From: Cris Di Sclafani
Date: Thu, 29 Oct 2020 08:49:25 +0000 (+0100)
Subject: Built motion from commit (unavailable).|2.5.4
X-Git-Url: http://repos.xcallymotion.com/base/%22angular-material.themes.css//%22javascript:void%28%27%7BtitleJs%7D%27%29/%22%22%29%20%27?a=commitdiff_plain;h=f7a313eedb31be573f83d0a6c6056e847f43e522;p=motion2.git
Built motion from commit (unavailable).|2.5.4
---
diff --git a/apidoc/api_project.js b/apidoc/api_project.js
index 35f07f0..0fc8f03 100644
--- a/apidoc/api_project.js
+++ b/apidoc/api_project.js
@@ -1 +1 @@
-define({
"name": "xCALLY Motion API",
"version": "2.5.4",
"description": "Thank you for choosing xCALLY MOTION, one of the first Omni Channel solution integrated with AsteriskTM and the most innovative real time solutions available on the market.",
"title": "xCALLY MOTION API",
"header": {
"title": "Introduction",
"content": "The API \nThis is the documentation for the xCALLY MOTION API.
\nWe make changes to the APIs from time to time. For more information, see Changelog .
\nThe xCALLY MOTION API consists of several different APIs. Use the left sidebar menu to select one.
\nThe API is a JSON API. XML is not supported. To learn more, see [Working with JSON].
\nEndpoints are documented with the HTTP method for the request and a partial resource identifier.\nExample:
\nGET /api/users\n \nPrepend your xCALLY URL to the resource identifier to get the full endpoint URL:
\nhttps://motion.xcally.com/api/users\n \nCurly braces, {}
, indicate values you have to supply. Example:
\nGET /api/users/{id}\n \nThe examples in the docs are cURL statements. You can run the statements on a command line to try out different API requests. To learn more, see [Installing and using cURL]. In Windows, you'll need to modify some of the examples in the docs to make them work. See [Using cURL in Windows].
\nThe examples use basic authentication requiring a xCALLY username and password.
\nSecurity and Authentication \nThis is an SSL-only API, regardless of how your account is configured. You can authorize against the API using either basic authentication with your username and password or with an OAuth access token or API Key.
\nClient-side CORS requests are supported if the request is authenticated with an OAuth access token. The requests are not supported if the request uses basic authentication or API Key.
\nBasic authentication \nUse the following authentication format with your username and password:\n{username}:{password}
\nExample:
\ncurl -u admin:password https://motion.xcally.com/api/users\n \nOAuth access token \nThe xCALLY API supports OAuth authorization flows.
\nOAuth access tokens also permit client-side API requests.
\nIn your requests, specify the access token in an Authorization header as follows:\nAuthorization: Bearer {token}
\nExample:
\ncurl -H \"Authorization: Bearer gErypPlm4dOVgGRvA1ZzMH5MQ3nLo8bo\" https://motion.xcally.com/api/users\n \nAPI Key \nIn your request, specify the API Key in apikey query parameter
\nExample:
\ncurl https://motion.xcally.com/api/users?apikey=eyJhbGciOiJIUzUxMiIsInR5cC...\n \nRequest Format \nThe xCALLY API is a JSON API. You must supply a Content-Type: application/json
header in PUT
and POST
requests. You must set an Accept: application/json
header on all requests. You may get a text/plain
response in case of an error like a bad request. You should treat this as an error you need to fix.
\nResponse Format \nThe xCALLY API responds to successful requests with HTTP status codes in the 200 or 300 range. When you create or update a resource, the API renders the resulting JSON representation in the response body.
\nResponses may have the status codes described in the following sections.
\n200 range \nThe request was successful. The status is 200 for successful GET and PUT requests, 201 for most POST requests, and 204 for DELETE requests.
\n400 range \nThe request was not successful. The content type of the response may be text/plain
for API-level error messages, such as when trying to call the API without SSL. The content type is application/json
for business-level error messages because the response includes a JSON object with information about the error.
\nIf you see a response from a known endpoint that looks like plain text, you probably made a syntax error in your request. This type of response commonly occurs when making a request to a nonexistent xCALLY Support instance.
\n500 range \nWhen building an API client, we recommend treating any 500 status codes as a warning or temporary state. However, if the status persists and we don't have a publicly announced maintenance or service disruption, contact us at support@xcally.com.
\nIf submitting a ticket to Support, provide the complete HTTP response. This helps the Support team track down the request in the logs more quickly.
\nData Types \nThe API returns and accepts JSON values, which can be strings in double quotes, numbers, objects, arrays, true or false, or null. Most programming languages have tools to parse this data.
\nID integers \nMost xCALLY Support resources such as queues and users are identified by the integer specified by the id attribute of API responses.
\nThe default numeric type in JavaScript, Ruby, Python, and PHP is sufficient to represent xCALLY Support ID integers.
\nTime stamps \nTime stamps use UTC time and are formatted as ISO 8601 strings. Example: 2017-04-16T09:14:57Z
\n"
},
"template": {
"withGenerator": false,
"withCompare": false,
"forceLanguage": "en"
},
"sampleUrl": false,
"defaultVersion": "0.0.0",
"apidoc": "0.3.0",
"generator": {
"name": "apidoc",
"time": "2020-10-29T07:48:42.174Z",
"url": "http://apidocjs.com",
"version": "0.19.0"
}
});
+define({
"name": "xCALLY Motion API",
"version": "2.5.4",
"description": "Thank you for choosing xCALLY MOTION, one of the first Omni Channel solution integrated with AsteriskTM and the most innovative real time solutions available on the market.",
"title": "xCALLY MOTION API",
"header": {
"title": "Introduction",
"content": "The API \nThis is the documentation for the xCALLY MOTION API.
\nWe make changes to the APIs from time to time. For more information, see Changelog .
\nThe xCALLY MOTION API consists of several different APIs. Use the left sidebar menu to select one.
\nThe API is a JSON API. XML is not supported. To learn more, see [Working with JSON].
\nEndpoints are documented with the HTTP method for the request and a partial resource identifier.\nExample:
\nGET /api/users\n \nPrepend your xCALLY URL to the resource identifier to get the full endpoint URL:
\nhttps://motion.xcally.com/api/users\n \nCurly braces, {}
, indicate values you have to supply. Example:
\nGET /api/users/{id}\n \nThe examples in the docs are cURL statements. You can run the statements on a command line to try out different API requests. To learn more, see [Installing and using cURL]. In Windows, you'll need to modify some of the examples in the docs to make them work. See [Using cURL in Windows].
\nThe examples use basic authentication requiring a xCALLY username and password.
\nSecurity and Authentication \nThis is an SSL-only API, regardless of how your account is configured. You can authorize against the API using either basic authentication with your username and password or with an OAuth access token or API Key.
\nClient-side CORS requests are supported if the request is authenticated with an OAuth access token. The requests are not supported if the request uses basic authentication or API Key.
\nBasic authentication \nUse the following authentication format with your username and password:\n{username}:{password}
\nExample:
\ncurl -u admin:password https://motion.xcally.com/api/users\n \nOAuth access token \nThe xCALLY API supports OAuth authorization flows.
\nOAuth access tokens also permit client-side API requests.
\nIn your requests, specify the access token in an Authorization header as follows:\nAuthorization: Bearer {token}
\nExample:
\ncurl -H \"Authorization: Bearer gErypPlm4dOVgGRvA1ZzMH5MQ3nLo8bo\" https://motion.xcally.com/api/users\n \nAPI Key \nIn your request, specify the API Key in apikey query parameter
\nExample:
\ncurl https://motion.xcally.com/api/users?apikey=eyJhbGciOiJIUzUxMiIsInR5cC...\n \nRequest Format \nThe xCALLY API is a JSON API. You must supply a Content-Type: application/json
header in PUT
and POST
requests. You must set an Accept: application/json
header on all requests. You may get a text/plain
response in case of an error like a bad request. You should treat this as an error you need to fix.
\nResponse Format \nThe xCALLY API responds to successful requests with HTTP status codes in the 200 or 300 range. When you create or update a resource, the API renders the resulting JSON representation in the response body.
\nResponses may have the status codes described in the following sections.
\n200 range \nThe request was successful. The status is 200 for successful GET and PUT requests, 201 for most POST requests, and 204 for DELETE requests.
\n400 range \nThe request was not successful. The content type of the response may be text/plain
for API-level error messages, such as when trying to call the API without SSL. The content type is application/json
for business-level error messages because the response includes a JSON object with information about the error.
\nIf you see a response from a known endpoint that looks like plain text, you probably made a syntax error in your request. This type of response commonly occurs when making a request to a nonexistent xCALLY Support instance.
\n500 range \nWhen building an API client, we recommend treating any 500 status codes as a warning or temporary state. However, if the status persists and we don't have a publicly announced maintenance or service disruption, contact us at support@xcally.com.
\nIf submitting a ticket to Support, provide the complete HTTP response. This helps the Support team track down the request in the logs more quickly.
\nData Types \nThe API returns and accepts JSON values, which can be strings in double quotes, numbers, objects, arrays, true or false, or null. Most programming languages have tools to parse this data.
\nID integers \nMost xCALLY Support resources such as queues and users are identified by the integer specified by the id attribute of API responses.
\nThe default numeric type in JavaScript, Ruby, Python, and PHP is sufficient to represent xCALLY Support ID integers.
\nTime stamps \nTime stamps use UTC time and are formatted as ISO 8601 strings. Example: 2017-04-16T09:14:57Z
\n"
},
"template": {
"withGenerator": false,
"withCompare": false,
"forceLanguage": "en"
},
"sampleUrl": false,
"defaultVersion": "0.0.0",
"apidoc": "0.3.0",
"generator": {
"name": "apidoc",
"time": "2020-10-29T08:42:00.866Z",
"url": "http://apidocjs.com",
"version": "0.19.0"
}
});
diff --git a/apidoc/api_project.json b/apidoc/api_project.json
index c621e57..6810bdf 100644
--- a/apidoc/api_project.json
+++ b/apidoc/api_project.json
@@ -1 +1 @@
-{
"name": "xCALLY Motion API",
"version": "2.5.4",
"description": "Thank you for choosing xCALLY MOTION, one of the first Omni Channel solution integrated with AsteriskTM and the most innovative real time solutions available on the market.",
"title": "xCALLY MOTION API",
"header": {
"title": "Introduction",
"content": "The API \nThis is the documentation for the xCALLY MOTION API.
\nWe make changes to the APIs from time to time. For more information, see Changelog .
\nThe xCALLY MOTION API consists of several different APIs. Use the left sidebar menu to select one.
\nThe API is a JSON API. XML is not supported. To learn more, see [Working with JSON].
\nEndpoints are documented with the HTTP method for the request and a partial resource identifier.\nExample:
\nGET /api/users\n \nPrepend your xCALLY URL to the resource identifier to get the full endpoint URL:
\nhttps://motion.xcally.com/api/users\n \nCurly braces, {}
, indicate values you have to supply. Example:
\nGET /api/users/{id}\n \nThe examples in the docs are cURL statements. You can run the statements on a command line to try out different API requests. To learn more, see [Installing and using cURL]. In Windows, you'll need to modify some of the examples in the docs to make them work. See [Using cURL in Windows].
\nThe examples use basic authentication requiring a xCALLY username and password.
\nSecurity and Authentication \nThis is an SSL-only API, regardless of how your account is configured. You can authorize against the API using either basic authentication with your username and password or with an OAuth access token or API Key.
\nClient-side CORS requests are supported if the request is authenticated with an OAuth access token. The requests are not supported if the request uses basic authentication or API Key.
\nBasic authentication \nUse the following authentication format with your username and password:\n{username}:{password}
\nExample:
\ncurl -u admin:password https://motion.xcally.com/api/users\n \nOAuth access token \nThe xCALLY API supports OAuth authorization flows.
\nOAuth access tokens also permit client-side API requests.
\nIn your requests, specify the access token in an Authorization header as follows:\nAuthorization: Bearer {token}
\nExample:
\ncurl -H \"Authorization: Bearer gErypPlm4dOVgGRvA1ZzMH5MQ3nLo8bo\" https://motion.xcally.com/api/users\n \nAPI Key \nIn your request, specify the API Key in apikey query parameter
\nExample:
\ncurl https://motion.xcally.com/api/users?apikey=eyJhbGciOiJIUzUxMiIsInR5cC...\n \nRequest Format \nThe xCALLY API is a JSON API. You must supply a Content-Type: application/json
header in PUT
and POST
requests. You must set an Accept: application/json
header on all requests. You may get a text/plain
response in case of an error like a bad request. You should treat this as an error you need to fix.
\nResponse Format \nThe xCALLY API responds to successful requests with HTTP status codes in the 200 or 300 range. When you create or update a resource, the API renders the resulting JSON representation in the response body.
\nResponses may have the status codes described in the following sections.
\n200 range \nThe request was successful. The status is 200 for successful GET and PUT requests, 201 for most POST requests, and 204 for DELETE requests.
\n400 range \nThe request was not successful. The content type of the response may be text/plain
for API-level error messages, such as when trying to call the API without SSL. The content type is application/json
for business-level error messages because the response includes a JSON object with information about the error.
\nIf you see a response from a known endpoint that looks like plain text, you probably made a syntax error in your request. This type of response commonly occurs when making a request to a nonexistent xCALLY Support instance.
\n500 range \nWhen building an API client, we recommend treating any 500 status codes as a warning or temporary state. However, if the status persists and we don't have a publicly announced maintenance or service disruption, contact us at support@xcally.com.
\nIf submitting a ticket to Support, provide the complete HTTP response. This helps the Support team track down the request in the logs more quickly.
\nData Types \nThe API returns and accepts JSON values, which can be strings in double quotes, numbers, objects, arrays, true or false, or null. Most programming languages have tools to parse this data.
\nID integers \nMost xCALLY Support resources such as queues and users are identified by the integer specified by the id attribute of API responses.
\nThe default numeric type in JavaScript, Ruby, Python, and PHP is sufficient to represent xCALLY Support ID integers.
\nTime stamps \nTime stamps use UTC time and are formatted as ISO 8601 strings. Example: 2017-04-16T09:14:57Z
\n"
},
"template": {
"withGenerator": false,
"withCompare": false,
"forceLanguage": "en"
},
"sampleUrl": false,
"defaultVersion": "0.0.0",
"apidoc": "0.3.0",
"generator": {
"name": "apidoc",
"time": "2020-10-29T07:48:42.174Z",
"url": "http://apidocjs.com",
"version": "0.19.0"
}
}
+{
"name": "xCALLY Motion API",
"version": "2.5.4",
"description": "Thank you for choosing xCALLY MOTION, one of the first Omni Channel solution integrated with AsteriskTM and the most innovative real time solutions available on the market.",
"title": "xCALLY MOTION API",
"header": {
"title": "Introduction",
"content": "The API \nThis is the documentation for the xCALLY MOTION API.
\nWe make changes to the APIs from time to time. For more information, see Changelog .
\nThe xCALLY MOTION API consists of several different APIs. Use the left sidebar menu to select one.
\nThe API is a JSON API. XML is not supported. To learn more, see [Working with JSON].
\nEndpoints are documented with the HTTP method for the request and a partial resource identifier.\nExample:
\nGET /api/users\n \nPrepend your xCALLY URL to the resource identifier to get the full endpoint URL:
\nhttps://motion.xcally.com/api/users\n \nCurly braces, {}
, indicate values you have to supply. Example:
\nGET /api/users/{id}\n \nThe examples in the docs are cURL statements. You can run the statements on a command line to try out different API requests. To learn more, see [Installing and using cURL]. In Windows, you'll need to modify some of the examples in the docs to make them work. See [Using cURL in Windows].
\nThe examples use basic authentication requiring a xCALLY username and password.
\nSecurity and Authentication \nThis is an SSL-only API, regardless of how your account is configured. You can authorize against the API using either basic authentication with your username and password or with an OAuth access token or API Key.
\nClient-side CORS requests are supported if the request is authenticated with an OAuth access token. The requests are not supported if the request uses basic authentication or API Key.
\nBasic authentication \nUse the following authentication format with your username and password:\n{username}:{password}
\nExample:
\ncurl -u admin:password https://motion.xcally.com/api/users\n \nOAuth access token \nThe xCALLY API supports OAuth authorization flows.
\nOAuth access tokens also permit client-side API requests.
\nIn your requests, specify the access token in an Authorization header as follows:\nAuthorization: Bearer {token}
\nExample:
\ncurl -H \"Authorization: Bearer gErypPlm4dOVgGRvA1ZzMH5MQ3nLo8bo\" https://motion.xcally.com/api/users\n \nAPI Key \nIn your request, specify the API Key in apikey query parameter
\nExample:
\ncurl https://motion.xcally.com/api/users?apikey=eyJhbGciOiJIUzUxMiIsInR5cC...\n \nRequest Format \nThe xCALLY API is a JSON API. You must supply a Content-Type: application/json
header in PUT
and POST
requests. You must set an Accept: application/json
header on all requests. You may get a text/plain
response in case of an error like a bad request. You should treat this as an error you need to fix.
\nResponse Format \nThe xCALLY API responds to successful requests with HTTP status codes in the 200 or 300 range. When you create or update a resource, the API renders the resulting JSON representation in the response body.
\nResponses may have the status codes described in the following sections.
\n200 range \nThe request was successful. The status is 200 for successful GET and PUT requests, 201 for most POST requests, and 204 for DELETE requests.
\n400 range \nThe request was not successful. The content type of the response may be text/plain
for API-level error messages, such as when trying to call the API without SSL. The content type is application/json
for business-level error messages because the response includes a JSON object with information about the error.
\nIf you see a response from a known endpoint that looks like plain text, you probably made a syntax error in your request. This type of response commonly occurs when making a request to a nonexistent xCALLY Support instance.
\n500 range \nWhen building an API client, we recommend treating any 500 status codes as a warning or temporary state. However, if the status persists and we don't have a publicly announced maintenance or service disruption, contact us at support@xcally.com.
\nIf submitting a ticket to Support, provide the complete HTTP response. This helps the Support team track down the request in the logs more quickly.
\nData Types \nThe API returns and accepts JSON values, which can be strings in double quotes, numbers, objects, arrays, true or false, or null. Most programming languages have tools to parse this data.
\nID integers \nMost xCALLY Support resources such as queues and users are identified by the integer specified by the id attribute of API responses.
\nThe default numeric type in JavaScript, Ruby, Python, and PHP is sufficient to represent xCALLY Support ID integers.
\nTime stamps \nTime stamps use UTC time and are formatted as ISO 8601 strings. Example: 2017-04-16T09:14:57Z
\n"
},
"template": {
"withGenerator": false,
"withCompare": false,
"forceLanguage": "en"
},
"sampleUrl": false,
"defaultVersion": "0.0.0",
"apidoc": "0.3.0",
"generator": {
"name": "apidoc",
"time": "2020-10-29T08:42:00.866Z",
"url": "http://apidocjs.com",
"version": "0.19.0"
}
}
diff --git a/server/api/action/action.attributes.js b/server/api/action/action.attributes.js
index 9771996..952aec7 100644
--- a/server/api/action/action.attributes.js
+++ b/server/api/action/action.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9fcb=['STRING','integration','motionbar','urlForward','bot','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','contactManager[ListId],\x20integration[intName(zendesk)],\x20motionbar[Popup(0),URL(1),WinApp(2)],\x20urlForward[GET,POST],\x20browser[TemplateId(0),URL(1)]','integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20urlForward[URL]','TEXT','exports','VIRTUAL','action'];(function(_0x547915,_0x43591c){var _0x8c935=function(_0x3b3359){while(--_0x3b3359){_0x547915['push'](_0x547915['shift']());}};_0x8c935(++_0x43591c);}(_0x9fcb,0x14d));var _0xb9fc=function(_0x30f278,_0x204e08){_0x30f278=_0x30f278-0x0;var _0x6b36cc=_0x9fcb[_0x30f278];return _0x6b36cc;};'use strict';var Sequelize=require('sequelize');module[_0xb9fc('0x0')]={'name':{'type':Sequelize[_0xb9fc('0x1')],'get':function(_0x5046e0){return this['getDataValue'](_0xb9fc('0x2'));}},'action':{'type':Sequelize[_0xb9fc('0x3')],'allowNull':![],'validate':{'isIn':{'args':[['contactManager',_0xb9fc('0x4'),_0xb9fc('0x5'),'jscripty',_0xb9fc('0x6'),'browser',_0xb9fc('0x7'),'script']],'msg':_0xb9fc('0x8')}},'comment':_0xb9fc('0x8')},'data1':{'type':Sequelize[_0xb9fc('0x3')](0x1000),'comment':_0xb9fc('0x9')},'data2':{'type':Sequelize['STRING'](0x1000),'comment':_0xb9fc('0xa')},'data3':{'type':Sequelize[_0xb9fc('0x3')](0x1000),'comment':'motionbar[NULL,NULL,WinAppArguments]'},'data4':{'type':Sequelize[_0xb9fc('0x3')](0x1000)},'data5':{'type':Sequelize[_0xb9fc('0x3')](0x1000)},'data6':{'type':Sequelize[_0xb9fc('0x3')]},'data7':{'type':Sequelize[_0xb9fc('0xb')]}};
\ No newline at end of file
+var _0x0ff6=['browser','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','contactManager[ListId],\x20integration[intName(zendesk)],\x20motionbar[Popup(0),URL(1),WinApp(2)],\x20urlForward[GET,POST],\x20browser[TemplateId(0),URL(1)]','integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20urlForward[URL]','motionbar[NULL,NULL,WinAppArguments]','sequelize','VIRTUAL','getDataValue','action','STRING','contactManager','integration','motionbar','jscripty','urlForward'];(function(_0xe295a8,_0x39b1db){var _0x238ea5=function(_0x227f49){while(--_0x227f49){_0xe295a8['push'](_0xe295a8['shift']());}};_0x238ea5(++_0x39b1db);}(_0x0ff6,0x96));var _0x60ff=function(_0x74a0c6,_0x327fee){_0x74a0c6=_0x74a0c6-0x0;var _0x2fb098=_0x0ff6[_0x74a0c6];return _0x2fb098;};'use strict';var Sequelize=require(_0x60ff('0x0'));module['exports']={'name':{'type':Sequelize[_0x60ff('0x1')],'get':function(_0x347337){return this[_0x60ff('0x2')](_0x60ff('0x3'));}},'action':{'type':Sequelize[_0x60ff('0x4')],'allowNull':![],'validate':{'isIn':{'args':[[_0x60ff('0x5'),_0x60ff('0x6'),_0x60ff('0x7'),_0x60ff('0x8'),_0x60ff('0x9'),_0x60ff('0xa'),'bot',_0x60ff('0xb')]],'msg':_0x60ff('0xc')}},'comment':_0x60ff('0xc')},'data1':{'type':Sequelize[_0x60ff('0x4')](0x1000),'comment':_0x60ff('0xd')},'data2':{'type':Sequelize['STRING'](0x1000),'comment':_0x60ff('0xe')},'data3':{'type':Sequelize['STRING'](0x1000),'comment':_0x60ff('0xf')},'data4':{'type':Sequelize[_0x60ff('0x4')](0x1000)},'data5':{'type':Sequelize[_0x60ff('0x4')](0x1000)},'data6':{'type':Sequelize['STRING']},'data7':{'type':Sequelize['TEXT']}};
\ No newline at end of file
diff --git a/server/api/action/action.controller.js b/server/api/action/action.controller.js
index e629aa2..7f1c781 100644
--- a/server/api/action/action.controller.js
+++ b/server/api/action/action.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x4545=['update','then','destroy','error','name','body','Action','find','catch','eml-format','rimraf','zip-dir','moment','mustache','util','path','ejs','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/environment','sendStatus','end','status','json','count','offset','limit','Content-Range','reject','save'];(function(_0x91151f,_0x163244){var _0x20c557=function(_0x5bd7bb){while(--_0x5bd7bb){_0x91151f['push'](_0x91151f['shift']());}};_0x20c557(++_0x163244);}(_0x4545,0xd1));var _0x5454=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x4545[_0x4a9fb1];return _0x348672;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x5454('0x0'));var rimraf=require(_0x5454('0x1'));var zipdir=require(_0x5454('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x5454('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x5454('0x4'));var util=require(_0x5454('0x5'));var path=require(_0x5454('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x5454('0x7'));var fs=require('fs');var _=require(_0x5454('0x8'));var squel=require('squel');var crypto=require(_0x5454('0x9'));var jsforce=require(_0x5454('0xa'));var deskjs=require(_0x5454('0xb'));var toCsv=require(_0x5454('0xc'));var querystring=require(_0x5454('0xd'));var Papa=require(_0x5454('0xe'));var Redis=require(_0x5454('0xf'));var authService=require(_0x5454('0x10'));var qs=require(_0x5454('0x11'));var as=require(_0x5454('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x5454('0x13'));var utils=require('../../config/utils');var config=require(_0x5454('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2eb88a,_0x24f3f1){_0x24f3f1=_0x24f3f1||0xcc;return function(_0x49cdf3){if(_0x49cdf3){return _0x2eb88a[_0x5454('0x15')](_0x24f3f1);}return _0x2eb88a['status'](_0x24f3f1)[_0x5454('0x16')]();};}function respondWithResult(_0x11e0af,_0x38d51e){_0x38d51e=_0x38d51e||0xc8;return function(_0x2fc1d2){if(_0x2fc1d2){return _0x11e0af[_0x5454('0x17')](_0x38d51e)[_0x5454('0x18')](_0x2fc1d2);}};}function respondWithFilteredResult(_0x12153b,_0x4eca99){return function(_0x5cc54d){if(_0x5cc54d){var _0x50bbcd=_0x5cc54d[_0x5454('0x19')],_0x311f2c=_0x4eca99[_0x5454('0x1a')],_0x51e1fb=_0x4eca99['offset']+_0x4eca99[_0x5454('0x1b')],_0x2a2068;if(_0x51e1fb>=_0x50bbcd){_0x51e1fb=_0x50bbcd;_0x2a2068=0xc8;}else{_0x2a2068=0xce;}_0x12153b['status'](_0x2a2068);return _0x12153b['set'](_0x5454('0x1c'),_0x311f2c+'-'+_0x51e1fb+'/'+_0x50bbcd)[_0x5454('0x18')](_0x5cc54d);}return null;};}function patchUpdates(_0x321d32){return function(_0xa95a44){try{jsonpatch['apply'](_0xa95a44,_0x321d32,!![]);}catch(_0x5cbe8e){return BPromise[_0x5454('0x1d')](_0x5cbe8e);}return _0xa95a44[_0x5454('0x1e')]();};}function saveUpdates(_0x277664,_0x526fd9){return function(_0x4d3b46){if(_0x4d3b46){return _0x4d3b46[_0x5454('0x1f')](_0x277664)[_0x5454('0x20')](function(_0xa79148){return _0xa79148;});}return null;};}function removeEntity(_0x366c02,_0x43e219){return function(_0xbc81a6){if(_0xbc81a6){return _0xbc81a6[_0x5454('0x21')]()[_0x5454('0x20')](function(){_0x366c02[_0x5454('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2d78a5,_0x498a0b){return function(_0x3f8849){if(!_0x3f8849){_0x2d78a5[_0x5454('0x15')](0x194);}return _0x3f8849;};}function handleError(_0x198792,_0xc02480){_0xc02480=_0xc02480||0x1f4;return function(_0x475033){logger[_0x5454('0x22')](_0x475033['stack']);if(_0x475033[_0x5454('0x23')]){delete _0x475033[_0x5454('0x23')];}_0x198792['status'](_0xc02480)['send'](_0x475033);};}exports[_0x5454('0x1f')]=function(_0x1407c0,_0x539f19){if(_0x1407c0[_0x5454('0x24')]['id']){delete _0x1407c0['body']['id'];}return db[_0x5454('0x25')][_0x5454('0x26')]({'where':{'id':_0x1407c0['params']['id']}})[_0x5454('0x20')](handleEntityNotFound(_0x539f19,null))[_0x5454('0x20')](saveUpdates(_0x1407c0[_0x5454('0x24')],null))[_0x5454('0x20')](respondWithResult(_0x539f19,null))[_0x5454('0x27')](handleError(_0x539f19,null));};exports[_0x5454('0x21')]=function(_0x27fc0e,_0x4ab0e1){return db[_0x5454('0x25')][_0x5454('0x26')]({'where':{'id':_0x27fc0e['params']['id']}})[_0x5454('0x20')](handleEntityNotFound(_0x4ab0e1,null))[_0x5454('0x20')](removeEntity(_0x4ab0e1,null))[_0x5454('0x27')](handleError(_0x4ab0e1,null));};
\ No newline at end of file
+var _0xcb5f=['ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','status','end','json','count','offset','limit','set','apply','reject','update','destroy','then','sendStatus','error','stack','name','body','Action','find','params','catch','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv'];(function(_0x1b6186,_0x1ec7f2){var _0x186121=function(_0x1748a8){while(--_0x1748a8){_0x1b6186['push'](_0x1b6186['shift']());}};_0x186121(++_0x1ec7f2);}(_0xcb5f,0x10e));var _0xfcb5=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xcb5f[_0x321bb2];return _0x9c12ed;};'use strict';var pdf=require(_0xfcb5('0x0'));var emlformat=require(_0xfcb5('0x1'));var rimraf=require(_0xfcb5('0x2'));var zipdir=require(_0xfcb5('0x3'));var jsonpatch=require(_0xfcb5('0x4'));var rp=require(_0xfcb5('0x5'));var moment=require('moment');var BPromise=require(_0xfcb5('0x6'));var Mustache=require(_0xfcb5('0x7'));var util=require(_0xfcb5('0x8'));var path=require(_0xfcb5('0x9'));var sox=require(_0xfcb5('0xa'));var csv=require(_0xfcb5('0xb'));var ejs=require(_0xfcb5('0xc'));var fs=require('fs');var _=require(_0xfcb5('0xd'));var squel=require(_0xfcb5('0xe'));var crypto=require(_0xfcb5('0xf'));var jsforce=require(_0xfcb5('0x10'));var deskjs=require(_0xfcb5('0x11'));var toCsv=require('to-csv');var querystring=require(_0xfcb5('0x12'));var Papa=require('papaparse');var Redis=require(_0xfcb5('0x13'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xfcb5('0x14'));var hardwareService=require(_0xfcb5('0x15'));var logger=require(_0xfcb5('0x16'))(_0xfcb5('0x17'));var utils=require('../../config/utils');var config=require(_0xfcb5('0x18'));var db=require(_0xfcb5('0x19'))['db'];function respondWithStatusCode(_0x1702eb,_0x2035bb){_0x2035bb=_0x2035bb||0xcc;return function(_0x58d514){if(_0x58d514){return _0x1702eb['sendStatus'](_0x2035bb);}return _0x1702eb[_0xfcb5('0x1a')](_0x2035bb)[_0xfcb5('0x1b')]();};}function respondWithResult(_0x57bbd4,_0x186932){_0x186932=_0x186932||0xc8;return function(_0x3db906){if(_0x3db906){return _0x57bbd4[_0xfcb5('0x1a')](_0x186932)[_0xfcb5('0x1c')](_0x3db906);}};}function respondWithFilteredResult(_0x12fe28,_0x44f95d){return function(_0x10443e){if(_0x10443e){var _0x13b671=_0x10443e[_0xfcb5('0x1d')],_0x37e6b8=_0x44f95d[_0xfcb5('0x1e')],_0x1d871c=_0x44f95d[_0xfcb5('0x1e')]+_0x44f95d[_0xfcb5('0x1f')],_0xadd087;if(_0x1d871c>=_0x13b671){_0x1d871c=_0x13b671;_0xadd087=0xc8;}else{_0xadd087=0xce;}_0x12fe28[_0xfcb5('0x1a')](_0xadd087);return _0x12fe28[_0xfcb5('0x20')]('Content-Range',_0x37e6b8+'-'+_0x1d871c+'/'+_0x13b671)[_0xfcb5('0x1c')](_0x10443e);}return null;};}function patchUpdates(_0x37ba2e){return function(_0x40a0d5){try{jsonpatch[_0xfcb5('0x21')](_0x40a0d5,_0x37ba2e,!![]);}catch(_0xddff66){return BPromise[_0xfcb5('0x22')](_0xddff66);}return _0x40a0d5['save']();};}function saveUpdates(_0xb966c8,_0x56a141){return function(_0xb397cb){if(_0xb397cb){return _0xb397cb[_0xfcb5('0x23')](_0xb966c8)['then'](function(_0x56c518){return _0x56c518;});}return null;};}function removeEntity(_0x5bf078,_0xc2865d){return function(_0x13c889){if(_0x13c889){return _0x13c889[_0xfcb5('0x24')]()[_0xfcb5('0x25')](function(){_0x5bf078[_0xfcb5('0x1a')](0xcc)[_0xfcb5('0x1b')]();});}};}function handleEntityNotFound(_0x26185c,_0x370007){return function(_0x2c5b53){if(!_0x2c5b53){_0x26185c[_0xfcb5('0x26')](0x194);}return _0x2c5b53;};}function handleError(_0x131da8,_0x55cce1){_0x55cce1=_0x55cce1||0x1f4;return function(_0x53e4d2){logger[_0xfcb5('0x27')](_0x53e4d2[_0xfcb5('0x28')]);if(_0x53e4d2[_0xfcb5('0x29')]){delete _0x53e4d2['name'];}_0x131da8[_0xfcb5('0x1a')](_0x55cce1)['send'](_0x53e4d2);};}exports[_0xfcb5('0x23')]=function(_0x1ee08d,_0x468331){if(_0x1ee08d['body']['id']){delete _0x1ee08d[_0xfcb5('0x2a')]['id'];}return db[_0xfcb5('0x2b')][_0xfcb5('0x2c')]({'where':{'id':_0x1ee08d[_0xfcb5('0x2d')]['id']}})['then'](handleEntityNotFound(_0x468331,null))[_0xfcb5('0x25')](saveUpdates(_0x1ee08d[_0xfcb5('0x2a')],null))['then'](respondWithResult(_0x468331,null))['catch'](handleError(_0x468331,null));};exports['destroy']=function(_0x1ecf5c,_0x450f79){return db[_0xfcb5('0x2b')]['find']({'where':{'id':_0x1ecf5c['params']['id']}})[_0xfcb5('0x25')](handleEntityNotFound(_0x450f79,null))[_0xfcb5('0x25')](removeEntity(_0x450f79,null))[_0xfcb5('0x2e')](handleError(_0x450f79,null));};
\ No newline at end of file
diff --git a/server/api/action/action.model.js b/server/api/action/action.model.js
index 74f4ee1..da952d4 100644
--- a/server/api/action/action.model.js
+++ b/server/api/action/action.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x91d8=['bluebird','request-promise','path','rimraf','../../config/environment','./action.attributes','exports','define','Action','tools_actions','lodash','../../config/logger','api','moment'];(function(_0x5497f7,_0x431f2b){var _0x59b3f1=function(_0x3cde8b){while(--_0x3cde8b){_0x5497f7['push'](_0x5497f7['shift']());}};_0x59b3f1(++_0x431f2b);}(_0x91d8,0x96));var _0x891d=function(_0x44931a,_0x379717){_0x44931a=_0x44931a-0x0;var _0xf687de=_0x91d8[_0x44931a];return _0xf687de;};'use strict';var _=require(_0x891d('0x0'));var util=require('util');var logger=require(_0x891d('0x1'))(_0x891d('0x2'));var moment=require(_0x891d('0x3'));var BPromise=require(_0x891d('0x4'));var rp=require(_0x891d('0x5'));var fs=require('fs');var path=require(_0x891d('0x6'));var rimraf=require(_0x891d('0x7'));var config=require(_0x891d('0x8'));var attributes=require(_0x891d('0x9'));module[_0x891d('0xa')]=function(_0x10df51,_0x33cc82){return _0x10df51[_0x891d('0xb')](_0x891d('0xc'),attributes,{'tableName':_0x891d('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xf9e1=['../../config/environment','./action.attributes','exports','define','Action','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf'];(function(_0x1324f2,_0x54accc){var _0x5260b4=function(_0x4fc82f){while(--_0x4fc82f){_0x1324f2['push'](_0x1324f2['shift']());}};_0x5260b4(++_0x54accc);}(_0xf9e1,0xe2));var _0x1f9e=function(_0x571644,_0x41f832){_0x571644=_0x571644-0x0;var _0x3269a6=_0xf9e1[_0x571644];return _0x3269a6;};'use strict';var _=require(_0x1f9e('0x0'));var util=require(_0x1f9e('0x1'));var logger=require(_0x1f9e('0x2'))('api');var moment=require(_0x1f9e('0x3'));var BPromise=require(_0x1f9e('0x4'));var rp=require(_0x1f9e('0x5'));var fs=require('fs');var path=require(_0x1f9e('0x6'));var rimraf=require(_0x1f9e('0x7'));var config=require(_0x1f9e('0x8'));var attributes=require(_0x1f9e('0x9'));module[_0x1f9e('0xa')]=function(_0x4f6213,_0x19357e){return _0x4f6213[_0x1f9e('0xb')](_0x1f9e('0xc'),attributes,{'tableName':'tools_actions','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/action/action.rpc.js b/server/api/action/action.rpc.js
index 9a86b61..94875d4 100644
--- a/server/api/action/action.rpc.js
+++ b/server/api/action/action.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xd8b0=['../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','then','info','Action,\x20%s,\x20%s','request\x20sent','debug','Action,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','ioredis'];(function(_0x259e77,_0x52f430){var _0x1f93bd=function(_0x3c9ffe){while(--_0x3c9ffe){_0x259e77['push'](_0x259e77['shift']());}};_0x1f93bd(++_0x52f430);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0d8b('0x2'));var db=require(_0x0d8b('0x3'))['db'];var utils=require(_0x0d8b('0x4'));var logger=require(_0x0d8b('0x5'))(_0x0d8b('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x0d8b('0x7')][_0x0d8b('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x39f43a,_0x4a4470,_0x413284){return new BPromise(function(_0x284169,_0x58e4e2){return client[_0x0d8b('0x9')](_0x39f43a,_0x413284)[_0x0d8b('0xa')](function(_0x3b027f){logger[_0x0d8b('0xb')](_0x0d8b('0xc'),_0x4a4470,_0x0d8b('0xd'));logger[_0x0d8b('0xe')](_0x0d8b('0xf'),_0x4a4470,'request\x20sent',JSON[_0x0d8b('0x10')](_0x3b027f));if(_0x3b027f['error']){if(_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x12')]===0x1f4){logger[_0x0d8b('0x11')](_0x0d8b('0xc'),_0x4a4470,_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x13')]);return _0x58e4e2(_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x13')]);}logger[_0x0d8b('0x11')](_0x0d8b('0xc'),_0x4a4470,_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x13')]);return _0x284169(_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x13')]);}else{logger['info'](_0x0d8b('0xc'),_0x4a4470,_0x0d8b('0xd'));_0x284169(_0x3b027f[_0x0d8b('0x14')][_0x0d8b('0x13')]);}})[_0x0d8b('0x15')](function(_0x5cd485){logger[_0x0d8b('0x11')](_0x0d8b('0xc'),_0x4a4470,_0x5cd485);_0x58e4e2(_0x5cd485);});});}
\ No newline at end of file
+var _0xcb91=['stringify','error','code','message','catch','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','info','Action,\x20%s,\x20%s','request\x20sent','debug','Action,\x20%s,\x20%s,\x20%s'];(function(_0x2be133,_0x48a819){var _0x260334=function(_0x14f985){while(--_0x14f985){_0x2be133['push'](_0x2be133['shift']());}};_0x260334(++_0x48a819);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x4b4d43,_0x1590f7){_0x4b4d43=_0x4b4d43-0x0;var _0x5706ba=_0xcb91[_0x4b4d43];return _0x5706ba;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x1cb9('0x0'));var BPromise=require(_0x1cb9('0x1'));var rs=require(_0x1cb9('0x2'));var fs=require('fs');var Redis=require(_0x1cb9('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x1cb9('0x4'));var logger=require(_0x1cb9('0x5'))('rpc');var config=require(_0x1cb9('0x6'));var jayson=require(_0x1cb9('0x7'));var client=jayson['client'][_0x1cb9('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3f7deb,_0x4ffe20,_0x38737d){return new BPromise(function(_0x12567c,_0x59d1be){return client[_0x1cb9('0x9')](_0x3f7deb,_0x38737d)['then'](function(_0x567139){logger[_0x1cb9('0xa')](_0x1cb9('0xb'),_0x4ffe20,_0x1cb9('0xc'));logger[_0x1cb9('0xd')](_0x1cb9('0xe'),_0x4ffe20,'request\x20sent',JSON[_0x1cb9('0xf')](_0x567139));if(_0x567139[_0x1cb9('0x10')]){if(_0x567139[_0x1cb9('0x10')][_0x1cb9('0x11')]===0x1f4){logger[_0x1cb9('0x10')]('Action,\x20%s,\x20%s',_0x4ffe20,_0x567139['error']['message']);return _0x59d1be(_0x567139[_0x1cb9('0x10')][_0x1cb9('0x12')]);}logger[_0x1cb9('0x10')](_0x1cb9('0xb'),_0x4ffe20,_0x567139['error'][_0x1cb9('0x12')]);return _0x12567c(_0x567139[_0x1cb9('0x10')][_0x1cb9('0x12')]);}else{logger[_0x1cb9('0xa')](_0x1cb9('0xb'),_0x4ffe20,'request\x20sent');_0x12567c(_0x567139['result'][_0x1cb9('0x12')]);}})[_0x1cb9('0x13')](function(_0x3904b7){logger[_0x1cb9('0x10')](_0x1cb9('0xb'),_0x4ffe20,_0x3904b7);_0x59d1be(_0x3904b7);});});}
\ No newline at end of file
diff --git a/server/api/action/index.js b/server/api/action/index.js
index c151262..2ce09b9 100644
--- a/server/api/action/index.js
+++ b/server/api/action/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x0bb6=['delete','destroy','exports','util','express','../../components/interaction/service','../../config/environment','./action.controller','/:id','isAuthenticated','update'];(function(_0x1111ac,_0x27f3d9){var _0x2b30c6=function(_0xaa7256){while(--_0xaa7256){_0x1111ac['push'](_0x1111ac['shift']());}};_0x2b30c6(++_0x27f3d9);}(_0x0bb6,0xb3));var _0x60bb=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0x0bb6[_0x19950b];return _0x3c6b41;};'use strict';var multer=require('multer');var util=require(_0x60bb('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x60bb('0x1'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x60bb('0x2'));var config=require(_0x60bb('0x3'));var controller=require(_0x60bb('0x4'));router['put'](_0x60bb('0x5'),auth[_0x60bb('0x6')](),controller[_0x60bb('0x7')]);router[_0x60bb('0x8')](_0x60bb('0x5'),auth[_0x60bb('0x6')](),controller[_0x60bb('0x9')]);module[_0x60bb('0xa')]=router;
\ No newline at end of file
+var _0x463a=['multer','util','path','connect-timeout','express','Router','../../components/auth/service','/:id','update','isAuthenticated'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x463a,0x190));var _0xa463=function(_0x2b5eae,_0x55010d){_0x2b5eae=_0x2b5eae-0x0;var _0x5f3ac9=_0x463a[_0x2b5eae];return _0x5f3ac9;};'use strict';var multer=require(_0xa463('0x0'));var util=require(_0xa463('0x1'));var path=require(_0xa463('0x2'));var timeout=require(_0xa463('0x3'));var express=require(_0xa463('0x4'));var router=express[_0xa463('0x5')]();var auth=require(_0xa463('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./action.controller');router['put'](_0xa463('0x7'),auth['isAuthenticated'](),controller[_0xa463('0x8')]);router['delete'](_0xa463('0x7'),auth[_0xa463('0x9')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.attributes.js b/server/api/analyticCustomReport/analyticCustomReport.attributes.js
index f99da77..e3de946 100644
--- a/server/api/analyticCustomReport/analyticCustomReport.attributes.js
+++ b/server/api/analyticCustomReport/analyticCustomReport.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x1b24=['STRING','TEXT','sequelize','exports'];(function(_0x128bef,_0xc7a0af){var _0x1ba862=function(_0x4858e8){while(--_0x4858e8){_0x128bef['push'](_0x128bef['shift']());}};_0x1ba862(++_0xc7a0af);}(_0x1b24,0xfa));var _0x41b2=function(_0x2cf930,_0x3d8b3d){_0x2cf930=_0x2cf930-0x0;var _0x125bf9=_0x1b24[_0x2cf930];return _0x125bf9;};'use strict';var Sequelize=require(_0x41b2('0x0'));module[_0x41b2('0x1')]={'name':{'type':Sequelize[_0x41b2('0x2')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize[_0x41b2('0x2')]},'table':{'type':Sequelize['STRING']},'conditions':{'type':Sequelize[_0x41b2('0x3')]},'joins':{'type':Sequelize['TEXT']}};
\ No newline at end of file
+var _0x0984=['TEXT','sequelize','STRING'];(function(_0x15a238,_0xdc6ea1){var _0x506955=function(_0x2b4e71){while(--_0x2b4e71){_0x15a238['push'](_0x15a238['shift']());}};_0x506955(++_0xdc6ea1);}(_0x0984,0x67));var _0x4098=function(_0x428952,_0x1d8b68){_0x428952=_0x428952-0x0;var _0x4283bb=_0x0984[_0x428952];return _0x4283bb;};'use strict';var Sequelize=require(_0x4098('0x0'));module['exports']={'name':{'type':Sequelize[_0x4098('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x4098('0x1')]},'parent':{'type':Sequelize[_0x4098('0x1')]},'table':{'type':Sequelize['STRING']},'conditions':{'type':Sequelize[_0x4098('0x2')]},'joins':{'type':Sequelize[_0x4098('0x2')]}};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.controller.js b/server/api/analyticCustomReport/analyticCustomReport.controller.js
index 323a409..5278b39 100644
--- a/server/api/analyticCustomReport/analyticCustomReport.controller.js
+++ b/server/api/analyticCustomReport/analyticCustomReport.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x3cfb=['filters','model','attributes','intersection','fields','length','nolimit','order','sort','merge','where','VIRTUAL','options','include','findAll','rows','catch','params','rawAttributes','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','join','left_join','right_join','cross_join','SUM(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','value','getFields','Sequelize','ValidationErrorItem','AnalyticMetric','keyBy','select','from','MetricId','metric','function','replace','format','groupBy','orderBy','alias','joins','parentKey','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','table','conditions','parse','clone','sequelize','toString','QueryTypes','SELECT','COUNT(%s)','MIN(%s)','IS\x20NULL','debug','Limited\x20Query:','No\x20available\x20data','output','fullPath','%s-%s.%s','randomstring','generate','csv','custom','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','endDate','info','Run\x20Query:','child_process','fork','../../components/export/','../../files/reports','savename','countTable','COUNT(*)','runReport','AVG(%s)','DESC','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','ejs','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','dbH','sendStatus','status','json','count','offset','limit','Content-Range','reject','save','update','then','destroy','get','CustomReports','UserProfileResource','end','error','stack','name','send','index','AnalyticCustomReport','type','key','map','query','keys'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x3cfb,0x1b8));var _0xb3cf=function(_0x272757,_0x4a5890){_0x272757=_0x272757-0x0;var _0x27d9d9=_0x3cfb[_0x272757];return _0x27d9d9;};'use strict';var pdf=require(_0xb3cf('0x0'));var emlformat=require(_0xb3cf('0x1'));var rimraf=require(_0xb3cf('0x2'));var zipdir=require(_0xb3cf('0x3'));var jsonpatch=require(_0xb3cf('0x4'));var rp=require(_0xb3cf('0x5'));var moment=require(_0xb3cf('0x6'));var BPromise=require(_0xb3cf('0x7'));var Mustache=require('mustache');var util=require(_0xb3cf('0x8'));var path=require(_0xb3cf('0x9'));var sox=require(_0xb3cf('0xa'));var csv=require('to-csv');var ejs=require(_0xb3cf('0xb'));var fs=require('fs');var _=require(_0xb3cf('0xc'));var squel=require(_0xb3cf('0xd'));var crypto=require('crypto');var jsforce=require(_0xb3cf('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xb3cf('0xf'));var Papa=require(_0xb3cf('0x10'));var Redis=require(_0xb3cf('0x11'));var authService=require(_0xb3cf('0x12'));var qs=require(_0xb3cf('0x13'));var as=require(_0xb3cf('0x14'));var hardwareService=require(_0xb3cf('0x15'));var logger=require(_0xb3cf('0x16'))(_0xb3cf('0x17'));var utils=require(_0xb3cf('0x18'));var config=require(_0xb3cf('0x19'));var db=require(_0xb3cf('0x1a'))['db'];var dbH=require(_0xb3cf('0x1a'))[_0xb3cf('0x1b')];function respondWithStatusCode(_0x16bb17,_0x530325){_0x530325=_0x530325||0xcc;return function(_0x495b2a){if(_0x495b2a){return _0x16bb17[_0xb3cf('0x1c')](_0x530325);}return _0x16bb17[_0xb3cf('0x1d')](_0x530325)['end']();};}function respondWithResult(_0x21ce6c,_0x510bae){_0x510bae=_0x510bae||0xc8;return function(_0x5c7a5c){if(_0x5c7a5c){return _0x21ce6c[_0xb3cf('0x1d')](_0x510bae)[_0xb3cf('0x1e')](_0x5c7a5c);}};}function respondWithFilteredResult(_0x2eff5c,_0x56f703){return function(_0x17e8cd){if(_0x17e8cd){var _0x87f87=_0x17e8cd[_0xb3cf('0x1f')],_0x3abe89=_0x56f703[_0xb3cf('0x20')],_0x442fd6=_0x56f703[_0xb3cf('0x20')]+_0x56f703[_0xb3cf('0x21')],_0x2afac9;if(_0x442fd6>=_0x87f87){_0x442fd6=_0x87f87;_0x2afac9=0xc8;}else{_0x2afac9=0xce;}_0x2eff5c[_0xb3cf('0x1d')](_0x2afac9);return _0x2eff5c['set'](_0xb3cf('0x22'),_0x3abe89+'-'+_0x442fd6+'/'+_0x87f87)[_0xb3cf('0x1e')](_0x17e8cd);}return null;};}function patchUpdates(_0x35fb62){return function(_0x416910){try{jsonpatch['apply'](_0x416910,_0x35fb62,!![]);}catch(_0x25d2f0){return BPromise[_0xb3cf('0x23')](_0x25d2f0);}return _0x416910[_0xb3cf('0x24')]();};}function saveUpdates(_0x1dfbc3,_0x283249){return function(_0x2ee4a0){if(_0x2ee4a0){return _0x2ee4a0[_0xb3cf('0x25')](_0x1dfbc3)[_0xb3cf('0x26')](function(_0x33ed8f){return _0x33ed8f;});}return null;};}function removeEntity(_0x1bfe02,_0x4c96fd){return function(_0x227360){if(_0x227360){return _0x227360[_0xb3cf('0x27')]()[_0xb3cf('0x26')](function(){var _0x203ce3=_0x227360[_0xb3cf('0x28')]({'plain':!![]});var _0x402d3e=_0xb3cf('0x29');return db[_0xb3cf('0x2a')][_0xb3cf('0x27')]({'where':{'type':_0x402d3e,'resourceId':_0x203ce3['id']}})[_0xb3cf('0x26')](function(){return _0x227360;});})['then'](function(){_0x1bfe02[_0xb3cf('0x1d')](0xcc)[_0xb3cf('0x2b')]();});}};}function handleEntityNotFound(_0x1662e5,_0x4fd689){return function(_0x4cae37){if(!_0x4cae37){_0x1662e5[_0xb3cf('0x1c')](0x194);}return _0x4cae37;};}function handleError(_0x173177,_0x5dfe51){_0x5dfe51=_0x5dfe51||0x1f4;return function(_0x5ce23b){logger[_0xb3cf('0x2c')](_0x5ce23b[_0xb3cf('0x2d')]);if(_0x5ce23b['name']){delete _0x5ce23b[_0xb3cf('0x2e')];}_0x173177[_0xb3cf('0x1d')](_0x5dfe51)[_0xb3cf('0x2f')](_0x5ce23b);};}exports[_0xb3cf('0x30')]=function(_0x1b1460,_0x440fb6){var _0x1203a4={},_0x11efb3={},_0x501402={'count':0x0,'rows':[]};var _0x2fc46b=_['map'](db[_0xb3cf('0x31')]['rawAttributes'],function(_0x4dd278){return{'name':_0x4dd278['fieldName'],'type':_0x4dd278[_0xb3cf('0x32')][_0xb3cf('0x33')]};});_0x11efb3['model']=_[_0xb3cf('0x34')](_0x2fc46b,_0xb3cf('0x2e'));_0x11efb3[_0xb3cf('0x35')]=_[_0xb3cf('0x36')](_0x1b1460[_0xb3cf('0x35')]);_0x11efb3[_0xb3cf('0x37')]=_['intersection'](_0x11efb3[_0xb3cf('0x38')],_0x11efb3['query']);_0x1203a4[_0xb3cf('0x39')]=_[_0xb3cf('0x3a')](_0x11efb3[_0xb3cf('0x38')],qs[_0xb3cf('0x3b')](_0x1b1460[_0xb3cf('0x35')][_0xb3cf('0x3b')]));_0x1203a4['attributes']=_0x1203a4['attributes'][_0xb3cf('0x3c')]?_0x1203a4['attributes']:_0x11efb3['model'];if(!_0x1b1460[_0xb3cf('0x35')]['hasOwnProperty'](_0xb3cf('0x3d'))){_0x1203a4[_0xb3cf('0x21')]=qs[_0xb3cf('0x21')](_0x1b1460[_0xb3cf('0x35')][_0xb3cf('0x21')]);_0x1203a4[_0xb3cf('0x20')]=qs['offset'](_0x1b1460[_0xb3cf('0x35')][_0xb3cf('0x20')]);}_0x1203a4[_0xb3cf('0x3e')]=qs[_0xb3cf('0x3f')](_0x1b1460['query'][_0xb3cf('0x3f')]);_0x1203a4['where']=qs[_0xb3cf('0x37')](_['pick'](_0x1b1460[_0xb3cf('0x35')],_0x11efb3[_0xb3cf('0x37')]),_0x2fc46b);if(_0x1b1460[_0xb3cf('0x35')]['filter']){_0x1203a4['where']=_[_0xb3cf('0x40')](_0x1203a4[_0xb3cf('0x41')],{'$or':_['map'](_0x2fc46b,function(_0x4e01e4){if(_0x4e01e4['type']!==_0xb3cf('0x42')){var _0x1b0b51={};_0x1b0b51[_0x4e01e4['name']]={'$like':'%'+_0x1b1460['query']['filter']+'%'};return _0x1b0b51;}})});}_0x1203a4=_[_0xb3cf('0x40')]({},_0x1203a4,_0x1b1460[_0xb3cf('0x43')]);var _0x13953b={'where':_0x1203a4[_0xb3cf('0x41')]};return db['AnalyticCustomReport']['count'](_0x13953b)[_0xb3cf('0x26')](function(_0x395628){_0x501402[_0xb3cf('0x1f')]=_0x395628;if(_0x1b1460[_0xb3cf('0x35')]['includeAll']){_0x1203a4[_0xb3cf('0x44')]=[{'all':!![]}];}return db[_0xb3cf('0x31')][_0xb3cf('0x45')](_0x1203a4);})[_0xb3cf('0x26')](function(_0x56c5b5){_0x501402[_0xb3cf('0x46')]=_0x56c5b5;return _0x501402;})[_0xb3cf('0x26')](respondWithFilteredResult(_0x440fb6,_0x1203a4))[_0xb3cf('0x47')](handleError(_0x440fb6,null));};exports['show']=function(_0x2486d1,_0x4c795b){var _0x4fa75a={'raw':![],'where':{'id':_0x2486d1[_0xb3cf('0x48')]['id']}},_0x2af50b={};_0x2af50b['model']=_['keys'](db[_0xb3cf('0x31')][_0xb3cf('0x49')]);_0x2af50b[_0xb3cf('0x35')]=_['keys'](_0x2486d1[_0xb3cf('0x35')]);_0x2af50b[_0xb3cf('0x37')]=_[_0xb3cf('0x3a')](_0x2af50b[_0xb3cf('0x38')],_0x2af50b[_0xb3cf('0x35')]);_0x4fa75a[_0xb3cf('0x39')]=_[_0xb3cf('0x3a')](_0x2af50b[_0xb3cf('0x38')],qs['fields'](_0x2486d1[_0xb3cf('0x35')][_0xb3cf('0x3b')]));_0x4fa75a[_0xb3cf('0x39')]=_0x4fa75a[_0xb3cf('0x39')][_0xb3cf('0x3c')]?_0x4fa75a[_0xb3cf('0x39')]:_0x2af50b['model'];if(_0x2486d1[_0xb3cf('0x35')][_0xb3cf('0x4a')]){_0x4fa75a[_0xb3cf('0x44')]=[{'all':!![]}];}_0x4fa75a=_[_0xb3cf('0x40')]({},_0x4fa75a,_0x2486d1[_0xb3cf('0x43')]);return db[_0xb3cf('0x31')][_0xb3cf('0x4b')](_0x4fa75a)[_0xb3cf('0x26')](handleEntityNotFound(_0x4c795b,null))[_0xb3cf('0x26')](respondWithResult(_0x4c795b,null))[_0xb3cf('0x47')](handleError(_0x4c795b,null));};exports[_0xb3cf('0x4c')]=function(_0x45e6bb,_0x5d4146){return db[_0xb3cf('0x31')]['create'](_0x45e6bb[_0xb3cf('0x4d')],{})['then'](function(_0x2ef02b){var _0x58398e=_0x45e6bb[_0xb3cf('0x4e')]['get']({'plain':!![]});if(!_0x58398e)throw new Error(_0xb3cf('0x4f'));if(_0x58398e[_0xb3cf('0x50')]===_0xb3cf('0x4e')){var _0xe8872b=_0x2ef02b['get']({'plain':!![]});var _0x4d6e81=_0xb3cf('0x51');return db[_0xb3cf('0x52')][_0xb3cf('0x4b')]({'where':{'name':_0x4d6e81,'userProfileId':_0x58398e[_0xb3cf('0x53')]},'raw':!![]})[_0xb3cf('0x26')](function(_0x40104e){if(_0x40104e&&_0x40104e['autoAssociation']===0x0){return db['UserProfileResource'][_0xb3cf('0x4c')]({'name':_0xe8872b[_0xb3cf('0x2e')],'resourceId':_0xe8872b['id'],'type':_0xb3cf('0x29'),'sectionId':_0x40104e['id']},{})[_0xb3cf('0x26')](function(){return _0x2ef02b;});}else{return _0x2ef02b;}})[_0xb3cf('0x47')](function(_0x788ad9){logger[_0xb3cf('0x2c')](_0xb3cf('0x54'),_0x788ad9);throw _0x788ad9;});}return _0x2ef02b;})[_0xb3cf('0x26')](respondWithResult(_0x5d4146,0xc9))[_0xb3cf('0x47')](handleError(_0x5d4146,null));};exports['update']=function(_0x33e16e,_0xbc98ad){if(_0x33e16e[_0xb3cf('0x4d')]['id']){delete _0x33e16e['body']['id'];}return db[_0xb3cf('0x31')]['find']({'where':{'id':_0x33e16e['params']['id']}})[_0xb3cf('0x26')](handleEntityNotFound(_0xbc98ad,null))['then'](saveUpdates(_0x33e16e[_0xb3cf('0x4d')],null))['then'](respondWithResult(_0xbc98ad,null))['catch'](handleError(_0xbc98ad,null));};exports['destroy']=function(_0x5e0973,_0x283799){return db['AnalyticCustomReport'][_0xb3cf('0x4b')]({'where':{'id':_0x5e0973[_0xb3cf('0x48')]['id']}})[_0xb3cf('0x26')](handleEntityNotFound(_0x283799,null))[_0xb3cf('0x26')](removeEntity(_0x283799,null))[_0xb3cf('0x47')](handleError(_0x283799,null));};exports['preview']=function(_0xd23894,_0x196923){var _0x566af2=0xa;var _0x238190=[_0xb3cf('0x55'),_0xb3cf('0x56'),_0xb3cf('0x57'),_0xb3cf('0x58')];var _0x41183a={'SUM':_0xb3cf('0x59'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0xb3cf('0x5a'),'MAX':_0xb3cf('0x5b'),'MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':_0xb3cf('0x5c'),'GROUP_CONCAT ASC':_0xb3cf('0x5d'),'GROUP_CONCAT DESC':_0xb3cf('0x5e')};var _0x2aeda={'SEC_TO_TIME':_0xb3cf('0x5f'),'DATE':_0xb3cf('0x60'),'HOUR':_0xb3cf('0x61'),'ROUND':_0xb3cf('0x62'),'UNIX_TIMESTAMP':_0xb3cf('0x63')};var _0x4bf651=function(_0x42b570){return!_[_0xb3cf('0x64')](['IS\x20NULL','IS\x20NOT\x20NULL',_0xb3cf('0x65'),_0xb3cf('0x66')],_0x42b570);};var _0x59f38e=function(_0x45b15f){if(!_0x45b15f||!_0x45b15f[_0xb3cf('0x67')][_0xb3cf('0x3c')]){return'';}for(var _0x5a678a='(',_0x4acfae=0x0;_0x4acfae<_0x45b15f[_0xb3cf('0x67')][_0xb3cf('0x3c')];_0x4acfae+=0x1){_0x4acfae>0x0&&(_0x5a678a+='\x20'+_0x45b15f[_0xb3cf('0x68')]+'\x20');_0x5a678a+=_0x45b15f[_0xb3cf('0x67')][_0x4acfae][_0xb3cf('0x69')]?_0x59f38e(_0x45b15f[_0xb3cf('0x67')][_0x4acfae][_0xb3cf('0x69')]):_0x45b15f[_0xb3cf('0x67')][_0x4acfae][_0xb3cf('0x6a')]+'\x20'+_0x45b15f[_0xb3cf('0x67')][_0x4acfae][_0xb3cf('0x6b')]+(_0x4bf651(_0x45b15f['rules'][_0x4acfae][_0xb3cf('0x6b')])?'\x20'+_0x45b15f[_0xb3cf('0x67')][_0x4acfae][_0xb3cf('0x6c')]:'');}return _0x5a678a+')';};var _0x10844a={'where':{'id':_0xd23894[_0xb3cf('0x48')]['id']}},_0xc15e93,_0x4f313f,_0x3a447e,_0x3b85ba,_0x4c2ffe;_0x10844a=_['merge']({},_0x10844a,_0xd23894['options']);return db[_0xb3cf('0x31')]['find'](_0x10844a)[_0xb3cf('0x26')](function(_0x23b0c5){if(_0x23b0c5){_0xc15e93=_0x23b0c5;return _0x23b0c5[_0xb3cf('0x6d')]();}return null;})[_0xb3cf('0x26')](function(_0x4dc30e){if(_0x4dc30e){if(!_0x4dc30e['length']){throw new db[(_0xb3cf('0x6e'))][(_0xb3cf('0x6f'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x4f313f=_0x4dc30e;return db[_0xb3cf('0x70')]['findAll']({'raw':!![]});}return null;})[_0xb3cf('0x26')](function(_0x327c85){if(_0x327c85){_0x3a447e=_[_0xb3cf('0x71')](_0x327c85,'id');var _0x4d489a;var _0x132150=squel[_0xb3cf('0x72')]();_0x132150[_0xb3cf('0x73')](_0xc15e93['table']);for(var _0x500887=0x0;_0x500887<_0x4f313f[_0xb3cf('0x3c')];_0x500887+=0x1){_0x4d489a=_0x4f313f[_0x500887]['MetricId']?_0x3a447e[_0x4f313f[_0x500887][_0xb3cf('0x74')]][_0xb3cf('0x75')]:_0x4f313f[_0x500887][_0xb3cf('0x6a')];_0x4d489a=_0x4f313f[_0x500887]['function']?_['replace'](_0x41183a[_0x4f313f[_0x500887][_0xb3cf('0x76')]],'%s',_0x4d489a):_0x4d489a;_0x4d489a=_0x4f313f[_0x500887]['format']?_[_0xb3cf('0x77')](_0x2aeda[_0x4f313f[_0x500887][_0xb3cf('0x78')]],'%s',_0x4d489a):_0x4d489a;if(_0x4f313f[_0x500887][_0xb3cf('0x79')]){_0x132150[_0xb3cf('0x69')](_0x4d489a);}_0x4f313f[_0x500887]['orderBy']&&_0x132150['order'](_0x4d489a,_0x4f313f[_0x500887][_0xb3cf('0x7a')]==='DESC'?![]:!![]);_0x132150[_0xb3cf('0x6a')](_0x4d489a,_0x4f313f[_0x500887][_0xb3cf('0x7b')]||_0x4d489a);}if(_0xc15e93[_0xb3cf('0x7c')]){_0xc15e93[_0xb3cf('0x7c')]=JSON['parse'](_0xc15e93['joins']);for(var _0x4f1fa2=0x0;_0x4f1fa2<_0xc15e93[_0xb3cf('0x7c')][_0xb3cf('0x3c')];_0x4f1fa2+=0x1){if(_0xc15e93[_0xb3cf('0x7c')][_0x4f1fa2][_0xb3cf('0x32')]&&_['includes'](_0x238190,_0xc15e93[_0xb3cf('0x7c')][_0x4f1fa2][_0xb3cf('0x32')])&&_0xc15e93[_0xb3cf('0x7c')][_0x4f1fa2][_0xb3cf('0x7d')]&&_0xc15e93[_0xb3cf('0x7c')][_0x4f1fa2][_0xb3cf('0x7e')]&&_0xc15e93[_0xb3cf('0x7c')][_0x4f1fa2][_0xb3cf('0x7f')]){_0x132150[_0xc15e93[_0xb3cf('0x7c')][_0x4f1fa2][_0xb3cf('0x32')]](_0xc15e93[_0xb3cf('0x7c')][_0x4f1fa2][_0xb3cf('0x7e')],null,util['format'](_0xb3cf('0x80'),_0xc15e93[_0xb3cf('0x81')],_0xc15e93[_0xb3cf('0x7c')][_0x4f1fa2][_0xb3cf('0x7d')],_0xc15e93[_0xb3cf('0x7c')][_0x4f1fa2][_0xb3cf('0x7e')],_0xc15e93['joins'][_0x4f1fa2][_0xb3cf('0x7f')]));}}}if(_0xc15e93[_0xb3cf('0x82')]){_0xc15e93['conditions']=JSON[_0xb3cf('0x83')](_0xc15e93[_0xb3cf('0x82')]);_0x132150[_0xb3cf('0x41')](_0x59f38e(_0xc15e93[_0xb3cf('0x82')][_0xb3cf('0x69')]));}_0x4c2ffe=_0x132150[_0xb3cf('0x84')]();_0x132150[_0xb3cf('0x21')](_0x566af2);_0x132150[_0xb3cf('0x20')](0x0);logger['debug']('Limited\x20Query:',_0x132150['toString']());return db[_0xb3cf('0x85')]['query'](_0x132150[_0xb3cf('0x86')](),{'type':db[_0xb3cf('0x85')][_0xb3cf('0x87')][_0xb3cf('0x88')]});}})['then'](respondWithResult(_0x196923,null))[_0xb3cf('0x47')](handleError(_0x196923,null));};function runReport(_0xf5d8fc,_0x130c03,_0x565605){var _0x536fa2=_0x130c03[_0xb3cf('0x2e')];var _0x2a0660=0xa;var _0x5a5af2=[_0xb3cf('0x55'),'left_join','right_join','cross_join'];var _0x929cc6={'SUM':_0xb3cf('0x59'),'COUNT':_0xb3cf('0x89'),'COUNT DISTINCT':_0xb3cf('0x5a'),'MAX':_0xb3cf('0x5b'),'MIN':_0xb3cf('0x8a'),'AVG':'AVG(%s)','GROUP_CONCAT':_0xb3cf('0x5c'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xb3cf('0x5e')};var _0x230c79={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xb3cf('0x60'),'HOUR':_0xb3cf('0x61'),'ROUND':_0xb3cf('0x62'),'UNIX_TIMESTAMP':_0xb3cf('0x63')};var _0x4cbbe3=function(_0x103df4){return!_[_0xb3cf('0x64')]([_0xb3cf('0x8b'),'IS\x20NOT\x20NULL',_0xb3cf('0x65'),_0xb3cf('0x66')],_0x103df4);};var _0x31ac46=function(_0x496f19){if(!_0x496f19||!_0x496f19['rules'][_0xb3cf('0x3c')]){return'';}for(var _0x50e864='(',_0x3168cf=0x0;_0x3168cf<_0x496f19[_0xb3cf('0x67')][_0xb3cf('0x3c')];_0x3168cf+=0x1){_0x3168cf>0x0&&(_0x50e864+='\x20'+_0x496f19[_0xb3cf('0x68')]+'\x20');_0x50e864+=_0x496f19[_0xb3cf('0x67')][_0x3168cf]['group']?_0x31ac46(_0x496f19[_0xb3cf('0x67')][_0x3168cf]['group']):_0x496f19['rules'][_0x3168cf][_0xb3cf('0x6a')]+'\x20'+_0x496f19[_0xb3cf('0x67')][_0x3168cf][_0xb3cf('0x6b')]+(_0x4cbbe3(_0x496f19[_0xb3cf('0x67')][_0x3168cf][_0xb3cf('0x6b')])?'\x20'+_0x496f19['rules'][_0x3168cf][_0xb3cf('0x6c')]:'');}return _0x50e864+')';};var _0x13763f={'where':{'id':_0xf5d8fc['id']}},_0x27bc10,_0x31939c,_0x3d8a50,_0x2db9ef,_0x4c8ac9;_0x13763f=_[_0xb3cf('0x40')]({},_0x13763f,_0x565605);return db[_0xb3cf('0x31')][_0xb3cf('0x4b')](_0x13763f)[_0xb3cf('0x26')](function(_0x46227f){if(_0x46227f){_0x27bc10=_0x46227f;return _0x46227f[_0xb3cf('0x6d')]();}return null;})[_0xb3cf('0x26')](function(_0x3bd1f0){if(_0x3bd1f0){if(!_0x3bd1f0[_0xb3cf('0x3c')]){throw new db['Sequelize'][(_0xb3cf('0x6f'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x31939c=_0x3bd1f0;return db[_0xb3cf('0x70')][_0xb3cf('0x45')]({'raw':!![]});}return null;})[_0xb3cf('0x26')](function(_0x518e33){if(_0x518e33){_0x3d8a50=_[_0xb3cf('0x71')](_0x518e33,'id');var _0x266d6e;var _0x182081=squel[_0xb3cf('0x72')]();_0x182081['from'](_0x27bc10[_0xb3cf('0x81')]);for(var _0x2bc2a3=0x0;_0x2bc2a3<_0x31939c['length'];_0x2bc2a3+=0x1){_0x266d6e=_0x31939c[_0x2bc2a3][_0xb3cf('0x74')]?_0x3d8a50[_0x31939c[_0x2bc2a3][_0xb3cf('0x74')]][_0xb3cf('0x75')]:_0x31939c[_0x2bc2a3][_0xb3cf('0x6a')];_0x266d6e=_0x31939c[_0x2bc2a3]['function']?_[_0xb3cf('0x77')](_0x929cc6[_0x31939c[_0x2bc2a3][_0xb3cf('0x76')]],'%s',_0x266d6e):_0x266d6e;_0x266d6e=_0x31939c[_0x2bc2a3][_0xb3cf('0x78')]?_[_0xb3cf('0x77')](_0x230c79[_0x31939c[_0x2bc2a3]['format']],'%s',_0x266d6e):_0x266d6e;if(_0x31939c[_0x2bc2a3]['groupBy']){_0x182081[_0xb3cf('0x69')](_0x266d6e);}_0x31939c[_0x2bc2a3][_0xb3cf('0x7a')]&&_0x182081['order'](_0x266d6e,_0x31939c[_0x2bc2a3][_0xb3cf('0x7a')]==='DESC'?![]:!![]);_0x182081['field'](_0x266d6e,_0x31939c[_0x2bc2a3][_0xb3cf('0x7b')]||_0x266d6e);}if(_0x27bc10[_0xb3cf('0x7c')]){_0x27bc10[_0xb3cf('0x7c')]=JSON[_0xb3cf('0x83')](_0x27bc10['joins']);for(var _0x2034a5=0x0;_0x2034a5<_0x27bc10[_0xb3cf('0x7c')][_0xb3cf('0x3c')];_0x2034a5+=0x1){if(_0x27bc10['joins'][_0x2034a5]['type']&&_[_0xb3cf('0x64')](_0x5a5af2,_0x27bc10[_0xb3cf('0x7c')][_0x2034a5]['type'])&&_0x27bc10[_0xb3cf('0x7c')][_0x2034a5][_0xb3cf('0x7d')]&&_0x27bc10[_0xb3cf('0x7c')][_0x2034a5]['foreignTable']&&_0x27bc10['joins'][_0x2034a5][_0xb3cf('0x7f')]){_0x182081[_0x27bc10[_0xb3cf('0x7c')][_0x2034a5]['type']](_0x27bc10[_0xb3cf('0x7c')][_0x2034a5][_0xb3cf('0x7e')],null,util[_0xb3cf('0x78')](_0xb3cf('0x80'),_0x27bc10[_0xb3cf('0x81')],_0x27bc10[_0xb3cf('0x7c')][_0x2034a5][_0xb3cf('0x7d')],_0x27bc10[_0xb3cf('0x7c')][_0x2034a5][_0xb3cf('0x7e')],_0x27bc10['joins'][_0x2034a5]['foreignKey']));}}}if(_0x27bc10['conditions']){_0x27bc10['conditions']=JSON[_0xb3cf('0x83')](_0x27bc10['conditions']);_0x182081['where'](_0x31ac46(_0x27bc10[_0xb3cf('0x82')][_0xb3cf('0x69')]));}_0x4c8ac9=_0x182081[_0xb3cf('0x84')]();_0x182081[_0xb3cf('0x21')](_0x2a0660);_0x182081[_0xb3cf('0x20')](0x0);logger[_0xb3cf('0x8c')](_0xb3cf('0x8d'),_0x182081[_0xb3cf('0x86')]());return db['sequelize'][_0xb3cf('0x35')](_0x182081['toString'](),{'type':db[_0xb3cf('0x85')][_0xb3cf('0x87')]['SELECT']});}})['then'](function(_0x27842d){if(!_0x27842d['length']){throw new db[(_0xb3cf('0x6e'))][(_0xb3cf('0x6f'))](_0xb3cf('0x8e'),0xcc);}if(_0x130c03[_0xb3cf('0x8f')]==='web'){return null;}var _0x5ce3fd=_[_0xb3cf('0x40')](_0x130c03,{'name':_0x130c03[_0xb3cf('0x90')]||_0x130c03[_0xb3cf('0x2e')]||_0x27bc10[_0xb3cf('0x2e')],'basename':_0x536fa2,'savename':util[_0xb3cf('0x78')](_0xb3cf('0x91'),_0x130c03[_0xb3cf('0x2e')]||_0x27bc10[_0xb3cf('0x2e')],require(_0xb3cf('0x92'))[_0xb3cf('0x93')](0x4),_0x130c03[_0xb3cf('0x8f')]||_0xb3cf('0x94')),'reportId':_0x27bc10['id'],'reportType':_0xb3cf('0x95')});return db['AnalyticExtractedReport'][_0xb3cf('0x4c')](_0x5ce3fd,{'raw':!![]});})[_0xb3cf('0x26')](function(_0x13ebb4){if(_0x27bc10[_0xb3cf('0x81')]===_0xb3cf('0x96')){_0x4c8ac9[_0xb3cf('0x41')](_0x27bc10[_0xb3cf('0x81')]+_0xb3cf('0x97'),_0x130c03['startDate'],_0x130c03[_0xb3cf('0x98')]);}else{_0x4c8ac9[_0xb3cf('0x41')](_0x27bc10['table']+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x130c03['startDate'],_0x130c03[_0xb3cf('0x98')]);}if(_0x13ebb4){logger[_0xb3cf('0x99')](_0xb3cf('0x9a'),_0x4c8ac9['toString']());require(_0xb3cf('0x9b'))[_0xb3cf('0x9c')](path[_0xb3cf('0x55')](__dirname,_0xb3cf('0x9d'),_0x13ebb4[_0xb3cf('0x8f')]),[_0x13ebb4['id'],_0x4c8ac9[_0xb3cf('0x86')](),path[_0xb3cf('0x55')](__dirname,_0xb3cf('0x9e'),_0x13ebb4[_0xb3cf('0x9f')]),_0x536fa2]);return _0x13ebb4;}else{var _0x1e501b=squel[_0xb3cf('0x72')]();_0x1e501b[_0xb3cf('0x73')]('('+_0x4c8ac9[_0xb3cf('0x86')]()+')',_0xb3cf('0xa0'));_0x1e501b['field'](_0xb3cf('0xa1'),_0xb3cf('0x1f'));_0x4c8ac9[_0xb3cf('0x21')](_0x130c03[_0xb3cf('0x21')]||_0x2a0660);_0x4c8ac9[_0xb3cf('0x20')](_0x130c03['offset']||0x0);return dbH[_0xb3cf('0x85')][_0xb3cf('0x35')](_0x1e501b[_0xb3cf('0x86')](),{'type':dbH[_0xb3cf('0x85')][_0xb3cf('0x87')]['SELECT']})[_0xb3cf('0x26')](function(_0x43727b){if(!_0x43727b[_0xb3cf('0x3c')]){_0x2db9ef=0x0;}else{_0x2db9ef=_0x43727b[0x0][_0xb3cf('0x1f')]||0x0;}return dbH['sequelize']['query'](_0x4c8ac9[_0xb3cf('0x86')](),{'type':dbH[_0xb3cf('0x85')]['QueryTypes'][_0xb3cf('0x88')]});})[_0xb3cf('0x26')](function(_0x435a09){return{'rows':_0x435a09||[],'count':_0x2db9ef};});}});}exports['run']=function(_0x14d769,_0x29a8de){return runReport(_0x14d769[_0xb3cf('0x48')],_0x14d769['query'],_0x14d769[_0xb3cf('0x43')])[_0xb3cf('0x26')](respondWithResult(_0x29a8de,null))[_0xb3cf('0x47')](handleError(_0x29a8de,null));};exports[_0xb3cf('0xa2')]=runReport;exports[_0xb3cf('0x35')]=function(_0x2d528f,_0x89d6e2){var _0x2fef29=0xa;var _0x92a7ab=[_0xb3cf('0x55'),_0xb3cf('0x56'),_0xb3cf('0x57'),_0xb3cf('0x58')];var _0x453073={'SUM':_0xb3cf('0x59'),'COUNT':_0xb3cf('0x89'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xb3cf('0x5b'),'MIN':_0xb3cf('0x8a'),'AVG':_0xb3cf('0xa3'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0xb3cf('0x5d'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x5a4bc6={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xb3cf('0x60'),'HOUR':_0xb3cf('0x61'),'ROUND':_0xb3cf('0x62'),'UNIX_TIMESTAMP':_0xb3cf('0x63')};var _0x5e1670=function(_0x1900ec){return!_[_0xb3cf('0x64')]([_0xb3cf('0x8b'),'IS\x20NOT\x20NULL',_0xb3cf('0x65'),_0xb3cf('0x66')],_0x1900ec);};var _0x5ef7d6=function(_0x144fd3){if(!_0x144fd3||!_0x144fd3[_0xb3cf('0x67')][_0xb3cf('0x3c')]){return'';}for(var _0x34353d='(',_0x2d452c=0x0;_0x2d452c<_0x144fd3[_0xb3cf('0x67')][_0xb3cf('0x3c')];_0x2d452c+=0x1){_0x2d452c>0x0&&(_0x34353d+='\x20'+_0x144fd3['operator']+'\x20');_0x34353d+=_0x144fd3['rules'][_0x2d452c][_0xb3cf('0x69')]?_0x5ef7d6(_0x144fd3['rules'][_0x2d452c][_0xb3cf('0x69')]):_0x144fd3[_0xb3cf('0x67')][_0x2d452c]['field']+'\x20'+_0x144fd3[_0xb3cf('0x67')][_0x2d452c]['condition']+(_0x5e1670(_0x144fd3[_0xb3cf('0x67')][_0x2d452c][_0xb3cf('0x6b')])?'\x20'+_0x144fd3['rules'][_0x2d452c][_0xb3cf('0x6c')]:'');}return _0x34353d+')';};var _0xadfdc2={'where':{'id':_0x2d528f[_0xb3cf('0x48')]['id']}},_0x37e11b,_0x2a2093,_0x28e295,_0x1be85c,_0x184f6b;_0xadfdc2=_[_0xb3cf('0x40')]({},_0xadfdc2,_0x2d528f['options']);return db['AnalyticCustomReport'][_0xb3cf('0x4b')](_0xadfdc2)[_0xb3cf('0x26')](function(_0x4a4158){if(_0x4a4158){_0x37e11b=_0x4a4158;return _0x4a4158[_0xb3cf('0x6d')]();}return null;})[_0xb3cf('0x26')](function(_0x5f1721){if(_0x5f1721){if(!_0x5f1721[_0xb3cf('0x3c')]){throw new db[(_0xb3cf('0x6e'))][(_0xb3cf('0x6f'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x2a2093=_0x5f1721;return db[_0xb3cf('0x70')][_0xb3cf('0x45')]({'raw':!![]});}return null;})['then'](function(_0x51bd97){if(_0x51bd97){_0x28e295=_[_0xb3cf('0x71')](_0x51bd97,'id');var _0x3a3d2e;var _0x28355e=squel[_0xb3cf('0x72')]();_0x28355e[_0xb3cf('0x73')](_0x37e11b[_0xb3cf('0x81')]);for(var _0x5bd899=0x0;_0x5bd899<_0x2a2093[_0xb3cf('0x3c')];_0x5bd899+=0x1){_0x3a3d2e=_0x2a2093[_0x5bd899][_0xb3cf('0x74')]?_0x28e295[_0x2a2093[_0x5bd899][_0xb3cf('0x74')]][_0xb3cf('0x75')]:_0x2a2093[_0x5bd899]['field'];_0x3a3d2e=_0x2a2093[_0x5bd899][_0xb3cf('0x76')]?_[_0xb3cf('0x77')](_0x453073[_0x2a2093[_0x5bd899]['function']],'%s',_0x3a3d2e):_0x3a3d2e;_0x3a3d2e=_0x2a2093[_0x5bd899][_0xb3cf('0x78')]?_[_0xb3cf('0x77')](_0x5a4bc6[_0x2a2093[_0x5bd899][_0xb3cf('0x78')]],'%s',_0x3a3d2e):_0x3a3d2e;if(_0x2a2093[_0x5bd899][_0xb3cf('0x79')]){_0x28355e['group'](_0x3a3d2e);}_0x2a2093[_0x5bd899][_0xb3cf('0x7a')]&&_0x28355e[_0xb3cf('0x3e')](_0x3a3d2e,_0x2a2093[_0x5bd899][_0xb3cf('0x7a')]===_0xb3cf('0xa4')?![]:!![]);_0x28355e[_0xb3cf('0x6a')](_0x3a3d2e,_0x2a2093[_0x5bd899][_0xb3cf('0x7b')]||_0x3a3d2e);}if(_0x37e11b[_0xb3cf('0x7c')]){_0x37e11b['joins']=JSON[_0xb3cf('0x83')](_0x37e11b[_0xb3cf('0x7c')]);for(var _0x5fb826=0x0;_0x5fb826<_0x37e11b[_0xb3cf('0x7c')][_0xb3cf('0x3c')];_0x5fb826+=0x1){if(_0x37e11b['joins'][_0x5fb826][_0xb3cf('0x32')]&&_[_0xb3cf('0x64')](_0x92a7ab,_0x37e11b[_0xb3cf('0x7c')][_0x5fb826][_0xb3cf('0x32')])&&_0x37e11b[_0xb3cf('0x7c')][_0x5fb826][_0xb3cf('0x7d')]&&_0x37e11b[_0xb3cf('0x7c')][_0x5fb826][_0xb3cf('0x7e')]&&_0x37e11b['joins'][_0x5fb826][_0xb3cf('0x7f')]){_0x28355e[_0x37e11b[_0xb3cf('0x7c')][_0x5fb826][_0xb3cf('0x32')]](_0x37e11b[_0xb3cf('0x7c')][_0x5fb826][_0xb3cf('0x7e')],null,util[_0xb3cf('0x78')]('%s.%s\x20=\x20%s.%s',_0x37e11b[_0xb3cf('0x81')],_0x37e11b[_0xb3cf('0x7c')][_0x5fb826][_0xb3cf('0x7d')],_0x37e11b['joins'][_0x5fb826]['foreignTable'],_0x37e11b[_0xb3cf('0x7c')][_0x5fb826][_0xb3cf('0x7f')]));}}}if(_0x37e11b[_0xb3cf('0x82')]){_0x37e11b['conditions']=JSON[_0xb3cf('0x83')](_0x37e11b[_0xb3cf('0x82')]);_0x28355e[_0xb3cf('0x41')](_0x5ef7d6(_0x37e11b[_0xb3cf('0x82')]['group']));}_0x184f6b=_0x28355e['clone']();_0x28355e[_0xb3cf('0x21')](_0x2fef29);_0x28355e['offset'](0x0);logger[_0xb3cf('0x8c')](_0xb3cf('0x8d'),_0x28355e[_0xb3cf('0x86')]());return db[_0xb3cf('0x85')][_0xb3cf('0x35')](_0x28355e[_0xb3cf('0x86')](),{'type':db[_0xb3cf('0x85')][_0xb3cf('0x87')][_0xb3cf('0x88')]});}})['then'](function(){return{'sql':_0x184f6b['toString']()};})[_0xb3cf('0x26')](respondWithResult(_0x89d6e2,null))['catch'](handleError(_0x89d6e2,null));};
\ No newline at end of file
+var _0xb2b5=['SUM(%s)','Please\x20insert\x20at\x20least\x20one\x20field','metric','fast-json-patch','request-promise','mustache','util','path','sox','ejs','lodash','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','dbH','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','UserProfileResource','destroy','error','stack','name','index','map','AnalyticCustomReport','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','findAll','rows','catch','params','merge','options','find','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','Reports','UserProfileSection','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','preview','join','right_join','cross_join','COUNT(%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','IS\x20NOT\x20NULL','IS\x20EMPTY','rules','group','field','value','getFields','Sequelize','AnalyticMetric','table','MetricId','function','replace','format','orderBy','order','DESC','alias','joins','parse','type','includes','parentKey','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','conditions','clone','debug','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','left_join','COUNT(DISTINCT\x20%s)','IS\x20NULL','IS\x20NOT\x20EMPTY','operator','condition','ValidationErrorItem','keyBy','select','from','groupBy','No\x20available\x20data','output','fullPath','%s-%s.%s','csv','custom','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','info','Run\x20Query:','fork','../../components/export/','../../files/reports','savename','countTable','run','runReport'];(function(_0x122a34,_0x1ea0c5){var _0x3b526f=function(_0x3bf5dd){while(--_0x3bf5dd){_0x122a34['push'](_0x122a34['shift']());}};_0x3b526f(++_0x1ea0c5);}(_0xb2b5,0xa3));var _0x5b2b=function(_0x51020b,_0x38c2c7){_0x51020b=_0x51020b-0x0;var _0x371e47=_0xb2b5[_0x51020b];return _0x371e47;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x5b2b('0x0'));var rp=require(_0x5b2b('0x1'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x5b2b('0x2'));var util=require(_0x5b2b('0x3'));var path=require(_0x5b2b('0x4'));var sox=require(_0x5b2b('0x5'));var csv=require('to-csv');var ejs=require(_0x5b2b('0x6'));var fs=require('fs');var _=require(_0x5b2b('0x7'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x5b2b('0x8'));var deskjs=require(_0x5b2b('0x9'));var toCsv=require(_0x5b2b('0xa'));var querystring=require(_0x5b2b('0xb'));var Papa=require(_0x5b2b('0xc'));var Redis=require(_0x5b2b('0xd'));var authService=require(_0x5b2b('0xe'));var qs=require(_0x5b2b('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5b2b('0x10'));var logger=require(_0x5b2b('0x11'))('api');var utils=require(_0x5b2b('0x12'));var config=require(_0x5b2b('0x13'));var db=require('../../mysqldb')['db'];var dbH=require(_0x5b2b('0x14'))[_0x5b2b('0x15')];function respondWithStatusCode(_0xfe1936,_0x12f1f8){_0x12f1f8=_0x12f1f8||0xcc;return function(_0x2efc16){if(_0x2efc16){return _0xfe1936[_0x5b2b('0x16')](_0x12f1f8);}return _0xfe1936[_0x5b2b('0x17')](_0x12f1f8)['end']();};}function respondWithResult(_0x30e9a3,_0x4fa243){_0x4fa243=_0x4fa243||0xc8;return function(_0x39dad7){if(_0x39dad7){return _0x30e9a3[_0x5b2b('0x17')](_0x4fa243)[_0x5b2b('0x18')](_0x39dad7);}};}function respondWithFilteredResult(_0x2611a3,_0x4ff4ba){return function(_0x310060){if(_0x310060){var _0x57b38f=_0x310060[_0x5b2b('0x19')],_0x3dd404=_0x4ff4ba[_0x5b2b('0x1a')],_0x481d65=_0x4ff4ba['offset']+_0x4ff4ba[_0x5b2b('0x1b')],_0x56ca46;if(_0x481d65>=_0x57b38f){_0x481d65=_0x57b38f;_0x56ca46=0xc8;}else{_0x56ca46=0xce;}_0x2611a3[_0x5b2b('0x17')](_0x56ca46);return _0x2611a3[_0x5b2b('0x1c')](_0x5b2b('0x1d'),_0x3dd404+'-'+_0x481d65+'/'+_0x57b38f)[_0x5b2b('0x18')](_0x310060);}return null;};}function patchUpdates(_0x47bb1b){return function(_0x35b589){try{jsonpatch[_0x5b2b('0x1e')](_0x35b589,_0x47bb1b,!![]);}catch(_0x38f083){return BPromise[_0x5b2b('0x1f')](_0x38f083);}return _0x35b589[_0x5b2b('0x20')]();};}function saveUpdates(_0x42f0ed,_0x11cc3e){return function(_0x208c1f){if(_0x208c1f){return _0x208c1f[_0x5b2b('0x21')](_0x42f0ed)[_0x5b2b('0x22')](function(_0x34c624){return _0x34c624;});}return null;};}function removeEntity(_0xa8ebd5,_0x2de273){return function(_0x5fdeb1){if(_0x5fdeb1){return _0x5fdeb1['destroy']()['then'](function(){var _0xfdaeed=_0x5fdeb1['get']({'plain':!![]});var _0x3a530f='CustomReports';return db[_0x5b2b('0x23')][_0x5b2b('0x24')]({'where':{'type':_0x3a530f,'resourceId':_0xfdaeed['id']}})[_0x5b2b('0x22')](function(){return _0x5fdeb1;});})[_0x5b2b('0x22')](function(){_0xa8ebd5[_0x5b2b('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x923346,_0x3e97dc){return function(_0x55b05c){if(!_0x55b05c){_0x923346[_0x5b2b('0x16')](0x194);}return _0x55b05c;};}function handleError(_0x1fa64b,_0x49fca6){_0x49fca6=_0x49fca6||0x1f4;return function(_0x2425df){logger[_0x5b2b('0x25')](_0x2425df[_0x5b2b('0x26')]);if(_0x2425df[_0x5b2b('0x27')]){delete _0x2425df[_0x5b2b('0x27')];}_0x1fa64b[_0x5b2b('0x17')](_0x49fca6)['send'](_0x2425df);};}exports[_0x5b2b('0x28')]=function(_0x42b46c,_0xf5f479){var _0x4162f6={},_0x45a0cd={},_0x5930ef={'count':0x0,'rows':[]};var _0x3ff027=_[_0x5b2b('0x29')](db[_0x5b2b('0x2a')][_0x5b2b('0x2b')],function(_0xbe2fc9){return{'name':_0xbe2fc9[_0x5b2b('0x2c')],'type':_0xbe2fc9['type'][_0x5b2b('0x2d')]};});_0x45a0cd[_0x5b2b('0x2e')]=_[_0x5b2b('0x29')](_0x3ff027,_0x5b2b('0x27'));_0x45a0cd[_0x5b2b('0x2f')]=_[_0x5b2b('0x30')](_0x42b46c[_0x5b2b('0x2f')]);_0x45a0cd[_0x5b2b('0x31')]=_[_0x5b2b('0x32')](_0x45a0cd[_0x5b2b('0x2e')],_0x45a0cd['query']);_0x4162f6[_0x5b2b('0x33')]=_[_0x5b2b('0x32')](_0x45a0cd[_0x5b2b('0x2e')],qs[_0x5b2b('0x34')](_0x42b46c[_0x5b2b('0x2f')][_0x5b2b('0x34')]));_0x4162f6[_0x5b2b('0x33')]=_0x4162f6[_0x5b2b('0x33')][_0x5b2b('0x35')]?_0x4162f6['attributes']:_0x45a0cd[_0x5b2b('0x2e')];if(!_0x42b46c[_0x5b2b('0x2f')][_0x5b2b('0x36')](_0x5b2b('0x37'))){_0x4162f6['limit']=qs['limit'](_0x42b46c[_0x5b2b('0x2f')]['limit']);_0x4162f6[_0x5b2b('0x1a')]=qs[_0x5b2b('0x1a')](_0x42b46c[_0x5b2b('0x2f')][_0x5b2b('0x1a')]);}_0x4162f6['order']=qs[_0x5b2b('0x38')](_0x42b46c[_0x5b2b('0x2f')][_0x5b2b('0x38')]);_0x4162f6[_0x5b2b('0x39')]=qs[_0x5b2b('0x31')](_[_0x5b2b('0x3a')](_0x42b46c[_0x5b2b('0x2f')],_0x45a0cd['filters']),_0x3ff027);if(_0x42b46c['query'][_0x5b2b('0x3b')]){_0x4162f6[_0x5b2b('0x39')]=_['merge'](_0x4162f6[_0x5b2b('0x39')],{'$or':_[_0x5b2b('0x29')](_0x3ff027,function(_0x501615){if(_0x501615['type']!=='VIRTUAL'){var _0x30c4e0={};_0x30c4e0[_0x501615[_0x5b2b('0x27')]]={'$like':'%'+_0x42b46c[_0x5b2b('0x2f')][_0x5b2b('0x3b')]+'%'};return _0x30c4e0;}})});}_0x4162f6=_['merge']({},_0x4162f6,_0x42b46c['options']);var _0xb3f4dc={'where':_0x4162f6['where']};return db[_0x5b2b('0x2a')][_0x5b2b('0x19')](_0xb3f4dc)[_0x5b2b('0x22')](function(_0x4910e8){_0x5930ef[_0x5b2b('0x19')]=_0x4910e8;if(_0x42b46c['query']['includeAll']){_0x4162f6['include']=[{'all':!![]}];}return db[_0x5b2b('0x2a')][_0x5b2b('0x3c')](_0x4162f6);})[_0x5b2b('0x22')](function(_0xea78d){_0x5930ef[_0x5b2b('0x3d')]=_0xea78d;return _0x5930ef;})['then'](respondWithFilteredResult(_0xf5f479,_0x4162f6))[_0x5b2b('0x3e')](handleError(_0xf5f479,null));};exports['show']=function(_0x18065c,_0x225e50){var _0x5bcbe0={'raw':![],'where':{'id':_0x18065c[_0x5b2b('0x3f')]['id']}},_0x2374f8={};_0x2374f8['model']=_[_0x5b2b('0x30')](db[_0x5b2b('0x2a')][_0x5b2b('0x2b')]);_0x2374f8['query']=_[_0x5b2b('0x30')](_0x18065c[_0x5b2b('0x2f')]);_0x2374f8[_0x5b2b('0x31')]=_[_0x5b2b('0x32')](_0x2374f8[_0x5b2b('0x2e')],_0x2374f8[_0x5b2b('0x2f')]);_0x5bcbe0[_0x5b2b('0x33')]=_[_0x5b2b('0x32')](_0x2374f8[_0x5b2b('0x2e')],qs['fields'](_0x18065c[_0x5b2b('0x2f')][_0x5b2b('0x34')]));_0x5bcbe0[_0x5b2b('0x33')]=_0x5bcbe0[_0x5b2b('0x33')][_0x5b2b('0x35')]?_0x5bcbe0[_0x5b2b('0x33')]:_0x2374f8['model'];if(_0x18065c['query']['includeAll']){_0x5bcbe0['include']=[{'all':!![]}];}_0x5bcbe0=_[_0x5b2b('0x40')]({},_0x5bcbe0,_0x18065c[_0x5b2b('0x41')]);return db[_0x5b2b('0x2a')][_0x5b2b('0x42')](_0x5bcbe0)[_0x5b2b('0x22')](handleEntityNotFound(_0x225e50,null))[_0x5b2b('0x22')](respondWithResult(_0x225e50,null))[_0x5b2b('0x3e')](handleError(_0x225e50,null));};exports['create']=function(_0x43ddd5,_0x1f814c){return db['AnalyticCustomReport']['create'](_0x43ddd5[_0x5b2b('0x43')],{})['then'](function(_0x5a6b8e){var _0x40b8ee=_0x43ddd5[_0x5b2b('0x44')][_0x5b2b('0x45')]({'plain':!![]});if(!_0x40b8ee)throw new Error(_0x5b2b('0x46'));if(_0x40b8ee['role']===_0x5b2b('0x44')){var _0x2d14cc=_0x5a6b8e['get']({'plain':!![]});var _0x5612f3=_0x5b2b('0x47');return db[_0x5b2b('0x48')][_0x5b2b('0x42')]({'where':{'name':_0x5612f3,'userProfileId':_0x40b8ee['userProfileId']},'raw':!![]})['then'](function(_0x1eddab){if(_0x1eddab&&_0x1eddab[_0x5b2b('0x49')]===0x0){return db['UserProfileResource'][_0x5b2b('0x4a')]({'name':_0x2d14cc[_0x5b2b('0x27')],'resourceId':_0x2d14cc['id'],'type':'CustomReports','sectionId':_0x1eddab['id']},{})[_0x5b2b('0x22')](function(){return _0x5a6b8e;});}else{return _0x5a6b8e;}})['catch'](function(_0x5da3df){logger[_0x5b2b('0x25')](_0x5b2b('0x4b'),_0x5da3df);throw _0x5da3df;});}return _0x5a6b8e;})[_0x5b2b('0x22')](respondWithResult(_0x1f814c,0xc9))[_0x5b2b('0x3e')](handleError(_0x1f814c,null));};exports['update']=function(_0xa7da0d,_0x57e376){if(_0xa7da0d[_0x5b2b('0x43')]['id']){delete _0xa7da0d['body']['id'];}return db[_0x5b2b('0x2a')][_0x5b2b('0x42')]({'where':{'id':_0xa7da0d[_0x5b2b('0x3f')]['id']}})[_0x5b2b('0x22')](handleEntityNotFound(_0x57e376,null))['then'](saveUpdates(_0xa7da0d[_0x5b2b('0x43')],null))[_0x5b2b('0x22')](respondWithResult(_0x57e376,null))[_0x5b2b('0x3e')](handleError(_0x57e376,null));};exports['destroy']=function(_0x42fac9,_0x5a0e86){return db['AnalyticCustomReport'][_0x5b2b('0x42')]({'where':{'id':_0x42fac9[_0x5b2b('0x3f')]['id']}})[_0x5b2b('0x22')](handleEntityNotFound(_0x5a0e86,null))[_0x5b2b('0x22')](removeEntity(_0x5a0e86,null))[_0x5b2b('0x3e')](handleError(_0x5a0e86,null));};exports[_0x5b2b('0x4c')]=function(_0x3df1aa,_0x5b8b0e){var _0x45cf58=0xa;var _0x41d14f=[_0x5b2b('0x4d'),'left_join',_0x5b2b('0x4e'),_0x5b2b('0x4f')];var _0x5972d1={'SUM':'SUM(%s)','COUNT':_0x5b2b('0x50'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x5b2b('0x51'),'MIN':_0x5b2b('0x52'),'AVG':_0x5b2b('0x53'),'GROUP_CONCAT':_0x5b2b('0x54'),'GROUP_CONCAT ASC':_0x5b2b('0x55'),'GROUP_CONCAT DESC':_0x5b2b('0x56')};var _0x3598d6={'SEC_TO_TIME':_0x5b2b('0x57'),'DATE':_0x5b2b('0x58'),'HOUR':_0x5b2b('0x59'),'ROUND':_0x5b2b('0x5a'),'UNIX_TIMESTAMP':_0x5b2b('0x5b')};var _0x31f193=function(_0x348a87){return!_['includes'](['IS\x20NULL',_0x5b2b('0x5c'),_0x5b2b('0x5d'),'IS\x20NOT\x20EMPTY'],_0x348a87);};var _0x581a72=function(_0x3a91cf){if(!_0x3a91cf||!_0x3a91cf[_0x5b2b('0x5e')][_0x5b2b('0x35')]){return'';}for(var _0x1be3e0='(',_0x40af7b=0x0;_0x40af7b<_0x3a91cf[_0x5b2b('0x5e')][_0x5b2b('0x35')];_0x40af7b+=0x1){_0x40af7b>0x0&&(_0x1be3e0+='\x20'+_0x3a91cf['operator']+'\x20');_0x1be3e0+=_0x3a91cf['rules'][_0x40af7b]['group']?_0x581a72(_0x3a91cf[_0x5b2b('0x5e')][_0x40af7b][_0x5b2b('0x5f')]):_0x3a91cf[_0x5b2b('0x5e')][_0x40af7b][_0x5b2b('0x60')]+'\x20'+_0x3a91cf[_0x5b2b('0x5e')][_0x40af7b]['condition']+(_0x31f193(_0x3a91cf[_0x5b2b('0x5e')][_0x40af7b]['condition'])?'\x20'+_0x3a91cf[_0x5b2b('0x5e')][_0x40af7b][_0x5b2b('0x61')]:'');}return _0x1be3e0+')';};var _0x536813={'where':{'id':_0x3df1aa[_0x5b2b('0x3f')]['id']}},_0x2b443f,_0x511b02,_0x27cf7a,_0x467624,_0x56e334;_0x536813=_[_0x5b2b('0x40')]({},_0x536813,_0x3df1aa[_0x5b2b('0x41')]);return db[_0x5b2b('0x2a')][_0x5b2b('0x42')](_0x536813)[_0x5b2b('0x22')](function(_0x494a6d){if(_0x494a6d){_0x2b443f=_0x494a6d;return _0x494a6d[_0x5b2b('0x62')]();}return null;})[_0x5b2b('0x22')](function(_0x5df24e){if(_0x5df24e){if(!_0x5df24e[_0x5b2b('0x35')]){throw new db[(_0x5b2b('0x63'))]['ValidationErrorItem']('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x511b02=_0x5df24e;return db[_0x5b2b('0x64')][_0x5b2b('0x3c')]({'raw':!![]});}return null;})[_0x5b2b('0x22')](function(_0x1c29ed){if(_0x1c29ed){_0x27cf7a=_['keyBy'](_0x1c29ed,'id');var _0x27a30b;var _0x560f16=squel['select']();_0x560f16['from'](_0x2b443f[_0x5b2b('0x65')]);for(var _0x162bca=0x0;_0x162bca<_0x511b02['length'];_0x162bca+=0x1){_0x27a30b=_0x511b02[_0x162bca][_0x5b2b('0x66')]?_0x27cf7a[_0x511b02[_0x162bca][_0x5b2b('0x66')]]['metric']:_0x511b02[_0x162bca]['field'];_0x27a30b=_0x511b02[_0x162bca][_0x5b2b('0x67')]?_[_0x5b2b('0x68')](_0x5972d1[_0x511b02[_0x162bca][_0x5b2b('0x67')]],'%s',_0x27a30b):_0x27a30b;_0x27a30b=_0x511b02[_0x162bca]['format']?_['replace'](_0x3598d6[_0x511b02[_0x162bca][_0x5b2b('0x69')]],'%s',_0x27a30b):_0x27a30b;if(_0x511b02[_0x162bca]['groupBy']){_0x560f16[_0x5b2b('0x5f')](_0x27a30b);}_0x511b02[_0x162bca][_0x5b2b('0x6a')]&&_0x560f16[_0x5b2b('0x6b')](_0x27a30b,_0x511b02[_0x162bca][_0x5b2b('0x6a')]===_0x5b2b('0x6c')?![]:!![]);_0x560f16[_0x5b2b('0x60')](_0x27a30b,_0x511b02[_0x162bca][_0x5b2b('0x6d')]||_0x27a30b);}if(_0x2b443f['joins']){_0x2b443f[_0x5b2b('0x6e')]=JSON[_0x5b2b('0x6f')](_0x2b443f['joins']);for(var _0x568657=0x0;_0x568657<_0x2b443f[_0x5b2b('0x6e')][_0x5b2b('0x35')];_0x568657+=0x1){if(_0x2b443f['joins'][_0x568657][_0x5b2b('0x70')]&&_[_0x5b2b('0x71')](_0x41d14f,_0x2b443f['joins'][_0x568657][_0x5b2b('0x70')])&&_0x2b443f[_0x5b2b('0x6e')][_0x568657][_0x5b2b('0x72')]&&_0x2b443f[_0x5b2b('0x6e')][_0x568657][_0x5b2b('0x73')]&&_0x2b443f[_0x5b2b('0x6e')][_0x568657][_0x5b2b('0x74')]){_0x560f16[_0x2b443f[_0x5b2b('0x6e')][_0x568657][_0x5b2b('0x70')]](_0x2b443f['joins'][_0x568657]['foreignTable'],null,util[_0x5b2b('0x69')](_0x5b2b('0x75'),_0x2b443f[_0x5b2b('0x65')],_0x2b443f[_0x5b2b('0x6e')][_0x568657]['parentKey'],_0x2b443f[_0x5b2b('0x6e')][_0x568657][_0x5b2b('0x73')],_0x2b443f['joins'][_0x568657][_0x5b2b('0x74')]));}}}if(_0x2b443f['conditions']){_0x2b443f['conditions']=JSON['parse'](_0x2b443f[_0x5b2b('0x76')]);_0x560f16[_0x5b2b('0x39')](_0x581a72(_0x2b443f[_0x5b2b('0x76')]['group']));}_0x56e334=_0x560f16[_0x5b2b('0x77')]();_0x560f16['limit'](_0x45cf58);_0x560f16[_0x5b2b('0x1a')](0x0);logger[_0x5b2b('0x78')](_0x5b2b('0x79'),_0x560f16[_0x5b2b('0x7a')]());return db['sequelize'][_0x5b2b('0x2f')](_0x560f16[_0x5b2b('0x7a')](),{'type':db[_0x5b2b('0x7b')][_0x5b2b('0x7c')][_0x5b2b('0x7d')]});}})[_0x5b2b('0x22')](respondWithResult(_0x5b8b0e,null))[_0x5b2b('0x3e')](handleError(_0x5b8b0e,null));};function runReport(_0x50a973,_0x2dcfa1,_0x5aeeeb){var _0x1e8158=_0x2dcfa1[_0x5b2b('0x27')];var _0x1604f0=0xa;var _0x20c6a1=[_0x5b2b('0x4d'),_0x5b2b('0x7e'),_0x5b2b('0x4e'),'cross_join'];var _0x112209={'SUM':'SUM(%s)','COUNT':'COUNT(%s)','COUNT DISTINCT':_0x5b2b('0x7f'),'MAX':'MAX(%s)','MIN':_0x5b2b('0x52'),'AVG':_0x5b2b('0x53'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x5b2b('0x55'),'GROUP_CONCAT DESC':_0x5b2b('0x56')};var _0x40aeea={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':'DATE(%s)','HOUR':_0x5b2b('0x59'),'ROUND':_0x5b2b('0x5a'),'UNIX_TIMESTAMP':_0x5b2b('0x5b')};var _0x248310=function(_0x1076cd){return!_[_0x5b2b('0x71')]([_0x5b2b('0x80'),_0x5b2b('0x5c'),_0x5b2b('0x5d'),_0x5b2b('0x81')],_0x1076cd);};var _0x2e91e6=function(_0x26e352){if(!_0x26e352||!_0x26e352[_0x5b2b('0x5e')][_0x5b2b('0x35')]){return'';}for(var _0xb96606='(',_0xe76f6=0x0;_0xe76f6<_0x26e352['rules'][_0x5b2b('0x35')];_0xe76f6+=0x1){_0xe76f6>0x0&&(_0xb96606+='\x20'+_0x26e352[_0x5b2b('0x82')]+'\x20');_0xb96606+=_0x26e352[_0x5b2b('0x5e')][_0xe76f6][_0x5b2b('0x5f')]?_0x2e91e6(_0x26e352[_0x5b2b('0x5e')][_0xe76f6][_0x5b2b('0x5f')]):_0x26e352[_0x5b2b('0x5e')][_0xe76f6]['field']+'\x20'+_0x26e352[_0x5b2b('0x5e')][_0xe76f6][_0x5b2b('0x83')]+(_0x248310(_0x26e352['rules'][_0xe76f6][_0x5b2b('0x83')])?'\x20'+_0x26e352[_0x5b2b('0x5e')][_0xe76f6][_0x5b2b('0x61')]:'');}return _0xb96606+')';};var _0x522cbf={'where':{'id':_0x50a973['id']}},_0x4b8f7a,_0x1bc5ab,_0x2a0c9d,_0x414a65,_0x34d21d;_0x522cbf=_[_0x5b2b('0x40')]({},_0x522cbf,_0x5aeeeb);return db[_0x5b2b('0x2a')]['find'](_0x522cbf)[_0x5b2b('0x22')](function(_0x3163ed){if(_0x3163ed){_0x4b8f7a=_0x3163ed;return _0x3163ed['getFields']();}return null;})[_0x5b2b('0x22')](function(_0x20f378){if(_0x20f378){if(!_0x20f378['length']){throw new db[(_0x5b2b('0x63'))][(_0x5b2b('0x84'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x1bc5ab=_0x20f378;return db[_0x5b2b('0x64')][_0x5b2b('0x3c')]({'raw':!![]});}return null;})[_0x5b2b('0x22')](function(_0x57213c){if(_0x57213c){_0x2a0c9d=_[_0x5b2b('0x85')](_0x57213c,'id');var _0x57a8c0;var _0x3821d2=squel[_0x5b2b('0x86')]();_0x3821d2[_0x5b2b('0x87')](_0x4b8f7a[_0x5b2b('0x65')]);for(var _0xf05d20=0x0;_0xf05d20<_0x1bc5ab[_0x5b2b('0x35')];_0xf05d20+=0x1){_0x57a8c0=_0x1bc5ab[_0xf05d20][_0x5b2b('0x66')]?_0x2a0c9d[_0x1bc5ab[_0xf05d20]['MetricId']]['metric']:_0x1bc5ab[_0xf05d20][_0x5b2b('0x60')];_0x57a8c0=_0x1bc5ab[_0xf05d20][_0x5b2b('0x67')]?_['replace'](_0x112209[_0x1bc5ab[_0xf05d20][_0x5b2b('0x67')]],'%s',_0x57a8c0):_0x57a8c0;_0x57a8c0=_0x1bc5ab[_0xf05d20]['format']?_[_0x5b2b('0x68')](_0x40aeea[_0x1bc5ab[_0xf05d20][_0x5b2b('0x69')]],'%s',_0x57a8c0):_0x57a8c0;if(_0x1bc5ab[_0xf05d20][_0x5b2b('0x88')]){_0x3821d2[_0x5b2b('0x5f')](_0x57a8c0);}_0x1bc5ab[_0xf05d20]['orderBy']&&_0x3821d2['order'](_0x57a8c0,_0x1bc5ab[_0xf05d20]['orderBy']===_0x5b2b('0x6c')?![]:!![]);_0x3821d2[_0x5b2b('0x60')](_0x57a8c0,_0x1bc5ab[_0xf05d20][_0x5b2b('0x6d')]||_0x57a8c0);}if(_0x4b8f7a[_0x5b2b('0x6e')]){_0x4b8f7a[_0x5b2b('0x6e')]=JSON[_0x5b2b('0x6f')](_0x4b8f7a[_0x5b2b('0x6e')]);for(var _0x4e037a=0x0;_0x4e037a<_0x4b8f7a[_0x5b2b('0x6e')][_0x5b2b('0x35')];_0x4e037a+=0x1){if(_0x4b8f7a[_0x5b2b('0x6e')][_0x4e037a]['type']&&_[_0x5b2b('0x71')](_0x20c6a1,_0x4b8f7a['joins'][_0x4e037a][_0x5b2b('0x70')])&&_0x4b8f7a[_0x5b2b('0x6e')][_0x4e037a]['parentKey']&&_0x4b8f7a[_0x5b2b('0x6e')][_0x4e037a]['foreignTable']&&_0x4b8f7a[_0x5b2b('0x6e')][_0x4e037a][_0x5b2b('0x74')]){_0x3821d2[_0x4b8f7a[_0x5b2b('0x6e')][_0x4e037a][_0x5b2b('0x70')]](_0x4b8f7a[_0x5b2b('0x6e')][_0x4e037a][_0x5b2b('0x73')],null,util[_0x5b2b('0x69')](_0x5b2b('0x75'),_0x4b8f7a[_0x5b2b('0x65')],_0x4b8f7a[_0x5b2b('0x6e')][_0x4e037a]['parentKey'],_0x4b8f7a[_0x5b2b('0x6e')][_0x4e037a][_0x5b2b('0x73')],_0x4b8f7a[_0x5b2b('0x6e')][_0x4e037a][_0x5b2b('0x74')]));}}}if(_0x4b8f7a[_0x5b2b('0x76')]){_0x4b8f7a[_0x5b2b('0x76')]=JSON[_0x5b2b('0x6f')](_0x4b8f7a[_0x5b2b('0x76')]);_0x3821d2[_0x5b2b('0x39')](_0x2e91e6(_0x4b8f7a[_0x5b2b('0x76')][_0x5b2b('0x5f')]));}_0x34d21d=_0x3821d2[_0x5b2b('0x77')]();_0x3821d2[_0x5b2b('0x1b')](_0x1604f0);_0x3821d2['offset'](0x0);logger[_0x5b2b('0x78')](_0x5b2b('0x79'),_0x3821d2['toString']());return db[_0x5b2b('0x7b')]['query'](_0x3821d2[_0x5b2b('0x7a')](),{'type':db['sequelize']['QueryTypes'][_0x5b2b('0x7d')]});}})[_0x5b2b('0x22')](function(_0x1d9882){if(!_0x1d9882['length']){throw new db[(_0x5b2b('0x63'))]['ValidationErrorItem'](_0x5b2b('0x89'),0xcc);}if(_0x2dcfa1[_0x5b2b('0x8a')]==='web'){return null;}var _0x5ced15=_[_0x5b2b('0x40')](_0x2dcfa1,{'name':_0x2dcfa1[_0x5b2b('0x8b')]||_0x2dcfa1[_0x5b2b('0x27')]||_0x4b8f7a[_0x5b2b('0x27')],'basename':_0x1e8158,'savename':util['format'](_0x5b2b('0x8c'),_0x2dcfa1['name']||_0x4b8f7a['name'],require('randomstring')['generate'](0x4),_0x2dcfa1['output']||_0x5b2b('0x8d')),'reportId':_0x4b8f7a['id'],'reportType':_0x5b2b('0x8e')});return db[_0x5b2b('0x8f')][_0x5b2b('0x4a')](_0x5ced15,{'raw':!![]});})['then'](function(_0x37d485){if(_0x4b8f7a[_0x5b2b('0x65')]===_0x5b2b('0x90')){_0x34d21d[_0x5b2b('0x39')](_0x4b8f7a[_0x5b2b('0x65')]+_0x5b2b('0x91'),_0x2dcfa1[_0x5b2b('0x92')],_0x2dcfa1[_0x5b2b('0x93')]);}else{_0x34d21d[_0x5b2b('0x39')](_0x4b8f7a[_0x5b2b('0x65')]+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x2dcfa1[_0x5b2b('0x92')],_0x2dcfa1[_0x5b2b('0x93')]);}if(_0x37d485){logger[_0x5b2b('0x94')](_0x5b2b('0x95'),_0x34d21d['toString']());require('child_process')[_0x5b2b('0x96')](path[_0x5b2b('0x4d')](__dirname,_0x5b2b('0x97'),_0x37d485[_0x5b2b('0x8a')]),[_0x37d485['id'],_0x34d21d[_0x5b2b('0x7a')](),path['join'](__dirname,_0x5b2b('0x98'),_0x37d485[_0x5b2b('0x99')]),_0x1e8158]);return _0x37d485;}else{var _0x8784c1=squel[_0x5b2b('0x86')]();_0x8784c1['from']('('+_0x34d21d[_0x5b2b('0x7a')]()+')',_0x5b2b('0x9a'));_0x8784c1[_0x5b2b('0x60')]('COUNT(*)',_0x5b2b('0x19'));_0x34d21d[_0x5b2b('0x1b')](_0x2dcfa1['limit']||_0x1604f0);_0x34d21d[_0x5b2b('0x1a')](_0x2dcfa1[_0x5b2b('0x1a')]||0x0);return dbH['sequelize']['query'](_0x8784c1[_0x5b2b('0x7a')](),{'type':dbH['sequelize']['QueryTypes']['SELECT']})['then'](function(_0x3df31c){if(!_0x3df31c['length']){_0x414a65=0x0;}else{_0x414a65=_0x3df31c[0x0][_0x5b2b('0x19')]||0x0;}return dbH[_0x5b2b('0x7b')][_0x5b2b('0x2f')](_0x34d21d[_0x5b2b('0x7a')](),{'type':dbH['sequelize'][_0x5b2b('0x7c')][_0x5b2b('0x7d')]});})[_0x5b2b('0x22')](function(_0x29b4a9){return{'rows':_0x29b4a9||[],'count':_0x414a65};});}});}exports[_0x5b2b('0x9b')]=function(_0x163a20,_0x553c91){return runReport(_0x163a20[_0x5b2b('0x3f')],_0x163a20[_0x5b2b('0x2f')],_0x163a20[_0x5b2b('0x41')])[_0x5b2b('0x22')](respondWithResult(_0x553c91,null))[_0x5b2b('0x3e')](handleError(_0x553c91,null));};exports[_0x5b2b('0x9c')]=runReport;exports[_0x5b2b('0x2f')]=function(_0xeab12,_0x149a96){var _0x262f23=0xa;var _0x21f110=[_0x5b2b('0x4d'),_0x5b2b('0x7e'),_0x5b2b('0x4e'),_0x5b2b('0x4f')];var _0x4c68e2={'SUM':_0x5b2b('0x9d'),'COUNT':'COUNT(%s)','COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':'MAX(%s)','MIN':'MIN(%s)','AVG':_0x5b2b('0x53'),'GROUP_CONCAT':_0x5b2b('0x54'),'GROUP_CONCAT ASC':_0x5b2b('0x55'),'GROUP_CONCAT DESC':_0x5b2b('0x56')};var _0x1215c8={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':'DATE(%s)','HOUR':_0x5b2b('0x59'),'ROUND':_0x5b2b('0x5a'),'UNIX_TIMESTAMP':_0x5b2b('0x5b')};var _0x2e7849=function(_0x1f606c){return!_['includes']([_0x5b2b('0x80'),_0x5b2b('0x5c'),_0x5b2b('0x5d'),_0x5b2b('0x81')],_0x1f606c);};var _0x47fc6a=function(_0x2ad0fe){if(!_0x2ad0fe||!_0x2ad0fe[_0x5b2b('0x5e')][_0x5b2b('0x35')]){return'';}for(var _0x2ff164='(',_0x3ca146=0x0;_0x3ca146<_0x2ad0fe[_0x5b2b('0x5e')]['length'];_0x3ca146+=0x1){_0x3ca146>0x0&&(_0x2ff164+='\x20'+_0x2ad0fe['operator']+'\x20');_0x2ff164+=_0x2ad0fe['rules'][_0x3ca146][_0x5b2b('0x5f')]?_0x47fc6a(_0x2ad0fe[_0x5b2b('0x5e')][_0x3ca146][_0x5b2b('0x5f')]):_0x2ad0fe['rules'][_0x3ca146][_0x5b2b('0x60')]+'\x20'+_0x2ad0fe['rules'][_0x3ca146][_0x5b2b('0x83')]+(_0x2e7849(_0x2ad0fe['rules'][_0x3ca146][_0x5b2b('0x83')])?'\x20'+_0x2ad0fe[_0x5b2b('0x5e')][_0x3ca146][_0x5b2b('0x61')]:'');}return _0x2ff164+')';};var _0x2e8afa={'where':{'id':_0xeab12[_0x5b2b('0x3f')]['id']}},_0x1979a9,_0x5ee8ec,_0x36f64f,_0x9598b1,_0x32dcab;_0x2e8afa=_['merge']({},_0x2e8afa,_0xeab12[_0x5b2b('0x41')]);return db[_0x5b2b('0x2a')][_0x5b2b('0x42')](_0x2e8afa)[_0x5b2b('0x22')](function(_0x1cbb97){if(_0x1cbb97){_0x1979a9=_0x1cbb97;return _0x1cbb97[_0x5b2b('0x62')]();}return null;})['then'](function(_0x1b7c8b){if(_0x1b7c8b){if(!_0x1b7c8b['length']){throw new db[(_0x5b2b('0x63'))][(_0x5b2b('0x84'))](_0x5b2b('0x9e'),0x193);}_0x5ee8ec=_0x1b7c8b;return db[_0x5b2b('0x64')][_0x5b2b('0x3c')]({'raw':!![]});}return null;})['then'](function(_0x486f1b){if(_0x486f1b){_0x36f64f=_[_0x5b2b('0x85')](_0x486f1b,'id');var _0x4be14d;var _0x54c261=squel[_0x5b2b('0x86')]();_0x54c261['from'](_0x1979a9[_0x5b2b('0x65')]);for(var _0x1c3d10=0x0;_0x1c3d10<_0x5ee8ec[_0x5b2b('0x35')];_0x1c3d10+=0x1){_0x4be14d=_0x5ee8ec[_0x1c3d10][_0x5b2b('0x66')]?_0x36f64f[_0x5ee8ec[_0x1c3d10][_0x5b2b('0x66')]][_0x5b2b('0x9f')]:_0x5ee8ec[_0x1c3d10]['field'];_0x4be14d=_0x5ee8ec[_0x1c3d10][_0x5b2b('0x67')]?_['replace'](_0x4c68e2[_0x5ee8ec[_0x1c3d10]['function']],'%s',_0x4be14d):_0x4be14d;_0x4be14d=_0x5ee8ec[_0x1c3d10][_0x5b2b('0x69')]?_[_0x5b2b('0x68')](_0x1215c8[_0x5ee8ec[_0x1c3d10][_0x5b2b('0x69')]],'%s',_0x4be14d):_0x4be14d;if(_0x5ee8ec[_0x1c3d10][_0x5b2b('0x88')]){_0x54c261[_0x5b2b('0x5f')](_0x4be14d);}_0x5ee8ec[_0x1c3d10][_0x5b2b('0x6a')]&&_0x54c261[_0x5b2b('0x6b')](_0x4be14d,_0x5ee8ec[_0x1c3d10][_0x5b2b('0x6a')]===_0x5b2b('0x6c')?![]:!![]);_0x54c261[_0x5b2b('0x60')](_0x4be14d,_0x5ee8ec[_0x1c3d10][_0x5b2b('0x6d')]||_0x4be14d);}if(_0x1979a9[_0x5b2b('0x6e')]){_0x1979a9[_0x5b2b('0x6e')]=JSON[_0x5b2b('0x6f')](_0x1979a9[_0x5b2b('0x6e')]);for(var _0x3a168e=0x0;_0x3a168e<_0x1979a9[_0x5b2b('0x6e')][_0x5b2b('0x35')];_0x3a168e+=0x1){if(_0x1979a9['joins'][_0x3a168e][_0x5b2b('0x70')]&&_['includes'](_0x21f110,_0x1979a9['joins'][_0x3a168e][_0x5b2b('0x70')])&&_0x1979a9['joins'][_0x3a168e]['parentKey']&&_0x1979a9[_0x5b2b('0x6e')][_0x3a168e][_0x5b2b('0x73')]&&_0x1979a9['joins'][_0x3a168e][_0x5b2b('0x74')]){_0x54c261[_0x1979a9['joins'][_0x3a168e]['type']](_0x1979a9['joins'][_0x3a168e][_0x5b2b('0x73')],null,util[_0x5b2b('0x69')](_0x5b2b('0x75'),_0x1979a9[_0x5b2b('0x65')],_0x1979a9['joins'][_0x3a168e]['parentKey'],_0x1979a9[_0x5b2b('0x6e')][_0x3a168e][_0x5b2b('0x73')],_0x1979a9['joins'][_0x3a168e][_0x5b2b('0x74')]));}}}if(_0x1979a9[_0x5b2b('0x76')]){_0x1979a9['conditions']=JSON[_0x5b2b('0x6f')](_0x1979a9[_0x5b2b('0x76')]);_0x54c261['where'](_0x47fc6a(_0x1979a9['conditions'][_0x5b2b('0x5f')]));}_0x32dcab=_0x54c261[_0x5b2b('0x77')]();_0x54c261[_0x5b2b('0x1b')](_0x262f23);_0x54c261[_0x5b2b('0x1a')](0x0);logger['debug'](_0x5b2b('0x79'),_0x54c261[_0x5b2b('0x7a')]());return db['sequelize'][_0x5b2b('0x2f')](_0x54c261[_0x5b2b('0x7a')](),{'type':db['sequelize'][_0x5b2b('0x7c')]['SELECT']});}})[_0x5b2b('0x22')](function(){return{'sql':_0x32dcab[_0x5b2b('0x7a')]()};})[_0x5b2b('0x22')](respondWithResult(_0x149a96,null))['catch'](handleError(_0x149a96,null));};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.model.js b/server/api/analyticCustomReport/analyticCustomReport.model.js
index 5f5d97d..705744d 100644
--- a/server/api/analyticCustomReport/analyticCustomReport.model.js
+++ b/server/api/analyticCustomReport/analyticCustomReport.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xae93=['AnalyticCustomReport','analytics_custom_reports','lodash','util','../../config/logger','api','moment','bluebird','rimraf','../../config/environment','./analyticCustomReport.attributes','exports','define'];(function(_0x49c3f8,_0x1b8109){var _0x4295c0=function(_0x158e2b){while(--_0x158e2b){_0x49c3f8['push'](_0x49c3f8['shift']());}};_0x4295c0(++_0x1b8109);}(_0xae93,0x188));var _0x3ae9=function(_0x4120ba,_0x2292eb){_0x4120ba=_0x4120ba-0x0;var _0x4da878=_0xae93[_0x4120ba];return _0x4da878;};'use strict';var _=require(_0x3ae9('0x0'));var util=require(_0x3ae9('0x1'));var logger=require(_0x3ae9('0x2'))(_0x3ae9('0x3'));var moment=require(_0x3ae9('0x4'));var BPromise=require(_0x3ae9('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x3ae9('0x6'));var config=require(_0x3ae9('0x7'));var attributes=require(_0x3ae9('0x8'));module[_0x3ae9('0x9')]=function(_0x14b7e2,_0x33a57d){return _0x14b7e2[_0x3ae9('0xa')](_0x3ae9('0xb'),attributes,{'tableName':_0x3ae9('0xc'),'paranoid':!![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xb1ef=['./analyticCustomReport.attributes','define','AnalyticCustomReport','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x4b26b5,_0x4f71fd){var _0x4dec71=function(_0x184329){while(--_0x184329){_0x4b26b5['push'](_0x4b26b5['shift']());}};_0x4dec71(++_0x4f71fd);}(_0xb1ef,0x93));var _0xfb1e=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xb1ef[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0xfb1e('0x0'));var util=require(_0xfb1e('0x1'));var logger=require('../../config/logger')(_0xfb1e('0x2'));var moment=require(_0xfb1e('0x3'));var BPromise=require(_0xfb1e('0x4'));var rp=require(_0xfb1e('0x5'));var fs=require('fs');var path=require(_0xfb1e('0x6'));var rimraf=require(_0xfb1e('0x7'));var config=require(_0xfb1e('0x8'));var attributes=require(_0xfb1e('0x9'));module['exports']=function(_0x1a41a9,_0x382252){return _0x1a41a9[_0xfb1e('0xa')](_0xfb1e('0xb'),attributes,{'tableName':'analytics_custom_reports','paranoid':!![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.rpc.js b/server/api/analyticCustomReport/analyticCustomReport.rpc.js
index ffda69f..5da69f4 100644
--- a/server/api/analyticCustomReport/analyticCustomReport.rpc.js
+++ b/server/api/analyticCustomReport/analyticCustomReport.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x688f=['rpc','../../config/environment','jayson/promise','client','http','request','then','info','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','util','bluebird','randomstring','../../config/utils','../../config/logger'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x688f,0x181));var _0xf688=function(_0x4d613c,_0x55f220){_0x4d613c=_0x4d613c-0x0;var _0x301fe3=_0x688f[_0x4d613c];return _0x301fe3;};'use strict';var _=require(_0xf688('0x0'));var util=require(_0xf688('0x1'));var moment=require('moment');var BPromise=require(_0xf688('0x2'));var rs=require(_0xf688('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xf688('0x4'));var logger=require(_0xf688('0x5'))(_0xf688('0x6'));var config=require(_0xf688('0x7'));var jayson=require(_0xf688('0x8'));var client=jayson[_0xf688('0x9')][_0xf688('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4b9ff1,_0x253d57,_0x23468a){return new BPromise(function(_0xf03a23,_0x347026){return client[_0xf688('0xb')](_0x4b9ff1,_0x23468a)[_0xf688('0xc')](function(_0x484ec9){logger[_0xf688('0xd')](_0xf688('0xe'),_0x253d57,_0xf688('0xf'));logger[_0xf688('0x10')]('AnalyticCustomReport,\x20%s,\x20%s,\x20%s',_0x253d57,'request\x20sent',JSON[_0xf688('0x11')](_0x484ec9));if(_0x484ec9[_0xf688('0x12')]){if(_0x484ec9[_0xf688('0x12')][_0xf688('0x13')]===0x1f4){logger[_0xf688('0x12')](_0xf688('0xe'),_0x253d57,_0x484ec9[_0xf688('0x12')]['message']);return _0x347026(_0x484ec9[_0xf688('0x12')]['message']);}logger[_0xf688('0x12')]('AnalyticCustomReport,\x20%s,\x20%s',_0x253d57,_0x484ec9[_0xf688('0x12')][_0xf688('0x14')]);return _0xf03a23(_0x484ec9[_0xf688('0x12')]['message']);}else{logger[_0xf688('0xd')](_0xf688('0xe'),_0x253d57,_0xf688('0xf'));_0xf03a23(_0x484ec9[_0xf688('0x15')][_0xf688('0x14')]);}})[_0xf688('0x16')](function(_0x2516bd){logger[_0xf688('0x12')](_0xf688('0xe'),_0x253d57,_0x2516bd);_0x347026(_0x2516bd);});});}
\ No newline at end of file
+var _0x4076=['info','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','request','then'];(function(_0x54209d,_0x4610a5){var _0x1d47d9=function(_0x55e0d5){while(--_0x55e0d5){_0x54209d['push'](_0x54209d['shift']());}};_0x1d47d9(++_0x4610a5);}(_0x4076,0xdb));var _0x6407=function(_0x215138,_0x791aa){_0x215138=_0x215138-0x0;var _0x2310e0=_0x4076[_0x215138];return _0x2310e0;};'use strict';var _=require(_0x6407('0x0'));var util=require(_0x6407('0x1'));var moment=require('moment');var BPromise=require(_0x6407('0x2'));var rs=require(_0x6407('0x3'));var fs=require('fs');var Redis=require(_0x6407('0x4'));var db=require(_0x6407('0x5'))['db'];var utils=require(_0x6407('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x6407('0x7'));var jayson=require(_0x6407('0x8'));var client=jayson[_0x6407('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3cfeab,_0x1a96eb,_0x45c859){return new BPromise(function(_0x68bcf9,_0x393736){return client[_0x6407('0xa')](_0x3cfeab,_0x45c859)[_0x6407('0xb')](function(_0x1c3989){logger[_0x6407('0xc')](_0x6407('0xd'),_0x1a96eb,_0x6407('0xe'));logger[_0x6407('0xf')]('AnalyticCustomReport,\x20%s,\x20%s,\x20%s',_0x1a96eb,_0x6407('0xe'),JSON[_0x6407('0x10')](_0x1c3989));if(_0x1c3989[_0x6407('0x11')]){if(_0x1c3989[_0x6407('0x11')][_0x6407('0x12')]===0x1f4){logger['error'](_0x6407('0xd'),_0x1a96eb,_0x1c3989[_0x6407('0x11')][_0x6407('0x13')]);return _0x393736(_0x1c3989[_0x6407('0x11')][_0x6407('0x13')]);}logger['error'](_0x6407('0xd'),_0x1a96eb,_0x1c3989[_0x6407('0x11')][_0x6407('0x13')]);return _0x68bcf9(_0x1c3989[_0x6407('0x11')][_0x6407('0x13')]);}else{logger['info'](_0x6407('0xd'),_0x1a96eb,'request\x20sent');_0x68bcf9(_0x1c3989['result'][_0x6407('0x13')]);}})[_0x6407('0x14')](function(_0x5b198c){logger['error']('AnalyticCustomReport,\x20%s,\x20%s',_0x1a96eb,_0x5b198c);_0x393736(_0x5b198c);});});}
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/index.js b/server/api/analyticCustomReport/index.js
index 8ef6788..3bfc845 100644
--- a/server/api/analyticCustomReport/index.js
+++ b/server/api/analyticCustomReport/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xbf3e=['connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./analyticCustomReport.controller','get','isAuthenticated','index','/:id','show','/:id/preview','preview','/:id/run','run','/:id/query','query','post','create','put','update','exports','multer','util','path'];(function(_0x3f9f0f,_0x531b30){var _0x2eb31d=function(_0x43feb1){while(--_0x43feb1){_0x3f9f0f['push'](_0x3f9f0f['shift']());}};_0x2eb31d(++_0x531b30);}(_0xbf3e,0x1bf));var _0xebf3=function(_0x1bddad,_0x4fcb8b){_0x1bddad=_0x1bddad-0x0;var _0xbaf22c=_0xbf3e[_0x1bddad];return _0xbaf22c;};'use strict';var multer=require(_0xebf3('0x0'));var util=require(_0xebf3('0x1'));var path=require(_0xebf3('0x2'));var timeout=require(_0xebf3('0x3'));var express=require(_0xebf3('0x4'));var router=express[_0xebf3('0x5')]();var auth=require(_0xebf3('0x6'));var interaction=require(_0xebf3('0x7'));var config=require('../../config/environment');var controller=require(_0xebf3('0x8'));router[_0xebf3('0x9')]('/',auth[_0xebf3('0xa')](),controller[_0xebf3('0xb')]);router[_0xebf3('0x9')](_0xebf3('0xc'),auth[_0xebf3('0xa')](),controller[_0xebf3('0xd')]);router[_0xebf3('0x9')](_0xebf3('0xe'),auth[_0xebf3('0xa')](),controller[_0xebf3('0xf')]);router[_0xebf3('0x9')](_0xebf3('0x10'),auth['isAuthenticated'](),controller[_0xebf3('0x11')]);router['get'](_0xebf3('0x12'),auth[_0xebf3('0xa')](),controller[_0xebf3('0x13')]);router[_0xebf3('0x14')]('/',auth['isAuthenticated'](),controller[_0xebf3('0x15')]);router[_0xebf3('0x16')](_0xebf3('0xc'),auth[_0xebf3('0xa')](),controller[_0xebf3('0x17')]);router['delete'](_0xebf3('0xc'),auth[_0xebf3('0xa')](),controller['destroy']);module[_0xebf3('0x18')]=router;
\ No newline at end of file
+var _0x9976=['put','update','delete','destroy','multer','util','path','connect-timeout','express','../../components/auth/service','../../config/environment','./analyticCustomReport.controller','get','isAuthenticated','index','/:id','show','/:id/preview','/:id/run','/:id/query','post','create'];(function(_0x23173f,_0x20b2ae){var _0x27b374=function(_0x4273b9){while(--_0x4273b9){_0x23173f['push'](_0x23173f['shift']());}};_0x27b374(++_0x20b2ae);}(_0x9976,0x138));var _0x6997=function(_0x25e2ee,_0x49d785){_0x25e2ee=_0x25e2ee-0x0;var _0x39ef9b=_0x9976[_0x25e2ee];return _0x39ef9b;};'use strict';var multer=require(_0x6997('0x0'));var util=require(_0x6997('0x1'));var path=require(_0x6997('0x2'));var timeout=require(_0x6997('0x3'));var express=require(_0x6997('0x4'));var router=express['Router']();var auth=require(_0x6997('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x6997('0x6'));var controller=require(_0x6997('0x7'));router[_0x6997('0x8')]('/',auth[_0x6997('0x9')](),controller[_0x6997('0xa')]);router[_0x6997('0x8')](_0x6997('0xb'),auth[_0x6997('0x9')](),controller[_0x6997('0xc')]);router[_0x6997('0x8')](_0x6997('0xd'),auth[_0x6997('0x9')](),controller['preview']);router['get'](_0x6997('0xe'),auth['isAuthenticated'](),controller['run']);router['get'](_0x6997('0xf'),auth['isAuthenticated'](),controller['query']);router[_0x6997('0x10')]('/',auth[_0x6997('0x9')](),controller[_0x6997('0x11')]);router[_0x6997('0x12')]('/:id',auth['isAuthenticated'](),controller[_0x6997('0x13')]);router[_0x6997('0x14')](_0x6997('0xb'),auth['isAuthenticated'](),controller[_0x6997('0x15')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js b/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js
index 38e1d8c..bf797ff 100644
--- a/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js
+++ b/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x89ff=['TEXT','exports','STRING'];(function(_0x26489a,_0x10290d){var _0x2c789c=function(_0xd0d405){while(--_0xd0d405){_0x26489a['push'](_0x26489a['shift']());}};_0x2c789c(++_0x10290d);}(_0x89ff,0xd9));var _0xf89f=function(_0x3d0d71,_0x3c4811){_0x3d0d71=_0x3d0d71-0x0;var _0xc3c53f=_0x89ff[_0x3d0d71];return _0xc3c53f;};'use strict';var Sequelize=require('sequelize');module[_0xf89f('0x0')]={'name':{'type':Sequelize[_0xf89f('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0xf89f('0x1')]},'parent':{'type':Sequelize['STRING']},'table':{'type':Sequelize[_0xf89f('0x1')]},'conditions':{'type':Sequelize[_0xf89f('0x2')]},'joins':{'type':Sequelize[_0xf89f('0x2')]}};
\ No newline at end of file
+var _0x73ac=['sequelize','exports','STRING','TEXT'];(function(_0x1757cd,_0x53d275){var _0x549048=function(_0x2de929){while(--_0x2de929){_0x1757cd['push'](_0x1757cd['shift']());}};_0x549048(++_0x53d275);}(_0x73ac,0x98));var _0xc73a=function(_0x3fa2cd,_0x270474){_0x3fa2cd=_0x3fa2cd-0x0;var _0x170c39=_0x73ac[_0x3fa2cd];return _0x170c39;};'use strict';var Sequelize=require(_0xc73a('0x0'));module[_0xc73a('0x1')]={'name':{'type':Sequelize[_0xc73a('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xc73a('0x2')]},'parent':{'type':Sequelize['STRING']},'table':{'type':Sequelize['STRING']},'conditions':{'type':Sequelize[_0xc73a('0x3')]},'joins':{'type':Sequelize[_0xc73a('0x3')]}};
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.controller.js b/server/api/analyticDefaultReport/analyticDefaultReport.controller.js
index 237a492..455ba1b 100644
--- a/server/api/analyticDefaultReport/analyticDefaultReport.controller.js
+++ b/server/api/analyticDefaultReport/analyticDefaultReport.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xf45c=['bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','dbH','sendStatus','end','status','count','offset','limit','Content-Range','apply','reject','save','update','then','get','DefaultReports','UserProfileResource','destroy','error','name','send','index','map','AnalyticDefaultReport','rawAttributes','fieldName','key','query','keys','filters','model','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','options','includeAll','include','findAll','catch','show','params','create','body','user','role','Reports','UserProfileSection','userProfileId','find','join','right_join','COUNT(%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','SEC_TO_TIME(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','value','getFields','Sequelize','ValidationErrorItem','AnalyticMetric','keyBy','from','field','function','groupBy','orderBy','DESC','alias','joins','parse','type','parentKey','foreignTable','foreignKey','format','%s.%s\x20=\x20%s.%s','table','conditions','debug','Limited\x20Query:','toString','SELECT','cross_join','SUM(%s)','COUNT(DISTINCT\x20%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','DATE(%s)','condition','Please\x20insert\x20at\x20least\x20one\x20field','MetricId','metric','replace','clone','sequelize','QueryTypes','output','web','%s-%s.%s','randomstring','csv','default','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','info','child_process','fork','../../components/export/','../../files/reports','savename','select','COUNT(*)','runReport','html-pdf','rimraf','fast-json-patch','request-promise'];(function(_0x6e7446,_0x120a01){var _0x167b36=function(_0x909f1a){while(--_0x909f1a){_0x6e7446['push'](_0x6e7446['shift']());}};_0x167b36(++_0x120a01);}(_0xf45c,0x1e5));var _0xcf45=function(_0x5bf1ef,_0x3965fc){_0x5bf1ef=_0x5bf1ef-0x0;var _0x14bf87=_0xf45c[_0x5bf1ef];return _0x14bf87;};'use strict';var pdf=require(_0xcf45('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xcf45('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xcf45('0x2'));var rp=require(_0xcf45('0x3'));var moment=require('moment');var BPromise=require(_0xcf45('0x4'));var Mustache=require(_0xcf45('0x5'));var util=require(_0xcf45('0x6'));var path=require(_0xcf45('0x7'));var sox=require(_0xcf45('0x8'));var csv=require('to-csv');var ejs=require(_0xcf45('0x9'));var fs=require('fs');var _=require(_0xcf45('0xa'));var squel=require(_0xcf45('0xb'));var crypto=require(_0xcf45('0xc'));var jsforce=require(_0xcf45('0xd'));var deskjs=require(_0xcf45('0xe'));var toCsv=require(_0xcf45('0xf'));var querystring=require(_0xcf45('0x10'));var Papa=require('papaparse');var Redis=require(_0xcf45('0x11'));var authService=require(_0xcf45('0x12'));var qs=require(_0xcf45('0x13'));var as=require(_0xcf45('0x14'));var hardwareService=require(_0xcf45('0x15'));var logger=require(_0xcf45('0x16'))(_0xcf45('0x17'));var utils=require('../../config/utils');var config=require(_0xcf45('0x18'));var db=require(_0xcf45('0x19'))['db'];var dbH=require(_0xcf45('0x19'))[_0xcf45('0x1a')];function respondWithStatusCode(_0x2277ad,_0x56883c){_0x56883c=_0x56883c||0xcc;return function(_0x5097e5){if(_0x5097e5){return _0x2277ad[_0xcf45('0x1b')](_0x56883c);}return _0x2277ad['status'](_0x56883c)[_0xcf45('0x1c')]();};}function respondWithResult(_0x4e028e,_0x366efb){_0x366efb=_0x366efb||0xc8;return function(_0x557438){if(_0x557438){return _0x4e028e[_0xcf45('0x1d')](_0x366efb)['json'](_0x557438);}};}function respondWithFilteredResult(_0x29d462,_0x42de54){return function(_0x1437c4){if(_0x1437c4){var _0x3c76df=_0x1437c4[_0xcf45('0x1e')],_0x5fe3ed=_0x42de54[_0xcf45('0x1f')],_0x592755=_0x42de54[_0xcf45('0x1f')]+_0x42de54[_0xcf45('0x20')],_0x2b6d49;if(_0x592755>=_0x3c76df){_0x592755=_0x3c76df;_0x2b6d49=0xc8;}else{_0x2b6d49=0xce;}_0x29d462[_0xcf45('0x1d')](_0x2b6d49);return _0x29d462['set'](_0xcf45('0x21'),_0x5fe3ed+'-'+_0x592755+'/'+_0x3c76df)['json'](_0x1437c4);}return null;};}function patchUpdates(_0x5a15ed){return function(_0x415002){try{jsonpatch[_0xcf45('0x22')](_0x415002,_0x5a15ed,!![]);}catch(_0x487eb6){return BPromise[_0xcf45('0x23')](_0x487eb6);}return _0x415002[_0xcf45('0x24')]();};}function saveUpdates(_0x3cf951,_0x1f6046){return function(_0x2e26fd){if(_0x2e26fd){return _0x2e26fd[_0xcf45('0x25')](_0x3cf951)[_0xcf45('0x26')](function(_0x39ad3a){return _0x39ad3a;});}return null;};}function removeEntity(_0x70d184,_0x3e0ba0){return function(_0x17ec20){if(_0x17ec20){return _0x17ec20['destroy']()[_0xcf45('0x26')](function(){var _0x1e5bfc=_0x17ec20[_0xcf45('0x27')]({'plain':!![]});var _0x5b2a27=_0xcf45('0x28');return db[_0xcf45('0x29')][_0xcf45('0x2a')]({'where':{'type':_0x5b2a27,'resourceId':_0x1e5bfc['id']}})[_0xcf45('0x26')](function(){return _0x17ec20;});})[_0xcf45('0x26')](function(){_0x70d184['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x596ccc,_0x31dcf6){return function(_0x264466){if(!_0x264466){_0x596ccc[_0xcf45('0x1b')](0x194);}return _0x264466;};}function handleError(_0x39c084,_0xbc3377){_0xbc3377=_0xbc3377||0x1f4;return function(_0x5dcde5){logger[_0xcf45('0x2b')](_0x5dcde5['stack']);if(_0x5dcde5[_0xcf45('0x2c')]){delete _0x5dcde5['name'];}_0x39c084['status'](_0xbc3377)[_0xcf45('0x2d')](_0x5dcde5);};}exports[_0xcf45('0x2e')]=function(_0x466a9a,_0x5b1d92){var _0x292a4d={},_0x50ce9c={},_0x5b4253={'count':0x0,'rows':[]};var _0xd372ac=_[_0xcf45('0x2f')](db[_0xcf45('0x30')][_0xcf45('0x31')],function(_0x310f02){return{'name':_0x310f02[_0xcf45('0x32')],'type':_0x310f02['type'][_0xcf45('0x33')]};});_0x50ce9c['model']=_[_0xcf45('0x2f')](_0xd372ac,_0xcf45('0x2c'));_0x50ce9c[_0xcf45('0x34')]=_[_0xcf45('0x35')](_0x466a9a['query']);_0x50ce9c[_0xcf45('0x36')]=_['intersection'](_0x50ce9c[_0xcf45('0x37')],_0x50ce9c[_0xcf45('0x34')]);_0x292a4d['attributes']=_[_0xcf45('0x38')](_0x50ce9c[_0xcf45('0x37')],qs[_0xcf45('0x39')](_0x466a9a[_0xcf45('0x34')][_0xcf45('0x39')]));_0x292a4d[_0xcf45('0x3a')]=_0x292a4d[_0xcf45('0x3a')][_0xcf45('0x3b')]?_0x292a4d[_0xcf45('0x3a')]:_0x50ce9c['model'];if(!_0x466a9a['query'][_0xcf45('0x3c')](_0xcf45('0x3d'))){_0x292a4d[_0xcf45('0x20')]=qs['limit'](_0x466a9a[_0xcf45('0x34')]['limit']);_0x292a4d[_0xcf45('0x1f')]=qs[_0xcf45('0x1f')](_0x466a9a[_0xcf45('0x34')][_0xcf45('0x1f')]);}_0x292a4d[_0xcf45('0x3e')]=qs['sort'](_0x466a9a['query'][_0xcf45('0x3f')]);_0x292a4d['where']=qs[_0xcf45('0x36')](_[_0xcf45('0x40')](_0x466a9a[_0xcf45('0x34')],_0x50ce9c['filters']),_0xd372ac);if(_0x466a9a[_0xcf45('0x34')][_0xcf45('0x41')]){_0x292a4d[_0xcf45('0x42')]=_[_0xcf45('0x43')](_0x292a4d[_0xcf45('0x42')],{'$or':_['map'](_0xd372ac,function(_0x8304d9){if(_0x8304d9['type']!=='VIRTUAL'){var _0x352abe={};_0x352abe[_0x8304d9[_0xcf45('0x2c')]]={'$like':'%'+_0x466a9a[_0xcf45('0x34')]['filter']+'%'};return _0x352abe;}})});}_0x292a4d=_[_0xcf45('0x43')]({},_0x292a4d,_0x466a9a[_0xcf45('0x44')]);var _0x3618a5={'where':_0x292a4d[_0xcf45('0x42')]};return db[_0xcf45('0x30')][_0xcf45('0x1e')](_0x3618a5)[_0xcf45('0x26')](function(_0xe34e1c){_0x5b4253[_0xcf45('0x1e')]=_0xe34e1c;if(_0x466a9a[_0xcf45('0x34')][_0xcf45('0x45')]){_0x292a4d[_0xcf45('0x46')]=[{'all':!![]}];}return db[_0xcf45('0x30')][_0xcf45('0x47')](_0x292a4d);})[_0xcf45('0x26')](function(_0x4f946c){_0x5b4253['rows']=_0x4f946c;return _0x5b4253;})[_0xcf45('0x26')](respondWithFilteredResult(_0x5b1d92,_0x292a4d))[_0xcf45('0x48')](handleError(_0x5b1d92,null));};exports[_0xcf45('0x49')]=function(_0x254755,_0x1f2b74){var _0x506aa9={'raw':!![],'where':{'id':_0x254755[_0xcf45('0x4a')]['id']}},_0x58d453={};_0x58d453[_0xcf45('0x37')]=_['keys'](db[_0xcf45('0x30')]['rawAttributes']);_0x58d453[_0xcf45('0x34')]=_['keys'](_0x254755[_0xcf45('0x34')]);_0x58d453[_0xcf45('0x36')]=_['intersection'](_0x58d453['model'],_0x58d453[_0xcf45('0x34')]);_0x506aa9[_0xcf45('0x3a')]=_[_0xcf45('0x38')](_0x58d453[_0xcf45('0x37')],qs[_0xcf45('0x39')](_0x254755[_0xcf45('0x34')]['fields']));_0x506aa9['attributes']=_0x506aa9[_0xcf45('0x3a')][_0xcf45('0x3b')]?_0x506aa9[_0xcf45('0x3a')]:_0x58d453[_0xcf45('0x37')];if(_0x254755['query'][_0xcf45('0x45')]){_0x506aa9[_0xcf45('0x46')]=[{'all':!![]}];}_0x506aa9=_[_0xcf45('0x43')]({},_0x506aa9,_0x254755['options']);return db['AnalyticDefaultReport']['find'](_0x506aa9)[_0xcf45('0x26')](handleEntityNotFound(_0x1f2b74,null))[_0xcf45('0x26')](respondWithResult(_0x1f2b74,null))[_0xcf45('0x48')](handleError(_0x1f2b74,null));};exports[_0xcf45('0x4b')]=function(_0x357df7,_0x5faa6){return db[_0xcf45('0x30')][_0xcf45('0x4b')](_0x357df7[_0xcf45('0x4c')],{})[_0xcf45('0x26')](function(_0x440f5a){var _0x1efab6=_0x357df7[_0xcf45('0x4d')][_0xcf45('0x27')]({'plain':!![]});if(!_0x1efab6)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1efab6[_0xcf45('0x4e')]==='user'){var _0x2c6e91=_0x440f5a[_0xcf45('0x27')]({'plain':!![]});var _0x1fb841=_0xcf45('0x4f');return db[_0xcf45('0x50')]['find']({'where':{'name':_0x1fb841,'userProfileId':_0x1efab6[_0xcf45('0x51')]},'raw':!![]})['then'](function(_0x19a45d){if(_0x19a45d&&_0x19a45d['autoAssociation']===0x0){return db[_0xcf45('0x29')]['create']({'name':_0x2c6e91[_0xcf45('0x2c')],'resourceId':_0x2c6e91['id'],'type':_0xcf45('0x28'),'sectionId':_0x19a45d['id']},{})[_0xcf45('0x26')](function(){return _0x440f5a;});}else{return _0x440f5a;}})['catch'](function(_0x226dc9){logger[_0xcf45('0x2b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x226dc9);throw _0x226dc9;});}return _0x440f5a;})[_0xcf45('0x26')](respondWithResult(_0x5faa6,0xc9))[_0xcf45('0x48')](handleError(_0x5faa6,null));};exports['update']=function(_0x399626,_0xc90de7){if(_0x399626[_0xcf45('0x4c')]['id']){delete _0x399626[_0xcf45('0x4c')]['id'];}return db[_0xcf45('0x30')]['find']({'where':{'id':_0x399626['params']['id']}})[_0xcf45('0x26')](handleEntityNotFound(_0xc90de7,null))['then'](saveUpdates(_0x399626[_0xcf45('0x4c')],null))[_0xcf45('0x26')](respondWithResult(_0xc90de7,null))[_0xcf45('0x48')](handleError(_0xc90de7,null));};exports[_0xcf45('0x2a')]=function(_0xb235de,_0x2b0bd0){return db['AnalyticDefaultReport'][_0xcf45('0x52')]({'where':{'id':_0xb235de[_0xcf45('0x4a')]['id']}})[_0xcf45('0x26')](handleEntityNotFound(_0x2b0bd0,null))['then'](removeEntity(_0x2b0bd0,null))['catch'](handleError(_0x2b0bd0,null));};exports['preview']=function(_0x505e8f,_0x343330){var _0x49a08b=0xa;var _0x2cbefc=[_0xcf45('0x53'),'left_join',_0xcf45('0x54'),'cross_join'];var _0x21dddf={'SUM':'SUM(%s)','COUNT':_0xcf45('0x55'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xcf45('0x56'),'MIN':_0xcf45('0x57'),'AVG':_0xcf45('0x58'),'GROUP_CONCAT':_0xcf45('0x59'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x209398={'SEC_TO_TIME':_0xcf45('0x5a'),'DATE':'DATE(%s)','HOUR':_0xcf45('0x5b'),'ROUND':_0xcf45('0x5c'),'UNIX_TIMESTAMP':_0xcf45('0x5d')};var _0x58ceb3=function(_0x56ba08){return!_[_0xcf45('0x5e')]([_0xcf45('0x5f'),_0xcf45('0x60'),_0xcf45('0x61'),_0xcf45('0x62')],_0x56ba08);};var _0xada5be=function(_0x21e3ec){if(!_0x21e3ec||!_0x21e3ec[_0xcf45('0x63')][_0xcf45('0x3b')]){return'';}for(var _0x14b335='(',_0x54335c=0x0;_0x54335c<_0x21e3ec[_0xcf45('0x63')][_0xcf45('0x3b')];_0x54335c+=0x1){_0x54335c>0x0&&(_0x14b335+='\x20'+_0x21e3ec[_0xcf45('0x64')]+'\x20');_0x14b335+=_0x21e3ec[_0xcf45('0x63')][_0x54335c][_0xcf45('0x65')]?_0xada5be(_0x21e3ec[_0xcf45('0x63')][_0x54335c][_0xcf45('0x65')]):_0x21e3ec[_0xcf45('0x63')][_0x54335c]['field']+'\x20'+_0x21e3ec[_0xcf45('0x63')][_0x54335c]['condition']+(_0x58ceb3(_0x21e3ec[_0xcf45('0x63')][_0x54335c]['condition'])?'\x20'+_0x21e3ec[_0xcf45('0x63')][_0x54335c][_0xcf45('0x66')]:'');}return _0x14b335+')';};var _0x47231e={'where':{'id':_0x505e8f['params']['id']}},_0x1930dc,_0x2239a2,_0x175d96,_0x3859f7,_0x3729e1;_0x47231e=_[_0xcf45('0x43')]({},_0x47231e,_0x505e8f[_0xcf45('0x44')]);return db[_0xcf45('0x30')][_0xcf45('0x52')](_0x47231e)['then'](function(_0x364405){if(_0x364405){_0x1930dc=_0x364405;return _0x364405[_0xcf45('0x67')]();}return null;})[_0xcf45('0x26')](function(_0x36ffcc){if(_0x36ffcc){if(!_0x36ffcc[_0xcf45('0x3b')]){throw new db[(_0xcf45('0x68'))][(_0xcf45('0x69'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x2239a2=_0x36ffcc;return db[_0xcf45('0x6a')][_0xcf45('0x47')]({'raw':!![]});}return null;})[_0xcf45('0x26')](function(_0x46d2c8){if(_0x46d2c8){_0x175d96=_[_0xcf45('0x6b')](_0x46d2c8,'id');var _0x3a49c0;var _0x28d2c1=squel['select']();_0x28d2c1[_0xcf45('0x6c')](_0x1930dc['table']);for(var _0x2304f9=0x0;_0x2304f9<_0x2239a2[_0xcf45('0x3b')];_0x2304f9+=0x1){_0x3a49c0=_0x2239a2[_0x2304f9]['MetricId']?_0x175d96[_0x2239a2[_0x2304f9]['MetricId']]['metric']:_0x2239a2[_0x2304f9][_0xcf45('0x6d')];_0x3a49c0=_0x2239a2[_0x2304f9][_0xcf45('0x6e')]?_['replace'](_0x21dddf[_0x2239a2[_0x2304f9][_0xcf45('0x6e')]],'%s',_0x3a49c0):_0x3a49c0;_0x3a49c0=_0x2239a2[_0x2304f9]['format']?_['replace'](_0x209398[_0x2239a2[_0x2304f9]['format']],'%s',_0x3a49c0):_0x3a49c0;if(_0x2239a2[_0x2304f9][_0xcf45('0x6f')]){_0x28d2c1[_0xcf45('0x65')](_0x3a49c0);}_0x2239a2[_0x2304f9][_0xcf45('0x70')]&&_0x28d2c1[_0xcf45('0x3e')](_0x3a49c0,_0x2239a2[_0x2304f9][_0xcf45('0x70')]===_0xcf45('0x71')?![]:!![]);_0x28d2c1['field'](_0x3a49c0,_0x2239a2[_0x2304f9][_0xcf45('0x72')]||_0x3a49c0);}if(_0x1930dc[_0xcf45('0x73')]){_0x1930dc[_0xcf45('0x73')]=JSON[_0xcf45('0x74')](_0x1930dc[_0xcf45('0x73')]);for(var _0x384cb7=0x0;_0x384cb7<_0x1930dc[_0xcf45('0x73')][_0xcf45('0x3b')];_0x384cb7+=0x1){if(_0x1930dc[_0xcf45('0x73')][_0x384cb7][_0xcf45('0x75')]&&_[_0xcf45('0x5e')](_0x2cbefc,_0x1930dc[_0xcf45('0x73')][_0x384cb7]['type'])&&_0x1930dc['joins'][_0x384cb7][_0xcf45('0x76')]&&_0x1930dc[_0xcf45('0x73')][_0x384cb7][_0xcf45('0x77')]&&_0x1930dc['joins'][_0x384cb7][_0xcf45('0x78')]){_0x28d2c1[_0x1930dc[_0xcf45('0x73')][_0x384cb7][_0xcf45('0x75')]](_0x1930dc[_0xcf45('0x73')][_0x384cb7][_0xcf45('0x77')],null,util[_0xcf45('0x79')](_0xcf45('0x7a'),_0x1930dc[_0xcf45('0x7b')],_0x1930dc[_0xcf45('0x73')][_0x384cb7][_0xcf45('0x76')],_0x1930dc[_0xcf45('0x73')][_0x384cb7]['foreignTable'],_0x1930dc[_0xcf45('0x73')][_0x384cb7]['foreignKey']));}}}if(_0x1930dc['conditions']){_0x1930dc['conditions']=JSON[_0xcf45('0x74')](_0x1930dc[_0xcf45('0x7c')]);_0x28d2c1['where'](_0xada5be(_0x1930dc['conditions']['group']));}_0x3729e1=_0x28d2c1['clone']();_0x28d2c1[_0xcf45('0x20')](_0x49a08b);_0x28d2c1['offset'](0x0);logger[_0xcf45('0x7d')](_0xcf45('0x7e'),_0x28d2c1[_0xcf45('0x7f')]());return db['sequelize'][_0xcf45('0x34')](_0x28d2c1[_0xcf45('0x7f')](),{'type':db['sequelize']['QueryTypes'][_0xcf45('0x80')]});}})[_0xcf45('0x26')](respondWithResult(_0x343330,null))[_0xcf45('0x48')](handleError(_0x343330,null));};function runReport(_0x1dbb6e,_0x26849b,_0x3cacd8){var _0x2aea45=_0x26849b[_0xcf45('0x2c')];var _0x2cc5b3=0xa;var _0x52b161=['join','left_join',_0xcf45('0x54'),_0xcf45('0x81')];var _0x30f8ec={'SUM':_0xcf45('0x82'),'COUNT':_0xcf45('0x55'),'COUNT DISTINCT':_0xcf45('0x83'),'MAX':_0xcf45('0x56'),'MIN':_0xcf45('0x57'),'AVG':_0xcf45('0x58'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0xcf45('0x84'),'GROUP_CONCAT DESC':_0xcf45('0x85')};var _0x3572e0={'SEC_TO_TIME':_0xcf45('0x5a'),'DATE':_0xcf45('0x86'),'HOUR':_0xcf45('0x5b'),'ROUND':_0xcf45('0x5c'),'UNIX_TIMESTAMP':_0xcf45('0x5d')};var _0x45a5ea=function(_0x40b2cf){return!_[_0xcf45('0x5e')]([_0xcf45('0x5f'),_0xcf45('0x60'),_0xcf45('0x61'),_0xcf45('0x62')],_0x40b2cf);};var _0x55f891=function(_0xf88d7a){if(!_0xf88d7a||!_0xf88d7a['rules']['length']){return'';}for(var _0x312150='(',_0x4dd3bb=0x0;_0x4dd3bb<_0xf88d7a[_0xcf45('0x63')][_0xcf45('0x3b')];_0x4dd3bb+=0x1){_0x4dd3bb>0x0&&(_0x312150+='\x20'+_0xf88d7a[_0xcf45('0x64')]+'\x20');_0x312150+=_0xf88d7a[_0xcf45('0x63')][_0x4dd3bb]['group']?_0x55f891(_0xf88d7a['rules'][_0x4dd3bb][_0xcf45('0x65')]):_0xf88d7a[_0xcf45('0x63')][_0x4dd3bb][_0xcf45('0x6d')]+'\x20'+_0xf88d7a[_0xcf45('0x63')][_0x4dd3bb][_0xcf45('0x87')]+(_0x45a5ea(_0xf88d7a[_0xcf45('0x63')][_0x4dd3bb][_0xcf45('0x87')])?'\x20'+_0xf88d7a[_0xcf45('0x63')][_0x4dd3bb][_0xcf45('0x66')]:'');}return _0x312150+')';};var _0x9026d8={'where':{'id':_0x1dbb6e['id']}},_0x12430e,_0x2e41e8,_0xe84928,_0x2fd28f,_0x1d446b;_0x9026d8=_[_0xcf45('0x43')]({},_0x9026d8,_0x3cacd8);return db['AnalyticDefaultReport'][_0xcf45('0x52')](_0x9026d8)[_0xcf45('0x26')](function(_0x4d46c4){if(_0x4d46c4){_0x12430e=_0x4d46c4;return _0x4d46c4[_0xcf45('0x67')]();}return null;})['then'](function(_0x5d5a3e){if(_0x5d5a3e){if(!_0x5d5a3e['length']){throw new db['Sequelize'][(_0xcf45('0x69'))](_0xcf45('0x88'),0x193);}_0x2e41e8=_0x5d5a3e;return db[_0xcf45('0x6a')]['findAll']({'raw':!![]});}return null;})[_0xcf45('0x26')](function(_0x388072){if(_0x388072){_0xe84928=_[_0xcf45('0x6b')](_0x388072,'id');var _0x17d8b5;var _0x28eadb=squel['select']();_0x28eadb[_0xcf45('0x6c')](_0x12430e[_0xcf45('0x7b')]);for(var _0x5ee921=0x0;_0x5ee921<_0x2e41e8['length'];_0x5ee921+=0x1){_0x17d8b5=_0x2e41e8[_0x5ee921][_0xcf45('0x89')]?_0xe84928[_0x2e41e8[_0x5ee921][_0xcf45('0x89')]][_0xcf45('0x8a')]:_0x2e41e8[_0x5ee921][_0xcf45('0x6d')];_0x17d8b5=_0x2e41e8[_0x5ee921][_0xcf45('0x6e')]?_[_0xcf45('0x8b')](_0x30f8ec[_0x2e41e8[_0x5ee921][_0xcf45('0x6e')]],'%s',_0x17d8b5):_0x17d8b5;_0x17d8b5=_0x2e41e8[_0x5ee921][_0xcf45('0x79')]?_[_0xcf45('0x8b')](_0x3572e0[_0x2e41e8[_0x5ee921]['format']],'%s',_0x17d8b5):_0x17d8b5;if(_0x2e41e8[_0x5ee921]['groupBy']){_0x28eadb['group'](_0x17d8b5);}_0x2e41e8[_0x5ee921]['orderBy']&&_0x28eadb[_0xcf45('0x3e')](_0x17d8b5,_0x2e41e8[_0x5ee921][_0xcf45('0x70')]===_0xcf45('0x71')?![]:!![]);_0x28eadb[_0xcf45('0x6d')](_0x17d8b5,_0x2e41e8[_0x5ee921][_0xcf45('0x72')]||_0x17d8b5);}if(_0x12430e[_0xcf45('0x73')]){_0x12430e[_0xcf45('0x73')]=JSON[_0xcf45('0x74')](_0x12430e[_0xcf45('0x73')]);for(var _0x2c25e7=0x0;_0x2c25e7<_0x12430e['joins'][_0xcf45('0x3b')];_0x2c25e7+=0x1){if(_0x12430e[_0xcf45('0x73')][_0x2c25e7]['type']&&_[_0xcf45('0x5e')](_0x52b161,_0x12430e['joins'][_0x2c25e7][_0xcf45('0x75')])&&_0x12430e[_0xcf45('0x73')][_0x2c25e7]['parentKey']&&_0x12430e['joins'][_0x2c25e7][_0xcf45('0x77')]&&_0x12430e[_0xcf45('0x73')][_0x2c25e7][_0xcf45('0x78')]){_0x28eadb[_0x12430e[_0xcf45('0x73')][_0x2c25e7][_0xcf45('0x75')]](_0x12430e[_0xcf45('0x73')][_0x2c25e7]['foreignTable'],null,util[_0xcf45('0x79')](_0xcf45('0x7a'),_0x12430e[_0xcf45('0x7b')],_0x12430e['joins'][_0x2c25e7][_0xcf45('0x76')],_0x12430e[_0xcf45('0x73')][_0x2c25e7][_0xcf45('0x77')],_0x12430e[_0xcf45('0x73')][_0x2c25e7][_0xcf45('0x78')]));}}}if(_0x12430e[_0xcf45('0x7c')]){_0x12430e[_0xcf45('0x7c')]=JSON['parse'](_0x12430e[_0xcf45('0x7c')]);_0x28eadb[_0xcf45('0x42')](_0x55f891(_0x12430e[_0xcf45('0x7c')][_0xcf45('0x65')]));}_0x1d446b=_0x28eadb[_0xcf45('0x8c')]();_0x28eadb[_0xcf45('0x20')](_0x2cc5b3);_0x28eadb['offset'](0x0);logger[_0xcf45('0x7d')](_0xcf45('0x7e'),_0x28eadb[_0xcf45('0x7f')]());return db[_0xcf45('0x8d')]['query'](_0x28eadb[_0xcf45('0x7f')](),{'type':db[_0xcf45('0x8d')][_0xcf45('0x8e')][_0xcf45('0x80')]});}})[_0xcf45('0x26')](function(_0x2ace95){if(!_0x2ace95[_0xcf45('0x3b')]){throw new db[(_0xcf45('0x68'))][(_0xcf45('0x69'))]('No\x20available\x20data',0xcc);}if(_0x26849b[_0xcf45('0x8f')]===_0xcf45('0x90')){return null;}var _0x48214a=_[_0xcf45('0x43')](_0x26849b,{'name':_0x26849b['fullPath']||_0x26849b[_0xcf45('0x2c')]||_0x12430e[_0xcf45('0x2c')],'basename':_0x2aea45,'savename':util[_0xcf45('0x79')](_0xcf45('0x91'),_0x26849b[_0xcf45('0x2c')]||_0x12430e['name'],require(_0xcf45('0x92'))['generate'](0x4),_0x26849b[_0xcf45('0x8f')]||_0xcf45('0x93')),'reportId':_0x12430e['id'],'reportType':_0xcf45('0x94')});return db[_0xcf45('0x95')]['create'](_0x48214a,{'raw':!![]});})[_0xcf45('0x26')](function(_0x38550e){if(_0x12430e['table']===_0xcf45('0x96')){_0x1d446b[_0xcf45('0x42')](_0x12430e['table']+_0xcf45('0x97'),_0x26849b[_0xcf45('0x98')],_0x26849b[_0xcf45('0x99')]);}else{_0x1d446b[_0xcf45('0x42')](_0x12430e[_0xcf45('0x7b')]+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x26849b[_0xcf45('0x98')],_0x26849b[_0xcf45('0x99')]);}if(_0x38550e){logger[_0xcf45('0x9a')]('Run\x20Query:',_0x1d446b[_0xcf45('0x7f')]());require(_0xcf45('0x9b'))[_0xcf45('0x9c')](path[_0xcf45('0x53')](__dirname,_0xcf45('0x9d'),_0x38550e[_0xcf45('0x8f')]),[_0x38550e['id'],_0x1d446b[_0xcf45('0x7f')](),path[_0xcf45('0x53')](__dirname,_0xcf45('0x9e'),_0x38550e[_0xcf45('0x9f')]),_0x2aea45]);return _0x38550e;}else{var _0x9f3fb0=squel[_0xcf45('0xa0')]();_0x9f3fb0['from']('('+_0x1d446b[_0xcf45('0x7f')]()+')','countTable');_0x9f3fb0[_0xcf45('0x6d')](_0xcf45('0xa1'),_0xcf45('0x1e'));_0x1d446b['limit'](_0x26849b[_0xcf45('0x20')]||_0x2cc5b3);_0x1d446b['offset'](_0x26849b['offset']||0x0);return dbH[_0xcf45('0x8d')][_0xcf45('0x34')](_0x9f3fb0[_0xcf45('0x7f')](),{'type':dbH[_0xcf45('0x8d')][_0xcf45('0x8e')]['SELECT']})['then'](function(_0x58dd3e){if(!_0x58dd3e[_0xcf45('0x3b')]){_0x2fd28f=0x0;}else{_0x2fd28f=_0x58dd3e[0x0][_0xcf45('0x1e')]||0x0;}return dbH[_0xcf45('0x8d')][_0xcf45('0x34')](_0x1d446b[_0xcf45('0x7f')](),{'type':dbH['sequelize'][_0xcf45('0x8e')]['SELECT']});})['then'](function(_0x2d71e8){return{'rows':_0x2d71e8||[],'count':_0x2fd28f};});}});}exports['run']=function(_0x117a89,_0x5dea2a){return runReport(_0x117a89['params'],_0x117a89[_0xcf45('0x34')],_0x117a89[_0xcf45('0x44')])['then'](respondWithResult(_0x5dea2a,null))[_0xcf45('0x48')](handleError(_0x5dea2a,null));};exports[_0xcf45('0xa2')]=runReport;exports[_0xcf45('0x34')]=function(_0x5c8eaf,_0x526224){var _0x1ad882=0xa;var _0x446eed=['join','left_join',_0xcf45('0x54'),_0xcf45('0x81')];var _0x8bc3bc={'SUM':_0xcf45('0x82'),'COUNT':_0xcf45('0x55'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xcf45('0x56'),'MIN':_0xcf45('0x57'),'AVG':_0xcf45('0x58'),'GROUP_CONCAT':_0xcf45('0x59'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xcf45('0x85')};var _0x451b5c={'SEC_TO_TIME':_0xcf45('0x5a'),'DATE':_0xcf45('0x86'),'HOUR':'HOUR(%s)','ROUND':_0xcf45('0x5c'),'UNIX_TIMESTAMP':_0xcf45('0x5d')};var _0x2cde28=function(_0x2d6c7){return!_[_0xcf45('0x5e')](['IS\x20NULL',_0xcf45('0x60'),_0xcf45('0x61'),_0xcf45('0x62')],_0x2d6c7);};var _0x2e2c1e=function(_0x14c75e){if(!_0x14c75e||!_0x14c75e[_0xcf45('0x63')][_0xcf45('0x3b')]){return'';}for(var _0x5b2c3f='(',_0xe35a93=0x0;_0xe35a93<_0x14c75e[_0xcf45('0x63')]['length'];_0xe35a93+=0x1){_0xe35a93>0x0&&(_0x5b2c3f+='\x20'+_0x14c75e['operator']+'\x20');_0x5b2c3f+=_0x14c75e[_0xcf45('0x63')][_0xe35a93]['group']?_0x2e2c1e(_0x14c75e[_0xcf45('0x63')][_0xe35a93][_0xcf45('0x65')]):_0x14c75e['rules'][_0xe35a93][_0xcf45('0x6d')]+'\x20'+_0x14c75e['rules'][_0xe35a93]['condition']+(_0x2cde28(_0x14c75e[_0xcf45('0x63')][_0xe35a93]['condition'])?'\x20'+_0x14c75e[_0xcf45('0x63')][_0xe35a93]['value']:'');}return _0x5b2c3f+')';};var _0x5ba2a1={'where':{'id':_0x5c8eaf[_0xcf45('0x4a')]['id']}},_0x4839ad,_0xd2fdf0,_0x33cc72,_0x236c24,_0x582223;_0x5ba2a1=_[_0xcf45('0x43')]({},_0x5ba2a1,_0x5c8eaf['options']);return db[_0xcf45('0x30')][_0xcf45('0x52')](_0x5ba2a1)[_0xcf45('0x26')](function(_0x307abc){if(_0x307abc){_0x4839ad=_0x307abc;return _0x307abc['getFields']();}return null;})[_0xcf45('0x26')](function(_0x1f3e8b){if(_0x1f3e8b){if(!_0x1f3e8b['length']){throw new db[(_0xcf45('0x68'))]['ValidationErrorItem'](_0xcf45('0x88'),0x193);}_0xd2fdf0=_0x1f3e8b;return db[_0xcf45('0x6a')][_0xcf45('0x47')]({'raw':!![]});}return null;})['then'](function(_0x71f709){if(_0x71f709){_0x33cc72=_[_0xcf45('0x6b')](_0x71f709,'id');var _0x350f9c;var _0x139b31=squel[_0xcf45('0xa0')]();_0x139b31[_0xcf45('0x6c')](_0x4839ad[_0xcf45('0x7b')]);for(var _0x661ca3=0x0;_0x661ca3<_0xd2fdf0['length'];_0x661ca3+=0x1){_0x350f9c=_0xd2fdf0[_0x661ca3][_0xcf45('0x89')]?_0x33cc72[_0xd2fdf0[_0x661ca3][_0xcf45('0x89')]][_0xcf45('0x8a')]:_0xd2fdf0[_0x661ca3][_0xcf45('0x6d')];_0x350f9c=_0xd2fdf0[_0x661ca3]['function']?_[_0xcf45('0x8b')](_0x8bc3bc[_0xd2fdf0[_0x661ca3][_0xcf45('0x6e')]],'%s',_0x350f9c):_0x350f9c;_0x350f9c=_0xd2fdf0[_0x661ca3][_0xcf45('0x79')]?_[_0xcf45('0x8b')](_0x451b5c[_0xd2fdf0[_0x661ca3][_0xcf45('0x79')]],'%s',_0x350f9c):_0x350f9c;if(_0xd2fdf0[_0x661ca3][_0xcf45('0x6f')]){_0x139b31[_0xcf45('0x65')](_0x350f9c);}_0xd2fdf0[_0x661ca3]['orderBy']&&_0x139b31[_0xcf45('0x3e')](_0x350f9c,_0xd2fdf0[_0x661ca3][_0xcf45('0x70')]===_0xcf45('0x71')?![]:!![]);_0x139b31[_0xcf45('0x6d')](_0x350f9c,_0xd2fdf0[_0x661ca3][_0xcf45('0x72')]||_0x350f9c);}if(_0x4839ad[_0xcf45('0x73')]){_0x4839ad[_0xcf45('0x73')]=JSON[_0xcf45('0x74')](_0x4839ad['joins']);for(var _0x10371a=0x0;_0x10371a<_0x4839ad[_0xcf45('0x73')][_0xcf45('0x3b')];_0x10371a+=0x1){if(_0x4839ad[_0xcf45('0x73')][_0x10371a][_0xcf45('0x75')]&&_['includes'](_0x446eed,_0x4839ad[_0xcf45('0x73')][_0x10371a]['type'])&&_0x4839ad[_0xcf45('0x73')][_0x10371a][_0xcf45('0x76')]&&_0x4839ad[_0xcf45('0x73')][_0x10371a]['foreignTable']&&_0x4839ad['joins'][_0x10371a]['foreignKey']){_0x139b31[_0x4839ad[_0xcf45('0x73')][_0x10371a][_0xcf45('0x75')]](_0x4839ad[_0xcf45('0x73')][_0x10371a][_0xcf45('0x77')],null,util[_0xcf45('0x79')](_0xcf45('0x7a'),_0x4839ad[_0xcf45('0x7b')],_0x4839ad['joins'][_0x10371a][_0xcf45('0x76')],_0x4839ad[_0xcf45('0x73')][_0x10371a]['foreignTable'],_0x4839ad[_0xcf45('0x73')][_0x10371a]['foreignKey']));}}}if(_0x4839ad[_0xcf45('0x7c')]){_0x4839ad['conditions']=JSON[_0xcf45('0x74')](_0x4839ad[_0xcf45('0x7c')]);_0x139b31[_0xcf45('0x42')](_0x2e2c1e(_0x4839ad[_0xcf45('0x7c')][_0xcf45('0x65')]));}_0x582223=_0x139b31[_0xcf45('0x8c')]();_0x139b31[_0xcf45('0x20')](_0x1ad882);_0x139b31[_0xcf45('0x1f')](0x0);logger[_0xcf45('0x7d')](_0xcf45('0x7e'),_0x139b31[_0xcf45('0x7f')]());return db[_0xcf45('0x8d')]['query'](_0x139b31[_0xcf45('0x7f')](),{'type':db['sequelize'][_0xcf45('0x8e')][_0xcf45('0x80')]});}})[_0xcf45('0x26')](function(){return{'sql':_0x582223['toString']()};})['then'](respondWithResult(_0x526224,null))[_0xcf45('0x48')](handleError(_0x526224,null));};
\ No newline at end of file
+var _0x552b=['../../mysqldb','dbH','sendStatus','status','end','json','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','DefaultReports','error','stack','name','index','map','AnalyticDefaultReport','rawAttributes','fieldName','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','type','merge','options','rows','show','params','keys','find','catch','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','Reports','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','preview','join','left_join','right_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','AVG(%s)','GROUP_CONCAT(%s)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','value','getFields','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','findAll','keyBy','select','from','table','MetricId','metric','function','format','replace','orderBy','DESC','alias','joins','parse','parentKey','foreignTable','%s.%s\x20=\x20%s.%s','foreignKey','conditions','debug','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','groupBy','clone','No\x20available\x20data','output','%s-%s.%s','randomstring','generate','csv','default','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','Run\x20Query:','child_process','fork','../../components/export/','../../files/reports','savename','countTable','run','runReport','cross_join','MIN(%s)','html-pdf','zip-dir','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils'];(function(_0x20ac65,_0x1793dd){var _0x243780=function(_0x133123){while(--_0x133123){_0x20ac65['push'](_0x20ac65['shift']());}};_0x243780(++_0x1793dd);}(_0x552b,0x1e2));var _0xb552=function(_0x5c4cc1,_0x5cd4b7){_0x5c4cc1=_0x5c4cc1-0x0;var _0x1944ef=_0x552b[_0x5c4cc1];return _0x1944ef;};'use strict';var pdf=require(_0xb552('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xb552('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb552('0x2'));var moment=require(_0xb552('0x3'));var BPromise=require(_0xb552('0x4'));var Mustache=require(_0xb552('0x5'));var util=require(_0xb552('0x6'));var path=require('path');var sox=require(_0xb552('0x7'));var csv=require(_0xb552('0x8'));var ejs=require(_0xb552('0x9'));var fs=require('fs');var _=require('lodash');var squel=require(_0xb552('0xa'));var crypto=require(_0xb552('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xb552('0xc'));var toCsv=require('to-csv');var querystring=require(_0xb552('0xd'));var Papa=require(_0xb552('0xe'));var Redis=require(_0xb552('0xf'));var authService=require(_0xb552('0x10'));var qs=require(_0xb552('0x11'));var as=require(_0xb552('0x12'));var hardwareService=require(_0xb552('0x13'));var logger=require('../../config/logger')(_0xb552('0x14'));var utils=require(_0xb552('0x15'));var config=require('../../config/environment');var db=require(_0xb552('0x16'))['db'];var dbH=require('../../mysqldb')[_0xb552('0x17')];function respondWithStatusCode(_0x1e3ebc,_0x55ce0d){_0x55ce0d=_0x55ce0d||0xcc;return function(_0x3f69f2){if(_0x3f69f2){return _0x1e3ebc[_0xb552('0x18')](_0x55ce0d);}return _0x1e3ebc[_0xb552('0x19')](_0x55ce0d)[_0xb552('0x1a')]();};}function respondWithResult(_0x5a0623,_0x301049){_0x301049=_0x301049||0xc8;return function(_0x9e008e){if(_0x9e008e){return _0x5a0623['status'](_0x301049)[_0xb552('0x1b')](_0x9e008e);}};}function respondWithFilteredResult(_0x12adab,_0x10c6e8){return function(_0x3937a1){if(_0x3937a1){var _0x1eb820=_0x3937a1[_0xb552('0x1c')],_0x395903=_0x10c6e8[_0xb552('0x1d')],_0x3bfb0e=_0x10c6e8[_0xb552('0x1d')]+_0x10c6e8['limit'],_0x5c0c96;if(_0x3bfb0e>=_0x1eb820){_0x3bfb0e=_0x1eb820;_0x5c0c96=0xc8;}else{_0x5c0c96=0xce;}_0x12adab['status'](_0x5c0c96);return _0x12adab[_0xb552('0x1e')](_0xb552('0x1f'),_0x395903+'-'+_0x3bfb0e+'/'+_0x1eb820)[_0xb552('0x1b')](_0x3937a1);}return null;};}function patchUpdates(_0xc34a68){return function(_0x5851cf){try{jsonpatch[_0xb552('0x20')](_0x5851cf,_0xc34a68,!![]);}catch(_0x1fa4ce){return BPromise[_0xb552('0x21')](_0x1fa4ce);}return _0x5851cf[_0xb552('0x22')]();};}function saveUpdates(_0x5af2ef,_0x4c75b1){return function(_0x2c50dd){if(_0x2c50dd){return _0x2c50dd[_0xb552('0x23')](_0x5af2ef)[_0xb552('0x24')](function(_0x3556a0){return _0x3556a0;});}return null;};}function removeEntity(_0x200f59,_0x5dd858){return function(_0x4f0187){if(_0x4f0187){return _0x4f0187[_0xb552('0x25')]()[_0xb552('0x24')](function(){var _0x435e79=_0x4f0187['get']({'plain':!![]});var _0x24d0d6=_0xb552('0x26');return db['UserProfileResource']['destroy']({'where':{'type':_0x24d0d6,'resourceId':_0x435e79['id']}})[_0xb552('0x24')](function(){return _0x4f0187;});})[_0xb552('0x24')](function(){_0x200f59[_0xb552('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x505845,_0xe5f347){return function(_0x5a901f){if(!_0x5a901f){_0x505845['sendStatus'](0x194);}return _0x5a901f;};}function handleError(_0x444119,_0x319716){_0x319716=_0x319716||0x1f4;return function(_0x45a8f4){logger[_0xb552('0x27')](_0x45a8f4[_0xb552('0x28')]);if(_0x45a8f4['name']){delete _0x45a8f4[_0xb552('0x29')];}_0x444119[_0xb552('0x19')](_0x319716)['send'](_0x45a8f4);};}exports[_0xb552('0x2a')]=function(_0x23e99f,_0x54a638){var _0x35731f={},_0x197bd6={},_0x4b5c17={'count':0x0,'rows':[]};var _0x19fd68=_[_0xb552('0x2b')](db[_0xb552('0x2c')][_0xb552('0x2d')],function(_0x2042bb){return{'name':_0x2042bb[_0xb552('0x2e')],'type':_0x2042bb['type'][_0xb552('0x2f')]};});_0x197bd6[_0xb552('0x30')]=_['map'](_0x19fd68,_0xb552('0x29'));_0x197bd6[_0xb552('0x31')]=_['keys'](_0x23e99f['query']);_0x197bd6[_0xb552('0x32')]=_[_0xb552('0x33')](_0x197bd6['model'],_0x197bd6[_0xb552('0x31')]);_0x35731f[_0xb552('0x34')]=_[_0xb552('0x33')](_0x197bd6[_0xb552('0x30')],qs[_0xb552('0x35')](_0x23e99f['query'][_0xb552('0x35')]));_0x35731f[_0xb552('0x34')]=_0x35731f[_0xb552('0x34')][_0xb552('0x36')]?_0x35731f[_0xb552('0x34')]:_0x197bd6[_0xb552('0x30')];if(!_0x23e99f[_0xb552('0x31')][_0xb552('0x37')](_0xb552('0x38'))){_0x35731f[_0xb552('0x39')]=qs[_0xb552('0x39')](_0x23e99f[_0xb552('0x31')]['limit']);_0x35731f[_0xb552('0x1d')]=qs[_0xb552('0x1d')](_0x23e99f[_0xb552('0x31')][_0xb552('0x1d')]);}_0x35731f[_0xb552('0x3a')]=qs[_0xb552('0x3b')](_0x23e99f[_0xb552('0x31')][_0xb552('0x3b')]);_0x35731f[_0xb552('0x3c')]=qs[_0xb552('0x32')](_[_0xb552('0x3d')](_0x23e99f[_0xb552('0x31')],_0x197bd6[_0xb552('0x32')]),_0x19fd68);if(_0x23e99f[_0xb552('0x31')][_0xb552('0x3e')]){_0x35731f[_0xb552('0x3c')]=_['merge'](_0x35731f[_0xb552('0x3c')],{'$or':_['map'](_0x19fd68,function(_0x57658c){if(_0x57658c[_0xb552('0x3f')]!=='VIRTUAL'){var _0x47cc05={};_0x47cc05[_0x57658c[_0xb552('0x29')]]={'$like':'%'+_0x23e99f[_0xb552('0x31')][_0xb552('0x3e')]+'%'};return _0x47cc05;}})});}_0x35731f=_[_0xb552('0x40')]({},_0x35731f,_0x23e99f[_0xb552('0x41')]);var _0x279943={'where':_0x35731f[_0xb552('0x3c')]};return db[_0xb552('0x2c')][_0xb552('0x1c')](_0x279943)[_0xb552('0x24')](function(_0xede151){_0x4b5c17[_0xb552('0x1c')]=_0xede151;if(_0x23e99f[_0xb552('0x31')]['includeAll']){_0x35731f['include']=[{'all':!![]}];}return db[_0xb552('0x2c')]['findAll'](_0x35731f);})[_0xb552('0x24')](function(_0x44d867){_0x4b5c17[_0xb552('0x42')]=_0x44d867;return _0x4b5c17;})[_0xb552('0x24')](respondWithFilteredResult(_0x54a638,_0x35731f))['catch'](handleError(_0x54a638,null));};exports[_0xb552('0x43')]=function(_0x5843d9,_0x143b66){var _0x33dc46={'raw':!![],'where':{'id':_0x5843d9[_0xb552('0x44')]['id']}},_0x5f4f98={};_0x5f4f98[_0xb552('0x30')]=_[_0xb552('0x45')](db[_0xb552('0x2c')][_0xb552('0x2d')]);_0x5f4f98[_0xb552('0x31')]=_[_0xb552('0x45')](_0x5843d9[_0xb552('0x31')]);_0x5f4f98['filters']=_[_0xb552('0x33')](_0x5f4f98[_0xb552('0x30')],_0x5f4f98['query']);_0x33dc46['attributes']=_[_0xb552('0x33')](_0x5f4f98[_0xb552('0x30')],qs[_0xb552('0x35')](_0x5843d9[_0xb552('0x31')][_0xb552('0x35')]));_0x33dc46[_0xb552('0x34')]=_0x33dc46['attributes'][_0xb552('0x36')]?_0x33dc46['attributes']:_0x5f4f98[_0xb552('0x30')];if(_0x5843d9[_0xb552('0x31')]['includeAll']){_0x33dc46['include']=[{'all':!![]}];}_0x33dc46=_[_0xb552('0x40')]({},_0x33dc46,_0x5843d9['options']);return db[_0xb552('0x2c')][_0xb552('0x46')](_0x33dc46)['then'](handleEntityNotFound(_0x143b66,null))[_0xb552('0x24')](respondWithResult(_0x143b66,null))[_0xb552('0x47')](handleError(_0x143b66,null));};exports[_0xb552('0x48')]=function(_0x57d58a,_0x3a780a){return db[_0xb552('0x2c')][_0xb552('0x48')](_0x57d58a[_0xb552('0x49')],{})[_0xb552('0x24')](function(_0x107f4b){var _0x1c5822=_0x57d58a['user'][_0xb552('0x4a')]({'plain':!![]});if(!_0x1c5822)throw new Error(_0xb552('0x4b'));if(_0x1c5822[_0xb552('0x4c')]===_0xb552('0x4d')){var _0x4fb784=_0x107f4b[_0xb552('0x4a')]({'plain':!![]});var _0x1078f6=_0xb552('0x4e');return db[_0xb552('0x4f')][_0xb552('0x46')]({'where':{'name':_0x1078f6,'userProfileId':_0x1c5822[_0xb552('0x50')]},'raw':!![]})[_0xb552('0x24')](function(_0x1b8dc3){if(_0x1b8dc3&&_0x1b8dc3[_0xb552('0x51')]===0x0){return db[_0xb552('0x52')][_0xb552('0x48')]({'name':_0x4fb784[_0xb552('0x29')],'resourceId':_0x4fb784['id'],'type':_0xb552('0x26'),'sectionId':_0x1b8dc3['id']},{})[_0xb552('0x24')](function(){return _0x107f4b;});}else{return _0x107f4b;}})[_0xb552('0x47')](function(_0x1bdd68){logger[_0xb552('0x27')](_0xb552('0x53'),_0x1bdd68);throw _0x1bdd68;});}return _0x107f4b;})[_0xb552('0x24')](respondWithResult(_0x3a780a,0xc9))[_0xb552('0x47')](handleError(_0x3a780a,null));};exports[_0xb552('0x23')]=function(_0x200999,_0x231fcc){if(_0x200999[_0xb552('0x49')]['id']){delete _0x200999[_0xb552('0x49')]['id'];}return db['AnalyticDefaultReport']['find']({'where':{'id':_0x200999[_0xb552('0x44')]['id']}})['then'](handleEntityNotFound(_0x231fcc,null))[_0xb552('0x24')](saveUpdates(_0x200999[_0xb552('0x49')],null))[_0xb552('0x24')](respondWithResult(_0x231fcc,null))[_0xb552('0x47')](handleError(_0x231fcc,null));};exports[_0xb552('0x25')]=function(_0x8c6b68,_0x5736df){return db[_0xb552('0x2c')]['find']({'where':{'id':_0x8c6b68[_0xb552('0x44')]['id']}})['then'](handleEntityNotFound(_0x5736df,null))[_0xb552('0x24')](removeEntity(_0x5736df,null))[_0xb552('0x47')](handleError(_0x5736df,null));};exports[_0xb552('0x54')]=function(_0x4d9ae0,_0x56495e){var _0x157b99=0xa;var _0x50eac6=[_0xb552('0x55'),_0xb552('0x56'),_0xb552('0x57'),'cross_join'];var _0x83a3b1={'SUM':_0xb552('0x58'),'COUNT':_0xb552('0x59'),'COUNT DISTINCT':_0xb552('0x5a'),'MAX':_0xb552('0x5b'),'MIN':'MIN(%s)','AVG':_0xb552('0x5c'),'GROUP_CONCAT':_0xb552('0x5d'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x3b4d7c={'SEC_TO_TIME':_0xb552('0x5e'),'DATE':_0xb552('0x5f'),'HOUR':_0xb552('0x60'),'ROUND':_0xb552('0x61'),'UNIX_TIMESTAMP':_0xb552('0x62')};var _0x5e4c59=function(_0x1f0ad4){return!_[_0xb552('0x63')]([_0xb552('0x64'),_0xb552('0x65'),_0xb552('0x66'),_0xb552('0x67')],_0x1f0ad4);};var _0x1187a9=function(_0x5e89bc){if(!_0x5e89bc||!_0x5e89bc[_0xb552('0x68')][_0xb552('0x36')]){return'';}for(var _0x234f95='(',_0x1560a1=0x0;_0x1560a1<_0x5e89bc[_0xb552('0x68')][_0xb552('0x36')];_0x1560a1+=0x1){_0x1560a1>0x0&&(_0x234f95+='\x20'+_0x5e89bc[_0xb552('0x69')]+'\x20');_0x234f95+=_0x5e89bc['rules'][_0x1560a1][_0xb552('0x6a')]?_0x1187a9(_0x5e89bc['rules'][_0x1560a1][_0xb552('0x6a')]):_0x5e89bc[_0xb552('0x68')][_0x1560a1][_0xb552('0x6b')]+'\x20'+_0x5e89bc[_0xb552('0x68')][_0x1560a1][_0xb552('0x6c')]+(_0x5e4c59(_0x5e89bc['rules'][_0x1560a1][_0xb552('0x6c')])?'\x20'+_0x5e89bc[_0xb552('0x68')][_0x1560a1][_0xb552('0x6d')]:'');}return _0x234f95+')';};var _0x283c10={'where':{'id':_0x4d9ae0[_0xb552('0x44')]['id']}},_0x3c4140,_0x5c39ef,_0x2a3f31,_0x389221,_0x346fa7;_0x283c10=_[_0xb552('0x40')]({},_0x283c10,_0x4d9ae0['options']);return db[_0xb552('0x2c')][_0xb552('0x46')](_0x283c10)[_0xb552('0x24')](function(_0x539eab){if(_0x539eab){_0x3c4140=_0x539eab;return _0x539eab[_0xb552('0x6e')]();}return null;})[_0xb552('0x24')](function(_0x423ca9){if(_0x423ca9){if(!_0x423ca9[_0xb552('0x36')]){throw new db[(_0xb552('0x6f'))][(_0xb552('0x70'))](_0xb552('0x71'),0x193);}_0x5c39ef=_0x423ca9;return db[_0xb552('0x72')][_0xb552('0x73')]({'raw':!![]});}return null;})[_0xb552('0x24')](function(_0x3a5533){if(_0x3a5533){_0x2a3f31=_[_0xb552('0x74')](_0x3a5533,'id');var _0x258a1e;var _0x155f7b=squel[_0xb552('0x75')]();_0x155f7b[_0xb552('0x76')](_0x3c4140[_0xb552('0x77')]);for(var _0x3f9efb=0x0;_0x3f9efb<_0x5c39ef[_0xb552('0x36')];_0x3f9efb+=0x1){_0x258a1e=_0x5c39ef[_0x3f9efb][_0xb552('0x78')]?_0x2a3f31[_0x5c39ef[_0x3f9efb][_0xb552('0x78')]][_0xb552('0x79')]:_0x5c39ef[_0x3f9efb][_0xb552('0x6b')];_0x258a1e=_0x5c39ef[_0x3f9efb][_0xb552('0x7a')]?_['replace'](_0x83a3b1[_0x5c39ef[_0x3f9efb][_0xb552('0x7a')]],'%s',_0x258a1e):_0x258a1e;_0x258a1e=_0x5c39ef[_0x3f9efb][_0xb552('0x7b')]?_[_0xb552('0x7c')](_0x3b4d7c[_0x5c39ef[_0x3f9efb][_0xb552('0x7b')]],'%s',_0x258a1e):_0x258a1e;if(_0x5c39ef[_0x3f9efb]['groupBy']){_0x155f7b[_0xb552('0x6a')](_0x258a1e);}_0x5c39ef[_0x3f9efb][_0xb552('0x7d')]&&_0x155f7b[_0xb552('0x3a')](_0x258a1e,_0x5c39ef[_0x3f9efb][_0xb552('0x7d')]===_0xb552('0x7e')?![]:!![]);_0x155f7b[_0xb552('0x6b')](_0x258a1e,_0x5c39ef[_0x3f9efb][_0xb552('0x7f')]||_0x258a1e);}if(_0x3c4140[_0xb552('0x80')]){_0x3c4140[_0xb552('0x80')]=JSON[_0xb552('0x81')](_0x3c4140['joins']);for(var _0x37a110=0x0;_0x37a110<_0x3c4140[_0xb552('0x80')]['length'];_0x37a110+=0x1){if(_0x3c4140[_0xb552('0x80')][_0x37a110]['type']&&_['includes'](_0x50eac6,_0x3c4140[_0xb552('0x80')][_0x37a110][_0xb552('0x3f')])&&_0x3c4140[_0xb552('0x80')][_0x37a110][_0xb552('0x82')]&&_0x3c4140[_0xb552('0x80')][_0x37a110][_0xb552('0x83')]&&_0x3c4140[_0xb552('0x80')][_0x37a110]['foreignKey']){_0x155f7b[_0x3c4140[_0xb552('0x80')][_0x37a110][_0xb552('0x3f')]](_0x3c4140[_0xb552('0x80')][_0x37a110][_0xb552('0x83')],null,util[_0xb552('0x7b')](_0xb552('0x84'),_0x3c4140[_0xb552('0x77')],_0x3c4140[_0xb552('0x80')][_0x37a110][_0xb552('0x82')],_0x3c4140[_0xb552('0x80')][_0x37a110][_0xb552('0x83')],_0x3c4140[_0xb552('0x80')][_0x37a110][_0xb552('0x85')]));}}}if(_0x3c4140[_0xb552('0x86')]){_0x3c4140[_0xb552('0x86')]=JSON[_0xb552('0x81')](_0x3c4140[_0xb552('0x86')]);_0x155f7b[_0xb552('0x3c')](_0x1187a9(_0x3c4140[_0xb552('0x86')][_0xb552('0x6a')]));}_0x346fa7=_0x155f7b['clone']();_0x155f7b[_0xb552('0x39')](_0x157b99);_0x155f7b[_0xb552('0x1d')](0x0);logger[_0xb552('0x87')](_0xb552('0x88'),_0x155f7b[_0xb552('0x89')]());return db[_0xb552('0x8a')][_0xb552('0x31')](_0x155f7b['toString'](),{'type':db[_0xb552('0x8a')][_0xb552('0x8b')][_0xb552('0x8c')]});}})[_0xb552('0x24')](respondWithResult(_0x56495e,null))[_0xb552('0x47')](handleError(_0x56495e,null));};function runReport(_0x5e8630,_0x471916,_0xb2227d){var _0x237337=_0x471916[_0xb552('0x29')];var _0x10a24e=0xa;var _0x3669a9=['join',_0xb552('0x56'),'right_join','cross_join'];var _0x4652fc={'SUM':_0xb552('0x58'),'COUNT':_0xb552('0x59'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xb552('0x5b'),'MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':_0xb552('0x5d'),'GROUP_CONCAT ASC':_0xb552('0x8d'),'GROUP_CONCAT DESC':_0xb552('0x8e')};var _0x2af3b1={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xb552('0x5f'),'HOUR':'HOUR(%s)','ROUND':_0xb552('0x61'),'UNIX_TIMESTAMP':_0xb552('0x62')};var _0x111454=function(_0x228197){return!_[_0xb552('0x63')]([_0xb552('0x64'),_0xb552('0x65'),_0xb552('0x66'),_0xb552('0x67')],_0x228197);};var _0x443fb7=function(_0x403ce1){if(!_0x403ce1||!_0x403ce1['rules'][_0xb552('0x36')]){return'';}for(var _0x16a28a='(',_0x1d187e=0x0;_0x1d187e<_0x403ce1[_0xb552('0x68')][_0xb552('0x36')];_0x1d187e+=0x1){_0x1d187e>0x0&&(_0x16a28a+='\x20'+_0x403ce1[_0xb552('0x69')]+'\x20');_0x16a28a+=_0x403ce1[_0xb552('0x68')][_0x1d187e][_0xb552('0x6a')]?_0x443fb7(_0x403ce1[_0xb552('0x68')][_0x1d187e][_0xb552('0x6a')]):_0x403ce1['rules'][_0x1d187e][_0xb552('0x6b')]+'\x20'+_0x403ce1['rules'][_0x1d187e]['condition']+(_0x111454(_0x403ce1[_0xb552('0x68')][_0x1d187e][_0xb552('0x6c')])?'\x20'+_0x403ce1['rules'][_0x1d187e][_0xb552('0x6d')]:'');}return _0x16a28a+')';};var _0x3b93d2={'where':{'id':_0x5e8630['id']}},_0x9e24e0,_0x3de839,_0x537ddb,_0x75c14b,_0x22dda1;_0x3b93d2=_[_0xb552('0x40')]({},_0x3b93d2,_0xb2227d);return db['AnalyticDefaultReport'][_0xb552('0x46')](_0x3b93d2)['then'](function(_0x3d373c){if(_0x3d373c){_0x9e24e0=_0x3d373c;return _0x3d373c[_0xb552('0x6e')]();}return null;})[_0xb552('0x24')](function(_0x1d75cd){if(_0x1d75cd){if(!_0x1d75cd[_0xb552('0x36')]){throw new db[(_0xb552('0x6f'))][(_0xb552('0x70'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x3de839=_0x1d75cd;return db[_0xb552('0x72')][_0xb552('0x73')]({'raw':!![]});}return null;})[_0xb552('0x24')](function(_0x4ceeaf){if(_0x4ceeaf){_0x537ddb=_[_0xb552('0x74')](_0x4ceeaf,'id');var _0x3bba7f;var _0x9fc88d=squel['select']();_0x9fc88d[_0xb552('0x76')](_0x9e24e0['table']);for(var _0x4a6305=0x0;_0x4a6305<_0x3de839['length'];_0x4a6305+=0x1){_0x3bba7f=_0x3de839[_0x4a6305][_0xb552('0x78')]?_0x537ddb[_0x3de839[_0x4a6305]['MetricId']][_0xb552('0x79')]:_0x3de839[_0x4a6305]['field'];_0x3bba7f=_0x3de839[_0x4a6305][_0xb552('0x7a')]?_[_0xb552('0x7c')](_0x4652fc[_0x3de839[_0x4a6305]['function']],'%s',_0x3bba7f):_0x3bba7f;_0x3bba7f=_0x3de839[_0x4a6305][_0xb552('0x7b')]?_[_0xb552('0x7c')](_0x2af3b1[_0x3de839[_0x4a6305]['format']],'%s',_0x3bba7f):_0x3bba7f;if(_0x3de839[_0x4a6305][_0xb552('0x8f')]){_0x9fc88d[_0xb552('0x6a')](_0x3bba7f);}_0x3de839[_0x4a6305][_0xb552('0x7d')]&&_0x9fc88d[_0xb552('0x3a')](_0x3bba7f,_0x3de839[_0x4a6305][_0xb552('0x7d')]===_0xb552('0x7e')?![]:!![]);_0x9fc88d[_0xb552('0x6b')](_0x3bba7f,_0x3de839[_0x4a6305]['alias']||_0x3bba7f);}if(_0x9e24e0[_0xb552('0x80')]){_0x9e24e0[_0xb552('0x80')]=JSON['parse'](_0x9e24e0['joins']);for(var _0x21a27f=0x0;_0x21a27f<_0x9e24e0[_0xb552('0x80')][_0xb552('0x36')];_0x21a27f+=0x1){if(_0x9e24e0[_0xb552('0x80')][_0x21a27f]['type']&&_[_0xb552('0x63')](_0x3669a9,_0x9e24e0['joins'][_0x21a27f][_0xb552('0x3f')])&&_0x9e24e0[_0xb552('0x80')][_0x21a27f]['parentKey']&&_0x9e24e0[_0xb552('0x80')][_0x21a27f][_0xb552('0x83')]&&_0x9e24e0[_0xb552('0x80')][_0x21a27f][_0xb552('0x85')]){_0x9fc88d[_0x9e24e0[_0xb552('0x80')][_0x21a27f][_0xb552('0x3f')]](_0x9e24e0['joins'][_0x21a27f][_0xb552('0x83')],null,util[_0xb552('0x7b')]('%s.%s\x20=\x20%s.%s',_0x9e24e0[_0xb552('0x77')],_0x9e24e0['joins'][_0x21a27f][_0xb552('0x82')],_0x9e24e0[_0xb552('0x80')][_0x21a27f][_0xb552('0x83')],_0x9e24e0[_0xb552('0x80')][_0x21a27f]['foreignKey']));}}}if(_0x9e24e0['conditions']){_0x9e24e0[_0xb552('0x86')]=JSON['parse'](_0x9e24e0['conditions']);_0x9fc88d[_0xb552('0x3c')](_0x443fb7(_0x9e24e0[_0xb552('0x86')][_0xb552('0x6a')]));}_0x22dda1=_0x9fc88d[_0xb552('0x90')]();_0x9fc88d[_0xb552('0x39')](_0x10a24e);_0x9fc88d['offset'](0x0);logger[_0xb552('0x87')](_0xb552('0x88'),_0x9fc88d['toString']());return db[_0xb552('0x8a')][_0xb552('0x31')](_0x9fc88d[_0xb552('0x89')](),{'type':db[_0xb552('0x8a')][_0xb552('0x8b')][_0xb552('0x8c')]});}})[_0xb552('0x24')](function(_0xa35359){if(!_0xa35359[_0xb552('0x36')]){throw new db[(_0xb552('0x6f'))][(_0xb552('0x70'))](_0xb552('0x91'),0xcc);}if(_0x471916[_0xb552('0x92')]==='web'){return null;}var _0xeb995b=_[_0xb552('0x40')](_0x471916,{'name':_0x471916['fullPath']||_0x471916[_0xb552('0x29')]||_0x9e24e0[_0xb552('0x29')],'basename':_0x237337,'savename':util['format'](_0xb552('0x93'),_0x471916[_0xb552('0x29')]||_0x9e24e0[_0xb552('0x29')],require(_0xb552('0x94'))[_0xb552('0x95')](0x4),_0x471916[_0xb552('0x92')]||_0xb552('0x96')),'reportId':_0x9e24e0['id'],'reportType':_0xb552('0x97')});return db[_0xb552('0x98')][_0xb552('0x48')](_0xeb995b,{'raw':!![]});})[_0xb552('0x24')](function(_0x3610dc){if(_0x9e24e0[_0xb552('0x77')]===_0xb552('0x99')){_0x22dda1[_0xb552('0x3c')](_0x9e24e0['table']+_0xb552('0x9a'),_0x471916[_0xb552('0x9b')],_0x471916[_0xb552('0x9c')]);}else{_0x22dda1[_0xb552('0x3c')](_0x9e24e0[_0xb552('0x77')]+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x471916['startDate'],_0x471916[_0xb552('0x9c')]);}if(_0x3610dc){logger['info'](_0xb552('0x9d'),_0x22dda1[_0xb552('0x89')]());require(_0xb552('0x9e'))[_0xb552('0x9f')](path[_0xb552('0x55')](__dirname,_0xb552('0xa0'),_0x3610dc[_0xb552('0x92')]),[_0x3610dc['id'],_0x22dda1[_0xb552('0x89')](),path['join'](__dirname,_0xb552('0xa1'),_0x3610dc[_0xb552('0xa2')]),_0x237337]);return _0x3610dc;}else{var _0x229306=squel[_0xb552('0x75')]();_0x229306[_0xb552('0x76')]('('+_0x22dda1['toString']()+')',_0xb552('0xa3'));_0x229306['field']('COUNT(*)','count');_0x22dda1[_0xb552('0x39')](_0x471916[_0xb552('0x39')]||_0x10a24e);_0x22dda1['offset'](_0x471916[_0xb552('0x1d')]||0x0);return dbH[_0xb552('0x8a')][_0xb552('0x31')](_0x229306[_0xb552('0x89')](),{'type':dbH[_0xb552('0x8a')][_0xb552('0x8b')][_0xb552('0x8c')]})[_0xb552('0x24')](function(_0x46bc3c){if(!_0x46bc3c[_0xb552('0x36')]){_0x75c14b=0x0;}else{_0x75c14b=_0x46bc3c[0x0][_0xb552('0x1c')]||0x0;}return dbH[_0xb552('0x8a')][_0xb552('0x31')](_0x22dda1[_0xb552('0x89')](),{'type':dbH[_0xb552('0x8a')][_0xb552('0x8b')][_0xb552('0x8c')]});})[_0xb552('0x24')](function(_0x31238f){return{'rows':_0x31238f||[],'count':_0x75c14b};});}});}exports[_0xb552('0xa4')]=function(_0xbca8e6,_0x1bed6d){return runReport(_0xbca8e6[_0xb552('0x44')],_0xbca8e6['query'],_0xbca8e6['options'])[_0xb552('0x24')](respondWithResult(_0x1bed6d,null))[_0xb552('0x47')](handleError(_0x1bed6d,null));};exports[_0xb552('0xa5')]=runReport;exports[_0xb552('0x31')]=function(_0x5a8e3c,_0x2682ad){var _0x3c0f85=0xa;var _0x16e911=[_0xb552('0x55'),_0xb552('0x56'),_0xb552('0x57'),_0xb552('0xa6')];var _0x243895={'SUM':'SUM(%s)','COUNT':_0xb552('0x59'),'COUNT DISTINCT':_0xb552('0x5a'),'MAX':_0xb552('0x5b'),'MIN':_0xb552('0xa7'),'AVG':'AVG(%s)','GROUP_CONCAT':_0xb552('0x5d'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xb552('0x8e')};var _0xdc245e={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xb552('0x5f'),'HOUR':_0xb552('0x60'),'ROUND':_0xb552('0x61'),'UNIX_TIMESTAMP':_0xb552('0x62')};var _0x5967c8=function(_0x4eb9e6){return!_[_0xb552('0x63')](['IS\x20NULL','IS\x20NOT\x20NULL',_0xb552('0x66'),_0xb552('0x67')],_0x4eb9e6);};var _0x33612e=function(_0x4e956e){if(!_0x4e956e||!_0x4e956e[_0xb552('0x68')]['length']){return'';}for(var _0x3bd747='(',_0x3afd23=0x0;_0x3afd23<_0x4e956e['rules'][_0xb552('0x36')];_0x3afd23+=0x1){_0x3afd23>0x0&&(_0x3bd747+='\x20'+_0x4e956e[_0xb552('0x69')]+'\x20');_0x3bd747+=_0x4e956e[_0xb552('0x68')][_0x3afd23][_0xb552('0x6a')]?_0x33612e(_0x4e956e['rules'][_0x3afd23]['group']):_0x4e956e[_0xb552('0x68')][_0x3afd23][_0xb552('0x6b')]+'\x20'+_0x4e956e['rules'][_0x3afd23]['condition']+(_0x5967c8(_0x4e956e['rules'][_0x3afd23][_0xb552('0x6c')])?'\x20'+_0x4e956e['rules'][_0x3afd23][_0xb552('0x6d')]:'');}return _0x3bd747+')';};var _0x3a8a6d={'where':{'id':_0x5a8e3c[_0xb552('0x44')]['id']}},_0x37f53a,_0x1e9bb9,_0x2b26ac,_0x3ed7fd,_0x4b573a;_0x3a8a6d=_['merge']({},_0x3a8a6d,_0x5a8e3c['options']);return db['AnalyticDefaultReport'][_0xb552('0x46')](_0x3a8a6d)[_0xb552('0x24')](function(_0x2b8119){if(_0x2b8119){_0x37f53a=_0x2b8119;return _0x2b8119[_0xb552('0x6e')]();}return null;})[_0xb552('0x24')](function(_0x35cbd3){if(_0x35cbd3){if(!_0x35cbd3[_0xb552('0x36')]){throw new db[(_0xb552('0x6f'))][(_0xb552('0x70'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x1e9bb9=_0x35cbd3;return db[_0xb552('0x72')][_0xb552('0x73')]({'raw':!![]});}return null;})[_0xb552('0x24')](function(_0x27861e){if(_0x27861e){_0x2b26ac=_[_0xb552('0x74')](_0x27861e,'id');var _0x3c8e2f;var _0x513ff0=squel[_0xb552('0x75')]();_0x513ff0[_0xb552('0x76')](_0x37f53a[_0xb552('0x77')]);for(var _0x492f10=0x0;_0x492f10<_0x1e9bb9[_0xb552('0x36')];_0x492f10+=0x1){_0x3c8e2f=_0x1e9bb9[_0x492f10]['MetricId']?_0x2b26ac[_0x1e9bb9[_0x492f10]['MetricId']][_0xb552('0x79')]:_0x1e9bb9[_0x492f10][_0xb552('0x6b')];_0x3c8e2f=_0x1e9bb9[_0x492f10][_0xb552('0x7a')]?_[_0xb552('0x7c')](_0x243895[_0x1e9bb9[_0x492f10]['function']],'%s',_0x3c8e2f):_0x3c8e2f;_0x3c8e2f=_0x1e9bb9[_0x492f10]['format']?_[_0xb552('0x7c')](_0xdc245e[_0x1e9bb9[_0x492f10][_0xb552('0x7b')]],'%s',_0x3c8e2f):_0x3c8e2f;if(_0x1e9bb9[_0x492f10][_0xb552('0x8f')]){_0x513ff0[_0xb552('0x6a')](_0x3c8e2f);}_0x1e9bb9[_0x492f10][_0xb552('0x7d')]&&_0x513ff0['order'](_0x3c8e2f,_0x1e9bb9[_0x492f10][_0xb552('0x7d')]===_0xb552('0x7e')?![]:!![]);_0x513ff0['field'](_0x3c8e2f,_0x1e9bb9[_0x492f10][_0xb552('0x7f')]||_0x3c8e2f);}if(_0x37f53a[_0xb552('0x80')]){_0x37f53a[_0xb552('0x80')]=JSON[_0xb552('0x81')](_0x37f53a['joins']);for(var _0x1193f6=0x0;_0x1193f6<_0x37f53a[_0xb552('0x80')][_0xb552('0x36')];_0x1193f6+=0x1){if(_0x37f53a[_0xb552('0x80')][_0x1193f6][_0xb552('0x3f')]&&_['includes'](_0x16e911,_0x37f53a[_0xb552('0x80')][_0x1193f6][_0xb552('0x3f')])&&_0x37f53a[_0xb552('0x80')][_0x1193f6]['parentKey']&&_0x37f53a[_0xb552('0x80')][_0x1193f6][_0xb552('0x83')]&&_0x37f53a[_0xb552('0x80')][_0x1193f6][_0xb552('0x85')]){_0x513ff0[_0x37f53a[_0xb552('0x80')][_0x1193f6]['type']](_0x37f53a[_0xb552('0x80')][_0x1193f6][_0xb552('0x83')],null,util[_0xb552('0x7b')](_0xb552('0x84'),_0x37f53a[_0xb552('0x77')],_0x37f53a[_0xb552('0x80')][_0x1193f6][_0xb552('0x82')],_0x37f53a[_0xb552('0x80')][_0x1193f6][_0xb552('0x83')],_0x37f53a[_0xb552('0x80')][_0x1193f6]['foreignKey']));}}}if(_0x37f53a[_0xb552('0x86')]){_0x37f53a[_0xb552('0x86')]=JSON[_0xb552('0x81')](_0x37f53a[_0xb552('0x86')]);_0x513ff0[_0xb552('0x3c')](_0x33612e(_0x37f53a[_0xb552('0x86')][_0xb552('0x6a')]));}_0x4b573a=_0x513ff0['clone']();_0x513ff0[_0xb552('0x39')](_0x3c0f85);_0x513ff0[_0xb552('0x1d')](0x0);logger['debug'](_0xb552('0x88'),_0x513ff0[_0xb552('0x89')]());return db[_0xb552('0x8a')][_0xb552('0x31')](_0x513ff0[_0xb552('0x89')](),{'type':db[_0xb552('0x8a')][_0xb552('0x8b')][_0xb552('0x8c')]});}})['then'](function(){return{'sql':_0x4b573a[_0xb552('0x89')]()};})[_0xb552('0x24')](respondWithResult(_0x2682ad,null))[_0xb552('0x47')](handleError(_0x2682ad,null));};
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.model.js b/server/api/analyticDefaultReport/analyticDefaultReport.model.js
index 57ffc6f..f6a4a25 100644
--- a/server/api/analyticDefaultReport/analyticDefaultReport.model.js
+++ b/server/api/analyticDefaultReport/analyticDefaultReport.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x5fab=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./analyticDefaultReport.attributes','exports','AnalyticDefaultReport','analytics_default_reports','lodash','util'];(function(_0x12304f,_0x3c24c4){var _0x18f866=function(_0x4ff5e7){while(--_0x4ff5e7){_0x12304f['push'](_0x12304f['shift']());}};_0x18f866(++_0x3c24c4);}(_0x5fab,0x177));var _0xb5fa=function(_0x110c54,_0xa3cfcb){_0x110c54=_0x110c54-0x0;var _0x58a348=_0x5fab[_0x110c54];return _0x58a348;};'use strict';var _=require(_0xb5fa('0x0'));var util=require(_0xb5fa('0x1'));var logger=require('../../config/logger')(_0xb5fa('0x2'));var moment=require(_0xb5fa('0x3'));var BPromise=require(_0xb5fa('0x4'));var rp=require(_0xb5fa('0x5'));var fs=require('fs');var path=require(_0xb5fa('0x6'));var rimraf=require(_0xb5fa('0x7'));var config=require(_0xb5fa('0x8'));var attributes=require(_0xb5fa('0x9'));module[_0xb5fa('0xa')]=function(_0x44df89,_0x4a0249){return _0x44df89['define'](_0xb5fa('0xb'),attributes,{'tableName':_0xb5fa('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x66fa=['define','AnalyticDefaultReport','analytics_default_reports','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x3a6efd,_0x2a5102){var _0x487b9a=function(_0x104f89){while(--_0x104f89){_0x3a6efd['push'](_0x3a6efd['shift']());}};_0x487b9a(++_0x2a5102);}(_0x66fa,0x117));var _0xa66f=function(_0x547657,_0x5ee353){_0x547657=_0x547657-0x0;var _0x56c5e3=_0x66fa[_0x547657];return _0x56c5e3;};'use strict';var _=require(_0xa66f('0x0'));var util=require(_0xa66f('0x1'));var logger=require('../../config/logger')(_0xa66f('0x2'));var moment=require(_0xa66f('0x3'));var BPromise=require(_0xa66f('0x4'));var rp=require(_0xa66f('0x5'));var fs=require('fs');var path=require(_0xa66f('0x6'));var rimraf=require(_0xa66f('0x7'));var config=require(_0xa66f('0x8'));var attributes=require('./analyticDefaultReport.attributes');module['exports']=function(_0x2239d3,_0x20a150){return _0x2239d3[_0xa66f('0x9')](_0xa66f('0xa'),attributes,{'tableName':_0xa66f('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.rpc.js b/server/api/analyticDefaultReport/analyticDefaultReport.rpc.js
index c99e8f3..69fc4db 100644
--- a/server/api/analyticDefaultReport/analyticDefaultReport.rpc.js
+++ b/server/api/analyticDefaultReport/analyticDefaultReport.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x25c2=['info','AnalyticDefaultReport,\x20%s,\x20%s','debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http'];(function(_0x3a2649,_0x2291f0){var _0x38ae1e=function(_0x3a0fa8){while(--_0x3a0fa8){_0x3a2649['push'](_0x3a2649['shift']());}};_0x38ae1e(++_0x2291f0);}(_0x25c2,0xdd));var _0x225c=function(_0x34843e,_0x4c4224){_0x34843e=_0x34843e-0x0;var _0x598f7f=_0x25c2[_0x34843e];return _0x598f7f;};'use strict';var _=require(_0x225c('0x0'));var util=require('util');var moment=require(_0x225c('0x1'));var BPromise=require(_0x225c('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x225c('0x3'));var db=require(_0x225c('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x225c('0x5'))(_0x225c('0x6'));var config=require('../../config/environment');var jayson=require(_0x225c('0x7'));var client=jayson[_0x225c('0x8')][_0x225c('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x36c1aa,_0x158fdb,_0x299150){return new BPromise(function(_0x4dcdb3,_0x5d200b){return client['request'](_0x36c1aa,_0x299150)['then'](function(_0x21b2f8){logger[_0x225c('0xa')](_0x225c('0xb'),_0x158fdb,'request\x20sent');logger[_0x225c('0xc')](_0x225c('0xd'),_0x158fdb,_0x225c('0xe'),JSON[_0x225c('0xf')](_0x21b2f8));if(_0x21b2f8['error']){if(_0x21b2f8[_0x225c('0x10')][_0x225c('0x11')]===0x1f4){logger['error'](_0x225c('0xb'),_0x158fdb,_0x21b2f8[_0x225c('0x10')][_0x225c('0x12')]);return _0x5d200b(_0x21b2f8['error'][_0x225c('0x12')]);}logger[_0x225c('0x10')](_0x225c('0xb'),_0x158fdb,_0x21b2f8[_0x225c('0x10')][_0x225c('0x12')]);return _0x4dcdb3(_0x21b2f8[_0x225c('0x10')][_0x225c('0x12')]);}else{logger[_0x225c('0xa')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x158fdb,'request\x20sent');_0x4dcdb3(_0x21b2f8[_0x225c('0x13')][_0x225c('0x12')]);}})[_0x225c('0x14')](function(_0x1c2c55){logger['error'](_0x225c('0xb'),_0x158fdb,_0x1c2c55);_0x5d200b(_0x1c2c55);});});}
\ No newline at end of file
+var _0xc91b=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','then','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','info','result','catch','lodash'];(function(_0x46b17c,_0x38d50c){var _0xee6fa2=function(_0x4430c5){while(--_0x4430c5){_0x46b17c['push'](_0x46b17c['shift']());}};_0xee6fa2(++_0x38d50c);}(_0xc91b,0x16f));var _0xbc91=function(_0x1f29d4,_0x20cdb6){_0x1f29d4=_0x1f29d4-0x0;var _0x1caf45=_0xc91b[_0x1f29d4];return _0x1caf45;};'use strict';var _=require(_0xbc91('0x0'));var util=require(_0xbc91('0x1'));var moment=require(_0xbc91('0x2'));var BPromise=require(_0xbc91('0x3'));var rs=require(_0xbc91('0x4'));var fs=require('fs');var Redis=require(_0xbc91('0x5'));var db=require(_0xbc91('0x6'))['db'];var utils=require(_0xbc91('0x7'));var logger=require('../../config/logger')(_0xbc91('0x8'));var config=require(_0xbc91('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xbc91('0xa')][_0xbc91('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x535cb9,_0xf88d45,_0x43731a){return new BPromise(function(_0x36e15f,_0x34f079){return client[_0xbc91('0xc')](_0x535cb9,_0x43731a)[_0xbc91('0xd')](function(_0xa20d9){logger['info'](_0xbc91('0xe'),_0xf88d45,_0xbc91('0xf'));logger[_0xbc91('0x10')]('AnalyticDefaultReport,\x20%s,\x20%s,\x20%s',_0xf88d45,'request\x20sent',JSON[_0xbc91('0x11')](_0xa20d9));if(_0xa20d9[_0xbc91('0x12')]){if(_0xa20d9['error']['code']===0x1f4){logger[_0xbc91('0x12')]('AnalyticDefaultReport,\x20%s,\x20%s',_0xf88d45,_0xa20d9['error'][_0xbc91('0x13')]);return _0x34f079(_0xa20d9[_0xbc91('0x12')][_0xbc91('0x13')]);}logger[_0xbc91('0x12')]('AnalyticDefaultReport,\x20%s,\x20%s',_0xf88d45,_0xa20d9['error'][_0xbc91('0x13')]);return _0x36e15f(_0xa20d9[_0xbc91('0x12')]['message']);}else{logger[_0xbc91('0x14')](_0xbc91('0xe'),_0xf88d45,_0xbc91('0xf'));_0x36e15f(_0xa20d9[_0xbc91('0x15')][_0xbc91('0x13')]);}})[_0xbc91('0x16')](function(_0xb92600){logger[_0xbc91('0x12')](_0xbc91('0xe'),_0xf88d45,_0xb92600);_0x34f079(_0xb92600);});});}
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/index.js b/server/api/analyticDefaultReport/index.js
index 57fa42a..62553a0 100644
--- a/server/api/analyticDefaultReport/index.js
+++ b/server/api/analyticDefaultReport/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xd573=['run','/:id/query','query','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticDefaultReport.controller','get','isAuthenticated','index','/:id','show','/:id/preview','/:id/run'];(function(_0x3306d8,_0x11d42a){var _0x39e559=function(_0x1443dd){while(--_0x1443dd){_0x3306d8['push'](_0x3306d8['shift']());}};_0x39e559(++_0x11d42a);}(_0xd573,0x135));var _0x3d57=function(_0x408bd1,_0x1f48b0){_0x408bd1=_0x408bd1-0x0;var _0x120fcd=_0xd573[_0x408bd1];return _0x120fcd;};'use strict';var multer=require(_0x3d57('0x0'));var util=require(_0x3d57('0x1'));var path=require(_0x3d57('0x2'));var timeout=require(_0x3d57('0x3'));var express=require(_0x3d57('0x4'));var router=express['Router']();var auth=require(_0x3d57('0x5'));var interaction=require(_0x3d57('0x6'));var config=require(_0x3d57('0x7'));var controller=require(_0x3d57('0x8'));router[_0x3d57('0x9')]('/',auth[_0x3d57('0xa')](),controller[_0x3d57('0xb')]);router['get'](_0x3d57('0xc'),auth[_0x3d57('0xa')](),controller[_0x3d57('0xd')]);router['get'](_0x3d57('0xe'),auth[_0x3d57('0xa')](),controller['preview']);router['get'](_0x3d57('0xf'),auth[_0x3d57('0xa')](),controller[_0x3d57('0x10')]);router[_0x3d57('0x9')](_0x3d57('0x11'),auth[_0x3d57('0xa')](),controller[_0x3d57('0x12')]);router['post']('/',auth[_0x3d57('0xa')](),controller[_0x3d57('0x13')]);router[_0x3d57('0x14')](_0x3d57('0xc'),auth['isAuthenticated'](),controller[_0x3d57('0x15')]);router[_0x3d57('0x16')](_0x3d57('0xc'),auth[_0x3d57('0xa')](),controller[_0x3d57('0x17')]);module[_0x3d57('0x18')]=router;
\ No newline at end of file
+var _0xb9ef=['isAuthenticated','show','get','/:id/preview','preview','/:id/run','/:id/query','query','post','create','put','update','destroy','exports','multer','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','index','/:id'];(function(_0x33fd46,_0x575863){var _0xfe858c=function(_0x2d1802){while(--_0x2d1802){_0x33fd46['push'](_0x33fd46['shift']());}};_0xfe858c(++_0x575863);}(_0xb9ef,0xa8));var _0xfb9e=function(_0x47b232,_0x5abe98){_0x47b232=_0x47b232-0x0;var _0x4f21fe=_0xb9ef[_0x47b232];return _0x4f21fe;};'use strict';var multer=require(_0xfb9e('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xfb9e('0x1'));var express=require(_0xfb9e('0x2'));var router=express[_0xfb9e('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0xfb9e('0x4'));var config=require(_0xfb9e('0x5'));var controller=require('./analyticDefaultReport.controller');router['get']('/',auth['isAuthenticated'](),controller[_0xfb9e('0x6')]);router['get'](_0xfb9e('0x7'),auth[_0xfb9e('0x8')](),controller[_0xfb9e('0x9')]);router[_0xfb9e('0xa')](_0xfb9e('0xb'),auth['isAuthenticated'](),controller[_0xfb9e('0xc')]);router[_0xfb9e('0xa')](_0xfb9e('0xd'),auth[_0xfb9e('0x8')](),controller['run']);router['get'](_0xfb9e('0xe'),auth['isAuthenticated'](),controller[_0xfb9e('0xf')]);router[_0xfb9e('0x10')]('/',auth['isAuthenticated'](),controller[_0xfb9e('0x11')]);router[_0xfb9e('0x12')](_0xfb9e('0x7'),auth['isAuthenticated'](),controller[_0xfb9e('0x13')]);router['delete'](_0xfb9e('0x7'),auth[_0xfb9e('0x8')](),controller[_0xfb9e('0x14')]);module[_0xfb9e('0x15')]=router;
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js b/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js
index 71f6a52..f4b02c7 100644
--- a/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js
+++ b/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x1f18=['STRING','ENUM','csv','pdf','xlsx','Loading','manual','UNSIGNED','sequelize','moment','exports'];(function(_0x4b0b3b,_0x734d16){var _0x322aaa=function(_0x147903){while(--_0x147903){_0x4b0b3b['push'](_0x4b0b3b['shift']());}};_0x322aaa(++_0x734d16);}(_0x1f18,0xef));var _0x81f1=function(_0x314061,_0x11ebe6){_0x314061=_0x314061-0x0;var _0x47ed38=_0x1f18[_0x314061];return _0x47ed38;};'use strict';var Sequelize=require(_0x81f1('0x0'));var moment=require(_0x81f1('0x1'));module[_0x81f1('0x2')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'basename':{'type':Sequelize[_0x81f1('0x3')],'allowNull':![]},'output':{'type':Sequelize[_0x81f1('0x4')](_0x81f1('0x5'),_0x81f1('0x6'),_0x81f1('0x7')),'allowNull':![],'defaultValue':_0x81f1('0x5')},'savename':{'type':Sequelize[_0x81f1('0x3')],'allowNull':![]},'startDate':{'type':Sequelize['DATE']},'endDate':{'type':Sequelize['DATE']},'status':{'type':Sequelize['STRING'],'defaultValue':_0x81f1('0x8')},'type':{'type':Sequelize[_0x81f1('0x4')](_0x81f1('0x9'),'scheduled'),'allowNull':![],'defaultValue':'manual'},'reportId':{'type':Sequelize['INTEGER'](0xb)[_0x81f1('0xa')]},'reportType':{'type':Sequelize[_0x81f1('0x3')]}};
\ No newline at end of file
+var _0x0bc4=['exports','STRING','ENUM','csv','xlsx','DATE','manual','scheduled','INTEGER','UNSIGNED'];(function(_0x3e33c7,_0x1c691d){var _0x2d1629=function(_0x226266){while(--_0x226266){_0x3e33c7['push'](_0x3e33c7['shift']());}};_0x2d1629(++_0x1c691d);}(_0x0bc4,0x6e));var _0x40bc=function(_0x44df38,_0x36a713){_0x44df38=_0x44df38-0x0;var _0x4f388e=_0x0bc4[_0x44df38];return _0x4f388e;};'use strict';var Sequelize=require('sequelize');var moment=require('moment');module[_0x40bc('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'basename':{'type':Sequelize[_0x40bc('0x1')],'allowNull':![]},'output':{'type':Sequelize[_0x40bc('0x2')](_0x40bc('0x3'),'pdf',_0x40bc('0x4')),'allowNull':![],'defaultValue':'csv'},'savename':{'type':Sequelize[_0x40bc('0x1')],'allowNull':![]},'startDate':{'type':Sequelize['DATE']},'endDate':{'type':Sequelize[_0x40bc('0x5')]},'status':{'type':Sequelize['STRING'],'defaultValue':'Loading'},'type':{'type':Sequelize[_0x40bc('0x2')](_0x40bc('0x6'),_0x40bc('0x7')),'allowNull':![],'defaultValue':_0x40bc('0x6')},'reportId':{'type':Sequelize[_0x40bc('0x8')](0xb)[_0x40bc('0x9')]},'reportType':{'type':Sequelize['STRING']}};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.controller.js b/server/api/analyticExtractedReport/analyticExtractedReport.controller.js
index 257967d..9ea2aec 100644
--- a/server/api/analyticExtractedReport/analyticExtractedReport.controller.js
+++ b/server/api/analyticExtractedReport/analyticExtractedReport.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x39b6=['findAll','catch','keys','fields','includeAll','options','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','ExtractedReports','find','userProfileId','params','download','basename','savename','output','existsSync','join','root','server/files/reports','Sequelize','ValidationError','Report\x20not\x20found\x20or\x20empty','exists','html-pdf','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','status','count','offset','limit','set','Content-Range','json','apply','save','update','destroy','then','UserProfileResource','sendStatus','error','stack','name','index','map','AnalyticExtractedReport','rawAttributes','fieldName','type','query','filters','intersection','model','attributes','length','hasOwnProperty','sort','where','filter','VIRTUAL','merge'];(function(_0x221e3f,_0x2dd056){var _0x3c3a75=function(_0x3e4fc4){while(--_0x3e4fc4){_0x221e3f['push'](_0x221e3f['shift']());}};_0x3c3a75(++_0x2dd056);}(_0x39b6,0x11b));var _0x639b=function(_0x16c35c,_0x5ac411){_0x16c35c=_0x16c35c-0x0;var _0x562eff=_0x39b6[_0x16c35c];return _0x562eff;};'use strict';var pdf=require(_0x639b('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x639b('0x1'));var zipdir=require(_0x639b('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x639b('0x3'));var moment=require(_0x639b('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x639b('0x5'));var util=require(_0x639b('0x6'));var path=require(_0x639b('0x7'));var sox=require(_0x639b('0x8'));var csv=require(_0x639b('0x9'));var ejs=require(_0x639b('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0x639b('0xb'));var crypto=require(_0x639b('0xc'));var jsforce=require(_0x639b('0xd'));var deskjs=require(_0x639b('0xe'));var toCsv=require(_0x639b('0x9'));var querystring=require('querystring');var Papa=require(_0x639b('0xf'));var Redis=require('ioredis');var authService=require(_0x639b('0x10'));var qs=require(_0x639b('0x11'));var as=require(_0x639b('0x12'));var hardwareService=require(_0x639b('0x13'));var logger=require('../../config/logger')(_0x639b('0x14'));var utils=require(_0x639b('0x15'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2c88a9,_0x40b9ba){_0x40b9ba=_0x40b9ba||0xcc;return function(_0x396600){if(_0x396600){return _0x2c88a9['sendStatus'](_0x40b9ba);}return _0x2c88a9[_0x639b('0x16')](_0x40b9ba)['end']();};}function respondWithResult(_0x2a4227,_0x26b0db){_0x26b0db=_0x26b0db||0xc8;return function(_0x4e1efb){if(_0x4e1efb){return _0x2a4227[_0x639b('0x16')](_0x26b0db)['json'](_0x4e1efb);}};}function respondWithFilteredResult(_0x585adf,_0x4ba256){return function(_0x5dc730){if(_0x5dc730){var _0x4ce9e7=_0x5dc730[_0x639b('0x17')],_0x2ad87c=_0x4ba256[_0x639b('0x18')],_0x367830=_0x4ba256[_0x639b('0x18')]+_0x4ba256[_0x639b('0x19')],_0x1126b3;if(_0x367830>=_0x4ce9e7){_0x367830=_0x4ce9e7;_0x1126b3=0xc8;}else{_0x1126b3=0xce;}_0x585adf[_0x639b('0x16')](_0x1126b3);return _0x585adf[_0x639b('0x1a')](_0x639b('0x1b'),_0x2ad87c+'-'+_0x367830+'/'+_0x4ce9e7)[_0x639b('0x1c')](_0x5dc730);}return null;};}function patchUpdates(_0x352ff1){return function(_0x37b310){try{jsonpatch[_0x639b('0x1d')](_0x37b310,_0x352ff1,!![]);}catch(_0x5590d2){return BPromise['reject'](_0x5590d2);}return _0x37b310[_0x639b('0x1e')]();};}function saveUpdates(_0x274d65,_0x165381){return function(_0x10db1f){if(_0x10db1f){return _0x10db1f[_0x639b('0x1f')](_0x274d65)['then'](function(_0x327680){return _0x327680;});}return null;};}function removeEntity(_0x857a73,_0x3debf4){return function(_0x2e9550){if(_0x2e9550){return _0x2e9550[_0x639b('0x20')]()[_0x639b('0x21')](function(){var _0x58bbb6=_0x2e9550['get']({'plain':!![]});var _0x5b9da2='ExtractedReports';return db[_0x639b('0x22')][_0x639b('0x20')]({'where':{'type':_0x5b9da2,'resourceId':_0x58bbb6['id']}})[_0x639b('0x21')](function(){return _0x2e9550;});})['then'](function(){_0x857a73[_0x639b('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0xe9c08a,_0x3e5adc){return function(_0xb77302){if(!_0xb77302){_0xe9c08a[_0x639b('0x23')](0x194);}return _0xb77302;};}function handleError(_0x5be154,_0x2eb46f){_0x2eb46f=_0x2eb46f||0x1f4;return function(_0x4acde1){logger[_0x639b('0x24')](_0x4acde1[_0x639b('0x25')]);if(_0x4acde1[_0x639b('0x26')]){delete _0x4acde1['name'];}_0x5be154[_0x639b('0x16')](_0x2eb46f)['send'](_0x4acde1);};}exports[_0x639b('0x27')]=function(_0x263f04,_0x9b3a40){var _0x2f38ba={},_0x4e9a59={},_0x32b0fd={'count':0x0,'rows':[]};var _0x35b338=_[_0x639b('0x28')](db[_0x639b('0x29')][_0x639b('0x2a')],function(_0x5aefca){return{'name':_0x5aefca[_0x639b('0x2b')],'type':_0x5aefca[_0x639b('0x2c')]['key']};});_0x4e9a59['model']=_[_0x639b('0x28')](_0x35b338,'name');_0x4e9a59['query']=_['keys'](_0x263f04[_0x639b('0x2d')]);_0x4e9a59[_0x639b('0x2e')]=_[_0x639b('0x2f')](_0x4e9a59[_0x639b('0x30')],_0x4e9a59[_0x639b('0x2d')]);_0x2f38ba[_0x639b('0x31')]=_[_0x639b('0x2f')](_0x4e9a59[_0x639b('0x30')],qs['fields'](_0x263f04[_0x639b('0x2d')]['fields']));_0x2f38ba['attributes']=_0x2f38ba[_0x639b('0x31')][_0x639b('0x32')]?_0x2f38ba['attributes']:_0x4e9a59[_0x639b('0x30')];if(!_0x263f04[_0x639b('0x2d')][_0x639b('0x33')]('nolimit')){_0x2f38ba[_0x639b('0x19')]=qs[_0x639b('0x19')](_0x263f04[_0x639b('0x2d')][_0x639b('0x19')]);_0x2f38ba[_0x639b('0x18')]=qs[_0x639b('0x18')](_0x263f04[_0x639b('0x2d')][_0x639b('0x18')]);}_0x2f38ba['order']=qs[_0x639b('0x34')](_0x263f04[_0x639b('0x2d')][_0x639b('0x34')]);_0x2f38ba[_0x639b('0x35')]=qs['filters'](_['pick'](_0x263f04[_0x639b('0x2d')],_0x4e9a59['filters']),_0x35b338);if(_0x263f04[_0x639b('0x2d')][_0x639b('0x36')]){_0x2f38ba[_0x639b('0x35')]=_['merge'](_0x2f38ba['where'],{'$or':_[_0x639b('0x28')](_0x35b338,function(_0x3fadad){if(_0x3fadad['type']!==_0x639b('0x37')){var _0x5e7108={};_0x5e7108[_0x3fadad[_0x639b('0x26')]]={'$like':'%'+_0x263f04['query'][_0x639b('0x36')]+'%'};return _0x5e7108;}})});}_0x2f38ba=_[_0x639b('0x38')]({},_0x2f38ba,_0x263f04['options']);var _0x841922={'where':_0x2f38ba[_0x639b('0x35')]};return db['AnalyticExtractedReport']['count'](_0x841922)[_0x639b('0x21')](function(_0x419b34){_0x32b0fd[_0x639b('0x17')]=_0x419b34;if(_0x263f04[_0x639b('0x2d')]['includeAll']){_0x2f38ba['include']=[{'all':!![]}];}return db[_0x639b('0x29')][_0x639b('0x39')](_0x2f38ba);})[_0x639b('0x21')](function(_0x5b5f17){_0x32b0fd['rows']=_0x5b5f17;return _0x32b0fd;})[_0x639b('0x21')](respondWithFilteredResult(_0x9b3a40,_0x2f38ba))[_0x639b('0x3a')](handleError(_0x9b3a40,null));};exports['show']=function(_0x3b4a93,_0x4737f5){var _0x50a62b={'raw':!![],'where':{'id':_0x3b4a93['params']['id']}},_0x1bd171={};_0x1bd171[_0x639b('0x30')]=_[_0x639b('0x3b')](db[_0x639b('0x29')][_0x639b('0x2a')]);_0x1bd171['query']=_[_0x639b('0x3b')](_0x3b4a93[_0x639b('0x2d')]);_0x1bd171['filters']=_[_0x639b('0x2f')](_0x1bd171[_0x639b('0x30')],_0x1bd171[_0x639b('0x2d')]);_0x50a62b[_0x639b('0x31')]=_[_0x639b('0x2f')](_0x1bd171[_0x639b('0x30')],qs[_0x639b('0x3c')](_0x3b4a93['query'][_0x639b('0x3c')]));_0x50a62b[_0x639b('0x31')]=_0x50a62b['attributes'][_0x639b('0x32')]?_0x50a62b[_0x639b('0x31')]:_0x1bd171[_0x639b('0x30')];if(_0x3b4a93['query'][_0x639b('0x3d')]){_0x50a62b['include']=[{'all':!![]}];}_0x50a62b=_[_0x639b('0x38')]({},_0x50a62b,_0x3b4a93[_0x639b('0x3e')]);return db[_0x639b('0x29')]['find'](_0x50a62b)[_0x639b('0x21')](handleEntityNotFound(_0x4737f5,null))[_0x639b('0x21')](respondWithResult(_0x4737f5,null))[_0x639b('0x3a')](handleError(_0x4737f5,null));};exports[_0x639b('0x3f')]=function(_0x5d3024,_0x55b90a){return db[_0x639b('0x29')]['create'](_0x5d3024[_0x639b('0x40')],{})[_0x639b('0x21')](function(_0x4c6adf){var _0x55460f=_0x5d3024['user'][_0x639b('0x41')]({'plain':!![]});if(!_0x55460f)throw new Error(_0x639b('0x42'));if(_0x55460f[_0x639b('0x43')]===_0x639b('0x44')){var _0xb5d3c8=_0x4c6adf[_0x639b('0x41')]({'plain':!![]});var _0x40d77c=_0x639b('0x45');return db['UserProfileSection'][_0x639b('0x46')]({'where':{'name':_0x40d77c,'userProfileId':_0x55460f[_0x639b('0x47')]},'raw':!![]})[_0x639b('0x21')](function(_0x1c7884){if(_0x1c7884&&_0x1c7884['autoAssociation']===0x0){return db['UserProfileResource'][_0x639b('0x3f')]({'name':_0xb5d3c8['name'],'resourceId':_0xb5d3c8['id'],'type':_0x1c7884['name'],'sectionId':_0x1c7884['id']},{})[_0x639b('0x21')](function(){return _0x4c6adf;});}else{return _0x4c6adf;}})[_0x639b('0x3a')](function(_0x14a675){logger[_0x639b('0x24')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x14a675);throw _0x14a675;});}return _0x4c6adf;})[_0x639b('0x21')](respondWithResult(_0x55b90a,0xc9))['catch'](handleError(_0x55b90a,null));};exports['update']=function(_0x5710c5,_0x24e75b){if(_0x5710c5[_0x639b('0x40')]['id']){delete _0x5710c5[_0x639b('0x40')]['id'];}return db[_0x639b('0x29')][_0x639b('0x46')]({'where':{'id':_0x5710c5[_0x639b('0x48')]['id']}})[_0x639b('0x21')](handleEntityNotFound(_0x24e75b,null))[_0x639b('0x21')](saveUpdates(_0x5710c5[_0x639b('0x40')],null))[_0x639b('0x21')](respondWithResult(_0x24e75b,null))[_0x639b('0x3a')](handleError(_0x24e75b,null));};exports[_0x639b('0x20')]=function(_0x310643,_0x2f442c){return db['AnalyticExtractedReport'][_0x639b('0x46')]({'where':{'id':_0x310643[_0x639b('0x48')]['id']}})['then'](handleEntityNotFound(_0x2f442c,null))[_0x639b('0x21')](removeEntity(_0x2f442c,null))['catch'](handleError(_0x2f442c,null));};exports[_0x639b('0x49')]=function(_0x414ffb,_0x1bf260,_0x7eeaad){return db['AnalyticExtractedReport'][_0x639b('0x46')]({'where':{'id':_0x414ffb['params']['id']},'attributes':[_0x639b('0x26'),_0x639b('0x4a'),_0x639b('0x4b'),_0x639b('0x4c')],'raw':!![]})[_0x639b('0x21')](handleEntityNotFound(_0x1bf260,null))['then'](function(_0x20db08){if(_0x20db08){if(!fs[_0x639b('0x4d')](path[_0x639b('0x4e')](config[_0x639b('0x4f')],_0x639b('0x50'),_0x20db08[_0x639b('0x4b')]))){throw new db[(_0x639b('0x51'))][(_0x639b('0x52'))](_0x639b('0x53'));}if(_0x414ffb[_0x639b('0x2d')][_0x639b('0x54')]){return _0x1bf260[_0x639b('0x23')](0xc8);}return _0x1bf260[_0x639b('0x49')](path[_0x639b('0x4e')](config[_0x639b('0x4f')],_0x639b('0x50'),_0x20db08[_0x639b('0x4b')]),util['format']('%s.%s',_0x20db08[_0x639b('0x4a')]||_0x20db08[_0x639b('0x26')],_0x20db08[_0x639b('0x4c')]['toLowerCase']()));}})['catch'](handleError(_0x1bf260,null));};
\ No newline at end of file
+var _0xb13a=['show','params','rawAttributes','intersection','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','savename','output','existsSync','root','server/files/reports','ValidationError','Report\x20not\x20found\x20or\x20empty','download','format','%s.%s','basename','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','to-csv','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','status','end','json','offset','limit','set','Content-Range','apply','reject','save','update','then','ExtractedReports','UserProfileResource','destroy','sendStatus','error','stack','name','send','index','AnalyticExtractedReport','fieldName','type','key','model','map','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','filter','where','merge','options','includeAll','include','findAll','rows','catch'];(function(_0x1cd585,_0x54276b){var _0x3ca87f=function(_0x224de8){while(--_0x224de8){_0x1cd585['push'](_0x1cd585['shift']());}};_0x3ca87f(++_0x54276b);}(_0xb13a,0x12a));var _0xab13=function(_0x451524,_0x5f2639){_0x451524=_0x451524-0x0;var _0x31c51d=_0xb13a[_0x451524];return _0x31c51d;};'use strict';var pdf=require(_0xab13('0x0'));var emlformat=require(_0xab13('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xab13('0x2'));var jsonpatch=require(_0xab13('0x3'));var rp=require(_0xab13('0x4'));var moment=require(_0xab13('0x5'));var BPromise=require(_0xab13('0x6'));var Mustache=require(_0xab13('0x7'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0xab13('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xab13('0x9'));var squel=require(_0xab13('0xa'));var crypto=require('crypto');var jsforce=require(_0xab13('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xab13('0x8'));var querystring=require(_0xab13('0xc'));var Papa=require(_0xab13('0xd'));var Redis=require(_0xab13('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xab13('0xf'));var as=require(_0xab13('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xab13('0x11'))(_0xab13('0x12'));var utils=require(_0xab13('0x13'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x25c82c,_0x4aad26){_0x4aad26=_0x4aad26||0xcc;return function(_0x10da6f){if(_0x10da6f){return _0x25c82c['sendStatus'](_0x4aad26);}return _0x25c82c[_0xab13('0x14')](_0x4aad26)[_0xab13('0x15')]();};}function respondWithResult(_0x30fb7e,_0x304678){_0x304678=_0x304678||0xc8;return function(_0x147588){if(_0x147588){return _0x30fb7e[_0xab13('0x14')](_0x304678)[_0xab13('0x16')](_0x147588);}};}function respondWithFilteredResult(_0x23cedd,_0x5a6277){return function(_0x19cdc2){if(_0x19cdc2){var _0x37d106=_0x19cdc2['count'],_0x733435=_0x5a6277[_0xab13('0x17')],_0x564fc3=_0x5a6277[_0xab13('0x17')]+_0x5a6277[_0xab13('0x18')],_0x5c7592;if(_0x564fc3>=_0x37d106){_0x564fc3=_0x37d106;_0x5c7592=0xc8;}else{_0x5c7592=0xce;}_0x23cedd[_0xab13('0x14')](_0x5c7592);return _0x23cedd[_0xab13('0x19')](_0xab13('0x1a'),_0x733435+'-'+_0x564fc3+'/'+_0x37d106)[_0xab13('0x16')](_0x19cdc2);}return null;};}function patchUpdates(_0x5890b3){return function(_0x2e18d6){try{jsonpatch[_0xab13('0x1b')](_0x2e18d6,_0x5890b3,!![]);}catch(_0x3b9c58){return BPromise[_0xab13('0x1c')](_0x3b9c58);}return _0x2e18d6[_0xab13('0x1d')]();};}function saveUpdates(_0x3908b7,_0x3df266){return function(_0x521546){if(_0x521546){return _0x521546[_0xab13('0x1e')](_0x3908b7)[_0xab13('0x1f')](function(_0x25cef3){return _0x25cef3;});}return null;};}function removeEntity(_0x5bbd0b,_0x49b36b){return function(_0x5b7047){if(_0x5b7047){return _0x5b7047['destroy']()[_0xab13('0x1f')](function(){var _0x1ead97=_0x5b7047['get']({'plain':!![]});var _0x217d0b=_0xab13('0x20');return db[_0xab13('0x21')][_0xab13('0x22')]({'where':{'type':_0x217d0b,'resourceId':_0x1ead97['id']}})[_0xab13('0x1f')](function(){return _0x5b7047;});})['then'](function(){_0x5bbd0b[_0xab13('0x14')](0xcc)[_0xab13('0x15')]();});}};}function handleEntityNotFound(_0x27d83c,_0x579a33){return function(_0x54ff7b){if(!_0x54ff7b){_0x27d83c[_0xab13('0x23')](0x194);}return _0x54ff7b;};}function handleError(_0x29f021,_0x3b7ffb){_0x3b7ffb=_0x3b7ffb||0x1f4;return function(_0x8c7509){logger[_0xab13('0x24')](_0x8c7509[_0xab13('0x25')]);if(_0x8c7509[_0xab13('0x26')]){delete _0x8c7509['name'];}_0x29f021[_0xab13('0x14')](_0x3b7ffb)[_0xab13('0x27')](_0x8c7509);};}exports[_0xab13('0x28')]=function(_0x4d58b5,_0x2491df){var _0x1b1a0c={},_0xb33194={},_0x2b355c={'count':0x0,'rows':[]};var _0x682839=_['map'](db[_0xab13('0x29')]['rawAttributes'],function(_0x18cc05){return{'name':_0x18cc05[_0xab13('0x2a')],'type':_0x18cc05[_0xab13('0x2b')][_0xab13('0x2c')]};});_0xb33194[_0xab13('0x2d')]=_[_0xab13('0x2e')](_0x682839,_0xab13('0x26'));_0xb33194[_0xab13('0x2f')]=_[_0xab13('0x30')](_0x4d58b5['query']);_0xb33194[_0xab13('0x31')]=_['intersection'](_0xb33194[_0xab13('0x2d')],_0xb33194[_0xab13('0x2f')]);_0x1b1a0c[_0xab13('0x32')]=_['intersection'](_0xb33194['model'],qs[_0xab13('0x33')](_0x4d58b5[_0xab13('0x2f')][_0xab13('0x33')]));_0x1b1a0c['attributes']=_0x1b1a0c[_0xab13('0x32')][_0xab13('0x34')]?_0x1b1a0c[_0xab13('0x32')]:_0xb33194[_0xab13('0x2d')];if(!_0x4d58b5[_0xab13('0x2f')][_0xab13('0x35')](_0xab13('0x36'))){_0x1b1a0c[_0xab13('0x18')]=qs[_0xab13('0x18')](_0x4d58b5[_0xab13('0x2f')][_0xab13('0x18')]);_0x1b1a0c[_0xab13('0x17')]=qs[_0xab13('0x17')](_0x4d58b5[_0xab13('0x2f')][_0xab13('0x17')]);}_0x1b1a0c['order']=qs[_0xab13('0x37')](_0x4d58b5[_0xab13('0x2f')][_0xab13('0x37')]);_0x1b1a0c['where']=qs[_0xab13('0x31')](_[_0xab13('0x38')](_0x4d58b5[_0xab13('0x2f')],_0xb33194['filters']),_0x682839);if(_0x4d58b5['query'][_0xab13('0x39')]){_0x1b1a0c[_0xab13('0x3a')]=_[_0xab13('0x3b')](_0x1b1a0c[_0xab13('0x3a')],{'$or':_['map'](_0x682839,function(_0xc9fa9a){if(_0xc9fa9a[_0xab13('0x2b')]!=='VIRTUAL'){var _0x2b4116={};_0x2b4116[_0xc9fa9a['name']]={'$like':'%'+_0x4d58b5[_0xab13('0x2f')][_0xab13('0x39')]+'%'};return _0x2b4116;}})});}_0x1b1a0c=_['merge']({},_0x1b1a0c,_0x4d58b5[_0xab13('0x3c')]);var _0x4e1bb9={'where':_0x1b1a0c['where']};return db['AnalyticExtractedReport']['count'](_0x4e1bb9)['then'](function(_0x45217a){_0x2b355c['count']=_0x45217a;if(_0x4d58b5[_0xab13('0x2f')][_0xab13('0x3d')]){_0x1b1a0c[_0xab13('0x3e')]=[{'all':!![]}];}return db[_0xab13('0x29')][_0xab13('0x3f')](_0x1b1a0c);})[_0xab13('0x1f')](function(_0x52a367){_0x2b355c[_0xab13('0x40')]=_0x52a367;return _0x2b355c;})[_0xab13('0x1f')](respondWithFilteredResult(_0x2491df,_0x1b1a0c))[_0xab13('0x41')](handleError(_0x2491df,null));};exports[_0xab13('0x42')]=function(_0x221f0c,_0x59d890){var _0x32be28={'raw':!![],'where':{'id':_0x221f0c[_0xab13('0x43')]['id']}},_0x2825ad={};_0x2825ad[_0xab13('0x2d')]=_['keys'](db[_0xab13('0x29')][_0xab13('0x44')]);_0x2825ad[_0xab13('0x2f')]=_[_0xab13('0x30')](_0x221f0c['query']);_0x2825ad[_0xab13('0x31')]=_['intersection'](_0x2825ad['model'],_0x2825ad[_0xab13('0x2f')]);_0x32be28[_0xab13('0x32')]=_[_0xab13('0x45')](_0x2825ad[_0xab13('0x2d')],qs[_0xab13('0x33')](_0x221f0c['query']['fields']));_0x32be28[_0xab13('0x32')]=_0x32be28[_0xab13('0x32')][_0xab13('0x34')]?_0x32be28[_0xab13('0x32')]:_0x2825ad[_0xab13('0x2d')];if(_0x221f0c['query'][_0xab13('0x3d')]){_0x32be28[_0xab13('0x3e')]=[{'all':!![]}];}_0x32be28=_['merge']({},_0x32be28,_0x221f0c[_0xab13('0x3c')]);return db[_0xab13('0x29')]['find'](_0x32be28)[_0xab13('0x1f')](handleEntityNotFound(_0x59d890,null))[_0xab13('0x1f')](respondWithResult(_0x59d890,null))['catch'](handleError(_0x59d890,null));};exports['create']=function(_0x38e977,_0x19ed67){return db[_0xab13('0x29')][_0xab13('0x46')](_0x38e977[_0xab13('0x47')],{})['then'](function(_0x423af3){var _0x204cde=_0x38e977[_0xab13('0x48')]['get']({'plain':!![]});if(!_0x204cde)throw new Error(_0xab13('0x49'));if(_0x204cde[_0xab13('0x4a')]===_0xab13('0x48')){var _0x3511eb=_0x423af3['get']({'plain':!![]});var _0x246d1d=_0xab13('0x20');return db[_0xab13('0x4b')][_0xab13('0x4c')]({'where':{'name':_0x246d1d,'userProfileId':_0x204cde[_0xab13('0x4d')]},'raw':!![]})['then'](function(_0x191b93){if(_0x191b93&&_0x191b93[_0xab13('0x4e')]===0x0){return db[_0xab13('0x21')]['create']({'name':_0x3511eb['name'],'resourceId':_0x3511eb['id'],'type':_0x191b93['name'],'sectionId':_0x191b93['id']},{})[_0xab13('0x1f')](function(){return _0x423af3;});}else{return _0x423af3;}})['catch'](function(_0x3a9bd0){logger[_0xab13('0x24')](_0xab13('0x4f'),_0x3a9bd0);throw _0x3a9bd0;});}return _0x423af3;})[_0xab13('0x1f')](respondWithResult(_0x19ed67,0xc9))[_0xab13('0x41')](handleError(_0x19ed67,null));};exports[_0xab13('0x1e')]=function(_0x2e61b3,_0x2b3ec1){if(_0x2e61b3[_0xab13('0x47')]['id']){delete _0x2e61b3[_0xab13('0x47')]['id'];}return db[_0xab13('0x29')]['find']({'where':{'id':_0x2e61b3['params']['id']}})[_0xab13('0x1f')](handleEntityNotFound(_0x2b3ec1,null))[_0xab13('0x1f')](saveUpdates(_0x2e61b3[_0xab13('0x47')],null))[_0xab13('0x1f')](respondWithResult(_0x2b3ec1,null))['catch'](handleError(_0x2b3ec1,null));};exports['destroy']=function(_0xb476e1,_0x1fb5c4){return db[_0xab13('0x29')][_0xab13('0x4c')]({'where':{'id':_0xb476e1[_0xab13('0x43')]['id']}})[_0xab13('0x1f')](handleEntityNotFound(_0x1fb5c4,null))['then'](removeEntity(_0x1fb5c4,null))['catch'](handleError(_0x1fb5c4,null));};exports['download']=function(_0x2a2f6c,_0x377693,_0x14f72b){return db[_0xab13('0x29')][_0xab13('0x4c')]({'where':{'id':_0x2a2f6c['params']['id']},'attributes':['name','basename',_0xab13('0x50'),_0xab13('0x51')],'raw':!![]})['then'](handleEntityNotFound(_0x377693,null))[_0xab13('0x1f')](function(_0x5862fd){if(_0x5862fd){if(!fs[_0xab13('0x52')](path['join'](config[_0xab13('0x53')],_0xab13('0x54'),_0x5862fd[_0xab13('0x50')]))){throw new db['Sequelize'][(_0xab13('0x55'))](_0xab13('0x56'));}if(_0x2a2f6c['query']['exists']){return _0x377693['sendStatus'](0xc8);}return _0x377693[_0xab13('0x57')](path['join'](config[_0xab13('0x53')],_0xab13('0x54'),_0x5862fd[_0xab13('0x50')]),util[_0xab13('0x58')](_0xab13('0x59'),_0x5862fd[_0xab13('0x5a')]||_0x5862fd['name'],_0x5862fd[_0xab13('0x51')]['toLowerCase']()));}})['catch'](handleError(_0x377693,null));};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.model.js b/server/api/analyticExtractedReport/analyticExtractedReport.model.js
index ed982b3..e960cbf 100644
--- a/server/api/analyticExtractedReport/analyticExtractedReport.model.js
+++ b/server/api/analyticExtractedReport/analyticExtractedReport.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x4bd0=['rimraf','../../config/environment','exports','define','AnalyticExtractedReport','analytics_extracted_reports','lodash','util','../../config/logger','moment','bluebird','path'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4bd0,0x1ce));var _0x04bd=function(_0x18b269,_0x4b9725){_0x18b269=_0x18b269-0x0;var _0x20807b=_0x4bd0[_0x18b269];return _0x20807b;};'use strict';var _=require(_0x04bd('0x0'));var util=require(_0x04bd('0x1'));var logger=require(_0x04bd('0x2'))('api');var moment=require(_0x04bd('0x3'));var BPromise=require(_0x04bd('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x04bd('0x5'));var rimraf=require(_0x04bd('0x6'));var config=require(_0x04bd('0x7'));var attributes=require('./analyticExtractedReport.attributes');module[_0x04bd('0x8')]=function(_0x20fb07,_0x3a3915){return _0x20fb07[_0x04bd('0x9')](_0x04bd('0xa'),attributes,{'tableName':_0x04bd('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xa4d8=['request-promise','path','../../config/environment','./analyticExtractedReport.attributes','exports','define','AnalyticExtractedReport','analytics_extracted_reports','lodash','util','api','moment','bluebird'];(function(_0x4cbf20,_0x1bfa66){var _0x582ae4=function(_0x5eca38){while(--_0x5eca38){_0x4cbf20['push'](_0x4cbf20['shift']());}};_0x582ae4(++_0x1bfa66);}(_0xa4d8,0x1e9));var _0x8a4d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa4d8[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x8a4d('0x0'));var util=require(_0x8a4d('0x1'));var logger=require('../../config/logger')(_0x8a4d('0x2'));var moment=require(_0x8a4d('0x3'));var BPromise=require(_0x8a4d('0x4'));var rp=require(_0x8a4d('0x5'));var fs=require('fs');var path=require(_0x8a4d('0x6'));var rimraf=require('rimraf');var config=require(_0x8a4d('0x7'));var attributes=require(_0x8a4d('0x8'));module[_0x8a4d('0x9')]=function(_0x529d93,_0x4e4f07){return _0x529d93[_0x8a4d('0xa')](_0x8a4d('0xb'),attributes,{'tableName':_0x8a4d('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.rpc.js b/server/api/analyticExtractedReport/analyticExtractedReport.rpc.js
index e41b478..8da0590 100644
--- a/server/api/analyticExtractedReport/analyticExtractedReport.rpc.js
+++ b/server/api/analyticExtractedReport/analyticExtractedReport.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x8a65=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','AnalyticExtractedReport,\x20%s,\x20%s','message','lodash','moment','bluebird'];(function(_0x3167a8,_0x4d5006){var _0x20073f=function(_0x5b7216){while(--_0x5b7216){_0x3167a8['push'](_0x3167a8['shift']());}};_0x20073f(++_0x4d5006);}(_0x8a65,0x177));var _0x58a6=function(_0x1e0a4f,_0x570b15){_0x1e0a4f=_0x1e0a4f-0x0;var _0x271b9e=_0x8a65[_0x1e0a4f];return _0x271b9e;};'use strict';var _=require(_0x58a6('0x0'));var util=require('util');var moment=require(_0x58a6('0x1'));var BPromise=require(_0x58a6('0x2'));var rs=require(_0x58a6('0x3'));var fs=require('fs');var Redis=require(_0x58a6('0x4'));var db=require(_0x58a6('0x5'))['db'];var utils=require(_0x58a6('0x6'));var logger=require(_0x58a6('0x7'))(_0x58a6('0x8'));var config=require(_0x58a6('0x9'));var jayson=require(_0x58a6('0xa'));var client=jayson['client'][_0x58a6('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x6cee03,_0x33a8d0,_0x54571b){return new BPromise(function(_0x33cbea,_0x50ee21){return client[_0x58a6('0xc')](_0x6cee03,_0x54571b)['then'](function(_0x377e2c){logger[_0x58a6('0xd')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x33a8d0,'request\x20sent');logger[_0x58a6('0xe')](_0x58a6('0xf'),_0x33a8d0,_0x58a6('0x10'),JSON['stringify'](_0x377e2c));if(_0x377e2c['error']){if(_0x377e2c[_0x58a6('0x11')][_0x58a6('0x12')]===0x1f4){logger[_0x58a6('0x11')](_0x58a6('0x13'),_0x33a8d0,_0x377e2c[_0x58a6('0x11')][_0x58a6('0x14')]);return _0x50ee21(_0x377e2c['error'][_0x58a6('0x14')]);}logger[_0x58a6('0x11')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x33a8d0,_0x377e2c['error'][_0x58a6('0x14')]);return _0x33cbea(_0x377e2c[_0x58a6('0x11')][_0x58a6('0x14')]);}else{logger['info']('AnalyticExtractedReport,\x20%s,\x20%s',_0x33a8d0,_0x58a6('0x10'));_0x33cbea(_0x377e2c['result']['message']);}})['catch'](function(_0x56b8b2){logger[_0x58a6('0x11')](_0x58a6('0x13'),_0x33a8d0,_0x56b8b2);_0x50ee21(_0x56b8b2);});});}
\ No newline at end of file
+var _0x3f88=['util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','info','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','stringify','error','message','catch'];(function(_0x32c450,_0x5c9631){var _0x1c9dfa=function(_0x498f57){while(--_0x498f57){_0x32c450['push'](_0x32c450['shift']());}};_0x1c9dfa(++_0x5c9631);}(_0x3f88,0x98));var _0x83f8=function(_0x10d1b5,_0x14010b){_0x10d1b5=_0x10d1b5-0x0;var _0x80ad03=_0x3f88[_0x10d1b5];return _0x80ad03;};'use strict';var _=require('lodash');var util=require(_0x83f8('0x0'));var moment=require(_0x83f8('0x1'));var BPromise=require(_0x83f8('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x83f8('0x3'));var db=require(_0x83f8('0x4'))['db'];var utils=require(_0x83f8('0x5'));var logger=require(_0x83f8('0x6'))(_0x83f8('0x7'));var config=require('../../config/environment');var jayson=require(_0x83f8('0x8'));var client=jayson[_0x83f8('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2ca4bb,_0x4dd17e,_0x496eca){return new BPromise(function(_0x34aeeb,_0x276359){return client[_0x83f8('0xa')](_0x2ca4bb,_0x496eca)[_0x83f8('0xb')](function(_0x188a1e){logger[_0x83f8('0xc')](_0x83f8('0xd'),_0x4dd17e,_0x83f8('0xe'));logger['debug']('AnalyticExtractedReport,\x20%s,\x20%s,\x20%s',_0x4dd17e,_0x83f8('0xe'),JSON[_0x83f8('0xf')](_0x188a1e));if(_0x188a1e[_0x83f8('0x10')]){if(_0x188a1e[_0x83f8('0x10')]['code']===0x1f4){logger[_0x83f8('0x10')](_0x83f8('0xd'),_0x4dd17e,_0x188a1e[_0x83f8('0x10')]['message']);return _0x276359(_0x188a1e[_0x83f8('0x10')][_0x83f8('0x11')]);}logger['error']('AnalyticExtractedReport,\x20%s,\x20%s',_0x4dd17e,_0x188a1e[_0x83f8('0x10')][_0x83f8('0x11')]);return _0x34aeeb(_0x188a1e['error']['message']);}else{logger[_0x83f8('0xc')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x4dd17e,_0x83f8('0xe'));_0x34aeeb(_0x188a1e['result']['message']);}})[_0x83f8('0x12')](function(_0x10d203){logger[_0x83f8('0x10')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x4dd17e,_0x10d203);_0x276359(_0x10d203);});});}
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/index.js b/server/api/analyticExtractedReport/index.js
index 44ae1b2..0859c65 100644
--- a/server/api/analyticExtractedReport/index.js
+++ b/server/api/analyticExtractedReport/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xd086=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticExtractedReport.controller','index','get','/:id','isAuthenticated','show','/:id/download','download','post','create','update','delete','exports','util','path','connect-timeout','express'];(function(_0x20576a,_0x1c2180){var _0x3dd472=function(_0x25b741){while(--_0x25b741){_0x20576a['push'](_0x20576a['shift']());}};_0x3dd472(++_0x1c2180);}(_0xd086,0x1df));var _0x6d08=function(_0x18c658,_0xa4d032){_0x18c658=_0x18c658-0x0;var _0x239fdc=_0xd086[_0x18c658];return _0x239fdc;};'use strict';var multer=require('multer');var util=require(_0x6d08('0x0'));var path=require(_0x6d08('0x1'));var timeout=require(_0x6d08('0x2'));var express=require(_0x6d08('0x3'));var router=express[_0x6d08('0x4')]();var auth=require(_0x6d08('0x5'));var interaction=require(_0x6d08('0x6'));var config=require(_0x6d08('0x7'));var controller=require(_0x6d08('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0x6d08('0x9')]);router[_0x6d08('0xa')](_0x6d08('0xb'),auth[_0x6d08('0xc')](),controller[_0x6d08('0xd')]);router[_0x6d08('0xa')](_0x6d08('0xe'),auth['isAuthenticated'](),controller[_0x6d08('0xf')]);router[_0x6d08('0x10')]('/',auth[_0x6d08('0xc')](),controller[_0x6d08('0x11')]);router['put'](_0x6d08('0xb'),auth[_0x6d08('0xc')](),controller[_0x6d08('0x12')]);router[_0x6d08('0x13')](_0x6d08('0xb'),auth[_0x6d08('0xc')](),controller['destroy']);module[_0x6d08('0x14')]=router;
\ No newline at end of file
+var _0x2f3a=['show','/:id/download','isAuthenticated','post','create','put','/:id','update','delete','destroy','exports','multer','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index'];(function(_0x3e1f4e,_0x3d48f8){var _0x14ea69=function(_0x49c9e0){while(--_0x49c9e0){_0x3e1f4e['push'](_0x3e1f4e['shift']());}};_0x14ea69(++_0x3d48f8);}(_0x2f3a,0xfb));var _0xa2f3=function(_0x252933,_0x43a776){_0x252933=_0x252933-0x0;var _0x41a521=_0x2f3a[_0x252933];return _0x41a521;};'use strict';var multer=require(_0xa2f3('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xa2f3('0x1'));var express=require(_0xa2f3('0x2'));var router=express[_0xa2f3('0x3')]();var auth=require(_0xa2f3('0x4'));var interaction=require(_0xa2f3('0x5'));var config=require(_0xa2f3('0x6'));var controller=require('./analyticExtractedReport.controller');router[_0xa2f3('0x7')]('/',auth['isAuthenticated'](),controller[_0xa2f3('0x8')]);router[_0xa2f3('0x7')]('/:id',auth['isAuthenticated'](),controller[_0xa2f3('0x9')]);router[_0xa2f3('0x7')](_0xa2f3('0xa'),auth[_0xa2f3('0xb')](),controller['download']);router[_0xa2f3('0xc')]('/',auth[_0xa2f3('0xb')](),controller[_0xa2f3('0xd')]);router[_0xa2f3('0xe')](_0xa2f3('0xf'),auth['isAuthenticated'](),controller[_0xa2f3('0x10')]);router[_0xa2f3('0x11')]('/:id',auth[_0xa2f3('0xb')](),controller[_0xa2f3('0x12')]);module[_0xa2f3('0x13')]=router;
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.attributes.js b/server/api/analyticFieldReport/analyticFieldReport.attributes.js
index adec10d..977bdf3 100644
--- a/server/api/analyticFieldReport/analyticFieldReport.attributes.js
+++ b/server/api/analyticFieldReport/analyticFieldReport.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xe14b=['sequelize','exports','STRING'];(function(_0x7830e0,_0x965d9e){var _0xc2c3c1=function(_0x10e17a){while(--_0x10e17a){_0x7830e0['push'](_0x7830e0['shift']());}};_0xc2c3c1(++_0x965d9e);}(_0xe14b,0x93));var _0xbe14=function(_0x140041,_0xbb2717){_0x140041=_0x140041-0x0;var _0x518373=_0xe14b[_0x140041];return _0x518373;};'use strict';var Sequelize=require(_0xbe14('0x0'));module[_0xbe14('0x1')]={'field':{'type':Sequelize['TEXT']},'alias':{'type':Sequelize['STRING']},'function':{'type':Sequelize[_0xbe14('0x2')]},'format':{'type':Sequelize[_0xbe14('0x2')]},'groupBy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'orderBy':{'type':Sequelize[_0xbe14('0x2')]},'custom':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}};
\ No newline at end of file
+var _0xc4aa=['exports','TEXT','STRING','sequelize'];(function(_0x101ed5,_0x4f5c30){var _0x5ae524=function(_0x568fd2){while(--_0x568fd2){_0x101ed5['push'](_0x101ed5['shift']());}};_0x5ae524(++_0x4f5c30);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x5f09c5,_0x2bfca0){_0x5f09c5=_0x5f09c5-0x0;var _0x426ad9=_0xc4aa[_0x5f09c5];return _0x426ad9;};'use strict';var Sequelize=require(_0xac4a('0x0'));module[_0xac4a('0x1')]={'field':{'type':Sequelize[_0xac4a('0x2')]},'alias':{'type':Sequelize[_0xac4a('0x3')]},'function':{'type':Sequelize[_0xac4a('0x3')]},'format':{'type':Sequelize[_0xac4a('0x3')]},'groupBy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'orderBy':{'type':Sequelize['STRING']},'custom':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}};
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.controller.js b/server/api/analyticFieldReport/analyticFieldReport.controller.js
index 95d611b..92fa803 100644
--- a/server/api/analyticFieldReport/analyticFieldReport.controller.js
+++ b/server/api/analyticFieldReport/analyticFieldReport.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x5c48=['filters','intersection','attributes','fields','nolimit','order','sort','filter','where','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','bulkCreate','bulkDestroy','ids','addFields','AnalyticCustomReport','sequelize','transaction','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','json','count','offset','limit','status','set','Content-Range','apply','reject','save','update','then','destroy','end','error','stack','name','send','map','AnalyticFieldReport','rawAttributes','fieldName','type','key','model','keys','query'];(function(_0x4fbfd9,_0x3ab91a){var _0x31dc94=function(_0x11e53b){while(--_0x11e53b){_0x4fbfd9['push'](_0x4fbfd9['shift']());}};_0x31dc94(++_0x3ab91a);}(_0x5c48,0xc3));var _0x85c4=function(_0x1657a9,_0x48c9fb){_0x1657a9=_0x1657a9-0x0;var _0x4b8859=_0x5c48[_0x1657a9];return _0x4b8859;};'use strict';var pdf=require(_0x85c4('0x0'));var emlformat=require(_0x85c4('0x1'));var rimraf=require(_0x85c4('0x2'));var zipdir=require(_0x85c4('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x85c4('0x4'));var moment=require(_0x85c4('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x85c4('0x6'));var path=require(_0x85c4('0x7'));var sox=require(_0x85c4('0x8'));var csv=require(_0x85c4('0x9'));var ejs=require(_0x85c4('0xa'));var fs=require('fs');var _=require(_0x85c4('0xb'));var squel=require(_0x85c4('0xc'));var crypto=require(_0x85c4('0xd'));var jsforce=require(_0x85c4('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x85c4('0x9'));var querystring=require(_0x85c4('0xf'));var Papa=require(_0x85c4('0x10'));var Redis=require(_0x85c4('0x11'));var authService=require(_0x85c4('0x12'));var qs=require(_0x85c4('0x13'));var as=require(_0x85c4('0x14'));var hardwareService=require(_0x85c4('0x15'));var logger=require(_0x85c4('0x16'))(_0x85c4('0x17'));var utils=require(_0x85c4('0x18'));var config=require(_0x85c4('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5f4d78,_0x41b7af){_0x41b7af=_0x41b7af||0xcc;return function(_0x5d56ec){if(_0x5d56ec){return _0x5f4d78[_0x85c4('0x1a')](_0x41b7af);}return _0x5f4d78['status'](_0x41b7af)['end']();};}function respondWithResult(_0x52a290,_0x45115b){_0x45115b=_0x45115b||0xc8;return function(_0x2c8ad){if(_0x2c8ad){return _0x52a290['status'](_0x45115b)[_0x85c4('0x1b')](_0x2c8ad);}};}function respondWithFilteredResult(_0x202409,_0x3e2769){return function(_0x3b2c52){if(_0x3b2c52){var _0x44d8fc=_0x3b2c52[_0x85c4('0x1c')],_0x515667=_0x3e2769['offset'],_0x37d724=_0x3e2769[_0x85c4('0x1d')]+_0x3e2769[_0x85c4('0x1e')],_0x2bd30f;if(_0x37d724>=_0x44d8fc){_0x37d724=_0x44d8fc;_0x2bd30f=0xc8;}else{_0x2bd30f=0xce;}_0x202409[_0x85c4('0x1f')](_0x2bd30f);return _0x202409[_0x85c4('0x20')](_0x85c4('0x21'),_0x515667+'-'+_0x37d724+'/'+_0x44d8fc)['json'](_0x3b2c52);}return null;};}function patchUpdates(_0x32cfe5){return function(_0x476abd){try{jsonpatch[_0x85c4('0x22')](_0x476abd,_0x32cfe5,!![]);}catch(_0x1c5ffc){return BPromise[_0x85c4('0x23')](_0x1c5ffc);}return _0x476abd[_0x85c4('0x24')]();};}function saveUpdates(_0x38cbed,_0x390fcb){return function(_0x15aff2){if(_0x15aff2){return _0x15aff2[_0x85c4('0x25')](_0x38cbed)[_0x85c4('0x26')](function(_0x2b9054){return _0x2b9054;});}return null;};}function removeEntity(_0x309616,_0x334a83){return function(_0x1f3646){if(_0x1f3646){return _0x1f3646[_0x85c4('0x27')]()[_0x85c4('0x26')](function(){_0x309616[_0x85c4('0x1f')](0xcc)[_0x85c4('0x28')]();});}};}function handleEntityNotFound(_0x40ba02,_0x346023){return function(_0x1da617){if(!_0x1da617){_0x40ba02[_0x85c4('0x1a')](0x194);}return _0x1da617;};}function handleError(_0x5948ed,_0x5e1dad){_0x5e1dad=_0x5e1dad||0x1f4;return function(_0x24bb30){logger[_0x85c4('0x29')](_0x24bb30[_0x85c4('0x2a')]);if(_0x24bb30[_0x85c4('0x2b')]){delete _0x24bb30['name'];}_0x5948ed[_0x85c4('0x1f')](_0x5e1dad)[_0x85c4('0x2c')](_0x24bb30);};}exports['index']=function(_0x76a5bb,_0x25029d){var _0x2649b9={},_0x4eb443={},_0x365482={'count':0x0,'rows':[]};var _0x3162f9=_[_0x85c4('0x2d')](db[_0x85c4('0x2e')][_0x85c4('0x2f')],function(_0x4c8386){return{'name':_0x4c8386[_0x85c4('0x30')],'type':_0x4c8386[_0x85c4('0x31')][_0x85c4('0x32')]};});_0x4eb443[_0x85c4('0x33')]=_[_0x85c4('0x2d')](_0x3162f9,'name');_0x4eb443['query']=_[_0x85c4('0x34')](_0x76a5bb[_0x85c4('0x35')]);_0x4eb443[_0x85c4('0x36')]=_[_0x85c4('0x37')](_0x4eb443[_0x85c4('0x33')],_0x4eb443[_0x85c4('0x35')]);_0x2649b9[_0x85c4('0x38')]=_[_0x85c4('0x37')](_0x4eb443[_0x85c4('0x33')],qs[_0x85c4('0x39')](_0x76a5bb[_0x85c4('0x35')][_0x85c4('0x39')]));_0x2649b9['attributes']=_0x2649b9['attributes']['length']?_0x2649b9[_0x85c4('0x38')]:_0x4eb443[_0x85c4('0x33')];if(!_0x76a5bb[_0x85c4('0x35')]['hasOwnProperty'](_0x85c4('0x3a'))){_0x2649b9[_0x85c4('0x1e')]=qs[_0x85c4('0x1e')](_0x76a5bb[_0x85c4('0x35')][_0x85c4('0x1e')]);_0x2649b9[_0x85c4('0x1d')]=qs['offset'](_0x76a5bb[_0x85c4('0x35')][_0x85c4('0x1d')]);}_0x2649b9[_0x85c4('0x3b')]=qs['sort'](_0x76a5bb[_0x85c4('0x35')][_0x85c4('0x3c')]);_0x2649b9['where']=qs[_0x85c4('0x36')](_['pick'](_0x76a5bb['query'],_0x4eb443[_0x85c4('0x36')]),_0x3162f9);if(_0x76a5bb[_0x85c4('0x35')][_0x85c4('0x3d')]){_0x2649b9[_0x85c4('0x3e')]=_['merge'](_0x2649b9['where'],{'$or':_['map'](_0x3162f9,function(_0x1410a6){if(_0x1410a6[_0x85c4('0x31')]!==_0x85c4('0x3f')){var _0x160e4={};_0x160e4[_0x1410a6[_0x85c4('0x2b')]]={'$like':'%'+_0x76a5bb[_0x85c4('0x35')][_0x85c4('0x3d')]+'%'};return _0x160e4;}})});}_0x2649b9=_[_0x85c4('0x40')]({},_0x2649b9,_0x76a5bb[_0x85c4('0x41')]);var _0xc9eb26={'where':_0x2649b9['where']};return db[_0x85c4('0x2e')][_0x85c4('0x1c')](_0xc9eb26)[_0x85c4('0x26')](function(_0x1e214f){_0x365482[_0x85c4('0x1c')]=_0x1e214f;if(_0x76a5bb[_0x85c4('0x35')][_0x85c4('0x42')]){_0x2649b9[_0x85c4('0x43')]=[{'all':!![]}];}return db[_0x85c4('0x2e')][_0x85c4('0x44')](_0x2649b9);})[_0x85c4('0x26')](function(_0x22a915){_0x365482[_0x85c4('0x45')]=_0x22a915;return _0x365482;})['then'](respondWithFilteredResult(_0x25029d,_0x2649b9))[_0x85c4('0x46')](handleError(_0x25029d,null));};exports[_0x85c4('0x47')]=function(_0x2c76aa,_0x5eedf3){var _0xdd17bd={'raw':![],'where':{'id':_0x2c76aa[_0x85c4('0x48')]['id']}},_0x3d364f={};_0x3d364f[_0x85c4('0x33')]=_[_0x85c4('0x34')](db['AnalyticFieldReport'][_0x85c4('0x2f')]);_0x3d364f[_0x85c4('0x35')]=_[_0x85c4('0x34')](_0x2c76aa['query']);_0x3d364f[_0x85c4('0x36')]=_['intersection'](_0x3d364f[_0x85c4('0x33')],_0x3d364f[_0x85c4('0x35')]);_0xdd17bd['attributes']=_['intersection'](_0x3d364f['model'],qs['fields'](_0x2c76aa[_0x85c4('0x35')][_0x85c4('0x39')]));_0xdd17bd[_0x85c4('0x38')]=_0xdd17bd[_0x85c4('0x38')]['length']?_0xdd17bd[_0x85c4('0x38')]:_0x3d364f[_0x85c4('0x33')];if(_0x2c76aa[_0x85c4('0x35')]['includeAll']){_0xdd17bd[_0x85c4('0x43')]=[{'all':!![]}];}_0xdd17bd=_[_0x85c4('0x40')]({},_0xdd17bd,_0x2c76aa[_0x85c4('0x41')]);return db[_0x85c4('0x2e')][_0x85c4('0x49')](_0xdd17bd)[_0x85c4('0x26')](handleEntityNotFound(_0x5eedf3,null))[_0x85c4('0x26')](respondWithResult(_0x5eedf3,null))[_0x85c4('0x46')](handleError(_0x5eedf3,null));};exports[_0x85c4('0x4a')]=function(_0xcebd1,_0x3fcec8){return db[_0x85c4('0x2e')][_0x85c4('0x4a')](_0xcebd1[_0x85c4('0x4b')],{})['then'](respondWithResult(_0x3fcec8,0xc9))[_0x85c4('0x46')](handleError(_0x3fcec8,null));};exports[_0x85c4('0x4c')]=function(_0x242381,_0x77f0c2){return db['AnalyticFieldReport'][_0x85c4('0x4c')](_0x242381[_0x85c4('0x4b')],{'raw':![],'individualHooks':!![]})[_0x85c4('0x26')](respondWithResult(_0x77f0c2,0xc9))[_0x85c4('0x46')](handleError(_0x77f0c2,null));};exports[_0x85c4('0x25')]=function(_0x2bfaea,_0x541ab5){if(_0x2bfaea[_0x85c4('0x4b')]['id']){delete _0x2bfaea['body']['id'];}return db['AnalyticFieldReport'][_0x85c4('0x49')]({'where':{'id':_0x2bfaea[_0x85c4('0x48')]['id']}})[_0x85c4('0x26')](handleEntityNotFound(_0x541ab5,null))['then'](saveUpdates(_0x2bfaea[_0x85c4('0x4b')],null))[_0x85c4('0x26')](respondWithResult(_0x541ab5,null))[_0x85c4('0x46')](handleError(_0x541ab5,null));};exports['destroy']=function(_0x593768,_0x423102){return db[_0x85c4('0x2e')]['find']({'where':{'id':_0x593768[_0x85c4('0x48')]['id']}})[_0x85c4('0x26')](handleEntityNotFound(_0x423102,null))[_0x85c4('0x26')](removeEntity(_0x423102,null))[_0x85c4('0x46')](handleError(_0x423102,null));};exports[_0x85c4('0x4d')]=function(_0x444db4,_0x105838){return db[_0x85c4('0x2e')][_0x85c4('0x27')]({'where':{'id':_0x444db4[_0x85c4('0x35')][_0x85c4('0x4e')]||[]},'raw':![],'individualHooks':!![]})[_0x85c4('0x26')](respondWithResult(_0x105838,0xcc))[_0x85c4('0x46')](handleError(_0x105838,null));};exports[_0x85c4('0x4f')]=function(_0x3be6a8,_0x5e9cee,_0xb802da){return db[_0x85c4('0x50')]['findOne']({'where':{'id':_0x3be6a8[_0x85c4('0x48')]['id']}})[_0x85c4('0x26')](handleEntityNotFound(_0x5e9cee,null))[_0x85c4('0x26')](function(_0x59ded8){if(_0x59ded8){return db[_0x85c4('0x51')][_0x85c4('0x52')](function(_0x263fab){return db['AnalyticFieldReport'][_0x85c4('0x27')]({'where':{'CustomReportId':_0x3be6a8[_0x85c4('0x48')]['id']},'transaction':_0x263fab})[_0x85c4('0x26')](function(_0x56a1f9){var _0xfa8399=_[_0x85c4('0x2d')](_0x3be6a8['body'],function(_0x28a9e2){delete _0x28a9e2['id'];_0x28a9e2['CustomReportId']=_0x3be6a8[_0x85c4('0x48')]['id'];return _0x28a9e2;});return db[_0x85c4('0x2e')][_0x85c4('0x4c')](_0xfa8399,{'transaction':_0x263fab});});})[_0x85c4('0x26')](function(){return db[_0x85c4('0x2e')][_0x85c4('0x44')]({'where':{'CustomReportId':_0x3be6a8['params']['id']}});});}})[_0x85c4('0x26')](respondWithResult(_0x5e9cee,null))[_0x85c4('0x46')](handleError(_0x5e9cee,null));};
\ No newline at end of file
+var _0xd6ce=['jsforce','querystring','papaparse','ioredis','../../components/auth/service','api','../../mysqldb','status','end','json','offset','limit','Content-Range','apply','reject','save','then','destroy','sendStatus','error','stack','name','send','index','map','AnalyticFieldReport','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','count','includeAll','include','findAll','rows','catch','show','find','create','body','bulkCreate','update','params','bulkDestroy','ids','addFields','AnalyticCustomReport','sequelize','CustomReportId','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','crypto'];(function(_0x311909,_0x414bf7){var _0x8d3163=function(_0x226f55){while(--_0x226f55){_0x311909['push'](_0x311909['shift']());}};_0x8d3163(++_0x414bf7);}(_0xd6ce,0x127));var _0xed6c=function(_0x7ef7db,_0x392508){_0x7ef7db=_0x7ef7db-0x0;var _0x465a01=_0xd6ce[_0x7ef7db];return _0x465a01;};'use strict';var pdf=require(_0xed6c('0x0'));var emlformat=require(_0xed6c('0x1'));var rimraf=require(_0xed6c('0x2'));var zipdir=require(_0xed6c('0x3'));var jsonpatch=require(_0xed6c('0x4'));var rp=require(_0xed6c('0x5'));var moment=require(_0xed6c('0x6'));var BPromise=require(_0xed6c('0x7'));var Mustache=require('mustache');var util=require('util');var path=require(_0xed6c('0x8'));var sox=require(_0xed6c('0x9'));var csv=require(_0xed6c('0xa'));var ejs=require(_0xed6c('0xb'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0xed6c('0xc'));var jsforce=require(_0xed6c('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xed6c('0xe'));var Papa=require(_0xed6c('0xf'));var Redis=require(_0xed6c('0x10'));var authService=require(_0xed6c('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xed6c('0x12'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0xed6c('0x13'))['db'];function respondWithStatusCode(_0x125c5f,_0x4efd40){_0x4efd40=_0x4efd40||0xcc;return function(_0x17e109){if(_0x17e109){return _0x125c5f['sendStatus'](_0x4efd40);}return _0x125c5f[_0xed6c('0x14')](_0x4efd40)[_0xed6c('0x15')]();};}function respondWithResult(_0x47c392,_0x3f3126){_0x3f3126=_0x3f3126||0xc8;return function(_0x32a8c9){if(_0x32a8c9){return _0x47c392[_0xed6c('0x14')](_0x3f3126)[_0xed6c('0x16')](_0x32a8c9);}};}function respondWithFilteredResult(_0x4b0ad3,_0x57ec05){return function(_0x2034d4){if(_0x2034d4){var _0x3d99b8=_0x2034d4['count'],_0x156e84=_0x57ec05[_0xed6c('0x17')],_0x4fbdb5=_0x57ec05[_0xed6c('0x17')]+_0x57ec05[_0xed6c('0x18')],_0x13c503;if(_0x4fbdb5>=_0x3d99b8){_0x4fbdb5=_0x3d99b8;_0x13c503=0xc8;}else{_0x13c503=0xce;}_0x4b0ad3[_0xed6c('0x14')](_0x13c503);return _0x4b0ad3['set'](_0xed6c('0x19'),_0x156e84+'-'+_0x4fbdb5+'/'+_0x3d99b8)[_0xed6c('0x16')](_0x2034d4);}return null;};}function patchUpdates(_0x277ee7){return function(_0x5bc042){try{jsonpatch[_0xed6c('0x1a')](_0x5bc042,_0x277ee7,!![]);}catch(_0x2d34d5){return BPromise[_0xed6c('0x1b')](_0x2d34d5);}return _0x5bc042[_0xed6c('0x1c')]();};}function saveUpdates(_0x314aeb,_0x5e86ad){return function(_0x85aedf){if(_0x85aedf){return _0x85aedf['update'](_0x314aeb)[_0xed6c('0x1d')](function(_0x37a9ce){return _0x37a9ce;});}return null;};}function removeEntity(_0x30e605,_0x34faac){return function(_0x49a583){if(_0x49a583){return _0x49a583[_0xed6c('0x1e')]()['then'](function(){_0x30e605[_0xed6c('0x14')](0xcc)['end']();});}};}function handleEntityNotFound(_0x7882e0,_0x21e0ba){return function(_0x51876b){if(!_0x51876b){_0x7882e0[_0xed6c('0x1f')](0x194);}return _0x51876b;};}function handleError(_0x391970,_0x1c3aca){_0x1c3aca=_0x1c3aca||0x1f4;return function(_0x638bc2){logger[_0xed6c('0x20')](_0x638bc2[_0xed6c('0x21')]);if(_0x638bc2[_0xed6c('0x22')]){delete _0x638bc2[_0xed6c('0x22')];}_0x391970['status'](_0x1c3aca)[_0xed6c('0x23')](_0x638bc2);};}exports[_0xed6c('0x24')]=function(_0x225ec6,_0x21d91e){var _0x953c0d={},_0x3574a3={},_0x47bdc5={'count':0x0,'rows':[]};var _0x23ee72=_[_0xed6c('0x25')](db[_0xed6c('0x26')]['rawAttributes'],function(_0x4e4373){return{'name':_0x4e4373['fieldName'],'type':_0x4e4373['type'][_0xed6c('0x27')]};});_0x3574a3['model']=_[_0xed6c('0x25')](_0x23ee72,'name');_0x3574a3[_0xed6c('0x28')]=_[_0xed6c('0x29')](_0x225ec6['query']);_0x3574a3[_0xed6c('0x2a')]=_[_0xed6c('0x2b')](_0x3574a3[_0xed6c('0x2c')],_0x3574a3[_0xed6c('0x28')]);_0x953c0d[_0xed6c('0x2d')]=_[_0xed6c('0x2b')](_0x3574a3['model'],qs[_0xed6c('0x2e')](_0x225ec6[_0xed6c('0x28')]['fields']));_0x953c0d[_0xed6c('0x2d')]=_0x953c0d['attributes'][_0xed6c('0x2f')]?_0x953c0d[_0xed6c('0x2d')]:_0x3574a3[_0xed6c('0x2c')];if(!_0x225ec6[_0xed6c('0x28')][_0xed6c('0x30')](_0xed6c('0x31'))){_0x953c0d['limit']=qs['limit'](_0x225ec6['query'][_0xed6c('0x18')]);_0x953c0d[_0xed6c('0x17')]=qs[_0xed6c('0x17')](_0x225ec6['query'][_0xed6c('0x17')]);}_0x953c0d[_0xed6c('0x32')]=qs[_0xed6c('0x33')](_0x225ec6[_0xed6c('0x28')][_0xed6c('0x33')]);_0x953c0d[_0xed6c('0x34')]=qs[_0xed6c('0x2a')](_[_0xed6c('0x35')](_0x225ec6[_0xed6c('0x28')],_0x3574a3[_0xed6c('0x2a')]),_0x23ee72);if(_0x225ec6[_0xed6c('0x28')][_0xed6c('0x36')]){_0x953c0d['where']=_[_0xed6c('0x37')](_0x953c0d[_0xed6c('0x34')],{'$or':_[_0xed6c('0x25')](_0x23ee72,function(_0x246589){if(_0x246589['type']!==_0xed6c('0x38')){var _0xb12a25={};_0xb12a25[_0x246589[_0xed6c('0x22')]]={'$like':'%'+_0x225ec6['query'][_0xed6c('0x36')]+'%'};return _0xb12a25;}})});}_0x953c0d=_['merge']({},_0x953c0d,_0x225ec6[_0xed6c('0x39')]);var _0x3aaf5a={'where':_0x953c0d[_0xed6c('0x34')]};return db['AnalyticFieldReport'][_0xed6c('0x3a')](_0x3aaf5a)[_0xed6c('0x1d')](function(_0x48708d){_0x47bdc5[_0xed6c('0x3a')]=_0x48708d;if(_0x225ec6[_0xed6c('0x28')][_0xed6c('0x3b')]){_0x953c0d[_0xed6c('0x3c')]=[{'all':!![]}];}return db[_0xed6c('0x26')][_0xed6c('0x3d')](_0x953c0d);})[_0xed6c('0x1d')](function(_0x212acc){_0x47bdc5[_0xed6c('0x3e')]=_0x212acc;return _0x47bdc5;})[_0xed6c('0x1d')](respondWithFilteredResult(_0x21d91e,_0x953c0d))[_0xed6c('0x3f')](handleError(_0x21d91e,null));};exports[_0xed6c('0x40')]=function(_0x41409d,_0x5c170e){var _0x10d810={'raw':![],'where':{'id':_0x41409d['params']['id']}},_0x468f50={};_0x468f50[_0xed6c('0x2c')]=_[_0xed6c('0x29')](db['AnalyticFieldReport']['rawAttributes']);_0x468f50[_0xed6c('0x28')]=_[_0xed6c('0x29')](_0x41409d['query']);_0x468f50[_0xed6c('0x2a')]=_[_0xed6c('0x2b')](_0x468f50['model'],_0x468f50['query']);_0x10d810[_0xed6c('0x2d')]=_[_0xed6c('0x2b')](_0x468f50[_0xed6c('0x2c')],qs[_0xed6c('0x2e')](_0x41409d['query'][_0xed6c('0x2e')]));_0x10d810[_0xed6c('0x2d')]=_0x10d810[_0xed6c('0x2d')][_0xed6c('0x2f')]?_0x10d810[_0xed6c('0x2d')]:_0x468f50[_0xed6c('0x2c')];if(_0x41409d[_0xed6c('0x28')][_0xed6c('0x3b')]){_0x10d810[_0xed6c('0x3c')]=[{'all':!![]}];}_0x10d810=_['merge']({},_0x10d810,_0x41409d[_0xed6c('0x39')]);return db['AnalyticFieldReport'][_0xed6c('0x41')](_0x10d810)[_0xed6c('0x1d')](handleEntityNotFound(_0x5c170e,null))[_0xed6c('0x1d')](respondWithResult(_0x5c170e,null))[_0xed6c('0x3f')](handleError(_0x5c170e,null));};exports['create']=function(_0x15a844,_0x47e113){return db[_0xed6c('0x26')][_0xed6c('0x42')](_0x15a844[_0xed6c('0x43')],{})[_0xed6c('0x1d')](respondWithResult(_0x47e113,0xc9))['catch'](handleError(_0x47e113,null));};exports[_0xed6c('0x44')]=function(_0x369481,_0xb54734){return db[_0xed6c('0x26')][_0xed6c('0x44')](_0x369481[_0xed6c('0x43')],{'raw':![],'individualHooks':!![]})[_0xed6c('0x1d')](respondWithResult(_0xb54734,0xc9))[_0xed6c('0x3f')](handleError(_0xb54734,null));};exports[_0xed6c('0x45')]=function(_0x124616,_0x77ca87){if(_0x124616[_0xed6c('0x43')]['id']){delete _0x124616[_0xed6c('0x43')]['id'];}return db[_0xed6c('0x26')][_0xed6c('0x41')]({'where':{'id':_0x124616[_0xed6c('0x46')]['id']}})[_0xed6c('0x1d')](handleEntityNotFound(_0x77ca87,null))['then'](saveUpdates(_0x124616[_0xed6c('0x43')],null))[_0xed6c('0x1d')](respondWithResult(_0x77ca87,null))[_0xed6c('0x3f')](handleError(_0x77ca87,null));};exports[_0xed6c('0x1e')]=function(_0x2301fd,_0x200a7a){return db[_0xed6c('0x26')][_0xed6c('0x41')]({'where':{'id':_0x2301fd['params']['id']}})[_0xed6c('0x1d')](handleEntityNotFound(_0x200a7a,null))[_0xed6c('0x1d')](removeEntity(_0x200a7a,null))[_0xed6c('0x3f')](handleError(_0x200a7a,null));};exports[_0xed6c('0x47')]=function(_0x2438aa,_0xaacd00){return db['AnalyticFieldReport'][_0xed6c('0x1e')]({'where':{'id':_0x2438aa[_0xed6c('0x28')][_0xed6c('0x48')]||[]},'raw':![],'individualHooks':!![]})[_0xed6c('0x1d')](respondWithResult(_0xaacd00,0xcc))['catch'](handleError(_0xaacd00,null));};exports[_0xed6c('0x49')]=function(_0x39e366,_0x2d6f1b,_0x40b9bf){return db[_0xed6c('0x4a')]['findOne']({'where':{'id':_0x39e366[_0xed6c('0x46')]['id']}})[_0xed6c('0x1d')](handleEntityNotFound(_0x2d6f1b,null))['then'](function(_0x33fbeb){if(_0x33fbeb){return db[_0xed6c('0x4b')]['transaction'](function(_0x26513b){return db[_0xed6c('0x26')][_0xed6c('0x1e')]({'where':{'CustomReportId':_0x39e366[_0xed6c('0x46')]['id']},'transaction':_0x26513b})['then'](function(_0x39d335){var _0x4e8fd8=_[_0xed6c('0x25')](_0x39e366[_0xed6c('0x43')],function(_0x301dc9){delete _0x301dc9['id'];_0x301dc9[_0xed6c('0x4c')]=_0x39e366[_0xed6c('0x46')]['id'];return _0x301dc9;});return db[_0xed6c('0x26')][_0xed6c('0x44')](_0x4e8fd8,{'transaction':_0x26513b});});})[_0xed6c('0x1d')](function(){return db['AnalyticFieldReport'][_0xed6c('0x3d')]({'where':{'CustomReportId':_0x39e366[_0xed6c('0x46')]['id']}});});}})[_0xed6c('0x1d')](respondWithResult(_0x2d6f1b,null))[_0xed6c('0x3f')](handleError(_0x2d6f1b,null));};
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.model.js b/server/api/analyticFieldReport/analyticFieldReport.model.js
index 0405983..687a022 100644
--- a/server/api/analyticFieldReport/analyticFieldReport.model.js
+++ b/server/api/analyticFieldReport/analyticFieldReport.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x30be=['util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./analyticFieldReport.attributes','exports','define','lodash'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x30be,0x6b));var _0xe30b=function(_0x232eb7,_0x199b07){_0x232eb7=_0x232eb7-0x0;var _0xd7fb8=_0x30be[_0x232eb7];return _0xd7fb8;};'use strict';var _=require(_0xe30b('0x0'));var util=require(_0xe30b('0x1'));var logger=require(_0xe30b('0x2'))(_0xe30b('0x3'));var moment=require(_0xe30b('0x4'));var BPromise=require('bluebird');var rp=require(_0xe30b('0x5'));var fs=require('fs');var path=require(_0xe30b('0x6'));var rimraf=require(_0xe30b('0x7'));var config=require(_0xe30b('0x8'));var attributes=require(_0xe30b('0x9'));module[_0xe30b('0xa')]=function(_0x255807,_0x201657){return _0x255807[_0xe30b('0xb')]('AnalyticFieldReport',attributes,{'tableName':'analytics_report_fields','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x8739=['rimraf','../../config/environment','exports','lodash','util','../../config/logger','api','moment','request-promise','path'];(function(_0x4f95f8,_0xb73784){var _0x123b8e=function(_0x89ad8f){while(--_0x89ad8f){_0x4f95f8['push'](_0x4f95f8['shift']());}};_0x123b8e(++_0xb73784);}(_0x8739,0xfd));var _0x9873=function(_0x2eee52,_0x115662){_0x2eee52=_0x2eee52-0x0;var _0x11a18b=_0x8739[_0x2eee52];return _0x11a18b;};'use strict';var _=require(_0x9873('0x0'));var util=require(_0x9873('0x1'));var logger=require(_0x9873('0x2'))(_0x9873('0x3'));var moment=require(_0x9873('0x4'));var BPromise=require('bluebird');var rp=require(_0x9873('0x5'));var fs=require('fs');var path=require(_0x9873('0x6'));var rimraf=require(_0x9873('0x7'));var config=require(_0x9873('0x8'));var attributes=require('./analyticFieldReport.attributes');module[_0x9873('0x9')]=function(_0x59d503,_0x4cab1d){return _0x59d503['define']('AnalyticFieldReport',attributes,{'tableName':'analytics_report_fields','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.rpc.js b/server/api/analyticFieldReport/analyticFieldReport.rpc.js
index 8c436da..8a5376e 100644
--- a/server/api/analyticFieldReport/analyticFieldReport.rpc.js
+++ b/server/api/analyticFieldReport/analyticFieldReport.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x5c0f=['error','code','AnalyticFieldReport,\x20%s,\x20%s','message','result','catch','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','request\x20sent','debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x54b680,_0x254038){var _0x49488d=function(_0x2a38f4){while(--_0x2a38f4){_0x54b680['push'](_0x54b680['shift']());}};_0x49488d(++_0x254038);}(_0x5c0f,0x1d2));var _0xf5c0=function(_0x43b276,_0x228f27){_0x43b276=_0x43b276-0x0;var _0x1e0f92=_0x5c0f[_0x43b276];return _0x1e0f92;};'use strict';var _=require('lodash');var util=require(_0xf5c0('0x0'));var moment=require(_0xf5c0('0x1'));var BPromise=require(_0xf5c0('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf5c0('0x3'))['db'];var utils=require(_0xf5c0('0x4'));var logger=require(_0xf5c0('0x5'))(_0xf5c0('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xf5c0('0x7')][_0xf5c0('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x108ee5,_0xcf2607,_0x7151c2){return new BPromise(function(_0x2f9d20,_0x253d3a){return client[_0xf5c0('0x9')](_0x108ee5,_0x7151c2)['then'](function(_0x2b1b9f){logger['info']('AnalyticFieldReport,\x20%s,\x20%s',_0xcf2607,_0xf5c0('0xa'));logger[_0xf5c0('0xb')](_0xf5c0('0xc'),_0xcf2607,_0xf5c0('0xa'),JSON[_0xf5c0('0xd')](_0x2b1b9f));if(_0x2b1b9f[_0xf5c0('0xe')]){if(_0x2b1b9f[_0xf5c0('0xe')][_0xf5c0('0xf')]===0x1f4){logger[_0xf5c0('0xe')](_0xf5c0('0x10'),_0xcf2607,_0x2b1b9f[_0xf5c0('0xe')][_0xf5c0('0x11')]);return _0x253d3a(_0x2b1b9f[_0xf5c0('0xe')][_0xf5c0('0x11')]);}logger[_0xf5c0('0xe')]('AnalyticFieldReport,\x20%s,\x20%s',_0xcf2607,_0x2b1b9f[_0xf5c0('0xe')][_0xf5c0('0x11')]);return _0x2f9d20(_0x2b1b9f[_0xf5c0('0xe')][_0xf5c0('0x11')]);}else{logger['info'](_0xf5c0('0x10'),_0xcf2607,_0xf5c0('0xa'));_0x2f9d20(_0x2b1b9f[_0xf5c0('0x12')][_0xf5c0('0x11')]);}})[_0xf5c0('0x13')](function(_0x52219c){logger[_0xf5c0('0xe')](_0xf5c0('0x10'),_0xcf2607,_0x52219c);_0x253d3a(_0x52219c);});});}
\ No newline at end of file
+var _0x6379=['randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','info','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','lodash','util','moment','bluebird'];(function(_0x55c4c5,_0x2f19c3){var _0x2a3d07=function(_0x332212){while(--_0x332212){_0x55c4c5['push'](_0x55c4c5['shift']());}};_0x2a3d07(++_0x2f19c3);}(_0x6379,0x1dc));var _0x9637=function(_0x1ffe75,_0x59931f){_0x1ffe75=_0x1ffe75-0x0;var _0x56bcdc=_0x6379[_0x1ffe75];return _0x56bcdc;};'use strict';var _=require(_0x9637('0x0'));var util=require(_0x9637('0x1'));var moment=require(_0x9637('0x2'));var BPromise=require(_0x9637('0x3'));var rs=require(_0x9637('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9637('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x9637('0x6'))(_0x9637('0x7'));var config=require(_0x9637('0x8'));var jayson=require(_0x9637('0x9'));var client=jayson[_0x9637('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5b91e3,_0x32c145,_0xcab46){return new BPromise(function(_0x20addb,_0x19798d){return client[_0x9637('0xb')](_0x5b91e3,_0xcab46)['then'](function(_0x3df19e){logger[_0x9637('0xc')](_0x9637('0xd'),_0x32c145,_0x9637('0xe'));logger['debug']('AnalyticFieldReport,\x20%s,\x20%s,\x20%s',_0x32c145,'request\x20sent',JSON['stringify'](_0x3df19e));if(_0x3df19e['error']){if(_0x3df19e[_0x9637('0xf')][_0x9637('0x10')]===0x1f4){logger[_0x9637('0xf')](_0x9637('0xd'),_0x32c145,_0x3df19e[_0x9637('0xf')][_0x9637('0x11')]);return _0x19798d(_0x3df19e['error'][_0x9637('0x11')]);}logger[_0x9637('0xf')](_0x9637('0xd'),_0x32c145,_0x3df19e[_0x9637('0xf')][_0x9637('0x11')]);return _0x20addb(_0x3df19e['error'][_0x9637('0x11')]);}else{logger[_0x9637('0xc')]('AnalyticFieldReport,\x20%s,\x20%s',_0x32c145,_0x9637('0xe'));_0x20addb(_0x3df19e[_0x9637('0x12')][_0x9637('0x11')]);}})[_0x9637('0x13')](function(_0x340166){logger[_0x9637('0xf')]('AnalyticFieldReport,\x20%s,\x20%s',_0x32c145,_0x340166);_0x19798d(_0x340166);});});}
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/index.js b/server/api/analyticFieldReport/index.js
index 5bdb769..9b8858e 100644
--- a/server/api/analyticFieldReport/index.js
+++ b/server/api/analyticFieldReport/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7217=['put','update','delete','bulkDestroy','destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','./analyticFieldReport.controller','get','isAuthenticated','index','/:id','show','post','create','/create_many','bulkCreate','/:id/create_many','addFields'];(function(_0x2f3947,_0xd4b6f){var _0x424d39=function(_0x238daf){while(--_0x238daf){_0x2f3947['push'](_0x2f3947['shift']());}};_0x424d39(++_0xd4b6f);}(_0x7217,0x19e));var _0x7721=function(_0x4154a6,_0x2c0b8e){_0x4154a6=_0x4154a6-0x0;var _0x3b2786=_0x7217[_0x4154a6];return _0x3b2786;};'use strict';var multer=require(_0x7721('0x0'));var util=require('util');var path=require(_0x7721('0x1'));var timeout=require(_0x7721('0x2'));var express=require(_0x7721('0x3'));var router=express[_0x7721('0x4')]();var auth=require(_0x7721('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x7721('0x6'));router[_0x7721('0x7')]('/',auth[_0x7721('0x8')](),controller[_0x7721('0x9')]);router[_0x7721('0x7')](_0x7721('0xa'),auth[_0x7721('0x8')](),controller[_0x7721('0xb')]);router[_0x7721('0xc')]('/',auth[_0x7721('0x8')](),controller[_0x7721('0xd')]);router[_0x7721('0xc')](_0x7721('0xe'),auth[_0x7721('0x8')](),controller[_0x7721('0xf')]);router['post'](_0x7721('0x10'),auth[_0x7721('0x8')](),controller[_0x7721('0x11')]);router[_0x7721('0x12')](_0x7721('0xa'),auth[_0x7721('0x8')](),controller[_0x7721('0x13')]);router[_0x7721('0x14')]('/destroy_many',auth[_0x7721('0x8')](),controller[_0x7721('0x15')]);router['delete'](_0x7721('0xa'),auth[_0x7721('0x8')](),controller[_0x7721('0x16')]);module[_0x7721('0x17')]=router;
\ No newline at end of file
+var _0x814b=['../../config/environment','./analyticFieldReport.controller','get','isAuthenticated','index','/:id','post','create','/create_many','bulkCreate','/:id/create_many','addFields','update','delete','/destroy_many','bulkDestroy','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service'];(function(_0x532cc7,_0x24dbe8){var _0x2ad62a=function(_0x16db4a){while(--_0x16db4a){_0x532cc7['push'](_0x532cc7['shift']());}};_0x2ad62a(++_0x24dbe8);}(_0x814b,0x1a2));var _0xb814=function(_0x379ee5,_0x336c42){_0x379ee5=_0x379ee5-0x0;var _0x114694=_0x814b[_0x379ee5];return _0x114694;};'use strict';var multer=require(_0xb814('0x0'));var util=require(_0xb814('0x1'));var path=require(_0xb814('0x2'));var timeout=require(_0xb814('0x3'));var express=require(_0xb814('0x4'));var router=express[_0xb814('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0xb814('0x6'));var config=require(_0xb814('0x7'));var controller=require(_0xb814('0x8'));router[_0xb814('0x9')]('/',auth[_0xb814('0xa')](),controller[_0xb814('0xb')]);router['get'](_0xb814('0xc'),auth[_0xb814('0xa')](),controller['show']);router[_0xb814('0xd')]('/',auth[_0xb814('0xa')](),controller[_0xb814('0xe')]);router[_0xb814('0xd')](_0xb814('0xf'),auth[_0xb814('0xa')](),controller[_0xb814('0x10')]);router[_0xb814('0xd')](_0xb814('0x11'),auth[_0xb814('0xa')](),controller[_0xb814('0x12')]);router['put'](_0xb814('0xc'),auth['isAuthenticated'](),controller[_0xb814('0x13')]);router[_0xb814('0x14')](_0xb814('0x15'),auth[_0xb814('0xa')](),controller[_0xb814('0x16')]);router[_0xb814('0x14')](_0xb814('0xc'),auth[_0xb814('0xa')](),controller[_0xb814('0x17')]);module[_0xb814('0x18')]=router;
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.attributes.js b/server/api/analyticMetric/analyticMetric.attributes.js
index a75bf5c..bd26c66 100644
--- a/server/api/analyticMetric/analyticMetric.attributes.js
+++ b/server/api/analyticMetric/analyticMetric.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7072=['exports','STRING','name','TEXT'];(function(_0xccd9b7,_0x2ea6bd){var _0x26301d=function(_0x5892db){while(--_0x5892db){_0xccd9b7['push'](_0xccd9b7['shift']());}};_0x26301d(++_0x2ea6bd);}(_0x7072,0x138));var _0x2707=function(_0x1969a7,_0x5a133a){_0x1969a7=_0x1969a7-0x0;var _0x3d665f=_0x7072[_0x1969a7];return _0x3d665f;};'use strict';var Sequelize=require('sequelize');module[_0x2707('0x0')]={'name':{'type':Sequelize[_0x2707('0x1')],'allowNull':![],'unique':_0x2707('0x2')},'table':{'type':Sequelize[_0x2707('0x1')]},'metric':{'type':Sequelize[_0x2707('0x3')]},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0xc936=['name','STRING','TEXT','exports'];(function(_0x4eaed1,_0x38ba87){var _0x22b9b8=function(_0x1ddaff){while(--_0x1ddaff){_0x4eaed1['push'](_0x4eaed1['shift']());}};_0x22b9b8(++_0x38ba87);}(_0xc936,0x153));var _0x6c93=function(_0x3be48b,_0xddcefa){_0x3be48b=_0x3be48b-0x0;var _0xeee73f=_0xc936[_0x3be48b];return _0xeee73f;};'use strict';var Sequelize=require('sequelize');module[_0x6c93('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x6c93('0x1')},'table':{'type':Sequelize[_0x6c93('0x2')]},'metric':{'type':Sequelize[_0x6c93('0x3')]},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.controller.js b/server/api/analyticMetric/analyticMetric.controller.js
index 1d012a8..b88d907 100644
--- a/server/api/analyticMetric/analyticMetric.controller.js
+++ b/server/api/analyticMetric/analyticMetric.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xe511=['UserProfileResource','stack','index','fieldName','type','key','model','map','name','query','keys','filters','attributes','intersection','length','hasOwnProperty','offset','order','sort','where','pick','filter','merge','VIRTUAL','AnalyticMetric','includeAll','include','findAll','catch','show','params','rawAttributes','fields','options','body','user','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','find','html-pdf','eml-format','zip-dir','request-promise','moment','mustache','util','path','sox','ejs','lodash','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','limit','set','Content-Range','apply','reject','save','destroy','then','get','Metrics'];(function(_0x2d460c,_0x4f08c0){var _0xf6fc4c=function(_0x4fb81c){while(--_0x4fb81c){_0x2d460c['push'](_0x2d460c['shift']());}};_0xf6fc4c(++_0x4f08c0);}(_0xe511,0x16f));var _0x1e51=function(_0x2a07c9,_0x185c10){_0x2a07c9=_0x2a07c9-0x0;var _0x4e5723=_0xe511[_0x2a07c9];return _0x4e5723;};'use strict';var pdf=require(_0x1e51('0x0'));var emlformat=require(_0x1e51('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x1e51('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x1e51('0x3'));var moment=require(_0x1e51('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x1e51('0x5'));var util=require(_0x1e51('0x6'));var path=require(_0x1e51('0x7'));var sox=require(_0x1e51('0x8'));var csv=require('to-csv');var ejs=require(_0x1e51('0x9'));var fs=require('fs');var _=require(_0x1e51('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x1e51('0xb'));var deskjs=require(_0x1e51('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x1e51('0xd'));var Redis=require(_0x1e51('0xe'));var authService=require(_0x1e51('0xf'));var qs=require(_0x1e51('0x10'));var as=require(_0x1e51('0x11'));var hardwareService=require(_0x1e51('0x12'));var logger=require('../../config/logger')(_0x1e51('0x13'));var utils=require(_0x1e51('0x14'));var config=require(_0x1e51('0x15'));var db=require(_0x1e51('0x16'))['db'];function respondWithStatusCode(_0x34ad70,_0x3c5330){_0x3c5330=_0x3c5330||0xcc;return function(_0x5544eb){if(_0x5544eb){return _0x34ad70[_0x1e51('0x17')](_0x3c5330);}return _0x34ad70[_0x1e51('0x18')](_0x3c5330)[_0x1e51('0x19')]();};}function respondWithResult(_0xcf297f,_0x21bcbd){_0x21bcbd=_0x21bcbd||0xc8;return function(_0x32945d){if(_0x32945d){return _0xcf297f[_0x1e51('0x18')](_0x21bcbd)[_0x1e51('0x1a')](_0x32945d);}};}function respondWithFilteredResult(_0x1cc62a,_0xd76fba){return function(_0x5a5c07){if(_0x5a5c07){var _0x3b01b7=_0x5a5c07[_0x1e51('0x1b')],_0x24db4f=_0xd76fba['offset'],_0x4526b4=_0xd76fba['offset']+_0xd76fba[_0x1e51('0x1c')],_0x5857e2;if(_0x4526b4>=_0x3b01b7){_0x4526b4=_0x3b01b7;_0x5857e2=0xc8;}else{_0x5857e2=0xce;}_0x1cc62a[_0x1e51('0x18')](_0x5857e2);return _0x1cc62a[_0x1e51('0x1d')](_0x1e51('0x1e'),_0x24db4f+'-'+_0x4526b4+'/'+_0x3b01b7)[_0x1e51('0x1a')](_0x5a5c07);}return null;};}function patchUpdates(_0x3e4234){return function(_0x4ef18a){try{jsonpatch[_0x1e51('0x1f')](_0x4ef18a,_0x3e4234,!![]);}catch(_0x4a9272){return BPromise[_0x1e51('0x20')](_0x4a9272);}return _0x4ef18a[_0x1e51('0x21')]();};}function saveUpdates(_0x309a87,_0x183a95){return function(_0x506f40){if(_0x506f40){return _0x506f40['update'](_0x309a87)['then'](function(_0x548c32){return _0x548c32;});}return null;};}function removeEntity(_0x1aec4f,_0x4f1f56){return function(_0x3f7340){if(_0x3f7340){return _0x3f7340[_0x1e51('0x22')]()[_0x1e51('0x23')](function(){var _0x13240f=_0x3f7340[_0x1e51('0x24')]({'plain':!![]});var _0xf9298=_0x1e51('0x25');return db[_0x1e51('0x26')]['destroy']({'where':{'type':_0xf9298,'resourceId':_0x13240f['id']}})['then'](function(){return _0x3f7340;});})[_0x1e51('0x23')](function(){_0x1aec4f[_0x1e51('0x18')](0xcc)[_0x1e51('0x19')]();});}};}function handleEntityNotFound(_0x1386db,_0x505d79){return function(_0x54d031){if(!_0x54d031){_0x1386db['sendStatus'](0x194);}return _0x54d031;};}function handleError(_0x1eb83f,_0x2a1561){_0x2a1561=_0x2a1561||0x1f4;return function(_0x433c2d){logger['error'](_0x433c2d[_0x1e51('0x27')]);if(_0x433c2d['name']){delete _0x433c2d['name'];}_0x1eb83f[_0x1e51('0x18')](_0x2a1561)['send'](_0x433c2d);};}exports[_0x1e51('0x28')]=function(_0x1eb79f,_0x56722f){var _0x3e6ef2={},_0x10ee23={},_0x71c7af={'count':0x0,'rows':[]};var _0x6862d1=_['map'](db['AnalyticMetric']['rawAttributes'],function(_0x20eb9b){return{'name':_0x20eb9b[_0x1e51('0x29')],'type':_0x20eb9b[_0x1e51('0x2a')][_0x1e51('0x2b')]};});_0x10ee23[_0x1e51('0x2c')]=_[_0x1e51('0x2d')](_0x6862d1,_0x1e51('0x2e'));_0x10ee23[_0x1e51('0x2f')]=_[_0x1e51('0x30')](_0x1eb79f[_0x1e51('0x2f')]);_0x10ee23[_0x1e51('0x31')]=_['intersection'](_0x10ee23[_0x1e51('0x2c')],_0x10ee23[_0x1e51('0x2f')]);_0x3e6ef2[_0x1e51('0x32')]=_[_0x1e51('0x33')](_0x10ee23[_0x1e51('0x2c')],qs['fields'](_0x1eb79f[_0x1e51('0x2f')]['fields']));_0x3e6ef2[_0x1e51('0x32')]=_0x3e6ef2[_0x1e51('0x32')][_0x1e51('0x34')]?_0x3e6ef2['attributes']:_0x10ee23[_0x1e51('0x2c')];if(!_0x1eb79f['query'][_0x1e51('0x35')]('nolimit')){_0x3e6ef2['limit']=qs[_0x1e51('0x1c')](_0x1eb79f[_0x1e51('0x2f')][_0x1e51('0x1c')]);_0x3e6ef2['offset']=qs[_0x1e51('0x36')](_0x1eb79f['query'][_0x1e51('0x36')]);}_0x3e6ef2[_0x1e51('0x37')]=qs['sort'](_0x1eb79f[_0x1e51('0x2f')][_0x1e51('0x38')]);_0x3e6ef2[_0x1e51('0x39')]=qs[_0x1e51('0x31')](_[_0x1e51('0x3a')](_0x1eb79f[_0x1e51('0x2f')],_0x10ee23['filters']),_0x6862d1);if(_0x1eb79f['query'][_0x1e51('0x3b')]){_0x3e6ef2['where']=_[_0x1e51('0x3c')](_0x3e6ef2[_0x1e51('0x39')],{'$or':_[_0x1e51('0x2d')](_0x6862d1,function(_0xcfa1d8){if(_0xcfa1d8[_0x1e51('0x2a')]!==_0x1e51('0x3d')){var _0x845a62={};_0x845a62[_0xcfa1d8[_0x1e51('0x2e')]]={'$like':'%'+_0x1eb79f[_0x1e51('0x2f')][_0x1e51('0x3b')]+'%'};return _0x845a62;}})});}_0x3e6ef2=_[_0x1e51('0x3c')]({},_0x3e6ef2,_0x1eb79f['options']);var _0x29a689={'where':_0x3e6ef2['where']};return db[_0x1e51('0x3e')][_0x1e51('0x1b')](_0x29a689)[_0x1e51('0x23')](function(_0x471386){_0x71c7af[_0x1e51('0x1b')]=_0x471386;if(_0x1eb79f[_0x1e51('0x2f')][_0x1e51('0x3f')]){_0x3e6ef2[_0x1e51('0x40')]=[{'all':!![]}];}return db[_0x1e51('0x3e')][_0x1e51('0x41')](_0x3e6ef2);})[_0x1e51('0x23')](function(_0x5b4b3f){_0x71c7af['rows']=_0x5b4b3f;return _0x71c7af;})[_0x1e51('0x23')](respondWithFilteredResult(_0x56722f,_0x3e6ef2))[_0x1e51('0x42')](handleError(_0x56722f,null));};exports[_0x1e51('0x43')]=function(_0x4650e4,_0x1ef3d3){var _0x1a9e0d={'raw':!![],'where':{'id':_0x4650e4[_0x1e51('0x44')]['id']}},_0x25592c={};_0x25592c['model']=_[_0x1e51('0x30')](db[_0x1e51('0x3e')][_0x1e51('0x45')]);_0x25592c[_0x1e51('0x2f')]=_[_0x1e51('0x30')](_0x4650e4[_0x1e51('0x2f')]);_0x25592c[_0x1e51('0x31')]=_['intersection'](_0x25592c[_0x1e51('0x2c')],_0x25592c[_0x1e51('0x2f')]);_0x1a9e0d['attributes']=_[_0x1e51('0x33')](_0x25592c[_0x1e51('0x2c')],qs[_0x1e51('0x46')](_0x4650e4['query'][_0x1e51('0x46')]));_0x1a9e0d[_0x1e51('0x32')]=_0x1a9e0d[_0x1e51('0x32')][_0x1e51('0x34')]?_0x1a9e0d[_0x1e51('0x32')]:_0x25592c[_0x1e51('0x2c')];if(_0x4650e4[_0x1e51('0x2f')][_0x1e51('0x3f')]){_0x1a9e0d[_0x1e51('0x40')]=[{'all':!![]}];}_0x1a9e0d=_['merge']({},_0x1a9e0d,_0x4650e4[_0x1e51('0x47')]);return db[_0x1e51('0x3e')]['find'](_0x1a9e0d)[_0x1e51('0x23')](handleEntityNotFound(_0x1ef3d3,null))[_0x1e51('0x23')](respondWithResult(_0x1ef3d3,null))[_0x1e51('0x42')](handleError(_0x1ef3d3,null));};exports['create']=function(_0x44468a,_0x4634de){return db[_0x1e51('0x3e')]['create'](_0x44468a[_0x1e51('0x48')],{})['then'](function(_0x581f7a){var _0x54688b=_0x44468a[_0x1e51('0x49')][_0x1e51('0x24')]({'plain':!![]});if(!_0x54688b)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x54688b['role']===_0x1e51('0x49')){var _0x7ffc42=_0x581f7a[_0x1e51('0x24')]({'plain':!![]});var _0x233a5a=_0x1e51('0x25');return db[_0x1e51('0x4a')]['find']({'where':{'name':_0x233a5a,'userProfileId':_0x54688b[_0x1e51('0x4b')]},'raw':!![]})['then'](function(_0xf6bd35){if(_0xf6bd35&&_0xf6bd35[_0x1e51('0x4c')]===0x0){return db['UserProfileResource']['create']({'name':_0x7ffc42['name'],'resourceId':_0x7ffc42['id'],'type':_0xf6bd35[_0x1e51('0x2e')],'sectionId':_0xf6bd35['id']},{})[_0x1e51('0x23')](function(){return _0x581f7a;});}else{return _0x581f7a;}})[_0x1e51('0x42')](function(_0x4cdfe3){logger[_0x1e51('0x4d')](_0x1e51('0x4e'),_0x4cdfe3);throw _0x4cdfe3;});}return _0x581f7a;})[_0x1e51('0x23')](respondWithResult(_0x4634de,0xc9))[_0x1e51('0x42')](handleError(_0x4634de,null));};exports[_0x1e51('0x4f')]=function(_0x12584c,_0x32fe1f){if(_0x12584c[_0x1e51('0x48')]['id']){delete _0x12584c['body']['id'];}return db[_0x1e51('0x3e')][_0x1e51('0x50')]({'where':{'id':_0x12584c[_0x1e51('0x44')]['id']}})[_0x1e51('0x23')](handleEntityNotFound(_0x32fe1f,null))[_0x1e51('0x23')](saveUpdates(_0x12584c[_0x1e51('0x48')],null))['then'](respondWithResult(_0x32fe1f,null))[_0x1e51('0x42')](handleError(_0x32fe1f,null));};exports['destroy']=function(_0x56a276,_0x4807b9){return db[_0x1e51('0x3e')][_0x1e51('0x50')]({'where':{'id':_0x56a276[_0x1e51('0x44')]['id']}})['then'](handleEntityNotFound(_0x4807b9,null))[_0x1e51('0x23')](removeEntity(_0x4807b9,null))[_0x1e51('0x42')](handleError(_0x4807b9,null));};
\ No newline at end of file
+var _0x19e1=['../../config/utils','../../config/environment','sendStatus','status','end','json','offset','limit','set','Content-Range','apply','save','update','then','destroy','get','Metrics','UserProfileResource','error','name','send','index','map','AnalyticMetric','fieldName','type','key','model','filters','intersection','attributes','fields','query','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','options','count','includeAll','include','findAll','rows','catch','params','keys','find','body','user','create','html-pdf','eml-format','rimraf','zip-dir','moment','bluebird','util','path','to-csv','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x19e1,0x163));var _0x119e=function(_0x6cf19c,_0x2f3f02){_0x6cf19c=_0x6cf19c-0x0;var _0xce14f3=_0x19e1[_0x6cf19c];return _0xce14f3;};'use strict';var pdf=require(_0x119e('0x0'));var emlformat=require(_0x119e('0x1'));var rimraf=require(_0x119e('0x2'));var zipdir=require(_0x119e('0x3'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x119e('0x4'));var BPromise=require(_0x119e('0x5'));var Mustache=require('mustache');var util=require(_0x119e('0x6'));var path=require(_0x119e('0x7'));var sox=require('sox');var csv=require(_0x119e('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x119e('0x9'));var squel=require(_0x119e('0xa'));var crypto=require(_0x119e('0xb'));var jsforce=require(_0x119e('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x119e('0x8'));var querystring=require(_0x119e('0xd'));var Papa=require(_0x119e('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x119e('0xf'));var as=require(_0x119e('0x10'));var hardwareService=require(_0x119e('0x11'));var logger=require(_0x119e('0x12'))(_0x119e('0x13'));var utils=require(_0x119e('0x14'));var config=require(_0x119e('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x430fff,_0x62d949){_0x62d949=_0x62d949||0xcc;return function(_0x1b0482){if(_0x1b0482){return _0x430fff[_0x119e('0x16')](_0x62d949);}return _0x430fff[_0x119e('0x17')](_0x62d949)[_0x119e('0x18')]();};}function respondWithResult(_0x4cfe1f,_0x1d46eb){_0x1d46eb=_0x1d46eb||0xc8;return function(_0x8a9fad){if(_0x8a9fad){return _0x4cfe1f[_0x119e('0x17')](_0x1d46eb)[_0x119e('0x19')](_0x8a9fad);}};}function respondWithFilteredResult(_0x132332,_0x3bac54){return function(_0x285148){if(_0x285148){var _0x791000=_0x285148['count'],_0x2c5902=_0x3bac54[_0x119e('0x1a')],_0x42acfd=_0x3bac54[_0x119e('0x1a')]+_0x3bac54[_0x119e('0x1b')],_0x41f329;if(_0x42acfd>=_0x791000){_0x42acfd=_0x791000;_0x41f329=0xc8;}else{_0x41f329=0xce;}_0x132332[_0x119e('0x17')](_0x41f329);return _0x132332[_0x119e('0x1c')](_0x119e('0x1d'),_0x2c5902+'-'+_0x42acfd+'/'+_0x791000)[_0x119e('0x19')](_0x285148);}return null;};}function patchUpdates(_0x35d22c){return function(_0x40528a){try{jsonpatch[_0x119e('0x1e')](_0x40528a,_0x35d22c,!![]);}catch(_0x2bd27a){return BPromise['reject'](_0x2bd27a);}return _0x40528a[_0x119e('0x1f')]();};}function saveUpdates(_0x5ef280,_0xd4c2d5){return function(_0x523a8d){if(_0x523a8d){return _0x523a8d[_0x119e('0x20')](_0x5ef280)[_0x119e('0x21')](function(_0x5b7ba0){return _0x5b7ba0;});}return null;};}function removeEntity(_0x4d41f0,_0x1ee79b){return function(_0x29de19){if(_0x29de19){return _0x29de19[_0x119e('0x22')]()['then'](function(){var _0x54c485=_0x29de19[_0x119e('0x23')]({'plain':!![]});var _0x52d69b=_0x119e('0x24');return db[_0x119e('0x25')][_0x119e('0x22')]({'where':{'type':_0x52d69b,'resourceId':_0x54c485['id']}})['then'](function(){return _0x29de19;});})[_0x119e('0x21')](function(){_0x4d41f0['status'](0xcc)[_0x119e('0x18')]();});}};}function handleEntityNotFound(_0x5398e6,_0x5c57a2){return function(_0xdc170f){if(!_0xdc170f){_0x5398e6[_0x119e('0x16')](0x194);}return _0xdc170f;};}function handleError(_0x1a7dea,_0x2770ac){_0x2770ac=_0x2770ac||0x1f4;return function(_0x476f0){logger[_0x119e('0x26')](_0x476f0['stack']);if(_0x476f0[_0x119e('0x27')]){delete _0x476f0[_0x119e('0x27')];}_0x1a7dea['status'](_0x2770ac)[_0x119e('0x28')](_0x476f0);};}exports[_0x119e('0x29')]=function(_0x49b965,_0x18f2d4){var _0x513843={},_0x12d101={},_0x201f9b={'count':0x0,'rows':[]};var _0x4211fb=_[_0x119e('0x2a')](db[_0x119e('0x2b')]['rawAttributes'],function(_0x1853f9){return{'name':_0x1853f9[_0x119e('0x2c')],'type':_0x1853f9[_0x119e('0x2d')][_0x119e('0x2e')]};});_0x12d101[_0x119e('0x2f')]=_[_0x119e('0x2a')](_0x4211fb,'name');_0x12d101['query']=_['keys'](_0x49b965['query']);_0x12d101[_0x119e('0x30')]=_[_0x119e('0x31')](_0x12d101['model'],_0x12d101['query']);_0x513843[_0x119e('0x32')]=_[_0x119e('0x31')](_0x12d101['model'],qs[_0x119e('0x33')](_0x49b965[_0x119e('0x34')]['fields']));_0x513843[_0x119e('0x32')]=_0x513843[_0x119e('0x32')][_0x119e('0x35')]?_0x513843[_0x119e('0x32')]:_0x12d101[_0x119e('0x2f')];if(!_0x49b965[_0x119e('0x34')][_0x119e('0x36')](_0x119e('0x37'))){_0x513843[_0x119e('0x1b')]=qs[_0x119e('0x1b')](_0x49b965[_0x119e('0x34')][_0x119e('0x1b')]);_0x513843[_0x119e('0x1a')]=qs[_0x119e('0x1a')](_0x49b965[_0x119e('0x34')]['offset']);}_0x513843[_0x119e('0x38')]=qs[_0x119e('0x39')](_0x49b965[_0x119e('0x34')]['sort']);_0x513843[_0x119e('0x3a')]=qs[_0x119e('0x30')](_[_0x119e('0x3b')](_0x49b965[_0x119e('0x34')],_0x12d101[_0x119e('0x30')]),_0x4211fb);if(_0x49b965['query']['filter']){_0x513843[_0x119e('0x3a')]=_[_0x119e('0x3c')](_0x513843[_0x119e('0x3a')],{'$or':_[_0x119e('0x2a')](_0x4211fb,function(_0x119c2d){if(_0x119c2d[_0x119e('0x2d')]!==_0x119e('0x3d')){var _0x4ec4bc={};_0x4ec4bc[_0x119c2d['name']]={'$like':'%'+_0x49b965[_0x119e('0x34')]['filter']+'%'};return _0x4ec4bc;}})});}_0x513843=_['merge']({},_0x513843,_0x49b965[_0x119e('0x3e')]);var _0x5b8f0f={'where':_0x513843['where']};return db['AnalyticMetric'][_0x119e('0x3f')](_0x5b8f0f)[_0x119e('0x21')](function(_0x113cb0){_0x201f9b[_0x119e('0x3f')]=_0x113cb0;if(_0x49b965[_0x119e('0x34')][_0x119e('0x40')]){_0x513843[_0x119e('0x41')]=[{'all':!![]}];}return db[_0x119e('0x2b')][_0x119e('0x42')](_0x513843);})[_0x119e('0x21')](function(_0x3d25a8){_0x201f9b[_0x119e('0x43')]=_0x3d25a8;return _0x201f9b;})[_0x119e('0x21')](respondWithFilteredResult(_0x18f2d4,_0x513843))[_0x119e('0x44')](handleError(_0x18f2d4,null));};exports['show']=function(_0x442c05,_0x3fb1f0){var _0x3a55b3={'raw':!![],'where':{'id':_0x442c05[_0x119e('0x45')]['id']}},_0x31e6e6={};_0x31e6e6[_0x119e('0x2f')]=_['keys'](db[_0x119e('0x2b')]['rawAttributes']);_0x31e6e6[_0x119e('0x34')]=_[_0x119e('0x46')](_0x442c05[_0x119e('0x34')]);_0x31e6e6[_0x119e('0x30')]=_[_0x119e('0x31')](_0x31e6e6[_0x119e('0x2f')],_0x31e6e6[_0x119e('0x34')]);_0x3a55b3['attributes']=_['intersection'](_0x31e6e6[_0x119e('0x2f')],qs[_0x119e('0x33')](_0x442c05[_0x119e('0x34')][_0x119e('0x33')]));_0x3a55b3[_0x119e('0x32')]=_0x3a55b3[_0x119e('0x32')][_0x119e('0x35')]?_0x3a55b3[_0x119e('0x32')]:_0x31e6e6[_0x119e('0x2f')];if(_0x442c05[_0x119e('0x34')][_0x119e('0x40')]){_0x3a55b3[_0x119e('0x41')]=[{'all':!![]}];}_0x3a55b3=_[_0x119e('0x3c')]({},_0x3a55b3,_0x442c05[_0x119e('0x3e')]);return db['AnalyticMetric'][_0x119e('0x47')](_0x3a55b3)[_0x119e('0x21')](handleEntityNotFound(_0x3fb1f0,null))['then'](respondWithResult(_0x3fb1f0,null))[_0x119e('0x44')](handleError(_0x3fb1f0,null));};exports['create']=function(_0x460aa6,_0x103a7d){return db[_0x119e('0x2b')]['create'](_0x460aa6[_0x119e('0x48')],{})[_0x119e('0x21')](function(_0x50ea06){var _0x46d022=_0x460aa6[_0x119e('0x49')][_0x119e('0x23')]({'plain':!![]});if(!_0x46d022)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x46d022['role']==='user'){var _0x1f79cd=_0x50ea06[_0x119e('0x23')]({'plain':!![]});var _0x4ef35a=_0x119e('0x24');return db['UserProfileSection'][_0x119e('0x47')]({'where':{'name':_0x4ef35a,'userProfileId':_0x46d022['userProfileId']},'raw':!![]})[_0x119e('0x21')](function(_0x1980f9){if(_0x1980f9&&_0x1980f9['autoAssociation']===0x0){return db['UserProfileResource'][_0x119e('0x4a')]({'name':_0x1f79cd[_0x119e('0x27')],'resourceId':_0x1f79cd['id'],'type':_0x1980f9[_0x119e('0x27')],'sectionId':_0x1980f9['id']},{})[_0x119e('0x21')](function(){return _0x50ea06;});}else{return _0x50ea06;}})[_0x119e('0x44')](function(_0x2ced7f){logger[_0x119e('0x26')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2ced7f);throw _0x2ced7f;});}return _0x50ea06;})['then'](respondWithResult(_0x103a7d,0xc9))['catch'](handleError(_0x103a7d,null));};exports[_0x119e('0x20')]=function(_0x34d038,_0x488154){if(_0x34d038[_0x119e('0x48')]['id']){delete _0x34d038[_0x119e('0x48')]['id'];}return db[_0x119e('0x2b')][_0x119e('0x47')]({'where':{'id':_0x34d038['params']['id']}})[_0x119e('0x21')](handleEntityNotFound(_0x488154,null))['then'](saveUpdates(_0x34d038[_0x119e('0x48')],null))[_0x119e('0x21')](respondWithResult(_0x488154,null))[_0x119e('0x44')](handleError(_0x488154,null));};exports[_0x119e('0x22')]=function(_0x168898,_0x5da020){return db[_0x119e('0x2b')][_0x119e('0x47')]({'where':{'id':_0x168898[_0x119e('0x45')]['id']}})[_0x119e('0x21')](handleEntityNotFound(_0x5da020,null))[_0x119e('0x21')](removeEntity(_0x5da020,null))['catch'](handleError(_0x5da020,null));};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.model.js b/server/api/analyticMetric/analyticMetric.model.js
index abf10fd..d22536f 100644
--- a/server/api/analyticMetric/analyticMetric.model.js
+++ b/server/api/analyticMetric/analyticMetric.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xa338=['bluebird','request-promise','path','rimraf','../../config/environment','./analyticMetric.attributes','exports','AnalyticMetric','lodash','../../config/logger','moment'];(function(_0x1cd674,_0x8d3638){var _0x27928f=function(_0x5e3c70){while(--_0x5e3c70){_0x1cd674['push'](_0x1cd674['shift']());}};_0x27928f(++_0x8d3638);}(_0xa338,0x6b));var _0x8a33=function(_0x408d22,_0x53eef9){_0x408d22=_0x408d22-0x0;var _0x58effd=_0xa338[_0x408d22];return _0x58effd;};'use strict';var _=require(_0x8a33('0x0'));var util=require('util');var logger=require(_0x8a33('0x1'))('api');var moment=require(_0x8a33('0x2'));var BPromise=require(_0x8a33('0x3'));var rp=require(_0x8a33('0x4'));var fs=require('fs');var path=require(_0x8a33('0x5'));var rimraf=require(_0x8a33('0x6'));var config=require(_0x8a33('0x7'));var attributes=require(_0x8a33('0x8'));module[_0x8a33('0x9')]=function(_0x26d35c,_0x4ee99f){return _0x26d35c['define'](_0x8a33('0xa'),attributes,{'tableName':'analytics_metrics','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x0d2e=['define','AnalyticMetric','analytics_metrics','util','../../config/logger','moment','bluebird','request-promise','path','../../config/environment','./analyticMetric.attributes','exports'];(function(_0x17a647,_0x2bbe12){var _0x219a38=function(_0x131c5d){while(--_0x131c5d){_0x17a647['push'](_0x17a647['shift']());}};_0x219a38(++_0x2bbe12);}(_0x0d2e,0xf3));var _0xe0d2=function(_0x567bcb,_0x4978c1){_0x567bcb=_0x567bcb-0x0;var _0x4eebc2=_0x0d2e[_0x567bcb];return _0x4eebc2;};'use strict';var _=require('lodash');var util=require(_0xe0d2('0x0'));var logger=require(_0xe0d2('0x1'))('api');var moment=require(_0xe0d2('0x2'));var BPromise=require(_0xe0d2('0x3'));var rp=require(_0xe0d2('0x4'));var fs=require('fs');var path=require(_0xe0d2('0x5'));var rimraf=require('rimraf');var config=require(_0xe0d2('0x6'));var attributes=require(_0xe0d2('0x7'));module[_0xe0d2('0x8')]=function(_0x113181,_0x2098f2){return _0x113181[_0xe0d2('0x9')](_0xe0d2('0xa'),attributes,{'tableName':_0xe0d2('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.rpc.js b/server/api/analyticMetric/analyticMetric.rpc.js
index 978a550..8ea8ff0 100644
--- a/server/api/analyticMetric/analyticMetric.rpc.js
+++ b/server/api/analyticMetric/analyticMetric.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xeb80=['../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','AnalyticMetric,\x20%s,\x20%s','request\x20sent','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x4b5cbb,_0x49b507){var _0x2e5080=function(_0x241491){while(--_0x241491){_0x4b5cbb['push'](_0x4b5cbb['shift']());}};_0x2e5080(++_0x49b507);}(_0xeb80,0x126));var _0x0eb8=function(_0x5c853a,_0x5d5b93){_0x5c853a=_0x5c853a-0x0;var _0x2ddd5b=_0xeb80[_0x5c853a];return _0x2ddd5b;};'use strict';var _=require(_0x0eb8('0x0'));var util=require(_0x0eb8('0x1'));var moment=require(_0x0eb8('0x2'));var BPromise=require(_0x0eb8('0x3'));var rs=require(_0x0eb8('0x4'));var fs=require('fs');var Redis=require(_0x0eb8('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x0eb8('0x6'));var logger=require(_0x0eb8('0x7'))(_0x0eb8('0x8'));var config=require(_0x0eb8('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x0eb8('0xa')][_0x0eb8('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1b7e79,_0x21f792,_0x169cb5){return new BPromise(function(_0x202f76,_0x2579aa){return client[_0x0eb8('0xc')](_0x1b7e79,_0x169cb5)[_0x0eb8('0xd')](function(_0x513db0){logger['info'](_0x0eb8('0xe'),_0x21f792,_0x0eb8('0xf'));logger[_0x0eb8('0x10')](_0x0eb8('0x11'),_0x21f792,'request\x20sent',JSON[_0x0eb8('0x12')](_0x513db0));if(_0x513db0[_0x0eb8('0x13')]){if(_0x513db0[_0x0eb8('0x13')][_0x0eb8('0x14')]===0x1f4){logger[_0x0eb8('0x13')](_0x0eb8('0xe'),_0x21f792,_0x513db0[_0x0eb8('0x13')][_0x0eb8('0x15')]);return _0x2579aa(_0x513db0[_0x0eb8('0x13')][_0x0eb8('0x15')]);}logger[_0x0eb8('0x13')](_0x0eb8('0xe'),_0x21f792,_0x513db0[_0x0eb8('0x13')][_0x0eb8('0x15')]);return _0x202f76(_0x513db0['error'][_0x0eb8('0x15')]);}else{logger[_0x0eb8('0x16')]('AnalyticMetric,\x20%s,\x20%s',_0x21f792,'request\x20sent');_0x202f76(_0x513db0[_0x0eb8('0x17')][_0x0eb8('0x15')]);}})[_0x0eb8('0x18')](function(_0x38c196){logger[_0x0eb8('0x13')](_0x0eb8('0xe'),_0x21f792,_0x38c196);_0x2579aa(_0x38c196);});});}
\ No newline at end of file
+var _0x6cf1=['http','request','then','info','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','AnalyticMetric,\x20%s,\x20%s','message','result','catch','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client'];(function(_0x1b743a,_0x15376b){var _0x9b28fc=function(_0x12f409){while(--_0x12f409){_0x1b743a['push'](_0x1b743a['shift']());}};_0x9b28fc(++_0x15376b);}(_0x6cf1,0x1f1));var _0x16cf=function(_0x20a353,_0x544561){_0x20a353=_0x20a353-0x0;var _0x524940=_0x6cf1[_0x20a353];return _0x524940;};'use strict';var _=require(_0x16cf('0x0'));var util=require(_0x16cf('0x1'));var moment=require(_0x16cf('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x16cf('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x16cf('0x4'));var logger=require(_0x16cf('0x5'))(_0x16cf('0x6'));var config=require(_0x16cf('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x16cf('0x8')][_0x16cf('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x19c0c8,_0x9d4bb6,_0xbf0dfe){return new BPromise(function(_0x2238cb,_0x5e3f05){return client[_0x16cf('0xa')](_0x19c0c8,_0xbf0dfe)[_0x16cf('0xb')](function(_0x2adc1e){logger[_0x16cf('0xc')]('AnalyticMetric,\x20%s,\x20%s',_0x9d4bb6,'request\x20sent');logger[_0x16cf('0xd')](_0x16cf('0xe'),_0x9d4bb6,_0x16cf('0xf'),JSON[_0x16cf('0x10')](_0x2adc1e));if(_0x2adc1e['error']){if(_0x2adc1e[_0x16cf('0x11')]['code']===0x1f4){logger[_0x16cf('0x11')](_0x16cf('0x12'),_0x9d4bb6,_0x2adc1e[_0x16cf('0x11')][_0x16cf('0x13')]);return _0x5e3f05(_0x2adc1e['error'][_0x16cf('0x13')]);}logger[_0x16cf('0x11')](_0x16cf('0x12'),_0x9d4bb6,_0x2adc1e[_0x16cf('0x11')][_0x16cf('0x13')]);return _0x2238cb(_0x2adc1e[_0x16cf('0x11')][_0x16cf('0x13')]);}else{logger[_0x16cf('0xc')](_0x16cf('0x12'),_0x9d4bb6,_0x16cf('0xf'));_0x2238cb(_0x2adc1e[_0x16cf('0x14')][_0x16cf('0x13')]);}})[_0x16cf('0x15')](function(_0x5024e9){logger['error'](_0x16cf('0x12'),_0x9d4bb6,_0x5024e9);_0x5e3f05(_0x5024e9);});});}
\ No newline at end of file
diff --git a/server/api/analyticMetric/index.js b/server/api/analyticMetric/index.js
index 3b0796d..db82d9d 100644
--- a/server/api/analyticMetric/index.js
+++ b/server/api/analyticMetric/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x187d=['update','delete','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./analyticMetric.controller','get','index','/:id','isAuthenticated','show','post','create'];(function(_0x5de411,_0x11e44b){var _0xf88454=function(_0x16ca91){while(--_0x16ca91){_0x5de411['push'](_0x5de411['shift']());}};_0xf88454(++_0x11e44b);}(_0x187d,0x93));var _0xd187=function(_0x4baae2,_0x487ab6){_0x4baae2=_0x4baae2-0x0;var _0x1a2285=_0x187d[_0x4baae2];return _0x1a2285;};'use strict';var multer=require(_0xd187('0x0'));var util=require('util');var path=require(_0xd187('0x1'));var timeout=require(_0xd187('0x2'));var express=require(_0xd187('0x3'));var router=express[_0xd187('0x4')]();var auth=require(_0xd187('0x5'));var interaction=require(_0xd187('0x6'));var config=require('../../config/environment');var controller=require(_0xd187('0x7'));router[_0xd187('0x8')]('/',auth['isAuthenticated'](),controller[_0xd187('0x9')]);router[_0xd187('0x8')](_0xd187('0xa'),auth[_0xd187('0xb')](),controller[_0xd187('0xc')]);router[_0xd187('0xd')]('/',auth[_0xd187('0xb')](),controller[_0xd187('0xe')]);router['put'](_0xd187('0xa'),auth[_0xd187('0xb')](),controller[_0xd187('0xf')]);router[_0xd187('0x10')](_0xd187('0xa'),auth[_0xd187('0xb')](),controller['destroy']);module[_0xd187('0x11')]=router;
\ No newline at end of file
+var _0x187d=['update','delete','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./analyticMetric.controller','get','index','/:id','isAuthenticated','show','post','create'];(function(_0x3edf27,_0x542b96){var _0x24bbff=function(_0xef8d6){while(--_0xef8d6){_0x3edf27['push'](_0x3edf27['shift']());}};_0x24bbff(++_0x542b96);}(_0x187d,0x93));var _0xd187=function(_0x3a6efd,_0x2a5102){_0x3a6efd=_0x3a6efd-0x0;var _0x487b9a=_0x187d[_0x3a6efd];return _0x487b9a;};'use strict';var multer=require(_0xd187('0x0'));var util=require('util');var path=require(_0xd187('0x1'));var timeout=require(_0xd187('0x2'));var express=require(_0xd187('0x3'));var router=express[_0xd187('0x4')]();var auth=require(_0xd187('0x5'));var interaction=require(_0xd187('0x6'));var config=require('../../config/environment');var controller=require(_0xd187('0x7'));router[_0xd187('0x8')]('/',auth['isAuthenticated'](),controller[_0xd187('0x9')]);router[_0xd187('0x8')](_0xd187('0xa'),auth[_0xd187('0xb')](),controller[_0xd187('0xc')]);router[_0xd187('0xd')]('/',auth[_0xd187('0xb')](),controller[_0xd187('0xe')]);router['put'](_0xd187('0xa'),auth[_0xd187('0xb')](),controller[_0xd187('0xf')]);router[_0xd187('0x10')](_0xd187('0xa'),auth[_0xd187('0xb')](),controller['destroy']);module[_0xd187('0x11')]=router;
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.attributes.js b/server/api/analyticTreeReport/analyticTreeReport.attributes.js
index 077d0c3..b9898db 100644
--- a/server/api/analyticTreeReport/analyticTreeReport.attributes.js
+++ b/server/api/analyticTreeReport/analyticTreeReport.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xdc92=['sequelize','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xdc92,0x1f0));var _0x2dc9=function(_0x9db5d3,_0x4eea5e){_0x9db5d3=_0x9db5d3-0x0;var _0x477a81=_0xdc92[_0x9db5d3];return _0x477a81;};'use strict';var Sequelize=require(_0x2dc9('0x0'));module[_0x2dc9('0x1')]={'tree':{'type':Sequelize['TEXT'],'allowNull':![]}};
\ No newline at end of file
+var _0x5f66=['exports','sequelize'];(function(_0xcf7834,_0x24a774){var _0x25aca0=function(_0x4a1899){while(--_0x4a1899){_0xcf7834['push'](_0xcf7834['shift']());}};_0x25aca0(++_0x24a774);}(_0x5f66,0x16f));var _0x65f6=function(_0xefd519,_0xc62635){_0xefd519=_0xefd519-0x0;var _0x4bb882=_0x5f66[_0xefd519];return _0x4bb882;};'use strict';var Sequelize=require(_0x65f6('0x0'));module[_0x65f6('0x1')]={'tree':{'type':Sequelize['TEXT'],'allowNull':![]}};
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.controller.js b/server/api/analyticTreeReport/analyticTreeReport.controller.js
index cf15e82..c72a0e1 100644
--- a/server/api/analyticTreeReport/analyticTreeReport.controller.js
+++ b/server/api/analyticTreeReport/analyticTreeReport.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x32b5=['html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','limit','Content-Range','apply','reject','save','update','then','end','name','send','map','rawAttributes','fieldName','type','key','model','keys','query','intersection','fields','attributes','length','hasOwnProperty','offset','order','sort','where','filters','filter','merge','VIRTUAL','AnalyticTreeReport','count','includeAll','include','findAll','rows','show','params','options','find','create','catch','body','destroy'];(function(_0x273b54,_0x41c1ef){var _0x95905c=function(_0x3d3343){while(--_0x3d3343){_0x273b54['push'](_0x273b54['shift']());}};_0x95905c(++_0x41c1ef);}(_0x32b5,0x130));var _0x532b=function(_0x110c3d,_0x12ee06){_0x110c3d=_0x110c3d-0x0;var _0x226d67=_0x32b5[_0x110c3d];return _0x226d67;};'use strict';var pdf=require(_0x532b('0x0'));var emlformat=require(_0x532b('0x1'));var rimraf=require(_0x532b('0x2'));var zipdir=require(_0x532b('0x3'));var jsonpatch=require(_0x532b('0x4'));var rp=require(_0x532b('0x5'));var moment=require('moment');var BPromise=require(_0x532b('0x6'));var Mustache=require(_0x532b('0x7'));var util=require(_0x532b('0x8'));var path=require(_0x532b('0x9'));var sox=require(_0x532b('0xa'));var csv=require(_0x532b('0xb'));var ejs=require(_0x532b('0xc'));var fs=require('fs');var _=require(_0x532b('0xd'));var squel=require(_0x532b('0xe'));var crypto=require(_0x532b('0xf'));var jsforce=require(_0x532b('0x10'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x532b('0x11'));var Papa=require('papaparse');var Redis=require(_0x532b('0x12'));var authService=require(_0x532b('0x13'));var qs=require(_0x532b('0x14'));var as=require(_0x532b('0x15'));var hardwareService=require(_0x532b('0x16'));var logger=require(_0x532b('0x17'))(_0x532b('0x18'));var utils=require(_0x532b('0x19'));var config=require(_0x532b('0x1a'));var db=require(_0x532b('0x1b'))['db'];function respondWithStatusCode(_0x6a7545,_0x5489d8){_0x5489d8=_0x5489d8||0xcc;return function(_0x167706){if(_0x167706){return _0x6a7545[_0x532b('0x1c')](_0x5489d8);}return _0x6a7545[_0x532b('0x1d')](_0x5489d8)['end']();};}function respondWithResult(_0x1356ef,_0x4b7b4a){_0x4b7b4a=_0x4b7b4a||0xc8;return function(_0x16188e){if(_0x16188e){return _0x1356ef[_0x532b('0x1d')](_0x4b7b4a)[_0x532b('0x1e')](_0x16188e);}};}function respondWithFilteredResult(_0x20b254,_0x3cb477){return function(_0x4c68ca){if(_0x4c68ca){var _0xa2e195=_0x4c68ca['count'],_0x285a23=_0x3cb477['offset'],_0x42f776=_0x3cb477['offset']+_0x3cb477[_0x532b('0x1f')],_0x305dd6;if(_0x42f776>=_0xa2e195){_0x42f776=_0xa2e195;_0x305dd6=0xc8;}else{_0x305dd6=0xce;}_0x20b254[_0x532b('0x1d')](_0x305dd6);return _0x20b254['set'](_0x532b('0x20'),_0x285a23+'-'+_0x42f776+'/'+_0xa2e195)['json'](_0x4c68ca);}return null;};}function patchUpdates(_0x324068){return function(_0x275277){try{jsonpatch[_0x532b('0x21')](_0x275277,_0x324068,!![]);}catch(_0x3e8707){return BPromise[_0x532b('0x22')](_0x3e8707);}return _0x275277[_0x532b('0x23')]();};}function saveUpdates(_0x3aa9d4,_0x2c37c2){return function(_0x48a864){if(_0x48a864){return _0x48a864[_0x532b('0x24')](_0x3aa9d4)['then'](function(_0x209d17){return _0x209d17;});}return null;};}function removeEntity(_0xa873c5,_0x3f290c){return function(_0x3f49b1){if(_0x3f49b1){return _0x3f49b1['destroy']()[_0x532b('0x25')](function(){_0xa873c5[_0x532b('0x1d')](0xcc)[_0x532b('0x26')]();});}};}function handleEntityNotFound(_0x5edcf2,_0x4722b6){return function(_0x8957a){if(!_0x8957a){_0x5edcf2[_0x532b('0x1c')](0x194);}return _0x8957a;};}function handleError(_0x5882be,_0x25380c){_0x25380c=_0x25380c||0x1f4;return function(_0x154188){logger['error'](_0x154188['stack']);if(_0x154188[_0x532b('0x27')]){delete _0x154188[_0x532b('0x27')];}_0x5882be[_0x532b('0x1d')](_0x25380c)[_0x532b('0x28')](_0x154188);};}exports['index']=function(_0x1d2446,_0x54c8c0){var _0x4b4cd3={},_0x3f8bc6={},_0x2d8193={'count':0x0,'rows':[]};var _0x184d80=_[_0x532b('0x29')](db['AnalyticTreeReport'][_0x532b('0x2a')],function(_0x3cbffd){return{'name':_0x3cbffd[_0x532b('0x2b')],'type':_0x3cbffd[_0x532b('0x2c')][_0x532b('0x2d')]};});_0x3f8bc6[_0x532b('0x2e')]=_[_0x532b('0x29')](_0x184d80,_0x532b('0x27'));_0x3f8bc6['query']=_[_0x532b('0x2f')](_0x1d2446[_0x532b('0x30')]);_0x3f8bc6['filters']=_[_0x532b('0x31')](_0x3f8bc6[_0x532b('0x2e')],_0x3f8bc6[_0x532b('0x30')]);_0x4b4cd3['attributes']=_[_0x532b('0x31')](_0x3f8bc6[_0x532b('0x2e')],qs[_0x532b('0x32')](_0x1d2446[_0x532b('0x30')][_0x532b('0x32')]));_0x4b4cd3[_0x532b('0x33')]=_0x4b4cd3[_0x532b('0x33')][_0x532b('0x34')]?_0x4b4cd3[_0x532b('0x33')]:_0x3f8bc6['model'];if(!_0x1d2446[_0x532b('0x30')][_0x532b('0x35')]('nolimit')){_0x4b4cd3['limit']=qs['limit'](_0x1d2446['query'][_0x532b('0x1f')]);_0x4b4cd3[_0x532b('0x36')]=qs[_0x532b('0x36')](_0x1d2446[_0x532b('0x30')][_0x532b('0x36')]);}_0x4b4cd3[_0x532b('0x37')]=qs['sort'](_0x1d2446[_0x532b('0x30')][_0x532b('0x38')]);_0x4b4cd3[_0x532b('0x39')]=qs[_0x532b('0x3a')](_['pick'](_0x1d2446['query'],_0x3f8bc6[_0x532b('0x3a')]),_0x184d80);if(_0x1d2446[_0x532b('0x30')][_0x532b('0x3b')]){_0x4b4cd3[_0x532b('0x39')]=_[_0x532b('0x3c')](_0x4b4cd3['where'],{'$or':_[_0x532b('0x29')](_0x184d80,function(_0xb8c3d){if(_0xb8c3d['type']!==_0x532b('0x3d')){var _0x1049eb={};_0x1049eb[_0xb8c3d['name']]={'$like':'%'+_0x1d2446['query'][_0x532b('0x3b')]+'%'};return _0x1049eb;}})});}_0x4b4cd3=_['merge']({},_0x4b4cd3,_0x1d2446['options']);var _0x2c5d53={'where':_0x4b4cd3[_0x532b('0x39')]};return db[_0x532b('0x3e')][_0x532b('0x3f')](_0x2c5d53)[_0x532b('0x25')](function(_0x39b053){_0x2d8193[_0x532b('0x3f')]=_0x39b053;if(_0x1d2446[_0x532b('0x30')][_0x532b('0x40')]){_0x4b4cd3[_0x532b('0x41')]=[{'all':!![]}];}return db[_0x532b('0x3e')][_0x532b('0x42')](_0x4b4cd3);})[_0x532b('0x25')](function(_0x476a65){_0x2d8193[_0x532b('0x43')]=_0x476a65;return _0x2d8193;})[_0x532b('0x25')](respondWithFilteredResult(_0x54c8c0,_0x4b4cd3))['catch'](handleError(_0x54c8c0,null));};exports[_0x532b('0x44')]=function(_0x278ce2,_0x3ffbc6){var _0xd2c4a9={'raw':!![],'where':{'id':_0x278ce2[_0x532b('0x45')]['id']}},_0x5255c7={};_0x5255c7['model']=_[_0x532b('0x2f')](db[_0x532b('0x3e')][_0x532b('0x2a')]);_0x5255c7[_0x532b('0x30')]=_[_0x532b('0x2f')](_0x278ce2[_0x532b('0x30')]);_0x5255c7[_0x532b('0x3a')]=_[_0x532b('0x31')](_0x5255c7[_0x532b('0x2e')],_0x5255c7[_0x532b('0x30')]);_0xd2c4a9['attributes']=_[_0x532b('0x31')](_0x5255c7['model'],qs['fields'](_0x278ce2['query']['fields']));_0xd2c4a9['attributes']=_0xd2c4a9[_0x532b('0x33')][_0x532b('0x34')]?_0xd2c4a9['attributes']:_0x5255c7[_0x532b('0x2e')];if(_0x278ce2[_0x532b('0x30')][_0x532b('0x40')]){_0xd2c4a9[_0x532b('0x41')]=[{'all':!![]}];}_0xd2c4a9=_[_0x532b('0x3c')]({},_0xd2c4a9,_0x278ce2[_0x532b('0x46')]);return db[_0x532b('0x3e')][_0x532b('0x47')](_0xd2c4a9)[_0x532b('0x25')](handleEntityNotFound(_0x3ffbc6,null))[_0x532b('0x25')](respondWithResult(_0x3ffbc6,null))['catch'](handleError(_0x3ffbc6,null));};exports[_0x532b('0x48')]=function(_0x4dd254,_0x4cb9c2){return db['AnalyticTreeReport'][_0x532b('0x48')](_0x4dd254['body'],{})[_0x532b('0x25')](respondWithResult(_0x4cb9c2,0xc9))[_0x532b('0x49')](handleError(_0x4cb9c2,null));};exports[_0x532b('0x24')]=function(_0xa95b7a,_0x228b35){if(_0xa95b7a[_0x532b('0x4a')]['id']){delete _0xa95b7a[_0x532b('0x4a')]['id'];}return db[_0x532b('0x3e')][_0x532b('0x47')]({'where':{'id':_0xa95b7a[_0x532b('0x45')]['id']}})[_0x532b('0x25')](handleEntityNotFound(_0x228b35,null))[_0x532b('0x25')](saveUpdates(_0xa95b7a[_0x532b('0x4a')],null))[_0x532b('0x25')](respondWithResult(_0x228b35,null))[_0x532b('0x49')](handleError(_0x228b35,null));};exports[_0x532b('0x4b')]=function(_0x248998,_0x26159c){return db['AnalyticTreeReport']['find']({'where':{'id':_0x248998['params']['id']}})[_0x532b('0x25')](handleEntityNotFound(_0x26159c,null))[_0x532b('0x25')](removeEntity(_0x26159c,null))[_0x532b('0x49')](handleError(_0x26159c,null));};
\ No newline at end of file
+var _0x9308=['../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','reject','then','destroy','error','stack','name','AnalyticTreeReport','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','rows','catch','params','find','create','body','update','html-pdf','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','ioredis'];(function(_0xfa5b8a,_0x2381f7){var _0x2f351d=function(_0x4bb826){while(--_0x4bb826){_0xfa5b8a['push'](_0xfa5b8a['shift']());}};_0x2f351d(++_0x2381f7);}(_0x9308,0x7b));var _0x8930=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x9308[_0x2641f9];return _0x585741;};'use strict';var pdf=require(_0x8930('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x8930('0x1'));var zipdir=require(_0x8930('0x2'));var jsonpatch=require(_0x8930('0x3'));var rp=require('request-promise');var moment=require(_0x8930('0x4'));var BPromise=require(_0x8930('0x5'));var Mustache=require('mustache');var util=require(_0x8930('0x6'));var path=require(_0x8930('0x7'));var sox=require(_0x8930('0x8'));var csv=require(_0x8930('0x9'));var ejs=require(_0x8930('0xa'));var fs=require('fs');var _=require(_0x8930('0xb'));var squel=require('squel');var crypto=require(_0x8930('0xc'));var jsforce=require(_0x8930('0xd'));var deskjs=require(_0x8930('0xe'));var toCsv=require(_0x8930('0x9'));var querystring=require(_0x8930('0xf'));var Papa=require('papaparse');var Redis=require(_0x8930('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x8930('0x11'));var hardwareService=require(_0x8930('0x12'));var logger=require(_0x8930('0x13'))('api');var utils=require(_0x8930('0x14'));var config=require(_0x8930('0x15'));var db=require(_0x8930('0x16'))['db'];function respondWithStatusCode(_0x2983b0,_0x118885){_0x118885=_0x118885||0xcc;return function(_0x7d0c45){if(_0x7d0c45){return _0x2983b0[_0x8930('0x17')](_0x118885);}return _0x2983b0[_0x8930('0x18')](_0x118885)[_0x8930('0x19')]();};}function respondWithResult(_0x4c70a2,_0x4e52b8){_0x4e52b8=_0x4e52b8||0xc8;return function(_0x2205ed){if(_0x2205ed){return _0x4c70a2[_0x8930('0x18')](_0x4e52b8)[_0x8930('0x1a')](_0x2205ed);}};}function respondWithFilteredResult(_0x3863eb,_0x57e98a){return function(_0x11d954){if(_0x11d954){var _0x304df3=_0x11d954[_0x8930('0x1b')],_0x36fcb9=_0x57e98a[_0x8930('0x1c')],_0x58e788=_0x57e98a[_0x8930('0x1c')]+_0x57e98a[_0x8930('0x1d')],_0x2b6bd6;if(_0x58e788>=_0x304df3){_0x58e788=_0x304df3;_0x2b6bd6=0xc8;}else{_0x2b6bd6=0xce;}_0x3863eb[_0x8930('0x18')](_0x2b6bd6);return _0x3863eb[_0x8930('0x1e')](_0x8930('0x1f'),_0x36fcb9+'-'+_0x58e788+'/'+_0x304df3)[_0x8930('0x1a')](_0x11d954);}return null;};}function patchUpdates(_0x3d3565){return function(_0x1215a5){try{jsonpatch['apply'](_0x1215a5,_0x3d3565,!![]);}catch(_0x337d99){return BPromise[_0x8930('0x20')](_0x337d99);}return _0x1215a5['save']();};}function saveUpdates(_0x25fa84,_0x3ad32a){return function(_0x29baf5){if(_0x29baf5){return _0x29baf5['update'](_0x25fa84)[_0x8930('0x21')](function(_0x40edb4){return _0x40edb4;});}return null;};}function removeEntity(_0x2458fe,_0x288c36){return function(_0x4edc94){if(_0x4edc94){return _0x4edc94[_0x8930('0x22')]()[_0x8930('0x21')](function(){_0x2458fe[_0x8930('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x47e35d,_0x13de1e){return function(_0x1bbbc1){if(!_0x1bbbc1){_0x47e35d[_0x8930('0x17')](0x194);}return _0x1bbbc1;};}function handleError(_0x43f3a7,_0x4bdef9){_0x4bdef9=_0x4bdef9||0x1f4;return function(_0xc4c4cf){logger[_0x8930('0x23')](_0xc4c4cf[_0x8930('0x24')]);if(_0xc4c4cf[_0x8930('0x25')]){delete _0xc4c4cf['name'];}_0x43f3a7['status'](_0x4bdef9)['send'](_0xc4c4cf);};}exports['index']=function(_0x4d58de,_0x317ae8){var _0x2764b1={},_0x3b1900={},_0x1406f4={'count':0x0,'rows':[]};var _0x2efcfc=_['map'](db[_0x8930('0x26')][_0x8930('0x27')],function(_0x703540){return{'name':_0x703540[_0x8930('0x28')],'type':_0x703540[_0x8930('0x29')][_0x8930('0x2a')]};});_0x3b1900[_0x8930('0x2b')]=_['map'](_0x2efcfc,'name');_0x3b1900['query']=_[_0x8930('0x2c')](_0x4d58de[_0x8930('0x2d')]);_0x3b1900[_0x8930('0x2e')]=_['intersection'](_0x3b1900[_0x8930('0x2b')],_0x3b1900['query']);_0x2764b1['attributes']=_[_0x8930('0x2f')](_0x3b1900[_0x8930('0x2b')],qs[_0x8930('0x30')](_0x4d58de[_0x8930('0x2d')][_0x8930('0x30')]));_0x2764b1[_0x8930('0x31')]=_0x2764b1[_0x8930('0x31')][_0x8930('0x32')]?_0x2764b1['attributes']:_0x3b1900[_0x8930('0x2b')];if(!_0x4d58de[_0x8930('0x2d')][_0x8930('0x33')](_0x8930('0x34'))){_0x2764b1[_0x8930('0x1d')]=qs[_0x8930('0x1d')](_0x4d58de[_0x8930('0x2d')]['limit']);_0x2764b1[_0x8930('0x1c')]=qs['offset'](_0x4d58de[_0x8930('0x2d')][_0x8930('0x1c')]);}_0x2764b1[_0x8930('0x35')]=qs['sort'](_0x4d58de[_0x8930('0x2d')][_0x8930('0x36')]);_0x2764b1[_0x8930('0x37')]=qs[_0x8930('0x2e')](_[_0x8930('0x38')](_0x4d58de['query'],_0x3b1900['filters']),_0x2efcfc);if(_0x4d58de[_0x8930('0x2d')][_0x8930('0x39')]){_0x2764b1[_0x8930('0x37')]=_[_0x8930('0x3a')](_0x2764b1[_0x8930('0x37')],{'$or':_['map'](_0x2efcfc,function(_0x291575){if(_0x291575[_0x8930('0x29')]!==_0x8930('0x3b')){var _0xd80170={};_0xd80170[_0x291575[_0x8930('0x25')]]={'$like':'%'+_0x4d58de[_0x8930('0x2d')][_0x8930('0x39')]+'%'};return _0xd80170;}})});}_0x2764b1=_[_0x8930('0x3a')]({},_0x2764b1,_0x4d58de[_0x8930('0x3c')]);var _0x1716e6={'where':_0x2764b1['where']};return db[_0x8930('0x26')][_0x8930('0x1b')](_0x1716e6)[_0x8930('0x21')](function(_0x3d02de){_0x1406f4['count']=_0x3d02de;if(_0x4d58de['query']['includeAll']){_0x2764b1[_0x8930('0x3d')]=[{'all':!![]}];}return db[_0x8930('0x26')][_0x8930('0x3e')](_0x2764b1);})[_0x8930('0x21')](function(_0x3c279a){_0x1406f4[_0x8930('0x3f')]=_0x3c279a;return _0x1406f4;})[_0x8930('0x21')](respondWithFilteredResult(_0x317ae8,_0x2764b1))[_0x8930('0x40')](handleError(_0x317ae8,null));};exports['show']=function(_0x37e53e,_0x2021c9){var _0x245099={'raw':!![],'where':{'id':_0x37e53e[_0x8930('0x41')]['id']}},_0x24f6b9={};_0x24f6b9[_0x8930('0x2b')]=_[_0x8930('0x2c')](db['AnalyticTreeReport'][_0x8930('0x27')]);_0x24f6b9[_0x8930('0x2d')]=_[_0x8930('0x2c')](_0x37e53e[_0x8930('0x2d')]);_0x24f6b9[_0x8930('0x2e')]=_[_0x8930('0x2f')](_0x24f6b9['model'],_0x24f6b9['query']);_0x245099['attributes']=_[_0x8930('0x2f')](_0x24f6b9[_0x8930('0x2b')],qs[_0x8930('0x30')](_0x37e53e[_0x8930('0x2d')]['fields']));_0x245099[_0x8930('0x31')]=_0x245099['attributes'][_0x8930('0x32')]?_0x245099[_0x8930('0x31')]:_0x24f6b9[_0x8930('0x2b')];if(_0x37e53e[_0x8930('0x2d')]['includeAll']){_0x245099[_0x8930('0x3d')]=[{'all':!![]}];}_0x245099=_['merge']({},_0x245099,_0x37e53e[_0x8930('0x3c')]);return db[_0x8930('0x26')][_0x8930('0x42')](_0x245099)[_0x8930('0x21')](handleEntityNotFound(_0x2021c9,null))['then'](respondWithResult(_0x2021c9,null))[_0x8930('0x40')](handleError(_0x2021c9,null));};exports[_0x8930('0x43')]=function(_0x205a51,_0x43f811){return db['AnalyticTreeReport']['create'](_0x205a51[_0x8930('0x44')],{})[_0x8930('0x21')](respondWithResult(_0x43f811,0xc9))['catch'](handleError(_0x43f811,null));};exports[_0x8930('0x45')]=function(_0x2b24db,_0x4dc0e0){if(_0x2b24db[_0x8930('0x44')]['id']){delete _0x2b24db['body']['id'];}return db[_0x8930('0x26')][_0x8930('0x42')]({'where':{'id':_0x2b24db['params']['id']}})['then'](handleEntityNotFound(_0x4dc0e0,null))[_0x8930('0x21')](saveUpdates(_0x2b24db[_0x8930('0x44')],null))[_0x8930('0x21')](respondWithResult(_0x4dc0e0,null))[_0x8930('0x40')](handleError(_0x4dc0e0,null));};exports[_0x8930('0x22')]=function(_0x4c6b4f,_0x5114e6){return db[_0x8930('0x26')][_0x8930('0x42')]({'where':{'id':_0x4c6b4f['params']['id']}})[_0x8930('0x21')](handleEntityNotFound(_0x5114e6,null))[_0x8930('0x21')](removeEntity(_0x5114e6,null))[_0x8930('0x40')](handleError(_0x5114e6,null));};
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.model.js b/server/api/analyticTreeReport/analyticTreeReport.model.js
index e53b4b8..f17850d 100644
--- a/server/api/analyticTreeReport/analyticTreeReport.model.js
+++ b/server/api/analyticTreeReport/analyticTreeReport.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xc756=['lodash','api','moment','bluebird','request-promise','./analyticTreeReport.attributes','exports','define','AnalyticTreeReport','analytics_report_trees'];(function(_0x3c7d67,_0x146fb5){var _0x190570=function(_0x4bb172){while(--_0x4bb172){_0x3c7d67['push'](_0x3c7d67['shift']());}};_0x190570(++_0x146fb5);}(_0xc756,0x1cc));var _0x6c75=function(_0x2be021,_0x4db39e){_0x2be021=_0x2be021-0x0;var _0x18763e=_0xc756[_0x2be021];return _0x18763e;};'use strict';var _=require(_0x6c75('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x6c75('0x1'));var moment=require(_0x6c75('0x2'));var BPromise=require(_0x6c75('0x3'));var rp=require(_0x6c75('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x6c75('0x5'));module[_0x6c75('0x6')]=function(_0x51c885,_0x5c44de){return _0x51c885[_0x6c75('0x7')](_0x6c75('0x8'),attributes,{'tableName':_0x6c75('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x7aea=['AnalyticTreeReport','lodash','util','../../config/logger','moment','request-promise','path','../../config/environment'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x7aea,0xa9));var _0xa7ae=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7aea[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xa7ae('0x0'));var util=require(_0xa7ae('0x1'));var logger=require(_0xa7ae('0x2'))('api');var moment=require(_0xa7ae('0x3'));var BPromise=require('bluebird');var rp=require(_0xa7ae('0x4'));var fs=require('fs');var path=require(_0xa7ae('0x5'));var rimraf=require('rimraf');var config=require(_0xa7ae('0x6'));var attributes=require('./analyticTreeReport.attributes');module['exports']=function(_0x554f42,_0x9e911e){return _0x554f42['define'](_0xa7ae('0x7'),attributes,{'tableName':'analytics_report_trees','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.rpc.js b/server/api/analyticTreeReport/analyticTreeReport.rpc.js
index ed5e921..ecd553c 100644
--- a/server/api/analyticTreeReport/analyticTreeReport.rpc.js
+++ b/server/api/analyticTreeReport/analyticTreeReport.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xfa63=['../../mysqldb','../../config/logger','rpc','jayson/promise','client','then','info','request\x20sent','debug','AnalyticTreeReport,\x20%s,\x20%s,\x20%s','error','AnalyticTreeReport,\x20%s,\x20%s','message','util','moment','randomstring','ioredis'];(function(_0x43cc12,_0x4c9039){var _0x54c308=function(_0x53aeef){while(--_0x53aeef){_0x43cc12['push'](_0x43cc12['shift']());}};_0x54c308(++_0x4c9039);}(_0xfa63,0x1e9));var _0x3fa6=function(_0x1acc60,_0x356178){_0x1acc60=_0x1acc60-0x0;var _0x429ffc=_0xfa63[_0x1acc60];return _0x429ffc;};'use strict';var _=require('lodash');var util=require(_0x3fa6('0x0'));var moment=require(_0x3fa6('0x1'));var BPromise=require('bluebird');var rs=require(_0x3fa6('0x2'));var fs=require('fs');var Redis=require(_0x3fa6('0x3'));var db=require(_0x3fa6('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x3fa6('0x5'))(_0x3fa6('0x6'));var config=require('../../config/environment');var jayson=require(_0x3fa6('0x7'));var client=jayson[_0x3fa6('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3c1f0f,_0x446e04,_0x29b4ad){return new BPromise(function(_0x20d04e,_0x3b50ff){return client['request'](_0x3c1f0f,_0x29b4ad)[_0x3fa6('0x9')](function(_0x1bac19){logger[_0x3fa6('0xa')]('AnalyticTreeReport,\x20%s,\x20%s',_0x446e04,_0x3fa6('0xb'));logger[_0x3fa6('0xc')](_0x3fa6('0xd'),_0x446e04,'request\x20sent',JSON['stringify'](_0x1bac19));if(_0x1bac19['error']){if(_0x1bac19[_0x3fa6('0xe')]['code']===0x1f4){logger['error'](_0x3fa6('0xf'),_0x446e04,_0x1bac19[_0x3fa6('0xe')]['message']);return _0x3b50ff(_0x1bac19[_0x3fa6('0xe')][_0x3fa6('0x10')]);}logger[_0x3fa6('0xe')](_0x3fa6('0xf'),_0x446e04,_0x1bac19['error'][_0x3fa6('0x10')]);return _0x20d04e(_0x1bac19[_0x3fa6('0xe')][_0x3fa6('0x10')]);}else{logger[_0x3fa6('0xa')]('AnalyticTreeReport,\x20%s,\x20%s',_0x446e04,'request\x20sent');_0x20d04e(_0x1bac19['result'][_0x3fa6('0x10')]);}})['catch'](function(_0x104075){logger[_0x3fa6('0xe')]('AnalyticTreeReport,\x20%s,\x20%s',_0x446e04,_0x104075);_0x3b50ff(_0x104075);});});}
\ No newline at end of file
+var _0x5bc7=['debug','error','code','AnalyticTreeReport,\x20%s,\x20%s','message','result','catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','request\x20sent'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x5bc7,0x1ea));var _0x75bc=function(_0x146f03,_0xad2335){_0x146f03=_0x146f03-0x0;var _0x18a3c5=_0x5bc7[_0x146f03];return _0x18a3c5;};'use strict';var _=require(_0x75bc('0x0'));var util=require('util');var moment=require(_0x75bc('0x1'));var BPromise=require(_0x75bc('0x2'));var rs=require(_0x75bc('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x75bc('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x75bc('0x5'))(_0x75bc('0x6'));var config=require(_0x75bc('0x7'));var jayson=require(_0x75bc('0x8'));var client=jayson[_0x75bc('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x14ce46,_0x1152aa,_0x4c2a73){return new BPromise(function(_0x562f3f,_0x3a3941){return client[_0x75bc('0xa')](_0x14ce46,_0x4c2a73)[_0x75bc('0xb')](function(_0x303b6e){logger[_0x75bc('0xc')]('AnalyticTreeReport,\x20%s,\x20%s',_0x1152aa,_0x75bc('0xd'));logger[_0x75bc('0xe')]('AnalyticTreeReport,\x20%s,\x20%s,\x20%s',_0x1152aa,_0x75bc('0xd'),JSON['stringify'](_0x303b6e));if(_0x303b6e[_0x75bc('0xf')]){if(_0x303b6e[_0x75bc('0xf')][_0x75bc('0x10')]===0x1f4){logger['error'](_0x75bc('0x11'),_0x1152aa,_0x303b6e[_0x75bc('0xf')][_0x75bc('0x12')]);return _0x3a3941(_0x303b6e['error'][_0x75bc('0x12')]);}logger['error'](_0x75bc('0x11'),_0x1152aa,_0x303b6e[_0x75bc('0xf')][_0x75bc('0x12')]);return _0x562f3f(_0x303b6e[_0x75bc('0xf')]['message']);}else{logger[_0x75bc('0xc')](_0x75bc('0x11'),_0x1152aa,_0x75bc('0xd'));_0x562f3f(_0x303b6e[_0x75bc('0x13')][_0x75bc('0x12')]);}})[_0x75bc('0x14')](function(_0x1f22f2){logger[_0x75bc('0xf')](_0x75bc('0x11'),_0x1152aa,_0x1f22f2);_0x3a3941(_0x1f22f2);});});}
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/index.js b/server/api/analyticTreeReport/index.js
index 9c7563d..f9d58f3 100644
--- a/server/api/analyticTreeReport/index.js
+++ b/server/api/analyticTreeReport/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xbcc2=['/:id','isAuthenticated','show','post','create','put','update','exports','multer','path','connect-timeout','Router','../../components/interaction/service','../../config/environment','./analyticTreeReport.controller','get'];(function(_0x13f78a,_0x6b002f){var _0x48f494=function(_0x100b86){while(--_0x100b86){_0x13f78a['push'](_0x13f78a['shift']());}};_0x48f494(++_0x6b002f);}(_0xbcc2,0xd8));var _0x2bcc=function(_0x5c611c,_0x56a7f9){_0x5c611c=_0x5c611c-0x0;var _0x480866=_0xbcc2[_0x5c611c];return _0x480866;};'use strict';var multer=require(_0x2bcc('0x0'));var util=require('util');var path=require(_0x2bcc('0x1'));var timeout=require(_0x2bcc('0x2'));var express=require('express');var router=express[_0x2bcc('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x2bcc('0x4'));var config=require(_0x2bcc('0x5'));var controller=require(_0x2bcc('0x6'));router[_0x2bcc('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0x2bcc('0x7')](_0x2bcc('0x8'),auth[_0x2bcc('0x9')](),controller[_0x2bcc('0xa')]);router[_0x2bcc('0xb')]('/',auth[_0x2bcc('0x9')](),controller[_0x2bcc('0xc')]);router[_0x2bcc('0xd')](_0x2bcc('0x8'),auth['isAuthenticated'](),controller[_0x2bcc('0xe')]);router['delete']('/:id',auth[_0x2bcc('0x9')](),controller['destroy']);module[_0x2bcc('0xf')]=router;
\ No newline at end of file
+var _0xd824=['create','/:id','update','delete','multer','util','connect-timeout','Router','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','show','post'];(function(_0x59b2ea,_0x2aa714){var _0x39dc9d=function(_0x1c00f3){while(--_0x1c00f3){_0x59b2ea['push'](_0x59b2ea['shift']());}};_0x39dc9d(++_0x2aa714);}(_0xd824,0x1d5));var _0x4d82=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0xd824[_0xfae23b];return _0x200640;};'use strict';var multer=require(_0x4d82('0x0'));var util=require(_0x4d82('0x1'));var path=require('path');var timeout=require(_0x4d82('0x2'));var express=require('express');var router=express[_0x4d82('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x4d82('0x4'));var config=require(_0x4d82('0x5'));var controller=require('./analyticTreeReport.controller');router[_0x4d82('0x6')]('/',auth[_0x4d82('0x7')](),controller[_0x4d82('0x8')]);router[_0x4d82('0x6')]('/:id',auth[_0x4d82('0x7')](),controller[_0x4d82('0x9')]);router[_0x4d82('0xa')]('/',auth[_0x4d82('0x7')](),controller[_0x4d82('0xb')]);router['put'](_0x4d82('0xc'),auth[_0x4d82('0x7')](),controller[_0x4d82('0xd')]);router[_0x4d82('0xe')]('/:id',auth[_0x4d82('0x7')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/attachment/attachment.attributes.js b/server/api/attachment/attachment.attributes.js
index 1d489cd..c66ca17 100644
--- a/server/api/attachment/attachment.attributes.js
+++ b/server/api/attachment/attachment.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x0564=['STRING','sequelize'];(function(_0x4c70a1,_0x38d5a0){var _0x58091d=function(_0x14e002){while(--_0x14e002){_0x4c70a1['push'](_0x4c70a1['shift']());}};_0x58091d(++_0x38d5a0);}(_0x0564,0xaf));var _0x4056=function(_0x56816e,_0x313a1a){_0x56816e=_0x56816e-0x0;var _0x89b642=_0x0564[_0x56816e];return _0x89b642;};'use strict';var Sequelize=require(_0x4056('0x0'));module['exports']={'name':{'type':Sequelize[_0x4056('0x1')]},'basename':{'type':Sequelize[_0x4056('0x1')]},'type':{'type':Sequelize[_0x4056('0x1')]}};
\ No newline at end of file
+var _0x2cae=['STRING','sequelize','exports'];(function(_0x275caa,_0x166d5e){var _0x28d670=function(_0x2a20e1){while(--_0x2a20e1){_0x275caa['push'](_0x275caa['shift']());}};_0x28d670(++_0x166d5e);}(_0x2cae,0x1cc));var _0xe2ca=function(_0x3ff085,_0x27c92e){_0x3ff085=_0x3ff085-0x0;var _0x2b68c3=_0x2cae[_0x3ff085];return _0x2b68c3;};'use strict';var Sequelize=require(_0xe2ca('0x0'));module[_0xe2ca('0x1')]={'name':{'type':Sequelize[_0xe2ca('0x2')]},'basename':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xe2ca('0x2')]}};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.controller.js b/server/api/attachment/attachment.controller.js
index 793741a..1a6bc48 100644
--- a/server/api/attachment/attachment.controller.js
+++ b/server/api/attachment/attachment.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xa179=['keys','catch','clone','find','get','omit','createdAt','updatedAt','body','create','update','file','basename','filename','mimetype','download','findOne','join','root','server/files/attachments/','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','sox','ejs','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','count','offset','limit','set','json','apply','reject','save','destroy','error','stack','name','index','map','rawAttributes','fieldName','type','key','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','then','includeAll','include','Attachment','show','params'];(function(_0x202e6c,_0x56a6c9){var _0x160ed2=function(_0x36701f){while(--_0x36701f){_0x202e6c['push'](_0x202e6c['shift']());}};_0x160ed2(++_0x56a6c9);}(_0xa179,0x65));var _0x9a17=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa179[_0x3dd15e];return _0x231fd0;};'use strict';var pdf=require(_0x9a17('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x9a17('0x1'));var zipdir=require(_0x9a17('0x2'));var jsonpatch=require(_0x9a17('0x3'));var rp=require(_0x9a17('0x4'));var moment=require('moment');var BPromise=require(_0x9a17('0x5'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x9a17('0x6'));var csv=require('to-csv');var ejs=require(_0x9a17('0x7'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x9a17('0x8'));var querystring=require('querystring');var Papa=require(_0x9a17('0x9'));var Redis=require(_0x9a17('0xa'));var authService=require(_0x9a17('0xb'));var qs=require(_0x9a17('0xc'));var as=require(_0x9a17('0xd'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x9a17('0xe'))('api');var utils=require(_0x9a17('0xf'));var config=require(_0x9a17('0x10'));var db=require(_0x9a17('0x11'))['db'];function respondWithStatusCode(_0x49a255,_0x3a8595){_0x3a8595=_0x3a8595||0xcc;return function(_0x24be21){if(_0x24be21){return _0x49a255[_0x9a17('0x12')](_0x3a8595);}return _0x49a255[_0x9a17('0x13')](_0x3a8595)[_0x9a17('0x14')]();};}function respondWithResult(_0x4d32a5,_0x110cd3){_0x110cd3=_0x110cd3||0xc8;return function(_0x16ff44){if(_0x16ff44){return _0x4d32a5[_0x9a17('0x13')](_0x110cd3)['json'](_0x16ff44);}};}function respondWithFilteredResult(_0x31c146,_0x1bb5ed){return function(_0xcfcc09){if(_0xcfcc09){var _0x2e1e33=_0xcfcc09[_0x9a17('0x15')],_0x23629b=_0x1bb5ed[_0x9a17('0x16')],_0xd35341=_0x1bb5ed[_0x9a17('0x16')]+_0x1bb5ed[_0x9a17('0x17')],_0x52e413;if(_0xd35341>=_0x2e1e33){_0xd35341=_0x2e1e33;_0x52e413=0xc8;}else{_0x52e413=0xce;}_0x31c146[_0x9a17('0x13')](_0x52e413);return _0x31c146[_0x9a17('0x18')]('Content-Range',_0x23629b+'-'+_0xd35341+'/'+_0x2e1e33)[_0x9a17('0x19')](_0xcfcc09);}return null;};}function patchUpdates(_0x48125e){return function(_0x1b1298){try{jsonpatch[_0x9a17('0x1a')](_0x1b1298,_0x48125e,!![]);}catch(_0x2591db){return BPromise[_0x9a17('0x1b')](_0x2591db);}return _0x1b1298[_0x9a17('0x1c')]();};}function saveUpdates(_0x2f5d46,_0x2d719c){return function(_0x5602c0){if(_0x5602c0){return _0x5602c0['update'](_0x2f5d46)['then'](function(_0x2e6fe5){return _0x2e6fe5;});}return null;};}function removeEntity(_0x5befe5,_0x1b4e44){return function(_0x5b03b7){if(_0x5b03b7){return _0x5b03b7[_0x9a17('0x1d')]()['then'](function(){_0x5befe5[_0x9a17('0x13')](0xcc)['end']();});}};}function handleEntityNotFound(_0x37cbd0,_0x229f3e){return function(_0x4268d9){if(!_0x4268d9){_0x37cbd0[_0x9a17('0x12')](0x194);}return _0x4268d9;};}function handleError(_0xfd64a9,_0x568b4b){_0x568b4b=_0x568b4b||0x1f4;return function(_0x30c1fc){logger[_0x9a17('0x1e')](_0x30c1fc[_0x9a17('0x1f')]);if(_0x30c1fc[_0x9a17('0x20')]){delete _0x30c1fc[_0x9a17('0x20')];}_0xfd64a9[_0x9a17('0x13')](_0x568b4b)['send'](_0x30c1fc);};}exports[_0x9a17('0x21')]=function(_0x21e086,_0x5671a9){var _0x166302={},_0x1a2d2b={},_0x3051b5={'count':0x0,'rows':[]};var _0x681e0e=_[_0x9a17('0x22')](db['Attachment'][_0x9a17('0x23')],function(_0xc7799f){return{'name':_0xc7799f[_0x9a17('0x24')],'type':_0xc7799f[_0x9a17('0x25')][_0x9a17('0x26')]};});_0x1a2d2b['model']=_[_0x9a17('0x22')](_0x681e0e,_0x9a17('0x20'));_0x1a2d2b['query']=_['keys'](_0x21e086[_0x9a17('0x27')]);_0x1a2d2b[_0x9a17('0x28')]=_[_0x9a17('0x29')](_0x1a2d2b[_0x9a17('0x2a')],_0x1a2d2b['query']);_0x166302[_0x9a17('0x2b')]=_['intersection'](_0x1a2d2b[_0x9a17('0x2a')],qs['fields'](_0x21e086[_0x9a17('0x27')][_0x9a17('0x2c')]));_0x166302[_0x9a17('0x2b')]=_0x166302['attributes'][_0x9a17('0x2d')]?_0x166302[_0x9a17('0x2b')]:_0x1a2d2b[_0x9a17('0x2a')];if(!_0x21e086['query'][_0x9a17('0x2e')](_0x9a17('0x2f'))){_0x166302[_0x9a17('0x17')]=qs[_0x9a17('0x17')](_0x21e086['query'][_0x9a17('0x17')]);_0x166302[_0x9a17('0x16')]=qs['offset'](_0x21e086[_0x9a17('0x27')][_0x9a17('0x16')]);}_0x166302['order']=qs[_0x9a17('0x30')](_0x21e086['query']['sort']);_0x166302[_0x9a17('0x31')]=qs[_0x9a17('0x28')](_[_0x9a17('0x32')](_0x21e086[_0x9a17('0x27')],_0x1a2d2b[_0x9a17('0x28')]),_0x681e0e);if(_0x21e086['query'][_0x9a17('0x33')]){_0x166302[_0x9a17('0x31')]=_[_0x9a17('0x34')](_0x166302[_0x9a17('0x31')],{'$or':_[_0x9a17('0x22')](_0x681e0e,function(_0xbf3409){if(_0xbf3409['type']!==_0x9a17('0x35')){var _0x42c6e7={};_0x42c6e7[_0xbf3409[_0x9a17('0x20')]]={'$like':'%'+_0x21e086['query'][_0x9a17('0x33')]+'%'};return _0x42c6e7;}})});}_0x166302=_[_0x9a17('0x34')]({},_0x166302,_0x21e086[_0x9a17('0x36')]);var _0x254741={'where':_0x166302[_0x9a17('0x31')]};return db['Attachment'][_0x9a17('0x15')](_0x254741)[_0x9a17('0x37')](function(_0x8199c8){_0x3051b5['count']=_0x8199c8;if(_0x21e086['query'][_0x9a17('0x38')]){_0x166302[_0x9a17('0x39')]=[{'all':!![]}];}return db[_0x9a17('0x3a')]['findAll'](_0x166302);})[_0x9a17('0x37')](function(_0x30e369){_0x3051b5['rows']=_0x30e369;return _0x3051b5;})['then'](respondWithFilteredResult(_0x5671a9,_0x166302))['catch'](handleError(_0x5671a9,null));};exports[_0x9a17('0x3b')]=function(_0x34917c,_0x1a99bc){var _0x4f269e={'raw':!![],'where':{'id':_0x34917c[_0x9a17('0x3c')]['id']}},_0x2ba44c={};_0x2ba44c[_0x9a17('0x2a')]=_[_0x9a17('0x3d')](db['Attachment']['rawAttributes']);_0x2ba44c[_0x9a17('0x27')]=_[_0x9a17('0x3d')](_0x34917c[_0x9a17('0x27')]);_0x2ba44c[_0x9a17('0x28')]=_[_0x9a17('0x29')](_0x2ba44c[_0x9a17('0x2a')],_0x2ba44c[_0x9a17('0x27')]);_0x4f269e[_0x9a17('0x2b')]=_[_0x9a17('0x29')](_0x2ba44c[_0x9a17('0x2a')],qs['fields'](_0x34917c[_0x9a17('0x27')]['fields']));_0x4f269e[_0x9a17('0x2b')]=_0x4f269e['attributes'][_0x9a17('0x2d')]?_0x4f269e[_0x9a17('0x2b')]:_0x2ba44c['model'];if(_0x34917c[_0x9a17('0x27')]['includeAll']){_0x4f269e['include']=[{'all':!![]}];}_0x4f269e=_[_0x9a17('0x34')]({},_0x4f269e,_0x34917c[_0x9a17('0x36')]);return db[_0x9a17('0x3a')]['find'](_0x4f269e)[_0x9a17('0x37')](handleEntityNotFound(_0x1a99bc,null))[_0x9a17('0x37')](respondWithResult(_0x1a99bc,null))[_0x9a17('0x3e')](handleError(_0x1a99bc,null));};exports[_0x9a17('0x3f')]=function(_0x2f18bc,_0x4ff7cb){var _0x265709={'where':{'id':_0x2f18bc[_0x9a17('0x3c')]['id']}},_0x8b378c={};_0x8b378c[_0x9a17('0x2a')]=_['keys'](db[_0x9a17('0x3a')][_0x9a17('0x23')]);_0x265709['attributes']=_['intersection'](_0x8b378c[_0x9a17('0x2a')],qs['fields'](_0x2f18bc[_0x9a17('0x27')]['fields']));_0x265709[_0x9a17('0x2b')]=_0x265709[_0x9a17('0x2b')]['length']?_0x265709['attributes']:_0x8b378c[_0x9a17('0x2a')];if(_0x2f18bc[_0x9a17('0x27')][_0x9a17('0x38')]){_0x265709[_0x9a17('0x39')]=[{'all':!![]}];}_0x265709=_[_0x9a17('0x34')]({},_0x265709,_0x2f18bc[_0x9a17('0x36')]);return db[_0x9a17('0x3a')][_0x9a17('0x40')](_0x265709)[_0x9a17('0x37')](handleEntityNotFound(_0x4ff7cb,null))['then'](function(_0x245ee6){if(_0x245ee6){var _0x4f8e5f=_0x245ee6[_0x9a17('0x41')]({'plain':!![]});_0x4f8e5f=qs[_0x9a17('0x42')](_0x4f8e5f,['id',_0x9a17('0x43'),_0x9a17('0x44')]);_0x2f18bc[_0x9a17('0x45')]=_[_0x9a17('0x42')](_0x2f18bc[_0x9a17('0x45')],['id',_0x9a17('0x43'),_0x9a17('0x44')]);return db[_0x9a17('0x3a')][_0x9a17('0x46')](_[_0x9a17('0x34')](_0x4f8e5f,_0x2f18bc[_0x9a17('0x45')]),{'include':_0x2f18bc[_0x9a17('0x27')][_0x9a17('0x38')]?[{'all':!![]}]:undefined});}})['then'](respondWithResult(_0x4ff7cb,0xc9))[_0x9a17('0x3e')](handleError(_0x4ff7cb,null));};exports[_0x9a17('0x47')]=function(_0x5c740a,_0x4fe55e){if(_0x5c740a[_0x9a17('0x45')]['id']){delete _0x5c740a[_0x9a17('0x45')]['id'];}return db[_0x9a17('0x3a')]['find']({'where':{'id':_0x5c740a[_0x9a17('0x3c')]['id']}})[_0x9a17('0x37')](handleEntityNotFound(_0x4fe55e,null))[_0x9a17('0x37')](saveUpdates(_0x5c740a[_0x9a17('0x45')],null))[_0x9a17('0x37')](respondWithResult(_0x4fe55e,null))['catch'](handleError(_0x4fe55e,null));};exports[_0x9a17('0x1d')]=function(_0x51b7d3,_0x3c4e2f){return db[_0x9a17('0x3a')][_0x9a17('0x40')]({'where':{'id':_0x51b7d3[_0x9a17('0x3c')]['id']}})[_0x9a17('0x37')](handleEntityNotFound(_0x3c4e2f,null))[_0x9a17('0x37')](removeEntity(_0x3c4e2f,null))[_0x9a17('0x3e')](handleError(_0x3c4e2f,null));};exports[_0x9a17('0x46')]=function(_0x19ece1,_0xd4ed5b,_0x5d3df7){_0x19ece1[_0x9a17('0x45')][_0x9a17('0x20')]=_0x19ece1[_0x9a17('0x48')]['originalname'];_0x19ece1['body'][_0x9a17('0x49')]=_0x19ece1['file'][_0x9a17('0x4a')];_0x19ece1[_0x9a17('0x45')][_0x9a17('0x25')]=_0x19ece1[_0x9a17('0x48')][_0x9a17('0x4b')];return db['Attachment'][_0x9a17('0x46')](_0x19ece1['body'])['then'](respondWithResult(_0xd4ed5b,0xc9))[_0x9a17('0x3e')](handleError(_0xd4ed5b,null));};exports[_0x9a17('0x4c')]=function(_0x200c64,_0x1b1e74,_0x490d08){return db[_0x9a17('0x3a')][_0x9a17('0x4d')]({'where':{'id':_0x200c64[_0x9a17('0x3c')]['id']},'raw':!![]})['then'](handleEntityNotFound(_0x1b1e74,null))[_0x9a17('0x37')](function(_0xb0b1fe){if(_0xb0b1fe){return _0x1b1e74[_0x9a17('0x4c')](path[_0x9a17('0x4e')](config[_0x9a17('0x4f')],_0x9a17('0x50'),_0xb0b1fe[_0x9a17('0x49')]));}})['catch'](handleError(_0x1b1e74,null));};
\ No newline at end of file
+var _0xada2=['eml-format','zip-dir','fast-json-patch','moment','bluebird','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','sendStatus','status','json','count','offset','limit','Content-Range','apply','save','update','then','end','error','stack','name','send','index','map','Attachment','rawAttributes','key','model','query','keys','filters','attributes','intersection','fields','length','nolimit','sort','where','filter','merge','type','VIRTUAL','options','includeAll','include','rows','show','params','find','catch','clone','omit','createdAt','updatedAt','body','destroy','originalname','basename','file','mimetype','download','findOne','join','root','server/files/attachments/','html-pdf'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0xada2,0x13f));var _0x2ada=function(_0x4792eb,_0x1e1aca){_0x4792eb=_0x4792eb-0x0;var _0x25fb07=_0xada2[_0x4792eb];return _0x25fb07;};'use strict';var pdf=require(_0x2ada('0x0'));var emlformat=require(_0x2ada('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x2ada('0x2'));var jsonpatch=require(_0x2ada('0x3'));var rp=require('request-promise');var moment=require(_0x2ada('0x4'));var BPromise=require(_0x2ada('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x2ada('0x6'));var sox=require(_0x2ada('0x7'));var csv=require(_0x2ada('0x8'));var ejs=require(_0x2ada('0x9'));var fs=require('fs');var _=require('lodash');var squel=require(_0x2ada('0xa'));var crypto=require(_0x2ada('0xb'));var jsforce=require(_0x2ada('0xc'));var deskjs=require(_0x2ada('0xd'));var toCsv=require(_0x2ada('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x2ada('0xe'));var qs=require(_0x2ada('0xf'));var as=require(_0x2ada('0x10'));var hardwareService=require(_0x2ada('0x11'));var logger=require(_0x2ada('0x12'))('api');var utils=require(_0x2ada('0x13'));var config=require(_0x2ada('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4d9f93,_0x282d67){_0x282d67=_0x282d67||0xcc;return function(_0x3ee064){if(_0x3ee064){return _0x4d9f93[_0x2ada('0x15')](_0x282d67);}return _0x4d9f93[_0x2ada('0x16')](_0x282d67)['end']();};}function respondWithResult(_0x3e556d,_0x279206){_0x279206=_0x279206||0xc8;return function(_0xa0908f){if(_0xa0908f){return _0x3e556d[_0x2ada('0x16')](_0x279206)[_0x2ada('0x17')](_0xa0908f);}};}function respondWithFilteredResult(_0x17bfb0,_0x106500){return function(_0x186e0c){if(_0x186e0c){var _0x1ebbc1=_0x186e0c[_0x2ada('0x18')],_0x3b70d7=_0x106500['offset'],_0x406568=_0x106500[_0x2ada('0x19')]+_0x106500[_0x2ada('0x1a')],_0x3ae66c;if(_0x406568>=_0x1ebbc1){_0x406568=_0x1ebbc1;_0x3ae66c=0xc8;}else{_0x3ae66c=0xce;}_0x17bfb0[_0x2ada('0x16')](_0x3ae66c);return _0x17bfb0['set'](_0x2ada('0x1b'),_0x3b70d7+'-'+_0x406568+'/'+_0x1ebbc1)[_0x2ada('0x17')](_0x186e0c);}return null;};}function patchUpdates(_0x1f569f){return function(_0x34d00c){try{jsonpatch[_0x2ada('0x1c')](_0x34d00c,_0x1f569f,!![]);}catch(_0x4e8eae){return BPromise['reject'](_0x4e8eae);}return _0x34d00c[_0x2ada('0x1d')]();};}function saveUpdates(_0x5aa851,_0x1c35fc){return function(_0x9f0080){if(_0x9f0080){return _0x9f0080[_0x2ada('0x1e')](_0x5aa851)['then'](function(_0x28f26e){return _0x28f26e;});}return null;};}function removeEntity(_0x4c5363,_0x5b677f){return function(_0x32aff1){if(_0x32aff1){return _0x32aff1['destroy']()[_0x2ada('0x1f')](function(){_0x4c5363[_0x2ada('0x16')](0xcc)[_0x2ada('0x20')]();});}};}function handleEntityNotFound(_0xdd7a0f,_0x21b4f9){return function(_0x2ec436){if(!_0x2ec436){_0xdd7a0f[_0x2ada('0x15')](0x194);}return _0x2ec436;};}function handleError(_0xcaf70a,_0x78b8b){_0x78b8b=_0x78b8b||0x1f4;return function(_0xe37e32){logger[_0x2ada('0x21')](_0xe37e32[_0x2ada('0x22')]);if(_0xe37e32[_0x2ada('0x23')]){delete _0xe37e32[_0x2ada('0x23')];}_0xcaf70a['status'](_0x78b8b)[_0x2ada('0x24')](_0xe37e32);};}exports[_0x2ada('0x25')]=function(_0x516c03,_0x2f56c7){var _0x1c3b34={},_0x284ff5={},_0x268d0f={'count':0x0,'rows':[]};var _0x229ba9=_[_0x2ada('0x26')](db[_0x2ada('0x27')][_0x2ada('0x28')],function(_0x499eee){return{'name':_0x499eee['fieldName'],'type':_0x499eee['type'][_0x2ada('0x29')]};});_0x284ff5[_0x2ada('0x2a')]=_[_0x2ada('0x26')](_0x229ba9,_0x2ada('0x23'));_0x284ff5[_0x2ada('0x2b')]=_[_0x2ada('0x2c')](_0x516c03['query']);_0x284ff5[_0x2ada('0x2d')]=_['intersection'](_0x284ff5[_0x2ada('0x2a')],_0x284ff5[_0x2ada('0x2b')]);_0x1c3b34[_0x2ada('0x2e')]=_[_0x2ada('0x2f')](_0x284ff5[_0x2ada('0x2a')],qs['fields'](_0x516c03[_0x2ada('0x2b')][_0x2ada('0x30')]));_0x1c3b34[_0x2ada('0x2e')]=_0x1c3b34[_0x2ada('0x2e')][_0x2ada('0x31')]?_0x1c3b34['attributes']:_0x284ff5['model'];if(!_0x516c03[_0x2ada('0x2b')]['hasOwnProperty'](_0x2ada('0x32'))){_0x1c3b34['limit']=qs[_0x2ada('0x1a')](_0x516c03[_0x2ada('0x2b')][_0x2ada('0x1a')]);_0x1c3b34[_0x2ada('0x19')]=qs[_0x2ada('0x19')](_0x516c03[_0x2ada('0x2b')]['offset']);}_0x1c3b34['order']=qs[_0x2ada('0x33')](_0x516c03[_0x2ada('0x2b')][_0x2ada('0x33')]);_0x1c3b34[_0x2ada('0x34')]=qs[_0x2ada('0x2d')](_['pick'](_0x516c03[_0x2ada('0x2b')],_0x284ff5['filters']),_0x229ba9);if(_0x516c03[_0x2ada('0x2b')][_0x2ada('0x35')]){_0x1c3b34[_0x2ada('0x34')]=_[_0x2ada('0x36')](_0x1c3b34[_0x2ada('0x34')],{'$or':_['map'](_0x229ba9,function(_0x311ea8){if(_0x311ea8[_0x2ada('0x37')]!==_0x2ada('0x38')){var _0x1b9796={};_0x1b9796[_0x311ea8['name']]={'$like':'%'+_0x516c03[_0x2ada('0x2b')][_0x2ada('0x35')]+'%'};return _0x1b9796;}})});}_0x1c3b34=_[_0x2ada('0x36')]({},_0x1c3b34,_0x516c03[_0x2ada('0x39')]);var _0x9950c9={'where':_0x1c3b34[_0x2ada('0x34')]};return db[_0x2ada('0x27')][_0x2ada('0x18')](_0x9950c9)[_0x2ada('0x1f')](function(_0x3e4070){_0x268d0f[_0x2ada('0x18')]=_0x3e4070;if(_0x516c03[_0x2ada('0x2b')][_0x2ada('0x3a')]){_0x1c3b34[_0x2ada('0x3b')]=[{'all':!![]}];}return db[_0x2ada('0x27')]['findAll'](_0x1c3b34);})[_0x2ada('0x1f')](function(_0x16ce59){_0x268d0f[_0x2ada('0x3c')]=_0x16ce59;return _0x268d0f;})[_0x2ada('0x1f')](respondWithFilteredResult(_0x2f56c7,_0x1c3b34))['catch'](handleError(_0x2f56c7,null));};exports[_0x2ada('0x3d')]=function(_0x4bb66b,_0x553f0d){var _0xb81430={'raw':!![],'where':{'id':_0x4bb66b[_0x2ada('0x3e')]['id']}},_0x259554={};_0x259554['model']=_[_0x2ada('0x2c')](db[_0x2ada('0x27')][_0x2ada('0x28')]);_0x259554['query']=_[_0x2ada('0x2c')](_0x4bb66b[_0x2ada('0x2b')]);_0x259554[_0x2ada('0x2d')]=_['intersection'](_0x259554[_0x2ada('0x2a')],_0x259554[_0x2ada('0x2b')]);_0xb81430['attributes']=_[_0x2ada('0x2f')](_0x259554[_0x2ada('0x2a')],qs[_0x2ada('0x30')](_0x4bb66b[_0x2ada('0x2b')][_0x2ada('0x30')]));_0xb81430['attributes']=_0xb81430[_0x2ada('0x2e')][_0x2ada('0x31')]?_0xb81430[_0x2ada('0x2e')]:_0x259554[_0x2ada('0x2a')];if(_0x4bb66b[_0x2ada('0x2b')][_0x2ada('0x3a')]){_0xb81430[_0x2ada('0x3b')]=[{'all':!![]}];}_0xb81430=_[_0x2ada('0x36')]({},_0xb81430,_0x4bb66b[_0x2ada('0x39')]);return db['Attachment'][_0x2ada('0x3f')](_0xb81430)['then'](handleEntityNotFound(_0x553f0d,null))[_0x2ada('0x1f')](respondWithResult(_0x553f0d,null))[_0x2ada('0x40')](handleError(_0x553f0d,null));};exports[_0x2ada('0x41')]=function(_0x3753a7,_0x3693f2){var _0x4d077d={'where':{'id':_0x3753a7[_0x2ada('0x3e')]['id']}},_0x22c56e={};_0x22c56e[_0x2ada('0x2a')]=_[_0x2ada('0x2c')](db[_0x2ada('0x27')][_0x2ada('0x28')]);_0x4d077d[_0x2ada('0x2e')]=_[_0x2ada('0x2f')](_0x22c56e[_0x2ada('0x2a')],qs[_0x2ada('0x30')](_0x3753a7[_0x2ada('0x2b')][_0x2ada('0x30')]));_0x4d077d[_0x2ada('0x2e')]=_0x4d077d[_0x2ada('0x2e')][_0x2ada('0x31')]?_0x4d077d['attributes']:_0x22c56e['model'];if(_0x3753a7[_0x2ada('0x2b')][_0x2ada('0x3a')]){_0x4d077d['include']=[{'all':!![]}];}_0x4d077d=_[_0x2ada('0x36')]({},_0x4d077d,_0x3753a7[_0x2ada('0x39')]);return db[_0x2ada('0x27')]['find'](_0x4d077d)[_0x2ada('0x1f')](handleEntityNotFound(_0x3693f2,null))['then'](function(_0x1024cb){if(_0x1024cb){var _0x5a7d14=_0x1024cb['get']({'plain':!![]});_0x5a7d14=qs[_0x2ada('0x42')](_0x5a7d14,['id',_0x2ada('0x43'),_0x2ada('0x44')]);_0x3753a7[_0x2ada('0x45')]=_[_0x2ada('0x42')](_0x3753a7[_0x2ada('0x45')],['id',_0x2ada('0x43'),_0x2ada('0x44')]);return db[_0x2ada('0x27')]['create'](_[_0x2ada('0x36')](_0x5a7d14,_0x3753a7[_0x2ada('0x45')]),{'include':_0x3753a7[_0x2ada('0x2b')]['includeAll']?[{'all':!![]}]:undefined});}})[_0x2ada('0x1f')](respondWithResult(_0x3693f2,0xc9))['catch'](handleError(_0x3693f2,null));};exports[_0x2ada('0x1e')]=function(_0x56b536,_0x5e0cfc){if(_0x56b536['body']['id']){delete _0x56b536[_0x2ada('0x45')]['id'];}return db[_0x2ada('0x27')][_0x2ada('0x3f')]({'where':{'id':_0x56b536[_0x2ada('0x3e')]['id']}})[_0x2ada('0x1f')](handleEntityNotFound(_0x5e0cfc,null))[_0x2ada('0x1f')](saveUpdates(_0x56b536[_0x2ada('0x45')],null))['then'](respondWithResult(_0x5e0cfc,null))[_0x2ada('0x40')](handleError(_0x5e0cfc,null));};exports[_0x2ada('0x46')]=function(_0x4e8655,_0x1c7469){return db[_0x2ada('0x27')][_0x2ada('0x3f')]({'where':{'id':_0x4e8655['params']['id']}})[_0x2ada('0x1f')](handleEntityNotFound(_0x1c7469,null))[_0x2ada('0x1f')](removeEntity(_0x1c7469,null))[_0x2ada('0x40')](handleError(_0x1c7469,null));};exports['create']=function(_0x4d8bbf,_0x8465e7,_0x4ce802){_0x4d8bbf[_0x2ada('0x45')][_0x2ada('0x23')]=_0x4d8bbf['file'][_0x2ada('0x47')];_0x4d8bbf['body'][_0x2ada('0x48')]=_0x4d8bbf[_0x2ada('0x49')]['filename'];_0x4d8bbf[_0x2ada('0x45')][_0x2ada('0x37')]=_0x4d8bbf[_0x2ada('0x49')][_0x2ada('0x4a')];return db[_0x2ada('0x27')]['create'](_0x4d8bbf[_0x2ada('0x45')])[_0x2ada('0x1f')](respondWithResult(_0x8465e7,0xc9))[_0x2ada('0x40')](handleError(_0x8465e7,null));};exports[_0x2ada('0x4b')]=function(_0x1912c9,_0x1740a2,_0x1234f1){return db[_0x2ada('0x27')][_0x2ada('0x4c')]({'where':{'id':_0x1912c9[_0x2ada('0x3e')]['id']},'raw':!![]})[_0x2ada('0x1f')](handleEntityNotFound(_0x1740a2,null))[_0x2ada('0x1f')](function(_0x536c48){if(_0x536c48){return _0x1740a2[_0x2ada('0x4b')](path[_0x2ada('0x4d')](config[_0x2ada('0x4e')],_0x2ada('0x4f'),_0x536c48[_0x2ada('0x48')]));}})[_0x2ada('0x40')](handleError(_0x1740a2,null));};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.model.js b/server/api/attachment/attachment.model.js
index 65c25e8..34c11e1 100644
--- a/server/api/attachment/attachment.model.js
+++ b/server/api/attachment/attachment.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9a19=['lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./attachment.attributes','exports','define'];(function(_0x178e48,_0x3c9509){var _0x440d7e=function(_0xc2f8a0){while(--_0xc2f8a0){_0x178e48['push'](_0x178e48['shift']());}};_0x440d7e(++_0x3c9509);}(_0x9a19,0x114));var _0x99a1=function(_0x377a6e,_0x59b99d){_0x377a6e=_0x377a6e-0x0;var _0x37f751=_0x9a19[_0x377a6e];return _0x37f751;};'use strict';var _=require(_0x99a1('0x0'));var util=require(_0x99a1('0x1'));var logger=require(_0x99a1('0x2'))('api');var moment=require(_0x99a1('0x3'));var BPromise=require(_0x99a1('0x4'));var rp=require(_0x99a1('0x5'));var fs=require('fs');var path=require(_0x99a1('0x6'));var rimraf=require(_0x99a1('0x7'));var config=require(_0x99a1('0x8'));var attributes=require(_0x99a1('0x9'));module[_0x99a1('0xa')]=function(_0x3eff4a,_0xff0240){return _0x3eff4a[_0x99a1('0xb')]('Attachment',attributes,{'tableName':'attachments','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xcb91=['rimraf','./attachment.attributes','exports','define','attachments','../../config/logger','api','moment','bluebird','path'];(function(_0x28e30b,_0x539e98){var _0x1a3730=function(_0x183804){while(--_0x183804){_0x28e30b['push'](_0x28e30b['shift']());}};_0x1a3730(++_0x539e98);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x44fef1,_0x132cf4){_0x44fef1=_0x44fef1-0x0;var _0x3c3a04=_0xcb91[_0x44fef1];return _0x3c3a04;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x1cb9('0x0'))(_0x1cb9('0x1'));var moment=require(_0x1cb9('0x2'));var BPromise=require(_0x1cb9('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1cb9('0x4'));var rimraf=require(_0x1cb9('0x5'));var config=require('../../config/environment');var attributes=require(_0x1cb9('0x6'));module[_0x1cb9('0x7')]=function(_0x53ffbd,_0x226b69){return _0x53ffbd[_0x1cb9('0x8')]('Attachment',attributes,{'tableName':_0x1cb9('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.rpc.js b/server/api/attachment/attachment.rpc.js
index 58240fd..272a74f 100644
--- a/server/api/attachment/attachment.rpc.js
+++ b/server/api/attachment/attachment.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9579=['bluebird','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','then','info','Attachment,\x20%s,\x20%s','debug','Attachment,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','CreateAttachment','body','options','moment'];(function(_0x407dc2,_0xec385c){var _0x14c9e3=function(_0x1ce5e3){while(--_0x1ce5e3){_0x407dc2['push'](_0x407dc2['shift']());}};_0x14c9e3(++_0xec385c);}(_0x9579,0x110));var _0x9957=function(_0x421e36,_0x18776e){_0x421e36=_0x421e36-0x0;var _0x20b3e3=_0x9579[_0x421e36];return _0x20b3e3;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x9957('0x0'));var BPromise=require(_0x9957('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x9957('0x2'));var logger=require(_0x9957('0x3'))('rpc');var config=require(_0x9957('0x4'));var jayson=require(_0x9957('0x5'));var client=jayson['client'][_0x9957('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x4ff89b,_0x43e30f,_0x3ce64a){return new BPromise(function(_0xdba79,_0x4f12bb){return client['request'](_0x4ff89b,_0x3ce64a)[_0x9957('0x7')](function(_0x23047c){logger[_0x9957('0x8')](_0x9957('0x9'),_0x43e30f,'request\x20sent');logger[_0x9957('0xa')](_0x9957('0xb'),_0x43e30f,_0x9957('0xc'),JSON[_0x9957('0xd')](_0x23047c));if(_0x23047c['error']){if(_0x23047c[_0x9957('0xe')][_0x9957('0xf')]===0x1f4){logger[_0x9957('0xe')](_0x9957('0x9'),_0x43e30f,_0x23047c['error'][_0x9957('0x10')]);return _0x4f12bb(_0x23047c['error']['message']);}logger[_0x9957('0xe')](_0x9957('0x9'),_0x43e30f,_0x23047c['error'][_0x9957('0x10')]);return _0xdba79(_0x23047c[_0x9957('0xe')][_0x9957('0x10')]);}else{logger[_0x9957('0x8')](_0x9957('0x9'),_0x43e30f,_0x9957('0xc'));_0xdba79(_0x23047c['result'][_0x9957('0x10')]);}})[_0x9957('0x11')](function(_0xbc97dc){logger[_0x9957('0xe')](_0x9957('0x9'),_0x43e30f,_0xbc97dc);_0x4f12bb(_0xbc97dc);});});}exports[_0x9957('0x12')]=function(_0x2de3a1){var _0x24a88c=this;return new Promise(function(_0x41681f,_0x320626){return db['Attachment']['create'](_0x2de3a1[_0x9957('0x13')],{'raw':_0x2de3a1[_0x9957('0x14')]?_0x2de3a1['options']['raw']===undefined?!![]:![]:!![]})[_0x9957('0x7')](function(_0x497b94){logger[_0x9957('0x8')](_0x9957('0x12'),_0x2de3a1);logger[_0x9957('0xa')]('CreateAttachment',_0x2de3a1,JSON[_0x9957('0xd')](_0x497b94));_0x41681f(_0x497b94);})[_0x9957('0x11')](function(_0x5bd879){logger['error'](_0x9957('0x12'),_0x5bd879[_0x9957('0x10')],_0x2de3a1);_0x320626(_0x24a88c[_0x9957('0xe')](0x1f4,_0x5bd879[_0x9957('0x10')]));});});};
\ No newline at end of file
+var _0xb910=['lodash','util','moment','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','debug','Attachment,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','Attachment,\x20%s,\x20%s','message','result','CreateAttachment','create','options','raw','catch'];(function(_0x1b4c8a,_0x178ad7){var _0x49802e=function(_0x5b721a){while(--_0x5b721a){_0x1b4c8a['push'](_0x1b4c8a['shift']());}};_0x49802e(++_0x178ad7);}(_0xb910,0xb6));var _0x0b91=function(_0x243b59,_0x3f9495){_0x243b59=_0x243b59-0x0;var _0x3e1676=_0xb910[_0x243b59];return _0x3e1676;};'use strict';var _=require(_0x0b91('0x0'));var util=require(_0x0b91('0x1'));var moment=require(_0x0b91('0x2'));var BPromise=require('bluebird');var rs=require(_0x0b91('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0b91('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x0b91('0x5'))(_0x0b91('0x6'));var config=require(_0x0b91('0x7'));var jayson=require(_0x0b91('0x8'));var client=jayson[_0x0b91('0x9')][_0x0b91('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x28d08f,_0x4b75cb,_0x132043){return new BPromise(function(_0x47f5bf,_0x21aeb1){return client['request'](_0x28d08f,_0x132043)[_0x0b91('0xb')](function(_0xcf1691){logger[_0x0b91('0xc')]('Attachment,\x20%s,\x20%s',_0x4b75cb,'request\x20sent');logger[_0x0b91('0xd')](_0x0b91('0xe'),_0x4b75cb,_0x0b91('0xf'),JSON[_0x0b91('0x10')](_0xcf1691));if(_0xcf1691['error']){if(_0xcf1691[_0x0b91('0x11')]['code']===0x1f4){logger['error'](_0x0b91('0x12'),_0x4b75cb,_0xcf1691[_0x0b91('0x11')][_0x0b91('0x13')]);return _0x21aeb1(_0xcf1691['error'][_0x0b91('0x13')]);}logger[_0x0b91('0x11')]('Attachment,\x20%s,\x20%s',_0x4b75cb,_0xcf1691[_0x0b91('0x11')][_0x0b91('0x13')]);return _0x47f5bf(_0xcf1691['error']['message']);}else{logger['info'](_0x0b91('0x12'),_0x4b75cb,_0x0b91('0xf'));_0x47f5bf(_0xcf1691[_0x0b91('0x14')]['message']);}})['catch'](function(_0x1f1ba6){logger['error'](_0x0b91('0x12'),_0x4b75cb,_0x1f1ba6);_0x21aeb1(_0x1f1ba6);});});}exports[_0x0b91('0x15')]=function(_0x51b10a){var _0x35389b=this;return new Promise(function(_0x13649c,_0x2664bb){return db['Attachment'][_0x0b91('0x16')](_0x51b10a['body'],{'raw':_0x51b10a[_0x0b91('0x17')]?_0x51b10a[_0x0b91('0x17')][_0x0b91('0x18')]===undefined?!![]:![]:!![]})[_0x0b91('0xb')](function(_0x7f6f23){logger[_0x0b91('0xc')](_0x0b91('0x15'),_0x51b10a);logger[_0x0b91('0xd')](_0x0b91('0x15'),_0x51b10a,JSON[_0x0b91('0x10')](_0x7f6f23));_0x13649c(_0x7f6f23);})[_0x0b91('0x19')](function(_0x3aac98){logger[_0x0b91('0x11')](_0x0b91('0x15'),_0x3aac98[_0x0b91('0x13')],_0x51b10a);_0x2664bb(_0x35389b[_0x0b91('0x11')](0x1f4,_0x3aac98[_0x0b91('0x13')]));});});};
\ No newline at end of file
diff --git a/server/api/attachment/index.js b/server/api/attachment/index.js
index 3a02f6f..5b0dbfd 100644
--- a/server/api/attachment/index.js
+++ b/server/api/attachment/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xb749=['isAuthenticated','index','/:id','show','/:id/download','download','/:id/clone','diskStorage','join','root','server/files/attachments/','format','%s-%s','now','originalname','post','single','file','create','put','delete','destroy','multer','path','connect-timeout','Router','../../components/interaction/service','../../config/environment','./attachment.controller','get'];(function(_0x5b64a1,_0x2ec810){var _0x4b6f55=function(_0x44dd84){while(--_0x44dd84){_0x5b64a1['push'](_0x5b64a1['shift']());}};_0x4b6f55(++_0x2ec810);}(_0xb749,0xac));var _0x9b74=function(_0xfc84ed,_0x32ee8a){_0xfc84ed=_0xfc84ed-0x0;var _0xb5fba1=_0xb749[_0xfc84ed];return _0xb5fba1;};'use strict';var multer=require(_0x9b74('0x0'));var util=require('util');var path=require(_0x9b74('0x1'));var timeout=require(_0x9b74('0x2'));var express=require('express');var router=express[_0x9b74('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x9b74('0x4'));var config=require(_0x9b74('0x5'));var controller=require(_0x9b74('0x6'));router[_0x9b74('0x7')]('/',auth[_0x9b74('0x8')](),controller[_0x9b74('0x9')]);router['get'](_0x9b74('0xa'),auth['isAuthenticated'](),controller[_0x9b74('0xb')]);router[_0x9b74('0x7')](_0x9b74('0xc'),auth[_0x9b74('0x8')](),controller[_0x9b74('0xd')]);router['post'](_0x9b74('0xe'),auth[_0x9b74('0x8')](),controller['clone']);var upload=multer({'storage':multer[_0x9b74('0xf')]({'destination':function(_0xfc8a79,_0x2d72a9,_0x5dd91a){_0x5dd91a(null,path[_0x9b74('0x10')](config[_0x9b74('0x11')],_0x9b74('0x12')));},'filename':function(_0x319fd1,_0x55491e,_0x4ef4c0){_0x4ef4c0(null,util[_0x9b74('0x13')](_0x9b74('0x14'),Date[_0x9b74('0x15')](),_0x55491e[_0x9b74('0x16')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x9b74('0x17')]('/',upload[_0x9b74('0x18')](_0x9b74('0x19')),controller[_0x9b74('0x1a')]);router[_0x9b74('0x1b')](_0x9b74('0xa'),auth['isAuthenticated'](),controller['update']);router[_0x9b74('0x1c')](_0x9b74('0xa'),auth[_0x9b74('0x8')](),controller[_0x9b74('0x1d')]);module['exports']=router;
\ No newline at end of file
+var _0x887b=['format','%s-%s','now','originalname','post','single','file','create','put','update','delete','destroy','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','/:id','isAuthenticated','/:id/download','clone','join','root','server/files/attachments/'];(function(_0x3f5dc8,_0x277a72){var _0x29fb58=function(_0x410ec1){while(--_0x410ec1){_0x3f5dc8['push'](_0x3f5dc8['shift']());}};_0x29fb58(++_0x277a72);}(_0x887b,0x185));var _0xb887=function(_0x41cf86,_0x22540d){_0x41cf86=_0x41cf86-0x0;var _0x28544c=_0x887b[_0x41cf86];return _0x28544c;};'use strict';var multer=require(_0xb887('0x0'));var util=require(_0xb887('0x1'));var path=require(_0xb887('0x2'));var timeout=require(_0xb887('0x3'));var express=require(_0xb887('0x4'));var router=express[_0xb887('0x5')]();var auth=require(_0xb887('0x6'));var interaction=require(_0xb887('0x7'));var config=require(_0xb887('0x8'));var controller=require('./attachment.controller');router[_0xb887('0x9')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0xb887('0xa'),auth[_0xb887('0xb')](),controller['show']);router['get'](_0xb887('0xc'),auth[_0xb887('0xb')](),controller['download']);router['post']('/:id/clone',auth[_0xb887('0xb')](),controller[_0xb887('0xd')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x2ec74a,_0x4dbf12,_0x46fe4e){_0x46fe4e(null,path[_0xb887('0xe')](config[_0xb887('0xf')],_0xb887('0x10')));},'filename':function(_0x4a028f,_0x582f11,_0x2380d2){_0x2380d2(null,util[_0xb887('0x11')](_0xb887('0x12'),Date[_0xb887('0x13')](),_0x582f11[_0xb887('0x14')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xb887('0x15')]('/',upload[_0xb887('0x16')](_0xb887('0x17')),controller[_0xb887('0x18')]);router[_0xb887('0x19')](_0xb887('0xa'),auth[_0xb887('0xb')](),controller[_0xb887('0x1a')]);router[_0xb887('0x1b')](_0xb887('0xa'),auth[_0xb887('0xb')](),controller[_0xb887('0x1c')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/authGoogle/authGoogle.controller.js b/server/api/authGoogle/authGoogle.controller.js
index 21eb112..b95486d 100644
--- a/server/api/authGoogle/authGoogle.controller.js
+++ b/server/api/authGoogle/authGoogle.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x3f4b=['add','clearBlockUser','getLicense','catch','passport','Strategy','moment','../../mysqldb','../../config/environment','../../components/auth/service','signToken','../../config/utils','authenticate','google','profile','email','/login','use','clientID','clientSecret','Setting','blockDuration','then','User','find','map','emails','value','admin','agent','disabled','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'];(function(_0x1ee62e,_0x159bb2){var _0x27c6c8=function(_0x31a5d4){while(--_0x31a5d4){_0x1ee62e['push'](_0x1ee62e['shift']());}};_0x27c6c8(++_0x159bb2);}(_0x3f4b,0x144));var _0xb3f4=function(_0x1733da,_0xf5318e){_0x1733da=_0x1733da-0x0;var _0x359598=_0x3f4b[_0x1733da];return _0x359598;};'use strict';var _=require('lodash');var passport=require(_0xb3f4('0x0'));var GoogleStrategy=require('passport-google-oauth20')[_0xb3f4('0x1')];var moment=require(_0xb3f4('0x2'));var db=require(_0xb3f4('0x3'))['db'];var config=require(_0xb3f4('0x4'));var signToken=require(_0xb3f4('0x5'))[_0xb3f4('0x6')];var utils=require(_0xb3f4('0x7'));exports['login']=passport[_0xb3f4('0x8')](_0xb3f4('0x9'),{'failureRedirect':'/login','scope':[_0xb3f4('0xa'),_0xb3f4('0xb')],'session':![]});exports['callback']=passport[_0xb3f4('0x8')](_0xb3f4('0x9'),{'failureRedirect':_0xb3f4('0xc'),'session':![]});passport[_0xb3f4('0xd')](new GoogleStrategy({'clientID':config[_0xb3f4('0x9')]?config[_0xb3f4('0x9')][_0xb3f4('0xe')]:'id','clientSecret':config[_0xb3f4('0x9')]?config[_0xb3f4('0x9')][_0xb3f4('0xf')]:'secret','callbackURL':config[_0xb3f4('0x9')]?config[_0xb3f4('0x9')]['callbackURL']:''},function(_0x24309a,_0x46b9db,_0x5ed97d,_0x231b1b){var _0x2a0bfa,_0x5d978e;return db[_0xb3f4('0x10')]['findOne']({'where':{'id':0x1},'attributes':['allowedLoginAttempts',_0xb3f4('0x11')],'raw':!![]})[_0xb3f4('0x12')](function(_0x3a148e){_0x2a0bfa=_0x3a148e;return db[_0xb3f4('0x13')][_0xb3f4('0x14')]({'where':{'email':_[_0xb3f4('0x15')](_0x5ed97d[_0xb3f4('0x16')],_0xb3f4('0x17')),'role':{'$or':[_0xb3f4('0x18'),'user',_0xb3f4('0x19')]}}});})[_0xb3f4('0x12')](function(_0x3a0380){_0x5d978e=_0x3a0380;if(_0x5d978e){if(_0x5d978e[_0xb3f4('0x1a')]){return _0x231b1b(_0xb3f4('0x1b'));}else if(_0x2a0bfa[_0xb3f4('0x11')]>0x0){if(_0x5d978e['blocked']){if(moment(_0x5d978e['blockedAt'])[_0xb3f4('0x1c')](_0x2a0bfa[_0xb3f4('0x11')],'minutes')>moment()){return _0x231b1b(_0xb3f4('0x1b'));}else{return utils[_0xb3f4('0x1d')](_0x5d978e,0x0,![],null)[_0xb3f4('0x12')](function(){return utils[_0xb3f4('0x1e')](_0x5d978e);})[_0xb3f4('0x12')](function(){return _0x231b1b(null,_0x5d978e);});}}else{return utils['getLicense'](_0x5d978e)[_0xb3f4('0x12')](function(){return _0x231b1b(null,_0x5d978e);});}}else{return utils['getLicense'](_0x5d978e)[_0xb3f4('0x12')](function(){return _0x231b1b(null,_0x5d978e);});}}return _0x231b1b('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');})[_0xb3f4('0x1f')](function(_0x481d93){_0x231b1b(_0x481d93);});}));
\ No newline at end of file
+var _0xd321=['email','callback','authenticate','clientID','clientSecret','secret','callbackURL','findOne','allowedLoginAttempts','blockDuration','then','User','find','map','value','user','agent','add','minutes','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','clearBlockUser','getLicense','catch','lodash','passport-google-oauth20','../../mysqldb','signToken','../../config/utils','google','/login'];(function(_0x41877d,_0x19b756){var _0x4f4f49=function(_0x1a17c3){while(--_0x1a17c3){_0x41877d['push'](_0x41877d['shift']());}};_0x4f4f49(++_0x19b756);}(_0xd321,0x107));var _0x1d32=function(_0x2ff3c9,_0x2f48de){_0x2ff3c9=_0x2ff3c9-0x0;var _0x233582=_0xd321[_0x2ff3c9];return _0x233582;};'use strict';var _=require(_0x1d32('0x0'));var passport=require('passport');var GoogleStrategy=require(_0x1d32('0x1'))['Strategy'];var moment=require('moment');var db=require(_0x1d32('0x2'))['db'];var config=require('../../config/environment');var signToken=require('../../components/auth/service')[_0x1d32('0x3')];var utils=require(_0x1d32('0x4'));exports['login']=passport['authenticate'](_0x1d32('0x5'),{'failureRedirect':_0x1d32('0x6'),'scope':['profile',_0x1d32('0x7')],'session':![]});exports[_0x1d32('0x8')]=passport[_0x1d32('0x9')](_0x1d32('0x5'),{'failureRedirect':_0x1d32('0x6'),'session':![]});passport['use'](new GoogleStrategy({'clientID':config['google']?config[_0x1d32('0x5')][_0x1d32('0xa')]:'id','clientSecret':config['google']?config[_0x1d32('0x5')][_0x1d32('0xb')]:_0x1d32('0xc'),'callbackURL':config[_0x1d32('0x5')]?config[_0x1d32('0x5')][_0x1d32('0xd')]:''},function(_0x124b40,_0x140a51,_0x46734e,_0x2d42b9){var _0x43404b,_0x4e4cf3;return db['Setting'][_0x1d32('0xe')]({'where':{'id':0x1},'attributes':[_0x1d32('0xf'),_0x1d32('0x10')],'raw':!![]})[_0x1d32('0x11')](function(_0x4f7191){_0x43404b=_0x4f7191;return db[_0x1d32('0x12')][_0x1d32('0x13')]({'where':{'email':_[_0x1d32('0x14')](_0x46734e['emails'],_0x1d32('0x15')),'role':{'$or':['admin',_0x1d32('0x16'),_0x1d32('0x17')]}}});})[_0x1d32('0x11')](function(_0x1edd9e){_0x4e4cf3=_0x1edd9e;if(_0x4e4cf3){if(_0x4e4cf3['disabled']){return _0x2d42b9('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else if(_0x43404b[_0x1d32('0x10')]>0x0){if(_0x4e4cf3['blocked']){if(moment(_0x4e4cf3['blockedAt'])[_0x1d32('0x18')](_0x43404b['blockDuration'],_0x1d32('0x19'))>moment()){return _0x2d42b9(_0x1d32('0x1a'));}else{return utils[_0x1d32('0x1b')](_0x4e4cf3,0x0,![],null)[_0x1d32('0x11')](function(){return utils[_0x1d32('0x1c')](_0x4e4cf3);})[_0x1d32('0x11')](function(){return _0x2d42b9(null,_0x4e4cf3);});}}else{return utils[_0x1d32('0x1c')](_0x4e4cf3)[_0x1d32('0x11')](function(){return _0x2d42b9(null,_0x4e4cf3);});}}else{return utils[_0x1d32('0x1c')](_0x4e4cf3)[_0x1d32('0x11')](function(){return _0x2d42b9(null,_0x4e4cf3);});}}return _0x2d42b9('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');})[_0x1d32('0x1d')](function(_0x438a13){_0x2d42b9(_0x438a13);});}));
\ No newline at end of file
diff --git a/server/api/authGoogle/index.js b/server/api/authGoogle/index.js
index 79e6ab0..234f33a 100644
--- a/server/api/authGoogle/index.js
+++ b/server/api/authGoogle/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xe356=['get','/callback','isMiddleware','exports','express','passport','Router','./authGoogle.controller','../../components/auth/service','login'];(function(_0x363f05,_0x4b6f15){var _0x2f86d3=function(_0x49acc8){while(--_0x49acc8){_0x363f05['push'](_0x363f05['shift']());}};_0x2f86d3(++_0x4b6f15);}(_0xe356,0x1ee));var _0x6e35=function(_0x5903ae,_0x173a6d){_0x5903ae=_0x5903ae-0x0;var _0x4e6dc0=_0xe356[_0x5903ae];return _0x4e6dc0;};'use strict';var express=require(_0x6e35('0x0'));var passport=require(_0x6e35('0x1'));var router=express[_0x6e35('0x2')]();var controller=require(_0x6e35('0x3'));var userController=require('../user/user.controller.js');var authService=require(_0x6e35('0x4'));router['get']('/',controller[_0x6e35('0x5')]);router[_0x6e35('0x6')](_0x6e35('0x7'),controller['callback'],authService[_0x6e35('0x8')],userController[_0x6e35('0x5')],authService['setTokenCookie']);module[_0x6e35('0x9')]=router;
\ No newline at end of file
+var _0xdeb7=['Router','../user/user.controller.js','../../components/auth/service','get','login','callback','isMiddleware','setTokenCookie','exports','express','passport'];(function(_0x57cb81,_0x16d6a6){var _0x26f5e9=function(_0x20e84f){while(--_0x20e84f){_0x57cb81['push'](_0x57cb81['shift']());}};_0x26f5e9(++_0x16d6a6);}(_0xdeb7,0x77));var _0x7deb=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xdeb7[_0x2641f9];return _0x585741;};'use strict';var express=require(_0x7deb('0x0'));var passport=require(_0x7deb('0x1'));var router=express[_0x7deb('0x2')]();var controller=require('./authGoogle.controller');var userController=require(_0x7deb('0x3'));var authService=require(_0x7deb('0x4'));router[_0x7deb('0x5')]('/',controller[_0x7deb('0x6')]);router[_0x7deb('0x5')]('/callback',controller[_0x7deb('0x7')],authService[_0x7deb('0x8')],userController[_0x7deb('0x6')],authService[_0x7deb('0x9')]);module[_0x7deb('0xa')]=router;
\ No newline at end of file
diff --git a/server/api/authLocal/authLocal.controller.js b/server/api/authLocal/authLocal.controller.js
index 08f6092..a2a2844 100644
--- a/server/api/authLocal/authLocal.controller.js
+++ b/server/api/authLocal/authLocal.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xbb4b=['save','xCally\x20Motion\x20Password\x20Reset','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','http://','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','status','Reset\x20Email\x20sent!','params','token','securePassword','password','send','Password\x20reset!','use','util','passport','jayson/promise','lodash','randomstring','../../mysqldb','../../components/auth/service','../../config/utils','client','http','Setting','findOne','name','role','disabled','blockedAt','admin','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','then','loginAttempts','allowedLoginAttempts','blocked','blockDuration','add','clearBlockUser','minutes','getLicense','catch','MailAccount','find','email','Smtp','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','service','host','port','secure','auth','pass','merge','format','\x22%s\x22\x20<%s>','request','SendMail','error','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','message','stringify','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','login','authenticate','local','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','online','forgot','body','Email\x20parameter\x20is\x20missing','trim','User','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','resetPasswordExpires','now'];(function(_0x4a67ae,_0x51ac3d){var _0x53b8ad=function(_0x1fff59){while(--_0x1fff59){_0x4a67ae['push'](_0x4a67ae['shift']());}};_0x53b8ad(++_0x51ac3d);}(_0xbb4b,0x1b4));var _0xbbb4=function(_0x7b0cf2,_0x5dddd3){_0x7b0cf2=_0x7b0cf2-0x0;var _0x35285d=_0xbb4b[_0x7b0cf2];return _0x35285d;};'use strict';var util=require(_0xbbb4('0x0'));var passport=require(_0xbbb4('0x1'));var LocalStrategy=require('passport-local')['Strategy'];var jayson=require(_0xbbb4('0x2'));var _=require(_0xbbb4('0x3'));var rs=require(_0xbbb4('0x4'));var moment=require('moment');var db=require(_0xbbb4('0x5'))['db'];var authService=require(_0xbbb4('0x6'));var utils=require(_0xbbb4('0x7'));var client=jayson[_0xbbb4('0x8')][_0xbbb4('0x9')]({'port':0x232b});function localAuthenticate(_0x4f6952,_0x52c7ae,_0x12fcbd,_0x70fd0f){var _0x8034aa,_0x384d7d;return db[_0xbbb4('0xa')]['findOne']({'where':{'id':0x1},'attributes':['allowedLoginAttempts','blockDuration'],'raw':!![]})['then'](function(_0x13a6f8){_0x8034aa=_0x13a6f8;return _0x4f6952[_0xbbb4('0xb')]({'attributes':['id',_0xbbb4('0xc'),'password','salt',_0xbbb4('0xd'),_0xbbb4('0xe'),'blocked',_0xbbb4('0xf'),'loginAttempts'],'where':{'name':_0x52c7ae,'role':{'$or':[_0xbbb4('0x10'),_0xbbb4('0x11'),_0xbbb4('0x12')]}}});})['then'](function(_0x4d9df1){if(!_0x4d9df1||_0x4d9df1&&_0x4d9df1[_0xbbb4('0xc')]!==_0x52c7ae){throw new Error(_0xbbb4('0x13'));}else{_0x384d7d=_0x4d9df1;return _0x384d7d;}})[_0xbbb4('0x14')](function(){_0x384d7d['authenticate'](_0x12fcbd,function(_0x4588ab,_0x4948a6){var _0x22c46a=_0x384d7d[_0xbbb4('0x15')]+0x1;if(_0x4588ab){return _0x70fd0f(_0x4588ab);}else if(!_0x4948a6){if(_0x384d7d['disabled']){return _0x70fd0f(null,![],{'message':_0xbbb4('0x13')});}else if(_0x8034aa[_0xbbb4('0x16')]>0x0){if(_0x384d7d[_0xbbb4('0x17')]){if(_0x8034aa[_0xbbb4('0x18')]>0x0){if(moment(_0x384d7d['blockedAt'])[_0xbbb4('0x19')](_0x8034aa[_0xbbb4('0x18')],'minutes')>moment()){return _0x70fd0f(null,![],{'message':_0xbbb4('0x13')});}else{return utils['clearBlockUser'](_0x384d7d,_0x22c46a,![],null)[_0xbbb4('0x14')](function(){return _0x70fd0f(null,![],{'message':_0xbbb4('0x13')});});}}else{return _0x70fd0f(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{if(_0x22c46a>=_0x8034aa[_0xbbb4('0x16')]){return utils[_0xbbb4('0x1a')](_0x384d7d,0x0,!![],moment())[_0xbbb4('0x14')](function(){return _0x70fd0f(null,![],{'message':_0xbbb4('0x13')});});}else{return utils[_0xbbb4('0x1a')](_0x384d7d,_0x22c46a,![],null)[_0xbbb4('0x14')](function(){return _0x70fd0f(null,![],{'message':_0xbbb4('0x13')});});}}}else{return _0x70fd0f(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{if(_0x384d7d[_0xbbb4('0xe')]){return _0x70fd0f(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else if(_0x8034aa[_0xbbb4('0x16')]>0x0){if(_0x384d7d[_0xbbb4('0x17')]){if(_0x8034aa['blockDuration']>0x0){if(moment(_0x384d7d[_0xbbb4('0xf')])[_0xbbb4('0x19')](_0x8034aa[_0xbbb4('0x18')],_0xbbb4('0x1b'))>moment()){return _0x70fd0f(null,![],{'message':_0xbbb4('0x13')});}else{return utils['clearBlockUser'](_0x384d7d,0x0,![],null)[_0xbbb4('0x14')](function(){return utils[_0xbbb4('0x1c')](_0x384d7d);})[_0xbbb4('0x14')](function(){return _0x70fd0f(null,_0x384d7d);});}}else{return _0x70fd0f(null,![],{'message':_0xbbb4('0x13')});}}else{return utils[_0xbbb4('0x1a')](_0x384d7d,0x0,![],null)[_0xbbb4('0x14')](function(){return utils[_0xbbb4('0x1c')](_0x384d7d);})[_0xbbb4('0x14')](function(){return _0x70fd0f(null,_0x384d7d);})[_0xbbb4('0x1d')](function(_0xc8f157){return _0x70fd0f(null,![],_0xc8f157);});}}else{if(_0x384d7d[_0xbbb4('0x17')]){return _0x70fd0f(null,![],{'message':_0xbbb4('0x13')});}else{return utils[_0xbbb4('0x1c')](_0x384d7d)[_0xbbb4('0x14')](function(){return _0x70fd0f(null,_0x384d7d);});}}}});})[_0xbbb4('0x1d')](function(_0x49bc48){return _0x70fd0f(null,![],_0x49bc48);});}function sendServiceMail(_0x5e1960){return db[_0xbbb4('0x1e')][_0xbbb4('0x1f')]({'where':{'service':!![]},'attributes':['id',_0xbbb4('0xc'),_0xbbb4('0x20')],'include':[{'model':db['MailServerOut'],'as':_0xbbb4('0x21')}]})['then'](function(_0x273692){if(!_0x273692){throw new Error(_0xbbb4('0x22'));}var _0x48705f={'tls':{'rejectUnauthorized':![]}};if(_0x273692['Smtp'][_0xbbb4('0x23')]){_0x48705f[_0xbbb4('0x23')]=_0x273692[_0xbbb4('0x21')][_0xbbb4('0x23')];}else{_0x48705f[_0xbbb4('0x24')]=_0x273692['Smtp'][_0xbbb4('0x24')];_0x48705f[_0xbbb4('0x25')]=_0x273692[_0xbbb4('0x21')][_0xbbb4('0x25')];_0x48705f[_0xbbb4('0x26')]=_0x273692[_0xbbb4('0x21')][_0xbbb4('0x26')];}if(_0x273692[_0xbbb4('0x21')]['authentication']){_0x48705f[_0xbbb4('0x27')]={'user':_0x273692[_0xbbb4('0x21')][_0xbbb4('0x11')],'pass':_0x273692[_0xbbb4('0x21')][_0xbbb4('0x28')]};}var _0x3e77e8={'account':_0x48705f,'message':_[_0xbbb4('0x29')]({'from':util[_0xbbb4('0x2a')](_0xbbb4('0x2b'),_0x273692[_0xbbb4('0xc')],_0x273692['email']||_0x273692[_0xbbb4('0x21')]['user'])},_0x5e1960)};return client[_0xbbb4('0x2c')](_0xbbb4('0x2d'),_0x3e77e8);})[_0xbbb4('0x14')](function(_0x57f12f){if(_0x57f12f[_0xbbb4('0x2e')]){throw new Error(util[_0xbbb4('0x2a')](_0xbbb4('0x2f'),_0x57f12f[_0xbbb4('0x2e')][_0xbbb4('0x30')]||JSON[_0xbbb4('0x31')](_0x57f12f[_0xbbb4('0x2e')])));}return!![];});}function handleError(_0xb35c3d,_0x269848,_0x1572c0){return _0xb35c3d['status'](_0x269848||0x1f4)['send']({'message':_0x1572c0?_0x1572c0['message']||_0x1572c0:''});}function checkPasswordPattern(_0x42874b,_0x212f9b,_0x532d49){if(_0x532d49){var _0xb45d22=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0xb45d22[_0xbbb4('0x32')](_0x212f9b)){return _0x42874b;}else{throw new Error(_0xbbb4('0x33'));}}else{return _0x42874b;}}exports[_0xbbb4('0x34')]=function(_0x34dc9e,_0x42da0e,_0x1da012){passport[_0xbbb4('0x35')](_0xbbb4('0x36'),function(_0x608658,_0x666c55,_0x1991a3){var _0x1241e0=_0x608658||_0x1991a3;if(_0x1241e0){return handleError(_0x42da0e,0x191,_0x1241e0);}if(!_0x666c55){return handleError(_0x42da0e,0x194,{'message':_0xbbb4('0x37')});}else{var _0x403e6f={'payload':{'id':_0x666c55['id'],'role':_0x666c55['role']},'options':{'expiresIn':0x15180}};return authService[_0xbbb4('0x38')](_0x403e6f)[_0xbbb4('0x14')](function(_0x7a0b16){_0x42da0e[_0xbbb4('0x39')]({'id':_0x666c55['id'],'token':_0x7a0b16,'statusCall':'','isAlreadyLogged':_0x666c55[_0xbbb4('0x3a')]});});}})(_0x34dc9e,_0x42da0e,_0x1da012);};exports[_0xbbb4('0x3b')]=function(_0x482699,_0x42f51e,_0x2ed13b){if(!_0x482699[_0xbbb4('0x3c')][_0xbbb4('0x20')]){return handleError(_0x42f51e,0x1f4,{'message':_0xbbb4('0x3d')});}var _0x308530=rs['generate']();_0x482699[_0xbbb4('0x3c')][_0xbbb4('0x20')]=_0x482699[_0xbbb4('0x3c')]['email'][_0xbbb4('0x3e')]()['toLowerCase']();var _0x8b68d2;return db[_0xbbb4('0xa')][_0xbbb4('0xb')]({'where':{'id':0x1},'attributes':['allowedLoginAttempts','blockDuration'],'raw':!![]})[_0xbbb4('0x14')](function(_0x99f461){_0x8b68d2=_0x99f461;return db[_0xbbb4('0x3f')]['find']({'where':{'email':_0x482699[_0xbbb4('0x3c')]['email']}});})[_0xbbb4('0x14')](function(_0x46ad85){if(!_0x46ad85){throw new Error('This\x20email\x20is\x20not\x20registered.');}if(_0x46ad85[_0xbbb4('0xe')]){throw new Error('The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.');}if(_0x46ad85[_0xbbb4('0x17')]){if(moment(_0x46ad85['blockedAt'])[_0xbbb4('0x19')](_0x8b68d2[_0xbbb4('0x18')],'minutes')>moment()){throw new Error(_0xbbb4('0x40'));}else{_0x46ad85[_0xbbb4('0x17')]=![];_0x46ad85[_0xbbb4('0xf')]=null;}}_0x46ad85[_0xbbb4('0x41')]=_0x308530;_0x46ad85[_0xbbb4('0x42')]=Date[_0xbbb4('0x43')]()+0x36ee80;return _0x46ad85[_0xbbb4('0x44')]();})['then'](function(){return sendServiceMail({'to':_0x482699[_0xbbb4('0x3c')]['email'],'subject':_0xbbb4('0x45'),'text':_0xbbb4('0x46')+_0xbbb4('0x47')+_0xbbb4('0x48')+_0x482699['headers'][_0xbbb4('0x24')]+_0xbbb4('0x49')+_0x308530+'\x0a\x0a'+_0xbbb4('0x4a')});})[_0xbbb4('0x14')](function(){_0x42f51e[_0xbbb4('0x4b')](0xc8)['send']({'message':_0xbbb4('0x4c')});})[_0xbbb4('0x1d')](function(_0x3c9624){return handleError(_0x42f51e,0x1f4,_0x3c9624);});};exports['reset']=function(_0x440440,_0x359ec4,_0x78f61e){var _0x30785a;return db[_0xbbb4('0x3f')][_0xbbb4('0x1f')]({'where':{'resetPasswordToken':_0x440440[_0xbbb4('0x4d')][_0xbbb4('0x4e')],'resetPasswordExpires':{'$gt':Date[_0xbbb4('0x43')]()}}})[_0xbbb4('0x14')](function(_0x3d4e4f){_0x30785a=_0x3d4e4f;if(!_0x30785a){throw new Error('Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.');}return db[_0xbbb4('0xa')]['findOne']({'attributes':['id',_0xbbb4('0x4f')]});})[_0xbbb4('0x14')](function(_0x309ce2){return checkPasswordPattern(_0x309ce2,_0x440440[_0xbbb4('0x3c')][_0xbbb4('0x50')],_0x309ce2[_0xbbb4('0x4f')]);})[_0xbbb4('0x14')](function(){_0x30785a[_0xbbb4('0x50')]=_0x440440[_0xbbb4('0x3c')][_0xbbb4('0x50')];_0x30785a[_0xbbb4('0x41')]=null;_0x30785a[_0xbbb4('0x42')]=null;return _0x30785a[_0xbbb4('0x44')]();})['then'](function(){_0x359ec4[_0xbbb4('0x4b')](0xc8)[_0xbbb4('0x51')]({'message':_0xbbb4('0x52')});})[_0xbbb4('0x1d')](function(_0x3dfc43){return handleError(_0x359ec4,0x1f4,_0x3dfc43);});};passport[_0xbbb4('0x53')](new LocalStrategy({'usernameField':_0xbbb4('0xc'),'passwordField':'password'},function(_0x4065ef,_0x52cab7,_0x13088d){return localAuthenticate(db[_0xbbb4('0x3f')],_0x4065ef,_0x52cab7,_0x13088d);}));
\ No newline at end of file
+var _0xc298=['host','port','secure','authentication','pass','merge','format','\x22%s\x22\x20<%s>','request','SendMail','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','message','stringify','error','status','send','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','login','local','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','online','forgot','body','Email\x20parameter\x20is\x20missing','generate','trim','toLowerCase','User','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','resetPasswordExpires','xCally\x20Motion\x20Password\x20Reset','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','http://','headers','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','params','token','now','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','save','Password\x20reset!','use','util','passport','passport-local','lodash','randomstring','moment','../../mysqldb','../../components/auth/service','../../config/utils','client','http','Setting','findOne','allowedLoginAttempts','blockDuration','then','name','password','salt','role','blocked','blockedAt','loginAttempts','admin','user','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','disabled','add','minutes','clearBlockUser','getLicense','catch','find','email','MailServerOut','Smtp','service'];(function(_0x4864ea,_0x7764ed){var _0x12e74f=function(_0x3fe41d){while(--_0x3fe41d){_0x4864ea['push'](_0x4864ea['shift']());}};_0x12e74f(++_0x7764ed);}(_0xc298,0x85));var _0x8c29=function(_0x2063bc,_0x1aa93b){_0x2063bc=_0x2063bc-0x0;var _0x2b352b=_0xc298[_0x2063bc];return _0x2b352b;};'use strict';var util=require(_0x8c29('0x0'));var passport=require(_0x8c29('0x1'));var LocalStrategy=require(_0x8c29('0x2'))['Strategy'];var jayson=require('jayson/promise');var _=require(_0x8c29('0x3'));var rs=require(_0x8c29('0x4'));var moment=require(_0x8c29('0x5'));var db=require(_0x8c29('0x6'))['db'];var authService=require(_0x8c29('0x7'));var utils=require(_0x8c29('0x8'));var client=jayson[_0x8c29('0x9')][_0x8c29('0xa')]({'port':0x232b});function localAuthenticate(_0xfb1afe,_0x1bca2c,_0x48aafa,_0x863f23){var _0x1aedd0,_0x4f08b0;return db[_0x8c29('0xb')][_0x8c29('0xc')]({'where':{'id':0x1},'attributes':[_0x8c29('0xd'),_0x8c29('0xe')],'raw':!![]})[_0x8c29('0xf')](function(_0x25c0ed){_0x1aedd0=_0x25c0ed;return _0xfb1afe['findOne']({'attributes':['id',_0x8c29('0x10'),_0x8c29('0x11'),_0x8c29('0x12'),_0x8c29('0x13'),'disabled',_0x8c29('0x14'),_0x8c29('0x15'),_0x8c29('0x16')],'where':{'name':_0x1bca2c,'role':{'$or':[_0x8c29('0x17'),_0x8c29('0x18'),'agent']}}});})[_0x8c29('0xf')](function(_0x2bb06a){if(!_0x2bb06a||_0x2bb06a&&_0x2bb06a[_0x8c29('0x10')]!==_0x1bca2c){throw new Error(_0x8c29('0x19'));}else{_0x4f08b0=_0x2bb06a;return _0x4f08b0;}})[_0x8c29('0xf')](function(){_0x4f08b0['authenticate'](_0x48aafa,function(_0x41654d,_0x544056){var _0x103f75=_0x4f08b0[_0x8c29('0x16')]+0x1;if(_0x41654d){return _0x863f23(_0x41654d);}else if(!_0x544056){if(_0x4f08b0[_0x8c29('0x1a')]){return _0x863f23(null,![],{'message':_0x8c29('0x19')});}else if(_0x1aedd0[_0x8c29('0xd')]>0x0){if(_0x4f08b0[_0x8c29('0x14')]){if(_0x1aedd0['blockDuration']>0x0){if(moment(_0x4f08b0[_0x8c29('0x15')])[_0x8c29('0x1b')](_0x1aedd0['blockDuration'],_0x8c29('0x1c'))>moment()){return _0x863f23(null,![],{'message':_0x8c29('0x19')});}else{return utils[_0x8c29('0x1d')](_0x4f08b0,_0x103f75,![],null)[_0x8c29('0xf')](function(){return _0x863f23(null,![],{'message':_0x8c29('0x19')});});}}else{return _0x863f23(null,![],{'message':_0x8c29('0x19')});}}else{if(_0x103f75>=_0x1aedd0[_0x8c29('0xd')]){return utils['clearBlockUser'](_0x4f08b0,0x0,!![],moment())[_0x8c29('0xf')](function(){return _0x863f23(null,![],{'message':_0x8c29('0x19')});});}else{return utils[_0x8c29('0x1d')](_0x4f08b0,_0x103f75,![],null)[_0x8c29('0xf')](function(){return _0x863f23(null,![],{'message':_0x8c29('0x19')});});}}}else{return _0x863f23(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{if(_0x4f08b0[_0x8c29('0x1a')]){return _0x863f23(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else if(_0x1aedd0[_0x8c29('0xd')]>0x0){if(_0x4f08b0[_0x8c29('0x14')]){if(_0x1aedd0[_0x8c29('0xe')]>0x0){if(moment(_0x4f08b0[_0x8c29('0x15')])['add'](_0x1aedd0[_0x8c29('0xe')],_0x8c29('0x1c'))>moment()){return _0x863f23(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils[_0x8c29('0x1d')](_0x4f08b0,0x0,![],null)[_0x8c29('0xf')](function(){return utils[_0x8c29('0x1e')](_0x4f08b0);})[_0x8c29('0xf')](function(){return _0x863f23(null,_0x4f08b0);});}}else{return _0x863f23(null,![],{'message':_0x8c29('0x19')});}}else{return utils[_0x8c29('0x1d')](_0x4f08b0,0x0,![],null)[_0x8c29('0xf')](function(){return utils[_0x8c29('0x1e')](_0x4f08b0);})['then'](function(){return _0x863f23(null,_0x4f08b0);})[_0x8c29('0x1f')](function(_0x4319d4){return _0x863f23(null,![],_0x4319d4);});}}else{if(_0x4f08b0[_0x8c29('0x14')]){return _0x863f23(null,![],{'message':_0x8c29('0x19')});}else{return utils[_0x8c29('0x1e')](_0x4f08b0)[_0x8c29('0xf')](function(){return _0x863f23(null,_0x4f08b0);});}}}});})[_0x8c29('0x1f')](function(_0x19df20){return _0x863f23(null,![],_0x19df20);});}function sendServiceMail(_0x236729){return db['MailAccount'][_0x8c29('0x20')]({'where':{'service':!![]},'attributes':['id','name',_0x8c29('0x21')],'include':[{'model':db[_0x8c29('0x22')],'as':_0x8c29('0x23')}]})[_0x8c29('0xf')](function(_0x136d27){if(!_0x136d27){throw new Error('Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!');}var _0xe7c5ba={'tls':{'rejectUnauthorized':![]}};if(_0x136d27[_0x8c29('0x23')][_0x8c29('0x24')]){_0xe7c5ba[_0x8c29('0x24')]=_0x136d27[_0x8c29('0x23')][_0x8c29('0x24')];}else{_0xe7c5ba[_0x8c29('0x25')]=_0x136d27['Smtp'][_0x8c29('0x25')];_0xe7c5ba['port']=_0x136d27['Smtp'][_0x8c29('0x26')];_0xe7c5ba[_0x8c29('0x27')]=_0x136d27[_0x8c29('0x23')][_0x8c29('0x27')];}if(_0x136d27[_0x8c29('0x23')][_0x8c29('0x28')]){_0xe7c5ba['auth']={'user':_0x136d27['Smtp'][_0x8c29('0x18')],'pass':_0x136d27[_0x8c29('0x23')][_0x8c29('0x29')]};}var _0x521867={'account':_0xe7c5ba,'message':_[_0x8c29('0x2a')]({'from':util[_0x8c29('0x2b')](_0x8c29('0x2c'),_0x136d27[_0x8c29('0x10')],_0x136d27[_0x8c29('0x21')]||_0x136d27[_0x8c29('0x23')]['user'])},_0x236729)};return client[_0x8c29('0x2d')](_0x8c29('0x2e'),_0x521867);})[_0x8c29('0xf')](function(_0x34c1b2){if(_0x34c1b2['error']){throw new Error(util[_0x8c29('0x2b')](_0x8c29('0x2f'),_0x34c1b2['error'][_0x8c29('0x30')]||JSON[_0x8c29('0x31')](_0x34c1b2[_0x8c29('0x32')])));}return!![];});}function handleError(_0x1a74af,_0x52864e,_0x96b81){return _0x1a74af[_0x8c29('0x33')](_0x52864e||0x1f4)[_0x8c29('0x34')]({'message':_0x96b81?_0x96b81[_0x8c29('0x30')]||_0x96b81:''});}function checkPasswordPattern(_0x72f23b,_0x5d2401,_0x23683f){if(_0x23683f){var _0x3cb864=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x3cb864['test'](_0x5d2401)){return _0x72f23b;}else{throw new Error(_0x8c29('0x35'));}}else{return _0x72f23b;}}exports[_0x8c29('0x36')]=function(_0x14aa60,_0x5f5af6,_0x20ff09){passport['authenticate'](_0x8c29('0x37'),function(_0x354275,_0x226c57,_0x34deb6){var _0x5d53bf=_0x354275||_0x34deb6;if(_0x5d53bf){return handleError(_0x5f5af6,0x191,_0x5d53bf);}if(!_0x226c57){return handleError(_0x5f5af6,0x194,{'message':_0x8c29('0x38')});}else{var _0xbc1ccd={'payload':{'id':_0x226c57['id'],'role':_0x226c57['role']},'options':{'expiresIn':0x15180}};return authService[_0x8c29('0x39')](_0xbc1ccd)['then'](function(_0x12883f){_0x5f5af6[_0x8c29('0x3a')]({'id':_0x226c57['id'],'token':_0x12883f,'statusCall':'','isAlreadyLogged':_0x226c57[_0x8c29('0x3b')]});});}})(_0x14aa60,_0x5f5af6,_0x20ff09);};exports[_0x8c29('0x3c')]=function(_0x970f6,_0x2402db,_0xa13b7b){if(!_0x970f6[_0x8c29('0x3d')]['email']){return handleError(_0x2402db,0x1f4,{'message':_0x8c29('0x3e')});}var _0x39b82a=rs[_0x8c29('0x3f')]();_0x970f6['body'][_0x8c29('0x21')]=_0x970f6[_0x8c29('0x3d')][_0x8c29('0x21')][_0x8c29('0x40')]()[_0x8c29('0x41')]();var _0x35d5f0;return db[_0x8c29('0xb')][_0x8c29('0xc')]({'where':{'id':0x1},'attributes':[_0x8c29('0xd'),_0x8c29('0xe')],'raw':!![]})[_0x8c29('0xf')](function(_0x46a4aa){_0x35d5f0=_0x46a4aa;return db[_0x8c29('0x42')][_0x8c29('0x20')]({'where':{'email':_0x970f6[_0x8c29('0x3d')][_0x8c29('0x21')]}});})['then'](function(_0xe3f5fb){if(!_0xe3f5fb){throw new Error('This\x20email\x20is\x20not\x20registered.');}if(_0xe3f5fb[_0x8c29('0x1a')]){throw new Error(_0x8c29('0x43'));}if(_0xe3f5fb[_0x8c29('0x14')]){if(moment(_0xe3f5fb[_0x8c29('0x15')])[_0x8c29('0x1b')](_0x35d5f0['blockDuration'],'minutes')>moment()){throw new Error(_0x8c29('0x44'));}else{_0xe3f5fb[_0x8c29('0x14')]=![];_0xe3f5fb[_0x8c29('0x15')]=null;}}_0xe3f5fb[_0x8c29('0x45')]=_0x39b82a;_0xe3f5fb[_0x8c29('0x46')]=Date['now']()+0x36ee80;return _0xe3f5fb['save']();})[_0x8c29('0xf')](function(){return sendServiceMail({'to':_0x970f6[_0x8c29('0x3d')][_0x8c29('0x21')],'subject':_0x8c29('0x47'),'text':'You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a'+_0x8c29('0x48')+_0x8c29('0x49')+_0x970f6[_0x8c29('0x4a')][_0x8c29('0x25')]+_0x8c29('0x4b')+_0x39b82a+'\x0a\x0a'+_0x8c29('0x4c')});})[_0x8c29('0xf')](function(){_0x2402db[_0x8c29('0x33')](0xc8)['send']({'message':'Reset\x20Email\x20sent!'});})['catch'](function(_0x3926d3){return handleError(_0x2402db,0x1f4,_0x3926d3);});};exports['reset']=function(_0x2525c1,_0x59bc7e,_0x130b9c){var _0x1823ad;return db[_0x8c29('0x42')][_0x8c29('0x20')]({'where':{'resetPasswordToken':_0x2525c1[_0x8c29('0x4d')][_0x8c29('0x4e')],'resetPasswordExpires':{'$gt':Date[_0x8c29('0x4f')]()}}})['then'](function(_0x478833){_0x1823ad=_0x478833;if(!_0x1823ad){throw new Error(_0x8c29('0x50'));}return db[_0x8c29('0xb')][_0x8c29('0xc')]({'attributes':['id','securePassword']});})[_0x8c29('0xf')](function(_0x5b5e2c){return checkPasswordPattern(_0x5b5e2c,_0x2525c1[_0x8c29('0x3d')]['password'],_0x5b5e2c[_0x8c29('0x51')]);})[_0x8c29('0xf')](function(){_0x1823ad['password']=_0x2525c1[_0x8c29('0x3d')][_0x8c29('0x11')];_0x1823ad[_0x8c29('0x45')]=null;_0x1823ad[_0x8c29('0x46')]=null;return _0x1823ad[_0x8c29('0x52')]();})[_0x8c29('0xf')](function(){_0x59bc7e[_0x8c29('0x33')](0xc8)['send']({'message':_0x8c29('0x53')});})[_0x8c29('0x1f')](function(_0x5b28e7){return handleError(_0x59bc7e,0x1f4,_0x5b28e7);});};passport[_0x8c29('0x54')](new LocalStrategy({'usernameField':_0x8c29('0x10'),'passwordField':_0x8c29('0x11')},function(_0x35fb1d,_0x25ea61,_0x37fe27){return localAuthenticate(db['User'],_0x35fb1d,_0x25ea61,_0x37fe27);}));
\ No newline at end of file
diff --git a/server/api/authLocal/index.js b/server/api/authLocal/index.js
index 42ed77f..b215838 100644
--- a/server/api/authLocal/index.js
+++ b/server/api/authLocal/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x16cd=['/forgot','forgot','/reset/:token','reset','exports','Router','./authLocal.controller','post','login'];(function(_0x4e9240,_0x570b72){var _0x4759ad=function(_0x3cabe1){while(--_0x3cabe1){_0x4e9240['push'](_0x4e9240['shift']());}};_0x4759ad(++_0x570b72);}(_0x16cd,0x101));var _0xd16c=function(_0x1cd47d,_0x55bc75){_0x1cd47d=_0x1cd47d-0x0;var _0x29d52f=_0x16cd[_0x1cd47d];return _0x29d52f;};'use strict';var express=require('express');var router=express[_0xd16c('0x0')]();var controller=require(_0xd16c('0x1'));router[_0xd16c('0x2')]('/',controller[_0xd16c('0x3')]);router[_0xd16c('0x2')](_0xd16c('0x4'),controller[_0xd16c('0x5')]);router['post'](_0xd16c('0x6'),controller[_0xd16c('0x7')]);module[_0xd16c('0x8')]=router;
\ No newline at end of file
+var _0xee15=['forgot','/reset/:token','reset','exports','express','Router','./authLocal.controller','post','login','/forgot'];(function(_0x47b096,_0x5ec33b){var _0x37ebd0=function(_0xf4edc6){while(--_0xf4edc6){_0x47b096['push'](_0x47b096['shift']());}};_0x37ebd0(++_0x5ec33b);}(_0xee15,0x9a));var _0x5ee1=function(_0x587dd0,_0x273922){_0x587dd0=_0x587dd0-0x0;var _0x56f153=_0xee15[_0x587dd0];return _0x56f153;};'use strict';var express=require(_0x5ee1('0x0'));var router=express[_0x5ee1('0x1')]();var controller=require(_0x5ee1('0x2'));router[_0x5ee1('0x3')]('/',controller[_0x5ee1('0x4')]);router[_0x5ee1('0x3')](_0x5ee1('0x5'),controller[_0x5ee1('0x6')]);router[_0x5ee1('0x3')](_0x5ee1('0x7'),controller[_0x5ee1('0x8')]);module[_0x5ee1('0x9')]=router;
\ No newline at end of file
diff --git a/server/api/automation/automation.attributes.js b/server/api/automation/automation.attributes.js
index 85cb245..0c9ef66 100644
--- a/server/api/automation/automation.attributes.js
+++ b/server/api/automation/automation.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xf3d8=['STRING','exports'];(function(_0x5e8479,_0x40ec45){var _0x59150a=function(_0x2555ad){while(--_0x2555ad){_0x5e8479['push'](_0x5e8479['shift']());}};_0x59150a(++_0x40ec45);}(_0xf3d8,0x93));var _0x8f3d=function(_0x33c9f8,_0x5aedbb){_0x33c9f8=_0x33c9f8-0x0;var _0x2d7004=_0xf3d8[_0x33c9f8];return _0x2d7004;};'use strict';var Sequelize=require('sequelize');module[_0x8f3d('0x0')]={'name':{'type':Sequelize[_0x8f3d('0x1')],'allowNull':![]},'channel':{'type':Sequelize[_0x8f3d('0x1')]},'description':{'type':Sequelize['STRING']},'status':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timeout':{'type':Sequelize['INTEGER'],'defaultValue':0xa}};
\ No newline at end of file
+var _0x44e3=['sequelize','exports','STRING','BOOLEAN','INTEGER'];(function(_0x1a7075,_0x210769){var _0x456ed8=function(_0x41a33f){while(--_0x41a33f){_0x1a7075['push'](_0x1a7075['shift']());}};_0x456ed8(++_0x210769);}(_0x44e3,0x177));var _0x344e=function(_0x5c3887,_0x148afb){_0x5c3887=_0x5c3887-0x0;var _0x30aa73=_0x44e3[_0x5c3887];return _0x30aa73;};'use strict';var Sequelize=require(_0x344e('0x0'));module[_0x344e('0x1')]={'name':{'type':Sequelize[_0x344e('0x2')],'allowNull':![]},'channel':{'type':Sequelize[_0x344e('0x2')]},'description':{'type':Sequelize[_0x344e('0x2')]},'status':{'type':Sequelize[_0x344e('0x3')],'defaultValue':![]},'timeout':{'type':Sequelize[_0x344e('0x4')],'defaultValue':0xa}};
\ No newline at end of file
diff --git a/server/api/automation/automation.controller.js b/server/api/automation/automation.controller.js
index 750ef13..4efe951 100644
--- a/server/api/automation/automation.controller.js
+++ b/server/api/automation/automation.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xff0f=['limit','set','Content-Range','apply','reject','save','then','destroy','error','stack','name','send','map','Automation','rawAttributes','fieldName','type','key','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','where','pick','filter','merge','options','include','findAll','rows','show','params','model','catch','body','update','find','addConditions','Condition','ids','sort','getConditions','Action','addActions','getActions','findOne','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','util','path','sox','to-csv','ejs','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset'];(function(_0x5bbd88,_0xc3e30e){var _0xfce126=function(_0x76919c){while(--_0x76919c){_0x5bbd88['push'](_0x5bbd88['shift']());}};_0xfce126(++_0xc3e30e);}(_0xff0f,0x86));var _0xfff0=function(_0x39c336,_0x288130){_0x39c336=_0x39c336-0x0;var _0x450ddf=_0xff0f[_0x39c336];return _0x450ddf;};'use strict';var pdf=require(_0xfff0('0x0'));var emlformat=require(_0xfff0('0x1'));var rimraf=require(_0xfff0('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0xfff0('0x3'));var rp=require(_0xfff0('0x4'));var moment=require(_0xfff0('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xfff0('0x6'));var path=require(_0xfff0('0x7'));var sox=require(_0xfff0('0x8'));var csv=require(_0xfff0('0x9'));var ejs=require(_0xfff0('0xa'));var fs=require('fs');var _=require(_0xfff0('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xfff0('0xc'));var deskjs=require(_0xfff0('0xd'));var toCsv=require(_0xfff0('0x9'));var querystring=require(_0xfff0('0xe'));var Papa=require(_0xfff0('0xf'));var Redis=require(_0xfff0('0x10'));var authService=require(_0xfff0('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xfff0('0x12'));var hardwareService=require(_0xfff0('0x13'));var logger=require(_0xfff0('0x14'))('api');var utils=require(_0xfff0('0x15'));var config=require(_0xfff0('0x16'));var db=require(_0xfff0('0x17'))['db'];function respondWithStatusCode(_0x1e693a,_0x312e00){_0x312e00=_0x312e00||0xcc;return function(_0x540a76){if(_0x540a76){return _0x1e693a[_0xfff0('0x18')](_0x312e00);}return _0x1e693a[_0xfff0('0x19')](_0x312e00)[_0xfff0('0x1a')]();};}function respondWithResult(_0x506618,_0x431332){_0x431332=_0x431332||0xc8;return function(_0x118d2c){if(_0x118d2c){return _0x506618['status'](_0x431332)[_0xfff0('0x1b')](_0x118d2c);}};}function respondWithFilteredResult(_0x2b0612,_0xaca040){return function(_0x49ed39){if(_0x49ed39){var _0x213390=_0x49ed39[_0xfff0('0x1c')],_0x4c693e=_0xaca040[_0xfff0('0x1d')],_0x35751c=_0xaca040[_0xfff0('0x1d')]+_0xaca040[_0xfff0('0x1e')],_0x26eb59;if(_0x35751c>=_0x213390){_0x35751c=_0x213390;_0x26eb59=0xc8;}else{_0x26eb59=0xce;}_0x2b0612[_0xfff0('0x19')](_0x26eb59);return _0x2b0612[_0xfff0('0x1f')](_0xfff0('0x20'),_0x4c693e+'-'+_0x35751c+'/'+_0x213390)['json'](_0x49ed39);}return null;};}function patchUpdates(_0x108390){return function(_0x2a9193){try{jsonpatch[_0xfff0('0x21')](_0x2a9193,_0x108390,!![]);}catch(_0x1d1eb5){return BPromise[_0xfff0('0x22')](_0x1d1eb5);}return _0x2a9193[_0xfff0('0x23')]();};}function saveUpdates(_0x59c999,_0x423f80){return function(_0x633956){if(_0x633956){return _0x633956['update'](_0x59c999)[_0xfff0('0x24')](function(_0x2b334c){return _0x2b334c;});}return null;};}function removeEntity(_0x4bea35,_0x1341b1){return function(_0x55039d){if(_0x55039d){return _0x55039d[_0xfff0('0x25')]()['then'](function(){_0x4bea35[_0xfff0('0x19')](0xcc)[_0xfff0('0x1a')]();});}};}function handleEntityNotFound(_0x490034,_0x3978c7){return function(_0x45a1b6){if(!_0x45a1b6){_0x490034[_0xfff0('0x18')](0x194);}return _0x45a1b6;};}function handleError(_0x2ba507,_0xd48f2d){_0xd48f2d=_0xd48f2d||0x1f4;return function(_0x399bd2){logger[_0xfff0('0x26')](_0x399bd2[_0xfff0('0x27')]);if(_0x399bd2[_0xfff0('0x28')]){delete _0x399bd2[_0xfff0('0x28')];}_0x2ba507[_0xfff0('0x19')](_0xd48f2d)[_0xfff0('0x29')](_0x399bd2);};}exports['index']=function(_0x98fd1c,_0x3dce43){var _0x3a06f2={},_0x394898={},_0x7102b2={'count':0x0,'rows':[]};var _0xb144f4=_[_0xfff0('0x2a')](db[_0xfff0('0x2b')][_0xfff0('0x2c')],function(_0x210a4e){return{'name':_0x210a4e[_0xfff0('0x2d')],'type':_0x210a4e[_0xfff0('0x2e')][_0xfff0('0x2f')]};});_0x394898['model']=_[_0xfff0('0x2a')](_0xb144f4,_0xfff0('0x28'));_0x394898[_0xfff0('0x30')]=_[_0xfff0('0x31')](_0x98fd1c[_0xfff0('0x30')]);_0x394898[_0xfff0('0x32')]=_[_0xfff0('0x33')](_0x394898['model'],_0x394898['query']);_0x3a06f2[_0xfff0('0x34')]=_[_0xfff0('0x33')](_0x394898['model'],qs[_0xfff0('0x35')](_0x98fd1c[_0xfff0('0x30')][_0xfff0('0x35')]));_0x3a06f2[_0xfff0('0x34')]=_0x3a06f2['attributes'][_0xfff0('0x36')]?_0x3a06f2[_0xfff0('0x34')]:_0x394898['model'];if(!_0x98fd1c[_0xfff0('0x30')][_0xfff0('0x37')](_0xfff0('0x38'))){_0x3a06f2['limit']=qs[_0xfff0('0x1e')](_0x98fd1c[_0xfff0('0x30')][_0xfff0('0x1e')]);_0x3a06f2[_0xfff0('0x1d')]=qs['offset'](_0x98fd1c[_0xfff0('0x30')][_0xfff0('0x1d')]);}_0x3a06f2[_0xfff0('0x39')]=qs['sort'](_0x98fd1c[_0xfff0('0x30')]['sort']);_0x3a06f2[_0xfff0('0x3a')]=qs[_0xfff0('0x32')](_[_0xfff0('0x3b')](_0x98fd1c[_0xfff0('0x30')],_0x394898[_0xfff0('0x32')]),_0xb144f4);if(_0x98fd1c[_0xfff0('0x30')][_0xfff0('0x3c')]){_0x3a06f2['where']=_[_0xfff0('0x3d')](_0x3a06f2[_0xfff0('0x3a')],{'$or':_['map'](_0xb144f4,function(_0x3a0a83){if(_0x3a0a83[_0xfff0('0x2e')]!=='VIRTUAL'){var _0x3b86d={};_0x3b86d[_0x3a0a83[_0xfff0('0x28')]]={'$like':'%'+_0x98fd1c[_0xfff0('0x30')][_0xfff0('0x3c')]+'%'};return _0x3b86d;}})});}_0x3a06f2=_[_0xfff0('0x3d')]({},_0x3a06f2,_0x98fd1c[_0xfff0('0x3e')]);var _0x16426f={'where':_0x3a06f2[_0xfff0('0x3a')]};return db[_0xfff0('0x2b')][_0xfff0('0x1c')](_0x16426f)[_0xfff0('0x24')](function(_0x2612b9){_0x7102b2['count']=_0x2612b9;if(_0x98fd1c[_0xfff0('0x30')]['includeAll']){_0x3a06f2[_0xfff0('0x3f')]=[{'all':!![]}];}return db['Automation'][_0xfff0('0x40')](_0x3a06f2);})[_0xfff0('0x24')](function(_0x76006d){_0x7102b2[_0xfff0('0x41')]=_0x76006d;return _0x7102b2;})[_0xfff0('0x24')](respondWithFilteredResult(_0x3dce43,_0x3a06f2))['catch'](handleError(_0x3dce43,null));};exports[_0xfff0('0x42')]=function(_0x1e6d59,_0x4c707c){var _0x2e228f={'raw':![],'where':{'id':_0x1e6d59[_0xfff0('0x43')]['id']}},_0x3444ca={};_0x3444ca[_0xfff0('0x44')]=_[_0xfff0('0x31')](db['Automation']['rawAttributes']);_0x3444ca[_0xfff0('0x30')]=_[_0xfff0('0x31')](_0x1e6d59[_0xfff0('0x30')]);_0x3444ca[_0xfff0('0x32')]=_[_0xfff0('0x33')](_0x3444ca[_0xfff0('0x44')],_0x3444ca['query']);_0x2e228f[_0xfff0('0x34')]=_['intersection'](_0x3444ca[_0xfff0('0x44')],qs[_0xfff0('0x35')](_0x1e6d59[_0xfff0('0x30')][_0xfff0('0x35')]));_0x2e228f[_0xfff0('0x34')]=_0x2e228f[_0xfff0('0x34')]['length']?_0x2e228f['attributes']:_0x3444ca[_0xfff0('0x44')];if(_0x1e6d59['query']['includeAll']){_0x2e228f[_0xfff0('0x3f')]=[{'all':!![]}];}_0x2e228f=_[_0xfff0('0x3d')]({},_0x2e228f,_0x1e6d59[_0xfff0('0x3e')]);return db[_0xfff0('0x2b')]['find'](_0x2e228f)[_0xfff0('0x24')](handleEntityNotFound(_0x4c707c,null))[_0xfff0('0x24')](respondWithResult(_0x4c707c,null))[_0xfff0('0x45')](handleError(_0x4c707c,null));};exports['create']=function(_0x43bc60,_0x5aa2cf){return db[_0xfff0('0x2b')]['create'](_0x43bc60[_0xfff0('0x46')],{})[_0xfff0('0x24')](respondWithResult(_0x5aa2cf,0xc9))['catch'](handleError(_0x5aa2cf,null));};exports[_0xfff0('0x47')]=function(_0x40d36f,_0x37c83e){if(_0x40d36f[_0xfff0('0x46')]['id']){delete _0x40d36f[_0xfff0('0x46')]['id'];}return db[_0xfff0('0x2b')][_0xfff0('0x48')]({'where':{'id':_0x40d36f['params']['id']}})[_0xfff0('0x24')](handleEntityNotFound(_0x37c83e,null))[_0xfff0('0x24')](saveUpdates(_0x40d36f[_0xfff0('0x46')],null))[_0xfff0('0x24')](respondWithResult(_0x37c83e,null))[_0xfff0('0x45')](handleError(_0x37c83e,null));};exports[_0xfff0('0x25')]=function(_0x530259,_0x30d0a7){return db[_0xfff0('0x2b')]['find']({'where':{'id':_0x530259[_0xfff0('0x43')]['id']}})[_0xfff0('0x24')](handleEntityNotFound(_0x30d0a7,null))['then'](removeEntity(_0x30d0a7,null))[_0xfff0('0x45')](handleError(_0x30d0a7,null));};exports[_0xfff0('0x49')]=function(_0x1478a6,_0x4a5073,_0x1c197b){return db[_0xfff0('0x4a')][_0xfff0('0x48')]({'where':{'id':_0x1478a6[_0xfff0('0x43')]['id']}})['then'](handleEntityNotFound(_0x4a5073,null))[_0xfff0('0x24')](function(_0x78948b){if(_0x78948b){return _0x78948b[_0xfff0('0x49')](_0x1478a6[_0xfff0('0x46')][_0xfff0('0x4b')],_['omit'](_0x1478a6['body'],[_0xfff0('0x4b'),'id'])||{});}})[_0xfff0('0x24')](respondWithResult(_0x4a5073,null))['catch'](handleError(_0x4a5073,null));};exports['getConditions']=function(_0x5d9643,_0x18c333,_0x4bea86){var _0x150a4e={};var _0x3abe71={};var _0x40e5e1;var _0x4468dc;return db[_0xfff0('0x2b')]['findOne']({'where':{'id':_0x5d9643[_0xfff0('0x43')]['id']}})[_0xfff0('0x24')](handleEntityNotFound(_0x18c333,null))[_0xfff0('0x24')](function(_0x20f18e){if(_0x20f18e){_0x40e5e1=_0x20f18e;_0x3abe71[_0xfff0('0x44')]=_[_0xfff0('0x31')](db[_0xfff0('0x4a')][_0xfff0('0x2c')]);_0x3abe71[_0xfff0('0x30')]=_[_0xfff0('0x31')](_0x5d9643['query']);_0x3abe71[_0xfff0('0x32')]=_['intersection'](_0x3abe71['model'],_0x3abe71[_0xfff0('0x30')]);_0x150a4e['attributes']=_['intersection'](_0x3abe71['model'],qs[_0xfff0('0x35')](_0x5d9643[_0xfff0('0x30')][_0xfff0('0x35')]));_0x150a4e[_0xfff0('0x34')]=_0x150a4e[_0xfff0('0x34')][_0xfff0('0x36')]?_0x150a4e[_0xfff0('0x34')]:_0x3abe71[_0xfff0('0x44')];_0x150a4e[_0xfff0('0x39')]=qs[_0xfff0('0x4c')](_0x5d9643[_0xfff0('0x30')][_0xfff0('0x4c')]);_0x150a4e[_0xfff0('0x3a')]=qs[_0xfff0('0x32')](_[_0xfff0('0x3b')](_0x5d9643['query'],_0x3abe71['filters']));if(_0x5d9643[_0xfff0('0x30')][_0xfff0('0x3c')]){_0x150a4e[_0xfff0('0x3a')]=_[_0xfff0('0x3d')](_0x150a4e['where'],{'$or':_[_0xfff0('0x2a')](_0x150a4e[_0xfff0('0x34')],function(_0x57bb37){var _0x32e785={};_0x32e785[_0x57bb37]={'$like':'%'+_0x5d9643[_0xfff0('0x30')][_0xfff0('0x3c')]+'%'};return _0x32e785;})});}_0x150a4e=_['merge']({},_0x150a4e,_0x5d9643[_0xfff0('0x3e')]);return _0x40e5e1['getConditions'](_0x150a4e);}})[_0xfff0('0x24')](function(_0x363692){if(_0x363692){_0x4468dc=_0x363692[_0xfff0('0x36')];if(!_0x5d9643['query']['hasOwnProperty'](_0xfff0('0x38'))){_0x150a4e[_0xfff0('0x1e')]=qs[_0xfff0('0x1e')](_0x5d9643['query'][_0xfff0('0x1e')]);_0x150a4e['offset']=qs[_0xfff0('0x1d')](_0x5d9643[_0xfff0('0x30')][_0xfff0('0x1d')]);}return _0x40e5e1[_0xfff0('0x4d')](_0x150a4e);}})[_0xfff0('0x24')](function(_0x2abe66){if(_0x2abe66){return _0x2abe66?{'count':_0x4468dc,'rows':_0x2abe66}:null;}})[_0xfff0('0x24')](respondWithResult(_0x18c333,null))[_0xfff0('0x45')](handleError(_0x18c333,null));};exports['addActions']=function(_0x59a566,_0x3efff9,_0x4a9dc9){return db[_0xfff0('0x4e')][_0xfff0('0x48')]({'where':{'id':_0x59a566['params']['id']}})[_0xfff0('0x24')](handleEntityNotFound(_0x3efff9,null))[_0xfff0('0x24')](function(_0x2b82a5){if(_0x2b82a5){return _0x2b82a5[_0xfff0('0x4f')](_0x59a566[_0xfff0('0x46')][_0xfff0('0x4b')],_['omit'](_0x59a566[_0xfff0('0x46')],['ids','id'])||{});}})[_0xfff0('0x24')](respondWithResult(_0x3efff9,null))[_0xfff0('0x45')](handleError(_0x3efff9,null));};exports[_0xfff0('0x50')]=function(_0x3ebd6c,_0x43f6c8,_0x538c3a){var _0x5b70e1={};var _0x5f3014={};var _0x4aad04;var _0x183ebd;return db[_0xfff0('0x2b')][_0xfff0('0x51')]({'where':{'id':_0x3ebd6c[_0xfff0('0x43')]['id']}})[_0xfff0('0x24')](handleEntityNotFound(_0x43f6c8,null))['then'](function(_0x52ed6c){if(_0x52ed6c){_0x4aad04=_0x52ed6c;_0x5f3014[_0xfff0('0x44')]=_['keys'](db['Action'][_0xfff0('0x2c')]);_0x5f3014[_0xfff0('0x30')]=_['keys'](_0x3ebd6c['query']);_0x5f3014['filters']=_['intersection'](_0x5f3014['model'],_0x5f3014[_0xfff0('0x30')]);_0x5b70e1['attributes']=_[_0xfff0('0x33')](_0x5f3014[_0xfff0('0x44')],qs[_0xfff0('0x35')](_0x3ebd6c[_0xfff0('0x30')][_0xfff0('0x35')]));_0x5b70e1['attributes']=_0x5b70e1[_0xfff0('0x34')][_0xfff0('0x36')]?_0x5b70e1[_0xfff0('0x34')]:_0x5f3014[_0xfff0('0x44')];_0x5b70e1[_0xfff0('0x39')]=qs['sort'](_0x3ebd6c['query']['sort']);_0x5b70e1[_0xfff0('0x3a')]=qs[_0xfff0('0x32')](_['pick'](_0x3ebd6c[_0xfff0('0x30')],_0x5f3014['filters']));if(_0x3ebd6c[_0xfff0('0x30')][_0xfff0('0x3c')]){_0x5b70e1[_0xfff0('0x3a')]=_['merge'](_0x5b70e1['where'],{'$or':_[_0xfff0('0x2a')](_0x5b70e1['attributes'],function(_0x3856b6){var _0x1c3734={};_0x1c3734[_0x3856b6]={'$like':'%'+_0x3ebd6c[_0xfff0('0x30')][_0xfff0('0x3c')]+'%'};return _0x1c3734;})});}_0x5b70e1=_[_0xfff0('0x3d')]({},_0x5b70e1,_0x3ebd6c[_0xfff0('0x3e')]);return _0x4aad04['getActions'](_0x5b70e1);}})[_0xfff0('0x24')](function(_0x1ff0fa){if(_0x1ff0fa){_0x183ebd=_0x1ff0fa[_0xfff0('0x36')];if(!_0x3ebd6c[_0xfff0('0x30')][_0xfff0('0x37')]('nolimit')){_0x5b70e1[_0xfff0('0x1e')]=qs['limit'](_0x3ebd6c['query']['limit']);_0x5b70e1['offset']=qs[_0xfff0('0x1d')](_0x3ebd6c[_0xfff0('0x30')]['offset']);}return _0x4aad04[_0xfff0('0x50')](_0x5b70e1);}})['then'](function(_0xcb0046){if(_0xcb0046){return _0xcb0046?{'count':_0x183ebd,'rows':_0xcb0046}:null;}})['then'](respondWithResult(_0x43f6c8,null))[_0xfff0('0x45')](handleError(_0x43f6c8,null));};
\ No newline at end of file
+var _0x8d89=['fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','end','status','count','offset','limit','set','json','reject','update','destroy','then','error','stack','name','send','index','map','Automation','type','key','model','keys','query','filters','intersection','attributes','fields','sort','pick','filter','where','merge','options','findAll','rows','catch','show','params','rawAttributes','length','includeAll','include','create','body','find','addConditions','Condition','ids','getConditions','order','hasOwnProperty','nolimit','addActions','omit','getActions','Action','html-pdf','eml-format','rimraf'];(function(_0x38537f,_0x252124){var _0x141e23=function(_0x2809b5){while(--_0x2809b5){_0x38537f['push'](_0x38537f['shift']());}};_0x141e23(++_0x252124);}(_0x8d89,0x139));var _0x98d8=function(_0xb217f1,_0x2162f0){_0xb217f1=_0xb217f1-0x0;var _0x458a0a=_0x8d89[_0xb217f1];return _0x458a0a;};'use strict';var pdf=require(_0x98d8('0x0'));var emlformat=require(_0x98d8('0x1'));var rimraf=require(_0x98d8('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x98d8('0x3'));var rp=require(_0x98d8('0x4'));var moment=require(_0x98d8('0x5'));var BPromise=require(_0x98d8('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0x98d8('0x7'));var sox=require(_0x98d8('0x8'));var csv=require(_0x98d8('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x98d8('0xa'));var squel=require(_0x98d8('0xb'));var crypto=require('crypto');var jsforce=require(_0x98d8('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x98d8('0x9'));var querystring=require(_0x98d8('0xd'));var Papa=require(_0x98d8('0xe'));var Redis=require(_0x98d8('0xf'));var authService=require(_0x98d8('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x98d8('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x98d8('0x12'))(_0x98d8('0x13'));var utils=require('../../config/utils');var config=require(_0x98d8('0x14'));var db=require(_0x98d8('0x15'))['db'];function respondWithStatusCode(_0x244e04,_0x2b9bc4){_0x2b9bc4=_0x2b9bc4||0xcc;return function(_0x2ecdfe){if(_0x2ecdfe){return _0x244e04[_0x98d8('0x16')](_0x2b9bc4);}return _0x244e04['status'](_0x2b9bc4)[_0x98d8('0x17')]();};}function respondWithResult(_0x1d83dc,_0x5c9bde){_0x5c9bde=_0x5c9bde||0xc8;return function(_0x87ee48){if(_0x87ee48){return _0x1d83dc[_0x98d8('0x18')](_0x5c9bde)['json'](_0x87ee48);}};}function respondWithFilteredResult(_0x4aeb99,_0x3270ba){return function(_0x5b38f5){if(_0x5b38f5){var _0x4ebe3b=_0x5b38f5[_0x98d8('0x19')],_0x3db913=_0x3270ba['offset'],_0x55f43f=_0x3270ba[_0x98d8('0x1a')]+_0x3270ba[_0x98d8('0x1b')],_0x179a72;if(_0x55f43f>=_0x4ebe3b){_0x55f43f=_0x4ebe3b;_0x179a72=0xc8;}else{_0x179a72=0xce;}_0x4aeb99['status'](_0x179a72);return _0x4aeb99[_0x98d8('0x1c')]('Content-Range',_0x3db913+'-'+_0x55f43f+'/'+_0x4ebe3b)[_0x98d8('0x1d')](_0x5b38f5);}return null;};}function patchUpdates(_0x30f4fc){return function(_0x581aa9){try{jsonpatch['apply'](_0x581aa9,_0x30f4fc,!![]);}catch(_0x3e6900){return BPromise[_0x98d8('0x1e')](_0x3e6900);}return _0x581aa9['save']();};}function saveUpdates(_0x232c74,_0x3bb964){return function(_0x5521d5){if(_0x5521d5){return _0x5521d5[_0x98d8('0x1f')](_0x232c74)['then'](function(_0x1754c0){return _0x1754c0;});}return null;};}function removeEntity(_0x2eab93,_0x55c35b){return function(_0x48a54b){if(_0x48a54b){return _0x48a54b[_0x98d8('0x20')]()[_0x98d8('0x21')](function(){_0x2eab93[_0x98d8('0x18')](0xcc)[_0x98d8('0x17')]();});}};}function handleEntityNotFound(_0x5c37b4,_0x5311ed){return function(_0x2b51f7){if(!_0x2b51f7){_0x5c37b4[_0x98d8('0x16')](0x194);}return _0x2b51f7;};}function handleError(_0x40cddd,_0x5d2d86){_0x5d2d86=_0x5d2d86||0x1f4;return function(_0x3708a4){logger[_0x98d8('0x22')](_0x3708a4[_0x98d8('0x23')]);if(_0x3708a4['name']){delete _0x3708a4[_0x98d8('0x24')];}_0x40cddd['status'](_0x5d2d86)[_0x98d8('0x25')](_0x3708a4);};}exports[_0x98d8('0x26')]=function(_0x4db782,_0x1c5ace){var _0x4f6928={},_0x7a4020={},_0x12a874={'count':0x0,'rows':[]};var _0x24af9d=_[_0x98d8('0x27')](db[_0x98d8('0x28')]['rawAttributes'],function(_0x179ec8){return{'name':_0x179ec8['fieldName'],'type':_0x179ec8[_0x98d8('0x29')][_0x98d8('0x2a')]};});_0x7a4020[_0x98d8('0x2b')]=_[_0x98d8('0x27')](_0x24af9d,_0x98d8('0x24'));_0x7a4020['query']=_[_0x98d8('0x2c')](_0x4db782[_0x98d8('0x2d')]);_0x7a4020[_0x98d8('0x2e')]=_[_0x98d8('0x2f')](_0x7a4020[_0x98d8('0x2b')],_0x7a4020[_0x98d8('0x2d')]);_0x4f6928[_0x98d8('0x30')]=_['intersection'](_0x7a4020[_0x98d8('0x2b')],qs[_0x98d8('0x31')](_0x4db782[_0x98d8('0x2d')][_0x98d8('0x31')]));_0x4f6928[_0x98d8('0x30')]=_0x4f6928['attributes']['length']?_0x4f6928[_0x98d8('0x30')]:_0x7a4020[_0x98d8('0x2b')];if(!_0x4db782[_0x98d8('0x2d')]['hasOwnProperty']('nolimit')){_0x4f6928[_0x98d8('0x1b')]=qs[_0x98d8('0x1b')](_0x4db782[_0x98d8('0x2d')][_0x98d8('0x1b')]);_0x4f6928['offset']=qs[_0x98d8('0x1a')](_0x4db782[_0x98d8('0x2d')][_0x98d8('0x1a')]);}_0x4f6928['order']=qs[_0x98d8('0x32')](_0x4db782['query']['sort']);_0x4f6928['where']=qs[_0x98d8('0x2e')](_[_0x98d8('0x33')](_0x4db782['query'],_0x7a4020[_0x98d8('0x2e')]),_0x24af9d);if(_0x4db782[_0x98d8('0x2d')][_0x98d8('0x34')]){_0x4f6928[_0x98d8('0x35')]=_[_0x98d8('0x36')](_0x4f6928[_0x98d8('0x35')],{'$or':_['map'](_0x24af9d,function(_0x1c3cb0){if(_0x1c3cb0[_0x98d8('0x29')]!=='VIRTUAL'){var _0x54a43c={};_0x54a43c[_0x1c3cb0[_0x98d8('0x24')]]={'$like':'%'+_0x4db782[_0x98d8('0x2d')][_0x98d8('0x34')]+'%'};return _0x54a43c;}})});}_0x4f6928=_['merge']({},_0x4f6928,_0x4db782[_0x98d8('0x37')]);var _0xf0ab79={'where':_0x4f6928[_0x98d8('0x35')]};return db[_0x98d8('0x28')][_0x98d8('0x19')](_0xf0ab79)[_0x98d8('0x21')](function(_0x36f1c8){_0x12a874[_0x98d8('0x19')]=_0x36f1c8;if(_0x4db782[_0x98d8('0x2d')]['includeAll']){_0x4f6928['include']=[{'all':!![]}];}return db[_0x98d8('0x28')][_0x98d8('0x38')](_0x4f6928);})[_0x98d8('0x21')](function(_0x386518){_0x12a874[_0x98d8('0x39')]=_0x386518;return _0x12a874;})[_0x98d8('0x21')](respondWithFilteredResult(_0x1c5ace,_0x4f6928))[_0x98d8('0x3a')](handleError(_0x1c5ace,null));};exports[_0x98d8('0x3b')]=function(_0x54073d,_0x3f5ae0){var _0x1e5342={'raw':![],'where':{'id':_0x54073d[_0x98d8('0x3c')]['id']}},_0x156b35={};_0x156b35[_0x98d8('0x2b')]=_[_0x98d8('0x2c')](db[_0x98d8('0x28')][_0x98d8('0x3d')]);_0x156b35[_0x98d8('0x2d')]=_[_0x98d8('0x2c')](_0x54073d[_0x98d8('0x2d')]);_0x156b35['filters']=_[_0x98d8('0x2f')](_0x156b35[_0x98d8('0x2b')],_0x156b35[_0x98d8('0x2d')]);_0x1e5342[_0x98d8('0x30')]=_[_0x98d8('0x2f')](_0x156b35[_0x98d8('0x2b')],qs['fields'](_0x54073d[_0x98d8('0x2d')][_0x98d8('0x31')]));_0x1e5342[_0x98d8('0x30')]=_0x1e5342['attributes'][_0x98d8('0x3e')]?_0x1e5342['attributes']:_0x156b35[_0x98d8('0x2b')];if(_0x54073d['query'][_0x98d8('0x3f')]){_0x1e5342[_0x98d8('0x40')]=[{'all':!![]}];}_0x1e5342=_['merge']({},_0x1e5342,_0x54073d[_0x98d8('0x37')]);return db['Automation']['find'](_0x1e5342)[_0x98d8('0x21')](handleEntityNotFound(_0x3f5ae0,null))[_0x98d8('0x21')](respondWithResult(_0x3f5ae0,null))[_0x98d8('0x3a')](handleError(_0x3f5ae0,null));};exports[_0x98d8('0x41')]=function(_0x84547c,_0x1b41d3){return db['Automation']['create'](_0x84547c[_0x98d8('0x42')],{})['then'](respondWithResult(_0x1b41d3,0xc9))['catch'](handleError(_0x1b41d3,null));};exports['update']=function(_0x3ffbe9,_0x3fb3dd){if(_0x3ffbe9['body']['id']){delete _0x3ffbe9['body']['id'];}return db[_0x98d8('0x28')][_0x98d8('0x43')]({'where':{'id':_0x3ffbe9['params']['id']}})[_0x98d8('0x21')](handleEntityNotFound(_0x3fb3dd,null))[_0x98d8('0x21')](saveUpdates(_0x3ffbe9[_0x98d8('0x42')],null))['then'](respondWithResult(_0x3fb3dd,null))[_0x98d8('0x3a')](handleError(_0x3fb3dd,null));};exports['destroy']=function(_0x5b7e77,_0x4912c4){return db['Automation'][_0x98d8('0x43')]({'where':{'id':_0x5b7e77['params']['id']}})['then'](handleEntityNotFound(_0x4912c4,null))[_0x98d8('0x21')](removeEntity(_0x4912c4,null))[_0x98d8('0x3a')](handleError(_0x4912c4,null));};exports[_0x98d8('0x44')]=function(_0x2603fa,_0x1b3381,_0x20c057){return db[_0x98d8('0x45')][_0x98d8('0x43')]({'where':{'id':_0x2603fa[_0x98d8('0x3c')]['id']}})['then'](handleEntityNotFound(_0x1b3381,null))[_0x98d8('0x21')](function(_0x516eee){if(_0x516eee){return _0x516eee[_0x98d8('0x44')](_0x2603fa[_0x98d8('0x42')]['ids'],_['omit'](_0x2603fa[_0x98d8('0x42')],[_0x98d8('0x46'),'id'])||{});}})[_0x98d8('0x21')](respondWithResult(_0x1b3381,null))['catch'](handleError(_0x1b3381,null));};exports[_0x98d8('0x47')]=function(_0x2311df,_0x4ee9cd,_0x4bce17){var _0x93b75f={};var _0x33c0e6={};var _0x593683;var _0x59df3d;return db[_0x98d8('0x28')]['findOne']({'where':{'id':_0x2311df[_0x98d8('0x3c')]['id']}})[_0x98d8('0x21')](handleEntityNotFound(_0x4ee9cd,null))[_0x98d8('0x21')](function(_0x5f0c7b){if(_0x5f0c7b){_0x593683=_0x5f0c7b;_0x33c0e6['model']=_['keys'](db[_0x98d8('0x45')][_0x98d8('0x3d')]);_0x33c0e6[_0x98d8('0x2d')]=_['keys'](_0x2311df[_0x98d8('0x2d')]);_0x33c0e6[_0x98d8('0x2e')]=_['intersection'](_0x33c0e6['model'],_0x33c0e6[_0x98d8('0x2d')]);_0x93b75f[_0x98d8('0x30')]=_['intersection'](_0x33c0e6['model'],qs[_0x98d8('0x31')](_0x2311df[_0x98d8('0x2d')][_0x98d8('0x31')]));_0x93b75f[_0x98d8('0x30')]=_0x93b75f[_0x98d8('0x30')][_0x98d8('0x3e')]?_0x93b75f['attributes']:_0x33c0e6[_0x98d8('0x2b')];_0x93b75f[_0x98d8('0x48')]=qs[_0x98d8('0x32')](_0x2311df[_0x98d8('0x2d')]['sort']);_0x93b75f[_0x98d8('0x35')]=qs['filters'](_[_0x98d8('0x33')](_0x2311df['query'],_0x33c0e6[_0x98d8('0x2e')]));if(_0x2311df[_0x98d8('0x2d')][_0x98d8('0x34')]){_0x93b75f[_0x98d8('0x35')]=_[_0x98d8('0x36')](_0x93b75f['where'],{'$or':_[_0x98d8('0x27')](_0x93b75f[_0x98d8('0x30')],function(_0x23af61){var _0x5b93ca={};_0x5b93ca[_0x23af61]={'$like':'%'+_0x2311df[_0x98d8('0x2d')][_0x98d8('0x34')]+'%'};return _0x5b93ca;})});}_0x93b75f=_['merge']({},_0x93b75f,_0x2311df[_0x98d8('0x37')]);return _0x593683[_0x98d8('0x47')](_0x93b75f);}})[_0x98d8('0x21')](function(_0x477f07){if(_0x477f07){_0x59df3d=_0x477f07[_0x98d8('0x3e')];if(!_0x2311df['query'][_0x98d8('0x49')](_0x98d8('0x4a'))){_0x93b75f['limit']=qs['limit'](_0x2311df[_0x98d8('0x2d')][_0x98d8('0x1b')]);_0x93b75f[_0x98d8('0x1a')]=qs['offset'](_0x2311df[_0x98d8('0x2d')][_0x98d8('0x1a')]);}return _0x593683[_0x98d8('0x47')](_0x93b75f);}})[_0x98d8('0x21')](function(_0x4fc4e6){if(_0x4fc4e6){return _0x4fc4e6?{'count':_0x59df3d,'rows':_0x4fc4e6}:null;}})['then'](respondWithResult(_0x4ee9cd,null))['catch'](handleError(_0x4ee9cd,null));};exports[_0x98d8('0x4b')]=function(_0x56c146,_0x221291,_0x24d039){return db['Action'][_0x98d8('0x43')]({'where':{'id':_0x56c146[_0x98d8('0x3c')]['id']}})[_0x98d8('0x21')](handleEntityNotFound(_0x221291,null))['then'](function(_0x3acac0){if(_0x3acac0){return _0x3acac0[_0x98d8('0x4b')](_0x56c146[_0x98d8('0x42')][_0x98d8('0x46')],_[_0x98d8('0x4c')](_0x56c146[_0x98d8('0x42')],[_0x98d8('0x46'),'id'])||{});}})[_0x98d8('0x21')](respondWithResult(_0x221291,null))['catch'](handleError(_0x221291,null));};exports[_0x98d8('0x4d')]=function(_0x2cff4c,_0x4ef913,_0x40a317){var _0x536100={};var _0x29f949={};var _0x10ded8;var _0x153167;return db['Automation']['findOne']({'where':{'id':_0x2cff4c['params']['id']}})[_0x98d8('0x21')](handleEntityNotFound(_0x4ef913,null))[_0x98d8('0x21')](function(_0x58f799){if(_0x58f799){_0x10ded8=_0x58f799;_0x29f949[_0x98d8('0x2b')]=_[_0x98d8('0x2c')](db[_0x98d8('0x4e')][_0x98d8('0x3d')]);_0x29f949[_0x98d8('0x2d')]=_[_0x98d8('0x2c')](_0x2cff4c[_0x98d8('0x2d')]);_0x29f949[_0x98d8('0x2e')]=_[_0x98d8('0x2f')](_0x29f949[_0x98d8('0x2b')],_0x29f949['query']);_0x536100['attributes']=_[_0x98d8('0x2f')](_0x29f949['model'],qs[_0x98d8('0x31')](_0x2cff4c['query'][_0x98d8('0x31')]));_0x536100[_0x98d8('0x30')]=_0x536100[_0x98d8('0x30')]['length']?_0x536100[_0x98d8('0x30')]:_0x29f949[_0x98d8('0x2b')];_0x536100[_0x98d8('0x48')]=qs[_0x98d8('0x32')](_0x2cff4c[_0x98d8('0x2d')][_0x98d8('0x32')]);_0x536100[_0x98d8('0x35')]=qs[_0x98d8('0x2e')](_[_0x98d8('0x33')](_0x2cff4c[_0x98d8('0x2d')],_0x29f949['filters']));if(_0x2cff4c[_0x98d8('0x2d')]['filter']){_0x536100[_0x98d8('0x35')]=_[_0x98d8('0x36')](_0x536100[_0x98d8('0x35')],{'$or':_[_0x98d8('0x27')](_0x536100[_0x98d8('0x30')],function(_0x133760){var _0x1e5599={};_0x1e5599[_0x133760]={'$like':'%'+_0x2cff4c[_0x98d8('0x2d')][_0x98d8('0x34')]+'%'};return _0x1e5599;})});}_0x536100=_[_0x98d8('0x36')]({},_0x536100,_0x2cff4c['options']);return _0x10ded8['getActions'](_0x536100);}})['then'](function(_0x19303f){if(_0x19303f){_0x153167=_0x19303f[_0x98d8('0x3e')];if(!_0x2cff4c[_0x98d8('0x2d')][_0x98d8('0x49')](_0x98d8('0x4a'))){_0x536100['limit']=qs[_0x98d8('0x1b')](_0x2cff4c[_0x98d8('0x2d')][_0x98d8('0x1b')]);_0x536100[_0x98d8('0x1a')]=qs[_0x98d8('0x1a')](_0x2cff4c[_0x98d8('0x2d')][_0x98d8('0x1a')]);}return _0x10ded8['getActions'](_0x536100);}})[_0x98d8('0x21')](function(_0x35eee5){if(_0x35eee5){return _0x35eee5?{'count':_0x153167,'rows':_0x35eee5}:null;}})[_0x98d8('0x21')](respondWithResult(_0x4ef913,null))[_0x98d8('0x3a')](handleError(_0x4ef913,null));};
\ No newline at end of file
diff --git a/server/api/automation/automation.model.js b/server/api/automation/automation.model.js
index cb33b63..33b5103 100644
--- a/server/api/automation/automation.model.js
+++ b/server/api/automation/automation.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x6aa7=['Automation','tools_automations','lodash','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','define'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x6aa7,0x178));var _0x76aa=function(_0x3c40e0,_0x308c01){_0x3c40e0=_0x3c40e0-0x0;var _0xd9449b=_0x6aa7[_0x3c40e0];return _0xd9449b;};'use strict';var _=require(_0x76aa('0x0'));var util=require('util');var logger=require(_0x76aa('0x1'))(_0x76aa('0x2'));var moment=require(_0x76aa('0x3'));var BPromise=require(_0x76aa('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x76aa('0x5'));var rimraf=require(_0x76aa('0x6'));var config=require(_0x76aa('0x7'));var attributes=require('./automation.attributes');module['exports']=function(_0x1aceaa,_0x4d53f6){return _0x1aceaa[_0x76aa('0x8')](_0x76aa('0x9'),attributes,{'tableName':_0x76aa('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xae24=['../../config/logger','moment','bluebird','rimraf','./automation.attributes','exports','define','Automation','lodash'];(function(_0x5169a4,_0x270720){var _0x17579f=function(_0x23d9c2){while(--_0x23d9c2){_0x5169a4['push'](_0x5169a4['shift']());}};_0x17579f(++_0x270720);}(_0xae24,0x182));var _0x4ae2=function(_0x2ad8f6,_0x182da9){_0x2ad8f6=_0x2ad8f6-0x0;var _0xb4a88f=_0xae24[_0x2ad8f6];return _0xb4a88f;};'use strict';var _=require(_0x4ae2('0x0'));var util=require('util');var logger=require(_0x4ae2('0x1'))('api');var moment=require(_0x4ae2('0x2'));var BPromise=require(_0x4ae2('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x4ae2('0x4'));var config=require('../../config/environment');var attributes=require(_0x4ae2('0x5'));module[_0x4ae2('0x6')]=function(_0x20c85c,_0x3e6055){return _0x20c85c[_0x4ae2('0x7')](_0x4ae2('0x8'),attributes,{'tableName':'tools_automations','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/automation/automation.rpc.js b/server/api/automation/automation.rpc.js
index ecf0368..476d38c 100644
--- a/server/api/automation/automation.rpc.js
+++ b/server/api/automation/automation.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x3162=['result','catch','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','info','Automation,\x20%s,\x20%s','debug','Automation,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message'];(function(_0x328fe8,_0x3959b4){var _0x28eab1=function(_0x5b2053){while(--_0x5b2053){_0x328fe8['push'](_0x328fe8['shift']());}};_0x28eab1(++_0x3959b4);}(_0x3162,0x18e));var _0x2316=function(_0x41e3e5,_0x441240){_0x41e3e5=_0x41e3e5-0x0;var _0x4b5b5c=_0x3162[_0x41e3e5];return _0x4b5b5c;};'use strict';var _=require(_0x2316('0x0'));var util=require(_0x2316('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x2316('0x2'));var fs=require('fs');var Redis=require(_0x2316('0x3'));var db=require(_0x2316('0x4'))['db'];var utils=require(_0x2316('0x5'));var logger=require(_0x2316('0x6'))(_0x2316('0x7'));var config=require('../../config/environment');var jayson=require(_0x2316('0x8'));var client=jayson[_0x2316('0x9')][_0x2316('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x44407a,_0x5e6384,_0x27677e){return new BPromise(function(_0x3a80a5,_0x22ff68){return client[_0x2316('0xb')](_0x44407a,_0x27677e)['then'](function(_0x557b30){logger[_0x2316('0xc')](_0x2316('0xd'),_0x5e6384,'request\x20sent');logger[_0x2316('0xe')](_0x2316('0xf'),_0x5e6384,_0x2316('0x10'),JSON[_0x2316('0x11')](_0x557b30));if(_0x557b30[_0x2316('0x12')]){if(_0x557b30['error']['code']===0x1f4){logger[_0x2316('0x12')](_0x2316('0xd'),_0x5e6384,_0x557b30[_0x2316('0x12')][_0x2316('0x13')]);return _0x22ff68(_0x557b30[_0x2316('0x12')]['message']);}logger[_0x2316('0x12')](_0x2316('0xd'),_0x5e6384,_0x557b30['error']['message']);return _0x3a80a5(_0x557b30[_0x2316('0x12')][_0x2316('0x13')]);}else{logger[_0x2316('0xc')](_0x2316('0xd'),_0x5e6384,_0x2316('0x10'));_0x3a80a5(_0x557b30[_0x2316('0x14')]['message']);}})[_0x2316('0x15')](function(_0x234e4f){logger[_0x2316('0x12')]('Automation,\x20%s,\x20%s',_0x5e6384,_0x234e4f);_0x22ff68(_0x234e4f);});});}
\ No newline at end of file
+var _0x8fcd=['Automation,\x20%s,\x20%s','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','Automation,\x20%s,\x20%s,\x20%s','stringify','code','error'];(function(_0x3f6565,_0x12a8bb){var _0x4abd23=function(_0x56dce7){while(--_0x56dce7){_0x3f6565['push'](_0x3f6565['shift']());}};_0x4abd23(++_0x12a8bb);}(_0x8fcd,0xf4));var _0xd8fc=function(_0x3fff1c,_0x1b137c){_0x3fff1c=_0x3fff1c-0x0;var _0x130243=_0x8fcd[_0x3fff1c];return _0x130243;};'use strict';var _=require(_0xd8fc('0x0'));var util=require(_0xd8fc('0x1'));var moment=require('moment');var BPromise=require(_0xd8fc('0x2'));var rs=require(_0xd8fc('0x3'));var fs=require('fs');var Redis=require(_0xd8fc('0x4'));var db=require(_0xd8fc('0x5'))['db'];var utils=require(_0xd8fc('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0xd8fc('0x7'));var jayson=require(_0xd8fc('0x8'));var client=jayson[_0xd8fc('0x9')][_0xd8fc('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x58d799,_0x2aec47,_0x4a0220){return new BPromise(function(_0x2f4559,_0x5b7392){return client[_0xd8fc('0xb')](_0x58d799,_0x4a0220)[_0xd8fc('0xc')](function(_0x3e9c49){logger[_0xd8fc('0xd')]('Automation,\x20%s,\x20%s',_0x2aec47,_0xd8fc('0xe'));logger[_0xd8fc('0xf')](_0xd8fc('0x10'),_0x2aec47,_0xd8fc('0xe'),JSON[_0xd8fc('0x11')](_0x3e9c49));if(_0x3e9c49['error']){if(_0x3e9c49['error'][_0xd8fc('0x12')]===0x1f4){logger[_0xd8fc('0x13')](_0xd8fc('0x14'),_0x2aec47,_0x3e9c49['error']['message']);return _0x5b7392(_0x3e9c49['error'][_0xd8fc('0x15')]);}logger['error'](_0xd8fc('0x14'),_0x2aec47,_0x3e9c49[_0xd8fc('0x13')]['message']);return _0x2f4559(_0x3e9c49[_0xd8fc('0x13')][_0xd8fc('0x15')]);}else{logger[_0xd8fc('0xd')](_0xd8fc('0x14'),_0x2aec47,_0xd8fc('0xe'));_0x2f4559(_0x3e9c49[_0xd8fc('0x16')][_0xd8fc('0x15')]);}})[_0xd8fc('0x17')](function(_0x45eb2){logger[_0xd8fc('0x13')]('Automation,\x20%s,\x20%s',_0x2aec47,_0x45eb2);_0x5b7392(_0x45eb2);});});}
\ No newline at end of file
diff --git a/server/api/automation/index.js b/server/api/automation/index.js
index affa529..b4e37ac 100644
--- a/server/api/automation/index.js
+++ b/server/api/automation/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x3080=['/:id/conditions','getConditions','/:id/actions','post','create','addConditions','addActions','put','update','destroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./automation.controller','get','index','/:id','isAuthenticated','show'];(function(_0x2151d7,_0x2f0103){var _0x28c45b=function(_0x280eaa){while(--_0x280eaa){_0x2151d7['push'](_0x2151d7['shift']());}};_0x28c45b(++_0x2f0103);}(_0x3080,0x1e6));var _0x0308=function(_0x10b615,_0x20b8e4){_0x10b615=_0x10b615-0x0;var _0xd9c301=_0x3080[_0x10b615];return _0xd9c301;};'use strict';var multer=require(_0x0308('0x0'));var util=require(_0x0308('0x1'));var path=require(_0x0308('0x2'));var timeout=require(_0x0308('0x3'));var express=require('express');var router=express[_0x0308('0x4')]();var auth=require(_0x0308('0x5'));var interaction=require(_0x0308('0x6'));var config=require(_0x0308('0x7'));var controller=require(_0x0308('0x8'));router[_0x0308('0x9')]('/',auth['isAuthenticated'](),controller[_0x0308('0xa')]);router['get'](_0x0308('0xb'),auth[_0x0308('0xc')](),controller[_0x0308('0xd')]);router['get'](_0x0308('0xe'),auth[_0x0308('0xc')](),controller[_0x0308('0xf')]);router[_0x0308('0x9')](_0x0308('0x10'),auth[_0x0308('0xc')](),controller['getActions']);router[_0x0308('0x11')]('/',auth['isAuthenticated'](),controller[_0x0308('0x12')]);router[_0x0308('0x11')](_0x0308('0xe'),auth[_0x0308('0xc')](),controller[_0x0308('0x13')]);router[_0x0308('0x11')]('/:id/actions',auth['isAuthenticated'](),controller[_0x0308('0x14')]);router[_0x0308('0x15')]('/:id',auth['isAuthenticated'](),controller[_0x0308('0x16')]);router['delete'](_0x0308('0xb'),auth[_0x0308('0xc')](),controller[_0x0308('0x17')]);module[_0x0308('0x18')]=router;
\ No newline at end of file
+var _0xf8eb=['/:id/actions','getActions','post','create','addConditions','addActions','put','delete','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./automation.controller','isAuthenticated','index','get','/:id','show','/:id/conditions','getConditions'];(function(_0x2fae9e,_0x43e068){var _0x3fa1cf=function(_0x4921b0){while(--_0x4921b0){_0x2fae9e['push'](_0x2fae9e['shift']());}};_0x3fa1cf(++_0x43e068);}(_0xf8eb,0x159));var _0xbf8e=function(_0x3cfaff,_0x37f317){_0x3cfaff=_0x3cfaff-0x0;var _0x39b714=_0xf8eb[_0x3cfaff];return _0x39b714;};'use strict';var multer=require(_0xbf8e('0x0'));var util=require(_0xbf8e('0x1'));var path=require(_0xbf8e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xbf8e('0x3')]();var auth=require(_0xbf8e('0x4'));var interaction=require(_0xbf8e('0x5'));var config=require(_0xbf8e('0x6'));var controller=require(_0xbf8e('0x7'));router['get']('/',auth[_0xbf8e('0x8')](),controller[_0xbf8e('0x9')]);router[_0xbf8e('0xa')](_0xbf8e('0xb'),auth[_0xbf8e('0x8')](),controller[_0xbf8e('0xc')]);router[_0xbf8e('0xa')](_0xbf8e('0xd'),auth[_0xbf8e('0x8')](),controller[_0xbf8e('0xe')]);router[_0xbf8e('0xa')](_0xbf8e('0xf'),auth['isAuthenticated'](),controller[_0xbf8e('0x10')]);router[_0xbf8e('0x11')]('/',auth[_0xbf8e('0x8')](),controller[_0xbf8e('0x12')]);router[_0xbf8e('0x11')](_0xbf8e('0xd'),auth[_0xbf8e('0x8')](),controller[_0xbf8e('0x13')]);router['post'](_0xbf8e('0xf'),auth['isAuthenticated'](),controller[_0xbf8e('0x14')]);router[_0xbf8e('0x15')](_0xbf8e('0xb'),auth[_0xbf8e('0x8')](),controller['update']);router[_0xbf8e('0x16')]('/:id',auth[_0xbf8e('0x8')](),controller['destroy']);module[_0xbf8e('0x17')]=router;
\ No newline at end of file
diff --git a/server/api/campaign/campaign.attributes.js b/server/api/campaign/campaign.attributes.js
index 51ea50c..011cf0e 100644
--- a/server/api/campaign/campaign.attributes.js
+++ b/server/api/campaign/campaign.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xda89=['UNSIGNED','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','#Congestion\x20Retry\x20(min:1,\x20max:999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','07:00-22:00,*,*,*','ENUM','always','never','onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Maximum\x20Word\x20Length','DESC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','STRING','name','ivr','BOOLEAN','Active/Disactive\x20Campaign','INTEGER','Max\x20200\x20calls.'];(function(_0x1e3158,_0x2c9751){var _0x4bd943=function(_0x315087){while(--_0x315087){_0x1e3158['push'](_0x1e3158['shift']());}};_0x4bd943(++_0x2c9751);}(_0xda89,0x10a));var _0x9da8=function(_0x172747,_0x1732bd){_0x172747=_0x172747-0x0;var _0x509692=_0xda89[_0x172747];return _0x509692;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x9da8('0x0')],'unique':_0x9da8('0x1'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize['ENUM'](_0x9da8('0x2')),'allowNull':![],'defaultValue':'ivr'},'description':{'type':Sequelize[_0x9da8('0x0')]},'active':{'type':Sequelize[_0x9da8('0x3')],'defaultValue':0x0,'comment':_0x9da8('0x4')},'limitCalls':{'type':Sequelize[_0x9da8('0x5')](0x4)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0x9da8('0x6')},'dialOriginateCallerIdName':{'type':Sequelize[_0x9da8('0x0')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x9da8('0x0')]},'dialOriginateTimeout':{'type':Sequelize[_0x9da8('0x5')](0x3)[_0x9da8('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x9da8('0x8')},'dialCongestionMaxRetry':{'type':Sequelize[_0x9da8('0x5')](0x3)[_0x9da8('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x9da8('0x9')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x9da8('0x5')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialBusyMaxRetry':{'type':Sequelize[_0x9da8('0x5')](0x3)[_0x9da8('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x9da8('0xa')},'dialBusyRetryFrequency':{'type':Sequelize[_0x9da8('0x5')](0x5)[_0x9da8('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x9da8('0xb')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x9da8('0x5')](0x3)['UNSIGNED'],'defaultValue':0x3,'comment':_0x9da8('0xc')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x9da8('0x5')](0x5)[_0x9da8('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x9da8('0xd')},'dialGlobalMaxRetry':{'type':Sequelize[_0x9da8('0x5')](0x3)[_0x9da8('0x7')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':'#Global\x20Max\x20Retry\x20(min:1,\x20max:999)'},'dialTimezone':{'type':Sequelize[_0x9da8('0x0')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize['STRING'],'defaultValue':_0x9da8('0xe')},'dialCheckDuplicateType':{'type':Sequelize[_0x9da8('0xf')](_0x9da8('0x10'),_0x9da8('0x11'),_0x9da8('0x12')),'defaultValue':'always'},'dialAMDActive':{'type':Sequelize[_0x9da8('0x3')],'defaultValue':0x0,'comment':_0x9da8('0x13')},'dialAMDInitialSilence':{'type':Sequelize[_0x9da8('0x5')](0x9)[_0x9da8('0x7')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x9da8('0x14')},'dialAMDGreeting':{'type':Sequelize[_0x9da8('0x5')](0x9)[_0x9da8('0x7')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x9da8('0x15')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x9da8('0x5')](0x9)[_0x9da8('0x7')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x9da8('0x16')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x9da8('0x5')](0x9)[_0x9da8('0x7')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Total\x20Analysis\x20Time'},'dialAMDMinWordLength':{'type':Sequelize[_0x9da8('0x5')](0x9)[_0x9da8('0x7')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x9da8('0x17')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x9da8('0x5')](0x9)['UNSIGNED'],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x9da8('0x18')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x9da8('0x5')](0x9)[_0x9da8('0x7')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x9da8('0x19')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x9da8('0x5')](0x5)[_0x9da8('0x7')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':'#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)'},'dialAMDMaximumWordLength':{'type':Sequelize[_0x9da8('0x5')](0x9)[_0x9da8('0x7')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x9da8('0x1a')},'dialOrderByScheduledAt':{'type':Sequelize[_0x9da8('0xf')](_0x9da8('0x1b'),'ASC'),'defaultValue':_0x9da8('0x1b')},'dialPrefix':{'type':Sequelize[_0x9da8('0x0')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x9da8('0x1c')},'dialCutDigit':{'type':Sequelize[_0x9da8('0x5')](0x3)[_0x9da8('0x7')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x9da8('0x1d')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x9da8('0x5')](0x3)[_0x9da8('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)'},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x9da8('0x5')](0x5)[_0x9da8('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x9da8('0x1e')},'dialDropMaxRetry':{'type':Sequelize[_0x9da8('0x5')](0x3)[_0x9da8('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x9da8('0x1f')},'dialDropRetryFrequency':{'type':Sequelize[_0x9da8('0x5')](0x5)[_0x9da8('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x9da8('0x20')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x9da8('0x5')](0x3)[_0x9da8('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x9da8('0x21')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x9da8('0x5')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x9da8('0x22')},'dialMachineMaxRetry':{'type':Sequelize[_0x9da8('0x5')](0x3)[_0x9da8('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x9da8('0x23')},'dialMachineRetryFrequency':{'type':Sequelize[_0x9da8('0x5')](0x5)[_0x9da8('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x9da8('0x24')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x9da8('0x5')](0x3)[_0x9da8('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x9da8('0x25')},'dialAgentRejectRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x9da8('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x9da8('0x26')}};
\ No newline at end of file
+var _0x2e8e=['#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','exports','STRING','ENUM','ivr','BOOLEAN','Active/Disactive\x20Campaign','INTEGER','UNSIGNED','Max\x20200\x20calls.','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','onlyIfOpen','always','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','DESC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2e8e,0xee));var _0xe2e8=function(_0x1ebc6c,_0x58a00b){_0x1ebc6c=_0x1ebc6c-0x0;var _0x3a826d=_0x2e8e[_0x1ebc6c];return _0x3a826d;};'use strict';var Sequelize=require('sequelize');module[_0xe2e8('0x0')]={'name':{'type':Sequelize[_0xe2e8('0x1')],'unique':'name','allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0xe2e8('0x2')](_0xe2e8('0x3')),'allowNull':![],'defaultValue':'ivr'},'description':{'type':Sequelize[_0xe2e8('0x1')]},'active':{'type':Sequelize[_0xe2e8('0x4')],'defaultValue':0x0,'comment':_0xe2e8('0x5')},'limitCalls':{'type':Sequelize[_0xe2e8('0x6')](0x4)[_0xe2e8('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0xe2e8('0x8')},'dialOriginateCallerIdName':{'type':Sequelize[_0xe2e8('0x1')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0xe2e8('0x1')]},'dialOriginateTimeout':{'type':Sequelize[_0xe2e8('0x6')](0x3)[_0xe2e8('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0xe2e8('0x9')},'dialCongestionMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xe2e8('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xe2e8('0xa')},'dialCongestionRetryFrequency':{'type':Sequelize[_0xe2e8('0x6')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xe2e8('0xb')},'dialBusyMaxRetry':{'type':Sequelize[_0xe2e8('0x6')](0x3)[_0xe2e8('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Busy\x20Retry\x20(min:1,\x20max:999)'},'dialBusyRetryFrequency':{'type':Sequelize[_0xe2e8('0x6')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialNoAnswerMaxRetry':{'type':Sequelize[_0xe2e8('0x6')](0x3)['UNSIGNED'],'defaultValue':0x3,'comment':'#NoAnswer\x20Retry\x20(min:1,\x20max:999)'},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0xe2e8('0x6')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xe2e8('0xc')},'dialGlobalMaxRetry':{'type':Sequelize[_0xe2e8('0x6')](0x3)[_0xe2e8('0x7')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0xe2e8('0xd')},'dialTimezone':{'type':Sequelize['STRING'],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0xe2e8('0x1')],'defaultValue':_0xe2e8('0xe')},'dialCheckDuplicateType':{'type':Sequelize[_0xe2e8('0x2')]('always','never',_0xe2e8('0xf')),'defaultValue':_0xe2e8('0x10')},'dialAMDActive':{'type':Sequelize[_0xe2e8('0x4')],'defaultValue':0x0,'comment':'Active/Disactive\x20AMD'},'dialAMDInitialSilence':{'type':Sequelize[_0xe2e8('0x6')](0x9)[_0xe2e8('0x7')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0xe2e8('0x11')},'dialAMDGreeting':{'type':Sequelize[_0xe2e8('0x6')](0x9)[_0xe2e8('0x7')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0xe2e8('0x12')},'dialAMDAfterGreetingSilence':{'type':Sequelize['INTEGER'](0x9)[_0xe2e8('0x7')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0xe2e8('0x13')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0xe2e8('0x6')](0x9)[_0xe2e8('0x7')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Total\x20Analysis\x20Time'},'dialAMDMinWordLength':{'type':Sequelize[_0xe2e8('0x6')](0x9)['UNSIGNED'],'defaultValue':0x64,'validate':{'min':0x0},'comment':'#AMD\x20Min\x20Word\x20Length'},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0xe2e8('0x6')](0x9)['UNSIGNED'],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0xe2e8('0x14')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0xe2e8('0x6')](0x9)[_0xe2e8('0x7')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0xe2e8('0x15')},'dialAMDSilenceThreshold':{'type':Sequelize[_0xe2e8('0x6')](0x5)['UNSIGNED'],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0xe2e8('0x16')},'dialAMDMaximumWordLength':{'type':Sequelize['INTEGER'](0x9)[_0xe2e8('0x7')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Word\x20Length'},'dialOrderByScheduledAt':{'type':Sequelize[_0xe2e8('0x2')](_0xe2e8('0x17'),'ASC'),'defaultValue':_0xe2e8('0x17')},'dialPrefix':{'type':Sequelize[_0xe2e8('0x1')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0xe2e8('0x6')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xe2e8('0x18')},'dialCutDigit':{'type':Sequelize[_0xe2e8('0x6')](0x3)[_0xe2e8('0x7')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xe2e8('0x19')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0xe2e8('0x6')](0x3)[_0xe2e8('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xe2e8('0x1a')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0xe2e8('0x6')](0x5)[_0xe2e8('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialDropMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xe2e8('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xe2e8('0x1b')},'dialDropRetryFrequency':{'type':Sequelize[_0xe2e8('0x6')](0x5)[_0xe2e8('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xe2e8('0x1c')},'dialAbandonedMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xe2e8('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xe2e8('0x1d')},'dialAbandonedRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xe2e8('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xe2e8('0x1e')},'dialMachineMaxRetry':{'type':Sequelize[_0xe2e8('0x6')](0x3)[_0xe2e8('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Machine\x20Retry\x20(min:1,\x20max:999)'},'dialMachineRetryFrequency':{'type':Sequelize[_0xe2e8('0x6')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xe2e8('0x1f')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0xe2e8('0x6')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xe2e8('0x20')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0xe2e8('0x6')](0x5)[_0xe2e8('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'}};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.controller.js b/server/api/campaign/campaign.controller.js
index c172434..c3d3d41 100644
--- a/server/api/campaign/campaign.controller.js
+++ b/server/api/campaign/campaign.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xa45d=['create','clone','omit','createdAt','updatedAt','UserProfileSection','update','getHoppers','findOne','CmHopper','CampaignId','CmHopperHistory','getHopperFinals','CmHopperFinal','CmHopperBlack','getLists','CmList','addLists','ids','spread','dialCheckDuplicateType','always','into','fromQuery','scheduledAt','ContactId','ListId','select','field','phone','NOW()','toString','from','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','CmListId','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','CampaignId\x20=\x20?','COALESCE(phone,\x27\x27)','cm_hopper','onlyIfOpen','insert','push','all','removeLists','getBlackLists','addBlackLists','cm_hopper_black','sequelize','removeBlackLists','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','end','status','count','offset','limit','set','Content-Range','json','apply','reject','save','then','destroy','get','IvrCampaigns','UserProfileResource','error','stack','name','index','map','Campaign','rawAttributes','fieldName','type','key','model','query','keys','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','intersection','fields','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','find','userProfileId','autoAssociation'];(function(_0x1cd4d5,_0x40bd09){var _0x348028=function(_0x10ffb3){while(--_0x10ffb3){_0x1cd4d5['push'](_0x1cd4d5['shift']());}};_0x348028(++_0x40bd09);}(_0xa45d,0x1c7));var _0xda45=function(_0xa6e64c,_0x1e78f5){_0xa6e64c=_0xa6e64c-0x0;var _0x5c2de0=_0xa45d[_0xa6e64c];return _0x5c2de0;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xda45('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xda45('0x1'));var jsonpatch=require(_0xda45('0x2'));var rp=require(_0xda45('0x3'));var moment=require(_0xda45('0x4'));var BPromise=require(_0xda45('0x5'));var Mustache=require(_0xda45('0x6'));var util=require(_0xda45('0x7'));var path=require(_0xda45('0x8'));var sox=require(_0xda45('0x9'));var csv=require(_0xda45('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xda45('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xda45('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xda45('0xa'));var querystring=require(_0xda45('0xd'));var Papa=require(_0xda45('0xe'));var Redis=require(_0xda45('0xf'));var authService=require(_0xda45('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xda45('0x11'));var hardwareService=require(_0xda45('0x12'));var logger=require(_0xda45('0x13'))(_0xda45('0x14'));var utils=require('../../config/utils');var config=require(_0xda45('0x15'));var db=require(_0xda45('0x16'))['db'];function respondWithStatusCode(_0xd2e50,_0x58ffd9){_0x58ffd9=_0x58ffd9||0xcc;return function(_0x1d63bd){if(_0x1d63bd){return _0xd2e50[_0xda45('0x17')](_0x58ffd9);}return _0xd2e50['status'](_0x58ffd9)[_0xda45('0x18')]();};}function respondWithResult(_0x106593,_0x13985b){_0x13985b=_0x13985b||0xc8;return function(_0x4f244e){if(_0x4f244e){return _0x106593[_0xda45('0x19')](_0x13985b)['json'](_0x4f244e);}};}function respondWithFilteredResult(_0x3d072d,_0x3f5216){return function(_0x54ffac){if(_0x54ffac){var _0x366956=_0x54ffac[_0xda45('0x1a')],_0x4127ce=_0x3f5216['offset'],_0x1f30c0=_0x3f5216[_0xda45('0x1b')]+_0x3f5216[_0xda45('0x1c')],_0x4b39c1;if(_0x1f30c0>=_0x366956){_0x1f30c0=_0x366956;_0x4b39c1=0xc8;}else{_0x4b39c1=0xce;}_0x3d072d[_0xda45('0x19')](_0x4b39c1);return _0x3d072d[_0xda45('0x1d')](_0xda45('0x1e'),_0x4127ce+'-'+_0x1f30c0+'/'+_0x366956)[_0xda45('0x1f')](_0x54ffac);}return null;};}function patchUpdates(_0x202c04){return function(_0x529d16){try{jsonpatch[_0xda45('0x20')](_0x529d16,_0x202c04,!![]);}catch(_0x302683){return BPromise[_0xda45('0x21')](_0x302683);}return _0x529d16[_0xda45('0x22')]();};}function saveUpdates(_0x5534a3,_0x3bd00c){return function(_0x518215){if(_0x518215){return _0x518215['update'](_0x5534a3)[_0xda45('0x23')](function(_0x4db00b){return _0x4db00b;});}return null;};}function removeEntity(_0x192c12,_0x39191b){return function(_0x3cb15d){if(_0x3cb15d){return _0x3cb15d[_0xda45('0x24')]()[_0xda45('0x23')](function(){var _0x316e19=_0x3cb15d[_0xda45('0x25')]({'plain':!![]});var _0x2282bd=_0xda45('0x26');return db[_0xda45('0x27')][_0xda45('0x24')]({'where':{'type':_0x2282bd,'resourceId':_0x316e19['id']}})[_0xda45('0x23')](function(){return _0x3cb15d;});})[_0xda45('0x23')](function(){_0x192c12[_0xda45('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x36a8c8,_0x1b51f9){return function(_0x4fc59){if(!_0x4fc59){_0x36a8c8['sendStatus'](0x194);}return _0x4fc59;};}function handleError(_0x5ee486,_0x5bb6a9){_0x5bb6a9=_0x5bb6a9||0x1f4;return function(_0x58c7f2){logger[_0xda45('0x28')](_0x58c7f2[_0xda45('0x29')]);if(_0x58c7f2[_0xda45('0x2a')]){delete _0x58c7f2[_0xda45('0x2a')];}_0x5ee486[_0xda45('0x19')](_0x5bb6a9)['send'](_0x58c7f2);};}exports[_0xda45('0x2b')]=function(_0x5bb837,_0x1d1b57){var _0x52e548={},_0x43d8ba={},_0x4c0bef={'count':0x0,'rows':[]};var _0x3ced5a=_[_0xda45('0x2c')](db[_0xda45('0x2d')][_0xda45('0x2e')],function(_0x1d9c12){return{'name':_0x1d9c12[_0xda45('0x2f')],'type':_0x1d9c12[_0xda45('0x30')][_0xda45('0x31')]};});_0x43d8ba[_0xda45('0x32')]=_['map'](_0x3ced5a,_0xda45('0x2a'));_0x43d8ba[_0xda45('0x33')]=_[_0xda45('0x34')](_0x5bb837[_0xda45('0x33')]);_0x43d8ba['filters']=_['intersection'](_0x43d8ba[_0xda45('0x32')],_0x43d8ba[_0xda45('0x33')]);_0x52e548[_0xda45('0x35')]=_['intersection'](_0x43d8ba[_0xda45('0x32')],qs['fields'](_0x5bb837[_0xda45('0x33')]['fields']));_0x52e548[_0xda45('0x35')]=_0x52e548['attributes'][_0xda45('0x36')]?_0x52e548[_0xda45('0x35')]:_0x43d8ba[_0xda45('0x32')];if(!_0x5bb837['query'][_0xda45('0x37')](_0xda45('0x38'))){_0x52e548[_0xda45('0x1c')]=qs[_0xda45('0x1c')](_0x5bb837[_0xda45('0x33')][_0xda45('0x1c')]);_0x52e548[_0xda45('0x1b')]=qs[_0xda45('0x1b')](_0x5bb837['query'][_0xda45('0x1b')]);}_0x52e548[_0xda45('0x39')]=qs[_0xda45('0x3a')](_0x5bb837['query'][_0xda45('0x3a')]);_0x52e548[_0xda45('0x3b')]=qs[_0xda45('0x3c')](_[_0xda45('0x3d')](_0x5bb837['query'],_0x43d8ba[_0xda45('0x3c')]),_0x3ced5a);if(_0x5bb837[_0xda45('0x33')][_0xda45('0x3e')]){_0x52e548[_0xda45('0x3b')]=_[_0xda45('0x3f')](_0x52e548['where'],{'$or':_['map'](_0x3ced5a,function(_0x19531c){if(_0x19531c[_0xda45('0x30')]!=='VIRTUAL'){var _0x2d6452={};_0x2d6452[_0x19531c['name']]={'$like':'%'+_0x5bb837[_0xda45('0x33')][_0xda45('0x3e')]+'%'};return _0x2d6452;}})});}_0x52e548=_['merge']({},_0x52e548,_0x5bb837[_0xda45('0x40')]);var _0x2f083b={'where':_0x52e548[_0xda45('0x3b')]};return db[_0xda45('0x2d')][_0xda45('0x1a')](_0x2f083b)[_0xda45('0x23')](function(_0x509db9){_0x4c0bef[_0xda45('0x1a')]=_0x509db9;if(_0x5bb837[_0xda45('0x33')][_0xda45('0x41')]){_0x52e548[_0xda45('0x42')]=[{'all':!![]}];}return db[_0xda45('0x2d')][_0xda45('0x43')](_0x52e548);})[_0xda45('0x23')](function(_0x6074b2){_0x4c0bef[_0xda45('0x44')]=_0x6074b2;return _0x4c0bef;})[_0xda45('0x23')](respondWithFilteredResult(_0x1d1b57,_0x52e548))[_0xda45('0x45')](handleError(_0x1d1b57,null));};exports[_0xda45('0x46')]=function(_0x35ec7e,_0x40b8eb){var _0x57e75d={'raw':![],'where':{'id':_0x35ec7e[_0xda45('0x47')]['id']}},_0x60e4b1={};_0x60e4b1['model']=_[_0xda45('0x34')](db[_0xda45('0x2d')][_0xda45('0x2e')]);_0x60e4b1['query']=_['keys'](_0x35ec7e[_0xda45('0x33')]);_0x60e4b1[_0xda45('0x3c')]=_[_0xda45('0x48')](_0x60e4b1[_0xda45('0x32')],_0x60e4b1[_0xda45('0x33')]);_0x57e75d[_0xda45('0x35')]=_[_0xda45('0x48')](_0x60e4b1['model'],qs[_0xda45('0x49')](_0x35ec7e[_0xda45('0x33')][_0xda45('0x49')]));_0x57e75d[_0xda45('0x35')]=_0x57e75d[_0xda45('0x35')][_0xda45('0x36')]?_0x57e75d['attributes']:_0x60e4b1[_0xda45('0x32')];if(_0x35ec7e[_0xda45('0x33')][_0xda45('0x41')]){_0x57e75d[_0xda45('0x42')]=[{'all':!![]}];}_0x57e75d=_['merge']({},_0x57e75d,_0x35ec7e[_0xda45('0x40')]);return db[_0xda45('0x2d')]['find'](_0x57e75d)[_0xda45('0x23')](handleEntityNotFound(_0x40b8eb,null))[_0xda45('0x23')](respondWithResult(_0x40b8eb,null))['catch'](handleError(_0x40b8eb,null));};exports['create']=function(_0x507351,_0x13ffa0){return db[_0xda45('0x2d')]['create'](_0x507351[_0xda45('0x4a')],{})[_0xda45('0x23')](function(_0x350ecc){var _0x5c1185=_0x507351[_0xda45('0x4b')]['get']({'plain':!![]});if(!_0x5c1185)throw new Error(_0xda45('0x4c'));if(_0x5c1185[_0xda45('0x4d')]===_0xda45('0x4b')){var _0x514b2c=_0x350ecc[_0xda45('0x25')]({'plain':!![]});var _0x63f898=_0xda45('0x26');return db['UserProfileSection'][_0xda45('0x4e')]({'where':{'name':_0x63f898,'userProfileId':_0x5c1185[_0xda45('0x4f')]},'raw':!![]})[_0xda45('0x23')](function(_0x107474){if(_0x107474&&_0x107474[_0xda45('0x50')]===0x0){return db[_0xda45('0x27')][_0xda45('0x51')]({'name':_0x514b2c[_0xda45('0x2a')],'resourceId':_0x514b2c['id'],'type':_0x107474['name'],'sectionId':_0x107474['id']},{})[_0xda45('0x23')](function(){return _0x350ecc;});}else{return _0x350ecc;}})[_0xda45('0x45')](function(_0xca6f2b){logger[_0xda45('0x28')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xca6f2b);throw _0xca6f2b;});}return _0x350ecc;})[_0xda45('0x23')](respondWithResult(_0x13ffa0,0xc9))[_0xda45('0x45')](handleError(_0x13ffa0,null));};exports[_0xda45('0x52')]=function(_0x3d9d87,_0x1cca12){var _0x2cb4b4={'where':{'id':_0x3d9d87[_0xda45('0x47')]['id']}},_0xcdf9e4={};_0xcdf9e4[_0xda45('0x32')]=_['keys'](db[_0xda45('0x2d')]['rawAttributes']);_0x2cb4b4[_0xda45('0x35')]=_['intersection'](_0xcdf9e4[_0xda45('0x32')],qs['fields'](_0x3d9d87[_0xda45('0x33')][_0xda45('0x49')]));_0x2cb4b4[_0xda45('0x35')]=_0x2cb4b4['attributes']['length']?_0x2cb4b4[_0xda45('0x35')]:_0xcdf9e4[_0xda45('0x32')];if(_0x3d9d87[_0xda45('0x33')]['includeAll']){_0x2cb4b4[_0xda45('0x42')]=[{'all':!![]}];}_0x2cb4b4=_['merge']({},_0x2cb4b4,_0x3d9d87[_0xda45('0x40')]);return db[_0xda45('0x2d')][_0xda45('0x4e')](_0x2cb4b4)[_0xda45('0x23')](handleEntityNotFound(_0x1cca12,null))[_0xda45('0x23')](function(_0x178ce7){if(_0x178ce7){var _0x560699=_0x178ce7['get']({'plain':!![]});_0x560699=qs[_0xda45('0x53')](_0x560699,['id',_0xda45('0x54'),_0xda45('0x55')]);_0x3d9d87[_0xda45('0x4a')]=_[_0xda45('0x53')](_0x3d9d87['body'],['id','createdAt',_0xda45('0x55')]);return db['Campaign']['create'](_['merge'](_0x560699,_0x3d9d87['body']),{'include':_0x3d9d87['query'][_0xda45('0x41')]?[{'all':!![]}]:undefined})[_0xda45('0x23')](function(_0x24e55c){var _0x26a994=_0x3d9d87[_0xda45('0x4b')][_0xda45('0x25')]({'plain':!![]});if(!_0x26a994)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x26a994[_0xda45('0x4d')]===_0xda45('0x4b')){var _0x99141a=_0x24e55c['get']({'plain':!![]});var _0x10aaf7=_0xda45('0x26');return db[_0xda45('0x56')]['find']({'where':{'name':_0x10aaf7,'userProfileId':_0x26a994[_0xda45('0x4f')]},'raw':!![]})['then'](function(_0x261054){if(_0x261054&&_0x261054[_0xda45('0x50')]===0x0){return db[_0xda45('0x27')][_0xda45('0x51')]({'name':_0x99141a['name'],'resourceId':_0x99141a['id'],'type':_0x261054[_0xda45('0x2a')],'sectionId':_0x261054['id']},{})[_0xda45('0x23')](function(){return _0x24e55c;});}else{return _0x24e55c;}})[_0xda45('0x45')](function(_0x56948b){logger[_0xda45('0x28')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x56948b);throw _0x56948b;});}return _0x24e55c;});}})[_0xda45('0x23')](respondWithResult(_0x1cca12,0xc9))[_0xda45('0x45')](handleError(_0x1cca12,null));};exports[_0xda45('0x57')]=function(_0x20c6c2,_0x650990){if(_0x20c6c2[_0xda45('0x4a')]['id']){delete _0x20c6c2['body']['id'];}return db[_0xda45('0x2d')]['find']({'where':{'id':_0x20c6c2[_0xda45('0x47')]['id']}})['then'](handleEntityNotFound(_0x650990,null))['then'](saveUpdates(_0x20c6c2[_0xda45('0x4a')],null))[_0xda45('0x23')](respondWithResult(_0x650990,null))[_0xda45('0x45')](handleError(_0x650990,null));};exports[_0xda45('0x24')]=function(_0x55da3a,_0x3cf19f){return db['Campaign'][_0xda45('0x4e')]({'where':{'id':_0x55da3a['params']['id']}})[_0xda45('0x23')](handleEntityNotFound(_0x3cf19f,null))['then'](removeEntity(_0x3cf19f,null))[_0xda45('0x45')](handleError(_0x3cf19f,null));};exports[_0xda45('0x58')]=function(_0x3b7513,_0x4f6344,_0x433550){var _0x5999fe={'raw':!![],'where':{}};var _0x12add4={};var _0x1e8b78={'count':0x0,'rows':[]};return db[_0xda45('0x2d')][_0xda45('0x59')]({'where':{'id':_0x3b7513[_0xda45('0x47')]['id']}})['then'](handleEntityNotFound(_0x4f6344,null))[_0xda45('0x23')](function(_0x348681){if(_0x348681){_0x12add4[_0xda45('0x32')]=_[_0xda45('0x34')](db[_0xda45('0x5a')]['rawAttributes']);_0x12add4[_0xda45('0x33')]=_[_0xda45('0x34')](_0x3b7513[_0xda45('0x33')]);_0x12add4['filters']=_[_0xda45('0x48')](_0x12add4[_0xda45('0x32')],_0x12add4[_0xda45('0x33')]);_0x5999fe[_0xda45('0x35')]=_[_0xda45('0x48')](_0x12add4['model'],qs[_0xda45('0x49')](_0x3b7513['query'][_0xda45('0x49')]));_0x5999fe[_0xda45('0x35')]=_0x5999fe[_0xda45('0x35')][_0xda45('0x36')]?_0x5999fe[_0xda45('0x35')]:_0x12add4[_0xda45('0x32')];if(!_0x3b7513[_0xda45('0x33')]['hasOwnProperty']('nolimit')){_0x5999fe[_0xda45('0x1c')]=qs[_0xda45('0x1c')](_0x3b7513[_0xda45('0x33')]['limit']);_0x5999fe['offset']=qs[_0xda45('0x1b')](_0x3b7513[_0xda45('0x33')][_0xda45('0x1b')]);}_0x5999fe['order']=qs[_0xda45('0x3a')](_0x3b7513[_0xda45('0x33')][_0xda45('0x3a')]);_0x5999fe[_0xda45('0x3b')]=qs[_0xda45('0x3c')](_['pick'](_0x3b7513[_0xda45('0x33')],_0x12add4[_0xda45('0x3c')]));_0x5999fe[_0xda45('0x3b')][_0xda45('0x5b')]=_0x348681['id'];if(_0x3b7513[_0xda45('0x33')][_0xda45('0x3e')]){_0x5999fe[_0xda45('0x3b')]=_[_0xda45('0x3f')](_0x5999fe[_0xda45('0x3b')],{'$or':_[_0xda45('0x2c')](_0x5999fe[_0xda45('0x35')],function(_0x324cfe){var _0xc245d9={};_0xc245d9[_0x324cfe]={'$like':'%'+_0x3b7513[_0xda45('0x33')][_0xda45('0x3e')]+'%'};return _0xc245d9;})});}_0x5999fe=_[_0xda45('0x3f')]({},_0x5999fe,_0x3b7513['options']);return db['CmHopper'][_0xda45('0x1a')]({'where':_0x5999fe[_0xda45('0x3b')]})[_0xda45('0x23')](function(_0x1350e0){_0x1e8b78[_0xda45('0x1a')]=_0x1350e0;if(_0x3b7513[_0xda45('0x33')][_0xda45('0x41')]){_0x5999fe[_0xda45('0x42')]=[{'all':!![]}];}return db['CmHopper']['findAll'](_0x5999fe);})[_0xda45('0x23')](function(_0x117102){_0x1e8b78[_0xda45('0x44')]=_0x117102;return _0x1e8b78;});}})[_0xda45('0x23')](respondWithFilteredResult(_0x4f6344,_0x5999fe))['catch'](handleError(_0x4f6344,null));};exports['getHopperHistories']=function(_0x2a4198,_0x1ab1db,_0x5c4be2){var _0x9dab51={'raw':!![],'where':{}};var _0x450dc2={};var _0x27f722={'count':0x0,'rows':[]};return db[_0xda45('0x2d')][_0xda45('0x59')]({'where':{'id':_0x2a4198[_0xda45('0x47')]['id']}})['then'](handleEntityNotFound(_0x1ab1db,null))[_0xda45('0x23')](function(_0x22159b){if(_0x22159b){_0x450dc2[_0xda45('0x32')]=_[_0xda45('0x34')](db[_0xda45('0x5c')][_0xda45('0x2e')]);_0x450dc2[_0xda45('0x33')]=_[_0xda45('0x34')](_0x2a4198[_0xda45('0x33')]);_0x450dc2[_0xda45('0x3c')]=_['intersection'](_0x450dc2[_0xda45('0x32')],_0x450dc2['query']);_0x9dab51[_0xda45('0x35')]=_[_0xda45('0x48')](_0x450dc2[_0xda45('0x32')],qs[_0xda45('0x49')](_0x2a4198['query'][_0xda45('0x49')]));_0x9dab51['attributes']=_0x9dab51[_0xda45('0x35')][_0xda45('0x36')]?_0x9dab51[_0xda45('0x35')]:_0x450dc2[_0xda45('0x32')];if(!_0x2a4198[_0xda45('0x33')][_0xda45('0x37')](_0xda45('0x38'))){_0x9dab51['limit']=qs[_0xda45('0x1c')](_0x2a4198[_0xda45('0x33')][_0xda45('0x1c')]);_0x9dab51[_0xda45('0x1b')]=qs[_0xda45('0x1b')](_0x2a4198[_0xda45('0x33')][_0xda45('0x1b')]);}_0x9dab51['order']=qs['sort'](_0x2a4198[_0xda45('0x33')][_0xda45('0x3a')]);_0x9dab51['where']=qs['filters'](_[_0xda45('0x3d')](_0x2a4198[_0xda45('0x33')],_0x450dc2[_0xda45('0x3c')]));_0x9dab51[_0xda45('0x3b')][_0xda45('0x5b')]=_0x22159b['id'];if(_0x2a4198[_0xda45('0x33')]['filter']){_0x9dab51[_0xda45('0x3b')]=_['merge'](_0x9dab51['where'],{'$or':_[_0xda45('0x2c')](_0x9dab51[_0xda45('0x35')],function(_0xfac03){var _0x57d999={};_0x57d999[_0xfac03]={'$like':'%'+_0x2a4198[_0xda45('0x33')][_0xda45('0x3e')]+'%'};return _0x57d999;})});}_0x9dab51=_[_0xda45('0x3f')]({},_0x9dab51,_0x2a4198['options']);return db[_0xda45('0x5c')][_0xda45('0x1a')]({'where':_0x9dab51[_0xda45('0x3b')]})[_0xda45('0x23')](function(_0x982c2c){_0x27f722[_0xda45('0x1a')]=_0x982c2c;if(_0x2a4198['query'][_0xda45('0x41')]){_0x9dab51[_0xda45('0x42')]=[{'all':!![]}];}return db[_0xda45('0x5c')]['findAll'](_0x9dab51);})['then'](function(_0x33ed77){_0x27f722[_0xda45('0x44')]=_0x33ed77;return _0x27f722;});}})['then'](respondWithFilteredResult(_0x1ab1db,_0x9dab51))[_0xda45('0x45')](handleError(_0x1ab1db,null));};exports[_0xda45('0x5d')]=function(_0xd7e308,_0x108288,_0x3352a8){var _0x2394db={'raw':!![],'where':{}};var _0xd11dce={};var _0x4f4bb2={'count':0x0,'rows':[]};return db[_0xda45('0x2d')][_0xda45('0x59')]({'where':{'id':_0xd7e308[_0xda45('0x47')]['id']}})['then'](handleEntityNotFound(_0x108288,null))[_0xda45('0x23')](function(_0x280293){if(_0x280293){_0xd11dce[_0xda45('0x32')]=_['keys'](db[_0xda45('0x5e')]['rawAttributes']);_0xd11dce['query']=_['keys'](_0xd7e308[_0xda45('0x33')]);_0xd11dce[_0xda45('0x3c')]=_[_0xda45('0x48')](_0xd11dce['model'],_0xd11dce['query']);_0x2394db[_0xda45('0x35')]=_['intersection'](_0xd11dce[_0xda45('0x32')],qs[_0xda45('0x49')](_0xd7e308[_0xda45('0x33')][_0xda45('0x49')]));_0x2394db[_0xda45('0x35')]=_0x2394db['attributes'][_0xda45('0x36')]?_0x2394db[_0xda45('0x35')]:_0xd11dce[_0xda45('0x32')];if(!_0xd7e308[_0xda45('0x33')]['hasOwnProperty'](_0xda45('0x38'))){_0x2394db[_0xda45('0x1c')]=qs[_0xda45('0x1c')](_0xd7e308[_0xda45('0x33')][_0xda45('0x1c')]);_0x2394db[_0xda45('0x1b')]=qs[_0xda45('0x1b')](_0xd7e308['query'][_0xda45('0x1b')]);}_0x2394db[_0xda45('0x39')]=qs[_0xda45('0x3a')](_0xd7e308['query'][_0xda45('0x3a')]);_0x2394db[_0xda45('0x3b')]=qs[_0xda45('0x3c')](_[_0xda45('0x3d')](_0xd7e308['query'],_0xd11dce[_0xda45('0x3c')]));_0x2394db['where'][_0xda45('0x5b')]=_0x280293['id'];if(_0xd7e308[_0xda45('0x33')][_0xda45('0x3e')]){_0x2394db[_0xda45('0x3b')]=_[_0xda45('0x3f')](_0x2394db[_0xda45('0x3b')],{'$or':_[_0xda45('0x2c')](_0x2394db[_0xda45('0x35')],function(_0x52b37f){var _0x1197dd={};_0x1197dd[_0x52b37f]={'$like':'%'+_0xd7e308[_0xda45('0x33')]['filter']+'%'};return _0x1197dd;})});}_0x2394db=_[_0xda45('0x3f')]({},_0x2394db,_0xd7e308[_0xda45('0x40')]);return db[_0xda45('0x5e')]['count']({'where':_0x2394db[_0xda45('0x3b')]})['then'](function(_0x2fa304){_0x4f4bb2[_0xda45('0x1a')]=_0x2fa304;if(_0xd7e308[_0xda45('0x33')][_0xda45('0x41')]){_0x2394db[_0xda45('0x42')]=[{'all':!![]}];}return db[_0xda45('0x5e')][_0xda45('0x43')](_0x2394db);})[_0xda45('0x23')](function(_0x490796){_0x4f4bb2[_0xda45('0x44')]=_0x490796;return _0x4f4bb2;});}})['then'](respondWithFilteredResult(_0x108288,_0x2394db))[_0xda45('0x45')](handleError(_0x108288,null));};exports['getHopperBlacks']=function(_0xed626b,_0x8d9eb9,_0x25d0e1){var _0x5ef40d={'raw':!![],'where':{}};var _0x1b3d1e={};var _0x2d16b6={'count':0x0,'rows':[]};return db[_0xda45('0x2d')]['findOne']({'where':{'id':_0xed626b[_0xda45('0x47')]['id']}})[_0xda45('0x23')](handleEntityNotFound(_0x8d9eb9,null))[_0xda45('0x23')](function(_0x22cd7a){if(_0x22cd7a){_0x1b3d1e[_0xda45('0x32')]=_[_0xda45('0x34')](db[_0xda45('0x5f')][_0xda45('0x2e')]);_0x1b3d1e[_0xda45('0x33')]=_[_0xda45('0x34')](_0xed626b[_0xda45('0x33')]);_0x1b3d1e['filters']=_[_0xda45('0x48')](_0x1b3d1e[_0xda45('0x32')],_0x1b3d1e[_0xda45('0x33')]);_0x5ef40d[_0xda45('0x35')]=_[_0xda45('0x48')](_0x1b3d1e[_0xda45('0x32')],qs[_0xda45('0x49')](_0xed626b[_0xda45('0x33')][_0xda45('0x49')]));_0x5ef40d[_0xda45('0x35')]=_0x5ef40d[_0xda45('0x35')][_0xda45('0x36')]?_0x5ef40d[_0xda45('0x35')]:_0x1b3d1e[_0xda45('0x32')];if(!_0xed626b['query'][_0xda45('0x37')](_0xda45('0x38'))){_0x5ef40d[_0xda45('0x1c')]=qs[_0xda45('0x1c')](_0xed626b[_0xda45('0x33')]['limit']);_0x5ef40d[_0xda45('0x1b')]=qs[_0xda45('0x1b')](_0xed626b[_0xda45('0x33')]['offset']);}_0x5ef40d[_0xda45('0x39')]=qs[_0xda45('0x3a')](_0xed626b[_0xda45('0x33')]['sort']);_0x5ef40d['where']=qs[_0xda45('0x3c')](_['pick'](_0xed626b['query'],_0x1b3d1e['filters']));_0x5ef40d[_0xda45('0x3b')][_0xda45('0x5b')]=_0x22cd7a['id'];if(_0xed626b['query'][_0xda45('0x3e')]){_0x5ef40d[_0xda45('0x3b')]=_[_0xda45('0x3f')](_0x5ef40d['where'],{'$or':_['map'](_0x5ef40d['attributes'],function(_0x3df5e5){var _0x56d90e={};_0x56d90e[_0x3df5e5]={'$like':'%'+_0xed626b[_0xda45('0x33')][_0xda45('0x3e')]+'%'};return _0x56d90e;})});}_0x5ef40d=_[_0xda45('0x3f')]({},_0x5ef40d,_0xed626b['options']);return db['CmHopperBlack'][_0xda45('0x1a')]({'where':_0x5ef40d[_0xda45('0x3b')]})[_0xda45('0x23')](function(_0x5a2b7f){_0x2d16b6[_0xda45('0x1a')]=_0x5a2b7f;if(_0xed626b[_0xda45('0x33')][_0xda45('0x41')]){_0x5ef40d[_0xda45('0x42')]=[{'all':!![]}];}return db[_0xda45('0x5f')][_0xda45('0x43')](_0x5ef40d);})[_0xda45('0x23')](function(_0x268f3e){_0x2d16b6[_0xda45('0x44')]=_0x268f3e;return _0x2d16b6;});}})[_0xda45('0x23')](respondWithFilteredResult(_0x8d9eb9,_0x5ef40d))[_0xda45('0x45')](handleError(_0x8d9eb9,null));};exports[_0xda45('0x60')]=function(_0x309e90,_0x5bf1e3,_0x21f5ed){var _0x5032b1={};var _0xe177e={};var _0x5a6477;var _0x2db696;return db[_0xda45('0x2d')]['findOne']({'where':{'id':_0x309e90[_0xda45('0x47')]['id']}})['then'](handleEntityNotFound(_0x5bf1e3,null))[_0xda45('0x23')](function(_0x530143){if(_0x530143){_0x5a6477=_0x530143;_0xe177e[_0xda45('0x32')]=_[_0xda45('0x34')](db[_0xda45('0x61')][_0xda45('0x2e')]);_0xe177e['query']=_[_0xda45('0x34')](_0x309e90[_0xda45('0x33')]);_0xe177e[_0xda45('0x3c')]=_[_0xda45('0x48')](_0xe177e['model'],_0xe177e['query']);_0x5032b1[_0xda45('0x35')]=_['intersection'](_0xe177e[_0xda45('0x32')],qs[_0xda45('0x49')](_0x309e90[_0xda45('0x33')][_0xda45('0x49')]));_0x5032b1['attributes']=_0x5032b1['attributes'][_0xda45('0x36')]?_0x5032b1[_0xda45('0x35')]:_0xe177e['model'];_0x5032b1[_0xda45('0x39')]=qs[_0xda45('0x3a')](_0x309e90[_0xda45('0x33')][_0xda45('0x3a')]);_0x5032b1[_0xda45('0x3b')]=qs[_0xda45('0x3c')](_[_0xda45('0x3d')](_0x309e90[_0xda45('0x33')],_0xe177e[_0xda45('0x3c')]));if(_0x309e90['query'][_0xda45('0x3e')]){_0x5032b1['where']=_[_0xda45('0x3f')](_0x5032b1[_0xda45('0x3b')],{'$or':_[_0xda45('0x2c')](_0x5032b1[_0xda45('0x35')],function(_0x253e2e){var _0xa80d6c={};_0xa80d6c[_0x253e2e]={'$like':'%'+_0x309e90[_0xda45('0x33')][_0xda45('0x3e')]+'%'};return _0xa80d6c;})});}_0x5032b1=_[_0xda45('0x3f')]({},_0x5032b1,_0x309e90[_0xda45('0x40')]);return _0x5a6477['getLists'](_0x5032b1);}})[_0xda45('0x23')](function(_0x5c1748){if(_0x5c1748){_0x2db696=_0x5c1748[_0xda45('0x36')];if(!_0x309e90['query'][_0xda45('0x37')](_0xda45('0x38'))){_0x5032b1['limit']=qs[_0xda45('0x1c')](_0x309e90[_0xda45('0x33')][_0xda45('0x1c')]);_0x5032b1['offset']=qs['offset'](_0x309e90[_0xda45('0x33')]['offset']);}return _0x5a6477[_0xda45('0x60')](_0x5032b1);}})['then'](function(_0x1680f3){if(_0x1680f3){return _0x1680f3?{'count':_0x2db696,'rows':_0x1680f3}:null;}})[_0xda45('0x23')](respondWithResult(_0x5bf1e3,null))['catch'](handleError(_0x5bf1e3,null));};exports[_0xda45('0x62')]=function(_0x58949d,_0x28a9fa,_0x39f92b){var _0x52841d,_0xf5b61d;return db[_0xda45('0x2d')][_0xda45('0x4e')]({'where':{'id':_0x58949d[_0xda45('0x47')]['id']}})[_0xda45('0x23')](handleEntityNotFound(_0x28a9fa,null))['then'](function(_0x5ad547){if(_0x5ad547){_0xf5b61d=_0x5ad547;return _0x5ad547[_0xda45('0x62')](_0x58949d[_0xda45('0x4a')][_0xda45('0x63')],_['omit'](_0x58949d[_0xda45('0x4a')],[_0xda45('0x63'),'id'])||{});}return null;})[_0xda45('0x64')](function(_0x3fbc59){var _0x2dbedb;_0x52841d=_0x3fbc59||[];var _0x206747=[];if(_0x3fbc59){for(var _0x52ccca=0x0;_0x52ccca<_0x3fbc59['length'];_0x52ccca+=0x1){var _0x2443b6=_0x3fbc59[_0x52ccca][_0xda45('0x25')]({'plain':!![]});_0xf5b61d[_0xda45('0x65')]=_0x58949d[_0xda45('0x4a')]['dialCheckDuplicateType']?_0x58949d['body'][_0xda45('0x65')]:_0xf5b61d['dialCheckDuplicateType'];switch(_0xf5b61d[_0xda45('0x65')]){case _0xda45('0x66'):_0x2dbedb=squel['insert']()[_0xda45('0x67')]('cm_hopper')[_0xda45('0x68')](['phone',_0xda45('0x69'),_0xda45('0x6a'),_0xda45('0x6b'),'CampaignId','createdAt','updatedAt'],squel[_0xda45('0x6c')]()[_0xda45('0x6d')]('phone',_0xda45('0x6e'))[_0xda45('0x6d')](_0xda45('0x6f'),'scheduledAt')[_0xda45('0x6d')]('id',_0xda45('0x6a'))[_0xda45('0x6d')](_0x2443b6['CmListId']['toString'](),_0xda45('0x6b'))[_0xda45('0x6d')](_0x58949d[_0xda45('0x47')]['id'][_0xda45('0x70')](),_0xda45('0x5b'))['field']('NOW()',_0xda45('0x54'))['field'](_0xda45('0x6f'),_0xda45('0x55'))[_0xda45('0x71')](_0xda45('0x72'))[_0xda45('0x3b')](_0xda45('0x73'))[_0xda45('0x3b')](_0xda45('0x74'),_0x2443b6[_0xda45('0x75')]['toString']())[_0xda45('0x3b')](_0xda45('0x76'))[_0xda45('0x3b')](_0xda45('0x77'),squel[_0xda45('0x6c')]()[_0xda45('0x6d')](_0xda45('0x78'))[_0xda45('0x71')]('cm_hopper_final')[_0xda45('0x3b')](_0xda45('0x79'),_0x58949d['params']['id'][_0xda45('0x70')]()))[_0xda45('0x3b')](_0xda45('0x77'),squel[_0xda45('0x6c')]()[_0xda45('0x6d')](_0xda45('0x7a'))['from'](_0xda45('0x7b'))[_0xda45('0x3b')](_0xda45('0x79'),_0x58949d[_0xda45('0x47')]['id']['toString']())))[_0xda45('0x70')]();break;case _0xda45('0x7c'):_0x2dbedb=squel['insert']()['into']('cm_hopper')[_0xda45('0x68')]([_0xda45('0x6e'),_0xda45('0x69'),_0xda45('0x6a'),'ListId','CampaignId',_0xda45('0x54'),_0xda45('0x55')],squel[_0xda45('0x6c')]()[_0xda45('0x6d')](_0xda45('0x6e'),'phone')[_0xda45('0x6d')](_0xda45('0x6f'),_0xda45('0x69'))['field']('id','ContactId')[_0xda45('0x6d')](_0x2443b6[_0xda45('0x75')][_0xda45('0x70')](),_0xda45('0x6b'))[_0xda45('0x6d')](_0x58949d[_0xda45('0x47')]['id'][_0xda45('0x70')](),'CampaignId')[_0xda45('0x6d')](_0xda45('0x6f'),'createdAt')[_0xda45('0x6d')](_0xda45('0x6f'),_0xda45('0x55'))['from'](_0xda45('0x72'))['where'](_0xda45('0x73'))[_0xda45('0x3b')]('ListId\x20=\x20?',_0x2443b6['CmListId'][_0xda45('0x70')]())[_0xda45('0x3b')](_0xda45('0x76'))[_0xda45('0x3b')]('phone\x20NOT\x20IN\x20(?)',squel['select']()[_0xda45('0x6d')](_0xda45('0x7a'))['from'](_0xda45('0x7b'))[_0xda45('0x3b')](_0xda45('0x79'),_0x58949d['params']['id'][_0xda45('0x70')]())))[_0xda45('0x70')]();break;default:_0x2dbedb=squel[_0xda45('0x7d')]()[_0xda45('0x67')](_0xda45('0x7b'))[_0xda45('0x68')]([_0xda45('0x6e'),'scheduledAt',_0xda45('0x6a'),_0xda45('0x6b'),_0xda45('0x5b'),'createdAt',_0xda45('0x55')],squel[_0xda45('0x6c')]()['field'](_0xda45('0x6e'),_0xda45('0x6e'))[_0xda45('0x6d')]('NOW()',_0xda45('0x69'))[_0xda45('0x6d')]('id',_0xda45('0x6a'))[_0xda45('0x6d')](_0x2443b6['CmListId'][_0xda45('0x70')](),_0xda45('0x6b'))[_0xda45('0x6d')](_0x58949d[_0xda45('0x47')]['id'][_0xda45('0x70')](),'CampaignId')[_0xda45('0x6d')]('NOW()','createdAt')[_0xda45('0x6d')]('NOW()',_0xda45('0x55'))[_0xda45('0x71')]('cm_contacts')[_0xda45('0x3b')](_0xda45('0x73'))[_0xda45('0x3b')](_0xda45('0x74'),_0x2443b6['CmListId'][_0xda45('0x70')]())[_0xda45('0x3b')](_0xda45('0x76')))[_0xda45('0x70')]();}_0x206747[_0xda45('0x7e')](db['sequelize'][_0xda45('0x33')](_0x2dbedb));}return BPromise[_0xda45('0x7f')](_0x206747);}})[_0xda45('0x23')](function(){return _0x52841d;})[_0xda45('0x23')](respondWithResult(_0x28a9fa,null))[_0xda45('0x45')](handleError(_0x28a9fa,null));};exports[_0xda45('0x80')]=function(_0x24b70a,_0xd709c1,_0x22e03d){return db[_0xda45('0x2d')]['find']({'where':{'id':_0x24b70a[_0xda45('0x47')]['id']}})[_0xda45('0x23')](handleEntityNotFound(_0xd709c1,null))[_0xda45('0x23')](function(_0x5c6384){if(_0x5c6384){return _0x5c6384[_0xda45('0x80')](_0x24b70a[_0xda45('0x33')][_0xda45('0x63')]);}})['then'](function(_0x2f5f48){if(_0x2f5f48){return db[_0xda45('0x5a')][_0xda45('0x24')]({'where':{'ListId':_0x24b70a['query'][_0xda45('0x63')],'CampaignId':_0x24b70a[_0xda45('0x47')]['id']}})['then'](function(){return _0x2f5f48;});}})[_0xda45('0x23')](respondWithStatusCode(_0xd709c1,null))['catch'](handleError(_0xd709c1,null));};exports[_0xda45('0x81')]=function(_0x59fbfb,_0x2faebb,_0x43d63d){var _0x52fe62={'raw':!![],'where':{}};var _0x3e4c67={};var _0x496ba3={'count':0x0,'rows':[]};return db[_0xda45('0x2d')][_0xda45('0x59')]({'where':{'id':_0x59fbfb['params']['id']}})[_0xda45('0x23')](handleEntityNotFound(_0x2faebb,null))[_0xda45('0x23')](function(_0x4c4f8c){if(_0x4c4f8c){_0x3e4c67[_0xda45('0x32')]=_[_0xda45('0x34')](db['CmList'][_0xda45('0x2e')]);_0x3e4c67[_0xda45('0x33')]=_[_0xda45('0x34')](_0x59fbfb[_0xda45('0x33')]);_0x3e4c67['filters']=_[_0xda45('0x48')](_0x3e4c67[_0xda45('0x32')],_0x3e4c67[_0xda45('0x33')]);_0x52fe62[_0xda45('0x35')]=_[_0xda45('0x48')](_0x3e4c67[_0xda45('0x32')],qs['fields'](_0x59fbfb[_0xda45('0x33')][_0xda45('0x49')]));_0x52fe62[_0xda45('0x35')]=_0x52fe62[_0xda45('0x35')][_0xda45('0x36')]?_0x52fe62[_0xda45('0x35')]:_0x3e4c67['model'];if(!_0x59fbfb[_0xda45('0x33')]['hasOwnProperty'](_0xda45('0x38'))){_0x52fe62[_0xda45('0x1c')]=qs[_0xda45('0x1c')](_0x59fbfb[_0xda45('0x33')]['limit']);_0x52fe62[_0xda45('0x1b')]=qs[_0xda45('0x1b')](_0x59fbfb[_0xda45('0x33')][_0xda45('0x1b')]);}_0x52fe62[_0xda45('0x39')]=qs[_0xda45('0x3a')](_0x59fbfb[_0xda45('0x33')][_0xda45('0x3a')]);_0x52fe62[_0xda45('0x3b')]=qs[_0xda45('0x3c')](_[_0xda45('0x3d')](_0x59fbfb[_0xda45('0x33')],_0x3e4c67[_0xda45('0x3c')]));_0x52fe62[_0xda45('0x3b')][_0xda45('0x5b')]=_0x4c4f8c['id'];if(_0x59fbfb[_0xda45('0x33')][_0xda45('0x3e')]){_0x52fe62[_0xda45('0x3b')]=_[_0xda45('0x3f')](_0x52fe62['where'],{'$or':_[_0xda45('0x2c')](_0x52fe62['attributes'],function(_0x523917){var _0x1f33fc={};_0x1f33fc[_0x523917]={'$like':'%'+_0x59fbfb[_0xda45('0x33')][_0xda45('0x3e')]+'%'};return _0x1f33fc;})});}_0x52fe62=_[_0xda45('0x3f')]({},_0x52fe62,_0x59fbfb['options']);return db[_0xda45('0x61')]['count']({'where':_0x52fe62[_0xda45('0x3b')]})[_0xda45('0x23')](function(_0x597cc5){_0x496ba3[_0xda45('0x1a')]=_0x597cc5;if(_0x59fbfb[_0xda45('0x33')][_0xda45('0x41')]){_0x52fe62[_0xda45('0x42')]=[{'all':!![]}];}return db[_0xda45('0x61')][_0xda45('0x43')](_0x52fe62);})[_0xda45('0x23')](function(_0x107c05){_0x496ba3[_0xda45('0x44')]=_0x107c05;return _0x496ba3;});}})['then'](respondWithFilteredResult(_0x2faebb,_0x52fe62))[_0xda45('0x45')](handleError(_0x2faebb,null));};exports[_0xda45('0x82')]=function(_0x52d924,_0x343404,_0x545416){var _0x11a93b,_0x342dd7;return db[_0xda45('0x2d')]['find']({'where':{'id':_0x52d924['params']['id']}})[_0xda45('0x23')](handleEntityNotFound(_0x343404,null))[_0xda45('0x23')](function(_0x31d5d6){if(_0x31d5d6){_0x342dd7=_0x31d5d6;return _0x31d5d6[_0xda45('0x82')](_0x52d924[_0xda45('0x4a')][_0xda45('0x63')],_[_0xda45('0x53')](_0x52d924[_0xda45('0x4a')],[_0xda45('0x63'),'id'])||{});}return null;})['spread'](function(_0x1cd4a6){var _0x197f4b;_0x11a93b=_0x1cd4a6||[];var _0x56c194=[];if(_0x1cd4a6){for(var _0x125fcd=0x0;_0x125fcd<_0x1cd4a6['length'];_0x125fcd+=0x1){var _0xbfa888=_0x1cd4a6[_0x125fcd][_0xda45('0x25')]({'plain':!![]});_0x197f4b=squel[_0xda45('0x7d')]()[_0xda45('0x67')](_0xda45('0x83'))['fromQuery']([_0xda45('0x6e'),_0xda45('0x6a'),_0xda45('0x6b'),_0xda45('0x5b'),_0xda45('0x54'),'updatedAt'],squel['select']()[_0xda45('0x6d')](_0xda45('0x6e'),_0xda45('0x6e'))[_0xda45('0x6d')]('id','ContactId')[_0xda45('0x6d')](_0xbfa888['CmListId'][_0xda45('0x70')](),'ListId')[_0xda45('0x6d')](_0x52d924[_0xda45('0x47')]['id']['toString'](),_0xda45('0x5b'))[_0xda45('0x6d')](_0xda45('0x6f'),_0xda45('0x54'))['field']('NOW()',_0xda45('0x55'))['from']('cm_contacts')[_0xda45('0x3b')](_0xda45('0x73'))[_0xda45('0x3b')](_0xda45('0x74'),_0xbfa888[_0xda45('0x75')]['toString']())['where'](_0xda45('0x76')))[_0xda45('0x70')]();_0x56c194[_0xda45('0x7e')](db[_0xda45('0x84')][_0xda45('0x33')](_0x197f4b));}return BPromise[_0xda45('0x7f')](_0x56c194);}})[_0xda45('0x23')](function(){return _0x11a93b;})[_0xda45('0x23')](respondWithResult(_0x343404,null))[_0xda45('0x45')](handleError(_0x343404,null));};exports[_0xda45('0x85')]=function(_0xfc67d9,_0x2039c7,_0x438eb7){return db[_0xda45('0x2d')]['find']({'where':{'id':_0xfc67d9[_0xda45('0x47')]['id']}})[_0xda45('0x23')](handleEntityNotFound(_0x2039c7,null))[_0xda45('0x23')](function(_0x56a138){if(_0x56a138){return _0x56a138['removeBlackLists'](_0xfc67d9[_0xda45('0x33')][_0xda45('0x63')]);}})['then'](function(_0x3b35c6){if(_0x3b35c6){return db[_0xda45('0x5f')][_0xda45('0x24')]({'where':{'ListId':_0xfc67d9[_0xda45('0x33')][_0xda45('0x63')],'CampaignId':_0xfc67d9['params']['id']}})[_0xda45('0x23')](function(){return _0x3b35c6;});}})['then'](respondWithStatusCode(_0x2039c7,null))[_0xda45('0x45')](handleError(_0x2039c7,null));};
\ No newline at end of file
+var _0x35cd=['querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../mysqldb','end','status','json','offset','limit','set','Content-Range','reject','update','then','IvrCampaigns','UserProfileResource','destroy','sendStatus','error','name','send','index','map','Campaign','type','key','model','query','keys','intersection','attributes','hasOwnProperty','nolimit','where','filters','filter','merge','VIRTUAL','options','count','includeAll','include','findAll','rows','params','rawAttributes','fields','find','catch','create','role','user','get','UserProfileSection','userProfileId','autoAssociation','clone','length','createdAt','updatedAt','body','omit','Unable\x20to\x20retrieve\x20the\x20current\x20user','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','findOne','CmHopper','order','sort','pick','CampaignId','getHopperHistories','CmHopperHistory','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','CmList','addLists','ids','spread','dialCheckDuplicateType','always','insert','into','phone','scheduledAt','ContactId','ListId','select','field','NOW()','CmListId','toString','from','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','CampaignId\x20=\x20?','cm_hopper','fromQuery','cm_contacts','COALESCE(phone,\x27\x27)','push','removeLists','getBlackLists','addBlackLists','cm_hopper_black','sequelize','removeBlackLists','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','jsforce','desk.js'];(function(_0x4f34d1,_0x15d0b8){var _0x3106a4=function(_0x4468ca){while(--_0x4468ca){_0x4f34d1['push'](_0x4f34d1['shift']());}};_0x3106a4(++_0x15d0b8);}(_0x35cd,0xfc));var _0xd35c=function(_0x36405a,_0x762511){_0x36405a=_0x36405a-0x0;var _0x443a48=_0x35cd[_0x36405a];return _0x443a48;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xd35c('0x0'));var rimraf=require(_0xd35c('0x1'));var zipdir=require(_0xd35c('0x2'));var jsonpatch=require(_0xd35c('0x3'));var rp=require(_0xd35c('0x4'));var moment=require(_0xd35c('0x5'));var BPromise=require(_0xd35c('0x6'));var Mustache=require(_0xd35c('0x7'));var util=require(_0xd35c('0x8'));var path=require(_0xd35c('0x9'));var sox=require(_0xd35c('0xa'));var csv=require(_0xd35c('0xb'));var ejs=require(_0xd35c('0xc'));var fs=require('fs');var _=require(_0xd35c('0xd'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xd35c('0xe'));var deskjs=require(_0xd35c('0xf'));var toCsv=require(_0xd35c('0xb'));var querystring=require(_0xd35c('0x10'));var Papa=require(_0xd35c('0x11'));var Redis=require('ioredis');var authService=require(_0xd35c('0x12'));var qs=require(_0xd35c('0x13'));var as=require(_0xd35c('0x14'));var hardwareService=require(_0xd35c('0x15'));var logger=require('../../config/logger')(_0xd35c('0x16'));var utils=require(_0xd35c('0x17'));var config=require('../../config/environment');var db=require(_0xd35c('0x18'))['db'];function respondWithStatusCode(_0x31e59b,_0x2ce633){_0x2ce633=_0x2ce633||0xcc;return function(_0x313630){if(_0x313630){return _0x31e59b['sendStatus'](_0x2ce633);}return _0x31e59b['status'](_0x2ce633)[_0xd35c('0x19')]();};}function respondWithResult(_0x284175,_0x3d3293){_0x3d3293=_0x3d3293||0xc8;return function(_0x168e27){if(_0x168e27){return _0x284175[_0xd35c('0x1a')](_0x3d3293)[_0xd35c('0x1b')](_0x168e27);}};}function respondWithFilteredResult(_0x38a25c,_0xdc1ba2){return function(_0x22fcfa){if(_0x22fcfa){var _0x142cc3=_0x22fcfa['count'],_0xeb9b4a=_0xdc1ba2[_0xd35c('0x1c')],_0x10599a=_0xdc1ba2[_0xd35c('0x1c')]+_0xdc1ba2[_0xd35c('0x1d')],_0x3999d3;if(_0x10599a>=_0x142cc3){_0x10599a=_0x142cc3;_0x3999d3=0xc8;}else{_0x3999d3=0xce;}_0x38a25c[_0xd35c('0x1a')](_0x3999d3);return _0x38a25c[_0xd35c('0x1e')](_0xd35c('0x1f'),_0xeb9b4a+'-'+_0x10599a+'/'+_0x142cc3)[_0xd35c('0x1b')](_0x22fcfa);}return null;};}function patchUpdates(_0x28980e){return function(_0x4b3d0f){try{jsonpatch['apply'](_0x4b3d0f,_0x28980e,!![]);}catch(_0x31d14b){return BPromise[_0xd35c('0x20')](_0x31d14b);}return _0x4b3d0f['save']();};}function saveUpdates(_0x20342a,_0x371595){return function(_0x1cf5cd){if(_0x1cf5cd){return _0x1cf5cd[_0xd35c('0x21')](_0x20342a)['then'](function(_0x25bddd){return _0x25bddd;});}return null;};}function removeEntity(_0x76da2,_0x290911){return function(_0x44fc50){if(_0x44fc50){return _0x44fc50['destroy']()[_0xd35c('0x22')](function(){var _0x2242dd=_0x44fc50['get']({'plain':!![]});var _0x3fc98c=_0xd35c('0x23');return db[_0xd35c('0x24')][_0xd35c('0x25')]({'where':{'type':_0x3fc98c,'resourceId':_0x2242dd['id']}})[_0xd35c('0x22')](function(){return _0x44fc50;});})[_0xd35c('0x22')](function(){_0x76da2['status'](0xcc)[_0xd35c('0x19')]();});}};}function handleEntityNotFound(_0x2efd6e,_0x55358f){return function(_0x27939f){if(!_0x27939f){_0x2efd6e[_0xd35c('0x26')](0x194);}return _0x27939f;};}function handleError(_0x25aa77,_0x5eeb86){_0x5eeb86=_0x5eeb86||0x1f4;return function(_0x42e6a6){logger[_0xd35c('0x27')](_0x42e6a6['stack']);if(_0x42e6a6['name']){delete _0x42e6a6[_0xd35c('0x28')];}_0x25aa77[_0xd35c('0x1a')](_0x5eeb86)[_0xd35c('0x29')](_0x42e6a6);};}exports[_0xd35c('0x2a')]=function(_0x3063de,_0x358805){var _0x4f85f6={},_0x162668={},_0x369522={'count':0x0,'rows':[]};var _0x23230e=_[_0xd35c('0x2b')](db[_0xd35c('0x2c')]['rawAttributes'],function(_0x5aba15){return{'name':_0x5aba15['fieldName'],'type':_0x5aba15[_0xd35c('0x2d')][_0xd35c('0x2e')]};});_0x162668[_0xd35c('0x2f')]=_[_0xd35c('0x2b')](_0x23230e,'name');_0x162668[_0xd35c('0x30')]=_[_0xd35c('0x31')](_0x3063de[_0xd35c('0x30')]);_0x162668['filters']=_[_0xd35c('0x32')](_0x162668[_0xd35c('0x2f')],_0x162668[_0xd35c('0x30')]);_0x4f85f6['attributes']=_['intersection'](_0x162668['model'],qs['fields'](_0x3063de[_0xd35c('0x30')]['fields']));_0x4f85f6[_0xd35c('0x33')]=_0x4f85f6['attributes']['length']?_0x4f85f6[_0xd35c('0x33')]:_0x162668['model'];if(!_0x3063de[_0xd35c('0x30')][_0xd35c('0x34')](_0xd35c('0x35'))){_0x4f85f6[_0xd35c('0x1d')]=qs[_0xd35c('0x1d')](_0x3063de[_0xd35c('0x30')][_0xd35c('0x1d')]);_0x4f85f6[_0xd35c('0x1c')]=qs[_0xd35c('0x1c')](_0x3063de['query'][_0xd35c('0x1c')]);}_0x4f85f6['order']=qs['sort'](_0x3063de[_0xd35c('0x30')]['sort']);_0x4f85f6[_0xd35c('0x36')]=qs[_0xd35c('0x37')](_['pick'](_0x3063de[_0xd35c('0x30')],_0x162668[_0xd35c('0x37')]),_0x23230e);if(_0x3063de['query'][_0xd35c('0x38')]){_0x4f85f6['where']=_[_0xd35c('0x39')](_0x4f85f6[_0xd35c('0x36')],{'$or':_[_0xd35c('0x2b')](_0x23230e,function(_0x4946a3){if(_0x4946a3[_0xd35c('0x2d')]!==_0xd35c('0x3a')){var _0x15e34f={};_0x15e34f[_0x4946a3[_0xd35c('0x28')]]={'$like':'%'+_0x3063de[_0xd35c('0x30')][_0xd35c('0x38')]+'%'};return _0x15e34f;}})});}_0x4f85f6=_[_0xd35c('0x39')]({},_0x4f85f6,_0x3063de[_0xd35c('0x3b')]);var _0x1be4b1={'where':_0x4f85f6[_0xd35c('0x36')]};return db[_0xd35c('0x2c')]['count'](_0x1be4b1)[_0xd35c('0x22')](function(_0x57fca9){_0x369522[_0xd35c('0x3c')]=_0x57fca9;if(_0x3063de[_0xd35c('0x30')][_0xd35c('0x3d')]){_0x4f85f6[_0xd35c('0x3e')]=[{'all':!![]}];}return db[_0xd35c('0x2c')][_0xd35c('0x3f')](_0x4f85f6);})['then'](function(_0x343d26){_0x369522[_0xd35c('0x40')]=_0x343d26;return _0x369522;})[_0xd35c('0x22')](respondWithFilteredResult(_0x358805,_0x4f85f6))['catch'](handleError(_0x358805,null));};exports['show']=function(_0x51cb1f,_0x4c664d){var _0x284a8c={'raw':![],'where':{'id':_0x51cb1f[_0xd35c('0x41')]['id']}},_0x3fada2={};_0x3fada2['model']=_[_0xd35c('0x31')](db[_0xd35c('0x2c')][_0xd35c('0x42')]);_0x3fada2[_0xd35c('0x30')]=_['keys'](_0x51cb1f[_0xd35c('0x30')]);_0x3fada2[_0xd35c('0x37')]=_[_0xd35c('0x32')](_0x3fada2[_0xd35c('0x2f')],_0x3fada2['query']);_0x284a8c[_0xd35c('0x33')]=_[_0xd35c('0x32')](_0x3fada2[_0xd35c('0x2f')],qs[_0xd35c('0x43')](_0x51cb1f[_0xd35c('0x30')][_0xd35c('0x43')]));_0x284a8c['attributes']=_0x284a8c[_0xd35c('0x33')]['length']?_0x284a8c['attributes']:_0x3fada2[_0xd35c('0x2f')];if(_0x51cb1f['query'][_0xd35c('0x3d')]){_0x284a8c[_0xd35c('0x3e')]=[{'all':!![]}];}_0x284a8c=_[_0xd35c('0x39')]({},_0x284a8c,_0x51cb1f[_0xd35c('0x3b')]);return db[_0xd35c('0x2c')][_0xd35c('0x44')](_0x284a8c)[_0xd35c('0x22')](handleEntityNotFound(_0x4c664d,null))['then'](respondWithResult(_0x4c664d,null))[_0xd35c('0x45')](handleError(_0x4c664d,null));};exports[_0xd35c('0x46')]=function(_0x484671,_0x45e630){return db[_0xd35c('0x2c')][_0xd35c('0x46')](_0x484671['body'],{})[_0xd35c('0x22')](function(_0x22198d){var _0x10c539=_0x484671['user']['get']({'plain':!![]});if(!_0x10c539)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x10c539[_0xd35c('0x47')]===_0xd35c('0x48')){var _0x4a80bb=_0x22198d[_0xd35c('0x49')]({'plain':!![]});var _0x4b4337=_0xd35c('0x23');return db[_0xd35c('0x4a')][_0xd35c('0x44')]({'where':{'name':_0x4b4337,'userProfileId':_0x10c539[_0xd35c('0x4b')]},'raw':!![]})[_0xd35c('0x22')](function(_0x4af44b){if(_0x4af44b&&_0x4af44b[_0xd35c('0x4c')]===0x0){return db[_0xd35c('0x24')][_0xd35c('0x46')]({'name':_0x4a80bb[_0xd35c('0x28')],'resourceId':_0x4a80bb['id'],'type':_0x4af44b[_0xd35c('0x28')],'sectionId':_0x4af44b['id']},{})[_0xd35c('0x22')](function(){return _0x22198d;});}else{return _0x22198d;}})[_0xd35c('0x45')](function(_0x47b563){logger[_0xd35c('0x27')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x47b563);throw _0x47b563;});}return _0x22198d;})[_0xd35c('0x22')](respondWithResult(_0x45e630,0xc9))['catch'](handleError(_0x45e630,null));};exports[_0xd35c('0x4d')]=function(_0x27882f,_0x16bd5b){var _0x2f5f47={'where':{'id':_0x27882f[_0xd35c('0x41')]['id']}},_0x1d14d3={};_0x1d14d3[_0xd35c('0x2f')]=_[_0xd35c('0x31')](db[_0xd35c('0x2c')]['rawAttributes']);_0x2f5f47[_0xd35c('0x33')]=_[_0xd35c('0x32')](_0x1d14d3['model'],qs[_0xd35c('0x43')](_0x27882f[_0xd35c('0x30')][_0xd35c('0x43')]));_0x2f5f47[_0xd35c('0x33')]=_0x2f5f47[_0xd35c('0x33')][_0xd35c('0x4e')]?_0x2f5f47[_0xd35c('0x33')]:_0x1d14d3['model'];if(_0x27882f[_0xd35c('0x30')][_0xd35c('0x3d')]){_0x2f5f47[_0xd35c('0x3e')]=[{'all':!![]}];}_0x2f5f47=_['merge']({},_0x2f5f47,_0x27882f[_0xd35c('0x3b')]);return db[_0xd35c('0x2c')][_0xd35c('0x44')](_0x2f5f47)[_0xd35c('0x22')](handleEntityNotFound(_0x16bd5b,null))[_0xd35c('0x22')](function(_0x564fdd){if(_0x564fdd){var _0x37f111=_0x564fdd[_0xd35c('0x49')]({'plain':!![]});_0x37f111=qs['omit'](_0x37f111,['id',_0xd35c('0x4f'),_0xd35c('0x50')]);_0x27882f[_0xd35c('0x51')]=_[_0xd35c('0x52')](_0x27882f['body'],['id',_0xd35c('0x4f'),_0xd35c('0x50')]);return db['Campaign']['create'](_['merge'](_0x37f111,_0x27882f[_0xd35c('0x51')]),{'include':_0x27882f[_0xd35c('0x30')][_0xd35c('0x3d')]?[{'all':!![]}]:undefined})[_0xd35c('0x22')](function(_0x46335d){var _0x26a216=_0x27882f[_0xd35c('0x48')]['get']({'plain':!![]});if(!_0x26a216)throw new Error(_0xd35c('0x53'));if(_0x26a216[_0xd35c('0x47')]===_0xd35c('0x48')){var _0x3c1b09=_0x46335d[_0xd35c('0x49')]({'plain':!![]});var _0x1692a2='IvrCampaigns';return db['UserProfileSection'][_0xd35c('0x44')]({'where':{'name':_0x1692a2,'userProfileId':_0x26a216['userProfileId']},'raw':!![]})[_0xd35c('0x22')](function(_0x137b9b){if(_0x137b9b&&_0x137b9b[_0xd35c('0x4c')]===0x0){return db[_0xd35c('0x24')]['create']({'name':_0x3c1b09[_0xd35c('0x28')],'resourceId':_0x3c1b09['id'],'type':_0x137b9b['name'],'sectionId':_0x137b9b['id']},{})[_0xd35c('0x22')](function(){return _0x46335d;});}else{return _0x46335d;}})[_0xd35c('0x45')](function(_0x55ffff){logger[_0xd35c('0x27')](_0xd35c('0x54'),_0x55ffff);throw _0x55ffff;});}return _0x46335d;});}})[_0xd35c('0x22')](respondWithResult(_0x16bd5b,0xc9))[_0xd35c('0x45')](handleError(_0x16bd5b,null));};exports[_0xd35c('0x21')]=function(_0x38e489,_0x1a8fc2){if(_0x38e489[_0xd35c('0x51')]['id']){delete _0x38e489[_0xd35c('0x51')]['id'];}return db[_0xd35c('0x2c')][_0xd35c('0x44')]({'where':{'id':_0x38e489[_0xd35c('0x41')]['id']}})[_0xd35c('0x22')](handleEntityNotFound(_0x1a8fc2,null))['then'](saveUpdates(_0x38e489[_0xd35c('0x51')],null))['then'](respondWithResult(_0x1a8fc2,null))['catch'](handleError(_0x1a8fc2,null));};exports[_0xd35c('0x25')]=function(_0x4fca1a,_0x1b4a7b){return db['Campaign'][_0xd35c('0x44')]({'where':{'id':_0x4fca1a[_0xd35c('0x41')]['id']}})[_0xd35c('0x22')](handleEntityNotFound(_0x1b4a7b,null))[_0xd35c('0x22')](removeEntity(_0x1b4a7b,null))[_0xd35c('0x45')](handleError(_0x1b4a7b,null));};exports['getHoppers']=function(_0x5de234,_0x6559ba,_0x3f6768){var _0x1cdd83={'raw':!![],'where':{}};var _0x29dc0c={};var _0x130218={'count':0x0,'rows':[]};return db[_0xd35c('0x2c')][_0xd35c('0x55')]({'where':{'id':_0x5de234[_0xd35c('0x41')]['id']}})[_0xd35c('0x22')](handleEntityNotFound(_0x6559ba,null))[_0xd35c('0x22')](function(_0x3dab5f){if(_0x3dab5f){_0x29dc0c[_0xd35c('0x2f')]=_['keys'](db[_0xd35c('0x56')][_0xd35c('0x42')]);_0x29dc0c['query']=_[_0xd35c('0x31')](_0x5de234[_0xd35c('0x30')]);_0x29dc0c[_0xd35c('0x37')]=_[_0xd35c('0x32')](_0x29dc0c[_0xd35c('0x2f')],_0x29dc0c[_0xd35c('0x30')]);_0x1cdd83[_0xd35c('0x33')]=_['intersection'](_0x29dc0c[_0xd35c('0x2f')],qs[_0xd35c('0x43')](_0x5de234[_0xd35c('0x30')][_0xd35c('0x43')]));_0x1cdd83[_0xd35c('0x33')]=_0x1cdd83[_0xd35c('0x33')][_0xd35c('0x4e')]?_0x1cdd83[_0xd35c('0x33')]:_0x29dc0c[_0xd35c('0x2f')];if(!_0x5de234[_0xd35c('0x30')][_0xd35c('0x34')](_0xd35c('0x35'))){_0x1cdd83[_0xd35c('0x1d')]=qs[_0xd35c('0x1d')](_0x5de234[_0xd35c('0x30')][_0xd35c('0x1d')]);_0x1cdd83[_0xd35c('0x1c')]=qs[_0xd35c('0x1c')](_0x5de234[_0xd35c('0x30')][_0xd35c('0x1c')]);}_0x1cdd83[_0xd35c('0x57')]=qs[_0xd35c('0x58')](_0x5de234[_0xd35c('0x30')][_0xd35c('0x58')]);_0x1cdd83[_0xd35c('0x36')]=qs['filters'](_[_0xd35c('0x59')](_0x5de234[_0xd35c('0x30')],_0x29dc0c[_0xd35c('0x37')]));_0x1cdd83['where'][_0xd35c('0x5a')]=_0x3dab5f['id'];if(_0x5de234[_0xd35c('0x30')][_0xd35c('0x38')]){_0x1cdd83[_0xd35c('0x36')]=_[_0xd35c('0x39')](_0x1cdd83['where'],{'$or':_[_0xd35c('0x2b')](_0x1cdd83[_0xd35c('0x33')],function(_0x22b435){var _0x29e16e={};_0x29e16e[_0x22b435]={'$like':'%'+_0x5de234['query'][_0xd35c('0x38')]+'%'};return _0x29e16e;})});}_0x1cdd83=_['merge']({},_0x1cdd83,_0x5de234['options']);return db['CmHopper'][_0xd35c('0x3c')]({'where':_0x1cdd83[_0xd35c('0x36')]})[_0xd35c('0x22')](function(_0x54b917){_0x130218[_0xd35c('0x3c')]=_0x54b917;if(_0x5de234[_0xd35c('0x30')][_0xd35c('0x3d')]){_0x1cdd83['include']=[{'all':!![]}];}return db[_0xd35c('0x56')][_0xd35c('0x3f')](_0x1cdd83);})[_0xd35c('0x22')](function(_0x133496){_0x130218[_0xd35c('0x40')]=_0x133496;return _0x130218;});}})[_0xd35c('0x22')](respondWithFilteredResult(_0x6559ba,_0x1cdd83))[_0xd35c('0x45')](handleError(_0x6559ba,null));};exports[_0xd35c('0x5b')]=function(_0x2102c1,_0x443acf,_0x12b3a4){var _0xc59bf5={'raw':!![],'where':{}};var _0xfc6b35={};var _0x503ec8={'count':0x0,'rows':[]};return db[_0xd35c('0x2c')][_0xd35c('0x55')]({'where':{'id':_0x2102c1[_0xd35c('0x41')]['id']}})[_0xd35c('0x22')](handleEntityNotFound(_0x443acf,null))[_0xd35c('0x22')](function(_0x24ef43){if(_0x24ef43){_0xfc6b35[_0xd35c('0x2f')]=_[_0xd35c('0x31')](db['CmHopperHistory'][_0xd35c('0x42')]);_0xfc6b35[_0xd35c('0x30')]=_['keys'](_0x2102c1['query']);_0xfc6b35[_0xd35c('0x37')]=_[_0xd35c('0x32')](_0xfc6b35['model'],_0xfc6b35['query']);_0xc59bf5[_0xd35c('0x33')]=_[_0xd35c('0x32')](_0xfc6b35[_0xd35c('0x2f')],qs[_0xd35c('0x43')](_0x2102c1[_0xd35c('0x30')][_0xd35c('0x43')]));_0xc59bf5[_0xd35c('0x33')]=_0xc59bf5['attributes']['length']?_0xc59bf5[_0xd35c('0x33')]:_0xfc6b35[_0xd35c('0x2f')];if(!_0x2102c1['query']['hasOwnProperty'](_0xd35c('0x35'))){_0xc59bf5[_0xd35c('0x1d')]=qs[_0xd35c('0x1d')](_0x2102c1[_0xd35c('0x30')][_0xd35c('0x1d')]);_0xc59bf5[_0xd35c('0x1c')]=qs['offset'](_0x2102c1[_0xd35c('0x30')][_0xd35c('0x1c')]);}_0xc59bf5[_0xd35c('0x57')]=qs['sort'](_0x2102c1[_0xd35c('0x30')][_0xd35c('0x58')]);_0xc59bf5['where']=qs['filters'](_[_0xd35c('0x59')](_0x2102c1[_0xd35c('0x30')],_0xfc6b35[_0xd35c('0x37')]));_0xc59bf5[_0xd35c('0x36')]['CampaignId']=_0x24ef43['id'];if(_0x2102c1[_0xd35c('0x30')][_0xd35c('0x38')]){_0xc59bf5[_0xd35c('0x36')]=_[_0xd35c('0x39')](_0xc59bf5[_0xd35c('0x36')],{'$or':_[_0xd35c('0x2b')](_0xc59bf5['attributes'],function(_0x248721){var _0x32dab0={};_0x32dab0[_0x248721]={'$like':'%'+_0x2102c1[_0xd35c('0x30')][_0xd35c('0x38')]+'%'};return _0x32dab0;})});}_0xc59bf5=_[_0xd35c('0x39')]({},_0xc59bf5,_0x2102c1[_0xd35c('0x3b')]);return db[_0xd35c('0x5c')][_0xd35c('0x3c')]({'where':_0xc59bf5['where']})['then'](function(_0x29c0a6){_0x503ec8['count']=_0x29c0a6;if(_0x2102c1[_0xd35c('0x30')]['includeAll']){_0xc59bf5[_0xd35c('0x3e')]=[{'all':!![]}];}return db[_0xd35c('0x5c')][_0xd35c('0x3f')](_0xc59bf5);})[_0xd35c('0x22')](function(_0xa20886){_0x503ec8[_0xd35c('0x40')]=_0xa20886;return _0x503ec8;});}})['then'](respondWithFilteredResult(_0x443acf,_0xc59bf5))[_0xd35c('0x45')](handleError(_0x443acf,null));};exports[_0xd35c('0x5d')]=function(_0x16c062,_0xd02a3c,_0x25862a){var _0x4b12cb={'raw':!![],'where':{}};var _0x2cf388={};var _0x5ca584={'count':0x0,'rows':[]};return db[_0xd35c('0x2c')][_0xd35c('0x55')]({'where':{'id':_0x16c062[_0xd35c('0x41')]['id']}})[_0xd35c('0x22')](handleEntityNotFound(_0xd02a3c,null))[_0xd35c('0x22')](function(_0xc3eace){if(_0xc3eace){_0x2cf388['model']=_['keys'](db[_0xd35c('0x5e')][_0xd35c('0x42')]);_0x2cf388['query']=_[_0xd35c('0x31')](_0x16c062[_0xd35c('0x30')]);_0x2cf388['filters']=_['intersection'](_0x2cf388[_0xd35c('0x2f')],_0x2cf388[_0xd35c('0x30')]);_0x4b12cb['attributes']=_[_0xd35c('0x32')](_0x2cf388[_0xd35c('0x2f')],qs[_0xd35c('0x43')](_0x16c062[_0xd35c('0x30')]['fields']));_0x4b12cb[_0xd35c('0x33')]=_0x4b12cb[_0xd35c('0x33')]['length']?_0x4b12cb[_0xd35c('0x33')]:_0x2cf388[_0xd35c('0x2f')];if(!_0x16c062[_0xd35c('0x30')][_0xd35c('0x34')](_0xd35c('0x35'))){_0x4b12cb[_0xd35c('0x1d')]=qs[_0xd35c('0x1d')](_0x16c062[_0xd35c('0x30')]['limit']);_0x4b12cb[_0xd35c('0x1c')]=qs[_0xd35c('0x1c')](_0x16c062[_0xd35c('0x30')][_0xd35c('0x1c')]);}_0x4b12cb[_0xd35c('0x57')]=qs['sort'](_0x16c062[_0xd35c('0x30')]['sort']);_0x4b12cb[_0xd35c('0x36')]=qs[_0xd35c('0x37')](_[_0xd35c('0x59')](_0x16c062['query'],_0x2cf388[_0xd35c('0x37')]));_0x4b12cb[_0xd35c('0x36')][_0xd35c('0x5a')]=_0xc3eace['id'];if(_0x16c062[_0xd35c('0x30')]['filter']){_0x4b12cb[_0xd35c('0x36')]=_[_0xd35c('0x39')](_0x4b12cb[_0xd35c('0x36')],{'$or':_[_0xd35c('0x2b')](_0x4b12cb[_0xd35c('0x33')],function(_0x5c377c){var _0x4f83ec={};_0x4f83ec[_0x5c377c]={'$like':'%'+_0x16c062['query'][_0xd35c('0x38')]+'%'};return _0x4f83ec;})});}_0x4b12cb=_['merge']({},_0x4b12cb,_0x16c062[_0xd35c('0x3b')]);return db['CmHopperFinal'][_0xd35c('0x3c')]({'where':_0x4b12cb[_0xd35c('0x36')]})[_0xd35c('0x22')](function(_0x2e2096){_0x5ca584[_0xd35c('0x3c')]=_0x2e2096;if(_0x16c062[_0xd35c('0x30')][_0xd35c('0x3d')]){_0x4b12cb[_0xd35c('0x3e')]=[{'all':!![]}];}return db[_0xd35c('0x5e')][_0xd35c('0x3f')](_0x4b12cb);})[_0xd35c('0x22')](function(_0x212254){_0x5ca584['rows']=_0x212254;return _0x5ca584;});}})[_0xd35c('0x22')](respondWithFilteredResult(_0xd02a3c,_0x4b12cb))[_0xd35c('0x45')](handleError(_0xd02a3c,null));};exports[_0xd35c('0x5f')]=function(_0x4189f7,_0x3e7509,_0x1ca543){var _0x1ae2b6={'raw':!![],'where':{}};var _0x403ff1={};var _0x2acafd={'count':0x0,'rows':[]};return db['Campaign'][_0xd35c('0x55')]({'where':{'id':_0x4189f7['params']['id']}})[_0xd35c('0x22')](handleEntityNotFound(_0x3e7509,null))[_0xd35c('0x22')](function(_0x4350a2){if(_0x4350a2){_0x403ff1['model']=_[_0xd35c('0x31')](db[_0xd35c('0x60')][_0xd35c('0x42')]);_0x403ff1[_0xd35c('0x30')]=_[_0xd35c('0x31')](_0x4189f7[_0xd35c('0x30')]);_0x403ff1[_0xd35c('0x37')]=_['intersection'](_0x403ff1[_0xd35c('0x2f')],_0x403ff1[_0xd35c('0x30')]);_0x1ae2b6['attributes']=_['intersection'](_0x403ff1[_0xd35c('0x2f')],qs['fields'](_0x4189f7[_0xd35c('0x30')][_0xd35c('0x43')]));_0x1ae2b6[_0xd35c('0x33')]=_0x1ae2b6['attributes'][_0xd35c('0x4e')]?_0x1ae2b6[_0xd35c('0x33')]:_0x403ff1['model'];if(!_0x4189f7['query'][_0xd35c('0x34')](_0xd35c('0x35'))){_0x1ae2b6[_0xd35c('0x1d')]=qs[_0xd35c('0x1d')](_0x4189f7[_0xd35c('0x30')][_0xd35c('0x1d')]);_0x1ae2b6[_0xd35c('0x1c')]=qs[_0xd35c('0x1c')](_0x4189f7[_0xd35c('0x30')][_0xd35c('0x1c')]);}_0x1ae2b6[_0xd35c('0x57')]=qs[_0xd35c('0x58')](_0x4189f7[_0xd35c('0x30')][_0xd35c('0x58')]);_0x1ae2b6[_0xd35c('0x36')]=qs[_0xd35c('0x37')](_[_0xd35c('0x59')](_0x4189f7[_0xd35c('0x30')],_0x403ff1[_0xd35c('0x37')]));_0x1ae2b6[_0xd35c('0x36')][_0xd35c('0x5a')]=_0x4350a2['id'];if(_0x4189f7['query'][_0xd35c('0x38')]){_0x1ae2b6[_0xd35c('0x36')]=_[_0xd35c('0x39')](_0x1ae2b6['where'],{'$or':_[_0xd35c('0x2b')](_0x1ae2b6['attributes'],function(_0xf480dc){var _0x48927b={};_0x48927b[_0xf480dc]={'$like':'%'+_0x4189f7[_0xd35c('0x30')][_0xd35c('0x38')]+'%'};return _0x48927b;})});}_0x1ae2b6=_['merge']({},_0x1ae2b6,_0x4189f7[_0xd35c('0x3b')]);return db['CmHopperBlack'][_0xd35c('0x3c')]({'where':_0x1ae2b6[_0xd35c('0x36')]})[_0xd35c('0x22')](function(_0x523c58){_0x2acafd[_0xd35c('0x3c')]=_0x523c58;if(_0x4189f7['query'][_0xd35c('0x3d')]){_0x1ae2b6[_0xd35c('0x3e')]=[{'all':!![]}];}return db[_0xd35c('0x60')][_0xd35c('0x3f')](_0x1ae2b6);})['then'](function(_0x30158b){_0x2acafd[_0xd35c('0x40')]=_0x30158b;return _0x2acafd;});}})[_0xd35c('0x22')](respondWithFilteredResult(_0x3e7509,_0x1ae2b6))['catch'](handleError(_0x3e7509,null));};exports[_0xd35c('0x61')]=function(_0x103b35,_0x5e24bc,_0x1a689f){var _0x3e01b7={};var _0x39edc7={};var _0x55908b;var _0x3a1bf7;return db[_0xd35c('0x2c')]['findOne']({'where':{'id':_0x103b35[_0xd35c('0x41')]['id']}})[_0xd35c('0x22')](handleEntityNotFound(_0x5e24bc,null))[_0xd35c('0x22')](function(_0x15c7e8){if(_0x15c7e8){_0x55908b=_0x15c7e8;_0x39edc7[_0xd35c('0x2f')]=_[_0xd35c('0x31')](db[_0xd35c('0x62')][_0xd35c('0x42')]);_0x39edc7[_0xd35c('0x30')]=_[_0xd35c('0x31')](_0x103b35[_0xd35c('0x30')]);_0x39edc7[_0xd35c('0x37')]=_[_0xd35c('0x32')](_0x39edc7[_0xd35c('0x2f')],_0x39edc7['query']);_0x3e01b7['attributes']=_[_0xd35c('0x32')](_0x39edc7[_0xd35c('0x2f')],qs[_0xd35c('0x43')](_0x103b35['query'][_0xd35c('0x43')]));_0x3e01b7['attributes']=_0x3e01b7['attributes'][_0xd35c('0x4e')]?_0x3e01b7['attributes']:_0x39edc7[_0xd35c('0x2f')];_0x3e01b7['order']=qs[_0xd35c('0x58')](_0x103b35['query']['sort']);_0x3e01b7['where']=qs[_0xd35c('0x37')](_[_0xd35c('0x59')](_0x103b35['query'],_0x39edc7['filters']));if(_0x103b35['query'][_0xd35c('0x38')]){_0x3e01b7[_0xd35c('0x36')]=_[_0xd35c('0x39')](_0x3e01b7[_0xd35c('0x36')],{'$or':_['map'](_0x3e01b7[_0xd35c('0x33')],function(_0xac6f0){var _0x41e29a={};_0x41e29a[_0xac6f0]={'$like':'%'+_0x103b35[_0xd35c('0x30')][_0xd35c('0x38')]+'%'};return _0x41e29a;})});}_0x3e01b7=_[_0xd35c('0x39')]({},_0x3e01b7,_0x103b35[_0xd35c('0x3b')]);return _0x55908b[_0xd35c('0x61')](_0x3e01b7);}})[_0xd35c('0x22')](function(_0x11645c){if(_0x11645c){_0x3a1bf7=_0x11645c[_0xd35c('0x4e')];if(!_0x103b35['query'][_0xd35c('0x34')](_0xd35c('0x35'))){_0x3e01b7[_0xd35c('0x1d')]=qs[_0xd35c('0x1d')](_0x103b35[_0xd35c('0x30')][_0xd35c('0x1d')]);_0x3e01b7[_0xd35c('0x1c')]=qs[_0xd35c('0x1c')](_0x103b35[_0xd35c('0x30')][_0xd35c('0x1c')]);}return _0x55908b[_0xd35c('0x61')](_0x3e01b7);}})['then'](function(_0x4df973){if(_0x4df973){return _0x4df973?{'count':_0x3a1bf7,'rows':_0x4df973}:null;}})[_0xd35c('0x22')](respondWithResult(_0x5e24bc,null))[_0xd35c('0x45')](handleError(_0x5e24bc,null));};exports[_0xd35c('0x63')]=function(_0x2f5e98,_0x48b3bb,_0x4ac63c){var _0x551a2f,_0xa61082;return db[_0xd35c('0x2c')][_0xd35c('0x44')]({'where':{'id':_0x2f5e98[_0xd35c('0x41')]['id']}})[_0xd35c('0x22')](handleEntityNotFound(_0x48b3bb,null))[_0xd35c('0x22')](function(_0x17de90){if(_0x17de90){_0xa61082=_0x17de90;return _0x17de90[_0xd35c('0x63')](_0x2f5e98[_0xd35c('0x51')][_0xd35c('0x64')],_[_0xd35c('0x52')](_0x2f5e98[_0xd35c('0x51')],[_0xd35c('0x64'),'id'])||{});}return null;})[_0xd35c('0x65')](function(_0xba488d){var _0x260e76;_0x551a2f=_0xba488d||[];var _0x4e2d27=[];if(_0xba488d){for(var _0x5c238c=0x0;_0x5c238c<_0xba488d[_0xd35c('0x4e')];_0x5c238c+=0x1){var _0x4a978d=_0xba488d[_0x5c238c][_0xd35c('0x49')]({'plain':!![]});_0xa61082[_0xd35c('0x66')]=_0x2f5e98['body'][_0xd35c('0x66')]?_0x2f5e98['body'][_0xd35c('0x66')]:_0xa61082['dialCheckDuplicateType'];switch(_0xa61082[_0xd35c('0x66')]){case _0xd35c('0x67'):_0x260e76=squel[_0xd35c('0x68')]()[_0xd35c('0x69')]('cm_hopper')['fromQuery']([_0xd35c('0x6a'),_0xd35c('0x6b'),_0xd35c('0x6c'),_0xd35c('0x6d'),'CampaignId','createdAt',_0xd35c('0x50')],squel[_0xd35c('0x6e')]()[_0xd35c('0x6f')](_0xd35c('0x6a'),_0xd35c('0x6a'))['field'](_0xd35c('0x70'),_0xd35c('0x6b'))[_0xd35c('0x6f')]('id',_0xd35c('0x6c'))[_0xd35c('0x6f')](_0x4a978d[_0xd35c('0x71')][_0xd35c('0x72')](),_0xd35c('0x6d'))['field'](_0x2f5e98['params']['id'][_0xd35c('0x72')](),_0xd35c('0x5a'))[_0xd35c('0x6f')](_0xd35c('0x70'),_0xd35c('0x4f'))[_0xd35c('0x6f')](_0xd35c('0x70'),'updatedAt')[_0xd35c('0x73')]('cm_contacts')[_0xd35c('0x36')](_0xd35c('0x74'))['where'](_0xd35c('0x75'),_0x4a978d[_0xd35c('0x71')]['toString']())[_0xd35c('0x36')](_0xd35c('0x76'))[_0xd35c('0x36')](_0xd35c('0x77'),squel[_0xd35c('0x6e')]()[_0xd35c('0x6f')](_0xd35c('0x78'))[_0xd35c('0x73')](_0xd35c('0x79'))[_0xd35c('0x36')](_0xd35c('0x7a'),_0x2f5e98[_0xd35c('0x41')]['id'][_0xd35c('0x72')]()))['where'](_0xd35c('0x77'),squel[_0xd35c('0x6e')]()[_0xd35c('0x6f')]('COALESCE(phone,\x27\x27)')['from'](_0xd35c('0x7b'))[_0xd35c('0x36')]('CampaignId\x20=\x20?',_0x2f5e98[_0xd35c('0x41')]['id'][_0xd35c('0x72')]())))['toString']();break;case'onlyIfOpen':_0x260e76=squel[_0xd35c('0x68')]()[_0xd35c('0x69')]('cm_hopper')[_0xd35c('0x7c')](['phone',_0xd35c('0x6b'),_0xd35c('0x6c'),_0xd35c('0x6d'),_0xd35c('0x5a'),_0xd35c('0x4f'),_0xd35c('0x50')],squel[_0xd35c('0x6e')]()[_0xd35c('0x6f')](_0xd35c('0x6a'),'phone')[_0xd35c('0x6f')](_0xd35c('0x70'),_0xd35c('0x6b'))[_0xd35c('0x6f')]('id',_0xd35c('0x6c'))[_0xd35c('0x6f')](_0x4a978d[_0xd35c('0x71')][_0xd35c('0x72')](),_0xd35c('0x6d'))[_0xd35c('0x6f')](_0x2f5e98[_0xd35c('0x41')]['id'][_0xd35c('0x72')](),_0xd35c('0x5a'))[_0xd35c('0x6f')](_0xd35c('0x70'),'createdAt')[_0xd35c('0x6f')](_0xd35c('0x70'),_0xd35c('0x50'))[_0xd35c('0x73')](_0xd35c('0x7d'))['where']('deletedAt\x20IS\x20NULL')[_0xd35c('0x36')](_0xd35c('0x75'),_0x4a978d[_0xd35c('0x71')][_0xd35c('0x72')]())[_0xd35c('0x36')](_0xd35c('0x76'))[_0xd35c('0x36')](_0xd35c('0x77'),squel[_0xd35c('0x6e')]()[_0xd35c('0x6f')](_0xd35c('0x7e'))[_0xd35c('0x73')](_0xd35c('0x7b'))['where']('CampaignId\x20=\x20?',_0x2f5e98['params']['id'][_0xd35c('0x72')]())))['toString']();break;default:_0x260e76=squel['insert']()['into']('cm_hopper')['fromQuery']([_0xd35c('0x6a'),_0xd35c('0x6b'),_0xd35c('0x6c'),_0xd35c('0x6d'),_0xd35c('0x5a'),_0xd35c('0x4f'),_0xd35c('0x50')],squel[_0xd35c('0x6e')]()['field']('phone','phone')['field'](_0xd35c('0x70'),'scheduledAt')['field']('id','ContactId')['field'](_0x4a978d[_0xd35c('0x71')][_0xd35c('0x72')](),_0xd35c('0x6d'))['field'](_0x2f5e98[_0xd35c('0x41')]['id'][_0xd35c('0x72')](),_0xd35c('0x5a'))[_0xd35c('0x6f')](_0xd35c('0x70'),_0xd35c('0x4f'))[_0xd35c('0x6f')]('NOW()',_0xd35c('0x50'))[_0xd35c('0x73')](_0xd35c('0x7d'))[_0xd35c('0x36')](_0xd35c('0x74'))[_0xd35c('0x36')](_0xd35c('0x75'),_0x4a978d[_0xd35c('0x71')][_0xd35c('0x72')]())[_0xd35c('0x36')]('phone\x20IS\x20NOT\x20NULL'))[_0xd35c('0x72')]();}_0x4e2d27[_0xd35c('0x7f')](db['sequelize'][_0xd35c('0x30')](_0x260e76));}return BPromise['all'](_0x4e2d27);}})[_0xd35c('0x22')](function(){return _0x551a2f;})['then'](respondWithResult(_0x48b3bb,null))[_0xd35c('0x45')](handleError(_0x48b3bb,null));};exports[_0xd35c('0x80')]=function(_0x539656,_0x154b2b,_0x41bac9){return db[_0xd35c('0x2c')][_0xd35c('0x44')]({'where':{'id':_0x539656[_0xd35c('0x41')]['id']}})[_0xd35c('0x22')](handleEntityNotFound(_0x154b2b,null))['then'](function(_0x2180f4){if(_0x2180f4){return _0x2180f4[_0xd35c('0x80')](_0x539656[_0xd35c('0x30')][_0xd35c('0x64')]);}})[_0xd35c('0x22')](function(_0x36e671){if(_0x36e671){return db[_0xd35c('0x56')][_0xd35c('0x25')]({'where':{'ListId':_0x539656[_0xd35c('0x30')][_0xd35c('0x64')],'CampaignId':_0x539656[_0xd35c('0x41')]['id']}})['then'](function(){return _0x36e671;});}})[_0xd35c('0x22')](respondWithStatusCode(_0x154b2b,null))[_0xd35c('0x45')](handleError(_0x154b2b,null));};exports[_0xd35c('0x81')]=function(_0x18fc2b,_0x4d6a35,_0x3dfc4a){var _0x2c65a3={'raw':!![],'where':{}};var _0x2722fe={};var _0x2f8770={'count':0x0,'rows':[]};return db[_0xd35c('0x2c')][_0xd35c('0x55')]({'where':{'id':_0x18fc2b['params']['id']}})['then'](handleEntityNotFound(_0x4d6a35,null))['then'](function(_0x3b60b9){if(_0x3b60b9){_0x2722fe[_0xd35c('0x2f')]=_[_0xd35c('0x31')](db[_0xd35c('0x62')]['rawAttributes']);_0x2722fe[_0xd35c('0x30')]=_['keys'](_0x18fc2b[_0xd35c('0x30')]);_0x2722fe[_0xd35c('0x37')]=_[_0xd35c('0x32')](_0x2722fe['model'],_0x2722fe[_0xd35c('0x30')]);_0x2c65a3['attributes']=_[_0xd35c('0x32')](_0x2722fe[_0xd35c('0x2f')],qs[_0xd35c('0x43')](_0x18fc2b[_0xd35c('0x30')][_0xd35c('0x43')]));_0x2c65a3[_0xd35c('0x33')]=_0x2c65a3[_0xd35c('0x33')][_0xd35c('0x4e')]?_0x2c65a3['attributes']:_0x2722fe['model'];if(!_0x18fc2b[_0xd35c('0x30')][_0xd35c('0x34')](_0xd35c('0x35'))){_0x2c65a3['limit']=qs[_0xd35c('0x1d')](_0x18fc2b[_0xd35c('0x30')][_0xd35c('0x1d')]);_0x2c65a3[_0xd35c('0x1c')]=qs[_0xd35c('0x1c')](_0x18fc2b[_0xd35c('0x30')][_0xd35c('0x1c')]);}_0x2c65a3['order']=qs[_0xd35c('0x58')](_0x18fc2b[_0xd35c('0x30')][_0xd35c('0x58')]);_0x2c65a3[_0xd35c('0x36')]=qs[_0xd35c('0x37')](_[_0xd35c('0x59')](_0x18fc2b['query'],_0x2722fe[_0xd35c('0x37')]));_0x2c65a3[_0xd35c('0x36')][_0xd35c('0x5a')]=_0x3b60b9['id'];if(_0x18fc2b[_0xd35c('0x30')]['filter']){_0x2c65a3['where']=_[_0xd35c('0x39')](_0x2c65a3['where'],{'$or':_['map'](_0x2c65a3[_0xd35c('0x33')],function(_0x4140e9){var _0x4fe71f={};_0x4fe71f[_0x4140e9]={'$like':'%'+_0x18fc2b[_0xd35c('0x30')]['filter']+'%'};return _0x4fe71f;})});}_0x2c65a3=_[_0xd35c('0x39')]({},_0x2c65a3,_0x18fc2b[_0xd35c('0x3b')]);return db[_0xd35c('0x62')][_0xd35c('0x3c')]({'where':_0x2c65a3['where']})[_0xd35c('0x22')](function(_0x58c914){_0x2f8770[_0xd35c('0x3c')]=_0x58c914;if(_0x18fc2b[_0xd35c('0x30')][_0xd35c('0x3d')]){_0x2c65a3[_0xd35c('0x3e')]=[{'all':!![]}];}return db[_0xd35c('0x62')]['findAll'](_0x2c65a3);})['then'](function(_0x2013a0){_0x2f8770[_0xd35c('0x40')]=_0x2013a0;return _0x2f8770;});}})['then'](respondWithFilteredResult(_0x4d6a35,_0x2c65a3))['catch'](handleError(_0x4d6a35,null));};exports[_0xd35c('0x82')]=function(_0x2c6680,_0x613088,_0x388ddc){var _0x31c3a9,_0x36b1ec;return db[_0xd35c('0x2c')][_0xd35c('0x44')]({'where':{'id':_0x2c6680[_0xd35c('0x41')]['id']}})['then'](handleEntityNotFound(_0x613088,null))[_0xd35c('0x22')](function(_0x53a7c4){if(_0x53a7c4){_0x36b1ec=_0x53a7c4;return _0x53a7c4['addBlackLists'](_0x2c6680[_0xd35c('0x51')][_0xd35c('0x64')],_[_0xd35c('0x52')](_0x2c6680[_0xd35c('0x51')],[_0xd35c('0x64'),'id'])||{});}return null;})[_0xd35c('0x65')](function(_0x5e478a){var _0xecd66f;_0x31c3a9=_0x5e478a||[];var _0x16474f=[];if(_0x5e478a){for(var _0x356295=0x0;_0x356295<_0x5e478a[_0xd35c('0x4e')];_0x356295+=0x1){var _0x2586b1=_0x5e478a[_0x356295][_0xd35c('0x49')]({'plain':!![]});_0xecd66f=squel[_0xd35c('0x68')]()['into'](_0xd35c('0x83'))['fromQuery']([_0xd35c('0x6a'),'ContactId',_0xd35c('0x6d'),'CampaignId',_0xd35c('0x4f'),_0xd35c('0x50')],squel[_0xd35c('0x6e')]()[_0xd35c('0x6f')](_0xd35c('0x6a'),_0xd35c('0x6a'))[_0xd35c('0x6f')]('id','ContactId')['field'](_0x2586b1[_0xd35c('0x71')][_0xd35c('0x72')](),_0xd35c('0x6d'))[_0xd35c('0x6f')](_0x2c6680['params']['id'][_0xd35c('0x72')](),_0xd35c('0x5a'))[_0xd35c('0x6f')](_0xd35c('0x70'),_0xd35c('0x4f'))[_0xd35c('0x6f')](_0xd35c('0x70'),_0xd35c('0x50'))['from'](_0xd35c('0x7d'))['where'](_0xd35c('0x74'))['where'](_0xd35c('0x75'),_0x2586b1[_0xd35c('0x71')][_0xd35c('0x72')]())[_0xd35c('0x36')](_0xd35c('0x76')))[_0xd35c('0x72')]();_0x16474f[_0xd35c('0x7f')](db[_0xd35c('0x84')][_0xd35c('0x30')](_0xecd66f));}return BPromise['all'](_0x16474f);}})[_0xd35c('0x22')](function(){return _0x31c3a9;})['then'](respondWithResult(_0x613088,null))[_0xd35c('0x45')](handleError(_0x613088,null));};exports[_0xd35c('0x85')]=function(_0x4d3858,_0x28c08e,_0x7c4e75){return db[_0xd35c('0x2c')]['find']({'where':{'id':_0x4d3858['params']['id']}})[_0xd35c('0x22')](handleEntityNotFound(_0x28c08e,null))[_0xd35c('0x22')](function(_0x896587){if(_0x896587){return _0x896587[_0xd35c('0x85')](_0x4d3858['query'][_0xd35c('0x64')]);}})[_0xd35c('0x22')](function(_0x1828c6){if(_0x1828c6){return db[_0xd35c('0x60')][_0xd35c('0x25')]({'where':{'ListId':_0x4d3858[_0xd35c('0x30')][_0xd35c('0x64')],'CampaignId':_0x4d3858[_0xd35c('0x41')]['id']}})[_0xd35c('0x22')](function(){return _0x1828c6;});}})[_0xd35c('0x22')](respondWithStatusCode(_0x28c08e,null))[_0xd35c('0x45')](handleError(_0x28c08e,null));};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.model.js b/server/api/campaign/campaign.model.js
index 12b3d36..7a68ce1 100644
--- a/server/api/campaign/campaign.model.js
+++ b/server/api/campaign/campaign.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xb10b=['api','moment','request-promise','path','rimraf','../../config/environment','./campaign.attributes','exports','define','campaigns','lodash','../../config/logger'];(function(_0x3c6b7d,_0x5f0d90){var _0x1d3ed2=function(_0x1a8f35){while(--_0x1a8f35){_0x3c6b7d['push'](_0x3c6b7d['shift']());}};_0x1d3ed2(++_0x5f0d90);}(_0xb10b,0x12a));var _0xbb10=function(_0x29fa3d,_0x45d24f){_0x29fa3d=_0x29fa3d-0x0;var _0x5d4bbf=_0xb10b[_0x29fa3d];return _0x5d4bbf;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var logger=require(_0xbb10('0x1'))(_0xbb10('0x2'));var moment=require(_0xbb10('0x3'));var BPromise=require('bluebird');var rp=require(_0xbb10('0x4'));var fs=require('fs');var path=require(_0xbb10('0x5'));var rimraf=require(_0xbb10('0x6'));var config=require(_0xbb10('0x7'));var attributes=require(_0xbb10('0x8'));module[_0xbb10('0x9')]=function(_0x481979,_0x328583){return _0x481979[_0xbb10('0xa')]('Campaign',attributes,{'tableName':_0xbb10('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xb10b=['api','moment','request-promise','path','rimraf','../../config/environment','./campaign.attributes','exports','define','campaigns','lodash','../../config/logger'];(function(_0x215e65,_0x183f97){var _0xa85842=function(_0x43bf45){while(--_0x43bf45){_0x215e65['push'](_0x215e65['shift']());}};_0xa85842(++_0x183f97);}(_0xb10b,0x12a));var _0xbb10=function(_0x161ec6,_0x580285){_0x161ec6=_0x161ec6-0x0;var _0x477176=_0xb10b[_0x161ec6];return _0x477176;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var logger=require(_0xbb10('0x1'))(_0xbb10('0x2'));var moment=require(_0xbb10('0x3'));var BPromise=require('bluebird');var rp=require(_0xbb10('0x4'));var fs=require('fs');var path=require(_0xbb10('0x5'));var rimraf=require(_0xbb10('0x6'));var config=require(_0xbb10('0x7'));var attributes=require(_0xbb10('0x8'));module[_0xbb10('0x9')]=function(_0x481979,_0x328583){return _0x481979[_0xbb10('0xa')]('Campaign',attributes,{'tableName':_0xbb10('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.rpc.js b/server/api/campaign/campaign.rpc.js
index f70a9f7..7abee32 100644
--- a/server/api/campaign/campaign.rpc.js
+++ b/server/api/campaign/campaign.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9957=['catch','GetCampaign','findAll','raw','options','where','attributes','limit','map','include','model','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','Campaign,\x20%s,\x20%s','request\x20sent','debug','Campaign,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result'];(function(_0x175757,_0xf83378){var _0x25b780=function(_0x57b71e){while(--_0x57b71e){_0x175757['push'](_0x175757['shift']());}};_0x25b780(++_0xf83378);}(_0x9957,0x93));var _0x7995=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x9957[_0x2f5ac5];return _0x37c9a8;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var moment=require(_0x7995('0x2'));var BPromise=require(_0x7995('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7995('0x4'));var db=require(_0x7995('0x5'))['db'];var utils=require(_0x7995('0x6'));var logger=require(_0x7995('0x7'))('rpc');var config=require(_0x7995('0x8'));var jayson=require(_0x7995('0x9'));var client=jayson[_0x7995('0xa')][_0x7995('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xbda126,_0x326741,_0x4996ca){return new BPromise(function(_0x465276,_0x1cad37){return client['request'](_0xbda126,_0x4996ca)[_0x7995('0xc')](function(_0x3116fb){logger[_0x7995('0xd')](_0x7995('0xe'),_0x326741,_0x7995('0xf'));logger[_0x7995('0x10')](_0x7995('0x11'),_0x326741,'request\x20sent',JSON[_0x7995('0x12')](_0x3116fb));if(_0x3116fb[_0x7995('0x13')]){if(_0x3116fb['error'][_0x7995('0x14')]===0x1f4){logger[_0x7995('0x13')](_0x7995('0xe'),_0x326741,_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);return _0x1cad37(_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);}logger['error']('Campaign,\x20%s,\x20%s',_0x326741,_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);return _0x465276(_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);}else{logger[_0x7995('0xd')](_0x7995('0xe'),_0x326741,_0x7995('0xf'));_0x465276(_0x3116fb[_0x7995('0x16')]['message']);}})[_0x7995('0x17')](function(_0x565d97){logger[_0x7995('0x13')](_0x7995('0xe'),_0x326741,_0x565d97);_0x1cad37(_0x565d97);});});}exports[_0x7995('0x18')]=function(_0x291317){var _0x1e1415=this;return new Promise(function(_0x37a7d4,_0x4faa60){return db['Campaign'][_0x7995('0x19')]({'raw':_0x291317['options']?_0x291317['options'][_0x7995('0x1a')]===undefined?!![]:![]:!![],'where':_0x291317[_0x7995('0x1b')]?_0x291317['options'][_0x7995('0x1c')]||null:null,'attributes':_0x291317['options']?_0x291317['options'][_0x7995('0x1d')]||null:null,'limit':_0x291317[_0x7995('0x1b')]?_0x291317[_0x7995('0x1b')][_0x7995('0x1e')]||null:null,'include':_0x291317[_0x7995('0x1b')]?_0x291317[_0x7995('0x1b')]['include']?_[_0x7995('0x1f')](_0x291317[_0x7995('0x1b')][_0x7995('0x20')],function(_0x285437){return{'model':db[_0x285437[_0x7995('0x21')]],'as':_0x285437['as'],'attributes':_0x285437[_0x7995('0x1d')],'include':_0x285437[_0x7995('0x20')]?_[_0x7995('0x1f')](_0x285437['include'],function(_0x39df42){return{'model':db[_0x39df42[_0x7995('0x21')]],'as':_0x39df42['as'],'attributes':_0x39df42[_0x7995('0x1d')],'include':_0x39df42[_0x7995('0x20')]?_[_0x7995('0x1f')](_0x39df42[_0x7995('0x20')],function(_0x56691a){return{'model':db[_0x56691a[_0x7995('0x21')]],'as':_0x56691a['as'],'attributes':_0x56691a['attributes']};}):[]};}):[]};}):[]:[]})[_0x7995('0xc')](function(_0x49bc7e){logger[_0x7995('0xd')](_0x7995('0x18'),_0x291317);logger[_0x7995('0x10')]('GetCampaign',_0x291317,JSON[_0x7995('0x12')](_0x49bc7e));_0x37a7d4(_0x49bc7e);})['catch'](function(_0x456a28){logger[_0x7995('0x13')](_0x7995('0x18'),_0x456a28['message'],_0x291317);_0x4faa60(_0x1e1415['error'](0x1f4,_0x456a28['message']));});});};
\ No newline at end of file
+var _0x9957=['catch','GetCampaign','findAll','raw','options','where','attributes','limit','map','include','model','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','Campaign,\x20%s,\x20%s','request\x20sent','debug','Campaign,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result'];(function(_0x7fa8a1,_0x52c9be){var _0x41fa61=function(_0x185b0d){while(--_0x185b0d){_0x7fa8a1['push'](_0x7fa8a1['shift']());}};_0x41fa61(++_0x52c9be);}(_0x9957,0x93));var _0x7995=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x9957[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var moment=require(_0x7995('0x2'));var BPromise=require(_0x7995('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7995('0x4'));var db=require(_0x7995('0x5'))['db'];var utils=require(_0x7995('0x6'));var logger=require(_0x7995('0x7'))('rpc');var config=require(_0x7995('0x8'));var jayson=require(_0x7995('0x9'));var client=jayson[_0x7995('0xa')][_0x7995('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xbda126,_0x326741,_0x4996ca){return new BPromise(function(_0x465276,_0x1cad37){return client['request'](_0xbda126,_0x4996ca)[_0x7995('0xc')](function(_0x3116fb){logger[_0x7995('0xd')](_0x7995('0xe'),_0x326741,_0x7995('0xf'));logger[_0x7995('0x10')](_0x7995('0x11'),_0x326741,'request\x20sent',JSON[_0x7995('0x12')](_0x3116fb));if(_0x3116fb[_0x7995('0x13')]){if(_0x3116fb['error'][_0x7995('0x14')]===0x1f4){logger[_0x7995('0x13')](_0x7995('0xe'),_0x326741,_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);return _0x1cad37(_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);}logger['error']('Campaign,\x20%s,\x20%s',_0x326741,_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);return _0x465276(_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);}else{logger[_0x7995('0xd')](_0x7995('0xe'),_0x326741,_0x7995('0xf'));_0x465276(_0x3116fb[_0x7995('0x16')]['message']);}})[_0x7995('0x17')](function(_0x565d97){logger[_0x7995('0x13')](_0x7995('0xe'),_0x326741,_0x565d97);_0x1cad37(_0x565d97);});});}exports[_0x7995('0x18')]=function(_0x291317){var _0x1e1415=this;return new Promise(function(_0x37a7d4,_0x4faa60){return db['Campaign'][_0x7995('0x19')]({'raw':_0x291317['options']?_0x291317['options'][_0x7995('0x1a')]===undefined?!![]:![]:!![],'where':_0x291317[_0x7995('0x1b')]?_0x291317['options'][_0x7995('0x1c')]||null:null,'attributes':_0x291317['options']?_0x291317['options'][_0x7995('0x1d')]||null:null,'limit':_0x291317[_0x7995('0x1b')]?_0x291317[_0x7995('0x1b')][_0x7995('0x1e')]||null:null,'include':_0x291317[_0x7995('0x1b')]?_0x291317[_0x7995('0x1b')]['include']?_[_0x7995('0x1f')](_0x291317[_0x7995('0x1b')][_0x7995('0x20')],function(_0x285437){return{'model':db[_0x285437[_0x7995('0x21')]],'as':_0x285437['as'],'attributes':_0x285437[_0x7995('0x1d')],'include':_0x285437[_0x7995('0x20')]?_[_0x7995('0x1f')](_0x285437['include'],function(_0x39df42){return{'model':db[_0x39df42[_0x7995('0x21')]],'as':_0x39df42['as'],'attributes':_0x39df42[_0x7995('0x1d')],'include':_0x39df42[_0x7995('0x20')]?_[_0x7995('0x1f')](_0x39df42[_0x7995('0x20')],function(_0x56691a){return{'model':db[_0x56691a[_0x7995('0x21')]],'as':_0x56691a['as'],'attributes':_0x56691a['attributes']};}):[]};}):[]};}):[]:[]})[_0x7995('0xc')](function(_0x49bc7e){logger[_0x7995('0xd')](_0x7995('0x18'),_0x291317);logger[_0x7995('0x10')]('GetCampaign',_0x291317,JSON[_0x7995('0x12')](_0x49bc7e));_0x37a7d4(_0x49bc7e);})['catch'](function(_0x456a28){logger[_0x7995('0x13')](_0x7995('0x18'),_0x456a28['message'],_0x291317);_0x4faa60(_0x1e1415['error'](0x1f4,_0x456a28['message']));});});};
\ No newline at end of file
diff --git a/server/api/campaign/index.js b/server/api/campaign/index.js
index 1eb86b9..3e1c1f9 100644
--- a/server/api/campaign/index.js
+++ b/server/api/campaign/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x60cf=['/:id/hopper_black','/:id/lists','/:id/blacklists','getBlackLists','post','create','/:id/clone','addLists','addBlackLists','put','update','destroy','delete','removeLists','removeBlackLists','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./campaign.controller','get','isAuthenticated','index','/:id','/:id/hoppers','getHoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','getHopperFinals'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x60cf,0x186));var _0xf60c=function(_0x4bbf87,_0x3490e0){_0x4bbf87=_0x4bbf87-0x0;var _0x59bfce=_0x60cf[_0x4bbf87];return _0x59bfce;};'use strict';var multer=require(_0xf60c('0x0'));var util=require(_0xf60c('0x1'));var path=require(_0xf60c('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xf60c('0x3')]();var auth=require(_0xf60c('0x4'));var interaction=require(_0xf60c('0x5'));var config=require(_0xf60c('0x6'));var controller=require(_0xf60c('0x7'));router[_0xf60c('0x8')]('/',auth[_0xf60c('0x9')](),controller[_0xf60c('0xa')]);router[_0xf60c('0x8')](_0xf60c('0xb'),auth[_0xf60c('0x9')](),controller['show']);router[_0xf60c('0x8')](_0xf60c('0xc'),auth[_0xf60c('0x9')](),controller[_0xf60c('0xd')]);router[_0xf60c('0x8')](_0xf60c('0xe'),auth['isAuthenticated'](),controller[_0xf60c('0xf')]);router[_0xf60c('0x8')](_0xf60c('0x10'),auth[_0xf60c('0x9')](),controller[_0xf60c('0x11')]);router[_0xf60c('0x8')](_0xf60c('0x12'),auth[_0xf60c('0x9')](),controller['getHopperBlacks']);router['get'](_0xf60c('0x13'),auth[_0xf60c('0x9')](),controller['getLists']);router[_0xf60c('0x8')](_0xf60c('0x14'),auth['isAuthenticated'](),controller[_0xf60c('0x15')]);router[_0xf60c('0x16')]('/',auth[_0xf60c('0x9')](),controller[_0xf60c('0x17')]);router['post'](_0xf60c('0x18'),auth[_0xf60c('0x9')](),controller['clone']);router[_0xf60c('0x16')](_0xf60c('0x13'),auth[_0xf60c('0x9')](),controller[_0xf60c('0x19')]);router[_0xf60c('0x16')](_0xf60c('0x14'),auth[_0xf60c('0x9')](),controller[_0xf60c('0x1a')]);router[_0xf60c('0x1b')](_0xf60c('0xb'),auth[_0xf60c('0x9')](),controller[_0xf60c('0x1c')]);router['delete']('/:id',auth[_0xf60c('0x9')](),controller[_0xf60c('0x1d')]);router[_0xf60c('0x1e')]('/:id/lists',auth['isAuthenticated'](),controller[_0xf60c('0x1f')]);router[_0xf60c('0x1e')](_0xf60c('0x14'),auth[_0xf60c('0x9')](),controller[_0xf60c('0x20')]);module[_0xf60c('0x21')]=router;
\ No newline at end of file
+var _0x5f87=['isAuthenticated','index','show','/:id/hoppers','/:id/hopper_histories','/:id/hopper_finals','getHopperFinals','/:id/hopper_black','getHopperBlacks','/:id/lists','getLists','/:id/blacklists','getBlackLists','post','create','/:id/clone','clone','addLists','addBlackLists','put','/:id','update','delete','removeLists','removeBlackLists','exports','multer','util','path','express','Router','../../components/interaction/service','../../config/environment','./campaign.controller','get'];(function(_0x474ed3,_0x5d44b8){var _0x2460f4=function(_0x3aaadb){while(--_0x3aaadb){_0x474ed3['push'](_0x474ed3['shift']());}};_0x2460f4(++_0x5d44b8);}(_0x5f87,0x1be));var _0x75f8=function(_0x20c227,_0xf3f44e){_0x20c227=_0x20c227-0x0;var _0x10bc30=_0x5f87[_0x20c227];return _0x10bc30;};'use strict';var multer=require(_0x75f8('0x0'));var util=require(_0x75f8('0x1'));var path=require(_0x75f8('0x2'));var timeout=require('connect-timeout');var express=require(_0x75f8('0x3'));var router=express[_0x75f8('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x75f8('0x5'));var config=require(_0x75f8('0x6'));var controller=require(_0x75f8('0x7'));router[_0x75f8('0x8')]('/',auth[_0x75f8('0x9')](),controller[_0x75f8('0xa')]);router[_0x75f8('0x8')]('/:id',auth[_0x75f8('0x9')](),controller[_0x75f8('0xb')]);router[_0x75f8('0x8')](_0x75f8('0xc'),auth['isAuthenticated'](),controller['getHoppers']);router[_0x75f8('0x8')](_0x75f8('0xd'),auth['isAuthenticated'](),controller['getHopperHistories']);router[_0x75f8('0x8')](_0x75f8('0xe'),auth['isAuthenticated'](),controller[_0x75f8('0xf')]);router['get'](_0x75f8('0x10'),auth['isAuthenticated'](),controller[_0x75f8('0x11')]);router[_0x75f8('0x8')](_0x75f8('0x12'),auth['isAuthenticated'](),controller[_0x75f8('0x13')]);router[_0x75f8('0x8')](_0x75f8('0x14'),auth['isAuthenticated'](),controller[_0x75f8('0x15')]);router[_0x75f8('0x16')]('/',auth['isAuthenticated'](),controller[_0x75f8('0x17')]);router[_0x75f8('0x16')](_0x75f8('0x18'),auth[_0x75f8('0x9')](),controller[_0x75f8('0x19')]);router['post']('/:id/lists',auth[_0x75f8('0x9')](),controller[_0x75f8('0x1a')]);router['post'](_0x75f8('0x14'),auth['isAuthenticated'](),controller[_0x75f8('0x1b')]);router[_0x75f8('0x1c')](_0x75f8('0x1d'),auth[_0x75f8('0x9')](),controller[_0x75f8('0x1e')]);router['delete'](_0x75f8('0x1d'),auth[_0x75f8('0x9')](),controller['destroy']);router[_0x75f8('0x1f')]('/:id/lists',auth['isAuthenticated'](),controller[_0x75f8('0x20')]);router[_0x75f8('0x1f')]('/:id/blacklists',auth['isAuthenticated'](),controller[_0x75f8('0x21')]);module[_0x75f8('0x22')]=router;
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.attributes.js b/server/api/cannedAnswer/cannedAnswer.attributes.js
index 7181a88..948b64d 100644
--- a/server/api/cannedAnswer/cannedAnswer.attributes.js
+++ b/server/api/cannedAnswer/cannedAnswer.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xee64=['STRING','VIRTUAL','getDataValue','key'];(function(_0x55e08b,_0x421620){var _0xd1a7ff=function(_0x58c7ff){while(--_0x58c7ff){_0x55e08b['push'](_0x55e08b['shift']());}};_0xd1a7ff(++_0x421620);}(_0xee64,0x110));var _0x4ee6=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0xee64[_0x167cc1];return _0x10bc4b;};'use strict';var Sequelize=require('sequelize');module['exports']={'key':{'type':Sequelize[_0x4ee6('0x0')],'allowNull':![]},'value':{'type':Sequelize['TEXT'],'allowNull':![]},'description':{'type':Sequelize[_0x4ee6('0x0')]},'name':{'type':Sequelize[_0x4ee6('0x1')],'get':function(){return this[_0x4ee6('0x2')](_0x4ee6('0x3'));}}};
\ No newline at end of file
+var _0xd72c=['VIRTUAL','key','sequelize','STRING','TEXT'];(function(_0xc65834,_0x5df6fb){var _0x5da298=function(_0x30fbc2){while(--_0x30fbc2){_0xc65834['push'](_0xc65834['shift']());}};_0x5da298(++_0x5df6fb);}(_0xd72c,0x1c4));var _0xcd72=function(_0x43e97a,_0x1a53ff){_0x43e97a=_0x43e97a-0x0;var _0x3140a9=_0xd72c[_0x43e97a];return _0x3140a9;};'use strict';var Sequelize=require(_0xcd72('0x0'));module['exports']={'key':{'type':Sequelize[_0xcd72('0x1')],'allowNull':![]},'value':{'type':Sequelize[_0xcd72('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xcd72('0x1')]},'name':{'type':Sequelize[_0xcd72('0x3')],'get':function(){return this['getDataValue'](_0xcd72('0x4'));}}};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.controller.js b/server/api/cannedAnswer/cannedAnswer.controller.js
index 8f16883..16afa9d 100644
--- a/server/api/cannedAnswer/cannedAnswer.controller.js
+++ b/server/api/cannedAnswer/cannedAnswer.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xc0b9=['status','Content-Range','reject','update','then','destroy','get','CannedAnswers','UserProfileResource','end','error','name','send','index','CannedAnswer','rawAttributes','fieldName','type','key','model','map','query','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','options','count','includeAll','include','findAll','rows','catch','show','params','keys','length','find','body','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','ValidationError','The\x20inserted\x20key\x20already\x20exists.','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/utils','../../mysqldb','sendStatus','json','offset','limit'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0xc0b9,0x199));var _0x9c0b=function(_0xa7dbc2,_0x22d81f){_0xa7dbc2=_0xa7dbc2-0x0;var _0x2e746f=_0xc0b9[_0xa7dbc2];return _0x2e746f;};'use strict';var pdf=require(_0x9c0b('0x0'));var emlformat=require(_0x9c0b('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x9c0b('0x2'));var jsonpatch=require(_0x9c0b('0x3'));var rp=require(_0x9c0b('0x4'));var moment=require('moment');var BPromise=require(_0x9c0b('0x5'));var Mustache=require(_0x9c0b('0x6'));var util=require(_0x9c0b('0x7'));var path=require(_0x9c0b('0x8'));var sox=require('sox');var csv=require(_0x9c0b('0x9'));var ejs=require(_0x9c0b('0xa'));var fs=require('fs');var _=require(_0x9c0b('0xb'));var squel=require(_0x9c0b('0xc'));var crypto=require(_0x9c0b('0xd'));var jsforce=require(_0x9c0b('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x9c0b('0x9'));var querystring=require(_0x9c0b('0xf'));var Papa=require(_0x9c0b('0x10'));var Redis=require(_0x9c0b('0x11'));var authService=require(_0x9c0b('0x12'));var qs=require(_0x9c0b('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x9c0b('0x14'));var config=require('../../config/environment');var db=require(_0x9c0b('0x15'))['db'];function respondWithStatusCode(_0x1a2c48,_0x14f849){_0x14f849=_0x14f849||0xcc;return function(_0xa291b6){if(_0xa291b6){return _0x1a2c48[_0x9c0b('0x16')](_0x14f849);}return _0x1a2c48['status'](_0x14f849)['end']();};}function respondWithResult(_0x2e6cfd,_0x156696){_0x156696=_0x156696||0xc8;return function(_0xf1468e){if(_0xf1468e){return _0x2e6cfd['status'](_0x156696)[_0x9c0b('0x17')](_0xf1468e);}};}function respondWithFilteredResult(_0x51ec63,_0x32af56){return function(_0x4fceea){if(_0x4fceea){var _0x355c87=_0x4fceea['count'],_0x2fdb19=_0x32af56[_0x9c0b('0x18')],_0x2f10a9=_0x32af56[_0x9c0b('0x18')]+_0x32af56[_0x9c0b('0x19')],_0x5d7ae6;if(_0x2f10a9>=_0x355c87){_0x2f10a9=_0x355c87;_0x5d7ae6=0xc8;}else{_0x5d7ae6=0xce;}_0x51ec63[_0x9c0b('0x1a')](_0x5d7ae6);return _0x51ec63['set'](_0x9c0b('0x1b'),_0x2fdb19+'-'+_0x2f10a9+'/'+_0x355c87)[_0x9c0b('0x17')](_0x4fceea);}return null;};}function patchUpdates(_0x10e5be){return function(_0x257319){try{jsonpatch['apply'](_0x257319,_0x10e5be,!![]);}catch(_0x2ed542){return BPromise[_0x9c0b('0x1c')](_0x2ed542);}return _0x257319['save']();};}function saveUpdates(_0x14689f,_0x268154){return function(_0x456469){if(_0x456469){return _0x456469[_0x9c0b('0x1d')](_0x14689f)[_0x9c0b('0x1e')](function(_0x2cb82f){return _0x2cb82f;});}return null;};}function removeEntity(_0x47c44e,_0x5be76a){return function(_0x395156){if(_0x395156){return _0x395156[_0x9c0b('0x1f')]()[_0x9c0b('0x1e')](function(){var _0xfd0b0a=_0x395156[_0x9c0b('0x20')]({'plain':!![]});var _0x5ee4fb=_0x9c0b('0x21');return db[_0x9c0b('0x22')]['destroy']({'where':{'type':_0x5ee4fb,'resourceId':_0xfd0b0a['id']}})[_0x9c0b('0x1e')](function(){return _0x395156;});})[_0x9c0b('0x1e')](function(){_0x47c44e[_0x9c0b('0x1a')](0xcc)[_0x9c0b('0x23')]();});}};}function handleEntityNotFound(_0x5003b3,_0x19f715){return function(_0x5a5564){if(!_0x5a5564){_0x5003b3['sendStatus'](0x194);}return _0x5a5564;};}function handleError(_0x5825d2,_0x4a8972){_0x4a8972=_0x4a8972||0x1f4;return function(_0x3879fc){logger[_0x9c0b('0x24')](_0x3879fc['stack']);if(_0x3879fc[_0x9c0b('0x25')]){delete _0x3879fc[_0x9c0b('0x25')];}_0x5825d2[_0x9c0b('0x1a')](_0x4a8972)[_0x9c0b('0x26')](_0x3879fc);};}exports[_0x9c0b('0x27')]=function(_0x3dc99a,_0x3db812){var _0x1f7b8f={},_0x6a6bb={},_0x4d352c={'count':0x0,'rows':[]};var _0x4b52d9=_['map'](db[_0x9c0b('0x28')][_0x9c0b('0x29')],function(_0xe6096f){return{'name':_0xe6096f[_0x9c0b('0x2a')],'type':_0xe6096f[_0x9c0b('0x2b')][_0x9c0b('0x2c')]};});_0x6a6bb[_0x9c0b('0x2d')]=_[_0x9c0b('0x2e')](_0x4b52d9,'name');_0x6a6bb[_0x9c0b('0x2f')]=_['keys'](_0x3dc99a[_0x9c0b('0x2f')]);_0x6a6bb['filters']=_['intersection'](_0x6a6bb['model'],_0x6a6bb[_0x9c0b('0x2f')]);_0x1f7b8f[_0x9c0b('0x30')]=_[_0x9c0b('0x31')](_0x6a6bb[_0x9c0b('0x2d')],qs[_0x9c0b('0x32')](_0x3dc99a['query'][_0x9c0b('0x32')]));_0x1f7b8f[_0x9c0b('0x30')]=_0x1f7b8f[_0x9c0b('0x30')]['length']?_0x1f7b8f[_0x9c0b('0x30')]:_0x6a6bb['model'];if(!_0x3dc99a[_0x9c0b('0x2f')][_0x9c0b('0x33')](_0x9c0b('0x34'))){_0x1f7b8f[_0x9c0b('0x19')]=qs[_0x9c0b('0x19')](_0x3dc99a[_0x9c0b('0x2f')][_0x9c0b('0x19')]);_0x1f7b8f['offset']=qs[_0x9c0b('0x18')](_0x3dc99a['query']['offset']);}_0x1f7b8f[_0x9c0b('0x35')]=qs[_0x9c0b('0x36')](_0x3dc99a[_0x9c0b('0x2f')][_0x9c0b('0x36')]);_0x1f7b8f[_0x9c0b('0x37')]=qs[_0x9c0b('0x38')](_[_0x9c0b('0x39')](_0x3dc99a[_0x9c0b('0x2f')],_0x6a6bb[_0x9c0b('0x38')]),_0x4b52d9);if(_0x3dc99a[_0x9c0b('0x2f')][_0x9c0b('0x3a')]){_0x1f7b8f[_0x9c0b('0x37')]=_[_0x9c0b('0x3b')](_0x1f7b8f[_0x9c0b('0x37')],{'$or':_['map'](_0x4b52d9,function(_0x4ce5cc){if(_0x4ce5cc[_0x9c0b('0x2b')]!=='VIRTUAL'){var _0xa89e26={};_0xa89e26[_0x4ce5cc[_0x9c0b('0x25')]]={'$like':'%'+_0x3dc99a[_0x9c0b('0x2f')][_0x9c0b('0x3a')]+'%'};return _0xa89e26;}})});}_0x1f7b8f=_[_0x9c0b('0x3b')]({},_0x1f7b8f,_0x3dc99a[_0x9c0b('0x3c')]);var _0x2ab781={'where':_0x1f7b8f['where']};return db[_0x9c0b('0x28')]['count'](_0x2ab781)['then'](function(_0x5ba409){_0x4d352c[_0x9c0b('0x3d')]=_0x5ba409;if(_0x3dc99a[_0x9c0b('0x2f')][_0x9c0b('0x3e')]){_0x1f7b8f[_0x9c0b('0x3f')]=[{'all':!![]}];}return db[_0x9c0b('0x28')][_0x9c0b('0x40')](_0x1f7b8f);})['then'](function(_0x2d9053){_0x4d352c[_0x9c0b('0x41')]=_0x2d9053;return _0x4d352c;})[_0x9c0b('0x1e')](respondWithFilteredResult(_0x3db812,_0x1f7b8f))[_0x9c0b('0x42')](handleError(_0x3db812,null));};exports[_0x9c0b('0x43')]=function(_0x12281d,_0x3e8264){var _0x161ec9={'raw':!![],'where':{'id':_0x12281d[_0x9c0b('0x44')]['id']}},_0x9b189b={};_0x9b189b['model']=_['keys'](db[_0x9c0b('0x28')][_0x9c0b('0x29')]);_0x9b189b[_0x9c0b('0x2f')]=_[_0x9c0b('0x45')](_0x12281d['query']);_0x9b189b[_0x9c0b('0x38')]=_[_0x9c0b('0x31')](_0x9b189b[_0x9c0b('0x2d')],_0x9b189b[_0x9c0b('0x2f')]);_0x161ec9[_0x9c0b('0x30')]=_[_0x9c0b('0x31')](_0x9b189b['model'],qs[_0x9c0b('0x32')](_0x12281d[_0x9c0b('0x2f')][_0x9c0b('0x32')]));_0x161ec9[_0x9c0b('0x30')]=_0x161ec9[_0x9c0b('0x30')][_0x9c0b('0x46')]?_0x161ec9[_0x9c0b('0x30')]:_0x9b189b['model'];if(_0x12281d['query']['includeAll']){_0x161ec9[_0x9c0b('0x3f')]=[{'all':!![]}];}_0x161ec9=_[_0x9c0b('0x3b')]({},_0x161ec9,_0x12281d['options']);return db[_0x9c0b('0x28')][_0x9c0b('0x47')](_0x161ec9)[_0x9c0b('0x1e')](handleEntityNotFound(_0x3e8264,null))[_0x9c0b('0x1e')](respondWithResult(_0x3e8264,null))[_0x9c0b('0x42')](handleError(_0x3e8264,null));};exports['update']=function(_0x50ce49,_0xc6dcbf){if(_0x50ce49[_0x9c0b('0x48')]['id']){delete _0x50ce49[_0x9c0b('0x48')]['id'];}return db[_0x9c0b('0x28')][_0x9c0b('0x47')]({'where':{'id':_0x50ce49[_0x9c0b('0x44')]['id']}})[_0x9c0b('0x1e')](handleEntityNotFound(_0xc6dcbf,null))[_0x9c0b('0x1e')](saveUpdates(_0x50ce49['body'],null))['then'](respondWithResult(_0xc6dcbf,null))[_0x9c0b('0x42')](handleError(_0xc6dcbf,null));};exports[_0x9c0b('0x1f')]=function(_0x125a9b,_0x40b748){return db[_0x9c0b('0x28')]['find']({'where':{'id':_0x125a9b[_0x9c0b('0x44')]['id']}})[_0x9c0b('0x1e')](handleEntityNotFound(_0x40b748,null))[_0x9c0b('0x1e')](removeEntity(_0x40b748,null))[_0x9c0b('0x42')](handleError(_0x40b748,null));};exports[_0x9c0b('0x49')]=function(_0x16bbae,_0x3bf7ea){var _0x546360={'key':_0x16bbae[_0x9c0b('0x48')][_0x9c0b('0x2c')]};if(_0x16bbae[_0x9c0b('0x48')][_0x9c0b('0x4a')]){_0x546360[_0x9c0b('0x4a')]=_0x16bbae[_0x9c0b('0x48')][_0x9c0b('0x4a')];}else if(_0x16bbae[_0x9c0b('0x48')][_0x9c0b('0x4b')]){_0x546360[_0x9c0b('0x4b')]=_0x16bbae[_0x9c0b('0x48')][_0x9c0b('0x4b')];}else if(_0x16bbae[_0x9c0b('0x48')][_0x9c0b('0x4c')]){_0x546360['OpenchannelAccountId']=_0x16bbae[_0x9c0b('0x48')][_0x9c0b('0x4c')];}else if(_0x16bbae[_0x9c0b('0x48')][_0x9c0b('0x4d')]){_0x546360[_0x9c0b('0x4d')]=_0x16bbae[_0x9c0b('0x48')]['ChatWebsiteId'];}return db[_0x9c0b('0x28')]['find']({'where':_0x546360})[_0x9c0b('0x1e')](function(_0x4d78ad){if(_0x4d78ad){throw new db['Sequelize'][(_0x9c0b('0x4e'))](_0x9c0b('0x4f'));}return db[_0x9c0b('0x28')][_0x9c0b('0x49')](_0x16bbae[_0x9c0b('0x48')]);})[_0x9c0b('0x1e')](function(_0x546f77){var _0x20e0be=_0x16bbae[_0x9c0b('0x50')][_0x9c0b('0x20')]({'plain':!![]});if(!_0x20e0be)throw new Error(_0x9c0b('0x51'));if(_0x20e0be[_0x9c0b('0x52')]===_0x9c0b('0x50')){var _0x5870e0=_0x546f77[_0x9c0b('0x20')]({'plain':!![]});return db[_0x9c0b('0x53')][_0x9c0b('0x47')]({'where':{'name':_0x9c0b('0x21'),'userProfileId':_0x20e0be[_0x9c0b('0x54')]},'raw':!![]})[_0x9c0b('0x1e')](function(_0x4536d8){if(_0x4536d8&&_0x4536d8[_0x9c0b('0x55')]===0x0){return db['UserProfileResource'][_0x9c0b('0x49')]({'name':_0x5870e0['name'],'resourceId':_0x5870e0['id'],'type':_0x4536d8['name'],'sectionId':_0x4536d8['id']},{})[_0x9c0b('0x1e')](function(){return _0x546f77;});}else{return _0x546f77;}})['catch'](function(_0x44e9f7){logger['error'](_0x9c0b('0x56'),_0x44e9f7);throw _0x44e9f7;});}return _0x546f77;})[_0x9c0b('0x1e')](respondWithResult(_0x3bf7ea,0xc9))[_0x9c0b('0x42')](handleError(_0x3bf7ea,null));};
\ No newline at end of file
+var _0x9297=['papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','count','offset','limit','Content-Range','apply','reject','save','then','get','UserProfileResource','destroy','stack','name','send','index','map','CannedAnswer','rawAttributes','type','key','model','query','intersection','attributes','fields','length','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','params','keys','update','body','find','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','The\x20inserted\x20key\x20already\x20exists.','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','CannedAnswers','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','sox','to-csv','ejs','squel','crypto','jsforce','desk.js'];(function(_0x273c39,_0x1052e6){var _0x46d6b5=function(_0x44f1fb){while(--_0x44f1fb){_0x273c39['push'](_0x273c39['shift']());}};_0x46d6b5(++_0x1052e6);}(_0x9297,0xa3));var _0x7929=function(_0x547927,_0x546dab){_0x547927=_0x547927-0x0;var _0x5b9923=_0x9297[_0x547927];return _0x5b9923;};'use strict';var pdf=require(_0x7929('0x0'));var emlformat=require(_0x7929('0x1'));var rimraf=require(_0x7929('0x2'));var zipdir=require(_0x7929('0x3'));var jsonpatch=require(_0x7929('0x4'));var rp=require('request-promise');var moment=require(_0x7929('0x5'));var BPromise=require(_0x7929('0x6'));var Mustache=require(_0x7929('0x7'));var util=require('util');var path=require('path');var sox=require(_0x7929('0x8'));var csv=require(_0x7929('0x9'));var ejs=require(_0x7929('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0x7929('0xb'));var crypto=require(_0x7929('0xc'));var jsforce=require(_0x7929('0xd'));var deskjs=require(_0x7929('0xe'));var toCsv=require(_0x7929('0x9'));var querystring=require('querystring');var Papa=require(_0x7929('0xf'));var Redis=require(_0x7929('0x10'));var authService=require(_0x7929('0x11'));var qs=require(_0x7929('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7929('0x13'));var logger=require('../../config/logger')(_0x7929('0x14'));var utils=require(_0x7929('0x15'));var config=require('../../config/environment');var db=require(_0x7929('0x16'))['db'];function respondWithStatusCode(_0x3a88e8,_0x5e79d3){_0x5e79d3=_0x5e79d3||0xcc;return function(_0x2ab898){if(_0x2ab898){return _0x3a88e8[_0x7929('0x17')](_0x5e79d3);}return _0x3a88e8[_0x7929('0x18')](_0x5e79d3)[_0x7929('0x19')]();};}function respondWithResult(_0x225b12,_0x54c72c){_0x54c72c=_0x54c72c||0xc8;return function(_0x9c62d9){if(_0x9c62d9){return _0x225b12[_0x7929('0x18')](_0x54c72c)[_0x7929('0x1a')](_0x9c62d9);}};}function respondWithFilteredResult(_0x276cf7,_0x4ade21){return function(_0x2e8386){if(_0x2e8386){var _0x5dedc8=_0x2e8386[_0x7929('0x1b')],_0x8a5d4f=_0x4ade21['offset'],_0x1b0f7b=_0x4ade21[_0x7929('0x1c')]+_0x4ade21[_0x7929('0x1d')],_0x396985;if(_0x1b0f7b>=_0x5dedc8){_0x1b0f7b=_0x5dedc8;_0x396985=0xc8;}else{_0x396985=0xce;}_0x276cf7['status'](_0x396985);return _0x276cf7['set'](_0x7929('0x1e'),_0x8a5d4f+'-'+_0x1b0f7b+'/'+_0x5dedc8)[_0x7929('0x1a')](_0x2e8386);}return null;};}function patchUpdates(_0x5765d6){return function(_0x2bdb67){try{jsonpatch[_0x7929('0x1f')](_0x2bdb67,_0x5765d6,!![]);}catch(_0x458985){return BPromise[_0x7929('0x20')](_0x458985);}return _0x2bdb67[_0x7929('0x21')]();};}function saveUpdates(_0x2df133,_0x2dc591){return function(_0x532a8e){if(_0x532a8e){return _0x532a8e['update'](_0x2df133)[_0x7929('0x22')](function(_0x3113df){return _0x3113df;});}return null;};}function removeEntity(_0x20b62,_0x5c84d2){return function(_0xac2a4b){if(_0xac2a4b){return _0xac2a4b['destroy']()[_0x7929('0x22')](function(){var _0x9090f4=_0xac2a4b[_0x7929('0x23')]({'plain':!![]});var _0x12a05c='CannedAnswers';return db[_0x7929('0x24')][_0x7929('0x25')]({'where':{'type':_0x12a05c,'resourceId':_0x9090f4['id']}})[_0x7929('0x22')](function(){return _0xac2a4b;});})['then'](function(){_0x20b62[_0x7929('0x18')](0xcc)[_0x7929('0x19')]();});}};}function handleEntityNotFound(_0x535ad2,_0x3e72e9){return function(_0xc2a742){if(!_0xc2a742){_0x535ad2['sendStatus'](0x194);}return _0xc2a742;};}function handleError(_0x2ca62c,_0x314360){_0x314360=_0x314360||0x1f4;return function(_0xf6a174){logger['error'](_0xf6a174[_0x7929('0x26')]);if(_0xf6a174[_0x7929('0x27')]){delete _0xf6a174['name'];}_0x2ca62c['status'](_0x314360)[_0x7929('0x28')](_0xf6a174);};}exports[_0x7929('0x29')]=function(_0x228061,_0x42e71b){var _0x18e5b0={},_0x374271={},_0x57cdef={'count':0x0,'rows':[]};var _0x2bf7d3=_[_0x7929('0x2a')](db[_0x7929('0x2b')][_0x7929('0x2c')],function(_0x514fa6){return{'name':_0x514fa6['fieldName'],'type':_0x514fa6[_0x7929('0x2d')][_0x7929('0x2e')]};});_0x374271[_0x7929('0x2f')]=_[_0x7929('0x2a')](_0x2bf7d3,_0x7929('0x27'));_0x374271[_0x7929('0x30')]=_['keys'](_0x228061['query']);_0x374271['filters']=_[_0x7929('0x31')](_0x374271[_0x7929('0x2f')],_0x374271['query']);_0x18e5b0[_0x7929('0x32')]=_[_0x7929('0x31')](_0x374271['model'],qs[_0x7929('0x33')](_0x228061[_0x7929('0x30')]['fields']));_0x18e5b0['attributes']=_0x18e5b0['attributes'][_0x7929('0x34')]?_0x18e5b0['attributes']:_0x374271[_0x7929('0x2f')];if(!_0x228061[_0x7929('0x30')]['hasOwnProperty'](_0x7929('0x35'))){_0x18e5b0['limit']=qs[_0x7929('0x1d')](_0x228061[_0x7929('0x30')]['limit']);_0x18e5b0[_0x7929('0x1c')]=qs[_0x7929('0x1c')](_0x228061[_0x7929('0x30')][_0x7929('0x1c')]);}_0x18e5b0[_0x7929('0x36')]=qs[_0x7929('0x37')](_0x228061[_0x7929('0x30')][_0x7929('0x37')]);_0x18e5b0[_0x7929('0x38')]=qs[_0x7929('0x39')](_[_0x7929('0x3a')](_0x228061['query'],_0x374271[_0x7929('0x39')]),_0x2bf7d3);if(_0x228061[_0x7929('0x30')][_0x7929('0x3b')]){_0x18e5b0['where']=_[_0x7929('0x3c')](_0x18e5b0[_0x7929('0x38')],{'$or':_[_0x7929('0x2a')](_0x2bf7d3,function(_0x5509d2){if(_0x5509d2[_0x7929('0x2d')]!==_0x7929('0x3d')){var _0x3e2b9b={};_0x3e2b9b[_0x5509d2[_0x7929('0x27')]]={'$like':'%'+_0x228061[_0x7929('0x30')]['filter']+'%'};return _0x3e2b9b;}})});}_0x18e5b0=_['merge']({},_0x18e5b0,_0x228061[_0x7929('0x3e')]);var _0x11e1e8={'where':_0x18e5b0['where']};return db[_0x7929('0x2b')][_0x7929('0x1b')](_0x11e1e8)[_0x7929('0x22')](function(_0x38270b){_0x57cdef[_0x7929('0x1b')]=_0x38270b;if(_0x228061[_0x7929('0x30')][_0x7929('0x3f')]){_0x18e5b0[_0x7929('0x40')]=[{'all':!![]}];}return db[_0x7929('0x2b')][_0x7929('0x41')](_0x18e5b0);})[_0x7929('0x22')](function(_0x431004){_0x57cdef['rows']=_0x431004;return _0x57cdef;})[_0x7929('0x22')](respondWithFilteredResult(_0x42e71b,_0x18e5b0))[_0x7929('0x42')](handleError(_0x42e71b,null));};exports[_0x7929('0x43')]=function(_0x12bc71,_0x24e5ab){var _0xc6f749={'raw':!![],'where':{'id':_0x12bc71[_0x7929('0x44')]['id']}},_0x2905fe={};_0x2905fe[_0x7929('0x2f')]=_[_0x7929('0x45')](db[_0x7929('0x2b')][_0x7929('0x2c')]);_0x2905fe['query']=_[_0x7929('0x45')](_0x12bc71[_0x7929('0x30')]);_0x2905fe['filters']=_[_0x7929('0x31')](_0x2905fe[_0x7929('0x2f')],_0x2905fe[_0x7929('0x30')]);_0xc6f749[_0x7929('0x32')]=_['intersection'](_0x2905fe[_0x7929('0x2f')],qs[_0x7929('0x33')](_0x12bc71[_0x7929('0x30')]['fields']));_0xc6f749[_0x7929('0x32')]=_0xc6f749['attributes'][_0x7929('0x34')]?_0xc6f749[_0x7929('0x32')]:_0x2905fe['model'];if(_0x12bc71[_0x7929('0x30')][_0x7929('0x3f')]){_0xc6f749[_0x7929('0x40')]=[{'all':!![]}];}_0xc6f749=_[_0x7929('0x3c')]({},_0xc6f749,_0x12bc71[_0x7929('0x3e')]);return db[_0x7929('0x2b')]['find'](_0xc6f749)[_0x7929('0x22')](handleEntityNotFound(_0x24e5ab,null))[_0x7929('0x22')](respondWithResult(_0x24e5ab,null))[_0x7929('0x42')](handleError(_0x24e5ab,null));};exports[_0x7929('0x46')]=function(_0x6a3a51,_0x184460){if(_0x6a3a51[_0x7929('0x47')]['id']){delete _0x6a3a51[_0x7929('0x47')]['id'];}return db[_0x7929('0x2b')][_0x7929('0x48')]({'where':{'id':_0x6a3a51['params']['id']}})['then'](handleEntityNotFound(_0x184460,null))[_0x7929('0x22')](saveUpdates(_0x6a3a51[_0x7929('0x47')],null))[_0x7929('0x22')](respondWithResult(_0x184460,null))['catch'](handleError(_0x184460,null));};exports[_0x7929('0x25')]=function(_0x30c2a7,_0x5ac079){return db[_0x7929('0x2b')]['find']({'where':{'id':_0x30c2a7['params']['id']}})[_0x7929('0x22')](handleEntityNotFound(_0x5ac079,null))[_0x7929('0x22')](removeEntity(_0x5ac079,null))['catch'](handleError(_0x5ac079,null));};exports[_0x7929('0x49')]=function(_0x3585ac,_0x450ef7){var _0x258ce8={'key':_0x3585ac[_0x7929('0x47')][_0x7929('0x2e')]};if(_0x3585ac[_0x7929('0x47')][_0x7929('0x4a')]){_0x258ce8[_0x7929('0x4a')]=_0x3585ac['body'][_0x7929('0x4a')];}else if(_0x3585ac[_0x7929('0x47')]['SmsAccountId']){_0x258ce8[_0x7929('0x4b')]=_0x3585ac[_0x7929('0x47')][_0x7929('0x4b')];}else if(_0x3585ac[_0x7929('0x47')][_0x7929('0x4c')]){_0x258ce8[_0x7929('0x4c')]=_0x3585ac[_0x7929('0x47')]['OpenchannelAccountId'];}else if(_0x3585ac[_0x7929('0x47')][_0x7929('0x4d')]){_0x258ce8[_0x7929('0x4d')]=_0x3585ac[_0x7929('0x47')][_0x7929('0x4d')];}return db[_0x7929('0x2b')][_0x7929('0x48')]({'where':_0x258ce8})['then'](function(_0x485b64){if(_0x485b64){throw new db[(_0x7929('0x4e'))][(_0x7929('0x4f'))](_0x7929('0x50'));}return db[_0x7929('0x2b')][_0x7929('0x49')](_0x3585ac['body']);})['then'](function(_0x368b68){var _0x51a5b8=_0x3585ac['user'][_0x7929('0x23')]({'plain':!![]});if(!_0x51a5b8)throw new Error(_0x7929('0x51'));if(_0x51a5b8[_0x7929('0x52')]==='user'){var _0x2ed9b5=_0x368b68[_0x7929('0x23')]({'plain':!![]});return db[_0x7929('0x53')][_0x7929('0x48')]({'where':{'name':_0x7929('0x54'),'userProfileId':_0x51a5b8[_0x7929('0x55')]},'raw':!![]})[_0x7929('0x22')](function(_0x610de9){if(_0x610de9&&_0x610de9[_0x7929('0x56')]===0x0){return db['UserProfileResource'][_0x7929('0x49')]({'name':_0x2ed9b5[_0x7929('0x27')],'resourceId':_0x2ed9b5['id'],'type':_0x610de9[_0x7929('0x27')],'sectionId':_0x610de9['id']},{})[_0x7929('0x22')](function(){return _0x368b68;});}else{return _0x368b68;}})[_0x7929('0x42')](function(_0x4e247a){logger[_0x7929('0x57')](_0x7929('0x58'),_0x4e247a);throw _0x4e247a;});}return _0x368b68;})[_0x7929('0x22')](respondWithResult(_0x450ef7,0xc9))[_0x7929('0x42')](handleError(_0x450ef7,null));};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.model.js b/server/api/cannedAnswer/cannedAnswer.model.js
index 4a71471..932192b 100644
--- a/server/api/cannedAnswer/cannedAnswer.model.js
+++ b/server/api/cannedAnswer/cannedAnswer.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x8ad5=['utf8mb4_unicode_ci','lodash','util','../../config/logger','api','request-promise','path','rimraf','../../config/environment','./cannedAnswer.attributes','exports','define','CannedAnswer','tools_canned_answers','utf8mb4'];(function(_0x160c73,_0x2ee678){var _0xd9302=function(_0x169454){while(--_0x169454){_0x160c73['push'](_0x160c73['shift']());}};_0xd9302(++_0x2ee678);}(_0x8ad5,0xf1));var _0x58ad=function(_0xa1e3e3,_0x29fe0e){_0xa1e3e3=_0xa1e3e3-0x0;var _0xc980e9=_0x8ad5[_0xa1e3e3];return _0xc980e9;};'use strict';var _=require(_0x58ad('0x0'));var util=require(_0x58ad('0x1'));var logger=require(_0x58ad('0x2'))(_0x58ad('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x58ad('0x4'));var fs=require('fs');var path=require(_0x58ad('0x5'));var rimraf=require(_0x58ad('0x6'));var config=require(_0x58ad('0x7'));var attributes=require(_0x58ad('0x8'));module[_0x58ad('0x9')]=function(_0x51d560,_0x5888f7){return _0x51d560[_0x58ad('0xa')](_0x58ad('0xb'),attributes,{'tableName':_0x58ad('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x58ad('0xd'),'collate':_0x58ad('0xe')});};
\ No newline at end of file
+var _0xb138=['moment','bluebird','request-promise','rimraf','../../config/environment','./cannedAnswer.attributes','CannedAnswer','tools_canned_answers','utf8mb4','lodash','util','../../config/logger','api'];(function(_0x391c55,_0x168617){var _0xa434e0=function(_0x51fa5c){while(--_0x51fa5c){_0x391c55['push'](_0x391c55['shift']());}};_0xa434e0(++_0x168617);}(_0xb138,0x1dd));var _0x8b13=function(_0x4a30f1,_0x2e75a8){_0x4a30f1=_0x4a30f1-0x0;var _0x1e0a09=_0xb138[_0x4a30f1];return _0x1e0a09;};'use strict';var _=require(_0x8b13('0x0'));var util=require(_0x8b13('0x1'));var logger=require(_0x8b13('0x2'))(_0x8b13('0x3'));var moment=require(_0x8b13('0x4'));var BPromise=require(_0x8b13('0x5'));var rp=require(_0x8b13('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8b13('0x7'));var config=require(_0x8b13('0x8'));var attributes=require(_0x8b13('0x9'));module['exports']=function(_0xd19a0f,_0x13f7bd){return _0xd19a0f['define'](_0x8b13('0xa'),attributes,{'tableName':_0x8b13('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x8b13('0xc'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.rpc.js b/server/api/cannedAnswer/cannedAnswer.rpc.js
index 17333cd..2e34a65 100644
--- a/server/api/cannedAnswer/cannedAnswer.rpc.js
+++ b/server/api/cannedAnswer/cannedAnswer.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x0c26=['ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','request','CannedAnswer,\x20%s,\x20%s','request\x20sent','debug','CannedAnswer,\x20%s,\x20%s,\x20%s','stringify','error','message','info','catch','lodash','util','randomstring'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x0c26,0x107));var _0x60c2=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x0c26[_0x5b644e];return _0x49c6bf;};'use strict';var _=require(_0x60c2('0x0'));var util=require(_0x60c2('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x60c2('0x2'));var fs=require('fs');var Redis=require(_0x60c2('0x3'));var db=require(_0x60c2('0x4'))['db'];var utils=require(_0x60c2('0x5'));var logger=require(_0x60c2('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x60c2('0x7'));var client=jayson[_0x60c2('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x25a5ef,_0x54f344,_0x22acbf){return new BPromise(function(_0x135d72,_0x5f252c){return client[_0x60c2('0x9')](_0x25a5ef,_0x22acbf)['then'](function(_0xd7d417){logger['info'](_0x60c2('0xa'),_0x54f344,_0x60c2('0xb'));logger[_0x60c2('0xc')](_0x60c2('0xd'),_0x54f344,'request\x20sent',JSON[_0x60c2('0xe')](_0xd7d417));if(_0xd7d417[_0x60c2('0xf')]){if(_0xd7d417['error']['code']===0x1f4){logger['error'](_0x60c2('0xa'),_0x54f344,_0xd7d417[_0x60c2('0xf')][_0x60c2('0x10')]);return _0x5f252c(_0xd7d417['error'][_0x60c2('0x10')]);}logger[_0x60c2('0xf')]('CannedAnswer,\x20%s,\x20%s',_0x54f344,_0xd7d417['error'][_0x60c2('0x10')]);return _0x135d72(_0xd7d417['error'][_0x60c2('0x10')]);}else{logger[_0x60c2('0x11')](_0x60c2('0xa'),_0x54f344,'request\x20sent');_0x135d72(_0xd7d417['result'][_0x60c2('0x10')]);}})[_0x60c2('0x12')](function(_0x32d1ad){logger[_0x60c2('0xf')]('CannedAnswer,\x20%s,\x20%s',_0x54f344,_0x32d1ad);_0x5f252c(_0x32d1ad);});});}
\ No newline at end of file
+var _0x3510=['client','http','request','then','info','request\x20sent','debug','CannedAnswer,\x20%s,\x20%s,\x20%s','stringify','error','CannedAnswer,\x20%s,\x20%s','message','result','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','../../config/environment','jayson/promise'];(function(_0x4f7811,_0x35e53e){var _0x23111b=function(_0x18cba6){while(--_0x18cba6){_0x4f7811['push'](_0x4f7811['shift']());}};_0x23111b(++_0x35e53e);}(_0x3510,0xa7));var _0x0351=function(_0x1e7b16,_0x4607a1){_0x1e7b16=_0x1e7b16-0x0;var _0x37fadc=_0x3510[_0x1e7b16];return _0x37fadc;};'use strict';var _=require(_0x0351('0x0'));var util=require(_0x0351('0x1'));var moment=require(_0x0351('0x2'));var BPromise=require(_0x0351('0x3'));var rs=require(_0x0351('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0351('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x0351('0x6'))('rpc');var config=require(_0x0351('0x7'));var jayson=require(_0x0351('0x8'));var client=jayson[_0x0351('0x9')][_0x0351('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x38611e,_0x2c10c6,_0x350d2f){return new BPromise(function(_0x27322d,_0x26c39f){return client[_0x0351('0xb')](_0x38611e,_0x350d2f)[_0x0351('0xc')](function(_0x28d9cd){logger[_0x0351('0xd')]('CannedAnswer,\x20%s,\x20%s',_0x2c10c6,_0x0351('0xe'));logger[_0x0351('0xf')](_0x0351('0x10'),_0x2c10c6,_0x0351('0xe'),JSON[_0x0351('0x11')](_0x28d9cd));if(_0x28d9cd['error']){if(_0x28d9cd[_0x0351('0x12')]['code']===0x1f4){logger['error'](_0x0351('0x13'),_0x2c10c6,_0x28d9cd[_0x0351('0x12')]['message']);return _0x26c39f(_0x28d9cd[_0x0351('0x12')][_0x0351('0x14')]);}logger[_0x0351('0x12')](_0x0351('0x13'),_0x2c10c6,_0x28d9cd[_0x0351('0x12')]['message']);return _0x27322d(_0x28d9cd[_0x0351('0x12')][_0x0351('0x14')]);}else{logger['info'](_0x0351('0x13'),_0x2c10c6,_0x0351('0xe'));_0x27322d(_0x28d9cd[_0x0351('0x15')][_0x0351('0x14')]);}})['catch'](function(_0x426cd8){logger[_0x0351('0x12')](_0x0351('0x13'),_0x2c10c6,_0x426cd8);_0x26c39f(_0x426cd8);});});}
\ No newline at end of file
diff --git a/server/api/cannedAnswer/index.js b/server/api/cannedAnswer/index.js
index dc763ad..0cd9606 100644
--- a/server/api/cannedAnswer/index.js
+++ b/server/api/cannedAnswer/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x5480=['put','/:id','update','destroy','exports','multer','util','path','connect-timeout','express','Router','../../config/environment','./cannedAnswer.controller','get','isAuthenticated','index','post','create'];(function(_0xeaf30e,_0x1ed4f8){var _0x3db7fd=function(_0x195ccb){while(--_0x195ccb){_0xeaf30e['push'](_0xeaf30e['shift']());}};_0x3db7fd(++_0x1ed4f8);}(_0x5480,0x15b));var _0x0548=function(_0x49e584,_0x2886f8){_0x49e584=_0x49e584-0x0;var _0x58b1be=_0x5480[_0x49e584];return _0x58b1be;};'use strict';var multer=require(_0x0548('0x0'));var util=require(_0x0548('0x1'));var path=require(_0x0548('0x2'));var timeout=require(_0x0548('0x3'));var express=require(_0x0548('0x4'));var router=express[_0x0548('0x5')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x0548('0x6'));var controller=require(_0x0548('0x7'));router[_0x0548('0x8')]('/',auth[_0x0548('0x9')](),controller[_0x0548('0xa')]);router[_0x0548('0x8')]('/:id',auth[_0x0548('0x9')](),controller['show']);router[_0x0548('0xb')]('/',auth[_0x0548('0x9')](),controller[_0x0548('0xc')]);router[_0x0548('0xd')](_0x0548('0xe'),auth[_0x0548('0x9')](),controller[_0x0548('0xf')]);router['delete'](_0x0548('0xe'),auth[_0x0548('0x9')](),controller[_0x0548('0x10')]);module[_0x0548('0x11')]=router;
\ No newline at end of file
+var _0xdd84=['../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','create','put','update','delete','multer','util','connect-timeout','express','../../components/auth/service'];(function(_0x25e7cb,_0x3579b7){var _0x375d92=function(_0xe8cf3b){while(--_0xe8cf3b){_0x25e7cb['push'](_0x25e7cb['shift']());}};_0x375d92(++_0x3579b7);}(_0xdd84,0xbe));var _0x4dd8=function(_0x1f586a,_0x532dbc){_0x1f586a=_0x1f586a-0x0;var _0x35f2ae=_0xdd84[_0x1f586a];return _0x35f2ae;};'use strict';var multer=require(_0x4dd8('0x0'));var util=require(_0x4dd8('0x1'));var path=require('path');var timeout=require(_0x4dd8('0x2'));var express=require(_0x4dd8('0x3'));var router=express['Router']();var auth=require(_0x4dd8('0x4'));var interaction=require(_0x4dd8('0x5'));var config=require(_0x4dd8('0x6'));var controller=require('./cannedAnswer.controller');router[_0x4dd8('0x7')]('/',auth[_0x4dd8('0x8')](),controller['index']);router[_0x4dd8('0x7')](_0x4dd8('0x9'),auth['isAuthenticated'](),controller[_0x4dd8('0xa')]);router['post']('/',auth[_0x4dd8('0x8')](),controller[_0x4dd8('0xb')]);router[_0x4dd8('0xc')](_0x4dd8('0x9'),auth[_0x4dd8('0x8')](),controller[_0x4dd8('0xd')]);router[_0x4dd8('0xe')]('/:id',auth[_0x4dd8('0x8')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/cdr/cdr.attributes.js b/server/api/cdr/cdr.attributes.js
index ecacc91..5c46b4e 100644
--- a/server/api/cdr/cdr.attributes.js
+++ b/server/api/cdr/cdr.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xf4df=['STRING','INTEGER','sequelize','DATE','1970-01-01\x2000:00:01'];(function(_0x2f0e85,_0x2172f9){var _0x44b4c7=function(_0x5e8e5b){while(--_0x5e8e5b){_0x2f0e85['push'](_0x2f0e85['shift']());}};_0x44b4c7(++_0x2172f9);}(_0xf4df,0x16f));var _0xff4d=function(_0x52359b,_0x2d9f79){_0x52359b=_0x52359b-0x0;var _0x530b10=_0xf4df[_0x52359b];return _0x530b10;};'use strict';var Sequelize=require(_0xff4d('0x0'));module['exports']={'calldate':{'type':Sequelize[_0xff4d('0x1')],'allowNull':![],'defaultValue':_0xff4d('0x2')},'clid':{'type':Sequelize[_0xff4d('0x3')]},'src':{'type':Sequelize[_0xff4d('0x3')]},'dst':{'type':Sequelize['STRING']},'dcontext':{'type':Sequelize[_0xff4d('0x3')]},'channel':{'type':Sequelize[_0xff4d('0x3')]},'dstchannel':{'type':Sequelize['STRING']},'lastapp':{'type':Sequelize[_0xff4d('0x3')]},'lastdata':{'type':Sequelize[_0xff4d('0x3')]},'duration':{'type':Sequelize[_0xff4d('0x4')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0xff4d('0x4')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize['STRING']},'amaflags':{'type':Sequelize[_0xff4d('0x4')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0xff4d('0x3')]},'userfield':{'type':Sequelize[_0xff4d('0x3')]},'uniqueid':{'type':Sequelize[_0xff4d('0x3')]},'linkedid':{'type':Sequelize[_0xff4d('0x3')]},'sequence':{'type':Sequelize[_0xff4d('0x3')]},'peeraccount':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xff4d('0x3')]},'tag':{'type':Sequelize[_0xff4d('0x3')]}};
\ No newline at end of file
+var _0x0622=['DATE','1970-01-01\x2000:00:01','STRING','INTEGER','exports'];(function(_0x186f55,_0x41057f){var _0x92b8de=function(_0x194856){while(--_0x194856){_0x186f55['push'](_0x186f55['shift']());}};_0x92b8de(++_0x41057f);}(_0x0622,0x167));var _0x2062=function(_0x2500a0,_0x397225){_0x2500a0=_0x2500a0-0x0;var _0x54a7ca=_0x0622[_0x2500a0];return _0x54a7ca;};'use strict';var Sequelize=require('sequelize');module[_0x2062('0x0')]={'calldate':{'type':Sequelize[_0x2062('0x1')],'allowNull':![],'defaultValue':_0x2062('0x2')},'clid':{'type':Sequelize['STRING']},'src':{'type':Sequelize[_0x2062('0x3')]},'dst':{'type':Sequelize[_0x2062('0x3')]},'dcontext':{'type':Sequelize[_0x2062('0x3')]},'channel':{'type':Sequelize['STRING']},'dstchannel':{'type':Sequelize[_0x2062('0x3')]},'lastapp':{'type':Sequelize[_0x2062('0x3')]},'lastdata':{'type':Sequelize[_0x2062('0x3')]},'duration':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x2062('0x4')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize['STRING']},'amaflags':{'type':Sequelize[_0x2062('0x4')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize['STRING']},'userfield':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x2062('0x3')]},'linkedid':{'type':Sequelize[_0x2062('0x3')]},'sequence':{'type':Sequelize[_0x2062('0x3')]},'peeraccount':{'type':Sequelize[_0x2062('0x3')]},'type':{'type':Sequelize[_0x2062('0x3')]},'tag':{'type':Sequelize[_0x2062('0x3')]}};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.controller.js b/server/api/cdr/cdr.controller.js
index 7c07d06..9ec43d8 100644
--- a/server/api/cdr/cdr.controller.js
+++ b/server/api/cdr/cdr.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xa6f6=['then','destroy','error','name','send','map','rawAttributes','fieldName','key','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','limit','order','sort','pick','filter','merge','type','VIRTUAL','options','where','Cdr','includeAll','include','rows','catch','params','length','find','create','body','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','apply','reject','update'];(function(_0x25f199,_0x14b142){var _0x4c3a93=function(_0x22f957){while(--_0x22f957){_0x25f199['push'](_0x25f199['shift']());}};_0x4c3a93(++_0x14b142);}(_0xa6f6,0x73));var _0x6a6f=function(_0xb24a3e,_0x4a3594){_0xb24a3e=_0xb24a3e-0x0;var _0x4038d7=_0xa6f6[_0xb24a3e];return _0x4038d7;};'use strict';var pdf=require(_0x6a6f('0x0'));var emlformat=require(_0x6a6f('0x1'));var rimraf=require(_0x6a6f('0x2'));var zipdir=require(_0x6a6f('0x3'));var jsonpatch=require(_0x6a6f('0x4'));var rp=require(_0x6a6f('0x5'));var moment=require(_0x6a6f('0x6'));var BPromise=require(_0x6a6f('0x7'));var Mustache=require(_0x6a6f('0x8'));var util=require(_0x6a6f('0x9'));var path=require(_0x6a6f('0xa'));var sox=require(_0x6a6f('0xb'));var csv=require(_0x6a6f('0xc'));var ejs=require(_0x6a6f('0xd'));var fs=require('fs');var _=require('lodash');var squel=require(_0x6a6f('0xe'));var crypto=require(_0x6a6f('0xf'));var jsforce=require(_0x6a6f('0x10'));var deskjs=require(_0x6a6f('0x11'));var toCsv=require(_0x6a6f('0xc'));var querystring=require('querystring');var Papa=require(_0x6a6f('0x12'));var Redis=require(_0x6a6f('0x13'));var authService=require(_0x6a6f('0x14'));var qs=require(_0x6a6f('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6a6f('0x16'));var logger=require(_0x6a6f('0x17'))(_0x6a6f('0x18'));var utils=require(_0x6a6f('0x19'));var config=require(_0x6a6f('0x1a'));var db=require(_0x6a6f('0x1b'))['db'];function respondWithStatusCode(_0x2ba17a,_0x3b9f85){_0x3b9f85=_0x3b9f85||0xcc;return function(_0x32bb79){if(_0x32bb79){return _0x2ba17a[_0x6a6f('0x1c')](_0x3b9f85);}return _0x2ba17a[_0x6a6f('0x1d')](_0x3b9f85)[_0x6a6f('0x1e')]();};}function respondWithResult(_0x841436,_0x7695f0){_0x7695f0=_0x7695f0||0xc8;return function(_0x2199e8){if(_0x2199e8){return _0x841436[_0x6a6f('0x1d')](_0x7695f0)[_0x6a6f('0x1f')](_0x2199e8);}};}function respondWithFilteredResult(_0x4fb338,_0x549f42){return function(_0x9a47aa){if(_0x9a47aa){var _0x221649=_0x9a47aa[_0x6a6f('0x20')],_0x1aa27b=_0x549f42[_0x6a6f('0x21')],_0x184570=_0x549f42[_0x6a6f('0x21')]+_0x549f42['limit'],_0xfb4f8a;if(_0x184570>=_0x221649){_0x184570=_0x221649;_0xfb4f8a=0xc8;}else{_0xfb4f8a=0xce;}_0x4fb338['status'](_0xfb4f8a);return _0x4fb338['set']('Content-Range',_0x1aa27b+'-'+_0x184570+'/'+_0x221649)[_0x6a6f('0x1f')](_0x9a47aa);}return null;};}function patchUpdates(_0x15db24){return function(_0x3c295f){try{jsonpatch[_0x6a6f('0x22')](_0x3c295f,_0x15db24,!![]);}catch(_0x2cdcc0){return BPromise[_0x6a6f('0x23')](_0x2cdcc0);}return _0x3c295f['save']();};}function saveUpdates(_0x2e7191,_0x3cc7f4){return function(_0x51f62c){if(_0x51f62c){return _0x51f62c[_0x6a6f('0x24')](_0x2e7191)[_0x6a6f('0x25')](function(_0x65915a){return _0x65915a;});}return null;};}function removeEntity(_0x20ec22,_0x21819d){return function(_0x2dac58){if(_0x2dac58){return _0x2dac58[_0x6a6f('0x26')]()[_0x6a6f('0x25')](function(){_0x20ec22[_0x6a6f('0x1d')](0xcc)[_0x6a6f('0x1e')]();});}};}function handleEntityNotFound(_0x214a25,_0x52ba6b){return function(_0x351c49){if(!_0x351c49){_0x214a25['sendStatus'](0x194);}return _0x351c49;};}function handleError(_0x52cd67,_0x16af39){_0x16af39=_0x16af39||0x1f4;return function(_0x40984d){logger[_0x6a6f('0x27')](_0x40984d['stack']);if(_0x40984d[_0x6a6f('0x28')]){delete _0x40984d['name'];}_0x52cd67[_0x6a6f('0x1d')](_0x16af39)[_0x6a6f('0x29')](_0x40984d);};}exports['index']=function(_0x86275b,_0x2855ae){var _0x4fe70d={},_0x45ff99={},_0xefed07={'count':0x0,'rows':[]};var _0x5943c1=_[_0x6a6f('0x2a')](db['Cdr'][_0x6a6f('0x2b')],function(_0x565ada){return{'name':_0x565ada[_0x6a6f('0x2c')],'type':_0x565ada['type'][_0x6a6f('0x2d')]};});_0x45ff99['model']=_[_0x6a6f('0x2a')](_0x5943c1,_0x6a6f('0x28'));_0x45ff99[_0x6a6f('0x2e')]=_[_0x6a6f('0x2f')](_0x86275b[_0x6a6f('0x2e')]);_0x45ff99[_0x6a6f('0x30')]=_[_0x6a6f('0x31')](_0x45ff99[_0x6a6f('0x32')],_0x45ff99['query']);_0x4fe70d[_0x6a6f('0x33')]=_['intersection'](_0x45ff99['model'],qs[_0x6a6f('0x34')](_0x86275b['query'][_0x6a6f('0x34')]));_0x4fe70d[_0x6a6f('0x33')]=_0x4fe70d[_0x6a6f('0x33')]['length']?_0x4fe70d[_0x6a6f('0x33')]:_0x45ff99[_0x6a6f('0x32')];if(!_0x86275b[_0x6a6f('0x2e')][_0x6a6f('0x35')](_0x6a6f('0x36'))){_0x4fe70d[_0x6a6f('0x37')]=qs[_0x6a6f('0x37')](_0x86275b[_0x6a6f('0x2e')]['limit']);_0x4fe70d[_0x6a6f('0x21')]=qs[_0x6a6f('0x21')](_0x86275b[_0x6a6f('0x2e')][_0x6a6f('0x21')]);}_0x4fe70d[_0x6a6f('0x38')]=qs[_0x6a6f('0x39')](_0x86275b[_0x6a6f('0x2e')][_0x6a6f('0x39')]);_0x4fe70d['where']=qs[_0x6a6f('0x30')](_[_0x6a6f('0x3a')](_0x86275b[_0x6a6f('0x2e')],_0x45ff99[_0x6a6f('0x30')]),_0x5943c1);if(_0x86275b[_0x6a6f('0x2e')][_0x6a6f('0x3b')]){_0x4fe70d['where']=_[_0x6a6f('0x3c')](_0x4fe70d['where'],{'$or':_[_0x6a6f('0x2a')](_0x5943c1,function(_0x1409fd){if(_0x1409fd[_0x6a6f('0x3d')]!==_0x6a6f('0x3e')){var _0xb3f967={};_0xb3f967[_0x1409fd[_0x6a6f('0x28')]]={'$like':'%'+_0x86275b['query'][_0x6a6f('0x3b')]+'%'};return _0xb3f967;}})});}_0x4fe70d=_[_0x6a6f('0x3c')]({},_0x4fe70d,_0x86275b[_0x6a6f('0x3f')]);var _0x4af1ef={'where':_0x4fe70d[_0x6a6f('0x40')]};return db[_0x6a6f('0x41')][_0x6a6f('0x20')](_0x4af1ef)[_0x6a6f('0x25')](function(_0x26f1d4){_0xefed07[_0x6a6f('0x20')]=_0x26f1d4;if(_0x86275b[_0x6a6f('0x2e')][_0x6a6f('0x42')]){_0x4fe70d[_0x6a6f('0x43')]=[{'all':!![]}];}return db[_0x6a6f('0x41')]['findAll'](_0x4fe70d);})['then'](function(_0x170dec){_0xefed07[_0x6a6f('0x44')]=_0x170dec;return _0xefed07;})[_0x6a6f('0x25')](respondWithFilteredResult(_0x2855ae,_0x4fe70d))[_0x6a6f('0x45')](handleError(_0x2855ae,null));};exports['show']=function(_0x4b0e81,_0x5b584c){var _0x4a5fb1={'raw':!![],'where':{'id':_0x4b0e81[_0x6a6f('0x46')]['id']}},_0x185d5a={};_0x185d5a['model']=_[_0x6a6f('0x2f')](db[_0x6a6f('0x41')][_0x6a6f('0x2b')]);_0x185d5a['query']=_[_0x6a6f('0x2f')](_0x4b0e81[_0x6a6f('0x2e')]);_0x185d5a[_0x6a6f('0x30')]=_[_0x6a6f('0x31')](_0x185d5a[_0x6a6f('0x32')],_0x185d5a[_0x6a6f('0x2e')]);_0x4a5fb1[_0x6a6f('0x33')]=_['intersection'](_0x185d5a[_0x6a6f('0x32')],qs[_0x6a6f('0x34')](_0x4b0e81[_0x6a6f('0x2e')]['fields']));_0x4a5fb1[_0x6a6f('0x33')]=_0x4a5fb1[_0x6a6f('0x33')][_0x6a6f('0x47')]?_0x4a5fb1[_0x6a6f('0x33')]:_0x185d5a['model'];if(_0x4b0e81[_0x6a6f('0x2e')][_0x6a6f('0x42')]){_0x4a5fb1['include']=[{'all':!![]}];}_0x4a5fb1=_['merge']({},_0x4a5fb1,_0x4b0e81[_0x6a6f('0x3f')]);return db[_0x6a6f('0x41')][_0x6a6f('0x48')](_0x4a5fb1)[_0x6a6f('0x25')](handleEntityNotFound(_0x5b584c,null))['then'](respondWithResult(_0x5b584c,null))[_0x6a6f('0x45')](handleError(_0x5b584c,null));};exports[_0x6a6f('0x49')]=function(_0x2112bf,_0x3a67bd){return db[_0x6a6f('0x41')][_0x6a6f('0x49')](_0x2112bf[_0x6a6f('0x4a')],{})[_0x6a6f('0x25')](respondWithResult(_0x3a67bd,0xc9))[_0x6a6f('0x45')](handleError(_0x3a67bd,null));};exports['update']=function(_0x13c1c7,_0x1b06a7){if(_0x13c1c7['body']['id']){delete _0x13c1c7[_0x6a6f('0x4a')]['id'];}return db[_0x6a6f('0x41')][_0x6a6f('0x48')]({'where':{'id':_0x13c1c7[_0x6a6f('0x46')]['id']}})[_0x6a6f('0x25')](handleEntityNotFound(_0x1b06a7,null))[_0x6a6f('0x25')](saveUpdates(_0x13c1c7['body'],null))['then'](respondWithResult(_0x1b06a7,null))[_0x6a6f('0x45')](handleError(_0x1b06a7,null));};exports[_0x6a6f('0x26')]=function(_0x4613a8,_0x22a3a1){return db[_0x6a6f('0x41')][_0x6a6f('0x48')]({'where':{'id':_0x4613a8[_0x6a6f('0x46')]['id']}})[_0x6a6f('0x25')](handleEntityNotFound(_0x22a3a1,null))[_0x6a6f('0x25')](removeEntity(_0x22a3a1,null))['catch'](handleError(_0x22a3a1,null));};exports['describe']=function(_0x215f19,_0x2265bd){return db[_0x6a6f('0x41')][_0x6a6f('0x4b')]()[_0x6a6f('0x25')](respondWithResult(_0x2265bd,null))[_0x6a6f('0x45')](handleError(_0x2265bd,null));};
\ No newline at end of file
+var _0x0b6e=['map','fieldName','type','key','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','sort','where','filters','pick','filter','merge','VIRTUAL','Cdr','include','catch','show','params','rawAttributes','includeAll','options','find','create','body','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','sendStatus','status','end','json','count','offset','limit','apply','reject','save','update','then','destroy','stack','name','index'];(function(_0x13d017,_0x13c192){var _0x432db4=function(_0x30ded7){while(--_0x30ded7){_0x13d017['push'](_0x13d017['shift']());}};_0x432db4(++_0x13c192);}(_0x0b6e,0xaf));var _0xe0b6=function(_0x147cba,_0x368976){_0x147cba=_0x147cba-0x0;var _0x5ba48f=_0x0b6e[_0x147cba];return _0x5ba48f;};'use strict';var pdf=require(_0xe0b6('0x0'));var emlformat=require(_0xe0b6('0x1'));var rimraf=require(_0xe0b6('0x2'));var zipdir=require(_0xe0b6('0x3'));var jsonpatch=require(_0xe0b6('0x4'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xe0b6('0x5'));var Mustache=require(_0xe0b6('0x6'));var util=require(_0xe0b6('0x7'));var path=require(_0xe0b6('0x8'));var sox=require(_0xe0b6('0x9'));var csv=require('to-csv');var ejs=require(_0xe0b6('0xa'));var fs=require('fs');var _=require(_0xe0b6('0xb'));var squel=require(_0xe0b6('0xc'));var crypto=require(_0xe0b6('0xd'));var jsforce=require(_0xe0b6('0xe'));var deskjs=require(_0xe0b6('0xf'));var toCsv=require(_0xe0b6('0x10'));var querystring=require(_0xe0b6('0x11'));var Papa=require(_0xe0b6('0x12'));var Redis=require('ioredis');var authService=require(_0xe0b6('0x13'));var qs=require(_0xe0b6('0x14'));var as=require(_0xe0b6('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xe0b6('0x16'))(_0xe0b6('0x17'));var utils=require(_0xe0b6('0x18'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x12de1b,_0x2a0524){_0x2a0524=_0x2a0524||0xcc;return function(_0x47709a){if(_0x47709a){return _0x12de1b[_0xe0b6('0x19')](_0x2a0524);}return _0x12de1b[_0xe0b6('0x1a')](_0x2a0524)[_0xe0b6('0x1b')]();};}function respondWithResult(_0x1d1c51,_0x47f25e){_0x47f25e=_0x47f25e||0xc8;return function(_0x2ef337){if(_0x2ef337){return _0x1d1c51['status'](_0x47f25e)[_0xe0b6('0x1c')](_0x2ef337);}};}function respondWithFilteredResult(_0x3bf6e1,_0x11e185){return function(_0x1a6668){if(_0x1a6668){var _0x325d88=_0x1a6668[_0xe0b6('0x1d')],_0x457634=_0x11e185[_0xe0b6('0x1e')],_0x5e5f69=_0x11e185[_0xe0b6('0x1e')]+_0x11e185[_0xe0b6('0x1f')],_0x4da9e9;if(_0x5e5f69>=_0x325d88){_0x5e5f69=_0x325d88;_0x4da9e9=0xc8;}else{_0x4da9e9=0xce;}_0x3bf6e1['status'](_0x4da9e9);return _0x3bf6e1['set']('Content-Range',_0x457634+'-'+_0x5e5f69+'/'+_0x325d88)[_0xe0b6('0x1c')](_0x1a6668);}return null;};}function patchUpdates(_0x3d1cb9){return function(_0x4dae0f){try{jsonpatch[_0xe0b6('0x20')](_0x4dae0f,_0x3d1cb9,!![]);}catch(_0x301280){return BPromise[_0xe0b6('0x21')](_0x301280);}return _0x4dae0f[_0xe0b6('0x22')]();};}function saveUpdates(_0x30ca07,_0x123126){return function(_0x460896){if(_0x460896){return _0x460896[_0xe0b6('0x23')](_0x30ca07)[_0xe0b6('0x24')](function(_0x11d875){return _0x11d875;});}return null;};}function removeEntity(_0xbcdc0c,_0x5c0424){return function(_0x35e961){if(_0x35e961){return _0x35e961[_0xe0b6('0x25')]()['then'](function(){_0xbcdc0c[_0xe0b6('0x1a')](0xcc)[_0xe0b6('0x1b')]();});}};}function handleEntityNotFound(_0x46421d,_0x5b049c){return function(_0x974368){if(!_0x974368){_0x46421d['sendStatus'](0x194);}return _0x974368;};}function handleError(_0x53356d,_0x26db33){_0x26db33=_0x26db33||0x1f4;return function(_0x1d3241){logger['error'](_0x1d3241[_0xe0b6('0x26')]);if(_0x1d3241[_0xe0b6('0x27')]){delete _0x1d3241[_0xe0b6('0x27')];}_0x53356d['status'](_0x26db33)['send'](_0x1d3241);};}exports[_0xe0b6('0x28')]=function(_0xd13c15,_0x242367){var _0x2cc123={},_0x27efa2={},_0x2887d7={'count':0x0,'rows':[]};var _0x1e9810=_[_0xe0b6('0x29')](db['Cdr']['rawAttributes'],function(_0x2fb72f){return{'name':_0x2fb72f[_0xe0b6('0x2a')],'type':_0x2fb72f[_0xe0b6('0x2b')][_0xe0b6('0x2c')]};});_0x27efa2[_0xe0b6('0x2d')]=_[_0xe0b6('0x29')](_0x1e9810,_0xe0b6('0x27'));_0x27efa2['query']=_[_0xe0b6('0x2e')](_0xd13c15[_0xe0b6('0x2f')]);_0x27efa2['filters']=_[_0xe0b6('0x30')](_0x27efa2['model'],_0x27efa2[_0xe0b6('0x2f')]);_0x2cc123[_0xe0b6('0x31')]=_['intersection'](_0x27efa2['model'],qs[_0xe0b6('0x32')](_0xd13c15[_0xe0b6('0x2f')][_0xe0b6('0x32')]));_0x2cc123['attributes']=_0x2cc123[_0xe0b6('0x31')][_0xe0b6('0x33')]?_0x2cc123['attributes']:_0x27efa2['model'];if(!_0xd13c15[_0xe0b6('0x2f')][_0xe0b6('0x34')]('nolimit')){_0x2cc123[_0xe0b6('0x1f')]=qs['limit'](_0xd13c15[_0xe0b6('0x2f')][_0xe0b6('0x1f')]);_0x2cc123[_0xe0b6('0x1e')]=qs[_0xe0b6('0x1e')](_0xd13c15[_0xe0b6('0x2f')][_0xe0b6('0x1e')]);}_0x2cc123['order']=qs[_0xe0b6('0x35')](_0xd13c15['query'][_0xe0b6('0x35')]);_0x2cc123[_0xe0b6('0x36')]=qs[_0xe0b6('0x37')](_[_0xe0b6('0x38')](_0xd13c15[_0xe0b6('0x2f')],_0x27efa2['filters']),_0x1e9810);if(_0xd13c15[_0xe0b6('0x2f')][_0xe0b6('0x39')]){_0x2cc123[_0xe0b6('0x36')]=_[_0xe0b6('0x3a')](_0x2cc123[_0xe0b6('0x36')],{'$or':_['map'](_0x1e9810,function(_0x5508a2){if(_0x5508a2['type']!==_0xe0b6('0x3b')){var _0x2aa148={};_0x2aa148[_0x5508a2['name']]={'$like':'%'+_0xd13c15['query'][_0xe0b6('0x39')]+'%'};return _0x2aa148;}})});}_0x2cc123=_[_0xe0b6('0x3a')]({},_0x2cc123,_0xd13c15['options']);var _0x11236e={'where':_0x2cc123[_0xe0b6('0x36')]};return db[_0xe0b6('0x3c')][_0xe0b6('0x1d')](_0x11236e)[_0xe0b6('0x24')](function(_0x5d35b8){_0x2887d7[_0xe0b6('0x1d')]=_0x5d35b8;if(_0xd13c15['query']['includeAll']){_0x2cc123[_0xe0b6('0x3d')]=[{'all':!![]}];}return db[_0xe0b6('0x3c')]['findAll'](_0x2cc123);})[_0xe0b6('0x24')](function(_0x3617c9){_0x2887d7['rows']=_0x3617c9;return _0x2887d7;})[_0xe0b6('0x24')](respondWithFilteredResult(_0x242367,_0x2cc123))[_0xe0b6('0x3e')](handleError(_0x242367,null));};exports[_0xe0b6('0x3f')]=function(_0x2cd191,_0xd68677){var _0x1d13cd={'raw':!![],'where':{'id':_0x2cd191[_0xe0b6('0x40')]['id']}},_0x3ed95d={};_0x3ed95d[_0xe0b6('0x2d')]=_[_0xe0b6('0x2e')](db[_0xe0b6('0x3c')][_0xe0b6('0x41')]);_0x3ed95d['query']=_['keys'](_0x2cd191[_0xe0b6('0x2f')]);_0x3ed95d[_0xe0b6('0x37')]=_[_0xe0b6('0x30')](_0x3ed95d[_0xe0b6('0x2d')],_0x3ed95d[_0xe0b6('0x2f')]);_0x1d13cd['attributes']=_[_0xe0b6('0x30')](_0x3ed95d[_0xe0b6('0x2d')],qs[_0xe0b6('0x32')](_0x2cd191['query'][_0xe0b6('0x32')]));_0x1d13cd[_0xe0b6('0x31')]=_0x1d13cd[_0xe0b6('0x31')]['length']?_0x1d13cd[_0xe0b6('0x31')]:_0x3ed95d[_0xe0b6('0x2d')];if(_0x2cd191[_0xe0b6('0x2f')][_0xe0b6('0x42')]){_0x1d13cd[_0xe0b6('0x3d')]=[{'all':!![]}];}_0x1d13cd=_[_0xe0b6('0x3a')]({},_0x1d13cd,_0x2cd191[_0xe0b6('0x43')]);return db['Cdr'][_0xe0b6('0x44')](_0x1d13cd)['then'](handleEntityNotFound(_0xd68677,null))['then'](respondWithResult(_0xd68677,null))[_0xe0b6('0x3e')](handleError(_0xd68677,null));};exports[_0xe0b6('0x45')]=function(_0x324faf,_0x3560eb){return db[_0xe0b6('0x3c')][_0xe0b6('0x45')](_0x324faf[_0xe0b6('0x46')],{})[_0xe0b6('0x24')](respondWithResult(_0x3560eb,0xc9))[_0xe0b6('0x3e')](handleError(_0x3560eb,null));};exports[_0xe0b6('0x23')]=function(_0x17dfd0,_0xf5bd3c){if(_0x17dfd0[_0xe0b6('0x46')]['id']){delete _0x17dfd0[_0xe0b6('0x46')]['id'];}return db[_0xe0b6('0x3c')][_0xe0b6('0x44')]({'where':{'id':_0x17dfd0[_0xe0b6('0x40')]['id']}})['then'](handleEntityNotFound(_0xf5bd3c,null))[_0xe0b6('0x24')](saveUpdates(_0x17dfd0['body'],null))[_0xe0b6('0x24')](respondWithResult(_0xf5bd3c,null))[_0xe0b6('0x3e')](handleError(_0xf5bd3c,null));};exports['destroy']=function(_0x2a49e8,_0x2f3b56){return db[_0xe0b6('0x3c')][_0xe0b6('0x44')]({'where':{'id':_0x2a49e8[_0xe0b6('0x40')]['id']}})[_0xe0b6('0x24')](handleEntityNotFound(_0x2f3b56,null))[_0xe0b6('0x24')](removeEntity(_0x2f3b56,null))[_0xe0b6('0x3e')](handleError(_0x2f3b56,null));};exports[_0xe0b6('0x47')]=function(_0x31c0d1,_0xd73323){return db[_0xe0b6('0x3c')][_0xe0b6('0x47')]()['then'](respondWithResult(_0xd73323,null))[_0xe0b6('0x3e')](handleError(_0xd73323,null));};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.model.js b/server/api/cdr/cdr.model.js
index d1b5141..60ae5c0 100644
--- a/server/api/cdr/cdr.model.js
+++ b/server/api/cdr/cdr.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9c80=['cdr','accountcode','calldate','disposition','dst','src','uniqueid','util','api','moment','request-promise','path','rimraf','../../config/environment','./cdr.attributes','exports'];(function(_0x32c3c8,_0x371a69){var _0xa61d0a=function(_0x426bf9){while(--_0x426bf9){_0x32c3c8['push'](_0x32c3c8['shift']());}};_0xa61d0a(++_0x371a69);}(_0x9c80,0x107));var _0x09c8=function(_0x341e0f,_0x4a09d0){_0x341e0f=_0x341e0f-0x0;var _0x59555a=_0x9c80[_0x341e0f];return _0x59555a;};'use strict';var _=require('lodash');var util=require(_0x09c8('0x0'));var logger=require('../../config/logger')(_0x09c8('0x1'));var moment=require(_0x09c8('0x2'));var BPromise=require('bluebird');var rp=require(_0x09c8('0x3'));var fs=require('fs');var path=require(_0x09c8('0x4'));var rimraf=require(_0x09c8('0x5'));var config=require(_0x09c8('0x6'));var attributes=require(_0x09c8('0x7'));module[_0x09c8('0x8')]=function(_0x491abf,_0x10ff44){return _0x491abf['define']('Cdr',attributes,{'tableName':_0x09c8('0x9'),'paranoid':![],'indexes':[{'name':_0x09c8('0xa'),'fields':[_0x09c8('0xa')]},{'name':_0x09c8('0xb'),'fields':[_0x09c8('0xb')]},{'name':'disposition','fields':[_0x09c8('0xc')]},{'name':_0x09c8('0xd'),'fields':[_0x09c8('0xd')]},{'name':_0x09c8('0xe'),'fields':[_0x09c8('0xe')]},{'name':_0x09c8('0xf'),'fields':['uniqueid']}],'timestamps':![]});};
\ No newline at end of file
+var _0x3c71=['request-promise','path','rimraf','exports','define','cdr','accountcode','calldate','disposition','dst','src','uniqueid','util','../../config/logger','api','moment','bluebird'];(function(_0xef3e4,_0x3a8560){var _0x2f4214=function(_0xfc62b3){while(--_0xfc62b3){_0xef3e4['push'](_0xef3e4['shift']());}};_0x2f4214(++_0x3a8560);}(_0x3c71,0xa5));var _0x13c7=function(_0x36d25b,_0x8a09c8){_0x36d25b=_0x36d25b-0x0;var _0x314a58=_0x3c71[_0x36d25b];return _0x314a58;};'use strict';var _=require('lodash');var util=require(_0x13c7('0x0'));var logger=require(_0x13c7('0x1'))(_0x13c7('0x2'));var moment=require(_0x13c7('0x3'));var BPromise=require(_0x13c7('0x4'));var rp=require(_0x13c7('0x5'));var fs=require('fs');var path=require(_0x13c7('0x6'));var rimraf=require(_0x13c7('0x7'));var config=require('../../config/environment');var attributes=require('./cdr.attributes');module[_0x13c7('0x8')]=function(_0x1f77c3,_0x5da601){return _0x1f77c3[_0x13c7('0x9')]('Cdr',attributes,{'tableName':_0x13c7('0xa'),'paranoid':![],'indexes':[{'name':_0x13c7('0xb'),'fields':[_0x13c7('0xb')]},{'name':'calldate','fields':[_0x13c7('0xc')]},{'name':'disposition','fields':[_0x13c7('0xd')]},{'name':_0x13c7('0xe'),'fields':['dst']},{'name':_0x13c7('0xf'),'fields':[_0x13c7('0xf')]},{'name':_0x13c7('0x10'),'fields':[_0x13c7('0x10')]}],'timestamps':![]});};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.rpc.js b/server/api/cdr/cdr.rpc.js
index 7c44c33..47150fb 100644
--- a/server/api/cdr/cdr.rpc.js
+++ b/server/api/cdr/cdr.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x871e=['Cdr,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info'];(function(_0x436bbf,_0x4847af){var _0x15c31a=function(_0x52091b){while(--_0x52091b){_0x436bbf['push'](_0x436bbf['shift']());}};_0x15c31a(++_0x4847af);}(_0x871e,0x182));var _0xe871=function(_0xf7339b,_0x44dcaa){_0xf7339b=_0xf7339b-0x0;var _0x118c96=_0x871e[_0xf7339b];return _0x118c96;};'use strict';var _=require('lodash');var util=require(_0xe871('0x0'));var moment=require(_0xe871('0x1'));var BPromise=require(_0xe871('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe871('0x3'));var db=require(_0xe871('0x4'))['db'];var utils=require(_0xe871('0x5'));var logger=require(_0xe871('0x6'))(_0xe871('0x7'));var config=require(_0xe871('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xe871('0x9')][_0xe871('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x362972,_0x3f1ba4,_0x1491e8){return new BPromise(function(_0x1e947c,_0xe40bfd){return client[_0xe871('0xb')](_0x362972,_0x1491e8)[_0xe871('0xc')](function(_0x5e7f9a){logger[_0xe871('0xd')](_0xe871('0xe'),_0x3f1ba4,_0xe871('0xf'));logger['debug']('Cdr,\x20%s,\x20%s,\x20%s',_0x3f1ba4,_0xe871('0xf'),JSON[_0xe871('0x10')](_0x5e7f9a));if(_0x5e7f9a[_0xe871('0x11')]){if(_0x5e7f9a[_0xe871('0x11')]['code']===0x1f4){logger['error'](_0xe871('0xe'),_0x3f1ba4,_0x5e7f9a[_0xe871('0x11')][_0xe871('0x12')]);return _0xe40bfd(_0x5e7f9a['error'][_0xe871('0x12')]);}logger[_0xe871('0x11')](_0xe871('0xe'),_0x3f1ba4,_0x5e7f9a[_0xe871('0x11')][_0xe871('0x12')]);return _0x1e947c(_0x5e7f9a[_0xe871('0x11')]['message']);}else{logger[_0xe871('0xd')](_0xe871('0xe'),_0x3f1ba4,_0xe871('0xf'));_0x1e947c(_0x5e7f9a[_0xe871('0x13')]['message']);}})['catch'](function(_0x118b4a){logger[_0xe871('0x11')](_0xe871('0xe'),_0x3f1ba4,_0x118b4a);_0xe40bfd(_0x118b4a);});});}
\ No newline at end of file
+var _0x200f=['info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','Cdr,\x20%s,\x20%s','request\x20sent','Cdr,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x1e79c6,_0x2ddf98){var _0x38e46a=function(_0x374807){while(--_0x374807){_0x1e79c6['push'](_0x1e79c6['shift']());}};_0x38e46a(++_0x2ddf98);}(_0x200f,0x8d));var _0xf200=function(_0x2110bb,_0x5bf49e){_0x2110bb=_0x2110bb-0x0;var _0x5cf87c=_0x200f[_0x2110bb];return _0x5cf87c;};'use strict';var _=require(_0xf200('0x0'));var util=require(_0xf200('0x1'));var moment=require(_0xf200('0x2'));var BPromise=require(_0xf200('0x3'));var rs=require(_0xf200('0x4'));var fs=require('fs');var Redis=require(_0xf200('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xf200('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0xf200('0x7'));var jayson=require(_0xf200('0x8'));var client=jayson[_0xf200('0x9')][_0xf200('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xfbd9dd,_0x47b45c,_0x8e9d60){return new BPromise(function(_0x2fa985,_0x36bf4d){return client[_0xf200('0xb')](_0xfbd9dd,_0x8e9d60)[_0xf200('0xc')](function(_0x4818db){logger['info'](_0xf200('0xd'),_0x47b45c,_0xf200('0xe'));logger['debug'](_0xf200('0xf'),_0x47b45c,'request\x20sent',JSON[_0xf200('0x10')](_0x4818db));if(_0x4818db['error']){if(_0x4818db[_0xf200('0x11')][_0xf200('0x12')]===0x1f4){logger[_0xf200('0x11')](_0xf200('0xd'),_0x47b45c,_0x4818db['error']['message']);return _0x36bf4d(_0x4818db[_0xf200('0x11')][_0xf200('0x13')]);}logger[_0xf200('0x11')]('Cdr,\x20%s,\x20%s',_0x47b45c,_0x4818db[_0xf200('0x11')][_0xf200('0x13')]);return _0x2fa985(_0x4818db[_0xf200('0x11')][_0xf200('0x13')]);}else{logger[_0xf200('0x14')](_0xf200('0xd'),_0x47b45c,_0xf200('0xe'));_0x2fa985(_0x4818db[_0xf200('0x15')][_0xf200('0x13')]);}})[_0xf200('0x16')](function(_0x39d8be){logger[_0xf200('0x11')](_0xf200('0xd'),_0x47b45c,_0x39d8be);_0x36bf4d(_0x39d8be);});});}
\ No newline at end of file
diff --git a/server/api/cdr/index.js b/server/api/cdr/index.js
index 408f833..22d5c5e 100644
--- a/server/api/cdr/index.js
+++ b/server/api/cdr/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x73db=['isAuthenticated','index','/describe','describe','show','post','create','put','update','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./cdr.controller','get'];(function(_0x3dbbe3,_0x3192bc){var _0x8d02fd=function(_0x52681c){while(--_0x52681c){_0x3dbbe3['push'](_0x3dbbe3['shift']());}};_0x8d02fd(++_0x3192bc);}(_0x73db,0x11c));var _0xb73d=function(_0x46f937,_0x2184c1){_0x46f937=_0x46f937-0x0;var _0x407d9b=_0x73db[_0x46f937];return _0x407d9b;};'use strict';var multer=require(_0xb73d('0x0'));var util=require(_0xb73d('0x1'));var path=require(_0xb73d('0x2'));var timeout=require(_0xb73d('0x3'));var express=require(_0xb73d('0x4'));var router=express[_0xb73d('0x5')]();var auth=require(_0xb73d('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xb73d('0x7'));var controller=require(_0xb73d('0x8'));router[_0xb73d('0x9')]('/',auth[_0xb73d('0xa')](),controller[_0xb73d('0xb')]);router['get'](_0xb73d('0xc'),auth[_0xb73d('0xa')](),controller[_0xb73d('0xd')]);router[_0xb73d('0x9')]('/:id',auth['isAuthenticated'](),controller[_0xb73d('0xe')]);router[_0xb73d('0xf')]('/',auth[_0xb73d('0xa')](),controller[_0xb73d('0x10')]);router[_0xb73d('0x11')]('/:id',auth['isAuthenticated'](),controller[_0xb73d('0x12')]);router['delete']('/:id',auth[_0xb73d('0xa')](),controller[_0xb73d('0x13')]);module[_0xb73d('0x14')]=router;
\ No newline at end of file
+var _0xa0b3=['index','/describe','describe','/:id','show','update','delete','destroy','multer','util','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./cdr.controller','get','isAuthenticated'];(function(_0x373e5e,_0x47c709){var _0x58d2c2=function(_0x23b0fc){while(--_0x23b0fc){_0x373e5e['push'](_0x373e5e['shift']());}};_0x58d2c2(++_0x47c709);}(_0xa0b3,0x1a6));var _0x3a0b=function(_0x3818a1,_0x31bc14){_0x3818a1=_0x3818a1-0x0;var _0x465793=_0xa0b3[_0x3818a1];return _0x465793;};'use strict';var multer=require(_0x3a0b('0x0'));var util=require(_0x3a0b('0x1'));var path=require('path');var timeout=require(_0x3a0b('0x2'));var express=require(_0x3a0b('0x3'));var router=express['Router']();var auth=require(_0x3a0b('0x4'));var interaction=require(_0x3a0b('0x5'));var config=require(_0x3a0b('0x6'));var controller=require(_0x3a0b('0x7'));router[_0x3a0b('0x8')]('/',auth[_0x3a0b('0x9')](),controller[_0x3a0b('0xa')]);router[_0x3a0b('0x8')](_0x3a0b('0xb'),auth[_0x3a0b('0x9')](),controller[_0x3a0b('0xc')]);router['get'](_0x3a0b('0xd'),auth[_0x3a0b('0x9')](),controller[_0x3a0b('0xe')]);router['post']('/',auth[_0x3a0b('0x9')](),controller['create']);router['put'](_0x3a0b('0xd'),auth['isAuthenticated'](),controller[_0x3a0b('0xf')]);router[_0x3a0b('0x10')]('/:id',auth['isAuthenticated'](),controller[_0x3a0b('0x11')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.attributes.js b/server/api/chatApplication/chatApplication.attributes.js
index 321a09c..66651db 100644
--- a/server/api/chatApplication/chatApplication.attributes.js
+++ b/server/api/chatApplication/chatApplication.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x4cfb=['exports','INTEGER','STRING','TEXT','*,*,*,*'];(function(_0x1b84d4,_0x25e453){var _0x5120f7=function(_0x24c6a5){while(--_0x24c6a5){_0x1b84d4['push'](_0x1b84d4['shift']());}};_0x5120f7(++_0x25e453);}(_0x4cfb,0xcd));var _0xb4cf=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x4cfb[_0x501510];return _0x1e6ee5;};'use strict';var Sequelize=require('sequelize');module[_0xb4cf('0x0')]={'priority':{'type':Sequelize[_0xb4cf('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0xb4cf('0x2')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0xb4cf('0x3')]()},'description':{'type':Sequelize[_0xb4cf('0x2')]},'interval':{'type':Sequelize[_0xb4cf('0x2')],'defaultValue':_0xb4cf('0x4')}};
\ No newline at end of file
+var _0x7a18=['exports','INTEGER','STRING','noop','TEXT','*,*,*,*'];(function(_0x5037ab,_0x43209e){var _0x512adb=function(_0x261783){while(--_0x261783){_0x5037ab['push'](_0x5037ab['shift']());}};_0x512adb(++_0x43209e);}(_0x7a18,0x15c));var _0x87a1=function(_0x3e21f4,_0x43d310){_0x3e21f4=_0x3e21f4-0x0;var _0x40fc49=_0x7a18[_0x3e21f4];return _0x40fc49;};'use strict';var Sequelize=require('sequelize');module[_0x87a1('0x0')]={'priority':{'type':Sequelize[_0x87a1('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0x87a1('0x2')],'allowNull':![],'defaultValue':_0x87a1('0x3')},'appdata':{'type':Sequelize[_0x87a1('0x4')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x87a1('0x2')],'defaultValue':_0x87a1('0x5')}};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.controller.js b/server/api/chatApplication/chatApplication.controller.js
index dc0c7e8..421408b 100644
--- a/server/api/chatApplication/chatApplication.controller.js
+++ b/server/api/chatApplication/chatApplication.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xd1eb=['set','Content-Range','reject','save','destroy','then','stack','name','send','show','model','keys','ChatApplication','rawAttributes','query','filters','attributes','intersection','fields','length','include','merge','options','find','catch','update','body','params','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit'];(function(_0x194f65,_0x1a1d57){var _0x50144b=function(_0x326c9a){while(--_0x326c9a){_0x194f65['push'](_0x194f65['shift']());}};_0x50144b(++_0x1a1d57);}(_0xd1eb,0x110));var _0xbd1e=function(_0x2be3b8,_0x2a620f){_0x2be3b8=_0x2be3b8-0x0;var _0x2134ff=_0xd1eb[_0x2be3b8];return _0x2134ff;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xbd1e('0x0'));var rimraf=require(_0xbd1e('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xbd1e('0x2'));var rp=require(_0xbd1e('0x3'));var moment=require(_0xbd1e('0x4'));var BPromise=require(_0xbd1e('0x5'));var Mustache=require(_0xbd1e('0x6'));var util=require(_0xbd1e('0x7'));var path=require(_0xbd1e('0x8'));var sox=require(_0xbd1e('0x9'));var csv=require(_0xbd1e('0xa'));var ejs=require(_0xbd1e('0xb'));var fs=require('fs');var _=require(_0xbd1e('0xc'));var squel=require(_0xbd1e('0xd'));var crypto=require('crypto');var jsforce=require(_0xbd1e('0xe'));var deskjs=require(_0xbd1e('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xbd1e('0x10'));var Redis=require(_0xbd1e('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xbd1e('0x12'));var as=require(_0xbd1e('0x13'));var hardwareService=require(_0xbd1e('0x14'));var logger=require(_0xbd1e('0x15'))(_0xbd1e('0x16'));var utils=require(_0xbd1e('0x17'));var config=require(_0xbd1e('0x18'));var db=require(_0xbd1e('0x19'))['db'];function respondWithStatusCode(_0x170ff9,_0x589c82){_0x589c82=_0x589c82||0xcc;return function(_0x4897e6){if(_0x4897e6){return _0x170ff9[_0xbd1e('0x1a')](_0x589c82);}return _0x170ff9[_0xbd1e('0x1b')](_0x589c82)[_0xbd1e('0x1c')]();};}function respondWithResult(_0x4328a3,_0x41e57e){_0x41e57e=_0x41e57e||0xc8;return function(_0x2e4189){if(_0x2e4189){return _0x4328a3['status'](_0x41e57e)[_0xbd1e('0x1d')](_0x2e4189);}};}function respondWithFilteredResult(_0x5e982b,_0x3549bb){return function(_0x4e545a){if(_0x4e545a){var _0x18077f=_0x4e545a[_0xbd1e('0x1e')],_0x97b211=_0x3549bb['offset'],_0x32782b=_0x3549bb[_0xbd1e('0x1f')]+_0x3549bb[_0xbd1e('0x20')],_0x225dc5;if(_0x32782b>=_0x18077f){_0x32782b=_0x18077f;_0x225dc5=0xc8;}else{_0x225dc5=0xce;}_0x5e982b[_0xbd1e('0x1b')](_0x225dc5);return _0x5e982b[_0xbd1e('0x21')](_0xbd1e('0x22'),_0x97b211+'-'+_0x32782b+'/'+_0x18077f)[_0xbd1e('0x1d')](_0x4e545a);}return null;};}function patchUpdates(_0x34af9b){return function(_0xbf241a){try{jsonpatch['apply'](_0xbf241a,_0x34af9b,!![]);}catch(_0x8f5d0a){return BPromise[_0xbd1e('0x23')](_0x8f5d0a);}return _0xbf241a[_0xbd1e('0x24')]();};}function saveUpdates(_0x1f453a,_0x2f2338){return function(_0x215c5c){if(_0x215c5c){return _0x215c5c['update'](_0x1f453a)['then'](function(_0x1f06f0){return _0x1f06f0;});}return null;};}function removeEntity(_0x50e1fd,_0x2eb428){return function(_0x5a3080){if(_0x5a3080){return _0x5a3080[_0xbd1e('0x25')]()[_0xbd1e('0x26')](function(){_0x50e1fd[_0xbd1e('0x1b')](0xcc)[_0xbd1e('0x1c')]();});}};}function handleEntityNotFound(_0x5cb9e4,_0x94b2cc){return function(_0x4dafb2){if(!_0x4dafb2){_0x5cb9e4['sendStatus'](0x194);}return _0x4dafb2;};}function handleError(_0x4cff13,_0x589df0){_0x589df0=_0x589df0||0x1f4;return function(_0x54446a){logger['error'](_0x54446a[_0xbd1e('0x27')]);if(_0x54446a[_0xbd1e('0x28')]){delete _0x54446a[_0xbd1e('0x28')];}_0x4cff13[_0xbd1e('0x1b')](_0x589df0)[_0xbd1e('0x29')](_0x54446a);};}exports[_0xbd1e('0x2a')]=function(_0x5dffb2,_0x5214ff){var _0xb088b9={'raw':!![],'where':{'id':_0x5dffb2['params']['id']}},_0x10333a={};_0x10333a[_0xbd1e('0x2b')]=_[_0xbd1e('0x2c')](db[_0xbd1e('0x2d')][_0xbd1e('0x2e')]);_0x10333a['query']=_[_0xbd1e('0x2c')](_0x5dffb2[_0xbd1e('0x2f')]);_0x10333a[_0xbd1e('0x30')]=_['intersection'](_0x10333a[_0xbd1e('0x2b')],_0x10333a[_0xbd1e('0x2f')]);_0xb088b9[_0xbd1e('0x31')]=_[_0xbd1e('0x32')](_0x10333a[_0xbd1e('0x2b')],qs[_0xbd1e('0x33')](_0x5dffb2[_0xbd1e('0x2f')][_0xbd1e('0x33')]));_0xb088b9['attributes']=_0xb088b9[_0xbd1e('0x31')][_0xbd1e('0x34')]?_0xb088b9[_0xbd1e('0x31')]:_0x10333a[_0xbd1e('0x2b')];if(_0x5dffb2[_0xbd1e('0x2f')]['includeAll']){_0xb088b9[_0xbd1e('0x35')]=[{'all':!![]}];}_0xb088b9=_[_0xbd1e('0x36')]({},_0xb088b9,_0x5dffb2[_0xbd1e('0x37')]);return db[_0xbd1e('0x2d')][_0xbd1e('0x38')](_0xb088b9)[_0xbd1e('0x26')](handleEntityNotFound(_0x5214ff,null))['then'](respondWithResult(_0x5214ff,null))[_0xbd1e('0x39')](handleError(_0x5214ff,null));};exports[_0xbd1e('0x3a')]=function(_0xec8974,_0x271145){if(_0xec8974[_0xbd1e('0x3b')]['id']){delete _0xec8974[_0xbd1e('0x3b')]['id'];}return db[_0xbd1e('0x2d')][_0xbd1e('0x38')]({'where':{'id':_0xec8974[_0xbd1e('0x3c')]['id']}})['then'](handleEntityNotFound(_0x271145,null))[_0xbd1e('0x26')](saveUpdates(_0xec8974[_0xbd1e('0x3b')],null))['then'](respondWithResult(_0x271145,null))['catch'](handleError(_0x271145,null));};exports['destroy']=function(_0x16e649,_0x4b7032){return db['ChatApplication']['find']({'where':{'id':_0x16e649['params']['id']}})[_0xbd1e('0x26')](handleEntityNotFound(_0x4b7032,null))[_0xbd1e('0x26')](removeEntity(_0x4b7032,null))[_0xbd1e('0x39')](handleError(_0x4b7032,null));};
\ No newline at end of file
+var _0x042e=['reject','update','then','sendStatus','error','stack','send','params','model','keys','ChatApplication','query','intersection','attributes','fields','length','includeAll','include','find','catch','body','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','status','end','limit','Content-Range'];(function(_0x57014b,_0x360c0f){var _0x2b258a=function(_0x52c4a3){while(--_0x52c4a3){_0x57014b['push'](_0x57014b['shift']());}};_0x2b258a(++_0x360c0f);}(_0x042e,0x182));var _0xe042=function(_0x197a2,_0x34df3d){_0x197a2=_0x197a2-0x0;var _0x3f0d10=_0x042e[_0x197a2];return _0x3f0d10;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xe042('0x0'));var rimraf=require(_0xe042('0x1'));var zipdir=require(_0xe042('0x2'));var jsonpatch=require(_0xe042('0x3'));var rp=require(_0xe042('0x4'));var moment=require('moment');var BPromise=require(_0xe042('0x5'));var Mustache=require(_0xe042('0x6'));var util=require(_0xe042('0x7'));var path=require(_0xe042('0x8'));var sox=require('sox');var csv=require(_0xe042('0x9'));var ejs=require(_0xe042('0xa'));var fs=require('fs');var _=require(_0xe042('0xb'));var squel=require(_0xe042('0xc'));var crypto=require('crypto');var jsforce=require(_0xe042('0xd'));var deskjs=require(_0xe042('0xe'));var toCsv=require(_0xe042('0x9'));var querystring=require(_0xe042('0xf'));var Papa=require(_0xe042('0x10'));var Redis=require(_0xe042('0x11'));var authService=require(_0xe042('0x12'));var qs=require(_0xe042('0x13'));var as=require(_0xe042('0x14'));var hardwareService=require(_0xe042('0x15'));var logger=require(_0xe042('0x16'))(_0xe042('0x17'));var utils=require(_0xe042('0x18'));var config=require('../../config/environment');var db=require(_0xe042('0x19'))['db'];function respondWithStatusCode(_0x554f82,_0x5a4964){_0x5a4964=_0x5a4964||0xcc;return function(_0x64dad7){if(_0x64dad7){return _0x554f82['sendStatus'](_0x5a4964);}return _0x554f82[_0xe042('0x1a')](_0x5a4964)[_0xe042('0x1b')]();};}function respondWithResult(_0x5459aa,_0x4b2a9a){_0x4b2a9a=_0x4b2a9a||0xc8;return function(_0x502a4b){if(_0x502a4b){return _0x5459aa[_0xe042('0x1a')](_0x4b2a9a)['json'](_0x502a4b);}};}function respondWithFilteredResult(_0x32683e,_0x139465){return function(_0x13b73b){if(_0x13b73b){var _0x1b630d=_0x13b73b['count'],_0x3341bd=_0x139465['offset'],_0x2c7de3=_0x139465['offset']+_0x139465[_0xe042('0x1c')],_0x282a2d;if(_0x2c7de3>=_0x1b630d){_0x2c7de3=_0x1b630d;_0x282a2d=0xc8;}else{_0x282a2d=0xce;}_0x32683e['status'](_0x282a2d);return _0x32683e['set'](_0xe042('0x1d'),_0x3341bd+'-'+_0x2c7de3+'/'+_0x1b630d)['json'](_0x13b73b);}return null;};}function patchUpdates(_0x2bd3c8){return function(_0x19b657){try{jsonpatch['apply'](_0x19b657,_0x2bd3c8,!![]);}catch(_0x129343){return BPromise[_0xe042('0x1e')](_0x129343);}return _0x19b657['save']();};}function saveUpdates(_0x292eea,_0x42425e){return function(_0x20be89){if(_0x20be89){return _0x20be89[_0xe042('0x1f')](_0x292eea)[_0xe042('0x20')](function(_0xf6ec5e){return _0xf6ec5e;});}return null;};}function removeEntity(_0x3d8c71,_0x5e6a33){return function(_0x9cc77c){if(_0x9cc77c){return _0x9cc77c['destroy']()[_0xe042('0x20')](function(){_0x3d8c71['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x1d16a0,_0xc3ef){return function(_0x442432){if(!_0x442432){_0x1d16a0[_0xe042('0x21')](0x194);}return _0x442432;};}function handleError(_0x3d9ede,_0x4fe8e9){_0x4fe8e9=_0x4fe8e9||0x1f4;return function(_0x2c3527){logger[_0xe042('0x22')](_0x2c3527[_0xe042('0x23')]);if(_0x2c3527['name']){delete _0x2c3527['name'];}_0x3d9ede[_0xe042('0x1a')](_0x4fe8e9)[_0xe042('0x24')](_0x2c3527);};}exports['show']=function(_0x30a8d2,_0x463f3a){var _0x10107f={'raw':!![],'where':{'id':_0x30a8d2[_0xe042('0x25')]['id']}},_0xfc5665={};_0xfc5665[_0xe042('0x26')]=_[_0xe042('0x27')](db[_0xe042('0x28')]['rawAttributes']);_0xfc5665[_0xe042('0x29')]=_['keys'](_0x30a8d2['query']);_0xfc5665['filters']=_[_0xe042('0x2a')](_0xfc5665[_0xe042('0x26')],_0xfc5665['query']);_0x10107f[_0xe042('0x2b')]=_[_0xe042('0x2a')](_0xfc5665[_0xe042('0x26')],qs[_0xe042('0x2c')](_0x30a8d2[_0xe042('0x29')][_0xe042('0x2c')]));_0x10107f[_0xe042('0x2b')]=_0x10107f[_0xe042('0x2b')][_0xe042('0x2d')]?_0x10107f[_0xe042('0x2b')]:_0xfc5665[_0xe042('0x26')];if(_0x30a8d2[_0xe042('0x29')][_0xe042('0x2e')]){_0x10107f[_0xe042('0x2f')]=[{'all':!![]}];}_0x10107f=_['merge']({},_0x10107f,_0x30a8d2['options']);return db['ChatApplication'][_0xe042('0x30')](_0x10107f)[_0xe042('0x20')](handleEntityNotFound(_0x463f3a,null))['then'](respondWithResult(_0x463f3a,null))[_0xe042('0x31')](handleError(_0x463f3a,null));};exports[_0xe042('0x1f')]=function(_0xb31c2,_0x194a86){if(_0xb31c2['body']['id']){delete _0xb31c2[_0xe042('0x32')]['id'];}return db[_0xe042('0x28')][_0xe042('0x30')]({'where':{'id':_0xb31c2[_0xe042('0x25')]['id']}})[_0xe042('0x20')](handleEntityNotFound(_0x194a86,null))[_0xe042('0x20')](saveUpdates(_0xb31c2[_0xe042('0x32')],null))[_0xe042('0x20')](respondWithResult(_0x194a86,null))[_0xe042('0x31')](handleError(_0x194a86,null));};exports[_0xe042('0x33')]=function(_0x59ac25,_0x1821cd){return db[_0xe042('0x28')][_0xe042('0x30')]({'where':{'id':_0x59ac25['params']['id']}})[_0xe042('0x20')](handleEntityNotFound(_0x1821cd,null))['then'](removeEntity(_0x1821cd,null))['catch'](handleError(_0x1821cd,null));};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.model.js b/server/api/chatApplication/chatApplication.model.js
index 2f24e9c..1c32570 100644
--- a/server/api/chatApplication/chatApplication.model.js
+++ b/server/api/chatApplication/chatApplication.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x093e=['util','../../config/logger','moment','bluebird','request-promise','path','rimraf','./chatApplication.attributes','exports','define','ChatApplication','chat_applications','utf8mb4','lodash'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x093e,0x1bf));var _0xe093=function(_0xc72d26,_0x40dd69){_0xc72d26=_0xc72d26-0x0;var _0x4cc1d0=_0x093e[_0xc72d26];return _0x4cc1d0;};'use strict';var _=require(_0xe093('0x0'));var util=require(_0xe093('0x1'));var logger=require(_0xe093('0x2'))('api');var moment=require(_0xe093('0x3'));var BPromise=require(_0xe093('0x4'));var rp=require(_0xe093('0x5'));var fs=require('fs');var path=require(_0xe093('0x6'));var rimraf=require(_0xe093('0x7'));var config=require('../../config/environment');var attributes=require(_0xe093('0x8'));module[_0xe093('0x9')]=function(_0x5a7cd4,_0x43d9f1){return _0x5a7cd4[_0xe093('0xa')](_0xe093('0xb'),attributes,{'tableName':_0xe093('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xe093('0xd'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0xc722=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./chatApplication.attributes','ChatApplication','chat_applications','utf8mb4','utf8mb4_unicode_ci','util'];(function(_0x580d97,_0xf8a984){var _0x50d54d=function(_0x22810a){while(--_0x22810a){_0x580d97['push'](_0x580d97['shift']());}};_0x50d54d(++_0xf8a984);}(_0xc722,0x144));var _0x2c72=function(_0x5d71b9,_0x3e19c8){_0x5d71b9=_0x5d71b9-0x0;var _0x26d9e5=_0xc722[_0x5d71b9];return _0x26d9e5;};'use strict';var _=require('lodash');var util=require(_0x2c72('0x0'));var logger=require(_0x2c72('0x1'))(_0x2c72('0x2'));var moment=require(_0x2c72('0x3'));var BPromise=require(_0x2c72('0x4'));var rp=require(_0x2c72('0x5'));var fs=require('fs');var path=require(_0x2c72('0x6'));var rimraf=require(_0x2c72('0x7'));var config=require('../../config/environment');var attributes=require(_0x2c72('0x8'));module['exports']=function(_0x42e4a8,_0x45be75){return _0x42e4a8['define'](_0x2c72('0x9'),attributes,{'tableName':_0x2c72('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x2c72('0xb'),'collate':_0x2c72('0xc')});};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.rpc.js b/server/api/chatApplication/chatApplication.rpc.js
index 1b87666..5dd1d8a 100644
--- a/server/api/chatApplication/chatApplication.rpc.js
+++ b/server/api/chatApplication/chatApplication.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x29e2=['request','then','info','ChatApplication,\x20%s,\x20%s','request\x20sent','ChatApplication,\x20%s,\x20%s,\x20%s','error','code','message','result','util','bluebird','randomstring','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x4d9e46,_0x4a9455){var _0xcd91fc=function(_0x59a448){while(--_0x59a448){_0x4d9e46['push'](_0x4d9e46['shift']());}};_0xcd91fc(++_0x4a9455);}(_0x29e2,0xf4));var _0x229e=function(_0x29a7e0,_0x35095f){_0x29a7e0=_0x29a7e0-0x0;var _0x4b9980=_0x29e2[_0x29a7e0];return _0x4b9980;};'use strict';var _=require('lodash');var util=require(_0x229e('0x0'));var moment=require('moment');var BPromise=require(_0x229e('0x1'));var rs=require(_0x229e('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x229e('0x3'))(_0x229e('0x4'));var config=require(_0x229e('0x5'));var jayson=require(_0x229e('0x6'));var client=jayson[_0x229e('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0xdb9e86,_0x5a43d8,_0x5b735f){return new BPromise(function(_0x423e03,_0x463840){return client[_0x229e('0x8')](_0xdb9e86,_0x5b735f)[_0x229e('0x9')](function(_0x189e37){logger[_0x229e('0xa')](_0x229e('0xb'),_0x5a43d8,_0x229e('0xc'));logger['debug'](_0x229e('0xd'),_0x5a43d8,'request\x20sent',JSON['stringify'](_0x189e37));if(_0x189e37[_0x229e('0xe')]){if(_0x189e37[_0x229e('0xe')][_0x229e('0xf')]===0x1f4){logger[_0x229e('0xe')]('ChatApplication,\x20%s,\x20%s',_0x5a43d8,_0x189e37[_0x229e('0xe')][_0x229e('0x10')]);return _0x463840(_0x189e37[_0x229e('0xe')]['message']);}logger['error']('ChatApplication,\x20%s,\x20%s',_0x5a43d8,_0x189e37['error'][_0x229e('0x10')]);return _0x423e03(_0x189e37[_0x229e('0xe')]['message']);}else{logger[_0x229e('0xa')]('ChatApplication,\x20%s,\x20%s',_0x5a43d8,'request\x20sent');_0x423e03(_0x189e37[_0x229e('0x11')][_0x229e('0x10')]);}})['catch'](function(_0x1312e7){logger[_0x229e('0xe')](_0x229e('0xb'),_0x5a43d8,_0x1312e7);_0x463840(_0x1312e7);});});}
\ No newline at end of file
+var _0x7051=['rpc','../../config/environment','client','http','then','info','ChatApplication,\x20%s,\x20%s','request\x20sent','debug','ChatApplication,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','bluebird','randomstring','../../mysqldb','../../config/logger'];(function(_0x3d75c4,_0x594c23){var _0x407801=function(_0x344234){while(--_0x344234){_0x3d75c4['push'](_0x3d75c4['shift']());}};_0x407801(++_0x594c23);}(_0x7051,0x120));var _0x1705=function(_0x26fc81,_0x57fc19){_0x26fc81=_0x26fc81-0x0;var _0x9feece=_0x7051[_0x26fc81];return _0x9feece;};'use strict';var _=require(_0x1705('0x0'));var util=require(_0x1705('0x1'));var moment=require('moment');var BPromise=require(_0x1705('0x2'));var rs=require(_0x1705('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1705('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x1705('0x5'))(_0x1705('0x6'));var config=require(_0x1705('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x1705('0x8')][_0x1705('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x16dd1d,_0x38eb46,_0x5aa6b1){return new BPromise(function(_0x523842,_0x41cb7b){return client['request'](_0x16dd1d,_0x5aa6b1)[_0x1705('0xa')](function(_0x8672e1){logger[_0x1705('0xb')](_0x1705('0xc'),_0x38eb46,_0x1705('0xd'));logger[_0x1705('0xe')](_0x1705('0xf'),_0x38eb46,'request\x20sent',JSON['stringify'](_0x8672e1));if(_0x8672e1[_0x1705('0x10')]){if(_0x8672e1['error'][_0x1705('0x11')]===0x1f4){logger[_0x1705('0x10')]('ChatApplication,\x20%s,\x20%s',_0x38eb46,_0x8672e1['error']['message']);return _0x41cb7b(_0x8672e1[_0x1705('0x10')][_0x1705('0x12')]);}logger[_0x1705('0x10')](_0x1705('0xc'),_0x38eb46,_0x8672e1[_0x1705('0x10')][_0x1705('0x12')]);return _0x523842(_0x8672e1[_0x1705('0x10')]['message']);}else{logger[_0x1705('0xb')](_0x1705('0xc'),_0x38eb46,'request\x20sent');_0x523842(_0x8672e1[_0x1705('0x13')][_0x1705('0x12')]);}})[_0x1705('0x14')](function(_0x528f38){logger[_0x1705('0x10')](_0x1705('0xc'),_0x38eb46,_0x528f38);_0x41cb7b(_0x528f38);});});}
\ No newline at end of file
diff --git a/server/api/chatApplication/index.js b/server/api/chatApplication/index.js
index 2dea209..ab5d2aa 100644
--- a/server/api/chatApplication/index.js
+++ b/server/api/chatApplication/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x2a33=['connect-timeout','Router','../../components/interaction/service','../../config/environment','./chatApplication.controller','get','/:id','put','isAuthenticated','update','delete','destroy','multer','path'];(function(_0x449bdf,_0x24caba){var _0x429647=function(_0x1450c7){while(--_0x1450c7){_0x449bdf['push'](_0x449bdf['shift']());}};_0x429647(++_0x24caba);}(_0x2a33,0x132));var _0x32a3=function(_0x4d0312,_0xb5433e){_0x4d0312=_0x4d0312-0x0;var _0x311591=_0x2a33[_0x4d0312];return _0x311591;};'use strict';var multer=require(_0x32a3('0x0'));var util=require('util');var path=require(_0x32a3('0x1'));var timeout=require(_0x32a3('0x2'));var express=require('express');var router=express[_0x32a3('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x32a3('0x4'));var config=require(_0x32a3('0x5'));var controller=require(_0x32a3('0x6'));router[_0x32a3('0x7')](_0x32a3('0x8'),auth['isAuthenticated'](),controller['show']);router[_0x32a3('0x9')](_0x32a3('0x8'),auth[_0x32a3('0xa')](),controller[_0x32a3('0xb')]);router[_0x32a3('0xc')](_0x32a3('0x8'),auth[_0x32a3('0xa')](),controller[_0x32a3('0xd')]);module['exports']=router;
\ No newline at end of file
+var _0xcce7=['../../components/interaction/service','../../config/environment','./chatApplication.controller','get','/:id','isAuthenticated','show','put','update','delete','destroy','util','express','../../components/auth/service'];(function(_0x13e31b,_0x2d82f4){var _0xc5484e=function(_0x14cbeb){while(--_0x14cbeb){_0x13e31b['push'](_0x13e31b['shift']());}};_0xc5484e(++_0x2d82f4);}(_0xcce7,0x1bd));var _0x7cce=function(_0x314cdb,_0x39595c){_0x314cdb=_0x314cdb-0x0;var _0x586c99=_0xcce7[_0x314cdb];return _0x586c99;};'use strict';var multer=require('multer');var util=require(_0x7cce('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x7cce('0x1'));var router=express['Router']();var auth=require(_0x7cce('0x2'));var interaction=require(_0x7cce('0x3'));var config=require(_0x7cce('0x4'));var controller=require(_0x7cce('0x5'));router[_0x7cce('0x6')](_0x7cce('0x7'),auth[_0x7cce('0x8')](),controller[_0x7cce('0x9')]);router[_0x7cce('0xa')]('/:id',auth[_0x7cce('0x8')](),controller[_0x7cce('0xb')]);router[_0x7cce('0xc')](_0x7cce('0x7'),auth['isAuthenticated'](),controller[_0x7cce('0xd')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.attributes.js b/server/api/chatGroup/chatGroup.attributes.js
index 81ea381..cadc056 100644
--- a/server/api/chatGroup/chatGroup.attributes.js
+++ b/server/api/chatGroup/chatGroup.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x804f=['sequelize','STRING','BOOLEAN'];(function(_0x12e17f,_0xa7df1c){var _0x476cb6=function(_0x5d8d37){while(--_0x5d8d37){_0x12e17f['push'](_0x12e17f['shift']());}};_0x476cb6(++_0xa7df1c);}(_0x804f,0xd2));var _0xf804=function(_0x2ae705,_0x5aa965){_0x2ae705=_0x2ae705-0x0;var _0x3dd8d4=_0x804f[_0x2ae705];return _0x3dd8d4;};'use strict';var Sequelize=require(_0xf804('0x0'));module['exports']={'name':{'type':Sequelize[_0xf804('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0xf804('0x1')]},'write':{'type':Sequelize[_0xf804('0x2')],'defaultValue':!![]}};
\ No newline at end of file
+var _0xf94a=['sequelize','exports','STRING','BOOLEAN'];(function(_0x2f6cfb,_0x43a30a){var _0x566464=function(_0x167d40){while(--_0x167d40){_0x2f6cfb['push'](_0x2f6cfb['shift']());}};_0x566464(++_0x43a30a);}(_0xf94a,0xec));var _0xaf94=function(_0x18ed88,_0x2fb109){_0x18ed88=_0x18ed88-0x0;var _0x43c29c=_0xf94a[_0x18ed88];return _0x43c29c;};'use strict';var Sequelize=require(_0xaf94('0x0'));module[_0xaf94('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0xaf94('0x2')]},'write':{'type':Sequelize[_0xaf94('0x3')],'defaultValue':!![]}};
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.controller.js b/server/api/chatGroup/chatGroup.controller.js
index 68b7f3a..6a2581f 100644
--- a/server/api/chatGroup/chatGroup.controller.js
+++ b/server/api/chatGroup/chatGroup.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xf1a5=['attributes','length','hasOwnProperty','order','sort','where','filters','pick','filter','VIRTUAL','merge','ChatGroup','includeAll','include','findAll','rows','show','params','find','create','body','describe','getUnread','ChatInternalMessage','user','toInteger','addMembers','ids','omit','getMembers','User','intersection','removeMembers','addMessage','ChatGroupId','getMessages','$gte','split','options','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatGroup.socket','jayson/promise','client','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','ChatGroup,\x20%s,\x20%s','debug','ChatGroup,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','info','result','catch','status','end','json','count','offset','limit','set','Content-Range','reject','save','update','destroy','sendStatus','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','keys','query','fields'];(function(_0x28dd1a,_0x48ecb3){var _0x18d911=function(_0x22c789){while(--_0x22c789){_0x28dd1a['push'](_0x28dd1a['shift']());}};_0x18d911(++_0x48ecb3);}(_0xf1a5,0x1db));var _0x5f1a=function(_0x234a2b,_0x45bad9){_0x234a2b=_0x234a2b-0x0;var _0x9a1bd1=_0xf1a5[_0x234a2b];return _0x9a1bd1;};'use strict';var pdf=require(_0x5f1a('0x0'));var emlformat=require(_0x5f1a('0x1'));var rimraf=require(_0x5f1a('0x2'));var zipdir=require(_0x5f1a('0x3'));var jsonpatch=require(_0x5f1a('0x4'));var rp=require(_0x5f1a('0x5'));var moment=require(_0x5f1a('0x6'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x5f1a('0x7'));var sox=require(_0x5f1a('0x8'));var csv=require(_0x5f1a('0x9'));var ejs=require(_0x5f1a('0xa'));var fs=require('fs');var _=require(_0x5f1a('0xb'));var squel=require(_0x5f1a('0xc'));var crypto=require('crypto');var jsforce=require(_0x5f1a('0xd'));var deskjs=require(_0x5f1a('0xe'));var toCsv=require('to-csv');var querystring=require(_0x5f1a('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x5f1a('0x10'));var as=require(_0x5f1a('0x11'));var hardwareService=require(_0x5f1a('0x12'));var logger=require(_0x5f1a('0x13'))(_0x5f1a('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x5f1a('0x15'))['db'];config[_0x5f1a('0x16')]=_[_0x5f1a('0x17')](config[_0x5f1a('0x16')],{'host':_0x5f1a('0x18'),'port':0x18eb});var socket=require(_0x5f1a('0x19'))(new Redis(config['redis']));require(_0x5f1a('0x1a'))['register'](socket);var jayson=require(_0x5f1a('0x1b'));var client=jayson[_0x5f1a('0x1c')]['http']({'port':0x232a});function checkPasswordPattern(_0xb7712f,_0x324fc5,_0x5aa536){if(_0x5aa536){var _0x2ab713=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x2ab713[_0x5f1a('0x1d')](_0x324fc5)){return _0xb7712f;}else{throw new db[(_0x5f1a('0x1e'))][(_0x5f1a('0x1f'))](_0x5f1a('0x20'));}}else{return _0xb7712f;}}function respondWithRpcPromise(_0x4498b6,_0x2ec2ca,_0x1e17ec,_0x142259){return new BPromise(function(_0x20ab5c,_0x530acb){var _0x72266f=_0x142259||client;return _0x72266f[_0x5f1a('0x21')](_0x4498b6,_0x1e17ec)[_0x5f1a('0x22')](function(_0xd2324c){logger['info'](_0x5f1a('0x23'),_0x2ec2ca,'request\x20sent');logger[_0x5f1a('0x24')](_0x5f1a('0x25'),_0x2ec2ca,_0x5f1a('0x26'),JSON['stringify'](_0xd2324c));if(_0xd2324c['error']){if(_0xd2324c[_0x5f1a('0x27')]['code']===0x1f4){logger[_0x5f1a('0x27')](_0x5f1a('0x23'),_0x2ec2ca,_0xd2324c[_0x5f1a('0x27')]['message']);return _0x530acb(_0xd2324c['error']['message']);}logger[_0x5f1a('0x27')](_0x5f1a('0x23'),_0x2ec2ca,_0xd2324c[_0x5f1a('0x27')][_0x5f1a('0x28')]);return _0x20ab5c(_0xd2324c['error'][_0x5f1a('0x28')]);}else{logger[_0x5f1a('0x29')]('ChatGroup,\x20%s,\x20%s',_0x2ec2ca,_0x5f1a('0x26'));_0x20ab5c(_0xd2324c[_0x5f1a('0x2a')]['message']);}})[_0x5f1a('0x2b')](function(_0x4de007){logger[_0x5f1a('0x27')](_0x5f1a('0x23'),_0x2ec2ca,_0x4de007);_0x530acb(_0x4de007);});});}function respondWithStatusCode(_0x3d8e32,_0x56bdbe){_0x56bdbe=_0x56bdbe||0xcc;return function(_0x4eaf1e){if(_0x4eaf1e){return _0x3d8e32['sendStatus'](_0x56bdbe);}return _0x3d8e32[_0x5f1a('0x2c')](_0x56bdbe)[_0x5f1a('0x2d')]();};}function respondWithResult(_0x1674ed,_0x2161e9){_0x2161e9=_0x2161e9||0xc8;return function(_0x512330){if(_0x512330){return _0x1674ed[_0x5f1a('0x2c')](_0x2161e9)[_0x5f1a('0x2e')](_0x512330);}};}function respondWithFilteredResult(_0x427263,_0x34acac){return function(_0x53750b){if(_0x53750b){var _0x381e18=_0x53750b[_0x5f1a('0x2f')],_0x45e704=_0x34acac[_0x5f1a('0x30')],_0x1b45a9=_0x34acac['offset']+_0x34acac[_0x5f1a('0x31')],_0x2b7b30;if(_0x1b45a9>=_0x381e18){_0x1b45a9=_0x381e18;_0x2b7b30=0xc8;}else{_0x2b7b30=0xce;}_0x427263[_0x5f1a('0x2c')](_0x2b7b30);return _0x427263[_0x5f1a('0x32')](_0x5f1a('0x33'),_0x45e704+'-'+_0x1b45a9+'/'+_0x381e18)[_0x5f1a('0x2e')](_0x53750b);}return null;};}function patchUpdates(_0x161631){return function(_0x4e5ce8){try{jsonpatch['apply'](_0x4e5ce8,_0x161631,!![]);}catch(_0x4820f9){return BPromise[_0x5f1a('0x34')](_0x4820f9);}return _0x4e5ce8[_0x5f1a('0x35')]();};}function saveUpdates(_0x2fb878,_0x49f7bc){return function(_0x147fcc){if(_0x147fcc){return _0x147fcc[_0x5f1a('0x36')](_0x2fb878)[_0x5f1a('0x22')](function(_0xb3c52a){return _0xb3c52a;});}return null;};}function removeEntity(_0x2b76dc,_0x4ba609){return function(_0x5711bd){if(_0x5711bd){return _0x5711bd[_0x5f1a('0x37')]()[_0x5f1a('0x22')](function(){_0x2b76dc[_0x5f1a('0x2c')](0xcc)[_0x5f1a('0x2d')]();});}};}function handleEntityNotFound(_0x341139,_0x2c0019){return function(_0x54cfb4){if(!_0x54cfb4){_0x341139[_0x5f1a('0x38')](0x194);}return _0x54cfb4;};}function handleError(_0x583a9b,_0x320a8a){_0x320a8a=_0x320a8a||0x1f4;return function(_0x5c4b6e){logger[_0x5f1a('0x27')](_0x5c4b6e[_0x5f1a('0x39')]);if(_0x5c4b6e[_0x5f1a('0x3a')]){delete _0x5c4b6e[_0x5f1a('0x3a')];}_0x583a9b[_0x5f1a('0x2c')](_0x320a8a)[_0x5f1a('0x3b')](_0x5c4b6e);};}exports[_0x5f1a('0x3c')]=function(_0x2e3a82,_0x29e815){var _0xeace9c={},_0x3101fd={},_0x204da9={'count':0x0,'rows':[]};var _0x259fa7=_[_0x5f1a('0x3d')](db['ChatGroup'][_0x5f1a('0x3e')],function(_0x20b57f){return{'name':_0x20b57f[_0x5f1a('0x3f')],'type':_0x20b57f[_0x5f1a('0x40')][_0x5f1a('0x41')]};});_0x3101fd[_0x5f1a('0x42')]=_[_0x5f1a('0x3d')](_0x259fa7,_0x5f1a('0x3a'));_0x3101fd['query']=_[_0x5f1a('0x43')](_0x2e3a82[_0x5f1a('0x44')]);_0x3101fd['filters']=_['intersection'](_0x3101fd['model'],_0x3101fd[_0x5f1a('0x44')]);_0xeace9c['attributes']=_['intersection'](_0x3101fd['model'],qs['fields'](_0x2e3a82[_0x5f1a('0x44')][_0x5f1a('0x45')]));_0xeace9c[_0x5f1a('0x46')]=_0xeace9c[_0x5f1a('0x46')][_0x5f1a('0x47')]?_0xeace9c[_0x5f1a('0x46')]:_0x3101fd[_0x5f1a('0x42')];if(!_0x2e3a82[_0x5f1a('0x44')][_0x5f1a('0x48')]('nolimit')){_0xeace9c[_0x5f1a('0x31')]=qs[_0x5f1a('0x31')](_0x2e3a82[_0x5f1a('0x44')]['limit']);_0xeace9c['offset']=qs[_0x5f1a('0x30')](_0x2e3a82[_0x5f1a('0x44')]['offset']);}_0xeace9c[_0x5f1a('0x49')]=qs[_0x5f1a('0x4a')](_0x2e3a82['query'][_0x5f1a('0x4a')]);_0xeace9c[_0x5f1a('0x4b')]=qs[_0x5f1a('0x4c')](_[_0x5f1a('0x4d')](_0x2e3a82[_0x5f1a('0x44')],_0x3101fd[_0x5f1a('0x4c')]),_0x259fa7);if(_0x2e3a82['query'][_0x5f1a('0x4e')]){_0xeace9c[_0x5f1a('0x4b')]=_['merge'](_0xeace9c[_0x5f1a('0x4b')],{'$or':_[_0x5f1a('0x3d')](_0x259fa7,function(_0x1dc138){if(_0x1dc138[_0x5f1a('0x40')]!==_0x5f1a('0x4f')){var _0x3ef538={};_0x3ef538[_0x1dc138['name']]={'$like':'%'+_0x2e3a82[_0x5f1a('0x44')][_0x5f1a('0x4e')]+'%'};return _0x3ef538;}})});}_0xeace9c=_[_0x5f1a('0x50')]({},_0xeace9c,_0x2e3a82['options']);var _0x36c972={'where':_0xeace9c['where']};return db[_0x5f1a('0x51')][_0x5f1a('0x2f')](_0x36c972)[_0x5f1a('0x22')](function(_0x507f39){_0x204da9[_0x5f1a('0x2f')]=_0x507f39;if(_0x2e3a82[_0x5f1a('0x44')][_0x5f1a('0x52')]){_0xeace9c[_0x5f1a('0x53')]=[{'all':!![]}];}return db[_0x5f1a('0x51')][_0x5f1a('0x54')](_0xeace9c);})['then'](function(_0x58bcba){_0x204da9[_0x5f1a('0x55')]=_0x58bcba;return _0x204da9;})[_0x5f1a('0x22')](respondWithFilteredResult(_0x29e815,_0xeace9c))[_0x5f1a('0x2b')](handleError(_0x29e815,null));};exports[_0x5f1a('0x56')]=function(_0x3da108,_0x5f4e5a){var _0x32f971={'raw':!![],'where':{'id':_0x3da108[_0x5f1a('0x57')]['id']}},_0x2a5064={};_0x2a5064['model']=_[_0x5f1a('0x43')](db[_0x5f1a('0x51')][_0x5f1a('0x3e')]);_0x2a5064[_0x5f1a('0x44')]=_[_0x5f1a('0x43')](_0x3da108[_0x5f1a('0x44')]);_0x2a5064[_0x5f1a('0x4c')]=_['intersection'](_0x2a5064['model'],_0x2a5064['query']);_0x32f971[_0x5f1a('0x46')]=_['intersection'](_0x2a5064[_0x5f1a('0x42')],qs[_0x5f1a('0x45')](_0x3da108[_0x5f1a('0x44')][_0x5f1a('0x45')]));_0x32f971[_0x5f1a('0x46')]=_0x32f971['attributes'][_0x5f1a('0x47')]?_0x32f971['attributes']:_0x2a5064[_0x5f1a('0x42')];if(_0x3da108[_0x5f1a('0x44')][_0x5f1a('0x52')]){_0x32f971['include']=[{'all':!![]}];}_0x32f971=_[_0x5f1a('0x50')]({},_0x32f971,_0x3da108['options']);return db['ChatGroup'][_0x5f1a('0x58')](_0x32f971)[_0x5f1a('0x22')](handleEntityNotFound(_0x5f4e5a,null))['then'](respondWithResult(_0x5f4e5a,null))[_0x5f1a('0x2b')](handleError(_0x5f4e5a,null));};exports[_0x5f1a('0x59')]=function(_0x4b993c,_0x532daf){return db[_0x5f1a('0x51')][_0x5f1a('0x59')](_0x4b993c[_0x5f1a('0x5a')],{})[_0x5f1a('0x22')](respondWithResult(_0x532daf,0xc9))[_0x5f1a('0x2b')](handleError(_0x532daf,null));};exports[_0x5f1a('0x36')]=function(_0x318b98,_0x26a2d5){if(_0x318b98['body']['id']){delete _0x318b98[_0x5f1a('0x5a')]['id'];}return db[_0x5f1a('0x51')]['find']({'where':{'id':_0x318b98[_0x5f1a('0x57')]['id']}})[_0x5f1a('0x22')](handleEntityNotFound(_0x26a2d5,null))['then'](saveUpdates(_0x318b98[_0x5f1a('0x5a')],null))[_0x5f1a('0x22')](respondWithResult(_0x26a2d5,null))['catch'](handleError(_0x26a2d5,null));};exports['destroy']=function(_0x24f918,_0x2767c8){return db[_0x5f1a('0x51')][_0x5f1a('0x58')]({'where':{'id':_0x24f918[_0x5f1a('0x57')]['id']}})[_0x5f1a('0x22')](handleEntityNotFound(_0x2767c8,null))[_0x5f1a('0x22')](removeEntity(_0x2767c8,null))['catch'](handleError(_0x2767c8,null));};exports[_0x5f1a('0x5b')]=function(_0x3dfa32,_0x33c319){return db[_0x5f1a('0x51')][_0x5f1a('0x5b')]()[_0x5f1a('0x22')](respondWithResult(_0x33c319,null))[_0x5f1a('0x2b')](handleError(_0x33c319,null));};exports[_0x5f1a('0x5c')]=function(_0x53718c,_0x548fab,_0x4c0f73){return db[_0x5f1a('0x5d')][_0x5f1a('0x2f')]({'where':{'ChatGroupId':_0x53718c['params']['id'],'ToId':_0x53718c[_0x5f1a('0x5e')]['id'],'read':![]}})[_0x5f1a('0x22')](function(_0x1a36dc){return{'id':_[_0x5f1a('0x5f')](_0x53718c[_0x5f1a('0x57')]['id']),'count':_0x1a36dc};})[_0x5f1a('0x22')](respondWithResult(_0x548fab,null))[_0x5f1a('0x2b')](handleError(_0x548fab,null));};exports[_0x5f1a('0x60')]=function(_0x2f04a2,_0x31a2e9,_0x53d314){return db[_0x5f1a('0x51')][_0x5f1a('0x58')]({'where':{'id':_0x2f04a2[_0x5f1a('0x57')]['id']}})[_0x5f1a('0x22')](handleEntityNotFound(_0x31a2e9,null))[_0x5f1a('0x22')](function(_0x38a049){if(_0x38a049){return _0x38a049[_0x5f1a('0x60')](_0x2f04a2[_0x5f1a('0x5a')][_0x5f1a('0x61')],_[_0x5f1a('0x62')](_0x2f04a2[_0x5f1a('0x5a')],[_0x5f1a('0x61'),'id'])||{});}})['then'](respondWithResult(_0x31a2e9,null))[_0x5f1a('0x2b')](handleError(_0x31a2e9,null));};exports[_0x5f1a('0x63')]=function(_0x4100a7,_0x3ae556,_0x1057a6){var _0x5892de={};var _0x56e4d7={};var _0x3daa18;var _0x2f49c8;return db[_0x5f1a('0x51')]['findOne']({'where':{'id':_0x4100a7[_0x5f1a('0x57')]['id']}})[_0x5f1a('0x22')](handleEntityNotFound(_0x3ae556,null))[_0x5f1a('0x22')](function(_0x37c66f){if(_0x37c66f){_0x3daa18=_0x37c66f;_0x56e4d7[_0x5f1a('0x42')]=_['keys'](db[_0x5f1a('0x64')][_0x5f1a('0x3e')]);_0x56e4d7[_0x5f1a('0x44')]=_[_0x5f1a('0x43')](_0x4100a7[_0x5f1a('0x44')]);_0x56e4d7['filters']=_[_0x5f1a('0x65')](_0x56e4d7[_0x5f1a('0x42')],_0x56e4d7[_0x5f1a('0x44')]);_0x5892de[_0x5f1a('0x46')]=_['intersection'](_0x56e4d7['model'],qs[_0x5f1a('0x45')](_0x4100a7[_0x5f1a('0x44')][_0x5f1a('0x45')]));_0x5892de[_0x5f1a('0x46')]=_0x5892de[_0x5f1a('0x46')][_0x5f1a('0x47')]?_0x5892de[_0x5f1a('0x46')]:_0x56e4d7[_0x5f1a('0x42')];_0x5892de['order']=qs[_0x5f1a('0x4a')](_0x4100a7[_0x5f1a('0x44')][_0x5f1a('0x4a')]);_0x5892de[_0x5f1a('0x4b')]=qs[_0x5f1a('0x4c')](_[_0x5f1a('0x4d')](_0x4100a7[_0x5f1a('0x44')],_0x56e4d7[_0x5f1a('0x4c')]));if(_0x4100a7[_0x5f1a('0x44')]['filter']){_0x5892de[_0x5f1a('0x4b')]=_[_0x5f1a('0x50')](_0x5892de['where'],{'$or':_[_0x5f1a('0x3d')](_0x5892de[_0x5f1a('0x46')],function(_0x254951){var _0x76a8d4={};_0x76a8d4[_0x254951]={'$like':'%'+_0x4100a7[_0x5f1a('0x44')][_0x5f1a('0x4e')]+'%'};return _0x76a8d4;})});}_0x5892de=_['merge']({},_0x5892de,_0x4100a7['options']);return _0x3daa18['getMembers'](_0x5892de);}})[_0x5f1a('0x22')](function(_0xd80583){if(_0xd80583){_0x2f49c8=_0xd80583[_0x5f1a('0x47')];if(!_0x4100a7[_0x5f1a('0x44')][_0x5f1a('0x48')]('nolimit')){_0x5892de['limit']=qs[_0x5f1a('0x31')](_0x4100a7[_0x5f1a('0x44')][_0x5f1a('0x31')]);_0x5892de[_0x5f1a('0x30')]=qs[_0x5f1a('0x30')](_0x4100a7[_0x5f1a('0x44')][_0x5f1a('0x30')]);}return _0x3daa18[_0x5f1a('0x63')](_0x5892de);}})[_0x5f1a('0x22')](function(_0xbf7fe0){if(_0xbf7fe0){return _0xbf7fe0?{'count':_0x2f49c8,'rows':_0xbf7fe0}:null;}})[_0x5f1a('0x22')](respondWithResult(_0x3ae556,null))['catch'](handleError(_0x3ae556,null));};exports['removeMembers']=function(_0x37280d,_0x501c17,_0x340cc1){return db['ChatGroup']['find']({'where':{'id':_0x37280d[_0x5f1a('0x57')]['id']}})[_0x5f1a('0x22')](handleEntityNotFound(_0x501c17,null))[_0x5f1a('0x22')](function(_0x4d4956){if(_0x4d4956){return _0x4d4956[_0x5f1a('0x66')](_0x37280d['query']['ids']);}})[_0x5f1a('0x22')](respondWithStatusCode(_0x501c17,null))[_0x5f1a('0x2b')](handleError(_0x501c17,null));};exports[_0x5f1a('0x67')]=function(_0x4e9bb5,_0x54551e,_0x3139aa){if(_0x4e9bb5[_0x5f1a('0x5a')]['id']){delete _0x4e9bb5[_0x5f1a('0x5a')]['id'];}return db[_0x5f1a('0x51')][_0x5f1a('0x58')]({'where':{'id':_0x4e9bb5[_0x5f1a('0x57')]['id']}})[_0x5f1a('0x22')](handleEntityNotFound(_0x54551e,null))[_0x5f1a('0x22')](function(_0xab1f10){if(_0xab1f10){_0x4e9bb5[_0x5f1a('0x5a')][_0x5f1a('0x68')]=_0xab1f10['id'];return db[_0x5f1a('0x5d')]['create'](_0x4e9bb5[_0x5f1a('0x5a')]);}})['then'](respondWithResult(_0x54551e,null))[_0x5f1a('0x2b')](handleError(_0x54551e,null));};exports[_0x5f1a('0x69')]=function(_0x48463a,_0x4bb867,_0x25d73a){var _0x310f25={};var _0x172a4d={};var _0x3a8314;var _0x20c845;return db['ChatGroup']['findOne']({'where':{'id':_0x48463a[_0x5f1a('0x57')]['id']}})[_0x5f1a('0x22')](handleEntityNotFound(_0x4bb867,null))[_0x5f1a('0x22')](function(_0xc1a814){if(_0xc1a814){_0x3a8314=_0xc1a814;_0x172a4d[_0x5f1a('0x42')]=_[_0x5f1a('0x43')](db[_0x5f1a('0x5d')][_0x5f1a('0x3e')]);_0x172a4d['query']=_[_0x5f1a('0x43')](_0x48463a[_0x5f1a('0x44')]);_0x172a4d['filters']=_[_0x5f1a('0x65')](_0x172a4d[_0x5f1a('0x42')],_0x172a4d['query']);_0x310f25[_0x5f1a('0x46')]=_[_0x5f1a('0x65')](_0x172a4d[_0x5f1a('0x42')],qs[_0x5f1a('0x45')](_0x48463a[_0x5f1a('0x44')][_0x5f1a('0x45')]));_0x310f25['attributes']=_0x310f25[_0x5f1a('0x46')][_0x5f1a('0x47')]?_0x310f25[_0x5f1a('0x46')]:_0x172a4d[_0x5f1a('0x42')];_0x310f25[_0x5f1a('0x49')]=qs[_0x5f1a('0x4a')](_0x48463a[_0x5f1a('0x44')][_0x5f1a('0x4a')]);_0x310f25['where']=qs['filters'](_[_0x5f1a('0x4d')](_0x48463a[_0x5f1a('0x44')],_0x172a4d['filters']));if(_0x48463a[_0x5f1a('0x44')][_0x5f1a('0x4e')]){_0x310f25[_0x5f1a('0x4b')]=_['merge'](_0x310f25['where'],{'$or':_['map'](_0x310f25[_0x5f1a('0x46')],function(_0x421c9f){var _0x128a71={};_0x128a71[_0x421c9f]={'$like':'%'+_0x48463a[_0x5f1a('0x44')]['filter']+'%'};return _0x128a71;})});}if(_0x48463a[_0x5f1a('0x44')][_0x5f1a('0x6a')]){var _0x84a730=_0x48463a['query'][_0x5f1a('0x6a')][_0x5f1a('0x6b')](',');var _0x461027={};_0x461027[_0x84a730[0x0]]={'$gte':moment(_0x84a730[0x1])['format']('YYYY-MM-DD\x20HH:mm:ss')};_0x310f25[_0x5f1a('0x4b')]=_['merge'](_0x310f25[_0x5f1a('0x4b')],_0x461027);}_0x310f25=_['merge']({},_0x310f25,_0x48463a[_0x5f1a('0x6c')]);return _0x3a8314[_0x5f1a('0x69')](_0x310f25);}})[_0x5f1a('0x22')](function(_0x4bd7f7){if(_0x4bd7f7){_0x20c845=_0x4bd7f7[_0x5f1a('0x47')];if(!_0x48463a[_0x5f1a('0x44')][_0x5f1a('0x48')]('nolimit')){_0x310f25[_0x5f1a('0x31')]=qs[_0x5f1a('0x31')](_0x48463a[_0x5f1a('0x44')]['limit']);_0x310f25[_0x5f1a('0x30')]=qs[_0x5f1a('0x30')](_0x48463a[_0x5f1a('0x44')][_0x5f1a('0x30')]);}return _0x3a8314[_0x5f1a('0x69')](_0x310f25);}})[_0x5f1a('0x22')](function(_0x1acdde){if(_0x1acdde){return _0x1acdde?{'count':_0x20c845,'rows':_0x1acdde}:null;}})[_0x5f1a('0x22')](respondWithResult(_0x4bb867,null))[_0x5f1a('0x2b')](handleError(_0x4bb867,null));};
\ No newline at end of file
+var _0x03fa=['findOne','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','nolimit','html-pdf','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','lodash','crypto','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatGroup.socket','jayson/promise','http','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','ChatGroup,\x20%s,\x20%s','request\x20sent','error','code','message','sendStatus','end','json','count','offset','limit','status','Content-Range','apply','reject','save','update','stack','name','send','index','map','ChatGroup','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','pick','filter','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','merge','find','create','body','destroy','ChatInternalMessage','user','toInteger','addMembers','ids','omit','getMembers','order','addMessage','ChatGroupId','getMessages'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x03fa,0x70));var _0xa03f=function(_0x5970a4,_0x410a19){_0x5970a4=_0x5970a4-0x0;var _0x45fc63=_0x03fa[_0x5970a4];return _0x45fc63;};'use strict';var pdf=require(_0xa03f('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xa03f('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa03f('0x2'));var rp=require(_0xa03f('0x3'));var moment=require(_0xa03f('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xa03f('0x5'));var util=require(_0xa03f('0x6'));var path=require(_0xa03f('0x7'));var sox=require(_0xa03f('0x8'));var csv=require(_0xa03f('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xa03f('0xa'));var squel=require('squel');var crypto=require(_0xa03f('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xa03f('0x9'));var querystring=require(_0xa03f('0xc'));var Papa=require('papaparse');var Redis=require(_0xa03f('0xd'));var authService=require(_0xa03f('0xe'));var qs=require(_0xa03f('0xf'));var as=require(_0xa03f('0x10'));var hardwareService=require(_0xa03f('0x11'));var logger=require('../../config/logger')('api');var utils=require(_0xa03f('0x12'));var config=require(_0xa03f('0x13'));var db=require(_0xa03f('0x14'))['db'];config[_0xa03f('0x15')]=_[_0xa03f('0x16')](config[_0xa03f('0x15')],{'host':_0xa03f('0x17'),'port':0x18eb});var socket=require(_0xa03f('0x18'))(new Redis(config[_0xa03f('0x15')]));require(_0xa03f('0x19'))['register'](socket);var jayson=require(_0xa03f('0x1a'));var client=jayson['client'][_0xa03f('0x1b')]({'port':0x232a});function checkPasswordPattern(_0x3866f,_0xe87e87,_0x324480){if(_0x324480){var _0x6b9aa9=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x6b9aa9[_0xa03f('0x1c')](_0xe87e87)){return _0x3866f;}else{throw new db[(_0xa03f('0x1d'))][(_0xa03f('0x1e'))](_0xa03f('0x1f'));}}else{return _0x3866f;}}function respondWithRpcPromise(_0x17c203,_0xf5b28,_0x2fcfe2,_0x163ac7){return new BPromise(function(_0x3c2080,_0x3bb904){var _0x531f1e=_0x163ac7||client;return _0x531f1e[_0xa03f('0x20')](_0x17c203,_0x2fcfe2)[_0xa03f('0x21')](function(_0xa5bbb9){logger[_0xa03f('0x22')](_0xa03f('0x23'),_0xf5b28,_0xa03f('0x24'));logger['debug']('ChatGroup,\x20%s,\x20%s,\x20%s',_0xf5b28,_0xa03f('0x24'),JSON['stringify'](_0xa5bbb9));if(_0xa5bbb9[_0xa03f('0x25')]){if(_0xa5bbb9[_0xa03f('0x25')][_0xa03f('0x26')]===0x1f4){logger[_0xa03f('0x25')]('ChatGroup,\x20%s,\x20%s',_0xf5b28,_0xa5bbb9[_0xa03f('0x25')][_0xa03f('0x27')]);return _0x3bb904(_0xa5bbb9[_0xa03f('0x25')][_0xa03f('0x27')]);}logger[_0xa03f('0x25')](_0xa03f('0x23'),_0xf5b28,_0xa5bbb9['error']['message']);return _0x3c2080(_0xa5bbb9[_0xa03f('0x25')][_0xa03f('0x27')]);}else{logger[_0xa03f('0x22')](_0xa03f('0x23'),_0xf5b28,_0xa03f('0x24'));_0x3c2080(_0xa5bbb9['result'][_0xa03f('0x27')]);}})['catch'](function(_0xcec26f){logger[_0xa03f('0x25')](_0xa03f('0x23'),_0xf5b28,_0xcec26f);_0x3bb904(_0xcec26f);});});}function respondWithStatusCode(_0x475153,_0x1c2a8b){_0x1c2a8b=_0x1c2a8b||0xcc;return function(_0x315d3c){if(_0x315d3c){return _0x475153[_0xa03f('0x28')](_0x1c2a8b);}return _0x475153['status'](_0x1c2a8b)[_0xa03f('0x29')]();};}function respondWithResult(_0x52d089,_0x4596d2){_0x4596d2=_0x4596d2||0xc8;return function(_0x32bd2f){if(_0x32bd2f){return _0x52d089['status'](_0x4596d2)[_0xa03f('0x2a')](_0x32bd2f);}};}function respondWithFilteredResult(_0x118dd7,_0x593997){return function(_0x547983){if(_0x547983){var _0x32406e=_0x547983[_0xa03f('0x2b')],_0x170f4d=_0x593997[_0xa03f('0x2c')],_0xa085a9=_0x593997[_0xa03f('0x2c')]+_0x593997[_0xa03f('0x2d')],_0x29dee3;if(_0xa085a9>=_0x32406e){_0xa085a9=_0x32406e;_0x29dee3=0xc8;}else{_0x29dee3=0xce;}_0x118dd7[_0xa03f('0x2e')](_0x29dee3);return _0x118dd7['set'](_0xa03f('0x2f'),_0x170f4d+'-'+_0xa085a9+'/'+_0x32406e)[_0xa03f('0x2a')](_0x547983);}return null;};}function patchUpdates(_0x180d80){return function(_0x44312e){try{jsonpatch[_0xa03f('0x30')](_0x44312e,_0x180d80,!![]);}catch(_0x50dede){return BPromise[_0xa03f('0x31')](_0x50dede);}return _0x44312e[_0xa03f('0x32')]();};}function saveUpdates(_0x58e6ce,_0x20e192){return function(_0x595bc8){if(_0x595bc8){return _0x595bc8[_0xa03f('0x33')](_0x58e6ce)['then'](function(_0x98c39c){return _0x98c39c;});}return null;};}function removeEntity(_0x43747d,_0xe160f1){return function(_0x45419f){if(_0x45419f){return _0x45419f['destroy']()[_0xa03f('0x21')](function(){_0x43747d['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x2ea760,_0x569463){return function(_0x1511d0){if(!_0x1511d0){_0x2ea760[_0xa03f('0x28')](0x194);}return _0x1511d0;};}function handleError(_0x30f959,_0x2dc307){_0x2dc307=_0x2dc307||0x1f4;return function(_0x5ae951){logger['error'](_0x5ae951[_0xa03f('0x34')]);if(_0x5ae951[_0xa03f('0x35')]){delete _0x5ae951[_0xa03f('0x35')];}_0x30f959[_0xa03f('0x2e')](_0x2dc307)[_0xa03f('0x36')](_0x5ae951);};}exports[_0xa03f('0x37')]=function(_0x3f4f75,_0x466033){var _0x1139bf={},_0x3ffb0d={},_0x4daf1d={'count':0x0,'rows':[]};var _0x519898=_[_0xa03f('0x38')](db[_0xa03f('0x39')]['rawAttributes'],function(_0x1b2eb2){return{'name':_0x1b2eb2[_0xa03f('0x3a')],'type':_0x1b2eb2[_0xa03f('0x3b')][_0xa03f('0x3c')]};});_0x3ffb0d[_0xa03f('0x3d')]=_[_0xa03f('0x38')](_0x519898,_0xa03f('0x35'));_0x3ffb0d[_0xa03f('0x3e')]=_[_0xa03f('0x3f')](_0x3f4f75['query']);_0x3ffb0d[_0xa03f('0x40')]=_[_0xa03f('0x41')](_0x3ffb0d[_0xa03f('0x3d')],_0x3ffb0d[_0xa03f('0x3e')]);_0x1139bf[_0xa03f('0x42')]=_['intersection'](_0x3ffb0d[_0xa03f('0x3d')],qs[_0xa03f('0x43')](_0x3f4f75[_0xa03f('0x3e')][_0xa03f('0x43')]));_0x1139bf[_0xa03f('0x42')]=_0x1139bf['attributes'][_0xa03f('0x44')]?_0x1139bf[_0xa03f('0x42')]:_0x3ffb0d[_0xa03f('0x3d')];if(!_0x3f4f75[_0xa03f('0x3e')][_0xa03f('0x45')]('nolimit')){_0x1139bf[_0xa03f('0x2d')]=qs[_0xa03f('0x2d')](_0x3f4f75[_0xa03f('0x3e')]['limit']);_0x1139bf[_0xa03f('0x2c')]=qs['offset'](_0x3f4f75['query'][_0xa03f('0x2c')]);}_0x1139bf['order']=qs[_0xa03f('0x46')](_0x3f4f75[_0xa03f('0x3e')][_0xa03f('0x46')]);_0x1139bf[_0xa03f('0x47')]=qs['filters'](_[_0xa03f('0x48')](_0x3f4f75['query'],_0x3ffb0d[_0xa03f('0x40')]),_0x519898);if(_0x3f4f75[_0xa03f('0x3e')][_0xa03f('0x49')]){_0x1139bf[_0xa03f('0x47')]=_['merge'](_0x1139bf[_0xa03f('0x47')],{'$or':_[_0xa03f('0x38')](_0x519898,function(_0x571df0){if(_0x571df0['type']!==_0xa03f('0x4a')){var _0x53ca2c={};_0x53ca2c[_0x571df0['name']]={'$like':'%'+_0x3f4f75[_0xa03f('0x3e')]['filter']+'%'};return _0x53ca2c;}})});}_0x1139bf=_['merge']({},_0x1139bf,_0x3f4f75[_0xa03f('0x4b')]);var _0x18233a={'where':_0x1139bf[_0xa03f('0x47')]};return db[_0xa03f('0x39')][_0xa03f('0x2b')](_0x18233a)[_0xa03f('0x21')](function(_0x33d3bd){_0x4daf1d[_0xa03f('0x2b')]=_0x33d3bd;if(_0x3f4f75[_0xa03f('0x3e')][_0xa03f('0x4c')]){_0x1139bf[_0xa03f('0x4d')]=[{'all':!![]}];}return db['ChatGroup'][_0xa03f('0x4e')](_0x1139bf);})[_0xa03f('0x21')](function(_0x22059f){_0x4daf1d[_0xa03f('0x4f')]=_0x22059f;return _0x4daf1d;})[_0xa03f('0x21')](respondWithFilteredResult(_0x466033,_0x1139bf))[_0xa03f('0x50')](handleError(_0x466033,null));};exports[_0xa03f('0x51')]=function(_0x554c7c,_0x1378cf){var _0x19b07e={'raw':!![],'where':{'id':_0x554c7c[_0xa03f('0x52')]['id']}},_0x2cd8af={};_0x2cd8af[_0xa03f('0x3d')]=_[_0xa03f('0x3f')](db['ChatGroup'][_0xa03f('0x53')]);_0x2cd8af[_0xa03f('0x3e')]=_[_0xa03f('0x3f')](_0x554c7c[_0xa03f('0x3e')]);_0x2cd8af[_0xa03f('0x40')]=_[_0xa03f('0x41')](_0x2cd8af[_0xa03f('0x3d')],_0x2cd8af[_0xa03f('0x3e')]);_0x19b07e[_0xa03f('0x42')]=_[_0xa03f('0x41')](_0x2cd8af[_0xa03f('0x3d')],qs[_0xa03f('0x43')](_0x554c7c['query'][_0xa03f('0x43')]));_0x19b07e[_0xa03f('0x42')]=_0x19b07e[_0xa03f('0x42')]['length']?_0x19b07e[_0xa03f('0x42')]:_0x2cd8af['model'];if(_0x554c7c['query']['includeAll']){_0x19b07e[_0xa03f('0x4d')]=[{'all':!![]}];}_0x19b07e=_[_0xa03f('0x54')]({},_0x19b07e,_0x554c7c[_0xa03f('0x4b')]);return db['ChatGroup'][_0xa03f('0x55')](_0x19b07e)[_0xa03f('0x21')](handleEntityNotFound(_0x1378cf,null))['then'](respondWithResult(_0x1378cf,null))[_0xa03f('0x50')](handleError(_0x1378cf,null));};exports[_0xa03f('0x56')]=function(_0x139fbc,_0xbca44c){return db['ChatGroup'][_0xa03f('0x56')](_0x139fbc['body'],{})[_0xa03f('0x21')](respondWithResult(_0xbca44c,0xc9))[_0xa03f('0x50')](handleError(_0xbca44c,null));};exports[_0xa03f('0x33')]=function(_0x7b4aaf,_0x18b5b9){if(_0x7b4aaf[_0xa03f('0x57')]['id']){delete _0x7b4aaf['body']['id'];}return db[_0xa03f('0x39')][_0xa03f('0x55')]({'where':{'id':_0x7b4aaf[_0xa03f('0x52')]['id']}})['then'](handleEntityNotFound(_0x18b5b9,null))[_0xa03f('0x21')](saveUpdates(_0x7b4aaf['body'],null))[_0xa03f('0x21')](respondWithResult(_0x18b5b9,null))['catch'](handleError(_0x18b5b9,null));};exports[_0xa03f('0x58')]=function(_0x2e858a,_0x35697b){return db[_0xa03f('0x39')][_0xa03f('0x55')]({'where':{'id':_0x2e858a[_0xa03f('0x52')]['id']}})['then'](handleEntityNotFound(_0x35697b,null))[_0xa03f('0x21')](removeEntity(_0x35697b,null))[_0xa03f('0x50')](handleError(_0x35697b,null));};exports['describe']=function(_0xadf9db,_0xda5468){return db['ChatGroup']['describe']()[_0xa03f('0x21')](respondWithResult(_0xda5468,null))[_0xa03f('0x50')](handleError(_0xda5468,null));};exports['getUnread']=function(_0x5425d2,_0x4e9eee,_0x1fc592){return db[_0xa03f('0x59')][_0xa03f('0x2b')]({'where':{'ChatGroupId':_0x5425d2[_0xa03f('0x52')]['id'],'ToId':_0x5425d2[_0xa03f('0x5a')]['id'],'read':![]}})[_0xa03f('0x21')](function(_0x261872){return{'id':_[_0xa03f('0x5b')](_0x5425d2['params']['id']),'count':_0x261872};})[_0xa03f('0x21')](respondWithResult(_0x4e9eee,null))[_0xa03f('0x50')](handleError(_0x4e9eee,null));};exports[_0xa03f('0x5c')]=function(_0x37c946,_0x440022,_0x166861){return db[_0xa03f('0x39')][_0xa03f('0x55')]({'where':{'id':_0x37c946[_0xa03f('0x52')]['id']}})[_0xa03f('0x21')](handleEntityNotFound(_0x440022,null))['then'](function(_0x2d7d43){if(_0x2d7d43){return _0x2d7d43[_0xa03f('0x5c')](_0x37c946[_0xa03f('0x57')][_0xa03f('0x5d')],_[_0xa03f('0x5e')](_0x37c946[_0xa03f('0x57')],[_0xa03f('0x5d'),'id'])||{});}})[_0xa03f('0x21')](respondWithResult(_0x440022,null))[_0xa03f('0x50')](handleError(_0x440022,null));};exports[_0xa03f('0x5f')]=function(_0x197331,_0x1000ff,_0x3e57ed){var _0x38816a={};var _0x860f09={};var _0x52df7e;var _0x33af3e;return db[_0xa03f('0x39')]['findOne']({'where':{'id':_0x197331['params']['id']}})[_0xa03f('0x21')](handleEntityNotFound(_0x1000ff,null))[_0xa03f('0x21')](function(_0x1b2590){if(_0x1b2590){_0x52df7e=_0x1b2590;_0x860f09[_0xa03f('0x3d')]=_['keys'](db['User'][_0xa03f('0x53')]);_0x860f09['query']=_['keys'](_0x197331[_0xa03f('0x3e')]);_0x860f09[_0xa03f('0x40')]=_[_0xa03f('0x41')](_0x860f09[_0xa03f('0x3d')],_0x860f09[_0xa03f('0x3e')]);_0x38816a[_0xa03f('0x42')]=_[_0xa03f('0x41')](_0x860f09[_0xa03f('0x3d')],qs[_0xa03f('0x43')](_0x197331[_0xa03f('0x3e')]['fields']));_0x38816a['attributes']=_0x38816a[_0xa03f('0x42')][_0xa03f('0x44')]?_0x38816a[_0xa03f('0x42')]:_0x860f09[_0xa03f('0x3d')];_0x38816a[_0xa03f('0x60')]=qs[_0xa03f('0x46')](_0x197331[_0xa03f('0x3e')][_0xa03f('0x46')]);_0x38816a[_0xa03f('0x47')]=qs['filters'](_[_0xa03f('0x48')](_0x197331[_0xa03f('0x3e')],_0x860f09[_0xa03f('0x40')]));if(_0x197331[_0xa03f('0x3e')][_0xa03f('0x49')]){_0x38816a['where']=_[_0xa03f('0x54')](_0x38816a[_0xa03f('0x47')],{'$or':_[_0xa03f('0x38')](_0x38816a['attributes'],function(_0xbac291){var _0x33a819={};_0x33a819[_0xbac291]={'$like':'%'+_0x197331[_0xa03f('0x3e')][_0xa03f('0x49')]+'%'};return _0x33a819;})});}_0x38816a=_[_0xa03f('0x54')]({},_0x38816a,_0x197331[_0xa03f('0x4b')]);return _0x52df7e[_0xa03f('0x5f')](_0x38816a);}})[_0xa03f('0x21')](function(_0x369058){if(_0x369058){_0x33af3e=_0x369058[_0xa03f('0x44')];if(!_0x197331[_0xa03f('0x3e')][_0xa03f('0x45')]('nolimit')){_0x38816a[_0xa03f('0x2d')]=qs['limit'](_0x197331[_0xa03f('0x3e')][_0xa03f('0x2d')]);_0x38816a[_0xa03f('0x2c')]=qs['offset'](_0x197331['query']['offset']);}return _0x52df7e['getMembers'](_0x38816a);}})[_0xa03f('0x21')](function(_0x379f86){if(_0x379f86){return _0x379f86?{'count':_0x33af3e,'rows':_0x379f86}:null;}})[_0xa03f('0x21')](respondWithResult(_0x1000ff,null))[_0xa03f('0x50')](handleError(_0x1000ff,null));};exports['removeMembers']=function(_0x3d7821,_0x113da3,_0x63bfc5){return db[_0xa03f('0x39')][_0xa03f('0x55')]({'where':{'id':_0x3d7821[_0xa03f('0x52')]['id']}})['then'](handleEntityNotFound(_0x113da3,null))[_0xa03f('0x21')](function(_0x27edfb){if(_0x27edfb){return _0x27edfb['removeMembers'](_0x3d7821['query']['ids']);}})[_0xa03f('0x21')](respondWithStatusCode(_0x113da3,null))[_0xa03f('0x50')](handleError(_0x113da3,null));};exports[_0xa03f('0x61')]=function(_0x570d6d,_0x42665f,_0x436bfd){if(_0x570d6d[_0xa03f('0x57')]['id']){delete _0x570d6d['body']['id'];}return db[_0xa03f('0x39')][_0xa03f('0x55')]({'where':{'id':_0x570d6d[_0xa03f('0x52')]['id']}})[_0xa03f('0x21')](handleEntityNotFound(_0x42665f,null))[_0xa03f('0x21')](function(_0x19caac){if(_0x19caac){_0x570d6d[_0xa03f('0x57')][_0xa03f('0x62')]=_0x19caac['id'];return db[_0xa03f('0x59')][_0xa03f('0x56')](_0x570d6d[_0xa03f('0x57')]);}})[_0xa03f('0x21')](respondWithResult(_0x42665f,null))['catch'](handleError(_0x42665f,null));};exports[_0xa03f('0x63')]=function(_0x1ef4dd,_0x495e79,_0x1faef3){var _0x4058d1={};var _0x343794={};var _0x153d18;var _0x4f7759;return db[_0xa03f('0x39')][_0xa03f('0x64')]({'where':{'id':_0x1ef4dd[_0xa03f('0x52')]['id']}})[_0xa03f('0x21')](handleEntityNotFound(_0x495e79,null))[_0xa03f('0x21')](function(_0x2738ef){if(_0x2738ef){_0x153d18=_0x2738ef;_0x343794[_0xa03f('0x3d')]=_[_0xa03f('0x3f')](db[_0xa03f('0x59')][_0xa03f('0x53')]);_0x343794['query']=_[_0xa03f('0x3f')](_0x1ef4dd['query']);_0x343794[_0xa03f('0x40')]=_[_0xa03f('0x41')](_0x343794[_0xa03f('0x3d')],_0x343794[_0xa03f('0x3e')]);_0x4058d1[_0xa03f('0x42')]=_[_0xa03f('0x41')](_0x343794[_0xa03f('0x3d')],qs[_0xa03f('0x43')](_0x1ef4dd['query'][_0xa03f('0x43')]));_0x4058d1[_0xa03f('0x42')]=_0x4058d1[_0xa03f('0x42')]['length']?_0x4058d1[_0xa03f('0x42')]:_0x343794[_0xa03f('0x3d')];_0x4058d1[_0xa03f('0x60')]=qs[_0xa03f('0x46')](_0x1ef4dd[_0xa03f('0x3e')][_0xa03f('0x46')]);_0x4058d1[_0xa03f('0x47')]=qs[_0xa03f('0x40')](_[_0xa03f('0x48')](_0x1ef4dd['query'],_0x343794[_0xa03f('0x40')]));if(_0x1ef4dd[_0xa03f('0x3e')][_0xa03f('0x49')]){_0x4058d1[_0xa03f('0x47')]=_[_0xa03f('0x54')](_0x4058d1[_0xa03f('0x47')],{'$or':_[_0xa03f('0x38')](_0x4058d1['attributes'],function(_0x126f8a){var _0x46ae92={};_0x46ae92[_0x126f8a]={'$like':'%'+_0x1ef4dd[_0xa03f('0x3e')]['filter']+'%'};return _0x46ae92;})});}if(_0x1ef4dd[_0xa03f('0x3e')][_0xa03f('0x65')]){var _0x3bc1ec=_0x1ef4dd[_0xa03f('0x3e')][_0xa03f('0x65')][_0xa03f('0x66')](',');var _0x560d21={};_0x560d21[_0x3bc1ec[0x0]]={'$gte':moment(_0x3bc1ec[0x1])[_0xa03f('0x67')](_0xa03f('0x68'))};_0x4058d1[_0xa03f('0x47')]=_['merge'](_0x4058d1['where'],_0x560d21);}_0x4058d1=_[_0xa03f('0x54')]({},_0x4058d1,_0x1ef4dd[_0xa03f('0x4b')]);return _0x153d18[_0xa03f('0x63')](_0x4058d1);}})[_0xa03f('0x21')](function(_0x43fd6c){if(_0x43fd6c){_0x4f7759=_0x43fd6c[_0xa03f('0x44')];if(!_0x1ef4dd[_0xa03f('0x3e')][_0xa03f('0x45')](_0xa03f('0x69'))){_0x4058d1[_0xa03f('0x2d')]=qs[_0xa03f('0x2d')](_0x1ef4dd['query']['limit']);_0x4058d1['offset']=qs[_0xa03f('0x2c')](_0x1ef4dd[_0xa03f('0x3e')]['offset']);}return _0x153d18[_0xa03f('0x63')](_0x4058d1);}})[_0xa03f('0x21')](function(_0x2f7563){if(_0x2f7563){return _0x2f7563?{'count':_0x4f7759,'rows':_0x2f7563}:null;}})['then'](respondWithResult(_0x495e79,null))[_0xa03f('0x50')](handleError(_0x495e79,null));};
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.events.js b/server/api/chatGroup/chatGroup.events.js
index 96ec096..4a1b6af 100644
--- a/server/api/chatGroup/chatGroup.events.js
+++ b/server/api/chatGroup/chatGroup.events.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xadb5=['update','emit','hasOwnProperty','hook','exports','../../mysqldb','setMaxListeners','save'];(function(_0x19ac6e,_0x435862){var _0x1cdcf3=function(_0x23151c){while(--_0x23151c){_0x19ac6e['push'](_0x19ac6e['shift']());}};_0x1cdcf3(++_0x435862);}(_0xadb5,0xad));var _0x5adb=function(_0x59f80b,_0x315915){_0x59f80b=_0x59f80b-0x0;var _0x3bf03f=_0xadb5[_0x59f80b];return _0x3bf03f;};'use strict';var EventEmitter=require('events');var ChatGroup=require(_0x5adb('0x0'))['db']['ChatGroup'];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x5adb('0x1')](0x0);var events={'afterCreate':_0x5adb('0x2'),'afterUpdate':_0x5adb('0x3'),'afterDestroy':'remove'};function emitEvent(_0x248dc6){return function(_0x31457,_0x2e3ef4,_0x4cb1d1){ChatGroupEvents[_0x5adb('0x4')](_0x248dc6+':'+_0x31457['id'],_0x31457);ChatGroupEvents[_0x5adb('0x4')](_0x248dc6,_0x31457);_0x4cb1d1(null);};}for(var e in events){if(events[_0x5adb('0x5')](e)){var event=events[e];ChatGroup[_0x5adb('0x6')](e,emitEvent(event));}}module[_0x5adb('0x7')]=ChatGroupEvents;
\ No newline at end of file
+var _0xb10b=['hasOwnProperty','hook','events','ChatGroup','setMaxListeners','save','remove','emit'];(function(_0xbfdd60,_0x543717){var _0x129e36=function(_0x15aba2){while(--_0x15aba2){_0xbfdd60['push'](_0xbfdd60['shift']());}};_0x129e36(++_0x543717);}(_0xb10b,0x12a));var _0xbb10=function(_0x27a591,_0x24c79b){_0x27a591=_0x27a591-0x0;var _0x2de723=_0xb10b[_0x27a591];return _0x2de723;};'use strict';var EventEmitter=require(_0xbb10('0x0'));var ChatGroup=require('../../mysqldb')['db'][_0xbb10('0x1')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0xbb10('0x2')](0x0);var events={'afterCreate':_0xbb10('0x3'),'afterUpdate':'update','afterDestroy':_0xbb10('0x4')};function emitEvent(_0x9bbed){return function(_0x460981,_0x22320e,_0x49baf4){ChatGroupEvents[_0xbb10('0x5')](_0x9bbed+':'+_0x460981['id'],_0x460981);ChatGroupEvents['emit'](_0x9bbed,_0x460981);_0x49baf4(null);};}for(var e in events){if(events[_0xbb10('0x6')](e)){var event=events[e];ChatGroup[_0xbb10('0x7')](e,emitEvent(event));}}module['exports']=ChatGroupEvents;
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.model.js b/server/api/chatGroup/chatGroup.model.js
index 1c56823..f9ba246 100644
--- a/server/api/chatGroup/chatGroup.model.js
+++ b/server/api/chatGroup/chatGroup.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x6596=['path','rimraf','exports','define','ChatGroup','lodash','util','api','moment','bluebird','request-promise'];(function(_0x4a2017,_0x531514){var _0x526dbe=function(_0x4c0517){while(--_0x4c0517){_0x4a2017['push'](_0x4a2017['shift']());}};_0x526dbe(++_0x531514);}(_0x6596,0x1d3));var _0x6659=function(_0x417dbf,_0x2029d3){_0x417dbf=_0x417dbf-0x0;var _0x18f559=_0x6596[_0x417dbf];return _0x18f559;};'use strict';var _=require(_0x6659('0x0'));var util=require(_0x6659('0x1'));var logger=require('../../config/logger')(_0x6659('0x2'));var moment=require(_0x6659('0x3'));var BPromise=require(_0x6659('0x4'));var rp=require(_0x6659('0x5'));var fs=require('fs');var path=require(_0x6659('0x6'));var rimraf=require(_0x6659('0x7'));var config=require('../../config/environment');var attributes=require('./chatGroup.attributes');module[_0x6659('0x8')]=function(_0x3091f1,_0xd6bf59){return _0x3091f1[_0x6659('0x9')](_0x6659('0xa'),attributes,{'tableName':'chat_groups','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xe944=['define','ChatGroup','chat_groups','lodash','api','request-promise','../../config/environment','./chatGroup.attributes','exports'];(function(_0x24e76f,_0x52166f){var _0x117a85=function(_0x44012a){while(--_0x44012a){_0x24e76f['push'](_0x24e76f['shift']());}};_0x117a85(++_0x52166f);}(_0xe944,0x174));var _0x4e94=function(_0x1e0a9d,_0x23581d){_0x1e0a9d=_0x1e0a9d-0x0;var _0x553a89=_0xe944[_0x1e0a9d];return _0x553a89;};'use strict';var _=require(_0x4e94('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x4e94('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x4e94('0x2'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x4e94('0x3'));var attributes=require(_0x4e94('0x4'));module[_0x4e94('0x5')]=function(_0xbb43ae,_0x4d00e5){return _0xbb43ae[_0x4e94('0x6')](_0x4e94('0x7'),attributes,{'tableName':_0x4e94('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.rpc.js b/server/api/chatGroup/chatGroup.rpc.js
index e636822..c195162 100644
--- a/server/api/chatGroup/chatGroup.rpc.js
+++ b/server/api/chatGroup/chatGroup.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xf9d0=['moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','redis','defaults','localhost','socket.io-emitter','./chatGroup.socket','request','then','info','ChatGroup,\x20%s,\x20%s','debug','request\x20sent','stringify','error','message','result','util'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0xf9d0,0xce));var _0x0f9d=function(_0x1d7101,_0x216e0d){_0x1d7101=_0x1d7101-0x0;var _0x26ec3=_0xf9d0[_0x1d7101];return _0x26ec3;};'use strict';var _=require('lodash');var util=require(_0x0f9d('0x0'));var moment=require(_0x0f9d('0x1'));var BPromise=require('bluebird');var rs=require(_0x0f9d('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0f9d('0x3'))['db'];var utils=require(_0x0f9d('0x4'));var logger=require(_0x0f9d('0x5'))('rpc');var config=require(_0x0f9d('0x6'));var jayson=require(_0x0f9d('0x7'));var client=jayson['client']['http']({'port':0x232a});config[_0x0f9d('0x8')]=_[_0x0f9d('0x9')](config['redis'],{'host':_0x0f9d('0xa'),'port':0x18eb});var socket=require(_0x0f9d('0xb'))(new Redis(config['redis']));require(_0x0f9d('0xc'))['register'](socket);function respondWithRpcPromise(_0x195d8e,_0x229160,_0x203cf3){return new BPromise(function(_0x4f5c5c,_0x3c68fd){return client[_0x0f9d('0xd')](_0x195d8e,_0x203cf3)[_0x0f9d('0xe')](function(_0x5def97){logger[_0x0f9d('0xf')](_0x0f9d('0x10'),_0x229160,'request\x20sent');logger[_0x0f9d('0x11')]('ChatGroup,\x20%s,\x20%s,\x20%s',_0x229160,_0x0f9d('0x12'),JSON[_0x0f9d('0x13')](_0x5def97));if(_0x5def97[_0x0f9d('0x14')]){if(_0x5def97[_0x0f9d('0x14')]['code']===0x1f4){logger[_0x0f9d('0x14')]('ChatGroup,\x20%s,\x20%s',_0x229160,_0x5def97[_0x0f9d('0x14')][_0x0f9d('0x15')]);return _0x3c68fd(_0x5def97[_0x0f9d('0x14')][_0x0f9d('0x15')]);}logger[_0x0f9d('0x14')]('ChatGroup,\x20%s,\x20%s',_0x229160,_0x5def97[_0x0f9d('0x14')][_0x0f9d('0x15')]);return _0x4f5c5c(_0x5def97[_0x0f9d('0x14')]['message']);}else{logger['info'](_0x0f9d('0x10'),_0x229160,_0x0f9d('0x12'));_0x4f5c5c(_0x5def97[_0x0f9d('0x16')][_0x0f9d('0x15')]);}})['catch'](function(_0x198cbd){logger['error'](_0x0f9d('0x10'),_0x229160,_0x198cbd);_0x3c68fd(_0x198cbd);});});}
\ No newline at end of file
+var _0xedee=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','defaults','redis','localhost','socket.io-emitter','./chatGroup.socket','register','then','info','request\x20sent','debug','ChatGroup,\x20%s,\x20%s,\x20%s','stringify','error','ChatGroup,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird'];(function(_0x43c8b7,_0x114978){var _0x34c10e=function(_0x4a8f55){while(--_0x4a8f55){_0x43c8b7['push'](_0x43c8b7['shift']());}};_0x34c10e(++_0x114978);}(_0xedee,0x114));var _0xeede=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0xedee[_0xfae23b];return _0x200640;};'use strict';var _=require(_0xeede('0x0'));var util=require(_0xeede('0x1'));var moment=require(_0xeede('0x2'));var BPromise=require(_0xeede('0x3'));var rs=require(_0xeede('0x4'));var fs=require('fs');var Redis=require(_0xeede('0x5'));var db=require(_0xeede('0x6'))['db'];var utils=require(_0xeede('0x7'));var logger=require(_0xeede('0x8'))(_0xeede('0x9'));var config=require(_0xeede('0xa'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});config['redis']=_[_0xeede('0xb')](config[_0xeede('0xc')],{'host':_0xeede('0xd'),'port':0x18eb});var socket=require(_0xeede('0xe'))(new Redis(config[_0xeede('0xc')]));require(_0xeede('0xf'))[_0xeede('0x10')](socket);function respondWithRpcPromise(_0x1934d0,_0x522d22,_0x5cc5cc){return new BPromise(function(_0x74ad87,_0x4c8b92){return client['request'](_0x1934d0,_0x5cc5cc)[_0xeede('0x11')](function(_0x1d5f80){logger[_0xeede('0x12')]('ChatGroup,\x20%s,\x20%s',_0x522d22,_0xeede('0x13'));logger[_0xeede('0x14')](_0xeede('0x15'),_0x522d22,_0xeede('0x13'),JSON[_0xeede('0x16')](_0x1d5f80));if(_0x1d5f80[_0xeede('0x17')]){if(_0x1d5f80['error']['code']===0x1f4){logger[_0xeede('0x17')](_0xeede('0x18'),_0x522d22,_0x1d5f80[_0xeede('0x17')][_0xeede('0x19')]);return _0x4c8b92(_0x1d5f80[_0xeede('0x17')][_0xeede('0x19')]);}logger[_0xeede('0x17')](_0xeede('0x18'),_0x522d22,_0x1d5f80['error'][_0xeede('0x19')]);return _0x74ad87(_0x1d5f80['error'][_0xeede('0x19')]);}else{logger[_0xeede('0x12')](_0xeede('0x18'),_0x522d22,_0xeede('0x13'));_0x74ad87(_0x1d5f80[_0xeede('0x1a')][_0xeede('0x19')]);}})[_0xeede('0x1b')](function(_0x2891f1){logger[_0xeede('0x17')](_0xeede('0x18'),_0x522d22,_0x2891f1);_0x4c8b92(_0x2891f1);});});}
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.socket.js b/server/api/chatGroup/chatGroup.socket.js
index 5753fd1..bc28959 100644
--- a/server/api/chatGroup/chatGroup.socket.js
+++ b/server/api/chatGroup/chatGroup.socket.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x146c=['update','removeListener','length','chatGroup:','./chatGroup.events','save','remove'];(function(_0x4cf98e,_0xba4b79){var _0x1623ac=function(_0x459bc0){while(--_0x459bc0){_0x4cf98e['push'](_0x4cf98e['shift']());}};_0x1623ac(++_0xba4b79);}(_0x146c,0x74));var _0xc146=function(_0x151c46,_0x26658a){_0x151c46=_0x151c46-0x0;var _0x323f1a=_0x146c[_0x151c46];return _0x323f1a;};'use strict';var ChatGroupEvents=require(_0xc146('0x0'));var events=[_0xc146('0x1'),_0xc146('0x2'),_0xc146('0x3')];function createListener(_0x216d5c,_0x509bc5){return function(_0x7cc448){_0x509bc5['emit'](_0x216d5c,_0x7cc448);};}function removeListener(_0xdb739d,_0x9dff0){return function(){ChatGroupEvents[_0xc146('0x4')](_0xdb739d,_0x9dff0);};}exports['register']=function(_0x31b2f1){for(var _0x5e73c6=0x0,_0x5eb9bc=events[_0xc146('0x5')];_0x5e73c6<_0x5eb9bc;_0x5e73c6++){var _0x4a7f78=events[_0x5e73c6];var _0x305ec6=createListener(_0xc146('0x6')+_0x4a7f78,_0x31b2f1);ChatGroupEvents['on'](_0x4a7f78,_0x305ec6);}};
\ No newline at end of file
+var _0x5704=['save','remove','update','removeListener','register','chatGroup:'];(function(_0x3392d2,_0x582611){var _0xa4843e=function(_0x5c179a){while(--_0x5c179a){_0x3392d2['push'](_0x3392d2['shift']());}};_0xa4843e(++_0x582611);}(_0x5704,0x1ce));var _0x4570=function(_0x19f28e,_0x479808){_0x19f28e=_0x19f28e-0x0;var _0x5b609a=_0x5704[_0x19f28e];return _0x5b609a;};'use strict';var ChatGroupEvents=require('./chatGroup.events');var events=[_0x4570('0x0'),_0x4570('0x1'),_0x4570('0x2')];function createListener(_0x279d2e,_0x1d3c8b){return function(_0x3c6379){_0x1d3c8b['emit'](_0x279d2e,_0x3c6379);};}function removeListener(_0x47775b,_0x1ef90b){return function(){ChatGroupEvents[_0x4570('0x3')](_0x47775b,_0x1ef90b);};}exports[_0x4570('0x4')]=function(_0x590ba7){for(var _0x41b934=0x0,_0x9c63c7=events['length'];_0x41b934<_0x9c63c7;_0x41b934++){var _0x4b8d0f=events[_0x41b934];var _0x539b0d=createListener(_0x4570('0x5')+_0x4b8d0f,_0x590ba7);ChatGroupEvents['on'](_0x4b8d0f,_0x539b0d);}};
\ No newline at end of file
diff --git a/server/api/chatGroup/index.js b/server/api/chatGroup/index.js
index 3648f7d..afb574f 100644
--- a/server/api/chatGroup/index.js
+++ b/server/api/chatGroup/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x4068=['removeMembers','exports','multer','util','path','express','Router','../../components/auth/service','../../config/environment','./chatGroup.controller','get','isAuthenticated','index','/describe','/:id','show','/:id/unread','getUnread','/:id/members','getMembers','/:id/messages','getMessages','post','create','addMembers','put','delete','destroy'];(function(_0x59db90,_0x2a7e72){var _0x42e49f=function(_0x3a5d0e){while(--_0x3a5d0e){_0x59db90['push'](_0x59db90['shift']());}};_0x42e49f(++_0x2a7e72);}(_0x4068,0xe2));var _0x8406=function(_0x38306e,_0x32a157){_0x38306e=_0x38306e-0x0;var _0x58fddf=_0x4068[_0x38306e];return _0x58fddf;};'use strict';var multer=require(_0x8406('0x0'));var util=require(_0x8406('0x1'));var path=require(_0x8406('0x2'));var timeout=require('connect-timeout');var express=require(_0x8406('0x3'));var router=express[_0x8406('0x4')]();var auth=require(_0x8406('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x8406('0x6'));var controller=require(_0x8406('0x7'));router[_0x8406('0x8')]('/',auth[_0x8406('0x9')](),controller[_0x8406('0xa')]);router[_0x8406('0x8')](_0x8406('0xb'),auth[_0x8406('0x9')](),controller['describe']);router[_0x8406('0x8')](_0x8406('0xc'),auth[_0x8406('0x9')](),controller[_0x8406('0xd')]);router[_0x8406('0x8')](_0x8406('0xe'),auth[_0x8406('0x9')](),controller[_0x8406('0xf')]);router[_0x8406('0x8')](_0x8406('0x10'),auth['isAuthenticated'](),controller[_0x8406('0x11')]);router[_0x8406('0x8')](_0x8406('0x12'),auth[_0x8406('0x9')](),controller[_0x8406('0x13')]);router[_0x8406('0x14')]('/',auth[_0x8406('0x9')](),controller[_0x8406('0x15')]);router[_0x8406('0x14')](_0x8406('0x10'),auth['isAuthenticated'](),controller[_0x8406('0x16')]);router[_0x8406('0x14')](_0x8406('0x12'),auth[_0x8406('0x9')](),controller['addMessage']);router[_0x8406('0x17')](_0x8406('0xc'),auth[_0x8406('0x9')](),controller['update']);router[_0x8406('0x18')](_0x8406('0xc'),auth[_0x8406('0x9')](),controller[_0x8406('0x19')]);router['delete'](_0x8406('0x10'),auth['isAuthenticated'](),controller[_0x8406('0x1a')]);module[_0x8406('0x1b')]=router;
\ No newline at end of file
+var _0x79b0=['/:id/unread','getUnread','/:id/members','getMembers','/:id/messages','getMessages','post','create','addMembers','addMessage','put','update','delete','destroy','removeMembers','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatGroup.controller','get','isAuthenticated','index','/describe','/:id'];(function(_0x37eef2,_0x5940ef){var _0x528b68=function(_0x3c7059){while(--_0x3c7059){_0x37eef2['push'](_0x37eef2['shift']());}};_0x528b68(++_0x5940ef);}(_0x79b0,0x100));var _0x079b=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x79b0[_0x1facfa];return _0x9ec701;};'use strict';var multer=require('multer');var util=require(_0x079b('0x0'));var path=require(_0x079b('0x1'));var timeout=require(_0x079b('0x2'));var express=require(_0x079b('0x3'));var router=express[_0x079b('0x4')]();var auth=require(_0x079b('0x5'));var interaction=require(_0x079b('0x6'));var config=require(_0x079b('0x7'));var controller=require(_0x079b('0x8'));router[_0x079b('0x9')]('/',auth[_0x079b('0xa')](),controller[_0x079b('0xb')]);router[_0x079b('0x9')](_0x079b('0xc'),auth[_0x079b('0xa')](),controller['describe']);router['get'](_0x079b('0xd'),auth[_0x079b('0xa')](),controller['show']);router[_0x079b('0x9')](_0x079b('0xe'),auth[_0x079b('0xa')](),controller[_0x079b('0xf')]);router['get'](_0x079b('0x10'),auth['isAuthenticated'](),controller[_0x079b('0x11')]);router[_0x079b('0x9')](_0x079b('0x12'),auth[_0x079b('0xa')](),controller[_0x079b('0x13')]);router[_0x079b('0x14')]('/',auth[_0x079b('0xa')](),controller[_0x079b('0x15')]);router['post'](_0x079b('0x10'),auth[_0x079b('0xa')](),controller[_0x079b('0x16')]);router[_0x079b('0x14')]('/:id/messages',auth[_0x079b('0xa')](),controller[_0x079b('0x17')]);router[_0x079b('0x18')](_0x079b('0xd'),auth[_0x079b('0xa')](),controller[_0x079b('0x19')]);router[_0x079b('0x1a')](_0x079b('0xd'),auth[_0x079b('0xa')](),controller[_0x079b('0x1b')]);router[_0x079b('0x1a')](_0x079b('0x10'),auth[_0x079b('0xa')](),controller[_0x079b('0x1c')]);module[_0x079b('0x1d')]=router;
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.attributes.js b/server/api/chatInteraction/chatInteraction.attributes.js
index 785fa77..ef65f98 100644
--- a/server/api/chatInteraction/chatInteraction.attributes.js
+++ b/server/api/chatInteraction/chatInteraction.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x277d=['INTEGER','star','TEXT','STRING','DATE','long','ENUM','exports','BOOLEAN'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x277d,0x166));var _0xd277=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0x277d[_0x2c91e9];return _0x13f0ff;};'use strict';var Sequelize=require('sequelize');module[_0xd277('0x0')]={'closed':{'type':Sequelize[_0xd277('0x1')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0xd277('0x2')]},'ratingType':{'type':Sequelize['ENUM'](_0xd277('0x3'),'thumb'),'defaultValue':_0xd277('0x3')},'ratingMessage':{'type':Sequelize['TEXT']},'pathTranscript':{'type':Sequelize[_0xd277('0x4')]},'mailTranscript':{'type':Sequelize[_0xd277('0x5')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0xd277('0x6')]},'disposition':{'type':Sequelize[_0xd277('0x5')]},'note':{'type':Sequelize[_0xd277('0x5')]},'browserName':{'type':Sequelize[_0xd277('0x5')]},'browserVersion':{'type':Sequelize[_0xd277('0x5')]},'osName':{'type':Sequelize['STRING']},'osVersion':{'type':Sequelize['STRING']},'deviceModel':{'type':Sequelize[_0xd277('0x5')]},'deviceVendor':{'type':Sequelize[_0xd277('0x5')]},'deviceType':{'type':Sequelize[_0xd277('0x5')]},'referer':{'type':Sequelize[_0xd277('0x4')]},'customerIp':{'type':Sequelize['STRING']},'formData':{'type':Sequelize[_0xd277('0x4')](_0xd277('0x7'))},'read1stAt':{'type':Sequelize['DATE']},'lastMsgAt':{'type':Sequelize[_0xd277('0x6')]},'lastMsgDirection':{'type':Sequelize[_0xd277('0x8')]('in','out'),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0xd277('0x5')]},'customerPort':{'type':Sequelize['STRING']},'vidaooSessionId':{'type':Sequelize[_0xd277('0x4')]}};
\ No newline at end of file
+var _0xa92c=['INTEGER','star','thumb','TEXT','STRING','DATE','long','out','sequelize','exports','BOOLEAN'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa92c,0x1e1));var _0xca92=function(_0x31eb67,_0x9bc8c0){_0x31eb67=_0x31eb67-0x0;var _0x2a8cb8=_0xa92c[_0x31eb67];return _0x2a8cb8;};'use strict';var Sequelize=require(_0xca92('0x0'));module[_0xca92('0x1')]={'closed':{'type':Sequelize[_0xca92('0x2')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0xca92('0x3')]},'ratingType':{'type':Sequelize['ENUM'](_0xca92('0x4'),_0xca92('0x5')),'defaultValue':_0xca92('0x4')},'ratingMessage':{'type':Sequelize['TEXT']},'pathTranscript':{'type':Sequelize[_0xca92('0x6')]},'mailTranscript':{'type':Sequelize[_0xca92('0x7')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0xca92('0x8')]},'disposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0xca92('0x7')]},'browserName':{'type':Sequelize['STRING']},'browserVersion':{'type':Sequelize[_0xca92('0x7')]},'osName':{'type':Sequelize[_0xca92('0x7')]},'osVersion':{'type':Sequelize['STRING']},'deviceModel':{'type':Sequelize[_0xca92('0x7')]},'deviceVendor':{'type':Sequelize[_0xca92('0x7')]},'deviceType':{'type':Sequelize[_0xca92('0x7')]},'referer':{'type':Sequelize['TEXT']},'customerIp':{'type':Sequelize[_0xca92('0x7')]},'formData':{'type':Sequelize['TEXT'](_0xca92('0x9'))},'read1stAt':{'type':Sequelize[_0xca92('0x8')]},'lastMsgAt':{'type':Sequelize[_0xca92('0x8')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0xca92('0xa')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0xca92('0x7')]},'customerPort':{'type':Sequelize[_0xca92('0x7')]},'vidaooSessionId':{'type':Sequelize[_0xca92('0x6')]}};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.controller.js b/server/api/chatInteraction/chatInteraction.controller.js
index a827358..9ab85a5 100644
--- a/server/api/chatInteraction/chatInteraction.controller.js
+++ b/server/api/chatInteraction/chatInteraction.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x1967=['service','host','port','secure','authentication','auth','pass','SendMail','sendMail','\x22%s\x22\x20<%s>','email','mailTranscript','Mail\x20Transcript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','omit','ids','getMessages','hasOwnProperty','$gte','YYYY-MM-DD\x20HH:mm:ss','options','findAll','getMyMessages','secret','includeAgent','include','setTags','spread','emit','chatInteractionTags:save','removeTags','unix','server','files','attachments','transcript-%d-%s.zip','Contact','firstName','Account','Owner','get','mkdirSync','40px','30px','YYYY-MM-DD','Chat','N.A.','closedAt','osName','customerIp','customerPort','tail','existsSync','createReadStream','pipe','createWriteStream','lastName','renderFile','views','downloadInteraction.html','toFile','transcript-','.pdf','log','err','unlinkSync','sendStatus','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatInteraction.socket','register','jayson/promise','client','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','error','ChatInteraction,\x20%s,\x20%s','message','info','catch','status','json','count','offset','limit','set','Content-Range','save','then','end','stack','name','send','Users','fullname','TagIds','split','forEach','push','ChatInteraction','rawAttributes','fieldName','query','filters','intersection','model','attributes','fields','length','nolimit','sort','where','pick','select','field','from','tools_tags','u.id','u.fullname','user_has_chat_interactions','left_join','users','chat_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','a.id\x20=\x20i.ChatWebsiteId','chat_messages','it.ChatInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','search','parseSearch','sqlOperator','conditions','unreadMessages','value','having','`\x20=\x200','`\x20>\x200','operator','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','find','ContactId','buildExpression','text','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','type','keys','map','some','compact','isEmpty','ChatWebsiteId','i.ChatWebsiteId\x20IN\x20?','concat','parse','null','\x20IS\x20NULL','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','filter','replace','isNumeric','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','i.id','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','order','DESC','t.id\x20IN\x20?','resolve','i.ChatWebsiteId\x20IS\x20NOT\x20NULL','sequelize','toString','keyBy','merge','a.key','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','c.firstName','Contact.firstName','c.email','Contact.email','c.phone','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','o.internal','ui.ChatInteractionId\x20IN\x20?','groupBy','ChatInteractionId','all','rows','show','params','includeAll','create','body','update','destroy','describe','createVidaooSession','findOne','ChatWebsite','vidaooApiKey','vidaooEscalation','POST','https://api-vidaoo.xcally.com/api/v1/sessions','follow','Error\x20in\x20Vidaoo\x20configuration','out','user','ChatMessage','updateAttributes','customUpdate','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','Interaction\x20already\x20assigned','closed','disposition','AbandonInteraction','attachmentUpload','file','originalname','filename','mimetype','Attachment','attachmentDownload','Unauthorized','attachId','download','join','root','basename','close','server/files/chat/upload/','transcript-%s.txt','pathTranscript','Messages','CmContact','%s%d','agentAlias','System','customer','format','Visitor','website_alias','alias','createdAt','MM/DD/YYYY\x20HH:mm:ss','direction','appendFileSync','MailAccount','MailServerOut','Smtp'];(function(_0x2b9120,_0x4cba82){var _0x459db0=function(_0x5753b5){while(--_0x5753b5){_0x2b9120['push'](_0x2b9120['shift']());}};_0x459db0(++_0x4cba82);}(_0x1967,0x173));var _0x7196=function(_0x431b8e,_0x5025ed){_0x431b8e=_0x431b8e-0x0;var _0x4a5cea=_0x1967[_0x431b8e];return _0x4a5cea;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x7196('0x0'));var rimraf=require(_0x7196('0x1'));var zipdir=require(_0x7196('0x2'));var jsonpatch=require(_0x7196('0x3'));var rp=require(_0x7196('0x4'));var moment=require(_0x7196('0x5'));var BPromise=require(_0x7196('0x6'));var Mustache=require(_0x7196('0x7'));var util=require(_0x7196('0x8'));var path=require(_0x7196('0x9'));var sox=require('sox');var csv=require(_0x7196('0xa'));var ejs=require(_0x7196('0xb'));var fs=require('fs');var _=require(_0x7196('0xc'));var squel=require(_0x7196('0xd'));var crypto=require(_0x7196('0xe'));var jsforce=require(_0x7196('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x7196('0xa'));var querystring=require(_0x7196('0x10'));var Papa=require(_0x7196('0x11'));var Redis=require(_0x7196('0x12'));var authService=require(_0x7196('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7196('0x14'));var logger=require(_0x7196('0x15'))(_0x7196('0x16'));var utils=require(_0x7196('0x17'));var config=require(_0x7196('0x18'));var db=require(_0x7196('0x19'))['db'];config[_0x7196('0x1a')]=_[_0x7196('0x1b')](config[_0x7196('0x1a')],{'host':_0x7196('0x1c'),'port':0x18eb});var socket=require(_0x7196('0x1d'))(new Redis(config['redis']));require(_0x7196('0x1e'))[_0x7196('0x1f')](socket);var jayson=require(_0x7196('0x20'));var client=jayson[_0x7196('0x21')]['http']({'port':0x232b});var client9004=jayson[_0x7196('0x21')]['http']({'port':0x232c});function checkPasswordPattern(_0xe32933,_0x2590a6,_0xf7e97){if(_0xf7e97){var _0x3ed1ad=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x3ed1ad[_0x7196('0x22')](_0x2590a6)){return _0xe32933;}else{throw new db[(_0x7196('0x23'))][(_0x7196('0x24'))](_0x7196('0x25'));}}else{return _0xe32933;}}function respondWithRpcPromise(_0x3e4e69,_0x32fe2b,_0x385f2d,_0x5b716a){return new BPromise(function(_0x4c4f91,_0x448f13){var _0x26b447=_0x5b716a||client;return _0x26b447[_0x7196('0x26')](_0x3e4e69,_0x385f2d)['then'](function(_0x39b944){logger['info']('ChatInteraction,\x20%s,\x20%s',_0x32fe2b,_0x7196('0x27'));logger[_0x7196('0x28')](_0x7196('0x29'),_0x32fe2b,'request\x20sent',JSON['stringify'](_0x39b944));if(_0x39b944[_0x7196('0x2a')]){if(_0x39b944[_0x7196('0x2a')]['code']===0x1f4){logger[_0x7196('0x2a')](_0x7196('0x2b'),_0x32fe2b,_0x39b944[_0x7196('0x2a')][_0x7196('0x2c')]);return _0x448f13(_0x39b944[_0x7196('0x2a')]['message']);}logger[_0x7196('0x2a')]('ChatInteraction,\x20%s,\x20%s',_0x32fe2b,_0x39b944[_0x7196('0x2a')][_0x7196('0x2c')]);return _0x4c4f91(_0x39b944[_0x7196('0x2a')][_0x7196('0x2c')]);}else{logger[_0x7196('0x2d')](_0x7196('0x2b'),_0x32fe2b,'request\x20sent');_0x4c4f91(_0x39b944['result'][_0x7196('0x2c')]);}})[_0x7196('0x2e')](function(_0x184c09){logger['error']('ChatInteraction,\x20%s,\x20%s',_0x32fe2b,_0x184c09);_0x448f13(_0x184c09);});});}function respondWithStatusCode(_0x41cfd2,_0x162cfc){_0x162cfc=_0x162cfc||0xcc;return function(_0x675e64){if(_0x675e64){return _0x41cfd2['sendStatus'](_0x162cfc);}return _0x41cfd2[_0x7196('0x2f')](_0x162cfc)['end']();};}function respondWithResult(_0x4fd339,_0x59d79d){_0x59d79d=_0x59d79d||0xc8;return function(_0x30151f){if(_0x30151f){return _0x4fd339[_0x7196('0x2f')](_0x59d79d)[_0x7196('0x30')](_0x30151f);}};}function respondWithFilteredResult(_0x4f02b1,_0x35116f){return function(_0x45d567){if(_0x45d567){var _0x2f9583=_0x45d567[_0x7196('0x31')],_0xf999e9=_0x35116f[_0x7196('0x32')],_0x50c386=_0x35116f[_0x7196('0x32')]+_0x35116f[_0x7196('0x33')],_0x39710d;if(_0x50c386>=_0x2f9583){_0x50c386=_0x2f9583;_0x39710d=0xc8;}else{_0x39710d=0xce;}_0x4f02b1[_0x7196('0x2f')](_0x39710d);return _0x4f02b1[_0x7196('0x34')](_0x7196('0x35'),_0xf999e9+'-'+_0x50c386+'/'+_0x2f9583)[_0x7196('0x30')](_0x45d567);}return null;};}function patchUpdates(_0xf33b59){return function(_0x1ff4b4){try{jsonpatch['apply'](_0x1ff4b4,_0xf33b59,!![]);}catch(_0xdf8aa){return BPromise['reject'](_0xdf8aa);}return _0x1ff4b4[_0x7196('0x36')]();};}function saveUpdates(_0x4c3365,_0x372ddc){return function(_0x25fa11){if(_0x25fa11){return _0x25fa11['update'](_0x4c3365)[_0x7196('0x37')](function(_0x2bcadd){return _0x2bcadd;});}return null;};}function removeEntity(_0x4531d7,_0x3a56b4){return function(_0x7547cf){if(_0x7547cf){return _0x7547cf['destroy']()[_0x7196('0x37')](function(){_0x4531d7[_0x7196('0x2f')](0xcc)[_0x7196('0x38')]();});}};}function handleEntityNotFound(_0xf2b652,_0x3e8f98){return function(_0x123cad){if(!_0x123cad){_0xf2b652['sendStatus'](0x194);}return _0x123cad;};}function handleError(_0x23d7aa,_0xe04e44){_0xe04e44=_0xe04e44||0x1f4;return function(_0x191df2){logger['error'](_0x191df2[_0x7196('0x39')]);if(_0x191df2[_0x7196('0x3a')]){delete _0x191df2[_0x7196('0x3a')];}_0x23d7aa[_0x7196('0x2f')](_0xe04e44)[_0x7196('0x3b')](_0x191df2);};}function getInteractionUsers(_0x31fca7,_0x938e49){return new BPromise(function(_0x1ab720,_0x92cfb1){try{if(_0x938e49[_0x31fca7['id']]){_0x31fca7[_0x7196('0x3c')]=_['map'](_0x938e49[_0x31fca7['id']],function(_0x257754){return{'id':_0x257754['id'],'fullname':_0x257754[_0x7196('0x3d')]};});}}catch(_0x4c411b){_0x92cfb1(_0x4c411b);}_0x1ab720(_0x31fca7);});}function getInteractionTags(_0x186efe,_0x54767f){return new BPromise(function(_0x5bd701,_0x301c42){try{if(_0x186efe[_0x7196('0x3e')]){_0x186efe['Tags']=[];_0x186efe['TagIds'][_0x7196('0x3f')](',')[_0x7196('0x40')](function(_0xed32cd){_0x186efe['Tags'][_0x7196('0x41')](_0x54767f[_0xed32cd]);});}delete _0x186efe[_0x7196('0x3e')];}catch(_0x29ba1c){_0x301c42(_0x29ba1c);}_0x5bd701(_0x186efe);});}function updateChatInteraction(_0x29c58d,_0x16da09,_0x428d76){return new BPromise(function(_0xc94d24,_0x440077){return getInteractionUsers(_0x29c58d,_0x428d76)['then'](function(_0x89c8ea){return getInteractionTags(_0x89c8ea,_0x16da09);})[_0x7196('0x37')](function(_0x4f8b4a){_0xc94d24(_0x4f8b4a);})[_0x7196('0x2e')](function(_0x43d4c0){_0x440077(_0x43d4c0);});});}exports['index']=function(_0x471915,_0x471bb2){var _0x3b78c8={},_0x5749e2={},_0x455fea={'count':0x0,'rows':[]};var _0x4713d3=_['map'](db[_0x7196('0x42')][_0x7196('0x43')],function(_0x4f0c6c){return{'name':_0x4f0c6c[_0x7196('0x44')],'type':_0x4f0c6c['type']['key']};});_0x5749e2['model']=_['map'](_0x4713d3,'name');_0x5749e2[_0x7196('0x45')]=_['keys'](_0x471915[_0x7196('0x45')]);_0x5749e2[_0x7196('0x46')]=_[_0x7196('0x47')](_0x5749e2[_0x7196('0x48')],_0x5749e2['query']);_0x3b78c8[_0x7196('0x49')]=_['intersection'](_0x5749e2[_0x7196('0x48')],qs[_0x7196('0x4a')](_0x471915[_0x7196('0x45')]['fields']));_0x3b78c8[_0x7196('0x49')]=_0x3b78c8[_0x7196('0x49')][_0x7196('0x4b')]?_0x3b78c8['attributes']:_0x5749e2['model'];if(!_0x471915[_0x7196('0x45')]['hasOwnProperty'](_0x7196('0x4c'))){_0x3b78c8['limit']=qs['limit'](_0x471915[_0x7196('0x45')]['limit']);_0x3b78c8['offset']=qs['offset'](_0x471915[_0x7196('0x45')]['offset']);}_0x3b78c8['order']=qs[_0x7196('0x4d')](_0x471915[_0x7196('0x45')][_0x7196('0x4d')]);_0x3b78c8[_0x7196('0x4e')]=qs['filters'](_[_0x7196('0x4f')](_0x471915['query'],_0x5749e2[_0x7196('0x46')]),_0x4713d3);var _0x143c58=[];var _0x513855=squel[_0x7196('0x50')]()[_0x7196('0x51')]('id')[_0x7196('0x51')]('name')[_0x7196('0x51')]('color')[_0x7196('0x52')](_0x7196('0x53'));var _0x179815=squel[_0x7196('0x50')]()[_0x7196('0x51')](_0x7196('0x54'))[_0x7196('0x51')](_0x7196('0x55'))['field']('ui.ChatInteractionId')[_0x7196('0x52')](_0x7196('0x56'),'ui')[_0x7196('0x57')](_0x7196('0x58'),'u','u.id\x20=\x20ui.UserId');var _0x76b189=squel[_0x7196('0x50')]()[_0x7196('0x52')](_0x7196('0x59'),'i')[_0x7196('0x57')](_0x7196('0x5a'),'c',_0x7196('0x5b'))[_0x7196('0x57')](_0x7196('0x58'),'o',_0x7196('0x5c'))[_0x7196('0x57')]('chat_websites','a',_0x7196('0x5d'))[_0x7196('0x57')](_0x7196('0x5e'),'me','me.ChatInteractionId\x20=\x20i.id')[_0x7196('0x57')]('chat_interaction_has_tags','it',_0x7196('0x5f'))[_0x7196('0x57')](_0x7196('0x53'),'t',_0x7196('0x60'));var _0x469bac=squel['expr']();var _0x3ece9f=[];var _0x5b77fc=squel['expr']();var _0x5b9824;if(_0x471915[_0x7196('0x45')][_0x7196('0x61')]){_0x5b9824=as[_0x7196('0x62')](_0x471915[_0x7196('0x45')][_0x7196('0x61')]);var _0x41fa94=_0x5b9824[_0x7196('0x63')];for(var _0x560ddb=0x0;_0x560ddb<_0x5b9824[_0x7196('0x64')][_0x7196('0x4b')];_0x560ddb++){var _0x2d14f4=_0x5b9824[_0x7196('0x64')][_0x560ddb];var _0x196f12='i';var _0x5ef1eb=_['find'](_0x4713d3,[_0x7196('0x3a'),_0x2d14f4[_0x7196('0x51')]]);if(!_0x5ef1eb){switch(_0x2d14f4[_0x7196('0x51')]){case _0x7196('0x65'):if(_0x2d14f4[_0x7196('0x66')]==0x1){_0x76b189[_0x7196('0x67')]('`'+_0x2d14f4[_0x7196('0x51')]+_0x7196('0x68'));}else{_0x76b189[_0x7196('0x67')]('`'+_0x2d14f4[_0x7196('0x51')]+_0x7196('0x69'));}break;case'Contact':if(_0x2d14f4[_0x7196('0x6a')]===_0x7196('0x6b')){if(_0x2d14f4[_0x7196('0x66')][_0x7196('0x3f')]('\x20')['length']>0x1){_0x469bac[_0x41fa94](_0x7196('0x6c'),qs[_0x7196('0x6d')](_0x2d14f4[_0x7196('0x66')]),null);}else{var _0x38d0a0='%'+_0x2d14f4[_0x7196('0x66')]+'%';_0x469bac[_0x41fa94](_0x7196('0x6e'),_0x38d0a0,_0x38d0a0,_0x38d0a0);}}else{_0x5ef1eb=_[_0x7196('0x6f')](_0x4713d3,['name',_0x7196('0x70')]);_0x2d14f4[_0x7196('0x51')]=_0x7196('0x70');_0x74fa58=as[_0x7196('0x71')](_0x196f12,_0x5ef1eb['type'],_0x2d14f4);_0x469bac[_0x41fa94](_0x74fa58[_0x7196('0x72')],_0x74fa58[_0x7196('0x66')][_0x7196('0x73')],_0x74fa58[_0x7196('0x66')][_0x7196('0x38')]);}break;case _0x7196('0x74'):var _0x57065=_0x2d14f4['value']['split'](',')['map'](function(_0x72f6f1){return Number(_0x72f6f1);});_0x57065['forEach'](function(_0xd94bd1){_0x5b77fc['or'](_0x7196('0x75'),'%,'+_0xd94bd1+',%');});_0x3ece9f=_[_0x7196('0x76')](_0x3ece9f,_0x57065);break;case _0x7196('0x77'):if(_0x2d14f4[_0x7196('0x6a')]===_0x7196('0x6b')){_0x469bac[_0x41fa94](_0x7196('0x78'),'%'+_0x2d14f4[_0x7196('0x66')]+'%',null);}else{_0x5ef1eb=_[_0x7196('0x6f')](_0x4713d3,['name','UserId']);_0x2d14f4[_0x7196('0x51')]=_0x7196('0x79');_0x74fa58=as[_0x7196('0x71')](_0x196f12,_0x5ef1eb[_0x7196('0x7a')],_0x2d14f4);_0x469bac[_0x41fa94](_0x74fa58[_0x7196('0x72')],_0x74fa58[_0x7196('0x66')][_0x7196('0x73')],_0x74fa58[_0x7196('0x66')]['end']);}break;case'body':_0x74fa58=as[_0x7196('0x71')]('me',null,_0x2d14f4);_0x469bac[_0x41fa94](_0x74fa58['text'],_0x74fa58[_0x7196('0x66')]['start'],_0x74fa58[_0x7196('0x66')][_0x7196('0x38')]);break;}}else{var _0x74fa58=as[_0x7196('0x71')](_0x196f12,_0x5ef1eb['type'],_0x2d14f4);_0x469bac[_0x41fa94](_0x74fa58['text'],_0x74fa58[_0x7196('0x66')]['start'],_0x74fa58[_0x7196('0x66')][_0x7196('0x38')]);}}}else{var _0x4526e8=_(_0x471915[_0x7196('0x45')])[_0x7196('0x7b')]()[_0x7196('0x7c')](function(_0x4bb3e1){return _[_0x7196('0x7d')](_0x4713d3,[_0x7196('0x3a'),_0x4bb3e1])?_0x4bb3e1:undefined;})[_0x7196('0x7e')]()[_0x7196('0x66')]();if(!_[_0x7196('0x7f')](_0x4526e8)){_0x4526e8[_0x7196('0x40')](function(_0x187ad4){if(_0x187ad4===_0x7196('0x80')){_0x76b189[_0x7196('0x4e')](_0x7196('0x81'),[][_0x7196('0x82')](_0x471915[_0x7196('0x45')][_0x187ad4]));}else if(_0x187ad4==='createdAt'){var _0x431415=JSON[_0x7196('0x83')](_0x471915['query'][_0x187ad4])['$gte'];var _0x2a98c6=JSON[_0x7196('0x83')](_0x471915[_0x7196('0x45')][_0x187ad4])['$lte'];_0x76b189[_0x7196('0x4e')]('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x431415,_0x2a98c6);}else{if(_0x471915[_0x7196('0x45')][_0x187ad4]===_0x7196('0x84')){_0x76b189['where']('i.'+_0x187ad4+_0x7196('0x85'));}else{_0x76b189['where']('i.'+_0x187ad4+'\x20=\x20?',_0x471915[_0x7196('0x45')][_0x187ad4]);}}});}if(_0x471915[_0x7196('0x45')][_0x7196('0x86')]){if(_0x471915['query'][_0x7196('0x86')]==0x1){_0x76b189['having'](_0x7196('0x87'));}else{_0x76b189[_0x7196('0x67')](_0x7196('0x88'));}}if(_0x471915[_0x7196('0x45')][_0x7196('0x89')]){_0x3ece9f=_['isArray'](_0x471915[_0x7196('0x45')][_0x7196('0x89')])?_0x471915[_0x7196('0x45')][_0x7196('0x89')]:new Array(_0x471915[_0x7196('0x45')][_0x7196('0x89')]);_0x3ece9f[_0x7196('0x40')](function(_0x34633a){_0x5b77fc['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x34633a+',%');});}if(_0x471915[_0x7196('0x45')][_0x7196('0x8a')]){var _0x28a29d=_0x471915[_0x7196('0x45')]['filter'][_0x7196('0x8b')]('\x5c','\x5c\x5c')[_0x7196('0x8b')]('\x27\x27','\x27\x27\x27\x27');if(qs[_0x7196('0x8c')](_0x28a29d)){_0x469bac['or']('i.id\x20LIKE\x20?',_0x28a29d+'%');}else{_0x469bac['or'](_0x7196('0x8d'),qs['getFullTextValue'](_0x28a29d))['or'](_0x7196('0x8e'),_0x28a29d+'%');}}}_0x76b189[_0x7196('0x4e')](_0x469bac);_0x76b189['group'](_0x7196('0x8f'));var _0x2b52c0={'type':db[_0x7196('0x23')]['QueryTypes']['SELECT'],'raw':!![]};var _0x1c5a41=_0x76b189['clone']();_0x1c5a41['field'](_0x7196('0x8f'));_0x1c5a41[_0x7196('0x51')](_0x7196('0x90'),'unreadMessages');if(_0x3b78c8[_0x7196('0x91')]){_0x3b78c8[_0x7196('0x91')][_0x7196('0x40')](function(_0x175dd8){_0x76b189[_0x7196('0x91')]('i.'+_0x175dd8[0x0],_0x175dd8[0x1]===_0x7196('0x92')?![]:!![]);});}if(!_[_0x7196('0x7f')](_0x3ece9f)){_0x76b189[_0x7196('0x67')](_0x5b77fc);_0x1c5a41[_0x7196('0x4e')](_0x7196('0x93'),_0x3ece9f);}BPromise[_0x7196('0x94')]()['then'](function(){if(!_0x5b9824){if(_0x471915['query'][_0x7196('0x80')]||_0x471915['query']['journey'])return;_0x1c5a41[_0x7196('0x4e')](_0x7196('0x95'));_0x76b189[_0x7196('0x4e')](_0x7196('0x95'));return;}return _0x471915['user']['getChatWebsites']({'attributes':['id'],'raw':!![]})[_0x7196('0x37')](function(_0x12394d){if(_[_0x7196('0x7f')](_0x12394d)){_0x1c5a41[_0x7196('0x4e')]('i.ChatWebsiteId\x20IS\x20NULL');_0x76b189[_0x7196('0x4e')]('i.ChatWebsiteId\x20IS\x20NULL');}else{_0x1c5a41['where'](_0x7196('0x81'),_[_0x7196('0x7c')](_0x12394d,'id'));_0x76b189[_0x7196('0x4e')]('i.ChatWebsiteId\x20IN\x20?',_[_0x7196('0x7c')](_0x12394d,'id'));}});})[_0x7196('0x37')](function(){db[_0x7196('0x96')][_0x7196('0x45')](_0x1c5a41[_0x7196('0x97')](),_0x2b52c0)[_0x7196('0x37')](function(_0x214ec2){_0x455fea[_0x7196('0x31')]=_0x214ec2['length'];if(_0x455fea[_0x7196('0x31')]===0x0)return[];return db[_0x7196('0x96')][_0x7196('0x45')](_0x513855[_0x7196('0x97')](),_0x2b52c0)[_0x7196('0x37')](function(_0x4faf7b){_0x143c58=_[_0x7196('0x98')](_0x4faf7b,'id');_0x2b52c0=_[_0x7196('0x99')](_0x2b52c0,{'model':db[_0x7196('0x42')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x471915['query'][_0x7196('0x4a')]){_0x3b78c8['attributes']['forEach'](function(_0x1dcf93){_0x76b189[_0x7196('0x51')]('i.'+_0x1dcf93);});}else{_0x76b189['field'](_0x7196('0x90'),_0x7196('0x65'));_0x76b189['field'](_0x7196('0x9a'),_0x7196('0x9b'));_0x76b189[_0x7196('0x51')](_0x7196('0x9c'),_0x7196('0x9d'));_0x76b189[_0x7196('0x51')]('i.*');_0x76b189[_0x7196('0x51')](_0x7196('0x9e'),_0x7196('0x9f'));_0x76b189['field']('c.lastName','Contact.lastName');_0x76b189[_0x7196('0x51')](_0x7196('0xa0'),_0x7196('0xa1'));_0x76b189['field'](_0x7196('0xa2'),'Contact.phone');_0x76b189[_0x7196('0x51')]('c.mobile',_0x7196('0xa3'));_0x76b189[_0x7196('0x51')](_0x7196('0xa4'),_0x7196('0xa5'));_0x76b189[_0x7196('0x51')](_0x7196('0xa6'),_0x7196('0xa7'));_0x76b189['field'](_0x7196('0xa8'),'Owner.internal');_0x76b189['field']('GROUP_CONCAT(DISTINCT\x20t.id)','TagIds');}if(_0x3b78c8['limit'])_0x76b189[_0x7196('0x33')](_0x3b78c8[_0x7196('0x33')]);if(_0x3b78c8[_0x7196('0x32')])_0x76b189['offset'](_0x3b78c8[_0x7196('0x32')]);return db['sequelize']['query'](_0x76b189['toString'](),_0x2b52c0);})[_0x7196('0x37')](function(_0x55e56b){_0x179815[_0x7196('0x4e')](_0x7196('0xa9'),_[_0x7196('0x7c')](_0x55e56b,'id'));return db[_0x7196('0x96')][_0x7196('0x45')](_0x179815[_0x7196('0x97')](),_0x2b52c0)[_0x7196('0x37')](function(_0x36ce4f){var _0x49d494=_[_0x7196('0xaa')](_0x36ce4f,_0x7196('0xab'));var _0x144e54=[];_0x55e56b['forEach'](function(_0x3a241a){_0x144e54[_0x7196('0x41')](updateChatInteraction(_0x3a241a,_0x143c58,_0x49d494));});return BPromise[_0x7196('0xac')](_0x144e54);});});})['then'](function(_0x6c7aa9){_0x455fea[_0x7196('0xad')]=_0x6c7aa9;return _0x455fea;})[_0x7196('0x37')](respondWithFilteredResult(_0x471bb2,_0x3b78c8));})['catch'](handleError(_0x471bb2,null));};exports[_0x7196('0xae')]=function(_0x3eb6db,_0x4d4f1b){var _0xfb40ad={'raw':![],'where':{'id':_0x3eb6db[_0x7196('0xaf')]['id']}},_0x5db5f1={};_0x5db5f1[_0x7196('0x48')]=_['keys'](db[_0x7196('0x42')]['rawAttributes']);_0x5db5f1[_0x7196('0x45')]=_[_0x7196('0x7b')](_0x3eb6db[_0x7196('0x45')]);_0x5db5f1['filters']=_[_0x7196('0x47')](_0x5db5f1[_0x7196('0x48')],_0x5db5f1[_0x7196('0x45')]);_0xfb40ad[_0x7196('0x49')]=_['intersection'](_0x5db5f1[_0x7196('0x48')],qs[_0x7196('0x4a')](_0x3eb6db[_0x7196('0x45')]['fields']));_0xfb40ad['attributes']=_0xfb40ad[_0x7196('0x49')][_0x7196('0x4b')]?_0xfb40ad[_0x7196('0x49')]:_0x5db5f1[_0x7196('0x48')];if(_0x3eb6db['query'][_0x7196('0xb0')]){_0xfb40ad['include']=[{'all':!![]}];}_0xfb40ad=_[_0x7196('0x99')]({},_0xfb40ad,_0x3eb6db['options']);return db[_0x7196('0x42')][_0x7196('0x6f')](_0xfb40ad)[_0x7196('0x37')](handleEntityNotFound(_0x4d4f1b,null))[_0x7196('0x37')](respondWithResult(_0x4d4f1b,null))[_0x7196('0x2e')](handleError(_0x4d4f1b,null));};exports[_0x7196('0xb1')]=function(_0x342fb1,_0x4c9c35){return db[_0x7196('0x42')][_0x7196('0xb1')](_0x342fb1[_0x7196('0xb2')],{})[_0x7196('0x37')](respondWithResult(_0x4c9c35,0xc9))[_0x7196('0x2e')](handleError(_0x4c9c35,null));};exports[_0x7196('0xb3')]=function(_0x186731,_0x90c063){if(_0x186731['body']['id']){delete _0x186731[_0x7196('0xb2')]['id'];}return db[_0x7196('0x42')]['find']({'where':{'id':_0x186731[_0x7196('0xaf')]['id']}})[_0x7196('0x37')](handleEntityNotFound(_0x90c063,null))['then'](saveUpdates(_0x186731[_0x7196('0xb2')],null))[_0x7196('0x37')](respondWithResult(_0x90c063,null))[_0x7196('0x2e')](handleError(_0x90c063,null));};exports[_0x7196('0xb4')]=function(_0x5ba767,_0x505aab){return db[_0x7196('0x42')]['find']({'where':{'id':_0x5ba767[_0x7196('0xaf')]['id']}})[_0x7196('0x37')](handleEntityNotFound(_0x505aab,null))[_0x7196('0x37')](removeEntity(_0x505aab,null))[_0x7196('0x2e')](handleError(_0x505aab,null));};exports[_0x7196('0xb5')]=function(_0x4efae3,_0x392e74){return db[_0x7196('0x42')][_0x7196('0xb5')]()[_0x7196('0x37')](respondWithResult(_0x392e74,null))[_0x7196('0x2e')](handleError(_0x392e74,null));};exports[_0x7196('0xb6')]=function(_0x446a99,_0x149144){var _0x11fb5b=_0x446a99['params']['id'];var _0x58fb86;var _0x51da79;var _0x144613;return db[_0x7196('0x42')][_0x7196('0xb7')]({'where':{'id':_0x11fb5b}})[_0x7196('0x37')](function(_0x52de6e){_0x58fb86=_0x52de6e;return db[_0x7196('0xb8')][_0x7196('0xb7')]({'where':{'id':_0x52de6e[_0x7196('0x80')]},'attributes':['id','vidaooApiKey','vidaooEscalation'],'raw':!![]});})['then'](function(_0x5ee12a){if(_0x5ee12a&&_0x5ee12a[_0x7196('0xb9')]&&_0x5ee12a[_0x7196('0xba')]){_0x51da79=_0x5ee12a;var _0x2884a6={'rejectUnauthorized':![],'method':_0x7196('0xbb'),'uri':_0x7196('0xbc'),'headers':{'X-APIKEY':_0x5ee12a[_0x7196('0xb9')]},'body':{'name':'MotionCWB:'+_0x11fb5b},'redirect':_0x7196('0xbd'),'json':!![]};return rp(_0x2884a6);}else{throw new db['Sequelize']['ValidationError'](_0x7196('0xbe'));}})['then'](function(_0x5f1525){_0x144613=_0x5f1525;if(_0x144613['id']){var _0x44fb9c={'body':_0x144613['join_url'],'ChatWebsiteId':_0x51da79['id'],'ChatInteractionId':_0x58fb86['id'],'direction':_0x7196('0xbf'),'UserId':_0x446a99[_0x7196('0xc0')]['id']};return db[_0x7196('0xc1')][_0x7196('0xb1')](_0x44fb9c,{});}else{throw new db[(_0x7196('0x23'))][(_0x7196('0x24'))]('Unable\x20to\x20create\x20Vidaoo\x20session');}})[_0x7196('0x37')](function(){return _0x58fb86[_0x7196('0xc2')]({'vidaooSessionId':_0x144613['id']});})[_0x7196('0x37')](respondWithResult(_0x149144,null))['catch'](handleError(_0x149144,null));};exports[_0x7196('0xc3')]=function(_0x17904c,_0x192f6f){if(_0x17904c['body']['id']){delete _0x17904c['body']['id'];}return db[_0x7196('0x42')][_0x7196('0x6f')]({'where':{'id':_0x17904c[_0x7196('0xaf')]['id']}})[_0x7196('0x37')](handleEntityNotFound(_0x192f6f,null))[_0x7196('0x37')](saveUpdates(_0x17904c[_0x7196('0xb2')],null))[_0x7196('0x37')](respondWithResult(_0x192f6f,null))[_0x7196('0x2e')](handleError(_0x192f6f,null));};exports[_0x7196('0xc4')]=function(_0xbd94ef,_0x5d2a56,_0x2fb552){if(_0xbd94ef[_0x7196('0xb2')]['id']){delete _0xbd94ef['body']['id'];}return db[_0x7196('0x42')][_0x7196('0x6f')]({'where':{'id':_0xbd94ef['params']['id']}})[_0x7196('0x37')](function(_0x386259){if(!_0x386259){logger[_0x7196('0x2a')](_0x7196('0xc5'),_0x7196('0xc4'),0x194,_0x7196('0xc6'));_0x5d2a56['sendStatus'](0x194);}else{if(_0x386259['UserId']){throw new db[(_0x7196('0x23'))]['ValidationError'](_0x7196('0xc7'));}}return _0x386259;})[_0x7196('0x37')](function(_0x30db09){if(_0x30db09){return _0x30db09['update']({'closed':_0xbd94ef[_0x7196('0xb2')][_0x7196('0xc8')],'disposition':_0xbd94ef[_0x7196('0xb2')][_0x7196('0xc9')]})[_0x7196('0x37')](function(_0x1e2105){return _0x1e2105;});}})[_0x7196('0x37')](function(_0x31f1d9){return respondWithRpcPromise(_0x7196('0xca'),'abandon',_0xbd94ef[_0x7196('0xb2')],client9004);})[_0x7196('0x37')](respondWithResult(_0x5d2a56,null))[_0x7196('0x2e')](handleError(_0x5d2a56,null));};exports[_0x7196('0xcb')]=function(_0x1bccbd,_0xc7a9d8,_0x5e01cd){_0x1bccbd[_0x7196('0xb2')]['name']=_0x1bccbd[_0x7196('0xcc')][_0x7196('0xcd')];_0x1bccbd[_0x7196('0xb2')]['basename']=_0x1bccbd['file'][_0x7196('0xce')];_0x1bccbd[_0x7196('0xb2')][_0x7196('0x7a')]=_0x1bccbd[_0x7196('0xcc')][_0x7196('0xcf')];return db[_0x7196('0xd0')][_0x7196('0xb1')](_0x1bccbd[_0x7196('0xb2')])['then'](respondWithResult(_0xc7a9d8,0xc9))[_0x7196('0x2e')](handleError(_0xc7a9d8,null));};exports[_0x7196('0xd1')]=function(_0x4ad81d,_0x135c51,_0x1fa845){return db[_0x7196('0x42')]['findOne']({'where':{'id':_0x4ad81d[_0x7196('0xaf')]['id']},'raw':!![]})[_0x7196('0x37')](handleEntityNotFound(_0x135c51,null))[_0x7196('0x37')](function(_0x3c6052){if(_0x3c6052){if(_0x3c6052[_0x7196('0xc8')]){return _0x135c51['status'](0x193)['json']({'status':0x193,'message':_0x7196('0xd2')});}return db[_0x7196('0xd0')][_0x7196('0xb7')]({'where':{'id':_0x4ad81d[_0x7196('0x45')][_0x7196('0xd3')]},'raw':!![]})[_0x7196('0x37')](handleEntityNotFound(_0x135c51,null));}})['then'](function(_0x7f5ce2){if(_0x7f5ce2){return _0x135c51[_0x7196('0xd4')](path[_0x7196('0xd5')](config[_0x7196('0xd6')],'server/files/attachments/',_0x7f5ce2[_0x7196('0xd7')]));}})[_0x7196('0x2e')](handleError(_0x135c51,null));};exports[_0x7196('0xd8')]=function(_0x3bad8a,_0x62d17f){var _0x269f75=null;var _0x36fa90=null;var _0x429670=null;var _0x329955=null;if(_0x3bad8a[_0x7196('0xb2')]['id']){delete _0x3bad8a[_0x7196('0xb2')]['id'];}if(_0x3bad8a[_0x7196('0xb2')]['mailTranscript']){_0x329955=path[_0x7196('0xd5')](config['root'],_0x7196('0xd9'),util['format'](_0x7196('0xda'),Date['now']()));_0x3bad8a[_0x7196('0xb2')][_0x7196('0xdb')]=_0x329955;}return db[_0x7196('0x42')][_0x7196('0x6f')]({'where':{'id':_0x3bad8a['params']['id']},'include':[{'model':db[_0x7196('0xc1')],'as':_0x7196('0xdc'),'include':[{'model':db[_0x7196('0x77')],'as':'User'}]}]})[_0x7196('0x37')](handleEntityNotFound(_0x62d17f,null))[_0x7196('0x37')](saveUpdates(_0x3bad8a[_0x7196('0xb2')],null))['then'](function(_0x6cbe9a){if(_0x6cbe9a){_0x269f75=_0x6cbe9a;return db[_0x7196('0xb8')][_0x7196('0x6f')]({'where':{'id':_0x269f75['ChatWebsiteId']}});}})[_0x7196('0x37')](function(_0x26af5b){if(_0x26af5b){_0x429670=_0x26af5b;return db[_0x7196('0xdd')]['find']({'where':{'id':_0x269f75['ContactId']}});}})['then'](function(_0x542f8e){if(_0x542f8e){_0x36fa90=_0x542f8e;if(_0x329955){var _0x2a0e91=null;for(var _0x2b359d=0x1;_0x2b359d<_0x269f75['Messages'][_0x7196('0x4b')];++_0x2b359d){_0x2a0e91=_0x269f75[_0x7196('0xdc')][_0x2b359d];var _0x18e274=_0x2a0e91['UserId']?util['format'](_0x7196('0xde'),_0x429670[_0x7196('0xdf')],_0x2a0e91[_0x7196('0x79')]):_0x7196('0xe0');var _0x29ec00=_0x3bad8a['body'][_0x7196('0xe1')]||util[_0x7196('0xe2')](_0x7196('0xde'),_0x7196('0xe3'),_0x2a0e91['ContactId']);switch(_0x429670['agentIdentifier']){case _0x7196('0xe4'):_0x18e274=_0x2a0e91[_0x7196('0x79')]?util[_0x7196('0xe2')](_0x7196('0xde'),_0x429670[_0x7196('0xdf')],_0x2a0e91[_0x7196('0x79')]):'System';break;case'agent_alias':_0x18e274=_0x2a0e91[_0x7196('0x79')]?_0x2a0e91[_0x7196('0x77')][_0x7196('0xe5')]||_0x2a0e91['User']['fullname']:_0x7196('0xe0');break;case'agent_fullname':_0x18e274=_0x2a0e91[_0x7196('0x79')]?_0x2a0e91[_0x7196('0x77')][_0x7196('0x3d')]:_0x7196('0xe0');break;default:_0x18e274=_0x2a0e91[_0x7196('0x79')]?util[_0x7196('0xe2')](_0x7196('0xde'),_0x429670[_0x7196('0xdf')],_0x2a0e91[_0x7196('0x79')]):_0x7196('0xe0');}var _0x501e31=util[_0x7196('0xe2')]('[%s]\x20%s:\x20%s\x0a',moment(_0x2a0e91[_0x7196('0xe6')])[_0x7196('0xe2')](_0x7196('0xe7')),_0x2a0e91[_0x7196('0xe8')]==='in'?_0x29ec00:_0x18e274,_0x2a0e91['body']);if(!_0x2a0e91['secret']){fs[_0x7196('0xe9')](_0x329955,_0x501e31);}}return db[_0x7196('0xea')][_0x7196('0xb7')]({'where':{'service':!![]},'include':[{'model':db[_0x7196('0xeb')],'as':'Smtp','raw':!![]}]});}}})['then'](function(_0x29bb00){if(_0x29bb00&&_0x29bb00[_0x7196('0xec')]&&_0x3bad8a['body']){var _0xc46c8c={'tls':{'rejectUnauthorized':![]}};if(_0x29bb00[_0x7196('0xec')]['service']){_0xc46c8c[_0x7196('0xed')]=_0x29bb00[_0x7196('0xec')][_0x7196('0xed')];}else{_0xc46c8c[_0x7196('0xee')]=_0x29bb00[_0x7196('0xec')][_0x7196('0xee')];_0xc46c8c[_0x7196('0xef')]=_0x29bb00['Smtp'][_0x7196('0xef')];_0xc46c8c[_0x7196('0xf0')]=_0x29bb00['Smtp']['secure'];}if(_0x29bb00[_0x7196('0xec')][_0x7196('0xf1')]){_0xc46c8c[_0x7196('0xf2')]={'user':_0x29bb00[_0x7196('0xec')][_0x7196('0xc0')],'pass':_0x29bb00[_0x7196('0xec')][_0x7196('0xf3')]};}return respondWithRpcPromise(_0x7196('0xf4'),_0x7196('0xf5'),{'account':_0xc46c8c,'message':{'from':util[_0x7196('0xe2')](_0x7196('0xf6'),_0x29bb00[_0x7196('0x3a')],_0x29bb00[_0x7196('0xf7')]||_0x29bb00[_0x7196('0xec')][_0x7196('0xc0')]),'to':_0x3bad8a['body'][_0x7196('0xf8')],'subject':_0x7196('0xf9'),'text':util['format'](_0x7196('0xfa'),_0x3bad8a[_0x7196('0xb2')][_0x7196('0xf8')]),'attachments':[{'path':_0x329955}]}})[_0x7196('0x37')](function(){return _0x269f75;})[_0x7196('0x2e')](function(_0x66cc24){console[_0x7196('0x2a')](_0x66cc24);});}else{return _0x269f75;}})[_0x7196('0x37')](respondWithStatusCode(_0x62d17f,0xc8))[_0x7196('0x2e')](handleError(_0x62d17f,null));};exports['addMessage']=function(_0xc815f5,_0x32f50c,_0x247aa4){return db['ChatMessage'][_0x7196('0x6f')]({'where':{'id':_0xc815f5[_0x7196('0xaf')]['id']}})[_0x7196('0x37')](handleEntityNotFound(_0x32f50c,null))[_0x7196('0x37')](function(_0x2ee28f){if(_0x2ee28f){return _0x2ee28f['addMessage'](_0xc815f5[_0x7196('0xb2')]['ids'],_[_0x7196('0xfb')](_0xc815f5['body'],[_0x7196('0xfc'),'id'])||{});}})[_0x7196('0x37')](respondWithResult(_0x32f50c,null))[_0x7196('0x2e')](handleError(_0x32f50c,null));};exports[_0x7196('0xfd')]=function(_0xde3a61,_0x1dc24d,_0x21b769){var _0x33589a={'raw':![],'where':{}};var _0x5d50c2={};var _0x3d290c={'count':0x0,'rows':[]};return db[_0x7196('0x42')][_0x7196('0xb7')]({'where':{'id':_0xde3a61['params']['id']}})['then'](handleEntityNotFound(_0x1dc24d,null))['then'](function(_0x5d95d5){if(_0x5d95d5){_0x5d50c2[_0x7196('0x48')]=_['keys'](db[_0x7196('0xc1')][_0x7196('0x43')]);_0x5d50c2[_0x7196('0x45')]=_[_0x7196('0x7b')](_0xde3a61[_0x7196('0x45')]);_0x5d50c2[_0x7196('0x46')]=_[_0x7196('0x47')](_0x5d50c2[_0x7196('0x48')],_0x5d50c2[_0x7196('0x45')]);_0x33589a[_0x7196('0x49')]=_['intersection'](_0x5d50c2[_0x7196('0x48')],qs[_0x7196('0x4a')](_0xde3a61['query'][_0x7196('0x4a')]));_0x33589a['attributes']=_0x33589a[_0x7196('0x49')][_0x7196('0x4b')]?_0x33589a[_0x7196('0x49')]:_0x5d50c2['model'];if(!_0xde3a61['query'][_0x7196('0xfe')](_0x7196('0x4c'))){_0x33589a['limit']=qs[_0x7196('0x33')](_0xde3a61[_0x7196('0x45')]['limit']);_0x33589a[_0x7196('0x32')]=qs[_0x7196('0x32')](_0xde3a61['query']['offset']);}_0x33589a['order']=qs[_0x7196('0x4d')](_0xde3a61[_0x7196('0x45')][_0x7196('0x4d')]);_0x33589a['where']=qs[_0x7196('0x46')](_[_0x7196('0x4f')](_0xde3a61[_0x7196('0x45')],_0x5d50c2[_0x7196('0x46')]));_0x33589a[_0x7196('0x4e')][_0x7196('0xab')]=_0x5d95d5['id'];if(_0xde3a61[_0x7196('0x45')][_0x7196('0x8a')]){_0x33589a[_0x7196('0x4e')]=_[_0x7196('0x99')](_0x33589a[_0x7196('0x4e')],{'$or':_[_0x7196('0x7c')](_0x33589a[_0x7196('0x49')],function(_0x2ef552){var _0x50e0bf={};_0x50e0bf[_0x2ef552]={'$like':'%'+_0xde3a61[_0x7196('0x45')]['filter']+'%'};return _0x50e0bf;})});}if(_0xde3a61[_0x7196('0x45')][_0x7196('0xff')]){var _0x4f86b4=_0xde3a61[_0x7196('0x45')]['$gte'][_0x7196('0x3f')](',');var _0x5a67de={};_0x5a67de[_0x4f86b4[0x0]]={'$gte':moment(_0x4f86b4[0x1])['format'](_0x7196('0x100'))};_0x33589a['where']=_['merge'](_0x33589a['where'],_0x5a67de);}_0x33589a=_['merge']({},_0x33589a,_0xde3a61[_0x7196('0x101')]);return db[_0x7196('0xc1')][_0x7196('0x31')]({'where':_0x33589a[_0x7196('0x4e')]})[_0x7196('0x37')](function(_0x4cd274){_0x3d290c[_0x7196('0x31')]=_0x4cd274;if(_0xde3a61['query'][_0x7196('0xb0')]){_0x33589a['include']=[{'all':!![]}];}return db[_0x7196('0xc1')][_0x7196('0x102')](_0x33589a);})['then'](function(_0xa6ca64){_0x3d290c['rows']=_0xa6ca64;return _0x3d290c;});}})[_0x7196('0x37')](respondWithFilteredResult(_0x1dc24d,_0x33589a))['catch'](handleError(_0x1dc24d,null));};exports[_0x7196('0x103')]=function(_0x3118bb,_0x4d91b9,_0x4a37d4){var _0x5c556e={'where':{}},_0xe1728b={},_0x4f6086={'count':0x0,'rows':[]};return db[_0x7196('0x42')][_0x7196('0xb7')]({'where':{'id':_0x3118bb[_0x7196('0xaf')]['id']}})[_0x7196('0x37')](handleEntityNotFound(_0x4d91b9,null))[_0x7196('0x37')](function(_0x1d264b){if(_0x1d264b){_0xe1728b[_0x7196('0x48')]=_['keys'](db['ChatMessage'][_0x7196('0x43')]);_0xe1728b['query']=_[_0x7196('0x7b')](_0x3118bb[_0x7196('0x45')]);_0xe1728b[_0x7196('0x46')]=_[_0x7196('0x47')](_0xe1728b['model'],_0xe1728b[_0x7196('0x45')]);_0x5c556e[_0x7196('0x49')]=_[_0x7196('0x47')](_0xe1728b[_0x7196('0x48')],qs[_0x7196('0x4a')](_0x3118bb[_0x7196('0x45')][_0x7196('0x4a')]));_0x5c556e['attributes']=_0x5c556e[_0x7196('0x49')][_0x7196('0x4b')]?_0x5c556e[_0x7196('0x49')]:_0xe1728b[_0x7196('0x48')];if(!_0x3118bb[_0x7196('0x45')][_0x7196('0xfe')]('nolimit')){_0x5c556e[_0x7196('0x33')]=qs[_0x7196('0x33')](_0x3118bb[_0x7196('0x45')][_0x7196('0x33')]);_0x5c556e[_0x7196('0x32')]=qs[_0x7196('0x32')](_0x3118bb[_0x7196('0x45')][_0x7196('0x32')]);}_0x5c556e[_0x7196('0x91')]=qs[_0x7196('0x4d')](_0x3118bb['query'][_0x7196('0x4d')]);_0x5c556e[_0x7196('0x4e')]=qs[_0x7196('0x46')](_[_0x7196('0x4f')](_0x3118bb[_0x7196('0x45')],_0xe1728b[_0x7196('0x46')]));_0x5c556e[_0x7196('0x4e')][_0x7196('0xab')]=_0x1d264b['id'];if(_0x3118bb['query']['filter']){_0x5c556e[_0x7196('0x4e')]=_[_0x7196('0x99')](_0x5c556e['where'],{'$or':_[_0x7196('0x7c')](_0x5c556e[_0x7196('0x49')],function(_0x401636){var _0xdb3933={};_0xdb3933[_0x401636]={'$like':'%'+_0x3118bb[_0x7196('0x45')][_0x7196('0x8a')]+'%'};return _0xdb3933;})});}_0x5c556e[_0x7196('0x4e')][_0x7196('0x104')]=![];if(_0x3118bb[_0x7196('0x45')]['id']){_0x5c556e[_0x7196('0x4e')]['id']={'$gt':_0x3118bb['query']['id']};}_0x5c556e=_[_0x7196('0x99')]({},_0x5c556e,_0x3118bb['options']);return db[_0x7196('0xc1')]['count']({'where':_0x5c556e[_0x7196('0x4e')]})[_0x7196('0x37')](function(_0x1df729){_0x4f6086[_0x7196('0x31')]=_0x1df729;_0x5c556e['include']=[];if(_0x3118bb[_0x7196('0x45')][_0x7196('0x105')]){_0x5c556e[_0x7196('0x106')]['push']({'model':db['User'],'as':_0x7196('0x77'),'attributes':['id','fullname',_0x7196('0xe5')]});}if(_0x3118bb['query']['includeAll']){_0x5c556e[_0x7196('0x106')]=[{'all':!![]}];}return db[_0x7196('0xc1')][_0x7196('0x102')](_0x5c556e);})[_0x7196('0x37')](function(_0x2911bb){_0x4f6086[_0x7196('0xad')]=_0x2911bb;return _0x4f6086;});}})[_0x7196('0x37')](respondWithFilteredResult(_0x4d91b9,_0x5c556e))[_0x7196('0x2e')](handleError(_0x4d91b9,null));};exports['addTags']=function(_0x2cfd7f,_0x3bda03,_0x716313){return db[_0x7196('0x42')][_0x7196('0x6f')]({'where':{'id':_0x2cfd7f['params']['id']}})['then'](handleEntityNotFound(_0x3bda03,null))[_0x7196('0x37')](function(_0x18fc9c){if(_0x18fc9c){return _0x18fc9c[_0x7196('0x107')](_0x2cfd7f['body']['ids'],_[_0x7196('0xfb')](_0x2cfd7f[_0x7196('0xb2')],[_0x7196('0xfc'),'id'])||{})[_0x7196('0x108')](function(){return db[_0x7196('0x74')][_0x7196('0x102')]({'attributes':['id','name','color'],'where':{'id':_0x2cfd7f[_0x7196('0xb2')][_0x7196('0xfc')]}});})[_0x7196('0x37')](function(_0x4dcd0c){socket[_0x7196('0x109')](_0x7196('0x10a'),{'id':Number(_0x2cfd7f[_0x7196('0xaf')]['id']),'tags':_0x4dcd0c||[]});return{'id':Number(_0x2cfd7f['params']['id']),'tags':_0x4dcd0c||[]};});}})[_0x7196('0x37')](respondWithResult(_0x3bda03,null))[_0x7196('0x2e')](handleError(_0x3bda03,null));};exports[_0x7196('0x10b')]=function(_0x514cde,_0x32c76a,_0x1e2dec){return db['ChatInteraction'][_0x7196('0x6f')]({'where':{'id':_0x514cde[_0x7196('0xaf')]['id']}})[_0x7196('0x37')](handleEntityNotFound(_0x32c76a,null))[_0x7196('0x37')](function(_0x5d67ed){if(_0x5d67ed){return _0x5d67ed['removeTags'](_0x514cde[_0x7196('0x45')]['ids']);}})['then'](respondWithStatusCode(_0x32c76a,null))[_0x7196('0x2e')](handleError(_0x32c76a,null));};exports['download']=function(_0x3cea3e,_0x33f4d5){var _0x100361=moment()[_0x7196('0x10c')]()[_0x7196('0x97')]();var _0x1b3d7e=path[_0x7196('0xd5')](config[_0x7196('0xd6')],_0x7196('0x10d'),_0x7196('0x10e'),'tmp');var _0x39d323=path['join'](config[_0x7196('0xd6')],_0x7196('0x10d'),'files',_0x7196('0x10f'));var _0x19505a=path[_0x7196('0xd5')](_0x1b3d7e,_0x100361);var _0x5d9b9b=util[_0x7196('0xe2')](_0x7196('0x110'),_0x3cea3e[_0x7196('0xaf')]['id'],_0x100361);var _0x1ff320=path[_0x7196('0xd5')](_0x1b3d7e,_0x5d9b9b);var _0x3f96d7=[];_0x3f96d7[_0x7196('0x41')]({'model':db['User'],'as':'User','attributes':['id',_0x7196('0x3d')],'raw':!![]});_0x3f96d7[_0x7196('0x41')]({'model':db[_0x7196('0xdd')],'as':_0x7196('0x111'),'attributes':['id',_0x7196('0x112'),'lastName'],'raw':!![]});if(_0x3cea3e[_0x7196('0x45')]['attachments']){_0x3f96d7['push']({'model':db['Attachment'],'as':_0x7196('0xd0'),'raw':!![]});}var _0x4e18f2=[{'model':db[_0x7196('0xc1')],'as':_0x7196('0xdc'),'attributes':['id',_0x7196('0xb2'),_0x7196('0xe6'),'direction','secret','read'],'include':_0x3f96d7}];_0x4e18f2[_0x7196('0x41')]({'model':db[_0x7196('0xb8')],'as':_0x7196('0x113'),'attributes':['id',_0x7196('0x3a')]});_0x4e18f2[_0x7196('0x41')]({'model':db[_0x7196('0x77')],'as':_0x7196('0x114'),'attributes':['id',_0x7196('0x3d')]});return db[_0x7196('0x42')][_0x7196('0x6f')]({'where':{'id':_0x3cea3e[_0x7196('0xaf')]['id']},'include':_0x4e18f2})[_0x7196('0x37')](handleEntityNotFound(_0x33f4d5,null))[_0x7196('0x37')](function(_0x44f774){if(_0x44f774){var _0x1fb96c=_0x44f774[_0x7196('0x115')]({'plain':!![]});fs[_0x7196('0x116')](_0x19505a);var _0x1d4126={'format':'A4','border':'10px','header':{'height':_0x7196('0x117'),'contents':{'first':'\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
Interaction\x20Transcript \x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
'}},'footer':{'height':_0x7196('0x118'),'contents':{'default':util[_0x7196('0xe2')](' \x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20%s \x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{{page}}/{{pages}} \x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20%s \x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
',util[_0x7196('0xe2')]('%s\x20#%d','Chat',_0x1fb96c['id']),moment()[_0x7196('0xe2')](_0x7196('0x119'))[_0x7196('0x97')]())}}};var _0x245211={'channel':_0x7196('0x11a'),'account':_0x1fb96c['Account'][_0x7196('0x3a')],'agent':_0x1fb96c['Owner']?_0x1fb96c['Owner'][_0x7196('0x3d')]:_0x7196('0x11b'),'createdAt':moment(_0x1fb96c[_0x7196('0xe6')])['format'](_0x7196('0x100'))[_0x7196('0x97')](),'closedAt':_0x1fb96c[_0x7196('0xc8')]?moment(_0x1fb96c[_0x7196('0x11c')])[_0x7196('0xe2')](_0x7196('0x100'))[_0x7196('0x97')]():'','disposition':_0x1fb96c[_0x7196('0xc9')],'chatInfo':{'browser':_0x1fb96c['browserName'],'os':_0x1fb96c[_0x7196('0x11d')],'referer':_0x1fb96c['referer'],'customerIp':_0x1fb96c[_0x7196('0x11e')],'customerPort':_0x1fb96c[_0x7196('0x11f')]?_0x1fb96c[_0x7196('0x11f')]:_0x7196('0x11b')},'messages':_(_0x1fb96c[_0x7196('0xdc')])[_0x7196('0x120')]()[_0x7196('0x8a')]({'secret':![]})[_0x7196('0x7c')](function(_0x51f5e9){if(_0x51f5e9[_0x7196('0xd0')]){var _0x1e8251=path[_0x7196('0xd5')](_0x39d323,_0x51f5e9[_0x7196('0xd0')][_0x7196('0xd7')]);if(fs[_0x7196('0x121')](_0x1e8251)){fs[_0x7196('0x122')](_0x1e8251)[_0x7196('0x123')](fs[_0x7196('0x124')](path[_0x7196('0xd5')](_0x19505a,_0x51f5e9[_0x7196('0xd0')][_0x7196('0xd7')])));}}return{'date':moment(_0x51f5e9[_0x7196('0xe6')])['format'](_0x7196('0x100'))[_0x7196('0x97')](),'sender':_0x51f5e9['direction']==='out'?_0x51f5e9[_0x7196('0x77')]?_0x51f5e9[_0x7196('0x77')][_0x7196('0x3d')]:_0x7196('0xe0'):_0x51f5e9['Contact']['firstName']+(_0x51f5e9[_0x7196('0x111')][_0x7196('0x125')]?'\x20'+_0x51f5e9[_0x7196('0x111')]['lastName']:''),'body':_0x51f5e9['Attachment']?_0x51f5e9[_0x7196('0xd0')][_0x7196('0xd7')]:_0x51f5e9['body'],'direction':_0x51f5e9[_0x7196('0xe8')]===_0x7196('0xbf')?'A':'C','secret':_0x51f5e9['secret'],'read':_0x51f5e9['read'],'attachment':_0x51f5e9['Attachment']};})[_0x7196('0x66')]()};return ejs[_0x7196('0x126')](path['join'](config[_0x7196('0xd6')],_0x7196('0x10d'),_0x7196('0x127'),_0x7196('0x128')),{'interaction':_0x245211})['then'](function(_0x2fc6f9){return new BPromise(function(_0x3c03f4,_0x2f8b1e){pdf['create'](_0x2fc6f9,_0x1d4126)[_0x7196('0x129')](path[_0x7196('0xd5')](_0x19505a,_0x7196('0x12a')+_0x1fb96c['id']+'-'+_0x100361+_0x7196('0x12b')),function(_0x3ac15f,_0x3a7edd){if(_0x3ac15f)return _0x2f8b1e(_0x3ac15f);_0x3c03f4(_0x3a7edd);});});})['then'](function(){return new BPromise(function(_0x5b9062,_0x4b00d5){zipdir(_0x19505a,{'saveTo':_0x1ff320},function(_0x493da5,_0x5b4f7e){if(_0x493da5)return _0x4b00d5(_0x493da5);return _0x5b9062(_0x5b4f7e);});})[_0x7196('0x37')](function(){return new BPromise(function(_0x729ed0,_0x45bf3e){rimraf(_0x19505a,function(_0x50ebe3){if(_0x50ebe3)_0x45bf3e(_0x50ebe3);return _0x729ed0();});});})[_0x7196('0x37')](function(){return _0x33f4d5[_0x7196('0xd4')](_0x1ff320,_0x5d9b9b,function(_0x1244f2){if(_0x1244f2){console[_0x7196('0x12c')](_0x7196('0x12d'),_0x1244f2);}else{fs[_0x7196('0x12e')](_0x1ff320);}});});});}else{return _0x33f4d5[_0x7196('0x12f')](0xc8);}})['catch'](handleError(_0x33f4d5,null));};
\ No newline at end of file
+var _0x4888=['follow','join_url','out','ChatMessage','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','Interaction\x20already\x20assigned','closed','disposition','AbandonInteraction','attachmentUpload','file','originalname','basename','filename','mimetype','Attachment','attachmentDownload','attachId','join','root','server/files/attachments/','mailTranscript','server/files/chat/upload/','format','transcript-%s.txt','now','pathTranscript','Messages','agentAlias','System','%s%d','agentIdentifier','alias','agent_fullname','[%s]\x20%s:\x20%s\x0a','direction','secret','MailAccount','MailServerOut','Smtp','service','host','port','secure','authentication','SendMail','\x22%s\x22\x20<%s>','Mail\x20Transcript','addMessage','omit','getMessages','nolimit','pick','filter','$gte','YYYY-MM-DD\x20HH:mm:ss','findAll','getMyMessages','includeAgent','addTags','ids','spread','color','emit','chatInteractionTags:save','removeTags','download','unix','server','tmp','files','attachments','transcript-%d-%s.zip','CmContact','firstName','lastName','Account','Owner','get','mkdirSync','40px','\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
Interaction\x20Transcript \x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','30px',' \x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20%s \x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{{page}}/{{pages}} \x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20%s \x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
','Chat','YYYY-MM-DD','closedAt','browserName','osName','referer','customerIp','customerPort','N.A.','existsSync','createReadStream','createWriteStream','renderFile','downloadInteraction.html','transcript-','.pdf','log','err','unlinkSync','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','defaults','redis','register','http','client','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','ChatInteraction,\x20%s,\x20%s','sendStatus','status','end','count','offset','limit','set','Content-Range','reject','save','update','destroy','stack','name','send','map','fullname','TagIds','split','forEach','Tags','push','index','ChatInteraction','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','select','field','from','tools_tags','u.id','ui.ChatInteractionId','left_join','users','u.id\x20=\x20ui.UserId','cm_contacts','o.id\x20=\x20i.UserId','chat_websites','a.id\x20=\x20i.ChatWebsiteId','chat_messages','me.ChatInteractionId\x20=\x20i.id','chat_interaction_has_tags','it.ChatInteractionId\x20=\x20i.id','expr','search','parseSearch','sqlOperator','conditions','length','unreadMessages','value','having','`\x20>\x200','Contact','operator','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','start','Tag','union','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','find','UserId','text','some','compact','ChatWebsiteId','i.ChatWebsiteId\x20IN\x20?','concat','createdAt','parse','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','replace','\x27\x27\x27\x27','i.id\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','i.id','QueryTypes','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','DESC','isEmpty','t.id\x20IN\x20?','resolve','journey','i.ChatWebsiteId\x20IS\x20NOT\x20NULL','user','getChatWebsites','i.ChatWebsiteId\x20IS\x20NULL','toString','sequelize','keyBy','merge','a.key','Account.key','a.mandatoryDisposition','i.*','c.firstName','Contact.firstName','Contact.lastName','c.email','Contact.email','Contact.phone','c.mobile','Contact.mobile','Contact.fax','o.internal','Owner.internal','ui.ChatInteractionId\x20IN\x20?','ChatInteractionId','all','rows','rawAttributes','includeAll','include','options','create','body','params','describe','createVidaooSession','findOne','ChatWebsite','vidaooEscalation','POST','https://api-vidaoo.xcally.com/api/v1/sessions','vidaooApiKey','MotionCWB:'];(function(_0x1a3cc7,_0x2900e3){var _0x338438=function(_0x5a4872){while(--_0x5a4872){_0x1a3cc7['push'](_0x1a3cc7['shift']());}};_0x338438(++_0x2900e3);}(_0x4888,0x198));var _0x8488=function(_0x4c0ebb,_0x1e7eae){_0x4c0ebb=_0x4c0ebb-0x0;var _0xfc4dc1=_0x4888[_0x4c0ebb];return _0xfc4dc1;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x8488('0x0'));var rimraf=require(_0x8488('0x1'));var zipdir=require(_0x8488('0x2'));var jsonpatch=require(_0x8488('0x3'));var rp=require(_0x8488('0x4'));var moment=require(_0x8488('0x5'));var BPromise=require(_0x8488('0x6'));var Mustache=require('mustache');var util=require(_0x8488('0x7'));var path=require(_0x8488('0x8'));var sox=require(_0x8488('0x9'));var csv=require(_0x8488('0xa'));var ejs=require(_0x8488('0xb'));var fs=require('fs');var _=require(_0x8488('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x8488('0xa'));var querystring=require(_0x8488('0xd'));var Papa=require('papaparse');var Redis=require(_0x8488('0xe'));var authService=require(_0x8488('0xf'));var qs=require(_0x8488('0x10'));var as=require(_0x8488('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8488('0x12'))(_0x8488('0x13'));var utils=require(_0x8488('0x14'));var config=require(_0x8488('0x15'));var db=require(_0x8488('0x16'))['db'];config['redis']=_[_0x8488('0x17')](config[_0x8488('0x18')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x8488('0x18')]));require('./chatInteraction.socket')[_0x8488('0x19')](socket);var jayson=require('jayson/promise');var client=jayson['client'][_0x8488('0x1a')]({'port':0x232b});var client9004=jayson[_0x8488('0x1b')][_0x8488('0x1a')]({'port':0x232c});function checkPasswordPattern(_0x2bcb7c,_0x3b3cfa,_0x8d3b3d){if(_0x8d3b3d){var _0x165139=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x165139['test'](_0x3b3cfa)){return _0x2bcb7c;}else{throw new db[(_0x8488('0x1c'))][(_0x8488('0x1d'))](_0x8488('0x1e'));}}else{return _0x2bcb7c;}}function respondWithRpcPromise(_0x37361d,_0x60ae2f,_0x39775f,_0x1aedb1){return new BPromise(function(_0x27c62a,_0x514c31){var _0x1de64a=_0x1aedb1||client;return _0x1de64a[_0x8488('0x1f')](_0x37361d,_0x39775f)[_0x8488('0x20')](function(_0x3dd93e){logger['info']('ChatInteraction,\x20%s,\x20%s',_0x60ae2f,_0x8488('0x21'));logger[_0x8488('0x22')](_0x8488('0x23'),_0x60ae2f,_0x8488('0x21'),JSON[_0x8488('0x24')](_0x3dd93e));if(_0x3dd93e[_0x8488('0x25')]){if(_0x3dd93e[_0x8488('0x25')][_0x8488('0x26')]===0x1f4){logger[_0x8488('0x25')]('ChatInteraction,\x20%s,\x20%s',_0x60ae2f,_0x3dd93e[_0x8488('0x25')][_0x8488('0x27')]);return _0x514c31(_0x3dd93e[_0x8488('0x25')][_0x8488('0x27')]);}logger[_0x8488('0x25')]('ChatInteraction,\x20%s,\x20%s',_0x60ae2f,_0x3dd93e['error']['message']);return _0x27c62a(_0x3dd93e['error'][_0x8488('0x27')]);}else{logger['info']('ChatInteraction,\x20%s,\x20%s',_0x60ae2f,_0x8488('0x21'));_0x27c62a(_0x3dd93e[_0x8488('0x28')][_0x8488('0x27')]);}})[_0x8488('0x29')](function(_0x287662){logger['error'](_0x8488('0x2a'),_0x60ae2f,_0x287662);_0x514c31(_0x287662);});});}function respondWithStatusCode(_0x38c137,_0xf9720e){_0xf9720e=_0xf9720e||0xcc;return function(_0x3df1f9){if(_0x3df1f9){return _0x38c137[_0x8488('0x2b')](_0xf9720e);}return _0x38c137[_0x8488('0x2c')](_0xf9720e)[_0x8488('0x2d')]();};}function respondWithResult(_0x296b6c,_0x368f9c){_0x368f9c=_0x368f9c||0xc8;return function(_0x1d9317){if(_0x1d9317){return _0x296b6c[_0x8488('0x2c')](_0x368f9c)['json'](_0x1d9317);}};}function respondWithFilteredResult(_0x57ce3c,_0x4e3fe2){return function(_0x292fe8){if(_0x292fe8){var _0x408c36=_0x292fe8[_0x8488('0x2e')],_0x19cf42=_0x4e3fe2['offset'],_0x121dcc=_0x4e3fe2[_0x8488('0x2f')]+_0x4e3fe2[_0x8488('0x30')],_0x117321;if(_0x121dcc>=_0x408c36){_0x121dcc=_0x408c36;_0x117321=0xc8;}else{_0x117321=0xce;}_0x57ce3c[_0x8488('0x2c')](_0x117321);return _0x57ce3c[_0x8488('0x31')](_0x8488('0x32'),_0x19cf42+'-'+_0x121dcc+'/'+_0x408c36)['json'](_0x292fe8);}return null;};}function patchUpdates(_0x46c95b){return function(_0x23f67a){try{jsonpatch['apply'](_0x23f67a,_0x46c95b,!![]);}catch(_0x1b0637){return BPromise[_0x8488('0x33')](_0x1b0637);}return _0x23f67a[_0x8488('0x34')]();};}function saveUpdates(_0x446f90,_0x4555d0){return function(_0x484a0e){if(_0x484a0e){return _0x484a0e[_0x8488('0x35')](_0x446f90)[_0x8488('0x20')](function(_0x3f3861){return _0x3f3861;});}return null;};}function removeEntity(_0x584965,_0x17ca2f){return function(_0x5bc335){if(_0x5bc335){return _0x5bc335[_0x8488('0x36')]()[_0x8488('0x20')](function(){_0x584965[_0x8488('0x2c')](0xcc)[_0x8488('0x2d')]();});}};}function handleEntityNotFound(_0x4c3b59,_0x1bb256){return function(_0xe71bd9){if(!_0xe71bd9){_0x4c3b59[_0x8488('0x2b')](0x194);}return _0xe71bd9;};}function handleError(_0x583ece,_0x3920d1){_0x3920d1=_0x3920d1||0x1f4;return function(_0x17bfea){logger[_0x8488('0x25')](_0x17bfea[_0x8488('0x37')]);if(_0x17bfea[_0x8488('0x38')]){delete _0x17bfea[_0x8488('0x38')];}_0x583ece[_0x8488('0x2c')](_0x3920d1)[_0x8488('0x39')](_0x17bfea);};}function getInteractionUsers(_0x1a8235,_0x2171dc){return new BPromise(function(_0x3b6d07,_0x4cb675){try{if(_0x2171dc[_0x1a8235['id']]){_0x1a8235['Users']=_[_0x8488('0x3a')](_0x2171dc[_0x1a8235['id']],function(_0x36c17a){return{'id':_0x36c17a['id'],'fullname':_0x36c17a[_0x8488('0x3b')]};});}}catch(_0x390a17){_0x4cb675(_0x390a17);}_0x3b6d07(_0x1a8235);});}function getInteractionTags(_0x2d9fa1,_0x910460){return new BPromise(function(_0x13c260,_0x4481df){try{if(_0x2d9fa1[_0x8488('0x3c')]){_0x2d9fa1['Tags']=[];_0x2d9fa1[_0x8488('0x3c')][_0x8488('0x3d')](',')[_0x8488('0x3e')](function(_0x520e82){_0x2d9fa1[_0x8488('0x3f')][_0x8488('0x40')](_0x910460[_0x520e82]);});}delete _0x2d9fa1[_0x8488('0x3c')];}catch(_0x28bc84){_0x4481df(_0x28bc84);}_0x13c260(_0x2d9fa1);});}function updateChatInteraction(_0x44d5f2,_0x156246,_0x1aac4b){return new BPromise(function(_0x496ea0,_0x45db70){return getInteractionUsers(_0x44d5f2,_0x1aac4b)[_0x8488('0x20')](function(_0x891cff){return getInteractionTags(_0x891cff,_0x156246);})['then'](function(_0x3649ae){_0x496ea0(_0x3649ae);})['catch'](function(_0x40ee7e){_0x45db70(_0x40ee7e);});});}exports[_0x8488('0x41')]=function(_0x5cbd11,_0x22a3f3){var _0x4023ac={},_0x10cc1f={},_0x25ef13={'count':0x0,'rows':[]};var _0x2158b2=_['map'](db[_0x8488('0x42')]['rawAttributes'],function(_0x3440ae){return{'name':_0x3440ae[_0x8488('0x43')],'type':_0x3440ae[_0x8488('0x44')][_0x8488('0x45')]};});_0x10cc1f[_0x8488('0x46')]=_[_0x8488('0x3a')](_0x2158b2,_0x8488('0x38'));_0x10cc1f[_0x8488('0x47')]=_[_0x8488('0x48')](_0x5cbd11[_0x8488('0x47')]);_0x10cc1f[_0x8488('0x49')]=_[_0x8488('0x4a')](_0x10cc1f[_0x8488('0x46')],_0x10cc1f[_0x8488('0x47')]);_0x4023ac[_0x8488('0x4b')]=_[_0x8488('0x4a')](_0x10cc1f[_0x8488('0x46')],qs['fields'](_0x5cbd11[_0x8488('0x47')][_0x8488('0x4c')]));_0x4023ac[_0x8488('0x4b')]=_0x4023ac[_0x8488('0x4b')]['length']?_0x4023ac[_0x8488('0x4b')]:_0x10cc1f[_0x8488('0x46')];if(!_0x5cbd11[_0x8488('0x47')][_0x8488('0x4d')]('nolimit')){_0x4023ac[_0x8488('0x30')]=qs[_0x8488('0x30')](_0x5cbd11[_0x8488('0x47')][_0x8488('0x30')]);_0x4023ac[_0x8488('0x2f')]=qs[_0x8488('0x2f')](_0x5cbd11[_0x8488('0x47')][_0x8488('0x2f')]);}_0x4023ac[_0x8488('0x4e')]=qs[_0x8488('0x4f')](_0x5cbd11[_0x8488('0x47')][_0x8488('0x4f')]);_0x4023ac[_0x8488('0x50')]=qs['filters'](_['pick'](_0x5cbd11[_0x8488('0x47')],_0x10cc1f[_0x8488('0x49')]),_0x2158b2);var _0x3749da=[];var _0x45bd4b=squel[_0x8488('0x51')]()[_0x8488('0x52')]('id')[_0x8488('0x52')](_0x8488('0x38'))[_0x8488('0x52')]('color')[_0x8488('0x53')](_0x8488('0x54'));var _0x51d1eb=squel[_0x8488('0x51')]()[_0x8488('0x52')](_0x8488('0x55'))[_0x8488('0x52')]('u.fullname')[_0x8488('0x52')](_0x8488('0x56'))[_0x8488('0x53')]('user_has_chat_interactions','ui')[_0x8488('0x57')](_0x8488('0x58'),'u',_0x8488('0x59'));var _0x3eb06e=squel['select']()[_0x8488('0x53')]('chat_interactions','i')['left_join'](_0x8488('0x5a'),'c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')[_0x8488('0x57')](_0x8488('0x58'),'o',_0x8488('0x5b'))[_0x8488('0x57')](_0x8488('0x5c'),'a',_0x8488('0x5d'))['left_join'](_0x8488('0x5e'),'me',_0x8488('0x5f'))[_0x8488('0x57')](_0x8488('0x60'),'it',_0x8488('0x61'))['left_join'](_0x8488('0x54'),'t','t.id\x20=\x20it.TagId');var _0x137f50=squel[_0x8488('0x62')]();var _0x5da71e=[];var _0x342188=squel[_0x8488('0x62')]();var _0x304ceb;if(_0x5cbd11[_0x8488('0x47')][_0x8488('0x63')]){_0x304ceb=as[_0x8488('0x64')](_0x5cbd11['query'][_0x8488('0x63')]);var _0x568da7=_0x304ceb[_0x8488('0x65')];for(var _0x3fa6e2=0x0;_0x3fa6e2<_0x304ceb[_0x8488('0x66')][_0x8488('0x67')];_0x3fa6e2++){var _0x38cfa5=_0x304ceb[_0x8488('0x66')][_0x3fa6e2];var _0x5a4426='i';var _0x43ec52=_['find'](_0x2158b2,[_0x8488('0x38'),_0x38cfa5[_0x8488('0x52')]]);if(!_0x43ec52){switch(_0x38cfa5[_0x8488('0x52')]){case _0x8488('0x68'):if(_0x38cfa5[_0x8488('0x69')]==0x1){_0x3eb06e[_0x8488('0x6a')]('`'+_0x38cfa5['field']+'`\x20=\x200');}else{_0x3eb06e['having']('`'+_0x38cfa5[_0x8488('0x52')]+_0x8488('0x6b'));}break;case _0x8488('0x6c'):if(_0x38cfa5[_0x8488('0x6d')]===_0x8488('0x6e')){if(_0x38cfa5[_0x8488('0x69')][_0x8488('0x3d')]('\x20')[_0x8488('0x67')]>0x1){_0x137f50[_0x568da7](_0x8488('0x6f'),qs[_0x8488('0x70')](_0x38cfa5['value']),null);}else{var _0x1f7e98='%'+_0x38cfa5[_0x8488('0x69')]+'%';_0x137f50[_0x568da7](_0x8488('0x71'),_0x1f7e98,_0x1f7e98,_0x1f7e98);}}else{_0x43ec52=_['find'](_0x2158b2,['name',_0x8488('0x72')]);_0x38cfa5[_0x8488('0x52')]=_0x8488('0x72');_0x1a3988=as[_0x8488('0x73')](_0x5a4426,_0x43ec52['type'],_0x38cfa5);_0x137f50[_0x568da7](_0x1a3988['text'],_0x1a3988[_0x8488('0x69')][_0x8488('0x74')],_0x1a3988[_0x8488('0x69')]['end']);}break;case _0x8488('0x75'):var _0x401f4d=_0x38cfa5[_0x8488('0x69')][_0x8488('0x3d')](',')[_0x8488('0x3a')](function(_0x5e41e5){return Number(_0x5e41e5);});_0x401f4d[_0x8488('0x3e')](function(_0x3babee){_0x342188['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x3babee+',%');});_0x5da71e=_[_0x8488('0x76')](_0x5da71e,_0x401f4d);break;case _0x8488('0x77'):if(_0x38cfa5['operator']===_0x8488('0x6e')){_0x137f50[_0x568da7](_0x8488('0x78'),'%'+_0x38cfa5[_0x8488('0x69')]+'%',null);}else{_0x43ec52=_[_0x8488('0x79')](_0x2158b2,[_0x8488('0x38'),_0x8488('0x7a')]);_0x38cfa5[_0x8488('0x52')]='UserId';_0x1a3988=as[_0x8488('0x73')](_0x5a4426,_0x43ec52[_0x8488('0x44')],_0x38cfa5);_0x137f50[_0x568da7](_0x1a3988['text'],_0x1a3988['value'][_0x8488('0x74')],_0x1a3988[_0x8488('0x69')][_0x8488('0x2d')]);}break;case'body':_0x1a3988=as[_0x8488('0x73')]('me',null,_0x38cfa5);_0x137f50[_0x568da7](_0x1a3988[_0x8488('0x7b')],_0x1a3988['value'][_0x8488('0x74')],_0x1a3988['value'][_0x8488('0x2d')]);break;}}else{var _0x1a3988=as[_0x8488('0x73')](_0x5a4426,_0x43ec52['type'],_0x38cfa5);_0x137f50[_0x568da7](_0x1a3988[_0x8488('0x7b')],_0x1a3988[_0x8488('0x69')]['start'],_0x1a3988['value'][_0x8488('0x2d')]);}}}else{var _0x21a42e=_(_0x5cbd11[_0x8488('0x47')])[_0x8488('0x48')]()[_0x8488('0x3a')](function(_0x2fb435){return _[_0x8488('0x7c')](_0x2158b2,[_0x8488('0x38'),_0x2fb435])?_0x2fb435:undefined;})[_0x8488('0x7d')]()[_0x8488('0x69')]();if(!_['isEmpty'](_0x21a42e)){_0x21a42e[_0x8488('0x3e')](function(_0x5c0599){if(_0x5c0599===_0x8488('0x7e')){_0x3eb06e[_0x8488('0x50')](_0x8488('0x7f'),[][_0x8488('0x80')](_0x5cbd11['query'][_0x5c0599]));}else if(_0x5c0599===_0x8488('0x81')){var _0x15ee3a=JSON['parse'](_0x5cbd11[_0x8488('0x47')][_0x5c0599])['$gte'];var _0x26241b=JSON[_0x8488('0x82')](_0x5cbd11[_0x8488('0x47')][_0x5c0599])[_0x8488('0x83')];_0x3eb06e[_0x8488('0x50')](_0x8488('0x84'),_0x15ee3a,_0x26241b);}else{if(_0x5cbd11[_0x8488('0x47')][_0x5c0599]===_0x8488('0x85')){_0x3eb06e['where']('i.'+_0x5c0599+_0x8488('0x86'));}else{_0x3eb06e['where']('i.'+_0x5c0599+'\x20=\x20?',_0x5cbd11[_0x8488('0x47')][_0x5c0599]);}}});}if(_0x5cbd11[_0x8488('0x47')][_0x8488('0x87')]){if(_0x5cbd11['query']['read']==0x1){_0x3eb06e[_0x8488('0x6a')](_0x8488('0x88'));}else{_0x3eb06e['having'](_0x8488('0x89'));}}if(_0x5cbd11[_0x8488('0x47')][_0x8488('0x8a')]){_0x5da71e=_[_0x8488('0x8b')](_0x5cbd11[_0x8488('0x47')][_0x8488('0x8a')])?_0x5cbd11['query'][_0x8488('0x8a')]:new Array(_0x5cbd11[_0x8488('0x47')][_0x8488('0x8a')]);_0x5da71e['forEach'](function(_0x1cfe70){_0x342188['or'](_0x8488('0x8c'),'%,'+_0x1cfe70+',%');});}if(_0x5cbd11[_0x8488('0x47')]['filter']){var _0x28468b=_0x5cbd11[_0x8488('0x47')]['filter']['replace']('\x5c','\x5c\x5c')[_0x8488('0x8d')]('\x27\x27',_0x8488('0x8e'));if(qs['isNumeric'](_0x28468b)){_0x137f50['or'](_0x8488('0x8f'),_0x28468b+'%');}else{_0x137f50['or'](_0x8488('0x90'),qs['getFullTextValue'](_0x28468b))['or']('CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?',_0x28468b+'%');}}}_0x3eb06e[_0x8488('0x50')](_0x137f50);_0x3eb06e['group'](_0x8488('0x91'));var _0x202d16={'type':db[_0x8488('0x1c')][_0x8488('0x92')]['SELECT'],'raw':!![]};var _0xde3227=_0x3eb06e['clone']();_0xde3227[_0x8488('0x52')]('i.id');_0xde3227[_0x8488('0x52')](_0x8488('0x93'),_0x8488('0x68'));if(_0x4023ac[_0x8488('0x4e')]){_0x4023ac[_0x8488('0x4e')][_0x8488('0x3e')](function(_0x784d23){_0x3eb06e[_0x8488('0x4e')]('i.'+_0x784d23[0x0],_0x784d23[0x1]===_0x8488('0x94')?![]:!![]);});}if(!_[_0x8488('0x95')](_0x5da71e)){_0x3eb06e[_0x8488('0x6a')](_0x342188);_0xde3227[_0x8488('0x50')](_0x8488('0x96'),_0x5da71e);}BPromise[_0x8488('0x97')]()['then'](function(){if(!_0x304ceb){if(_0x5cbd11[_0x8488('0x47')][_0x8488('0x7e')]||_0x5cbd11['query'][_0x8488('0x98')])return;_0xde3227[_0x8488('0x50')](_0x8488('0x99'));_0x3eb06e[_0x8488('0x50')](_0x8488('0x99'));return;}return _0x5cbd11[_0x8488('0x9a')][_0x8488('0x9b')]({'attributes':['id'],'raw':!![]})[_0x8488('0x20')](function(_0x8682a5){if(_[_0x8488('0x95')](_0x8682a5)){_0xde3227[_0x8488('0x50')]('i.ChatWebsiteId\x20IS\x20NULL');_0x3eb06e[_0x8488('0x50')](_0x8488('0x9c'));}else{_0xde3227['where'](_0x8488('0x7f'),_[_0x8488('0x3a')](_0x8682a5,'id'));_0x3eb06e[_0x8488('0x50')](_0x8488('0x7f'),_[_0x8488('0x3a')](_0x8682a5,'id'));}});})['then'](function(){db['sequelize'][_0x8488('0x47')](_0xde3227[_0x8488('0x9d')](),_0x202d16)[_0x8488('0x20')](function(_0x244a2b){_0x25ef13[_0x8488('0x2e')]=_0x244a2b[_0x8488('0x67')];if(_0x25ef13[_0x8488('0x2e')]===0x0)return[];return db[_0x8488('0x9e')][_0x8488('0x47')](_0x45bd4b[_0x8488('0x9d')](),_0x202d16)[_0x8488('0x20')](function(_0xb045bc){_0x3749da=_[_0x8488('0x9f')](_0xb045bc,'id');_0x202d16=_[_0x8488('0xa0')](_0x202d16,{'model':db[_0x8488('0x42')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x5cbd11['query'][_0x8488('0x4c')]){_0x4023ac['attributes']['forEach'](function(_0x1e25a3){_0x3eb06e[_0x8488('0x52')]('i.'+_0x1e25a3);});}else{_0x3eb06e[_0x8488('0x52')](_0x8488('0x93'),_0x8488('0x68'));_0x3eb06e[_0x8488('0x52')](_0x8488('0xa1'),_0x8488('0xa2'));_0x3eb06e[_0x8488('0x52')](_0x8488('0xa3'),'Account.mandatoryDisposition');_0x3eb06e[_0x8488('0x52')](_0x8488('0xa4'));_0x3eb06e[_0x8488('0x52')](_0x8488('0xa5'),_0x8488('0xa6'));_0x3eb06e[_0x8488('0x52')]('c.lastName',_0x8488('0xa7'));_0x3eb06e['field'](_0x8488('0xa8'),_0x8488('0xa9'));_0x3eb06e['field']('c.phone',_0x8488('0xaa'));_0x3eb06e[_0x8488('0x52')](_0x8488('0xab'),_0x8488('0xac'));_0x3eb06e[_0x8488('0x52')]('c.fax',_0x8488('0xad'));_0x3eb06e[_0x8488('0x52')]('o.fullname','Owner.fullname');_0x3eb06e[_0x8488('0x52')](_0x8488('0xae'),_0x8488('0xaf'));_0x3eb06e['field']('GROUP_CONCAT(DISTINCT\x20t.id)',_0x8488('0x3c'));}if(_0x4023ac[_0x8488('0x30')])_0x3eb06e[_0x8488('0x30')](_0x4023ac['limit']);if(_0x4023ac[_0x8488('0x2f')])_0x3eb06e[_0x8488('0x2f')](_0x4023ac[_0x8488('0x2f')]);return db[_0x8488('0x9e')][_0x8488('0x47')](_0x3eb06e[_0x8488('0x9d')](),_0x202d16);})[_0x8488('0x20')](function(_0x1c8f5d){_0x51d1eb[_0x8488('0x50')](_0x8488('0xb0'),_[_0x8488('0x3a')](_0x1c8f5d,'id'));return db[_0x8488('0x9e')][_0x8488('0x47')](_0x51d1eb['toString'](),_0x202d16)[_0x8488('0x20')](function(_0x1445c7){var _0x248175=_['groupBy'](_0x1445c7,_0x8488('0xb1'));var _0x546a25=[];_0x1c8f5d[_0x8488('0x3e')](function(_0x52fe9f){_0x546a25['push'](updateChatInteraction(_0x52fe9f,_0x3749da,_0x248175));});return BPromise[_0x8488('0xb2')](_0x546a25);});});})['then'](function(_0x42f36b){_0x25ef13[_0x8488('0xb3')]=_0x42f36b;return _0x25ef13;})[_0x8488('0x20')](respondWithFilteredResult(_0x22a3f3,_0x4023ac));})[_0x8488('0x29')](handleError(_0x22a3f3,null));};exports['show']=function(_0x391e86,_0x450afa){var _0x477a86={'raw':![],'where':{'id':_0x391e86['params']['id']}},_0x37ca73={};_0x37ca73[_0x8488('0x46')]=_[_0x8488('0x48')](db[_0x8488('0x42')][_0x8488('0xb4')]);_0x37ca73[_0x8488('0x47')]=_['keys'](_0x391e86['query']);_0x37ca73[_0x8488('0x49')]=_[_0x8488('0x4a')](_0x37ca73[_0x8488('0x46')],_0x37ca73[_0x8488('0x47')]);_0x477a86[_0x8488('0x4b')]=_['intersection'](_0x37ca73['model'],qs['fields'](_0x391e86[_0x8488('0x47')][_0x8488('0x4c')]));_0x477a86[_0x8488('0x4b')]=_0x477a86['attributes'][_0x8488('0x67')]?_0x477a86[_0x8488('0x4b')]:_0x37ca73['model'];if(_0x391e86[_0x8488('0x47')][_0x8488('0xb5')]){_0x477a86[_0x8488('0xb6')]=[{'all':!![]}];}_0x477a86=_[_0x8488('0xa0')]({},_0x477a86,_0x391e86[_0x8488('0xb7')]);return db[_0x8488('0x42')][_0x8488('0x79')](_0x477a86)[_0x8488('0x20')](handleEntityNotFound(_0x450afa,null))[_0x8488('0x20')](respondWithResult(_0x450afa,null))[_0x8488('0x29')](handleError(_0x450afa,null));};exports[_0x8488('0xb8')]=function(_0x13add2,_0xa0c692){return db['ChatInteraction'][_0x8488('0xb8')](_0x13add2[_0x8488('0xb9')],{})['then'](respondWithResult(_0xa0c692,0xc9))['catch'](handleError(_0xa0c692,null));};exports['update']=function(_0x5e60cb,_0x14ff09){if(_0x5e60cb[_0x8488('0xb9')]['id']){delete _0x5e60cb['body']['id'];}return db[_0x8488('0x42')]['find']({'where':{'id':_0x5e60cb[_0x8488('0xba')]['id']}})[_0x8488('0x20')](handleEntityNotFound(_0x14ff09,null))[_0x8488('0x20')](saveUpdates(_0x5e60cb[_0x8488('0xb9')],null))[_0x8488('0x20')](respondWithResult(_0x14ff09,null))['catch'](handleError(_0x14ff09,null));};exports[_0x8488('0x36')]=function(_0x27c233,_0x41e251){return db[_0x8488('0x42')]['find']({'where':{'id':_0x27c233['params']['id']}})[_0x8488('0x20')](handleEntityNotFound(_0x41e251,null))[_0x8488('0x20')](removeEntity(_0x41e251,null))[_0x8488('0x29')](handleError(_0x41e251,null));};exports[_0x8488('0xbb')]=function(_0x2f8191,_0x14b32b){return db[_0x8488('0x42')][_0x8488('0xbb')]()[_0x8488('0x20')](respondWithResult(_0x14b32b,null))[_0x8488('0x29')](handleError(_0x14b32b,null));};exports[_0x8488('0xbc')]=function(_0x1e7617,_0x315136){var _0x193a96=_0x1e7617['params']['id'];var _0x556b9b;var _0x2c20e9;var _0x312a32;return db[_0x8488('0x42')][_0x8488('0xbd')]({'where':{'id':_0x193a96}})[_0x8488('0x20')](function(_0x22f2de){_0x556b9b=_0x22f2de;return db[_0x8488('0xbe')][_0x8488('0xbd')]({'where':{'id':_0x22f2de[_0x8488('0x7e')]},'attributes':['id','vidaooApiKey',_0x8488('0xbf')],'raw':!![]});})[_0x8488('0x20')](function(_0x2d7d0b){if(_0x2d7d0b&&_0x2d7d0b['vidaooApiKey']&&_0x2d7d0b[_0x8488('0xbf')]){_0x2c20e9=_0x2d7d0b;var _0x3a5ce0={'rejectUnauthorized':![],'method':_0x8488('0xc0'),'uri':_0x8488('0xc1'),'headers':{'X-APIKEY':_0x2d7d0b[_0x8488('0xc2')]},'body':{'name':_0x8488('0xc3')+_0x193a96},'redirect':_0x8488('0xc4'),'json':!![]};return rp(_0x3a5ce0);}else{throw new db[(_0x8488('0x1c'))]['ValidationError']('Error\x20in\x20Vidaoo\x20configuration');}})[_0x8488('0x20')](function(_0x215d7e){_0x312a32=_0x215d7e;if(_0x312a32['id']){var _0x257a1b={'body':_0x312a32[_0x8488('0xc5')],'ChatWebsiteId':_0x2c20e9['id'],'ChatInteractionId':_0x556b9b['id'],'direction':_0x8488('0xc6'),'UserId':_0x1e7617[_0x8488('0x9a')]['id']};return db[_0x8488('0xc7')]['create'](_0x257a1b,{});}else{throw new db[(_0x8488('0x1c'))]['ValidationError'](_0x8488('0xc8'));}})[_0x8488('0x20')](function(){return _0x556b9b[_0x8488('0xc9')]({'vidaooSessionId':_0x312a32['id']});})[_0x8488('0x20')](respondWithResult(_0x315136,null))[_0x8488('0x29')](handleError(_0x315136,null));};exports['customUpdate']=function(_0x27add0,_0x319fa8){if(_0x27add0[_0x8488('0xb9')]['id']){delete _0x27add0[_0x8488('0xb9')]['id'];}return db[_0x8488('0x42')][_0x8488('0x79')]({'where':{'id':_0x27add0[_0x8488('0xba')]['id']}})['then'](handleEntityNotFound(_0x319fa8,null))[_0x8488('0x20')](saveUpdates(_0x27add0['body'],null))['then'](respondWithResult(_0x319fa8,null))[_0x8488('0x29')](handleError(_0x319fa8,null));};exports[_0x8488('0xca')]=function(_0x5da38e,_0x47633f,_0x2ba4ba){if(_0x5da38e[_0x8488('0xb9')]['id']){delete _0x5da38e[_0x8488('0xb9')]['id'];}return db[_0x8488('0x42')]['find']({'where':{'id':_0x5da38e['params']['id']}})[_0x8488('0x20')](function(_0x1c4b86){if(!_0x1c4b86){logger[_0x8488('0x25')](_0x8488('0xcb'),_0x8488('0xca'),0x194,'entity\x20not\x20found');_0x47633f['sendStatus'](0x194);}else{if(_0x1c4b86[_0x8488('0x7a')]){throw new db[(_0x8488('0x1c'))][(_0x8488('0x1d'))](_0x8488('0xcc'));}}return _0x1c4b86;})[_0x8488('0x20')](function(_0x1a2b0d){if(_0x1a2b0d){return _0x1a2b0d[_0x8488('0x35')]({'closed':_0x5da38e[_0x8488('0xb9')][_0x8488('0xcd')],'disposition':_0x5da38e[_0x8488('0xb9')][_0x8488('0xce')]})[_0x8488('0x20')](function(_0x327051){return _0x327051;});}})[_0x8488('0x20')](function(_0x4a3c76){return respondWithRpcPromise(_0x8488('0xcf'),_0x8488('0xca'),_0x5da38e[_0x8488('0xb9')],client9004);})['then'](respondWithResult(_0x47633f,null))[_0x8488('0x29')](handleError(_0x47633f,null));};exports[_0x8488('0xd0')]=function(_0x24c5ed,_0x4ef936,_0x62adfe){_0x24c5ed[_0x8488('0xb9')]['name']=_0x24c5ed[_0x8488('0xd1')][_0x8488('0xd2')];_0x24c5ed['body'][_0x8488('0xd3')]=_0x24c5ed[_0x8488('0xd1')][_0x8488('0xd4')];_0x24c5ed[_0x8488('0xb9')][_0x8488('0x44')]=_0x24c5ed[_0x8488('0xd1')][_0x8488('0xd5')];return db[_0x8488('0xd6')][_0x8488('0xb8')](_0x24c5ed[_0x8488('0xb9')])['then'](respondWithResult(_0x4ef936,0xc9))[_0x8488('0x29')](handleError(_0x4ef936,null));};exports[_0x8488('0xd7')]=function(_0x52e72a,_0x230e13,_0x54bed4){return db[_0x8488('0x42')][_0x8488('0xbd')]({'where':{'id':_0x52e72a[_0x8488('0xba')]['id']},'raw':!![]})[_0x8488('0x20')](handleEntityNotFound(_0x230e13,null))[_0x8488('0x20')](function(_0x2c587f){if(_0x2c587f){if(_0x2c587f['closed']){return _0x230e13[_0x8488('0x2c')](0x193)['json']({'status':0x193,'message':'Unauthorized'});}return db[_0x8488('0xd6')][_0x8488('0xbd')]({'where':{'id':_0x52e72a[_0x8488('0x47')][_0x8488('0xd8')]},'raw':!![]})['then'](handleEntityNotFound(_0x230e13,null));}})['then'](function(_0x52749d){if(_0x52749d){return _0x230e13['download'](path[_0x8488('0xd9')](config[_0x8488('0xda')],_0x8488('0xdb'),_0x52749d[_0x8488('0xd3')]));}})[_0x8488('0x29')](handleError(_0x230e13,null));};exports['close']=function(_0x1f5299,_0x939646){var _0x42b9b7=null;var _0x491c3c=null;var _0x50b45f=null;var _0x1f8fb1=null;if(_0x1f5299[_0x8488('0xb9')]['id']){delete _0x1f5299['body']['id'];}if(_0x1f5299['body'][_0x8488('0xdc')]){_0x1f8fb1=path[_0x8488('0xd9')](config[_0x8488('0xda')],_0x8488('0xdd'),util[_0x8488('0xde')](_0x8488('0xdf'),Date[_0x8488('0xe0')]()));_0x1f5299[_0x8488('0xb9')][_0x8488('0xe1')]=_0x1f8fb1;}return db[_0x8488('0x42')][_0x8488('0x79')]({'where':{'id':_0x1f5299[_0x8488('0xba')]['id']},'include':[{'model':db[_0x8488('0xc7')],'as':_0x8488('0xe2'),'include':[{'model':db[_0x8488('0x77')],'as':_0x8488('0x77')}]}]})[_0x8488('0x20')](handleEntityNotFound(_0x939646,null))['then'](saveUpdates(_0x1f5299[_0x8488('0xb9')],null))[_0x8488('0x20')](function(_0xddf093){if(_0xddf093){_0x42b9b7=_0xddf093;return db['ChatWebsite'][_0x8488('0x79')]({'where':{'id':_0x42b9b7[_0x8488('0x7e')]}});}})[_0x8488('0x20')](function(_0x674d19){if(_0x674d19){_0x50b45f=_0x674d19;return db['CmContact'][_0x8488('0x79')]({'where':{'id':_0x42b9b7['ContactId']}});}})[_0x8488('0x20')](function(_0x391b98){if(_0x391b98){_0x491c3c=_0x391b98;if(_0x1f8fb1){var _0x5b2721=null;for(var _0x388871=0x1;_0x388871<_0x42b9b7[_0x8488('0xe2')][_0x8488('0x67')];++_0x388871){_0x5b2721=_0x42b9b7[_0x8488('0xe2')][_0x388871];var _0x3cd626=_0x5b2721[_0x8488('0x7a')]?util['format']('%s%d',_0x50b45f[_0x8488('0xe3')],_0x5b2721[_0x8488('0x7a')]):_0x8488('0xe4');var _0x2628ba=_0x1f5299[_0x8488('0xb9')]['customer']||util['format'](_0x8488('0xe5'),'Visitor',_0x5b2721[_0x8488('0x72')]);switch(_0x50b45f[_0x8488('0xe6')]){case'website_alias':_0x3cd626=_0x5b2721['UserId']?util[_0x8488('0xde')](_0x8488('0xe5'),_0x50b45f['agentAlias'],_0x5b2721[_0x8488('0x7a')]):'System';break;case'agent_alias':_0x3cd626=_0x5b2721[_0x8488('0x7a')]?_0x5b2721[_0x8488('0x77')][_0x8488('0xe7')]||_0x5b2721['User'][_0x8488('0x3b')]:_0x8488('0xe4');break;case _0x8488('0xe8'):_0x3cd626=_0x5b2721[_0x8488('0x7a')]?_0x5b2721['User'][_0x8488('0x3b')]:_0x8488('0xe4');break;default:_0x3cd626=_0x5b2721[_0x8488('0x7a')]?util[_0x8488('0xde')](_0x8488('0xe5'),_0x50b45f[_0x8488('0xe3')],_0x5b2721[_0x8488('0x7a')]):_0x8488('0xe4');}var _0x201a91=util[_0x8488('0xde')](_0x8488('0xe9'),moment(_0x5b2721['createdAt'])['format']('MM/DD/YYYY\x20HH:mm:ss'),_0x5b2721[_0x8488('0xea')]==='in'?_0x2628ba:_0x3cd626,_0x5b2721['body']);if(!_0x5b2721[_0x8488('0xeb')]){fs['appendFileSync'](_0x1f8fb1,_0x201a91);}}return db[_0x8488('0xec')][_0x8488('0xbd')]({'where':{'service':!![]},'include':[{'model':db[_0x8488('0xed')],'as':_0x8488('0xee'),'raw':!![]}]});}}})['then'](function(_0x4957f0){if(_0x4957f0&&_0x4957f0[_0x8488('0xee')]&&_0x1f5299['body']){var _0x9eebf6={'tls':{'rejectUnauthorized':![]}};if(_0x4957f0['Smtp'][_0x8488('0xef')]){_0x9eebf6[_0x8488('0xef')]=_0x4957f0['Smtp'][_0x8488('0xef')];}else{_0x9eebf6[_0x8488('0xf0')]=_0x4957f0[_0x8488('0xee')][_0x8488('0xf0')];_0x9eebf6[_0x8488('0xf1')]=_0x4957f0[_0x8488('0xee')][_0x8488('0xf1')];_0x9eebf6[_0x8488('0xf2')]=_0x4957f0[_0x8488('0xee')][_0x8488('0xf2')];}if(_0x4957f0[_0x8488('0xee')][_0x8488('0xf3')]){_0x9eebf6['auth']={'user':_0x4957f0[_0x8488('0xee')][_0x8488('0x9a')],'pass':_0x4957f0[_0x8488('0xee')]['pass']};}return respondWithRpcPromise(_0x8488('0xf4'),'sendMail',{'account':_0x9eebf6,'message':{'from':util[_0x8488('0xde')](_0x8488('0xf5'),_0x4957f0[_0x8488('0x38')],_0x4957f0['email']||_0x4957f0['Smtp'][_0x8488('0x9a')]),'to':_0x1f5299[_0x8488('0xb9')][_0x8488('0xdc')],'subject':_0x8488('0xf6'),'text':util[_0x8488('0xde')]('Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a',_0x1f5299['body']['mailTranscript']),'attachments':[{'path':_0x1f8fb1}]}})[_0x8488('0x20')](function(){return _0x42b9b7;})[_0x8488('0x29')](function(_0x2c0ae1){console[_0x8488('0x25')](_0x2c0ae1);});}else{return _0x42b9b7;}})['then'](respondWithStatusCode(_0x939646,0xc8))[_0x8488('0x29')](handleError(_0x939646,null));};exports[_0x8488('0xf7')]=function(_0xa358dc,_0x5be3e5,_0xab367e){return db['ChatMessage'][_0x8488('0x79')]({'where':{'id':_0xa358dc[_0x8488('0xba')]['id']}})[_0x8488('0x20')](handleEntityNotFound(_0x5be3e5,null))[_0x8488('0x20')](function(_0x59b90a){if(_0x59b90a){return _0x59b90a[_0x8488('0xf7')](_0xa358dc['body']['ids'],_[_0x8488('0xf8')](_0xa358dc[_0x8488('0xb9')],['ids','id'])||{});}})[_0x8488('0x20')](respondWithResult(_0x5be3e5,null))['catch'](handleError(_0x5be3e5,null));};exports[_0x8488('0xf9')]=function(_0x1c1375,_0x5dbd0c,_0x4e5c26){var _0x1e98c8={'raw':![],'where':{}};var _0x184265={};var _0x3bd2cb={'count':0x0,'rows':[]};return db[_0x8488('0x42')]['findOne']({'where':{'id':_0x1c1375[_0x8488('0xba')]['id']}})[_0x8488('0x20')](handleEntityNotFound(_0x5dbd0c,null))[_0x8488('0x20')](function(_0x5da39c){if(_0x5da39c){_0x184265[_0x8488('0x46')]=_[_0x8488('0x48')](db['ChatMessage'][_0x8488('0xb4')]);_0x184265[_0x8488('0x47')]=_[_0x8488('0x48')](_0x1c1375['query']);_0x184265[_0x8488('0x49')]=_[_0x8488('0x4a')](_0x184265[_0x8488('0x46')],_0x184265[_0x8488('0x47')]);_0x1e98c8[_0x8488('0x4b')]=_['intersection'](_0x184265[_0x8488('0x46')],qs[_0x8488('0x4c')](_0x1c1375[_0x8488('0x47')][_0x8488('0x4c')]));_0x1e98c8['attributes']=_0x1e98c8['attributes'][_0x8488('0x67')]?_0x1e98c8['attributes']:_0x184265[_0x8488('0x46')];if(!_0x1c1375['query'][_0x8488('0x4d')](_0x8488('0xfa'))){_0x1e98c8['limit']=qs['limit'](_0x1c1375['query'][_0x8488('0x30')]);_0x1e98c8[_0x8488('0x2f')]=qs[_0x8488('0x2f')](_0x1c1375['query'][_0x8488('0x2f')]);}_0x1e98c8[_0x8488('0x4e')]=qs[_0x8488('0x4f')](_0x1c1375[_0x8488('0x47')][_0x8488('0x4f')]);_0x1e98c8[_0x8488('0x50')]=qs[_0x8488('0x49')](_[_0x8488('0xfb')](_0x1c1375['query'],_0x184265[_0x8488('0x49')]));_0x1e98c8['where'][_0x8488('0xb1')]=_0x5da39c['id'];if(_0x1c1375['query'][_0x8488('0xfc')]){_0x1e98c8['where']=_['merge'](_0x1e98c8[_0x8488('0x50')],{'$or':_['map'](_0x1e98c8[_0x8488('0x4b')],function(_0x582b7d){var _0x358868={};_0x358868[_0x582b7d]={'$like':'%'+_0x1c1375['query']['filter']+'%'};return _0x358868;})});}if(_0x1c1375['query'][_0x8488('0xfd')]){var _0x5807e9=_0x1c1375[_0x8488('0x47')][_0x8488('0xfd')][_0x8488('0x3d')](',');var _0x1d3714={};_0x1d3714[_0x5807e9[0x0]]={'$gte':moment(_0x5807e9[0x1])[_0x8488('0xde')](_0x8488('0xfe'))};_0x1e98c8['where']=_[_0x8488('0xa0')](_0x1e98c8['where'],_0x1d3714);}_0x1e98c8=_[_0x8488('0xa0')]({},_0x1e98c8,_0x1c1375[_0x8488('0xb7')]);return db[_0x8488('0xc7')][_0x8488('0x2e')]({'where':_0x1e98c8[_0x8488('0x50')]})['then'](function(_0x7c86dd){_0x3bd2cb['count']=_0x7c86dd;if(_0x1c1375['query'][_0x8488('0xb5')]){_0x1e98c8['include']=[{'all':!![]}];}return db[_0x8488('0xc7')][_0x8488('0xff')](_0x1e98c8);})[_0x8488('0x20')](function(_0x3abbe0){_0x3bd2cb[_0x8488('0xb3')]=_0x3abbe0;return _0x3bd2cb;});}})[_0x8488('0x20')](respondWithFilteredResult(_0x5dbd0c,_0x1e98c8))[_0x8488('0x29')](handleError(_0x5dbd0c,null));};exports[_0x8488('0x100')]=function(_0x5d287f,_0x29ea4b,_0xab7ae3){var _0x42295c={'where':{}},_0x51ca92={},_0x554d9a={'count':0x0,'rows':[]};return db[_0x8488('0x42')][_0x8488('0xbd')]({'where':{'id':_0x5d287f[_0x8488('0xba')]['id']}})[_0x8488('0x20')](handleEntityNotFound(_0x29ea4b,null))[_0x8488('0x20')](function(_0x21e76e){if(_0x21e76e){_0x51ca92[_0x8488('0x46')]=_[_0x8488('0x48')](db[_0x8488('0xc7')][_0x8488('0xb4')]);_0x51ca92[_0x8488('0x47')]=_[_0x8488('0x48')](_0x5d287f[_0x8488('0x47')]);_0x51ca92['filters']=_[_0x8488('0x4a')](_0x51ca92[_0x8488('0x46')],_0x51ca92[_0x8488('0x47')]);_0x42295c[_0x8488('0x4b')]=_[_0x8488('0x4a')](_0x51ca92['model'],qs['fields'](_0x5d287f[_0x8488('0x47')][_0x8488('0x4c')]));_0x42295c[_0x8488('0x4b')]=_0x42295c['attributes'][_0x8488('0x67')]?_0x42295c[_0x8488('0x4b')]:_0x51ca92[_0x8488('0x46')];if(!_0x5d287f[_0x8488('0x47')][_0x8488('0x4d')](_0x8488('0xfa'))){_0x42295c[_0x8488('0x30')]=qs[_0x8488('0x30')](_0x5d287f[_0x8488('0x47')][_0x8488('0x30')]);_0x42295c[_0x8488('0x2f')]=qs[_0x8488('0x2f')](_0x5d287f[_0x8488('0x47')][_0x8488('0x2f')]);}_0x42295c[_0x8488('0x4e')]=qs[_0x8488('0x4f')](_0x5d287f[_0x8488('0x47')][_0x8488('0x4f')]);_0x42295c[_0x8488('0x50')]=qs[_0x8488('0x49')](_[_0x8488('0xfb')](_0x5d287f[_0x8488('0x47')],_0x51ca92['filters']));_0x42295c['where'][_0x8488('0xb1')]=_0x21e76e['id'];if(_0x5d287f[_0x8488('0x47')][_0x8488('0xfc')]){_0x42295c[_0x8488('0x50')]=_[_0x8488('0xa0')](_0x42295c['where'],{'$or':_[_0x8488('0x3a')](_0x42295c[_0x8488('0x4b')],function(_0x2f96cb){var _0x379b81={};_0x379b81[_0x2f96cb]={'$like':'%'+_0x5d287f[_0x8488('0x47')][_0x8488('0xfc')]+'%'};return _0x379b81;})});}_0x42295c[_0x8488('0x50')][_0x8488('0xeb')]=![];if(_0x5d287f['query']['id']){_0x42295c[_0x8488('0x50')]['id']={'$gt':_0x5d287f[_0x8488('0x47')]['id']};}_0x42295c=_[_0x8488('0xa0')]({},_0x42295c,_0x5d287f[_0x8488('0xb7')]);return db[_0x8488('0xc7')][_0x8488('0x2e')]({'where':_0x42295c[_0x8488('0x50')]})['then'](function(_0x24ff97){_0x554d9a[_0x8488('0x2e')]=_0x24ff97;_0x42295c[_0x8488('0xb6')]=[];if(_0x5d287f[_0x8488('0x47')][_0x8488('0x101')]){_0x42295c[_0x8488('0xb6')][_0x8488('0x40')]({'model':db[_0x8488('0x77')],'as':'User','attributes':['id',_0x8488('0x3b'),_0x8488('0xe7')]});}if(_0x5d287f[_0x8488('0x47')][_0x8488('0xb5')]){_0x42295c[_0x8488('0xb6')]=[{'all':!![]}];}return db[_0x8488('0xc7')][_0x8488('0xff')](_0x42295c);})[_0x8488('0x20')](function(_0x32bd5f){_0x554d9a[_0x8488('0xb3')]=_0x32bd5f;return _0x554d9a;});}})[_0x8488('0x20')](respondWithFilteredResult(_0x29ea4b,_0x42295c))['catch'](handleError(_0x29ea4b,null));};exports[_0x8488('0x102')]=function(_0x5608c4,_0x5d3b8d,_0x51f315){return db[_0x8488('0x42')]['find']({'where':{'id':_0x5608c4['params']['id']}})['then'](handleEntityNotFound(_0x5d3b8d,null))[_0x8488('0x20')](function(_0x3f9240){if(_0x3f9240){return _0x3f9240['setTags'](_0x5608c4[_0x8488('0xb9')]['ids'],_['omit'](_0x5608c4['body'],[_0x8488('0x103'),'id'])||{})[_0x8488('0x104')](function(){return db['Tag']['findAll']({'attributes':['id',_0x8488('0x38'),_0x8488('0x105')],'where':{'id':_0x5608c4[_0x8488('0xb9')]['ids']}});})[_0x8488('0x20')](function(_0x3377ae){socket[_0x8488('0x106')](_0x8488('0x107'),{'id':Number(_0x5608c4[_0x8488('0xba')]['id']),'tags':_0x3377ae||[]});return{'id':Number(_0x5608c4['params']['id']),'tags':_0x3377ae||[]};});}})[_0x8488('0x20')](respondWithResult(_0x5d3b8d,null))[_0x8488('0x29')](handleError(_0x5d3b8d,null));};exports[_0x8488('0x108')]=function(_0x1aa9de,_0x190c7a,_0x524c83){return db['ChatInteraction'][_0x8488('0x79')]({'where':{'id':_0x1aa9de[_0x8488('0xba')]['id']}})[_0x8488('0x20')](handleEntityNotFound(_0x190c7a,null))['then'](function(_0x5c0461){if(_0x5c0461){return _0x5c0461['removeTags'](_0x1aa9de[_0x8488('0x47')][_0x8488('0x103')]);}})[_0x8488('0x20')](respondWithStatusCode(_0x190c7a,null))['catch'](handleError(_0x190c7a,null));};exports[_0x8488('0x109')]=function(_0x5d038c,_0x42afd4){var _0x54e484=moment()[_0x8488('0x10a')]()['toString']();var _0x42367d=path[_0x8488('0xd9')](config[_0x8488('0xda')],_0x8488('0x10b'),'files',_0x8488('0x10c'));var _0x49d626=path[_0x8488('0xd9')](config[_0x8488('0xda')],_0x8488('0x10b'),_0x8488('0x10d'),_0x8488('0x10e'));var _0x33e945=path[_0x8488('0xd9')](_0x42367d,_0x54e484);var _0x116d17=util['format'](_0x8488('0x10f'),_0x5d038c['params']['id'],_0x54e484);var _0x2370fd=path['join'](_0x42367d,_0x116d17);var _0x21d61a=[];_0x21d61a[_0x8488('0x40')]({'model':db[_0x8488('0x77')],'as':'User','attributes':['id',_0x8488('0x3b')],'raw':!![]});_0x21d61a[_0x8488('0x40')]({'model':db[_0x8488('0x110')],'as':_0x8488('0x6c'),'attributes':['id',_0x8488('0x111'),_0x8488('0x112')],'raw':!![]});if(_0x5d038c[_0x8488('0x47')]['attachments']){_0x21d61a[_0x8488('0x40')]({'model':db[_0x8488('0xd6')],'as':_0x8488('0xd6'),'raw':!![]});}var _0x1aef84=[{'model':db[_0x8488('0xc7')],'as':'Messages','attributes':['id',_0x8488('0xb9'),_0x8488('0x81'),_0x8488('0xea'),'secret',_0x8488('0x87')],'include':_0x21d61a}];_0x1aef84['push']({'model':db['ChatWebsite'],'as':_0x8488('0x113'),'attributes':['id',_0x8488('0x38')]});_0x1aef84[_0x8488('0x40')]({'model':db[_0x8488('0x77')],'as':_0x8488('0x114'),'attributes':['id',_0x8488('0x3b')]});return db['ChatInteraction']['find']({'where':{'id':_0x5d038c[_0x8488('0xba')]['id']},'include':_0x1aef84})[_0x8488('0x20')](handleEntityNotFound(_0x42afd4,null))[_0x8488('0x20')](function(_0x47edf8){if(_0x47edf8){var _0x1dc04e=_0x47edf8[_0x8488('0x115')]({'plain':!![]});fs[_0x8488('0x116')](_0x33e945);var _0x22749f={'format':'A4','border':'10px','header':{'height':_0x8488('0x117'),'contents':{'first':_0x8488('0x118')}},'footer':{'height':_0x8488('0x119'),'contents':{'default':util[_0x8488('0xde')](_0x8488('0x11a'),util['format']('%s\x20#%d',_0x8488('0x11b'),_0x1dc04e['id']),moment()['format'](_0x8488('0x11c'))[_0x8488('0x9d')]())}}};var _0x33f830={'channel':'Chat','account':_0x1dc04e[_0x8488('0x113')][_0x8488('0x38')],'agent':_0x1dc04e['Owner']?_0x1dc04e[_0x8488('0x114')][_0x8488('0x3b')]:'N.A.','createdAt':moment(_0x1dc04e[_0x8488('0x81')])[_0x8488('0xde')]('YYYY-MM-DD\x20HH:mm:ss')['toString'](),'closedAt':_0x1dc04e['closed']?moment(_0x1dc04e[_0x8488('0x11d')])[_0x8488('0xde')]('YYYY-MM-DD\x20HH:mm:ss')['toString']():'','disposition':_0x1dc04e[_0x8488('0xce')],'chatInfo':{'browser':_0x1dc04e[_0x8488('0x11e')],'os':_0x1dc04e[_0x8488('0x11f')],'referer':_0x1dc04e[_0x8488('0x120')],'customerIp':_0x1dc04e[_0x8488('0x121')],'customerPort':_0x1dc04e['customerPort']?_0x1dc04e[_0x8488('0x122')]:_0x8488('0x123')},'messages':_(_0x1dc04e[_0x8488('0xe2')])['tail']()['filter']({'secret':![]})[_0x8488('0x3a')](function(_0x34bcaa){if(_0x34bcaa[_0x8488('0xd6')]){var _0x520188=path[_0x8488('0xd9')](_0x49d626,_0x34bcaa[_0x8488('0xd6')][_0x8488('0xd3')]);if(fs[_0x8488('0x124')](_0x520188)){fs[_0x8488('0x125')](_0x520188)['pipe'](fs[_0x8488('0x126')](path[_0x8488('0xd9')](_0x33e945,_0x34bcaa['Attachment'][_0x8488('0xd3')])));}}return{'date':moment(_0x34bcaa['createdAt'])[_0x8488('0xde')](_0x8488('0xfe'))[_0x8488('0x9d')](),'sender':_0x34bcaa['direction']===_0x8488('0xc6')?_0x34bcaa[_0x8488('0x77')]?_0x34bcaa['User'][_0x8488('0x3b')]:_0x8488('0xe4'):_0x34bcaa['Contact'][_0x8488('0x111')]+(_0x34bcaa['Contact'][_0x8488('0x112')]?'\x20'+_0x34bcaa[_0x8488('0x6c')][_0x8488('0x112')]:''),'body':_0x34bcaa[_0x8488('0xd6')]?_0x34bcaa[_0x8488('0xd6')]['basename']:_0x34bcaa[_0x8488('0xb9')],'direction':_0x34bcaa['direction']==='out'?'A':'C','secret':_0x34bcaa['secret'],'read':_0x34bcaa[_0x8488('0x87')],'attachment':_0x34bcaa['Attachment']};})[_0x8488('0x69')]()};return ejs[_0x8488('0x127')](path[_0x8488('0xd9')](config[_0x8488('0xda')],_0x8488('0x10b'),'views',_0x8488('0x128')),{'interaction':_0x33f830})[_0x8488('0x20')](function(_0x407cd5){return new BPromise(function(_0x6a3925,_0x4d1227){pdf[_0x8488('0xb8')](_0x407cd5,_0x22749f)['toFile'](path[_0x8488('0xd9')](_0x33e945,_0x8488('0x129')+_0x1dc04e['id']+'-'+_0x54e484+_0x8488('0x12a')),function(_0x358f95,_0x520c5a){if(_0x358f95)return _0x4d1227(_0x358f95);_0x6a3925(_0x520c5a);});});})[_0x8488('0x20')](function(){return new BPromise(function(_0x5baaa5,_0x34a5e4){zipdir(_0x33e945,{'saveTo':_0x2370fd},function(_0x22efdd,_0x4b3081){if(_0x22efdd)return _0x34a5e4(_0x22efdd);return _0x5baaa5(_0x4b3081);});})[_0x8488('0x20')](function(){return new BPromise(function(_0xf8bfa8,_0x3cf327){rimraf(_0x33e945,function(_0x3c4b4d){if(_0x3c4b4d)_0x3cf327(_0x3c4b4d);return _0xf8bfa8();});});})['then'](function(){return _0x42afd4[_0x8488('0x109')](_0x2370fd,_0x116d17,function(_0x337cac){if(_0x337cac){console[_0x8488('0x12b')](_0x8488('0x12c'),_0x337cac);}else{fs[_0x8488('0x12d')](_0x2370fd);}});});});}else{return _0x42afd4[_0x8488('0x2b')](0xc8);}})['catch'](handleError(_0x42afd4,null));};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.events.js b/server/api/chatInteraction/chatInteraction.events.js
index c6f0499..f1bca61 100644
--- a/server/api/chatInteraction/chatInteraction.events.js
+++ b/server/api/chatInteraction/chatInteraction.events.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x0fcf=['hook','exports','events','ChatInteraction','../../mysqldb','ChatMessage','setMaxListeners','save','update','remove','Users','map','findAll','then','setDataValue','unreadMessages','length','emit','catch'];(function(_0x17559c,_0x485682){var _0x23ab66=function(_0x2d0ca4){while(--_0x2d0ca4){_0x17559c['push'](_0x17559c['shift']());}};_0x23ab66(++_0x485682);}(_0x0fcf,0x145));var _0xf0fc=function(_0x1152ba,_0x96cb9f){_0x1152ba=_0x1152ba-0x0;var _0xcf7499=_0x0fcf[_0x1152ba];return _0xcf7499;};'use strict';var EventEmitter=require(_0xf0fc('0x0'));var ChatInteraction=require('../../mysqldb')['db'][_0xf0fc('0x1')];var ChatMessage=require(_0xf0fc('0x2'))['db'][_0xf0fc('0x3')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0xf0fc('0x4')](0x0);var events={'afterCreate':_0xf0fc('0x5'),'afterUpdate':_0xf0fc('0x6'),'afterDestroy':_0xf0fc('0x7')};function emitEvent(_0x3fa023){return function(_0x46a65d,_0x1eb32e,_0x24ec4c){_0x46a65d['getUsers']({'attributes':['id'],'raw':!![]})['then'](function(_0x114879){_0x46a65d['setDataValue'](_0xf0fc('0x8'),_0x114879[_0xf0fc('0x9')](function(_0x4116f1){return{'id':_0x4116f1['id']};}));return ChatMessage[_0xf0fc('0xa')]({'where':{'ChatInteractionId':_0x46a65d['id'],'direction':'in','read':![]},'raw':!![]});})[_0xf0fc('0xb')](function(_0x513080){_0x46a65d[_0xf0fc('0xc')](_0xf0fc('0xd'),_0x513080[_0xf0fc('0xe')]);ChatInteractionEvents[_0xf0fc('0xf')](_0x3fa023+':'+_0x46a65d['id'],_0x46a65d);ChatInteractionEvents[_0xf0fc('0xf')](_0x3fa023,_0x46a65d);_0x24ec4c(null);})[_0xf0fc('0x10')](_0x24ec4c(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInteraction[_0xf0fc('0x11')](e,emitEvent(event));}}module[_0xf0fc('0x12')]=ChatInteractionEvents;
\ No newline at end of file
+var _0x4649=['then','Users','map','findAll','setDataValue','length','emit','catch','hasOwnProperty','hook','events','ChatInteraction','../../mysqldb','ChatMessage','setMaxListeners','save','update','remove','getUsers'];(function(_0x2b0ae9,_0x599d4f){var _0x3915c9=function(_0x3cef2d){while(--_0x3cef2d){_0x2b0ae9['push'](_0x2b0ae9['shift']());}};_0x3915c9(++_0x599d4f);}(_0x4649,0x199));var _0x9464=function(_0x576509,_0x5b489a){_0x576509=_0x576509-0x0;var _0x35815a=_0x4649[_0x576509];return _0x35815a;};'use strict';var EventEmitter=require(_0x9464('0x0'));var ChatInteraction=require('../../mysqldb')['db'][_0x9464('0x1')];var ChatMessage=require(_0x9464('0x2'))['db'][_0x9464('0x3')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x9464('0x4')](0x0);var events={'afterCreate':_0x9464('0x5'),'afterUpdate':_0x9464('0x6'),'afterDestroy':_0x9464('0x7')};function emitEvent(_0x58331a){return function(_0xdfa97e,_0x488a7c,_0x44f19f){_0xdfa97e[_0x9464('0x8')]({'attributes':['id'],'raw':!![]})[_0x9464('0x9')](function(_0x8e7f8c){_0xdfa97e['setDataValue'](_0x9464('0xa'),_0x8e7f8c[_0x9464('0xb')](function(_0x2f0c31){return{'id':_0x2f0c31['id']};}));return ChatMessage[_0x9464('0xc')]({'where':{'ChatInteractionId':_0xdfa97e['id'],'direction':'in','read':![]},'raw':!![]});})[_0x9464('0x9')](function(_0x5d850a){_0xdfa97e[_0x9464('0xd')]('unreadMessages',_0x5d850a[_0x9464('0xe')]);ChatInteractionEvents[_0x9464('0xf')](_0x58331a+':'+_0xdfa97e['id'],_0xdfa97e);ChatInteractionEvents[_0x9464('0xf')](_0x58331a,_0xdfa97e);_0x44f19f(null);})[_0x9464('0x10')](_0x44f19f(null));};}for(var e in events){if(events[_0x9464('0x11')](e)){var event=events[e];ChatInteraction[_0x9464('0x12')](e,emitEvent(event));}}module['exports']=ChatInteractionEvents;
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.model.js b/server/api/chatInteraction/chatInteraction.model.js
index fae6a93..c024436 100644
--- a/server/api/chatInteraction/chatInteraction.model.js
+++ b/server/api/chatInteraction/chatInteraction.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xe5d5=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','chat_interactions','changed','closedAt','YYYY-MM-DD\x20HH:mm:ss','utf8mb4','lodash','util'];(function(_0x1640c1,_0x1004b3){var _0x1595e2=function(_0x4f8858){while(--_0x4f8858){_0x1640c1['push'](_0x1640c1['shift']());}};_0x1595e2(++_0x1004b3);}(_0xe5d5,0xdf));var _0x5e5d=function(_0x32e3a9,_0x403b74){_0x32e3a9=_0x32e3a9-0x0;var _0x2bfcae=_0xe5d5[_0x32e3a9];return _0x2bfcae;};'use strict';var _=require(_0x5e5d('0x0'));var util=require(_0x5e5d('0x1'));var logger=require(_0x5e5d('0x2'))(_0x5e5d('0x3'));var moment=require(_0x5e5d('0x4'));var BPromise=require(_0x5e5d('0x5'));var rp=require(_0x5e5d('0x6'));var fs=require('fs');var path=require(_0x5e5d('0x7'));var rimraf=require(_0x5e5d('0x8'));var config=require(_0x5e5d('0x9'));var attributes=require('./chatInteraction.attributes');module['exports']=function(_0x30a2f2,_0x442473){return _0x30a2f2['define']('ChatInteraction',attributes,{'tableName':_0x5e5d('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x23fe54,_0x4e2ac5,_0xe73aeb){if(_0x23fe54[_0x5e5d('0xb')]('closed')){_0x23fe54[_0x5e5d('0xc')]=moment()['format'](_0x5e5d('0xd'));}_0xe73aeb(null,_0x23fe54);}},'charset':_0x5e5d('0xe'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0x6aa2=['rimraf','../../config/environment','./chatInteraction.attributes','exports','define','ChatInteraction','chat_interactions','changed','closed','format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','path'];(function(_0x12e073,_0x4d43db){var _0x267748=function(_0x381284){while(--_0x381284){_0x12e073['push'](_0x12e073['shift']());}};_0x267748(++_0x4d43db);}(_0x6aa2,0x94));var _0x26aa=function(_0x4e5d67,_0x54dffc){_0x4e5d67=_0x4e5d67-0x0;var _0x4acdf3=_0x6aa2[_0x4e5d67];return _0x4acdf3;};'use strict';var _=require(_0x26aa('0x0'));var util=require(_0x26aa('0x1'));var logger=require(_0x26aa('0x2'))('api');var moment=require(_0x26aa('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x26aa('0x4'));var rimraf=require(_0x26aa('0x5'));var config=require(_0x26aa('0x6'));var attributes=require(_0x26aa('0x7'));module[_0x26aa('0x8')]=function(_0xdd1a94,_0x1143d9){return _0xdd1a94[_0x26aa('0x9')](_0x26aa('0xa'),attributes,{'tableName':_0x26aa('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x2f3d6c,_0x51a60a,_0x503863){if(_0x2f3d6c[_0x26aa('0xc')](_0x26aa('0xd'))){_0x2f3d6c['closedAt']=moment()[_0x26aa('0xe')](_0x26aa('0xf'));}_0x503863(null,_0x2f3d6c);}},'charset':'utf8mb4','collate':_0x26aa('0x10')});};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.rpc.js b/server/api/chatInteraction/chatInteraction.rpc.js
index d1bb8e5..7a56c2f 100644
--- a/server/api/chatInteraction/chatInteraction.rpc.js
+++ b/server/api/chatInteraction/chatInteraction.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xfd4c=['where','ids','spread','AddTags','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','localhost','./chatInteraction.socket','register','then','ChatInteraction,\x20%s,\x20%s','debug','stringify','error','code','message','info','catch','UpdateChatInteraction','update','body','options','raw','attributes','AddTagsToChatInteraction','find'];(function(_0x2d7f0e,_0x3e6fbd){var _0x110b07=function(_0x557b00){while(--_0x557b00){_0x2d7f0e['push'](_0x2d7f0e['shift']());}};_0x110b07(++_0x3e6fbd);}(_0xfd4c,0x1b4));var _0xcfd4=function(_0x1fe435,_0x1bd504){_0x1fe435=_0x1fe435-0x0;var _0x2f9e68=_0xfd4c[_0x1fe435];return _0x2f9e68;};'use strict';var _=require('lodash');var util=require(_0xcfd4('0x0'));var moment=require(_0xcfd4('0x1'));var BPromise=require(_0xcfd4('0x2'));var rs=require(_0xcfd4('0x3'));var fs=require('fs');var Redis=require(_0xcfd4('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xcfd4('0x5'));var logger=require(_0xcfd4('0x6'))('rpc');var config=require(_0xcfd4('0x7'));var jayson=require(_0xcfd4('0x8'));var client=jayson[_0xcfd4('0x9')][_0xcfd4('0xa')]({'port':0x232a});config[_0xcfd4('0xb')]=_['defaults'](config[_0xcfd4('0xb')],{'host':_0xcfd4('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xcfd4('0xd'))[_0xcfd4('0xe')](socket);function respondWithRpcPromise(_0x386980,_0x4483a8,_0x2415cd){return new BPromise(function(_0x35f7ca,_0x519aee){return client['request'](_0x386980,_0x2415cd)[_0xcfd4('0xf')](function(_0x52626d){logger['info'](_0xcfd4('0x10'),_0x4483a8,'request\x20sent');logger[_0xcfd4('0x11')]('ChatInteraction,\x20%s,\x20%s,\x20%s',_0x4483a8,'request\x20sent',JSON[_0xcfd4('0x12')](_0x52626d));if(_0x52626d[_0xcfd4('0x13')]){if(_0x52626d['error'][_0xcfd4('0x14')]===0x1f4){logger[_0xcfd4('0x13')](_0xcfd4('0x10'),_0x4483a8,_0x52626d['error'][_0xcfd4('0x15')]);return _0x519aee(_0x52626d[_0xcfd4('0x13')][_0xcfd4('0x15')]);}logger['error'](_0xcfd4('0x10'),_0x4483a8,_0x52626d[_0xcfd4('0x13')][_0xcfd4('0x15')]);return _0x35f7ca(_0x52626d['error'][_0xcfd4('0x15')]);}else{logger[_0xcfd4('0x16')]('ChatInteraction,\x20%s,\x20%s',_0x4483a8,'request\x20sent');_0x35f7ca(_0x52626d['result'][_0xcfd4('0x15')]);}})[_0xcfd4('0x17')](function(_0x5b9193){logger[_0xcfd4('0x13')](_0xcfd4('0x10'),_0x4483a8,_0x5b9193);_0x519aee(_0x5b9193);});});}exports[_0xcfd4('0x18')]=function(_0x5b369d){var _0x18d9fa=this;return new Promise(function(_0x158037,_0x4f8d11){return db['ChatInteraction'][_0xcfd4('0x19')](_0x5b369d[_0xcfd4('0x1a')],{'raw':_0x5b369d['options']?_0x5b369d[_0xcfd4('0x1b')][_0xcfd4('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5b369d[_0xcfd4('0x1b')]?_0x5b369d['options']['where']||null:null,'attributes':_0x5b369d[_0xcfd4('0x1b')]?_0x5b369d[_0xcfd4('0x1b')][_0xcfd4('0x1d')]||null:null,'limit':_0x5b369d[_0xcfd4('0x1b')]?_0x5b369d[_0xcfd4('0x1b')]['limit']||null:null})[_0xcfd4('0xf')](function(_0x5ed2f6){logger[_0xcfd4('0x16')](_0xcfd4('0x18'),_0x5b369d);logger[_0xcfd4('0x11')](_0xcfd4('0x18'),_0x5b369d,JSON['stringify'](_0x5ed2f6));_0x158037(_0x5ed2f6);})[_0xcfd4('0x17')](function(_0x122f9f){logger[_0xcfd4('0x13')]('UpdateChatInteraction',_0x122f9f[_0xcfd4('0x15')],_0x5b369d);_0x4f8d11(_0x18d9fa[_0xcfd4('0x13')](0x1f4,_0x122f9f[_0xcfd4('0x15')]));});});};exports[_0xcfd4('0x1e')]=function(_0x815cbf){return new Promise(function(_0x51833a,_0x212883){return db['ChatInteraction'][_0xcfd4('0x1f')]({'where':_0x815cbf[_0xcfd4('0x1b')]?_0x815cbf[_0xcfd4('0x1b')][_0xcfd4('0x20')]||null:null})[_0xcfd4('0xf')](function(_0x1510a7){if(_0x1510a7){return _0x1510a7['addTags'](_0x815cbf['body'][_0xcfd4('0x21')],_['omit'](_0x815cbf[_0xcfd4('0x1a')],[_0xcfd4('0x21'),'id'])||{});}})[_0xcfd4('0x22')](function(_0x455da7){logger['info'](_0xcfd4('0x23'),_0x815cbf);logger[_0xcfd4('0x11')]('AddTags',_0x815cbf,JSON['stringify'](_0x455da7));_0x51833a(_0x455da7);})[_0xcfd4('0x17')](function(_0xb15842){logger[_0xcfd4('0x13')](_0xcfd4('0x23'),_0xb15842[_0xcfd4('0x15')],_0x815cbf);_0x212883(_this[_0xcfd4('0x13')](0x1f4,_0xb15842[_0xcfd4('0x15')]));});});};
\ No newline at end of file
+var _0x9fc2=['message','info','result','catch','UpdateChatInteraction','ChatInteraction','update','body','options','attributes','limit','AddTagsToChatInteraction','find','where','addTags','ids','omit','spread','AddTags','lodash','util','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','request','then','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x11579f,_0x26ab6b){var _0x56e613=function(_0x21c110){while(--_0x21c110){_0x11579f['push'](_0x11579f['shift']());}};_0x56e613(++_0x26ab6b);}(_0x9fc2,0x163));var _0x29fc=function(_0x27a444,_0x5902d4){_0x27a444=_0x27a444-0x0;var _0x370fdc=_0x9fc2[_0x27a444];return _0x370fdc;};'use strict';var _=require(_0x29fc('0x0'));var util=require(_0x29fc('0x1'));var moment=require('moment');var BPromise=require(_0x29fc('0x2'));var rs=require(_0x29fc('0x3'));var fs=require('fs');var Redis=require(_0x29fc('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x29fc('0x5'));var logger=require('../../config/logger')(_0x29fc('0x6'));var config=require(_0x29fc('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x29fc('0x8')][_0x29fc('0x9')]({'port':0x232a});config[_0x29fc('0xa')]=_[_0x29fc('0xb')](config[_0x29fc('0xa')],{'host':_0x29fc('0xc'),'port':0x18eb});var socket=require(_0x29fc('0xd'))(new Redis(config[_0x29fc('0xa')]));require('./chatInteraction.socket')['register'](socket);function respondWithRpcPromise(_0x3e4494,_0x5f4b1d,_0x31b8e7){return new BPromise(function(_0x4fccf9,_0x4171a2){return client[_0x29fc('0xe')](_0x3e4494,_0x31b8e7)[_0x29fc('0xf')](function(_0x54084b){logger['info'](_0x29fc('0x10'),_0x5f4b1d,_0x29fc('0x11'));logger[_0x29fc('0x12')](_0x29fc('0x13'),_0x5f4b1d,_0x29fc('0x11'),JSON[_0x29fc('0x14')](_0x54084b));if(_0x54084b[_0x29fc('0x15')]){if(_0x54084b['error'][_0x29fc('0x16')]===0x1f4){logger[_0x29fc('0x15')](_0x29fc('0x10'),_0x5f4b1d,_0x54084b['error']['message']);return _0x4171a2(_0x54084b['error'][_0x29fc('0x17')]);}logger[_0x29fc('0x15')](_0x29fc('0x10'),_0x5f4b1d,_0x54084b[_0x29fc('0x15')][_0x29fc('0x17')]);return _0x4fccf9(_0x54084b[_0x29fc('0x15')]['message']);}else{logger[_0x29fc('0x18')]('ChatInteraction,\x20%s,\x20%s',_0x5f4b1d,_0x29fc('0x11'));_0x4fccf9(_0x54084b[_0x29fc('0x19')][_0x29fc('0x17')]);}})[_0x29fc('0x1a')](function(_0xcd7c0d){logger['error']('ChatInteraction,\x20%s,\x20%s',_0x5f4b1d,_0xcd7c0d);_0x4171a2(_0xcd7c0d);});});}exports[_0x29fc('0x1b')]=function(_0x13eabe){var _0x25a599=this;return new Promise(function(_0x29baa0,_0x3d3da8){return db[_0x29fc('0x1c')][_0x29fc('0x1d')](_0x13eabe[_0x29fc('0x1e')],{'raw':_0x13eabe[_0x29fc('0x1f')]?_0x13eabe['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x13eabe[_0x29fc('0x1f')]?_0x13eabe[_0x29fc('0x1f')]['where']||null:null,'attributes':_0x13eabe[_0x29fc('0x1f')]?_0x13eabe[_0x29fc('0x1f')][_0x29fc('0x20')]||null:null,'limit':_0x13eabe[_0x29fc('0x1f')]?_0x13eabe[_0x29fc('0x1f')][_0x29fc('0x21')]||null:null})[_0x29fc('0xf')](function(_0x32c549){logger[_0x29fc('0x18')](_0x29fc('0x1b'),_0x13eabe);logger['debug']('UpdateChatInteraction',_0x13eabe,JSON[_0x29fc('0x14')](_0x32c549));_0x29baa0(_0x32c549);})[_0x29fc('0x1a')](function(_0x311404){logger['error'](_0x29fc('0x1b'),_0x311404['message'],_0x13eabe);_0x3d3da8(_0x25a599[_0x29fc('0x15')](0x1f4,_0x311404[_0x29fc('0x17')]));});});};exports[_0x29fc('0x22')]=function(_0xbb7b27){return new Promise(function(_0x52de38,_0xa60c8d){return db['ChatInteraction'][_0x29fc('0x23')]({'where':_0xbb7b27['options']?_0xbb7b27[_0x29fc('0x1f')][_0x29fc('0x24')]||null:null})[_0x29fc('0xf')](function(_0x4994b1){if(_0x4994b1){return _0x4994b1[_0x29fc('0x25')](_0xbb7b27[_0x29fc('0x1e')][_0x29fc('0x26')],_[_0x29fc('0x27')](_0xbb7b27['body'],[_0x29fc('0x26'),'id'])||{});}})[_0x29fc('0x28')](function(_0x3c96a4){logger['info'](_0x29fc('0x29'),_0xbb7b27);logger[_0x29fc('0x12')]('AddTags',_0xbb7b27,JSON[_0x29fc('0x14')](_0x3c96a4));_0x52de38(_0x3c96a4);})[_0x29fc('0x1a')](function(_0x3e1565){logger[_0x29fc('0x15')](_0x29fc('0x29'),_0x3e1565[_0x29fc('0x17')],_0xbb7b27);_0xa60c8d(_this[_0x29fc('0x15')](0x1f4,_0x3e1565[_0x29fc('0x17')]));});});};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.socket.js b/server/api/chatInteraction/chatInteraction.socket.js
index ad7182f..297160c 100644
--- a/server/api/chatInteraction/chatInteraction.socket.js
+++ b/server/api/chatInteraction/chatInteraction.socket.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x86d1=['chatInteraction:','./chatInteraction.events','save','remove','update','removeListener','length'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x86d1,0x158));var _0x186d=function(_0x55a8b5,_0x18a413){_0x55a8b5=_0x55a8b5-0x0;var _0x1ddc06=_0x86d1[_0x55a8b5];return _0x1ddc06;};'use strict';var ChatInteractionEvents=require(_0x186d('0x0'));var events=[_0x186d('0x1'),_0x186d('0x2'),_0x186d('0x3')];function createListener(_0x42994f,_0x538255){return function(_0x28df20){_0x538255['emit'](_0x42994f,_0x28df20);};}function removeListener(_0x3286ab,_0x405c4c){return function(){ChatInteractionEvents[_0x186d('0x4')](_0x3286ab,_0x405c4c);};}exports['register']=function(_0x484b1a){for(var _0x1978b0=0x0,_0xac4741=events[_0x186d('0x5')];_0x1978b0<_0xac4741;_0x1978b0++){var _0x13abe8=events[_0x1978b0];var _0x4e4ae8=createListener(_0x186d('0x6')+_0x13abe8,_0x484b1a);ChatInteractionEvents['on'](_0x13abe8,_0x4e4ae8);}};
\ No newline at end of file
+var _0xa8e7=['register','chatInteraction:','./chatInteraction.events','save','remove','emit','removeListener'];(function(_0xba192c,_0x4be2f7){var _0x5c837f=function(_0x248622){while(--_0x248622){_0xba192c['push'](_0xba192c['shift']());}};_0x5c837f(++_0x4be2f7);}(_0xa8e7,0x18a));var _0x7a8e=function(_0x23a7f5,_0x490f8a){_0x23a7f5=_0x23a7f5-0x0;var _0x1ac0d3=_0xa8e7[_0x23a7f5];return _0x1ac0d3;};'use strict';var ChatInteractionEvents=require(_0x7a8e('0x0'));var events=[_0x7a8e('0x1'),_0x7a8e('0x2'),'update'];function createListener(_0x36c5a1,_0x16aed8){return function(_0x500a33){_0x16aed8[_0x7a8e('0x3')](_0x36c5a1,_0x500a33);};}function removeListener(_0x265a12,_0x493489){return function(){ChatInteractionEvents[_0x7a8e('0x4')](_0x265a12,_0x493489);};}exports[_0x7a8e('0x5')]=function(_0x51137e){for(var _0x242402=0x0,_0x363104=events['length'];_0x242402<_0x363104;_0x242402++){var _0x408173=events[_0x242402];var _0x317f0f=createListener(_0x7a8e('0x6')+_0x408173,_0x51137e);ChatInteractionEvents['on'](_0x408173,_0x317f0f);}};
\ No newline at end of file
diff --git a/server/api/chatInteraction/index.js b/server/api/chatInteraction/index.js
index 7e2100d..f0f329e 100644
--- a/server/api/chatInteraction/index.js
+++ b/server/api/chatInteraction/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x608a=['join','format','%s-%s','replace','/:id/attachment_upload','single','file','attachmentUpload','addMessage','/:id/tags','tracked','chat','chatinteraction:addtags','put','chatinteraction:update','update','/:id/custom_update','customUpdate','abandon','/:id/close','close','/:id','chatinteraction:destroy','delete','removeTags','util','path','express','Router','../../components/auth/service','../../components/interaction/service','./chatInteraction.controller','get','isAuthenticated','describe','isChatInteractionAuthorized','/:id/attachment_download','attachmentDownload','/:id/messages','/:id/my_messages','getMyMessages','download','create','post','/:id/vidaoo','diskStorage'];(function(_0xbc26a7,_0x4a735b){var _0x33bd35=function(_0x30cbcd){while(--_0x30cbcd){_0xbc26a7['push'](_0xbc26a7['shift']());}};_0x33bd35(++_0x4a735b);}(_0x608a,0xff));var _0xa608=function(_0x1e5bda,_0x3eb1a6){_0x1e5bda=_0x1e5bda-0x0;var _0x3dc564=_0x608a[_0x1e5bda];return _0x3dc564;};'use strict';var multer=require('multer');var util=require(_0xa608('0x0'));var path=require(_0xa608('0x1'));var timeout=require('connect-timeout');var express=require(_0xa608('0x2'));var router=express[_0xa608('0x3')]();var auth=require(_0xa608('0x4'));var interaction=require(_0xa608('0x5'));var config=require('../../config/environment');var controller=require(_0xa608('0x6'));router[_0xa608('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0xa608('0x7')]('/describe',auth[_0xa608('0x8')](),controller[_0xa608('0x9')]);router[_0xa608('0x7')]('/:id',auth[_0xa608('0xa')](),controller['show']);router[_0xa608('0x7')](_0xa608('0xb'),auth['isChatInteractionAuthorized'](),controller[_0xa608('0xc')]);router[_0xa608('0x7')](_0xa608('0xd'),auth[_0xa608('0x8')](),controller['getMessages']);router[_0xa608('0x7')](_0xa608('0xe'),auth[_0xa608('0xa')](),controller[_0xa608('0xf')]);router[_0xa608('0x7')]('/:id/download',auth[_0xa608('0x8')](),controller[_0xa608('0x10')]);router['post']('/',auth['isAuthenticated'](),controller[_0xa608('0x11')]);router[_0xa608('0x12')](_0xa608('0x13'),auth[_0xa608('0x8')](),controller['createVidaooSession']);var upload=multer({'storage':multer[_0xa608('0x14')]({'destination':function(_0x4564f5,_0x49d154,_0xf4fcf6){_0xf4fcf6(null,path[_0xa608('0x15')](config['root'],'server/files/attachments/'));},'filename':function(_0x577f36,_0x19cc45,_0x473003){_0x473003(null,util[_0xa608('0x16')](_0xa608('0x17'),Date['now'](),_0x19cc45['originalname'][_0xa608('0x18')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router['post'](_0xa608('0x19'),upload[_0xa608('0x1a')](_0xa608('0x1b')),controller[_0xa608('0x1c')]);router[_0xa608('0x12')](_0xa608('0xd'),auth[_0xa608('0xa')](),controller[_0xa608('0x1d')]);router[_0xa608('0x12')](_0xa608('0x1e'),auth[_0xa608('0x8')](),interaction[_0xa608('0x1f')](_0xa608('0x20'),_0xa608('0x21')),controller['addTags']);router[_0xa608('0x22')]('/:id',auth[_0xa608('0x8')](),interaction[_0xa608('0x1f')](_0xa608('0x20'),_0xa608('0x23')),controller[_0xa608('0x24')]);router[_0xa608('0x22')](_0xa608('0x25'),controller[_0xa608('0x26')]);router[_0xa608('0x22')]('/:id/abandon',auth['isChatInteractionAuthorized'](),controller[_0xa608('0x27')]);router[_0xa608('0x22')](_0xa608('0x28'),controller[_0xa608('0x29')]);router['delete'](_0xa608('0x2a'),auth[_0xa608('0x8')](),interaction[_0xa608('0x1f')](_0xa608('0x20'),_0xa608('0x2b')),controller['destroy']);router[_0xa608('0x2c')](_0xa608('0x1e'),auth['isAuthenticated'](),controller[_0xa608('0x2d')]);module['exports']=router;
\ No newline at end of file
+var _0x5853=['chat','chatinteraction:addtags','addTags','update','put','/:id/custom_update','customUpdate','abandon','/:id/close','delete','chatinteraction:destroy','destroy','/:id/tags','removeTags','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInteraction.controller','get','isAuthenticated','describe','/:id','isChatInteractionAuthorized','show','/:id/attachment_download','attachmentDownload','/:id/messages','getMessages','/:id/my_messages','getMyMessages','/:id/download','create','/:id/vidaoo','diskStorage','join','root','server/files/attachments/','%s-%s','now','originalname','replace','post','/:id/attachment_upload','single','addMessage','tracked'];(function(_0x553927,_0x408337){var _0x4f6d8e=function(_0x197ae6){while(--_0x197ae6){_0x553927['push'](_0x553927['shift']());}};_0x4f6d8e(++_0x408337);}(_0x5853,0x113));var _0x3585=function(_0x5ecaab,_0x2f3053){_0x5ecaab=_0x5ecaab-0x0;var _0x3db1a8=_0x5853[_0x5ecaab];return _0x3db1a8;};'use strict';var multer=require(_0x3585('0x0'));var util=require(_0x3585('0x1'));var path=require(_0x3585('0x2'));var timeout=require(_0x3585('0x3'));var express=require(_0x3585('0x4'));var router=express['Router']();var auth=require(_0x3585('0x5'));var interaction=require(_0x3585('0x6'));var config=require(_0x3585('0x7'));var controller=require(_0x3585('0x8'));router[_0x3585('0x9')]('/',auth[_0x3585('0xa')](),controller['index']);router[_0x3585('0x9')]('/describe',auth['isAuthenticated'](),controller[_0x3585('0xb')]);router['get'](_0x3585('0xc'),auth[_0x3585('0xd')](),controller[_0x3585('0xe')]);router[_0x3585('0x9')](_0x3585('0xf'),auth[_0x3585('0xd')](),controller[_0x3585('0x10')]);router['get'](_0x3585('0x11'),auth[_0x3585('0xa')](),controller[_0x3585('0x12')]);router[_0x3585('0x9')](_0x3585('0x13'),auth[_0x3585('0xd')](),controller[_0x3585('0x14')]);router['get'](_0x3585('0x15'),auth['isAuthenticated'](),controller['download']);router['post']('/',auth['isAuthenticated'](),controller[_0x3585('0x16')]);router['post'](_0x3585('0x17'),auth[_0x3585('0xa')](),controller['createVidaooSession']);var upload=multer({'storage':multer[_0x3585('0x18')]({'destination':function(_0x3c97ae,_0x5e31b2,_0x366723){_0x366723(null,path[_0x3585('0x19')](config[_0x3585('0x1a')],_0x3585('0x1b')));},'filename':function(_0x2496a4,_0x59e340,_0x3bd298){_0x3bd298(null,util['format'](_0x3585('0x1c'),Date[_0x3585('0x1d')](),_0x59e340[_0x3585('0x1e')][_0x3585('0x1f')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x3585('0x20')](_0x3585('0x21'),upload[_0x3585('0x22')]('file'),controller['attachmentUpload']);router[_0x3585('0x20')](_0x3585('0x11'),auth[_0x3585('0xd')](),controller[_0x3585('0x23')]);router[_0x3585('0x20')]('/:id/tags',auth[_0x3585('0xa')](),interaction[_0x3585('0x24')](_0x3585('0x25'),_0x3585('0x26')),controller[_0x3585('0x27')]);router['put']('/:id',auth['isAuthenticated'](),interaction['tracked']('chat','chatinteraction:update'),controller[_0x3585('0x28')]);router[_0x3585('0x29')](_0x3585('0x2a'),controller[_0x3585('0x2b')]);router[_0x3585('0x29')]('/:id/abandon',auth[_0x3585('0xd')](),controller[_0x3585('0x2c')]);router['put'](_0x3585('0x2d'),controller['close']);router[_0x3585('0x2e')](_0x3585('0xc'),auth[_0x3585('0xa')](),interaction[_0x3585('0x24')](_0x3585('0x25'),_0x3585('0x2f')),controller[_0x3585('0x30')]);router[_0x3585('0x2e')](_0x3585('0x31'),auth[_0x3585('0xa')](),controller[_0x3585('0x32')]);module[_0x3585('0x33')]=router;
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.attributes.js b/server/api/chatInternalMessage/chatInternalMessage.attributes.js
index ccbed0d..34448fa 100644
--- a/server/api/chatInternalMessage/chatInternalMessage.attributes.js
+++ b/server/api/chatInternalMessage/chatInternalMessage.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x5f2f=['INTEGER','sequelize','exports','TEXT','medium','BOOLEAN'];(function(_0x569863,_0x23b4ff){var _0x2e4708=function(_0x938072){while(--_0x938072){_0x569863['push'](_0x569863['shift']());}};_0x2e4708(++_0x23b4ff);}(_0x5f2f,0x73));var _0xf5f2=function(_0x16a201,_0x432c20){_0x16a201=_0x16a201-0x0;var _0x15baac=_0x5f2f[_0x16a201];return _0x15baac;};'use strict';var Sequelize=require(_0xf5f2('0x0'));module[_0xf5f2('0x1')]={'body':{'type':Sequelize[_0xf5f2('0x2')](_0xf5f2('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0xf5f2('0x4')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0xf5f2('0x5')]}};
\ No newline at end of file
+var _0xda2d=['medium','BOOLEAN','INTEGER','exports','TEXT'];(function(_0x447080,_0x1571ac){var _0x667c47=function(_0x4a4013){while(--_0x4a4013){_0x447080['push'](_0x447080['shift']());}};_0x667c47(++_0x1571ac);}(_0xda2d,0x102));var _0xdda2=function(_0x56cc43,_0x5a2bf8){_0x56cc43=_0x56cc43-0x0;var _0x1d93c1=_0xda2d[_0x56cc43];return _0x1d93c1;};'use strict';var Sequelize=require('sequelize');module[_0xdda2('0x0')]={'body':{'type':Sequelize[_0xdda2('0x1')](_0xdda2('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0xdda2('0x3')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0xdda2('0x4')]}};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.controller.js b/server/api/chatInternalMessage/chatInternalMessage.controller.js
index 703b6a8..0373f96 100644
--- a/server/api/chatInternalMessage/chatInternalMessage.controller.js
+++ b/server/api/chatInternalMessage/chatInternalMessage.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xa827=['../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatInternalMessage.socket','register','sendStatus','status','end','offset','limit','json','save','update','then','destroy','name','send','index','map','ChatInternalMessage','rawAttributes','fieldName','type','key','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','options','count','includeAll','include','findAll','catch','show','params','keys','find','body','describe','messages','lastMessageAt','createdAt','lastMessage','format','YYYY-MM-DD\x20HH:mm:ss','getUsers','User','agent','admin','user','fullname','role','userpic','internal','online','allowmessenger','showWebBar','-online','VoiceQueue','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','Agents','userProfileId','autoAssociation','isEmpty','resourceId','push','FromId','ToId','read','-createdAt','all','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','squel','crypto','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs'];(function(_0x443468,_0x5c8c24){var _0xb723f=function(_0x405bd9){while(--_0x405bd9){_0x443468['push'](_0x443468['shift']());}};_0xb723f(++_0x5c8c24);}(_0xa827,0xc6));var _0x7a82=function(_0x5f5df5,_0x52587e){_0x5f5df5=_0x5f5df5-0x0;var _0x17acaa=_0xa827[_0x5f5df5];return _0x17acaa;};'use strict';var pdf=require(_0x7a82('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x7a82('0x1'));var zipdir=require(_0x7a82('0x2'));var jsonpatch=require(_0x7a82('0x3'));var rp=require(_0x7a82('0x4'));var moment=require('moment');var BPromise=require(_0x7a82('0x5'));var Mustache=require(_0x7a82('0x6'));var util=require(_0x7a82('0x7'));var path=require(_0x7a82('0x8'));var sox=require(_0x7a82('0x9'));var csv=require('to-csv');var ejs=require(_0x7a82('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0x7a82('0xb'));var crypto=require(_0x7a82('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x7a82('0xd'));var querystring=require(_0x7a82('0xe'));var Papa=require('papaparse');var Redis=require(_0x7a82('0xf'));var authService=require(_0x7a82('0x10'));var qs=require(_0x7a82('0x11'));var as=require(_0x7a82('0x12'));var hardwareService=require(_0x7a82('0x13'));var logger=require(_0x7a82('0x14'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x7a82('0x15'))['db'];config[_0x7a82('0x16')]=_[_0x7a82('0x17')](config[_0x7a82('0x16')],{'host':_0x7a82('0x18'),'port':0x18eb});var socket=require(_0x7a82('0x19'))(new Redis(config[_0x7a82('0x16')]));require(_0x7a82('0x1a'))[_0x7a82('0x1b')](socket);function respondWithStatusCode(_0xf8e823,_0xecad0a){_0xecad0a=_0xecad0a||0xcc;return function(_0x3ef512){if(_0x3ef512){return _0xf8e823[_0x7a82('0x1c')](_0xecad0a);}return _0xf8e823[_0x7a82('0x1d')](_0xecad0a)[_0x7a82('0x1e')]();};}function respondWithResult(_0xf37e68,_0xedd610){_0xedd610=_0xedd610||0xc8;return function(_0x80e760){if(_0x80e760){return _0xf37e68[_0x7a82('0x1d')](_0xedd610)['json'](_0x80e760);}};}function respondWithFilteredResult(_0x11c891,_0x58eeeb){return function(_0x516fad){if(_0x516fad){var _0x185117=_0x516fad['count'],_0x292935=_0x58eeeb[_0x7a82('0x1f')],_0x4a379b=_0x58eeeb[_0x7a82('0x1f')]+_0x58eeeb[_0x7a82('0x20')],_0x4e26fd;if(_0x4a379b>=_0x185117){_0x4a379b=_0x185117;_0x4e26fd=0xc8;}else{_0x4e26fd=0xce;}_0x11c891['status'](_0x4e26fd);return _0x11c891['set']('Content-Range',_0x292935+'-'+_0x4a379b+'/'+_0x185117)[_0x7a82('0x21')](_0x516fad);}return null;};}function patchUpdates(_0x20dff2){return function(_0x177cff){try{jsonpatch['apply'](_0x177cff,_0x20dff2,!![]);}catch(_0x3bb7e9){return BPromise['reject'](_0x3bb7e9);}return _0x177cff[_0x7a82('0x22')]();};}function saveUpdates(_0x11c4ec,_0x2cdfec){return function(_0x378a6d){if(_0x378a6d){return _0x378a6d[_0x7a82('0x23')](_0x11c4ec)[_0x7a82('0x24')](function(_0x2f4cd5){return _0x2f4cd5;});}return null;};}function removeEntity(_0x152e35,_0x3550dd){return function(_0x3f4bb7){if(_0x3f4bb7){return _0x3f4bb7[_0x7a82('0x25')]()['then'](function(){_0x152e35[_0x7a82('0x1d')](0xcc)[_0x7a82('0x1e')]();});}};}function handleEntityNotFound(_0x3a1bad,_0x4121da){return function(_0x2a8431){if(!_0x2a8431){_0x3a1bad['sendStatus'](0x194);}return _0x2a8431;};}function handleError(_0xf9a718,_0x56b77c){_0x56b77c=_0x56b77c||0x1f4;return function(_0x505c6c){logger['error'](_0x505c6c['stack']);if(_0x505c6c[_0x7a82('0x26')]){delete _0x505c6c['name'];}_0xf9a718[_0x7a82('0x1d')](_0x56b77c)[_0x7a82('0x27')](_0x505c6c);};}exports[_0x7a82('0x28')]=function(_0x243bad,_0xea5965){var _0x1f5768={},_0x58b549={},_0x19ad80={'count':0x0,'rows':[]};var _0x27c980=_[_0x7a82('0x29')](db[_0x7a82('0x2a')][_0x7a82('0x2b')],function(_0x329990){return{'name':_0x329990[_0x7a82('0x2c')],'type':_0x329990[_0x7a82('0x2d')][_0x7a82('0x2e')]};});_0x58b549[_0x7a82('0x2f')]=_['map'](_0x27c980,_0x7a82('0x26'));_0x58b549[_0x7a82('0x30')]=_['keys'](_0x243bad[_0x7a82('0x30')]);_0x58b549['filters']=_[_0x7a82('0x31')](_0x58b549[_0x7a82('0x2f')],_0x58b549['query']);_0x1f5768[_0x7a82('0x32')]=_[_0x7a82('0x31')](_0x58b549[_0x7a82('0x2f')],qs[_0x7a82('0x33')](_0x243bad[_0x7a82('0x30')][_0x7a82('0x33')]));_0x1f5768[_0x7a82('0x32')]=_0x1f5768[_0x7a82('0x32')][_0x7a82('0x34')]?_0x1f5768['attributes']:_0x58b549['model'];if(!_0x243bad[_0x7a82('0x30')][_0x7a82('0x35')](_0x7a82('0x36'))){_0x1f5768[_0x7a82('0x20')]=qs[_0x7a82('0x20')](_0x243bad[_0x7a82('0x30')][_0x7a82('0x20')]);_0x1f5768[_0x7a82('0x1f')]=qs['offset'](_0x243bad[_0x7a82('0x30')][_0x7a82('0x1f')]);}_0x1f5768[_0x7a82('0x37')]=qs[_0x7a82('0x38')](_0x243bad[_0x7a82('0x30')][_0x7a82('0x38')]);_0x1f5768[_0x7a82('0x39')]=qs[_0x7a82('0x3a')](_[_0x7a82('0x3b')](_0x243bad['query'],_0x58b549[_0x7a82('0x3a')]),_0x27c980);if(_0x243bad[_0x7a82('0x30')][_0x7a82('0x3c')]){_0x1f5768[_0x7a82('0x39')]=_[_0x7a82('0x3d')](_0x1f5768['where'],{'$or':_[_0x7a82('0x29')](_0x27c980,function(_0x30ced7){if(_0x30ced7[_0x7a82('0x2d')]!=='VIRTUAL'){var _0x55b3c7={};_0x55b3c7[_0x30ced7['name']]={'$like':'%'+_0x243bad[_0x7a82('0x30')][_0x7a82('0x3c')]+'%'};return _0x55b3c7;}})});}_0x1f5768=_['merge']({},_0x1f5768,_0x243bad[_0x7a82('0x3e')]);var _0x1a3fef={'where':_0x1f5768['where']};return db['ChatInternalMessage'][_0x7a82('0x3f')](_0x1a3fef)['then'](function(_0x4a0781){_0x19ad80[_0x7a82('0x3f')]=_0x4a0781;if(_0x243bad[_0x7a82('0x30')][_0x7a82('0x40')]){_0x1f5768[_0x7a82('0x41')]=[{'all':!![]}];}return db[_0x7a82('0x2a')][_0x7a82('0x42')](_0x1f5768);})[_0x7a82('0x24')](function(_0x5de60b){_0x19ad80['rows']=_0x5de60b;return _0x19ad80;})[_0x7a82('0x24')](respondWithFilteredResult(_0xea5965,_0x1f5768))[_0x7a82('0x43')](handleError(_0xea5965,null));};exports[_0x7a82('0x44')]=function(_0x29c6fa,_0x50e2c9){var _0x33a25c={'raw':!![],'where':{'id':_0x29c6fa[_0x7a82('0x45')]['id']}},_0x1a92f9={};_0x1a92f9[_0x7a82('0x2f')]=_[_0x7a82('0x46')](db[_0x7a82('0x2a')][_0x7a82('0x2b')]);_0x1a92f9[_0x7a82('0x30')]=_[_0x7a82('0x46')](_0x29c6fa[_0x7a82('0x30')]);_0x1a92f9[_0x7a82('0x3a')]=_[_0x7a82('0x31')](_0x1a92f9[_0x7a82('0x2f')],_0x1a92f9['query']);_0x33a25c['attributes']=_[_0x7a82('0x31')](_0x1a92f9[_0x7a82('0x2f')],qs[_0x7a82('0x33')](_0x29c6fa[_0x7a82('0x30')][_0x7a82('0x33')]));_0x33a25c[_0x7a82('0x32')]=_0x33a25c[_0x7a82('0x32')][_0x7a82('0x34')]?_0x33a25c['attributes']:_0x1a92f9[_0x7a82('0x2f')];if(_0x29c6fa['query'][_0x7a82('0x40')]){_0x33a25c[_0x7a82('0x41')]=[{'all':!![]}];}_0x33a25c=_[_0x7a82('0x3d')]({},_0x33a25c,_0x29c6fa[_0x7a82('0x3e')]);return db[_0x7a82('0x2a')][_0x7a82('0x47')](_0x33a25c)[_0x7a82('0x24')](handleEntityNotFound(_0x50e2c9,null))[_0x7a82('0x24')](respondWithResult(_0x50e2c9,null))[_0x7a82('0x43')](handleError(_0x50e2c9,null));};exports['create']=function(_0x814a94,_0x31db5c){return db[_0x7a82('0x2a')]['create'](_0x814a94[_0x7a82('0x48')],{})[_0x7a82('0x24')](respondWithResult(_0x31db5c,0xc9))['catch'](handleError(_0x31db5c,null));};exports[_0x7a82('0x23')]=function(_0x33ace1,_0x4ec749){if(_0x33ace1['body']['id']){delete _0x33ace1['body']['id'];}return db['ChatInternalMessage'][_0x7a82('0x47')]({'where':{'id':_0x33ace1['params']['id']}})[_0x7a82('0x24')](handleEntityNotFound(_0x4ec749,null))[_0x7a82('0x24')](saveUpdates(_0x33ace1[_0x7a82('0x48')],null))[_0x7a82('0x24')](respondWithResult(_0x4ec749,null))[_0x7a82('0x43')](handleError(_0x4ec749,null));};exports[_0x7a82('0x25')]=function(_0x6b3557,_0x4c9f44){return db['ChatInternalMessage'][_0x7a82('0x47')]({'where':{'id':_0x6b3557[_0x7a82('0x45')]['id']}})[_0x7a82('0x24')](handleEntityNotFound(_0x4c9f44,null))[_0x7a82('0x24')](removeEntity(_0x4c9f44,null))[_0x7a82('0x43')](handleError(_0x4c9f44,null));};exports[_0x7a82('0x49')]=function(_0x51af68,_0x4e7e14){return db[_0x7a82('0x2a')][_0x7a82('0x49')]()['then'](respondWithResult(_0x4e7e14,null))[_0x7a82('0x43')](handleError(_0x4e7e14,null));};function wrapUser(_0x2c6fcd){return function(_0x5c3e04){var _0x3a20a6=_0x2c6fcd['get']({'plain':!![]});_0x3a20a6[_0x7a82('0x4a')]=[];if(_0x5c3e04){_0x3a20a6[_0x7a82('0x4b')]=_0x5c3e04[_0x7a82('0x4c')];_0x3a20a6[_0x7a82('0x4d')]=_0x5c3e04;}else{_0x3a20a6['lastMessageAt']=moment(0x0)[_0x7a82('0x4e')](_0x7a82('0x4f'));_0x3a20a6[_0x7a82('0x4d')]={};}return _0x3a20a6;};}exports[_0x7a82('0x50')]=function(_0x1adde0,_0x1bff9a,_0x55e7ed){var _0x1ec196=[];return db[_0x7a82('0x51')][_0x7a82('0x42')]({'where':{'role':[_0x7a82('0x52'),_0x7a82('0x53'),_0x7a82('0x54')]},'attributes':['id',_0x7a82('0x55'),'name',_0x7a82('0x56'),_0x7a82('0x57'),_0x7a82('0x58'),_0x7a82('0x59'),'lastLoginAt',_0x7a82('0x5a'),_0x7a82('0x5b')],'order':qs[_0x7a82('0x38')](_0x7a82('0x5c')),'include':[{'model':db[_0x7a82('0x5d')],'as':'VoiceQueues','attributes':['id','name',_0x7a82('0x2d')],'through':{'attributes':[]}}]})[_0x7a82('0x24')](function(_0x3fe615){if(_0x3fe615){var _0x29f0a4=_0x1adde0['user'][_0x7a82('0x5e')]({'plain':!![]});if(!_0x29f0a4)throw new Error(_0x7a82('0x5f'));if(_0x29f0a4['role']===_0x7a82('0x54')){return db[_0x7a82('0x60')]['find']({'where':{'name':_0x7a82('0x61'),'userProfileId':_0x29f0a4[_0x7a82('0x62')]},'raw':!![]})[_0x7a82('0x24')](function(_0x8d47db){if(_0x8d47db){if(_0x8d47db[_0x7a82('0x63')]===0x0){return db['UserProfileResource'][_0x7a82('0x42')]({'where':{'sectionId':_0x8d47db['id']},'raw':!![]})[_0x7a82('0x24')](function(_0x5314db){var _0x156153=[];if(_[_0x7a82('0x64')](_0x5314db)){_0x156153=_[_0x7a82('0x3c')](_0x3fe615,function(_0x481a61){if(_0x481a61[_0x7a82('0x56')]!==_0x7a82('0x52')){return _0x481a61;}});return _0x156153;}else{for(var _0x1df34c=0x0;_0x1df34c<_0x3fe615[_0x7a82('0x34')];_0x1df34c++){var _0x39d147=_0x3fe615[_0x1df34c];if(_0x39d147[_0x7a82('0x56')]===_0x7a82('0x52')){var _0x3d57fc=_[_0x7a82('0x47')](_0x5314db,function(_0x56b905){return _0x56b905[_0x7a82('0x65')]===_0x39d147['id'];});if(_0x3d57fc)_0x156153[_0x7a82('0x66')](_0x39d147);}else{_0x156153[_0x7a82('0x66')](_0x39d147);}}return _0x156153;}});}else{return _0x3fe615;}}else{var _0x290308=_[_0x7a82('0x3c')](_0x3fe615,function(_0x281ba0){if(_0x281ba0[_0x7a82('0x56')]!=='agent'){return _0x281ba0;}});return _0x290308;}});}else{return _0x3fe615;}}})[_0x7a82('0x24')](function(_0x5161d8){var _0x25b7be=[];if(_0x5161d8){_0x1ec196=_0x5161d8;for(var _0x50df09=0x0;_0x50df09<_0x5161d8[_0x7a82('0x34')];_0x50df09+=0x1){_0x1ec196[_0x50df09][_0x7a82('0x4a')]=[];_0x25b7be[_0x7a82('0x66')](db[_0x7a82('0x2a')][_0x7a82('0x47')]({'where':{'FromId':[_0x1adde0['user']['id'],_0x5161d8[_0x50df09]['id']],'ToId':[_0x1adde0[_0x7a82('0x54')]['id'],_0x5161d8[_0x50df09]['id']],'ChatGroupId':null},'attributes':['id',_0x7a82('0x4c'),_0x7a82('0x67'),_0x7a82('0x68'),_0x7a82('0x69'),_0x7a82('0x48')],'order':qs[_0x7a82('0x38')](_0x7a82('0x6a')),'limit':0x1,'offset':0x0,'raw':!![]})[_0x7a82('0x24')](wrapUser(_0x5161d8[_0x50df09])));}return BPromise[_0x7a82('0x6b')](_0x25b7be);}return[];})[_0x7a82('0x24')](function(_0x1e2a62){return{'rows':_0x1e2a62,'count':_0x1e2a62[_0x7a82('0x34')]};})['then'](respondWithResult(_0x1bff9a,null))['catch'](handleError(_0x1bff9a,null));};
\ No newline at end of file
+var _0x8dea=['YYYY-MM-DD\x20HH:mm:ss','getUsers','agent','user','fullname','internal','online','lastLoginAt','allowmessenger','-online','VoiceQueue','VoiceQueues','Agents','userProfileId','autoAssociation','UserProfileResource','isEmpty','role','push','FromId','ToId','read','-createdAt','all','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','ejs','lodash','squel','jsforce','desk.js','to-csv','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','register','sendStatus','status','end','count','offset','limit','set','Content-Range','apply','then','destroy','error','stack','name','send','index','map','ChatInternalMessage','rawAttributes','fieldName','key','query','keys','filters','model','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','includeAll','include','findAll','rows','catch','show','params','length','options','find','create','body','describe','get','messages','lastMessageAt','createdAt','lastMessage','format'];(function(_0x2a3702,_0x31452e){var _0x42dfef=function(_0x490850){while(--_0x490850){_0x2a3702['push'](_0x2a3702['shift']());}};_0x42dfef(++_0x31452e);}(_0x8dea,0x162));var _0xa8de=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8dea[_0x3dd15e];return _0x231fd0;};'use strict';var pdf=require(_0xa8de('0x0'));var emlformat=require(_0xa8de('0x1'));var rimraf=require(_0xa8de('0x2'));var zipdir=require(_0xa8de('0x3'));var jsonpatch=require(_0xa8de('0x4'));var rp=require(_0xa8de('0x5'));var moment=require(_0xa8de('0x6'));var BPromise=require(_0xa8de('0x7'));var Mustache=require('mustache');var util=require(_0xa8de('0x8'));var path=require(_0xa8de('0x9'));var sox=require(_0xa8de('0xa'));var csv=require('to-csv');var ejs=require(_0xa8de('0xb'));var fs=require('fs');var _=require(_0xa8de('0xc'));var squel=require(_0xa8de('0xd'));var crypto=require('crypto');var jsforce=require(_0xa8de('0xe'));var deskjs=require(_0xa8de('0xf'));var toCsv=require(_0xa8de('0x10'));var querystring=require(_0xa8de('0x11'));var Papa=require('papaparse');var Redis=require(_0xa8de('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xa8de('0x13'));var as=require(_0xa8de('0x14'));var hardwareService=require(_0xa8de('0x15'));var logger=require(_0xa8de('0x16'))(_0xa8de('0x17'));var utils=require(_0xa8de('0x18'));var config=require(_0xa8de('0x19'));var db=require(_0xa8de('0x1a'))['db'];config[_0xa8de('0x1b')]=_[_0xa8de('0x1c')](config[_0xa8de('0x1b')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xa8de('0x1b')]));require('./chatInternalMessage.socket')[_0xa8de('0x1d')](socket);function respondWithStatusCode(_0x25d98c,_0x19f22c){_0x19f22c=_0x19f22c||0xcc;return function(_0x4d11b3){if(_0x4d11b3){return _0x25d98c[_0xa8de('0x1e')](_0x19f22c);}return _0x25d98c[_0xa8de('0x1f')](_0x19f22c)[_0xa8de('0x20')]();};}function respondWithResult(_0x56a22c,_0x249e23){_0x249e23=_0x249e23||0xc8;return function(_0x123829){if(_0x123829){return _0x56a22c[_0xa8de('0x1f')](_0x249e23)['json'](_0x123829);}};}function respondWithFilteredResult(_0x54ac56,_0x39643e){return function(_0x176ce0){if(_0x176ce0){var _0x2d040f=_0x176ce0[_0xa8de('0x21')],_0x3d5730=_0x39643e[_0xa8de('0x22')],_0x2e2985=_0x39643e[_0xa8de('0x22')]+_0x39643e[_0xa8de('0x23')],_0x697fdf;if(_0x2e2985>=_0x2d040f){_0x2e2985=_0x2d040f;_0x697fdf=0xc8;}else{_0x697fdf=0xce;}_0x54ac56[_0xa8de('0x1f')](_0x697fdf);return _0x54ac56[_0xa8de('0x24')](_0xa8de('0x25'),_0x3d5730+'-'+_0x2e2985+'/'+_0x2d040f)['json'](_0x176ce0);}return null;};}function patchUpdates(_0x54b2fa){return function(_0x595cc7){try{jsonpatch[_0xa8de('0x26')](_0x595cc7,_0x54b2fa,!![]);}catch(_0x6c6f37){return BPromise['reject'](_0x6c6f37);}return _0x595cc7['save']();};}function saveUpdates(_0x5408d8,_0x50380c){return function(_0x5ef218){if(_0x5ef218){return _0x5ef218['update'](_0x5408d8)[_0xa8de('0x27')](function(_0x2d8fbb){return _0x2d8fbb;});}return null;};}function removeEntity(_0x5a0612,_0x4c999b){return function(_0x12619b){if(_0x12619b){return _0x12619b[_0xa8de('0x28')]()[_0xa8de('0x27')](function(){_0x5a0612[_0xa8de('0x1f')](0xcc)[_0xa8de('0x20')]();});}};}function handleEntityNotFound(_0x1e7621,_0x20aa17){return function(_0x546196){if(!_0x546196){_0x1e7621[_0xa8de('0x1e')](0x194);}return _0x546196;};}function handleError(_0x7afdd2,_0x5362d5){_0x5362d5=_0x5362d5||0x1f4;return function(_0xad1de8){logger[_0xa8de('0x29')](_0xad1de8[_0xa8de('0x2a')]);if(_0xad1de8[_0xa8de('0x2b')]){delete _0xad1de8[_0xa8de('0x2b')];}_0x7afdd2[_0xa8de('0x1f')](_0x5362d5)[_0xa8de('0x2c')](_0xad1de8);};}exports[_0xa8de('0x2d')]=function(_0x3ad493,_0x4fd400){var _0x246ddf={},_0x364fcd={},_0x3aabbf={'count':0x0,'rows':[]};var _0x5cedc2=_[_0xa8de('0x2e')](db[_0xa8de('0x2f')][_0xa8de('0x30')],function(_0x600a80){return{'name':_0x600a80[_0xa8de('0x31')],'type':_0x600a80['type'][_0xa8de('0x32')]};});_0x364fcd['model']=_['map'](_0x5cedc2,_0xa8de('0x2b'));_0x364fcd[_0xa8de('0x33')]=_[_0xa8de('0x34')](_0x3ad493[_0xa8de('0x33')]);_0x364fcd[_0xa8de('0x35')]=_['intersection'](_0x364fcd[_0xa8de('0x36')],_0x364fcd[_0xa8de('0x33')]);_0x246ddf[_0xa8de('0x37')]=_[_0xa8de('0x38')](_0x364fcd[_0xa8de('0x36')],qs[_0xa8de('0x39')](_0x3ad493[_0xa8de('0x33')][_0xa8de('0x39')]));_0x246ddf[_0xa8de('0x37')]=_0x246ddf[_0xa8de('0x37')]['length']?_0x246ddf['attributes']:_0x364fcd['model'];if(!_0x3ad493[_0xa8de('0x33')][_0xa8de('0x3a')](_0xa8de('0x3b'))){_0x246ddf[_0xa8de('0x23')]=qs[_0xa8de('0x23')](_0x3ad493[_0xa8de('0x33')]['limit']);_0x246ddf['offset']=qs[_0xa8de('0x22')](_0x3ad493['query'][_0xa8de('0x22')]);}_0x246ddf[_0xa8de('0x3c')]=qs['sort'](_0x3ad493[_0xa8de('0x33')][_0xa8de('0x3d')]);_0x246ddf[_0xa8de('0x3e')]=qs[_0xa8de('0x35')](_[_0xa8de('0x3f')](_0x3ad493[_0xa8de('0x33')],_0x364fcd[_0xa8de('0x35')]),_0x5cedc2);if(_0x3ad493[_0xa8de('0x33')][_0xa8de('0x40')]){_0x246ddf[_0xa8de('0x3e')]=_[_0xa8de('0x41')](_0x246ddf['where'],{'$or':_['map'](_0x5cedc2,function(_0x25bb69){if(_0x25bb69[_0xa8de('0x42')]!=='VIRTUAL'){var _0x3eb6={};_0x3eb6[_0x25bb69[_0xa8de('0x2b')]]={'$like':'%'+_0x3ad493[_0xa8de('0x33')][_0xa8de('0x40')]+'%'};return _0x3eb6;}})});}_0x246ddf=_[_0xa8de('0x41')]({},_0x246ddf,_0x3ad493['options']);var _0xb09f3e={'where':_0x246ddf['where']};return db['ChatInternalMessage']['count'](_0xb09f3e)[_0xa8de('0x27')](function(_0x55abe8){_0x3aabbf[_0xa8de('0x21')]=_0x55abe8;if(_0x3ad493[_0xa8de('0x33')][_0xa8de('0x43')]){_0x246ddf[_0xa8de('0x44')]=[{'all':!![]}];}return db['ChatInternalMessage'][_0xa8de('0x45')](_0x246ddf);})[_0xa8de('0x27')](function(_0x12ae79){_0x3aabbf[_0xa8de('0x46')]=_0x12ae79;return _0x3aabbf;})[_0xa8de('0x27')](respondWithFilteredResult(_0x4fd400,_0x246ddf))[_0xa8de('0x47')](handleError(_0x4fd400,null));};exports[_0xa8de('0x48')]=function(_0x36c674,_0x28c1f0){var _0x258cc3={'raw':!![],'where':{'id':_0x36c674[_0xa8de('0x49')]['id']}},_0x23d6af={};_0x23d6af['model']=_[_0xa8de('0x34')](db[_0xa8de('0x2f')][_0xa8de('0x30')]);_0x23d6af['query']=_[_0xa8de('0x34')](_0x36c674[_0xa8de('0x33')]);_0x23d6af[_0xa8de('0x35')]=_['intersection'](_0x23d6af[_0xa8de('0x36')],_0x23d6af['query']);_0x258cc3['attributes']=_[_0xa8de('0x38')](_0x23d6af[_0xa8de('0x36')],qs[_0xa8de('0x39')](_0x36c674[_0xa8de('0x33')]['fields']));_0x258cc3[_0xa8de('0x37')]=_0x258cc3[_0xa8de('0x37')][_0xa8de('0x4a')]?_0x258cc3[_0xa8de('0x37')]:_0x23d6af[_0xa8de('0x36')];if(_0x36c674['query']['includeAll']){_0x258cc3['include']=[{'all':!![]}];}_0x258cc3=_['merge']({},_0x258cc3,_0x36c674[_0xa8de('0x4b')]);return db['ChatInternalMessage'][_0xa8de('0x4c')](_0x258cc3)[_0xa8de('0x27')](handleEntityNotFound(_0x28c1f0,null))[_0xa8de('0x27')](respondWithResult(_0x28c1f0,null))[_0xa8de('0x47')](handleError(_0x28c1f0,null));};exports[_0xa8de('0x4d')]=function(_0x5bdb66,_0x571812){return db['ChatInternalMessage'][_0xa8de('0x4d')](_0x5bdb66['body'],{})[_0xa8de('0x27')](respondWithResult(_0x571812,0xc9))[_0xa8de('0x47')](handleError(_0x571812,null));};exports['update']=function(_0x285110,_0x105bd2){if(_0x285110[_0xa8de('0x4e')]['id']){delete _0x285110[_0xa8de('0x4e')]['id'];}return db[_0xa8de('0x2f')]['find']({'where':{'id':_0x285110[_0xa8de('0x49')]['id']}})[_0xa8de('0x27')](handleEntityNotFound(_0x105bd2,null))['then'](saveUpdates(_0x285110['body'],null))[_0xa8de('0x27')](respondWithResult(_0x105bd2,null))[_0xa8de('0x47')](handleError(_0x105bd2,null));};exports[_0xa8de('0x28')]=function(_0x3c8bad,_0x36b361){return db[_0xa8de('0x2f')]['find']({'where':{'id':_0x3c8bad[_0xa8de('0x49')]['id']}})[_0xa8de('0x27')](handleEntityNotFound(_0x36b361,null))[_0xa8de('0x27')](removeEntity(_0x36b361,null))['catch'](handleError(_0x36b361,null));};exports['describe']=function(_0x4f907c,_0x5a4518){return db[_0xa8de('0x2f')][_0xa8de('0x4f')]()['then'](respondWithResult(_0x5a4518,null))[_0xa8de('0x47')](handleError(_0x5a4518,null));};function wrapUser(_0x44f9d8){return function(_0x1e588c){var _0x365e72=_0x44f9d8[_0xa8de('0x50')]({'plain':!![]});_0x365e72[_0xa8de('0x51')]=[];if(_0x1e588c){_0x365e72[_0xa8de('0x52')]=_0x1e588c[_0xa8de('0x53')];_0x365e72[_0xa8de('0x54')]=_0x1e588c;}else{_0x365e72['lastMessageAt']=moment(0x0)[_0xa8de('0x55')](_0xa8de('0x56'));_0x365e72[_0xa8de('0x54')]={};}return _0x365e72;};}exports[_0xa8de('0x57')]=function(_0x58f7fe,_0x868033,_0x36f968){var _0x1b6440=[];return db['User']['findAll']({'where':{'role':[_0xa8de('0x58'),'admin',_0xa8de('0x59')]},'attributes':['id',_0xa8de('0x5a'),_0xa8de('0x2b'),'role','userpic',_0xa8de('0x5b'),_0xa8de('0x5c'),_0xa8de('0x5d'),_0xa8de('0x5e'),'showWebBar'],'order':qs[_0xa8de('0x3d')](_0xa8de('0x5f')),'include':[{'model':db[_0xa8de('0x60')],'as':_0xa8de('0x61'),'attributes':['id',_0xa8de('0x2b'),_0xa8de('0x42')],'through':{'attributes':[]}}]})[_0xa8de('0x27')](function(_0x39ae78){if(_0x39ae78){var _0xe49b64=_0x58f7fe['user'][_0xa8de('0x50')]({'plain':!![]});if(!_0xe49b64)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xe49b64['role']===_0xa8de('0x59')){return db['UserProfileSection']['find']({'where':{'name':_0xa8de('0x62'),'userProfileId':_0xe49b64[_0xa8de('0x63')]},'raw':!![]})['then'](function(_0x23a43a){if(_0x23a43a){if(_0x23a43a[_0xa8de('0x64')]===0x0){return db[_0xa8de('0x65')][_0xa8de('0x45')]({'where':{'sectionId':_0x23a43a['id']},'raw':!![]})[_0xa8de('0x27')](function(_0x95bf98){var _0x14689a=[];if(_[_0xa8de('0x66')](_0x95bf98)){_0x14689a=_[_0xa8de('0x40')](_0x39ae78,function(_0x55e884){if(_0x55e884[_0xa8de('0x67')]!==_0xa8de('0x58')){return _0x55e884;}});return _0x14689a;}else{for(var _0x1ee961=0x0;_0x1ee961<_0x39ae78[_0xa8de('0x4a')];_0x1ee961++){var _0xd537e5=_0x39ae78[_0x1ee961];if(_0xd537e5[_0xa8de('0x67')]==='agent'){var _0x44e90b=_[_0xa8de('0x4c')](_0x95bf98,function(_0x23eb4e){return _0x23eb4e['resourceId']===_0xd537e5['id'];});if(_0x44e90b)_0x14689a[_0xa8de('0x68')](_0xd537e5);}else{_0x14689a['push'](_0xd537e5);}}return _0x14689a;}});}else{return _0x39ae78;}}else{var _0x285c83=_[_0xa8de('0x40')](_0x39ae78,function(_0x3c6ae0){if(_0x3c6ae0['role']!==_0xa8de('0x58')){return _0x3c6ae0;}});return _0x285c83;}});}else{return _0x39ae78;}}})[_0xa8de('0x27')](function(_0x126bc8){var _0x4ea3c0=[];if(_0x126bc8){_0x1b6440=_0x126bc8;for(var _0x5c4054=0x0;_0x5c4054<_0x126bc8[_0xa8de('0x4a')];_0x5c4054+=0x1){_0x1b6440[_0x5c4054][_0xa8de('0x51')]=[];_0x4ea3c0[_0xa8de('0x68')](db[_0xa8de('0x2f')][_0xa8de('0x4c')]({'where':{'FromId':[_0x58f7fe[_0xa8de('0x59')]['id'],_0x126bc8[_0x5c4054]['id']],'ToId':[_0x58f7fe['user']['id'],_0x126bc8[_0x5c4054]['id']],'ChatGroupId':null},'attributes':['id',_0xa8de('0x53'),_0xa8de('0x69'),_0xa8de('0x6a'),_0xa8de('0x6b'),_0xa8de('0x4e')],'order':qs[_0xa8de('0x3d')](_0xa8de('0x6c')),'limit':0x1,'offset':0x0,'raw':!![]})[_0xa8de('0x27')](wrapUser(_0x126bc8[_0x5c4054])));}return BPromise[_0xa8de('0x6d')](_0x4ea3c0);}return[];})['then'](function(_0x4bf9ba){return{'rows':_0x4bf9ba,'count':_0x4bf9ba[_0xa8de('0x4a')]};})[_0xa8de('0x27')](respondWithResult(_0x868033,null))[_0xa8de('0x47')](handleError(_0x868033,null));};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.events.js b/server/api/chatInternalMessage/chatInternalMessage.events.js
index ee23bd6..39eebfb 100644
--- a/server/api/chatInternalMessage/chatInternalMessage.events.js
+++ b/server/api/chatInternalMessage/chatInternalMessage.events.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x6fc4=['hasOwnProperty','hook','exports','events','../../mysqldb','save','emit'];(function(_0x3d2580,_0x5bcf59){var _0x1bed34=function(_0x4838e5){while(--_0x4838e5){_0x3d2580['push'](_0x3d2580['shift']());}};_0x1bed34(++_0x5bcf59);}(_0x6fc4,0x1a0));var _0x46fc=function(_0x1278b6,_0x24252e){_0x1278b6=_0x1278b6-0x0;var _0x2cff42=_0x6fc4[_0x1278b6];return _0x2cff42;};'use strict';var EventEmitter=require(_0x46fc('0x0'));var ChatInternalMessage=require(_0x46fc('0x1'))['db']['ChatInternalMessage'];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x46fc('0x2'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x4e3ca5){return function(_0x34e479,_0x27d5dd,_0x13b05b){ChatInternalMessageEvents[_0x46fc('0x3')](_0x4e3ca5+':'+_0x34e479['id'],_0x34e479);ChatInternalMessageEvents[_0x46fc('0x3')](_0x4e3ca5,_0x34e479);_0x13b05b(null);};}for(var e in events){if(events[_0x46fc('0x4')](e)){var event=events[e];ChatInternalMessage[_0x46fc('0x5')](e,emitEvent(event));}}module[_0x46fc('0x6')]=ChatInternalMessageEvents;
\ No newline at end of file
+var _0xf50a=['setMaxListeners','update','remove','emit','hook','exports','../../mysqldb'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0xf50a,0x1b8));var _0xaf50=function(_0x310eaf,_0x5024e1){_0x310eaf=_0x310eaf-0x0;var _0xbab0d8=_0xf50a[_0x310eaf];return _0xbab0d8;};'use strict';var EventEmitter=require('events');var ChatInternalMessage=require(_0xaf50('0x0'))['db']['ChatInternalMessage'];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0xaf50('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0xaf50('0x2'),'afterDestroy':_0xaf50('0x3')};function emitEvent(_0x2a92a6){return function(_0x570778,_0x3db96b,_0x2d9951){ChatInternalMessageEvents['emit'](_0x2a92a6+':'+_0x570778['id'],_0x570778);ChatInternalMessageEvents[_0xaf50('0x4')](_0x2a92a6,_0x570778);_0x2d9951(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInternalMessage[_0xaf50('0x5')](e,emitEvent(event));}}module[_0xaf50('0x6')]=ChatInternalMessageEvents;
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.model.js b/server/api/chatInternalMessage/chatInternalMessage.model.js
index 88ea4be..097c4cd 100644
--- a/server/api/chatInternalMessage/chatInternalMessage.model.js
+++ b/server/api/chatInternalMessage/chatInternalMessage.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xb4db=['moment','bluebird','request-promise','path','../../config/environment','./chatInternalMessage.attributes','exports','chat_internal_messages','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0xb4db,0x130));var _0xbb4d=function(_0x52a664,_0x2716ad){_0x52a664=_0x52a664-0x0;var _0x18e9fb=_0xb4db[_0x52a664];return _0x18e9fb;};'use strict';var _=require(_0xbb4d('0x0'));var util=require(_0xbb4d('0x1'));var logger=require(_0xbb4d('0x2'))(_0xbb4d('0x3'));var moment=require(_0xbb4d('0x4'));var BPromise=require(_0xbb4d('0x5'));var rp=require(_0xbb4d('0x6'));var fs=require('fs');var path=require(_0xbb4d('0x7'));var rimraf=require('rimraf');var config=require(_0xbb4d('0x8'));var attributes=require(_0xbb4d('0x9'));module[_0xbb4d('0xa')]=function(_0x32271c,_0x31e99b){return _0x32271c['define']('ChatInternalMessage',attributes,{'tableName':_0xbb4d('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xbb4d('0xc'),'collate':_0xbb4d('0xd')});};
\ No newline at end of file
+var _0xb137=['moment','request-promise','path','rimraf','exports','define','utf8mb4','utf8mb4_unicode_ci','lodash'];(function(_0x5a98d5,_0x1f476d){var _0x753c1b=function(_0x4e0ba6){while(--_0x4e0ba6){_0x5a98d5['push'](_0x5a98d5['shift']());}};_0x753c1b(++_0x1f476d);}(_0xb137,0x1b8));var _0x7b13=function(_0x40a77f,_0x1d5f8d){_0x40a77f=_0x40a77f-0x0;var _0x415aa1=_0xb137[_0x40a77f];return _0x415aa1;};'use strict';var _=require(_0x7b13('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x7b13('0x1'));var BPromise=require('bluebird');var rp=require(_0x7b13('0x2'));var fs=require('fs');var path=require(_0x7b13('0x3'));var rimraf=require(_0x7b13('0x4'));var config=require('../../config/environment');var attributes=require('./chatInternalMessage.attributes');module[_0x7b13('0x5')]=function(_0x41047e,_0x2a6a76){return _0x41047e[_0x7b13('0x6')]('ChatInternalMessage',attributes,{'tableName':'chat_internal_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x7b13('0x7'),'collate':_0x7b13('0x8')});};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.rpc.js b/server/api/chatInternalMessage/chatInternalMessage.rpc.js
index 3fc37a9..9bc39eb 100644
--- a/server/api/chatInternalMessage/chatInternalMessage.rpc.js
+++ b/server/api/chatInternalMessage/chatInternalMessage.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9fc1=['redis','localhost','socket.io-emitter','./chatInternalMessage.socket','register','request','then','info','ChatInternalMessage,\x20%s,\x20%s','request\x20sent','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http'];(function(_0xc6436,_0x45a5eb){var _0x473f3c=function(_0x57f325){while(--_0x57f325){_0xc6436['push'](_0xc6436['shift']());}};_0x473f3c(++_0x45a5eb);}(_0x9fc1,0x199));var _0x19fc=function(_0x50304a,_0x32b93a){_0x50304a=_0x50304a-0x0;var _0x4e2c52=_0x9fc1[_0x50304a];return _0x4e2c52;};'use strict';var _=require(_0x19fc('0x0'));var util=require(_0x19fc('0x1'));var moment=require(_0x19fc('0x2'));var BPromise=require(_0x19fc('0x3'));var rs=require(_0x19fc('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x19fc('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x19fc('0x6'))(_0x19fc('0x7'));var config=require(_0x19fc('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x19fc('0x9')][_0x19fc('0xa')]({'port':0x232a});config[_0x19fc('0xb')]=_['defaults'](config[_0x19fc('0xb')],{'host':_0x19fc('0xc'),'port':0x18eb});var socket=require(_0x19fc('0xd'))(new Redis(config[_0x19fc('0xb')]));require(_0x19fc('0xe'))[_0x19fc('0xf')](socket);function respondWithRpcPromise(_0x1d8880,_0x20bcad,_0x1e599e){return new BPromise(function(_0x49df66,_0x1d7bd7){return client[_0x19fc('0x10')](_0x1d8880,_0x1e599e)[_0x19fc('0x11')](function(_0x1940fa){logger[_0x19fc('0x12')](_0x19fc('0x13'),_0x20bcad,_0x19fc('0x14'));logger[_0x19fc('0x15')](_0x19fc('0x16'),_0x20bcad,'request\x20sent',JSON[_0x19fc('0x17')](_0x1940fa));if(_0x1940fa['error']){if(_0x1940fa[_0x19fc('0x18')][_0x19fc('0x19')]===0x1f4){logger['error'](_0x19fc('0x13'),_0x20bcad,_0x1940fa['error']['message']);return _0x1d7bd7(_0x1940fa[_0x19fc('0x18')][_0x19fc('0x1a')]);}logger[_0x19fc('0x18')](_0x19fc('0x13'),_0x20bcad,_0x1940fa[_0x19fc('0x18')][_0x19fc('0x1a')]);return _0x49df66(_0x1940fa['error'][_0x19fc('0x1a')]);}else{logger['info'](_0x19fc('0x13'),_0x20bcad,_0x19fc('0x14'));_0x49df66(_0x1940fa['result'][_0x19fc('0x1a')]);}})[_0x19fc('0x1b')](function(_0x224a5b){logger['error'](_0x19fc('0x13'),_0x20bcad,_0x224a5b);_0x1d7bd7(_0x224a5b);});});}
\ No newline at end of file
+var _0xc0b7=['../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','./chatInternalMessage.socket','register','info','ChatInternalMessage,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x37ad4c,_0x2c8a9c){var _0x2c14d6=function(_0x4962cf){while(--_0x4962cf){_0x37ad4c['push'](_0x37ad4c['shift']());}};_0x2c14d6(++_0x2c8a9c);}(_0xc0b7,0xb9));var _0x7c0b=function(_0x2f4141,_0x3de02a){_0x2f4141=_0x2f4141-0x0;var _0x36f1ad=_0xc0b7[_0x2f4141];return _0x36f1ad;};'use strict';var _=require('lodash');var util=require(_0x7c0b('0x0'));var moment=require(_0x7c0b('0x1'));var BPromise=require(_0x7c0b('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7c0b('0x3'))['db'];var utils=require(_0x7c0b('0x4'));var logger=require(_0x7c0b('0x5'))(_0x7c0b('0x6'));var config=require(_0x7c0b('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x7c0b('0x8')][_0x7c0b('0x9')]({'port':0x232a});config[_0x7c0b('0xa')]=_[_0x7c0b('0xb')](config['redis'],{'host':_0x7c0b('0xc'),'port':0x18eb});var socket=require(_0x7c0b('0xd'))(new Redis(config[_0x7c0b('0xa')]));require(_0x7c0b('0xe'))[_0x7c0b('0xf')](socket);function respondWithRpcPromise(_0x570c11,_0x34016e,_0xb36415){return new BPromise(function(_0x474b76,_0x5ca70a){return client['request'](_0x570c11,_0xb36415)['then'](function(_0x2ae24f){logger[_0x7c0b('0x10')](_0x7c0b('0x11'),_0x34016e,_0x7c0b('0x12'));logger['debug']('ChatInternalMessage,\x20%s,\x20%s,\x20%s',_0x34016e,'request\x20sent',JSON[_0x7c0b('0x13')](_0x2ae24f));if(_0x2ae24f['error']){if(_0x2ae24f[_0x7c0b('0x14')]['code']===0x1f4){logger[_0x7c0b('0x14')](_0x7c0b('0x11'),_0x34016e,_0x2ae24f[_0x7c0b('0x14')][_0x7c0b('0x15')]);return _0x5ca70a(_0x2ae24f['error'][_0x7c0b('0x15')]);}logger[_0x7c0b('0x14')](_0x7c0b('0x11'),_0x34016e,_0x2ae24f['error']['message']);return _0x474b76(_0x2ae24f[_0x7c0b('0x14')][_0x7c0b('0x15')]);}else{logger[_0x7c0b('0x10')](_0x7c0b('0x11'),_0x34016e,_0x7c0b('0x12'));_0x474b76(_0x2ae24f[_0x7c0b('0x16')][_0x7c0b('0x15')]);}})[_0x7c0b('0x17')](function(_0x48bc5c){logger[_0x7c0b('0x14')](_0x7c0b('0x11'),_0x34016e,_0x48bc5c);_0x5ca70a(_0x48bc5c);});});}
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.socket.js b/server/api/chatInternalMessage/chatInternalMessage.socket.js
index fae7b11..7aced4b 100644
--- a/server/api/chatInternalMessage/chatInternalMessage.socket.js
+++ b/server/api/chatInternalMessage/chatInternalMessage.socket.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xc818=['update','emit','removeListener','register','length','chatInternalMessage:','./chatInternalMessage.events','save','remove'];(function(_0x134c2e,_0x3573c4){var _0x2825db=function(_0x2a574d){while(--_0x2a574d){_0x134c2e['push'](_0x134c2e['shift']());}};_0x2825db(++_0x3573c4);}(_0xc818,0x1e3));var _0x8c81=function(_0x5a455a,_0x3562a2){_0x5a455a=_0x5a455a-0x0;var _0x4b9c20=_0xc818[_0x5a455a];return _0x4b9c20;};'use strict';var ChatInternalMessageEvents=require(_0x8c81('0x0'));var events=[_0x8c81('0x1'),_0x8c81('0x2'),_0x8c81('0x3')];function createListener(_0x5e6597,_0x461c5f){return function(_0x7a8137){_0x461c5f[_0x8c81('0x4')](_0x5e6597,_0x7a8137);};}function removeListener(_0x7e329f,_0x1a61ab){return function(){ChatInternalMessageEvents[_0x8c81('0x5')](_0x7e329f,_0x1a61ab);};}exports[_0x8c81('0x6')]=function(_0x4a6e65){for(var _0x2c5966=0x0,_0x3d663e=events[_0x8c81('0x7')];_0x2c5966<_0x3d663e;_0x2c5966++){var _0x43d142=events[_0x2c5966];var _0x501240=createListener(_0x8c81('0x8')+_0x43d142,_0x4a6e65);ChatInternalMessageEvents['on'](_0x43d142,_0x501240);}};
\ No newline at end of file
+var _0x5d55=['save','update','emit','removeListener','register','length','chatInternalMessage:'];(function(_0x3e43b3,_0xfb2173){var _0x576c32=function(_0x29f81f){while(--_0x29f81f){_0x3e43b3['push'](_0x3e43b3['shift']());}};_0x576c32(++_0xfb2173);}(_0x5d55,0x1a4));var _0x55d5=function(_0x5aeb2c,_0x462724){_0x5aeb2c=_0x5aeb2c-0x0;var _0x1dcd9e=_0x5d55[_0x5aeb2c];return _0x1dcd9e;};'use strict';var ChatInternalMessageEvents=require('./chatInternalMessage.events');var events=[_0x55d5('0x0'),'remove',_0x55d5('0x1')];function createListener(_0x441dc5,_0x47de4d){return function(_0x46c617){_0x47de4d[_0x55d5('0x2')](_0x441dc5,_0x46c617);};}function removeListener(_0x3bca0b,_0x546e6c){return function(){ChatInternalMessageEvents[_0x55d5('0x3')](_0x3bca0b,_0x546e6c);};}exports[_0x55d5('0x4')]=function(_0x33e5c5){for(var _0x35fe43=0x0,_0x16d364=events[_0x55d5('0x5')];_0x35fe43<_0x16d364;_0x35fe43++){var _0x454144=events[_0x35fe43];var _0x3937d3=createListener(_0x55d5('0x6')+_0x454144,_0x33e5c5);ChatInternalMessageEvents['on'](_0x454144,_0x3937d3);}};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/index.js b/server/api/chatInternalMessage/index.js
index 2ae7fdf..599875a 100644
--- a/server/api/chatInternalMessage/index.js
+++ b/server/api/chatInternalMessage/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x70e0=['exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','describe','/users','isAuthenticated','getUsers','/:id','post','create','put','update','delete','destroy'];(function(_0x1b25f8,_0xc8cf2f){var _0x271234=function(_0x4a66a7){while(--_0x4a66a7){_0x1b25f8['push'](_0x1b25f8['shift']());}};_0x271234(++_0xc8cf2f);}(_0x70e0,0x17b));var _0x070e=function(_0x2cfc46,_0x2629f1){_0x2cfc46=_0x2cfc46-0x0;var _0x446d8f=_0x70e0[_0x2cfc46];return _0x446d8f;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var auth=require(_0x070e('0x4'));var interaction=require(_0x070e('0x5'));var config=require(_0x070e('0x6'));var controller=require('./chatInternalMessage.controller');router[_0x070e('0x7')]('/',auth['isAuthenticated'](),controller[_0x070e('0x8')]);router['get']('/describe',auth['isAuthenticated'](),controller[_0x070e('0x9')]);router[_0x070e('0x7')](_0x070e('0xa'),auth[_0x070e('0xb')](),controller[_0x070e('0xc')]);router[_0x070e('0x7')](_0x070e('0xd'),auth['isAuthenticated'](),controller['show']);router[_0x070e('0xe')]('/',auth[_0x070e('0xb')](),controller[_0x070e('0xf')]);router[_0x070e('0x10')](_0x070e('0xd'),controller[_0x070e('0x11')]);router[_0x070e('0x12')](_0x070e('0xd'),auth[_0x070e('0xb')](),controller[_0x070e('0x13')]);module[_0x070e('0x14')]=router;
\ No newline at end of file
+var _0x70e0=['exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','describe','/users','isAuthenticated','getUsers','/:id','post','create','put','update','delete','destroy'];(function(_0x5631e5,_0x373f18){var _0x477444=function(_0xc373a7){while(--_0xc373a7){_0x5631e5['push'](_0x5631e5['shift']());}};_0x477444(++_0x373f18);}(_0x70e0,0x17b));var _0x070e=function(_0x6abdbf,_0x54f37e){_0x6abdbf=_0x6abdbf-0x0;var _0x2a5314=_0x70e0[_0x6abdbf];return _0x2a5314;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var auth=require(_0x070e('0x4'));var interaction=require(_0x070e('0x5'));var config=require(_0x070e('0x6'));var controller=require('./chatInternalMessage.controller');router[_0x070e('0x7')]('/',auth['isAuthenticated'](),controller[_0x070e('0x8')]);router['get']('/describe',auth['isAuthenticated'](),controller[_0x070e('0x9')]);router[_0x070e('0x7')](_0x070e('0xa'),auth[_0x070e('0xb')](),controller[_0x070e('0xc')]);router[_0x070e('0x7')](_0x070e('0xd'),auth['isAuthenticated'](),controller['show']);router[_0x070e('0xe')]('/',auth[_0x070e('0xb')](),controller[_0x070e('0xf')]);router[_0x070e('0x10')](_0x070e('0xd'),controller[_0x070e('0x11')]);router[_0x070e('0x12')](_0x070e('0xd'),auth[_0x070e('0xb')](),controller[_0x070e('0x13')]);module[_0x070e('0x14')]=router;
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.attributes.js b/server/api/chatMessage/chatMessage.attributes.js
index 3aea280..3ea3d1e 100644
--- a/server/api/chatMessage/chatMessage.attributes.js
+++ b/server/api/chatMessage/chatMessage.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x80ee=['sequelize','exports','TEXT','medium','BOOLEAN','ENUM','out','DATE'];(function(_0x2d982d,_0x121028){var _0x4f36b0=function(_0x11f3a9){while(--_0x11f3a9){_0x2d982d['push'](_0x2d982d['shift']());}};_0x4f36b0(++_0x121028);}(_0x80ee,0x158));var _0xe80e=function(_0x56b034,_0xb96f9b){_0x56b034=_0x56b034-0x0;var _0x25f338=_0x80ee[_0x56b034];return _0x25f338;};'use strict';var Sequelize=require(_0xe80e('0x0'));module[_0xe80e('0x1')]={'body':{'type':Sequelize[_0xe80e('0x2')](_0xe80e('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0xe80e('0x4')],'defaultValue':![]},'secret':{'type':Sequelize[_0xe80e('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0xe80e('0x5')]('in',_0xe80e('0x6')),'defaultValue':_0xe80e('0x6'),'allowNull':![]},'readAt':{'type':Sequelize[_0xe80e('0x7')]}};
\ No newline at end of file
+var _0xec15=['medium','BOOLEAN','out','DATE','sequelize'];(function(_0x3628bf,_0x4e7422){var _0x57a32b=function(_0x301081){while(--_0x301081){_0x3628bf['push'](_0x3628bf['shift']());}};_0x57a32b(++_0x4e7422);}(_0xec15,0xe5));var _0x5ec1=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xec15[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require(_0x5ec1('0x0'));module['exports']={'body':{'type':Sequelize['TEXT'](_0x5ec1('0x1')),'allowNull':![]},'read':{'type':Sequelize[_0x5ec1('0x2')],'defaultValue':![]},'secret':{'type':Sequelize[_0x5ec1('0x2')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0x5ec1('0x3')),'defaultValue':_0x5ec1('0x3'),'allowNull':![]},'readAt':{'type':Sequelize[_0x5ec1('0x4')]}};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.controller.js b/server/api/chatMessage/chatMessage.controller.js
index 4d85b15..ad83389 100644
--- a/server/api/chatMessage/chatMessage.controller.js
+++ b/server/api/chatMessage/chatMessage.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xb375=['interface','rejectmessage','html-pdf','zip-dir','moment','bluebird','util','sox','to-csv','ejs','squel','crypto','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','./chatMessage.socket','register','client','http','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','info','ChatMessage,\x20%s,\x20%s','request\x20sent','stringify','error','message','catch','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','stack','name','send','map','rawAttributes','fieldName','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filter','merge','where','type','options','ChatMessage','includeAll','include','rows','show','keys','find','create','body','params','destroy','describe','accept','chat','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','get','ChatInteraction','ChatInteractionId','read1stAt','interaction','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','AcceptMessage','acceptMessage','manual','SIP/%s','channel','EventManager','acceptmessage','formData','chat-interactions','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','RejectMessage','rejectMessage'];(function(_0x41fc7f,_0x123a6d){var _0x5cabfe=function(_0x507955){while(--_0x507955){_0x41fc7f['push'](_0x41fc7f['shift']());}};_0x5cabfe(++_0x123a6d);}(_0xb375,0xea));var _0x5b37=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xb375[_0x2641f9];return _0x585741;};'use strict';var pdf=require(_0x5b37('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x5b37('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x5b37('0x2'));var BPromise=require(_0x5b37('0x3'));var Mustache=require('mustache');var util=require(_0x5b37('0x4'));var path=require('path');var sox=require(_0x5b37('0x5'));var csv=require(_0x5b37('0x6'));var ejs=require(_0x5b37('0x7'));var fs=require('fs');var _=require('lodash');var squel=require(_0x5b37('0x8'));var crypto=require(_0x5b37('0x9'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x5b37('0x6'));var querystring=require(_0x5b37('0xa'));var Papa=require('papaparse');var Redis=require(_0x5b37('0xb'));var authService=require('../../components/auth/service');var qs=require(_0x5b37('0xc'));var as=require(_0x5b37('0xd'));var hardwareService=require(_0x5b37('0xe'));var logger=require(_0x5b37('0xf'))(_0x5b37('0x10'));var utils=require(_0x5b37('0x11'));var config=require(_0x5b37('0x12'));var db=require(_0x5b37('0x13'))['db'];config[_0x5b37('0x14')]=_[_0x5b37('0x15')](config['redis'],{'host':_0x5b37('0x16'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x5b37('0x14')]));require(_0x5b37('0x17'))[_0x5b37('0x18')](socket);var jayson=require('jayson/promise');var client=jayson[_0x5b37('0x19')][_0x5b37('0x1a')]({'port':0x232c});var client9002=jayson[_0x5b37('0x19')][_0x5b37('0x1a')]({'port':0x232a});function checkPasswordPattern(_0x21a219,_0xa688cc,_0x33edef){if(_0x33edef){var _0x191142=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x191142[_0x5b37('0x1b')](_0xa688cc)){return _0x21a219;}else{throw new db[(_0x5b37('0x1c'))][(_0x5b37('0x1d'))](_0x5b37('0x1e'));}}else{return _0x21a219;}}function respondWithRpcPromise(_0x573b36,_0xeaf3a8,_0x22d45e,_0x4c2e18){return new BPromise(function(_0x3ef22e,_0x5336b7){var _0x25bba5=_0x4c2e18||client;return _0x25bba5[_0x5b37('0x1f')](_0x573b36,_0x22d45e)['then'](function(_0x315dd6){logger[_0x5b37('0x20')](_0x5b37('0x21'),_0xeaf3a8,_0x5b37('0x22'));logger['debug']('ChatMessage,\x20%s,\x20%s,\x20%s',_0xeaf3a8,_0x5b37('0x22'),JSON[_0x5b37('0x23')](_0x315dd6));if(_0x315dd6[_0x5b37('0x24')]){if(_0x315dd6[_0x5b37('0x24')]['code']===0x1f4){logger['error']('ChatMessage,\x20%s,\x20%s',_0xeaf3a8,_0x315dd6['error']['message']);return _0x5336b7(_0x315dd6[_0x5b37('0x24')][_0x5b37('0x25')]);}logger[_0x5b37('0x24')]('ChatMessage,\x20%s,\x20%s',_0xeaf3a8,_0x315dd6[_0x5b37('0x24')][_0x5b37('0x25')]);return _0x3ef22e(_0x315dd6[_0x5b37('0x24')]['message']);}else{logger[_0x5b37('0x20')](_0x5b37('0x21'),_0xeaf3a8,_0x5b37('0x22'));_0x3ef22e(_0x315dd6['result'][_0x5b37('0x25')]);}})[_0x5b37('0x26')](function(_0x48b15d){logger[_0x5b37('0x24')](_0x5b37('0x21'),_0xeaf3a8,_0x48b15d);_0x5336b7(_0x48b15d);});});}function respondWithStatusCode(_0xaf6fe3,_0x4dfd2c){_0x4dfd2c=_0x4dfd2c||0xcc;return function(_0x372b6d){if(_0x372b6d){return _0xaf6fe3[_0x5b37('0x27')](_0x4dfd2c);}return _0xaf6fe3[_0x5b37('0x28')](_0x4dfd2c)[_0x5b37('0x29')]();};}function respondWithResult(_0x3c132e,_0xcda969){_0xcda969=_0xcda969||0xc8;return function(_0x4dca65){if(_0x4dca65){return _0x3c132e[_0x5b37('0x28')](_0xcda969)[_0x5b37('0x2a')](_0x4dca65);}};}function respondWithFilteredResult(_0xcdc418,_0xc63f60){return function(_0x19f513){if(_0x19f513){var _0x15c0e6=_0x19f513[_0x5b37('0x2b')],_0x3ac93a=_0xc63f60[_0x5b37('0x2c')],_0x2e8e6c=_0xc63f60['offset']+_0xc63f60[_0x5b37('0x2d')],_0x2ded7c;if(_0x2e8e6c>=_0x15c0e6){_0x2e8e6c=_0x15c0e6;_0x2ded7c=0xc8;}else{_0x2ded7c=0xce;}_0xcdc418[_0x5b37('0x28')](_0x2ded7c);return _0xcdc418[_0x5b37('0x2e')](_0x5b37('0x2f'),_0x3ac93a+'-'+_0x2e8e6c+'/'+_0x15c0e6)[_0x5b37('0x2a')](_0x19f513);}return null;};}function patchUpdates(_0x1d5195){return function(_0x56365d){try{jsonpatch[_0x5b37('0x30')](_0x56365d,_0x1d5195,!![]);}catch(_0x39760d){return BPromise[_0x5b37('0x31')](_0x39760d);}return _0x56365d[_0x5b37('0x32')]();};}function saveUpdates(_0x250035,_0x3d5051){return function(_0x41824a){if(_0x41824a){return _0x41824a[_0x5b37('0x33')](_0x250035)[_0x5b37('0x34')](function(_0x2494f3){return _0x2494f3;});}return null;};}function removeEntity(_0xee589,_0x1f1398){return function(_0x3479f6){if(_0x3479f6){return _0x3479f6['destroy']()[_0x5b37('0x34')](function(){_0xee589[_0x5b37('0x28')](0xcc)[_0x5b37('0x29')]();});}};}function handleEntityNotFound(_0x1f9b7e,_0x415e0d){return function(_0x6c3e23){if(!_0x6c3e23){_0x1f9b7e[_0x5b37('0x27')](0x194);}return _0x6c3e23;};}function handleError(_0x432346,_0x1fa3a1){_0x1fa3a1=_0x1fa3a1||0x1f4;return function(_0x1e79d2){logger[_0x5b37('0x24')](_0x1e79d2[_0x5b37('0x35')]);if(_0x1e79d2['name']){delete _0x1e79d2[_0x5b37('0x36')];}_0x432346[_0x5b37('0x28')](_0x1fa3a1)[_0x5b37('0x37')](_0x1e79d2);};}exports['index']=function(_0x36b76a,_0x256afb){var _0x109666={},_0x574115={},_0x59cfa5={'count':0x0,'rows':[]};var _0x4c7586=_[_0x5b37('0x38')](db['ChatMessage'][_0x5b37('0x39')],function(_0x399d93){return{'name':_0x399d93[_0x5b37('0x3a')],'type':_0x399d93['type'][_0x5b37('0x3b')]};});_0x574115[_0x5b37('0x3c')]=_[_0x5b37('0x38')](_0x4c7586,_0x5b37('0x36'));_0x574115[_0x5b37('0x3d')]=_['keys'](_0x36b76a[_0x5b37('0x3d')]);_0x574115[_0x5b37('0x3e')]=_[_0x5b37('0x3f')](_0x574115[_0x5b37('0x3c')],_0x574115[_0x5b37('0x3d')]);_0x109666[_0x5b37('0x40')]=_['intersection'](_0x574115[_0x5b37('0x3c')],qs[_0x5b37('0x41')](_0x36b76a[_0x5b37('0x3d')][_0x5b37('0x41')]));_0x109666[_0x5b37('0x40')]=_0x109666[_0x5b37('0x40')][_0x5b37('0x42')]?_0x109666[_0x5b37('0x40')]:_0x574115[_0x5b37('0x3c')];if(!_0x36b76a['query'][_0x5b37('0x43')](_0x5b37('0x44'))){_0x109666[_0x5b37('0x2d')]=qs[_0x5b37('0x2d')](_0x36b76a[_0x5b37('0x3d')][_0x5b37('0x2d')]);_0x109666[_0x5b37('0x2c')]=qs[_0x5b37('0x2c')](_0x36b76a[_0x5b37('0x3d')][_0x5b37('0x2c')]);}_0x109666[_0x5b37('0x45')]=qs[_0x5b37('0x46')](_0x36b76a[_0x5b37('0x3d')][_0x5b37('0x46')]);_0x109666['where']=qs[_0x5b37('0x3e')](_['pick'](_0x36b76a[_0x5b37('0x3d')],_0x574115['filters']),_0x4c7586);if(_0x36b76a[_0x5b37('0x3d')][_0x5b37('0x47')]){_0x109666['where']=_[_0x5b37('0x48')](_0x109666[_0x5b37('0x49')],{'$or':_['map'](_0x4c7586,function(_0x1193e1){if(_0x1193e1[_0x5b37('0x4a')]!=='VIRTUAL'){var _0x2d5af0={};_0x2d5af0[_0x1193e1['name']]={'$like':'%'+_0x36b76a[_0x5b37('0x3d')][_0x5b37('0x47')]+'%'};return _0x2d5af0;}})});}_0x109666=_[_0x5b37('0x48')]({},_0x109666,_0x36b76a[_0x5b37('0x4b')]);var _0x283727={'where':_0x109666['where']};return db[_0x5b37('0x4c')][_0x5b37('0x2b')](_0x283727)['then'](function(_0x1a3a69){_0x59cfa5[_0x5b37('0x2b')]=_0x1a3a69;if(_0x36b76a[_0x5b37('0x3d')][_0x5b37('0x4d')]){_0x109666[_0x5b37('0x4e')]=[{'all':!![]}];}return db['ChatMessage']['findAll'](_0x109666);})[_0x5b37('0x34')](function(_0x6517d5){_0x59cfa5[_0x5b37('0x4f')]=_0x6517d5;return _0x59cfa5;})['then'](respondWithFilteredResult(_0x256afb,_0x109666))[_0x5b37('0x26')](handleError(_0x256afb,null));};exports[_0x5b37('0x50')]=function(_0x1c04e2,_0x53d3d2){var _0x5203a8={'raw':!![],'where':{'id':_0x1c04e2['params']['id']}},_0xf28114={};_0xf28114[_0x5b37('0x3c')]=_[_0x5b37('0x51')](db['ChatMessage']['rawAttributes']);_0xf28114[_0x5b37('0x3d')]=_[_0x5b37('0x51')](_0x1c04e2['query']);_0xf28114['filters']=_[_0x5b37('0x3f')](_0xf28114['model'],_0xf28114[_0x5b37('0x3d')]);_0x5203a8['attributes']=_[_0x5b37('0x3f')](_0xf28114[_0x5b37('0x3c')],qs['fields'](_0x1c04e2['query'][_0x5b37('0x41')]));_0x5203a8[_0x5b37('0x40')]=_0x5203a8[_0x5b37('0x40')]['length']?_0x5203a8['attributes']:_0xf28114[_0x5b37('0x3c')];if(_0x1c04e2[_0x5b37('0x3d')]['includeAll']){_0x5203a8[_0x5b37('0x4e')]=[{'all':!![]}];}_0x5203a8=_[_0x5b37('0x48')]({},_0x5203a8,_0x1c04e2[_0x5b37('0x4b')]);return db[_0x5b37('0x4c')][_0x5b37('0x52')](_0x5203a8)['then'](handleEntityNotFound(_0x53d3d2,null))[_0x5b37('0x34')](respondWithResult(_0x53d3d2,null))[_0x5b37('0x26')](handleError(_0x53d3d2,null));};exports[_0x5b37('0x53')]=function(_0x49114c,_0x4a93e1){return db['ChatMessage'][_0x5b37('0x53')](_0x49114c['body'],{})[_0x5b37('0x34')](respondWithResult(_0x4a93e1,0xc9))[_0x5b37('0x26')](handleError(_0x4a93e1,null));};exports[_0x5b37('0x33')]=function(_0x2bb540,_0x25da6f){if(_0x2bb540[_0x5b37('0x54')]['id']){delete _0x2bb540['body']['id'];}return db[_0x5b37('0x4c')][_0x5b37('0x52')]({'where':{'id':_0x2bb540[_0x5b37('0x55')]['id']}})[_0x5b37('0x34')](handleEntityNotFound(_0x25da6f,null))[_0x5b37('0x34')](saveUpdates(_0x2bb540['body'],null))[_0x5b37('0x34')](respondWithResult(_0x25da6f,null))[_0x5b37('0x26')](handleError(_0x25da6f,null));};exports[_0x5b37('0x56')]=function(_0x3a150c,_0x2ce6b8){return db['ChatMessage']['find']({'where':{'id':_0x3a150c['params']['id']}})['then'](handleEntityNotFound(_0x2ce6b8,null))[_0x5b37('0x34')](removeEntity(_0x2ce6b8,null))[_0x5b37('0x26')](handleError(_0x2ce6b8,null));};exports[_0x5b37('0x57')]=function(_0x406005,_0x314dd0){return db[_0x5b37('0x4c')]['describe']()[_0x5b37('0x34')](respondWithResult(_0x314dd0,null))[_0x5b37('0x26')](handleError(_0x314dd0,null));};var interaction_log=require(_0x5b37('0xf'))('chat-interactions');exports[_0x5b37('0x58')]=function(_0x5a9f12,_0x40bab6,_0x5c6101){var _0x5e9ccf={'channel':_0x5b37('0x59')};if(_0x5a9f12[_0x5b37('0x54')]['id']){delete _0x5a9f12['body']['id'];}_0x5a9f12['body']['read']=!![];_0x5a9f12[_0x5b37('0x54')]['readAt']=moment()[_0x5b37('0x5a')](_0x5b37('0x5b'));_0x5a9f12['body']['UserId']=_0x5a9f12[_0x5b37('0x54')][_0x5b37('0x5c')]||_0x5a9f12[_0x5b37('0x5d')]['id'];return db['ChatMessage'][_0x5b37('0x52')]({'where':{'id':_0x5a9f12[_0x5b37('0x55')]['id'],'UserId':null},'include':[{'model':db['CmContact'],'as':'Contact'}]})['then'](handleEntityNotFound(_0x40bab6,null))[_0x5b37('0x34')](saveUpdates(_0x5a9f12[_0x5b37('0x54')],null))[_0x5b37('0x34')](function(_0x5a5d07){if(_0x5a5d07){_0x5e9ccf[_0x5b37('0x25')]=_0x5a5d07[_0x5b37('0x5e')]({'plain':!![]});return db[_0x5b37('0x5f')]['find']({'where':{'id':_0x5a5d07[_0x5b37('0x60')]}});}return null;})['then'](handleEntityNotFound(_0x40bab6,null))[_0x5b37('0x34')](function(_0xa6ff51){if(_0xa6ff51){return _0xa6ff51[_0x5b37('0x33')]({'UserId':_0x5a9f12[_0x5b37('0x54')][_0x5b37('0x5c')],'read1stAt':_['isNil'](_0xa6ff51[_0x5b37('0x61')])?moment()[_0x5b37('0x5a')](_0x5b37('0x5b')):undefined});}return null;})[_0x5b37('0x34')](function(_0x256b5d){if(_0x256b5d){_0x5e9ccf[_0x5b37('0x62')]=_0x256b5d[_0x5b37('0x5e')]({'plain':!![]});interaction_log[_0x5b37('0x20')](_0x5b37('0x63'),_0x5a9f12['user']['id'],_0x5a9f12[_0x5b37('0x5d')][_0x5b37('0x36')],_0x5a9f12[_0x5b37('0x5d')]['role'],_0x5e9ccf['interaction']['id'],_0x5a9f12[_0x5b37('0x54')]?JSON[_0x5b37('0x23')](_0x5a9f12[_0x5b37('0x54')]):_0x5b37('0x64'));return respondWithRpcPromise(_0x5b37('0x65'),_0x5b37('0x66'),_0x5e9ccf);}return null;})['then'](function(_0x227cf5){if(_0x227cf5){if(_0x5a9f12[_0x5b37('0x54')][_0x5b37('0x67')]){_0x5e9ccf['message']['interface']=util['format'](_0x5b37('0x68'),_0x5a9f12[_0x5b37('0x5d')][_0x5b37('0x36')]);_0x5e9ccf[_0x5b37('0x25')][_0x5b37('0x69')]=_0x5e9ccf['channel'];_0x5e9ccf[_0x5b37('0x25')]['event']='accept';return respondWithRpcPromise('EventManager',_0x5b37('0x6a'),{'event':_0x5b37('0x6b'),'message':_['merge'](_0x5e9ccf['message'],JSON['parse'](_0x5e9ccf[_0x5b37('0x62')][_0x5b37('0x6c')]))},client9002)[_0x5b37('0x34')](function(){return _0x5e9ccf;});}return _0x5e9ccf;}return null;})[_0x5b37('0x34')](respondWithResult(_0x40bab6,null))[_0x5b37('0x26')](handleError(_0x40bab6,null));};var interaction_log=require('../../config/logger')(_0x5b37('0x6d'));exports[_0x5b37('0x31')]=function(_0x27c6ea,_0x24be9d,_0x5e2a19){var _0x32b32a={'agent':{},'channel':_0x5b37('0x59')};if(_0x27c6ea[_0x5b37('0x54')]['id']){delete _0x27c6ea['body']['id'];}_0x27c6ea[_0x5b37('0x54')][_0x5b37('0x5c')]=_0x27c6ea[_0x5b37('0x54')][_0x5b37('0x5c')]||_0x27c6ea[_0x5b37('0x5d')]['id'];_0x32b32a['agent']['id']=_0x27c6ea['body'][_0x5b37('0x5c')];return db[_0x5b37('0x4c')][_0x5b37('0x52')]({'where':{'id':_0x27c6ea['params']['id'],'UserId':null}})['then'](handleEntityNotFound(_0x24be9d,null))[_0x5b37('0x34')](function(_0x5010eb){if(_0x5010eb){_0x32b32a['message']=_0x5010eb[_0x5b37('0x5e')]({'plain':!![]});return db['ChatInteraction'][_0x5b37('0x52')]({'where':{'id':_0x5010eb['ChatInteractionId']}});}return null;})[_0x5b37('0x34')](handleEntityNotFound(_0x24be9d,null))[_0x5b37('0x34')](function(_0x236a99){if(_0x236a99){_0x32b32a[_0x5b37('0x62')]=_0x236a99['get']({'plain':!![]});interaction_log[_0x5b37('0x20')](_0x5b37('0x6e'),_0x27c6ea['user']['id'],_0x27c6ea[_0x5b37('0x5d')][_0x5b37('0x36')],_0x27c6ea[_0x5b37('0x5d')][_0x5b37('0x6f')],_0x32b32a['interaction']['id'],_0x27c6ea[_0x5b37('0x54')]?JSON[_0x5b37('0x23')](_0x27c6ea[_0x5b37('0x54')]):_0x5b37('0x64'));return respondWithRpcPromise(_0x5b37('0x70'),_0x5b37('0x71'),_0x32b32a);}return null;})[_0x5b37('0x34')](function(_0x457373){if(_0x457373){_0x457373[_0x5b37('0x25')][_0x5b37('0x72')]=util[_0x5b37('0x5a')](_0x5b37('0x68'),_0x27c6ea[_0x5b37('0x5d')][_0x5b37('0x36')]);_0x457373[_0x5b37('0x25')]['channel']=_0x32b32a[_0x5b37('0x69')];_0x457373[_0x5b37('0x25')]['event']=_0x5b37('0x31');respondWithRpcPromise(_0x5b37('0x6a'),_0x5b37('0x6a'),{'event':_0x5b37('0x73'),'message':_0x457373[_0x5b37('0x25')]},client9002);return _0x32b32a;}return null;})[_0x5b37('0x34')](respondWithResult(_0x24be9d,null))[_0x5b37('0x26')](handleError(_0x24be9d,null));};
\ No newline at end of file
+var _0xc425=['user','CmContact','Contact','get','ChatInteraction','ChatInteractionId','UserId','read1stAt','format','YYYY-MM-DD\x20HH:mm:ss','interaction','role','AcceptMessage','acceptMessage','manual','SIP/%s','channel','EventManager','acceptmessage','parse','formData','agent','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','interface','rejectmessage','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','to-csv','lodash','squel','crypto','jsforce','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../mysqldb','redis','socket.io-emitter','./chatMessage.socket','register','client','http','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','sendStatus','status','json','offset','limit','set','Content-Range','apply','reject','update','destroy','end','stack','send','map','rawAttributes','fieldName','type','key','name','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','filter','where','merge','VIRTUAL','options','ChatMessage','includeAll','include','findAll','rows','show','params','keys','find','body','describe','chat-interactions','accept','chat','readAt'];(function(_0x2ac9e6,_0x5c156d){var _0x4541a5=function(_0x211a8c){while(--_0x211a8c){_0x2ac9e6['push'](_0x2ac9e6['shift']());}};_0x4541a5(++_0x5c156d);}(_0xc425,0x109));var _0x5c42=function(_0x48cdf6,_0x275d81){_0x48cdf6=_0x48cdf6-0x0;var _0x5210c1=_0xc425[_0x48cdf6];return _0x5210c1;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x5c42('0x0'));var rimraf=require(_0x5c42('0x1'));var zipdir=require(_0x5c42('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x5c42('0x3'));var moment=require(_0x5c42('0x4'));var BPromise=require(_0x5c42('0x5'));var Mustache=require(_0x5c42('0x6'));var util=require(_0x5c42('0x7'));var path=require(_0x5c42('0x8'));var sox=require('sox');var csv=require(_0x5c42('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x5c42('0xa'));var squel=require(_0x5c42('0xb'));var crypto=require(_0x5c42('0xc'));var jsforce=require(_0x5c42('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x5c42('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x5c42('0xe'));var qs=require(_0x5c42('0xf'));var as=require(_0x5c42('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x5c42('0x11'))(_0x5c42('0x12'));var utils=require(_0x5c42('0x13'));var config=require('../../config/environment');var db=require(_0x5c42('0x14'))['db'];config['redis']=_['defaults'](config[_0x5c42('0x15')],{'host':'localhost','port':0x18eb});var socket=require(_0x5c42('0x16'))(new Redis(config['redis']));require(_0x5c42('0x17'))[_0x5c42('0x18')](socket);var jayson=require('jayson/promise');var client=jayson[_0x5c42('0x19')][_0x5c42('0x1a')]({'port':0x232c});var client9002=jayson['client'][_0x5c42('0x1a')]({'port':0x232a});function checkPasswordPattern(_0x9f56d0,_0x2cb627,_0x59a14c){if(_0x59a14c){var _0x53bf5b=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x53bf5b['test'](_0x2cb627)){return _0x9f56d0;}else{throw new db[(_0x5c42('0x1b'))][(_0x5c42('0x1c'))](_0x5c42('0x1d'));}}else{return _0x9f56d0;}}function respondWithRpcPromise(_0x306f9e,_0x51d438,_0x4bbe18,_0x51a64b){return new BPromise(function(_0xe86471,_0x1fb23e){var _0x1211c8=_0x51a64b||client;return _0x1211c8['request'](_0x306f9e,_0x4bbe18)[_0x5c42('0x1e')](function(_0x330515){logger[_0x5c42('0x1f')](_0x5c42('0x20'),_0x51d438,_0x5c42('0x21'));logger[_0x5c42('0x22')](_0x5c42('0x23'),_0x51d438,_0x5c42('0x21'),JSON[_0x5c42('0x24')](_0x330515));if(_0x330515[_0x5c42('0x25')]){if(_0x330515[_0x5c42('0x25')]['code']===0x1f4){logger[_0x5c42('0x25')](_0x5c42('0x20'),_0x51d438,_0x330515[_0x5c42('0x25')][_0x5c42('0x26')]);return _0x1fb23e(_0x330515['error']['message']);}logger[_0x5c42('0x25')](_0x5c42('0x20'),_0x51d438,_0x330515[_0x5c42('0x25')][_0x5c42('0x26')]);return _0xe86471(_0x330515[_0x5c42('0x25')][_0x5c42('0x26')]);}else{logger[_0x5c42('0x1f')]('ChatMessage,\x20%s,\x20%s',_0x51d438,_0x5c42('0x21'));_0xe86471(_0x330515[_0x5c42('0x27')][_0x5c42('0x26')]);}})[_0x5c42('0x28')](function(_0x4cf086){logger[_0x5c42('0x25')](_0x5c42('0x20'),_0x51d438,_0x4cf086);_0x1fb23e(_0x4cf086);});});}function respondWithStatusCode(_0x173aec,_0x1a53d0){_0x1a53d0=_0x1a53d0||0xcc;return function(_0x16257f){if(_0x16257f){return _0x173aec[_0x5c42('0x29')](_0x1a53d0);}return _0x173aec[_0x5c42('0x2a')](_0x1a53d0)['end']();};}function respondWithResult(_0x7f7551,_0x47ad98){_0x47ad98=_0x47ad98||0xc8;return function(_0x33737f){if(_0x33737f){return _0x7f7551[_0x5c42('0x2a')](_0x47ad98)[_0x5c42('0x2b')](_0x33737f);}};}function respondWithFilteredResult(_0x599c3f,_0x4dc685){return function(_0x568b99){if(_0x568b99){var _0x5572e6=_0x568b99['count'],_0x5dff2a=_0x4dc685[_0x5c42('0x2c')],_0x26c4d9=_0x4dc685[_0x5c42('0x2c')]+_0x4dc685[_0x5c42('0x2d')],_0x138701;if(_0x26c4d9>=_0x5572e6){_0x26c4d9=_0x5572e6;_0x138701=0xc8;}else{_0x138701=0xce;}_0x599c3f['status'](_0x138701);return _0x599c3f[_0x5c42('0x2e')](_0x5c42('0x2f'),_0x5dff2a+'-'+_0x26c4d9+'/'+_0x5572e6)[_0x5c42('0x2b')](_0x568b99);}return null;};}function patchUpdates(_0x484bc1){return function(_0x1efdd7){try{jsonpatch[_0x5c42('0x30')](_0x1efdd7,_0x484bc1,!![]);}catch(_0x47858c){return BPromise[_0x5c42('0x31')](_0x47858c);}return _0x1efdd7['save']();};}function saveUpdates(_0x35a642,_0x3538ac){return function(_0x32e2d4){if(_0x32e2d4){return _0x32e2d4[_0x5c42('0x32')](_0x35a642)[_0x5c42('0x1e')](function(_0x5563cc){return _0x5563cc;});}return null;};}function removeEntity(_0x521589,_0x1f1718){return function(_0x24eae7){if(_0x24eae7){return _0x24eae7[_0x5c42('0x33')]()['then'](function(){_0x521589['status'](0xcc)[_0x5c42('0x34')]();});}};}function handleEntityNotFound(_0x5d07c0,_0x712e61){return function(_0x1af75b){if(!_0x1af75b){_0x5d07c0[_0x5c42('0x29')](0x194);}return _0x1af75b;};}function handleError(_0x5943d9,_0x17eacd){_0x17eacd=_0x17eacd||0x1f4;return function(_0x4434e4){logger[_0x5c42('0x25')](_0x4434e4[_0x5c42('0x35')]);if(_0x4434e4['name']){delete _0x4434e4['name'];}_0x5943d9[_0x5c42('0x2a')](_0x17eacd)[_0x5c42('0x36')](_0x4434e4);};}exports['index']=function(_0x2c94d5,_0x3678b1){var _0x2e5cc3={},_0x2cdcf0={},_0x3a055c={'count':0x0,'rows':[]};var _0x5ede5a=_[_0x5c42('0x37')](db['ChatMessage'][_0x5c42('0x38')],function(_0x5ba243){return{'name':_0x5ba243[_0x5c42('0x39')],'type':_0x5ba243[_0x5c42('0x3a')][_0x5c42('0x3b')]};});_0x2cdcf0['model']=_[_0x5c42('0x37')](_0x5ede5a,_0x5c42('0x3c'));_0x2cdcf0[_0x5c42('0x3d')]=_['keys'](_0x2c94d5[_0x5c42('0x3d')]);_0x2cdcf0[_0x5c42('0x3e')]=_[_0x5c42('0x3f')](_0x2cdcf0[_0x5c42('0x40')],_0x2cdcf0[_0x5c42('0x3d')]);_0x2e5cc3['attributes']=_[_0x5c42('0x3f')](_0x2cdcf0['model'],qs['fields'](_0x2c94d5[_0x5c42('0x3d')][_0x5c42('0x41')]));_0x2e5cc3[_0x5c42('0x42')]=_0x2e5cc3[_0x5c42('0x42')][_0x5c42('0x43')]?_0x2e5cc3[_0x5c42('0x42')]:_0x2cdcf0[_0x5c42('0x40')];if(!_0x2c94d5[_0x5c42('0x3d')][_0x5c42('0x44')](_0x5c42('0x45'))){_0x2e5cc3[_0x5c42('0x2d')]=qs[_0x5c42('0x2d')](_0x2c94d5[_0x5c42('0x3d')][_0x5c42('0x2d')]);_0x2e5cc3[_0x5c42('0x2c')]=qs[_0x5c42('0x2c')](_0x2c94d5[_0x5c42('0x3d')]['offset']);}_0x2e5cc3[_0x5c42('0x46')]=qs['sort'](_0x2c94d5[_0x5c42('0x3d')][_0x5c42('0x47')]);_0x2e5cc3['where']=qs[_0x5c42('0x3e')](_['pick'](_0x2c94d5[_0x5c42('0x3d')],_0x2cdcf0[_0x5c42('0x3e')]),_0x5ede5a);if(_0x2c94d5[_0x5c42('0x3d')][_0x5c42('0x48')]){_0x2e5cc3[_0x5c42('0x49')]=_[_0x5c42('0x4a')](_0x2e5cc3[_0x5c42('0x49')],{'$or':_[_0x5c42('0x37')](_0x5ede5a,function(_0x303619){if(_0x303619[_0x5c42('0x3a')]!==_0x5c42('0x4b')){var _0x35564b={};_0x35564b[_0x303619[_0x5c42('0x3c')]]={'$like':'%'+_0x2c94d5['query'][_0x5c42('0x48')]+'%'};return _0x35564b;}})});}_0x2e5cc3=_[_0x5c42('0x4a')]({},_0x2e5cc3,_0x2c94d5[_0x5c42('0x4c')]);var _0x1d3631={'where':_0x2e5cc3['where']};return db[_0x5c42('0x4d')]['count'](_0x1d3631)[_0x5c42('0x1e')](function(_0x364d93){_0x3a055c['count']=_0x364d93;if(_0x2c94d5[_0x5c42('0x3d')][_0x5c42('0x4e')]){_0x2e5cc3[_0x5c42('0x4f')]=[{'all':!![]}];}return db['ChatMessage'][_0x5c42('0x50')](_0x2e5cc3);})[_0x5c42('0x1e')](function(_0x37f9c5){_0x3a055c[_0x5c42('0x51')]=_0x37f9c5;return _0x3a055c;})[_0x5c42('0x1e')](respondWithFilteredResult(_0x3678b1,_0x2e5cc3))[_0x5c42('0x28')](handleError(_0x3678b1,null));};exports[_0x5c42('0x52')]=function(_0x40ce98,_0x4dac35){var _0x48ce89={'raw':!![],'where':{'id':_0x40ce98[_0x5c42('0x53')]['id']}},_0x3f2b2a={};_0x3f2b2a[_0x5c42('0x40')]=_[_0x5c42('0x54')](db['ChatMessage']['rawAttributes']);_0x3f2b2a[_0x5c42('0x3d')]=_['keys'](_0x40ce98[_0x5c42('0x3d')]);_0x3f2b2a[_0x5c42('0x3e')]=_['intersection'](_0x3f2b2a[_0x5c42('0x40')],_0x3f2b2a['query']);_0x48ce89[_0x5c42('0x42')]=_[_0x5c42('0x3f')](_0x3f2b2a['model'],qs['fields'](_0x40ce98[_0x5c42('0x3d')][_0x5c42('0x41')]));_0x48ce89[_0x5c42('0x42')]=_0x48ce89[_0x5c42('0x42')][_0x5c42('0x43')]?_0x48ce89[_0x5c42('0x42')]:_0x3f2b2a[_0x5c42('0x40')];if(_0x40ce98[_0x5c42('0x3d')][_0x5c42('0x4e')]){_0x48ce89[_0x5c42('0x4f')]=[{'all':!![]}];}_0x48ce89=_[_0x5c42('0x4a')]({},_0x48ce89,_0x40ce98[_0x5c42('0x4c')]);return db[_0x5c42('0x4d')][_0x5c42('0x55')](_0x48ce89)[_0x5c42('0x1e')](handleEntityNotFound(_0x4dac35,null))[_0x5c42('0x1e')](respondWithResult(_0x4dac35,null))['catch'](handleError(_0x4dac35,null));};exports['create']=function(_0x37b5d8,_0x2c98e7){return db['ChatMessage']['create'](_0x37b5d8[_0x5c42('0x56')],{})[_0x5c42('0x1e')](respondWithResult(_0x2c98e7,0xc9))['catch'](handleError(_0x2c98e7,null));};exports[_0x5c42('0x32')]=function(_0xcad152,_0x59d975){if(_0xcad152[_0x5c42('0x56')]['id']){delete _0xcad152[_0x5c42('0x56')]['id'];}return db[_0x5c42('0x4d')][_0x5c42('0x55')]({'where':{'id':_0xcad152[_0x5c42('0x53')]['id']}})[_0x5c42('0x1e')](handleEntityNotFound(_0x59d975,null))['then'](saveUpdates(_0xcad152[_0x5c42('0x56')],null))['then'](respondWithResult(_0x59d975,null))[_0x5c42('0x28')](handleError(_0x59d975,null));};exports[_0x5c42('0x33')]=function(_0x3c74a6,_0x48ca91){return db[_0x5c42('0x4d')][_0x5c42('0x55')]({'where':{'id':_0x3c74a6[_0x5c42('0x53')]['id']}})['then'](handleEntityNotFound(_0x48ca91,null))['then'](removeEntity(_0x48ca91,null))[_0x5c42('0x28')](handleError(_0x48ca91,null));};exports[_0x5c42('0x57')]=function(_0x545675,_0x3fe0de){return db[_0x5c42('0x4d')][_0x5c42('0x57')]()[_0x5c42('0x1e')](respondWithResult(_0x3fe0de,null))[_0x5c42('0x28')](handleError(_0x3fe0de,null));};var interaction_log=require(_0x5c42('0x11'))(_0x5c42('0x58'));exports[_0x5c42('0x59')]=function(_0x88df60,_0x4b57ca,_0x9e4416){var _0x42ed71={'channel':_0x5c42('0x5a')};if(_0x88df60[_0x5c42('0x56')]['id']){delete _0x88df60[_0x5c42('0x56')]['id'];}_0x88df60[_0x5c42('0x56')]['read']=!![];_0x88df60[_0x5c42('0x56')][_0x5c42('0x5b')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x88df60['body']['UserId']=_0x88df60[_0x5c42('0x56')]['UserId']||_0x88df60[_0x5c42('0x5c')]['id'];return db['ChatMessage'][_0x5c42('0x55')]({'where':{'id':_0x88df60[_0x5c42('0x53')]['id'],'UserId':null},'include':[{'model':db[_0x5c42('0x5d')],'as':_0x5c42('0x5e')}]})[_0x5c42('0x1e')](handleEntityNotFound(_0x4b57ca,null))[_0x5c42('0x1e')](saveUpdates(_0x88df60[_0x5c42('0x56')],null))['then'](function(_0x2979f9){if(_0x2979f9){_0x42ed71[_0x5c42('0x26')]=_0x2979f9[_0x5c42('0x5f')]({'plain':!![]});return db[_0x5c42('0x60')][_0x5c42('0x55')]({'where':{'id':_0x2979f9[_0x5c42('0x61')]}});}return null;})[_0x5c42('0x1e')](handleEntityNotFound(_0x4b57ca,null))['then'](function(_0x1da70a){if(_0x1da70a){return _0x1da70a[_0x5c42('0x32')]({'UserId':_0x88df60['body'][_0x5c42('0x62')],'read1stAt':_['isNil'](_0x1da70a[_0x5c42('0x63')])?moment()[_0x5c42('0x64')](_0x5c42('0x65')):undefined});}return null;})[_0x5c42('0x1e')](function(_0x52253f){if(_0x52253f){_0x42ed71[_0x5c42('0x66')]=_0x52253f['get']({'plain':!![]});interaction_log[_0x5c42('0x1f')]('[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x88df60[_0x5c42('0x5c')]['id'],_0x88df60[_0x5c42('0x5c')][_0x5c42('0x3c')],_0x88df60[_0x5c42('0x5c')][_0x5c42('0x67')],_0x42ed71['interaction']['id'],_0x88df60[_0x5c42('0x56')]?JSON['stringify'](_0x88df60[_0x5c42('0x56')]):'null');return respondWithRpcPromise(_0x5c42('0x68'),_0x5c42('0x69'),_0x42ed71);}return null;})[_0x5c42('0x1e')](function(_0x3688ce){if(_0x3688ce){if(_0x88df60[_0x5c42('0x56')][_0x5c42('0x6a')]){_0x42ed71[_0x5c42('0x26')]['interface']=util[_0x5c42('0x64')](_0x5c42('0x6b'),_0x88df60[_0x5c42('0x5c')]['name']);_0x42ed71[_0x5c42('0x26')][_0x5c42('0x6c')]=_0x42ed71['channel'];_0x42ed71[_0x5c42('0x26')]['event']=_0x5c42('0x59');return respondWithRpcPromise(_0x5c42('0x6d'),_0x5c42('0x6d'),{'event':_0x5c42('0x6e'),'message':_[_0x5c42('0x4a')](_0x42ed71[_0x5c42('0x26')],JSON[_0x5c42('0x6f')](_0x42ed71[_0x5c42('0x66')][_0x5c42('0x70')]))},client9002)[_0x5c42('0x1e')](function(){return _0x42ed71;});}return _0x42ed71;}return null;})['then'](respondWithResult(_0x4b57ca,null))[_0x5c42('0x28')](handleError(_0x4b57ca,null));};var interaction_log=require(_0x5c42('0x11'))(_0x5c42('0x58'));exports['reject']=function(_0x1e1d18,_0x5cec7,_0x56c36b){var _0x1b324b={'agent':{},'channel':'chat'};if(_0x1e1d18[_0x5c42('0x56')]['id']){delete _0x1e1d18['body']['id'];}_0x1e1d18[_0x5c42('0x56')][_0x5c42('0x62')]=_0x1e1d18[_0x5c42('0x56')][_0x5c42('0x62')]||_0x1e1d18[_0x5c42('0x5c')]['id'];_0x1b324b[_0x5c42('0x71')]['id']=_0x1e1d18[_0x5c42('0x56')][_0x5c42('0x62')];return db[_0x5c42('0x4d')][_0x5c42('0x55')]({'where':{'id':_0x1e1d18['params']['id'],'UserId':null}})['then'](handleEntityNotFound(_0x5cec7,null))['then'](function(_0x8e237c){if(_0x8e237c){_0x1b324b[_0x5c42('0x26')]=_0x8e237c[_0x5c42('0x5f')]({'plain':!![]});return db[_0x5c42('0x60')][_0x5c42('0x55')]({'where':{'id':_0x8e237c[_0x5c42('0x61')]}});}return null;})[_0x5c42('0x1e')](handleEntityNotFound(_0x5cec7,null))['then'](function(_0x28753c){if(_0x28753c){_0x1b324b['interaction']=_0x28753c[_0x5c42('0x5f')]({'plain':!![]});interaction_log[_0x5c42('0x1f')](_0x5c42('0x72'),_0x1e1d18[_0x5c42('0x5c')]['id'],_0x1e1d18[_0x5c42('0x5c')][_0x5c42('0x3c')],_0x1e1d18['user']['role'],_0x1b324b[_0x5c42('0x66')]['id'],_0x1e1d18[_0x5c42('0x56')]?JSON[_0x5c42('0x24')](_0x1e1d18['body']):'null');return respondWithRpcPromise(_0x5c42('0x73'),_0x5c42('0x74'),_0x1b324b);}return null;})['then'](function(_0x3b2e13){if(_0x3b2e13){_0x3b2e13[_0x5c42('0x26')][_0x5c42('0x75')]=util[_0x5c42('0x64')]('SIP/%s',_0x1e1d18['user'][_0x5c42('0x3c')]);_0x3b2e13[_0x5c42('0x26')][_0x5c42('0x6c')]=_0x1b324b[_0x5c42('0x6c')];_0x3b2e13[_0x5c42('0x26')]['event']='reject';respondWithRpcPromise(_0x5c42('0x6d'),'EventManager',{'event':_0x5c42('0x76'),'message':_0x3b2e13[_0x5c42('0x26')]},client9002);return _0x1b324b;}return null;})['then'](respondWithResult(_0x5cec7,null))[_0x5c42('0x28')](handleError(_0x5cec7,null));};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.events.js b/server/api/chatMessage/chatMessage.events.js
index 2a4be8b..edbaaa6 100644
--- a/server/api/chatMessage/chatMessage.events.js
+++ b/server/api/chatMessage/chatMessage.events.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xaef6=['../../mysqldb','ChatMessage','setMaxListeners','save','update','remove','emit','events'];(function(_0x1d9603,_0x3c35d2){var _0x5f2edd=function(_0x290ddc){while(--_0x290ddc){_0x1d9603['push'](_0x1d9603['shift']());}};_0x5f2edd(++_0x3c35d2);}(_0xaef6,0x19f));var _0x6aef=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xaef6[_0x20a584];return _0x4b41a8;};'use strict';var EventEmitter=require(_0x6aef('0x0'));var ChatMessage=require(_0x6aef('0x1'))['db'][_0x6aef('0x2')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0x6aef('0x3')](0x0);var events={'afterCreate':_0x6aef('0x4'),'afterUpdate':_0x6aef('0x5'),'afterDestroy':_0x6aef('0x6')};function emitEvent(_0x58690e){return function(_0xdef075,_0x2ff6fd,_0x1b23b1){ChatMessageEvents[_0x6aef('0x7')](_0x58690e+':'+_0xdef075['id'],_0xdef075);ChatMessageEvents[_0x6aef('0x7')](_0x58690e,_0xdef075);_0x1b23b1(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatMessage['hook'](e,emitEvent(event));}}module['exports']=ChatMessageEvents;
\ No newline at end of file
+var _0xf64a=['remove','emit','hasOwnProperty','hook','exports','ChatMessage','setMaxListeners','save'];(function(_0x8afdd0,_0x548ad1){var _0x3de7ac=function(_0x2dc2c4){while(--_0x2dc2c4){_0x8afdd0['push'](_0x8afdd0['shift']());}};_0x3de7ac(++_0x548ad1);}(_0xf64a,0x17d));var _0xaf64=function(_0x2ca9d4,_0x51d5c6){_0x2ca9d4=_0x2ca9d4-0x0;var _0x258956=_0xf64a[_0x2ca9d4];return _0x258956;};'use strict';var EventEmitter=require('events');var ChatMessage=require('../../mysqldb')['db'][_0xaf64('0x0')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0xaf64('0x1')](0x0);var events={'afterCreate':_0xaf64('0x2'),'afterUpdate':'update','afterDestroy':_0xaf64('0x3')};function emitEvent(_0x1d1f7b){return function(_0x455728,_0x1fd6a6,_0x4cb18c){ChatMessageEvents['emit'](_0x1d1f7b+':'+_0x455728['id'],_0x455728);ChatMessageEvents[_0xaf64('0x4')](_0x1d1f7b,_0x455728);_0x4cb18c(null);};}for(var e in events){if(events[_0xaf64('0x5')](e)){var event=events[e];ChatMessage[_0xaf64('0x6')](e,emitEvent(event));}}module[_0xaf64('0x7')]=ChatMessageEvents;
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.model.js b/server/api/chatMessage/chatMessage.model.js
index 5133f6e..d4d4f7d 100644
--- a/server/api/chatMessage/chatMessage.model.js
+++ b/server/api/chatMessage/chatMessage.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xd93a=['then','update','catch','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','bluebird','request-promise','rimraf','exports','ChatMessage','fti_chat_messages','body','FULLTEXT','models','get','direction','toLowerCase','out','isNil','UserId','findOne'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xd93a,0x131));var _0xad93=function(_0x7e80c2,_0x5229b0){_0x7e80c2=_0x7e80c2-0x0;var _0x43e592=_0xd93a[_0x7e80c2];return _0x43e592;};'use strict';var _=require(_0xad93('0x0'));var util=require(_0xad93('0x1'));var logger=require(_0xad93('0x2'))(_0xad93('0x3'));var moment=require('moment');var BPromise=require(_0xad93('0x4'));var rp=require(_0xad93('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xad93('0x6'));var config=require('../../config/environment');var attributes=require('./chatMessage.attributes');module[_0xad93('0x7')]=function(_0xb9a73c,_0x4290e2){return _0xb9a73c['define'](_0xad93('0x8'),attributes,{'tableName':'chat_messages','paranoid':![],'indexes':[{'name':_0xad93('0x9'),'fields':[_0xad93('0xa')],'type':_0xad93('0xb')}],'timestamps':!![],'hooks':{'afterCreate':function(_0xa7d5e9,_0x218ca8,_0x157c67){var _0x3891a8=_0xb9a73c[_0xad93('0xc')];var _0x1865dd=_0xa7d5e9[_0xad93('0xd')]({'plain':!![]});if(_0x1865dd['direction']['toLowerCase']()==='in'||_0x1865dd[_0xad93('0xe')][_0xad93('0xf')]()===_0xad93('0x10')&&!_0x1865dd['secret']&&!_[_0xad93('0x11')](_0x1865dd[_0xad93('0x12')])){_0x3891a8['ChatInteraction'][_0xad93('0x13')]({'where':{'id':_0x1865dd['ChatInteractionId']}})[_0xad93('0x14')](function(_0x478d9e){if(_0x478d9e){_0x478d9e[_0xad93('0x15')]({'lastMsgAt':_0x1865dd['createdAt'],'lastMsgDirection':_0x1865dd[_0xad93('0xe')][_0xad93('0xf')]()});}})[_0xad93('0x16')](function(_0x4d3f57){console['error'](_0x4d3f57);});}_0x157c67();}},'charset':_0xad93('0x17'),'collate':_0xad93('0x18')});};
\ No newline at end of file
+var _0x718e=['createdAt','direction','error','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','moment','rimraf','../../config/environment','./chatMessage.attributes','exports','ChatMessage','chat_messages','fti_chat_messages','body','FULLTEXT','models','get','toLowerCase','out','secret','isNil','findOne','then','update'];(function(_0x4a1a4a,_0x13cfaa){var _0x137f0f=function(_0x3dc3e1){while(--_0x3dc3e1){_0x4a1a4a['push'](_0x4a1a4a['shift']());}};_0x137f0f(++_0x13cfaa);}(_0x718e,0x17f));var _0xe718=function(_0x397dd0,_0x58a7a8){_0x397dd0=_0x397dd0-0x0;var _0x4188b2=_0x718e[_0x397dd0];return _0x4188b2;};'use strict';var _=require('lodash');var util=require(_0xe718('0x0'));var logger=require(_0xe718('0x1'))(_0xe718('0x2'));var moment=require(_0xe718('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xe718('0x4'));var config=require(_0xe718('0x5'));var attributes=require(_0xe718('0x6'));module[_0xe718('0x7')]=function(_0x5bbef3,_0x33ef54){return _0x5bbef3['define'](_0xe718('0x8'),attributes,{'tableName':_0xe718('0x9'),'paranoid':![],'indexes':[{'name':_0xe718('0xa'),'fields':[_0xe718('0xb')],'type':_0xe718('0xc')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x20aee2,_0x1ca1ed,_0x2fce6b){var _0x3d1af0=_0x5bbef3[_0xe718('0xd')];var _0x127fde=_0x20aee2[_0xe718('0xe')]({'plain':!![]});if(_0x127fde['direction']['toLowerCase']()==='in'||_0x127fde['direction'][_0xe718('0xf')]()===_0xe718('0x10')&&!_0x127fde[_0xe718('0x11')]&&!_[_0xe718('0x12')](_0x127fde['UserId'])){_0x3d1af0['ChatInteraction'][_0xe718('0x13')]({'where':{'id':_0x127fde['ChatInteractionId']}})[_0xe718('0x14')](function(_0x56fedf){if(_0x56fedf){_0x56fedf[_0xe718('0x15')]({'lastMsgAt':_0x127fde[_0xe718('0x16')],'lastMsgDirection':_0x127fde[_0xe718('0x17')][_0xe718('0xf')]()});}})['catch'](function(_0x4d2a04){console[_0xe718('0x18')](_0x4d2a04);});}_0x2fce6b();}},'charset':_0xe718('0x19'),'collate':_0xe718('0x1a')});};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.rpc.js b/server/api/chatMessage/chatMessage.rpc.js
index 1ebb098..1dbfc83 100644
--- a/server/api/chatMessage/chatMessage.rpc.js
+++ b/server/api/chatMessage/chatMessage.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x0227=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','redis','defaults','./chatMessage.socket','register','request','then','ChatMessage,\x20%s,\x20%s','request\x20sent','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','code','error','message','info','result','catch','ChatMessage','body','options','raw','CreateChatMessage','debug','util'];(function(_0x29e32b,_0x101662){var _0x1b7c92=function(_0x2b73b7){while(--_0x2b73b7){_0x29e32b['push'](_0x29e32b['shift']());}};_0x1b7c92(++_0x101662);}(_0x0227,0x18b));var _0x7022=function(_0x2c4424,_0x2a0f63){_0x2c4424=_0x2c4424-0x0;var _0x351054=_0x0227[_0x2c4424];return _0x351054;};'use strict';var _=require('lodash');var util=require(_0x7022('0x0'));var moment=require(_0x7022('0x1'));var BPromise=require(_0x7022('0x2'));var rs=require(_0x7022('0x3'));var fs=require('fs');var Redis=require(_0x7022('0x4'));var db=require(_0x7022('0x5'))['db'];var utils=require(_0x7022('0x6'));var logger=require(_0x7022('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x7022('0x8'));var client=jayson[_0x7022('0x9')][_0x7022('0xa')]({'port':0x232a});config[_0x7022('0xb')]=_[_0x7022('0xc')](config[_0x7022('0xb')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x7022('0xb')]));require(_0x7022('0xd'))[_0x7022('0xe')](socket);function respondWithRpcPromise(_0x2ff0b0,_0x3c7cb1,_0x4109){return new BPromise(function(_0x5aac0d,_0x17cdfd){return client[_0x7022('0xf')](_0x2ff0b0,_0x4109)[_0x7022('0x10')](function(_0x28692e){logger['info'](_0x7022('0x11'),_0x3c7cb1,_0x7022('0x12'));logger['debug'](_0x7022('0x13'),_0x3c7cb1,_0x7022('0x12'),JSON[_0x7022('0x14')](_0x28692e));if(_0x28692e['error']){if(_0x28692e['error'][_0x7022('0x15')]===0x1f4){logger[_0x7022('0x16')](_0x7022('0x11'),_0x3c7cb1,_0x28692e[_0x7022('0x16')][_0x7022('0x17')]);return _0x17cdfd(_0x28692e[_0x7022('0x16')]['message']);}logger['error'](_0x7022('0x11'),_0x3c7cb1,_0x28692e[_0x7022('0x16')][_0x7022('0x17')]);return _0x5aac0d(_0x28692e[_0x7022('0x16')][_0x7022('0x17')]);}else{logger[_0x7022('0x18')](_0x7022('0x11'),_0x3c7cb1,_0x7022('0x12'));_0x5aac0d(_0x28692e[_0x7022('0x19')][_0x7022('0x17')]);}})[_0x7022('0x1a')](function(_0x53b030){logger[_0x7022('0x16')](_0x7022('0x11'),_0x3c7cb1,_0x53b030);_0x17cdfd(_0x53b030);});});}exports['CreateChatMessage']=function(_0x411f76){var _0x49f9a8=this;return new Promise(function(_0x3b655b,_0x139b25){return db[_0x7022('0x1b')]['create'](_0x411f76[_0x7022('0x1c')],{'raw':_0x411f76[_0x7022('0x1d')]?_0x411f76[_0x7022('0x1d')][_0x7022('0x1e')]===undefined?!![]:![]:!![]})[_0x7022('0x10')](function(_0x1bbc94){logger[_0x7022('0x18')](_0x7022('0x1f'),_0x411f76);logger[_0x7022('0x20')](_0x7022('0x1f'),_0x411f76,JSON[_0x7022('0x14')](_0x1bbc94));_0x3b655b(_0x1bbc94);})[_0x7022('0x1a')](function(_0x41e057){logger['error'](_0x7022('0x1f'),_0x41e057[_0x7022('0x17')],_0x411f76);_0x139b25(_0x49f9a8['error'](0x1f4,_0x41e057[_0x7022('0x17')]));});});};
\ No newline at end of file
+var _0x78fa=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','redis','defaults','localhost','socket.io-emitter','register','request','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','CreateChatMessage','options','raw','debug','stringify','lodash','util'];(function(_0x4a6cf8,_0x5534ef){var _0x22205e=function(_0x3f4d0d){while(--_0x3f4d0d){_0x4a6cf8['push'](_0x4a6cf8['shift']());}};_0x22205e(++_0x5534ef);}(_0x78fa,0x8f));var _0xa78f=function(_0x3acf41,_0x5285dd){_0x3acf41=_0x3acf41-0x0;var _0x5b51e7=_0x78fa[_0x3acf41];return _0x5b51e7;};'use strict';var _=require(_0xa78f('0x0'));var util=require(_0xa78f('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa78f('0x2'));var db=require(_0xa78f('0x3'))['db'];var utils=require(_0xa78f('0x4'));var logger=require(_0xa78f('0x5'))(_0xa78f('0x6'));var config=require(_0xa78f('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0xa78f('0x8')]({'port':0x232a});config[_0xa78f('0x9')]=_[_0xa78f('0xa')](config[_0xa78f('0x9')],{'host':_0xa78f('0xb'),'port':0x18eb});var socket=require(_0xa78f('0xc'))(new Redis(config['redis']));require('./chatMessage.socket')[_0xa78f('0xd')](socket);function respondWithRpcPromise(_0x46275a,_0xd3ee67,_0x2dc151){return new BPromise(function(_0x293c08,_0x31d80a){return client[_0xa78f('0xe')](_0x46275a,_0x2dc151)[_0xa78f('0xf')](function(_0x2d0b61){logger[_0xa78f('0x10')](_0xa78f('0x11'),_0xd3ee67,_0xa78f('0x12'));logger['debug']('ChatMessage,\x20%s,\x20%s,\x20%s',_0xd3ee67,'request\x20sent',JSON['stringify'](_0x2d0b61));if(_0x2d0b61['error']){if(_0x2d0b61[_0xa78f('0x13')][_0xa78f('0x14')]===0x1f4){logger[_0xa78f('0x13')]('ChatMessage,\x20%s,\x20%s',_0xd3ee67,_0x2d0b61['error'][_0xa78f('0x15')]);return _0x31d80a(_0x2d0b61[_0xa78f('0x13')][_0xa78f('0x15')]);}logger['error'](_0xa78f('0x11'),_0xd3ee67,_0x2d0b61[_0xa78f('0x13')][_0xa78f('0x15')]);return _0x293c08(_0x2d0b61[_0xa78f('0x13')][_0xa78f('0x15')]);}else{logger[_0xa78f('0x10')]('ChatMessage,\x20%s,\x20%s',_0xd3ee67,_0xa78f('0x12'));_0x293c08(_0x2d0b61[_0xa78f('0x16')][_0xa78f('0x15')]);}})[_0xa78f('0x17')](function(_0x3ce5fb){logger[_0xa78f('0x13')](_0xa78f('0x11'),_0xd3ee67,_0x3ce5fb);_0x31d80a(_0x3ce5fb);});});}exports[_0xa78f('0x18')]=function(_0x3e5cb3){var _0x329448=this;return new Promise(function(_0xea9a99,_0x4ab341){return db['ChatMessage']['create'](_0x3e5cb3['body'],{'raw':_0x3e5cb3[_0xa78f('0x19')]?_0x3e5cb3[_0xa78f('0x19')][_0xa78f('0x1a')]===undefined?!![]:![]:!![]})[_0xa78f('0xf')](function(_0x4686aa){logger[_0xa78f('0x10')](_0xa78f('0x18'),_0x3e5cb3);logger[_0xa78f('0x1b')](_0xa78f('0x18'),_0x3e5cb3,JSON[_0xa78f('0x1c')](_0x4686aa));_0xea9a99(_0x4686aa);})[_0xa78f('0x17')](function(_0x136d54){logger['error'](_0xa78f('0x18'),_0x136d54[_0xa78f('0x15')],_0x3e5cb3);_0x4ab341(_0x329448[_0xa78f('0x13')](0x1f4,_0x136d54[_0xa78f('0x15')]));});});};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.socket.js b/server/api/chatMessage/chatMessage.socket.js
index c950d9e..0a499d3 100644
--- a/server/api/chatMessage/chatMessage.socket.js
+++ b/server/api/chatMessage/chatMessage.socket.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x33af=['emit','removeListener','register','length','chatMessage:','save','update'];(function(_0x598d4c,_0x4f74d4){var _0x34d7f1=function(_0x26cfd3){while(--_0x26cfd3){_0x598d4c['push'](_0x598d4c['shift']());}};_0x34d7f1(++_0x4f74d4);}(_0x33af,0xec));var _0xf33a=function(_0x42c118,_0x197006){_0x42c118=_0x42c118-0x0;var _0x112ebd=_0x33af[_0x42c118];return _0x112ebd;};'use strict';var ChatMessageEvents=require('./chatMessage.events');var events=[_0xf33a('0x0'),'remove',_0xf33a('0x1')];function createListener(_0x1111c6,_0x267057){return function(_0x4303f1){_0x267057[_0xf33a('0x2')](_0x1111c6,_0x4303f1);};}function removeListener(_0x25f156,_0x4c734e){return function(){ChatMessageEvents[_0xf33a('0x3')](_0x25f156,_0x4c734e);};}exports[_0xf33a('0x4')]=function(_0x583e54){for(var _0xc0dd13=0x0,_0x384b14=events[_0xf33a('0x5')];_0xc0dd13<_0x384b14;_0xc0dd13++){var _0x2f3730=events[_0xc0dd13];var _0x2baabb=createListener(_0xf33a('0x6')+_0x2f3730,_0x583e54);ChatMessageEvents['on'](_0x2f3730,_0x2baabb);}};
\ No newline at end of file
+var _0xc2c7=['register','chatMessage:','save','remove','update','emit'];(function(_0x4e0e02,_0xb7355d){var _0x146f93=function(_0x1d2bbf){while(--_0x1d2bbf){_0x4e0e02['push'](_0x4e0e02['shift']());}};_0x146f93(++_0xb7355d);}(_0xc2c7,0x134));var _0x7c2c=function(_0x4ac6c3,_0x36e5ea){_0x4ac6c3=_0x4ac6c3-0x0;var _0x3f3436=_0xc2c7[_0x4ac6c3];return _0x3f3436;};'use strict';var ChatMessageEvents=require('./chatMessage.events');var events=[_0x7c2c('0x0'),_0x7c2c('0x1'),_0x7c2c('0x2')];function createListener(_0x330870,_0x380d13){return function(_0x237e4d){_0x380d13[_0x7c2c('0x3')](_0x330870,_0x237e4d);};}function removeListener(_0x116f8a,_0x4bbc14){return function(){ChatMessageEvents['removeListener'](_0x116f8a,_0x4bbc14);};}exports[_0x7c2c('0x4')]=function(_0x42ecc9){for(var _0x23c038=0x0,_0x54f027=events['length'];_0x23c038<_0x54f027;_0x23c038++){var _0x5a1027=events[_0x23c038];var _0x2274cd=createListener(_0x7c2c('0x5')+_0x5a1027,_0x42ecc9);ChatMessageEvents['on'](_0x5a1027,_0x2274cd);}};
\ No newline at end of file
diff --git a/server/api/chatMessage/index.js b/server/api/chatMessage/index.js
index 5f4e521..e55fcad 100644
--- a/server/api/chatMessage/index.js
+++ b/server/api/chatMessage/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7724=['express','Router','../../components/auth/service','../../config/environment','./chatMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','chatmessage:create','put','update','/:id/accept','accept','/:id/reject','reject','delete','exports','multer','util','path','connect-timeout'];(function(_0x4818e1,_0x3f434d){var _0x4cad09=function(_0x4105fa){while(--_0x4105fa){_0x4818e1['push'](_0x4818e1['shift']());}};_0x4cad09(++_0x3f434d);}(_0x7724,0xe6));var _0x4772=function(_0x5a47ac,_0x128140){_0x5a47ac=_0x5a47ac-0x0;var _0x99111f=_0x7724[_0x5a47ac];return _0x99111f;};'use strict';var multer=require(_0x4772('0x0'));var util=require(_0x4772('0x1'));var path=require(_0x4772('0x2'));var timeout=require(_0x4772('0x3'));var express=require(_0x4772('0x4'));var router=express[_0x4772('0x5')]();var auth=require(_0x4772('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x4772('0x7'));var controller=require(_0x4772('0x8'));router[_0x4772('0x9')]('/',auth[_0x4772('0xa')](),controller[_0x4772('0xb')]);router[_0x4772('0x9')](_0x4772('0xc'),auth[_0x4772('0xa')](),controller[_0x4772('0xd')]);router['get'](_0x4772('0xe'),auth[_0x4772('0xa')](),controller[_0x4772('0xf')]);router[_0x4772('0x10')]('/',auth['isAuthenticated'](),interaction['tracked']('chat',_0x4772('0x11')),controller['create']);router[_0x4772('0x12')](_0x4772('0xe'),controller[_0x4772('0x13')]);router[_0x4772('0x12')](_0x4772('0x14'),auth[_0x4772('0xa')](),controller[_0x4772('0x15')]);router['put'](_0x4772('0x16'),auth['isAuthenticated'](),controller[_0x4772('0x17')]);router[_0x4772('0x18')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0x4772('0x19')]=router;
\ No newline at end of file
+var _0xaeb4=['Router','../../components/auth/service','../../config/environment','./chatMessage.controller','isAuthenticated','/describe','get','/:id','show','tracked','chat','create','put','update','/:id/accept','/:id/reject','reject','delete','destroy','path','express'];(function(_0x50b3fd,_0x4c007d){var _0x33265f=function(_0x4e5bbe){while(--_0x4e5bbe){_0x50b3fd['push'](_0x50b3fd['shift']());}};_0x33265f(++_0x4c007d);}(_0xaeb4,0x14e));var _0x4aeb=function(_0x5cb1af,_0x4bdc8c){_0x5cb1af=_0x5cb1af-0x0;var _0x8d7940=_0xaeb4[_0x5cb1af];return _0x8d7940;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x4aeb('0x0'));var timeout=require('connect-timeout');var express=require(_0x4aeb('0x1'));var router=express[_0x4aeb('0x2')]();var auth=require(_0x4aeb('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x4aeb('0x4'));var controller=require(_0x4aeb('0x5'));router['get']('/',auth[_0x4aeb('0x6')](),controller['index']);router['get'](_0x4aeb('0x7'),auth[_0x4aeb('0x6')](),controller['describe']);router[_0x4aeb('0x8')](_0x4aeb('0x9'),auth[_0x4aeb('0x6')](),controller[_0x4aeb('0xa')]);router['post']('/',auth['isAuthenticated'](),interaction[_0x4aeb('0xb')](_0x4aeb('0xc'),'chatmessage:create'),controller[_0x4aeb('0xd')]);router[_0x4aeb('0xe')](_0x4aeb('0x9'),controller[_0x4aeb('0xf')]);router['put'](_0x4aeb('0x10'),auth['isAuthenticated'](),controller['accept']);router['put'](_0x4aeb('0x11'),auth[_0x4aeb('0x6')](),controller[_0x4aeb('0x12')]);router[_0x4aeb('0x13')](_0x4aeb('0x9'),auth['isAuthenticated'](),controller[_0x4aeb('0x14')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js b/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js
index f6026a6..345f190 100644
--- a/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js
+++ b/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x929c=['TEXT','medium','sequelize','exports'];(function(_0xb87f83,_0x30d965){var _0x3dd56f=function(_0x2ae28c){while(--_0x2ae28c){_0xb87f83['push'](_0xb87f83['shift']());}};_0x3dd56f(++_0x30d965);}(_0x929c,0x16e));var _0xc929=function(_0x550a13,_0x5abdc9){_0x550a13=_0x550a13-0x0;var _0x17340e=_0x929c[_0x550a13];return _0x17340e;};'use strict';var Sequelize=require(_0xc929('0x0'));module[_0xc929('0x1')]={'body':{'type':Sequelize[_0xc929('0x2')](_0xc929('0x3')),'allowNull':![]}};
\ No newline at end of file
+var _0xea18=['TEXT','medium','sequelize','exports'];(function(_0x731658,_0x26f155){var _0x29adfd=function(_0x2baf72){while(--_0x2baf72){_0x731658['push'](_0x731658['shift']());}};_0x29adfd(++_0x26f155);}(_0xea18,0x102));var _0x8ea1=function(_0x32cf93,_0x170441){_0x32cf93=_0x32cf93-0x0;var _0x3d6405=_0xea18[_0x32cf93];return _0x3d6405;};'use strict';var Sequelize=require(_0x8ea1('0x0'));module[_0x8ea1('0x1')]={'body':{'type':Sequelize[_0x8ea1('0x2')](_0x8ea1('0x3')),'allowNull':![]}};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js
index 7843919..80163cb 100644
--- a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js
+++ b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x8ca9=['find','create','body','update','params','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','end','status','json','count','offset','limit','set','Content-Range','apply','reject','then','destroy','stack','name','index','map','ChatOfflineMessage','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','sort','pick','filter','where','merge','options','includeAll','include','findAll','catch','show','keys'];(function(_0x10b491,_0xdbc8b){var _0x1c597b=function(_0x256920){while(--_0x256920){_0x10b491['push'](_0x10b491['shift']());}};_0x1c597b(++_0xdbc8b);}(_0x8ca9,0x9c));var _0x98ca=function(_0x1d1dd7,_0x46915f){_0x1d1dd7=_0x1d1dd7-0x0;var _0x5b7207=_0x8ca9[_0x1d1dd7];return _0x5b7207;};'use strict';var pdf=require(_0x98ca('0x0'));var emlformat=require(_0x98ca('0x1'));var rimraf=require(_0x98ca('0x2'));var zipdir=require(_0x98ca('0x3'));var jsonpatch=require(_0x98ca('0x4'));var rp=require(_0x98ca('0x5'));var moment=require(_0x98ca('0x6'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x98ca('0x7'));var path=require('path');var sox=require(_0x98ca('0x8'));var csv=require('to-csv');var ejs=require(_0x98ca('0x9'));var fs=require('fs');var _=require(_0x98ca('0xa'));var squel=require(_0x98ca('0xb'));var crypto=require(_0x98ca('0xc'));var jsforce=require(_0x98ca('0xd'));var deskjs=require(_0x98ca('0xe'));var toCsv=require(_0x98ca('0xf'));var querystring=require(_0x98ca('0x10'));var Papa=require(_0x98ca('0x11'));var Redis=require(_0x98ca('0x12'));var authService=require(_0x98ca('0x13'));var qs=require(_0x98ca('0x14'));var as=require(_0x98ca('0x15'));var hardwareService=require(_0x98ca('0x16'));var logger=require(_0x98ca('0x17'))(_0x98ca('0x18'));var utils=require(_0x98ca('0x19'));var config=require(_0x98ca('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x16221a,_0x44b65b){_0x44b65b=_0x44b65b||0xcc;return function(_0xba3887){if(_0xba3887){return _0x16221a[_0x98ca('0x1b')](_0x44b65b);}return _0x16221a['status'](_0x44b65b)[_0x98ca('0x1c')]();};}function respondWithResult(_0x6345be,_0x9a230e){_0x9a230e=_0x9a230e||0xc8;return function(_0xa2bab4){if(_0xa2bab4){return _0x6345be[_0x98ca('0x1d')](_0x9a230e)[_0x98ca('0x1e')](_0xa2bab4);}};}function respondWithFilteredResult(_0x58d07a,_0x4940ca){return function(_0x330713){if(_0x330713){var _0x29df1b=_0x330713[_0x98ca('0x1f')],_0x29f46b=_0x4940ca[_0x98ca('0x20')],_0x398171=_0x4940ca[_0x98ca('0x20')]+_0x4940ca[_0x98ca('0x21')],_0x52e9c8;if(_0x398171>=_0x29df1b){_0x398171=_0x29df1b;_0x52e9c8=0xc8;}else{_0x52e9c8=0xce;}_0x58d07a[_0x98ca('0x1d')](_0x52e9c8);return _0x58d07a[_0x98ca('0x22')](_0x98ca('0x23'),_0x29f46b+'-'+_0x398171+'/'+_0x29df1b)[_0x98ca('0x1e')](_0x330713);}return null;};}function patchUpdates(_0xddec43){return function(_0x110f9f){try{jsonpatch[_0x98ca('0x24')](_0x110f9f,_0xddec43,!![]);}catch(_0x4806a3){return BPromise[_0x98ca('0x25')](_0x4806a3);}return _0x110f9f['save']();};}function saveUpdates(_0x47a3f1,_0x2fe568){return function(_0x50f8b4){if(_0x50f8b4){return _0x50f8b4['update'](_0x47a3f1)[_0x98ca('0x26')](function(_0x170688){return _0x170688;});}return null;};}function removeEntity(_0x130544,_0x519927){return function(_0x2f7742){if(_0x2f7742){return _0x2f7742[_0x98ca('0x27')]()['then'](function(){_0x130544[_0x98ca('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3fd0bd,_0x323cdb){return function(_0x430d16){if(!_0x430d16){_0x3fd0bd[_0x98ca('0x1b')](0x194);}return _0x430d16;};}function handleError(_0x8d669d,_0xe5091e){_0xe5091e=_0xe5091e||0x1f4;return function(_0x2a59e3){logger['error'](_0x2a59e3[_0x98ca('0x28')]);if(_0x2a59e3['name']){delete _0x2a59e3[_0x98ca('0x29')];}_0x8d669d[_0x98ca('0x1d')](_0xe5091e)['send'](_0x2a59e3);};}exports[_0x98ca('0x2a')]=function(_0x47d89f,_0x214649){var _0x4f48db={},_0x5bf77d={},_0x14bfb4={'count':0x0,'rows':[]};var _0x540f45=_[_0x98ca('0x2b')](db[_0x98ca('0x2c')][_0x98ca('0x2d')],function(_0x21a12a){return{'name':_0x21a12a[_0x98ca('0x2e')],'type':_0x21a12a[_0x98ca('0x2f')][_0x98ca('0x30')]};});_0x5bf77d[_0x98ca('0x31')]=_[_0x98ca('0x2b')](_0x540f45,'name');_0x5bf77d[_0x98ca('0x32')]=_['keys'](_0x47d89f[_0x98ca('0x32')]);_0x5bf77d[_0x98ca('0x33')]=_['intersection'](_0x5bf77d['model'],_0x5bf77d[_0x98ca('0x32')]);_0x4f48db['attributes']=_[_0x98ca('0x34')](_0x5bf77d['model'],qs[_0x98ca('0x35')](_0x47d89f['query'][_0x98ca('0x35')]));_0x4f48db[_0x98ca('0x36')]=_0x4f48db['attributes'][_0x98ca('0x37')]?_0x4f48db[_0x98ca('0x36')]:_0x5bf77d['model'];if(!_0x47d89f[_0x98ca('0x32')][_0x98ca('0x38')]('nolimit')){_0x4f48db[_0x98ca('0x21')]=qs[_0x98ca('0x21')](_0x47d89f[_0x98ca('0x32')][_0x98ca('0x21')]);_0x4f48db[_0x98ca('0x20')]=qs['offset'](_0x47d89f[_0x98ca('0x32')][_0x98ca('0x20')]);}_0x4f48db['order']=qs[_0x98ca('0x39')](_0x47d89f[_0x98ca('0x32')][_0x98ca('0x39')]);_0x4f48db['where']=qs[_0x98ca('0x33')](_[_0x98ca('0x3a')](_0x47d89f[_0x98ca('0x32')],_0x5bf77d['filters']),_0x540f45);if(_0x47d89f[_0x98ca('0x32')][_0x98ca('0x3b')]){_0x4f48db[_0x98ca('0x3c')]=_['merge'](_0x4f48db['where'],{'$or':_[_0x98ca('0x2b')](_0x540f45,function(_0xe77d02){if(_0xe77d02[_0x98ca('0x2f')]!=='VIRTUAL'){var _0x16f7b1={};_0x16f7b1[_0xe77d02[_0x98ca('0x29')]]={'$like':'%'+_0x47d89f[_0x98ca('0x32')]['filter']+'%'};return _0x16f7b1;}})});}_0x4f48db=_[_0x98ca('0x3d')]({},_0x4f48db,_0x47d89f[_0x98ca('0x3e')]);var _0x1059df={'where':_0x4f48db[_0x98ca('0x3c')]};return db[_0x98ca('0x2c')]['count'](_0x1059df)['then'](function(_0x4b811b){_0x14bfb4[_0x98ca('0x1f')]=_0x4b811b;if(_0x47d89f[_0x98ca('0x32')][_0x98ca('0x3f')]){_0x4f48db[_0x98ca('0x40')]=[{'all':!![]}];}return db[_0x98ca('0x2c')][_0x98ca('0x41')](_0x4f48db);})[_0x98ca('0x26')](function(_0x570afe){_0x14bfb4['rows']=_0x570afe;return _0x14bfb4;})[_0x98ca('0x26')](respondWithFilteredResult(_0x214649,_0x4f48db))[_0x98ca('0x42')](handleError(_0x214649,null));};exports[_0x98ca('0x43')]=function(_0x382989,_0x17fdc7){var _0x535fdc={'raw':!![],'where':{'id':_0x382989['params']['id']}},_0x55161f={};_0x55161f[_0x98ca('0x31')]=_[_0x98ca('0x44')](db[_0x98ca('0x2c')][_0x98ca('0x2d')]);_0x55161f['query']=_['keys'](_0x382989[_0x98ca('0x32')]);_0x55161f[_0x98ca('0x33')]=_[_0x98ca('0x34')](_0x55161f[_0x98ca('0x31')],_0x55161f[_0x98ca('0x32')]);_0x535fdc[_0x98ca('0x36')]=_[_0x98ca('0x34')](_0x55161f[_0x98ca('0x31')],qs[_0x98ca('0x35')](_0x382989[_0x98ca('0x32')][_0x98ca('0x35')]));_0x535fdc['attributes']=_0x535fdc[_0x98ca('0x36')][_0x98ca('0x37')]?_0x535fdc[_0x98ca('0x36')]:_0x55161f[_0x98ca('0x31')];if(_0x382989[_0x98ca('0x32')][_0x98ca('0x3f')]){_0x535fdc[_0x98ca('0x40')]=[{'all':!![]}];}_0x535fdc=_[_0x98ca('0x3d')]({},_0x535fdc,_0x382989[_0x98ca('0x3e')]);return db['ChatOfflineMessage'][_0x98ca('0x45')](_0x535fdc)[_0x98ca('0x26')](handleEntityNotFound(_0x17fdc7,null))['then'](respondWithResult(_0x17fdc7,null))[_0x98ca('0x42')](handleError(_0x17fdc7,null));};exports['create']=function(_0x3946b3,_0x39f4fd){return db[_0x98ca('0x2c')][_0x98ca('0x46')](_0x3946b3[_0x98ca('0x47')],{})[_0x98ca('0x26')](respondWithResult(_0x39f4fd,0xc9))[_0x98ca('0x42')](handleError(_0x39f4fd,null));};exports[_0x98ca('0x48')]=function(_0x2c7d53,_0x42a53d){if(_0x2c7d53[_0x98ca('0x47')]['id']){delete _0x2c7d53[_0x98ca('0x47')]['id'];}return db['ChatOfflineMessage'][_0x98ca('0x45')]({'where':{'id':_0x2c7d53[_0x98ca('0x49')]['id']}})[_0x98ca('0x26')](handleEntityNotFound(_0x42a53d,null))[_0x98ca('0x26')](saveUpdates(_0x2c7d53['body'],null))[_0x98ca('0x26')](respondWithResult(_0x42a53d,null))[_0x98ca('0x42')](handleError(_0x42a53d,null));};exports[_0x98ca('0x27')]=function(_0x3de7a4,_0x2141ef){return db[_0x98ca('0x2c')][_0x98ca('0x45')]({'where':{'id':_0x3de7a4['params']['id']}})['then'](handleEntityNotFound(_0x2141ef,null))['then'](removeEntity(_0x2141ef,null))[_0x98ca('0x42')](handleError(_0x2141ef,null));};exports[_0x98ca('0x4a')]=function(_0x3fc063,_0x2fdcb4){return db['ChatOfflineMessage']['describe']()[_0x98ca('0x26')](respondWithResult(_0x2fdcb4,null))[_0x98ca('0x42')](handleError(_0x2fdcb4,null));};
\ No newline at end of file
+var _0x82c4=['findAll','rows','catch','params','find','create','body','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../mysqldb','status','end','json','count','offset','limit','set','Content-Range','reject','save','update','then','destroy','sendStatus','stack','name','send','index','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','pick','filter','where','merge','options','ChatOfflineMessage','includeAll','include'];(function(_0x13980b,_0x1fbb72){var _0x13220b=function(_0x11aa5f){while(--_0x11aa5f){_0x13980b['push'](_0x13980b['shift']());}};_0x13220b(++_0x1fbb72);}(_0x82c4,0x1ca));var _0x482c=function(_0x3fd723,_0x1f48b4){_0x3fd723=_0x3fd723-0x0;var _0x131dc2=_0x82c4[_0x3fd723];return _0x131dc2;};'use strict';var pdf=require(_0x482c('0x0'));var emlformat=require(_0x482c('0x1'));var rimraf=require(_0x482c('0x2'));var zipdir=require(_0x482c('0x3'));var jsonpatch=require(_0x482c('0x4'));var rp=require(_0x482c('0x5'));var moment=require(_0x482c('0x6'));var BPromise=require('bluebird');var Mustache=require(_0x482c('0x7'));var util=require('util');var path=require(_0x482c('0x8'));var sox=require('sox');var csv=require(_0x482c('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x482c('0xa'));var squel=require(_0x482c('0xb'));var crypto=require(_0x482c('0xc'));var jsforce=require(_0x482c('0xd'));var deskjs=require(_0x482c('0xe'));var toCsv=require('to-csv');var querystring=require(_0x482c('0xf'));var Papa=require(_0x482c('0x10'));var Redis=require(_0x482c('0x11'));var authService=require(_0x482c('0x12'));var qs=require(_0x482c('0x13'));var as=require(_0x482c('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x482c('0x15'))(_0x482c('0x16'));var utils=require(_0x482c('0x17'));var config=require('../../config/environment');var db=require(_0x482c('0x18'))['db'];function respondWithStatusCode(_0xbbda9b,_0x3fabb3){_0x3fabb3=_0x3fabb3||0xcc;return function(_0x56aafd){if(_0x56aafd){return _0xbbda9b['sendStatus'](_0x3fabb3);}return _0xbbda9b[_0x482c('0x19')](_0x3fabb3)[_0x482c('0x1a')]();};}function respondWithResult(_0x59837f,_0x56ee17){_0x56ee17=_0x56ee17||0xc8;return function(_0x14452b){if(_0x14452b){return _0x59837f[_0x482c('0x19')](_0x56ee17)[_0x482c('0x1b')](_0x14452b);}};}function respondWithFilteredResult(_0x3dfbc8,_0x37a4f0){return function(_0x119635){if(_0x119635){var _0x3beedb=_0x119635[_0x482c('0x1c')],_0xf65563=_0x37a4f0[_0x482c('0x1d')],_0x3fc79c=_0x37a4f0['offset']+_0x37a4f0[_0x482c('0x1e')],_0x1758fb;if(_0x3fc79c>=_0x3beedb){_0x3fc79c=_0x3beedb;_0x1758fb=0xc8;}else{_0x1758fb=0xce;}_0x3dfbc8['status'](_0x1758fb);return _0x3dfbc8[_0x482c('0x1f')](_0x482c('0x20'),_0xf65563+'-'+_0x3fc79c+'/'+_0x3beedb)['json'](_0x119635);}return null;};}function patchUpdates(_0x4bd270){return function(_0x357965){try{jsonpatch['apply'](_0x357965,_0x4bd270,!![]);}catch(_0x16fe9a){return BPromise[_0x482c('0x21')](_0x16fe9a);}return _0x357965[_0x482c('0x22')]();};}function saveUpdates(_0x3f97ae,_0x5c927b){return function(_0x1c9a7b){if(_0x1c9a7b){return _0x1c9a7b[_0x482c('0x23')](_0x3f97ae)[_0x482c('0x24')](function(_0xd18658){return _0xd18658;});}return null;};}function removeEntity(_0x14d832,_0x58ed18){return function(_0x4afcd9){if(_0x4afcd9){return _0x4afcd9[_0x482c('0x25')]()[_0x482c('0x24')](function(){_0x14d832[_0x482c('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3d5490,_0x579d2f){return function(_0x2f3f96){if(!_0x2f3f96){_0x3d5490[_0x482c('0x26')](0x194);}return _0x2f3f96;};}function handleError(_0x4f1108,_0x466583){_0x466583=_0x466583||0x1f4;return function(_0x5436e2){logger['error'](_0x5436e2[_0x482c('0x27')]);if(_0x5436e2[_0x482c('0x28')]){delete _0x5436e2[_0x482c('0x28')];}_0x4f1108[_0x482c('0x19')](_0x466583)[_0x482c('0x29')](_0x5436e2);};}exports[_0x482c('0x2a')]=function(_0x2981d2,_0x5ad788){var _0xb65836={},_0x255417={},_0x58da7c={'count':0x0,'rows':[]};var _0xb01bc3=_['map'](db['ChatOfflineMessage'][_0x482c('0x2b')],function(_0x5af04c){return{'name':_0x5af04c[_0x482c('0x2c')],'type':_0x5af04c[_0x482c('0x2d')][_0x482c('0x2e')]};});_0x255417[_0x482c('0x2f')]=_[_0x482c('0x30')](_0xb01bc3,_0x482c('0x28'));_0x255417[_0x482c('0x31')]=_[_0x482c('0x32')](_0x2981d2[_0x482c('0x31')]);_0x255417[_0x482c('0x33')]=_[_0x482c('0x34')](_0x255417[_0x482c('0x2f')],_0x255417[_0x482c('0x31')]);_0xb65836[_0x482c('0x35')]=_[_0x482c('0x34')](_0x255417[_0x482c('0x2f')],qs[_0x482c('0x36')](_0x2981d2[_0x482c('0x31')]['fields']));_0xb65836['attributes']=_0xb65836['attributes'][_0x482c('0x37')]?_0xb65836[_0x482c('0x35')]:_0x255417[_0x482c('0x2f')];if(!_0x2981d2[_0x482c('0x31')]['hasOwnProperty'](_0x482c('0x38'))){_0xb65836['limit']=qs[_0x482c('0x1e')](_0x2981d2[_0x482c('0x31')][_0x482c('0x1e')]);_0xb65836[_0x482c('0x1d')]=qs[_0x482c('0x1d')](_0x2981d2[_0x482c('0x31')][_0x482c('0x1d')]);}_0xb65836[_0x482c('0x39')]=qs['sort'](_0x2981d2['query'][_0x482c('0x3a')]);_0xb65836['where']=qs[_0x482c('0x33')](_[_0x482c('0x3b')](_0x2981d2[_0x482c('0x31')],_0x255417['filters']),_0xb01bc3);if(_0x2981d2[_0x482c('0x31')][_0x482c('0x3c')]){_0xb65836[_0x482c('0x3d')]=_[_0x482c('0x3e')](_0xb65836['where'],{'$or':_[_0x482c('0x30')](_0xb01bc3,function(_0x52a610){if(_0x52a610[_0x482c('0x2d')]!=='VIRTUAL'){var _0x234bd2={};_0x234bd2[_0x52a610['name']]={'$like':'%'+_0x2981d2[_0x482c('0x31')][_0x482c('0x3c')]+'%'};return _0x234bd2;}})});}_0xb65836=_['merge']({},_0xb65836,_0x2981d2[_0x482c('0x3f')]);var _0x536816={'where':_0xb65836['where']};return db[_0x482c('0x40')]['count'](_0x536816)['then'](function(_0x5a07a3){_0x58da7c['count']=_0x5a07a3;if(_0x2981d2[_0x482c('0x31')][_0x482c('0x41')]){_0xb65836[_0x482c('0x42')]=[{'all':!![]}];}return db[_0x482c('0x40')][_0x482c('0x43')](_0xb65836);})['then'](function(_0x24f3b5){_0x58da7c[_0x482c('0x44')]=_0x24f3b5;return _0x58da7c;})[_0x482c('0x24')](respondWithFilteredResult(_0x5ad788,_0xb65836))[_0x482c('0x45')](handleError(_0x5ad788,null));};exports['show']=function(_0x490641,_0xa41da0){var _0x44bedf={'raw':!![],'where':{'id':_0x490641[_0x482c('0x46')]['id']}},_0x4e4d91={};_0x4e4d91[_0x482c('0x2f')]=_[_0x482c('0x32')](db[_0x482c('0x40')][_0x482c('0x2b')]);_0x4e4d91[_0x482c('0x31')]=_[_0x482c('0x32')](_0x490641[_0x482c('0x31')]);_0x4e4d91['filters']=_[_0x482c('0x34')](_0x4e4d91[_0x482c('0x2f')],_0x4e4d91[_0x482c('0x31')]);_0x44bedf[_0x482c('0x35')]=_[_0x482c('0x34')](_0x4e4d91[_0x482c('0x2f')],qs[_0x482c('0x36')](_0x490641['query']['fields']));_0x44bedf[_0x482c('0x35')]=_0x44bedf[_0x482c('0x35')][_0x482c('0x37')]?_0x44bedf['attributes']:_0x4e4d91[_0x482c('0x2f')];if(_0x490641['query'][_0x482c('0x41')]){_0x44bedf[_0x482c('0x42')]=[{'all':!![]}];}_0x44bedf=_[_0x482c('0x3e')]({},_0x44bedf,_0x490641[_0x482c('0x3f')]);return db['ChatOfflineMessage'][_0x482c('0x47')](_0x44bedf)[_0x482c('0x24')](handleEntityNotFound(_0xa41da0,null))[_0x482c('0x24')](respondWithResult(_0xa41da0,null))['catch'](handleError(_0xa41da0,null));};exports[_0x482c('0x48')]=function(_0x41d96f,_0xcf89c4){return db['ChatOfflineMessage']['create'](_0x41d96f['body'],{})['then'](respondWithResult(_0xcf89c4,0xc9))['catch'](handleError(_0xcf89c4,null));};exports['update']=function(_0x3096c4,_0x5bd0c5){if(_0x3096c4[_0x482c('0x49')]['id']){delete _0x3096c4[_0x482c('0x49')]['id'];}return db[_0x482c('0x40')][_0x482c('0x47')]({'where':{'id':_0x3096c4[_0x482c('0x46')]['id']}})[_0x482c('0x24')](handleEntityNotFound(_0x5bd0c5,null))[_0x482c('0x24')](saveUpdates(_0x3096c4[_0x482c('0x49')],null))[_0x482c('0x24')](respondWithResult(_0x5bd0c5,null))[_0x482c('0x45')](handleError(_0x5bd0c5,null));};exports[_0x482c('0x25')]=function(_0x3f7ff7,_0x1126b7){return db[_0x482c('0x40')][_0x482c('0x47')]({'where':{'id':_0x3f7ff7[_0x482c('0x46')]['id']}})[_0x482c('0x24')](handleEntityNotFound(_0x1126b7,null))[_0x482c('0x24')](removeEntity(_0x1126b7,null))[_0x482c('0x45')](handleError(_0x1126b7,null));};exports['describe']=function(_0x107b1b,_0x3b8b04){return db['ChatOfflineMessage'][_0x482c('0x4a')]()[_0x482c('0x24')](respondWithResult(_0x3b8b04,null))[_0x482c('0x45')](handleError(_0x3b8b04,null));};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.model.js b/server/api/chatOfflineMessage/chatOfflineMessage.model.js
index 4d8fec0..8bdcbc5 100644
--- a/server/api/chatOfflineMessage/chatOfflineMessage.model.js
+++ b/server/api/chatOfflineMessage/chatOfflineMessage.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x4a08=['util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./chatOfflineMessage.attributes','exports','define','ChatOfflineMessage','chat_offline_messages','utf8mb4','utf8mb4_unicode_ci','lodash'];(function(_0x3227c1,_0x4318c5){var _0x31fd48=function(_0x5c5850){while(--_0x5c5850){_0x3227c1['push'](_0x3227c1['shift']());}};_0x31fd48(++_0x4318c5);}(_0x4a08,0x19f));var _0x84a0=function(_0x34488f,_0x2c0c47){_0x34488f=_0x34488f-0x0;var _0x4c0130=_0x4a08[_0x34488f];return _0x4c0130;};'use strict';var _=require(_0x84a0('0x0'));var util=require(_0x84a0('0x1'));var logger=require(_0x84a0('0x2'))(_0x84a0('0x3'));var moment=require(_0x84a0('0x4'));var BPromise=require(_0x84a0('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x84a0('0x6'));var rimraf=require(_0x84a0('0x7'));var config=require(_0x84a0('0x8'));var attributes=require(_0x84a0('0x9'));module[_0x84a0('0xa')]=function(_0x1fe4cc,_0x265556){return _0x1fe4cc[_0x84a0('0xb')](_0x84a0('0xc'),attributes,{'tableName':_0x84a0('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x84a0('0xe'),'collate':_0x84a0('0xf')});};
\ No newline at end of file
+var _0xd4f7=['rimraf','../../config/environment','./chatOfflineMessage.attributes','exports','define','ChatOfflineMessage','chat_offline_messages','utf8mb4_unicode_ci','lodash','util','api','request-promise'];(function(_0xa39b2b,_0x8c128c){var _0x54d7f3=function(_0x139c09){while(--_0x139c09){_0xa39b2b['push'](_0xa39b2b['shift']());}};_0x54d7f3(++_0x8c128c);}(_0xd4f7,0x1ac));var _0x7d4f=function(_0x51cc1d,_0xaa88ae){_0x51cc1d=_0x51cc1d-0x0;var _0x2eb9f2=_0xd4f7[_0x51cc1d];return _0x2eb9f2;};'use strict';var _=require(_0x7d4f('0x0'));var util=require(_0x7d4f('0x1'));var logger=require('../../config/logger')(_0x7d4f('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x7d4f('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7d4f('0x4'));var config=require(_0x7d4f('0x5'));var attributes=require(_0x7d4f('0x6'));module[_0x7d4f('0x7')]=function(_0x1928bd,_0x29eff5){return _0x1928bd[_0x7d4f('0x8')](_0x7d4f('0x9'),attributes,{'tableName':_0x7d4f('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x7d4f('0xb')});};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js b/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js
index f54ce9c..e766dc8 100644
--- a/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js
+++ b/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x98e9=['request\x20sent','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','error','code','message','ChatOfflineMessage,\x20%s,\x20%s','info','lodash','util','moment','bluebird','randomstring','../../config/environment','jayson/promise','request'];(function(_0x179e11,_0xf65436){var _0x549f04=function(_0x610545){while(--_0x610545){_0x179e11['push'](_0x179e11['shift']());}};_0x549f04(++_0xf65436);}(_0x98e9,0x78));var _0x998e=function(_0x488ba6,_0x2d234b){_0x488ba6=_0x488ba6-0x0;var _0x3b9c76=_0x98e9[_0x488ba6];return _0x3b9c76;};'use strict';var _=require(_0x998e('0x0'));var util=require(_0x998e('0x1'));var moment=require(_0x998e('0x2'));var BPromise=require(_0x998e('0x3'));var rs=require(_0x998e('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x998e('0x5'));var jayson=require(_0x998e('0x6'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x5ec2bd,_0x24e072,_0x138bf1){return new BPromise(function(_0x6fc821,_0x1d5fe4){return client[_0x998e('0x7')](_0x5ec2bd,_0x138bf1)['then'](function(_0x855dc4){logger['info']('ChatOfflineMessage,\x20%s,\x20%s',_0x24e072,_0x998e('0x8'));logger[_0x998e('0x9')](_0x998e('0xa'),_0x24e072,_0x998e('0x8'),JSON['stringify'](_0x855dc4));if(_0x855dc4[_0x998e('0xb')]){if(_0x855dc4['error'][_0x998e('0xc')]===0x1f4){logger['error']('ChatOfflineMessage,\x20%s,\x20%s',_0x24e072,_0x855dc4['error']['message']);return _0x1d5fe4(_0x855dc4[_0x998e('0xb')][_0x998e('0xd')]);}logger[_0x998e('0xb')](_0x998e('0xe'),_0x24e072,_0x855dc4[_0x998e('0xb')][_0x998e('0xd')]);return _0x6fc821(_0x855dc4[_0x998e('0xb')][_0x998e('0xd')]);}else{logger[_0x998e('0xf')](_0x998e('0xe'),_0x24e072,_0x998e('0x8'));_0x6fc821(_0x855dc4['result'][_0x998e('0xd')]);}})['catch'](function(_0x50a88b){logger[_0x998e('0xb')](_0x998e('0xe'),_0x24e072,_0x50a88b);_0x1d5fe4(_0x50a88b);});});}
\ No newline at end of file
+var _0xca26=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ChatOfflineMessage,\x20%s,\x20%s','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch'];(function(_0x4871f4,_0x2c1f0){var _0x565f30=function(_0x61e2ed){while(--_0x61e2ed){_0x4871f4['push'](_0x4871f4['shift']());}};_0x565f30(++_0x2c1f0);}(_0xca26,0xd8));var _0x6ca2=function(_0x617eb,_0x2f2f57){_0x617eb=_0x617eb-0x0;var _0x3e5dbf=_0xca26[_0x617eb];return _0x3e5dbf;};'use strict';var _=require('lodash');var util=require(_0x6ca2('0x0'));var moment=require(_0x6ca2('0x1'));var BPromise=require(_0x6ca2('0x2'));var rs=require(_0x6ca2('0x3'));var fs=require('fs');var Redis=require(_0x6ca2('0x4'));var db=require(_0x6ca2('0x5'))['db'];var utils=require(_0x6ca2('0x6'));var logger=require('../../config/logger')(_0x6ca2('0x7'));var config=require(_0x6ca2('0x8'));var jayson=require(_0x6ca2('0x9'));var client=jayson[_0x6ca2('0xa')][_0x6ca2('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x560f83,_0x3f9eb0,_0x514848){return new BPromise(function(_0x49315d,_0x287a5c){return client[_0x6ca2('0xc')](_0x560f83,_0x514848)[_0x6ca2('0xd')](function(_0x428bdc){logger[_0x6ca2('0xe')](_0x6ca2('0xf'),_0x3f9eb0,'request\x20sent');logger['debug'](_0x6ca2('0x10'),_0x3f9eb0,_0x6ca2('0x11'),JSON[_0x6ca2('0x12')](_0x428bdc));if(_0x428bdc[_0x6ca2('0x13')]){if(_0x428bdc[_0x6ca2('0x13')][_0x6ca2('0x14')]===0x1f4){logger['error']('ChatOfflineMessage,\x20%s,\x20%s',_0x3f9eb0,_0x428bdc[_0x6ca2('0x13')][_0x6ca2('0x15')]);return _0x287a5c(_0x428bdc[_0x6ca2('0x13')]['message']);}logger[_0x6ca2('0x13')]('ChatOfflineMessage,\x20%s,\x20%s',_0x3f9eb0,_0x428bdc['error'][_0x6ca2('0x15')]);return _0x49315d(_0x428bdc['error'][_0x6ca2('0x15')]);}else{logger[_0x6ca2('0xe')](_0x6ca2('0xf'),_0x3f9eb0,_0x6ca2('0x11'));_0x49315d(_0x428bdc[_0x6ca2('0x16')][_0x6ca2('0x15')]);}})[_0x6ca2('0x17')](function(_0x16b848){logger[_0x6ca2('0x13')](_0x6ca2('0xf'),_0x3f9eb0,_0x16b848);_0x287a5c(_0x16b848);});});}
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/index.js b/server/api/chatOfflineMessage/index.js
index 80725b4..12de1c8 100644
--- a/server/api/chatOfflineMessage/index.js
+++ b/server/api/chatOfflineMessage/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xfc9b=['../../components/interaction/service','../../config/environment','./chatOfflineMessage.controller','get','isAuthenticated','/describe','describe','/:id','put','update','delete','destroy','exports','util','path','express','Router','../../components/auth/service'];(function(_0xe8f8e0,_0xdabc0b){var _0x30507c=function(_0x38f7b3){while(--_0x38f7b3){_0xe8f8e0['push'](_0xe8f8e0['shift']());}};_0x30507c(++_0xdabc0b);}(_0xfc9b,0x199));var _0xbfc9=function(_0x107d63,_0x1a4a18){_0x107d63=_0x107d63-0x0;var _0x160d06=_0xfc9b[_0x107d63];return _0x160d06;};'use strict';var multer=require('multer');var util=require(_0xbfc9('0x0'));var path=require(_0xbfc9('0x1'));var timeout=require('connect-timeout');var express=require(_0xbfc9('0x2'));var router=express[_0xbfc9('0x3')]();var auth=require(_0xbfc9('0x4'));var interaction=require(_0xbfc9('0x5'));var config=require(_0xbfc9('0x6'));var controller=require(_0xbfc9('0x7'));router[_0xbfc9('0x8')]('/',auth[_0xbfc9('0x9')](),controller['index']);router[_0xbfc9('0x8')](_0xbfc9('0xa'),auth[_0xbfc9('0x9')](),controller[_0xbfc9('0xb')]);router[_0xbfc9('0x8')](_0xbfc9('0xc'),auth['isAuthenticated'](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0xbfc9('0xd')](_0xbfc9('0xc'),auth['isAuthenticated'](),controller[_0xbfc9('0xe')]);router[_0xbfc9('0xf')](_0xbfc9('0xc'),auth[_0xbfc9('0x9')](),controller[_0xbfc9('0x10')]);module[_0xbfc9('0x11')]=router;
\ No newline at end of file
+var _0x24b4=['path','connect-timeout','../../components/auth/service','../../components/interaction/service','./chatOfflineMessage.controller','get','isAuthenticated','describe','/:id','show','create','update','delete','exports','util'];(function(_0x5d82c0,_0x54bb2f){var _0x340b63=function(_0x4cad44){while(--_0x4cad44){_0x5d82c0['push'](_0x5d82c0['shift']());}};_0x340b63(++_0x54bb2f);}(_0x24b4,0xd1));var _0x424b=function(_0xea9702,_0x3d1c9b){_0xea9702=_0xea9702-0x0;var _0xdc7ec9=_0x24b4[_0xea9702];return _0xdc7ec9;};'use strict';var multer=require('multer');var util=require(_0x424b('0x0'));var path=require(_0x424b('0x1'));var timeout=require(_0x424b('0x2'));var express=require('express');var router=express['Router']();var auth=require(_0x424b('0x3'));var interaction=require(_0x424b('0x4'));var config=require('../../config/environment');var controller=require(_0x424b('0x5'));router[_0x424b('0x6')]('/',auth[_0x424b('0x7')](),controller['index']);router[_0x424b('0x6')]('/describe',auth['isAuthenticated'](),controller[_0x424b('0x8')]);router['get'](_0x424b('0x9'),auth[_0x424b('0x7')](),controller[_0x424b('0xa')]);router['post']('/',auth['isAuthenticated'](),controller[_0x424b('0xb')]);router['put'](_0x424b('0x9'),auth['isAuthenticated'](),controller[_0x424b('0xc')]);router[_0x424b('0xd')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0x424b('0xe')]=router;
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.attributes.js b/server/api/chatProactiveAction/chatProactiveAction.attributes.js
index 0f7c6cb..4d6c424 100644
--- a/server/api/chatProactiveAction/chatProactiveAction.attributes.js
+++ b/server/api/chatProactiveAction/chatProactiveAction.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xea8f=['mouseOver','timeout','exports','STRING','ENUM'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0xea8f,0x147));var _0xfea8=function(_0x48d834,_0x5732b1){_0x48d834=_0x48d834-0x0;var _0x5f4e4e=_0xea8f[_0x48d834];return _0x5f4e4e;};'use strict';var Sequelize=require('sequelize');module[_0xfea8('0x0')]={'name':{'type':Sequelize[_0xfea8('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0xfea8('0x2')](_0xfea8('0x3'),_0xfea8('0x4')),'defaultValue':_0xfea8('0x3')},'selector':{'type':Sequelize[_0xfea8('0x1')]},'timeout':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
+var _0x65ed=['sequelize','exports','STRING','ENUM','timeout','mouseOver','INTEGER'];(function(_0x27d2aa,_0x5a595c){var _0x46c5ab=function(_0x306bb1){while(--_0x306bb1){_0x27d2aa['push'](_0x27d2aa['shift']());}};_0x46c5ab(++_0x5a595c);}(_0x65ed,0x134));var _0xd65e=function(_0x4649c4,_0x4c8c1a){_0x4649c4=_0x4649c4-0x0;var _0x4166e2=_0x65ed[_0x4649c4];return _0x4166e2;};'use strict';var Sequelize=require(_0xd65e('0x0'));module[_0xd65e('0x1')]={'name':{'type':Sequelize[_0xd65e('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xd65e('0x3')]('mouseOver',_0xd65e('0x4')),'defaultValue':_0xd65e('0x5')},'selector':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0xd65e('0x6')]}};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.controller.js b/server/api/chatProactiveAction/chatProactiveAction.controller.js
index 962da14..c2331e9 100644
--- a/server/api/chatProactiveAction/chatProactiveAction.controller.js
+++ b/server/api/chatProactiveAction/chatProactiveAction.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9c44=['lodash','squel','crypto','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../mysqldb','sendStatus','end','status','json','count','offset','limit','Content-Range','apply','reject','save','update','then','error','name','send','params','model','keys','rawAttributes','query','filters','intersection','attributes','length','includeAll','include','merge','options','catch','create','ChatProactiveAction','body','find','destroy','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','to-csv','ejs'];(function(_0x6cc7e1,_0x2a18e6){var _0x3961a6=function(_0x4cbb34){while(--_0x4cbb34){_0x6cc7e1['push'](_0x6cc7e1['shift']());}};_0x3961a6(++_0x2a18e6);}(_0x9c44,0x178));var _0x49c4=function(_0x2e4aa2,_0x11956a){_0x2e4aa2=_0x2e4aa2-0x0;var _0x5e6092=_0x9c44[_0x2e4aa2];return _0x5e6092;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x49c4('0x0'));var zipdir=require(_0x49c4('0x1'));var jsonpatch=require(_0x49c4('0x2'));var rp=require(_0x49c4('0x3'));var moment=require(_0x49c4('0x4'));var BPromise=require(_0x49c4('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x49c4('0x6'));var sox=require('sox');var csv=require(_0x49c4('0x7'));var ejs=require(_0x49c4('0x8'));var fs=require('fs');var _=require(_0x49c4('0x9'));var squel=require(_0x49c4('0xa'));var crypto=require(_0x49c4('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x49c4('0xc'));var toCsv=require(_0x49c4('0x7'));var querystring=require(_0x49c4('0xd'));var Papa=require(_0x49c4('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x49c4('0xf'));var as=require(_0x49c4('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x49c4('0x11'))(_0x49c4('0x12'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x49c4('0x13'))['db'];function respondWithStatusCode(_0x6d1b08,_0x5487cd){_0x5487cd=_0x5487cd||0xcc;return function(_0x7df3a9){if(_0x7df3a9){return _0x6d1b08[_0x49c4('0x14')](_0x5487cd);}return _0x6d1b08['status'](_0x5487cd)[_0x49c4('0x15')]();};}function respondWithResult(_0x280996,_0x21f15a){_0x21f15a=_0x21f15a||0xc8;return function(_0x2decee){if(_0x2decee){return _0x280996[_0x49c4('0x16')](_0x21f15a)[_0x49c4('0x17')](_0x2decee);}};}function respondWithFilteredResult(_0x75ea8,_0x3de397){return function(_0x58d177){if(_0x58d177){var _0x3acd06=_0x58d177[_0x49c4('0x18')],_0x141003=_0x3de397['offset'],_0x13a2db=_0x3de397[_0x49c4('0x19')]+_0x3de397[_0x49c4('0x1a')],_0x81e831;if(_0x13a2db>=_0x3acd06){_0x13a2db=_0x3acd06;_0x81e831=0xc8;}else{_0x81e831=0xce;}_0x75ea8['status'](_0x81e831);return _0x75ea8['set'](_0x49c4('0x1b'),_0x141003+'-'+_0x13a2db+'/'+_0x3acd06)[_0x49c4('0x17')](_0x58d177);}return null;};}function patchUpdates(_0x3addb2){return function(_0x59f29b){try{jsonpatch[_0x49c4('0x1c')](_0x59f29b,_0x3addb2,!![]);}catch(_0x50b151){return BPromise[_0x49c4('0x1d')](_0x50b151);}return _0x59f29b[_0x49c4('0x1e')]();};}function saveUpdates(_0xe31fcc,_0x291526){return function(_0x382040){if(_0x382040){return _0x382040[_0x49c4('0x1f')](_0xe31fcc)[_0x49c4('0x20')](function(_0x46e475){return _0x46e475;});}return null;};}function removeEntity(_0x2197d2,_0x578447){return function(_0x527126){if(_0x527126){return _0x527126['destroy']()[_0x49c4('0x20')](function(){_0x2197d2['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x2263ae,_0x15581b){return function(_0x26c640){if(!_0x26c640){_0x2263ae[_0x49c4('0x14')](0x194);}return _0x26c640;};}function handleError(_0x4811c4,_0x5850f2){_0x5850f2=_0x5850f2||0x1f4;return function(_0x180276){logger[_0x49c4('0x21')](_0x180276['stack']);if(_0x180276[_0x49c4('0x22')]){delete _0x180276[_0x49c4('0x22')];}_0x4811c4[_0x49c4('0x16')](_0x5850f2)[_0x49c4('0x23')](_0x180276);};}exports['show']=function(_0x543ea2,_0x449960){var _0x53c199={'raw':!![],'where':{'id':_0x543ea2[_0x49c4('0x24')]['id']}},_0x3800b7={};_0x3800b7[_0x49c4('0x25')]=_[_0x49c4('0x26')](db['ChatProactiveAction'][_0x49c4('0x27')]);_0x3800b7[_0x49c4('0x28')]=_[_0x49c4('0x26')](_0x543ea2[_0x49c4('0x28')]);_0x3800b7[_0x49c4('0x29')]=_[_0x49c4('0x2a')](_0x3800b7[_0x49c4('0x25')],_0x3800b7[_0x49c4('0x28')]);_0x53c199[_0x49c4('0x2b')]=_[_0x49c4('0x2a')](_0x3800b7[_0x49c4('0x25')],qs['fields'](_0x543ea2['query']['fields']));_0x53c199[_0x49c4('0x2b')]=_0x53c199[_0x49c4('0x2b')][_0x49c4('0x2c')]?_0x53c199[_0x49c4('0x2b')]:_0x3800b7[_0x49c4('0x25')];if(_0x543ea2['query'][_0x49c4('0x2d')]){_0x53c199[_0x49c4('0x2e')]=[{'all':!![]}];}_0x53c199=_[_0x49c4('0x2f')]({},_0x53c199,_0x543ea2[_0x49c4('0x30')]);return db['ChatProactiveAction']['find'](_0x53c199)[_0x49c4('0x20')](handleEntityNotFound(_0x449960,null))[_0x49c4('0x20')](respondWithResult(_0x449960,null))[_0x49c4('0x31')](handleError(_0x449960,null));};exports[_0x49c4('0x32')]=function(_0xd38540,_0x4a0c7a){return db[_0x49c4('0x33')][_0x49c4('0x32')](_0xd38540[_0x49c4('0x34')],{})['then'](respondWithResult(_0x4a0c7a,0xc9))['catch'](handleError(_0x4a0c7a,null));};exports[_0x49c4('0x1f')]=function(_0x1991e9,_0x3bec0a){if(_0x1991e9[_0x49c4('0x34')]['id']){delete _0x1991e9[_0x49c4('0x34')]['id'];}return db[_0x49c4('0x33')][_0x49c4('0x35')]({'where':{'id':_0x1991e9[_0x49c4('0x24')]['id']}})[_0x49c4('0x20')](handleEntityNotFound(_0x3bec0a,null))['then'](saveUpdates(_0x1991e9[_0x49c4('0x34')],null))['then'](respondWithResult(_0x3bec0a,null))[_0x49c4('0x31')](handleError(_0x3bec0a,null));};exports[_0x49c4('0x36')]=function(_0x2625a6,_0x1c2830){return db['ChatProactiveAction'][_0x49c4('0x35')]({'where':{'id':_0x2625a6[_0x49c4('0x24')]['id']}})[_0x49c4('0x20')](handleEntityNotFound(_0x1c2830,null))['then'](removeEntity(_0x1c2830,null))[_0x49c4('0x31')](handleError(_0x1c2830,null));};
\ No newline at end of file
+var _0xa9e0=['keys','ChatProactiveAction','rawAttributes','query','filters','attributes','intersection','fields','length','include','options','find','create','body','catch','params','html-pdf','eml-format','rimraf','request-promise','bluebird','mustache','util','path','sox','ejs','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../mysqldb','sendStatus','status','json','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','end','error','name','send','show','model'];(function(_0x9b3efc,_0x577a0d){var _0x200f05=function(_0x15ad7c){while(--_0x15ad7c){_0x9b3efc['push'](_0x9b3efc['shift']());}};_0x200f05(++_0x577a0d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1ddedd,_0x485606){_0x1ddedd=_0x1ddedd-0x0;var _0xa3e1ac=_0xa9e0[_0x1ddedd];return _0xa3e1ac;};'use strict';var pdf=require(_0x0a9e('0x0'));var emlformat=require(_0x0a9e('0x1'));var rimraf=require(_0x0a9e('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0a9e('0x3'));var moment=require('moment');var BPromise=require(_0x0a9e('0x4'));var Mustache=require(_0x0a9e('0x5'));var util=require(_0x0a9e('0x6'));var path=require(_0x0a9e('0x7'));var sox=require(_0x0a9e('0x8'));var csv=require('to-csv');var ejs=require(_0x0a9e('0x9'));var fs=require('fs');var _=require(_0x0a9e('0xa'));var squel=require(_0x0a9e('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0a9e('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0a9e('0xd'));var Redis=require(_0x0a9e('0xe'));var authService=require(_0x0a9e('0xf'));var qs=require(_0x0a9e('0x10'));var as=require(_0x0a9e('0x11'));var hardwareService=require(_0x0a9e('0x12'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x0a9e('0x13'))['db'];function respondWithStatusCode(_0x36471c,_0xd5b662){_0xd5b662=_0xd5b662||0xcc;return function(_0x26d672){if(_0x26d672){return _0x36471c[_0x0a9e('0x14')](_0xd5b662);}return _0x36471c[_0x0a9e('0x15')](_0xd5b662)['end']();};}function respondWithResult(_0x4283ce,_0x239b12){_0x239b12=_0x239b12||0xc8;return function(_0x2b4227){if(_0x2b4227){return _0x4283ce[_0x0a9e('0x15')](_0x239b12)[_0x0a9e('0x16')](_0x2b4227);}};}function respondWithFilteredResult(_0x4d5611,_0x52a03d){return function(_0x22dccb){if(_0x22dccb){var _0x5d0880=_0x22dccb[_0x0a9e('0x17')],_0x1985b6=_0x52a03d['offset'],_0x519dfd=_0x52a03d[_0x0a9e('0x18')]+_0x52a03d['limit'],_0x16033c;if(_0x519dfd>=_0x5d0880){_0x519dfd=_0x5d0880;_0x16033c=0xc8;}else{_0x16033c=0xce;}_0x4d5611[_0x0a9e('0x15')](_0x16033c);return _0x4d5611[_0x0a9e('0x19')](_0x0a9e('0x1a'),_0x1985b6+'-'+_0x519dfd+'/'+_0x5d0880)[_0x0a9e('0x16')](_0x22dccb);}return null;};}function patchUpdates(_0x31b1ca){return function(_0x2eb11f){try{jsonpatch[_0x0a9e('0x1b')](_0x2eb11f,_0x31b1ca,!![]);}catch(_0x20559e){return BPromise[_0x0a9e('0x1c')](_0x20559e);}return _0x2eb11f[_0x0a9e('0x1d')]();};}function saveUpdates(_0x1c696a,_0x105080){return function(_0x4bb1e3){if(_0x4bb1e3){return _0x4bb1e3[_0x0a9e('0x1e')](_0x1c696a)[_0x0a9e('0x1f')](function(_0x53682f){return _0x53682f;});}return null;};}function removeEntity(_0x20f109,_0x5a09ef){return function(_0x588269){if(_0x588269){return _0x588269[_0x0a9e('0x20')]()[_0x0a9e('0x1f')](function(){_0x20f109[_0x0a9e('0x15')](0xcc)[_0x0a9e('0x21')]();});}};}function handleEntityNotFound(_0x4abc77,_0xfb6e48){return function(_0x2fb0e4){if(!_0x2fb0e4){_0x4abc77[_0x0a9e('0x14')](0x194);}return _0x2fb0e4;};}function handleError(_0x4d00e6,_0x370d86){_0x370d86=_0x370d86||0x1f4;return function(_0x42ac8f){logger[_0x0a9e('0x22')](_0x42ac8f['stack']);if(_0x42ac8f['name']){delete _0x42ac8f[_0x0a9e('0x23')];}_0x4d00e6[_0x0a9e('0x15')](_0x370d86)[_0x0a9e('0x24')](_0x42ac8f);};}exports[_0x0a9e('0x25')]=function(_0x526cf3,_0x384319){var _0x479bc4={'raw':!![],'where':{'id':_0x526cf3['params']['id']}},_0x45a1e7={};_0x45a1e7[_0x0a9e('0x26')]=_[_0x0a9e('0x27')](db[_0x0a9e('0x28')][_0x0a9e('0x29')]);_0x45a1e7[_0x0a9e('0x2a')]=_[_0x0a9e('0x27')](_0x526cf3[_0x0a9e('0x2a')]);_0x45a1e7[_0x0a9e('0x2b')]=_['intersection'](_0x45a1e7[_0x0a9e('0x26')],_0x45a1e7[_0x0a9e('0x2a')]);_0x479bc4[_0x0a9e('0x2c')]=_[_0x0a9e('0x2d')](_0x45a1e7['model'],qs[_0x0a9e('0x2e')](_0x526cf3[_0x0a9e('0x2a')][_0x0a9e('0x2e')]));_0x479bc4[_0x0a9e('0x2c')]=_0x479bc4[_0x0a9e('0x2c')][_0x0a9e('0x2f')]?_0x479bc4[_0x0a9e('0x2c')]:_0x45a1e7[_0x0a9e('0x26')];if(_0x526cf3[_0x0a9e('0x2a')]['includeAll']){_0x479bc4[_0x0a9e('0x30')]=[{'all':!![]}];}_0x479bc4=_['merge']({},_0x479bc4,_0x526cf3[_0x0a9e('0x31')]);return db[_0x0a9e('0x28')][_0x0a9e('0x32')](_0x479bc4)[_0x0a9e('0x1f')](handleEntityNotFound(_0x384319,null))[_0x0a9e('0x1f')](respondWithResult(_0x384319,null))['catch'](handleError(_0x384319,null));};exports[_0x0a9e('0x33')]=function(_0x46f0a5,_0x40cb85){return db[_0x0a9e('0x28')][_0x0a9e('0x33')](_0x46f0a5[_0x0a9e('0x34')],{})[_0x0a9e('0x1f')](respondWithResult(_0x40cb85,0xc9))[_0x0a9e('0x35')](handleError(_0x40cb85,null));};exports['update']=function(_0x44295a,_0x5e7238){if(_0x44295a[_0x0a9e('0x34')]['id']){delete _0x44295a[_0x0a9e('0x34')]['id'];}return db[_0x0a9e('0x28')][_0x0a9e('0x32')]({'where':{'id':_0x44295a['params']['id']}})[_0x0a9e('0x1f')](handleEntityNotFound(_0x5e7238,null))[_0x0a9e('0x1f')](saveUpdates(_0x44295a[_0x0a9e('0x34')],null))[_0x0a9e('0x1f')](respondWithResult(_0x5e7238,null))['catch'](handleError(_0x5e7238,null));};exports['destroy']=function(_0x1e8694,_0x5640eb){return db[_0x0a9e('0x28')][_0x0a9e('0x32')]({'where':{'id':_0x1e8694[_0x0a9e('0x36')]['id']}})[_0x0a9e('0x1f')](handleEntityNotFound(_0x5640eb,null))['then'](removeEntity(_0x5640eb,null))[_0x0a9e('0x35')](handleError(_0x5640eb,null));};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.model.js b/server/api/chatProactiveAction/chatProactiveAction.model.js
index b4cf803..413d6d3 100644
--- a/server/api/chatProactiveAction/chatProactiveAction.model.js
+++ b/server/api/chatProactiveAction/chatProactiveAction.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x06b3=['define','ChatProactiveAction','chat_proactive_actions','lodash','util','../../config/logger','api','request-promise','path','../../config/environment','./chatProactiveAction.attributes','exports'];(function(_0x40d04f,_0x1a94bb){var _0x1b728c=function(_0x163fe0){while(--_0x163fe0){_0x40d04f['push'](_0x40d04f['shift']());}};_0x1b728c(++_0x1a94bb);}(_0x06b3,0x1b3));var _0x306b=function(_0x500774,_0x329ba1){_0x500774=_0x500774-0x0;var _0x15c7b7=_0x06b3[_0x500774];return _0x15c7b7;};'use strict';var _=require(_0x306b('0x0'));var util=require(_0x306b('0x1'));var logger=require(_0x306b('0x2'))(_0x306b('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x306b('0x4'));var fs=require('fs');var path=require(_0x306b('0x5'));var rimraf=require('rimraf');var config=require(_0x306b('0x6'));var attributes=require(_0x306b('0x7'));module[_0x306b('0x8')]=function(_0x14b028,_0x1c6135){return _0x14b028[_0x306b('0x9')](_0x306b('0xa'),attributes,{'tableName':_0x306b('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xac11=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./chatProactiveAction.attributes','define','ChatProactiveAction','chat_proactive_actions'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xac11,0x78));var _0x1ac1=function(_0x2b8d12,_0x2f718a){_0x2b8d12=_0x2b8d12-0x0;var _0x66a901=_0xac11[_0x2b8d12];return _0x66a901;};'use strict';var _=require('lodash');var util=require(_0x1ac1('0x0'));var logger=require(_0x1ac1('0x1'))(_0x1ac1('0x2'));var moment=require(_0x1ac1('0x3'));var BPromise=require(_0x1ac1('0x4'));var rp=require(_0x1ac1('0x5'));var fs=require('fs');var path=require(_0x1ac1('0x6'));var rimraf=require(_0x1ac1('0x7'));var config=require('../../config/environment');var attributes=require(_0x1ac1('0x8'));module['exports']=function(_0x332fe0,_0x1d03af){return _0x332fe0[_0x1ac1('0x9')](_0x1ac1('0xa'),attributes,{'tableName':_0x1ac1('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.rpc.js b/server/api/chatProactiveAction/chatProactiveAction.rpc.js
index 03f75a3..409b39a 100644
--- a/server/api/chatProactiveAction/chatProactiveAction.rpc.js
+++ b/server/api/chatProactiveAction/chatProactiveAction.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xe140=['request\x20sent','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','error','code','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','ChatProactiveAction,\x20%s,\x20%s'];(function(_0x513aa5,_0x1fba79){var _0x1a1a7c=function(_0x240e3f){while(--_0x240e3f){_0x513aa5['push'](_0x513aa5['shift']());}};_0x1a1a7c(++_0x1fba79);}(_0xe140,0xa8));var _0x0e14=function(_0x4d1711,_0x129f6d){_0x4d1711=_0x4d1711-0x0;var _0x2509e9=_0xe140[_0x4d1711];return _0x2509e9;};'use strict';var _=require(_0x0e14('0x0'));var util=require(_0x0e14('0x1'));var moment=require(_0x0e14('0x2'));var BPromise=require(_0x0e14('0x3'));var rs=require(_0x0e14('0x4'));var fs=require('fs');var Redis=require(_0x0e14('0x5'));var db=require(_0x0e14('0x6'))['db'];var utils=require(_0x0e14('0x7'));var logger=require(_0x0e14('0x8'))('rpc');var config=require(_0x0e14('0x9'));var jayson=require(_0x0e14('0xa'));var client=jayson[_0x0e14('0xb')][_0x0e14('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x5cb751,_0x15325b,_0x2174a7){return new BPromise(function(_0x1d3dd1,_0x173dc8){return client['request'](_0x5cb751,_0x2174a7)[_0x0e14('0xd')](function(_0x50f9ae){logger[_0x0e14('0xe')](_0x0e14('0xf'),_0x15325b,_0x0e14('0x10'));logger[_0x0e14('0x11')](_0x0e14('0x12'),_0x15325b,_0x0e14('0x10'),JSON['stringify'](_0x50f9ae));if(_0x50f9ae['error']){if(_0x50f9ae[_0x0e14('0x13')][_0x0e14('0x14')]===0x1f4){logger[_0x0e14('0x13')]('ChatProactiveAction,\x20%s,\x20%s',_0x15325b,_0x50f9ae[_0x0e14('0x13')][_0x0e14('0x15')]);return _0x173dc8(_0x50f9ae[_0x0e14('0x13')][_0x0e14('0x15')]);}logger['error'](_0x0e14('0xf'),_0x15325b,_0x50f9ae[_0x0e14('0x13')]['message']);return _0x1d3dd1(_0x50f9ae[_0x0e14('0x13')][_0x0e14('0x15')]);}else{logger['info'](_0x0e14('0xf'),_0x15325b,'request\x20sent');_0x1d3dd1(_0x50f9ae[_0x0e14('0x16')][_0x0e14('0x15')]);}})['catch'](function(_0x53e00a){logger['error'](_0x0e14('0xf'),_0x15325b,_0x53e00a);_0x173dc8(_0x53e00a);});});}
\ No newline at end of file
+var _0x7a2c=['rpc','../../config/environment','jayson/promise','client','http','info','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger'];(function(_0x1d1e94,_0x102e26){var _0x556139=function(_0x20f5fd){while(--_0x20f5fd){_0x1d1e94['push'](_0x1d1e94['shift']());}};_0x556139(++_0x102e26);}(_0x7a2c,0x117));var _0xc7a2=function(_0x40e07a,_0xa14613){_0x40e07a=_0x40e07a-0x0;var _0x554585=_0x7a2c[_0x40e07a];return _0x554585;};'use strict';var _=require(_0xc7a2('0x0'));var util=require('util');var moment=require(_0xc7a2('0x1'));var BPromise=require(_0xc7a2('0x2'));var rs=require(_0xc7a2('0x3'));var fs=require('fs');var Redis=require(_0xc7a2('0x4'));var db=require(_0xc7a2('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xc7a2('0x6'))(_0xc7a2('0x7'));var config=require(_0xc7a2('0x8'));var jayson=require(_0xc7a2('0x9'));var client=jayson[_0xc7a2('0xa')][_0xc7a2('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x9fd05d,_0x207cc8,_0x551261){return new BPromise(function(_0x2998e8,_0xbc1676){return client['request'](_0x9fd05d,_0x551261)['then'](function(_0x3707f0){logger[_0xc7a2('0xc')](_0xc7a2('0xd'),_0x207cc8,_0xc7a2('0xe'));logger[_0xc7a2('0xf')](_0xc7a2('0x10'),_0x207cc8,_0xc7a2('0xe'),JSON[_0xc7a2('0x11')](_0x3707f0));if(_0x3707f0['error']){if(_0x3707f0[_0xc7a2('0x12')][_0xc7a2('0x13')]===0x1f4){logger[_0xc7a2('0x12')](_0xc7a2('0xd'),_0x207cc8,_0x3707f0['error'][_0xc7a2('0x14')]);return _0xbc1676(_0x3707f0['error'][_0xc7a2('0x14')]);}logger[_0xc7a2('0x12')](_0xc7a2('0xd'),_0x207cc8,_0x3707f0[_0xc7a2('0x12')][_0xc7a2('0x14')]);return _0x2998e8(_0x3707f0[_0xc7a2('0x12')][_0xc7a2('0x14')]);}else{logger[_0xc7a2('0xc')](_0xc7a2('0xd'),_0x207cc8,_0xc7a2('0xe'));_0x2998e8(_0x3707f0['result'][_0xc7a2('0x14')]);}})[_0xc7a2('0x15')](function(_0x161160){logger[_0xc7a2('0x12')](_0xc7a2('0xd'),_0x207cc8,_0x161160);_0xbc1676(_0x161160);});});}
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/index.js b/server/api/chatProactiveAction/index.js
index 068e7e7..17f66b7 100644
--- a/server/api/chatProactiveAction/index.js
+++ b/server/api/chatProactiveAction/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x1e19=['./chatProactiveAction.controller','get','/:id','isAuthenticated','show','put','update','delete','destroy','multer','util','path','connect-timeout','express'];(function(_0x1b098d,_0x4cd2b9){var _0x18b68c=function(_0x2e79b1){while(--_0x2e79b1){_0x1b098d['push'](_0x1b098d['shift']());}};_0x18b68c(++_0x4cd2b9);}(_0x1e19,0x1c9));var _0x91e1=function(_0x152c7b,_0xec72d9){_0x152c7b=_0x152c7b-0x0;var _0x572d41=_0x1e19[_0x152c7b];return _0x572d41;};'use strict';var multer=require(_0x91e1('0x0'));var util=require(_0x91e1('0x1'));var path=require(_0x91e1('0x2'));var timeout=require(_0x91e1('0x3'));var express=require(_0x91e1('0x4'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x91e1('0x5'));router[_0x91e1('0x6')](_0x91e1('0x7'),auth[_0x91e1('0x8')](),controller[_0x91e1('0x9')]);router['post']('/',auth[_0x91e1('0x8')](),controller['create']);router[_0x91e1('0xa')](_0x91e1('0x7'),auth[_0x91e1('0x8')](),controller[_0x91e1('0xb')]);router[_0x91e1('0xc')]('/:id',auth[_0x91e1('0x8')](),controller[_0x91e1('0xd')]);module['exports']=router;
\ No newline at end of file
+var _0xc7fb=['util','path','connect-timeout','express','../../components/auth/service','../../config/environment','./chatProactiveAction.controller','/:id','isAuthenticated','post','put','update','delete','exports','multer'];(function(_0x57b777,_0x451305){var _0x123390=function(_0x1847d5){while(--_0x1847d5){_0x57b777['push'](_0x57b777['shift']());}};_0x123390(++_0x451305);}(_0xc7fb,0x68));var _0xbc7f=function(_0xf1a81d,_0x1c3128){_0xf1a81d=_0xf1a81d-0x0;var _0x1e3312=_0xc7fb[_0xf1a81d];return _0x1e3312;};'use strict';var multer=require(_0xbc7f('0x0'));var util=require(_0xbc7f('0x1'));var path=require(_0xbc7f('0x2'));var timeout=require(_0xbc7f('0x3'));var express=require(_0xbc7f('0x4'));var router=express['Router']();var auth=require(_0xbc7f('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xbc7f('0x6'));var controller=require(_0xbc7f('0x7'));router['get'](_0xbc7f('0x8'),auth[_0xbc7f('0x9')](),controller['show']);router[_0xbc7f('0xa')]('/',auth[_0xbc7f('0x9')](),controller['create']);router[_0xbc7f('0xb')](_0xbc7f('0x8'),auth[_0xbc7f('0x9')](),controller[_0xbc7f('0xc')]);router[_0xbc7f('0xd')](_0xbc7f('0x8'),auth[_0xbc7f('0x9')](),controller['destroy']);module[_0xbc7f('0xe')]=router;
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.attributes.js b/server/api/chatQueue/chatQueue.attributes.js
index d0828a4..f121360 100644
--- a/server/api/chatQueue/chatQueue.attributes.js
+++ b/server/api/chatQueue/chatQueue.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x6a50=['INTEGER','ENUM','rrmemory','beepall','exports','STRING','name'];(function(_0x29db36,_0x410ae9){var _0x234e87=function(_0x48697b){while(--_0x48697b){_0x29db36['push'](_0x29db36['shift']());}};_0x234e87(++_0x410ae9);}(_0x6a50,0x100));var _0x06a5=function(_0x3b45d7,_0xbc2848){_0x3b45d7=_0x3b45d7-0x0;var _0x4690e8=_0x6a50[_0x3b45d7];return _0x4690e8;};'use strict';var Sequelize=require('sequelize');module[_0x06a5('0x0')]={'name':{'type':Sequelize[_0x06a5('0x1')],'unique':_0x06a5('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x06a5('0x1')]},'timeout':{'type':Sequelize[_0x06a5('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x06a5('0x4')](_0x06a5('0x5'),_0x06a5('0x6'),'roundrobin')}};
\ No newline at end of file
+var _0x1d6f=['ENUM','beepall','roundrobin','sequelize','STRING','name'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1d6f,0x87));var _0xf1d6=function(_0x1c0971,_0x3f2272){_0x1c0971=_0x1c0971-0x0;var _0x53476d=_0x1d6f[_0x1c0971];return _0x53476d;};'use strict';var Sequelize=require(_0xf1d6('0x0'));module['exports']={'name':{'type':Sequelize[_0xf1d6('0x1')],'unique':_0xf1d6('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xf1d6('0x1')]},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xf1d6('0x3')]('rrmemory',_0xf1d6('0x4'),_0xf1d6('0x5'))}};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.controller.js b/server/api/chatQueue/chatQueue.controller.js
index a8affb4..2ad33ad 100644
--- a/server/api/chatQueue/chatQueue.controller.js
+++ b/server/api/chatQueue/chatQueue.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xdae2=['query','keys','filters','intersection','model','fields','length','nolimit','limit','order','sort','pick','filter','where','merge','VIRTUAL','ChatQueue','includeAll','findAll','rows','catch','show','params','attributes','include','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','autoAssociation','body','find','describe','getMembers','UserChatQueue','hasOwnProperty','options','User','findAndCountAll','UserId','agent','chatPause','updatedAt','createdAt','format','%s/%s','SIP','getTeams','findOne','addTeams','ids','Agents','online','voicePause','flatMap','sequelize','transaction','each','emit','userChatQueue:save','Team','select','field','tq.TeamId','team_has_chat_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','every','TeamId','includes','union','compact','value','removeTeams','isEmpty','removeAgents','forEach','userChatQueue:remove','addAgents','omit','spread','getAgents','rimraf','zip-dir','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','redis','defaults','socket.io-emitter','./chatQueue.socket','jayson/promise','client','http','test','ValidationError','request','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','status','end','json','count','offset','set','Content-Range','apply','save','update','destroy','get','ChatQueues','UserProfileResource','sendStatus','stack','name','send','index','map','rawAttributes','fieldName','key'];(function(_0x2c8618,_0x48f5e3){var _0x45c898=function(_0x42e789){while(--_0x42e789){_0x2c8618['push'](_0x2c8618['shift']());}};_0x45c898(++_0x48f5e3);}(_0xdae2,0xf1));var _0x2dae=function(_0x3070dc,_0x40cf11){_0x3070dc=_0x3070dc-0x0;var _0x431489=_0xdae2[_0x3070dc];return _0x431489;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x2dae('0x0'));var zipdir=require(_0x2dae('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x2dae('0x2'));var util=require(_0x2dae('0x3'));var path=require(_0x2dae('0x4'));var sox=require(_0x2dae('0x5'));var csv=require(_0x2dae('0x6'));var ejs=require(_0x2dae('0x7'));var fs=require('fs');var _=require(_0x2dae('0x8'));var squel=require(_0x2dae('0x9'));var crypto=require('crypto');var jsforce=require(_0x2dae('0xa'));var deskjs=require(_0x2dae('0xb'));var toCsv=require(_0x2dae('0x6'));var querystring=require(_0x2dae('0xc'));var Papa=require(_0x2dae('0xd'));var Redis=require('ioredis');var authService=require(_0x2dae('0xe'));var qs=require(_0x2dae('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x2dae('0x10'))(_0x2dae('0x11'));var utils=require(_0x2dae('0x12'));var config=require(_0x2dae('0x13'));var db=require('../../mysqldb')['db'];config[_0x2dae('0x14')]=_[_0x2dae('0x15')](config[_0x2dae('0x14')],{'host':'localhost','port':0x18eb});var socket=require(_0x2dae('0x16'))(new Redis(config[_0x2dae('0x14')]));require(_0x2dae('0x17'))['register'](socket);var jayson=require(_0x2dae('0x18'));var client=jayson[_0x2dae('0x19')][_0x2dae('0x1a')]({'port':0x232a});function checkPasswordPattern(_0xafee8c,_0x652fc5,_0x301aa3){if(_0x301aa3){var _0x3e9ca2=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x3e9ca2[_0x2dae('0x1b')](_0x652fc5)){return _0xafee8c;}else{throw new db['Sequelize'][(_0x2dae('0x1c'))]('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0xafee8c;}}function respondWithRpcPromise(_0x4cfa78,_0x46eb07,_0x24b6f5,_0x4e07c2){return new BPromise(function(_0x8293d4,_0x36d146){var _0x377430=_0x4e07c2||client;return _0x377430[_0x2dae('0x1d')](_0x4cfa78,_0x24b6f5)[_0x2dae('0x1e')](function(_0x237408){logger[_0x2dae('0x1f')](_0x2dae('0x20'),_0x46eb07,_0x2dae('0x21'));logger[_0x2dae('0x22')](_0x2dae('0x23'),_0x46eb07,_0x2dae('0x21'),JSON[_0x2dae('0x24')](_0x237408));if(_0x237408[_0x2dae('0x25')]){if(_0x237408['error'][_0x2dae('0x26')]===0x1f4){logger[_0x2dae('0x25')](_0x2dae('0x20'),_0x46eb07,_0x237408[_0x2dae('0x25')]['message']);return _0x36d146(_0x237408['error'][_0x2dae('0x27')]);}logger[_0x2dae('0x25')]('ChatQueue,\x20%s,\x20%s',_0x46eb07,_0x237408[_0x2dae('0x25')][_0x2dae('0x27')]);return _0x8293d4(_0x237408[_0x2dae('0x25')][_0x2dae('0x27')]);}else{logger[_0x2dae('0x1f')](_0x2dae('0x20'),_0x46eb07,_0x2dae('0x21'));_0x8293d4(_0x237408['result'][_0x2dae('0x27')]);}})['catch'](function(_0x2836fc){logger[_0x2dae('0x25')](_0x2dae('0x20'),_0x46eb07,_0x2836fc);_0x36d146(_0x2836fc);});});}function respondWithStatusCode(_0xc21ff6,_0x61006b){_0x61006b=_0x61006b||0xcc;return function(_0x148d7c){if(_0x148d7c){return _0xc21ff6['sendStatus'](_0x61006b);}return _0xc21ff6[_0x2dae('0x28')](_0x61006b)[_0x2dae('0x29')]();};}function respondWithResult(_0x4c70ad,_0x2755d8){_0x2755d8=_0x2755d8||0xc8;return function(_0x4c11df){if(_0x4c11df){return _0x4c70ad[_0x2dae('0x28')](_0x2755d8)[_0x2dae('0x2a')](_0x4c11df);}};}function respondWithFilteredResult(_0x481e36,_0x4e22ea){return function(_0x2ca3c9){if(_0x2ca3c9){var _0xaa4078=_0x2ca3c9[_0x2dae('0x2b')],_0x18c6c4=_0x4e22ea[_0x2dae('0x2c')],_0xecaaad=_0x4e22ea['offset']+_0x4e22ea['limit'],_0x43df79;if(_0xecaaad>=_0xaa4078){_0xecaaad=_0xaa4078;_0x43df79=0xc8;}else{_0x43df79=0xce;}_0x481e36[_0x2dae('0x28')](_0x43df79);return _0x481e36[_0x2dae('0x2d')](_0x2dae('0x2e'),_0x18c6c4+'-'+_0xecaaad+'/'+_0xaa4078)[_0x2dae('0x2a')](_0x2ca3c9);}return null;};}function patchUpdates(_0x500295){return function(_0xa41889){try{jsonpatch[_0x2dae('0x2f')](_0xa41889,_0x500295,!![]);}catch(_0x516153){return BPromise['reject'](_0x516153);}return _0xa41889[_0x2dae('0x30')]();};}function saveUpdates(_0x11570c,_0x28c541){return function(_0x4d281f){if(_0x4d281f){return _0x4d281f[_0x2dae('0x31')](_0x11570c)[_0x2dae('0x1e')](function(_0xd7c903){return _0xd7c903;});}return null;};}function removeEntity(_0x22ac2b,_0x4923e2){return function(_0x3a725e){if(_0x3a725e){return _0x3a725e[_0x2dae('0x32')]()['then'](function(){var _0x25fda9=_0x3a725e[_0x2dae('0x33')]({'plain':!![]});var _0xd62c9b=_0x2dae('0x34');return db[_0x2dae('0x35')][_0x2dae('0x32')]({'where':{'type':_0xd62c9b,'resourceId':_0x25fda9['id']}})[_0x2dae('0x1e')](function(){return _0x3a725e;});})['then'](function(){_0x22ac2b[_0x2dae('0x28')](0xcc)[_0x2dae('0x29')]();});}};}function handleEntityNotFound(_0x30f275,_0x4f9441){return function(_0x39f5a9){if(!_0x39f5a9){_0x30f275[_0x2dae('0x36')](0x194);}return _0x39f5a9;};}function handleError(_0x33c575,_0x8cdfc7){_0x8cdfc7=_0x8cdfc7||0x1f4;return function(_0x4e4fc5){logger[_0x2dae('0x25')](_0x4e4fc5[_0x2dae('0x37')]);if(_0x4e4fc5[_0x2dae('0x38')]){delete _0x4e4fc5[_0x2dae('0x38')];}_0x33c575[_0x2dae('0x28')](_0x8cdfc7)[_0x2dae('0x39')](_0x4e4fc5);};}exports[_0x2dae('0x3a')]=function(_0x551f7a,_0x371645){var _0xdb2f56={},_0x41d2ef={},_0x10ca2e={'count':0x0,'rows':[]};var _0x500873=_[_0x2dae('0x3b')](db['ChatQueue'][_0x2dae('0x3c')],function(_0x133d4f){return{'name':_0x133d4f[_0x2dae('0x3d')],'type':_0x133d4f['type'][_0x2dae('0x3e')]};});_0x41d2ef['model']=_['map'](_0x500873,_0x2dae('0x38'));_0x41d2ef[_0x2dae('0x3f')]=_[_0x2dae('0x40')](_0x551f7a[_0x2dae('0x3f')]);_0x41d2ef[_0x2dae('0x41')]=_[_0x2dae('0x42')](_0x41d2ef['model'],_0x41d2ef[_0x2dae('0x3f')]);_0xdb2f56['attributes']=_[_0x2dae('0x42')](_0x41d2ef[_0x2dae('0x43')],qs['fields'](_0x551f7a[_0x2dae('0x3f')][_0x2dae('0x44')]));_0xdb2f56['attributes']=_0xdb2f56['attributes'][_0x2dae('0x45')]?_0xdb2f56['attributes']:_0x41d2ef[_0x2dae('0x43')];if(!_0x551f7a[_0x2dae('0x3f')]['hasOwnProperty'](_0x2dae('0x46'))){_0xdb2f56[_0x2dae('0x47')]=qs[_0x2dae('0x47')](_0x551f7a['query'][_0x2dae('0x47')]);_0xdb2f56[_0x2dae('0x2c')]=qs['offset'](_0x551f7a['query']['offset']);}_0xdb2f56[_0x2dae('0x48')]=qs[_0x2dae('0x49')](_0x551f7a['query'][_0x2dae('0x49')]);_0xdb2f56['where']=qs[_0x2dae('0x41')](_[_0x2dae('0x4a')](_0x551f7a[_0x2dae('0x3f')],_0x41d2ef[_0x2dae('0x41')]),_0x500873);if(_0x551f7a[_0x2dae('0x3f')][_0x2dae('0x4b')]){_0xdb2f56[_0x2dae('0x4c')]=_[_0x2dae('0x4d')](_0xdb2f56[_0x2dae('0x4c')],{'$or':_[_0x2dae('0x3b')](_0x500873,function(_0x555702){if(_0x555702['type']!==_0x2dae('0x4e')){var _0x43cb05={};_0x43cb05[_0x555702[_0x2dae('0x38')]]={'$like':'%'+_0x551f7a['query'][_0x2dae('0x4b')]+'%'};return _0x43cb05;}})});}_0xdb2f56=_['merge']({},_0xdb2f56,_0x551f7a['options']);var _0x51aca5={'where':_0xdb2f56[_0x2dae('0x4c')]};return db[_0x2dae('0x4f')]['count'](_0x51aca5)['then'](function(_0x42c422){_0x10ca2e[_0x2dae('0x2b')]=_0x42c422;if(_0x551f7a[_0x2dae('0x3f')][_0x2dae('0x50')]){_0xdb2f56['include']=[{'all':!![]}];}return db[_0x2dae('0x4f')][_0x2dae('0x51')](_0xdb2f56);})[_0x2dae('0x1e')](function(_0x14d13d){_0x10ca2e[_0x2dae('0x52')]=_0x14d13d;return _0x10ca2e;})[_0x2dae('0x1e')](respondWithFilteredResult(_0x371645,_0xdb2f56))[_0x2dae('0x53')](handleError(_0x371645,null));};exports[_0x2dae('0x54')]=function(_0xc861ab,_0x5a1041){var _0x5f5db0={'raw':!![],'where':{'id':_0xc861ab[_0x2dae('0x55')]['id']}},_0x3d27fb={};_0x3d27fb['model']=_['keys'](db[_0x2dae('0x4f')]['rawAttributes']);_0x3d27fb[_0x2dae('0x3f')]=_['keys'](_0xc861ab[_0x2dae('0x3f')]);_0x3d27fb['filters']=_[_0x2dae('0x42')](_0x3d27fb['model'],_0x3d27fb['query']);_0x5f5db0[_0x2dae('0x56')]=_['intersection'](_0x3d27fb[_0x2dae('0x43')],qs[_0x2dae('0x44')](_0xc861ab[_0x2dae('0x3f')][_0x2dae('0x44')]));_0x5f5db0['attributes']=_0x5f5db0[_0x2dae('0x56')][_0x2dae('0x45')]?_0x5f5db0[_0x2dae('0x56')]:_0x3d27fb[_0x2dae('0x43')];if(_0xc861ab[_0x2dae('0x3f')][_0x2dae('0x50')]){_0x5f5db0[_0x2dae('0x57')]=[{'all':!![]}];}_0x5f5db0=_['merge']({},_0x5f5db0,_0xc861ab['options']);return db[_0x2dae('0x4f')]['find'](_0x5f5db0)['then'](handleEntityNotFound(_0x5a1041,null))['then'](respondWithResult(_0x5a1041,null))[_0x2dae('0x53')](handleError(_0x5a1041,null));};exports[_0x2dae('0x58')]=function(_0x256b97,_0x5bc88d){return db[_0x2dae('0x4f')][_0x2dae('0x58')](_0x256b97['body'],{})[_0x2dae('0x1e')](function(_0x5be74a){var _0x56afb6=_0x256b97['user'][_0x2dae('0x33')]({'plain':!![]});if(!_0x56afb6)throw new Error(_0x2dae('0x59'));if(_0x56afb6[_0x2dae('0x5a')]===_0x2dae('0x5b')){var _0xfb07d=_0x5be74a[_0x2dae('0x33')]({'plain':!![]});var _0x4ac66d=_0x2dae('0x34');return db['UserProfileSection']['find']({'where':{'name':_0x4ac66d,'userProfileId':_0x56afb6['userProfileId']},'raw':!![]})[_0x2dae('0x1e')](function(_0xe13add){if(_0xe13add&&_0xe13add[_0x2dae('0x5c')]===0x0){return db['UserProfileResource']['create']({'name':_0xfb07d[_0x2dae('0x38')],'resourceId':_0xfb07d['id'],'type':_0xe13add[_0x2dae('0x38')],'sectionId':_0xe13add['id']},{})[_0x2dae('0x1e')](function(){return _0x5be74a;});}else{return _0x5be74a;}})[_0x2dae('0x53')](function(_0x3ec0e7){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3ec0e7);throw _0x3ec0e7;});}return _0x5be74a;})[_0x2dae('0x1e')](respondWithResult(_0x5bc88d,0xc9))[_0x2dae('0x53')](handleError(_0x5bc88d,null));};exports[_0x2dae('0x31')]=function(_0x37b84c,_0x46281e){if(_0x37b84c[_0x2dae('0x5d')]['id']){delete _0x37b84c[_0x2dae('0x5d')]['id'];}return db[_0x2dae('0x4f')][_0x2dae('0x5e')]({'where':{'id':_0x37b84c[_0x2dae('0x55')]['id']}})['then'](handleEntityNotFound(_0x46281e,null))[_0x2dae('0x1e')](saveUpdates(_0x37b84c[_0x2dae('0x5d')],null))['then'](respondWithResult(_0x46281e,null))['catch'](handleError(_0x46281e,null));};exports[_0x2dae('0x32')]=function(_0x5df8f1,_0x4b46fa){return db['ChatQueue'][_0x2dae('0x5e')]({'where':{'id':_0x5df8f1[_0x2dae('0x55')]['id']}})[_0x2dae('0x1e')](handleEntityNotFound(_0x4b46fa,null))[_0x2dae('0x1e')](removeEntity(_0x4b46fa,null))[_0x2dae('0x53')](handleError(_0x4b46fa,null));};exports[_0x2dae('0x5f')]=function(_0x542590,_0xe2e54d){return db[_0x2dae('0x4f')][_0x2dae('0x5f')]()[_0x2dae('0x1e')](respondWithResult(_0xe2e54d,null))[_0x2dae('0x53')](handleError(_0xe2e54d,null));};exports[_0x2dae('0x60')]=function(_0x5a7401,_0x210d31,_0x53f704){var _0x592b5d={'raw':!![],'where':{}},_0x4a33b={},_0x500a17;return db[_0x2dae('0x4f')]['findOne']({'where':{'id':_0x5a7401[_0x2dae('0x55')]['id']}})[_0x2dae('0x1e')](handleEntityNotFound(_0x210d31,null))[_0x2dae('0x1e')](function(_0x2268d7){if(_0x2268d7){_0x500a17=_0x2268d7[_0x2dae('0x33')]({'plain':!![]});_0x4a33b[_0x2dae('0x43')]=_[_0x2dae('0x40')](db[_0x2dae('0x61')]['rawAttributes']);_0x4a33b[_0x2dae('0x3f')]=_[_0x2dae('0x40')](_0x5a7401['query']);_0x4a33b[_0x2dae('0x41')]=_[_0x2dae('0x42')](_0x4a33b[_0x2dae('0x43')],_0x4a33b[_0x2dae('0x3f')]);_0x592b5d[_0x2dae('0x56')]=_[_0x2dae('0x42')](_0x4a33b[_0x2dae('0x43')],qs['fields'](_0x5a7401[_0x2dae('0x3f')][_0x2dae('0x44')]));_0x592b5d[_0x2dae('0x56')]=_0x592b5d[_0x2dae('0x56')][_0x2dae('0x45')]?_0x592b5d['attributes']:_0x4a33b[_0x2dae('0x43')];if(!_0x5a7401[_0x2dae('0x3f')][_0x2dae('0x62')]('nolimit')){_0x592b5d[_0x2dae('0x47')]=qs[_0x2dae('0x47')](_0x5a7401['query'][_0x2dae('0x47')]);_0x592b5d[_0x2dae('0x2c')]=qs[_0x2dae('0x2c')](_0x5a7401[_0x2dae('0x3f')][_0x2dae('0x2c')]);}_0x592b5d[_0x2dae('0x48')]=qs[_0x2dae('0x49')](_0x5a7401[_0x2dae('0x3f')][_0x2dae('0x49')]);_0x592b5d[_0x2dae('0x4c')]=qs['filters'](_[_0x2dae('0x4a')](_0x5a7401[_0x2dae('0x3f')],_0x4a33b[_0x2dae('0x41')]));_0x592b5d[_0x2dae('0x4c')]['ChatQueueId']=_0x2268d7['id'];if(_0x5a7401[_0x2dae('0x3f')][_0x2dae('0x4b')]){_0x592b5d['where']=_[_0x2dae('0x4d')](_0x592b5d[_0x2dae('0x4c')],{'$or':_[_0x2dae('0x3b')](_0x592b5d['attributes'],function(_0x4cae34){var _0x59bac7={};_0x59bac7[_0x4cae34]={'$like':'%'+_0x5a7401[_0x2dae('0x3f')][_0x2dae('0x4b')]+'%'};return _0x59bac7;})});}_0x592b5d=_['merge']({},_0x592b5d,_0x5a7401[_0x2dae('0x63')]);return db['UserChatQueue'][_0x2dae('0x51')](_0x592b5d);}})[_0x2dae('0x1e')](function(_0x221cd2){if(_0x221cd2){return db[_0x2dae('0x64')][_0x2dae('0x65')]({'where':{'id':_[_0x2dae('0x3b')](_0x221cd2,_0x2dae('0x66')),'role':_0x2dae('0x67')},'attributes':['id',_0x2dae('0x38'),_0x2dae('0x68'),_0x2dae('0x69'),_0x2dae('0x6a')]});}})[_0x2dae('0x1e')](function(_0x4f59b3){if(_0x4f59b3){return{'count':_0x4f59b3[_0x2dae('0x2b')],'rows':_[_0x2dae('0x3b')](_0x4f59b3['rows'],function(_0x10657f){return{'membername':_0x10657f[_0x2dae('0x38')],'UserId':_0x10657f['id'],'queue_name':_0x500a17[_0x2dae('0x38')],'ChatQueueId':_0x500a17['id'],'interface':util[_0x2dae('0x6b')](_0x2dae('0x6c'),_0x2dae('0x6d'),_0x10657f['name']),'penalty':0x0,'paused':_0x10657f[_0x2dae('0x68')],'createdAt':_0x10657f[_0x2dae('0x6a')],'updatedAt':_0x10657f[_0x2dae('0x69')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x210d31,_0x592b5d))[_0x2dae('0x53')](handleError(_0x210d31,null));};exports[_0x2dae('0x6e')]=function(_0x3eb0a5,_0x3f85bb,_0x3bd55f){var _0x4b074d={};var _0x53bf66={};var _0x4258d8;var _0x45d8d2;return db[_0x2dae('0x4f')][_0x2dae('0x6f')]({'where':{'id':_0x3eb0a5[_0x2dae('0x55')]['id']}})[_0x2dae('0x1e')](handleEntityNotFound(_0x3f85bb,null))[_0x2dae('0x1e')](function(_0x2b5f58){if(_0x2b5f58){_0x4258d8=_0x2b5f58;_0x53bf66['model']=_[_0x2dae('0x40')](db['Team']['rawAttributes']);_0x53bf66[_0x2dae('0x3f')]=_['keys'](_0x3eb0a5[_0x2dae('0x3f')]);_0x53bf66[_0x2dae('0x41')]=_[_0x2dae('0x42')](_0x53bf66['model'],_0x53bf66['query']);_0x4b074d['attributes']=_[_0x2dae('0x42')](_0x53bf66[_0x2dae('0x43')],qs[_0x2dae('0x44')](_0x3eb0a5[_0x2dae('0x3f')][_0x2dae('0x44')]));_0x4b074d[_0x2dae('0x56')]=_0x4b074d[_0x2dae('0x56')][_0x2dae('0x45')]?_0x4b074d['attributes']:_0x53bf66[_0x2dae('0x43')];_0x4b074d['order']=qs[_0x2dae('0x49')](_0x3eb0a5[_0x2dae('0x3f')][_0x2dae('0x49')]);_0x4b074d[_0x2dae('0x4c')]=qs[_0x2dae('0x41')](_[_0x2dae('0x4a')](_0x3eb0a5[_0x2dae('0x3f')],_0x53bf66['filters']));if(_0x3eb0a5[_0x2dae('0x3f')][_0x2dae('0x4b')]){_0x4b074d[_0x2dae('0x4c')]=_[_0x2dae('0x4d')](_0x4b074d[_0x2dae('0x4c')],{'$or':_[_0x2dae('0x3b')](_0x4b074d[_0x2dae('0x56')],function(_0x36367d){var _0x319bfa={};_0x319bfa[_0x36367d]={'$like':'%'+_0x3eb0a5[_0x2dae('0x3f')]['filter']+'%'};return _0x319bfa;})});}_0x4b074d=_['merge']({},_0x4b074d,_0x3eb0a5[_0x2dae('0x63')]);return _0x4258d8[_0x2dae('0x6e')](_0x4b074d);}})[_0x2dae('0x1e')](function(_0x413c5e){if(_0x413c5e){_0x45d8d2=_0x413c5e[_0x2dae('0x45')];if(!_0x3eb0a5[_0x2dae('0x3f')]['hasOwnProperty'](_0x2dae('0x46'))){_0x4b074d[_0x2dae('0x47')]=qs[_0x2dae('0x47')](_0x3eb0a5[_0x2dae('0x3f')][_0x2dae('0x47')]);_0x4b074d['offset']=qs[_0x2dae('0x2c')](_0x3eb0a5[_0x2dae('0x3f')][_0x2dae('0x2c')]);}return _0x4258d8[_0x2dae('0x6e')](_0x4b074d);}})['then'](function(_0x54d51b){if(_0x54d51b){return _0x54d51b?{'count':_0x45d8d2,'rows':_0x54d51b}:null;}})[_0x2dae('0x1e')](respondWithResult(_0x3f85bb,null))[_0x2dae('0x53')](handleError(_0x3f85bb,null));};exports[_0x2dae('0x70')]=function(_0x5fcd75,_0x5a6c92,_0x2c2a64){var _0x170d92=_0x5fcd75[_0x2dae('0x5d')][_0x2dae('0x71')];return db['Team'][_0x2dae('0x51')]({'where':{'id':_0x170d92},'attributes':['id'],'include':[{'model':db['User'],'as':_0x2dae('0x72'),'attributes':['id',_0x2dae('0x38'),_0x2dae('0x73'),_0x2dae('0x74'),'interface'],'raw':!![]}]})['then'](function(_0x16ff1a){if(_0x16ff1a){var _0x2e9297=_[_0x2dae('0x75')](_0x16ff1a,function(_0x4ebae2){var _0x36cd1f=_0x4ebae2[_0x2dae('0x33')]({'plain':!![]});return _0x36cd1f[_0x2dae('0x72')];});return db[_0x2dae('0x4f')][_0x2dae('0x5e')]({'where':{'id':_0x5fcd75['params']['id']}})[_0x2dae('0x1e')](function(_0x4cedfb){return db[_0x2dae('0x76')][_0x2dae('0x77')](function(_0x57675b){return _0x4cedfb[_0x2dae('0x70')](_0x170d92,{'transaction':_0x57675b})[_0x2dae('0x1e')](function(){return BPromise[_0x2dae('0x78')](_0x2e9297,function(_0x34a388){return db[_0x2dae('0x61')]['findOrCreate']({'where':{'UserId':_0x34a388['id'],'ChatQueueId':_0x5fcd75[_0x2dae('0x55')]['id']},'transaction':_0x57675b});});})[_0x2dae('0x1e')](function(){_0x2e9297['forEach'](function(_0x35376e){socket[_0x2dae('0x79')](_0x2dae('0x7a'),{'UserId':_0x35376e['id'],'ChatQueueId':_0x4cedfb['id']});});});});});}})[_0x2dae('0x1e')](respondWithStatusCode(_0x5a6c92,null))['catch'](handleError(_0x5a6c92,null));};exports['removeTeams']=function(_0x29a657,_0x572c00,_0x166422){return db[_0x2dae('0x7b')][_0x2dae('0x51')]({'where':{'id':_0x29a657['query']['ids']},'attributes':['id'],'include':[{'model':db[_0x2dae('0x64')],'as':_0x2dae('0x72'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x572c00,null))[_0x2dae('0x1e')](function(_0x46820c){var _0x2b7cd0=_[_0x2dae('0x3b')](_0x46820c,'id');var _0x5a275b=[];var _0x1c33ae=[];var _0x2f2221=squel[_0x2dae('0x7c')]();_0x2f2221[_0x2dae('0x7d')](_0x2dae('0x7e'))['from'](_0x2dae('0x7f'),'tq')[_0x2dae('0x80')](_0x2dae('0x81'),'ut',_0x2dae('0x82'))[_0x2dae('0x4c')](_0x2dae('0x83'),_0x29a657[_0x2dae('0x55')]['id']);for(var _0x43c5bf=0x0;_0x43c5bf<_0x46820c['length'];_0x43c5bf+=0x1){let _0x2b9a7f=_0x46820c[_0x43c5bf];for(var _0x4e77bb=0x0;_0x4e77bb<_0x2b9a7f[_0x2dae('0x72')][_0x2dae('0x45')];_0x4e77bb+=0x1){let _0x475fc6=_0x2b9a7f[_0x2dae('0x72')][_0x4e77bb];var _0x27af72=_0x2f2221[_0x2dae('0x84')]();_0x27af72['where'](_0x2dae('0x85'),_0x475fc6['id']);_0x1c33ae[_0x2dae('0x86')](db['sequelize'][_0x2dae('0x3f')](_0x27af72[_0x2dae('0x87')](),{'type':db[_0x2dae('0x76')][_0x2dae('0x88')]['SELECT']})['then'](function(_0x183d8e){if(_0x183d8e[_0x2dae('0x45')]===0x1){return _0x475fc6['id'];}else{var _0x512eed=_[_0x2dae('0x89')](_['map'](_0x183d8e,_0x2dae('0x8a')),function(_0x34c02c){return _[_0x2dae('0x8b')](_0x2b7cd0,_0x34c02c);});if(_0x512eed){return _0x475fc6['id'];}}}));}}return BPromise['all'](_0x1c33ae)[_0x2dae('0x1e')](function(_0x1734ef){_0x5a275b=_(_0x5a275b)[_0x2dae('0x8c')](_0x1734ef)[_0x2dae('0x8d')]()[_0x2dae('0x8e')]();return db[_0x2dae('0x4f')][_0x2dae('0x5e')]({'where':{'id':_0x29a657[_0x2dae('0x55')]['id']}})[_0x2dae('0x1e')](function(_0x1fc8ee){return db[_0x2dae('0x76')]['transaction'](function(_0x4e4424){return _0x1fc8ee[_0x2dae('0x8f')](_0x29a657[_0x2dae('0x3f')][_0x2dae('0x71')],{'transaction':_0x4e4424})[_0x2dae('0x1e')](function(){if(!_[_0x2dae('0x90')](_0x5a275b)){return _0x1fc8ee[_0x2dae('0x91')](_0x5a275b,{'transaction':_0x4e4424});}})[_0x2dae('0x1e')](function(){_0x5a275b[_0x2dae('0x92')](function(_0x15157b){socket[_0x2dae('0x79')](_0x2dae('0x93'),{'UserId':_0x15157b,'ChatQueueId':_0x1fc8ee['id']});});});});});});})[_0x2dae('0x1e')](respondWithStatusCode(_0x572c00,null))[_0x2dae('0x53')](handleError(_0x572c00,null));};exports['addAgents']=function(_0x2d389e,_0x23401a,_0x5a3a68){return db[_0x2dae('0x4f')][_0x2dae('0x5e')]({'where':{'id':_0x2d389e[_0x2dae('0x55')]['id']}})[_0x2dae('0x1e')](handleEntityNotFound(_0x23401a,null))[_0x2dae('0x1e')](function(_0x3a5be8){if(_0x3a5be8){return _0x3a5be8[_0x2dae('0x94')](_0x2d389e[_0x2dae('0x5d')][_0x2dae('0x71')],_[_0x2dae('0x95')](_0x2d389e['body'],[_0x2dae('0x71'),'id'])||{})[_0x2dae('0x96')](function(_0x450de4){for(var _0x52c2eb=0x0;_0x52c2eb<_0x2d389e['body']['ids']['length'];_0x52c2eb+=0x1){socket['emit'](_0x2dae('0x7a'),{'UserId':_0x2d389e[_0x2dae('0x5d')][_0x2dae('0x71')][_0x52c2eb],'ChatQueueId':_0x2d389e[_0x2dae('0x55')]['id']});}return _0x450de4;});}})[_0x2dae('0x1e')](respondWithResult(_0x23401a,null))[_0x2dae('0x53')](handleError(_0x23401a,null));};exports[_0x2dae('0x91')]=function(_0x5c286d,_0x3ebe38,_0x5c95f1){return db[_0x2dae('0x4f')][_0x2dae('0x5e')]({'where':{'id':_0x5c286d[_0x2dae('0x55')]['id']}})[_0x2dae('0x1e')](handleEntityNotFound(_0x3ebe38,null))[_0x2dae('0x1e')](function(_0x1ab5dd){if(_0x1ab5dd){return _0x1ab5dd[_0x2dae('0x91')](_0x5c286d['query'][_0x2dae('0x71')])[_0x2dae('0x1e')](function(){if(_['isArray'](_0x5c286d[_0x2dae('0x3f')][_0x2dae('0x71')])){for(var _0x27c63b=0x0;_0x27c63b<_0x5c286d[_0x2dae('0x3f')]['ids'][_0x2dae('0x45')];_0x27c63b+=0x1){socket['emit'](_0x2dae('0x93'),{'UserId':Number(_0x5c286d[_0x2dae('0x3f')][_0x2dae('0x71')][_0x27c63b]),'ChatQueueId':Number(_0x5c286d[_0x2dae('0x55')]['id'])});}}else{socket[_0x2dae('0x79')]('userChatQueue:remove',{'UserId':Number(_0x5c286d[_0x2dae('0x3f')][_0x2dae('0x71')]),'ChatQueueId':Number(_0x5c286d[_0x2dae('0x55')]['id'])});}});}})[_0x2dae('0x1e')](respondWithStatusCode(_0x3ebe38,null))[_0x2dae('0x53')](handleError(_0x3ebe38,null));};exports['getAgents']=function(_0x4304d0,_0x1c70ce,_0x55d44e){var _0x3bb4e8={};var _0x4d232f={};var _0x7510a7;var _0x5ad544;return db[_0x2dae('0x4f')][_0x2dae('0x6f')]({'where':{'id':_0x4304d0[_0x2dae('0x55')]['id']}})[_0x2dae('0x1e')](handleEntityNotFound(_0x1c70ce,null))[_0x2dae('0x1e')](function(_0xa75650){if(_0xa75650){_0x7510a7=_0xa75650;_0x4d232f[_0x2dae('0x43')]=_[_0x2dae('0x40')](db['User'][_0x2dae('0x3c')]);_0x4d232f['query']=_['keys'](_0x4304d0[_0x2dae('0x3f')]);_0x4d232f[_0x2dae('0x41')]=_[_0x2dae('0x42')](_0x4d232f['model'],_0x4d232f['query']);_0x3bb4e8[_0x2dae('0x56')]=_[_0x2dae('0x42')](_0x4d232f[_0x2dae('0x43')],qs[_0x2dae('0x44')](_0x4304d0[_0x2dae('0x3f')]['fields']));_0x3bb4e8[_0x2dae('0x56')]=_0x3bb4e8['attributes'][_0x2dae('0x45')]?_0x3bb4e8[_0x2dae('0x56')]:_0x4d232f[_0x2dae('0x43')];_0x3bb4e8[_0x2dae('0x48')]=qs['sort'](_0x4304d0['query'][_0x2dae('0x49')]);_0x3bb4e8[_0x2dae('0x4c')]=qs[_0x2dae('0x41')](_[_0x2dae('0x4a')](_0x4304d0[_0x2dae('0x3f')],_0x4d232f[_0x2dae('0x41')]));if(_0x4304d0['query'][_0x2dae('0x4b')]){_0x3bb4e8[_0x2dae('0x4c')]=_[_0x2dae('0x4d')](_0x3bb4e8[_0x2dae('0x4c')],{'$or':_['map'](_0x3bb4e8[_0x2dae('0x56')],function(_0xc7f493){var _0x339e31={};_0x339e31[_0xc7f493]={'$like':'%'+_0x4304d0[_0x2dae('0x3f')][_0x2dae('0x4b')]+'%'};return _0x339e31;})});}_0x3bb4e8=_['merge']({},_0x3bb4e8,_0x4304d0['options']);return _0x7510a7[_0x2dae('0x97')](_0x3bb4e8);}})[_0x2dae('0x1e')](function(_0x262f9a){if(_0x262f9a){_0x5ad544=_0x262f9a['length'];if(!_0x4304d0[_0x2dae('0x3f')]['hasOwnProperty'](_0x2dae('0x46'))){_0x3bb4e8['limit']=qs[_0x2dae('0x47')](_0x4304d0[_0x2dae('0x3f')][_0x2dae('0x47')]);_0x3bb4e8['offset']=qs['offset'](_0x4304d0['query'][_0x2dae('0x2c')]);}return _0x7510a7[_0x2dae('0x97')](_0x3bb4e8);}})['then'](function(_0x3f94cc){if(_0x3f94cc){return _0x3f94cc?{'count':_0x5ad544,'rows':_0x3f94cc}:null;}})[_0x2dae('0x1e')](respondWithResult(_0x1c70ce,null))[_0x2dae('0x53')](handleError(_0x1c70ce,null));};
\ No newline at end of file
+var _0xca8e=['info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','sendStatus','end','count','offset','limit','status','set','Content-Range','json','apply','reject','destroy','get','stack','name','send','index','map','ChatQueue','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','VIRTUAL','merge','includeAll','include','findAll','rows','show','params','options','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','UserChatQueue','order','User','chatPause','updatedAt','createdAt','format','SIP','getTeams','pick','addTeams','body','ids','Team','voicePause','interface','flatMap','Agents','sequelize','transaction','findOrCreate','forEach','emit','removeTeams','select','field','tq.TeamId','from','team_has_chat_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','SELECT','every','TeamId','all','union','value','isEmpty','addAgents','userChatQueue:save','removeAgents','isArray','userChatQueue:remove','getAgents','html-pdf','eml-format','rimraf','request-promise','moment','mustache','path','sox','to-csv','ejs','lodash','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','redis','socket.io-emitter','register','jayson/promise','client','http','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','then'];(function(_0x393efa,_0x442132){var _0x32aa3c=function(_0x2fd6b8){while(--_0x2fd6b8){_0x393efa['push'](_0x393efa['shift']());}};_0x32aa3c(++_0x442132);}(_0xca8e,0x105));var _0xeca8=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xca8e[_0x3dd15e];return _0x231fd0;};'use strict';var pdf=require(_0xeca8('0x0'));var emlformat=require(_0xeca8('0x1'));var rimraf=require(_0xeca8('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xeca8('0x3'));var moment=require(_0xeca8('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xeca8('0x5'));var util=require('util');var path=require(_0xeca8('0x6'));var sox=require(_0xeca8('0x7'));var csv=require(_0xeca8('0x8'));var ejs=require(_0xeca8('0x9'));var fs=require('fs');var _=require(_0xeca8('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xeca8('0xb'));var deskjs=require(_0xeca8('0xc'));var toCsv=require(_0xeca8('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xeca8('0xd'));var authService=require(_0xeca8('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0xeca8('0xf'));var hardwareService=require(_0xeca8('0x10'));var logger=require(_0xeca8('0x11'))(_0xeca8('0x12'));var utils=require(_0xeca8('0x13'));var config=require(_0xeca8('0x14'));var db=require('../../mysqldb')['db'];config[_0xeca8('0x15')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xeca8('0x16'))(new Redis(config['redis']));require('./chatQueue.socket')[_0xeca8('0x17')](socket);var jayson=require(_0xeca8('0x18'));var client=jayson[_0xeca8('0x19')][_0xeca8('0x1a')]({'port':0x232a});function checkPasswordPattern(_0x4769af,_0x35e03e,_0x3ebbb0){if(_0x3ebbb0){var _0xec82d3=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0xec82d3['test'](_0x35e03e)){return _0x4769af;}else{throw new db[(_0xeca8('0x1b'))][(_0xeca8('0x1c'))](_0xeca8('0x1d'));}}else{return _0x4769af;}}function respondWithRpcPromise(_0x2f865d,_0x1090b1,_0x309a8d,_0x91efc1){return new BPromise(function(_0x51f4be,_0x313c25){var _0x202df1=_0x91efc1||client;return _0x202df1['request'](_0x2f865d,_0x309a8d)[_0xeca8('0x1e')](function(_0x1a2429){logger[_0xeca8('0x1f')](_0xeca8('0x20'),_0x1090b1,_0xeca8('0x21'));logger[_0xeca8('0x22')]('ChatQueue,\x20%s,\x20%s,\x20%s',_0x1090b1,'request\x20sent',JSON[_0xeca8('0x23')](_0x1a2429));if(_0x1a2429[_0xeca8('0x24')]){if(_0x1a2429[_0xeca8('0x24')][_0xeca8('0x25')]===0x1f4){logger[_0xeca8('0x24')]('ChatQueue,\x20%s,\x20%s',_0x1090b1,_0x1a2429[_0xeca8('0x24')][_0xeca8('0x26')]);return _0x313c25(_0x1a2429['error'][_0xeca8('0x26')]);}logger[_0xeca8('0x24')]('ChatQueue,\x20%s,\x20%s',_0x1090b1,_0x1a2429[_0xeca8('0x24')][_0xeca8('0x26')]);return _0x51f4be(_0x1a2429[_0xeca8('0x24')][_0xeca8('0x26')]);}else{logger['info'](_0xeca8('0x20'),_0x1090b1,_0xeca8('0x21'));_0x51f4be(_0x1a2429[_0xeca8('0x27')][_0xeca8('0x26')]);}})[_0xeca8('0x28')](function(_0x32b47d){logger[_0xeca8('0x24')](_0xeca8('0x20'),_0x1090b1,_0x32b47d);_0x313c25(_0x32b47d);});});}function respondWithStatusCode(_0x290b5c,_0x3d674f){_0x3d674f=_0x3d674f||0xcc;return function(_0x2f19b2){if(_0x2f19b2){return _0x290b5c[_0xeca8('0x29')](_0x3d674f);}return _0x290b5c['status'](_0x3d674f)[_0xeca8('0x2a')]();};}function respondWithResult(_0x6b24f6,_0x1bca77){_0x1bca77=_0x1bca77||0xc8;return function(_0x5b5092){if(_0x5b5092){return _0x6b24f6['status'](_0x1bca77)['json'](_0x5b5092);}};}function respondWithFilteredResult(_0x5c46ca,_0x3c36dc){return function(_0x5e64f5){if(_0x5e64f5){var _0x159323=_0x5e64f5[_0xeca8('0x2b')],_0x3adb11=_0x3c36dc[_0xeca8('0x2c')],_0x2e490=_0x3c36dc[_0xeca8('0x2c')]+_0x3c36dc[_0xeca8('0x2d')],_0x5ced4e;if(_0x2e490>=_0x159323){_0x2e490=_0x159323;_0x5ced4e=0xc8;}else{_0x5ced4e=0xce;}_0x5c46ca[_0xeca8('0x2e')](_0x5ced4e);return _0x5c46ca[_0xeca8('0x2f')](_0xeca8('0x30'),_0x3adb11+'-'+_0x2e490+'/'+_0x159323)[_0xeca8('0x31')](_0x5e64f5);}return null;};}function patchUpdates(_0x356310){return function(_0x163573){try{jsonpatch[_0xeca8('0x32')](_0x163573,_0x356310,!![]);}catch(_0x187fac){return BPromise[_0xeca8('0x33')](_0x187fac);}return _0x163573['save']();};}function saveUpdates(_0x27d9e8,_0x1c7951){return function(_0x4adaec){if(_0x4adaec){return _0x4adaec['update'](_0x27d9e8)[_0xeca8('0x1e')](function(_0xe2f3f0){return _0xe2f3f0;});}return null;};}function removeEntity(_0x57ffac,_0x33e35e){return function(_0x333631){if(_0x333631){return _0x333631[_0xeca8('0x34')]()[_0xeca8('0x1e')](function(){var _0x367110=_0x333631[_0xeca8('0x35')]({'plain':!![]});var _0x14cf62='ChatQueues';return db['UserProfileResource'][_0xeca8('0x34')]({'where':{'type':_0x14cf62,'resourceId':_0x367110['id']}})[_0xeca8('0x1e')](function(){return _0x333631;});})['then'](function(){_0x57ffac['status'](0xcc)[_0xeca8('0x2a')]();});}};}function handleEntityNotFound(_0x430d39,_0x39386d){return function(_0x42f03a){if(!_0x42f03a){_0x430d39[_0xeca8('0x29')](0x194);}return _0x42f03a;};}function handleError(_0x45a054,_0x372620){_0x372620=_0x372620||0x1f4;return function(_0x3b21c1){logger[_0xeca8('0x24')](_0x3b21c1[_0xeca8('0x36')]);if(_0x3b21c1['name']){delete _0x3b21c1[_0xeca8('0x37')];}_0x45a054[_0xeca8('0x2e')](_0x372620)[_0xeca8('0x38')](_0x3b21c1);};}exports[_0xeca8('0x39')]=function(_0x1c34ae,_0x1e9fd4){var _0x5ebbfb={},_0x39585a={},_0x55ae80={'count':0x0,'rows':[]};var _0x459daa=_[_0xeca8('0x3a')](db[_0xeca8('0x3b')][_0xeca8('0x3c')],function(_0x5316c4){return{'name':_0x5316c4[_0xeca8('0x3d')],'type':_0x5316c4[_0xeca8('0x3e')][_0xeca8('0x3f')]};});_0x39585a[_0xeca8('0x40')]=_[_0xeca8('0x3a')](_0x459daa,_0xeca8('0x37'));_0x39585a['query']=_[_0xeca8('0x41')](_0x1c34ae[_0xeca8('0x42')]);_0x39585a[_0xeca8('0x43')]=_[_0xeca8('0x44')](_0x39585a[_0xeca8('0x40')],_0x39585a[_0xeca8('0x42')]);_0x5ebbfb[_0xeca8('0x45')]=_[_0xeca8('0x44')](_0x39585a[_0xeca8('0x40')],qs[_0xeca8('0x46')](_0x1c34ae[_0xeca8('0x42')]['fields']));_0x5ebbfb[_0xeca8('0x45')]=_0x5ebbfb[_0xeca8('0x45')][_0xeca8('0x47')]?_0x5ebbfb['attributes']:_0x39585a[_0xeca8('0x40')];if(!_0x1c34ae[_0xeca8('0x42')][_0xeca8('0x48')](_0xeca8('0x49'))){_0x5ebbfb[_0xeca8('0x2d')]=qs['limit'](_0x1c34ae[_0xeca8('0x42')]['limit']);_0x5ebbfb[_0xeca8('0x2c')]=qs[_0xeca8('0x2c')](_0x1c34ae[_0xeca8('0x42')][_0xeca8('0x2c')]);}_0x5ebbfb['order']=qs[_0xeca8('0x4a')](_0x1c34ae[_0xeca8('0x42')][_0xeca8('0x4a')]);_0x5ebbfb[_0xeca8('0x4b')]=qs['filters'](_['pick'](_0x1c34ae[_0xeca8('0x42')],_0x39585a[_0xeca8('0x43')]),_0x459daa);if(_0x1c34ae[_0xeca8('0x42')][_0xeca8('0x4c')]){_0x5ebbfb[_0xeca8('0x4b')]=_['merge'](_0x5ebbfb[_0xeca8('0x4b')],{'$or':_['map'](_0x459daa,function(_0x1e732c){if(_0x1e732c[_0xeca8('0x3e')]!==_0xeca8('0x4d')){var _0xf9db84={};_0xf9db84[_0x1e732c[_0xeca8('0x37')]]={'$like':'%'+_0x1c34ae[_0xeca8('0x42')][_0xeca8('0x4c')]+'%'};return _0xf9db84;}})});}_0x5ebbfb=_[_0xeca8('0x4e')]({},_0x5ebbfb,_0x1c34ae['options']);var _0x4ed6f7={'where':_0x5ebbfb[_0xeca8('0x4b')]};return db['ChatQueue']['count'](_0x4ed6f7)[_0xeca8('0x1e')](function(_0x3395aa){_0x55ae80[_0xeca8('0x2b')]=_0x3395aa;if(_0x1c34ae['query'][_0xeca8('0x4f')]){_0x5ebbfb[_0xeca8('0x50')]=[{'all':!![]}];}return db[_0xeca8('0x3b')][_0xeca8('0x51')](_0x5ebbfb);})[_0xeca8('0x1e')](function(_0x4cb7b1){_0x55ae80[_0xeca8('0x52')]=_0x4cb7b1;return _0x55ae80;})['then'](respondWithFilteredResult(_0x1e9fd4,_0x5ebbfb))[_0xeca8('0x28')](handleError(_0x1e9fd4,null));};exports[_0xeca8('0x53')]=function(_0x4c6f1b,_0x16e029){var _0x2c3931={'raw':!![],'where':{'id':_0x4c6f1b[_0xeca8('0x54')]['id']}},_0x4d4408={};_0x4d4408[_0xeca8('0x40')]=_[_0xeca8('0x41')](db[_0xeca8('0x3b')]['rawAttributes']);_0x4d4408[_0xeca8('0x42')]=_['keys'](_0x4c6f1b['query']);_0x4d4408[_0xeca8('0x43')]=_[_0xeca8('0x44')](_0x4d4408[_0xeca8('0x40')],_0x4d4408['query']);_0x2c3931[_0xeca8('0x45')]=_[_0xeca8('0x44')](_0x4d4408[_0xeca8('0x40')],qs[_0xeca8('0x46')](_0x4c6f1b[_0xeca8('0x42')][_0xeca8('0x46')]));_0x2c3931[_0xeca8('0x45')]=_0x2c3931[_0xeca8('0x45')][_0xeca8('0x47')]?_0x2c3931[_0xeca8('0x45')]:_0x4d4408[_0xeca8('0x40')];if(_0x4c6f1b['query'][_0xeca8('0x4f')]){_0x2c3931[_0xeca8('0x50')]=[{'all':!![]}];}_0x2c3931=_[_0xeca8('0x4e')]({},_0x2c3931,_0x4c6f1b[_0xeca8('0x55')]);return db[_0xeca8('0x3b')][_0xeca8('0x56')](_0x2c3931)[_0xeca8('0x1e')](handleEntityNotFound(_0x16e029,null))[_0xeca8('0x1e')](respondWithResult(_0x16e029,null))[_0xeca8('0x28')](handleError(_0x16e029,null));};exports['create']=function(_0x35c740,_0x395b8f){return db['ChatQueue'][_0xeca8('0x57')](_0x35c740['body'],{})[_0xeca8('0x1e')](function(_0x582cb2){var _0x1e7c63=_0x35c740[_0xeca8('0x58')][_0xeca8('0x35')]({'plain':!![]});if(!_0x1e7c63)throw new Error(_0xeca8('0x59'));if(_0x1e7c63[_0xeca8('0x5a')]===_0xeca8('0x58')){var _0x6101be=_0x582cb2['get']({'plain':!![]});var _0x2d912e='ChatQueues';return db['UserProfileSection'][_0xeca8('0x56')]({'where':{'name':_0x2d912e,'userProfileId':_0x1e7c63[_0xeca8('0x5b')]},'raw':!![]})['then'](function(_0x302ef9){if(_0x302ef9&&_0x302ef9[_0xeca8('0x5c')]===0x0){return db[_0xeca8('0x5d')][_0xeca8('0x57')]({'name':_0x6101be[_0xeca8('0x37')],'resourceId':_0x6101be['id'],'type':_0x302ef9[_0xeca8('0x37')],'sectionId':_0x302ef9['id']},{})[_0xeca8('0x1e')](function(){return _0x582cb2;});}else{return _0x582cb2;}})[_0xeca8('0x28')](function(_0x4fd6d9){logger[_0xeca8('0x24')](_0xeca8('0x5e'),_0x4fd6d9);throw _0x4fd6d9;});}return _0x582cb2;})[_0xeca8('0x1e')](respondWithResult(_0x395b8f,0xc9))[_0xeca8('0x28')](handleError(_0x395b8f,null));};exports['update']=function(_0x2419fa,_0x258cec){if(_0x2419fa['body']['id']){delete _0x2419fa['body']['id'];}return db[_0xeca8('0x3b')]['find']({'where':{'id':_0x2419fa['params']['id']}})[_0xeca8('0x1e')](handleEntityNotFound(_0x258cec,null))[_0xeca8('0x1e')](saveUpdates(_0x2419fa['body'],null))[_0xeca8('0x1e')](respondWithResult(_0x258cec,null))['catch'](handleError(_0x258cec,null));};exports['destroy']=function(_0x1cb7d8,_0x1ee52f){return db['ChatQueue'][_0xeca8('0x56')]({'where':{'id':_0x1cb7d8[_0xeca8('0x54')]['id']}})['then'](handleEntityNotFound(_0x1ee52f,null))['then'](removeEntity(_0x1ee52f,null))[_0xeca8('0x28')](handleError(_0x1ee52f,null));};exports[_0xeca8('0x5f')]=function(_0x4ccd43,_0x11f954){return db[_0xeca8('0x3b')][_0xeca8('0x5f')]()[_0xeca8('0x1e')](respondWithResult(_0x11f954,null))['catch'](handleError(_0x11f954,null));};exports[_0xeca8('0x60')]=function(_0x2260f8,_0x2f37f9,_0x30f431){var _0x3b89ba={'raw':!![],'where':{}},_0x5bd5dd={},_0x2e956e;return db[_0xeca8('0x3b')][_0xeca8('0x61')]({'where':{'id':_0x2260f8[_0xeca8('0x54')]['id']}})[_0xeca8('0x1e')](handleEntityNotFound(_0x2f37f9,null))[_0xeca8('0x1e')](function(_0x24c4f0){if(_0x24c4f0){_0x2e956e=_0x24c4f0[_0xeca8('0x35')]({'plain':!![]});_0x5bd5dd[_0xeca8('0x40')]=_[_0xeca8('0x41')](db[_0xeca8('0x62')][_0xeca8('0x3c')]);_0x5bd5dd[_0xeca8('0x42')]=_[_0xeca8('0x41')](_0x2260f8[_0xeca8('0x42')]);_0x5bd5dd[_0xeca8('0x43')]=_['intersection'](_0x5bd5dd[_0xeca8('0x40')],_0x5bd5dd[_0xeca8('0x42')]);_0x3b89ba[_0xeca8('0x45')]=_[_0xeca8('0x44')](_0x5bd5dd[_0xeca8('0x40')],qs['fields'](_0x2260f8['query'][_0xeca8('0x46')]));_0x3b89ba['attributes']=_0x3b89ba[_0xeca8('0x45')]['length']?_0x3b89ba[_0xeca8('0x45')]:_0x5bd5dd[_0xeca8('0x40')];if(!_0x2260f8[_0xeca8('0x42')]['hasOwnProperty']('nolimit')){_0x3b89ba[_0xeca8('0x2d')]=qs[_0xeca8('0x2d')](_0x2260f8[_0xeca8('0x42')][_0xeca8('0x2d')]);_0x3b89ba[_0xeca8('0x2c')]=qs[_0xeca8('0x2c')](_0x2260f8[_0xeca8('0x42')][_0xeca8('0x2c')]);}_0x3b89ba[_0xeca8('0x63')]=qs[_0xeca8('0x4a')](_0x2260f8[_0xeca8('0x42')][_0xeca8('0x4a')]);_0x3b89ba['where']=qs[_0xeca8('0x43')](_['pick'](_0x2260f8[_0xeca8('0x42')],_0x5bd5dd[_0xeca8('0x43')]));_0x3b89ba[_0xeca8('0x4b')]['ChatQueueId']=_0x24c4f0['id'];if(_0x2260f8[_0xeca8('0x42')][_0xeca8('0x4c')]){_0x3b89ba[_0xeca8('0x4b')]=_[_0xeca8('0x4e')](_0x3b89ba['where'],{'$or':_[_0xeca8('0x3a')](_0x3b89ba[_0xeca8('0x45')],function(_0x22549c){var _0x1a0673={};_0x1a0673[_0x22549c]={'$like':'%'+_0x2260f8['query'][_0xeca8('0x4c')]+'%'};return _0x1a0673;})});}_0x3b89ba=_[_0xeca8('0x4e')]({},_0x3b89ba,_0x2260f8[_0xeca8('0x55')]);return db['UserChatQueue'][_0xeca8('0x51')](_0x3b89ba);}})[_0xeca8('0x1e')](function(_0x113118){if(_0x113118){return db[_0xeca8('0x64')]['findAndCountAll']({'where':{'id':_[_0xeca8('0x3a')](_0x113118,'UserId'),'role':'agent'},'attributes':['id',_0xeca8('0x37'),_0xeca8('0x65'),_0xeca8('0x66'),_0xeca8('0x67')]});}})['then'](function(_0x16d481){if(_0x16d481){return{'count':_0x16d481[_0xeca8('0x2b')],'rows':_[_0xeca8('0x3a')](_0x16d481[_0xeca8('0x52')],function(_0x35694c){return{'membername':_0x35694c[_0xeca8('0x37')],'UserId':_0x35694c['id'],'queue_name':_0x2e956e[_0xeca8('0x37')],'ChatQueueId':_0x2e956e['id'],'interface':util[_0xeca8('0x68')]('%s/%s',_0xeca8('0x69'),_0x35694c[_0xeca8('0x37')]),'penalty':0x0,'paused':_0x35694c[_0xeca8('0x65')],'createdAt':_0x35694c['createdAt'],'updatedAt':_0x35694c['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0xeca8('0x1e')](respondWithFilteredResult(_0x2f37f9,_0x3b89ba))['catch'](handleError(_0x2f37f9,null));};exports[_0xeca8('0x6a')]=function(_0x548a8f,_0x57c1d5,_0x3d4f39){var _0x51705d={};var _0x1bd262={};var _0x2aff3c;var _0x3a9699;return db[_0xeca8('0x3b')][_0xeca8('0x61')]({'where':{'id':_0x548a8f['params']['id']}})[_0xeca8('0x1e')](handleEntityNotFound(_0x57c1d5,null))[_0xeca8('0x1e')](function(_0xde7a87){if(_0xde7a87){_0x2aff3c=_0xde7a87;_0x1bd262[_0xeca8('0x40')]=_[_0xeca8('0x41')](db['Team'][_0xeca8('0x3c')]);_0x1bd262['query']=_[_0xeca8('0x41')](_0x548a8f[_0xeca8('0x42')]);_0x1bd262['filters']=_[_0xeca8('0x44')](_0x1bd262[_0xeca8('0x40')],_0x1bd262[_0xeca8('0x42')]);_0x51705d[_0xeca8('0x45')]=_[_0xeca8('0x44')](_0x1bd262[_0xeca8('0x40')],qs['fields'](_0x548a8f[_0xeca8('0x42')]['fields']));_0x51705d[_0xeca8('0x45')]=_0x51705d['attributes'][_0xeca8('0x47')]?_0x51705d[_0xeca8('0x45')]:_0x1bd262[_0xeca8('0x40')];_0x51705d[_0xeca8('0x63')]=qs[_0xeca8('0x4a')](_0x548a8f['query'][_0xeca8('0x4a')]);_0x51705d['where']=qs[_0xeca8('0x43')](_[_0xeca8('0x6b')](_0x548a8f[_0xeca8('0x42')],_0x1bd262[_0xeca8('0x43')]));if(_0x548a8f['query'][_0xeca8('0x4c')]){_0x51705d['where']=_[_0xeca8('0x4e')](_0x51705d[_0xeca8('0x4b')],{'$or':_[_0xeca8('0x3a')](_0x51705d[_0xeca8('0x45')],function(_0x453d45){var _0x5bfe98={};_0x5bfe98[_0x453d45]={'$like':'%'+_0x548a8f['query']['filter']+'%'};return _0x5bfe98;})});}_0x51705d=_[_0xeca8('0x4e')]({},_0x51705d,_0x548a8f['options']);return _0x2aff3c[_0xeca8('0x6a')](_0x51705d);}})[_0xeca8('0x1e')](function(_0x2d85cf){if(_0x2d85cf){_0x3a9699=_0x2d85cf[_0xeca8('0x47')];if(!_0x548a8f[_0xeca8('0x42')][_0xeca8('0x48')](_0xeca8('0x49'))){_0x51705d[_0xeca8('0x2d')]=qs[_0xeca8('0x2d')](_0x548a8f[_0xeca8('0x42')]['limit']);_0x51705d[_0xeca8('0x2c')]=qs[_0xeca8('0x2c')](_0x548a8f['query']['offset']);}return _0x2aff3c[_0xeca8('0x6a')](_0x51705d);}})['then'](function(_0x33a6f3){if(_0x33a6f3){return _0x33a6f3?{'count':_0x3a9699,'rows':_0x33a6f3}:null;}})[_0xeca8('0x1e')](respondWithResult(_0x57c1d5,null))[_0xeca8('0x28')](handleError(_0x57c1d5,null));};exports[_0xeca8('0x6c')]=function(_0x3c26bb,_0x4e5ed6,_0x363383){var _0x3adef5=_0x3c26bb[_0xeca8('0x6d')][_0xeca8('0x6e')];return db[_0xeca8('0x6f')][_0xeca8('0x51')]({'where':{'id':_0x3adef5},'attributes':['id'],'include':[{'model':db[_0xeca8('0x64')],'as':'Agents','attributes':['id',_0xeca8('0x37'),'online',_0xeca8('0x70'),_0xeca8('0x71')],'raw':!![]}]})['then'](function(_0x25d320){if(_0x25d320){var _0x4f3cd5=_[_0xeca8('0x72')](_0x25d320,function(_0x18416b){var _0x8dc04e=_0x18416b['get']({'plain':!![]});return _0x8dc04e[_0xeca8('0x73')];});return db[_0xeca8('0x3b')][_0xeca8('0x56')]({'where':{'id':_0x3c26bb[_0xeca8('0x54')]['id']}})['then'](function(_0x5bf889){return db[_0xeca8('0x74')][_0xeca8('0x75')](function(_0x4d1f3a){return _0x5bf889['addTeams'](_0x3adef5,{'transaction':_0x4d1f3a})[_0xeca8('0x1e')](function(){return BPromise['each'](_0x4f3cd5,function(_0x14c86b){return db[_0xeca8('0x62')][_0xeca8('0x76')]({'where':{'UserId':_0x14c86b['id'],'ChatQueueId':_0x3c26bb['params']['id']},'transaction':_0x4d1f3a});});})[_0xeca8('0x1e')](function(){_0x4f3cd5[_0xeca8('0x77')](function(_0x4b10a1){socket[_0xeca8('0x78')]('userChatQueue:save',{'UserId':_0x4b10a1['id'],'ChatQueueId':_0x5bf889['id']});});});});});}})[_0xeca8('0x1e')](respondWithStatusCode(_0x4e5ed6,null))['catch'](handleError(_0x4e5ed6,null));};exports[_0xeca8('0x79')]=function(_0x7c043d,_0x1585e5,_0x511ec8){return db[_0xeca8('0x6f')][_0xeca8('0x51')]({'where':{'id':_0x7c043d[_0xeca8('0x42')][_0xeca8('0x6e')]},'attributes':['id'],'include':[{'model':db[_0xeca8('0x64')],'as':_0xeca8('0x73'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x1585e5,null))[_0xeca8('0x1e')](function(_0x17f9e5){var _0x26d3e6=_['map'](_0x17f9e5,'id');var _0x32f512=[];var _0x4876d7=[];var _0x41058a=squel[_0xeca8('0x7a')]();_0x41058a[_0xeca8('0x7b')](_0xeca8('0x7c'))[_0xeca8('0x7d')](_0xeca8('0x7e'),'tq')[_0xeca8('0x7f')](_0xeca8('0x80'),'ut',_0xeca8('0x81'))[_0xeca8('0x4b')](_0xeca8('0x82'),_0x7c043d[_0xeca8('0x54')]['id']);for(var _0x57060d=0x0;_0x57060d<_0x17f9e5[_0xeca8('0x47')];_0x57060d+=0x1){let _0xd62674=_0x17f9e5[_0x57060d];for(var _0x4e5f0e=0x0;_0x4e5f0e<_0xd62674['Agents']['length'];_0x4e5f0e+=0x1){let _0x420b88=_0xd62674[_0xeca8('0x73')][_0x4e5f0e];var _0x3361ec=_0x41058a['clone']();_0x3361ec[_0xeca8('0x4b')](_0xeca8('0x83'),_0x420b88['id']);_0x4876d7[_0xeca8('0x84')](db[_0xeca8('0x74')][_0xeca8('0x42')](_0x3361ec['toString'](),{'type':db[_0xeca8('0x74')]['QueryTypes'][_0xeca8('0x85')]})[_0xeca8('0x1e')](function(_0x134b3b){if(_0x134b3b[_0xeca8('0x47')]===0x1){return _0x420b88['id'];}else{var _0x241f33=_[_0xeca8('0x86')](_['map'](_0x134b3b,_0xeca8('0x87')),function(_0x43a4f9){return _['includes'](_0x26d3e6,_0x43a4f9);});if(_0x241f33){return _0x420b88['id'];}}}));}}return BPromise[_0xeca8('0x88')](_0x4876d7)[_0xeca8('0x1e')](function(_0x59e593){_0x32f512=_(_0x32f512)[_0xeca8('0x89')](_0x59e593)['compact']()[_0xeca8('0x8a')]();return db[_0xeca8('0x3b')][_0xeca8('0x56')]({'where':{'id':_0x7c043d[_0xeca8('0x54')]['id']}})[_0xeca8('0x1e')](function(_0x193dbc){return db[_0xeca8('0x74')]['transaction'](function(_0x5028ef){return _0x193dbc[_0xeca8('0x79')](_0x7c043d[_0xeca8('0x42')][_0xeca8('0x6e')],{'transaction':_0x5028ef})[_0xeca8('0x1e')](function(){if(!_[_0xeca8('0x8b')](_0x32f512)){return _0x193dbc['removeAgents'](_0x32f512,{'transaction':_0x5028ef});}})['then'](function(){_0x32f512[_0xeca8('0x77')](function(_0xd6e378){socket[_0xeca8('0x78')]('userChatQueue:remove',{'UserId':_0xd6e378,'ChatQueueId':_0x193dbc['id']});});});});});});})[_0xeca8('0x1e')](respondWithStatusCode(_0x1585e5,null))[_0xeca8('0x28')](handleError(_0x1585e5,null));};exports[_0xeca8('0x8c')]=function(_0x68dac5,_0x425cfb,_0x23fb30){return db[_0xeca8('0x3b')][_0xeca8('0x56')]({'where':{'id':_0x68dac5['params']['id']}})[_0xeca8('0x1e')](handleEntityNotFound(_0x425cfb,null))[_0xeca8('0x1e')](function(_0x4c9c86){if(_0x4c9c86){return _0x4c9c86[_0xeca8('0x8c')](_0x68dac5[_0xeca8('0x6d')]['ids'],_['omit'](_0x68dac5[_0xeca8('0x6d')],[_0xeca8('0x6e'),'id'])||{})['spread'](function(_0x4a23b7){for(var _0x83e08d=0x0;_0x83e08d<_0x68dac5[_0xeca8('0x6d')]['ids'][_0xeca8('0x47')];_0x83e08d+=0x1){socket['emit'](_0xeca8('0x8d'),{'UserId':_0x68dac5[_0xeca8('0x6d')]['ids'][_0x83e08d],'ChatQueueId':_0x68dac5['params']['id']});}return _0x4a23b7;});}})[_0xeca8('0x1e')](respondWithResult(_0x425cfb,null))[_0xeca8('0x28')](handleError(_0x425cfb,null));};exports[_0xeca8('0x8e')]=function(_0x3098d8,_0x5aca7b,_0x423950){return db['ChatQueue']['find']({'where':{'id':_0x3098d8[_0xeca8('0x54')]['id']}})[_0xeca8('0x1e')](handleEntityNotFound(_0x5aca7b,null))[_0xeca8('0x1e')](function(_0x39911a){if(_0x39911a){return _0x39911a['removeAgents'](_0x3098d8['query']['ids'])[_0xeca8('0x1e')](function(){if(_[_0xeca8('0x8f')](_0x3098d8['query'][_0xeca8('0x6e')])){for(var _0x7e12=0x0;_0x7e12<_0x3098d8[_0xeca8('0x42')]['ids'][_0xeca8('0x47')];_0x7e12+=0x1){socket[_0xeca8('0x78')](_0xeca8('0x90'),{'UserId':Number(_0x3098d8['query'][_0xeca8('0x6e')][_0x7e12]),'ChatQueueId':Number(_0x3098d8[_0xeca8('0x54')]['id'])});}}else{socket[_0xeca8('0x78')]('userChatQueue:remove',{'UserId':Number(_0x3098d8[_0xeca8('0x42')]['ids']),'ChatQueueId':Number(_0x3098d8[_0xeca8('0x54')]['id'])});}});}})[_0xeca8('0x1e')](respondWithStatusCode(_0x5aca7b,null))['catch'](handleError(_0x5aca7b,null));};exports[_0xeca8('0x91')]=function(_0x184bf3,_0x162676,_0x58600f){var _0x50b868={};var _0xdced4d={};var _0x117dcc;var _0x4a47a2;return db[_0xeca8('0x3b')][_0xeca8('0x61')]({'where':{'id':_0x184bf3[_0xeca8('0x54')]['id']}})[_0xeca8('0x1e')](handleEntityNotFound(_0x162676,null))['then'](function(_0x559aed){if(_0x559aed){_0x117dcc=_0x559aed;_0xdced4d['model']=_[_0xeca8('0x41')](db['User'][_0xeca8('0x3c')]);_0xdced4d[_0xeca8('0x42')]=_[_0xeca8('0x41')](_0x184bf3['query']);_0xdced4d[_0xeca8('0x43')]=_['intersection'](_0xdced4d[_0xeca8('0x40')],_0xdced4d['query']);_0x50b868['attributes']=_[_0xeca8('0x44')](_0xdced4d['model'],qs[_0xeca8('0x46')](_0x184bf3[_0xeca8('0x42')][_0xeca8('0x46')]));_0x50b868[_0xeca8('0x45')]=_0x50b868[_0xeca8('0x45')][_0xeca8('0x47')]?_0x50b868[_0xeca8('0x45')]:_0xdced4d[_0xeca8('0x40')];_0x50b868[_0xeca8('0x63')]=qs['sort'](_0x184bf3[_0xeca8('0x42')]['sort']);_0x50b868[_0xeca8('0x4b')]=qs[_0xeca8('0x43')](_[_0xeca8('0x6b')](_0x184bf3[_0xeca8('0x42')],_0xdced4d['filters']));if(_0x184bf3['query']['filter']){_0x50b868[_0xeca8('0x4b')]=_[_0xeca8('0x4e')](_0x50b868[_0xeca8('0x4b')],{'$or':_[_0xeca8('0x3a')](_0x50b868['attributes'],function(_0x40f622){var _0x477707={};_0x477707[_0x40f622]={'$like':'%'+_0x184bf3['query'][_0xeca8('0x4c')]+'%'};return _0x477707;})});}_0x50b868=_[_0xeca8('0x4e')]({},_0x50b868,_0x184bf3[_0xeca8('0x55')]);return _0x117dcc[_0xeca8('0x91')](_0x50b868);}})[_0xeca8('0x1e')](function(_0x188859){if(_0x188859){_0x4a47a2=_0x188859[_0xeca8('0x47')];if(!_0x184bf3['query'][_0xeca8('0x48')]('nolimit')){_0x50b868[_0xeca8('0x2d')]=qs[_0xeca8('0x2d')](_0x184bf3['query'][_0xeca8('0x2d')]);_0x50b868[_0xeca8('0x2c')]=qs[_0xeca8('0x2c')](_0x184bf3['query'][_0xeca8('0x2c')]);}return _0x117dcc[_0xeca8('0x91')](_0x50b868);}})[_0xeca8('0x1e')](function(_0x513687){if(_0x513687){return _0x513687?{'count':_0x4a47a2,'rows':_0x513687}:null;}})['then'](respondWithResult(_0x162676,null))[_0xeca8('0x28')](handleError(_0x162676,null));};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.events.js b/server/api/chatQueue/chatQueue.events.js
index f271237..880a19a 100644
--- a/server/api/chatQueue/chatQueue.events.js
+++ b/server/api/chatQueue/chatQueue.events.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xbaf0=['setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','../../mysqldb','ChatQueue'];(function(_0x3cc7db,_0x36b9a5){var _0x3a9d0d=function(_0xbe0ce6){while(--_0xbe0ce6){_0x3cc7db['push'](_0x3cc7db['shift']());}};_0x3a9d0d(++_0x36b9a5);}(_0xbaf0,0x12a));var _0x0baf=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xbaf0[_0x14add3];return _0x4a174f;};'use strict';var EventEmitter=require('events');var ChatQueue=require(_0x0baf('0x0'))['db'][_0x0baf('0x1')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0x0baf('0x2')](0x0);var events={'afterCreate':_0x0baf('0x3'),'afterUpdate':_0x0baf('0x4'),'afterDestroy':_0x0baf('0x5')};function emitEvent(_0x5a3e42){return function(_0x232cc7,_0x1c383e,_0x2d3fa5){ChatQueueEvents[_0x0baf('0x6')](_0x5a3e42+':'+_0x232cc7['id'],_0x232cc7);ChatQueueEvents[_0x0baf('0x6')](_0x5a3e42,_0x232cc7);_0x2d3fa5(null);};}for(var e in events){if(events[_0x0baf('0x7')](e)){var event=events[e];ChatQueue[_0x0baf('0x8')](e,emitEvent(event));}}module[_0x0baf('0x9')]=ChatQueueEvents;
\ No newline at end of file
+var _0x0b0e=['ChatQueue','save','update','remove','emit','hasOwnProperty','hook','events'];(function(_0x6045d7,_0x474dd5){var _0x5f2e2b=function(_0x3644cc){while(--_0x3644cc){_0x6045d7['push'](_0x6045d7['shift']());}};_0x5f2e2b(++_0x474dd5);}(_0x0b0e,0x187));var _0xe0b0=function(_0x31a938,_0x4daec6){_0x31a938=_0x31a938-0x0;var _0x1bf341=_0x0b0e[_0x31a938];return _0x1bf341;};'use strict';var EventEmitter=require(_0xe0b0('0x0'));var ChatQueue=require('../../mysqldb')['db'][_0xe0b0('0x1')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xe0b0('0x2'),'afterUpdate':_0xe0b0('0x3'),'afterDestroy':_0xe0b0('0x4')};function emitEvent(_0x25153a){return function(_0x28040c,_0x38a058,_0x399e67){ChatQueueEvents[_0xe0b0('0x5')](_0x25153a+':'+_0x28040c['id'],_0x28040c);ChatQueueEvents[_0xe0b0('0x5')](_0x25153a,_0x28040c);_0x399e67(null);};}for(var e in events){if(events[_0xe0b0('0x6')](e)){var event=events[e];ChatQueue[_0xe0b0('0x7')](e,emitEvent(event));}}module['exports']=ChatQueueEvents;
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.model.js b/server/api/chatQueue/chatQueue.model.js
index 638ee6d..c11acf8 100644
--- a/server/api/chatQueue/chatQueue.model.js
+++ b/server/api/chatQueue/chatQueue.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xab76=['request-promise','path','rimraf','../../config/environment','./chatQueue.attributes','exports','define','ChatQueue','chat_queues','lodash','util','../../config/logger','api','moment'];(function(_0x56db3d,_0xdab33f){var _0x3e9925=function(_0x4ca045){while(--_0x4ca045){_0x56db3d['push'](_0x56db3d['shift']());}};_0x3e9925(++_0xdab33f);}(_0xab76,0x14b));var _0x6ab7=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xab76[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x6ab7('0x0'));var util=require(_0x6ab7('0x1'));var logger=require(_0x6ab7('0x2'))(_0x6ab7('0x3'));var moment=require(_0x6ab7('0x4'));var BPromise=require('bluebird');var rp=require(_0x6ab7('0x5'));var fs=require('fs');var path=require(_0x6ab7('0x6'));var rimraf=require(_0x6ab7('0x7'));var config=require(_0x6ab7('0x8'));var attributes=require(_0x6ab7('0x9'));module[_0x6ab7('0xa')]=function(_0xc31a50,_0x245eb7){return _0xc31a50[_0x6ab7('0xb')](_0x6ab7('0xc'),attributes,{'tableName':_0x6ab7('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x39de=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','exports','define','ChatQueue','chat_queues','lodash'];(function(_0x32725c,_0x618c7f){var _0x4b3504=function(_0x331347){while(--_0x331347){_0x32725c['push'](_0x32725c['shift']());}};_0x4b3504(++_0x618c7f);}(_0x39de,0x8f));var _0xe39d=function(_0x3d9e94,_0x48136c){_0x3d9e94=_0x3d9e94-0x0;var _0x45f76e=_0x39de[_0x3d9e94];return _0x45f76e;};'use strict';var _=require(_0xe39d('0x0'));var util=require('util');var logger=require(_0xe39d('0x1'))(_0xe39d('0x2'));var moment=require(_0xe39d('0x3'));var BPromise=require(_0xe39d('0x4'));var rp=require(_0xe39d('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xe39d('0x6'));var config=require(_0xe39d('0x7'));var attributes=require('./chatQueue.attributes');module[_0xe39d('0x8')]=function(_0x592a65,_0x5ca63e){return _0x592a65[_0xe39d('0x9')](_0xe39d('0xa'),attributes,{'tableName':_0xe39d('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.rpc.js b/server/api/chatQueue/chatQueue.rpc.js
index a6286df..2635e9d 100644
--- a/server/api/chatQueue/chatQueue.rpc.js
+++ b/server/api/chatQueue/chatQueue.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x2fc9=['register','request','then','request\x20sent','debug','stringify','error','code','ChatQueue,\x20%s,\x20%s','message','info','result','catch','GetChatQueue','ChatQueue','findAll','options','raw','where','limit','include','map','model','attributes','ShowChatQueue','find','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','defaults','redis','localhost','socket.io-emitter','./chatQueue.socket'];(function(_0x5253cc,_0x4a6bda){var _0xbb5fc3=function(_0x5c141c){while(--_0x5c141c){_0x5253cc['push'](_0x5253cc['shift']());}};_0xbb5fc3(++_0x4a6bda);}(_0x2fc9,0xc2));var _0x92fc=function(_0x5ed54b,_0x3a2827){_0x5ed54b=_0x5ed54b-0x0;var _0x4b58c7=_0x2fc9[_0x5ed54b];return _0x4b58c7;};'use strict';var _=require('lodash');var util=require(_0x92fc('0x0'));var moment=require(_0x92fc('0x1'));var BPromise=require(_0x92fc('0x2'));var rs=require(_0x92fc('0x3'));var fs=require('fs');var Redis=require(_0x92fc('0x4'));var db=require(_0x92fc('0x5'))['db'];var utils=require(_0x92fc('0x6'));var logger=require(_0x92fc('0x7'))(_0x92fc('0x8'));var config=require(_0x92fc('0x9'));var jayson=require(_0x92fc('0xa'));var client=jayson['client']['http']({'port':0x232a});config['redis']=_[_0x92fc('0xb')](config[_0x92fc('0xc')],{'host':_0x92fc('0xd'),'port':0x18eb});var socket=require(_0x92fc('0xe'))(new Redis(config[_0x92fc('0xc')]));require(_0x92fc('0xf'))[_0x92fc('0x10')](socket);function respondWithRpcPromise(_0x59fa42,_0x4d8759,_0x34a751){return new BPromise(function(_0x32b1d9,_0x5ce1ed){return client[_0x92fc('0x11')](_0x59fa42,_0x34a751)[_0x92fc('0x12')](function(_0x36094a){logger['info']('ChatQueue,\x20%s,\x20%s',_0x4d8759,_0x92fc('0x13'));logger[_0x92fc('0x14')]('ChatQueue,\x20%s,\x20%s,\x20%s',_0x4d8759,_0x92fc('0x13'),JSON[_0x92fc('0x15')](_0x36094a));if(_0x36094a[_0x92fc('0x16')]){if(_0x36094a[_0x92fc('0x16')][_0x92fc('0x17')]===0x1f4){logger['error'](_0x92fc('0x18'),_0x4d8759,_0x36094a[_0x92fc('0x16')][_0x92fc('0x19')]);return _0x5ce1ed(_0x36094a[_0x92fc('0x16')]['message']);}logger['error'](_0x92fc('0x18'),_0x4d8759,_0x36094a[_0x92fc('0x16')]['message']);return _0x32b1d9(_0x36094a[_0x92fc('0x16')][_0x92fc('0x19')]);}else{logger[_0x92fc('0x1a')]('ChatQueue,\x20%s,\x20%s',_0x4d8759,_0x92fc('0x13'));_0x32b1d9(_0x36094a[_0x92fc('0x1b')][_0x92fc('0x19')]);}})[_0x92fc('0x1c')](function(_0x22d671){logger[_0x92fc('0x16')](_0x92fc('0x18'),_0x4d8759,_0x22d671);_0x5ce1ed(_0x22d671);});});}exports[_0x92fc('0x1d')]=function(_0x498adf){var _0x13802a=this;return new Promise(function(_0x4eaeff,_0x1e3bb1){return db[_0x92fc('0x1e')][_0x92fc('0x1f')]({'raw':_0x498adf[_0x92fc('0x20')]?_0x498adf[_0x92fc('0x20')][_0x92fc('0x21')]===undefined?!![]:![]:!![],'where':_0x498adf[_0x92fc('0x20')]?_0x498adf['options'][_0x92fc('0x22')]||null:null,'attributes':_0x498adf[_0x92fc('0x20')]?_0x498adf[_0x92fc('0x20')]['attributes']||null:null,'limit':_0x498adf[_0x92fc('0x20')]?_0x498adf[_0x92fc('0x20')][_0x92fc('0x23')]||null:null,'include':_0x498adf['options']?_0x498adf[_0x92fc('0x20')][_0x92fc('0x24')]?_[_0x92fc('0x25')](_0x498adf[_0x92fc('0x20')][_0x92fc('0x24')],function(_0x366bd4){return{'model':db[_0x366bd4[_0x92fc('0x26')]],'as':_0x366bd4['as'],'attributes':_0x366bd4[_0x92fc('0x27')],'include':_0x366bd4[_0x92fc('0x24')]?_[_0x92fc('0x25')](_0x366bd4[_0x92fc('0x24')],function(_0x1c0269){return{'model':db[_0x1c0269[_0x92fc('0x26')]],'as':_0x1c0269['as'],'attributes':_0x1c0269['attributes'],'include':_0x1c0269[_0x92fc('0x24')]?_[_0x92fc('0x25')](_0x1c0269[_0x92fc('0x24')],function(_0x391c71){return{'model':db[_0x391c71[_0x92fc('0x26')]],'as':_0x391c71['as'],'attributes':_0x391c71[_0x92fc('0x27')]};}):[]};}):[]};}):[]:[]})[_0x92fc('0x12')](function(_0x4ef34d){logger[_0x92fc('0x1a')](_0x92fc('0x1d'),_0x498adf);logger[_0x92fc('0x14')]('GetChatQueue',_0x498adf,JSON[_0x92fc('0x15')](_0x4ef34d));_0x4eaeff(_0x4ef34d);})[_0x92fc('0x1c')](function(_0x416dfe){logger[_0x92fc('0x16')](_0x92fc('0x1d'),_0x416dfe['message'],_0x498adf);_0x1e3bb1(_0x13802a[_0x92fc('0x16')](0x1f4,_0x416dfe[_0x92fc('0x19')]));});});};exports[_0x92fc('0x28')]=function(_0x58410f){var _0xb207e=this;return new Promise(function(_0x1840df,_0x31d5f9){return db[_0x92fc('0x1e')][_0x92fc('0x29')]({'raw':_0x58410f['options']?_0x58410f[_0x92fc('0x20')][_0x92fc('0x21')]===undefined?!![]:![]:!![],'where':_0x58410f[_0x92fc('0x20')]?_0x58410f[_0x92fc('0x20')]['where']||null:null,'attributes':_0x58410f[_0x92fc('0x20')]?_0x58410f['options']['attributes']||null:null,'include':_0x58410f[_0x92fc('0x20')]?_0x58410f[_0x92fc('0x20')][_0x92fc('0x24')]?_[_0x92fc('0x25')](_0x58410f[_0x92fc('0x20')]['include'],function(_0x471545){return{'model':db[_0x471545[_0x92fc('0x26')]],'as':_0x471545['as'],'attributes':_0x471545[_0x92fc('0x27')],'include':_0x471545[_0x92fc('0x24')]?_['map'](_0x471545[_0x92fc('0x24')],function(_0x1f62c6){return{'model':db[_0x1f62c6[_0x92fc('0x26')]],'as':_0x1f62c6['as'],'attributes':_0x1f62c6[_0x92fc('0x27')],'include':_0x1f62c6[_0x92fc('0x24')]?_[_0x92fc('0x25')](_0x1f62c6[_0x92fc('0x24')],function(_0x540e85){return{'model':db[_0x540e85['model']],'as':_0x540e85['as'],'attributes':_0x540e85['attributes']};}):[]};}):[]};}):[]:[]})[_0x92fc('0x12')](function(_0x6e2b42){logger[_0x92fc('0x1a')]('ShowChatQueue',_0x58410f);logger[_0x92fc('0x14')](_0x92fc('0x28'),_0x58410f,JSON[_0x92fc('0x15')](_0x6e2b42));_0x1840df(_0x6e2b42);})[_0x92fc('0x1c')](function(_0x543242){logger[_0x92fc('0x16')](_0x92fc('0x28'),_0x543242['message'],_0x58410f);_0x31d5f9(_0xb207e['error'](0x1f4,_0x543242['message']));});});};
\ No newline at end of file
+var _0xe24e=['ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetChatQueue','ChatQueue','findAll','options','raw','where','attributes','limit','include','map','model','ShowChatQueue','find','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','client','http','redis','defaults','socket.io-emitter','./chatQueue.socket','register','request','then','info'];(function(_0x1d558c,_0x1e497c){var _0x15767d=function(_0x26326d){while(--_0x26326d){_0x1d558c['push'](_0x1d558c['shift']());}};_0x15767d(++_0x1e497c);}(_0xe24e,0x15f));var _0xee24=function(_0x4aa4e6,_0x278c45){_0x4aa4e6=_0x4aa4e6-0x0;var _0x322588=_0xe24e[_0x4aa4e6];return _0x322588;};'use strict';var _=require(_0xee24('0x0'));var util=require(_0xee24('0x1'));var moment=require(_0xee24('0x2'));var BPromise=require(_0xee24('0x3'));var rs=require(_0xee24('0x4'));var fs=require('fs');var Redis=require(_0xee24('0x5'));var db=require(_0xee24('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xee24('0x7'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xee24('0x8')][_0xee24('0x9')]({'port':0x232a});config[_0xee24('0xa')]=_[_0xee24('0xb')](config[_0xee24('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0xee24('0xc'))(new Redis(config[_0xee24('0xa')]));require(_0xee24('0xd'))[_0xee24('0xe')](socket);function respondWithRpcPromise(_0x346647,_0x1cb7d6,_0x3a928d){return new BPromise(function(_0x2fa6e1,_0x47f87f){return client[_0xee24('0xf')](_0x346647,_0x3a928d)[_0xee24('0x10')](function(_0x1f9199){logger[_0xee24('0x11')](_0xee24('0x12'),_0x1cb7d6,_0xee24('0x13'));logger[_0xee24('0x14')](_0xee24('0x15'),_0x1cb7d6,'request\x20sent',JSON[_0xee24('0x16')](_0x1f9199));if(_0x1f9199[_0xee24('0x17')]){if(_0x1f9199[_0xee24('0x17')][_0xee24('0x18')]===0x1f4){logger[_0xee24('0x17')](_0xee24('0x12'),_0x1cb7d6,_0x1f9199[_0xee24('0x17')][_0xee24('0x19')]);return _0x47f87f(_0x1f9199[_0xee24('0x17')][_0xee24('0x19')]);}logger[_0xee24('0x17')](_0xee24('0x12'),_0x1cb7d6,_0x1f9199[_0xee24('0x17')][_0xee24('0x19')]);return _0x2fa6e1(_0x1f9199[_0xee24('0x17')]['message']);}else{logger['info'](_0xee24('0x12'),_0x1cb7d6,_0xee24('0x13'));_0x2fa6e1(_0x1f9199[_0xee24('0x1a')][_0xee24('0x19')]);}})[_0xee24('0x1b')](function(_0x27a0cf){logger[_0xee24('0x17')](_0xee24('0x12'),_0x1cb7d6,_0x27a0cf);_0x47f87f(_0x27a0cf);});});}exports[_0xee24('0x1c')]=function(_0xff741b){var _0x2ef7f0=this;return new Promise(function(_0xffa04d,_0x3ec49f){return db[_0xee24('0x1d')][_0xee24('0x1e')]({'raw':_0xff741b[_0xee24('0x1f')]?_0xff741b[_0xee24('0x1f')][_0xee24('0x20')]===undefined?!![]:![]:!![],'where':_0xff741b[_0xee24('0x1f')]?_0xff741b[_0xee24('0x1f')][_0xee24('0x21')]||null:null,'attributes':_0xff741b[_0xee24('0x1f')]?_0xff741b[_0xee24('0x1f')][_0xee24('0x22')]||null:null,'limit':_0xff741b[_0xee24('0x1f')]?_0xff741b[_0xee24('0x1f')][_0xee24('0x23')]||null:null,'include':_0xff741b[_0xee24('0x1f')]?_0xff741b[_0xee24('0x1f')][_0xee24('0x24')]?_[_0xee24('0x25')](_0xff741b[_0xee24('0x1f')][_0xee24('0x24')],function(_0x15c02f){return{'model':db[_0x15c02f[_0xee24('0x26')]],'as':_0x15c02f['as'],'attributes':_0x15c02f[_0xee24('0x22')],'include':_0x15c02f[_0xee24('0x24')]?_[_0xee24('0x25')](_0x15c02f[_0xee24('0x24')],function(_0x5617b6){return{'model':db[_0x5617b6[_0xee24('0x26')]],'as':_0x5617b6['as'],'attributes':_0x5617b6[_0xee24('0x22')],'include':_0x5617b6[_0xee24('0x24')]?_[_0xee24('0x25')](_0x5617b6[_0xee24('0x24')],function(_0x3d4964){return{'model':db[_0x3d4964[_0xee24('0x26')]],'as':_0x3d4964['as'],'attributes':_0x3d4964[_0xee24('0x22')]};}):[]};}):[]};}):[]:[]})[_0xee24('0x10')](function(_0x5d468d){logger[_0xee24('0x11')](_0xee24('0x1c'),_0xff741b);logger[_0xee24('0x14')]('GetChatQueue',_0xff741b,JSON[_0xee24('0x16')](_0x5d468d));_0xffa04d(_0x5d468d);})['catch'](function(_0x4ede3c){logger[_0xee24('0x17')](_0xee24('0x1c'),_0x4ede3c[_0xee24('0x19')],_0xff741b);_0x3ec49f(_0x2ef7f0[_0xee24('0x17')](0x1f4,_0x4ede3c[_0xee24('0x19')]));});});};exports[_0xee24('0x27')]=function(_0x41249d){var _0x328a05=this;return new Promise(function(_0x2266ab,_0x17a5ac){return db['ChatQueue'][_0xee24('0x28')]({'raw':_0x41249d[_0xee24('0x1f')]?_0x41249d[_0xee24('0x1f')]['raw']===undefined?!![]:![]:!![],'where':_0x41249d[_0xee24('0x1f')]?_0x41249d[_0xee24('0x1f')]['where']||null:null,'attributes':_0x41249d[_0xee24('0x1f')]?_0x41249d[_0xee24('0x1f')]['attributes']||null:null,'include':_0x41249d[_0xee24('0x1f')]?_0x41249d['options'][_0xee24('0x24')]?_['map'](_0x41249d[_0xee24('0x1f')][_0xee24('0x24')],function(_0x790b44){return{'model':db[_0x790b44[_0xee24('0x26')]],'as':_0x790b44['as'],'attributes':_0x790b44[_0xee24('0x22')],'include':_0x790b44[_0xee24('0x24')]?_['map'](_0x790b44[_0xee24('0x24')],function(_0x32e2f0){return{'model':db[_0x32e2f0[_0xee24('0x26')]],'as':_0x32e2f0['as'],'attributes':_0x32e2f0['attributes'],'include':_0x32e2f0['include']?_[_0xee24('0x25')](_0x32e2f0['include'],function(_0x56de2e){return{'model':db[_0x56de2e['model']],'as':_0x56de2e['as'],'attributes':_0x56de2e['attributes']};}):[]};}):[]};}):[]:[]})[_0xee24('0x10')](function(_0x1cd632){logger[_0xee24('0x11')]('ShowChatQueue',_0x41249d);logger[_0xee24('0x14')](_0xee24('0x27'),_0x41249d,JSON[_0xee24('0x16')](_0x1cd632));_0x2266ab(_0x1cd632);})['catch'](function(_0x2b749f){logger[_0xee24('0x17')]('ShowChatQueue',_0x2b749f[_0xee24('0x19')],_0x41249d);_0x17a5ac(_0x328a05[_0xee24('0x17')](0x1f4,_0x2b749f[_0xee24('0x19')]));});});};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.socket.js b/server/api/chatQueue/chatQueue.socket.js
index 52eca11..67ce266 100644
--- a/server/api/chatQueue/chatQueue.socket.js
+++ b/server/api/chatQueue/chatQueue.socket.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x5f2f=['remove','update','emit','removeListener','register','length','chatQueue:','./chatQueue.events','save'];(function(_0x32eb8b,_0x5ac0b5){var _0x5bc68b=function(_0x259158){while(--_0x259158){_0x32eb8b['push'](_0x32eb8b['shift']());}};_0x5bc68b(++_0x5ac0b5);}(_0x5f2f,0x73));var _0xf5f2=function(_0x18bf9a,_0x18b92c){_0x18bf9a=_0x18bf9a-0x0;var _0x18b7b8=_0x5f2f[_0x18bf9a];return _0x18b7b8;};'use strict';var ChatQueueEvents=require(_0xf5f2('0x0'));var events=[_0xf5f2('0x1'),_0xf5f2('0x2'),_0xf5f2('0x3')];function createListener(_0x1172dd,_0x174bc7){return function(_0x3c72ee){_0x174bc7[_0xf5f2('0x4')](_0x1172dd,_0x3c72ee);};}function removeListener(_0x501fbd,_0x4854b6){return function(){ChatQueueEvents[_0xf5f2('0x5')](_0x501fbd,_0x4854b6);};}exports[_0xf5f2('0x6')]=function(_0xad7f65){for(var _0x3eebf6=0x0,_0x3133bc=events[_0xf5f2('0x7')];_0x3eebf6<_0x3133bc;_0x3eebf6++){var _0x5907aa=events[_0x3eebf6];var _0x466882=createListener(_0xf5f2('0x8')+_0x5907aa,_0xad7f65);ChatQueueEvents['on'](_0x5907aa,_0x466882);}};
\ No newline at end of file
+var _0xadb5=['update','emit','register','length','chatQueue:','save'];(function(_0x54ef1e,_0x218d4a){var _0x19c745=function(_0x46fb24){while(--_0x46fb24){_0x54ef1e['push'](_0x54ef1e['shift']());}};_0x19c745(++_0x218d4a);}(_0xadb5,0xad));var _0x5adb=function(_0x437bec,_0x380b66){_0x437bec=_0x437bec-0x0;var _0x87ff34=_0xadb5[_0x437bec];return _0x87ff34;};'use strict';var ChatQueueEvents=require('./chatQueue.events');var events=[_0x5adb('0x0'),'remove',_0x5adb('0x1')];function createListener(_0x38f67f,_0x3129c3){return function(_0x4aecec){_0x3129c3[_0x5adb('0x2')](_0x38f67f,_0x4aecec);};}function removeListener(_0x31457,_0x2e3ef4){return function(){ChatQueueEvents['removeListener'](_0x31457,_0x2e3ef4);};}exports[_0x5adb('0x3')]=function(_0x168d89){for(var _0x3e2555=0x0,_0x3213e8=events[_0x5adb('0x4')];_0x3e2555<_0x3213e8;_0x3e2555++){var _0x353885=events[_0x3e2555];var _0x47228a=createListener(_0x5adb('0x5')+_0x353885,_0x168d89);ChatQueueEvents['on'](_0x353885,_0x47228a);}};
\ No newline at end of file
diff --git a/server/api/chatQueue/index.js b/server/api/chatQueue/index.js
index 8386bca..5ae6bea 100644
--- a/server/api/chatQueue/index.js
+++ b/server/api/chatQueue/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xa2dd=['getMembers','getTeams','/:id/users','post','addTeams','addAgents','put','update','delete','destroy','/:id/teams','removeTeams','removeAgents','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./chatQueue.controller','get','isAuthenticated','/describe','describe','/:id','show','/:id/members'];(function(_0x3ba924,_0x3b99f0){var _0x4cc1df=function(_0x15bf28){while(--_0x15bf28){_0x3ba924['push'](_0x3ba924['shift']());}};_0x4cc1df(++_0x3b99f0);}(_0xa2dd,0xd9));var _0xda2d=function(_0x34992e,_0x363391){_0x34992e=_0x34992e-0x0;var _0xb35d1d=_0xa2dd[_0x34992e];return _0xb35d1d;};'use strict';var multer=require(_0xda2d('0x0'));var util=require(_0xda2d('0x1'));var path=require('path');var timeout=require(_0xda2d('0x2'));var express=require(_0xda2d('0x3'));var router=express[_0xda2d('0x4')]();var auth=require(_0xda2d('0x5'));var interaction=require(_0xda2d('0x6'));var config=require('../../config/environment');var controller=require(_0xda2d('0x7'));router[_0xda2d('0x8')]('/',auth[_0xda2d('0x9')](),controller['index']);router[_0xda2d('0x8')](_0xda2d('0xa'),auth[_0xda2d('0x9')](),controller[_0xda2d('0xb')]);router['get'](_0xda2d('0xc'),auth[_0xda2d('0x9')](),controller[_0xda2d('0xd')]);router['get'](_0xda2d('0xe'),auth[_0xda2d('0x9')](),controller[_0xda2d('0xf')]);router[_0xda2d('0x8')]('/:id/teams',auth[_0xda2d('0x9')](),controller[_0xda2d('0x10')]);router[_0xda2d('0x8')](_0xda2d('0x11'),auth['isAuthenticated'](),controller['getAgents']);router['post']('/',auth[_0xda2d('0x9')](),controller['create']);router[_0xda2d('0x12')]('/:id/teams',auth[_0xda2d('0x9')](),controller[_0xda2d('0x13')]);router[_0xda2d('0x12')](_0xda2d('0x11'),auth['isAuthenticated'](),controller[_0xda2d('0x14')]);router[_0xda2d('0x15')](_0xda2d('0xc'),auth[_0xda2d('0x9')](),controller[_0xda2d('0x16')]);router[_0xda2d('0x17')](_0xda2d('0xc'),auth[_0xda2d('0x9')](),controller[_0xda2d('0x18')]);router[_0xda2d('0x17')](_0xda2d('0x19'),auth['isAuthenticated'](),controller[_0xda2d('0x1a')]);router[_0xda2d('0x17')]('/:id/users',auth[_0xda2d('0x9')](),controller[_0xda2d('0x1b')]);module[_0xda2d('0x1c')]=router;
\ No newline at end of file
+var _0x6c51=['multer','path','express','Router','../../components/auth/service','./chatQueue.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/members','getMembers','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','delete','/:id/teams','removeTeams','removeAgents','exports'];(function(_0x2beba9,_0x304957){var _0xfb6f7e=function(_0x331689){while(--_0x331689){_0x2beba9['push'](_0x2beba9['shift']());}};_0xfb6f7e(++_0x304957);}(_0x6c51,0xa2));var _0x16c5=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x6c51[_0xa464c9];return _0x3d73c4;};'use strict';var multer=require(_0x16c5('0x0'));var util=require('util');var path=require(_0x16c5('0x1'));var timeout=require('connect-timeout');var express=require(_0x16c5('0x2'));var router=express[_0x16c5('0x3')]();var auth=require(_0x16c5('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x16c5('0x5'));router[_0x16c5('0x6')]('/',auth[_0x16c5('0x7')](),controller[_0x16c5('0x8')]);router['get'](_0x16c5('0x9'),auth[_0x16c5('0x7')](),controller[_0x16c5('0xa')]);router[_0x16c5('0x6')](_0x16c5('0xb'),auth[_0x16c5('0x7')](),controller[_0x16c5('0xc')]);router[_0x16c5('0x6')](_0x16c5('0xd'),auth[_0x16c5('0x7')](),controller[_0x16c5('0xe')]);router[_0x16c5('0x6')]('/:id/teams',auth[_0x16c5('0x7')](),controller[_0x16c5('0xf')]);router[_0x16c5('0x6')](_0x16c5('0x10'),auth['isAuthenticated'](),controller[_0x16c5('0x11')]);router[_0x16c5('0x12')]('/',auth['isAuthenticated'](),controller[_0x16c5('0x13')]);router[_0x16c5('0x12')]('/:id/teams',auth[_0x16c5('0x7')](),controller[_0x16c5('0x14')]);router[_0x16c5('0x12')]('/:id/users',auth[_0x16c5('0x7')](),controller[_0x16c5('0x15')]);router['put']('/:id',auth[_0x16c5('0x7')](),controller['update']);router[_0x16c5('0x16')](_0x16c5('0xb'),auth['isAuthenticated'](),controller['destroy']);router[_0x16c5('0x16')](_0x16c5('0x17'),auth['isAuthenticated'](),controller[_0x16c5('0x18')]);router[_0x16c5('0x16')](_0x16c5('0x10'),auth[_0x16c5('0x7')](),controller[_0x16c5('0x19')]);module[_0x16c5('0x1a')]=router;
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.attributes.js b/server/api/chatQueueReport/chatQueueReport.attributes.js
index 403dc07..5b8e56b 100644
--- a/server/api/chatQueueReport/chatQueueReport.attributes.js
+++ b/server/api/chatQueueReport/chatQueueReport.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xe0fe=['STRING','DATE','sequelize','exports'];(function(_0x1cb557,_0x2915a2){var _0x208628=function(_0x230386){while(--_0x230386){_0x1cb557['push'](_0x1cb557['shift']());}};_0x208628(++_0x2915a2);}(_0xe0fe,0x11e));var _0xee0f=function(_0x5c544c,_0x556ad7){_0x5c544c=_0x5c544c-0x0;var _0x1ceebd=_0xe0fe[_0x5c544c];return _0x1ceebd;};'use strict';var moment=require('moment');var Sequelize=require(_0xee0f('0x0'));module[_0xee0f('0x1')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0xee0f('0x2')]},'joinAt':{'type':Sequelize[_0xee0f('0x3')]},'leaveAt':{'type':Sequelize[_0xee0f('0x3')]},'acceptAt':{'type':Sequelize[_0xee0f('0x3')]},'exitAt':{'type':Sequelize[_0xee0f('0x3')]},'reason':{'type':Sequelize[_0xee0f('0x2')]}};
\ No newline at end of file
+var _0x893b=['STRING','DATE','moment','sequelize','exports'];(function(_0x4077ef,_0x584c5d){var _0x4b1852=function(_0x1ca351){while(--_0x1ca351){_0x4077ef['push'](_0x4077ef['shift']());}};_0x4b1852(++_0x584c5d);}(_0x893b,0x16f));var _0xb893=function(_0x41f134,_0x216ee6){_0x41f134=_0x41f134-0x0;var _0x22e54c=_0x893b[_0x41f134];return _0x22e54c;};'use strict';var moment=require(_0xb893('0x0'));var Sequelize=require(_0xb893('0x1'));module[_0xb893('0x2')]={'uniqueid':{'type':Sequelize[_0xb893('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0xb893('0x3')]},'joinAt':{'type':Sequelize[_0xb893('0x4')]},'leaveAt':{'type':Sequelize[_0xb893('0x4')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0xb893('0x4')]},'reason':{'type':Sequelize[_0xb893('0x3')]}};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.controller.js b/server/api/chatQueueReport/chatQueueReport.controller.js
index 2924fcd..2c65d01 100644
--- a/server/api/chatQueueReport/chatQueueReport.controller.js
+++ b/server/api/chatQueueReport/chatQueueReport.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xb7e7=['desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','end','name','send','index','ChatQueueReport','rawAttributes','fieldName','key','model','map','query','keys','filters','intersection','fields','attributes','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','include','findAll','rows','catch','show','params','length','find','create','body','describe','html-pdf','rimraf','fast-json-patch','moment','mustache','util','path','ejs','lodash','squel','jsforce'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0xb7e7,0x121));var _0x7b7e=function(_0x39096d,_0x51f8a0){_0x39096d=_0x39096d-0x0;var _0x13da4f=_0xb7e7[_0x39096d];return _0x13da4f;};'use strict';var pdf=require(_0x7b7e('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x7b7e('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x7b7e('0x2'));var rp=require('request-promise');var moment=require(_0x7b7e('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x7b7e('0x4'));var util=require(_0x7b7e('0x5'));var path=require(_0x7b7e('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x7b7e('0x7'));var fs=require('fs');var _=require(_0x7b7e('0x8'));var squel=require(_0x7b7e('0x9'));var crypto=require('crypto');var jsforce=require(_0x7b7e('0xa'));var deskjs=require(_0x7b7e('0xb'));var toCsv=require(_0x7b7e('0xc'));var querystring=require(_0x7b7e('0xd'));var Papa=require(_0x7b7e('0xe'));var Redis=require(_0x7b7e('0xf'));var authService=require(_0x7b7e('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x7b7e('0x11'));var hardwareService=require(_0x7b7e('0x12'));var logger=require(_0x7b7e('0x13'))(_0x7b7e('0x14'));var utils=require(_0x7b7e('0x15'));var config=require(_0x7b7e('0x16'));var db=require(_0x7b7e('0x17'))['db'];function respondWithStatusCode(_0x55620b,_0xaadda){_0xaadda=_0xaadda||0xcc;return function(_0x54d8ce){if(_0x54d8ce){return _0x55620b[_0x7b7e('0x18')](_0xaadda);}return _0x55620b[_0x7b7e('0x19')](_0xaadda)['end']();};}function respondWithResult(_0x422d3a,_0x5976ac){_0x5976ac=_0x5976ac||0xc8;return function(_0x4c6011){if(_0x4c6011){return _0x422d3a[_0x7b7e('0x19')](_0x5976ac)[_0x7b7e('0x1a')](_0x4c6011);}};}function respondWithFilteredResult(_0xf067da,_0x457ec5){return function(_0x3d2fb2){if(_0x3d2fb2){var _0x5703fd=_0x3d2fb2[_0x7b7e('0x1b')],_0x51baf6=_0x457ec5[_0x7b7e('0x1c')],_0xc7f087=_0x457ec5[_0x7b7e('0x1c')]+_0x457ec5[_0x7b7e('0x1d')],_0x36444d;if(_0xc7f087>=_0x5703fd){_0xc7f087=_0x5703fd;_0x36444d=0xc8;}else{_0x36444d=0xce;}_0xf067da[_0x7b7e('0x19')](_0x36444d);return _0xf067da[_0x7b7e('0x1e')](_0x7b7e('0x1f'),_0x51baf6+'-'+_0xc7f087+'/'+_0x5703fd)[_0x7b7e('0x1a')](_0x3d2fb2);}return null;};}function patchUpdates(_0x12e8e9){return function(_0x14f4fe){try{jsonpatch[_0x7b7e('0x20')](_0x14f4fe,_0x12e8e9,!![]);}catch(_0x3bec7d){return BPromise[_0x7b7e('0x21')](_0x3bec7d);}return _0x14f4fe[_0x7b7e('0x22')]();};}function saveUpdates(_0x3a7b8b,_0x49eddb){return function(_0x69262b){if(_0x69262b){return _0x69262b[_0x7b7e('0x23')](_0x3a7b8b)[_0x7b7e('0x24')](function(_0x4c0647){return _0x4c0647;});}return null;};}function removeEntity(_0x313122,_0xbf0cb3){return function(_0x14243b){if(_0x14243b){return _0x14243b[_0x7b7e('0x25')]()[_0x7b7e('0x24')](function(){_0x313122[_0x7b7e('0x19')](0xcc)[_0x7b7e('0x26')]();});}};}function handleEntityNotFound(_0x10a66a,_0x53bbb3){return function(_0x5d6215){if(!_0x5d6215){_0x10a66a['sendStatus'](0x194);}return _0x5d6215;};}function handleError(_0x26ee14,_0x22598e){_0x22598e=_0x22598e||0x1f4;return function(_0x23bfa3){logger['error'](_0x23bfa3['stack']);if(_0x23bfa3['name']){delete _0x23bfa3[_0x7b7e('0x27')];}_0x26ee14[_0x7b7e('0x19')](_0x22598e)[_0x7b7e('0x28')](_0x23bfa3);};}exports[_0x7b7e('0x29')]=function(_0x3ceaf5,_0x48fad1){var _0x6a1e71={},_0x21a15={},_0x4c46b8={'count':0x0,'rows':[]};var _0x57b9da=_['map'](db[_0x7b7e('0x2a')][_0x7b7e('0x2b')],function(_0x503625){return{'name':_0x503625[_0x7b7e('0x2c')],'type':_0x503625['type'][_0x7b7e('0x2d')]};});_0x21a15[_0x7b7e('0x2e')]=_[_0x7b7e('0x2f')](_0x57b9da,'name');_0x21a15[_0x7b7e('0x30')]=_[_0x7b7e('0x31')](_0x3ceaf5[_0x7b7e('0x30')]);_0x21a15[_0x7b7e('0x32')]=_[_0x7b7e('0x33')](_0x21a15['model'],_0x21a15[_0x7b7e('0x30')]);_0x6a1e71['attributes']=_[_0x7b7e('0x33')](_0x21a15[_0x7b7e('0x2e')],qs[_0x7b7e('0x34')](_0x3ceaf5[_0x7b7e('0x30')][_0x7b7e('0x34')]));_0x6a1e71[_0x7b7e('0x35')]=_0x6a1e71[_0x7b7e('0x35')]['length']?_0x6a1e71['attributes']:_0x21a15[_0x7b7e('0x2e')];if(!_0x3ceaf5[_0x7b7e('0x30')]['hasOwnProperty'](_0x7b7e('0x36'))){_0x6a1e71[_0x7b7e('0x1d')]=qs[_0x7b7e('0x1d')](_0x3ceaf5['query'][_0x7b7e('0x1d')]);_0x6a1e71[_0x7b7e('0x1c')]=qs[_0x7b7e('0x1c')](_0x3ceaf5[_0x7b7e('0x30')][_0x7b7e('0x1c')]);}_0x6a1e71[_0x7b7e('0x37')]=qs[_0x7b7e('0x38')](_0x3ceaf5[_0x7b7e('0x30')][_0x7b7e('0x38')]);_0x6a1e71[_0x7b7e('0x39')]=qs[_0x7b7e('0x32')](_[_0x7b7e('0x3a')](_0x3ceaf5[_0x7b7e('0x30')],_0x21a15[_0x7b7e('0x32')]),_0x57b9da);if(_0x3ceaf5[_0x7b7e('0x30')][_0x7b7e('0x3b')]){_0x6a1e71['where']=_[_0x7b7e('0x3c')](_0x6a1e71[_0x7b7e('0x39')],{'$or':_[_0x7b7e('0x2f')](_0x57b9da,function(_0x242609){if(_0x242609[_0x7b7e('0x3d')]!==_0x7b7e('0x3e')){var _0x7f15={};_0x7f15[_0x242609[_0x7b7e('0x27')]]={'$like':'%'+_0x3ceaf5[_0x7b7e('0x30')][_0x7b7e('0x3b')]+'%'};return _0x7f15;}})});}_0x6a1e71=_['merge']({},_0x6a1e71,_0x3ceaf5[_0x7b7e('0x3f')]);var _0x1fa75b={'where':_0x6a1e71[_0x7b7e('0x39')]};return db[_0x7b7e('0x2a')]['count'](_0x1fa75b)[_0x7b7e('0x24')](function(_0x35b31a){_0x4c46b8[_0x7b7e('0x1b')]=_0x35b31a;if(_0x3ceaf5['query']['includeAll']){_0x6a1e71[_0x7b7e('0x40')]=[{'all':!![]}];}return db['ChatQueueReport'][_0x7b7e('0x41')](_0x6a1e71);})[_0x7b7e('0x24')](function(_0x4de331){_0x4c46b8[_0x7b7e('0x42')]=_0x4de331;return _0x4c46b8;})[_0x7b7e('0x24')](respondWithFilteredResult(_0x48fad1,_0x6a1e71))[_0x7b7e('0x43')](handleError(_0x48fad1,null));};exports[_0x7b7e('0x44')]=function(_0x38d32f,_0x435de5){var _0xc888e4={'raw':!![],'where':{'id':_0x38d32f[_0x7b7e('0x45')]['id']}},_0x1d9bb9={};_0x1d9bb9['model']=_['keys'](db[_0x7b7e('0x2a')]['rawAttributes']);_0x1d9bb9[_0x7b7e('0x30')]=_['keys'](_0x38d32f['query']);_0x1d9bb9[_0x7b7e('0x32')]=_['intersection'](_0x1d9bb9[_0x7b7e('0x2e')],_0x1d9bb9['query']);_0xc888e4[_0x7b7e('0x35')]=_[_0x7b7e('0x33')](_0x1d9bb9[_0x7b7e('0x2e')],qs[_0x7b7e('0x34')](_0x38d32f['query'][_0x7b7e('0x34')]));_0xc888e4[_0x7b7e('0x35')]=_0xc888e4[_0x7b7e('0x35')][_0x7b7e('0x46')]?_0xc888e4[_0x7b7e('0x35')]:_0x1d9bb9[_0x7b7e('0x2e')];if(_0x38d32f['query']['includeAll']){_0xc888e4['include']=[{'all':!![]}];}_0xc888e4=_[_0x7b7e('0x3c')]({},_0xc888e4,_0x38d32f[_0x7b7e('0x3f')]);return db[_0x7b7e('0x2a')][_0x7b7e('0x47')](_0xc888e4)[_0x7b7e('0x24')](handleEntityNotFound(_0x435de5,null))[_0x7b7e('0x24')](respondWithResult(_0x435de5,null))['catch'](handleError(_0x435de5,null));};exports[_0x7b7e('0x48')]=function(_0x42e560,_0x5a0832){return db['ChatQueueReport'][_0x7b7e('0x48')](_0x42e560[_0x7b7e('0x49')],{})[_0x7b7e('0x24')](respondWithResult(_0x5a0832,0xc9))[_0x7b7e('0x43')](handleError(_0x5a0832,null));};exports[_0x7b7e('0x23')]=function(_0xb46776,_0x590154){if(_0xb46776[_0x7b7e('0x49')]['id']){delete _0xb46776['body']['id'];}return db[_0x7b7e('0x2a')][_0x7b7e('0x47')]({'where':{'id':_0xb46776[_0x7b7e('0x45')]['id']}})[_0x7b7e('0x24')](handleEntityNotFound(_0x590154,null))['then'](saveUpdates(_0xb46776[_0x7b7e('0x49')],null))[_0x7b7e('0x24')](respondWithResult(_0x590154,null))[_0x7b7e('0x43')](handleError(_0x590154,null));};exports[_0x7b7e('0x25')]=function(_0x1f9d0f,_0x5cce7c){return db[_0x7b7e('0x2a')][_0x7b7e('0x47')]({'where':{'id':_0x1f9d0f[_0x7b7e('0x45')]['id']}})[_0x7b7e('0x24')](handleEntityNotFound(_0x5cce7c,null))[_0x7b7e('0x24')](removeEntity(_0x5cce7c,null))['catch'](handleError(_0x5cce7c,null));};exports[_0x7b7e('0x4a')]=function(_0x29024e,_0x46d4ee){return db[_0x7b7e('0x2a')][_0x7b7e('0x4a')]()[_0x7b7e('0x24')](respondWithResult(_0x46d4ee,null))[_0x7b7e('0x43')](handleError(_0x46d4ee,null));};
\ No newline at end of file
+var _0x757a=['count','findAll','rows','catch','params','keys','includeAll','include','create','body','find','describe','eml-format','rimraf','moment','bluebird','mustache','util','path','sox','ejs','lodash','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','end','status','json','offset','limit','Content-Range','apply','save','update','then','destroy','stack','name','send','index','rawAttributes','fieldName','type','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','map','VIRTUAL','options','ChatQueueReport'];(function(_0x5447fd,_0x52a6b5){var _0x15b28a=function(_0x370d4f){while(--_0x370d4f){_0x5447fd['push'](_0x5447fd['shift']());}};_0x15b28a(++_0x52a6b5);}(_0x757a,0xde));var _0xa757=function(_0x189480,_0x45b6b5){_0x189480=_0x189480-0x0;var _0x2922e6=_0x757a[_0x189480];return _0x2922e6;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xa757('0x0'));var rimraf=require(_0xa757('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xa757('0x2'));var BPromise=require(_0xa757('0x3'));var Mustache=require(_0xa757('0x4'));var util=require(_0xa757('0x5'));var path=require(_0xa757('0x6'));var sox=require(_0xa757('0x7'));var csv=require('to-csv');var ejs=require(_0xa757('0x8'));var fs=require('fs');var _=require(_0xa757('0x9'));var squel=require('squel');var crypto=require(_0xa757('0xa'));var jsforce=require(_0xa757('0xb'));var deskjs=require(_0xa757('0xc'));var toCsv=require(_0xa757('0xd'));var querystring=require(_0xa757('0xe'));var Papa=require('papaparse');var Redis=require(_0xa757('0xf'));var authService=require(_0xa757('0x10'));var qs=require(_0xa757('0x11'));var as=require(_0xa757('0x12'));var hardwareService=require(_0xa757('0x13'));var logger=require(_0xa757('0x14'))(_0xa757('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x56acfb,_0x4db68e){_0x4db68e=_0x4db68e||0xcc;return function(_0x421040){if(_0x421040){return _0x56acfb['sendStatus'](_0x4db68e);}return _0x56acfb['status'](_0x4db68e)[_0xa757('0x16')]();};}function respondWithResult(_0x513b1f,_0x481508){_0x481508=_0x481508||0xc8;return function(_0x32112b){if(_0x32112b){return _0x513b1f[_0xa757('0x17')](_0x481508)[_0xa757('0x18')](_0x32112b);}};}function respondWithFilteredResult(_0x4a0c38,_0x86abd){return function(_0x31cfd2){if(_0x31cfd2){var _0xf12b68=_0x31cfd2['count'],_0x2f7947=_0x86abd[_0xa757('0x19')],_0x185011=_0x86abd[_0xa757('0x19')]+_0x86abd[_0xa757('0x1a')],_0x3df1f9;if(_0x185011>=_0xf12b68){_0x185011=_0xf12b68;_0x3df1f9=0xc8;}else{_0x3df1f9=0xce;}_0x4a0c38['status'](_0x3df1f9);return _0x4a0c38['set'](_0xa757('0x1b'),_0x2f7947+'-'+_0x185011+'/'+_0xf12b68)[_0xa757('0x18')](_0x31cfd2);}return null;};}function patchUpdates(_0x1bd14c){return function(_0x340599){try{jsonpatch[_0xa757('0x1c')](_0x340599,_0x1bd14c,!![]);}catch(_0xe2d567){return BPromise['reject'](_0xe2d567);}return _0x340599[_0xa757('0x1d')]();};}function saveUpdates(_0x4fec52,_0x32c2a1){return function(_0x167640){if(_0x167640){return _0x167640[_0xa757('0x1e')](_0x4fec52)[_0xa757('0x1f')](function(_0x4d598c){return _0x4d598c;});}return null;};}function removeEntity(_0x5638c7,_0x40ec48){return function(_0x2159cf){if(_0x2159cf){return _0x2159cf[_0xa757('0x20')]()[_0xa757('0x1f')](function(){_0x5638c7[_0xa757('0x17')](0xcc)[_0xa757('0x16')]();});}};}function handleEntityNotFound(_0x2ca10d,_0x21f1af){return function(_0x2bf276){if(!_0x2bf276){_0x2ca10d['sendStatus'](0x194);}return _0x2bf276;};}function handleError(_0x3707c1,_0x59e9d4){_0x59e9d4=_0x59e9d4||0x1f4;return function(_0x422e9e){logger['error'](_0x422e9e[_0xa757('0x21')]);if(_0x422e9e[_0xa757('0x22')]){delete _0x422e9e[_0xa757('0x22')];}_0x3707c1['status'](_0x59e9d4)[_0xa757('0x23')](_0x422e9e);};}exports[_0xa757('0x24')]=function(_0x471e84,_0x3bf7f3){var _0x5b4779={},_0x449a7d={},_0x54263b={'count':0x0,'rows':[]};var _0x5a5664=_['map'](db['ChatQueueReport'][_0xa757('0x25')],function(_0x596ae2){return{'name':_0x596ae2[_0xa757('0x26')],'type':_0x596ae2[_0xa757('0x27')]['key']};});_0x449a7d[_0xa757('0x28')]=_['map'](_0x5a5664,_0xa757('0x22'));_0x449a7d[_0xa757('0x29')]=_['keys'](_0x471e84[_0xa757('0x29')]);_0x449a7d['filters']=_[_0xa757('0x2a')](_0x449a7d[_0xa757('0x28')],_0x449a7d[_0xa757('0x29')]);_0x5b4779[_0xa757('0x2b')]=_[_0xa757('0x2a')](_0x449a7d[_0xa757('0x28')],qs[_0xa757('0x2c')](_0x471e84[_0xa757('0x29')][_0xa757('0x2c')]));_0x5b4779[_0xa757('0x2b')]=_0x5b4779[_0xa757('0x2b')][_0xa757('0x2d')]?_0x5b4779[_0xa757('0x2b')]:_0x449a7d[_0xa757('0x28')];if(!_0x471e84[_0xa757('0x29')][_0xa757('0x2e')](_0xa757('0x2f'))){_0x5b4779[_0xa757('0x1a')]=qs[_0xa757('0x1a')](_0x471e84[_0xa757('0x29')][_0xa757('0x1a')]);_0x5b4779[_0xa757('0x19')]=qs[_0xa757('0x19')](_0x471e84[_0xa757('0x29')]['offset']);}_0x5b4779[_0xa757('0x30')]=qs[_0xa757('0x31')](_0x471e84[_0xa757('0x29')][_0xa757('0x31')]);_0x5b4779[_0xa757('0x32')]=qs['filters'](_[_0xa757('0x33')](_0x471e84[_0xa757('0x29')],_0x449a7d[_0xa757('0x34')]),_0x5a5664);if(_0x471e84[_0xa757('0x29')][_0xa757('0x35')]){_0x5b4779[_0xa757('0x32')]=_['merge'](_0x5b4779[_0xa757('0x32')],{'$or':_[_0xa757('0x36')](_0x5a5664,function(_0x2cade7){if(_0x2cade7[_0xa757('0x27')]!==_0xa757('0x37')){var _0x111cfe={};_0x111cfe[_0x2cade7[_0xa757('0x22')]]={'$like':'%'+_0x471e84[_0xa757('0x29')][_0xa757('0x35')]+'%'};return _0x111cfe;}})});}_0x5b4779=_['merge']({},_0x5b4779,_0x471e84[_0xa757('0x38')]);var _0x34fba8={'where':_0x5b4779[_0xa757('0x32')]};return db[_0xa757('0x39')][_0xa757('0x3a')](_0x34fba8)[_0xa757('0x1f')](function(_0x501e26){_0x54263b[_0xa757('0x3a')]=_0x501e26;if(_0x471e84[_0xa757('0x29')]['includeAll']){_0x5b4779['include']=[{'all':!![]}];}return db[_0xa757('0x39')][_0xa757('0x3b')](_0x5b4779);})['then'](function(_0x51c3d1){_0x54263b[_0xa757('0x3c')]=_0x51c3d1;return _0x54263b;})[_0xa757('0x1f')](respondWithFilteredResult(_0x3bf7f3,_0x5b4779))[_0xa757('0x3d')](handleError(_0x3bf7f3,null));};exports['show']=function(_0x830dc4,_0x13a8f4){var _0x26802c={'raw':!![],'where':{'id':_0x830dc4[_0xa757('0x3e')]['id']}},_0x1ba399={};_0x1ba399['model']=_[_0xa757('0x3f')](db['ChatQueueReport']['rawAttributes']);_0x1ba399[_0xa757('0x29')]=_[_0xa757('0x3f')](_0x830dc4[_0xa757('0x29')]);_0x1ba399[_0xa757('0x34')]=_[_0xa757('0x2a')](_0x1ba399['model'],_0x1ba399['query']);_0x26802c[_0xa757('0x2b')]=_[_0xa757('0x2a')](_0x1ba399[_0xa757('0x28')],qs[_0xa757('0x2c')](_0x830dc4[_0xa757('0x29')][_0xa757('0x2c')]));_0x26802c['attributes']=_0x26802c[_0xa757('0x2b')][_0xa757('0x2d')]?_0x26802c['attributes']:_0x1ba399[_0xa757('0x28')];if(_0x830dc4['query'][_0xa757('0x40')]){_0x26802c[_0xa757('0x41')]=[{'all':!![]}];}_0x26802c=_['merge']({},_0x26802c,_0x830dc4[_0xa757('0x38')]);return db[_0xa757('0x39')]['find'](_0x26802c)[_0xa757('0x1f')](handleEntityNotFound(_0x13a8f4,null))[_0xa757('0x1f')](respondWithResult(_0x13a8f4,null))[_0xa757('0x3d')](handleError(_0x13a8f4,null));};exports[_0xa757('0x42')]=function(_0x543b5b,_0x199dc9){return db[_0xa757('0x39')][_0xa757('0x42')](_0x543b5b[_0xa757('0x43')],{})['then'](respondWithResult(_0x199dc9,0xc9))[_0xa757('0x3d')](handleError(_0x199dc9,null));};exports['update']=function(_0x50c131,_0x2acf88){if(_0x50c131[_0xa757('0x43')]['id']){delete _0x50c131[_0xa757('0x43')]['id'];}return db['ChatQueueReport'][_0xa757('0x44')]({'where':{'id':_0x50c131['params']['id']}})[_0xa757('0x1f')](handleEntityNotFound(_0x2acf88,null))[_0xa757('0x1f')](saveUpdates(_0x50c131[_0xa757('0x43')],null))[_0xa757('0x1f')](respondWithResult(_0x2acf88,null))[_0xa757('0x3d')](handleError(_0x2acf88,null));};exports[_0xa757('0x20')]=function(_0x57bf73,_0x505cd){return db['ChatQueueReport'][_0xa757('0x44')]({'where':{'id':_0x57bf73[_0xa757('0x3e')]['id']}})[_0xa757('0x1f')](handleEntityNotFound(_0x505cd,null))[_0xa757('0x1f')](removeEntity(_0x505cd,null))[_0xa757('0x3d')](handleError(_0x505cd,null));};exports[_0xa757('0x45')]=function(_0x15bad7,_0x2c5b3c){return db[_0xa757('0x39')][_0xa757('0x45')]()[_0xa757('0x1f')](respondWithResult(_0x2c5b3c,null))[_0xa757('0x3d')](handleError(_0x2c5b3c,null));};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.model.js b/server/api/chatQueueReport/chatQueueReport.model.js
index d08ba86..10f0104 100644
--- a/server/api/chatQueueReport/chatQueueReport.model.js
+++ b/server/api/chatQueueReport/chatQueueReport.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x633f=['exports','define','ChatQueueReport','report_chat_queue','uniqueid','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatQueueReport.attributes'];(function(_0x21a9a3,_0xa033e5){var _0x14910a=function(_0x4e2f05){while(--_0x4e2f05){_0x21a9a3['push'](_0x21a9a3['shift']());}};_0x14910a(++_0xa033e5);}(_0x633f,0x113));var _0xf633=function(_0x45a244,_0x12f982){_0x45a244=_0x45a244-0x0;var _0x57edbc=_0x633f[_0x45a244];return _0x57edbc;};'use strict';var _=require(_0xf633('0x0'));var util=require(_0xf633('0x1'));var logger=require('../../config/logger')(_0xf633('0x2'));var moment=require(_0xf633('0x3'));var BPromise=require(_0xf633('0x4'));var rp=require(_0xf633('0x5'));var fs=require('fs');var path=require(_0xf633('0x6'));var rimraf=require(_0xf633('0x7'));var config=require(_0xf633('0x8'));var attributes=require(_0xf633('0x9'));module[_0xf633('0xa')]=function(_0x547966,_0x2dc7ca){return _0x547966[_0xf633('0xb')](_0xf633('0xc'),attributes,{'tableName':_0xf633('0xd'),'paranoid':![],'indexes':[{'name':_0xf633('0xe'),'fields':[_0xf633('0xe')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xd66e=['../../config/environment','./chatQueueReport.attributes','define','report_chat_queue','uniqueid','lodash','util','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x17ef39,_0x124979){var _0x4c33d9=function(_0x31d81c){while(--_0x31d81c){_0x17ef39['push'](_0x17ef39['shift']());}};_0x4c33d9(++_0x124979);}(_0xd66e,0x171));var _0xed66=function(_0x267c52,_0x3c0df3){_0x267c52=_0x267c52-0x0;var _0x46c47b=_0xd66e[_0x267c52];return _0x46c47b;};'use strict';var _=require(_0xed66('0x0'));var util=require(_0xed66('0x1'));var logger=require('../../config/logger')(_0xed66('0x2'));var moment=require(_0xed66('0x3'));var BPromise=require(_0xed66('0x4'));var rp=require(_0xed66('0x5'));var fs=require('fs');var path=require(_0xed66('0x6'));var rimraf=require(_0xed66('0x7'));var config=require(_0xed66('0x8'));var attributes=require(_0xed66('0x9'));module['exports']=function(_0x11853d,_0x337468){return _0x11853d[_0xed66('0xa')]('ChatQueueReport',attributes,{'tableName':_0xed66('0xb'),'paranoid':![],'indexes':[{'name':_0xed66('0xc'),'fields':[_0xed66('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.rpc.js b/server/api/chatQueueReport/chatQueueReport.rpc.js
index ccf58b8..a2b43c8 100644
--- a/server/api/chatQueueReport/chatQueueReport.rpc.js
+++ b/server/api/chatQueueReport/chatQueueReport.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x47a1=['code','message','result','catch','CreateChatQueueReport','ChatQueueReport','create','body','options','raw','then','UpdateChatQueueReport','update','where','attributes','limit','debug','lodash','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','info','ChatQueueReport,\x20%s,\x20%s','request\x20sent','ChatQueueReport,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x2be8c2,_0x14a4b5){var _0x97f531=function(_0xcee58d){while(--_0xcee58d){_0x2be8c2['push'](_0x2be8c2['shift']());}};_0x97f531(++_0x14a4b5);}(_0x47a1,0x95));var _0x147a=function(_0x547a92,_0x13d240){_0x547a92=_0x547a92-0x0;var _0x263d46=_0x47a1[_0x547a92];return _0x263d46;};'use strict';var _=require(_0x147a('0x0'));var util=require('util');var moment=require(_0x147a('0x1'));var BPromise=require('bluebird');var rs=require(_0x147a('0x2'));var fs=require('fs');var Redis=require(_0x147a('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x147a('0x4'));var logger=require(_0x147a('0x5'))(_0x147a('0x6'));var config=require('../../config/environment');var jayson=require(_0x147a('0x7'));var client=jayson['client'][_0x147a('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x295173,_0xeb550f,_0x14ace6){return new BPromise(function(_0x4e5936,_0x5e3db2){return client[_0x147a('0x9')](_0x295173,_0x14ace6)['then'](function(_0x575003){logger[_0x147a('0xa')](_0x147a('0xb'),_0xeb550f,_0x147a('0xc'));logger['debug'](_0x147a('0xd'),_0xeb550f,'request\x20sent',JSON[_0x147a('0xe')](_0x575003));if(_0x575003['error']){if(_0x575003[_0x147a('0xf')][_0x147a('0x10')]===0x1f4){logger[_0x147a('0xf')](_0x147a('0xb'),_0xeb550f,_0x575003['error']['message']);return _0x5e3db2(_0x575003[_0x147a('0xf')]['message']);}logger[_0x147a('0xf')](_0x147a('0xb'),_0xeb550f,_0x575003['error']['message']);return _0x4e5936(_0x575003[_0x147a('0xf')][_0x147a('0x11')]);}else{logger[_0x147a('0xa')](_0x147a('0xb'),_0xeb550f,_0x147a('0xc'));_0x4e5936(_0x575003[_0x147a('0x12')][_0x147a('0x11')]);}})[_0x147a('0x13')](function(_0x52aa76){logger[_0x147a('0xf')](_0x147a('0xb'),_0xeb550f,_0x52aa76);_0x5e3db2(_0x52aa76);});});}exports[_0x147a('0x14')]=function(_0x4c0969){var _0x22fb53=this;return new Promise(function(_0x3925d0,_0x3ca5dd){return db[_0x147a('0x15')][_0x147a('0x16')](_0x4c0969[_0x147a('0x17')],{'raw':_0x4c0969[_0x147a('0x18')]?_0x4c0969[_0x147a('0x18')][_0x147a('0x19')]===undefined?!![]:![]:!![]})[_0x147a('0x1a')](function(_0x3596c8){logger[_0x147a('0xa')]('CreateChatQueueReport',_0x4c0969);logger['debug'](_0x147a('0x14'),_0x4c0969,JSON[_0x147a('0xe')](_0x3596c8));_0x3925d0(_0x3596c8);})[_0x147a('0x13')](function(_0x511cbd){logger[_0x147a('0xf')]('CreateChatQueueReport',_0x511cbd[_0x147a('0x11')],_0x4c0969);_0x3ca5dd(_0x22fb53[_0x147a('0xf')](0x1f4,_0x511cbd[_0x147a('0x11')]));});});};exports[_0x147a('0x1b')]=function(_0x4828bd){var _0x3887a2=this;return new Promise(function(_0x28d573,_0x445cb6){return db[_0x147a('0x15')][_0x147a('0x1c')](_0x4828bd[_0x147a('0x17')],{'raw':_0x4828bd[_0x147a('0x18')]?_0x4828bd[_0x147a('0x18')][_0x147a('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4828bd['options']?_0x4828bd[_0x147a('0x18')][_0x147a('0x1d')]||null:null,'attributes':_0x4828bd['options']?_0x4828bd[_0x147a('0x18')][_0x147a('0x1e')]||null:null,'limit':_0x4828bd[_0x147a('0x18')]?_0x4828bd[_0x147a('0x18')][_0x147a('0x1f')]||null:null})[_0x147a('0x1a')](function(_0x586381){logger['info']('UpdateChatQueueReport',_0x4828bd);logger[_0x147a('0x20')](_0x147a('0x1b'),_0x4828bd,JSON[_0x147a('0xe')](_0x586381));_0x28d573(_0x586381);})[_0x147a('0x13')](function(_0x366d91){logger['error'](_0x147a('0x1b'),_0x366d91['message'],_0x4828bd);_0x445cb6(_0x3887a2[_0x147a('0xf')](0x1f4,_0x366d91[_0x147a('0x11')]));});});};
\ No newline at end of file
+var _0x4ddd=['result','catch','CreateChatQueueReport','ChatQueueReport','create','body','options','raw','UpdateChatQueueReport','where','attributes','limit','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','request','then','info','ChatQueueReport,\x20%s,\x20%s','request\x20sent','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x51bca3,_0x4d538f){var _0x522da4=function(_0x21e301){while(--_0x21e301){_0x51bca3['push'](_0x51bca3['shift']());}};_0x522da4(++_0x4d538f);}(_0x4ddd,0x1d3));var _0xd4dd=function(_0xa9a245,_0x2a0387){_0xa9a245=_0xa9a245-0x0;var _0x2d0eaa=_0x4ddd[_0xa9a245];return _0x2d0eaa;};'use strict';var _=require(_0xd4dd('0x0'));var util=require(_0xd4dd('0x1'));var moment=require(_0xd4dd('0x2'));var BPromise=require(_0xd4dd('0x3'));var rs=require(_0xd4dd('0x4'));var fs=require('fs');var Redis=require(_0xd4dd('0x5'));var db=require(_0xd4dd('0x6'))['db'];var utils=require(_0xd4dd('0x7'));var logger=require('../../config/logger')(_0xd4dd('0x8'));var config=require('../../config/environment');var jayson=require(_0xd4dd('0x9'));var client=jayson[_0xd4dd('0xa')][_0xd4dd('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x10eb26,_0x5d3446,_0x3df8f9){return new BPromise(function(_0x240f38,_0x4edf18){return client[_0xd4dd('0xc')](_0x10eb26,_0x3df8f9)[_0xd4dd('0xd')](function(_0x1f5cef){logger[_0xd4dd('0xe')](_0xd4dd('0xf'),_0x5d3446,_0xd4dd('0x10'));logger[_0xd4dd('0x11')](_0xd4dd('0x12'),_0x5d3446,'request\x20sent',JSON[_0xd4dd('0x13')](_0x1f5cef));if(_0x1f5cef['error']){if(_0x1f5cef[_0xd4dd('0x14')][_0xd4dd('0x15')]===0x1f4){logger[_0xd4dd('0x14')]('ChatQueueReport,\x20%s,\x20%s',_0x5d3446,_0x1f5cef[_0xd4dd('0x14')][_0xd4dd('0x16')]);return _0x4edf18(_0x1f5cef['error'][_0xd4dd('0x16')]);}logger['error'](_0xd4dd('0xf'),_0x5d3446,_0x1f5cef['error'][_0xd4dd('0x16')]);return _0x240f38(_0x1f5cef['error'][_0xd4dd('0x16')]);}else{logger['info'](_0xd4dd('0xf'),_0x5d3446,_0xd4dd('0x10'));_0x240f38(_0x1f5cef[_0xd4dd('0x17')][_0xd4dd('0x16')]);}})[_0xd4dd('0x18')](function(_0x635d02){logger[_0xd4dd('0x14')](_0xd4dd('0xf'),_0x5d3446,_0x635d02);_0x4edf18(_0x635d02);});});}exports[_0xd4dd('0x19')]=function(_0x21a400){var _0x279ee2=this;return new Promise(function(_0x56aec7,_0x4b50ee){return db[_0xd4dd('0x1a')][_0xd4dd('0x1b')](_0x21a400[_0xd4dd('0x1c')],{'raw':_0x21a400['options']?_0x21a400[_0xd4dd('0x1d')][_0xd4dd('0x1e')]===undefined?!![]:![]:!![]})[_0xd4dd('0xd')](function(_0x5bc5f6){logger[_0xd4dd('0xe')](_0xd4dd('0x19'),_0x21a400);logger[_0xd4dd('0x11')](_0xd4dd('0x19'),_0x21a400,JSON[_0xd4dd('0x13')](_0x5bc5f6));_0x56aec7(_0x5bc5f6);})[_0xd4dd('0x18')](function(_0x447af8){logger[_0xd4dd('0x14')]('CreateChatQueueReport',_0x447af8['message'],_0x21a400);_0x4b50ee(_0x279ee2[_0xd4dd('0x14')](0x1f4,_0x447af8[_0xd4dd('0x16')]));});});};exports[_0xd4dd('0x1f')]=function(_0x3998ba){var _0x4d9bc6=this;return new Promise(function(_0x3be51f,_0x2fc3d0){return db['ChatQueueReport']['update'](_0x3998ba[_0xd4dd('0x1c')],{'raw':_0x3998ba['options']?_0x3998ba['options'][_0xd4dd('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3998ba[_0xd4dd('0x1d')]?_0x3998ba[_0xd4dd('0x1d')][_0xd4dd('0x20')]||null:null,'attributes':_0x3998ba[_0xd4dd('0x1d')]?_0x3998ba[_0xd4dd('0x1d')][_0xd4dd('0x21')]||null:null,'limit':_0x3998ba[_0xd4dd('0x1d')]?_0x3998ba[_0xd4dd('0x1d')][_0xd4dd('0x22')]||null:null})[_0xd4dd('0xd')](function(_0x17105c){logger[_0xd4dd('0xe')](_0xd4dd('0x1f'),_0x3998ba);logger[_0xd4dd('0x11')](_0xd4dd('0x1f'),_0x3998ba,JSON[_0xd4dd('0x13')](_0x17105c));_0x3be51f(_0x17105c);})[_0xd4dd('0x18')](function(_0x5789a2){logger['error']('UpdateChatQueueReport',_0x5789a2[_0xd4dd('0x16')],_0x3998ba);_0x2fc3d0(_0x4d9bc6[_0xd4dd('0x14')](0x1f4,_0x5789a2[_0xd4dd('0x16')]));});});};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/index.js b/server/api/chatQueueReport/index.js
index 26f1ecd..b6986f1 100644
--- a/server/api/chatQueueReport/index.js
+++ b/server/api/chatQueueReport/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x8136=['get','index','/describe','isAuthenticated','describe','/:id','show','create','update','delete','destroy','exports','util','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','./chatQueueReport.controller'];(function(_0x36a88f,_0x43e5ce){var _0x2008c2=function(_0xd75f89){while(--_0xd75f89){_0x36a88f['push'](_0x36a88f['shift']());}};_0x2008c2(++_0x43e5ce);}(_0x8136,0xf6));var _0x6813=function(_0x2dd1dd,_0x281863){_0x2dd1dd=_0x2dd1dd-0x0;var _0x3e2c13=_0x8136[_0x2dd1dd];return _0x3e2c13;};'use strict';var multer=require('multer');var util=require(_0x6813('0x0'));var path=require('path');var timeout=require(_0x6813('0x1'));var express=require('express');var router=express[_0x6813('0x2')]();var auth=require(_0x6813('0x3'));var interaction=require(_0x6813('0x4'));var config=require('../../config/environment');var controller=require(_0x6813('0x5'));router[_0x6813('0x6')]('/',auth['isAuthenticated'](),controller[_0x6813('0x7')]);router[_0x6813('0x6')](_0x6813('0x8'),auth[_0x6813('0x9')](),controller[_0x6813('0xa')]);router['get'](_0x6813('0xb'),auth[_0x6813('0x9')](),controller[_0x6813('0xc')]);router['post']('/',auth['isAuthenticated'](),controller[_0x6813('0xd')]);router['put']('/:id',auth[_0x6813('0x9')](),controller[_0x6813('0xe')]);router[_0x6813('0xf')]('/:id',auth[_0x6813('0x9')](),controller[_0x6813('0x10')]);module[_0x6813('0x11')]=router;
\ No newline at end of file
+var _0xf0fc=['../../components/auth/service','../../components/interaction/service','../../config/environment','./chatQueueReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','create','update','delete','util','path','connect-timeout','express'];(function(_0xb54e3a,_0x53210b){var _0x44ecbe=function(_0x486af3){while(--_0x486af3){_0xb54e3a['push'](_0xb54e3a['shift']());}};_0x44ecbe(++_0x53210b);}(_0xf0fc,0x68));var _0xcf0f=function(_0x967abd,_0x55e888){_0x967abd=_0x967abd-0x0;var _0x533f1a=_0xf0fc[_0x967abd];return _0x533f1a;};'use strict';var multer=require('multer');var util=require(_0xcf0f('0x0'));var path=require(_0xcf0f('0x1'));var timeout=require(_0xcf0f('0x2'));var express=require(_0xcf0f('0x3'));var router=express['Router']();var auth=require(_0xcf0f('0x4'));var interaction=require(_0xcf0f('0x5'));var config=require(_0xcf0f('0x6'));var controller=require(_0xcf0f('0x7'));router[_0xcf0f('0x8')]('/',auth[_0xcf0f('0x9')](),controller[_0xcf0f('0xa')]);router[_0xcf0f('0x8')](_0xcf0f('0xb'),auth[_0xcf0f('0x9')](),controller[_0xcf0f('0xc')]);router[_0xcf0f('0x8')](_0xcf0f('0xd'),auth[_0xcf0f('0x9')](),controller[_0xcf0f('0xe')]);router['post']('/',auth[_0xcf0f('0x9')](),controller[_0xcf0f('0xf')]);router['put'](_0xcf0f('0xd'),auth[_0xcf0f('0x9')](),controller[_0xcf0f('0x10')]);router[_0xcf0f('0x11')](_0xcf0f('0xd'),auth[_0xcf0f('0x9')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.attributes.js b/server/api/chatTransferReport/chatTransferReport.attributes.js
index 2ef49bb..03ca65b 100644
--- a/server/api/chatTransferReport/chatTransferReport.attributes.js
+++ b/server/api/chatTransferReport/chatTransferReport.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x3e96=['STRING','ENUM','account','agent','queue','DATE','NOW','moment'];(function(_0x1acd1d,_0x3c8c1a){var _0x59f5a7=function(_0x431aec){while(--_0x431aec){_0x1acd1d['push'](_0x1acd1d['shift']());}};_0x59f5a7(++_0x3c8c1a);}(_0x3e96,0x1af));var _0x63e9=function(_0x30182f,_0x30ce41){_0x30182f=_0x30182f-0x0;var _0x5207db=_0x3e96[_0x30182f];return _0x5207db;};'use strict';var moment=require(_0x63e9('0x0'));var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize[_0x63e9('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x63e9('0x2')](_0x63e9('0x3'),_0x63e9('0x4'),_0x63e9('0x5')),'allowNull':![],'defaultValue':_0x63e9('0x5')},'transferredAt':{'type':Sequelize[_0x63e9('0x6')],'allowNull':![],'defaultValue':Sequelize[_0x63e9('0x7')]}};
\ No newline at end of file
+var _0x37fe=['account','queue','DATE','NOW','exports','STRING','ENUM'];(function(_0x70f299,_0x35907f){var _0x292933=function(_0x3be6e3){while(--_0x3be6e3){_0x70f299['push'](_0x70f299['shift']());}};_0x292933(++_0x35907f);}(_0x37fe,0x138));var _0xe37f=function(_0x25d085,_0x40cebf){_0x25d085=_0x25d085-0x0;var _0x112d9d=_0x37fe[_0x25d085];return _0x112d9d;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0xe37f('0x0')]={'uniqueid':{'type':Sequelize[_0xe37f('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0xe37f('0x2')](_0xe37f('0x3'),'agent','queue'),'allowNull':![],'defaultValue':_0xe37f('0x4')},'transferredAt':{'type':Sequelize[_0xe37f('0x5')],'allowNull':![],'defaultValue':Sequelize[_0xe37f('0x6')]}};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.controller.js b/server/api/chatTransferReport/chatTransferReport.controller.js
index 9122559..dc93863 100644
--- a/server/api/chatTransferReport/chatTransferReport.controller.js
+++ b/server/api/chatTransferReport/chatTransferReport.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x5fef=['sendStatus','status','end','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','ChatTransferReport','rawAttributes','fieldName','type','key','model','map','query','attributes','fields','length','nolimit','sort','where','filters','merge','VIRTUAL','filter','count','includeAll','include','rows','catch','show','params','keys','intersection','options','find','create','body','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','api','../../config/environment','../../mysqldb'];(function(_0x28ce24,_0x2ff60e){var _0x10ea69=function(_0x1b4d90){while(--_0x1b4d90){_0x28ce24['push'](_0x28ce24['shift']());}};_0x10ea69(++_0x2ff60e);}(_0x5fef,0x19f));var _0xf5fe=function(_0x165a17,_0xbe780f){_0x165a17=_0x165a17-0x0;var _0x4f9f1c=_0x5fef[_0x165a17];return _0x4f9f1c;};'use strict';var pdf=require(_0xf5fe('0x0'));var emlformat=require(_0xf5fe('0x1'));var rimraf=require(_0xf5fe('0x2'));var zipdir=require(_0xf5fe('0x3'));var jsonpatch=require(_0xf5fe('0x4'));var rp=require('request-promise');var moment=require(_0xf5fe('0x5'));var BPromise=require(_0xf5fe('0x6'));var Mustache=require(_0xf5fe('0x7'));var util=require('util');var path=require('path');var sox=require(_0xf5fe('0x8'));var csv=require(_0xf5fe('0x9'));var ejs=require(_0xf5fe('0xa'));var fs=require('fs');var _=require(_0xf5fe('0xb'));var squel=require('squel');var crypto=require(_0xf5fe('0xc'));var jsforce=require(_0xf5fe('0xd'));var deskjs=require(_0xf5fe('0xe'));var toCsv=require('to-csv');var querystring=require(_0xf5fe('0xf'));var Papa=require(_0xf5fe('0x10'));var Redis=require(_0xf5fe('0x11'));var authService=require(_0xf5fe('0x12'));var qs=require(_0xf5fe('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xf5fe('0x14'));var utils=require('../../config/utils');var config=require(_0xf5fe('0x15'));var db=require(_0xf5fe('0x16'))['db'];function respondWithStatusCode(_0x2cb036,_0x206e62){_0x206e62=_0x206e62||0xcc;return function(_0xb9ecab){if(_0xb9ecab){return _0x2cb036[_0xf5fe('0x17')](_0x206e62);}return _0x2cb036[_0xf5fe('0x18')](_0x206e62)[_0xf5fe('0x19')]();};}function respondWithResult(_0x1ea593,_0xd49eea){_0xd49eea=_0xd49eea||0xc8;return function(_0x560cd9){if(_0x560cd9){return _0x1ea593[_0xf5fe('0x18')](_0xd49eea)['json'](_0x560cd9);}};}function respondWithFilteredResult(_0x7b3fc8,_0x9749fd){return function(_0x4d3e5b){if(_0x4d3e5b){var _0x2d5ad1=_0x4d3e5b['count'],_0x21f732=_0x9749fd[_0xf5fe('0x1a')],_0x5d4d33=_0x9749fd[_0xf5fe('0x1a')]+_0x9749fd[_0xf5fe('0x1b')],_0x3543ab;if(_0x5d4d33>=_0x2d5ad1){_0x5d4d33=_0x2d5ad1;_0x3543ab=0xc8;}else{_0x3543ab=0xce;}_0x7b3fc8[_0xf5fe('0x18')](_0x3543ab);return _0x7b3fc8[_0xf5fe('0x1c')](_0xf5fe('0x1d'),_0x21f732+'-'+_0x5d4d33+'/'+_0x2d5ad1)['json'](_0x4d3e5b);}return null;};}function patchUpdates(_0x8e68a6){return function(_0x22576f){try{jsonpatch[_0xf5fe('0x1e')](_0x22576f,_0x8e68a6,!![]);}catch(_0x62db8f){return BPromise[_0xf5fe('0x1f')](_0x62db8f);}return _0x22576f[_0xf5fe('0x20')]();};}function saveUpdates(_0x32159c,_0x1dd5ef){return function(_0x3f4340){if(_0x3f4340){return _0x3f4340[_0xf5fe('0x21')](_0x32159c)[_0xf5fe('0x22')](function(_0xd779ff){return _0xd779ff;});}return null;};}function removeEntity(_0x255c6a,_0x3976cb){return function(_0x20b1eb){if(_0x20b1eb){return _0x20b1eb[_0xf5fe('0x23')]()[_0xf5fe('0x22')](function(){_0x255c6a[_0xf5fe('0x18')](0xcc)[_0xf5fe('0x19')]();});}};}function handleEntityNotFound(_0x46d3ba,_0x407b1e){return function(_0x16a6b9){if(!_0x16a6b9){_0x46d3ba['sendStatus'](0x194);}return _0x16a6b9;};}function handleError(_0x34f296,_0x54f4a3){_0x54f4a3=_0x54f4a3||0x1f4;return function(_0x26e620){logger[_0xf5fe('0x24')](_0x26e620[_0xf5fe('0x25')]);if(_0x26e620[_0xf5fe('0x26')]){delete _0x26e620[_0xf5fe('0x26')];}_0x34f296[_0xf5fe('0x18')](_0x54f4a3)[_0xf5fe('0x27')](_0x26e620);};}exports[_0xf5fe('0x28')]=function(_0x3bce2c,_0x259c4b){var _0x36372d={},_0x273c73={},_0x2cd7d7={'count':0x0,'rows':[]};var _0x1d9c9c=_['map'](db[_0xf5fe('0x29')][_0xf5fe('0x2a')],function(_0x1cade2){return{'name':_0x1cade2[_0xf5fe('0x2b')],'type':_0x1cade2[_0xf5fe('0x2c')][_0xf5fe('0x2d')]};});_0x273c73[_0xf5fe('0x2e')]=_[_0xf5fe('0x2f')](_0x1d9c9c,'name');_0x273c73[_0xf5fe('0x30')]=_['keys'](_0x3bce2c[_0xf5fe('0x30')]);_0x273c73['filters']=_['intersection'](_0x273c73['model'],_0x273c73[_0xf5fe('0x30')]);_0x36372d[_0xf5fe('0x31')]=_['intersection'](_0x273c73[_0xf5fe('0x2e')],qs[_0xf5fe('0x32')](_0x3bce2c['query'][_0xf5fe('0x32')]));_0x36372d['attributes']=_0x36372d[_0xf5fe('0x31')][_0xf5fe('0x33')]?_0x36372d['attributes']:_0x273c73['model'];if(!_0x3bce2c['query']['hasOwnProperty'](_0xf5fe('0x34'))){_0x36372d[_0xf5fe('0x1b')]=qs['limit'](_0x3bce2c[_0xf5fe('0x30')][_0xf5fe('0x1b')]);_0x36372d[_0xf5fe('0x1a')]=qs['offset'](_0x3bce2c['query'][_0xf5fe('0x1a')]);}_0x36372d['order']=qs[_0xf5fe('0x35')](_0x3bce2c[_0xf5fe('0x30')]['sort']);_0x36372d[_0xf5fe('0x36')]=qs['filters'](_['pick'](_0x3bce2c[_0xf5fe('0x30')],_0x273c73[_0xf5fe('0x37')]),_0x1d9c9c);if(_0x3bce2c[_0xf5fe('0x30')]['filter']){_0x36372d[_0xf5fe('0x36')]=_[_0xf5fe('0x38')](_0x36372d['where'],{'$or':_[_0xf5fe('0x2f')](_0x1d9c9c,function(_0x211bf4){if(_0x211bf4['type']!==_0xf5fe('0x39')){var _0x3af95a={};_0x3af95a[_0x211bf4['name']]={'$like':'%'+_0x3bce2c[_0xf5fe('0x30')][_0xf5fe('0x3a')]+'%'};return _0x3af95a;}})});}_0x36372d=_[_0xf5fe('0x38')]({},_0x36372d,_0x3bce2c['options']);var _0x36f569={'where':_0x36372d[_0xf5fe('0x36')]};return db[_0xf5fe('0x29')][_0xf5fe('0x3b')](_0x36f569)[_0xf5fe('0x22')](function(_0x1b38fb){_0x2cd7d7[_0xf5fe('0x3b')]=_0x1b38fb;if(_0x3bce2c['query'][_0xf5fe('0x3c')]){_0x36372d[_0xf5fe('0x3d')]=[{'all':!![]}];}return db[_0xf5fe('0x29')]['findAll'](_0x36372d);})['then'](function(_0x27a96b){_0x2cd7d7[_0xf5fe('0x3e')]=_0x27a96b;return _0x2cd7d7;})[_0xf5fe('0x22')](respondWithFilteredResult(_0x259c4b,_0x36372d))[_0xf5fe('0x3f')](handleError(_0x259c4b,null));};exports[_0xf5fe('0x40')]=function(_0x406b94,_0x5baad7){var _0x317c99={'raw':!![],'where':{'id':_0x406b94[_0xf5fe('0x41')]['id']}},_0x3fa2fa={};_0x3fa2fa['model']=_[_0xf5fe('0x42')](db[_0xf5fe('0x29')]['rawAttributes']);_0x3fa2fa[_0xf5fe('0x30')]=_['keys'](_0x406b94[_0xf5fe('0x30')]);_0x3fa2fa['filters']=_['intersection'](_0x3fa2fa['model'],_0x3fa2fa[_0xf5fe('0x30')]);_0x317c99[_0xf5fe('0x31')]=_[_0xf5fe('0x43')](_0x3fa2fa['model'],qs[_0xf5fe('0x32')](_0x406b94[_0xf5fe('0x30')]['fields']));_0x317c99['attributes']=_0x317c99[_0xf5fe('0x31')][_0xf5fe('0x33')]?_0x317c99[_0xf5fe('0x31')]:_0x3fa2fa[_0xf5fe('0x2e')];if(_0x406b94[_0xf5fe('0x30')][_0xf5fe('0x3c')]){_0x317c99[_0xf5fe('0x3d')]=[{'all':!![]}];}_0x317c99=_[_0xf5fe('0x38')]({},_0x317c99,_0x406b94[_0xf5fe('0x44')]);return db[_0xf5fe('0x29')][_0xf5fe('0x45')](_0x317c99)[_0xf5fe('0x22')](handleEntityNotFound(_0x5baad7,null))['then'](respondWithResult(_0x5baad7,null))[_0xf5fe('0x3f')](handleError(_0x5baad7,null));};exports[_0xf5fe('0x46')]=function(_0x3bb159,_0x470b9a){return db[_0xf5fe('0x29')][_0xf5fe('0x46')](_0x3bb159[_0xf5fe('0x47')],{})[_0xf5fe('0x22')](respondWithResult(_0x470b9a,0xc9))[_0xf5fe('0x3f')](handleError(_0x470b9a,null));};exports['update']=function(_0x2ded3a,_0x4dc420){if(_0x2ded3a[_0xf5fe('0x47')]['id']){delete _0x2ded3a[_0xf5fe('0x47')]['id'];}return db[_0xf5fe('0x29')][_0xf5fe('0x45')]({'where':{'id':_0x2ded3a[_0xf5fe('0x41')]['id']}})[_0xf5fe('0x22')](handleEntityNotFound(_0x4dc420,null))['then'](saveUpdates(_0x2ded3a[_0xf5fe('0x47')],null))[_0xf5fe('0x22')](respondWithResult(_0x4dc420,null))[_0xf5fe('0x3f')](handleError(_0x4dc420,null));};exports[_0xf5fe('0x23')]=function(_0x254c4f,_0x4510ea){return db[_0xf5fe('0x29')][_0xf5fe('0x45')]({'where':{'id':_0x254c4f[_0xf5fe('0x41')]['id']}})[_0xf5fe('0x22')](handleEntityNotFound(_0x4510ea,null))[_0xf5fe('0x22')](removeEntity(_0x4510ea,null))[_0xf5fe('0x3f')](handleError(_0x4510ea,null));};exports[_0xf5fe('0x48')]=function(_0x29455e,_0x144010){return db[_0xf5fe('0x29')][_0xf5fe('0x48')]()[_0xf5fe('0x22')](respondWithResult(_0x144010,null))[_0xf5fe('0x3f')](handleError(_0x144010,null));};
\ No newline at end of file
+var _0x266c=['../../mysqldb','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','end','error','stack','name','send','index','map','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','options','include','ChatTransferReport','findAll','rows','catch','params','rawAttributes','length','includeAll','create','body','find','describe','html-pdf','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','api'];(function(_0x1139d0,_0x41e5f8){var _0xcc01a6=function(_0x504ffa){while(--_0x504ffa){_0x1139d0['push'](_0x1139d0['shift']());}};_0xcc01a6(++_0x41e5f8);}(_0x266c,0x155));var _0xc266=function(_0x20d15c,_0x2ca902){_0x20d15c=_0x20d15c-0x0;var _0x17d594=_0x266c[_0x20d15c];return _0x17d594;};'use strict';var pdf=require(_0xc266('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xc266('0x1'));var jsonpatch=require(_0xc266('0x2'));var rp=require('request-promise');var moment=require(_0xc266('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xc266('0x4'));var util=require(_0xc266('0x5'));var path=require(_0xc266('0x6'));var sox=require(_0xc266('0x7'));var csv=require(_0xc266('0x8'));var ejs=require(_0xc266('0x9'));var fs=require('fs');var _=require(_0xc266('0xa'));var squel=require(_0xc266('0xb'));var crypto=require(_0xc266('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xc266('0x8'));var querystring=require(_0xc266('0xd'));var Papa=require(_0xc266('0xe'));var Redis=require(_0xc266('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xc266('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xc266('0x11'))(_0xc266('0x12'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0xc266('0x13'))['db'];function respondWithStatusCode(_0x186f4c,_0x5da987){_0x5da987=_0x5da987||0xcc;return function(_0x50af60){if(_0x50af60){return _0x186f4c[_0xc266('0x14')](_0x5da987);}return _0x186f4c['status'](_0x5da987)['end']();};}function respondWithResult(_0x2b4cbe,_0x14f78e){_0x14f78e=_0x14f78e||0xc8;return function(_0x10a869){if(_0x10a869){return _0x2b4cbe[_0xc266('0x15')](_0x14f78e)[_0xc266('0x16')](_0x10a869);}};}function respondWithFilteredResult(_0x3d47b7,_0x413d0e){return function(_0x841f40){if(_0x841f40){var _0x24872c=_0x841f40[_0xc266('0x17')],_0x41da79=_0x413d0e[_0xc266('0x18')],_0x56b584=_0x413d0e[_0xc266('0x18')]+_0x413d0e[_0xc266('0x19')],_0x5122e9;if(_0x56b584>=_0x24872c){_0x56b584=_0x24872c;_0x5122e9=0xc8;}else{_0x5122e9=0xce;}_0x3d47b7[_0xc266('0x15')](_0x5122e9);return _0x3d47b7[_0xc266('0x1a')](_0xc266('0x1b'),_0x41da79+'-'+_0x56b584+'/'+_0x24872c)['json'](_0x841f40);}return null;};}function patchUpdates(_0x3ea7d9){return function(_0x19bacb){try{jsonpatch[_0xc266('0x1c')](_0x19bacb,_0x3ea7d9,!![]);}catch(_0x255f32){return BPromise[_0xc266('0x1d')](_0x255f32);}return _0x19bacb[_0xc266('0x1e')]();};}function saveUpdates(_0x4ec57e,_0x4d2872){return function(_0x194cc7){if(_0x194cc7){return _0x194cc7[_0xc266('0x1f')](_0x4ec57e)[_0xc266('0x20')](function(_0x212847){return _0x212847;});}return null;};}function removeEntity(_0x29ee99,_0x5eeb63){return function(_0x35ea52){if(_0x35ea52){return _0x35ea52['destroy']()[_0xc266('0x20')](function(){_0x29ee99[_0xc266('0x15')](0xcc)[_0xc266('0x21')]();});}};}function handleEntityNotFound(_0x17746c,_0x247db8){return function(_0x58353c){if(!_0x58353c){_0x17746c[_0xc266('0x14')](0x194);}return _0x58353c;};}function handleError(_0x849bfe,_0x2d78c5){_0x2d78c5=_0x2d78c5||0x1f4;return function(_0x539505){logger[_0xc266('0x22')](_0x539505[_0xc266('0x23')]);if(_0x539505[_0xc266('0x24')]){delete _0x539505[_0xc266('0x24')];}_0x849bfe['status'](_0x2d78c5)[_0xc266('0x25')](_0x539505);};}exports[_0xc266('0x26')]=function(_0x207a30,_0x3a09ed){var _0x5af9b7={},_0x32171e={},_0x46f7c3={'count':0x0,'rows':[]};var _0x594ffe=_[_0xc266('0x27')](db['ChatTransferReport']['rawAttributes'],function(_0x422988){return{'name':_0x422988[_0xc266('0x28')],'type':_0x422988[_0xc266('0x29')][_0xc266('0x2a')]};});_0x32171e[_0xc266('0x2b')]=_[_0xc266('0x27')](_0x594ffe,_0xc266('0x24'));_0x32171e[_0xc266('0x2c')]=_[_0xc266('0x2d')](_0x207a30[_0xc266('0x2c')]);_0x32171e[_0xc266('0x2e')]=_[_0xc266('0x2f')](_0x32171e[_0xc266('0x2b')],_0x32171e['query']);_0x5af9b7[_0xc266('0x30')]=_[_0xc266('0x2f')](_0x32171e['model'],qs[_0xc266('0x31')](_0x207a30['query'][_0xc266('0x31')]));_0x5af9b7[_0xc266('0x30')]=_0x5af9b7[_0xc266('0x30')]['length']?_0x5af9b7[_0xc266('0x30')]:_0x32171e[_0xc266('0x2b')];if(!_0x207a30[_0xc266('0x2c')][_0xc266('0x32')](_0xc266('0x33'))){_0x5af9b7[_0xc266('0x19')]=qs['limit'](_0x207a30[_0xc266('0x2c')][_0xc266('0x19')]);_0x5af9b7['offset']=qs[_0xc266('0x18')](_0x207a30[_0xc266('0x2c')][_0xc266('0x18')]);}_0x5af9b7[_0xc266('0x34')]=qs[_0xc266('0x35')](_0x207a30[_0xc266('0x2c')][_0xc266('0x35')]);_0x5af9b7[_0xc266('0x36')]=qs[_0xc266('0x2e')](_[_0xc266('0x37')](_0x207a30[_0xc266('0x2c')],_0x32171e['filters']),_0x594ffe);if(_0x207a30['query']['filter']){_0x5af9b7['where']=_[_0xc266('0x38')](_0x5af9b7[_0xc266('0x36')],{'$or':_['map'](_0x594ffe,function(_0x4c893a){if(_0x4c893a[_0xc266('0x29')]!==_0xc266('0x39')){var _0x52ded8={};_0x52ded8[_0x4c893a[_0xc266('0x24')]]={'$like':'%'+_0x207a30['query']['filter']+'%'};return _0x52ded8;}})});}_0x5af9b7=_[_0xc266('0x38')]({},_0x5af9b7,_0x207a30[_0xc266('0x3a')]);var _0x31220c={'where':_0x5af9b7[_0xc266('0x36')]};return db['ChatTransferReport']['count'](_0x31220c)[_0xc266('0x20')](function(_0x2d43c1){_0x46f7c3[_0xc266('0x17')]=_0x2d43c1;if(_0x207a30[_0xc266('0x2c')]['includeAll']){_0x5af9b7[_0xc266('0x3b')]=[{'all':!![]}];}return db[_0xc266('0x3c')][_0xc266('0x3d')](_0x5af9b7);})[_0xc266('0x20')](function(_0x43b627){_0x46f7c3[_0xc266('0x3e')]=_0x43b627;return _0x46f7c3;})['then'](respondWithFilteredResult(_0x3a09ed,_0x5af9b7))[_0xc266('0x3f')](handleError(_0x3a09ed,null));};exports['show']=function(_0x15655a,_0x255129){var _0x355eac={'raw':!![],'where':{'id':_0x15655a[_0xc266('0x40')]['id']}},_0x31cf7a={};_0x31cf7a[_0xc266('0x2b')]=_['keys'](db[_0xc266('0x3c')][_0xc266('0x41')]);_0x31cf7a['query']=_[_0xc266('0x2d')](_0x15655a[_0xc266('0x2c')]);_0x31cf7a[_0xc266('0x2e')]=_[_0xc266('0x2f')](_0x31cf7a[_0xc266('0x2b')],_0x31cf7a[_0xc266('0x2c')]);_0x355eac['attributes']=_[_0xc266('0x2f')](_0x31cf7a[_0xc266('0x2b')],qs[_0xc266('0x31')](_0x15655a[_0xc266('0x2c')][_0xc266('0x31')]));_0x355eac[_0xc266('0x30')]=_0x355eac[_0xc266('0x30')][_0xc266('0x42')]?_0x355eac[_0xc266('0x30')]:_0x31cf7a['model'];if(_0x15655a['query'][_0xc266('0x43')]){_0x355eac['include']=[{'all':!![]}];}_0x355eac=_[_0xc266('0x38')]({},_0x355eac,_0x15655a['options']);return db[_0xc266('0x3c')]['find'](_0x355eac)[_0xc266('0x20')](handleEntityNotFound(_0x255129,null))[_0xc266('0x20')](respondWithResult(_0x255129,null))[_0xc266('0x3f')](handleError(_0x255129,null));};exports[_0xc266('0x44')]=function(_0xf6d18f,_0x55a71d){return db[_0xc266('0x3c')][_0xc266('0x44')](_0xf6d18f[_0xc266('0x45')],{})[_0xc266('0x20')](respondWithResult(_0x55a71d,0xc9))['catch'](handleError(_0x55a71d,null));};exports[_0xc266('0x1f')]=function(_0x1fd91b,_0xedab84){if(_0x1fd91b[_0xc266('0x45')]['id']){delete _0x1fd91b[_0xc266('0x45')]['id'];}return db[_0xc266('0x3c')][_0xc266('0x46')]({'where':{'id':_0x1fd91b['params']['id']}})[_0xc266('0x20')](handleEntityNotFound(_0xedab84,null))[_0xc266('0x20')](saveUpdates(_0x1fd91b[_0xc266('0x45')],null))[_0xc266('0x20')](respondWithResult(_0xedab84,null))[_0xc266('0x3f')](handleError(_0xedab84,null));};exports['destroy']=function(_0x25c3f4,_0x24f89d){return db[_0xc266('0x3c')]['find']({'where':{'id':_0x25c3f4[_0xc266('0x40')]['id']}})['then'](handleEntityNotFound(_0x24f89d,null))[_0xc266('0x20')](removeEntity(_0x24f89d,null))[_0xc266('0x3f')](handleError(_0x24f89d,null));};exports[_0xc266('0x47')]=function(_0x5cdec8,_0x417e4f){return db['ChatTransferReport'][_0xc266('0x47')]()[_0xc266('0x20')](respondWithResult(_0x417e4f,null))[_0xc266('0x3f')](handleError(_0x417e4f,null));};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.model.js b/server/api/chatTransferReport/chatTransferReport.model.js
index e822f78..0d3050a 100644
--- a/server/api/chatTransferReport/chatTransferReport.model.js
+++ b/server/api/chatTransferReport/chatTransferReport.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x00bb=['define','ChatTransferReport','report_chat_transfer','uniqueid','lodash','util','../../config/logger','moment','request-promise','path','../../config/environment','./chatTransferReport.attributes'];(function(_0x5ca644,_0x3d2165){var _0x5c87a2=function(_0x3dc7d9){while(--_0x3dc7d9){_0x5ca644['push'](_0x5ca644['shift']());}};_0x5c87a2(++_0x3d2165);}(_0x00bb,0x1d8));var _0xb00b=function(_0x30ae5e,_0x391fc4){_0x30ae5e=_0x30ae5e-0x0;var _0x1f2e93=_0x00bb[_0x30ae5e];return _0x1f2e93;};'use strict';var _=require(_0xb00b('0x0'));var util=require(_0xb00b('0x1'));var logger=require(_0xb00b('0x2'))('api');var moment=require(_0xb00b('0x3'));var BPromise=require('bluebird');var rp=require(_0xb00b('0x4'));var fs=require('fs');var path=require(_0xb00b('0x5'));var rimraf=require('rimraf');var config=require(_0xb00b('0x6'));var attributes=require(_0xb00b('0x7'));module['exports']=function(_0x574cf8,_0x532ffb){return _0x574cf8[_0xb00b('0x8')](_0xb00b('0x9'),attributes,{'tableName':_0xb00b('0xa'),'paranoid':![],'indexes':[{'name':_0xb00b('0xb'),'fields':[_0xb00b('0xb')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x54ef=['uniqueid','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatTransferReport.attributes','define','ChatTransferReport'];(function(_0x2c0d91,_0x195a06){var _0x891055=function(_0x1f30cb){while(--_0x1f30cb){_0x2c0d91['push'](_0x2c0d91['shift']());}};_0x891055(++_0x195a06);}(_0x54ef,0x112));var _0xf54e=function(_0x43f7b1,_0x58a297){_0x43f7b1=_0x43f7b1-0x0;var _0xc8b6e2=_0x54ef[_0x43f7b1];return _0xc8b6e2;};'use strict';var _=require(_0xf54e('0x0'));var util=require(_0xf54e('0x1'));var logger=require(_0xf54e('0x2'))('api');var moment=require(_0xf54e('0x3'));var BPromise=require(_0xf54e('0x4'));var rp=require(_0xf54e('0x5'));var fs=require('fs');var path=require(_0xf54e('0x6'));var rimraf=require(_0xf54e('0x7'));var config=require(_0xf54e('0x8'));var attributes=require(_0xf54e('0x9'));module['exports']=function(_0x55e611,_0x18e84e){return _0x55e611[_0xf54e('0xa')](_0xf54e('0xb'),attributes,{'tableName':'report_chat_transfer','paranoid':![],'indexes':[{'name':_0xf54e('0xc'),'fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.rpc.js b/server/api/chatTransferReport/chatTransferReport.rpc.js
index 5b7031e..5a1fda1 100644
--- a/server/api/chatTransferReport/chatTransferReport.rpc.js
+++ b/server/api/chatTransferReport/chatTransferReport.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x983b=['http','request','info','ChatTransferReport,\x20%s,\x20%s','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client'];(function(_0x5cd395,_0x507285){var _0x141227=function(_0x5893fe){while(--_0x5893fe){_0x5cd395['push'](_0x5cd395['shift']());}};_0x141227(++_0x507285);}(_0x983b,0x1af));var _0xb983=function(_0x1aac73,_0x5b9b95){_0x1aac73=_0x1aac73-0x0;var _0xce1c58=_0x983b[_0x1aac73];return _0xce1c58;};'use strict';var _=require(_0xb983('0x0'));var util=require(_0xb983('0x1'));var moment=require(_0xb983('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb983('0x3'));var db=require(_0xb983('0x4'))['db'];var utils=require(_0xb983('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0xb983('0x6'));var jayson=require(_0xb983('0x7'));var client=jayson[_0xb983('0x8')][_0xb983('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x58778e,_0xc4c66,_0x564fa5){return new BPromise(function(_0x17b9ed,_0x535138){return client[_0xb983('0xa')](_0x58778e,_0x564fa5)['then'](function(_0x1fa52d){logger[_0xb983('0xb')](_0xb983('0xc'),_0xc4c66,'request\x20sent');logger[_0xb983('0xd')](_0xb983('0xe'),_0xc4c66,_0xb983('0xf'),JSON['stringify'](_0x1fa52d));if(_0x1fa52d['error']){if(_0x1fa52d[_0xb983('0x10')][_0xb983('0x11')]===0x1f4){logger[_0xb983('0x10')](_0xb983('0xc'),_0xc4c66,_0x1fa52d[_0xb983('0x10')]['message']);return _0x535138(_0x1fa52d[_0xb983('0x10')][_0xb983('0x12')]);}logger[_0xb983('0x10')]('ChatTransferReport,\x20%s,\x20%s',_0xc4c66,_0x1fa52d[_0xb983('0x10')][_0xb983('0x12')]);return _0x17b9ed(_0x1fa52d['error'][_0xb983('0x12')]);}else{logger[_0xb983('0xb')](_0xb983('0xc'),_0xc4c66,_0xb983('0xf'));_0x17b9ed(_0x1fa52d[_0xb983('0x13')]['message']);}})['catch'](function(_0x5f349a){logger[_0xb983('0x10')](_0xb983('0xc'),_0xc4c66,_0x5f349a);_0x535138(_0x5f349a);});});}
\ No newline at end of file
+var _0x16e8=['util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','info','ChatTransferReport,\x20%s,\x20%s','request\x20sent','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','error','code','message','result'];(function(_0x4c8dce,_0x417943){var _0x5ac36a=function(_0x394c78){while(--_0x394c78){_0x4c8dce['push'](_0x4c8dce['shift']());}};_0x5ac36a(++_0x417943);}(_0x16e8,0x12c));var _0x816e=function(_0x5437de,_0x4b85a4){_0x5437de=_0x5437de-0x0;var _0x4a9101=_0x16e8[_0x5437de];return _0x4a9101;};'use strict';var _=require('lodash');var util=require(_0x816e('0x0'));var moment=require('moment');var BPromise=require(_0x816e('0x1'));var rs=require(_0x816e('0x2'));var fs=require('fs');var Redis=require(_0x816e('0x3'));var db=require(_0x816e('0x4'))['db'];var utils=require(_0x816e('0x5'));var logger=require(_0x816e('0x6'))('rpc');var config=require(_0x816e('0x7'));var jayson=require(_0x816e('0x8'));var client=jayson[_0x816e('0x9')][_0x816e('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5eff15,_0x37628b,_0x2db390){return new BPromise(function(_0x323783,_0x3891ae){return client['request'](_0x5eff15,_0x2db390)['then'](function(_0x7f8a9e){logger[_0x816e('0xb')](_0x816e('0xc'),_0x37628b,_0x816e('0xd'));logger[_0x816e('0xe')](_0x816e('0xf'),_0x37628b,_0x816e('0xd'),JSON['stringify'](_0x7f8a9e));if(_0x7f8a9e[_0x816e('0x10')]){if(_0x7f8a9e[_0x816e('0x10')][_0x816e('0x11')]===0x1f4){logger[_0x816e('0x10')](_0x816e('0xc'),_0x37628b,_0x7f8a9e[_0x816e('0x10')]['message']);return _0x3891ae(_0x7f8a9e[_0x816e('0x10')][_0x816e('0x12')]);}logger['error'](_0x816e('0xc'),_0x37628b,_0x7f8a9e['error'][_0x816e('0x12')]);return _0x323783(_0x7f8a9e['error']['message']);}else{logger[_0x816e('0xb')](_0x816e('0xc'),_0x37628b,_0x816e('0xd'));_0x323783(_0x7f8a9e[_0x816e('0x13')][_0x816e('0x12')]);}})['catch'](function(_0x964333){logger[_0x816e('0x10')](_0x816e('0xc'),_0x37628b,_0x964333);_0x3891ae(_0x964333);});});}
\ No newline at end of file
diff --git a/server/api/chatTransferReport/index.js b/server/api/chatTransferReport/index.js
index d0a4075..e6a7fe8 100644
--- a/server/api/chatTransferReport/index.js
+++ b/server/api/chatTransferReport/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xb10b=['../../config/environment','./chatTransferReport.controller','get','isAuthenticated','/describe','describe','/:id','show','post','create','update','delete','exports','multer','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service'];(function(_0xd49e15,_0x5e34ac){var _0x306b6a=function(_0x38ce9c){while(--_0x38ce9c){_0xd49e15['push'](_0xd49e15['shift']());}};_0x306b6a(++_0x5e34ac);}(_0xb10b,0x12a));var _0xbb10=function(_0x509d9e,_0x2d1197){_0x509d9e=_0x509d9e-0x0;var _0x56b488=_0xb10b[_0x509d9e];return _0x56b488;};'use strict';var multer=require(_0xbb10('0x0'));var util=require('util');var path=require(_0xbb10('0x1'));var timeout=require(_0xbb10('0x2'));var express=require(_0xbb10('0x3'));var router=express['Router']();var auth=require(_0xbb10('0x4'));var interaction=require(_0xbb10('0x5'));var config=require(_0xbb10('0x6'));var controller=require(_0xbb10('0x7'));router[_0xbb10('0x8')]('/',auth[_0xbb10('0x9')](),controller['index']);router[_0xbb10('0x8')](_0xbb10('0xa'),auth['isAuthenticated'](),controller[_0xbb10('0xb')]);router[_0xbb10('0x8')](_0xbb10('0xc'),auth[_0xbb10('0x9')](),controller[_0xbb10('0xd')]);router[_0xbb10('0xe')]('/',auth[_0xbb10('0x9')](),controller[_0xbb10('0xf')]);router['put']('/:id',auth[_0xbb10('0x9')](),controller[_0xbb10('0x10')]);router[_0xbb10('0x11')]('/:id',auth[_0xbb10('0x9')](),controller['destroy']);module[_0xbb10('0x12')]=router;
\ No newline at end of file
+var _0xb7e7=['multer','path','express','../../components/auth/service','../../config/environment','./chatTransferReport.controller','get','/describe','isAuthenticated','/:id','show','post','create','update','delete','destroy','exports'];(function(_0x31fb83,_0x1d22dc){var _0x44183f=function(_0x3aa1bb){while(--_0x3aa1bb){_0x31fb83['push'](_0x31fb83['shift']());}};_0x44183f(++_0x1d22dc);}(_0xb7e7,0x121));var _0x7b7e=function(_0xefd519,_0xc62635){_0xefd519=_0xefd519-0x0;var _0x4bb882=_0xb7e7[_0xefd519];return _0x4bb882;};'use strict';var multer=require(_0x7b7e('0x0'));var util=require('util');var path=require(_0x7b7e('0x1'));var timeout=require('connect-timeout');var express=require(_0x7b7e('0x2'));var router=express['Router']();var auth=require(_0x7b7e('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x7b7e('0x4'));var controller=require(_0x7b7e('0x5'));router[_0x7b7e('0x6')]('/',auth['isAuthenticated'](),controller['index']);router[_0x7b7e('0x6')](_0x7b7e('0x7'),auth[_0x7b7e('0x8')](),controller['describe']);router[_0x7b7e('0x6')](_0x7b7e('0x9'),auth[_0x7b7e('0x8')](),controller[_0x7b7e('0xa')]);router[_0x7b7e('0xb')]('/',auth[_0x7b7e('0x8')](),controller[_0x7b7e('0xc')]);router['put'](_0x7b7e('0x9'),auth[_0x7b7e('0x8')](),controller[_0x7b7e('0xd')]);router[_0x7b7e('0xe')](_0x7b7e('0x9'),auth[_0x7b7e('0x8')](),controller[_0x7b7e('0xf')]);module[_0x7b7e('0x10')]=router;
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.attributes.js b/server/api/chatWebsite/chatWebsite.attributes.js
index a1f7039..29bb87f 100644
--- a/server/api/chatWebsite/chatWebsite.attributes.js
+++ b/server/api/chatWebsite/chatWebsite.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x5455=['bottom_right','alternate','#fafafa','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDisposition','randomstring','exports','STRING','address','email','#011F6A','#ffffff','INTEGER','BOOLEAN','ENUM','rounded','squared','Chat','Send','Powered\x20by\x20xCALLY','TEXT','Form\x20properly\x20submitted','Form\x20submission\x20error','Note','Type\x20a\x20message','Thanks\x20you\x20for\x20your\x20time!','Skip','Feedback','thumb','star','input','name','getDataValue','onlineForm','parse','setDataValue','stringify','textarea','Comments','Leave\x20your\x20comments','offlineForm','generate','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.','New\x20offline\x20message\x20from\x20websiteName','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','Account:\x20{{account.name}} {{#queue}}Queue:\x20{{queue.name}} {{/queue}}From\x20:\x20{{from}}','website_alias'];(function(_0x29d4b5,_0x1913e2){var _0x3fbb01=function(_0x8b0a41){while(--_0x8b0a41){_0x29d4b5['push'](_0x29d4b5['shift']());}};_0x3fbb01(++_0x1913e2);}(_0x5455,0x197));var _0x5545=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x5455[_0xfae23b];return _0x200640;};'use strict';var Sequelize=require('sequelize');var rs=require(_0x5545('0x0'));module[_0x5545('0x1')]={'name':{'type':Sequelize[_0x5545('0x2')],'allowNull':![]},'address':{'type':Sequelize[_0x5545('0x2')],'allowNull':![],'unique':_0x5545('0x3')},'description':{'type':Sequelize[_0x5545('0x2')]},'mapKey':{'type':Sequelize[_0x5545('0x2')],'defaultValue':'email'},'mapKeyOffline':{'type':Sequelize['STRING'],'defaultValue':_0x5545('0x4')},'key':{'type':Sequelize[_0x5545('0x2')],'allowNull':![]},'agentAlias':{'type':Sequelize['STRING'],'defaultValue':'Agent'},'customerAlias':{'type':Sequelize[_0x5545('0x2')],'defaultValue':'Me'},'color':{'type':Sequelize[_0x5545('0x2')],'allowNull':![],'defaultValue':'#011F6A','validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0x5545('0x2')],'allowNull':![],'defaultValue':_0x5545('0x5'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x5545('0x6'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0x5545('0x7')],'defaultValue':0xf},'remote':{'type':Sequelize[_0x5545('0x2')]},'animation':{'type':Sequelize[_0x5545('0x8')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0x5545('0x9')](_0x5545('0xa'),_0x5545('0xb')),'defaultValue':_0x5545('0xa')},'header_online':{'type':Sequelize[_0x5545('0x2')],'defaultValue':'We\x20are\x20here!'},'start_chat_button':{'type':Sequelize['STRING'],'defaultValue':_0x5545('0xc')},'offline_chat_button':{'type':Sequelize[_0x5545('0x2')],'defaultValue':_0x5545('0xd')},'header_offline':{'type':Sequelize[_0x5545('0x2')],'defaultValue':'Contact\x20us'},'download_transcript':{'type':Sequelize[_0x5545('0x8')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0x5545('0x7')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize['STRING'],'defaultValue':_0x5545('0xe')},'defaultWhiteLabel':{'type':Sequelize[_0x5545('0x8')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0x5545('0xf')]},'closingQuestion':{'type':Sequelize[_0x5545('0x2')],'defaultValue':'Do\x20you\x20want\x20to\x20close\x20the\x20interaction?'},'formSubmitSuccessMessage':{'type':Sequelize[_0x5545('0x2')],'defaultValue':_0x5545('0x10')},'formSubmitFailureMessage':{'type':Sequelize[_0x5545('0x2')],'defaultValue':_0x5545('0x11')},'noteTitle':{'type':Sequelize[_0x5545('0x2')],'defaultValue':_0x5545('0x12')},'placeholderMessage':{'type':Sequelize[_0x5545('0x2')],'defaultValue':_0x5545('0x13')},'closingMessage':{'type':Sequelize[_0x5545('0x2')],'defaultValue':_0x5545('0x14')},'closingMessageButton':{'type':Sequelize[_0x5545('0x2')],'defaultValue':_0x5545('0xd')},'skipMessageButton':{'type':Sequelize['STRING'],'defaultValue':_0x5545('0x15')},'conditionAgreement':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableRating':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableFeedback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableSendButton':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0x5545('0x2')],'defaultValue':_0x5545('0x16')},'ratingType':{'type':Sequelize[_0x5545('0x9')]('star',_0x5545('0x17')),'defaultValue':_0x5545('0x18')},'ratingStarsNumber':{'type':Sequelize[_0x5545('0x7')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0x5545('0xf')],'defaultValue':function(){return JSON['stringify']({'items':[{'type':_0x5545('0x19'),'variable':null,'config':{'placeholder':_0x5545('0x1a'),'type':'text','required':!![]},'props':{'title':'name','helpText':''}},{'type':_0x5545('0x19'),'props':{'title':_0x5545('0x4'),'helpText':''},'config':{'required':!![],'placeholder':_0x5545('0x4'),'type':'email'},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0x5545('0x1b')](_0x5545('0x1c'))?JSON[_0x5545('0x1d')](this[_0x5545('0x1b')](_0x5545('0x1c'))):{};},'set':function(_0xc420f5){return this[_0x5545('0x1e')]('onlineForm',JSON['stringify'](_0xc420f5));}},'offlineForm':{'type':Sequelize[_0x5545('0xf')],'defaultValue':function(){return JSON[_0x5545('0x1f')]({'items':[{'type':_0x5545('0x19'),'props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':_0x5545('0x4'),'type':'email'},'variable':null},{'type':_0x5545('0x20'),'config':{'placeholder':_0x5545('0x21')},'props':{'title':_0x5545('0x21'),'helpText':_0x5545('0x22')}}],'fromKey':0x0});},'get':function(){return this['getDataValue'](_0x5545('0x23'))?JSON[_0x5545('0x1d')](this[_0x5545('0x1b')](_0x5545('0x23'))):{};},'set':function(_0x4113d6){return this['setDataValue'](_0x5545('0x23'),JSON[_0x5545('0x1f')](_0x4113d6));}},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0x5545('0x24')]();}},'autoclose':{'type':Sequelize[_0x5545('0x8')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0x5545('0x8')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0x5545('0x8')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0x5545('0x2')]},'forwardOffline':{'type':Sequelize[_0x5545('0x8')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0x5545('0x2')]},'waitingTitle':{'type':Sequelize[_0x5545('0x2')],'defaultValue':_0x5545('0x25')},'waitingMessage':{'type':Sequelize['STRING'],'defaultValue':_0x5545('0x26')},'offlineMessageSubject':{'type':Sequelize['STRING'],'defaultValue':_0x5545('0x27')},'offlineMessageBody':{'type':Sequelize[_0x5545('0x2')],'defaultValue':_0x5545('0x28')},'enableUnmanagedNote':{'type':Sequelize[_0x5545('0x8')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0x5545('0x2')],'defaultValue':'Your\x20request\x20has\x20not\x20been\x20processed.'},'skipUnmanaged':{'type':Sequelize[_0x5545('0x2')],'defaultValue':_0x5545('0x15')},'sendUnmanaged':{'type':Sequelize['STRING'],'defaultValue':_0x5545('0xd')},'enableCustomerAttachment':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0x5545('0x8')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0x5545('0xf')]},'showAgentAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timezone':{'type':Sequelize[_0x5545('0x2')]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0x5545('0x29');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0x5545('0x8')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0x5545('0x2')],'defaultValue':_0x5545('0x2a')},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0x5545('0x2')],'defaultValue':_0x5545('0x2b')},'verticalAlignment':{'type':Sequelize[_0x5545('0x7')],'defaultValue':0x1e},'messagesAlignment':{'type':Sequelize['STRING'],'defaultValue':_0x5545('0x2c')},'defaultTitle':{'type':Sequelize[_0x5545('0x2')]},'customerAvatar':{'type':Sequelize[_0x5545('0xf')]},'showCustomerAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0x5545('0x7')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0x5545('0x2')],'allowNull':![],'defaultValue':_0x5545('0x2d'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0x5545('0x8')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x5545('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x5545('0x8')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x5545('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0x5545('0x2')],'defaultValue':_0x5545('0x2e')},'systemAvatar':{'type':Sequelize[_0x5545('0xf')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x5545('0x7')],'comment':_0x5545('0x2f')},'mandatoryDisposition':{'type':Sequelize[_0x5545('0x8')],'defaultValue':![],'comment':_0x5545('0x30'),'set':function(_0x3932f5){if(!_0x3932f5)this[_0x5545('0x1e')]('mandatoryDispositionPauseId',null);this['setDataValue'](_0x5545('0x31'),_0x3932f5);}},'vidaooEscalation':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0x5545('0x2')],'defaultValue':![]}};
\ No newline at end of file
+var _0xfdcb=['Type\x20a\x20message','Thanks\x20you\x20for\x20your\x20time!','Feedback','star','thumb','name','text','input','getDataValue','onlineForm','parse','setDataValue','stringify','Comments','Leave\x20your\x20comments','offlineForm','generate','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','Your\x20request\x20has\x20not\x20been\x20processed.','Account:\x20{{account.name}} {{#queue}}Queue:\x20{{queue.name}} {{/queue}}From\x20:\x20{{from}}','bottom_right','alternate','#fafafa','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','randomstring','exports','STRING','address','email','Agent','#011F6A','#ffffff','INTEGER','ENUM','We\x20are\x20here!','Chat','Send','Contact\x20us','BOOLEAN','Powered\x20by\x20xCALLY','TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20submission\x20error','Note'];(function(_0xe86ad7,_0x4e34cd){var _0x45b33b=function(_0x186cea){while(--_0x186cea){_0xe86ad7['push'](_0xe86ad7['shift']());}};_0x45b33b(++_0x4e34cd);}(_0xfdcb,0x134));var _0xbfdc=function(_0x2242a1,_0x38f44d){_0x2242a1=_0x2242a1-0x0;var _0x2c298b=_0xfdcb[_0x2242a1];return _0x2c298b;};'use strict';var Sequelize=require(_0xbfdc('0x0'));var rs=require(_0xbfdc('0x1'));module[_0xbfdc('0x2')]={'name':{'type':Sequelize[_0xbfdc('0x3')],'allowNull':![]},'address':{'type':Sequelize[_0xbfdc('0x3')],'allowNull':![],'unique':_0xbfdc('0x4')},'description':{'type':Sequelize[_0xbfdc('0x3')]},'mapKey':{'type':Sequelize['STRING'],'defaultValue':'email'},'mapKeyOffline':{'type':Sequelize[_0xbfdc('0x3')],'defaultValue':_0xbfdc('0x5')},'key':{'type':Sequelize[_0xbfdc('0x3')],'allowNull':![]},'agentAlias':{'type':Sequelize['STRING'],'defaultValue':_0xbfdc('0x6')},'customerAlias':{'type':Sequelize[_0xbfdc('0x3')],'defaultValue':'Me'},'color':{'type':Sequelize[_0xbfdc('0x3')],'allowNull':![],'defaultValue':_0xbfdc('0x7'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0xbfdc('0x3')],'allowNull':![],'defaultValue':_0xbfdc('0x7'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xbfdc('0x8'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0xbfdc('0x9')],'defaultValue':0xf},'remote':{'type':Sequelize[_0xbfdc('0x3')]},'animation':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0xbfdc('0xa')]('rounded','squared'),'defaultValue':'rounded'},'header_online':{'type':Sequelize[_0xbfdc('0x3')],'defaultValue':_0xbfdc('0xb')},'start_chat_button':{'type':Sequelize[_0xbfdc('0x3')],'defaultValue':_0xbfdc('0xc')},'offline_chat_button':{'type':Sequelize['STRING'],'defaultValue':_0xbfdc('0xd')},'header_offline':{'type':Sequelize['STRING'],'defaultValue':_0xbfdc('0xe')},'download_transcript':{'type':Sequelize[_0xbfdc('0xf')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0xbfdc('0x9')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0xbfdc('0x3')],'defaultValue':_0xbfdc('0x10')},'defaultWhiteLabel':{'type':Sequelize[_0xbfdc('0xf')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0xbfdc('0x11')]},'closingQuestion':{'type':Sequelize[_0xbfdc('0x3')],'defaultValue':_0xbfdc('0x12')},'formSubmitSuccessMessage':{'type':Sequelize['STRING'],'defaultValue':'Form\x20properly\x20submitted'},'formSubmitFailureMessage':{'type':Sequelize[_0xbfdc('0x3')],'defaultValue':_0xbfdc('0x13')},'noteTitle':{'type':Sequelize[_0xbfdc('0x3')],'defaultValue':_0xbfdc('0x14')},'placeholderMessage':{'type':Sequelize[_0xbfdc('0x3')],'defaultValue':_0xbfdc('0x15')},'closingMessage':{'type':Sequelize[_0xbfdc('0x3')],'defaultValue':_0xbfdc('0x16')},'closingMessageButton':{'type':Sequelize[_0xbfdc('0x3')],'defaultValue':'Send'},'skipMessageButton':{'type':Sequelize['STRING'],'defaultValue':'Skip'},'conditionAgreement':{'type':Sequelize[_0xbfdc('0xf')],'defaultValue':![]},'enableRating':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableFeedback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0xbfdc('0xf')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0xbfdc('0x3')],'defaultValue':_0xbfdc('0x17')},'ratingType':{'type':Sequelize[_0xbfdc('0xa')](_0xbfdc('0x18'),_0xbfdc('0x19')),'defaultValue':_0xbfdc('0x18')},'ratingStarsNumber':{'type':Sequelize[_0xbfdc('0x9')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0xbfdc('0x11')],'defaultValue':function(){return JSON['stringify']({'items':[{'type':'input','variable':null,'config':{'placeholder':_0xbfdc('0x1a'),'type':_0xbfdc('0x1b'),'required':!![]},'props':{'title':_0xbfdc('0x1a'),'helpText':''}},{'type':_0xbfdc('0x1c'),'props':{'title':_0xbfdc('0x5'),'helpText':''},'config':{'required':!![],'placeholder':'email','type':_0xbfdc('0x5')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0xbfdc('0x1d')](_0xbfdc('0x1e'))?JSON[_0xbfdc('0x1f')](this[_0xbfdc('0x1d')](_0xbfdc('0x1e'))):{};},'set':function(_0x56ec58){return this[_0xbfdc('0x20')](_0xbfdc('0x1e'),JSON[_0xbfdc('0x21')](_0x56ec58));}},'offlineForm':{'type':Sequelize[_0xbfdc('0x11')],'defaultValue':function(){return JSON[_0xbfdc('0x21')]({'items':[{'type':_0xbfdc('0x1c'),'props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':_0xbfdc('0x5'),'type':_0xbfdc('0x5')},'variable':null},{'type':'textarea','config':{'placeholder':'Comments'},'props':{'title':_0xbfdc('0x22'),'helpText':_0xbfdc('0x23')}}],'fromKey':0x0});},'get':function(){return this[_0xbfdc('0x1d')]('offlineForm')?JSON['parse'](this[_0xbfdc('0x1d')](_0xbfdc('0x24'))):{};},'set':function(_0x4b2f7f){return this[_0xbfdc('0x20')](_0xbfdc('0x24'),JSON['stringify'](_0x4b2f7f));}},'token':{'type':Sequelize[_0xbfdc('0x3')],'defaultValue':function(){return rs[_0xbfdc('0x25')]();}},'autoclose':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0xbfdc('0xf')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0xbfdc('0xf')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0xbfdc('0x3')]},'forwardOffline':{'type':Sequelize[_0xbfdc('0xf')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0xbfdc('0x3')]},'waitingTitle':{'type':Sequelize[_0xbfdc('0x3')],'defaultValue':_0xbfdc('0x26')},'waitingMessage':{'type':Sequelize[_0xbfdc('0x3')],'defaultValue':'Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.'},'offlineMessageSubject':{'type':Sequelize[_0xbfdc('0x3')],'defaultValue':'New\x20offline\x20message\x20from\x20websiteName'},'offlineMessageBody':{'type':Sequelize[_0xbfdc('0x3')],'defaultValue':'You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:'},'enableUnmanagedNote':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0xbfdc('0x3')],'defaultValue':_0xbfdc('0x27')},'skipUnmanaged':{'type':Sequelize[_0xbfdc('0x3')],'defaultValue':'Skip'},'sendUnmanaged':{'type':Sequelize['STRING'],'defaultValue':'Send'},'enableCustomerAttachment':{'type':Sequelize[_0xbfdc('0xf')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0xbfdc('0xf')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0xbfdc('0x11')]},'showAgentAvatar':{'type':Sequelize[_0xbfdc('0xf')],'defaultValue':![]},'timezone':{'type':Sequelize[_0xbfdc('0x3')]},'notificationTemplate':{'type':Sequelize[_0xbfdc('0x11')],'defaultValue':function(){return _0xbfdc('0x28');}},'notificationSound':{'type':Sequelize[_0xbfdc('0xf')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0xbfdc('0x3')],'defaultValue':'website_alias'},'waitForTheAssignedAgent':{'type':Sequelize[_0xbfdc('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize['STRING'],'defaultValue':_0xbfdc('0x29')},'verticalAlignment':{'type':Sequelize[_0xbfdc('0x9')],'defaultValue':0x1e},'messagesAlignment':{'type':Sequelize[_0xbfdc('0x3')],'defaultValue':_0xbfdc('0x2a')},'defaultTitle':{'type':Sequelize[_0xbfdc('0x3')]},'customerAvatar':{'type':Sequelize[_0xbfdc('0x11')]},'showCustomerAvatar':{'type':Sequelize[_0xbfdc('0xf')],'defaultValue':![]},'messageFontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0xbfdc('0x3')],'allowNull':![],'defaultValue':_0xbfdc('0x2b'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0xbfdc('0xf')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xbfdc('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xbfdc('0xf')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xbfdc('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0xbfdc('0x3')],'defaultValue':'System'},'systemAvatar':{'type':Sequelize['TEXT']},'mandatoryDispositionPauseId':{'type':Sequelize[_0xbfdc('0x9')],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0xbfdc('0xf')],'defaultValue':![],'comment':_0xbfdc('0x2c'),'set':function(_0x3853a3){if(!_0x3853a3)this[_0xbfdc('0x20')](_0xbfdc('0x2d'),null);this[_0xbfdc('0x20')](_0xbfdc('0x2e'),_0x3853a3);}},'vidaooEscalation':{'type':Sequelize[_0xbfdc('0xf')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize['STRING'],'defaultValue':![]}};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.controller.js b/server/api/chatWebsite/chatWebsite.controller.js
index bcc1773..6e3ad4d 100644
--- a/server/api/chatWebsite/chatWebsite.controller.js
+++ b/server/api/chatWebsite/chatWebsite.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9477=['mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','findOrCreate','readFileSync','server/files/templates/chatOfflineMessage.ejs','render','toPairs','offlineMessageBody','ChatOfflineMessage','MailAccount','Smtp','service','host','port','secure','auth','user','pass','SendMail','sendMail','\x22%s\x22\x20<%s>','email','forwardOfflineAddress','addInteraction','omit','getInteractions','Contact','Owner','fullname','Tag','Tags','color','tag','getSnippet','timezone','interval','iftime\x20%s','indexOf','ONLINE','OFFLINE','No\x20timezone','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','inspect','Interval','Intervals','getProactiveActions','License','increment','chatLicenseExceeded','push','some','server/files/chat/iframe.js','utf8','x-real-ip','remoteAddress','alignment','verticalAlignment','textColor','addApplications','transaction','findAndCountAll','getApplications','chatProactiveAction','ChatProactiveAction','getFields','online','false','offlineForm','items','fromKey','addAgents','emit','userChatWebsite:save','removeAgents','isArray','userChatWebsite:remove','getAgents','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./chatWebsite.socket','register','jayson/promise','client','http','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','sendStatus','status','end','json','count','offset','limit','set','apply','save','update','get','ChatWebsites','UserProfileResource','destroy','stack','name','send','index','Pause','map','ChatWebsite','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','nolimit','order','sort','pick','where','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','mandatoryDispositionPause','length','find','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','params','describe','ChatWebsiteId','Disposition','getDispositions','findOne','hasOwnProperty','removeDispositions','CannedAnswer','create','getAnswers','removeAnswers','ids','sitepic','addAvatar','agentAvatar','file','addCustomerAvatar','customerAvatar','filename','addSystemAvatar','systemAvatar','getLogo','join','root','../../config/license/util','getLicense','custom','isNil','existsSync','server/files/images/logos/','getAvatar','server/files/images/avatars/default_avatar.png','server/files/images/avatars/','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','download','server/files/images/avatars/system_avatar.png','notify','headers','user-agent','getResult','CmContact','no\x20available\x20attributes','difference','updatedAt','createdAt','CompanyId','ListId','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey','CmList','Contacts','DESC','ChatApplication','List','account','applications','Applications','list','orderBy','priority','asc','contact','customerIp','cf-connecting-ip','x-forwarded-for','first','split','firstName','lastName','x-real-port','referer','browser','version','format','%s\x20%s','unknown','device','vendor','%s\x20%s\x20%s','threadId','ChatInteraction','externalUrl','interaction','spread','messageId','created','autoclose','unmanaged','*,*,*,*','ChatMessage','AttachmentId','UserId','User','unshift','agent','waitForTheAssignedAgent','forcedOwnership','Start','startRouting','EventManager','offline'];(function(_0x4409e7,_0x307f17){var _0x24c751=function(_0x3a7d33){while(--_0x3a7d33){_0x4409e7['push'](_0x4409e7['shift']());}};_0x24c751(++_0x307f17);}(_0x9477,0x16f));var _0x7947=function(_0x1bbe35,_0x5e271b){_0x1bbe35=_0x1bbe35-0x0;var _0x4e11d7=_0x9477[_0x1bbe35];return _0x4e11d7;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x7947('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x7947('0x1'));var moment=require(_0x7947('0x2'));var BPromise=require(_0x7947('0x3'));var Mustache=require(_0x7947('0x4'));var util=require(_0x7947('0x5'));var path=require(_0x7947('0x6'));var sox=require(_0x7947('0x7'));var csv=require(_0x7947('0x8'));var ejs=require(_0x7947('0x9'));var fs=require('fs');var _=require(_0x7947('0xa'));var squel=require(_0x7947('0xb'));var crypto=require(_0x7947('0xc'));var jsforce=require(_0x7947('0xd'));var deskjs=require(_0x7947('0xe'));var toCsv=require(_0x7947('0x8'));var querystring=require(_0x7947('0xf'));var Papa=require('papaparse');var Redis=require(_0x7947('0x10'));var authService=require(_0x7947('0x11'));var qs=require(_0x7947('0x12'));var as=require(_0x7947('0x13'));var hardwareService=require(_0x7947('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0x7947('0x15'));var config=require(_0x7947('0x16'));var db=require(_0x7947('0x17'))['db'];config['redis']=_[_0x7947('0x18')](config[_0x7947('0x19')],{'host':_0x7947('0x1a'),'port':0x18eb});var socket=require(_0x7947('0x1b'))(new Redis(config[_0x7947('0x19')]));require(_0x7947('0x1c'))[_0x7947('0x1d')](socket);var jayson=require(_0x7947('0x1e'));var client=jayson[_0x7947('0x1f')]['http']({'port':0x232c});var client9002=jayson[_0x7947('0x1f')][_0x7947('0x20')]({'port':0x232a});var client9003=jayson[_0x7947('0x1f')][_0x7947('0x20')]({'port':0x232b});function checkPasswordPattern(_0x83f236,_0x360594,_0x3679b1){if(_0x3679b1){var _0x539fe4=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x539fe4[_0x7947('0x21')](_0x360594)){return _0x83f236;}else{throw new db[(_0x7947('0x22'))][(_0x7947('0x23'))](_0x7947('0x24'));}}else{return _0x83f236;}}function respondWithRpcPromise(_0x1088a9,_0x5cb119,_0x57d88a,_0x263ec7){return new BPromise(function(_0x1226f9,_0x1219af){var _0x1fe444=_0x263ec7||client;return _0x1fe444[_0x7947('0x25')](_0x1088a9,_0x57d88a)[_0x7947('0x26')](function(_0x28f1b7){logger[_0x7947('0x27')](_0x7947('0x28'),_0x5cb119,_0x7947('0x29'));logger['debug']('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x5cb119,_0x7947('0x29'),JSON[_0x7947('0x2a')](_0x28f1b7));if(_0x28f1b7['error']){if(_0x28f1b7[_0x7947('0x2b')]['code']===0x1f4){logger[_0x7947('0x2b')](_0x7947('0x28'),_0x5cb119,_0x28f1b7['error'][_0x7947('0x2c')]);return _0x1219af(_0x28f1b7[_0x7947('0x2b')][_0x7947('0x2c')]);}logger[_0x7947('0x2b')](_0x7947('0x28'),_0x5cb119,_0x28f1b7[_0x7947('0x2b')][_0x7947('0x2c')]);return _0x1226f9(_0x28f1b7[_0x7947('0x2b')]['message']);}else{logger['info'](_0x7947('0x28'),_0x5cb119,_0x7947('0x29'));_0x1226f9(_0x28f1b7[_0x7947('0x2d')]['message']);}})['catch'](function(_0x5a47e4){logger['error'](_0x7947('0x28'),_0x5cb119,_0x5a47e4);_0x1219af(_0x5a47e4);});});}function respondWithStatusCode(_0x25bced,_0xbbb8f0){_0xbbb8f0=_0xbbb8f0||0xcc;return function(_0x598bd9){if(_0x598bd9){return _0x25bced[_0x7947('0x2e')](_0xbbb8f0);}return _0x25bced[_0x7947('0x2f')](_0xbbb8f0)[_0x7947('0x30')]();};}function respondWithResult(_0x3a0d41,_0x211d21){_0x211d21=_0x211d21||0xc8;return function(_0x2e350d){if(_0x2e350d){return _0x3a0d41['status'](_0x211d21)[_0x7947('0x31')](_0x2e350d);}};}function respondWithFilteredResult(_0x15bc51,_0x172512){return function(_0xaa6c6a){if(_0xaa6c6a){var _0x201e15=_0xaa6c6a[_0x7947('0x32')],_0x2be2dd=_0x172512[_0x7947('0x33')],_0x4ee9eb=_0x172512[_0x7947('0x33')]+_0x172512[_0x7947('0x34')],_0x57a0c0;if(_0x4ee9eb>=_0x201e15){_0x4ee9eb=_0x201e15;_0x57a0c0=0xc8;}else{_0x57a0c0=0xce;}_0x15bc51['status'](_0x57a0c0);return _0x15bc51[_0x7947('0x35')]('Content-Range',_0x2be2dd+'-'+_0x4ee9eb+'/'+_0x201e15)[_0x7947('0x31')](_0xaa6c6a);}return null;};}function patchUpdates(_0x3d663c){return function(_0x82d363){try{jsonpatch[_0x7947('0x36')](_0x82d363,_0x3d663c,!![]);}catch(_0x3b4f0a){return BPromise['reject'](_0x3b4f0a);}return _0x82d363[_0x7947('0x37')]();};}function saveUpdates(_0x47c979,_0x4ea4d0){return function(_0x4c787c){if(_0x4c787c){return _0x4c787c[_0x7947('0x38')](_0x47c979)['then'](function(_0x3de322){return _0x3de322;});}return null;};}function removeEntity(_0x12e130,_0x587ae7){return function(_0x19e447){if(_0x19e447){return _0x19e447['destroy']()[_0x7947('0x26')](function(){var _0x5bbddc=_0x19e447[_0x7947('0x39')]({'plain':!![]});var _0x27c1f0=_0x7947('0x3a');return db[_0x7947('0x3b')][_0x7947('0x3c')]({'where':{'type':_0x27c1f0,'resourceId':_0x5bbddc['id']}})['then'](function(){return _0x19e447;});})[_0x7947('0x26')](function(){_0x12e130['status'](0xcc)[_0x7947('0x30')]();});}};}function handleEntityNotFound(_0x5afc65,_0xfd1fa0){return function(_0x245559){if(!_0x245559){_0x5afc65[_0x7947('0x2e')](0x194);}return _0x245559;};}function handleError(_0x135d82,_0x244cf0){_0x244cf0=_0x244cf0||0x1f4;return function(_0x440872){logger[_0x7947('0x2b')](_0x440872[_0x7947('0x3d')]);if(_0x440872['name']){delete _0x440872[_0x7947('0x3e')];}_0x135d82[_0x7947('0x2f')](_0x244cf0)[_0x7947('0x3f')](_0x440872);};}exports[_0x7947('0x40')]=function(_0x4e1b80,_0xfde982){var _0xc418ba={'include':[{'model':db[_0x7947('0x41')],'as':'mandatoryDispositionPause'}]},_0x226fc9={},_0x429cff={'count':0x0,'rows':[]};var _0x59c9f1=_[_0x7947('0x42')](db[_0x7947('0x43')][_0x7947('0x44')],function(_0x14fe76){return{'name':_0x14fe76[_0x7947('0x45')],'type':_0x14fe76[_0x7947('0x46')][_0x7947('0x47')]};});_0x226fc9[_0x7947('0x48')]=_[_0x7947('0x42')](_0x59c9f1,_0x7947('0x3e'));_0x226fc9[_0x7947('0x49')]=_[_0x7947('0x4a')](_0x4e1b80[_0x7947('0x49')]);_0x226fc9[_0x7947('0x4b')]=_[_0x7947('0x4c')](_0x226fc9[_0x7947('0x48')],_0x226fc9[_0x7947('0x49')]);_0xc418ba[_0x7947('0x4d')]=_[_0x7947('0x4c')](_0x226fc9[_0x7947('0x48')],qs['fields'](_0x4e1b80[_0x7947('0x49')][_0x7947('0x4e')]));_0xc418ba['attributes']=_0xc418ba[_0x7947('0x4d')]['length']?_0xc418ba[_0x7947('0x4d')]:_0x226fc9['model'];if(!_0x4e1b80['query']['hasOwnProperty'](_0x7947('0x4f'))){_0xc418ba[_0x7947('0x34')]=qs['limit'](_0x4e1b80[_0x7947('0x49')][_0x7947('0x34')]);_0xc418ba[_0x7947('0x33')]=qs[_0x7947('0x33')](_0x4e1b80['query'][_0x7947('0x33')]);}_0xc418ba[_0x7947('0x50')]=qs[_0x7947('0x51')](_0x4e1b80[_0x7947('0x49')][_0x7947('0x51')]);_0xc418ba['where']=qs['filters'](_[_0x7947('0x52')](_0x4e1b80['query'],_0x226fc9[_0x7947('0x4b')]),_0x59c9f1);if(_0x4e1b80[_0x7947('0x49')]['filter']){_0xc418ba[_0x7947('0x53')]=_[_0x7947('0x54')](_0xc418ba['where'],{'$or':_[_0x7947('0x42')](_0x59c9f1,function(_0x5c6d2d){if(_0x5c6d2d[_0x7947('0x46')]!==_0x7947('0x55')){var _0x4df42e={};_0x4df42e[_0x5c6d2d['name']]={'$like':'%'+_0x4e1b80[_0x7947('0x49')][_0x7947('0x56')]+'%'};return _0x4df42e;}})});}_0xc418ba=_[_0x7947('0x54')]({},_0xc418ba,_0x4e1b80[_0x7947('0x57')]);var _0x3d827b={'where':_0xc418ba[_0x7947('0x53')]};return db[_0x7947('0x43')][_0x7947('0x32')](_0x3d827b)['then'](function(_0x371311){_0x429cff[_0x7947('0x32')]=_0x371311;if(_0x4e1b80[_0x7947('0x49')][_0x7947('0x58')]){_0xc418ba[_0x7947('0x59')]=[{'all':!![]}];}return db[_0x7947('0x43')][_0x7947('0x5a')](_0xc418ba);})[_0x7947('0x26')](function(_0xc7a638){_0x429cff[_0x7947('0x5b')]=_0xc7a638;return _0x429cff;})[_0x7947('0x26')](respondWithFilteredResult(_0xfde982,_0xc418ba))[_0x7947('0x5c')](handleError(_0xfde982,null));};exports[_0x7947('0x5d')]=function(_0x3d856a,_0x19c4e8){var _0x2a1df9={'raw':![],'where':{'id':_0x3d856a['params']['id']},'include':[{'model':db['Pause'],'as':_0x7947('0x5e')}]},_0x24db4a={};_0x24db4a[_0x7947('0x48')]=_['keys'](db['ChatWebsite'][_0x7947('0x44')]);_0x24db4a[_0x7947('0x49')]=_['keys'](_0x3d856a[_0x7947('0x49')]);_0x24db4a[_0x7947('0x4b')]=_[_0x7947('0x4c')](_0x24db4a['model'],_0x24db4a[_0x7947('0x49')]);_0x2a1df9[_0x7947('0x4d')]=_[_0x7947('0x4c')](_0x24db4a['model'],qs[_0x7947('0x4e')](_0x3d856a[_0x7947('0x49')][_0x7947('0x4e')]));_0x2a1df9['attributes']=_0x2a1df9[_0x7947('0x4d')][_0x7947('0x5f')]?_0x2a1df9['attributes']:_0x24db4a[_0x7947('0x48')];if(_0x3d856a['query'][_0x7947('0x58')]){_0x2a1df9[_0x7947('0x59')]=[{'all':!![]}];}_0x2a1df9=_['merge']({},_0x2a1df9,_0x3d856a[_0x7947('0x57')]);return db['ChatWebsite'][_0x7947('0x60')](_0x2a1df9)[_0x7947('0x26')](handleEntityNotFound(_0x19c4e8,null))['then'](respondWithResult(_0x19c4e8,null))[_0x7947('0x5c')](handleError(_0x19c4e8,null));};exports['create']=function(_0x1fd79d,_0x1bafef){return db[_0x7947('0x43')]['create'](_0x1fd79d[_0x7947('0x61')],{})[_0x7947('0x26')](function(_0x215dd5){var _0x3477e4=_0x1fd79d['user'][_0x7947('0x39')]({'plain':!![]});if(!_0x3477e4)throw new Error(_0x7947('0x62'));if(_0x3477e4[_0x7947('0x63')]==='user'){var _0x29eae6=_0x215dd5[_0x7947('0x39')]({'plain':!![]});var _0x23e2f6='ChatWebsites';return db[_0x7947('0x64')]['find']({'where':{'name':_0x23e2f6,'userProfileId':_0x3477e4[_0x7947('0x65')]},'raw':!![]})[_0x7947('0x26')](function(_0x5a19c7){if(_0x5a19c7&&_0x5a19c7[_0x7947('0x66')]===0x0){return db[_0x7947('0x3b')]['create']({'name':_0x29eae6[_0x7947('0x3e')],'resourceId':_0x29eae6['id'],'type':_0x5a19c7[_0x7947('0x3e')],'sectionId':_0x5a19c7['id']},{})[_0x7947('0x26')](function(){return _0x215dd5;});}else{return _0x215dd5;}})['catch'](function(_0x1dcd0c){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1dcd0c);throw _0x1dcd0c;});}return _0x215dd5;})[_0x7947('0x26')](respondWithResult(_0x1bafef,0xc9))[_0x7947('0x5c')](handleError(_0x1bafef,null));};exports[_0x7947('0x38')]=function(_0x514a11,_0xbe3644){if(_0x514a11[_0x7947('0x61')]['id']){delete _0x514a11['body']['id'];}return db[_0x7947('0x43')][_0x7947('0x60')]({'where':{'id':_0x514a11[_0x7947('0x67')]['id']},'include':[{'model':db[_0x7947('0x41')],'as':'mandatoryDispositionPause'}]})[_0x7947('0x26')](handleEntityNotFound(_0xbe3644,null))[_0x7947('0x26')](saveUpdates(_0x514a11[_0x7947('0x61')],null))[_0x7947('0x26')](respondWithResult(_0xbe3644,null))[_0x7947('0x5c')](handleError(_0xbe3644,null));};exports[_0x7947('0x3c')]=function(_0x3ea117,_0x3085b9){return db[_0x7947('0x43')][_0x7947('0x60')]({'where':{'id':_0x3ea117[_0x7947('0x67')]['id']}})[_0x7947('0x26')](handleEntityNotFound(_0x3085b9,null))['then'](removeEntity(_0x3085b9,null))[_0x7947('0x5c')](handleError(_0x3085b9,null));};exports['describe']=function(_0x5f20f3,_0x2d3a17){return db['ChatWebsite'][_0x7947('0x68')]()['then'](respondWithResult(_0x2d3a17,null))[_0x7947('0x5c')](handleError(_0x2d3a17,null));};exports['addDisposition']=function(_0x1dd6cd,_0x1a7f4a,_0x4ac864){if(_0x1dd6cd[_0x7947('0x61')]['id']){delete _0x1dd6cd[_0x7947('0x61')]['id'];}return db[_0x7947('0x43')][_0x7947('0x60')]({'where':{'id':_0x1dd6cd[_0x7947('0x67')]['id']}})[_0x7947('0x26')](handleEntityNotFound(_0x1a7f4a,null))[_0x7947('0x26')](function(_0x1229d3){if(_0x1229d3){_0x1dd6cd[_0x7947('0x61')][_0x7947('0x69')]=_0x1229d3['id'];return db[_0x7947('0x6a')]['create'](_0x1dd6cd[_0x7947('0x61')]);}})[_0x7947('0x26')](respondWithResult(_0x1a7f4a,null))[_0x7947('0x5c')](handleError(_0x1a7f4a,null));};exports[_0x7947('0x6b')]=function(_0x11d6d6,_0xc8c4ed,_0x2bd717){var _0x562a83={'raw':![],'where':{}};var _0x373e18={};var _0x2c6a5b={'count':0x0,'rows':[]};return db[_0x7947('0x43')][_0x7947('0x6c')]({'where':{'id':_0x11d6d6[_0x7947('0x67')]['id']}})[_0x7947('0x26')](handleEntityNotFound(_0xc8c4ed,null))['then'](function(_0x1a6b0b){if(_0x1a6b0b){_0x373e18[_0x7947('0x48')]=_[_0x7947('0x4a')](db[_0x7947('0x6a')][_0x7947('0x44')]);_0x373e18[_0x7947('0x49')]=_[_0x7947('0x4a')](_0x11d6d6[_0x7947('0x49')]);_0x373e18[_0x7947('0x4b')]=_[_0x7947('0x4c')](_0x373e18['model'],_0x373e18['query']);_0x562a83['attributes']=_['intersection'](_0x373e18[_0x7947('0x48')],qs[_0x7947('0x4e')](_0x11d6d6['query']['fields']));_0x562a83[_0x7947('0x4d')]=_0x562a83[_0x7947('0x4d')][_0x7947('0x5f')]?_0x562a83[_0x7947('0x4d')]:_0x373e18[_0x7947('0x48')];if(!_0x11d6d6['query'][_0x7947('0x6d')](_0x7947('0x4f'))){_0x562a83[_0x7947('0x34')]=qs[_0x7947('0x34')](_0x11d6d6['query'][_0x7947('0x34')]);_0x562a83[_0x7947('0x33')]=qs[_0x7947('0x33')](_0x11d6d6['query'][_0x7947('0x33')]);}_0x562a83[_0x7947('0x50')]=qs[_0x7947('0x51')](_0x11d6d6[_0x7947('0x49')][_0x7947('0x51')]);_0x562a83[_0x7947('0x53')]=qs[_0x7947('0x4b')](_[_0x7947('0x52')](_0x11d6d6[_0x7947('0x49')],_0x373e18[_0x7947('0x4b')]));_0x562a83[_0x7947('0x53')][_0x7947('0x69')]=_0x1a6b0b['id'];if(_0x11d6d6[_0x7947('0x49')][_0x7947('0x56')]){_0x562a83[_0x7947('0x53')]=_['merge'](_0x562a83[_0x7947('0x53')],{'$or':_[_0x7947('0x42')](_0x562a83[_0x7947('0x4d')],function(_0x2f9370){var _0x4f1b15={};_0x4f1b15[_0x2f9370]={'$like':'%'+_0x11d6d6[_0x7947('0x49')][_0x7947('0x56')]+'%'};return _0x4f1b15;})});}_0x562a83=_[_0x7947('0x54')]({},_0x562a83,_0x11d6d6['options']);return db[_0x7947('0x6a')][_0x7947('0x32')]({'where':_0x562a83[_0x7947('0x53')]})['then'](function(_0x5247fe){_0x2c6a5b['count']=_0x5247fe;if(_0x11d6d6[_0x7947('0x49')][_0x7947('0x58')]){_0x562a83['include']=[{'all':!![]}];}return db['Disposition'][_0x7947('0x5a')](_0x562a83);})[_0x7947('0x26')](function(_0x5c3f38){_0x2c6a5b[_0x7947('0x5b')]=_0x5c3f38;return _0x2c6a5b;});}})[_0x7947('0x26')](respondWithFilteredResult(_0xc8c4ed,_0x562a83))[_0x7947('0x5c')](handleError(_0xc8c4ed,null));};exports[_0x7947('0x6e')]=function(_0x50cde6,_0x10ee7b,_0x31cbe7){return db[_0x7947('0x43')][_0x7947('0x60')]({'where':{'id':_0x50cde6[_0x7947('0x67')]['id']}})['then'](handleEntityNotFound(_0x10ee7b,null))[_0x7947('0x26')](function(_0x50357d){if(_0x50357d){return _0x50357d['removeDispositions'](_0x50cde6[_0x7947('0x49')]['ids']);}})[_0x7947('0x26')](respondWithStatusCode(_0x10ee7b,null))['catch'](handleError(_0x10ee7b,null));};exports['addAnswer']=function(_0x26fd5e,_0x24ec18,_0x39d370){if(_0x26fd5e[_0x7947('0x61')]['id']){delete _0x26fd5e[_0x7947('0x61')]['id'];}return db['ChatWebsite']['find']({'where':{'id':_0x26fd5e['params']['id']}})[_0x7947('0x26')](handleEntityNotFound(_0x24ec18,null))[_0x7947('0x26')](function(_0x5ea15d){if(_0x5ea15d){_0x26fd5e[_0x7947('0x61')]['ChatWebsiteId']=_0x5ea15d['id'];return db[_0x7947('0x6f')][_0x7947('0x70')](_0x26fd5e[_0x7947('0x61')]);}})['then'](respondWithResult(_0x24ec18,null))[_0x7947('0x5c')](handleError(_0x24ec18,null));};exports[_0x7947('0x71')]=function(_0x5bdcd5,_0x461e86,_0x35b572){var _0x2a62e0={'raw':![],'where':{}};var _0x10990b={};var _0x316fe3={'count':0x0,'rows':[]};return db[_0x7947('0x43')][_0x7947('0x6c')]({'where':{'id':_0x5bdcd5[_0x7947('0x67')]['id']}})[_0x7947('0x26')](handleEntityNotFound(_0x461e86,null))[_0x7947('0x26')](function(_0x5c9c72){if(_0x5c9c72){_0x10990b[_0x7947('0x48')]=_[_0x7947('0x4a')](db['CannedAnswer'][_0x7947('0x44')]);_0x10990b[_0x7947('0x49')]=_[_0x7947('0x4a')](_0x5bdcd5[_0x7947('0x49')]);_0x10990b['filters']=_[_0x7947('0x4c')](_0x10990b[_0x7947('0x48')],_0x10990b[_0x7947('0x49')]);_0x2a62e0['attributes']=_[_0x7947('0x4c')](_0x10990b['model'],qs['fields'](_0x5bdcd5['query'][_0x7947('0x4e')]));_0x2a62e0[_0x7947('0x4d')]=_0x2a62e0[_0x7947('0x4d')][_0x7947('0x5f')]?_0x2a62e0[_0x7947('0x4d')]:_0x10990b[_0x7947('0x48')];if(!_0x5bdcd5[_0x7947('0x49')]['hasOwnProperty'](_0x7947('0x4f'))){_0x2a62e0[_0x7947('0x34')]=qs[_0x7947('0x34')](_0x5bdcd5['query'][_0x7947('0x34')]);_0x2a62e0['offset']=qs[_0x7947('0x33')](_0x5bdcd5[_0x7947('0x49')][_0x7947('0x33')]);}_0x2a62e0[_0x7947('0x50')]=qs[_0x7947('0x51')](_0x5bdcd5[_0x7947('0x49')]['sort']);_0x2a62e0[_0x7947('0x53')]=qs['filters'](_[_0x7947('0x52')](_0x5bdcd5['query'],_0x10990b[_0x7947('0x4b')]));_0x2a62e0[_0x7947('0x53')][_0x7947('0x69')]=_0x5c9c72['id'];if(_0x5bdcd5[_0x7947('0x49')][_0x7947('0x56')]){_0x2a62e0[_0x7947('0x53')]=_[_0x7947('0x54')](_0x2a62e0[_0x7947('0x53')],{'$or':_[_0x7947('0x42')](_0x2a62e0['attributes'],function(_0x5f1fb1){var _0x778c4c={};_0x778c4c[_0x5f1fb1]={'$like':'%'+_0x5bdcd5[_0x7947('0x49')][_0x7947('0x56')]+'%'};return _0x778c4c;})});}_0x2a62e0=_[_0x7947('0x54')]({},_0x2a62e0,_0x5bdcd5['options']);return db[_0x7947('0x6f')][_0x7947('0x32')]({'where':_0x2a62e0[_0x7947('0x53')]})[_0x7947('0x26')](function(_0x483374){_0x316fe3[_0x7947('0x32')]=_0x483374;if(_0x5bdcd5[_0x7947('0x49')][_0x7947('0x58')]){_0x2a62e0['include']=[{'all':!![]}];}return db[_0x7947('0x6f')][_0x7947('0x5a')](_0x2a62e0);})[_0x7947('0x26')](function(_0x325f01){_0x316fe3[_0x7947('0x5b')]=_0x325f01;return _0x316fe3;});}})['then'](respondWithFilteredResult(_0x461e86,_0x2a62e0))[_0x7947('0x5c')](handleError(_0x461e86,null));};exports[_0x7947('0x72')]=function(_0x5ae70d,_0x84799,_0x5f5920){return db[_0x7947('0x43')][_0x7947('0x60')]({'where':{'id':_0x5ae70d[_0x7947('0x67')]['id']}})[_0x7947('0x26')](handleEntityNotFound(_0x84799,null))[_0x7947('0x26')](function(_0x5ff10c){if(_0x5ff10c){return _0x5ff10c[_0x7947('0x72')](_0x5ae70d[_0x7947('0x49')][_0x7947('0x73')]);}})[_0x7947('0x26')](respondWithStatusCode(_0x84799,null))[_0x7947('0x5c')](handleError(_0x84799,null));};exports['addLogo']=function(_0xbf73,_0x9d0e87,_0x4ac1c9){_0xbf73[_0x7947('0x61')][_0x7947('0x74')]=_0xbf73['file']['filename'];return db[_0x7947('0x43')][_0x7947('0x60')]({'where':{'id':_0xbf73['params']['id']}})[_0x7947('0x26')](handleEntityNotFound(_0x9d0e87,null))[_0x7947('0x26')](saveUpdates(_0xbf73[_0x7947('0x61')],null))[_0x7947('0x26')](respondWithResult(_0x9d0e87,null))[_0x7947('0x5c')](handleError(_0x9d0e87,null));};exports[_0x7947('0x75')]=function(_0x41e693,_0x471979,_0x50a32a){_0x41e693['body'][_0x7947('0x76')]=_0x41e693[_0x7947('0x77')]['filename'];return db[_0x7947('0x43')]['find']({'where':{'id':_0x41e693[_0x7947('0x67')]['id']}})['then'](handleEntityNotFound(_0x471979,null))[_0x7947('0x26')](saveUpdates(_0x41e693[_0x7947('0x61')],null))[_0x7947('0x26')](respondWithResult(_0x471979,null))[_0x7947('0x5c')](handleError(_0x471979,null));};exports[_0x7947('0x78')]=function(_0x37a79b,_0x45bd6e,_0x5033b0){_0x37a79b[_0x7947('0x61')][_0x7947('0x79')]=_0x37a79b[_0x7947('0x77')][_0x7947('0x7a')];return db[_0x7947('0x43')][_0x7947('0x60')]({'where':{'id':_0x37a79b[_0x7947('0x67')]['id']}})['then'](handleEntityNotFound(_0x45bd6e,null))[_0x7947('0x26')](saveUpdates(_0x37a79b[_0x7947('0x61')],null))['then'](respondWithResult(_0x45bd6e,null))[_0x7947('0x5c')](handleError(_0x45bd6e,null));};exports[_0x7947('0x7b')]=function(_0x176ff4,_0xdb0e6f,_0x53a4cb){_0x176ff4[_0x7947('0x61')][_0x7947('0x7c')]=_0x176ff4[_0x7947('0x77')][_0x7947('0x7a')];return db['ChatWebsite'][_0x7947('0x60')]({'where':{'id':_0x176ff4['params']['id']}})[_0x7947('0x26')](handleEntityNotFound(_0xdb0e6f,null))[_0x7947('0x26')](saveUpdates(_0x176ff4[_0x7947('0x61')],null))['then'](respondWithResult(_0xdb0e6f,null))[_0x7947('0x5c')](handleError(_0xdb0e6f,null));};exports[_0x7947('0x7d')]=function(_0xc9a98e,_0x3e4895,_0xdf508c){var _0x507f80=path[_0x7947('0x7e')](config[_0x7947('0x7f')],'server/files/images/logos/default_logo.svg');var _0x3341d9={'where':{'id':_0xc9a98e['params']['id']},'attributes':['id',_0x7947('0x74')],'raw':!![]};var _0x370d5d=![];return require(_0x7947('0x80'))[_0x7947('0x81')]()['then'](function(_0x5737b7){if(_0x5737b7){_0x370d5d=_0x5737b7[_0x7947('0x82')];}})[_0x7947('0x26')](function(){return db[_0x7947('0x43')][_0x7947('0x60')](_0x3341d9);})[_0x7947('0x26')](handleEntityNotFound(_0x3e4895,null))[_0x7947('0x26')](function(_0x33f098){if(_0x33f098){if(!_[_0x7947('0x83')](_0x33f098[_0x7947('0x74')])){if(fs[_0x7947('0x84')](path[_0x7947('0x7e')](config[_0x7947('0x7f')],_0x7947('0x85'),_0x33f098['sitepic']))&&_0x370d5d){_0x507f80=path['join'](config[_0x7947('0x7f')],_0x7947('0x85'),_0x33f098[_0x7947('0x74')]);}}return _0x3e4895['download'](_0x507f80);}})['catch'](handleError(_0x3e4895,null));};exports[_0x7947('0x86')]=function(_0x1ef57e,_0x1ebe34,_0x4f92c1){var _0x1c00dc=path['join'](config['root'],_0x7947('0x87'));var _0x15363d={'where':{'id':_0x1ef57e[_0x7947('0x67')]['id']},'attributes':['id','agentAvatar'],'raw':!![]};return db[_0x7947('0x43')][_0x7947('0x60')](_0x15363d)[_0x7947('0x26')](handleEntityNotFound(_0x1ebe34,null))['then'](function(_0x39b9f9){if(_0x39b9f9){if(!_['isNil'](_0x39b9f9[_0x7947('0x76')])){if(fs[_0x7947('0x84')](path[_0x7947('0x7e')](config[_0x7947('0x7f')],_0x7947('0x88'),_0x39b9f9[_0x7947('0x76')]))){_0x1c00dc=path[_0x7947('0x7e')](config[_0x7947('0x7f')],_0x7947('0x88'),_0x39b9f9['agentAvatar']);}}return _0x1ebe34['download'](_0x1c00dc);}})[_0x7947('0x5c')](handleError(_0x1ebe34,null));};exports['getCustomerAvatar']=function(_0x4a7515,_0x5a884f,_0xf2fa64){var _0xffdb70=path[_0x7947('0x7e')](config['root'],_0x7947('0x89'));var _0x1c7d89={'where':{'id':_0x4a7515[_0x7947('0x67')]['id']},'attributes':['id',_0x7947('0x79'),_0x7947('0x8a')],'raw':!![]};return db[_0x7947('0x43')][_0x7947('0x60')](_0x1c7d89)['then'](handleEntityNotFound(_0x5a884f,null))['then'](function(_0x53f824){if(_0x53f824){if(!_[_0x7947('0x83')](_0x53f824[_0x7947('0x79')])){if(fs[_0x7947('0x84')](path[_0x7947('0x7e')](config['root'],_0x7947('0x88'),_0x53f824['customerAvatar']))&&_0x53f824[_0x7947('0x8a')]){_0xffdb70=path[_0x7947('0x7e')](config['root'],_0x7947('0x88'),_0x53f824['customerAvatar']);}}return _0x5a884f[_0x7947('0x8b')](_0xffdb70);}})[_0x7947('0x5c')](handleError(_0x5a884f,null));};exports['getSystemAvatar']=function(_0xfbe116,_0x32838b,_0xdbab6e){var _0x29ccd1=path[_0x7947('0x7e')](config[_0x7947('0x7f')],_0x7947('0x8c'));var _0x451411={'where':{'id':_0xfbe116[_0x7947('0x67')]['id']},'attributes':['id',_0x7947('0x7c')],'raw':!![]};return db[_0x7947('0x43')][_0x7947('0x60')](_0x451411)[_0x7947('0x26')](handleEntityNotFound(_0x32838b,null))[_0x7947('0x26')](function(_0x4cc758){if(_0x4cc758){if(!_['isNil'](_0x4cc758['systemAvatar'])){if(fs[_0x7947('0x84')](path['join'](config['root'],_0x7947('0x88'),_0x4cc758[_0x7947('0x7c')]))){_0x29ccd1=path['join'](config['root'],_0x7947('0x88'),_0x4cc758[_0x7947('0x7c')]);}}return _0x32838b[_0x7947('0x8b')](_0x29ccd1);}})[_0x7947('0x5c')](handleError(_0x32838b,null));};exports[_0x7947('0x8d')]=function(_0x16f6ff,_0x460726,_0x1c0347){var _0xa2dcd4=require('user-agent-parser');var _0x49e6e7=new _0xa2dcd4();var _0x174718=_0x49e6e7['setUA'](_0x16f6ff[_0x7947('0x8e')][_0x7947('0x8f')])[_0x7947('0x90')]();var _0x9c24b5={'body':_0x16f6ff[_0x7947('0x61')],'channel':'chat'};var _0x3191e6=[];var _0x4314a9=[];var _0x36f583={};var _0x6a3249=![];return db[_0x7947('0x91')][_0x7947('0x68')]()[_0x7947('0x26')](function(_0x3b0fcc){if(!_0x3b0fcc){throw new db[(_0x7947('0x22'))][(_0x7947('0x23'))](_0x7947('0x92'));}_0x3191e6=_[_0x7947('0x93')](_[_0x7947('0x4a')](_0x3b0fcc),['createdAt',_0x7947('0x94')]);_0x4314a9=_[_0x7947('0x93')](_[_0x7947('0x4a')](_0x3b0fcc),[_0x7947('0x95'),_0x7947('0x94'),_0x7947('0x96'),_0x7947('0x97')]);if(_0x16f6ff[_0x7947('0x61')]['id']){delete _0x16f6ff[_0x7947('0x61')]['id'];}if(_[_0x7947('0x83')](_0x16f6ff['body'][_0x7947('0x98')])){throw new db[(_0x7947('0x22'))]['ValidationError'](_0x7947('0x99'));}if(_['isNil'](_0x16f6ff[_0x7947('0x61')]['body'])||_0x16f6ff[_0x7947('0x61')][_0x7947('0x61')]===''){throw new db[(_0x7947('0x22'))]['ValidationError'](_0x7947('0x9a'));}if(_['isNil'](_0x16f6ff['body']['mapKey'])){throw new db[(_0x7947('0x22'))][(_0x7947('0x23'))](_0x7947('0x9b')+_0x4314a9);}if(!_[_0x7947('0x9c')](_0x4314a9,_0x16f6ff[_0x7947('0x61')]['mapKey'])){throw new db[(_0x7947('0x22'))]['ValidationError'](_0x7947('0x9d')+_0x4314a9);}_0x36f583[_0x16f6ff[_0x7947('0x61')][_0x7947('0x9e')]]=_0x16f6ff['body'][_0x7947('0x98')];})[_0x7947('0x26')](function(){return db[_0x7947('0x43')]['find']({'where':{'id':_0x16f6ff[_0x7947('0x67')]['id']},'include':[{'model':db[_0x7947('0x9f')],'as':'List','include':[{'model':db['CmContact'],'as':_0x7947('0xa0'),'where':_0x36f583,'limit':0x1,'order':[[_0x7947('0x94'),_0x7947('0xa1')]]}]},{'model':db[_0x7947('0xa2')],'as':'Applications'}]});})[_0x7947('0x26')](handleEntityNotFound(_0x460726,null))['then'](function(_0xb4d7bb){if(_0xb4d7bb&&_0xb4d7bb[_0x7947('0xa3')]){_0x9c24b5[_0x7947('0xa4')]=_0xb4d7bb;_0x9c24b5[_0x7947('0xa5')]=_0xb4d7bb[_0x7947('0xa6')];_0x9c24b5[_0x7947('0xa7')]=_0xb4d7bb[_0x7947('0xa3')];_0x9c24b5['applications']=_[_0x7947('0xa8')](_0x9c24b5[_0x7947('0xa5')],[_0x7947('0xa9')],[_0x7947('0xaa')]);if(_0x9c24b5[_0x7947('0xa4')]['Applications']){delete _0x9c24b5[_0x7947('0xa4')]['Applications'];}if(_0x9c24b5['account'][_0x7947('0xa3')]&&_0x9c24b5[_0x7947('0xa4')][_0x7947('0xa3')][_0x7947('0xa0')][_0x7947('0x5f')]){return _0x9c24b5['account'][_0x7947('0xa3')][_0x7947('0xa0')][0x0];}var _0x44b906=_[_0x7947('0x18')](_0x16f6ff[_0x7947('0x61')],{'firstName':_0x16f6ff[_0x7947('0x61')][_0x7947('0x98')],'ListId':_0xb4d7bb[_0x7947('0x97')]});_0x44b906[_0x16f6ff[_0x7947('0x61')][_0x7947('0x9e')]]=_0x16f6ff[_0x7947('0x61')][_0x7947('0x98')];return db[_0x7947('0x91')][_0x7947('0x70')](_0x44b906,{'fields':_0x3191e6,'raw':!![]});}})[_0x7947('0x26')](handleEntityNotFound(_0x460726,null))[_0x7947('0x26')](function(_0x2c12e1){_0x9c24b5[_0x7947('0xab')]=_0x2c12e1;var _0x1bcccf=_0x16f6ff['body'][_0x7947('0xac')];if(_0x16f6ff[_0x7947('0x8e')]['cf-connecting-ip']){_0x1bcccf=_0x16f6ff[_0x7947('0x8e')][_0x7947('0xad')];}else if(_0x16f6ff[_0x7947('0x8e')][_0x7947('0xae')]){_0x1bcccf=_[_0x7947('0xaf')](_0x16f6ff[_0x7947('0x8e')]['x-forwarded-for'][_0x7947('0xb0')](','));}if(_0x2c12e1){var _0xbae7de={'ContactId':_0x2c12e1['id'],'ChatWebsiteId':_0x16f6ff[_0x7947('0x67')]['id'],'from':(_0x2c12e1[_0x7947('0xb1')]||'')+'\x20'+(_0x2c12e1[_0x7947('0xb2')]||''),'customerIp':_0x1bcccf,'customerPort':_0x16f6ff['headers'][_0x7947('0xb3')]?_0x16f6ff[_0x7947('0x8e')][_0x7947('0xb3')]:null,'referer':_0x16f6ff[_0x7947('0x61')][_0x7947('0xb4')],'browserName':_0x174718[_0x7947('0xb5')][_0x7947('0x3e')]&&_0x174718[_0x7947('0xb5')][_0x7947('0xb6')]?util[_0x7947('0xb7')](_0x7947('0xb8'),_0x174718[_0x7947('0xb5')][_0x7947('0x3e')],_0x174718[_0x7947('0xb5')][_0x7947('0xb6')]):'unknown','browserVersion':_0x174718[_0x7947('0xb5')][_0x7947('0xb6')]||_0x7947('0xb9'),'osName':util[_0x7947('0xb7')](_0x7947('0xb8'),_0x174718['os'][_0x7947('0x3e')],_0x174718['os'][_0x7947('0xb6')]),'osVersion':_0x174718['os']['version'],'deviceModel':_0x174718[_0x7947('0xba')]['model']&&_0x174718[_0x7947('0xba')][_0x7947('0xbb')]?util[_0x7947('0xb7')](_0x7947('0xbc'),_0x174718['device'][_0x7947('0x48')],_0x174718[_0x7947('0xba')][_0x7947('0xbb')],_0x174718['device'][_0x7947('0x46')]):null,'deviceVendor':_0x174718['device'][_0x7947('0xbb')],'deviceType':_0x174718['device'][_0x7947('0x46')],'formData':JSON['stringify'](_0x16f6ff[_0x7947('0x61')])};var _0x229423={'ChatWebsiteId':_0x16f6ff['params']['id'],'closed':![]};if(_0x16f6ff[_0x7947('0x61')][_0x7947('0xbd')]){_0x229423[_0x7947('0xbd')]=_0x16f6ff['body']['threadId'];return db[_0x7947('0xbe')]['find']({'where':_0x229423})[_0x7947('0x26')](function(_0x2a5cc2){if(_0x2a5cc2){return[_0x2a5cc2,![]];}_0xbae7de[_0x7947('0xbd')]=_0x16f6ff[_0x7947('0x61')][_0x7947('0xbd')];_0xbae7de[_0x7947('0xbf')]=_0x16f6ff['body'][_0x7947('0xbf')];return db[_0x7947('0xbe')][_0x7947('0x70')](_0xbae7de)['then'](function(_0x43d70e){return[_0x43d70e,!![]];});});}_0x229423['ContactId']=_0x2c12e1['id'];if(_0x16f6ff[_0x7947('0x61')][_0x7947('0xc0')]&&_0x16f6ff['body'][_0x7947('0xc0')]['id']){_0x229423['id']=_0x16f6ff[_0x7947('0x61')]['interaction']['id'];return db['ChatInteraction'][_0x7947('0x60')]({'where':_0x229423})[_0x7947('0x26')](function(_0x369e5f){if(_0x369e5f){return[_0x369e5f,![]];}return db[_0x7947('0xbe')][_0x7947('0x70')](_0xbae7de)['then'](function(_0x4d0a5f){return[_0x4d0a5f,!![]];});});}return db[_0x7947('0xbe')][_0x7947('0x70')](_0xbae7de)[_0x7947('0x26')](function(_0x12d13c){return[_0x12d13c,!![]];});}})[_0x7947('0xc1')](function(_0x416ab7,_0x19e8ce){if(_0x416ab7){_0x6a3249=_0x19e8ce;if(!_0x19e8ce){var _0x2c057d={'from':(_0x9c24b5[_0x7947('0xab')][_0x7947('0xb1')]||'')+'\x20'+(_0x9c24b5[_0x7947('0xab')]['lastName']||'')};if(_0x16f6ff[_0x7947('0x61')][_0x7947('0xbd')]&&_0x16f6ff[_0x7947('0x61')][_0x7947('0xc2')]&&_0x16f6ff['body'][_0x7947('0xbd')]!=_0x16f6ff[_0x7947('0x61')][_0x7947('0xc2')]){_0x2c057d[_0x7947('0xbd')]=_0x16f6ff[_0x7947('0x61')]['messageId'];}return _0x416ab7[_0x7947('0x38')](_0x2c057d);}else{return _0x416ab7;}}})[_0x7947('0x26')](function(_0x177e6e){_0x9c24b5[_0x7947('0xc0')]=_0x177e6e['get']({'plain':!![]});_0x9c24b5[_0x7947('0xc0')][_0x7947('0xc3')]=_0x6a3249;if(_0x9c24b5['interaction'][_0x7947('0xc3')]){if(_0x9c24b5['account'][_0x7947('0xc4')]){_0x9c24b5[_0x7947('0xa5')]['push']({'id':0x0,'priority':_0x9c24b5['applications'][_0x7947('0x5f')]+0x1,'app':'close','appdata':_0x7947('0xc5'),'interval':_0x7947('0xc6')});}}return db[_0x7947('0xc7')][_0x7947('0x70')]({'body':_0x16f6ff[_0x7947('0x61')][_0x7947('0x61')],'ChatWebsiteId':_0x16f6ff[_0x7947('0x67')]['id'],'ChatInteractionId':_0x177e6e['id'],'direction':'in','ContactId':_0x9c24b5[_0x7947('0xab')]['id'],'AttachmentId':_0x16f6ff[_0x7947('0x61')][_0x7947('0xc8')]});})[_0x7947('0x26')](function(_0x71b4ff){_0x9c24b5[_0x7947('0x2c')]=_0x71b4ff;if(_0x9c24b5[_0x7947('0xc0')][_0x7947('0xc9')]){return db[_0x7947('0xca')]['find']({'attributes':['id',_0x7947('0x3e')],'where':{'id':_0x9c24b5['interaction'][_0x7947('0xc9')]}})[_0x7947('0x26')](function(_0x468491){if(_0x468491){_0x9c24b5['applications'][_0x7947('0xcb')]({'id':0x0,'priority':0x0,'app':_0x7947('0xcc'),'appdata':_0x468491[_0x7947('0x3e')]+','+(_0x9c24b5['account'][_0x7947('0xcd')]||0xa),'interval':_0x7947('0xc6')});_0x9c24b5[_0x7947('0xce')]=!![];}return respondWithRpcPromise(_0x7947('0xcf'),_0x7947('0xd0'),_0x9c24b5);});}return respondWithRpcPromise('Start',_0x7947('0xd0'),_0x9c24b5);})['then'](function(_0x2f8405){respondWithRpcPromise(_0x7947('0xd1'),_0x7947('0xd1'),{'event':_0x7947('0x8d'),'message':_0x2f8405},client9002);return _0x2f8405;})[_0x7947('0x26')](respondWithResult(_0x460726,null))[_0x7947('0x5c')](handleError(_0x460726,null));};exports[_0x7947('0xd2')]=function(_0x309123,_0xc65ee0,_0x1ad1cb){var _0x464e08,_0x397ca9,_0x12c582;var _0xcc951a=[];var _0x15e7aa=[];var _0x4a75dc={};return db[_0x7947('0x91')][_0x7947('0x68')]()[_0x7947('0x26')](function(_0x43cf3e){if(!_0x43cf3e){throw new db[(_0x7947('0x22'))][(_0x7947('0x23'))](_0x7947('0x92'));}_0x15e7aa=_[_0x7947('0x93')](_['keys'](_0x43cf3e),[_0x7947('0x95'),'updatedAt']);_0xcc951a=_[_0x7947('0x93')](_[_0x7947('0x4a')](_0x43cf3e),[_0x7947('0x95'),_0x7947('0x94'),_0x7947('0x96'),'ListId']);if(_0x309123[_0x7947('0x61')]['id']){delete _0x309123[_0x7947('0x61')]['id'];}if(_[_0x7947('0x83')](_0x309123['body'][_0x7947('0x98')])){throw _0xc65ee0[_0x7947('0x2f')](0x1f4)['send'](new db[(_0x7947('0x22'))][(_0x7947('0x23'))](_0x7947('0x99')));}if(_[_0x7947('0x83')](_0x309123[_0x7947('0x61')][_0x7947('0x61')])||_0x309123[_0x7947('0x61')][_0x7947('0x61')]===''){throw _0xc65ee0[_0x7947('0x2f')](0x1f4)[_0x7947('0x3f')](new db['Sequelize'][(_0x7947('0x23'))](_0x7947('0x9a')));}if(_['isNil'](_0x309123['body'][_0x7947('0xd3')])){throw _0xc65ee0[_0x7947('0x2f')](0x1f4)['send'](new db[(_0x7947('0x22'))][(_0x7947('0x23'))](_0x7947('0xd4')+_0xcc951a));}if(!_[_0x7947('0x9c')](_0xcc951a,_0x309123[_0x7947('0x61')][_0x7947('0xd3')])){throw _0xc65ee0[_0x7947('0x2f')](0x1f4)[_0x7947('0x3f')](new db[(_0x7947('0x22'))][(_0x7947('0x23'))](_0x7947('0xd5')+_0xcc951a));}_0x4a75dc[_0x309123[_0x7947('0x61')][_0x7947('0xd3')]]=_0x309123[_0x7947('0x61')]['from'];})[_0x7947('0x26')](function(){return db[_0x7947('0x43')][_0x7947('0x60')]({'where':{'id':_0x309123[_0x7947('0x67')]['id']},'include':[{'model':db['CmList'],'as':'List'}]});})['then'](handleEntityNotFound(_0xc65ee0,null))[_0x7947('0x26')](function(_0x200421){if(_0x200421&&_0x200421['List']){_0x397ca9=_0x200421;var _0x4d72ff=_[_0x7947('0x18')](_0x309123[_0x7947('0x61')],{'firstName':_0x309123['body']['from'],'phone':_0x309123['body'][_0x7947('0x98')],'ListId':_0x200421[_0x7947('0x97')]});_0x4d72ff[_0x309123[_0x7947('0x61')]['mapKeyOffline']]=_0x309123['body'][_0x7947('0x98')];return db['CmContact'][_0x7947('0xd6')]({'where':_0x4a75dc,'defaults':_0x4d72ff});}})['spread'](function(_0x34788c){if(_0x34788c){_0x12c582=_0x34788c;var _0x19e1f6=fs[_0x7947('0xd7')](path[_0x7947('0x7e')](config[_0x7947('0x7f')],_0x7947('0xd8')),'utf8');var _0x134978=ejs[_0x7947('0xd9')](_0x19e1f6,{'body':_[_0x7947('0xda')](_0x309123[_0x7947('0x61')][_0x7947('0x61')]),'bodyTitle':_0x397ca9[_0x7947('0xdb')]});return db[_0x7947('0xdc')][_0x7947('0x70')]({'body':_0x134978,'ContactId':_0x34788c['id'],'ChatWebsiteId':_0x397ca9['id']});}})[_0x7947('0x26')](function(_0x4a6c18){if(_0x4a6c18){_0x464e08=_0x4a6c18;return db[_0x7947('0xdd')]['findOne']({'where':{'service':!![]},'include':[{'model':db['MailServerOut'],'as':'Smtp','raw':!![]}]});}})['then'](function(_0x419c65){if(_0x419c65&&_0x419c65[_0x7947('0xde')]&&_0x397ca9['forwardOfflineAddress']){var _0xd616e0={'tls':{'rejectUnauthorized':![]}};if(_0x419c65[_0x7947('0xde')][_0x7947('0xdf')]){_0xd616e0['service']=_0x419c65[_0x7947('0xde')][_0x7947('0xdf')];}else{_0xd616e0[_0x7947('0xe0')]=_0x419c65[_0x7947('0xde')][_0x7947('0xe0')];_0xd616e0['port']=_0x419c65[_0x7947('0xde')][_0x7947('0xe1')];_0xd616e0[_0x7947('0xe2')]=_0x419c65['Smtp'][_0x7947('0xe2')];}if(_0x419c65[_0x7947('0xde')]['authentication']){_0xd616e0[_0x7947('0xe3')]={'user':_0x419c65[_0x7947('0xde')][_0x7947('0xe4')],'pass':_0x419c65[_0x7947('0xde')][_0x7947('0xe5')]};}return respondWithRpcPromise(_0x7947('0xe6'),_0x7947('0xe7'),{'account':_0xd616e0,'message':{'from':util[_0x7947('0xb7')](_0x7947('0xe8'),_0x419c65[_0x7947('0x3e')],_0x419c65[_0x7947('0xe9')]||_0x419c65['Smtp']['user']),'to':_0x397ca9[_0x7947('0xea')],'subject':_0x397ca9['offlineMessageSubject'],'text':_0x464e08[_0x7947('0x61')]}},client9003)['then'](function(){return _0x464e08;})[_0x7947('0x5c')](function(_0x513a74){console[_0x7947('0x2b')](_0x513a74);});}})[_0x7947('0x26')](function(){if(_0x464e08){return _0x464e08;}})['then'](respondWithResult(_0xc65ee0,null))[_0x7947('0x5c')](handleError(_0xc65ee0,null));};exports[_0x7947('0xeb')]=function(_0x367301,_0x1d7dec,_0x23dc35){return db['ChatInteraction'][_0x7947('0x60')]({'where':{'id':_0x367301['params']['id']}})['then'](handleEntityNotFound(_0x1d7dec,null))[_0x7947('0x26')](function(_0x47f9ee){if(_0x47f9ee){return _0x47f9ee[_0x7947('0xeb')](_0x367301[_0x7947('0x61')][_0x7947('0x73')],_[_0x7947('0xec')](_0x367301[_0x7947('0x61')],[_0x7947('0x73'),'id'])||{});}})[_0x7947('0x26')](respondWithResult(_0x1d7dec,null))['catch'](handleError(_0x1d7dec,null));};exports[_0x7947('0xed')]=function(_0xb2a347,_0x142cbd,_0x4fabd5){var _0x1d0e0e={'raw':![],'where':{}};var _0x54bfd7={};var _0x568952={'count':0x0,'rows':[]};return db[_0x7947('0x43')]['findOne']({'where':{'id':_0xb2a347[_0x7947('0x67')]['id']}})['then'](handleEntityNotFound(_0x142cbd,null))['then'](function(_0x1277c3){if(_0x1277c3){_0x54bfd7[_0x7947('0x48')]=_[_0x7947('0x4a')](db['ChatInteraction'][_0x7947('0x44')]);_0x54bfd7[_0x7947('0x49')]=_[_0x7947('0x4a')](_0xb2a347[_0x7947('0x49')]);_0x54bfd7[_0x7947('0x4b')]=_['intersection'](_0x54bfd7[_0x7947('0x48')],_0x54bfd7[_0x7947('0x49')]);_0x1d0e0e[_0x7947('0x4d')]=_[_0x7947('0x4c')](_0x54bfd7['model'],qs[_0x7947('0x4e')](_0xb2a347['query'][_0x7947('0x4e')]));_0x1d0e0e[_0x7947('0x4d')]=_0x1d0e0e[_0x7947('0x4d')][_0x7947('0x5f')]?_0x1d0e0e['attributes']:_0x54bfd7['model'];if(!_0xb2a347[_0x7947('0x49')][_0x7947('0x6d')](_0x7947('0x4f'))){_0x1d0e0e[_0x7947('0x34')]=qs[_0x7947('0x34')](_0xb2a347['query']['limit']);_0x1d0e0e[_0x7947('0x33')]=qs[_0x7947('0x33')](_0xb2a347[_0x7947('0x49')][_0x7947('0x33')]);}_0x1d0e0e[_0x7947('0x50')]=qs['sort'](_0xb2a347[_0x7947('0x49')][_0x7947('0x51')]);_0x1d0e0e['where']=qs[_0x7947('0x4b')](_[_0x7947('0x52')](_0xb2a347[_0x7947('0x49')],_0x54bfd7['filters']));_0x1d0e0e[_0x7947('0x53')][_0x7947('0x69')]=_0x1277c3['id'];if(_0xb2a347['query']['filter']){_0x1d0e0e['where']=_[_0x7947('0x54')](_0x1d0e0e[_0x7947('0x53')],{'$or':_[_0x7947('0x42')](_0x1d0e0e['attributes'],function(_0x4f1d29){var _0xecbdb3={};_0xecbdb3[_0x4f1d29]={'$like':'%'+_0xb2a347[_0x7947('0x49')][_0x7947('0x56')]+'%'};return _0xecbdb3;})});}_0x1d0e0e=_[_0x7947('0x54')]({},_0x1d0e0e,_0xb2a347['options']);return db[_0x7947('0xbe')][_0x7947('0x32')]({'where':_0x1d0e0e[_0x7947('0x53')]})[_0x7947('0x26')](function(_0x5f615b){_0x568952[_0x7947('0x32')]=_0x5f615b;if(_0xb2a347[_0x7947('0x49')]['includeAll']){_0x1d0e0e[_0x7947('0x59')]=[{'model':db[_0x7947('0x91')],'as':_0x7947('0xee'),'required':![]},{'model':db[_0x7947('0xca')],'as':_0x7947('0xef'),'attributes':[_0x7947('0x3e'),_0x7947('0xf0'),'internal'],'required':![]},{'model':db[_0x7947('0xf1')],'as':_0x7947('0xf2'),'attributes':['id',_0x7947('0x3e'),_0x7947('0xf3')],'where':_0xb2a347['query'][_0x7947('0xf4')]?{'id':_0xb2a347[_0x7947('0x49')][_0x7947('0xf4')]}:undefined,'required':_0xb2a347[_0x7947('0x49')]['tag']?!![]:![]}];}return db[_0x7947('0xbe')][_0x7947('0x5a')](_0x1d0e0e);})['then'](function(_0x5e1e74){_0x568952[_0x7947('0x5b')]=_0x5e1e74;return _0x568952;});}})[_0x7947('0x26')](respondWithFilteredResult(_0x142cbd,_0x1d0e0e))[_0x7947('0x5c')](handleError(_0x142cbd,null));};function iftimePromise(_0x17e291,_0x1b9962){return respondWithRpcPromise('Command',_0x7947('0xf5'),{'command':_0x1b9962[_0x7947('0xf6')]?util[_0x7947('0xb7')]('iftime\x20%s,%s',_0x17e291[_0x7947('0xf7')],_0x1b9962[_0x7947('0xf6')]):util[_0x7947('0xb7')](_0x7947('0xf8'),_0x17e291['interval'])},client9002)['then'](function(_0x53b2f6){var _0x58da61=_0x53b2f6&&_0x53b2f6[_0x7947('0xf9')]('true')>=0x0?!![]:![];logger[_0x7947('0x27')]('[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)',_0x1b9962['id'],_0x17e291['id'],_0x17e291[_0x7947('0xf7')],_0x58da61?_0x7947('0xfa'):_0x7947('0xfb'),_0x1b9962[_0x7947('0xf6')]?_0x1b9962['timezone']:_0x7947('0xfc'));return _0x58da61;})[_0x7947('0x5c')](function(_0x4ae787){logger[_0x7947('0x2b')](_0x7947('0xfd'),_0x1b9962['id'],_0x17e291['id'],_0x17e291[_0x7947('0xf7')],util[_0x7947('0xfe')](_0x4ae787,{'showHidden':![],'depth':null}),_0x1b9962[_0x7947('0xf6')]?_0x1b9962[_0x7947('0xf6')]:_0x7947('0xfc'));return![];});}exports['getSnippet']=function(_0x20c39b,_0x3d0bf6,_0x1d116b){var _0x3c977b=0x0;var _0x56e5e9=0x0;var _0x2d0d12=![];var _0x4cd1a2;var _0x18c43b;return db[_0x7947('0x43')][_0x7947('0x60')]({'where':{'id':_0x20c39b['params']['id']},'include':[{'model':db[_0x7947('0xff')],'as':_0x7947('0xff'),'include':[{'model':db[_0x7947('0xff')],'as':_0x7947('0x100'),'attributes':['id',_0x7947('0xf7')],'raw':!![]}]}]})[_0x7947('0x26')](handleEntityNotFound(_0x3d0bf6,null))[_0x7947('0x26')](function(_0x4a886b){if(_0x4a886b){_0x4cd1a2=_0x4a886b;return _0x4a886b[_0x7947('0x101')]({'raw':!![]});}})[_0x7947('0x26')](function(_0x41f247){if(_0x4cd1a2){if(_0x41f247){_0x18c43b=_0x41f247;}}return require(_0x7947('0x80'))[_0x7947('0x81')]();})[_0x7947('0x26')](function(_0x7d5c7f){if(_0x7d5c7f){_0x56e5e9=_0x7d5c7f['virtual'];_0x2d0d12=_0x7d5c7f[_0x7947('0x82')];}})[_0x7947('0x26')](function(){return db[_0x7947('0xbe')][_0x7947('0x32')]({'where':{'closed':![]}});})[_0x7947('0x26')](function(_0x1d89df){_0x3c977b=_0x1d89df;if(_0x56e5e9&&_0x1d89df>_0x56e5e9){return db[_0x7947('0x102')][_0x7947('0x6c')]({'where':{'id':0x1}})[_0x7947('0x26')](function(_0x54fe45){if(_0x54fe45){_0x54fe45[_0x7947('0x103')](_0x7947('0x104'));}});}})[_0x7947('0x26')](function(){if(_0x4cd1a2['Interval']&&_0x4cd1a2[_0x7947('0xff')]['Intervals']){var _0x3e077d=[];for(var _0x5c8b24=0x0;_0x5c8b24<_0x4cd1a2[_0x7947('0xff')][_0x7947('0x100')][_0x7947('0x5f')];_0x5c8b24++){var _0x36b5a4=_0x4cd1a2['Interval'][_0x7947('0x100')][_0x5c8b24]['get']({'plain':!![]});_0x3e077d[_0x7947('0x105')](iftimePromise(_0x36b5a4,_0x4cd1a2));}return BPromise['all'](_0x3e077d)['then'](function(_0x43a660){return _[_0x7947('0x106')](_0x43a660);});}else{return!![];}})['then'](function(_0x29fe54){var _0x2664e3=fs[_0x7947('0xd7')](path[_0x7947('0x7e')](config[_0x7947('0x7f')],_0x7947('0x107')),_0x7947('0x108'));var _0x4d3d37={'remote':_0x4cd1a2['remote'],'query':querystring[_0x7947('0x2a')](_[_0x7947('0x54')](_0x4cd1a2['get']({'plain':!![]}),{'customerIp':_0x20c39b[_0x7947('0x8e')][_0x7947('0xae')]||_0x20c39b[_0x7947('0x8e')][_0x7947('0x109')]||_0x20c39b['connection'][_0x7947('0x10a')]||_0x20c39b['ip'],'referer':_0x20c39b[_0x7947('0x8e')][_0x7947('0xb4')],'openedInteractions':_0x3c977b,'maxInteractions':_0x56e5e9,'virtual':_0x2d0d12['virtual'],'online':_0x29fe54,'custom':_0x2d0d12}))['replace'](/'/g,'\x5c\x27')};_0x3d0bf6['send'](ejs[_0x7947('0xd9')](Mustache[_0x7947('0xd9')](_0x2664e3,_0x4d3d37),{'proactiveActions':_0x18c43b,'alignment':_0x4cd1a2[_0x7947('0x10b')],'verticalAlignment':_0x4cd1a2[_0x7947('0x10c')],'div_color':_0x4cd1a2[_0x7947('0xf3')],'text_color':_0x4cd1a2[_0x7947('0x10d')]}));})[_0x7947('0x5c')](handleError(_0x3d0bf6,null));};exports[_0x7947('0x10e')]=function(_0x346e17,_0x366b7a,_0x580869){return db[_0x7947('0x43')][_0x7947('0x6c')]({'where':{'id':_0x346e17[_0x7947('0x67')]['id']}})['then'](handleEntityNotFound(_0x366b7a,null))[_0x7947('0x26')](function(_0xd91d6f){if(_0xd91d6f){return db['sequelize'][_0x7947('0x10f')](function(_0x39f850){return db[_0x7947('0xa2')][_0x7947('0x3c')]({'where':{'ChatWebsiteId':_0x346e17[_0x7947('0x67')]['id']},'transaction':_0x39f850})['then'](function(_0x45e5ea){var _0x4ea07c=_[_0x7947('0x42')](_0x346e17[_0x7947('0x61')],function(_0x461d34){_0x461d34['ChatWebsiteId']=_0x346e17[_0x7947('0x67')]['id'];return _0x461d34;});return db[_0x7947('0xa2')]['bulkCreate'](_0x4ea07c,{'transaction':_0x39f850});});})[_0x7947('0x26')](function(){return db[_0x7947('0xa2')][_0x7947('0x110')]({'where':{'ChatWebsiteId':_0x346e17[_0x7947('0x67')]['id']},'order':'priority'});});}})['then'](respondWithResult(_0x366b7a,null))[_0x7947('0x5c')](handleError(_0x366b7a,null));};exports['getApplications']=function(_0x5fbf4a,_0x260b3f,_0x135709){var _0x19b914={};var _0x5c499a={};var _0x34a0b3;var _0x1193d8;return db['ChatWebsite']['findOne']({'where':{'id':_0x5fbf4a[_0x7947('0x67')]['id']}})[_0x7947('0x26')](handleEntityNotFound(_0x260b3f,null))['then'](function(_0x2d4a1a){if(_0x2d4a1a){_0x34a0b3=_0x2d4a1a;_0x5c499a['model']=_[_0x7947('0x4a')](db[_0x7947('0xa2')][_0x7947('0x44')]);_0x5c499a['query']=_[_0x7947('0x4a')](_0x5fbf4a[_0x7947('0x49')]);_0x5c499a['filters']=_[_0x7947('0x4c')](_0x5c499a[_0x7947('0x48')],_0x5c499a[_0x7947('0x49')]);_0x19b914[_0x7947('0x4d')]=_[_0x7947('0x4c')](_0x5c499a[_0x7947('0x48')],qs[_0x7947('0x4e')](_0x5fbf4a[_0x7947('0x49')][_0x7947('0x4e')]));_0x19b914[_0x7947('0x4d')]=_0x19b914[_0x7947('0x4d')][_0x7947('0x5f')]?_0x19b914[_0x7947('0x4d')]:_0x5c499a[_0x7947('0x48')];_0x19b914['order']=qs[_0x7947('0x51')](_0x5fbf4a[_0x7947('0x49')][_0x7947('0x51')]);_0x19b914[_0x7947('0x53')]=qs[_0x7947('0x4b')](_[_0x7947('0x52')](_0x5fbf4a[_0x7947('0x49')],_0x5c499a[_0x7947('0x4b')]));if(_0x5fbf4a['query']['filter']){_0x19b914['where']=_[_0x7947('0x54')](_0x19b914['where'],{'$or':_['map'](_0x19b914[_0x7947('0x4d')],function(_0x5d18da){var _0x2e7851={};_0x2e7851[_0x5d18da]={'$like':'%'+_0x5fbf4a['query'][_0x7947('0x56')]+'%'};return _0x2e7851;})});}_0x19b914=_['merge']({},_0x19b914,_0x5fbf4a[_0x7947('0x57')]);return _0x34a0b3[_0x7947('0x111')](_0x19b914);}})[_0x7947('0x26')](function(_0x318c59){if(_0x318c59){_0x1193d8=_0x318c59['length'];if(!_0x5fbf4a[_0x7947('0x49')][_0x7947('0x6d')](_0x7947('0x4f'))){_0x19b914[_0x7947('0x34')]=qs[_0x7947('0x34')](_0x5fbf4a[_0x7947('0x49')]['limit']);_0x19b914['offset']=qs['offset'](_0x5fbf4a['query'][_0x7947('0x33')]);}return _0x34a0b3['getApplications'](_0x19b914);}})[_0x7947('0x26')](function(_0x51dd90){if(_0x51dd90){return _0x51dd90?{'count':_0x1193d8,'rows':_0x51dd90}:null;}})[_0x7947('0x26')](respondWithResult(_0x260b3f,null))['catch'](handleError(_0x260b3f,null));};exports['addProactiveActions']=function(_0x97f220,_0x3f303,_0xb5eb23){return db[_0x7947('0x112')]['find']({'where':{'id':_0x97f220['params']['id']}})[_0x7947('0x26')](handleEntityNotFound(_0x3f303,null))[_0x7947('0x26')](function(_0x114bac){if(_0x114bac){return _0x114bac['addProactiveActions'](_0x97f220[_0x7947('0x61')]['ids'],_[_0x7947('0xec')](_0x97f220['body'],['ids','id'])||{});}})[_0x7947('0x26')](respondWithResult(_0x3f303,null))[_0x7947('0x5c')](handleError(_0x3f303,null));};exports['getProactiveActions']=function(_0x18dca4,_0x4a1303,_0x423e32){var _0x4d0ab6={};var _0x33c945={};var _0x280ff9;var _0xe1bb2b;return db[_0x7947('0x43')]['findOne']({'where':{'id':_0x18dca4['params']['id']}})[_0x7947('0x26')](handleEntityNotFound(_0x4a1303,null))[_0x7947('0x26')](function(_0x387baf){if(_0x387baf){_0x280ff9=_0x387baf;_0x33c945[_0x7947('0x48')]=_['keys'](db[_0x7947('0x113')][_0x7947('0x44')]);_0x33c945[_0x7947('0x49')]=_[_0x7947('0x4a')](_0x18dca4[_0x7947('0x49')]);_0x33c945['filters']=_[_0x7947('0x4c')](_0x33c945['model'],_0x33c945[_0x7947('0x49')]);_0x4d0ab6[_0x7947('0x4d')]=_[_0x7947('0x4c')](_0x33c945['model'],qs['fields'](_0x18dca4[_0x7947('0x49')][_0x7947('0x4e')]));_0x4d0ab6['attributes']=_0x4d0ab6[_0x7947('0x4d')][_0x7947('0x5f')]?_0x4d0ab6[_0x7947('0x4d')]:_0x33c945[_0x7947('0x48')];_0x4d0ab6['order']=qs[_0x7947('0x51')](_0x18dca4['query'][_0x7947('0x51')]);_0x4d0ab6[_0x7947('0x53')]=qs['filters'](_[_0x7947('0x52')](_0x18dca4[_0x7947('0x49')],_0x33c945[_0x7947('0x4b')]));if(_0x18dca4[_0x7947('0x49')][_0x7947('0x56')]){_0x4d0ab6[_0x7947('0x53')]=_[_0x7947('0x54')](_0x4d0ab6[_0x7947('0x53')],{'$or':_[_0x7947('0x42')](_0x4d0ab6['attributes'],function(_0x377684){var _0xb9cd7e={};_0xb9cd7e[_0x377684]={'$like':'%'+_0x18dca4[_0x7947('0x49')][_0x7947('0x56')]+'%'};return _0xb9cd7e;})});}_0x4d0ab6=_[_0x7947('0x54')]({},_0x4d0ab6,_0x18dca4[_0x7947('0x57')]);return _0x280ff9[_0x7947('0x101')](_0x4d0ab6);}})[_0x7947('0x26')](function(_0x522272){if(_0x522272){_0xe1bb2b=_0x522272[_0x7947('0x5f')];if(!_0x18dca4[_0x7947('0x49')][_0x7947('0x6d')](_0x7947('0x4f'))){_0x4d0ab6[_0x7947('0x34')]=qs['limit'](_0x18dca4[_0x7947('0x49')][_0x7947('0x34')]);_0x4d0ab6[_0x7947('0x33')]=qs[_0x7947('0x33')](_0x18dca4[_0x7947('0x49')]['offset']);}return _0x280ff9[_0x7947('0x101')](_0x4d0ab6);}})[_0x7947('0x26')](function(_0x13d395){if(_0x13d395){return _0x13d395?{'count':_0xe1bb2b,'rows':_0x13d395}:null;}})[_0x7947('0x26')](respondWithResult(_0x4a1303,null))['catch'](handleError(_0x4a1303,null));};exports[_0x7947('0x114')]=function(_0x39cff5,_0x1679c4,_0x529b74){var _0x21d94b=_0x39cff5[_0x7947('0x49')][_0x7947('0x115')]===_0x7947('0x116')?_0x7947('0x117'):'onlineForm';return db['ChatWebsite']['find']({'attributes':['id',_0x21d94b],'where':{'id':_0x39cff5['params']['id']}})[_0x7947('0x26')](handleEntityNotFound(_0x1679c4,null))[_0x7947('0x26')](function(_0x158b78){if(_0x158b78){var _0x198595=_0x158b78[_0x21d94b];var _0x5cbac4=_0x198595&&_0x198595[_0x7947('0x118')]?_0x198595[_0x7947('0x118')]:[];_0x1679c4[_0x7947('0x3f')]({'fromKey':_[_0x7947('0x83')](_0x198595[_0x7947('0x119')])?undefined:_0x198595[_0x7947('0x119')],'count':_0x5cbac4[_0x7947('0x5f')],'rows':_0x5cbac4});}})[_0x7947('0x5c')](handleError(_0x1679c4,null));};exports['getOfflineMessages']=function(_0x81a97d,_0x3b8cf9,_0x28bd58){var _0x2f7f25={'raw':![],'where':{}};var _0x47fd2a={};var _0x10eed9={'count':0x0,'rows':[]};return db['ChatWebsite'][_0x7947('0x6c')]({'where':{'id':_0x81a97d['params']['id']}})[_0x7947('0x26')](handleEntityNotFound(_0x3b8cf9,null))[_0x7947('0x26')](function(_0x3f293a){if(_0x3f293a){_0x47fd2a['model']=_['keys'](db[_0x7947('0xdc')][_0x7947('0x44')]);_0x47fd2a[_0x7947('0x49')]=_['keys'](_0x81a97d[_0x7947('0x49')]);_0x47fd2a[_0x7947('0x4b')]=_[_0x7947('0x4c')](_0x47fd2a[_0x7947('0x48')],_0x47fd2a[_0x7947('0x49')]);_0x2f7f25[_0x7947('0x4d')]=_[_0x7947('0x4c')](_0x47fd2a[_0x7947('0x48')],qs['fields'](_0x81a97d['query']['fields']));_0x2f7f25[_0x7947('0x4d')]=_0x2f7f25[_0x7947('0x4d')][_0x7947('0x5f')]?_0x2f7f25[_0x7947('0x4d')]:_0x47fd2a[_0x7947('0x48')];if(!_0x81a97d[_0x7947('0x49')]['hasOwnProperty']('nolimit')){_0x2f7f25[_0x7947('0x34')]=qs[_0x7947('0x34')](_0x81a97d[_0x7947('0x49')]['limit']);_0x2f7f25['offset']=qs[_0x7947('0x33')](_0x81a97d[_0x7947('0x49')]['offset']);}_0x2f7f25[_0x7947('0x50')]=qs[_0x7947('0x51')](_0x81a97d['query']['sort']);_0x2f7f25['where']=qs[_0x7947('0x4b')](_[_0x7947('0x52')](_0x81a97d[_0x7947('0x49')],_0x47fd2a[_0x7947('0x4b')]));_0x2f7f25[_0x7947('0x53')][_0x7947('0x69')]=_0x3f293a['id'];if(_0x81a97d[_0x7947('0x49')][_0x7947('0x56')]){_0x2f7f25[_0x7947('0x53')]=_[_0x7947('0x54')](_0x2f7f25['where'],{'$or':_['map'](_0x2f7f25[_0x7947('0x4d')],function(_0x574753){var _0x45d6f6={};_0x45d6f6[_0x574753]={'$like':'%'+_0x81a97d[_0x7947('0x49')][_0x7947('0x56')]+'%'};return _0x45d6f6;})});}_0x2f7f25=_['merge']({},_0x2f7f25,_0x81a97d[_0x7947('0x57')]);return db[_0x7947('0xdc')][_0x7947('0x32')]({'where':_0x2f7f25['where']})[_0x7947('0x26')](function(_0x486a42){_0x10eed9[_0x7947('0x32')]=_0x486a42;if(_0x81a97d[_0x7947('0x49')][_0x7947('0x58')]){_0x2f7f25[_0x7947('0x59')]=[{'all':!![]}];}else{_0x2f7f25['include']=[{'model':db[_0x7947('0x91')],'as':'Contact','required':![]}];}return db[_0x7947('0xdc')]['findAll'](_0x2f7f25);})[_0x7947('0x26')](function(_0x5bb160){_0x10eed9[_0x7947('0x5b')]=_0x5bb160;return _0x10eed9;});}})[_0x7947('0x26')](respondWithFilteredResult(_0x3b8cf9,_0x2f7f25))[_0x7947('0x5c')](handleError(_0x3b8cf9,null));};exports['addAgents']=function(_0x57e924,_0x298a36,_0x5b3580){return db['ChatWebsite'][_0x7947('0x60')]({'where':{'id':_0x57e924[_0x7947('0x67')]['id']}})['then'](handleEntityNotFound(_0x298a36,null))[_0x7947('0x26')](function(_0xd2f8a6){if(_0xd2f8a6){return _0xd2f8a6[_0x7947('0x11a')](_0x57e924[_0x7947('0x61')][_0x7947('0x73')],_[_0x7947('0xec')](_0x57e924[_0x7947('0x61')],[_0x7947('0x73'),'id'])||{})[_0x7947('0xc1')](function(_0x44cdd7){for(var _0x5bc360=0x0;_0x5bc360<_0x57e924[_0x7947('0x61')][_0x7947('0x73')][_0x7947('0x5f')];_0x5bc360+=0x1){socket[_0x7947('0x11b')](_0x7947('0x11c'),{'UserId':_0x57e924[_0x7947('0x61')][_0x7947('0x73')][_0x5bc360],'ChatWebsiteId':_0x57e924[_0x7947('0x67')]['id']});}return _0x44cdd7;});}})[_0x7947('0x26')](respondWithResult(_0x298a36,null))[_0x7947('0x5c')](handleError(_0x298a36,null));};exports['removeAgents']=function(_0x38042e,_0x378480,_0x45bcc1){return db['ChatWebsite'][_0x7947('0x60')]({'where':{'id':_0x38042e[_0x7947('0x67')]['id']}})['then'](handleEntityNotFound(_0x378480,null))[_0x7947('0x26')](function(_0x43d29c){if(_0x43d29c){return _0x43d29c[_0x7947('0x11d')](_0x38042e[_0x7947('0x49')]['ids'])[_0x7947('0x26')](function(){if(_[_0x7947('0x11e')](_0x38042e[_0x7947('0x49')]['ids'])){for(var _0x3c6ae4=0x0;_0x3c6ae4<_0x38042e['query']['ids']['length'];_0x3c6ae4+=0x1){socket['emit'](_0x7947('0x11f'),{'UserId':Number(_0x38042e[_0x7947('0x49')][_0x7947('0x73')][_0x3c6ae4]),'ChatWebsiteId':Number(_0x38042e[_0x7947('0x67')]['id'])});}}else{socket['emit'](_0x7947('0x11f'),{'UserId':Number(_0x38042e[_0x7947('0x49')][_0x7947('0x73')]),'ChatWebsiteId':Number(_0x38042e['params']['id'])});}});}})['then'](respondWithStatusCode(_0x378480,null))[_0x7947('0x5c')](handleError(_0x378480,null));};exports[_0x7947('0x120')]=function(_0x163524,_0x2ab6fd,_0x43bbea){var _0x20aed8={};var _0x92657={};var _0x418fa1;var _0x59e93f;return db[_0x7947('0x43')][_0x7947('0x6c')]({'where':{'id':_0x163524[_0x7947('0x67')]['id']}})[_0x7947('0x26')](handleEntityNotFound(_0x2ab6fd,null))['then'](function(_0x29b793){if(_0x29b793){_0x418fa1=_0x29b793;_0x92657[_0x7947('0x48')]=_[_0x7947('0x4a')](db[_0x7947('0xca')][_0x7947('0x44')]);_0x92657['query']=_['keys'](_0x163524[_0x7947('0x49')]);_0x92657[_0x7947('0x4b')]=_[_0x7947('0x4c')](_0x92657['model'],_0x92657[_0x7947('0x49')]);_0x20aed8[_0x7947('0x4d')]=_[_0x7947('0x4c')](_0x92657[_0x7947('0x48')],qs[_0x7947('0x4e')](_0x163524[_0x7947('0x49')][_0x7947('0x4e')]));_0x20aed8[_0x7947('0x4d')]=_0x20aed8[_0x7947('0x4d')][_0x7947('0x5f')]?_0x20aed8[_0x7947('0x4d')]:_0x92657['model'];_0x20aed8['order']=qs[_0x7947('0x51')](_0x163524[_0x7947('0x49')][_0x7947('0x51')]);_0x20aed8[_0x7947('0x53')]=qs['filters'](_['pick'](_0x163524[_0x7947('0x49')],_0x92657['filters']));if(_0x163524[_0x7947('0x49')][_0x7947('0x56')]){_0x20aed8[_0x7947('0x53')]=_['merge'](_0x20aed8[_0x7947('0x53')],{'$or':_[_0x7947('0x42')](_0x20aed8[_0x7947('0x4d')],function(_0x203807){var _0x1b6aad={};_0x1b6aad[_0x203807]={'$like':'%'+_0x163524[_0x7947('0x49')][_0x7947('0x56')]+'%'};return _0x1b6aad;})});}_0x20aed8=_[_0x7947('0x54')]({},_0x20aed8,_0x163524[_0x7947('0x57')]);return _0x418fa1[_0x7947('0x120')](_0x20aed8);}})[_0x7947('0x26')](function(_0x319e16){if(_0x319e16){_0x59e93f=_0x319e16[_0x7947('0x5f')];if(!_0x163524[_0x7947('0x49')][_0x7947('0x6d')](_0x7947('0x4f'))){_0x20aed8[_0x7947('0x34')]=qs[_0x7947('0x34')](_0x163524[_0x7947('0x49')][_0x7947('0x34')]);_0x20aed8[_0x7947('0x33')]=qs[_0x7947('0x33')](_0x163524[_0x7947('0x49')][_0x7947('0x33')]);}return _0x418fa1[_0x7947('0x120')](_0x20aed8);}})[_0x7947('0x26')](function(_0x212339){if(_0x212339){return _0x212339?{'count':_0x59e93f,'rows':_0x212339}:null;}})['then'](respondWithResult(_0x2ab6fd,null))[_0x7947('0x5c')](handleError(_0x2ab6fd,null));};
\ No newline at end of file
+var _0x4944=['include','findAll','rows','show','params','options','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','body','destroy','describe','addDisposition','ChatWebsiteId','Disposition','getDispositions','findOne','nolimit','pick','removeDispositions','ids','addAnswer','CannedAnswer','removeAnswers','addLogo','sitepic','filename','addAvatar','agentAvatar','file','addCustomerAvatar','customerAvatar','addSystemAvatar','systemAvatar','join','root','server/files/images/logos/default_logo.svg','../../config/license/util','getLicense','custom','isNil','existsSync','server/files/images/logos/','server/files/images/avatars/default_avatar.png','server/files/images/avatars/','download','getCustomerAvatar','showCustomerAvatar','server/files/images/avatars/system_avatar.png','notify','headers','user-agent','getResult','CmContact','no\x20available\x20attributes','difference','createdAt','updatedAt','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','includes','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','List','Contacts','DESC','ChatApplication','account','Applications','applications','priority','asc','ListId','contact','customerIp','cf-connecting-ip','x-forwarded-for','split','lastName','x-real-port','referer','browser','version','format','unknown','%s\x20%s','vendor','device','stringify','threadId','ChatInteraction','externalUrl','ContactId','interaction','firstName','messageId','created','autoclose','unmanaged','*,*,*,*','ChatMessage','AttachmentId','UserId','User','agent','waitForTheAssignedAgent','forcedOwnership','startRouting','Start','EventManager','offline','CompanyId','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','findOrCreate','spread','readFileSync','server/files/templates/chatOfflineMessage.ejs','render','toPairs','MailAccount','forwardOfflineAddress','Smtp','service','host','port','pass','SendMail','email','offlineMessageSubject','addInteraction','omit','getInteractions','Contact','Owner','internal','Tags','color','tag','Command','getSnippet','timezone','iftime\x20%s,%s','iftime\x20%s','indexOf','true','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','interval','ONLINE','OFFLINE','No\x20timezone','inspect','Interval','Intervals','getProactiveActions','virtual','License','increment','chatLicenseExceeded','push','all','some','server/files/chat/iframe.js','utf8','remote','x-real-ip','connection','replace','textColor','addApplications','sequelize','bulkCreate','getApplications','addProactiveActions','chatProactiveAction','ChatProactiveAction','getFields','false','onlineForm','items','fromKey','getOfflineMessages','emit','userChatWebsite:save','removeAgents','isArray','userChatWebsite:remove','getAgents','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','to-csv','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','redis','defaults','./chatWebsite.socket','jayson/promise','client','http','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','sendStatus','status','json','count','offset','limit','set','apply','reject','update','get','ChatWebsites','UserProfileResource','end','stack','name','send','Pause','mandatoryDispositionPause','map','ChatWebsite','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','filter','merge','where','VIRTUAL','includeAll'];(function(_0x56f7e2,_0x145392){var _0x36240b=function(_0x216ff7){while(--_0x216ff7){_0x56f7e2['push'](_0x56f7e2['shift']());}};_0x36240b(++_0x145392);}(_0x4944,0x1d5));var _0x4494=function(_0x169f72,_0x15cb6a){_0x169f72=_0x169f72-0x0;var _0x1b6211=_0x4944[_0x169f72];return _0x1b6211;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x4494('0x0'));var zipdir=require(_0x4494('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x4494('0x2'));var moment=require(_0x4494('0x3'));var BPromise=require(_0x4494('0x4'));var Mustache=require(_0x4494('0x5'));var util=require(_0x4494('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x4494('0x7'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x4494('0x8'));var squel=require(_0x4494('0x9'));var crypto=require(_0x4494('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x4494('0x7'));var querystring=require(_0x4494('0xb'));var Papa=require(_0x4494('0xc'));var Redis=require(_0x4494('0xd'));var authService=require(_0x4494('0xe'));var qs=require(_0x4494('0xf'));var as=require(_0x4494('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x4494('0x11'));var utils=require(_0x4494('0x12'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config[_0x4494('0x13')]=_[_0x4494('0x14')](config[_0x4494('0x13')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x4494('0x15'))['register'](socket);var jayson=require(_0x4494('0x16'));var client=jayson[_0x4494('0x17')][_0x4494('0x18')]({'port':0x232c});var client9002=jayson['client']['http']({'port':0x232a});var client9003=jayson[_0x4494('0x17')][_0x4494('0x18')]({'port':0x232b});function checkPasswordPattern(_0x14c7af,_0x575697,_0x22bd8d){if(_0x22bd8d){var _0x5d08b2=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x5d08b2['test'](_0x575697)){return _0x14c7af;}else{throw new db[(_0x4494('0x19'))][(_0x4494('0x1a'))](_0x4494('0x1b'));}}else{return _0x14c7af;}}function respondWithRpcPromise(_0x59bfb3,_0x1e777b,_0x8200d6,_0x36c558){return new BPromise(function(_0x402552,_0x30b9c1){var _0x32b0a4=_0x36c558||client;return _0x32b0a4[_0x4494('0x1c')](_0x59bfb3,_0x8200d6)[_0x4494('0x1d')](function(_0x502646){logger[_0x4494('0x1e')](_0x4494('0x1f'),_0x1e777b,_0x4494('0x20'));logger['debug']('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x1e777b,_0x4494('0x20'),JSON['stringify'](_0x502646));if(_0x502646[_0x4494('0x21')]){if(_0x502646['error'][_0x4494('0x22')]===0x1f4){logger[_0x4494('0x21')](_0x4494('0x1f'),_0x1e777b,_0x502646[_0x4494('0x21')][_0x4494('0x23')]);return _0x30b9c1(_0x502646[_0x4494('0x21')][_0x4494('0x23')]);}logger[_0x4494('0x21')]('ChatWebsite,\x20%s,\x20%s',_0x1e777b,_0x502646[_0x4494('0x21')]['message']);return _0x402552(_0x502646[_0x4494('0x21')][_0x4494('0x23')]);}else{logger['info'](_0x4494('0x1f'),_0x1e777b,_0x4494('0x20'));_0x402552(_0x502646[_0x4494('0x24')]['message']);}})[_0x4494('0x25')](function(_0x31e527){logger['error'](_0x4494('0x1f'),_0x1e777b,_0x31e527);_0x30b9c1(_0x31e527);});});}function respondWithStatusCode(_0x5f0009,_0x2a4509){_0x2a4509=_0x2a4509||0xcc;return function(_0x507a6a){if(_0x507a6a){return _0x5f0009[_0x4494('0x26')](_0x2a4509);}return _0x5f0009[_0x4494('0x27')](_0x2a4509)['end']();};}function respondWithResult(_0x1fcff5,_0x3a2307){_0x3a2307=_0x3a2307||0xc8;return function(_0x3c0965){if(_0x3c0965){return _0x1fcff5[_0x4494('0x27')](_0x3a2307)[_0x4494('0x28')](_0x3c0965);}};}function respondWithFilteredResult(_0x39d59d,_0x1741db){return function(_0x4203b){if(_0x4203b){var _0x550291=_0x4203b[_0x4494('0x29')],_0x56e8ad=_0x1741db['offset'],_0x594f5b=_0x1741db[_0x4494('0x2a')]+_0x1741db[_0x4494('0x2b')],_0x5898d7;if(_0x594f5b>=_0x550291){_0x594f5b=_0x550291;_0x5898d7=0xc8;}else{_0x5898d7=0xce;}_0x39d59d[_0x4494('0x27')](_0x5898d7);return _0x39d59d[_0x4494('0x2c')]('Content-Range',_0x56e8ad+'-'+_0x594f5b+'/'+_0x550291)['json'](_0x4203b);}return null;};}function patchUpdates(_0x285804){return function(_0x469c18){try{jsonpatch[_0x4494('0x2d')](_0x469c18,_0x285804,!![]);}catch(_0x41ff6c){return BPromise[_0x4494('0x2e')](_0x41ff6c);}return _0x469c18['save']();};}function saveUpdates(_0x3f3320,_0x1e7331){return function(_0x5c1131){if(_0x5c1131){return _0x5c1131[_0x4494('0x2f')](_0x3f3320)[_0x4494('0x1d')](function(_0x1528c3){return _0x1528c3;});}return null;};}function removeEntity(_0x342be5,_0x17d008){return function(_0x2528f2){if(_0x2528f2){return _0x2528f2['destroy']()['then'](function(){var _0x5e10ab=_0x2528f2[_0x4494('0x30')]({'plain':!![]});var _0x225484=_0x4494('0x31');return db[_0x4494('0x32')]['destroy']({'where':{'type':_0x225484,'resourceId':_0x5e10ab['id']}})['then'](function(){return _0x2528f2;});})[_0x4494('0x1d')](function(){_0x342be5[_0x4494('0x27')](0xcc)[_0x4494('0x33')]();});}};}function handleEntityNotFound(_0x382c57,_0x4abcbf){return function(_0x1e1e8a){if(!_0x1e1e8a){_0x382c57['sendStatus'](0x194);}return _0x1e1e8a;};}function handleError(_0x10f988,_0x4f8889){_0x4f8889=_0x4f8889||0x1f4;return function(_0x152347){logger['error'](_0x152347[_0x4494('0x34')]);if(_0x152347[_0x4494('0x35')]){delete _0x152347[_0x4494('0x35')];}_0x10f988[_0x4494('0x27')](_0x4f8889)[_0x4494('0x36')](_0x152347);};}exports['index']=function(_0x528af9,_0x3f906f){var _0x4c77a8={'include':[{'model':db[_0x4494('0x37')],'as':_0x4494('0x38')}]},_0x201942={},_0x119221={'count':0x0,'rows':[]};var _0x1954dc=_[_0x4494('0x39')](db[_0x4494('0x3a')][_0x4494('0x3b')],function(_0x303139){return{'name':_0x303139[_0x4494('0x3c')],'type':_0x303139[_0x4494('0x3d')][_0x4494('0x3e')]};});_0x201942[_0x4494('0x3f')]=_['map'](_0x1954dc,_0x4494('0x35'));_0x201942[_0x4494('0x40')]=_[_0x4494('0x41')](_0x528af9['query']);_0x201942[_0x4494('0x42')]=_['intersection'](_0x201942['model'],_0x201942[_0x4494('0x40')]);_0x4c77a8['attributes']=_[_0x4494('0x43')](_0x201942[_0x4494('0x3f')],qs[_0x4494('0x44')](_0x528af9[_0x4494('0x40')][_0x4494('0x44')]));_0x4c77a8['attributes']=_0x4c77a8[_0x4494('0x45')][_0x4494('0x46')]?_0x4c77a8[_0x4494('0x45')]:_0x201942[_0x4494('0x3f')];if(!_0x528af9['query'][_0x4494('0x47')]('nolimit')){_0x4c77a8['limit']=qs[_0x4494('0x2b')](_0x528af9['query'][_0x4494('0x2b')]);_0x4c77a8['offset']=qs[_0x4494('0x2a')](_0x528af9[_0x4494('0x40')][_0x4494('0x2a')]);}_0x4c77a8[_0x4494('0x48')]=qs[_0x4494('0x49')](_0x528af9[_0x4494('0x40')][_0x4494('0x49')]);_0x4c77a8['where']=qs[_0x4494('0x42')](_['pick'](_0x528af9[_0x4494('0x40')],_0x201942[_0x4494('0x42')]),_0x1954dc);if(_0x528af9[_0x4494('0x40')][_0x4494('0x4a')]){_0x4c77a8['where']=_[_0x4494('0x4b')](_0x4c77a8[_0x4494('0x4c')],{'$or':_[_0x4494('0x39')](_0x1954dc,function(_0x290b26){if(_0x290b26[_0x4494('0x3d')]!==_0x4494('0x4d')){var _0x464b1b={};_0x464b1b[_0x290b26[_0x4494('0x35')]]={'$like':'%'+_0x528af9[_0x4494('0x40')][_0x4494('0x4a')]+'%'};return _0x464b1b;}})});}_0x4c77a8=_['merge']({},_0x4c77a8,_0x528af9['options']);var _0x20564a={'where':_0x4c77a8[_0x4494('0x4c')]};return db[_0x4494('0x3a')][_0x4494('0x29')](_0x20564a)[_0x4494('0x1d')](function(_0x552e6d){_0x119221['count']=_0x552e6d;if(_0x528af9['query'][_0x4494('0x4e')]){_0x4c77a8[_0x4494('0x4f')]=[{'all':!![]}];}return db[_0x4494('0x3a')][_0x4494('0x50')](_0x4c77a8);})[_0x4494('0x1d')](function(_0x1dfd19){_0x119221[_0x4494('0x51')]=_0x1dfd19;return _0x119221;})['then'](respondWithFilteredResult(_0x3f906f,_0x4c77a8))[_0x4494('0x25')](handleError(_0x3f906f,null));};exports[_0x4494('0x52')]=function(_0x2c79f5,_0x42b41e){var _0x415974={'raw':![],'where':{'id':_0x2c79f5[_0x4494('0x53')]['id']},'include':[{'model':db[_0x4494('0x37')],'as':_0x4494('0x38')}]},_0x24f3bc={};_0x24f3bc[_0x4494('0x3f')]=_[_0x4494('0x41')](db[_0x4494('0x3a')][_0x4494('0x3b')]);_0x24f3bc['query']=_[_0x4494('0x41')](_0x2c79f5['query']);_0x24f3bc[_0x4494('0x42')]=_[_0x4494('0x43')](_0x24f3bc[_0x4494('0x3f')],_0x24f3bc['query']);_0x415974['attributes']=_[_0x4494('0x43')](_0x24f3bc[_0x4494('0x3f')],qs[_0x4494('0x44')](_0x2c79f5['query'][_0x4494('0x44')]));_0x415974[_0x4494('0x45')]=_0x415974[_0x4494('0x45')][_0x4494('0x46')]?_0x415974['attributes']:_0x24f3bc[_0x4494('0x3f')];if(_0x2c79f5[_0x4494('0x40')][_0x4494('0x4e')]){_0x415974[_0x4494('0x4f')]=[{'all':!![]}];}_0x415974=_[_0x4494('0x4b')]({},_0x415974,_0x2c79f5[_0x4494('0x54')]);return db[_0x4494('0x3a')][_0x4494('0x55')](_0x415974)[_0x4494('0x1d')](handleEntityNotFound(_0x42b41e,null))['then'](respondWithResult(_0x42b41e,null))['catch'](handleError(_0x42b41e,null));};exports['create']=function(_0x268ee6,_0x294604){return db[_0x4494('0x3a')][_0x4494('0x56')](_0x268ee6['body'],{})[_0x4494('0x1d')](function(_0x2e52cd){var _0x3dfa73=_0x268ee6[_0x4494('0x57')][_0x4494('0x30')]({'plain':!![]});if(!_0x3dfa73)throw new Error(_0x4494('0x58'));if(_0x3dfa73[_0x4494('0x59')]===_0x4494('0x57')){var _0x4fec05=_0x2e52cd[_0x4494('0x30')]({'plain':!![]});var _0x5a9011=_0x4494('0x31');return db[_0x4494('0x5a')][_0x4494('0x55')]({'where':{'name':_0x5a9011,'userProfileId':_0x3dfa73['userProfileId']},'raw':!![]})['then'](function(_0x134eab){if(_0x134eab&&_0x134eab[_0x4494('0x5b')]===0x0){return db[_0x4494('0x32')][_0x4494('0x56')]({'name':_0x4fec05[_0x4494('0x35')],'resourceId':_0x4fec05['id'],'type':_0x134eab[_0x4494('0x35')],'sectionId':_0x134eab['id']},{})['then'](function(){return _0x2e52cd;});}else{return _0x2e52cd;}})['catch'](function(_0x4c80c7){logger[_0x4494('0x21')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4c80c7);throw _0x4c80c7;});}return _0x2e52cd;})[_0x4494('0x1d')](respondWithResult(_0x294604,0xc9))[_0x4494('0x25')](handleError(_0x294604,null));};exports[_0x4494('0x2f')]=function(_0x55bf14,_0x3e0ec8){if(_0x55bf14['body']['id']){delete _0x55bf14[_0x4494('0x5c')]['id'];}return db[_0x4494('0x3a')][_0x4494('0x55')]({'where':{'id':_0x55bf14[_0x4494('0x53')]['id']},'include':[{'model':db[_0x4494('0x37')],'as':_0x4494('0x38')}]})[_0x4494('0x1d')](handleEntityNotFound(_0x3e0ec8,null))[_0x4494('0x1d')](saveUpdates(_0x55bf14[_0x4494('0x5c')],null))['then'](respondWithResult(_0x3e0ec8,null))['catch'](handleError(_0x3e0ec8,null));};exports[_0x4494('0x5d')]=function(_0x1dcd7d,_0x49edaf){return db['ChatWebsite'][_0x4494('0x55')]({'where':{'id':_0x1dcd7d['params']['id']}})['then'](handleEntityNotFound(_0x49edaf,null))[_0x4494('0x1d')](removeEntity(_0x49edaf,null))[_0x4494('0x25')](handleError(_0x49edaf,null));};exports[_0x4494('0x5e')]=function(_0x4f680a,_0x2b7180){return db[_0x4494('0x3a')][_0x4494('0x5e')]()[_0x4494('0x1d')](respondWithResult(_0x2b7180,null))[_0x4494('0x25')](handleError(_0x2b7180,null));};exports[_0x4494('0x5f')]=function(_0x3f57ca,_0x4fa412,_0x5ae803){if(_0x3f57ca[_0x4494('0x5c')]['id']){delete _0x3f57ca[_0x4494('0x5c')]['id'];}return db[_0x4494('0x3a')][_0x4494('0x55')]({'where':{'id':_0x3f57ca['params']['id']}})[_0x4494('0x1d')](handleEntityNotFound(_0x4fa412,null))[_0x4494('0x1d')](function(_0x448068){if(_0x448068){_0x3f57ca[_0x4494('0x5c')][_0x4494('0x60')]=_0x448068['id'];return db[_0x4494('0x61')][_0x4494('0x56')](_0x3f57ca[_0x4494('0x5c')]);}})['then'](respondWithResult(_0x4fa412,null))[_0x4494('0x25')](handleError(_0x4fa412,null));};exports[_0x4494('0x62')]=function(_0x52c530,_0x2bdca6,_0x1e5fd9){var _0x3f01a2={'raw':![],'where':{}};var _0x563767={};var _0x5cc95f={'count':0x0,'rows':[]};return db[_0x4494('0x3a')][_0x4494('0x63')]({'where':{'id':_0x52c530[_0x4494('0x53')]['id']}})[_0x4494('0x1d')](handleEntityNotFound(_0x2bdca6,null))[_0x4494('0x1d')](function(_0x35f0fc){if(_0x35f0fc){_0x563767['model']=_[_0x4494('0x41')](db[_0x4494('0x61')]['rawAttributes']);_0x563767['query']=_['keys'](_0x52c530['query']);_0x563767[_0x4494('0x42')]=_[_0x4494('0x43')](_0x563767[_0x4494('0x3f')],_0x563767[_0x4494('0x40')]);_0x3f01a2['attributes']=_[_0x4494('0x43')](_0x563767[_0x4494('0x3f')],qs[_0x4494('0x44')](_0x52c530[_0x4494('0x40')][_0x4494('0x44')]));_0x3f01a2['attributes']=_0x3f01a2[_0x4494('0x45')][_0x4494('0x46')]?_0x3f01a2[_0x4494('0x45')]:_0x563767[_0x4494('0x3f')];if(!_0x52c530[_0x4494('0x40')]['hasOwnProperty'](_0x4494('0x64'))){_0x3f01a2[_0x4494('0x2b')]=qs[_0x4494('0x2b')](_0x52c530[_0x4494('0x40')][_0x4494('0x2b')]);_0x3f01a2[_0x4494('0x2a')]=qs['offset'](_0x52c530[_0x4494('0x40')][_0x4494('0x2a')]);}_0x3f01a2[_0x4494('0x48')]=qs[_0x4494('0x49')](_0x52c530[_0x4494('0x40')][_0x4494('0x49')]);_0x3f01a2[_0x4494('0x4c')]=qs[_0x4494('0x42')](_[_0x4494('0x65')](_0x52c530['query'],_0x563767[_0x4494('0x42')]));_0x3f01a2[_0x4494('0x4c')]['ChatWebsiteId']=_0x35f0fc['id'];if(_0x52c530[_0x4494('0x40')][_0x4494('0x4a')]){_0x3f01a2[_0x4494('0x4c')]=_[_0x4494('0x4b')](_0x3f01a2[_0x4494('0x4c')],{'$or':_[_0x4494('0x39')](_0x3f01a2['attributes'],function(_0x3bf76e){var _0x12b0f4={};_0x12b0f4[_0x3bf76e]={'$like':'%'+_0x52c530[_0x4494('0x40')]['filter']+'%'};return _0x12b0f4;})});}_0x3f01a2=_[_0x4494('0x4b')]({},_0x3f01a2,_0x52c530[_0x4494('0x54')]);return db[_0x4494('0x61')][_0x4494('0x29')]({'where':_0x3f01a2[_0x4494('0x4c')]})[_0x4494('0x1d')](function(_0x37fa91){_0x5cc95f[_0x4494('0x29')]=_0x37fa91;if(_0x52c530[_0x4494('0x40')][_0x4494('0x4e')]){_0x3f01a2[_0x4494('0x4f')]=[{'all':!![]}];}return db[_0x4494('0x61')][_0x4494('0x50')](_0x3f01a2);})[_0x4494('0x1d')](function(_0x2cc99c){_0x5cc95f[_0x4494('0x51')]=_0x2cc99c;return _0x5cc95f;});}})[_0x4494('0x1d')](respondWithFilteredResult(_0x2bdca6,_0x3f01a2))[_0x4494('0x25')](handleError(_0x2bdca6,null));};exports['removeDispositions']=function(_0x3d59b5,_0x4ea63c,_0x172cab){return db[_0x4494('0x3a')][_0x4494('0x55')]({'where':{'id':_0x3d59b5[_0x4494('0x53')]['id']}})[_0x4494('0x1d')](handleEntityNotFound(_0x4ea63c,null))[_0x4494('0x1d')](function(_0x4c8e68){if(_0x4c8e68){return _0x4c8e68[_0x4494('0x66')](_0x3d59b5[_0x4494('0x40')][_0x4494('0x67')]);}})['then'](respondWithStatusCode(_0x4ea63c,null))[_0x4494('0x25')](handleError(_0x4ea63c,null));};exports[_0x4494('0x68')]=function(_0x17d58a,_0x1eb876,_0x5b751f){if(_0x17d58a['body']['id']){delete _0x17d58a['body']['id'];}return db[_0x4494('0x3a')][_0x4494('0x55')]({'where':{'id':_0x17d58a[_0x4494('0x53')]['id']}})[_0x4494('0x1d')](handleEntityNotFound(_0x1eb876,null))[_0x4494('0x1d')](function(_0x15fdc5){if(_0x15fdc5){_0x17d58a[_0x4494('0x5c')][_0x4494('0x60')]=_0x15fdc5['id'];return db[_0x4494('0x69')][_0x4494('0x56')](_0x17d58a[_0x4494('0x5c')]);}})['then'](respondWithResult(_0x1eb876,null))[_0x4494('0x25')](handleError(_0x1eb876,null));};exports['getAnswers']=function(_0x486802,_0x2322fc,_0x25e28a){var _0x1cbd42={'raw':![],'where':{}};var _0x737cb3={};var _0x1797e1={'count':0x0,'rows':[]};return db['ChatWebsite']['findOne']({'where':{'id':_0x486802['params']['id']}})['then'](handleEntityNotFound(_0x2322fc,null))[_0x4494('0x1d')](function(_0x1caabf){if(_0x1caabf){_0x737cb3[_0x4494('0x3f')]=_[_0x4494('0x41')](db[_0x4494('0x69')][_0x4494('0x3b')]);_0x737cb3['query']=_[_0x4494('0x41')](_0x486802['query']);_0x737cb3[_0x4494('0x42')]=_[_0x4494('0x43')](_0x737cb3[_0x4494('0x3f')],_0x737cb3[_0x4494('0x40')]);_0x1cbd42[_0x4494('0x45')]=_[_0x4494('0x43')](_0x737cb3[_0x4494('0x3f')],qs[_0x4494('0x44')](_0x486802['query'][_0x4494('0x44')]));_0x1cbd42[_0x4494('0x45')]=_0x1cbd42[_0x4494('0x45')][_0x4494('0x46')]?_0x1cbd42['attributes']:_0x737cb3['model'];if(!_0x486802[_0x4494('0x40')]['hasOwnProperty']('nolimit')){_0x1cbd42['limit']=qs[_0x4494('0x2b')](_0x486802[_0x4494('0x40')][_0x4494('0x2b')]);_0x1cbd42[_0x4494('0x2a')]=qs[_0x4494('0x2a')](_0x486802[_0x4494('0x40')][_0x4494('0x2a')]);}_0x1cbd42[_0x4494('0x48')]=qs['sort'](_0x486802['query'][_0x4494('0x49')]);_0x1cbd42[_0x4494('0x4c')]=qs[_0x4494('0x42')](_[_0x4494('0x65')](_0x486802[_0x4494('0x40')],_0x737cb3[_0x4494('0x42')]));_0x1cbd42[_0x4494('0x4c')][_0x4494('0x60')]=_0x1caabf['id'];if(_0x486802[_0x4494('0x40')]['filter']){_0x1cbd42['where']=_[_0x4494('0x4b')](_0x1cbd42[_0x4494('0x4c')],{'$or':_[_0x4494('0x39')](_0x1cbd42[_0x4494('0x45')],function(_0xd7e428){var _0x34adfd={};_0x34adfd[_0xd7e428]={'$like':'%'+_0x486802[_0x4494('0x40')]['filter']+'%'};return _0x34adfd;})});}_0x1cbd42=_['merge']({},_0x1cbd42,_0x486802[_0x4494('0x54')]);return db[_0x4494('0x69')][_0x4494('0x29')]({'where':_0x1cbd42[_0x4494('0x4c')]})[_0x4494('0x1d')](function(_0x5d6878){_0x1797e1[_0x4494('0x29')]=_0x5d6878;if(_0x486802[_0x4494('0x40')][_0x4494('0x4e')]){_0x1cbd42[_0x4494('0x4f')]=[{'all':!![]}];}return db[_0x4494('0x69')][_0x4494('0x50')](_0x1cbd42);})['then'](function(_0x425cf5){_0x1797e1['rows']=_0x425cf5;return _0x1797e1;});}})[_0x4494('0x1d')](respondWithFilteredResult(_0x2322fc,_0x1cbd42))[_0x4494('0x25')](handleError(_0x2322fc,null));};exports[_0x4494('0x6a')]=function(_0x844d94,_0x188157,_0x4913fe){return db[_0x4494('0x3a')][_0x4494('0x55')]({'where':{'id':_0x844d94[_0x4494('0x53')]['id']}})[_0x4494('0x1d')](handleEntityNotFound(_0x188157,null))[_0x4494('0x1d')](function(_0x3613b4){if(_0x3613b4){return _0x3613b4[_0x4494('0x6a')](_0x844d94['query'][_0x4494('0x67')]);}})[_0x4494('0x1d')](respondWithStatusCode(_0x188157,null))[_0x4494('0x25')](handleError(_0x188157,null));};exports[_0x4494('0x6b')]=function(_0x4dc2bf,_0x579d45,_0x57fbfd){_0x4dc2bf['body'][_0x4494('0x6c')]=_0x4dc2bf['file'][_0x4494('0x6d')];return db[_0x4494('0x3a')][_0x4494('0x55')]({'where':{'id':_0x4dc2bf['params']['id']}})[_0x4494('0x1d')](handleEntityNotFound(_0x579d45,null))[_0x4494('0x1d')](saveUpdates(_0x4dc2bf[_0x4494('0x5c')],null))[_0x4494('0x1d')](respondWithResult(_0x579d45,null))['catch'](handleError(_0x579d45,null));};exports[_0x4494('0x6e')]=function(_0x3c613f,_0x2d64e5,_0x3add65){_0x3c613f['body'][_0x4494('0x6f')]=_0x3c613f[_0x4494('0x70')][_0x4494('0x6d')];return db[_0x4494('0x3a')]['find']({'where':{'id':_0x3c613f[_0x4494('0x53')]['id']}})['then'](handleEntityNotFound(_0x2d64e5,null))[_0x4494('0x1d')](saveUpdates(_0x3c613f[_0x4494('0x5c')],null))['then'](respondWithResult(_0x2d64e5,null))[_0x4494('0x25')](handleError(_0x2d64e5,null));};exports[_0x4494('0x71')]=function(_0x55ff3b,_0x3cfa6c,_0x402ab8){_0x55ff3b[_0x4494('0x5c')][_0x4494('0x72')]=_0x55ff3b[_0x4494('0x70')][_0x4494('0x6d')];return db['ChatWebsite'][_0x4494('0x55')]({'where':{'id':_0x55ff3b[_0x4494('0x53')]['id']}})[_0x4494('0x1d')](handleEntityNotFound(_0x3cfa6c,null))[_0x4494('0x1d')](saveUpdates(_0x55ff3b[_0x4494('0x5c')],null))['then'](respondWithResult(_0x3cfa6c,null))[_0x4494('0x25')](handleError(_0x3cfa6c,null));};exports[_0x4494('0x73')]=function(_0x15d54a,_0x114c0f,_0x11950d){_0x15d54a[_0x4494('0x5c')][_0x4494('0x74')]=_0x15d54a[_0x4494('0x70')][_0x4494('0x6d')];return db['ChatWebsite'][_0x4494('0x55')]({'where':{'id':_0x15d54a[_0x4494('0x53')]['id']}})[_0x4494('0x1d')](handleEntityNotFound(_0x114c0f,null))[_0x4494('0x1d')](saveUpdates(_0x15d54a[_0x4494('0x5c')],null))[_0x4494('0x1d')](respondWithResult(_0x114c0f,null))['catch'](handleError(_0x114c0f,null));};exports['getLogo']=function(_0xdb7fbd,_0x36cc4d,_0x37b894){var _0xc58a4c=path[_0x4494('0x75')](config[_0x4494('0x76')],_0x4494('0x77'));var _0x397f88={'where':{'id':_0xdb7fbd[_0x4494('0x53')]['id']},'attributes':['id',_0x4494('0x6c')],'raw':!![]};var _0x1fad78=![];return require(_0x4494('0x78'))[_0x4494('0x79')]()[_0x4494('0x1d')](function(_0x1ce96a){if(_0x1ce96a){_0x1fad78=_0x1ce96a[_0x4494('0x7a')];}})['then'](function(){return db['ChatWebsite']['find'](_0x397f88);})['then'](handleEntityNotFound(_0x36cc4d,null))[_0x4494('0x1d')](function(_0x254c15){if(_0x254c15){if(!_[_0x4494('0x7b')](_0x254c15[_0x4494('0x6c')])){if(fs[_0x4494('0x7c')](path['join'](config['root'],'server/files/images/logos/',_0x254c15[_0x4494('0x6c')]))&&_0x1fad78){_0xc58a4c=path[_0x4494('0x75')](config[_0x4494('0x76')],_0x4494('0x7d'),_0x254c15[_0x4494('0x6c')]);}}return _0x36cc4d['download'](_0xc58a4c);}})[_0x4494('0x25')](handleError(_0x36cc4d,null));};exports['getAvatar']=function(_0x89780b,_0x3e58ea,_0x101e0f){var _0x15bda6=path[_0x4494('0x75')](config['root'],_0x4494('0x7e'));var _0x26649d={'where':{'id':_0x89780b[_0x4494('0x53')]['id']},'attributes':['id',_0x4494('0x6f')],'raw':!![]};return db[_0x4494('0x3a')][_0x4494('0x55')](_0x26649d)['then'](handleEntityNotFound(_0x3e58ea,null))[_0x4494('0x1d')](function(_0x878257){if(_0x878257){if(!_['isNil'](_0x878257[_0x4494('0x6f')])){if(fs['existsSync'](path[_0x4494('0x75')](config[_0x4494('0x76')],_0x4494('0x7f'),_0x878257[_0x4494('0x6f')]))){_0x15bda6=path[_0x4494('0x75')](config[_0x4494('0x76')],'server/files/images/avatars/',_0x878257[_0x4494('0x6f')]);}}return _0x3e58ea[_0x4494('0x80')](_0x15bda6);}})[_0x4494('0x25')](handleError(_0x3e58ea,null));};exports[_0x4494('0x81')]=function(_0xcd2cc6,_0x42390c,_0x8ef58b){var _0x208ee4=path[_0x4494('0x75')](config[_0x4494('0x76')],'server/files/images/avatars/customer_avatar.png');var _0x211fec={'where':{'id':_0xcd2cc6['params']['id']},'attributes':['id',_0x4494('0x72'),'showCustomerAvatar'],'raw':!![]};return db['ChatWebsite'][_0x4494('0x55')](_0x211fec)[_0x4494('0x1d')](handleEntityNotFound(_0x42390c,null))[_0x4494('0x1d')](function(_0xdb0f0a){if(_0xdb0f0a){if(!_['isNil'](_0xdb0f0a[_0x4494('0x72')])){if(fs['existsSync'](path[_0x4494('0x75')](config[_0x4494('0x76')],'server/files/images/avatars/',_0xdb0f0a[_0x4494('0x72')]))&&_0xdb0f0a[_0x4494('0x82')]){_0x208ee4=path['join'](config[_0x4494('0x76')],_0x4494('0x7f'),_0xdb0f0a['customerAvatar']);}}return _0x42390c['download'](_0x208ee4);}})[_0x4494('0x25')](handleError(_0x42390c,null));};exports['getSystemAvatar']=function(_0xc7af92,_0x279778,_0x1aabca){var _0x38bf4a=path[_0x4494('0x75')](config[_0x4494('0x76')],_0x4494('0x83'));var _0x87b971={'where':{'id':_0xc7af92['params']['id']},'attributes':['id',_0x4494('0x74')],'raw':!![]};return db[_0x4494('0x3a')]['find'](_0x87b971)[_0x4494('0x1d')](handleEntityNotFound(_0x279778,null))[_0x4494('0x1d')](function(_0x2173e4){if(_0x2173e4){if(!_[_0x4494('0x7b')](_0x2173e4[_0x4494('0x74')])){if(fs[_0x4494('0x7c')](path[_0x4494('0x75')](config[_0x4494('0x76')],'server/files/images/avatars/',_0x2173e4[_0x4494('0x74')]))){_0x38bf4a=path[_0x4494('0x75')](config[_0x4494('0x76')],'server/files/images/avatars/',_0x2173e4[_0x4494('0x74')]);}}return _0x279778[_0x4494('0x80')](_0x38bf4a);}})['catch'](handleError(_0x279778,null));};exports[_0x4494('0x84')]=function(_0x37e665,_0x3a32c8,_0x49ae38){var _0x267c60=require('user-agent-parser');var _0x14d22f=new _0x267c60();var _0x3043c9=_0x14d22f['setUA'](_0x37e665[_0x4494('0x85')][_0x4494('0x86')])[_0x4494('0x87')]();var _0x5912f1={'body':_0x37e665[_0x4494('0x5c')],'channel':'chat'};var _0x3679bf=[];var _0x215599=[];var _0x476674={};var _0x137b33=![];return db[_0x4494('0x88')][_0x4494('0x5e')]()[_0x4494('0x1d')](function(_0x1cc85f){if(!_0x1cc85f){throw new db[(_0x4494('0x19'))][(_0x4494('0x1a'))](_0x4494('0x89'));}_0x3679bf=_[_0x4494('0x8a')](_[_0x4494('0x41')](_0x1cc85f),[_0x4494('0x8b'),_0x4494('0x8c')]);_0x215599=_[_0x4494('0x8a')](_[_0x4494('0x41')](_0x1cc85f),[_0x4494('0x8b'),'updatedAt','CompanyId','ListId']);if(_0x37e665[_0x4494('0x5c')]['id']){delete _0x37e665[_0x4494('0x5c')]['id'];}if(_[_0x4494('0x7b')](_0x37e665[_0x4494('0x5c')][_0x4494('0x8d')])){throw new db[(_0x4494('0x19'))][(_0x4494('0x1a'))](_0x4494('0x8e'));}if(_[_0x4494('0x7b')](_0x37e665[_0x4494('0x5c')][_0x4494('0x5c')])||_0x37e665[_0x4494('0x5c')][_0x4494('0x5c')]===''){throw new db[(_0x4494('0x19'))][(_0x4494('0x1a'))](_0x4494('0x8f'));}if(_[_0x4494('0x7b')](_0x37e665[_0x4494('0x5c')]['mapKey'])){throw new db[(_0x4494('0x19'))][(_0x4494('0x1a'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x215599);}if(!_[_0x4494('0x90')](_0x215599,_0x37e665[_0x4494('0x5c')][_0x4494('0x91')])){throw new db['Sequelize'][(_0x4494('0x1a'))](_0x4494('0x92')+_0x215599);}_0x476674[_0x37e665[_0x4494('0x5c')]['mapKey']]=_0x37e665[_0x4494('0x5c')]['from'];})['then'](function(){return db[_0x4494('0x3a')][_0x4494('0x55')]({'where':{'id':_0x37e665[_0x4494('0x53')]['id']},'include':[{'model':db[_0x4494('0x93')],'as':_0x4494('0x94'),'include':[{'model':db[_0x4494('0x88')],'as':_0x4494('0x95'),'where':_0x476674,'limit':0x1,'order':[['updatedAt',_0x4494('0x96')]]}]},{'model':db[_0x4494('0x97')],'as':'Applications'}]});})[_0x4494('0x1d')](handleEntityNotFound(_0x3a32c8,null))[_0x4494('0x1d')](function(_0xb11091){if(_0xb11091&&_0xb11091[_0x4494('0x94')]){_0x5912f1[_0x4494('0x98')]=_0xb11091;_0x5912f1['applications']=_0xb11091[_0x4494('0x99')];_0x5912f1['list']=_0xb11091['List'];_0x5912f1['applications']=_['orderBy'](_0x5912f1[_0x4494('0x9a')],[_0x4494('0x9b')],[_0x4494('0x9c')]);if(_0x5912f1[_0x4494('0x98')]['Applications']){delete _0x5912f1['account'][_0x4494('0x99')];}if(_0x5912f1[_0x4494('0x98')][_0x4494('0x94')]&&_0x5912f1[_0x4494('0x98')]['List'][_0x4494('0x95')][_0x4494('0x46')]){return _0x5912f1['account'][_0x4494('0x94')][_0x4494('0x95')][0x0];}var _0x196e30=_['defaults'](_0x37e665[_0x4494('0x5c')],{'firstName':_0x37e665[_0x4494('0x5c')][_0x4494('0x8d')],'ListId':_0xb11091[_0x4494('0x9d')]});_0x196e30[_0x37e665[_0x4494('0x5c')]['mapKey']]=_0x37e665[_0x4494('0x5c')]['from'];return db[_0x4494('0x88')][_0x4494('0x56')](_0x196e30,{'fields':_0x3679bf,'raw':!![]});}})[_0x4494('0x1d')](handleEntityNotFound(_0x3a32c8,null))[_0x4494('0x1d')](function(_0x1fdae8){_0x5912f1[_0x4494('0x9e')]=_0x1fdae8;var _0x27a04f=_0x37e665[_0x4494('0x5c')][_0x4494('0x9f')];if(_0x37e665['headers'][_0x4494('0xa0')]){_0x27a04f=_0x37e665['headers']['cf-connecting-ip'];}else if(_0x37e665[_0x4494('0x85')][_0x4494('0xa1')]){_0x27a04f=_['first'](_0x37e665[_0x4494('0x85')][_0x4494('0xa1')][_0x4494('0xa2')](','));}if(_0x1fdae8){var _0x4a7cb3={'ContactId':_0x1fdae8['id'],'ChatWebsiteId':_0x37e665[_0x4494('0x53')]['id'],'from':(_0x1fdae8['firstName']||'')+'\x20'+(_0x1fdae8[_0x4494('0xa3')]||''),'customerIp':_0x27a04f,'customerPort':_0x37e665[_0x4494('0x85')]['x-real-port']?_0x37e665[_0x4494('0x85')][_0x4494('0xa4')]:null,'referer':_0x37e665[_0x4494('0x5c')][_0x4494('0xa5')],'browserName':_0x3043c9['browser']['name']&&_0x3043c9[_0x4494('0xa6')][_0x4494('0xa7')]?util[_0x4494('0xa8')]('%s\x20%s',_0x3043c9[_0x4494('0xa6')][_0x4494('0x35')],_0x3043c9['browser']['version']):_0x4494('0xa9'),'browserVersion':_0x3043c9[_0x4494('0xa6')][_0x4494('0xa7')]||_0x4494('0xa9'),'osName':util[_0x4494('0xa8')](_0x4494('0xaa'),_0x3043c9['os'][_0x4494('0x35')],_0x3043c9['os'][_0x4494('0xa7')]),'osVersion':_0x3043c9['os'][_0x4494('0xa7')],'deviceModel':_0x3043c9['device'][_0x4494('0x3f')]&&_0x3043c9['device'][_0x4494('0xab')]?util[_0x4494('0xa8')]('%s\x20%s\x20%s',_0x3043c9['device']['model'],_0x3043c9[_0x4494('0xac')]['vendor'],_0x3043c9[_0x4494('0xac')][_0x4494('0x3d')]):null,'deviceVendor':_0x3043c9[_0x4494('0xac')][_0x4494('0xab')],'deviceType':_0x3043c9[_0x4494('0xac')][_0x4494('0x3d')],'formData':JSON[_0x4494('0xad')](_0x37e665[_0x4494('0x5c')])};var _0x598b3a={'ChatWebsiteId':_0x37e665[_0x4494('0x53')]['id'],'closed':![]};if(_0x37e665[_0x4494('0x5c')][_0x4494('0xae')]){_0x598b3a['threadId']=_0x37e665[_0x4494('0x5c')][_0x4494('0xae')];return db[_0x4494('0xaf')][_0x4494('0x55')]({'where':_0x598b3a})[_0x4494('0x1d')](function(_0x183aed){if(_0x183aed){return[_0x183aed,![]];}_0x4a7cb3[_0x4494('0xae')]=_0x37e665[_0x4494('0x5c')][_0x4494('0xae')];_0x4a7cb3[_0x4494('0xb0')]=_0x37e665[_0x4494('0x5c')][_0x4494('0xb0')];return db[_0x4494('0xaf')][_0x4494('0x56')](_0x4a7cb3)[_0x4494('0x1d')](function(_0x387895){return[_0x387895,!![]];});});}_0x598b3a[_0x4494('0xb1')]=_0x1fdae8['id'];if(_0x37e665['body'][_0x4494('0xb2')]&&_0x37e665['body'][_0x4494('0xb2')]['id']){_0x598b3a['id']=_0x37e665[_0x4494('0x5c')][_0x4494('0xb2')]['id'];return db[_0x4494('0xaf')]['find']({'where':_0x598b3a})[_0x4494('0x1d')](function(_0x3ad1c3){if(_0x3ad1c3){return[_0x3ad1c3,![]];}return db[_0x4494('0xaf')][_0x4494('0x56')](_0x4a7cb3)[_0x4494('0x1d')](function(_0x1b1c4b){return[_0x1b1c4b,!![]];});});}return db[_0x4494('0xaf')][_0x4494('0x56')](_0x4a7cb3)[_0x4494('0x1d')](function(_0x1b966f){return[_0x1b966f,!![]];});}})['spread'](function(_0x5170d1,_0x5b75fe){if(_0x5170d1){_0x137b33=_0x5b75fe;if(!_0x5b75fe){var _0x326c21={'from':(_0x5912f1[_0x4494('0x9e')][_0x4494('0xb3')]||'')+'\x20'+(_0x5912f1[_0x4494('0x9e')]['lastName']||'')};if(_0x37e665[_0x4494('0x5c')][_0x4494('0xae')]&&_0x37e665[_0x4494('0x5c')][_0x4494('0xb4')]&&_0x37e665['body'][_0x4494('0xae')]!=_0x37e665[_0x4494('0x5c')][_0x4494('0xb4')]){_0x326c21['threadId']=_0x37e665[_0x4494('0x5c')]['messageId'];}return _0x5170d1[_0x4494('0x2f')](_0x326c21);}else{return _0x5170d1;}}})[_0x4494('0x1d')](function(_0x20aebc){_0x5912f1[_0x4494('0xb2')]=_0x20aebc[_0x4494('0x30')]({'plain':!![]});_0x5912f1['interaction'][_0x4494('0xb5')]=_0x137b33;if(_0x5912f1[_0x4494('0xb2')]['created']){if(_0x5912f1[_0x4494('0x98')][_0x4494('0xb6')]){_0x5912f1['applications']['push']({'id':0x0,'priority':_0x5912f1['applications'][_0x4494('0x46')]+0x1,'app':'close','appdata':_0x4494('0xb7'),'interval':_0x4494('0xb8')});}}return db[_0x4494('0xb9')][_0x4494('0x56')]({'body':_0x37e665['body'][_0x4494('0x5c')],'ChatWebsiteId':_0x37e665[_0x4494('0x53')]['id'],'ChatInteractionId':_0x20aebc['id'],'direction':'in','ContactId':_0x5912f1[_0x4494('0x9e')]['id'],'AttachmentId':_0x37e665[_0x4494('0x5c')][_0x4494('0xba')]});})[_0x4494('0x1d')](function(_0x21c112){_0x5912f1['message']=_0x21c112;if(_0x5912f1[_0x4494('0xb2')][_0x4494('0xbb')]){return db[_0x4494('0xbc')][_0x4494('0x55')]({'attributes':['id',_0x4494('0x35')],'where':{'id':_0x5912f1[_0x4494('0xb2')][_0x4494('0xbb')]}})[_0x4494('0x1d')](function(_0x55bd87){if(_0x55bd87){_0x5912f1[_0x4494('0x9a')]['unshift']({'id':0x0,'priority':0x0,'app':_0x4494('0xbd'),'appdata':_0x55bd87[_0x4494('0x35')]+','+(_0x5912f1['account'][_0x4494('0xbe')]||0xa),'interval':_0x4494('0xb8')});_0x5912f1[_0x4494('0xbf')]=!![];}return respondWithRpcPromise('Start',_0x4494('0xc0'),_0x5912f1);});}return respondWithRpcPromise(_0x4494('0xc1'),_0x4494('0xc0'),_0x5912f1);})[_0x4494('0x1d')](function(_0x1b12ee){respondWithRpcPromise(_0x4494('0xc2'),_0x4494('0xc2'),{'event':_0x4494('0x84'),'message':_0x1b12ee},client9002);return _0x1b12ee;})[_0x4494('0x1d')](respondWithResult(_0x3a32c8,null))['catch'](handleError(_0x3a32c8,null));};exports[_0x4494('0xc3')]=function(_0x234e22,_0x9a63ef,_0x1b11a6){var _0x3afc45,_0x416d65,_0x40b319;var _0x338215=[];var _0x40be0f=[];var _0x3ace0b={};return db[_0x4494('0x88')]['describe']()[_0x4494('0x1d')](function(_0x46758d){if(!_0x46758d){throw new db[(_0x4494('0x19'))][(_0x4494('0x1a'))]('no\x20available\x20attributes');}_0x40be0f=_[_0x4494('0x8a')](_[_0x4494('0x41')](_0x46758d),[_0x4494('0x8b'),_0x4494('0x8c')]);_0x338215=_[_0x4494('0x8a')](_['keys'](_0x46758d),[_0x4494('0x8b'),_0x4494('0x8c'),_0x4494('0xc4'),'ListId']);if(_0x234e22[_0x4494('0x5c')]['id']){delete _0x234e22[_0x4494('0x5c')]['id'];}if(_['isNil'](_0x234e22['body'][_0x4494('0x8d')])){throw _0x9a63ef[_0x4494('0x27')](0x1f4)['send'](new db[(_0x4494('0x19'))][(_0x4494('0x1a'))](_0x4494('0x8e')));}if(_[_0x4494('0x7b')](_0x234e22['body']['body'])||_0x234e22[_0x4494('0x5c')]['body']===''){throw _0x9a63ef[_0x4494('0x27')](0x1f4)['send'](new db[(_0x4494('0x19'))][(_0x4494('0x1a'))]('body\x20is\x20mandatory\x20and\x20not\x20empty'));}if(_['isNil'](_0x234e22['body']['mapKeyOffline'])){throw _0x9a63ef['status'](0x1f4)[_0x4494('0x36')](new db[(_0x4494('0x19'))][(_0x4494('0x1a'))](_0x4494('0xc5')+_0x338215));}if(!_[_0x4494('0x90')](_0x338215,_0x234e22[_0x4494('0x5c')][_0x4494('0xc6')])){throw _0x9a63ef[_0x4494('0x27')](0x1f4)['send'](new db['Sequelize'][(_0x4494('0x1a'))](_0x4494('0xc7')+_0x338215));}_0x3ace0b[_0x234e22[_0x4494('0x5c')]['mapKeyOffline']]=_0x234e22['body']['from'];})[_0x4494('0x1d')](function(){return db[_0x4494('0x3a')][_0x4494('0x55')]({'where':{'id':_0x234e22['params']['id']},'include':[{'model':db[_0x4494('0x93')],'as':_0x4494('0x94')}]});})[_0x4494('0x1d')](handleEntityNotFound(_0x9a63ef,null))[_0x4494('0x1d')](function(_0x780083){if(_0x780083&&_0x780083[_0x4494('0x94')]){_0x416d65=_0x780083;var _0x429321=_['defaults'](_0x234e22['body'],{'firstName':_0x234e22[_0x4494('0x5c')][_0x4494('0x8d')],'phone':_0x234e22[_0x4494('0x5c')][_0x4494('0x8d')],'ListId':_0x780083[_0x4494('0x9d')]});_0x429321[_0x234e22['body'][_0x4494('0xc6')]]=_0x234e22[_0x4494('0x5c')][_0x4494('0x8d')];return db[_0x4494('0x88')][_0x4494('0xc8')]({'where':_0x3ace0b,'defaults':_0x429321});}})[_0x4494('0xc9')](function(_0x4c6679){if(_0x4c6679){_0x40b319=_0x4c6679;var _0x1f2f62=fs[_0x4494('0xca')](path[_0x4494('0x75')](config[_0x4494('0x76')],_0x4494('0xcb')),'utf8');var _0xc154cf=ejs[_0x4494('0xcc')](_0x1f2f62,{'body':_[_0x4494('0xcd')](_0x234e22[_0x4494('0x5c')][_0x4494('0x5c')]),'bodyTitle':_0x416d65['offlineMessageBody']});return db['ChatOfflineMessage'][_0x4494('0x56')]({'body':_0xc154cf,'ContactId':_0x4c6679['id'],'ChatWebsiteId':_0x416d65['id']});}})[_0x4494('0x1d')](function(_0x193f55){if(_0x193f55){_0x3afc45=_0x193f55;return db[_0x4494('0xce')][_0x4494('0x63')]({'where':{'service':!![]},'include':[{'model':db['MailServerOut'],'as':'Smtp','raw':!![]}]});}})[_0x4494('0x1d')](function(_0x391115){if(_0x391115&&_0x391115['Smtp']&&_0x416d65[_0x4494('0xcf')]){var _0x2f461b={'tls':{'rejectUnauthorized':![]}};if(_0x391115[_0x4494('0xd0')][_0x4494('0xd1')]){_0x2f461b[_0x4494('0xd1')]=_0x391115[_0x4494('0xd0')][_0x4494('0xd1')];}else{_0x2f461b[_0x4494('0xd2')]=_0x391115[_0x4494('0xd0')][_0x4494('0xd2')];_0x2f461b[_0x4494('0xd3')]=_0x391115[_0x4494('0xd0')][_0x4494('0xd3')];_0x2f461b['secure']=_0x391115['Smtp']['secure'];}if(_0x391115[_0x4494('0xd0')]['authentication']){_0x2f461b['auth']={'user':_0x391115[_0x4494('0xd0')][_0x4494('0x57')],'pass':_0x391115[_0x4494('0xd0')][_0x4494('0xd4')]};}return respondWithRpcPromise(_0x4494('0xd5'),'sendMail',{'account':_0x2f461b,'message':{'from':util[_0x4494('0xa8')]('\x22%s\x22\x20<%s>',_0x391115[_0x4494('0x35')],_0x391115[_0x4494('0xd6')]||_0x391115[_0x4494('0xd0')][_0x4494('0x57')]),'to':_0x416d65['forwardOfflineAddress'],'subject':_0x416d65[_0x4494('0xd7')],'text':_0x3afc45['body']}},client9003)[_0x4494('0x1d')](function(){return _0x3afc45;})['catch'](function(_0x341b8c){console[_0x4494('0x21')](_0x341b8c);});}})[_0x4494('0x1d')](function(){if(_0x3afc45){return _0x3afc45;}})[_0x4494('0x1d')](respondWithResult(_0x9a63ef,null))[_0x4494('0x25')](handleError(_0x9a63ef,null));};exports[_0x4494('0xd8')]=function(_0x241945,_0x51c585,_0xbe8f1b){return db[_0x4494('0xaf')][_0x4494('0x55')]({'where':{'id':_0x241945[_0x4494('0x53')]['id']}})[_0x4494('0x1d')](handleEntityNotFound(_0x51c585,null))[_0x4494('0x1d')](function(_0x411ce3){if(_0x411ce3){return _0x411ce3['addInteraction'](_0x241945['body'][_0x4494('0x67')],_[_0x4494('0xd9')](_0x241945[_0x4494('0x5c')],[_0x4494('0x67'),'id'])||{});}})[_0x4494('0x1d')](respondWithResult(_0x51c585,null))[_0x4494('0x25')](handleError(_0x51c585,null));};exports[_0x4494('0xda')]=function(_0x1d4a98,_0x10bf93,_0x3a1aab){var _0x306847={'raw':![],'where':{}};var _0x1949b0={};var _0x2a3c21={'count':0x0,'rows':[]};return db[_0x4494('0x3a')]['findOne']({'where':{'id':_0x1d4a98[_0x4494('0x53')]['id']}})['then'](handleEntityNotFound(_0x10bf93,null))[_0x4494('0x1d')](function(_0x2f6851){if(_0x2f6851){_0x1949b0[_0x4494('0x3f')]=_[_0x4494('0x41')](db[_0x4494('0xaf')][_0x4494('0x3b')]);_0x1949b0['query']=_[_0x4494('0x41')](_0x1d4a98[_0x4494('0x40')]);_0x1949b0['filters']=_[_0x4494('0x43')](_0x1949b0['model'],_0x1949b0[_0x4494('0x40')]);_0x306847[_0x4494('0x45')]=_[_0x4494('0x43')](_0x1949b0[_0x4494('0x3f')],qs[_0x4494('0x44')](_0x1d4a98['query'][_0x4494('0x44')]));_0x306847[_0x4494('0x45')]=_0x306847[_0x4494('0x45')][_0x4494('0x46')]?_0x306847[_0x4494('0x45')]:_0x1949b0[_0x4494('0x3f')];if(!_0x1d4a98['query']['hasOwnProperty'](_0x4494('0x64'))){_0x306847[_0x4494('0x2b')]=qs[_0x4494('0x2b')](_0x1d4a98[_0x4494('0x40')][_0x4494('0x2b')]);_0x306847['offset']=qs[_0x4494('0x2a')](_0x1d4a98[_0x4494('0x40')]['offset']);}_0x306847[_0x4494('0x48')]=qs[_0x4494('0x49')](_0x1d4a98[_0x4494('0x40')][_0x4494('0x49')]);_0x306847[_0x4494('0x4c')]=qs[_0x4494('0x42')](_[_0x4494('0x65')](_0x1d4a98[_0x4494('0x40')],_0x1949b0[_0x4494('0x42')]));_0x306847[_0x4494('0x4c')][_0x4494('0x60')]=_0x2f6851['id'];if(_0x1d4a98['query']['filter']){_0x306847[_0x4494('0x4c')]=_['merge'](_0x306847[_0x4494('0x4c')],{'$or':_[_0x4494('0x39')](_0x306847[_0x4494('0x45')],function(_0xdffc87){var _0x3ddf4b={};_0x3ddf4b[_0xdffc87]={'$like':'%'+_0x1d4a98['query'][_0x4494('0x4a')]+'%'};return _0x3ddf4b;})});}_0x306847=_['merge']({},_0x306847,_0x1d4a98[_0x4494('0x54')]);return db[_0x4494('0xaf')][_0x4494('0x29')]({'where':_0x306847['where']})[_0x4494('0x1d')](function(_0x292303){_0x2a3c21[_0x4494('0x29')]=_0x292303;if(_0x1d4a98[_0x4494('0x40')][_0x4494('0x4e')]){_0x306847[_0x4494('0x4f')]=[{'model':db[_0x4494('0x88')],'as':_0x4494('0xdb'),'required':![]},{'model':db[_0x4494('0xbc')],'as':_0x4494('0xdc'),'attributes':[_0x4494('0x35'),'fullname',_0x4494('0xdd')],'required':![]},{'model':db['Tag'],'as':_0x4494('0xde'),'attributes':['id',_0x4494('0x35'),_0x4494('0xdf')],'where':_0x1d4a98[_0x4494('0x40')]['tag']?{'id':_0x1d4a98[_0x4494('0x40')][_0x4494('0xe0')]}:undefined,'required':_0x1d4a98[_0x4494('0x40')][_0x4494('0xe0')]?!![]:![]}];}return db[_0x4494('0xaf')][_0x4494('0x50')](_0x306847);})['then'](function(_0x3eceb5){_0x2a3c21[_0x4494('0x51')]=_0x3eceb5;return _0x2a3c21;});}})[_0x4494('0x1d')](respondWithFilteredResult(_0x10bf93,_0x306847))[_0x4494('0x25')](handleError(_0x10bf93,null));};function iftimePromise(_0xba356f,_0x3a6ae8){return respondWithRpcPromise(_0x4494('0xe1'),_0x4494('0xe2'),{'command':_0x3a6ae8[_0x4494('0xe3')]?util[_0x4494('0xa8')](_0x4494('0xe4'),_0xba356f['interval'],_0x3a6ae8[_0x4494('0xe3')]):util[_0x4494('0xa8')](_0x4494('0xe5'),_0xba356f['interval'])},client9002)['then'](function(_0x2b2c2d){var _0x42beba=_0x2b2c2d&&_0x2b2c2d[_0x4494('0xe6')](_0x4494('0xe7'))>=0x0?!![]:![];logger[_0x4494('0x1e')](_0x4494('0xe8'),_0x3a6ae8['id'],_0xba356f['id'],_0xba356f[_0x4494('0xe9')],_0x42beba?_0x4494('0xea'):_0x4494('0xeb'),_0x3a6ae8[_0x4494('0xe3')]?_0x3a6ae8[_0x4494('0xe3')]:_0x4494('0xec'));return _0x42beba;})['catch'](function(_0xbc3860){logger['error'](_0x4494('0xe8'),_0x3a6ae8['id'],_0xba356f['id'],_0xba356f[_0x4494('0xe9')],util[_0x4494('0xed')](_0xbc3860,{'showHidden':![],'depth':null}),_0x3a6ae8[_0x4494('0xe3')]?_0x3a6ae8[_0x4494('0xe3')]:'No\x20timezone');return![];});}exports[_0x4494('0xe2')]=function(_0x5ea6d6,_0x223689,_0x488702){var _0x4c937a=0x0;var _0x5dcb9a=0x0;var _0x2b97fc=![];var _0x28a8d4;var _0x440ae6;return db[_0x4494('0x3a')]['find']({'where':{'id':_0x5ea6d6[_0x4494('0x53')]['id']},'include':[{'model':db[_0x4494('0xee')],'as':_0x4494('0xee'),'include':[{'model':db[_0x4494('0xee')],'as':_0x4494('0xef'),'attributes':['id',_0x4494('0xe9')],'raw':!![]}]}]})['then'](handleEntityNotFound(_0x223689,null))[_0x4494('0x1d')](function(_0x52c3e9){if(_0x52c3e9){_0x28a8d4=_0x52c3e9;return _0x52c3e9[_0x4494('0xf0')]({'raw':!![]});}})[_0x4494('0x1d')](function(_0x2f509c){if(_0x28a8d4){if(_0x2f509c){_0x440ae6=_0x2f509c;}}return require('../../config/license/util')[_0x4494('0x79')]();})[_0x4494('0x1d')](function(_0x4f8b43){if(_0x4f8b43){_0x5dcb9a=_0x4f8b43[_0x4494('0xf1')];_0x2b97fc=_0x4f8b43['custom'];}})['then'](function(){return db['ChatInteraction'][_0x4494('0x29')]({'where':{'closed':![]}});})[_0x4494('0x1d')](function(_0x2506ef){_0x4c937a=_0x2506ef;if(_0x5dcb9a&&_0x2506ef>_0x5dcb9a){return db[_0x4494('0xf2')][_0x4494('0x63')]({'where':{'id':0x1}})[_0x4494('0x1d')](function(_0x164b53){if(_0x164b53){_0x164b53[_0x4494('0xf3')](_0x4494('0xf4'));}});}})[_0x4494('0x1d')](function(){if(_0x28a8d4[_0x4494('0xee')]&&_0x28a8d4[_0x4494('0xee')][_0x4494('0xef')]){var _0x4570d7=[];for(var _0x332a37=0x0;_0x332a37<_0x28a8d4[_0x4494('0xee')][_0x4494('0xef')][_0x4494('0x46')];_0x332a37++){var _0x568da6=_0x28a8d4[_0x4494('0xee')][_0x4494('0xef')][_0x332a37][_0x4494('0x30')]({'plain':!![]});_0x4570d7[_0x4494('0xf5')](iftimePromise(_0x568da6,_0x28a8d4));}return BPromise[_0x4494('0xf6')](_0x4570d7)[_0x4494('0x1d')](function(_0x2c2f15){return _[_0x4494('0xf7')](_0x2c2f15);});}else{return!![];}})[_0x4494('0x1d')](function(_0x4fc543){var _0x3a9c67=fs[_0x4494('0xca')](path[_0x4494('0x75')](config[_0x4494('0x76')],_0x4494('0xf8')),_0x4494('0xf9'));var _0x2aaebe={'remote':_0x28a8d4[_0x4494('0xfa')],'query':querystring['stringify'](_[_0x4494('0x4b')](_0x28a8d4[_0x4494('0x30')]({'plain':!![]}),{'customerIp':_0x5ea6d6[_0x4494('0x85')][_0x4494('0xa1')]||_0x5ea6d6[_0x4494('0x85')][_0x4494('0xfb')]||_0x5ea6d6[_0x4494('0xfc')]['remoteAddress']||_0x5ea6d6['ip'],'referer':_0x5ea6d6['headers'][_0x4494('0xa5')],'openedInteractions':_0x4c937a,'maxInteractions':_0x5dcb9a,'virtual':_0x2b97fc[_0x4494('0xf1')],'online':_0x4fc543,'custom':_0x2b97fc}))[_0x4494('0xfd')](/'/g,'\x5c\x27')};_0x223689[_0x4494('0x36')](ejs[_0x4494('0xcc')](Mustache[_0x4494('0xcc')](_0x3a9c67,_0x2aaebe),{'proactiveActions':_0x440ae6,'alignment':_0x28a8d4['alignment'],'verticalAlignment':_0x28a8d4['verticalAlignment'],'div_color':_0x28a8d4[_0x4494('0xdf')],'text_color':_0x28a8d4[_0x4494('0xfe')]}));})['catch'](handleError(_0x223689,null));};exports[_0x4494('0xff')]=function(_0x32e959,_0x147c07,_0x3e2731){return db[_0x4494('0x3a')][_0x4494('0x63')]({'where':{'id':_0x32e959['params']['id']}})[_0x4494('0x1d')](handleEntityNotFound(_0x147c07,null))[_0x4494('0x1d')](function(_0x233541){if(_0x233541){return db[_0x4494('0x100')]['transaction'](function(_0x391bdd){return db[_0x4494('0x97')][_0x4494('0x5d')]({'where':{'ChatWebsiteId':_0x32e959[_0x4494('0x53')]['id']},'transaction':_0x391bdd})[_0x4494('0x1d')](function(_0xe4f6fa){var _0x20265d=_[_0x4494('0x39')](_0x32e959[_0x4494('0x5c')],function(_0x2e92eb){_0x2e92eb[_0x4494('0x60')]=_0x32e959[_0x4494('0x53')]['id'];return _0x2e92eb;});return db[_0x4494('0x97')][_0x4494('0x101')](_0x20265d,{'transaction':_0x391bdd});});})['then'](function(){return db[_0x4494('0x97')]['findAndCountAll']({'where':{'ChatWebsiteId':_0x32e959[_0x4494('0x53')]['id']},'order':_0x4494('0x9b')});});}})[_0x4494('0x1d')](respondWithResult(_0x147c07,null))[_0x4494('0x25')](handleError(_0x147c07,null));};exports['getApplications']=function(_0x38159c,_0x3c1e4c,_0x1f777d){var _0x404a22={};var _0x149395={};var _0x33a052;var _0x2c2f8c;return db[_0x4494('0x3a')][_0x4494('0x63')]({'where':{'id':_0x38159c[_0x4494('0x53')]['id']}})['then'](handleEntityNotFound(_0x3c1e4c,null))[_0x4494('0x1d')](function(_0x20a428){if(_0x20a428){_0x33a052=_0x20a428;_0x149395[_0x4494('0x3f')]=_[_0x4494('0x41')](db[_0x4494('0x97')][_0x4494('0x3b')]);_0x149395[_0x4494('0x40')]=_[_0x4494('0x41')](_0x38159c[_0x4494('0x40')]);_0x149395[_0x4494('0x42')]=_[_0x4494('0x43')](_0x149395[_0x4494('0x3f')],_0x149395[_0x4494('0x40')]);_0x404a22[_0x4494('0x45')]=_[_0x4494('0x43')](_0x149395[_0x4494('0x3f')],qs[_0x4494('0x44')](_0x38159c[_0x4494('0x40')][_0x4494('0x44')]));_0x404a22[_0x4494('0x45')]=_0x404a22[_0x4494('0x45')][_0x4494('0x46')]?_0x404a22[_0x4494('0x45')]:_0x149395[_0x4494('0x3f')];_0x404a22[_0x4494('0x48')]=qs[_0x4494('0x49')](_0x38159c[_0x4494('0x40')][_0x4494('0x49')]);_0x404a22[_0x4494('0x4c')]=qs[_0x4494('0x42')](_['pick'](_0x38159c['query'],_0x149395[_0x4494('0x42')]));if(_0x38159c['query'][_0x4494('0x4a')]){_0x404a22[_0x4494('0x4c')]=_['merge'](_0x404a22[_0x4494('0x4c')],{'$or':_[_0x4494('0x39')](_0x404a22[_0x4494('0x45')],function(_0x5dbbdc){var _0x493d28={};_0x493d28[_0x5dbbdc]={'$like':'%'+_0x38159c[_0x4494('0x40')]['filter']+'%'};return _0x493d28;})});}_0x404a22=_['merge']({},_0x404a22,_0x38159c[_0x4494('0x54')]);return _0x33a052[_0x4494('0x102')](_0x404a22);}})['then'](function(_0x45571b){if(_0x45571b){_0x2c2f8c=_0x45571b[_0x4494('0x46')];if(!_0x38159c['query'][_0x4494('0x47')](_0x4494('0x64'))){_0x404a22['limit']=qs[_0x4494('0x2b')](_0x38159c[_0x4494('0x40')][_0x4494('0x2b')]);_0x404a22[_0x4494('0x2a')]=qs['offset'](_0x38159c['query']['offset']);}return _0x33a052[_0x4494('0x102')](_0x404a22);}})['then'](function(_0x49cab3){if(_0x49cab3){return _0x49cab3?{'count':_0x2c2f8c,'rows':_0x49cab3}:null;}})[_0x4494('0x1d')](respondWithResult(_0x3c1e4c,null))[_0x4494('0x25')](handleError(_0x3c1e4c,null));};exports[_0x4494('0x103')]=function(_0x1de488,_0x5bd076,_0x1d566e){return db[_0x4494('0x104')][_0x4494('0x55')]({'where':{'id':_0x1de488[_0x4494('0x53')]['id']}})[_0x4494('0x1d')](handleEntityNotFound(_0x5bd076,null))['then'](function(_0x554c99){if(_0x554c99){return _0x554c99['addProactiveActions'](_0x1de488[_0x4494('0x5c')][_0x4494('0x67')],_['omit'](_0x1de488['body'],['ids','id'])||{});}})[_0x4494('0x1d')](respondWithResult(_0x5bd076,null))[_0x4494('0x25')](handleError(_0x5bd076,null));};exports[_0x4494('0xf0')]=function(_0x228b75,_0x28c068,_0x13f01c){var _0x46bcd8={};var _0x11e8f9={};var _0x395b21;var _0x236e50;return db[_0x4494('0x3a')]['findOne']({'where':{'id':_0x228b75[_0x4494('0x53')]['id']}})[_0x4494('0x1d')](handleEntityNotFound(_0x28c068,null))['then'](function(_0xffb6ac){if(_0xffb6ac){_0x395b21=_0xffb6ac;_0x11e8f9[_0x4494('0x3f')]=_[_0x4494('0x41')](db[_0x4494('0x105')]['rawAttributes']);_0x11e8f9[_0x4494('0x40')]=_[_0x4494('0x41')](_0x228b75['query']);_0x11e8f9[_0x4494('0x42')]=_[_0x4494('0x43')](_0x11e8f9[_0x4494('0x3f')],_0x11e8f9['query']);_0x46bcd8['attributes']=_[_0x4494('0x43')](_0x11e8f9[_0x4494('0x3f')],qs['fields'](_0x228b75['query'][_0x4494('0x44')]));_0x46bcd8[_0x4494('0x45')]=_0x46bcd8[_0x4494('0x45')][_0x4494('0x46')]?_0x46bcd8[_0x4494('0x45')]:_0x11e8f9[_0x4494('0x3f')];_0x46bcd8[_0x4494('0x48')]=qs[_0x4494('0x49')](_0x228b75[_0x4494('0x40')][_0x4494('0x49')]);_0x46bcd8[_0x4494('0x4c')]=qs[_0x4494('0x42')](_[_0x4494('0x65')](_0x228b75['query'],_0x11e8f9['filters']));if(_0x228b75[_0x4494('0x40')][_0x4494('0x4a')]){_0x46bcd8[_0x4494('0x4c')]=_[_0x4494('0x4b')](_0x46bcd8['where'],{'$or':_[_0x4494('0x39')](_0x46bcd8[_0x4494('0x45')],function(_0x383ee8){var _0x4c677f={};_0x4c677f[_0x383ee8]={'$like':'%'+_0x228b75['query']['filter']+'%'};return _0x4c677f;})});}_0x46bcd8=_['merge']({},_0x46bcd8,_0x228b75['options']);return _0x395b21[_0x4494('0xf0')](_0x46bcd8);}})[_0x4494('0x1d')](function(_0xd37ffa){if(_0xd37ffa){_0x236e50=_0xd37ffa[_0x4494('0x46')];if(!_0x228b75[_0x4494('0x40')][_0x4494('0x47')]('nolimit')){_0x46bcd8['limit']=qs[_0x4494('0x2b')](_0x228b75[_0x4494('0x40')][_0x4494('0x2b')]);_0x46bcd8['offset']=qs[_0x4494('0x2a')](_0x228b75[_0x4494('0x40')][_0x4494('0x2a')]);}return _0x395b21[_0x4494('0xf0')](_0x46bcd8);}})[_0x4494('0x1d')](function(_0x1ca618){if(_0x1ca618){return _0x1ca618?{'count':_0x236e50,'rows':_0x1ca618}:null;}})[_0x4494('0x1d')](respondWithResult(_0x28c068,null))['catch'](handleError(_0x28c068,null));};exports[_0x4494('0x106')]=function(_0x80c1bf,_0x2a8ef4,_0x14e219){var _0x5ace67=_0x80c1bf[_0x4494('0x40')]['online']===_0x4494('0x107')?'offlineForm':_0x4494('0x108');return db[_0x4494('0x3a')][_0x4494('0x55')]({'attributes':['id',_0x5ace67],'where':{'id':_0x80c1bf[_0x4494('0x53')]['id']}})[_0x4494('0x1d')](handleEntityNotFound(_0x2a8ef4,null))[_0x4494('0x1d')](function(_0x21a627){if(_0x21a627){var _0x32d162=_0x21a627[_0x5ace67];var _0x192c95=_0x32d162&&_0x32d162[_0x4494('0x109')]?_0x32d162[_0x4494('0x109')]:[];_0x2a8ef4[_0x4494('0x36')]({'fromKey':_[_0x4494('0x7b')](_0x32d162[_0x4494('0x10a')])?undefined:_0x32d162[_0x4494('0x10a')],'count':_0x192c95[_0x4494('0x46')],'rows':_0x192c95});}})[_0x4494('0x25')](handleError(_0x2a8ef4,null));};exports[_0x4494('0x10b')]=function(_0x245bcc,_0x585487,_0x5d89ea){var _0x4b86d3={'raw':![],'where':{}};var _0x37583e={};var _0x55bc5a={'count':0x0,'rows':[]};return db[_0x4494('0x3a')][_0x4494('0x63')]({'where':{'id':_0x245bcc[_0x4494('0x53')]['id']}})[_0x4494('0x1d')](handleEntityNotFound(_0x585487,null))[_0x4494('0x1d')](function(_0x383c4e){if(_0x383c4e){_0x37583e[_0x4494('0x3f')]=_[_0x4494('0x41')](db['ChatOfflineMessage'][_0x4494('0x3b')]);_0x37583e[_0x4494('0x40')]=_[_0x4494('0x41')](_0x245bcc[_0x4494('0x40')]);_0x37583e[_0x4494('0x42')]=_[_0x4494('0x43')](_0x37583e[_0x4494('0x3f')],_0x37583e[_0x4494('0x40')]);_0x4b86d3[_0x4494('0x45')]=_['intersection'](_0x37583e[_0x4494('0x3f')],qs[_0x4494('0x44')](_0x245bcc['query'][_0x4494('0x44')]));_0x4b86d3[_0x4494('0x45')]=_0x4b86d3[_0x4494('0x45')][_0x4494('0x46')]?_0x4b86d3[_0x4494('0x45')]:_0x37583e['model'];if(!_0x245bcc[_0x4494('0x40')]['hasOwnProperty']('nolimit')){_0x4b86d3['limit']=qs[_0x4494('0x2b')](_0x245bcc['query'][_0x4494('0x2b')]);_0x4b86d3['offset']=qs[_0x4494('0x2a')](_0x245bcc[_0x4494('0x40')][_0x4494('0x2a')]);}_0x4b86d3[_0x4494('0x48')]=qs[_0x4494('0x49')](_0x245bcc[_0x4494('0x40')][_0x4494('0x49')]);_0x4b86d3[_0x4494('0x4c')]=qs['filters'](_[_0x4494('0x65')](_0x245bcc[_0x4494('0x40')],_0x37583e[_0x4494('0x42')]));_0x4b86d3[_0x4494('0x4c')][_0x4494('0x60')]=_0x383c4e['id'];if(_0x245bcc[_0x4494('0x40')]['filter']){_0x4b86d3['where']=_['merge'](_0x4b86d3['where'],{'$or':_['map'](_0x4b86d3['attributes'],function(_0xcd39e8){var _0x49f3ac={};_0x49f3ac[_0xcd39e8]={'$like':'%'+_0x245bcc[_0x4494('0x40')]['filter']+'%'};return _0x49f3ac;})});}_0x4b86d3=_[_0x4494('0x4b')]({},_0x4b86d3,_0x245bcc[_0x4494('0x54')]);return db['ChatOfflineMessage'][_0x4494('0x29')]({'where':_0x4b86d3[_0x4494('0x4c')]})[_0x4494('0x1d')](function(_0x4af615){_0x55bc5a[_0x4494('0x29')]=_0x4af615;if(_0x245bcc[_0x4494('0x40')][_0x4494('0x4e')]){_0x4b86d3['include']=[{'all':!![]}];}else{_0x4b86d3['include']=[{'model':db['CmContact'],'as':_0x4494('0xdb'),'required':![]}];}return db['ChatOfflineMessage'][_0x4494('0x50')](_0x4b86d3);})[_0x4494('0x1d')](function(_0x7d09dd){_0x55bc5a[_0x4494('0x51')]=_0x7d09dd;return _0x55bc5a;});}})[_0x4494('0x1d')](respondWithFilteredResult(_0x585487,_0x4b86d3))[_0x4494('0x25')](handleError(_0x585487,null));};exports['addAgents']=function(_0x39d5de,_0x2688ce,_0x16e537){return db[_0x4494('0x3a')][_0x4494('0x55')]({'where':{'id':_0x39d5de[_0x4494('0x53')]['id']}})[_0x4494('0x1d')](handleEntityNotFound(_0x2688ce,null))[_0x4494('0x1d')](function(_0xc725ef){if(_0xc725ef){return _0xc725ef['addAgents'](_0x39d5de[_0x4494('0x5c')][_0x4494('0x67')],_[_0x4494('0xd9')](_0x39d5de[_0x4494('0x5c')],['ids','id'])||{})[_0x4494('0xc9')](function(_0x252f11){for(var _0x269d26=0x0;_0x269d26<_0x39d5de['body'][_0x4494('0x67')][_0x4494('0x46')];_0x269d26+=0x1){socket[_0x4494('0x10c')](_0x4494('0x10d'),{'UserId':_0x39d5de['body']['ids'][_0x269d26],'ChatWebsiteId':_0x39d5de['params']['id']});}return _0x252f11;});}})[_0x4494('0x1d')](respondWithResult(_0x2688ce,null))['catch'](handleError(_0x2688ce,null));};exports[_0x4494('0x10e')]=function(_0x47dcd2,_0x57b3ff,_0x5c4727){return db['ChatWebsite']['find']({'where':{'id':_0x47dcd2['params']['id']}})[_0x4494('0x1d')](handleEntityNotFound(_0x57b3ff,null))[_0x4494('0x1d')](function(_0xe6425f){if(_0xe6425f){return _0xe6425f[_0x4494('0x10e')](_0x47dcd2['query']['ids'])[_0x4494('0x1d')](function(){if(_[_0x4494('0x10f')](_0x47dcd2[_0x4494('0x40')][_0x4494('0x67')])){for(var _0x14f6f3=0x0;_0x14f6f3<_0x47dcd2[_0x4494('0x40')][_0x4494('0x67')][_0x4494('0x46')];_0x14f6f3+=0x1){socket[_0x4494('0x10c')](_0x4494('0x110'),{'UserId':Number(_0x47dcd2['query'][_0x4494('0x67')][_0x14f6f3]),'ChatWebsiteId':Number(_0x47dcd2[_0x4494('0x53')]['id'])});}}else{socket[_0x4494('0x10c')]('userChatWebsite:remove',{'UserId':Number(_0x47dcd2[_0x4494('0x40')][_0x4494('0x67')]),'ChatWebsiteId':Number(_0x47dcd2[_0x4494('0x53')]['id'])});}});}})[_0x4494('0x1d')](respondWithStatusCode(_0x57b3ff,null))[_0x4494('0x25')](handleError(_0x57b3ff,null));};exports[_0x4494('0x111')]=function(_0x204eaf,_0x2f0e06,_0xc2d935){var _0x245036={};var _0x96907e={};var _0x20ca68;var _0x408d8b;return db[_0x4494('0x3a')]['findOne']({'where':{'id':_0x204eaf['params']['id']}})['then'](handleEntityNotFound(_0x2f0e06,null))[_0x4494('0x1d')](function(_0x54632c){if(_0x54632c){_0x20ca68=_0x54632c;_0x96907e[_0x4494('0x3f')]=_[_0x4494('0x41')](db['User']['rawAttributes']);_0x96907e[_0x4494('0x40')]=_[_0x4494('0x41')](_0x204eaf[_0x4494('0x40')]);_0x96907e[_0x4494('0x42')]=_[_0x4494('0x43')](_0x96907e['model'],_0x96907e['query']);_0x245036[_0x4494('0x45')]=_[_0x4494('0x43')](_0x96907e[_0x4494('0x3f')],qs[_0x4494('0x44')](_0x204eaf[_0x4494('0x40')][_0x4494('0x44')]));_0x245036[_0x4494('0x45')]=_0x245036[_0x4494('0x45')][_0x4494('0x46')]?_0x245036[_0x4494('0x45')]:_0x96907e[_0x4494('0x3f')];_0x245036[_0x4494('0x48')]=qs[_0x4494('0x49')](_0x204eaf[_0x4494('0x40')][_0x4494('0x49')]);_0x245036[_0x4494('0x4c')]=qs[_0x4494('0x42')](_[_0x4494('0x65')](_0x204eaf[_0x4494('0x40')],_0x96907e['filters']));if(_0x204eaf['query'][_0x4494('0x4a')]){_0x245036[_0x4494('0x4c')]=_[_0x4494('0x4b')](_0x245036[_0x4494('0x4c')],{'$or':_[_0x4494('0x39')](_0x245036[_0x4494('0x45')],function(_0x21fc31){var _0x523a86={};_0x523a86[_0x21fc31]={'$like':'%'+_0x204eaf['query']['filter']+'%'};return _0x523a86;})});}_0x245036=_[_0x4494('0x4b')]({},_0x245036,_0x204eaf[_0x4494('0x54')]);return _0x20ca68['getAgents'](_0x245036);}})[_0x4494('0x1d')](function(_0x269675){if(_0x269675){_0x408d8b=_0x269675[_0x4494('0x46')];if(!_0x204eaf['query'][_0x4494('0x47')](_0x4494('0x64'))){_0x245036[_0x4494('0x2b')]=qs[_0x4494('0x2b')](_0x204eaf[_0x4494('0x40')][_0x4494('0x2b')]);_0x245036['offset']=qs[_0x4494('0x2a')](_0x204eaf[_0x4494('0x40')][_0x4494('0x2a')]);}return _0x20ca68[_0x4494('0x111')](_0x245036);}})[_0x4494('0x1d')](function(_0x12528b){if(_0x12528b){return _0x12528b?{'count':_0x408d8b,'rows':_0x12528b}:null;}})[_0x4494('0x1d')](respondWithResult(_0x2f0e06,null))['catch'](handleError(_0x2f0e06,null));};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.events.js b/server/api/chatWebsite/chatWebsite.events.js
index c8f7de1..ba3afec 100644
--- a/server/api/chatWebsite/chatWebsite.events.js
+++ b/server/api/chatWebsite/chatWebsite.events.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x3645=['../../mysqldb','ChatWebsite','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0x33975c,_0x50d085){var _0x1c15ab=function(_0x54e8bc){while(--_0x54e8bc){_0x33975c['push'](_0x33975c['shift']());}};_0x1c15ab(++_0x50d085);}(_0x3645,0x154));var _0x5364=function(_0x225f50,_0x48a77d){_0x225f50=_0x225f50-0x0;var _0x19d003=_0x3645[_0x225f50];return _0x19d003;};'use strict';var EventEmitter=require('events');var ChatWebsite=require(_0x5364('0x0'))['db'][_0x5364('0x1')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0x5364('0x2')](0x0);var events={'afterCreate':_0x5364('0x3'),'afterUpdate':_0x5364('0x4'),'afterDestroy':_0x5364('0x5')};function emitEvent(_0x3c0f77){return function(_0x5a63bf,_0x334a16,_0xea3e95){ChatWebsiteEvents[_0x5364('0x6')](_0x3c0f77+':'+_0x5a63bf['id'],_0x5a63bf);ChatWebsiteEvents[_0x5364('0x6')](_0x3c0f77,_0x5a63bf);_0xea3e95(null);};}for(var e in events){if(events[_0x5364('0x7')](e)){var event=events[e];ChatWebsite[_0x5364('0x8')](e,emitEvent(event));}}module[_0x5364('0x9')]=ChatWebsiteEvents;
\ No newline at end of file
+var _0x7bb8=['hasOwnProperty','../../mysqldb','ChatWebsite','setMaxListeners','save','remove','emit'];(function(_0x5b78e8,_0x55096b){var _0xf2c321=function(_0x4e0cff){while(--_0x4e0cff){_0x5b78e8['push'](_0x5b78e8['shift']());}};_0xf2c321(++_0x55096b);}(_0x7bb8,0xe8));var _0x87bb=function(_0x3318f0,_0x3ad120){_0x3318f0=_0x3318f0-0x0;var _0x1cc92f=_0x7bb8[_0x3318f0];return _0x1cc92f;};'use strict';var EventEmitter=require('events');var ChatWebsite=require(_0x87bb('0x0'))['db'][_0x87bb('0x1')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0x87bb('0x2')](0x0);var events={'afterCreate':_0x87bb('0x3'),'afterUpdate':'update','afterDestroy':_0x87bb('0x4')};function emitEvent(_0x1c17f8){return function(_0x5c03d3,_0xd7ed75,_0x2e5773){ChatWebsiteEvents['emit'](_0x1c17f8+':'+_0x5c03d3['id'],_0x5c03d3);ChatWebsiteEvents[_0x87bb('0x5')](_0x1c17f8,_0x5c03d3);_0x2e5773(null);};}for(var e in events){if(events[_0x87bb('0x6')](e)){var event=events[e];ChatWebsite['hook'](e,emitEvent(event));}}module['exports']=ChatWebsiteEvents;
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.model.js b/server/api/chatWebsite/chatWebsite.model.js
index 9779009..de63cf0 100644
--- a/server/api/chatWebsite/chatWebsite.model.js
+++ b/server/api/chatWebsite/chatWebsite.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xbf83=['lodash','../../config/logger','api','moment','bluebird','request-promise','../../config/environment','./chatWebsite.attributes','exports','ChatWebsite','chat_websites'];(function(_0x4beedb,_0x514fd9){var _0x22adb5=function(_0x3d80d2){while(--_0x3d80d2){_0x4beedb['push'](_0x4beedb['shift']());}};_0x22adb5(++_0x514fd9);}(_0xbf83,0x11e));var _0x3bf8=function(_0x21ce51,_0x5a9d75){_0x21ce51=_0x21ce51-0x0;var _0x36d533=_0xbf83[_0x21ce51];return _0x36d533;};'use strict';var _=require(_0x3bf8('0x0'));var util=require('util');var logger=require(_0x3bf8('0x1'))(_0x3bf8('0x2'));var moment=require(_0x3bf8('0x3'));var BPromise=require(_0x3bf8('0x4'));var rp=require(_0x3bf8('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x3bf8('0x6'));var attributes=require(_0x3bf8('0x7'));module[_0x3bf8('0x8')]=function(_0x251445,_0x5be89b){return _0x251445['define'](_0x3bf8('0x9'),attributes,{'tableName':_0x3bf8('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x22dd=['lodash','util','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','./chatWebsite.attributes','exports','define','chat_websites'];(function(_0x4c6411,_0x3c7199){var _0x54b551=function(_0x1db5e9){while(--_0x1db5e9){_0x4c6411['push'](_0x4c6411['shift']());}};_0x54b551(++_0x3c7199);}(_0x22dd,0xe4));var _0xd22d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x22dd[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xd22d('0x0'));var util=require(_0xd22d('0x1'));var logger=require(_0xd22d('0x2'))('api');var moment=require('moment');var BPromise=require(_0xd22d('0x3'));var rp=require(_0xd22d('0x4'));var fs=require('fs');var path=require(_0xd22d('0x5'));var rimraf=require(_0xd22d('0x6'));var config=require(_0xd22d('0x7'));var attributes=require(_0xd22d('0x8'));module[_0xd22d('0x9')]=function(_0x2df700,_0x3f4197){return _0x2df700[_0xd22d('0xa')]('ChatWebsite',attributes,{'tableName':_0xd22d('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.rpc.js b/server/api/chatWebsite/chatWebsite.rpc.js
index 1007513..bc823f5 100644
--- a/server/api/chatWebsite/chatWebsite.rpc.js
+++ b/server/api/chatWebsite/chatWebsite.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7096=['ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','error','code','message','catch','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./chatWebsite.socket','register','then','info'];(function(_0x2def61,_0x7e9ab){var _0xd7fee3=function(_0x366c4b){while(--_0x366c4b){_0x2def61['push'](_0x2def61['shift']());}};_0xd7fee3(++_0x7e9ab);}(_0x7096,0x10c));var _0x6709=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x7096[_0x397e5f];return _0x5302b8;};'use strict';var _=require('lodash');var util=require(_0x6709('0x0'));var moment=require('moment');var BPromise=require(_0x6709('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6709('0x2'));var db=require(_0x6709('0x3'))['db'];var utils=require(_0x6709('0x4'));var logger=require(_0x6709('0x5'))(_0x6709('0x6'));var config=require(_0x6709('0x7'));var jayson=require(_0x6709('0x8'));var client=jayson[_0x6709('0x9')][_0x6709('0xa')]({'port':0x232a});config[_0x6709('0xb')]=_[_0x6709('0xc')](config[_0x6709('0xb')],{'host':_0x6709('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x6709('0xe'))[_0x6709('0xf')](socket);function respondWithRpcPromise(_0xbcb47,_0x1aa476,_0x12eea2){return new BPromise(function(_0x426ea1,_0x5de1fa){return client['request'](_0xbcb47,_0x12eea2)[_0x6709('0x10')](function(_0x262261){logger[_0x6709('0x11')](_0x6709('0x12'),_0x1aa476,_0x6709('0x13'));logger[_0x6709('0x14')](_0x6709('0x15'),_0x1aa476,_0x6709('0x13'),JSON['stringify'](_0x262261));if(_0x262261[_0x6709('0x16')]){if(_0x262261[_0x6709('0x16')][_0x6709('0x17')]===0x1f4){logger[_0x6709('0x16')]('ChatWebsite,\x20%s,\x20%s',_0x1aa476,_0x262261[_0x6709('0x16')]['message']);return _0x5de1fa(_0x262261[_0x6709('0x16')]['message']);}logger[_0x6709('0x16')](_0x6709('0x12'),_0x1aa476,_0x262261[_0x6709('0x16')][_0x6709('0x18')]);return _0x426ea1(_0x262261['error']['message']);}else{logger['info'](_0x6709('0x12'),_0x1aa476,_0x6709('0x13'));_0x426ea1(_0x262261['result'][_0x6709('0x18')]);}})[_0x6709('0x19')](function(_0xf1a70d){logger['error'](_0x6709('0x12'),_0x1aa476,_0xf1a70d);_0x5de1fa(_0xf1a70d);});});}
\ No newline at end of file
+var _0x5496=['request\x20sent','stringify','error','code','message','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','http','redis','localhost','socket.io-emitter','./chatWebsite.socket','register','then','info','ChatWebsite,\x20%s,\x20%s'];(function(_0xbec8e6,_0x2841b5){var _0x4aa6f2=function(_0x583a0a){while(--_0x583a0a){_0xbec8e6['push'](_0xbec8e6['shift']());}};_0x4aa6f2(++_0x2841b5);}(_0x5496,0x175));var _0x6549=function(_0xcab48b,_0xc60fd1){_0xcab48b=_0xcab48b-0x0;var _0x1ad3ea=_0x5496[_0xcab48b];return _0x1ad3ea;};'use strict';var _=require(_0x6549('0x0'));var util=require(_0x6549('0x1'));var moment=require(_0x6549('0x2'));var BPromise=require(_0x6549('0x3'));var rs=require(_0x6549('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6549('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x6549('0x6'))(_0x6549('0x7'));var config=require(_0x6549('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x6549('0x9')]({'port':0x232a});config[_0x6549('0xa')]=_['defaults'](config[_0x6549('0xa')],{'host':_0x6549('0xb'),'port':0x18eb});var socket=require(_0x6549('0xc'))(new Redis(config['redis']));require(_0x6549('0xd'))[_0x6549('0xe')](socket);function respondWithRpcPromise(_0x2ecce2,_0x135c2c,_0x1e5083){return new BPromise(function(_0x3e08a6,_0x50fa35){return client['request'](_0x2ecce2,_0x1e5083)[_0x6549('0xf')](function(_0xac828c){logger[_0x6549('0x10')](_0x6549('0x11'),_0x135c2c,_0x6549('0x12'));logger['debug']('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x135c2c,_0x6549('0x12'),JSON[_0x6549('0x13')](_0xac828c));if(_0xac828c['error']){if(_0xac828c[_0x6549('0x14')][_0x6549('0x15')]===0x1f4){logger[_0x6549('0x14')](_0x6549('0x11'),_0x135c2c,_0xac828c[_0x6549('0x14')][_0x6549('0x16')]);return _0x50fa35(_0xac828c['error']['message']);}logger[_0x6549('0x14')](_0x6549('0x11'),_0x135c2c,_0xac828c['error'][_0x6549('0x16')]);return _0x3e08a6(_0xac828c[_0x6549('0x14')][_0x6549('0x16')]);}else{logger[_0x6549('0x10')](_0x6549('0x11'),_0x135c2c,'request\x20sent');_0x3e08a6(_0xac828c['result'][_0x6549('0x16')]);}})['catch'](function(_0x56c15b){logger[_0x6549('0x14')](_0x6549('0x11'),_0x135c2c,_0x56c15b);_0x50fa35(_0x56c15b);});});}
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.socket.js b/server/api/chatWebsite/chatWebsite.socket.js
index 23d8286..c8b5c44 100644
--- a/server/api/chatWebsite/chatWebsite.socket.js
+++ b/server/api/chatWebsite/chatWebsite.socket.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x5f2f=['remove','update','emit','removeListener','register','length','chatWebsite:','./chatWebsite.events','save'];(function(_0x15fc3c,_0x35665b){var _0x94c5c8=function(_0xbab268){while(--_0xbab268){_0x15fc3c['push'](_0x15fc3c['shift']());}};_0x94c5c8(++_0x35665b);}(_0x5f2f,0x73));var _0xf5f2=function(_0x137e96,_0x301502){_0x137e96=_0x137e96-0x0;var _0x47d8f2=_0x5f2f[_0x137e96];return _0x47d8f2;};'use strict';var ChatWebsiteEvents=require(_0xf5f2('0x0'));var events=[_0xf5f2('0x1'),_0xf5f2('0x2'),_0xf5f2('0x3')];function createListener(_0x1172dd,_0x174bc7){return function(_0x3c72ee){_0x174bc7[_0xf5f2('0x4')](_0x1172dd,_0x3c72ee);};}function removeListener(_0x501fbd,_0x4854b6){return function(){ChatWebsiteEvents[_0xf5f2('0x5')](_0x501fbd,_0x4854b6);};}exports[_0xf5f2('0x6')]=function(_0xad7f65){for(var _0x3eebf6=0x0,_0x3133bc=events[_0xf5f2('0x7')];_0x3eebf6<_0x3133bc;_0x3eebf6++){var _0x5907aa=events[_0x3eebf6];var _0x466882=createListener(_0xf5f2('0x8')+_0x5907aa,_0xad7f65);ChatWebsiteEvents['on'](_0x5907aa,_0x466882);}};
\ No newline at end of file
+var _0x7a54=['remove','emit','removeListener','register','length','chatWebsite:','./chatWebsite.events','save'];(function(_0x4e39cd,_0x216b37){var _0x3e9298=function(_0x2a1f31){while(--_0x2a1f31){_0x4e39cd['push'](_0x4e39cd['shift']());}};_0x3e9298(++_0x216b37);}(_0x7a54,0x106));var _0x47a5=function(_0xf339f0,_0x2aa78c){_0xf339f0=_0xf339f0-0x0;var _0x4acd43=_0x7a54[_0xf339f0];return _0x4acd43;};'use strict';var ChatWebsiteEvents=require(_0x47a5('0x0'));var events=[_0x47a5('0x1'),_0x47a5('0x2'),'update'];function createListener(_0x1d33e,_0x4086cd){return function(_0x4880bf){_0x4086cd[_0x47a5('0x3')](_0x1d33e,_0x4880bf);};}function removeListener(_0x11bf85,_0x2a1a7e){return function(){ChatWebsiteEvents[_0x47a5('0x4')](_0x11bf85,_0x2a1a7e);};}exports[_0x47a5('0x5')]=function(_0x545a97){for(var _0x3d5629=0x0,_0x59199c=events[_0x47a5('0x6')];_0x3d5629<_0x59199c;_0x3d5629++){var _0x30e405=events[_0x3d5629];var _0x506eda=createListener(_0x47a5('0x7')+_0x30e405,_0x545a97);ChatWebsiteEvents['on'](_0x30e405,_0x506eda);}};
\ No newline at end of file
diff --git a/server/api/chatWebsite/index.js b/server/api/chatWebsite/index.js
index dddfb53..b775299 100644
--- a/server/api/chatWebsite/index.js
+++ b/server/api/chatWebsite/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xab00=['getInteractions','/:id/snippet','getSnippet','/:id/applications','getApplications','/:id/proactive_actions','getProactiveActions','/:id/fields','getFields','/:id/offline_messages','getOfflineMessages','/:id/users','post','/:id/dispositions','addDisposition','addAnswer','diskStorage','join','root','server/files/images/logos/','format','%s-%s','/:id/logo','single','addLogo','server/files/images/avatars/','now','originalname','/:id/avatar','addAvatar','file','/:id/system_avatar','addSystemAvatar','notify','/:id/offline','addInteraction','addApplications','addProactiveActions','addAgents','destroy','delete','removeDispositions','removeAnswers','removeAgents','multer','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','get','/describe','isAuthenticated','describe','/:id','show','getDispositions','/:id/canned_answers','getAnswers','getAvatar','/:id/customer_avatar','getCustomerAvatar','getSystemAvatar','/:id/interactions'];(function(_0x5620c7,_0x53ad6c){var _0x342f27=function(_0x243de1){while(--_0x243de1){_0x5620c7['push'](_0x5620c7['shift']());}};_0x342f27(++_0x53ad6c);}(_0xab00,0xef));var _0x0ab0=function(_0x2857a8,_0x316959){_0x2857a8=_0x2857a8-0x0;var _0x3dc73d=_0xab00[_0x2857a8];return _0x3dc73d;};'use strict';var multer=require(_0x0ab0('0x0'));var util=require('util');var path=require(_0x0ab0('0x1'));var timeout=require(_0x0ab0('0x2'));var express=require(_0x0ab0('0x3'));var router=express['Router']();var auth=require(_0x0ab0('0x4'));var interaction=require(_0x0ab0('0x5'));var config=require(_0x0ab0('0x6'));var controller=require('./chatWebsite.controller');router[_0x0ab0('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0x0ab0('0x7')](_0x0ab0('0x8'),auth[_0x0ab0('0x9')](),controller[_0x0ab0('0xa')]);router['get'](_0x0ab0('0xb'),auth['isAuthenticated'](),controller[_0x0ab0('0xc')]);router[_0x0ab0('0x7')]('/:id/dispositions',auth[_0x0ab0('0x9')](),controller[_0x0ab0('0xd')]);router[_0x0ab0('0x7')](_0x0ab0('0xe'),auth[_0x0ab0('0x9')](),controller[_0x0ab0('0xf')]);router['get']('/:id/logo',controller['getLogo']);router['get']('/:id/avatar',controller[_0x0ab0('0x10')]);router[_0x0ab0('0x7')](_0x0ab0('0x11'),controller[_0x0ab0('0x12')]);router['get']('/:id/system_avatar',controller[_0x0ab0('0x13')]);router[_0x0ab0('0x7')](_0x0ab0('0x14'),auth[_0x0ab0('0x9')](),controller[_0x0ab0('0x15')]);router[_0x0ab0('0x7')](_0x0ab0('0x16'),controller[_0x0ab0('0x17')]);router[_0x0ab0('0x7')](_0x0ab0('0x18'),auth['isAuthenticated'](),controller[_0x0ab0('0x19')]);router[_0x0ab0('0x7')](_0x0ab0('0x1a'),auth[_0x0ab0('0x9')](),controller[_0x0ab0('0x1b')]);router[_0x0ab0('0x7')](_0x0ab0('0x1c'),controller[_0x0ab0('0x1d')]);router[_0x0ab0('0x7')](_0x0ab0('0x1e'),auth[_0x0ab0('0x9')](),controller[_0x0ab0('0x1f')]);router[_0x0ab0('0x7')](_0x0ab0('0x20'),auth['isAuthenticated'](),controller['getAgents']);router[_0x0ab0('0x21')]('/',auth[_0x0ab0('0x9')](),controller['create']);router[_0x0ab0('0x21')](_0x0ab0('0x22'),auth[_0x0ab0('0x9')](),controller[_0x0ab0('0x23')]);router['post'](_0x0ab0('0xe'),auth['isAuthenticated'](),controller[_0x0ab0('0x24')]);var upload=multer({'storage':multer[_0x0ab0('0x25')]({'destination':function(_0x297fbe,_0xfab7e2,_0x51b97b){_0x51b97b(null,path[_0x0ab0('0x26')](config[_0x0ab0('0x27')],_0x0ab0('0x28')));},'filename':function(_0x12e5d8,_0x183d66,_0x1e92f4){_0x1e92f4(null,util[_0x0ab0('0x29')](_0x0ab0('0x2a'),Date['now'](),_0x183d66['originalname']));}})});router['post'](_0x0ab0('0x2b'),upload[_0x0ab0('0x2c')]('file'),controller[_0x0ab0('0x2d')]);var upload=multer({'storage':multer[_0x0ab0('0x25')]({'destination':function(_0x287190,_0x346146,_0x2a50d8){_0x2a50d8(null,path[_0x0ab0('0x26')](config[_0x0ab0('0x27')],_0x0ab0('0x2e')));},'filename':function(_0x254e3d,_0x4255f5,_0x4c3609){_0x4c3609(null,util['format']('%s-%s',Date[_0x0ab0('0x2f')](),_0x4255f5[_0x0ab0('0x30')]));}})});router['post'](_0x0ab0('0x31'),upload['single']('file'),controller[_0x0ab0('0x32')]);var upload=multer({'storage':multer[_0x0ab0('0x25')]({'destination':function(_0x2c43f2,_0x454c81,_0x59a998){_0x59a998(null,path[_0x0ab0('0x26')](config[_0x0ab0('0x27')],_0x0ab0('0x2e')));},'filename':function(_0x2afb7c,_0x119e87,_0x59152a){_0x59152a(null,util[_0x0ab0('0x29')](_0x0ab0('0x2a'),Date[_0x0ab0('0x2f')](),_0x119e87[_0x0ab0('0x30')]));}})});router['post']('/:id/customer_avatar',upload[_0x0ab0('0x2c')](_0x0ab0('0x33')),controller['addCustomerAvatar']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x25b0ee,_0x5eac33,_0x4cce73){_0x4cce73(null,path[_0x0ab0('0x26')](config[_0x0ab0('0x27')],_0x0ab0('0x2e')));},'filename':function(_0x13cb77,_0x5991bc,_0xceaacb){_0xceaacb(null,util['format'](_0x0ab0('0x2a'),Date[_0x0ab0('0x2f')](),_0x5991bc[_0x0ab0('0x30')]));}})});router[_0x0ab0('0x21')](_0x0ab0('0x34'),upload[_0x0ab0('0x2c')](_0x0ab0('0x33')),controller[_0x0ab0('0x35')]);router['post']('/:id/notify',controller[_0x0ab0('0x36')]);router[_0x0ab0('0x21')](_0x0ab0('0x37'),controller['offline']);router[_0x0ab0('0x21')]('/:id/interactions',auth['isAuthenticated'](),controller[_0x0ab0('0x38')]);router[_0x0ab0('0x21')](_0x0ab0('0x18'),auth[_0x0ab0('0x9')](),controller[_0x0ab0('0x39')]);router[_0x0ab0('0x21')](_0x0ab0('0x1a'),auth[_0x0ab0('0x9')](),controller[_0x0ab0('0x3a')]);router[_0x0ab0('0x21')](_0x0ab0('0x20'),auth[_0x0ab0('0x9')](),controller[_0x0ab0('0x3b')]);router['put'](_0x0ab0('0xb'),auth[_0x0ab0('0x9')](),controller['update']);router['delete'](_0x0ab0('0xb'),auth[_0x0ab0('0x9')](),controller[_0x0ab0('0x3c')]);router[_0x0ab0('0x3d')]('/:id/dispositions',auth[_0x0ab0('0x9')](),controller[_0x0ab0('0x3e')]);router['delete'](_0x0ab0('0xe'),auth[_0x0ab0('0x9')](),controller[_0x0ab0('0x3f')]);router['delete'](_0x0ab0('0x20'),auth[_0x0ab0('0x9')](),controller[_0x0ab0('0x40')]);module['exports']=router;
\ No newline at end of file
+var _0xd40e=['path','express','Router','../../components/interaction/service','../../config/environment','./chatWebsite.controller','get','index','/describe','/:id','isAuthenticated','show','getAnswers','/:id/logo','getLogo','/:id/avatar','/:id/customer_avatar','getSystemAvatar','getInteractions','/:id/snippet','getSnippet','/:id/applications','getApplications','/:id/proactive_actions','getProactiveActions','getFields','getOfflineMessages','getAgents','create','post','addDisposition','/:id/canned_answers','addAnswer','diskStorage','root','format','%s-%s','now','originalname','single','file','server/files/images/avatars/','join','addCustomerAvatar','/:id/system_avatar','addSystemAvatar','/:id/offline','offline','/:id/interactions','addApplications','addProactiveActions','/:id/users','addAgents','put','update','destroy','delete','/:id/dispositions','removeDispositions','removeAgents','exports','multer','util'];(function(_0x5a5a98,_0x2d63f7){var _0x2f09ad=function(_0x46e4e2){while(--_0x46e4e2){_0x5a5a98['push'](_0x5a5a98['shift']());}};_0x2f09ad(++_0x2d63f7);}(_0xd40e,0xfa));var _0xed40=function(_0x65eae,_0x32dc5f){_0x65eae=_0x65eae-0x0;var _0x18e82b=_0xd40e[_0x65eae];return _0x18e82b;};'use strict';var multer=require(_0xed40('0x0'));var util=require(_0xed40('0x1'));var path=require(_0xed40('0x2'));var timeout=require('connect-timeout');var express=require(_0xed40('0x3'));var router=express[_0xed40('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0xed40('0x5'));var config=require(_0xed40('0x6'));var controller=require(_0xed40('0x7'));router[_0xed40('0x8')]('/',auth['isAuthenticated'](),controller[_0xed40('0x9')]);router[_0xed40('0x8')](_0xed40('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0xed40('0x8')](_0xed40('0xb'),auth[_0xed40('0xc')](),controller[_0xed40('0xd')]);router[_0xed40('0x8')]('/:id/dispositions',auth[_0xed40('0xc')](),controller['getDispositions']);router[_0xed40('0x8')]('/:id/canned_answers',auth['isAuthenticated'](),controller[_0xed40('0xe')]);router[_0xed40('0x8')](_0xed40('0xf'),controller[_0xed40('0x10')]);router[_0xed40('0x8')](_0xed40('0x11'),controller['getAvatar']);router[_0xed40('0x8')](_0xed40('0x12'),controller['getCustomerAvatar']);router[_0xed40('0x8')]('/:id/system_avatar',controller[_0xed40('0x13')]);router[_0xed40('0x8')]('/:id/interactions',auth['isAuthenticated'](),controller[_0xed40('0x14')]);router[_0xed40('0x8')](_0xed40('0x15'),controller[_0xed40('0x16')]);router[_0xed40('0x8')](_0xed40('0x17'),auth[_0xed40('0xc')](),controller[_0xed40('0x18')]);router['get'](_0xed40('0x19'),auth[_0xed40('0xc')](),controller[_0xed40('0x1a')]);router[_0xed40('0x8')]('/:id/fields',controller[_0xed40('0x1b')]);router[_0xed40('0x8')]('/:id/offline_messages',auth['isAuthenticated'](),controller[_0xed40('0x1c')]);router['get']('/:id/users',auth['isAuthenticated'](),controller[_0xed40('0x1d')]);router['post']('/',auth['isAuthenticated'](),controller[_0xed40('0x1e')]);router[_0xed40('0x1f')]('/:id/dispositions',auth[_0xed40('0xc')](),controller[_0xed40('0x20')]);router['post'](_0xed40('0x21'),auth[_0xed40('0xc')](),controller[_0xed40('0x22')]);var upload=multer({'storage':multer[_0xed40('0x23')]({'destination':function(_0x3ce4cf,_0x56bcd7,_0x23e5b9){_0x23e5b9(null,path['join'](config[_0xed40('0x24')],'server/files/images/logos/'));},'filename':function(_0x5f4313,_0x376f95,_0x5e4816){_0x5e4816(null,util[_0xed40('0x25')](_0xed40('0x26'),Date[_0xed40('0x27')](),_0x376f95[_0xed40('0x28')]));}})});router['post'](_0xed40('0xf'),upload[_0xed40('0x29')](_0xed40('0x2a')),controller['addLogo']);var upload=multer({'storage':multer[_0xed40('0x23')]({'destination':function(_0x188fc6,_0x5c9695,_0x1d4cfb){_0x1d4cfb(null,path['join'](config['root'],_0xed40('0x2b')));},'filename':function(_0x57f67c,_0x29f797,_0x30268e){_0x30268e(null,util[_0xed40('0x25')](_0xed40('0x26'),Date[_0xed40('0x27')](),_0x29f797[_0xed40('0x28')]));}})});router[_0xed40('0x1f')](_0xed40('0x11'),upload[_0xed40('0x29')](_0xed40('0x2a')),controller['addAvatar']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x2e745f,_0x140036,_0x468abe){_0x468abe(null,path[_0xed40('0x2c')](config[_0xed40('0x24')],'server/files/images/avatars/'));},'filename':function(_0x398234,_0x552e77,_0x9f3201){_0x9f3201(null,util['format'](_0xed40('0x26'),Date[_0xed40('0x27')](),_0x552e77['originalname']));}})});router[_0xed40('0x1f')](_0xed40('0x12'),upload[_0xed40('0x29')](_0xed40('0x2a')),controller[_0xed40('0x2d')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x417eed,_0x2957e8,_0x4b5cca){_0x4b5cca(null,path['join'](config[_0xed40('0x24')],_0xed40('0x2b')));},'filename':function(_0x4c70e1,_0x4913e9,_0x2e59a0){_0x2e59a0(null,util[_0xed40('0x25')](_0xed40('0x26'),Date[_0xed40('0x27')](),_0x4913e9['originalname']));}})});router[_0xed40('0x1f')](_0xed40('0x2e'),upload['single'](_0xed40('0x2a')),controller[_0xed40('0x2f')]);router['post']('/:id/notify',controller['notify']);router['post'](_0xed40('0x30'),controller[_0xed40('0x31')]);router[_0xed40('0x1f')](_0xed40('0x32'),auth[_0xed40('0xc')](),controller['addInteraction']);router['post'](_0xed40('0x17'),auth[_0xed40('0xc')](),controller[_0xed40('0x33')]);router[_0xed40('0x1f')]('/:id/proactive_actions',auth[_0xed40('0xc')](),controller[_0xed40('0x34')]);router[_0xed40('0x1f')](_0xed40('0x35'),auth[_0xed40('0xc')](),controller[_0xed40('0x36')]);router[_0xed40('0x37')](_0xed40('0xb'),auth[_0xed40('0xc')](),controller[_0xed40('0x38')]);router['delete'](_0xed40('0xb'),auth['isAuthenticated'](),controller[_0xed40('0x39')]);router[_0xed40('0x3a')](_0xed40('0x3b'),auth[_0xed40('0xc')](),controller[_0xed40('0x3c')]);router[_0xed40('0x3a')](_0xed40('0x21'),auth[_0xed40('0xc')](),controller['removeAnswers']);router['delete']('/:id/users',auth[_0xed40('0xc')](),controller[_0xed40('0x3d')]);module[_0xed40('0x3e')]=router;
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.attributes.js b/server/api/cloudProvider/cloudProvider.attributes.js
index daa87fe..63b3b6a 100644
--- a/server/api/cloudProvider/cloudProvider.attributes.js
+++ b/server/api/cloudProvider/cloudProvider.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x6363=['STRING','ENUM','AmazonAWS','Google','sequelize'];(function(_0x2702cf,_0x2ec174){var _0x12e1e2=function(_0x5368f0){while(--_0x5368f0){_0x2702cf['push'](_0x2702cf['shift']());}};_0x12e1e2(++_0x2ec174);}(_0x6363,0x13a));var _0x3636=function(_0x2c4832,_0x51e47){_0x2c4832=_0x2c4832-0x0;var _0x45defc=_0x6363[_0x2c4832];return _0x45defc;};'use strict';var Sequelize=require(_0x3636('0x0'));module['exports']={'name':{'type':Sequelize[_0x3636('0x1')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0x3636('0x2')](_0x3636('0x3'),_0x3636('0x4')),'allowNull':![],'validate':{'notEmpty':!![]}},'data1':{'type':Sequelize[_0x3636('0x1')]},'data2':{'type':Sequelize[_0x3636('0x1')]}};
\ No newline at end of file
+var _0xf483=['Google','STRING','exports','ENUM','AmazonAWS'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0xf483,0xf2));var _0x3f48=function(_0x789678,_0x475d97){_0x789678=_0x789678-0x0;var _0x57f47c=_0xf483[_0x789678];return _0x57f47c;};'use strict';var Sequelize=require('sequelize');module[_0x3f48('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0x3f48('0x1')](_0x3f48('0x2'),_0x3f48('0x3')),'allowNull':![],'validate':{'notEmpty':!![]}},'data1':{'type':Sequelize[_0x3f48('0x4')]},'data2':{'type':Sequelize[_0x3f48('0x4')]}};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.controller.js b/server/api/cloudProvider/cloudProvider.controller.js
index 00aaa28..4487b62 100644
--- a/server/api/cloudProvider/cloudProvider.controller.js
+++ b/server/api/cloudProvider/cloudProvider.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xf50a=['rawAttributes','fieldName','type','key','query','keys','filters','model','attributes','intersection','fields','hasOwnProperty','nolimit','limit','order','sort','where','pick','merge','VIRTUAL','filter','options','count','findAll','rows','catch','show','length','includeAll','find','create','body','params','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','sox','to-csv','lodash','squel','jsforce','desk.js','papaparse','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','offset','Content-Range','json','apply','update','then','destroy','end','sendStatus','error','stack','name','send','map','CloudProvider'];(function(_0x46e363,_0x45d7e2){var _0x3fb059=function(_0x5e6274){while(--_0x5e6274){_0x46e363['push'](_0x46e363['shift']());}};_0x3fb059(++_0x45d7e2);}(_0xf50a,0xf9));var _0xaf50=function(_0x4c3296,_0x262566){_0x4c3296=_0x4c3296-0x0;var _0x5260de=_0xf50a[_0x4c3296];return _0x5260de;};'use strict';var pdf=require(_0xaf50('0x0'));var emlformat=require(_0xaf50('0x1'));var rimraf=require(_0xaf50('0x2'));var zipdir=require(_0xaf50('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0xaf50('0x4'));var moment=require(_0xaf50('0x5'));var BPromise=require(_0xaf50('0x6'));var Mustache=require(_0xaf50('0x7'));var util=require(_0xaf50('0x8'));var path=require('path');var sox=require(_0xaf50('0x9'));var csv=require(_0xaf50('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xaf50('0xb'));var squel=require(_0xaf50('0xc'));var crypto=require('crypto');var jsforce=require(_0xaf50('0xd'));var deskjs=require(_0xaf50('0xe'));var toCsv=require(_0xaf50('0xa'));var querystring=require('querystring');var Papa=require(_0xaf50('0xf'));var Redis=require('ioredis');var authService=require(_0xaf50('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xaf50('0x11'));var logger=require(_0xaf50('0x12'))(_0xaf50('0x13'));var utils=require(_0xaf50('0x14'));var config=require(_0xaf50('0x15'));var db=require(_0xaf50('0x16'))['db'];function respondWithStatusCode(_0x320f48,_0x828af){_0x828af=_0x828af||0xcc;return function(_0x462a8b){if(_0x462a8b){return _0x320f48['sendStatus'](_0x828af);}return _0x320f48[_0xaf50('0x17')](_0x828af)['end']();};}function respondWithResult(_0x5d55f9,_0x379f01){_0x379f01=_0x379f01||0xc8;return function(_0xfbad0f){if(_0xfbad0f){return _0x5d55f9[_0xaf50('0x17')](_0x379f01)['json'](_0xfbad0f);}};}function respondWithFilteredResult(_0x15459e,_0xba2125){return function(_0x4e443b){if(_0x4e443b){var _0x300c42=_0x4e443b['count'],_0x1d76dd=_0xba2125['offset'],_0x47d7a2=_0xba2125[_0xaf50('0x18')]+_0xba2125['limit'],_0x4063a1;if(_0x47d7a2>=_0x300c42){_0x47d7a2=_0x300c42;_0x4063a1=0xc8;}else{_0x4063a1=0xce;}_0x15459e[_0xaf50('0x17')](_0x4063a1);return _0x15459e['set'](_0xaf50('0x19'),_0x1d76dd+'-'+_0x47d7a2+'/'+_0x300c42)[_0xaf50('0x1a')](_0x4e443b);}return null;};}function patchUpdates(_0x13f9c4){return function(_0x195c8b){try{jsonpatch[_0xaf50('0x1b')](_0x195c8b,_0x13f9c4,!![]);}catch(_0x52b0f0){return BPromise['reject'](_0x52b0f0);}return _0x195c8b['save']();};}function saveUpdates(_0x499e57,_0x28b82d){return function(_0x272786){if(_0x272786){return _0x272786[_0xaf50('0x1c')](_0x499e57)[_0xaf50('0x1d')](function(_0x1bed5d){return _0x1bed5d;});}return null;};}function removeEntity(_0x22dacb,_0x4693d0){return function(_0x5ae106){if(_0x5ae106){return _0x5ae106[_0xaf50('0x1e')]()['then'](function(){_0x22dacb[_0xaf50('0x17')](0xcc)[_0xaf50('0x1f')]();});}};}function handleEntityNotFound(_0x55991c,_0x2f1099){return function(_0x3a83ff){if(!_0x3a83ff){_0x55991c[_0xaf50('0x20')](0x194);}return _0x3a83ff;};}function handleError(_0x5d1146,_0x235ba3){_0x235ba3=_0x235ba3||0x1f4;return function(_0x28261d){logger[_0xaf50('0x21')](_0x28261d[_0xaf50('0x22')]);if(_0x28261d['name']){delete _0x28261d[_0xaf50('0x23')];}_0x5d1146['status'](_0x235ba3)[_0xaf50('0x24')](_0x28261d);};}exports['index']=function(_0x43fb74,_0x3c00d9){var _0x5149ae={},_0x43ca2f={},_0x588dbb={'count':0x0,'rows':[]};var _0x3d5817=_[_0xaf50('0x25')](db[_0xaf50('0x26')][_0xaf50('0x27')],function(_0x3d0760){return{'name':_0x3d0760[_0xaf50('0x28')],'type':_0x3d0760[_0xaf50('0x29')][_0xaf50('0x2a')]};});_0x43ca2f['model']=_[_0xaf50('0x25')](_0x3d5817,'name');_0x43ca2f[_0xaf50('0x2b')]=_[_0xaf50('0x2c')](_0x43fb74[_0xaf50('0x2b')]);_0x43ca2f[_0xaf50('0x2d')]=_['intersection'](_0x43ca2f[_0xaf50('0x2e')],_0x43ca2f[_0xaf50('0x2b')]);_0x5149ae[_0xaf50('0x2f')]=_[_0xaf50('0x30')](_0x43ca2f['model'],qs[_0xaf50('0x31')](_0x43fb74[_0xaf50('0x2b')][_0xaf50('0x31')]));_0x5149ae[_0xaf50('0x2f')]=_0x5149ae[_0xaf50('0x2f')]['length']?_0x5149ae[_0xaf50('0x2f')]:_0x43ca2f[_0xaf50('0x2e')];if(!_0x43fb74[_0xaf50('0x2b')][_0xaf50('0x32')](_0xaf50('0x33'))){_0x5149ae['limit']=qs[_0xaf50('0x34')](_0x43fb74[_0xaf50('0x2b')][_0xaf50('0x34')]);_0x5149ae[_0xaf50('0x18')]=qs[_0xaf50('0x18')](_0x43fb74[_0xaf50('0x2b')][_0xaf50('0x18')]);}_0x5149ae[_0xaf50('0x35')]=qs['sort'](_0x43fb74[_0xaf50('0x2b')][_0xaf50('0x36')]);_0x5149ae[_0xaf50('0x37')]=qs[_0xaf50('0x2d')](_[_0xaf50('0x38')](_0x43fb74[_0xaf50('0x2b')],_0x43ca2f[_0xaf50('0x2d')]),_0x3d5817);if(_0x43fb74[_0xaf50('0x2b')]['filter']){_0x5149ae['where']=_[_0xaf50('0x39')](_0x5149ae[_0xaf50('0x37')],{'$or':_[_0xaf50('0x25')](_0x3d5817,function(_0x4e7284){if(_0x4e7284[_0xaf50('0x29')]!==_0xaf50('0x3a')){var _0x2f1dd1={};_0x2f1dd1[_0x4e7284['name']]={'$like':'%'+_0x43fb74['query'][_0xaf50('0x3b')]+'%'};return _0x2f1dd1;}})});}_0x5149ae=_[_0xaf50('0x39')]({},_0x5149ae,_0x43fb74[_0xaf50('0x3c')]);var _0xfef06b={'where':_0x5149ae[_0xaf50('0x37')]};return db['CloudProvider'][_0xaf50('0x3d')](_0xfef06b)[_0xaf50('0x1d')](function(_0x1e9426){_0x588dbb['count']=_0x1e9426;if(_0x43fb74[_0xaf50('0x2b')]['includeAll']){_0x5149ae['include']=[{'all':!![]}];}return db['CloudProvider'][_0xaf50('0x3e')](_0x5149ae);})[_0xaf50('0x1d')](function(_0x51e77c){_0x588dbb[_0xaf50('0x3f')]=_0x51e77c;return _0x588dbb;})[_0xaf50('0x1d')](respondWithFilteredResult(_0x3c00d9,_0x5149ae))[_0xaf50('0x40')](handleError(_0x3c00d9,null));};exports[_0xaf50('0x41')]=function(_0xc0fa1f,_0x6ce00c){var _0x16d519={'raw':!![],'where':{'id':_0xc0fa1f['params']['id']}},_0x1d6fb4={};_0x1d6fb4[_0xaf50('0x2e')]=_['keys'](db[_0xaf50('0x26')][_0xaf50('0x27')]);_0x1d6fb4['query']=_[_0xaf50('0x2c')](_0xc0fa1f['query']);_0x1d6fb4[_0xaf50('0x2d')]=_['intersection'](_0x1d6fb4[_0xaf50('0x2e')],_0x1d6fb4['query']);_0x16d519[_0xaf50('0x2f')]=_[_0xaf50('0x30')](_0x1d6fb4[_0xaf50('0x2e')],qs[_0xaf50('0x31')](_0xc0fa1f[_0xaf50('0x2b')][_0xaf50('0x31')]));_0x16d519[_0xaf50('0x2f')]=_0x16d519[_0xaf50('0x2f')][_0xaf50('0x42')]?_0x16d519[_0xaf50('0x2f')]:_0x1d6fb4[_0xaf50('0x2e')];if(_0xc0fa1f['query'][_0xaf50('0x43')]){_0x16d519['include']=[{'all':!![]}];}_0x16d519=_[_0xaf50('0x39')]({},_0x16d519,_0xc0fa1f['options']);return db['CloudProvider'][_0xaf50('0x44')](_0x16d519)[_0xaf50('0x1d')](handleEntityNotFound(_0x6ce00c,null))[_0xaf50('0x1d')](respondWithResult(_0x6ce00c,null))['catch'](handleError(_0x6ce00c,null));};exports[_0xaf50('0x45')]=function(_0x1743c6,_0x246e45){return db[_0xaf50('0x26')][_0xaf50('0x45')](_0x1743c6[_0xaf50('0x46')],{})[_0xaf50('0x1d')](respondWithResult(_0x246e45,0xc9))[_0xaf50('0x40')](handleError(_0x246e45,null));};exports[_0xaf50('0x1c')]=function(_0x470fc2,_0x61e411){if(_0x470fc2[_0xaf50('0x46')]['id']){delete _0x470fc2[_0xaf50('0x46')]['id'];}return db[_0xaf50('0x26')][_0xaf50('0x44')]({'where':{'id':_0x470fc2[_0xaf50('0x47')]['id']}})['then'](handleEntityNotFound(_0x61e411,null))['then'](saveUpdates(_0x470fc2['body'],null))[_0xaf50('0x1d')](respondWithResult(_0x61e411,null))[_0xaf50('0x40')](handleError(_0x61e411,null));};exports['destroy']=function(_0x1c3a68,_0x107588){return db[_0xaf50('0x26')][_0xaf50('0x44')]({'where':{'id':_0x1c3a68[_0xaf50('0x47')]['id']}})[_0xaf50('0x1d')](handleEntityNotFound(_0x107588,null))[_0xaf50('0x1d')](removeEntity(_0x107588,null))[_0xaf50('0x40')](handleError(_0x107588,null));};
\ No newline at end of file
+var _0x0ab0=['to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','offset','limit','set','Content-Range','json','reject','save','update','then','destroy','error','name','send','map','CloudProvider','rawAttributes','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','VIRTUAL','options','count','includeAll','findAll','rows','catch','show','create','body','find','params','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox'];(function(_0x38854e,_0x23cbc9){var _0x3f8415=function(_0x4e493e){while(--_0x4e493e){_0x38854e['push'](_0x38854e['shift']());}};_0x3f8415(++_0x23cbc9);}(_0x0ab0,0x1b2));var _0x00ab=function(_0x35c26e,_0x1583cc){_0x35c26e=_0x35c26e-0x0;var _0x364f03=_0x0ab0[_0x35c26e];return _0x364f03;};'use strict';var pdf=require(_0x00ab('0x0'));var emlformat=require(_0x00ab('0x1'));var rimraf=require(_0x00ab('0x2'));var zipdir=require(_0x00ab('0x3'));var jsonpatch=require(_0x00ab('0x4'));var rp=require(_0x00ab('0x5'));var moment=require(_0x00ab('0x6'));var BPromise=require(_0x00ab('0x7'));var Mustache=require('mustache');var util=require(_0x00ab('0x8'));var path=require('path');var sox=require(_0x00ab('0x9'));var csv=require(_0x00ab('0xa'));var ejs=require(_0x00ab('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0x00ab('0xc'));var crypto=require(_0x00ab('0xd'));var jsforce=require(_0x00ab('0xe'));var deskjs=require(_0x00ab('0xf'));var toCsv=require(_0x00ab('0xa'));var querystring=require(_0x00ab('0x10'));var Papa=require(_0x00ab('0x11'));var Redis=require(_0x00ab('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x00ab('0x13'));var as=require(_0x00ab('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x00ab('0x15'))(_0x00ab('0x16'));var utils=require(_0x00ab('0x17'));var config=require(_0x00ab('0x18'));var db=require(_0x00ab('0x19'))['db'];function respondWithStatusCode(_0x175b0d,_0x36d614){_0x36d614=_0x36d614||0xcc;return function(_0xea0337){if(_0xea0337){return _0x175b0d[_0x00ab('0x1a')](_0x36d614);}return _0x175b0d[_0x00ab('0x1b')](_0x36d614)[_0x00ab('0x1c')]();};}function respondWithResult(_0x18af44,_0x21ba7d){_0x21ba7d=_0x21ba7d||0xc8;return function(_0x49d8bf){if(_0x49d8bf){return _0x18af44['status'](_0x21ba7d)['json'](_0x49d8bf);}};}function respondWithFilteredResult(_0x23da96,_0x3ba818){return function(_0x3ad719){if(_0x3ad719){var _0x150dc8=_0x3ad719['count'],_0x4acbb4=_0x3ba818[_0x00ab('0x1d')],_0x5c521c=_0x3ba818[_0x00ab('0x1d')]+_0x3ba818[_0x00ab('0x1e')],_0x2ca145;if(_0x5c521c>=_0x150dc8){_0x5c521c=_0x150dc8;_0x2ca145=0xc8;}else{_0x2ca145=0xce;}_0x23da96[_0x00ab('0x1b')](_0x2ca145);return _0x23da96[_0x00ab('0x1f')](_0x00ab('0x20'),_0x4acbb4+'-'+_0x5c521c+'/'+_0x150dc8)[_0x00ab('0x21')](_0x3ad719);}return null;};}function patchUpdates(_0x47d1fd){return function(_0x3cc9a4){try{jsonpatch['apply'](_0x3cc9a4,_0x47d1fd,!![]);}catch(_0x2fa076){return BPromise[_0x00ab('0x22')](_0x2fa076);}return _0x3cc9a4[_0x00ab('0x23')]();};}function saveUpdates(_0x2bacd7,_0x3f392e){return function(_0x57b181){if(_0x57b181){return _0x57b181[_0x00ab('0x24')](_0x2bacd7)[_0x00ab('0x25')](function(_0xd2a692){return _0xd2a692;});}return null;};}function removeEntity(_0x1fd690,_0x3fe099){return function(_0x50d277){if(_0x50d277){return _0x50d277[_0x00ab('0x26')]()[_0x00ab('0x25')](function(){_0x1fd690[_0x00ab('0x1b')](0xcc)[_0x00ab('0x1c')]();});}};}function handleEntityNotFound(_0x3d0eb0,_0x445180){return function(_0x2c024a){if(!_0x2c024a){_0x3d0eb0[_0x00ab('0x1a')](0x194);}return _0x2c024a;};}function handleError(_0x1c5290,_0x5f6a25){_0x5f6a25=_0x5f6a25||0x1f4;return function(_0x3e88a9){logger[_0x00ab('0x27')](_0x3e88a9['stack']);if(_0x3e88a9[_0x00ab('0x28')]){delete _0x3e88a9[_0x00ab('0x28')];}_0x1c5290[_0x00ab('0x1b')](_0x5f6a25)[_0x00ab('0x29')](_0x3e88a9);};}exports['index']=function(_0x5b3b7d,_0x1a1560){var _0x56c1b5={},_0x159640={},_0x61e78e={'count':0x0,'rows':[]};var _0x1b6e7e=_[_0x00ab('0x2a')](db[_0x00ab('0x2b')][_0x00ab('0x2c')],function(_0x6e1202){return{'name':_0x6e1202['fieldName'],'type':_0x6e1202[_0x00ab('0x2d')][_0x00ab('0x2e')]};});_0x159640[_0x00ab('0x2f')]=_['map'](_0x1b6e7e,'name');_0x159640[_0x00ab('0x30')]=_[_0x00ab('0x31')](_0x5b3b7d['query']);_0x159640['filters']=_[_0x00ab('0x32')](_0x159640[_0x00ab('0x2f')],_0x159640[_0x00ab('0x30')]);_0x56c1b5[_0x00ab('0x33')]=_['intersection'](_0x159640[_0x00ab('0x2f')],qs[_0x00ab('0x34')](_0x5b3b7d[_0x00ab('0x30')]['fields']));_0x56c1b5[_0x00ab('0x33')]=_0x56c1b5['attributes'][_0x00ab('0x35')]?_0x56c1b5['attributes']:_0x159640['model'];if(!_0x5b3b7d[_0x00ab('0x30')][_0x00ab('0x36')](_0x00ab('0x37'))){_0x56c1b5[_0x00ab('0x1e')]=qs[_0x00ab('0x1e')](_0x5b3b7d['query'][_0x00ab('0x1e')]);_0x56c1b5[_0x00ab('0x1d')]=qs[_0x00ab('0x1d')](_0x5b3b7d['query'][_0x00ab('0x1d')]);}_0x56c1b5[_0x00ab('0x38')]=qs[_0x00ab('0x39')](_0x5b3b7d[_0x00ab('0x30')][_0x00ab('0x39')]);_0x56c1b5[_0x00ab('0x3a')]=qs[_0x00ab('0x3b')](_[_0x00ab('0x3c')](_0x5b3b7d[_0x00ab('0x30')],_0x159640[_0x00ab('0x3b')]),_0x1b6e7e);if(_0x5b3b7d[_0x00ab('0x30')]['filter']){_0x56c1b5[_0x00ab('0x3a')]=_[_0x00ab('0x3d')](_0x56c1b5[_0x00ab('0x3a')],{'$or':_[_0x00ab('0x2a')](_0x1b6e7e,function(_0x5e7fb5){if(_0x5e7fb5['type']!==_0x00ab('0x3e')){var _0xe25aa3={};_0xe25aa3[_0x5e7fb5['name']]={'$like':'%'+_0x5b3b7d['query']['filter']+'%'};return _0xe25aa3;}})});}_0x56c1b5=_[_0x00ab('0x3d')]({},_0x56c1b5,_0x5b3b7d[_0x00ab('0x3f')]);var _0x3289ef={'where':_0x56c1b5[_0x00ab('0x3a')]};return db[_0x00ab('0x2b')][_0x00ab('0x40')](_0x3289ef)['then'](function(_0x146ad7){_0x61e78e['count']=_0x146ad7;if(_0x5b3b7d['query'][_0x00ab('0x41')]){_0x56c1b5['include']=[{'all':!![]}];}return db['CloudProvider'][_0x00ab('0x42')](_0x56c1b5);})[_0x00ab('0x25')](function(_0x2b7586){_0x61e78e[_0x00ab('0x43')]=_0x2b7586;return _0x61e78e;})[_0x00ab('0x25')](respondWithFilteredResult(_0x1a1560,_0x56c1b5))[_0x00ab('0x44')](handleError(_0x1a1560,null));};exports[_0x00ab('0x45')]=function(_0x55c772,_0x17cb5e){var _0x51ec37={'raw':!![],'where':{'id':_0x55c772['params']['id']}},_0x3daacc={};_0x3daacc[_0x00ab('0x2f')]=_['keys'](db[_0x00ab('0x2b')][_0x00ab('0x2c')]);_0x3daacc[_0x00ab('0x30')]=_[_0x00ab('0x31')](_0x55c772['query']);_0x3daacc[_0x00ab('0x3b')]=_[_0x00ab('0x32')](_0x3daacc[_0x00ab('0x2f')],_0x3daacc[_0x00ab('0x30')]);_0x51ec37[_0x00ab('0x33')]=_['intersection'](_0x3daacc['model'],qs[_0x00ab('0x34')](_0x55c772[_0x00ab('0x30')]['fields']));_0x51ec37[_0x00ab('0x33')]=_0x51ec37[_0x00ab('0x33')][_0x00ab('0x35')]?_0x51ec37[_0x00ab('0x33')]:_0x3daacc[_0x00ab('0x2f')];if(_0x55c772[_0x00ab('0x30')][_0x00ab('0x41')]){_0x51ec37['include']=[{'all':!![]}];}_0x51ec37=_[_0x00ab('0x3d')]({},_0x51ec37,_0x55c772[_0x00ab('0x3f')]);return db['CloudProvider']['find'](_0x51ec37)['then'](handleEntityNotFound(_0x17cb5e,null))['then'](respondWithResult(_0x17cb5e,null))['catch'](handleError(_0x17cb5e,null));};exports['create']=function(_0x565085,_0xf0e426){return db[_0x00ab('0x2b')][_0x00ab('0x46')](_0x565085[_0x00ab('0x47')],{})[_0x00ab('0x25')](respondWithResult(_0xf0e426,0xc9))['catch'](handleError(_0xf0e426,null));};exports[_0x00ab('0x24')]=function(_0x200b85,_0x1331ef){if(_0x200b85[_0x00ab('0x47')]['id']){delete _0x200b85['body']['id'];}return db[_0x00ab('0x2b')][_0x00ab('0x48')]({'where':{'id':_0x200b85['params']['id']}})['then'](handleEntityNotFound(_0x1331ef,null))[_0x00ab('0x25')](saveUpdates(_0x200b85['body'],null))['then'](respondWithResult(_0x1331ef,null))[_0x00ab('0x44')](handleError(_0x1331ef,null));};exports[_0x00ab('0x26')]=function(_0x2ddcc1,_0x4a1e9d){return db[_0x00ab('0x2b')]['find']({'where':{'id':_0x2ddcc1[_0x00ab('0x49')]['id']}})[_0x00ab('0x25')](handleEntityNotFound(_0x4a1e9d,null))[_0x00ab('0x25')](removeEntity(_0x4a1e9d,null))[_0x00ab('0x44')](handleError(_0x4a1e9d,null));};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.model.js b/server/api/cloudProvider/cloudProvider.model.js
index a2aaca1..5456999 100644
--- a/server/api/cloudProvider/cloudProvider.model.js
+++ b/server/api/cloudProvider/cloudProvider.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x1b0a=['api','moment','bluebird','request-promise','../../config/environment','exports','define','CloudProvider','../../config/logger'];(function(_0x48c02e,_0x210faf){var _0x1ebf1a=function(_0x269639){while(--_0x269639){_0x48c02e['push'](_0x48c02e['shift']());}};_0x1ebf1a(++_0x210faf);}(_0x1b0a,0x194));var _0xa1b0=function(_0xdde39c,_0x329888){_0xdde39c=_0xdde39c-0x0;var _0x122ea7=_0x1b0a[_0xdde39c];return _0x122ea7;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xa1b0('0x0'))(_0xa1b0('0x1'));var moment=require(_0xa1b0('0x2'));var BPromise=require(_0xa1b0('0x3'));var rp=require(_0xa1b0('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xa1b0('0x5'));var attributes=require('./cloudProvider.attributes');module[_0xa1b0('0x6')]=function(_0x17616b,_0x5a2cf2){return _0x17616b[_0xa1b0('0x7')](_0xa1b0('0x8'),attributes,{'tableName':'cloud_providers','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x5776=['cloud_providers','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./cloudProvider.attributes','exports','define','CloudProvider'];(function(_0xc12954,_0x253e72){var _0x14d239=function(_0x4bb1dd){while(--_0x4bb1dd){_0xc12954['push'](_0xc12954['shift']());}};_0x14d239(++_0x253e72);}(_0x5776,0x187));var _0x6577=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x5776[_0x2641f9];return _0x585741;};'use strict';var _=require('lodash');var util=require(_0x6577('0x0'));var logger=require(_0x6577('0x1'))(_0x6577('0x2'));var moment=require(_0x6577('0x3'));var BPromise=require(_0x6577('0x4'));var rp=require(_0x6577('0x5'));var fs=require('fs');var path=require(_0x6577('0x6'));var rimraf=require(_0x6577('0x7'));var config=require('../../config/environment');var attributes=require(_0x6577('0x8'));module[_0x6577('0x9')]=function(_0x3639d8,_0x256ef3){return _0x3639d8[_0x6577('0xa')](_0x6577('0xb'),attributes,{'tableName':_0x6577('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.rpc.js b/server/api/cloudProvider/cloudProvider.rpc.js
index 16c133b..1ac20c4 100644
--- a/server/api/cloudProvider/cloudProvider.rpc.js
+++ b/server/api/cloudProvider/cloudProvider.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x369b=['http','request','then','info','CloudProvider,\x20%s,\x20%s','request\x20sent','CloudProvider,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x369b,0x1a5));var _0xb369=function(_0xbb091,_0x3fe7ee){_0xbb091=_0xbb091-0x0;var _0x467a04=_0x369b[_0xbb091];return _0x467a04;};'use strict';var _=require(_0xb369('0x0'));var util=require(_0xb369('0x1'));var moment=require(_0xb369('0x2'));var BPromise=require(_0xb369('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb369('0x4'));var db=require(_0xb369('0x5'))['db'];var utils=require(_0xb369('0x6'));var logger=require('../../config/logger')(_0xb369('0x7'));var config=require(_0xb369('0x8'));var jayson=require(_0xb369('0x9'));var client=jayson[_0xb369('0xa')][_0xb369('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4b0c88,_0x41d296,_0x3299df){return new BPromise(function(_0x430084,_0x43b114){return client[_0xb369('0xc')](_0x4b0c88,_0x3299df)[_0xb369('0xd')](function(_0x4694ca){logger[_0xb369('0xe')](_0xb369('0xf'),_0x41d296,_0xb369('0x10'));logger['debug'](_0xb369('0x11'),_0x41d296,'request\x20sent',JSON[_0xb369('0x12')](_0x4694ca));if(_0x4694ca[_0xb369('0x13')]){if(_0x4694ca[_0xb369('0x13')][_0xb369('0x14')]===0x1f4){logger[_0xb369('0x13')](_0xb369('0xf'),_0x41d296,_0x4694ca[_0xb369('0x13')][_0xb369('0x15')]);return _0x43b114(_0x4694ca['error']['message']);}logger[_0xb369('0x13')](_0xb369('0xf'),_0x41d296,_0x4694ca[_0xb369('0x13')][_0xb369('0x15')]);return _0x430084(_0x4694ca[_0xb369('0x13')]['message']);}else{logger['info']('CloudProvider,\x20%s,\x20%s',_0x41d296,_0xb369('0x10'));_0x430084(_0x4694ca[_0xb369('0x16')][_0xb369('0x15')]);}})[_0xb369('0x17')](function(_0xd1623e){logger['error'](_0xb369('0xf'),_0x41d296,_0xd1623e);_0x43b114(_0xd1623e);});});}
\ No newline at end of file
+var _0x6a20=['error','code','message','catch','lodash','moment','bluebird','randomstring','../../mysqldb','rpc','jayson/promise','client','http','request','then','info','CloudProvider,\x20%s,\x20%s','request\x20sent','debug','CloudProvider,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x6a20,0x13f));var _0x06a2=function(_0x571f36,_0x58551e){_0x571f36=_0x571f36-0x0;var _0x12724f=_0x6a20[_0x571f36];return _0x12724f;};'use strict';var _=require(_0x06a2('0x0'));var util=require('util');var moment=require(_0x06a2('0x1'));var BPromise=require(_0x06a2('0x2'));var rs=require(_0x06a2('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x06a2('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x06a2('0x5'));var config=require('../../config/environment');var jayson=require(_0x06a2('0x6'));var client=jayson[_0x06a2('0x7')][_0x06a2('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x255aec,_0x4917fe,_0x1ebb76){return new BPromise(function(_0x40eb3b,_0x27f28b){return client[_0x06a2('0x9')](_0x255aec,_0x1ebb76)[_0x06a2('0xa')](function(_0x2a6e17){logger[_0x06a2('0xb')](_0x06a2('0xc'),_0x4917fe,_0x06a2('0xd'));logger[_0x06a2('0xe')](_0x06a2('0xf'),_0x4917fe,_0x06a2('0xd'),JSON[_0x06a2('0x10')](_0x2a6e17));if(_0x2a6e17[_0x06a2('0x11')]){if(_0x2a6e17['error'][_0x06a2('0x12')]===0x1f4){logger['error']('CloudProvider,\x20%s,\x20%s',_0x4917fe,_0x2a6e17[_0x06a2('0x11')]['message']);return _0x27f28b(_0x2a6e17[_0x06a2('0x11')][_0x06a2('0x13')]);}logger['error'](_0x06a2('0xc'),_0x4917fe,_0x2a6e17[_0x06a2('0x11')][_0x06a2('0x13')]);return _0x40eb3b(_0x2a6e17['error'][_0x06a2('0x13')]);}else{logger['info']('CloudProvider,\x20%s,\x20%s',_0x4917fe,_0x06a2('0xd'));_0x40eb3b(_0x2a6e17['result']['message']);}})[_0x06a2('0x14')](function(_0x3e1b02){logger[_0x06a2('0x11')](_0x06a2('0xc'),_0x4917fe,_0x3e1b02);_0x27f28b(_0x3e1b02);});});}
\ No newline at end of file
diff --git a/server/api/cloudProvider/index.js b/server/api/cloudProvider/index.js
index df6c140..95b86d6 100644
--- a/server/api/cloudProvider/index.js
+++ b/server/api/cloudProvider/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7622=['create','put','update','exports','multer','path','express','Router','./cloudProvider.controller','index','get','/:id','isAuthenticated','show'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x7622,0xba));var _0x2762=function(_0xf0c56a,_0x5a0beb){_0xf0c56a=_0xf0c56a-0x0;var _0x23b4ac=_0x7622[_0xf0c56a];return _0x23b4ac;};'use strict';var multer=require(_0x2762('0x0'));var util=require('util');var path=require(_0x2762('0x1'));var timeout=require('connect-timeout');var express=require(_0x2762('0x2'));var router=express[_0x2762('0x3')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x2762('0x4'));router['get']('/',auth['isAuthenticated'](),controller[_0x2762('0x5')]);router[_0x2762('0x6')](_0x2762('0x7'),auth[_0x2762('0x8')](),controller[_0x2762('0x9')]);router['post']('/',auth[_0x2762('0x8')](),controller[_0x2762('0xa')]);router[_0x2762('0xb')]('/:id',auth[_0x2762('0x8')](),controller[_0x2762('0xc')]);router['delete'](_0x2762('0x7'),auth[_0x2762('0x8')](),controller['destroy']);module[_0x2762('0xd')]=router;
\ No newline at end of file
+var _0xc4ed=['util','path','connect-timeout','Router','./cloudProvider.controller','get','index','/:id','isAuthenticated','post','create','update','delete','exports','multer'];(function(_0x5ccdf5,_0x47ee1c){var _0x210b53=function(_0x461c1c){while(--_0x461c1c){_0x5ccdf5['push'](_0x5ccdf5['shift']());}};_0x210b53(++_0x47ee1c);}(_0xc4ed,0x68));var _0xdc4e=function(_0x3cf7df,_0x43b053){_0x3cf7df=_0x3cf7df-0x0;var _0x52ca51=_0xc4ed[_0x3cf7df];return _0x52ca51;};'use strict';var multer=require(_0xdc4e('0x0'));var util=require(_0xdc4e('0x1'));var path=require(_0xdc4e('0x2'));var timeout=require(_0xdc4e('0x3'));var express=require('express');var router=express[_0xdc4e('0x4')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xdc4e('0x5'));router[_0xdc4e('0x6')]('/',auth['isAuthenticated'](),controller[_0xdc4e('0x7')]);router[_0xdc4e('0x6')](_0xdc4e('0x8'),auth[_0xdc4e('0x9')](),controller['show']);router[_0xdc4e('0xa')]('/',auth[_0xdc4e('0x9')](),controller[_0xdc4e('0xb')]);router['put'](_0xdc4e('0x8'),auth[_0xdc4e('0x9')](),controller[_0xdc4e('0xc')]);router[_0xdc4e('0xd')](_0xdc4e('0x8'),auth[_0xdc4e('0x9')](),controller['destroy']);module[_0xdc4e('0xe')]=router;
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.attributes.js b/server/api/cmCompany/cmCompany.attributes.js
index ea9f932..2a20536 100644
--- a/server/api/cmCompany/cmCompany.attributes.js
+++ b/server/api/cmCompany/cmCompany.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x0fb4=['sequelize','exports','STRING'];(function(_0x55e724,_0x8f22f1){var _0x1b317c=function(_0x21d4dd){while(--_0x21d4dd){_0x55e724['push'](_0x55e724['shift']());}};_0x1b317c(++_0x8f22f1);}(_0x0fb4,0x114));var _0x40fb=function(_0x44ca6e,_0x5e2c91){_0x44ca6e=_0x44ca6e-0x0;var _0x2edab2=_0x0fb4[_0x44ca6e];return _0x2edab2;};'use strict';var Sequelize=require(_0x40fb('0x0'));module[_0x40fb('0x1')]={'name':{'type':Sequelize[_0x40fb('0x2')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0x40fb('0x2')]},'companyId':{'type':Sequelize[_0x40fb('0x2')]},'website':{'type':Sequelize[_0x40fb('0x2')]},'phone':{'type':Sequelize[_0x40fb('0x2')]},'fax':{'type':Sequelize[_0x40fb('0x2')]},'type':{'type':Sequelize['STRING']},'street':{'type':Sequelize[_0x40fb('0x2')]},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0x40fb('0x2')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0x40fb('0x2')]},'sStreet':{'type':Sequelize[_0x40fb('0x2')]},'sPostalCode':{'type':Sequelize[_0x40fb('0x2')]},'sCity':{'type':Sequelize[_0x40fb('0x2')]},'sCountry':{'type':Sequelize[_0x40fb('0x2')]},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0xff50=['STRING','name','sequelize'];(function(_0x297c55,_0x34fa75){var _0x120389=function(_0x595108){while(--_0x595108){_0x297c55['push'](_0x297c55['shift']());}};_0x120389(++_0x34fa75);}(_0xff50,0x164));var _0x0ff5=function(_0x495b3d,_0x4d3da4){_0x495b3d=_0x495b3d-0x0;var _0x4cb329=_0xff50[_0x495b3d];return _0x4cb329;};'use strict';var Sequelize=require(_0x0ff5('0x0'));module['exports']={'name':{'type':Sequelize[_0x0ff5('0x1')],'unique':_0x0ff5('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0x0ff5('0x1')]},'companyId':{'type':Sequelize[_0x0ff5('0x1')]},'website':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0x0ff5('0x1')]},'fax':{'type':Sequelize[_0x0ff5('0x1')]},'type':{'type':Sequelize[_0x0ff5('0x1')]},'street':{'type':Sequelize[_0x0ff5('0x1')]},'postalCode':{'type':Sequelize[_0x0ff5('0x1')]},'city':{'type':Sequelize[_0x0ff5('0x1')]},'country':{'type':Sequelize[_0x0ff5('0x1')]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0x0ff5('0x1')]},'sStreet':{'type':Sequelize[_0x0ff5('0x1')]},'sPostalCode':{'type':Sequelize['STRING']},'sCity':{'type':Sequelize[_0x0ff5('0x1')]},'sCountry':{'type':Sequelize[_0x0ff5('0x1')]},'description':{'type':Sequelize[_0x0ff5('0x1')]}};
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.controller.js b/server/api/cmCompany/cmCompany.controller.js
index 8b2d2d7..5d1bfa6 100644
--- a/server/api/cmCompany/cmCompany.controller.js
+++ b/server/api/cmCompany/cmCompany.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x5cf8=['../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','status','json','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','UserProfileResource','end','sendStatus','error','name','send','describe','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','pick','filter','where','merge','map','options','findAll','rows','catch','show','params','CmCompany','rawAttributes','includeAll','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addContacts','omit','ids','getContacts','CmContact','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','lodash','crypto','jsforce','desk.js','to-csv','ioredis','../../components/auth/service'];(function(_0x673734,_0x3bd38c){var _0x22bf02=function(_0x1a7585){while(--_0x1a7585){_0x673734['push'](_0x673734['shift']());}};_0x22bf02(++_0x3bd38c);}(_0x5cf8,0x143));var _0x85cf=function(_0x36625f,_0x727bd6){_0x36625f=_0x36625f-0x0;var _0x135981=_0x5cf8[_0x36625f];return _0x135981;};'use strict';var pdf=require(_0x85cf('0x0'));var emlformat=require(_0x85cf('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x85cf('0x2'));var jsonpatch=require(_0x85cf('0x3'));var rp=require(_0x85cf('0x4'));var moment=require(_0x85cf('0x5'));var BPromise=require(_0x85cf('0x6'));var Mustache=require(_0x85cf('0x7'));var util=require(_0x85cf('0x8'));var path=require('path');var sox=require(_0x85cf('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x85cf('0xa'));var squel=require('squel');var crypto=require(_0x85cf('0xb'));var jsforce=require(_0x85cf('0xc'));var deskjs=require(_0x85cf('0xd'));var toCsv=require(_0x85cf('0xe'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x85cf('0xf'));var authService=require(_0x85cf('0x10'));var qs=require(_0x85cf('0x11'));var as=require(_0x85cf('0x12'));var hardwareService=require(_0x85cf('0x13'));var logger=require(_0x85cf('0x14'))(_0x85cf('0x15'));var utils=require(_0x85cf('0x16'));var config=require(_0x85cf('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4c24ba,_0x294091){_0x294091=_0x294091||0xcc;return function(_0x1b7f4f){if(_0x1b7f4f){return _0x4c24ba['sendStatus'](_0x294091);}return _0x4c24ba[_0x85cf('0x18')](_0x294091)['end']();};}function respondWithResult(_0x16bbb1,_0x1fe83a){_0x1fe83a=_0x1fe83a||0xc8;return function(_0x5a243e){if(_0x5a243e){return _0x16bbb1['status'](_0x1fe83a)[_0x85cf('0x19')](_0x5a243e);}};}function respondWithFilteredResult(_0x20ac6f,_0x1cb612){return function(_0x212b77){if(_0x212b77){var _0x5d16ad=_0x212b77[_0x85cf('0x1a')],_0x22051=_0x1cb612[_0x85cf('0x1b')],_0x27dd71=_0x1cb612[_0x85cf('0x1b')]+_0x1cb612['limit'],_0x96bb86;if(_0x27dd71>=_0x5d16ad){_0x27dd71=_0x5d16ad;_0x96bb86=0xc8;}else{_0x96bb86=0xce;}_0x20ac6f['status'](_0x96bb86);return _0x20ac6f[_0x85cf('0x1c')](_0x85cf('0x1d'),_0x22051+'-'+_0x27dd71+'/'+_0x5d16ad)['json'](_0x212b77);}return null;};}function patchUpdates(_0xced2a2){return function(_0x53c96a){try{jsonpatch[_0x85cf('0x1e')](_0x53c96a,_0xced2a2,!![]);}catch(_0x61d230){return BPromise[_0x85cf('0x1f')](_0x61d230);}return _0x53c96a[_0x85cf('0x20')]();};}function saveUpdates(_0xb6e70e,_0x1b5299){return function(_0x3b74df){if(_0x3b74df){return _0x3b74df[_0x85cf('0x21')](_0xb6e70e)[_0x85cf('0x22')](function(_0x2f6527){return _0x2f6527;});}return null;};}function removeEntity(_0x52349f,_0x1156cb){return function(_0x3f63a3){if(_0x3f63a3){return _0x3f63a3[_0x85cf('0x23')]()[_0x85cf('0x22')](function(){var _0xf4aa29=_0x3f63a3['get']({'plain':!![]});var _0x1c1121='Companies';return db[_0x85cf('0x24')][_0x85cf('0x23')]({'where':{'type':_0x1c1121,'resourceId':_0xf4aa29['id']}})['then'](function(){return _0x3f63a3;});})['then'](function(){_0x52349f[_0x85cf('0x18')](0xcc)[_0x85cf('0x25')]();});}};}function handleEntityNotFound(_0x485f15,_0x543624){return function(_0xfa4768){if(!_0xfa4768){_0x485f15[_0x85cf('0x26')](0x194);}return _0xfa4768;};}function handleError(_0x2f67cc,_0x34cb4b){_0x34cb4b=_0x34cb4b||0x1f4;return function(_0x583231){logger[_0x85cf('0x27')](_0x583231['stack']);if(_0x583231[_0x85cf('0x28')]){delete _0x583231[_0x85cf('0x28')];}_0x2f67cc[_0x85cf('0x18')](_0x34cb4b)[_0x85cf('0x29')](_0x583231);};}exports['index']=function(_0x30733b,_0x3d5695){var _0x386fb5={},_0x11e113={},_0x4f6bed={'count':0x0,'rows':[]};return db['CmCompany'][_0x85cf('0x2a')]()['then'](function(_0x48d920){_0x11e113[_0x85cf('0x2b')]=_[_0x85cf('0x2c')](_0x48d920);_0x11e113[_0x85cf('0x2d')]=_['keys'](_0x30733b[_0x85cf('0x2d')]);_0x11e113[_0x85cf('0x2e')]=_[_0x85cf('0x2f')](_0x11e113[_0x85cf('0x2b')],_0x11e113[_0x85cf('0x2d')]);_0x386fb5[_0x85cf('0x30')]=_['intersection'](_0x11e113[_0x85cf('0x2b')],qs['fields'](_0x30733b[_0x85cf('0x2d')][_0x85cf('0x31')]));_0x386fb5[_0x85cf('0x30')]=_0x386fb5['attributes'][_0x85cf('0x32')]?_0x386fb5[_0x85cf('0x30')]:_0x11e113['model'];if(!_0x30733b[_0x85cf('0x2d')][_0x85cf('0x33')](_0x85cf('0x34'))){_0x386fb5[_0x85cf('0x35')]=qs[_0x85cf('0x35')](_0x30733b['query']['limit']);_0x386fb5['offset']=qs['offset'](_0x30733b[_0x85cf('0x2d')]['offset']);}_0x386fb5[_0x85cf('0x36')]=qs['sort'](_0x30733b[_0x85cf('0x2d')][_0x85cf('0x37')]);_0x386fb5['where']=qs[_0x85cf('0x2e')](_[_0x85cf('0x38')](_0x30733b[_0x85cf('0x2d')],_0x11e113['filters']),_0x48d920);if(_0x30733b[_0x85cf('0x2d')][_0x85cf('0x39')]){_0x386fb5[_0x85cf('0x3a')]=_[_0x85cf('0x3b')](_0x386fb5[_0x85cf('0x3a')],{'$or':_[_0x85cf('0x3c')](_0x386fb5[_0x85cf('0x30')],function(_0x3a1995){var _0x327e69={};_0x327e69[_0x3a1995]={'$like':'%'+_0x30733b['query'][_0x85cf('0x39')]+'%'};return _0x327e69;})});}_0x386fb5=_[_0x85cf('0x3b')]({},_0x386fb5,_0x30733b[_0x85cf('0x3d')]);var _0x1d0f1e={'where':_0x386fb5['where']};return db['CmCompany'][_0x85cf('0x1a')](_0x1d0f1e)[_0x85cf('0x22')](function(_0x249f9f){_0x4f6bed[_0x85cf('0x1a')]=_0x249f9f;if(_0x30733b[_0x85cf('0x2d')]['includeAll']){_0x386fb5['include']=[{'all':!![]}];}return db['CmCompany'][_0x85cf('0x3e')](_0x386fb5);})[_0x85cf('0x22')](function(_0x4842c7){_0x4f6bed[_0x85cf('0x3f')]=_0x4842c7;return _0x4f6bed;})['then'](respondWithFilteredResult(_0x3d5695,_0x386fb5))[_0x85cf('0x40')](handleError(_0x3d5695,null));})['catch'](handleError(_0x3d5695,null));};exports[_0x85cf('0x41')]=function(_0x1e64fa,_0x18e542){var _0x2768ef={'raw':![],'where':{'id':_0x1e64fa[_0x85cf('0x42')]['id']}},_0x1df328={};_0x1df328[_0x85cf('0x2b')]=_[_0x85cf('0x2c')](db[_0x85cf('0x43')][_0x85cf('0x44')]);_0x1df328[_0x85cf('0x2d')]=_[_0x85cf('0x2c')](_0x1e64fa[_0x85cf('0x2d')]);_0x1df328[_0x85cf('0x2e')]=_[_0x85cf('0x2f')](_0x1df328[_0x85cf('0x2b')],_0x1df328[_0x85cf('0x2d')]);_0x2768ef[_0x85cf('0x30')]=_[_0x85cf('0x2f')](_0x1df328[_0x85cf('0x2b')],qs['fields'](_0x1e64fa['query'][_0x85cf('0x31')]));_0x2768ef[_0x85cf('0x30')]=_0x2768ef[_0x85cf('0x30')][_0x85cf('0x32')]?_0x2768ef[_0x85cf('0x30')]:_0x1df328[_0x85cf('0x2b')];if(_0x1e64fa[_0x85cf('0x2d')][_0x85cf('0x45')]){_0x2768ef['include']=[{'all':!![]}];}_0x2768ef=_[_0x85cf('0x3b')]({},_0x2768ef,_0x1e64fa['options']);return db[_0x85cf('0x43')][_0x85cf('0x46')](_0x2768ef)['then'](handleEntityNotFound(_0x18e542,null))['then'](respondWithResult(_0x18e542,null))['catch'](handleError(_0x18e542,null));};exports[_0x85cf('0x47')]=function(_0x12ccf4,_0x4d0b51){return db['CmCompany'][_0x85cf('0x47')](_0x12ccf4[_0x85cf('0x48')],{})[_0x85cf('0x22')](function(_0x54f9b6){var _0x1e5074=_0x12ccf4[_0x85cf('0x49')][_0x85cf('0x4a')]({'plain':!![]});if(!_0x1e5074)throw new Error(_0x85cf('0x4b'));if(_0x1e5074[_0x85cf('0x4c')]===_0x85cf('0x49')){var _0x318c00=_0x54f9b6[_0x85cf('0x4a')]({'plain':!![]});var _0x5e1dc0='Companies';return db[_0x85cf('0x4d')][_0x85cf('0x46')]({'where':{'name':_0x5e1dc0,'userProfileId':_0x1e5074[_0x85cf('0x4e')]},'raw':!![]})[_0x85cf('0x22')](function(_0x1f5b7c){if(_0x1f5b7c&&_0x1f5b7c['autoAssociation']===0x0){return db[_0x85cf('0x24')]['create']({'name':_0x318c00[_0x85cf('0x28')],'resourceId':_0x318c00['id'],'type':_0x1f5b7c[_0x85cf('0x28')],'sectionId':_0x1f5b7c['id']},{})[_0x85cf('0x22')](function(){return _0x54f9b6;});}else{return _0x54f9b6;}})['catch'](function(_0x4227f2){logger[_0x85cf('0x27')](_0x85cf('0x4f'),_0x4227f2);throw _0x4227f2;});}return _0x54f9b6;})[_0x85cf('0x22')](respondWithResult(_0x4d0b51,0xc9))[_0x85cf('0x40')](handleError(_0x4d0b51,null));};exports[_0x85cf('0x21')]=function(_0x5abbbd,_0x290d82){if(_0x5abbbd['body']['id']){delete _0x5abbbd[_0x85cf('0x48')]['id'];}return db['CmCompany'][_0x85cf('0x46')]({'where':{'id':_0x5abbbd[_0x85cf('0x42')]['id']}})[_0x85cf('0x22')](handleEntityNotFound(_0x290d82,null))[_0x85cf('0x22')](saveUpdates(_0x5abbbd[_0x85cf('0x48')],null))[_0x85cf('0x22')](respondWithResult(_0x290d82,null))[_0x85cf('0x40')](handleError(_0x290d82,null));};exports[_0x85cf('0x23')]=function(_0xb62991,_0x288d34){return db[_0x85cf('0x43')]['find']({'where':{'id':_0xb62991[_0x85cf('0x42')]['id']}})[_0x85cf('0x22')](handleEntityNotFound(_0x288d34,null))[_0x85cf('0x22')](removeEntity(_0x288d34,null))[_0x85cf('0x40')](handleError(_0x288d34,null));};exports[_0x85cf('0x2a')]=function(_0x416f41,_0x41bc6f){return db[_0x85cf('0x43')]['describe']()[_0x85cf('0x22')](respondWithResult(_0x41bc6f,null))[_0x85cf('0x40')](handleError(_0x41bc6f,null));};exports[_0x85cf('0x50')]=function(_0x57b579,_0x14af12,_0x2eadba){return db['CmContact']['find']({'where':{'id':_0x57b579[_0x85cf('0x42')]['id']}})['then'](handleEntityNotFound(_0x14af12,null))['then'](function(_0x6d65be){if(_0x6d65be){return _0x6d65be[_0x85cf('0x50')](_0x57b579[_0x85cf('0x48')]['ids'],_[_0x85cf('0x51')](_0x57b579['body'],[_0x85cf('0x52'),'id'])||{});}})[_0x85cf('0x22')](respondWithResult(_0x14af12,null))['catch'](handleError(_0x14af12,null));};exports[_0x85cf('0x53')]=function(_0x5d3220,_0x22fe1a,_0x36b26){var _0x4dfa38={};var _0x428744={};var _0x5cf4dd;var _0x444514;return db[_0x85cf('0x43')]['findOne']({'where':{'id':_0x5d3220['params']['id']}})[_0x85cf('0x22')](handleEntityNotFound(_0x22fe1a,null))[_0x85cf('0x22')](function(_0x2e478d){if(_0x2e478d){_0x5cf4dd=_0x2e478d;_0x428744[_0x85cf('0x2b')]=_[_0x85cf('0x2c')](db[_0x85cf('0x54')]['rawAttributes']);_0x428744[_0x85cf('0x2d')]=_[_0x85cf('0x2c')](_0x5d3220[_0x85cf('0x2d')]);_0x428744[_0x85cf('0x2e')]=_[_0x85cf('0x2f')](_0x428744[_0x85cf('0x2b')],_0x428744[_0x85cf('0x2d')]);_0x4dfa38[_0x85cf('0x30')]=_['intersection'](_0x428744[_0x85cf('0x2b')],qs['fields'](_0x5d3220['query'][_0x85cf('0x31')]));_0x4dfa38[_0x85cf('0x30')]=_0x4dfa38[_0x85cf('0x30')]['length']?_0x4dfa38[_0x85cf('0x30')]:_0x428744[_0x85cf('0x2b')];_0x4dfa38[_0x85cf('0x36')]=qs[_0x85cf('0x37')](_0x5d3220['query'][_0x85cf('0x37')]);_0x4dfa38[_0x85cf('0x3a')]=qs[_0x85cf('0x2e')](_['pick'](_0x5d3220[_0x85cf('0x2d')],_0x428744[_0x85cf('0x2e')]));if(_0x5d3220['query'][_0x85cf('0x39')]){_0x4dfa38[_0x85cf('0x3a')]=_[_0x85cf('0x3b')](_0x4dfa38['where'],{'$or':_[_0x85cf('0x3c')](_0x4dfa38[_0x85cf('0x30')],function(_0x38aa9d){var _0x3a8ddb={};_0x3a8ddb[_0x38aa9d]={'$like':'%'+_0x5d3220[_0x85cf('0x2d')][_0x85cf('0x39')]+'%'};return _0x3a8ddb;})});}_0x4dfa38=_['merge']({},_0x4dfa38,_0x5d3220['options']);return _0x5cf4dd['getContacts'](_0x4dfa38);}})[_0x85cf('0x22')](function(_0x3746e7){if(_0x3746e7){_0x444514=_0x3746e7[_0x85cf('0x32')];if(!_0x5d3220[_0x85cf('0x2d')][_0x85cf('0x33')](_0x85cf('0x34'))){_0x4dfa38[_0x85cf('0x35')]=qs[_0x85cf('0x35')](_0x5d3220[_0x85cf('0x2d')][_0x85cf('0x35')]);_0x4dfa38[_0x85cf('0x1b')]=qs[_0x85cf('0x1b')](_0x5d3220[_0x85cf('0x2d')][_0x85cf('0x1b')]);}return _0x5cf4dd[_0x85cf('0x53')](_0x4dfa38);}})['then'](function(_0x1ebd32){if(_0x1ebd32){return _0x1ebd32?{'count':_0x444514,'rows':_0x1ebd32}:null;}})[_0x85cf('0x22')](respondWithResult(_0x22fe1a,null))[_0x85cf('0x40')](handleError(_0x22fe1a,null));};
\ No newline at end of file
+var _0x2688=['set','Content-Range','json','apply','reject','update','then','destroy','get','Companies','end','error','stack','name','send','index','CmCompany','describe','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','limit','order','where','pick','filters','merge','map','options','include','rows','catch','params','rawAttributes','includeAll','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','addContacts','omit','getContacts','findOne','sort','filter','nolimit','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','squel','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','count','offset'];(function(_0x587f2d,_0x1eb138){var _0x130af1=function(_0x572a18){while(--_0x572a18){_0x587f2d['push'](_0x587f2d['shift']());}};_0x130af1(++_0x1eb138);}(_0x2688,0x180));var _0x8268=function(_0x328b40,_0x370642){_0x328b40=_0x328b40-0x0;var _0x556a56=_0x2688[_0x328b40];return _0x556a56;};'use strict';var pdf=require(_0x8268('0x0'));var emlformat=require(_0x8268('0x1'));var rimraf=require(_0x8268('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x8268('0x3'));var rp=require(_0x8268('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x8268('0x5'));var util=require(_0x8268('0x6'));var path=require(_0x8268('0x7'));var sox=require(_0x8268('0x8'));var csv=require(_0x8268('0x9'));var ejs=require(_0x8268('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0x8268('0xb'));var crypto=require('crypto');var jsforce=require(_0x8268('0xc'));var deskjs=require(_0x8268('0xd'));var toCsv=require('to-csv');var querystring=require(_0x8268('0xe'));var Papa=require(_0x8268('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x8268('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8268('0x11'));var logger=require(_0x8268('0x12'))(_0x8268('0x13'));var utils=require('../../config/utils');var config=require(_0x8268('0x14'));var db=require(_0x8268('0x15'))['db'];function respondWithStatusCode(_0x2cae7c,_0x5beb11){_0x5beb11=_0x5beb11||0xcc;return function(_0x193c7b){if(_0x193c7b){return _0x2cae7c[_0x8268('0x16')](_0x5beb11);}return _0x2cae7c[_0x8268('0x17')](_0x5beb11)['end']();};}function respondWithResult(_0x2760f3,_0x24a1da){_0x24a1da=_0x24a1da||0xc8;return function(_0x5a4ee7){if(_0x5a4ee7){return _0x2760f3[_0x8268('0x17')](_0x24a1da)['json'](_0x5a4ee7);}};}function respondWithFilteredResult(_0x36fefb,_0x13c5c6){return function(_0x1f2c05){if(_0x1f2c05){var _0x3c9977=_0x1f2c05[_0x8268('0x18')],_0x584448=_0x13c5c6[_0x8268('0x19')],_0x2bd6e7=_0x13c5c6[_0x8268('0x19')]+_0x13c5c6['limit'],_0x402d41;if(_0x2bd6e7>=_0x3c9977){_0x2bd6e7=_0x3c9977;_0x402d41=0xc8;}else{_0x402d41=0xce;}_0x36fefb[_0x8268('0x17')](_0x402d41);return _0x36fefb[_0x8268('0x1a')](_0x8268('0x1b'),_0x584448+'-'+_0x2bd6e7+'/'+_0x3c9977)[_0x8268('0x1c')](_0x1f2c05);}return null;};}function patchUpdates(_0x135161){return function(_0x47744c){try{jsonpatch[_0x8268('0x1d')](_0x47744c,_0x135161,!![]);}catch(_0x385bd0){return BPromise[_0x8268('0x1e')](_0x385bd0);}return _0x47744c['save']();};}function saveUpdates(_0x28706e,_0x4bd2a0){return function(_0x175958){if(_0x175958){return _0x175958[_0x8268('0x1f')](_0x28706e)[_0x8268('0x20')](function(_0x4470dc){return _0x4470dc;});}return null;};}function removeEntity(_0x498001,_0x223d24){return function(_0x55736a){if(_0x55736a){return _0x55736a[_0x8268('0x21')]()[_0x8268('0x20')](function(){var _0x179f00=_0x55736a[_0x8268('0x22')]({'plain':!![]});var _0x5458a1=_0x8268('0x23');return db['UserProfileResource'][_0x8268('0x21')]({'where':{'type':_0x5458a1,'resourceId':_0x179f00['id']}})[_0x8268('0x20')](function(){return _0x55736a;});})['then'](function(){_0x498001[_0x8268('0x17')](0xcc)[_0x8268('0x24')]();});}};}function handleEntityNotFound(_0x5eb706,_0xba852b){return function(_0x2cc898){if(!_0x2cc898){_0x5eb706[_0x8268('0x16')](0x194);}return _0x2cc898;};}function handleError(_0x39a73a,_0x117d67){_0x117d67=_0x117d67||0x1f4;return function(_0x3f176c){logger[_0x8268('0x25')](_0x3f176c[_0x8268('0x26')]);if(_0x3f176c[_0x8268('0x27')]){delete _0x3f176c[_0x8268('0x27')];}_0x39a73a[_0x8268('0x17')](_0x117d67)[_0x8268('0x28')](_0x3f176c);};}exports[_0x8268('0x29')]=function(_0x3b0692,_0x30589b){var _0x5654f6={},_0x19af3c={},_0x27a37b={'count':0x0,'rows':[]};return db[_0x8268('0x2a')][_0x8268('0x2b')]()[_0x8268('0x20')](function(_0x414811){_0x19af3c[_0x8268('0x2c')]=_[_0x8268('0x2d')](_0x414811);_0x19af3c['query']=_[_0x8268('0x2d')](_0x3b0692[_0x8268('0x2e')]);_0x19af3c['filters']=_[_0x8268('0x2f')](_0x19af3c['model'],_0x19af3c[_0x8268('0x2e')]);_0x5654f6[_0x8268('0x30')]=_[_0x8268('0x2f')](_0x19af3c[_0x8268('0x2c')],qs[_0x8268('0x31')](_0x3b0692[_0x8268('0x2e')][_0x8268('0x31')]));_0x5654f6[_0x8268('0x30')]=_0x5654f6[_0x8268('0x30')][_0x8268('0x32')]?_0x5654f6[_0x8268('0x30')]:_0x19af3c[_0x8268('0x2c')];if(!_0x3b0692['query'][_0x8268('0x33')]('nolimit')){_0x5654f6[_0x8268('0x34')]=qs[_0x8268('0x34')](_0x3b0692[_0x8268('0x2e')][_0x8268('0x34')]);_0x5654f6[_0x8268('0x19')]=qs[_0x8268('0x19')](_0x3b0692['query'][_0x8268('0x19')]);}_0x5654f6[_0x8268('0x35')]=qs['sort'](_0x3b0692[_0x8268('0x2e')]['sort']);_0x5654f6[_0x8268('0x36')]=qs['filters'](_[_0x8268('0x37')](_0x3b0692[_0x8268('0x2e')],_0x19af3c[_0x8268('0x38')]),_0x414811);if(_0x3b0692[_0x8268('0x2e')]['filter']){_0x5654f6[_0x8268('0x36')]=_[_0x8268('0x39')](_0x5654f6[_0x8268('0x36')],{'$or':_[_0x8268('0x3a')](_0x5654f6['attributes'],function(_0x5ebd41){var _0x3985e0={};_0x3985e0[_0x5ebd41]={'$like':'%'+_0x3b0692[_0x8268('0x2e')]['filter']+'%'};return _0x3985e0;})});}_0x5654f6=_[_0x8268('0x39')]({},_0x5654f6,_0x3b0692[_0x8268('0x3b')]);var _0x47829f={'where':_0x5654f6[_0x8268('0x36')]};return db['CmCompany'][_0x8268('0x18')](_0x47829f)['then'](function(_0x8c29d5){_0x27a37b['count']=_0x8c29d5;if(_0x3b0692['query']['includeAll']){_0x5654f6[_0x8268('0x3c')]=[{'all':!![]}];}return db[_0x8268('0x2a')]['findAll'](_0x5654f6);})['then'](function(_0x2a8d9a){_0x27a37b[_0x8268('0x3d')]=_0x2a8d9a;return _0x27a37b;})[_0x8268('0x20')](respondWithFilteredResult(_0x30589b,_0x5654f6))['catch'](handleError(_0x30589b,null));})[_0x8268('0x3e')](handleError(_0x30589b,null));};exports['show']=function(_0x5778ad,_0x14b69e){var _0x1b19a8={'raw':![],'where':{'id':_0x5778ad[_0x8268('0x3f')]['id']}},_0x373dbd={};_0x373dbd[_0x8268('0x2c')]=_[_0x8268('0x2d')](db[_0x8268('0x2a')][_0x8268('0x40')]);_0x373dbd['query']=_[_0x8268('0x2d')](_0x5778ad[_0x8268('0x2e')]);_0x373dbd[_0x8268('0x38')]=_[_0x8268('0x2f')](_0x373dbd[_0x8268('0x2c')],_0x373dbd[_0x8268('0x2e')]);_0x1b19a8[_0x8268('0x30')]=_['intersection'](_0x373dbd['model'],qs[_0x8268('0x31')](_0x5778ad['query']['fields']));_0x1b19a8['attributes']=_0x1b19a8[_0x8268('0x30')]['length']?_0x1b19a8[_0x8268('0x30')]:_0x373dbd[_0x8268('0x2c')];if(_0x5778ad['query'][_0x8268('0x41')]){_0x1b19a8[_0x8268('0x3c')]=[{'all':!![]}];}_0x1b19a8=_['merge']({},_0x1b19a8,_0x5778ad[_0x8268('0x3b')]);return db['CmCompany'][_0x8268('0x42')](_0x1b19a8)[_0x8268('0x20')](handleEntityNotFound(_0x14b69e,null))[_0x8268('0x20')](respondWithResult(_0x14b69e,null))[_0x8268('0x3e')](handleError(_0x14b69e,null));};exports[_0x8268('0x43')]=function(_0x2614e5,_0x160810){return db[_0x8268('0x2a')]['create'](_0x2614e5['body'],{})[_0x8268('0x20')](function(_0x22f6a8){var _0x4ea560=_0x2614e5[_0x8268('0x44')][_0x8268('0x22')]({'plain':!![]});if(!_0x4ea560)throw new Error(_0x8268('0x45'));if(_0x4ea560['role']===_0x8268('0x44')){var _0x2a490c=_0x22f6a8['get']({'plain':!![]});var _0x4b54fd='Companies';return db[_0x8268('0x46')][_0x8268('0x42')]({'where':{'name':_0x4b54fd,'userProfileId':_0x4ea560['userProfileId']},'raw':!![]})[_0x8268('0x20')](function(_0x3addf0){if(_0x3addf0&&_0x3addf0[_0x8268('0x47')]===0x0){return db[_0x8268('0x48')]['create']({'name':_0x2a490c[_0x8268('0x27')],'resourceId':_0x2a490c['id'],'type':_0x3addf0['name'],'sectionId':_0x3addf0['id']},{})[_0x8268('0x20')](function(){return _0x22f6a8;});}else{return _0x22f6a8;}})[_0x8268('0x3e')](function(_0x39bb59){logger[_0x8268('0x25')](_0x8268('0x49'),_0x39bb59);throw _0x39bb59;});}return _0x22f6a8;})[_0x8268('0x20')](respondWithResult(_0x160810,0xc9))['catch'](handleError(_0x160810,null));};exports[_0x8268('0x1f')]=function(_0x3d2155,_0xb721a9){if(_0x3d2155[_0x8268('0x4a')]['id']){delete _0x3d2155[_0x8268('0x4a')]['id'];}return db[_0x8268('0x2a')][_0x8268('0x42')]({'where':{'id':_0x3d2155[_0x8268('0x3f')]['id']}})[_0x8268('0x20')](handleEntityNotFound(_0xb721a9,null))['then'](saveUpdates(_0x3d2155['body'],null))[_0x8268('0x20')](respondWithResult(_0xb721a9,null))[_0x8268('0x3e')](handleError(_0xb721a9,null));};exports[_0x8268('0x21')]=function(_0x492f59,_0x51c26d){return db[_0x8268('0x2a')][_0x8268('0x42')]({'where':{'id':_0x492f59[_0x8268('0x3f')]['id']}})[_0x8268('0x20')](handleEntityNotFound(_0x51c26d,null))[_0x8268('0x20')](removeEntity(_0x51c26d,null))['catch'](handleError(_0x51c26d,null));};exports[_0x8268('0x2b')]=function(_0x1c3967,_0x133fca){return db[_0x8268('0x2a')][_0x8268('0x2b')]()[_0x8268('0x20')](respondWithResult(_0x133fca,null))['catch'](handleError(_0x133fca,null));};exports['addContacts']=function(_0x5b3ab6,_0x394859,_0x55528a){return db['CmContact'][_0x8268('0x42')]({'where':{'id':_0x5b3ab6[_0x8268('0x3f')]['id']}})['then'](handleEntityNotFound(_0x394859,null))[_0x8268('0x20')](function(_0x5b2cfe){if(_0x5b2cfe){return _0x5b2cfe[_0x8268('0x4b')](_0x5b3ab6['body']['ids'],_[_0x8268('0x4c')](_0x5b3ab6[_0x8268('0x4a')],['ids','id'])||{});}})[_0x8268('0x20')](respondWithResult(_0x394859,null))[_0x8268('0x3e')](handleError(_0x394859,null));};exports[_0x8268('0x4d')]=function(_0x36f5e8,_0x571946,_0x48b539){var _0xa8f012={};var _0x18b228={};var _0x513d3b;var _0x2d0af3;return db[_0x8268('0x2a')][_0x8268('0x4e')]({'where':{'id':_0x36f5e8[_0x8268('0x3f')]['id']}})['then'](handleEntityNotFound(_0x571946,null))[_0x8268('0x20')](function(_0x1dd04b){if(_0x1dd04b){_0x513d3b=_0x1dd04b;_0x18b228[_0x8268('0x2c')]=_[_0x8268('0x2d')](db['CmContact'][_0x8268('0x40')]);_0x18b228[_0x8268('0x2e')]=_[_0x8268('0x2d')](_0x36f5e8[_0x8268('0x2e')]);_0x18b228[_0x8268('0x38')]=_[_0x8268('0x2f')](_0x18b228[_0x8268('0x2c')],_0x18b228[_0x8268('0x2e')]);_0xa8f012[_0x8268('0x30')]=_['intersection'](_0x18b228['model'],qs[_0x8268('0x31')](_0x36f5e8['query'][_0x8268('0x31')]));_0xa8f012['attributes']=_0xa8f012[_0x8268('0x30')][_0x8268('0x32')]?_0xa8f012[_0x8268('0x30')]:_0x18b228[_0x8268('0x2c')];_0xa8f012['order']=qs[_0x8268('0x4f')](_0x36f5e8[_0x8268('0x2e')][_0x8268('0x4f')]);_0xa8f012[_0x8268('0x36')]=qs['filters'](_[_0x8268('0x37')](_0x36f5e8[_0x8268('0x2e')],_0x18b228[_0x8268('0x38')]));if(_0x36f5e8[_0x8268('0x2e')][_0x8268('0x50')]){_0xa8f012[_0x8268('0x36')]=_[_0x8268('0x39')](_0xa8f012[_0x8268('0x36')],{'$or':_[_0x8268('0x3a')](_0xa8f012[_0x8268('0x30')],function(_0x36b7fd){var _0xc349c3={};_0xc349c3[_0x36b7fd]={'$like':'%'+_0x36f5e8['query'][_0x8268('0x50')]+'%'};return _0xc349c3;})});}_0xa8f012=_[_0x8268('0x39')]({},_0xa8f012,_0x36f5e8[_0x8268('0x3b')]);return _0x513d3b[_0x8268('0x4d')](_0xa8f012);}})[_0x8268('0x20')](function(_0xd0ea3){if(_0xd0ea3){_0x2d0af3=_0xd0ea3['length'];if(!_0x36f5e8[_0x8268('0x2e')][_0x8268('0x33')](_0x8268('0x51'))){_0xa8f012[_0x8268('0x34')]=qs[_0x8268('0x34')](_0x36f5e8[_0x8268('0x2e')][_0x8268('0x34')]);_0xa8f012[_0x8268('0x19')]=qs['offset'](_0x36f5e8[_0x8268('0x2e')][_0x8268('0x19')]);}return _0x513d3b['getContacts'](_0xa8f012);}})['then'](function(_0x380a72){if(_0x380a72){return _0x380a72?{'count':_0x2d0af3,'rows':_0x380a72}:null;}})['then'](respondWithResult(_0x571946,null))[_0x8268('0x3e')](handleError(_0x571946,null));};
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.model.js b/server/api/cmCompany/cmCompany.model.js
index 7653f2d..986d6b7 100644
--- a/server/api/cmCompany/cmCompany.model.js
+++ b/server/api/cmCompany/cmCompany.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x1ab0=['rimraf','./cmCompany.attributes','exports','define','CmCompany','cm_companies','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x3cdbc7,_0x2a7cb3){var _0x422d20=function(_0x11ac87){while(--_0x11ac87){_0x3cdbc7['push'](_0x3cdbc7['shift']());}};_0x422d20(++_0x2a7cb3);}(_0x1ab0,0x19c));var _0x01ab=function(_0x48de79,_0xbb13df){_0x48de79=_0x48de79-0x0;var _0x18a8eb=_0x1ab0[_0x48de79];return _0x18a8eb;};'use strict';var _=require(_0x01ab('0x0'));var util=require(_0x01ab('0x1'));var logger=require(_0x01ab('0x2'))(_0x01ab('0x3'));var moment=require(_0x01ab('0x4'));var BPromise=require(_0x01ab('0x5'));var rp=require(_0x01ab('0x6'));var fs=require('fs');var path=require(_0x01ab('0x7'));var rimraf=require(_0x01ab('0x8'));var config=require('../../config/environment');var attributes=require(_0x01ab('0x9'));module[_0x01ab('0xa')]=function(_0x300c44,_0x4352ff){return _0x300c44[_0x01ab('0xb')](_0x01ab('0xc'),attributes,{'tableName':_0x01ab('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xc647=['path','../../config/environment','./cmCompany.attributes','exports','define','CmCompany','lodash','util','../../config/logger','moment','bluebird','request-promise'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xc647,0x1f2));var _0x7c64=function(_0x10df18,_0x13338c){_0x10df18=_0x10df18-0x0;var _0x1f9a1d=_0xc647[_0x10df18];return _0x1f9a1d;};'use strict';var _=require(_0x7c64('0x0'));var util=require(_0x7c64('0x1'));var logger=require(_0x7c64('0x2'))('api');var moment=require(_0x7c64('0x3'));var BPromise=require(_0x7c64('0x4'));var rp=require(_0x7c64('0x5'));var fs=require('fs');var path=require(_0x7c64('0x6'));var rimraf=require('rimraf');var config=require(_0x7c64('0x7'));var attributes=require(_0x7c64('0x8'));module[_0x7c64('0x9')]=function(_0x1afd54,_0x355531){return _0x1afd54[_0x7c64('0xa')](_0x7c64('0xb'),attributes,{'tableName':'cm_companies','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.rpc.js b/server/api/cmCompany/cmCompany.rpc.js
index 61e282c..41133b4 100644
--- a/server/api/cmCompany/cmCompany.rpc.js
+++ b/server/api/cmCompany/cmCompany.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xf56b=['../../config/utils','../../config/logger','../../config/environment','client','http','request','then','CmCompany,\x20%s,\x20%s','request\x20sent','debug','CmCompany,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','moment','randomstring','ioredis','../../mysqldb'];(function(_0x5eb868,_0x3edfb0){var _0x278458=function(_0x266273){while(--_0x266273){_0x5eb868['push'](_0x5eb868['shift']());}};_0x278458(++_0x3edfb0);}(_0xf56b,0x172));var _0xbf56=function(_0x3b1b75,_0x12059c){_0x3b1b75=_0x3b1b75-0x0;var _0x564861=_0xf56b[_0x3b1b75];return _0x564861;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xbf56('0x0'));var BPromise=require('bluebird');var rs=require(_0xbf56('0x1'));var fs=require('fs');var Redis=require(_0xbf56('0x2'));var db=require(_0xbf56('0x3'))['db'];var utils=require(_0xbf56('0x4'));var logger=require(_0xbf56('0x5'))('rpc');var config=require(_0xbf56('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xbf56('0x7')][_0xbf56('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x15d434,_0x44f77c,_0x429d10){return new BPromise(function(_0x40d07c,_0x31114d){return client[_0xbf56('0x9')](_0x15d434,_0x429d10)[_0xbf56('0xa')](function(_0x4e9021){logger['info'](_0xbf56('0xb'),_0x44f77c,_0xbf56('0xc'));logger[_0xbf56('0xd')](_0xbf56('0xe'),_0x44f77c,_0xbf56('0xc'),JSON[_0xbf56('0xf')](_0x4e9021));if(_0x4e9021['error']){if(_0x4e9021[_0xbf56('0x10')][_0xbf56('0x11')]===0x1f4){logger[_0xbf56('0x10')](_0xbf56('0xb'),_0x44f77c,_0x4e9021['error'][_0xbf56('0x12')]);return _0x31114d(_0x4e9021['error'][_0xbf56('0x12')]);}logger[_0xbf56('0x10')](_0xbf56('0xb'),_0x44f77c,_0x4e9021['error'][_0xbf56('0x12')]);return _0x40d07c(_0x4e9021[_0xbf56('0x10')]['message']);}else{logger[_0xbf56('0x13')]('CmCompany,\x20%s,\x20%s',_0x44f77c,_0xbf56('0xc'));_0x40d07c(_0x4e9021[_0xbf56('0x14')][_0xbf56('0x12')]);}})[_0xbf56('0x15')](function(_0x3cd9ee){logger['error']('CmCompany,\x20%s,\x20%s',_0x44f77c,_0x3cd9ee);_0x31114d(_0x3cd9ee);});});}
\ No newline at end of file
+var _0x54dc=['CmCompany,\x20%s,\x20%s','request\x20sent','debug','CmCompany,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','then','info'];(function(_0x5ecadc,_0x1cf9f1){var _0x565037=function(_0x22908b){while(--_0x22908b){_0x5ecadc['push'](_0x5ecadc['shift']());}};_0x565037(++_0x1cf9f1);}(_0x54dc,0x81));var _0xc54d=function(_0x41d5d5,_0x9867db){_0x41d5d5=_0x41d5d5-0x0;var _0x2142d3=_0x54dc[_0x41d5d5];return _0x2142d3;};'use strict';var _=require('lodash');var util=require(_0xc54d('0x0'));var moment=require(_0xc54d('0x1'));var BPromise=require(_0xc54d('0x2'));var rs=require(_0xc54d('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc54d('0x4'))['db'];var utils=require(_0xc54d('0x5'));var logger=require(_0xc54d('0x6'))('rpc');var config=require(_0xc54d('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xc54d('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2789a2,_0x348e23,_0x145507){return new BPromise(function(_0x455a31,_0x27286d){return client['request'](_0x2789a2,_0x145507)[_0xc54d('0x9')](function(_0x265d4d){logger[_0xc54d('0xa')](_0xc54d('0xb'),_0x348e23,_0xc54d('0xc'));logger[_0xc54d('0xd')](_0xc54d('0xe'),_0x348e23,_0xc54d('0xc'),JSON[_0xc54d('0xf')](_0x265d4d));if(_0x265d4d[_0xc54d('0x10')]){if(_0x265d4d[_0xc54d('0x10')][_0xc54d('0x11')]===0x1f4){logger[_0xc54d('0x10')]('CmCompany,\x20%s,\x20%s',_0x348e23,_0x265d4d[_0xc54d('0x10')][_0xc54d('0x12')]);return _0x27286d(_0x265d4d[_0xc54d('0x10')]['message']);}logger['error'](_0xc54d('0xb'),_0x348e23,_0x265d4d['error']['message']);return _0x455a31(_0x265d4d[_0xc54d('0x10')][_0xc54d('0x12')]);}else{logger[_0xc54d('0xa')](_0xc54d('0xb'),_0x348e23,_0xc54d('0xc'));_0x455a31(_0x265d4d['result'][_0xc54d('0x12')]);}})[_0xc54d('0x13')](function(_0x4160f3){logger[_0xc54d('0x10')](_0xc54d('0xb'),_0x348e23,_0x4160f3);_0x27286d(_0x4160f3);});});}
\ No newline at end of file
diff --git a/server/api/cmCompany/index.js b/server/api/cmCompany/index.js
index 0f310a9..2cc941d 100644
--- a/server/api/cmCompany/index.js
+++ b/server/api/cmCompany/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x55ca=['multer','util','Router','../../components/auth/service','../../config/environment','./cmCompany.controller','get','isAuthenticated','index','/describe','describe','show','getContacts','post','create','/:id/contacts','addContacts','put','update','destroy','exports'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x55ca,0x126));var _0xa55c=function(_0x1b8d87,_0x4168fb){_0x1b8d87=_0x1b8d87-0x0;var _0x182b74=_0x55ca[_0x1b8d87];return _0x182b74;};'use strict';var multer=require(_0xa55c('0x0'));var util=require(_0xa55c('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xa55c('0x2')]();var auth=require(_0xa55c('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0xa55c('0x4'));var controller=require(_0xa55c('0x5'));router[_0xa55c('0x6')]('/',auth[_0xa55c('0x7')](),controller[_0xa55c('0x8')]);router[_0xa55c('0x6')](_0xa55c('0x9'),auth['isAuthenticated'](),controller[_0xa55c('0xa')]);router[_0xa55c('0x6')]('/:id',auth[_0xa55c('0x7')](),controller[_0xa55c('0xb')]);router['get']('/:id/contacts',auth[_0xa55c('0x7')](),controller[_0xa55c('0xc')]);router[_0xa55c('0xd')]('/',auth[_0xa55c('0x7')](),controller[_0xa55c('0xe')]);router[_0xa55c('0xd')](_0xa55c('0xf'),auth[_0xa55c('0x7')](),controller[_0xa55c('0x10')]);router[_0xa55c('0x11')]('/:id',auth['isAuthenticated'](),controller[_0xa55c('0x12')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0xa55c('0x13')]);module[_0xa55c('0x14')]=router;
\ No newline at end of file
+var _0x9957=['../../config/environment','get','isAuthenticated','index','/describe','/:id','show','/:id/contacts','getContacts','post','addContacts','put','update','delete','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x3e5086,_0x48f4a2){var _0xfeb102=function(_0x5a945f){while(--_0x5a945f){_0x3e5086['push'](_0x3e5086['shift']());}};_0xfeb102(++_0x48f4a2);}(_0x9957,0x93));var _0x7995=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x9957[_0x3947c9];return _0x2e7871;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var auth=require(_0x7995('0x5'));var interaction=require(_0x7995('0x6'));var config=require(_0x7995('0x7'));var controller=require('./cmCompany.controller');router[_0x7995('0x8')]('/',auth[_0x7995('0x9')](),controller[_0x7995('0xa')]);router[_0x7995('0x8')](_0x7995('0xb'),auth[_0x7995('0x9')](),controller['describe']);router[_0x7995('0x8')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x8')](_0x7995('0xe'),auth[_0x7995('0x9')](),controller[_0x7995('0xf')]);router[_0x7995('0x10')]('/',auth[_0x7995('0x9')](),controller['create']);router[_0x7995('0x10')](_0x7995('0xe'),auth['isAuthenticated'](),controller[_0x7995('0x11')]);router[_0x7995('0x12')](_0x7995('0xc'),auth[_0x7995('0x9')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')](_0x7995('0xc'),auth['isAuthenticated'](),controller['destroy']);module[_0x7995('0x15')]=router;
\ No newline at end of file
diff --git a/server/api/cmContact/cmContact.attributes.js b/server/api/cmContact/cmContact.attributes.js
index a76f7f1..49f4ae1 100644
--- a/server/api/cmContact/cmContact.attributes.js
+++ b/server/api/cmContact/cmContact.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xcaa4=['NOW','INTEGER','sequelize','STRING','TEXT','DATE'];(function(_0x1abeb2,_0x79f462){var _0x48da20=function(_0x42a90b){while(--_0x42a90b){_0x1abeb2['push'](_0x1abeb2['shift']());}};_0x48da20(++_0x79f462);}(_0xcaa4,0x1e8));var _0x4caa=function(_0x5e4623,_0x374bf9){_0x5e4623=_0x5e4623-0x0;var _0x4a1f99=_0xcaa4[_0x5e4623];return _0x4a1f99;};'use strict';var _=require('lodash');var Sequelize=require(_0x4caa('0x0'));module['exports']={'firstName':{'type':Sequelize[_0x4caa('0x1')],'allowNull':![]},'lastName':{'type':Sequelize[_0x4caa('0x1')]},'street':{'type':Sequelize[_0x4caa('0x1')]},'postalCode':{'type':Sequelize[_0x4caa('0x1')]},'city':{'type':Sequelize[_0x4caa('0x1')]},'country':{'type':Sequelize[_0x4caa('0x1')]},'dateOfBirth':{'type':Sequelize[_0x4caa('0x1')]},'description':{'type':Sequelize[_0x4caa('0x2')]},'phone':{'type':Sequelize[_0x4caa('0x1')]},'mobile':{'type':Sequelize[_0x4caa('0x1')]},'fax':{'type':Sequelize['STRING']},'email':{'type':Sequelize['STRING']},'url':{'type':Sequelize[_0x4caa('0x1')]},'facebook':{'type':Sequelize['STRING']},'fb_data':{'type':Sequelize['STRING']},'twitter':{'type':Sequelize['STRING']},'skype':{'type':Sequelize[_0x4caa('0x1')]},'teams':{'type':Sequelize[_0x4caa('0x1')]},'viber':{'type':Sequelize['STRING']},'line':{'type':Sequelize[_0x4caa('0x1')]},'wechat':{'type':Sequelize[_0x4caa('0x1')]},'telegram':{'type':Sequelize[_0x4caa('0x1')]},'UserId':{'type':Sequelize['INTEGER']},'priority':{'type':Sequelize['INTEGER'](0x2)['UNSIGNED'],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0x4caa('0x3')],'defaultValue':Sequelize[_0x4caa('0x4')]},'dialTimezone':{'type':Sequelize[_0x4caa('0x1')]},'utcOffset':{'type':Sequelize[_0x4caa('0x5')]}};
\ No newline at end of file
+var _0x7ef2=['exports','STRING','TEXT','INTEGER','DATE','NOW','lodash'];(function(_0x4b9750,_0x538cbf){var _0x4470b0=function(_0x204609){while(--_0x204609){_0x4b9750['push'](_0x4b9750['shift']());}};_0x4470b0(++_0x538cbf);}(_0x7ef2,0x15d));var _0x27ef=function(_0x330e96,_0x2d26db){_0x330e96=_0x330e96-0x0;var _0x32ef7b=_0x7ef2[_0x330e96];return _0x32ef7b;};'use strict';var _=require(_0x27ef('0x0'));var Sequelize=require('sequelize');module[_0x27ef('0x1')]={'firstName':{'type':Sequelize[_0x27ef('0x2')],'allowNull':![]},'lastName':{'type':Sequelize['STRING']},'street':{'type':Sequelize[_0x27ef('0x2')]},'postalCode':{'type':Sequelize[_0x27ef('0x2')]},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize['STRING']},'dateOfBirth':{'type':Sequelize[_0x27ef('0x2')]},'description':{'type':Sequelize[_0x27ef('0x3')]},'phone':{'type':Sequelize['STRING']},'mobile':{'type':Sequelize[_0x27ef('0x2')]},'fax':{'type':Sequelize[_0x27ef('0x2')]},'email':{'type':Sequelize[_0x27ef('0x2')]},'url':{'type':Sequelize['STRING']},'facebook':{'type':Sequelize[_0x27ef('0x2')]},'fb_data':{'type':Sequelize[_0x27ef('0x2')]},'twitter':{'type':Sequelize[_0x27ef('0x2')]},'skype':{'type':Sequelize[_0x27ef('0x2')]},'teams':{'type':Sequelize[_0x27ef('0x2')]},'viber':{'type':Sequelize['STRING']},'line':{'type':Sequelize[_0x27ef('0x2')]},'wechat':{'type':Sequelize['STRING']},'telegram':{'type':Sequelize[_0x27ef('0x2')]},'UserId':{'type':Sequelize['INTEGER']},'priority':{'type':Sequelize[_0x27ef('0x4')](0x2)['UNSIGNED'],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0x27ef('0x5')],'defaultValue':Sequelize[_0x27ef('0x6')]},'dialTimezone':{'type':Sequelize[_0x27ef('0x2')]},'utcOffset':{'type':Sequelize[_0x27ef('0x4')]}};
\ No newline at end of file
diff --git a/server/api/cmContact/cmContact.controller.js b/server/api/cmContact/cmContact.controller.js
index 1b732eb..89d9f43 100644
--- a/server/api/cmContact/cmContact.controller.js
+++ b/server/api/cmContact/cmContact.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xb7e2=['c.ListId\x20IN\x20?','CONCAT_WS(\x27\x20\x27,\x20c.firstName,\x20c.lastName,\x20c.email)\x20LIKE\x20?','\x20=\x20?','tag','isArray','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','filter','replace','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','isNumeric','c.id\x20LIKE\x20?','c.mobile\x20LIKE\x20?','c.fax\x20LIKE\x20?','isEmail','c.email\x20LIKE\x20?','c.firstName\x20LIKE\x20?','Sequelize','QueryTypes','SELECT','c.id','DESC','t.id\x20IN\x20?','some','user','c.ListId\x20IS\x20NULL','toString','count','sequelize','keyBy','c.firstName','c.fax','c.ListId','GROUP_CONCAT(DISTINCT\x20t.id)','TagIds','Tags','rows','catch','params','tags','columnName','findAll','displayName','alias','custom','values','merge','body','get','mergeWith','join','info','[CmContact][merge]\x20to\x20%s\x20from\x20%s','CmHopper','CmHopperBlack','[CmContact][merge][destroy][CmHopperBlack],\x20%s','ChatInteraction','ChatOfflineMessage','MailInteraction','MailMessage','SmsMessage','FaxInteraction','OpenchannelInteraction','CmHopperFinal','CmHopperHistory','VoiceCallReport','ChatQueueReport','FaxQueueReport','OpenchannelQueueReport','JscriptySessionReport','create','bulkCreate','each','duplicates','$or','findOrCreate','Tag','color','$and','omit','format','cf_%d','pickBy','table','setFields','id\x20=\x20?','toParam','phone','getTags','findOne','rawAttributes','options','setTags','getHoppers','ContactId','include','includeAll','getHopperFinals','getJscriptySessions','uploadCsv','No\x20ListId\x20specified','binding_keys','No\x20association\x20keys\x20specified!','binding_values','No\x20association\x20values\x20specified!','socket_timestamp','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','Incorrect\x20binding\x20parameters\x20passed!','zipObject','No\x20phone\x20column\x20specified','firstName','No\x20firstName\x20column\x20specified','root','server/files/tmp','file','filename','chmodSync','0777','fork','CompanyId','File\x20uploaded\x20correctly!','pid','upload','createReadStream','parse','binding','child_process','stringify','message','start\x20child\x20process\x20correctly!','error\x20child\x20process','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./cmContact.socket','register','status','json','set','Content-Range','apply','reject','save','update','then','destroy','end','sendStatus','error','stack','name','send','index','CmContact','describe','keys','length','startsWith','cf_','push','CmCustomField','trimStart','fieldType','type','query','intersection','model','fields','attributes','hasOwnProperty','nolimit','limit','offset','order','sort','filters','pick','from','tools_tags','select','cm_contacts','left_join','cm_user_has_contacts','uc.CmContactId\x20=\x20c.id','cm_contact_has_tags','ct.CmContactId\x20=\x20c.id','t.id\x20=\x20ct.TagId','where','c.deletedAt\x20IS\x20NULL','expr','search','parseSearch','sqlOperator','conditions','find','field','split','map','forEach','union','User','and','uc.UserId\x20=\x20?','dateOfBirth','datetime','DATE','text','value','start','isNil','Contact','isEmpty','ListId'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xb7e2,0x83));var _0x2b7e=function(_0x31b875,_0x55555d){_0x31b875=_0x31b875-0x0;var _0x533a1a=_0xb7e2[_0x31b875];return _0x533a1a;};'use strict';var pdf=require(_0x2b7e('0x0'));var emlformat=require(_0x2b7e('0x1'));var rimraf=require(_0x2b7e('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x2b7e('0x3'));var rp=require(_0x2b7e('0x4'));var moment=require(_0x2b7e('0x5'));var BPromise=require(_0x2b7e('0x6'));var Mustache=require(_0x2b7e('0x7'));var util=require(_0x2b7e('0x8'));var path=require(_0x2b7e('0x9'));var sox=require(_0x2b7e('0xa'));var csv=require(_0x2b7e('0xb'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x2b7e('0xc'));var squel=require('squel');var crypto=require(_0x2b7e('0xd'));var jsforce=require(_0x2b7e('0xe'));var deskjs=require(_0x2b7e('0xf'));var toCsv=require(_0x2b7e('0xb'));var querystring=require(_0x2b7e('0x10'));var Papa=require('papaparse');var Redis=require(_0x2b7e('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x2b7e('0x12'));var as=require(_0x2b7e('0x13'));var hardwareService=require(_0x2b7e('0x14'));var logger=require(_0x2b7e('0x15'))(_0x2b7e('0x16'));var utils=require(_0x2b7e('0x17'));var config=require('../../config/environment');var db=require(_0x2b7e('0x18'))['db'];config[_0x2b7e('0x19')]=_[_0x2b7e('0x1a')](config[_0x2b7e('0x19')],{'host':_0x2b7e('0x1b'),'port':0x18eb});var socket=require(_0x2b7e('0x1c'))(new Redis(config[_0x2b7e('0x19')]));require(_0x2b7e('0x1d'))[_0x2b7e('0x1e')](socket);function respondWithStatusCode(_0x4aa46a,_0x1e59c4){_0x1e59c4=_0x1e59c4||0xcc;return function(_0x51231c){if(_0x51231c){return _0x4aa46a['sendStatus'](_0x1e59c4);}return _0x4aa46a['status'](_0x1e59c4)['end']();};}function respondWithResult(_0x522752,_0x3946a5){_0x3946a5=_0x3946a5||0xc8;return function(_0x4d4245){if(_0x4d4245){return _0x522752[_0x2b7e('0x1f')](_0x3946a5)[_0x2b7e('0x20')](_0x4d4245);}};}function respondWithFilteredResult(_0x42c85f,_0x48fb22){return function(_0x1afef2){if(_0x1afef2){var _0x157b11=_0x1afef2['count'],_0x18092d=_0x48fb22['offset'],_0x1b4494=_0x48fb22['offset']+_0x48fb22['limit'],_0x480328;if(_0x1b4494>=_0x157b11){_0x1b4494=_0x157b11;_0x480328=0xc8;}else{_0x480328=0xce;}_0x42c85f[_0x2b7e('0x1f')](_0x480328);return _0x42c85f[_0x2b7e('0x21')](_0x2b7e('0x22'),_0x18092d+'-'+_0x1b4494+'/'+_0x157b11)['json'](_0x1afef2);}return null;};}function patchUpdates(_0x22c4c5){return function(_0x1761ea){try{jsonpatch[_0x2b7e('0x23')](_0x1761ea,_0x22c4c5,!![]);}catch(_0xca85f8){return BPromise[_0x2b7e('0x24')](_0xca85f8);}return _0x1761ea[_0x2b7e('0x25')]();};}function saveUpdates(_0x282d63,_0x1bcaf4){return function(_0x1c3b63){if(_0x1c3b63){return _0x1c3b63[_0x2b7e('0x26')](_0x282d63)[_0x2b7e('0x27')](function(_0xee74bd){return _0xee74bd;});}return null;};}function removeEntity(_0x5ab957,_0x55df34){return function(_0x376f17){if(_0x376f17){return _0x376f17[_0x2b7e('0x28')]()['then'](function(){_0x5ab957['status'](0xcc)[_0x2b7e('0x29')]();});}};}function handleEntityNotFound(_0x501231,_0x3db4a6){return function(_0x2ca3f7){if(!_0x2ca3f7){_0x501231[_0x2b7e('0x2a')](0x194);}return _0x2ca3f7;};}function handleError(_0x3251b5,_0x19b3a5){_0x19b3a5=_0x19b3a5||0x1f4;return function(_0x36aa3f){logger[_0x2b7e('0x2b')](_0x36aa3f[_0x2b7e('0x2c')]);if(_0x36aa3f[_0x2b7e('0x2d')]){delete _0x36aa3f[_0x2b7e('0x2d')];}_0x3251b5['status'](_0x19b3a5)[_0x2b7e('0x2e')](_0x36aa3f);};}exports[_0x2b7e('0x2f')]=function(_0x3c7ec5,_0x1868c6){var _0x31277f={},_0x2908f5={},_0xbfbd2d={'count':0x0,'rows':[]};return db[_0x2b7e('0x30')][_0x2b7e('0x31')]()[_0x2b7e('0x27')](function(_0x4aea1b){var _0x13c445=[];for(var _0x3fb27b=0x0;_0x3fb27b0x1){_0x146ec7['or'](_0x2b7e('0x74'),qs[_0x2b7e('0x75')](_0x39f6c3),null);}else{if(qs[_0x2b7e('0x76')](_0x39f6c3)){_0x146ec7['or'](_0x2b7e('0x77'),_0x39f6c3+'%');_0x146ec7['or']('c.phone\x20LIKE\x20?',_0x39f6c3+'%');_0x146ec7['or'](_0x2b7e('0x78'),_0x39f6c3+'%');_0x146ec7['or'](_0x2b7e('0x79'),_0x39f6c3+'%');}else if(qs[_0x2b7e('0x7a')](_0x39f6c3)){_0x146ec7['or'](_0x2b7e('0x7b'),_0x39f6c3+'%');}else{_0x146ec7['or'](_0x2b7e('0x7c'),'%'+_0x39f6c3+'%');_0x146ec7['or']('c.lastName\x20LIKE\x20?','%'+_0x39f6c3+'%');_0x146ec7['or'](_0x2b7e('0x7b'),'%'+_0x39f6c3+'%');}}}}_0x4a7d0f[_0x2b7e('0x52')](_0x146ec7);_0x4a7d0f['group']('c.id');var _0x1dee3a={'type':db[_0x2b7e('0x7d')][_0x2b7e('0x7e')][_0x2b7e('0x7f')],'raw':!![]};var _0x528851=_0x4a7d0f['clone']()[_0x2b7e('0x5a')](_0x2b7e('0x80'));if(_0x31277f[_0x2b7e('0x44')]){_0x31277f[_0x2b7e('0x44')]['forEach'](function(_0x3ec619){_0x4a7d0f[_0x2b7e('0x44')]('c.'+_0x3ec619[0x0],_0x3ec619[0x1]===_0x2b7e('0x81')?![]:!![]);});}if(!_['isEmpty'](_0x5e4968)){_0x4a7d0f['having'](_0x462f7c);_0x528851['where'](_0x2b7e('0x82'),_0x5e4968);}BPromise['resolve']()[_0x2b7e('0x27')](function(){if(_0x347f44&&!_[_0x2b7e('0x83')](_0x347f44[_0x2b7e('0x58')],[_0x2b7e('0x5a'),_0x2b7e('0x5f')])){return _0x3c7ec5[_0x2b7e('0x84')]['getLists']({'attributes':['id'],'raw':!![]})[_0x2b7e('0x27')](function(_0x600c27){if(_[_0x2b7e('0x6a')](_0x600c27)){_0x528851[_0x2b7e('0x52')](_0x2b7e('0x85'));_0x4a7d0f[_0x2b7e('0x52')](_0x2b7e('0x85'));}else{_0x528851[_0x2b7e('0x52')](_0x2b7e('0x6c'),_[_0x2b7e('0x5c')](_0x600c27,'id'));_0x4a7d0f[_0x2b7e('0x52')](_0x2b7e('0x6c'),_[_0x2b7e('0x5c')](_0x600c27,'id'));}});}else{return;}})[_0x2b7e('0x27')](function(){db['sequelize'][_0x2b7e('0x3b')](_0x528851[_0x2b7e('0x86')](),_0x1dee3a)[_0x2b7e('0x27')](function(_0x1ffd2f){_0xbfbd2d[_0x2b7e('0x87')]=_0x1ffd2f[_0x2b7e('0x33')];if(_0xbfbd2d[_0x2b7e('0x87')]===0x0)return[];return db[_0x2b7e('0x88')][_0x2b7e('0x3b')](_0xcad0c2[_0x2b7e('0x86')](),_0x1dee3a);})[_0x2b7e('0x27')](function(_0x1051d3){_0x13912b=_[_0x2b7e('0x89')](_0x1051d3,'id');_0x1dee3a=_['merge'](_0x1dee3a,{'model':db[_0x2b7e('0x30')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x3c7ec5[_0x2b7e('0x3b')][_0x2b7e('0x3e')]){_0x31277f[_0x2b7e('0x3f')][_0x2b7e('0x5d')](function(_0x21e804){_0x4a7d0f['field']('c.'+_0x21e804);});}else{_0x4a7d0f['field'](_0x2b7e('0x80'));_0x4a7d0f[_0x2b7e('0x5a')](_0x2b7e('0x8a'));_0x4a7d0f[_0x2b7e('0x5a')]('c.lastName');_0x4a7d0f[_0x2b7e('0x5a')]('c.phone');_0x4a7d0f[_0x2b7e('0x5a')]('c.mobile');_0x4a7d0f[_0x2b7e('0x5a')](_0x2b7e('0x8b'));_0x4a7d0f[_0x2b7e('0x5a')]('c.email');_0x4a7d0f[_0x2b7e('0x5a')](_0x2b7e('0x8c'));_0x4a7d0f[_0x2b7e('0x5a')]('c.deletedAt');_0x4a7d0f[_0x2b7e('0x5a')](_0x2b7e('0x8d'),_0x2b7e('0x8e'));}if(_0x31277f[_0x2b7e('0x42')])_0x4a7d0f['limit'](_0x31277f[_0x2b7e('0x42')]);if(_0x31277f[_0x2b7e('0x43')])_0x4a7d0f[_0x2b7e('0x43')](_0x31277f['offset']);return db[_0x2b7e('0x88')][_0x2b7e('0x3b')](_0x4a7d0f['toString'](),_0x1dee3a);})[_0x2b7e('0x27')](function(_0x1e0e7d){_0x1e0e7d[_0x2b7e('0x5d')](function(_0x14e61c){if(_0x14e61c[_0x2b7e('0x8e')]){_0x14e61c[_0x2b7e('0x8f')]=[];_0x14e61c[_0x2b7e('0x8e')][_0x2b7e('0x5b')](',')[_0x2b7e('0x5d')](function(_0x54b467){_0x14e61c['Tags'][_0x2b7e('0x36')](_0x13912b[_0x54b467]);});}delete _0x14e61c[_0x2b7e('0x8e')];});_0xbfbd2d[_0x2b7e('0x90')]=_0x1e0e7d;return _0xbfbd2d;})[_0x2b7e('0x27')](respondWithFilteredResult(_0x1868c6,_0x31277f));});})[_0x2b7e('0x91')](handleError(_0x1868c6,null));};exports[_0x2b7e('0x28')]=function(_0x539c69,_0x521c5f){return db[_0x2b7e('0x30')][_0x2b7e('0x59')]({'where':{'id':_0x539c69[_0x2b7e('0x92')]['id']}})[_0x2b7e('0x27')](handleEntityNotFound(_0x521c5f,null))['then'](removeEntity(_0x521c5f,null))['catch'](handleError(_0x521c5f,null));};exports[_0x2b7e('0x31')]=function(_0x224739,_0x5689fd){return db[_0x2b7e('0x30')][_0x2b7e('0x31')]()[_0x2b7e('0x27')](function(_0x2ea0d3){delete _0x2ea0d3[_0x2b7e('0x93')];for(var _0x250fce=0x0;_0x250fce=_0x2c335f){_0x3aaf94=_0x2c335f;_0x394454=0xc8;}else{_0x394454=0xce;}_0xc32b03[_0x3ebe('0x20')](_0x394454);return _0xc32b03[_0x3ebe('0x21')](_0x3ebe('0x22'),_0x4377fe+'-'+_0x3aaf94+'/'+_0x2c335f)['json'](_0x230316);}return null;};}function patchUpdates(_0x22b593){return function(_0x2b558b){try{jsonpatch['apply'](_0x2b558b,_0x22b593,!![]);}catch(_0x118320){return BPromise['reject'](_0x118320);}return _0x2b558b['save']();};}function saveUpdates(_0x32488d,_0x3fc477){return function(_0x11357f){if(_0x11357f){return _0x11357f[_0x3ebe('0x23')](_0x32488d)[_0x3ebe('0x24')](function(_0x5d66c4){return _0x5d66c4;});}return null;};}function removeEntity(_0x356f8f,_0x3ef71b){return function(_0xd04e62){if(_0xd04e62){return _0xd04e62[_0x3ebe('0x25')]()[_0x3ebe('0x24')](function(){_0x356f8f['status'](0xcc)[_0x3ebe('0x1d')]();});}};}function handleEntityNotFound(_0xecca3,_0x498330){return function(_0x4f5417){if(!_0x4f5417){_0xecca3[_0x3ebe('0x26')](0x194);}return _0x4f5417;};}function handleError(_0x200b1e,_0x4c1dd3){_0x4c1dd3=_0x4c1dd3||0x1f4;return function(_0x155dac){logger[_0x3ebe('0x27')](_0x155dac['stack']);if(_0x155dac[_0x3ebe('0x28')]){delete _0x155dac[_0x3ebe('0x28')];}_0x200b1e[_0x3ebe('0x20')](_0x4c1dd3)[_0x3ebe('0x29')](_0x155dac);};}exports['index']=function(_0x1ee02c,_0x5d1927){var _0x1973ba={},_0x17e02e={},_0x2bc346={'count':0x0,'rows':[]};return db[_0x3ebe('0x2a')]['describe']()[_0x3ebe('0x24')](function(_0x2b570d){var _0x2771fe=[];for(var _0x20d89c=0x0;_0x20d89c0x1){_0x24fbb6['or'](_0x3ebe('0x69'),qs['getFullTextValue'](_0x5b53c1),null);}else{if(qs['isNumeric'](_0x5b53c1)){_0x24fbb6['or'](_0x3ebe('0x6a'),_0x5b53c1+'%');_0x24fbb6['or'](_0x3ebe('0x6b'),_0x5b53c1+'%');_0x24fbb6['or'](_0x3ebe('0x6c'),_0x5b53c1+'%');_0x24fbb6['or'](_0x3ebe('0x6d'),_0x5b53c1+'%');}else if(qs[_0x3ebe('0x6e')](_0x5b53c1)){_0x24fbb6['or']('c.email\x20LIKE\x20?',_0x5b53c1+'%');}else{_0x24fbb6['or'](_0x3ebe('0x6f'),'%'+_0x5b53c1+'%');_0x24fbb6['or'](_0x3ebe('0x70'),'%'+_0x5b53c1+'%');_0x24fbb6['or']('c.email\x20LIKE\x20?','%'+_0x5b53c1+'%');}}}}_0x369043[_0x3ebe('0x40')](_0x24fbb6);_0x369043[_0x3ebe('0x71')](_0x3ebe('0x72'));var _0x5af1ff={'type':db[_0x3ebe('0x73')][_0x3ebe('0x74')]['SELECT'],'raw':!![]};var _0xfe3647=_0x369043[_0x3ebe('0x75')]()[_0x3ebe('0x43')](_0x3ebe('0x72'));if(_0x1973ba[_0x3ebe('0x76')]){_0x1973ba[_0x3ebe('0x76')][_0x3ebe('0x61')](function(_0x1036df){_0x369043[_0x3ebe('0x76')]('c.'+_0x1036df[0x0],_0x1036df[0x1]===_0x3ebe('0x77')?![]:!![]);});}if(!_[_0x3ebe('0x60')](_0x1b511f)){_0x369043['having'](_0x69dfdc);_0xfe3647['where'](_0x3ebe('0x78'),_0x1b511f);}BPromise[_0x3ebe('0x79')]()[_0x3ebe('0x24')](function(){if(_0x2cad1e&&!_['some'](_0x2cad1e[_0x3ebe('0x50')],['field',_0x3ebe('0x56')])){return _0x1ee02c[_0x3ebe('0x7a')][_0x3ebe('0x7b')]({'attributes':['id'],'raw':!![]})[_0x3ebe('0x24')](function(_0x28f756){if(_[_0x3ebe('0x60')](_0x28f756)){_0xfe3647[_0x3ebe('0x40')](_0x3ebe('0x7c'));_0x369043['where'](_0x3ebe('0x7c'));}else{_0xfe3647[_0x3ebe('0x40')](_0x3ebe('0x7d'),_[_0x3ebe('0x53')](_0x28f756,'id'));_0x369043[_0x3ebe('0x40')](_0x3ebe('0x7d'),_[_0x3ebe('0x53')](_0x28f756,'id'));}});}else{return;}})[_0x3ebe('0x24')](function(){db[_0x3ebe('0x7e')]['query'](_0xfe3647[_0x3ebe('0x7f')](),_0x5af1ff)[_0x3ebe('0x24')](function(_0xb6e0bf){_0x2bc346[_0x3ebe('0x1e')]=_0xb6e0bf['length'];if(_0x2bc346['count']===0x0)return[];return db[_0x3ebe('0x7e')][_0x3ebe('0x37')](_0x38434b['toString'](),_0x5af1ff);})['then'](function(_0x146ff9){_0x49da56=_['keyBy'](_0x146ff9,'id');_0x5af1ff=_[_0x3ebe('0x80')](_0x5af1ff,{'model':db[_0x3ebe('0x2a')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x1ee02c[_0x3ebe('0x37')]['fields']){_0x1973ba[_0x3ebe('0x3a')][_0x3ebe('0x61')](function(_0x5b9191){_0x369043[_0x3ebe('0x43')]('c.'+_0x5b9191);});}else{_0x369043[_0x3ebe('0x43')](_0x3ebe('0x72'));_0x369043[_0x3ebe('0x43')]('c.firstName');_0x369043['field'](_0x3ebe('0x81'));_0x369043[_0x3ebe('0x43')](_0x3ebe('0x82'));_0x369043['field'](_0x3ebe('0x83'));_0x369043[_0x3ebe('0x43')](_0x3ebe('0x84'));_0x369043['field']('c.email');_0x369043[_0x3ebe('0x43')](_0x3ebe('0x85'));_0x369043['field']('c.deletedAt');_0x369043[_0x3ebe('0x43')]('GROUP_CONCAT(DISTINCT\x20t.id)',_0x3ebe('0x86'));}if(_0x1973ba[_0x3ebe('0x3e')])_0x369043[_0x3ebe('0x3e')](_0x1973ba[_0x3ebe('0x3e')]);if(_0x1973ba[_0x3ebe('0x1f')])_0x369043[_0x3ebe('0x1f')](_0x1973ba[_0x3ebe('0x1f')]);return db['sequelize'][_0x3ebe('0x37')](_0x369043[_0x3ebe('0x7f')](),_0x5af1ff);})[_0x3ebe('0x24')](function(_0x158bb8){_0x158bb8[_0x3ebe('0x61')](function(_0x5f0fdc){if(_0x5f0fdc[_0x3ebe('0x86')]){_0x5f0fdc[_0x3ebe('0x87')]=[];_0x5f0fdc['TagIds'][_0x3ebe('0x88')](',')[_0x3ebe('0x61')](function(_0x2f94c6){_0x5f0fdc[_0x3ebe('0x87')][_0x3ebe('0x2e')](_0x49da56[_0x2f94c6]);});}delete _0x5f0fdc['TagIds'];});_0x2bc346['rows']=_0x158bb8;return _0x2bc346;})[_0x3ebe('0x24')](respondWithFilteredResult(_0x5d1927,_0x1973ba));});})['catch'](handleError(_0x5d1927,null));};exports['destroy']=function(_0x21565a,_0x5b2744){return db[_0x3ebe('0x2a')][_0x3ebe('0x89')]({'where':{'id':_0x21565a[_0x3ebe('0x8a')]['id']}})[_0x3ebe('0x24')](handleEntityNotFound(_0x5b2744,null))[_0x3ebe('0x24')](removeEntity(_0x5b2744,null))[_0x3ebe('0x8b')](handleError(_0x5b2744,null));};exports[_0x3ebe('0x8c')]=function(_0xd6d1bc,_0x31198c){return db[_0x3ebe('0x2a')]['describe']()[_0x3ebe('0x24')](function(_0x3b930b){delete _0x3b930b['tags'];for(var _0x48cb52=0x0;_0x48cb52{}\s\\|]/g,'-');_0x355af0(null,util[_0xd425('0x23')](_0xd425('0x24'),path[_0xd425('0x25')](_0x5e797a[_0xd425('0x21')],path[_0xd425('0x26')](_0x5e797a[_0xd425('0x21')])),Date[_0xd425('0x27')](),path[_0xd425('0x26')](_0x5e797a[_0xd425('0x21')])));}})});router[_0xd425('0x1a')](_0xd425('0x28'),upload['single'](_0xd425('0x29')),controller[_0xd425('0x2a')]);var upload=multer({'storage':multer[_0xd425('0x1e')]({'destination':function(_0x1908a5,_0x2afcdb,_0x400dd7){_0x400dd7(null,path[_0xd425('0x2b')](config['root'],_0xd425('0x20')));},'filename':function(_0x177de2,_0x1d8861,_0x57c950){_0x1d8861[_0xd425('0x21')]=_0x1d8861[_0xd425('0x21')][_0xd425('0x22')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x57c950(null,util[_0xd425('0x23')](_0xd425('0x24'),path[_0xd425('0x25')](_0x1d8861[_0xd425('0x21')],path[_0xd425('0x26')](_0x1d8861[_0xd425('0x21')])),Date[_0xd425('0x27')](),path['extname'](_0x1d8861[_0xd425('0x21')])));}})});router[_0xd425('0x1a')](_0xd425('0x2c'),upload[_0xd425('0x2d')](_0xd425('0x29')),controller[_0xd425('0x2e')]);router[_0xd425('0x1a')](_0xd425('0x2f'),auth[_0xd425('0x9')](),controller[_0xd425('0x30')]);router[_0xd425('0x31')]('/:id',auth[_0xd425('0x9')](),controller[_0xd425('0x32')]);router[_0xd425('0x33')](_0xd425('0xc'),auth[_0xd425('0x9')](),controller['destroy']);module[_0xd425('0x34')]=router;
\ No newline at end of file
+var _0x2d17=['single','upload','/upload/:id','import','update','exports','multer','util','connect-timeout','express','../../components/auth/service','../../components/interaction/service','./cmContact.controller','isAuthenticated','get','/describe','describe','/:id','show','/:id/tags','getTags','/:id/hoppers','getHoppers','/:id/hopper_histories','getHopperHistories','getHopperFinals','/:id/jscripty_sessions','getJscriptySessions','post','/merge','merge','create','/create_many','bulkCreate','setTags','diskStorage','join','root','server/files/tmp','originalname','extname','now','/csv','uploadCsv','replace','%s-%s%s','/upload'];(function(_0x43d16c,_0x2b5447){var _0x208cce=function(_0x371720){while(--_0x371720){_0x43d16c['push'](_0x43d16c['shift']());}};_0x208cce(++_0x2b5447);}(_0x2d17,0x17e));var _0x72d1=function(_0x5085b4,_0x2296ae){_0x5085b4=_0x5085b4-0x0;var _0x2a119d=_0x2d17[_0x5085b4];return _0x2a119d;};'use strict';var multer=require(_0x72d1('0x0'));var util=require(_0x72d1('0x1'));var path=require('path');var timeout=require(_0x72d1('0x2'));var express=require(_0x72d1('0x3'));var router=express['Router']();var auth=require(_0x72d1('0x4'));var interaction=require(_0x72d1('0x5'));var config=require('../../config/environment');var controller=require(_0x72d1('0x6'));router['get']('/',auth[_0x72d1('0x7')](),controller['index']);router[_0x72d1('0x8')](_0x72d1('0x9'),auth['isAuthenticated'](),controller[_0x72d1('0xa')]);router[_0x72d1('0x8')](_0x72d1('0xb'),auth['isAuthenticated'](),controller[_0x72d1('0xc')]);router[_0x72d1('0x8')](_0x72d1('0xd'),auth['isAuthenticated'](),controller[_0x72d1('0xe')]);router[_0x72d1('0x8')](_0x72d1('0xf'),auth[_0x72d1('0x7')](),controller[_0x72d1('0x10')]);router[_0x72d1('0x8')](_0x72d1('0x11'),auth[_0x72d1('0x7')](),controller[_0x72d1('0x12')]);router[_0x72d1('0x8')]('/:id/hopper_finals',auth[_0x72d1('0x7')](),controller[_0x72d1('0x13')]);router[_0x72d1('0x8')](_0x72d1('0x14'),auth[_0x72d1('0x7')](),controller[_0x72d1('0x15')]);router[_0x72d1('0x16')](_0x72d1('0x17'),auth[_0x72d1('0x7')](),controller[_0x72d1('0x18')]);router[_0x72d1('0x16')]('/',auth[_0x72d1('0x7')](),controller[_0x72d1('0x19')]);router['post'](_0x72d1('0x1a'),auth['isAuthenticated'](),controller[_0x72d1('0x1b')]);router[_0x72d1('0x16')]('/:id/tags',auth[_0x72d1('0x7')](),controller[_0x72d1('0x1c')]);var upload=multer({'storage':multer[_0x72d1('0x1d')]({'destination':function(_0x49caf4,_0x4925f6,_0x313d7b){_0x313d7b(null,path[_0x72d1('0x1e')](config[_0x72d1('0x1f')],_0x72d1('0x20')));},'filename':function(_0x8d6890,_0x2253fd,_0x1e2411){_0x2253fd['originalname']=_0x2253fd[_0x72d1('0x21')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x1e2411(null,util['format']('%s-%s%s',path['basename'](_0x2253fd[_0x72d1('0x21')],path[_0x72d1('0x22')](_0x2253fd['originalname'])),Date[_0x72d1('0x23')](),path[_0x72d1('0x22')](_0x2253fd[_0x72d1('0x21')])));}})});router[_0x72d1('0x16')](_0x72d1('0x24'),upload['single']('file'),controller[_0x72d1('0x25')]);var upload=multer({'storage':multer[_0x72d1('0x1d')]({'destination':function(_0x2f661,_0x2f879f,_0xdf6a69){_0xdf6a69(null,path[_0x72d1('0x1e')](config[_0x72d1('0x1f')],'server/files/tmp'));},'filename':function(_0x57ec9e,_0x1ba258,_0x482cb8){_0x1ba258[_0x72d1('0x21')]=_0x1ba258[_0x72d1('0x21')][_0x72d1('0x26')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x482cb8(null,util['format'](_0x72d1('0x27'),path['basename'](_0x1ba258[_0x72d1('0x21')],path[_0x72d1('0x22')](_0x1ba258[_0x72d1('0x21')])),Date[_0x72d1('0x23')](),path['extname'](_0x1ba258[_0x72d1('0x21')])));}})});router['post'](_0x72d1('0x28'),upload[_0x72d1('0x29')]('file'),controller[_0x72d1('0x2a')]);router[_0x72d1('0x16')](_0x72d1('0x2b'),auth[_0x72d1('0x7')](),controller[_0x72d1('0x2c')]);router['put'](_0x72d1('0xb'),auth[_0x72d1('0x7')](),controller[_0x72d1('0x2d')]);router['delete'](_0x72d1('0xb'),auth[_0x72d1('0x7')](),controller['destroy']);module[_0x72d1('0x2e')]=router;
\ No newline at end of file
diff --git a/server/api/cmContactHasItem/cmContactHasItem.attributes.js b/server/api/cmContactHasItem/cmContactHasItem.attributes.js
index 7933a41..563d944 100644
--- a/server/api/cmContactHasItem/cmContactHasItem.attributes.js
+++ b/server/api/cmContactHasItem/cmContactHasItem.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xf105=['sequelize','exports','INTEGER','STRING'];(function(_0x398450,_0x4a206c){var _0xeea830=function(_0x100330){while(--_0x100330){_0x398450['push'](_0x398450['shift']());}};_0xeea830(++_0x4a206c);}(_0xf105,0x1b0));var _0x5f10=function(_0x5e91c7,_0x2e6b79){_0x5e91c7=_0x5e91c7-0x0;var _0x52c081=_0xf105[_0x5e91c7];return _0x52c081;};'use strict';var Sequelize=require(_0x5f10('0x0'));module[_0x5f10('0x1')]={'CmContactId':{'type':Sequelize[_0x5f10('0x2')],'primaryKey':!![]},'item':{'type':Sequelize[_0x5f10('0x3')],'defaultValue':'','primaryKey':!![]},'ItemTypeId':{'type':Sequelize[_0x5f10('0x2')],'defaultValue':null},'ItemClass':{'type':Sequelize[_0x5f10('0x3')],'defaultValue':'PHONE'},'OrderBy':{'type':Sequelize[_0x5f10('0x2')],'defaultValue':null}};
\ No newline at end of file
+var _0x5a99=['PHONE','sequelize','exports','INTEGER','STRING'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x5a99,0xc9));var _0x95a9=function(_0x2cb1ec,_0x1ef536){_0x2cb1ec=_0x2cb1ec-0x0;var _0x48dafc=_0x5a99[_0x2cb1ec];return _0x48dafc;};'use strict';var Sequelize=require(_0x95a9('0x0'));module[_0x95a9('0x1')]={'CmContactId':{'type':Sequelize[_0x95a9('0x2')],'primaryKey':!![]},'item':{'type':Sequelize['STRING'],'defaultValue':'','primaryKey':!![]},'ItemTypeId':{'type':Sequelize[_0x95a9('0x2')],'defaultValue':null},'ItemClass':{'type':Sequelize[_0x95a9('0x3')],'defaultValue':_0x95a9('0x4')},'OrderBy':{'type':Sequelize[_0x95a9('0x2')],'defaultValue':null}};
\ No newline at end of file
diff --git a/server/api/cmContactHasItem/cmContactHasItem.controller.js b/server/api/cmContactHasItem/cmContactHasItem.controller.js
index 446d2f0..92100af 100644
--- a/server/api/cmContactHasItem/cmContactHasItem.controller.js
+++ b/server/api/cmContactHasItem/cmContactHasItem.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xdb82=['model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','catch','show','params','options','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','UserProfileResource','html-pdf','rimraf','zip-dir','moment','bluebird','mustache','util','path','ejs','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','sendStatus','end','json','count','offset','limit','status','set','Content-Range','reject','update','destroy','then','CmContactHasItems','error','stack','name','send','index','map','CmContactHasItem','rawAttributes','type','key'];(function(_0x499b02,_0x4cc638){var _0x2980f3=function(_0xb328e2){while(--_0xb328e2){_0x499b02['push'](_0x499b02['shift']());}};_0x2980f3(++_0x4cc638);}(_0xdb82,0x1dc));var _0x2db8=function(_0xaf1901,_0x4f5d21){_0xaf1901=_0xaf1901-0x0;var _0x38c5ce=_0xdb82[_0xaf1901];return _0x38c5ce;};'use strict';var pdf=require(_0x2db8('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x2db8('0x1'));var zipdir=require(_0x2db8('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x2db8('0x3'));var BPromise=require(_0x2db8('0x4'));var Mustache=require(_0x2db8('0x5'));var util=require(_0x2db8('0x6'));var path=require(_0x2db8('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x2db8('0x8'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x2db8('0x9'));var deskjs=require(_0x2db8('0xa'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x2db8('0xb'));var authService=require(_0x2db8('0xc'));var qs=require(_0x2db8('0xd'));var as=require(_0x2db8('0xe'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x2db8('0xf'))(_0x2db8('0x10'));var utils=require(_0x2db8('0x11'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xc86f0d,_0x21befb){_0x21befb=_0x21befb||0xcc;return function(_0x150870){if(_0x150870){return _0xc86f0d[_0x2db8('0x12')](_0x21befb);}return _0xc86f0d['status'](_0x21befb)[_0x2db8('0x13')]();};}function respondWithResult(_0x2a34e6,_0x1476ba){_0x1476ba=_0x1476ba||0xc8;return function(_0x3285a2){if(_0x3285a2){return _0x2a34e6['status'](_0x1476ba)[_0x2db8('0x14')](_0x3285a2);}};}function respondWithFilteredResult(_0x581bc0,_0x2fa4fe){return function(_0x42001e){if(_0x42001e){var _0x3d1f5f=_0x42001e[_0x2db8('0x15')],_0x212797=_0x2fa4fe[_0x2db8('0x16')],_0x55cf73=_0x2fa4fe[_0x2db8('0x16')]+_0x2fa4fe[_0x2db8('0x17')],_0x157607;if(_0x55cf73>=_0x3d1f5f){_0x55cf73=_0x3d1f5f;_0x157607=0xc8;}else{_0x157607=0xce;}_0x581bc0[_0x2db8('0x18')](_0x157607);return _0x581bc0[_0x2db8('0x19')](_0x2db8('0x1a'),_0x212797+'-'+_0x55cf73+'/'+_0x3d1f5f)[_0x2db8('0x14')](_0x42001e);}return null;};}function patchUpdates(_0x4a6be6){return function(_0x37c414){try{jsonpatch['apply'](_0x37c414,_0x4a6be6,!![]);}catch(_0x4df301){return BPromise[_0x2db8('0x1b')](_0x4df301);}return _0x37c414['save']();};}function saveUpdates(_0x333a8c,_0x5764f8){return function(_0x304d6b){if(_0x304d6b){return _0x304d6b[_0x2db8('0x1c')](_0x333a8c)['then'](function(_0xc67de7){return _0xc67de7;});}return null;};}function removeEntity(_0x2d6a12,_0x140585){return function(_0x6183f3){if(_0x6183f3){return _0x6183f3[_0x2db8('0x1d')]()[_0x2db8('0x1e')](function(){var _0x524692=_0x6183f3['get']({'plain':!![]});var _0x3ab9c0=_0x2db8('0x1f');return db['UserProfileResource'][_0x2db8('0x1d')]({'where':{'type':_0x3ab9c0,'resourceId':_0x524692['id']}})[_0x2db8('0x1e')](function(){return _0x6183f3;});})[_0x2db8('0x1e')](function(){_0x2d6a12[_0x2db8('0x18')](0xcc)[_0x2db8('0x13')]();});}};}function handleEntityNotFound(_0x2f71db,_0x1d1fda){return function(_0x1ca262){if(!_0x1ca262){_0x2f71db[_0x2db8('0x12')](0x194);}return _0x1ca262;};}function handleError(_0x25bfe4,_0x58bff1){_0x58bff1=_0x58bff1||0x1f4;return function(_0x130ab){logger[_0x2db8('0x20')](_0x130ab[_0x2db8('0x21')]);if(_0x130ab[_0x2db8('0x22')]){delete _0x130ab[_0x2db8('0x22')];}_0x25bfe4[_0x2db8('0x18')](_0x58bff1)[_0x2db8('0x23')](_0x130ab);};}exports[_0x2db8('0x24')]=function(_0x3569ae,_0x3de877){var _0x48c740={},_0x37049d={},_0x31335f={'count':0x0,'rows':[]};var _0x598f49=_[_0x2db8('0x25')](db[_0x2db8('0x26')][_0x2db8('0x27')],function(_0xc344e2){return{'name':_0xc344e2['fieldName'],'type':_0xc344e2[_0x2db8('0x28')][_0x2db8('0x29')]};});_0x37049d[_0x2db8('0x2a')]=_[_0x2db8('0x25')](_0x598f49,_0x2db8('0x22'));_0x37049d[_0x2db8('0x2b')]=_[_0x2db8('0x2c')](_0x3569ae[_0x2db8('0x2b')]);_0x37049d[_0x2db8('0x2d')]=_[_0x2db8('0x2e')](_0x37049d['model'],_0x37049d['query']);_0x48c740[_0x2db8('0x2f')]=_[_0x2db8('0x2e')](_0x37049d[_0x2db8('0x2a')],qs[_0x2db8('0x30')](_0x3569ae[_0x2db8('0x2b')][_0x2db8('0x30')]));_0x48c740['attributes']=_0x48c740['attributes'][_0x2db8('0x31')]?_0x48c740[_0x2db8('0x2f')]:_0x37049d[_0x2db8('0x2a')];if(!_0x3569ae[_0x2db8('0x2b')][_0x2db8('0x32')]('nolimit')){_0x48c740[_0x2db8('0x17')]=qs[_0x2db8('0x17')](_0x3569ae[_0x2db8('0x2b')][_0x2db8('0x17')]);_0x48c740['offset']=qs[_0x2db8('0x16')](_0x3569ae[_0x2db8('0x2b')]['offset']);}_0x48c740['order']=qs[_0x2db8('0x33')](_0x3569ae[_0x2db8('0x2b')]['sort']);_0x48c740[_0x2db8('0x34')]=qs[_0x2db8('0x2d')](_[_0x2db8('0x35')](_0x3569ae[_0x2db8('0x2b')],_0x37049d[_0x2db8('0x2d')]),_0x598f49);if(_0x3569ae[_0x2db8('0x2b')][_0x2db8('0x36')]){_0x48c740[_0x2db8('0x34')]=_[_0x2db8('0x37')](_0x48c740['where'],{'$or':_[_0x2db8('0x25')](_0x598f49,function(_0x34112c){if(_0x34112c[_0x2db8('0x28')]!==_0x2db8('0x38')){var _0x5d08ec={};_0x5d08ec[_0x34112c[_0x2db8('0x22')]]={'$like':'%'+_0x3569ae[_0x2db8('0x2b')]['filter']+'%'};return _0x5d08ec;}})});}_0x48c740=_[_0x2db8('0x37')]({},_0x48c740,_0x3569ae['options']);var _0x36e2e8={'where':_0x48c740[_0x2db8('0x34')]};return db[_0x2db8('0x26')]['count'](_0x36e2e8)['then'](function(_0x3505bc){_0x31335f[_0x2db8('0x15')]=_0x3505bc;if(_0x3569ae[_0x2db8('0x2b')][_0x2db8('0x39')]){_0x48c740[_0x2db8('0x3a')]=[{'all':!![]}];}return db[_0x2db8('0x26')][_0x2db8('0x3b')](_0x48c740);})[_0x2db8('0x1e')](function(_0x244a51){_0x31335f['rows']=_0x244a51;return _0x31335f;})['then'](respondWithFilteredResult(_0x3de877,_0x48c740))[_0x2db8('0x3c')](handleError(_0x3de877,null));};exports[_0x2db8('0x3d')]=function(_0x5e5196,_0x1e5c35){var _0x33d518={'raw':!![],'where':{'id':_0x5e5196[_0x2db8('0x3e')]['id']}},_0x37bb41={};_0x37bb41[_0x2db8('0x2a')]=_[_0x2db8('0x2c')](db['CmContactHasItem'][_0x2db8('0x27')]);_0x37bb41[_0x2db8('0x2b')]=_[_0x2db8('0x2c')](_0x5e5196[_0x2db8('0x2b')]);_0x37bb41[_0x2db8('0x2d')]=_[_0x2db8('0x2e')](_0x37bb41[_0x2db8('0x2a')],_0x37bb41[_0x2db8('0x2b')]);_0x33d518[_0x2db8('0x2f')]=_[_0x2db8('0x2e')](_0x37bb41['model'],qs[_0x2db8('0x30')](_0x5e5196['query'][_0x2db8('0x30')]));_0x33d518['attributes']=_0x33d518[_0x2db8('0x2f')][_0x2db8('0x31')]?_0x33d518[_0x2db8('0x2f')]:_0x37bb41['model'];if(_0x5e5196['query'][_0x2db8('0x39')]){_0x33d518[_0x2db8('0x3a')]=[{'all':!![]}];}_0x33d518=_[_0x2db8('0x37')]({},_0x33d518,_0x5e5196[_0x2db8('0x3f')]);return db[_0x2db8('0x26')][_0x2db8('0x40')](_0x33d518)[_0x2db8('0x1e')](handleEntityNotFound(_0x1e5c35,null))[_0x2db8('0x1e')](respondWithResult(_0x1e5c35,null))['catch'](handleError(_0x1e5c35,null));};exports[_0x2db8('0x41')]=function(_0x3e20ed,_0x2915ff){return db[_0x2db8('0x26')][_0x2db8('0x41')](_0x3e20ed[_0x2db8('0x42')],{})[_0x2db8('0x1e')](function(_0x16a521){var _0x4d40e4=_0x3e20ed[_0x2db8('0x43')][_0x2db8('0x44')]({'plain':!![]});if(!_0x4d40e4)throw new Error(_0x2db8('0x45'));if(_0x4d40e4[_0x2db8('0x46')]===_0x2db8('0x43')){var _0x47a33b=_0x16a521[_0x2db8('0x44')]({'plain':!![]});var _0x3a1643=_0x2db8('0x1f');return db[_0x2db8('0x47')][_0x2db8('0x40')]({'where':{'name':_0x3a1643,'userProfileId':_0x4d40e4['userProfileId']},'raw':!![]})[_0x2db8('0x1e')](function(_0x4f1824){if(_0x4f1824&&_0x4f1824[_0x2db8('0x48')]===0x0){return db[_0x2db8('0x49')]['create']({'name':_0x47a33b[_0x2db8('0x22')],'resourceId':_0x47a33b['id'],'type':_0x4f1824['name'],'sectionId':_0x4f1824['id']},{})[_0x2db8('0x1e')](function(){return _0x16a521;});}else{return _0x16a521;}})[_0x2db8('0x3c')](function(_0x27d172){logger[_0x2db8('0x20')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x27d172);throw _0x27d172;});}return _0x16a521;})[_0x2db8('0x1e')](respondWithResult(_0x2915ff,0xc9))[_0x2db8('0x3c')](handleError(_0x2915ff,null));};exports[_0x2db8('0x1c')]=function(_0x5343d8,_0x1c5255){if(_0x5343d8[_0x2db8('0x42')]['id']){delete _0x5343d8[_0x2db8('0x42')]['id'];}return db[_0x2db8('0x26')][_0x2db8('0x40')]({'where':{'id':_0x5343d8[_0x2db8('0x3e')]['id']}})['then'](handleEntityNotFound(_0x1c5255,null))[_0x2db8('0x1e')](saveUpdates(_0x5343d8[_0x2db8('0x42')],null))['then'](respondWithResult(_0x1c5255,null))['catch'](handleError(_0x1c5255,null));};exports['destroy']=function(_0x321212,_0x3f264f){return db[_0x2db8('0x26')]['find']({'where':{'id':_0x321212[_0x2db8('0x3e')]['id']}})[_0x2db8('0x1e')](handleEntityNotFound(_0x3f264f,null))[_0x2db8('0x1e')](removeEntity(_0x3f264f,null))[_0x2db8('0x3c')](handleError(_0x3f264f,null));};
\ No newline at end of file
+var _0x0347=['name','send','map','CmContactHasItem','rawAttributes','fieldName','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','include','findAll','catch','show','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','ejs','squel','crypto','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','sendStatus','end','json','offset','limit','status','set','Content-Range','apply','reject','update','then','destroy','get','CmContactHasItems','stack'];(function(_0x1bbab5,_0x4f7ef0){var _0x4bd92e=function(_0x4b6696){while(--_0x4b6696){_0x1bbab5['push'](_0x1bbab5['shift']());}};_0x4bd92e(++_0x4f7ef0);}(_0x0347,0x1f0));var _0x7034=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0x0347[_0x21a9d9];return _0x46adce;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x7034('0x0'));var rimraf=require(_0x7034('0x1'));var zipdir=require(_0x7034('0x2'));var jsonpatch=require(_0x7034('0x3'));var rp=require(_0x7034('0x4'));var moment=require('moment');var BPromise=require(_0x7034('0x5'));var Mustache=require(_0x7034('0x6'));var util=require(_0x7034('0x7'));var path=require(_0x7034('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x7034('0x9'));var fs=require('fs');var _=require('lodash');var squel=require(_0x7034('0xa'));var crypto=require(_0x7034('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x7034('0xc'));var toCsv=require('to-csv');var querystring=require(_0x7034('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x7034('0xe'));var qs=require(_0x7034('0xf'));var as=require(_0x7034('0x10'));var hardwareService=require(_0x7034('0x11'));var logger=require('../../config/logger')(_0x7034('0x12'));var utils=require(_0x7034('0x13'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x13ee23,_0x1a7bd2){_0x1a7bd2=_0x1a7bd2||0xcc;return function(_0x91863b){if(_0x91863b){return _0x13ee23[_0x7034('0x14')](_0x1a7bd2);}return _0x13ee23['status'](_0x1a7bd2)[_0x7034('0x15')]();};}function respondWithResult(_0x143c0a,_0x2d0ad3){_0x2d0ad3=_0x2d0ad3||0xc8;return function(_0x110103){if(_0x110103){return _0x143c0a['status'](_0x2d0ad3)[_0x7034('0x16')](_0x110103);}};}function respondWithFilteredResult(_0x10f83e,_0x2a4396){return function(_0xc749d1){if(_0xc749d1){var _0x1e6898=_0xc749d1['count'],_0x418272=_0x2a4396[_0x7034('0x17')],_0x3dcc7a=_0x2a4396[_0x7034('0x17')]+_0x2a4396[_0x7034('0x18')],_0x1f8e78;if(_0x3dcc7a>=_0x1e6898){_0x3dcc7a=_0x1e6898;_0x1f8e78=0xc8;}else{_0x1f8e78=0xce;}_0x10f83e[_0x7034('0x19')](_0x1f8e78);return _0x10f83e[_0x7034('0x1a')](_0x7034('0x1b'),_0x418272+'-'+_0x3dcc7a+'/'+_0x1e6898)[_0x7034('0x16')](_0xc749d1);}return null;};}function patchUpdates(_0xbbf88f){return function(_0x505654){try{jsonpatch[_0x7034('0x1c')](_0x505654,_0xbbf88f,!![]);}catch(_0x2867c4){return BPromise[_0x7034('0x1d')](_0x2867c4);}return _0x505654['save']();};}function saveUpdates(_0x1bb1cc,_0x48f5f1){return function(_0x2c3964){if(_0x2c3964){return _0x2c3964[_0x7034('0x1e')](_0x1bb1cc)[_0x7034('0x1f')](function(_0x56ef60){return _0x56ef60;});}return null;};}function removeEntity(_0x31f2ef,_0x33c792){return function(_0xdd907b){if(_0xdd907b){return _0xdd907b[_0x7034('0x20')]()[_0x7034('0x1f')](function(){var _0x5f11a6=_0xdd907b[_0x7034('0x21')]({'plain':!![]});var _0x114d6b=_0x7034('0x22');return db['UserProfileResource']['destroy']({'where':{'type':_0x114d6b,'resourceId':_0x5f11a6['id']}})[_0x7034('0x1f')](function(){return _0xdd907b;});})[_0x7034('0x1f')](function(){_0x31f2ef['status'](0xcc)[_0x7034('0x15')]();});}};}function handleEntityNotFound(_0x3a0f1d,_0xed5e9){return function(_0x822e15){if(!_0x822e15){_0x3a0f1d['sendStatus'](0x194);}return _0x822e15;};}function handleError(_0x36eb11,_0xd5b9af){_0xd5b9af=_0xd5b9af||0x1f4;return function(_0xc8ccba){logger['error'](_0xc8ccba[_0x7034('0x23')]);if(_0xc8ccba[_0x7034('0x24')]){delete _0xc8ccba[_0x7034('0x24')];}_0x36eb11[_0x7034('0x19')](_0xd5b9af)[_0x7034('0x25')](_0xc8ccba);};}exports['index']=function(_0x50a99f,_0x423158){var _0x518de0={},_0x1f5b6e={},_0x22c48d={'count':0x0,'rows':[]};var _0xec9b7d=_[_0x7034('0x26')](db[_0x7034('0x27')][_0x7034('0x28')],function(_0x28512d){return{'name':_0x28512d[_0x7034('0x29')],'type':_0x28512d['type'][_0x7034('0x2a')]};});_0x1f5b6e[_0x7034('0x2b')]=_[_0x7034('0x26')](_0xec9b7d,'name');_0x1f5b6e[_0x7034('0x2c')]=_[_0x7034('0x2d')](_0x50a99f[_0x7034('0x2c')]);_0x1f5b6e['filters']=_[_0x7034('0x2e')](_0x1f5b6e[_0x7034('0x2b')],_0x1f5b6e[_0x7034('0x2c')]);_0x518de0[_0x7034('0x2f')]=_['intersection'](_0x1f5b6e['model'],qs[_0x7034('0x30')](_0x50a99f[_0x7034('0x2c')][_0x7034('0x30')]));_0x518de0[_0x7034('0x2f')]=_0x518de0[_0x7034('0x2f')][_0x7034('0x31')]?_0x518de0[_0x7034('0x2f')]:_0x1f5b6e['model'];if(!_0x50a99f[_0x7034('0x2c')][_0x7034('0x32')]('nolimit')){_0x518de0[_0x7034('0x18')]=qs[_0x7034('0x18')](_0x50a99f[_0x7034('0x2c')][_0x7034('0x18')]);_0x518de0[_0x7034('0x17')]=qs[_0x7034('0x17')](_0x50a99f[_0x7034('0x2c')][_0x7034('0x17')]);}_0x518de0[_0x7034('0x33')]=qs[_0x7034('0x34')](_0x50a99f['query'][_0x7034('0x34')]);_0x518de0[_0x7034('0x35')]=qs[_0x7034('0x36')](_[_0x7034('0x37')](_0x50a99f['query'],_0x1f5b6e[_0x7034('0x36')]),_0xec9b7d);if(_0x50a99f['query'][_0x7034('0x38')]){_0x518de0[_0x7034('0x35')]=_[_0x7034('0x39')](_0x518de0[_0x7034('0x35')],{'$or':_['map'](_0xec9b7d,function(_0x13f13c){if(_0x13f13c['type']!==_0x7034('0x3a')){var _0x7d19f5={};_0x7d19f5[_0x13f13c[_0x7034('0x24')]]={'$like':'%'+_0x50a99f['query']['filter']+'%'};return _0x7d19f5;}})});}_0x518de0=_[_0x7034('0x39')]({},_0x518de0,_0x50a99f[_0x7034('0x3b')]);var _0x5e043e={'where':_0x518de0[_0x7034('0x35')]};return db[_0x7034('0x27')]['count'](_0x5e043e)[_0x7034('0x1f')](function(_0x517573){_0x22c48d['count']=_0x517573;if(_0x50a99f[_0x7034('0x2c')]['includeAll']){_0x518de0[_0x7034('0x3c')]=[{'all':!![]}];}return db['CmContactHasItem'][_0x7034('0x3d')](_0x518de0);})['then'](function(_0x192c9b){_0x22c48d['rows']=_0x192c9b;return _0x22c48d;})[_0x7034('0x1f')](respondWithFilteredResult(_0x423158,_0x518de0))[_0x7034('0x3e')](handleError(_0x423158,null));};exports[_0x7034('0x3f')]=function(_0x5ab693,_0x550f2f){var _0x35c74c={'raw':!![],'where':{'id':_0x5ab693['params']['id']}},_0x55cd0f={};_0x55cd0f['model']=_[_0x7034('0x2d')](db['CmContactHasItem'][_0x7034('0x28')]);_0x55cd0f['query']=_[_0x7034('0x2d')](_0x5ab693[_0x7034('0x2c')]);_0x55cd0f['filters']=_[_0x7034('0x2e')](_0x55cd0f[_0x7034('0x2b')],_0x55cd0f[_0x7034('0x2c')]);_0x35c74c[_0x7034('0x2f')]=_[_0x7034('0x2e')](_0x55cd0f[_0x7034('0x2b')],qs['fields'](_0x5ab693['query'][_0x7034('0x30')]));_0x35c74c[_0x7034('0x2f')]=_0x35c74c['attributes']['length']?_0x35c74c[_0x7034('0x2f')]:_0x55cd0f[_0x7034('0x2b')];if(_0x5ab693[_0x7034('0x2c')][_0x7034('0x40')]){_0x35c74c['include']=[{'all':!![]}];}_0x35c74c=_[_0x7034('0x39')]({},_0x35c74c,_0x5ab693[_0x7034('0x3b')]);return db[_0x7034('0x27')][_0x7034('0x41')](_0x35c74c)[_0x7034('0x1f')](handleEntityNotFound(_0x550f2f,null))[_0x7034('0x1f')](respondWithResult(_0x550f2f,null))[_0x7034('0x3e')](handleError(_0x550f2f,null));};exports[_0x7034('0x42')]=function(_0x1914fd,_0x5869b5){return db[_0x7034('0x27')]['create'](_0x1914fd[_0x7034('0x43')],{})['then'](function(_0x1e0d8c){var _0x44960d=_0x1914fd[_0x7034('0x44')][_0x7034('0x21')]({'plain':!![]});if(!_0x44960d)throw new Error(_0x7034('0x45'));if(_0x44960d['role']===_0x7034('0x44')){var _0x342b8a=_0x1e0d8c['get']({'plain':!![]});var _0x3c0fb5='CmContactHasItems';return db[_0x7034('0x46')][_0x7034('0x41')]({'where':{'name':_0x3c0fb5,'userProfileId':_0x44960d[_0x7034('0x47')]},'raw':!![]})[_0x7034('0x1f')](function(_0x47f176){if(_0x47f176&&_0x47f176['autoAssociation']===0x0){return db[_0x7034('0x48')]['create']({'name':_0x342b8a[_0x7034('0x24')],'resourceId':_0x342b8a['id'],'type':_0x47f176[_0x7034('0x24')],'sectionId':_0x47f176['id']},{})[_0x7034('0x1f')](function(){return _0x1e0d8c;});}else{return _0x1e0d8c;}})[_0x7034('0x3e')](function(_0xf5bb08){logger[_0x7034('0x49')](_0x7034('0x4a'),_0xf5bb08);throw _0xf5bb08;});}return _0x1e0d8c;})[_0x7034('0x1f')](respondWithResult(_0x5869b5,0xc9))['catch'](handleError(_0x5869b5,null));};exports[_0x7034('0x1e')]=function(_0x1eb8bf,_0x20b075){if(_0x1eb8bf['body']['id']){delete _0x1eb8bf[_0x7034('0x43')]['id'];}return db['CmContactHasItem'][_0x7034('0x41')]({'where':{'id':_0x1eb8bf['params']['id']}})['then'](handleEntityNotFound(_0x20b075,null))[_0x7034('0x1f')](saveUpdates(_0x1eb8bf[_0x7034('0x43')],null))['then'](respondWithResult(_0x20b075,null))['catch'](handleError(_0x20b075,null));};exports[_0x7034('0x20')]=function(_0x40af88,_0x242c44){return db['CmContactHasItem'][_0x7034('0x41')]({'where':{'id':_0x40af88[_0x7034('0x4b')]['id']}})['then'](handleEntityNotFound(_0x242c44,null))['then'](removeEntity(_0x242c44,null))['catch'](handleError(_0x242c44,null));};
\ No newline at end of file
diff --git a/server/api/cmContactHasItem/cmContactHasItem.model.js b/server/api/cmContactHasItem/cmContactHasItem.model.js
index 9951e35..6157115 100644
--- a/server/api/cmContactHasItem/cmContactHasItem.model.js
+++ b/server/api/cmContactHasItem/cmContactHasItem.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xb4c7=['../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./cmContactHasItem.attributes','define','cm_contact_has_items','lodash','util'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0xb4c7,0x1ea));var _0x7b4c=function(_0x78ef4d,_0x1768aa){_0x78ef4d=_0x78ef4d-0x0;var _0x3817c4=_0xb4c7[_0x78ef4d];return _0x3817c4;};'use strict';var _=require(_0x7b4c('0x0'));var util=require(_0x7b4c('0x1'));var logger=require(_0x7b4c('0x2'))(_0x7b4c('0x3'));var moment=require(_0x7b4c('0x4'));var BPromise=require('bluebird');var rp=require(_0x7b4c('0x5'));var fs=require('fs');var path=require(_0x7b4c('0x6'));var rimraf=require(_0x7b4c('0x7'));var config=require(_0x7b4c('0x8'));var attributes=require(_0x7b4c('0x9'));module['exports']=function(_0x1b0f57,_0x10e197){return _0x1b0f57[_0x7b4c('0xa')]('CmContactHasItem',attributes,{'tableName':_0x7b4c('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xa630=['define','CmContactHasItem','cm_contact_has_items','lodash','util','moment','request-promise','rimraf','../../config/environment','./cmContactHasItem.attributes','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa630,0xbe));var _0x0a63=function(_0x343d43,_0x42a0bb){_0x343d43=_0x343d43-0x0;var _0x228c00=_0xa630[_0x343d43];return _0x228c00;};'use strict';var _=require(_0x0a63('0x0'));var util=require(_0x0a63('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x0a63('0x2'));var BPromise=require('bluebird');var rp=require(_0x0a63('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0a63('0x4'));var config=require(_0x0a63('0x5'));var attributes=require(_0x0a63('0x6'));module[_0x0a63('0x7')]=function(_0x37b4c9,_0x4b7474){return _0x37b4c9[_0x0a63('0x8')](_0x0a63('0x9'),attributes,{'tableName':_0x0a63('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/cmContactHasItem/cmContactHasItem.rpc.js b/server/api/cmContactHasItem/cmContactHasItem.rpc.js
index 9951b53..68d26d7 100644
--- a/server/api/cmContactHasItem/cmContactHasItem.rpc.js
+++ b/server/api/cmContactHasItem/cmContactHasItem.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xe8a1=['rpc','../../config/environment','client','http','then','info','CmContactHasItem,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x10b7e4,_0x584183){var _0x54e873=function(_0x32a0b6){while(--_0x32a0b6){_0x10b7e4['push'](_0x10b7e4['shift']());}};_0x54e873(++_0x584183);}(_0xe8a1,0x1f2));var _0x1e8a=function(_0x932345,_0x2c91a1){_0x932345=_0x932345-0x0;var _0x5e43ec=_0xe8a1[_0x932345];return _0x5e43ec;};'use strict';var _=require(_0x1e8a('0x0'));var util=require('util');var moment=require(_0x1e8a('0x1'));var BPromise=require(_0x1e8a('0x2'));var rs=require(_0x1e8a('0x3'));var fs=require('fs');var Redis=require(_0x1e8a('0x4'));var db=require(_0x1e8a('0x5'))['db'];var utils=require(_0x1e8a('0x6'));var logger=require(_0x1e8a('0x7'))(_0x1e8a('0x8'));var config=require(_0x1e8a('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x1e8a('0xa')][_0x1e8a('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x53a19a,_0x135366,_0x3988b6){return new BPromise(function(_0x34831f,_0x5f90fe){return client['request'](_0x53a19a,_0x3988b6)[_0x1e8a('0xc')](function(_0x6858c0){logger[_0x1e8a('0xd')](_0x1e8a('0xe'),_0x135366,'request\x20sent');logger[_0x1e8a('0xf')]('CmContactHasItem,\x20%s,\x20%s,\x20%s',_0x135366,'request\x20sent',JSON[_0x1e8a('0x10')](_0x6858c0));if(_0x6858c0[_0x1e8a('0x11')]){if(_0x6858c0[_0x1e8a('0x11')][_0x1e8a('0x12')]===0x1f4){logger[_0x1e8a('0x11')](_0x1e8a('0xe'),_0x135366,_0x6858c0['error']['message']);return _0x5f90fe(_0x6858c0[_0x1e8a('0x11')][_0x1e8a('0x13')]);}logger[_0x1e8a('0x11')](_0x1e8a('0xe'),_0x135366,_0x6858c0[_0x1e8a('0x11')][_0x1e8a('0x13')]);return _0x34831f(_0x6858c0['error'][_0x1e8a('0x13')]);}else{logger[_0x1e8a('0xd')](_0x1e8a('0xe'),_0x135366,_0x1e8a('0x14'));_0x34831f(_0x6858c0[_0x1e8a('0x15')][_0x1e8a('0x13')]);}})[_0x1e8a('0x16')](function(_0x1d8ac3){logger[_0x1e8a('0x11')](_0x1e8a('0xe'),_0x135366,_0x1d8ac3);_0x5f90fe(_0x1d8ac3);});});}
\ No newline at end of file
+var _0xf6c6=['stringify','error','code','CmContactHasItem,\x20%s,\x20%s','message','result','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','info','debug','request\x20sent'];(function(_0x11005e,_0x20c3d2){var _0x29338f=function(_0x3384e9){while(--_0x3384e9){_0x11005e['push'](_0x11005e['shift']());}};_0x29338f(++_0x20c3d2);}(_0xf6c6,0xed));var _0x6f6c=function(_0xb24a3e,_0x4a3594){_0xb24a3e=_0xb24a3e-0x0;var _0x4038d7=_0xf6c6[_0xb24a3e];return _0x4038d7;};'use strict';var _=require(_0x6f6c('0x0'));var util=require(_0x6f6c('0x1'));var moment=require(_0x6f6c('0x2'));var BPromise=require(_0x6f6c('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6f6c('0x4'));var db=require(_0x6f6c('0x5'))['db'];var utils=require(_0x6f6c('0x6'));var logger=require(_0x6f6c('0x7'))('rpc');var config=require(_0x6f6c('0x8'));var jayson=require(_0x6f6c('0x9'));var client=jayson[_0x6f6c('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x158508,_0x10d84e,_0x4bb100){return new BPromise(function(_0x53f5c4,_0x4e57d1){return client[_0x6f6c('0xb')](_0x158508,_0x4bb100)['then'](function(_0x16c39d){logger[_0x6f6c('0xc')]('CmContactHasItem,\x20%s,\x20%s',_0x10d84e,'request\x20sent');logger[_0x6f6c('0xd')]('CmContactHasItem,\x20%s,\x20%s,\x20%s',_0x10d84e,_0x6f6c('0xe'),JSON[_0x6f6c('0xf')](_0x16c39d));if(_0x16c39d[_0x6f6c('0x10')]){if(_0x16c39d[_0x6f6c('0x10')][_0x6f6c('0x11')]===0x1f4){logger[_0x6f6c('0x10')](_0x6f6c('0x12'),_0x10d84e,_0x16c39d[_0x6f6c('0x10')]['message']);return _0x4e57d1(_0x16c39d['error'][_0x6f6c('0x13')]);}logger['error']('CmContactHasItem,\x20%s,\x20%s',_0x10d84e,_0x16c39d[_0x6f6c('0x10')][_0x6f6c('0x13')]);return _0x53f5c4(_0x16c39d[_0x6f6c('0x10')][_0x6f6c('0x13')]);}else{logger[_0x6f6c('0xc')](_0x6f6c('0x12'),_0x10d84e,_0x6f6c('0xe'));_0x53f5c4(_0x16c39d[_0x6f6c('0x14')][_0x6f6c('0x13')]);}})['catch'](function(_0xe76fe9){logger[_0x6f6c('0x10')](_0x6f6c('0x12'),_0x10d84e,_0xe76fe9);_0x4e57d1(_0xe76fe9);});});}
\ No newline at end of file
diff --git a/server/api/cmContactHasItem/index.js b/server/api/cmContactHasItem/index.js
index ff8704f..472282f 100644
--- a/server/api/cmContactHasItem/index.js
+++ b/server/api/cmContactHasItem/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x67a7=['isAuthenticated','index','show','post','put','/:id','update','delete','destroy','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./cmContactHasItem.controller','get'];(function(_0x54026d,_0x215e17){var _0x2226de=function(_0x32935){while(--_0x32935){_0x54026d['push'](_0x54026d['shift']());}};_0x2226de(++_0x215e17);}(_0x67a7,0x14d));var _0x767a=function(_0x619e53,_0x3cdbd2){_0x619e53=_0x619e53-0x0;var _0x24c385=_0x67a7[_0x619e53];return _0x24c385;};'use strict';var multer=require('multer');var util=require(_0x767a('0x0'));var path=require(_0x767a('0x1'));var timeout=require(_0x767a('0x2'));var express=require(_0x767a('0x3'));var router=express[_0x767a('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x767a('0x5'));var config=require(_0x767a('0x6'));var controller=require(_0x767a('0x7'));router[_0x767a('0x8')]('/',auth[_0x767a('0x9')](),controller[_0x767a('0xa')]);router[_0x767a('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x767a('0xb')]);router[_0x767a('0xc')]('/',auth[_0x767a('0x9')](),controller['create']);router[_0x767a('0xd')](_0x767a('0xe'),auth[_0x767a('0x9')](),controller[_0x767a('0xf')]);router[_0x767a('0x10')](_0x767a('0xe'),auth[_0x767a('0x9')](),controller[_0x767a('0x11')]);module['exports']=router;
\ No newline at end of file
+var _0x44c1=['isAuthenticated','show','put','/:id','update','delete','destroy','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./cmContactHasItem.controller','get'];(function(_0xf9c3cf,_0x23b4cd){var _0x4879eb=function(_0x459648){while(--_0x459648){_0xf9c3cf['push'](_0xf9c3cf['shift']());}};_0x4879eb(++_0x23b4cd);}(_0x44c1,0x18f));var _0x144c=function(_0x2d8434,_0x43d781){_0x2d8434=_0x2d8434-0x0;var _0x26b9e4=_0x44c1[_0x2d8434];return _0x26b9e4;};'use strict';var multer=require('multer');var util=require(_0x144c('0x0'));var path=require(_0x144c('0x1'));var timeout=require(_0x144c('0x2'));var express=require(_0x144c('0x3'));var router=express[_0x144c('0x4')]();var auth=require(_0x144c('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x144c('0x6'));var controller=require(_0x144c('0x7'));router[_0x144c('0x8')]('/',auth[_0x144c('0x9')](),controller['index']);router['get']('/:id',auth['isAuthenticated'](),controller[_0x144c('0xa')]);router['post']('/',auth[_0x144c('0x9')](),controller['create']);router[_0x144c('0xb')](_0x144c('0xc'),auth[_0x144c('0x9')](),controller[_0x144c('0xd')]);router[_0x144c('0xe')](_0x144c('0xc'),auth[_0x144c('0x9')](),controller[_0x144c('0xf')]);module[_0x144c('0x10')]=router;
\ No newline at end of file
diff --git a/server/api/cmContactHasPhone/cmContactHasPhone.attributes.js b/server/api/cmContactHasPhone/cmContactHasPhone.attributes.js
index 1be7134..16e21b9 100644
--- a/server/api/cmContactHasPhone/cmContactHasPhone.attributes.js
+++ b/server/api/cmContactHasPhone/cmContactHasPhone.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xbf73=['INTEGER','STRING','sequelize','exports'];(function(_0x25c2ad,_0xd5ca5){var _0x555eec=function(_0x46c77f){while(--_0x46c77f){_0x25c2ad['push'](_0x25c2ad['shift']());}};_0x555eec(++_0xd5ca5);}(_0xbf73,0x186));var _0x3bf7=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xbf73[_0x2641f9];return _0x585741;};'use strict';var Sequelize=require(_0x3bf7('0x0'));module[_0x3bf7('0x1')]={'CmContactId':{'type':Sequelize[_0x3bf7('0x2')],'primaryKey':!![]},'phone':{'type':Sequelize[_0x3bf7('0x3')],'defaultValue':'','primaryKey':!![]}};
\ No newline at end of file
+var _0xdb0a=['sequelize','exports','STRING'];(function(_0x1c45fe,_0xce1fac){var _0x395449=function(_0x1e7b92){while(--_0x1e7b92){_0x1c45fe['push'](_0x1c45fe['shift']());}};_0x395449(++_0xce1fac);}(_0xdb0a,0x1c5));var _0xadb0=function(_0x513aca,_0x42ec3b){_0x513aca=_0x513aca-0x0;var _0xa6994=_0xdb0a[_0x513aca];return _0xa6994;};'use strict';var Sequelize=require(_0xadb0('0x0'));module[_0xadb0('0x1')]={'CmContactId':{'type':Sequelize['INTEGER'],'primaryKey':!![]},'phone':{'type':Sequelize[_0xadb0('0x2')],'defaultValue':'','primaryKey':!![]}};
\ No newline at end of file
diff --git a/server/api/cmContactHasPhone/cmContactHasPhone.controller.js b/server/api/cmContactHasPhone/cmContactHasPhone.controller.js
index 69e3e73..1767da8 100644
--- a/server/api/cmContactHasPhone/cmContactHasPhone.controller.js
+++ b/server/api/cmContactHasPhone/cmContactHasPhone.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x4b01=['attributes','length','hasOwnProperty','nolimit','sort','pick','filter','where','merge','map','options','CmContactHasPhone','includeAll','findAll','catch','fields','include','find','create','user','role','CmContactHasPhones','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','destroy','html-pdf','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','save','update','then','get','UserProfileResource','error','stack','name','send','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection'];(function(_0x33c01e,_0x2d2908){var _0x278b47=function(_0xa2e238){while(--_0xa2e238){_0x33c01e['push'](_0x33c01e['shift']());}};_0x278b47(++_0x2d2908);}(_0x4b01,0x6b));var _0x14b0=function(_0x3a35e7,_0x31f899){_0x3a35e7=_0x3a35e7-0x0;var _0x34f4b2=_0x4b01[_0x3a35e7];return _0x34f4b2;};'use strict';var pdf=require(_0x14b0('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x14b0('0x1'));var rp=require('request-promise');var moment=require(_0x14b0('0x2'));var BPromise=require(_0x14b0('0x3'));var Mustache=require(_0x14b0('0x4'));var util=require(_0x14b0('0x5'));var path=require(_0x14b0('0x6'));var sox=require(_0x14b0('0x7'));var csv=require(_0x14b0('0x8'));var ejs=require(_0x14b0('0x9'));var fs=require('fs');var _=require('lodash');var squel=require(_0x14b0('0xa'));var crypto=require(_0x14b0('0xb'));var jsforce=require(_0x14b0('0xc'));var deskjs=require(_0x14b0('0xd'));var toCsv=require(_0x14b0('0x8'));var querystring=require(_0x14b0('0xe'));var Papa=require(_0x14b0('0xf'));var Redis=require(_0x14b0('0x10'));var authService=require(_0x14b0('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x14b0('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x14b0('0x13'))(_0x14b0('0x14'));var utils=require(_0x14b0('0x15'));var config=require(_0x14b0('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x132ba4,_0x4aef09){_0x4aef09=_0x4aef09||0xcc;return function(_0x1d3cd5){if(_0x1d3cd5){return _0x132ba4[_0x14b0('0x17')](_0x4aef09);}return _0x132ba4[_0x14b0('0x18')](_0x4aef09)[_0x14b0('0x19')]();};}function respondWithResult(_0x4a0b95,_0xc27c08){_0xc27c08=_0xc27c08||0xc8;return function(_0x26f7fc){if(_0x26f7fc){return _0x4a0b95[_0x14b0('0x18')](_0xc27c08)[_0x14b0('0x1a')](_0x26f7fc);}};}function respondWithFilteredResult(_0x177668,_0x4d6612){return function(_0x10d0ec){if(_0x10d0ec){var _0x42399b=_0x10d0ec[_0x14b0('0x1b')],_0x2e17be=_0x4d6612[_0x14b0('0x1c')],_0x5f444f=_0x4d6612[_0x14b0('0x1c')]+_0x4d6612[_0x14b0('0x1d')],_0x24ad28;if(_0x5f444f>=_0x42399b){_0x5f444f=_0x42399b;_0x24ad28=0xc8;}else{_0x24ad28=0xce;}_0x177668[_0x14b0('0x18')](_0x24ad28);return _0x177668[_0x14b0('0x1e')](_0x14b0('0x1f'),_0x2e17be+'-'+_0x5f444f+'/'+_0x42399b)[_0x14b0('0x1a')](_0x10d0ec);}return null;};}function patchUpdates(_0x2d189d){return function(_0x38eda7){try{jsonpatch[_0x14b0('0x20')](_0x38eda7,_0x2d189d,!![]);}catch(_0x5b3561){return BPromise['reject'](_0x5b3561);}return _0x38eda7[_0x14b0('0x21')]();};}function saveUpdates(_0x37fe52,_0x68f682){return function(_0x303559){if(_0x303559){return _0x303559[_0x14b0('0x22')](_0x37fe52)[_0x14b0('0x23')](function(_0x5690ba){return _0x5690ba;});}return null;};}function removeEntity(_0x20cbca,_0x1b0e80){return function(_0x22f4d2){if(_0x22f4d2){return _0x22f4d2['destroy']()['then'](function(){var _0x4d47d0=_0x22f4d2[_0x14b0('0x24')]({'plain':!![]});var _0x4945e2='CmContactHasPhones';return db[_0x14b0('0x25')]['destroy']({'where':{'type':_0x4945e2,'resourceId':_0x4d47d0['id']}})[_0x14b0('0x23')](function(){return _0x22f4d2;});})[_0x14b0('0x23')](function(){_0x20cbca[_0x14b0('0x18')](0xcc)[_0x14b0('0x19')]();});}};}function handleEntityNotFound(_0x106274,_0x4f528a){return function(_0x5e7b94){if(!_0x5e7b94){_0x106274[_0x14b0('0x17')](0x194);}return _0x5e7b94;};}function handleError(_0x2df426,_0x3db9e8){_0x3db9e8=_0x3db9e8||0x1f4;return function(_0x29f4a1){logger[_0x14b0('0x26')](_0x29f4a1[_0x14b0('0x27')]);if(_0x29f4a1[_0x14b0('0x28')]){delete _0x29f4a1[_0x14b0('0x28')];}_0x2df426[_0x14b0('0x18')](_0x3db9e8)[_0x14b0('0x29')](_0x29f4a1);};}exports['index']=function(_0x1cded6,_0x851319){var _0x1b4f32={},_0x5af490={},_0x401d7a={'count':0x0,'rows':[]};var _0x28383a=_['map'](db['CmContactHasPhone'][_0x14b0('0x2a')],function(_0x51fd4d){return{'name':_0x51fd4d[_0x14b0('0x2b')],'type':_0x51fd4d[_0x14b0('0x2c')][_0x14b0('0x2d')]};});_0x5af490[_0x14b0('0x2e')]=_['map'](_0x28383a,'name');_0x5af490[_0x14b0('0x2f')]=_[_0x14b0('0x30')](_0x1cded6['query']);_0x5af490[_0x14b0('0x31')]=_[_0x14b0('0x32')](_0x5af490['model'],_0x5af490[_0x14b0('0x2f')]);_0x1b4f32[_0x14b0('0x33')]=_[_0x14b0('0x32')](_0x5af490['model'],qs['fields'](_0x1cded6['query']['fields']));_0x1b4f32[_0x14b0('0x33')]=_0x1b4f32[_0x14b0('0x33')][_0x14b0('0x34')]?_0x1b4f32[_0x14b0('0x33')]:_0x5af490[_0x14b0('0x2e')];if(!_0x1cded6[_0x14b0('0x2f')][_0x14b0('0x35')](_0x14b0('0x36'))){_0x1b4f32['limit']=qs['limit'](_0x1cded6[_0x14b0('0x2f')][_0x14b0('0x1d')]);_0x1b4f32[_0x14b0('0x1c')]=qs['offset'](_0x1cded6[_0x14b0('0x2f')][_0x14b0('0x1c')]);}_0x1b4f32['order']=qs[_0x14b0('0x37')](_0x1cded6[_0x14b0('0x2f')][_0x14b0('0x37')]);_0x1b4f32['where']=qs['filters'](_[_0x14b0('0x38')](_0x1cded6[_0x14b0('0x2f')],_0x5af490[_0x14b0('0x31')]),_0x28383a);if(_0x1cded6[_0x14b0('0x2f')][_0x14b0('0x39')]){_0x1b4f32[_0x14b0('0x3a')]=_[_0x14b0('0x3b')](_0x1b4f32[_0x14b0('0x3a')],{'$or':_[_0x14b0('0x3c')](_0x28383a,function(_0x2bb417){if(_0x2bb417[_0x14b0('0x2c')]!=='VIRTUAL'){var _0x154153={};_0x154153[_0x2bb417['name']]={'$like':'%'+_0x1cded6[_0x14b0('0x2f')][_0x14b0('0x39')]+'%'};return _0x154153;}})});}_0x1b4f32=_[_0x14b0('0x3b')]({},_0x1b4f32,_0x1cded6[_0x14b0('0x3d')]);var _0x4d1786={'where':_0x1b4f32['where']};return db[_0x14b0('0x3e')][_0x14b0('0x1b')](_0x4d1786)[_0x14b0('0x23')](function(_0x10b778){_0x401d7a[_0x14b0('0x1b')]=_0x10b778;if(_0x1cded6[_0x14b0('0x2f')][_0x14b0('0x3f')]){_0x1b4f32['include']=[{'all':!![]}];}return db[_0x14b0('0x3e')][_0x14b0('0x40')](_0x1b4f32);})[_0x14b0('0x23')](function(_0x5410c8){_0x401d7a['rows']=_0x5410c8;return _0x401d7a;})[_0x14b0('0x23')](respondWithFilteredResult(_0x851319,_0x1b4f32))[_0x14b0('0x41')](handleError(_0x851319,null));};exports['show']=function(_0x3f71f0,_0x4c4d5b){var _0xc0890={'raw':!![],'where':{'id':_0x3f71f0['params']['id']}},_0x114ec2={};_0x114ec2[_0x14b0('0x2e')]=_[_0x14b0('0x30')](db[_0x14b0('0x3e')]['rawAttributes']);_0x114ec2[_0x14b0('0x2f')]=_[_0x14b0('0x30')](_0x3f71f0[_0x14b0('0x2f')]);_0x114ec2[_0x14b0('0x31')]=_[_0x14b0('0x32')](_0x114ec2['model'],_0x114ec2[_0x14b0('0x2f')]);_0xc0890[_0x14b0('0x33')]=_[_0x14b0('0x32')](_0x114ec2['model'],qs[_0x14b0('0x42')](_0x3f71f0[_0x14b0('0x2f')][_0x14b0('0x42')]));_0xc0890[_0x14b0('0x33')]=_0xc0890[_0x14b0('0x33')][_0x14b0('0x34')]?_0xc0890[_0x14b0('0x33')]:_0x114ec2['model'];if(_0x3f71f0['query'][_0x14b0('0x3f')]){_0xc0890[_0x14b0('0x43')]=[{'all':!![]}];}_0xc0890=_['merge']({},_0xc0890,_0x3f71f0[_0x14b0('0x3d')]);return db['CmContactHasPhone'][_0x14b0('0x44')](_0xc0890)['then'](handleEntityNotFound(_0x4c4d5b,null))['then'](respondWithResult(_0x4c4d5b,null))[_0x14b0('0x41')](handleError(_0x4c4d5b,null));};exports[_0x14b0('0x45')]=function(_0x17b75e,_0x4663a2){return db[_0x14b0('0x3e')][_0x14b0('0x45')](_0x17b75e['body'],{})[_0x14b0('0x23')](function(_0x263df4){var _0x3f5d5a=_0x17b75e[_0x14b0('0x46')][_0x14b0('0x24')]({'plain':!![]});if(!_0x3f5d5a)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3f5d5a[_0x14b0('0x47')]===_0x14b0('0x46')){var _0xcfe440=_0x263df4[_0x14b0('0x24')]({'plain':!![]});var _0x1b73aa=_0x14b0('0x48');return db['UserProfileSection'][_0x14b0('0x44')]({'where':{'name':_0x1b73aa,'userProfileId':_0x3f5d5a[_0x14b0('0x49')]},'raw':!![]})[_0x14b0('0x23')](function(_0x34bfb4){if(_0x34bfb4&&_0x34bfb4[_0x14b0('0x4a')]===0x0){return db['UserProfileResource'][_0x14b0('0x45')]({'name':_0xcfe440[_0x14b0('0x28')],'resourceId':_0xcfe440['id'],'type':_0x34bfb4[_0x14b0('0x28')],'sectionId':_0x34bfb4['id']},{})[_0x14b0('0x23')](function(){return _0x263df4;});}else{return _0x263df4;}})[_0x14b0('0x41')](function(_0x555db1){logger[_0x14b0('0x26')](_0x14b0('0x4b'),_0x555db1);throw _0x555db1;});}return _0x263df4;})[_0x14b0('0x23')](respondWithResult(_0x4663a2,0xc9))['catch'](handleError(_0x4663a2,null));};exports['update']=function(_0x19b0e4,_0xed227e){if(_0x19b0e4[_0x14b0('0x4c')]['id']){delete _0x19b0e4[_0x14b0('0x4c')]['id'];}return db[_0x14b0('0x3e')][_0x14b0('0x44')]({'where':{'id':_0x19b0e4[_0x14b0('0x4d')]['id']}})[_0x14b0('0x23')](handleEntityNotFound(_0xed227e,null))['then'](saveUpdates(_0x19b0e4[_0x14b0('0x4c')],null))[_0x14b0('0x23')](respondWithResult(_0xed227e,null))[_0x14b0('0x41')](handleError(_0xed227e,null));};exports[_0x14b0('0x4e')]=function(_0x1604d7,_0xcf12b){return db[_0x14b0('0x3e')][_0x14b0('0x44')]({'where':{'id':_0x1604d7[_0x14b0('0x4d')]['id']}})[_0x14b0('0x23')](handleEntityNotFound(_0xcf12b,null))[_0x14b0('0x23')](removeEntity(_0xcf12b,null))['catch'](handleError(_0xcf12b,null));};
\ No newline at end of file
+var _0x2ab5=['destroy','CmContactHasPhones','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','intersection','fields','attributes','length','hasOwnProperty','limit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','CmContactHasPhone','includeAll','include','findAll','rows','catch','show','params','keys','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','lodash','squel','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../mysqldb','status','end','json','count','offset','apply','reject','save','update','then'];(function(_0x5cb366,_0x2a3d54){var _0x4358cd=function(_0x1b1856){while(--_0x1b1856){_0x5cb366['push'](_0x5cb366['shift']());}};_0x4358cd(++_0x2a3d54);}(_0x2ab5,0x11e));var _0x52ab=function(_0xe083f3,_0x1282ac){_0xe083f3=_0xe083f3-0x0;var _0x1be0a7=_0x2ab5[_0xe083f3];return _0x1be0a7;};'use strict';var pdf=require(_0x52ab('0x0'));var emlformat=require(_0x52ab('0x1'));var rimraf=require(_0x52ab('0x2'));var zipdir=require(_0x52ab('0x3'));var jsonpatch=require(_0x52ab('0x4'));var rp=require(_0x52ab('0x5'));var moment=require(_0x52ab('0x6'));var BPromise=require(_0x52ab('0x7'));var Mustache=require(_0x52ab('0x8'));var util=require(_0x52ab('0x9'));var path=require(_0x52ab('0xa'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x52ab('0xb'));var squel=require(_0x52ab('0xc'));var crypto=require('crypto');var jsforce=require(_0x52ab('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x52ab('0xe'));var querystring=require(_0x52ab('0xf'));var Papa=require(_0x52ab('0x10'));var Redis=require(_0x52ab('0x11'));var authService=require(_0x52ab('0x12'));var qs=require(_0x52ab('0x13'));var as=require(_0x52ab('0x14'));var hardwareService=require(_0x52ab('0x15'));var logger=require('../../config/logger')(_0x52ab('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x52ab('0x17'))['db'];function respondWithStatusCode(_0x1a4d3c,_0x246ccb){_0x246ccb=_0x246ccb||0xcc;return function(_0x2c87f1){if(_0x2c87f1){return _0x1a4d3c['sendStatus'](_0x246ccb);}return _0x1a4d3c[_0x52ab('0x18')](_0x246ccb)[_0x52ab('0x19')]();};}function respondWithResult(_0x511b64,_0x1ed974){_0x1ed974=_0x1ed974||0xc8;return function(_0x48cc3c){if(_0x48cc3c){return _0x511b64[_0x52ab('0x18')](_0x1ed974)[_0x52ab('0x1a')](_0x48cc3c);}};}function respondWithFilteredResult(_0x49cfb8,_0xd4bcda){return function(_0xc1687){if(_0xc1687){var _0x35530a=_0xc1687[_0x52ab('0x1b')],_0x55323d=_0xd4bcda[_0x52ab('0x1c')],_0xab2ccb=_0xd4bcda[_0x52ab('0x1c')]+_0xd4bcda['limit'],_0x9dceab;if(_0xab2ccb>=_0x35530a){_0xab2ccb=_0x35530a;_0x9dceab=0xc8;}else{_0x9dceab=0xce;}_0x49cfb8['status'](_0x9dceab);return _0x49cfb8['set']('Content-Range',_0x55323d+'-'+_0xab2ccb+'/'+_0x35530a)[_0x52ab('0x1a')](_0xc1687);}return null;};}function patchUpdates(_0x197277){return function(_0x160743){try{jsonpatch[_0x52ab('0x1d')](_0x160743,_0x197277,!![]);}catch(_0x478d0a){return BPromise[_0x52ab('0x1e')](_0x478d0a);}return _0x160743[_0x52ab('0x1f')]();};}function saveUpdates(_0x2539e8,_0x49350e){return function(_0x244c77){if(_0x244c77){return _0x244c77[_0x52ab('0x20')](_0x2539e8)[_0x52ab('0x21')](function(_0x231cb4){return _0x231cb4;});}return null;};}function removeEntity(_0x24ea43,_0x5547e2){return function(_0xe46a17){if(_0xe46a17){return _0xe46a17[_0x52ab('0x22')]()[_0x52ab('0x21')](function(){var _0x31025b=_0xe46a17['get']({'plain':!![]});var _0x45d65a=_0x52ab('0x23');return db['UserProfileResource'][_0x52ab('0x22')]({'where':{'type':_0x45d65a,'resourceId':_0x31025b['id']}})['then'](function(){return _0xe46a17;});})['then'](function(){_0x24ea43[_0x52ab('0x18')](0xcc)[_0x52ab('0x19')]();});}};}function handleEntityNotFound(_0x9cce67,_0x5b01ec){return function(_0x5cc030){if(!_0x5cc030){_0x9cce67['sendStatus'](0x194);}return _0x5cc030;};}function handleError(_0x10f4d0,_0x2e5b4c){_0x2e5b4c=_0x2e5b4c||0x1f4;return function(_0x552460){logger[_0x52ab('0x24')](_0x552460[_0x52ab('0x25')]);if(_0x552460[_0x52ab('0x26')]){delete _0x552460['name'];}_0x10f4d0[_0x52ab('0x18')](_0x2e5b4c)[_0x52ab('0x27')](_0x552460);};}exports[_0x52ab('0x28')]=function(_0x54e271,_0x13285b){var _0x59e8b7={},_0x592cb9={},_0x3f2a2a={'count':0x0,'rows':[]};var _0x396324=_[_0x52ab('0x29')](db['CmContactHasPhone'][_0x52ab('0x2a')],function(_0x5c2c86){return{'name':_0x5c2c86[_0x52ab('0x2b')],'type':_0x5c2c86[_0x52ab('0x2c')][_0x52ab('0x2d')]};});_0x592cb9[_0x52ab('0x2e')]=_[_0x52ab('0x29')](_0x396324,_0x52ab('0x26'));_0x592cb9[_0x52ab('0x2f')]=_['keys'](_0x54e271[_0x52ab('0x2f')]);_0x592cb9['filters']=_[_0x52ab('0x30')](_0x592cb9[_0x52ab('0x2e')],_0x592cb9[_0x52ab('0x2f')]);_0x59e8b7['attributes']=_[_0x52ab('0x30')](_0x592cb9[_0x52ab('0x2e')],qs[_0x52ab('0x31')](_0x54e271[_0x52ab('0x2f')][_0x52ab('0x31')]));_0x59e8b7[_0x52ab('0x32')]=_0x59e8b7[_0x52ab('0x32')][_0x52ab('0x33')]?_0x59e8b7[_0x52ab('0x32')]:_0x592cb9[_0x52ab('0x2e')];if(!_0x54e271[_0x52ab('0x2f')][_0x52ab('0x34')]('nolimit')){_0x59e8b7[_0x52ab('0x35')]=qs[_0x52ab('0x35')](_0x54e271[_0x52ab('0x2f')][_0x52ab('0x35')]);_0x59e8b7[_0x52ab('0x1c')]=qs[_0x52ab('0x1c')](_0x54e271['query'][_0x52ab('0x1c')]);}_0x59e8b7[_0x52ab('0x36')]=qs[_0x52ab('0x37')](_0x54e271[_0x52ab('0x2f')][_0x52ab('0x37')]);_0x59e8b7[_0x52ab('0x38')]=qs[_0x52ab('0x39')](_[_0x52ab('0x3a')](_0x54e271[_0x52ab('0x2f')],_0x592cb9[_0x52ab('0x39')]),_0x396324);if(_0x54e271['query'][_0x52ab('0x3b')]){_0x59e8b7['where']=_[_0x52ab('0x3c')](_0x59e8b7[_0x52ab('0x38')],{'$or':_[_0x52ab('0x29')](_0x396324,function(_0x14f180){if(_0x14f180[_0x52ab('0x2c')]!==_0x52ab('0x3d')){var _0x1b199a={};_0x1b199a[_0x14f180[_0x52ab('0x26')]]={'$like':'%'+_0x54e271[_0x52ab('0x2f')][_0x52ab('0x3b')]+'%'};return _0x1b199a;}})});}_0x59e8b7=_['merge']({},_0x59e8b7,_0x54e271[_0x52ab('0x3e')]);var _0x5c4277={'where':_0x59e8b7['where']};return db[_0x52ab('0x3f')][_0x52ab('0x1b')](_0x5c4277)[_0x52ab('0x21')](function(_0x24782e){_0x3f2a2a[_0x52ab('0x1b')]=_0x24782e;if(_0x54e271['query'][_0x52ab('0x40')]){_0x59e8b7[_0x52ab('0x41')]=[{'all':!![]}];}return db[_0x52ab('0x3f')][_0x52ab('0x42')](_0x59e8b7);})[_0x52ab('0x21')](function(_0x49f14b){_0x3f2a2a[_0x52ab('0x43')]=_0x49f14b;return _0x3f2a2a;})[_0x52ab('0x21')](respondWithFilteredResult(_0x13285b,_0x59e8b7))[_0x52ab('0x44')](handleError(_0x13285b,null));};exports[_0x52ab('0x45')]=function(_0x564a98,_0x6ff5d6){var _0x42a55c={'raw':!![],'where':{'id':_0x564a98[_0x52ab('0x46')]['id']}},_0x1bc345={};_0x1bc345[_0x52ab('0x2e')]=_['keys'](db['CmContactHasPhone']['rawAttributes']);_0x1bc345[_0x52ab('0x2f')]=_[_0x52ab('0x47')](_0x564a98[_0x52ab('0x2f')]);_0x1bc345[_0x52ab('0x39')]=_[_0x52ab('0x30')](_0x1bc345['model'],_0x1bc345[_0x52ab('0x2f')]);_0x42a55c[_0x52ab('0x32')]=_[_0x52ab('0x30')](_0x1bc345[_0x52ab('0x2e')],qs[_0x52ab('0x31')](_0x564a98['query'][_0x52ab('0x31')]));_0x42a55c['attributes']=_0x42a55c['attributes'][_0x52ab('0x33')]?_0x42a55c['attributes']:_0x1bc345[_0x52ab('0x2e')];if(_0x564a98[_0x52ab('0x2f')][_0x52ab('0x40')]){_0x42a55c[_0x52ab('0x41')]=[{'all':!![]}];}_0x42a55c=_[_0x52ab('0x3c')]({},_0x42a55c,_0x564a98[_0x52ab('0x3e')]);return db[_0x52ab('0x3f')]['find'](_0x42a55c)[_0x52ab('0x21')](handleEntityNotFound(_0x6ff5d6,null))[_0x52ab('0x21')](respondWithResult(_0x6ff5d6,null))[_0x52ab('0x44')](handleError(_0x6ff5d6,null));};exports[_0x52ab('0x48')]=function(_0x191bce,_0x330b){return db[_0x52ab('0x3f')][_0x52ab('0x48')](_0x191bce[_0x52ab('0x49')],{})[_0x52ab('0x21')](function(_0x8353ab){var _0xef5133=_0x191bce[_0x52ab('0x4a')]['get']({'plain':!![]});if(!_0xef5133)throw new Error(_0x52ab('0x4b'));if(_0xef5133['role']===_0x52ab('0x4a')){var _0x5e5631=_0x8353ab['get']({'plain':!![]});var _0x23604d='CmContactHasPhones';return db[_0x52ab('0x4c')]['find']({'where':{'name':_0x23604d,'userProfileId':_0xef5133[_0x52ab('0x4d')]},'raw':!![]})[_0x52ab('0x21')](function(_0x3e294a){if(_0x3e294a&&_0x3e294a['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x5e5631[_0x52ab('0x26')],'resourceId':_0x5e5631['id'],'type':_0x3e294a[_0x52ab('0x26')],'sectionId':_0x3e294a['id']},{})[_0x52ab('0x21')](function(){return _0x8353ab;});}else{return _0x8353ab;}})['catch'](function(_0x432b62){logger[_0x52ab('0x24')](_0x52ab('0x4e'),_0x432b62);throw _0x432b62;});}return _0x8353ab;})[_0x52ab('0x21')](respondWithResult(_0x330b,0xc9))[_0x52ab('0x44')](handleError(_0x330b,null));};exports[_0x52ab('0x20')]=function(_0x23d4d5,_0x5b6446){if(_0x23d4d5[_0x52ab('0x49')]['id']){delete _0x23d4d5[_0x52ab('0x49')]['id'];}return db[_0x52ab('0x3f')][_0x52ab('0x4f')]({'where':{'id':_0x23d4d5[_0x52ab('0x46')]['id']}})[_0x52ab('0x21')](handleEntityNotFound(_0x5b6446,null))[_0x52ab('0x21')](saveUpdates(_0x23d4d5[_0x52ab('0x49')],null))['then'](respondWithResult(_0x5b6446,null))[_0x52ab('0x44')](handleError(_0x5b6446,null));};exports[_0x52ab('0x22')]=function(_0x3d1620,_0x86ea44){return db[_0x52ab('0x3f')][_0x52ab('0x4f')]({'where':{'id':_0x3d1620['params']['id']}})[_0x52ab('0x21')](handleEntityNotFound(_0x86ea44,null))[_0x52ab('0x21')](removeEntity(_0x86ea44,null))[_0x52ab('0x44')](handleError(_0x86ea44,null));};
\ No newline at end of file
diff --git a/server/api/cmContactHasPhone/cmContactHasPhone.model.js b/server/api/cmContactHasPhone/cmContactHasPhone.model.js
index da192c5..1e30c0f 100644
--- a/server/api/cmContactHasPhone/cmContactHasPhone.model.js
+++ b/server/api/cmContactHasPhone/cmContactHasPhone.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xf986=['request-promise','CmContactHasPhone','cm_contact_has_phones','lodash','util','../../config/logger','moment','bluebird'];(function(_0x1f865a,_0xf1cdb6){var _0x42c455=function(_0x32f853){while(--_0x32f853){_0x1f865a['push'](_0x1f865a['shift']());}};_0x42c455(++_0xf1cdb6);}(_0xf986,0x163));var _0x6f98=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xf986[_0x19e35c];return _0x3e1fe8;};'use strict';var _=require(_0x6f98('0x0'));var util=require(_0x6f98('0x1'));var logger=require(_0x6f98('0x2'))('api');var moment=require(_0x6f98('0x3'));var BPromise=require(_0x6f98('0x4'));var rp=require(_0x6f98('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./cmContactHasPhone.attributes');module['exports']=function(_0x256c18,_0x3a4934){return _0x256c18['define'](_0x6f98('0x6'),attributes,{'tableName':_0x6f98('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xad36=['rimraf','../../config/environment','exports','define','CmContactHasPhone','cm_contact_has_phones','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x4c6cf0,_0x826f70){var _0x108145=function(_0x299f69){while(--_0x299f69){_0x4c6cf0['push'](_0x4c6cf0['shift']());}};_0x108145(++_0x826f70);}(_0xad36,0x1c6));var _0x6ad3=function(_0xbe51b8,_0x23240a){_0xbe51b8=_0xbe51b8-0x0;var _0x51eea1=_0xad36[_0xbe51b8];return _0x51eea1;};'use strict';var _=require(_0x6ad3('0x0'));var util=require(_0x6ad3('0x1'));var logger=require(_0x6ad3('0x2'))(_0x6ad3('0x3'));var moment=require(_0x6ad3('0x4'));var BPromise=require(_0x6ad3('0x5'));var rp=require(_0x6ad3('0x6'));var fs=require('fs');var path=require(_0x6ad3('0x7'));var rimraf=require(_0x6ad3('0x8'));var config=require(_0x6ad3('0x9'));var attributes=require('./cmContactHasPhone.attributes');module[_0x6ad3('0xa')]=function(_0x52f6ee,_0x48c394){return _0x52f6ee[_0x6ad3('0xb')](_0x6ad3('0xc'),attributes,{'tableName':_0x6ad3('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/cmContactHasPhone/cmContactHasPhone.rpc.js b/server/api/cmContactHasPhone/cmContactHasPhone.rpc.js
index a6ee0a4..f915c23 100644
--- a/server/api/cmContactHasPhone/cmContactHasPhone.rpc.js
+++ b/server/api/cmContactHasPhone/cmContactHasPhone.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xbb65=['lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','info','CmContactHasPhone,\x20%s,\x20%s','debug','stringify','error','code','message','catch'];(function(_0x15c421,_0x6366f7){var _0x5e5ed5=function(_0x206e66){while(--_0x206e66){_0x15c421['push'](_0x15c421['shift']());}};_0x5e5ed5(++_0x6366f7);}(_0xbb65,0x118));var _0x5bb6=function(_0x1afd83,_0x284d4d){_0x1afd83=_0x1afd83-0x0;var _0x4a744f=_0xbb65[_0x1afd83];return _0x4a744f;};'use strict';var _=require(_0x5bb6('0x0'));var util=require('util');var moment=require(_0x5bb6('0x1'));var BPromise=require(_0x5bb6('0x2'));var rs=require(_0x5bb6('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5bb6('0x4'))['db'];var utils=require(_0x5bb6('0x5'));var logger=require(_0x5bb6('0x6'))(_0x5bb6('0x7'));var config=require(_0x5bb6('0x8'));var jayson=require(_0x5bb6('0x9'));var client=jayson[_0x5bb6('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x352fdf,_0x184b12,_0xc83357){return new BPromise(function(_0x306fb1,_0x30a2e1){return client['request'](_0x352fdf,_0xc83357)[_0x5bb6('0xb')](function(_0x4f6dd6){logger[_0x5bb6('0xc')](_0x5bb6('0xd'),_0x184b12,'request\x20sent');logger[_0x5bb6('0xe')]('CmContactHasPhone,\x20%s,\x20%s,\x20%s',_0x184b12,'request\x20sent',JSON[_0x5bb6('0xf')](_0x4f6dd6));if(_0x4f6dd6['error']){if(_0x4f6dd6[_0x5bb6('0x10')][_0x5bb6('0x11')]===0x1f4){logger[_0x5bb6('0x10')]('CmContactHasPhone,\x20%s,\x20%s',_0x184b12,_0x4f6dd6['error']['message']);return _0x30a2e1(_0x4f6dd6['error']['message']);}logger[_0x5bb6('0x10')](_0x5bb6('0xd'),_0x184b12,_0x4f6dd6[_0x5bb6('0x10')][_0x5bb6('0x12')]);return _0x306fb1(_0x4f6dd6['error'][_0x5bb6('0x12')]);}else{logger['info'](_0x5bb6('0xd'),_0x184b12,'request\x20sent');_0x306fb1(_0x4f6dd6['result'][_0x5bb6('0x12')]);}})[_0x5bb6('0x13')](function(_0x309064){logger[_0x5bb6('0x10')]('CmContactHasPhone,\x20%s,\x20%s',_0x184b12,_0x309064);_0x30a2e1(_0x309064);});});}
\ No newline at end of file
+var _0x8df7=['then','info','request\x20sent','debug','stringify','error','CmContactHasPhone,\x20%s,\x20%s','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','request'];(function(_0x42dcc7,_0x3d1cde){var _0x3ecf8f=function(_0x4a1a87){while(--_0x4a1a87){_0x42dcc7['push'](_0x42dcc7['shift']());}};_0x3ecf8f(++_0x3d1cde);}(_0x8df7,0xfb));var _0x78df=function(_0x460fff,_0x2fb381){_0x460fff=_0x460fff-0x0;var _0x561c8e=_0x8df7[_0x460fff];return _0x561c8e;};'use strict';var _=require(_0x78df('0x0'));var util=require(_0x78df('0x1'));var moment=require(_0x78df('0x2'));var BPromise=require(_0x78df('0x3'));var rs=require(_0x78df('0x4'));var fs=require('fs');var Redis=require(_0x78df('0x5'));var db=require(_0x78df('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x78df('0x7'))(_0x78df('0x8'));var config=require(_0x78df('0x9'));var jayson=require(_0x78df('0xa'));var client=jayson[_0x78df('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1734b3,_0x554ef9,_0x17de8d){return new BPromise(function(_0x33a881,_0x58ee38){return client[_0x78df('0xc')](_0x1734b3,_0x17de8d)[_0x78df('0xd')](function(_0xc9a961){logger[_0x78df('0xe')]('CmContactHasPhone,\x20%s,\x20%s',_0x554ef9,_0x78df('0xf'));logger[_0x78df('0x10')]('CmContactHasPhone,\x20%s,\x20%s,\x20%s',_0x554ef9,'request\x20sent',JSON[_0x78df('0x11')](_0xc9a961));if(_0xc9a961[_0x78df('0x12')]){if(_0xc9a961[_0x78df('0x12')]['code']===0x1f4){logger[_0x78df('0x12')](_0x78df('0x13'),_0x554ef9,_0xc9a961[_0x78df('0x12')][_0x78df('0x14')]);return _0x58ee38(_0xc9a961['error'][_0x78df('0x14')]);}logger[_0x78df('0x12')](_0x78df('0x13'),_0x554ef9,_0xc9a961[_0x78df('0x12')]['message']);return _0x33a881(_0xc9a961['error'][_0x78df('0x14')]);}else{logger[_0x78df('0xe')](_0x78df('0x13'),_0x554ef9,_0x78df('0xf'));_0x33a881(_0xc9a961[_0x78df('0x15')]['message']);}})['catch'](function(_0xa7c80f){logger[_0x78df('0x12')]('CmContactHasPhone,\x20%s,\x20%s',_0x554ef9,_0xa7c80f);_0x58ee38(_0xa7c80f);});});}
\ No newline at end of file
diff --git a/server/api/cmContactHasPhone/index.js b/server/api/cmContactHasPhone/index.js
index 1bee662..4d6f81c 100644
--- a/server/api/cmContactHasPhone/index.js
+++ b/server/api/cmContactHasPhone/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x19ac=['connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmContactHasPhone.controller','get','isAuthenticated','index','/:id','create','delete','exports','multer','util','path'];(function(_0x486f4a,_0x478dc7){var _0x135d99=function(_0x434008){while(--_0x434008){_0x486f4a['push'](_0x486f4a['shift']());}};_0x135d99(++_0x478dc7);}(_0x19ac,0x96));var _0xc19a=function(_0x1e4360,_0x930b9b){_0x1e4360=_0x1e4360-0x0;var _0x31e6b4=_0x19ac[_0x1e4360];return _0x31e6b4;};'use strict';var multer=require(_0xc19a('0x0'));var util=require(_0xc19a('0x1'));var path=require(_0xc19a('0x2'));var timeout=require(_0xc19a('0x3'));var express=require(_0xc19a('0x4'));var router=express[_0xc19a('0x5')]();var auth=require(_0xc19a('0x6'));var interaction=require(_0xc19a('0x7'));var config=require(_0xc19a('0x8'));var controller=require(_0xc19a('0x9'));router[_0xc19a('0xa')]('/',auth[_0xc19a('0xb')](),controller[_0xc19a('0xc')]);router[_0xc19a('0xa')](_0xc19a('0xd'),auth[_0xc19a('0xb')](),controller['show']);router['post']('/',auth[_0xc19a('0xb')](),controller[_0xc19a('0xe')]);router['put'](_0xc19a('0xd'),auth[_0xc19a('0xb')](),controller['update']);router[_0xc19a('0xf')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0xc19a('0x10')]=router;
\ No newline at end of file
+var _0x8fb9=['express','Router','../../components/interaction/service','../../config/environment','./cmContactHasPhone.controller','get','isAuthenticated','index','/:id','show','post','create','update','delete','multer','util','connect-timeout'];(function(_0x5c05a7,_0x19e412){var _0x50386a=function(_0x40f934){while(--_0x40f934){_0x5c05a7['push'](_0x5c05a7['shift']());}};_0x50386a(++_0x19e412);}(_0x8fb9,0x12f));var _0x98fb=function(_0x39772f,_0x5605cb){_0x39772f=_0x39772f-0x0;var _0xc9edbf=_0x8fb9[_0x39772f];return _0xc9edbf;};'use strict';var multer=require(_0x98fb('0x0'));var util=require(_0x98fb('0x1'));var path=require('path');var timeout=require(_0x98fb('0x2'));var express=require(_0x98fb('0x3'));var router=express[_0x98fb('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x98fb('0x5'));var config=require(_0x98fb('0x6'));var controller=require(_0x98fb('0x7'));router[_0x98fb('0x8')]('/',auth[_0x98fb('0x9')](),controller[_0x98fb('0xa')]);router[_0x98fb('0x8')](_0x98fb('0xb'),auth[_0x98fb('0x9')](),controller[_0x98fb('0xc')]);router[_0x98fb('0xd')]('/',auth[_0x98fb('0x9')](),controller[_0x98fb('0xe')]);router['put'](_0x98fb('0xb'),auth['isAuthenticated'](),controller[_0x98fb('0xf')]);router[_0x98fb('0x10')](_0x98fb('0xb'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/cmCustomField/cmCustomField.attributes.js b/server/api/cmCustomField/cmCustomField.attributes.js
index b3ca4f8..aec246d 100644
--- a/server/api/cmCustomField/cmCustomField.attributes.js
+++ b/server/api/cmCustomField/cmCustomField.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x4aa4=['select','parse','values','isArray','stringify','BOOLEAN','sequelize','exports','VIRTUAL','getDataValue','alias','STRING','setDataValue','name','long','type'];(function(_0x2842b4,_0x2b1b7b){var _0x2b9521=function(_0x3613b8){while(--_0x3613b8){_0x2842b4['push'](_0x2842b4['shift']());}};_0x2b9521(++_0x2b1b7b);}(_0x4aa4,0x106));var _0x44aa=function(_0x4b03ba,_0xdcfd8a){_0x4b03ba=_0x4b03ba-0x0;var _0x431c6b=_0x4aa4[_0x4b03ba];return _0x431c6b;};'use strict';var Sequelize=require(_0x44aa('0x0'));var _=require('lodash');module[_0x44aa('0x1')]={'name':{'type':Sequelize[_0x44aa('0x2')],'get':function(_0x7c49d1){return this[_0x44aa('0x3')](_0x44aa('0x4'));}},'alias':{'type':Sequelize[_0x44aa('0x5')],'allowNull':![],'set':function(_0x391b40){this[_0x44aa('0x6')](_0x44aa('0x4'),_0x391b40?_0x391b40:this[_0x44aa('0x3')](_0x44aa('0x7')));}},'type':{'type':Sequelize[_0x44aa('0x5')],'allowNull':![]},'values':{'type':Sequelize['TEXT'](_0x44aa('0x8')),'get':function(){if(this[_0x44aa('0x3')](_0x44aa('0x9'))===_0x44aa('0xa')){return JSON[_0x44aa('0xb')](this[_0x44aa('0x3')](_0x44aa('0xc')));}else{return this['getDataValue']('values');}},'set':function(_0xcec5bb){if(Array[_0x44aa('0xd')](_0xcec5bb)){this[_0x44aa('0x6')](_0x44aa('0xc'),JSON[_0x44aa('0xe')](_0xcec5bb));}else{this['setDataValue'](_0x44aa('0xc'),_0xcec5bb);}}},'required':{'type':Sequelize[_0x44aa('0xf')],'defaultValue':![]}};
\ No newline at end of file
+var _0x6c4f=['name','STRING','long','type','select','parse','values','isArray','stringify','sequelize','lodash','exports','VIRTUAL','getDataValue','alias','setDataValue'];(function(_0x916a95,_0x3655d2){var _0x5b94b0=function(_0x49055e){while(--_0x49055e){_0x916a95['push'](_0x916a95['shift']());}};_0x5b94b0(++_0x3655d2);}(_0x6c4f,0x69));var _0xf6c4=function(_0x480948,_0x26934e){_0x480948=_0x480948-0x0;var _0x27e1ec=_0x6c4f[_0x480948];return _0x27e1ec;};'use strict';var Sequelize=require(_0xf6c4('0x0'));var _=require(_0xf6c4('0x1'));module[_0xf6c4('0x2')]={'name':{'type':Sequelize[_0xf6c4('0x3')],'get':function(_0x38dfa1){return this[_0xf6c4('0x4')](_0xf6c4('0x5'));}},'alias':{'type':Sequelize['STRING'],'allowNull':![],'set':function(_0x149d26){this[_0xf6c4('0x6')](_0xf6c4('0x5'),_0x149d26?_0x149d26:this['getDataValue'](_0xf6c4('0x7')));}},'type':{'type':Sequelize[_0xf6c4('0x8')],'allowNull':![]},'values':{'type':Sequelize['TEXT'](_0xf6c4('0x9')),'get':function(){if(this['getDataValue'](_0xf6c4('0xa'))===_0xf6c4('0xb')){return JSON[_0xf6c4('0xc')](this[_0xf6c4('0x4')](_0xf6c4('0xd')));}else{return this[_0xf6c4('0x4')]('values');}},'set':function(_0x8716fd){if(Array[_0xf6c4('0xe')](_0x8716fd)){this['setDataValue'](_0xf6c4('0xd'),JSON[_0xf6c4('0xf')](_0x8716fd));}else{this[_0xf6c4('0x6')]('values',_0x8716fd);}}},'required':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}};
\ No newline at end of file
diff --git a/server/api/cmCustomField/cmCustomField.controller.js b/server/api/cmCustomField/cmCustomField.controller.js
index c6188db..012436d 100644
--- a/server/api/cmCustomField/cmCustomField.controller.js
+++ b/server/api/cmCustomField/cmCustomField.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x56f1=['send','index','map','type','key','model','differenceBy','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','count','includeAll','include','CmCustomField','findAll','rows','catch','show','params','find','update','body','create','sequelize','transaction','text','Sequelize','TEXT','number','INTEGER','switch','defaultValue','addColumn','cm_contacts','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','sox','ejs','squel','jsforce','to-csv','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','sendStatus','status','end','json','offset','limit','set','Content-Range','apply','then','destroy','stack','name'];(function(_0x5252b8,_0x56e845){var _0x14bb8e=function(_0x33eaa1){while(--_0x33eaa1){_0x5252b8['push'](_0x5252b8['shift']());}};_0x14bb8e(++_0x56e845);}(_0x56f1,0x1bb));var _0x156f=function(_0x4b2cb5,_0x4c07aa){_0x4b2cb5=_0x4b2cb5-0x0;var _0x4a8c62=_0x56f1[_0x4b2cb5];return _0x4a8c62;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x156f('0x0'));var zipdir=require(_0x156f('0x1'));var jsonpatch=require(_0x156f('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x156f('0x3'));var Mustache=require(_0x156f('0x4'));var util=require(_0x156f('0x5'));var path=require('path');var sox=require(_0x156f('0x6'));var csv=require('to-csv');var ejs=require(_0x156f('0x7'));var fs=require('fs');var _=require('lodash');var squel=require(_0x156f('0x8'));var crypto=require('crypto');var jsforce=require(_0x156f('0x9'));var deskjs=require('desk.js');var toCsv=require(_0x156f('0xa'));var querystring=require('querystring');var Papa=require(_0x156f('0xb'));var Redis=require('ioredis');var authService=require(_0x156f('0xc'));var qs=require(_0x156f('0xd'));var as=require(_0x156f('0xe'));var hardwareService=require(_0x156f('0xf'));var logger=require(_0x156f('0x10'))(_0x156f('0x11'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3d250d,_0x48b1d6){_0x48b1d6=_0x48b1d6||0xcc;return function(_0x302044){if(_0x302044){return _0x3d250d[_0x156f('0x12')](_0x48b1d6);}return _0x3d250d[_0x156f('0x13')](_0x48b1d6)[_0x156f('0x14')]();};}function respondWithResult(_0x525267,_0x1d3b47){_0x1d3b47=_0x1d3b47||0xc8;return function(_0x4faa13){if(_0x4faa13){return _0x525267[_0x156f('0x13')](_0x1d3b47)[_0x156f('0x15')](_0x4faa13);}};}function respondWithFilteredResult(_0x4cc406,_0xfe34f6){return function(_0x1a3ab8){if(_0x1a3ab8){var _0x4649a2=_0x1a3ab8['count'],_0x2c6047=_0xfe34f6[_0x156f('0x16')],_0x1c4d5a=_0xfe34f6[_0x156f('0x16')]+_0xfe34f6[_0x156f('0x17')],_0x4dec76;if(_0x1c4d5a>=_0x4649a2){_0x1c4d5a=_0x4649a2;_0x4dec76=0xc8;}else{_0x4dec76=0xce;}_0x4cc406[_0x156f('0x13')](_0x4dec76);return _0x4cc406[_0x156f('0x18')](_0x156f('0x19'),_0x2c6047+'-'+_0x1c4d5a+'/'+_0x4649a2)[_0x156f('0x15')](_0x1a3ab8);}return null;};}function patchUpdates(_0x372433){return function(_0x7299bd){try{jsonpatch[_0x156f('0x1a')](_0x7299bd,_0x372433,!![]);}catch(_0x3fea07){return BPromise['reject'](_0x3fea07);}return _0x7299bd['save']();};}function saveUpdates(_0x58684f,_0x232703){return function(_0x189f27){if(_0x189f27){return _0x189f27['update'](_0x58684f)[_0x156f('0x1b')](function(_0x5b073e){return _0x5b073e;});}return null;};}function removeEntity(_0x1db46e,_0x3108b2){return function(_0xc17b55){if(_0xc17b55){return _0xc17b55[_0x156f('0x1c')]()[_0x156f('0x1b')](function(){_0x1db46e[_0x156f('0x13')](0xcc)[_0x156f('0x14')]();});}};}function handleEntityNotFound(_0x103270,_0x5127bb){return function(_0x29a1c9){if(!_0x29a1c9){_0x103270[_0x156f('0x12')](0x194);}return _0x29a1c9;};}function handleError(_0x334769,_0x13a260){_0x13a260=_0x13a260||0x1f4;return function(_0x35c86d){logger['error'](_0x35c86d[_0x156f('0x1d')]);if(_0x35c86d[_0x156f('0x1e')]){delete _0x35c86d['name'];}_0x334769[_0x156f('0x13')](_0x13a260)[_0x156f('0x1f')](_0x35c86d);};}exports[_0x156f('0x20')]=function(_0x3d6752,_0x3ca1a6){var _0x108365={},_0x5e6fed={},_0x2516f4={'count':0x0,'rows':[]};var _0x5c5100=_[_0x156f('0x21')](db['CmCustomField']['rawAttributes'],function(_0x115361){return{'name':_0x115361['fieldName'],'type':_0x115361[_0x156f('0x22')][_0x156f('0x23')]};});_0x5e6fed[_0x156f('0x24')]=_[_0x156f('0x25')](_['map'](_0x5c5100,_0x156f('0x1e')),[_0x156f('0x1e')]);_0x5e6fed[_0x156f('0x26')]=_[_0x156f('0x27')](_0x3d6752[_0x156f('0x26')]);_0x5e6fed[_0x156f('0x28')]=_[_0x156f('0x29')](_0x5e6fed[_0x156f('0x24')],_0x5e6fed[_0x156f('0x26')]);_0x108365['attributes']=_[_0x156f('0x29')](_0x5e6fed[_0x156f('0x24')],qs[_0x156f('0x2a')](_0x3d6752['query'][_0x156f('0x2a')]));_0x108365[_0x156f('0x2b')]=_0x108365[_0x156f('0x2b')][_0x156f('0x2c')]?_0x108365[_0x156f('0x2b')]:_0x5e6fed[_0x156f('0x24')];if(!_0x3d6752['query'][_0x156f('0x2d')](_0x156f('0x2e'))){_0x108365[_0x156f('0x17')]=qs[_0x156f('0x17')](_0x3d6752[_0x156f('0x26')][_0x156f('0x17')]);_0x108365['offset']=qs[_0x156f('0x16')](_0x3d6752[_0x156f('0x26')][_0x156f('0x16')]);}_0x108365[_0x156f('0x2f')]=qs[_0x156f('0x30')](_0x3d6752[_0x156f('0x26')]['sort']);_0x108365[_0x156f('0x31')]=qs[_0x156f('0x28')](_[_0x156f('0x32')](_0x3d6752[_0x156f('0x26')],_0x5e6fed['filters']),_0x5c5100);if(_0x3d6752[_0x156f('0x26')][_0x156f('0x33')]){_0x108365[_0x156f('0x31')]=_[_0x156f('0x34')](_0x108365['where'],{'$or':_['map'](_0x5c5100,function(_0x17beb0){if(_0x17beb0[_0x156f('0x22')]!==_0x156f('0x35')){var _0x5d414e={};_0x5d414e[_0x17beb0[_0x156f('0x1e')]]={'$like':'%'+_0x3d6752[_0x156f('0x26')]['filter']+'%'};return _0x5d414e;}})});}_0x108365=_[_0x156f('0x34')]({},_0x108365,_0x3d6752[_0x156f('0x36')]);var _0x3e665f={'where':_0x108365[_0x156f('0x31')]};return db['CmCustomField'][_0x156f('0x37')](_0x3e665f)['then'](function(_0x45aa30){_0x2516f4[_0x156f('0x37')]=_0x45aa30;if(_0x3d6752[_0x156f('0x26')][_0x156f('0x38')]){_0x108365[_0x156f('0x39')]=[{'all':!![]}];}return db[_0x156f('0x3a')][_0x156f('0x3b')](_0x108365);})['then'](function(_0x3fde77){_0x2516f4[_0x156f('0x3c')]=_0x3fde77;return _0x2516f4;})[_0x156f('0x1b')](respondWithFilteredResult(_0x3ca1a6,_0x108365))[_0x156f('0x3d')](handleError(_0x3ca1a6,null));};exports[_0x156f('0x3e')]=function(_0x43a989,_0x1e0b5b){var _0x40ec69={'raw':!![],'where':{'id':_0x43a989[_0x156f('0x3f')]['id']}},_0x193437={};_0x193437[_0x156f('0x24')]=_[_0x156f('0x27')](db[_0x156f('0x3a')]['rawAttributes']);_0x193437[_0x156f('0x26')]=_['keys'](_0x43a989['query']);_0x193437[_0x156f('0x28')]=_[_0x156f('0x29')](_0x193437['model'],_0x193437['query']);_0x40ec69[_0x156f('0x2b')]=_['intersection'](_0x193437[_0x156f('0x24')],qs[_0x156f('0x2a')](_0x43a989[_0x156f('0x26')][_0x156f('0x2a')]));_0x40ec69['attributes']=_0x40ec69[_0x156f('0x2b')][_0x156f('0x2c')]?_0x40ec69[_0x156f('0x2b')]:_0x193437[_0x156f('0x24')];if(_0x43a989['query']['includeAll']){_0x40ec69[_0x156f('0x39')]=[{'all':!![]}];}_0x40ec69=_[_0x156f('0x34')]({},_0x40ec69,_0x43a989['options']);return db[_0x156f('0x3a')][_0x156f('0x40')](_0x40ec69)['then'](handleEntityNotFound(_0x1e0b5b,null))[_0x156f('0x1b')](respondWithResult(_0x1e0b5b,null))[_0x156f('0x3d')](handleError(_0x1e0b5b,null));};exports[_0x156f('0x41')]=function(_0x3b8f9d,_0x24595e){if(_0x3b8f9d[_0x156f('0x42')]['id']){delete _0x3b8f9d[_0x156f('0x42')]['id'];}return db[_0x156f('0x3a')][_0x156f('0x40')]({'where':{'id':_0x3b8f9d['params']['id']}})[_0x156f('0x1b')](handleEntityNotFound(_0x24595e,null))['then'](saveUpdates(_0x3b8f9d[_0x156f('0x42')],null))[_0x156f('0x1b')](respondWithResult(_0x24595e,null))[_0x156f('0x3d')](handleError(_0x24595e,null));};exports['destroy']=function(_0x157e18,_0x343e80){return db[_0x156f('0x3a')][_0x156f('0x40')]({'where':{'id':_0x157e18[_0x156f('0x3f')]['id']}})[_0x156f('0x1b')](handleEntityNotFound(_0x343e80,null))[_0x156f('0x1b')](removeEntity(_0x343e80,null))[_0x156f('0x3d')](handleError(_0x343e80,null));};exports[_0x156f('0x43')]=function(_0x903849,_0x5af292){var _0x58c3a0;return db[_0x156f('0x44')][_0x156f('0x45')](function(_0x1b4df2){return db[_0x156f('0x3a')][_0x156f('0x43')](_0x903849['body'],{'transaction':_0x1b4df2})[_0x156f('0x1b')](function(_0x2095ac){_0x58c3a0=_0x2095ac;var _0x276500={'type':db['Sequelize']['TEXT'],'transaction':_0x1b4df2};switch(_0x903849[_0x156f('0x42')]['type']){case _0x156f('0x46'):_0x276500['type']=db[_0x156f('0x47')][_0x156f('0x48')];break;case _0x156f('0x49'):_0x276500['type']=db[_0x156f('0x47')][_0x156f('0x4a')];break;case _0x156f('0x4b'):_0x276500['type']=db['Sequelize']['BOOLEAN'];_0x276500[_0x156f('0x4c')]=![];break;default:}return db[_0x156f('0x44')]['queryInterface'][_0x156f('0x4d')](_0x156f('0x4e'),util['format']('cf_%d',_0x58c3a0['id']),_0x276500);})[_0x156f('0x1b')](function(){return _0x58c3a0;});})[_0x156f('0x1b')](respondWithResult(_0x5af292,0xc9))[_0x156f('0x3d')](handleError(_0x5af292,null));};
\ No newline at end of file
+var _0x538a=['where','pick','merge','filter','options','includeAll','include','findAll','rows','show','params','find','catch','body','destroy','create','sequelize','transaction','Sequelize','TEXT','type','text','INTEGER','switch','BOOLEAN','defaultValue','queryInterface','addColumn','rimraf','fast-json-patch','mustache','util','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','apply','save','update','then','stack','name','CmCustomField','rawAttributes','fieldName','key','differenceBy','map','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort'];(function(_0x2c3a8f,_0x374e56){var _0x189412=function(_0x560055){while(--_0x560055){_0x2c3a8f['push'](_0x2c3a8f['shift']());}};_0x189412(++_0x374e56);}(_0x538a,0x69));var _0xa538=function(_0x5d76b5,_0x49d055){_0x5d76b5=_0x5d76b5-0x0;var _0x1c4361=_0x538a[_0x5d76b5];return _0x1c4361;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0xa538('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa538('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xa538('0x2'));var util=require(_0xa538('0x3'));var path=require('path');var sox=require('sox');var csv=require(_0xa538('0x4'));var ejs=require(_0xa538('0x5'));var fs=require('fs');var _=require(_0xa538('0x6'));var squel=require(_0xa538('0x7'));var crypto=require(_0xa538('0x8'));var jsforce=require(_0xa538('0x9'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xa538('0xa'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xa538('0xb'));var qs=require(_0xa538('0xc'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa538('0xd'));var logger=require(_0xa538('0xe'))(_0xa538('0xf'));var utils=require('../../config/utils');var config=require(_0xa538('0x10'));var db=require(_0xa538('0x11'))['db'];function respondWithStatusCode(_0x35c72c,_0x5ca4f8){_0x5ca4f8=_0x5ca4f8||0xcc;return function(_0x1b364f){if(_0x1b364f){return _0x35c72c[_0xa538('0x12')](_0x5ca4f8);}return _0x35c72c[_0xa538('0x13')](_0x5ca4f8)[_0xa538('0x14')]();};}function respondWithResult(_0x135a25,_0x82b381){_0x82b381=_0x82b381||0xc8;return function(_0x3f0476){if(_0x3f0476){return _0x135a25[_0xa538('0x13')](_0x82b381)[_0xa538('0x15')](_0x3f0476);}};}function respondWithFilteredResult(_0x2aae2b,_0x4237a2){return function(_0x52e168){if(_0x52e168){var _0x38e70=_0x52e168[_0xa538('0x16')],_0x28e215=_0x4237a2[_0xa538('0x17')],_0x1d2c44=_0x4237a2[_0xa538('0x17')]+_0x4237a2[_0xa538('0x18')],_0x2d2876;if(_0x1d2c44>=_0x38e70){_0x1d2c44=_0x38e70;_0x2d2876=0xc8;}else{_0x2d2876=0xce;}_0x2aae2b['status'](_0x2d2876);return _0x2aae2b[_0xa538('0x19')]('Content-Range',_0x28e215+'-'+_0x1d2c44+'/'+_0x38e70)[_0xa538('0x15')](_0x52e168);}return null;};}function patchUpdates(_0x7c47f9){return function(_0x54fcd2){try{jsonpatch[_0xa538('0x1a')](_0x54fcd2,_0x7c47f9,!![]);}catch(_0xd4dde6){return BPromise['reject'](_0xd4dde6);}return _0x54fcd2[_0xa538('0x1b')]();};}function saveUpdates(_0x11a314,_0x5c9398){return function(_0x3dab7c){if(_0x3dab7c){return _0x3dab7c[_0xa538('0x1c')](_0x11a314)[_0xa538('0x1d')](function(_0x19c123){return _0x19c123;});}return null;};}function removeEntity(_0xc6116b,_0x144471){return function(_0x22346f){if(_0x22346f){return _0x22346f['destroy']()[_0xa538('0x1d')](function(){_0xc6116b[_0xa538('0x13')](0xcc)['end']();});}};}function handleEntityNotFound(_0xbf780f,_0x353627){return function(_0x4b63ee){if(!_0x4b63ee){_0xbf780f[_0xa538('0x12')](0x194);}return _0x4b63ee;};}function handleError(_0xb62c53,_0x513202){_0x513202=_0x513202||0x1f4;return function(_0x58bb57){logger['error'](_0x58bb57[_0xa538('0x1e')]);if(_0x58bb57[_0xa538('0x1f')]){delete _0x58bb57['name'];}_0xb62c53[_0xa538('0x13')](_0x513202)['send'](_0x58bb57);};}exports['index']=function(_0x215f46,_0x3b337a){var _0x1ad44a={},_0xceb00={},_0x457871={'count':0x0,'rows':[]};var _0x32b8af=_['map'](db[_0xa538('0x20')][_0xa538('0x21')],function(_0x4ec22d){return{'name':_0x4ec22d[_0xa538('0x22')],'type':_0x4ec22d['type'][_0xa538('0x23')]};});_0xceb00['model']=_[_0xa538('0x24')](_[_0xa538('0x25')](_0x32b8af,'name'),[_0xa538('0x1f')]);_0xceb00['query']=_[_0xa538('0x26')](_0x215f46[_0xa538('0x27')]);_0xceb00[_0xa538('0x28')]=_[_0xa538('0x29')](_0xceb00[_0xa538('0x2a')],_0xceb00[_0xa538('0x27')]);_0x1ad44a[_0xa538('0x2b')]=_[_0xa538('0x29')](_0xceb00[_0xa538('0x2a')],qs[_0xa538('0x2c')](_0x215f46[_0xa538('0x27')]['fields']));_0x1ad44a[_0xa538('0x2b')]=_0x1ad44a[_0xa538('0x2b')][_0xa538('0x2d')]?_0x1ad44a['attributes']:_0xceb00[_0xa538('0x2a')];if(!_0x215f46['query'][_0xa538('0x2e')]('nolimit')){_0x1ad44a[_0xa538('0x18')]=qs[_0xa538('0x18')](_0x215f46['query'][_0xa538('0x18')]);_0x1ad44a['offset']=qs[_0xa538('0x17')](_0x215f46[_0xa538('0x27')][_0xa538('0x17')]);}_0x1ad44a[_0xa538('0x2f')]=qs['sort'](_0x215f46['query'][_0xa538('0x30')]);_0x1ad44a[_0xa538('0x31')]=qs[_0xa538('0x28')](_[_0xa538('0x32')](_0x215f46[_0xa538('0x27')],_0xceb00[_0xa538('0x28')]),_0x32b8af);if(_0x215f46[_0xa538('0x27')]['filter']){_0x1ad44a[_0xa538('0x31')]=_[_0xa538('0x33')](_0x1ad44a[_0xa538('0x31')],{'$or':_[_0xa538('0x25')](_0x32b8af,function(_0x103857){if(_0x103857['type']!=='VIRTUAL'){var _0x30cbd1={};_0x30cbd1[_0x103857[_0xa538('0x1f')]]={'$like':'%'+_0x215f46[_0xa538('0x27')][_0xa538('0x34')]+'%'};return _0x30cbd1;}})});}_0x1ad44a=_['merge']({},_0x1ad44a,_0x215f46[_0xa538('0x35')]);var _0x577db2={'where':_0x1ad44a[_0xa538('0x31')]};return db[_0xa538('0x20')][_0xa538('0x16')](_0x577db2)[_0xa538('0x1d')](function(_0x297b60){_0x457871['count']=_0x297b60;if(_0x215f46[_0xa538('0x27')][_0xa538('0x36')]){_0x1ad44a[_0xa538('0x37')]=[{'all':!![]}];}return db[_0xa538('0x20')][_0xa538('0x38')](_0x1ad44a);})[_0xa538('0x1d')](function(_0xf8ddd8){_0x457871[_0xa538('0x39')]=_0xf8ddd8;return _0x457871;})[_0xa538('0x1d')](respondWithFilteredResult(_0x3b337a,_0x1ad44a))['catch'](handleError(_0x3b337a,null));};exports[_0xa538('0x3a')]=function(_0x5d0220,_0x4abaa0){var _0x46a3f6={'raw':!![],'where':{'id':_0x5d0220[_0xa538('0x3b')]['id']}},_0x2e9e15={};_0x2e9e15['model']=_[_0xa538('0x26')](db['CmCustomField'][_0xa538('0x21')]);_0x2e9e15['query']=_[_0xa538('0x26')](_0x5d0220['query']);_0x2e9e15['filters']=_['intersection'](_0x2e9e15[_0xa538('0x2a')],_0x2e9e15[_0xa538('0x27')]);_0x46a3f6[_0xa538('0x2b')]=_[_0xa538('0x29')](_0x2e9e15['model'],qs[_0xa538('0x2c')](_0x5d0220[_0xa538('0x27')][_0xa538('0x2c')]));_0x46a3f6[_0xa538('0x2b')]=_0x46a3f6[_0xa538('0x2b')][_0xa538('0x2d')]?_0x46a3f6['attributes']:_0x2e9e15[_0xa538('0x2a')];if(_0x5d0220[_0xa538('0x27')]['includeAll']){_0x46a3f6['include']=[{'all':!![]}];}_0x46a3f6=_[_0xa538('0x33')]({},_0x46a3f6,_0x5d0220[_0xa538('0x35')]);return db[_0xa538('0x20')][_0xa538('0x3c')](_0x46a3f6)[_0xa538('0x1d')](handleEntityNotFound(_0x4abaa0,null))[_0xa538('0x1d')](respondWithResult(_0x4abaa0,null))[_0xa538('0x3d')](handleError(_0x4abaa0,null));};exports['update']=function(_0x3ea5ab,_0x2fb21d){if(_0x3ea5ab[_0xa538('0x3e')]['id']){delete _0x3ea5ab[_0xa538('0x3e')]['id'];}return db[_0xa538('0x20')][_0xa538('0x3c')]({'where':{'id':_0x3ea5ab[_0xa538('0x3b')]['id']}})[_0xa538('0x1d')](handleEntityNotFound(_0x2fb21d,null))['then'](saveUpdates(_0x3ea5ab[_0xa538('0x3e')],null))[_0xa538('0x1d')](respondWithResult(_0x2fb21d,null))[_0xa538('0x3d')](handleError(_0x2fb21d,null));};exports[_0xa538('0x3f')]=function(_0x594b2e,_0x4a66b0){return db[_0xa538('0x20')][_0xa538('0x3c')]({'where':{'id':_0x594b2e['params']['id']}})[_0xa538('0x1d')](handleEntityNotFound(_0x4a66b0,null))[_0xa538('0x1d')](removeEntity(_0x4a66b0,null))[_0xa538('0x3d')](handleError(_0x4a66b0,null));};exports[_0xa538('0x40')]=function(_0x4613a7,_0x25c5d7){var _0x497cba;return db[_0xa538('0x41')][_0xa538('0x42')](function(_0x26a307){return db[_0xa538('0x20')][_0xa538('0x40')](_0x4613a7['body'],{'transaction':_0x26a307})[_0xa538('0x1d')](function(_0x175352){_0x497cba=_0x175352;var _0x462ef5={'type':db[_0xa538('0x43')][_0xa538('0x44')],'transaction':_0x26a307};switch(_0x4613a7['body'][_0xa538('0x45')]){case _0xa538('0x46'):_0x462ef5[_0xa538('0x45')]=db[_0xa538('0x43')][_0xa538('0x44')];break;case'number':_0x462ef5[_0xa538('0x45')]=db[_0xa538('0x43')][_0xa538('0x47')];break;case _0xa538('0x48'):_0x462ef5[_0xa538('0x45')]=db[_0xa538('0x43')][_0xa538('0x49')];_0x462ef5[_0xa538('0x4a')]=![];break;default:}return db[_0xa538('0x41')][_0xa538('0x4b')][_0xa538('0x4c')]('cm_contacts',util['format']('cf_%d',_0x497cba['id']),_0x462ef5);})[_0xa538('0x1d')](function(){return _0x497cba;});})[_0xa538('0x1d')](respondWithResult(_0x25c5d7,0xc9))['catch'](handleError(_0x25c5d7,null));};
\ No newline at end of file
diff --git a/server/api/cmCustomField/cmCustomField.model.js b/server/api/cmCustomField/cmCustomField.model.js
index 12fa8ed..8a9a479 100644
--- a/server/api/cmCustomField/cmCustomField.model.js
+++ b/server/api/cmCustomField/cmCustomField.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x96f9=['moment','bluebird','request-promise','path','rimraf','./cmCustomField.attributes','exports','define','CmCustomField','lodash','util','../../config/logger','api'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x96f9,0x64));var _0x996f=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x96f9[_0x17d9e3];return _0x14192d;};'use strict';var _=require(_0x996f('0x0'));var util=require(_0x996f('0x1'));var logger=require(_0x996f('0x2'))(_0x996f('0x3'));var moment=require(_0x996f('0x4'));var BPromise=require(_0x996f('0x5'));var rp=require(_0x996f('0x6'));var fs=require('fs');var path=require(_0x996f('0x7'));var rimraf=require(_0x996f('0x8'));var config=require('../../config/environment');var attributes=require(_0x996f('0x9'));module[_0x996f('0xa')]=function(_0x4846b8,_0x1e1b9d){return _0x4846b8[_0x996f('0xb')](_0x996f('0xc'),attributes,{'tableName':'cm_custom_fields','paranoid':!![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x5360=['define','CmCustomField','cm_custom_fields','lodash','util','../../config/logger','api','request-promise','rimraf','../../config/environment'];(function(_0x4ffed8,_0x11f581){var _0x595563=function(_0x57115a){while(--_0x57115a){_0x4ffed8['push'](_0x4ffed8['shift']());}};_0x595563(++_0x11f581);}(_0x5360,0x157));var _0x0536=function(_0x3f1b99,_0x2f2a2e){_0x3f1b99=_0x3f1b99-0x0;var _0x4bb708=_0x5360[_0x3f1b99];return _0x4bb708;};'use strict';var _=require(_0x0536('0x0'));var util=require(_0x0536('0x1'));var logger=require(_0x0536('0x2'))(_0x0536('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x0536('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0536('0x5'));var config=require(_0x0536('0x6'));var attributes=require('./cmCustomField.attributes');module['exports']=function(_0x4fc885,_0x459432){return _0x4fc885[_0x0536('0x7')](_0x0536('0x8'),attributes,{'tableName':_0x0536('0x9'),'paranoid':!![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/cmCustomField/cmCustomField.rpc.js b/server/api/cmCustomField/cmCustomField.rpc.js
index 4456196..9325815 100644
--- a/server/api/cmCustomField/cmCustomField.rpc.js
+++ b/server/api/cmCustomField/cmCustomField.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xb469=['ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','request','then','CmCustomField,\x20%s,\x20%s','debug','request\x20sent','error','message','info','result','lodash','util','moment','bluebird','randomstring'];(function(_0x1f1f9e,_0x1ef7fc){var _0x1e2a98=function(_0x31b0c6){while(--_0x31b0c6){_0x1f1f9e['push'](_0x1f1f9e['shift']());}};_0x1e2a98(++_0x1ef7fc);}(_0xb469,0x13b));var _0x9b46=function(_0x3f0cc8,_0xde10c0){_0x3f0cc8=_0x3f0cc8-0x0;var _0x4f7cf4=_0xb469[_0x3f0cc8];return _0x4f7cf4;};'use strict';var _=require(_0x9b46('0x0'));var util=require(_0x9b46('0x1'));var moment=require(_0x9b46('0x2'));var BPromise=require(_0x9b46('0x3'));var rs=require(_0x9b46('0x4'));var fs=require('fs');var Redis=require(_0x9b46('0x5'));var db=require(_0x9b46('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x9b46('0x7'))(_0x9b46('0x8'));var config=require('../../config/environment');var jayson=require(_0x9b46('0x9'));var client=jayson[_0x9b46('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1b2dd3,_0x5bd834,_0x4c1ed9){return new BPromise(function(_0x34c0de,_0x545b6c){return client[_0x9b46('0xb')](_0x1b2dd3,_0x4c1ed9)[_0x9b46('0xc')](function(_0x43a112){logger['info'](_0x9b46('0xd'),_0x5bd834,'request\x20sent');logger[_0x9b46('0xe')]('CmCustomField,\x20%s,\x20%s,\x20%s',_0x5bd834,_0x9b46('0xf'),JSON['stringify'](_0x43a112));if(_0x43a112[_0x9b46('0x10')]){if(_0x43a112[_0x9b46('0x10')]['code']===0x1f4){logger[_0x9b46('0x10')](_0x9b46('0xd'),_0x5bd834,_0x43a112['error'][_0x9b46('0x11')]);return _0x545b6c(_0x43a112[_0x9b46('0x10')][_0x9b46('0x11')]);}logger[_0x9b46('0x10')](_0x9b46('0xd'),_0x5bd834,_0x43a112[_0x9b46('0x10')][_0x9b46('0x11')]);return _0x34c0de(_0x43a112[_0x9b46('0x10')][_0x9b46('0x11')]);}else{logger[_0x9b46('0x12')](_0x9b46('0xd'),_0x5bd834,_0x9b46('0xf'));_0x34c0de(_0x43a112[_0x9b46('0x13')]['message']);}})['catch'](function(_0x52c1b8){logger[_0x9b46('0x10')](_0x9b46('0xd'),_0x5bd834,_0x52c1b8);_0x545b6c(_0x52c1b8);});});}
\ No newline at end of file
+var _0xc3b5=['../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','info','request\x20sent','debug','CmCustomField,\x20%s,\x20%s,\x20%s','stringify','error','code','CmCustomField,\x20%s,\x20%s','message','result','catch','moment','bluebird','randomstring','ioredis'];(function(_0x7a319d,_0x235959){var _0x5c6b4e=function(_0x2e5b17){while(--_0x2e5b17){_0x7a319d['push'](_0x7a319d['shift']());}};_0x5c6b4e(++_0x235959);}(_0xc3b5,0x6f));var _0x5c3b=function(_0x5d4448,_0x2a9a90){_0x5d4448=_0x5d4448-0x0;var _0x127b24=_0xc3b5[_0x5d4448];return _0x127b24;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x5c3b('0x0'));var BPromise=require(_0x5c3b('0x1'));var rs=require(_0x5c3b('0x2'));var fs=require('fs');var Redis=require(_0x5c3b('0x3'));var db=require(_0x5c3b('0x4'))['db'];var utils=require(_0x5c3b('0x5'));var logger=require(_0x5c3b('0x6'))(_0x5c3b('0x7'));var config=require('../../config/environment');var jayson=require(_0x5c3b('0x8'));var client=jayson[_0x5c3b('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x568a28,_0x30a08f,_0x420839){return new BPromise(function(_0x3892ad,_0x5be9ee){return client[_0x5c3b('0xa')](_0x568a28,_0x420839)[_0x5c3b('0xb')](function(_0x159db5){logger[_0x5c3b('0xc')]('CmCustomField,\x20%s,\x20%s',_0x30a08f,_0x5c3b('0xd'));logger[_0x5c3b('0xe')](_0x5c3b('0xf'),_0x30a08f,_0x5c3b('0xd'),JSON[_0x5c3b('0x10')](_0x159db5));if(_0x159db5['error']){if(_0x159db5[_0x5c3b('0x11')][_0x5c3b('0x12')]===0x1f4){logger['error'](_0x5c3b('0x13'),_0x30a08f,_0x159db5[_0x5c3b('0x11')]['message']);return _0x5be9ee(_0x159db5[_0x5c3b('0x11')][_0x5c3b('0x14')]);}logger[_0x5c3b('0x11')](_0x5c3b('0x13'),_0x30a08f,_0x159db5[_0x5c3b('0x11')][_0x5c3b('0x14')]);return _0x3892ad(_0x159db5[_0x5c3b('0x11')]['message']);}else{logger[_0x5c3b('0xc')]('CmCustomField,\x20%s,\x20%s',_0x30a08f,'request\x20sent');_0x3892ad(_0x159db5[_0x5c3b('0x15')][_0x5c3b('0x14')]);}})[_0x5c3b('0x16')](function(_0x589797){logger[_0x5c3b('0x11')](_0x5c3b('0x13'),_0x30a08f,_0x589797);_0x5be9ee(_0x589797);});});}
\ No newline at end of file
diff --git a/server/api/cmCustomField/index.js b/server/api/cmCustomField/index.js
index 6040e9a..f9960ae 100644
--- a/server/api/cmCustomField/index.js
+++ b/server/api/cmCustomField/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xc35f=['show','create','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmCustomField.controller','get','isAuthenticated','/:id'];(function(_0x211311,_0x5e08e9){var _0x12d89b=function(_0x19390f){while(--_0x19390f){_0x211311['push'](_0x211311['shift']());}};_0x12d89b(++_0x5e08e9);}(_0xc35f,0x16f));var _0xfc35=function(_0xed45fc,_0x472179){_0xed45fc=_0xed45fc-0x0;var _0x30c449=_0xc35f[_0xed45fc];return _0x30c449;};'use strict';var multer=require(_0xfc35('0x0'));var util=require(_0xfc35('0x1'));var path=require(_0xfc35('0x2'));var timeout=require(_0xfc35('0x3'));var express=require(_0xfc35('0x4'));var router=express[_0xfc35('0x5')]();var auth=require(_0xfc35('0x6'));var interaction=require(_0xfc35('0x7'));var config=require(_0xfc35('0x8'));var controller=require(_0xfc35('0x9'));router[_0xfc35('0xa')]('/',auth[_0xfc35('0xb')](),controller['index']);router[_0xfc35('0xa')](_0xfc35('0xc'),auth[_0xfc35('0xb')](),controller[_0xfc35('0xd')]);router['post']('/',auth['isAuthenticated'](),controller[_0xfc35('0xe')]);router['put'](_0xfc35('0xc'),auth[_0xfc35('0xb')](),controller[_0xfc35('0xf')]);router[_0xfc35('0x10')]('/:id',auth['isAuthenticated'](),controller[_0xfc35('0x11')]);module[_0xfc35('0x12')]=router;
\ No newline at end of file
+var _0x2c64=['../../components/auth/service','./cmCustomField.controller','get','isAuthenticated','show','post','create','/:id','update','exports','multer','util','connect-timeout','express','Router'];(function(_0x53f8f5,_0x129002){var _0x17b128=function(_0x363aa9){while(--_0x363aa9){_0x53f8f5['push'](_0x53f8f5['shift']());}};_0x17b128(++_0x129002);}(_0x2c64,0x181));var _0x42c6=function(_0x341e0f,_0x4a09d0){_0x341e0f=_0x341e0f-0x0;var _0x59555a=_0x2c64[_0x341e0f];return _0x59555a;};'use strict';var multer=require(_0x42c6('0x0'));var util=require(_0x42c6('0x1'));var path=require('path');var timeout=require(_0x42c6('0x2'));var express=require(_0x42c6('0x3'));var router=express[_0x42c6('0x4')]();var auth=require(_0x42c6('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x42c6('0x6'));router[_0x42c6('0x7')]('/',auth[_0x42c6('0x8')](),controller['index']);router['get']('/:id',auth[_0x42c6('0x8')](),controller[_0x42c6('0x9')]);router[_0x42c6('0xa')]('/',auth[_0x42c6('0x8')](),controller[_0x42c6('0xb')]);router['put'](_0x42c6('0xc'),auth[_0x42c6('0x8')](),controller[_0x42c6('0xd')]);router['delete'](_0x42c6('0xc'),auth[_0x42c6('0x8')](),controller['destroy']);module[_0x42c6('0xe')]=router;
\ No newline at end of file
diff --git a/server/api/cmHopper/cmHopper.attributes.js b/server/api/cmHopper/cmHopper.attributes.js
index 3f934c2..244e61d 100644
--- a/server/api/cmHopper/cmHopper.attributes.js
+++ b/server/api/cmHopper/cmHopper.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x3f8a=['DATE','format','YYYY-MM-DD\x20HH:mm:ss','INTEGER','BOOLEAN','UNSIGNED','contactListQueue','moment','sequelize','exports','STRING'];(function(_0x44d744,_0x46cc36){var _0x3365c6=function(_0x147be8){while(--_0x147be8){_0x44d744['push'](_0x44d744['shift']());}};_0x3365c6(++_0x46cc36);}(_0x3f8a,0x1d5));var _0xa3f8=function(_0x1ca4fc,_0x292296){_0x1ca4fc=_0x1ca4fc-0x0;var _0x159709=_0x3f8a[_0x1ca4fc];return _0x159709;};'use strict';var moment=require(_0xa3f8('0x0'));var Sequelize=require(_0xa3f8('0x1'));module[_0xa3f8('0x2')]={'phone':{'type':Sequelize[_0xa3f8('0x3')],'allowNull':![]},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'scheduledat':{'type':Sequelize[_0xa3f8('0x4')],'defaultValue':moment()[_0xa3f8('0x5')](_0xa3f8('0x6'))},'countbusyretry':{'type':Sequelize[_0xa3f8('0x7')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xa3f8('0x7')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xa3f8('0x7')],'defaultValue':0x0},'callback':{'type':Sequelize[_0xa3f8('0x8')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0xa3f8('0x3')],'defaultValue':null},'callbackat':{'type':Sequelize[_0xa3f8('0x4')]},'priority':{'type':Sequelize[_0xa3f8('0x7')](0x2)[_0xa3f8('0x9')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize[_0xa3f8('0x8')],'defaultValue':![]},'ContactId':{'type':Sequelize[_0xa3f8('0x7')],'unique':_0xa3f8('0xa')},'ListId':{'type':Sequelize[_0xa3f8('0x7')],'unique':_0xa3f8('0xa')},'UserId':{'type':Sequelize[_0xa3f8('0x7')]},'VoiceQueueId':{'type':Sequelize['INTEGER'],'unique':_0xa3f8('0xa')},'CampaignId':{'type':Sequelize[_0xa3f8('0x7')]},'countnosuchnumberretry':{'type':Sequelize[_0xa3f8('0x7')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0xa3f8('0x7')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0xa3f8('0x7')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0xa3f8('0x7')],'defaultValue':0x0},'dialTimezone':{'type':Sequelize[_0xa3f8('0x3')]}};
\ No newline at end of file
+var _0x2675=['YYYY-MM-DD\x20HH:mm:ss','INTEGER','STRING','UNSIGNED','contactListQueue','moment','BOOLEAN','DATE'];(function(_0x15380b,_0x3fe355){var _0x2c3048=function(_0x27c206){while(--_0x27c206){_0x15380b['push'](_0x15380b['shift']());}};_0x2c3048(++_0x3fe355);}(_0x2675,0x75));var _0x5267=function(_0x162f28,_0x19d00b){_0x162f28=_0x162f28-0x0;var _0x1d68fc=_0x2675[_0x162f28];return _0x1d68fc;};'use strict';var moment=require(_0x5267('0x0'));var Sequelize=require('sequelize');module['exports']={'phone':{'type':Sequelize['STRING'],'allowNull':![]},'active':{'type':Sequelize[_0x5267('0x1')],'defaultValue':![]},'scheduledat':{'type':Sequelize[_0x5267('0x2')],'defaultValue':moment()['format'](_0x5267('0x3'))},'countbusyretry':{'type':Sequelize[_0x5267('0x4')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x5267('0x4')],'defaultValue':0x0},'callback':{'type':Sequelize[_0x5267('0x1')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x5267('0x5')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x5267('0x2')]},'priority':{'type':Sequelize[_0x5267('0x4')](0x2)[_0x5267('0x6')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ContactId':{'type':Sequelize[_0x5267('0x4')],'unique':_0x5267('0x7')},'ListId':{'type':Sequelize['INTEGER'],'unique':_0x5267('0x7')},'UserId':{'type':Sequelize['INTEGER']},'VoiceQueueId':{'type':Sequelize[_0x5267('0x4')],'unique':_0x5267('0x7')},'CampaignId':{'type':Sequelize[_0x5267('0x4')]},'countnosuchnumberretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x5267('0x4')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x5267('0x4')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'dialTimezone':{'type':Sequelize[_0x5267('0x5')]}};
\ No newline at end of file
diff --git a/server/api/cmHopper/cmHopper.controller.js b/server/api/cmHopper/cmHopper.controller.js
index 4c525ea..bc87920 100644
--- a/server/api/cmHopper/cmHopper.controller.js
+++ b/server/api/cmHopper/cmHopper.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9c4a=['timezones','utcOffset','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','end','status','json','count','offset','limit','set','Content-Range','apply','save','update','destroy','then','sendStatus','error','stack','name','map','CmHopper','rawAttributes','fieldName','key','model','keys','query','filters','intersection','$and','$or','$gt','$gte','$lte','$eq','$notBetween','$in','$notIn','$like','$notLike','$iLike','$notILike','$contains','$contained','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','merge','type','VIRTUAL','filter','options','includeAll','findAll','rows','catch','show','params','find','create','body','describe','CampaignId','VoiceQueueId','VoiceQueue','Campaign','campaign','membername','user','UserId','deleted','deletedat','YYYY-MM-DD\x20HH:mm:ss','calleridnum','phone','campaigntype','queue','ivr','CmContact','firstName','lastName','isNil','calleridname','finally','getPreview','outbound','dialOrderByScheduledAt','sequelize','transaction','format','direction','prev','hopperIds','priority','ASC','scheduledAt','literal','COALESCE(CmHopper.UserId,\x200)\x20ASC','DESC','isEmpty','COALESCE(CmHopper.UserId,\x200)\x20DESC','findOne','UPDATE','Contact','CmCompany','Company','Queue','dialActive','getOpenContacts','isNumber','CmHopper,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','getTimezones'];(function(_0x1fe6fb,_0x3991ec){var _0x4dbe77=function(_0x3b306a){while(--_0x3b306a){_0x1fe6fb['push'](_0x1fe6fb['shift']());}};_0x4dbe77(++_0x3991ec);}(_0x9c4a,0x120));var _0xa9c4=function(_0x36c6eb,_0x4fb127){_0x36c6eb=_0x36c6eb-0x0;var _0x30675b=_0x9c4a[_0x36c6eb];return _0x30675b;};'use strict';var pdf=require(_0xa9c4('0x0'));var emlformat=require(_0xa9c4('0x1'));var rimraf=require(_0xa9c4('0x2'));var zipdir=require(_0xa9c4('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0xa9c4('0x4'));var moment=require(_0xa9c4('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xa9c4('0x6'));var path=require(_0xa9c4('0x7'));var sox=require('sox');var csv=require(_0xa9c4('0x8'));var ejs=require(_0xa9c4('0x9'));var fs=require('fs');var _=require(_0xa9c4('0xa'));var squel=require(_0xa9c4('0xb'));var crypto=require(_0xa9c4('0xc'));var jsforce=require(_0xa9c4('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xa9c4('0x8'));var querystring=require(_0xa9c4('0xe'));var Papa=require(_0xa9c4('0xf'));var Redis=require(_0xa9c4('0x10'));var shared=require('../../config/environment');var authService=require(_0xa9c4('0x11'));var qs=require(_0xa9c4('0x12'));var as=require(_0xa9c4('0x13'));var hardwareService=require(_0xa9c4('0x14'));var logger=require('../../config/logger')(_0xa9c4('0x15'));var utils=require(_0xa9c4('0x16'));var config=require(_0xa9c4('0x17'));var db=require(_0xa9c4('0x18'))['db'];function respondWithStatusCode(_0x6f86c3,_0x5a5926){_0x5a5926=_0x5a5926||0xcc;return function(_0x93982a){if(_0x93982a){return _0x6f86c3['sendStatus'](_0x5a5926);}return _0x6f86c3['status'](_0x5a5926)[_0xa9c4('0x19')]();};}function respondWithResult(_0x42fdcc,_0x46d39c){_0x46d39c=_0x46d39c||0xc8;return function(_0x45ba29){if(_0x45ba29){return _0x42fdcc[_0xa9c4('0x1a')](_0x46d39c)[_0xa9c4('0x1b')](_0x45ba29);}};}function respondWithFilteredResult(_0x36659d,_0x363168){return function(_0x2cc61b){if(_0x2cc61b){var _0x4074e9=_0x2cc61b[_0xa9c4('0x1c')],_0x204da6=_0x363168['offset'],_0x349e71=_0x363168[_0xa9c4('0x1d')]+_0x363168[_0xa9c4('0x1e')],_0x215e80;if(_0x349e71>=_0x4074e9){_0x349e71=_0x4074e9;_0x215e80=0xc8;}else{_0x215e80=0xce;}_0x36659d[_0xa9c4('0x1a')](_0x215e80);return _0x36659d[_0xa9c4('0x1f')](_0xa9c4('0x20'),_0x204da6+'-'+_0x349e71+'/'+_0x4074e9)[_0xa9c4('0x1b')](_0x2cc61b);}return null;};}function patchUpdates(_0x2306b8){return function(_0x3610a1){try{jsonpatch[_0xa9c4('0x21')](_0x3610a1,_0x2306b8,!![]);}catch(_0x2c6390){return BPromise['reject'](_0x2c6390);}return _0x3610a1[_0xa9c4('0x22')]();};}function saveUpdates(_0x184615,_0x19f2d0){return function(_0x290972){if(_0x290972){return _0x290972[_0xa9c4('0x23')](_0x184615)['then'](function(_0x3dfb89){return _0x3dfb89;});}return null;};}function removeEntity(_0x48ff87,_0x19006d){return function(_0x328b2d){if(_0x328b2d){return _0x328b2d[_0xa9c4('0x24')]()[_0xa9c4('0x25')](function(){_0x48ff87['status'](0xcc)[_0xa9c4('0x19')]();});}};}function handleEntityNotFound(_0x579c26,_0x1b6546){return function(_0x27d785){if(!_0x27d785){_0x579c26[_0xa9c4('0x26')](0x194);}return _0x27d785;};}function handleError(_0xab098f,_0x5eee99){_0x5eee99=_0x5eee99||0x1f4;return function(_0x28b95f){logger[_0xa9c4('0x27')](_0x28b95f[_0xa9c4('0x28')]);if(_0x28b95f[_0xa9c4('0x29')]){delete _0x28b95f['name'];}_0xab098f[_0xa9c4('0x1a')](_0x5eee99)['send'](_0x28b95f);};}exports['index']=function(_0x505298,_0x3e01a4){var _0x315aed={},_0x81b4cd={},_0x46f4e5={'count':0x0,'rows':[]};var _0x2d9fa7=_[_0xa9c4('0x2a')](db[_0xa9c4('0x2b')][_0xa9c4('0x2c')],function(_0x49e708){return{'name':_0x49e708[_0xa9c4('0x2d')],'type':_0x49e708['type'][_0xa9c4('0x2e')]};});_0x81b4cd[_0xa9c4('0x2f')]=_['map'](_0x2d9fa7,_0xa9c4('0x29'));_0x81b4cd['query']=_[_0xa9c4('0x30')](_0x505298[_0xa9c4('0x31')]);_0x81b4cd[_0xa9c4('0x32')]=_[_0xa9c4('0x33')](_0x81b4cd[_0xa9c4('0x2f')],_0x81b4cd[_0xa9c4('0x31')]);_0x81b4cd['filters']=_['concat'](_0x81b4cd['filters'],[_0xa9c4('0x34'),_0xa9c4('0x35'),_0xa9c4('0x36'),_0xa9c4('0x37'),'$lt',_0xa9c4('0x38'),'$ne',_0xa9c4('0x39'),'$not','$between',_0xa9c4('0x3a'),_0xa9c4('0x3b'),_0xa9c4('0x3c'),_0xa9c4('0x3d'),_0xa9c4('0x3e'),_0xa9c4('0x3f'),_0xa9c4('0x40'),_0xa9c4('0x3d'),'$overlap',_0xa9c4('0x41'),_0xa9c4('0x42'),'$any']);_0x315aed['attributes']=_[_0xa9c4('0x33')](_0x81b4cd['model'],qs['fields'](_0x505298[_0xa9c4('0x31')][_0xa9c4('0x43')]));_0x315aed[_0xa9c4('0x44')]=_0x315aed[_0xa9c4('0x44')][_0xa9c4('0x45')]?_0x315aed[_0xa9c4('0x44')]:_0x81b4cd['model'];if(!_0x505298[_0xa9c4('0x31')][_0xa9c4('0x46')](_0xa9c4('0x47'))){_0x315aed[_0xa9c4('0x1e')]=qs[_0xa9c4('0x1e')](_0x505298['query'][_0xa9c4('0x1e')]);_0x315aed[_0xa9c4('0x1d')]=qs['offset'](_0x505298[_0xa9c4('0x31')][_0xa9c4('0x1d')]);}_0x315aed['order']=qs[_0xa9c4('0x48')](_0x505298['query'][_0xa9c4('0x48')]);_0x315aed[_0xa9c4('0x49')]=qs[_0xa9c4('0x32')](_[_0xa9c4('0x4a')](_0x505298[_0xa9c4('0x31')],_0x81b4cd[_0xa9c4('0x32')]),_0x2d9fa7);if(_0x505298['query']['filter']){_0x315aed[_0xa9c4('0x49')]=_[_0xa9c4('0x4b')](_0x315aed[_0xa9c4('0x49')],{'$or':_['map'](_0x2d9fa7,function(_0x47c80d){if(_0x47c80d[_0xa9c4('0x4c')]!==_0xa9c4('0x4d')){var _0x3ec2ea={};_0x3ec2ea[_0x47c80d['name']]={'$like':'%'+_0x505298[_0xa9c4('0x31')][_0xa9c4('0x4e')]+'%'};return _0x3ec2ea;}})});}_0x315aed=_['merge']({},_0x315aed,_0x505298[_0xa9c4('0x4f')]);var _0x199356={'where':_0x315aed[_0xa9c4('0x49')]};return db['CmHopper'][_0xa9c4('0x1c')](_0x199356)[_0xa9c4('0x25')](function(_0x4ebd56){_0x46f4e5[_0xa9c4('0x1c')]=_0x4ebd56;if(_0x505298[_0xa9c4('0x31')][_0xa9c4('0x50')]){_0x315aed['include']=[{'all':!![]}];}return db[_0xa9c4('0x2b')][_0xa9c4('0x51')](_0x315aed);})['then'](function(_0x582ff1){_0x46f4e5[_0xa9c4('0x52')]=_0x582ff1;return _0x46f4e5;})[_0xa9c4('0x25')](respondWithFilteredResult(_0x3e01a4,_0x315aed))[_0xa9c4('0x53')](handleError(_0x3e01a4,null));};exports[_0xa9c4('0x54')]=function(_0x58cb0e,_0x596567){var _0x27b9b8={'raw':!![],'where':{'id':_0x58cb0e[_0xa9c4('0x55')]['id']}},_0x1a1f99={};_0x1a1f99['model']=_['keys'](db['CmHopper']['rawAttributes']);_0x1a1f99[_0xa9c4('0x31')]=_[_0xa9c4('0x30')](_0x58cb0e['query']);_0x1a1f99[_0xa9c4('0x32')]=_[_0xa9c4('0x33')](_0x1a1f99[_0xa9c4('0x2f')],_0x1a1f99['query']);_0x27b9b8['attributes']=_['intersection'](_0x1a1f99[_0xa9c4('0x2f')],qs['fields'](_0x58cb0e[_0xa9c4('0x31')][_0xa9c4('0x43')]));_0x27b9b8[_0xa9c4('0x44')]=_0x27b9b8[_0xa9c4('0x44')][_0xa9c4('0x45')]?_0x27b9b8['attributes']:_0x1a1f99[_0xa9c4('0x2f')];if(_0x58cb0e[_0xa9c4('0x31')][_0xa9c4('0x50')]){_0x27b9b8['include']=[{'all':!![]}];}_0x27b9b8=_['merge']({},_0x27b9b8,_0x58cb0e[_0xa9c4('0x4f')]);return db[_0xa9c4('0x2b')][_0xa9c4('0x56')](_0x27b9b8)[_0xa9c4('0x25')](handleEntityNotFound(_0x596567,null))[_0xa9c4('0x25')](respondWithResult(_0x596567,null))[_0xa9c4('0x53')](handleError(_0x596567,null));};exports[_0xa9c4('0x57')]=function(_0x7b3ad,_0x592e65){return db[_0xa9c4('0x2b')][_0xa9c4('0x57')](_0x7b3ad[_0xa9c4('0x58')],{})[_0xa9c4('0x25')](respondWithResult(_0x592e65,0xc9))[_0xa9c4('0x53')](handleError(_0x592e65,null));};exports[_0xa9c4('0x23')]=function(_0x1c327d,_0x25645f){if(_0x1c327d[_0xa9c4('0x58')]['id']){delete _0x1c327d[_0xa9c4('0x58')]['id'];}return db[_0xa9c4('0x2b')]['find']({'where':{'id':_0x1c327d[_0xa9c4('0x55')]['id']}})[_0xa9c4('0x25')](handleEntityNotFound(_0x25645f,null))[_0xa9c4('0x25')](saveUpdates(_0x1c327d[_0xa9c4('0x58')],null))[_0xa9c4('0x25')](respondWithResult(_0x25645f,null))[_0xa9c4('0x53')](handleError(_0x25645f,null));};exports[_0xa9c4('0x59')]=function(_0x286e15,_0x13e081){return db[_0xa9c4('0x2b')][_0xa9c4('0x59')]()[_0xa9c4('0x25')](respondWithResult(_0x13e081,null))[_0xa9c4('0x53')](handleError(_0x13e081,null));};exports[_0xa9c4('0x24')]=function(_0x45f2b4,_0x207264){var _0x41db80;return db[_0xa9c4('0x2b')]['find']({'where':{'id':_0x45f2b4[_0xa9c4('0x55')]['id']}})[_0xa9c4('0x25')](handleEntityNotFound(_0x207264,null))[_0xa9c4('0x25')](function(_0x328563){if(_0x328563){return _0x328563[_0xa9c4('0x24')]()[_0xa9c4('0x25')](function(_0x44f8c3){return _0x44f8c3;});}})['then'](function(_0x838470){_0x41db80=_0x838470;if(_0x838470){if(_0x838470['VoiceQueueId']||_0x838470[_0xa9c4('0x5a')]){return db[_0x838470[_0xa9c4('0x5b')]?_0xa9c4('0x5c'):_0xa9c4('0x5d')][_0xa9c4('0x56')]({'where':{'id':_0x838470[_0xa9c4('0x5b')]?_0x838470[_0xa9c4('0x5b')]:_0x838470['CampaignId']},'attributes':['id',_0xa9c4('0x29')],'raw':!![]});}}})[_0xa9c4('0x25')](function(_0x1e23a0){var _0x427271={};if(_0x1e23a0){_[_0xa9c4('0x4b')](_0x427271,_['omit'](_0x41db80['dataValues'],['createdAt','updatedAt','id']));_0x427271['state']=0x15;_0x427271['statedesc']='deleted';_0x427271[_0xa9c4('0x5e')]=_0x1e23a0[_0xa9c4('0x29')];_0x427271[_0xa9c4('0x5f')]=_0x45f2b4[_0xa9c4('0x60')][_0xa9c4('0x29')];_0x427271[_0xa9c4('0x61')]=_0x45f2b4[_0xa9c4('0x60')]['id'];_0x427271[_0xa9c4('0x62')]=!![];_0x427271[_0xa9c4('0x63')]=moment()['format'](_0xa9c4('0x64'));_0x427271[_0xa9c4('0x65')]=_0x41db80[_0xa9c4('0x66')];_0x427271[_0xa9c4('0x67')]=_0x41db80[_0xa9c4('0x5b')]?_0xa9c4('0x68'):_0xa9c4('0x69');return db[_0xa9c4('0x6a')]['find']({'where':{'id':_0x427271['ContactId']},'attributes':[_0xa9c4('0x6b'),_0xa9c4('0x6c')]})[_0xa9c4('0x25')](function(_0x3ca5bd){if(!_[_0xa9c4('0x6d')](_0x207264)&&!_['isNil'](_0x3ca5bd[_0xa9c4('0x6b')])){_0x427271[_0xa9c4('0x6e')]=_0x3ca5bd[_0xa9c4('0x6b')];if(!_[_0xa9c4('0x6d')](_0x3ca5bd[_0xa9c4('0x6c')])){_0x427271['calleridname']+='\x20'+_0x3ca5bd[_0xa9c4('0x6c')];}}})[_0xa9c4('0x6f')](function(){return db['CmHopperFinal']['create'](_0x427271);});}})[_0xa9c4('0x25')](function(){return _0x207264[_0xa9c4('0x1a')](0xcc)[_0xa9c4('0x19')]();})[_0xa9c4('0x53')](handleError(_0x207264,null));};exports[_0xa9c4('0x70')]=function(_0x4cd244,_0x4ed901,_0x3c2de6){var _0x257e79=[];return db[_0xa9c4('0x6a')][_0xa9c4('0x59')]()[_0xa9c4('0x25')](function(_0x9aecd8){_0x257e79=_[_0xa9c4('0x30')](_0x9aecd8);return _0x4cd244[_0xa9c4('0x60')]['getVoiceQueues']({'where':{'type':_0xa9c4('0x71'),'dialActive':!![],'dialMethod':'preview'},'attributes':['id',_0xa9c4('0x72')],'raw':!![]});})[_0xa9c4('0x25')](function(_0x1eb409){if(_0x1eb409&&_0x1eb409['length']){return db[_0xa9c4('0x73')][_0xa9c4('0x74')](function(_0x40790f){var _0x5c0ac0={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0xa9c4('0x75')](_0xa9c4('0x64'))},'VoiceQueueId':{'$in':_['map'](_0x1eb409,'id')},'$or':[{'UserId':null},{'UserId':_0x4cd244['user']['id']}]};var _0x31023a=[];if(_0x4cd244[_0xa9c4('0x58')][_0xa9c4('0x76')]&&_0x4cd244['body'][_0xa9c4('0x76')]===_0xa9c4('0x77')){if(!_['isEmpty'](_0x4cd244[_0xa9c4('0x58')][_0xa9c4('0x78')])){_0x5c0ac0['id']={'$in':_0x4cd244[_0xa9c4('0x58')]['hopperIds']};}_0x31023a=[[_0xa9c4('0x79'),_0xa9c4('0x7a')],[_0xa9c4('0x7b'),_0x1eb409[0x0]['dialOrderByScheduledAt']===_0xa9c4('0x7a')?'DESC':'ASC'],db[_0xa9c4('0x73')][_0xa9c4('0x7c')](_0xa9c4('0x7d')),['id',_0xa9c4('0x7e')]];}else{if(!_[_0xa9c4('0x7f')](_0x4cd244[_0xa9c4('0x58')][_0xa9c4('0x78')])){_0x5c0ac0['id']={'$notIn':_0x4cd244[_0xa9c4('0x58')][_0xa9c4('0x78')]};}_0x31023a=[[_0xa9c4('0x79'),'DESC'],[_0xa9c4('0x7b'),_0x1eb409[0x0][_0xa9c4('0x72')]],db['sequelize'][_0xa9c4('0x7c')](_0xa9c4('0x80')),['id',_0xa9c4('0x7a')]];}return db[_0xa9c4('0x2b')][_0xa9c4('0x81')]({'attributes':['id','scheduledat'],'where':_0x5c0ac0,'order':_0x31023a,'transaction':_0x40790f,'lock':_0x40790f['LOCK'][_0xa9c4('0x82')],'include':[{'model':db['CmContact'],'as':_0xa9c4('0x83'),'attributes':_0x257e79,'include':[{'model':db[_0xa9c4('0x84')],'as':_0xa9c4('0x85'),'attributes':['id',_0xa9c4('0x29')]}]},{'model':db['CmList'],'as':'List','attributes':['id',_0xa9c4('0x29')]},{'model':db[_0xa9c4('0x5c')],'as':_0xa9c4('0x86'),'attributes':['id',_0xa9c4('0x29'),_0xa9c4('0x87')]}]})[_0xa9c4('0x25')](function(_0x470ec3){if(_0x470ec3){return _0x470ec3['update']({'UserId':_0x4cd244[_0xa9c4('0x60')]['id']},{'transaction':_0x40790f});}});});}})[_0xa9c4('0x25')](handleEntityNotFound(_0x4ed901,null))[_0xa9c4('0x25')](respondWithResult(_0x4ed901,null))[_0xa9c4('0x53')](handleError(_0x4ed901,null));};exports[_0xa9c4('0x88')]=function(_0x23edd9,_0x516b11,_0x672a3e){return _0x23edd9['user']['getVoiceQueues']({'where':{'type':'outbound','dialActive':!![],'dialMethod':'preview'},'attributes':['id'],'raw':!![]})[_0xa9c4('0x25')](function(_0x445770){if(_0x445770&&_0x445770[_0xa9c4('0x45')]){return db[_0xa9c4('0x2b')][_0xa9c4('0x1c')]({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0xa9c4('0x75')](_0xa9c4('0x64'))},'VoiceQueueId':{'$in':_[_0xa9c4('0x2a')](_0x445770,'id')},'$or':[{'UserId':null},{'UserId':_0x23edd9[_0xa9c4('0x60')]['id']}]}});}return 0x0;})['then'](function(_0x3e6e09){if(!_[_0xa9c4('0x6d')](_0x3e6e09)&&_[_0xa9c4('0x89')](_0x3e6e09)){return _0x516b11[_0xa9c4('0x1a')](0xc8)[_0xa9c4('0x1b')]({'contacts':_0x3e6e09});}else{logger['error'](_0xa9c4('0x8a'),_0xa9c4('0x88'),0x194,_0xa9c4('0x8b'));_0x516b11[_0xa9c4('0x26')](0x194);}})['catch'](handleError(_0x516b11,null));};exports[_0xa9c4('0x8c')]=function(_0x11299d,_0x5d373d,_0x48d300){var _0x45905c=shared[_0xa9c4('0x8d')];var _0x192e10=[];_[_0xa9c4('0x2a')](_0x45905c,function(_0x49d57c){_0x192e10['push']({'id':_0x49d57c[_0xa9c4('0x29')],'name':_0x49d57c[_0xa9c4('0x29')],'utcOffset':_0x49d57c[_0xa9c4('0x8e')]});});return _0x5d373d['status'](0xc8)['json']({'tz':_0x192e10});};exports['getTimezone']=function(_0x4ee662,_0x5494ba,_0x1a1b15){var _0x5c1bcf=shared[_0xa9c4('0x8d')];var _0x11747d={};if(!_['isNil'](_0x5c1bcf[_0x4ee662[_0xa9c4('0x58')]['id']]))_0x11747d=_0x5c1bcf[_0x4ee662[_0xa9c4('0x58')]['id']];return _0x5494ba['status'](0xc8)['json'](_0x11747d);};
\ No newline at end of file
+var _0x1e48=['DESC','literal','COALESCE(CmHopper.UserId,\x200)\x20ASC','COALESCE(CmHopper.UserId,\x200)\x20DESC','LOCK','Contact','CmCompany','CmList','List','Queue','dialActive','CmHopper,\x20%s,\x20%s,\x20%s','getOpenContacts','entity\x20not\x20found','getTimezones','timezones','push','utcOffset','getTimezone','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','util','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../config/environment','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../mysqldb','sendStatus','status','end','json','offset','limit','Content-Range','apply','reject','save','update','then','destroy','error','name','send','map','CmHopper','rawAttributes','fieldName','type','key','model','query','keys','filters','$and','$or','$gt','$gte','$lte','$ne','$eq','$between','$notBetween','$in','$notIn','$like','$notLike','$iLike','$overlap','$contains','$any','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','count','includeAll','include','findAll','show','params','length','options','find','catch','body','describe','VoiceQueueId','CampaignId','VoiceQueue','Campaign','createdAt','state','statedesc','deleted','membername','user','UserId','format','YYYY-MM-DD\x20HH:mm:ss','calleridnum','phone','campaigntype','ivr','CmContact','ContactId','firstName','lastName','isNil','calleridname','CmHopperFinal','getPreview','getVoiceQueues','outbound','preview','sequelize','transaction','direction','prev','hopperIds','priority','scheduledAt','dialOrderByScheduledAt','ASC'];(function(_0x19cfe5,_0x4d1bcf){var _0x15b837=function(_0x2552e4){while(--_0x2552e4){_0x19cfe5['push'](_0x19cfe5['shift']());}};_0x15b837(++_0x4d1bcf);}(_0x1e48,0x139));var _0x81e4=function(_0x2577d9,_0x8f2f28){_0x2577d9=_0x2577d9-0x0;var _0x36fe58=_0x1e48[_0x2577d9];return _0x36fe58;};'use strict';var pdf=require(_0x81e4('0x0'));var emlformat=require(_0x81e4('0x1'));var rimraf=require(_0x81e4('0x2'));var zipdir=require(_0x81e4('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x81e4('0x4'));var moment=require(_0x81e4('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x81e4('0x6'));var path=require('path');var sox=require(_0x81e4('0x7'));var csv=require(_0x81e4('0x8'));var ejs=require(_0x81e4('0x9'));var fs=require('fs');var _=require(_0x81e4('0xa'));var squel=require(_0x81e4('0xb'));var crypto=require('crypto');var jsforce=require(_0x81e4('0xc'));var deskjs=require(_0x81e4('0xd'));var toCsv=require('to-csv');var querystring=require(_0x81e4('0xe'));var Papa=require(_0x81e4('0xf'));var Redis=require(_0x81e4('0x10'));var shared=require(_0x81e4('0x11'));var authService=require(_0x81e4('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x81e4('0x13'));var hardwareService=require(_0x81e4('0x14'));var logger=require(_0x81e4('0x15'))(_0x81e4('0x16'));var utils=require('../../config/utils');var config=require(_0x81e4('0x11'));var db=require(_0x81e4('0x17'))['db'];function respondWithStatusCode(_0x427c30,_0x2534bf){_0x2534bf=_0x2534bf||0xcc;return function(_0x54ae2a){if(_0x54ae2a){return _0x427c30[_0x81e4('0x18')](_0x2534bf);}return _0x427c30[_0x81e4('0x19')](_0x2534bf)[_0x81e4('0x1a')]();};}function respondWithResult(_0x513799,_0xe62da0){_0xe62da0=_0xe62da0||0xc8;return function(_0x12b644){if(_0x12b644){return _0x513799[_0x81e4('0x19')](_0xe62da0)[_0x81e4('0x1b')](_0x12b644);}};}function respondWithFilteredResult(_0x20cede,_0x54aaef){return function(_0x3799f2){if(_0x3799f2){var _0x5ae8a1=_0x3799f2['count'],_0x567c1f=_0x54aaef[_0x81e4('0x1c')],_0x2bbb8f=_0x54aaef[_0x81e4('0x1c')]+_0x54aaef[_0x81e4('0x1d')],_0x27df22;if(_0x2bbb8f>=_0x5ae8a1){_0x2bbb8f=_0x5ae8a1;_0x27df22=0xc8;}else{_0x27df22=0xce;}_0x20cede[_0x81e4('0x19')](_0x27df22);return _0x20cede['set'](_0x81e4('0x1e'),_0x567c1f+'-'+_0x2bbb8f+'/'+_0x5ae8a1)[_0x81e4('0x1b')](_0x3799f2);}return null;};}function patchUpdates(_0x353d2c){return function(_0x599931){try{jsonpatch[_0x81e4('0x1f')](_0x599931,_0x353d2c,!![]);}catch(_0x20edb2){return BPromise[_0x81e4('0x20')](_0x20edb2);}return _0x599931[_0x81e4('0x21')]();};}function saveUpdates(_0x28060c,_0x2f9685){return function(_0xade65){if(_0xade65){return _0xade65[_0x81e4('0x22')](_0x28060c)[_0x81e4('0x23')](function(_0x356e2f){return _0x356e2f;});}return null;};}function removeEntity(_0x2f0446,_0x2f2db9){return function(_0x2e2888){if(_0x2e2888){return _0x2e2888[_0x81e4('0x24')]()[_0x81e4('0x23')](function(){_0x2f0446[_0x81e4('0x19')](0xcc)[_0x81e4('0x1a')]();});}};}function handleEntityNotFound(_0x191670,_0x203a90){return function(_0x15ec26){if(!_0x15ec26){_0x191670[_0x81e4('0x18')](0x194);}return _0x15ec26;};}function handleError(_0x17f23e,_0x3d0522){_0x3d0522=_0x3d0522||0x1f4;return function(_0xb6acd5){logger[_0x81e4('0x25')](_0xb6acd5['stack']);if(_0xb6acd5[_0x81e4('0x26')]){delete _0xb6acd5['name'];}_0x17f23e['status'](_0x3d0522)[_0x81e4('0x27')](_0xb6acd5);};}exports['index']=function(_0x460a8f,_0x5f244d){var _0xc397f2={},_0x4f95d0={},_0x306a7b={'count':0x0,'rows':[]};var _0x576bfd=_[_0x81e4('0x28')](db[_0x81e4('0x29')][_0x81e4('0x2a')],function(_0x538759){return{'name':_0x538759[_0x81e4('0x2b')],'type':_0x538759[_0x81e4('0x2c')][_0x81e4('0x2d')]};});_0x4f95d0[_0x81e4('0x2e')]=_[_0x81e4('0x28')](_0x576bfd,_0x81e4('0x26'));_0x4f95d0[_0x81e4('0x2f')]=_[_0x81e4('0x30')](_0x460a8f[_0x81e4('0x2f')]);_0x4f95d0[_0x81e4('0x31')]=_['intersection'](_0x4f95d0[_0x81e4('0x2e')],_0x4f95d0[_0x81e4('0x2f')]);_0x4f95d0[_0x81e4('0x31')]=_['concat'](_0x4f95d0[_0x81e4('0x31')],[_0x81e4('0x32'),_0x81e4('0x33'),_0x81e4('0x34'),_0x81e4('0x35'),'$lt',_0x81e4('0x36'),_0x81e4('0x37'),_0x81e4('0x38'),'$not',_0x81e4('0x39'),_0x81e4('0x3a'),_0x81e4('0x3b'),_0x81e4('0x3c'),_0x81e4('0x3d'),_0x81e4('0x3e'),_0x81e4('0x3f'),'$notILike',_0x81e4('0x3d'),_0x81e4('0x40'),_0x81e4('0x41'),'$contained',_0x81e4('0x42')]);_0xc397f2[_0x81e4('0x43')]=_[_0x81e4('0x44')](_0x4f95d0[_0x81e4('0x2e')],qs[_0x81e4('0x45')](_0x460a8f[_0x81e4('0x2f')][_0x81e4('0x45')]));_0xc397f2[_0x81e4('0x43')]=_0xc397f2[_0x81e4('0x43')]['length']?_0xc397f2[_0x81e4('0x43')]:_0x4f95d0[_0x81e4('0x2e')];if(!_0x460a8f[_0x81e4('0x2f')][_0x81e4('0x46')](_0x81e4('0x47'))){_0xc397f2[_0x81e4('0x1d')]=qs['limit'](_0x460a8f[_0x81e4('0x2f')][_0x81e4('0x1d')]);_0xc397f2[_0x81e4('0x1c')]=qs[_0x81e4('0x1c')](_0x460a8f[_0x81e4('0x2f')][_0x81e4('0x1c')]);}_0xc397f2[_0x81e4('0x48')]=qs['sort'](_0x460a8f['query'][_0x81e4('0x49')]);_0xc397f2[_0x81e4('0x4a')]=qs['filters'](_[_0x81e4('0x4b')](_0x460a8f[_0x81e4('0x2f')],_0x4f95d0['filters']),_0x576bfd);if(_0x460a8f['query']['filter']){_0xc397f2[_0x81e4('0x4a')]=_[_0x81e4('0x4c')](_0xc397f2['where'],{'$or':_['map'](_0x576bfd,function(_0x996612){if(_0x996612['type']!==_0x81e4('0x4d')){var _0x34b525={};_0x34b525[_0x996612[_0x81e4('0x26')]]={'$like':'%'+_0x460a8f['query'][_0x81e4('0x4e')]+'%'};return _0x34b525;}})});}_0xc397f2=_[_0x81e4('0x4c')]({},_0xc397f2,_0x460a8f['options']);var _0x407cc8={'where':_0xc397f2[_0x81e4('0x4a')]};return db[_0x81e4('0x29')]['count'](_0x407cc8)[_0x81e4('0x23')](function(_0x1ba2e5){_0x306a7b[_0x81e4('0x4f')]=_0x1ba2e5;if(_0x460a8f[_0x81e4('0x2f')][_0x81e4('0x50')]){_0xc397f2[_0x81e4('0x51')]=[{'all':!![]}];}return db[_0x81e4('0x29')][_0x81e4('0x52')](_0xc397f2);})[_0x81e4('0x23')](function(_0x395a1e){_0x306a7b['rows']=_0x395a1e;return _0x306a7b;})['then'](respondWithFilteredResult(_0x5f244d,_0xc397f2))['catch'](handleError(_0x5f244d,null));};exports[_0x81e4('0x53')]=function(_0x2d9b8b,_0x593aad){var _0x1a6776={'raw':!![],'where':{'id':_0x2d9b8b[_0x81e4('0x54')]['id']}},_0xb990ac={};_0xb990ac[_0x81e4('0x2e')]=_[_0x81e4('0x30')](db['CmHopper']['rawAttributes']);_0xb990ac[_0x81e4('0x2f')]=_['keys'](_0x2d9b8b['query']);_0xb990ac[_0x81e4('0x31')]=_[_0x81e4('0x44')](_0xb990ac['model'],_0xb990ac['query']);_0x1a6776[_0x81e4('0x43')]=_['intersection'](_0xb990ac[_0x81e4('0x2e')],qs['fields'](_0x2d9b8b[_0x81e4('0x2f')][_0x81e4('0x45')]));_0x1a6776['attributes']=_0x1a6776[_0x81e4('0x43')][_0x81e4('0x55')]?_0x1a6776[_0x81e4('0x43')]:_0xb990ac[_0x81e4('0x2e')];if(_0x2d9b8b[_0x81e4('0x2f')]['includeAll']){_0x1a6776[_0x81e4('0x51')]=[{'all':!![]}];}_0x1a6776=_[_0x81e4('0x4c')]({},_0x1a6776,_0x2d9b8b[_0x81e4('0x56')]);return db[_0x81e4('0x29')][_0x81e4('0x57')](_0x1a6776)['then'](handleEntityNotFound(_0x593aad,null))[_0x81e4('0x23')](respondWithResult(_0x593aad,null))[_0x81e4('0x58')](handleError(_0x593aad,null));};exports['create']=function(_0x3fcd09,_0x1cba91){return db[_0x81e4('0x29')]['create'](_0x3fcd09['body'],{})[_0x81e4('0x23')](respondWithResult(_0x1cba91,0xc9))['catch'](handleError(_0x1cba91,null));};exports[_0x81e4('0x22')]=function(_0x3f3e45,_0x23a786){if(_0x3f3e45[_0x81e4('0x59')]['id']){delete _0x3f3e45[_0x81e4('0x59')]['id'];}return db[_0x81e4('0x29')][_0x81e4('0x57')]({'where':{'id':_0x3f3e45[_0x81e4('0x54')]['id']}})[_0x81e4('0x23')](handleEntityNotFound(_0x23a786,null))['then'](saveUpdates(_0x3f3e45[_0x81e4('0x59')],null))[_0x81e4('0x23')](respondWithResult(_0x23a786,null))['catch'](handleError(_0x23a786,null));};exports[_0x81e4('0x5a')]=function(_0x561cb3,_0xefd250){return db['CmHopper']['describe']()[_0x81e4('0x23')](respondWithResult(_0xefd250,null))[_0x81e4('0x58')](handleError(_0xefd250,null));};exports[_0x81e4('0x24')]=function(_0x2cbc41,_0x4aa2cf){var _0x4bc8fe;return db['CmHopper'][_0x81e4('0x57')]({'where':{'id':_0x2cbc41[_0x81e4('0x54')]['id']}})[_0x81e4('0x23')](handleEntityNotFound(_0x4aa2cf,null))[_0x81e4('0x23')](function(_0x386a6f){if(_0x386a6f){return _0x386a6f[_0x81e4('0x24')]()[_0x81e4('0x23')](function(_0x147042){return _0x147042;});}})[_0x81e4('0x23')](function(_0x423fd6){_0x4bc8fe=_0x423fd6;if(_0x423fd6){if(_0x423fd6[_0x81e4('0x5b')]||_0x423fd6[_0x81e4('0x5c')]){return db[_0x423fd6['VoiceQueueId']?_0x81e4('0x5d'):_0x81e4('0x5e')]['find']({'where':{'id':_0x423fd6[_0x81e4('0x5b')]?_0x423fd6[_0x81e4('0x5b')]:_0x423fd6[_0x81e4('0x5c')]},'attributes':['id',_0x81e4('0x26')],'raw':!![]});}}})[_0x81e4('0x23')](function(_0x5790d4){var _0x3f47d4={};if(_0x5790d4){_[_0x81e4('0x4c')](_0x3f47d4,_['omit'](_0x4bc8fe['dataValues'],[_0x81e4('0x5f'),'updatedAt','id']));_0x3f47d4[_0x81e4('0x60')]=0x15;_0x3f47d4[_0x81e4('0x61')]=_0x81e4('0x62');_0x3f47d4['campaign']=_0x5790d4[_0x81e4('0x26')];_0x3f47d4[_0x81e4('0x63')]=_0x2cbc41[_0x81e4('0x64')][_0x81e4('0x26')];_0x3f47d4[_0x81e4('0x65')]=_0x2cbc41['user']['id'];_0x3f47d4[_0x81e4('0x62')]=!![];_0x3f47d4['deletedat']=moment()[_0x81e4('0x66')](_0x81e4('0x67'));_0x3f47d4[_0x81e4('0x68')]=_0x4bc8fe[_0x81e4('0x69')];_0x3f47d4[_0x81e4('0x6a')]=_0x4bc8fe[_0x81e4('0x5b')]?'queue':_0x81e4('0x6b');return db[_0x81e4('0x6c')][_0x81e4('0x57')]({'where':{'id':_0x3f47d4[_0x81e4('0x6d')]},'attributes':[_0x81e4('0x6e'),_0x81e4('0x6f')]})[_0x81e4('0x23')](function(_0x161920){if(!_[_0x81e4('0x70')](_0x4aa2cf)&&!_['isNil'](_0x161920[_0x81e4('0x6e')])){_0x3f47d4[_0x81e4('0x71')]=_0x161920[_0x81e4('0x6e')];if(!_[_0x81e4('0x70')](_0x161920['lastName'])){_0x3f47d4[_0x81e4('0x71')]+='\x20'+_0x161920[_0x81e4('0x6f')];}}})['finally'](function(){return db[_0x81e4('0x72')]['create'](_0x3f47d4);});}})[_0x81e4('0x23')](function(){return _0x4aa2cf[_0x81e4('0x19')](0xcc)[_0x81e4('0x1a')]();})[_0x81e4('0x58')](handleError(_0x4aa2cf,null));};exports[_0x81e4('0x73')]=function(_0x49d2f8,_0x3a8e85,_0xdf6f44){var _0x3b7193=[];return db[_0x81e4('0x6c')][_0x81e4('0x5a')]()[_0x81e4('0x23')](function(_0x37d5f7){_0x3b7193=_[_0x81e4('0x30')](_0x37d5f7);return _0x49d2f8[_0x81e4('0x64')][_0x81e4('0x74')]({'where':{'type':_0x81e4('0x75'),'dialActive':!![],'dialMethod':_0x81e4('0x76')},'attributes':['id','dialOrderByScheduledAt'],'raw':!![]});})[_0x81e4('0x23')](function(_0x4e0d30){if(_0x4e0d30&&_0x4e0d30['length']){return db[_0x81e4('0x77')][_0x81e4('0x78')](function(_0x508262){var _0x516a3e={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x81e4('0x66')](_0x81e4('0x67'))},'VoiceQueueId':{'$in':_[_0x81e4('0x28')](_0x4e0d30,'id')},'$or':[{'UserId':null},{'UserId':_0x49d2f8[_0x81e4('0x64')]['id']}]};var _0x121ef3=[];if(_0x49d2f8[_0x81e4('0x59')][_0x81e4('0x79')]&&_0x49d2f8[_0x81e4('0x59')][_0x81e4('0x79')]===_0x81e4('0x7a')){if(!_['isEmpty'](_0x49d2f8[_0x81e4('0x59')]['hopperIds'])){_0x516a3e['id']={'$in':_0x49d2f8[_0x81e4('0x59')][_0x81e4('0x7b')]};}_0x121ef3=[[_0x81e4('0x7c'),'ASC'],[_0x81e4('0x7d'),_0x4e0d30[0x0][_0x81e4('0x7e')]===_0x81e4('0x7f')?_0x81e4('0x80'):'ASC'],db[_0x81e4('0x77')][_0x81e4('0x81')](_0x81e4('0x82')),['id',_0x81e4('0x80')]];}else{if(!_['isEmpty'](_0x49d2f8[_0x81e4('0x59')]['hopperIds'])){_0x516a3e['id']={'$notIn':_0x49d2f8['body'][_0x81e4('0x7b')]};}_0x121ef3=[['priority','DESC'],[_0x81e4('0x7d'),_0x4e0d30[0x0]['dialOrderByScheduledAt']],db[_0x81e4('0x77')]['literal'](_0x81e4('0x83')),['id',_0x81e4('0x7f')]];}return db[_0x81e4('0x29')]['findOne']({'attributes':['id','scheduledat'],'where':_0x516a3e,'order':_0x121ef3,'transaction':_0x508262,'lock':_0x508262[_0x81e4('0x84')]['UPDATE'],'include':[{'model':db[_0x81e4('0x6c')],'as':_0x81e4('0x85'),'attributes':_0x3b7193,'include':[{'model':db[_0x81e4('0x86')],'as':'Company','attributes':['id',_0x81e4('0x26')]}]},{'model':db[_0x81e4('0x87')],'as':_0x81e4('0x88'),'attributes':['id',_0x81e4('0x26')]},{'model':db['VoiceQueue'],'as':_0x81e4('0x89'),'attributes':['id',_0x81e4('0x26'),_0x81e4('0x8a')]}]})[_0x81e4('0x23')](function(_0x38fbd3){if(_0x38fbd3){return _0x38fbd3['update']({'UserId':_0x49d2f8[_0x81e4('0x64')]['id']},{'transaction':_0x508262});}});});}})[_0x81e4('0x23')](handleEntityNotFound(_0x3a8e85,null))[_0x81e4('0x23')](respondWithResult(_0x3a8e85,null))['catch'](handleError(_0x3a8e85,null));};exports['getOpenContacts']=function(_0x968057,_0x342688,_0x4e509f){return _0x968057[_0x81e4('0x64')][_0x81e4('0x74')]({'where':{'type':_0x81e4('0x75'),'dialActive':!![],'dialMethod':'preview'},'attributes':['id'],'raw':!![]})['then'](function(_0xd6bf78){if(_0xd6bf78&&_0xd6bf78[_0x81e4('0x55')]){return db[_0x81e4('0x29')][_0x81e4('0x4f')]({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x81e4('0x66')]('YYYY-MM-DD\x20HH:mm:ss')},'VoiceQueueId':{'$in':_[_0x81e4('0x28')](_0xd6bf78,'id')},'$or':[{'UserId':null},{'UserId':_0x968057['user']['id']}]}});}return 0x0;})[_0x81e4('0x23')](function(_0x29033f){if(!_['isNil'](_0x29033f)&&_['isNumber'](_0x29033f)){return _0x342688[_0x81e4('0x19')](0xc8)[_0x81e4('0x1b')]({'contacts':_0x29033f});}else{logger['error'](_0x81e4('0x8b'),_0x81e4('0x8c'),0x194,_0x81e4('0x8d'));_0x342688[_0x81e4('0x18')](0x194);}})[_0x81e4('0x58')](handleError(_0x342688,null));};exports[_0x81e4('0x8e')]=function(_0x4263d3,_0x32c868,_0x19ebcf){var _0x815c97=shared[_0x81e4('0x8f')];var _0x41258d=[];_[_0x81e4('0x28')](_0x815c97,function(_0x8151f9){_0x41258d[_0x81e4('0x90')]({'id':_0x8151f9[_0x81e4('0x26')],'name':_0x8151f9['name'],'utcOffset':_0x8151f9[_0x81e4('0x91')]});});return _0x32c868[_0x81e4('0x19')](0xc8)['json']({'tz':_0x41258d});};exports[_0x81e4('0x92')]=function(_0x2b25ac,_0x853515,_0x43da34){var _0x1db70d=shared[_0x81e4('0x8f')];var _0x2cce6f={};if(!_[_0x81e4('0x70')](_0x1db70d[_0x2b25ac['body']['id']]))_0x2cce6f=_0x1db70d[_0x2b25ac[_0x81e4('0x59')]['id']];return _0x853515['status'](0xc8)[_0x81e4('0x1b')](_0x2cce6f);};
\ No newline at end of file
diff --git a/server/api/cmHopper/cmHopper.model.js b/server/api/cmHopper/cmHopper.model.js
index 3277790..af8e082 100644
--- a/server/api/cmHopper/cmHopper.model.js
+++ b/server/api/cmHopper/cmHopper.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xa7bd=['moment','bluebird','path','../../config/environment','./cmHopper.attributes','exports','define','CmHopper','cm_hopper','scheduledat','priority','lodash','util','../../config/logger','api'];(function(_0x1d6f75,_0x22ff41){var _0x1db40f=function(_0x140b82){while(--_0x140b82){_0x1d6f75['push'](_0x1d6f75['shift']());}};_0x1db40f(++_0x22ff41);}(_0xa7bd,0xdd));var _0xda7b=function(_0x2bc1fe,_0x45da98){_0x2bc1fe=_0x2bc1fe-0x0;var _0x1a47a5=_0xa7bd[_0x2bc1fe];return _0x1a47a5;};'use strict';var _=require(_0xda7b('0x0'));var util=require(_0xda7b('0x1'));var logger=require(_0xda7b('0x2'))(_0xda7b('0x3'));var moment=require(_0xda7b('0x4'));var BPromise=require(_0xda7b('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xda7b('0x6'));var rimraf=require('rimraf');var config=require(_0xda7b('0x7'));var attributes=require(_0xda7b('0x8'));module[_0xda7b('0x9')]=function(_0x128564,_0x454703){return _0x128564[_0xda7b('0xa')](_0xda7b('0xb'),attributes,{'tableName':_0xda7b('0xc'),'paranoid':![],'indexes':[{'name':_0xda7b('0xd'),'fields':['scheduledat']},{'name':'phone','fields':['phone']},{'name':_0xda7b('0xe'),'fields':[_0xda7b('0xe')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x7e15=['exports','CmHopper','cm_hopper','scheduledat','phone','priority','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cmHopper.attributes'];(function(_0x29d312,_0x951117){var _0x1fe04b=function(_0x26e53b){while(--_0x26e53b){_0x29d312['push'](_0x29d312['shift']());}};_0x1fe04b(++_0x951117);}(_0x7e15,0x138));var _0x57e1=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x7e15[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x57e1('0x0'));var util=require(_0x57e1('0x1'));var logger=require(_0x57e1('0x2'))(_0x57e1('0x3'));var moment=require(_0x57e1('0x4'));var BPromise=require(_0x57e1('0x5'));var rp=require(_0x57e1('0x6'));var fs=require('fs');var path=require(_0x57e1('0x7'));var rimraf=require(_0x57e1('0x8'));var config=require(_0x57e1('0x9'));var attributes=require(_0x57e1('0xa'));module[_0x57e1('0xb')]=function(_0xc36303,_0x4b9c1c){return _0xc36303['define'](_0x57e1('0xc'),attributes,{'tableName':_0x57e1('0xd'),'paranoid':![],'indexes':[{'name':_0x57e1('0xe'),'fields':['scheduledat']},{'name':_0x57e1('0xf'),'fields':[_0x57e1('0xf')]},{'name':'priority','fields':[_0x57e1('0x10')]}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/cmHopper/cmHopper.rpc.js b/server/api/cmHopper/cmHopper.rpc.js
index 5aacdfe..c63ceab 100644
--- a/server/api/cmHopper/cmHopper.rpc.js
+++ b/server/api/cmHopper/cmHopper.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x0c60=['push','UserId','all','MoveContactManagedDialer','CmHopperFinal','CountReScheduled','COUNT','literal','format','\x20,\x201,\x20null','contactsRescheduled','LOCK','length','GetContactRecallMe','lodash','moment','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','client','http','request','then','info','CmHopper,\x20%s,\x20%s','request\x20sent','debug','CmHopper,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','GetCmHopper','CmHopper','findAll','options','attributes','limit','map','include','model','catch','ShowCmHopper','find','raw','where','CreateCmHopper','create','body','UpdateCmHopper','update','DestroyCmHopper','destroy','GetContactDialer','CmContact','describe','sequelize','transaction','order','UPDATE','User','name','voicePause','includes'];(function(_0x5865b6,_0x3caea1){var _0x4b8ba8=function(_0x8b9aa3){while(--_0x8b9aa3){_0x5865b6['push'](_0x5865b6['shift']());}};_0x4b8ba8(++_0x3caea1);}(_0x0c60,0x11a));var _0x00c6=function(_0x76c5d6,_0x2ebbf8){_0x76c5d6=_0x76c5d6-0x0;var _0x5cc18c=_0x0c60[_0x76c5d6];return _0x5cc18c;};'use strict';var _=require(_0x00c6('0x0'));var util=require('util');var moment=require(_0x00c6('0x1'));var BPromise=require('bluebird');var rs=require(_0x00c6('0x2'));var fs=require('fs');var Redis=require(_0x00c6('0x3'));var db=require(_0x00c6('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x00c6('0x5'));var config=require(_0x00c6('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x00c6('0x7')][_0x00c6('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x15485d,_0x326800,_0x24a7af){return new BPromise(function(_0x10e338,_0x54f853){return client[_0x00c6('0x9')](_0x15485d,_0x24a7af)[_0x00c6('0xa')](function(_0x45e332){logger[_0x00c6('0xb')](_0x00c6('0xc'),_0x326800,_0x00c6('0xd'));logger[_0x00c6('0xe')](_0x00c6('0xf'),_0x326800,_0x00c6('0xd'),JSON[_0x00c6('0x10')](_0x45e332));if(_0x45e332[_0x00c6('0x11')]){if(_0x45e332[_0x00c6('0x11')][_0x00c6('0x12')]===0x1f4){logger[_0x00c6('0x11')](_0x00c6('0xc'),_0x326800,_0x45e332[_0x00c6('0x11')][_0x00c6('0x13')]);return _0x54f853(_0x45e332['error'][_0x00c6('0x13')]);}logger[_0x00c6('0x11')](_0x00c6('0xc'),_0x326800,_0x45e332[_0x00c6('0x11')][_0x00c6('0x13')]);return _0x10e338(_0x45e332[_0x00c6('0x11')]['message']);}else{logger[_0x00c6('0xb')](_0x00c6('0xc'),_0x326800,_0x00c6('0xd'));_0x10e338(_0x45e332[_0x00c6('0x14')][_0x00c6('0x13')]);}})['catch'](function(_0x7d2cca){logger[_0x00c6('0x11')](_0x00c6('0xc'),_0x326800,_0x7d2cca);_0x54f853(_0x7d2cca);});});}exports[_0x00c6('0x15')]=function(_0x2bd577){var _0x59702b=this;return new Promise(function(_0x3c9ce9,_0x43c97c){return db[_0x00c6('0x16')][_0x00c6('0x17')]({'raw':_0x2bd577['options']?_0x2bd577[_0x00c6('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x2bd577[_0x00c6('0x18')]?_0x2bd577[_0x00c6('0x18')]['where']||null:null,'attributes':_0x2bd577[_0x00c6('0x18')]?_0x2bd577[_0x00c6('0x18')][_0x00c6('0x19')]||null:null,'limit':_0x2bd577[_0x00c6('0x18')]?_0x2bd577[_0x00c6('0x18')][_0x00c6('0x1a')]||null:null,'include':_0x2bd577[_0x00c6('0x18')]?_0x2bd577[_0x00c6('0x18')]['include']?_[_0x00c6('0x1b')](_0x2bd577[_0x00c6('0x18')][_0x00c6('0x1c')],function(_0x13c931){return{'model':db[_0x13c931[_0x00c6('0x1d')]],'as':_0x13c931['as'],'attributes':_0x13c931['attributes'],'include':_0x13c931[_0x00c6('0x1c')]?_[_0x00c6('0x1b')](_0x13c931[_0x00c6('0x1c')],function(_0x914187){return{'model':db[_0x914187['model']],'as':_0x914187['as'],'attributes':_0x914187['attributes'],'include':_0x914187['include']?_[_0x00c6('0x1b')](_0x914187[_0x00c6('0x1c')],function(_0x351b23){return{'model':db[_0x351b23[_0x00c6('0x1d')]],'as':_0x351b23['as'],'attributes':_0x351b23[_0x00c6('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x56a6cb){logger[_0x00c6('0xb')](_0x00c6('0x15'),_0x2bd577);logger[_0x00c6('0xe')]('GetCmHopper',_0x2bd577,JSON[_0x00c6('0x10')](_0x56a6cb));_0x3c9ce9(_0x56a6cb);})[_0x00c6('0x1e')](function(_0x5ccbd9){logger[_0x00c6('0x11')]('GetCmHopper',_0x5ccbd9['message'],_0x2bd577);_0x43c97c(_0x59702b[_0x00c6('0x11')](0x1f4,_0x5ccbd9['message']));});});};exports[_0x00c6('0x1f')]=function(_0x10c97e){var _0x2db31c=this;return new Promise(function(_0x527a7e,_0x2229d3){return db[_0x00c6('0x16')][_0x00c6('0x20')]({'raw':_0x10c97e[_0x00c6('0x18')]?_0x10c97e['options'][_0x00c6('0x21')]===undefined?!![]:![]:!![],'where':_0x10c97e[_0x00c6('0x18')]?_0x10c97e[_0x00c6('0x18')][_0x00c6('0x22')]||null:null,'attributes':_0x10c97e[_0x00c6('0x18')]?_0x10c97e[_0x00c6('0x18')]['attributes']||null:null,'include':_0x10c97e['options']?_0x10c97e[_0x00c6('0x18')][_0x00c6('0x1c')]?_[_0x00c6('0x1b')](_0x10c97e[_0x00c6('0x18')][_0x00c6('0x1c')],function(_0x5cd4b2){return{'model':db[_0x5cd4b2['model']],'as':_0x5cd4b2['as'],'attributes':_0x5cd4b2[_0x00c6('0x19')],'include':_0x5cd4b2[_0x00c6('0x1c')]?_[_0x00c6('0x1b')](_0x5cd4b2[_0x00c6('0x1c')],function(_0x2d01cb){return{'model':db[_0x2d01cb[_0x00c6('0x1d')]],'as':_0x2d01cb['as'],'attributes':_0x2d01cb['attributes'],'include':_0x2d01cb[_0x00c6('0x1c')]?_['map'](_0x2d01cb[_0x00c6('0x1c')],function(_0x20442b){return{'model':db[_0x20442b[_0x00c6('0x1d')]],'as':_0x20442b['as'],'attributes':_0x20442b[_0x00c6('0x19')]};}):[]};}):[]};}):[]:[]})[_0x00c6('0xa')](function(_0x645007){logger['info'](_0x00c6('0x1f'),_0x10c97e);logger[_0x00c6('0xe')](_0x00c6('0x1f'),_0x10c97e,JSON['stringify'](_0x645007));_0x527a7e(_0x645007);})[_0x00c6('0x1e')](function(_0x13ffbd){logger[_0x00c6('0x11')](_0x00c6('0x1f'),_0x13ffbd['message'],_0x10c97e);_0x2229d3(_0x2db31c[_0x00c6('0x11')](0x1f4,_0x13ffbd[_0x00c6('0x13')]));});});};exports[_0x00c6('0x23')]=function(_0x42ec1b){var _0x4f0a1b=this;return new Promise(function(_0x22be54,_0x31f8fd){return db['CmHopper'][_0x00c6('0x24')](_0x42ec1b[_0x00c6('0x25')],{'raw':_0x42ec1b[_0x00c6('0x18')]?_0x42ec1b[_0x00c6('0x18')][_0x00c6('0x21')]===undefined?!![]:![]:!![]})[_0x00c6('0xa')](function(_0x4c115e){logger[_0x00c6('0xb')](_0x00c6('0x23'),_0x42ec1b);logger['debug'](_0x00c6('0x23'),_0x42ec1b,JSON[_0x00c6('0x10')](_0x4c115e));_0x22be54(_0x4c115e);})[_0x00c6('0x1e')](function(_0x4eefad){logger[_0x00c6('0x11')](_0x00c6('0x23'),_0x4eefad['message'],_0x42ec1b);_0x31f8fd(_0x4f0a1b[_0x00c6('0x11')](0x1f4,_0x4eefad[_0x00c6('0x13')]));});});};exports[_0x00c6('0x26')]=function(_0x3060f3){var _0x53fdd9=this;return new Promise(function(_0x2cb4ed,_0x8c202f){return db[_0x00c6('0x16')][_0x00c6('0x27')](_0x3060f3[_0x00c6('0x25')],{'raw':_0x3060f3[_0x00c6('0x18')]?_0x3060f3[_0x00c6('0x18')][_0x00c6('0x21')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3060f3[_0x00c6('0x18')]?_0x3060f3[_0x00c6('0x18')][_0x00c6('0x22')]||null:null,'attributes':_0x3060f3[_0x00c6('0x18')]?_0x3060f3[_0x00c6('0x18')][_0x00c6('0x19')]||null:null,'limit':_0x3060f3[_0x00c6('0x18')]?_0x3060f3['options'][_0x00c6('0x1a')]||null:null})[_0x00c6('0xa')](function(_0x50bf5a){logger[_0x00c6('0xb')](_0x00c6('0x26'),_0x3060f3);logger[_0x00c6('0xe')]('UpdateCmHopper',_0x3060f3,JSON['stringify'](_0x50bf5a));_0x2cb4ed(_0x50bf5a);})['catch'](function(_0x41a2a5){logger[_0x00c6('0x11')](_0x00c6('0x26'),_0x41a2a5[_0x00c6('0x13')],_0x3060f3);_0x8c202f(_0x53fdd9['error'](0x1f4,_0x41a2a5['message']));});});};exports[_0x00c6('0x28')]=function(_0x4e98f8){var _0x2859d4=this;return new Promise(function(_0x17cf27,_0x4eb823){return db[_0x00c6('0x16')][_0x00c6('0x29')]({'where':_0x4e98f8[_0x00c6('0x18')]?_0x4e98f8['options'][_0x00c6('0x22')]||null:null})[_0x00c6('0xa')](function(_0x20ae0b){logger[_0x00c6('0xb')](_0x00c6('0x28'),_0x4e98f8);logger['debug'](_0x00c6('0x28'),_0x4e98f8,JSON[_0x00c6('0x10')](_0x20ae0b));_0x17cf27(_0x20ae0b);})[_0x00c6('0x1e')](function(_0x55854b){logger[_0x00c6('0x11')](_0x00c6('0x28'),_0x55854b['message'],_0x4e98f8);_0x4eb823(_0x2859d4[_0x00c6('0x11')](0x1f4,_0x55854b[_0x00c6('0x13')]));});});};exports[_0x00c6('0x2a')]=function(_0x5257a9){var _0xbc8f81=this;return new Promise(function(_0x25a163,_0x5c7ae0){return db[_0x00c6('0x2b')][_0x00c6('0x2c')]()['then'](function(_0x31c73b){return db[_0x00c6('0x2d')][_0x00c6('0x2e')](function(_0x39c6f7){return db[_0x00c6('0x16')][_0x00c6('0x17')]({'where':_0x5257a9[_0x00c6('0x18')]?_0x5257a9[_0x00c6('0x18')][_0x00c6('0x22')]||null:null,'attributes':_0x5257a9['options']?_0x5257a9[_0x00c6('0x18')][_0x00c6('0x19')]||null:null,'limit':_0x5257a9[_0x00c6('0x18')]?_0x5257a9[_0x00c6('0x18')]['limit']||null:null,'order':_0x5257a9[_0x00c6('0x18')]?_0x5257a9['options'][_0x00c6('0x2f')]||null:null,'transaction':_0x39c6f7,'lock':_0x39c6f7['LOCK'][_0x00c6('0x30')],'include':[{'model':db[_0x00c6('0x2b')],'as':'Contact','attributes':_['keys'](_0x31c73b)},{'model':db[_0x00c6('0x31')],'as':'Agent','attributes':['id',_0x00c6('0x32'),_0x00c6('0x33')]}]})[_0x00c6('0xa')](function(_0x25a014){var _0x1b5e73=[];var _0x881533=[];for(var _0x440b9a=0x0;_0x440b9a<_0x25a014['length'];_0x440b9a+=0x1){if(!_0x881533[_0x00c6('0x34')](_0x25a014[_0x440b9a]['UserId'])){_0x881533[_0x00c6('0x35')](_0x25a014[_0x440b9a][_0x00c6('0x36')]);_0x1b5e73['push'](_0x25a014[_0x440b9a][_0x00c6('0x27')](_0x5257a9['body'],{'transaction':_0x39c6f7}));}}return BPromise[_0x00c6('0x37')](_0x1b5e73);});})[_0x00c6('0xa')](function(_0x39609f){logger[_0x00c6('0xb')](_0x00c6('0x2a'),_0x5257a9);logger[_0x00c6('0xe')](_0x00c6('0x2a'),_0x5257a9,JSON[_0x00c6('0x10')](_0x39609f));_0x25a163(_0x39609f);})[_0x00c6('0x1e')](function(_0x4911c4){logger['error']('GetContactDialer',_0x4911c4[_0x00c6('0x13')],_0x5257a9);_0x5c7ae0(_0xbc8f81[_0x00c6('0x11')](0x1f4,_0x4911c4[_0x00c6('0x13')]));});});});};exports[_0x00c6('0x38')]=function(_0x409980){var _0x2612ce=this;return new Promise(function(_0x2706b7,_0xce1ed9){return db[_0x00c6('0x2d')][_0x00c6('0x2e')](function(_0x6d3f98){return db[_0x00c6('0x39')][_0x00c6('0x24')](_0x409980[_0x00c6('0x25')],{'raw':_0x409980[_0x00c6('0x18')]?_0x409980[_0x00c6('0x18')]['raw']===undefined?!![]:![]:!![],'transaction':_0x6d3f98})[_0x00c6('0xa')](function(){return db['CmHopper'][_0x00c6('0x29')]({'where':_0x409980[_0x00c6('0x18')]?_0x409980['options'][_0x00c6('0x22')]||null:null,'transaction':_0x6d3f98});});})[_0x00c6('0xa')](function(_0x4f5e50){logger['info'](_0x00c6('0x38'),_0x409980);logger[_0x00c6('0xe')](_0x00c6('0x38'),_0x409980,JSON[_0x00c6('0x10')](_0x4f5e50));_0x2706b7(_0x4f5e50);})[_0x00c6('0x1e')](function(_0x1e5ea2){logger[_0x00c6('0x11')](_0x00c6('0x38'),_0x1e5ea2['message'],_0x409980);_0xce1ed9(_0x2612ce[_0x00c6('0x11')](0x1f4,_0x1e5ea2[_0x00c6('0x13')]));});});};exports[_0x00c6('0x3a')]=function(_0x29a429){var _0x4a34cc=this;return new Promise(function(_0xa8e7ae,_0x38b740){return db[_0x00c6('0x16')][_0x00c6('0x17')]({'raw':_0x29a429['options']?_0x29a429[_0x00c6('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x29a429[_0x00c6('0x18')]?_0x29a429[_0x00c6('0x18')][_0x00c6('0x22')]||null:null,'attributes':[[db[_0x00c6('0x2d')]['fn'](_0x00c6('0x3b'),db[_0x00c6('0x2d')]['fn']('IF',db[_0x00c6('0x2d')][_0x00c6('0x3c')]('`scheduledat`\x20>=\x20'+util[_0x00c6('0x3d')]('\x22%s\x22',moment()[_0x00c6('0x3d')]('YYYY-MM-DD\x20HH:mm:ss'))+_0x00c6('0x3e')))),_0x00c6('0x3f')]]})[_0x00c6('0xa')](function(_0x51589c){logger[_0x00c6('0xb')](_0x00c6('0x3a'),_0x29a429);logger[_0x00c6('0xe')](_0x00c6('0x3a'),_0x29a429,JSON[_0x00c6('0x10')](_0x51589c));_0xa8e7ae(_0x51589c);})[_0x00c6('0x1e')](function(_0x464ef0){logger[_0x00c6('0x11')]('CountReScheduled',_0x464ef0['message'],_0x29a429);_0x38b740(_0x4a34cc['error'](0x1f4,_0x464ef0[_0x00c6('0x13')]));});});};exports['GetContactRecallMe']=function(_0x49e6b5){var _0x30bcb1=this;return new Promise(function(_0x471200,_0x311d1f){return db[_0x00c6('0x2b')][_0x00c6('0x2c')]()[_0x00c6('0xa')](function(_0x5ae287){return db[_0x00c6('0x2d')][_0x00c6('0x2e')](function(_0x58ee4e){return db[_0x00c6('0x16')][_0x00c6('0x17')]({'where':_0x49e6b5[_0x00c6('0x18')]?_0x49e6b5['options'][_0x00c6('0x22')]||null:null,'attributes':_0x49e6b5['options']?_0x49e6b5[_0x00c6('0x18')][_0x00c6('0x19')]||null:null,'limit':0x1,'order':_0x49e6b5[_0x00c6('0x18')]?_0x49e6b5[_0x00c6('0x18')]['order']||null:null,'group':db[_0x00c6('0x16')][_0x00c6('0x36')],'transaction':_0x58ee4e,'lock':_0x58ee4e[_0x00c6('0x40')]['UPDATE'],'include':_0x49e6b5['options']?_0x49e6b5[_0x00c6('0x18')]['include']?_[_0x00c6('0x1b')](_0x49e6b5[_0x00c6('0x18')][_0x00c6('0x1c')],function(_0x207510){return{'model':db[_0x207510['model']],'as':_0x207510['as'],'attributes':_0x207510[_0x00c6('0x19')],'include':_0x207510[_0x00c6('0x1c')]?_[_0x00c6('0x1b')](_0x207510[_0x00c6('0x1c')],function(_0x163843){return{'model':db[_0x163843[_0x00c6('0x1d')]],'as':_0x163843['as'],'attributes':_0x163843[_0x00c6('0x19')],'include':_0x163843['include']?_['map'](_0x163843[_0x00c6('0x1c')],function(_0x104499){return{'model':db[_0x104499[_0x00c6('0x1d')]],'as':_0x104499['as'],'attributes':_0x104499[_0x00c6('0x19')]};}):[]};}):[]};}):[]:[]})[_0x00c6('0xa')](function(_0x5812be){var _0x1c7b57=[];for(var _0x39e500=0x0;_0x39e500<_0x5812be[_0x00c6('0x41')];_0x39e500+=0x1){_0x1c7b57['push'](_0x5812be[_0x39e500][_0x00c6('0x27')](_0x49e6b5[_0x00c6('0x25')],{'transaction':_0x58ee4e}));}return BPromise[_0x00c6('0x37')](_0x1c7b57);});})[_0x00c6('0xa')](function(_0x3f74a5){logger[_0x00c6('0xb')](_0x00c6('0x42'),_0x49e6b5);logger[_0x00c6('0xe')](_0x00c6('0x42'),_0x49e6b5,JSON[_0x00c6('0x10')](_0x3f74a5));_0x471200(_0x3f74a5);})[_0x00c6('0x1e')](function(_0x1bbdf1){logger['error'](_0x00c6('0x42'),_0x1bbdf1[_0x00c6('0x13')],_0x49e6b5);_0x311d1f(_0x30bcb1[_0x00c6('0x11')](0x1f4,_0x1bbdf1['message']));});});});};exports['GetCmHopperPreview']=function(_0x103580){var _0x3f1151=this;return new Promise(function(_0x4f517f,_0x5af613){db[_0x00c6('0x2b')][_0x00c6('0x2c')]()[_0x00c6('0xa')](function(_0x4c3215){return db[_0x00c6('0x16')][_0x00c6('0x17')]({'raw':_0x103580[_0x00c6('0x18')]?_0x103580[_0x00c6('0x18')][_0x00c6('0x21')]===undefined?!![]:![]:!![],'where':_0x103580['options']?_0x103580['options']['where']||null:null,'attributes':_0x103580['options']?_0x103580[_0x00c6('0x18')][_0x00c6('0x19')]||null:null,'limit':_0x103580[_0x00c6('0x18')]?_0x103580[_0x00c6('0x18')][_0x00c6('0x1a')]||null:null,'include':_0x103580[_0x00c6('0x18')]?_0x103580[_0x00c6('0x18')][_0x00c6('0x1c')]?_[_0x00c6('0x1b')](_0x103580[_0x00c6('0x18')][_0x00c6('0x1c')],function(_0x1c4152){return{'model':db[_0x1c4152[_0x00c6('0x1d')]],'as':_0x1c4152['as'],'attributes':_0x1c4152['as']==='Contact'?_['keys'](_0x4c3215):_0x1c4152[_0x00c6('0x19')],'include':_0x1c4152[_0x00c6('0x1c')]?_[_0x00c6('0x1b')](_0x1c4152[_0x00c6('0x1c')],function(_0x2af840){return{'model':db[_0x2af840[_0x00c6('0x1d')]],'as':_0x2af840['as'],'attributes':_0x2af840[_0x00c6('0x19')],'include':_0x2af840['include']?_[_0x00c6('0x1b')](_0x2af840['include'],function(_0x212164){return{'model':db[_0x212164[_0x00c6('0x1d')]],'as':_0x212164['as'],'attributes':_0x212164[_0x00c6('0x19')]};}):[]};}):[]};}):[]:[]})[_0x00c6('0xa')](function(_0xe8156d){logger[_0x00c6('0xb')]('GetCmHopper',_0x103580);logger['debug'](_0x00c6('0x15'),_0x103580,JSON['stringify'](_0xe8156d));_0x4f517f(_0xe8156d);})['catch'](function(_0x2ae755){logger['error'](_0x00c6('0x15'),_0x2ae755[_0x00c6('0x13')],_0x103580);_0x5af613(_0x3f1151[_0x00c6('0x11')](0x1f4,_0x2ae755[_0x00c6('0x13')]));});});});};
\ No newline at end of file
+var _0xde36=['../../config/logger','rpc','../../config/environment','client','http','then','info','CmHopper,\x20%s,\x20%s','debug','request\x20sent','error','code','message','result','catch','GetCmHopper','CmHopper','findAll','options','raw','where','attributes','limit','include','map','model','stringify','ShowCmHopper','find','create','body','CreateCmHopper','update','UpdateCmHopper','DestroyCmHopper','destroy','CmContact','describe','sequelize','order','UPDATE','Contact','keys','User','Agent','name','voicePause','length','UserId','push','all','GetContactDialer','transaction','MoveContactManagedDialer','CountReScheduled','COUNT','literal','`scheduledat`\x20>=\x20','format','\x22%s\x22','\x20,\x201,\x20null','contactsRescheduled','GetContactRecallMe','LOCK','GetCmHopperPreview','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x94478b,_0x551ee1){var _0xe2d364=function(_0x287904){while(--_0x287904){_0x94478b['push'](_0x94478b['shift']());}};_0xe2d364(++_0x551ee1);}(_0xde36,0xd1));var _0x6de3=function(_0x3fcbf1,_0x8b6056){_0x3fcbf1=_0x3fcbf1-0x0;var _0x435faa=_0xde36[_0x3fcbf1];return _0x435faa;};'use strict';var _=require('lodash');var util=require(_0x6de3('0x0'));var moment=require(_0x6de3('0x1'));var BPromise=require(_0x6de3('0x2'));var rs=require(_0x6de3('0x3'));var fs=require('fs');var Redis=require(_0x6de3('0x4'));var db=require(_0x6de3('0x5'))['db'];var utils=require(_0x6de3('0x6'));var logger=require(_0x6de3('0x7'))(_0x6de3('0x8'));var config=require(_0x6de3('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x6de3('0xa')][_0x6de3('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4e488b,_0x5b8e39,_0x5da052){return new BPromise(function(_0x123bb2,_0x420115){return client['request'](_0x4e488b,_0x5da052)[_0x6de3('0xc')](function(_0x95ade3){logger[_0x6de3('0xd')](_0x6de3('0xe'),_0x5b8e39,'request\x20sent');logger[_0x6de3('0xf')]('CmHopper,\x20%s,\x20%s,\x20%s',_0x5b8e39,_0x6de3('0x10'),JSON['stringify'](_0x95ade3));if(_0x95ade3[_0x6de3('0x11')]){if(_0x95ade3[_0x6de3('0x11')][_0x6de3('0x12')]===0x1f4){logger['error'](_0x6de3('0xe'),_0x5b8e39,_0x95ade3[_0x6de3('0x11')][_0x6de3('0x13')]);return _0x420115(_0x95ade3[_0x6de3('0x11')][_0x6de3('0x13')]);}logger[_0x6de3('0x11')](_0x6de3('0xe'),_0x5b8e39,_0x95ade3[_0x6de3('0x11')][_0x6de3('0x13')]);return _0x123bb2(_0x95ade3[_0x6de3('0x11')]['message']);}else{logger['info'](_0x6de3('0xe'),_0x5b8e39,_0x6de3('0x10'));_0x123bb2(_0x95ade3[_0x6de3('0x14')]['message']);}})[_0x6de3('0x15')](function(_0x226092){logger[_0x6de3('0x11')](_0x6de3('0xe'),_0x5b8e39,_0x226092);_0x420115(_0x226092);});});}exports[_0x6de3('0x16')]=function(_0x5ba9b4){var _0x112693=this;return new Promise(function(_0x437591,_0x62bc99){return db[_0x6de3('0x17')][_0x6de3('0x18')]({'raw':_0x5ba9b4[_0x6de3('0x19')]?_0x5ba9b4[_0x6de3('0x19')][_0x6de3('0x1a')]===undefined?!![]:![]:!![],'where':_0x5ba9b4[_0x6de3('0x19')]?_0x5ba9b4['options'][_0x6de3('0x1b')]||null:null,'attributes':_0x5ba9b4[_0x6de3('0x19')]?_0x5ba9b4[_0x6de3('0x19')][_0x6de3('0x1c')]||null:null,'limit':_0x5ba9b4[_0x6de3('0x19')]?_0x5ba9b4[_0x6de3('0x19')][_0x6de3('0x1d')]||null:null,'include':_0x5ba9b4[_0x6de3('0x19')]?_0x5ba9b4['options'][_0x6de3('0x1e')]?_[_0x6de3('0x1f')](_0x5ba9b4[_0x6de3('0x19')][_0x6de3('0x1e')],function(_0x1fcc7c){return{'model':db[_0x1fcc7c['model']],'as':_0x1fcc7c['as'],'attributes':_0x1fcc7c[_0x6de3('0x1c')],'include':_0x1fcc7c[_0x6de3('0x1e')]?_[_0x6de3('0x1f')](_0x1fcc7c[_0x6de3('0x1e')],function(_0x2a425d){return{'model':db[_0x2a425d[_0x6de3('0x20')]],'as':_0x2a425d['as'],'attributes':_0x2a425d[_0x6de3('0x1c')],'include':_0x2a425d['include']?_[_0x6de3('0x1f')](_0x2a425d['include'],function(_0x44092c){return{'model':db[_0x44092c[_0x6de3('0x20')]],'as':_0x44092c['as'],'attributes':_0x44092c[_0x6de3('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x6de3('0xc')](function(_0xd8d03b){logger[_0x6de3('0xd')](_0x6de3('0x16'),_0x5ba9b4);logger['debug']('GetCmHopper',_0x5ba9b4,JSON[_0x6de3('0x21')](_0xd8d03b));_0x437591(_0xd8d03b);})[_0x6de3('0x15')](function(_0x523ebd){logger[_0x6de3('0x11')]('GetCmHopper',_0x523ebd['message'],_0x5ba9b4);_0x62bc99(_0x112693[_0x6de3('0x11')](0x1f4,_0x523ebd[_0x6de3('0x13')]));});});};exports[_0x6de3('0x22')]=function(_0x1b1de8){var _0x43fcf2=this;return new Promise(function(_0x4a4430,_0x208fdf){return db[_0x6de3('0x17')][_0x6de3('0x23')]({'raw':_0x1b1de8[_0x6de3('0x19')]?_0x1b1de8['options'][_0x6de3('0x1a')]===undefined?!![]:![]:!![],'where':_0x1b1de8[_0x6de3('0x19')]?_0x1b1de8[_0x6de3('0x19')]['where']||null:null,'attributes':_0x1b1de8[_0x6de3('0x19')]?_0x1b1de8[_0x6de3('0x19')][_0x6de3('0x1c')]||null:null,'include':_0x1b1de8[_0x6de3('0x19')]?_0x1b1de8[_0x6de3('0x19')][_0x6de3('0x1e')]?_[_0x6de3('0x1f')](_0x1b1de8[_0x6de3('0x19')][_0x6de3('0x1e')],function(_0x4382dd){return{'model':db[_0x4382dd['model']],'as':_0x4382dd['as'],'attributes':_0x4382dd[_0x6de3('0x1c')],'include':_0x4382dd['include']?_[_0x6de3('0x1f')](_0x4382dd[_0x6de3('0x1e')],function(_0x30ae33){return{'model':db[_0x30ae33['model']],'as':_0x30ae33['as'],'attributes':_0x30ae33[_0x6de3('0x1c')],'include':_0x30ae33[_0x6de3('0x1e')]?_[_0x6de3('0x1f')](_0x30ae33['include'],function(_0x2902c6){return{'model':db[_0x2902c6['model']],'as':_0x2902c6['as'],'attributes':_0x2902c6[_0x6de3('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3e9b8c){logger['info'](_0x6de3('0x22'),_0x1b1de8);logger[_0x6de3('0xf')](_0x6de3('0x22'),_0x1b1de8,JSON['stringify'](_0x3e9b8c));_0x4a4430(_0x3e9b8c);})['catch'](function(_0x5a131e){logger[_0x6de3('0x11')](_0x6de3('0x22'),_0x5a131e[_0x6de3('0x13')],_0x1b1de8);_0x208fdf(_0x43fcf2[_0x6de3('0x11')](0x1f4,_0x5a131e[_0x6de3('0x13')]));});});};exports['CreateCmHopper']=function(_0x17117a){var _0x58fe9f=this;return new Promise(function(_0x1ec263,_0x5c67e3){return db[_0x6de3('0x17')][_0x6de3('0x24')](_0x17117a[_0x6de3('0x25')],{'raw':_0x17117a[_0x6de3('0x19')]?_0x17117a[_0x6de3('0x19')][_0x6de3('0x1a')]===undefined?!![]:![]:!![]})[_0x6de3('0xc')](function(_0x4e6713){logger[_0x6de3('0xd')](_0x6de3('0x26'),_0x17117a);logger[_0x6de3('0xf')](_0x6de3('0x26'),_0x17117a,JSON[_0x6de3('0x21')](_0x4e6713));_0x1ec263(_0x4e6713);})[_0x6de3('0x15')](function(_0x4c1eb9){logger[_0x6de3('0x11')](_0x6de3('0x26'),_0x4c1eb9['message'],_0x17117a);_0x5c67e3(_0x58fe9f[_0x6de3('0x11')](0x1f4,_0x4c1eb9[_0x6de3('0x13')]));});});};exports['UpdateCmHopper']=function(_0x15181d){var _0x1a7d32=this;return new Promise(function(_0x31eaa6,_0x25a984){return db[_0x6de3('0x17')][_0x6de3('0x27')](_0x15181d['body'],{'raw':_0x15181d[_0x6de3('0x19')]?_0x15181d[_0x6de3('0x19')][_0x6de3('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x15181d[_0x6de3('0x19')]?_0x15181d[_0x6de3('0x19')][_0x6de3('0x1b')]||null:null,'attributes':_0x15181d['options']?_0x15181d[_0x6de3('0x19')][_0x6de3('0x1c')]||null:null,'limit':_0x15181d[_0x6de3('0x19')]?_0x15181d[_0x6de3('0x19')][_0x6de3('0x1d')]||null:null})[_0x6de3('0xc')](function(_0x26e3c0){logger['info'](_0x6de3('0x28'),_0x15181d);logger[_0x6de3('0xf')](_0x6de3('0x28'),_0x15181d,JSON[_0x6de3('0x21')](_0x26e3c0));_0x31eaa6(_0x26e3c0);})[_0x6de3('0x15')](function(_0x3e5438){logger[_0x6de3('0x11')]('UpdateCmHopper',_0x3e5438[_0x6de3('0x13')],_0x15181d);_0x25a984(_0x1a7d32[_0x6de3('0x11')](0x1f4,_0x3e5438['message']));});});};exports[_0x6de3('0x29')]=function(_0x3c5239){var _0x215630=this;return new Promise(function(_0x26efda,_0x5dccb8){return db['CmHopper'][_0x6de3('0x2a')]({'where':_0x3c5239[_0x6de3('0x19')]?_0x3c5239[_0x6de3('0x19')][_0x6de3('0x1b')]||null:null})[_0x6de3('0xc')](function(_0x50a744){logger[_0x6de3('0xd')](_0x6de3('0x29'),_0x3c5239);logger[_0x6de3('0xf')](_0x6de3('0x29'),_0x3c5239,JSON[_0x6de3('0x21')](_0x50a744));_0x26efda(_0x50a744);})[_0x6de3('0x15')](function(_0x33e055){logger[_0x6de3('0x11')](_0x6de3('0x29'),_0x33e055[_0x6de3('0x13')],_0x3c5239);_0x5dccb8(_0x215630['error'](0x1f4,_0x33e055['message']));});});};exports['GetContactDialer']=function(_0x1ae31a){var _0xadb8bd=this;return new Promise(function(_0x4ca735,_0x37887b){return db[_0x6de3('0x2b')][_0x6de3('0x2c')]()[_0x6de3('0xc')](function(_0x53ad06){return db[_0x6de3('0x2d')]['transaction'](function(_0x18e823){return db['CmHopper'][_0x6de3('0x18')]({'where':_0x1ae31a[_0x6de3('0x19')]?_0x1ae31a[_0x6de3('0x19')][_0x6de3('0x1b')]||null:null,'attributes':_0x1ae31a[_0x6de3('0x19')]?_0x1ae31a[_0x6de3('0x19')][_0x6de3('0x1c')]||null:null,'limit':_0x1ae31a[_0x6de3('0x19')]?_0x1ae31a['options'][_0x6de3('0x1d')]||null:null,'order':_0x1ae31a[_0x6de3('0x19')]?_0x1ae31a[_0x6de3('0x19')][_0x6de3('0x2e')]||null:null,'transaction':_0x18e823,'lock':_0x18e823['LOCK'][_0x6de3('0x2f')],'include':[{'model':db[_0x6de3('0x2b')],'as':_0x6de3('0x30'),'attributes':_[_0x6de3('0x31')](_0x53ad06)},{'model':db[_0x6de3('0x32')],'as':_0x6de3('0x33'),'attributes':['id',_0x6de3('0x34'),_0x6de3('0x35')]}]})[_0x6de3('0xc')](function(_0x47d788){var _0x5a705f=[];var _0xe10ea=[];for(var _0x47a3cc=0x0;_0x47a3cc<_0x47d788[_0x6de3('0x36')];_0x47a3cc+=0x1){if(!_0xe10ea['includes'](_0x47d788[_0x47a3cc][_0x6de3('0x37')])){_0xe10ea[_0x6de3('0x38')](_0x47d788[_0x47a3cc][_0x6de3('0x37')]);_0x5a705f['push'](_0x47d788[_0x47a3cc]['update'](_0x1ae31a[_0x6de3('0x25')],{'transaction':_0x18e823}));}}return BPromise[_0x6de3('0x39')](_0x5a705f);});})[_0x6de3('0xc')](function(_0x3f714b){logger[_0x6de3('0xd')](_0x6de3('0x3a'),_0x1ae31a);logger[_0x6de3('0xf')](_0x6de3('0x3a'),_0x1ae31a,JSON[_0x6de3('0x21')](_0x3f714b));_0x4ca735(_0x3f714b);})[_0x6de3('0x15')](function(_0x48150c){logger[_0x6de3('0x11')](_0x6de3('0x3a'),_0x48150c[_0x6de3('0x13')],_0x1ae31a);_0x37887b(_0xadb8bd[_0x6de3('0x11')](0x1f4,_0x48150c['message']));});});});};exports['MoveContactManagedDialer']=function(_0x31b6d1){var _0x4c7d51=this;return new Promise(function(_0x5cc867,_0x5b8eb0){return db[_0x6de3('0x2d')][_0x6de3('0x3b')](function(_0x18ea6b){return db['CmHopperFinal'][_0x6de3('0x24')](_0x31b6d1[_0x6de3('0x25')],{'raw':_0x31b6d1[_0x6de3('0x19')]?_0x31b6d1['options'][_0x6de3('0x1a')]===undefined?!![]:![]:!![],'transaction':_0x18ea6b})[_0x6de3('0xc')](function(){return db[_0x6de3('0x17')][_0x6de3('0x2a')]({'where':_0x31b6d1[_0x6de3('0x19')]?_0x31b6d1[_0x6de3('0x19')][_0x6de3('0x1b')]||null:null,'transaction':_0x18ea6b});});})['then'](function(_0x1a51a5){logger[_0x6de3('0xd')]('MoveContactManagedDialer',_0x31b6d1);logger[_0x6de3('0xf')](_0x6de3('0x3c'),_0x31b6d1,JSON[_0x6de3('0x21')](_0x1a51a5));_0x5cc867(_0x1a51a5);})['catch'](function(_0x52be52){logger['error'](_0x6de3('0x3c'),_0x52be52[_0x6de3('0x13')],_0x31b6d1);_0x5b8eb0(_0x4c7d51[_0x6de3('0x11')](0x1f4,_0x52be52['message']));});});};exports[_0x6de3('0x3d')]=function(_0x5aa658){var _0x49adcc=this;return new Promise(function(_0x3bb8ff,_0x101210){return db[_0x6de3('0x17')][_0x6de3('0x18')]({'raw':_0x5aa658['options']?_0x5aa658['options'][_0x6de3('0x1a')]===undefined?!![]:![]:!![],'where':_0x5aa658[_0x6de3('0x19')]?_0x5aa658[_0x6de3('0x19')][_0x6de3('0x1b')]||null:null,'attributes':[[db[_0x6de3('0x2d')]['fn'](_0x6de3('0x3e'),db[_0x6de3('0x2d')]['fn']('IF',db[_0x6de3('0x2d')][_0x6de3('0x3f')](_0x6de3('0x40')+util[_0x6de3('0x41')](_0x6de3('0x42'),moment()[_0x6de3('0x41')]('YYYY-MM-DD\x20HH:mm:ss'))+_0x6de3('0x43')))),_0x6de3('0x44')]]})[_0x6de3('0xc')](function(_0x52355c){logger['info'](_0x6de3('0x3d'),_0x5aa658);logger[_0x6de3('0xf')]('CountReScheduled',_0x5aa658,JSON[_0x6de3('0x21')](_0x52355c));_0x3bb8ff(_0x52355c);})[_0x6de3('0x15')](function(_0x53a04b){logger[_0x6de3('0x11')](_0x6de3('0x3d'),_0x53a04b[_0x6de3('0x13')],_0x5aa658);_0x101210(_0x49adcc[_0x6de3('0x11')](0x1f4,_0x53a04b['message']));});});};exports[_0x6de3('0x45')]=function(_0x184d34){var _0x522999=this;return new Promise(function(_0x193c0c,_0x47f2f1){return db[_0x6de3('0x2b')][_0x6de3('0x2c')]()[_0x6de3('0xc')](function(_0x265b0f){return db[_0x6de3('0x2d')][_0x6de3('0x3b')](function(_0x3c92ed){return db[_0x6de3('0x17')]['findAll']({'where':_0x184d34[_0x6de3('0x19')]?_0x184d34[_0x6de3('0x19')]['where']||null:null,'attributes':_0x184d34['options']?_0x184d34[_0x6de3('0x19')][_0x6de3('0x1c')]||null:null,'limit':0x1,'order':_0x184d34[_0x6de3('0x19')]?_0x184d34[_0x6de3('0x19')][_0x6de3('0x2e')]||null:null,'group':db[_0x6de3('0x17')]['UserId'],'transaction':_0x3c92ed,'lock':_0x3c92ed[_0x6de3('0x46')][_0x6de3('0x2f')],'include':_0x184d34['options']?_0x184d34['options'][_0x6de3('0x1e')]?_[_0x6de3('0x1f')](_0x184d34[_0x6de3('0x19')][_0x6de3('0x1e')],function(_0x223ab4){return{'model':db[_0x223ab4['model']],'as':_0x223ab4['as'],'attributes':_0x223ab4[_0x6de3('0x1c')],'include':_0x223ab4[_0x6de3('0x1e')]?_[_0x6de3('0x1f')](_0x223ab4[_0x6de3('0x1e')],function(_0x2fe4e3){return{'model':db[_0x2fe4e3[_0x6de3('0x20')]],'as':_0x2fe4e3['as'],'attributes':_0x2fe4e3[_0x6de3('0x1c')],'include':_0x2fe4e3['include']?_[_0x6de3('0x1f')](_0x2fe4e3[_0x6de3('0x1e')],function(_0x4c82de){return{'model':db[_0x4c82de[_0x6de3('0x20')]],'as':_0x4c82de['as'],'attributes':_0x4c82de[_0x6de3('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x6de3('0xc')](function(_0xaef0c9){var _0x451180=[];for(var _0x527430=0x0;_0x527430<_0xaef0c9[_0x6de3('0x36')];_0x527430+=0x1){_0x451180[_0x6de3('0x38')](_0xaef0c9[_0x527430][_0x6de3('0x27')](_0x184d34['body'],{'transaction':_0x3c92ed}));}return BPromise[_0x6de3('0x39')](_0x451180);});})[_0x6de3('0xc')](function(_0x4f2295){logger[_0x6de3('0xd')]('GetContactRecallMe',_0x184d34);logger[_0x6de3('0xf')]('GetContactRecallMe',_0x184d34,JSON[_0x6de3('0x21')](_0x4f2295));_0x193c0c(_0x4f2295);})[_0x6de3('0x15')](function(_0x22c3f8){logger[_0x6de3('0x11')](_0x6de3('0x45'),_0x22c3f8[_0x6de3('0x13')],_0x184d34);_0x47f2f1(_0x522999[_0x6de3('0x11')](0x1f4,_0x22c3f8[_0x6de3('0x13')]));});});});};exports[_0x6de3('0x47')]=function(_0x56cff4){var _0x19dbf7=this;return new Promise(function(_0x43a575,_0x795680){db[_0x6de3('0x2b')]['describe']()[_0x6de3('0xc')](function(_0x207097){return db['CmHopper']['findAll']({'raw':_0x56cff4[_0x6de3('0x19')]?_0x56cff4[_0x6de3('0x19')][_0x6de3('0x1a')]===undefined?!![]:![]:!![],'where':_0x56cff4[_0x6de3('0x19')]?_0x56cff4[_0x6de3('0x19')]['where']||null:null,'attributes':_0x56cff4[_0x6de3('0x19')]?_0x56cff4['options'][_0x6de3('0x1c')]||null:null,'limit':_0x56cff4[_0x6de3('0x19')]?_0x56cff4[_0x6de3('0x19')][_0x6de3('0x1d')]||null:null,'include':_0x56cff4[_0x6de3('0x19')]?_0x56cff4[_0x6de3('0x19')][_0x6de3('0x1e')]?_[_0x6de3('0x1f')](_0x56cff4[_0x6de3('0x19')][_0x6de3('0x1e')],function(_0x263cc2){return{'model':db[_0x263cc2[_0x6de3('0x20')]],'as':_0x263cc2['as'],'attributes':_0x263cc2['as']===_0x6de3('0x30')?_[_0x6de3('0x31')](_0x207097):_0x263cc2['attributes'],'include':_0x263cc2['include']?_[_0x6de3('0x1f')](_0x263cc2[_0x6de3('0x1e')],function(_0x395101){return{'model':db[_0x395101['model']],'as':_0x395101['as'],'attributes':_0x395101['attributes'],'include':_0x395101[_0x6de3('0x1e')]?_[_0x6de3('0x1f')](_0x395101[_0x6de3('0x1e')],function(_0x53cddf){return{'model':db[_0x53cddf['model']],'as':_0x53cddf['as'],'attributes':_0x53cddf[_0x6de3('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x161f2f){logger[_0x6de3('0xd')](_0x6de3('0x16'),_0x56cff4);logger[_0x6de3('0xf')](_0x6de3('0x16'),_0x56cff4,JSON[_0x6de3('0x21')](_0x161f2f));_0x43a575(_0x161f2f);})[_0x6de3('0x15')](function(_0x2ea9a8){logger[_0x6de3('0x11')](_0x6de3('0x16'),_0x2ea9a8[_0x6de3('0x13')],_0x56cff4);_0x795680(_0x19dbf7['error'](0x1f4,_0x2ea9a8[_0x6de3('0x13')]));});});});};
\ No newline at end of file
diff --git a/server/api/cmHopper/index.js b/server/api/cmHopper/index.js
index e070d48..0205929 100644
--- a/server/api/cmHopper/index.js
+++ b/server/api/cmHopper/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x207c=['/timezone','getTimezone','update','delete','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./cmHopper.controller','get','/describe','isAuthenticated','/opencontacts','/timezones','getTimezones','/:id','post','/preview','getPreview'];(function(_0x1c4abb,_0x44a6a9){var _0x491f5f=function(_0x39efc5){while(--_0x39efc5){_0x1c4abb['push'](_0x1c4abb['shift']());}};_0x491f5f(++_0x44a6a9);}(_0x207c,0x1e8));var _0xc207=function(_0x332ddf,_0x1ed1b5){_0x332ddf=_0x332ddf-0x0;var _0x4798a9=_0x207c[_0x332ddf];return _0x4798a9;};'use strict';var multer=require('multer');var util=require(_0xc207('0x0'));var path=require(_0xc207('0x1'));var timeout=require(_0xc207('0x2'));var express=require(_0xc207('0x3'));var router=express[_0xc207('0x4')]();var auth=require(_0xc207('0x5'));var interaction=require(_0xc207('0x6'));var config=require('../../config/environment');var controller=require(_0xc207('0x7'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0xc207('0x8')](_0xc207('0x9'),auth[_0xc207('0xa')](),controller['describe']);router[_0xc207('0x8')](_0xc207('0xb'),auth[_0xc207('0xa')](),controller['getOpenContacts']);router[_0xc207('0x8')](_0xc207('0xc'),auth[_0xc207('0xa')](),controller[_0xc207('0xd')]);router[_0xc207('0x8')](_0xc207('0xe'),auth['isAuthenticated'](),controller['show']);router['post']('/',auth[_0xc207('0xa')](),controller['create']);router[_0xc207('0xf')](_0xc207('0x10'),auth['isAuthenticated'](),controller[_0xc207('0x11')]);router[_0xc207('0xf')](_0xc207('0x12'),auth[_0xc207('0xa')](),controller[_0xc207('0x13')]);router['put'](_0xc207('0xe'),auth[_0xc207('0xa')](),controller[_0xc207('0x14')]);router[_0xc207('0x15')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0xc207('0x16')]=router;
\ No newline at end of file
+var _0xae24=['post','create','/preview','getPreview','/timezone','getTimezone','put','exports','multer','path','express','Router','../../config/environment','get','isAuthenticated','index','/describe','/opencontacts','/timezones','getTimezones','/:id'];(function(_0x3a3728,_0x875599){var _0x279db6=function(_0x5ca7f9){while(--_0x5ca7f9){_0x3a3728['push'](_0x3a3728['shift']());}};_0x279db6(++_0x875599);}(_0xae24,0x182));var _0x4ae2=function(_0x2ff83c,_0x118a59){_0x2ff83c=_0x2ff83c-0x0;var _0x24fc7d=_0xae24[_0x2ff83c];return _0x24fc7d;};'use strict';var multer=require(_0x4ae2('0x0'));var util=require('util');var path=require(_0x4ae2('0x1'));var timeout=require('connect-timeout');var express=require(_0x4ae2('0x2'));var router=express[_0x4ae2('0x3')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x4ae2('0x4'));var controller=require('./cmHopper.controller');router[_0x4ae2('0x5')]('/',auth[_0x4ae2('0x6')](),controller[_0x4ae2('0x7')]);router[_0x4ae2('0x5')](_0x4ae2('0x8'),auth[_0x4ae2('0x6')](),controller['describe']);router['get'](_0x4ae2('0x9'),auth['isAuthenticated'](),controller['getOpenContacts']);router[_0x4ae2('0x5')](_0x4ae2('0xa'),auth['isAuthenticated'](),controller[_0x4ae2('0xb')]);router[_0x4ae2('0x5')](_0x4ae2('0xc'),auth[_0x4ae2('0x6')](),controller['show']);router[_0x4ae2('0xd')]('/',auth[_0x4ae2('0x6')](),controller[_0x4ae2('0xe')]);router['post'](_0x4ae2('0xf'),auth[_0x4ae2('0x6')](),controller[_0x4ae2('0x10')]);router[_0x4ae2('0xd')](_0x4ae2('0x11'),auth[_0x4ae2('0x6')](),controller[_0x4ae2('0x12')]);router[_0x4ae2('0x13')](_0x4ae2('0xc'),auth['isAuthenticated'](),controller['update']);router['delete'](_0x4ae2('0xc'),auth[_0x4ae2('0x6')](),controller['destroy']);module[_0x4ae2('0x14')]=router;
\ No newline at end of file
diff --git a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.attributes.js b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.attributes.js
index 9ff511b..c8d071e 100644
--- a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.attributes.js
+++ b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xb9f9=['format','YYYY-MM-DD\x20HH:mm:ss','moment','sequelize','exports','INTEGER','STRING','DATE'];(function(_0x51b8d7,_0x38c9ed){var _0x27f193=function(_0xe03f73){while(--_0xe03f73){_0x51b8d7['push'](_0x51b8d7['shift']());}};_0x27f193(++_0x38c9ed);}(_0xb9f9,0xe2));var _0x9b9f=function(_0x26b5a9,_0x2c1f6f){_0x26b5a9=_0x26b5a9-0x0;var _0x5dc833=_0xb9f9[_0x26b5a9];return _0x5dc833;};'use strict';var moment=require(_0x9b9f('0x0'));var Sequelize=require(_0x9b9f('0x1'));module[_0x9b9f('0x2')]={'CmHopperId':{'type':Sequelize[_0x9b9f('0x3')]},'phone':{'type':Sequelize[_0x9b9f('0x4')],'allowNull':![]},'OrderBy':{'type':Sequelize[_0x9b9f('0x3')],'defaultValue':0x0},'scheduledat':{'type':Sequelize[_0x9b9f('0x5')],'defaultValue':moment()[_0x9b9f('0x6')](_0x9b9f('0x7'))},'countbusyretry':{'type':Sequelize[_0x9b9f('0x3')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x9b9f('0x3')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x9b9f('0x3')],'defaultValue':0x0},'countnosuchnumberretry':{'type':Sequelize[_0x9b9f('0x3')],'defaultValue':0x0},'countdropretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x9b9f('0x3')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x9b9f('0x3')],'defaultValue':0x0}};
\ No newline at end of file
+var _0x5640=['format','moment','sequelize','INTEGER','STRING'];(function(_0x53a18f,_0x19e911){var _0x26b28c=function(_0x50dd5e){while(--_0x50dd5e){_0x53a18f['push'](_0x53a18f['shift']());}};_0x26b28c(++_0x19e911);}(_0x5640,0x1e1));var _0x0564=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x5640[_0x59ee6f];return _0x4c0979;};'use strict';var moment=require(_0x0564('0x0'));var Sequelize=require(_0x0564('0x1'));module['exports']={'CmHopperId':{'type':Sequelize[_0x0564('0x2')]},'phone':{'type':Sequelize[_0x0564('0x3')],'allowNull':![]},'OrderBy':{'type':Sequelize[_0x0564('0x2')],'defaultValue':0x0},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':moment()[_0x0564('0x4')]('YYYY-MM-DD\x20HH:mm:ss')},'countbusyretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x0564('0x2')],'defaultValue':0x0},'countnosuchnumberretry':{'type':Sequelize[_0x0564('0x2')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x0564('0x2')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x0564('0x2')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x0564('0x2')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0}};
\ No newline at end of file
diff --git a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.controller.js b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.controller.js
index ddb0814..03c2baa 100644
--- a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.controller.js
+++ b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x13bc=['query','filters','intersection','attributes','fields','length','hasOwnProperty','limit','order','sort','pick','filter','where','VIRTUAL','merge','options','count','findAll','rows','catch','show','params','keys','includeAll','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','UserProfileSection','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','html-pdf','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','sox','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','sendStatus','status','json','offset','set','apply','update','then','destroy','CmHopperAdditionalPhones','end','error','stack','name','send','index','map','CmHopperAdditionalPhone','rawAttributes','fieldName','type','key','model'];(function(_0x32d457,_0x1a39c9){var _0x338386=function(_0x199d7a){while(--_0x199d7a){_0x32d457['push'](_0x32d457['shift']());}};_0x338386(++_0x1a39c9);}(_0x13bc,0xc6));var _0xc13b=function(_0x63637,_0x3a20b3){_0x63637=_0x63637-0x0;var _0x3e1fa3=_0x13bc[_0x63637];return _0x3e1fa3;};'use strict';var pdf=require(_0xc13b('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xc13b('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xc13b('0x2'));var rp=require(_0xc13b('0x3'));var moment=require(_0xc13b('0x4'));var BPromise=require(_0xc13b('0x5'));var Mustache=require(_0xc13b('0x6'));var util=require('util');var path=require('path');var sox=require(_0xc13b('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0xc13b('0x8'));var crypto=require('crypto');var jsforce=require(_0xc13b('0x9'));var deskjs=require(_0xc13b('0xa'));var toCsv=require(_0xc13b('0xb'));var querystring=require(_0xc13b('0xc'));var Papa=require(_0xc13b('0xd'));var Redis=require(_0xc13b('0xe'));var authService=require(_0xc13b('0xf'));var qs=require(_0xc13b('0x10'));var as=require(_0xc13b('0x11'));var hardwareService=require(_0xc13b('0x12'));var logger=require(_0xc13b('0x13'))('api');var utils=require('../../config/utils');var config=require(_0xc13b('0x14'));var db=require(_0xc13b('0x15'))['db'];function respondWithStatusCode(_0x29ddbd,_0x2a71b0){_0x2a71b0=_0x2a71b0||0xcc;return function(_0x912a2c){if(_0x912a2c){return _0x29ddbd[_0xc13b('0x16')](_0x2a71b0);}return _0x29ddbd['status'](_0x2a71b0)['end']();};}function respondWithResult(_0x423bb1,_0xdc42a7){_0xdc42a7=_0xdc42a7||0xc8;return function(_0x2db9af){if(_0x2db9af){return _0x423bb1[_0xc13b('0x17')](_0xdc42a7)[_0xc13b('0x18')](_0x2db9af);}};}function respondWithFilteredResult(_0x1f17c9,_0x2dcd4b){return function(_0x8aeb82){if(_0x8aeb82){var _0x30d625=_0x8aeb82['count'],_0x30b14a=_0x2dcd4b[_0xc13b('0x19')],_0xbd7647=_0x2dcd4b[_0xc13b('0x19')]+_0x2dcd4b['limit'],_0x4b4f43;if(_0xbd7647>=_0x30d625){_0xbd7647=_0x30d625;_0x4b4f43=0xc8;}else{_0x4b4f43=0xce;}_0x1f17c9[_0xc13b('0x17')](_0x4b4f43);return _0x1f17c9[_0xc13b('0x1a')]('Content-Range',_0x30b14a+'-'+_0xbd7647+'/'+_0x30d625)['json'](_0x8aeb82);}return null;};}function patchUpdates(_0x55b1aa){return function(_0x2d2eb4){try{jsonpatch[_0xc13b('0x1b')](_0x2d2eb4,_0x55b1aa,!![]);}catch(_0x443e86){return BPromise['reject'](_0x443e86);}return _0x2d2eb4['save']();};}function saveUpdates(_0x2b8976,_0x4ee951){return function(_0x1070a6){if(_0x1070a6){return _0x1070a6[_0xc13b('0x1c')](_0x2b8976)[_0xc13b('0x1d')](function(_0x3ab53e){return _0x3ab53e;});}return null;};}function removeEntity(_0xdf7fd5,_0x334d7a){return function(_0x5a1e33){if(_0x5a1e33){return _0x5a1e33[_0xc13b('0x1e')]()[_0xc13b('0x1d')](function(){var _0xf30a9d=_0x5a1e33['get']({'plain':!![]});var _0x35513e=_0xc13b('0x1f');return db['UserProfileResource'][_0xc13b('0x1e')]({'where':{'type':_0x35513e,'resourceId':_0xf30a9d['id']}})['then'](function(){return _0x5a1e33;});})[_0xc13b('0x1d')](function(){_0xdf7fd5[_0xc13b('0x17')](0xcc)[_0xc13b('0x20')]();});}};}function handleEntityNotFound(_0x520b42,_0x1006ad){return function(_0x2e4b01){if(!_0x2e4b01){_0x520b42['sendStatus'](0x194);}return _0x2e4b01;};}function handleError(_0x18c902,_0x16d71a){_0x16d71a=_0x16d71a||0x1f4;return function(_0x951943){logger[_0xc13b('0x21')](_0x951943[_0xc13b('0x22')]);if(_0x951943[_0xc13b('0x23')]){delete _0x951943['name'];}_0x18c902[_0xc13b('0x17')](_0x16d71a)[_0xc13b('0x24')](_0x951943);};}exports[_0xc13b('0x25')]=function(_0xc3d21f,_0x4b5236){var _0x49f27f={},_0x592750={},_0x328166={'count':0x0,'rows':[]};var _0x310aed=_[_0xc13b('0x26')](db[_0xc13b('0x27')][_0xc13b('0x28')],function(_0x261b20){return{'name':_0x261b20[_0xc13b('0x29')],'type':_0x261b20[_0xc13b('0x2a')][_0xc13b('0x2b')]};});_0x592750[_0xc13b('0x2c')]=_[_0xc13b('0x26')](_0x310aed,'name');_0x592750[_0xc13b('0x2d')]=_['keys'](_0xc3d21f[_0xc13b('0x2d')]);_0x592750[_0xc13b('0x2e')]=_[_0xc13b('0x2f')](_0x592750[_0xc13b('0x2c')],_0x592750[_0xc13b('0x2d')]);_0x49f27f[_0xc13b('0x30')]=_[_0xc13b('0x2f')](_0x592750[_0xc13b('0x2c')],qs[_0xc13b('0x31')](_0xc3d21f[_0xc13b('0x2d')][_0xc13b('0x31')]));_0x49f27f[_0xc13b('0x30')]=_0x49f27f[_0xc13b('0x30')][_0xc13b('0x32')]?_0x49f27f[_0xc13b('0x30')]:_0x592750[_0xc13b('0x2c')];if(!_0xc3d21f['query'][_0xc13b('0x33')]('nolimit')){_0x49f27f[_0xc13b('0x34')]=qs['limit'](_0xc3d21f[_0xc13b('0x2d')][_0xc13b('0x34')]);_0x49f27f[_0xc13b('0x19')]=qs[_0xc13b('0x19')](_0xc3d21f[_0xc13b('0x2d')][_0xc13b('0x19')]);}_0x49f27f[_0xc13b('0x35')]=qs[_0xc13b('0x36')](_0xc3d21f[_0xc13b('0x2d')][_0xc13b('0x36')]);_0x49f27f['where']=qs[_0xc13b('0x2e')](_[_0xc13b('0x37')](_0xc3d21f[_0xc13b('0x2d')],_0x592750[_0xc13b('0x2e')]),_0x310aed);if(_0xc3d21f['query'][_0xc13b('0x38')]){_0x49f27f[_0xc13b('0x39')]=_['merge'](_0x49f27f[_0xc13b('0x39')],{'$or':_[_0xc13b('0x26')](_0x310aed,function(_0x4e78dc){if(_0x4e78dc['type']!==_0xc13b('0x3a')){var _0x359c28={};_0x359c28[_0x4e78dc['name']]={'$like':'%'+_0xc3d21f['query'][_0xc13b('0x38')]+'%'};return _0x359c28;}})});}_0x49f27f=_[_0xc13b('0x3b')]({},_0x49f27f,_0xc3d21f[_0xc13b('0x3c')]);var _0x214c51={'where':_0x49f27f[_0xc13b('0x39')]};return db[_0xc13b('0x27')][_0xc13b('0x3d')](_0x214c51)[_0xc13b('0x1d')](function(_0x11fc8c){_0x328166[_0xc13b('0x3d')]=_0x11fc8c;if(_0xc3d21f['query']['includeAll']){_0x49f27f['include']=[{'all':!![]}];}return db[_0xc13b('0x27')][_0xc13b('0x3e')](_0x49f27f);})['then'](function(_0x1273c7){_0x328166[_0xc13b('0x3f')]=_0x1273c7;return _0x328166;})['then'](respondWithFilteredResult(_0x4b5236,_0x49f27f))[_0xc13b('0x40')](handleError(_0x4b5236,null));};exports[_0xc13b('0x41')]=function(_0x63f289,_0x19b19b){var _0x4f412f={'raw':!![],'where':{'id':_0x63f289[_0xc13b('0x42')]['id']}},_0x1c8b0f={};_0x1c8b0f['model']=_[_0xc13b('0x43')](db[_0xc13b('0x27')]['rawAttributes']);_0x1c8b0f[_0xc13b('0x2d')]=_['keys'](_0x63f289[_0xc13b('0x2d')]);_0x1c8b0f[_0xc13b('0x2e')]=_[_0xc13b('0x2f')](_0x1c8b0f[_0xc13b('0x2c')],_0x1c8b0f[_0xc13b('0x2d')]);_0x4f412f[_0xc13b('0x30')]=_[_0xc13b('0x2f')](_0x1c8b0f[_0xc13b('0x2c')],qs['fields'](_0x63f289['query'][_0xc13b('0x31')]));_0x4f412f[_0xc13b('0x30')]=_0x4f412f['attributes'][_0xc13b('0x32')]?_0x4f412f[_0xc13b('0x30')]:_0x1c8b0f[_0xc13b('0x2c')];if(_0x63f289[_0xc13b('0x2d')][_0xc13b('0x44')]){_0x4f412f[_0xc13b('0x45')]=[{'all':!![]}];}_0x4f412f=_[_0xc13b('0x3b')]({},_0x4f412f,_0x63f289[_0xc13b('0x3c')]);return db[_0xc13b('0x27')][_0xc13b('0x46')](_0x4f412f)[_0xc13b('0x1d')](handleEntityNotFound(_0x19b19b,null))[_0xc13b('0x1d')](respondWithResult(_0x19b19b,null))[_0xc13b('0x40')](handleError(_0x19b19b,null));};exports[_0xc13b('0x47')]=function(_0x5c94dd,_0x54a0c5){return db['CmHopperAdditionalPhone'][_0xc13b('0x47')](_0x5c94dd[_0xc13b('0x48')],{})[_0xc13b('0x1d')](function(_0x32df98){var _0x32b2a5=_0x5c94dd[_0xc13b('0x49')]['get']({'plain':!![]});if(!_0x32b2a5)throw new Error(_0xc13b('0x4a'));if(_0x32b2a5[_0xc13b('0x4b')]===_0xc13b('0x49')){var _0x19e815=_0x32df98[_0xc13b('0x4c')]({'plain':!![]});var _0x54f667=_0xc13b('0x1f');return db[_0xc13b('0x4d')][_0xc13b('0x46')]({'where':{'name':_0x54f667,'userProfileId':_0x32b2a5[_0xc13b('0x4e')]},'raw':!![]})[_0xc13b('0x1d')](function(_0x2486be){if(_0x2486be&&_0x2486be['autoAssociation']===0x0){return db[_0xc13b('0x4f')][_0xc13b('0x47')]({'name':_0x19e815[_0xc13b('0x23')],'resourceId':_0x19e815['id'],'type':_0x2486be[_0xc13b('0x23')],'sectionId':_0x2486be['id']},{})[_0xc13b('0x1d')](function(){return _0x32df98;});}else{return _0x32df98;}})[_0xc13b('0x40')](function(_0x13fedf){logger['error'](_0xc13b('0x50'),_0x13fedf);throw _0x13fedf;});}return _0x32df98;})['then'](respondWithResult(_0x54a0c5,0xc9))[_0xc13b('0x40')](handleError(_0x54a0c5,null));};exports[_0xc13b('0x1c')]=function(_0x557a3d,_0x3c0dd6){if(_0x557a3d[_0xc13b('0x48')]['id']){delete _0x557a3d[_0xc13b('0x48')]['id'];}return db[_0xc13b('0x27')]['find']({'where':{'id':_0x557a3d['params']['id']}})[_0xc13b('0x1d')](handleEntityNotFound(_0x3c0dd6,null))[_0xc13b('0x1d')](saveUpdates(_0x557a3d[_0xc13b('0x48')],null))['then'](respondWithResult(_0x3c0dd6,null))['catch'](handleError(_0x3c0dd6,null));};exports[_0xc13b('0x1e')]=function(_0x55398e,_0x54fef4){return db[_0xc13b('0x27')][_0xc13b('0x46')]({'where':{'id':_0x55398e[_0xc13b('0x42')]['id']}})[_0xc13b('0x1d')](handleEntityNotFound(_0x54fef4,null))[_0xc13b('0x1d')](removeEntity(_0x54fef4,null))['catch'](handleError(_0x54fef4,null));};
\ No newline at end of file
+var _0xe329=['order','sort','filter','where','type','VIRTUAL','merge','options','includeAll','findAll','rows','show','params','find','catch','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','util','sox','to-csv','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','update','then','destroy','get','CmHopperAdditionalPhones','UserProfileResource','error','stack','name','map','CmHopperAdditionalPhone','rawAttributes','fieldName','key','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit'];(function(_0x42049c,_0x411e74){var _0x5c4eb2=function(_0x1c7254){while(--_0x1c7254){_0x42049c['push'](_0x42049c['shift']());}};_0x5c4eb2(++_0x411e74);}(_0xe329,0x69));var _0x9e32=function(_0x2bb512,_0x4b1d96){_0x2bb512=_0x2bb512-0x0;var _0x83d61b=_0xe329[_0x2bb512];return _0x83d61b;};'use strict';var pdf=require(_0x9e32('0x0'));var emlformat=require(_0x9e32('0x1'));var rimraf=require(_0x9e32('0x2'));var zipdir=require(_0x9e32('0x3'));var jsonpatch=require(_0x9e32('0x4'));var rp=require('request-promise');var moment=require(_0x9e32('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x9e32('0x6'));var path=require('path');var sox=require(_0x9e32('0x7'));var csv=require(_0x9e32('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x9e32('0x9'));var squel=require(_0x9e32('0xa'));var crypto=require(_0x9e32('0xb'));var jsforce=require(_0x9e32('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x9e32('0x8'));var querystring=require(_0x9e32('0xd'));var Papa=require(_0x9e32('0xe'));var Redis=require(_0x9e32('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x9e32('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x9e32('0x11'))(_0x9e32('0x12'));var utils=require(_0x9e32('0x13'));var config=require(_0x9e32('0x14'));var db=require(_0x9e32('0x15'))['db'];function respondWithStatusCode(_0x540b55,_0x14affa){_0x14affa=_0x14affa||0xcc;return function(_0x136a7d){if(_0x136a7d){return _0x540b55[_0x9e32('0x16')](_0x14affa);}return _0x540b55[_0x9e32('0x17')](_0x14affa)[_0x9e32('0x18')]();};}function respondWithResult(_0x41da58,_0x12b893){_0x12b893=_0x12b893||0xc8;return function(_0xc521ca){if(_0xc521ca){return _0x41da58[_0x9e32('0x17')](_0x12b893)[_0x9e32('0x19')](_0xc521ca);}};}function respondWithFilteredResult(_0x5f2983,_0x34c632){return function(_0x51c004){if(_0x51c004){var _0x5e7197=_0x51c004[_0x9e32('0x1a')],_0x4f195e=_0x34c632[_0x9e32('0x1b')],_0x12268f=_0x34c632[_0x9e32('0x1b')]+_0x34c632[_0x9e32('0x1c')],_0x32fa59;if(_0x12268f>=_0x5e7197){_0x12268f=_0x5e7197;_0x32fa59=0xc8;}else{_0x32fa59=0xce;}_0x5f2983[_0x9e32('0x17')](_0x32fa59);return _0x5f2983[_0x9e32('0x1d')](_0x9e32('0x1e'),_0x4f195e+'-'+_0x12268f+'/'+_0x5e7197)['json'](_0x51c004);}return null;};}function patchUpdates(_0x4cffe4){return function(_0x449197){try{jsonpatch[_0x9e32('0x1f')](_0x449197,_0x4cffe4,!![]);}catch(_0x1ccad5){return BPromise[_0x9e32('0x20')](_0x1ccad5);}return _0x449197['save']();};}function saveUpdates(_0x1f060b,_0xc46054){return function(_0x117b56){if(_0x117b56){return _0x117b56[_0x9e32('0x21')](_0x1f060b)[_0x9e32('0x22')](function(_0x4dc276){return _0x4dc276;});}return null;};}function removeEntity(_0x353ef5,_0x4e7445){return function(_0x23fdd4){if(_0x23fdd4){return _0x23fdd4[_0x9e32('0x23')]()[_0x9e32('0x22')](function(){var _0x1ec593=_0x23fdd4[_0x9e32('0x24')]({'plain':!![]});var _0x5703cb=_0x9e32('0x25');return db[_0x9e32('0x26')]['destroy']({'where':{'type':_0x5703cb,'resourceId':_0x1ec593['id']}})[_0x9e32('0x22')](function(){return _0x23fdd4;});})[_0x9e32('0x22')](function(){_0x353ef5[_0x9e32('0x17')](0xcc)[_0x9e32('0x18')]();});}};}function handleEntityNotFound(_0x3dfe21,_0x438f26){return function(_0x5da331){if(!_0x5da331){_0x3dfe21[_0x9e32('0x16')](0x194);}return _0x5da331;};}function handleError(_0x109dad,_0x293d82){_0x293d82=_0x293d82||0x1f4;return function(_0x42bff3){logger[_0x9e32('0x27')](_0x42bff3[_0x9e32('0x28')]);if(_0x42bff3['name']){delete _0x42bff3[_0x9e32('0x29')];}_0x109dad[_0x9e32('0x17')](_0x293d82)['send'](_0x42bff3);};}exports['index']=function(_0x389f60,_0x52e3a5){var _0xd3ffc7={},_0x1a59ce={},_0x58e1e8={'count':0x0,'rows':[]};var _0x59e96d=_[_0x9e32('0x2a')](db[_0x9e32('0x2b')][_0x9e32('0x2c')],function(_0x28fee1){return{'name':_0x28fee1[_0x9e32('0x2d')],'type':_0x28fee1['type'][_0x9e32('0x2e')]};});_0x1a59ce['model']=_[_0x9e32('0x2a')](_0x59e96d,_0x9e32('0x29'));_0x1a59ce[_0x9e32('0x2f')]=_[_0x9e32('0x30')](_0x389f60['query']);_0x1a59ce[_0x9e32('0x31')]=_[_0x9e32('0x32')](_0x1a59ce[_0x9e32('0x33')],_0x1a59ce[_0x9e32('0x2f')]);_0xd3ffc7['attributes']=_[_0x9e32('0x32')](_0x1a59ce[_0x9e32('0x33')],qs[_0x9e32('0x34')](_0x389f60[_0x9e32('0x2f')][_0x9e32('0x34')]));_0xd3ffc7[_0x9e32('0x35')]=_0xd3ffc7[_0x9e32('0x35')][_0x9e32('0x36')]?_0xd3ffc7['attributes']:_0x1a59ce[_0x9e32('0x33')];if(!_0x389f60['query'][_0x9e32('0x37')](_0x9e32('0x38'))){_0xd3ffc7[_0x9e32('0x1c')]=qs[_0x9e32('0x1c')](_0x389f60[_0x9e32('0x2f')]['limit']);_0xd3ffc7['offset']=qs['offset'](_0x389f60['query'][_0x9e32('0x1b')]);}_0xd3ffc7[_0x9e32('0x39')]=qs[_0x9e32('0x3a')](_0x389f60[_0x9e32('0x2f')][_0x9e32('0x3a')]);_0xd3ffc7['where']=qs[_0x9e32('0x31')](_['pick'](_0x389f60[_0x9e32('0x2f')],_0x1a59ce[_0x9e32('0x31')]),_0x59e96d);if(_0x389f60[_0x9e32('0x2f')][_0x9e32('0x3b')]){_0xd3ffc7['where']=_['merge'](_0xd3ffc7[_0x9e32('0x3c')],{'$or':_[_0x9e32('0x2a')](_0x59e96d,function(_0x4a57c8){if(_0x4a57c8[_0x9e32('0x3d')]!==_0x9e32('0x3e')){var _0x4dae53={};_0x4dae53[_0x4a57c8[_0x9e32('0x29')]]={'$like':'%'+_0x389f60[_0x9e32('0x2f')][_0x9e32('0x3b')]+'%'};return _0x4dae53;}})});}_0xd3ffc7=_[_0x9e32('0x3f')]({},_0xd3ffc7,_0x389f60[_0x9e32('0x40')]);var _0x5a8094={'where':_0xd3ffc7['where']};return db[_0x9e32('0x2b')][_0x9e32('0x1a')](_0x5a8094)['then'](function(_0x41da23){_0x58e1e8[_0x9e32('0x1a')]=_0x41da23;if(_0x389f60[_0x9e32('0x2f')][_0x9e32('0x41')]){_0xd3ffc7['include']=[{'all':!![]}];}return db['CmHopperAdditionalPhone'][_0x9e32('0x42')](_0xd3ffc7);})['then'](function(_0x8e91bb){_0x58e1e8[_0x9e32('0x43')]=_0x8e91bb;return _0x58e1e8;})['then'](respondWithFilteredResult(_0x52e3a5,_0xd3ffc7))['catch'](handleError(_0x52e3a5,null));};exports[_0x9e32('0x44')]=function(_0xa45ddb,_0x74111b){var _0x1d56a0={'raw':!![],'where':{'id':_0xa45ddb[_0x9e32('0x45')]['id']}},_0x5905f9={};_0x5905f9[_0x9e32('0x33')]=_[_0x9e32('0x30')](db[_0x9e32('0x2b')][_0x9e32('0x2c')]);_0x5905f9[_0x9e32('0x2f')]=_[_0x9e32('0x30')](_0xa45ddb[_0x9e32('0x2f')]);_0x5905f9['filters']=_[_0x9e32('0x32')](_0x5905f9['model'],_0x5905f9[_0x9e32('0x2f')]);_0x1d56a0['attributes']=_[_0x9e32('0x32')](_0x5905f9['model'],qs['fields'](_0xa45ddb['query'][_0x9e32('0x34')]));_0x1d56a0['attributes']=_0x1d56a0[_0x9e32('0x35')][_0x9e32('0x36')]?_0x1d56a0[_0x9e32('0x35')]:_0x5905f9['model'];if(_0xa45ddb['query'][_0x9e32('0x41')]){_0x1d56a0['include']=[{'all':!![]}];}_0x1d56a0=_['merge']({},_0x1d56a0,_0xa45ddb['options']);return db[_0x9e32('0x2b')][_0x9e32('0x46')](_0x1d56a0)[_0x9e32('0x22')](handleEntityNotFound(_0x74111b,null))['then'](respondWithResult(_0x74111b,null))[_0x9e32('0x47')](handleError(_0x74111b,null));};exports['create']=function(_0x88a756,_0x4cd60a){return db[_0x9e32('0x2b')]['create'](_0x88a756['body'],{})['then'](function(_0x2cbebe){var _0x340438=_0x88a756[_0x9e32('0x48')][_0x9e32('0x24')]({'plain':!![]});if(!_0x340438)throw new Error(_0x9e32('0x49'));if(_0x340438[_0x9e32('0x4a')]===_0x9e32('0x48')){var _0x3cb141=_0x2cbebe[_0x9e32('0x24')]({'plain':!![]});var _0x2f3813=_0x9e32('0x25');return db[_0x9e32('0x4b')][_0x9e32('0x46')]({'where':{'name':_0x2f3813,'userProfileId':_0x340438[_0x9e32('0x4c')]},'raw':!![]})[_0x9e32('0x22')](function(_0x11d8bd){if(_0x11d8bd&&_0x11d8bd[_0x9e32('0x4d')]===0x0){return db[_0x9e32('0x26')][_0x9e32('0x4e')]({'name':_0x3cb141[_0x9e32('0x29')],'resourceId':_0x3cb141['id'],'type':_0x11d8bd[_0x9e32('0x29')],'sectionId':_0x11d8bd['id']},{})[_0x9e32('0x22')](function(){return _0x2cbebe;});}else{return _0x2cbebe;}})[_0x9e32('0x47')](function(_0x27c681){logger[_0x9e32('0x27')](_0x9e32('0x4f'),_0x27c681);throw _0x27c681;});}return _0x2cbebe;})[_0x9e32('0x22')](respondWithResult(_0x4cd60a,0xc9))[_0x9e32('0x47')](handleError(_0x4cd60a,null));};exports['update']=function(_0x5e16da,_0x4b997d){if(_0x5e16da[_0x9e32('0x50')]['id']){delete _0x5e16da[_0x9e32('0x50')]['id'];}return db[_0x9e32('0x2b')][_0x9e32('0x46')]({'where':{'id':_0x5e16da[_0x9e32('0x45')]['id']}})['then'](handleEntityNotFound(_0x4b997d,null))[_0x9e32('0x22')](saveUpdates(_0x5e16da[_0x9e32('0x50')],null))[_0x9e32('0x22')](respondWithResult(_0x4b997d,null))[_0x9e32('0x47')](handleError(_0x4b997d,null));};exports[_0x9e32('0x23')]=function(_0x5ca700,_0x3211ad){return db['CmHopperAdditionalPhone'][_0x9e32('0x46')]({'where':{'id':_0x5ca700[_0x9e32('0x45')]['id']}})['then'](handleEntityNotFound(_0x3211ad,null))[_0x9e32('0x22')](removeEntity(_0x3211ad,null))['catch'](handleError(_0x3211ad,null));};
\ No newline at end of file
diff --git a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model.js b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model.js
index 8dd634f..43122ab 100644
--- a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model.js
+++ b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x2a17=['path','rimraf','exports','CmHopperAdditionalPhone','util','../../config/logger','api','moment','bluebird'];(function(_0x4d1974,_0x49182b){var _0x135df5=function(_0x28f1ec){while(--_0x28f1ec){_0x4d1974['push'](_0x4d1974['shift']());}};_0x135df5(++_0x49182b);}(_0x2a17,0x1cf));var _0x72a1=function(_0xf362b8,_0x3e756b){_0xf362b8=_0xf362b8-0x0;var _0x13da7e=_0x2a17[_0xf362b8];return _0x13da7e;};'use strict';var _=require('lodash');var util=require(_0x72a1('0x0'));var logger=require(_0x72a1('0x1'))(_0x72a1('0x2'));var moment=require(_0x72a1('0x3'));var BPromise=require(_0x72a1('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x72a1('0x5'));var rimraf=require(_0x72a1('0x6'));var config=require('../../config/environment');var attributes=require('./cmHopperAdditionalPhone.attributes');module[_0x72a1('0x7')]=function(_0x419cd7,_0x5eb12b){return _0x419cd7['define'](_0x72a1('0x8'),attributes,{'tableName':'cm_hopper_additional_phones','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xa1a7=['../../config/environment','exports','define','CmHopperAdditionalPhone','cm_hopper_additional_phones','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x45815e,_0x1d806b){var _0x417b60=function(_0x2530ba){while(--_0x2530ba){_0x45815e['push'](_0x45815e['shift']());}};_0x417b60(++_0x1d806b);}(_0xa1a7,0x67));var _0x7a1a=function(_0x54fe4e,_0x153ebc){_0x54fe4e=_0x54fe4e-0x0;var _0x21ceae=_0xa1a7[_0x54fe4e];return _0x21ceae;};'use strict';var _=require(_0x7a1a('0x0'));var util=require(_0x7a1a('0x1'));var logger=require(_0x7a1a('0x2'))(_0x7a1a('0x3'));var moment=require(_0x7a1a('0x4'));var BPromise=require(_0x7a1a('0x5'));var rp=require(_0x7a1a('0x6'));var fs=require('fs');var path=require(_0x7a1a('0x7'));var rimraf=require(_0x7a1a('0x8'));var config=require(_0x7a1a('0x9'));var attributes=require('./cmHopperAdditionalPhone.attributes');module[_0x7a1a('0xa')]=function(_0x1e204c,_0x25b113){return _0x1e204c[_0x7a1a('0xb')](_0x7a1a('0xc'),attributes,{'tableName':_0x7a1a('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.rpc.js b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.rpc.js
index 7571814..9c6646a 100644
--- a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.rpc.js
+++ b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xe27a=['IncrementPreviewCounters','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','info','CmHopperAdditionalPhone,\x20%s,\x20%s','request\x20sent','CmHopperAdditionalPhone,\x20%s,\x20%s,\x20%s','error','message','catch','VerifyAdditionalPhones','CmHopper','findOne','ContactId','body','ListId','CampaignId','CmHopperAdditionalPhone','OrderBy','ASC','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countmachineretry','countagentrejectretry','entity','dialGlobalMaxRetry','countabandonedretry','SwapAdditionalPhones','VoiceQueueId','duration','waitTime','minutes','add','phone','createdAt','updatedAt','isNil','hopperToAdd','additionalToHop','sequelize','transaction','update'];(function(_0x291589,_0x394acd){var _0x304d5d=function(_0x12e247){while(--_0x12e247){_0x291589['push'](_0x291589['shift']());}};_0x304d5d(++_0x394acd);}(_0xe27a,0x6f));var _0xae27=function(_0x41aeac,_0x5312d4){_0x41aeac=_0x41aeac-0x0;var _0x1b9133=_0xe27a[_0x41aeac];return _0x1b9133;};'use strict';var _=require(_0xae27('0x0'));var util=require(_0xae27('0x1'));var moment=require(_0xae27('0x2'));var BPromise=require(_0xae27('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xae27('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xae27('0x5'));var logger=require(_0xae27('0x6'))(_0xae27('0x7'));var config=require(_0xae27('0x8'));var jayson=require(_0xae27('0x9'));var client=jayson['client'][_0xae27('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x50f7a2,_0x1c57d5,_0x1105c6){return new BPromise(function(_0x201a18,_0x513dae){return client['request'](_0x50f7a2,_0x1105c6)[_0xae27('0xb')](function(_0x44dfc5){logger[_0xae27('0xc')](_0xae27('0xd'),_0x1c57d5,_0xae27('0xe'));logger['debug'](_0xae27('0xf'),_0x1c57d5,_0xae27('0xe'),JSON['stringify'](_0x44dfc5));if(_0x44dfc5['error']){if(_0x44dfc5['error']['code']===0x1f4){logger['error'](_0xae27('0xd'),_0x1c57d5,_0x44dfc5[_0xae27('0x10')][_0xae27('0x11')]);return _0x513dae(_0x44dfc5[_0xae27('0x10')][_0xae27('0x11')]);}logger['error'](_0xae27('0xd'),_0x1c57d5,_0x44dfc5[_0xae27('0x10')][_0xae27('0x11')]);return _0x201a18(_0x44dfc5[_0xae27('0x10')][_0xae27('0x11')]);}else{logger['info'](_0xae27('0xd'),_0x1c57d5,_0xae27('0xe'));_0x201a18(_0x44dfc5['result']['message']);}})[_0xae27('0x12')](function(_0xa654f8){logger[_0xae27('0x10')](_0xae27('0xd'),_0x1c57d5,_0xa654f8);_0x513dae(_0xa654f8);});});}exports[_0xae27('0x13')]=function(_0x528bf7){var _0x3bd6ae=this;return new Promise(function(_0x249074,_0x2810e4){return db[_0xae27('0x14')][_0xae27('0x15')]({'raw':!![],'where':{'ContactId':_0x528bf7['body'][_0xae27('0x16')],'ListId':_0x528bf7[_0xae27('0x17')][_0xae27('0x18')],'VoiceQueueId':_0x528bf7[_0xae27('0x17')]['VoiceQueueId']===undefined?null:_0x528bf7['body']['VoiceQueueId'],'CampaignId':_0x528bf7[_0xae27('0x17')][_0xae27('0x19')]===undefined?null:_0x528bf7[_0xae27('0x17')][_0xae27('0x19')]}})[_0xae27('0xb')](function(_0x588777){if(_0x588777!=null){return db[_0xae27('0x1a')]['findOne']({'raw':!![],'where':{'CmHopperId':_0x588777['id'],'OrderBy':{'$gt':_0x588777[_0xae27('0x1b')]}},'order':[[_0xae27('0x1b'),_0xae27('0x1c')]]})[_0xae27('0xb')](function(_0x10c90b){var _0x350f3f=0x0;if(_0x10c90b){if(_0x10c90b[_0xae27('0x1d')]+_0x10c90b[_0xae27('0x1e')]+_0x10c90b[_0xae27('0x1f')]+_0x10c90b[_0xae27('0x20')]+_0x10c90b[_0xae27('0x21')]+_0x10c90b['countabandonedretry']+_0x10c90b[_0xae27('0x22')]+_0x10c90b[_0xae27('0x23')]<_0x528bf7[_0xae27('0x24')][_0xae27('0x25')])_0x350f3f=0x1;_0x249074({'additional':_0x350f3f});}else{return db['CmHopperAdditionalPhone']['findOne']({'raw':!![],'where':{'CmHopperId':_0x588777['id']},'order':[[_0xae27('0x1b'),'ASC']]})['then'](function(_0x8bd292){var _0x5dc62f=0x0;if(_0x8bd292){if(_0x8bd292[_0xae27('0x1d')]+_0x8bd292[_0xae27('0x1e')]+_0x8bd292[_0xae27('0x1f')]+_0x8bd292[_0xae27('0x20')]+_0x8bd292['countdropretry']+_0x8bd292[_0xae27('0x26')]+_0x8bd292[_0xae27('0x22')]+_0x8bd292[_0xae27('0x23')]<_0x528bf7[_0xae27('0x24')][_0xae27('0x25')])_0x5dc62f=0x1;_0x249074({'additional':_0x5dc62f});}else{_0x249074({'additional':0x0});}})[_0xae27('0x12')](function(_0x161882){logger[_0xae27('0x10')](_0xae27('0x13'),_0x161882[_0xae27('0x11')],_0x528bf7);_0x2810e4(_0x3bd6ae[_0xae27('0x10')](0x1f4,_0x161882[_0xae27('0x11')]));});}})['catch'](function(_0x15c1dd){logger[_0xae27('0x10')](_0xae27('0x13'),_0x15c1dd[_0xae27('0x11')],_0x528bf7);_0x2810e4(_0x3bd6ae[_0xae27('0x10')](0x1f4,_0x15c1dd[_0xae27('0x11')]));});}else _0x249074({'additional':0x0});});});};exports[_0xae27('0x27')]=function(_0x707b7a){var _0x5b6086=this;return new Promise(function(_0x2c7ff6,_0x20eba9){return db['CmHopper'][_0xae27('0x15')]({'raw':!![],'where':{'ContactId':_0x707b7a[_0xae27('0x17')][_0xae27('0x16')],'ListId':_0x707b7a[_0xae27('0x17')][_0xae27('0x18')],'VoiceQueueId':_0x707b7a[_0xae27('0x17')][_0xae27('0x28')]===undefined?null:_0x707b7a[_0xae27('0x17')][_0xae27('0x28')],'CampaignId':_0x707b7a['body'][_0xae27('0x19')]===undefined?null:_0x707b7a[_0xae27('0x17')][_0xae27('0x19')]}})[_0xae27('0xb')](function(_0x238d88){if(_0x238d88!=null){return db[_0xae27('0x1a')][_0xae27('0x15')]({'raw':!![],'where':{'CmHopperId':_0x238d88['id'],'OrderBy':{'$gt':_0x238d88[_0xae27('0x1b')]}},'order':[[_0xae27('0x1b'),'ASC']]})['then'](function(_0x22d015){if(_0x22d015)return activateAdditionalPhone(_0x238d88,_0x707b7a[_0xae27('0x17')],_0x22d015,_0x707b7a[_0xae27('0x29')],_0x707b7a[_0xae27('0x2a')])[_0xae27('0xb')](function(_0x1edc3f){_0x2c7ff6(_0x1edc3f);});else{return db[_0xae27('0x1a')][_0xae27('0x15')]({'raw':!![],'where':{'CmHopperId':_0x238d88['id']},'order':[[_0xae27('0x1b'),'ASC']]})[_0xae27('0xb')](function(_0x3c5ca2){if(_0x3c5ca2)return activateAdditionalPhone(_0x238d88,_0x707b7a['body'],_0x3c5ca2,_0x707b7a[_0xae27('0x29')],_0x707b7a[_0xae27('0x2a')])[_0xae27('0xb')](function(_0x490495){_0x2c7ff6(_0x490495);});else{_0x2c7ff6({'id':_0x238d88['id'],'phone':''});}})['catch'](function(_0x54d63c){logger[_0xae27('0x10')](_0xae27('0x13'),_0x54d63c[_0xae27('0x11')],_0x707b7a);_0x20eba9(_0x5b6086['error'](0x1f4,_0x54d63c['message']));});}})[_0xae27('0x12')](function(_0x49a061){logger[_0xae27('0x10')](_0xae27('0x13'),_0x49a061[_0xae27('0x11')],_0x707b7a);_0x20eba9(_0x5b6086[_0xae27('0x10')](0x1f4,_0x49a061['message']));});}else _0x2c7ff6(0x1);});});};function activateAdditionalPhone(_0x1d9859,_0x1e5c48,_0x1c4696,_0x502836,_0x1f4d63){return new Promise(function(_0x3677a1,_0x261bc2){logger[_0xae27('0xc')](_0xae27('0x13'),_0x1c4696);var _0xb5375;if(moment()>moment(_0x1c4696['scheduledat'])){_0xb5375=moment()['add'](_0x1f4d63||0x3,_0xae27('0x2b'));}else{if(_0x1c4696[_0xae27('0x1b')]==0x0){_0xb5375=moment(_0x1c4696['scheduledat']);}else{_0xb5375=moment()[_0xae27('0x2c')](_0x1f4d63||0x3,'minutes');}}var _0x2dffc0={'phone':_0x1d9859[_0xae27('0x2d')],'active':0x0,'OrderBy':_['isNil'](_0x1d9859[_0xae27('0x1b')])?0x0:_0x1d9859[_0xae27('0x1b')],'scheduledat':moment()[_0xae27('0x2c')](_0x502836||0x1,_0xae27('0x2b')),'countbusyretry':_0x1e5c48['countbusyretry'],'countcongestionretry':_0x1e5c48[_0xae27('0x1e')],'countnoanswerretry':_0x1e5c48[_0xae27('0x1f')],'countnosuchnumberretry':_0x1e5c48[_0xae27('0x20')],'countdropretry':_0x1e5c48[_0xae27('0x21')],'countabandonedretry':_0x1e5c48['countabandonedretry'],'countmachineretry':_0x1e5c48[_0xae27('0x22')],'countagentrejectretry':_0x1e5c48['countagentrejectretry'],'createdAt':_0x1e5c48[_0xae27('0x2e')],'updatedAt':_0x1e5c48[_0xae27('0x2f')]};var _0x4f2105={'CmHopperId':_0x1d9859['id'],'phone':_0x1c4696[_0xae27('0x2d')],'active':0x0,'OrderBy':_[_0xae27('0x30')](_0x1c4696[_0xae27('0x1b')])?0x0:_0x1c4696[_0xae27('0x1b')],'scheduledat':_0xb5375,'countbusyretry':_0x1c4696['countbusyretry'],'countcongestionretry':_0x1c4696[_0xae27('0x1e')],'countnoanswerretry':_0x1c4696[_0xae27('0x1f')],'countnosuchnumberretry':_0x1e5c48[_0xae27('0x20')],'countdropretry':_0x1e5c48[_0xae27('0x21')],'countabandonedretry':_0x1e5c48['countabandonedretry'],'countmachineretry':_0x1e5c48[_0xae27('0x22')],'countagentrejectretry':_0x1e5c48[_0xae27('0x23')],'createdAt':_0x1c4696[_0xae27('0x2e')],'updatedAt':_0x1c4696['updatedAt']};logger[_0xae27('0xc')](_0xae27('0x31'),_0x2dffc0);logger['info'](_0xae27('0x32'),_0x4f2105);return db[_0xae27('0x33')][_0xae27('0x34')](function(_0x13afa1){return db[_0xae27('0x1a')][_0xae27('0x35')](_0x2dffc0,{'where':{'id':_0x1c4696['id']}},{'transaction':_0x13afa1})[_0xae27('0xb')](function(){return db['CmHopper'][_0xae27('0x35')](_0x4f2105,{'where':{'id':_0x1d9859['id']}},{'transaction':_0x13afa1});});})[_0xae27('0xb')](function(_0x2088ca){_0x3677a1({'id':_0x1d9859['id'],'phone':_0x1c4696[_0xae27('0x2d')]});})[_0xae27('0x12')](function(_0x5497b3){logger[_0xae27('0x10')](_0xae27('0x13'),_0x5497b3['message'],req);_0x261bc2(_this['error'](0x1f4,_0x5497b3[_0xae27('0x11')]));});});}exports[_0xae27('0x36')]=function(_0x122046){var _0x2043a9=this;return new Promise(function(_0x22e7b1,_0x28dc28){return db[_0xae27('0x14')][_0xae27('0x35')](_0x122046[_0xae27('0x17')]['field'],{'where':{'id':_0x122046[_0xae27('0x17')]['id']}})['then'](function(_0x554dc2){_0x22e7b1(_0x554dc2);})['catch'](function(_0x3ce0ea){logger['error'](_0xae27('0x36'),_0x3ce0ea[_0xae27('0x11')],_0x122046);_0x28dc28(_0x2043a9['error'](0x1f4,_0x3ce0ea[_0xae27('0x11')]));});});};
\ No newline at end of file
+var _0xba9c=['hopperToAdd','additionalToHop','update','IncrementPreviewCounters','field','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request','info','debug','CmHopperAdditionalPhone,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','CmHopperAdditionalPhone,\x20%s,\x20%s','message','result','catch','VerifyAdditionalPhones','CmHopper','body','ContactId','ListId','VoiceQueueId','then','CmHopperAdditionalPhone','OrderBy','ASC','countbusyretry','countnoanswerretry','countabandonedretry','countmachineretry','countagentrejectretry','entity','dialGlobalMaxRetry','findOne','countcongestionretry','countdropretry','CampaignId','duration','waitTime','scheduledat','add','minutes','countnosuchnumberretry','createdAt','updatedAt','phone'];(function(_0x369e27,_0x7f5136){var _0x15b494=function(_0x4bca8d){while(--_0x4bca8d){_0x369e27['push'](_0x369e27['shift']());}};_0x15b494(++_0x7f5136);}(_0xba9c,0xad));var _0xcba9=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xba9c[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0xcba9('0x0'));var moment=require(_0xcba9('0x1'));var BPromise=require(_0xcba9('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xcba9('0x3'));var db=require(_0xcba9('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xcba9('0x5'))(_0xcba9('0x6'));var config=require(_0xcba9('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xcba9('0x8')][_0xcba9('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x98f66c,_0x2a3c6b,_0x5653bb){return new BPromise(function(_0x576e9c,_0x4a11da){return client[_0xcba9('0xa')](_0x98f66c,_0x5653bb)['then'](function(_0x39815f){logger[_0xcba9('0xb')]('CmHopperAdditionalPhone,\x20%s,\x20%s',_0x2a3c6b,'request\x20sent');logger[_0xcba9('0xc')](_0xcba9('0xd'),_0x2a3c6b,_0xcba9('0xe'),JSON['stringify'](_0x39815f));if(_0x39815f[_0xcba9('0xf')]){if(_0x39815f[_0xcba9('0xf')][_0xcba9('0x10')]===0x1f4){logger['error'](_0xcba9('0x11'),_0x2a3c6b,_0x39815f[_0xcba9('0xf')][_0xcba9('0x12')]);return _0x4a11da(_0x39815f[_0xcba9('0xf')][_0xcba9('0x12')]);}logger[_0xcba9('0xf')](_0xcba9('0x11'),_0x2a3c6b,_0x39815f[_0xcba9('0xf')][_0xcba9('0x12')]);return _0x576e9c(_0x39815f[_0xcba9('0xf')][_0xcba9('0x12')]);}else{logger['info'](_0xcba9('0x11'),_0x2a3c6b,_0xcba9('0xe'));_0x576e9c(_0x39815f[_0xcba9('0x13')][_0xcba9('0x12')]);}})[_0xcba9('0x14')](function(_0xc2d12c){logger[_0xcba9('0xf')](_0xcba9('0x11'),_0x2a3c6b,_0xc2d12c);_0x4a11da(_0xc2d12c);});});}exports[_0xcba9('0x15')]=function(_0xf22f9){var _0x523c53=this;return new Promise(function(_0x120761,_0x50a833){return db[_0xcba9('0x16')]['findOne']({'raw':!![],'where':{'ContactId':_0xf22f9[_0xcba9('0x17')][_0xcba9('0x18')],'ListId':_0xf22f9[_0xcba9('0x17')][_0xcba9('0x19')],'VoiceQueueId':_0xf22f9[_0xcba9('0x17')][_0xcba9('0x1a')]===undefined?null:_0xf22f9[_0xcba9('0x17')][_0xcba9('0x1a')],'CampaignId':_0xf22f9[_0xcba9('0x17')]['CampaignId']===undefined?null:_0xf22f9[_0xcba9('0x17')]['CampaignId']}})[_0xcba9('0x1b')](function(_0x4592af){if(_0x4592af!=null){return db[_0xcba9('0x1c')]['findOne']({'raw':!![],'where':{'CmHopperId':_0x4592af['id'],'OrderBy':{'$gt':_0x4592af[_0xcba9('0x1d')]}},'order':[[_0xcba9('0x1d'),_0xcba9('0x1e')]]})[_0xcba9('0x1b')](function(_0x261b49){var _0xa4a3e1=0x0;if(_0x261b49){if(_0x261b49[_0xcba9('0x1f')]+_0x261b49['countcongestionretry']+_0x261b49[_0xcba9('0x20')]+_0x261b49['countnosuchnumberretry']+_0x261b49['countdropretry']+_0x261b49[_0xcba9('0x21')]+_0x261b49[_0xcba9('0x22')]+_0x261b49[_0xcba9('0x23')]<_0xf22f9[_0xcba9('0x24')][_0xcba9('0x25')])_0xa4a3e1=0x1;_0x120761({'additional':_0xa4a3e1});}else{return db[_0xcba9('0x1c')][_0xcba9('0x26')]({'raw':!![],'where':{'CmHopperId':_0x4592af['id']},'order':[[_0xcba9('0x1d'),_0xcba9('0x1e')]]})[_0xcba9('0x1b')](function(_0x3dbb0a){var _0x13b86f=0x0;if(_0x3dbb0a){if(_0x3dbb0a[_0xcba9('0x1f')]+_0x3dbb0a[_0xcba9('0x27')]+_0x3dbb0a['countnoanswerretry']+_0x3dbb0a['countnosuchnumberretry']+_0x3dbb0a[_0xcba9('0x28')]+_0x3dbb0a[_0xcba9('0x21')]+_0x3dbb0a['countmachineretry']+_0x3dbb0a[_0xcba9('0x23')]<_0xf22f9[_0xcba9('0x24')][_0xcba9('0x25')])_0x13b86f=0x1;_0x120761({'additional':_0x13b86f});}else{_0x120761({'additional':0x0});}})[_0xcba9('0x14')](function(_0x11a0b5){logger[_0xcba9('0xf')]('VerifyAdditionalPhones',_0x11a0b5['message'],_0xf22f9);_0x50a833(_0x523c53[_0xcba9('0xf')](0x1f4,_0x11a0b5['message']));});}})[_0xcba9('0x14')](function(_0x39a8bc){logger['error'](_0xcba9('0x15'),_0x39a8bc[_0xcba9('0x12')],_0xf22f9);_0x50a833(_0x523c53[_0xcba9('0xf')](0x1f4,_0x39a8bc[_0xcba9('0x12')]));});}else _0x120761({'additional':0x0});});});};exports['SwapAdditionalPhones']=function(_0x5644d4){var _0x539d3b=this;return new Promise(function(_0x363f5b,_0x5315f5){return db['CmHopper'][_0xcba9('0x26')]({'raw':!![],'where':{'ContactId':_0x5644d4['body'][_0xcba9('0x18')],'ListId':_0x5644d4[_0xcba9('0x17')][_0xcba9('0x19')],'VoiceQueueId':_0x5644d4[_0xcba9('0x17')]['VoiceQueueId']===undefined?null:_0x5644d4[_0xcba9('0x17')][_0xcba9('0x1a')],'CampaignId':_0x5644d4[_0xcba9('0x17')]['CampaignId']===undefined?null:_0x5644d4['body'][_0xcba9('0x29')]}})[_0xcba9('0x1b')](function(_0x1e5a76){if(_0x1e5a76!=null){return db[_0xcba9('0x1c')][_0xcba9('0x26')]({'raw':!![],'where':{'CmHopperId':_0x1e5a76['id'],'OrderBy':{'$gt':_0x1e5a76[_0xcba9('0x1d')]}},'order':[['OrderBy',_0xcba9('0x1e')]]})[_0xcba9('0x1b')](function(_0x17ca58){if(_0x17ca58)return activateAdditionalPhone(_0x1e5a76,_0x5644d4[_0xcba9('0x17')],_0x17ca58,_0x5644d4[_0xcba9('0x2a')],_0x5644d4['waitTime'])[_0xcba9('0x1b')](function(_0x547463){_0x363f5b(_0x547463);});else{return db[_0xcba9('0x1c')][_0xcba9('0x26')]({'raw':!![],'where':{'CmHopperId':_0x1e5a76['id']},'order':[[_0xcba9('0x1d'),'ASC']]})[_0xcba9('0x1b')](function(_0x2a16c5){if(_0x2a16c5)return activateAdditionalPhone(_0x1e5a76,_0x5644d4['body'],_0x2a16c5,_0x5644d4['duration'],_0x5644d4[_0xcba9('0x2b')])[_0xcba9('0x1b')](function(_0x404816){_0x363f5b(_0x404816);});else{_0x363f5b({'id':_0x1e5a76['id'],'phone':''});}})[_0xcba9('0x14')](function(_0xda9343){logger[_0xcba9('0xf')](_0xcba9('0x15'),_0xda9343[_0xcba9('0x12')],_0x5644d4);_0x5315f5(_0x539d3b[_0xcba9('0xf')](0x1f4,_0xda9343[_0xcba9('0x12')]));});}})[_0xcba9('0x14')](function(_0x49c8d3){logger[_0xcba9('0xf')]('VerifyAdditionalPhones',_0x49c8d3[_0xcba9('0x12')],_0x5644d4);_0x5315f5(_0x539d3b[_0xcba9('0xf')](0x1f4,_0x49c8d3[_0xcba9('0x12')]));});}else _0x363f5b(0x1);});});};function activateAdditionalPhone(_0x225590,_0x230bef,_0x31d8c6,_0x9b561e,_0x588a7f){return new Promise(function(_0x3e4149,_0x31bd1c){logger[_0xcba9('0xb')](_0xcba9('0x15'),_0x31d8c6);var _0x3856f2;if(moment()>moment(_0x31d8c6[_0xcba9('0x2c')])){_0x3856f2=moment()[_0xcba9('0x2d')](_0x588a7f||0x3,_0xcba9('0x2e'));}else{if(_0x31d8c6[_0xcba9('0x1d')]==0x0){_0x3856f2=moment(_0x31d8c6['scheduledat']);}else{_0x3856f2=moment()[_0xcba9('0x2d')](_0x588a7f||0x3,_0xcba9('0x2e'));}}var _0x361a38={'phone':_0x225590['phone'],'active':0x0,'OrderBy':_['isNil'](_0x225590[_0xcba9('0x1d')])?0x0:_0x225590[_0xcba9('0x1d')],'scheduledat':moment()[_0xcba9('0x2d')](_0x9b561e||0x1,_0xcba9('0x2e')),'countbusyretry':_0x230bef[_0xcba9('0x1f')],'countcongestionretry':_0x230bef[_0xcba9('0x27')],'countnoanswerretry':_0x230bef['countnoanswerretry'],'countnosuchnumberretry':_0x230bef[_0xcba9('0x2f')],'countdropretry':_0x230bef[_0xcba9('0x28')],'countabandonedretry':_0x230bef[_0xcba9('0x21')],'countmachineretry':_0x230bef[_0xcba9('0x22')],'countagentrejectretry':_0x230bef['countagentrejectretry'],'createdAt':_0x230bef[_0xcba9('0x30')],'updatedAt':_0x230bef[_0xcba9('0x31')]};var _0x39a586={'CmHopperId':_0x225590['id'],'phone':_0x31d8c6[_0xcba9('0x32')],'active':0x0,'OrderBy':_['isNil'](_0x31d8c6['OrderBy'])?0x0:_0x31d8c6['OrderBy'],'scheduledat':_0x3856f2,'countbusyretry':_0x31d8c6[_0xcba9('0x1f')],'countcongestionretry':_0x31d8c6[_0xcba9('0x27')],'countnoanswerretry':_0x31d8c6['countnoanswerretry'],'countnosuchnumberretry':_0x230bef['countnosuchnumberretry'],'countdropretry':_0x230bef['countdropretry'],'countabandonedretry':_0x230bef[_0xcba9('0x21')],'countmachineretry':_0x230bef[_0xcba9('0x22')],'countagentrejectretry':_0x230bef[_0xcba9('0x23')],'createdAt':_0x31d8c6[_0xcba9('0x30')],'updatedAt':_0x31d8c6[_0xcba9('0x31')]};logger['info'](_0xcba9('0x33'),_0x361a38);logger['info'](_0xcba9('0x34'),_0x39a586);return db['sequelize']['transaction'](function(_0x3ad21e){return db[_0xcba9('0x1c')]['update'](_0x361a38,{'where':{'id':_0x31d8c6['id']}},{'transaction':_0x3ad21e})[_0xcba9('0x1b')](function(){return db[_0xcba9('0x16')][_0xcba9('0x35')](_0x39a586,{'where':{'id':_0x225590['id']}},{'transaction':_0x3ad21e});});})[_0xcba9('0x1b')](function(_0x10461a){_0x3e4149({'id':_0x225590['id'],'phone':_0x31d8c6[_0xcba9('0x32')]});})[_0xcba9('0x14')](function(_0xcc9c61){logger[_0xcba9('0xf')](_0xcba9('0x15'),_0xcc9c61[_0xcba9('0x12')],req);_0x31bd1c(_this[_0xcba9('0xf')](0x1f4,_0xcc9c61[_0xcba9('0x12')]));});});}exports[_0xcba9('0x36')]=function(_0x1899f6){var _0x3fc75e=this;return new Promise(function(_0x1519e0,_0x30e847){return db['CmHopper'][_0xcba9('0x35')](_0x1899f6[_0xcba9('0x17')][_0xcba9('0x37')],{'where':{'id':_0x1899f6[_0xcba9('0x17')]['id']}})['then'](function(_0x15a094){_0x1519e0(_0x15a094);})[_0xcba9('0x14')](function(_0x945aea){logger[_0xcba9('0xf')](_0xcba9('0x36'),_0x945aea[_0xcba9('0x12')],_0x1899f6);_0x30e847(_0x3fc75e[_0xcba9('0xf')](0x1f4,_0x945aea[_0xcba9('0x12')]));});});};
\ No newline at end of file
diff --git a/server/api/cmHopperAdditionalPhone/index.js b/server/api/cmHopperAdditionalPhone/index.js
index ee277b9..e981375 100644
--- a/server/api/cmHopperAdditionalPhone/index.js
+++ b/server/api/cmHopperAdditionalPhone/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x025e=['/:id','post','create','put','update','destroy','multer','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x025e,0x116));var _0xe025=function(_0x1d24eb,_0x12295b){_0x1d24eb=_0x1d24eb-0x0;var _0x1dc576=_0x025e[_0x1d24eb];return _0x1dc576;};'use strict';var multer=require(_0xe025('0x0'));var util=require('util');var path=require(_0xe025('0x1'));var timeout=require(_0xe025('0x2'));var express=require('express');var router=express[_0xe025('0x3')]();var auth=require(_0xe025('0x4'));var interaction=require(_0xe025('0x5'));var config=require(_0xe025('0x6'));var controller=require('./cmHopperAdditionalPhone.controller');router[_0xe025('0x7')]('/',auth[_0xe025('0x8')](),controller[_0xe025('0x9')]);router[_0xe025('0x7')](_0xe025('0xa'),auth[_0xe025('0x8')](),controller['show']);router[_0xe025('0xb')]('/',auth[_0xe025('0x8')](),controller[_0xe025('0xc')]);router[_0xe025('0xd')](_0xe025('0xa'),auth[_0xe025('0x8')](),controller[_0xe025('0xe')]);router['delete']('/:id',auth[_0xe025('0x8')](),controller[_0xe025('0xf')]);module['exports']=router;
\ No newline at end of file
+var _0xbc7b=['util','express','Router','../../components/auth/service','../../components/interaction/service','./cmHopperAdditionalPhone.controller','get','isAuthenticated','index','/:id','show','create','put','update','delete','destroy','exports'];(function(_0x25537b,_0xa4df9d){var _0x971069=function(_0x46e745){while(--_0x46e745){_0x25537b['push'](_0x25537b['shift']());}};_0x971069(++_0xa4df9d);}(_0xbc7b,0x1ed));var _0xbbc7=function(_0x250c2e,_0x27642e){_0x250c2e=_0x250c2e-0x0;var _0x153d56=_0xbc7b[_0x250c2e];return _0x153d56;};'use strict';var multer=require('multer');var util=require(_0xbbc7('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xbbc7('0x1'));var router=express[_0xbbc7('0x2')]();var auth=require(_0xbbc7('0x3'));var interaction=require(_0xbbc7('0x4'));var config=require('../../config/environment');var controller=require(_0xbbc7('0x5'));router[_0xbbc7('0x6')]('/',auth[_0xbbc7('0x7')](),controller[_0xbbc7('0x8')]);router[_0xbbc7('0x6')](_0xbbc7('0x9'),auth[_0xbbc7('0x7')](),controller[_0xbbc7('0xa')]);router['post']('/',auth['isAuthenticated'](),controller[_0xbbc7('0xb')]);router[_0xbbc7('0xc')](_0xbbc7('0x9'),auth[_0xbbc7('0x7')](),controller[_0xbbc7('0xd')]);router[_0xbbc7('0xe')](_0xbbc7('0x9'),auth[_0xbbc7('0x7')](),controller[_0xbbc7('0xf')]);module[_0xbbc7('0x10')]=router;
\ No newline at end of file
diff --git a/server/api/cmHopperBlack/cmHopperBlack.attributes.js b/server/api/cmHopperBlack/cmHopperBlack.attributes.js
index 373dfb5..581dd2d 100644
--- a/server/api/cmHopperBlack/cmHopperBlack.attributes.js
+++ b/server/api/cmHopperBlack/cmHopperBlack.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xbf74=['contactListQueue','moment','sequelize','exports','STRING','INTEGER'];(function(_0x5262e8,_0x458199){var _0x4426b5=function(_0x32d969){while(--_0x32d969){_0x5262e8['push'](_0x5262e8['shift']());}};_0x4426b5(++_0x458199);}(_0xbf74,0x10f));var _0x4bf7=function(_0x15740a,_0x511855){_0x15740a=_0x15740a-0x0;var _0x1938d6=_0xbf74[_0x15740a];return _0x1938d6;};'use strict';var moment=require(_0x4bf7('0x0'));var Sequelize=require(_0x4bf7('0x1'));module[_0x4bf7('0x2')]={'phone':{'type':Sequelize[_0x4bf7('0x3')],'allowNull':![]},'ContactId':{'type':Sequelize[_0x4bf7('0x4')],'unique':_0x4bf7('0x5')},'ListId':{'type':Sequelize[_0x4bf7('0x4')],'unique':_0x4bf7('0x5')},'VoiceQueueId':{'type':Sequelize['INTEGER'],'unique':'contactListQueue'}};
\ No newline at end of file
+var _0xcd61=['contactListQueue','sequelize','exports','INTEGER'];(function(_0x490bdb,_0x1ee49c){var _0x5aa1cc=function(_0x399d83){while(--_0x399d83){_0x490bdb['push'](_0x490bdb['shift']());}};_0x5aa1cc(++_0x1ee49c);}(_0xcd61,0x1a9));var _0x1cd6=function(_0x56dabd,_0x283fee){_0x56dabd=_0x56dabd-0x0;var _0x94031e=_0xcd61[_0x56dabd];return _0x94031e;};'use strict';var moment=require('moment');var Sequelize=require(_0x1cd6('0x0'));module[_0x1cd6('0x1')]={'phone':{'type':Sequelize['STRING'],'allowNull':![]},'ContactId':{'type':Sequelize[_0x1cd6('0x2')],'unique':'contactListQueue'},'ListId':{'type':Sequelize['INTEGER'],'unique':_0x1cd6('0x3')},'VoiceQueueId':{'type':Sequelize[_0x1cd6('0x2')],'unique':_0x1cd6('0x3')}};
\ No newline at end of file
diff --git a/server/api/cmHopperBlack/cmHopperBlack.controller.js b/server/api/cmHopperBlack/cmHopperBlack.controller.js
index 925e9db..17225a0 100644
--- a/server/api/cmHopperBlack/cmHopperBlack.controller.js
+++ b/server/api/cmHopperBlack/cmHopperBlack.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xa9e0=['sort','where','pick','filter','VIRTUAL','merge','options','include','findAll','catch','params','includeAll','body','find','describe','html-pdf','eml-format','rimraf','request-promise','bluebird','mustache','util','path','sox','ejs','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../mysqldb','sendStatus','status','json','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','end','error','name','send','index','map','CmHopperBlack','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','limit'];(function(_0x3d5f2e,_0x338d17){var _0xd65dfc=function(_0xd87221){while(--_0xd87221){_0x3d5f2e['push'](_0x3d5f2e['shift']());}};_0xd65dfc(++_0x338d17);}(_0xa9e0,0x123));var _0x0a9e=function(_0x49ca18,_0x5e6d05){_0x49ca18=_0x49ca18-0x0;var _0x145d54=_0xa9e0[_0x49ca18];return _0x145d54;};'use strict';var pdf=require(_0x0a9e('0x0'));var emlformat=require(_0x0a9e('0x1'));var rimraf=require(_0x0a9e('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0a9e('0x3'));var moment=require('moment');var BPromise=require(_0x0a9e('0x4'));var Mustache=require(_0x0a9e('0x5'));var util=require(_0x0a9e('0x6'));var path=require(_0x0a9e('0x7'));var sox=require(_0x0a9e('0x8'));var csv=require('to-csv');var ejs=require(_0x0a9e('0x9'));var fs=require('fs');var _=require(_0x0a9e('0xa'));var squel=require(_0x0a9e('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0a9e('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0a9e('0xd'));var Redis=require(_0x0a9e('0xe'));var authService=require(_0x0a9e('0xf'));var qs=require(_0x0a9e('0x10'));var as=require(_0x0a9e('0x11'));var hardwareService=require(_0x0a9e('0x12'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x0a9e('0x13'))['db'];function respondWithStatusCode(_0x36471c,_0xd5b662){_0xd5b662=_0xd5b662||0xcc;return function(_0x26d672){if(_0x26d672){return _0x36471c[_0x0a9e('0x14')](_0xd5b662);}return _0x36471c[_0x0a9e('0x15')](_0xd5b662)['end']();};}function respondWithResult(_0x4283ce,_0x239b12){_0x239b12=_0x239b12||0xc8;return function(_0x2b4227){if(_0x2b4227){return _0x4283ce[_0x0a9e('0x15')](_0x239b12)[_0x0a9e('0x16')](_0x2b4227);}};}function respondWithFilteredResult(_0x4d5611,_0x52a03d){return function(_0x22dccb){if(_0x22dccb){var _0x5d0880=_0x22dccb[_0x0a9e('0x17')],_0x1985b6=_0x52a03d['offset'],_0x519dfd=_0x52a03d[_0x0a9e('0x18')]+_0x52a03d['limit'],_0x16033c;if(_0x519dfd>=_0x5d0880){_0x519dfd=_0x5d0880;_0x16033c=0xc8;}else{_0x16033c=0xce;}_0x4d5611[_0x0a9e('0x15')](_0x16033c);return _0x4d5611[_0x0a9e('0x19')](_0x0a9e('0x1a'),_0x1985b6+'-'+_0x519dfd+'/'+_0x5d0880)[_0x0a9e('0x16')](_0x22dccb);}return null;};}function patchUpdates(_0x31b1ca){return function(_0x2eb11f){try{jsonpatch[_0x0a9e('0x1b')](_0x2eb11f,_0x31b1ca,!![]);}catch(_0x20559e){return BPromise[_0x0a9e('0x1c')](_0x20559e);}return _0x2eb11f[_0x0a9e('0x1d')]();};}function saveUpdates(_0x1c696a,_0x105080){return function(_0x4bb1e3){if(_0x4bb1e3){return _0x4bb1e3[_0x0a9e('0x1e')](_0x1c696a)[_0x0a9e('0x1f')](function(_0x53682f){return _0x53682f;});}return null;};}function removeEntity(_0x20f109,_0x5a09ef){return function(_0x588269){if(_0x588269){return _0x588269[_0x0a9e('0x20')]()[_0x0a9e('0x1f')](function(){_0x20f109[_0x0a9e('0x15')](0xcc)[_0x0a9e('0x21')]();});}};}function handleEntityNotFound(_0x4abc77,_0xfb6e48){return function(_0x2fb0e4){if(!_0x2fb0e4){_0x4abc77[_0x0a9e('0x14')](0x194);}return _0x2fb0e4;};}function handleError(_0x4d00e6,_0x370d86){_0x370d86=_0x370d86||0x1f4;return function(_0x42ac8f){logger[_0x0a9e('0x22')](_0x42ac8f['stack']);if(_0x42ac8f['name']){delete _0x42ac8f[_0x0a9e('0x23')];}_0x4d00e6[_0x0a9e('0x15')](_0x370d86)[_0x0a9e('0x24')](_0x42ac8f);};}exports[_0x0a9e('0x25')]=function(_0x526cf3,_0x384319){var _0x479bc4={},_0x45a1e7={},_0x5bfb33={'count':0x0,'rows':[]};var _0x1dc186=_[_0x0a9e('0x26')](db[_0x0a9e('0x27')][_0x0a9e('0x28')],function(_0x140511){return{'name':_0x140511[_0x0a9e('0x29')],'type':_0x140511[_0x0a9e('0x2a')][_0x0a9e('0x2b')]};});_0x45a1e7['model']=_[_0x0a9e('0x26')](_0x1dc186,_0x0a9e('0x23'));_0x45a1e7[_0x0a9e('0x2c')]=_[_0x0a9e('0x2d')](_0x526cf3['query']);_0x45a1e7[_0x0a9e('0x2e')]=_[_0x0a9e('0x2f')](_0x45a1e7[_0x0a9e('0x30')],_0x45a1e7[_0x0a9e('0x2c')]);_0x479bc4[_0x0a9e('0x31')]=_[_0x0a9e('0x2f')](_0x45a1e7[_0x0a9e('0x30')],qs[_0x0a9e('0x32')](_0x526cf3[_0x0a9e('0x2c')]['fields']));_0x479bc4[_0x0a9e('0x31')]=_0x479bc4['attributes'][_0x0a9e('0x33')]?_0x479bc4[_0x0a9e('0x31')]:_0x45a1e7[_0x0a9e('0x30')];if(!_0x526cf3[_0x0a9e('0x2c')][_0x0a9e('0x34')]('nolimit')){_0x479bc4[_0x0a9e('0x35')]=qs[_0x0a9e('0x35')](_0x526cf3[_0x0a9e('0x2c')][_0x0a9e('0x35')]);_0x479bc4[_0x0a9e('0x18')]=qs[_0x0a9e('0x18')](_0x526cf3[_0x0a9e('0x2c')][_0x0a9e('0x18')]);}_0x479bc4['order']=qs[_0x0a9e('0x36')](_0x526cf3['query'][_0x0a9e('0x36')]);_0x479bc4[_0x0a9e('0x37')]=qs[_0x0a9e('0x2e')](_[_0x0a9e('0x38')](_0x526cf3['query'],_0x45a1e7[_0x0a9e('0x2e')]),_0x1dc186);if(_0x526cf3[_0x0a9e('0x2c')][_0x0a9e('0x39')]){_0x479bc4[_0x0a9e('0x37')]=_['merge'](_0x479bc4['where'],{'$or':_[_0x0a9e('0x26')](_0x1dc186,function(_0x5640eb){if(_0x5640eb[_0x0a9e('0x2a')]!==_0x0a9e('0x3a')){var _0x381c37={};_0x381c37[_0x5640eb[_0x0a9e('0x23')]]={'$like':'%'+_0x526cf3['query'][_0x0a9e('0x39')]+'%'};return _0x381c37;}})});}_0x479bc4=_[_0x0a9e('0x3b')]({},_0x479bc4,_0x526cf3[_0x0a9e('0x3c')]);var _0x533942={'where':_0x479bc4[_0x0a9e('0x37')]};return db[_0x0a9e('0x27')][_0x0a9e('0x17')](_0x533942)['then'](function(_0x546ef8){_0x5bfb33[_0x0a9e('0x17')]=_0x546ef8;if(_0x526cf3[_0x0a9e('0x2c')]['includeAll']){_0x479bc4[_0x0a9e('0x3d')]=[{'all':!![]}];}return db[_0x0a9e('0x27')][_0x0a9e('0x3e')](_0x479bc4);})[_0x0a9e('0x1f')](function(_0x4b38d9){_0x5bfb33['rows']=_0x4b38d9;return _0x5bfb33;})[_0x0a9e('0x1f')](respondWithFilteredResult(_0x384319,_0x479bc4))[_0x0a9e('0x3f')](handleError(_0x384319,null));};exports['show']=function(_0x183991,_0x1dec2e){var _0x1459bb={'raw':!![],'where':{'id':_0x183991[_0x0a9e('0x40')]['id']}},_0x5b4f5e={};_0x5b4f5e[_0x0a9e('0x30')]=_[_0x0a9e('0x2d')](db[_0x0a9e('0x27')][_0x0a9e('0x28')]);_0x5b4f5e[_0x0a9e('0x2c')]=_[_0x0a9e('0x2d')](_0x183991[_0x0a9e('0x2c')]);_0x5b4f5e[_0x0a9e('0x2e')]=_[_0x0a9e('0x2f')](_0x5b4f5e[_0x0a9e('0x30')],_0x5b4f5e[_0x0a9e('0x2c')]);_0x1459bb[_0x0a9e('0x31')]=_[_0x0a9e('0x2f')](_0x5b4f5e[_0x0a9e('0x30')],qs['fields'](_0x183991['query'][_0x0a9e('0x32')]));_0x1459bb[_0x0a9e('0x31')]=_0x1459bb[_0x0a9e('0x31')][_0x0a9e('0x33')]?_0x1459bb[_0x0a9e('0x31')]:_0x5b4f5e[_0x0a9e('0x30')];if(_0x183991[_0x0a9e('0x2c')][_0x0a9e('0x41')]){_0x1459bb[_0x0a9e('0x3d')]=[{'all':!![]}];}_0x1459bb=_[_0x0a9e('0x3b')]({},_0x1459bb,_0x183991[_0x0a9e('0x3c')]);return db[_0x0a9e('0x27')]['find'](_0x1459bb)[_0x0a9e('0x1f')](handleEntityNotFound(_0x1dec2e,null))[_0x0a9e('0x1f')](respondWithResult(_0x1dec2e,null))[_0x0a9e('0x3f')](handleError(_0x1dec2e,null));};exports[_0x0a9e('0x1e')]=function(_0x2e8caf,_0xbe9d19){if(_0x2e8caf[_0x0a9e('0x42')]['id']){delete _0x2e8caf[_0x0a9e('0x42')]['id'];}return db['CmHopperBlack'][_0x0a9e('0x43')]({'where':{'id':_0x2e8caf['params']['id']}})[_0x0a9e('0x1f')](handleEntityNotFound(_0xbe9d19,null))[_0x0a9e('0x1f')](saveUpdates(_0x2e8caf[_0x0a9e('0x42')],null))['then'](respondWithResult(_0xbe9d19,null))[_0x0a9e('0x3f')](handleError(_0xbe9d19,null));};exports[_0x0a9e('0x20')]=function(_0x4774f4,_0x34aa5a){return db[_0x0a9e('0x27')][_0x0a9e('0x43')]({'where':{'id':_0x4774f4[_0x0a9e('0x40')]['id']}})['then'](handleEntityNotFound(_0x34aa5a,null))[_0x0a9e('0x1f')](removeEntity(_0x34aa5a,null))[_0x0a9e('0x3f')](handleError(_0x34aa5a,null));};exports[_0x0a9e('0x44')]=function(_0x16f976,_0x409789){return db[_0x0a9e('0x27')][_0x0a9e('0x44')]()[_0x0a9e('0x1f')](respondWithResult(_0x409789,null))[_0x0a9e('0x3f')](handleError(_0x409789,null));};
\ No newline at end of file
+var _0xa9e0=['sort','where','pick','filter','VIRTUAL','merge','options','include','findAll','catch','params','includeAll','body','find','describe','html-pdf','eml-format','rimraf','request-promise','bluebird','mustache','util','path','sox','ejs','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../mysqldb','sendStatus','status','json','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','end','error','name','send','index','map','CmHopperBlack','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','limit'];(function(_0x374a97,_0x3e05df){var _0x1d79b7=function(_0x27d4be){while(--_0x27d4be){_0x374a97['push'](_0x374a97['shift']());}};_0x1d79b7(++_0x3e05df);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5c351c,_0x2046d8){_0x5c351c=_0x5c351c-0x0;var _0x26f3b3=_0xa9e0[_0x5c351c];return _0x26f3b3;};'use strict';var pdf=require(_0x0a9e('0x0'));var emlformat=require(_0x0a9e('0x1'));var rimraf=require(_0x0a9e('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0a9e('0x3'));var moment=require('moment');var BPromise=require(_0x0a9e('0x4'));var Mustache=require(_0x0a9e('0x5'));var util=require(_0x0a9e('0x6'));var path=require(_0x0a9e('0x7'));var sox=require(_0x0a9e('0x8'));var csv=require('to-csv');var ejs=require(_0x0a9e('0x9'));var fs=require('fs');var _=require(_0x0a9e('0xa'));var squel=require(_0x0a9e('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0a9e('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0a9e('0xd'));var Redis=require(_0x0a9e('0xe'));var authService=require(_0x0a9e('0xf'));var qs=require(_0x0a9e('0x10'));var as=require(_0x0a9e('0x11'));var hardwareService=require(_0x0a9e('0x12'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x0a9e('0x13'))['db'];function respondWithStatusCode(_0x36471c,_0xd5b662){_0xd5b662=_0xd5b662||0xcc;return function(_0x26d672){if(_0x26d672){return _0x36471c[_0x0a9e('0x14')](_0xd5b662);}return _0x36471c[_0x0a9e('0x15')](_0xd5b662)['end']();};}function respondWithResult(_0x4283ce,_0x239b12){_0x239b12=_0x239b12||0xc8;return function(_0x2b4227){if(_0x2b4227){return _0x4283ce[_0x0a9e('0x15')](_0x239b12)[_0x0a9e('0x16')](_0x2b4227);}};}function respondWithFilteredResult(_0x4d5611,_0x52a03d){return function(_0x22dccb){if(_0x22dccb){var _0x5d0880=_0x22dccb[_0x0a9e('0x17')],_0x1985b6=_0x52a03d['offset'],_0x519dfd=_0x52a03d[_0x0a9e('0x18')]+_0x52a03d['limit'],_0x16033c;if(_0x519dfd>=_0x5d0880){_0x519dfd=_0x5d0880;_0x16033c=0xc8;}else{_0x16033c=0xce;}_0x4d5611[_0x0a9e('0x15')](_0x16033c);return _0x4d5611[_0x0a9e('0x19')](_0x0a9e('0x1a'),_0x1985b6+'-'+_0x519dfd+'/'+_0x5d0880)[_0x0a9e('0x16')](_0x22dccb);}return null;};}function patchUpdates(_0x31b1ca){return function(_0x2eb11f){try{jsonpatch[_0x0a9e('0x1b')](_0x2eb11f,_0x31b1ca,!![]);}catch(_0x20559e){return BPromise[_0x0a9e('0x1c')](_0x20559e);}return _0x2eb11f[_0x0a9e('0x1d')]();};}function saveUpdates(_0x1c696a,_0x105080){return function(_0x4bb1e3){if(_0x4bb1e3){return _0x4bb1e3[_0x0a9e('0x1e')](_0x1c696a)[_0x0a9e('0x1f')](function(_0x53682f){return _0x53682f;});}return null;};}function removeEntity(_0x20f109,_0x5a09ef){return function(_0x588269){if(_0x588269){return _0x588269[_0x0a9e('0x20')]()[_0x0a9e('0x1f')](function(){_0x20f109[_0x0a9e('0x15')](0xcc)[_0x0a9e('0x21')]();});}};}function handleEntityNotFound(_0x4abc77,_0xfb6e48){return function(_0x2fb0e4){if(!_0x2fb0e4){_0x4abc77[_0x0a9e('0x14')](0x194);}return _0x2fb0e4;};}function handleError(_0x4d00e6,_0x370d86){_0x370d86=_0x370d86||0x1f4;return function(_0x42ac8f){logger[_0x0a9e('0x22')](_0x42ac8f['stack']);if(_0x42ac8f['name']){delete _0x42ac8f[_0x0a9e('0x23')];}_0x4d00e6[_0x0a9e('0x15')](_0x370d86)[_0x0a9e('0x24')](_0x42ac8f);};}exports[_0x0a9e('0x25')]=function(_0x526cf3,_0x384319){var _0x479bc4={},_0x45a1e7={},_0x5bfb33={'count':0x0,'rows':[]};var _0x1dc186=_[_0x0a9e('0x26')](db[_0x0a9e('0x27')][_0x0a9e('0x28')],function(_0x140511){return{'name':_0x140511[_0x0a9e('0x29')],'type':_0x140511[_0x0a9e('0x2a')][_0x0a9e('0x2b')]};});_0x45a1e7['model']=_[_0x0a9e('0x26')](_0x1dc186,_0x0a9e('0x23'));_0x45a1e7[_0x0a9e('0x2c')]=_[_0x0a9e('0x2d')](_0x526cf3['query']);_0x45a1e7[_0x0a9e('0x2e')]=_[_0x0a9e('0x2f')](_0x45a1e7[_0x0a9e('0x30')],_0x45a1e7[_0x0a9e('0x2c')]);_0x479bc4[_0x0a9e('0x31')]=_[_0x0a9e('0x2f')](_0x45a1e7[_0x0a9e('0x30')],qs[_0x0a9e('0x32')](_0x526cf3[_0x0a9e('0x2c')]['fields']));_0x479bc4[_0x0a9e('0x31')]=_0x479bc4['attributes'][_0x0a9e('0x33')]?_0x479bc4[_0x0a9e('0x31')]:_0x45a1e7[_0x0a9e('0x30')];if(!_0x526cf3[_0x0a9e('0x2c')][_0x0a9e('0x34')]('nolimit')){_0x479bc4[_0x0a9e('0x35')]=qs[_0x0a9e('0x35')](_0x526cf3[_0x0a9e('0x2c')][_0x0a9e('0x35')]);_0x479bc4[_0x0a9e('0x18')]=qs[_0x0a9e('0x18')](_0x526cf3[_0x0a9e('0x2c')][_0x0a9e('0x18')]);}_0x479bc4['order']=qs[_0x0a9e('0x36')](_0x526cf3['query'][_0x0a9e('0x36')]);_0x479bc4[_0x0a9e('0x37')]=qs[_0x0a9e('0x2e')](_[_0x0a9e('0x38')](_0x526cf3['query'],_0x45a1e7[_0x0a9e('0x2e')]),_0x1dc186);if(_0x526cf3[_0x0a9e('0x2c')][_0x0a9e('0x39')]){_0x479bc4[_0x0a9e('0x37')]=_['merge'](_0x479bc4['where'],{'$or':_[_0x0a9e('0x26')](_0x1dc186,function(_0x5640eb){if(_0x5640eb[_0x0a9e('0x2a')]!==_0x0a9e('0x3a')){var _0x381c37={};_0x381c37[_0x5640eb[_0x0a9e('0x23')]]={'$like':'%'+_0x526cf3['query'][_0x0a9e('0x39')]+'%'};return _0x381c37;}})});}_0x479bc4=_[_0x0a9e('0x3b')]({},_0x479bc4,_0x526cf3[_0x0a9e('0x3c')]);var _0x533942={'where':_0x479bc4[_0x0a9e('0x37')]};return db[_0x0a9e('0x27')][_0x0a9e('0x17')](_0x533942)['then'](function(_0x546ef8){_0x5bfb33[_0x0a9e('0x17')]=_0x546ef8;if(_0x526cf3[_0x0a9e('0x2c')]['includeAll']){_0x479bc4[_0x0a9e('0x3d')]=[{'all':!![]}];}return db[_0x0a9e('0x27')][_0x0a9e('0x3e')](_0x479bc4);})[_0x0a9e('0x1f')](function(_0x4b38d9){_0x5bfb33['rows']=_0x4b38d9;return _0x5bfb33;})[_0x0a9e('0x1f')](respondWithFilteredResult(_0x384319,_0x479bc4))[_0x0a9e('0x3f')](handleError(_0x384319,null));};exports['show']=function(_0x183991,_0x1dec2e){var _0x1459bb={'raw':!![],'where':{'id':_0x183991[_0x0a9e('0x40')]['id']}},_0x5b4f5e={};_0x5b4f5e[_0x0a9e('0x30')]=_[_0x0a9e('0x2d')](db[_0x0a9e('0x27')][_0x0a9e('0x28')]);_0x5b4f5e[_0x0a9e('0x2c')]=_[_0x0a9e('0x2d')](_0x183991[_0x0a9e('0x2c')]);_0x5b4f5e[_0x0a9e('0x2e')]=_[_0x0a9e('0x2f')](_0x5b4f5e[_0x0a9e('0x30')],_0x5b4f5e[_0x0a9e('0x2c')]);_0x1459bb[_0x0a9e('0x31')]=_[_0x0a9e('0x2f')](_0x5b4f5e[_0x0a9e('0x30')],qs['fields'](_0x183991['query'][_0x0a9e('0x32')]));_0x1459bb[_0x0a9e('0x31')]=_0x1459bb[_0x0a9e('0x31')][_0x0a9e('0x33')]?_0x1459bb[_0x0a9e('0x31')]:_0x5b4f5e[_0x0a9e('0x30')];if(_0x183991[_0x0a9e('0x2c')][_0x0a9e('0x41')]){_0x1459bb[_0x0a9e('0x3d')]=[{'all':!![]}];}_0x1459bb=_[_0x0a9e('0x3b')]({},_0x1459bb,_0x183991[_0x0a9e('0x3c')]);return db[_0x0a9e('0x27')]['find'](_0x1459bb)[_0x0a9e('0x1f')](handleEntityNotFound(_0x1dec2e,null))[_0x0a9e('0x1f')](respondWithResult(_0x1dec2e,null))[_0x0a9e('0x3f')](handleError(_0x1dec2e,null));};exports[_0x0a9e('0x1e')]=function(_0x2e8caf,_0xbe9d19){if(_0x2e8caf[_0x0a9e('0x42')]['id']){delete _0x2e8caf[_0x0a9e('0x42')]['id'];}return db['CmHopperBlack'][_0x0a9e('0x43')]({'where':{'id':_0x2e8caf['params']['id']}})[_0x0a9e('0x1f')](handleEntityNotFound(_0xbe9d19,null))[_0x0a9e('0x1f')](saveUpdates(_0x2e8caf[_0x0a9e('0x42')],null))['then'](respondWithResult(_0xbe9d19,null))[_0x0a9e('0x3f')](handleError(_0xbe9d19,null));};exports[_0x0a9e('0x20')]=function(_0x4774f4,_0x34aa5a){return db[_0x0a9e('0x27')][_0x0a9e('0x43')]({'where':{'id':_0x4774f4[_0x0a9e('0x40')]['id']}})['then'](handleEntityNotFound(_0x34aa5a,null))[_0x0a9e('0x1f')](removeEntity(_0x34aa5a,null))[_0x0a9e('0x3f')](handleError(_0x34aa5a,null));};exports[_0x0a9e('0x44')]=function(_0x16f976,_0x409789){return db[_0x0a9e('0x27')][_0x0a9e('0x44')]()[_0x0a9e('0x1f')](respondWithResult(_0x409789,null))[_0x0a9e('0x3f')](handleError(_0x409789,null));};
\ No newline at end of file
diff --git a/server/api/cmHopperBlack/cmHopperBlack.model.js b/server/api/cmHopperBlack/cmHopperBlack.model.js
index afd5b54..2d82fcb 100644
--- a/server/api/cmHopperBlack/cmHopperBlack.model.js
+++ b/server/api/cmHopperBlack/cmHopperBlack.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xcb91=['rimraf','./cmHopperBlack.attributes','exports','define','cm_hopper_black','../../config/logger','api','moment','bluebird','path'];(function(_0x8739fe,_0x41cd63){var _0x506854=function(_0x293eb7){while(--_0x293eb7){_0x8739fe['push'](_0x8739fe['shift']());}};_0x506854(++_0x41cd63);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x45313f,_0x46caf4){_0x45313f=_0x45313f-0x0;var _0x402910=_0xcb91[_0x45313f];return _0x402910;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x1cb9('0x0'))(_0x1cb9('0x1'));var moment=require(_0x1cb9('0x2'));var BPromise=require(_0x1cb9('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1cb9('0x4'));var rimraf=require(_0x1cb9('0x5'));var config=require('../../config/environment');var attributes=require(_0x1cb9('0x6'));module[_0x1cb9('0x7')]=function(_0x53ffbd,_0x226b69){return _0x53ffbd[_0x1cb9('0x8')]('CmHopperBlack',attributes,{'tableName':_0x1cb9('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xedd9=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./cmHopperBlack.attributes','exports','CmHopperBlack','util'];(function(_0x146114,_0x31cc72){var _0x442edc=function(_0x1d4cf4){while(--_0x1d4cf4){_0x146114['push'](_0x146114['shift']());}};_0x442edc(++_0x31cc72);}(_0xedd9,0xfc));var _0x9edd=function(_0x2d67b4,_0x4ca8fe){_0x2d67b4=_0x2d67b4-0x0;var _0x4cd582=_0xedd9[_0x2d67b4];return _0x4cd582;};'use strict';var _=require('lodash');var util=require(_0x9edd('0x0'));var logger=require(_0x9edd('0x1'))(_0x9edd('0x2'));var moment=require(_0x9edd('0x3'));var BPromise=require(_0x9edd('0x4'));var rp=require(_0x9edd('0x5'));var fs=require('fs');var path=require(_0x9edd('0x6'));var rimraf=require(_0x9edd('0x7'));var config=require('../../config/environment');var attributes=require(_0x9edd('0x8'));module[_0x9edd('0x9')]=function(_0x268f9e,_0x34c1a7){return _0x268f9e['define'](_0x9edd('0xa'),attributes,{'tableName':'cm_hopper_black','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/cmHopperBlack/cmHopperBlack.rpc.js b/server/api/cmHopperBlack/cmHopperBlack.rpc.js
index 1b1f771..0bb4a96 100644
--- a/server/api/cmHopperBlack/cmHopperBlack.rpc.js
+++ b/server/api/cmHopperBlack/cmHopperBlack.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x8b58=['GetCmHopperBlack','CmHopperBlack','findAll','options','where','attributes','limit','include','map','model','UpdateCmHopperBlack','body','raw','DestroyCmHopperBlack','destroy','lodash','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','info','debug','CmHopperBlack,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','CmHopperBlack,\x20%s,\x20%s','message','result','catch'];(function(_0x4260f3,_0x4988d6){var _0x31b726=function(_0x5a5513){while(--_0x5a5513){_0x4260f3['push'](_0x4260f3['shift']());}};_0x31b726(++_0x4988d6);}(_0x8b58,0x7e));var _0x88b5=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8b58[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x88b5('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x88b5('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x88b5('0x2'));var db=require(_0x88b5('0x3'))['db'];var utils=require(_0x88b5('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0x88b5('0x5'));var jayson=require(_0x88b5('0x6'));var client=jayson[_0x88b5('0x7')][_0x88b5('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4aab64,_0x242ee9,_0x358a9c){return new BPromise(function(_0x3b83ea,_0x19fa30){return client[_0x88b5('0x9')](_0x4aab64,_0x358a9c)[_0x88b5('0xa')](function(_0x56ed1c){logger[_0x88b5('0xb')]('CmHopperBlack,\x20%s,\x20%s',_0x242ee9,'request\x20sent');logger[_0x88b5('0xc')](_0x88b5('0xd'),_0x242ee9,_0x88b5('0xe'),JSON[_0x88b5('0xf')](_0x56ed1c));if(_0x56ed1c[_0x88b5('0x10')]){if(_0x56ed1c[_0x88b5('0x10')][_0x88b5('0x11')]===0x1f4){logger[_0x88b5('0x10')](_0x88b5('0x12'),_0x242ee9,_0x56ed1c['error'][_0x88b5('0x13')]);return _0x19fa30(_0x56ed1c['error'][_0x88b5('0x13')]);}logger[_0x88b5('0x10')](_0x88b5('0x12'),_0x242ee9,_0x56ed1c[_0x88b5('0x10')][_0x88b5('0x13')]);return _0x3b83ea(_0x56ed1c[_0x88b5('0x10')][_0x88b5('0x13')]);}else{logger[_0x88b5('0xb')](_0x88b5('0x12'),_0x242ee9,_0x88b5('0xe'));_0x3b83ea(_0x56ed1c[_0x88b5('0x14')][_0x88b5('0x13')]);}})[_0x88b5('0x15')](function(_0xb77102){logger['error']('CmHopperBlack,\x20%s,\x20%s',_0x242ee9,_0xb77102);_0x19fa30(_0xb77102);});});}exports[_0x88b5('0x16')]=function(_0x6e1ef5){var _0x51ea81=this;return new Promise(function(_0x6f171e,_0x5287a0){return db[_0x88b5('0x17')][_0x88b5('0x18')]({'raw':_0x6e1ef5['options']?_0x6e1ef5['options']['raw']===undefined?!![]:![]:!![],'where':_0x6e1ef5[_0x88b5('0x19')]?_0x6e1ef5['options'][_0x88b5('0x1a')]||null:null,'attributes':_0x6e1ef5[_0x88b5('0x19')]?_0x6e1ef5[_0x88b5('0x19')][_0x88b5('0x1b')]||null:null,'limit':_0x6e1ef5[_0x88b5('0x19')]?_0x6e1ef5[_0x88b5('0x19')][_0x88b5('0x1c')]||null:null,'include':_0x6e1ef5[_0x88b5('0x19')]?_0x6e1ef5[_0x88b5('0x19')][_0x88b5('0x1d')]?_[_0x88b5('0x1e')](_0x6e1ef5[_0x88b5('0x19')][_0x88b5('0x1d')],function(_0x324e00){return{'model':db[_0x324e00[_0x88b5('0x1f')]],'as':_0x324e00['as'],'attributes':_0x324e00['attributes'],'include':_0x324e00[_0x88b5('0x1d')]?_[_0x88b5('0x1e')](_0x324e00[_0x88b5('0x1d')],function(_0x5afb6a){return{'model':db[_0x5afb6a[_0x88b5('0x1f')]],'as':_0x5afb6a['as'],'attributes':_0x5afb6a['attributes'],'include':_0x5afb6a[_0x88b5('0x1d')]?_[_0x88b5('0x1e')](_0x5afb6a[_0x88b5('0x1d')],function(_0x31b3b9){return{'model':db[_0x31b3b9['model']],'as':_0x31b3b9['as'],'attributes':_0x31b3b9[_0x88b5('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x88b5('0xa')](function(_0x485f16){logger['info'](_0x88b5('0x16'),_0x6e1ef5);logger[_0x88b5('0xc')](_0x88b5('0x16'),_0x6e1ef5,JSON[_0x88b5('0xf')](_0x485f16));_0x6f171e(_0x485f16);})[_0x88b5('0x15')](function(_0x5f413e){logger[_0x88b5('0x10')](_0x88b5('0x16'),_0x5f413e[_0x88b5('0x13')],_0x6e1ef5);_0x5287a0(_0x51ea81[_0x88b5('0x10')](0x1f4,_0x5f413e[_0x88b5('0x13')]));});});};exports[_0x88b5('0x20')]=function(_0x4c00cd){var _0x1dc0f1=this;return new Promise(function(_0xa43896,_0x556819){return db['CmHopperBlack']['update'](_0x4c00cd[_0x88b5('0x21')],{'raw':_0x4c00cd[_0x88b5('0x19')]?_0x4c00cd[_0x88b5('0x19')][_0x88b5('0x22')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4c00cd['options']?_0x4c00cd['options'][_0x88b5('0x1a')]||null:null,'attributes':_0x4c00cd[_0x88b5('0x19')]?_0x4c00cd[_0x88b5('0x19')]['attributes']||null:null,'limit':_0x4c00cd[_0x88b5('0x19')]?_0x4c00cd[_0x88b5('0x19')][_0x88b5('0x1c')]||null:null})[_0x88b5('0xa')](function(_0x4a86e7){logger[_0x88b5('0xb')](_0x88b5('0x20'),_0x4c00cd);logger[_0x88b5('0xc')](_0x88b5('0x20'),_0x4c00cd,JSON[_0x88b5('0xf')](_0x4a86e7));_0xa43896(_0x4a86e7);})[_0x88b5('0x15')](function(_0x1c4868){logger[_0x88b5('0x10')](_0x88b5('0x20'),_0x1c4868[_0x88b5('0x13')],_0x4c00cd);_0x556819(_0x1dc0f1[_0x88b5('0x10')](0x1f4,_0x1c4868[_0x88b5('0x13')]));});});};exports[_0x88b5('0x23')]=function(_0x48b9fa){var _0x5bc18f=this;return new Promise(function(_0x3ee071,_0x150a66){return db[_0x88b5('0x17')][_0x88b5('0x24')]({'where':_0x48b9fa[_0x88b5('0x19')]?_0x48b9fa[_0x88b5('0x19')][_0x88b5('0x1a')]||null:null})[_0x88b5('0xa')](function(_0x38bde8){logger[_0x88b5('0xb')](_0x88b5('0x23'),_0x48b9fa);logger['debug']('DestroyCmHopperBlack',_0x48b9fa,JSON[_0x88b5('0xf')](_0x38bde8));_0x3ee071(_0x38bde8);})['catch'](function(_0x9cb200){logger[_0x88b5('0x10')](_0x88b5('0x23'),_0x9cb200['message'],_0x48b9fa);_0x150a66(_0x5bc18f[_0x88b5('0x10')](0x1f4,_0x9cb200[_0x88b5('0x13')]));});});};
\ No newline at end of file
+var _0x74d4=['where','DestroyCmHopperBlack','destroy','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','request\x20sent','debug','CmHopperBlack,\x20%s,\x20%s,\x20%s','stringify','error','code','CmHopperBlack,\x20%s,\x20%s','message','result','catch','GetCmHopperBlack','CmHopperBlack','options','raw','limit','include','model','attributes','map','UpdateCmHopperBlack','update','body'];(function(_0x30eb5b,_0x234476){var _0x559d73=function(_0x35e62f){while(--_0x35e62f){_0x30eb5b['push'](_0x30eb5b['shift']());}};_0x559d73(++_0x234476);}(_0x74d4,0x78));var _0x474d=function(_0x149092,_0x21a767){_0x149092=_0x149092-0x0;var _0x2c6ed5=_0x74d4[_0x149092];return _0x2c6ed5;};'use strict';var _=require(_0x474d('0x0'));var util=require(_0x474d('0x1'));var moment=require('moment');var BPromise=require(_0x474d('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x474d('0x3'));var db=require(_0x474d('0x4'))['db'];var utils=require(_0x474d('0x5'));var logger=require(_0x474d('0x6'))(_0x474d('0x7'));var config=require(_0x474d('0x8'));var jayson=require(_0x474d('0x9'));var client=jayson['client'][_0x474d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x23c6fe,_0x28c69a,_0x2476b3){return new BPromise(function(_0x23a61a,_0x45f371){return client[_0x474d('0xb')](_0x23c6fe,_0x2476b3)[_0x474d('0xc')](function(_0x1309b6){logger[_0x474d('0xd')]('CmHopperBlack,\x20%s,\x20%s',_0x28c69a,_0x474d('0xe'));logger[_0x474d('0xf')](_0x474d('0x10'),_0x28c69a,_0x474d('0xe'),JSON[_0x474d('0x11')](_0x1309b6));if(_0x1309b6[_0x474d('0x12')]){if(_0x1309b6[_0x474d('0x12')][_0x474d('0x13')]===0x1f4){logger['error'](_0x474d('0x14'),_0x28c69a,_0x1309b6[_0x474d('0x12')][_0x474d('0x15')]);return _0x45f371(_0x1309b6[_0x474d('0x12')][_0x474d('0x15')]);}logger[_0x474d('0x12')](_0x474d('0x14'),_0x28c69a,_0x1309b6['error']['message']);return _0x23a61a(_0x1309b6[_0x474d('0x12')][_0x474d('0x15')]);}else{logger[_0x474d('0xd')](_0x474d('0x14'),_0x28c69a,'request\x20sent');_0x23a61a(_0x1309b6[_0x474d('0x16')][_0x474d('0x15')]);}})[_0x474d('0x17')](function(_0x106d79){logger['error']('CmHopperBlack,\x20%s,\x20%s',_0x28c69a,_0x106d79);_0x45f371(_0x106d79);});});}exports[_0x474d('0x18')]=function(_0x1d423d){var _0x4bfce1=this;return new Promise(function(_0x408887,_0x29c4bd){return db[_0x474d('0x19')]['findAll']({'raw':_0x1d423d[_0x474d('0x1a')]?_0x1d423d[_0x474d('0x1a')][_0x474d('0x1b')]===undefined?!![]:![]:!![],'where':_0x1d423d[_0x474d('0x1a')]?_0x1d423d[_0x474d('0x1a')]['where']||null:null,'attributes':_0x1d423d[_0x474d('0x1a')]?_0x1d423d[_0x474d('0x1a')]['attributes']||null:null,'limit':_0x1d423d['options']?_0x1d423d['options'][_0x474d('0x1c')]||null:null,'include':_0x1d423d[_0x474d('0x1a')]?_0x1d423d[_0x474d('0x1a')][_0x474d('0x1d')]?_['map'](_0x1d423d[_0x474d('0x1a')]['include'],function(_0x5f4f6f){return{'model':db[_0x5f4f6f[_0x474d('0x1e')]],'as':_0x5f4f6f['as'],'attributes':_0x5f4f6f[_0x474d('0x1f')],'include':_0x5f4f6f[_0x474d('0x1d')]?_['map'](_0x5f4f6f['include'],function(_0x5b5be4){return{'model':db[_0x5b5be4['model']],'as':_0x5b5be4['as'],'attributes':_0x5b5be4[_0x474d('0x1f')],'include':_0x5b5be4[_0x474d('0x1d')]?_[_0x474d('0x20')](_0x5b5be4[_0x474d('0x1d')],function(_0x1d3bc1){return{'model':db[_0x1d3bc1[_0x474d('0x1e')]],'as':_0x1d3bc1['as'],'attributes':_0x1d3bc1[_0x474d('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x246c4f){logger[_0x474d('0xd')](_0x474d('0x18'),_0x1d423d);logger[_0x474d('0xf')](_0x474d('0x18'),_0x1d423d,JSON[_0x474d('0x11')](_0x246c4f));_0x408887(_0x246c4f);})[_0x474d('0x17')](function(_0x423dea){logger[_0x474d('0x12')](_0x474d('0x18'),_0x423dea[_0x474d('0x15')],_0x1d423d);_0x29c4bd(_0x4bfce1[_0x474d('0x12')](0x1f4,_0x423dea[_0x474d('0x15')]));});});};exports[_0x474d('0x21')]=function(_0x45e00b){var _0x1fadb6=this;return new Promise(function(_0x152ec0,_0xf17ecc){return db[_0x474d('0x19')][_0x474d('0x22')](_0x45e00b[_0x474d('0x23')],{'raw':_0x45e00b[_0x474d('0x1a')]?_0x45e00b[_0x474d('0x1a')][_0x474d('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x45e00b[_0x474d('0x1a')]?_0x45e00b[_0x474d('0x1a')][_0x474d('0x24')]||null:null,'attributes':_0x45e00b[_0x474d('0x1a')]?_0x45e00b[_0x474d('0x1a')][_0x474d('0x1f')]||null:null,'limit':_0x45e00b['options']?_0x45e00b['options']['limit']||null:null})['then'](function(_0x203efc){logger[_0x474d('0xd')](_0x474d('0x21'),_0x45e00b);logger[_0x474d('0xf')]('UpdateCmHopperBlack',_0x45e00b,JSON['stringify'](_0x203efc));_0x152ec0(_0x203efc);})[_0x474d('0x17')](function(_0x47a9e7){logger[_0x474d('0x12')](_0x474d('0x21'),_0x47a9e7[_0x474d('0x15')],_0x45e00b);_0xf17ecc(_0x1fadb6[_0x474d('0x12')](0x1f4,_0x47a9e7[_0x474d('0x15')]));});});};exports[_0x474d('0x25')]=function(_0x8cbc72){var _0xeca65d=this;return new Promise(function(_0x5ed0b0,_0xd9b795){return db[_0x474d('0x19')][_0x474d('0x26')]({'where':_0x8cbc72[_0x474d('0x1a')]?_0x8cbc72[_0x474d('0x1a')][_0x474d('0x24')]||null:null})[_0x474d('0xc')](function(_0x23cc37){logger[_0x474d('0xd')]('DestroyCmHopperBlack',_0x8cbc72);logger['debug'](_0x474d('0x25'),_0x8cbc72,JSON[_0x474d('0x11')](_0x23cc37));_0x5ed0b0(_0x23cc37);})[_0x474d('0x17')](function(_0x3f316e){logger[_0x474d('0x12')](_0x474d('0x25'),_0x3f316e[_0x474d('0x15')],_0x8cbc72);_0xd9b795(_0xeca65d[_0x474d('0x12')](0x1f4,_0x3f316e[_0x474d('0x15')]));});});};
\ No newline at end of file
diff --git a/server/api/cmHopperBlack/index.js b/server/api/cmHopperBlack/index.js
index 481fbf5..43d1e68 100644
--- a/server/api/cmHopperBlack/index.js
+++ b/server/api/cmHopperBlack/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xb903=['connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperBlack.controller','get','isAuthenticated','describe','/:id','exports','multer','util','path'];(function(_0x538631,_0x2258ed){var _0x49913e=function(_0x571bd8){while(--_0x571bd8){_0x538631['push'](_0x538631['shift']());}};_0x49913e(++_0x2258ed);}(_0xb903,0x185));var _0x3b90=function(_0x2a625c,_0x500e38){_0x2a625c=_0x2a625c-0x0;var _0x13ea16=_0xb903[_0x2a625c];return _0x13ea16;};'use strict';var multer=require(_0x3b90('0x0'));var util=require(_0x3b90('0x1'));var path=require(_0x3b90('0x2'));var timeout=require(_0x3b90('0x3'));var express=require('express');var router=express[_0x3b90('0x4')]();var auth=require(_0x3b90('0x5'));var interaction=require(_0x3b90('0x6'));var config=require(_0x3b90('0x7'));var controller=require(_0x3b90('0x8'));router[_0x3b90('0x9')]('/',auth[_0x3b90('0xa')](),controller['index']);router[_0x3b90('0x9')]('/describe',auth['isAuthenticated'](),controller[_0x3b90('0xb')]);router[_0x3b90('0x9')](_0x3b90('0xc'),auth[_0x3b90('0xa')](),controller['show']);router['put']('/:id',auth['isAuthenticated'](),controller['update']);router['delete'](_0x3b90('0xc'),auth[_0x3b90('0xa')](),controller['destroy']);module[_0x3b90('0xd')]=router;
\ No newline at end of file
+var _0x3e74=['connect-timeout','express','../../components/interaction/service','./cmHopperBlack.controller','get','isAuthenticated','index','describe','/:id','put','update','delete','exports','multer','path'];(function(_0x3ee91e,_0x466a5a){var _0x239405=function(_0x3f2d09){while(--_0x3f2d09){_0x3ee91e['push'](_0x3ee91e['shift']());}};_0x239405(++_0x466a5a);}(_0x3e74,0x175));var _0x43e7=function(_0x437227,_0x144eae){_0x437227=_0x437227-0x0;var _0x23e68a=_0x3e74[_0x437227];return _0x23e68a;};'use strict';var multer=require(_0x43e7('0x0'));var util=require('util');var path=require(_0x43e7('0x1'));var timeout=require(_0x43e7('0x2'));var express=require(_0x43e7('0x3'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x43e7('0x4'));var config=require('../../config/environment');var controller=require(_0x43e7('0x5'));router[_0x43e7('0x6')]('/',auth[_0x43e7('0x7')](),controller[_0x43e7('0x8')]);router[_0x43e7('0x6')]('/describe',auth[_0x43e7('0x7')](),controller[_0x43e7('0x9')]);router[_0x43e7('0x6')](_0x43e7('0xa'),auth[_0x43e7('0x7')](),controller['show']);router[_0x43e7('0xb')]('/:id',auth['isAuthenticated'](),controller[_0x43e7('0xc')]);router[_0x43e7('0xd')]('/:id',auth[_0x43e7('0x7')](),controller['destroy']);module[_0x43e7('0xe')]=router;
\ No newline at end of file
diff --git a/server/api/cmHopperFinal/cmHopperFinal.attributes.js b/server/api/cmHopperFinal/cmHopperFinal.attributes.js
index c15ae30..6055c37 100644
--- a/server/api/cmHopperFinal/cmHopperFinal.attributes.js
+++ b/server/api/cmHopperFinal/cmHopperFinal.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xfcd5=['DATE','getDataValue','setDataValue','followuptime','diff','seconds','BOOLEAN','sequelize','moment','INTEGER','STRING'];(function(_0x44f192,_0x557c5a){var _0x33fcb8=function(_0xf9ae58){while(--_0xf9ae58){_0x44f192['push'](_0x44f192['shift']());}};_0x33fcb8(++_0x557c5a);}(_0xfcd5,0xb7));var _0x5fcd=function(_0x422905,_0x3bce3a){_0x422905=_0x422905-0x0;var _0x33dc6c=_0xfcd5[_0x422905];return _0x33dc6c;};'use strict';var Sequelize=require(_0x5fcd('0x0'));var moment=require(_0x5fcd('0x1'));module['exports']={'state':{'type':Sequelize[_0x5fcd('0x2')](0x2)},'statedesc':{'type':Sequelize[_0x5fcd('0x3')]},'scheduledat':{'type':Sequelize[_0x5fcd('0x4')]},'countbusyretry':{'type':Sequelize[_0x5fcd('0x2')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x5fcd('0x2')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x5fcd('0x2')],'defaultValue':0x0},'countglobal':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x5fcd('0x3')]},'originatecalleridnum':{'type':Sequelize[_0x5fcd('0x3')]},'originatecalleridname':{'type':Sequelize[_0x5fcd('0x3')]},'calleridnum':{'type':Sequelize[_0x5fcd('0x3')]},'calleridname':{'type':Sequelize[_0x5fcd('0x3')]},'starttime':{'type':Sequelize['DATE']},'responsetime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize[_0x5fcd('0x4')]},'droptime':{'type':Sequelize[_0x5fcd('0x4')]},'endtime':{'type':Sequelize[_0x5fcd('0x4')]},'ringtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x5fcd('0x2')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x5fcd('0x2')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x5fcd('0x2')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x5fcd('0x3')]},'campaign':{'type':Sequelize[_0x5fcd('0x3')]},'campaigntype':{'type':Sequelize[_0x5fcd('0x3')]},'membername':{'type':Sequelize[_0x5fcd('0x3')]},'reason':{'type':Sequelize['STRING']},'disposition':{'type':Sequelize[_0x5fcd('0x3')]},'dispositionat':{'type':Sequelize[_0x5fcd('0x4')],'set':function(_0x2f7fad){var _0x3076a5=this[_0x5fcd('0x5')]('endtime');if(_0x3076a5&&_0x2f7fad){this[_0x5fcd('0x6')](_0x5fcd('0x7'),moment(_0x2f7fad)[_0x5fcd('0x8')](moment(_0x3076a5),_0x5fcd('0x9')));}return this[_0x5fcd('0x6')]('dispositionat',_0x2f7fad);}},'amd':{'type':Sequelize[_0x5fcd('0xa')],'defaultValue':![]},'fax':{'type':Sequelize[_0x5fcd('0xa')],'defaultValue':![]},'blacklist':{'type':Sequelize[_0x5fcd('0xa')],'defaultValue':![]},'rescheduled':{'type':Sequelize[_0x5fcd('0xa')],'defaultValue':![]},'rescheduledat':{'type':Sequelize[_0x5fcd('0x4')]},'callback':{'type':Sequelize[_0x5fcd('0xa')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x5fcd('0x3')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x5fcd('0x4')]},'deleted':{'type':Sequelize[_0x5fcd('0x3')],'defaultValue':null},'deletedat':{'type':Sequelize['DATE']},'recallme':{'type':Sequelize[_0x5fcd('0xa')],'defaultValue':![]},'agiafterat':{'type':Sequelize[_0x5fcd('0x4')]},'countnosuchnumberretry':{'type':Sequelize[_0x5fcd('0x2')],'defaultValue':0x0},'countdropretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x5fcd('0x2')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0}};
\ No newline at end of file
+var _0xda41=['moment','exports','INTEGER','STRING','DATE','getDataValue','endtime','followuptime','diff','seconds','dispositionat','BOOLEAN','sequelize'];(function(_0x399bdd,_0x28232f){var _0x4221b1=function(_0x1883ef){while(--_0x1883ef){_0x399bdd['push'](_0x399bdd['shift']());}};_0x4221b1(++_0x28232f);}(_0xda41,0x137));var _0x1da4=function(_0x14d23c,_0x51fd18){_0x14d23c=_0x14d23c-0x0;var _0xe4b452=_0xda41[_0x14d23c];return _0xe4b452;};'use strict';var Sequelize=require(_0x1da4('0x0'));var moment=require(_0x1da4('0x1'));module[_0x1da4('0x2')]={'state':{'type':Sequelize[_0x1da4('0x3')](0x2)},'statedesc':{'type':Sequelize[_0x1da4('0x4')]},'scheduledat':{'type':Sequelize[_0x1da4('0x5')]},'countbusyretry':{'type':Sequelize[_0x1da4('0x3')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x1da4('0x3')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x1da4('0x3')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x1da4('0x4')]},'originatecalleridnum':{'type':Sequelize[_0x1da4('0x4')]},'originatecalleridname':{'type':Sequelize[_0x1da4('0x4')]},'calleridnum':{'type':Sequelize[_0x1da4('0x4')]},'calleridname':{'type':Sequelize[_0x1da4('0x4')]},'starttime':{'type':Sequelize[_0x1da4('0x5')]},'responsetime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize['DATE']},'droptime':{'type':Sequelize[_0x1da4('0x5')]},'endtime':{'type':Sequelize['DATE']},'ringtime':{'type':Sequelize[_0x1da4('0x3')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x1da4('0x3')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x1da4('0x3')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x1da4('0x3')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x1da4('0x4')]},'campaign':{'type':Sequelize[_0x1da4('0x4')]},'campaigntype':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0x1da4('0x4')]},'reason':{'type':Sequelize[_0x1da4('0x4')]},'disposition':{'type':Sequelize[_0x1da4('0x4')]},'dispositionat':{'type':Sequelize[_0x1da4('0x5')],'set':function(_0x432aad){var _0x458b34=this[_0x1da4('0x6')](_0x1da4('0x7'));if(_0x458b34&&_0x432aad){this['setDataValue'](_0x1da4('0x8'),moment(_0x432aad)[_0x1da4('0x9')](moment(_0x458b34),_0x1da4('0xa')));}return this['setDataValue'](_0x1da4('0xb'),_0x432aad);}},'amd':{'type':Sequelize[_0x1da4('0xc')],'defaultValue':![]},'fax':{'type':Sequelize[_0x1da4('0xc')],'defaultValue':![]},'blacklist':{'type':Sequelize[_0x1da4('0xc')],'defaultValue':![]},'rescheduled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'rescheduledat':{'type':Sequelize[_0x1da4('0x5')]},'callback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x1da4('0x4')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x1da4('0x5')]},'deleted':{'type':Sequelize['STRING'],'defaultValue':null},'deletedat':{'type':Sequelize['DATE']},'recallme':{'type':Sequelize[_0x1da4('0xc')],'defaultValue':![]},'agiafterat':{'type':Sequelize[_0x1da4('0x5')]},'countnosuchnumberretry':{'type':Sequelize[_0x1da4('0x3')],'defaultValue':0x0},'countdropretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x1da4('0x3')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x1da4('0x3')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x1da4('0x3')],'defaultValue':0x0}};
\ No newline at end of file
diff --git a/server/api/cmHopperFinal/cmHopperFinal.controller.js b/server/api/cmHopperFinal/cmHopperFinal.controller.js
index 88b3dae..3c6a2dc 100644
--- a/server/api/cmHopperFinal/cmHopperFinal.controller.js
+++ b/server/api/cmHopperFinal/cmHopperFinal.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x5204=['error','stack','name','send','index','CmHopperFinal','fieldName','type','key','model','map','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','merge','options','catch','show','params','rawAttributes','keys','includeAll','include','find','describe','update','body','uniqueid','sequelize','COUNT','literal','`state`\x20=\x200,\x201,\x20null','`state`\x20=\x203,\x201,\x20null','noAnswerContacts','`state`\x20=\x205,\x201,\x20null','busyContacts','`state`\x20=\x208,\x201,\x20null','congestionContacts','`state`\x20=\x2010\x20,\x201,\x20null','`state`\x20=\x2011\x20,\x201,\x20null','abandonedContacts','`state`\x20=\x2022,\x201,\x20null','reCallContacts','answeringMachine','countContactsIvrCampaignHopperFinal','findAll','noSuchContacts','`state`\x20=\x2019,\x201,\x20null','insert','into','cm_hopper','phone','scheduledAt','ContactId','ListId','VoiceQueueId','createdAt','updatedAt','select','field','ANY_VALUE(ContactId)','ANY_VALUE(ListId)','ANY_VALUE(VoiceQueueId)','NOW()','from','cm_hopper_final','VoiceQueueId\x20=\x20?','toString','state\x20=\x20?','state','calleridnum\x20NOT\x20IN\x20(?)','state\x20=\x204','group','Campaign','CampaignId','ANY_VALUE(CampaignId)','CampaignId\x20=\x20?','calleridnum\x20IS\x20NOT\x20NULL','calleridnum','checkContactHopper','CmHopper','findOne','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','count','offset','limit','set','Content-Range','json','apply','reject','then','destroy'];(function(_0x551f8e,_0x5c3783){var _0x3e0ecd=function(_0x5cf677){while(--_0x5cf677){_0x551f8e['push'](_0x551f8e['shift']());}};_0x3e0ecd(++_0x5c3783);}(_0x5204,0xdf));var _0x4520=function(_0x2bc3f4,_0x470b26){_0x2bc3f4=_0x2bc3f4-0x0;var _0x14ac53=_0x5204[_0x2bc3f4];return _0x14ac53;};'use strict';var pdf=require(_0x4520('0x0'));var emlformat=require(_0x4520('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x4520('0x2'));var jsonpatch=require(_0x4520('0x3'));var rp=require(_0x4520('0x4'));var moment=require(_0x4520('0x5'));var BPromise=require(_0x4520('0x6'));var Mustache=require('mustache');var util=require(_0x4520('0x7'));var path=require('path');var sox=require(_0x4520('0x8'));var csv=require(_0x4520('0x9'));var ejs=require(_0x4520('0xa'));var fs=require('fs');var _=require(_0x4520('0xb'));var squel=require(_0x4520('0xc'));var crypto=require(_0x4520('0xd'));var jsforce=require(_0x4520('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x4520('0x9'));var querystring=require('querystring');var Papa=require(_0x4520('0xf'));var Redis=require(_0x4520('0x10'));var authService=require(_0x4520('0x11'));var qs=require(_0x4520('0x12'));var as=require(_0x4520('0x13'));var hardwareService=require(_0x4520('0x14'));var logger=require(_0x4520('0x15'))(_0x4520('0x16'));var utils=require(_0x4520('0x17'));var config=require(_0x4520('0x18'));var db=require(_0x4520('0x19'))['db'];function respondWithStatusCode(_0x394072,_0x3c7a5d){_0x3c7a5d=_0x3c7a5d||0xcc;return function(_0x508ea6){if(_0x508ea6){return _0x394072[_0x4520('0x1a')](_0x3c7a5d);}return _0x394072[_0x4520('0x1b')](_0x3c7a5d)[_0x4520('0x1c')]();};}function respondWithResult(_0x4677d7,_0x426836){_0x426836=_0x426836||0xc8;return function(_0x34d383){if(_0x34d383){return _0x4677d7[_0x4520('0x1b')](_0x426836)['json'](_0x34d383);}};}function respondWithFilteredResult(_0x3e53e5,_0x20de6b){return function(_0x1ab841){if(_0x1ab841){var _0x15a31f=_0x1ab841[_0x4520('0x1d')],_0x32d8aa=_0x20de6b[_0x4520('0x1e')],_0x51d85f=_0x20de6b[_0x4520('0x1e')]+_0x20de6b[_0x4520('0x1f')],_0x2c1805;if(_0x51d85f>=_0x15a31f){_0x51d85f=_0x15a31f;_0x2c1805=0xc8;}else{_0x2c1805=0xce;}_0x3e53e5[_0x4520('0x1b')](_0x2c1805);return _0x3e53e5[_0x4520('0x20')](_0x4520('0x21'),_0x32d8aa+'-'+_0x51d85f+'/'+_0x15a31f)[_0x4520('0x22')](_0x1ab841);}return null;};}function patchUpdates(_0x11eaea){return function(_0x398dd2){try{jsonpatch[_0x4520('0x23')](_0x398dd2,_0x11eaea,!![]);}catch(_0x4ac41d){return BPromise[_0x4520('0x24')](_0x4ac41d);}return _0x398dd2['save']();};}function saveUpdates(_0x5ceff6,_0x4c46c5){return function(_0x2b9456){if(_0x2b9456){return _0x2b9456['update'](_0x5ceff6)[_0x4520('0x25')](function(_0x270dc2){return _0x270dc2;});}return null;};}function removeEntity(_0x428d36,_0x534b15){return function(_0x3199a9){if(_0x3199a9){return _0x3199a9[_0x4520('0x26')]()[_0x4520('0x25')](function(){_0x428d36['status'](0xcc)[_0x4520('0x1c')]();});}};}function handleEntityNotFound(_0x847d15,_0x24eacd){return function(_0x3a4680){if(!_0x3a4680){_0x847d15[_0x4520('0x1a')](0x194);}return _0x3a4680;};}function handleError(_0x552da1,_0x3774bd){_0x3774bd=_0x3774bd||0x1f4;return function(_0x15987c){logger[_0x4520('0x27')](_0x15987c[_0x4520('0x28')]);if(_0x15987c['name']){delete _0x15987c[_0x4520('0x29')];}_0x552da1[_0x4520('0x1b')](_0x3774bd)[_0x4520('0x2a')](_0x15987c);};}exports[_0x4520('0x2b')]=function(_0xad9f8,_0x2c95ea){var _0x2d6902={},_0x195c58={},_0x180c44={'count':0x0,'rows':[]};var _0x926ca0=_['map'](db[_0x4520('0x2c')]['rawAttributes'],function(_0x7ce8d2){return{'name':_0x7ce8d2[_0x4520('0x2d')],'type':_0x7ce8d2[_0x4520('0x2e')][_0x4520('0x2f')]};});_0x195c58[_0x4520('0x30')]=_[_0x4520('0x31')](_0x926ca0,'name');_0x195c58[_0x4520('0x32')]=_['keys'](_0xad9f8[_0x4520('0x32')]);_0x195c58['filters']=_[_0x4520('0x33')](_0x195c58['model'],_0x195c58[_0x4520('0x32')]);_0x2d6902['attributes']=_['intersection'](_0x195c58[_0x4520('0x30')],qs[_0x4520('0x34')](_0xad9f8[_0x4520('0x32')]['fields']));_0x2d6902[_0x4520('0x35')]=_0x2d6902[_0x4520('0x35')][_0x4520('0x36')]?_0x2d6902[_0x4520('0x35')]:_0x195c58['model'];if(!_0xad9f8['query'][_0x4520('0x37')](_0x4520('0x38'))){_0x2d6902['limit']=qs[_0x4520('0x1f')](_0xad9f8[_0x4520('0x32')][_0x4520('0x1f')]);_0x2d6902[_0x4520('0x1e')]=qs[_0x4520('0x1e')](_0xad9f8[_0x4520('0x32')]['offset']);}_0x2d6902[_0x4520('0x39')]=qs[_0x4520('0x3a')](_0xad9f8['query'][_0x4520('0x3a')]);_0x2d6902['where']=qs[_0x4520('0x3b')](_[_0x4520('0x3c')](_0xad9f8['query'],_0x195c58['filters']),_0x926ca0);if(_0xad9f8['query'][_0x4520('0x3d')]){_0x2d6902[_0x4520('0x3e')]=_[_0x4520('0x3f')](_0x2d6902[_0x4520('0x3e')],{'$or':_[_0x4520('0x31')](_0x926ca0,function(_0x1ca2b4){if(_0x1ca2b4[_0x4520('0x2e')]!=='VIRTUAL'){var _0x47085e={};_0x47085e[_0x1ca2b4[_0x4520('0x29')]]={'$like':'%'+_0xad9f8[_0x4520('0x32')]['filter']+'%'};return _0x47085e;}})});}_0x2d6902=_[_0x4520('0x3f')]({},_0x2d6902,_0xad9f8[_0x4520('0x40')]);var _0x5c6f84={'where':_0x2d6902['where']};return db[_0x4520('0x2c')][_0x4520('0x1d')](_0x5c6f84)[_0x4520('0x25')](function(_0x11164a){_0x180c44[_0x4520('0x1d')]=_0x11164a;if(_0xad9f8['query']['includeAll']){_0x2d6902['include']=[{'all':!![]}];}return db[_0x4520('0x2c')]['findAll'](_0x2d6902);})[_0x4520('0x25')](function(_0x54da7a){_0x180c44['rows']=_0x54da7a;return _0x180c44;})[_0x4520('0x25')](respondWithFilteredResult(_0x2c95ea,_0x2d6902))[_0x4520('0x41')](handleError(_0x2c95ea,null));};exports[_0x4520('0x42')]=function(_0x214026,_0x21e21c){var _0x59d646={'raw':!![],'where':{'id':_0x214026[_0x4520('0x43')]['id']}},_0x1675e6={};_0x1675e6['model']=_['keys'](db[_0x4520('0x2c')][_0x4520('0x44')]);_0x1675e6['query']=_[_0x4520('0x45')](_0x214026[_0x4520('0x32')]);_0x1675e6[_0x4520('0x3b')]=_[_0x4520('0x33')](_0x1675e6['model'],_0x1675e6[_0x4520('0x32')]);_0x59d646[_0x4520('0x35')]=_[_0x4520('0x33')](_0x1675e6[_0x4520('0x30')],qs[_0x4520('0x34')](_0x214026[_0x4520('0x32')][_0x4520('0x34')]));_0x59d646[_0x4520('0x35')]=_0x59d646[_0x4520('0x35')][_0x4520('0x36')]?_0x59d646[_0x4520('0x35')]:_0x1675e6[_0x4520('0x30')];if(_0x214026[_0x4520('0x32')][_0x4520('0x46')]){_0x59d646[_0x4520('0x47')]=[{'all':!![]}];}_0x59d646=_[_0x4520('0x3f')]({},_0x59d646,_0x214026[_0x4520('0x40')]);return db['CmHopperFinal'][_0x4520('0x48')](_0x59d646)[_0x4520('0x25')](handleEntityNotFound(_0x21e21c,null))['then'](respondWithResult(_0x21e21c,null))['catch'](handleError(_0x21e21c,null));};exports['describe']=function(_0x4dce4f,_0x22e62d){return db['CmHopperFinal'][_0x4520('0x49')]()[_0x4520('0x25')](respondWithResult(_0x22e62d,null))[_0x4520('0x41')](handleError(_0x22e62d,null));};exports[_0x4520('0x4a')]=function(_0x177c4e,_0x5e3eef){if(_0x177c4e[_0x4520('0x4b')][_0x4520('0x4c')]){delete _0x177c4e[_0x4520('0x4b')][_0x4520('0x4c')];}return db[_0x4520('0x2c')][_0x4520('0x48')]({'where':{'uniqueid':_0x177c4e[_0x4520('0x43')]['id']}})[_0x4520('0x25')](handleEntityNotFound(_0x5e3eef,null))[_0x4520('0x25')](saveUpdates(_0x177c4e[_0x4520('0x4b')],null))[_0x4520('0x25')](respondWithResult(_0x5e3eef,null))[_0x4520('0x41')](handleError(_0x5e3eef,null));};exports['countContactsQueueCampaignHopperFinal']=function(_0x53987b,_0x2f14c1,_0x29e14c){return db[_0x4520('0x2c')]['findAll']({'raw':![],'where':{'VoiceQueueId':_0x53987b[_0x4520('0x43')]['id']},'attributes':[[db[_0x4520('0x4d')]['fn'](_0x4520('0x4e'),db['sequelize']['fn']('IF',db[_0x4520('0x4d')][_0x4520('0x4f')](_0x4520('0x50')))),'noSuchContacts'],[db['sequelize']['fn'](_0x4520('0x4e'),db[_0x4520('0x4d')]['fn']('IF',db[_0x4520('0x4d')][_0x4520('0x4f')](_0x4520('0x51')))),_0x4520('0x52')],[db[_0x4520('0x4d')]['fn'](_0x4520('0x4e'),db['sequelize']['fn']('IF',db[_0x4520('0x4d')][_0x4520('0x4f')](_0x4520('0x53')))),_0x4520('0x54')],[db[_0x4520('0x4d')]['fn'](_0x4520('0x4e'),db[_0x4520('0x4d')]['fn']('IF',db[_0x4520('0x4d')][_0x4520('0x4f')](_0x4520('0x55')))),_0x4520('0x56')],[db[_0x4520('0x4d')]['fn'](_0x4520('0x4e'),db[_0x4520('0x4d')]['fn']('IF',db[_0x4520('0x4d')][_0x4520('0x4f')](_0x4520('0x57')))),'dropContacts'],[db['sequelize']['fn'](_0x4520('0x4e'),db[_0x4520('0x4d')]['fn']('IF',db[_0x4520('0x4d')][_0x4520('0x4f')](_0x4520('0x58')))),_0x4520('0x59')],[db['sequelize']['fn'](_0x4520('0x4e'),db[_0x4520('0x4d')]['fn']('IF',db['sequelize'][_0x4520('0x4f')](_0x4520('0x5a')))),_0x4520('0x5b')],[db[_0x4520('0x4d')]['fn']('COUNT',db[_0x4520('0x4d')]['fn']('IF',db[_0x4520('0x4d')]['literal']('`state`\x20=\x2019,\x201,\x20null'))),_0x4520('0x5c')]]})[_0x4520('0x25')](handleEntityNotFound(_0x2f14c1,null))[_0x4520('0x25')](respondWithResult(_0x2f14c1,null))[_0x4520('0x41')](handleError(_0x2f14c1,null));};exports[_0x4520('0x5d')]=function(_0xf5d990,_0x4e15f1,_0x402ea0){return db[_0x4520('0x2c')][_0x4520('0x5e')]({'raw':![],'where':{'CampaignId':_0xf5d990[_0x4520('0x43')]['id']},'attributes':[[db['sequelize']['fn'](_0x4520('0x4e'),db[_0x4520('0x4d')]['fn']('IF',db['sequelize'][_0x4520('0x4f')]('`state`\x20=\x200,\x201,\x20null'))),_0x4520('0x5f')],[db[_0x4520('0x4d')]['fn'](_0x4520('0x4e'),db[_0x4520('0x4d')]['fn']('IF',db['sequelize'][_0x4520('0x4f')](_0x4520('0x51')))),_0x4520('0x52')],[db[_0x4520('0x4d')]['fn']('COUNT',db[_0x4520('0x4d')]['fn']('IF',db[_0x4520('0x4d')][_0x4520('0x4f')](_0x4520('0x53')))),_0x4520('0x54')],[db[_0x4520('0x4d')]['fn']('COUNT',db[_0x4520('0x4d')]['fn']('IF',db['sequelize'][_0x4520('0x4f')](_0x4520('0x55')))),_0x4520('0x56')],[db[_0x4520('0x4d')]['fn'](_0x4520('0x4e'),db[_0x4520('0x4d')]['fn']('IF',db['sequelize']['literal'](_0x4520('0x57')))),'dropContacts'],[db[_0x4520('0x4d')]['fn'](_0x4520('0x4e'),db[_0x4520('0x4d')]['fn']('IF',db[_0x4520('0x4d')][_0x4520('0x4f')](_0x4520('0x58')))),_0x4520('0x59')],[db[_0x4520('0x4d')]['fn'](_0x4520('0x4e'),db['sequelize']['fn']('IF',db[_0x4520('0x4d')]['literal'](_0x4520('0x5a')))),_0x4520('0x5b')],[db[_0x4520('0x4d')]['fn'](_0x4520('0x4e'),db[_0x4520('0x4d')]['fn']('IF',db['sequelize'][_0x4520('0x4f')](_0x4520('0x60')))),_0x4520('0x5c')]]})[_0x4520('0x25')](handleEntityNotFound(_0x4e15f1,null))['then'](respondWithResult(_0x4e15f1,null))['catch'](handleError(_0x4e15f1,null));};exports['moveContactsQueueCampaignHopperFinal']=function(_0x2bf316,_0x14bd13,_0x390835){return db['VoiceQueue'][_0x4520('0x48')]({'where':{'id':_0x2bf316[_0x4520('0x43')]['id']}})[_0x4520('0x25')](handleEntityNotFound(_0x14bd13,null))[_0x4520('0x25')](function(_0x163ff6){var _0x578618;if(_0x163ff6){_0x578618=squel[_0x4520('0x61')]()[_0x4520('0x62')](_0x4520('0x63'))['fromQuery']([_0x4520('0x64'),_0x4520('0x65'),_0x4520('0x66'),_0x4520('0x67'),_0x4520('0x68'),_0x4520('0x69'),_0x4520('0x6a')],squel[_0x4520('0x6b')]()['field']('ANY_VALUE(calleridnum)',_0x4520('0x64'))[_0x4520('0x6c')]('NOW()',_0x4520('0x65'))['field'](_0x4520('0x6d'),_0x4520('0x66'))['field'](_0x4520('0x6e'),_0x4520('0x67'))['field'](_0x4520('0x6f'),_0x4520('0x68'))['field'](_0x4520('0x70'),_0x4520('0x69'))[_0x4520('0x6c')]('NOW()',_0x4520('0x6a'))[_0x4520('0x71')](_0x4520('0x72'))[_0x4520('0x3e')](_0x4520('0x73'),_0x2bf316[_0x4520('0x43')]['id'][_0x4520('0x74')]())[_0x4520('0x3e')](_0x4520('0x75'),_0x2bf316[_0x4520('0x4b')][_0x4520('0x76')][_0x4520('0x74')]())['where']('calleridnum\x20IS\x20NOT\x20NULL')[_0x4520('0x3e')]('calleridnum\x20NOT\x20IN\x20(?)',squel[_0x4520('0x6b')]()[_0x4520('0x6c')](_0x4520('0x64'))[_0x4520('0x71')](_0x4520('0x63'))['where']('VoiceQueueId\x20=\x20?',_0x2bf316[_0x4520('0x43')]['id'][_0x4520('0x74')]()))[_0x4520('0x3e')](_0x4520('0x77'),squel[_0x4520('0x6b')]()[_0x4520('0x6c')]('calleridnum')[_0x4520('0x71')](_0x4520('0x72'))['where'](_0x4520('0x73'),_0x2bf316['params']['id']['toString']())['where'](_0x4520('0x78')))[_0x4520('0x79')](_0x4520('0x66')))[_0x4520('0x74')]();return db[_0x4520('0x4d')]['query'](_0x578618);}return[];})[_0x4520('0x25')](respondWithResult(_0x14bd13,null))[_0x4520('0x41')](handleError(_0x14bd13,null));};exports['moveContactsIvrCampaignHopperFinal']=function(_0x4b28ad,_0x1fdd7a,_0x1757fc){return db[_0x4520('0x7a')]['find']({'where':{'id':_0x4b28ad[_0x4520('0x43')]['id']}})[_0x4520('0x25')](handleEntityNotFound(_0x1fdd7a,null))[_0x4520('0x25')](function(_0x4866b5){var _0x80496a;if(_0x4866b5){_0x80496a=squel[_0x4520('0x61')]()['into'](_0x4520('0x63'))['fromQuery']([_0x4520('0x64'),_0x4520('0x65'),_0x4520('0x66'),_0x4520('0x67'),_0x4520('0x7b'),_0x4520('0x69'),_0x4520('0x6a')],squel['select']()[_0x4520('0x6c')]('ANY_VALUE(calleridnum)',_0x4520('0x64'))[_0x4520('0x6c')]('NOW()',_0x4520('0x65'))[_0x4520('0x6c')](_0x4520('0x6d'),_0x4520('0x66'))[_0x4520('0x6c')](_0x4520('0x6e'),_0x4520('0x67'))[_0x4520('0x6c')](_0x4520('0x7c'),_0x4520('0x7b'))[_0x4520('0x6c')]('NOW()','createdAt')['field']('NOW()','updatedAt')[_0x4520('0x71')](_0x4520('0x72'))[_0x4520('0x3e')](_0x4520('0x7d'),_0x4b28ad['params']['id'][_0x4520('0x74')]())['where'](_0x4520('0x75'),_0x4b28ad['body'][_0x4520('0x76')]['toString']())[_0x4520('0x3e')](_0x4520('0x7e'))[_0x4520('0x3e')](_0x4520('0x77'),squel['select']()[_0x4520('0x6c')]('phone')[_0x4520('0x71')](_0x4520('0x63'))[_0x4520('0x3e')](_0x4520('0x7d'),_0x4b28ad[_0x4520('0x43')]['id']['toString']()))[_0x4520('0x3e')](_0x4520('0x77'),squel['select']()[_0x4520('0x6c')](_0x4520('0x7f'))['from'](_0x4520('0x72'))['where']('CampaignId\x20=\x20?',_0x4b28ad[_0x4520('0x43')]['id'][_0x4520('0x74')]())['where'](_0x4520('0x78')))['group'](_0x4520('0x66')))[_0x4520('0x74')]();return db[_0x4520('0x4d')][_0x4520('0x32')](_0x80496a);}return[];})[_0x4520('0x25')](respondWithResult(_0x1fdd7a,null))[_0x4520('0x41')](handleError(_0x1fdd7a,null));};exports[_0x4520('0x80')]=function(_0x42d618,_0x126b39,_0x3d1121){return db[_0x4520('0x81')][_0x4520('0x82')]({'where':{'VoiceQueueId':_0x42d618[_0x4520('0x4b')][_0x4520('0x68')],'CampaignId':_0x42d618['body'][_0x4520('0x7b')],'ContactId':_0x42d618[_0x4520('0x4b')]['ContactId']}})[_0x4520('0x25')](handleEntityNotFound(_0x126b39,null))[_0x4520('0x25')](function(_0x5875b5){if(_0x5875b5){return _0x5875b5;}return null;})[_0x4520('0x25')](respondWithResult(_0x126b39,null))[_0x4520('0x41')](handleError(_0x126b39,null));};
\ No newline at end of file
+var _0x7ed1=['filter','merge','where','map','type','options','includeAll','include','findAll','rows','show','params','find','describe','catch','uniqueid','body','countContactsQueueCampaignHopperFinal','sequelize','COUNT','`state`\x20=\x200,\x201,\x20null','noSuchContacts','literal','`state`\x20=\x203,\x201,\x20null','noAnswerContacts','`state`\x20=\x205,\x201,\x20null','busyContacts','`state`\x20=\x208,\x201,\x20null','congestionContacts','`state`\x20=\x2010\x20,\x201,\x20null','dropContacts','`state`\x20=\x2011\x20,\x201,\x20null','abandonedContacts','reCallContacts','`state`\x20=\x2019,\x201,\x20null','answeringMachine','countContactsIvrCampaignHopperFinal','`state`\x20=\x2022,\x201,\x20null','VoiceQueue','insert','into','cm_hopper','fromQuery','updatedAt','select','field','ANY_VALUE(calleridnum)','phone','NOW()','scheduledAt','ContactId','ANY_VALUE(ListId)','ListId','ANY_VALUE(VoiceQueueId)','VoiceQueueId','from','toString','state','calleridnum\x20IS\x20NOT\x20NULL','calleridnum\x20NOT\x20IN\x20(?)','VoiceQueueId\x20=\x20?','calleridnum','cm_hopper_final','state\x20=\x204','group','Campaign','CampaignId','ANY_VALUE(ContactId)','createdAt','state\x20=\x20?','CampaignId\x20=\x20?','CmHopper','findOne','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/environment','../../mysqldb','status','end','count','offset','set','Content-Range','json','reject','update','then','destroy','stack','name','send','index','CmHopperFinal','rawAttributes','fieldName','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','sort','pick'];(function(_0x4be53f,_0x5aec1e){var _0x10d2b3=function(_0x3346a1){while(--_0x3346a1){_0x4be53f['push'](_0x4be53f['shift']());}};_0x10d2b3(++_0x5aec1e);}(_0x7ed1,0xca));var _0x17ed=function(_0x4b73a2,_0x40b5fe){_0x4b73a2=_0x4b73a2-0x0;var _0x383c66=_0x7ed1[_0x4b73a2];return _0x383c66;};'use strict';var pdf=require(_0x17ed('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x17ed('0x1'));var zipdir=require(_0x17ed('0x2'));var jsonpatch=require(_0x17ed('0x3'));var rp=require(_0x17ed('0x4'));var moment=require(_0x17ed('0x5'));var BPromise=require(_0x17ed('0x6'));var Mustache=require('mustache');var util=require(_0x17ed('0x7'));var path=require(_0x17ed('0x8'));var sox=require(_0x17ed('0x9'));var csv=require(_0x17ed('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x17ed('0xb'));var crypto=require(_0x17ed('0xc'));var jsforce=require(_0x17ed('0xd'));var deskjs=require(_0x17ed('0xe'));var toCsv=require('to-csv');var querystring=require(_0x17ed('0xf'));var Papa=require(_0x17ed('0x10'));var Redis=require(_0x17ed('0x11'));var authService=require(_0x17ed('0x12'));var qs=require(_0x17ed('0x13'));var as=require(_0x17ed('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x17ed('0x15'))('api');var utils=require('../../config/utils');var config=require(_0x17ed('0x16'));var db=require(_0x17ed('0x17'))['db'];function respondWithStatusCode(_0x4533bc,_0x10d961){_0x10d961=_0x10d961||0xcc;return function(_0x3f2851){if(_0x3f2851){return _0x4533bc['sendStatus'](_0x10d961);}return _0x4533bc[_0x17ed('0x18')](_0x10d961)[_0x17ed('0x19')]();};}function respondWithResult(_0x197135,_0x5f408e){_0x5f408e=_0x5f408e||0xc8;return function(_0x2ae9aa){if(_0x2ae9aa){return _0x197135['status'](_0x5f408e)['json'](_0x2ae9aa);}};}function respondWithFilteredResult(_0x30a0c6,_0x570d98){return function(_0x41b741){if(_0x41b741){var _0x4782c3=_0x41b741[_0x17ed('0x1a')],_0xd10a00=_0x570d98[_0x17ed('0x1b')],_0x6ccf15=_0x570d98[_0x17ed('0x1b')]+_0x570d98['limit'],_0x5458ff;if(_0x6ccf15>=_0x4782c3){_0x6ccf15=_0x4782c3;_0x5458ff=0xc8;}else{_0x5458ff=0xce;}_0x30a0c6['status'](_0x5458ff);return _0x30a0c6[_0x17ed('0x1c')](_0x17ed('0x1d'),_0xd10a00+'-'+_0x6ccf15+'/'+_0x4782c3)[_0x17ed('0x1e')](_0x41b741);}return null;};}function patchUpdates(_0x22e43d){return function(_0x418f4e){try{jsonpatch['apply'](_0x418f4e,_0x22e43d,!![]);}catch(_0x427340){return BPromise[_0x17ed('0x1f')](_0x427340);}return _0x418f4e['save']();};}function saveUpdates(_0x2cac50,_0x3368aa){return function(_0x532b3a){if(_0x532b3a){return _0x532b3a[_0x17ed('0x20')](_0x2cac50)[_0x17ed('0x21')](function(_0x2298ea){return _0x2298ea;});}return null;};}function removeEntity(_0x390342,_0x3918e4){return function(_0x2e5f56){if(_0x2e5f56){return _0x2e5f56[_0x17ed('0x22')]()['then'](function(){_0x390342[_0x17ed('0x18')](0xcc)[_0x17ed('0x19')]();});}};}function handleEntityNotFound(_0x5e1602,_0x5e4f27){return function(_0x464799){if(!_0x464799){_0x5e1602['sendStatus'](0x194);}return _0x464799;};}function handleError(_0x5e03b3,_0x4f014b){_0x4f014b=_0x4f014b||0x1f4;return function(_0x284c72){logger['error'](_0x284c72[_0x17ed('0x23')]);if(_0x284c72[_0x17ed('0x24')]){delete _0x284c72[_0x17ed('0x24')];}_0x5e03b3['status'](_0x4f014b)[_0x17ed('0x25')](_0x284c72);};}exports[_0x17ed('0x26')]=function(_0x29049e,_0x4d1de9){var _0x57470d={},_0x170d4f={},_0xb3ea65={'count':0x0,'rows':[]};var _0x376f03=_['map'](db[_0x17ed('0x27')][_0x17ed('0x28')],function(_0x20ece2){return{'name':_0x20ece2[_0x17ed('0x29')],'type':_0x20ece2['type'][_0x17ed('0x2a')]};});_0x170d4f[_0x17ed('0x2b')]=_['map'](_0x376f03,_0x17ed('0x24'));_0x170d4f[_0x17ed('0x2c')]=_[_0x17ed('0x2d')](_0x29049e['query']);_0x170d4f[_0x17ed('0x2e')]=_[_0x17ed('0x2f')](_0x170d4f[_0x17ed('0x2b')],_0x170d4f[_0x17ed('0x2c')]);_0x57470d['attributes']=_[_0x17ed('0x2f')](_0x170d4f['model'],qs[_0x17ed('0x30')](_0x29049e[_0x17ed('0x2c')][_0x17ed('0x30')]));_0x57470d[_0x17ed('0x31')]=_0x57470d['attributes'][_0x17ed('0x32')]?_0x57470d[_0x17ed('0x31')]:_0x170d4f[_0x17ed('0x2b')];if(!_0x29049e[_0x17ed('0x2c')][_0x17ed('0x33')](_0x17ed('0x34'))){_0x57470d[_0x17ed('0x35')]=qs[_0x17ed('0x35')](_0x29049e['query'][_0x17ed('0x35')]);_0x57470d[_0x17ed('0x1b')]=qs[_0x17ed('0x1b')](_0x29049e[_0x17ed('0x2c')][_0x17ed('0x1b')]);}_0x57470d['order']=qs[_0x17ed('0x36')](_0x29049e[_0x17ed('0x2c')]['sort']);_0x57470d['where']=qs['filters'](_[_0x17ed('0x37')](_0x29049e['query'],_0x170d4f[_0x17ed('0x2e')]),_0x376f03);if(_0x29049e[_0x17ed('0x2c')][_0x17ed('0x38')]){_0x57470d['where']=_[_0x17ed('0x39')](_0x57470d[_0x17ed('0x3a')],{'$or':_[_0x17ed('0x3b')](_0x376f03,function(_0x471b09){if(_0x471b09[_0x17ed('0x3c')]!=='VIRTUAL'){var _0x245778={};_0x245778[_0x471b09[_0x17ed('0x24')]]={'$like':'%'+_0x29049e[_0x17ed('0x2c')][_0x17ed('0x38')]+'%'};return _0x245778;}})});}_0x57470d=_[_0x17ed('0x39')]({},_0x57470d,_0x29049e[_0x17ed('0x3d')]);var _0x54d037={'where':_0x57470d['where']};return db[_0x17ed('0x27')][_0x17ed('0x1a')](_0x54d037)['then'](function(_0x6b4bb4){_0xb3ea65[_0x17ed('0x1a')]=_0x6b4bb4;if(_0x29049e['query'][_0x17ed('0x3e')]){_0x57470d[_0x17ed('0x3f')]=[{'all':!![]}];}return db[_0x17ed('0x27')][_0x17ed('0x40')](_0x57470d);})[_0x17ed('0x21')](function(_0x369145){_0xb3ea65[_0x17ed('0x41')]=_0x369145;return _0xb3ea65;})[_0x17ed('0x21')](respondWithFilteredResult(_0x4d1de9,_0x57470d))['catch'](handleError(_0x4d1de9,null));};exports[_0x17ed('0x42')]=function(_0x20a05e,_0x37f91f){var _0xb6a76a={'raw':!![],'where':{'id':_0x20a05e[_0x17ed('0x43')]['id']}},_0x58c19a={};_0x58c19a[_0x17ed('0x2b')]=_[_0x17ed('0x2d')](db[_0x17ed('0x27')][_0x17ed('0x28')]);_0x58c19a[_0x17ed('0x2c')]=_[_0x17ed('0x2d')](_0x20a05e[_0x17ed('0x2c')]);_0x58c19a[_0x17ed('0x2e')]=_[_0x17ed('0x2f')](_0x58c19a[_0x17ed('0x2b')],_0x58c19a[_0x17ed('0x2c')]);_0xb6a76a[_0x17ed('0x31')]=_[_0x17ed('0x2f')](_0x58c19a['model'],qs[_0x17ed('0x30')](_0x20a05e[_0x17ed('0x2c')][_0x17ed('0x30')]));_0xb6a76a[_0x17ed('0x31')]=_0xb6a76a[_0x17ed('0x31')]['length']?_0xb6a76a[_0x17ed('0x31')]:_0x58c19a[_0x17ed('0x2b')];if(_0x20a05e[_0x17ed('0x2c')][_0x17ed('0x3e')]){_0xb6a76a[_0x17ed('0x3f')]=[{'all':!![]}];}_0xb6a76a=_[_0x17ed('0x39')]({},_0xb6a76a,_0x20a05e[_0x17ed('0x3d')]);return db[_0x17ed('0x27')][_0x17ed('0x44')](_0xb6a76a)[_0x17ed('0x21')](handleEntityNotFound(_0x37f91f,null))[_0x17ed('0x21')](respondWithResult(_0x37f91f,null))['catch'](handleError(_0x37f91f,null));};exports['describe']=function(_0xab7fc1,_0x4238bc){return db[_0x17ed('0x27')][_0x17ed('0x45')]()[_0x17ed('0x21')](respondWithResult(_0x4238bc,null))[_0x17ed('0x46')](handleError(_0x4238bc,null));};exports[_0x17ed('0x20')]=function(_0xc9b7c4,_0x2a63bc){if(_0xc9b7c4['body'][_0x17ed('0x47')]){delete _0xc9b7c4[_0x17ed('0x48')][_0x17ed('0x47')];}return db['CmHopperFinal']['find']({'where':{'uniqueid':_0xc9b7c4[_0x17ed('0x43')]['id']}})[_0x17ed('0x21')](handleEntityNotFound(_0x2a63bc,null))['then'](saveUpdates(_0xc9b7c4['body'],null))['then'](respondWithResult(_0x2a63bc,null))[_0x17ed('0x46')](handleError(_0x2a63bc,null));};exports[_0x17ed('0x49')]=function(_0x2b2db0,_0x3888b7,_0x27f3b6){return db[_0x17ed('0x27')][_0x17ed('0x40')]({'raw':![],'where':{'VoiceQueueId':_0x2b2db0[_0x17ed('0x43')]['id']},'attributes':[[db[_0x17ed('0x4a')]['fn'](_0x17ed('0x4b'),db[_0x17ed('0x4a')]['fn']('IF',db[_0x17ed('0x4a')]['literal'](_0x17ed('0x4c')))),_0x17ed('0x4d')],[db['sequelize']['fn'](_0x17ed('0x4b'),db[_0x17ed('0x4a')]['fn']('IF',db[_0x17ed('0x4a')][_0x17ed('0x4e')](_0x17ed('0x4f')))),_0x17ed('0x50')],[db['sequelize']['fn'](_0x17ed('0x4b'),db['sequelize']['fn']('IF',db[_0x17ed('0x4a')]['literal'](_0x17ed('0x51')))),_0x17ed('0x52')],[db[_0x17ed('0x4a')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x17ed('0x4a')][_0x17ed('0x4e')](_0x17ed('0x53')))),_0x17ed('0x54')],[db[_0x17ed('0x4a')]['fn'](_0x17ed('0x4b'),db['sequelize']['fn']('IF',db['sequelize'][_0x17ed('0x4e')](_0x17ed('0x55')))),_0x17ed('0x56')],[db[_0x17ed('0x4a')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x17ed('0x4a')][_0x17ed('0x4e')](_0x17ed('0x57')))),_0x17ed('0x58')],[db[_0x17ed('0x4a')]['fn'](_0x17ed('0x4b'),db['sequelize']['fn']('IF',db['sequelize'][_0x17ed('0x4e')]('`state`\x20=\x2022,\x201,\x20null'))),_0x17ed('0x59')],[db['sequelize']['fn'](_0x17ed('0x4b'),db['sequelize']['fn']('IF',db[_0x17ed('0x4a')][_0x17ed('0x4e')](_0x17ed('0x5a')))),_0x17ed('0x5b')]]})['then'](handleEntityNotFound(_0x3888b7,null))[_0x17ed('0x21')](respondWithResult(_0x3888b7,null))[_0x17ed('0x46')](handleError(_0x3888b7,null));};exports[_0x17ed('0x5c')]=function(_0x4b10ad,_0x10821b,_0x2892bb){return db[_0x17ed('0x27')][_0x17ed('0x40')]({'raw':![],'where':{'CampaignId':_0x4b10ad['params']['id']},'attributes':[[db[_0x17ed('0x4a')]['fn']('COUNT',db[_0x17ed('0x4a')]['fn']('IF',db[_0x17ed('0x4a')]['literal']('`state`\x20=\x200,\x201,\x20null'))),_0x17ed('0x4d')],[db[_0x17ed('0x4a')]['fn'](_0x17ed('0x4b'),db['sequelize']['fn']('IF',db[_0x17ed('0x4a')][_0x17ed('0x4e')]('`state`\x20=\x203,\x201,\x20null'))),'noAnswerContacts'],[db[_0x17ed('0x4a')]['fn'](_0x17ed('0x4b'),db[_0x17ed('0x4a')]['fn']('IF',db[_0x17ed('0x4a')][_0x17ed('0x4e')](_0x17ed('0x51')))),_0x17ed('0x52')],[db['sequelize']['fn']('COUNT',db[_0x17ed('0x4a')]['fn']('IF',db[_0x17ed('0x4a')]['literal']('`state`\x20=\x208,\x201,\x20null'))),_0x17ed('0x54')],[db['sequelize']['fn']('COUNT',db[_0x17ed('0x4a')]['fn']('IF',db['sequelize']['literal'](_0x17ed('0x55')))),_0x17ed('0x56')],[db['sequelize']['fn'](_0x17ed('0x4b'),db[_0x17ed('0x4a')]['fn']('IF',db[_0x17ed('0x4a')][_0x17ed('0x4e')](_0x17ed('0x57')))),_0x17ed('0x58')],[db[_0x17ed('0x4a')]['fn']('COUNT',db[_0x17ed('0x4a')]['fn']('IF',db[_0x17ed('0x4a')][_0x17ed('0x4e')](_0x17ed('0x5d')))),_0x17ed('0x59')],[db[_0x17ed('0x4a')]['fn'](_0x17ed('0x4b'),db[_0x17ed('0x4a')]['fn']('IF',db[_0x17ed('0x4a')][_0x17ed('0x4e')](_0x17ed('0x5a')))),_0x17ed('0x5b')]]})['then'](handleEntityNotFound(_0x10821b,null))[_0x17ed('0x21')](respondWithResult(_0x10821b,null))['catch'](handleError(_0x10821b,null));};exports['moveContactsQueueCampaignHopperFinal']=function(_0x49d90d,_0xf6f991,_0x70290c){return db[_0x17ed('0x5e')][_0x17ed('0x44')]({'where':{'id':_0x49d90d['params']['id']}})[_0x17ed('0x21')](handleEntityNotFound(_0xf6f991,null))[_0x17ed('0x21')](function(_0x17ac01){var _0x3156db;if(_0x17ac01){_0x3156db=squel[_0x17ed('0x5f')]()[_0x17ed('0x60')](_0x17ed('0x61'))[_0x17ed('0x62')](['phone','scheduledAt','ContactId','ListId','VoiceQueueId','createdAt',_0x17ed('0x63')],squel[_0x17ed('0x64')]()[_0x17ed('0x65')](_0x17ed('0x66'),_0x17ed('0x67'))[_0x17ed('0x65')](_0x17ed('0x68'),_0x17ed('0x69'))['field']('ANY_VALUE(ContactId)',_0x17ed('0x6a'))[_0x17ed('0x65')](_0x17ed('0x6b'),_0x17ed('0x6c'))[_0x17ed('0x65')](_0x17ed('0x6d'),_0x17ed('0x6e'))[_0x17ed('0x65')](_0x17ed('0x68'),'createdAt')[_0x17ed('0x65')](_0x17ed('0x68'),_0x17ed('0x63'))[_0x17ed('0x6f')]('cm_hopper_final')[_0x17ed('0x3a')]('VoiceQueueId\x20=\x20?',_0x49d90d['params']['id'][_0x17ed('0x70')]())['where']('state\x20=\x20?',_0x49d90d[_0x17ed('0x48')][_0x17ed('0x71')][_0x17ed('0x70')]())[_0x17ed('0x3a')](_0x17ed('0x72'))[_0x17ed('0x3a')](_0x17ed('0x73'),squel[_0x17ed('0x64')]()[_0x17ed('0x65')](_0x17ed('0x67'))[_0x17ed('0x6f')](_0x17ed('0x61'))[_0x17ed('0x3a')](_0x17ed('0x74'),_0x49d90d[_0x17ed('0x43')]['id'][_0x17ed('0x70')]()))[_0x17ed('0x3a')](_0x17ed('0x73'),squel[_0x17ed('0x64')]()[_0x17ed('0x65')](_0x17ed('0x75'))[_0x17ed('0x6f')](_0x17ed('0x76'))['where'](_0x17ed('0x74'),_0x49d90d[_0x17ed('0x43')]['id']['toString']())[_0x17ed('0x3a')](_0x17ed('0x77')))[_0x17ed('0x78')](_0x17ed('0x6a')))[_0x17ed('0x70')]();return db[_0x17ed('0x4a')]['query'](_0x3156db);}return[];})[_0x17ed('0x21')](respondWithResult(_0xf6f991,null))['catch'](handleError(_0xf6f991,null));};exports['moveContactsIvrCampaignHopperFinal']=function(_0x2458ea,_0x327cc4,_0x3e58e6){return db[_0x17ed('0x79')][_0x17ed('0x44')]({'where':{'id':_0x2458ea[_0x17ed('0x43')]['id']}})[_0x17ed('0x21')](handleEntityNotFound(_0x327cc4,null))[_0x17ed('0x21')](function(_0xa1ba59){var _0x1f4e83;if(_0xa1ba59){_0x1f4e83=squel[_0x17ed('0x5f')]()[_0x17ed('0x60')](_0x17ed('0x61'))['fromQuery'](['phone',_0x17ed('0x69'),_0x17ed('0x6a'),_0x17ed('0x6c'),_0x17ed('0x7a'),'createdAt',_0x17ed('0x63')],squel[_0x17ed('0x64')]()[_0x17ed('0x65')](_0x17ed('0x66'),_0x17ed('0x67'))[_0x17ed('0x65')](_0x17ed('0x68'),_0x17ed('0x69'))[_0x17ed('0x65')](_0x17ed('0x7b'),_0x17ed('0x6a'))[_0x17ed('0x65')](_0x17ed('0x6b'),_0x17ed('0x6c'))[_0x17ed('0x65')]('ANY_VALUE(CampaignId)',_0x17ed('0x7a'))[_0x17ed('0x65')](_0x17ed('0x68'),_0x17ed('0x7c'))[_0x17ed('0x65')]('NOW()',_0x17ed('0x63'))[_0x17ed('0x6f')]('cm_hopper_final')['where']('CampaignId\x20=\x20?',_0x2458ea[_0x17ed('0x43')]['id']['toString']())[_0x17ed('0x3a')](_0x17ed('0x7d'),_0x2458ea['body'][_0x17ed('0x71')][_0x17ed('0x70')]())[_0x17ed('0x3a')](_0x17ed('0x72'))[_0x17ed('0x3a')](_0x17ed('0x73'),squel[_0x17ed('0x64')]()[_0x17ed('0x65')](_0x17ed('0x67'))[_0x17ed('0x6f')]('cm_hopper')[_0x17ed('0x3a')](_0x17ed('0x7e'),_0x2458ea[_0x17ed('0x43')]['id'][_0x17ed('0x70')]()))[_0x17ed('0x3a')]('calleridnum\x20NOT\x20IN\x20(?)',squel['select']()['field'](_0x17ed('0x75'))[_0x17ed('0x6f')](_0x17ed('0x76'))[_0x17ed('0x3a')]('CampaignId\x20=\x20?',_0x2458ea['params']['id'][_0x17ed('0x70')]())['where'](_0x17ed('0x77')))[_0x17ed('0x78')](_0x17ed('0x6a')))[_0x17ed('0x70')]();return db['sequelize'][_0x17ed('0x2c')](_0x1f4e83);}return[];})[_0x17ed('0x21')](respondWithResult(_0x327cc4,null))[_0x17ed('0x46')](handleError(_0x327cc4,null));};exports['checkContactHopper']=function(_0xa43beb,_0x51c06b,_0x1e7800){return db[_0x17ed('0x7f')][_0x17ed('0x80')]({'where':{'VoiceQueueId':_0xa43beb[_0x17ed('0x48')]['VoiceQueueId'],'CampaignId':_0xa43beb['body'][_0x17ed('0x7a')],'ContactId':_0xa43beb['body'][_0x17ed('0x6a')]}})[_0x17ed('0x21')](handleEntityNotFound(_0x51c06b,null))[_0x17ed('0x21')](function(_0x47f3fa){if(_0x47f3fa){return _0x47f3fa;}return null;})[_0x17ed('0x21')](respondWithResult(_0x51c06b,null))['catch'](handleError(_0x51c06b,null));};
\ No newline at end of file
diff --git a/server/api/cmHopperFinal/cmHopperFinal.model.js b/server/api/cmHopperFinal/cmHopperFinal.model.js
index a40cf90..0b0b726 100644
--- a/server/api/cmHopperFinal/cmHopperFinal.model.js
+++ b/server/api/cmHopperFinal/cmHopperFinal.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x8e94=['api','bluebird','path','exports','define','cm_hopper_final','calleridnum','uniqueid','lodash','util'];(function(_0x30aa3d,_0x4a8951){var _0x44dc5a=function(_0x565e17){while(--_0x565e17){_0x30aa3d['push'](_0x30aa3d['shift']());}};_0x44dc5a(++_0x4a8951);}(_0x8e94,0xf8));var _0x48e9=function(_0xdfc87d,_0x28e1a5){_0xdfc87d=_0xdfc87d-0x0;var _0x4e2a5e=_0x8e94[_0xdfc87d];return _0x4e2a5e;};'use strict';var _=require(_0x48e9('0x0'));var util=require(_0x48e9('0x1'));var logger=require('../../config/logger')(_0x48e9('0x2'));var moment=require('moment');var BPromise=require(_0x48e9('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x48e9('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./cmHopperFinal.attributes');module[_0x48e9('0x5')]=function(_0x20d724,_0x5d6996){return _0x20d724[_0x48e9('0x6')]('CmHopperFinal',attributes,{'tableName':_0x48e9('0x7'),'paranoid':![],'indexes':[{'name':'calleridnum','fields':[_0x48e9('0x8')]},{'name':_0x48e9('0x9'),'fields':[_0x48e9('0x9')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xb634=['lodash','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./cmHopperFinal.attributes','exports','define','cm_hopper_final','calleridnum','uniqueid'];(function(_0xbec8e6,_0x2841b5){var _0x4aa6f2=function(_0x583a0a){while(--_0x583a0a){_0xbec8e6['push'](_0xbec8e6['shift']());}};_0x4aa6f2(++_0x2841b5);}(_0xb634,0x1c0));var _0x4b63=function(_0x15b1fb,_0xa26679){_0x15b1fb=_0x15b1fb-0x0;var _0x139d7d=_0xb634[_0x15b1fb];return _0x139d7d;};'use strict';var _=require(_0x4b63('0x0'));var util=require('util');var logger=require(_0x4b63('0x1'))(_0x4b63('0x2'));var moment=require(_0x4b63('0x3'));var BPromise=require('bluebird');var rp=require(_0x4b63('0x4'));var fs=require('fs');var path=require(_0x4b63('0x5'));var rimraf=require(_0x4b63('0x6'));var config=require(_0x4b63('0x7'));var attributes=require(_0x4b63('0x8'));module[_0x4b63('0x9')]=function(_0x47abe1,_0x57fba1){return _0x47abe1[_0x4b63('0xa')]('CmHopperFinal',attributes,{'tableName':_0x4b63('0xb'),'paranoid':![],'indexes':[{'name':'calleridnum','fields':[_0x4b63('0xc')]},{'name':_0x4b63('0xd'),'fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/cmHopperFinal/cmHopperFinal.rpc.js b/server/api/cmHopperFinal/cmHopperFinal.rpc.js
index bc6acf3..80795fc 100644
--- a/server/api/cmHopperFinal/cmHopperFinal.rpc.js
+++ b/server/api/cmHopperFinal/cmHopperFinal.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9eec=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','CmHopperFinal,\x20%s,\x20%s','request\x20sent','error','code','message','catch','CmHopperFinal','create','raw','CreateCmHopperFinal','debug','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x4085d8,_0x52b689){var _0x10a618=function(_0x4b7fce){while(--_0x4b7fce){_0x4085d8['push'](_0x4085d8['shift']());}};_0x10a618(++_0x52b689);}(_0x9eec,0x84));var _0xc9ee=function(_0x29f8c4,_0x43ddd6){_0x29f8c4=_0x29f8c4-0x0;var _0x234e9f=_0x9eec[_0x29f8c4];return _0x234e9f;};'use strict';var _=require(_0xc9ee('0x0'));var util=require(_0xc9ee('0x1'));var moment=require(_0xc9ee('0x2'));var BPromise=require(_0xc9ee('0x3'));var rs=require(_0xc9ee('0x4'));var fs=require('fs');var Redis=require(_0xc9ee('0x5'));var db=require(_0xc9ee('0x6'))['db'];var utils=require(_0xc9ee('0x7'));var logger=require(_0xc9ee('0x8'))(_0xc9ee('0x9'));var config=require(_0xc9ee('0xa'));var jayson=require(_0xc9ee('0xb'));var client=jayson[_0xc9ee('0xc')][_0xc9ee('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x5cb884,_0x11c4a1,_0x2777f8){return new BPromise(function(_0x24220c,_0x5816ff){return client[_0xc9ee('0xe')](_0x5cb884,_0x2777f8)[_0xc9ee('0xf')](function(_0x4f75c1){logger[_0xc9ee('0x10')](_0xc9ee('0x11'),_0x11c4a1,_0xc9ee('0x12'));logger['debug']('CmHopperFinal,\x20%s,\x20%s,\x20%s',_0x11c4a1,'request\x20sent',JSON['stringify'](_0x4f75c1));if(_0x4f75c1[_0xc9ee('0x13')]){if(_0x4f75c1[_0xc9ee('0x13')][_0xc9ee('0x14')]===0x1f4){logger['error']('CmHopperFinal,\x20%s,\x20%s',_0x11c4a1,_0x4f75c1[_0xc9ee('0x13')][_0xc9ee('0x15')]);return _0x5816ff(_0x4f75c1[_0xc9ee('0x13')][_0xc9ee('0x15')]);}logger[_0xc9ee('0x13')]('CmHopperFinal,\x20%s,\x20%s',_0x11c4a1,_0x4f75c1[_0xc9ee('0x13')][_0xc9ee('0x15')]);return _0x24220c(_0x4f75c1['error']['message']);}else{logger[_0xc9ee('0x10')](_0xc9ee('0x11'),_0x11c4a1,_0xc9ee('0x12'));_0x24220c(_0x4f75c1['result']['message']);}})[_0xc9ee('0x16')](function(_0x1d07dd){logger[_0xc9ee('0x13')](_0xc9ee('0x11'),_0x11c4a1,_0x1d07dd);_0x5816ff(_0x1d07dd);});});}exports['CreateCmHopperFinal']=function(_0x108a01){var _0xa40ad1=this;return new Promise(function(_0x2497d8,_0x4a6728){return db[_0xc9ee('0x17')][_0xc9ee('0x18')](_0x108a01['body'],{'raw':_0x108a01['options']?_0x108a01['options'][_0xc9ee('0x19')]===undefined?!![]:![]:!![]})[_0xc9ee('0xf')](function(_0x4b5fd7){logger[_0xc9ee('0x10')](_0xc9ee('0x1a'),_0x108a01);logger[_0xc9ee('0x1b')](_0xc9ee('0x1a'),_0x108a01,JSON['stringify'](_0x4b5fd7));_0x2497d8(_0x4b5fd7);})[_0xc9ee('0x16')](function(_0x50a084){logger[_0xc9ee('0x13')](_0xc9ee('0x1a'),_0x50a084[_0xc9ee('0x15')],_0x108a01);_0x4a6728(_0xa40ad1[_0xc9ee('0x13')](0x1f4,_0x50a084[_0xc9ee('0x15')]));});});};
\ No newline at end of file
+var _0xc873=['http','request','then','info','CmHopperFinal,\x20%s,\x20%s','request\x20sent','debug','error','message','result','catch','CreateCmHopperFinal','CmHopperFinal','create','options','stringify','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0xaa0dc9,_0x5c570c){var _0x1eb73a=function(_0xb97d45){while(--_0xb97d45){_0xaa0dc9['push'](_0xaa0dc9['shift']());}};_0x1eb73a(++_0x5c570c);}(_0xc873,0x15a));var _0x3c87=function(_0x50973b,_0x31e978){_0x50973b=_0x50973b-0x0;var _0x324eaf=_0xc873[_0x50973b];return _0x324eaf;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x3c87('0x0'));var BPromise=require('bluebird');var rs=require(_0x3c87('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3c87('0x2'))['db'];var utils=require(_0x3c87('0x3'));var logger=require(_0x3c87('0x4'))(_0x3c87('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x3c87('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x3b8646,_0x458a3a,_0x3a23aa){return new BPromise(function(_0x16fb8c,_0x1728e3){return client[_0x3c87('0x7')](_0x3b8646,_0x3a23aa)[_0x3c87('0x8')](function(_0x396e68){logger[_0x3c87('0x9')](_0x3c87('0xa'),_0x458a3a,_0x3c87('0xb'));logger[_0x3c87('0xc')]('CmHopperFinal,\x20%s,\x20%s,\x20%s',_0x458a3a,'request\x20sent',JSON['stringify'](_0x396e68));if(_0x396e68[_0x3c87('0xd')]){if(_0x396e68['error']['code']===0x1f4){logger[_0x3c87('0xd')]('CmHopperFinal,\x20%s,\x20%s',_0x458a3a,_0x396e68['error'][_0x3c87('0xe')]);return _0x1728e3(_0x396e68[_0x3c87('0xd')][_0x3c87('0xe')]);}logger[_0x3c87('0xd')](_0x3c87('0xa'),_0x458a3a,_0x396e68[_0x3c87('0xd')][_0x3c87('0xe')]);return _0x16fb8c(_0x396e68['error'][_0x3c87('0xe')]);}else{logger[_0x3c87('0x9')](_0x3c87('0xa'),_0x458a3a,_0x3c87('0xb'));_0x16fb8c(_0x396e68[_0x3c87('0xf')][_0x3c87('0xe')]);}})[_0x3c87('0x10')](function(_0x3acc3e){logger['error']('CmHopperFinal,\x20%s,\x20%s',_0x458a3a,_0x3acc3e);_0x1728e3(_0x3acc3e);});});}exports[_0x3c87('0x11')]=function(_0x4467cd){var _0x6dcfbb=this;return new Promise(function(_0x2934c4,_0x2d2fa2){return db[_0x3c87('0x12')][_0x3c87('0x13')](_0x4467cd['body'],{'raw':_0x4467cd['options']?_0x4467cd[_0x3c87('0x14')]['raw']===undefined?!![]:![]:!![]})[_0x3c87('0x8')](function(_0x369ed0){logger['info'](_0x3c87('0x11'),_0x4467cd);logger[_0x3c87('0xc')]('CreateCmHopperFinal',_0x4467cd,JSON[_0x3c87('0x15')](_0x369ed0));_0x2934c4(_0x369ed0);})[_0x3c87('0x10')](function(_0x1f8cae){logger[_0x3c87('0xd')](_0x3c87('0x11'),_0x1f8cae[_0x3c87('0xe')],_0x4467cd);_0x2d2fa2(_0x6dcfbb[_0x3c87('0xd')](0x1f4,_0x1f8cae[_0x3c87('0xe')]));});});};
\ No newline at end of file
diff --git a/server/api/cmHopperFinal/index.js b/server/api/cmHopperFinal/index.js
index e7f3807..9b9c26c 100644
--- a/server/api/cmHopperFinal/index.js
+++ b/server/api/cmHopperFinal/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xca74=['moveContactsIvrCampaignHopperFinal','/checkContactHopper','put','update','exports','util','path','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperFinal.controller','get','/describe','isAuthenticated','/:id','show','/campaign/countAttributes/:id','countContactsIvrCampaignHopperFinal','moveContactsQueueCampaignHopperFinal','post','/voice/campaign/moveContacts/:id'];(function(_0x4eb24f,_0x9d1734){var _0x2f5de3=function(_0x464b24){while(--_0x464b24){_0x4eb24f['push'](_0x4eb24f['shift']());}};_0x2f5de3(++_0x9d1734);}(_0xca74,0x9f));var _0x4ca7=function(_0x1db831,_0x42b7b5){_0x1db831=_0x1db831-0x0;var _0x39ba56=_0xca74[_0x1db831];return _0x39ba56;};'use strict';var multer=require('multer');var util=require(_0x4ca7('0x0'));var path=require(_0x4ca7('0x1'));var timeout=require(_0x4ca7('0x2'));var express=require('express');var router=express['Router']();var auth=require(_0x4ca7('0x3'));var interaction=require(_0x4ca7('0x4'));var config=require(_0x4ca7('0x5'));var controller=require(_0x4ca7('0x6'));router[_0x4ca7('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0x4ca7('0x7')](_0x4ca7('0x8'),auth[_0x4ca7('0x9')](),controller['describe']);router['get'](_0x4ca7('0xa'),auth['isAuthenticated'](),controller[_0x4ca7('0xb')]);router['get']('/voice/queue/countAttributes/:id',auth[_0x4ca7('0x9')](),controller['countContactsQueueCampaignHopperFinal']);router[_0x4ca7('0x7')](_0x4ca7('0xc'),auth[_0x4ca7('0x9')](),controller[_0x4ca7('0xd')]);router['post']('/voice/queue/moveContacts/:id',auth[_0x4ca7('0x9')](),controller[_0x4ca7('0xe')]);router[_0x4ca7('0xf')](_0x4ca7('0x10'),auth[_0x4ca7('0x9')](),controller[_0x4ca7('0x11')]);router['post'](_0x4ca7('0x12'),auth[_0x4ca7('0x9')](),controller['checkContactHopper']);router[_0x4ca7('0x13')](_0x4ca7('0xa'),auth['isAuthenticated'](),controller[_0x4ca7('0x14')]);module[_0x4ca7('0x15')]=router;
\ No newline at end of file
+var _0xe07a=['/checkContactHopper','checkContactHopper','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperFinal.controller','get','isAuthenticated','index','describe','/:id','show','countContactsQueueCampaignHopperFinal','/campaign/countAttributes/:id','countContactsIvrCampaignHopperFinal','/voice/queue/moveContacts/:id','moveContactsQueueCampaignHopperFinal','post','moveContactsIvrCampaignHopperFinal'];(function(_0x28666a,_0x3dc25d){var _0x19d752=function(_0x551e47){while(--_0x551e47){_0x28666a['push'](_0x28666a['shift']());}};_0x19d752(++_0x3dc25d);}(_0xe07a,0xfc));var _0xae07=function(_0x57096e,_0x57a241){_0x57096e=_0x57096e-0x0;var _0x4061db=_0xe07a[_0x57096e];return _0x4061db;};'use strict';var multer=require(_0xae07('0x0'));var util=require(_0xae07('0x1'));var path=require(_0xae07('0x2'));var timeout=require(_0xae07('0x3'));var express=require(_0xae07('0x4'));var router=express[_0xae07('0x5')]();var auth=require(_0xae07('0x6'));var interaction=require(_0xae07('0x7'));var config=require(_0xae07('0x8'));var controller=require(_0xae07('0x9'));router[_0xae07('0xa')]('/',auth[_0xae07('0xb')](),controller[_0xae07('0xc')]);router[_0xae07('0xa')]('/describe',auth[_0xae07('0xb')](),controller[_0xae07('0xd')]);router[_0xae07('0xa')](_0xae07('0xe'),auth[_0xae07('0xb')](),controller[_0xae07('0xf')]);router['get']('/voice/queue/countAttributes/:id',auth[_0xae07('0xb')](),controller[_0xae07('0x10')]);router['get'](_0xae07('0x11'),auth[_0xae07('0xb')](),controller[_0xae07('0x12')]);router['post'](_0xae07('0x13'),auth[_0xae07('0xb')](),controller[_0xae07('0x14')]);router[_0xae07('0x15')]('/voice/campaign/moveContacts/:id',auth[_0xae07('0xb')](),controller[_0xae07('0x16')]);router['post'](_0xae07('0x17'),auth[_0xae07('0xb')](),controller[_0xae07('0x18')]);router['put']('/:id',auth[_0xae07('0xb')](),controller['update']);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/cmHopperHistory/cmHopperHistory.attributes.js b/server/api/cmHopperHistory/cmHopperHistory.attributes.js
index a7ffe3f..ee08fad 100644
--- a/server/api/cmHopperHistory/cmHopperHistory.attributes.js
+++ b/server/api/cmHopperHistory/cmHopperHistory.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xb160=['BOOLEAN','sequelize','exports','STRING','INTEGER','DATE'];(function(_0x10bc07,_0x277d97){var _0x3b65ee=function(_0x51b62f){while(--_0x51b62f){_0x10bc07['push'](_0x10bc07['shift']());}};_0x3b65ee(++_0x277d97);}(_0xb160,0xf1));var _0x0b16=function(_0x50e053,_0x3b3464){_0x50e053=_0x50e053-0x0;var _0x27a68f=_0xb160[_0x50e053];return _0x27a68f;};'use strict';var Sequelize=require(_0x0b16('0x0'));module[_0x0b16('0x1')]={'state':{'type':Sequelize['INTEGER'](0x2)},'statedesc':{'type':Sequelize[_0x0b16('0x2')]},'scheduledat':{'type':Sequelize['DATE']},'countbusyretry':{'type':Sequelize[_0x0b16('0x3')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x0b16('0x3')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x0b16('0x3')],'defaultValue':0x0},'countglobal':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x0b16('0x2')]},'originatecalleridnum':{'type':Sequelize['STRING']},'originatecalleridname':{'type':Sequelize[_0x0b16('0x2')]},'calleridnum':{'type':Sequelize[_0x0b16('0x2')]},'calleridname':{'type':Sequelize[_0x0b16('0x2')]},'starttime':{'type':Sequelize['DATE']},'responsetime':{'type':Sequelize[_0x0b16('0x4')]},'answertime':{'type':Sequelize['DATE']},'droptime':{'type':Sequelize[_0x0b16('0x4')]},'endtime':{'type':Sequelize[_0x0b16('0x4')]},'ringtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x0b16('0x3')],'defaultValue':0x0},'talktime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x0b16('0x3')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x0b16('0x2')]},'campaign':{'type':Sequelize[_0x0b16('0x2')]},'campaigntype':{'type':Sequelize[_0x0b16('0x2')]},'membername':{'type':Sequelize['STRING']},'reason':{'type':Sequelize[_0x0b16('0x2')]},'amd':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'fax':{'type':Sequelize[_0x0b16('0x5')],'defaultValue':![]},'callback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x0b16('0x2')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x0b16('0x4')]},'recallme':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'editedat':{'type':Sequelize['DATE']},'edited':{'type':Sequelize[_0x0b16('0x5')],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize[_0x0b16('0x3')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x0b16('0x3')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x0b16('0x3')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x0b16('0x3')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x0b16('0x3')],'defaultValue':0x0},'dialTimezone':{'type':Sequelize[_0x0b16('0x2')]}};
\ No newline at end of file
+var _0x3737=['BOOLEAN','INTEGER','STRING','DATE'];(function(_0xf5fa0d,_0x17485e){var _0x2633e3=function(_0x593a2f){while(--_0x593a2f){_0xf5fa0d['push'](_0xf5fa0d['shift']());}};_0x2633e3(++_0x17485e);}(_0x3737,0x69));var _0x7373=function(_0x49ae9b,_0xf8c269){_0x49ae9b=_0x49ae9b-0x0;var _0x125b30=_0x3737[_0x49ae9b];return _0x125b30;};'use strict';var Sequelize=require('sequelize');module['exports']={'state':{'type':Sequelize[_0x7373('0x0')](0x2)},'statedesc':{'type':Sequelize[_0x7373('0x1')]},'scheduledat':{'type':Sequelize[_0x7373('0x2')]},'countbusyretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x7373('0x0')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countglobal':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x7373('0x1')]},'originatecalleridnum':{'type':Sequelize[_0x7373('0x1')]},'originatecalleridname':{'type':Sequelize[_0x7373('0x1')]},'calleridnum':{'type':Sequelize[_0x7373('0x1')]},'calleridname':{'type':Sequelize[_0x7373('0x1')]},'starttime':{'type':Sequelize[_0x7373('0x2')]},'responsetime':{'type':Sequelize[_0x7373('0x2')]},'answertime':{'type':Sequelize[_0x7373('0x2')]},'droptime':{'type':Sequelize[_0x7373('0x2')]},'endtime':{'type':Sequelize[_0x7373('0x2')]},'ringtime':{'type':Sequelize[_0x7373('0x0')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x7373('0x0')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x7373('0x0')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x7373('0x0')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x7373('0x1')]},'campaign':{'type':Sequelize[_0x7373('0x1')]},'campaigntype':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0x7373('0x1')]},'reason':{'type':Sequelize[_0x7373('0x1')]},'amd':{'type':Sequelize[_0x7373('0x3')],'defaultValue':![]},'fax':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callback':{'type':Sequelize[_0x7373('0x3')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x7373('0x1')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x7373('0x2')]},'recallme':{'type':Sequelize[_0x7373('0x3')],'defaultValue':![]},'editedat':{'type':Sequelize[_0x7373('0x2')]},'edited':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize[_0x7373('0x0')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x7373('0x0')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x7373('0x0')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x7373('0x0')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x7373('0x0')],'defaultValue':0x0},'dialTimezone':{'type':Sequelize[_0x7373('0x1')]}};
\ No newline at end of file
diff --git a/server/api/cmHopperHistory/cmHopperHistory.controller.js b/server/api/cmHopperHistory/cmHopperHistory.controller.js
index 00861ef..75745ef 100644
--- a/server/api/cmHopperHistory/cmHopperHistory.controller.js
+++ b/server/api/cmHopperHistory/cmHopperHistory.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xf2b1=['fields','hasOwnProperty','nolimit','limit','offset','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','findAll','rows','catch','length','include','find','body','describe','uniqueid','html-pdf','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','count','status','Content-Range','json','reject','then','destroy','error','name','index','CmHopperHistory','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes'];(function(_0x786e23,_0x425e18){var _0x4c347b=function(_0x2125cf){while(--_0x2125cf){_0x786e23['push'](_0x786e23['shift']());}};_0x4c347b(++_0x425e18);}(_0xf2b1,0x17a));var _0x1f2b=function(_0x2920dd,_0x19d049){_0x2920dd=_0x2920dd-0x0;var _0x5d4e52=_0xf2b1[_0x2920dd];return _0x5d4e52;};'use strict';var pdf=require(_0x1f2b('0x0'));var emlformat=require(_0x1f2b('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x1f2b('0x2'));var rp=require(_0x1f2b('0x3'));var moment=require(_0x1f2b('0x4'));var BPromise=require(_0x1f2b('0x5'));var Mustache=require(_0x1f2b('0x6'));var util=require(_0x1f2b('0x7'));var path=require('path');var sox=require(_0x1f2b('0x8'));var csv=require(_0x1f2b('0x9'));var ejs=require(_0x1f2b('0xa'));var fs=require('fs');var _=require(_0x1f2b('0xb'));var squel=require(_0x1f2b('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x1f2b('0xd'));var toCsv=require(_0x1f2b('0x9'));var querystring=require(_0x1f2b('0xe'));var Papa=require(_0x1f2b('0xf'));var Redis=require(_0x1f2b('0x10'));var authService=require(_0x1f2b('0x11'));var qs=require(_0x1f2b('0x12'));var as=require(_0x1f2b('0x13'));var hardwareService=require(_0x1f2b('0x14'));var logger=require(_0x1f2b('0x15'))(_0x1f2b('0x16'));var utils=require(_0x1f2b('0x17'));var config=require(_0x1f2b('0x18'));var db=require(_0x1f2b('0x19'))['db'];function respondWithStatusCode(_0x13ff32,_0x5ef855){_0x5ef855=_0x5ef855||0xcc;return function(_0x2b686e){if(_0x2b686e){return _0x13ff32[_0x1f2b('0x1a')](_0x5ef855);}return _0x13ff32['status'](_0x5ef855)[_0x1f2b('0x1b')]();};}function respondWithResult(_0x1c9b5f,_0x28fed6){_0x28fed6=_0x28fed6||0xc8;return function(_0x665269){if(_0x665269){return _0x1c9b5f['status'](_0x28fed6)['json'](_0x665269);}};}function respondWithFilteredResult(_0x5186a9,_0x511167){return function(_0x190653){if(_0x190653){var _0x217b9d=_0x190653[_0x1f2b('0x1c')],_0x2d8e46=_0x511167['offset'],_0x134393=_0x511167['offset']+_0x511167['limit'],_0x21306c;if(_0x134393>=_0x217b9d){_0x134393=_0x217b9d;_0x21306c=0xc8;}else{_0x21306c=0xce;}_0x5186a9[_0x1f2b('0x1d')](_0x21306c);return _0x5186a9['set'](_0x1f2b('0x1e'),_0x2d8e46+'-'+_0x134393+'/'+_0x217b9d)[_0x1f2b('0x1f')](_0x190653);}return null;};}function patchUpdates(_0xf657a6){return function(_0x2652eb){try{jsonpatch['apply'](_0x2652eb,_0xf657a6,!![]);}catch(_0x3e2b1c){return BPromise[_0x1f2b('0x20')](_0x3e2b1c);}return _0x2652eb['save']();};}function saveUpdates(_0x340dc2,_0x4fdfaa){return function(_0x24e775){if(_0x24e775){return _0x24e775['update'](_0x340dc2)[_0x1f2b('0x21')](function(_0x48fa2f){return _0x48fa2f;});}return null;};}function removeEntity(_0x47b874,_0x2ce879){return function(_0x4d3a07){if(_0x4d3a07){return _0x4d3a07[_0x1f2b('0x22')]()[_0x1f2b('0x21')](function(){_0x47b874['status'](0xcc)[_0x1f2b('0x1b')]();});}};}function handleEntityNotFound(_0x2c5418,_0x58414f){return function(_0x1d0938){if(!_0x1d0938){_0x2c5418['sendStatus'](0x194);}return _0x1d0938;};}function handleError(_0x37ebb5,_0x1edfdf){_0x1edfdf=_0x1edfdf||0x1f4;return function(_0x3581db){logger[_0x1f2b('0x23')](_0x3581db['stack']);if(_0x3581db[_0x1f2b('0x24')]){delete _0x3581db[_0x1f2b('0x24')];}_0x37ebb5[_0x1f2b('0x1d')](_0x1edfdf)['send'](_0x3581db);};}exports[_0x1f2b('0x25')]=function(_0x1d69fb,_0x2c08ee){var _0x157e06={},_0x2f09b5={},_0x567037={'count':0x0,'rows':[]};var _0x60caa6=_['map'](db[_0x1f2b('0x26')][_0x1f2b('0x27')],function(_0x3c0784){return{'name':_0x3c0784[_0x1f2b('0x28')],'type':_0x3c0784[_0x1f2b('0x29')]['key']};});_0x2f09b5[_0x1f2b('0x2a')]=_['map'](_0x60caa6,_0x1f2b('0x24'));_0x2f09b5[_0x1f2b('0x2b')]=_[_0x1f2b('0x2c')](_0x1d69fb[_0x1f2b('0x2b')]);_0x2f09b5[_0x1f2b('0x2d')]=_[_0x1f2b('0x2e')](_0x2f09b5['model'],_0x2f09b5['query']);_0x157e06[_0x1f2b('0x2f')]=_[_0x1f2b('0x2e')](_0x2f09b5[_0x1f2b('0x2a')],qs['fields'](_0x1d69fb[_0x1f2b('0x2b')][_0x1f2b('0x30')]));_0x157e06[_0x1f2b('0x2f')]=_0x157e06[_0x1f2b('0x2f')]['length']?_0x157e06[_0x1f2b('0x2f')]:_0x2f09b5[_0x1f2b('0x2a')];if(!_0x1d69fb[_0x1f2b('0x2b')][_0x1f2b('0x31')](_0x1f2b('0x32'))){_0x157e06[_0x1f2b('0x33')]=qs['limit'](_0x1d69fb[_0x1f2b('0x2b')]['limit']);_0x157e06[_0x1f2b('0x34')]=qs[_0x1f2b('0x34')](_0x1d69fb[_0x1f2b('0x2b')][_0x1f2b('0x34')]);}_0x157e06[_0x1f2b('0x35')]=qs['sort'](_0x1d69fb[_0x1f2b('0x2b')][_0x1f2b('0x36')]);_0x157e06[_0x1f2b('0x37')]=qs[_0x1f2b('0x2d')](_[_0x1f2b('0x38')](_0x1d69fb['query'],_0x2f09b5['filters']),_0x60caa6);if(_0x1d69fb[_0x1f2b('0x2b')][_0x1f2b('0x39')]){_0x157e06['where']=_['merge'](_0x157e06[_0x1f2b('0x37')],{'$or':_['map'](_0x60caa6,function(_0x9255fd){if(_0x9255fd[_0x1f2b('0x29')]!==_0x1f2b('0x3a')){var _0x58c335={};_0x58c335[_0x9255fd['name']]={'$like':'%'+_0x1d69fb[_0x1f2b('0x2b')][_0x1f2b('0x39')]+'%'};return _0x58c335;}})});}_0x157e06=_[_0x1f2b('0x3b')]({},_0x157e06,_0x1d69fb[_0x1f2b('0x3c')]);var _0x1966c9={'where':_0x157e06[_0x1f2b('0x37')]};return db[_0x1f2b('0x26')][_0x1f2b('0x1c')](_0x1966c9)['then'](function(_0x911977){_0x567037['count']=_0x911977;if(_0x1d69fb[_0x1f2b('0x2b')][_0x1f2b('0x3d')]){_0x157e06['include']=[{'all':!![]}];}return db[_0x1f2b('0x26')][_0x1f2b('0x3e')](_0x157e06);})[_0x1f2b('0x21')](function(_0x4a35e4){_0x567037[_0x1f2b('0x3f')]=_0x4a35e4;return _0x567037;})['then'](respondWithFilteredResult(_0x2c08ee,_0x157e06))[_0x1f2b('0x40')](handleError(_0x2c08ee,null));};exports['show']=function(_0x34b271,_0x1380bc){var _0x414b71={'raw':!![],'where':{'id':_0x34b271['params']['id']}},_0x583def={};_0x583def[_0x1f2b('0x2a')]=_['keys'](db[_0x1f2b('0x26')][_0x1f2b('0x27')]);_0x583def[_0x1f2b('0x2b')]=_[_0x1f2b('0x2c')](_0x34b271[_0x1f2b('0x2b')]);_0x583def[_0x1f2b('0x2d')]=_['intersection'](_0x583def['model'],_0x583def[_0x1f2b('0x2b')]);_0x414b71[_0x1f2b('0x2f')]=_[_0x1f2b('0x2e')](_0x583def[_0x1f2b('0x2a')],qs[_0x1f2b('0x30')](_0x34b271[_0x1f2b('0x2b')][_0x1f2b('0x30')]));_0x414b71['attributes']=_0x414b71['attributes'][_0x1f2b('0x41')]?_0x414b71[_0x1f2b('0x2f')]:_0x583def[_0x1f2b('0x2a')];if(_0x34b271[_0x1f2b('0x2b')]['includeAll']){_0x414b71[_0x1f2b('0x42')]=[{'all':!![]}];}_0x414b71=_['merge']({},_0x414b71,_0x34b271[_0x1f2b('0x3c')]);return db[_0x1f2b('0x26')][_0x1f2b('0x43')](_0x414b71)[_0x1f2b('0x21')](handleEntityNotFound(_0x1380bc,null))[_0x1f2b('0x21')](respondWithResult(_0x1380bc,null))[_0x1f2b('0x40')](handleError(_0x1380bc,null));};exports['create']=function(_0x58a105,_0x184f25){return db[_0x1f2b('0x26')]['create'](_0x58a105[_0x1f2b('0x44')],{})[_0x1f2b('0x21')](respondWithResult(_0x184f25,0xc9))['catch'](handleError(_0x184f25,null));};exports[_0x1f2b('0x45')]=function(_0x44eed2,_0x1311c7){return db[_0x1f2b('0x26')][_0x1f2b('0x45')]()['then'](respondWithResult(_0x1311c7,null))['catch'](handleError(_0x1311c7,null));};exports['update']=function(_0x5af8df,_0x5bfab7){if(_0x5af8df[_0x1f2b('0x44')][_0x1f2b('0x46')]){delete _0x5af8df['body'][_0x1f2b('0x46')];}return db['CmHopperHistory'][_0x1f2b('0x43')]({'where':{'uniqueid':_0x5af8df['params']['id']}})[_0x1f2b('0x21')](handleEntityNotFound(_0x5bfab7,null))[_0x1f2b('0x21')](saveUpdates(_0x5af8df[_0x1f2b('0x44')],null))[_0x1f2b('0x21')](respondWithResult(_0x5bfab7,null))[_0x1f2b('0x40')](handleError(_0x5bfab7,null));};
\ No newline at end of file
+var _0xd4f1=['rows','catch','show','params','options','create','describe','body','uniqueid','find','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','json','offset','limit','set','Content-Range','apply','reject','then','error','stack','name','send','index','map','CmHopperHistory','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','sort','pick','filter','merge','where','count','includeAll','include','findAll'];(function(_0x379eaf,_0x4eb489){var _0x326f1f=function(_0x4a8bc2){while(--_0x4a8bc2){_0x379eaf['push'](_0x379eaf['shift']());}};_0x326f1f(++_0x4eb489);}(_0xd4f1,0x181));var _0x1d4f=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd4f1[_0x20a584];return _0x4b41a8;};'use strict';var pdf=require(_0x1d4f('0x0'));var emlformat=require(_0x1d4f('0x1'));var rimraf=require(_0x1d4f('0x2'));var zipdir=require(_0x1d4f('0x3'));var jsonpatch=require(_0x1d4f('0x4'));var rp=require('request-promise');var moment=require(_0x1d4f('0x5'));var BPromise=require(_0x1d4f('0x6'));var Mustache=require(_0x1d4f('0x7'));var util=require('util');var path=require(_0x1d4f('0x8'));var sox=require(_0x1d4f('0x9'));var csv=require(_0x1d4f('0xa'));var ejs=require(_0x1d4f('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0x1d4f('0xc'));var crypto=require(_0x1d4f('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x1d4f('0xe'));var toCsv=require(_0x1d4f('0xa'));var querystring=require(_0x1d4f('0xf'));var Papa=require(_0x1d4f('0x10'));var Redis=require(_0x1d4f('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x1d4f('0x12'));var as=require(_0x1d4f('0x13'));var hardwareService=require(_0x1d4f('0x14'));var logger=require(_0x1d4f('0x15'))(_0x1d4f('0x16'));var utils=require(_0x1d4f('0x17'));var config=require(_0x1d4f('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x403ee7,_0x10c695){_0x10c695=_0x10c695||0xcc;return function(_0xb8b147){if(_0xb8b147){return _0x403ee7[_0x1d4f('0x19')](_0x10c695);}return _0x403ee7[_0x1d4f('0x1a')](_0x10c695)[_0x1d4f('0x1b')]();};}function respondWithResult(_0x5c4507,_0x590788){_0x590788=_0x590788||0xc8;return function(_0x19ea7a){if(_0x19ea7a){return _0x5c4507[_0x1d4f('0x1a')](_0x590788)[_0x1d4f('0x1c')](_0x19ea7a);}};}function respondWithFilteredResult(_0x3b781b,_0x338081){return function(_0x17c17b){if(_0x17c17b){var _0x5ee70c=_0x17c17b['count'],_0x585b85=_0x338081['offset'],_0x6b465d=_0x338081[_0x1d4f('0x1d')]+_0x338081[_0x1d4f('0x1e')],_0x10e29a;if(_0x6b465d>=_0x5ee70c){_0x6b465d=_0x5ee70c;_0x10e29a=0xc8;}else{_0x10e29a=0xce;}_0x3b781b[_0x1d4f('0x1a')](_0x10e29a);return _0x3b781b[_0x1d4f('0x1f')](_0x1d4f('0x20'),_0x585b85+'-'+_0x6b465d+'/'+_0x5ee70c)['json'](_0x17c17b);}return null;};}function patchUpdates(_0x2b8843){return function(_0x399e63){try{jsonpatch[_0x1d4f('0x21')](_0x399e63,_0x2b8843,!![]);}catch(_0x32c562){return BPromise[_0x1d4f('0x22')](_0x32c562);}return _0x399e63['save']();};}function saveUpdates(_0x10f5f3,_0x18f04f){return function(_0x1ecf42){if(_0x1ecf42){return _0x1ecf42['update'](_0x10f5f3)[_0x1d4f('0x23')](function(_0x4d032c){return _0x4d032c;});}return null;};}function removeEntity(_0x2845a2,_0x57ab13){return function(_0x52da3f){if(_0x52da3f){return _0x52da3f['destroy']()[_0x1d4f('0x23')](function(){_0x2845a2[_0x1d4f('0x1a')](0xcc)[_0x1d4f('0x1b')]();});}};}function handleEntityNotFound(_0x5acdb3,_0x36f847){return function(_0x2ca9f6){if(!_0x2ca9f6){_0x5acdb3[_0x1d4f('0x19')](0x194);}return _0x2ca9f6;};}function handleError(_0x2954e6,_0x55922b){_0x55922b=_0x55922b||0x1f4;return function(_0x8a462e){logger[_0x1d4f('0x24')](_0x8a462e[_0x1d4f('0x25')]);if(_0x8a462e[_0x1d4f('0x26')]){delete _0x8a462e['name'];}_0x2954e6[_0x1d4f('0x1a')](_0x55922b)[_0x1d4f('0x27')](_0x8a462e);};}exports[_0x1d4f('0x28')]=function(_0x35c057,_0x52a3a9){var _0x16182d={},_0x49ed54={},_0x16e659={'count':0x0,'rows':[]};var _0x41a0d8=_[_0x1d4f('0x29')](db[_0x1d4f('0x2a')][_0x1d4f('0x2b')],function(_0x3d3321){return{'name':_0x3d3321[_0x1d4f('0x2c')],'type':_0x3d3321[_0x1d4f('0x2d')][_0x1d4f('0x2e')]};});_0x49ed54[_0x1d4f('0x2f')]=_[_0x1d4f('0x29')](_0x41a0d8,'name');_0x49ed54[_0x1d4f('0x30')]=_[_0x1d4f('0x31')](_0x35c057[_0x1d4f('0x30')]);_0x49ed54[_0x1d4f('0x32')]=_[_0x1d4f('0x33')](_0x49ed54[_0x1d4f('0x2f')],_0x49ed54[_0x1d4f('0x30')]);_0x16182d[_0x1d4f('0x34')]=_[_0x1d4f('0x33')](_0x49ed54[_0x1d4f('0x2f')],qs[_0x1d4f('0x35')](_0x35c057[_0x1d4f('0x30')][_0x1d4f('0x35')]));_0x16182d['attributes']=_0x16182d[_0x1d4f('0x34')][_0x1d4f('0x36')]?_0x16182d[_0x1d4f('0x34')]:_0x49ed54[_0x1d4f('0x2f')];if(!_0x35c057[_0x1d4f('0x30')][_0x1d4f('0x37')]('nolimit')){_0x16182d[_0x1d4f('0x1e')]=qs['limit'](_0x35c057[_0x1d4f('0x30')][_0x1d4f('0x1e')]);_0x16182d['offset']=qs[_0x1d4f('0x1d')](_0x35c057['query'][_0x1d4f('0x1d')]);}_0x16182d['order']=qs['sort'](_0x35c057[_0x1d4f('0x30')][_0x1d4f('0x38')]);_0x16182d['where']=qs[_0x1d4f('0x32')](_[_0x1d4f('0x39')](_0x35c057[_0x1d4f('0x30')],_0x49ed54[_0x1d4f('0x32')]),_0x41a0d8);if(_0x35c057['query'][_0x1d4f('0x3a')]){_0x16182d['where']=_[_0x1d4f('0x3b')](_0x16182d[_0x1d4f('0x3c')],{'$or':_[_0x1d4f('0x29')](_0x41a0d8,function(_0x5ff17e){if(_0x5ff17e[_0x1d4f('0x2d')]!=='VIRTUAL'){var _0x1c8f23={};_0x1c8f23[_0x5ff17e[_0x1d4f('0x26')]]={'$like':'%'+_0x35c057[_0x1d4f('0x30')][_0x1d4f('0x3a')]+'%'};return _0x1c8f23;}})});}_0x16182d=_[_0x1d4f('0x3b')]({},_0x16182d,_0x35c057['options']);var _0x592574={'where':_0x16182d[_0x1d4f('0x3c')]};return db[_0x1d4f('0x2a')]['count'](_0x592574)[_0x1d4f('0x23')](function(_0x536bb0){_0x16e659[_0x1d4f('0x3d')]=_0x536bb0;if(_0x35c057['query'][_0x1d4f('0x3e')]){_0x16182d[_0x1d4f('0x3f')]=[{'all':!![]}];}return db[_0x1d4f('0x2a')][_0x1d4f('0x40')](_0x16182d);})[_0x1d4f('0x23')](function(_0x73b11f){_0x16e659[_0x1d4f('0x41')]=_0x73b11f;return _0x16e659;})[_0x1d4f('0x23')](respondWithFilteredResult(_0x52a3a9,_0x16182d))[_0x1d4f('0x42')](handleError(_0x52a3a9,null));};exports[_0x1d4f('0x43')]=function(_0x389b21,_0x5b2eb1){var _0x238800={'raw':!![],'where':{'id':_0x389b21[_0x1d4f('0x44')]['id']}},_0x232ccc={};_0x232ccc['model']=_['keys'](db['CmHopperHistory']['rawAttributes']);_0x232ccc[_0x1d4f('0x30')]=_[_0x1d4f('0x31')](_0x389b21[_0x1d4f('0x30')]);_0x232ccc[_0x1d4f('0x32')]=_['intersection'](_0x232ccc[_0x1d4f('0x2f')],_0x232ccc[_0x1d4f('0x30')]);_0x238800[_0x1d4f('0x34')]=_[_0x1d4f('0x33')](_0x232ccc[_0x1d4f('0x2f')],qs[_0x1d4f('0x35')](_0x389b21[_0x1d4f('0x30')][_0x1d4f('0x35')]));_0x238800['attributes']=_0x238800['attributes'][_0x1d4f('0x36')]?_0x238800[_0x1d4f('0x34')]:_0x232ccc[_0x1d4f('0x2f')];if(_0x389b21[_0x1d4f('0x30')][_0x1d4f('0x3e')]){_0x238800[_0x1d4f('0x3f')]=[{'all':!![]}];}_0x238800=_[_0x1d4f('0x3b')]({},_0x238800,_0x389b21[_0x1d4f('0x45')]);return db[_0x1d4f('0x2a')]['find'](_0x238800)[_0x1d4f('0x23')](handleEntityNotFound(_0x5b2eb1,null))[_0x1d4f('0x23')](respondWithResult(_0x5b2eb1,null))[_0x1d4f('0x42')](handleError(_0x5b2eb1,null));};exports[_0x1d4f('0x46')]=function(_0x441b74,_0xf5531c){return db['CmHopperHistory'][_0x1d4f('0x46')](_0x441b74['body'],{})[_0x1d4f('0x23')](respondWithResult(_0xf5531c,0xc9))[_0x1d4f('0x42')](handleError(_0xf5531c,null));};exports[_0x1d4f('0x47')]=function(_0x1c1daa,_0x5d3a7b){return db['CmHopperHistory'][_0x1d4f('0x47')]()[_0x1d4f('0x23')](respondWithResult(_0x5d3a7b,null))[_0x1d4f('0x42')](handleError(_0x5d3a7b,null));};exports['update']=function(_0x1d09bd,_0x4c5d18){if(_0x1d09bd[_0x1d4f('0x48')]['uniqueid']){delete _0x1d09bd[_0x1d4f('0x48')][_0x1d4f('0x49')];}return db[_0x1d4f('0x2a')][_0x1d4f('0x4a')]({'where':{'uniqueid':_0x1d09bd[_0x1d4f('0x44')]['id']}})[_0x1d4f('0x23')](handleEntityNotFound(_0x4c5d18,null))['then'](saveUpdates(_0x1d09bd[_0x1d4f('0x48')],null))[_0x1d4f('0x23')](respondWithResult(_0x4c5d18,null))[_0x1d4f('0x42')](handleError(_0x4c5d18,null));};
\ No newline at end of file
diff --git a/server/api/cmHopperHistory/cmHopperHistory.model.js b/server/api/cmHopperHistory/cmHopperHistory.model.js
index 3e04b9b..0cc93d7 100644
--- a/server/api/cmHopperHistory/cmHopperHistory.model.js
+++ b/server/api/cmHopperHistory/cmHopperHistory.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x6817=['endtime','uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./cmHopperHistory.attributes','exports','define','cm_hopper_history'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x6817,0x11f));var _0x7681=function(_0x2b9cf2,_0x19cb39){_0x2b9cf2=_0x2b9cf2-0x0;var _0x40dcea=_0x6817[_0x2b9cf2];return _0x40dcea;};'use strict';var _=require(_0x7681('0x0'));var util=require(_0x7681('0x1'));var logger=require(_0x7681('0x2'))(_0x7681('0x3'));var moment=require('moment');var BPromise=require(_0x7681('0x4'));var rp=require(_0x7681('0x5'));var fs=require('fs');var path=require(_0x7681('0x6'));var rimraf=require(_0x7681('0x7'));var config=require(_0x7681('0x8'));var attributes=require(_0x7681('0x9'));module[_0x7681('0xa')]=function(_0x4a83e5,_0x4f9341){return _0x4a83e5[_0x7681('0xb')]('CmHopperHistory',attributes,{'tableName':_0x7681('0xc'),'paranoid':![],'indexes':[{'name':'endtime','fields':[_0x7681('0xd')]},{'name':_0x7681('0xe'),'fields':[_0x7681('0xe')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x4482=['../../config/environment','exports','define','CmHopperHistory','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf'];(function(_0x11a220,_0x4e470a){var _0x20d8fe=function(_0xbedfd){while(--_0xbedfd){_0x11a220['push'](_0x11a220['shift']());}};_0x20d8fe(++_0x4e470a);}(_0x4482,0x184));var _0x2448=function(_0x370b04,_0x1f0815){_0x370b04=_0x370b04-0x0;var _0x3a4e77=_0x4482[_0x370b04];return _0x3a4e77;};'use strict';var _=require(_0x2448('0x0'));var util=require(_0x2448('0x1'));var logger=require(_0x2448('0x2'))(_0x2448('0x3'));var moment=require('moment');var BPromise=require(_0x2448('0x4'));var rp=require(_0x2448('0x5'));var fs=require('fs');var path=require(_0x2448('0x6'));var rimraf=require(_0x2448('0x7'));var config=require(_0x2448('0x8'));var attributes=require('./cmHopperHistory.attributes');module[_0x2448('0x9')]=function(_0x1ae533,_0xe790a7){return _0x1ae533[_0x2448('0xa')](_0x2448('0xb'),attributes,{'tableName':'cm_hopper_history','paranoid':![],'indexes':[{'name':'endtime','fields':['endtime']},{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/cmHopperHistory/cmHopperHistory.rpc.js b/server/api/cmHopperHistory/cmHopperHistory.rpc.js
index 30150fb..f64a44a 100644
--- a/server/api/cmHopperHistory/cmHopperHistory.rpc.js
+++ b/server/api/cmHopperHistory/cmHopperHistory.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x3423=['`state`\x20=\x204,\x201,\x20null','COUNT','`state`\x20=\x2010,\x201,\x20null','predictiveIntervalDroppedCallsTimeout','predictiveIntervalDroppedCallsCallersExit','AVG','`state`\x20=\x204,\x20`holdtime`,\x20null','predictiveIntervalAvgHoldtime','`state`\x20=\x204,\x20`talktime`,\x20null','predictiveIntervalAvgTalktime','GetVoiceQueueHopperHistory','findAll','campaign','`state`\x20=\x200,\x201,\x20null','outboundNoSuchCallsDay','`state`\x20=\x203,\x201,\x20null','outboundAnswerCallsDay','`state`\x20=\x205,\x201,\x20null','outboundBusyCallsDay','`state`\x20=\x208,\x201,\x20null','outboundCongestionCallsDay','`state`\x20=\x2010\x20,\x201,\x20null','outboundDropCallsDayTimeout','outboundDropCallsDayCallersExit','`state`\x20=\x2012,\x201,\x20null','`state`\x20=\x2013,\x201,\x20null','outboundBlacklistCallsDay','`state`\x20=\x2014,\x201,\x20null','outboundOriginateFailureCallsDay','outboundRejectCallsDay','`state`\x20=\x2016,\x201,\x20null','outboundAnswerAgiCallsDay','`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null','outboundReCallsDay','name','ivrTotalCallsDays','GetCampaignHopperHistory','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','CmHopperHistory,\x20%s,\x20%s','stringify','error','code','message','info','result','CreateCmHopperHistory','CmHopperHistory','create','options','raw','debug','catch','AvgHandleTime','where','col','predictiveIntervalTotalCalls','sequelize','literal'];(function(_0x3dac2c,_0x2ad312){var _0x23f73a=function(_0x4fbb2a){while(--_0x4fbb2a){_0x3dac2c['push'](_0x3dac2c['shift']());}};_0x23f73a(++_0x2ad312);}(_0x3423,0x188));var _0x3342=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3423[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x3342('0x0'));var BPromise=require(_0x3342('0x1'));var rs=require(_0x3342('0x2'));var fs=require('fs');var Redis=require(_0x3342('0x3'));var db=require(_0x3342('0x4'))['db'];var utils=require(_0x3342('0x5'));var logger=require(_0x3342('0x6'))(_0x3342('0x7'));var config=require(_0x3342('0x8'));var jayson=require(_0x3342('0x9'));var client=jayson[_0x3342('0xa')][_0x3342('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x29c40c,_0x420d4b,_0x76422d){return new BPromise(function(_0xce08ab,_0x305d13){return client[_0x3342('0xc')](_0x29c40c,_0x76422d)[_0x3342('0xd')](function(_0x4ae4f3){logger['info'](_0x3342('0xe'),_0x420d4b,'request\x20sent');logger['debug']('CmHopperHistory,\x20%s,\x20%s,\x20%s',_0x420d4b,'request\x20sent',JSON[_0x3342('0xf')](_0x4ae4f3));if(_0x4ae4f3[_0x3342('0x10')]){if(_0x4ae4f3['error'][_0x3342('0x11')]===0x1f4){logger['error'](_0x3342('0xe'),_0x420d4b,_0x4ae4f3[_0x3342('0x10')]['message']);return _0x305d13(_0x4ae4f3[_0x3342('0x10')][_0x3342('0x12')]);}logger[_0x3342('0x10')](_0x3342('0xe'),_0x420d4b,_0x4ae4f3[_0x3342('0x10')][_0x3342('0x12')]);return _0xce08ab(_0x4ae4f3[_0x3342('0x10')]['message']);}else{logger[_0x3342('0x13')](_0x3342('0xe'),_0x420d4b,'request\x20sent');_0xce08ab(_0x4ae4f3[_0x3342('0x14')][_0x3342('0x12')]);}})['catch'](function(_0x554f9c){logger[_0x3342('0x10')](_0x3342('0xe'),_0x420d4b,_0x554f9c);_0x305d13(_0x554f9c);});});}exports[_0x3342('0x15')]=function(_0x2075cb){var _0x12947a=this;return new Promise(function(_0x156c24,_0x45a3ca){return db[_0x3342('0x16')][_0x3342('0x17')](_0x2075cb['body'],{'raw':_0x2075cb[_0x3342('0x18')]?_0x2075cb[_0x3342('0x18')][_0x3342('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x3cb86f){logger[_0x3342('0x13')]('CreateCmHopperHistory',_0x2075cb);logger[_0x3342('0x1a')](_0x3342('0x15'),_0x2075cb,JSON['stringify'](_0x3cb86f));_0x156c24(_0x3cb86f);})[_0x3342('0x1b')](function(_0x5a0658){logger[_0x3342('0x10')](_0x3342('0x15'),_0x5a0658[_0x3342('0x12')],_0x2075cb);_0x45a3ca(_0x12947a[_0x3342('0x10')](0x1f4,_0x5a0658[_0x3342('0x12')]));});});};exports[_0x3342('0x1c')]=function(_0x26eb87){var _0x2d8622=this;return new Promise(function(_0x5d4f14,_0x30ffc9){return db['CmHopperHistory']['findAll']({'raw':_0x26eb87[_0x3342('0x18')]?_0x26eb87['options']['raw']===undefined?!![]:![]:!![],'where':_0x26eb87[_0x3342('0x18')]?_0x26eb87['options'][_0x3342('0x1d')]||null:null,'attributes':[[db['sequelize']['fn']('COUNT',db['sequelize'][_0x3342('0x1e')]('id')),_0x3342('0x1f')],[db[_0x3342('0x20')]['fn']('COUNT',db[_0x3342('0x20')]['fn']('IF',db[_0x3342('0x20')][_0x3342('0x21')](_0x3342('0x22')))),'predictiveIntervalAnsweredCalls'],[db[_0x3342('0x20')]['fn'](_0x3342('0x23'),db[_0x3342('0x20')]['fn']('IF',db[_0x3342('0x20')][_0x3342('0x21')](_0x3342('0x24')))),_0x3342('0x25')],[db['sequelize']['fn'](_0x3342('0x23'),db['sequelize']['fn']('IF',db[_0x3342('0x20')][_0x3342('0x21')]('`state`\x20=\x2011,\x201,\x20null'))),_0x3342('0x26')],[db[_0x3342('0x20')]['fn'](_0x3342('0x27'),db[_0x3342('0x20')]['fn']('IF',db['sequelize'][_0x3342('0x21')](_0x3342('0x28')))),_0x3342('0x29')],[db[_0x3342('0x20')]['fn'](_0x3342('0x27'),db[_0x3342('0x20')]['fn']('IF',db[_0x3342('0x20')][_0x3342('0x21')](_0x3342('0x2a')))),_0x3342('0x2b')]]})[_0x3342('0xd')](function(_0x30dcea){logger['info']('AvgHandleTime',_0x26eb87);logger[_0x3342('0x1a')]('AvgHandleTime',_0x26eb87,JSON[_0x3342('0xf')](_0x30dcea));_0x5d4f14(_0x30dcea);})[_0x3342('0x1b')](function(_0x1a74d3){logger[_0x3342('0x10')](_0x3342('0x1c'),_0x1a74d3[_0x3342('0x12')],_0x26eb87);_0x30ffc9(_0x2d8622[_0x3342('0x10')](0x1f4,_0x1a74d3['message']));});});};exports[_0x3342('0x2c')]=function(_0x2db4ac){var _0x23dbe8=this;return new Promise(function(_0x155493,_0x32f644){return db['CmHopperHistory'][_0x3342('0x2d')]({'raw':_0x2db4ac['options']?_0x2db4ac[_0x3342('0x18')][_0x3342('0x19')]===undefined?!![]:![]:!![],'where':_0x2db4ac[_0x3342('0x18')]?_0x2db4ac[_0x3342('0x18')]['where']||null:null,'attributes':[[_0x3342('0x2e'),'name'],[db[_0x3342('0x20')]['fn'](_0x3342('0x23'),db[_0x3342('0x20')]['fn']('IF',db[_0x3342('0x20')][_0x3342('0x21')](_0x3342('0x2f')))),_0x3342('0x30')],[db['sequelize']['fn'](_0x3342('0x23'),db[_0x3342('0x20')]['fn']('IF',db['sequelize'][_0x3342('0x21')](_0x3342('0x31')))),'outboundNoAnswerCallsDay'],[db[_0x3342('0x20')]['fn'](_0x3342('0x23'),db['sequelize']['fn']('IF',db['sequelize']['literal'](_0x3342('0x22')))),_0x3342('0x32')],[db['sequelize']['fn'](_0x3342('0x23'),db[_0x3342('0x20')]['fn']('IF',db[_0x3342('0x20')][_0x3342('0x21')](_0x3342('0x33')))),_0x3342('0x34')],[db[_0x3342('0x20')]['fn'](_0x3342('0x23'),db['sequelize']['fn']('IF',db['sequelize'][_0x3342('0x21')](_0x3342('0x35')))),_0x3342('0x36')],[db[_0x3342('0x20')]['fn'](_0x3342('0x23'),db[_0x3342('0x20')]['fn']('IF',db['sequelize'][_0x3342('0x21')](_0x3342('0x37')))),_0x3342('0x38')],[db[_0x3342('0x20')]['fn'](_0x3342('0x23'),db[_0x3342('0x20')]['fn']('IF',db['sequelize'][_0x3342('0x21')]('`state`\x20=\x2011\x20,\x201,\x20null'))),_0x3342('0x39')],[db[_0x3342('0x20')]['fn'](_0x3342('0x23'),db[_0x3342('0x20')]['fn']('IF',db['sequelize'][_0x3342('0x21')](_0x3342('0x3a')))),'outboundUnknownCallsDay'],[db[_0x3342('0x20')]['fn'](_0x3342('0x23'),db[_0x3342('0x20')]['fn']('IF',db[_0x3342('0x20')]['literal'](_0x3342('0x3b')))),_0x3342('0x3c')],[db['sequelize']['fn'](_0x3342('0x23'),db['sequelize']['fn']('IF',db['sequelize'][_0x3342('0x21')](_0x3342('0x3d')))),_0x3342('0x3e')],[db[_0x3342('0x20')]['fn'](_0x3342('0x23'),db[_0x3342('0x20')]['fn']('IF',db[_0x3342('0x20')]['literal']('`state`\x20=\x2018,\x201,\x20null'))),_0x3342('0x3f')],[db['sequelize']['fn'](_0x3342('0x23'),db['sequelize']['fn']('IF',db['sequelize']['literal'](_0x3342('0x40')))),_0x3342('0x41')],[db[_0x3342('0x20')]['fn'](_0x3342('0x23'),db['sequelize']['fn']('IF',db[_0x3342('0x20')][_0x3342('0x21')]('`state`\x20=\x2020,\x201,\x20null'))),_0x3342('0x3f')],[db[_0x3342('0x20')]['fn'](_0x3342('0x23'),db['sequelize']['fn']('IF',db[_0x3342('0x20')][_0x3342('0x21')](_0x3342('0x42')))),_0x3342('0x43')]],'group':[_0x3342('0x2e')]})['then'](function(_0x2699d2){logger[_0x3342('0x13')](_0x3342('0x2c'),_0x2db4ac);logger[_0x3342('0x1a')](_0x3342('0x2c'),_0x2db4ac,JSON[_0x3342('0xf')](_0x2699d2));_0x155493(_0x2699d2);})[_0x3342('0x1b')](function(_0x47cf76){logger[_0x3342('0x10')]('GetVoiceQueueHopperHistory',_0x47cf76[_0x3342('0x12')],_0x2db4ac);_0x32f644(_0x23dbe8['error'](0x1f4,_0x47cf76[_0x3342('0x12')]));});});};exports['GetCampaignHopperHistory']=function(_0x49e3c6){var _0x5bff74=this;return new Promise(function(_0x47b9b2,_0x204e35){return db[_0x3342('0x16')][_0x3342('0x2d')]({'raw':_0x49e3c6[_0x3342('0x18')]?_0x49e3c6[_0x3342('0x18')][_0x3342('0x19')]===undefined?!![]:![]:!![],'where':_0x49e3c6[_0x3342('0x18')]?_0x49e3c6[_0x3342('0x18')][_0x3342('0x1d')]||null:null,'attributes':[[_0x3342('0x2e'),_0x3342('0x44')],[db['sequelize']['fn']('COUNT',db[_0x3342('0x20')]['col']('id')),_0x3342('0x45')],[db['sequelize']['fn']('COUNT',db[_0x3342('0x20')]['fn']('IF',db[_0x3342('0x20')][_0x3342('0x21')]('`state`\x20=\x204,\x201,\x20null'))),'ivrAnswerCallsDay']],'group':[_0x3342('0x2e')]})[_0x3342('0xd')](function(_0x5e9161){logger[_0x3342('0x13')](_0x3342('0x46'),_0x49e3c6);logger[_0x3342('0x1a')]('GetCampaignHopperHistory',_0x49e3c6,JSON[_0x3342('0xf')](_0x5e9161));_0x47b9b2(_0x5e9161);})[_0x3342('0x1b')](function(_0x3dd926){logger[_0x3342('0x10')](_0x3342('0x46'),_0x3dd926[_0x3342('0x12')],_0x49e3c6);_0x204e35(_0x5bff74[_0x3342('0x10')](0x1f4,_0x3dd926['message']));});});};
\ No newline at end of file
+var _0x7916=['body','options','raw','sequelize','COUNT','col','`state`\x20=\x204,\x201,\x20null','predictiveIntervalAnsweredCalls','literal','`state`\x20=\x2011,\x201,\x20null','predictiveIntervalDroppedCallsCallersExit','AVG','predictiveIntervalAvgHoldtime','AvgHandleTime','campaign','name','outboundNoSuchCallsDay','`state`\x20=\x203,\x201,\x20null','outboundNoAnswerCallsDay','`state`\x20=\x205,\x201,\x20null','outboundBusyCallsDay','`state`\x20=\x208,\x201,\x20null','`state`\x20=\x2010\x20,\x201,\x20null','outboundDropCallsDayTimeout','`state`\x20=\x2011\x20,\x201,\x20null','`state`\x20=\x2012,\x201,\x20null','outboundUnknownCallsDay','`state`\x20=\x2013,\x201,\x20null','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','`state`\x20=\x2018,\x201,\x20null','outboundAnswerAgiCallsDay','`state`\x20=\x2020,\x201,\x20null','outboundRejectCallsDay','`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null','outboundReCallsDay','GetVoiceQueueHopperHistory','GetCampaignHopperHistory','findAll','ivrAnswerCallsDay','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','then','CmHopperHistory,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','catch','CreateCmHopperHistory','CmHopperHistory','create'];(function(_0x2b9b7f,_0x4d47df){var _0x4ed19a=function(_0x72b5ff){while(--_0x72b5ff){_0x2b9b7f['push'](_0x2b9b7f['shift']());}};_0x4ed19a(++_0x4d47df);}(_0x7916,0x128));var _0x6791=function(_0x40e1ed,_0x297e89){_0x40e1ed=_0x40e1ed-0x0;var _0x220ddd=_0x7916[_0x40e1ed];return _0x220ddd;};'use strict';var _=require(_0x6791('0x0'));var util=require('util');var moment=require(_0x6791('0x1'));var BPromise=require(_0x6791('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6791('0x3'));var db=require(_0x6791('0x4'))['db'];var utils=require(_0x6791('0x5'));var logger=require(_0x6791('0x6'))('rpc');var config=require(_0x6791('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x6791('0x8')][_0x6791('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5ad8c0,_0x8b85ff,_0x5d2118){return new BPromise(function(_0x2b240c,_0x50c563){return client['request'](_0x5ad8c0,_0x5d2118)[_0x6791('0xa')](function(_0x198a64){logger['info'](_0x6791('0xb'),_0x8b85ff,_0x6791('0xc'));logger[_0x6791('0xd')]('CmHopperHistory,\x20%s,\x20%s,\x20%s',_0x8b85ff,_0x6791('0xc'),JSON[_0x6791('0xe')](_0x198a64));if(_0x198a64[_0x6791('0xf')]){if(_0x198a64[_0x6791('0xf')][_0x6791('0x10')]===0x1f4){logger[_0x6791('0xf')](_0x6791('0xb'),_0x8b85ff,_0x198a64[_0x6791('0xf')][_0x6791('0x11')]);return _0x50c563(_0x198a64[_0x6791('0xf')][_0x6791('0x11')]);}logger['error']('CmHopperHistory,\x20%s,\x20%s',_0x8b85ff,_0x198a64[_0x6791('0xf')]['message']);return _0x2b240c(_0x198a64[_0x6791('0xf')]['message']);}else{logger[_0x6791('0x12')](_0x6791('0xb'),_0x8b85ff,'request\x20sent');_0x2b240c(_0x198a64[_0x6791('0x13')]['message']);}})[_0x6791('0x14')](function(_0x150d1f){logger['error'](_0x6791('0xb'),_0x8b85ff,_0x150d1f);_0x50c563(_0x150d1f);});});}exports[_0x6791('0x15')]=function(_0x5bec14){var _0x1872f5=this;return new Promise(function(_0x4d8a79,_0xe55dba){return db[_0x6791('0x16')][_0x6791('0x17')](_0x5bec14[_0x6791('0x18')],{'raw':_0x5bec14[_0x6791('0x19')]?_0x5bec14[_0x6791('0x19')][_0x6791('0x1a')]===undefined?!![]:![]:!![]})['then'](function(_0x4a2922){logger[_0x6791('0x12')]('CreateCmHopperHistory',_0x5bec14);logger[_0x6791('0xd')](_0x6791('0x15'),_0x5bec14,JSON['stringify'](_0x4a2922));_0x4d8a79(_0x4a2922);})[_0x6791('0x14')](function(_0x309610){logger[_0x6791('0xf')](_0x6791('0x15'),_0x309610['message'],_0x5bec14);_0xe55dba(_0x1872f5[_0x6791('0xf')](0x1f4,_0x309610[_0x6791('0x11')]));});});};exports['AvgHandleTime']=function(_0x53bb44){var _0x4b23bc=this;return new Promise(function(_0x372dae,_0x502043){return db[_0x6791('0x16')]['findAll']({'raw':_0x53bb44['options']?_0x53bb44['options'][_0x6791('0x1a')]===undefined?!![]:![]:!![],'where':_0x53bb44[_0x6791('0x19')]?_0x53bb44[_0x6791('0x19')]['where']||null:null,'attributes':[[db[_0x6791('0x1b')]['fn'](_0x6791('0x1c'),db['sequelize'][_0x6791('0x1d')]('id')),'predictiveIntervalTotalCalls'],[db[_0x6791('0x1b')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x6791('0x1b')]['literal'](_0x6791('0x1e')))),_0x6791('0x1f')],[db['sequelize']['fn'](_0x6791('0x1c'),db[_0x6791('0x1b')]['fn']('IF',db[_0x6791('0x1b')][_0x6791('0x20')]('`state`\x20=\x2010,\x201,\x20null'))),'predictiveIntervalDroppedCallsTimeout'],[db[_0x6791('0x1b')]['fn']('COUNT',db[_0x6791('0x1b')]['fn']('IF',db[_0x6791('0x1b')][_0x6791('0x20')](_0x6791('0x21')))),_0x6791('0x22')],[db[_0x6791('0x1b')]['fn'](_0x6791('0x23'),db[_0x6791('0x1b')]['fn']('IF',db[_0x6791('0x1b')][_0x6791('0x20')]('`state`\x20=\x204,\x20`holdtime`,\x20null'))),_0x6791('0x24')],[db[_0x6791('0x1b')]['fn'](_0x6791('0x23'),db[_0x6791('0x1b')]['fn']('IF',db[_0x6791('0x1b')][_0x6791('0x20')]('`state`\x20=\x204,\x20`talktime`,\x20null'))),'predictiveIntervalAvgTalktime']]})['then'](function(_0x1de770){logger[_0x6791('0x12')](_0x6791('0x25'),_0x53bb44);logger['debug']('AvgHandleTime',_0x53bb44,JSON[_0x6791('0xe')](_0x1de770));_0x372dae(_0x1de770);})[_0x6791('0x14')](function(_0x31a525){logger[_0x6791('0xf')]('AvgHandleTime',_0x31a525[_0x6791('0x11')],_0x53bb44);_0x502043(_0x4b23bc[_0x6791('0xf')](0x1f4,_0x31a525[_0x6791('0x11')]));});});};exports['GetVoiceQueueHopperHistory']=function(_0x31217d){var _0x567e36=this;return new Promise(function(_0x4ee010,_0x256c02){return db[_0x6791('0x16')]['findAll']({'raw':_0x31217d[_0x6791('0x19')]?_0x31217d[_0x6791('0x19')][_0x6791('0x1a')]===undefined?!![]:![]:!![],'where':_0x31217d[_0x6791('0x19')]?_0x31217d[_0x6791('0x19')]['where']||null:null,'attributes':[[_0x6791('0x26'),_0x6791('0x27')],[db[_0x6791('0x1b')]['fn']('COUNT',db[_0x6791('0x1b')]['fn']('IF',db[_0x6791('0x1b')][_0x6791('0x20')]('`state`\x20=\x200,\x201,\x20null'))),_0x6791('0x28')],[db[_0x6791('0x1b')]['fn'](_0x6791('0x1c'),db[_0x6791('0x1b')]['fn']('IF',db['sequelize'][_0x6791('0x20')](_0x6791('0x29')))),_0x6791('0x2a')],[db[_0x6791('0x1b')]['fn'](_0x6791('0x1c'),db[_0x6791('0x1b')]['fn']('IF',db[_0x6791('0x1b')][_0x6791('0x20')](_0x6791('0x1e')))),'outboundAnswerCallsDay'],[db['sequelize']['fn'](_0x6791('0x1c'),db[_0x6791('0x1b')]['fn']('IF',db['sequelize'][_0x6791('0x20')](_0x6791('0x2b')))),_0x6791('0x2c')],[db[_0x6791('0x1b')]['fn'](_0x6791('0x1c'),db[_0x6791('0x1b')]['fn']('IF',db[_0x6791('0x1b')]['literal'](_0x6791('0x2d')))),'outboundCongestionCallsDay'],[db[_0x6791('0x1b')]['fn'](_0x6791('0x1c'),db[_0x6791('0x1b')]['fn']('IF',db[_0x6791('0x1b')]['literal'](_0x6791('0x2e')))),_0x6791('0x2f')],[db[_0x6791('0x1b')]['fn'](_0x6791('0x1c'),db[_0x6791('0x1b')]['fn']('IF',db[_0x6791('0x1b')][_0x6791('0x20')](_0x6791('0x30')))),'outboundDropCallsDayCallersExit'],[db[_0x6791('0x1b')]['fn'](_0x6791('0x1c'),db[_0x6791('0x1b')]['fn']('IF',db[_0x6791('0x1b')]['literal'](_0x6791('0x31')))),_0x6791('0x32')],[db['sequelize']['fn'](_0x6791('0x1c'),db['sequelize']['fn']('IF',db[_0x6791('0x1b')][_0x6791('0x20')](_0x6791('0x33')))),_0x6791('0x34')],[db[_0x6791('0x1b')]['fn'](_0x6791('0x1c'),db[_0x6791('0x1b')]['fn']('IF',db[_0x6791('0x1b')][_0x6791('0x20')]('`state`\x20=\x2014,\x201,\x20null'))),_0x6791('0x35')],[db['sequelize']['fn'](_0x6791('0x1c'),db[_0x6791('0x1b')]['fn']('IF',db[_0x6791('0x1b')][_0x6791('0x20')](_0x6791('0x36')))),'outboundRejectCallsDay'],[db[_0x6791('0x1b')]['fn'](_0x6791('0x1c'),db[_0x6791('0x1b')]['fn']('IF',db[_0x6791('0x1b')][_0x6791('0x20')]('`state`\x20=\x2016,\x201,\x20null'))),_0x6791('0x37')],[db[_0x6791('0x1b')]['fn']('COUNT',db[_0x6791('0x1b')]['fn']('IF',db['sequelize'][_0x6791('0x20')](_0x6791('0x38')))),_0x6791('0x39')],[db[_0x6791('0x1b')]['fn']('COUNT',db[_0x6791('0x1b')]['fn']('IF',db[_0x6791('0x1b')]['literal'](_0x6791('0x3a')))),_0x6791('0x3b')]],'group':[_0x6791('0x26')]})['then'](function(_0x355e97){logger[_0x6791('0x12')]('GetVoiceQueueHopperHistory',_0x31217d);logger[_0x6791('0xd')](_0x6791('0x3c'),_0x31217d,JSON['stringify'](_0x355e97));_0x4ee010(_0x355e97);})[_0x6791('0x14')](function(_0x216498){logger[_0x6791('0xf')](_0x6791('0x3c'),_0x216498['message'],_0x31217d);_0x256c02(_0x567e36[_0x6791('0xf')](0x1f4,_0x216498[_0x6791('0x11')]));});});};exports[_0x6791('0x3d')]=function(_0x5b534b){var _0x5a7a88=this;return new Promise(function(_0x1d6bec,_0x6b8acd){return db[_0x6791('0x16')][_0x6791('0x3e')]({'raw':_0x5b534b[_0x6791('0x19')]?_0x5b534b['options']['raw']===undefined?!![]:![]:!![],'where':_0x5b534b[_0x6791('0x19')]?_0x5b534b['options']['where']||null:null,'attributes':[[_0x6791('0x26'),_0x6791('0x27')],[db[_0x6791('0x1b')]['fn'](_0x6791('0x1c'),db[_0x6791('0x1b')][_0x6791('0x1d')]('id')),'ivrTotalCallsDays'],[db['sequelize']['fn'](_0x6791('0x1c'),db[_0x6791('0x1b')]['fn']('IF',db['sequelize'][_0x6791('0x20')]('`state`\x20=\x204,\x201,\x20null'))),_0x6791('0x3f')]],'group':[_0x6791('0x26')]})['then'](function(_0x1ebfb6){logger[_0x6791('0x12')](_0x6791('0x3d'),_0x5b534b);logger['debug'](_0x6791('0x3d'),_0x5b534b,JSON[_0x6791('0xe')](_0x1ebfb6));_0x1d6bec(_0x1ebfb6);})[_0x6791('0x14')](function(_0x383853){logger[_0x6791('0xf')]('GetCampaignHopperHistory',_0x383853['message'],_0x5b534b);_0x6b8acd(_0x5a7a88[_0x6791('0xf')](0x1f4,_0x383853[_0x6791('0x11')]));});});};
\ No newline at end of file
diff --git a/server/api/cmHopperHistory/index.js b/server/api/cmHopperHistory/index.js
index 1cb5a6c..56c2bb0 100644
--- a/server/api/cmHopperHistory/index.js
+++ b/server/api/cmHopperHistory/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x758f=['../../components/interaction/service','../../config/environment','get','index','/describe','isAuthenticated','describe','show','post','create','put','/:id','update','util','path','express','Router','../../components/auth/service'];(function(_0x4d1be0,_0x135738){var _0x47d662=function(_0xdd044e){while(--_0xdd044e){_0x4d1be0['push'](_0x4d1be0['shift']());}};_0x47d662(++_0x135738);}(_0x758f,0x187));var _0xf758=function(_0x34ef08,_0x3490fc){_0x34ef08=_0x34ef08-0x0;var _0x161a4f=_0x758f[_0x34ef08];return _0x161a4f;};'use strict';var multer=require('multer');var util=require(_0xf758('0x0'));var path=require(_0xf758('0x1'));var timeout=require('connect-timeout');var express=require(_0xf758('0x2'));var router=express[_0xf758('0x3')]();var auth=require(_0xf758('0x4'));var interaction=require(_0xf758('0x5'));var config=require(_0xf758('0x6'));var controller=require('./cmHopperHistory.controller');router[_0xf758('0x7')]('/',auth['isAuthenticated'](),controller[_0xf758('0x8')]);router[_0xf758('0x7')](_0xf758('0x9'),auth[_0xf758('0xa')](),controller[_0xf758('0xb')]);router['get']('/:id',auth[_0xf758('0xa')](),controller[_0xf758('0xc')]);router[_0xf758('0xd')]('/',auth[_0xf758('0xa')](),controller[_0xf758('0xe')]);router[_0xf758('0xf')](_0xf758('0x10'),auth[_0xf758('0xa')](),controller[_0xf758('0x11')]);module['exports']=router;
\ No newline at end of file
+var _0x0ea2=['post','update','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperHistory.controller','get','isAuthenticated','index','/describe','/:id','show'];(function(_0x269274,_0x44efa7){var _0x36ec0e=function(_0xe340b4){while(--_0xe340b4){_0x269274['push'](_0x269274['shift']());}};_0x36ec0e(++_0x44efa7);}(_0x0ea2,0x189));var _0x20ea=function(_0x381476,_0x1c520f){_0x381476=_0x381476-0x0;var _0x5b20fb=_0x0ea2[_0x381476];return _0x5b20fb;};'use strict';var multer=require(_0x20ea('0x0'));var util=require(_0x20ea('0x1'));var path=require(_0x20ea('0x2'));var timeout=require(_0x20ea('0x3'));var express=require('express');var router=express[_0x20ea('0x4')]();var auth=require(_0x20ea('0x5'));var interaction=require(_0x20ea('0x6'));var config=require(_0x20ea('0x7'));var controller=require(_0x20ea('0x8'));router[_0x20ea('0x9')]('/',auth[_0x20ea('0xa')](),controller[_0x20ea('0xb')]);router['get'](_0x20ea('0xc'),auth[_0x20ea('0xa')](),controller['describe']);router[_0x20ea('0x9')](_0x20ea('0xd'),auth['isAuthenticated'](),controller[_0x20ea('0xe')]);router[_0x20ea('0xf')]('/',auth[_0x20ea('0xa')](),controller['create']);router['put'](_0x20ea('0xd'),auth[_0x20ea('0xa')](),controller[_0x20ea('0x10')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/cmList/cmList.attributes.js b/server/api/cmList/cmList.attributes.js
index 2704776..d25e07f 100644
--- a/server/api/cmList/cmList.attributes.js
+++ b/server/api/cmList/cmList.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xa6b2=['sequelize','STRING','name'];(function(_0x21972b,_0x366de9){var _0x43d5c5=function(_0x1cc8c9){while(--_0x1cc8c9){_0x21972b['push'](_0x21972b['shift']());}};_0x43d5c5(++_0x366de9);}(_0xa6b2,0xd8));var _0x2a6b=function(_0x48086f,_0x49a91f){_0x48086f=_0x48086f-0x0;var _0x39fc12=_0xa6b2[_0x48086f];return _0x39fc12;};'use strict';var Sequelize=require(_0x2a6b('0x0'));module['exports']={'name':{'type':Sequelize[_0x2a6b('0x1')],'unique':_0x2a6b('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x2a6b('0x1')]},'dialPrefix':{'type':Sequelize[_0x2a6b('0x1')]}};
\ No newline at end of file
+var _0x54d4=['sequelize','exports','STRING'];(function(_0x37ae2f,_0x36a07b){var _0x2f0b3d=function(_0x81c6bc){while(--_0x81c6bc){_0x37ae2f['push'](_0x37ae2f['shift']());}};_0x2f0b3d(++_0x36a07b);}(_0x54d4,0xff));var _0x454d=function(_0x121619,_0x293a7a){_0x121619=_0x121619-0x0;var _0x37ba1f=_0x54d4[_0x121619];return _0x37ba1f;};'use strict';var Sequelize=require(_0x454d('0x0'));module[_0x454d('0x1')]={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']},'dialPrefix':{'type':Sequelize[_0x454d('0x2')]}};
\ No newline at end of file
diff --git a/server/api/cmList/cmList.controller.js b/server/api/cmList/cmList.controller.js
index 4a0446c..4f3e2f3 100644
--- a/server/api/cmList/cmList.controller.js
+++ b/server/api/cmList/cmList.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xa6d2=['spread','emit','userCmList:remove','getAgents','User','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','redis','socket.io-emitter','./cmList.socket','register','sendStatus','end','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','UserProfileResource','status','error','stack','name','send','index','map','CmList','rawAttributes','fieldName','type','key','query','model','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','keys','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Lists','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','describe','ListId','Disposition','findOne','filter','removeDispositions','ids','addContacts','CmContact','tags','join','push','omit','success','dataValues','errors','message','json','Malformed\x20request\x20syntax','getContacts','CmCustomField','CustomFields','concat','format','cf_%d','getContactsCsv','raw','isEmpty','now','writeFileSync','attachment;\x20filename=','list_%d_%s.csv','setHeader','Content-type','download','addCustomField','sequelize','transaction','addCustomFields','Sequelize','TEXT','text','switch','BOOLEAN','defaultValue','queryInterface','cf_%s','getCustomFields','findAndCountAll','addAgents'];(function(_0x4c8700,_0x25e672){var _0x16dcaa=function(_0x18c324){while(--_0x18c324){_0x4c8700['push'](_0x4c8700['shift']());}};_0x16dcaa(++_0x25e672);}(_0xa6d2,0x1b2));var _0x2a6d=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xa6d2[_0x20a584];return _0x4b41a8;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x2a6d('0x0'));var rimraf=require(_0x2a6d('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x2a6d('0x2'));var rp=require('request-promise');var moment=require(_0x2a6d('0x3'));var BPromise=require(_0x2a6d('0x4'));var Mustache=require(_0x2a6d('0x5'));var util=require(_0x2a6d('0x6'));var path=require(_0x2a6d('0x7'));var sox=require(_0x2a6d('0x8'));var csv=require('to-csv');var ejs=require(_0x2a6d('0x9'));var fs=require('fs');var _=require(_0x2a6d('0xa'));var squel=require(_0x2a6d('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x2a6d('0xc'));var toCsv=require(_0x2a6d('0xd'));var querystring=require('querystring');var Papa=require(_0x2a6d('0xe'));var Redis=require(_0x2a6d('0xf'));var authService=require(_0x2a6d('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x2a6d('0x11'));var logger=require('../../config/logger')(_0x2a6d('0x12'));var utils=require(_0x2a6d('0x13'));var config=require(_0x2a6d('0x14'));var db=require(_0x2a6d('0x15'))['db'];config[_0x2a6d('0x16')]=_['defaults'](config[_0x2a6d('0x16')],{'host':'localhost','port':0x18eb});var socket=require(_0x2a6d('0x17'))(new Redis(config[_0x2a6d('0x16')]));require(_0x2a6d('0x18'))[_0x2a6d('0x19')](socket);function respondWithStatusCode(_0x24029c,_0x4c2c4f){_0x4c2c4f=_0x4c2c4f||0xcc;return function(_0x417728){if(_0x417728){return _0x24029c[_0x2a6d('0x1a')](_0x4c2c4f);}return _0x24029c['status'](_0x4c2c4f)[_0x2a6d('0x1b')]();};}function respondWithResult(_0x19bcff,_0x249d48){_0x249d48=_0x249d48||0xc8;return function(_0x4275e3){if(_0x4275e3){return _0x19bcff['status'](_0x249d48)['json'](_0x4275e3);}};}function respondWithFilteredResult(_0x4803f4,_0x2c6cd8){return function(_0x100658){if(_0x100658){var _0x3f6b6e=_0x100658[_0x2a6d('0x1c')],_0x5c9f7b=_0x2c6cd8['offset'],_0x467a47=_0x2c6cd8[_0x2a6d('0x1d')]+_0x2c6cd8[_0x2a6d('0x1e')],_0x5d5ef0;if(_0x467a47>=_0x3f6b6e){_0x467a47=_0x3f6b6e;_0x5d5ef0=0xc8;}else{_0x5d5ef0=0xce;}_0x4803f4['status'](_0x5d5ef0);return _0x4803f4[_0x2a6d('0x1f')](_0x2a6d('0x20'),_0x5c9f7b+'-'+_0x467a47+'/'+_0x3f6b6e)['json'](_0x100658);}return null;};}function patchUpdates(_0x4da976){return function(_0x1b1389){try{jsonpatch[_0x2a6d('0x21')](_0x1b1389,_0x4da976,!![]);}catch(_0x3851f5){return BPromise[_0x2a6d('0x22')](_0x3851f5);}return _0x1b1389[_0x2a6d('0x23')]();};}function saveUpdates(_0x2ef7da,_0x5d65da){return function(_0x1a3d95){if(_0x1a3d95){return _0x1a3d95[_0x2a6d('0x24')](_0x2ef7da)[_0x2a6d('0x25')](function(_0x195b95){return _0x195b95;});}return null;};}function removeEntity(_0x4f6fc5,_0x1d7ea4){return function(_0x533c76){if(_0x533c76){return _0x533c76[_0x2a6d('0x26')]()[_0x2a6d('0x25')](function(){var _0x456c36=_0x533c76['get']({'plain':!![]});var _0x3896ce='Lists';return db[_0x2a6d('0x27')][_0x2a6d('0x26')]({'where':{'type':_0x3896ce,'resourceId':_0x456c36['id']}})[_0x2a6d('0x25')](function(){return _0x533c76;});})[_0x2a6d('0x25')](function(){_0x4f6fc5[_0x2a6d('0x28')](0xcc)[_0x2a6d('0x1b')]();});}};}function handleEntityNotFound(_0x5b4cce,_0x10bb77){return function(_0x4093c8){if(!_0x4093c8){_0x5b4cce['sendStatus'](0x194);}return _0x4093c8;};}function handleError(_0x4520ea,_0x98fdd5){_0x98fdd5=_0x98fdd5||0x1f4;return function(_0x2ba712){logger[_0x2a6d('0x29')](_0x2ba712[_0x2a6d('0x2a')]);if(_0x2ba712[_0x2a6d('0x2b')]){delete _0x2ba712[_0x2a6d('0x2b')];}_0x4520ea[_0x2a6d('0x28')](_0x98fdd5)[_0x2a6d('0x2c')](_0x2ba712);};}exports[_0x2a6d('0x2d')]=function(_0x25a2fd,_0x4201d1){var _0x540512={},_0x54673d={},_0x357543={'count':0x0,'rows':[]};var _0x15467c=_[_0x2a6d('0x2e')](db[_0x2a6d('0x2f')][_0x2a6d('0x30')],function(_0x133a1e){return{'name':_0x133a1e[_0x2a6d('0x31')],'type':_0x133a1e[_0x2a6d('0x32')][_0x2a6d('0x33')]};});_0x54673d['model']=_[_0x2a6d('0x2e')](_0x15467c,_0x2a6d('0x2b'));_0x54673d[_0x2a6d('0x34')]=_['keys'](_0x25a2fd[_0x2a6d('0x34')]);_0x54673d['filters']=_['intersection'](_0x54673d[_0x2a6d('0x35')],_0x54673d[_0x2a6d('0x34')]);_0x540512['attributes']=_[_0x2a6d('0x36')](_0x54673d['model'],qs[_0x2a6d('0x37')](_0x25a2fd[_0x2a6d('0x34')][_0x2a6d('0x37')]));_0x540512[_0x2a6d('0x38')]=_0x540512[_0x2a6d('0x38')][_0x2a6d('0x39')]?_0x540512[_0x2a6d('0x38')]:_0x54673d['model'];if(!_0x25a2fd[_0x2a6d('0x34')][_0x2a6d('0x3a')](_0x2a6d('0x3b'))){_0x540512[_0x2a6d('0x1e')]=qs[_0x2a6d('0x1e')](_0x25a2fd[_0x2a6d('0x34')]['limit']);_0x540512[_0x2a6d('0x1d')]=qs[_0x2a6d('0x1d')](_0x25a2fd['query'][_0x2a6d('0x1d')]);}_0x540512[_0x2a6d('0x3c')]=qs['sort'](_0x25a2fd[_0x2a6d('0x34')][_0x2a6d('0x3d')]);_0x540512[_0x2a6d('0x3e')]=qs[_0x2a6d('0x3f')](_[_0x2a6d('0x40')](_0x25a2fd[_0x2a6d('0x34')],_0x54673d['filters']),_0x15467c);if(_0x25a2fd[_0x2a6d('0x34')]['filter']){_0x540512[_0x2a6d('0x3e')]=_['merge'](_0x540512[_0x2a6d('0x3e')],{'$or':_[_0x2a6d('0x2e')](_0x15467c,function(_0x85e46b){if(_0x85e46b[_0x2a6d('0x32')]!==_0x2a6d('0x41')){var _0x3ce412={};_0x3ce412[_0x85e46b[_0x2a6d('0x2b')]]={'$like':'%'+_0x25a2fd[_0x2a6d('0x34')]['filter']+'%'};return _0x3ce412;}})});}_0x540512=_[_0x2a6d('0x42')]({},_0x540512,_0x25a2fd[_0x2a6d('0x43')]);var _0x340e97={'where':_0x540512['where']};return db[_0x2a6d('0x2f')]['count'](_0x340e97)[_0x2a6d('0x25')](function(_0x17428e){_0x357543[_0x2a6d('0x1c')]=_0x17428e;if(_0x25a2fd['query'][_0x2a6d('0x44')]){_0x540512[_0x2a6d('0x45')]=[{'all':!![]}];}return db['CmList'][_0x2a6d('0x46')](_0x540512);})[_0x2a6d('0x25')](function(_0x1d65ad){_0x357543[_0x2a6d('0x47')]=_0x1d65ad;return _0x357543;})[_0x2a6d('0x25')](respondWithFilteredResult(_0x4201d1,_0x540512))[_0x2a6d('0x48')](handleError(_0x4201d1,null));};exports[_0x2a6d('0x49')]=function(_0x178b02,_0x273a9c){var _0x4f5542={'raw':![],'where':{'id':_0x178b02['params']['id']}},_0xb67652={};_0xb67652['model']=_[_0x2a6d('0x4a')](db[_0x2a6d('0x2f')]['rawAttributes']);_0xb67652[_0x2a6d('0x34')]=_[_0x2a6d('0x4a')](_0x178b02['query']);_0xb67652['filters']=_[_0x2a6d('0x36')](_0xb67652['model'],_0xb67652['query']);_0x4f5542[_0x2a6d('0x38')]=_[_0x2a6d('0x36')](_0xb67652[_0x2a6d('0x35')],qs[_0x2a6d('0x37')](_0x178b02[_0x2a6d('0x34')][_0x2a6d('0x37')]));_0x4f5542[_0x2a6d('0x38')]=_0x4f5542[_0x2a6d('0x38')][_0x2a6d('0x39')]?_0x4f5542[_0x2a6d('0x38')]:_0xb67652[_0x2a6d('0x35')];if(_0x178b02[_0x2a6d('0x34')][_0x2a6d('0x44')]){_0x4f5542[_0x2a6d('0x45')]=[{'all':!![]}];}_0x4f5542=_[_0x2a6d('0x42')]({},_0x4f5542,_0x178b02[_0x2a6d('0x43')]);return db[_0x2a6d('0x2f')]['find'](_0x4f5542)[_0x2a6d('0x25')](handleEntityNotFound(_0x273a9c,null))['then'](respondWithResult(_0x273a9c,null))['catch'](handleError(_0x273a9c,null));};exports['create']=function(_0x218eff,_0x2a09e0){return db[_0x2a6d('0x2f')][_0x2a6d('0x4b')](_0x218eff['body'],{})[_0x2a6d('0x25')](function(_0x451196){var _0x2298db=_0x218eff[_0x2a6d('0x4c')][_0x2a6d('0x4d')]({'plain':!![]});if(!_0x2298db)throw new Error(_0x2a6d('0x4e'));if(_0x2298db[_0x2a6d('0x4f')]===_0x2a6d('0x4c')){var _0x2c7ba3=_0x451196[_0x2a6d('0x4d')]({'plain':!![]});var _0x3d95d0=_0x2a6d('0x50');return db[_0x2a6d('0x51')][_0x2a6d('0x52')]({'where':{'name':_0x3d95d0,'userProfileId':_0x2298db[_0x2a6d('0x53')]},'raw':!![]})['then'](function(_0x47f0bd){if(_0x47f0bd&&_0x47f0bd[_0x2a6d('0x54')]===0x0){return db[_0x2a6d('0x27')][_0x2a6d('0x4b')]({'name':_0x2c7ba3[_0x2a6d('0x2b')],'resourceId':_0x2c7ba3['id'],'type':_0x47f0bd['name'],'sectionId':_0x47f0bd['id']},{})[_0x2a6d('0x25')](function(){return _0x451196;});}else{return _0x451196;}})[_0x2a6d('0x48')](function(_0x1d3ec6){logger[_0x2a6d('0x29')](_0x2a6d('0x55'),_0x1d3ec6);throw _0x1d3ec6;});}return _0x451196;})['then'](respondWithResult(_0x2a09e0,0xc9))[_0x2a6d('0x48')](handleError(_0x2a09e0,null));};exports[_0x2a6d('0x24')]=function(_0x245480,_0x1c8b96){if(_0x245480[_0x2a6d('0x56')]['id']){delete _0x245480[_0x2a6d('0x56')]['id'];}return db[_0x2a6d('0x2f')][_0x2a6d('0x52')]({'where':{'id':_0x245480[_0x2a6d('0x57')]['id']}})[_0x2a6d('0x25')](handleEntityNotFound(_0x1c8b96,null))[_0x2a6d('0x25')](saveUpdates(_0x245480[_0x2a6d('0x56')],null))[_0x2a6d('0x25')](respondWithResult(_0x1c8b96,null))[_0x2a6d('0x48')](handleError(_0x1c8b96,null));};exports['destroy']=function(_0xb9de2b,_0x18e73c){return db[_0x2a6d('0x2f')][_0x2a6d('0x52')]({'where':{'id':_0xb9de2b[_0x2a6d('0x57')]['id']}})[_0x2a6d('0x25')](handleEntityNotFound(_0x18e73c,null))['then'](removeEntity(_0x18e73c,null))[_0x2a6d('0x48')](handleError(_0x18e73c,null));};exports['describe']=function(_0x15c0cf,_0x122c5a){return db[_0x2a6d('0x2f')][_0x2a6d('0x58')]()[_0x2a6d('0x25')](respondWithResult(_0x122c5a,null))[_0x2a6d('0x48')](handleError(_0x122c5a,null));};exports['addDisposition']=function(_0x2e4dc4,_0x691a7b,_0x41fc42){if(_0x2e4dc4[_0x2a6d('0x56')]['id']){delete _0x2e4dc4['body']['id'];}return db['CmList'][_0x2a6d('0x52')]({'where':{'id':_0x2e4dc4[_0x2a6d('0x57')]['id']}})[_0x2a6d('0x25')](handleEntityNotFound(_0x691a7b,null))[_0x2a6d('0x25')](function(_0x379c9b){if(_0x379c9b){_0x2e4dc4[_0x2a6d('0x56')][_0x2a6d('0x59')]=_0x379c9b['id'];return db[_0x2a6d('0x5a')]['create'](_0x2e4dc4[_0x2a6d('0x56')]);}})[_0x2a6d('0x25')](respondWithResult(_0x691a7b,null))[_0x2a6d('0x48')](handleError(_0x691a7b,null));};exports['getDispositions']=function(_0x4d6d3f,_0x453361,_0x33d086){var _0x2d9828={'raw':![],'where':{}};var _0xe39b2d={};var _0x471d27={'count':0x0,'rows':[]};return db[_0x2a6d('0x2f')][_0x2a6d('0x5b')]({'where':{'id':_0x4d6d3f[_0x2a6d('0x57')]['id']}})['then'](handleEntityNotFound(_0x453361,null))[_0x2a6d('0x25')](function(_0x217400){if(_0x217400){_0xe39b2d[_0x2a6d('0x35')]=_['keys'](db[_0x2a6d('0x5a')][_0x2a6d('0x30')]);_0xe39b2d[_0x2a6d('0x34')]=_['keys'](_0x4d6d3f[_0x2a6d('0x34')]);_0xe39b2d[_0x2a6d('0x3f')]=_['intersection'](_0xe39b2d[_0x2a6d('0x35')],_0xe39b2d[_0x2a6d('0x34')]);_0x2d9828[_0x2a6d('0x38')]=_[_0x2a6d('0x36')](_0xe39b2d[_0x2a6d('0x35')],qs[_0x2a6d('0x37')](_0x4d6d3f[_0x2a6d('0x34')]['fields']));_0x2d9828[_0x2a6d('0x38')]=_0x2d9828[_0x2a6d('0x38')]['length']?_0x2d9828['attributes']:_0xe39b2d[_0x2a6d('0x35')];if(!_0x4d6d3f[_0x2a6d('0x34')][_0x2a6d('0x3a')](_0x2a6d('0x3b'))){_0x2d9828[_0x2a6d('0x1e')]=qs[_0x2a6d('0x1e')](_0x4d6d3f['query'][_0x2a6d('0x1e')]);_0x2d9828['offset']=qs[_0x2a6d('0x1d')](_0x4d6d3f[_0x2a6d('0x34')][_0x2a6d('0x1d')]);}_0x2d9828[_0x2a6d('0x3c')]=qs['sort'](_0x4d6d3f[_0x2a6d('0x34')]['sort']);_0x2d9828[_0x2a6d('0x3e')]=qs[_0x2a6d('0x3f')](_[_0x2a6d('0x40')](_0x4d6d3f[_0x2a6d('0x34')],_0xe39b2d[_0x2a6d('0x3f')]));_0x2d9828[_0x2a6d('0x3e')]['ListId']=_0x217400['id'];if(_0x4d6d3f['query'][_0x2a6d('0x5c')]){_0x2d9828[_0x2a6d('0x3e')]=_[_0x2a6d('0x42')](_0x2d9828[_0x2a6d('0x3e')],{'$or':_[_0x2a6d('0x2e')](_0x2d9828[_0x2a6d('0x38')],function(_0x1aaff4){var _0x475cdb={};_0x475cdb[_0x1aaff4]={'$like':'%'+_0x4d6d3f[_0x2a6d('0x34')][_0x2a6d('0x5c')]+'%'};return _0x475cdb;})});}_0x2d9828=_[_0x2a6d('0x42')]({},_0x2d9828,_0x4d6d3f[_0x2a6d('0x43')]);return db[_0x2a6d('0x5a')][_0x2a6d('0x1c')]({'where':_0x2d9828[_0x2a6d('0x3e')]})[_0x2a6d('0x25')](function(_0x424240){_0x471d27[_0x2a6d('0x1c')]=_0x424240;if(_0x4d6d3f[_0x2a6d('0x34')][_0x2a6d('0x44')]){_0x2d9828[_0x2a6d('0x45')]=[{'all':!![]}];}return db[_0x2a6d('0x5a')]['findAll'](_0x2d9828);})[_0x2a6d('0x25')](function(_0x1434e5){_0x471d27[_0x2a6d('0x47')]=_0x1434e5;return _0x471d27;});}})[_0x2a6d('0x25')](respondWithFilteredResult(_0x453361,_0x2d9828))['catch'](handleError(_0x453361,null));};exports[_0x2a6d('0x5d')]=function(_0x4c82e1,_0x5872a0,_0x4ccbb7){return db[_0x2a6d('0x2f')][_0x2a6d('0x52')]({'where':{'id':_0x4c82e1[_0x2a6d('0x57')]['id']}})[_0x2a6d('0x25')](handleEntityNotFound(_0x5872a0,null))[_0x2a6d('0x25')](function(_0x2f00fa){if(_0x2f00fa){return _0x2f00fa[_0x2a6d('0x5d')](_0x4c82e1['query'][_0x2a6d('0x5e')]);}})[_0x2a6d('0x25')](respondWithStatusCode(_0x5872a0,null))[_0x2a6d('0x48')](handleError(_0x5872a0,null));};exports[_0x2a6d('0x5f')]=function(_0x423c78,_0x2ca71a,_0x3031dc){return db['CmList'][_0x2a6d('0x52')]({'where':{'id':_0x423c78['params']['id']}})[_0x2a6d('0x25')](handleEntityNotFound(_0x2ca71a,null))['then'](function(_0x5c04b3){if(_0x5c04b3){var _0x3bb9e4=[];var _0x49c4fd={'success':[],'errors':[]};return db[_0x2a6d('0x60')][_0x2a6d('0x58')]()[_0x2a6d('0x25')](function(_0x419a46){if(_0x423c78[_0x2a6d('0x56')][_0x2a6d('0x61')]&&_['isArray'](_0x423c78['body'][_0x2a6d('0x61')])){if(_0x423c78[_0x2a6d('0x56')][_0x2a6d('0x61')]['length']){_0x423c78['body']['tags']=_0x423c78[_0x2a6d('0x56')]['tags'][_0x2a6d('0x62')](';')+';';}else{_0x423c78['body'][_0x2a6d('0x61')]=null;}}else{_0x423c78['body'][_0x2a6d('0x61')]=null;}if(_0x423c78[_0x2a6d('0x56')]&&_['isArray'](_0x423c78[_0x2a6d('0x56')])){for(var _0x4c993f=0x0;_0x4c993f<_0x423c78[_0x2a6d('0x56')]['length'];_0x4c993f+=0x1){_0x423c78[_0x2a6d('0x56')][_0x4c993f][_0x2a6d('0x59')]=_0x423c78[_0x2a6d('0x57')]['id'];_0x3bb9e4[_0x2a6d('0x63')](_0x423c78[_0x2a6d('0x56')][_0x4c993f]);}return BPromise['each'](_0x3bb9e4,function(_0x5e61db){return db[_0x2a6d('0x60')]['create'](_[_0x2a6d('0x64')](_0x5e61db,[_0x2a6d('0x5e'),'id'])||{},{'fields':_[_0x2a6d('0x4a')](_0x419a46),'raw':!![]})[_0x2a6d('0x25')](function(_0x10cd37){_0x49c4fd[_0x2a6d('0x65')]['push'](_0x10cd37[_0x2a6d('0x66')]);})[_0x2a6d('0x48')](function(_0x39a40a){_0x49c4fd[_0x2a6d('0x67')][_0x2a6d('0x63')]({'data':_0x5e61db,'error':_0x39a40a[_0x2a6d('0x68')]});});})[_0x2a6d('0x25')](function(_0x1ec05d){return _0x49c4fd;})[_0x2a6d('0x48')](function(_0x42a4fb){return _0x42a4fb;});}else{_0x2ca71a[_0x2a6d('0x28')](0x190)[_0x2a6d('0x69')]({'message':_0x2a6d('0x6a')});}});}})[_0x2a6d('0x25')](respondWithResult(_0x2ca71a,null))['catch'](handleError(_0x2ca71a,null));};exports[_0x2a6d('0x6b')]=function(_0x5cb354,_0x3a6839,_0x2b3dee){var _0x113aa5;return db[_0x2a6d('0x2f')]['find']({'where':{'id':_0x5cb354[_0x2a6d('0x57')]['id']},'include':[{'model':db[_0x2a6d('0x6c')],'as':_0x2a6d('0x6d')}]})[_0x2a6d('0x25')](handleEntityNotFound(_0x3a6839,null))[_0x2a6d('0x25')](function(_0x3933d9){if(_0x3933d9){_0x113aa5=_0x3933d9;return db[_0x2a6d('0x60')]['rawAttributes'];}})[_0x2a6d('0x25')](function(_0x563538){if(_0x563538){var _0x334b5b={};var _0x29da96={};_0x29da96['model']=_[_0x2a6d('0x6e')](_[_0x2a6d('0x4a')](_0x563538),_[_0x2a6d('0x2e')](_0x113aa5['CustomFields'],function(_0x581390){return util[_0x2a6d('0x6f')](_0x2a6d('0x70'),_0x581390['id']);}));_0x29da96[_0x2a6d('0x34')]=_[_0x2a6d('0x4a')](_0x5cb354[_0x2a6d('0x34')]);_0x29da96[_0x2a6d('0x3f')]=_[_0x2a6d('0x36')](_0x29da96[_0x2a6d('0x35')],_0x29da96[_0x2a6d('0x34')]);_0x334b5b['attributes']=_[_0x2a6d('0x36')](_0x29da96['model'],qs[_0x2a6d('0x37')](_0x5cb354[_0x2a6d('0x34')]['fields']));_0x334b5b[_0x2a6d('0x38')]=_0x334b5b['attributes']['length']?_0x334b5b[_0x2a6d('0x38')]:_0x29da96[_0x2a6d('0x35')];if(!_0x5cb354[_0x2a6d('0x34')]['hasOwnProperty']('nolimit')){_0x334b5b['limit']=qs[_0x2a6d('0x1e')](_0x5cb354[_0x2a6d('0x34')]['limit']);_0x334b5b[_0x2a6d('0x1d')]=qs[_0x2a6d('0x1d')](_0x5cb354[_0x2a6d('0x34')][_0x2a6d('0x1d')]);}_0x334b5b[_0x2a6d('0x3c')]=qs[_0x2a6d('0x3d')](_0x5cb354[_0x2a6d('0x34')]['sort']);_0x334b5b[_0x2a6d('0x3e')]=qs[_0x2a6d('0x3f')](_[_0x2a6d('0x40')](_0x5cb354[_0x2a6d('0x34')],_0x29da96[_0x2a6d('0x3f')]));_0x334b5b['raw']=!![];if(_0x5cb354[_0x2a6d('0x34')][_0x2a6d('0x5c')]){_0x334b5b['where']=_[_0x2a6d('0x42')](_0x334b5b['where'],{'$or':_[_0x2a6d('0x2e')](_0x334b5b[_0x2a6d('0x38')],function(_0x204212){var _0x369a5e={};_0x369a5e[_0x204212]={'$like':'%'+_0x5cb354[_0x2a6d('0x34')][_0x2a6d('0x5c')]+'%'};return _0x369a5e;})});}_0x334b5b=_[_0x2a6d('0x42')]({},_0x334b5b,_0x5cb354[_0x2a6d('0x43')]);return _0x113aa5[_0x2a6d('0x6b')](_0x334b5b);}})[_0x2a6d('0x25')](respondWithResult(_0x3a6839,null))[_0x2a6d('0x48')](handleError(_0x3a6839,null));};exports[_0x2a6d('0x71')]=function(_0x196c54,_0x5593b9,_0x32f014){var _0x228504;return db['CmList'][_0x2a6d('0x52')]({'where':{'id':_0x196c54[_0x2a6d('0x57')]['id']},'include':[{'model':db['CmCustomField'],'as':'CustomFields'}]})['then'](handleEntityNotFound(_0x5593b9,null))[_0x2a6d('0x25')](function(_0x2f86d5){if(_0x2f86d5){_0x228504=_0x2f86d5;return db[_0x2a6d('0x60')]['rawAttributes'];}})[_0x2a6d('0x25')](function(_0x403164){if(_0x403164){var _0x5f284e={};var _0x2a2ad4={};_0x2a2ad4[_0x2a6d('0x35')]=_[_0x2a6d('0x6e')](_[_0x2a6d('0x4a')](_0x403164),_[_0x2a6d('0x2e')](_0x228504[_0x2a6d('0x6d')],function(_0x7a4fca){return util[_0x2a6d('0x6f')]('cf_%d',_0x7a4fca['id']);}));_0x2a2ad4[_0x2a6d('0x34')]=_['keys'](_0x196c54[_0x2a6d('0x34')]);_0x2a2ad4['filters']=_[_0x2a6d('0x36')](_0x2a2ad4[_0x2a6d('0x35')],_0x2a2ad4[_0x2a6d('0x34')]);_0x5f284e[_0x2a6d('0x38')]=_['intersection'](_0x2a2ad4[_0x2a6d('0x35')],qs['fields'](_0x196c54['query'][_0x2a6d('0x37')]));_0x5f284e[_0x2a6d('0x38')]=_0x5f284e[_0x2a6d('0x38')][_0x2a6d('0x39')]?_0x5f284e['attributes']:_0x2a2ad4[_0x2a6d('0x35')];if(!_0x196c54['query'][_0x2a6d('0x3a')](_0x2a6d('0x3b'))){_0x5f284e[_0x2a6d('0x1e')]=qs[_0x2a6d('0x1e')](_0x196c54['query'][_0x2a6d('0x1e')]);_0x5f284e[_0x2a6d('0x1d')]=qs['offset'](_0x196c54['query']['offset']);}_0x5f284e[_0x2a6d('0x3c')]=qs[_0x2a6d('0x3d')](_0x196c54[_0x2a6d('0x34')][_0x2a6d('0x3d')]);_0x5f284e[_0x2a6d('0x3e')]=qs['filters'](_['pick'](_0x196c54['query'],_0x2a2ad4[_0x2a6d('0x3f')]));_0x5f284e[_0x2a6d('0x72')]=!![];if(_0x196c54[_0x2a6d('0x34')][_0x2a6d('0x5c')]){_0x5f284e[_0x2a6d('0x3e')]=_[_0x2a6d('0x42')](_0x5f284e['where'],{'$or':_[_0x2a6d('0x2e')](_0x5f284e[_0x2a6d('0x38')],function(_0x10a338){var _0x3f5e52={};_0x3f5e52[_0x10a338]={'$like':'%'+_0x196c54['query'][_0x2a6d('0x5c')]+'%'};return _0x3f5e52;})});}_0x5f284e=_['merge']({},_0x5f284e,_0x196c54[_0x2a6d('0x43')]);return _0x228504['getContacts'](_0x5f284e);}})[_0x2a6d('0x25')](function(_0x2563a8){if(!_[_0x2a6d('0x73')](_0x2563a8)){var _0x2cf80a=toCsv(_0x2563a8);var _0x1e289f=Date[_0x2a6d('0x74')]();fs[_0x2a6d('0x75')](util[_0x2a6d('0x6f')]('/tmp/list_%d_%s.csv',_0x228504['id'],_0x1e289f),_0x2cf80a);_0x5593b9['setHeader']('Content-disposition',_0x2a6d('0x76')+util[_0x2a6d('0x6f')](_0x2a6d('0x77'),_0x228504['id'],_0x1e289f));_0x5593b9[_0x2a6d('0x78')](_0x2a6d('0x79'),'text/csv');return _0x5593b9[_0x2a6d('0x7a')](util['format']('/tmp/list_%d_%s.csv',_0x228504['id'],_0x1e289f));}else{return _0x5593b9[_0x2a6d('0x1a')](0xcc);}})[_0x2a6d('0x48')](handleError(_0x5593b9,null));};exports[_0x2a6d('0x7b')]=function(_0xc29222,_0x1c3410,_0x1a124f){var _0x361110;delete _0xc29222['body']['id'];return db[_0x2a6d('0x2f')][_0x2a6d('0x5b')]({'where':{'id':_0xc29222[_0x2a6d('0x57')]['id']}})['then'](handleEntityNotFound(_0x1c3410,null))[_0x2a6d('0x25')](function(_0x4caf00){if(_0x4caf00){return db[_0x2a6d('0x7c')][_0x2a6d('0x7d')](function(_0x329e97){return db[_0x2a6d('0x6c')][_0x2a6d('0x4b')](_0xc29222[_0x2a6d('0x56')],{'transaction':_0x329e97})['then'](function(_0x20745c){_0x361110=_0x20745c;return _0x4caf00[_0x2a6d('0x7e')](_0x20745c,{'transaction':_0x329e97});})[_0x2a6d('0x25')](function(){var _0x47d9b2={'type':db[_0x2a6d('0x7f')][_0x2a6d('0x80')],'transaction':_0x329e97};switch(_0xc29222['body'][_0x2a6d('0x32')]){case _0x2a6d('0x81'):_0x47d9b2[_0x2a6d('0x32')]=db['Sequelize']['TEXT'];break;case'number':_0x47d9b2[_0x2a6d('0x32')]=db[_0x2a6d('0x7f')]['INTEGER'];break;case _0x2a6d('0x82'):_0x47d9b2['type']=db[_0x2a6d('0x7f')][_0x2a6d('0x83')];_0x47d9b2[_0x2a6d('0x84')]=![];break;default:}return db[_0x2a6d('0x7c')][_0x2a6d('0x85')]['addColumn']('cm_contacts',util['format'](_0x2a6d('0x86'),_0x361110['id']),_0x47d9b2);})[_0x2a6d('0x25')](function(){return _0x361110;});});}})[_0x2a6d('0x25')](respondWithResult(_0x1c3410,null))[_0x2a6d('0x48')](handleError(_0x1c3410,null));};exports[_0x2a6d('0x87')]=function(_0x2d9801,_0x4654cd,_0x5e4fb5){var _0x227def={};var _0x41dde6={};var _0xb14071;var _0x51b275;return db[_0x2a6d('0x2f')]['findOne']({'where':{'id':_0x2d9801[_0x2a6d('0x57')]['id']}})[_0x2a6d('0x25')](handleEntityNotFound(_0x4654cd,null))[_0x2a6d('0x25')](function(_0x4c2809){if(_0x4c2809){_0xb14071=_0x4c2809;_0x41dde6['model']=_[_0x2a6d('0x4a')](db['CmCustomField'][_0x2a6d('0x30')]);_0x41dde6[_0x2a6d('0x34')]=_[_0x2a6d('0x4a')](_0x2d9801[_0x2a6d('0x34')]);_0x41dde6[_0x2a6d('0x3f')]=_['intersection'](_0x41dde6[_0x2a6d('0x35')],_0x41dde6[_0x2a6d('0x34')]);_0x227def[_0x2a6d('0x38')]=_[_0x2a6d('0x36')](_0x41dde6['model'],qs[_0x2a6d('0x37')](_0x2d9801[_0x2a6d('0x34')]['fields']));_0x227def[_0x2a6d('0x38')]=_0x227def[_0x2a6d('0x38')][_0x2a6d('0x39')]?_0x227def[_0x2a6d('0x38')]:_0x41dde6[_0x2a6d('0x35')];_0x227def['order']=qs['sort'](_0x2d9801['query']['sort']);_0x227def[_0x2a6d('0x3e')]=qs[_0x2a6d('0x3f')](_['pick'](_0x2d9801[_0x2a6d('0x34')],_0x41dde6[_0x2a6d('0x3f')]));_0x227def[_0x2a6d('0x3e')]=_[_0x2a6d('0x42')](_0x227def[_0x2a6d('0x3e')],{'$or':[{'ListId':_0x4c2809['id']},{'ListId':null}]});if(_0x2d9801['query']['filter']){_0x227def[_0x2a6d('0x3e')]=_[_0x2a6d('0x42')](_0x227def['where'],{'$or':_['map'](_0x227def[_0x2a6d('0x38')],function(_0x210257){var _0x1150e7={};_0x1150e7[_0x210257]={'$like':'%'+_0x2d9801['query']['filter']+'%'};return _0x1150e7;})});}_0x227def=_[_0x2a6d('0x42')]({},_0x227def,_0x2d9801[_0x2a6d('0x43')]);return db[_0x2a6d('0x6c')][_0x2a6d('0x88')](_0x227def);}})[_0x2a6d('0x25')](respondWithResult(_0x4654cd,null))[_0x2a6d('0x48')](handleError(_0x4654cd,null));};exports[_0x2a6d('0x89')]=function(_0x167b59,_0x152352,_0x5829f2){return db['CmList'][_0x2a6d('0x52')]({'where':{'id':_0x167b59[_0x2a6d('0x57')]['id']}})['then'](handleEntityNotFound(_0x152352,null))[_0x2a6d('0x25')](function(_0x4c07f2){if(_0x4c07f2){return _0x4c07f2[_0x2a6d('0x89')](_0x167b59[_0x2a6d('0x56')][_0x2a6d('0x5e')],_[_0x2a6d('0x64')](_0x167b59[_0x2a6d('0x56')],[_0x2a6d('0x5e'),'id'])||{})[_0x2a6d('0x8a')](function(_0x22ae24){for(var _0x547e1f=0x0;_0x547e1f<_0x167b59[_0x2a6d('0x56')][_0x2a6d('0x5e')]['length'];_0x547e1f+=0x1){socket[_0x2a6d('0x8b')]('userCmList:save',{'UserId':_0x167b59[_0x2a6d('0x56')][_0x2a6d('0x5e')][_0x547e1f],'CmListId':_0x167b59['params']['id']});}return _0x22ae24;});}})[_0x2a6d('0x25')](respondWithResult(_0x152352,null))[_0x2a6d('0x48')](handleError(_0x152352,null));};exports['removeAgents']=function(_0x3a1b97,_0x411685,_0x44b424){return db[_0x2a6d('0x2f')][_0x2a6d('0x52')]({'where':{'id':_0x3a1b97[_0x2a6d('0x57')]['id']}})[_0x2a6d('0x25')](handleEntityNotFound(_0x411685,null))[_0x2a6d('0x25')](function(_0x181912){if(_0x181912){return _0x181912['removeAgents'](_0x3a1b97[_0x2a6d('0x34')][_0x2a6d('0x5e')])[_0x2a6d('0x25')](function(){if(_['isArray'](_0x3a1b97[_0x2a6d('0x34')][_0x2a6d('0x5e')])){for(var _0x4b1c12=0x0;_0x4b1c12<_0x3a1b97[_0x2a6d('0x34')][_0x2a6d('0x5e')]['length'];_0x4b1c12+=0x1){socket['emit'](_0x2a6d('0x8c'),{'UserId':Number(_0x3a1b97['query'][_0x2a6d('0x5e')][_0x4b1c12]),'CmListId':Number(_0x3a1b97[_0x2a6d('0x57')]['id'])});}}else{socket[_0x2a6d('0x8b')]('userCmList:remove',{'UserId':Number(_0x3a1b97['query'][_0x2a6d('0x5e')]),'CmListId':Number(_0x3a1b97[_0x2a6d('0x57')]['id'])});}});}})[_0x2a6d('0x25')](respondWithStatusCode(_0x411685,null))['catch'](handleError(_0x411685,null));};exports[_0x2a6d('0x8d')]=function(_0x277f34,_0x3f926c,_0x5539c4){var _0x154110={};var _0x20efe4={};var _0xfdf54e;var _0x5bbcd2;return db[_0x2a6d('0x2f')][_0x2a6d('0x5b')]({'where':{'id':_0x277f34[_0x2a6d('0x57')]['id']}})[_0x2a6d('0x25')](handleEntityNotFound(_0x3f926c,null))[_0x2a6d('0x25')](function(_0xce2d82){if(_0xce2d82){_0xfdf54e=_0xce2d82;_0x20efe4[_0x2a6d('0x35')]=_['keys'](db[_0x2a6d('0x8e')][_0x2a6d('0x30')]);_0x20efe4['query']=_[_0x2a6d('0x4a')](_0x277f34[_0x2a6d('0x34')]);_0x20efe4[_0x2a6d('0x3f')]=_[_0x2a6d('0x36')](_0x20efe4[_0x2a6d('0x35')],_0x20efe4['query']);_0x154110[_0x2a6d('0x38')]=_[_0x2a6d('0x36')](_0x20efe4['model'],qs[_0x2a6d('0x37')](_0x277f34[_0x2a6d('0x34')][_0x2a6d('0x37')]));_0x154110[_0x2a6d('0x38')]=_0x154110[_0x2a6d('0x38')][_0x2a6d('0x39')]?_0x154110[_0x2a6d('0x38')]:_0x20efe4[_0x2a6d('0x35')];_0x154110[_0x2a6d('0x3c')]=qs[_0x2a6d('0x3d')](_0x277f34[_0x2a6d('0x34')]['sort']);_0x154110['where']=qs[_0x2a6d('0x3f')](_['pick'](_0x277f34['query'],_0x20efe4['filters']));if(_0x277f34[_0x2a6d('0x34')]['filter']){_0x154110[_0x2a6d('0x3e')]=_[_0x2a6d('0x42')](_0x154110[_0x2a6d('0x3e')],{'$or':_[_0x2a6d('0x2e')](_0x154110[_0x2a6d('0x38')],function(_0x47fdb6){var _0xfb002e={};_0xfb002e[_0x47fdb6]={'$like':'%'+_0x277f34[_0x2a6d('0x34')]['filter']+'%'};return _0xfb002e;})});}_0x154110=_[_0x2a6d('0x42')]({},_0x154110,_0x277f34[_0x2a6d('0x43')]);return _0xfdf54e[_0x2a6d('0x8d')](_0x154110);}})[_0x2a6d('0x25')](function(_0x4093ff){if(_0x4093ff){_0x5bbcd2=_0x4093ff[_0x2a6d('0x39')];if(!_0x277f34[_0x2a6d('0x34')][_0x2a6d('0x3a')](_0x2a6d('0x3b'))){_0x154110[_0x2a6d('0x1e')]=qs['limit'](_0x277f34[_0x2a6d('0x34')][_0x2a6d('0x1e')]);_0x154110['offset']=qs['offset'](_0x277f34['query'][_0x2a6d('0x1d')]);}return _0xfdf54e[_0x2a6d('0x8d')](_0x154110);}})['then'](function(_0x43fe11){if(_0x43fe11){return _0x43fe11?{'count':_0x5bbcd2,'rows':_0x43fe11}:null;}})[_0x2a6d('0x25')](respondWithResult(_0x3f926c,null))[_0x2a6d('0x48')](handleError(_0x3f926c,null));};
\ No newline at end of file
+var _0x120a=['body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','Disposition','getDispositions','findOne','length','ListId','filter','removeDispositions','CmContact','tags','isArray','join','each','omit','ids','success','push','dataValues','message','CmCustomField','CustomFields','format','cf_%d','getContacts','getContactsCsv','isEmpty','now','writeFileSync','/tmp/list_%d_%s.csv','setHeader','list_%d_%s.csv','Content-type','download','addCustomField','sequelize','addCustomFields','Sequelize','TEXT','number','INTEGER','switch','BOOLEAN','defaultValue','queryInterface','addColumn','cm_contacts','cf_%s','getCustomFields','findAndCountAll','spread','emit','userCmList:save','removeAgents','userCmList:remove','getAgents','User','html-pdf','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','lodash','squel','crypto','querystring','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','defaults','socket.io-emitter','register','sendStatus','status','end','json','count','offset','set','Content-Range','reject','save','update','then','destroy','get','Lists','UserProfileResource','error','name','send','index','map','CmList','rawAttributes','type','key','keys','query','intersection','model','attributes','fields','hasOwnProperty','nolimit','limit','order','sort','where','filters','pick','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create'];(function(_0xfdeaaf,_0x50ba66){var _0xa18cd7=function(_0x14a111){while(--_0x14a111){_0xfdeaaf['push'](_0xfdeaaf['shift']());}};_0xa18cd7(++_0x50ba66);}(_0x120a,0x152));var _0xa120=function(_0x14ec75,_0x56a3d4){_0x14ec75=_0x14ec75-0x0;var _0x40b9e9=_0x120a[_0x14ec75];return _0x40b9e9;};'use strict';var pdf=require(_0xa120('0x0'));var emlformat=require(_0xa120('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xa120('0x2'));var rp=require(_0xa120('0x3'));var moment=require(_0xa120('0x4'));var BPromise=require(_0xa120('0x5'));var Mustache=require(_0xa120('0x6'));var util=require(_0xa120('0x7'));var path=require(_0xa120('0x8'));var sox=require('sox');var csv=require(_0xa120('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xa120('0xa'));var squel=require(_0xa120('0xb'));var crypto=require(_0xa120('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xa120('0x9'));var querystring=require(_0xa120('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xa120('0xe'));var qs=require(_0xa120('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa120('0x10'));var logger=require(_0xa120('0x11'))(_0xa120('0x12'));var utils=require(_0xa120('0x13'));var config=require(_0xa120('0x14'));var db=require(_0xa120('0x15'))['db'];config['redis']=_[_0xa120('0x16')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xa120('0x17'))(new Redis(config['redis']));require('./cmList.socket')[_0xa120('0x18')](socket);function respondWithStatusCode(_0x19a4e4,_0x3003cc){_0x3003cc=_0x3003cc||0xcc;return function(_0x455852){if(_0x455852){return _0x19a4e4[_0xa120('0x19')](_0x3003cc);}return _0x19a4e4[_0xa120('0x1a')](_0x3003cc)[_0xa120('0x1b')]();};}function respondWithResult(_0x2b0518,_0x1129a6){_0x1129a6=_0x1129a6||0xc8;return function(_0x178751){if(_0x178751){return _0x2b0518[_0xa120('0x1a')](_0x1129a6)[_0xa120('0x1c')](_0x178751);}};}function respondWithFilteredResult(_0x3a1b4a,_0x5ede4d){return function(_0x151ee4){if(_0x151ee4){var _0x1782b4=_0x151ee4[_0xa120('0x1d')],_0x1e8291=_0x5ede4d[_0xa120('0x1e')],_0x2b1f93=_0x5ede4d['offset']+_0x5ede4d['limit'],_0x82e870;if(_0x2b1f93>=_0x1782b4){_0x2b1f93=_0x1782b4;_0x82e870=0xc8;}else{_0x82e870=0xce;}_0x3a1b4a['status'](_0x82e870);return _0x3a1b4a[_0xa120('0x1f')](_0xa120('0x20'),_0x1e8291+'-'+_0x2b1f93+'/'+_0x1782b4)[_0xa120('0x1c')](_0x151ee4);}return null;};}function patchUpdates(_0x22a740){return function(_0x5a848a){try{jsonpatch['apply'](_0x5a848a,_0x22a740,!![]);}catch(_0x4abb42){return BPromise[_0xa120('0x21')](_0x4abb42);}return _0x5a848a[_0xa120('0x22')]();};}function saveUpdates(_0x3c6f55,_0x4eda23){return function(_0x1076f2){if(_0x1076f2){return _0x1076f2[_0xa120('0x23')](_0x3c6f55)[_0xa120('0x24')](function(_0x1d4353){return _0x1d4353;});}return null;};}function removeEntity(_0x466476,_0x235a82){return function(_0x1a2dcb){if(_0x1a2dcb){return _0x1a2dcb[_0xa120('0x25')]()[_0xa120('0x24')](function(){var _0x48f63b=_0x1a2dcb[_0xa120('0x26')]({'plain':!![]});var _0x5ff11e=_0xa120('0x27');return db[_0xa120('0x28')][_0xa120('0x25')]({'where':{'type':_0x5ff11e,'resourceId':_0x48f63b['id']}})[_0xa120('0x24')](function(){return _0x1a2dcb;});})[_0xa120('0x24')](function(){_0x466476[_0xa120('0x1a')](0xcc)[_0xa120('0x1b')]();});}};}function handleEntityNotFound(_0x2b5bea,_0x2c3782){return function(_0x1e5647){if(!_0x1e5647){_0x2b5bea[_0xa120('0x19')](0x194);}return _0x1e5647;};}function handleError(_0x22650f,_0x561648){_0x561648=_0x561648||0x1f4;return function(_0x23a31b){logger[_0xa120('0x29')](_0x23a31b['stack']);if(_0x23a31b['name']){delete _0x23a31b[_0xa120('0x2a')];}_0x22650f[_0xa120('0x1a')](_0x561648)[_0xa120('0x2b')](_0x23a31b);};}exports[_0xa120('0x2c')]=function(_0x22a9ba,_0x5b7ce3){var _0x3d8eb1={},_0x524d62={},_0x1eb2ae={'count':0x0,'rows':[]};var _0x25b86a=_[_0xa120('0x2d')](db[_0xa120('0x2e')][_0xa120('0x2f')],function(_0x3c4dd5){return{'name':_0x3c4dd5['fieldName'],'type':_0x3c4dd5[_0xa120('0x30')][_0xa120('0x31')]};});_0x524d62['model']=_[_0xa120('0x2d')](_0x25b86a,_0xa120('0x2a'));_0x524d62['query']=_[_0xa120('0x32')](_0x22a9ba[_0xa120('0x33')]);_0x524d62['filters']=_[_0xa120('0x34')](_0x524d62[_0xa120('0x35')],_0x524d62['query']);_0x3d8eb1[_0xa120('0x36')]=_[_0xa120('0x34')](_0x524d62[_0xa120('0x35')],qs[_0xa120('0x37')](_0x22a9ba[_0xa120('0x33')][_0xa120('0x37')]));_0x3d8eb1[_0xa120('0x36')]=_0x3d8eb1[_0xa120('0x36')]['length']?_0x3d8eb1['attributes']:_0x524d62['model'];if(!_0x22a9ba[_0xa120('0x33')][_0xa120('0x38')](_0xa120('0x39'))){_0x3d8eb1['limit']=qs[_0xa120('0x3a')](_0x22a9ba[_0xa120('0x33')][_0xa120('0x3a')]);_0x3d8eb1['offset']=qs[_0xa120('0x1e')](_0x22a9ba[_0xa120('0x33')]['offset']);}_0x3d8eb1[_0xa120('0x3b')]=qs[_0xa120('0x3c')](_0x22a9ba[_0xa120('0x33')][_0xa120('0x3c')]);_0x3d8eb1[_0xa120('0x3d')]=qs[_0xa120('0x3e')](_[_0xa120('0x3f')](_0x22a9ba[_0xa120('0x33')],_0x524d62[_0xa120('0x3e')]),_0x25b86a);if(_0x22a9ba['query']['filter']){_0x3d8eb1['where']=_[_0xa120('0x40')](_0x3d8eb1[_0xa120('0x3d')],{'$or':_['map'](_0x25b86a,function(_0x3ef691){if(_0x3ef691[_0xa120('0x30')]!==_0xa120('0x41')){var _0x314af8={};_0x314af8[_0x3ef691[_0xa120('0x2a')]]={'$like':'%'+_0x22a9ba[_0xa120('0x33')]['filter']+'%'};return _0x314af8;}})});}_0x3d8eb1=_[_0xa120('0x40')]({},_0x3d8eb1,_0x22a9ba[_0xa120('0x42')]);var _0x57ef1c={'where':_0x3d8eb1[_0xa120('0x3d')]};return db[_0xa120('0x2e')]['count'](_0x57ef1c)[_0xa120('0x24')](function(_0x3b319d){_0x1eb2ae[_0xa120('0x1d')]=_0x3b319d;if(_0x22a9ba[_0xa120('0x33')][_0xa120('0x43')]){_0x3d8eb1[_0xa120('0x44')]=[{'all':!![]}];}return db[_0xa120('0x2e')][_0xa120('0x45')](_0x3d8eb1);})[_0xa120('0x24')](function(_0xcb4f0f){_0x1eb2ae[_0xa120('0x46')]=_0xcb4f0f;return _0x1eb2ae;})[_0xa120('0x24')](respondWithFilteredResult(_0x5b7ce3,_0x3d8eb1))[_0xa120('0x47')](handleError(_0x5b7ce3,null));};exports[_0xa120('0x48')]=function(_0x4f8fe3,_0x12ce0f){var _0x296c3d={'raw':![],'where':{'id':_0x4f8fe3[_0xa120('0x49')]['id']}},_0x255b3e={};_0x255b3e[_0xa120('0x35')]=_[_0xa120('0x32')](db[_0xa120('0x2e')][_0xa120('0x2f')]);_0x255b3e[_0xa120('0x33')]=_[_0xa120('0x32')](_0x4f8fe3[_0xa120('0x33')]);_0x255b3e[_0xa120('0x3e')]=_[_0xa120('0x34')](_0x255b3e[_0xa120('0x35')],_0x255b3e['query']);_0x296c3d[_0xa120('0x36')]=_['intersection'](_0x255b3e['model'],qs[_0xa120('0x37')](_0x4f8fe3[_0xa120('0x33')][_0xa120('0x37')]));_0x296c3d[_0xa120('0x36')]=_0x296c3d['attributes']['length']?_0x296c3d[_0xa120('0x36')]:_0x255b3e[_0xa120('0x35')];if(_0x4f8fe3[_0xa120('0x33')][_0xa120('0x43')]){_0x296c3d[_0xa120('0x44')]=[{'all':!![]}];}_0x296c3d=_[_0xa120('0x40')]({},_0x296c3d,_0x4f8fe3[_0xa120('0x42')]);return db[_0xa120('0x2e')][_0xa120('0x4a')](_0x296c3d)[_0xa120('0x24')](handleEntityNotFound(_0x12ce0f,null))[_0xa120('0x24')](respondWithResult(_0x12ce0f,null))[_0xa120('0x47')](handleError(_0x12ce0f,null));};exports[_0xa120('0x4b')]=function(_0x1a9813,_0x533b00){return db['CmList'][_0xa120('0x4b')](_0x1a9813[_0xa120('0x4c')],{})[_0xa120('0x24')](function(_0x6210a7){var _0x717b01=_0x1a9813[_0xa120('0x4d')]['get']({'plain':!![]});if(!_0x717b01)throw new Error(_0xa120('0x4e'));if(_0x717b01[_0xa120('0x4f')]===_0xa120('0x4d')){var _0x154e8f=_0x6210a7[_0xa120('0x26')]({'plain':!![]});var _0x11392e=_0xa120('0x27');return db[_0xa120('0x50')][_0xa120('0x4a')]({'where':{'name':_0x11392e,'userProfileId':_0x717b01['userProfileId']},'raw':!![]})[_0xa120('0x24')](function(_0xc04d0d){if(_0xc04d0d&&_0xc04d0d['autoAssociation']===0x0){return db['UserProfileResource'][_0xa120('0x4b')]({'name':_0x154e8f['name'],'resourceId':_0x154e8f['id'],'type':_0xc04d0d[_0xa120('0x2a')],'sectionId':_0xc04d0d['id']},{})['then'](function(){return _0x6210a7;});}else{return _0x6210a7;}})[_0xa120('0x47')](function(_0x4b2221){logger[_0xa120('0x29')](_0xa120('0x51'),_0x4b2221);throw _0x4b2221;});}return _0x6210a7;})[_0xa120('0x24')](respondWithResult(_0x533b00,0xc9))[_0xa120('0x47')](handleError(_0x533b00,null));};exports[_0xa120('0x23')]=function(_0x4b7b14,_0x9058b6){if(_0x4b7b14['body']['id']){delete _0x4b7b14['body']['id'];}return db[_0xa120('0x2e')][_0xa120('0x4a')]({'where':{'id':_0x4b7b14[_0xa120('0x49')]['id']}})['then'](handleEntityNotFound(_0x9058b6,null))[_0xa120('0x24')](saveUpdates(_0x4b7b14['body'],null))[_0xa120('0x24')](respondWithResult(_0x9058b6,null))[_0xa120('0x47')](handleError(_0x9058b6,null));};exports[_0xa120('0x25')]=function(_0x29f165,_0x54b80e){return db[_0xa120('0x2e')][_0xa120('0x4a')]({'where':{'id':_0x29f165[_0xa120('0x49')]['id']}})['then'](handleEntityNotFound(_0x54b80e,null))[_0xa120('0x24')](removeEntity(_0x54b80e,null))[_0xa120('0x47')](handleError(_0x54b80e,null));};exports[_0xa120('0x52')]=function(_0x3de6f6,_0x47ed69){return db[_0xa120('0x2e')][_0xa120('0x52')]()[_0xa120('0x24')](respondWithResult(_0x47ed69,null))['catch'](handleError(_0x47ed69,null));};exports['addDisposition']=function(_0x17ed93,_0x2987c1,_0x1b1189){if(_0x17ed93[_0xa120('0x4c')]['id']){delete _0x17ed93[_0xa120('0x4c')]['id'];}return db[_0xa120('0x2e')]['find']({'where':{'id':_0x17ed93[_0xa120('0x49')]['id']}})[_0xa120('0x24')](handleEntityNotFound(_0x2987c1,null))[_0xa120('0x24')](function(_0x57d430){if(_0x57d430){_0x17ed93['body']['ListId']=_0x57d430['id'];return db[_0xa120('0x53')][_0xa120('0x4b')](_0x17ed93[_0xa120('0x4c')]);}})[_0xa120('0x24')](respondWithResult(_0x2987c1,null))[_0xa120('0x47')](handleError(_0x2987c1,null));};exports[_0xa120('0x54')]=function(_0x3e8b17,_0x5dee9d,_0x2cef27){var _0x514c5f={'raw':![],'where':{}};var _0x408d0f={};var _0x4e03e2={'count':0x0,'rows':[]};return db['CmList'][_0xa120('0x55')]({'where':{'id':_0x3e8b17[_0xa120('0x49')]['id']}})[_0xa120('0x24')](handleEntityNotFound(_0x5dee9d,null))['then'](function(_0x203fa2){if(_0x203fa2){_0x408d0f[_0xa120('0x35')]=_[_0xa120('0x32')](db[_0xa120('0x53')][_0xa120('0x2f')]);_0x408d0f[_0xa120('0x33')]=_[_0xa120('0x32')](_0x3e8b17[_0xa120('0x33')]);_0x408d0f[_0xa120('0x3e')]=_['intersection'](_0x408d0f[_0xa120('0x35')],_0x408d0f[_0xa120('0x33')]);_0x514c5f[_0xa120('0x36')]=_[_0xa120('0x34')](_0x408d0f[_0xa120('0x35')],qs[_0xa120('0x37')](_0x3e8b17[_0xa120('0x33')][_0xa120('0x37')]));_0x514c5f[_0xa120('0x36')]=_0x514c5f[_0xa120('0x36')][_0xa120('0x56')]?_0x514c5f[_0xa120('0x36')]:_0x408d0f[_0xa120('0x35')];if(!_0x3e8b17['query'][_0xa120('0x38')]('nolimit')){_0x514c5f[_0xa120('0x3a')]=qs[_0xa120('0x3a')](_0x3e8b17[_0xa120('0x33')][_0xa120('0x3a')]);_0x514c5f[_0xa120('0x1e')]=qs[_0xa120('0x1e')](_0x3e8b17[_0xa120('0x33')][_0xa120('0x1e')]);}_0x514c5f[_0xa120('0x3b')]=qs[_0xa120('0x3c')](_0x3e8b17['query'][_0xa120('0x3c')]);_0x514c5f[_0xa120('0x3d')]=qs[_0xa120('0x3e')](_[_0xa120('0x3f')](_0x3e8b17[_0xa120('0x33')],_0x408d0f[_0xa120('0x3e')]));_0x514c5f[_0xa120('0x3d')][_0xa120('0x57')]=_0x203fa2['id'];if(_0x3e8b17['query']['filter']){_0x514c5f[_0xa120('0x3d')]=_[_0xa120('0x40')](_0x514c5f[_0xa120('0x3d')],{'$or':_[_0xa120('0x2d')](_0x514c5f[_0xa120('0x36')],function(_0x11e2f1){var _0x9ddf05={};_0x9ddf05[_0x11e2f1]={'$like':'%'+_0x3e8b17[_0xa120('0x33')][_0xa120('0x58')]+'%'};return _0x9ddf05;})});}_0x514c5f=_['merge']({},_0x514c5f,_0x3e8b17[_0xa120('0x42')]);return db[_0xa120('0x53')]['count']({'where':_0x514c5f[_0xa120('0x3d')]})[_0xa120('0x24')](function(_0x323962){_0x4e03e2[_0xa120('0x1d')]=_0x323962;if(_0x3e8b17[_0xa120('0x33')]['includeAll']){_0x514c5f['include']=[{'all':!![]}];}return db[_0xa120('0x53')][_0xa120('0x45')](_0x514c5f);})[_0xa120('0x24')](function(_0x47b158){_0x4e03e2[_0xa120('0x46')]=_0x47b158;return _0x4e03e2;});}})[_0xa120('0x24')](respondWithFilteredResult(_0x5dee9d,_0x514c5f))['catch'](handleError(_0x5dee9d,null));};exports[_0xa120('0x59')]=function(_0xbf2da,_0xba41a5,_0x4b98f0){return db[_0xa120('0x2e')][_0xa120('0x4a')]({'where':{'id':_0xbf2da[_0xa120('0x49')]['id']}})['then'](handleEntityNotFound(_0xba41a5,null))[_0xa120('0x24')](function(_0x1f5eb2){if(_0x1f5eb2){return _0x1f5eb2[_0xa120('0x59')](_0xbf2da[_0xa120('0x33')]['ids']);}})['then'](respondWithStatusCode(_0xba41a5,null))['catch'](handleError(_0xba41a5,null));};exports['addContacts']=function(_0x12bb7e,_0x468759,_0x48be35){return db['CmList'][_0xa120('0x4a')]({'where':{'id':_0x12bb7e[_0xa120('0x49')]['id']}})[_0xa120('0x24')](handleEntityNotFound(_0x468759,null))[_0xa120('0x24')](function(_0x108d22){if(_0x108d22){var _0x1b9a74=[];var _0x573a4e={'success':[],'errors':[]};return db[_0xa120('0x5a')][_0xa120('0x52')]()[_0xa120('0x24')](function(_0x54a036){if(_0x12bb7e['body'][_0xa120('0x5b')]&&_[_0xa120('0x5c')](_0x12bb7e[_0xa120('0x4c')][_0xa120('0x5b')])){if(_0x12bb7e[_0xa120('0x4c')]['tags'][_0xa120('0x56')]){_0x12bb7e[_0xa120('0x4c')]['tags']=_0x12bb7e[_0xa120('0x4c')][_0xa120('0x5b')][_0xa120('0x5d')](';')+';';}else{_0x12bb7e['body'][_0xa120('0x5b')]=null;}}else{_0x12bb7e['body']['tags']=null;}if(_0x12bb7e['body']&&_['isArray'](_0x12bb7e[_0xa120('0x4c')])){for(var _0x16fe45=0x0;_0x16fe45<_0x12bb7e[_0xa120('0x4c')][_0xa120('0x56')];_0x16fe45+=0x1){_0x12bb7e['body'][_0x16fe45][_0xa120('0x57')]=_0x12bb7e[_0xa120('0x49')]['id'];_0x1b9a74['push'](_0x12bb7e['body'][_0x16fe45]);}return BPromise[_0xa120('0x5e')](_0x1b9a74,function(_0xd2c0b3){return db['CmContact']['create'](_[_0xa120('0x5f')](_0xd2c0b3,[_0xa120('0x60'),'id'])||{},{'fields':_[_0xa120('0x32')](_0x54a036),'raw':!![]})['then'](function(_0x542e20){_0x573a4e[_0xa120('0x61')][_0xa120('0x62')](_0x542e20[_0xa120('0x63')]);})[_0xa120('0x47')](function(_0xf09200){_0x573a4e['errors']['push']({'data':_0xd2c0b3,'error':_0xf09200[_0xa120('0x64')]});});})[_0xa120('0x24')](function(_0x2d8cb6){return _0x573a4e;})[_0xa120('0x47')](function(_0x45ea98){return _0x45ea98;});}else{_0x468759['status'](0x190)[_0xa120('0x1c')]({'message':'Malformed\x20request\x20syntax'});}});}})[_0xa120('0x24')](respondWithResult(_0x468759,null))[_0xa120('0x47')](handleError(_0x468759,null));};exports['getContacts']=function(_0x399738,_0x327467,_0x5e0d33){var _0x113434;return db[_0xa120('0x2e')][_0xa120('0x4a')]({'where':{'id':_0x399738['params']['id']},'include':[{'model':db[_0xa120('0x65')],'as':'CustomFields'}]})[_0xa120('0x24')](handleEntityNotFound(_0x327467,null))[_0xa120('0x24')](function(_0x1f46f1){if(_0x1f46f1){_0x113434=_0x1f46f1;return db[_0xa120('0x5a')]['rawAttributes'];}})[_0xa120('0x24')](function(_0x13e92f){if(_0x13e92f){var _0x2713ae={};var _0x1b102b={};_0x1b102b[_0xa120('0x35')]=_['concat'](_[_0xa120('0x32')](_0x13e92f),_[_0xa120('0x2d')](_0x113434[_0xa120('0x66')],function(_0x446cda){return util[_0xa120('0x67')](_0xa120('0x68'),_0x446cda['id']);}));_0x1b102b[_0xa120('0x33')]=_[_0xa120('0x32')](_0x399738[_0xa120('0x33')]);_0x1b102b[_0xa120('0x3e')]=_[_0xa120('0x34')](_0x1b102b[_0xa120('0x35')],_0x1b102b['query']);_0x2713ae['attributes']=_[_0xa120('0x34')](_0x1b102b[_0xa120('0x35')],qs[_0xa120('0x37')](_0x399738[_0xa120('0x33')][_0xa120('0x37')]));_0x2713ae[_0xa120('0x36')]=_0x2713ae[_0xa120('0x36')]['length']?_0x2713ae[_0xa120('0x36')]:_0x1b102b[_0xa120('0x35')];if(!_0x399738[_0xa120('0x33')][_0xa120('0x38')](_0xa120('0x39'))){_0x2713ae[_0xa120('0x3a')]=qs[_0xa120('0x3a')](_0x399738['query'][_0xa120('0x3a')]);_0x2713ae[_0xa120('0x1e')]=qs[_0xa120('0x1e')](_0x399738[_0xa120('0x33')][_0xa120('0x1e')]);}_0x2713ae[_0xa120('0x3b')]=qs[_0xa120('0x3c')](_0x399738[_0xa120('0x33')][_0xa120('0x3c')]);_0x2713ae[_0xa120('0x3d')]=qs[_0xa120('0x3e')](_['pick'](_0x399738[_0xa120('0x33')],_0x1b102b[_0xa120('0x3e')]));_0x2713ae['raw']=!![];if(_0x399738[_0xa120('0x33')][_0xa120('0x58')]){_0x2713ae[_0xa120('0x3d')]=_[_0xa120('0x40')](_0x2713ae['where'],{'$or':_['map'](_0x2713ae[_0xa120('0x36')],function(_0x5598dc){var _0x7c998d={};_0x7c998d[_0x5598dc]={'$like':'%'+_0x399738[_0xa120('0x33')][_0xa120('0x58')]+'%'};return _0x7c998d;})});}_0x2713ae=_[_0xa120('0x40')]({},_0x2713ae,_0x399738[_0xa120('0x42')]);return _0x113434[_0xa120('0x69')](_0x2713ae);}})['then'](respondWithResult(_0x327467,null))[_0xa120('0x47')](handleError(_0x327467,null));};exports[_0xa120('0x6a')]=function(_0x8b0552,_0x2d7714,_0x302d6c){var _0x3bb5fc;return db[_0xa120('0x2e')]['find']({'where':{'id':_0x8b0552[_0xa120('0x49')]['id']},'include':[{'model':db[_0xa120('0x65')],'as':_0xa120('0x66')}]})[_0xa120('0x24')](handleEntityNotFound(_0x2d7714,null))[_0xa120('0x24')](function(_0x2ea609){if(_0x2ea609){_0x3bb5fc=_0x2ea609;return db['CmContact'][_0xa120('0x2f')];}})[_0xa120('0x24')](function(_0x4dd79b){if(_0x4dd79b){var _0x2a7cb8={};var _0x5311e1={};_0x5311e1[_0xa120('0x35')]=_['concat'](_[_0xa120('0x32')](_0x4dd79b),_[_0xa120('0x2d')](_0x3bb5fc['CustomFields'],function(_0x210641){return util['format']('cf_%d',_0x210641['id']);}));_0x5311e1['query']=_[_0xa120('0x32')](_0x8b0552[_0xa120('0x33')]);_0x5311e1[_0xa120('0x3e')]=_[_0xa120('0x34')](_0x5311e1[_0xa120('0x35')],_0x5311e1[_0xa120('0x33')]);_0x2a7cb8[_0xa120('0x36')]=_['intersection'](_0x5311e1[_0xa120('0x35')],qs[_0xa120('0x37')](_0x8b0552[_0xa120('0x33')]['fields']));_0x2a7cb8[_0xa120('0x36')]=_0x2a7cb8[_0xa120('0x36')]['length']?_0x2a7cb8['attributes']:_0x5311e1['model'];if(!_0x8b0552['query']['hasOwnProperty']('nolimit')){_0x2a7cb8[_0xa120('0x3a')]=qs[_0xa120('0x3a')](_0x8b0552['query'][_0xa120('0x3a')]);_0x2a7cb8[_0xa120('0x1e')]=qs['offset'](_0x8b0552[_0xa120('0x33')][_0xa120('0x1e')]);}_0x2a7cb8[_0xa120('0x3b')]=qs[_0xa120('0x3c')](_0x8b0552[_0xa120('0x33')][_0xa120('0x3c')]);_0x2a7cb8[_0xa120('0x3d')]=qs[_0xa120('0x3e')](_[_0xa120('0x3f')](_0x8b0552[_0xa120('0x33')],_0x5311e1['filters']));_0x2a7cb8['raw']=!![];if(_0x8b0552[_0xa120('0x33')][_0xa120('0x58')]){_0x2a7cb8[_0xa120('0x3d')]=_[_0xa120('0x40')](_0x2a7cb8['where'],{'$or':_[_0xa120('0x2d')](_0x2a7cb8['attributes'],function(_0x116847){var _0x4ed139={};_0x4ed139[_0x116847]={'$like':'%'+_0x8b0552[_0xa120('0x33')]['filter']+'%'};return _0x4ed139;})});}_0x2a7cb8=_['merge']({},_0x2a7cb8,_0x8b0552['options']);return _0x3bb5fc[_0xa120('0x69')](_0x2a7cb8);}})[_0xa120('0x24')](function(_0x75a271){if(!_[_0xa120('0x6b')](_0x75a271)){var _0x27151b=toCsv(_0x75a271);var _0x366f11=Date[_0xa120('0x6c')]();fs[_0xa120('0x6d')](util[_0xa120('0x67')](_0xa120('0x6e'),_0x3bb5fc['id'],_0x366f11),_0x27151b);_0x2d7714[_0xa120('0x6f')]('Content-disposition','attachment;\x20filename='+util['format'](_0xa120('0x70'),_0x3bb5fc['id'],_0x366f11));_0x2d7714['setHeader'](_0xa120('0x71'),'text/csv');return _0x2d7714[_0xa120('0x72')](util['format'](_0xa120('0x6e'),_0x3bb5fc['id'],_0x366f11));}else{return _0x2d7714[_0xa120('0x19')](0xcc);}})[_0xa120('0x47')](handleError(_0x2d7714,null));};exports[_0xa120('0x73')]=function(_0x47245d,_0x40e1a7,_0x3ed91c){var _0x2ea302;delete _0x47245d['body']['id'];return db['CmList'][_0xa120('0x55')]({'where':{'id':_0x47245d[_0xa120('0x49')]['id']}})['then'](handleEntityNotFound(_0x40e1a7,null))['then'](function(_0x2d7fd9){if(_0x2d7fd9){return db[_0xa120('0x74')]['transaction'](function(_0x1182c8){return db[_0xa120('0x65')][_0xa120('0x4b')](_0x47245d[_0xa120('0x4c')],{'transaction':_0x1182c8})[_0xa120('0x24')](function(_0x4dbfd5){_0x2ea302=_0x4dbfd5;return _0x2d7fd9[_0xa120('0x75')](_0x4dbfd5,{'transaction':_0x1182c8});})[_0xa120('0x24')](function(){var _0x289116={'type':db[_0xa120('0x76')][_0xa120('0x77')],'transaction':_0x1182c8};switch(_0x47245d[_0xa120('0x4c')]['type']){case'text':_0x289116[_0xa120('0x30')]=db[_0xa120('0x76')][_0xa120('0x77')];break;case _0xa120('0x78'):_0x289116[_0xa120('0x30')]=db['Sequelize'][_0xa120('0x79')];break;case _0xa120('0x7a'):_0x289116['type']=db[_0xa120('0x76')][_0xa120('0x7b')];_0x289116[_0xa120('0x7c')]=![];break;default:}return db[_0xa120('0x74')][_0xa120('0x7d')][_0xa120('0x7e')](_0xa120('0x7f'),util['format'](_0xa120('0x80'),_0x2ea302['id']),_0x289116);})['then'](function(){return _0x2ea302;});});}})[_0xa120('0x24')](respondWithResult(_0x40e1a7,null))[_0xa120('0x47')](handleError(_0x40e1a7,null));};exports[_0xa120('0x81')]=function(_0x18c972,_0x1005ce,_0x441958){var _0x40d637={};var _0x3c0d33={};var _0x36fdcb;var _0xee6410;return db[_0xa120('0x2e')][_0xa120('0x55')]({'where':{'id':_0x18c972[_0xa120('0x49')]['id']}})[_0xa120('0x24')](handleEntityNotFound(_0x1005ce,null))[_0xa120('0x24')](function(_0xdf5091){if(_0xdf5091){_0x36fdcb=_0xdf5091;_0x3c0d33[_0xa120('0x35')]=_['keys'](db[_0xa120('0x65')][_0xa120('0x2f')]);_0x3c0d33[_0xa120('0x33')]=_[_0xa120('0x32')](_0x18c972[_0xa120('0x33')]);_0x3c0d33[_0xa120('0x3e')]=_[_0xa120('0x34')](_0x3c0d33[_0xa120('0x35')],_0x3c0d33[_0xa120('0x33')]);_0x40d637[_0xa120('0x36')]=_[_0xa120('0x34')](_0x3c0d33[_0xa120('0x35')],qs[_0xa120('0x37')](_0x18c972[_0xa120('0x33')][_0xa120('0x37')]));_0x40d637[_0xa120('0x36')]=_0x40d637[_0xa120('0x36')][_0xa120('0x56')]?_0x40d637['attributes']:_0x3c0d33[_0xa120('0x35')];_0x40d637[_0xa120('0x3b')]=qs[_0xa120('0x3c')](_0x18c972['query'][_0xa120('0x3c')]);_0x40d637[_0xa120('0x3d')]=qs['filters'](_[_0xa120('0x3f')](_0x18c972[_0xa120('0x33')],_0x3c0d33[_0xa120('0x3e')]));_0x40d637[_0xa120('0x3d')]=_['merge'](_0x40d637[_0xa120('0x3d')],{'$or':[{'ListId':_0xdf5091['id']},{'ListId':null}]});if(_0x18c972['query'][_0xa120('0x58')]){_0x40d637[_0xa120('0x3d')]=_[_0xa120('0x40')](_0x40d637[_0xa120('0x3d')],{'$or':_['map'](_0x40d637[_0xa120('0x36')],function(_0x47d41c){var _0x1f9b62={};_0x1f9b62[_0x47d41c]={'$like':'%'+_0x18c972[_0xa120('0x33')][_0xa120('0x58')]+'%'};return _0x1f9b62;})});}_0x40d637=_[_0xa120('0x40')]({},_0x40d637,_0x18c972[_0xa120('0x42')]);return db[_0xa120('0x65')][_0xa120('0x82')](_0x40d637);}})[_0xa120('0x24')](respondWithResult(_0x1005ce,null))[_0xa120('0x47')](handleError(_0x1005ce,null));};exports['addAgents']=function(_0x320a6b,_0x14c42a,_0x274c93){return db[_0xa120('0x2e')][_0xa120('0x4a')]({'where':{'id':_0x320a6b[_0xa120('0x49')]['id']}})[_0xa120('0x24')](handleEntityNotFound(_0x14c42a,null))['then'](function(_0x3d7bf8){if(_0x3d7bf8){return _0x3d7bf8['addAgents'](_0x320a6b[_0xa120('0x4c')][_0xa120('0x60')],_[_0xa120('0x5f')](_0x320a6b['body'],[_0xa120('0x60'),'id'])||{})[_0xa120('0x83')](function(_0x44d14c){for(var _0x4ddcef=0x0;_0x4ddcef<_0x320a6b[_0xa120('0x4c')]['ids'][_0xa120('0x56')];_0x4ddcef+=0x1){socket[_0xa120('0x84')](_0xa120('0x85'),{'UserId':_0x320a6b[_0xa120('0x4c')][_0xa120('0x60')][_0x4ddcef],'CmListId':_0x320a6b[_0xa120('0x49')]['id']});}return _0x44d14c;});}})[_0xa120('0x24')](respondWithResult(_0x14c42a,null))[_0xa120('0x47')](handleError(_0x14c42a,null));};exports[_0xa120('0x86')]=function(_0x1d8914,_0x47ce5d,_0x4076d4){return db[_0xa120('0x2e')][_0xa120('0x4a')]({'where':{'id':_0x1d8914['params']['id']}})['then'](handleEntityNotFound(_0x47ce5d,null))[_0xa120('0x24')](function(_0x456b73){if(_0x456b73){return _0x456b73[_0xa120('0x86')](_0x1d8914[_0xa120('0x33')][_0xa120('0x60')])[_0xa120('0x24')](function(){if(_[_0xa120('0x5c')](_0x1d8914[_0xa120('0x33')][_0xa120('0x60')])){for(var _0x23602b=0x0;_0x23602b<_0x1d8914[_0xa120('0x33')][_0xa120('0x60')][_0xa120('0x56')];_0x23602b+=0x1){socket[_0xa120('0x84')](_0xa120('0x87'),{'UserId':Number(_0x1d8914[_0xa120('0x33')][_0xa120('0x60')][_0x23602b]),'CmListId':Number(_0x1d8914[_0xa120('0x49')]['id'])});}}else{socket[_0xa120('0x84')]('userCmList:remove',{'UserId':Number(_0x1d8914[_0xa120('0x33')][_0xa120('0x60')]),'CmListId':Number(_0x1d8914['params']['id'])});}});}})[_0xa120('0x24')](respondWithStatusCode(_0x47ce5d,null))[_0xa120('0x47')](handleError(_0x47ce5d,null));};exports[_0xa120('0x88')]=function(_0x18fea1,_0x37d464,_0xe48a5){var _0x3f6c0c={};var _0x28401b={};var _0x16e2fb;var _0x5ce01e;return db[_0xa120('0x2e')]['findOne']({'where':{'id':_0x18fea1[_0xa120('0x49')]['id']}})[_0xa120('0x24')](handleEntityNotFound(_0x37d464,null))[_0xa120('0x24')](function(_0x251500){if(_0x251500){_0x16e2fb=_0x251500;_0x28401b['model']=_[_0xa120('0x32')](db[_0xa120('0x89')][_0xa120('0x2f')]);_0x28401b['query']=_[_0xa120('0x32')](_0x18fea1[_0xa120('0x33')]);_0x28401b[_0xa120('0x3e')]=_[_0xa120('0x34')](_0x28401b[_0xa120('0x35')],_0x28401b[_0xa120('0x33')]);_0x3f6c0c[_0xa120('0x36')]=_[_0xa120('0x34')](_0x28401b['model'],qs[_0xa120('0x37')](_0x18fea1[_0xa120('0x33')][_0xa120('0x37')]));_0x3f6c0c['attributes']=_0x3f6c0c[_0xa120('0x36')][_0xa120('0x56')]?_0x3f6c0c['attributes']:_0x28401b[_0xa120('0x35')];_0x3f6c0c[_0xa120('0x3b')]=qs[_0xa120('0x3c')](_0x18fea1[_0xa120('0x33')][_0xa120('0x3c')]);_0x3f6c0c[_0xa120('0x3d')]=qs['filters'](_[_0xa120('0x3f')](_0x18fea1[_0xa120('0x33')],_0x28401b['filters']));if(_0x18fea1['query'][_0xa120('0x58')]){_0x3f6c0c[_0xa120('0x3d')]=_[_0xa120('0x40')](_0x3f6c0c[_0xa120('0x3d')],{'$or':_[_0xa120('0x2d')](_0x3f6c0c[_0xa120('0x36')],function(_0x1f39b8){var _0x5332d1={};_0x5332d1[_0x1f39b8]={'$like':'%'+_0x18fea1['query']['filter']+'%'};return _0x5332d1;})});}_0x3f6c0c=_[_0xa120('0x40')]({},_0x3f6c0c,_0x18fea1[_0xa120('0x42')]);return _0x16e2fb[_0xa120('0x88')](_0x3f6c0c);}})['then'](function(_0x1ea573){if(_0x1ea573){_0x5ce01e=_0x1ea573['length'];if(!_0x18fea1[_0xa120('0x33')]['hasOwnProperty'](_0xa120('0x39'))){_0x3f6c0c[_0xa120('0x3a')]=qs[_0xa120('0x3a')](_0x18fea1['query'][_0xa120('0x3a')]);_0x3f6c0c[_0xa120('0x1e')]=qs['offset'](_0x18fea1['query'][_0xa120('0x1e')]);}return _0x16e2fb[_0xa120('0x88')](_0x3f6c0c);}})['then'](function(_0xe4fce4){if(_0xe4fce4){return _0xe4fce4?{'count':_0x5ce01e,'rows':_0xe4fce4}:null;}})[_0xa120('0x24')](respondWithResult(_0x37d464,null))[_0xa120('0x47')](handleError(_0x37d464,null));};
\ No newline at end of file
diff --git a/server/api/cmList/cmList.events.js b/server/api/cmList/cmList.events.js
index 59d3112..1bb6d9e 100644
--- a/server/api/cmList/cmList.events.js
+++ b/server/api/cmList/cmList.events.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x5fe5=['remove','emit','hook','events','CmList','setMaxListeners','update'];(function(_0xee207e,_0x298c1e){var _0x51ad4a=function(_0x58ff71){while(--_0x58ff71){_0xee207e['push'](_0xee207e['shift']());}};_0x51ad4a(++_0x298c1e);}(_0x5fe5,0x7a));var _0x55fe=function(_0x18afca,_0x4219d9){_0x18afca=_0x18afca-0x0;var _0x11603f=_0x5fe5[_0x18afca];return _0x11603f;};'use strict';var EventEmitter=require(_0x55fe('0x0'));var CmList=require('../../mysqldb')['db'][_0x55fe('0x1')];var CmListEvents=new EventEmitter();CmListEvents[_0x55fe('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x55fe('0x3'),'afterDestroy':_0x55fe('0x4')};function emitEvent(_0x40f478){return function(_0x37be29,_0x58e44c,_0x2972f9){CmListEvents[_0x55fe('0x5')](_0x40f478+':'+_0x37be29['id'],_0x37be29);CmListEvents[_0x55fe('0x5')](_0x40f478,_0x37be29);_0x2972f9(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];CmList[_0x55fe('0x6')](e,emitEvent(event));}}module['exports']=CmListEvents;
\ No newline at end of file
+var _0xb954=['CmList','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x1079b7,_0x563ef6){var _0x3e8309=function(_0x559bc4){while(--_0x559bc4){_0x1079b7['push'](_0x1079b7['shift']());}};_0x3e8309(++_0x563ef6);}(_0xb954,0x169));var _0x4b95=function(_0x4eb6dc,_0x3dc261){_0x4eb6dc=_0x4eb6dc-0x0;var _0x3068b4=_0xb954[_0x4eb6dc];return _0x3068b4;};'use strict';var EventEmitter=require(_0x4b95('0x0'));var CmList=require(_0x4b95('0x1'))['db'][_0x4b95('0x2')];var CmListEvents=new EventEmitter();CmListEvents[_0x4b95('0x3')](0x0);var events={'afterCreate':_0x4b95('0x4'),'afterUpdate':_0x4b95('0x5'),'afterDestroy':_0x4b95('0x6')};function emitEvent(_0x39a2c5){return function(_0x265273,_0x5b771e,_0x1cbd24){CmListEvents['emit'](_0x39a2c5+':'+_0x265273['id'],_0x265273);CmListEvents[_0x4b95('0x7')](_0x39a2c5,_0x265273);_0x1cbd24(null);};}for(var e in events){if(events[_0x4b95('0x8')](e)){var event=events[e];CmList[_0x4b95('0x9')](e,emitEvent(event));}}module[_0x4b95('0xa')]=CmListEvents;
\ No newline at end of file
diff --git a/server/api/cmList/cmList.model.js b/server/api/cmList/cmList.model.js
index 5062448..ae8ed89 100644
--- a/server/api/cmList/cmList.model.js
+++ b/server/api/cmList/cmList.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x96cc=['api','rimraf','./cmList.attributes','exports','define','CmList','lodash','../../config/logger'];(function(_0xb65e77,_0x238c3d){var _0x38134b=function(_0x39da21){while(--_0x39da21){_0xb65e77['push'](_0xb65e77['shift']());}};_0x38134b(++_0x238c3d);}(_0x96cc,0x146));var _0xc96c=function(_0x40dd56,_0x726ca5){_0x40dd56=_0x40dd56-0x0;var _0x4f850f=_0x96cc[_0x40dd56];return _0x4f850f;};'use strict';var _=require(_0xc96c('0x0'));var util=require('util');var logger=require(_0xc96c('0x1'))(_0xc96c('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xc96c('0x3'));var config=require('../../config/environment');var attributes=require(_0xc96c('0x4'));module[_0xc96c('0x5')]=function(_0x2e2f07,_0x3ad9d2){return _0x2e2f07[_0xc96c('0x6')](_0xc96c('0x7'),attributes,{'tableName':'cm_lists','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x35d8=['../../config/logger','moment','bluebird','request-promise','path','../../config/environment','./cmList.attributes','exports','define','CmList','cm_lists','lodash'];(function(_0x5eea00,_0x59bf6e){var _0xe049b5=function(_0x59840a){while(--_0x59840a){_0x5eea00['push'](_0x5eea00['shift']());}};_0xe049b5(++_0x59bf6e);}(_0x35d8,0x12b));var _0x835d=function(_0x4abb98,_0x21e2a8){_0x4abb98=_0x4abb98-0x0;var _0x2720c8=_0x35d8[_0x4abb98];return _0x2720c8;};'use strict';var _=require(_0x835d('0x0'));var util=require('util');var logger=require(_0x835d('0x1'))('api');var moment=require(_0x835d('0x2'));var BPromise=require(_0x835d('0x3'));var rp=require(_0x835d('0x4'));var fs=require('fs');var path=require(_0x835d('0x5'));var rimraf=require('rimraf');var config=require(_0x835d('0x6'));var attributes=require(_0x835d('0x7'));module[_0x835d('0x8')]=function(_0x462995,_0x2fcfb3){return _0x462995[_0x835d('0x9')](_0x835d('0xa'),attributes,{'tableName':_0x835d('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/cmList/cmList.rpc.js b/server/api/cmList/cmList.rpc.js
index 9a273a0..6910ae4 100644
--- a/server/api/cmList/cmList.rpc.js
+++ b/server/api/cmList/cmList.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x5363=['jayson/promise','client','redis','defaults','localhost','socket.io-emitter','request','then','CmList,\x20%s,\x20%s','debug','error','message','result','catch','lodash','moment','bluebird','randomstring','../../mysqldb','rpc'];(function(_0x2aa0e7,_0x4e5145){var _0x1472c0=function(_0x4deaeb){while(--_0x4deaeb){_0x2aa0e7['push'](_0x2aa0e7['shift']());}};_0x1472c0(++_0x4e5145);}(_0x5363,0xea));var _0x3536=function(_0x583d41,_0x4ba6fc){_0x583d41=_0x583d41-0x0;var _0x13037c=_0x5363[_0x583d41];return _0x13037c;};'use strict';var _=require(_0x3536('0x0'));var util=require('util');var moment=require(_0x3536('0x1'));var BPromise=require(_0x3536('0x2'));var rs=require(_0x3536('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3536('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x3536('0x5'));var config=require('../../config/environment');var jayson=require(_0x3536('0x6'));var client=jayson[_0x3536('0x7')]['http']({'port':0x232a});config[_0x3536('0x8')]=_[_0x3536('0x9')](config[_0x3536('0x8')],{'host':_0x3536('0xa'),'port':0x18eb});var socket=require(_0x3536('0xb'))(new Redis(config['redis']));require('./cmList.socket')['register'](socket);function respondWithRpcPromise(_0x2bf527,_0x52d642,_0x5dd6ca){return new BPromise(function(_0x1c74bb,_0x3523d7){return client[_0x3536('0xc')](_0x2bf527,_0x5dd6ca)[_0x3536('0xd')](function(_0x2a20b3){logger['info'](_0x3536('0xe'),_0x52d642,'request\x20sent');logger[_0x3536('0xf')]('CmList,\x20%s,\x20%s,\x20%s',_0x52d642,'request\x20sent',JSON['stringify'](_0x2a20b3));if(_0x2a20b3['error']){if(_0x2a20b3[_0x3536('0x10')]['code']===0x1f4){logger[_0x3536('0x10')](_0x3536('0xe'),_0x52d642,_0x2a20b3[_0x3536('0x10')][_0x3536('0x11')]);return _0x3523d7(_0x2a20b3[_0x3536('0x10')][_0x3536('0x11')]);}logger[_0x3536('0x10')](_0x3536('0xe'),_0x52d642,_0x2a20b3['error'][_0x3536('0x11')]);return _0x1c74bb(_0x2a20b3[_0x3536('0x10')][_0x3536('0x11')]);}else{logger['info'](_0x3536('0xe'),_0x52d642,'request\x20sent');_0x1c74bb(_0x2a20b3[_0x3536('0x12')][_0x3536('0x11')]);}})[_0x3536('0x13')](function(_0x466d3d){logger['error'](_0x3536('0xe'),_0x52d642,_0x466d3d);_0x3523d7(_0x466d3d);});});}
\ No newline at end of file
+var _0xb435=['stringify','error','message','result','catch','lodash','util','moment','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','defaults','localhost','redis','./cmList.socket','register','request','then','CmList,\x20%s,\x20%s','request\x20sent','debug','CmList,\x20%s,\x20%s,\x20%s'];(function(_0x2b0bc2,_0x4331f5){var _0x56e5b9=function(_0x4c1b06){while(--_0x4c1b06){_0x2b0bc2['push'](_0x2b0bc2['shift']());}};_0x56e5b9(++_0x4331f5);}(_0xb435,0x1d9));var _0x5b43=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xb435[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x5b43('0x0'));var util=require(_0x5b43('0x1'));var moment=require(_0x5b43('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5b43('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x5b43('0x4'));var logger=require('../../config/logger')(_0x5b43('0x5'));var config=require(_0x5b43('0x6'));var jayson=require(_0x5b43('0x7'));var client=jayson[_0x5b43('0x8')][_0x5b43('0x9')]({'port':0x232a});config['redis']=_[_0x5b43('0xa')](config['redis'],{'host':_0x5b43('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x5b43('0xc')]));require(_0x5b43('0xd'))[_0x5b43('0xe')](socket);function respondWithRpcPromise(_0x346454,_0x5dc73e,_0x1888b8){return new BPromise(function(_0x137575,_0x3444fb){return client[_0x5b43('0xf')](_0x346454,_0x1888b8)[_0x5b43('0x10')](function(_0x2a186b){logger['info'](_0x5b43('0x11'),_0x5dc73e,_0x5b43('0x12'));logger[_0x5b43('0x13')](_0x5b43('0x14'),_0x5dc73e,_0x5b43('0x12'),JSON[_0x5b43('0x15')](_0x2a186b));if(_0x2a186b['error']){if(_0x2a186b[_0x5b43('0x16')]['code']===0x1f4){logger[_0x5b43('0x16')]('CmList,\x20%s,\x20%s',_0x5dc73e,_0x2a186b['error'][_0x5b43('0x17')]);return _0x3444fb(_0x2a186b[_0x5b43('0x16')][_0x5b43('0x17')]);}logger[_0x5b43('0x16')]('CmList,\x20%s,\x20%s',_0x5dc73e,_0x2a186b[_0x5b43('0x16')][_0x5b43('0x17')]);return _0x137575(_0x2a186b[_0x5b43('0x16')]['message']);}else{logger['info']('CmList,\x20%s,\x20%s',_0x5dc73e,_0x5b43('0x12'));_0x137575(_0x2a186b[_0x5b43('0x18')][_0x5b43('0x17')]);}})[_0x5b43('0x19')](function(_0x4ca109){logger['error'](_0x5b43('0x11'),_0x5dc73e,_0x4ca109);_0x3444fb(_0x4ca109);});});}
\ No newline at end of file
diff --git a/server/api/cmList/cmList.socket.js b/server/api/cmList/cmList.socket.js
index 7d4992d..3d4a80c 100644
--- a/server/api/cmList/cmList.socket.js
+++ b/server/api/cmList/cmList.socket.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x2123=['./cmList.events','save','remove','update','emit','removeListener','register','length'];(function(_0x19c04e,_0x1fdfb9){var _0x5bdf27=function(_0x750e36){while(--_0x750e36){_0x19c04e['push'](_0x19c04e['shift']());}};_0x5bdf27(++_0x1fdfb9);}(_0x2123,0x190));var _0x3212=function(_0x28a289,_0x2638ed){_0x28a289=_0x28a289-0x0;var _0x1fe6a9=_0x2123[_0x28a289];return _0x1fe6a9;};'use strict';var CmListEvents=require(_0x3212('0x0'));var events=[_0x3212('0x1'),_0x3212('0x2'),_0x3212('0x3')];function createListener(_0x7158b8,_0x2ff863){return function(_0x8c047){_0x2ff863[_0x3212('0x4')](_0x7158b8,_0x8c047);};}function removeListener(_0x304f80,_0x6ca653){return function(){CmListEvents[_0x3212('0x5')](_0x304f80,_0x6ca653);};}exports[_0x3212('0x6')]=function(_0x5d9d36){for(var _0x3859e4=0x0,_0x2b1302=events[_0x3212('0x7')];_0x3859e4<_0x2b1302;_0x3859e4++){var _0x4b35e9=events[_0x3859e4];var _0x3e17a3=createListener('cmList:'+_0x4b35e9,_0x5d9d36);CmListEvents['on'](_0x4b35e9,_0x3e17a3);}};
\ No newline at end of file
+var _0x2cd0=['emit','removeListener','register','length','cmList:','./cmList.events','save'];(function(_0xc5a1a2,_0x49df81){var _0x5d3fe6=function(_0x3d443d){while(--_0x3d443d){_0xc5a1a2['push'](_0xc5a1a2['shift']());}};_0x5d3fe6(++_0x49df81);}(_0x2cd0,0x8a));var _0x02cd=function(_0x5d5799,_0xae2a5b){_0x5d5799=_0x5d5799-0x0;var _0x1b38a4=_0x2cd0[_0x5d5799];return _0x1b38a4;};'use strict';var CmListEvents=require(_0x02cd('0x0'));var events=[_0x02cd('0x1'),'remove','update'];function createListener(_0x22baca,_0x573434){return function(_0x55565b){_0x573434[_0x02cd('0x2')](_0x22baca,_0x55565b);};}function removeListener(_0x291580,_0x3fba37){return function(){CmListEvents[_0x02cd('0x3')](_0x291580,_0x3fba37);};}exports[_0x02cd('0x4')]=function(_0x35144b){for(var _0x222904=0x0,_0x178a25=events[_0x02cd('0x5')];_0x222904<_0x178a25;_0x222904++){var _0x21bbe0=events[_0x222904];var _0x5ccfd4=createListener(_0x02cd('0x6')+_0x21bbe0,_0x35144b);CmListEvents['on'](_0x21bbe0,_0x5ccfd4);}};
\ No newline at end of file
diff --git a/server/api/cmList/index.js b/server/api/cmList/index.js
index 0c1c6f0..c1b987a 100644
--- a/server/api/cmList/index.js
+++ b/server/api/cmList/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xc90d=['destroy','removeDispositions','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmList.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/dispositions','getDispositions','/:id/contacts','/:id/contacts/csv','getContactsCsv','/:id/users','getAgents','post','create','addDisposition','addContacts','addCustomField','addAgents','put','update','delete'];(function(_0xea8947,_0x1b573d){var _0x2455e9=function(_0x18771e){while(--_0x18771e){_0xea8947['push'](_0xea8947['shift']());}};_0x2455e9(++_0x1b573d);}(_0xc90d,0x134));var _0xdc90=function(_0x401ccd,_0x140815){_0x401ccd=_0x401ccd-0x0;var _0x5a57ad=_0xc90d[_0x401ccd];return _0x5a57ad;};'use strict';var multer=require(_0xdc90('0x0'));var util=require(_0xdc90('0x1'));var path=require(_0xdc90('0x2'));var timeout=require('connect-timeout');var express=require(_0xdc90('0x3'));var router=express[_0xdc90('0x4')]();var auth=require(_0xdc90('0x5'));var interaction=require(_0xdc90('0x6'));var config=require(_0xdc90('0x7'));var controller=require(_0xdc90('0x8'));router[_0xdc90('0x9')]('/',auth[_0xdc90('0xa')](),controller[_0xdc90('0xb')]);router[_0xdc90('0x9')](_0xdc90('0xc'),auth[_0xdc90('0xa')](),controller[_0xdc90('0xd')]);router[_0xdc90('0x9')](_0xdc90('0xe'),auth[_0xdc90('0xa')](),controller[_0xdc90('0xf')]);router[_0xdc90('0x9')](_0xdc90('0x10'),auth[_0xdc90('0xa')](),controller[_0xdc90('0x11')]);router[_0xdc90('0x9')](_0xdc90('0x12'),auth['isAuthenticated'](),controller['getContacts']);router[_0xdc90('0x9')](_0xdc90('0x13'),auth[_0xdc90('0xa')](),controller[_0xdc90('0x14')]);router['get']('/:id/fields',auth[_0xdc90('0xa')](),controller['getCustomFields']);router[_0xdc90('0x9')](_0xdc90('0x15'),auth[_0xdc90('0xa')](),controller[_0xdc90('0x16')]);router[_0xdc90('0x17')]('/',auth[_0xdc90('0xa')](),controller[_0xdc90('0x18')]);router['post'](_0xdc90('0x10'),auth[_0xdc90('0xa')](),controller[_0xdc90('0x19')]);router[_0xdc90('0x17')](_0xdc90('0x12'),auth['isAuthenticated'](),controller[_0xdc90('0x1a')]);router[_0xdc90('0x17')]('/:id/fields',auth[_0xdc90('0xa')](),controller[_0xdc90('0x1b')]);router[_0xdc90('0x17')](_0xdc90('0x15'),auth[_0xdc90('0xa')](),controller[_0xdc90('0x1c')]);router[_0xdc90('0x1d')](_0xdc90('0xe'),auth[_0xdc90('0xa')](),controller[_0xdc90('0x1e')]);router[_0xdc90('0x1f')](_0xdc90('0xe'),auth[_0xdc90('0xa')](),controller[_0xdc90('0x20')]);router['delete'](_0xdc90('0x10'),auth['isAuthenticated'](),controller[_0xdc90('0x21')]);router[_0xdc90('0x1f')](_0xdc90('0x15'),auth[_0xdc90('0xa')](),controller['removeAgents']);module['exports']=router;
\ No newline at end of file
+var _0xb6d4=['exports','multer','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./cmList.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/contacts','getContacts','getContactsCsv','getCustomFields','/:id/users','getAgents','post','/:id/dispositions','addDisposition','addContacts','/:id/fields','addCustomField','addAgents','put','update','delete','removeDispositions','removeAgents'];(function(_0x92924,_0x55d113){var _0x23b7aa=function(_0x4739b3){while(--_0x4739b3){_0x92924['push'](_0x92924['shift']());}};_0x23b7aa(++_0x55d113);}(_0xb6d4,0x16c));var _0x4b6d=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0xb6d4[_0x3bf83f];return _0x22c4a9;};'use strict';var multer=require(_0x4b6d('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x4b6d('0x1'));var express=require(_0x4b6d('0x2'));var router=express[_0x4b6d('0x3')]();var auth=require(_0x4b6d('0x4'));var interaction=require(_0x4b6d('0x5'));var config=require('../../config/environment');var controller=require(_0x4b6d('0x6'));router[_0x4b6d('0x7')]('/',auth[_0x4b6d('0x8')](),controller[_0x4b6d('0x9')]);router[_0x4b6d('0x7')](_0x4b6d('0xa'),auth[_0x4b6d('0x8')](),controller[_0x4b6d('0xb')]);router[_0x4b6d('0x7')](_0x4b6d('0xc'),auth[_0x4b6d('0x8')](),controller[_0x4b6d('0xd')]);router['get']('/:id/dispositions',auth['isAuthenticated'](),controller['getDispositions']);router[_0x4b6d('0x7')](_0x4b6d('0xe'),auth[_0x4b6d('0x8')](),controller[_0x4b6d('0xf')]);router[_0x4b6d('0x7')]('/:id/contacts/csv',auth['isAuthenticated'](),controller[_0x4b6d('0x10')]);router[_0x4b6d('0x7')]('/:id/fields',auth['isAuthenticated'](),controller[_0x4b6d('0x11')]);router[_0x4b6d('0x7')](_0x4b6d('0x12'),auth[_0x4b6d('0x8')](),controller[_0x4b6d('0x13')]);router[_0x4b6d('0x14')]('/',auth[_0x4b6d('0x8')](),controller['create']);router['post'](_0x4b6d('0x15'),auth[_0x4b6d('0x8')](),controller[_0x4b6d('0x16')]);router[_0x4b6d('0x14')](_0x4b6d('0xe'),auth['isAuthenticated'](),controller[_0x4b6d('0x17')]);router[_0x4b6d('0x14')](_0x4b6d('0x18'),auth[_0x4b6d('0x8')](),controller[_0x4b6d('0x19')]);router['post'](_0x4b6d('0x12'),auth[_0x4b6d('0x8')](),controller[_0x4b6d('0x1a')]);router[_0x4b6d('0x1b')]('/:id',auth[_0x4b6d('0x8')](),controller[_0x4b6d('0x1c')]);router['delete']('/:id',auth[_0x4b6d('0x8')](),controller['destroy']);router[_0x4b6d('0x1d')](_0x4b6d('0x15'),auth[_0x4b6d('0x8')](),controller[_0x4b6d('0x1e')]);router[_0x4b6d('0x1d')](_0x4b6d('0x12'),auth[_0x4b6d('0x8')](),controller[_0x4b6d('0x1f')]);module[_0x4b6d('0x20')]=router;
\ No newline at end of file
diff --git a/server/api/condition/condition.attributes.js b/server/api/condition/condition.attributes.js
index d4835a0..8e2ff79 100644
--- a/server/api/condition/condition.attributes.js
+++ b/server/api/condition/condition.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9957=['field','STRING','sequelize','exports','VIRTUAL'];(function(_0x59170c,_0xaf2219){var _0x1703fb=function(_0x4c74e5){while(--_0x4c74e5){_0x59170c['push'](_0x59170c['shift']());}};_0x1703fb(++_0xaf2219);}(_0x9957,0x93));var _0x7995=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x9957[_0x3b380d];return _0x54502b;};'use strict';var Sequelize=require(_0x7995('0x0'));module[_0x7995('0x1')]={'name':{'type':Sequelize[_0x7995('0x2')],'get':function(_0x10a05d){return this['getDataValue'](_0x7995('0x3'));}},'field':{'type':Sequelize[_0x7995('0x4')],'allowNull':![]},'operator':{'type':Sequelize[_0x7995('0x4')],'allowNull':![]},'value':{'type':Sequelize[_0x7995('0x4')],'allowNull':![]}};
\ No newline at end of file
+var _0xa9e0=['STRING','sequelize','exports','VIRTUAL','field'];(function(_0x3fd167,_0x948598){var _0x3d41e3=function(_0x45bb83){while(--_0x45bb83){_0x3fd167['push'](_0x3fd167['shift']());}};_0x3d41e3(++_0x948598);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1da04e,_0x31024b){_0x1da04e=_0x1da04e-0x0;var _0xdd8c41=_0xa9e0[_0x1da04e];return _0xdd8c41;};'use strict';var Sequelize=require(_0x0a9e('0x0'));module[_0x0a9e('0x1')]={'name':{'type':Sequelize[_0x0a9e('0x2')],'get':function(_0x5dd881){return this['getDataValue'](_0x0a9e('0x3'));}},'field':{'type':Sequelize['STRING'],'allowNull':![]},'operator':{'type':Sequelize[_0x0a9e('0x4')],'allowNull':![]},'value':{'type':Sequelize[_0x0a9e('0x4')],'allowNull':![]}};
\ No newline at end of file
diff --git a/server/api/condition/condition.controller.js b/server/api/condition/condition.controller.js
index 44e6c9c..82b5ba3 100644
--- a/server/api/condition/condition.controller.js
+++ b/server/api/condition/condition.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xcbda=['name','send','body','Condition','params','catch','html-pdf','eml-format','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','destroy','then','stack'];(function(_0x5ada82,_0x47fa19){var _0x595c90=function(_0x265a3b){while(--_0x265a3b){_0x5ada82['push'](_0x5ada82['shift']());}};_0x595c90(++_0x47fa19);}(_0xcbda,0x10e));var _0xacbd=function(_0x29b729,_0x30f838){_0x29b729=_0x29b729-0x0;var _0x3d2aad=_0xcbda[_0x29b729];return _0x3d2aad;};'use strict';var pdf=require(_0xacbd('0x0'));var emlformat=require(_0xacbd('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xacbd('0x2'));var rp=require(_0xacbd('0x3'));var moment=require('moment');var BPromise=require(_0xacbd('0x4'));var Mustache=require(_0xacbd('0x5'));var util=require(_0xacbd('0x6'));var path=require('path');var sox=require(_0xacbd('0x7'));var csv=require(_0xacbd('0x8'));var ejs=require(_0xacbd('0x9'));var fs=require('fs');var _=require(_0xacbd('0xa'));var squel=require(_0xacbd('0xb'));var crypto=require(_0xacbd('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xacbd('0x8'));var querystring=require(_0xacbd('0xd'));var Papa=require(_0xacbd('0xe'));var Redis=require(_0xacbd('0xf'));var authService=require(_0xacbd('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xacbd('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xacbd('0x12'))(_0xacbd('0x13'));var utils=require('../../config/utils');var config=require(_0xacbd('0x14'));var db=require(_0xacbd('0x15'))['db'];function respondWithStatusCode(_0x289c29,_0x49b52b){_0x49b52b=_0x49b52b||0xcc;return function(_0xe8db24){if(_0xe8db24){return _0x289c29[_0xacbd('0x16')](_0x49b52b);}return _0x289c29[_0xacbd('0x17')](_0x49b52b)[_0xacbd('0x18')]();};}function respondWithResult(_0x2c5947,_0x5dee25){_0x5dee25=_0x5dee25||0xc8;return function(_0x5888e0){if(_0x5888e0){return _0x2c5947['status'](_0x5dee25)[_0xacbd('0x19')](_0x5888e0);}};}function respondWithFilteredResult(_0x1a66b5,_0x4a5d58){return function(_0x4fae07){if(_0x4fae07){var _0x23fcbc=_0x4fae07[_0xacbd('0x1a')],_0x25a7b6=_0x4a5d58[_0xacbd('0x1b')],_0x30c2f9=_0x4a5d58[_0xacbd('0x1b')]+_0x4a5d58[_0xacbd('0x1c')],_0x39e409;if(_0x30c2f9>=_0x23fcbc){_0x30c2f9=_0x23fcbc;_0x39e409=0xc8;}else{_0x39e409=0xce;}_0x1a66b5[_0xacbd('0x17')](_0x39e409);return _0x1a66b5[_0xacbd('0x1d')](_0xacbd('0x1e'),_0x25a7b6+'-'+_0x30c2f9+'/'+_0x23fcbc)['json'](_0x4fae07);}return null;};}function patchUpdates(_0x499700){return function(_0x1ad404){try{jsonpatch[_0xacbd('0x1f')](_0x1ad404,_0x499700,!![]);}catch(_0x3cd542){return BPromise[_0xacbd('0x20')](_0x3cd542);}return _0x1ad404[_0xacbd('0x21')]();};}function saveUpdates(_0x51da53,_0x4d4fab){return function(_0x32e117){if(_0x32e117){return _0x32e117[_0xacbd('0x22')](_0x51da53)['then'](function(_0x41eefc){return _0x41eefc;});}return null;};}function removeEntity(_0x303172,_0x257437){return function(_0x285a0e){if(_0x285a0e){return _0x285a0e[_0xacbd('0x23')]()[_0xacbd('0x24')](function(){_0x303172[_0xacbd('0x17')](0xcc)[_0xacbd('0x18')]();});}};}function handleEntityNotFound(_0x587a6a,_0x3afff8){return function(_0x3624a4){if(!_0x3624a4){_0x587a6a['sendStatus'](0x194);}return _0x3624a4;};}function handleError(_0xd268ec,_0x49ae6d){_0x49ae6d=_0x49ae6d||0x1f4;return function(_0x220969){logger['error'](_0x220969[_0xacbd('0x25')]);if(_0x220969[_0xacbd('0x26')]){delete _0x220969['name'];}_0xd268ec[_0xacbd('0x17')](_0x49ae6d)[_0xacbd('0x27')](_0x220969);};}exports[_0xacbd('0x22')]=function(_0x2a071a,_0x3847f5){if(_0x2a071a[_0xacbd('0x28')]['id']){delete _0x2a071a[_0xacbd('0x28')]['id'];}return db[_0xacbd('0x29')]['find']({'where':{'id':_0x2a071a[_0xacbd('0x2a')]['id']}})['then'](handleEntityNotFound(_0x3847f5,null))[_0xacbd('0x24')](saveUpdates(_0x2a071a[_0xacbd('0x28')],null))[_0xacbd('0x24')](respondWithResult(_0x3847f5,null))[_0xacbd('0x2b')](handleError(_0x3847f5,null));};exports['destroy']=function(_0x170b5c,_0x5445ab){return db[_0xacbd('0x29')]['find']({'where':{'id':_0x170b5c[_0xacbd('0x2a')]['id']}})['then'](handleEntityNotFound(_0x5445ab,null))[_0xacbd('0x24')](removeEntity(_0x5445ab,null))[_0xacbd('0x2b')](handleError(_0x5445ab,null));};
\ No newline at end of file
+var _0x7e96=['zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','lodash','squel','crypto','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../mysqldb','sendStatus','status','end','json','offset','limit','set','Content-Range','update','then','destroy','name','send','body','Condition','find','params','catch','html-pdf','eml-format'];(function(_0x455c6c,_0x1e78b7){var _0x488242=function(_0x3e8fb0){while(--_0x3e8fb0){_0x455c6c['push'](_0x455c6c['shift']());}};_0x488242(++_0x1e78b7);}(_0x7e96,0x1c6));var _0x67e9=function(_0x4452a0,_0x10b371){_0x4452a0=_0x4452a0-0x0;var _0x579a04=_0x7e96[_0x4452a0];return _0x579a04;};'use strict';var pdf=require(_0x67e9('0x0'));var emlformat=require(_0x67e9('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x67e9('0x2'));var jsonpatch=require(_0x67e9('0x3'));var rp=require(_0x67e9('0x4'));var moment=require('moment');var BPromise=require(_0x67e9('0x5'));var Mustache=require(_0x67e9('0x6'));var util=require(_0x67e9('0x7'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x67e9('0x8'));var squel=require(_0x67e9('0x9'));var crypto=require(_0x67e9('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x67e9('0xb'));var querystring=require('querystring');var Papa=require(_0x67e9('0xc'));var Redis=require(_0x67e9('0xd'));var authService=require(_0x67e9('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x67e9('0xf'));var hardwareService=require(_0x67e9('0x10'));var logger=require(_0x67e9('0x11'))(_0x67e9('0x12'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x67e9('0x13'))['db'];function respondWithStatusCode(_0x1b8b11,_0x481001){_0x481001=_0x481001||0xcc;return function(_0x4cc7bd){if(_0x4cc7bd){return _0x1b8b11[_0x67e9('0x14')](_0x481001);}return _0x1b8b11[_0x67e9('0x15')](_0x481001)[_0x67e9('0x16')]();};}function respondWithResult(_0x416e42,_0x1c6474){_0x1c6474=_0x1c6474||0xc8;return function(_0x36a315){if(_0x36a315){return _0x416e42[_0x67e9('0x15')](_0x1c6474)[_0x67e9('0x17')](_0x36a315);}};}function respondWithFilteredResult(_0x2c280f,_0x1e3547){return function(_0x232434){if(_0x232434){var _0x19a226=_0x232434['count'],_0x199dea=_0x1e3547[_0x67e9('0x18')],_0x5461e8=_0x1e3547[_0x67e9('0x18')]+_0x1e3547[_0x67e9('0x19')],_0x57e7e1;if(_0x5461e8>=_0x19a226){_0x5461e8=_0x19a226;_0x57e7e1=0xc8;}else{_0x57e7e1=0xce;}_0x2c280f[_0x67e9('0x15')](_0x57e7e1);return _0x2c280f[_0x67e9('0x1a')](_0x67e9('0x1b'),_0x199dea+'-'+_0x5461e8+'/'+_0x19a226)[_0x67e9('0x17')](_0x232434);}return null;};}function patchUpdates(_0x4bff78){return function(_0x297a99){try{jsonpatch['apply'](_0x297a99,_0x4bff78,!![]);}catch(_0x529419){return BPromise['reject'](_0x529419);}return _0x297a99['save']();};}function saveUpdates(_0x3561da,_0x1a63f3){return function(_0x104453){if(_0x104453){return _0x104453[_0x67e9('0x1c')](_0x3561da)[_0x67e9('0x1d')](function(_0xb85f4b){return _0xb85f4b;});}return null;};}function removeEntity(_0x16449b,_0x4d82fd){return function(_0x547f0c){if(_0x547f0c){return _0x547f0c[_0x67e9('0x1e')]()[_0x67e9('0x1d')](function(){_0x16449b[_0x67e9('0x15')](0xcc)[_0x67e9('0x16')]();});}};}function handleEntityNotFound(_0x3c7b98,_0x671220){return function(_0x38cab7){if(!_0x38cab7){_0x3c7b98[_0x67e9('0x14')](0x194);}return _0x38cab7;};}function handleError(_0x5edcb1,_0x315a97){_0x315a97=_0x315a97||0x1f4;return function(_0x22f184){logger['error'](_0x22f184['stack']);if(_0x22f184['name']){delete _0x22f184[_0x67e9('0x1f')];}_0x5edcb1['status'](_0x315a97)[_0x67e9('0x20')](_0x22f184);};}exports[_0x67e9('0x1c')]=function(_0x193f33,_0x18776e){if(_0x193f33[_0x67e9('0x21')]['id']){delete _0x193f33[_0x67e9('0x21')]['id'];}return db[_0x67e9('0x22')][_0x67e9('0x23')]({'where':{'id':_0x193f33[_0x67e9('0x24')]['id']}})[_0x67e9('0x1d')](handleEntityNotFound(_0x18776e,null))['then'](saveUpdates(_0x193f33['body'],null))[_0x67e9('0x1d')](respondWithResult(_0x18776e,null))[_0x67e9('0x25')](handleError(_0x18776e,null));};exports[_0x67e9('0x1e')]=function(_0x5d63ff,_0x47c357){return db[_0x67e9('0x22')]['find']({'where':{'id':_0x5d63ff[_0x67e9('0x24')]['id']}})[_0x67e9('0x1d')](handleEntityNotFound(_0x47c357,null))[_0x67e9('0x1d')](removeEntity(_0x47c357,null))['catch'](handleError(_0x47c357,null));};
\ No newline at end of file
diff --git a/server/api/condition/condition.model.js b/server/api/condition/condition.model.js
index d54e480..811c34a 100644
--- a/server/api/condition/condition.model.js
+++ b/server/api/condition/condition.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xac79=['tools_conditions','lodash','../../config/logger','api','moment','bluebird','request-promise','rimraf','./condition.attributes','define'];(function(_0x728761,_0x4132a6){var _0xe26006=function(_0x388cae){while(--_0x388cae){_0x728761['push'](_0x728761['shift']());}};_0xe26006(++_0x4132a6);}(_0xac79,0xc9));var _0x9ac7=function(_0x42bd65,_0x52326b){_0x42bd65=_0x42bd65-0x0;var _0x279c12=_0xac79[_0x42bd65];return _0x279c12;};'use strict';var _=require(_0x9ac7('0x0'));var util=require('util');var logger=require(_0x9ac7('0x1'))(_0x9ac7('0x2'));var moment=require(_0x9ac7('0x3'));var BPromise=require(_0x9ac7('0x4'));var rp=require(_0x9ac7('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9ac7('0x6'));var config=require('../../config/environment');var attributes=require(_0x9ac7('0x7'));module['exports']=function(_0x2e164d,_0x276749){return _0x2e164d[_0x9ac7('0x8')]('Condition',attributes,{'tableName':_0x9ac7('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x0b7a=['request-promise','path','rimraf','../../config/environment','./condition.attributes','exports','define','tools_conditions','../../config/logger','bluebird'];(function(_0x1dc8a1,_0x43450b){var _0x4e663e=function(_0x3409de){while(--_0x3409de){_0x1dc8a1['push'](_0x1dc8a1['shift']());}};_0x4e663e(++_0x43450b);}(_0x0b7a,0xbc));var _0xa0b7=function(_0x1c8539,_0x107438){_0x1c8539=_0x1c8539-0x0;var _0x5d9716=_0x0b7a[_0x1c8539];return _0x5d9716;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xa0b7('0x0'))('api');var moment=require('moment');var BPromise=require(_0xa0b7('0x1'));var rp=require(_0xa0b7('0x2'));var fs=require('fs');var path=require(_0xa0b7('0x3'));var rimraf=require(_0xa0b7('0x4'));var config=require(_0xa0b7('0x5'));var attributes=require(_0xa0b7('0x6'));module[_0xa0b7('0x7')]=function(_0x5f4e88,_0x1457d0){return _0x5f4e88[_0xa0b7('0x8')]('Condition',attributes,{'tableName':_0xa0b7('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/condition/condition.rpc.js b/server/api/condition/condition.rpc.js
index 3716f50..e24cea1 100644
--- a/server/api/condition/condition.rpc.js
+++ b/server/api/condition/condition.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xa51b=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','info','Condition,\x20%s,\x20%s','debug','Condition,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0xa51b,0xb1));var _0xba51=function(_0x3c5cc7,_0x447374){_0x3c5cc7=_0x3c5cc7-0x0;var _0x2aef2a=_0xa51b[_0x3c5cc7];return _0x2aef2a;};'use strict';var _=require(_0xba51('0x0'));var util=require(_0xba51('0x1'));var moment=require('moment');var BPromise=require(_0xba51('0x2'));var rs=require(_0xba51('0x3'));var fs=require('fs');var Redis=require(_0xba51('0x4'));var db=require(_0xba51('0x5'))['db'];var utils=require(_0xba51('0x6'));var logger=require(_0xba51('0x7'))(_0xba51('0x8'));var config=require(_0xba51('0x9'));var jayson=require(_0xba51('0xa'));var client=jayson[_0xba51('0xb')][_0xba51('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x57b6a3,_0x1b4812,_0x199a67){return new BPromise(function(_0x18078b,_0x4284c3){return client['request'](_0x57b6a3,_0x199a67)['then'](function(_0x2e5119){logger[_0xba51('0xd')](_0xba51('0xe'),_0x1b4812,'request\x20sent');logger[_0xba51('0xf')](_0xba51('0x10'),_0x1b4812,_0xba51('0x11'),JSON[_0xba51('0x12')](_0x2e5119));if(_0x2e5119[_0xba51('0x13')]){if(_0x2e5119[_0xba51('0x13')]['code']===0x1f4){logger[_0xba51('0x13')](_0xba51('0xe'),_0x1b4812,_0x2e5119[_0xba51('0x13')]['message']);return _0x4284c3(_0x2e5119['error'][_0xba51('0x14')]);}logger[_0xba51('0x13')](_0xba51('0xe'),_0x1b4812,_0x2e5119['error']['message']);return _0x18078b(_0x2e5119[_0xba51('0x13')][_0xba51('0x14')]);}else{logger[_0xba51('0xd')]('Condition,\x20%s,\x20%s',_0x1b4812,_0xba51('0x11'));_0x18078b(_0x2e5119[_0xba51('0x15')]['message']);}})[_0xba51('0x16')](function(_0x1d6971){logger[_0xba51('0x13')](_0xba51('0xe'),_0x1b4812,_0x1d6971);_0x4284c3(_0x1d6971);});});}
\ No newline at end of file
+var _0xadca=['lodash','util','moment','randomstring','../../mysqldb','../../config/logger','rpc','client','http','request','then','info','Condition,\x20%s,\x20%s','debug','Condition,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','result'];(function(_0x4cc3e0,_0x1f07b7){var _0x2a0776=function(_0x4926e4){while(--_0x4926e4){_0x4cc3e0['push'](_0x4cc3e0['shift']());}};_0x2a0776(++_0x1f07b7);}(_0xadca,0x72));var _0xaadc=function(_0x31d707,_0x733c2b){_0x31d707=_0x31d707-0x0;var _0x3ff20d=_0xadca[_0x31d707];return _0x3ff20d;};'use strict';var _=require(_0xaadc('0x0'));var util=require(_0xaadc('0x1'));var moment=require(_0xaadc('0x2'));var BPromise=require('bluebird');var rs=require(_0xaadc('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xaadc('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xaadc('0x5'))(_0xaadc('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xaadc('0x7')][_0xaadc('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2195a8,_0x24848f,_0x48981b){return new BPromise(function(_0x25c030,_0x75bf22){return client[_0xaadc('0x9')](_0x2195a8,_0x48981b)[_0xaadc('0xa')](function(_0x529a54){logger[_0xaadc('0xb')](_0xaadc('0xc'),_0x24848f,'request\x20sent');logger[_0xaadc('0xd')](_0xaadc('0xe'),_0x24848f,_0xaadc('0xf'),JSON['stringify'](_0x529a54));if(_0x529a54['error']){if(_0x529a54[_0xaadc('0x10')]['code']===0x1f4){logger[_0xaadc('0x10')]('Condition,\x20%s,\x20%s',_0x24848f,_0x529a54[_0xaadc('0x10')]['message']);return _0x75bf22(_0x529a54[_0xaadc('0x10')][_0xaadc('0x11')]);}logger[_0xaadc('0x10')](_0xaadc('0xc'),_0x24848f,_0x529a54['error']['message']);return _0x25c030(_0x529a54['error'][_0xaadc('0x11')]);}else{logger[_0xaadc('0xb')]('Condition,\x20%s,\x20%s',_0x24848f,_0xaadc('0xf'));_0x25c030(_0x529a54[_0xaadc('0x12')][_0xaadc('0x11')]);}})['catch'](function(_0x58308d){logger['error']('Condition,\x20%s,\x20%s',_0x24848f,_0x58308d);_0x75bf22(_0x58308d);});});}
\ No newline at end of file
diff --git a/server/api/condition/index.js b/server/api/condition/index.js
index 71fa9bd..3dc7b94 100644
--- a/server/api/condition/index.js
+++ b/server/api/condition/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x6546=['/:id','isAuthenticated','delete','destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','put'];(function(_0x1919ba,_0x1d9c12){var _0x30c9ca=function(_0x2c3c52){while(--_0x2c3c52){_0x1919ba['push'](_0x1919ba['shift']());}};_0x30c9ca(++_0x1d9c12);}(_0x6546,0x1e6));var _0x6654=function(_0x1fc75d,_0x41cb7d){_0x1fc75d=_0x1fc75d-0x0;var _0x10a48d=_0x6546[_0x1fc75d];return _0x10a48d;};'use strict';var multer=require(_0x6654('0x0'));var util=require('util');var path=require(_0x6654('0x1'));var timeout=require(_0x6654('0x2'));var express=require(_0x6654('0x3'));var router=express[_0x6654('0x4')]();var auth=require(_0x6654('0x5'));var interaction=require(_0x6654('0x6'));var config=require('../../config/environment');var controller=require('./condition.controller');router[_0x6654('0x7')](_0x6654('0x8'),auth[_0x6654('0x9')](),controller['update']);router[_0x6654('0xa')]('/:id',auth[_0x6654('0x9')](),controller[_0x6654('0xb')]);module[_0x6654('0xc')]=router;
\ No newline at end of file
+var _0xe8e5=['put','/:id','isAuthenticated','update','delete','destroy','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./condition.controller'];(function(_0xc8c031,_0x22cf1a){var _0x5ed7ed=function(_0x5be705){while(--_0x5be705){_0xc8c031['push'](_0xc8c031['shift']());}};_0x5ed7ed(++_0x22cf1a);}(_0xe8e5,0x172));var _0x5e8e=function(_0x3dcd06,_0x2f21d6){_0x3dcd06=_0x3dcd06-0x0;var _0x1a3bde=_0xe8e5[_0x3dcd06];return _0x1a3bde;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x5e8e('0x0'));var timeout=require(_0x5e8e('0x1'));var express=require(_0x5e8e('0x2'));var router=express[_0x5e8e('0x3')]();var auth=require(_0x5e8e('0x4'));var interaction=require(_0x5e8e('0x5'));var config=require(_0x5e8e('0x6'));var controller=require(_0x5e8e('0x7'));router[_0x5e8e('0x8')](_0x5e8e('0x9'),auth[_0x5e8e('0xa')](),controller[_0x5e8e('0xb')]);router[_0x5e8e('0xc')](_0x5e8e('0x9'),auth[_0x5e8e('0xa')](),controller[_0x5e8e('0xd')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/contactItemType/contactItemType.attributes.js b/server/api/contactItemType/contactItemType.attributes.js
index ad45d66..68b8d09 100644
--- a/server/api/contactItemType/contactItemType.attributes.js
+++ b/server/api/contactItemType/contactItemType.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x34f8=['STRING','name','INTEGER','sequelize','exports'];(function(_0xbb24d7,_0x702a5d){var _0x2d38b0=function(_0x19a998){while(--_0x19a998){_0xbb24d7['push'](_0xbb24d7['shift']());}};_0x2d38b0(++_0x702a5d);}(_0x34f8,0x80));var _0x834f=function(_0x4dd1d9,_0x37c23d){_0x4dd1d9=_0x4dd1d9-0x0;var _0x20e38b=_0x34f8[_0x4dd1d9];return _0x20e38b;};'use strict';var Sequelize=require(_0x834f('0x0'));module[_0x834f('0x1')]={'name':{'type':Sequelize[_0x834f('0x2')],'allowNull':![],'unique':_0x834f('0x3')},'OrderBy':{'type':Sequelize[_0x834f('0x4')],'allowNull':!![]},'rgbBackgroundColor':{'type':Sequelize['STRING'],'allowNull':!![]}};
\ No newline at end of file
+var _0x34e8=['sequelize','exports','STRING','name'];(function(_0x2d41ee,_0x4ea538){var _0x4efdd7=function(_0x5b707d){while(--_0x5b707d){_0x2d41ee['push'](_0x2d41ee['shift']());}};_0x4efdd7(++_0x4ea538);}(_0x34e8,0x12c));var _0x834e=function(_0x37ca0e,_0x1e908c){_0x37ca0e=_0x37ca0e-0x0;var _0x350345=_0x34e8[_0x37ca0e];return _0x350345;};'use strict';var Sequelize=require(_0x834e('0x0'));module[_0x834e('0x1')]={'name':{'type':Sequelize[_0x834e('0x2')],'allowNull':![],'unique':_0x834e('0x3')},'OrderBy':{'type':Sequelize['INTEGER'],'allowNull':!![]},'rgbBackgroundColor':{'type':Sequelize[_0x834e('0x2')],'allowNull':!![]}};
\ No newline at end of file
diff --git a/server/api/contactItemType/contactItemType.controller.js b/server/api/contactItemType/contactItemType.controller.js
index 5f244e7..112f320 100644
--- a/server/api/contactItemType/contactItemType.controller.js
+++ b/server/api/contactItemType/contactItemType.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x4b84=['fast-json-patch','bluebird','mustache','util','ejs','squel','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','end','count','offset','limit','set','Content-Range','reject','save','update','then','get','ContactItemTypes','destroy','status','stack','name','send','index','ContactItemType','rawAttributes','fieldName','type','key','model','map','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','params','find','create','body','user','role','UserProfileSection','userProfileId','UserProfileResource','error','html-pdf','eml-format'];(function(_0x378d80,_0x30c95a){var _0x52b0ba=function(_0x3864a2){while(--_0x3864a2){_0x378d80['push'](_0x378d80['shift']());}};_0x52b0ba(++_0x30c95a);}(_0x4b84,0x1cc));var _0x44b8=function(_0x52b24f,_0xca062d){_0x52b24f=_0x52b24f-0x0;var _0x46ea6b=_0x4b84[_0x52b24f];return _0x46ea6b;};'use strict';var pdf=require(_0x44b8('0x0'));var emlformat=require(_0x44b8('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x44b8('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x44b8('0x3'));var Mustache=require(_0x44b8('0x4'));var util=require(_0x44b8('0x5'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x44b8('0x6'));var fs=require('fs');var _=require('lodash');var squel=require(_0x44b8('0x7'));var crypto=require('crypto');var jsforce=require(_0x44b8('0x8'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x44b8('0x9'));var Papa=require(_0x44b8('0xa'));var Redis=require(_0x44b8('0xb'));var authService=require('../../components/auth/service');var qs=require(_0x44b8('0xc'));var as=require(_0x44b8('0xd'));var hardwareService=require(_0x44b8('0xe'));var logger=require(_0x44b8('0xf'))(_0x44b8('0x10'));var utils=require(_0x44b8('0x11'));var config=require(_0x44b8('0x12'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x147529,_0x4301a6){_0x4301a6=_0x4301a6||0xcc;return function(_0x4bcc43){if(_0x4bcc43){return _0x147529[_0x44b8('0x13')](_0x4301a6);}return _0x147529['status'](_0x4301a6)[_0x44b8('0x14')]();};}function respondWithResult(_0x18d642,_0x4df670){_0x4df670=_0x4df670||0xc8;return function(_0x63e8f6){if(_0x63e8f6){return _0x18d642['status'](_0x4df670)['json'](_0x63e8f6);}};}function respondWithFilteredResult(_0x2a3e4c,_0x2af0ad){return function(_0x1722da){if(_0x1722da){var _0x41ab46=_0x1722da[_0x44b8('0x15')],_0x5e52f2=_0x2af0ad['offset'],_0x495c74=_0x2af0ad[_0x44b8('0x16')]+_0x2af0ad[_0x44b8('0x17')],_0x5d6349;if(_0x495c74>=_0x41ab46){_0x495c74=_0x41ab46;_0x5d6349=0xc8;}else{_0x5d6349=0xce;}_0x2a3e4c['status'](_0x5d6349);return _0x2a3e4c[_0x44b8('0x18')](_0x44b8('0x19'),_0x5e52f2+'-'+_0x495c74+'/'+_0x41ab46)['json'](_0x1722da);}return null;};}function patchUpdates(_0x89bc30){return function(_0x3f4688){try{jsonpatch['apply'](_0x3f4688,_0x89bc30,!![]);}catch(_0xcce202){return BPromise[_0x44b8('0x1a')](_0xcce202);}return _0x3f4688[_0x44b8('0x1b')]();};}function saveUpdates(_0x235bdc,_0x102ef9){return function(_0x369c09){if(_0x369c09){return _0x369c09[_0x44b8('0x1c')](_0x235bdc)[_0x44b8('0x1d')](function(_0x429461){return _0x429461;});}return null;};}function removeEntity(_0x1e0f2d,_0x1d642b){return function(_0x14996c){if(_0x14996c){return _0x14996c['destroy']()[_0x44b8('0x1d')](function(){var _0x3a8aa4=_0x14996c[_0x44b8('0x1e')]({'plain':!![]});var _0x1418db=_0x44b8('0x1f');return db['UserProfileResource'][_0x44b8('0x20')]({'where':{'type':_0x1418db,'resourceId':_0x3a8aa4['id']}})['then'](function(){return _0x14996c;});})[_0x44b8('0x1d')](function(){_0x1e0f2d[_0x44b8('0x21')](0xcc)[_0x44b8('0x14')]();});}};}function handleEntityNotFound(_0x47689e,_0x230a3d){return function(_0x59acbc){if(!_0x59acbc){_0x47689e[_0x44b8('0x13')](0x194);}return _0x59acbc;};}function handleError(_0x502acf,_0x41d673){_0x41d673=_0x41d673||0x1f4;return function(_0x350482){logger['error'](_0x350482[_0x44b8('0x22')]);if(_0x350482[_0x44b8('0x23')]){delete _0x350482[_0x44b8('0x23')];}_0x502acf['status'](_0x41d673)[_0x44b8('0x24')](_0x350482);};}exports[_0x44b8('0x25')]=function(_0x53d9c7,_0x2e0174){var _0x4a182d={},_0xfb0028={},_0x5a544c={'count':0x0,'rows':[]};var _0x559f0b=_['map'](db[_0x44b8('0x26')][_0x44b8('0x27')],function(_0x44ce5a){return{'name':_0x44ce5a[_0x44b8('0x28')],'type':_0x44ce5a[_0x44b8('0x29')][_0x44b8('0x2a')]};});_0xfb0028[_0x44b8('0x2b')]=_[_0x44b8('0x2c')](_0x559f0b,_0x44b8('0x23'));_0xfb0028[_0x44b8('0x2d')]=_[_0x44b8('0x2e')](_0x53d9c7[_0x44b8('0x2d')]);_0xfb0028[_0x44b8('0x2f')]=_['intersection'](_0xfb0028[_0x44b8('0x2b')],_0xfb0028['query']);_0x4a182d[_0x44b8('0x30')]=_[_0x44b8('0x31')](_0xfb0028[_0x44b8('0x2b')],qs[_0x44b8('0x32')](_0x53d9c7[_0x44b8('0x2d')]['fields']));_0x4a182d[_0x44b8('0x30')]=_0x4a182d[_0x44b8('0x30')][_0x44b8('0x33')]?_0x4a182d[_0x44b8('0x30')]:_0xfb0028[_0x44b8('0x2b')];if(!_0x53d9c7['query'][_0x44b8('0x34')](_0x44b8('0x35'))){_0x4a182d[_0x44b8('0x17')]=qs[_0x44b8('0x17')](_0x53d9c7[_0x44b8('0x2d')][_0x44b8('0x17')]);_0x4a182d[_0x44b8('0x16')]=qs[_0x44b8('0x16')](_0x53d9c7[_0x44b8('0x2d')][_0x44b8('0x16')]);}_0x4a182d[_0x44b8('0x36')]=qs[_0x44b8('0x37')](_0x53d9c7[_0x44b8('0x2d')][_0x44b8('0x37')]);_0x4a182d[_0x44b8('0x38')]=qs[_0x44b8('0x2f')](_[_0x44b8('0x39')](_0x53d9c7[_0x44b8('0x2d')],_0xfb0028[_0x44b8('0x2f')]),_0x559f0b);if(_0x53d9c7[_0x44b8('0x2d')][_0x44b8('0x3a')]){_0x4a182d[_0x44b8('0x38')]=_['merge'](_0x4a182d[_0x44b8('0x38')],{'$or':_[_0x44b8('0x2c')](_0x559f0b,function(_0x4fcfa0){if(_0x4fcfa0[_0x44b8('0x29')]!==_0x44b8('0x3b')){var _0x6658be={};_0x6658be[_0x4fcfa0[_0x44b8('0x23')]]={'$like':'%'+_0x53d9c7['query'][_0x44b8('0x3a')]+'%'};return _0x6658be;}})});}_0x4a182d=_[_0x44b8('0x3c')]({},_0x4a182d,_0x53d9c7[_0x44b8('0x3d')]);var _0x1ee3cc={'where':_0x4a182d[_0x44b8('0x38')]};return db[_0x44b8('0x26')][_0x44b8('0x15')](_0x1ee3cc)[_0x44b8('0x1d')](function(_0x209039){_0x5a544c[_0x44b8('0x15')]=_0x209039;if(_0x53d9c7[_0x44b8('0x2d')][_0x44b8('0x3e')]){_0x4a182d[_0x44b8('0x3f')]=[{'all':!![]}];}return db[_0x44b8('0x26')][_0x44b8('0x40')](_0x4a182d);})[_0x44b8('0x1d')](function(_0x57d8c4){_0x5a544c[_0x44b8('0x41')]=_0x57d8c4;return _0x5a544c;})[_0x44b8('0x1d')](respondWithFilteredResult(_0x2e0174,_0x4a182d))[_0x44b8('0x42')](handleError(_0x2e0174,null));};exports['show']=function(_0xd424f8,_0x1054c5){var _0x229cc9={'raw':!![],'where':{'id':_0xd424f8[_0x44b8('0x43')]['id']}},_0x585a16={};_0x585a16[_0x44b8('0x2b')]=_[_0x44b8('0x2e')](db[_0x44b8('0x26')][_0x44b8('0x27')]);_0x585a16['query']=_['keys'](_0xd424f8[_0x44b8('0x2d')]);_0x585a16[_0x44b8('0x2f')]=_[_0x44b8('0x31')](_0x585a16[_0x44b8('0x2b')],_0x585a16[_0x44b8('0x2d')]);_0x229cc9[_0x44b8('0x30')]=_[_0x44b8('0x31')](_0x585a16[_0x44b8('0x2b')],qs[_0x44b8('0x32')](_0xd424f8[_0x44b8('0x2d')][_0x44b8('0x32')]));_0x229cc9[_0x44b8('0x30')]=_0x229cc9[_0x44b8('0x30')][_0x44b8('0x33')]?_0x229cc9[_0x44b8('0x30')]:_0x585a16[_0x44b8('0x2b')];if(_0xd424f8[_0x44b8('0x2d')][_0x44b8('0x3e')]){_0x229cc9[_0x44b8('0x3f')]=[{'all':!![]}];}_0x229cc9=_['merge']({},_0x229cc9,_0xd424f8['options']);return db[_0x44b8('0x26')][_0x44b8('0x44')](_0x229cc9)[_0x44b8('0x1d')](handleEntityNotFound(_0x1054c5,null))[_0x44b8('0x1d')](respondWithResult(_0x1054c5,null))[_0x44b8('0x42')](handleError(_0x1054c5,null));};exports[_0x44b8('0x45')]=function(_0x411ed6,_0x4fe73f){return db[_0x44b8('0x26')]['create'](_0x411ed6[_0x44b8('0x46')],{})[_0x44b8('0x1d')](function(_0x1dbc28){var _0x9207bf=_0x411ed6[_0x44b8('0x47')][_0x44b8('0x1e')]({'plain':!![]});if(!_0x9207bf)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x9207bf[_0x44b8('0x48')]===_0x44b8('0x47')){var _0x10602c=_0x1dbc28[_0x44b8('0x1e')]({'plain':!![]});var _0x4ccc77=_0x44b8('0x1f');return db[_0x44b8('0x49')][_0x44b8('0x44')]({'where':{'name':_0x4ccc77,'userProfileId':_0x9207bf[_0x44b8('0x4a')]},'raw':!![]})[_0x44b8('0x1d')](function(_0x470ebb){if(_0x470ebb&&_0x470ebb['autoAssociation']===0x0){return db[_0x44b8('0x4b')][_0x44b8('0x45')]({'name':_0x10602c[_0x44b8('0x23')],'resourceId':_0x10602c['id'],'type':_0x470ebb[_0x44b8('0x23')],'sectionId':_0x470ebb['id']},{})[_0x44b8('0x1d')](function(){return _0x1dbc28;});}else{return _0x1dbc28;}})['catch'](function(_0x493840){logger[_0x44b8('0x4c')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x493840);throw _0x493840;});}return _0x1dbc28;})[_0x44b8('0x1d')](respondWithResult(_0x4fe73f,0xc9))['catch'](handleError(_0x4fe73f,null));};exports[_0x44b8('0x1c')]=function(_0x434d6a,_0x1a29f6){if(_0x434d6a[_0x44b8('0x46')]['id']){delete _0x434d6a[_0x44b8('0x46')]['id'];}return db[_0x44b8('0x26')][_0x44b8('0x44')]({'where':{'id':_0x434d6a['params']['id']}})[_0x44b8('0x1d')](handleEntityNotFound(_0x1a29f6,null))[_0x44b8('0x1d')](saveUpdates(_0x434d6a[_0x44b8('0x46')],null))['then'](respondWithResult(_0x1a29f6,null))[_0x44b8('0x42')](handleError(_0x1a29f6,null));};exports[_0x44b8('0x20')]=function(_0x45f9a0,_0x2b256b){return db['ContactItemType'][_0x44b8('0x44')]({'where':{'id':_0x45f9a0[_0x44b8('0x43')]['id']}})['then'](handleEntityNotFound(_0x2b256b,null))[_0x44b8('0x1d')](removeEntity(_0x2b256b,null))[_0x44b8('0x42')](handleError(_0x2b256b,null));};
\ No newline at end of file
+var _0x8ef6=['crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','json','offset','set','apply','reject','save','update','get','ContactItemTypes','UserProfileResource','destroy','then','end','error','stack','send','index','map','ContactItemType','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','nolimit','limit','order','sort','where','pick','filter','merge','type','VIRTUAL','name','options','count','includeAll','include','findAll','rows','catch','show','params','length','find','create','body','user','UserProfileSection','userProfileId','autoAssociation','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','lodash','squel'];(function(_0x4f4e4b,_0x46ea73){var _0x23a628=function(_0x56791){while(--_0x56791){_0x4f4e4b['push'](_0x4f4e4b['shift']());}};_0x23a628(++_0x46ea73);}(_0x8ef6,0xf2));var _0x68ef=function(_0x2d37a1,_0x1c3284){_0x2d37a1=_0x2d37a1-0x0;var _0x22c6be=_0x8ef6[_0x2d37a1];return _0x22c6be;};'use strict';var pdf=require(_0x68ef('0x0'));var emlformat=require(_0x68ef('0x1'));var rimraf=require(_0x68ef('0x2'));var zipdir=require(_0x68ef('0x3'));var jsonpatch=require(_0x68ef('0x4'));var rp=require(_0x68ef('0x5'));var moment=require(_0x68ef('0x6'));var BPromise=require('bluebird');var Mustache=require(_0x68ef('0x7'));var util=require(_0x68ef('0x8'));var path=require(_0x68ef('0x9'));var sox=require(_0x68ef('0xa'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x68ef('0xb'));var squel=require(_0x68ef('0xc'));var crypto=require(_0x68ef('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x68ef('0xe'));var toCsv=require(_0x68ef('0xf'));var querystring=require(_0x68ef('0x10'));var Papa=require(_0x68ef('0x11'));var Redis=require(_0x68ef('0x12'));var authService=require(_0x68ef('0x13'));var qs=require(_0x68ef('0x14'));var as=require(_0x68ef('0x15'));var hardwareService=require(_0x68ef('0x16'));var logger=require(_0x68ef('0x17'))(_0x68ef('0x18'));var utils=require(_0x68ef('0x19'));var config=require('../../config/environment');var db=require(_0x68ef('0x1a'))['db'];function respondWithStatusCode(_0x46356f,_0x1e117a){_0x1e117a=_0x1e117a||0xcc;return function(_0x454ef4){if(_0x454ef4){return _0x46356f[_0x68ef('0x1b')](_0x1e117a);}return _0x46356f[_0x68ef('0x1c')](_0x1e117a)['end']();};}function respondWithResult(_0x3b48dd,_0xc50cce){_0xc50cce=_0xc50cce||0xc8;return function(_0x2657c5){if(_0x2657c5){return _0x3b48dd['status'](_0xc50cce)[_0x68ef('0x1d')](_0x2657c5);}};}function respondWithFilteredResult(_0x1764de,_0x24682d){return function(_0x5005ba){if(_0x5005ba){var _0x35493d=_0x5005ba['count'],_0x37c4cc=_0x24682d[_0x68ef('0x1e')],_0x3d1e90=_0x24682d['offset']+_0x24682d['limit'],_0x3780a4;if(_0x3d1e90>=_0x35493d){_0x3d1e90=_0x35493d;_0x3780a4=0xc8;}else{_0x3780a4=0xce;}_0x1764de[_0x68ef('0x1c')](_0x3780a4);return _0x1764de[_0x68ef('0x1f')]('Content-Range',_0x37c4cc+'-'+_0x3d1e90+'/'+_0x35493d)['json'](_0x5005ba);}return null;};}function patchUpdates(_0x3c4c1f){return function(_0x2cd92c){try{jsonpatch[_0x68ef('0x20')](_0x2cd92c,_0x3c4c1f,!![]);}catch(_0x4fad1c){return BPromise[_0x68ef('0x21')](_0x4fad1c);}return _0x2cd92c[_0x68ef('0x22')]();};}function saveUpdates(_0x183f5f,_0x5b246b){return function(_0x3c46d4){if(_0x3c46d4){return _0x3c46d4[_0x68ef('0x23')](_0x183f5f)['then'](function(_0x399da4){return _0x399da4;});}return null;};}function removeEntity(_0xf4760f,_0x19aa3d){return function(_0x5ddec7){if(_0x5ddec7){return _0x5ddec7['destroy']()['then'](function(){var _0x26018d=_0x5ddec7[_0x68ef('0x24')]({'plain':!![]});var _0x312cc9=_0x68ef('0x25');return db[_0x68ef('0x26')][_0x68ef('0x27')]({'where':{'type':_0x312cc9,'resourceId':_0x26018d['id']}})[_0x68ef('0x28')](function(){return _0x5ddec7;});})[_0x68ef('0x28')](function(){_0xf4760f[_0x68ef('0x1c')](0xcc)[_0x68ef('0x29')]();});}};}function handleEntityNotFound(_0x5e4dbe,_0x178460){return function(_0x57f9ee){if(!_0x57f9ee){_0x5e4dbe['sendStatus'](0x194);}return _0x57f9ee;};}function handleError(_0x55d8b0,_0x1a7ce1){_0x1a7ce1=_0x1a7ce1||0x1f4;return function(_0x268f32){logger[_0x68ef('0x2a')](_0x268f32[_0x68ef('0x2b')]);if(_0x268f32['name']){delete _0x268f32['name'];}_0x55d8b0[_0x68ef('0x1c')](_0x1a7ce1)[_0x68ef('0x2c')](_0x268f32);};}exports[_0x68ef('0x2d')]=function(_0x263b30,_0x22ef25){var _0x201884={},_0x26288a={},_0x4579cb={'count':0x0,'rows':[]};var _0x5a6dfd=_[_0x68ef('0x2e')](db[_0x68ef('0x2f')][_0x68ef('0x30')],function(_0x4c25aa){return{'name':_0x4c25aa[_0x68ef('0x31')],'type':_0x4c25aa['type'][_0x68ef('0x32')]};});_0x26288a[_0x68ef('0x33')]=_['map'](_0x5a6dfd,'name');_0x26288a[_0x68ef('0x34')]=_[_0x68ef('0x35')](_0x263b30['query']);_0x26288a[_0x68ef('0x36')]=_[_0x68ef('0x37')](_0x26288a[_0x68ef('0x33')],_0x26288a[_0x68ef('0x34')]);_0x201884['attributes']=_[_0x68ef('0x37')](_0x26288a[_0x68ef('0x33')],qs['fields'](_0x263b30[_0x68ef('0x34')]['fields']));_0x201884[_0x68ef('0x38')]=_0x201884[_0x68ef('0x38')]['length']?_0x201884[_0x68ef('0x38')]:_0x26288a['model'];if(!_0x263b30[_0x68ef('0x34')]['hasOwnProperty'](_0x68ef('0x39'))){_0x201884[_0x68ef('0x3a')]=qs[_0x68ef('0x3a')](_0x263b30['query'][_0x68ef('0x3a')]);_0x201884['offset']=qs[_0x68ef('0x1e')](_0x263b30['query'][_0x68ef('0x1e')]);}_0x201884[_0x68ef('0x3b')]=qs[_0x68ef('0x3c')](_0x263b30[_0x68ef('0x34')][_0x68ef('0x3c')]);_0x201884[_0x68ef('0x3d')]=qs['filters'](_[_0x68ef('0x3e')](_0x263b30[_0x68ef('0x34')],_0x26288a[_0x68ef('0x36')]),_0x5a6dfd);if(_0x263b30['query'][_0x68ef('0x3f')]){_0x201884[_0x68ef('0x3d')]=_[_0x68ef('0x40')](_0x201884['where'],{'$or':_['map'](_0x5a6dfd,function(_0x14f0fc){if(_0x14f0fc[_0x68ef('0x41')]!==_0x68ef('0x42')){var _0x42fc8c={};_0x42fc8c[_0x14f0fc[_0x68ef('0x43')]]={'$like':'%'+_0x263b30[_0x68ef('0x34')][_0x68ef('0x3f')]+'%'};return _0x42fc8c;}})});}_0x201884=_['merge']({},_0x201884,_0x263b30[_0x68ef('0x44')]);var _0xd7f9ca={'where':_0x201884[_0x68ef('0x3d')]};return db[_0x68ef('0x2f')]['count'](_0xd7f9ca)[_0x68ef('0x28')](function(_0x3a2f53){_0x4579cb[_0x68ef('0x45')]=_0x3a2f53;if(_0x263b30[_0x68ef('0x34')][_0x68ef('0x46')]){_0x201884[_0x68ef('0x47')]=[{'all':!![]}];}return db['ContactItemType'][_0x68ef('0x48')](_0x201884);})[_0x68ef('0x28')](function(_0xf5010c){_0x4579cb[_0x68ef('0x49')]=_0xf5010c;return _0x4579cb;})[_0x68ef('0x28')](respondWithFilteredResult(_0x22ef25,_0x201884))[_0x68ef('0x4a')](handleError(_0x22ef25,null));};exports[_0x68ef('0x4b')]=function(_0xd6a0b5,_0xc687ab){var _0x531096={'raw':!![],'where':{'id':_0xd6a0b5[_0x68ef('0x4c')]['id']}},_0xad1a28={};_0xad1a28[_0x68ef('0x33')]=_[_0x68ef('0x35')](db[_0x68ef('0x2f')][_0x68ef('0x30')]);_0xad1a28[_0x68ef('0x34')]=_['keys'](_0xd6a0b5[_0x68ef('0x34')]);_0xad1a28['filters']=_[_0x68ef('0x37')](_0xad1a28[_0x68ef('0x33')],_0xad1a28[_0x68ef('0x34')]);_0x531096[_0x68ef('0x38')]=_['intersection'](_0xad1a28[_0x68ef('0x33')],qs['fields'](_0xd6a0b5[_0x68ef('0x34')]['fields']));_0x531096[_0x68ef('0x38')]=_0x531096[_0x68ef('0x38')][_0x68ef('0x4d')]?_0x531096['attributes']:_0xad1a28['model'];if(_0xd6a0b5[_0x68ef('0x34')][_0x68ef('0x46')]){_0x531096['include']=[{'all':!![]}];}_0x531096=_['merge']({},_0x531096,_0xd6a0b5['options']);return db[_0x68ef('0x2f')][_0x68ef('0x4e')](_0x531096)[_0x68ef('0x28')](handleEntityNotFound(_0xc687ab,null))[_0x68ef('0x28')](respondWithResult(_0xc687ab,null))[_0x68ef('0x4a')](handleError(_0xc687ab,null));};exports['create']=function(_0x55f385,_0xc39f5b){return db[_0x68ef('0x2f')][_0x68ef('0x4f')](_0x55f385[_0x68ef('0x50')],{})['then'](function(_0x810685){var _0x474e5a=_0x55f385[_0x68ef('0x51')][_0x68ef('0x24')]({'plain':!![]});if(!_0x474e5a)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x474e5a['role']===_0x68ef('0x51')){var _0x3c3074=_0x810685['get']({'plain':!![]});var _0xfc7a74=_0x68ef('0x25');return db[_0x68ef('0x52')][_0x68ef('0x4e')]({'where':{'name':_0xfc7a74,'userProfileId':_0x474e5a[_0x68ef('0x53')]},'raw':!![]})['then'](function(_0x35d6bd){if(_0x35d6bd&&_0x35d6bd[_0x68ef('0x54')]===0x0){return db[_0x68ef('0x26')]['create']({'name':_0x3c3074[_0x68ef('0x43')],'resourceId':_0x3c3074['id'],'type':_0x35d6bd[_0x68ef('0x43')],'sectionId':_0x35d6bd['id']},{})[_0x68ef('0x28')](function(){return _0x810685;});}else{return _0x810685;}})['catch'](function(_0x7dce90){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x7dce90);throw _0x7dce90;});}return _0x810685;})[_0x68ef('0x28')](respondWithResult(_0xc39f5b,0xc9))['catch'](handleError(_0xc39f5b,null));};exports[_0x68ef('0x23')]=function(_0xb33afd,_0x53ebd){if(_0xb33afd[_0x68ef('0x50')]['id']){delete _0xb33afd[_0x68ef('0x50')]['id'];}return db[_0x68ef('0x2f')][_0x68ef('0x4e')]({'where':{'id':_0xb33afd[_0x68ef('0x4c')]['id']}})[_0x68ef('0x28')](handleEntityNotFound(_0x53ebd,null))[_0x68ef('0x28')](saveUpdates(_0xb33afd['body'],null))['then'](respondWithResult(_0x53ebd,null))[_0x68ef('0x4a')](handleError(_0x53ebd,null));};exports[_0x68ef('0x27')]=function(_0x317b79,_0xdc83f4){return db[_0x68ef('0x2f')][_0x68ef('0x4e')]({'where':{'id':_0x317b79[_0x68ef('0x4c')]['id']}})[_0x68ef('0x28')](handleEntityNotFound(_0xdc83f4,null))[_0x68ef('0x28')](removeEntity(_0xdc83f4,null))['catch'](handleError(_0xdc83f4,null));};
\ No newline at end of file
diff --git a/server/api/contactItemType/contactItemType.model.js b/server/api/contactItemType/contactItemType.model.js
index b78af87..e5f6fcb 100644
--- a/server/api/contactItemType/contactItemType.model.js
+++ b/server/api/contactItemType/contactItemType.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xe5e0=['rimraf','../../config/environment','exports','define','tools_contact_item_types','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x4f6f79,_0x39299b){var _0x2a7f9a=function(_0x3e2547){while(--_0x3e2547){_0x4f6f79['push'](_0x4f6f79['shift']());}};_0x2a7f9a(++_0x39299b);}(_0xe5e0,0x123));var _0x0e5e=function(_0x545a6d,_0x4bab36){_0x545a6d=_0x545a6d-0x0;var _0x1aa192=_0xe5e0[_0x545a6d];return _0x1aa192;};'use strict';var _=require(_0x0e5e('0x0'));var util=require(_0x0e5e('0x1'));var logger=require(_0x0e5e('0x2'))(_0x0e5e('0x3'));var moment=require(_0x0e5e('0x4'));var BPromise=require(_0x0e5e('0x5'));var rp=require(_0x0e5e('0x6'));var fs=require('fs');var path=require(_0x0e5e('0x7'));var rimraf=require(_0x0e5e('0x8'));var config=require(_0x0e5e('0x9'));var attributes=require('./contactItemType.attributes');module[_0x0e5e('0xa')]=function(_0x39c487,_0x5cc97b){return _0x39c487[_0x0e5e('0xb')]('ContactItemType',attributes,{'tableName':_0x0e5e('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xb5bb=['tools_contact_item_types','lodash','util','../../config/logger','moment','bluebird','ContactItemType'];(function(_0x3d773f,_0x3462b3){var _0x22bf3a=function(_0x2d295e){while(--_0x2d295e){_0x3d773f['push'](_0x3d773f['shift']());}};_0x22bf3a(++_0x3462b3);}(_0xb5bb,0x1ba));var _0xbb5b=function(_0x1fff1f,_0x556462){_0x1fff1f=_0x1fff1f-0x0;var _0x50efb1=_0xb5bb[_0x1fff1f];return _0x50efb1;};'use strict';var _=require(_0xbb5b('0x0'));var util=require(_0xbb5b('0x1'));var logger=require(_0xbb5b('0x2'))('api');var moment=require(_0xbb5b('0x3'));var BPromise=require(_0xbb5b('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./contactItemType.attributes');module['exports']=function(_0x1c9622,_0x161047){return _0x1c9622['define'](_0xbb5b('0x5'),attributes,{'tableName':_0xbb5b('0x6'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/contactItemType/contactItemType.rpc.js b/server/api/contactItemType/contactItemType.rpc.js
index b506154..b79c823 100644
--- a/server/api/contactItemType/contactItemType.rpc.js
+++ b/server/api/contactItemType/contactItemType.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x41bb=['ContactItemType,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','then','info'];(function(_0x73a7e8,_0x114f8b){var _0x170204=function(_0x3c35d0){while(--_0x3c35d0){_0x73a7e8['push'](_0x73a7e8['shift']());}};_0x170204(++_0x114f8b);}(_0x41bb,0xc5));var _0xb41b=function(_0xcffa56,_0x24050e){_0xcffa56=_0xcffa56-0x0;var _0x279b03=_0x41bb[_0xcffa56];return _0x279b03;};'use strict';var _=require(_0xb41b('0x0'));var util=require(_0xb41b('0x1'));var moment=require('moment');var BPromise=require(_0xb41b('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb41b('0x3'));var db=require(_0xb41b('0x4'))['db'];var utils=require(_0xb41b('0x5'));var logger=require(_0xb41b('0x6'))('rpc');var config=require(_0xb41b('0x7'));var jayson=require(_0xb41b('0x8'));var client=jayson[_0xb41b('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5455ce,_0x497242,_0x2704f0){return new BPromise(function(_0x29c30d,_0x53722a){return client[_0xb41b('0xa')](_0x5455ce,_0x2704f0)[_0xb41b('0xb')](function(_0x11b8b2){logger[_0xb41b('0xc')](_0xb41b('0xd'),_0x497242,_0xb41b('0xe'));logger[_0xb41b('0xf')]('ContactItemType,\x20%s,\x20%s,\x20%s',_0x497242,_0xb41b('0xe'),JSON['stringify'](_0x11b8b2));if(_0x11b8b2[_0xb41b('0x10')]){if(_0x11b8b2[_0xb41b('0x10')][_0xb41b('0x11')]===0x1f4){logger[_0xb41b('0x10')](_0xb41b('0xd'),_0x497242,_0x11b8b2['error'][_0xb41b('0x12')]);return _0x53722a(_0x11b8b2[_0xb41b('0x10')][_0xb41b('0x12')]);}logger[_0xb41b('0x10')](_0xb41b('0xd'),_0x497242,_0x11b8b2['error']['message']);return _0x29c30d(_0x11b8b2['error'][_0xb41b('0x12')]);}else{logger[_0xb41b('0xc')](_0xb41b('0xd'),_0x497242,_0xb41b('0xe'));_0x29c30d(_0x11b8b2[_0xb41b('0x13')]['message']);}})[_0xb41b('0x14')](function(_0xd0b6b5){logger[_0xb41b('0x10')](_0xb41b('0xd'),_0x497242,_0xd0b6b5);_0x53722a(_0xd0b6b5);});});}
\ No newline at end of file
+var _0xe130=['ContactItemType,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','info'];(function(_0x56d33f,_0xc31fba){var _0x495730=function(_0x21fd64){while(--_0x21fd64){_0x56d33f['push'](_0x56d33f['shift']());}};_0x495730(++_0xc31fba);}(_0xe130,0x127));var _0x0e13=function(_0x324cd0,_0x11fe56){_0x324cd0=_0x324cd0-0x0;var _0x43d346=_0xe130[_0x324cd0];return _0x43d346;};'use strict';var _=require(_0x0e13('0x0'));var util=require(_0x0e13('0x1'));var moment=require('moment');var BPromise=require(_0x0e13('0x2'));var rs=require(_0x0e13('0x3'));var fs=require('fs');var Redis=require(_0x0e13('0x4'));var db=require(_0x0e13('0x5'))['db'];var utils=require(_0x0e13('0x6'));var logger=require('../../config/logger')(_0x0e13('0x7'));var config=require(_0x0e13('0x8'));var jayson=require(_0x0e13('0x9'));var client=jayson[_0x0e13('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1774a5,_0x5f0d09,_0x567031){return new BPromise(function(_0x5aaa22,_0x2faf49){return client[_0x0e13('0xb')](_0x1774a5,_0x567031)['then'](function(_0x5d066a){logger[_0x0e13('0xc')](_0x0e13('0xd'),_0x5f0d09,_0x0e13('0xe'));logger[_0x0e13('0xf')]('ContactItemType,\x20%s,\x20%s,\x20%s',_0x5f0d09,'request\x20sent',JSON[_0x0e13('0x10')](_0x5d066a));if(_0x5d066a[_0x0e13('0x11')]){if(_0x5d066a[_0x0e13('0x11')][_0x0e13('0x12')]===0x1f4){logger['error'](_0x0e13('0xd'),_0x5f0d09,_0x5d066a['error'][_0x0e13('0x13')]);return _0x2faf49(_0x5d066a[_0x0e13('0x11')][_0x0e13('0x13')]);}logger[_0x0e13('0x11')](_0x0e13('0xd'),_0x5f0d09,_0x5d066a[_0x0e13('0x11')][_0x0e13('0x13')]);return _0x5aaa22(_0x5d066a[_0x0e13('0x11')][_0x0e13('0x13')]);}else{logger['info'](_0x0e13('0xd'),_0x5f0d09,_0x0e13('0xe'));_0x5aaa22(_0x5d066a[_0x0e13('0x14')][_0x0e13('0x13')]);}})[_0x0e13('0x15')](function(_0x32f76a){logger['error'](_0x0e13('0xd'),_0x5f0d09,_0x32f76a);_0x2faf49(_0x32f76a);});});}
\ No newline at end of file
diff --git a/server/api/contactItemType/index.js b/server/api/contactItemType/index.js
index 656cf8d..49fb782 100644
--- a/server/api/contactItemType/index.js
+++ b/server/api/contactItemType/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xc0f4=['get','show','post','create','/:id','update','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','./contactItemType.controller','isAuthenticated'];(function(_0x58afd5,_0x534a48){var _0x3e503b=function(_0x27ba44){while(--_0x27ba44){_0x58afd5['push'](_0x58afd5['shift']());}};_0x3e503b(++_0x534a48);}(_0xc0f4,0xe5));var _0x4c0f=function(_0x3e2c08,_0x49ed2d){_0x3e2c08=_0x3e2c08-0x0;var _0x26d60e=_0xc0f4[_0x3e2c08];return _0x26d60e;};'use strict';var multer=require(_0x4c0f('0x0'));var util=require(_0x4c0f('0x1'));var path=require(_0x4c0f('0x2'));var timeout=require(_0x4c0f('0x3'));var express=require(_0x4c0f('0x4'));var router=express[_0x4c0f('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0x4c0f('0x6'));var config=require('../../config/environment');var controller=require(_0x4c0f('0x7'));router['get']('/',auth[_0x4c0f('0x8')](),controller['index']);router[_0x4c0f('0x9')]('/:id',auth[_0x4c0f('0x8')](),controller[_0x4c0f('0xa')]);router[_0x4c0f('0xb')]('/',auth[_0x4c0f('0x8')](),controller[_0x4c0f('0xc')]);router['put'](_0x4c0f('0xd'),auth[_0x4c0f('0x8')](),controller[_0x4c0f('0xe')]);router['delete'](_0x4c0f('0xd'),auth['isAuthenticated'](),controller[_0x4c0f('0xf')]);module[_0x4c0f('0x10')]=router;
\ No newline at end of file
+var _0x9fa8=['post','create','put','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./contactItemType.controller','get','isAuthenticated','index','/:id','show'];(function(_0x14f1f9,_0x353fe0){var _0x3b946a=function(_0xf63844){while(--_0xf63844){_0x14f1f9['push'](_0x14f1f9['shift']());}};_0x3b946a(++_0x353fe0);}(_0x9fa8,0x103));var _0x89fa=function(_0x239b66,_0x2cd713){_0x239b66=_0x239b66-0x0;var _0x48cf81=_0x9fa8[_0x239b66];return _0x48cf81;};'use strict';var multer=require(_0x89fa('0x0'));var util=require(_0x89fa('0x1'));var path=require('path');var timeout=require(_0x89fa('0x2'));var express=require(_0x89fa('0x3'));var router=express[_0x89fa('0x4')]();var auth=require(_0x89fa('0x5'));var interaction=require(_0x89fa('0x6'));var config=require(_0x89fa('0x7'));var controller=require(_0x89fa('0x8'));router[_0x89fa('0x9')]('/',auth[_0x89fa('0xa')](),controller[_0x89fa('0xb')]);router[_0x89fa('0x9')](_0x89fa('0xc'),auth[_0x89fa('0xa')](),controller[_0x89fa('0xd')]);router[_0x89fa('0xe')]('/',auth[_0x89fa('0xa')](),controller[_0x89fa('0xf')]);router[_0x89fa('0x10')](_0x89fa('0xc'),auth[_0x89fa('0xa')](),controller[_0x89fa('0x11')]);router[_0x89fa('0x12')]('/:id',auth[_0x89fa('0xa')](),controller[_0x89fa('0x13')]);module[_0x89fa('0x14')]=router;
\ No newline at end of file
diff --git a/server/api/dashboard/dashboard.attributes.js b/server/api/dashboard/dashboard.attributes.js
index cccaa65..4edbfa9 100644
--- a/server/api/dashboard/dashboard.attributes.js
+++ b/server/api/dashboard/dashboard.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x2494=['name','sequelize','STRING'];(function(_0x1a58fa,_0x4a947d){var _0x1f35ac=function(_0x46c001){while(--_0x46c001){_0x1a58fa['push'](_0x1a58fa['shift']());}};_0x1f35ac(++_0x4a947d);}(_0x2494,0x82));var _0x4249=function(_0x17823c,_0x165b9a){_0x17823c=_0x17823c-0x0;var _0x5105af=_0x2494[_0x17823c];return _0x5105af;};'use strict';var Sequelize=require(_0x4249('0x0'));module['exports']={'name':{'type':Sequelize[_0x4249('0x1')],'allowNull':![],'unique':_0x4249('0x2')},'description':{'type':Sequelize[_0x4249('0x1')]}};
\ No newline at end of file
+var _0xb30f=['name','sequelize','exports','STRING'];(function(_0x3bce02,_0x3f7d7a){var _0x306140=function(_0x3eb4ec){while(--_0x3eb4ec){_0x3bce02['push'](_0x3bce02['shift']());}};_0x306140(++_0x3f7d7a);}(_0xb30f,0x109));var _0xfb30=function(_0x56344e,_0x44e5b2){_0x56344e=_0x56344e-0x0;var _0x4bbea1=_0xb30f[_0x56344e];return _0x4bbea1;};'use strict';var Sequelize=require(_0xfb30('0x0'));module[_0xfb30('0x1')]={'name':{'type':Sequelize[_0xfb30('0x2')],'allowNull':![],'unique':_0xfb30('0x3')},'description':{'type':Sequelize[_0xfb30('0x2')]}};
\ No newline at end of file
diff --git a/server/api/dashboard/dashboard.controller.js b/server/api/dashboard/dashboard.controller.js
index 48c9a17..6b0805e 100644
--- a/server/api/dashboard/dashboard.controller.js
+++ b/server/api/dashboard/dashboard.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x6a2e=['where','pick','filter','VIRTUAL','merge','options','includeAll','findAll','rows','catch','show','rawAttributes','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','params','omit','updatedAt','createdAt','type','iframe','attrUrl','attrs','value','https://','custom','attrHourFormat','HH:mm:ss','attrTimezone','attrFontSize','counter','attrMetric','total','attrVoiceQueues','pie-chart','attrSerie1','attrSerie2','attrSerie3','web-report','attrReport','reportType','attrRefresh','widgetAttributes:\x20%s','stringify','addItem','DashboardId','DashboardItem','getItems','order','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','redis','socket.io-emitter','./dashboard.socket','register','sendStatus','end','status','json','count','offset','limit','Content-Range','apply','reject','save','update','then','destroy','get','CustomDashboards','UserProfileResource','error','stack','name','index','map','Dashboard','key','model','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','sort'];(function(_0x2f5ac5,_0x1ee939){var _0x37c9a8=function(_0x15031f){while(--_0x15031f){_0x2f5ac5['push'](_0x2f5ac5['shift']());}};_0x37c9a8(++_0x1ee939);}(_0x6a2e,0xb0));var _0xe6a2=function(_0x4a53dd,_0x48b733){_0x4a53dd=_0x4a53dd-0x0;var _0xa1579a=_0x6a2e[_0x4a53dd];return _0xa1579a;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0xe6a2('0x0'));var zipdir=require(_0xe6a2('0x1'));var jsonpatch=require(_0xe6a2('0x2'));var rp=require(_0xe6a2('0x3'));var moment=require(_0xe6a2('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xe6a2('0x5'));var util=require(_0xe6a2('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0xe6a2('0x7'));var ejs=require(_0xe6a2('0x8'));var fs=require('fs');var _=require(_0xe6a2('0x9'));var squel=require(_0xe6a2('0xa'));var crypto=require(_0xe6a2('0xb'));var jsforce=require(_0xe6a2('0xc'));var deskjs=require(_0xe6a2('0xd'));var toCsv=require(_0xe6a2('0x7'));var querystring=require(_0xe6a2('0xe'));var Papa=require(_0xe6a2('0xf'));var Redis=require(_0xe6a2('0x10'));var authService=require(_0xe6a2('0x11'));var qs=require(_0xe6a2('0x12'));var as=require(_0xe6a2('0x13'));var hardwareService=require(_0xe6a2('0x14'));var logger=require(_0xe6a2('0x15'))(_0xe6a2('0x16'));var utils=require(_0xe6a2('0x17'));var config=require('../../config/environment');var db=require(_0xe6a2('0x18'))['db'];config['redis']=_['defaults'](config[_0xe6a2('0x19')],{'host':'localhost','port':0x18eb});var socket=require(_0xe6a2('0x1a'))(new Redis(config['redis']));require(_0xe6a2('0x1b'))[_0xe6a2('0x1c')](socket);function respondWithStatusCode(_0x99297f,_0x34cc6b){_0x34cc6b=_0x34cc6b||0xcc;return function(_0x125aea){if(_0x125aea){return _0x99297f[_0xe6a2('0x1d')](_0x34cc6b);}return _0x99297f['status'](_0x34cc6b)[_0xe6a2('0x1e')]();};}function respondWithResult(_0x7ec2f6,_0x1993a1){_0x1993a1=_0x1993a1||0xc8;return function(_0x3a07c2){if(_0x3a07c2){return _0x7ec2f6[_0xe6a2('0x1f')](_0x1993a1)[_0xe6a2('0x20')](_0x3a07c2);}};}function respondWithFilteredResult(_0x127195,_0x3e3c3d){return function(_0x505965){if(_0x505965){var _0x54ad21=_0x505965[_0xe6a2('0x21')],_0x50afd0=_0x3e3c3d[_0xe6a2('0x22')],_0x663590=_0x3e3c3d[_0xe6a2('0x22')]+_0x3e3c3d[_0xe6a2('0x23')],_0x981ced;if(_0x663590>=_0x54ad21){_0x663590=_0x54ad21;_0x981ced=0xc8;}else{_0x981ced=0xce;}_0x127195[_0xe6a2('0x1f')](_0x981ced);return _0x127195['set'](_0xe6a2('0x24'),_0x50afd0+'-'+_0x663590+'/'+_0x54ad21)[_0xe6a2('0x20')](_0x505965);}return null;};}function patchUpdates(_0x78146e){return function(_0x17e14f){try{jsonpatch[_0xe6a2('0x25')](_0x17e14f,_0x78146e,!![]);}catch(_0x4e1bbf){return BPromise[_0xe6a2('0x26')](_0x4e1bbf);}return _0x17e14f[_0xe6a2('0x27')]();};}function saveUpdates(_0x235a26,_0x53b6b6){return function(_0x2e44d9){if(_0x2e44d9){return _0x2e44d9[_0xe6a2('0x28')](_0x235a26)[_0xe6a2('0x29')](function(_0x4d8421){return _0x4d8421;});}return null;};}function removeEntity(_0x31c982,_0x4f58d0){return function(_0x26647f){if(_0x26647f){return _0x26647f[_0xe6a2('0x2a')]()[_0xe6a2('0x29')](function(){var _0x15a201=_0x26647f[_0xe6a2('0x2b')]({'plain':!![]});var _0x15f8a5=_0xe6a2('0x2c');return db[_0xe6a2('0x2d')][_0xe6a2('0x2a')]({'where':{'type':_0x15f8a5,'resourceId':_0x15a201['id']}})['then'](function(){return _0x26647f;});})['then'](function(){_0x31c982['status'](0xcc)[_0xe6a2('0x1e')]();});}};}function handleEntityNotFound(_0x4414a8,_0xfe3166){return function(_0x3bcd11){if(!_0x3bcd11){_0x4414a8['sendStatus'](0x194);}return _0x3bcd11;};}function handleError(_0x37f7a9,_0x254693){_0x254693=_0x254693||0x1f4;return function(_0x29aed6){logger[_0xe6a2('0x2e')](_0x29aed6[_0xe6a2('0x2f')]);if(_0x29aed6[_0xe6a2('0x30')]){delete _0x29aed6[_0xe6a2('0x30')];}_0x37f7a9[_0xe6a2('0x1f')](_0x254693)['send'](_0x29aed6);};}exports[_0xe6a2('0x31')]=function(_0x561437,_0x40e3d6){var _0x564cc9={},_0x14b2f3={},_0x350567={'count':0x0,'rows':[]};var _0x1f5e6d=_[_0xe6a2('0x32')](db[_0xe6a2('0x33')]['rawAttributes'],function(_0x6ba053){return{'name':_0x6ba053['fieldName'],'type':_0x6ba053['type'][_0xe6a2('0x34')]};});_0x14b2f3[_0xe6a2('0x35')]=_[_0xe6a2('0x32')](_0x1f5e6d,_0xe6a2('0x30'));_0x14b2f3['query']=_[_0xe6a2('0x36')](_0x561437['query']);_0x14b2f3[_0xe6a2('0x37')]=_[_0xe6a2('0x38')](_0x14b2f3[_0xe6a2('0x35')],_0x14b2f3[_0xe6a2('0x39')]);_0x564cc9[_0xe6a2('0x3a')]=_[_0xe6a2('0x38')](_0x14b2f3[_0xe6a2('0x35')],qs[_0xe6a2('0x3b')](_0x561437[_0xe6a2('0x39')][_0xe6a2('0x3b')]));_0x564cc9[_0xe6a2('0x3a')]=_0x564cc9[_0xe6a2('0x3a')][_0xe6a2('0x3c')]?_0x564cc9[_0xe6a2('0x3a')]:_0x14b2f3['model'];if(!_0x561437[_0xe6a2('0x39')][_0xe6a2('0x3d')](_0xe6a2('0x3e'))){_0x564cc9['limit']=qs['limit'](_0x561437[_0xe6a2('0x39')][_0xe6a2('0x23')]);_0x564cc9[_0xe6a2('0x22')]=qs['offset'](_0x561437[_0xe6a2('0x39')]['offset']);}_0x564cc9['order']=qs[_0xe6a2('0x3f')](_0x561437[_0xe6a2('0x39')][_0xe6a2('0x3f')]);_0x564cc9[_0xe6a2('0x40')]=qs[_0xe6a2('0x37')](_[_0xe6a2('0x41')](_0x561437['query'],_0x14b2f3[_0xe6a2('0x37')]),_0x1f5e6d);if(_0x561437[_0xe6a2('0x39')][_0xe6a2('0x42')]){_0x564cc9[_0xe6a2('0x40')]=_['merge'](_0x564cc9[_0xe6a2('0x40')],{'$or':_[_0xe6a2('0x32')](_0x1f5e6d,function(_0xaf91fb){if(_0xaf91fb['type']!==_0xe6a2('0x43')){var _0x41cd81={};_0x41cd81[_0xaf91fb[_0xe6a2('0x30')]]={'$like':'%'+_0x561437[_0xe6a2('0x39')][_0xe6a2('0x42')]+'%'};return _0x41cd81;}})});}_0x564cc9=_[_0xe6a2('0x44')]({},_0x564cc9,_0x561437[_0xe6a2('0x45')]);var _0xf22244={'where':_0x564cc9[_0xe6a2('0x40')]};return db[_0xe6a2('0x33')][_0xe6a2('0x21')](_0xf22244)['then'](function(_0x4c3f0a){_0x350567[_0xe6a2('0x21')]=_0x4c3f0a;if(_0x561437['query'][_0xe6a2('0x46')]){_0x564cc9['include']=[{'all':!![]}];}return db['Dashboard'][_0xe6a2('0x47')](_0x564cc9);})['then'](function(_0x3c4349){_0x350567[_0xe6a2('0x48')]=_0x3c4349;return _0x350567;})['then'](respondWithFilteredResult(_0x40e3d6,_0x564cc9))[_0xe6a2('0x49')](handleError(_0x40e3d6,null));};exports[_0xe6a2('0x4a')]=function(_0x184bc1,_0x250b50){var _0x224a38={'raw':![],'where':{'id':_0x184bc1['params']['id']}},_0x31dfc2={};_0x31dfc2[_0xe6a2('0x35')]=_[_0xe6a2('0x36')](db[_0xe6a2('0x33')][_0xe6a2('0x4b')]);_0x31dfc2[_0xe6a2('0x39')]=_[_0xe6a2('0x36')](_0x184bc1[_0xe6a2('0x39')]);_0x31dfc2[_0xe6a2('0x37')]=_[_0xe6a2('0x38')](_0x31dfc2['model'],_0x31dfc2[_0xe6a2('0x39')]);_0x224a38[_0xe6a2('0x3a')]=_[_0xe6a2('0x38')](_0x31dfc2[_0xe6a2('0x35')],qs[_0xe6a2('0x3b')](_0x184bc1[_0xe6a2('0x39')][_0xe6a2('0x3b')]));_0x224a38[_0xe6a2('0x3a')]=_0x224a38['attributes'][_0xe6a2('0x3c')]?_0x224a38[_0xe6a2('0x3a')]:_0x31dfc2[_0xe6a2('0x35')];if(_0x184bc1[_0xe6a2('0x39')]['includeAll']){_0x224a38['include']=[{'all':!![]}];}_0x224a38=_[_0xe6a2('0x44')]({},_0x224a38,_0x184bc1['options']);return db[_0xe6a2('0x33')][_0xe6a2('0x4c')](_0x224a38)[_0xe6a2('0x29')](handleEntityNotFound(_0x250b50,null))[_0xe6a2('0x29')](respondWithResult(_0x250b50,null))[_0xe6a2('0x49')](handleError(_0x250b50,null));};exports['create']=function(_0x70d9c3,_0x5535a7){return db[_0xe6a2('0x33')][_0xe6a2('0x4d')](_0x70d9c3[_0xe6a2('0x4e')],{})[_0xe6a2('0x29')](function(_0x993472){var _0x38f4cd=_0x70d9c3[_0xe6a2('0x4f')]['get']({'plain':!![]});if(!_0x38f4cd)throw new Error(_0xe6a2('0x50'));if(_0x38f4cd['role']==='user'){var _0x49b5c6=_0x993472['get']({'plain':!![]});var _0x4e6b44='CustomDashboards';return db[_0xe6a2('0x51')][_0xe6a2('0x4c')]({'where':{'name':_0x4e6b44,'userProfileId':_0x38f4cd[_0xe6a2('0x52')]},'raw':!![]})[_0xe6a2('0x29')](function(_0x7d5462){if(_0x7d5462&&_0x7d5462[_0xe6a2('0x53')]===0x0){return db[_0xe6a2('0x2d')][_0xe6a2('0x4d')]({'name':_0x49b5c6[_0xe6a2('0x30')],'resourceId':_0x49b5c6['id'],'type':_0x7d5462['name'],'sectionId':_0x7d5462['id']},{})['then'](function(){return _0x993472;});}else{return _0x993472;}})[_0xe6a2('0x49')](function(_0x13a3f1){logger['error'](_0xe6a2('0x54'),_0x13a3f1);throw _0x13a3f1;});}return _0x993472;})[_0xe6a2('0x29')](respondWithResult(_0x5535a7,0xc9))['catch'](handleError(_0x5535a7,null));};exports[_0xe6a2('0x55')]=function(_0x1014f2,_0x1f4416){var _0x5ed3ab={'where':{'id':_0x1014f2[_0xe6a2('0x56')]['id']}},_0x1ad591={};_0x1ad591[_0xe6a2('0x35')]=_[_0xe6a2('0x36')](db['Dashboard']['rawAttributes']);_0x5ed3ab[_0xe6a2('0x3a')]=_['intersection'](_0x1ad591[_0xe6a2('0x35')],qs[_0xe6a2('0x3b')](_0x1014f2[_0xe6a2('0x39')][_0xe6a2('0x3b')]));_0x5ed3ab[_0xe6a2('0x3a')]=_0x5ed3ab['attributes'][_0xe6a2('0x3c')]?_0x5ed3ab['attributes']:_0x1ad591[_0xe6a2('0x35')];if(_0x1014f2[_0xe6a2('0x39')][_0xe6a2('0x46')]){_0x5ed3ab['include']=[{'all':!![]}];}_0x5ed3ab=_[_0xe6a2('0x44')]({},_0x5ed3ab,_0x1014f2[_0xe6a2('0x45')]);return db['Dashboard'][_0xe6a2('0x4c')](_0x5ed3ab)[_0xe6a2('0x29')](handleEntityNotFound(_0x1f4416,null))[_0xe6a2('0x29')](function(_0x4a8b69){if(_0x4a8b69){var _0x32ae11=_0x4a8b69[_0xe6a2('0x2b')]({'plain':!![]});_0x32ae11=qs[_0xe6a2('0x57')](_0x32ae11,['id','createdAt',_0xe6a2('0x58')]);_0x1014f2[_0xe6a2('0x4e')]=_[_0xe6a2('0x57')](_0x1014f2[_0xe6a2('0x4e')],['id',_0xe6a2('0x59'),'updatedAt']);return db['Dashboard'][_0xe6a2('0x4d')](_['merge'](_0x32ae11,_0x1014f2[_0xe6a2('0x4e')]),{'include':_0x1014f2['query']['includeAll']?[{'all':!![]}]:undefined})['then'](function(_0x4651a7){var _0x2239e6=_0x1014f2['user'][_0xe6a2('0x2b')]({'plain':!![]});if(!_0x2239e6)throw new Error(_0xe6a2('0x50'));if(_0x2239e6['role']==='user'){var _0x553c60=_0x4651a7[_0xe6a2('0x2b')]({'plain':!![]});var _0x50c664=_0xe6a2('0x2c');return db[_0xe6a2('0x51')][_0xe6a2('0x4c')]({'where':{'name':_0x50c664,'userProfileId':_0x2239e6[_0xe6a2('0x52')]},'raw':!![]})[_0xe6a2('0x29')](function(_0x12fb77){if(_0x12fb77&&_0x12fb77[_0xe6a2('0x53')]===0x0){return db['UserProfileResource'][_0xe6a2('0x4d')]({'name':_0x553c60[_0xe6a2('0x30')],'resourceId':_0x553c60['id'],'type':_0x12fb77[_0xe6a2('0x30')],'sectionId':_0x12fb77['id']},{})['then'](function(){return _0x4651a7;});}else{return _0x4651a7;}})[_0xe6a2('0x49')](function(_0x4977df){logger['error'](_0xe6a2('0x54'),_0x4977df);throw _0x4977df;});}return _0x4651a7;});}})[_0xe6a2('0x29')](respondWithResult(_0x1f4416,0xc9))[_0xe6a2('0x49')](handleError(_0x1f4416,null));};exports[_0xe6a2('0x28')]=function(_0x347f1e,_0x3d15b8){if(_0x347f1e[_0xe6a2('0x4e')]['id']){delete _0x347f1e[_0xe6a2('0x4e')]['id'];}return db['Dashboard'][_0xe6a2('0x4c')]({'where':{'id':_0x347f1e[_0xe6a2('0x56')]['id']}})['then'](handleEntityNotFound(_0x3d15b8,null))[_0xe6a2('0x29')](saveUpdates(_0x347f1e[_0xe6a2('0x4e')],null))[_0xe6a2('0x29')](respondWithResult(_0x3d15b8,null))[_0xe6a2('0x49')](handleError(_0x3d15b8,null));};exports['destroy']=function(_0x5f164c,_0x211fb2){return db[_0xe6a2('0x33')][_0xe6a2('0x4c')]({'where':{'id':_0x5f164c['params']['id']}})['then'](handleEntityNotFound(_0x211fb2,null))[_0xe6a2('0x29')](removeEntity(_0x211fb2,null))[_0xe6a2('0x49')](handleError(_0x211fb2,null));};function widgetAttributes(_0x7c5491){try{switch(_0x7c5491[_0xe6a2('0x5a')]){case _0xe6a2('0x5b'):return[{'name':'attrUrl','value':_0x7c5491[_0xe6a2('0x5c')]||(_0x7c5491['attrs']&&_0x7c5491['attrs'][0x0]?_0x7c5491[_0xe6a2('0x5d')][0x0][_0xe6a2('0x5e')]:undefined)||_0xe6a2('0x5f')}];case _0xe6a2('0x60'):return[{'name':'attrPath','value':_0x7c5491['attrPath']||(_0x7c5491[_0xe6a2('0x5d')]&&_0x7c5491[_0xe6a2('0x5d')][0x0]?_0x7c5491['attrs'][0x0][_0xe6a2('0x5e')]:undefined)||''}];case'clock':return[{'name':_0xe6a2('0x61'),'value':_0x7c5491['attrHourFormat']||(_0x7c5491[_0xe6a2('0x5d')]&&_0x7c5491[_0xe6a2('0x5d')][0x0]?_0x7c5491[_0xe6a2('0x5d')][0x0][_0xe6a2('0x5e')]:undefined)||_0xe6a2('0x62')},{'name':_0xe6a2('0x63'),'value':_0x7c5491['attrTimezone']||(_0x7c5491[_0xe6a2('0x5d')]&&_0x7c5491[_0xe6a2('0x5d')][0x1]?_0x7c5491[_0xe6a2('0x5d')][0x1]['value']:undefined)||'0.00'},{'name':'attrFontSize','value':_0x7c5491[_0xe6a2('0x64')]||(_0x7c5491['attrs']&&_0x7c5491['attrs'][0x2]?_0x7c5491[_0xe6a2('0x5d')][0x2][_0xe6a2('0x5e')]:undefined)||0xc}];case _0xe6a2('0x65'):return[{'name':_0xe6a2('0x66'),'value':_0x7c5491[_0xe6a2('0x66')]||(_0x7c5491['attrs']&&_0x7c5491[_0xe6a2('0x5d')][0x0]?_0x7c5491[_0xe6a2('0x5d')][0x0][_0xe6a2('0x5e')]:undefined)||_0xe6a2('0x67')},{'name':_0xe6a2('0x68'),'value':_0x7c5491[_0xe6a2('0x68')]||(_0x7c5491['attrs']&&_0x7c5491[_0xe6a2('0x5d')][0x1]?_0x7c5491[_0xe6a2('0x5d')][0x1]['value']:undefined)||[]},{'name':_0xe6a2('0x64'),'value':_0x7c5491[_0xe6a2('0x64')]||(_0x7c5491[_0xe6a2('0x5d')]&&_0x7c5491['attrs'][0x2]?_0x7c5491[_0xe6a2('0x5d')][0x2][_0xe6a2('0x5e')]:undefined)||0x14}];case'multibar-chart':case _0xe6a2('0x69'):return[{'name':_0xe6a2('0x6a'),'value':_0x7c5491[_0xe6a2('0x6a')]||(_0x7c5491[_0xe6a2('0x5d')]&&_0x7c5491[_0xe6a2('0x5d')][0x0]?_0x7c5491[_0xe6a2('0x5d')][0x0][_0xe6a2('0x5e')]:undefined)||_0xe6a2('0x67')},{'name':_0xe6a2('0x6b'),'value':_0x7c5491[_0xe6a2('0x6b')]||(_0x7c5491['attrs']&&_0x7c5491[_0xe6a2('0x5d')][0x1]?_0x7c5491['attrs'][0x1][_0xe6a2('0x5e')]:undefined)||null},{'name':_0xe6a2('0x6c'),'value':_0x7c5491[_0xe6a2('0x6c')]||(_0x7c5491[_0xe6a2('0x5d')]&&_0x7c5491[_0xe6a2('0x5d')][0x2]?_0x7c5491[_0xe6a2('0x5d')][0x2][_0xe6a2('0x5e')]:undefined)||null},{'name':_0xe6a2('0x68'),'value':_0x7c5491[_0xe6a2('0x68')]||(_0x7c5491[_0xe6a2('0x5d')]&&_0x7c5491['attrs'][0x3]?_0x7c5491[_0xe6a2('0x5d')][0x3]['value']:undefined)||[]}];case _0xe6a2('0x6d'):return[{'name':_0xe6a2('0x6e'),'type':_0x7c5491[_0xe6a2('0x6f')]||(_0x7c5491[_0xe6a2('0x5d')]&&_0x7c5491['attrs'][0x0]?_0x7c5491[_0xe6a2('0x5d')][0x0][_0xe6a2('0x5a')]:undefined)||null,'value':_0x7c5491[_0xe6a2('0x6e')]||(_0x7c5491[_0xe6a2('0x5d')]&&_0x7c5491[_0xe6a2('0x5d')][0x0]?_0x7c5491[_0xe6a2('0x5d')][0x0][_0xe6a2('0x5e')]:undefined)||null},{'name':_0xe6a2('0x70'),'value':_0x7c5491[_0xe6a2('0x70')]||(_0x7c5491[_0xe6a2('0x5d')]&&_0x7c5491[_0xe6a2('0x5d')][0x1]?_0x7c5491['attrs'][0x1][_0xe6a2('0x5e')]:undefined)||0x0}];default:return[];}}catch(_0x3bfdd9){logger[_0xe6a2('0x2e')](_0xe6a2('0x71'),JSON[_0xe6a2('0x72')](_0x3bfdd9));return[];}}exports[_0xe6a2('0x73')]=function(_0x57aa69,_0x563099,_0x26e23c){if(_0x57aa69[_0xe6a2('0x4e')]['id']){delete _0x57aa69[_0xe6a2('0x4e')]['id'];}return db[_0xe6a2('0x33')]['find']({'where':{'id':_0x57aa69[_0xe6a2('0x56')]['id']}})[_0xe6a2('0x29')](handleEntityNotFound(_0x563099,null))[_0xe6a2('0x29')](function(_0x42836e){if(_0x42836e){_0x57aa69[_0xe6a2('0x4e')][_0xe6a2('0x74')]=_0x42836e['id'];_0x57aa69[_0xe6a2('0x4e')][_0xe6a2('0x5d')]=widgetAttributes(_0x57aa69[_0xe6a2('0x4e')]);return db[_0xe6a2('0x75')][_0xe6a2('0x4d')](_0x57aa69[_0xe6a2('0x4e')]);}})[_0xe6a2('0x29')](respondWithResult(_0x563099,null))[_0xe6a2('0x49')](handleError(_0x563099,null));};exports[_0xe6a2('0x76')]=function(_0x1189dc,_0x5911c9,_0x1300e1){var _0x52f6f5={};var _0x25b48c={};var _0x331e79;var _0x35c52b;return db[_0xe6a2('0x33')]['findOne']({'where':{'id':_0x1189dc[_0xe6a2('0x56')]['id']}})[_0xe6a2('0x29')](handleEntityNotFound(_0x5911c9,null))[_0xe6a2('0x29')](function(_0x4b9ab4){if(_0x4b9ab4){_0x331e79=_0x4b9ab4;_0x25b48c[_0xe6a2('0x35')]=_[_0xe6a2('0x36')](db['DashboardItem']['rawAttributes']);_0x25b48c[_0xe6a2('0x39')]=_[_0xe6a2('0x36')](_0x1189dc[_0xe6a2('0x39')]);_0x25b48c[_0xe6a2('0x37')]=_[_0xe6a2('0x38')](_0x25b48c[_0xe6a2('0x35')],_0x25b48c[_0xe6a2('0x39')]);_0x52f6f5[_0xe6a2('0x3a')]=_[_0xe6a2('0x38')](_0x25b48c[_0xe6a2('0x35')],qs[_0xe6a2('0x3b')](_0x1189dc['query'][_0xe6a2('0x3b')]));_0x52f6f5[_0xe6a2('0x3a')]=_0x52f6f5[_0xe6a2('0x3a')][_0xe6a2('0x3c')]?_0x52f6f5['attributes']:_0x25b48c[_0xe6a2('0x35')];_0x52f6f5[_0xe6a2('0x77')]=qs[_0xe6a2('0x3f')](_0x1189dc[_0xe6a2('0x39')][_0xe6a2('0x3f')]);_0x52f6f5[_0xe6a2('0x40')]=qs[_0xe6a2('0x37')](_[_0xe6a2('0x41')](_0x1189dc['query'],_0x25b48c['filters']));if(_0x1189dc[_0xe6a2('0x39')][_0xe6a2('0x42')]){_0x52f6f5[_0xe6a2('0x40')]=_[_0xe6a2('0x44')](_0x52f6f5['where'],{'$or':_[_0xe6a2('0x32')](_0x52f6f5['attributes'],function(_0x6c22b7){var _0x1d696a={};_0x1d696a[_0x6c22b7]={'$like':'%'+_0x1189dc[_0xe6a2('0x39')][_0xe6a2('0x42')]+'%'};return _0x1d696a;})});}_0x52f6f5=_[_0xe6a2('0x44')]({},_0x52f6f5,_0x1189dc['options']);return _0x331e79[_0xe6a2('0x76')](_0x52f6f5);}})['then'](function(_0x1b34c2){if(_0x1b34c2){_0x35c52b=_0x1b34c2['length'];if(!_0x1189dc[_0xe6a2('0x39')]['hasOwnProperty'](_0xe6a2('0x3e'))){_0x52f6f5['limit']=qs[_0xe6a2('0x23')](_0x1189dc['query']['limit']);_0x52f6f5[_0xe6a2('0x22')]=qs['offset'](_0x1189dc[_0xe6a2('0x39')]['offset']);}return _0x331e79[_0xe6a2('0x76')](_0x52f6f5);}})['then'](function(_0x138185){if(_0x138185){return _0x138185?{'count':_0x35c52b,'rows':_0x138185}:null;}})[_0xe6a2('0x29')](respondWithResult(_0x5911c9,null))['catch'](handleError(_0x5911c9,null));};
\ No newline at end of file
+var _0x1c18=['then','destroy','CustomDashboards','UserProfileResource','error','stack','name','send','Dashboard','rawAttributes','fieldName','type','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','merge','VIRTUAL','filter','includeAll','include','findAll','rows','catch','show','params','keys','options','create','body','user','role','get','UserProfileSection','find','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','createdAt','updatedAt','Unable\x20to\x20retrieve\x20the\x20current\x20user','autoAssociation','attrUrl','attrs','https://','custom','attrPath','value','clock','attrHourFormat','HH:mm:ss','attrTimezone','attrFontSize','counter','attrMetric','attrVoiceQueues','multibar-chart','pie-chart','attrSerie1','total','attrSerie2','attrSerie3','attrReport','reportType','attrRefresh','widgetAttributes:\x20%s','stringify','addItem','DashboardId','getItems','findOne','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','redis','register','sendStatus','end','status','json','count','offset','limit','set','Content-Range','apply','reject','save','update'];(function(_0x4c3c5e,_0x555c8d){var _0x4ee436=function(_0x2be2b9){while(--_0x2be2b9){_0x4c3c5e['push'](_0x4c3c5e['shift']());}};_0x4ee436(++_0x555c8d);}(_0x1c18,0x147));var _0x81c1=function(_0x9dd37c,_0x3e255e){_0x9dd37c=_0x9dd37c-0x0;var _0x2a522c=_0x1c18[_0x9dd37c];return _0x2a522c;};'use strict';var pdf=require(_0x81c1('0x0'));var emlformat=require(_0x81c1('0x1'));var rimraf=require(_0x81c1('0x2'));var zipdir=require(_0x81c1('0x3'));var jsonpatch=require(_0x81c1('0x4'));var rp=require(_0x81c1('0x5'));var moment=require(_0x81c1('0x6'));var BPromise=require(_0x81c1('0x7'));var Mustache=require(_0x81c1('0x8'));var util=require(_0x81c1('0x9'));var path=require(_0x81c1('0xa'));var sox=require(_0x81c1('0xb'));var csv=require(_0x81c1('0xc'));var ejs=require(_0x81c1('0xd'));var fs=require('fs');var _=require(_0x81c1('0xe'));var squel=require(_0x81c1('0xf'));var crypto=require(_0x81c1('0x10'));var jsforce=require('jsforce');var deskjs=require(_0x81c1('0x11'));var toCsv=require(_0x81c1('0xc'));var querystring=require('querystring');var Papa=require(_0x81c1('0x12'));var Redis=require(_0x81c1('0x13'));var authService=require(_0x81c1('0x14'));var qs=require(_0x81c1('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x81c1('0x16'));var logger=require(_0x81c1('0x17'))(_0x81c1('0x18'));var utils=require(_0x81c1('0x19'));var config=require(_0x81c1('0x1a'));var db=require('../../mysqldb')['db'];config[_0x81c1('0x1b')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x81c1('0x1b')]));require('./dashboard.socket')[_0x81c1('0x1c')](socket);function respondWithStatusCode(_0x450255,_0x3c4d75){_0x3c4d75=_0x3c4d75||0xcc;return function(_0xd69ebd){if(_0xd69ebd){return _0x450255[_0x81c1('0x1d')](_0x3c4d75);}return _0x450255['status'](_0x3c4d75)[_0x81c1('0x1e')]();};}function respondWithResult(_0x222c19,_0x408c8b){_0x408c8b=_0x408c8b||0xc8;return function(_0x3a030e){if(_0x3a030e){return _0x222c19[_0x81c1('0x1f')](_0x408c8b)[_0x81c1('0x20')](_0x3a030e);}};}function respondWithFilteredResult(_0x3b81ec,_0x4ec8be){return function(_0x445d08){if(_0x445d08){var _0x91228c=_0x445d08[_0x81c1('0x21')],_0x198452=_0x4ec8be['offset'],_0x4bfdd2=_0x4ec8be[_0x81c1('0x22')]+_0x4ec8be[_0x81c1('0x23')],_0x14ed88;if(_0x4bfdd2>=_0x91228c){_0x4bfdd2=_0x91228c;_0x14ed88=0xc8;}else{_0x14ed88=0xce;}_0x3b81ec[_0x81c1('0x1f')](_0x14ed88);return _0x3b81ec[_0x81c1('0x24')](_0x81c1('0x25'),_0x198452+'-'+_0x4bfdd2+'/'+_0x91228c)[_0x81c1('0x20')](_0x445d08);}return null;};}function patchUpdates(_0x2f2adb){return function(_0x17d958){try{jsonpatch[_0x81c1('0x26')](_0x17d958,_0x2f2adb,!![]);}catch(_0x213d1d){return BPromise[_0x81c1('0x27')](_0x213d1d);}return _0x17d958[_0x81c1('0x28')]();};}function saveUpdates(_0x45a8bc,_0x559ebf){return function(_0x1ab48f){if(_0x1ab48f){return _0x1ab48f[_0x81c1('0x29')](_0x45a8bc)[_0x81c1('0x2a')](function(_0x2ab4b1){return _0x2ab4b1;});}return null;};}function removeEntity(_0x1a6beb,_0x5a71af){return function(_0x135de7){if(_0x135de7){return _0x135de7[_0x81c1('0x2b')]()[_0x81c1('0x2a')](function(){var _0xe259a1=_0x135de7['get']({'plain':!![]});var _0x15e30e=_0x81c1('0x2c');return db[_0x81c1('0x2d')][_0x81c1('0x2b')]({'where':{'type':_0x15e30e,'resourceId':_0xe259a1['id']}})[_0x81c1('0x2a')](function(){return _0x135de7;});})[_0x81c1('0x2a')](function(){_0x1a6beb[_0x81c1('0x1f')](0xcc)[_0x81c1('0x1e')]();});}};}function handleEntityNotFound(_0x268de4,_0x5f080d){return function(_0x325374){if(!_0x325374){_0x268de4[_0x81c1('0x1d')](0x194);}return _0x325374;};}function handleError(_0x70d307,_0x90f05e){_0x90f05e=_0x90f05e||0x1f4;return function(_0x41c191){logger[_0x81c1('0x2e')](_0x41c191[_0x81c1('0x2f')]);if(_0x41c191[_0x81c1('0x30')]){delete _0x41c191['name'];}_0x70d307[_0x81c1('0x1f')](_0x90f05e)[_0x81c1('0x31')](_0x41c191);};}exports['index']=function(_0x4e100a,_0x3865d8){var _0x553c6a={},_0x4bb1f5={},_0x472dd8={'count':0x0,'rows':[]};var _0x36c6ef=_['map'](db[_0x81c1('0x32')][_0x81c1('0x33')],function(_0x3acb5b){return{'name':_0x3acb5b[_0x81c1('0x34')],'type':_0x3acb5b[_0x81c1('0x35')]['key']};});_0x4bb1f5[_0x81c1('0x36')]=_[_0x81c1('0x37')](_0x36c6ef,_0x81c1('0x30'));_0x4bb1f5[_0x81c1('0x38')]=_['keys'](_0x4e100a['query']);_0x4bb1f5[_0x81c1('0x39')]=_[_0x81c1('0x3a')](_0x4bb1f5[_0x81c1('0x36')],_0x4bb1f5[_0x81c1('0x38')]);_0x553c6a[_0x81c1('0x3b')]=_['intersection'](_0x4bb1f5['model'],qs[_0x81c1('0x3c')](_0x4e100a[_0x81c1('0x38')][_0x81c1('0x3c')]));_0x553c6a[_0x81c1('0x3b')]=_0x553c6a['attributes'][_0x81c1('0x3d')]?_0x553c6a[_0x81c1('0x3b')]:_0x4bb1f5[_0x81c1('0x36')];if(!_0x4e100a[_0x81c1('0x38')][_0x81c1('0x3e')](_0x81c1('0x3f'))){_0x553c6a['limit']=qs[_0x81c1('0x23')](_0x4e100a[_0x81c1('0x38')][_0x81c1('0x23')]);_0x553c6a[_0x81c1('0x22')]=qs[_0x81c1('0x22')](_0x4e100a[_0x81c1('0x38')][_0x81c1('0x22')]);}_0x553c6a['order']=qs[_0x81c1('0x40')](_0x4e100a['query']['sort']);_0x553c6a[_0x81c1('0x41')]=qs['filters'](_[_0x81c1('0x42')](_0x4e100a['query'],_0x4bb1f5[_0x81c1('0x39')]),_0x36c6ef);if(_0x4e100a[_0x81c1('0x38')]['filter']){_0x553c6a[_0x81c1('0x41')]=_[_0x81c1('0x43')](_0x553c6a[_0x81c1('0x41')],{'$or':_['map'](_0x36c6ef,function(_0x2e94e2){if(_0x2e94e2[_0x81c1('0x35')]!==_0x81c1('0x44')){var _0x16e7a2={};_0x16e7a2[_0x2e94e2[_0x81c1('0x30')]]={'$like':'%'+_0x4e100a['query'][_0x81c1('0x45')]+'%'};return _0x16e7a2;}})});}_0x553c6a=_[_0x81c1('0x43')]({},_0x553c6a,_0x4e100a['options']);var _0x4e1f06={'where':_0x553c6a[_0x81c1('0x41')]};return db[_0x81c1('0x32')][_0x81c1('0x21')](_0x4e1f06)[_0x81c1('0x2a')](function(_0x540bae){_0x472dd8['count']=_0x540bae;if(_0x4e100a[_0x81c1('0x38')][_0x81c1('0x46')]){_0x553c6a[_0x81c1('0x47')]=[{'all':!![]}];}return db[_0x81c1('0x32')][_0x81c1('0x48')](_0x553c6a);})[_0x81c1('0x2a')](function(_0x2a9ee2){_0x472dd8[_0x81c1('0x49')]=_0x2a9ee2;return _0x472dd8;})['then'](respondWithFilteredResult(_0x3865d8,_0x553c6a))[_0x81c1('0x4a')](handleError(_0x3865d8,null));};exports[_0x81c1('0x4b')]=function(_0x3031fd,_0x2d70d6){var _0x58cbfb={'raw':![],'where':{'id':_0x3031fd[_0x81c1('0x4c')]['id']}},_0x5eaf86={};_0x5eaf86['model']=_[_0x81c1('0x4d')](db[_0x81c1('0x32')][_0x81c1('0x33')]);_0x5eaf86[_0x81c1('0x38')]=_[_0x81c1('0x4d')](_0x3031fd['query']);_0x5eaf86[_0x81c1('0x39')]=_[_0x81c1('0x3a')](_0x5eaf86[_0x81c1('0x36')],_0x5eaf86[_0x81c1('0x38')]);_0x58cbfb['attributes']=_[_0x81c1('0x3a')](_0x5eaf86[_0x81c1('0x36')],qs[_0x81c1('0x3c')](_0x3031fd['query'][_0x81c1('0x3c')]));_0x58cbfb[_0x81c1('0x3b')]=_0x58cbfb[_0x81c1('0x3b')][_0x81c1('0x3d')]?_0x58cbfb[_0x81c1('0x3b')]:_0x5eaf86[_0x81c1('0x36')];if(_0x3031fd[_0x81c1('0x38')]['includeAll']){_0x58cbfb[_0x81c1('0x47')]=[{'all':!![]}];}_0x58cbfb=_[_0x81c1('0x43')]({},_0x58cbfb,_0x3031fd[_0x81c1('0x4e')]);return db[_0x81c1('0x32')]['find'](_0x58cbfb)['then'](handleEntityNotFound(_0x2d70d6,null))[_0x81c1('0x2a')](respondWithResult(_0x2d70d6,null))['catch'](handleError(_0x2d70d6,null));};exports[_0x81c1('0x4f')]=function(_0x56a001,_0x2a5218){return db['Dashboard'][_0x81c1('0x4f')](_0x56a001[_0x81c1('0x50')],{})['then'](function(_0x5a9fd2){var _0x1e43bc=_0x56a001[_0x81c1('0x51')]['get']({'plain':!![]});if(!_0x1e43bc)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1e43bc[_0x81c1('0x52')]===_0x81c1('0x51')){var _0x14f017=_0x5a9fd2[_0x81c1('0x53')]({'plain':!![]});var _0x537cd0=_0x81c1('0x2c');return db[_0x81c1('0x54')][_0x81c1('0x55')]({'where':{'name':_0x537cd0,'userProfileId':_0x1e43bc[_0x81c1('0x56')]},'raw':!![]})[_0x81c1('0x2a')](function(_0x18349a){if(_0x18349a&&_0x18349a['autoAssociation']===0x0){return db['UserProfileResource'][_0x81c1('0x4f')]({'name':_0x14f017[_0x81c1('0x30')],'resourceId':_0x14f017['id'],'type':_0x18349a[_0x81c1('0x30')],'sectionId':_0x18349a['id']},{})[_0x81c1('0x2a')](function(){return _0x5a9fd2;});}else{return _0x5a9fd2;}})[_0x81c1('0x4a')](function(_0x525a08){logger[_0x81c1('0x2e')](_0x81c1('0x57'),_0x525a08);throw _0x525a08;});}return _0x5a9fd2;})['then'](respondWithResult(_0x2a5218,0xc9))[_0x81c1('0x4a')](handleError(_0x2a5218,null));};exports[_0x81c1('0x58')]=function(_0x13a048,_0x2f316c){var _0x5a34c6={'where':{'id':_0x13a048[_0x81c1('0x4c')]['id']}},_0xdaed63={};_0xdaed63[_0x81c1('0x36')]=_[_0x81c1('0x4d')](db[_0x81c1('0x32')][_0x81c1('0x33')]);_0x5a34c6[_0x81c1('0x3b')]=_[_0x81c1('0x3a')](_0xdaed63['model'],qs[_0x81c1('0x3c')](_0x13a048[_0x81c1('0x38')][_0x81c1('0x3c')]));_0x5a34c6[_0x81c1('0x3b')]=_0x5a34c6['attributes'][_0x81c1('0x3d')]?_0x5a34c6[_0x81c1('0x3b')]:_0xdaed63[_0x81c1('0x36')];if(_0x13a048[_0x81c1('0x38')][_0x81c1('0x46')]){_0x5a34c6[_0x81c1('0x47')]=[{'all':!![]}];}_0x5a34c6=_[_0x81c1('0x43')]({},_0x5a34c6,_0x13a048[_0x81c1('0x4e')]);return db['Dashboard']['find'](_0x5a34c6)[_0x81c1('0x2a')](handleEntityNotFound(_0x2f316c,null))['then'](function(_0x11fc95){if(_0x11fc95){var _0x321d16=_0x11fc95['get']({'plain':!![]});_0x321d16=qs[_0x81c1('0x59')](_0x321d16,['id',_0x81c1('0x5a'),_0x81c1('0x5b')]);_0x13a048[_0x81c1('0x50')]=_[_0x81c1('0x59')](_0x13a048[_0x81c1('0x50')],['id',_0x81c1('0x5a'),_0x81c1('0x5b')]);return db[_0x81c1('0x32')][_0x81c1('0x4f')](_[_0x81c1('0x43')](_0x321d16,_0x13a048[_0x81c1('0x50')]),{'include':_0x13a048[_0x81c1('0x38')][_0x81c1('0x46')]?[{'all':!![]}]:undefined})['then'](function(_0x32d720){var _0x362f67=_0x13a048[_0x81c1('0x51')][_0x81c1('0x53')]({'plain':!![]});if(!_0x362f67)throw new Error(_0x81c1('0x5c'));if(_0x362f67[_0x81c1('0x52')]===_0x81c1('0x51')){var _0xcb9d9=_0x32d720[_0x81c1('0x53')]({'plain':!![]});var _0x5fb0ef=_0x81c1('0x2c');return db[_0x81c1('0x54')]['find']({'where':{'name':_0x5fb0ef,'userProfileId':_0x362f67[_0x81c1('0x56')]},'raw':!![]})[_0x81c1('0x2a')](function(_0x5abb9f){if(_0x5abb9f&&_0x5abb9f[_0x81c1('0x5d')]===0x0){return db['UserProfileResource'][_0x81c1('0x4f')]({'name':_0xcb9d9[_0x81c1('0x30')],'resourceId':_0xcb9d9['id'],'type':_0x5abb9f['name'],'sectionId':_0x5abb9f['id']},{})['then'](function(){return _0x32d720;});}else{return _0x32d720;}})[_0x81c1('0x4a')](function(_0x221818){logger['error'](_0x81c1('0x57'),_0x221818);throw _0x221818;});}return _0x32d720;});}})[_0x81c1('0x2a')](respondWithResult(_0x2f316c,0xc9))[_0x81c1('0x4a')](handleError(_0x2f316c,null));};exports[_0x81c1('0x29')]=function(_0x4a7645,_0x5edf3c){if(_0x4a7645[_0x81c1('0x50')]['id']){delete _0x4a7645['body']['id'];}return db['Dashboard'][_0x81c1('0x55')]({'where':{'id':_0x4a7645[_0x81c1('0x4c')]['id']}})['then'](handleEntityNotFound(_0x5edf3c,null))[_0x81c1('0x2a')](saveUpdates(_0x4a7645[_0x81c1('0x50')],null))[_0x81c1('0x2a')](respondWithResult(_0x5edf3c,null))[_0x81c1('0x4a')](handleError(_0x5edf3c,null));};exports[_0x81c1('0x2b')]=function(_0x57d29f,_0x539250){return db[_0x81c1('0x32')][_0x81c1('0x55')]({'where':{'id':_0x57d29f[_0x81c1('0x4c')]['id']}})[_0x81c1('0x2a')](handleEntityNotFound(_0x539250,null))[_0x81c1('0x2a')](removeEntity(_0x539250,null))[_0x81c1('0x4a')](handleError(_0x539250,null));};function widgetAttributes(_0x3c0c87){try{switch(_0x3c0c87[_0x81c1('0x35')]){case'iframe':return[{'name':_0x81c1('0x5e'),'value':_0x3c0c87['attrUrl']||(_0x3c0c87[_0x81c1('0x5f')]&&_0x3c0c87['attrs'][0x0]?_0x3c0c87[_0x81c1('0x5f')][0x0]['value']:undefined)||_0x81c1('0x60')}];case _0x81c1('0x61'):return[{'name':_0x81c1('0x62'),'value':_0x3c0c87[_0x81c1('0x62')]||(_0x3c0c87['attrs']&&_0x3c0c87[_0x81c1('0x5f')][0x0]?_0x3c0c87[_0x81c1('0x5f')][0x0][_0x81c1('0x63')]:undefined)||''}];case _0x81c1('0x64'):return[{'name':_0x81c1('0x65'),'value':_0x3c0c87[_0x81c1('0x65')]||(_0x3c0c87[_0x81c1('0x5f')]&&_0x3c0c87[_0x81c1('0x5f')][0x0]?_0x3c0c87[_0x81c1('0x5f')][0x0][_0x81c1('0x63')]:undefined)||_0x81c1('0x66')},{'name':_0x81c1('0x67'),'value':_0x3c0c87[_0x81c1('0x67')]||(_0x3c0c87[_0x81c1('0x5f')]&&_0x3c0c87['attrs'][0x1]?_0x3c0c87[_0x81c1('0x5f')][0x1][_0x81c1('0x63')]:undefined)||'0.00'},{'name':'attrFontSize','value':_0x3c0c87[_0x81c1('0x68')]||(_0x3c0c87['attrs']&&_0x3c0c87['attrs'][0x2]?_0x3c0c87[_0x81c1('0x5f')][0x2][_0x81c1('0x63')]:undefined)||0xc}];case _0x81c1('0x69'):return[{'name':_0x81c1('0x6a'),'value':_0x3c0c87[_0x81c1('0x6a')]||(_0x3c0c87[_0x81c1('0x5f')]&&_0x3c0c87[_0x81c1('0x5f')][0x0]?_0x3c0c87[_0x81c1('0x5f')][0x0]['value']:undefined)||'total'},{'name':_0x81c1('0x6b'),'value':_0x3c0c87['attrVoiceQueues']||(_0x3c0c87[_0x81c1('0x5f')]&&_0x3c0c87[_0x81c1('0x5f')][0x1]?_0x3c0c87[_0x81c1('0x5f')][0x1]['value']:undefined)||[]},{'name':_0x81c1('0x68'),'value':_0x3c0c87[_0x81c1('0x68')]||(_0x3c0c87[_0x81c1('0x5f')]&&_0x3c0c87[_0x81c1('0x5f')][0x2]?_0x3c0c87[_0x81c1('0x5f')][0x2]['value']:undefined)||0x14}];case _0x81c1('0x6c'):case _0x81c1('0x6d'):return[{'name':_0x81c1('0x6e'),'value':_0x3c0c87[_0x81c1('0x6e')]||(_0x3c0c87['attrs']&&_0x3c0c87[_0x81c1('0x5f')][0x0]?_0x3c0c87[_0x81c1('0x5f')][0x0][_0x81c1('0x63')]:undefined)||_0x81c1('0x6f')},{'name':_0x81c1('0x70'),'value':_0x3c0c87[_0x81c1('0x70')]||(_0x3c0c87['attrs']&&_0x3c0c87[_0x81c1('0x5f')][0x1]?_0x3c0c87[_0x81c1('0x5f')][0x1]['value']:undefined)||null},{'name':_0x81c1('0x71'),'value':_0x3c0c87['attrSerie3']||(_0x3c0c87[_0x81c1('0x5f')]&&_0x3c0c87[_0x81c1('0x5f')][0x2]?_0x3c0c87[_0x81c1('0x5f')][0x2]['value']:undefined)||null},{'name':_0x81c1('0x6b'),'value':_0x3c0c87[_0x81c1('0x6b')]||(_0x3c0c87[_0x81c1('0x5f')]&&_0x3c0c87[_0x81c1('0x5f')][0x3]?_0x3c0c87[_0x81c1('0x5f')][0x3][_0x81c1('0x63')]:undefined)||[]}];case'web-report':return[{'name':_0x81c1('0x72'),'type':_0x3c0c87[_0x81c1('0x73')]||(_0x3c0c87['attrs']&&_0x3c0c87[_0x81c1('0x5f')][0x0]?_0x3c0c87['attrs'][0x0]['type']:undefined)||null,'value':_0x3c0c87[_0x81c1('0x72')]||(_0x3c0c87[_0x81c1('0x5f')]&&_0x3c0c87[_0x81c1('0x5f')][0x0]?_0x3c0c87['attrs'][0x0][_0x81c1('0x63')]:undefined)||null},{'name':'attrRefresh','value':_0x3c0c87[_0x81c1('0x74')]||(_0x3c0c87[_0x81c1('0x5f')]&&_0x3c0c87['attrs'][0x1]?_0x3c0c87[_0x81c1('0x5f')][0x1][_0x81c1('0x63')]:undefined)||0x0}];default:return[];}}catch(_0x3f31fe){logger[_0x81c1('0x2e')](_0x81c1('0x75'),JSON[_0x81c1('0x76')](_0x3f31fe));return[];}}exports[_0x81c1('0x77')]=function(_0x3b2b25,_0x5d6bfa,_0x59676c){if(_0x3b2b25[_0x81c1('0x50')]['id']){delete _0x3b2b25[_0x81c1('0x50')]['id'];}return db[_0x81c1('0x32')]['find']({'where':{'id':_0x3b2b25[_0x81c1('0x4c')]['id']}})[_0x81c1('0x2a')](handleEntityNotFound(_0x5d6bfa,null))['then'](function(_0x248f00){if(_0x248f00){_0x3b2b25[_0x81c1('0x50')][_0x81c1('0x78')]=_0x248f00['id'];_0x3b2b25[_0x81c1('0x50')]['attrs']=widgetAttributes(_0x3b2b25[_0x81c1('0x50')]);return db['DashboardItem'][_0x81c1('0x4f')](_0x3b2b25[_0x81c1('0x50')]);}})[_0x81c1('0x2a')](respondWithResult(_0x5d6bfa,null))[_0x81c1('0x4a')](handleError(_0x5d6bfa,null));};exports[_0x81c1('0x79')]=function(_0x22a43e,_0x5079ab,_0x37913d){var _0x5f47a1={};var _0x25d538={};var _0x13428c;var _0x326bc4;return db['Dashboard'][_0x81c1('0x7a')]({'where':{'id':_0x22a43e[_0x81c1('0x4c')]['id']}})['then'](handleEntityNotFound(_0x5079ab,null))[_0x81c1('0x2a')](function(_0x5cbd6b){if(_0x5cbd6b){_0x13428c=_0x5cbd6b;_0x25d538[_0x81c1('0x36')]=_[_0x81c1('0x4d')](db['DashboardItem'][_0x81c1('0x33')]);_0x25d538[_0x81c1('0x38')]=_['keys'](_0x22a43e[_0x81c1('0x38')]);_0x25d538[_0x81c1('0x39')]=_[_0x81c1('0x3a')](_0x25d538[_0x81c1('0x36')],_0x25d538[_0x81c1('0x38')]);_0x5f47a1[_0x81c1('0x3b')]=_[_0x81c1('0x3a')](_0x25d538[_0x81c1('0x36')],qs[_0x81c1('0x3c')](_0x22a43e[_0x81c1('0x38')]['fields']));_0x5f47a1[_0x81c1('0x3b')]=_0x5f47a1['attributes'][_0x81c1('0x3d')]?_0x5f47a1[_0x81c1('0x3b')]:_0x25d538['model'];_0x5f47a1['order']=qs['sort'](_0x22a43e[_0x81c1('0x38')][_0x81c1('0x40')]);_0x5f47a1['where']=qs[_0x81c1('0x39')](_['pick'](_0x22a43e[_0x81c1('0x38')],_0x25d538['filters']));if(_0x22a43e[_0x81c1('0x38')][_0x81c1('0x45')]){_0x5f47a1[_0x81c1('0x41')]=_['merge'](_0x5f47a1[_0x81c1('0x41')],{'$or':_['map'](_0x5f47a1[_0x81c1('0x3b')],function(_0x47f60e){var _0x30f3fe={};_0x30f3fe[_0x47f60e]={'$like':'%'+_0x22a43e[_0x81c1('0x38')]['filter']+'%'};return _0x30f3fe;})});}_0x5f47a1=_['merge']({},_0x5f47a1,_0x22a43e[_0x81c1('0x4e')]);return _0x13428c[_0x81c1('0x79')](_0x5f47a1);}})[_0x81c1('0x2a')](function(_0x22aff2){if(_0x22aff2){_0x326bc4=_0x22aff2[_0x81c1('0x3d')];if(!_0x22a43e[_0x81c1('0x38')][_0x81c1('0x3e')](_0x81c1('0x3f'))){_0x5f47a1[_0x81c1('0x23')]=qs['limit'](_0x22a43e[_0x81c1('0x38')][_0x81c1('0x23')]);_0x5f47a1['offset']=qs[_0x81c1('0x22')](_0x22a43e[_0x81c1('0x38')][_0x81c1('0x22')]);}return _0x13428c['getItems'](_0x5f47a1);}})[_0x81c1('0x2a')](function(_0x1a49c5){if(_0x1a49c5){return _0x1a49c5?{'count':_0x326bc4,'rows':_0x1a49c5}:null;}})[_0x81c1('0x2a')](respondWithResult(_0x5079ab,null))[_0x81c1('0x4a')](handleError(_0x5079ab,null));};
\ No newline at end of file
diff --git a/server/api/dashboard/dashboard.events.js b/server/api/dashboard/dashboard.events.js
index a325ab3..1a3389c 100644
--- a/server/api/dashboard/dashboard.events.js
+++ b/server/api/dashboard/dashboard.events.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x42fc=['save','update','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0x57e80a,_0xac3f2a){var _0x181027=function(_0x27487f){while(--_0x27487f){_0x57e80a['push'](_0x57e80a['shift']());}};_0x181027(++_0xac3f2a);}(_0x42fc,0x1a7));var _0xc42f=function(_0x12bdfc,_0xf55e66){_0x12bdfc=_0x12bdfc-0x0;var _0x24f758=_0x42fc[_0x12bdfc];return _0x24f758;};'use strict';var EventEmitter=require(_0xc42f('0x0'));var Dashboard=require('../../mysqldb')['db']['Dashboard'];var DashboardEvents=new EventEmitter();DashboardEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xc42f('0x1'),'afterUpdate':_0xc42f('0x2'),'afterDestroy':_0xc42f('0x3')};function emitEvent(_0x493072){return function(_0x4304b8,_0x48916d,_0x12c95f){DashboardEvents[_0xc42f('0x4')](_0x493072+':'+_0x4304b8['id'],_0x4304b8);DashboardEvents[_0xc42f('0x4')](_0x493072,_0x4304b8);_0x12c95f(null);};}for(var e in events){if(events[_0xc42f('0x5')](e)){var event=events[e];Dashboard[_0xc42f('0x6')](e,emitEvent(event));}}module[_0xc42f('0x7')]=DashboardEvents;
\ No newline at end of file
+var _0xcfbe=['hasOwnProperty','hook','exports','events','../../mysqldb','Dashboard','remove','emit'];(function(_0x20e187,_0x1ef9e1){var _0x425928=function(_0x471806){while(--_0x471806){_0x20e187['push'](_0x20e187['shift']());}};_0x425928(++_0x1ef9e1);}(_0xcfbe,0x83));var _0xecfb=function(_0x5e7a86,_0x502364){_0x5e7a86=_0x5e7a86-0x0;var _0xbbdd3d=_0xcfbe[_0x5e7a86];return _0xbbdd3d;};'use strict';var EventEmitter=require(_0xecfb('0x0'));var Dashboard=require(_0xecfb('0x1'))['db'][_0xecfb('0x2')];var DashboardEvents=new EventEmitter();DashboardEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0xecfb('0x3')};function emitEvent(_0x3979c8){return function(_0x1296ee,_0x17643d,_0x110e74){DashboardEvents['emit'](_0x3979c8+':'+_0x1296ee['id'],_0x1296ee);DashboardEvents[_0xecfb('0x4')](_0x3979c8,_0x1296ee);_0x110e74(null);};}for(var e in events){if(events[_0xecfb('0x5')](e)){var event=events[e];Dashboard[_0xecfb('0x6')](e,emitEvent(event));}}module[_0xecfb('0x7')]=DashboardEvents;
\ No newline at end of file
diff --git a/server/api/dashboard/dashboard.model.js b/server/api/dashboard/dashboard.model.js
index 0808050..702a665 100644
--- a/server/api/dashboard/dashboard.model.js
+++ b/server/api/dashboard/dashboard.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x8c0d=['dashboards','lodash','util','../../config/logger','api','moment','path','rimraf','./dashboard.attributes','exports','Dashboard'];(function(_0x24c5bf,_0x3bf899){var _0x3c584b=function(_0x350332){while(--_0x350332){_0x24c5bf['push'](_0x24c5bf['shift']());}};_0x3c584b(++_0x3bf899);}(_0x8c0d,0x177));var _0xd8c0=function(_0x32abc3,_0x58db21){_0x32abc3=_0x32abc3-0x0;var _0xe05314=_0x8c0d[_0x32abc3];return _0xe05314;};'use strict';var _=require(_0xd8c0('0x0'));var util=require(_0xd8c0('0x1'));var logger=require(_0xd8c0('0x2'))(_0xd8c0('0x3'));var moment=require(_0xd8c0('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xd8c0('0x5'));var rimraf=require(_0xd8c0('0x6'));var config=require('../../config/environment');var attributes=require(_0xd8c0('0x7'));module[_0xd8c0('0x8')]=function(_0x229cb9,_0x4f4b26){return _0x229cb9['define'](_0xd8c0('0x9'),attributes,{'tableName':_0xd8c0('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x91a9=['rimraf','../../config/environment','./dashboard.attributes','exports','define','Dashboard','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x1ac96b,_0x900861){var _0xf31fb6=function(_0x5ae230){while(--_0x5ae230){_0x1ac96b['push'](_0x1ac96b['shift']());}};_0xf31fb6(++_0x900861);}(_0x91a9,0xbc));var _0x991a=function(_0x5a623f,_0x2403d2){_0x5a623f=_0x5a623f-0x0;var _0x18fda2=_0x91a9[_0x5a623f];return _0x18fda2;};'use strict';var _=require(_0x991a('0x0'));var util=require(_0x991a('0x1'));var logger=require(_0x991a('0x2'))(_0x991a('0x3'));var moment=require(_0x991a('0x4'));var BPromise=require(_0x991a('0x5'));var rp=require(_0x991a('0x6'));var fs=require('fs');var path=require(_0x991a('0x7'));var rimraf=require(_0x991a('0x8'));var config=require(_0x991a('0x9'));var attributes=require(_0x991a('0xa'));module[_0x991a('0xb')]=function(_0x370710,_0x2e5c49){return _0x370710[_0x991a('0xc')](_0x991a('0xd'),attributes,{'tableName':'dashboards','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/dashboard/dashboard.rpc.js b/server/api/dashboard/dashboard.rpc.js
index 20c5377..6112434 100644
--- a/server/api/dashboard/dashboard.rpc.js
+++ b/server/api/dashboard/dashboard.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x70ae=['socket.io-emitter','request','then','Dashboard,\x20%s,\x20%s','request\x20sent','debug','Dashboard,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/environment','jayson/promise','http','redis','localhost'];(function(_0x1ffde6,_0xe3b27a){var _0x47954d=function(_0x3c0d23){while(--_0x3c0d23){_0x1ffde6['push'](_0x1ffde6['shift']());}};_0x47954d(++_0xe3b27a);}(_0x70ae,0x153));var _0xe70a=function(_0x2b4629,_0x2cfe26){_0x2b4629=_0x2b4629-0x0;var _0x1d8fa9=_0x70ae[_0x2b4629];return _0x1d8fa9;};'use strict';var _=require('lodash');var util=require(_0xe70a('0x0'));var moment=require(_0xe70a('0x1'));var BPromise=require(_0xe70a('0x2'));var rs=require(_0xe70a('0x3'));var fs=require('fs');var Redis=require(_0xe70a('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xe70a('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0xe70a('0x6'));var jayson=require(_0xe70a('0x7'));var client=jayson['client'][_0xe70a('0x8')]({'port':0x232a});config[_0xe70a('0x9')]=_['defaults'](config[_0xe70a('0x9')],{'host':_0xe70a('0xa'),'port':0x18eb});var socket=require(_0xe70a('0xb'))(new Redis(config[_0xe70a('0x9')]));require('./dashboard.socket')['register'](socket);function respondWithRpcPromise(_0x512fc1,_0x46fb5b,_0xb5fe63){return new BPromise(function(_0x15300a,_0x5d8a66){return client[_0xe70a('0xc')](_0x512fc1,_0xb5fe63)[_0xe70a('0xd')](function(_0x5db24c){logger['info'](_0xe70a('0xe'),_0x46fb5b,_0xe70a('0xf'));logger[_0xe70a('0x10')](_0xe70a('0x11'),_0x46fb5b,'request\x20sent',JSON[_0xe70a('0x12')](_0x5db24c));if(_0x5db24c['error']){if(_0x5db24c[_0xe70a('0x13')][_0xe70a('0x14')]===0x1f4){logger[_0xe70a('0x13')]('Dashboard,\x20%s,\x20%s',_0x46fb5b,_0x5db24c[_0xe70a('0x13')][_0xe70a('0x15')]);return _0x5d8a66(_0x5db24c[_0xe70a('0x13')]['message']);}logger['error'](_0xe70a('0xe'),_0x46fb5b,_0x5db24c[_0xe70a('0x13')][_0xe70a('0x15')]);return _0x15300a(_0x5db24c['error'][_0xe70a('0x15')]);}else{logger[_0xe70a('0x16')](_0xe70a('0xe'),_0x46fb5b,_0xe70a('0xf'));_0x15300a(_0x5db24c[_0xe70a('0x17')][_0xe70a('0x15')]);}})[_0xe70a('0x18')](function(_0x37fbe5){logger[_0xe70a('0x13')]('Dashboard,\x20%s,\x20%s',_0x46fb5b,_0x37fbe5);_0x5d8a66(_0x37fbe5);});});}
\ No newline at end of file
+var _0x6192=['stringify','error','code','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','http','redis','localhost','./dashboard.socket','request','then','info','Dashboard,\x20%s,\x20%s','request\x20sent','debug','Dashboard,\x20%s,\x20%s,\x20%s'];(function(_0x34cbdb,_0x5793fb){var _0x5a20cf=function(_0x366e57){while(--_0x366e57){_0x34cbdb['push'](_0x34cbdb['shift']());}};_0x5a20cf(++_0x5793fb);}(_0x6192,0x10a));var _0x2619=function(_0x43e4de,_0x16d989){_0x43e4de=_0x43e4de-0x0;var _0x541f0a=_0x6192[_0x43e4de];return _0x541f0a;};'use strict';var _=require(_0x2619('0x0'));var util=require(_0x2619('0x1'));var moment=require(_0x2619('0x2'));var BPromise=require(_0x2619('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2619('0x4'));var db=require(_0x2619('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x2619('0x6'))(_0x2619('0x7'));var config=require(_0x2619('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x2619('0x9')]({'port':0x232a});config[_0x2619('0xa')]=_['defaults'](config['redis'],{'host':_0x2619('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x2619('0xa')]));require(_0x2619('0xc'))['register'](socket);function respondWithRpcPromise(_0x1b4cb3,_0x415c86,_0x2cda3f){return new BPromise(function(_0x3119b4,_0x4b140b){return client[_0x2619('0xd')](_0x1b4cb3,_0x2cda3f)[_0x2619('0xe')](function(_0x59b625){logger[_0x2619('0xf')](_0x2619('0x10'),_0x415c86,_0x2619('0x11'));logger[_0x2619('0x12')](_0x2619('0x13'),_0x415c86,_0x2619('0x11'),JSON[_0x2619('0x14')](_0x59b625));if(_0x59b625['error']){if(_0x59b625[_0x2619('0x15')][_0x2619('0x16')]===0x1f4){logger[_0x2619('0x15')](_0x2619('0x10'),_0x415c86,_0x59b625[_0x2619('0x15')][_0x2619('0x17')]);return _0x4b140b(_0x59b625[_0x2619('0x15')][_0x2619('0x17')]);}logger[_0x2619('0x15')](_0x2619('0x10'),_0x415c86,_0x59b625[_0x2619('0x15')][_0x2619('0x17')]);return _0x3119b4(_0x59b625['error'][_0x2619('0x17')]);}else{logger[_0x2619('0xf')](_0x2619('0x10'),_0x415c86,_0x2619('0x11'));_0x3119b4(_0x59b625[_0x2619('0x18')][_0x2619('0x17')]);}})[_0x2619('0x19')](function(_0x345561){logger[_0x2619('0x15')](_0x2619('0x10'),_0x415c86,_0x345561);_0x4b140b(_0x345561);});});}
\ No newline at end of file
diff --git a/server/api/dashboard/dashboard.socket.js b/server/api/dashboard/dashboard.socket.js
index 067fd95..d4c0b1e 100644
--- a/server/api/dashboard/dashboard.socket.js
+++ b/server/api/dashboard/dashboard.socket.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x86e5=['remove','update','emit','register','length','dashboard:','./dashboard.events'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x86e5,0x110));var _0x586e=function(_0x5dbbc2,_0x1eb331){_0x5dbbc2=_0x5dbbc2-0x0;var _0x347c95=_0x86e5[_0x5dbbc2];return _0x347c95;};'use strict';var DashboardEvents=require(_0x586e('0x0'));var events=['save',_0x586e('0x1'),_0x586e('0x2')];function createListener(_0x1c49bd,_0x3bbe23){return function(_0x43a2fb){_0x3bbe23[_0x586e('0x3')](_0x1c49bd,_0x43a2fb);};}function removeListener(_0x3778a3,_0x296b57){return function(){DashboardEvents['removeListener'](_0x3778a3,_0x296b57);};}exports[_0x586e('0x4')]=function(_0x5979e1){for(var _0xbd4749=0x0,_0x222ed9=events[_0x586e('0x5')];_0xbd4749<_0x222ed9;_0xbd4749++){var _0x3d99ac=events[_0xbd4749];var _0x559d68=createListener(_0x586e('0x6')+_0x3d99ac,_0x5979e1);DashboardEvents['on'](_0x3d99ac,_0x559d68);}};
\ No newline at end of file
+var _0xf6f3=['save','remove','update','length','dashboard:','./dashboard.events'];(function(_0x2f2b36,_0x3b13ec){var _0x190bd8=function(_0x3230b2){while(--_0x3230b2){_0x2f2b36['push'](_0x2f2b36['shift']());}};_0x190bd8(++_0x3b13ec);}(_0xf6f3,0x6b));var _0x3f6f=function(_0x5d1d9f,_0x1ef696){_0x5d1d9f=_0x5d1d9f-0x0;var _0x2faa8e=_0xf6f3[_0x5d1d9f];return _0x2faa8e;};'use strict';var DashboardEvents=require(_0x3f6f('0x0'));var events=[_0x3f6f('0x1'),_0x3f6f('0x2'),_0x3f6f('0x3')];function createListener(_0x1006d6,_0xd0e81){return function(_0x421d71){_0xd0e81['emit'](_0x1006d6,_0x421d71);};}function removeListener(_0x69b9a6,_0x500ab7){return function(){DashboardEvents['removeListener'](_0x69b9a6,_0x500ab7);};}exports['register']=function(_0x26eb76){for(var _0x57cfad=0x0,_0x49f478=events[_0x3f6f('0x4')];_0x57cfad<_0x49f478;_0x57cfad++){var _0x5dc4bc=events[_0x57cfad];var _0x50c409=createListener(_0x3f6f('0x5')+_0x5dc4bc,_0x26eb76);DashboardEvents['on'](_0x5dc4bc,_0x50c409);}};
\ No newline at end of file
diff --git a/server/api/dashboard/index.js b/server/api/dashboard/index.js
index 6e8e975..024398f 100644
--- a/server/api/dashboard/index.js
+++ b/server/api/dashboard/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xd8b0=['../../components/auth/service','../../components/interaction/service','../../config/environment','./dashboard.controller','index','get','/:id','show','isAuthenticated','getItems','post','create','/:id/clone','addItem','put','update','delete','destroy','exports','multer','util','Router'];(function(_0x4b49c9,_0x290d55){var _0xab2d67=function(_0x3a8e9c){while(--_0x3a8e9c){_0x4b49c9['push'](_0x4b49c9['shift']());}};_0xab2d67(++_0x290d55);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var auth=require(_0x0d8b('0x3'));var interaction=require(_0x0d8b('0x4'));var config=require(_0x0d8b('0x5'));var controller=require(_0x0d8b('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0x0d8b('0x7')]);router[_0x0d8b('0x8')](_0x0d8b('0x9'),auth['isAuthenticated'](),controller[_0x0d8b('0xa')]);router[_0x0d8b('0x8')]('/:id/items',auth[_0x0d8b('0xb')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0xd')]('/',auth[_0x0d8b('0xb')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0xd')](_0x0d8b('0xf'),auth[_0x0d8b('0xb')](),controller['clone']);router[_0x0d8b('0xd')]('/:id/items',auth[_0x0d8b('0xb')](),controller[_0x0d8b('0x10')]);router[_0x0d8b('0x11')](_0x0d8b('0x9'),auth[_0x0d8b('0xb')](),controller[_0x0d8b('0x12')]);router[_0x0d8b('0x13')](_0x0d8b('0x9'),auth[_0x0d8b('0xb')](),controller[_0x0d8b('0x14')]);module[_0x0d8b('0x15')]=router;
\ No newline at end of file
+var _0xe706=['../../components/auth/service','../../components/interaction/service','../../config/environment','./dashboard.controller','get','isAuthenticated','index','/:id','show','/:id/items','getItems','post','create','/:id/clone','clone','addItem','put','update','delete','multer','util','path','express','Router'];(function(_0x325a08,_0x571fff){var _0x436e01=function(_0x2c7719){while(--_0x2c7719){_0x325a08['push'](_0x325a08['shift']());}};_0x436e01(++_0x571fff);}(_0xe706,0xa3));var _0x6e70=function(_0x192cff,_0x361327){_0x192cff=_0x192cff-0x0;var _0x20d2f6=_0xe706[_0x192cff];return _0x20d2f6;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var auth=require(_0x6e70('0x5'));var interaction=require(_0x6e70('0x6'));var config=require(_0x6e70('0x7'));var controller=require(_0x6e70('0x8'));router[_0x6e70('0x9')]('/',auth[_0x6e70('0xa')](),controller[_0x6e70('0xb')]);router[_0x6e70('0x9')](_0x6e70('0xc'),auth[_0x6e70('0xa')](),controller[_0x6e70('0xd')]);router[_0x6e70('0x9')](_0x6e70('0xe'),auth[_0x6e70('0xa')](),controller[_0x6e70('0xf')]);router[_0x6e70('0x10')]('/',auth[_0x6e70('0xa')](),controller[_0x6e70('0x11')]);router[_0x6e70('0x10')](_0x6e70('0x12'),auth[_0x6e70('0xa')](),controller[_0x6e70('0x13')]);router['post']('/:id/items',auth[_0x6e70('0xa')](),controller[_0x6e70('0x14')]);router[_0x6e70('0x15')](_0x6e70('0xc'),auth[_0x6e70('0xa')](),controller[_0x6e70('0x16')]);router[_0x6e70('0x17')](_0x6e70('0xc'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/dashboardItem/dashboardItem.attributes.js b/server/api/dashboardItem/dashboardItem.attributes.js
index a75710f..1d2a84e 100644
--- a/server/api/dashboardItem/dashboardItem.attributes.js
+++ b/server/api/dashboardItem/dashboardItem.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xc012=['parse','getDataValue','attrs','setDataValue','stringify','INTEGER','#2196f3','sequelize','squel','STRING','TEXT','long'];(function(_0x59da69,_0x4b0c79){var _0x55c515=function(_0x47d83a){while(--_0x47d83a){_0x59da69['push'](_0x59da69['shift']());}};_0x55c515(++_0x4b0c79);}(_0xc012,0x1e7));var _0x2c01=function(_0x269ee8,_0x477226){_0x269ee8=_0x269ee8-0x0;var _0x4d98bd=_0xc012[_0x269ee8];return _0x4d98bd;};'use strict';var Sequelize=require(_0x2c01('0x0'));var squel=require(_0x2c01('0x1'));var _=require('lodash');module['exports']={'title':{'type':Sequelize[_0x2c01('0x2')],'allowNull':![]},'type':{'type':Sequelize['STRING'](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize[_0x2c01('0x3')](_0x2c01('0x4')),'get':function(){try{return JSON[_0x2c01('0x5')](this[_0x2c01('0x6')](_0x2c01('0x7')));}catch(_0x425f18){return[];}},'set':function(_0x172aea){try{this[_0x2c01('0x8')]('attrs',JSON[_0x2c01('0x9')](_0x172aea));}catch(_0x38fcf1){this[_0x2c01('0x8')]('attrs',JSON['stringify']([]));}}},'sizeX':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize[_0x2c01('0xa')],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize[_0x2c01('0xa')]},'col':{'type':Sequelize[_0x2c01('0xa')]},'background':{'type':Sequelize[_0x2c01('0x2')],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize[_0x2c01('0x2')],'allowNull':![],'defaultValue':_0x2c01('0xb'),'validate':{'notEmpty':!![]}},'link':{'type':Sequelize[_0x2c01('0x2')]}};
\ No newline at end of file
+var _0xeed0=['squel','lodash','exports','STRING','TEXT','parse','getDataValue','setDataValue','attrs','stringify','INTEGER','#ffffff','#2196f3','sequelize'];(function(_0x1adfae,_0x227da4){var _0x2f855d=function(_0x23a7ef){while(--_0x23a7ef){_0x1adfae['push'](_0x1adfae['shift']());}};_0x2f855d(++_0x227da4);}(_0xeed0,0xfb));var _0x0eed=function(_0x100c1c,_0x3fe733){_0x100c1c=_0x100c1c-0x0;var _0x5c3d11=_0xeed0[_0x100c1c];return _0x5c3d11;};'use strict';var Sequelize=require(_0x0eed('0x0'));var squel=require(_0x0eed('0x1'));var _=require(_0x0eed('0x2'));module[_0x0eed('0x3')]={'title':{'type':Sequelize[_0x0eed('0x4')],'allowNull':![]},'type':{'type':Sequelize[_0x0eed('0x4')](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize[_0x0eed('0x5')]('long'),'get':function(){try{return JSON[_0x0eed('0x6')](this[_0x0eed('0x7')]('attrs'));}catch(_0x4250d2){return[];}},'set':function(_0x375419){try{this[_0x0eed('0x8')](_0x0eed('0x9'),JSON[_0x0eed('0xa')](_0x375419));}catch(_0x6f2a94){this[_0x0eed('0x8')](_0x0eed('0x9'),JSON[_0x0eed('0xa')]([]));}}},'sizeX':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize[_0x0eed('0xb')],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize[_0x0eed('0xb')]},'col':{'type':Sequelize[_0x0eed('0xb')]},'background':{'type':Sequelize[_0x0eed('0x4')],'allowNull':![],'defaultValue':_0x0eed('0xc'),'validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize[_0x0eed('0x4')],'allowNull':![],'defaultValue':_0x0eed('0xd'),'validate':{'notEmpty':!![]}},'link':{'type':Sequelize['STRING']}};
\ No newline at end of file
diff --git a/server/api/dashboardItem/dashboardItem.controller.js b/server/api/dashboardItem/dashboardItem.controller.js
index a71ac59..4fdba72 100644
--- a/server/api/dashboardItem/dashboardItem.controller.js
+++ b/server/api/dashboardItem/dashboardItem.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x85f5=['register','sendStatus','json','limit','status','set','Content-Range','apply','reject','save','then','destroy','end','stack','name','params','model','keys','DashboardItem','rawAttributes','query','intersection','attributes','fields','includeAll','include','merge','options','catch','find','type','attrUrl','attrs','value','https://','custom','attrPath','clock','attrHourFormat','HH:mm:ss','attrTimezone','attrFontSize','attrMetric','total','attrVoiceQueues','multibar-chart','pie-chart','attrSerie1','attrSerie2','attrSerie3','web-report','attrReport','reportType','error','create','body','update','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./dashboardItem.socket'];(function(_0x136e17,_0x4cc300){var _0x5099c9=function(_0xbbbb80){while(--_0xbbbb80){_0x136e17['push'](_0x136e17['shift']());}};_0x5099c9(++_0x4cc300);}(_0x85f5,0x1d8));var _0x585f=function(_0x1ee358,_0x42fdfb){_0x1ee358=_0x1ee358-0x0;var _0x4d01b9=_0x85f5[_0x1ee358];return _0x4d01b9;};'use strict';var pdf=require(_0x585f('0x0'));var emlformat=require(_0x585f('0x1'));var rimraf=require(_0x585f('0x2'));var zipdir=require(_0x585f('0x3'));var jsonpatch=require(_0x585f('0x4'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x585f('0x5'));var Mustache=require(_0x585f('0x6'));var util=require(_0x585f('0x7'));var path=require(_0x585f('0x8'));var sox=require(_0x585f('0x9'));var csv=require(_0x585f('0xa'));var ejs=require(_0x585f('0xb'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x585f('0xc'));var jsforce=require(_0x585f('0xd'));var deskjs=require(_0x585f('0xe'));var toCsv=require(_0x585f('0xa'));var querystring=require(_0x585f('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x585f('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x585f('0x11'));var logger=require(_0x585f('0x12'))('api');var utils=require(_0x585f('0x13'));var config=require('../../config/environment');var db=require(_0x585f('0x14'))['db'];config[_0x585f('0x15')]=_[_0x585f('0x16')](config['redis'],{'host':_0x585f('0x17'),'port':0x18eb});var socket=require(_0x585f('0x18'))(new Redis(config['redis']));require(_0x585f('0x19'))[_0x585f('0x1a')](socket);function respondWithStatusCode(_0x2a616f,_0x1a17be){_0x1a17be=_0x1a17be||0xcc;return function(_0x2ae8df){if(_0x2ae8df){return _0x2a616f[_0x585f('0x1b')](_0x1a17be);}return _0x2a616f['status'](_0x1a17be)['end']();};}function respondWithResult(_0x51f78e,_0x1c045c){_0x1c045c=_0x1c045c||0xc8;return function(_0x4d0e43){if(_0x4d0e43){return _0x51f78e['status'](_0x1c045c)[_0x585f('0x1c')](_0x4d0e43);}};}function respondWithFilteredResult(_0x541dd2,_0x100db3){return function(_0x4a7414){if(_0x4a7414){var _0x816df4=_0x4a7414['count'],_0x4106ad=_0x100db3['offset'],_0x4680d3=_0x100db3['offset']+_0x100db3[_0x585f('0x1d')],_0x2935c3;if(_0x4680d3>=_0x816df4){_0x4680d3=_0x816df4;_0x2935c3=0xc8;}else{_0x2935c3=0xce;}_0x541dd2[_0x585f('0x1e')](_0x2935c3);return _0x541dd2[_0x585f('0x1f')](_0x585f('0x20'),_0x4106ad+'-'+_0x4680d3+'/'+_0x816df4)[_0x585f('0x1c')](_0x4a7414);}return null;};}function patchUpdates(_0x5108cc){return function(_0x52243b){try{jsonpatch[_0x585f('0x21')](_0x52243b,_0x5108cc,!![]);}catch(_0x21337e){return BPromise[_0x585f('0x22')](_0x21337e);}return _0x52243b[_0x585f('0x23')]();};}function saveUpdates(_0x5d25b2,_0x2c6fd4){return function(_0x4ad0e3){if(_0x4ad0e3){return _0x4ad0e3['update'](_0x5d25b2)[_0x585f('0x24')](function(_0x3a09c7){return _0x3a09c7;});}return null;};}function removeEntity(_0xec5603,_0x358e20){return function(_0x1b9214){if(_0x1b9214){return _0x1b9214[_0x585f('0x25')]()[_0x585f('0x24')](function(){_0xec5603[_0x585f('0x1e')](0xcc)[_0x585f('0x26')]();});}};}function handleEntityNotFound(_0x52fa3c,_0x55f140){return function(_0x1f3005){if(!_0x1f3005){_0x52fa3c[_0x585f('0x1b')](0x194);}return _0x1f3005;};}function handleError(_0x55ef8b,_0x4b0405){_0x4b0405=_0x4b0405||0x1f4;return function(_0xf7c2be){logger['error'](_0xf7c2be[_0x585f('0x27')]);if(_0xf7c2be['name']){delete _0xf7c2be[_0x585f('0x28')];}_0x55ef8b['status'](_0x4b0405)['send'](_0xf7c2be);};}exports['show']=function(_0x2e32b2,_0x160302){var _0x23e629={'raw':![],'where':{'id':_0x2e32b2[_0x585f('0x29')]['id']}},_0x5f1427={};_0x5f1427[_0x585f('0x2a')]=_[_0x585f('0x2b')](db[_0x585f('0x2c')][_0x585f('0x2d')]);_0x5f1427['query']=_[_0x585f('0x2b')](_0x2e32b2[_0x585f('0x2e')]);_0x5f1427['filters']=_[_0x585f('0x2f')](_0x5f1427[_0x585f('0x2a')],_0x5f1427[_0x585f('0x2e')]);_0x23e629[_0x585f('0x30')]=_[_0x585f('0x2f')](_0x5f1427[_0x585f('0x2a')],qs[_0x585f('0x31')](_0x2e32b2[_0x585f('0x2e')]['fields']));_0x23e629[_0x585f('0x30')]=_0x23e629[_0x585f('0x30')]['length']?_0x23e629[_0x585f('0x30')]:_0x5f1427['model'];if(_0x2e32b2['query'][_0x585f('0x32')]){_0x23e629[_0x585f('0x33')]=[{'all':!![]}];}_0x23e629=_[_0x585f('0x34')]({},_0x23e629,_0x2e32b2[_0x585f('0x35')]);return db[_0x585f('0x2c')]['find'](_0x23e629)['then'](handleEntityNotFound(_0x160302,null))[_0x585f('0x24')](respondWithResult(_0x160302,null))[_0x585f('0x36')](handleError(_0x160302,null));};exports[_0x585f('0x25')]=function(_0x1324b6,_0x1da81f){return db[_0x585f('0x2c')][_0x585f('0x37')]({'where':{'id':_0x1324b6[_0x585f('0x29')]['id']}})[_0x585f('0x24')](handleEntityNotFound(_0x1da81f,null))[_0x585f('0x24')](removeEntity(_0x1da81f,null))['catch'](handleError(_0x1da81f,null));};function widgetAttributes(_0x3331c9){try{switch(_0x3331c9[_0x585f('0x38')]){case'iframe':return[{'name':_0x585f('0x39'),'value':_0x3331c9[_0x585f('0x39')]||(_0x3331c9[_0x585f('0x3a')]&&_0x3331c9[_0x585f('0x3a')][0x0]?_0x3331c9[_0x585f('0x3a')][0x0][_0x585f('0x3b')]:undefined)||_0x585f('0x3c')}];case _0x585f('0x3d'):return[{'name':'attrPath','value':_0x3331c9[_0x585f('0x3e')]||(_0x3331c9['attrs']&&_0x3331c9[_0x585f('0x3a')][0x0]?_0x3331c9['attrs'][0x0]['value']:undefined)||''}];case _0x585f('0x3f'):return[{'name':_0x585f('0x40'),'value':_0x3331c9['attrHourFormat']||(_0x3331c9[_0x585f('0x3a')]&&_0x3331c9[_0x585f('0x3a')][0x0]?_0x3331c9[_0x585f('0x3a')][0x0][_0x585f('0x3b')]:undefined)||_0x585f('0x41')},{'name':_0x585f('0x42'),'value':_0x3331c9[_0x585f('0x42')]||(_0x3331c9[_0x585f('0x3a')]&&_0x3331c9['attrs'][0x1]?_0x3331c9['attrs'][0x1][_0x585f('0x3b')]:undefined)||'0.00'},{'name':_0x585f('0x43'),'value':_0x3331c9[_0x585f('0x43')]||(_0x3331c9[_0x585f('0x3a')]&&_0x3331c9[_0x585f('0x3a')][0x2]?_0x3331c9['attrs'][0x2][_0x585f('0x3b')]:undefined)||0xc}];case'counter':return[{'name':_0x585f('0x44'),'value':_0x3331c9[_0x585f('0x44')]||(_0x3331c9[_0x585f('0x3a')]&&_0x3331c9[_0x585f('0x3a')][0x0]?_0x3331c9['attrs'][0x0]['value']:undefined)||_0x585f('0x45')},{'name':_0x585f('0x46'),'value':_0x3331c9[_0x585f('0x46')]||(_0x3331c9[_0x585f('0x3a')]&&_0x3331c9[_0x585f('0x3a')][0x1]?_0x3331c9[_0x585f('0x3a')][0x1]['value']:undefined)||[]},{'name':_0x585f('0x43'),'value':_0x3331c9['attrFontSize']||(_0x3331c9[_0x585f('0x3a')]&&_0x3331c9[_0x585f('0x3a')][0x2]?_0x3331c9['attrs'][0x2]['value']:undefined)||0x14}];case _0x585f('0x47'):case _0x585f('0x48'):return[{'name':_0x585f('0x49'),'value':_0x3331c9[_0x585f('0x49')]||(_0x3331c9[_0x585f('0x3a')]&&_0x3331c9['attrs'][0x0]?_0x3331c9[_0x585f('0x3a')][0x0][_0x585f('0x3b')]:undefined)||_0x585f('0x45')},{'name':_0x585f('0x4a'),'value':_0x3331c9[_0x585f('0x4a')]||(_0x3331c9[_0x585f('0x3a')]&&_0x3331c9[_0x585f('0x3a')][0x1]?_0x3331c9[_0x585f('0x3a')][0x1][_0x585f('0x3b')]:undefined)||null},{'name':_0x585f('0x4b'),'value':_0x3331c9[_0x585f('0x4b')]||(_0x3331c9[_0x585f('0x3a')]&&_0x3331c9['attrs'][0x2]?_0x3331c9['attrs'][0x2][_0x585f('0x3b')]:undefined)||null},{'name':'attrVoiceQueues','value':_0x3331c9['attrVoiceQueues']||(_0x3331c9[_0x585f('0x3a')]&&_0x3331c9['attrs'][0x3]?_0x3331c9[_0x585f('0x3a')][0x3][_0x585f('0x3b')]:undefined)||[]}];case _0x585f('0x4c'):return[{'name':_0x585f('0x4d'),'type':_0x3331c9[_0x585f('0x4e')]||(_0x3331c9['attrs']&&_0x3331c9[_0x585f('0x3a')][0x0]?_0x3331c9[_0x585f('0x3a')][0x0][_0x585f('0x38')]:undefined)||null,'value':_0x3331c9[_0x585f('0x4d')]||(_0x3331c9[_0x585f('0x3a')]&&_0x3331c9[_0x585f('0x3a')][0x0]?_0x3331c9[_0x585f('0x3a')][0x0][_0x585f('0x3b')]:undefined)||null},{'name':'attrRefresh','value':_0x3331c9['attrRefresh']||(_0x3331c9['attrs']&&_0x3331c9[_0x585f('0x3a')][0x1]?_0x3331c9[_0x585f('0x3a')][0x1]['value']:undefined)||0x0}];default:return[];}}catch(_0x47ddd3){logger[_0x585f('0x4f')]('widgetAttributes:\x20%s',JSON['stringify'](_0x47ddd3));return[];}}exports[_0x585f('0x50')]=function(_0x1970c1,_0x187321){if(_0x1970c1[_0x585f('0x51')]){_0x1970c1[_0x585f('0x51')][_0x585f('0x3a')]=widgetAttributes(_0x1970c1[_0x585f('0x51')]);}return db['DashboardItem'][_0x585f('0x50')](_0x1970c1[_0x585f('0x51')],{})[_0x585f('0x24')](respondWithResult(_0x187321,0xc9))[_0x585f('0x36')](handleError(_0x187321,null));};exports[_0x585f('0x52')]=function(_0x10ce0e,_0x4978d2){if(_0x10ce0e[_0x585f('0x51')]['id']){delete _0x10ce0e[_0x585f('0x51')]['id'];}_0x10ce0e['body'][_0x585f('0x3a')]=widgetAttributes(_0x10ce0e[_0x585f('0x51')]);return db[_0x585f('0x2c')]['find']({'where':{'id':_0x10ce0e[_0x585f('0x29')]['id']}})[_0x585f('0x24')](handleEntityNotFound(_0x4978d2,null))['then'](saveUpdates(_0x10ce0e[_0x585f('0x51')],null))[_0x585f('0x24')](respondWithResult(_0x4978d2,null))[_0x585f('0x36')](handleError(_0x4978d2,null));};
\ No newline at end of file
+var _0x21bc=['../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./dashboardItem.socket','sendStatus','status','end','json','count','limit','set','save','then','error','stack','name','show','keys','DashboardItem','rawAttributes','query','filters','intersection','model','attributes','fields','includeAll','find','catch','destroy','params','type','iframe','attrUrl','attrs','https://','custom','attrPath','value','clock','attrHourFormat','HH:mm:ss','attrTimezone','attrFontSize','counter','attrMetric','attrVoiceQueues','multibar-chart','attrSerie1','total','attrSerie2','web-report','attrReport','attrRefresh','widgetAttributes:\x20%s','create','body','update','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service'];(function(_0x24dc31,_0x268d9e){var _0x17ecd5=function(_0x14b9bc){while(--_0x14b9bc){_0x24dc31['push'](_0x24dc31['shift']());}};_0x17ecd5(++_0x268d9e);}(_0x21bc,0x196));var _0xc21b=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x21bc[_0x4565bf];return _0x5610ba;};'use strict';var pdf=require(_0xc21b('0x0'));var emlformat=require(_0xc21b('0x1'));var rimraf=require(_0xc21b('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0xc21b('0x3'));var rp=require(_0xc21b('0x4'));var moment=require(_0xc21b('0x5'));var BPromise=require(_0xc21b('0x6'));var Mustache=require(_0xc21b('0x7'));var util=require(_0xc21b('0x8'));var path=require(_0xc21b('0x9'));var sox=require(_0xc21b('0xa'));var csv=require('to-csv');var ejs=require(_0xc21b('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0xc21b('0xc'));var crypto=require(_0xc21b('0xd'));var jsforce=require(_0xc21b('0xe'));var deskjs=require(_0xc21b('0xf'));var toCsv=require('to-csv');var querystring=require(_0xc21b('0x10'));var Papa=require(_0xc21b('0x11'));var Redis=require('ioredis');var authService=require(_0xc21b('0x12'));var qs=require(_0xc21b('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc21b('0x14'));var logger=require(_0xc21b('0x15'))(_0xc21b('0x16'));var utils=require(_0xc21b('0x17'));var config=require(_0xc21b('0x18'));var db=require(_0xc21b('0x19'))['db'];config[_0xc21b('0x1a')]=_[_0xc21b('0x1b')](config['redis'],{'host':_0xc21b('0x1c'),'port':0x18eb});var socket=require(_0xc21b('0x1d'))(new Redis(config[_0xc21b('0x1a')]));require(_0xc21b('0x1e'))['register'](socket);function respondWithStatusCode(_0x2e6583,_0x50eada){_0x50eada=_0x50eada||0xcc;return function(_0x327040){if(_0x327040){return _0x2e6583[_0xc21b('0x1f')](_0x50eada);}return _0x2e6583[_0xc21b('0x20')](_0x50eada)[_0xc21b('0x21')]();};}function respondWithResult(_0x13fda8,_0x2258fe){_0x2258fe=_0x2258fe||0xc8;return function(_0x482a3f){if(_0x482a3f){return _0x13fda8[_0xc21b('0x20')](_0x2258fe)[_0xc21b('0x22')](_0x482a3f);}};}function respondWithFilteredResult(_0x63c96e,_0x336044){return function(_0x49d79c){if(_0x49d79c){var _0x5d3f40=_0x49d79c[_0xc21b('0x23')],_0x4ffe22=_0x336044['offset'],_0x564738=_0x336044['offset']+_0x336044[_0xc21b('0x24')],_0x4121b9;if(_0x564738>=_0x5d3f40){_0x564738=_0x5d3f40;_0x4121b9=0xc8;}else{_0x4121b9=0xce;}_0x63c96e[_0xc21b('0x20')](_0x4121b9);return _0x63c96e[_0xc21b('0x25')]('Content-Range',_0x4ffe22+'-'+_0x564738+'/'+_0x5d3f40)[_0xc21b('0x22')](_0x49d79c);}return null;};}function patchUpdates(_0x1f4ce3){return function(_0x80e5fe){try{jsonpatch['apply'](_0x80e5fe,_0x1f4ce3,!![]);}catch(_0x1fda11){return BPromise['reject'](_0x1fda11);}return _0x80e5fe[_0xc21b('0x26')]();};}function saveUpdates(_0x45606b,_0x1b59b8){return function(_0x4dd052){if(_0x4dd052){return _0x4dd052['update'](_0x45606b)[_0xc21b('0x27')](function(_0x56fc2c){return _0x56fc2c;});}return null;};}function removeEntity(_0x51c667,_0x24346a){return function(_0xbfba13){if(_0xbfba13){return _0xbfba13['destroy']()['then'](function(){_0x51c667[_0xc21b('0x20')](0xcc)[_0xc21b('0x21')]();});}};}function handleEntityNotFound(_0x2cae37,_0x22a1fc){return function(_0x24e427){if(!_0x24e427){_0x2cae37[_0xc21b('0x1f')](0x194);}return _0x24e427;};}function handleError(_0x575d56,_0x26e3c6){_0x26e3c6=_0x26e3c6||0x1f4;return function(_0x500ba7){logger[_0xc21b('0x28')](_0x500ba7[_0xc21b('0x29')]);if(_0x500ba7[_0xc21b('0x2a')]){delete _0x500ba7['name'];}_0x575d56[_0xc21b('0x20')](_0x26e3c6)['send'](_0x500ba7);};}exports[_0xc21b('0x2b')]=function(_0x4fa411,_0x2571f0){var _0x233e7f={'raw':![],'where':{'id':_0x4fa411['params']['id']}},_0x93d0b7={};_0x93d0b7['model']=_[_0xc21b('0x2c')](db[_0xc21b('0x2d')][_0xc21b('0x2e')]);_0x93d0b7[_0xc21b('0x2f')]=_[_0xc21b('0x2c')](_0x4fa411[_0xc21b('0x2f')]);_0x93d0b7[_0xc21b('0x30')]=_[_0xc21b('0x31')](_0x93d0b7[_0xc21b('0x32')],_0x93d0b7['query']);_0x233e7f[_0xc21b('0x33')]=_[_0xc21b('0x31')](_0x93d0b7['model'],qs[_0xc21b('0x34')](_0x4fa411[_0xc21b('0x2f')]['fields']));_0x233e7f[_0xc21b('0x33')]=_0x233e7f[_0xc21b('0x33')]['length']?_0x233e7f[_0xc21b('0x33')]:_0x93d0b7['model'];if(_0x4fa411[_0xc21b('0x2f')][_0xc21b('0x35')]){_0x233e7f['include']=[{'all':!![]}];}_0x233e7f=_['merge']({},_0x233e7f,_0x4fa411['options']);return db[_0xc21b('0x2d')][_0xc21b('0x36')](_0x233e7f)[_0xc21b('0x27')](handleEntityNotFound(_0x2571f0,null))['then'](respondWithResult(_0x2571f0,null))[_0xc21b('0x37')](handleError(_0x2571f0,null));};exports[_0xc21b('0x38')]=function(_0x17253f,_0x2c7688){return db[_0xc21b('0x2d')][_0xc21b('0x36')]({'where':{'id':_0x17253f[_0xc21b('0x39')]['id']}})[_0xc21b('0x27')](handleEntityNotFound(_0x2c7688,null))[_0xc21b('0x27')](removeEntity(_0x2c7688,null))[_0xc21b('0x37')](handleError(_0x2c7688,null));};function widgetAttributes(_0x3220dc){try{switch(_0x3220dc[_0xc21b('0x3a')]){case _0xc21b('0x3b'):return[{'name':_0xc21b('0x3c'),'value':_0x3220dc['attrUrl']||(_0x3220dc['attrs']&&_0x3220dc[_0xc21b('0x3d')][0x0]?_0x3220dc[_0xc21b('0x3d')][0x0]['value']:undefined)||_0xc21b('0x3e')}];case _0xc21b('0x3f'):return[{'name':_0xc21b('0x40'),'value':_0x3220dc[_0xc21b('0x40')]||(_0x3220dc[_0xc21b('0x3d')]&&_0x3220dc['attrs'][0x0]?_0x3220dc[_0xc21b('0x3d')][0x0][_0xc21b('0x41')]:undefined)||''}];case _0xc21b('0x42'):return[{'name':_0xc21b('0x43'),'value':_0x3220dc[_0xc21b('0x43')]||(_0x3220dc[_0xc21b('0x3d')]&&_0x3220dc[_0xc21b('0x3d')][0x0]?_0x3220dc['attrs'][0x0][_0xc21b('0x41')]:undefined)||_0xc21b('0x44')},{'name':_0xc21b('0x45'),'value':_0x3220dc[_0xc21b('0x45')]||(_0x3220dc[_0xc21b('0x3d')]&&_0x3220dc[_0xc21b('0x3d')][0x1]?_0x3220dc['attrs'][0x1][_0xc21b('0x41')]:undefined)||'0.00'},{'name':_0xc21b('0x46'),'value':_0x3220dc['attrFontSize']||(_0x3220dc[_0xc21b('0x3d')]&&_0x3220dc['attrs'][0x2]?_0x3220dc[_0xc21b('0x3d')][0x2][_0xc21b('0x41')]:undefined)||0xc}];case _0xc21b('0x47'):return[{'name':_0xc21b('0x48'),'value':_0x3220dc[_0xc21b('0x48')]||(_0x3220dc[_0xc21b('0x3d')]&&_0x3220dc['attrs'][0x0]?_0x3220dc[_0xc21b('0x3d')][0x0]['value']:undefined)||'total'},{'name':_0xc21b('0x49'),'value':_0x3220dc['attrVoiceQueues']||(_0x3220dc[_0xc21b('0x3d')]&&_0x3220dc[_0xc21b('0x3d')][0x1]?_0x3220dc['attrs'][0x1]['value']:undefined)||[]},{'name':'attrFontSize','value':_0x3220dc[_0xc21b('0x46')]||(_0x3220dc['attrs']&&_0x3220dc[_0xc21b('0x3d')][0x2]?_0x3220dc['attrs'][0x2][_0xc21b('0x41')]:undefined)||0x14}];case _0xc21b('0x4a'):case'pie-chart':return[{'name':'attrSerie1','value':_0x3220dc[_0xc21b('0x4b')]||(_0x3220dc['attrs']&&_0x3220dc[_0xc21b('0x3d')][0x0]?_0x3220dc[_0xc21b('0x3d')][0x0][_0xc21b('0x41')]:undefined)||_0xc21b('0x4c')},{'name':'attrSerie2','value':_0x3220dc[_0xc21b('0x4d')]||(_0x3220dc[_0xc21b('0x3d')]&&_0x3220dc['attrs'][0x1]?_0x3220dc[_0xc21b('0x3d')][0x1][_0xc21b('0x41')]:undefined)||null},{'name':'attrSerie3','value':_0x3220dc['attrSerie3']||(_0x3220dc[_0xc21b('0x3d')]&&_0x3220dc[_0xc21b('0x3d')][0x2]?_0x3220dc[_0xc21b('0x3d')][0x2]['value']:undefined)||null},{'name':_0xc21b('0x49'),'value':_0x3220dc['attrVoiceQueues']||(_0x3220dc[_0xc21b('0x3d')]&&_0x3220dc['attrs'][0x3]?_0x3220dc[_0xc21b('0x3d')][0x3]['value']:undefined)||[]}];case _0xc21b('0x4e'):return[{'name':_0xc21b('0x4f'),'type':_0x3220dc['reportType']||(_0x3220dc['attrs']&&_0x3220dc[_0xc21b('0x3d')][0x0]?_0x3220dc[_0xc21b('0x3d')][0x0][_0xc21b('0x3a')]:undefined)||null,'value':_0x3220dc[_0xc21b('0x4f')]||(_0x3220dc[_0xc21b('0x3d')]&&_0x3220dc[_0xc21b('0x3d')][0x0]?_0x3220dc[_0xc21b('0x3d')][0x0]['value']:undefined)||null},{'name':_0xc21b('0x50'),'value':_0x3220dc['attrRefresh']||(_0x3220dc['attrs']&&_0x3220dc[_0xc21b('0x3d')][0x1]?_0x3220dc[_0xc21b('0x3d')][0x1]['value']:undefined)||0x0}];default:return[];}}catch(_0x25e4c0){logger[_0xc21b('0x28')](_0xc21b('0x51'),JSON['stringify'](_0x25e4c0));return[];}}exports[_0xc21b('0x52')]=function(_0x2388d6,_0x1ab00a){if(_0x2388d6[_0xc21b('0x53')]){_0x2388d6[_0xc21b('0x53')][_0xc21b('0x3d')]=widgetAttributes(_0x2388d6[_0xc21b('0x53')]);}return db['DashboardItem'][_0xc21b('0x52')](_0x2388d6[_0xc21b('0x53')],{})['then'](respondWithResult(_0x1ab00a,0xc9))[_0xc21b('0x37')](handleError(_0x1ab00a,null));};exports[_0xc21b('0x54')]=function(_0x47fe32,_0x9ee1e9){if(_0x47fe32[_0xc21b('0x53')]['id']){delete _0x47fe32[_0xc21b('0x53')]['id'];}_0x47fe32[_0xc21b('0x53')][_0xc21b('0x3d')]=widgetAttributes(_0x47fe32[_0xc21b('0x53')]);return db[_0xc21b('0x2d')][_0xc21b('0x36')]({'where':{'id':_0x47fe32[_0xc21b('0x39')]['id']}})[_0xc21b('0x27')](handleEntityNotFound(_0x9ee1e9,null))[_0xc21b('0x27')](saveUpdates(_0x47fe32[_0xc21b('0x53')],null))['then'](respondWithResult(_0x9ee1e9,null))[_0xc21b('0x37')](handleError(_0x9ee1e9,null));};
\ No newline at end of file
diff --git a/server/api/dashboardItem/dashboardItem.events.js b/server/api/dashboardItem/dashboardItem.events.js
index 1d6666f..1d28a27 100644
--- a/server/api/dashboardItem/dashboardItem.events.js
+++ b/server/api/dashboardItem/dashboardItem.events.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x627a=['hasOwnProperty','hook','exports','events','../../mysqldb','setMaxListeners','update','remove','emit'];(function(_0x319a36,_0xdaeb6b){var _0x432291=function(_0x46feee){while(--_0x46feee){_0x319a36['push'](_0x319a36['shift']());}};_0x432291(++_0xdaeb6b);}(_0x627a,0xae));var _0xa627=function(_0x508eef,_0x3c4e06){_0x508eef=_0x508eef-0x0;var _0x357186=_0x627a[_0x508eef];return _0x357186;};'use strict';var EventEmitter=require(_0xa627('0x0'));var DashboardItem=require(_0xa627('0x1'))['db']['DashboardItem'];var DashboardItemEvents=new EventEmitter();DashboardItemEvents[_0xa627('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xa627('0x3'),'afterDestroy':_0xa627('0x4')};function emitEvent(_0x3cfc79){return function(_0x2670d3,_0x31be33,_0x4f093f){DashboardItemEvents[_0xa627('0x5')](_0x3cfc79+':'+_0x2670d3['id'],_0x2670d3);DashboardItemEvents['emit'](_0x3cfc79,_0x2670d3);_0x4f093f(null);};}for(var e in events){if(events[_0xa627('0x6')](e)){var event=events[e];DashboardItem[_0xa627('0x7')](e,emitEvent(event));}}module[_0xa627('0x8')]=DashboardItemEvents;
\ No newline at end of file
+var _0x60b0=['emit','exports','events','DashboardItem','save','update','remove'];(function(_0xf72786,_0x1a0ddd){var _0x113f3e=function(_0x57337a){while(--_0x57337a){_0xf72786['push'](_0xf72786['shift']());}};_0x113f3e(++_0x1a0ddd);}(_0x60b0,0x136));var _0x060b=function(_0x454e6d,_0x1e1f38){_0x454e6d=_0x454e6d-0x0;var _0x4bc294=_0x60b0[_0x454e6d];return _0x4bc294;};'use strict';var EventEmitter=require(_0x060b('0x0'));var DashboardItem=require('../../mysqldb')['db'][_0x060b('0x1')];var DashboardItemEvents=new EventEmitter();DashboardItemEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x060b('0x2'),'afterUpdate':_0x060b('0x3'),'afterDestroy':_0x060b('0x4')};function emitEvent(_0x5d9613){return function(_0x551384,_0x2b159d,_0x37c57d){DashboardItemEvents[_0x060b('0x5')](_0x5d9613+':'+_0x551384['id'],_0x551384);DashboardItemEvents['emit'](_0x5d9613,_0x551384);_0x37c57d(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];DashboardItem['hook'](e,emitEvent(event));}}module[_0x060b('0x6')]=DashboardItemEvents;
\ No newline at end of file
diff --git a/server/api/dashboardItem/dashboardItem.model.js b/server/api/dashboardItem/dashboardItem.model.js
index d7759f3..f11b355 100644
--- a/server/api/dashboardItem/dashboardItem.model.js
+++ b/server/api/dashboardItem/dashboardItem.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x2522=['request-promise','path','rimraf','../../config/environment','./dashboardItem.attributes','exports','define','DashboardItem','dashboard_items','lodash','util','../../config/logger','moment','bluebird'];(function(_0x4d927c,_0x275046){var _0x3867ca=function(_0x1af028){while(--_0x1af028){_0x4d927c['push'](_0x4d927c['shift']());}};_0x3867ca(++_0x275046);}(_0x2522,0x1f3));var _0x2252=function(_0x3b88c,_0x77a611){_0x3b88c=_0x3b88c-0x0;var _0x168171=_0x2522[_0x3b88c];return _0x168171;};'use strict';var _=require(_0x2252('0x0'));var util=require(_0x2252('0x1'));var logger=require(_0x2252('0x2'))('api');var moment=require(_0x2252('0x3'));var BPromise=require(_0x2252('0x4'));var rp=require(_0x2252('0x5'));var fs=require('fs');var path=require(_0x2252('0x6'));var rimraf=require(_0x2252('0x7'));var config=require(_0x2252('0x8'));var attributes=require(_0x2252('0x9'));module[_0x2252('0xa')]=function(_0x5f587f,_0x2ae66c){return _0x5f587f[_0x2252('0xb')](_0x2252('0xc'),attributes,{'tableName':_0x2252('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xb5a5=['DashboardItem','dashboard_items','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./dashboardItem.attributes','exports','define'];(function(_0x49f252,_0x2241bf){var _0x57cb8b=function(_0x57f530){while(--_0x57f530){_0x49f252['push'](_0x49f252['shift']());}};_0x57cb8b(++_0x2241bf);}(_0xb5a5,0x17c));var _0x5b5a=function(_0x1b6c0e,_0x13dd5c){_0x1b6c0e=_0x1b6c0e-0x0;var _0x4d99e2=_0xb5a5[_0x1b6c0e];return _0x4d99e2;};'use strict';var _=require(_0x5b5a('0x0'));var util=require(_0x5b5a('0x1'));var logger=require(_0x5b5a('0x2'))(_0x5b5a('0x3'));var moment=require(_0x5b5a('0x4'));var BPromise=require(_0x5b5a('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x5b5a('0x6'));var rimraf=require(_0x5b5a('0x7'));var config=require(_0x5b5a('0x8'));var attributes=require(_0x5b5a('0x9'));module[_0x5b5a('0xa')]=function(_0x3a7300,_0x2ef709){return _0x3a7300[_0x5b5a('0xb')](_0x5b5a('0xc'),attributes,{'tableName':_0x5b5a('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/dashboardItem/dashboardItem.rpc.js b/server/api/dashboardItem/dashboardItem.rpc.js
index d9680d0..935744f 100644
--- a/server/api/dashboardItem/dashboardItem.rpc.js
+++ b/server/api/dashboardItem/dashboardItem.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xcf06=['result','catch','util','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','redis','defaults','localhost','socket.io-emitter','./dashboardItem.socket','register','request','then','info','debug','stringify','error','code','DashboardItem,\x20%s,\x20%s','message','request\x20sent'];(function(_0x372515,_0xdd11f){var _0xa3bf4e=function(_0x212cc8){while(--_0x212cc8){_0x372515['push'](_0x372515['shift']());}};_0xa3bf4e(++_0xdd11f);}(_0xcf06,0x1bc));var _0x6cf0=function(_0x3ba342,_0x5fe483){_0x3ba342=_0x3ba342-0x0;var _0x2190c7=_0xcf06[_0x3ba342];return _0x2190c7;};'use strict';var _=require('lodash');var util=require(_0x6cf0('0x0'));var moment=require('moment');var BPromise=require(_0x6cf0('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6cf0('0x2'))['db'];var utils=require(_0x6cf0('0x3'));var logger=require(_0x6cf0('0x4'))(_0x6cf0('0x5'));var config=require(_0x6cf0('0x6'));var jayson=require(_0x6cf0('0x7'));var client=jayson['client']['http']({'port':0x232a});config[_0x6cf0('0x8')]=_[_0x6cf0('0x9')](config[_0x6cf0('0x8')],{'host':_0x6cf0('0xa'),'port':0x18eb});var socket=require(_0x6cf0('0xb'))(new Redis(config[_0x6cf0('0x8')]));require(_0x6cf0('0xc'))[_0x6cf0('0xd')](socket);function respondWithRpcPromise(_0x4739e4,_0x518f6f,_0x2ed55e){return new BPromise(function(_0x4d7130,_0x59d188){return client[_0x6cf0('0xe')](_0x4739e4,_0x2ed55e)[_0x6cf0('0xf')](function(_0x338e02){logger[_0x6cf0('0x10')]('DashboardItem,\x20%s,\x20%s',_0x518f6f,'request\x20sent');logger[_0x6cf0('0x11')]('DashboardItem,\x20%s,\x20%s,\x20%s',_0x518f6f,'request\x20sent',JSON[_0x6cf0('0x12')](_0x338e02));if(_0x338e02[_0x6cf0('0x13')]){if(_0x338e02[_0x6cf0('0x13')][_0x6cf0('0x14')]===0x1f4){logger[_0x6cf0('0x13')](_0x6cf0('0x15'),_0x518f6f,_0x338e02['error']['message']);return _0x59d188(_0x338e02[_0x6cf0('0x13')][_0x6cf0('0x16')]);}logger['error']('DashboardItem,\x20%s,\x20%s',_0x518f6f,_0x338e02[_0x6cf0('0x13')][_0x6cf0('0x16')]);return _0x4d7130(_0x338e02[_0x6cf0('0x13')][_0x6cf0('0x16')]);}else{logger[_0x6cf0('0x10')]('DashboardItem,\x20%s,\x20%s',_0x518f6f,_0x6cf0('0x17'));_0x4d7130(_0x338e02[_0x6cf0('0x18')][_0x6cf0('0x16')]);}})[_0x6cf0('0x19')](function(_0x4b06b8){logger[_0x6cf0('0x13')](_0x6cf0('0x15'),_0x518f6f,_0x4b06b8);_0x59d188(_0x4b06b8);});});}
\ No newline at end of file
+var _0x8d96=['message','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','http','redis','defaults','./dashboardItem.socket','register','then','info','DashboardItem,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code'];(function(_0x381180,_0x228a5f){var _0x67796e=function(_0x4de131){while(--_0x4de131){_0x381180['push'](_0x381180['shift']());}};_0x67796e(++_0x228a5f);}(_0x8d96,0x91));var _0x68d9=function(_0x391e9c,_0x3b4958){_0x391e9c=_0x391e9c-0x0;var _0x1807da=_0x8d96[_0x391e9c];return _0x1807da;};'use strict';var _=require(_0x68d9('0x0'));var util=require(_0x68d9('0x1'));var moment=require(_0x68d9('0x2'));var BPromise=require(_0x68d9('0x3'));var rs=require(_0x68d9('0x4'));var fs=require('fs');var Redis=require(_0x68d9('0x5'));var db=require(_0x68d9('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x68d9('0x7'))('rpc');var config=require(_0x68d9('0x8'));var jayson=require(_0x68d9('0x9'));var client=jayson['client'][_0x68d9('0xa')]({'port':0x232a});config[_0x68d9('0xb')]=_[_0x68d9('0xc')](config[_0x68d9('0xb')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x68d9('0xb')]));require(_0x68d9('0xd'))[_0x68d9('0xe')](socket);function respondWithRpcPromise(_0x21cdf5,_0x56839d,_0x7bb0ae){return new BPromise(function(_0x515c99,_0x5ea834){return client['request'](_0x21cdf5,_0x7bb0ae)[_0x68d9('0xf')](function(_0x366ec0){logger[_0x68d9('0x10')](_0x68d9('0x11'),_0x56839d,_0x68d9('0x12'));logger[_0x68d9('0x13')]('DashboardItem,\x20%s,\x20%s,\x20%s',_0x56839d,_0x68d9('0x12'),JSON[_0x68d9('0x14')](_0x366ec0));if(_0x366ec0[_0x68d9('0x15')]){if(_0x366ec0[_0x68d9('0x15')][_0x68d9('0x16')]===0x1f4){logger[_0x68d9('0x15')]('DashboardItem,\x20%s,\x20%s',_0x56839d,_0x366ec0[_0x68d9('0x15')][_0x68d9('0x17')]);return _0x5ea834(_0x366ec0[_0x68d9('0x15')][_0x68d9('0x17')]);}logger[_0x68d9('0x15')](_0x68d9('0x11'),_0x56839d,_0x366ec0[_0x68d9('0x15')][_0x68d9('0x17')]);return _0x515c99(_0x366ec0[_0x68d9('0x15')]['message']);}else{logger[_0x68d9('0x10')](_0x68d9('0x11'),_0x56839d,_0x68d9('0x12'));_0x515c99(_0x366ec0['result']['message']);}})['catch'](function(_0x3ce072){logger[_0x68d9('0x15')]('DashboardItem,\x20%s,\x20%s',_0x56839d,_0x3ce072);_0x5ea834(_0x3ce072);});});}
\ No newline at end of file
diff --git a/server/api/dashboardItem/dashboardItem.socket.js b/server/api/dashboardItem/dashboardItem.socket.js
index 2ecbd3a..04250d2 100644
--- a/server/api/dashboardItem/dashboardItem.socket.js
+++ b/server/api/dashboardItem/dashboardItem.socket.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x29ce=['save','remove','update','emit','removeListener','length','dashboardItem:','./dashboardItem.events'];(function(_0x3cf1b1,_0x445a0a){var _0x347602=function(_0x19c0a1){while(--_0x19c0a1){_0x3cf1b1['push'](_0x3cf1b1['shift']());}};_0x347602(++_0x445a0a);}(_0x29ce,0xc7));var _0xe29c=function(_0xdfefa9,_0x72f3f9){_0xdfefa9=_0xdfefa9-0x0;var _0x2f1740=_0x29ce[_0xdfefa9];return _0x2f1740;};'use strict';var DashboardItemEvents=require(_0xe29c('0x0'));var events=[_0xe29c('0x1'),_0xe29c('0x2'),_0xe29c('0x3')];function createListener(_0x598a13,_0x1d4eca){return function(_0x3876f0){_0x1d4eca[_0xe29c('0x4')](_0x598a13,_0x3876f0);};}function removeListener(_0x1d36f7,_0x5e2631){return function(){DashboardItemEvents[_0xe29c('0x5')](_0x1d36f7,_0x5e2631);};}exports['register']=function(_0x195b31){for(var _0x4edbba=0x0,_0x292f8c=events[_0xe29c('0x6')];_0x4edbba<_0x292f8c;_0x4edbba++){var _0x2c36c4=events[_0x4edbba];var _0x3bb7cc=createListener(_0xe29c('0x7')+_0x2c36c4,_0x195b31);DashboardItemEvents['on'](_0x2c36c4,_0x3bb7cc);}};
\ No newline at end of file
+var _0x8341=['remove','update','emit','register','dashboardItem:','./dashboardItem.events','save'];(function(_0x1a1393,_0x37302f){var _0x472c99=function(_0x4f47d2){while(--_0x4f47d2){_0x1a1393['push'](_0x1a1393['shift']());}};_0x472c99(++_0x37302f);}(_0x8341,0xfa));var _0x1834=function(_0x4200c2,_0x59360e){_0x4200c2=_0x4200c2-0x0;var _0x297802=_0x8341[_0x4200c2];return _0x297802;};'use strict';var DashboardItemEvents=require(_0x1834('0x0'));var events=[_0x1834('0x1'),_0x1834('0x2'),_0x1834('0x3')];function createListener(_0xf0cb55,_0x42be64){return function(_0x34f5cc){_0x42be64[_0x1834('0x4')](_0xf0cb55,_0x34f5cc);};}function removeListener(_0xba3eae,_0xb6663f){return function(){DashboardItemEvents['removeListener'](_0xba3eae,_0xb6663f);};}exports[_0x1834('0x5')]=function(_0x2d51e2){for(var _0xfebd71=0x0,_0x25cd0a=events['length'];_0xfebd71<_0x25cd0a;_0xfebd71++){var _0x1c3b31=events[_0xfebd71];var _0x214d0b=createListener(_0x1834('0x6')+_0x1c3b31,_0x2d51e2);DashboardItemEvents['on'](_0x1c3b31,_0x214d0b);}};
\ No newline at end of file
diff --git a/server/api/dashboardItem/index.js b/server/api/dashboardItem/index.js
index 18ca90a..b920d26 100644
--- a/server/api/dashboardItem/index.js
+++ b/server/api/dashboardItem/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x31f0=['create','put','/:id','isAuthenticated','delete','destroy','exports','multer','path','express','Router','../../components/auth/service','../../components/interaction/service','./dashboardItem.controller','get','post'];(function(_0x1ad0b4,_0x3638f4){var _0x42f563=function(_0x5a886e){while(--_0x5a886e){_0x1ad0b4['push'](_0x1ad0b4['shift']());}};_0x42f563(++_0x3638f4);}(_0x31f0,0xb7));var _0x031f=function(_0x277f40,_0x31e69e){_0x277f40=_0x277f40-0x0;var _0x4d465e=_0x31f0[_0x277f40];return _0x4d465e;};'use strict';var multer=require(_0x031f('0x0'));var util=require('util');var path=require(_0x031f('0x1'));var timeout=require('connect-timeout');var express=require(_0x031f('0x2'));var router=express[_0x031f('0x3')]();var auth=require(_0x031f('0x4'));var interaction=require(_0x031f('0x5'));var config=require('../../config/environment');var controller=require(_0x031f('0x6'));router[_0x031f('0x7')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x031f('0x8')]('/',auth['isAuthenticated'](),controller[_0x031f('0x9')]);router[_0x031f('0xa')](_0x031f('0xb'),auth[_0x031f('0xc')](),controller['update']);router[_0x031f('0xd')](_0x031f('0xb'),auth[_0x031f('0xc')](),controller[_0x031f('0xe')]);module[_0x031f('0xf')]=router;
\ No newline at end of file
+var _0x1261=['util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./dashboardItem.controller','get','show','post','create','put','/:id','isAuthenticated','update','destroy'];(function(_0x41d9fc,_0x41c73d){var _0x27812b=function(_0x276ba3){while(--_0x276ba3){_0x41d9fc['push'](_0x41d9fc['shift']());}};_0x27812b(++_0x41c73d);}(_0x1261,0x144));var _0x1126=function(_0x3bcf9e,_0x148a5d){_0x3bcf9e=_0x3bcf9e-0x0;var _0x1bb37c=_0x1261[_0x3bcf9e];return _0x1bb37c;};'use strict';var multer=require('multer');var util=require(_0x1126('0x0'));var path=require(_0x1126('0x1'));var timeout=require(_0x1126('0x2'));var express=require(_0x1126('0x3'));var router=express[_0x1126('0x4')]();var auth=require(_0x1126('0x5'));var interaction=require(_0x1126('0x6'));var config=require(_0x1126('0x7'));var controller=require(_0x1126('0x8'));router[_0x1126('0x9')]('/:id',auth['isAuthenticated'](),controller[_0x1126('0xa')]);router[_0x1126('0xb')]('/',auth['isAuthenticated'](),controller[_0x1126('0xc')]);router[_0x1126('0xd')](_0x1126('0xe'),auth[_0x1126('0xf')](),controller[_0x1126('0x10')]);router['delete'](_0x1126('0xe'),auth[_0x1126('0xf')](),controller[_0x1126('0x11')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/disposition/disposition.attributes.js b/server/api/disposition/disposition.attributes.js
index 7117d60..4ae12bf 100644
--- a/server/api/disposition/disposition.attributes.js
+++ b/server/api/disposition/disposition.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x4c28=['exports','STRING','sequelize'];(function(_0x38987f,_0xc79720){var _0x4cb697=function(_0x1af5ae){while(--_0x1af5ae){_0x38987f['push'](_0x38987f['shift']());}};_0x4cb697(++_0xc79720);}(_0x4c28,0xad));var _0x84c2=function(_0x4f6395,_0x38d77a){_0x4f6395=_0x4f6395-0x0;var _0x13dc86=_0x4c28[_0x4f6395];return _0x13dc86;};'use strict';var Sequelize=require(_0x84c2('0x0'));module[_0x84c2('0x1')]={'name':{'type':Sequelize[_0x84c2('0x2')],'allowNull':![]}};
\ No newline at end of file
+var _0x0445=['STRING','sequelize','exports'];(function(_0x1934de,_0x16fdb2){var _0x4a79b4=function(_0x5a9f2f){while(--_0x5a9f2f){_0x1934de['push'](_0x1934de['shift']());}};_0x4a79b4(++_0x16fdb2);}(_0x0445,0x6d));var _0x5044=function(_0x5413f5,_0x3154c7){_0x5413f5=_0x5413f5-0x0;var _0x639288=_0x0445[_0x5413f5];return _0x639288;};'use strict';var Sequelize=require(_0x5044('0x0'));module[_0x5044('0x1')]={'name':{'type':Sequelize[_0x5044('0x2')],'allowNull':![]}};
\ No newline at end of file
diff --git a/server/api/disposition/disposition.controller.js b/server/api/disposition/disposition.controller.js
index 33e688f..98a400d 100644
--- a/server/api/disposition/disposition.controller.js
+++ b/server/api/disposition/disposition.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xc74e=['error','stack','name','send','index','rawAttributes','fieldName','type','key','map','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','Disposition','includeAll','include','rows','params','keys','options','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','util','path','lodash','squel','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','get','Dispositions','UserProfileResource','destroy','end'];(function(_0x154277,_0x509577){var _0x26da82=function(_0x2596a4){while(--_0x2596a4){_0x154277['push'](_0x154277['shift']());}};_0x26da82(++_0x509577);}(_0xc74e,0x116));var _0xec74=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0xc74e[_0x432682];return _0x463d05;};'use strict';var pdf=require(_0xec74('0x0'));var emlformat=require(_0xec74('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xec74('0x2'));var jsonpatch=require(_0xec74('0x3'));var rp=require(_0xec74('0x4'));var moment=require('moment');var BPromise=require(_0xec74('0x5'));var Mustache=require('mustache');var util=require(_0xec74('0x6'));var path=require(_0xec74('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0xec74('0x8'));var squel=require(_0xec74('0x9'));var crypto=require('crypto');var jsforce=require(_0xec74('0xa'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xec74('0xb'));var Redis=require(_0xec74('0xc'));var authService=require(_0xec74('0xd'));var qs=require(_0xec74('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xec74('0xf'))(_0xec74('0x10'));var utils=require(_0xec74('0x11'));var config=require(_0xec74('0x12'));var db=require(_0xec74('0x13'))['db'];function respondWithStatusCode(_0x5e79eb,_0x2b5390){_0x2b5390=_0x2b5390||0xcc;return function(_0x3581c3){if(_0x3581c3){return _0x5e79eb[_0xec74('0x14')](_0x2b5390);}return _0x5e79eb['status'](_0x2b5390)['end']();};}function respondWithResult(_0x265e54,_0x3124e7){_0x3124e7=_0x3124e7||0xc8;return function(_0x1d9d58){if(_0x1d9d58){return _0x265e54[_0xec74('0x15')](_0x3124e7)[_0xec74('0x16')](_0x1d9d58);}};}function respondWithFilteredResult(_0x1705da,_0xceee3d){return function(_0x22b80a){if(_0x22b80a){var _0x47da9e=_0x22b80a[_0xec74('0x17')],_0xdbe246=_0xceee3d[_0xec74('0x18')],_0x4c77e8=_0xceee3d[_0xec74('0x18')]+_0xceee3d[_0xec74('0x19')],_0x5074da;if(_0x4c77e8>=_0x47da9e){_0x4c77e8=_0x47da9e;_0x5074da=0xc8;}else{_0x5074da=0xce;}_0x1705da[_0xec74('0x15')](_0x5074da);return _0x1705da[_0xec74('0x1a')](_0xec74('0x1b'),_0xdbe246+'-'+_0x4c77e8+'/'+_0x47da9e)[_0xec74('0x16')](_0x22b80a);}return null;};}function patchUpdates(_0x5022ec){return function(_0x4b41cb){try{jsonpatch[_0xec74('0x1c')](_0x4b41cb,_0x5022ec,!![]);}catch(_0x4395d3){return BPromise[_0xec74('0x1d')](_0x4395d3);}return _0x4b41cb[_0xec74('0x1e')]();};}function saveUpdates(_0x4ca564,_0x25b91c){return function(_0x56b0ab){if(_0x56b0ab){return _0x56b0ab[_0xec74('0x1f')](_0x4ca564)[_0xec74('0x20')](function(_0x39636b){return _0x39636b;});}return null;};}function removeEntity(_0xaba33f,_0x5061e7){return function(_0x2980a4){if(_0x2980a4){return _0x2980a4['destroy']()[_0xec74('0x20')](function(){var _0x2ac727=_0x2980a4[_0xec74('0x21')]({'plain':!![]});var _0x105e83=_0xec74('0x22');return db[_0xec74('0x23')][_0xec74('0x24')]({'where':{'type':_0x105e83,'resourceId':_0x2ac727['id']}})['then'](function(){return _0x2980a4;});})['then'](function(){_0xaba33f[_0xec74('0x15')](0xcc)[_0xec74('0x25')]();});}};}function handleEntityNotFound(_0x274790,_0x177b6d){return function(_0x59c71e){if(!_0x59c71e){_0x274790[_0xec74('0x14')](0x194);}return _0x59c71e;};}function handleError(_0x29b388,_0x1b9210){_0x1b9210=_0x1b9210||0x1f4;return function(_0xfcd074){logger[_0xec74('0x26')](_0xfcd074[_0xec74('0x27')]);if(_0xfcd074['name']){delete _0xfcd074[_0xec74('0x28')];}_0x29b388[_0xec74('0x15')](_0x1b9210)[_0xec74('0x29')](_0xfcd074);};}exports[_0xec74('0x2a')]=function(_0x20a8b9,_0x1cf5c3){var _0x5a34c3={},_0x1aebd4={},_0xa89032={'count':0x0,'rows':[]};var _0x277263=_['map'](db['Disposition'][_0xec74('0x2b')],function(_0x40c92d){return{'name':_0x40c92d[_0xec74('0x2c')],'type':_0x40c92d[_0xec74('0x2d')][_0xec74('0x2e')]};});_0x1aebd4['model']=_[_0xec74('0x2f')](_0x277263,_0xec74('0x28'));_0x1aebd4[_0xec74('0x30')]=_['keys'](_0x20a8b9[_0xec74('0x30')]);_0x1aebd4[_0xec74('0x31')]=_[_0xec74('0x32')](_0x1aebd4[_0xec74('0x33')],_0x1aebd4[_0xec74('0x30')]);_0x5a34c3['attributes']=_[_0xec74('0x32')](_0x1aebd4[_0xec74('0x33')],qs[_0xec74('0x34')](_0x20a8b9[_0xec74('0x30')][_0xec74('0x34')]));_0x5a34c3[_0xec74('0x35')]=_0x5a34c3['attributes'][_0xec74('0x36')]?_0x5a34c3[_0xec74('0x35')]:_0x1aebd4[_0xec74('0x33')];if(!_0x20a8b9['query'][_0xec74('0x37')](_0xec74('0x38'))){_0x5a34c3[_0xec74('0x19')]=qs[_0xec74('0x19')](_0x20a8b9[_0xec74('0x30')][_0xec74('0x19')]);_0x5a34c3[_0xec74('0x18')]=qs[_0xec74('0x18')](_0x20a8b9['query'][_0xec74('0x18')]);}_0x5a34c3['order']=qs[_0xec74('0x39')](_0x20a8b9[_0xec74('0x30')][_0xec74('0x39')]);_0x5a34c3[_0xec74('0x3a')]=qs[_0xec74('0x31')](_[_0xec74('0x3b')](_0x20a8b9['query'],_0x1aebd4[_0xec74('0x31')]),_0x277263);if(_0x20a8b9[_0xec74('0x30')][_0xec74('0x3c')]){_0x5a34c3[_0xec74('0x3a')]=_[_0xec74('0x3d')](_0x5a34c3['where'],{'$or':_['map'](_0x277263,function(_0x3bf387){if(_0x3bf387[_0xec74('0x2d')]!==_0xec74('0x3e')){var _0x3c14f2={};_0x3c14f2[_0x3bf387[_0xec74('0x28')]]={'$like':'%'+_0x20a8b9[_0xec74('0x30')][_0xec74('0x3c')]+'%'};return _0x3c14f2;}})});}_0x5a34c3=_['merge']({},_0x5a34c3,_0x20a8b9['options']);var _0x5344d8={'where':_0x5a34c3['where']};return db[_0xec74('0x3f')]['count'](_0x5344d8)[_0xec74('0x20')](function(_0x4c7e02){_0xa89032[_0xec74('0x17')]=_0x4c7e02;if(_0x20a8b9[_0xec74('0x30')][_0xec74('0x40')]){_0x5a34c3[_0xec74('0x41')]=[{'all':!![]}];}return db[_0xec74('0x3f')]['findAll'](_0x5a34c3);})['then'](function(_0x3e3806){_0xa89032[_0xec74('0x42')]=_0x3e3806;return _0xa89032;})[_0xec74('0x20')](respondWithFilteredResult(_0x1cf5c3,_0x5a34c3))['catch'](handleError(_0x1cf5c3,null));};exports['show']=function(_0x38bbbc,_0x4b0c46){var _0x235c3c={'raw':!![],'where':{'id':_0x38bbbc[_0xec74('0x43')]['id']}},_0x4c9f23={};_0x4c9f23[_0xec74('0x33')]=_[_0xec74('0x44')](db[_0xec74('0x3f')][_0xec74('0x2b')]);_0x4c9f23[_0xec74('0x30')]=_[_0xec74('0x44')](_0x38bbbc[_0xec74('0x30')]);_0x4c9f23[_0xec74('0x31')]=_['intersection'](_0x4c9f23['model'],_0x4c9f23[_0xec74('0x30')]);_0x235c3c[_0xec74('0x35')]=_['intersection'](_0x4c9f23['model'],qs['fields'](_0x38bbbc['query'][_0xec74('0x34')]));_0x235c3c['attributes']=_0x235c3c[_0xec74('0x35')][_0xec74('0x36')]?_0x235c3c[_0xec74('0x35')]:_0x4c9f23[_0xec74('0x33')];if(_0x38bbbc[_0xec74('0x30')][_0xec74('0x40')]){_0x235c3c[_0xec74('0x41')]=[{'all':!![]}];}_0x235c3c=_[_0xec74('0x3d')]({},_0x235c3c,_0x38bbbc[_0xec74('0x45')]);return db[_0xec74('0x3f')][_0xec74('0x46')](_0x235c3c)['then'](handleEntityNotFound(_0x4b0c46,null))[_0xec74('0x20')](respondWithResult(_0x4b0c46,null))[_0xec74('0x47')](handleError(_0x4b0c46,null));};exports[_0xec74('0x48')]=function(_0x154d6f,_0x48b012){return db[_0xec74('0x3f')][_0xec74('0x48')](_0x154d6f[_0xec74('0x49')],{})['then'](function(_0xd075e){var _0x1915ed=_0x154d6f[_0xec74('0x4a')]['get']({'plain':!![]});if(!_0x1915ed)throw new Error(_0xec74('0x4b'));if(_0x1915ed[_0xec74('0x4c')]===_0xec74('0x4a')){var _0x4958d4=_0xd075e[_0xec74('0x21')]({'plain':!![]});var _0x49c4a4=_0xec74('0x22');return db[_0xec74('0x4d')]['find']({'where':{'name':_0x49c4a4,'userProfileId':_0x1915ed['userProfileId']},'raw':!![]})[_0xec74('0x20')](function(_0x393f52){if(_0x393f52&&_0x393f52['autoAssociation']===0x0){return db[_0xec74('0x23')][_0xec74('0x48')]({'name':_0x4958d4[_0xec74('0x28')],'resourceId':_0x4958d4['id'],'type':_0x393f52[_0xec74('0x28')],'sectionId':_0x393f52['id']},{})[_0xec74('0x20')](function(){return _0xd075e;});}else{return _0xd075e;}})['catch'](function(_0x3f16c7){logger[_0xec74('0x26')](_0xec74('0x4e'),_0x3f16c7);throw _0x3f16c7;});}return _0xd075e;})[_0xec74('0x20')](respondWithResult(_0x48b012,0xc9))[_0xec74('0x47')](handleError(_0x48b012,null));};exports[_0xec74('0x1f')]=function(_0x448a98,_0x3efbfb){if(_0x448a98[_0xec74('0x49')]['id']){delete _0x448a98[_0xec74('0x49')]['id'];}return db[_0xec74('0x3f')][_0xec74('0x46')]({'where':{'id':_0x448a98[_0xec74('0x43')]['id']}})[_0xec74('0x20')](handleEntityNotFound(_0x3efbfb,null))[_0xec74('0x20')](saveUpdates(_0x448a98['body'],null))[_0xec74('0x20')](respondWithResult(_0x3efbfb,null))[_0xec74('0x47')](handleError(_0x3efbfb,null));};exports[_0xec74('0x24')]=function(_0x453da6,_0x2f0fae){return db['Disposition'][_0xec74('0x46')]({'where':{'id':_0x453da6[_0xec74('0x43')]['id']}})['then'](handleEntityNotFound(_0x2f0fae,null))[_0xec74('0x20')](removeEntity(_0x2f0fae,null))[_0xec74('0x47')](handleError(_0x2f0fae,null));};
\ No newline at end of file
+var _0xde63=['eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','Content-Range','reject','update','then','destroy','get','Dispositions','error','stack','name','send','index','map','Disposition','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','findAll','rows','catch','show','length','include','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','find','autoAssociation','params','html-pdf'];(function(_0x213f8f,_0x1ff03d){var _0x34df14=function(_0x5e1b05){while(--_0x5e1b05){_0x213f8f['push'](_0x213f8f['shift']());}};_0x34df14(++_0x1ff03d);}(_0xde63,0x1d9));var _0x3de6=function(_0x1ba43c,_0x5bd2e8){_0x1ba43c=_0x1ba43c-0x0;var _0x2f60eb=_0xde63[_0x1ba43c];return _0x2f60eb;};'use strict';var pdf=require(_0x3de6('0x0'));var emlformat=require(_0x3de6('0x1'));var rimraf=require(_0x3de6('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x3de6('0x3'));var rp=require(_0x3de6('0x4'));var moment=require(_0x3de6('0x5'));var BPromise=require(_0x3de6('0x6'));var Mustache=require(_0x3de6('0x7'));var util=require(_0x3de6('0x8'));var path=require('path');var sox=require(_0x3de6('0x9'));var csv=require(_0x3de6('0xa'));var ejs=require(_0x3de6('0xb'));var fs=require('fs');var _=require(_0x3de6('0xc'));var squel=require(_0x3de6('0xd'));var crypto=require(_0x3de6('0xe'));var jsforce=require(_0x3de6('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x3de6('0xa'));var querystring=require(_0x3de6('0x10'));var Papa=require(_0x3de6('0x11'));var Redis=require(_0x3de6('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x3de6('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3de6('0x14'));var logger=require(_0x3de6('0x15'))(_0x3de6('0x16'));var utils=require('../../config/utils');var config=require(_0x3de6('0x17'));var db=require(_0x3de6('0x18'))['db'];function respondWithStatusCode(_0x30bc68,_0x36e4b1){_0x36e4b1=_0x36e4b1||0xcc;return function(_0x4c5cf4){if(_0x4c5cf4){return _0x30bc68[_0x3de6('0x19')](_0x36e4b1);}return _0x30bc68[_0x3de6('0x1a')](_0x36e4b1)[_0x3de6('0x1b')]();};}function respondWithResult(_0x2e818a,_0x26e715){_0x26e715=_0x26e715||0xc8;return function(_0x4e7735){if(_0x4e7735){return _0x2e818a[_0x3de6('0x1a')](_0x26e715)[_0x3de6('0x1c')](_0x4e7735);}};}function respondWithFilteredResult(_0x76005d,_0x470494){return function(_0x1e7f63){if(_0x1e7f63){var _0x5dd2b7=_0x1e7f63[_0x3de6('0x1d')],_0x354308=_0x470494[_0x3de6('0x1e')],_0x41163f=_0x470494[_0x3de6('0x1e')]+_0x470494['limit'],_0x12468d;if(_0x41163f>=_0x5dd2b7){_0x41163f=_0x5dd2b7;_0x12468d=0xc8;}else{_0x12468d=0xce;}_0x76005d['status'](_0x12468d);return _0x76005d['set'](_0x3de6('0x1f'),_0x354308+'-'+_0x41163f+'/'+_0x5dd2b7)[_0x3de6('0x1c')](_0x1e7f63);}return null;};}function patchUpdates(_0x43a39c){return function(_0x4c560f){try{jsonpatch['apply'](_0x4c560f,_0x43a39c,!![]);}catch(_0x1daa42){return BPromise[_0x3de6('0x20')](_0x1daa42);}return _0x4c560f['save']();};}function saveUpdates(_0x392ba4,_0x39f347){return function(_0x420e07){if(_0x420e07){return _0x420e07[_0x3de6('0x21')](_0x392ba4)[_0x3de6('0x22')](function(_0x5737aa){return _0x5737aa;});}return null;};}function removeEntity(_0x2ee67e,_0x35f478){return function(_0x501b1f){if(_0x501b1f){return _0x501b1f[_0x3de6('0x23')]()[_0x3de6('0x22')](function(){var _0x58d3b9=_0x501b1f[_0x3de6('0x24')]({'plain':!![]});var _0xb59db7=_0x3de6('0x25');return db['UserProfileResource'][_0x3de6('0x23')]({'where':{'type':_0xb59db7,'resourceId':_0x58d3b9['id']}})[_0x3de6('0x22')](function(){return _0x501b1f;});})[_0x3de6('0x22')](function(){_0x2ee67e['status'](0xcc)[_0x3de6('0x1b')]();});}};}function handleEntityNotFound(_0x3d1992,_0x4234a5){return function(_0x7d5902){if(!_0x7d5902){_0x3d1992[_0x3de6('0x19')](0x194);}return _0x7d5902;};}function handleError(_0x21fab4,_0x3a2f92){_0x3a2f92=_0x3a2f92||0x1f4;return function(_0x53b442){logger[_0x3de6('0x26')](_0x53b442[_0x3de6('0x27')]);if(_0x53b442['name']){delete _0x53b442[_0x3de6('0x28')];}_0x21fab4[_0x3de6('0x1a')](_0x3a2f92)[_0x3de6('0x29')](_0x53b442);};}exports[_0x3de6('0x2a')]=function(_0x36ffcd,_0x455bf6){var _0x188bb1={},_0x165a39={},_0x17eb37={'count':0x0,'rows':[]};var _0x3a1fd3=_[_0x3de6('0x2b')](db[_0x3de6('0x2c')][_0x3de6('0x2d')],function(_0x3cc61c){return{'name':_0x3cc61c[_0x3de6('0x2e')],'type':_0x3cc61c[_0x3de6('0x2f')][_0x3de6('0x30')]};});_0x165a39[_0x3de6('0x31')]=_[_0x3de6('0x2b')](_0x3a1fd3,_0x3de6('0x28'));_0x165a39[_0x3de6('0x32')]=_[_0x3de6('0x33')](_0x36ffcd[_0x3de6('0x32')]);_0x165a39[_0x3de6('0x34')]=_[_0x3de6('0x35')](_0x165a39[_0x3de6('0x31')],_0x165a39[_0x3de6('0x32')]);_0x188bb1[_0x3de6('0x36')]=_['intersection'](_0x165a39['model'],qs[_0x3de6('0x37')](_0x36ffcd[_0x3de6('0x32')][_0x3de6('0x37')]));_0x188bb1['attributes']=_0x188bb1['attributes']['length']?_0x188bb1[_0x3de6('0x36')]:_0x165a39['model'];if(!_0x36ffcd[_0x3de6('0x32')][_0x3de6('0x38')](_0x3de6('0x39'))){_0x188bb1['limit']=qs[_0x3de6('0x3a')](_0x36ffcd['query'][_0x3de6('0x3a')]);_0x188bb1[_0x3de6('0x1e')]=qs[_0x3de6('0x1e')](_0x36ffcd[_0x3de6('0x32')][_0x3de6('0x1e')]);}_0x188bb1[_0x3de6('0x3b')]=qs[_0x3de6('0x3c')](_0x36ffcd[_0x3de6('0x32')]['sort']);_0x188bb1[_0x3de6('0x3d')]=qs[_0x3de6('0x34')](_[_0x3de6('0x3e')](_0x36ffcd['query'],_0x165a39[_0x3de6('0x34')]),_0x3a1fd3);if(_0x36ffcd['query'][_0x3de6('0x3f')]){_0x188bb1[_0x3de6('0x3d')]=_[_0x3de6('0x40')](_0x188bb1[_0x3de6('0x3d')],{'$or':_[_0x3de6('0x2b')](_0x3a1fd3,function(_0xaa734e){if(_0xaa734e[_0x3de6('0x2f')]!==_0x3de6('0x41')){var _0x50b7db={};_0x50b7db[_0xaa734e[_0x3de6('0x28')]]={'$like':'%'+_0x36ffcd[_0x3de6('0x32')][_0x3de6('0x3f')]+'%'};return _0x50b7db;}})});}_0x188bb1=_[_0x3de6('0x40')]({},_0x188bb1,_0x36ffcd['options']);var _0x3d1275={'where':_0x188bb1[_0x3de6('0x3d')]};return db[_0x3de6('0x2c')]['count'](_0x3d1275)['then'](function(_0x1a5296){_0x17eb37['count']=_0x1a5296;if(_0x36ffcd[_0x3de6('0x32')][_0x3de6('0x42')]){_0x188bb1['include']=[{'all':!![]}];}return db[_0x3de6('0x2c')][_0x3de6('0x43')](_0x188bb1);})[_0x3de6('0x22')](function(_0x498d19){_0x17eb37[_0x3de6('0x44')]=_0x498d19;return _0x17eb37;})[_0x3de6('0x22')](respondWithFilteredResult(_0x455bf6,_0x188bb1))[_0x3de6('0x45')](handleError(_0x455bf6,null));};exports[_0x3de6('0x46')]=function(_0x53cb07,_0x19b114){var _0x1d47ed={'raw':!![],'where':{'id':_0x53cb07['params']['id']}},_0x44e46e={};_0x44e46e['model']=_['keys'](db['Disposition'][_0x3de6('0x2d')]);_0x44e46e[_0x3de6('0x32')]=_[_0x3de6('0x33')](_0x53cb07[_0x3de6('0x32')]);_0x44e46e[_0x3de6('0x34')]=_['intersection'](_0x44e46e[_0x3de6('0x31')],_0x44e46e['query']);_0x1d47ed[_0x3de6('0x36')]=_[_0x3de6('0x35')](_0x44e46e['model'],qs[_0x3de6('0x37')](_0x53cb07[_0x3de6('0x32')][_0x3de6('0x37')]));_0x1d47ed[_0x3de6('0x36')]=_0x1d47ed[_0x3de6('0x36')][_0x3de6('0x47')]?_0x1d47ed[_0x3de6('0x36')]:_0x44e46e[_0x3de6('0x31')];if(_0x53cb07[_0x3de6('0x32')][_0x3de6('0x42')]){_0x1d47ed[_0x3de6('0x48')]=[{'all':!![]}];}_0x1d47ed=_['merge']({},_0x1d47ed,_0x53cb07['options']);return db[_0x3de6('0x2c')]['find'](_0x1d47ed)[_0x3de6('0x22')](handleEntityNotFound(_0x19b114,null))['then'](respondWithResult(_0x19b114,null))['catch'](handleError(_0x19b114,null));};exports[_0x3de6('0x49')]=function(_0x25b19e,_0x4f29cc){return db['Disposition'][_0x3de6('0x49')](_0x25b19e[_0x3de6('0x4a')],{})['then'](function(_0x1842ff){var _0x29e3ec=_0x25b19e['user'][_0x3de6('0x24')]({'plain':!![]});if(!_0x29e3ec)throw new Error(_0x3de6('0x4b'));if(_0x29e3ec['role']==='user'){var _0x13b82a=_0x1842ff[_0x3de6('0x24')]({'plain':!![]});var _0x305e99=_0x3de6('0x25');return db['UserProfileSection'][_0x3de6('0x4c')]({'where':{'name':_0x305e99,'userProfileId':_0x29e3ec['userProfileId']},'raw':!![]})[_0x3de6('0x22')](function(_0x1035ed){if(_0x1035ed&&_0x1035ed[_0x3de6('0x4d')]===0x0){return db['UserProfileResource'][_0x3de6('0x49')]({'name':_0x13b82a[_0x3de6('0x28')],'resourceId':_0x13b82a['id'],'type':_0x1035ed['name'],'sectionId':_0x1035ed['id']},{})['then'](function(){return _0x1842ff;});}else{return _0x1842ff;}})[_0x3de6('0x45')](function(_0x26a62b){logger[_0x3de6('0x26')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x26a62b);throw _0x26a62b;});}return _0x1842ff;})[_0x3de6('0x22')](respondWithResult(_0x4f29cc,0xc9))[_0x3de6('0x45')](handleError(_0x4f29cc,null));};exports[_0x3de6('0x21')]=function(_0x49d2a0,_0x1a12b6){if(_0x49d2a0[_0x3de6('0x4a')]['id']){delete _0x49d2a0[_0x3de6('0x4a')]['id'];}return db['Disposition'][_0x3de6('0x4c')]({'where':{'id':_0x49d2a0[_0x3de6('0x4e')]['id']}})[_0x3de6('0x22')](handleEntityNotFound(_0x1a12b6,null))[_0x3de6('0x22')](saveUpdates(_0x49d2a0['body'],null))[_0x3de6('0x22')](respondWithResult(_0x1a12b6,null))[_0x3de6('0x45')](handleError(_0x1a12b6,null));};exports[_0x3de6('0x23')]=function(_0x195729,_0xfd0345){return db[_0x3de6('0x2c')][_0x3de6('0x4c')]({'where':{'id':_0x195729[_0x3de6('0x4e')]['id']}})['then'](handleEntityNotFound(_0xfd0345,null))[_0x3de6('0x22')](removeEntity(_0xfd0345,null))[_0x3de6('0x45')](handleError(_0xfd0345,null));};
\ No newline at end of file
diff --git a/server/api/disposition/disposition.model.js b/server/api/disposition/disposition.model.js
index ea42eb7..2316724 100644
--- a/server/api/disposition/disposition.model.js
+++ b/server/api/disposition/disposition.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xfe0b=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','tools_dispositions','name_voice','name_chat','name','ChatWebsiteId','name_mail','MailAccountId','name_sms','SmsAccountId','name_fax','FaxAccountId','OpenchannelAccountId','name_whatsapp','WhatsappAccountId','lodash','util','../../config/logger'];(function(_0x2af953,_0x38d762){var _0xec0374=function(_0x48d561){while(--_0x48d561){_0x2af953['push'](_0x2af953['shift']());}};_0xec0374(++_0x38d762);}(_0xfe0b,0x11b));var _0xbfe0=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0xfe0b[_0x502c7d];return _0x30b7ed;};'use strict';var _=require(_0xbfe0('0x0'));var util=require(_0xbfe0('0x1'));var logger=require(_0xbfe0('0x2'))(_0xbfe0('0x3'));var moment=require(_0xbfe0('0x4'));var BPromise=require(_0xbfe0('0x5'));var rp=require(_0xbfe0('0x6'));var fs=require('fs');var path=require(_0xbfe0('0x7'));var rimraf=require(_0xbfe0('0x8'));var config=require(_0xbfe0('0x9'));var attributes=require('./disposition.attributes');module[_0xbfe0('0xa')]=function(_0x5f1e30,_0x3a2d63){return _0x5f1e30[_0xbfe0('0xb')]('Disposition',attributes,{'tableName':_0xbfe0('0xc'),'paranoid':![],'indexes':[{'unique':!![],'name':_0xbfe0('0xd'),'fields':['name','ListId']},{'unique':!![],'name':_0xbfe0('0xe'),'fields':[_0xbfe0('0xf'),_0xbfe0('0x10')]},{'unique':!![],'name':_0xbfe0('0x11'),'fields':[_0xbfe0('0xf'),_0xbfe0('0x12')]},{'unique':!![],'name':_0xbfe0('0x13'),'fields':[_0xbfe0('0xf'),_0xbfe0('0x14')]},{'unique':!![],'name':_0xbfe0('0x15'),'fields':[_0xbfe0('0xf'),_0xbfe0('0x16')]},{'unique':!![],'name':'name_openchannel','fields':['name',_0xbfe0('0x17')]},{'unique':!![],'name':_0xbfe0('0x18'),'fields':['name',_0xbfe0('0x19')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x3bf2=['path','rimraf','../../config/environment','./disposition.attributes','define','Disposition','tools_dispositions','name_voice','name','ListId','name_chat','ChatWebsiteId','name_mail','MailAccountId','name_sms','SmsAccountId','name_fax','FaxAccountId','OpenchannelAccountId','name_whatsapp','WhatsappAccountId','lodash','../../config/logger','api','moment','bluebird'];(function(_0x1a3eff,_0x24f105){var _0x26b839=function(_0xf3fa70){while(--_0xf3fa70){_0x1a3eff['push'](_0x1a3eff['shift']());}};_0x26b839(++_0x24f105);}(_0x3bf2,0x167));var _0x23bf=function(_0x4322c6,_0x28f126){_0x4322c6=_0x4322c6-0x0;var _0x4e7537=_0x3bf2[_0x4322c6];return _0x4e7537;};'use strict';var _=require(_0x23bf('0x0'));var util=require('util');var logger=require(_0x23bf('0x1'))(_0x23bf('0x2'));var moment=require(_0x23bf('0x3'));var BPromise=require(_0x23bf('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x23bf('0x5'));var rimraf=require(_0x23bf('0x6'));var config=require(_0x23bf('0x7'));var attributes=require(_0x23bf('0x8'));module['exports']=function(_0x2292e8,_0x4c6a78){return _0x2292e8[_0x23bf('0x9')](_0x23bf('0xa'),attributes,{'tableName':_0x23bf('0xb'),'paranoid':![],'indexes':[{'unique':!![],'name':_0x23bf('0xc'),'fields':[_0x23bf('0xd'),_0x23bf('0xe')]},{'unique':!![],'name':_0x23bf('0xf'),'fields':[_0x23bf('0xd'),_0x23bf('0x10')]},{'unique':!![],'name':_0x23bf('0x11'),'fields':[_0x23bf('0xd'),_0x23bf('0x12')]},{'unique':!![],'name':_0x23bf('0x13'),'fields':['name',_0x23bf('0x14')]},{'unique':!![],'name':_0x23bf('0x15'),'fields':[_0x23bf('0xd'),_0x23bf('0x16')]},{'unique':!![],'name':'name_openchannel','fields':['name',_0x23bf('0x17')]},{'unique':!![],'name':_0x23bf('0x18'),'fields':[_0x23bf('0xd'),_0x23bf('0x19')]}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/disposition/disposition.rpc.js b/server/api/disposition/disposition.rpc.js
index dca6f84..291b87b 100644
--- a/server/api/disposition/disposition.rpc.js
+++ b/server/api/disposition/disposition.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xb16a=['request','Disposition,\x20%s,\x20%s','request\x20sent','Disposition,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x39beaa,_0x1a7d06){var _0x582f97=function(_0x1b6874){while(--_0x1b6874){_0x39beaa['push'](_0x39beaa['shift']());}};_0x582f97(++_0x1a7d06);}(_0xb16a,0x111));var _0xab16=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xb16a[_0x19e35c];return _0x3e1fe8;};'use strict';var _=require(_0xab16('0x0'));var util=require(_0xab16('0x1'));var moment=require(_0xab16('0x2'));var BPromise=require('bluebird');var rs=require(_0xab16('0x3'));var fs=require('fs');var Redis=require(_0xab16('0x4'));var db=require(_0xab16('0x5'))['db'];var utils=require(_0xab16('0x6'));var logger=require(_0xab16('0x7'))(_0xab16('0x8'));var config=require(_0xab16('0x9'));var jayson=require(_0xab16('0xa'));var client=jayson[_0xab16('0xb')][_0xab16('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x491405,_0x2ad82b,_0x1972de){return new BPromise(function(_0x14ed5d,_0x4cb938){return client[_0xab16('0xd')](_0x491405,_0x1972de)['then'](function(_0x3e12ae){logger['info'](_0xab16('0xe'),_0x2ad82b,_0xab16('0xf'));logger['debug'](_0xab16('0x10'),_0x2ad82b,'request\x20sent',JSON[_0xab16('0x11')](_0x3e12ae));if(_0x3e12ae[_0xab16('0x12')]){if(_0x3e12ae[_0xab16('0x12')][_0xab16('0x13')]===0x1f4){logger[_0xab16('0x12')](_0xab16('0xe'),_0x2ad82b,_0x3e12ae['error'][_0xab16('0x14')]);return _0x4cb938(_0x3e12ae[_0xab16('0x12')][_0xab16('0x14')]);}logger[_0xab16('0x12')]('Disposition,\x20%s,\x20%s',_0x2ad82b,_0x3e12ae[_0xab16('0x12')]['message']);return _0x14ed5d(_0x3e12ae[_0xab16('0x12')][_0xab16('0x14')]);}else{logger[_0xab16('0x15')]('Disposition,\x20%s,\x20%s',_0x2ad82b,_0xab16('0xf'));_0x14ed5d(_0x3e12ae['result'][_0xab16('0x14')]);}})['catch'](function(_0x308d6d){logger[_0xab16('0x12')]('Disposition,\x20%s,\x20%s',_0x2ad82b,_0x308d6d);_0x4cb938(_0x308d6d);});});}
\ No newline at end of file
+var _0x2198=['Disposition,\x20%s,\x20%s,\x20%s','error','code','message','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','Disposition,\x20%s,\x20%s','request\x20sent','debug'];(function(_0xb58502,_0x5b30ab){var _0x466ce9=function(_0xd82d6c){while(--_0xd82d6c){_0xb58502['push'](_0xb58502['shift']());}};_0x466ce9(++_0x5b30ab);}(_0x2198,0x9f));var _0x8219=function(_0x25c019,_0xd5a5b8){_0x25c019=_0x25c019-0x0;var _0x41950d=_0x2198[_0x25c019];return _0x41950d;};'use strict';var _=require(_0x8219('0x0'));var util=require('util');var moment=require(_0x8219('0x1'));var BPromise=require(_0x8219('0x2'));var rs=require(_0x8219('0x3'));var fs=require('fs');var Redis=require(_0x8219('0x4'));var db=require(_0x8219('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x8219('0x6'))('rpc');var config=require(_0x8219('0x7'));var jayson=require(_0x8219('0x8'));var client=jayson[_0x8219('0x9')][_0x8219('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x164944,_0x5d7abd,_0x2eeeb8){return new BPromise(function(_0x3a3e29,_0x1976a6){return client[_0x8219('0xb')](_0x164944,_0x2eeeb8)[_0x8219('0xc')](function(_0x45e41e){logger[_0x8219('0xd')](_0x8219('0xe'),_0x5d7abd,_0x8219('0xf'));logger[_0x8219('0x10')](_0x8219('0x11'),_0x5d7abd,'request\x20sent',JSON['stringify'](_0x45e41e));if(_0x45e41e[_0x8219('0x12')]){if(_0x45e41e[_0x8219('0x12')][_0x8219('0x13')]===0x1f4){logger[_0x8219('0x12')](_0x8219('0xe'),_0x5d7abd,_0x45e41e['error'][_0x8219('0x14')]);return _0x1976a6(_0x45e41e[_0x8219('0x12')]['message']);}logger[_0x8219('0x12')](_0x8219('0xe'),_0x5d7abd,_0x45e41e[_0x8219('0x12')]['message']);return _0x3a3e29(_0x45e41e['error'][_0x8219('0x14')]);}else{logger[_0x8219('0xd')]('Disposition,\x20%s,\x20%s',_0x5d7abd,_0x8219('0xf'));_0x3a3e29(_0x45e41e['result']['message']);}})[_0x8219('0x15')](function(_0x5bdf62){logger['error']('Disposition,\x20%s,\x20%s',_0x5d7abd,_0x5bdf62);_0x1976a6(_0x5bdf62);});});}
\ No newline at end of file
diff --git a/server/api/disposition/index.js b/server/api/disposition/index.js
index 2cc669a..504e8f5 100644
--- a/server/api/disposition/index.js
+++ b/server/api/disposition/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xdf94=['../../config/environment','./disposition.controller','get','isAuthenticated','index','/:id','show','post','put','update','delete','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x5e7cd5,_0x386aac){var _0x100bcf=function(_0x192c94){while(--_0x192c94){_0x5e7cd5['push'](_0x5e7cd5['shift']());}};_0x100bcf(++_0x386aac);}(_0xdf94,0xad));var _0x4df9=function(_0x568a86,_0x568758){_0x568a86=_0x568a86-0x0;var _0x5567db=_0xdf94[_0x568a86];return _0x5567db;};'use strict';var multer=require('multer');var util=require(_0x4df9('0x0'));var path=require(_0x4df9('0x1'));var timeout=require(_0x4df9('0x2'));var express=require(_0x4df9('0x3'));var router=express[_0x4df9('0x4')]();var auth=require(_0x4df9('0x5'));var interaction=require(_0x4df9('0x6'));var config=require(_0x4df9('0x7'));var controller=require(_0x4df9('0x8'));router[_0x4df9('0x9')]('/',auth[_0x4df9('0xa')](),controller[_0x4df9('0xb')]);router[_0x4df9('0x9')](_0x4df9('0xc'),auth[_0x4df9('0xa')](),controller[_0x4df9('0xd')]);router[_0x4df9('0xe')]('/',auth[_0x4df9('0xa')](),controller['create']);router[_0x4df9('0xf')](_0x4df9('0xc'),auth[_0x4df9('0xa')](),controller[_0x4df9('0x10')]);router[_0x4df9('0x11')](_0x4df9('0xc'),auth[_0x4df9('0xa')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
+var _0xbff2=['multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','show','/:id','destroy','exports'];(function(_0x556f19,_0x15ea04){var _0x1add52=function(_0x105adf){while(--_0x105adf){_0x556f19['push'](_0x556f19['shift']());}};_0x1add52(++_0x15ea04);}(_0xbff2,0x10e));var _0x2bff=function(_0x1ef04f,_0x5ad9b8){_0x1ef04f=_0x1ef04f-0x0;var _0x5c3e79=_0xbff2[_0x1ef04f];return _0x5c3e79;};'use strict';var multer=require(_0x2bff('0x0'));var util=require(_0x2bff('0x1'));var path=require(_0x2bff('0x2'));var timeout=require(_0x2bff('0x3'));var express=require(_0x2bff('0x4'));var router=express[_0x2bff('0x5')]();var auth=require(_0x2bff('0x6'));var interaction=require(_0x2bff('0x7'));var config=require(_0x2bff('0x8'));var controller=require('./disposition.controller');router[_0x2bff('0x9')]('/',auth[_0x2bff('0xa')](),controller['index']);router['get']('/:id',auth[_0x2bff('0xa')](),controller[_0x2bff('0xb')]);router['post']('/',auth[_0x2bff('0xa')](),controller['create']);router['put'](_0x2bff('0xc'),auth['isAuthenticated'](),controller['update']);router['delete'](_0x2bff('0xc'),auth['isAuthenticated'](),controller[_0x2bff('0xd')]);module[_0x2bff('0xe')]=router;
\ No newline at end of file
diff --git a/server/api/faxAccount/faxAccount.attributes.js b/server/api/faxAccount/faxAccount.attributes.js
index 03b493c..bf0e444 100644
--- a/server/api/faxAccount/faxAccount.attributes.js
+++ b/server/api/faxAccount/faxAccount.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x0805=['9600','14400','4800','2400','12000','v17,v27,v29','IAX','DADHI','KHOMP','SIP','TEXT','BOOLEAN','INTEGER','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','exports','STRING','xCALLY\x20Motion\x20Fax','localstationid','7200'];(function(_0x3811d4,_0x2abdfb){var _0x3f1fae=function(_0x5b8908){while(--_0x5b8908){_0x3811d4['push'](_0x3811d4['shift']());}};_0x3f1fae(++_0x2abdfb);}(_0x0805,0x125));var _0x5080=function(_0x588d91,_0x2e37e8){_0x588d91=_0x588d91-0x0;var _0x4dcef9=_0x0805[_0x588d91];return _0x4dcef9;};'use strict';var Sequelize=require(_0x5080('0x0'));module[_0x5080('0x1')]={'name':{'type':Sequelize[_0x5080('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x5080('0x2')]},'ecm':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'yes'},'headerinfo':{'type':Sequelize[_0x5080('0x2')],'defaultValue':_0x5080('0x3')},'localstationid':{'type':Sequelize[_0x5080('0x2')],'unique':_0x5080('0x4')},'minrate':{'type':Sequelize['ENUM']('2400','4800',_0x5080('0x5'),_0x5080('0x6'),'12000',_0x5080('0x7')),'defaultValue':_0x5080('0x8')},'maxrate':{'type':Sequelize['ENUM'](_0x5080('0x9'),_0x5080('0x8'),_0x5080('0x5'),_0x5080('0x6'),_0x5080('0xa'),_0x5080('0x7')),'defaultValue':_0x5080('0x7')},'modem':{'type':Sequelize[_0x5080('0x2')],'defaultValue':_0x5080('0xb')},'gateway':{'type':Sequelize[_0x5080('0x2')],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize[_0x5080('0x2')],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize['INTEGER'],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize['ENUM']('SIP',_0x5080('0xc'),_0x5080('0xd'),_0x5080('0xe')),'defaultValue':_0x5080('0xf')},'key':{'type':Sequelize[_0x5080('0x2')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x5080('0x10')],'defaultValue':function(){return'Account:\x20{{account.name}} {{#queue}}Queue:\x20{{queue.name}} {{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0x5080('0x11')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x5080('0x11')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x5080('0x12')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x5080('0x12')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x5080('0x11')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x5080('0x12')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'defaultValue':null,'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0x5080('0x13'),'set':function(_0x1d9a92){if(!_0x1d9a92)this[_0x5080('0x14')](_0x5080('0x15'),null);this[_0x5080('0x14')](_0x5080('0x16'),_0x1d9a92);}}};
\ No newline at end of file
+var _0x0767=['9600','12000','14400','v17,v27,v29','INTEGER','DADHI','KHOMP','SIP','TEXT','Account:\x20{{account.name}} {{#queue}}Queue:\x20{{queue.name}} {{/queue}}From\x20:\x20{{from}}','BOOLEAN','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','exports','STRING','ENUM','yes','localstationid','2400','4800','7200'];(function(_0xfe4d6f,_0x1488ce){var _0x5748e5=function(_0x13d546){while(--_0x13d546){_0xfe4d6f['push'](_0xfe4d6f['shift']());}};_0x5748e5(++_0x1488ce);}(_0x0767,0x1a0));var _0x7076=function(_0x18a078,_0xfb6032){_0x18a078=_0x18a078-0x0;var _0x27b869=_0x0767[_0x18a078];return _0x27b869;};'use strict';var Sequelize=require(_0x7076('0x0'));module[_0x7076('0x1')]={'name':{'type':Sequelize[_0x7076('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x7076('0x2')]},'ecm':{'type':Sequelize[_0x7076('0x3')](_0x7076('0x4'),'no'),'defaultValue':_0x7076('0x4')},'headerinfo':{'type':Sequelize[_0x7076('0x2')],'defaultValue':'xCALLY\x20Motion\x20Fax'},'localstationid':{'type':Sequelize[_0x7076('0x2')],'unique':_0x7076('0x5')},'minrate':{'type':Sequelize[_0x7076('0x3')](_0x7076('0x6'),_0x7076('0x7'),_0x7076('0x8'),_0x7076('0x9'),'12000','14400'),'defaultValue':_0x7076('0x7')},'maxrate':{'type':Sequelize['ENUM'](_0x7076('0x6'),_0x7076('0x7'),_0x7076('0x8'),_0x7076('0x9'),_0x7076('0xa'),_0x7076('0xb')),'defaultValue':'14400'},'modem':{'type':Sequelize[_0x7076('0x2')],'defaultValue':_0x7076('0xc')},'gateway':{'type':Sequelize[_0x7076('0x2')],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize[_0x7076('0x2')],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize[_0x7076('0xd')],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize[_0x7076('0x3')]('SIP','IAX',_0x7076('0xe'),_0x7076('0xf')),'defaultValue':_0x7076('0x10')},'key':{'type':Sequelize[_0x7076('0x2')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x7076('0x11')],'defaultValue':function(){return _0x7076('0x12');}},'notificationSound':{'type':Sequelize[_0x7076('0x13')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x7076('0x13')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x7076('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x7076('0x13')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x7076('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x7076('0xd')],'allowNull':!![],'defaultValue':null,'comment':_0x7076('0x14')},'mandatoryDisposition':{'type':Sequelize[_0x7076('0x13')],'defaultValue':![],'comment':_0x7076('0x15'),'set':function(_0x2fcdfc){if(!_0x2fcdfc)this[_0x7076('0x16')](_0x7076('0x17'),null);this[_0x7076('0x16')](_0x7076('0x18'),_0x2fcdfc);}}};
\ No newline at end of file
diff --git a/server/api/faxAccount/faxAccount.controller.js b/server/api/faxAccount/faxAccount.controller.js
index 49e56ad..80b7597 100644
--- a/server/api/faxAccount/faxAccount.controller.js
+++ b/server/api/faxAccount/faxAccount.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x65fd=['addAccountApplications','VoiceExtension','updateAccountApplications','tech','createdAt','updatedAt','ListId','findById','getMessages','FaxMessage','$gte','format','YYYY-MM-DD\x20HH:mm:ss','List','CmContact','Contacts','DESC','attachments','server/files/attachments','basename','CheckAfterSend','isNil','from','\x22%s\x22\x20<%s>','List\x20not\x20found','Send\x20Fax\x20failed','out','filename','Messages','spread','ContactId','dataValues','SendFax','SendFaxRpc,\x20%s','addAgents','userFaxAccount:save','removeAgents','isArray','emit','getAgents','html-pdf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./faxAccount.socket','register','jayson/promise','client','Sequelize','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','FaxAccount,\x20%s,\x20%s','request\x20sent','debug','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','end','status','count','offset','limit','json','apply','reject','save','update','get','FaxAccounts','stack','name','send','index','Pause','mandatoryDispositionPause','map','FaxAccount','rawAttributes','fieldName','key','query','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','type','includeAll','include','rows','params','keys','options','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','find','userProfileId','destroy','addDisposition','getDispositions','findOne','Disposition','order','FaxAccountId','findAll','removeDispositions','addAnswer','CannedAnswer','getAnswers','removeAnswers','FaxInteraction','addInteraction','omit','ids','getInteractions','Contact','User','Owner','fullname','Tag','Tags','tag','addApplications','sequelize','transaction','FaxApplication','bulkCreate','findAndCountAll','priority','getApplications','context','from-voip-provider','localstationid','app','system','description','appdata','push','CDR(type)=inbound-fax','Set','ecm','gateway','faxdetect','headerinfo','minrate','modem','t38timeout','FAXOPT(','Wait','/var/opt/motion2/server/files/attachments/fax-${CALLERID(num)}-${CUT(UNIQUEID,.,1)}-${CUT(UNIQUEID,.,2)}-${STRFTIME(,,%C%y%m%d%H%M%S)}-rx.tif,d','ReceiveFax'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x65fd,0xe8));var _0xd65f=function(_0x58885f,_0x98e475){_0x58885f=_0x58885f-0x0;var _0x15b184=_0x65fd[_0x58885f];return _0x15b184;};'use strict';var pdf=require(_0xd65f('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xd65f('0x1'));var rp=require(_0xd65f('0x2'));var moment=require(_0xd65f('0x3'));var BPromise=require(_0xd65f('0x4'));var Mustache=require(_0xd65f('0x5'));var util=require(_0xd65f('0x6'));var path=require(_0xd65f('0x7'));var sox=require(_0xd65f('0x8'));var csv=require(_0xd65f('0x9'));var ejs=require(_0xd65f('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0xd65f('0xb'));var crypto=require(_0xd65f('0xc'));var jsforce=require(_0xd65f('0xd'));var deskjs=require(_0xd65f('0xe'));var toCsv=require(_0xd65f('0x9'));var querystring=require(_0xd65f('0xf'));var Papa=require(_0xd65f('0x10'));var Redis=require(_0xd65f('0x11'));var authService=require(_0xd65f('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xd65f('0x13'));var hardwareService=require(_0xd65f('0x14'));var logger=require('../../config/logger')(_0xd65f('0x15'));var utils=require('../../config/utils');var config=require(_0xd65f('0x16'));var db=require(_0xd65f('0x17'))['db'];config[_0xd65f('0x18')]=_[_0xd65f('0x19')](config[_0xd65f('0x18')],{'host':'localhost','port':0x18eb});var socket=require(_0xd65f('0x1a'))(new Redis(config[_0xd65f('0x18')]));require(_0xd65f('0x1b'))[_0xd65f('0x1c')](socket);var jayson=require(_0xd65f('0x1d'));var client=jayson[_0xd65f('0x1e')]['http']({'port':0x232c});var client9002=jayson[_0xd65f('0x1e')]['http']({'port':0x232a});function checkPasswordPattern(_0x1ecab1,_0x196b6e,_0x459926){if(_0x459926){var _0x541912=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x541912['test'](_0x196b6e)){return _0x1ecab1;}else{throw new db[(_0xd65f('0x1f'))]['ValidationError'](_0xd65f('0x20'));}}else{return _0x1ecab1;}}function respondWithRpcPromise(_0x55cfe0,_0xf4eec4,_0x3c0a71,_0x537411){return new BPromise(function(_0x4518e7,_0x2e1463){var _0x2657c5=_0x537411||client;return _0x2657c5[_0xd65f('0x21')](_0x55cfe0,_0x3c0a71)[_0xd65f('0x22')](function(_0x11cd87){logger[_0xd65f('0x23')](_0xd65f('0x24'),_0xf4eec4,_0xd65f('0x25'));logger[_0xd65f('0x26')](_0xd65f('0x27'),_0xf4eec4,_0xd65f('0x25'),JSON[_0xd65f('0x28')](_0x11cd87));if(_0x11cd87[_0xd65f('0x29')]){if(_0x11cd87['error'][_0xd65f('0x2a')]===0x1f4){logger[_0xd65f('0x29')](_0xd65f('0x24'),_0xf4eec4,_0x11cd87[_0xd65f('0x29')][_0xd65f('0x2b')]);return _0x2e1463(_0x11cd87[_0xd65f('0x29')]['message']);}logger[_0xd65f('0x29')](_0xd65f('0x24'),_0xf4eec4,_0x11cd87[_0xd65f('0x29')][_0xd65f('0x2b')]);return _0x4518e7(_0x11cd87['error'][_0xd65f('0x2b')]);}else{logger['info'](_0xd65f('0x24'),_0xf4eec4,_0xd65f('0x25'));_0x4518e7(_0x11cd87[_0xd65f('0x2c')][_0xd65f('0x2b')]);}})[_0xd65f('0x2d')](function(_0x529df3){logger['error'](_0xd65f('0x24'),_0xf4eec4,_0x529df3);_0x2e1463(_0x529df3);});});}function respondWithStatusCode(_0x4a82b1,_0x3fcc13){_0x3fcc13=_0x3fcc13||0xcc;return function(_0x18caab){if(_0x18caab){return _0x4a82b1[_0xd65f('0x2e')](_0x3fcc13);}return _0x4a82b1['status'](_0x3fcc13)[_0xd65f('0x2f')]();};}function respondWithResult(_0x360cb2,_0x2c02db){_0x2c02db=_0x2c02db||0xc8;return function(_0xfd82c1){if(_0xfd82c1){return _0x360cb2[_0xd65f('0x30')](_0x2c02db)['json'](_0xfd82c1);}};}function respondWithFilteredResult(_0x33c008,_0x8d92f8){return function(_0x4297a8){if(_0x4297a8){var _0x3bfab6=_0x4297a8[_0xd65f('0x31')],_0x322854=_0x8d92f8[_0xd65f('0x32')],_0x22b1b3=_0x8d92f8['offset']+_0x8d92f8[_0xd65f('0x33')],_0x1f093c;if(_0x22b1b3>=_0x3bfab6){_0x22b1b3=_0x3bfab6;_0x1f093c=0xc8;}else{_0x1f093c=0xce;}_0x33c008[_0xd65f('0x30')](_0x1f093c);return _0x33c008['set']('Content-Range',_0x322854+'-'+_0x22b1b3+'/'+_0x3bfab6)[_0xd65f('0x34')](_0x4297a8);}return null;};}function patchUpdates(_0x2dfc65){return function(_0x5dc3a3){try{jsonpatch[_0xd65f('0x35')](_0x5dc3a3,_0x2dfc65,!![]);}catch(_0x39e43a){return BPromise[_0xd65f('0x36')](_0x39e43a);}return _0x5dc3a3[_0xd65f('0x37')]();};}function saveUpdates(_0x59d9ea,_0x235d18){return function(_0x1a918b){if(_0x1a918b){return _0x1a918b[_0xd65f('0x38')](_0x59d9ea)[_0xd65f('0x22')](function(_0x13c871){return _0x13c871;});}return null;};}function removeEntity(_0x59f865,_0x56eaa9){return function(_0x38c30e){if(_0x38c30e){return _0x38c30e['destroy']()[_0xd65f('0x22')](function(){var _0xeeac2f=_0x38c30e[_0xd65f('0x39')]({'plain':!![]});var _0x26aa88=_0xd65f('0x3a');return db['UserProfileResource']['destroy']({'where':{'type':_0x26aa88,'resourceId':_0xeeac2f['id']}})[_0xd65f('0x22')](function(){return _0x38c30e;});})[_0xd65f('0x22')](function(){_0x59f865[_0xd65f('0x30')](0xcc)[_0xd65f('0x2f')]();});}};}function handleEntityNotFound(_0x1359a9,_0x46932e){return function(_0x3cc1b0){if(!_0x3cc1b0){_0x1359a9[_0xd65f('0x2e')](0x194);}return _0x3cc1b0;};}function handleError(_0x34995e,_0x5604a1){_0x5604a1=_0x5604a1||0x1f4;return function(_0xa60897){logger[_0xd65f('0x29')](_0xa60897[_0xd65f('0x3b')]);if(_0xa60897[_0xd65f('0x3c')]){delete _0xa60897[_0xd65f('0x3c')];}_0x34995e[_0xd65f('0x30')](_0x5604a1)[_0xd65f('0x3d')](_0xa60897);};}exports[_0xd65f('0x3e')]=function(_0x2dba86,_0x4ea9fe){var _0x5b14d3={'include':[{'model':db[_0xd65f('0x3f')],'as':_0xd65f('0x40')}]},_0x28c3ab={},_0x14e00d={'count':0x0,'rows':[]};var _0x2fb755=_[_0xd65f('0x41')](db[_0xd65f('0x42')][_0xd65f('0x43')],function(_0x5cb04b){return{'name':_0x5cb04b[_0xd65f('0x44')],'type':_0x5cb04b['type'][_0xd65f('0x45')]};});_0x28c3ab['model']=_[_0xd65f('0x41')](_0x2fb755,'name');_0x28c3ab[_0xd65f('0x46')]=_['keys'](_0x2dba86[_0xd65f('0x46')]);_0x28c3ab[_0xd65f('0x47')]=_['intersection'](_0x28c3ab[_0xd65f('0x48')],_0x28c3ab[_0xd65f('0x46')]);_0x5b14d3[_0xd65f('0x49')]=_[_0xd65f('0x4a')](_0x28c3ab[_0xd65f('0x48')],qs[_0xd65f('0x4b')](_0x2dba86[_0xd65f('0x46')]['fields']));_0x5b14d3[_0xd65f('0x49')]=_0x5b14d3[_0xd65f('0x49')][_0xd65f('0x4c')]?_0x5b14d3[_0xd65f('0x49')]:_0x28c3ab[_0xd65f('0x48')];if(!_0x2dba86[_0xd65f('0x46')][_0xd65f('0x4d')](_0xd65f('0x4e'))){_0x5b14d3['limit']=qs['limit'](_0x2dba86[_0xd65f('0x46')]['limit']);_0x5b14d3[_0xd65f('0x32')]=qs[_0xd65f('0x32')](_0x2dba86[_0xd65f('0x46')][_0xd65f('0x32')]);}_0x5b14d3['order']=qs['sort'](_0x2dba86['query'][_0xd65f('0x4f')]);_0x5b14d3[_0xd65f('0x50')]=qs['filters'](_[_0xd65f('0x51')](_0x2dba86[_0xd65f('0x46')],_0x28c3ab[_0xd65f('0x47')]),_0x2fb755);if(_0x2dba86[_0xd65f('0x46')][_0xd65f('0x52')]){_0x5b14d3[_0xd65f('0x50')]=_[_0xd65f('0x53')](_0x5b14d3[_0xd65f('0x50')],{'$or':_[_0xd65f('0x41')](_0x2fb755,function(_0x397372){if(_0x397372[_0xd65f('0x54')]!=='VIRTUAL'){var _0x215775={};_0x215775[_0x397372[_0xd65f('0x3c')]]={'$like':'%'+_0x2dba86['query'][_0xd65f('0x52')]+'%'};return _0x215775;}})});}_0x5b14d3=_['merge']({},_0x5b14d3,_0x2dba86['options']);var _0x424a38={'where':_0x5b14d3['where']};return db[_0xd65f('0x42')][_0xd65f('0x31')](_0x424a38)['then'](function(_0x2aa226){_0x14e00d[_0xd65f('0x31')]=_0x2aa226;if(_0x2dba86[_0xd65f('0x46')][_0xd65f('0x55')]){_0x5b14d3[_0xd65f('0x56')]=[{'all':!![]}];}return db[_0xd65f('0x42')]['findAll'](_0x5b14d3);})[_0xd65f('0x22')](function(_0x20f5c2){_0x14e00d[_0xd65f('0x57')]=_0x20f5c2;return _0x14e00d;})[_0xd65f('0x22')](respondWithFilteredResult(_0x4ea9fe,_0x5b14d3))['catch'](handleError(_0x4ea9fe,null));};exports['show']=function(_0x4c4fe7,_0x3cbb26){var _0x20f705={'raw':![],'where':{'id':_0x4c4fe7[_0xd65f('0x58')]['id']},'include':[{'model':db[_0xd65f('0x3f')],'as':_0xd65f('0x40')}]},_0x1d730b={};_0x1d730b[_0xd65f('0x48')]=_[_0xd65f('0x59')](db['FaxAccount'][_0xd65f('0x43')]);_0x1d730b[_0xd65f('0x46')]=_[_0xd65f('0x59')](_0x4c4fe7[_0xd65f('0x46')]);_0x1d730b[_0xd65f('0x47')]=_['intersection'](_0x1d730b[_0xd65f('0x48')],_0x1d730b[_0xd65f('0x46')]);_0x20f705[_0xd65f('0x49')]=_[_0xd65f('0x4a')](_0x1d730b[_0xd65f('0x48')],qs[_0xd65f('0x4b')](_0x4c4fe7[_0xd65f('0x46')][_0xd65f('0x4b')]));_0x20f705[_0xd65f('0x49')]=_0x20f705[_0xd65f('0x49')][_0xd65f('0x4c')]?_0x20f705['attributes']:_0x1d730b[_0xd65f('0x48')];if(_0x4c4fe7[_0xd65f('0x46')][_0xd65f('0x55')]){_0x20f705['include']=[{'all':!![]}];}_0x20f705=_[_0xd65f('0x53')]({},_0x20f705,_0x4c4fe7[_0xd65f('0x5a')]);return db[_0xd65f('0x42')]['find'](_0x20f705)[_0xd65f('0x22')](handleEntityNotFound(_0x3cbb26,null))['then'](respondWithResult(_0x3cbb26,null))[_0xd65f('0x2d')](handleError(_0x3cbb26,null));};exports[_0xd65f('0x5b')]=function(_0x29fef3,_0x1b8e97){return db[_0xd65f('0x42')][_0xd65f('0x5b')](_0x29fef3[_0xd65f('0x5c')],{})[_0xd65f('0x22')](function(_0x60fe09){var _0x1215ce=_0x29fef3['user'][_0xd65f('0x39')]({'plain':!![]});if(!_0x1215ce)throw new Error(_0xd65f('0x5d'));if(_0x1215ce['role']===_0xd65f('0x5e')){var _0x39cbbc=_0x60fe09['get']({'plain':!![]});var _0x2248f=_0xd65f('0x3a');return db[_0xd65f('0x5f')][_0xd65f('0x60')]({'where':{'name':_0x2248f,'userProfileId':_0x1215ce[_0xd65f('0x61')]},'raw':!![]})[_0xd65f('0x22')](function(_0xf446e5){if(_0xf446e5&&_0xf446e5['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x39cbbc['name'],'resourceId':_0x39cbbc['id'],'type':_0xf446e5[_0xd65f('0x3c')],'sectionId':_0xf446e5['id']},{})[_0xd65f('0x22')](function(){return _0x60fe09;});}else{return _0x60fe09;}})[_0xd65f('0x2d')](function(_0x1b4ce6){logger[_0xd65f('0x29')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1b4ce6);throw _0x1b4ce6;});}return _0x60fe09;})[_0xd65f('0x22')](respondWithResult(_0x1b8e97,0xc9))[_0xd65f('0x2d')](handleError(_0x1b8e97,null));};exports[_0xd65f('0x38')]=function(_0xc94648,_0x2344eb){if(_0xc94648[_0xd65f('0x5c')]['id']){delete _0xc94648['body']['id'];}return db['FaxAccount'][_0xd65f('0x60')]({'where':{'id':_0xc94648[_0xd65f('0x58')]['id']},'include':[{'model':db[_0xd65f('0x3f')],'as':_0xd65f('0x40')}]})['then'](handleEntityNotFound(_0x2344eb,null))[_0xd65f('0x22')](saveUpdates(_0xc94648[_0xd65f('0x5c')],null))[_0xd65f('0x22')](respondWithResult(_0x2344eb,null))[_0xd65f('0x2d')](handleError(_0x2344eb,null));};exports[_0xd65f('0x62')]=function(_0x5add78,_0x1be167){return db[_0xd65f('0x42')][_0xd65f('0x60')]({'where':{'id':_0x5add78[_0xd65f('0x58')]['id']}})[_0xd65f('0x22')](handleEntityNotFound(_0x1be167,null))[_0xd65f('0x22')](removeEntity(_0x1be167,null))[_0xd65f('0x2d')](handleError(_0x1be167,null));};exports['describe']=function(_0x8e26c8,_0x3637af){return db[_0xd65f('0x42')]['describe']()['then'](respondWithResult(_0x3637af,null))[_0xd65f('0x2d')](handleError(_0x3637af,null));};exports[_0xd65f('0x63')]=function(_0x250f6b,_0x9a3311,_0xd5e42e){if(_0x250f6b[_0xd65f('0x5c')]['id']){delete _0x250f6b[_0xd65f('0x5c')]['id'];}return db[_0xd65f('0x42')]['find']({'where':{'id':_0x250f6b[_0xd65f('0x58')]['id']}})[_0xd65f('0x22')](handleEntityNotFound(_0x9a3311,null))[_0xd65f('0x22')](function(_0x161c76){if(_0x161c76){_0x250f6b['body']['FaxAccountId']=_0x161c76['id'];return db['Disposition'][_0xd65f('0x5b')](_0x250f6b['body']);}})[_0xd65f('0x22')](respondWithResult(_0x9a3311,null))[_0xd65f('0x2d')](handleError(_0x9a3311,null));};exports[_0xd65f('0x64')]=function(_0x4180f6,_0x451f22,_0x26c6a2){var _0x14e184={'raw':![],'where':{}};var _0x1d101b={};var _0x2e16e4={'count':0x0,'rows':[]};return db[_0xd65f('0x42')][_0xd65f('0x65')]({'where':{'id':_0x4180f6[_0xd65f('0x58')]['id']}})[_0xd65f('0x22')](handleEntityNotFound(_0x451f22,null))[_0xd65f('0x22')](function(_0x34bab7){if(_0x34bab7){_0x1d101b['model']=_[_0xd65f('0x59')](db[_0xd65f('0x66')][_0xd65f('0x43')]);_0x1d101b[_0xd65f('0x46')]=_[_0xd65f('0x59')](_0x4180f6[_0xd65f('0x46')]);_0x1d101b['filters']=_[_0xd65f('0x4a')](_0x1d101b[_0xd65f('0x48')],_0x1d101b[_0xd65f('0x46')]);_0x14e184[_0xd65f('0x49')]=_[_0xd65f('0x4a')](_0x1d101b[_0xd65f('0x48')],qs[_0xd65f('0x4b')](_0x4180f6[_0xd65f('0x46')][_0xd65f('0x4b')]));_0x14e184['attributes']=_0x14e184[_0xd65f('0x49')][_0xd65f('0x4c')]?_0x14e184[_0xd65f('0x49')]:_0x1d101b[_0xd65f('0x48')];if(!_0x4180f6[_0xd65f('0x46')]['hasOwnProperty']('nolimit')){_0x14e184[_0xd65f('0x33')]=qs[_0xd65f('0x33')](_0x4180f6[_0xd65f('0x46')]['limit']);_0x14e184[_0xd65f('0x32')]=qs['offset'](_0x4180f6[_0xd65f('0x46')][_0xd65f('0x32')]);}_0x14e184[_0xd65f('0x67')]=qs[_0xd65f('0x4f')](_0x4180f6[_0xd65f('0x46')][_0xd65f('0x4f')]);_0x14e184[_0xd65f('0x50')]=qs[_0xd65f('0x47')](_[_0xd65f('0x51')](_0x4180f6[_0xd65f('0x46')],_0x1d101b['filters']));_0x14e184[_0xd65f('0x50')][_0xd65f('0x68')]=_0x34bab7['id'];if(_0x4180f6['query']['filter']){_0x14e184[_0xd65f('0x50')]=_[_0xd65f('0x53')](_0x14e184[_0xd65f('0x50')],{'$or':_[_0xd65f('0x41')](_0x14e184[_0xd65f('0x49')],function(_0x141770){var _0x8db597={};_0x8db597[_0x141770]={'$like':'%'+_0x4180f6['query'][_0xd65f('0x52')]+'%'};return _0x8db597;})});}_0x14e184=_[_0xd65f('0x53')]({},_0x14e184,_0x4180f6[_0xd65f('0x5a')]);return db[_0xd65f('0x66')]['count']({'where':_0x14e184['where']})[_0xd65f('0x22')](function(_0x19e3ca){_0x2e16e4['count']=_0x19e3ca;if(_0x4180f6[_0xd65f('0x46')]['includeAll']){_0x14e184[_0xd65f('0x56')]=[{'all':!![]}];}return db[_0xd65f('0x66')][_0xd65f('0x69')](_0x14e184);})['then'](function(_0x2ce493){_0x2e16e4['rows']=_0x2ce493;return _0x2e16e4;});}})[_0xd65f('0x22')](respondWithFilteredResult(_0x451f22,_0x14e184))['catch'](handleError(_0x451f22,null));};exports[_0xd65f('0x6a')]=function(_0x5d88cc,_0x2e968e,_0xf9bd31){return db[_0xd65f('0x42')][_0xd65f('0x60')]({'where':{'id':_0x5d88cc[_0xd65f('0x58')]['id']}})[_0xd65f('0x22')](handleEntityNotFound(_0x2e968e,null))[_0xd65f('0x22')](function(_0x131641){if(_0x131641){return _0x131641[_0xd65f('0x6a')](_0x5d88cc[_0xd65f('0x46')]['ids']);}})['then'](respondWithStatusCode(_0x2e968e,null))[_0xd65f('0x2d')](handleError(_0x2e968e,null));};exports[_0xd65f('0x6b')]=function(_0x4ad84e,_0x351a58,_0x85141f){if(_0x4ad84e[_0xd65f('0x5c')]['id']){delete _0x4ad84e['body']['id'];}return db[_0xd65f('0x42')][_0xd65f('0x60')]({'where':{'id':_0x4ad84e['params']['id']}})['then'](handleEntityNotFound(_0x351a58,null))[_0xd65f('0x22')](function(_0x5b18fc){if(_0x5b18fc){_0x4ad84e[_0xd65f('0x5c')]['FaxAccountId']=_0x5b18fc['id'];return db[_0xd65f('0x6c')]['create'](_0x4ad84e['body']);}})[_0xd65f('0x22')](respondWithResult(_0x351a58,null))[_0xd65f('0x2d')](handleError(_0x351a58,null));};exports[_0xd65f('0x6d')]=function(_0x312090,_0x5a63d9,_0x325480){var _0x2834f5={'raw':![],'where':{}};var _0x2f7d20={};var _0x44a6fb={'count':0x0,'rows':[]};return db[_0xd65f('0x42')][_0xd65f('0x65')]({'where':{'id':_0x312090[_0xd65f('0x58')]['id']}})['then'](handleEntityNotFound(_0x5a63d9,null))[_0xd65f('0x22')](function(_0x43c45c){if(_0x43c45c){_0x2f7d20[_0xd65f('0x48')]=_[_0xd65f('0x59')](db[_0xd65f('0x6c')]['rawAttributes']);_0x2f7d20[_0xd65f('0x46')]=_['keys'](_0x312090['query']);_0x2f7d20[_0xd65f('0x47')]=_[_0xd65f('0x4a')](_0x2f7d20['model'],_0x2f7d20['query']);_0x2834f5['attributes']=_[_0xd65f('0x4a')](_0x2f7d20['model'],qs[_0xd65f('0x4b')](_0x312090[_0xd65f('0x46')][_0xd65f('0x4b')]));_0x2834f5[_0xd65f('0x49')]=_0x2834f5[_0xd65f('0x49')]['length']?_0x2834f5['attributes']:_0x2f7d20[_0xd65f('0x48')];if(!_0x312090[_0xd65f('0x46')][_0xd65f('0x4d')](_0xd65f('0x4e'))){_0x2834f5[_0xd65f('0x33')]=qs[_0xd65f('0x33')](_0x312090[_0xd65f('0x46')][_0xd65f('0x33')]);_0x2834f5[_0xd65f('0x32')]=qs['offset'](_0x312090[_0xd65f('0x46')][_0xd65f('0x32')]);}_0x2834f5[_0xd65f('0x67')]=qs[_0xd65f('0x4f')](_0x312090['query']['sort']);_0x2834f5['where']=qs[_0xd65f('0x47')](_['pick'](_0x312090[_0xd65f('0x46')],_0x2f7d20[_0xd65f('0x47')]));_0x2834f5['where']['FaxAccountId']=_0x43c45c['id'];if(_0x312090[_0xd65f('0x46')][_0xd65f('0x52')]){_0x2834f5['where']=_[_0xd65f('0x53')](_0x2834f5['where'],{'$or':_[_0xd65f('0x41')](_0x2834f5[_0xd65f('0x49')],function(_0x16cdce){var _0x4ed031={};_0x4ed031[_0x16cdce]={'$like':'%'+_0x312090[_0xd65f('0x46')]['filter']+'%'};return _0x4ed031;})});}_0x2834f5=_['merge']({},_0x2834f5,_0x312090[_0xd65f('0x5a')]);return db[_0xd65f('0x6c')][_0xd65f('0x31')]({'where':_0x2834f5[_0xd65f('0x50')]})[_0xd65f('0x22')](function(_0x4b8b87){_0x44a6fb[_0xd65f('0x31')]=_0x4b8b87;if(_0x312090[_0xd65f('0x46')][_0xd65f('0x55')]){_0x2834f5['include']=[{'all':!![]}];}return db[_0xd65f('0x6c')][_0xd65f('0x69')](_0x2834f5);})['then'](function(_0xc67dc0){_0x44a6fb[_0xd65f('0x57')]=_0xc67dc0;return _0x44a6fb;});}})['then'](respondWithFilteredResult(_0x5a63d9,_0x2834f5))[_0xd65f('0x2d')](handleError(_0x5a63d9,null));};exports[_0xd65f('0x6e')]=function(_0x140e2b,_0xbc92d1,_0xd6e058){return db[_0xd65f('0x42')][_0xd65f('0x60')]({'where':{'id':_0x140e2b[_0xd65f('0x58')]['id']}})[_0xd65f('0x22')](handleEntityNotFound(_0xbc92d1,null))['then'](function(_0x392b45){if(_0x392b45){return _0x392b45['removeAnswers'](_0x140e2b[_0xd65f('0x46')]['ids']);}})[_0xd65f('0x22')](respondWithStatusCode(_0xbc92d1,null))[_0xd65f('0x2d')](handleError(_0xbc92d1,null));};exports['addInteraction']=function(_0xcaef8d,_0x3588f0,_0x406ac9){return db[_0xd65f('0x6f')][_0xd65f('0x60')]({'where':{'id':_0xcaef8d['params']['id']}})[_0xd65f('0x22')](handleEntityNotFound(_0x3588f0,null))['then'](function(_0x39e54c){if(_0x39e54c){return _0x39e54c[_0xd65f('0x70')](_0xcaef8d[_0xd65f('0x5c')]['ids'],_[_0xd65f('0x71')](_0xcaef8d[_0xd65f('0x5c')],[_0xd65f('0x72'),'id'])||{});}})[_0xd65f('0x22')](respondWithResult(_0x3588f0,null))[_0xd65f('0x2d')](handleError(_0x3588f0,null));};exports[_0xd65f('0x73')]=function(_0x49a931,_0x112b76,_0x3c23c6){var _0x22c138={'raw':![],'where':{}};var _0x1ee91a={};var _0x58c471={'count':0x0,'rows':[]};return db['FaxAccount'][_0xd65f('0x65')]({'where':{'id':_0x49a931[_0xd65f('0x58')]['id']}})[_0xd65f('0x22')](handleEntityNotFound(_0x112b76,null))[_0xd65f('0x22')](function(_0x3139c8){if(_0x3139c8){_0x1ee91a['model']=_['keys'](db['FaxInteraction'][_0xd65f('0x43')]);_0x1ee91a[_0xd65f('0x46')]=_[_0xd65f('0x59')](_0x49a931[_0xd65f('0x46')]);_0x1ee91a[_0xd65f('0x47')]=_[_0xd65f('0x4a')](_0x1ee91a[_0xd65f('0x48')],_0x1ee91a[_0xd65f('0x46')]);_0x22c138[_0xd65f('0x49')]=_[_0xd65f('0x4a')](_0x1ee91a[_0xd65f('0x48')],qs['fields'](_0x49a931[_0xd65f('0x46')][_0xd65f('0x4b')]));_0x22c138['attributes']=_0x22c138[_0xd65f('0x49')][_0xd65f('0x4c')]?_0x22c138[_0xd65f('0x49')]:_0x1ee91a[_0xd65f('0x48')];if(!_0x49a931[_0xd65f('0x46')]['hasOwnProperty'](_0xd65f('0x4e'))){_0x22c138[_0xd65f('0x33')]=qs[_0xd65f('0x33')](_0x49a931[_0xd65f('0x46')]['limit']);_0x22c138[_0xd65f('0x32')]=qs[_0xd65f('0x32')](_0x49a931[_0xd65f('0x46')][_0xd65f('0x32')]);}_0x22c138[_0xd65f('0x67')]=qs[_0xd65f('0x4f')](_0x49a931[_0xd65f('0x46')][_0xd65f('0x4f')]);_0x22c138[_0xd65f('0x50')]=qs[_0xd65f('0x47')](_[_0xd65f('0x51')](_0x49a931[_0xd65f('0x46')],_0x1ee91a[_0xd65f('0x47')]));_0x22c138['where'][_0xd65f('0x68')]=_0x3139c8['id'];if(_0x49a931['query'][_0xd65f('0x52')]){_0x22c138[_0xd65f('0x50')]=_[_0xd65f('0x53')](_0x22c138['where'],{'$or':_[_0xd65f('0x41')](_0x22c138['attributes'],function(_0x7ce070){var _0x1c2991={};_0x1c2991[_0x7ce070]={'$like':'%'+_0x49a931['query']['filter']+'%'};return _0x1c2991;})});}_0x22c138=_['merge']({},_0x22c138,_0x49a931[_0xd65f('0x5a')]);return db[_0xd65f('0x6f')][_0xd65f('0x31')]({'where':_0x22c138['where']})[_0xd65f('0x22')](function(_0x1e7db9){_0x58c471['count']=_0x1e7db9;if(_0x49a931[_0xd65f('0x46')][_0xd65f('0x55')]){_0x22c138[_0xd65f('0x56')]=[{'model':db['CmContact'],'as':_0xd65f('0x74'),'required':![]},{'model':db[_0xd65f('0x75')],'as':_0xd65f('0x76'),'attributes':[_0xd65f('0x3c'),_0xd65f('0x77'),'internal'],'required':![]},{'model':db[_0xd65f('0x78')],'as':_0xd65f('0x79'),'attributes':['id',_0xd65f('0x3c'),'color'],'where':_0x49a931['query'][_0xd65f('0x7a')]?{'id':_0x49a931[_0xd65f('0x46')][_0xd65f('0x7a')]}:undefined,'required':_0x49a931['query'][_0xd65f('0x7a')]?!![]:![]}];}return db[_0xd65f('0x6f')][_0xd65f('0x69')](_0x22c138);})['then'](function(_0x53fa3d){_0x58c471[_0xd65f('0x57')]=_0x53fa3d;return _0x58c471;});}})[_0xd65f('0x22')](respondWithFilteredResult(_0x112b76,_0x22c138))[_0xd65f('0x2d')](handleError(_0x112b76,null));};exports[_0xd65f('0x7b')]=function(_0x5d9d10,_0x39d747,_0x5628af){return db['FaxAccount'][_0xd65f('0x65')]({'where':{'id':_0x5d9d10['params']['id']}})[_0xd65f('0x22')](handleEntityNotFound(_0x39d747,null))[_0xd65f('0x22')](function(_0x497105){if(_0x497105){return db[_0xd65f('0x7c')][_0xd65f('0x7d')](function(_0x34a087){return db[_0xd65f('0x7e')][_0xd65f('0x62')]({'where':{'FaxAccountId':_0x5d9d10[_0xd65f('0x58')]['id']},'transaction':_0x34a087})['then'](function(_0x1bf6c6){var _0x5b74aa=_[_0xd65f('0x41')](_0x5d9d10[_0xd65f('0x5c')],function(_0x321d8c){_0x321d8c['FaxAccountId']=_0x5d9d10[_0xd65f('0x58')]['id'];return _0x321d8c;});return db[_0xd65f('0x7e')][_0xd65f('0x7f')](_0x5b74aa,{'transaction':_0x34a087});});})[_0xd65f('0x22')](function(){return db[_0xd65f('0x7e')][_0xd65f('0x80')]({'where':{'FaxAccountId':_0x5d9d10['params']['id']},'order':_0xd65f('0x81')});});}})[_0xd65f('0x22')](respondWithResult(_0x39d747,null))[_0xd65f('0x2d')](handleError(_0x39d747,null));};exports[_0xd65f('0x82')]=function(_0x3adba3,_0xf9be38,_0x3b734f){var _0x3fb8c4={};var _0x258e27={};var _0x57aa0f;var _0x3e27fd;return db['FaxAccount'][_0xd65f('0x65')]({'where':{'id':_0x3adba3[_0xd65f('0x58')]['id']}})['then'](handleEntityNotFound(_0xf9be38,null))[_0xd65f('0x22')](function(_0x350fe1){if(_0x350fe1){_0x57aa0f=_0x350fe1;_0x258e27[_0xd65f('0x48')]=_[_0xd65f('0x59')](db['FaxApplication'][_0xd65f('0x43')]);_0x258e27[_0xd65f('0x46')]=_['keys'](_0x3adba3['query']);_0x258e27[_0xd65f('0x47')]=_[_0xd65f('0x4a')](_0x258e27[_0xd65f('0x48')],_0x258e27[_0xd65f('0x46')]);_0x3fb8c4[_0xd65f('0x49')]=_[_0xd65f('0x4a')](_0x258e27[_0xd65f('0x48')],qs[_0xd65f('0x4b')](_0x3adba3['query'][_0xd65f('0x4b')]));_0x3fb8c4[_0xd65f('0x49')]=_0x3fb8c4[_0xd65f('0x49')][_0xd65f('0x4c')]?_0x3fb8c4[_0xd65f('0x49')]:_0x258e27[_0xd65f('0x48')];_0x3fb8c4['order']=qs['sort'](_0x3adba3[_0xd65f('0x46')][_0xd65f('0x4f')]);_0x3fb8c4['where']=qs[_0xd65f('0x47')](_['pick'](_0x3adba3[_0xd65f('0x46')],_0x258e27[_0xd65f('0x47')]));if(_0x3adba3['query'][_0xd65f('0x52')]){_0x3fb8c4[_0xd65f('0x50')]=_[_0xd65f('0x53')](_0x3fb8c4[_0xd65f('0x50')],{'$or':_[_0xd65f('0x41')](_0x3fb8c4[_0xd65f('0x49')],function(_0x4588ad){var _0x245bf7={};_0x245bf7[_0x4588ad]={'$like':'%'+_0x3adba3[_0xd65f('0x46')][_0xd65f('0x52')]+'%'};return _0x245bf7;})});}_0x3fb8c4=_['merge']({},_0x3fb8c4,_0x3adba3[_0xd65f('0x5a')]);return _0x57aa0f[_0xd65f('0x82')](_0x3fb8c4);}})[_0xd65f('0x22')](function(_0x5bc234){if(_0x5bc234){_0x3e27fd=_0x5bc234['length'];if(!_0x3adba3['query'][_0xd65f('0x4d')]('nolimit')){_0x3fb8c4['limit']=qs['limit'](_0x3adba3[_0xd65f('0x46')]['limit']);_0x3fb8c4[_0xd65f('0x32')]=qs[_0xd65f('0x32')](_0x3adba3[_0xd65f('0x46')][_0xd65f('0x32')]);}return _0x57aa0f[_0xd65f('0x82')](_0x3fb8c4);}})[_0xd65f('0x22')](function(_0x338cda){if(_0x338cda){return _0x338cda?{'count':_0x3e27fd,'rows':_0x338cda}:null;}})[_0xd65f('0x22')](respondWithResult(_0xf9be38,null))['catch'](handleError(_0xf9be38,null));};function Extension(_0xbf8f47,_0x2593d4,_0x3f6165,_0x26809e){this[_0xd65f('0x83')]=_0xd65f('0x84');this['exten']=_0xbf8f47[_0xd65f('0x85')];this[_0xd65f('0x86')]=_0x26809e;this['type']=_0xd65f('0x87');this[_0xd65f('0x88')]='Fax\x20Extension';this[_0xd65f('0x68')]=_0xbf8f47['id'];this[_0xd65f('0x81')]=_0x2593d4;this[_0xd65f('0x89')]=_0x3f6165;}function createExtensionsReciveFax(_0x5abfff){var _0x1087a2=0x1;var _0x5cf1a5=[];_0x5cf1a5[_0xd65f('0x8a')](new Extension(_0x5abfff,_0x1087a2,'','Answer'));_0x1087a2+=0x1;_0x5cf1a5['push'](new Extension(_0x5abfff,_0x1087a2,_0xd65f('0x8b'),_0xd65f('0x8c')));_0x1087a2+=0x1;for(var _0x335739 in _0x5abfff){if(_0x5abfff[_0xd65f('0x4d')](_0x335739)&&(_0x335739===_0xd65f('0x8d')||_0x335739===_0xd65f('0x85')||_0x335739===_0xd65f('0x8e')||_0x335739===_0xd65f('0x8f')||_0x335739===_0xd65f('0x90')||_0x335739==='maxrate'||_0x335739===_0xd65f('0x91')||_0x335739===_0xd65f('0x92')||_0x335739===_0xd65f('0x93'))){_0x5cf1a5['push'](new Extension(_0x5abfff,_0x1087a2,_0xd65f('0x94')+_0x335739+')='+_0x5abfff[_0x335739],_0xd65f('0x8c')));_0x1087a2+=0x1;}}_0x5cf1a5['push'](new Extension(_0x5abfff,_0x1087a2,'6',_0xd65f('0x95')));_0x1087a2+=0x1;_0x5cf1a5['push'](new Extension(_0x5abfff,_0x1087a2,_0xd65f('0x96'),_0xd65f('0x97')));_0x1087a2=0x0;return _0x5cf1a5;}exports[_0xd65f('0x98')]=function(_0x5e369e,_0x62bcfe,_0x5ea983){var _0x451899;return db['sequelize']['transaction'](function(_0x522844){return db['FaxAccount'][_0xd65f('0x5b')](_0x5e369e['body'],{'transaction':_0x522844})[_0xd65f('0x22')](function(_0x541919){_0x451899=_0x541919[_0xd65f('0x39')]({'plain':!![]});return db[_0xd65f('0x99')][_0xd65f('0x7f')](createExtensionsReciveFax(_0x451899),{'transaction':_0x522844});});})['then'](function(){return _0x451899;})[_0xd65f('0x22')](respondWithResult(_0x62bcfe,null))['catch'](handleError(_0x62bcfe,null));};exports[_0xd65f('0x9a')]=function(_0x18a491,_0x23561d,_0x41693f){var _0xcdbff1;return db[_0xd65f('0x7c')][_0xd65f('0x7d')](function(_0x740efd){return db['FaxAccount'][_0xd65f('0x38')](_0x18a491[_0xd65f('0x5c')],{'where':{'id':_0x18a491[_0xd65f('0x5c')]['id']},'transaction':_0x740efd})[_0xd65f('0x22')](function(_0x1dc182){return db['VoiceExtension'][_0xd65f('0x62')]({'where':{'FaxAccountId':_0x18a491['body']['id']},'transaction':_0x740efd})[_0xd65f('0x22')](function(_0x4b18c6){return db['VoiceExtension']['bulkCreate'](createExtensionsReciveFax(_[_0xd65f('0x71')](_0x18a491[_0xd65f('0x5c')],[_0xd65f('0x9b'),_0xd65f('0x45'),_0xd65f('0x9c'),_0xd65f('0x9d'),'TrunkId',_0xd65f('0x9e')])),{'transaction':_0x740efd});});});})[_0xd65f('0x22')](function(){return db[_0xd65f('0x42')][_0xd65f('0x9f')](_0x18a491[_0xd65f('0x5c')]['id']);})[_0xd65f('0x22')](respondWithResult(_0x23561d,null))[_0xd65f('0x2d')](handleError(_0x23561d,null));};exports[_0xd65f('0xa0')]=function(_0x3cda26,_0x16d933,_0x5979cc){var _0xad0818={'raw':!![],'where':{}};var _0x4f91f1={};var _0x3b5884={'count':0x0,'rows':[]};return db['FaxAccount'][_0xd65f('0x65')]({'where':{'id':_0x3cda26['params']['id']}})[_0xd65f('0x22')](handleEntityNotFound(_0x16d933,null))[_0xd65f('0x22')](function(_0x121910){if(_0x121910){_0x4f91f1[_0xd65f('0x48')]=_['keys'](db[_0xd65f('0xa1')]['rawAttributes']);_0x4f91f1['query']=_[_0xd65f('0x59')](_0x3cda26['query']);_0x4f91f1[_0xd65f('0x47')]=_['intersection'](_0x4f91f1[_0xd65f('0x48')],_0x4f91f1[_0xd65f('0x46')]);_0xad0818[_0xd65f('0x49')]=_[_0xd65f('0x4a')](_0x4f91f1[_0xd65f('0x48')],qs[_0xd65f('0x4b')](_0x3cda26[_0xd65f('0x46')][_0xd65f('0x4b')]));_0xad0818[_0xd65f('0x49')]=_0xad0818['attributes'][_0xd65f('0x4c')]?_0xad0818[_0xd65f('0x49')]:_0x4f91f1[_0xd65f('0x48')];if(!_0x3cda26['query'][_0xd65f('0x4d')]('nolimit')){_0xad0818[_0xd65f('0x33')]=qs[_0xd65f('0x33')](_0x3cda26[_0xd65f('0x46')][_0xd65f('0x33')]);_0xad0818[_0xd65f('0x32')]=qs['offset'](_0x3cda26[_0xd65f('0x46')][_0xd65f('0x32')]);}_0xad0818[_0xd65f('0x67')]=qs[_0xd65f('0x4f')](_0x3cda26[_0xd65f('0x46')][_0xd65f('0x4f')]);_0xad0818['where']=qs['filters'](_[_0xd65f('0x51')](_0x3cda26[_0xd65f('0x46')],_0x4f91f1['filters']));_0xad0818['where']['FaxAccountId']=_0x121910['id'];if(_0x3cda26['query'][_0xd65f('0x52')]){_0xad0818['where']=_['merge'](_0xad0818[_0xd65f('0x50')],{'$or':_[_0xd65f('0x41')](_0xad0818[_0xd65f('0x49')],function(_0x225a23){var _0x16a412={};_0x16a412[_0x225a23]={'$like':'%'+_0x3cda26['query'][_0xd65f('0x52')]+'%'};return _0x16a412;})});}if(_0x3cda26[_0xd65f('0x46')][_0xd65f('0xa2')]){var _0x2972b3=_0x3cda26[_0xd65f('0x46')][_0xd65f('0xa2')]['split'](',');var _0x31dd79={};_0x31dd79[_0x2972b3[0x0]]={'$gte':moment(_0x2972b3[0x1])[_0xd65f('0xa3')](_0xd65f('0xa4'))};_0xad0818[_0xd65f('0x50')]=_[_0xd65f('0x53')](_0xad0818['where'],_0x31dd79);}_0xad0818=_[_0xd65f('0x53')]({},_0xad0818,_0x3cda26[_0xd65f('0x5a')]);return db['FaxMessage'][_0xd65f('0x31')]({'where':_0xad0818[_0xd65f('0x50')]})[_0xd65f('0x22')](function(_0x492cce){_0x3b5884['count']=_0x492cce;if(_0x3cda26['query'][_0xd65f('0x55')]){_0xad0818[_0xd65f('0x56')]=[{'all':!![]}];}return db['FaxMessage'][_0xd65f('0x69')](_0xad0818);})['then'](function(_0x5975d3){_0x3b5884[_0xd65f('0x57')]=_0x5975d3;return _0x3b5884;});}})[_0xd65f('0x22')](respondWithFilteredResult(_0x16d933,_0xad0818))[_0xd65f('0x2d')](handleError(_0x16d933,null));};exports['send']=function(_0x215e9f,_0x4f9ba5,_0x40935f){var _0x6447bb,_0x5164e7={},_0x1203dc;if(_0x215e9f['body']['to']){_0x1203dc=_0x215e9f[_0xd65f('0x5c')]['to'][0x0];}return db['FaxAccount'][_0xd65f('0x60')]({'where':{'id':_0x215e9f[_0xd65f('0x58')]['id']},'include':[{'model':db['CmList'],'as':_0xd65f('0xa5'),'include':[{'model':db[_0xd65f('0xa6')],'as':_0xd65f('0xa7'),'where':{'fax':_0x1203dc},'limit':0x1,'order':[[_0xd65f('0x9d'),_0xd65f('0xa8')]]}]}]})[_0xd65f('0x22')](handleEntityNotFound(_0x4f9ba5,null))[_0xd65f('0x22')](function(_0x37498f){_0x6447bb=_0x37498f;if(_0x215e9f[_0xd65f('0x5c')]['attachments']&&_0x215e9f[_0xd65f('0x5c')][_0xd65f('0xa9')][_0xd65f('0x4c')]){for(var _0x228eb4=0x0;_0x228eb4<_0x215e9f[_0xd65f('0x5c')][_0xd65f('0xa9')][_0xd65f('0x4c')];_0x228eb4+=0x1){_0x215e9f[_0xd65f('0x5c')]['attachments'][_0x228eb4]={'filename':_0x215e9f[_0xd65f('0x5c')][_0xd65f('0xa9')][_0x228eb4][_0xd65f('0x3c')],'id':_0x215e9f[_0xd65f('0x5c')][_0xd65f('0xa9')][_0x228eb4]['id'],'path':path['join'](config['root'],_0xd65f('0xaa'),_0x215e9f[_0xd65f('0x5c')][_0xd65f('0xa9')][_0x228eb4][_0xd65f('0xab')])};}}return respondWithRpcPromise(_0xd65f('0xac'),_0xd65f('0xac'),{'FaxAccountId':_[_0xd65f('0xad')](_0x215e9f[_0xd65f('0x58')]['id'])?undefined:_0x215e9f[_0xd65f('0x58')]['id'],'path':_['isNil'](_0x215e9f[_0xd65f('0x5c')][_0xd65f('0xa9')][0x0]['path'])?undefined:_0x215e9f[_0xd65f('0x5c')]['attachments'][0x0][_0xd65f('0x7')],'fax':_[_0xd65f('0xad')](_0x215e9f[_0xd65f('0x5c')]['to'][0x0])?undefined:_0x215e9f[_0xd65f('0x5c')]['to'][0x0]},client9002);})[_0xd65f('0x22')](function(){if(_0x6447bb){if(_[_0xd65f('0xad')](_0x215e9f['body'][_0xd65f('0xae')])){_0x215e9f[_0xd65f('0x5c')]['from']=util[_0xd65f('0xa3')](_0xd65f('0xaf'),_0x6447bb['name'],_0x6447bb['fax']);}if(_0x6447bb[_0xd65f('0xa5')]){if(_0x6447bb[_0xd65f('0xa5')][_0xd65f('0xa7')][_0xd65f('0x4c')]){return _0x6447bb['List']['Contacts'][0x0];}else{return db[_0xd65f('0xa6')]['create'](_[_0xd65f('0x19')](_0x215e9f[_0xd65f('0x5c')],{'firstName':_0x215e9f[_0xd65f('0x5c')]['to'][0x0],'phone':_0x215e9f['body']['to'][0x0],'fax':_0x215e9f[_0xd65f('0x5c')]['to'][0x0],'ListId':_0x6447bb[_0xd65f('0x9e')]}));}}else{throw new Error(_0xd65f('0xb0'));}}else{throw new Error(_0xd65f('0xb1'));}})[_0xd65f('0x22')](function(_0x12429a){if(_0x12429a){return db[_0xd65f('0x6f')][_0xd65f('0x60')]({'where':{'ContactId':_0x12429a['id'],'closed':![],'FaxAccountId':_0x6447bb['id']}})[_0xd65f('0x22')](function(_0x318e4b){if(_0x318e4b){return[_0x318e4b,![]];}return db[_0xd65f('0x6f')][_0xd65f('0x5b')]({'UserId':_0x215e9f[_0xd65f('0x5e')]['id'],'ContactId':_0x12429a['id'],'FaxAccountId':_0x6447bb['id'],'fax':_0x215e9f[_0xd65f('0x5c')]['to'][0x0],'firstMsgDirection':_0xd65f('0xb2'),'Messages':[_[_0xd65f('0x53')](_0x215e9f[_0xd65f('0x5c')],{'read':![],'body':_0x215e9f['body']['attachments'][0x0][_0xd65f('0xb3')],'FaxAccountId':_0x6447bb['id'],'UserId':_0x215e9f[_0xd65f('0x5e')]['id'],'ContactId':_0x12429a['id'],'AttachmentId':_0x215e9f[_0xd65f('0x5c')][_0xd65f('0xa9')][0x0]['id']})]},{'include':[{'model':db[_0xd65f('0xa1')],'as':_0xd65f('0xb4')}]})[_0xd65f('0x22')](function(_0x126b93){return[_0x126b93,!![]];});});}else{throw new Error('Contact\x20not\x20found');}})[_0xd65f('0xb5')](function(_0x516275,_0x4e82dc){if(_0x4e82dc){return _0x516275;}return db[_0xd65f('0xa1')][_0xd65f('0x5b')]({'direction':_0xd65f('0xb2'),'read':![],'body':_0x215e9f[_0xd65f('0x5c')][_0xd65f('0xa9')][0x0]['filename'],'FaxAccountId':_0x6447bb['id'],'FaxInteractionId':_0x516275['id'],'UserId':_0x215e9f[_0xd65f('0x5e')]['id'],'ContactId':_0x516275[_0xd65f('0xb6')],'AttachmentId':_0x215e9f['body'][_0xd65f('0xa9')][0x0]['id']})[_0xd65f('0x22')](function(_0x1ecc78){_0x516275['dataValues'][_0xd65f('0xb4')]=[];_0x516275['dataValues'][_0xd65f('0xb4')][_0xd65f('0x8a')](_0x1ecc78[_0xd65f('0xb7')]);return _0x516275;});})['then'](function(_0x3f14e0){respondWithRpcPromise(_0xd65f('0xb8'),'SendFax',{'FaxAccountId':_[_0xd65f('0xad')](_0x215e9f[_0xd65f('0x58')]['id'])?undefined:_0x215e9f[_0xd65f('0x58')]['id'],'path':_[_0xd65f('0xad')](_0x215e9f[_0xd65f('0x5c')][_0xd65f('0xa9')][0x0]['path'])?undefined:_0x215e9f[_0xd65f('0x5c')][_0xd65f('0xa9')][0x0]['path'],'fax':_[_0xd65f('0xad')](_0x215e9f[_0xd65f('0x5c')]['to'][0x0])?undefined:_0x215e9f['body']['to'][0x0],'AttachmentId':_0x215e9f[_0xd65f('0x5c')]['attachments'][0x0]['id']},client9002)['then'](function(_0x3c42e7){logger[_0xd65f('0x23')](_0xd65f('0xb9'),_0x3c42e7);})[_0xd65f('0x2d')](function(_0x103ca7){logger[_0xd65f('0x23')](_0xd65f('0xb9'),_0x103ca7);});return _0x3f14e0;})['then'](respondWithResult(_0x4f9ba5,null))[_0xd65f('0x2d')](handleError(_0x4f9ba5,null));};exports[_0xd65f('0xba')]=function(_0x17bced,_0x261e85,_0x567876){return db[_0xd65f('0x42')][_0xd65f('0x60')]({'where':{'id':_0x17bced[_0xd65f('0x58')]['id']}})[_0xd65f('0x22')](handleEntityNotFound(_0x261e85,null))['then'](function(_0x14d631){if(_0x14d631){return _0x14d631[_0xd65f('0xba')](_0x17bced[_0xd65f('0x5c')][_0xd65f('0x72')],_['omit'](_0x17bced['body'],[_0xd65f('0x72'),'id'])||{})[_0xd65f('0xb5')](function(_0x393e86){for(var _0x3829aa=0x0;_0x3829aa<_0x17bced['body'][_0xd65f('0x72')]['length'];_0x3829aa+=0x1){socket['emit'](_0xd65f('0xbb'),{'UserId':_0x17bced[_0xd65f('0x5c')]['ids'][_0x3829aa],'FaxAccountId':_0x17bced['params']['id']});}return _0x393e86;});}})[_0xd65f('0x22')](respondWithResult(_0x261e85,null))['catch'](handleError(_0x261e85,null));};exports[_0xd65f('0xbc')]=function(_0x2334d2,_0x4a9076,_0x330ebb){return db[_0xd65f('0x42')]['find']({'where':{'id':_0x2334d2[_0xd65f('0x58')]['id']}})[_0xd65f('0x22')](handleEntityNotFound(_0x4a9076,null))[_0xd65f('0x22')](function(_0x328a9f){if(_0x328a9f){return _0x328a9f[_0xd65f('0xbc')](_0x2334d2[_0xd65f('0x46')][_0xd65f('0x72')])[_0xd65f('0x22')](function(){if(_[_0xd65f('0xbd')](_0x2334d2['query']['ids'])){for(var _0x37a04e=0x0;_0x37a04e<_0x2334d2[_0xd65f('0x46')][_0xd65f('0x72')][_0xd65f('0x4c')];_0x37a04e+=0x1){socket[_0xd65f('0xbe')]('userFaxAccount:remove',{'UserId':Number(_0x2334d2[_0xd65f('0x46')][_0xd65f('0x72')][_0x37a04e]),'FaxAccountId':Number(_0x2334d2[_0xd65f('0x58')]['id'])});}}else{socket[_0xd65f('0xbe')]('userFaxAccount:remove',{'UserId':Number(_0x2334d2['query'][_0xd65f('0x72')]),'FaxAccountId':Number(_0x2334d2[_0xd65f('0x58')]['id'])});}});}})['then'](respondWithStatusCode(_0x4a9076,null))[_0xd65f('0x2d')](handleError(_0x4a9076,null));};exports[_0xd65f('0xbf')]=function(_0x237b17,_0x16f137,_0x5f571e){var _0x17648a={};var _0x1d3e35={};var _0x5d1531;var _0x3a356b;return db['FaxAccount'][_0xd65f('0x65')]({'where':{'id':_0x237b17['params']['id']}})[_0xd65f('0x22')](handleEntityNotFound(_0x16f137,null))[_0xd65f('0x22')](function(_0x19aef0){if(_0x19aef0){_0x5d1531=_0x19aef0;_0x1d3e35[_0xd65f('0x48')]=_['keys'](db['User']['rawAttributes']);_0x1d3e35[_0xd65f('0x46')]=_['keys'](_0x237b17['query']);_0x1d3e35['filters']=_[_0xd65f('0x4a')](_0x1d3e35[_0xd65f('0x48')],_0x1d3e35['query']);_0x17648a[_0xd65f('0x49')]=_['intersection'](_0x1d3e35['model'],qs[_0xd65f('0x4b')](_0x237b17[_0xd65f('0x46')][_0xd65f('0x4b')]));_0x17648a[_0xd65f('0x49')]=_0x17648a[_0xd65f('0x49')][_0xd65f('0x4c')]?_0x17648a[_0xd65f('0x49')]:_0x1d3e35[_0xd65f('0x48')];_0x17648a[_0xd65f('0x67')]=qs[_0xd65f('0x4f')](_0x237b17[_0xd65f('0x46')][_0xd65f('0x4f')]);_0x17648a[_0xd65f('0x50')]=qs[_0xd65f('0x47')](_[_0xd65f('0x51')](_0x237b17[_0xd65f('0x46')],_0x1d3e35[_0xd65f('0x47')]));if(_0x237b17['query'][_0xd65f('0x52')]){_0x17648a[_0xd65f('0x50')]=_[_0xd65f('0x53')](_0x17648a[_0xd65f('0x50')],{'$or':_['map'](_0x17648a[_0xd65f('0x49')],function(_0x198adb){var _0x3ed561={};_0x3ed561[_0x198adb]={'$like':'%'+_0x237b17[_0xd65f('0x46')]['filter']+'%'};return _0x3ed561;})});}_0x17648a=_[_0xd65f('0x53')]({},_0x17648a,_0x237b17[_0xd65f('0x5a')]);return _0x5d1531['getAgents'](_0x17648a);}})['then'](function(_0x367afd){if(_0x367afd){_0x3a356b=_0x367afd[_0xd65f('0x4c')];if(!_0x237b17[_0xd65f('0x46')][_0xd65f('0x4d')]('nolimit')){_0x17648a['limit']=qs[_0xd65f('0x33')](_0x237b17['query'][_0xd65f('0x33')]);_0x17648a['offset']=qs['offset'](_0x237b17['query'][_0xd65f('0x32')]);}return _0x5d1531['getAgents'](_0x17648a);}})[_0xd65f('0x22')](function(_0x5ce7f1){if(_0x5ce7f1){return _0x5ce7f1?{'count':_0x3a356b,'rows':_0x5ce7f1}:null;}})[_0xd65f('0x22')](respondWithResult(_0x16f137,null))[_0xd65f('0x2d')](handleError(_0x16f137,null));};
\ No newline at end of file
+var _0x3f3e=['Wait','/var/opt/motion2/server/files/attachments/fax-${CALLERID(num)}-${CUT(UNIQUEID,.,1)}-${CUT(UNIQUEID,.,2)}-${STRFTIME(,,%C%y%m%d%H%M%S)}-rx.tif,d','ReceiveFax','addAccountApplications','sequelize','VoiceExtension','updateAccountApplications','createdAt','updatedAt','ListId','findById','getMessages','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','FaxMessage','send','List','Contacts','DESC','attachments','join','server/files/attachments','basename','CheckAfterSend','isNil','from','\x22%s\x22\x20<%s>','fax','defaults','Send\x20Fax\x20failed','filename','Messages','Contact\x20not\x20found','spread','out','ContactId','dataValues','SendFax','addAgents','emit','removeAgents','isArray','userFaxAccount:remove','getAgents','html-pdf','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./faxAccount.socket','register','jayson/promise','client','http','test','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','info','FaxAccount,\x20%s,\x20%s','request\x20sent','debug','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','status','end','json','count','offset','limit','Content-Range','apply','reject','save','then','get','UserProfileResource','destroy','stack','name','index','Pause','mandatoryDispositionPause','map','FaxAccount','rawAttributes','fieldName','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','type','VIRTUAL','includeAll','include','findAll','rows','params','options','create','body','user','role','FaxAccounts','UserProfileSection','autoAssociation','update','find','describe','FaxAccountId','getDispositions','findOne','Disposition','nolimit','removeDispositions','ids','addAnswer','CannedAnswer','removeAnswers','addInteraction','FaxInteraction','omit','getInteractions','CmContact','Contact','User','Owner','fullname','internal','Tag','color','tag','addApplications','transaction','FaxApplication','bulkCreate','findAndCountAll','priority','getApplications','from-voip-provider','exten','localstationid','app','system','description','Fax\x20Extension','appdata','push','Answer','Set','ecm','gateway','faxdetect','headerinfo','modem','t38timeout','FAXOPT('];(function(_0x59befa,_0x4af99b){var _0x1dd63d=function(_0x4c1df4){while(--_0x4c1df4){_0x59befa['push'](_0x59befa['shift']());}};_0x1dd63d(++_0x4af99b);}(_0x3f3e,0x1b8));var _0xe3f3=function(_0x5aa138,_0x35973c){_0x5aa138=_0x5aa138-0x0;var _0x515ddc=_0x3f3e[_0x5aa138];return _0x515ddc;};'use strict';var pdf=require(_0xe3f3('0x0'));var emlformat=require(_0xe3f3('0x1'));var rimraf=require(_0xe3f3('0x2'));var zipdir=require(_0xe3f3('0x3'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xe3f3('0x4'));var BPromise=require(_0xe3f3('0x5'));var Mustache=require(_0xe3f3('0x6'));var util=require(_0xe3f3('0x7'));var path=require(_0xe3f3('0x8'));var sox=require(_0xe3f3('0x9'));var csv=require(_0xe3f3('0xa'));var ejs=require(_0xe3f3('0xb'));var fs=require('fs');var _=require(_0xe3f3('0xc'));var squel=require('squel');var crypto=require(_0xe3f3('0xd'));var jsforce=require(_0xe3f3('0xe'));var deskjs=require(_0xe3f3('0xf'));var toCsv=require(_0xe3f3('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xe3f3('0x10'));var authService=require(_0xe3f3('0x11'));var qs=require(_0xe3f3('0x12'));var as=require(_0xe3f3('0x13'));var hardwareService=require(_0xe3f3('0x14'));var logger=require(_0xe3f3('0x15'))('api');var utils=require(_0xe3f3('0x16'));var config=require(_0xe3f3('0x17'));var db=require(_0xe3f3('0x18'))['db'];config[_0xe3f3('0x19')]=_['defaults'](config[_0xe3f3('0x19')],{'host':_0xe3f3('0x1a'),'port':0x18eb});var socket=require(_0xe3f3('0x1b'))(new Redis(config[_0xe3f3('0x19')]));require(_0xe3f3('0x1c'))[_0xe3f3('0x1d')](socket);var jayson=require(_0xe3f3('0x1e'));var client=jayson[_0xe3f3('0x1f')][_0xe3f3('0x20')]({'port':0x232c});var client9002=jayson[_0xe3f3('0x1f')][_0xe3f3('0x20')]({'port':0x232a});function checkPasswordPattern(_0x106297,_0x3e30f9,_0x1c2221){if(_0x1c2221){var _0x5f3008=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x5f3008[_0xe3f3('0x21')](_0x3e30f9)){return _0x106297;}else{throw new db['Sequelize'][(_0xe3f3('0x22'))](_0xe3f3('0x23'));}}else{return _0x106297;}}function respondWithRpcPromise(_0x505645,_0x622454,_0xb5ae4d,_0x2489a3){return new BPromise(function(_0x4bc5ae,_0x46766b){var _0xfe7463=_0x2489a3||client;return _0xfe7463[_0xe3f3('0x24')](_0x505645,_0xb5ae4d)['then'](function(_0xb0bcbd){logger[_0xe3f3('0x25')](_0xe3f3('0x26'),_0x622454,_0xe3f3('0x27'));logger[_0xe3f3('0x28')](_0xe3f3('0x29'),_0x622454,_0xe3f3('0x27'),JSON[_0xe3f3('0x2a')](_0xb0bcbd));if(_0xb0bcbd[_0xe3f3('0x2b')]){if(_0xb0bcbd[_0xe3f3('0x2b')]['code']===0x1f4){logger[_0xe3f3('0x2b')]('FaxAccount,\x20%s,\x20%s',_0x622454,_0xb0bcbd[_0xe3f3('0x2b')][_0xe3f3('0x2c')]);return _0x46766b(_0xb0bcbd['error'][_0xe3f3('0x2c')]);}logger['error']('FaxAccount,\x20%s,\x20%s',_0x622454,_0xb0bcbd[_0xe3f3('0x2b')][_0xe3f3('0x2c')]);return _0x4bc5ae(_0xb0bcbd['error'][_0xe3f3('0x2c')]);}else{logger[_0xe3f3('0x25')](_0xe3f3('0x26'),_0x622454,_0xe3f3('0x27'));_0x4bc5ae(_0xb0bcbd['result'][_0xe3f3('0x2c')]);}})[_0xe3f3('0x2d')](function(_0x5203f8){logger['error']('FaxAccount,\x20%s,\x20%s',_0x622454,_0x5203f8);_0x46766b(_0x5203f8);});});}function respondWithStatusCode(_0xa8da23,_0x3f7f6b){_0x3f7f6b=_0x3f7f6b||0xcc;return function(_0xc147ce){if(_0xc147ce){return _0xa8da23['sendStatus'](_0x3f7f6b);}return _0xa8da23[_0xe3f3('0x2e')](_0x3f7f6b)[_0xe3f3('0x2f')]();};}function respondWithResult(_0x92f38b,_0x78bbcf){_0x78bbcf=_0x78bbcf||0xc8;return function(_0x137a83){if(_0x137a83){return _0x92f38b['status'](_0x78bbcf)[_0xe3f3('0x30')](_0x137a83);}};}function respondWithFilteredResult(_0x585f4c,_0x45481a){return function(_0x17b0b5){if(_0x17b0b5){var _0x5136c2=_0x17b0b5[_0xe3f3('0x31')],_0x438bfb=_0x45481a[_0xe3f3('0x32')],_0x47a6a9=_0x45481a[_0xe3f3('0x32')]+_0x45481a[_0xe3f3('0x33')],_0x2a8c15;if(_0x47a6a9>=_0x5136c2){_0x47a6a9=_0x5136c2;_0x2a8c15=0xc8;}else{_0x2a8c15=0xce;}_0x585f4c[_0xe3f3('0x2e')](_0x2a8c15);return _0x585f4c['set'](_0xe3f3('0x34'),_0x438bfb+'-'+_0x47a6a9+'/'+_0x5136c2)[_0xe3f3('0x30')](_0x17b0b5);}return null;};}function patchUpdates(_0x10b4dd){return function(_0x354ddc){try{jsonpatch[_0xe3f3('0x35')](_0x354ddc,_0x10b4dd,!![]);}catch(_0x331206){return BPromise[_0xe3f3('0x36')](_0x331206);}return _0x354ddc[_0xe3f3('0x37')]();};}function saveUpdates(_0x4cba53,_0x362071){return function(_0x352e61){if(_0x352e61){return _0x352e61['update'](_0x4cba53)[_0xe3f3('0x38')](function(_0x4e356a){return _0x4e356a;});}return null;};}function removeEntity(_0x169ec1,_0x39a28f){return function(_0x449cd5){if(_0x449cd5){return _0x449cd5['destroy']()[_0xe3f3('0x38')](function(){var _0x133302=_0x449cd5[_0xe3f3('0x39')]({'plain':!![]});var _0x11bdf1='FaxAccounts';return db[_0xe3f3('0x3a')][_0xe3f3('0x3b')]({'where':{'type':_0x11bdf1,'resourceId':_0x133302['id']}})[_0xe3f3('0x38')](function(){return _0x449cd5;});})[_0xe3f3('0x38')](function(){_0x169ec1[_0xe3f3('0x2e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4cd0dc,_0x6ef60){return function(_0x3d050c){if(!_0x3d050c){_0x4cd0dc['sendStatus'](0x194);}return _0x3d050c;};}function handleError(_0x1468ad,_0x57f4cb){_0x57f4cb=_0x57f4cb||0x1f4;return function(_0x537739){logger[_0xe3f3('0x2b')](_0x537739[_0xe3f3('0x3c')]);if(_0x537739[_0xe3f3('0x3d')]){delete _0x537739[_0xe3f3('0x3d')];}_0x1468ad[_0xe3f3('0x2e')](_0x57f4cb)['send'](_0x537739);};}exports[_0xe3f3('0x3e')]=function(_0x1bdeac,_0xda83f9){var _0x100bc8={'include':[{'model':db[_0xe3f3('0x3f')],'as':_0xe3f3('0x40')}]},_0x4793bd={},_0x7795b5={'count':0x0,'rows':[]};var _0x1176cd=_[_0xe3f3('0x41')](db[_0xe3f3('0x42')][_0xe3f3('0x43')],function(_0x2377a8){return{'name':_0x2377a8[_0xe3f3('0x44')],'type':_0x2377a8['type'][_0xe3f3('0x45')]};});_0x4793bd['model']=_[_0xe3f3('0x41')](_0x1176cd,_0xe3f3('0x3d'));_0x4793bd[_0xe3f3('0x46')]=_[_0xe3f3('0x47')](_0x1bdeac[_0xe3f3('0x46')]);_0x4793bd[_0xe3f3('0x48')]=_[_0xe3f3('0x49')](_0x4793bd[_0xe3f3('0x4a')],_0x4793bd[_0xe3f3('0x46')]);_0x100bc8[_0xe3f3('0x4b')]=_['intersection'](_0x4793bd[_0xe3f3('0x4a')],qs['fields'](_0x1bdeac[_0xe3f3('0x46')][_0xe3f3('0x4c')]));_0x100bc8['attributes']=_0x100bc8[_0xe3f3('0x4b')][_0xe3f3('0x4d')]?_0x100bc8[_0xe3f3('0x4b')]:_0x4793bd[_0xe3f3('0x4a')];if(!_0x1bdeac[_0xe3f3('0x46')][_0xe3f3('0x4e')]('nolimit')){_0x100bc8[_0xe3f3('0x33')]=qs['limit'](_0x1bdeac[_0xe3f3('0x46')]['limit']);_0x100bc8[_0xe3f3('0x32')]=qs['offset'](_0x1bdeac[_0xe3f3('0x46')][_0xe3f3('0x32')]);}_0x100bc8[_0xe3f3('0x4f')]=qs[_0xe3f3('0x50')](_0x1bdeac[_0xe3f3('0x46')][_0xe3f3('0x50')]);_0x100bc8[_0xe3f3('0x51')]=qs[_0xe3f3('0x48')](_[_0xe3f3('0x52')](_0x1bdeac[_0xe3f3('0x46')],_0x4793bd['filters']),_0x1176cd);if(_0x1bdeac['query'][_0xe3f3('0x53')]){_0x100bc8[_0xe3f3('0x51')]=_[_0xe3f3('0x54')](_0x100bc8[_0xe3f3('0x51')],{'$or':_[_0xe3f3('0x41')](_0x1176cd,function(_0xfd1438){if(_0xfd1438[_0xe3f3('0x55')]!==_0xe3f3('0x56')){var _0x562090={};_0x562090[_0xfd1438[_0xe3f3('0x3d')]]={'$like':'%'+_0x1bdeac[_0xe3f3('0x46')][_0xe3f3('0x53')]+'%'};return _0x562090;}})});}_0x100bc8=_[_0xe3f3('0x54')]({},_0x100bc8,_0x1bdeac['options']);var _0x20831d={'where':_0x100bc8[_0xe3f3('0x51')]};return db[_0xe3f3('0x42')][_0xe3f3('0x31')](_0x20831d)['then'](function(_0xc6be95){_0x7795b5[_0xe3f3('0x31')]=_0xc6be95;if(_0x1bdeac[_0xe3f3('0x46')][_0xe3f3('0x57')]){_0x100bc8[_0xe3f3('0x58')]=[{'all':!![]}];}return db[_0xe3f3('0x42')][_0xe3f3('0x59')](_0x100bc8);})[_0xe3f3('0x38')](function(_0x139d16){_0x7795b5[_0xe3f3('0x5a')]=_0x139d16;return _0x7795b5;})['then'](respondWithFilteredResult(_0xda83f9,_0x100bc8))[_0xe3f3('0x2d')](handleError(_0xda83f9,null));};exports['show']=function(_0x2da5db,_0x9a784c){var _0x23fa01={'raw':![],'where':{'id':_0x2da5db[_0xe3f3('0x5b')]['id']},'include':[{'model':db['Pause'],'as':_0xe3f3('0x40')}]},_0x225726={};_0x225726[_0xe3f3('0x4a')]=_[_0xe3f3('0x47')](db['FaxAccount'][_0xe3f3('0x43')]);_0x225726[_0xe3f3('0x46')]=_[_0xe3f3('0x47')](_0x2da5db[_0xe3f3('0x46')]);_0x225726['filters']=_[_0xe3f3('0x49')](_0x225726[_0xe3f3('0x4a')],_0x225726[_0xe3f3('0x46')]);_0x23fa01[_0xe3f3('0x4b')]=_['intersection'](_0x225726['model'],qs['fields'](_0x2da5db[_0xe3f3('0x46')][_0xe3f3('0x4c')]));_0x23fa01[_0xe3f3('0x4b')]=_0x23fa01[_0xe3f3('0x4b')][_0xe3f3('0x4d')]?_0x23fa01[_0xe3f3('0x4b')]:_0x225726[_0xe3f3('0x4a')];if(_0x2da5db[_0xe3f3('0x46')][_0xe3f3('0x57')]){_0x23fa01[_0xe3f3('0x58')]=[{'all':!![]}];}_0x23fa01=_[_0xe3f3('0x54')]({},_0x23fa01,_0x2da5db[_0xe3f3('0x5c')]);return db[_0xe3f3('0x42')]['find'](_0x23fa01)[_0xe3f3('0x38')](handleEntityNotFound(_0x9a784c,null))[_0xe3f3('0x38')](respondWithResult(_0x9a784c,null))[_0xe3f3('0x2d')](handleError(_0x9a784c,null));};exports[_0xe3f3('0x5d')]=function(_0x1c58c6,_0xce8413){return db[_0xe3f3('0x42')][_0xe3f3('0x5d')](_0x1c58c6[_0xe3f3('0x5e')],{})[_0xe3f3('0x38')](function(_0x4b6a70){var _0x4fd286=_0x1c58c6[_0xe3f3('0x5f')]['get']({'plain':!![]});if(!_0x4fd286)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4fd286[_0xe3f3('0x60')]===_0xe3f3('0x5f')){var _0x48746d=_0x4b6a70[_0xe3f3('0x39')]({'plain':!![]});var _0x2d03b7=_0xe3f3('0x61');return db[_0xe3f3('0x62')]['find']({'where':{'name':_0x2d03b7,'userProfileId':_0x4fd286['userProfileId']},'raw':!![]})[_0xe3f3('0x38')](function(_0x4751b3){if(_0x4751b3&&_0x4751b3[_0xe3f3('0x63')]===0x0){return db[_0xe3f3('0x3a')][_0xe3f3('0x5d')]({'name':_0x48746d['name'],'resourceId':_0x48746d['id'],'type':_0x4751b3[_0xe3f3('0x3d')],'sectionId':_0x4751b3['id']},{})[_0xe3f3('0x38')](function(){return _0x4b6a70;});}else{return _0x4b6a70;}})[_0xe3f3('0x2d')](function(_0xc5114b){logger[_0xe3f3('0x2b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xc5114b);throw _0xc5114b;});}return _0x4b6a70;})[_0xe3f3('0x38')](respondWithResult(_0xce8413,0xc9))[_0xe3f3('0x2d')](handleError(_0xce8413,null));};exports[_0xe3f3('0x64')]=function(_0x43a02a,_0x56d1a5){if(_0x43a02a[_0xe3f3('0x5e')]['id']){delete _0x43a02a[_0xe3f3('0x5e')]['id'];}return db['FaxAccount'][_0xe3f3('0x65')]({'where':{'id':_0x43a02a['params']['id']},'include':[{'model':db[_0xe3f3('0x3f')],'as':'mandatoryDispositionPause'}]})['then'](handleEntityNotFound(_0x56d1a5,null))[_0xe3f3('0x38')](saveUpdates(_0x43a02a[_0xe3f3('0x5e')],null))[_0xe3f3('0x38')](respondWithResult(_0x56d1a5,null))['catch'](handleError(_0x56d1a5,null));};exports['destroy']=function(_0x3d8a7e,_0x487f5e){return db[_0xe3f3('0x42')][_0xe3f3('0x65')]({'where':{'id':_0x3d8a7e[_0xe3f3('0x5b')]['id']}})[_0xe3f3('0x38')](handleEntityNotFound(_0x487f5e,null))[_0xe3f3('0x38')](removeEntity(_0x487f5e,null))[_0xe3f3('0x2d')](handleError(_0x487f5e,null));};exports[_0xe3f3('0x66')]=function(_0x1598f2,_0x1e4062){return db[_0xe3f3('0x42')]['describe']()['then'](respondWithResult(_0x1e4062,null))[_0xe3f3('0x2d')](handleError(_0x1e4062,null));};exports['addDisposition']=function(_0x2b3456,_0x1513b5,_0x56f7dd){if(_0x2b3456[_0xe3f3('0x5e')]['id']){delete _0x2b3456[_0xe3f3('0x5e')]['id'];}return db['FaxAccount'][_0xe3f3('0x65')]({'where':{'id':_0x2b3456['params']['id']}})['then'](handleEntityNotFound(_0x1513b5,null))[_0xe3f3('0x38')](function(_0x110646){if(_0x110646){_0x2b3456['body'][_0xe3f3('0x67')]=_0x110646['id'];return db['Disposition'][_0xe3f3('0x5d')](_0x2b3456[_0xe3f3('0x5e')]);}})['then'](respondWithResult(_0x1513b5,null))[_0xe3f3('0x2d')](handleError(_0x1513b5,null));};exports[_0xe3f3('0x68')]=function(_0x3a9494,_0x42aa3e,_0x2ffdea){var _0x5319bd={'raw':![],'where':{}};var _0x4b8072={};var _0x25ff6c={'count':0x0,'rows':[]};return db[_0xe3f3('0x42')][_0xe3f3('0x69')]({'where':{'id':_0x3a9494['params']['id']}})[_0xe3f3('0x38')](handleEntityNotFound(_0x42aa3e,null))[_0xe3f3('0x38')](function(_0x32d23b){if(_0x32d23b){_0x4b8072[_0xe3f3('0x4a')]=_['keys'](db[_0xe3f3('0x6a')]['rawAttributes']);_0x4b8072[_0xe3f3('0x46')]=_[_0xe3f3('0x47')](_0x3a9494[_0xe3f3('0x46')]);_0x4b8072[_0xe3f3('0x48')]=_[_0xe3f3('0x49')](_0x4b8072['model'],_0x4b8072[_0xe3f3('0x46')]);_0x5319bd[_0xe3f3('0x4b')]=_[_0xe3f3('0x49')](_0x4b8072['model'],qs['fields'](_0x3a9494[_0xe3f3('0x46')]['fields']));_0x5319bd[_0xe3f3('0x4b')]=_0x5319bd[_0xe3f3('0x4b')]['length']?_0x5319bd[_0xe3f3('0x4b')]:_0x4b8072[_0xe3f3('0x4a')];if(!_0x3a9494['query'][_0xe3f3('0x4e')](_0xe3f3('0x6b'))){_0x5319bd['limit']=qs['limit'](_0x3a9494[_0xe3f3('0x46')][_0xe3f3('0x33')]);_0x5319bd['offset']=qs[_0xe3f3('0x32')](_0x3a9494[_0xe3f3('0x46')][_0xe3f3('0x32')]);}_0x5319bd[_0xe3f3('0x4f')]=qs[_0xe3f3('0x50')](_0x3a9494['query']['sort']);_0x5319bd[_0xe3f3('0x51')]=qs[_0xe3f3('0x48')](_[_0xe3f3('0x52')](_0x3a9494[_0xe3f3('0x46')],_0x4b8072[_0xe3f3('0x48')]));_0x5319bd[_0xe3f3('0x51')]['FaxAccountId']=_0x32d23b['id'];if(_0x3a9494[_0xe3f3('0x46')][_0xe3f3('0x53')]){_0x5319bd[_0xe3f3('0x51')]=_[_0xe3f3('0x54')](_0x5319bd[_0xe3f3('0x51')],{'$or':_[_0xe3f3('0x41')](_0x5319bd[_0xe3f3('0x4b')],function(_0x2d8c3){var _0x5111e5={};_0x5111e5[_0x2d8c3]={'$like':'%'+_0x3a9494['query'][_0xe3f3('0x53')]+'%'};return _0x5111e5;})});}_0x5319bd=_[_0xe3f3('0x54')]({},_0x5319bd,_0x3a9494[_0xe3f3('0x5c')]);return db[_0xe3f3('0x6a')][_0xe3f3('0x31')]({'where':_0x5319bd[_0xe3f3('0x51')]})[_0xe3f3('0x38')](function(_0x3c8646){_0x25ff6c[_0xe3f3('0x31')]=_0x3c8646;if(_0x3a9494[_0xe3f3('0x46')][_0xe3f3('0x57')]){_0x5319bd[_0xe3f3('0x58')]=[{'all':!![]}];}return db[_0xe3f3('0x6a')][_0xe3f3('0x59')](_0x5319bd);})[_0xe3f3('0x38')](function(_0x2d31b6){_0x25ff6c['rows']=_0x2d31b6;return _0x25ff6c;});}})[_0xe3f3('0x38')](respondWithFilteredResult(_0x42aa3e,_0x5319bd))['catch'](handleError(_0x42aa3e,null));};exports[_0xe3f3('0x6c')]=function(_0x50557b,_0x1c47ca,_0x350d8d){return db[_0xe3f3('0x42')]['find']({'where':{'id':_0x50557b[_0xe3f3('0x5b')]['id']}})['then'](handleEntityNotFound(_0x1c47ca,null))['then'](function(_0xc42306){if(_0xc42306){return _0xc42306[_0xe3f3('0x6c')](_0x50557b[_0xe3f3('0x46')][_0xe3f3('0x6d')]);}})[_0xe3f3('0x38')](respondWithStatusCode(_0x1c47ca,null))[_0xe3f3('0x2d')](handleError(_0x1c47ca,null));};exports[_0xe3f3('0x6e')]=function(_0x51bd8c,_0x5ae855,_0x36d08b){if(_0x51bd8c[_0xe3f3('0x5e')]['id']){delete _0x51bd8c['body']['id'];}return db[_0xe3f3('0x42')]['find']({'where':{'id':_0x51bd8c[_0xe3f3('0x5b')]['id']}})[_0xe3f3('0x38')](handleEntityNotFound(_0x5ae855,null))[_0xe3f3('0x38')](function(_0x18b81a){if(_0x18b81a){_0x51bd8c[_0xe3f3('0x5e')][_0xe3f3('0x67')]=_0x18b81a['id'];return db[_0xe3f3('0x6f')]['create'](_0x51bd8c[_0xe3f3('0x5e')]);}})[_0xe3f3('0x38')](respondWithResult(_0x5ae855,null))[_0xe3f3('0x2d')](handleError(_0x5ae855,null));};exports['getAnswers']=function(_0x24decc,_0x335ace,_0x22842b){var _0x2008ec={'raw':![],'where':{}};var _0x4cb648={};var _0x8cdfdb={'count':0x0,'rows':[]};return db[_0xe3f3('0x42')][_0xe3f3('0x69')]({'where':{'id':_0x24decc[_0xe3f3('0x5b')]['id']}})['then'](handleEntityNotFound(_0x335ace,null))['then'](function(_0x22ccab){if(_0x22ccab){_0x4cb648[_0xe3f3('0x4a')]=_['keys'](db[_0xe3f3('0x6f')]['rawAttributes']);_0x4cb648[_0xe3f3('0x46')]=_[_0xe3f3('0x47')](_0x24decc[_0xe3f3('0x46')]);_0x4cb648[_0xe3f3('0x48')]=_[_0xe3f3('0x49')](_0x4cb648[_0xe3f3('0x4a')],_0x4cb648[_0xe3f3('0x46')]);_0x2008ec['attributes']=_[_0xe3f3('0x49')](_0x4cb648['model'],qs[_0xe3f3('0x4c')](_0x24decc[_0xe3f3('0x46')][_0xe3f3('0x4c')]));_0x2008ec[_0xe3f3('0x4b')]=_0x2008ec[_0xe3f3('0x4b')][_0xe3f3('0x4d')]?_0x2008ec[_0xe3f3('0x4b')]:_0x4cb648[_0xe3f3('0x4a')];if(!_0x24decc[_0xe3f3('0x46')][_0xe3f3('0x4e')]('nolimit')){_0x2008ec[_0xe3f3('0x33')]=qs['limit'](_0x24decc[_0xe3f3('0x46')][_0xe3f3('0x33')]);_0x2008ec[_0xe3f3('0x32')]=qs['offset'](_0x24decc['query'][_0xe3f3('0x32')]);}_0x2008ec[_0xe3f3('0x4f')]=qs['sort'](_0x24decc['query'][_0xe3f3('0x50')]);_0x2008ec[_0xe3f3('0x51')]=qs['filters'](_[_0xe3f3('0x52')](_0x24decc[_0xe3f3('0x46')],_0x4cb648[_0xe3f3('0x48')]));_0x2008ec[_0xe3f3('0x51')][_0xe3f3('0x67')]=_0x22ccab['id'];if(_0x24decc[_0xe3f3('0x46')][_0xe3f3('0x53')]){_0x2008ec[_0xe3f3('0x51')]=_['merge'](_0x2008ec[_0xe3f3('0x51')],{'$or':_['map'](_0x2008ec[_0xe3f3('0x4b')],function(_0x27c218){var _0x795344={};_0x795344[_0x27c218]={'$like':'%'+_0x24decc[_0xe3f3('0x46')][_0xe3f3('0x53')]+'%'};return _0x795344;})});}_0x2008ec=_[_0xe3f3('0x54')]({},_0x2008ec,_0x24decc[_0xe3f3('0x5c')]);return db[_0xe3f3('0x6f')]['count']({'where':_0x2008ec[_0xe3f3('0x51')]})[_0xe3f3('0x38')](function(_0x36c7a6){_0x8cdfdb[_0xe3f3('0x31')]=_0x36c7a6;if(_0x24decc[_0xe3f3('0x46')][_0xe3f3('0x57')]){_0x2008ec['include']=[{'all':!![]}];}return db[_0xe3f3('0x6f')][_0xe3f3('0x59')](_0x2008ec);})['then'](function(_0x2d12e1){_0x8cdfdb['rows']=_0x2d12e1;return _0x8cdfdb;});}})[_0xe3f3('0x38')](respondWithFilteredResult(_0x335ace,_0x2008ec))[_0xe3f3('0x2d')](handleError(_0x335ace,null));};exports[_0xe3f3('0x70')]=function(_0x493f54,_0x3bcb85,_0x4ab474){return db[_0xe3f3('0x42')][_0xe3f3('0x65')]({'where':{'id':_0x493f54['params']['id']}})['then'](handleEntityNotFound(_0x3bcb85,null))[_0xe3f3('0x38')](function(_0x15ebf1){if(_0x15ebf1){return _0x15ebf1['removeAnswers'](_0x493f54[_0xe3f3('0x46')][_0xe3f3('0x6d')]);}})[_0xe3f3('0x38')](respondWithStatusCode(_0x3bcb85,null))[_0xe3f3('0x2d')](handleError(_0x3bcb85,null));};exports[_0xe3f3('0x71')]=function(_0x57dadd,_0x1b0873,_0x1aea11){return db[_0xe3f3('0x72')][_0xe3f3('0x65')]({'where':{'id':_0x57dadd['params']['id']}})[_0xe3f3('0x38')](handleEntityNotFound(_0x1b0873,null))['then'](function(_0x1f81e3){if(_0x1f81e3){return _0x1f81e3['addInteraction'](_0x57dadd['body'][_0xe3f3('0x6d')],_[_0xe3f3('0x73')](_0x57dadd[_0xe3f3('0x5e')],[_0xe3f3('0x6d'),'id'])||{});}})[_0xe3f3('0x38')](respondWithResult(_0x1b0873,null))[_0xe3f3('0x2d')](handleError(_0x1b0873,null));};exports[_0xe3f3('0x74')]=function(_0x208937,_0x38e4ab,_0x338f21){var _0x10290c={'raw':![],'where':{}};var _0x484714={};var _0x32572c={'count':0x0,'rows':[]};return db[_0xe3f3('0x42')][_0xe3f3('0x69')]({'where':{'id':_0x208937['params']['id']}})['then'](handleEntityNotFound(_0x38e4ab,null))['then'](function(_0x5798b8){if(_0x5798b8){_0x484714[_0xe3f3('0x4a')]=_[_0xe3f3('0x47')](db[_0xe3f3('0x72')]['rawAttributes']);_0x484714['query']=_[_0xe3f3('0x47')](_0x208937[_0xe3f3('0x46')]);_0x484714['filters']=_[_0xe3f3('0x49')](_0x484714[_0xe3f3('0x4a')],_0x484714['query']);_0x10290c[_0xe3f3('0x4b')]=_['intersection'](_0x484714[_0xe3f3('0x4a')],qs[_0xe3f3('0x4c')](_0x208937[_0xe3f3('0x46')][_0xe3f3('0x4c')]));_0x10290c[_0xe3f3('0x4b')]=_0x10290c[_0xe3f3('0x4b')][_0xe3f3('0x4d')]?_0x10290c[_0xe3f3('0x4b')]:_0x484714['model'];if(!_0x208937[_0xe3f3('0x46')][_0xe3f3('0x4e')](_0xe3f3('0x6b'))){_0x10290c[_0xe3f3('0x33')]=qs[_0xe3f3('0x33')](_0x208937['query'][_0xe3f3('0x33')]);_0x10290c['offset']=qs[_0xe3f3('0x32')](_0x208937[_0xe3f3('0x46')][_0xe3f3('0x32')]);}_0x10290c[_0xe3f3('0x4f')]=qs['sort'](_0x208937[_0xe3f3('0x46')][_0xe3f3('0x50')]);_0x10290c[_0xe3f3('0x51')]=qs[_0xe3f3('0x48')](_['pick'](_0x208937[_0xe3f3('0x46')],_0x484714[_0xe3f3('0x48')]));_0x10290c[_0xe3f3('0x51')][_0xe3f3('0x67')]=_0x5798b8['id'];if(_0x208937[_0xe3f3('0x46')][_0xe3f3('0x53')]){_0x10290c[_0xe3f3('0x51')]=_[_0xe3f3('0x54')](_0x10290c['where'],{'$or':_[_0xe3f3('0x41')](_0x10290c[_0xe3f3('0x4b')],function(_0x5abd58){var _0x2037d1={};_0x2037d1[_0x5abd58]={'$like':'%'+_0x208937['query'][_0xe3f3('0x53')]+'%'};return _0x2037d1;})});}_0x10290c=_[_0xe3f3('0x54')]({},_0x10290c,_0x208937[_0xe3f3('0x5c')]);return db[_0xe3f3('0x72')]['count']({'where':_0x10290c[_0xe3f3('0x51')]})['then'](function(_0x33e7e0){_0x32572c[_0xe3f3('0x31')]=_0x33e7e0;if(_0x208937['query'][_0xe3f3('0x57')]){_0x10290c['include']=[{'model':db[_0xe3f3('0x75')],'as':_0xe3f3('0x76'),'required':![]},{'model':db[_0xe3f3('0x77')],'as':_0xe3f3('0x78'),'attributes':[_0xe3f3('0x3d'),_0xe3f3('0x79'),_0xe3f3('0x7a')],'required':![]},{'model':db[_0xe3f3('0x7b')],'as':'Tags','attributes':['id',_0xe3f3('0x3d'),_0xe3f3('0x7c')],'where':_0x208937['query'][_0xe3f3('0x7d')]?{'id':_0x208937['query']['tag']}:undefined,'required':_0x208937[_0xe3f3('0x46')][_0xe3f3('0x7d')]?!![]:![]}];}return db[_0xe3f3('0x72')]['findAll'](_0x10290c);})[_0xe3f3('0x38')](function(_0x3011ff){_0x32572c[_0xe3f3('0x5a')]=_0x3011ff;return _0x32572c;});}})[_0xe3f3('0x38')](respondWithFilteredResult(_0x38e4ab,_0x10290c))['catch'](handleError(_0x38e4ab,null));};exports[_0xe3f3('0x7e')]=function(_0x21010e,_0x50a629,_0x1492fe){return db[_0xe3f3('0x42')][_0xe3f3('0x69')]({'where':{'id':_0x21010e[_0xe3f3('0x5b')]['id']}})[_0xe3f3('0x38')](handleEntityNotFound(_0x50a629,null))[_0xe3f3('0x38')](function(_0x4c9769){if(_0x4c9769){return db['sequelize'][_0xe3f3('0x7f')](function(_0x4b4dd7){return db[_0xe3f3('0x80')][_0xe3f3('0x3b')]({'where':{'FaxAccountId':_0x21010e[_0xe3f3('0x5b')]['id']},'transaction':_0x4b4dd7})[_0xe3f3('0x38')](function(_0x5f5b87){var _0x5afb27=_['map'](_0x21010e[_0xe3f3('0x5e')],function(_0xd93a75){_0xd93a75['FaxAccountId']=_0x21010e['params']['id'];return _0xd93a75;});return db[_0xe3f3('0x80')][_0xe3f3('0x81')](_0x5afb27,{'transaction':_0x4b4dd7});});})['then'](function(){return db[_0xe3f3('0x80')][_0xe3f3('0x82')]({'where':{'FaxAccountId':_0x21010e['params']['id']},'order':_0xe3f3('0x83')});});}})[_0xe3f3('0x38')](respondWithResult(_0x50a629,null))['catch'](handleError(_0x50a629,null));};exports[_0xe3f3('0x84')]=function(_0x1d2ee9,_0x51b2ff,_0x3d1105){var _0x2eab3a={};var _0x2a4dea={};var _0x32ed68;var _0x1e97cb;return db['FaxAccount'][_0xe3f3('0x69')]({'where':{'id':_0x1d2ee9['params']['id']}})[_0xe3f3('0x38')](handleEntityNotFound(_0x51b2ff,null))[_0xe3f3('0x38')](function(_0x59715f){if(_0x59715f){_0x32ed68=_0x59715f;_0x2a4dea['model']=_['keys'](db[_0xe3f3('0x80')][_0xe3f3('0x43')]);_0x2a4dea['query']=_[_0xe3f3('0x47')](_0x1d2ee9[_0xe3f3('0x46')]);_0x2a4dea[_0xe3f3('0x48')]=_['intersection'](_0x2a4dea[_0xe3f3('0x4a')],_0x2a4dea['query']);_0x2eab3a[_0xe3f3('0x4b')]=_['intersection'](_0x2a4dea[_0xe3f3('0x4a')],qs[_0xe3f3('0x4c')](_0x1d2ee9[_0xe3f3('0x46')][_0xe3f3('0x4c')]));_0x2eab3a[_0xe3f3('0x4b')]=_0x2eab3a[_0xe3f3('0x4b')]['length']?_0x2eab3a[_0xe3f3('0x4b')]:_0x2a4dea[_0xe3f3('0x4a')];_0x2eab3a['order']=qs[_0xe3f3('0x50')](_0x1d2ee9[_0xe3f3('0x46')][_0xe3f3('0x50')]);_0x2eab3a[_0xe3f3('0x51')]=qs[_0xe3f3('0x48')](_[_0xe3f3('0x52')](_0x1d2ee9[_0xe3f3('0x46')],_0x2a4dea[_0xe3f3('0x48')]));if(_0x1d2ee9[_0xe3f3('0x46')][_0xe3f3('0x53')]){_0x2eab3a[_0xe3f3('0x51')]=_['merge'](_0x2eab3a[_0xe3f3('0x51')],{'$or':_[_0xe3f3('0x41')](_0x2eab3a[_0xe3f3('0x4b')],function(_0x4d4b4f){var _0x31814f={};_0x31814f[_0x4d4b4f]={'$like':'%'+_0x1d2ee9[_0xe3f3('0x46')][_0xe3f3('0x53')]+'%'};return _0x31814f;})});}_0x2eab3a=_['merge']({},_0x2eab3a,_0x1d2ee9['options']);return _0x32ed68[_0xe3f3('0x84')](_0x2eab3a);}})[_0xe3f3('0x38')](function(_0x3ae75a){if(_0x3ae75a){_0x1e97cb=_0x3ae75a[_0xe3f3('0x4d')];if(!_0x1d2ee9['query'][_0xe3f3('0x4e')](_0xe3f3('0x6b'))){_0x2eab3a[_0xe3f3('0x33')]=qs[_0xe3f3('0x33')](_0x1d2ee9[_0xe3f3('0x46')]['limit']);_0x2eab3a['offset']=qs[_0xe3f3('0x32')](_0x1d2ee9[_0xe3f3('0x46')][_0xe3f3('0x32')]);}return _0x32ed68[_0xe3f3('0x84')](_0x2eab3a);}})[_0xe3f3('0x38')](function(_0x351789){if(_0x351789){return _0x351789?{'count':_0x1e97cb,'rows':_0x351789}:null;}})['then'](respondWithResult(_0x51b2ff,null))['catch'](handleError(_0x51b2ff,null));};function Extension(_0x34ec37,_0x2842e1,_0x74f6ec,_0x58d70e){this['context']=_0xe3f3('0x85');this[_0xe3f3('0x86')]=_0x34ec37[_0xe3f3('0x87')];this[_0xe3f3('0x88')]=_0x58d70e;this[_0xe3f3('0x55')]=_0xe3f3('0x89');this[_0xe3f3('0x8a')]=_0xe3f3('0x8b');this['FaxAccountId']=_0x34ec37['id'];this[_0xe3f3('0x83')]=_0x2842e1;this[_0xe3f3('0x8c')]=_0x74f6ec;}function createExtensionsReciveFax(_0x41b333){var _0x3aa3ff=0x1;var _0x3af365=[];_0x3af365[_0xe3f3('0x8d')](new Extension(_0x41b333,_0x3aa3ff,'',_0xe3f3('0x8e')));_0x3aa3ff+=0x1;_0x3af365[_0xe3f3('0x8d')](new Extension(_0x41b333,_0x3aa3ff,'CDR(type)=inbound-fax',_0xe3f3('0x8f')));_0x3aa3ff+=0x1;for(var _0x500092 in _0x41b333){if(_0x41b333[_0xe3f3('0x4e')](_0x500092)&&(_0x500092===_0xe3f3('0x90')||_0x500092==='localstationid'||_0x500092===_0xe3f3('0x91')||_0x500092===_0xe3f3('0x92')||_0x500092===_0xe3f3('0x93')||_0x500092==='maxrate'||_0x500092==='minrate'||_0x500092===_0xe3f3('0x94')||_0x500092===_0xe3f3('0x95'))){_0x3af365[_0xe3f3('0x8d')](new Extension(_0x41b333,_0x3aa3ff,_0xe3f3('0x96')+_0x500092+')='+_0x41b333[_0x500092],_0xe3f3('0x8f')));_0x3aa3ff+=0x1;}}_0x3af365['push'](new Extension(_0x41b333,_0x3aa3ff,'6',_0xe3f3('0x97')));_0x3aa3ff+=0x1;_0x3af365[_0xe3f3('0x8d')](new Extension(_0x41b333,_0x3aa3ff,_0xe3f3('0x98'),_0xe3f3('0x99')));_0x3aa3ff=0x0;return _0x3af365;}exports[_0xe3f3('0x9a')]=function(_0x50983a,_0xae95a0,_0xfea4ea){var _0x20d348;return db[_0xe3f3('0x9b')][_0xe3f3('0x7f')](function(_0x2b9505){return db[_0xe3f3('0x42')][_0xe3f3('0x5d')](_0x50983a['body'],{'transaction':_0x2b9505})[_0xe3f3('0x38')](function(_0x437002){_0x20d348=_0x437002[_0xe3f3('0x39')]({'plain':!![]});return db[_0xe3f3('0x9c')][_0xe3f3('0x81')](createExtensionsReciveFax(_0x20d348),{'transaction':_0x2b9505});});})[_0xe3f3('0x38')](function(){return _0x20d348;})[_0xe3f3('0x38')](respondWithResult(_0xae95a0,null))[_0xe3f3('0x2d')](handleError(_0xae95a0,null));};exports[_0xe3f3('0x9d')]=function(_0x1178e6,_0x4a4c16,_0x33c333){var _0x638512;return db[_0xe3f3('0x9b')][_0xe3f3('0x7f')](function(_0x3fff9f){return db['FaxAccount'][_0xe3f3('0x64')](_0x1178e6['body'],{'where':{'id':_0x1178e6['body']['id']},'transaction':_0x3fff9f})['then'](function(_0x15eda1){return db['VoiceExtension'][_0xe3f3('0x3b')]({'where':{'FaxAccountId':_0x1178e6['body']['id']},'transaction':_0x3fff9f})[_0xe3f3('0x38')](function(_0x3bd8a4){return db[_0xe3f3('0x9c')][_0xe3f3('0x81')](createExtensionsReciveFax(_[_0xe3f3('0x73')](_0x1178e6[_0xe3f3('0x5e')],['tech',_0xe3f3('0x45'),_0xe3f3('0x9e'),_0xe3f3('0x9f'),'TrunkId',_0xe3f3('0xa0')])),{'transaction':_0x3fff9f});});});})[_0xe3f3('0x38')](function(){return db[_0xe3f3('0x42')][_0xe3f3('0xa1')](_0x1178e6[_0xe3f3('0x5e')]['id']);})[_0xe3f3('0x38')](respondWithResult(_0x4a4c16,null))[_0xe3f3('0x2d')](handleError(_0x4a4c16,null));};exports[_0xe3f3('0xa2')]=function(_0x46995f,_0x11bc54,_0x276381){var _0x413c49={'raw':!![],'where':{}};var _0x2106d3={};var _0x3f6b22={'count':0x0,'rows':[]};return db[_0xe3f3('0x42')]['findOne']({'where':{'id':_0x46995f[_0xe3f3('0x5b')]['id']}})[_0xe3f3('0x38')](handleEntityNotFound(_0x11bc54,null))[_0xe3f3('0x38')](function(_0x7aa7d3){if(_0x7aa7d3){_0x2106d3[_0xe3f3('0x4a')]=_[_0xe3f3('0x47')](db['FaxMessage'][_0xe3f3('0x43')]);_0x2106d3[_0xe3f3('0x46')]=_[_0xe3f3('0x47')](_0x46995f[_0xe3f3('0x46')]);_0x2106d3[_0xe3f3('0x48')]=_[_0xe3f3('0x49')](_0x2106d3[_0xe3f3('0x4a')],_0x2106d3['query']);_0x413c49[_0xe3f3('0x4b')]=_[_0xe3f3('0x49')](_0x2106d3['model'],qs[_0xe3f3('0x4c')](_0x46995f[_0xe3f3('0x46')][_0xe3f3('0x4c')]));_0x413c49['attributes']=_0x413c49[_0xe3f3('0x4b')]['length']?_0x413c49[_0xe3f3('0x4b')]:_0x2106d3[_0xe3f3('0x4a')];if(!_0x46995f[_0xe3f3('0x46')][_0xe3f3('0x4e')](_0xe3f3('0x6b'))){_0x413c49['limit']=qs[_0xe3f3('0x33')](_0x46995f['query'][_0xe3f3('0x33')]);_0x413c49[_0xe3f3('0x32')]=qs[_0xe3f3('0x32')](_0x46995f['query']['offset']);}_0x413c49['order']=qs[_0xe3f3('0x50')](_0x46995f[_0xe3f3('0x46')][_0xe3f3('0x50')]);_0x413c49[_0xe3f3('0x51')]=qs[_0xe3f3('0x48')](_['pick'](_0x46995f[_0xe3f3('0x46')],_0x2106d3['filters']));_0x413c49[_0xe3f3('0x51')][_0xe3f3('0x67')]=_0x7aa7d3['id'];if(_0x46995f[_0xe3f3('0x46')][_0xe3f3('0x53')]){_0x413c49[_0xe3f3('0x51')]=_[_0xe3f3('0x54')](_0x413c49[_0xe3f3('0x51')],{'$or':_[_0xe3f3('0x41')](_0x413c49[_0xe3f3('0x4b')],function(_0x317c1a){var _0x2fe21b={};_0x2fe21b[_0x317c1a]={'$like':'%'+_0x46995f[_0xe3f3('0x46')]['filter']+'%'};return _0x2fe21b;})});}if(_0x46995f[_0xe3f3('0x46')][_0xe3f3('0xa3')]){var _0x56b110=_0x46995f[_0xe3f3('0x46')][_0xe3f3('0xa3')][_0xe3f3('0xa4')](',');var _0x49cd28={};_0x49cd28[_0x56b110[0x0]]={'$gte':moment(_0x56b110[0x1])[_0xe3f3('0xa5')](_0xe3f3('0xa6'))};_0x413c49[_0xe3f3('0x51')]=_[_0xe3f3('0x54')](_0x413c49[_0xe3f3('0x51')],_0x49cd28);}_0x413c49=_[_0xe3f3('0x54')]({},_0x413c49,_0x46995f[_0xe3f3('0x5c')]);return db[_0xe3f3('0xa7')][_0xe3f3('0x31')]({'where':_0x413c49[_0xe3f3('0x51')]})['then'](function(_0x38a6d2){_0x3f6b22[_0xe3f3('0x31')]=_0x38a6d2;if(_0x46995f['query'][_0xe3f3('0x57')]){_0x413c49['include']=[{'all':!![]}];}return db[_0xe3f3('0xa7')]['findAll'](_0x413c49);})['then'](function(_0x5b283d){_0x3f6b22[_0xe3f3('0x5a')]=_0x5b283d;return _0x3f6b22;});}})[_0xe3f3('0x38')](respondWithFilteredResult(_0x11bc54,_0x413c49))[_0xe3f3('0x2d')](handleError(_0x11bc54,null));};exports[_0xe3f3('0xa8')]=function(_0x5bc834,_0x443429,_0x4aa2f){var _0x57b869,_0x154fdb={},_0x4282c4;if(_0x5bc834[_0xe3f3('0x5e')]['to']){_0x4282c4=_0x5bc834[_0xe3f3('0x5e')]['to'][0x0];}return db[_0xe3f3('0x42')][_0xe3f3('0x65')]({'where':{'id':_0x5bc834[_0xe3f3('0x5b')]['id']},'include':[{'model':db['CmList'],'as':_0xe3f3('0xa9'),'include':[{'model':db[_0xe3f3('0x75')],'as':_0xe3f3('0xaa'),'where':{'fax':_0x4282c4},'limit':0x1,'order':[[_0xe3f3('0x9f'),_0xe3f3('0xab')]]}]}]})[_0xe3f3('0x38')](handleEntityNotFound(_0x443429,null))[_0xe3f3('0x38')](function(_0xfa5a12){_0x57b869=_0xfa5a12;if(_0x5bc834[_0xe3f3('0x5e')][_0xe3f3('0xac')]&&_0x5bc834[_0xe3f3('0x5e')][_0xe3f3('0xac')][_0xe3f3('0x4d')]){for(var _0x16180=0x0;_0x16180<_0x5bc834['body']['attachments'][_0xe3f3('0x4d')];_0x16180+=0x1){_0x5bc834['body'][_0xe3f3('0xac')][_0x16180]={'filename':_0x5bc834[_0xe3f3('0x5e')]['attachments'][_0x16180][_0xe3f3('0x3d')],'id':_0x5bc834[_0xe3f3('0x5e')]['attachments'][_0x16180]['id'],'path':path[_0xe3f3('0xad')](config['root'],_0xe3f3('0xae'),_0x5bc834[_0xe3f3('0x5e')][_0xe3f3('0xac')][_0x16180][_0xe3f3('0xaf')])};}}return respondWithRpcPromise(_0xe3f3('0xb0'),_0xe3f3('0xb0'),{'FaxAccountId':_[_0xe3f3('0xb1')](_0x5bc834[_0xe3f3('0x5b')]['id'])?undefined:_0x5bc834[_0xe3f3('0x5b')]['id'],'path':_[_0xe3f3('0xb1')](_0x5bc834[_0xe3f3('0x5e')][_0xe3f3('0xac')][0x0][_0xe3f3('0x8')])?undefined:_0x5bc834[_0xe3f3('0x5e')]['attachments'][0x0][_0xe3f3('0x8')],'fax':_[_0xe3f3('0xb1')](_0x5bc834[_0xe3f3('0x5e')]['to'][0x0])?undefined:_0x5bc834[_0xe3f3('0x5e')]['to'][0x0]},client9002);})['then'](function(){if(_0x57b869){if(_[_0xe3f3('0xb1')](_0x5bc834[_0xe3f3('0x5e')][_0xe3f3('0xb2')])){_0x5bc834[_0xe3f3('0x5e')][_0xe3f3('0xb2')]=util[_0xe3f3('0xa5')](_0xe3f3('0xb3'),_0x57b869['name'],_0x57b869[_0xe3f3('0xb4')]);}if(_0x57b869['List']){if(_0x57b869[_0xe3f3('0xa9')][_0xe3f3('0xaa')][_0xe3f3('0x4d')]){return _0x57b869[_0xe3f3('0xa9')][_0xe3f3('0xaa')][0x0];}else{return db[_0xe3f3('0x75')][_0xe3f3('0x5d')](_[_0xe3f3('0xb5')](_0x5bc834['body'],{'firstName':_0x5bc834[_0xe3f3('0x5e')]['to'][0x0],'phone':_0x5bc834[_0xe3f3('0x5e')]['to'][0x0],'fax':_0x5bc834[_0xe3f3('0x5e')]['to'][0x0],'ListId':_0x57b869[_0xe3f3('0xa0')]}));}}else{throw new Error('List\x20not\x20found');}}else{throw new Error(_0xe3f3('0xb6'));}})[_0xe3f3('0x38')](function(_0x44099f){if(_0x44099f){return db[_0xe3f3('0x72')][_0xe3f3('0x65')]({'where':{'ContactId':_0x44099f['id'],'closed':![],'FaxAccountId':_0x57b869['id']}})[_0xe3f3('0x38')](function(_0x553379){if(_0x553379){return[_0x553379,![]];}return db[_0xe3f3('0x72')]['create']({'UserId':_0x5bc834[_0xe3f3('0x5f')]['id'],'ContactId':_0x44099f['id'],'FaxAccountId':_0x57b869['id'],'fax':_0x5bc834[_0xe3f3('0x5e')]['to'][0x0],'firstMsgDirection':'out','Messages':[_[_0xe3f3('0x54')](_0x5bc834['body'],{'read':![],'body':_0x5bc834[_0xe3f3('0x5e')][_0xe3f3('0xac')][0x0][_0xe3f3('0xb7')],'FaxAccountId':_0x57b869['id'],'UserId':_0x5bc834['user']['id'],'ContactId':_0x44099f['id'],'AttachmentId':_0x5bc834[_0xe3f3('0x5e')][_0xe3f3('0xac')][0x0]['id']})]},{'include':[{'model':db['FaxMessage'],'as':_0xe3f3('0xb8')}]})[_0xe3f3('0x38')](function(_0x3bd4f2){return[_0x3bd4f2,!![]];});});}else{throw new Error(_0xe3f3('0xb9'));}})[_0xe3f3('0xba')](function(_0x318e69,_0x5a0462){if(_0x5a0462){return _0x318e69;}return db[_0xe3f3('0xa7')][_0xe3f3('0x5d')]({'direction':_0xe3f3('0xbb'),'read':![],'body':_0x5bc834[_0xe3f3('0x5e')]['attachments'][0x0][_0xe3f3('0xb7')],'FaxAccountId':_0x57b869['id'],'FaxInteractionId':_0x318e69['id'],'UserId':_0x5bc834[_0xe3f3('0x5f')]['id'],'ContactId':_0x318e69[_0xe3f3('0xbc')],'AttachmentId':_0x5bc834[_0xe3f3('0x5e')]['attachments'][0x0]['id']})[_0xe3f3('0x38')](function(_0x1f6484){_0x318e69['dataValues'][_0xe3f3('0xb8')]=[];_0x318e69[_0xe3f3('0xbd')]['Messages'][_0xe3f3('0x8d')](_0x1f6484[_0xe3f3('0xbd')]);return _0x318e69;});})[_0xe3f3('0x38')](function(_0x4ecdff){respondWithRpcPromise(_0xe3f3('0xbe'),'SendFax',{'FaxAccountId':_[_0xe3f3('0xb1')](_0x5bc834[_0xe3f3('0x5b')]['id'])?undefined:_0x5bc834[_0xe3f3('0x5b')]['id'],'path':_[_0xe3f3('0xb1')](_0x5bc834[_0xe3f3('0x5e')]['attachments'][0x0]['path'])?undefined:_0x5bc834[_0xe3f3('0x5e')][_0xe3f3('0xac')][0x0]['path'],'fax':_[_0xe3f3('0xb1')](_0x5bc834[_0xe3f3('0x5e')]['to'][0x0])?undefined:_0x5bc834['body']['to'][0x0],'AttachmentId':_0x5bc834[_0xe3f3('0x5e')][_0xe3f3('0xac')][0x0]['id']},client9002)['then'](function(_0x1c9e72){logger[_0xe3f3('0x25')]('SendFaxRpc,\x20%s',_0x1c9e72);})['catch'](function(_0x1cd6e9){logger[_0xe3f3('0x25')]('SendFaxRpc,\x20%s',_0x1cd6e9);});return _0x4ecdff;})['then'](respondWithResult(_0x443429,null))[_0xe3f3('0x2d')](handleError(_0x443429,null));};exports['addAgents']=function(_0x595e1a,_0xf2febb,_0x372de6){return db[_0xe3f3('0x42')][_0xe3f3('0x65')]({'where':{'id':_0x595e1a['params']['id']}})[_0xe3f3('0x38')](handleEntityNotFound(_0xf2febb,null))['then'](function(_0x67014c){if(_0x67014c){return _0x67014c[_0xe3f3('0xbf')](_0x595e1a[_0xe3f3('0x5e')][_0xe3f3('0x6d')],_['omit'](_0x595e1a['body'],[_0xe3f3('0x6d'),'id'])||{})[_0xe3f3('0xba')](function(_0x2a40f0){for(var _0x477212=0x0;_0x477212<_0x595e1a[_0xe3f3('0x5e')]['ids'][_0xe3f3('0x4d')];_0x477212+=0x1){socket[_0xe3f3('0xc0')]('userFaxAccount:save',{'UserId':_0x595e1a['body'][_0xe3f3('0x6d')][_0x477212],'FaxAccountId':_0x595e1a[_0xe3f3('0x5b')]['id']});}return _0x2a40f0;});}})[_0xe3f3('0x38')](respondWithResult(_0xf2febb,null))[_0xe3f3('0x2d')](handleError(_0xf2febb,null));};exports[_0xe3f3('0xc1')]=function(_0x4a5060,_0x443e2b,_0x53d427){return db[_0xe3f3('0x42')]['find']({'where':{'id':_0x4a5060['params']['id']}})[_0xe3f3('0x38')](handleEntityNotFound(_0x443e2b,null))[_0xe3f3('0x38')](function(_0x1e3b18){if(_0x1e3b18){return _0x1e3b18[_0xe3f3('0xc1')](_0x4a5060['query'][_0xe3f3('0x6d')])[_0xe3f3('0x38')](function(){if(_[_0xe3f3('0xc2')](_0x4a5060[_0xe3f3('0x46')]['ids'])){for(var _0x50cb2e=0x0;_0x50cb2e<_0x4a5060[_0xe3f3('0x46')][_0xe3f3('0x6d')][_0xe3f3('0x4d')];_0x50cb2e+=0x1){socket[_0xe3f3('0xc0')](_0xe3f3('0xc3'),{'UserId':Number(_0x4a5060[_0xe3f3('0x46')][_0xe3f3('0x6d')][_0x50cb2e]),'FaxAccountId':Number(_0x4a5060[_0xe3f3('0x5b')]['id'])});}}else{socket[_0xe3f3('0xc0')](_0xe3f3('0xc3'),{'UserId':Number(_0x4a5060[_0xe3f3('0x46')][_0xe3f3('0x6d')]),'FaxAccountId':Number(_0x4a5060[_0xe3f3('0x5b')]['id'])});}});}})[_0xe3f3('0x38')](respondWithStatusCode(_0x443e2b,null))['catch'](handleError(_0x443e2b,null));};exports[_0xe3f3('0xc4')]=function(_0x588368,_0x1aa900,_0x4d6ad9){var _0x251734={};var _0x5e0952={};var _0x199baa;var _0x12a162;return db[_0xe3f3('0x42')][_0xe3f3('0x69')]({'where':{'id':_0x588368[_0xe3f3('0x5b')]['id']}})[_0xe3f3('0x38')](handleEntityNotFound(_0x1aa900,null))[_0xe3f3('0x38')](function(_0x45078e){if(_0x45078e){_0x199baa=_0x45078e;_0x5e0952[_0xe3f3('0x4a')]=_[_0xe3f3('0x47')](db[_0xe3f3('0x77')][_0xe3f3('0x43')]);_0x5e0952['query']=_['keys'](_0x588368[_0xe3f3('0x46')]);_0x5e0952[_0xe3f3('0x48')]=_[_0xe3f3('0x49')](_0x5e0952[_0xe3f3('0x4a')],_0x5e0952['query']);_0x251734[_0xe3f3('0x4b')]=_[_0xe3f3('0x49')](_0x5e0952[_0xe3f3('0x4a')],qs[_0xe3f3('0x4c')](_0x588368[_0xe3f3('0x46')][_0xe3f3('0x4c')]));_0x251734[_0xe3f3('0x4b')]=_0x251734[_0xe3f3('0x4b')]['length']?_0x251734[_0xe3f3('0x4b')]:_0x5e0952[_0xe3f3('0x4a')];_0x251734['order']=qs['sort'](_0x588368['query'][_0xe3f3('0x50')]);_0x251734[_0xe3f3('0x51')]=qs[_0xe3f3('0x48')](_['pick'](_0x588368[_0xe3f3('0x46')],_0x5e0952[_0xe3f3('0x48')]));if(_0x588368[_0xe3f3('0x46')][_0xe3f3('0x53')]){_0x251734[_0xe3f3('0x51')]=_[_0xe3f3('0x54')](_0x251734[_0xe3f3('0x51')],{'$or':_[_0xe3f3('0x41')](_0x251734[_0xe3f3('0x4b')],function(_0x265287){var _0x298299={};_0x298299[_0x265287]={'$like':'%'+_0x588368['query'][_0xe3f3('0x53')]+'%'};return _0x298299;})});}_0x251734=_[_0xe3f3('0x54')]({},_0x251734,_0x588368[_0xe3f3('0x5c')]);return _0x199baa[_0xe3f3('0xc4')](_0x251734);}})[_0xe3f3('0x38')](function(_0x41ec7d){if(_0x41ec7d){_0x12a162=_0x41ec7d[_0xe3f3('0x4d')];if(!_0x588368[_0xe3f3('0x46')][_0xe3f3('0x4e')](_0xe3f3('0x6b'))){_0x251734[_0xe3f3('0x33')]=qs[_0xe3f3('0x33')](_0x588368[_0xe3f3('0x46')][_0xe3f3('0x33')]);_0x251734[_0xe3f3('0x32')]=qs['offset'](_0x588368[_0xe3f3('0x46')][_0xe3f3('0x32')]);}return _0x199baa['getAgents'](_0x251734);}})[_0xe3f3('0x38')](function(_0x5f359f){if(_0x5f359f){return _0x5f359f?{'count':_0x12a162,'rows':_0x5f359f}:null;}})[_0xe3f3('0x38')](respondWithResult(_0x1aa900,null))[_0xe3f3('0x2d')](handleError(_0x1aa900,null));};
\ No newline at end of file
diff --git a/server/api/faxAccount/faxAccount.events.js b/server/api/faxAccount/faxAccount.events.js
index 83c60c3..2c070db 100644
--- a/server/api/faxAccount/faxAccount.events.js
+++ b/server/api/faxAccount/faxAccount.events.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x3a15=['update','remove','emit','hasOwnProperty','exports','events','../../mysqldb','FaxAccount','setMaxListeners','save'];(function(_0x378857,_0x1e1343){var _0xbdb505=function(_0x2bdb26){while(--_0x2bdb26){_0x378857['push'](_0x378857['shift']());}};_0xbdb505(++_0x1e1343);}(_0x3a15,0x113));var _0x53a1=function(_0x5c6acd,_0x475638){_0x5c6acd=_0x5c6acd-0x0;var _0x20bb67=_0x3a15[_0x5c6acd];return _0x20bb67;};'use strict';var EventEmitter=require(_0x53a1('0x0'));var FaxAccount=require(_0x53a1('0x1'))['db'][_0x53a1('0x2')];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0x53a1('0x3')](0x0);var events={'afterCreate':_0x53a1('0x4'),'afterUpdate':_0x53a1('0x5'),'afterDestroy':_0x53a1('0x6')};function emitEvent(_0x27600b){return function(_0x34f1f7,_0x371e9c,_0x5e8ed4){FaxAccountEvents['emit'](_0x27600b+':'+_0x34f1f7['id'],_0x34f1f7);FaxAccountEvents[_0x53a1('0x7')](_0x27600b,_0x34f1f7);_0x5e8ed4(null);};}for(var e in events){if(events[_0x53a1('0x8')](e)){var event=events[e];FaxAccount['hook'](e,emitEvent(event));}}module[_0x53a1('0x9')]=FaxAccountEvents;
\ No newline at end of file
+var _0xcab6=['update','remove','emit','hasOwnProperty','exports','events','FaxAccount','setMaxListeners','save'];(function(_0x1f23b1,_0x57c83f){var _0x3c9197=function(_0x2f6e4a){while(--_0x2f6e4a){_0x1f23b1['push'](_0x1f23b1['shift']());}};_0x3c9197(++_0x57c83f);}(_0xcab6,0xd4));var _0x6cab=function(_0x58a7a2,_0x52b127){_0x58a7a2=_0x58a7a2-0x0;var _0x4fe6b6=_0xcab6[_0x58a7a2];return _0x4fe6b6;};'use strict';var EventEmitter=require(_0x6cab('0x0'));var FaxAccount=require('../../mysqldb')['db'][_0x6cab('0x1')];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0x6cab('0x2')](0x0);var events={'afterCreate':_0x6cab('0x3'),'afterUpdate':_0x6cab('0x4'),'afterDestroy':_0x6cab('0x5')};function emitEvent(_0x129d57){return function(_0x5ea2d8,_0xa8b534,_0x4c79f1){FaxAccountEvents[_0x6cab('0x6')](_0x129d57+':'+_0x5ea2d8['id'],_0x5ea2d8);FaxAccountEvents[_0x6cab('0x6')](_0x129d57,_0x5ea2d8);_0x4c79f1(null);};}for(var e in events){if(events[_0x6cab('0x7')](e)){var event=events[e];FaxAccount['hook'](e,emitEvent(event));}}module[_0x6cab('0x8')]=FaxAccountEvents;
\ No newline at end of file
diff --git a/server/api/faxAccount/faxAccount.model.js b/server/api/faxAccount/faxAccount.model.js
index 1d4a116..a877734 100644
--- a/server/api/faxAccount/faxAccount.model.js
+++ b/server/api/faxAccount/faxAccount.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xf4ca=['util','../../config/logger','api','moment','bluebird','../../config/environment','./faxAccount.attributes','fax_accounts'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf4ca,0x198));var _0xaf4c=function(_0xa2582b,_0x229036){_0xa2582b=_0xa2582b-0x0;var _0x1c00e9=_0xf4ca[_0xa2582b];return _0x1c00e9;};'use strict';var _=require('lodash');var util=require(_0xaf4c('0x0'));var logger=require(_0xaf4c('0x1'))(_0xaf4c('0x2'));var moment=require(_0xaf4c('0x3'));var BPromise=require(_0xaf4c('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xaf4c('0x5'));var attributes=require(_0xaf4c('0x6'));module['exports']=function(_0x486f7c,_0x356b07){return _0x486f7c['define']('FaxAccount',attributes,{'tableName':_0xaf4c('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x02bd=['FaxAccount','fax_accounts','lodash','../../config/logger','api','bluebird','request-promise','path','../../config/environment','./faxAccount.attributes','define'];(function(_0x566200,_0x126fd1){var _0x189ac0=function(_0x34b0ae){while(--_0x34b0ae){_0x566200['push'](_0x566200['shift']());}};_0x189ac0(++_0x126fd1);}(_0x02bd,0x183));var _0xd02b=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x02bd[_0xfae23b];return _0x200640;};'use strict';var _=require(_0xd02b('0x0'));var util=require('util');var logger=require(_0xd02b('0x1'))(_0xd02b('0x2'));var moment=require('moment');var BPromise=require(_0xd02b('0x3'));var rp=require(_0xd02b('0x4'));var fs=require('fs');var path=require(_0xd02b('0x5'));var rimraf=require('rimraf');var config=require(_0xd02b('0x6'));var attributes=require(_0xd02b('0x7'));module['exports']=function(_0x2cd0f0,_0x376f9e){return _0x2cd0f0[_0xd02b('0x8')](_0xd02b('0x9'),attributes,{'tableName':_0xd02b('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/faxAccount/faxAccount.rpc.js b/server/api/faxAccount/faxAccount.rpc.js
index c1abef6..234e938 100644
--- a/server/api/faxAccount/faxAccount.rpc.js
+++ b/server/api/faxAccount/faxAccount.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xf278=['Contact\x20not\x20found','spread','push','close','*,*,*,*','created','FaxMessage','ContactId','AttachmentId','interaction','UserId','User','name','unshift','agent','waitForTheAssignedAgent','Start','startRouting','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','./faxAccount.socket','register','info','FaxAccount,\x20%s,\x20%s','request\x20sent','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','FaxAccount','findAll','options','raw','where','attributes','map','include','model','then','GetFaxAccount','debug','NotifyFaxAccount','body','fax','describe','Sequelize','ValidationError','difference','keys','createdAt','updatedAt','CompanyId','ListId','isNil','from','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','find','account','List','CmContact','DESC','FaxApplication','Applications','get','applications','priority','asc','length','Contacts','contact','FaxInteraction','create'];(function(_0x212807,_0x16c5cb){var _0x1a6b19=function(_0x2146ca){while(--_0x2146ca){_0x212807['push'](_0x212807['shift']());}};_0x1a6b19(++_0x16c5cb);}(_0xf278,0xc8));var _0x8f27=function(_0x2d398b,_0x5e98f8){_0x2d398b=_0x2d398b-0x0;var _0x5d8b9d=_0xf278[_0x2d398b];return _0x5d8b9d;};'use strict';var _=require(_0x8f27('0x0'));var util=require(_0x8f27('0x1'));var moment=require(_0x8f27('0x2'));var BPromise=require(_0x8f27('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8f27('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x8f27('0x5'));var logger=require(_0x8f27('0x6'))(_0x8f27('0x7'));var config=require(_0x8f27('0x8'));var jayson=require(_0x8f27('0x9'));var client=jayson['client'][_0x8f27('0xa')]({'port':0x232c});config[_0x8f27('0xb')]=_[_0x8f27('0xc')](config['redis'],{'host':_0x8f27('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x8f27('0xe'))[_0x8f27('0xf')](socket);function respondWithRpcPromise(_0x22b449,_0x1b5862,_0x14d0f7){return new BPromise(function(_0x43a06f,_0x1a7f9e){return client['request'](_0x22b449,_0x14d0f7)['then'](function(_0x147147){logger[_0x8f27('0x10')](_0x8f27('0x11'),_0x1b5862,_0x8f27('0x12'));logger['debug'](_0x8f27('0x13'),_0x1b5862,_0x8f27('0x12'),JSON[_0x8f27('0x14')](_0x147147));if(_0x147147[_0x8f27('0x15')]){if(_0x147147[_0x8f27('0x15')][_0x8f27('0x16')]===0x1f4){logger[_0x8f27('0x15')](_0x8f27('0x11'),_0x1b5862,_0x147147[_0x8f27('0x15')][_0x8f27('0x17')]);return _0x1a7f9e(_0x147147['error'][_0x8f27('0x17')]);}logger['error'](_0x8f27('0x11'),_0x1b5862,_0x147147['error'][_0x8f27('0x17')]);return _0x43a06f(_0x147147[_0x8f27('0x15')]['message']);}else{logger['info'](_0x8f27('0x11'),_0x1b5862,_0x8f27('0x12'));_0x43a06f(_0x147147[_0x8f27('0x18')][_0x8f27('0x17')]);}})[_0x8f27('0x19')](function(_0x1cc3ef){logger[_0x8f27('0x15')](_0x8f27('0x11'),_0x1b5862,_0x1cc3ef);_0x1a7f9e(_0x1cc3ef);});});}exports['GetFaxAccount']=function(_0x58d025){var _0x23274b=this;return new Promise(function(_0x1b026a,_0x109419){return db[_0x8f27('0x1a')][_0x8f27('0x1b')]({'raw':_0x58d025[_0x8f27('0x1c')]?_0x58d025[_0x8f27('0x1c')][_0x8f27('0x1d')]===undefined?!![]:![]:!![],'where':_0x58d025[_0x8f27('0x1c')]?_0x58d025[_0x8f27('0x1c')][_0x8f27('0x1e')]||null:null,'attributes':_0x58d025[_0x8f27('0x1c')]?_0x58d025[_0x8f27('0x1c')][_0x8f27('0x1f')]||null:null,'limit':_0x58d025[_0x8f27('0x1c')]?_0x58d025[_0x8f27('0x1c')]['limit']||null:null,'include':_0x58d025[_0x8f27('0x1c')]?_0x58d025[_0x8f27('0x1c')]['include']?_[_0x8f27('0x20')](_0x58d025[_0x8f27('0x1c')][_0x8f27('0x21')],function(_0x58cd54){return{'model':db[_0x58cd54[_0x8f27('0x22')]],'as':_0x58cd54['as'],'attributes':_0x58cd54['attributes'],'include':_0x58cd54[_0x8f27('0x21')]?_[_0x8f27('0x20')](_0x58cd54[_0x8f27('0x21')],function(_0x40f075){return{'model':db[_0x40f075[_0x8f27('0x22')]],'as':_0x40f075['as'],'attributes':_0x40f075[_0x8f27('0x1f')],'include':_0x40f075[_0x8f27('0x21')]?_['map'](_0x40f075[_0x8f27('0x21')],function(_0x1cb005){return{'model':db[_0x1cb005[_0x8f27('0x22')]],'as':_0x1cb005['as'],'attributes':_0x1cb005['attributes']};}):[]};}):[]};}):[]:[]})[_0x8f27('0x23')](function(_0x36f7cc){logger['info'](_0x8f27('0x24'),_0x58d025);logger[_0x8f27('0x25')](_0x8f27('0x24'),_0x58d025,JSON[_0x8f27('0x14')](_0x36f7cc));_0x1b026a(_0x36f7cc);})[_0x8f27('0x19')](function(_0x5ae266){logger[_0x8f27('0x15')](_0x8f27('0x24'),_0x5ae266[_0x8f27('0x17')],_0x58d025);_0x109419(_0x23274b[_0x8f27('0x15')](0x1f4,_0x5ae266[_0x8f27('0x17')]));});});};exports[_0x8f27('0x26')]=function(_0x2081d5,_0x3b32c3,_0x3d1e8b){var _0x2c3a5a=this;return new Promise(function(_0x172ee7,_0x5c30b5){var _0x14dc22={'body':_0x2081d5[_0x8f27('0x27')],'channel':_0x8f27('0x28')};var _0x33d184=[];var _0x14fd60=[];var _0x34f2d3={};return db['CmContact'][_0x8f27('0x29')]()[_0x8f27('0x23')](function(_0x3e4426){if(!_0x3e4426){throw new db[(_0x8f27('0x2a'))][(_0x8f27('0x2b'))]('no\x20available\x20attributes');}_0x33d184=_[_0x8f27('0x2c')](_[_0x8f27('0x2d')](_0x3e4426),[_0x8f27('0x2e'),_0x8f27('0x2f')]);_0x14fd60=_[_0x8f27('0x2c')](_[_0x8f27('0x2d')](_0x3e4426),[_0x8f27('0x2e'),_0x8f27('0x2f'),_0x8f27('0x30'),_0x8f27('0x31')]);if(_0x2081d5[_0x8f27('0x27')]['id']){delete _0x2081d5[_0x8f27('0x27')]['id'];}if(_[_0x8f27('0x32')](_0x2081d5['body'][_0x8f27('0x33')])){throw new db[(_0x8f27('0x2a'))][(_0x8f27('0x2b'))]('from\x20is\x20mandatory');}if(_['isNil'](_0x2081d5[_0x8f27('0x27')]['body'])||_0x2081d5[_0x8f27('0x27')][_0x8f27('0x27')]===''){throw new db[(_0x8f27('0x2a'))]['ValidationError'](_0x8f27('0x34'));}if(_[_0x8f27('0x32')](_0x2081d5['body']['mapKey'])){throw new db[(_0x8f27('0x2a'))][(_0x8f27('0x2b'))](_0x8f27('0x35')+_0x14fd60);}if(!_[_0x8f27('0x36')](_0x14fd60,_0x2081d5[_0x8f27('0x27')][_0x8f27('0x37')])){throw new db[(_0x8f27('0x2a'))][(_0x8f27('0x2b'))](_0x8f27('0x38')+_0x14fd60);}_0x34f2d3[_0x2081d5[_0x8f27('0x27')][_0x8f27('0x37')]]=_0x2081d5[_0x8f27('0x27')][_0x8f27('0x33')];})[_0x8f27('0x23')](function(){return db[_0x8f27('0x1a')][_0x8f27('0x39')]({'where':{'id':_0x2081d5[_0x8f27('0x3a')]['id']},'include':[{'model':db['CmList'],'as':_0x8f27('0x3b'),'include':[{'model':db[_0x8f27('0x3c')],'as':'Contacts','where':_0x34f2d3,'limit':0x1,'order':[[_0x8f27('0x2f'),_0x8f27('0x3d')]]}]},{'model':db[_0x8f27('0x3e')],'as':_0x8f27('0x3f')}]});})[_0x8f27('0x23')](function(_0x321f9c){if(_0x321f9c&&_0x321f9c['List']){var _0x1e2965=_0x321f9c[_0x8f27('0x40')]({'plain':!![]});_0x14dc22['account']=_0x1e2965;_0x14dc22['applications']=_0x1e2965[_0x8f27('0x3f')];_0x14dc22['list']=_0x1e2965[_0x8f27('0x3b')];_0x14dc22[_0x8f27('0x41')]=_['orderBy'](_0x14dc22[_0x8f27('0x41')],[_0x8f27('0x42')],[_0x8f27('0x43')]);if(_0x14dc22['account']['Applications']){delete _0x14dc22[_0x8f27('0x3a')][_0x8f27('0x3f')];}if(_0x14dc22[_0x8f27('0x3a')][_0x8f27('0x3b')]&&_0x14dc22['account'][_0x8f27('0x3b')]['Contacts'][_0x8f27('0x44')]){return _0x14dc22['account']['List'][_0x8f27('0x45')][0x0];}var _0x12a75a=_[_0x8f27('0xc')](_0x2081d5['body'],{'firstName':_0x2081d5[_0x8f27('0x27')]['from'],'ListId':_0x1e2965[_0x8f27('0x31')]});_0x12a75a[_0x2081d5['body'][_0x8f27('0x37')]]=_0x2081d5[_0x8f27('0x27')][_0x8f27('0x33')];return db[_0x8f27('0x3c')]['create'](_0x12a75a,{'fields':_0x33d184,'raw':!![]});}})[_0x8f27('0x23')](function(_0x418afe){_0x14dc22[_0x8f27('0x46')]=_0x418afe;if(_0x418afe){var _0x6c35da={'ContactId':_0x418afe['id'],'FaxAccountId':_0x2081d5['account']['id'],'fax':_0x418afe[_0x8f27('0x28')]};return db[_0x8f27('0x47')]['find']({'where':{'ContactId':_0x418afe['id'],'closed':![],'FaxAccountId':_0x2081d5[_0x8f27('0x3a')]['id']}})[_0x8f27('0x23')](function(_0x2fec04){if(_0x2fec04){return[_0x2fec04,![]];}return db[_0x8f27('0x47')][_0x8f27('0x48')](_0x6c35da)[_0x8f27('0x23')](function(_0xb6ffd7){return[_0xb6ffd7,!![]];});});}else{throw new Error(_0x8f27('0x49'));}})[_0x8f27('0x4a')](function(_0x4d40de,_0x27e75a){var _0x3d0337=_0x4d40de['get']({'plain':!![]});if(_0x27e75a){if(_0x14dc22['account']['autoclose']){_0x14dc22[_0x8f27('0x41')][_0x8f27('0x4b')]({'id':0x0,'priority':_0x14dc22[_0x8f27('0x41')][_0x8f27('0x44')]+0x1,'app':_0x8f27('0x4c'),'appdata':'unmanaged','interval':_0x8f27('0x4d')});}_0x3d0337[_0x8f27('0x4e')]=!![];}else{_0x3d0337['created']=![];}_0x14dc22['interaction']=_0x3d0337;return db[_0x8f27('0x4f')][_0x8f27('0x48')]({'body':_0x2081d5[_0x8f27('0x27')]['body'],'FaxAccountId':_0x2081d5['account']['id'],'FaxInteractionId':_0x4d40de['id'],'direction':'in','ContactId':_0x4d40de[_0x8f27('0x50')],'AttachmentId':_0x2081d5['body'][_0x8f27('0x51')]});})['then'](function(_0x33b273){_0x14dc22[_0x8f27('0x17')]=_0x33b273;if(_0x14dc22[_0x8f27('0x52')][_0x8f27('0x53')]){return db[_0x8f27('0x54')][_0x8f27('0x39')]({'attributes':['id',_0x8f27('0x55')],'where':{'id':_0x14dc22['interaction'][_0x8f27('0x53')]}})[_0x8f27('0x23')](function(_0x5e5092){if(_0x5e5092){_0x14dc22[_0x8f27('0x41')][_0x8f27('0x56')]({'id':0x0,'priority':0x0,'app':_0x8f27('0x57'),'appdata':_0x5e5092[_0x8f27('0x55')]+','+(_0x14dc22[_0x8f27('0x3a')][_0x8f27('0x58')]||0xa),'interval':_0x8f27('0x4d')});}return respondWithRpcPromise(_0x8f27('0x59'),_0x8f27('0x5a'),_0x14dc22);});}return respondWithRpcPromise('Start',_0x8f27('0x5a'),_0x14dc22);})[_0x8f27('0x23')](function(_0x312d5d){_0x172ee7(_0x312d5d);})['catch'](function(_0x19ddfc){_0x5c30b5(_0x2c3a5a[_0x8f27('0x15')](0x1f4,_0x19ddfc[_0x8f27('0x17')]));});});};
\ No newline at end of file
+var _0x5482=['raw','where','attributes','limit','include','map','model','debug','stringify','NotifyFaxAccount','body','fax','CmContact','Sequelize','keys','updatedAt','createdAt','CompanyId','isNil','from','ValidationError','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','account','CmList','Contacts','DESC','FaxApplication','List','get','Applications','list','applications','orderBy','priority','asc','defaults','create','contact','FaxInteraction','find','Contact\x20not\x20found','spread','length','close','unmanaged','*,*,*,*','created','FaxMessage','ContactId','AttachmentId','interaction','UserId','User','unshift','agent','name','waitForTheAssignedAgent','Start','startRouting','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','jayson/promise','client','http','redis','localhost','socket.io-emitter','request','then','info','request\x20sent','FaxAccount,\x20%s,\x20%s,\x20%s','error','code','FaxAccount,\x20%s,\x20%s','message','result','catch','GetFaxAccount','FaxAccount','findAll','options'];(function(_0x7ce717,_0x53da6c){var _0x2b09c6=function(_0x5e733c){while(--_0x5e733c){_0x7ce717['push'](_0x7ce717['shift']());}};_0x2b09c6(++_0x53da6c);}(_0x5482,0xf8));var _0x2548=function(_0x56a1d0,_0x16a437){_0x56a1d0=_0x56a1d0-0x0;var _0x5952c4=_0x5482[_0x56a1d0];return _0x5952c4;};'use strict';var _=require(_0x2548('0x0'));var util=require(_0x2548('0x1'));var moment=require(_0x2548('0x2'));var BPromise=require(_0x2548('0x3'));var rs=require(_0x2548('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2548('0x5'))['db'];var utils=require(_0x2548('0x6'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x2548('0x7'));var client=jayson[_0x2548('0x8')][_0x2548('0x9')]({'port':0x232c});config[_0x2548('0xa')]=_['defaults'](config[_0x2548('0xa')],{'host':_0x2548('0xb'),'port':0x18eb});var socket=require(_0x2548('0xc'))(new Redis(config[_0x2548('0xa')]));require('./faxAccount.socket')['register'](socket);function respondWithRpcPromise(_0x2077b7,_0x4afdd5,_0x586076){return new BPromise(function(_0x168649,_0x2cc147){return client[_0x2548('0xd')](_0x2077b7,_0x586076)[_0x2548('0xe')](function(_0x157500){logger[_0x2548('0xf')]('FaxAccount,\x20%s,\x20%s',_0x4afdd5,_0x2548('0x10'));logger['debug'](_0x2548('0x11'),_0x4afdd5,_0x2548('0x10'),JSON['stringify'](_0x157500));if(_0x157500['error']){if(_0x157500[_0x2548('0x12')][_0x2548('0x13')]===0x1f4){logger[_0x2548('0x12')](_0x2548('0x14'),_0x4afdd5,_0x157500[_0x2548('0x12')][_0x2548('0x15')]);return _0x2cc147(_0x157500[_0x2548('0x12')]['message']);}logger[_0x2548('0x12')](_0x2548('0x14'),_0x4afdd5,_0x157500['error'][_0x2548('0x15')]);return _0x168649(_0x157500['error']['message']);}else{logger[_0x2548('0xf')](_0x2548('0x14'),_0x4afdd5,_0x2548('0x10'));_0x168649(_0x157500[_0x2548('0x16')][_0x2548('0x15')]);}})[_0x2548('0x17')](function(_0xc7ca0d){logger[_0x2548('0x12')]('FaxAccount,\x20%s,\x20%s',_0x4afdd5,_0xc7ca0d);_0x2cc147(_0xc7ca0d);});});}exports[_0x2548('0x18')]=function(_0x31c815){var _0x46b458=this;return new Promise(function(_0x4729f0,_0x439251){return db[_0x2548('0x19')][_0x2548('0x1a')]({'raw':_0x31c815[_0x2548('0x1b')]?_0x31c815[_0x2548('0x1b')][_0x2548('0x1c')]===undefined?!![]:![]:!![],'where':_0x31c815[_0x2548('0x1b')]?_0x31c815[_0x2548('0x1b')][_0x2548('0x1d')]||null:null,'attributes':_0x31c815['options']?_0x31c815[_0x2548('0x1b')][_0x2548('0x1e')]||null:null,'limit':_0x31c815[_0x2548('0x1b')]?_0x31c815[_0x2548('0x1b')][_0x2548('0x1f')]||null:null,'include':_0x31c815['options']?_0x31c815['options'][_0x2548('0x20')]?_[_0x2548('0x21')](_0x31c815[_0x2548('0x1b')]['include'],function(_0x4fa0d0){return{'model':db[_0x4fa0d0[_0x2548('0x22')]],'as':_0x4fa0d0['as'],'attributes':_0x4fa0d0['attributes'],'include':_0x4fa0d0[_0x2548('0x20')]?_[_0x2548('0x21')](_0x4fa0d0[_0x2548('0x20')],function(_0x4f9af7){return{'model':db[_0x4f9af7[_0x2548('0x22')]],'as':_0x4f9af7['as'],'attributes':_0x4f9af7[_0x2548('0x1e')],'include':_0x4f9af7[_0x2548('0x20')]?_[_0x2548('0x21')](_0x4f9af7[_0x2548('0x20')],function(_0x5c1dc5){return{'model':db[_0x5c1dc5[_0x2548('0x22')]],'as':_0x5c1dc5['as'],'attributes':_0x5c1dc5[_0x2548('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x2548('0xe')](function(_0x3b80b1){logger[_0x2548('0xf')]('GetFaxAccount',_0x31c815);logger[_0x2548('0x23')](_0x2548('0x18'),_0x31c815,JSON[_0x2548('0x24')](_0x3b80b1));_0x4729f0(_0x3b80b1);})[_0x2548('0x17')](function(_0x5524a7){logger[_0x2548('0x12')]('GetFaxAccount',_0x5524a7[_0x2548('0x15')],_0x31c815);_0x439251(_0x46b458[_0x2548('0x12')](0x1f4,_0x5524a7[_0x2548('0x15')]));});});};exports[_0x2548('0x25')]=function(_0x895db3,_0x340ef7,_0x2f2cfb){var _0x4f1931=this;return new Promise(function(_0x2060f2,_0x42d37a){var _0x1cf709={'body':_0x895db3[_0x2548('0x26')],'channel':_0x2548('0x27')};var _0x5c6af6=[];var _0x58f80b=[];var _0x44accf={};return db[_0x2548('0x28')]['describe']()[_0x2548('0xe')](function(_0x283f86){if(!_0x283f86){throw new db[(_0x2548('0x29'))]['ValidationError']('no\x20available\x20attributes');}_0x5c6af6=_['difference'](_[_0x2548('0x2a')](_0x283f86),['createdAt',_0x2548('0x2b')]);_0x58f80b=_['difference'](_[_0x2548('0x2a')](_0x283f86),[_0x2548('0x2c'),_0x2548('0x2b'),_0x2548('0x2d'),'ListId']);if(_0x895db3[_0x2548('0x26')]['id']){delete _0x895db3['body']['id'];}if(_[_0x2548('0x2e')](_0x895db3['body'][_0x2548('0x2f')])){throw new db['Sequelize'][(_0x2548('0x30'))](_0x2548('0x31'));}if(_[_0x2548('0x2e')](_0x895db3[_0x2548('0x26')]['body'])||_0x895db3[_0x2548('0x26')][_0x2548('0x26')]===''){throw new db['Sequelize'][(_0x2548('0x30'))](_0x2548('0x32'));}if(_[_0x2548('0x2e')](_0x895db3[_0x2548('0x26')]['mapKey'])){throw new db[(_0x2548('0x29'))][(_0x2548('0x30'))](_0x2548('0x33')+_0x58f80b);}if(!_[_0x2548('0x34')](_0x58f80b,_0x895db3[_0x2548('0x26')][_0x2548('0x35')])){throw new db[(_0x2548('0x29'))]['ValidationError'](_0x2548('0x36')+_0x58f80b);}_0x44accf[_0x895db3[_0x2548('0x26')][_0x2548('0x35')]]=_0x895db3[_0x2548('0x26')]['from'];})[_0x2548('0xe')](function(){return db[_0x2548('0x19')]['find']({'where':{'id':_0x895db3[_0x2548('0x37')]['id']},'include':[{'model':db[_0x2548('0x38')],'as':'List','include':[{'model':db[_0x2548('0x28')],'as':_0x2548('0x39'),'where':_0x44accf,'limit':0x1,'order':[[_0x2548('0x2b'),_0x2548('0x3a')]]}]},{'model':db[_0x2548('0x3b')],'as':'Applications'}]});})[_0x2548('0xe')](function(_0x476ae8){if(_0x476ae8&&_0x476ae8[_0x2548('0x3c')]){var _0xe2312b=_0x476ae8[_0x2548('0x3d')]({'plain':!![]});_0x1cf709[_0x2548('0x37')]=_0xe2312b;_0x1cf709['applications']=_0xe2312b[_0x2548('0x3e')];_0x1cf709[_0x2548('0x3f')]=_0xe2312b['List'];_0x1cf709[_0x2548('0x40')]=_[_0x2548('0x41')](_0x1cf709[_0x2548('0x40')],[_0x2548('0x42')],[_0x2548('0x43')]);if(_0x1cf709['account'][_0x2548('0x3e')]){delete _0x1cf709['account']['Applications'];}if(_0x1cf709[_0x2548('0x37')][_0x2548('0x3c')]&&_0x1cf709[_0x2548('0x37')][_0x2548('0x3c')][_0x2548('0x39')]['length']){return _0x1cf709[_0x2548('0x37')]['List'][_0x2548('0x39')][0x0];}var _0x4a8dfb=_[_0x2548('0x44')](_0x895db3[_0x2548('0x26')],{'firstName':_0x895db3['body'][_0x2548('0x2f')],'ListId':_0xe2312b['ListId']});_0x4a8dfb[_0x895db3[_0x2548('0x26')][_0x2548('0x35')]]=_0x895db3['body']['from'];return db[_0x2548('0x28')][_0x2548('0x45')](_0x4a8dfb,{'fields':_0x5c6af6,'raw':!![]});}})[_0x2548('0xe')](function(_0x102625){_0x1cf709[_0x2548('0x46')]=_0x102625;if(_0x102625){var _0x664d40={'ContactId':_0x102625['id'],'FaxAccountId':_0x895db3['account']['id'],'fax':_0x102625[_0x2548('0x27')]};return db[_0x2548('0x47')][_0x2548('0x48')]({'where':{'ContactId':_0x102625['id'],'closed':![],'FaxAccountId':_0x895db3['account']['id']}})[_0x2548('0xe')](function(_0x3d35f1){if(_0x3d35f1){return[_0x3d35f1,![]];}return db['FaxInteraction'][_0x2548('0x45')](_0x664d40)['then'](function(_0x35eb61){return[_0x35eb61,!![]];});});}else{throw new Error(_0x2548('0x49'));}})[_0x2548('0x4a')](function(_0x4bd47b,_0x5f55d3){var _0x11028e=_0x4bd47b[_0x2548('0x3d')]({'plain':!![]});if(_0x5f55d3){if(_0x1cf709[_0x2548('0x37')]['autoclose']){_0x1cf709[_0x2548('0x40')]['push']({'id':0x0,'priority':_0x1cf709[_0x2548('0x40')][_0x2548('0x4b')]+0x1,'app':_0x2548('0x4c'),'appdata':_0x2548('0x4d'),'interval':_0x2548('0x4e')});}_0x11028e[_0x2548('0x4f')]=!![];}else{_0x11028e[_0x2548('0x4f')]=![];}_0x1cf709['interaction']=_0x11028e;return db[_0x2548('0x50')][_0x2548('0x45')]({'body':_0x895db3[_0x2548('0x26')]['body'],'FaxAccountId':_0x895db3[_0x2548('0x37')]['id'],'FaxInteractionId':_0x4bd47b['id'],'direction':'in','ContactId':_0x4bd47b[_0x2548('0x51')],'AttachmentId':_0x895db3[_0x2548('0x26')][_0x2548('0x52')]});})[_0x2548('0xe')](function(_0x4b508b){_0x1cf709[_0x2548('0x15')]=_0x4b508b;if(_0x1cf709[_0x2548('0x53')][_0x2548('0x54')]){return db[_0x2548('0x55')]['find']({'attributes':['id','name'],'where':{'id':_0x1cf709[_0x2548('0x53')]['UserId']}})[_0x2548('0xe')](function(_0x489443){if(_0x489443){_0x1cf709['applications'][_0x2548('0x56')]({'id':0x0,'priority':0x0,'app':_0x2548('0x57'),'appdata':_0x489443[_0x2548('0x58')]+','+(_0x1cf709['account'][_0x2548('0x59')]||0xa),'interval':'*,*,*,*'});}return respondWithRpcPromise(_0x2548('0x5a'),_0x2548('0x5b'),_0x1cf709);});}return respondWithRpcPromise(_0x2548('0x5a'),_0x2548('0x5b'),_0x1cf709);})[_0x2548('0xe')](function(_0x1ea9fe){_0x2060f2(_0x1ea9fe);})[_0x2548('0x17')](function(_0x449a24){_0x42d37a(_0x4f1931[_0x2548('0x12')](0x1f4,_0x449a24['message']));});});};
\ No newline at end of file
diff --git a/server/api/faxAccount/faxAccount.socket.js b/server/api/faxAccount/faxAccount.socket.js
index 7e002f8..69e2d38 100644
--- a/server/api/faxAccount/faxAccount.socket.js
+++ b/server/api/faxAccount/faxAccount.socket.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xda2d=['remove','update','removeListener','register','length','faxAccount:','save'];(function(_0x24d799,_0x2367f2){var _0x2c409c=function(_0x5d85fd){while(--_0x5d85fd){_0x24d799['push'](_0x24d799['shift']());}};_0x2c409c(++_0x2367f2);}(_0xda2d,0x102));var _0xdda2=function(_0x284795,_0x148f39){_0x284795=_0x284795-0x0;var _0x3addb1=_0xda2d[_0x284795];return _0x3addb1;};'use strict';var FaxAccountEvents=require('./faxAccount.events');var events=[_0xdda2('0x0'),_0xdda2('0x1'),_0xdda2('0x2')];function createListener(_0x1f1fcc,_0x329c5e){return function(_0x58973d){_0x329c5e['emit'](_0x1f1fcc,_0x58973d);};}function removeListener(_0x5a5f9f,_0x357e97){return function(){FaxAccountEvents[_0xdda2('0x3')](_0x5a5f9f,_0x357e97);};}exports[_0xdda2('0x4')]=function(_0x39f6c9){for(var _0xc256bc=0x0,_0xf38e58=events[_0xdda2('0x5')];_0xc256bc<_0xf38e58;_0xc256bc++){var _0x436676=events[_0xc256bc];var _0x2e2523=createListener(_0xdda2('0x6')+_0x436676,_0x39f6c9);FaxAccountEvents['on'](_0x436676,_0x2e2523);}};
\ No newline at end of file
+var _0xd117=['save','remove','update','emit','removeListener','register','length','faxAccount:','./faxAccount.events'];(function(_0x2ed550,_0x4a9a50){var _0x3d63cf=function(_0x386c6d){while(--_0x386c6d){_0x2ed550['push'](_0x2ed550['shift']());}};_0x3d63cf(++_0x4a9a50);}(_0xd117,0x182));var _0x7d11=function(_0x544072,_0xc41ee1){_0x544072=_0x544072-0x0;var _0x590bf6=_0xd117[_0x544072];return _0x590bf6;};'use strict';var FaxAccountEvents=require(_0x7d11('0x0'));var events=[_0x7d11('0x1'),_0x7d11('0x2'),_0x7d11('0x3')];function createListener(_0x454387,_0x26e0f0){return function(_0x306ae4){_0x26e0f0[_0x7d11('0x4')](_0x454387,_0x306ae4);};}function removeListener(_0x3c07be,_0x31fcb0){return function(){FaxAccountEvents[_0x7d11('0x5')](_0x3c07be,_0x31fcb0);};}exports[_0x7d11('0x6')]=function(_0x27d7e8){for(var _0x40c3c4=0x0,_0x345602=events[_0x7d11('0x7')];_0x40c3c4<_0x345602;_0x40c3c4++){var _0x47b5e6=events[_0x40c3c4];var _0x3803b5=createListener(_0x7d11('0x8')+_0x47b5e6,_0x27d7e8);FaxAccountEvents['on'](_0x47b5e6,_0x3803b5);}};
\ No newline at end of file
diff --git a/server/api/faxAccount/index.js b/server/api/faxAccount/index.js
index b3741cb..e84ad4a 100644
--- a/server/api/faxAccount/index.js
+++ b/server/api/faxAccount/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x31ec=['/:id','update','delete','removeDispositions','removeAnswers','exports','multer','util','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxAccount.controller','get','isAuthenticated','/describe','describe','show','/:id/dispositions','/:id/canned_answers','getAnswers','/:id/interactions','/:id/applications','getMessages','getAgents','post','create','addDisposition','addAnswer','addInteraction','addApplications','/addaccountapplications','addAccountApplications','/updateaccountapplications','/:id/send','send','/:id/users','addAgents'];(function(_0x56e911,_0x4e0aa2){var _0x455636=function(_0x2a7ef7){while(--_0x2a7ef7){_0x56e911['push'](_0x56e911['shift']());}};_0x455636(++_0x4e0aa2);}(_0x31ec,0x1a8));var _0xc31e=function(_0x3d3992,_0x510557){_0x3d3992=_0x3d3992-0x0;var _0x4b1d71=_0x31ec[_0x3d3992];return _0x4b1d71;};'use strict';var multer=require(_0xc31e('0x0'));var util=require(_0xc31e('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xc31e('0x2'));var router=express['Router']();var auth=require(_0xc31e('0x3'));var interaction=require(_0xc31e('0x4'));var config=require(_0xc31e('0x5'));var controller=require(_0xc31e('0x6'));router[_0xc31e('0x7')]('/',auth[_0xc31e('0x8')](),controller['index']);router[_0xc31e('0x7')](_0xc31e('0x9'),auth[_0xc31e('0x8')](),controller[_0xc31e('0xa')]);router['get']('/:id',auth[_0xc31e('0x8')](),controller[_0xc31e('0xb')]);router['get'](_0xc31e('0xc'),auth[_0xc31e('0x8')](),controller['getDispositions']);router[_0xc31e('0x7')](_0xc31e('0xd'),auth[_0xc31e('0x8')](),controller[_0xc31e('0xe')]);router['get'](_0xc31e('0xf'),auth[_0xc31e('0x8')](),controller['getInteractions']);router[_0xc31e('0x7')](_0xc31e('0x10'),auth['isAuthenticated'](),controller['getApplications']);router[_0xc31e('0x7')]('/:id/messages',auth[_0xc31e('0x8')](),controller[_0xc31e('0x11')]);router[_0xc31e('0x7')]('/:id/users',auth[_0xc31e('0x8')](),controller[_0xc31e('0x12')]);router[_0xc31e('0x13')]('/',auth[_0xc31e('0x8')](),controller[_0xc31e('0x14')]);router[_0xc31e('0x13')](_0xc31e('0xc'),auth[_0xc31e('0x8')](),controller[_0xc31e('0x15')]);router['post'](_0xc31e('0xd'),auth[_0xc31e('0x8')](),controller[_0xc31e('0x16')]);router[_0xc31e('0x13')](_0xc31e('0xf'),auth[_0xc31e('0x8')](),controller[_0xc31e('0x17')]);router[_0xc31e('0x13')](_0xc31e('0x10'),auth['isAuthenticated'](),controller[_0xc31e('0x18')]);router[_0xc31e('0x13')](_0xc31e('0x19'),auth[_0xc31e('0x8')](),controller[_0xc31e('0x1a')]);router[_0xc31e('0x13')](_0xc31e('0x1b'),auth[_0xc31e('0x8')](),controller['updateAccountApplications']);router['post'](_0xc31e('0x1c'),auth[_0xc31e('0x8')](),controller[_0xc31e('0x1d')]);router[_0xc31e('0x13')](_0xc31e('0x1e'),auth[_0xc31e('0x8')](),controller[_0xc31e('0x1f')]);router['put'](_0xc31e('0x20'),auth[_0xc31e('0x8')](),controller[_0xc31e('0x21')]);router[_0xc31e('0x22')](_0xc31e('0x20'),auth[_0xc31e('0x8')](),controller['destroy']);router['delete']('/:id/dispositions',auth[_0xc31e('0x8')](),controller[_0xc31e('0x23')]);router['delete'](_0xc31e('0xd'),auth[_0xc31e('0x8')](),controller[_0xc31e('0x24')]);router['delete'](_0xc31e('0x1e'),auth['isAuthenticated'](),controller['removeAgents']);module[_0xc31e('0x25')]=router;
\ No newline at end of file
+var _0xd4d8=['show','/:id/dispositions','getDispositions','getAnswers','/:id/applications','getApplications','/:id/messages','/:id/users','getAgents','post','addDisposition','/:id/canned_answers','addAnswer','addInteraction','addApplications','addAccountApplications','/updateaccountapplications','updateAccountApplications','/:id/send','addAgents','update','delete','destroy','removeDispositions','removeAnswers','removeAgents','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe','/:id'];(function(_0x33d967,_0x625b){var _0x1168ab=function(_0x1369f0){while(--_0x1369f0){_0x33d967['push'](_0x33d967['shift']());}};_0x1168ab(++_0x625b);}(_0xd4d8,0xbb));var _0x8d4d=function(_0x52f159,_0x419d8a){_0x52f159=_0x52f159-0x0;var _0x156799=_0xd4d8[_0x52f159];return _0x156799;};'use strict';var multer=require(_0x8d4d('0x0'));var util=require(_0x8d4d('0x1'));var path=require(_0x8d4d('0x2'));var timeout=require(_0x8d4d('0x3'));var express=require(_0x8d4d('0x4'));var router=express[_0x8d4d('0x5')]();var auth=require(_0x8d4d('0x6'));var interaction=require(_0x8d4d('0x7'));var config=require(_0x8d4d('0x8'));var controller=require('./faxAccount.controller');router[_0x8d4d('0x9')]('/',auth[_0x8d4d('0xa')](),controller['index']);router[_0x8d4d('0x9')](_0x8d4d('0xb'),auth['isAuthenticated'](),controller['describe']);router[_0x8d4d('0x9')](_0x8d4d('0xc'),auth[_0x8d4d('0xa')](),controller[_0x8d4d('0xd')]);router['get'](_0x8d4d('0xe'),auth[_0x8d4d('0xa')](),controller[_0x8d4d('0xf')]);router['get']('/:id/canned_answers',auth['isAuthenticated'](),controller[_0x8d4d('0x10')]);router['get']('/:id/interactions',auth[_0x8d4d('0xa')](),controller['getInteractions']);router[_0x8d4d('0x9')](_0x8d4d('0x11'),auth[_0x8d4d('0xa')](),controller[_0x8d4d('0x12')]);router[_0x8d4d('0x9')](_0x8d4d('0x13'),auth[_0x8d4d('0xa')](),controller['getMessages']);router['get'](_0x8d4d('0x14'),auth[_0x8d4d('0xa')](),controller[_0x8d4d('0x15')]);router[_0x8d4d('0x16')]('/',auth['isAuthenticated'](),controller['create']);router['post'](_0x8d4d('0xe'),auth['isAuthenticated'](),controller[_0x8d4d('0x17')]);router[_0x8d4d('0x16')](_0x8d4d('0x18'),auth[_0x8d4d('0xa')](),controller[_0x8d4d('0x19')]);router[_0x8d4d('0x16')]('/:id/interactions',auth['isAuthenticated'](),controller[_0x8d4d('0x1a')]);router['post']('/:id/applications',auth[_0x8d4d('0xa')](),controller[_0x8d4d('0x1b')]);router[_0x8d4d('0x16')]('/addaccountapplications',auth[_0x8d4d('0xa')](),controller[_0x8d4d('0x1c')]);router[_0x8d4d('0x16')](_0x8d4d('0x1d'),auth[_0x8d4d('0xa')](),controller[_0x8d4d('0x1e')]);router[_0x8d4d('0x16')](_0x8d4d('0x1f'),auth['isAuthenticated'](),controller['send']);router[_0x8d4d('0x16')]('/:id/users',auth['isAuthenticated'](),controller[_0x8d4d('0x20')]);router['put']('/:id',auth[_0x8d4d('0xa')](),controller[_0x8d4d('0x21')]);router[_0x8d4d('0x22')]('/:id',auth['isAuthenticated'](),controller[_0x8d4d('0x23')]);router[_0x8d4d('0x22')]('/:id/dispositions',auth['isAuthenticated'](),controller[_0x8d4d('0x24')]);router[_0x8d4d('0x22')]('/:id/canned_answers',auth[_0x8d4d('0xa')](),controller[_0x8d4d('0x25')]);router[_0x8d4d('0x22')]('/:id/users',auth['isAuthenticated'](),controller[_0x8d4d('0x26')]);module[_0x8d4d('0x27')]=router;
\ No newline at end of file
diff --git a/server/api/faxApplication/faxApplication.attributes.js b/server/api/faxApplication/faxApplication.attributes.js
index 9fe15da..0bcc999 100644
--- a/server/api/faxApplication/faxApplication.attributes.js
+++ b/server/api/faxApplication/faxApplication.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7c16=['noop','*,*,*,*','exports','STRING'];(function(_0x2c692e,_0x45c5f0){var _0x36ba57=function(_0x3f8106){while(--_0x3f8106){_0x2c692e['push'](_0x2c692e['shift']());}};_0x36ba57(++_0x45c5f0);}(_0x7c16,0x1c6));var _0x67c1=function(_0x384a65,_0x4a54b1){_0x384a65=_0x384a65-0x0;var _0x158090=_0x7c16[_0x384a65];return _0x158090;};'use strict';var Sequelize=require('sequelize');module[_0x67c1('0x0')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x67c1('0x1')],'allowNull':![],'defaultValue':_0x67c1('0x2')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0x67c1('0x1')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0x67c1('0x3')}};
\ No newline at end of file
+var _0x3dcc=['*,*,*,*','sequelize','TEXT','STRING'];(function(_0x54153d,_0x59d077){var _0x1ea5d2=function(_0x49d838){while(--_0x49d838){_0x54153d['push'](_0x54153d['shift']());}};_0x1ea5d2(++_0x59d077);}(_0x3dcc,0xf5));var _0xc3dc=function(_0x86b219,_0x43038f){_0x86b219=_0x86b219-0x0;var _0x1f320c=_0x3dcc[_0x86b219];return _0x1f320c;};'use strict';var Sequelize=require(_0xc3dc('0x0'));module['exports']={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0xc3dc('0x1')]()},'description':{'type':Sequelize[_0xc3dc('0x2')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0xc3dc('0x3')}};
\ No newline at end of file
diff --git a/server/api/faxApplication/faxApplication.controller.js b/server/api/faxApplication/faxApplication.controller.js
index 7bb99bf..f4f6301 100644
--- a/server/api/faxApplication/faxApplication.controller.js
+++ b/server/api/faxApplication/faxApplication.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7fbe=['map','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','VIRTUAL','FaxApplication','includeAll','findAll','rows','show','params','include','options','catch','create','body','destroy','find','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','Content-Range','save','update','then','error','name','send','index'];(function(_0x1a0daa,_0x2a4634){var _0x1dbe15=function(_0xa8ab22){while(--_0xa8ab22){_0x1a0daa['push'](_0x1a0daa['shift']());}};_0x1dbe15(++_0x2a4634);}(_0x7fbe,0x1ec));var _0xe7fb=function(_0x51ed62,_0x574379){_0x51ed62=_0x51ed62-0x0;var _0x34aee3=_0x7fbe[_0x51ed62];return _0x34aee3;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0xe7fb('0x0'));var zipdir=require(_0xe7fb('0x1'));var jsonpatch=require(_0xe7fb('0x2'));var rp=require(_0xe7fb('0x3'));var moment=require(_0xe7fb('0x4'));var BPromise=require(_0xe7fb('0x5'));var Mustache=require(_0xe7fb('0x6'));var util=require(_0xe7fb('0x7'));var path=require(_0xe7fb('0x8'));var sox=require(_0xe7fb('0x9'));var csv=require(_0xe7fb('0xa'));var ejs=require(_0xe7fb('0xb'));var fs=require('fs');var _=require(_0xe7fb('0xc'));var squel=require(_0xe7fb('0xd'));var crypto=require('crypto');var jsforce=require(_0xe7fb('0xe'));var deskjs=require(_0xe7fb('0xf'));var toCsv=require(_0xe7fb('0xa'));var querystring=require(_0xe7fb('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xe7fb('0x11'));var qs=require(_0xe7fb('0x12'));var as=require(_0xe7fb('0x13'));var hardwareService=require(_0xe7fb('0x14'));var logger=require(_0xe7fb('0x15'))(_0xe7fb('0x16'));var utils=require(_0xe7fb('0x17'));var config=require(_0xe7fb('0x18'));var db=require(_0xe7fb('0x19'))['db'];function respondWithStatusCode(_0x2fe8ab,_0x2437d4){_0x2437d4=_0x2437d4||0xcc;return function(_0x188e1d){if(_0x188e1d){return _0x2fe8ab[_0xe7fb('0x1a')](_0x2437d4);}return _0x2fe8ab[_0xe7fb('0x1b')](_0x2437d4)[_0xe7fb('0x1c')]();};}function respondWithResult(_0x598729,_0x278b75){_0x278b75=_0x278b75||0xc8;return function(_0x2225e5){if(_0x2225e5){return _0x598729['status'](_0x278b75)[_0xe7fb('0x1d')](_0x2225e5);}};}function respondWithFilteredResult(_0x37eb9f,_0x482f7d){return function(_0xa76acf){if(_0xa76acf){var _0x559129=_0xa76acf[_0xe7fb('0x1e')],_0x12fff6=_0x482f7d['offset'],_0x18d23c=_0x482f7d[_0xe7fb('0x1f')]+_0x482f7d['limit'],_0x12603d;if(_0x18d23c>=_0x559129){_0x18d23c=_0x559129;_0x12603d=0xc8;}else{_0x12603d=0xce;}_0x37eb9f[_0xe7fb('0x1b')](_0x12603d);return _0x37eb9f['set'](_0xe7fb('0x20'),_0x12fff6+'-'+_0x18d23c+'/'+_0x559129)[_0xe7fb('0x1d')](_0xa76acf);}return null;};}function patchUpdates(_0x3f96a7){return function(_0x182269){try{jsonpatch['apply'](_0x182269,_0x3f96a7,!![]);}catch(_0x44466e){return BPromise['reject'](_0x44466e);}return _0x182269[_0xe7fb('0x21')]();};}function saveUpdates(_0x51f01f,_0x15f7a4){return function(_0x4ea664){if(_0x4ea664){return _0x4ea664[_0xe7fb('0x22')](_0x51f01f)[_0xe7fb('0x23')](function(_0x4a9994){return _0x4a9994;});}return null;};}function removeEntity(_0x143eb6,_0x4742bd){return function(_0x3ae8f1){if(_0x3ae8f1){return _0x3ae8f1['destroy']()[_0xe7fb('0x23')](function(){_0x143eb6[_0xe7fb('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5bea27,_0x52f08b){return function(_0x35e4db){if(!_0x35e4db){_0x5bea27['sendStatus'](0x194);}return _0x35e4db;};}function handleError(_0x49b219,_0x4026b1){_0x4026b1=_0x4026b1||0x1f4;return function(_0x32e8b2){logger[_0xe7fb('0x24')](_0x32e8b2['stack']);if(_0x32e8b2[_0xe7fb('0x25')]){delete _0x32e8b2[_0xe7fb('0x25')];}_0x49b219[_0xe7fb('0x1b')](_0x4026b1)[_0xe7fb('0x26')](_0x32e8b2);};}exports[_0xe7fb('0x27')]=function(_0x16237a,_0x380130){var _0x59e015={},_0x5df9f2={},_0x1086e6={'count':0x0,'rows':[]};var _0x3bdee9=_[_0xe7fb('0x28')](db['FaxApplication'][_0xe7fb('0x29')],function(_0x251807){return{'name':_0x251807[_0xe7fb('0x2a')],'type':_0x251807[_0xe7fb('0x2b')][_0xe7fb('0x2c')]};});_0x5df9f2[_0xe7fb('0x2d')]=_[_0xe7fb('0x28')](_0x3bdee9,_0xe7fb('0x25'));_0x5df9f2['query']=_[_0xe7fb('0x2e')](_0x16237a[_0xe7fb('0x2f')]);_0x5df9f2[_0xe7fb('0x30')]=_['intersection'](_0x5df9f2['model'],_0x5df9f2[_0xe7fb('0x2f')]);_0x59e015['attributes']=_[_0xe7fb('0x31')](_0x5df9f2[_0xe7fb('0x2d')],qs[_0xe7fb('0x32')](_0x16237a[_0xe7fb('0x2f')]['fields']));_0x59e015[_0xe7fb('0x33')]=_0x59e015[_0xe7fb('0x33')][_0xe7fb('0x34')]?_0x59e015[_0xe7fb('0x33')]:_0x5df9f2[_0xe7fb('0x2d')];if(!_0x16237a['query'][_0xe7fb('0x35')](_0xe7fb('0x36'))){_0x59e015[_0xe7fb('0x37')]=qs[_0xe7fb('0x37')](_0x16237a[_0xe7fb('0x2f')][_0xe7fb('0x37')]);_0x59e015[_0xe7fb('0x1f')]=qs[_0xe7fb('0x1f')](_0x16237a[_0xe7fb('0x2f')]['offset']);}_0x59e015[_0xe7fb('0x38')]=qs[_0xe7fb('0x39')](_0x16237a[_0xe7fb('0x2f')]['sort']);_0x59e015[_0xe7fb('0x3a')]=qs[_0xe7fb('0x30')](_[_0xe7fb('0x3b')](_0x16237a[_0xe7fb('0x2f')],_0x5df9f2[_0xe7fb('0x30')]),_0x3bdee9);if(_0x16237a[_0xe7fb('0x2f')][_0xe7fb('0x3c')]){_0x59e015[_0xe7fb('0x3a')]=_[_0xe7fb('0x3d')](_0x59e015[_0xe7fb('0x3a')],{'$or':_[_0xe7fb('0x28')](_0x3bdee9,function(_0x3c4f4b){if(_0x3c4f4b[_0xe7fb('0x2b')]!==_0xe7fb('0x3e')){var _0xeb7c29={};_0xeb7c29[_0x3c4f4b[_0xe7fb('0x25')]]={'$like':'%'+_0x16237a[_0xe7fb('0x2f')][_0xe7fb('0x3c')]+'%'};return _0xeb7c29;}})});}_0x59e015=_[_0xe7fb('0x3d')]({},_0x59e015,_0x16237a['options']);var _0x261ec5={'where':_0x59e015[_0xe7fb('0x3a')]};return db[_0xe7fb('0x3f')][_0xe7fb('0x1e')](_0x261ec5)['then'](function(_0x3426a9){_0x1086e6[_0xe7fb('0x1e')]=_0x3426a9;if(_0x16237a[_0xe7fb('0x2f')][_0xe7fb('0x40')]){_0x59e015['include']=[{'all':!![]}];}return db[_0xe7fb('0x3f')][_0xe7fb('0x41')](_0x59e015);})[_0xe7fb('0x23')](function(_0x62a8a1){_0x1086e6[_0xe7fb('0x42')]=_0x62a8a1;return _0x1086e6;})[_0xe7fb('0x23')](respondWithFilteredResult(_0x380130,_0x59e015))['catch'](handleError(_0x380130,null));};exports[_0xe7fb('0x43')]=function(_0x35139f,_0x3a96cd){var _0x4b263d={'raw':!![],'where':{'id':_0x35139f[_0xe7fb('0x44')]['id']}},_0x36a341={};_0x36a341['model']=_['keys'](db['FaxApplication']['rawAttributes']);_0x36a341['query']=_[_0xe7fb('0x2e')](_0x35139f[_0xe7fb('0x2f')]);_0x36a341[_0xe7fb('0x30')]=_['intersection'](_0x36a341[_0xe7fb('0x2d')],_0x36a341['query']);_0x4b263d[_0xe7fb('0x33')]=_[_0xe7fb('0x31')](_0x36a341['model'],qs[_0xe7fb('0x32')](_0x35139f[_0xe7fb('0x2f')][_0xe7fb('0x32')]));_0x4b263d[_0xe7fb('0x33')]=_0x4b263d['attributes'][_0xe7fb('0x34')]?_0x4b263d[_0xe7fb('0x33')]:_0x36a341[_0xe7fb('0x2d')];if(_0x35139f['query'][_0xe7fb('0x40')]){_0x4b263d[_0xe7fb('0x45')]=[{'all':!![]}];}_0x4b263d=_[_0xe7fb('0x3d')]({},_0x4b263d,_0x35139f[_0xe7fb('0x46')]);return db[_0xe7fb('0x3f')]['find'](_0x4b263d)[_0xe7fb('0x23')](handleEntityNotFound(_0x3a96cd,null))['then'](respondWithResult(_0x3a96cd,null))[_0xe7fb('0x47')](handleError(_0x3a96cd,null));};exports[_0xe7fb('0x48')]=function(_0x3520e3,_0x1ecbfd){return db[_0xe7fb('0x3f')]['create'](_0x3520e3[_0xe7fb('0x49')],{})['then'](respondWithResult(_0x1ecbfd,0xc9))['catch'](handleError(_0x1ecbfd,null));};exports[_0xe7fb('0x22')]=function(_0x3d740f,_0x16327f){if(_0x3d740f['body']['id']){delete _0x3d740f[_0xe7fb('0x49')]['id'];}return db[_0xe7fb('0x3f')]['find']({'where':{'id':_0x3d740f['params']['id']}})[_0xe7fb('0x23')](handleEntityNotFound(_0x16327f,null))[_0xe7fb('0x23')](saveUpdates(_0x3d740f[_0xe7fb('0x49')],null))[_0xe7fb('0x23')](respondWithResult(_0x16327f,null))[_0xe7fb('0x47')](handleError(_0x16327f,null));};exports[_0xe7fb('0x4a')]=function(_0x18a590,_0x347177){return db['FaxApplication'][_0xe7fb('0x4b')]({'where':{'id':_0x18a590['params']['id']}})[_0xe7fb('0x23')](handleEntityNotFound(_0x347177,null))[_0xe7fb('0x23')](removeEntity(_0x347177,null))['catch'](handleError(_0x347177,null));};
\ No newline at end of file
+var _0x814b=['destroy','then','error','stack','name','send','index','map','rawAttributes','fieldName','key','model','keys','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','sort','filters','pick','filter','where','merge','VIRTUAL','include','findAll','rows','catch','show','FaxApplication','options','find','create','body','params','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','save','update'];(function(_0x2e2bd1,_0x3717c2){var _0x51da1e=function(_0x1be9d4){while(--_0x1be9d4){_0x2e2bd1['push'](_0x2e2bd1['shift']());}};_0x51da1e(++_0x3717c2);}(_0x814b,0x1a2));var _0xb814=function(_0x1ae491,_0x5b83b9){_0x1ae491=_0x1ae491-0x0;var _0x4958a5=_0x814b[_0x1ae491];return _0x4958a5;};'use strict';var pdf=require(_0xb814('0x0'));var emlformat=require(_0xb814('0x1'));var rimraf=require(_0xb814('0x2'));var zipdir=require(_0xb814('0x3'));var jsonpatch=require(_0xb814('0x4'));var rp=require(_0xb814('0x5'));var moment=require('moment');var BPromise=require(_0xb814('0x6'));var Mustache=require(_0xb814('0x7'));var util=require(_0xb814('0x8'));var path=require(_0xb814('0x9'));var sox=require(_0xb814('0xa'));var csv=require(_0xb814('0xb'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xb814('0xc'));var squel=require(_0xb814('0xd'));var crypto=require('crypto');var jsforce=require(_0xb814('0xe'));var deskjs=require(_0xb814('0xf'));var toCsv=require(_0xb814('0xb'));var querystring=require(_0xb814('0x10'));var Papa=require(_0xb814('0x11'));var Redis=require(_0xb814('0x12'));var authService=require(_0xb814('0x13'));var qs=require(_0xb814('0x14'));var as=require(_0xb814('0x15'));var hardwareService=require(_0xb814('0x16'));var logger=require(_0xb814('0x17'))('api');var utils=require(_0xb814('0x18'));var config=require('../../config/environment');var db=require(_0xb814('0x19'))['db'];function respondWithStatusCode(_0x15d6ef,_0x35b10d){_0x35b10d=_0x35b10d||0xcc;return function(_0x2cc46b){if(_0x2cc46b){return _0x15d6ef[_0xb814('0x1a')](_0x35b10d);}return _0x15d6ef[_0xb814('0x1b')](_0x35b10d)[_0xb814('0x1c')]();};}function respondWithResult(_0x41ed7b,_0xa0a2e5){_0xa0a2e5=_0xa0a2e5||0xc8;return function(_0x2ab627){if(_0x2ab627){return _0x41ed7b[_0xb814('0x1b')](_0xa0a2e5)[_0xb814('0x1d')](_0x2ab627);}};}function respondWithFilteredResult(_0x17f5bd,_0x39bfcf){return function(_0x303aca){if(_0x303aca){var _0x3a71d6=_0x303aca[_0xb814('0x1e')],_0x45e0d0=_0x39bfcf[_0xb814('0x1f')],_0x265a83=_0x39bfcf['offset']+_0x39bfcf[_0xb814('0x20')],_0x125ce2;if(_0x265a83>=_0x3a71d6){_0x265a83=_0x3a71d6;_0x125ce2=0xc8;}else{_0x125ce2=0xce;}_0x17f5bd['status'](_0x125ce2);return _0x17f5bd[_0xb814('0x21')](_0xb814('0x22'),_0x45e0d0+'-'+_0x265a83+'/'+_0x3a71d6)['json'](_0x303aca);}return null;};}function patchUpdates(_0x4b55a7){return function(_0x55d63c){try{jsonpatch[_0xb814('0x23')](_0x55d63c,_0x4b55a7,!![]);}catch(_0x4d5276){return BPromise['reject'](_0x4d5276);}return _0x55d63c[_0xb814('0x24')]();};}function saveUpdates(_0x24211d,_0x25b6b6){return function(_0x4e139e){if(_0x4e139e){return _0x4e139e[_0xb814('0x25')](_0x24211d)['then'](function(_0x1e6393){return _0x1e6393;});}return null;};}function removeEntity(_0x1808a3,_0x3b267e){return function(_0x470e81){if(_0x470e81){return _0x470e81[_0xb814('0x26')]()[_0xb814('0x27')](function(){_0x1808a3[_0xb814('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2ead86,_0x52b7a3){return function(_0x3f81d0){if(!_0x3f81d0){_0x2ead86[_0xb814('0x1a')](0x194);}return _0x3f81d0;};}function handleError(_0x31c7ec,_0x208927){_0x208927=_0x208927||0x1f4;return function(_0x1c8a2e){logger[_0xb814('0x28')](_0x1c8a2e[_0xb814('0x29')]);if(_0x1c8a2e['name']){delete _0x1c8a2e[_0xb814('0x2a')];}_0x31c7ec[_0xb814('0x1b')](_0x208927)[_0xb814('0x2b')](_0x1c8a2e);};}exports[_0xb814('0x2c')]=function(_0x32ed56,_0x1d5965){var _0x3f0150={},_0x1e4e89={},_0x5a6291={'count':0x0,'rows':[]};var _0x271aa8=_[_0xb814('0x2d')](db['FaxApplication'][_0xb814('0x2e')],function(_0x37d24d){return{'name':_0x37d24d[_0xb814('0x2f')],'type':_0x37d24d['type'][_0xb814('0x30')]};});_0x1e4e89[_0xb814('0x31')]=_['map'](_0x271aa8,_0xb814('0x2a'));_0x1e4e89['query']=_[_0xb814('0x32')](_0x32ed56['query']);_0x1e4e89['filters']=_[_0xb814('0x33')](_0x1e4e89['model'],_0x1e4e89[_0xb814('0x34')]);_0x3f0150[_0xb814('0x35')]=_[_0xb814('0x33')](_0x1e4e89['model'],qs['fields'](_0x32ed56[_0xb814('0x34')][_0xb814('0x36')]));_0x3f0150['attributes']=_0x3f0150[_0xb814('0x35')][_0xb814('0x37')]?_0x3f0150[_0xb814('0x35')]:_0x1e4e89[_0xb814('0x31')];if(!_0x32ed56[_0xb814('0x34')][_0xb814('0x38')](_0xb814('0x39'))){_0x3f0150['limit']=qs[_0xb814('0x20')](_0x32ed56[_0xb814('0x34')][_0xb814('0x20')]);_0x3f0150[_0xb814('0x1f')]=qs[_0xb814('0x1f')](_0x32ed56['query'][_0xb814('0x1f')]);}_0x3f0150['order']=qs[_0xb814('0x3a')](_0x32ed56[_0xb814('0x34')][_0xb814('0x3a')]);_0x3f0150['where']=qs[_0xb814('0x3b')](_[_0xb814('0x3c')](_0x32ed56['query'],_0x1e4e89[_0xb814('0x3b')]),_0x271aa8);if(_0x32ed56[_0xb814('0x34')][_0xb814('0x3d')]){_0x3f0150[_0xb814('0x3e')]=_[_0xb814('0x3f')](_0x3f0150[_0xb814('0x3e')],{'$or':_['map'](_0x271aa8,function(_0xa6ce87){if(_0xa6ce87['type']!==_0xb814('0x40')){var _0x4b5583={};_0x4b5583[_0xa6ce87[_0xb814('0x2a')]]={'$like':'%'+_0x32ed56['query'][_0xb814('0x3d')]+'%'};return _0x4b5583;}})});}_0x3f0150=_[_0xb814('0x3f')]({},_0x3f0150,_0x32ed56['options']);var _0x4d308a={'where':_0x3f0150['where']};return db['FaxApplication'][_0xb814('0x1e')](_0x4d308a)[_0xb814('0x27')](function(_0x38cdc2){_0x5a6291[_0xb814('0x1e')]=_0x38cdc2;if(_0x32ed56['query']['includeAll']){_0x3f0150[_0xb814('0x41')]=[{'all':!![]}];}return db['FaxApplication'][_0xb814('0x42')](_0x3f0150);})[_0xb814('0x27')](function(_0x178823){_0x5a6291[_0xb814('0x43')]=_0x178823;return _0x5a6291;})[_0xb814('0x27')](respondWithFilteredResult(_0x1d5965,_0x3f0150))[_0xb814('0x44')](handleError(_0x1d5965,null));};exports[_0xb814('0x45')]=function(_0x28b2b4,_0x31989d){var _0x4b6ff8={'raw':!![],'where':{'id':_0x28b2b4['params']['id']}},_0x544d36={};_0x544d36[_0xb814('0x31')]=_['keys'](db[_0xb814('0x46')]['rawAttributes']);_0x544d36[_0xb814('0x34')]=_[_0xb814('0x32')](_0x28b2b4[_0xb814('0x34')]);_0x544d36[_0xb814('0x3b')]=_['intersection'](_0x544d36[_0xb814('0x31')],_0x544d36[_0xb814('0x34')]);_0x4b6ff8[_0xb814('0x35')]=_[_0xb814('0x33')](_0x544d36[_0xb814('0x31')],qs[_0xb814('0x36')](_0x28b2b4['query'][_0xb814('0x36')]));_0x4b6ff8[_0xb814('0x35')]=_0x4b6ff8[_0xb814('0x35')][_0xb814('0x37')]?_0x4b6ff8[_0xb814('0x35')]:_0x544d36[_0xb814('0x31')];if(_0x28b2b4[_0xb814('0x34')]['includeAll']){_0x4b6ff8['include']=[{'all':!![]}];}_0x4b6ff8=_[_0xb814('0x3f')]({},_0x4b6ff8,_0x28b2b4[_0xb814('0x47')]);return db[_0xb814('0x46')][_0xb814('0x48')](_0x4b6ff8)[_0xb814('0x27')](handleEntityNotFound(_0x31989d,null))[_0xb814('0x27')](respondWithResult(_0x31989d,null))[_0xb814('0x44')](handleError(_0x31989d,null));};exports[_0xb814('0x49')]=function(_0x2eb9b6,_0x344198){return db[_0xb814('0x46')]['create'](_0x2eb9b6[_0xb814('0x4a')],{})[_0xb814('0x27')](respondWithResult(_0x344198,0xc9))['catch'](handleError(_0x344198,null));};exports[_0xb814('0x25')]=function(_0x55234d,_0x2fb0f7){if(_0x55234d[_0xb814('0x4a')]['id']){delete _0x55234d[_0xb814('0x4a')]['id'];}return db[_0xb814('0x46')][_0xb814('0x48')]({'where':{'id':_0x55234d[_0xb814('0x4b')]['id']}})[_0xb814('0x27')](handleEntityNotFound(_0x2fb0f7,null))[_0xb814('0x27')](saveUpdates(_0x55234d[_0xb814('0x4a')],null))[_0xb814('0x27')](respondWithResult(_0x2fb0f7,null))['catch'](handleError(_0x2fb0f7,null));};exports['destroy']=function(_0x32eca6,_0x30f07b){return db[_0xb814('0x46')][_0xb814('0x48')]({'where':{'id':_0x32eca6[_0xb814('0x4b')]['id']}})[_0xb814('0x27')](handleEntityNotFound(_0x30f07b,null))[_0xb814('0x27')](removeEntity(_0x30f07b,null))['catch'](handleError(_0x30f07b,null));};
\ No newline at end of file
diff --git a/server/api/faxApplication/faxApplication.model.js b/server/api/faxApplication/faxApplication.model.js
index 2e4202f..5d203c6 100644
--- a/server/api/faxApplication/faxApplication.model.js
+++ b/server/api/faxApplication/faxApplication.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x8094=['rimraf','../../config/environment','./faxApplication.attributes','exports','define','FaxApplication','fax_applications','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','bluebird','request-promise','path'];(function(_0x4e9978,_0x1a1c06){var _0xb4b14f=function(_0x2b482c){while(--_0x2b482c){_0x4e9978['push'](_0x4e9978['shift']());}};_0xb4b14f(++_0x1a1c06);}(_0x8094,0x1bb));var _0x4809=function(_0x304b67,_0x31cb39){_0x304b67=_0x304b67-0x0;var _0x493afb=_0x8094[_0x304b67];return _0x493afb;};'use strict';var _=require(_0x4809('0x0'));var util=require(_0x4809('0x1'));var logger=require(_0x4809('0x2'))('api');var moment=require(_0x4809('0x3'));var BPromise=require(_0x4809('0x4'));var rp=require(_0x4809('0x5'));var fs=require('fs');var path=require(_0x4809('0x6'));var rimraf=require(_0x4809('0x7'));var config=require(_0x4809('0x8'));var attributes=require(_0x4809('0x9'));module[_0x4809('0xa')]=function(_0x1cfec1,_0x3b29df){return _0x1cfec1[_0x4809('0xb')](_0x4809('0xc'),attributes,{'tableName':_0x4809('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x4809('0xe')});};
\ No newline at end of file
+var _0x571d=['utf8mb4','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./faxApplication.attributes','exports','define','FaxApplication'];(function(_0x337d6f,_0x5d47aa){var _0x1b2f88=function(_0x34a084){while(--_0x34a084){_0x337d6f['push'](_0x337d6f['shift']());}};_0x1b2f88(++_0x5d47aa);}(_0x571d,0x1eb));var _0xd571=function(_0x3987d0,_0x39166d){_0x3987d0=_0x3987d0-0x0;var _0x284b44=_0x571d[_0x3987d0];return _0x284b44;};'use strict';var _=require(_0xd571('0x0'));var util=require(_0xd571('0x1'));var logger=require(_0xd571('0x2'))('api');var moment=require(_0xd571('0x3'));var BPromise=require(_0xd571('0x4'));var rp=require(_0xd571('0x5'));var fs=require('fs');var path=require(_0xd571('0x6'));var rimraf=require(_0xd571('0x7'));var config=require(_0xd571('0x8'));var attributes=require(_0xd571('0x9'));module[_0xd571('0xa')]=function(_0x4c98cc,_0x3b9a31){return _0x4c98cc[_0xd571('0xb')](_0xd571('0xc'),attributes,{'tableName':'fax_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xd571('0xd'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
diff --git a/server/api/faxApplication/faxApplication.rpc.js b/server/api/faxApplication/faxApplication.rpc.js
index 66dc80f..77a2f9e 100644
--- a/server/api/faxApplication/faxApplication.rpc.js
+++ b/server/api/faxApplication/faxApplication.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x2421=['bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','request','then','info','FaxApplication,\x20%s,\x20%s','request\x20sent','debug','FaxApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','UpdateFaxApplication','FaxApplication','update','body','options','raw','where','attributes','limit','lodash','util','moment'];(function(_0x120799,_0x1eeb07){var _0x53494d=function(_0x38673f){while(--_0x38673f){_0x120799['push'](_0x120799['shift']());}};_0x53494d(++_0x1eeb07);}(_0x2421,0x17d));var _0x1242=function(_0x4981d8,_0x4796f8){_0x4981d8=_0x4981d8-0x0;var _0x4e2060=_0x2421[_0x4981d8];return _0x4e2060;};'use strict';var _=require(_0x1242('0x0'));var util=require(_0x1242('0x1'));var moment=require(_0x1242('0x2'));var BPromise=require(_0x1242('0x3'));var rs=require(_0x1242('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1242('0x5'))['db'];var utils=require(_0x1242('0x6'));var logger=require(_0x1242('0x7'))(_0x1242('0x8'));var config=require(_0x1242('0x9'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2e5fc8,_0x1ac60f,_0x15fee9){return new BPromise(function(_0x2087e9,_0xba53eb){return client[_0x1242('0xa')](_0x2e5fc8,_0x15fee9)[_0x1242('0xb')](function(_0x442bbd){logger[_0x1242('0xc')](_0x1242('0xd'),_0x1ac60f,_0x1242('0xe'));logger[_0x1242('0xf')](_0x1242('0x10'),_0x1ac60f,'request\x20sent',JSON[_0x1242('0x11')](_0x442bbd));if(_0x442bbd[_0x1242('0x12')]){if(_0x442bbd[_0x1242('0x12')][_0x1242('0x13')]===0x1f4){logger[_0x1242('0x12')]('FaxApplication,\x20%s,\x20%s',_0x1ac60f,_0x442bbd[_0x1242('0x12')]['message']);return _0xba53eb(_0x442bbd[_0x1242('0x12')][_0x1242('0x14')]);}logger[_0x1242('0x12')](_0x1242('0xd'),_0x1ac60f,_0x442bbd['error'][_0x1242('0x14')]);return _0x2087e9(_0x442bbd[_0x1242('0x12')]['message']);}else{logger[_0x1242('0xc')](_0x1242('0xd'),_0x1ac60f,_0x1242('0xe'));_0x2087e9(_0x442bbd[_0x1242('0x15')]['message']);}})[_0x1242('0x16')](function(_0xce20e4){logger[_0x1242('0x12')](_0x1242('0xd'),_0x1ac60f,_0xce20e4);_0xba53eb(_0xce20e4);});});}exports[_0x1242('0x17')]=function(_0x5e6eef){var _0x33b663=this;return new Promise(function(_0x366783,_0x5ed5bd){return db[_0x1242('0x18')][_0x1242('0x19')](_0x5e6eef[_0x1242('0x1a')],{'raw':_0x5e6eef[_0x1242('0x1b')]?_0x5e6eef[_0x1242('0x1b')][_0x1242('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5e6eef[_0x1242('0x1b')]?_0x5e6eef['options'][_0x1242('0x1d')]||null:null,'attributes':_0x5e6eef['options']?_0x5e6eef[_0x1242('0x1b')][_0x1242('0x1e')]||null:null,'limit':_0x5e6eef[_0x1242('0x1b')]?_0x5e6eef[_0x1242('0x1b')][_0x1242('0x1f')]||null:null})[_0x1242('0xb')](function(_0xe76a1e){logger['info'](_0x1242('0x17'),_0x5e6eef);logger['debug'](_0x1242('0x17'),_0x5e6eef,JSON['stringify'](_0xe76a1e));_0x366783(_0xe76a1e);})[_0x1242('0x16')](function(_0x246d0d){logger[_0x1242('0x12')](_0x1242('0x17'),_0x246d0d['message'],_0x5e6eef);_0x5ed5bd(_0x33b663['error'](0x1f4,_0x246d0d[_0x1242('0x14')]));});});};
\ No newline at end of file
+var _0x1855=['../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','request','then','info','FaxApplication,\x20%s,\x20%s','request\x20sent','FaxApplication,\x20%s,\x20%s,\x20%s','error','message','result','catch','UpdateFaxApplication','FaxApplication','update','body','options','where','attributes','limit','debug','stringify','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x34e85e,_0x5b8ca2){var _0x3e5347=function(_0x34a58d){while(--_0x34a58d){_0x34e85e['push'](_0x34e85e['shift']());}};_0x3e5347(++_0x5b8ca2);}(_0x1855,0x19a));var _0x5185=function(_0x491a7f,_0x28bb80){_0x491a7f=_0x491a7f-0x0;var _0x3d8f44=_0x1855[_0x491a7f];return _0x3d8f44;};'use strict';var _=require(_0x5185('0x0'));var util=require(_0x5185('0x1'));var moment=require(_0x5185('0x2'));var BPromise=require(_0x5185('0x3'));var rs=require(_0x5185('0x4'));var fs=require('fs');var Redis=require(_0x5185('0x5'));var db=require(_0x5185('0x6'))['db'];var utils=require(_0x5185('0x7'));var logger=require('../../config/logger')(_0x5185('0x8'));var config=require('../../config/environment');var jayson=require(_0x5185('0x9'));var client=jayson[_0x5185('0xa')][_0x5185('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x243e9e,_0x13e2f0,_0x3a8b46){return new BPromise(function(_0x408d63,_0x16e0eb){return client[_0x5185('0xc')](_0x243e9e,_0x3a8b46)[_0x5185('0xd')](function(_0x11feb2){logger[_0x5185('0xe')](_0x5185('0xf'),_0x13e2f0,_0x5185('0x10'));logger['debug'](_0x5185('0x11'),_0x13e2f0,_0x5185('0x10'),JSON['stringify'](_0x11feb2));if(_0x11feb2[_0x5185('0x12')]){if(_0x11feb2[_0x5185('0x12')]['code']===0x1f4){logger[_0x5185('0x12')]('FaxApplication,\x20%s,\x20%s',_0x13e2f0,_0x11feb2[_0x5185('0x12')][_0x5185('0x13')]);return _0x16e0eb(_0x11feb2[_0x5185('0x12')]['message']);}logger[_0x5185('0x12')]('FaxApplication,\x20%s,\x20%s',_0x13e2f0,_0x11feb2[_0x5185('0x12')][_0x5185('0x13')]);return _0x408d63(_0x11feb2[_0x5185('0x12')][_0x5185('0x13')]);}else{logger[_0x5185('0xe')]('FaxApplication,\x20%s,\x20%s',_0x13e2f0,_0x5185('0x10'));_0x408d63(_0x11feb2[_0x5185('0x14')][_0x5185('0x13')]);}})[_0x5185('0x15')](function(_0x1c034c){logger[_0x5185('0x12')]('FaxApplication,\x20%s,\x20%s',_0x13e2f0,_0x1c034c);_0x16e0eb(_0x1c034c);});});}exports[_0x5185('0x16')]=function(_0xc4ae31){var _0x818255=this;return new Promise(function(_0x187f8a,_0x265f3c){return db[_0x5185('0x17')][_0x5185('0x18')](_0xc4ae31[_0x5185('0x19')],{'raw':_0xc4ae31[_0x5185('0x1a')]?_0xc4ae31[_0x5185('0x1a')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xc4ae31[_0x5185('0x1a')]?_0xc4ae31[_0x5185('0x1a')][_0x5185('0x1b')]||null:null,'attributes':_0xc4ae31[_0x5185('0x1a')]?_0xc4ae31['options'][_0x5185('0x1c')]||null:null,'limit':_0xc4ae31[_0x5185('0x1a')]?_0xc4ae31[_0x5185('0x1a')][_0x5185('0x1d')]||null:null})['then'](function(_0x56b726){logger[_0x5185('0xe')](_0x5185('0x16'),_0xc4ae31);logger[_0x5185('0x1e')](_0x5185('0x16'),_0xc4ae31,JSON[_0x5185('0x1f')](_0x56b726));_0x187f8a(_0x56b726);})[_0x5185('0x15')](function(_0x59f339){logger[_0x5185('0x12')]('UpdateFaxApplication',_0x59f339[_0x5185('0x13')],_0xc4ae31);_0x265f3c(_0x818255[_0x5185('0x12')](0x1f4,_0x59f339[_0x5185('0x13')]));});});};
\ No newline at end of file
diff --git a/server/api/faxApplication/index.js b/server/api/faxApplication/index.js
index df88a25..ffc4839 100644
--- a/server/api/faxApplication/index.js
+++ b/server/api/faxApplication/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7da7=['util','path','Router','../../components/auth/service','../../config/environment','./faxApplication.controller','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports','multer'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x7da7,0x10d));var _0x77da=function(_0x296923,_0x4adaed){_0x296923=_0x296923-0x0;var _0x29af70=_0x7da7[_0x296923];return _0x29af70;};'use strict';var multer=require(_0x77da('0x0'));var util=require(_0x77da('0x1'));var path=require(_0x77da('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x77da('0x3')]();var auth=require(_0x77da('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x77da('0x5'));var controller=require(_0x77da('0x6'));router['get']('/',auth[_0x77da('0x7')](),controller[_0x77da('0x8')]);router['get'](_0x77da('0x9'),auth['isAuthenticated'](),controller[_0x77da('0xa')]);router[_0x77da('0xb')]('/',auth[_0x77da('0x7')](),controller[_0x77da('0xc')]);router[_0x77da('0xd')]('/:id',auth[_0x77da('0x7')](),controller[_0x77da('0xe')]);router[_0x77da('0xf')]('/:id',auth[_0x77da('0x7')](),controller[_0x77da('0x10')]);module[_0x77da('0x11')]=router;
\ No newline at end of file
+var _0x207c=['./faxApplication.controller','get','/:id','isAuthenticated','post','create','update','delete','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x4dbe44,_0x3b786e){var _0x4eaa3b=function(_0x5e234a){while(--_0x5e234a){_0x4dbe44['push'](_0x4dbe44['shift']());}};_0x4eaa3b(++_0x3b786e);}(_0x207c,0x1e8));var _0xc207=function(_0x1b33ec,_0x4c5bb3){_0x1b33ec=_0x1b33ec-0x0;var _0x36c0a4=_0x207c[_0x1b33ec];return _0x36c0a4;};'use strict';var multer=require('multer');var util=require(_0xc207('0x0'));var path=require(_0xc207('0x1'));var timeout=require(_0xc207('0x2'));var express=require(_0xc207('0x3'));var router=express[_0xc207('0x4')]();var auth=require(_0xc207('0x5'));var interaction=require(_0xc207('0x6'));var config=require('../../config/environment');var controller=require(_0xc207('0x7'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0xc207('0x8')](_0xc207('0x9'),auth[_0xc207('0xa')](),controller['show']);router[_0xc207('0xb')]('/',auth[_0xc207('0xa')](),controller[_0xc207('0xc')]);router['put'](_0xc207('0x9'),auth[_0xc207('0xa')](),controller[_0xc207('0xd')]);router[_0xc207('0xe')](_0xc207('0x9'),auth[_0xc207('0xa')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/faxInteraction/faxInteraction.attributes.js b/server/api/faxInteraction/faxInteraction.attributes.js
index 9e446b0..a7650ee 100644
--- a/server/api/faxInteraction/faxInteraction.attributes.js
+++ b/server/api/faxInteraction/faxInteraction.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x1bee=['STRING','DATE','ENUM','out','BOOLEAN'];(function(_0x466f2e,_0x5e2a7f){var _0x22dfbb=function(_0x308bbf){while(--_0x308bbf){_0x466f2e['push'](_0x466f2e['shift']());}};_0x22dfbb(++_0x5e2a7f);}(_0x1bee,0x1bc));var _0xe1be=function(_0xe31502,_0x24688d){_0xe31502=_0xe31502-0x0;var _0x171c63=_0x1bee[_0xe31502];return _0x171c63;};'use strict';var Sequelize=require('sequelize');module['exports']={'closed':{'type':Sequelize[_0xe1be('0x0')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0xe1be('0x1')]},'note':{'type':Sequelize[_0xe1be('0x1')]},'read1stAt':{'type':Sequelize[_0xe1be('0x2')]},'fax':{'type':Sequelize[_0xe1be('0x1')]},'firstMsgDirection':{'type':Sequelize[_0xe1be('0x3')]('in',_0xe1be('0x4')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xe1be('0x2')]},'lastMsgDirection':{'type':Sequelize[_0xe1be('0x3')]('in',_0xe1be('0x4')),'defaultValue':'in','allowNull':![]}};
\ No newline at end of file
+var _0xbb1d=['STRING','ENUM','sequelize','exports','BOOLEAN','DATE'];(function(_0x4128bb,_0x4f9c32){var _0x293df0=function(_0x22b29b){while(--_0x22b29b){_0x4128bb['push'](_0x4128bb['shift']());}};_0x293df0(++_0x4f9c32);}(_0xbb1d,0x18e));var _0xdbb1=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xbb1d[_0x501510];return _0x1e6ee5;};'use strict';var Sequelize=require(_0xdbb1('0x0'));module[_0xdbb1('0x1')]={'closed':{'type':Sequelize[_0xdbb1('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xdbb1('0x3')]},'disposition':{'type':Sequelize[_0xdbb1('0x4')]},'note':{'type':Sequelize[_0xdbb1('0x4')]},'read1stAt':{'type':Sequelize[_0xdbb1('0x3')]},'fax':{'type':Sequelize[_0xdbb1('0x4')]},'firstMsgDirection':{'type':Sequelize[_0xdbb1('0x5')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xdbb1('0x3')]},'lastMsgDirection':{'type':Sequelize[_0xdbb1('0x5')]('in','out'),'defaultValue':'in','allowNull':![]}};
\ No newline at end of file
diff --git a/server/api/faxInteraction/faxInteraction.controller.js b/server/api/faxInteraction/faxInteraction.controller.js
index 0fb3a02..70e1d85 100644
--- a/server/api/faxInteraction/faxInteraction.controller.js
+++ b/server/api/faxInteraction/faxInteraction.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x2e21=['register','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','then','destroy','sendStatus','error','stack','name','send','Users','fullname','TagIds','Tags','split','forEach','push','catch','index','map','FaxInteraction','rawAttributes','fieldName','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','field','color','select','u.id','u.fullname','ui.FaxInteractionId','from','user_has_fax_interactions','left_join','users','fax_interactions','cm_contacts','o.id\x20=\x20i.UserId','fax_accounts','a.id\x20=\x20i.FaxAccountId','me.FaxInteractionId\x20=\x20i.id','fax_interaction_has_tags','it.FaxInteractionId\x20=\x20i.id','tools_tags','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','find','unreadMessages','having','`\x20=\x200','`\x20>\x200','operator','value','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','ContactId','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','$substring','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','buildExpression','body','type','text','some','FaxAccountId','concat','createdAt','parse','$gte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','\x27\x27\x27\x27','isNumeric','i.id\x20LIKE\x20?','i.fax\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','Sequelize','QueryTypes','SELECT','i.id','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','DESC','isEmpty','t.id\x20IN\x20?','resolve','i.FaxAccountId\x20IS\x20NOT\x20NULL','user','i.FaxAccountId\x20IS\x20NULL','i.FaxAccountId\x20IN\x20?','sequelize','a.key','a.mandatoryDisposition','Account.mandatoryDisposition','i.*','Contact.lastName','c.email','c.phone','c.mobile','Contact.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','toString','ui.FaxInteractionId\x20IN\x20?','groupBy','all','rows','show','params','includeAll','include','create','update','describe','addMessage','FaxMessage','omit','ids','getMessages','findOne','nolimit','FaxInteractionId','merge','options','findAll','addTags','setTags','spread','emit','removeTags','download','unix','join','root','files','tmp','server','attachments','Attachment','Messages','get','createReadStream','createWriteStream','log','err','unlinkSync','html-pdf','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','redis','localhost','socket.io-emitter','./faxInteraction.socket'];(function(_0x3cb942,_0x8e2d6c){var _0x25e1fb=function(_0x3b28cf){while(--_0x3b28cf){_0x3cb942['push'](_0x3cb942['shift']());}};_0x25e1fb(++_0x8e2d6c);}(_0x2e21,0xba));var _0x12e2=function(_0x480c01,_0x54ae31){_0x480c01=_0x480c01-0x0;var _0x4efdf5=_0x2e21[_0x480c01];return _0x4efdf5;};'use strict';var pdf=require(_0x12e2('0x0'));var emlformat=require(_0x12e2('0x1'));var rimraf=require(_0x12e2('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x12e2('0x3'));var rp=require('request-promise');var moment=require(_0x12e2('0x4'));var BPromise=require(_0x12e2('0x5'));var Mustache=require(_0x12e2('0x6'));var util=require(_0x12e2('0x7'));var path=require(_0x12e2('0x8'));var sox=require(_0x12e2('0x9'));var csv=require(_0x12e2('0xa'));var ejs=require(_0x12e2('0xb'));var fs=require('fs');var _=require(_0x12e2('0xc'));var squel=require(_0x12e2('0xd'));var crypto=require(_0x12e2('0xe'));var jsforce=require(_0x12e2('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x12e2('0xa'));var querystring=require('querystring');var Papa=require(_0x12e2('0x10'));var Redis=require('ioredis');var authService=require(_0x12e2('0x11'));var qs=require(_0x12e2('0x12'));var as=require(_0x12e2('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x12e2('0x14'))(_0x12e2('0x15'));var utils=require('../../config/utils');var config=require(_0x12e2('0x16'));var db=require('../../mysqldb')['db'];config[_0x12e2('0x17')]=_['defaults'](config[_0x12e2('0x17')],{'host':_0x12e2('0x18'),'port':0x18eb});var socket=require(_0x12e2('0x19'))(new Redis(config[_0x12e2('0x17')]));require(_0x12e2('0x1a'))[_0x12e2('0x1b')](socket);function respondWithStatusCode(_0x1cfa64,_0x3b936e){_0x3b936e=_0x3b936e||0xcc;return function(_0x18d47e){if(_0x18d47e){return _0x1cfa64['sendStatus'](_0x3b936e);}return _0x1cfa64[_0x12e2('0x1c')](_0x3b936e)[_0x12e2('0x1d')]();};}function respondWithResult(_0x44b3e0,_0x285ff7){_0x285ff7=_0x285ff7||0xc8;return function(_0x2d882a){if(_0x2d882a){return _0x44b3e0[_0x12e2('0x1c')](_0x285ff7)[_0x12e2('0x1e')](_0x2d882a);}};}function respondWithFilteredResult(_0x168d26,_0x1d3da5){return function(_0x2ffb31){if(_0x2ffb31){var _0x210f5c=_0x2ffb31[_0x12e2('0x1f')],_0x430bc9=_0x1d3da5[_0x12e2('0x20')],_0x298e64=_0x1d3da5[_0x12e2('0x20')]+_0x1d3da5[_0x12e2('0x21')],_0x174b28;if(_0x298e64>=_0x210f5c){_0x298e64=_0x210f5c;_0x174b28=0xc8;}else{_0x174b28=0xce;}_0x168d26[_0x12e2('0x1c')](_0x174b28);return _0x168d26[_0x12e2('0x22')](_0x12e2('0x23'),_0x430bc9+'-'+_0x298e64+'/'+_0x210f5c)[_0x12e2('0x1e')](_0x2ffb31);}return null;};}function patchUpdates(_0x475cab){return function(_0x4e5bc7){try{jsonpatch[_0x12e2('0x24')](_0x4e5bc7,_0x475cab,!![]);}catch(_0x45179e){return BPromise[_0x12e2('0x25')](_0x45179e);}return _0x4e5bc7[_0x12e2('0x26')]();};}function saveUpdates(_0x47be59,_0x400d23){return function(_0x10c374){if(_0x10c374){return _0x10c374['update'](_0x47be59)[_0x12e2('0x27')](function(_0x5dac82){return _0x5dac82;});}return null;};}function removeEntity(_0xe5868a,_0x33fed2){return function(_0x5e6d9a){if(_0x5e6d9a){return _0x5e6d9a[_0x12e2('0x28')]()[_0x12e2('0x27')](function(){_0xe5868a['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x719371,_0x461e2b){return function(_0x52f475){if(!_0x52f475){_0x719371[_0x12e2('0x29')](0x194);}return _0x52f475;};}function handleError(_0x18639b,_0x441c84){_0x441c84=_0x441c84||0x1f4;return function(_0xf36e7a){logger[_0x12e2('0x2a')](_0xf36e7a[_0x12e2('0x2b')]);if(_0xf36e7a[_0x12e2('0x2c')]){delete _0xf36e7a[_0x12e2('0x2c')];}_0x18639b['status'](_0x441c84)[_0x12e2('0x2d')](_0xf36e7a);};}function getInteractionUsers(_0x2a32a6,_0xdeff70){return new BPromise(function(_0x2f2a21,_0xb62e62){try{if(_0xdeff70[_0x2a32a6['id']]){_0x2a32a6[_0x12e2('0x2e')]=_['map'](_0xdeff70[_0x2a32a6['id']],function(_0x133729){return{'id':_0x133729['id'],'fullname':_0x133729[_0x12e2('0x2f')]};});}}catch(_0x1bf373){_0xb62e62(_0x1bf373);}_0x2f2a21(_0x2a32a6);});}function getInteractionTags(_0x488fd9,_0x9e26a1){return new BPromise(function(_0xdcf157,_0x4c9609){try{if(_0x488fd9[_0x12e2('0x30')]){_0x488fd9[_0x12e2('0x31')]=[];_0x488fd9[_0x12e2('0x30')][_0x12e2('0x32')](',')[_0x12e2('0x33')](function(_0x5bea7b){_0x488fd9[_0x12e2('0x31')][_0x12e2('0x34')](_0x9e26a1[_0x5bea7b]);});}delete _0x488fd9[_0x12e2('0x30')];}catch(_0x513d80){_0x4c9609(_0x513d80);}_0xdcf157(_0x488fd9);});}function updateFaxInteraction(_0x15ef9f,_0x27fb07,_0x10c23c){return new BPromise(function(_0x489883,_0x2cc277){return getInteractionUsers(_0x15ef9f,_0x10c23c)[_0x12e2('0x27')](function(_0x21eb92){return getInteractionTags(_0x21eb92,_0x27fb07);})[_0x12e2('0x27')](function(_0x304f79){_0x489883(_0x304f79);})[_0x12e2('0x35')](function(_0x101e84){_0x2cc277(_0x101e84);});});}exports[_0x12e2('0x36')]=function(_0x468fa4,_0x382ddf){var _0x4aa699={},_0x5d00bf={},_0x5e2246={'count':0x0,'rows':[]};var _0x3e23e6=_[_0x12e2('0x37')](db[_0x12e2('0x38')][_0x12e2('0x39')],function(_0x3acd82){return{'name':_0x3acd82[_0x12e2('0x3a')],'type':_0x3acd82['type'][_0x12e2('0x3b')]};});_0x5d00bf[_0x12e2('0x3c')]=_[_0x12e2('0x37')](_0x3e23e6,_0x12e2('0x2c'));_0x5d00bf['query']=_[_0x12e2('0x3d')](_0x468fa4[_0x12e2('0x3e')]);_0x5d00bf[_0x12e2('0x3f')]=_[_0x12e2('0x40')](_0x5d00bf['model'],_0x5d00bf[_0x12e2('0x3e')]);_0x4aa699[_0x12e2('0x41')]=_['intersection'](_0x5d00bf[_0x12e2('0x3c')],qs['fields'](_0x468fa4['query'][_0x12e2('0x42')]));_0x4aa699[_0x12e2('0x41')]=_0x4aa699[_0x12e2('0x41')][_0x12e2('0x43')]?_0x4aa699[_0x12e2('0x41')]:_0x5d00bf['model'];if(!_0x468fa4['query'][_0x12e2('0x44')]('nolimit')){_0x4aa699[_0x12e2('0x21')]=qs[_0x12e2('0x21')](_0x468fa4[_0x12e2('0x3e')][_0x12e2('0x21')]);_0x4aa699['offset']=qs[_0x12e2('0x20')](_0x468fa4[_0x12e2('0x3e')]['offset']);}_0x4aa699[_0x12e2('0x45')]=qs[_0x12e2('0x46')](_0x468fa4[_0x12e2('0x3e')][_0x12e2('0x46')]);_0x4aa699[_0x12e2('0x47')]=qs[_0x12e2('0x3f')](_[_0x12e2('0x48')](_0x468fa4[_0x12e2('0x3e')],_0x5d00bf['filters']),_0x3e23e6);var _0x32f02e=[];var _0x149052=squel['select']()[_0x12e2('0x49')]('id')['field'](_0x12e2('0x2c'))[_0x12e2('0x49')](_0x12e2('0x4a'))['from']('tools_tags');var _0x25d117=squel[_0x12e2('0x4b')]()[_0x12e2('0x49')](_0x12e2('0x4c'))[_0x12e2('0x49')](_0x12e2('0x4d'))[_0x12e2('0x49')](_0x12e2('0x4e'))[_0x12e2('0x4f')](_0x12e2('0x50'),'ui')[_0x12e2('0x51')](_0x12e2('0x52'),'u','u.id\x20=\x20ui.UserId');var _0x203045=squel[_0x12e2('0x4b')]()[_0x12e2('0x4f')](_0x12e2('0x53'),'i')['left_join'](_0x12e2('0x54'),'c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')[_0x12e2('0x51')]('users','o',_0x12e2('0x55'))[_0x12e2('0x51')](_0x12e2('0x56'),'a',_0x12e2('0x57'))[_0x12e2('0x51')]('fax_messages','me',_0x12e2('0x58'))[_0x12e2('0x51')](_0x12e2('0x59'),'it',_0x12e2('0x5a'))[_0x12e2('0x51')](_0x12e2('0x5b'),'t',_0x12e2('0x5c'));var _0x4ec3b6=squel[_0x12e2('0x5d')]();var _0x40e727=[];var _0x2cd9f3=squel[_0x12e2('0x5d')]();var _0x48b16c;if(_0x468fa4['query'][_0x12e2('0x5e')]){_0x48b16c=as[_0x12e2('0x5f')](_0x468fa4[_0x12e2('0x3e')][_0x12e2('0x5e')]);var _0x50bf03=_0x48b16c[_0x12e2('0x60')];for(var _0x4502da=0x0;_0x4502da<_0x48b16c[_0x12e2('0x61')]['length'];_0x4502da++){var _0x5081ca=_0x48b16c[_0x12e2('0x61')][_0x4502da];var _0x5be300='i';var _0x5afad2=_[_0x12e2('0x62')](_0x3e23e6,['name',_0x5081ca['field']]);if(!_0x5afad2){switch(_0x5081ca[_0x12e2('0x49')]){case _0x12e2('0x63'):if(_0x5081ca['value']==0x1){_0x203045[_0x12e2('0x64')]('`'+_0x5081ca['field']+_0x12e2('0x65'));}else{_0x203045[_0x12e2('0x64')]('`'+_0x5081ca[_0x12e2('0x49')]+_0x12e2('0x66'));}break;case'Contact':if(_0x5081ca[_0x12e2('0x67')]==='$substring'){if(_0x5081ca[_0x12e2('0x68')][_0x12e2('0x32')]('\x20')[_0x12e2('0x43')]>0x1){_0x4ec3b6[_0x50bf03](_0x12e2('0x69'),qs[_0x12e2('0x6a')](_0x5081ca['value']),null);}else{var _0x218a00='%'+_0x5081ca['value']+'%';_0x4ec3b6[_0x50bf03]('c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?',_0x218a00,_0x218a00,_0x218a00);}}else{_0x5afad2=_['find'](_0x3e23e6,[_0x12e2('0x2c'),'ContactId']);_0x5081ca[_0x12e2('0x49')]=_0x12e2('0x6b');_0x51c8dc=as['buildExpression'](_0x5be300,_0x5afad2['type'],_0x5081ca);_0x4ec3b6[_0x50bf03](_0x51c8dc['text'],_0x51c8dc['value'][_0x12e2('0x6c')],_0x51c8dc['value'][_0x12e2('0x1d')]);}break;case _0x12e2('0x6d'):var _0x4e5b0a=_0x5081ca[_0x12e2('0x68')]['split'](',')[_0x12e2('0x37')](function(_0x43c20c){return Number(_0x43c20c);});_0x4e5b0a[_0x12e2('0x33')](function(_0x526d9e){_0x2cd9f3['or'](_0x12e2('0x6e'),'%,'+_0x526d9e+',%');});_0x40e727=_[_0x12e2('0x6f')](_0x40e727,_0x4e5b0a);break;case _0x12e2('0x70'):if(_0x5081ca[_0x12e2('0x67')]===_0x12e2('0x71')){_0x4ec3b6[_0x50bf03](_0x12e2('0x72'),'%'+_0x5081ca[_0x12e2('0x68')]+'%',null);}else{_0x5afad2=_[_0x12e2('0x62')](_0x3e23e6,[_0x12e2('0x2c'),'UserId']);_0x5081ca[_0x12e2('0x49')]=_0x12e2('0x73');_0x51c8dc=as[_0x12e2('0x74')](_0x5be300,_0x5afad2['type'],_0x5081ca);_0x4ec3b6[_0x50bf03](_0x51c8dc['text'],_0x51c8dc[_0x12e2('0x68')][_0x12e2('0x6c')],_0x51c8dc[_0x12e2('0x68')][_0x12e2('0x1d')]);}break;case _0x12e2('0x75'):_0x51c8dc=as[_0x12e2('0x74')]('me',null,_0x5081ca);_0x4ec3b6[_0x50bf03](_0x51c8dc['text'],_0x51c8dc[_0x12e2('0x68')][_0x12e2('0x6c')],_0x51c8dc[_0x12e2('0x68')][_0x12e2('0x1d')]);break;}}else{var _0x51c8dc=as['buildExpression'](_0x5be300,_0x5afad2[_0x12e2('0x76')],_0x5081ca);_0x4ec3b6[_0x50bf03](_0x51c8dc[_0x12e2('0x77')],_0x51c8dc[_0x12e2('0x68')][_0x12e2('0x6c')],_0x51c8dc[_0x12e2('0x68')][_0x12e2('0x1d')]);}}}else{var _0x4e6cfa=_(_0x468fa4['query'])['keys']()['map'](function(_0x23900b){return _[_0x12e2('0x78')](_0x3e23e6,['name',_0x23900b])?_0x23900b:undefined;})['compact']()[_0x12e2('0x68')]();if(!_['isEmpty'](_0x4e6cfa)){_0x4e6cfa['forEach'](function(_0x183e3b){if(_0x183e3b===_0x12e2('0x79')){_0x203045[_0x12e2('0x47')]('i.FaxAccountId\x20IN\x20?',[][_0x12e2('0x7a')](_0x468fa4[_0x12e2('0x3e')][_0x183e3b]));}else if(_0x183e3b===_0x12e2('0x7b')){var _0x55546b=JSON[_0x12e2('0x7c')](_0x468fa4[_0x12e2('0x3e')][_0x183e3b])[_0x12e2('0x7d')];var _0x3246cd=JSON[_0x12e2('0x7c')](_0x468fa4[_0x12e2('0x3e')][_0x183e3b])['$lte'];_0x203045['where'](_0x12e2('0x7e'),_0x55546b,_0x3246cd);}else{if(_0x468fa4[_0x12e2('0x3e')][_0x183e3b]===_0x12e2('0x7f')){_0x203045[_0x12e2('0x47')]('i.'+_0x183e3b+'\x20IS\x20NULL');}else{_0x203045['where']('i.'+_0x183e3b+_0x12e2('0x80'),_0x468fa4[_0x12e2('0x3e')][_0x183e3b]);}}});}if(_0x468fa4[_0x12e2('0x3e')][_0x12e2('0x81')]){if(_0x468fa4[_0x12e2('0x3e')][_0x12e2('0x81')]==0x1){_0x203045['having'](_0x12e2('0x82'));}else{_0x203045[_0x12e2('0x64')](_0x12e2('0x83'));}}if(_0x468fa4['query'][_0x12e2('0x84')]){_0x40e727=_[_0x12e2('0x85')](_0x468fa4[_0x12e2('0x3e')]['tag'])?_0x468fa4[_0x12e2('0x3e')][_0x12e2('0x84')]:new Array(_0x468fa4[_0x12e2('0x3e')][_0x12e2('0x84')]);_0x40e727[_0x12e2('0x33')](function(_0x1c590c){_0x2cd9f3['or'](_0x12e2('0x6e'),'%,'+_0x1c590c+',%');});}if(_0x468fa4[_0x12e2('0x3e')][_0x12e2('0x86')]){var _0x29cbc0=_0x468fa4['query'][_0x12e2('0x86')][_0x12e2('0x87')]('\x5c','\x5c\x5c')[_0x12e2('0x87')]('\x27\x27',_0x12e2('0x88'));if(qs[_0x12e2('0x89')](_0x29cbc0)){_0x4ec3b6['or'](_0x12e2('0x8a'),_0x29cbc0+'%')['or'](_0x12e2('0x8b'),_0x29cbc0+'%');}_0x4ec3b6['or'](_0x12e2('0x8c'),_0x29cbc0+'%');}}_0x203045[_0x12e2('0x47')](_0x4ec3b6);_0x203045['group']('i.id');var _0x5d4293={'type':db[_0x12e2('0x8d')][_0x12e2('0x8e')][_0x12e2('0x8f')],'raw':!![]};var _0x384c6a=_0x203045['clone']();_0x384c6a[_0x12e2('0x49')](_0x12e2('0x90'));_0x384c6a[_0x12e2('0x49')](_0x12e2('0x91'),_0x12e2('0x63'));if(_0x4aa699[_0x12e2('0x45')]){_0x4aa699[_0x12e2('0x45')][_0x12e2('0x33')](function(_0x5c27ba){_0x203045[_0x12e2('0x45')]('i.'+_0x5c27ba[0x0],_0x5c27ba[0x1]===_0x12e2('0x92')?![]:!![]);});}if(!_[_0x12e2('0x93')](_0x40e727)){_0x203045[_0x12e2('0x64')](_0x2cd9f3);_0x384c6a[_0x12e2('0x47')](_0x12e2('0x94'),_0x40e727);}BPromise[_0x12e2('0x95')]()[_0x12e2('0x27')](function(){if(!_0x48b16c){if(_0x468fa4[_0x12e2('0x3e')][_0x12e2('0x79')]||_0x468fa4[_0x12e2('0x3e')]['journey'])return;_0x384c6a[_0x12e2('0x47')]('i.FaxAccountId\x20IS\x20NOT\x20NULL');_0x203045[_0x12e2('0x47')](_0x12e2('0x96'));return;}return _0x468fa4[_0x12e2('0x97')]['getFaxAccounts']({'attributes':['id'],'raw':!![]})[_0x12e2('0x27')](function(_0x4d0047){if(_[_0x12e2('0x93')](_0x4d0047)){_0x384c6a[_0x12e2('0x47')](_0x12e2('0x98'));_0x203045['where'](_0x12e2('0x98'));}else{_0x384c6a['where'](_0x12e2('0x99'),_['map'](_0x4d0047,'id'));_0x203045[_0x12e2('0x47')](_0x12e2('0x99'),_[_0x12e2('0x37')](_0x4d0047,'id'));}});})[_0x12e2('0x27')](function(){db[_0x12e2('0x9a')]['query'](_0x384c6a['toString'](),_0x5d4293)[_0x12e2('0x27')](function(_0x4301c8){_0x5e2246[_0x12e2('0x1f')]=_0x4301c8['length'];if(_0x5e2246[_0x12e2('0x1f')]===0x0)return[];return db['sequelize'][_0x12e2('0x3e')](_0x149052['toString'](),_0x5d4293)[_0x12e2('0x27')](function(_0x140de4){_0x32f02e=_['keyBy'](_0x140de4,'id');_0x5d4293=_['merge'](_0x5d4293,{'model':db['FaxInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x468fa4[_0x12e2('0x3e')][_0x12e2('0x42')]){_0x4aa699[_0x12e2('0x41')][_0x12e2('0x33')](function(_0x147001){_0x203045[_0x12e2('0x49')]('i.'+_0x147001);});}else{_0x203045['field'](_0x12e2('0x91'),'unreadMessages');_0x203045[_0x12e2('0x49')](_0x12e2('0x9b'),'Account.key');_0x203045[_0x12e2('0x49')](_0x12e2('0x9c'),_0x12e2('0x9d'));_0x203045['field'](_0x12e2('0x9e'));_0x203045[_0x12e2('0x49')]('c.firstName','Contact.firstName');_0x203045[_0x12e2('0x49')]('c.lastName',_0x12e2('0x9f'));_0x203045[_0x12e2('0x49')](_0x12e2('0xa0'),'Contact.email');_0x203045[_0x12e2('0x49')](_0x12e2('0xa1'),'Contact.phone');_0x203045['field'](_0x12e2('0xa2'),'Contact.mobile');_0x203045[_0x12e2('0x49')]('c.fax',_0x12e2('0xa3'));_0x203045[_0x12e2('0x49')](_0x12e2('0xa4'),_0x12e2('0xa5'));_0x203045[_0x12e2('0x49')](_0x12e2('0xa6'),_0x12e2('0xa7'));_0x203045[_0x12e2('0x49')](_0x12e2('0xa8'),_0x12e2('0x30'));}if(_0x4aa699[_0x12e2('0x21')])_0x203045[_0x12e2('0x21')](_0x4aa699['limit']);if(_0x4aa699[_0x12e2('0x20')])_0x203045['offset'](_0x4aa699[_0x12e2('0x20')]);return db[_0x12e2('0x9a')][_0x12e2('0x3e')](_0x203045[_0x12e2('0xa9')](),_0x5d4293);})[_0x12e2('0x27')](function(_0x142f0b){_0x25d117[_0x12e2('0x47')](_0x12e2('0xaa'),_['map'](_0x142f0b,'id'));return db[_0x12e2('0x9a')][_0x12e2('0x3e')](_0x25d117[_0x12e2('0xa9')](),_0x5d4293)[_0x12e2('0x27')](function(_0x197437){var _0x14ce7f=_[_0x12e2('0xab')](_0x197437,'FaxInteractionId');var _0x26617c=[];_0x142f0b[_0x12e2('0x33')](function(_0x17d3aa){_0x26617c[_0x12e2('0x34')](updateFaxInteraction(_0x17d3aa,_0x32f02e,_0x14ce7f));});return BPromise[_0x12e2('0xac')](_0x26617c);});});})[_0x12e2('0x27')](function(_0x112c76){_0x5e2246[_0x12e2('0xad')]=_0x112c76;return _0x5e2246;})['then'](respondWithFilteredResult(_0x382ddf,_0x4aa699));})['catch'](handleError(_0x382ddf,null));};exports[_0x12e2('0xae')]=function(_0x4c06ab,_0x400476){var _0x1d5650={'raw':![],'where':{'id':_0x4c06ab[_0x12e2('0xaf')]['id']}},_0x323b76={};_0x323b76[_0x12e2('0x3c')]=_[_0x12e2('0x3d')](db[_0x12e2('0x38')][_0x12e2('0x39')]);_0x323b76[_0x12e2('0x3e')]=_[_0x12e2('0x3d')](_0x4c06ab[_0x12e2('0x3e')]);_0x323b76[_0x12e2('0x3f')]=_[_0x12e2('0x40')](_0x323b76[_0x12e2('0x3c')],_0x323b76[_0x12e2('0x3e')]);_0x1d5650[_0x12e2('0x41')]=_['intersection'](_0x323b76[_0x12e2('0x3c')],qs[_0x12e2('0x42')](_0x4c06ab[_0x12e2('0x3e')][_0x12e2('0x42')]));_0x1d5650[_0x12e2('0x41')]=_0x1d5650['attributes'][_0x12e2('0x43')]?_0x1d5650[_0x12e2('0x41')]:_0x323b76[_0x12e2('0x3c')];if(_0x4c06ab['query'][_0x12e2('0xb0')]){_0x1d5650[_0x12e2('0xb1')]=[{'all':!![]}];}_0x1d5650=_['merge']({},_0x1d5650,_0x4c06ab['options']);return db[_0x12e2('0x38')][_0x12e2('0x62')](_0x1d5650)[_0x12e2('0x27')](handleEntityNotFound(_0x400476,null))[_0x12e2('0x27')](respondWithResult(_0x400476,null))[_0x12e2('0x35')](handleError(_0x400476,null));};exports[_0x12e2('0xb2')]=function(_0x322e6b,_0x402075){return db['FaxInteraction']['create'](_0x322e6b[_0x12e2('0x75')],{})['then'](respondWithResult(_0x402075,0xc9))['catch'](handleError(_0x402075,null));};exports[_0x12e2('0xb3')]=function(_0x2ab72e,_0x4295df){if(_0x2ab72e['body']['id']){delete _0x2ab72e[_0x12e2('0x75')]['id'];}return db[_0x12e2('0x38')][_0x12e2('0x62')]({'where':{'id':_0x2ab72e['params']['id']}})[_0x12e2('0x27')](handleEntityNotFound(_0x4295df,null))[_0x12e2('0x27')](saveUpdates(_0x2ab72e[_0x12e2('0x75')],null))[_0x12e2('0x27')](respondWithResult(_0x4295df,null))[_0x12e2('0x35')](handleError(_0x4295df,null));};exports[_0x12e2('0x28')]=function(_0x3e9fc0,_0x16576a){return db[_0x12e2('0x38')]['find']({'where':{'id':_0x3e9fc0[_0x12e2('0xaf')]['id']}})[_0x12e2('0x27')](handleEntityNotFound(_0x16576a,null))[_0x12e2('0x27')](removeEntity(_0x16576a,null))[_0x12e2('0x35')](handleError(_0x16576a,null));};exports[_0x12e2('0xb4')]=function(_0x1cf10a,_0x204ae3){return db['FaxInteraction'][_0x12e2('0xb4')]()[_0x12e2('0x27')](respondWithResult(_0x204ae3,null))[_0x12e2('0x35')](handleError(_0x204ae3,null));};exports[_0x12e2('0xb5')]=function(_0xf47db3,_0x42f9a2,_0x2480ae){return db[_0x12e2('0xb6')]['find']({'where':{'id':_0xf47db3[_0x12e2('0xaf')]['id']}})[_0x12e2('0x27')](handleEntityNotFound(_0x42f9a2,null))[_0x12e2('0x27')](function(_0xf481a5){if(_0xf481a5){return _0xf481a5['addMessage'](_0xf47db3[_0x12e2('0x75')]['ids'],_[_0x12e2('0xb7')](_0xf47db3[_0x12e2('0x75')],[_0x12e2('0xb8'),'id'])||{});}})[_0x12e2('0x27')](respondWithResult(_0x42f9a2,null))[_0x12e2('0x35')](handleError(_0x42f9a2,null));};exports[_0x12e2('0xb9')]=function(_0x3d2b1c,_0x333a87,_0x596ef5){var _0x4d40c2={'raw':![],'where':{}};var _0x91c798={};var _0x452796={'count':0x0,'rows':[]};return db[_0x12e2('0x38')][_0x12e2('0xba')]({'where':{'id':_0x3d2b1c[_0x12e2('0xaf')]['id']}})[_0x12e2('0x27')](handleEntityNotFound(_0x333a87,null))[_0x12e2('0x27')](function(_0x56819f){if(_0x56819f){_0x91c798[_0x12e2('0x3c')]=_[_0x12e2('0x3d')](db['FaxMessage']['rawAttributes']);_0x91c798[_0x12e2('0x3e')]=_['keys'](_0x3d2b1c[_0x12e2('0x3e')]);_0x91c798[_0x12e2('0x3f')]=_[_0x12e2('0x40')](_0x91c798[_0x12e2('0x3c')],_0x91c798[_0x12e2('0x3e')]);_0x4d40c2['attributes']=_[_0x12e2('0x40')](_0x91c798[_0x12e2('0x3c')],qs[_0x12e2('0x42')](_0x3d2b1c[_0x12e2('0x3e')][_0x12e2('0x42')]));_0x4d40c2[_0x12e2('0x41')]=_0x4d40c2[_0x12e2('0x41')]['length']?_0x4d40c2['attributes']:_0x91c798[_0x12e2('0x3c')];if(!_0x3d2b1c[_0x12e2('0x3e')][_0x12e2('0x44')](_0x12e2('0xbb'))){_0x4d40c2[_0x12e2('0x21')]=qs['limit'](_0x3d2b1c[_0x12e2('0x3e')][_0x12e2('0x21')]);_0x4d40c2[_0x12e2('0x20')]=qs['offset'](_0x3d2b1c[_0x12e2('0x3e')][_0x12e2('0x20')]);}_0x4d40c2[_0x12e2('0x45')]=qs['sort'](_0x3d2b1c['query'][_0x12e2('0x46')]);_0x4d40c2[_0x12e2('0x47')]=qs[_0x12e2('0x3f')](_[_0x12e2('0x48')](_0x3d2b1c[_0x12e2('0x3e')],_0x91c798[_0x12e2('0x3f')]));_0x4d40c2[_0x12e2('0x47')][_0x12e2('0xbc')]=_0x56819f['id'];if(_0x3d2b1c[_0x12e2('0x3e')][_0x12e2('0x86')]){_0x4d40c2[_0x12e2('0x47')]=_[_0x12e2('0xbd')](_0x4d40c2[_0x12e2('0x47')],{'$or':_[_0x12e2('0x37')](_0x4d40c2[_0x12e2('0x41')],function(_0x1704b1){var _0xb6124e={};_0xb6124e[_0x1704b1]={'$like':'%'+_0x3d2b1c['query'][_0x12e2('0x86')]+'%'};return _0xb6124e;})});}if(_0x3d2b1c['query']['$gte']){var _0x1e5ae7=_0x3d2b1c[_0x12e2('0x3e')][_0x12e2('0x7d')][_0x12e2('0x32')](',');var _0x11dd78={};_0x11dd78[_0x1e5ae7[0x0]]={'$gte':moment(_0x1e5ae7[0x1])['format']('YYYY-MM-DD\x20HH:mm:ss')};_0x4d40c2['where']=_[_0x12e2('0xbd')](_0x4d40c2['where'],_0x11dd78);}_0x4d40c2=_[_0x12e2('0xbd')]({},_0x4d40c2,_0x3d2b1c[_0x12e2('0xbe')]);return db['FaxMessage'][_0x12e2('0x1f')]({'where':_0x4d40c2[_0x12e2('0x47')]})[_0x12e2('0x27')](function(_0x235588){_0x452796['count']=_0x235588;if(_0x3d2b1c['query'][_0x12e2('0xb0')]){_0x4d40c2[_0x12e2('0xb1')]=[{'all':!![]}];}return db[_0x12e2('0xb6')][_0x12e2('0xbf')](_0x4d40c2);})[_0x12e2('0x27')](function(_0x1f93bd){_0x452796[_0x12e2('0xad')]=_0x1f93bd;return _0x452796;});}})[_0x12e2('0x27')](respondWithFilteredResult(_0x333a87,_0x4d40c2))[_0x12e2('0x35')](handleError(_0x333a87,null));};exports[_0x12e2('0xc0')]=function(_0x2eff49,_0x4145e1,_0x30ba70){return db[_0x12e2('0x38')][_0x12e2('0x62')]({'where':{'id':_0x2eff49[_0x12e2('0xaf')]['id']}})[_0x12e2('0x27')](handleEntityNotFound(_0x4145e1,null))[_0x12e2('0x27')](function(_0x547722){if(_0x547722){return _0x547722[_0x12e2('0xc1')](_0x2eff49[_0x12e2('0x75')]['ids'],_[_0x12e2('0xb7')](_0x2eff49[_0x12e2('0x75')],[_0x12e2('0xb8'),'id'])||{})[_0x12e2('0xc2')](function(){return db[_0x12e2('0x6d')][_0x12e2('0xbf')]({'attributes':['id',_0x12e2('0x2c'),_0x12e2('0x4a')],'where':{'id':_0x2eff49[_0x12e2('0x75')]['ids']}});})[_0x12e2('0x27')](function(_0x2bf228){socket[_0x12e2('0xc3')]('faxInteractionTags:save',{'id':Number(_0x2eff49['params']['id']),'tags':_0x2bf228||[]});return{'id':Number(_0x2eff49['params']['id']),'tags':_0x2bf228||[]};});}})['then'](respondWithResult(_0x4145e1,null))[_0x12e2('0x35')](handleError(_0x4145e1,null));};exports[_0x12e2('0xc4')]=function(_0x3e84d8,_0x3c0b1f,_0x41b804){return db[_0x12e2('0x38')][_0x12e2('0x62')]({'where':{'id':_0x3e84d8[_0x12e2('0xaf')]['id']}})[_0x12e2('0x27')](handleEntityNotFound(_0x3c0b1f,null))[_0x12e2('0x27')](function(_0x404c9f){if(_0x404c9f){return _0x404c9f['removeTags'](_0x3e84d8['query'][_0x12e2('0xb8')]);}})['then'](respondWithStatusCode(_0x3c0b1f,null))[_0x12e2('0x35')](handleError(_0x3c0b1f,null));};exports[_0x12e2('0xc5')]=function(_0x2bc8e6,_0x84acf4){var _0x553d52=moment()[_0x12e2('0xc6')]()[_0x12e2('0xa9')]();var _0x1c13eb=path[_0x12e2('0xc7')](config[_0x12e2('0xc8')],'server',_0x12e2('0xc9'),_0x12e2('0xca'));var _0x34bf6e=path[_0x12e2('0xc7')](config['root'],_0x12e2('0xcb'),_0x12e2('0xc9'),_0x12e2('0xcc'));var _0x1b9157=path[_0x12e2('0xc7')](_0x1c13eb,_0x553d52);var _0x326bd8=util['format']('transcript-%d-%s.zip',_0x2bc8e6['params']['id'],_0x553d52);var _0x512564=path[_0x12e2('0xc7')](_0x1c13eb,_0x326bd8);var _0x512620=[];_0x512620[_0x12e2('0x34')]({'model':db[_0x12e2('0xcd')],'as':'Attachment','raw':!![]});var _0x461d62=[{'model':db[_0x12e2('0xb6')],'as':_0x12e2('0xce'),'attributes':['id',_0x12e2('0x75'),_0x12e2('0x7b')],'include':_0x512620}];return db['FaxInteraction'][_0x12e2('0x62')]({'where':{'id':_0x2bc8e6['params']['id']},'include':_0x461d62})[_0x12e2('0x27')](handleEntityNotFound(_0x84acf4,null))[_0x12e2('0x27')](function(_0x41a255){if(_0x41a255&&_0x41a255[_0x12e2('0xce')]){var _0x91553=_0x41a255[_0x12e2('0xcf')]({'plain':!![]});fs['mkdirSync'](_0x1b9157);for(var _0x3947e5=0x0;_0x3947e5<_0x91553['Messages'][_0x12e2('0x43')];_0x3947e5++){var _0x44a2d5=_0x91553['Messages'][_0x3947e5][_0x12e2('0xcd')];if(_0x44a2d5){var _0x109e6b=path[_0x12e2('0xc7')](_0x34bf6e,_0x44a2d5['basename']);if(fs['existsSync'](_0x109e6b)){fs[_0x12e2('0xd0')](_0x109e6b)['pipe'](fs[_0x12e2('0xd1')](path[_0x12e2('0xc7')](_0x1b9157,_0x44a2d5['basename'])));}}}return BPromise[_0x12e2('0x95')]()[_0x12e2('0x27')](function(){return new BPromise(function(_0x4883ee,_0xa5c2e7){zipdir(_0x1b9157,{'saveTo':_0x512564},function(_0x336815,_0x72b34c){if(_0x336815)return _0xa5c2e7(_0x336815);return _0x4883ee(_0x72b34c);});})[_0x12e2('0x27')](function(){return new BPromise(function(_0x2df902,_0x489dbf){rimraf(_0x1b9157,function(_0x419141){if(_0x419141)_0x489dbf(_0x419141);return _0x2df902();});});})[_0x12e2('0x27')](function(){return _0x84acf4[_0x12e2('0xc5')](_0x512564,_0x326bd8,function(_0x2bccf6){if(_0x2bccf6){console[_0x12e2('0xd2')](_0x12e2('0xd3'),_0x2bccf6);}else{fs[_0x12e2('0xd4')](_0x512564);}});});});}else{return _0x84acf4[_0x12e2('0x29')](0xc8);}})['catch'](handleError(_0x84acf4,null));};
\ No newline at end of file
+var _0xcecc=['querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./faxInteraction.socket','status','end','json','count','offset','set','Content-Range','apply','reject','update','then','destroy','stack','name','send','map','TagIds','Tags','forEach','push','catch','index','FaxInteraction','rawAttributes','key','model','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','limit','order','sort','where','field','from','tools_tags','select','u.id','u.fullname','ui.FaxInteractionId','user_has_fax_interactions','left_join','users','u.id\x20=\x20ui.UserId','fax_interactions','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','a.id\x20=\x20i.FaxAccountId','fax_messages','fax_interaction_has_tags','it.FaxInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','parseSearch','find','unreadMessages','value','having','`\x20>\x200','Contact','operator','split','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','type','text','start','Tag','union','User','$substring','UserId','compact','FaxAccountId','concat','createdAt','$gte','parse','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','filter','replace','\x27\x27\x27\x27','i.id\x20LIKE\x20?','i.fax\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','Sequelize','QueryTypes','i.id','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','DESC','isEmpty','t.id\x20IN\x20?','resolve','journey','i.FaxAccountId\x20IS\x20NOT\x20NULL','user','getFaxAccounts','i.FaxAccountId\x20IS\x20NULL','i.FaxAccountId\x20IN\x20?','toString','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','i.*','c.firstName','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.email','c.phone','Contact.phone','Contact.mobile','c.fax','Contact.fax','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','sequelize','ui.FaxInteractionId\x20IN\x20?','groupBy','FaxInteractionId','all','rows','include','merge','options','body','params','describe','addMessage','FaxMessage','ids','getMessages','findOne','YYYY-MM-DD\x20HH:mm:ss','includeAll','addTags','findAll','faxInteractionTags:save','removeTags','unix','join','root','server','files','format','transcript-%d-%s.zip','Messages','get','mkdirSync','Attachment','basename','existsSync','createReadStream','pipe','download','log','unlinkSync','html-pdf','rimraf','request-promise','moment','bluebird','mustache','sox','ejs','lodash','squel','jsforce','desk.js'];(function(_0x4f51f9,_0x5d5613){var _0x533984=function(_0x578319){while(--_0x578319){_0x4f51f9['push'](_0x4f51f9['shift']());}};_0x533984(++_0x5d5613);}(_0xcecc,0x186));var _0xccec=function(_0x30c9da,_0x545460){_0x30c9da=_0x30c9da-0x0;var _0x33708f=_0xcecc[_0x30c9da];return _0x33708f;};'use strict';var pdf=require(_0xccec('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xccec('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xccec('0x2'));var moment=require(_0xccec('0x3'));var BPromise=require(_0xccec('0x4'));var Mustache=require(_0xccec('0x5'));var util=require('util');var path=require('path');var sox=require(_0xccec('0x6'));var csv=require('to-csv');var ejs=require(_0xccec('0x7'));var fs=require('fs');var _=require(_0xccec('0x8'));var squel=require(_0xccec('0x9'));var crypto=require('crypto');var jsforce=require(_0xccec('0xa'));var deskjs=require(_0xccec('0xb'));var toCsv=require('to-csv');var querystring=require(_0xccec('0xc'));var Papa=require(_0xccec('0xd'));var Redis=require(_0xccec('0xe'));var authService=require(_0xccec('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xccec('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xccec('0x11'))(_0xccec('0x12'));var utils=require('../../config/utils');var config=require(_0xccec('0x13'));var db=require(_0xccec('0x14'))['db'];config[_0xccec('0x15')]=_['defaults'](config[_0xccec('0x15')],{'host':_0xccec('0x16'),'port':0x18eb});var socket=require(_0xccec('0x17'))(new Redis(config[_0xccec('0x15')]));require(_0xccec('0x18'))['register'](socket);function respondWithStatusCode(_0x2882d9,_0x566a81){_0x566a81=_0x566a81||0xcc;return function(_0x4d0145){if(_0x4d0145){return _0x2882d9['sendStatus'](_0x566a81);}return _0x2882d9[_0xccec('0x19')](_0x566a81)[_0xccec('0x1a')]();};}function respondWithResult(_0x18e7d0,_0x69a776){_0x69a776=_0x69a776||0xc8;return function(_0x1d588f){if(_0x1d588f){return _0x18e7d0[_0xccec('0x19')](_0x69a776)[_0xccec('0x1b')](_0x1d588f);}};}function respondWithFilteredResult(_0x1b7235,_0x199e52){return function(_0x5f0be1){if(_0x5f0be1){var _0x518016=_0x5f0be1[_0xccec('0x1c')],_0x56b926=_0x199e52[_0xccec('0x1d')],_0x970c66=_0x199e52[_0xccec('0x1d')]+_0x199e52['limit'],_0x551d33;if(_0x970c66>=_0x518016){_0x970c66=_0x518016;_0x551d33=0xc8;}else{_0x551d33=0xce;}_0x1b7235[_0xccec('0x19')](_0x551d33);return _0x1b7235[_0xccec('0x1e')](_0xccec('0x1f'),_0x56b926+'-'+_0x970c66+'/'+_0x518016)['json'](_0x5f0be1);}return null;};}function patchUpdates(_0x2fedff){return function(_0x3bd5fa){try{jsonpatch[_0xccec('0x20')](_0x3bd5fa,_0x2fedff,!![]);}catch(_0x57926a){return BPromise[_0xccec('0x21')](_0x57926a);}return _0x3bd5fa['save']();};}function saveUpdates(_0x9065a3,_0x4b2666){return function(_0x23ddf8){if(_0x23ddf8){return _0x23ddf8[_0xccec('0x22')](_0x9065a3)[_0xccec('0x23')](function(_0x50794d){return _0x50794d;});}return null;};}function removeEntity(_0x3d83e1,_0x6be7ac){return function(_0x2412f3){if(_0x2412f3){return _0x2412f3[_0xccec('0x24')]()[_0xccec('0x23')](function(){_0x3d83e1['status'](0xcc)[_0xccec('0x1a')]();});}};}function handleEntityNotFound(_0xb0b0da,_0x2d8fa0){return function(_0x15d495){if(!_0x15d495){_0xb0b0da['sendStatus'](0x194);}return _0x15d495;};}function handleError(_0x27b541,_0x52ddd7){_0x52ddd7=_0x52ddd7||0x1f4;return function(_0x4e00c6){logger['error'](_0x4e00c6[_0xccec('0x25')]);if(_0x4e00c6[_0xccec('0x26')]){delete _0x4e00c6[_0xccec('0x26')];}_0x27b541[_0xccec('0x19')](_0x52ddd7)[_0xccec('0x27')](_0x4e00c6);};}function getInteractionUsers(_0x3e8557,_0x3ca9c7){return new BPromise(function(_0x59bb66,_0x11085d){try{if(_0x3ca9c7[_0x3e8557['id']]){_0x3e8557['Users']=_[_0xccec('0x28')](_0x3ca9c7[_0x3e8557['id']],function(_0xc6db88){return{'id':_0xc6db88['id'],'fullname':_0xc6db88['fullname']};});}}catch(_0x55a53a){_0x11085d(_0x55a53a);}_0x59bb66(_0x3e8557);});}function getInteractionTags(_0x1e93e3,_0x190786){return new BPromise(function(_0x53be76,_0x3e9ef5){try{if(_0x1e93e3[_0xccec('0x29')]){_0x1e93e3[_0xccec('0x2a')]=[];_0x1e93e3[_0xccec('0x29')]['split'](',')[_0xccec('0x2b')](function(_0x1bcdd1){_0x1e93e3[_0xccec('0x2a')][_0xccec('0x2c')](_0x190786[_0x1bcdd1]);});}delete _0x1e93e3[_0xccec('0x29')];}catch(_0x235219){_0x3e9ef5(_0x235219);}_0x53be76(_0x1e93e3);});}function updateFaxInteraction(_0x180367,_0x173ebc,_0x576df7){return new BPromise(function(_0x2d2be9,_0x293ed1){return getInteractionUsers(_0x180367,_0x576df7)[_0xccec('0x23')](function(_0x4a63e7){return getInteractionTags(_0x4a63e7,_0x173ebc);})['then'](function(_0xf2311c){_0x2d2be9(_0xf2311c);})[_0xccec('0x2d')](function(_0x7b2585){_0x293ed1(_0x7b2585);});});}exports[_0xccec('0x2e')]=function(_0x5373df,_0xb0a4a7){var _0x5952ba={},_0x4ece41={},_0x324ca1={'count':0x0,'rows':[]};var _0x87d6d3=_[_0xccec('0x28')](db[_0xccec('0x2f')][_0xccec('0x30')],function(_0x263209){return{'name':_0x263209['fieldName'],'type':_0x263209['type'][_0xccec('0x31')]};});_0x4ece41[_0xccec('0x32')]=_[_0xccec('0x28')](_0x87d6d3,_0xccec('0x26'));_0x4ece41['query']=_[_0xccec('0x33')](_0x5373df['query']);_0x4ece41[_0xccec('0x34')]=_[_0xccec('0x35')](_0x4ece41[_0xccec('0x32')],_0x4ece41[_0xccec('0x36')]);_0x5952ba[_0xccec('0x37')]=_['intersection'](_0x4ece41[_0xccec('0x32')],qs[_0xccec('0x38')](_0x5373df['query'][_0xccec('0x38')]));_0x5952ba[_0xccec('0x37')]=_0x5952ba[_0xccec('0x37')][_0xccec('0x39')]?_0x5952ba['attributes']:_0x4ece41[_0xccec('0x32')];if(!_0x5373df[_0xccec('0x36')][_0xccec('0x3a')]('nolimit')){_0x5952ba[_0xccec('0x3b')]=qs['limit'](_0x5373df[_0xccec('0x36')][_0xccec('0x3b')]);_0x5952ba[_0xccec('0x1d')]=qs['offset'](_0x5373df['query'][_0xccec('0x1d')]);}_0x5952ba[_0xccec('0x3c')]=qs[_0xccec('0x3d')](_0x5373df['query'][_0xccec('0x3d')]);_0x5952ba[_0xccec('0x3e')]=qs[_0xccec('0x34')](_['pick'](_0x5373df[_0xccec('0x36')],_0x4ece41[_0xccec('0x34')]),_0x87d6d3);var _0x262e25=[];var _0x1dfd34=squel['select']()['field']('id')[_0xccec('0x3f')](_0xccec('0x26'))[_0xccec('0x3f')]('color')[_0xccec('0x40')](_0xccec('0x41'));var _0x42ed1c=squel[_0xccec('0x42')]()[_0xccec('0x3f')](_0xccec('0x43'))['field'](_0xccec('0x44'))[_0xccec('0x3f')](_0xccec('0x45'))[_0xccec('0x40')](_0xccec('0x46'),'ui')[_0xccec('0x47')](_0xccec('0x48'),'u',_0xccec('0x49'));var _0x57c8ab=squel[_0xccec('0x42')]()[_0xccec('0x40')](_0xccec('0x4a'),'i')[_0xccec('0x47')]('cm_contacts','c',_0xccec('0x4b'))[_0xccec('0x47')](_0xccec('0x48'),'o','o.id\x20=\x20i.UserId')[_0xccec('0x47')]('fax_accounts','a',_0xccec('0x4c'))[_0xccec('0x47')](_0xccec('0x4d'),'me','me.FaxInteractionId\x20=\x20i.id')[_0xccec('0x47')](_0xccec('0x4e'),'it',_0xccec('0x4f'))['left_join'](_0xccec('0x41'),'t',_0xccec('0x50'));var _0x25c627=squel[_0xccec('0x51')]();var _0x415238=[];var _0x5d299c=squel['expr']();var _0x486034;if(_0x5373df[_0xccec('0x36')][_0xccec('0x52')]){_0x486034=as[_0xccec('0x53')](_0x5373df[_0xccec('0x36')][_0xccec('0x52')]);var _0x1b16ed=_0x486034['sqlOperator'];for(var _0x1ddc01=0x0;_0x1ddc01<_0x486034['conditions'][_0xccec('0x39')];_0x1ddc01++){var _0xff9e72=_0x486034['conditions'][_0x1ddc01];var _0x303aa6='i';var _0x362844=_[_0xccec('0x54')](_0x87d6d3,[_0xccec('0x26'),_0xff9e72[_0xccec('0x3f')]]);if(!_0x362844){switch(_0xff9e72[_0xccec('0x3f')]){case _0xccec('0x55'):if(_0xff9e72[_0xccec('0x56')]==0x1){_0x57c8ab['having']('`'+_0xff9e72['field']+'`\x20=\x200');}else{_0x57c8ab[_0xccec('0x57')]('`'+_0xff9e72[_0xccec('0x3f')]+_0xccec('0x58'));}break;case _0xccec('0x59'):if(_0xff9e72[_0xccec('0x5a')]==='$substring'){if(_0xff9e72[_0xccec('0x56')][_0xccec('0x5b')]('\x20')['length']>0x1){_0x25c627[_0x1b16ed](_0xccec('0x5c'),qs[_0xccec('0x5d')](_0xff9e72[_0xccec('0x56')]),null);}else{var _0x50474d='%'+_0xff9e72['value']+'%';_0x25c627[_0x1b16ed](_0xccec('0x5e'),_0x50474d,_0x50474d,_0x50474d);}}else{_0x362844=_['find'](_0x87d6d3,[_0xccec('0x26'),_0xccec('0x5f')]);_0xff9e72['field']=_0xccec('0x5f');_0x21cf28=as[_0xccec('0x60')](_0x303aa6,_0x362844[_0xccec('0x61')],_0xff9e72);_0x25c627[_0x1b16ed](_0x21cf28[_0xccec('0x62')],_0x21cf28[_0xccec('0x56')][_0xccec('0x63')],_0x21cf28[_0xccec('0x56')][_0xccec('0x1a')]);}break;case _0xccec('0x64'):var _0x449106=_0xff9e72[_0xccec('0x56')][_0xccec('0x5b')](',')[_0xccec('0x28')](function(_0x1c4f9b){return Number(_0x1c4f9b);});_0x449106['forEach'](function(_0x25c1ef){_0x5d299c['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x25c1ef+',%');});_0x415238=_[_0xccec('0x65')](_0x415238,_0x449106);break;case _0xccec('0x66'):if(_0xff9e72[_0xccec('0x5a')]===_0xccec('0x67')){_0x25c627[_0x1b16ed]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0xff9e72['value']+'%',null);}else{_0x362844=_['find'](_0x87d6d3,[_0xccec('0x26'),_0xccec('0x68')]);_0xff9e72[_0xccec('0x3f')]=_0xccec('0x68');_0x21cf28=as['buildExpression'](_0x303aa6,_0x362844['type'],_0xff9e72);_0x25c627[_0x1b16ed](_0x21cf28['text'],_0x21cf28[_0xccec('0x56')]['start'],_0x21cf28[_0xccec('0x56')][_0xccec('0x1a')]);}break;case'body':_0x21cf28=as[_0xccec('0x60')]('me',null,_0xff9e72);_0x25c627[_0x1b16ed](_0x21cf28[_0xccec('0x62')],_0x21cf28['value'][_0xccec('0x63')],_0x21cf28[_0xccec('0x56')][_0xccec('0x1a')]);break;}}else{var _0x21cf28=as[_0xccec('0x60')](_0x303aa6,_0x362844[_0xccec('0x61')],_0xff9e72);_0x25c627[_0x1b16ed](_0x21cf28[_0xccec('0x62')],_0x21cf28[_0xccec('0x56')][_0xccec('0x63')],_0x21cf28[_0xccec('0x56')]['end']);}}}else{var _0x10f944=_(_0x5373df[_0xccec('0x36')])[_0xccec('0x33')]()[_0xccec('0x28')](function(_0x2d5f33){return _['some'](_0x87d6d3,[_0xccec('0x26'),_0x2d5f33])?_0x2d5f33:undefined;})[_0xccec('0x69')]()[_0xccec('0x56')]();if(!_['isEmpty'](_0x10f944)){_0x10f944[_0xccec('0x2b')](function(_0x128b63){if(_0x128b63===_0xccec('0x6a')){_0x57c8ab[_0xccec('0x3e')]('i.FaxAccountId\x20IN\x20?',[][_0xccec('0x6b')](_0x5373df[_0xccec('0x36')][_0x128b63]));}else if(_0x128b63===_0xccec('0x6c')){var _0x33c721=JSON['parse'](_0x5373df[_0xccec('0x36')][_0x128b63])[_0xccec('0x6d')];var _0x395ebc=JSON[_0xccec('0x6e')](_0x5373df['query'][_0x128b63])[_0xccec('0x6f')];_0x57c8ab[_0xccec('0x3e')](_0xccec('0x70'),_0x33c721,_0x395ebc);}else{if(_0x5373df['query'][_0x128b63]===_0xccec('0x71')){_0x57c8ab[_0xccec('0x3e')]('i.'+_0x128b63+'\x20IS\x20NULL');}else{_0x57c8ab[_0xccec('0x3e')]('i.'+_0x128b63+_0xccec('0x72'),_0x5373df[_0xccec('0x36')][_0x128b63]);}}});}if(_0x5373df[_0xccec('0x36')][_0xccec('0x73')]){if(_0x5373df['query'][_0xccec('0x73')]==0x1){_0x57c8ab[_0xccec('0x57')](_0xccec('0x74'));}else{_0x57c8ab['having'](_0xccec('0x75'));}}if(_0x5373df[_0xccec('0x36')][_0xccec('0x76')]){_0x415238=_[_0xccec('0x77')](_0x5373df[_0xccec('0x36')][_0xccec('0x76')])?_0x5373df['query'][_0xccec('0x76')]:new Array(_0x5373df[_0xccec('0x36')][_0xccec('0x76')]);_0x415238[_0xccec('0x2b')](function(_0x59e15e){_0x5d299c['or'](_0xccec('0x78'),'%,'+_0x59e15e+',%');});}if(_0x5373df['query'][_0xccec('0x79')]){var _0x276410=_0x5373df[_0xccec('0x36')]['filter'][_0xccec('0x7a')]('\x5c','\x5c\x5c')[_0xccec('0x7a')]('\x27\x27',_0xccec('0x7b'));if(qs['isNumeric'](_0x276410)){_0x25c627['or'](_0xccec('0x7c'),_0x276410+'%')['or'](_0xccec('0x7d'),_0x276410+'%');}_0x25c627['or'](_0xccec('0x7e'),_0x276410+'%');}}_0x57c8ab[_0xccec('0x3e')](_0x25c627);_0x57c8ab[_0xccec('0x7f')]('i.id');var _0x527369={'type':db[_0xccec('0x80')][_0xccec('0x81')]['SELECT'],'raw':!![]};var _0x1a922c=_0x57c8ab['clone']();_0x1a922c[_0xccec('0x3f')](_0xccec('0x82'));_0x1a922c[_0xccec('0x3f')](_0xccec('0x83'),_0xccec('0x55'));if(_0x5952ba[_0xccec('0x3c')]){_0x5952ba[_0xccec('0x3c')][_0xccec('0x2b')](function(_0x2c47e0){_0x57c8ab['order']('i.'+_0x2c47e0[0x0],_0x2c47e0[0x1]===_0xccec('0x84')?![]:!![]);});}if(!_[_0xccec('0x85')](_0x415238)){_0x57c8ab[_0xccec('0x57')](_0x5d299c);_0x1a922c[_0xccec('0x3e')](_0xccec('0x86'),_0x415238);}BPromise[_0xccec('0x87')]()['then'](function(){if(!_0x486034){if(_0x5373df[_0xccec('0x36')]['FaxAccountId']||_0x5373df[_0xccec('0x36')][_0xccec('0x88')])return;_0x1a922c[_0xccec('0x3e')](_0xccec('0x89'));_0x57c8ab['where'](_0xccec('0x89'));return;}return _0x5373df[_0xccec('0x8a')][_0xccec('0x8b')]({'attributes':['id'],'raw':!![]})['then'](function(_0x16a0cc){if(_[_0xccec('0x85')](_0x16a0cc)){_0x1a922c[_0xccec('0x3e')](_0xccec('0x8c'));_0x57c8ab[_0xccec('0x3e')]('i.FaxAccountId\x20IS\x20NULL');}else{_0x1a922c[_0xccec('0x3e')](_0xccec('0x8d'),_['map'](_0x16a0cc,'id'));_0x57c8ab[_0xccec('0x3e')](_0xccec('0x8d'),_[_0xccec('0x28')](_0x16a0cc,'id'));}});})[_0xccec('0x23')](function(){db['sequelize'][_0xccec('0x36')](_0x1a922c[_0xccec('0x8e')](),_0x527369)[_0xccec('0x23')](function(_0x3eb21a){_0x324ca1['count']=_0x3eb21a['length'];if(_0x324ca1[_0xccec('0x1c')]===0x0)return[];return db['sequelize'][_0xccec('0x36')](_0x1dfd34[_0xccec('0x8e')](),_0x527369)[_0xccec('0x23')](function(_0x1fd3f0){_0x262e25=_['keyBy'](_0x1fd3f0,'id');_0x527369=_['merge'](_0x527369,{'model':db[_0xccec('0x2f')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x5373df['query'][_0xccec('0x38')]){_0x5952ba['attributes'][_0xccec('0x2b')](function(_0x47e7b2){_0x57c8ab[_0xccec('0x3f')]('i.'+_0x47e7b2);});}else{_0x57c8ab[_0xccec('0x3f')](_0xccec('0x83'),_0xccec('0x55'));_0x57c8ab[_0xccec('0x3f')]('a.key',_0xccec('0x8f'));_0x57c8ab['field'](_0xccec('0x90'),_0xccec('0x91'));_0x57c8ab[_0xccec('0x3f')](_0xccec('0x92'));_0x57c8ab['field'](_0xccec('0x93'),_0xccec('0x94'));_0x57c8ab['field'](_0xccec('0x95'),_0xccec('0x96'));_0x57c8ab[_0xccec('0x3f')](_0xccec('0x97'),_0xccec('0x98'));_0x57c8ab[_0xccec('0x3f')](_0xccec('0x99'),_0xccec('0x9a'));_0x57c8ab[_0xccec('0x3f')]('c.mobile',_0xccec('0x9b'));_0x57c8ab[_0xccec('0x3f')](_0xccec('0x9c'),_0xccec('0x9d'));_0x57c8ab['field']('o.fullname','Owner.fullname');_0x57c8ab[_0xccec('0x3f')]('o.internal',_0xccec('0x9e'));_0x57c8ab[_0xccec('0x3f')](_0xccec('0x9f'),_0xccec('0x29'));}if(_0x5952ba['limit'])_0x57c8ab[_0xccec('0x3b')](_0x5952ba[_0xccec('0x3b')]);if(_0x5952ba[_0xccec('0x1d')])_0x57c8ab[_0xccec('0x1d')](_0x5952ba[_0xccec('0x1d')]);return db[_0xccec('0xa0')]['query'](_0x57c8ab['toString'](),_0x527369);})['then'](function(_0x280b04){_0x42ed1c[_0xccec('0x3e')](_0xccec('0xa1'),_['map'](_0x280b04,'id'));return db['sequelize'][_0xccec('0x36')](_0x42ed1c[_0xccec('0x8e')](),_0x527369)['then'](function(_0x1c93d9){var _0x8367c4=_[_0xccec('0xa2')](_0x1c93d9,_0xccec('0xa3'));var _0x108d43=[];_0x280b04[_0xccec('0x2b')](function(_0x1a52dc){_0x108d43[_0xccec('0x2c')](updateFaxInteraction(_0x1a52dc,_0x262e25,_0x8367c4));});return BPromise[_0xccec('0xa4')](_0x108d43);});});})[_0xccec('0x23')](function(_0xab8528){_0x324ca1[_0xccec('0xa5')]=_0xab8528;return _0x324ca1;})[_0xccec('0x23')](respondWithFilteredResult(_0xb0a4a7,_0x5952ba));})['catch'](handleError(_0xb0a4a7,null));};exports['show']=function(_0x2e619c,_0xe4967d){var _0x21e4e2={'raw':![],'where':{'id':_0x2e619c['params']['id']}},_0x386c7b={};_0x386c7b['model']=_['keys'](db['FaxInteraction'][_0xccec('0x30')]);_0x386c7b[_0xccec('0x36')]=_['keys'](_0x2e619c[_0xccec('0x36')]);_0x386c7b[_0xccec('0x34')]=_[_0xccec('0x35')](_0x386c7b[_0xccec('0x32')],_0x386c7b[_0xccec('0x36')]);_0x21e4e2[_0xccec('0x37')]=_['intersection'](_0x386c7b[_0xccec('0x32')],qs[_0xccec('0x38')](_0x2e619c['query']['fields']));_0x21e4e2['attributes']=_0x21e4e2[_0xccec('0x37')][_0xccec('0x39')]?_0x21e4e2[_0xccec('0x37')]:_0x386c7b[_0xccec('0x32')];if(_0x2e619c[_0xccec('0x36')]['includeAll']){_0x21e4e2[_0xccec('0xa6')]=[{'all':!![]}];}_0x21e4e2=_[_0xccec('0xa7')]({},_0x21e4e2,_0x2e619c[_0xccec('0xa8')]);return db['FaxInteraction']['find'](_0x21e4e2)[_0xccec('0x23')](handleEntityNotFound(_0xe4967d,null))[_0xccec('0x23')](respondWithResult(_0xe4967d,null))[_0xccec('0x2d')](handleError(_0xe4967d,null));};exports['create']=function(_0x52c5cc,_0x412851){return db[_0xccec('0x2f')]['create'](_0x52c5cc[_0xccec('0xa9')],{})[_0xccec('0x23')](respondWithResult(_0x412851,0xc9))[_0xccec('0x2d')](handleError(_0x412851,null));};exports['update']=function(_0x241b19,_0x3fa549){if(_0x241b19[_0xccec('0xa9')]['id']){delete _0x241b19[_0xccec('0xa9')]['id'];}return db['FaxInteraction']['find']({'where':{'id':_0x241b19[_0xccec('0xaa')]['id']}})[_0xccec('0x23')](handleEntityNotFound(_0x3fa549,null))[_0xccec('0x23')](saveUpdates(_0x241b19[_0xccec('0xa9')],null))[_0xccec('0x23')](respondWithResult(_0x3fa549,null))['catch'](handleError(_0x3fa549,null));};exports[_0xccec('0x24')]=function(_0xb7ffd2,_0x501bd6){return db[_0xccec('0x2f')]['find']({'where':{'id':_0xb7ffd2[_0xccec('0xaa')]['id']}})[_0xccec('0x23')](handleEntityNotFound(_0x501bd6,null))[_0xccec('0x23')](removeEntity(_0x501bd6,null))[_0xccec('0x2d')](handleError(_0x501bd6,null));};exports['describe']=function(_0x12faa3,_0x374a51){return db[_0xccec('0x2f')][_0xccec('0xab')]()[_0xccec('0x23')](respondWithResult(_0x374a51,null))[_0xccec('0x2d')](handleError(_0x374a51,null));};exports[_0xccec('0xac')]=function(_0x97407d,_0xf70c0,_0x10f019){return db[_0xccec('0xad')]['find']({'where':{'id':_0x97407d['params']['id']}})[_0xccec('0x23')](handleEntityNotFound(_0xf70c0,null))[_0xccec('0x23')](function(_0x267109){if(_0x267109){return _0x267109[_0xccec('0xac')](_0x97407d[_0xccec('0xa9')][_0xccec('0xae')],_['omit'](_0x97407d[_0xccec('0xa9')],[_0xccec('0xae'),'id'])||{});}})[_0xccec('0x23')](respondWithResult(_0xf70c0,null))['catch'](handleError(_0xf70c0,null));};exports[_0xccec('0xaf')]=function(_0x48dfa9,_0x5900e2,_0x3de700){var _0x3f4af8={'raw':![],'where':{}};var _0x48a35a={};var _0x2c244d={'count':0x0,'rows':[]};return db[_0xccec('0x2f')][_0xccec('0xb0')]({'where':{'id':_0x48dfa9[_0xccec('0xaa')]['id']}})[_0xccec('0x23')](handleEntityNotFound(_0x5900e2,null))[_0xccec('0x23')](function(_0x1767fd){if(_0x1767fd){_0x48a35a[_0xccec('0x32')]=_[_0xccec('0x33')](db[_0xccec('0xad')][_0xccec('0x30')]);_0x48a35a[_0xccec('0x36')]=_[_0xccec('0x33')](_0x48dfa9['query']);_0x48a35a[_0xccec('0x34')]=_[_0xccec('0x35')](_0x48a35a[_0xccec('0x32')],_0x48a35a[_0xccec('0x36')]);_0x3f4af8['attributes']=_[_0xccec('0x35')](_0x48a35a[_0xccec('0x32')],qs['fields'](_0x48dfa9[_0xccec('0x36')][_0xccec('0x38')]));_0x3f4af8[_0xccec('0x37')]=_0x3f4af8[_0xccec('0x37')][_0xccec('0x39')]?_0x3f4af8[_0xccec('0x37')]:_0x48a35a[_0xccec('0x32')];if(!_0x48dfa9[_0xccec('0x36')][_0xccec('0x3a')]('nolimit')){_0x3f4af8[_0xccec('0x3b')]=qs[_0xccec('0x3b')](_0x48dfa9['query'][_0xccec('0x3b')]);_0x3f4af8[_0xccec('0x1d')]=qs[_0xccec('0x1d')](_0x48dfa9[_0xccec('0x36')][_0xccec('0x1d')]);}_0x3f4af8['order']=qs[_0xccec('0x3d')](_0x48dfa9[_0xccec('0x36')][_0xccec('0x3d')]);_0x3f4af8['where']=qs[_0xccec('0x34')](_['pick'](_0x48dfa9[_0xccec('0x36')],_0x48a35a[_0xccec('0x34')]));_0x3f4af8['where'][_0xccec('0xa3')]=_0x1767fd['id'];if(_0x48dfa9[_0xccec('0x36')]['filter']){_0x3f4af8[_0xccec('0x3e')]=_[_0xccec('0xa7')](_0x3f4af8[_0xccec('0x3e')],{'$or':_[_0xccec('0x28')](_0x3f4af8['attributes'],function(_0x1d6922){var _0x5e16de={};_0x5e16de[_0x1d6922]={'$like':'%'+_0x48dfa9[_0xccec('0x36')][_0xccec('0x79')]+'%'};return _0x5e16de;})});}if(_0x48dfa9[_0xccec('0x36')][_0xccec('0x6d')]){var _0x855870=_0x48dfa9['query']['$gte'][_0xccec('0x5b')](',');var _0x3177b9={};_0x3177b9[_0x855870[0x0]]={'$gte':moment(_0x855870[0x1])['format'](_0xccec('0xb1'))};_0x3f4af8[_0xccec('0x3e')]=_[_0xccec('0xa7')](_0x3f4af8[_0xccec('0x3e')],_0x3177b9);}_0x3f4af8=_[_0xccec('0xa7')]({},_0x3f4af8,_0x48dfa9[_0xccec('0xa8')]);return db[_0xccec('0xad')][_0xccec('0x1c')]({'where':_0x3f4af8[_0xccec('0x3e')]})[_0xccec('0x23')](function(_0x36e37e){_0x2c244d['count']=_0x36e37e;if(_0x48dfa9['query'][_0xccec('0xb2')]){_0x3f4af8[_0xccec('0xa6')]=[{'all':!![]}];}return db[_0xccec('0xad')]['findAll'](_0x3f4af8);})['then'](function(_0x14e396){_0x2c244d['rows']=_0x14e396;return _0x2c244d;});}})[_0xccec('0x23')](respondWithFilteredResult(_0x5900e2,_0x3f4af8))[_0xccec('0x2d')](handleError(_0x5900e2,null));};exports[_0xccec('0xb3')]=function(_0x49bf95,_0x493251,_0xdba0a0){return db[_0xccec('0x2f')][_0xccec('0x54')]({'where':{'id':_0x49bf95[_0xccec('0xaa')]['id']}})['then'](handleEntityNotFound(_0x493251,null))[_0xccec('0x23')](function(_0x3eb6c7){if(_0x3eb6c7){return _0x3eb6c7['setTags'](_0x49bf95[_0xccec('0xa9')][_0xccec('0xae')],_['omit'](_0x49bf95[_0xccec('0xa9')],[_0xccec('0xae'),'id'])||{})['spread'](function(){return db[_0xccec('0x64')][_0xccec('0xb4')]({'attributes':['id',_0xccec('0x26'),'color'],'where':{'id':_0x49bf95['body'][_0xccec('0xae')]}});})['then'](function(_0x1b92bf){socket['emit'](_0xccec('0xb5'),{'id':Number(_0x49bf95[_0xccec('0xaa')]['id']),'tags':_0x1b92bf||[]});return{'id':Number(_0x49bf95[_0xccec('0xaa')]['id']),'tags':_0x1b92bf||[]};});}})[_0xccec('0x23')](respondWithResult(_0x493251,null))[_0xccec('0x2d')](handleError(_0x493251,null));};exports[_0xccec('0xb6')]=function(_0x57ac9b,_0x147f3b,_0x125abf){return db['FaxInteraction'][_0xccec('0x54')]({'where':{'id':_0x57ac9b[_0xccec('0xaa')]['id']}})['then'](handleEntityNotFound(_0x147f3b,null))[_0xccec('0x23')](function(_0x2e8ab9){if(_0x2e8ab9){return _0x2e8ab9[_0xccec('0xb6')](_0x57ac9b['query'][_0xccec('0xae')]);}})[_0xccec('0x23')](respondWithStatusCode(_0x147f3b,null))[_0xccec('0x2d')](handleError(_0x147f3b,null));};exports['download']=function(_0x31b21e,_0x4bacbe){var _0xf4e89=moment()[_0xccec('0xb7')]()[_0xccec('0x8e')]();var _0x368b09=path[_0xccec('0xb8')](config[_0xccec('0xb9')],_0xccec('0xba'),_0xccec('0xbb'),'tmp');var _0x171b21=path[_0xccec('0xb8')](config[_0xccec('0xb9')],'server','files','attachments');var _0x5cab0e=path[_0xccec('0xb8')](_0x368b09,_0xf4e89);var _0x24669a=util[_0xccec('0xbc')](_0xccec('0xbd'),_0x31b21e[_0xccec('0xaa')]['id'],_0xf4e89);var _0x4d7830=path[_0xccec('0xb8')](_0x368b09,_0x24669a);var _0xa0fdda=[];_0xa0fdda['push']({'model':db['Attachment'],'as':'Attachment','raw':!![]});var _0x4e030e=[{'model':db[_0xccec('0xad')],'as':_0xccec('0xbe'),'attributes':['id','body',_0xccec('0x6c')],'include':_0xa0fdda}];return db[_0xccec('0x2f')][_0xccec('0x54')]({'where':{'id':_0x31b21e[_0xccec('0xaa')]['id']},'include':_0x4e030e})['then'](handleEntityNotFound(_0x4bacbe,null))['then'](function(_0x5d355e){if(_0x5d355e&&_0x5d355e['Messages']){var _0xe31042=_0x5d355e[_0xccec('0xbf')]({'plain':!![]});fs[_0xccec('0xc0')](_0x5cab0e);for(var _0x1b1643=0x0;_0x1b1643<_0xe31042[_0xccec('0xbe')]['length'];_0x1b1643++){var _0x1454f5=_0xe31042['Messages'][_0x1b1643][_0xccec('0xc1')];if(_0x1454f5){var _0x33b964=path[_0xccec('0xb8')](_0x171b21,_0x1454f5[_0xccec('0xc2')]);if(fs[_0xccec('0xc3')](_0x33b964)){fs[_0xccec('0xc4')](_0x33b964)[_0xccec('0xc5')](fs['createWriteStream'](path[_0xccec('0xb8')](_0x5cab0e,_0x1454f5[_0xccec('0xc2')])));}}}return BPromise[_0xccec('0x87')]()['then'](function(){return new BPromise(function(_0x469316,_0x368f3c){zipdir(_0x5cab0e,{'saveTo':_0x4d7830},function(_0x1f1f3b,_0x3b9dcd){if(_0x1f1f3b)return _0x368f3c(_0x1f1f3b);return _0x469316(_0x3b9dcd);});})[_0xccec('0x23')](function(){return new BPromise(function(_0x4ae550,_0x4df6a3){rimraf(_0x5cab0e,function(_0xc784c1){if(_0xc784c1)_0x4df6a3(_0xc784c1);return _0x4ae550();});});})['then'](function(){return _0x4bacbe[_0xccec('0xc6')](_0x4d7830,_0x24669a,function(_0x35ac58){if(_0x35ac58){console[_0xccec('0xc7')]('err',_0x35ac58);}else{fs[_0xccec('0xc8')](_0x4d7830);}});});});}else{return _0x4bacbe['sendStatus'](0xc8);}})[_0xccec('0x2d')](handleError(_0x4bacbe,null));};
\ No newline at end of file
diff --git a/server/api/faxInteraction/faxInteraction.events.js b/server/api/faxInteraction/faxInteraction.events.js
index 0748749..010535c 100644
--- a/server/api/faxInteraction/faxInteraction.events.js
+++ b/server/api/faxInteraction/faxInteraction.events.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x814b=['then','Users','map','findAll','setDataValue','unreadMessages','length','emit','hasOwnProperty','exports','events','../../mysqldb','FaxInteraction','FaxMessage','setMaxListeners','update','remove'];(function(_0x5a8678,_0x2b834d){var _0x117447=function(_0x4b938f){while(--_0x4b938f){_0x5a8678['push'](_0x5a8678['shift']());}};_0x117447(++_0x2b834d);}(_0x814b,0x1a2));var _0xb814=function(_0x19997d,_0x2c92a4){_0x19997d=_0x19997d-0x0;var _0x49be7f=_0x814b[_0x19997d];return _0x49be7f;};'use strict';var EventEmitter=require(_0xb814('0x0'));var FaxInteraction=require(_0xb814('0x1'))['db'][_0xb814('0x2')];var FaxMessage=require(_0xb814('0x1'))['db'][_0xb814('0x3')];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents[_0xb814('0x4')](0x0);var events={'afterCreate':'save','afterUpdate':_0xb814('0x5'),'afterDestroy':_0xb814('0x6')};function emitEvent(_0x258866){return function(_0x4237bc,_0x44931c,_0x322a70){_0x4237bc['getUsers']({'attributes':['id'],'raw':!![]})[_0xb814('0x7')](function(_0x2e6272){_0x4237bc['setDataValue'](_0xb814('0x8'),_0x2e6272[_0xb814('0x9')](function(_0x186d5a){return{'id':_0x186d5a['id']};}));return FaxMessage[_0xb814('0xa')]({'where':{'FaxInteractionId':_0x4237bc['id'],'direction':'in','read':![]},'raw':!![]});})[_0xb814('0x7')](function(_0x21d4a5){_0x4237bc[_0xb814('0xb')](_0xb814('0xc'),_0x21d4a5[_0xb814('0xd')]);FaxInteractionEvents[_0xb814('0xe')](_0x258866+':'+_0x4237bc['id'],_0x4237bc);FaxInteractionEvents[_0xb814('0xe')](_0x258866,_0x4237bc);_0x322a70(null);})['catch'](_0x322a70(null));};}for(var e in events){if(events[_0xb814('0xf')](e)){var event=events[e];FaxInteraction['hook'](e,emitEvent(event));}}module[_0xb814('0x10')]=FaxInteractionEvents;
\ No newline at end of file
+var _0x7a54=['setDataValue','map','length','catch','hasOwnProperty','hook','exports','events','../../mysqldb','FaxInteraction','FaxMessage','setMaxListeners','update','remove','getUsers'];(function(_0x194f9a,_0x4378c4){var _0x5702e1=function(_0x1472ed){while(--_0x1472ed){_0x194f9a['push'](_0x194f9a['shift']());}};_0x5702e1(++_0x4378c4);}(_0x7a54,0x106));var _0x47a5=function(_0x348058,_0x87f573){_0x348058=_0x348058-0x0;var _0x23e141=_0x7a54[_0x348058];return _0x23e141;};'use strict';var EventEmitter=require(_0x47a5('0x0'));var FaxInteraction=require(_0x47a5('0x1'))['db'][_0x47a5('0x2')];var FaxMessage=require('../../mysqldb')['db'][_0x47a5('0x3')];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents[_0x47a5('0x4')](0x0);var events={'afterCreate':'save','afterUpdate':_0x47a5('0x5'),'afterDestroy':_0x47a5('0x6')};function emitEvent(_0x2a1a7e){return function(_0x3717e1,_0xfdf934,_0x545a97){_0x3717e1[_0x47a5('0x7')]({'attributes':['id'],'raw':!![]})['then'](function(_0x343372){_0x3717e1[_0x47a5('0x8')]('Users',_0x343372[_0x47a5('0x9')](function(_0x5077f3){return{'id':_0x5077f3['id']};}));return FaxMessage['findAll']({'where':{'FaxInteractionId':_0x3717e1['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x2a0e98){_0x3717e1[_0x47a5('0x8')]('unreadMessages',_0x2a0e98[_0x47a5('0xa')]);FaxInteractionEvents['emit'](_0x2a1a7e+':'+_0x3717e1['id'],_0x3717e1);FaxInteractionEvents['emit'](_0x2a1a7e,_0x3717e1);_0x545a97(null);})[_0x47a5('0xb')](_0x545a97(null));};}for(var e in events){if(events[_0x47a5('0xc')](e)){var event=events[e];FaxInteraction[_0x47a5('0xd')](e,emitEvent(event));}}module[_0x47a5('0xe')]=FaxInteractionEvents;
\ No newline at end of file
diff --git a/server/api/faxInteraction/faxInteraction.model.js b/server/api/faxInteraction/faxInteraction.model.js
index eedb2f7..f70ce5d 100644
--- a/server/api/faxInteraction/faxInteraction.model.js
+++ b/server/api/faxInteraction/faxInteraction.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xd2ea=['path','rimraf','../../config/environment','./faxInteraction.attributes','exports','define','FaxInteraction','fax_interactions','closed','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','api','moment','request-promise'];(function(_0x2d4c3b,_0x504b57){var _0x4200f7=function(_0x3d299f){while(--_0x3d299f){_0x2d4c3b['push'](_0x2d4c3b['shift']());}};_0x4200f7(++_0x504b57);}(_0xd2ea,0x15f));var _0xad2e=function(_0x1e3e1e,_0x45192a){_0x1e3e1e=_0x1e3e1e-0x0;var _0x5369ee=_0xd2ea[_0x1e3e1e];return _0x5369ee;};'use strict';var _=require(_0xad2e('0x0'));var util=require(_0xad2e('0x1'));var logger=require(_0xad2e('0x2'))(_0xad2e('0x3'));var moment=require(_0xad2e('0x4'));var BPromise=require('bluebird');var rp=require(_0xad2e('0x5'));var fs=require('fs');var path=require(_0xad2e('0x6'));var rimraf=require(_0xad2e('0x7'));var config=require(_0xad2e('0x8'));var attributes=require(_0xad2e('0x9'));module[_0xad2e('0xa')]=function(_0x29e97f,_0x592e8b){return _0x29e97f[_0xad2e('0xb')](_0xad2e('0xc'),attributes,{'tableName':_0xad2e('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x5710ac,_0x1e0e9e,_0x19bb0d){if(_0x5710ac['changed'](_0xad2e('0xe'))){_0x5710ac['closedAt']=moment()[_0xad2e('0xf')](_0xad2e('0x10'));}_0x19bb0d(null,_0x5710ac);}}});};
\ No newline at end of file
+var _0xb4e6=['closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./faxInteraction.attributes','exports','define','changed'];(function(_0x280141,_0x220806){var _0x38fd1e=function(_0x182c8c){while(--_0x182c8c){_0x280141['push'](_0x280141['shift']());}};_0x38fd1e(++_0x220806);}(_0xb4e6,0x1f4));var _0x6b4e=function(_0x37cc52,_0x459a9b){_0x37cc52=_0x37cc52-0x0;var _0x2b4a90=_0xb4e6[_0x37cc52];return _0x2b4a90;};'use strict';var _=require(_0x6b4e('0x0'));var util=require('util');var logger=require(_0x6b4e('0x1'))(_0x6b4e('0x2'));var moment=require(_0x6b4e('0x3'));var BPromise=require(_0x6b4e('0x4'));var rp=require(_0x6b4e('0x5'));var fs=require('fs');var path=require(_0x6b4e('0x6'));var rimraf=require(_0x6b4e('0x7'));var config=require('../../config/environment');var attributes=require(_0x6b4e('0x8'));module[_0x6b4e('0x9')]=function(_0x1f67a2,_0x49de51){return _0x1f67a2[_0x6b4e('0xa')]('FaxInteraction',attributes,{'tableName':'fax_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x2311d9,_0x48c870,_0x53a71f){if(_0x2311d9[_0x6b4e('0xb')](_0x6b4e('0xc'))){_0x2311d9[_0x6b4e('0xd')]=moment()[_0x6b4e('0xe')](_0x6b4e('0xf'));}_0x53a71f(null,_0x2311d9);}}});};
\ No newline at end of file
diff --git a/server/api/faxInteraction/faxInteraction.rpc.js b/server/api/faxInteraction/faxInteraction.rpc.js
index 1444781..230ff68 100644
--- a/server/api/faxInteraction/faxInteraction.rpc.js
+++ b/server/api/faxInteraction/faxInteraction.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xdf1d=['message','info','catch','UpdateFaxInteraction','update','body','options','raw','where','attributes','AddTagsToFaxInteraction','FaxInteraction','find','addTags','omit','ids','AddTags','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','register','request','then','FaxInteraction,\x20%s,\x20%s','request\x20sent','debug','FaxInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x314e35,_0x568de3){var _0x449332=function(_0x30d84b){while(--_0x30d84b){_0x314e35['push'](_0x314e35['shift']());}};_0x449332(++_0x568de3);}(_0xdf1d,0x179));var _0xddf1=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0xdf1d[_0x4b369d];return _0x571a98;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xddf1('0x0'));var BPromise=require(_0xddf1('0x1'));var rs=require(_0xddf1('0x2'));var fs=require('fs');var Redis=require(_0xddf1('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xddf1('0x4'));var logger=require(_0xddf1('0x5'))('rpc');var config=require(_0xddf1('0x6'));var jayson=require(_0xddf1('0x7'));var client=jayson[_0xddf1('0x8')][_0xddf1('0x9')]({'port':0x232a});config['redis']=_['defaults'](config[_0xddf1('0xa')],{'host':_0xddf1('0xb'),'port':0x18eb});var socket=require(_0xddf1('0xc'))(new Redis(config['redis']));require('./faxInteraction.socket')[_0xddf1('0xd')](socket);function respondWithRpcPromise(_0x2b3198,_0x4a3940,_0x1a76b0){return new BPromise(function(_0x104462,_0x6b963d){return client[_0xddf1('0xe')](_0x2b3198,_0x1a76b0)[_0xddf1('0xf')](function(_0x5c631e){logger['info'](_0xddf1('0x10'),_0x4a3940,_0xddf1('0x11'));logger[_0xddf1('0x12')](_0xddf1('0x13'),_0x4a3940,'request\x20sent',JSON[_0xddf1('0x14')](_0x5c631e));if(_0x5c631e[_0xddf1('0x15')]){if(_0x5c631e['error'][_0xddf1('0x16')]===0x1f4){logger[_0xddf1('0x15')](_0xddf1('0x10'),_0x4a3940,_0x5c631e[_0xddf1('0x15')][_0xddf1('0x17')]);return _0x6b963d(_0x5c631e[_0xddf1('0x15')][_0xddf1('0x17')]);}logger[_0xddf1('0x15')](_0xddf1('0x10'),_0x4a3940,_0x5c631e[_0xddf1('0x15')][_0xddf1('0x17')]);return _0x104462(_0x5c631e[_0xddf1('0x15')][_0xddf1('0x17')]);}else{logger[_0xddf1('0x18')](_0xddf1('0x10'),_0x4a3940,_0xddf1('0x11'));_0x104462(_0x5c631e['result'][_0xddf1('0x17')]);}})[_0xddf1('0x19')](function(_0x5dbc64){logger[_0xddf1('0x15')]('FaxInteraction,\x20%s,\x20%s',_0x4a3940,_0x5dbc64);_0x6b963d(_0x5dbc64);});});}exports[_0xddf1('0x1a')]=function(_0xa7b021){var _0x3b3210=this;return new Promise(function(_0x44270d,_0x5849c8){return db['FaxInteraction'][_0xddf1('0x1b')](_0xa7b021[_0xddf1('0x1c')],{'raw':_0xa7b021[_0xddf1('0x1d')]?_0xa7b021[_0xddf1('0x1d')][_0xddf1('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xa7b021['options']?_0xa7b021[_0xddf1('0x1d')][_0xddf1('0x1f')]||null:null,'attributes':_0xa7b021[_0xddf1('0x1d')]?_0xa7b021[_0xddf1('0x1d')][_0xddf1('0x20')]||null:null,'limit':_0xa7b021[_0xddf1('0x1d')]?_0xa7b021['options']['limit']||null:null})['then'](function(_0x4ea4ff){logger['info'](_0xddf1('0x1a'),_0xa7b021);logger[_0xddf1('0x12')](_0xddf1('0x1a'),_0xa7b021,JSON[_0xddf1('0x14')](_0x4ea4ff));_0x44270d(_0x4ea4ff);})[_0xddf1('0x19')](function(_0x248a64){logger[_0xddf1('0x15')]('UpdateFaxInteraction',_0x248a64[_0xddf1('0x17')],_0xa7b021);_0x5849c8(_0x3b3210[_0xddf1('0x15')](0x1f4,_0x248a64['message']));});});};exports[_0xddf1('0x21')]=function(_0x52764c){return new Promise(function(_0x7c50f5,_0x241898){return db[_0xddf1('0x22')][_0xddf1('0x23')]({'where':_0x52764c['options']?_0x52764c[_0xddf1('0x1d')][_0xddf1('0x1f')]||null:null})[_0xddf1('0xf')](function(_0x19eb66){if(_0x19eb66){return _0x19eb66[_0xddf1('0x24')](_0x52764c[_0xddf1('0x1c')]['ids'],_[_0xddf1('0x25')](_0x52764c[_0xddf1('0x1c')],[_0xddf1('0x26'),'id'])||{});}})['spread'](function(_0x2f7ebc){logger[_0xddf1('0x18')](_0xddf1('0x27'),_0x52764c);logger[_0xddf1('0x12')](_0xddf1('0x27'),_0x52764c,JSON['stringify'](_0x2f7ebc));_0x7c50f5(_0x2f7ebc);})['catch'](function(_0x2e096c){logger[_0xddf1('0x15')]('AddTags',_0x2e096c[_0xddf1('0x17')],_0x52764c);_0x241898(_this[_0xddf1('0x15')](0x1f4,_0x2e096c[_0xddf1('0x17')]));});});};
\ No newline at end of file
+var _0xa5e9=['request','then','info','FaxInteraction,\x20%s,\x20%s','request\x20sent','debug','FaxInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','FaxInteraction','update','body','options','raw','where','attributes','limit','UpdateFaxInteraction','catch','find','addTags','ids','omit','spread','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','redis','localhost','socket.io-emitter','./faxInteraction.socket','register'];(function(_0x160c73,_0x2ee678){var _0xd9302=function(_0x169454){while(--_0x169454){_0x160c73['push'](_0x160c73['shift']());}};_0xd9302(++_0x2ee678);}(_0xa5e9,0xec));var _0x9a5e=function(_0x245afe,_0x319cde){_0x245afe=_0x245afe-0x0;var _0x4eefde=_0xa5e9[_0x245afe];return _0x4eefde;};'use strict';var _=require(_0x9a5e('0x0'));var util=require(_0x9a5e('0x1'));var moment=require(_0x9a5e('0x2'));var BPromise=require('bluebird');var rs=require(_0x9a5e('0x3'));var fs=require('fs');var Redis=require(_0x9a5e('0x4'));var db=require(_0x9a5e('0x5'))['db'];var utils=require(_0x9a5e('0x6'));var logger=require(_0x9a5e('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x9a5e('0x8'));var client=jayson[_0x9a5e('0x9')][_0x9a5e('0xa')]({'port':0x232a});config[_0x9a5e('0xb')]=_['defaults'](config['redis'],{'host':_0x9a5e('0xc'),'port':0x18eb});var socket=require(_0x9a5e('0xd'))(new Redis(config['redis']));require(_0x9a5e('0xe'))[_0x9a5e('0xf')](socket);function respondWithRpcPromise(_0x36ce72,_0x42d1be,_0x36788b){return new BPromise(function(_0x165a68,_0x3fab30){return client[_0x9a5e('0x10')](_0x36ce72,_0x36788b)[_0x9a5e('0x11')](function(_0x325f25){logger[_0x9a5e('0x12')](_0x9a5e('0x13'),_0x42d1be,_0x9a5e('0x14'));logger[_0x9a5e('0x15')](_0x9a5e('0x16'),_0x42d1be,_0x9a5e('0x14'),JSON[_0x9a5e('0x17')](_0x325f25));if(_0x325f25[_0x9a5e('0x18')]){if(_0x325f25[_0x9a5e('0x18')][_0x9a5e('0x19')]===0x1f4){logger[_0x9a5e('0x18')](_0x9a5e('0x13'),_0x42d1be,_0x325f25[_0x9a5e('0x18')]['message']);return _0x3fab30(_0x325f25[_0x9a5e('0x18')][_0x9a5e('0x1a')]);}logger[_0x9a5e('0x18')](_0x9a5e('0x13'),_0x42d1be,_0x325f25[_0x9a5e('0x18')][_0x9a5e('0x1a')]);return _0x165a68(_0x325f25[_0x9a5e('0x18')][_0x9a5e('0x1a')]);}else{logger[_0x9a5e('0x12')](_0x9a5e('0x13'),_0x42d1be,_0x9a5e('0x14'));_0x165a68(_0x325f25['result'][_0x9a5e('0x1a')]);}})['catch'](function(_0x237fa7){logger[_0x9a5e('0x18')]('FaxInteraction,\x20%s,\x20%s',_0x42d1be,_0x237fa7);_0x3fab30(_0x237fa7);});});}exports['UpdateFaxInteraction']=function(_0x592eef){var _0x3e9e94=this;return new Promise(function(_0x4f0856,_0x2a2464){return db[_0x9a5e('0x1b')][_0x9a5e('0x1c')](_0x592eef[_0x9a5e('0x1d')],{'raw':_0x592eef[_0x9a5e('0x1e')]?_0x592eef['options'][_0x9a5e('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x592eef[_0x9a5e('0x1e')]?_0x592eef[_0x9a5e('0x1e')][_0x9a5e('0x20')]||null:null,'attributes':_0x592eef[_0x9a5e('0x1e')]?_0x592eef['options'][_0x9a5e('0x21')]||null:null,'limit':_0x592eef[_0x9a5e('0x1e')]?_0x592eef[_0x9a5e('0x1e')][_0x9a5e('0x22')]||null:null})[_0x9a5e('0x11')](function(_0x1141b9){logger[_0x9a5e('0x12')](_0x9a5e('0x23'),_0x592eef);logger[_0x9a5e('0x15')](_0x9a5e('0x23'),_0x592eef,JSON[_0x9a5e('0x17')](_0x1141b9));_0x4f0856(_0x1141b9);})[_0x9a5e('0x24')](function(_0x343389){logger['error'](_0x9a5e('0x23'),_0x343389[_0x9a5e('0x1a')],_0x592eef);_0x2a2464(_0x3e9e94[_0x9a5e('0x18')](0x1f4,_0x343389[_0x9a5e('0x1a')]));});});};exports['AddTagsToFaxInteraction']=function(_0x2bf9a2){return new Promise(function(_0x22b69f,_0x29dd6b){return db['FaxInteraction'][_0x9a5e('0x25')]({'where':_0x2bf9a2['options']?_0x2bf9a2['options']['where']||null:null})[_0x9a5e('0x11')](function(_0x199741){if(_0x199741){return _0x199741[_0x9a5e('0x26')](_0x2bf9a2['body'][_0x9a5e('0x27')],_[_0x9a5e('0x28')](_0x2bf9a2['body'],[_0x9a5e('0x27'),'id'])||{});}})[_0x9a5e('0x29')](function(_0x472059){logger[_0x9a5e('0x12')]('AddTags',_0x2bf9a2);logger['debug']('AddTags',_0x2bf9a2,JSON[_0x9a5e('0x17')](_0x472059));_0x22b69f(_0x472059);})[_0x9a5e('0x24')](function(_0x18dd1a){logger['error']('AddTags',_0x18dd1a[_0x9a5e('0x1a')],_0x2bf9a2);_0x29dd6b(_this['error'](0x1f4,_0x18dd1a[_0x9a5e('0x1a')]));});});};
\ No newline at end of file
diff --git a/server/api/faxInteraction/faxInteraction.socket.js b/server/api/faxInteraction/faxInteraction.socket.js
index 61eda9a..bcf4804 100644
--- a/server/api/faxInteraction/faxInteraction.socket.js
+++ b/server/api/faxInteraction/faxInteraction.socket.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7a91=['save','remove','update','emit','removeListener','length','./faxInteraction.events'];(function(_0x5c9b55,_0x5befc4){var _0x113969=function(_0x5a404d){while(--_0x5a404d){_0x5c9b55['push'](_0x5c9b55['shift']());}};_0x113969(++_0x5befc4);}(_0x7a91,0x12c));var _0x17a9=function(_0xa63ea3,_0x4367ff){_0xa63ea3=_0xa63ea3-0x0;var _0x2aa5ff=_0x7a91[_0xa63ea3];return _0x2aa5ff;};'use strict';var FaxInteractionEvents=require(_0x17a9('0x0'));var events=[_0x17a9('0x1'),_0x17a9('0x2'),_0x17a9('0x3')];function createListener(_0x149469,_0x3bebd2){return function(_0x4c1fc4){_0x3bebd2[_0x17a9('0x4')](_0x149469,_0x4c1fc4);};}function removeListener(_0x28ead3,_0x2d82c8){return function(){FaxInteractionEvents[_0x17a9('0x5')](_0x28ead3,_0x2d82c8);};}exports['register']=function(_0x50674b){for(var _0x15e630=0x0,_0x2ff547=events[_0x17a9('0x6')];_0x15e630<_0x2ff547;_0x15e630++){var _0x21935b=events[_0x15e630];var _0xabaca=createListener('faxInteraction:'+_0x21935b,_0x50674b);FaxInteractionEvents['on'](_0x21935b,_0xabaca);}};
\ No newline at end of file
+var _0x1745=['removeListener','register','length','faxInteraction:','save','remove','update'];(function(_0x33f7e1,_0x48d209){var _0x23bab4=function(_0xd532b0){while(--_0xd532b0){_0x33f7e1['push'](_0x33f7e1['shift']());}};_0x23bab4(++_0x48d209);}(_0x1745,0x177));var _0x5174=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x1745[_0x4cf98e];return _0x1623ac;};'use strict';var FaxInteractionEvents=require('./faxInteraction.events');var events=[_0x5174('0x0'),_0x5174('0x1'),_0x5174('0x2')];function createListener(_0x216859,_0x448f4f){return function(_0xb0fe72){_0x448f4f['emit'](_0x216859,_0xb0fe72);};}function removeListener(_0x20dd63,_0x12d2c8){return function(){FaxInteractionEvents[_0x5174('0x3')](_0x20dd63,_0x12d2c8);};}exports[_0x5174('0x4')]=function(_0x11aea7){for(var _0x326111=0x0,_0x3d34d0=events[_0x5174('0x5')];_0x326111<_0x3d34d0;_0x326111++){var _0x29827e=events[_0x326111];var _0x270891=createListener(_0x5174('0x6')+_0x29827e,_0x11aea7);FaxInteractionEvents['on'](_0x29827e,_0x270891);}};
\ No newline at end of file
diff --git a/server/api/faxInteraction/index.js b/server/api/faxInteraction/index.js
index b76f4b4..3471b81 100644
--- a/server/api/faxInteraction/index.js
+++ b/server/api/faxInteraction/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x3cec=['isAuthenticated','index','/describe','describe','/:id','show','/:id/messages','getMessages','/:id/download','download','create','addMessage','/:id/tags','tracked','fax','faxinteraction:update','update','delete','destroy','removeTags','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./faxInteraction.controller','get'];(function(_0x5bc4e2,_0x427ff9){var _0x4c93f9=function(_0x1e8546){while(--_0x1e8546){_0x5bc4e2['push'](_0x5bc4e2['shift']());}};_0x4c93f9(++_0x427ff9);}(_0x3cec,0xb0));var _0xc3ce=function(_0x30ef62,_0x372cdd){_0x30ef62=_0x30ef62-0x0;var _0x32b26d=_0x3cec[_0x30ef62];return _0x32b26d;};'use strict';var multer=require(_0xc3ce('0x0'));var util=require(_0xc3ce('0x1'));var path=require(_0xc3ce('0x2'));var timeout=require(_0xc3ce('0x3'));var express=require(_0xc3ce('0x4'));var router=express[_0xc3ce('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0xc3ce('0x6'));var config=require(_0xc3ce('0x7'));var controller=require(_0xc3ce('0x8'));router[_0xc3ce('0x9')]('/',auth[_0xc3ce('0xa')](),controller[_0xc3ce('0xb')]);router[_0xc3ce('0x9')](_0xc3ce('0xc'),auth[_0xc3ce('0xa')](),controller[_0xc3ce('0xd')]);router[_0xc3ce('0x9')](_0xc3ce('0xe'),auth[_0xc3ce('0xa')](),controller[_0xc3ce('0xf')]);router['get'](_0xc3ce('0x10'),auth['isAuthenticated'](),controller[_0xc3ce('0x11')]);router[_0xc3ce('0x9')](_0xc3ce('0x12'),auth[_0xc3ce('0xa')](),controller[_0xc3ce('0x13')]);router['post']('/',auth['isAuthenticated'](),controller[_0xc3ce('0x14')]);router['post'](_0xc3ce('0x10'),auth[_0xc3ce('0xa')](),controller[_0xc3ce('0x15')]);router['post'](_0xc3ce('0x16'),auth[_0xc3ce('0xa')](),interaction[_0xc3ce('0x17')](_0xc3ce('0x18'),'faxinteraction:addtags'),controller['addTags']);router['put'](_0xc3ce('0xe'),auth[_0xc3ce('0xa')](),interaction['tracked'](_0xc3ce('0x18'),_0xc3ce('0x19')),controller[_0xc3ce('0x1a')]);router[_0xc3ce('0x1b')](_0xc3ce('0xe'),auth[_0xc3ce('0xa')](),interaction[_0xc3ce('0x17')]('fax','faxinteraction:destroy'),controller[_0xc3ce('0x1c')]);router[_0xc3ce('0x1b')](_0xc3ce('0x16'),auth[_0xc3ce('0xa')](),controller[_0xc3ce('0x1d')]);module[_0xc3ce('0x1e')]=router;
\ No newline at end of file
+var _0x7264=['/:id/tags','tracked','fax','put','update','faxinteraction:destroy','delete','removeTags','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxInteraction.controller','get','index','/describe','/:id','isAuthenticated','show','getMessages','/:id/download','download','create','post','addMessage'];(function(_0x479011,_0x3f5155){var _0x4f3c39=function(_0x4e250c){while(--_0x4e250c){_0x479011['push'](_0x479011['shift']());}};_0x4f3c39(++_0x3f5155);}(_0x7264,0xf0));var _0x4726=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x7264[_0x501510];return _0x1e6ee5;};'use strict';var multer=require(_0x4726('0x0'));var util=require('util');var path=require(_0x4726('0x1'));var timeout=require(_0x4726('0x2'));var express=require(_0x4726('0x3'));var router=express[_0x4726('0x4')]();var auth=require(_0x4726('0x5'));var interaction=require(_0x4726('0x6'));var config=require(_0x4726('0x7'));var controller=require(_0x4726('0x8'));router[_0x4726('0x9')]('/',auth['isAuthenticated'](),controller[_0x4726('0xa')]);router[_0x4726('0x9')](_0x4726('0xb'),auth['isAuthenticated'](),controller['describe']);router[_0x4726('0x9')](_0x4726('0xc'),auth[_0x4726('0xd')](),controller[_0x4726('0xe')]);router[_0x4726('0x9')]('/:id/messages',auth[_0x4726('0xd')](),controller[_0x4726('0xf')]);router[_0x4726('0x9')](_0x4726('0x10'),auth[_0x4726('0xd')](),controller[_0x4726('0x11')]);router['post']('/',auth[_0x4726('0xd')](),controller[_0x4726('0x12')]);router[_0x4726('0x13')]('/:id/messages',auth[_0x4726('0xd')](),controller[_0x4726('0x14')]);router[_0x4726('0x13')](_0x4726('0x15'),auth[_0x4726('0xd')](),interaction[_0x4726('0x16')](_0x4726('0x17'),'faxinteraction:addtags'),controller['addTags']);router[_0x4726('0x18')]('/:id',auth['isAuthenticated'](),interaction[_0x4726('0x16')](_0x4726('0x17'),'faxinteraction:update'),controller[_0x4726('0x19')]);router['delete']('/:id',auth['isAuthenticated'](),interaction[_0x4726('0x16')]('fax',_0x4726('0x1a')),controller['destroy']);router[_0x4726('0x1b')](_0x4726('0x15'),auth[_0x4726('0xd')](),controller[_0x4726('0x1c')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/faxMessage/faxMessage.attributes.js b/server/api/faxMessage/faxMessage.attributes.js
index 521e504..ce8f98c 100644
--- a/server/api/faxMessage/faxMessage.attributes.js
+++ b/server/api/faxMessage/faxMessage.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x07fb=['ENUM','DATE','sequelize','exports','TEXT','medium','BOOLEAN'];(function(_0x3e5086,_0x48f4a2){var _0xfeb102=function(_0x5a945f){while(--_0x5a945f){_0x3e5086['push'](_0x3e5086['shift']());}};_0xfeb102(++_0x48f4a2);}(_0x07fb,0x159));var _0xb07f=function(_0x174833,_0x4f5b0a){_0x174833=_0x174833-0x0;var _0x2b2f9c=_0x07fb[_0x174833];return _0x2b2f9c;};'use strict';var Sequelize=require(_0xb07f('0x0'));module[_0xb07f('0x1')]={'body':{'type':Sequelize[_0xb07f('0x2')](_0xb07f('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0xb07f('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0xb07f('0x5')]('in','out'),'defaultValue':'out','allowNull':![]},'failMessage':{'type':Sequelize[_0xb07f('0x2')],'defaultValue':null},'readAt':{'type':Sequelize[_0xb07f('0x6')]}};
\ No newline at end of file
+var _0x9458=['exports','TEXT','medium','BOOLEAN','ENUM','out','DATE'];(function(_0xa8883,_0x1f107f){var _0x479426=function(_0x4e56b9){while(--_0x4e56b9){_0xa8883['push'](_0xa8883['shift']());}};_0x479426(++_0x1f107f);}(_0x9458,0x188));var _0x8945=function(_0x1f0cfe,_0x33fa8e){_0x1f0cfe=_0x1f0cfe-0x0;var _0x4e6421=_0x9458[_0x1f0cfe];return _0x4e6421;};'use strict';var Sequelize=require('sequelize');module[_0x8945('0x0')]={'body':{'type':Sequelize[_0x8945('0x1')](_0x8945('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x8945('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0x8945('0x4')]('in','out'),'defaultValue':_0x8945('0x5'),'allowNull':![]},'failMessage':{'type':Sequelize[_0x8945('0x1')],'defaultValue':null},'readAt':{'type':Sequelize[_0x8945('0x6')]}};
\ No newline at end of file
diff --git a/server/api/faxMessage/faxMessage.controller.js b/server/api/faxMessage/faxMessage.controller.js
index 4b23162..b04cd7f 100644
--- a/server/api/faxMessage/faxMessage.controller.js
+++ b/server/api/faxMessage/faxMessage.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xd2a2=['find','body','describe','../../config/logger','fax-interactions','accept','fax','read','readAt','YYYY-MM-DD\x20HH:mm:ss','CmContact','Contact','get','FaxInteraction','FaxInteractionId','UserId','isNil','interaction','[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','stringify','AcceptMessage','acceptMessage','manual','interface','SIP/%s','channel','EventManager','agent','[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','RejectMessage','format','event','rejectmessage','create','findOne','ContactId','Attachment','AttachmentId','SendFax','/var/opt/motion2/server/files/attachments/%s','basename','download','server','files','join','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','path','to-csv','lodash','squel','jsforce','desk.js','querystring','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../mysqldb','redis','defaults','socket.io-emitter','./faxMessage.socket','jayson/promise','client','http','test','Sequelize','ValidationError','request','then','info','FaxMessage,\x20%s,\x20%s','request\x20sent','FaxMessage,\x20%s,\x20%s,\x20%s','error','message','catch','status','end','json','count','offset','limit','set','Content-Range','reject','save','update','destroy','sendStatus','stack','name','send','index','map','FaxMessage','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','merge','filter','options','includeAll','include','rows','show','params','length'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xd2a2,0x134));var _0x2d2a=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0xd2a2[_0x3bf83f];return _0x22c4a9;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x2d2a('0x0'));var rimraf=require(_0x2d2a('0x1'));var zipdir=require(_0x2d2a('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x2d2a('0x3'));var moment=require(_0x2d2a('0x4'));var BPromise=require(_0x2d2a('0x5'));var Mustache=require('mustache');var util=require(_0x2d2a('0x6'));var path=require(_0x2d2a('0x7'));var sox=require('sox');var csv=require(_0x2d2a('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x2d2a('0x9'));var squel=require(_0x2d2a('0xa'));var crypto=require('crypto');var jsforce=require(_0x2d2a('0xb'));var deskjs=require(_0x2d2a('0xc'));var toCsv=require(_0x2d2a('0x8'));var querystring=require(_0x2d2a('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x2d2a('0xe'));var hardwareService=require(_0x2d2a('0xf'));var logger=require('../../config/logger')(_0x2d2a('0x10'));var utils=require(_0x2d2a('0x11'));var config=require('../../config/environment');var db=require(_0x2d2a('0x12'))['db'];config[_0x2d2a('0x13')]=_[_0x2d2a('0x14')](config[_0x2d2a('0x13')],{'host':'localhost','port':0x18eb});var socket=require(_0x2d2a('0x15'))(new Redis(config['redis']));require(_0x2d2a('0x16'))['register'](socket);var jayson=require(_0x2d2a('0x17'));var client=jayson[_0x2d2a('0x18')][_0x2d2a('0x19')]({'port':0x232c});var client9002=jayson[_0x2d2a('0x18')]['http']({'port':0x232a});function checkPasswordPattern(_0x9386de,_0x5eeeeb,_0x4ed5e7){if(_0x4ed5e7){var _0x4348fa=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x4348fa[_0x2d2a('0x1a')](_0x5eeeeb)){return _0x9386de;}else{throw new db[(_0x2d2a('0x1b'))][(_0x2d2a('0x1c'))]('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x9386de;}}function respondWithRpcPromise(_0x2faf17,_0x1778af,_0x2411b5,_0x3f1cc7){return new BPromise(function(_0x3bf8f4,_0x4adb31){var _0x567d3f=_0x3f1cc7||client;return _0x567d3f[_0x2d2a('0x1d')](_0x2faf17,_0x2411b5)[_0x2d2a('0x1e')](function(_0x3697e1){logger[_0x2d2a('0x1f')](_0x2d2a('0x20'),_0x1778af,_0x2d2a('0x21'));logger['debug'](_0x2d2a('0x22'),_0x1778af,_0x2d2a('0x21'),JSON['stringify'](_0x3697e1));if(_0x3697e1[_0x2d2a('0x23')]){if(_0x3697e1[_0x2d2a('0x23')]['code']===0x1f4){logger[_0x2d2a('0x23')]('FaxMessage,\x20%s,\x20%s',_0x1778af,_0x3697e1['error']['message']);return _0x4adb31(_0x3697e1['error'][_0x2d2a('0x24')]);}logger['error'](_0x2d2a('0x20'),_0x1778af,_0x3697e1[_0x2d2a('0x23')][_0x2d2a('0x24')]);return _0x3bf8f4(_0x3697e1[_0x2d2a('0x23')][_0x2d2a('0x24')]);}else{logger['info'](_0x2d2a('0x20'),_0x1778af,_0x2d2a('0x21'));_0x3bf8f4(_0x3697e1['result'][_0x2d2a('0x24')]);}})[_0x2d2a('0x25')](function(_0x399b6e){logger[_0x2d2a('0x23')](_0x2d2a('0x20'),_0x1778af,_0x399b6e);_0x4adb31(_0x399b6e);});});}function respondWithStatusCode(_0x34a266,_0x3d8659){_0x3d8659=_0x3d8659||0xcc;return function(_0x5dd35b){if(_0x5dd35b){return _0x34a266['sendStatus'](_0x3d8659);}return _0x34a266[_0x2d2a('0x26')](_0x3d8659)[_0x2d2a('0x27')]();};}function respondWithResult(_0x5e7557,_0x4ac366){_0x4ac366=_0x4ac366||0xc8;return function(_0x5cfb51){if(_0x5cfb51){return _0x5e7557[_0x2d2a('0x26')](_0x4ac366)[_0x2d2a('0x28')](_0x5cfb51);}};}function respondWithFilteredResult(_0x2b6444,_0x7f8584){return function(_0x90333){if(_0x90333){var _0x12d9ba=_0x90333[_0x2d2a('0x29')],_0x511538=_0x7f8584['offset'],_0x32c234=_0x7f8584[_0x2d2a('0x2a')]+_0x7f8584[_0x2d2a('0x2b')],_0x3af3b0;if(_0x32c234>=_0x12d9ba){_0x32c234=_0x12d9ba;_0x3af3b0=0xc8;}else{_0x3af3b0=0xce;}_0x2b6444[_0x2d2a('0x26')](_0x3af3b0);return _0x2b6444[_0x2d2a('0x2c')](_0x2d2a('0x2d'),_0x511538+'-'+_0x32c234+'/'+_0x12d9ba)['json'](_0x90333);}return null;};}function patchUpdates(_0x514fec){return function(_0x4917d3){try{jsonpatch['apply'](_0x4917d3,_0x514fec,!![]);}catch(_0x27d994){return BPromise[_0x2d2a('0x2e')](_0x27d994);}return _0x4917d3[_0x2d2a('0x2f')]();};}function saveUpdates(_0x292e5e,_0x25313f){return function(_0x49eca2){if(_0x49eca2){return _0x49eca2[_0x2d2a('0x30')](_0x292e5e)[_0x2d2a('0x1e')](function(_0xf91b34){return _0xf91b34;});}return null;};}function removeEntity(_0x177eb3,_0x1be10f){return function(_0x346cb6){if(_0x346cb6){return _0x346cb6[_0x2d2a('0x31')]()['then'](function(){_0x177eb3[_0x2d2a('0x26')](0xcc)[_0x2d2a('0x27')]();});}};}function handleEntityNotFound(_0x3fde07,_0x42be5b){return function(_0x597aeb){if(!_0x597aeb){_0x3fde07[_0x2d2a('0x32')](0x194);}return _0x597aeb;};}function handleError(_0x24cbce,_0x576db5){_0x576db5=_0x576db5||0x1f4;return function(_0x297a95){logger['error'](_0x297a95[_0x2d2a('0x33')]);if(_0x297a95[_0x2d2a('0x34')]){delete _0x297a95['name'];}_0x24cbce[_0x2d2a('0x26')](_0x576db5)[_0x2d2a('0x35')](_0x297a95);};}exports[_0x2d2a('0x36')]=function(_0x4e079c,_0x5d13a3){var _0x565fc2={},_0x500e77={},_0x3ab0d0={'count':0x0,'rows':[]};var _0x3ce42e=_[_0x2d2a('0x37')](db[_0x2d2a('0x38')][_0x2d2a('0x39')],function(_0xefbc2f){return{'name':_0xefbc2f[_0x2d2a('0x3a')],'type':_0xefbc2f[_0x2d2a('0x3b')][_0x2d2a('0x3c')]};});_0x500e77[_0x2d2a('0x3d')]=_['map'](_0x3ce42e,_0x2d2a('0x34'));_0x500e77[_0x2d2a('0x3e')]=_[_0x2d2a('0x3f')](_0x4e079c[_0x2d2a('0x3e')]);_0x500e77[_0x2d2a('0x40')]=_[_0x2d2a('0x41')](_0x500e77[_0x2d2a('0x3d')],_0x500e77['query']);_0x565fc2[_0x2d2a('0x42')]=_['intersection'](_0x500e77['model'],qs['fields'](_0x4e079c[_0x2d2a('0x3e')][_0x2d2a('0x43')]));_0x565fc2['attributes']=_0x565fc2[_0x2d2a('0x42')]['length']?_0x565fc2[_0x2d2a('0x42')]:_0x500e77['model'];if(!_0x4e079c['query'][_0x2d2a('0x44')](_0x2d2a('0x45'))){_0x565fc2['limit']=qs[_0x2d2a('0x2b')](_0x4e079c[_0x2d2a('0x3e')][_0x2d2a('0x2b')]);_0x565fc2[_0x2d2a('0x2a')]=qs['offset'](_0x4e079c[_0x2d2a('0x3e')][_0x2d2a('0x2a')]);}_0x565fc2['order']=qs[_0x2d2a('0x46')](_0x4e079c[_0x2d2a('0x3e')][_0x2d2a('0x46')]);_0x565fc2[_0x2d2a('0x47')]=qs[_0x2d2a('0x40')](_[_0x2d2a('0x48')](_0x4e079c['query'],_0x500e77[_0x2d2a('0x40')]),_0x3ce42e);if(_0x4e079c[_0x2d2a('0x3e')]['filter']){_0x565fc2[_0x2d2a('0x47')]=_[_0x2d2a('0x49')](_0x565fc2['where'],{'$or':_[_0x2d2a('0x37')](_0x3ce42e,function(_0x217e47){if(_0x217e47[_0x2d2a('0x3b')]!=='VIRTUAL'){var _0x19f199={};_0x19f199[_0x217e47['name']]={'$like':'%'+_0x4e079c[_0x2d2a('0x3e')][_0x2d2a('0x4a')]+'%'};return _0x19f199;}})});}_0x565fc2=_['merge']({},_0x565fc2,_0x4e079c[_0x2d2a('0x4b')]);var _0x1104ea={'where':_0x565fc2[_0x2d2a('0x47')]};return db[_0x2d2a('0x38')][_0x2d2a('0x29')](_0x1104ea)[_0x2d2a('0x1e')](function(_0x16cfb6){_0x3ab0d0['count']=_0x16cfb6;if(_0x4e079c[_0x2d2a('0x3e')][_0x2d2a('0x4c')]){_0x565fc2[_0x2d2a('0x4d')]=[{'all':!![]}];}return db['FaxMessage']['findAll'](_0x565fc2);})[_0x2d2a('0x1e')](function(_0x2eaace){_0x3ab0d0[_0x2d2a('0x4e')]=_0x2eaace;return _0x3ab0d0;})[_0x2d2a('0x1e')](respondWithFilteredResult(_0x5d13a3,_0x565fc2))[_0x2d2a('0x25')](handleError(_0x5d13a3,null));};exports[_0x2d2a('0x4f')]=function(_0x1de7ef,_0x49ff7f){var _0x3f6f5d={'raw':!![],'where':{'id':_0x1de7ef[_0x2d2a('0x50')]['id']}},_0x31e74c={};_0x31e74c[_0x2d2a('0x3d')]=_['keys'](db[_0x2d2a('0x38')][_0x2d2a('0x39')]);_0x31e74c[_0x2d2a('0x3e')]=_[_0x2d2a('0x3f')](_0x1de7ef[_0x2d2a('0x3e')]);_0x31e74c[_0x2d2a('0x40')]=_[_0x2d2a('0x41')](_0x31e74c[_0x2d2a('0x3d')],_0x31e74c['query']);_0x3f6f5d[_0x2d2a('0x42')]=_[_0x2d2a('0x41')](_0x31e74c['model'],qs[_0x2d2a('0x43')](_0x1de7ef['query'][_0x2d2a('0x43')]));_0x3f6f5d[_0x2d2a('0x42')]=_0x3f6f5d[_0x2d2a('0x42')][_0x2d2a('0x51')]?_0x3f6f5d[_0x2d2a('0x42')]:_0x31e74c[_0x2d2a('0x3d')];if(_0x1de7ef[_0x2d2a('0x3e')][_0x2d2a('0x4c')]){_0x3f6f5d[_0x2d2a('0x4d')]=[{'all':!![]}];}_0x3f6f5d=_['merge']({},_0x3f6f5d,_0x1de7ef[_0x2d2a('0x4b')]);return db[_0x2d2a('0x38')][_0x2d2a('0x52')](_0x3f6f5d)[_0x2d2a('0x1e')](handleEntityNotFound(_0x49ff7f,null))[_0x2d2a('0x1e')](respondWithResult(_0x49ff7f,null))[_0x2d2a('0x25')](handleError(_0x49ff7f,null));};exports[_0x2d2a('0x30')]=function(_0x3158e2,_0x3a8845){if(_0x3158e2[_0x2d2a('0x53')]['id']){delete _0x3158e2[_0x2d2a('0x53')]['id'];}return db[_0x2d2a('0x38')][_0x2d2a('0x52')]({'where':{'id':_0x3158e2['params']['id']}})[_0x2d2a('0x1e')](handleEntityNotFound(_0x3a8845,null))['then'](saveUpdates(_0x3158e2[_0x2d2a('0x53')],null))[_0x2d2a('0x1e')](respondWithResult(_0x3a8845,null))[_0x2d2a('0x25')](handleError(_0x3a8845,null));};exports[_0x2d2a('0x31')]=function(_0x246787,_0x27a545){return db['FaxMessage'][_0x2d2a('0x52')]({'where':{'id':_0x246787[_0x2d2a('0x50')]['id']}})[_0x2d2a('0x1e')](handleEntityNotFound(_0x27a545,null))[_0x2d2a('0x1e')](removeEntity(_0x27a545,null))[_0x2d2a('0x25')](handleError(_0x27a545,null));};exports['describe']=function(_0x674d5b,_0xb22d80){return db[_0x2d2a('0x38')][_0x2d2a('0x54')]()[_0x2d2a('0x1e')](respondWithResult(_0xb22d80,null))['catch'](handleError(_0xb22d80,null));};var interaction_log=require(_0x2d2a('0x55'))(_0x2d2a('0x56'));exports[_0x2d2a('0x57')]=function(_0x5ec2f0,_0x5be01c,_0x48f53d){var _0x531a5a={'channel':_0x2d2a('0x58')};if(_0x5ec2f0[_0x2d2a('0x53')]['id']){delete _0x5ec2f0[_0x2d2a('0x53')]['id'];}_0x5ec2f0['body'][_0x2d2a('0x59')]=!![];_0x5ec2f0['body'][_0x2d2a('0x5a')]=moment()['format'](_0x2d2a('0x5b'));_0x5ec2f0[_0x2d2a('0x53')]['UserId']=_0x5ec2f0['body']['UserId']||_0x5ec2f0['user']['id'];return db[_0x2d2a('0x38')][_0x2d2a('0x52')]({'where':{'id':_0x5ec2f0['params']['id'],'UserId':null},'include':[{'model':db[_0x2d2a('0x5c')],'as':_0x2d2a('0x5d')}]})[_0x2d2a('0x1e')](handleEntityNotFound(_0x5be01c,null))[_0x2d2a('0x1e')](saveUpdates(_0x5ec2f0[_0x2d2a('0x53')],null))['then'](function(_0x8e0370){if(_0x8e0370){_0x531a5a['message']=_0x8e0370[_0x2d2a('0x5e')]({'plain':!![]});return db[_0x2d2a('0x5f')][_0x2d2a('0x52')]({'where':{'id':_0x8e0370[_0x2d2a('0x60')]}});}return null;})[_0x2d2a('0x1e')](handleEntityNotFound(_0x5be01c,null))[_0x2d2a('0x1e')](function(_0x563c03){if(_0x563c03){return _0x563c03['update']({'UserId':_0x5ec2f0['body'][_0x2d2a('0x61')],'read1stAt':_[_0x2d2a('0x62')](_0x563c03['read1stAt'])?moment()['format']('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0x2d2a('0x1e')](function(_0x51514d){if(_0x51514d){_0x531a5a[_0x2d2a('0x63')]=_0x51514d[_0x2d2a('0x5e')]({'plain':!![]});interaction_log['info'](_0x2d2a('0x64'),_0x5ec2f0[_0x2d2a('0x65')]['id'],_0x5ec2f0[_0x2d2a('0x65')][_0x2d2a('0x34')],_0x5ec2f0[_0x2d2a('0x65')][_0x2d2a('0x66')],_0x531a5a[_0x2d2a('0x63')]['id'],_0x5ec2f0[_0x2d2a('0x53')]?JSON[_0x2d2a('0x67')](_0x5ec2f0[_0x2d2a('0x53')]):'null');return respondWithRpcPromise(_0x2d2a('0x68'),_0x2d2a('0x69'),_0x531a5a);}return null;})[_0x2d2a('0x1e')](function(_0x3ad8c7){if(_0x3ad8c7){if(_0x5ec2f0[_0x2d2a('0x53')][_0x2d2a('0x6a')]){_0x531a5a['message'][_0x2d2a('0x6b')]=util['format'](_0x2d2a('0x6c'),_0x5ec2f0[_0x2d2a('0x65')][_0x2d2a('0x34')]);_0x531a5a[_0x2d2a('0x24')]['channel']=_0x531a5a[_0x2d2a('0x6d')];_0x531a5a['message']['event']=_0x2d2a('0x57');return respondWithRpcPromise(_0x2d2a('0x6e'),_0x2d2a('0x6e'),{'event':'acceptmessage','message':_0x531a5a['message']},client9002)[_0x2d2a('0x1e')](function(){return _0x531a5a;});}return _0x531a5a;}return null;})[_0x2d2a('0x1e')](respondWithResult(_0x5be01c,null))['catch'](handleError(_0x5be01c,null));};var interaction_log=require('../../config/logger')(_0x2d2a('0x56'));exports[_0x2d2a('0x2e')]=function(_0x1aebc9,_0x30b9e5,_0x313699){var _0x4aa4d0={'agent':{},'channel':_0x2d2a('0x58')};if(_0x1aebc9[_0x2d2a('0x53')]['id']){delete _0x1aebc9[_0x2d2a('0x53')]['id'];}_0x1aebc9[_0x2d2a('0x53')][_0x2d2a('0x61')]=_0x1aebc9[_0x2d2a('0x53')]['UserId']||_0x1aebc9['user']['id'];_0x4aa4d0[_0x2d2a('0x6f')]['id']=_0x1aebc9['body'][_0x2d2a('0x61')];return db['FaxMessage'][_0x2d2a('0x52')]({'where':{'id':_0x1aebc9['params']['id'],'UserId':null}})[_0x2d2a('0x1e')](handleEntityNotFound(_0x30b9e5,null))[_0x2d2a('0x1e')](function(_0x79e01f){if(_0x79e01f){_0x4aa4d0[_0x2d2a('0x24')]=_0x79e01f[_0x2d2a('0x5e')]({'plain':!![]});return db[_0x2d2a('0x5f')]['find']({'where':{'id':_0x79e01f['FaxInteractionId']}});}return null;})[_0x2d2a('0x1e')](handleEntityNotFound(_0x30b9e5,null))[_0x2d2a('0x1e')](function(_0x3cfdd2){if(_0x3cfdd2){_0x4aa4d0['interaction']=_0x3cfdd2[_0x2d2a('0x5e')]({'plain':!![]});interaction_log[_0x2d2a('0x1f')](_0x2d2a('0x70'),_0x1aebc9[_0x2d2a('0x65')]['id'],_0x1aebc9['user'][_0x2d2a('0x34')],_0x1aebc9[_0x2d2a('0x65')]['role'],_0x4aa4d0[_0x2d2a('0x63')]['id'],_0x1aebc9['body']?JSON['stringify'](_0x1aebc9['body']):_0x2d2a('0x71'));return respondWithRpcPromise(_0x2d2a('0x72'),'rejectMessage',_0x4aa4d0);}return null;})[_0x2d2a('0x1e')](function(_0x280b82){if(_0x280b82){_0x280b82[_0x2d2a('0x24')][_0x2d2a('0x6b')]=util[_0x2d2a('0x73')](_0x2d2a('0x6c'),_0x1aebc9[_0x2d2a('0x65')][_0x2d2a('0x34')]);_0x280b82[_0x2d2a('0x24')][_0x2d2a('0x6d')]=_0x4aa4d0['channel'];_0x280b82['message'][_0x2d2a('0x74')]=_0x2d2a('0x2e');respondWithRpcPromise(_0x2d2a('0x6e'),_0x2d2a('0x6e'),{'event':_0x2d2a('0x75'),'message':_0x280b82[_0x2d2a('0x24')]},client9002);return _0x4aa4d0;}return null;})[_0x2d2a('0x1e')](respondWithResult(_0x30b9e5,null))[_0x2d2a('0x25')](handleError(_0x30b9e5,null));};exports[_0x2d2a('0x76')]=function(_0x4e56d3,_0x54cc74){var _0x6de660;return db[_0x2d2a('0x38')][_0x2d2a('0x76')](_0x4e56d3[_0x2d2a('0x53')],{})['then'](function(_0x3cf16f){_0x6de660=_0x3cf16f;return db[_0x2d2a('0x5c')][_0x2d2a('0x77')]({'where':{'id':_0x6de660[_0x2d2a('0x78')]}});})[_0x2d2a('0x1e')](function(_0x42f9a9){if(_[_0x2d2a('0x62')](_0x42f9a9)){return;}else{_0x6de660[_0x2d2a('0x58')]=_0x42f9a9[_0x2d2a('0x58')];return db[_0x2d2a('0x79')]['findOne']({'where':{'id':_0x6de660[_0x2d2a('0x7a')]}});}})['then'](function(_0x14697c){return respondWithRpcPromise(_0x2d2a('0x7b'),_0x2d2a('0x7b'),{'FaxAccountId':_[_0x2d2a('0x62')](_0x4e56d3[_0x2d2a('0x53')])?undefined:_0x4e56d3['body']['FaxAccountId'],'path':_[_0x2d2a('0x62')](_0x14697c)?undefined:util[_0x2d2a('0x73')](_0x2d2a('0x7c'),_0x14697c[_0x2d2a('0x7d')]),'fax':_[_0x2d2a('0x62')](_0x6de660[_0x2d2a('0x58')])?undefined:_0x6de660[_0x2d2a('0x58')],'AttachmentId':_0x6de660[_0x2d2a('0x7a')]},client9002);})[_0x2d2a('0x1e')](respondWithResult(_0x54cc74,0xc9))['catch'](handleError(_0x54cc74,null));};exports[_0x2d2a('0x7e')]=function(_0x2709f7,_0x2c9674){var _0x11eb1e=path['join'](config['root'],_0x2d2a('0x7f'),_0x2d2a('0x80'),'attachments');return db[_0x2d2a('0x38')]['find']({'where':{'id':_0x2709f7[_0x2d2a('0x50')]['id']},'include':[{'model':db[_0x2d2a('0x79')],'as':_0x2d2a('0x79')}]})[_0x2d2a('0x1e')](handleEntityNotFound(_0x2c9674,null))['then'](function(_0x34b33a){if(_0x34b33a){return _0x2c9674['download'](path[_0x2d2a('0x81')](_0x11eb1e,_0x34b33a[_0x2d2a('0x79')][_0x2d2a('0x7d')]));}})[_0x2d2a('0x25')](handleError(_0x2c9674,null));};
\ No newline at end of file
+var _0x6f98=['describe','fax-interactions','fax','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','CmContact','Contact','get','isNil','read1stAt','interaction','[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','acceptMessage','manual','interface','channel','event','EventManager','acceptmessage','agent','FaxInteraction','role','RejectMessage','rejectMessage','SIP/%s','rejectmessage','create','ContactId','findOne','AttachmentId','/var/opt/motion2/server/files/attachments/%s','basename','join','root','server','files','attachments','Attachment','download','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','redis','defaults','localhost','socket.io-emitter','./faxMessage.socket','register','jayson/promise','client','http','ValidationError','then','info','request\x20sent','debug','FaxMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','FaxMessage,\x20%s,\x20%s','message','result','catch','sendStatus','end','status','json','count','offset','limit','set','Content-Range','apply','reject','save','update','destroy','stack','send','index','map','FaxMessage','rawAttributes','fieldName','type','key','query','keys','intersection','model','fields','attributes','hasOwnProperty','nolimit','order','sort','filters','pick','filter','merge','where','name','options','includeAll','include','findAll','rows','params','length','body','find'];(function(_0xf5aede,_0x5b2e7f){var _0x5c6890=function(_0x12db0f){while(--_0x12db0f){_0xf5aede['push'](_0xf5aede['shift']());}};_0x5c6890(++_0x5b2e7f);}(_0x6f98,0x1ca));var _0x86f9=function(_0x13f908,_0x30eab0){_0x13f908=_0x13f908-0x0;var _0x14b5f2=_0x6f98[_0x13f908];return _0x14b5f2;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x86f9('0x0'));var rimraf=require(_0x86f9('0x1'));var zipdir=require(_0x86f9('0x2'));var jsonpatch=require(_0x86f9('0x3'));var rp=require('request-promise');var moment=require(_0x86f9('0x4'));var BPromise=require(_0x86f9('0x5'));var Mustache=require(_0x86f9('0x6'));var util=require('util');var path=require('path');var sox=require(_0x86f9('0x7'));var csv=require(_0x86f9('0x8'));var ejs=require(_0x86f9('0x9'));var fs=require('fs');var _=require('lodash');var squel=require(_0x86f9('0xa'));var crypto=require(_0x86f9('0xb'));var jsforce=require(_0x86f9('0xc'));var deskjs=require(_0x86f9('0xd'));var toCsv=require('to-csv');var querystring=require(_0x86f9('0xe'));var Papa=require(_0x86f9('0xf'));var Redis=require(_0x86f9('0x10'));var authService=require(_0x86f9('0x11'));var qs=require(_0x86f9('0x12'));var as=require(_0x86f9('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x86f9('0x14'))(_0x86f9('0x15'));var utils=require(_0x86f9('0x16'));var config=require(_0x86f9('0x17'));var db=require('../../mysqldb')['db'];config[_0x86f9('0x18')]=_[_0x86f9('0x19')](config['redis'],{'host':_0x86f9('0x1a'),'port':0x18eb});var socket=require(_0x86f9('0x1b'))(new Redis(config[_0x86f9('0x18')]));require(_0x86f9('0x1c'))[_0x86f9('0x1d')](socket);var jayson=require(_0x86f9('0x1e'));var client=jayson[_0x86f9('0x1f')][_0x86f9('0x20')]({'port':0x232c});var client9002=jayson['client'][_0x86f9('0x20')]({'port':0x232a});function checkPasswordPattern(_0x29815e,_0x40f99e,_0x4b5068){if(_0x4b5068){var _0x439361=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x439361['test'](_0x40f99e)){return _0x29815e;}else{throw new db['Sequelize'][(_0x86f9('0x21'))]('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x29815e;}}function respondWithRpcPromise(_0x14beaf,_0x385ea5,_0x3051bd,_0x59a759){return new BPromise(function(_0x18459a,_0x4cd2aa){var _0x5a1ddb=_0x59a759||client;return _0x5a1ddb['request'](_0x14beaf,_0x3051bd)[_0x86f9('0x22')](function(_0x34e404){logger[_0x86f9('0x23')]('FaxMessage,\x20%s,\x20%s',_0x385ea5,_0x86f9('0x24'));logger[_0x86f9('0x25')](_0x86f9('0x26'),_0x385ea5,_0x86f9('0x24'),JSON[_0x86f9('0x27')](_0x34e404));if(_0x34e404[_0x86f9('0x28')]){if(_0x34e404[_0x86f9('0x28')][_0x86f9('0x29')]===0x1f4){logger[_0x86f9('0x28')](_0x86f9('0x2a'),_0x385ea5,_0x34e404[_0x86f9('0x28')][_0x86f9('0x2b')]);return _0x4cd2aa(_0x34e404[_0x86f9('0x28')][_0x86f9('0x2b')]);}logger[_0x86f9('0x28')](_0x86f9('0x2a'),_0x385ea5,_0x34e404[_0x86f9('0x28')][_0x86f9('0x2b')]);return _0x18459a(_0x34e404[_0x86f9('0x28')][_0x86f9('0x2b')]);}else{logger[_0x86f9('0x23')](_0x86f9('0x2a'),_0x385ea5,_0x86f9('0x24'));_0x18459a(_0x34e404[_0x86f9('0x2c')]['message']);}})[_0x86f9('0x2d')](function(_0x435fe8){logger['error'](_0x86f9('0x2a'),_0x385ea5,_0x435fe8);_0x4cd2aa(_0x435fe8);});});}function respondWithStatusCode(_0x57f019,_0x4db919){_0x4db919=_0x4db919||0xcc;return function(_0xfe9a60){if(_0xfe9a60){return _0x57f019[_0x86f9('0x2e')](_0x4db919);}return _0x57f019['status'](_0x4db919)[_0x86f9('0x2f')]();};}function respondWithResult(_0x160da5,_0x23bd2a){_0x23bd2a=_0x23bd2a||0xc8;return function(_0x3c9584){if(_0x3c9584){return _0x160da5[_0x86f9('0x30')](_0x23bd2a)[_0x86f9('0x31')](_0x3c9584);}};}function respondWithFilteredResult(_0xaf74c5,_0x53f577){return function(_0xb9c7e5){if(_0xb9c7e5){var _0xc69ac=_0xb9c7e5[_0x86f9('0x32')],_0x1ff830=_0x53f577[_0x86f9('0x33')],_0x7731d3=_0x53f577[_0x86f9('0x33')]+_0x53f577[_0x86f9('0x34')],_0x52cfcc;if(_0x7731d3>=_0xc69ac){_0x7731d3=_0xc69ac;_0x52cfcc=0xc8;}else{_0x52cfcc=0xce;}_0xaf74c5[_0x86f9('0x30')](_0x52cfcc);return _0xaf74c5[_0x86f9('0x35')](_0x86f9('0x36'),_0x1ff830+'-'+_0x7731d3+'/'+_0xc69ac)[_0x86f9('0x31')](_0xb9c7e5);}return null;};}function patchUpdates(_0x397dbb){return function(_0x326529){try{jsonpatch[_0x86f9('0x37')](_0x326529,_0x397dbb,!![]);}catch(_0x12ca11){return BPromise[_0x86f9('0x38')](_0x12ca11);}return _0x326529[_0x86f9('0x39')]();};}function saveUpdates(_0x14e60f,_0x1a00e4){return function(_0x515fa2){if(_0x515fa2){return _0x515fa2[_0x86f9('0x3a')](_0x14e60f)[_0x86f9('0x22')](function(_0x2b6a09){return _0x2b6a09;});}return null;};}function removeEntity(_0x384dcf,_0x2dbf8a){return function(_0x3a1cfc){if(_0x3a1cfc){return _0x3a1cfc[_0x86f9('0x3b')]()['then'](function(){_0x384dcf[_0x86f9('0x30')](0xcc)[_0x86f9('0x2f')]();});}};}function handleEntityNotFound(_0x4dc2f8,_0x3a0944){return function(_0x5e16d8){if(!_0x5e16d8){_0x4dc2f8[_0x86f9('0x2e')](0x194);}return _0x5e16d8;};}function handleError(_0x1a5c34,_0x2c3710){_0x2c3710=_0x2c3710||0x1f4;return function(_0x2ceef0){logger[_0x86f9('0x28')](_0x2ceef0[_0x86f9('0x3c')]);if(_0x2ceef0['name']){delete _0x2ceef0['name'];}_0x1a5c34[_0x86f9('0x30')](_0x2c3710)[_0x86f9('0x3d')](_0x2ceef0);};}exports[_0x86f9('0x3e')]=function(_0x1cff58,_0x1e1315){var _0x4ec633={},_0x1a5493={},_0x55d7ff={'count':0x0,'rows':[]};var _0x2c1472=_[_0x86f9('0x3f')](db[_0x86f9('0x40')][_0x86f9('0x41')],function(_0x1e57c6){return{'name':_0x1e57c6[_0x86f9('0x42')],'type':_0x1e57c6[_0x86f9('0x43')][_0x86f9('0x44')]};});_0x1a5493['model']=_[_0x86f9('0x3f')](_0x2c1472,'name');_0x1a5493[_0x86f9('0x45')]=_[_0x86f9('0x46')](_0x1cff58[_0x86f9('0x45')]);_0x1a5493['filters']=_[_0x86f9('0x47')](_0x1a5493[_0x86f9('0x48')],_0x1a5493[_0x86f9('0x45')]);_0x4ec633['attributes']=_[_0x86f9('0x47')](_0x1a5493['model'],qs[_0x86f9('0x49')](_0x1cff58[_0x86f9('0x45')][_0x86f9('0x49')]));_0x4ec633['attributes']=_0x4ec633[_0x86f9('0x4a')]['length']?_0x4ec633[_0x86f9('0x4a')]:_0x1a5493[_0x86f9('0x48')];if(!_0x1cff58['query'][_0x86f9('0x4b')](_0x86f9('0x4c'))){_0x4ec633[_0x86f9('0x34')]=qs[_0x86f9('0x34')](_0x1cff58['query'][_0x86f9('0x34')]);_0x4ec633[_0x86f9('0x33')]=qs[_0x86f9('0x33')](_0x1cff58[_0x86f9('0x45')][_0x86f9('0x33')]);}_0x4ec633[_0x86f9('0x4d')]=qs['sort'](_0x1cff58['query'][_0x86f9('0x4e')]);_0x4ec633['where']=qs[_0x86f9('0x4f')](_[_0x86f9('0x50')](_0x1cff58[_0x86f9('0x45')],_0x1a5493[_0x86f9('0x4f')]),_0x2c1472);if(_0x1cff58[_0x86f9('0x45')][_0x86f9('0x51')]){_0x4ec633['where']=_[_0x86f9('0x52')](_0x4ec633[_0x86f9('0x53')],{'$or':_['map'](_0x2c1472,function(_0x911c20){if(_0x911c20['type']!=='VIRTUAL'){var _0x59aafa={};_0x59aafa[_0x911c20[_0x86f9('0x54')]]={'$like':'%'+_0x1cff58[_0x86f9('0x45')][_0x86f9('0x51')]+'%'};return _0x59aafa;}})});}_0x4ec633=_['merge']({},_0x4ec633,_0x1cff58[_0x86f9('0x55')]);var _0x18abce={'where':_0x4ec633[_0x86f9('0x53')]};return db['FaxMessage']['count'](_0x18abce)['then'](function(_0x20a7ab){_0x55d7ff[_0x86f9('0x32')]=_0x20a7ab;if(_0x1cff58[_0x86f9('0x45')][_0x86f9('0x56')]){_0x4ec633[_0x86f9('0x57')]=[{'all':!![]}];}return db['FaxMessage'][_0x86f9('0x58')](_0x4ec633);})[_0x86f9('0x22')](function(_0x4d4f84){_0x55d7ff[_0x86f9('0x59')]=_0x4d4f84;return _0x55d7ff;})['then'](respondWithFilteredResult(_0x1e1315,_0x4ec633))[_0x86f9('0x2d')](handleError(_0x1e1315,null));};exports['show']=function(_0x1695cc,_0x388ceb){var _0x528b63={'raw':!![],'where':{'id':_0x1695cc[_0x86f9('0x5a')]['id']}},_0x15112f={};_0x15112f[_0x86f9('0x48')]=_[_0x86f9('0x46')](db[_0x86f9('0x40')][_0x86f9('0x41')]);_0x15112f[_0x86f9('0x45')]=_[_0x86f9('0x46')](_0x1695cc[_0x86f9('0x45')]);_0x15112f[_0x86f9('0x4f')]=_[_0x86f9('0x47')](_0x15112f[_0x86f9('0x48')],_0x15112f[_0x86f9('0x45')]);_0x528b63[_0x86f9('0x4a')]=_[_0x86f9('0x47')](_0x15112f[_0x86f9('0x48')],qs[_0x86f9('0x49')](_0x1695cc[_0x86f9('0x45')][_0x86f9('0x49')]));_0x528b63['attributes']=_0x528b63['attributes'][_0x86f9('0x5b')]?_0x528b63['attributes']:_0x15112f['model'];if(_0x1695cc[_0x86f9('0x45')]['includeAll']){_0x528b63[_0x86f9('0x57')]=[{'all':!![]}];}_0x528b63=_[_0x86f9('0x52')]({},_0x528b63,_0x1695cc[_0x86f9('0x55')]);return db[_0x86f9('0x40')]['find'](_0x528b63)[_0x86f9('0x22')](handleEntityNotFound(_0x388ceb,null))[_0x86f9('0x22')](respondWithResult(_0x388ceb,null))[_0x86f9('0x2d')](handleError(_0x388ceb,null));};exports['update']=function(_0x3d0db8,_0x136c2e){if(_0x3d0db8[_0x86f9('0x5c')]['id']){delete _0x3d0db8[_0x86f9('0x5c')]['id'];}return db['FaxMessage'][_0x86f9('0x5d')]({'where':{'id':_0x3d0db8[_0x86f9('0x5a')]['id']}})[_0x86f9('0x22')](handleEntityNotFound(_0x136c2e,null))[_0x86f9('0x22')](saveUpdates(_0x3d0db8['body'],null))[_0x86f9('0x22')](respondWithResult(_0x136c2e,null))['catch'](handleError(_0x136c2e,null));};exports['destroy']=function(_0x6a7f69,_0x1b173f){return db[_0x86f9('0x40')][_0x86f9('0x5d')]({'where':{'id':_0x6a7f69[_0x86f9('0x5a')]['id']}})['then'](handleEntityNotFound(_0x1b173f,null))[_0x86f9('0x22')](removeEntity(_0x1b173f,null))[_0x86f9('0x2d')](handleError(_0x1b173f,null));};exports[_0x86f9('0x5e')]=function(_0x3b7681,_0x1cd0f0){return db['FaxMessage'][_0x86f9('0x5e')]()[_0x86f9('0x22')](respondWithResult(_0x1cd0f0,null))[_0x86f9('0x2d')](handleError(_0x1cd0f0,null));};var interaction_log=require(_0x86f9('0x14'))(_0x86f9('0x5f'));exports['accept']=function(_0x2c8745,_0x2ea56a,_0x130e12){var _0x333e45={'channel':_0x86f9('0x60')};if(_0x2c8745[_0x86f9('0x5c')]['id']){delete _0x2c8745[_0x86f9('0x5c')]['id'];}_0x2c8745[_0x86f9('0x5c')][_0x86f9('0x61')]=!![];_0x2c8745[_0x86f9('0x5c')][_0x86f9('0x62')]=moment()[_0x86f9('0x63')](_0x86f9('0x64'));_0x2c8745[_0x86f9('0x5c')][_0x86f9('0x65')]=_0x2c8745[_0x86f9('0x5c')][_0x86f9('0x65')]||_0x2c8745[_0x86f9('0x66')]['id'];return db[_0x86f9('0x40')]['find']({'where':{'id':_0x2c8745[_0x86f9('0x5a')]['id'],'UserId':null},'include':[{'model':db[_0x86f9('0x67')],'as':_0x86f9('0x68')}]})[_0x86f9('0x22')](handleEntityNotFound(_0x2ea56a,null))[_0x86f9('0x22')](saveUpdates(_0x2c8745[_0x86f9('0x5c')],null))[_0x86f9('0x22')](function(_0x19d94a){if(_0x19d94a){_0x333e45[_0x86f9('0x2b')]=_0x19d94a[_0x86f9('0x69')]({'plain':!![]});return db['FaxInteraction'][_0x86f9('0x5d')]({'where':{'id':_0x19d94a['FaxInteractionId']}});}return null;})[_0x86f9('0x22')](handleEntityNotFound(_0x2ea56a,null))[_0x86f9('0x22')](function(_0x566b6b){if(_0x566b6b){return _0x566b6b['update']({'UserId':_0x2c8745[_0x86f9('0x5c')][_0x86f9('0x65')],'read1stAt':_[_0x86f9('0x6a')](_0x566b6b[_0x86f9('0x6b')])?moment()[_0x86f9('0x63')](_0x86f9('0x64')):undefined});}return null;})[_0x86f9('0x22')](function(_0x45fba2){if(_0x45fba2){_0x333e45[_0x86f9('0x6c')]=_0x45fba2['get']({'plain':!![]});interaction_log['info'](_0x86f9('0x6d'),_0x2c8745['user']['id'],_0x2c8745[_0x86f9('0x66')][_0x86f9('0x54')],_0x2c8745[_0x86f9('0x66')]['role'],_0x333e45[_0x86f9('0x6c')]['id'],_0x2c8745[_0x86f9('0x5c')]?JSON[_0x86f9('0x27')](_0x2c8745['body']):_0x86f9('0x6e'));return respondWithRpcPromise('AcceptMessage',_0x86f9('0x6f'),_0x333e45);}return null;})[_0x86f9('0x22')](function(_0x4e4fda){if(_0x4e4fda){if(_0x2c8745['body'][_0x86f9('0x70')]){_0x333e45[_0x86f9('0x2b')][_0x86f9('0x71')]=util['format']('SIP/%s',_0x2c8745[_0x86f9('0x66')][_0x86f9('0x54')]);_0x333e45['message'][_0x86f9('0x72')]=_0x333e45[_0x86f9('0x72')];_0x333e45[_0x86f9('0x2b')][_0x86f9('0x73')]='accept';return respondWithRpcPromise(_0x86f9('0x74'),_0x86f9('0x74'),{'event':_0x86f9('0x75'),'message':_0x333e45[_0x86f9('0x2b')]},client9002)[_0x86f9('0x22')](function(){return _0x333e45;});}return _0x333e45;}return null;})[_0x86f9('0x22')](respondWithResult(_0x2ea56a,null))[_0x86f9('0x2d')](handleError(_0x2ea56a,null));};var interaction_log=require(_0x86f9('0x14'))(_0x86f9('0x5f'));exports[_0x86f9('0x38')]=function(_0x205a69,_0x36b35f,_0x2c3339){var _0xb83927={'agent':{},'channel':_0x86f9('0x60')};if(_0x205a69['body']['id']){delete _0x205a69[_0x86f9('0x5c')]['id'];}_0x205a69[_0x86f9('0x5c')]['UserId']=_0x205a69[_0x86f9('0x5c')][_0x86f9('0x65')]||_0x205a69['user']['id'];_0xb83927[_0x86f9('0x76')]['id']=_0x205a69['body'][_0x86f9('0x65')];return db[_0x86f9('0x40')][_0x86f9('0x5d')]({'where':{'id':_0x205a69[_0x86f9('0x5a')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x36b35f,null))['then'](function(_0x17d0e9){if(_0x17d0e9){_0xb83927['message']=_0x17d0e9['get']({'plain':!![]});return db[_0x86f9('0x77')][_0x86f9('0x5d')]({'where':{'id':_0x17d0e9['FaxInteractionId']}});}return null;})[_0x86f9('0x22')](handleEntityNotFound(_0x36b35f,null))[_0x86f9('0x22')](function(_0xa6d4ff){if(_0xa6d4ff){_0xb83927[_0x86f9('0x6c')]=_0xa6d4ff[_0x86f9('0x69')]({'plain':!![]});interaction_log['info']('[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x205a69[_0x86f9('0x66')]['id'],_0x205a69[_0x86f9('0x66')][_0x86f9('0x54')],_0x205a69[_0x86f9('0x66')][_0x86f9('0x78')],_0xb83927[_0x86f9('0x6c')]['id'],_0x205a69[_0x86f9('0x5c')]?JSON[_0x86f9('0x27')](_0x205a69[_0x86f9('0x5c')]):'null');return respondWithRpcPromise(_0x86f9('0x79'),_0x86f9('0x7a'),_0xb83927);}return null;})[_0x86f9('0x22')](function(_0x5deec6){if(_0x5deec6){_0x5deec6[_0x86f9('0x2b')][_0x86f9('0x71')]=util[_0x86f9('0x63')](_0x86f9('0x7b'),_0x205a69[_0x86f9('0x66')]['name']);_0x5deec6[_0x86f9('0x2b')][_0x86f9('0x72')]=_0xb83927[_0x86f9('0x72')];_0x5deec6[_0x86f9('0x2b')]['event']='reject';respondWithRpcPromise('EventManager',_0x86f9('0x74'),{'event':_0x86f9('0x7c'),'message':_0x5deec6[_0x86f9('0x2b')]},client9002);return _0xb83927;}return null;})[_0x86f9('0x22')](respondWithResult(_0x36b35f,null))['catch'](handleError(_0x36b35f,null));};exports[_0x86f9('0x7d')]=function(_0x16b8b3,_0x8f57d1){var _0x13e6fb;return db[_0x86f9('0x40')]['create'](_0x16b8b3[_0x86f9('0x5c')],{})[_0x86f9('0x22')](function(_0x19085e){_0x13e6fb=_0x19085e;return db[_0x86f9('0x67')]['findOne']({'where':{'id':_0x13e6fb[_0x86f9('0x7e')]}});})[_0x86f9('0x22')](function(_0x1f882a){if(_[_0x86f9('0x6a')](_0x1f882a)){return;}else{_0x13e6fb[_0x86f9('0x60')]=_0x1f882a[_0x86f9('0x60')];return db['Attachment'][_0x86f9('0x7f')]({'where':{'id':_0x13e6fb[_0x86f9('0x80')]}});}})[_0x86f9('0x22')](function(_0x21bbbe){return respondWithRpcPromise('SendFax','SendFax',{'FaxAccountId':_['isNil'](_0x16b8b3['body'])?undefined:_0x16b8b3[_0x86f9('0x5c')]['FaxAccountId'],'path':_[_0x86f9('0x6a')](_0x21bbbe)?undefined:util['format'](_0x86f9('0x81'),_0x21bbbe[_0x86f9('0x82')]),'fax':_['isNil'](_0x13e6fb[_0x86f9('0x60')])?undefined:_0x13e6fb[_0x86f9('0x60')],'AttachmentId':_0x13e6fb[_0x86f9('0x80')]},client9002);})['then'](respondWithResult(_0x8f57d1,0xc9))[_0x86f9('0x2d')](handleError(_0x8f57d1,null));};exports['download']=function(_0xa3674,_0x369d59){var _0x2b4275=path[_0x86f9('0x83')](config[_0x86f9('0x84')],_0x86f9('0x85'),_0x86f9('0x86'),_0x86f9('0x87'));return db['FaxMessage']['find']({'where':{'id':_0xa3674['params']['id']},'include':[{'model':db['Attachment'],'as':_0x86f9('0x88')}]})[_0x86f9('0x22')](handleEntityNotFound(_0x369d59,null))[_0x86f9('0x22')](function(_0x2b83ba){if(_0x2b83ba){return _0x369d59[_0x86f9('0x89')](path[_0x86f9('0x83')](_0x2b4275,_0x2b83ba[_0x86f9('0x88')][_0x86f9('0x82')]));}})[_0x86f9('0x2d')](handleError(_0x369d59,null));};
\ No newline at end of file
diff --git a/server/api/faxMessage/faxMessage.events.js b/server/api/faxMessage/faxMessage.events.js
index 7b5ce1d..bc75292 100644
--- a/server/api/faxMessage/faxMessage.events.js
+++ b/server/api/faxMessage/faxMessage.events.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7217=['emit','hasOwnProperty','hook','exports','events','FaxMessage','setMaxListeners','save','update','remove'];(function(_0x30ba61,_0x48b905){var _0x7300ad=function(_0x3b4f73){while(--_0x3b4f73){_0x30ba61['push'](_0x30ba61['shift']());}};_0x7300ad(++_0x48b905);}(_0x7217,0x19e));var _0x7721=function(_0x173d7e,_0x3242fd){_0x173d7e=_0x173d7e-0x0;var _0x2220d6=_0x7217[_0x173d7e];return _0x2220d6;};'use strict';var EventEmitter=require(_0x7721('0x0'));var FaxMessage=require('../../mysqldb')['db'][_0x7721('0x1')];var FaxMessageEvents=new EventEmitter();FaxMessageEvents[_0x7721('0x2')](0x0);var events={'afterCreate':_0x7721('0x3'),'afterUpdate':_0x7721('0x4'),'afterDestroy':_0x7721('0x5')};function emitEvent(_0x4d6446){return function(_0x5bf160,_0x472a96,_0xce17f9){FaxMessageEvents[_0x7721('0x6')](_0x4d6446+':'+_0x5bf160['id'],_0x5bf160);FaxMessageEvents[_0x7721('0x6')](_0x4d6446,_0x5bf160);_0xce17f9(null);};}for(var e in events){if(events[_0x7721('0x7')](e)){var event=events[e];FaxMessage[_0x7721('0x8')](e,emitEvent(event));}}module[_0x7721('0x9')]=FaxMessageEvents;
\ No newline at end of file
+var _0x9957=['setMaxListeners','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','FaxMessage'];(function(_0x3a06b6,_0x50e5cd){var _0x229e2a=function(_0x51c86c){while(--_0x51c86c){_0x3a06b6['push'](_0x3a06b6['shift']());}};_0x229e2a(++_0x50e5cd);}(_0x9957,0x93));var _0x7995=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x9957[_0x6131cd];return _0x47e916;};'use strict';var EventEmitter=require(_0x7995('0x0'));var FaxMessage=require(_0x7995('0x1'))['db'][_0x7995('0x2')];var FaxMessageEvents=new EventEmitter();FaxMessageEvents[_0x7995('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x7995('0x4'),'afterDestroy':_0x7995('0x5')};function emitEvent(_0x1902b4){return function(_0x462a03,_0x576d89,_0x744bea){FaxMessageEvents[_0x7995('0x6')](_0x1902b4+':'+_0x462a03['id'],_0x462a03);FaxMessageEvents[_0x7995('0x6')](_0x1902b4,_0x462a03);_0x744bea(null);};}for(var e in events){if(events[_0x7995('0x7')](e)){var event=events[e];FaxMessage[_0x7995('0x8')](e,emitEvent(event));}}module[_0x7995('0x9')]=FaxMessageEvents;
\ No newline at end of file
diff --git a/server/api/faxMessage/faxMessage.model.js b/server/api/faxMessage/faxMessage.model.js
index 363b1cd..efe93ef 100644
--- a/server/api/faxMessage/faxMessage.model.js
+++ b/server/api/faxMessage/faxMessage.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xd356=['toLowerCase','catch','error','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./faxMessage.attributes','define','fax_messages','body','FULLTEXT','get','direction','out','secret','isNil','UserId','FaxInteraction','findOne','FaxInteractionId','then','update','createdAt'];(function(_0x3f6b1b,_0x58d3d6){var _0x4a3d2b=function(_0x5648f0){while(--_0x5648f0){_0x3f6b1b['push'](_0x3f6b1b['shift']());}};_0x4a3d2b(++_0x58d3d6);}(_0xd356,0x1a8));var _0x6d35=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd356[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x6d35('0x0'));var util=require('util');var logger=require(_0x6d35('0x1'))(_0x6d35('0x2'));var moment=require(_0x6d35('0x3'));var BPromise=require(_0x6d35('0x4'));var rp=require(_0x6d35('0x5'));var fs=require('fs');var path=require(_0x6d35('0x6'));var rimraf=require(_0x6d35('0x7'));var config=require(_0x6d35('0x8'));var attributes=require(_0x6d35('0x9'));module['exports']=function(_0xd24bd5,_0x42f951){return _0xd24bd5[_0x6d35('0xa')]('FaxMessage',attributes,{'tableName':_0x6d35('0xb'),'paranoid':![],'indexes':[{'name':'fti_fax_messages','fields':[_0x6d35('0xc')],'type':_0x6d35('0xd')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x4f5a32,_0x358b09,_0x2f74b5){var _0x41f83c=_0xd24bd5['models'];var _0x678c8d=_0x4f5a32[_0x6d35('0xe')]({'plain':!![]});if(_0x678c8d[_0x6d35('0xf')]['toLowerCase']()==='in'||_0x678c8d['direction']['toLowerCase']()===_0x6d35('0x10')&&!_0x678c8d[_0x6d35('0x11')]&&!_[_0x6d35('0x12')](_0x678c8d[_0x6d35('0x13')])){_0x41f83c[_0x6d35('0x14')][_0x6d35('0x15')]({'where':{'id':_0x678c8d[_0x6d35('0x16')]}})[_0x6d35('0x17')](function(_0x32bbd2){if(_0x32bbd2){_0x32bbd2[_0x6d35('0x18')]({'lastMsgAt':_0x678c8d[_0x6d35('0x19')],'lastMsgDirection':_0x678c8d['direction'][_0x6d35('0x1a')]()});}})[_0x6d35('0x1b')](function(_0x564167){console[_0x6d35('0x1c')](_0x564167);});}_0x2f74b5();}},'charset':'utf8mb4','collate':_0x6d35('0x1d')});};
\ No newline at end of file
+var _0x72df=['catch','error','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment','./faxMessage.attributes','exports','define','FaxMessage','fax_messages','fti_fax_messages','body','FULLTEXT','models','toLowerCase','direction','isNil','UserId','FaxInteraction','FaxInteractionId','update'];(function(_0x16a9e3,_0x2e0676){var _0x2fd8cf=function(_0x77a40d){while(--_0x77a40d){_0x16a9e3['push'](_0x16a9e3['shift']());}};_0x2fd8cf(++_0x2e0676);}(_0x72df,0xf6));var _0xf72d=function(_0x30e620,_0x47b066){_0x30e620=_0x30e620-0x0;var _0x54591b=_0x72df[_0x30e620];return _0x54591b;};'use strict';var _=require(_0xf72d('0x0'));var util=require(_0xf72d('0x1'));var logger=require(_0xf72d('0x2'))(_0xf72d('0x3'));var moment=require('moment');var BPromise=require(_0xf72d('0x4'));var rp=require(_0xf72d('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf72d('0x6'));var config=require(_0xf72d('0x7'));var attributes=require(_0xf72d('0x8'));module[_0xf72d('0x9')]=function(_0x584c50,_0x2a8047){return _0x584c50[_0xf72d('0xa')](_0xf72d('0xb'),attributes,{'tableName':_0xf72d('0xc'),'paranoid':![],'indexes':[{'name':_0xf72d('0xd'),'fields':[_0xf72d('0xe')],'type':_0xf72d('0xf')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x2c10db,_0x2b7043,_0x1e0f5f){var _0x5d3b09=_0x584c50[_0xf72d('0x10')];var _0x31b541=_0x2c10db['get']({'plain':!![]});if(_0x31b541['direction'][_0xf72d('0x11')]()==='in'||_0x31b541[_0xf72d('0x12')]['toLowerCase']()==='out'&&!_0x31b541['secret']&&!_[_0xf72d('0x13')](_0x31b541[_0xf72d('0x14')])){_0x5d3b09[_0xf72d('0x15')]['findOne']({'where':{'id':_0x31b541[_0xf72d('0x16')]}})['then'](function(_0x29ef66){if(_0x29ef66){_0x29ef66[_0xf72d('0x17')]({'lastMsgAt':_0x31b541['createdAt'],'lastMsgDirection':_0x31b541[_0xf72d('0x12')]['toLowerCase']()});}})[_0xf72d('0x18')](function(_0x11a8c){console[_0xf72d('0x19')](_0x11a8c);});}_0x1e0f5f();}},'charset':'utf8mb4','collate':_0xf72d('0x1a')});};
\ No newline at end of file
diff --git a/server/api/faxMessage/faxMessage.rpc.js b/server/api/faxMessage/faxMessage.rpc.js
index 8f86e1a..b671692 100644
--- a/server/api/faxMessage/faxMessage.rpc.js
+++ b/server/api/faxMessage/faxMessage.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x53a6=['where','attributes','limit','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','client','http','redis','defaults','localhost','./faxMessage.socket','register','request','then','info','FaxMessage,\x20%s,\x20%s','request\x20sent','debug','FaxMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','CreateFaxMessage','FaxMessage','body','options','raw','UpdateFaxMessage','update'];(function(_0x4552be,_0x16e1c1){var _0x47505e=function(_0x152f1a){while(--_0x152f1a){_0x4552be['push'](_0x4552be['shift']());}};_0x47505e(++_0x16e1c1);}(_0x53a6,0x18f));var _0x653a=function(_0x564ebb,_0x439c1c){_0x564ebb=_0x564ebb-0x0;var _0x5c310f=_0x53a6[_0x564ebb];return _0x5c310f;};'use strict';var _=require(_0x653a('0x0'));var util=require('util');var moment=require(_0x653a('0x1'));var BPromise=require('bluebird');var rs=require(_0x653a('0x2'));var fs=require('fs');var Redis=require(_0x653a('0x3'));var db=require(_0x653a('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x653a('0x5'))(_0x653a('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x653a('0x7')][_0x653a('0x8')]({'port':0x232a});config[_0x653a('0x9')]=_[_0x653a('0xa')](config[_0x653a('0x9')],{'host':_0x653a('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x653a('0x9')]));require(_0x653a('0xc'))[_0x653a('0xd')](socket);function respondWithRpcPromise(_0xe2a1c4,_0x33834c,_0x2c14d5){return new BPromise(function(_0x2e270e,_0x30f534){return client[_0x653a('0xe')](_0xe2a1c4,_0x2c14d5)[_0x653a('0xf')](function(_0x3ab79a){logger[_0x653a('0x10')](_0x653a('0x11'),_0x33834c,_0x653a('0x12'));logger[_0x653a('0x13')](_0x653a('0x14'),_0x33834c,_0x653a('0x12'),JSON[_0x653a('0x15')](_0x3ab79a));if(_0x3ab79a[_0x653a('0x16')]){if(_0x3ab79a[_0x653a('0x16')][_0x653a('0x17')]===0x1f4){logger[_0x653a('0x16')]('FaxMessage,\x20%s,\x20%s',_0x33834c,_0x3ab79a[_0x653a('0x16')][_0x653a('0x18')]);return _0x30f534(_0x3ab79a[_0x653a('0x16')]['message']);}logger[_0x653a('0x16')]('FaxMessage,\x20%s,\x20%s',_0x33834c,_0x3ab79a[_0x653a('0x16')][_0x653a('0x18')]);return _0x2e270e(_0x3ab79a['error'][_0x653a('0x18')]);}else{logger[_0x653a('0x10')](_0x653a('0x11'),_0x33834c,_0x653a('0x12'));_0x2e270e(_0x3ab79a['result'][_0x653a('0x18')]);}})[_0x653a('0x19')](function(_0x48a0af){logger['error'](_0x653a('0x11'),_0x33834c,_0x48a0af);_0x30f534(_0x48a0af);});});}exports[_0x653a('0x1a')]=function(_0x220f36){var _0x2b1f1d=this;return new Promise(function(_0x37c63d,_0x2c12e2){return db[_0x653a('0x1b')]['create'](_0x220f36[_0x653a('0x1c')],{'raw':_0x220f36['options']?_0x220f36[_0x653a('0x1d')][_0x653a('0x1e')]===undefined?!![]:![]:!![]})[_0x653a('0xf')](function(_0x3949e0){logger[_0x653a('0x10')](_0x653a('0x1a'),_0x220f36);logger[_0x653a('0x13')](_0x653a('0x1a'),_0x220f36,JSON[_0x653a('0x15')](_0x3949e0));_0x37c63d(_0x3949e0);})[_0x653a('0x19')](function(_0x7d5997){logger[_0x653a('0x16')](_0x653a('0x1a'),_0x7d5997['message'],_0x220f36);_0x2c12e2(_0x2b1f1d[_0x653a('0x16')](0x1f4,_0x7d5997[_0x653a('0x18')]));});});};exports[_0x653a('0x1f')]=function(_0x546351){var _0x12ba9f=this;return new Promise(function(_0x25ac2a,_0x1fb035){return db['FaxMessage'][_0x653a('0x20')](_0x546351[_0x653a('0x1c')],{'raw':_0x546351[_0x653a('0x1d')]?_0x546351[_0x653a('0x1d')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x546351[_0x653a('0x1d')]?_0x546351[_0x653a('0x1d')][_0x653a('0x21')]||null:null,'attributes':_0x546351[_0x653a('0x1d')]?_0x546351[_0x653a('0x1d')][_0x653a('0x22')]||null:null,'limit':_0x546351[_0x653a('0x1d')]?_0x546351['options'][_0x653a('0x23')]||null:null})[_0x653a('0xf')](function(_0xd5803f){logger['info']('UpdateFaxMessage',_0x546351);logger[_0x653a('0x13')](_0x653a('0x1f'),_0x546351,JSON[_0x653a('0x15')](_0xd5803f));_0x25ac2a(_0xd5803f);})[_0x653a('0x19')](function(_0x3554c0){logger[_0x653a('0x16')](_0x653a('0x1f'),_0x3554c0['message'],_0x546351);_0x1fb035(_0x12ba9f[_0x653a('0x16')](0x1f4,_0x3554c0[_0x653a('0x18')]));});});};
\ No newline at end of file
+var _0x8ee5=['message','info','CreateFaxMessage','FaxMessage','options','raw','update','body','where','attributes','limit','UpdateFaxMessage','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','http','redis','localhost','socket.io-emitter','./faxMessage.socket','register','then','request\x20sent','debug','FaxMessage,\x20%s,\x20%s,\x20%s','stringify','error','FaxMessage,\x20%s,\x20%s'];(function(_0x22f164,_0xaa4f80){var _0x51ab95=function(_0x190b68){while(--_0x190b68){_0x22f164['push'](_0x22f164['shift']());}};_0x51ab95(++_0xaa4f80);}(_0x8ee5,0xbc));var _0x58ee=function(_0x1f18d9,_0x317307){_0x1f18d9=_0x1f18d9-0x0;var _0x10d8d7=_0x8ee5[_0x1f18d9];return _0x10d8d7;};'use strict';var _=require(_0x58ee('0x0'));var util=require(_0x58ee('0x1'));var moment=require(_0x58ee('0x2'));var BPromise=require(_0x58ee('0x3'));var rs=require(_0x58ee('0x4'));var fs=require('fs');var Redis=require(_0x58ee('0x5'));var db=require(_0x58ee('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x58ee('0x7'))(_0x58ee('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x58ee('0x9')]({'port':0x232a});config[_0x58ee('0xa')]=_['defaults'](config[_0x58ee('0xa')],{'host':_0x58ee('0xb'),'port':0x18eb});var socket=require(_0x58ee('0xc'))(new Redis(config[_0x58ee('0xa')]));require(_0x58ee('0xd'))[_0x58ee('0xe')](socket);function respondWithRpcPromise(_0x1006b5,_0x2fc166,_0x4abc18){return new BPromise(function(_0x403f73,_0x296d10){return client['request'](_0x1006b5,_0x4abc18)[_0x58ee('0xf')](function(_0x5224be){logger['info']('FaxMessage,\x20%s,\x20%s',_0x2fc166,_0x58ee('0x10'));logger[_0x58ee('0x11')](_0x58ee('0x12'),_0x2fc166,_0x58ee('0x10'),JSON[_0x58ee('0x13')](_0x5224be));if(_0x5224be[_0x58ee('0x14')]){if(_0x5224be[_0x58ee('0x14')]['code']===0x1f4){logger[_0x58ee('0x14')](_0x58ee('0x15'),_0x2fc166,_0x5224be[_0x58ee('0x14')][_0x58ee('0x16')]);return _0x296d10(_0x5224be[_0x58ee('0x14')][_0x58ee('0x16')]);}logger['error'](_0x58ee('0x15'),_0x2fc166,_0x5224be[_0x58ee('0x14')][_0x58ee('0x16')]);return _0x403f73(_0x5224be['error'][_0x58ee('0x16')]);}else{logger[_0x58ee('0x17')](_0x58ee('0x15'),_0x2fc166,'request\x20sent');_0x403f73(_0x5224be['result'][_0x58ee('0x16')]);}})['catch'](function(_0x2635ab){logger[_0x58ee('0x14')](_0x58ee('0x15'),_0x2fc166,_0x2635ab);_0x296d10(_0x2635ab);});});}exports[_0x58ee('0x18')]=function(_0x423a5e){var _0x54fd16=this;return new Promise(function(_0x16c0bf,_0x53d3c5){return db[_0x58ee('0x19')]['create'](_0x423a5e['body'],{'raw':_0x423a5e[_0x58ee('0x1a')]?_0x423a5e['options'][_0x58ee('0x1b')]===undefined?!![]:![]:!![]})[_0x58ee('0xf')](function(_0x416446){logger['info'](_0x58ee('0x18'),_0x423a5e);logger[_0x58ee('0x11')]('CreateFaxMessage',_0x423a5e,JSON[_0x58ee('0x13')](_0x416446));_0x16c0bf(_0x416446);})['catch'](function(_0x48589c){logger[_0x58ee('0x14')]('CreateFaxMessage',_0x48589c[_0x58ee('0x16')],_0x423a5e);_0x53d3c5(_0x54fd16[_0x58ee('0x14')](0x1f4,_0x48589c[_0x58ee('0x16')]));});});};exports['UpdateFaxMessage']=function(_0x5339ef){var _0x486d12=this;return new Promise(function(_0x13287d,_0x4f94ae){return db[_0x58ee('0x19')][_0x58ee('0x1c')](_0x5339ef[_0x58ee('0x1d')],{'raw':_0x5339ef[_0x58ee('0x1a')]?_0x5339ef[_0x58ee('0x1a')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5339ef['options']?_0x5339ef[_0x58ee('0x1a')][_0x58ee('0x1e')]||null:null,'attributes':_0x5339ef['options']?_0x5339ef['options'][_0x58ee('0x1f')]||null:null,'limit':_0x5339ef['options']?_0x5339ef[_0x58ee('0x1a')][_0x58ee('0x20')]||null:null})[_0x58ee('0xf')](function(_0x207286){logger[_0x58ee('0x17')](_0x58ee('0x21'),_0x5339ef);logger['debug'](_0x58ee('0x21'),_0x5339ef,JSON[_0x58ee('0x13')](_0x207286));_0x13287d(_0x207286);})[_0x58ee('0x22')](function(_0x10567d){logger['error'](_0x58ee('0x21'),_0x10567d[_0x58ee('0x16')],_0x5339ef);_0x4f94ae(_0x486d12[_0x58ee('0x14')](0x1f4,_0x10567d['message']));});});};
\ No newline at end of file
diff --git a/server/api/faxMessage/faxMessage.socket.js b/server/api/faxMessage/faxMessage.socket.js
index b093546..a9cbf8c 100644
--- a/server/api/faxMessage/faxMessage.socket.js
+++ b/server/api/faxMessage/faxMessage.socket.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9957=['register','length','faxMessage:','./faxMessage.events','save','remove','update','emit','removeListener'];(function(_0x5037ab,_0x43209e){var _0x512adb=function(_0x261783){while(--_0x261783){_0x5037ab['push'](_0x5037ab['shift']());}};_0x512adb(++_0x43209e);}(_0x9957,0x93));var _0x7995=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x9957[_0x6c993a];return _0x27f547;};'use strict';var FaxMessageEvents=require(_0x7995('0x0'));var events=[_0x7995('0x1'),_0x7995('0x2'),_0x7995('0x3')];function createListener(_0x5b96eb,_0x86c128){return function(_0x3c58eb){_0x86c128[_0x7995('0x4')](_0x5b96eb,_0x3c58eb);};}function removeListener(_0x462a03,_0x576d89){return function(){FaxMessageEvents[_0x7995('0x5')](_0x462a03,_0x576d89);};}exports[_0x7995('0x6')]=function(_0x137b6b){for(var _0x219534=0x0,_0xbda126=events[_0x7995('0x7')];_0x219534<_0xbda126;_0x219534++){var _0x4996ca=events[_0x219534];var _0x465276=createListener(_0x7995('0x8')+_0x4996ca,_0x137b6b);FaxMessageEvents['on'](_0x4996ca,_0x465276);}};
\ No newline at end of file
+var _0xa9e0=['register','length','faxMessage:','./faxMessage.events','save','remove','emit','removeListener'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2a6809,_0x44edde){_0x2a6809=_0x2a6809-0x0;var _0x11c371=_0xa9e0[_0x2a6809];return _0x11c371;};'use strict';var FaxMessageEvents=require(_0x0a9e('0x0'));var events=[_0x0a9e('0x1'),_0x0a9e('0x2'),'update'];function createListener(_0x550fbc,_0x18d5c9){return function(_0x4ce2f1){_0x18d5c9[_0x0a9e('0x3')](_0x550fbc,_0x4ce2f1);};}function removeListener(_0x432180,_0x2ab90b){return function(){FaxMessageEvents[_0x0a9e('0x4')](_0x432180,_0x2ab90b);};}exports[_0x0a9e('0x5')]=function(_0x57b080){for(var _0x219af0=0x0,_0x441e3a=events[_0x0a9e('0x6')];_0x219af0<_0x441e3a;_0x219af0++){var _0x5f41ea=events[_0x219af0];var _0x503809=createListener(_0x0a9e('0x7')+_0x5f41ea,_0x57b080);FaxMessageEvents['on'](_0x5f41ea,_0x503809);}};
\ No newline at end of file
diff --git a/server/api/faxMessage/index.js b/server/api/faxMessage/index.js
index c5b0a4f..bca393f 100644
--- a/server/api/faxMessage/index.js
+++ b/server/api/faxMessage/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x3c29=['exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxMessage.controller','get','index','isAuthenticated','describe','show','download','post','tracked','fax','faxmessage:create','create','put','update','/:id/reject','reject','/:id'];(function(_0xcd4585,_0x14cf77){var _0x4e09ab=function(_0x5da966){while(--_0x5da966){_0xcd4585['push'](_0xcd4585['shift']());}};_0x4e09ab(++_0x14cf77);}(_0x3c29,0x16d));var _0x93c2=function(_0x29476b,_0x309fe2){_0x29476b=_0x29476b-0x0;var _0x2f2237=_0x3c29[_0x29476b];return _0x2f2237;};'use strict';var multer=require(_0x93c2('0x0'));var util=require(_0x93c2('0x1'));var path=require(_0x93c2('0x2'));var timeout=require('connect-timeout');var express=require(_0x93c2('0x3'));var router=express[_0x93c2('0x4')]();var auth=require(_0x93c2('0x5'));var interaction=require(_0x93c2('0x6'));var config=require(_0x93c2('0x7'));var controller=require(_0x93c2('0x8'));router[_0x93c2('0x9')]('/',auth['isAuthenticated'](),controller[_0x93c2('0xa')]);router[_0x93c2('0x9')]('/describe',auth[_0x93c2('0xb')](),controller[_0x93c2('0xc')]);router[_0x93c2('0x9')]('/:id',auth['isAuthenticated'](),controller[_0x93c2('0xd')]);router['get']('/:id/download',auth[_0x93c2('0xb')](),controller[_0x93c2('0xe')]);router[_0x93c2('0xf')]('/',auth['isAuthenticated'](),interaction[_0x93c2('0x10')](_0x93c2('0x11'),_0x93c2('0x12')),controller[_0x93c2('0x13')]);router[_0x93c2('0x14')]('/:id',auth[_0x93c2('0xb')](),controller[_0x93c2('0x15')]);router[_0x93c2('0x14')]('/:id/accept',auth[_0x93c2('0xb')](),controller['accept']);router[_0x93c2('0x14')](_0x93c2('0x16'),auth[_0x93c2('0xb')](),controller[_0x93c2('0x17')]);router['delete'](_0x93c2('0x18'),auth[_0x93c2('0xb')](),controller['destroy']);module[_0x93c2('0x19')]=router;
\ No newline at end of file
+var _0xb25b=['isAuthenticated','index','/describe','describe','/:id','show','download','post','tracked','fax','faxmessage:create','create','put','update','/:id/accept','accept','/:id/reject','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxMessage.controller','get'];(function(_0x883d7,_0x28edb8){var _0x1559d6=function(_0x2a245b){while(--_0x2a245b){_0x883d7['push'](_0x883d7['shift']());}};_0x1559d6(++_0x28edb8);}(_0xb25b,0x12b));var _0xbb25=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xb25b[_0x2641f9];return _0x585741;};'use strict';var multer=require(_0xbb25('0x0'));var util=require(_0xbb25('0x1'));var path=require(_0xbb25('0x2'));var timeout=require(_0xbb25('0x3'));var express=require(_0xbb25('0x4'));var router=express[_0xbb25('0x5')]();var auth=require(_0xbb25('0x6'));var interaction=require(_0xbb25('0x7'));var config=require(_0xbb25('0x8'));var controller=require(_0xbb25('0x9'));router[_0xbb25('0xa')]('/',auth[_0xbb25('0xb')](),controller[_0xbb25('0xc')]);router[_0xbb25('0xa')](_0xbb25('0xd'),auth[_0xbb25('0xb')](),controller[_0xbb25('0xe')]);router[_0xbb25('0xa')](_0xbb25('0xf'),auth['isAuthenticated'](),controller[_0xbb25('0x10')]);router[_0xbb25('0xa')]('/:id/download',auth[_0xbb25('0xb')](),controller[_0xbb25('0x11')]);router[_0xbb25('0x12')]('/',auth[_0xbb25('0xb')](),interaction[_0xbb25('0x13')](_0xbb25('0x14'),_0xbb25('0x15')),controller[_0xbb25('0x16')]);router[_0xbb25('0x17')]('/:id',auth[_0xbb25('0xb')](),controller[_0xbb25('0x18')]);router[_0xbb25('0x17')](_0xbb25('0x19'),auth['isAuthenticated'](),controller[_0xbb25('0x1a')]);router[_0xbb25('0x17')](_0xbb25('0x1b'),auth[_0xbb25('0xb')](),controller['reject']);router[_0xbb25('0x1c')]('/:id',auth[_0xbb25('0xb')](),controller[_0xbb25('0x1d')]);module[_0xbb25('0x1e')]=router;
\ No newline at end of file
diff --git a/server/api/faxQueue/faxQueue.attributes.js b/server/api/faxQueue/faxQueue.attributes.js
index 94e86b0..a19e17a 100644
--- a/server/api/faxQueue/faxQueue.attributes.js
+++ b/server/api/faxQueue/faxQueue.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x2194=['roundrobin','exports','STRING','INTEGER','ENUM','rrmemory','beepall'];(function(_0x5f2c87,_0x460c86){var _0x4bbb21=function(_0x482512){while(--_0x482512){_0x5f2c87['push'](_0x5f2c87['shift']());}};_0x4bbb21(++_0x460c86);}(_0x2194,0x8d));var _0x4219=function(_0xfcbcb8,_0x35bf6b){_0xfcbcb8=_0xfcbcb8-0x0;var _0x1b1f97=_0x2194[_0xfcbcb8];return _0x1b1f97;};'use strict';var Sequelize=require('sequelize');module[_0x4219('0x0')]={'name':{'type':Sequelize[_0x4219('0x1')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x4219('0x1')]},'timeout':{'type':Sequelize[_0x4219('0x2')],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x4219('0x3')](_0x4219('0x4'),_0x4219('0x5'),_0x4219('0x6')),'allowNull':![]},'lastAgent':{'type':Sequelize['INTEGER'],'defaultValue':0x0}};
\ No newline at end of file
+var _0xb59d=['name','INTEGER','ENUM','rrmemory','roundrobin','sequelize','exports','STRING'];(function(_0x40220a,_0x22feb1){var _0x3903cc=function(_0x33a296){while(--_0x33a296){_0x40220a['push'](_0x40220a['shift']());}};_0x3903cc(++_0x22feb1);}(_0xb59d,0x6d));var _0xdb59=function(_0x2913f6,_0x265243){_0x2913f6=_0x2913f6-0x0;var _0x213194=_0xb59d[_0x2913f6];return _0x213194;};'use strict';var Sequelize=require(_0xdb59('0x0'));module[_0xdb59('0x1')]={'name':{'type':Sequelize[_0xdb59('0x2')],'unique':_0xdb59('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xdb59('0x2')]},'timeout':{'type':Sequelize[_0xdb59('0x4')],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xdb59('0x5')](_0xdb59('0x6'),'beepall',_0xdb59('0x7')),'allowNull':![]},'lastAgent':{'type':Sequelize['INTEGER'],'defaultValue':0x0}};
\ No newline at end of file
diff --git a/server/api/faxQueue/faxQueue.controller.js b/server/api/faxQueue/faxQueue.controller.js
index 4a1c4e8..8101e7e 100644
--- a/server/api/faxQueue/faxQueue.controller.js
+++ b/server/api/faxQueue/faxQueue.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x4d5a=['find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','FaxQueues','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','getMembers','findOne','hasOwnProperty','FaxQueueId','UserFaxQueue','findAll','User','agent','faxPause','updatedAt','createdAt','format','SIP','getTeams','Team','addTeams','ids','Agents','voicePause','interface','flatMap','transaction','findOrCreate','forEach','emit','userFaxQueue:save','removeTeams','select','field','tq.TeamId','from','team_has_fax_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','FaxQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','sequelize','toString','QueryTypes','SELECT','every','TeamId','includes','all','compact','value','isEmpty','removeAgents','userFaxQueue:remove','addAgents','omit','spread','isArray','getAgents','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','redis','defaults','localhost','./faxQueue.socket','register','sendStatus','status','json','offset','limit','set','Content-Range','apply','reject','update','destroy','then','get','end','error','stack','name','send','index','map','FaxQueue','rawAttributes','fieldName','model','query','intersection','attributes','fields','length','nolimit','order','sort','where','filters','pick','merge','filter','options','count','includeAll','include','rows','catch','show','keys'];(function(_0x4bc5a1,_0x276471){var _0x498659=function(_0x2e8c81){while(--_0x2e8c81){_0x4bc5a1['push'](_0x4bc5a1['shift']());}};_0x498659(++_0x276471);}(_0x4d5a,0x15e));var _0xa4d5=function(_0x13e741,_0x5d3c24){_0x13e741=_0x13e741-0x0;var _0x3f8bb3=_0x4d5a[_0x13e741];return _0x3f8bb3;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xa4d5('0x0'));var rimraf=require(_0xa4d5('0x1'));var zipdir=require(_0xa4d5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xa4d5('0x3'));var moment=require(_0xa4d5('0x4'));var BPromise=require(_0xa4d5('0x5'));var Mustache=require(_0xa4d5('0x6'));var util=require('util');var path=require(_0xa4d5('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xa4d5('0x8'));var fs=require('fs');var _=require(_0xa4d5('0x9'));var squel=require(_0xa4d5('0xa'));var crypto=require(_0xa4d5('0xb'));var jsforce=require(_0xa4d5('0xc'));var deskjs=require(_0xa4d5('0xd'));var toCsv=require(_0xa4d5('0xe'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xa4d5('0xf'));var authService=require(_0xa4d5('0x10'));var qs=require(_0xa4d5('0x11'));var as=require(_0xa4d5('0x12'));var hardwareService=require(_0xa4d5('0x13'));var logger=require(_0xa4d5('0x14'))(_0xa4d5('0x15'));var utils=require(_0xa4d5('0x16'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config[_0xa4d5('0x17')]=_[_0xa4d5('0x18')](config[_0xa4d5('0x17')],{'host':_0xa4d5('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xa4d5('0x1a'))[_0xa4d5('0x1b')](socket);function respondWithStatusCode(_0x9d459a,_0x16faa3){_0x16faa3=_0x16faa3||0xcc;return function(_0x22a9ae){if(_0x22a9ae){return _0x9d459a[_0xa4d5('0x1c')](_0x16faa3);}return _0x9d459a['status'](_0x16faa3)['end']();};}function respondWithResult(_0xec3425,_0x138112){_0x138112=_0x138112||0xc8;return function(_0x527ef2){if(_0x527ef2){return _0xec3425[_0xa4d5('0x1d')](_0x138112)[_0xa4d5('0x1e')](_0x527ef2);}};}function respondWithFilteredResult(_0x67acdc,_0x40eefe){return function(_0x37d983){if(_0x37d983){var _0x3d4c69=_0x37d983['count'],_0x508595=_0x40eefe[_0xa4d5('0x1f')],_0x405789=_0x40eefe['offset']+_0x40eefe[_0xa4d5('0x20')],_0x5b4086;if(_0x405789>=_0x3d4c69){_0x405789=_0x3d4c69;_0x5b4086=0xc8;}else{_0x5b4086=0xce;}_0x67acdc[_0xa4d5('0x1d')](_0x5b4086);return _0x67acdc[_0xa4d5('0x21')](_0xa4d5('0x22'),_0x508595+'-'+_0x405789+'/'+_0x3d4c69)[_0xa4d5('0x1e')](_0x37d983);}return null;};}function patchUpdates(_0x1642da){return function(_0x51efd0){try{jsonpatch[_0xa4d5('0x23')](_0x51efd0,_0x1642da,!![]);}catch(_0x42074c){return BPromise[_0xa4d5('0x24')](_0x42074c);}return _0x51efd0['save']();};}function saveUpdates(_0x5bbc83,_0x4bff89){return function(_0x1b450f){if(_0x1b450f){return _0x1b450f[_0xa4d5('0x25')](_0x5bbc83)['then'](function(_0x53fdfe){return _0x53fdfe;});}return null;};}function removeEntity(_0x6af851,_0x1aea16){return function(_0x913551){if(_0x913551){return _0x913551[_0xa4d5('0x26')]()[_0xa4d5('0x27')](function(){var _0x259c30=_0x913551[_0xa4d5('0x28')]({'plain':!![]});var _0x4c91df='FaxQueues';return db['UserProfileResource'][_0xa4d5('0x26')]({'where':{'type':_0x4c91df,'resourceId':_0x259c30['id']}})[_0xa4d5('0x27')](function(){return _0x913551;});})[_0xa4d5('0x27')](function(){_0x6af851[_0xa4d5('0x1d')](0xcc)[_0xa4d5('0x29')]();});}};}function handleEntityNotFound(_0x14dbe8,_0x471e5f){return function(_0x6e161b){if(!_0x6e161b){_0x14dbe8[_0xa4d5('0x1c')](0x194);}return _0x6e161b;};}function handleError(_0x16a6e9,_0x169382){_0x169382=_0x169382||0x1f4;return function(_0x2909fb){logger[_0xa4d5('0x2a')](_0x2909fb[_0xa4d5('0x2b')]);if(_0x2909fb[_0xa4d5('0x2c')]){delete _0x2909fb[_0xa4d5('0x2c')];}_0x16a6e9['status'](_0x169382)[_0xa4d5('0x2d')](_0x2909fb);};}exports[_0xa4d5('0x2e')]=function(_0x4bf431,_0x471d03){var _0x185ccc={},_0x409231={},_0x2d2d66={'count':0x0,'rows':[]};var _0x11712d=_[_0xa4d5('0x2f')](db[_0xa4d5('0x30')][_0xa4d5('0x31')],function(_0x3d2118){return{'name':_0x3d2118[_0xa4d5('0x32')],'type':_0x3d2118['type']['key']};});_0x409231[_0xa4d5('0x33')]=_[_0xa4d5('0x2f')](_0x11712d,_0xa4d5('0x2c'));_0x409231[_0xa4d5('0x34')]=_['keys'](_0x4bf431[_0xa4d5('0x34')]);_0x409231['filters']=_[_0xa4d5('0x35')](_0x409231[_0xa4d5('0x33')],_0x409231[_0xa4d5('0x34')]);_0x185ccc[_0xa4d5('0x36')]=_[_0xa4d5('0x35')](_0x409231[_0xa4d5('0x33')],qs[_0xa4d5('0x37')](_0x4bf431[_0xa4d5('0x34')][_0xa4d5('0x37')]));_0x185ccc[_0xa4d5('0x36')]=_0x185ccc['attributes'][_0xa4d5('0x38')]?_0x185ccc[_0xa4d5('0x36')]:_0x409231[_0xa4d5('0x33')];if(!_0x4bf431['query']['hasOwnProperty'](_0xa4d5('0x39'))){_0x185ccc[_0xa4d5('0x20')]=qs['limit'](_0x4bf431[_0xa4d5('0x34')][_0xa4d5('0x20')]);_0x185ccc[_0xa4d5('0x1f')]=qs['offset'](_0x4bf431[_0xa4d5('0x34')]['offset']);}_0x185ccc[_0xa4d5('0x3a')]=qs['sort'](_0x4bf431[_0xa4d5('0x34')][_0xa4d5('0x3b')]);_0x185ccc[_0xa4d5('0x3c')]=qs[_0xa4d5('0x3d')](_[_0xa4d5('0x3e')](_0x4bf431[_0xa4d5('0x34')],_0x409231[_0xa4d5('0x3d')]),_0x11712d);if(_0x4bf431[_0xa4d5('0x34')]['filter']){_0x185ccc[_0xa4d5('0x3c')]=_[_0xa4d5('0x3f')](_0x185ccc[_0xa4d5('0x3c')],{'$or':_[_0xa4d5('0x2f')](_0x11712d,function(_0xcb857c){if(_0xcb857c['type']!=='VIRTUAL'){var _0x48b0da={};_0x48b0da[_0xcb857c[_0xa4d5('0x2c')]]={'$like':'%'+_0x4bf431[_0xa4d5('0x34')][_0xa4d5('0x40')]+'%'};return _0x48b0da;}})});}_0x185ccc=_[_0xa4d5('0x3f')]({},_0x185ccc,_0x4bf431[_0xa4d5('0x41')]);var _0xb0d47e={'where':_0x185ccc['where']};return db['FaxQueue']['count'](_0xb0d47e)[_0xa4d5('0x27')](function(_0x1caa58){_0x2d2d66[_0xa4d5('0x42')]=_0x1caa58;if(_0x4bf431[_0xa4d5('0x34')][_0xa4d5('0x43')]){_0x185ccc[_0xa4d5('0x44')]=[{'all':!![]}];}return db[_0xa4d5('0x30')]['findAll'](_0x185ccc);})['then'](function(_0xf0da7c){_0x2d2d66[_0xa4d5('0x45')]=_0xf0da7c;return _0x2d2d66;})[_0xa4d5('0x27')](respondWithFilteredResult(_0x471d03,_0x185ccc))[_0xa4d5('0x46')](handleError(_0x471d03,null));};exports[_0xa4d5('0x47')]=function(_0x1ee846,_0x2d279a){var _0x3853f6={'raw':!![],'where':{'id':_0x1ee846['params']['id']}},_0x291fe2={};_0x291fe2[_0xa4d5('0x33')]=_[_0xa4d5('0x48')](db[_0xa4d5('0x30')][_0xa4d5('0x31')]);_0x291fe2['query']=_[_0xa4d5('0x48')](_0x1ee846[_0xa4d5('0x34')]);_0x291fe2[_0xa4d5('0x3d')]=_[_0xa4d5('0x35')](_0x291fe2[_0xa4d5('0x33')],_0x291fe2[_0xa4d5('0x34')]);_0x3853f6[_0xa4d5('0x36')]=_[_0xa4d5('0x35')](_0x291fe2[_0xa4d5('0x33')],qs[_0xa4d5('0x37')](_0x1ee846[_0xa4d5('0x34')][_0xa4d5('0x37')]));_0x3853f6[_0xa4d5('0x36')]=_0x3853f6[_0xa4d5('0x36')]['length']?_0x3853f6['attributes']:_0x291fe2[_0xa4d5('0x33')];if(_0x1ee846[_0xa4d5('0x34')][_0xa4d5('0x43')]){_0x3853f6[_0xa4d5('0x44')]=[{'all':!![]}];}_0x3853f6=_[_0xa4d5('0x3f')]({},_0x3853f6,_0x1ee846[_0xa4d5('0x41')]);return db['FaxQueue'][_0xa4d5('0x49')](_0x3853f6)['then'](handleEntityNotFound(_0x2d279a,null))['then'](respondWithResult(_0x2d279a,null))['catch'](handleError(_0x2d279a,null));};exports[_0xa4d5('0x4a')]=function(_0x4c7aef,_0x4061b7){return db['FaxQueue']['create'](_0x4c7aef[_0xa4d5('0x4b')],{})[_0xa4d5('0x27')](function(_0x1edd36){var _0x5226b5=_0x4c7aef[_0xa4d5('0x4c')][_0xa4d5('0x28')]({'plain':!![]});if(!_0x5226b5)throw new Error(_0xa4d5('0x4d'));if(_0x5226b5['role']===_0xa4d5('0x4c')){var _0xef98cb=_0x1edd36['get']({'plain':!![]});var _0x331632=_0xa4d5('0x4e');return db[_0xa4d5('0x4f')][_0xa4d5('0x49')]({'where':{'name':_0x331632,'userProfileId':_0x5226b5[_0xa4d5('0x50')]},'raw':!![]})[_0xa4d5('0x27')](function(_0xde09f6){if(_0xde09f6&&_0xde09f6[_0xa4d5('0x51')]===0x0){return db['UserProfileResource']['create']({'name':_0xef98cb[_0xa4d5('0x2c')],'resourceId':_0xef98cb['id'],'type':_0xde09f6[_0xa4d5('0x2c')],'sectionId':_0xde09f6['id']},{})[_0xa4d5('0x27')](function(){return _0x1edd36;});}else{return _0x1edd36;}})['catch'](function(_0x461f32){logger[_0xa4d5('0x2a')](_0xa4d5('0x52'),_0x461f32);throw _0x461f32;});}return _0x1edd36;})[_0xa4d5('0x27')](respondWithResult(_0x4061b7,0xc9))['catch'](handleError(_0x4061b7,null));};exports['update']=function(_0x21b119,_0x2ba84e){if(_0x21b119[_0xa4d5('0x4b')]['id']){delete _0x21b119[_0xa4d5('0x4b')]['id'];}return db[_0xa4d5('0x30')][_0xa4d5('0x49')]({'where':{'id':_0x21b119[_0xa4d5('0x53')]['id']}})['then'](handleEntityNotFound(_0x2ba84e,null))[_0xa4d5('0x27')](saveUpdates(_0x21b119[_0xa4d5('0x4b')],null))[_0xa4d5('0x27')](respondWithResult(_0x2ba84e,null))['catch'](handleError(_0x2ba84e,null));};exports[_0xa4d5('0x26')]=function(_0x49a9bb,_0x16e797){return db['FaxQueue'][_0xa4d5('0x49')]({'where':{'id':_0x49a9bb['params']['id']}})[_0xa4d5('0x27')](handleEntityNotFound(_0x16e797,null))[_0xa4d5('0x27')](removeEntity(_0x16e797,null))[_0xa4d5('0x46')](handleError(_0x16e797,null));};exports[_0xa4d5('0x54')]=function(_0x2076cf,_0x4f5a4d){return db[_0xa4d5('0x30')]['describe']()[_0xa4d5('0x27')](respondWithResult(_0x4f5a4d,null))[_0xa4d5('0x46')](handleError(_0x4f5a4d,null));};exports[_0xa4d5('0x55')]=function(_0x4c27e1,_0x4513f6,_0x324588){var _0x433934={'raw':!![],'where':{}},_0x45d4a6={},_0x1dfa53;return db[_0xa4d5('0x30')][_0xa4d5('0x56')]({'where':{'id':_0x4c27e1[_0xa4d5('0x53')]['id']}})['then'](handleEntityNotFound(_0x4513f6,null))[_0xa4d5('0x27')](function(_0x23ca50){if(_0x23ca50){_0x1dfa53=_0x23ca50['get']({'plain':!![]});_0x45d4a6['model']=_['keys'](db['UserFaxQueue'][_0xa4d5('0x31')]);_0x45d4a6[_0xa4d5('0x34')]=_[_0xa4d5('0x48')](_0x4c27e1['query']);_0x45d4a6[_0xa4d5('0x3d')]=_[_0xa4d5('0x35')](_0x45d4a6[_0xa4d5('0x33')],_0x45d4a6[_0xa4d5('0x34')]);_0x433934[_0xa4d5('0x36')]=_['intersection'](_0x45d4a6['model'],qs[_0xa4d5('0x37')](_0x4c27e1[_0xa4d5('0x34')][_0xa4d5('0x37')]));_0x433934['attributes']=_0x433934[_0xa4d5('0x36')][_0xa4d5('0x38')]?_0x433934[_0xa4d5('0x36')]:_0x45d4a6[_0xa4d5('0x33')];if(!_0x4c27e1[_0xa4d5('0x34')][_0xa4d5('0x57')]('nolimit')){_0x433934[_0xa4d5('0x20')]=qs['limit'](_0x4c27e1[_0xa4d5('0x34')][_0xa4d5('0x20')]);_0x433934[_0xa4d5('0x1f')]=qs['offset'](_0x4c27e1[_0xa4d5('0x34')][_0xa4d5('0x1f')]);}_0x433934[_0xa4d5('0x3a')]=qs[_0xa4d5('0x3b')](_0x4c27e1['query'][_0xa4d5('0x3b')]);_0x433934[_0xa4d5('0x3c')]=qs['filters'](_[_0xa4d5('0x3e')](_0x4c27e1[_0xa4d5('0x34')],_0x45d4a6[_0xa4d5('0x3d')]));_0x433934[_0xa4d5('0x3c')][_0xa4d5('0x58')]=_0x23ca50['id'];if(_0x4c27e1['query'][_0xa4d5('0x40')]){_0x433934[_0xa4d5('0x3c')]=_[_0xa4d5('0x3f')](_0x433934['where'],{'$or':_[_0xa4d5('0x2f')](_0x433934['attributes'],function(_0x9f9558){var _0x4983da={};_0x4983da[_0x9f9558]={'$like':'%'+_0x4c27e1[_0xa4d5('0x34')]['filter']+'%'};return _0x4983da;})});}_0x433934=_[_0xa4d5('0x3f')]({},_0x433934,_0x4c27e1[_0xa4d5('0x41')]);return db[_0xa4d5('0x59')][_0xa4d5('0x5a')](_0x433934);}})[_0xa4d5('0x27')](function(_0x517471){if(_0x517471){return db[_0xa4d5('0x5b')]['findAndCountAll']({'where':{'id':_[_0xa4d5('0x2f')](_0x517471,'UserId'),'role':_0xa4d5('0x5c')},'attributes':['id',_0xa4d5('0x2c'),_0xa4d5('0x5d'),_0xa4d5('0x5e'),_0xa4d5('0x5f')]});}})[_0xa4d5('0x27')](function(_0x369036){if(_0x369036){return{'count':_0x369036[_0xa4d5('0x42')],'rows':_[_0xa4d5('0x2f')](_0x369036['rows'],function(_0x548b16){return{'membername':_0x548b16['name'],'UserId':_0x548b16['id'],'queue_name':_0x1dfa53[_0xa4d5('0x2c')],'FaxQueueId':_0x1dfa53['id'],'interface':util[_0xa4d5('0x60')]('%s/%s',_0xa4d5('0x61'),_0x548b16[_0xa4d5('0x2c')]),'penalty':0x0,'paused':_0x548b16[_0xa4d5('0x5d')],'createdAt':_0x548b16[_0xa4d5('0x5f')],'updatedAt':_0x548b16[_0xa4d5('0x5e')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xa4d5('0x27')](respondWithFilteredResult(_0x4513f6,_0x433934))[_0xa4d5('0x46')](handleError(_0x4513f6,null));};exports[_0xa4d5('0x62')]=function(_0x307af9,_0x4455b4,_0x17bc37){var _0x28af3b={};var _0x167488={};var _0x96bf7f;var _0x35b480;return db[_0xa4d5('0x30')]['findOne']({'where':{'id':_0x307af9[_0xa4d5('0x53')]['id']}})[_0xa4d5('0x27')](handleEntityNotFound(_0x4455b4,null))[_0xa4d5('0x27')](function(_0x11d09d){if(_0x11d09d){_0x96bf7f=_0x11d09d;_0x167488[_0xa4d5('0x33')]=_['keys'](db[_0xa4d5('0x63')][_0xa4d5('0x31')]);_0x167488['query']=_['keys'](_0x307af9[_0xa4d5('0x34')]);_0x167488[_0xa4d5('0x3d')]=_['intersection'](_0x167488[_0xa4d5('0x33')],_0x167488[_0xa4d5('0x34')]);_0x28af3b[_0xa4d5('0x36')]=_[_0xa4d5('0x35')](_0x167488[_0xa4d5('0x33')],qs[_0xa4d5('0x37')](_0x307af9[_0xa4d5('0x34')][_0xa4d5('0x37')]));_0x28af3b[_0xa4d5('0x36')]=_0x28af3b[_0xa4d5('0x36')]['length']?_0x28af3b[_0xa4d5('0x36')]:_0x167488[_0xa4d5('0x33')];_0x28af3b[_0xa4d5('0x3a')]=qs[_0xa4d5('0x3b')](_0x307af9['query']['sort']);_0x28af3b[_0xa4d5('0x3c')]=qs[_0xa4d5('0x3d')](_[_0xa4d5('0x3e')](_0x307af9[_0xa4d5('0x34')],_0x167488[_0xa4d5('0x3d')]));if(_0x307af9[_0xa4d5('0x34')][_0xa4d5('0x40')]){_0x28af3b[_0xa4d5('0x3c')]=_[_0xa4d5('0x3f')](_0x28af3b[_0xa4d5('0x3c')],{'$or':_[_0xa4d5('0x2f')](_0x28af3b['attributes'],function(_0x287582){var _0x385397={};_0x385397[_0x287582]={'$like':'%'+_0x307af9['query'][_0xa4d5('0x40')]+'%'};return _0x385397;})});}_0x28af3b=_['merge']({},_0x28af3b,_0x307af9[_0xa4d5('0x41')]);return _0x96bf7f['getTeams'](_0x28af3b);}})[_0xa4d5('0x27')](function(_0x579ee7){if(_0x579ee7){_0x35b480=_0x579ee7[_0xa4d5('0x38')];if(!_0x307af9[_0xa4d5('0x34')][_0xa4d5('0x57')](_0xa4d5('0x39'))){_0x28af3b[_0xa4d5('0x20')]=qs[_0xa4d5('0x20')](_0x307af9['query'][_0xa4d5('0x20')]);_0x28af3b['offset']=qs[_0xa4d5('0x1f')](_0x307af9[_0xa4d5('0x34')][_0xa4d5('0x1f')]);}return _0x96bf7f[_0xa4d5('0x62')](_0x28af3b);}})[_0xa4d5('0x27')](function(_0x58f74f){if(_0x58f74f){return _0x58f74f?{'count':_0x35b480,'rows':_0x58f74f}:null;}})[_0xa4d5('0x27')](respondWithResult(_0x4455b4,null))[_0xa4d5('0x46')](handleError(_0x4455b4,null));};exports[_0xa4d5('0x64')]=function(_0x131a3d,_0x56e7a6,_0x4632ad){var _0x18b0cb=_0x131a3d['body'][_0xa4d5('0x65')];return db['Team']['findAll']({'where':{'id':_0x18b0cb},'attributes':['id'],'include':[{'model':db['User'],'as':_0xa4d5('0x66'),'attributes':['id',_0xa4d5('0x2c'),'online',_0xa4d5('0x67'),_0xa4d5('0x68')],'raw':!![]}]})[_0xa4d5('0x27')](function(_0x27484d){if(_0x27484d){var _0x410d0e=_[_0xa4d5('0x69')](_0x27484d,function(_0x525303){var _0x39c37c=_0x525303[_0xa4d5('0x28')]({'plain':!![]});return _0x39c37c[_0xa4d5('0x66')];});return db[_0xa4d5('0x30')][_0xa4d5('0x49')]({'where':{'id':_0x131a3d[_0xa4d5('0x53')]['id']}})['then'](function(_0x4b4449){return db['sequelize'][_0xa4d5('0x6a')](function(_0x3522c5){return _0x4b4449[_0xa4d5('0x64')](_0x18b0cb,{'transaction':_0x3522c5})[_0xa4d5('0x27')](function(){return BPromise['each'](_0x410d0e,function(_0x59a5dd){return db[_0xa4d5('0x59')][_0xa4d5('0x6b')]({'where':{'UserId':_0x59a5dd['id'],'FaxQueueId':_0x131a3d['params']['id']},'transaction':_0x3522c5});});})[_0xa4d5('0x27')](function(){_0x410d0e[_0xa4d5('0x6c')](function(_0x526a4f){socket[_0xa4d5('0x6d')](_0xa4d5('0x6e'),{'UserId':_0x526a4f['id'],'FaxQueueId':_0x4b4449['id']});});});});});}})[_0xa4d5('0x27')](respondWithStatusCode(_0x56e7a6,null))['catch'](handleError(_0x56e7a6,null));};exports[_0xa4d5('0x6f')]=function(_0x42dd7a,_0x27eb36,_0x5e39c5){return db[_0xa4d5('0x63')]['findAll']({'where':{'id':_0x42dd7a[_0xa4d5('0x34')][_0xa4d5('0x65')]},'attributes':['id'],'include':[{'model':db[_0xa4d5('0x5b')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0xa4d5('0x27')](handleEntityNotFound(_0x27eb36,null))['then'](function(_0x158308){var _0x10ce50=_[_0xa4d5('0x2f')](_0x158308,'id');var _0x529b5e=[];var _0x93e595=[];var _0x13cfe4=squel[_0xa4d5('0x70')]();_0x13cfe4[_0xa4d5('0x71')](_0xa4d5('0x72'))[_0xa4d5('0x73')](_0xa4d5('0x74'),'tq')[_0xa4d5('0x75')](_0xa4d5('0x76'),'ut',_0xa4d5('0x77'))[_0xa4d5('0x3c')](_0xa4d5('0x78'),_0x42dd7a[_0xa4d5('0x53')]['id']);for(var _0x5225a4=0x0;_0x5225a4<_0x158308[_0xa4d5('0x38')];_0x5225a4+=0x1){let _0x346890=_0x158308[_0x5225a4];for(var _0x51a5b0=0x0;_0x51a5b0<_0x346890[_0xa4d5('0x66')]['length'];_0x51a5b0+=0x1){let _0x5438c1=_0x346890[_0xa4d5('0x66')][_0x51a5b0];var _0x319e7d=_0x13cfe4[_0xa4d5('0x79')]();_0x319e7d[_0xa4d5('0x3c')](_0xa4d5('0x7a'),_0x5438c1['id']);_0x93e595['push'](db[_0xa4d5('0x7b')][_0xa4d5('0x34')](_0x319e7d[_0xa4d5('0x7c')](),{'type':db[_0xa4d5('0x7b')][_0xa4d5('0x7d')][_0xa4d5('0x7e')]})[_0xa4d5('0x27')](function(_0x7819ac){if(_0x7819ac[_0xa4d5('0x38')]===0x1){return _0x5438c1['id'];}else{var _0x60f2df=_[_0xa4d5('0x7f')](_[_0xa4d5('0x2f')](_0x7819ac,_0xa4d5('0x80')),function(_0x137155){return _[_0xa4d5('0x81')](_0x10ce50,_0x137155);});if(_0x60f2df){return _0x5438c1['id'];}}}));}}return BPromise[_0xa4d5('0x82')](_0x93e595)[_0xa4d5('0x27')](function(_0x134c9d){_0x529b5e=_(_0x529b5e)['union'](_0x134c9d)[_0xa4d5('0x83')]()[_0xa4d5('0x84')]();return db[_0xa4d5('0x30')][_0xa4d5('0x49')]({'where':{'id':_0x42dd7a[_0xa4d5('0x53')]['id']}})[_0xa4d5('0x27')](function(_0x21bb1d){return db[_0xa4d5('0x7b')][_0xa4d5('0x6a')](function(_0x134ec8){return _0x21bb1d[_0xa4d5('0x6f')](_0x42dd7a[_0xa4d5('0x34')][_0xa4d5('0x65')],{'transaction':_0x134ec8})[_0xa4d5('0x27')](function(){if(!_[_0xa4d5('0x85')](_0x529b5e)){return _0x21bb1d[_0xa4d5('0x86')](_0x529b5e,{'transaction':_0x134ec8});}})['then'](function(){_0x529b5e[_0xa4d5('0x6c')](function(_0x2621b1){socket[_0xa4d5('0x6d')](_0xa4d5('0x87'),{'UserId':_0x2621b1,'FaxQueueId':_0x21bb1d['id']});});});});});});})['then'](respondWithStatusCode(_0x27eb36,null))[_0xa4d5('0x46')](handleError(_0x27eb36,null));};exports[_0xa4d5('0x88')]=function(_0x3f985a,_0x29a8bc,_0x48a102){return db[_0xa4d5('0x30')][_0xa4d5('0x49')]({'where':{'id':_0x3f985a[_0xa4d5('0x53')]['id']}})[_0xa4d5('0x27')](handleEntityNotFound(_0x29a8bc,null))[_0xa4d5('0x27')](function(_0x1268e8){if(_0x1268e8){return _0x1268e8[_0xa4d5('0x88')](_0x3f985a[_0xa4d5('0x4b')][_0xa4d5('0x65')],_[_0xa4d5('0x89')](_0x3f985a[_0xa4d5('0x4b')],[_0xa4d5('0x65'),'id'])||{})[_0xa4d5('0x8a')](function(_0x29837c){for(var _0x51b9fd=0x0;_0x51b9fd<_0x3f985a[_0xa4d5('0x4b')]['ids'][_0xa4d5('0x38')];_0x51b9fd+=0x1){socket['emit'](_0xa4d5('0x6e'),{'UserId':_0x3f985a[_0xa4d5('0x4b')][_0xa4d5('0x65')][_0x51b9fd],'FaxQueueId':_0x3f985a['params']['id']});}return _0x29837c;});}})['then'](respondWithResult(_0x29a8bc,null))['catch'](handleError(_0x29a8bc,null));};exports[_0xa4d5('0x86')]=function(_0x58a95c,_0x3326d9,_0x2b6bcb){return db['FaxQueue'][_0xa4d5('0x49')]({'where':{'id':_0x58a95c[_0xa4d5('0x53')]['id']}})[_0xa4d5('0x27')](handleEntityNotFound(_0x3326d9,null))[_0xa4d5('0x27')](function(_0x5beace){if(_0x5beace){return _0x5beace[_0xa4d5('0x86')](_0x58a95c[_0xa4d5('0x34')][_0xa4d5('0x65')])['then'](function(){if(_[_0xa4d5('0x8b')](_0x58a95c[_0xa4d5('0x34')][_0xa4d5('0x65')])){for(var _0x2e5664=0x0;_0x2e5664<_0x58a95c[_0xa4d5('0x34')][_0xa4d5('0x65')][_0xa4d5('0x38')];_0x2e5664+=0x1){socket[_0xa4d5('0x6d')](_0xa4d5('0x87'),{'UserId':Number(_0x58a95c[_0xa4d5('0x34')][_0xa4d5('0x65')][_0x2e5664]),'FaxQueueId':Number(_0x58a95c[_0xa4d5('0x53')]['id'])});}}else{socket[_0xa4d5('0x6d')]('userFaxQueue:remove',{'UserId':Number(_0x58a95c[_0xa4d5('0x34')][_0xa4d5('0x65')]),'FaxQueueId':Number(_0x58a95c[_0xa4d5('0x53')]['id'])});}});}})[_0xa4d5('0x27')](respondWithStatusCode(_0x3326d9,null))['catch'](handleError(_0x3326d9,null));};exports['getAgents']=function(_0x138c85,_0x569182,_0x264bb0){var _0x4d3997={};var _0x26ec26={};var _0x1be2e2;var _0x5b2e9d;return db[_0xa4d5('0x30')][_0xa4d5('0x56')]({'where':{'id':_0x138c85[_0xa4d5('0x53')]['id']}})['then'](handleEntityNotFound(_0x569182,null))['then'](function(_0x497110){if(_0x497110){_0x1be2e2=_0x497110;_0x26ec26[_0xa4d5('0x33')]=_[_0xa4d5('0x48')](db[_0xa4d5('0x5b')]['rawAttributes']);_0x26ec26[_0xa4d5('0x34')]=_[_0xa4d5('0x48')](_0x138c85[_0xa4d5('0x34')]);_0x26ec26[_0xa4d5('0x3d')]=_[_0xa4d5('0x35')](_0x26ec26[_0xa4d5('0x33')],_0x26ec26['query']);_0x4d3997[_0xa4d5('0x36')]=_[_0xa4d5('0x35')](_0x26ec26[_0xa4d5('0x33')],qs[_0xa4d5('0x37')](_0x138c85['query'][_0xa4d5('0x37')]));_0x4d3997[_0xa4d5('0x36')]=_0x4d3997[_0xa4d5('0x36')][_0xa4d5('0x38')]?_0x4d3997[_0xa4d5('0x36')]:_0x26ec26[_0xa4d5('0x33')];_0x4d3997[_0xa4d5('0x3a')]=qs[_0xa4d5('0x3b')](_0x138c85['query']['sort']);_0x4d3997['where']=qs[_0xa4d5('0x3d')](_[_0xa4d5('0x3e')](_0x138c85['query'],_0x26ec26[_0xa4d5('0x3d')]));if(_0x138c85['query'][_0xa4d5('0x40')]){_0x4d3997[_0xa4d5('0x3c')]=_['merge'](_0x4d3997[_0xa4d5('0x3c')],{'$or':_[_0xa4d5('0x2f')](_0x4d3997['attributes'],function(_0x8a5b1e){var _0x441db3={};_0x441db3[_0x8a5b1e]={'$like':'%'+_0x138c85[_0xa4d5('0x34')]['filter']+'%'};return _0x441db3;})});}_0x4d3997=_[_0xa4d5('0x3f')]({},_0x4d3997,_0x138c85[_0xa4d5('0x41')]);return _0x1be2e2[_0xa4d5('0x8c')](_0x4d3997);}})['then'](function(_0x7e34e4){if(_0x7e34e4){_0x5b2e9d=_0x7e34e4['length'];if(!_0x138c85[_0xa4d5('0x34')][_0xa4d5('0x57')](_0xa4d5('0x39'))){_0x4d3997[_0xa4d5('0x20')]=qs[_0xa4d5('0x20')](_0x138c85[_0xa4d5('0x34')][_0xa4d5('0x20')]);_0x4d3997['offset']=qs[_0xa4d5('0x1f')](_0x138c85[_0xa4d5('0x34')][_0xa4d5('0x1f')]);}return _0x1be2e2[_0xa4d5('0x8c')](_0x4d3997);}})[_0xa4d5('0x27')](function(_0x55f281){if(_0x55f281){return _0x55f281?{'count':_0x5b2e9d,'rows':_0x55f281}:null;}})['then'](respondWithResult(_0x569182,null))[_0xa4d5('0x46')](handleError(_0x569182,null));};
\ No newline at end of file
+var _0x8580=['tq.TeamId','from','team_has_fax_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','FaxQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','toString','QueryTypes','SELECT','every','TeamId','includes','all','compact','value','transaction','isEmpty','forEach','emit','userFaxQueue:remove','addAgents','omit','spread','removeAgents','isArray','getAgents','eml-format','zip-dir','moment','bluebird','util','path','to-csv','ejs','lodash','squel','jsforce','desk.js','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','./faxQueue.socket','register','sendStatus','status','end','json','count','offset','set','apply','reject','save','then','destroy','get','FaxQueues','UserProfileResource','error','name','send','index','map','FaxQueue','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','sort','where','pick','filter','merge','options','includeAll','rows','catch','show','params','include','find','create','body','user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','describe','getMembers','findOne','rawAttributes','FaxQueueId','findAll','findAndCountAll','UserId','agent','updatedAt','format','%s/%s','SIP','faxPause','createdAt','getTeams','order','ids','Team','User','Agents','online','voicePause','interface','flatMap','sequelize','addTeams','each','findOrCreate','userFaxQueue:save','removeTeams','select','field'];(function(_0x2c7618,_0x26be9c){var _0x5ce3f0=function(_0x1837b3){while(--_0x1837b3){_0x2c7618['push'](_0x2c7618['shift']());}};_0x5ce3f0(++_0x26be9c);}(_0x8580,0x1c7));var _0x0858=function(_0x3914e9,_0x22e093){_0x3914e9=_0x3914e9-0x0;var _0x2e3c52=_0x8580[_0x3914e9];return _0x2e3c52;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x0858('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x0858('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x0858('0x2'));var BPromise=require(_0x0858('0x3'));var Mustache=require('mustache');var util=require(_0x0858('0x4'));var path=require(_0x0858('0x5'));var sox=require('sox');var csv=require(_0x0858('0x6'));var ejs=require(_0x0858('0x7'));var fs=require('fs');var _=require(_0x0858('0x8'));var squel=require(_0x0858('0x9'));var crypto=require('crypto');var jsforce=require(_0x0858('0xa'));var deskjs=require(_0x0858('0xb'));var toCsv=require(_0x0858('0x6'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x0858('0xc'));var authService=require('../../components/auth/service');var qs=require(_0x0858('0xd'));var as=require(_0x0858('0xe'));var hardwareService=require(_0x0858('0xf'));var logger=require(_0x0858('0x10'))(_0x0858('0x11'));var utils=require(_0x0858('0x12'));var config=require(_0x0858('0x13'));var db=require(_0x0858('0x14'))['db'];config['redis']=_['defaults'](config[_0x0858('0x15')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x0858('0x16'))[_0x0858('0x17')](socket);function respondWithStatusCode(_0x4a869f,_0x23bc2d){_0x23bc2d=_0x23bc2d||0xcc;return function(_0x69ceda){if(_0x69ceda){return _0x4a869f[_0x0858('0x18')](_0x23bc2d);}return _0x4a869f[_0x0858('0x19')](_0x23bc2d)[_0x0858('0x1a')]();};}function respondWithResult(_0x306170,_0xca6a95){_0xca6a95=_0xca6a95||0xc8;return function(_0x2ed26b){if(_0x2ed26b){return _0x306170[_0x0858('0x19')](_0xca6a95)[_0x0858('0x1b')](_0x2ed26b);}};}function respondWithFilteredResult(_0x163a6e,_0x3ad059){return function(_0x538831){if(_0x538831){var _0x2b73c2=_0x538831[_0x0858('0x1c')],_0x4d376b=_0x3ad059[_0x0858('0x1d')],_0x284ebd=_0x3ad059[_0x0858('0x1d')]+_0x3ad059['limit'],_0x37f90b;if(_0x284ebd>=_0x2b73c2){_0x284ebd=_0x2b73c2;_0x37f90b=0xc8;}else{_0x37f90b=0xce;}_0x163a6e[_0x0858('0x19')](_0x37f90b);return _0x163a6e[_0x0858('0x1e')]('Content-Range',_0x4d376b+'-'+_0x284ebd+'/'+_0x2b73c2)[_0x0858('0x1b')](_0x538831);}return null;};}function patchUpdates(_0x4896c0){return function(_0x523c04){try{jsonpatch[_0x0858('0x1f')](_0x523c04,_0x4896c0,!![]);}catch(_0x318fc8){return BPromise[_0x0858('0x20')](_0x318fc8);}return _0x523c04[_0x0858('0x21')]();};}function saveUpdates(_0x29ac2b,_0x58d7f8){return function(_0x116e45){if(_0x116e45){return _0x116e45['update'](_0x29ac2b)[_0x0858('0x22')](function(_0x5f5b52){return _0x5f5b52;});}return null;};}function removeEntity(_0xea7f7f,_0x425745){return function(_0x32d21d){if(_0x32d21d){return _0x32d21d[_0x0858('0x23')]()['then'](function(){var _0x1fac3f=_0x32d21d[_0x0858('0x24')]({'plain':!![]});var _0x38046e=_0x0858('0x25');return db[_0x0858('0x26')][_0x0858('0x23')]({'where':{'type':_0x38046e,'resourceId':_0x1fac3f['id']}})[_0x0858('0x22')](function(){return _0x32d21d;});})[_0x0858('0x22')](function(){_0xea7f7f[_0x0858('0x19')](0xcc)[_0x0858('0x1a')]();});}};}function handleEntityNotFound(_0x1256df,_0x39fb6f){return function(_0x35eb3e){if(!_0x35eb3e){_0x1256df[_0x0858('0x18')](0x194);}return _0x35eb3e;};}function handleError(_0xc45871,_0x410e7d){_0x410e7d=_0x410e7d||0x1f4;return function(_0x2607c1){logger[_0x0858('0x27')](_0x2607c1['stack']);if(_0x2607c1[_0x0858('0x28')]){delete _0x2607c1[_0x0858('0x28')];}_0xc45871[_0x0858('0x19')](_0x410e7d)[_0x0858('0x29')](_0x2607c1);};}exports[_0x0858('0x2a')]=function(_0x46d304,_0x15e94b){var _0x18c02f={},_0x59c7a6={},_0x138a63={'count':0x0,'rows':[]};var _0x6ab7c0=_[_0x0858('0x2b')](db[_0x0858('0x2c')]['rawAttributes'],function(_0x12b2c9){return{'name':_0x12b2c9[_0x0858('0x2d')],'type':_0x12b2c9['type'][_0x0858('0x2e')]};});_0x59c7a6[_0x0858('0x2f')]=_['map'](_0x6ab7c0,_0x0858('0x28'));_0x59c7a6[_0x0858('0x30')]=_[_0x0858('0x31')](_0x46d304[_0x0858('0x30')]);_0x59c7a6[_0x0858('0x32')]=_[_0x0858('0x33')](_0x59c7a6[_0x0858('0x2f')],_0x59c7a6[_0x0858('0x30')]);_0x18c02f[_0x0858('0x34')]=_['intersection'](_0x59c7a6['model'],qs[_0x0858('0x35')](_0x46d304[_0x0858('0x30')][_0x0858('0x35')]));_0x18c02f[_0x0858('0x34')]=_0x18c02f[_0x0858('0x34')][_0x0858('0x36')]?_0x18c02f[_0x0858('0x34')]:_0x59c7a6[_0x0858('0x2f')];if(!_0x46d304[_0x0858('0x30')][_0x0858('0x37')](_0x0858('0x38'))){_0x18c02f[_0x0858('0x39')]=qs[_0x0858('0x39')](_0x46d304[_0x0858('0x30')][_0x0858('0x39')]);_0x18c02f[_0x0858('0x1d')]=qs[_0x0858('0x1d')](_0x46d304[_0x0858('0x30')]['offset']);}_0x18c02f['order']=qs['sort'](_0x46d304['query'][_0x0858('0x3a')]);_0x18c02f[_0x0858('0x3b')]=qs[_0x0858('0x32')](_[_0x0858('0x3c')](_0x46d304[_0x0858('0x30')],_0x59c7a6[_0x0858('0x32')]),_0x6ab7c0);if(_0x46d304[_0x0858('0x30')][_0x0858('0x3d')]){_0x18c02f['where']=_['merge'](_0x18c02f['where'],{'$or':_[_0x0858('0x2b')](_0x6ab7c0,function(_0x262e0d){if(_0x262e0d['type']!=='VIRTUAL'){var _0x3a55dc={};_0x3a55dc[_0x262e0d[_0x0858('0x28')]]={'$like':'%'+_0x46d304[_0x0858('0x30')]['filter']+'%'};return _0x3a55dc;}})});}_0x18c02f=_[_0x0858('0x3e')]({},_0x18c02f,_0x46d304[_0x0858('0x3f')]);var _0x13784c={'where':_0x18c02f['where']};return db[_0x0858('0x2c')]['count'](_0x13784c)[_0x0858('0x22')](function(_0x2816cb){_0x138a63[_0x0858('0x1c')]=_0x2816cb;if(_0x46d304[_0x0858('0x30')][_0x0858('0x40')]){_0x18c02f['include']=[{'all':!![]}];}return db[_0x0858('0x2c')]['findAll'](_0x18c02f);})[_0x0858('0x22')](function(_0x48968a){_0x138a63[_0x0858('0x41')]=_0x48968a;return _0x138a63;})[_0x0858('0x22')](respondWithFilteredResult(_0x15e94b,_0x18c02f))[_0x0858('0x42')](handleError(_0x15e94b,null));};exports[_0x0858('0x43')]=function(_0x58ab2e,_0x1dd91c){var _0x20b9d4={'raw':!![],'where':{'id':_0x58ab2e[_0x0858('0x44')]['id']}},_0x5144d4={};_0x5144d4[_0x0858('0x2f')]=_[_0x0858('0x31')](db['FaxQueue']['rawAttributes']);_0x5144d4[_0x0858('0x30')]=_[_0x0858('0x31')](_0x58ab2e['query']);_0x5144d4[_0x0858('0x32')]=_[_0x0858('0x33')](_0x5144d4[_0x0858('0x2f')],_0x5144d4[_0x0858('0x30')]);_0x20b9d4[_0x0858('0x34')]=_['intersection'](_0x5144d4['model'],qs[_0x0858('0x35')](_0x58ab2e[_0x0858('0x30')][_0x0858('0x35')]));_0x20b9d4[_0x0858('0x34')]=_0x20b9d4[_0x0858('0x34')][_0x0858('0x36')]?_0x20b9d4[_0x0858('0x34')]:_0x5144d4[_0x0858('0x2f')];if(_0x58ab2e[_0x0858('0x30')][_0x0858('0x40')]){_0x20b9d4[_0x0858('0x45')]=[{'all':!![]}];}_0x20b9d4=_[_0x0858('0x3e')]({},_0x20b9d4,_0x58ab2e[_0x0858('0x3f')]);return db['FaxQueue'][_0x0858('0x46')](_0x20b9d4)['then'](handleEntityNotFound(_0x1dd91c,null))[_0x0858('0x22')](respondWithResult(_0x1dd91c,null))[_0x0858('0x42')](handleError(_0x1dd91c,null));};exports[_0x0858('0x47')]=function(_0x47ec83,_0x59839c){return db[_0x0858('0x2c')]['create'](_0x47ec83[_0x0858('0x48')],{})['then'](function(_0x4307b7){var _0x1cbbf2=_0x47ec83[_0x0858('0x49')][_0x0858('0x24')]({'plain':!![]});if(!_0x1cbbf2)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1cbbf2[_0x0858('0x4a')]===_0x0858('0x49')){var _0x2da36f=_0x4307b7[_0x0858('0x24')]({'plain':!![]});var _0x43764b=_0x0858('0x25');return db[_0x0858('0x4b')][_0x0858('0x46')]({'where':{'name':_0x43764b,'userProfileId':_0x1cbbf2[_0x0858('0x4c')]},'raw':!![]})[_0x0858('0x22')](function(_0x396831){if(_0x396831&&_0x396831[_0x0858('0x4d')]===0x0){return db[_0x0858('0x26')][_0x0858('0x47')]({'name':_0x2da36f['name'],'resourceId':_0x2da36f['id'],'type':_0x396831[_0x0858('0x28')],'sectionId':_0x396831['id']},{})[_0x0858('0x22')](function(){return _0x4307b7;});}else{return _0x4307b7;}})[_0x0858('0x42')](function(_0x20140e){logger[_0x0858('0x27')](_0x0858('0x4e'),_0x20140e);throw _0x20140e;});}return _0x4307b7;})['then'](respondWithResult(_0x59839c,0xc9))[_0x0858('0x42')](handleError(_0x59839c,null));};exports[_0x0858('0x4f')]=function(_0x5843eb,_0x473a47){if(_0x5843eb[_0x0858('0x48')]['id']){delete _0x5843eb[_0x0858('0x48')]['id'];}return db[_0x0858('0x2c')][_0x0858('0x46')]({'where':{'id':_0x5843eb[_0x0858('0x44')]['id']}})[_0x0858('0x22')](handleEntityNotFound(_0x473a47,null))['then'](saveUpdates(_0x5843eb[_0x0858('0x48')],null))[_0x0858('0x22')](respondWithResult(_0x473a47,null))[_0x0858('0x42')](handleError(_0x473a47,null));};exports[_0x0858('0x23')]=function(_0x412e45,_0x53352e){return db['FaxQueue'][_0x0858('0x46')]({'where':{'id':_0x412e45['params']['id']}})[_0x0858('0x22')](handleEntityNotFound(_0x53352e,null))[_0x0858('0x22')](removeEntity(_0x53352e,null))[_0x0858('0x42')](handleError(_0x53352e,null));};exports[_0x0858('0x50')]=function(_0x7c173,_0xe20999){return db[_0x0858('0x2c')]['describe']()['then'](respondWithResult(_0xe20999,null))[_0x0858('0x42')](handleError(_0xe20999,null));};exports[_0x0858('0x51')]=function(_0x59caa4,_0x327ab0,_0x4b5fe7){var _0x4e07a4={'raw':!![],'where':{}},_0x3887b3={},_0x1e6b7b;return db['FaxQueue'][_0x0858('0x52')]({'where':{'id':_0x59caa4['params']['id']}})['then'](handleEntityNotFound(_0x327ab0,null))[_0x0858('0x22')](function(_0x3ad02c){if(_0x3ad02c){_0x1e6b7b=_0x3ad02c[_0x0858('0x24')]({'plain':!![]});_0x3887b3[_0x0858('0x2f')]=_[_0x0858('0x31')](db['UserFaxQueue'][_0x0858('0x53')]);_0x3887b3[_0x0858('0x30')]=_[_0x0858('0x31')](_0x59caa4[_0x0858('0x30')]);_0x3887b3[_0x0858('0x32')]=_[_0x0858('0x33')](_0x3887b3[_0x0858('0x2f')],_0x3887b3[_0x0858('0x30')]);_0x4e07a4['attributes']=_[_0x0858('0x33')](_0x3887b3[_0x0858('0x2f')],qs['fields'](_0x59caa4[_0x0858('0x30')][_0x0858('0x35')]));_0x4e07a4[_0x0858('0x34')]=_0x4e07a4[_0x0858('0x34')][_0x0858('0x36')]?_0x4e07a4[_0x0858('0x34')]:_0x3887b3[_0x0858('0x2f')];if(!_0x59caa4['query'][_0x0858('0x37')](_0x0858('0x38'))){_0x4e07a4[_0x0858('0x39')]=qs[_0x0858('0x39')](_0x59caa4[_0x0858('0x30')][_0x0858('0x39')]);_0x4e07a4['offset']=qs[_0x0858('0x1d')](_0x59caa4['query']['offset']);}_0x4e07a4['order']=qs[_0x0858('0x3a')](_0x59caa4[_0x0858('0x30')]['sort']);_0x4e07a4[_0x0858('0x3b')]=qs['filters'](_[_0x0858('0x3c')](_0x59caa4[_0x0858('0x30')],_0x3887b3[_0x0858('0x32')]));_0x4e07a4[_0x0858('0x3b')][_0x0858('0x54')]=_0x3ad02c['id'];if(_0x59caa4['query']['filter']){_0x4e07a4[_0x0858('0x3b')]=_[_0x0858('0x3e')](_0x4e07a4[_0x0858('0x3b')],{'$or':_[_0x0858('0x2b')](_0x4e07a4[_0x0858('0x34')],function(_0x30e47c){var _0x3e53ae={};_0x3e53ae[_0x30e47c]={'$like':'%'+_0x59caa4[_0x0858('0x30')]['filter']+'%'};return _0x3e53ae;})});}_0x4e07a4=_[_0x0858('0x3e')]({},_0x4e07a4,_0x59caa4['options']);return db['UserFaxQueue'][_0x0858('0x55')](_0x4e07a4);}})[_0x0858('0x22')](function(_0x1dfabd){if(_0x1dfabd){return db['User'][_0x0858('0x56')]({'where':{'id':_[_0x0858('0x2b')](_0x1dfabd,_0x0858('0x57')),'role':_0x0858('0x58')},'attributes':['id',_0x0858('0x28'),'faxPause',_0x0858('0x59'),'createdAt']});}})[_0x0858('0x22')](function(_0x1f1427){if(_0x1f1427){return{'count':_0x1f1427[_0x0858('0x1c')],'rows':_[_0x0858('0x2b')](_0x1f1427[_0x0858('0x41')],function(_0x4e27f7){return{'membername':_0x4e27f7[_0x0858('0x28')],'UserId':_0x4e27f7['id'],'queue_name':_0x1e6b7b[_0x0858('0x28')],'FaxQueueId':_0x1e6b7b['id'],'interface':util[_0x0858('0x5a')](_0x0858('0x5b'),_0x0858('0x5c'),_0x4e27f7[_0x0858('0x28')]),'penalty':0x0,'paused':_0x4e27f7[_0x0858('0x5d')],'createdAt':_0x4e27f7[_0x0858('0x5e')],'updatedAt':_0x4e27f7['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x327ab0,_0x4e07a4))[_0x0858('0x42')](handleError(_0x327ab0,null));};exports[_0x0858('0x5f')]=function(_0x8de23c,_0x33529a,_0x5df737){var _0x561637={};var _0x2fe267={};var _0x13b0b9;var _0x39456a;return db['FaxQueue']['findOne']({'where':{'id':_0x8de23c[_0x0858('0x44')]['id']}})['then'](handleEntityNotFound(_0x33529a,null))[_0x0858('0x22')](function(_0x1ff280){if(_0x1ff280){_0x13b0b9=_0x1ff280;_0x2fe267[_0x0858('0x2f')]=_['keys'](db['Team'][_0x0858('0x53')]);_0x2fe267[_0x0858('0x30')]=_['keys'](_0x8de23c[_0x0858('0x30')]);_0x2fe267['filters']=_[_0x0858('0x33')](_0x2fe267['model'],_0x2fe267[_0x0858('0x30')]);_0x561637[_0x0858('0x34')]=_['intersection'](_0x2fe267['model'],qs[_0x0858('0x35')](_0x8de23c[_0x0858('0x30')][_0x0858('0x35')]));_0x561637[_0x0858('0x34')]=_0x561637[_0x0858('0x34')][_0x0858('0x36')]?_0x561637[_0x0858('0x34')]:_0x2fe267[_0x0858('0x2f')];_0x561637[_0x0858('0x60')]=qs[_0x0858('0x3a')](_0x8de23c[_0x0858('0x30')][_0x0858('0x3a')]);_0x561637[_0x0858('0x3b')]=qs[_0x0858('0x32')](_[_0x0858('0x3c')](_0x8de23c['query'],_0x2fe267[_0x0858('0x32')]));if(_0x8de23c[_0x0858('0x30')][_0x0858('0x3d')]){_0x561637[_0x0858('0x3b')]=_[_0x0858('0x3e')](_0x561637[_0x0858('0x3b')],{'$or':_[_0x0858('0x2b')](_0x561637[_0x0858('0x34')],function(_0x3b4df4){var _0x36f856={};_0x36f856[_0x3b4df4]={'$like':'%'+_0x8de23c['query'][_0x0858('0x3d')]+'%'};return _0x36f856;})});}_0x561637=_[_0x0858('0x3e')]({},_0x561637,_0x8de23c['options']);return _0x13b0b9[_0x0858('0x5f')](_0x561637);}})[_0x0858('0x22')](function(_0x4f0125){if(_0x4f0125){_0x39456a=_0x4f0125['length'];if(!_0x8de23c[_0x0858('0x30')][_0x0858('0x37')]('nolimit')){_0x561637[_0x0858('0x39')]=qs['limit'](_0x8de23c['query'][_0x0858('0x39')]);_0x561637['offset']=qs[_0x0858('0x1d')](_0x8de23c['query']['offset']);}return _0x13b0b9[_0x0858('0x5f')](_0x561637);}})['then'](function(_0x4e9ff9){if(_0x4e9ff9){return _0x4e9ff9?{'count':_0x39456a,'rows':_0x4e9ff9}:null;}})['then'](respondWithResult(_0x33529a,null))[_0x0858('0x42')](handleError(_0x33529a,null));};exports['addTeams']=function(_0x184801,_0x28a782,_0x5b8d14){var _0xd45232=_0x184801[_0x0858('0x48')][_0x0858('0x61')];return db[_0x0858('0x62')]['findAll']({'where':{'id':_0xd45232},'attributes':['id'],'include':[{'model':db[_0x0858('0x63')],'as':_0x0858('0x64'),'attributes':['id',_0x0858('0x28'),_0x0858('0x65'),_0x0858('0x66'),_0x0858('0x67')],'raw':!![]}]})[_0x0858('0x22')](function(_0x29363c){if(_0x29363c){var _0x3328e6=_[_0x0858('0x68')](_0x29363c,function(_0x4d1758){var _0x184c86=_0x4d1758[_0x0858('0x24')]({'plain':!![]});return _0x184c86[_0x0858('0x64')];});return db[_0x0858('0x2c')][_0x0858('0x46')]({'where':{'id':_0x184801[_0x0858('0x44')]['id']}})[_0x0858('0x22')](function(_0x13a8c5){return db[_0x0858('0x69')]['transaction'](function(_0xf807a1){return _0x13a8c5[_0x0858('0x6a')](_0xd45232,{'transaction':_0xf807a1})[_0x0858('0x22')](function(){return BPromise[_0x0858('0x6b')](_0x3328e6,function(_0x3e9109){return db['UserFaxQueue'][_0x0858('0x6c')]({'where':{'UserId':_0x3e9109['id'],'FaxQueueId':_0x184801[_0x0858('0x44')]['id']},'transaction':_0xf807a1});});})[_0x0858('0x22')](function(){_0x3328e6['forEach'](function(_0x4c3023){socket['emit'](_0x0858('0x6d'),{'UserId':_0x4c3023['id'],'FaxQueueId':_0x13a8c5['id']});});});});});}})[_0x0858('0x22')](respondWithStatusCode(_0x28a782,null))[_0x0858('0x42')](handleError(_0x28a782,null));};exports[_0x0858('0x6e')]=function(_0x1731cc,_0x110a4d,_0x176f09){return db[_0x0858('0x62')]['findAll']({'where':{'id':_0x1731cc[_0x0858('0x30')]['ids']},'attributes':['id'],'include':[{'model':db['User'],'as':_0x0858('0x64'),'attributes':['id'],'raw':!![]}]})[_0x0858('0x22')](handleEntityNotFound(_0x110a4d,null))['then'](function(_0x230565){var _0x13615d=_[_0x0858('0x2b')](_0x230565,'id');var _0x45f4ad=[];var _0xa2fcd1=[];var _0x28feef=squel[_0x0858('0x6f')]();_0x28feef[_0x0858('0x70')](_0x0858('0x71'))[_0x0858('0x72')](_0x0858('0x73'),'tq')[_0x0858('0x74')](_0x0858('0x75'),'ut',_0x0858('0x76'))[_0x0858('0x3b')](_0x0858('0x77'),_0x1731cc[_0x0858('0x44')]['id']);for(var _0x2be2a6=0x0;_0x2be2a6<_0x230565['length'];_0x2be2a6+=0x1){let _0x5e63f1=_0x230565[_0x2be2a6];for(var _0x3dca3d=0x0;_0x3dca3d<_0x5e63f1[_0x0858('0x64')][_0x0858('0x36')];_0x3dca3d+=0x1){let _0x66adc5=_0x5e63f1[_0x0858('0x64')][_0x3dca3d];var _0x192c56=_0x28feef[_0x0858('0x78')]();_0x192c56[_0x0858('0x3b')](_0x0858('0x79'),_0x66adc5['id']);_0xa2fcd1['push'](db[_0x0858('0x69')][_0x0858('0x30')](_0x192c56[_0x0858('0x7a')](),{'type':db['sequelize'][_0x0858('0x7b')][_0x0858('0x7c')]})[_0x0858('0x22')](function(_0x43bc96){if(_0x43bc96['length']===0x1){return _0x66adc5['id'];}else{var _0x304523=_[_0x0858('0x7d')](_['map'](_0x43bc96,_0x0858('0x7e')),function(_0x23e76b){return _[_0x0858('0x7f')](_0x13615d,_0x23e76b);});if(_0x304523){return _0x66adc5['id'];}}}));}}return BPromise[_0x0858('0x80')](_0xa2fcd1)[_0x0858('0x22')](function(_0x35eea9){_0x45f4ad=_(_0x45f4ad)['union'](_0x35eea9)[_0x0858('0x81')]()[_0x0858('0x82')]();return db[_0x0858('0x2c')][_0x0858('0x46')]({'where':{'id':_0x1731cc[_0x0858('0x44')]['id']}})[_0x0858('0x22')](function(_0xac9320){return db[_0x0858('0x69')][_0x0858('0x83')](function(_0x5567b6){return _0xac9320[_0x0858('0x6e')](_0x1731cc['query']['ids'],{'transaction':_0x5567b6})[_0x0858('0x22')](function(){if(!_[_0x0858('0x84')](_0x45f4ad)){return _0xac9320['removeAgents'](_0x45f4ad,{'transaction':_0x5567b6});}})[_0x0858('0x22')](function(){_0x45f4ad[_0x0858('0x85')](function(_0x56f7a0){socket[_0x0858('0x86')](_0x0858('0x87'),{'UserId':_0x56f7a0,'FaxQueueId':_0xac9320['id']});});});});});});})[_0x0858('0x22')](respondWithStatusCode(_0x110a4d,null))['catch'](handleError(_0x110a4d,null));};exports[_0x0858('0x88')]=function(_0x42dac6,_0x154e8f,_0x40c70c){return db[_0x0858('0x2c')][_0x0858('0x46')]({'where':{'id':_0x42dac6[_0x0858('0x44')]['id']}})[_0x0858('0x22')](handleEntityNotFound(_0x154e8f,null))['then'](function(_0x37af2a){if(_0x37af2a){return _0x37af2a['addAgents'](_0x42dac6[_0x0858('0x48')][_0x0858('0x61')],_[_0x0858('0x89')](_0x42dac6['body'],[_0x0858('0x61'),'id'])||{})[_0x0858('0x8a')](function(_0x393424){for(var _0x504aca=0x0;_0x504aca<_0x42dac6[_0x0858('0x48')]['ids']['length'];_0x504aca+=0x1){socket[_0x0858('0x86')](_0x0858('0x6d'),{'UserId':_0x42dac6[_0x0858('0x48')][_0x0858('0x61')][_0x504aca],'FaxQueueId':_0x42dac6['params']['id']});}return _0x393424;});}})[_0x0858('0x22')](respondWithResult(_0x154e8f,null))['catch'](handleError(_0x154e8f,null));};exports[_0x0858('0x8b')]=function(_0x4962e6,_0x635fab,_0x219bbd){return db[_0x0858('0x2c')][_0x0858('0x46')]({'where':{'id':_0x4962e6[_0x0858('0x44')]['id']}})[_0x0858('0x22')](handleEntityNotFound(_0x635fab,null))[_0x0858('0x22')](function(_0x338b15){if(_0x338b15){return _0x338b15[_0x0858('0x8b')](_0x4962e6[_0x0858('0x30')][_0x0858('0x61')])['then'](function(){if(_[_0x0858('0x8c')](_0x4962e6[_0x0858('0x30')]['ids'])){for(var _0x1c8584=0x0;_0x1c8584<_0x4962e6[_0x0858('0x30')][_0x0858('0x61')][_0x0858('0x36')];_0x1c8584+=0x1){socket[_0x0858('0x86')](_0x0858('0x87'),{'UserId':Number(_0x4962e6[_0x0858('0x30')][_0x0858('0x61')][_0x1c8584]),'FaxQueueId':Number(_0x4962e6[_0x0858('0x44')]['id'])});}}else{socket['emit'](_0x0858('0x87'),{'UserId':Number(_0x4962e6['query'][_0x0858('0x61')]),'FaxQueueId':Number(_0x4962e6[_0x0858('0x44')]['id'])});}});}})[_0x0858('0x22')](respondWithStatusCode(_0x635fab,null))[_0x0858('0x42')](handleError(_0x635fab,null));};exports[_0x0858('0x8d')]=function(_0x30b99b,_0x55ae4f,_0xd6937d){var _0x5eea28={};var _0x370804={};var _0x1a5964;var _0x53e363;return db[_0x0858('0x2c')]['findOne']({'where':{'id':_0x30b99b[_0x0858('0x44')]['id']}})[_0x0858('0x22')](handleEntityNotFound(_0x55ae4f,null))[_0x0858('0x22')](function(_0x2d7640){if(_0x2d7640){_0x1a5964=_0x2d7640;_0x370804[_0x0858('0x2f')]=_[_0x0858('0x31')](db[_0x0858('0x63')][_0x0858('0x53')]);_0x370804['query']=_[_0x0858('0x31')](_0x30b99b[_0x0858('0x30')]);_0x370804[_0x0858('0x32')]=_[_0x0858('0x33')](_0x370804['model'],_0x370804[_0x0858('0x30')]);_0x5eea28[_0x0858('0x34')]=_[_0x0858('0x33')](_0x370804[_0x0858('0x2f')],qs[_0x0858('0x35')](_0x30b99b['query'][_0x0858('0x35')]));_0x5eea28[_0x0858('0x34')]=_0x5eea28[_0x0858('0x34')][_0x0858('0x36')]?_0x5eea28[_0x0858('0x34')]:_0x370804[_0x0858('0x2f')];_0x5eea28[_0x0858('0x60')]=qs[_0x0858('0x3a')](_0x30b99b[_0x0858('0x30')]['sort']);_0x5eea28['where']=qs[_0x0858('0x32')](_[_0x0858('0x3c')](_0x30b99b[_0x0858('0x30')],_0x370804['filters']));if(_0x30b99b[_0x0858('0x30')]['filter']){_0x5eea28[_0x0858('0x3b')]=_[_0x0858('0x3e')](_0x5eea28['where'],{'$or':_[_0x0858('0x2b')](_0x5eea28[_0x0858('0x34')],function(_0x5ed079){var _0x108768={};_0x108768[_0x5ed079]={'$like':'%'+_0x30b99b[_0x0858('0x30')][_0x0858('0x3d')]+'%'};return _0x108768;})});}_0x5eea28=_['merge']({},_0x5eea28,_0x30b99b[_0x0858('0x3f')]);return _0x1a5964['getAgents'](_0x5eea28);}})[_0x0858('0x22')](function(_0x2c226f){if(_0x2c226f){_0x53e363=_0x2c226f[_0x0858('0x36')];if(!_0x30b99b[_0x0858('0x30')]['hasOwnProperty'](_0x0858('0x38'))){_0x5eea28[_0x0858('0x39')]=qs[_0x0858('0x39')](_0x30b99b[_0x0858('0x30')]['limit']);_0x5eea28[_0x0858('0x1d')]=qs[_0x0858('0x1d')](_0x30b99b[_0x0858('0x30')][_0x0858('0x1d')]);}return _0x1a5964[_0x0858('0x8d')](_0x5eea28);}})[_0x0858('0x22')](function(_0x4e5e5a){if(_0x4e5e5a){return _0x4e5e5a?{'count':_0x53e363,'rows':_0x4e5e5a}:null;}})[_0x0858('0x22')](respondWithResult(_0x55ae4f,null))[_0x0858('0x42')](handleError(_0x55ae4f,null));};
\ No newline at end of file
diff --git a/server/api/faxQueue/faxQueue.events.js b/server/api/faxQueue/faxQueue.events.js
index eaef405..5193aa0 100644
--- a/server/api/faxQueue/faxQueue.events.js
+++ b/server/api/faxQueue/faxQueue.events.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x554b=['setMaxListeners','save','remove','emit','hasOwnProperty','hook','FaxQueue'];(function(_0x2bb298,_0x4bdefb){var _0x1ef1af=function(_0x590665){while(--_0x590665){_0x2bb298['push'](_0x2bb298['shift']());}};_0x1ef1af(++_0x4bdefb);}(_0x554b,0x68));var _0xb554=function(_0x2e04ef,_0x31a596){_0x2e04ef=_0x2e04ef-0x0;var _0x5722b0=_0x554b[_0x2e04ef];return _0x5722b0;};'use strict';var EventEmitter=require('events');var FaxQueue=require('../../mysqldb')['db'][_0xb554('0x0')];var FaxQueueEvents=new EventEmitter();FaxQueueEvents[_0xb554('0x1')](0x0);var events={'afterCreate':_0xb554('0x2'),'afterUpdate':'update','afterDestroy':_0xb554('0x3')};function emitEvent(_0xd6f211){return function(_0x1f704f,_0x1aa676,_0x25d3cd){FaxQueueEvents[_0xb554('0x4')](_0xd6f211+':'+_0x1f704f['id'],_0x1f704f);FaxQueueEvents[_0xb554('0x4')](_0xd6f211,_0x1f704f);_0x25d3cd(null);};}for(var e in events){if(events[_0xb554('0x5')](e)){var event=events[e];FaxQueue[_0xb554('0x6')](e,emitEvent(event));}}module['exports']=FaxQueueEvents;
\ No newline at end of file
+var _0xe071=['hook','exports','events','../../mysqldb','FaxQueue','setMaxListeners','remove','emit'];(function(_0x12d033,_0x25fa2f){var _0x3b4e80=function(_0x46c1f4){while(--_0x46c1f4){_0x12d033['push'](_0x12d033['shift']());}};_0x3b4e80(++_0x25fa2f);}(_0xe071,0x6a));var _0x1e07=function(_0x1a2ef3,_0x21186c){_0x1a2ef3=_0x1a2ef3-0x0;var _0x34f4a4=_0xe071[_0x1a2ef3];return _0x34f4a4;};'use strict';var EventEmitter=require(_0x1e07('0x0'));var FaxQueue=require(_0x1e07('0x1'))['db'][_0x1e07('0x2')];var FaxQueueEvents=new EventEmitter();FaxQueueEvents[_0x1e07('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x1e07('0x4')};function emitEvent(_0x9e181){return function(_0x4324dd,_0x488f6e,_0xf7c883){FaxQueueEvents[_0x1e07('0x5')](_0x9e181+':'+_0x4324dd['id'],_0x4324dd);FaxQueueEvents[_0x1e07('0x5')](_0x9e181,_0x4324dd);_0xf7c883(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxQueue[_0x1e07('0x6')](e,emitEvent(event));}}module[_0x1e07('0x7')]=FaxQueueEvents;
\ No newline at end of file
diff --git a/server/api/faxQueue/faxQueue.model.js b/server/api/faxQueue/faxQueue.model.js
index b13fe2a..c2b7e51 100644
--- a/server/api/faxQueue/faxQueue.model.js
+++ b/server/api/faxQueue/faxQueue.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xa917=['path','rimraf','../../config/environment','define','FaxQueue','fax_queues','lodash','util','api','moment','request-promise'];(function(_0x294696,_0x437854){var _0x5ede2d=function(_0x130158){while(--_0x130158){_0x294696['push'](_0x294696['shift']());}};_0x5ede2d(++_0x437854);}(_0xa917,0x74));var _0x7a91=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0xa917[_0x21a9d9];return _0x46adce;};'use strict';var _=require(_0x7a91('0x0'));var util=require(_0x7a91('0x1'));var logger=require('../../config/logger')(_0x7a91('0x2'));var moment=require(_0x7a91('0x3'));var BPromise=require('bluebird');var rp=require(_0x7a91('0x4'));var fs=require('fs');var path=require(_0x7a91('0x5'));var rimraf=require(_0x7a91('0x6'));var config=require(_0x7a91('0x7'));var attributes=require('./faxQueue.attributes');module['exports']=function(_0xf6b296,_0x45e6a2){return _0xf6b296[_0x7a91('0x8')](_0x7a91('0x9'),attributes,{'tableName':_0x7a91('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xd77c=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','define','FaxQueue','fax_queues','util','../../config/logger'];(function(_0x490451,_0x2c5f41){var _0x20ebe0=function(_0x56c321){while(--_0x56c321){_0x490451['push'](_0x490451['shift']());}};_0x20ebe0(++_0x2c5f41);}(_0xd77c,0xee));var _0xcd77=function(_0x19f0dc,_0x4de96b){_0x19f0dc=_0x19f0dc-0x0;var _0x56c8ec=_0xd77c[_0x19f0dc];return _0x56c8ec;};'use strict';var _=require('lodash');var util=require(_0xcd77('0x0'));var logger=require(_0xcd77('0x1'))(_0xcd77('0x2'));var moment=require(_0xcd77('0x3'));var BPromise=require(_0xcd77('0x4'));var rp=require(_0xcd77('0x5'));var fs=require('fs');var path=require(_0xcd77('0x6'));var rimraf=require(_0xcd77('0x7'));var config=require(_0xcd77('0x8'));var attributes=require('./faxQueue.attributes');module['exports']=function(_0x171360,_0x4a803f){return _0x171360[_0xcd77('0x9')](_0xcd77('0xa'),attributes,{'tableName':_0xcd77('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/faxQueue/faxQueue.rpc.js b/server/api/faxQueue/faxQueue.rpc.js
index f5bc11d..2bb3816 100644
--- a/server/api/faxQueue/faxQueue.rpc.js
+++ b/server/api/faxQueue/faxQueue.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x35d1=['debug','stringify','error','code','message','GetFaxQueue','FaxQueue','options','raw','where','limit','include','map','model','attributes','catch','then','ShowFaxQueue','lodash','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','./faxQueue.socket','register','request','info','FaxQueue,\x20%s,\x20%s','request\x20sent'];(function(_0x320088,_0x4f929d){var _0x2bf3f3=function(_0x57369f){while(--_0x57369f){_0x320088['push'](_0x320088['shift']());}};_0x2bf3f3(++_0x4f929d);}(_0x35d1,0x168));var _0x135d=function(_0x49b207,_0x408ade){_0x49b207=_0x49b207-0x0;var _0x2dc8fa=_0x35d1[_0x49b207];return _0x2dc8fa;};'use strict';var _=require(_0x135d('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x135d('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x135d('0x2'));var db=require(_0x135d('0x3'))['db'];var utils=require(_0x135d('0x4'));var logger=require(_0x135d('0x5'))(_0x135d('0x6'));var config=require(_0x135d('0x7'));var jayson=require(_0x135d('0x8'));var client=jayson[_0x135d('0x9')][_0x135d('0xa')]({'port':0x232a});config[_0x135d('0xb')]=_[_0x135d('0xc')](config[_0x135d('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x135d('0xd'))(new Redis(config[_0x135d('0xb')]));require(_0x135d('0xe'))[_0x135d('0xf')](socket);function respondWithRpcPromise(_0x10b58d,_0x3eebc4,_0x192662){return new BPromise(function(_0x408edb,_0x3fcd39){return client[_0x135d('0x10')](_0x10b58d,_0x192662)['then'](function(_0x722f16){logger[_0x135d('0x11')](_0x135d('0x12'),_0x3eebc4,_0x135d('0x13'));logger[_0x135d('0x14')]('FaxQueue,\x20%s,\x20%s,\x20%s',_0x3eebc4,_0x135d('0x13'),JSON[_0x135d('0x15')](_0x722f16));if(_0x722f16['error']){if(_0x722f16[_0x135d('0x16')][_0x135d('0x17')]===0x1f4){logger[_0x135d('0x16')](_0x135d('0x12'),_0x3eebc4,_0x722f16[_0x135d('0x16')][_0x135d('0x18')]);return _0x3fcd39(_0x722f16['error']['message']);}logger[_0x135d('0x16')](_0x135d('0x12'),_0x3eebc4,_0x722f16[_0x135d('0x16')][_0x135d('0x18')]);return _0x408edb(_0x722f16[_0x135d('0x16')][_0x135d('0x18')]);}else{logger[_0x135d('0x11')](_0x135d('0x12'),_0x3eebc4,_0x135d('0x13'));_0x408edb(_0x722f16['result'][_0x135d('0x18')]);}})['catch'](function(_0x1a04b5){logger['error'](_0x135d('0x12'),_0x3eebc4,_0x1a04b5);_0x3fcd39(_0x1a04b5);});});}exports[_0x135d('0x19')]=function(_0x471d78){var _0x50fb7f=this;return new Promise(function(_0x246004,_0x426da9){return db[_0x135d('0x1a')]['findAll']({'raw':_0x471d78[_0x135d('0x1b')]?_0x471d78['options'][_0x135d('0x1c')]===undefined?!![]:![]:!![],'where':_0x471d78[_0x135d('0x1b')]?_0x471d78[_0x135d('0x1b')][_0x135d('0x1d')]||null:null,'attributes':_0x471d78[_0x135d('0x1b')]?_0x471d78[_0x135d('0x1b')]['attributes']||null:null,'limit':_0x471d78[_0x135d('0x1b')]?_0x471d78['options'][_0x135d('0x1e')]||null:null,'include':_0x471d78[_0x135d('0x1b')]?_0x471d78[_0x135d('0x1b')][_0x135d('0x1f')]?_[_0x135d('0x20')](_0x471d78[_0x135d('0x1b')]['include'],function(_0x32681d){return{'model':db[_0x32681d[_0x135d('0x21')]],'as':_0x32681d['as'],'attributes':_0x32681d[_0x135d('0x22')],'include':_0x32681d[_0x135d('0x1f')]?_['map'](_0x32681d['include'],function(_0x85f3d0){return{'model':db[_0x85f3d0['model']],'as':_0x85f3d0['as'],'attributes':_0x85f3d0[_0x135d('0x22')],'include':_0x85f3d0[_0x135d('0x1f')]?_[_0x135d('0x20')](_0x85f3d0['include'],function(_0x36f426){return{'model':db[_0x36f426[_0x135d('0x21')]],'as':_0x36f426['as'],'attributes':_0x36f426[_0x135d('0x22')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xfa330c){logger[_0x135d('0x11')](_0x135d('0x19'),_0x471d78);logger[_0x135d('0x14')](_0x135d('0x19'),_0x471d78,JSON[_0x135d('0x15')](_0xfa330c));_0x246004(_0xfa330c);})[_0x135d('0x23')](function(_0x2cd206){logger[_0x135d('0x16')](_0x135d('0x19'),_0x2cd206[_0x135d('0x18')],_0x471d78);_0x426da9(_0x50fb7f[_0x135d('0x16')](0x1f4,_0x2cd206[_0x135d('0x18')]));});});};exports['ShowFaxQueue']=function(_0x33415a){var _0x2c6b94=this;return new Promise(function(_0x14d87b,_0x382813){return db[_0x135d('0x1a')]['find']({'raw':_0x33415a[_0x135d('0x1b')]?_0x33415a['options'][_0x135d('0x1c')]===undefined?!![]:![]:!![],'where':_0x33415a[_0x135d('0x1b')]?_0x33415a['options'][_0x135d('0x1d')]||null:null,'attributes':_0x33415a[_0x135d('0x1b')]?_0x33415a['options'][_0x135d('0x22')]||null:null,'include':_0x33415a[_0x135d('0x1b')]?_0x33415a[_0x135d('0x1b')]['include']?_[_0x135d('0x20')](_0x33415a[_0x135d('0x1b')]['include'],function(_0xb58147){return{'model':db[_0xb58147[_0x135d('0x21')]],'as':_0xb58147['as'],'attributes':_0xb58147[_0x135d('0x22')],'include':_0xb58147['include']?_[_0x135d('0x20')](_0xb58147[_0x135d('0x1f')],function(_0x131883){return{'model':db[_0x131883[_0x135d('0x21')]],'as':_0x131883['as'],'attributes':_0x131883[_0x135d('0x22')],'include':_0x131883[_0x135d('0x1f')]?_['map'](_0x131883['include'],function(_0x552234){return{'model':db[_0x552234[_0x135d('0x21')]],'as':_0x552234['as'],'attributes':_0x552234[_0x135d('0x22')]};}):[]};}):[]};}):[]:[]})[_0x135d('0x24')](function(_0x392650){logger['info'](_0x135d('0x25'),_0x33415a);logger[_0x135d('0x14')]('ShowFaxQueue',_0x33415a,JSON['stringify'](_0x392650));_0x14d87b(_0x392650);})[_0x135d('0x23')](function(_0x4a0f30){logger[_0x135d('0x16')]('ShowFaxQueue',_0x4a0f30[_0x135d('0x18')],_0x33415a);_0x382813(_0x2c6b94[_0x135d('0x16')](0x1f4,_0x4a0f30[_0x135d('0x18')]));});});};
\ No newline at end of file
+var _0x8a3e=['util','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','./faxQueue.socket','request','then','info','FaxQueue,\x20%s,\x20%s','request\x20sent','FaxQueue,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetFaxQueue','FaxQueue','findAll','options','raw','where','attributes','limit','map','include','model','stringify','ShowFaxQueue','find','debug','lodash'];(function(_0x5efbd0,_0x299553){var _0x475ec9=function(_0x3752ec){while(--_0x3752ec){_0x5efbd0['push'](_0x5efbd0['shift']());}};_0x475ec9(++_0x299553);}(_0x8a3e,0x167));var _0xe8a3=function(_0x225d9f,_0x280e04){_0x225d9f=_0x225d9f-0x0;var _0x24e55f=_0x8a3e[_0x225d9f];return _0x24e55f;};'use strict';var _=require(_0xe8a3('0x0'));var util=require(_0xe8a3('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xe8a3('0x2'));var fs=require('fs');var Redis=require(_0xe8a3('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xe8a3('0x4'));var logger=require(_0xe8a3('0x5'))(_0xe8a3('0x6'));var config=require(_0xe8a3('0x7'));var jayson=require(_0xe8a3('0x8'));var client=jayson['client'][_0xe8a3('0x9')]({'port':0x232a});config[_0xe8a3('0xa')]=_[_0xe8a3('0xb')](config[_0xe8a3('0xa')],{'host':_0xe8a3('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xe8a3('0xa')]));require(_0xe8a3('0xd'))['register'](socket);function respondWithRpcPromise(_0x4ff097,_0x4926ae,_0x355327){return new BPromise(function(_0x345973,_0x624e5f){return client[_0xe8a3('0xe')](_0x4ff097,_0x355327)[_0xe8a3('0xf')](function(_0x3dad49){logger[_0xe8a3('0x10')](_0xe8a3('0x11'),_0x4926ae,_0xe8a3('0x12'));logger['debug'](_0xe8a3('0x13'),_0x4926ae,_0xe8a3('0x12'),JSON['stringify'](_0x3dad49));if(_0x3dad49[_0xe8a3('0x14')]){if(_0x3dad49['error'][_0xe8a3('0x15')]===0x1f4){logger[_0xe8a3('0x14')](_0xe8a3('0x11'),_0x4926ae,_0x3dad49[_0xe8a3('0x14')][_0xe8a3('0x16')]);return _0x624e5f(_0x3dad49[_0xe8a3('0x14')][_0xe8a3('0x16')]);}logger['error']('FaxQueue,\x20%s,\x20%s',_0x4926ae,_0x3dad49[_0xe8a3('0x14')][_0xe8a3('0x16')]);return _0x345973(_0x3dad49['error']['message']);}else{logger[_0xe8a3('0x10')]('FaxQueue,\x20%s,\x20%s',_0x4926ae,_0xe8a3('0x12'));_0x345973(_0x3dad49[_0xe8a3('0x17')][_0xe8a3('0x16')]);}})[_0xe8a3('0x18')](function(_0x3291e1){logger[_0xe8a3('0x14')](_0xe8a3('0x11'),_0x4926ae,_0x3291e1);_0x624e5f(_0x3291e1);});});}exports[_0xe8a3('0x19')]=function(_0x21cd5d){var _0x4bb708=this;return new Promise(function(_0x9f57f4,_0x58ca24){return db[_0xe8a3('0x1a')][_0xe8a3('0x1b')]({'raw':_0x21cd5d[_0xe8a3('0x1c')]?_0x21cd5d[_0xe8a3('0x1c')][_0xe8a3('0x1d')]===undefined?!![]:![]:!![],'where':_0x21cd5d[_0xe8a3('0x1c')]?_0x21cd5d['options'][_0xe8a3('0x1e')]||null:null,'attributes':_0x21cd5d['options']?_0x21cd5d['options'][_0xe8a3('0x1f')]||null:null,'limit':_0x21cd5d[_0xe8a3('0x1c')]?_0x21cd5d['options'][_0xe8a3('0x20')]||null:null,'include':_0x21cd5d[_0xe8a3('0x1c')]?_0x21cd5d[_0xe8a3('0x1c')]['include']?_[_0xe8a3('0x21')](_0x21cd5d[_0xe8a3('0x1c')][_0xe8a3('0x22')],function(_0x1e434f){return{'model':db[_0x1e434f[_0xe8a3('0x23')]],'as':_0x1e434f['as'],'attributes':_0x1e434f[_0xe8a3('0x1f')],'include':_0x1e434f[_0xe8a3('0x22')]?_[_0xe8a3('0x21')](_0x1e434f[_0xe8a3('0x22')],function(_0x26a676){return{'model':db[_0x26a676[_0xe8a3('0x23')]],'as':_0x26a676['as'],'attributes':_0x26a676[_0xe8a3('0x1f')],'include':_0x26a676[_0xe8a3('0x22')]?_[_0xe8a3('0x21')](_0x26a676['include'],function(_0x420ad3){return{'model':db[_0x420ad3[_0xe8a3('0x23')]],'as':_0x420ad3['as'],'attributes':_0x420ad3[_0xe8a3('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xe8a3('0xf')](function(_0xb67498){logger[_0xe8a3('0x10')](_0xe8a3('0x19'),_0x21cd5d);logger['debug'](_0xe8a3('0x19'),_0x21cd5d,JSON[_0xe8a3('0x24')](_0xb67498));_0x9f57f4(_0xb67498);})[_0xe8a3('0x18')](function(_0x1b0455){logger[_0xe8a3('0x14')](_0xe8a3('0x19'),_0x1b0455[_0xe8a3('0x16')],_0x21cd5d);_0x58ca24(_0x4bb708['error'](0x1f4,_0x1b0455['message']));});});};exports[_0xe8a3('0x25')]=function(_0x3df400){var _0x26834f=this;return new Promise(function(_0x2041fa,_0x436469){return db[_0xe8a3('0x1a')][_0xe8a3('0x26')]({'raw':_0x3df400[_0xe8a3('0x1c')]?_0x3df400[_0xe8a3('0x1c')][_0xe8a3('0x1d')]===undefined?!![]:![]:!![],'where':_0x3df400[_0xe8a3('0x1c')]?_0x3df400['options'][_0xe8a3('0x1e')]||null:null,'attributes':_0x3df400[_0xe8a3('0x1c')]?_0x3df400[_0xe8a3('0x1c')]['attributes']||null:null,'include':_0x3df400[_0xe8a3('0x1c')]?_0x3df400[_0xe8a3('0x1c')][_0xe8a3('0x22')]?_[_0xe8a3('0x21')](_0x3df400[_0xe8a3('0x1c')][_0xe8a3('0x22')],function(_0x3907dd){return{'model':db[_0x3907dd[_0xe8a3('0x23')]],'as':_0x3907dd['as'],'attributes':_0x3907dd[_0xe8a3('0x1f')],'include':_0x3907dd[_0xe8a3('0x22')]?_[_0xe8a3('0x21')](_0x3907dd[_0xe8a3('0x22')],function(_0x3e8b9a){return{'model':db[_0x3e8b9a['model']],'as':_0x3e8b9a['as'],'attributes':_0x3e8b9a[_0xe8a3('0x1f')],'include':_0x3e8b9a[_0xe8a3('0x22')]?_[_0xe8a3('0x21')](_0x3e8b9a[_0xe8a3('0x22')],function(_0x2bc5df){return{'model':db[_0x2bc5df['model']],'as':_0x2bc5df['as'],'attributes':_0x2bc5df['attributes']};}):[]};}):[]};}):[]:[]})[_0xe8a3('0xf')](function(_0x3900fd){logger[_0xe8a3('0x10')]('ShowFaxQueue',_0x3df400);logger[_0xe8a3('0x27')]('ShowFaxQueue',_0x3df400,JSON[_0xe8a3('0x24')](_0x3900fd));_0x2041fa(_0x3900fd);})[_0xe8a3('0x18')](function(_0x55a24b){logger['error'](_0xe8a3('0x25'),_0x55a24b['message'],_0x3df400);_0x436469(_0x26834f['error'](0x1f4,_0x55a24b[_0xe8a3('0x16')]));});});};
\ No newline at end of file
diff --git a/server/api/faxQueue/faxQueue.socket.js b/server/api/faxQueue/faxQueue.socket.js
index 7d22119..22800f6 100644
--- a/server/api/faxQueue/faxQueue.socket.js
+++ b/server/api/faxQueue/faxQueue.socket.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x2347=['save','remove','update','emit','register','length','./faxQueue.events'];(function(_0x2d4421,_0x15a84f){var _0x2d3b01=function(_0xb9e94c){while(--_0xb9e94c){_0x2d4421['push'](_0x2d4421['shift']());}};_0x2d3b01(++_0x15a84f);}(_0x2347,0x133));var _0x7234=function(_0x3bc55f,_0x39f176){_0x3bc55f=_0x3bc55f-0x0;var _0x1b45a1=_0x2347[_0x3bc55f];return _0x1b45a1;};'use strict';var FaxQueueEvents=require(_0x7234('0x0'));var events=[_0x7234('0x1'),_0x7234('0x2'),_0x7234('0x3')];function createListener(_0x3d5c58,_0x170ec3){return function(_0x228f04){_0x170ec3[_0x7234('0x4')](_0x3d5c58,_0x228f04);};}function removeListener(_0x14a913,_0x4148f8){return function(){FaxQueueEvents['removeListener'](_0x14a913,_0x4148f8);};}exports[_0x7234('0x5')]=function(_0x1a4d8c){for(var _0x17a1de=0x0,_0x26afd2=events[_0x7234('0x6')];_0x17a1de<_0x26afd2;_0x17a1de++){var _0xe5eb7a=events[_0x17a1de];var _0xaa294d=createListener('faxQueue:'+_0xe5eb7a,_0x1a4d8c);FaxQueueEvents['on'](_0xe5eb7a,_0xaa294d);}};
\ No newline at end of file
+var _0x0d20=['register','faxQueue:','./faxQueue.events','remove','update','emit','removeListener'];(function(_0x4ea69d,_0x290f53){var _0x5318e0=function(_0x18e081){while(--_0x18e081){_0x4ea69d['push'](_0x4ea69d['shift']());}};_0x5318e0(++_0x290f53);}(_0x0d20,0x6b));var _0x00d2=function(_0x4d67ad,_0x82e1ff){_0x4d67ad=_0x4d67ad-0x0;var _0x5e29c1=_0x0d20[_0x4d67ad];return _0x5e29c1;};'use strict';var FaxQueueEvents=require(_0x00d2('0x0'));var events=['save',_0x00d2('0x1'),_0x00d2('0x2')];function createListener(_0x1755e7,_0x5cd67b){return function(_0x537e31){_0x5cd67b[_0x00d2('0x3')](_0x1755e7,_0x537e31);};}function removeListener(_0x36eb0b,_0x18af6c){return function(){FaxQueueEvents[_0x00d2('0x4')](_0x36eb0b,_0x18af6c);};}exports[_0x00d2('0x5')]=function(_0x99a166){for(var _0x4f6dbc=0x0,_0x3cc257=events['length'];_0x4f6dbc<_0x3cc257;_0x4f6dbc++){var _0x27faf9=events[_0x4f6dbc];var _0x5418e2=createListener(_0x00d2('0x6')+_0x27faf9,_0x99a166);FaxQueueEvents['on'](_0x27faf9,_0x5418e2);}};
\ No newline at end of file
diff --git a/server/api/faxQueue/index.js b/server/api/faxQueue/index.js
index e5a0217..7c496cd 100644
--- a/server/api/faxQueue/index.js
+++ b/server/api/faxQueue/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xb10b=['addTeams','addAgents','put','update','delete','destroy','removeTeams','removeAgents','multer','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxQueue.controller','get','isAuthenticated','/describe','describe','/:id','show','/:id/members','/:id/teams','getTeams','/:id/users','getAgents','post','create'];(function(_0x202c61,_0x3673e0){var _0x540691=function(_0x409610){while(--_0x409610){_0x202c61['push'](_0x202c61['shift']());}};_0x540691(++_0x3673e0);}(_0xb10b,0x12a));var _0xbb10=function(_0xcf4569,_0x1ce755){_0xcf4569=_0xcf4569-0x0;var _0x7fef=_0xb10b[_0xcf4569];return _0x7fef;};'use strict';var multer=require(_0xbb10('0x0'));var util=require('util');var path=require(_0xbb10('0x1'));var timeout=require(_0xbb10('0x2'));var express=require(_0xbb10('0x3'));var router=express['Router']();var auth=require(_0xbb10('0x4'));var interaction=require(_0xbb10('0x5'));var config=require(_0xbb10('0x6'));var controller=require(_0xbb10('0x7'));router[_0xbb10('0x8')]('/',auth[_0xbb10('0x9')](),controller['index']);router[_0xbb10('0x8')](_0xbb10('0xa'),auth['isAuthenticated'](),controller[_0xbb10('0xb')]);router[_0xbb10('0x8')](_0xbb10('0xc'),auth[_0xbb10('0x9')](),controller[_0xbb10('0xd')]);router[_0xbb10('0x8')](_0xbb10('0xe'),auth[_0xbb10('0x9')](),controller['getMembers']);router['get'](_0xbb10('0xf'),auth[_0xbb10('0x9')](),controller[_0xbb10('0x10')]);router['get'](_0xbb10('0x11'),auth['isAuthenticated'](),controller[_0xbb10('0x12')]);router[_0xbb10('0x13')]('/',auth[_0xbb10('0x9')](),controller[_0xbb10('0x14')]);router[_0xbb10('0x13')](_0xbb10('0xf'),auth['isAuthenticated'](),controller[_0xbb10('0x15')]);router[_0xbb10('0x13')](_0xbb10('0x11'),auth[_0xbb10('0x9')](),controller[_0xbb10('0x16')]);router[_0xbb10('0x17')](_0xbb10('0xc'),auth[_0xbb10('0x9')](),controller[_0xbb10('0x18')]);router[_0xbb10('0x19')]('/:id',auth[_0xbb10('0x9')](),controller[_0xbb10('0x1a')]);router[_0xbb10('0x19')](_0xbb10('0xf'),auth[_0xbb10('0x9')](),controller[_0xbb10('0x1b')]);router[_0xbb10('0x19')](_0xbb10('0x11'),auth[_0xbb10('0x9')](),controller[_0xbb10('0x1c')]);module['exports']=router;
\ No newline at end of file
+var _0xb10b=['addTeams','addAgents','put','update','delete','destroy','removeTeams','removeAgents','multer','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxQueue.controller','get','isAuthenticated','/describe','describe','/:id','show','/:id/members','/:id/teams','getTeams','/:id/users','getAgents','post','create'];(function(_0x481bf7,_0x437f69){var _0x461787=function(_0xb3bc9d){while(--_0xb3bc9d){_0x481bf7['push'](_0x481bf7['shift']());}};_0x461787(++_0x437f69);}(_0xb10b,0x12a));var _0xbb10=function(_0x149ca0,_0x2ac7f5){_0x149ca0=_0x149ca0-0x0;var _0x56b6b9=_0xb10b[_0x149ca0];return _0x56b6b9;};'use strict';var multer=require(_0xbb10('0x0'));var util=require('util');var path=require(_0xbb10('0x1'));var timeout=require(_0xbb10('0x2'));var express=require(_0xbb10('0x3'));var router=express['Router']();var auth=require(_0xbb10('0x4'));var interaction=require(_0xbb10('0x5'));var config=require(_0xbb10('0x6'));var controller=require(_0xbb10('0x7'));router[_0xbb10('0x8')]('/',auth[_0xbb10('0x9')](),controller['index']);router[_0xbb10('0x8')](_0xbb10('0xa'),auth['isAuthenticated'](),controller[_0xbb10('0xb')]);router[_0xbb10('0x8')](_0xbb10('0xc'),auth[_0xbb10('0x9')](),controller[_0xbb10('0xd')]);router[_0xbb10('0x8')](_0xbb10('0xe'),auth[_0xbb10('0x9')](),controller['getMembers']);router['get'](_0xbb10('0xf'),auth[_0xbb10('0x9')](),controller[_0xbb10('0x10')]);router['get'](_0xbb10('0x11'),auth['isAuthenticated'](),controller[_0xbb10('0x12')]);router[_0xbb10('0x13')]('/',auth[_0xbb10('0x9')](),controller[_0xbb10('0x14')]);router[_0xbb10('0x13')](_0xbb10('0xf'),auth['isAuthenticated'](),controller[_0xbb10('0x15')]);router[_0xbb10('0x13')](_0xbb10('0x11'),auth[_0xbb10('0x9')](),controller[_0xbb10('0x16')]);router[_0xbb10('0x17')](_0xbb10('0xc'),auth[_0xbb10('0x9')](),controller[_0xbb10('0x18')]);router[_0xbb10('0x19')]('/:id',auth[_0xbb10('0x9')](),controller[_0xbb10('0x1a')]);router[_0xbb10('0x19')](_0xbb10('0xf'),auth[_0xbb10('0x9')](),controller[_0xbb10('0x1b')]);router[_0xbb10('0x19')](_0xbb10('0x11'),auth[_0xbb10('0x9')](),controller[_0xbb10('0x1c')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/faxQueueReport/faxQueueReport.attributes.js b/server/api/faxQueueReport/faxQueueReport.attributes.js
index 888cfdd..92a3da2 100644
--- a/server/api/faxQueueReport/faxQueueReport.attributes.js
+++ b/server/api/faxQueueReport/faxQueueReport.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x2935=['exports','STRING','DATE'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x2935,0x1d1));var _0x5293=function(_0x593cc6,_0x592022){_0x593cc6=_0x593cc6-0x0;var _0x26038a=_0x2935[_0x593cc6];return _0x26038a;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0x5293('0x0')]={'uniqueid':{'type':Sequelize[_0x5293('0x1')],'allowNull':![]},'from':{'type':Sequelize[_0x5293('0x1')]},'joinAt':{'type':Sequelize[_0x5293('0x2')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x5293('0x2')]},'reason':{'type':Sequelize[_0x5293('0x1')]}};
\ No newline at end of file
+var _0x2b5a=['exports','STRING','DATE','moment','sequelize'];(function(_0x9733df,_0x450c75){var _0x1abfad=function(_0x536974){while(--_0x536974){_0x9733df['push'](_0x9733df['shift']());}};_0x1abfad(++_0x450c75);}(_0x2b5a,0x1c0));var _0xa2b5=function(_0x2049fd,_0x35f359){_0x2049fd=_0x2049fd-0x0;var _0x52dc67=_0x2b5a[_0x2049fd];return _0x52dc67;};'use strict';var moment=require(_0xa2b5('0x0'));var Sequelize=require(_0xa2b5('0x1'));module[_0xa2b5('0x2')]={'uniqueid':{'type':Sequelize[_0xa2b5('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0xa2b5('0x3')]},'joinAt':{'type':Sequelize[_0xa2b5('0x4')]},'leaveAt':{'type':Sequelize[_0xa2b5('0x4')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0xa2b5('0x3')]}};
\ No newline at end of file
diff --git a/server/api/faxQueueReport/faxQueueReport.controller.js b/server/api/faxQueueReport/faxQueueReport.controller.js
index 7759003..04af6bd 100644
--- a/server/api/faxQueueReport/faxQueueReport.controller.js
+++ b/server/api/faxQueueReport/faxQueueReport.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x771c=['rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','lodash','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','json','offset','limit','set','Content-Range','apply','reject','update','then','destroy','end','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','FaxQueueReport','count','includeAll','include','rows','catch','show','params','find','create','body','eml-format'];(function(_0x4b291d,_0x44740f){var _0x572c36=function(_0x35e1cc){while(--_0x35e1cc){_0x4b291d['push'](_0x4b291d['shift']());}};_0x572c36(++_0x44740f);}(_0x771c,0x176));var _0xc771=function(_0x46dd5a,_0x14c890){_0x46dd5a=_0x46dd5a-0x0;var _0x562da4=_0x771c[_0x46dd5a];return _0x562da4;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xc771('0x0'));var rimraf=require(_0xc771('0x1'));var zipdir=require(_0xc771('0x2'));var jsonpatch=require(_0xc771('0x3'));var rp=require(_0xc771('0x4'));var moment=require('moment');var BPromise=require(_0xc771('0x5'));var Mustache=require(_0xc771('0x6'));var util=require('util');var path=require(_0xc771('0x7'));var sox=require(_0xc771('0x8'));var csv=require(_0xc771('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xc771('0xa'));var squel=require(_0xc771('0xb'));var crypto=require(_0xc771('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xc771('0xd'));var toCsv=require(_0xc771('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xc771('0xe'));var authService=require(_0xc771('0xf'));var qs=require(_0xc771('0x10'));var as=require(_0xc771('0x11'));var hardwareService=require(_0xc771('0x12'));var logger=require(_0xc771('0x13'))(_0xc771('0x14'));var utils=require(_0xc771('0x15'));var config=require('../../config/environment');var db=require(_0xc771('0x16'))['db'];function respondWithStatusCode(_0x2a17d1,_0x13a563){_0x13a563=_0x13a563||0xcc;return function(_0x816736){if(_0x816736){return _0x2a17d1[_0xc771('0x17')](_0x13a563);}return _0x2a17d1[_0xc771('0x18')](_0x13a563)['end']();};}function respondWithResult(_0x33afe3,_0x2daf98){_0x2daf98=_0x2daf98||0xc8;return function(_0x55da7d){if(_0x55da7d){return _0x33afe3['status'](_0x2daf98)[_0xc771('0x19')](_0x55da7d);}};}function respondWithFilteredResult(_0x3af8cc,_0x5b3430){return function(_0xef6abe){if(_0xef6abe){var _0x4ead9e=_0xef6abe['count'],_0xdc3925=_0x5b3430[_0xc771('0x1a')],_0xae881b=_0x5b3430[_0xc771('0x1a')]+_0x5b3430[_0xc771('0x1b')],_0x1e956f;if(_0xae881b>=_0x4ead9e){_0xae881b=_0x4ead9e;_0x1e956f=0xc8;}else{_0x1e956f=0xce;}_0x3af8cc[_0xc771('0x18')](_0x1e956f);return _0x3af8cc[_0xc771('0x1c')](_0xc771('0x1d'),_0xdc3925+'-'+_0xae881b+'/'+_0x4ead9e)[_0xc771('0x19')](_0xef6abe);}return null;};}function patchUpdates(_0x45128b){return function(_0x143cda){try{jsonpatch[_0xc771('0x1e')](_0x143cda,_0x45128b,!![]);}catch(_0x5cb899){return BPromise[_0xc771('0x1f')](_0x5cb899);}return _0x143cda['save']();};}function saveUpdates(_0x4f5223,_0x27041d){return function(_0x3f2502){if(_0x3f2502){return _0x3f2502[_0xc771('0x20')](_0x4f5223)[_0xc771('0x21')](function(_0x2311ed){return _0x2311ed;});}return null;};}function removeEntity(_0x56a691,_0x45ffdc){return function(_0x21f6d0){if(_0x21f6d0){return _0x21f6d0[_0xc771('0x22')]()[_0xc771('0x21')](function(){_0x56a691[_0xc771('0x18')](0xcc)[_0xc771('0x23')]();});}};}function handleEntityNotFound(_0x18623d,_0x26ddaa){return function(_0x5d2258){if(!_0x5d2258){_0x18623d[_0xc771('0x17')](0x194);}return _0x5d2258;};}function handleError(_0x1e0e08,_0x4fccac){_0x4fccac=_0x4fccac||0x1f4;return function(_0x5c4477){logger[_0xc771('0x24')](_0x5c4477[_0xc771('0x25')]);if(_0x5c4477[_0xc771('0x26')]){delete _0x5c4477[_0xc771('0x26')];}_0x1e0e08[_0xc771('0x18')](_0x4fccac)[_0xc771('0x27')](_0x5c4477);};}exports[_0xc771('0x28')]=function(_0x5b346c,_0x70cdc5){var _0x16edf8={},_0x31f88b={},_0x45a370={'count':0x0,'rows':[]};var _0x36d470=_[_0xc771('0x29')](db['FaxQueueReport'][_0xc771('0x2a')],function(_0x25d48b){return{'name':_0x25d48b[_0xc771('0x2b')],'type':_0x25d48b[_0xc771('0x2c')][_0xc771('0x2d')]};});_0x31f88b[_0xc771('0x2e')]=_[_0xc771('0x29')](_0x36d470,_0xc771('0x26'));_0x31f88b[_0xc771('0x2f')]=_[_0xc771('0x30')](_0x5b346c[_0xc771('0x2f')]);_0x31f88b[_0xc771('0x31')]=_[_0xc771('0x32')](_0x31f88b[_0xc771('0x2e')],_0x31f88b[_0xc771('0x2f')]);_0x16edf8[_0xc771('0x33')]=_[_0xc771('0x32')](_0x31f88b[_0xc771('0x2e')],qs[_0xc771('0x34')](_0x5b346c[_0xc771('0x2f')][_0xc771('0x34')]));_0x16edf8['attributes']=_0x16edf8[_0xc771('0x33')][_0xc771('0x35')]?_0x16edf8[_0xc771('0x33')]:_0x31f88b[_0xc771('0x2e')];if(!_0x5b346c[_0xc771('0x2f')][_0xc771('0x36')](_0xc771('0x37'))){_0x16edf8[_0xc771('0x1b')]=qs[_0xc771('0x1b')](_0x5b346c[_0xc771('0x2f')][_0xc771('0x1b')]);_0x16edf8['offset']=qs['offset'](_0x5b346c[_0xc771('0x2f')][_0xc771('0x1a')]);}_0x16edf8[_0xc771('0x38')]=qs[_0xc771('0x39')](_0x5b346c[_0xc771('0x2f')]['sort']);_0x16edf8[_0xc771('0x3a')]=qs[_0xc771('0x31')](_[_0xc771('0x3b')](_0x5b346c[_0xc771('0x2f')],_0x31f88b[_0xc771('0x31')]),_0x36d470);if(_0x5b346c[_0xc771('0x2f')]['filter']){_0x16edf8[_0xc771('0x3a')]=_[_0xc771('0x3c')](_0x16edf8[_0xc771('0x3a')],{'$or':_[_0xc771('0x29')](_0x36d470,function(_0x3d44f6){if(_0x3d44f6[_0xc771('0x2c')]!==_0xc771('0x3d')){var _0x50b355={};_0x50b355[_0x3d44f6[_0xc771('0x26')]]={'$like':'%'+_0x5b346c['query'][_0xc771('0x3e')]+'%'};return _0x50b355;}})});}_0x16edf8=_['merge']({},_0x16edf8,_0x5b346c[_0xc771('0x3f')]);var _0x40774d={'where':_0x16edf8[_0xc771('0x3a')]};return db[_0xc771('0x40')]['count'](_0x40774d)[_0xc771('0x21')](function(_0x4d3e51){_0x45a370[_0xc771('0x41')]=_0x4d3e51;if(_0x5b346c['query'][_0xc771('0x42')]){_0x16edf8[_0xc771('0x43')]=[{'all':!![]}];}return db[_0xc771('0x40')]['findAll'](_0x16edf8);})['then'](function(_0xcac643){_0x45a370[_0xc771('0x44')]=_0xcac643;return _0x45a370;})['then'](respondWithFilteredResult(_0x70cdc5,_0x16edf8))[_0xc771('0x45')](handleError(_0x70cdc5,null));};exports[_0xc771('0x46')]=function(_0x12b9c5,_0x41ed7f){var _0x23ffac={'raw':!![],'where':{'id':_0x12b9c5[_0xc771('0x47')]['id']}},_0x3114d1={};_0x3114d1[_0xc771('0x2e')]=_['keys'](db['FaxQueueReport'][_0xc771('0x2a')]);_0x3114d1[_0xc771('0x2f')]=_[_0xc771('0x30')](_0x12b9c5[_0xc771('0x2f')]);_0x3114d1['filters']=_['intersection'](_0x3114d1[_0xc771('0x2e')],_0x3114d1[_0xc771('0x2f')]);_0x23ffac['attributes']=_[_0xc771('0x32')](_0x3114d1[_0xc771('0x2e')],qs[_0xc771('0x34')](_0x12b9c5[_0xc771('0x2f')][_0xc771('0x34')]));_0x23ffac[_0xc771('0x33')]=_0x23ffac[_0xc771('0x33')][_0xc771('0x35')]?_0x23ffac[_0xc771('0x33')]:_0x3114d1[_0xc771('0x2e')];if(_0x12b9c5[_0xc771('0x2f')][_0xc771('0x42')]){_0x23ffac[_0xc771('0x43')]=[{'all':!![]}];}_0x23ffac=_['merge']({},_0x23ffac,_0x12b9c5[_0xc771('0x3f')]);return db[_0xc771('0x40')][_0xc771('0x48')](_0x23ffac)[_0xc771('0x21')](handleEntityNotFound(_0x41ed7f,null))[_0xc771('0x21')](respondWithResult(_0x41ed7f,null))[_0xc771('0x45')](handleError(_0x41ed7f,null));};exports['create']=function(_0x2a9c9b,_0x871840){return db[_0xc771('0x40')][_0xc771('0x49')](_0x2a9c9b[_0xc771('0x4a')],{})[_0xc771('0x21')](respondWithResult(_0x871840,0xc9))[_0xc771('0x45')](handleError(_0x871840,null));};exports[_0xc771('0x20')]=function(_0x3a45cd,_0x1ff72c){if(_0x3a45cd[_0xc771('0x4a')]['id']){delete _0x3a45cd['body']['id'];}return db[_0xc771('0x40')]['find']({'where':{'id':_0x3a45cd[_0xc771('0x47')]['id']}})[_0xc771('0x21')](handleEntityNotFound(_0x1ff72c,null))['then'](saveUpdates(_0x3a45cd[_0xc771('0x4a')],null))[_0xc771('0x21')](respondWithResult(_0x1ff72c,null))[_0xc771('0x45')](handleError(_0x1ff72c,null));};exports[_0xc771('0x22')]=function(_0x4d56ad,_0x476ba0){return db[_0xc771('0x40')][_0xc771('0x48')]({'where':{'id':_0x4d56ad[_0xc771('0x47')]['id']}})[_0xc771('0x21')](handleEntityNotFound(_0x476ba0,null))['then'](removeEntity(_0x476ba0,null))['catch'](handleError(_0x476ba0,null));};exports['describe']=function(_0x4da3cd,_0x2d9842){return db[_0xc771('0x40')]['describe']()[_0xc771('0x21')](respondWithResult(_0x2d9842,null))[_0xc771('0x45')](handleError(_0x2d9842,null));};
\ No newline at end of file
+var _0xea80=['destroy','error','stack','name','send','index','map','FaxQueueReport','rawAttributes','type','key','model','query','keys','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filters','filter','merge','VIRTUAL','options','then','includeAll','include','catch','show','params','intersection','find','create','update','body','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../mysqldb','sendStatus','end','status','json','count','offset','limit','set','apply','reject','save'];(function(_0x581255,_0x52439b){var _0x270a32=function(_0x5ee9ee){while(--_0x5ee9ee){_0x581255['push'](_0x581255['shift']());}};_0x270a32(++_0x52439b);}(_0xea80,0x1d7));var _0x0ea8=function(_0xf2b559,_0x5e5e1b){_0xf2b559=_0xf2b559-0x0;var _0x49f356=_0xea80[_0xf2b559];return _0x49f356;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x0ea8('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x0ea8('0x1'));var jsonpatch=require(_0x0ea8('0x2'));var rp=require(_0x0ea8('0x3'));var moment=require(_0x0ea8('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x0ea8('0x5'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x0ea8('0x6'));var ejs=require(_0x0ea8('0x7'));var fs=require('fs');var _=require(_0x0ea8('0x8'));var squel=require('squel');var crypto=require(_0x0ea8('0x9'));var jsforce=require(_0x0ea8('0xa'));var deskjs=require(_0x0ea8('0xb'));var toCsv=require(_0x0ea8('0x6'));var querystring=require(_0x0ea8('0xc'));var Papa=require(_0x0ea8('0xd'));var Redis=require(_0x0ea8('0xe'));var authService=require(_0x0ea8('0xf'));var qs=require(_0x0ea8('0x10'));var as=require(_0x0ea8('0x11'));var hardwareService=require(_0x0ea8('0x12'));var logger=require(_0x0ea8('0x13'))(_0x0ea8('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x0ea8('0x15'))['db'];function respondWithStatusCode(_0x4b2de5,_0x4063a2){_0x4063a2=_0x4063a2||0xcc;return function(_0x1c507c){if(_0x1c507c){return _0x4b2de5[_0x0ea8('0x16')](_0x4063a2);}return _0x4b2de5['status'](_0x4063a2)[_0x0ea8('0x17')]();};}function respondWithResult(_0x3e8f63,_0x39f69f){_0x39f69f=_0x39f69f||0xc8;return function(_0x370c28){if(_0x370c28){return _0x3e8f63[_0x0ea8('0x18')](_0x39f69f)[_0x0ea8('0x19')](_0x370c28);}};}function respondWithFilteredResult(_0x4ff877,_0x2f9803){return function(_0x16bf27){if(_0x16bf27){var _0x51076d=_0x16bf27[_0x0ea8('0x1a')],_0x269ca1=_0x2f9803[_0x0ea8('0x1b')],_0x117c59=_0x2f9803['offset']+_0x2f9803[_0x0ea8('0x1c')],_0x34a531;if(_0x117c59>=_0x51076d){_0x117c59=_0x51076d;_0x34a531=0xc8;}else{_0x34a531=0xce;}_0x4ff877[_0x0ea8('0x18')](_0x34a531);return _0x4ff877[_0x0ea8('0x1d')]('Content-Range',_0x269ca1+'-'+_0x117c59+'/'+_0x51076d)[_0x0ea8('0x19')](_0x16bf27);}return null;};}function patchUpdates(_0x3e7c14){return function(_0x3b1a06){try{jsonpatch[_0x0ea8('0x1e')](_0x3b1a06,_0x3e7c14,!![]);}catch(_0x102618){return BPromise[_0x0ea8('0x1f')](_0x102618);}return _0x3b1a06[_0x0ea8('0x20')]();};}function saveUpdates(_0x50586c,_0xc122a1){return function(_0x4a848f){if(_0x4a848f){return _0x4a848f['update'](_0x50586c)['then'](function(_0x34078f){return _0x34078f;});}return null;};}function removeEntity(_0x2a9520,_0x4a01c4){return function(_0x44a7ad){if(_0x44a7ad){return _0x44a7ad[_0x0ea8('0x21')]()['then'](function(){_0x2a9520[_0x0ea8('0x18')](0xcc)[_0x0ea8('0x17')]();});}};}function handleEntityNotFound(_0x58b07a,_0x1e8269){return function(_0x3bf98b){if(!_0x3bf98b){_0x58b07a['sendStatus'](0x194);}return _0x3bf98b;};}function handleError(_0x2e4aa4,_0x2a28d2){_0x2a28d2=_0x2a28d2||0x1f4;return function(_0xaebef4){logger[_0x0ea8('0x22')](_0xaebef4[_0x0ea8('0x23')]);if(_0xaebef4[_0x0ea8('0x24')]){delete _0xaebef4[_0x0ea8('0x24')];}_0x2e4aa4['status'](_0x2a28d2)[_0x0ea8('0x25')](_0xaebef4);};}exports[_0x0ea8('0x26')]=function(_0x544d20,_0x41c4ef){var _0x529c97={},_0x328f44={},_0xa2f1de={'count':0x0,'rows':[]};var _0x211cd7=_[_0x0ea8('0x27')](db[_0x0ea8('0x28')][_0x0ea8('0x29')],function(_0x3b8f1d){return{'name':_0x3b8f1d['fieldName'],'type':_0x3b8f1d[_0x0ea8('0x2a')][_0x0ea8('0x2b')]};});_0x328f44[_0x0ea8('0x2c')]=_[_0x0ea8('0x27')](_0x211cd7,_0x0ea8('0x24'));_0x328f44[_0x0ea8('0x2d')]=_[_0x0ea8('0x2e')](_0x544d20['query']);_0x328f44['filters']=_['intersection'](_0x328f44[_0x0ea8('0x2c')],_0x328f44['query']);_0x529c97[_0x0ea8('0x2f')]=_['intersection'](_0x328f44['model'],qs['fields'](_0x544d20['query'][_0x0ea8('0x30')]));_0x529c97['attributes']=_0x529c97[_0x0ea8('0x2f')][_0x0ea8('0x31')]?_0x529c97[_0x0ea8('0x2f')]:_0x328f44['model'];if(!_0x544d20[_0x0ea8('0x2d')][_0x0ea8('0x32')](_0x0ea8('0x33'))){_0x529c97[_0x0ea8('0x1c')]=qs['limit'](_0x544d20[_0x0ea8('0x2d')]['limit']);_0x529c97[_0x0ea8('0x1b')]=qs[_0x0ea8('0x1b')](_0x544d20['query']['offset']);}_0x529c97['order']=qs[_0x0ea8('0x34')](_0x544d20['query'][_0x0ea8('0x34')]);_0x529c97[_0x0ea8('0x35')]=qs['filters'](_[_0x0ea8('0x36')](_0x544d20[_0x0ea8('0x2d')],_0x328f44[_0x0ea8('0x37')]),_0x211cd7);if(_0x544d20[_0x0ea8('0x2d')][_0x0ea8('0x38')]){_0x529c97[_0x0ea8('0x35')]=_[_0x0ea8('0x39')](_0x529c97[_0x0ea8('0x35')],{'$or':_['map'](_0x211cd7,function(_0x2cdbe9){if(_0x2cdbe9['type']!==_0x0ea8('0x3a')){var _0x1a09dd={};_0x1a09dd[_0x2cdbe9['name']]={'$like':'%'+_0x544d20[_0x0ea8('0x2d')][_0x0ea8('0x38')]+'%'};return _0x1a09dd;}})});}_0x529c97=_['merge']({},_0x529c97,_0x544d20[_0x0ea8('0x3b')]);var _0xcedec3={'where':_0x529c97[_0x0ea8('0x35')]};return db[_0x0ea8('0x28')][_0x0ea8('0x1a')](_0xcedec3)[_0x0ea8('0x3c')](function(_0x89c302){_0xa2f1de['count']=_0x89c302;if(_0x544d20[_0x0ea8('0x2d')][_0x0ea8('0x3d')]){_0x529c97[_0x0ea8('0x3e')]=[{'all':!![]}];}return db['FaxQueueReport']['findAll'](_0x529c97);})[_0x0ea8('0x3c')](function(_0x32ca73){_0xa2f1de['rows']=_0x32ca73;return _0xa2f1de;})[_0x0ea8('0x3c')](respondWithFilteredResult(_0x41c4ef,_0x529c97))[_0x0ea8('0x3f')](handleError(_0x41c4ef,null));};exports[_0x0ea8('0x40')]=function(_0x5f58e5,_0xc0ffd8){var _0x41510f={'raw':!![],'where':{'id':_0x5f58e5[_0x0ea8('0x41')]['id']}},_0x3ada5e={};_0x3ada5e['model']=_['keys'](db[_0x0ea8('0x28')][_0x0ea8('0x29')]);_0x3ada5e[_0x0ea8('0x2d')]=_[_0x0ea8('0x2e')](_0x5f58e5[_0x0ea8('0x2d')]);_0x3ada5e[_0x0ea8('0x37')]=_[_0x0ea8('0x42')](_0x3ada5e['model'],_0x3ada5e[_0x0ea8('0x2d')]);_0x41510f[_0x0ea8('0x2f')]=_[_0x0ea8('0x42')](_0x3ada5e['model'],qs[_0x0ea8('0x30')](_0x5f58e5[_0x0ea8('0x2d')][_0x0ea8('0x30')]));_0x41510f[_0x0ea8('0x2f')]=_0x41510f[_0x0ea8('0x2f')]['length']?_0x41510f[_0x0ea8('0x2f')]:_0x3ada5e[_0x0ea8('0x2c')];if(_0x5f58e5[_0x0ea8('0x2d')][_0x0ea8('0x3d')]){_0x41510f[_0x0ea8('0x3e')]=[{'all':!![]}];}_0x41510f=_[_0x0ea8('0x39')]({},_0x41510f,_0x5f58e5['options']);return db[_0x0ea8('0x28')][_0x0ea8('0x43')](_0x41510f)[_0x0ea8('0x3c')](handleEntityNotFound(_0xc0ffd8,null))[_0x0ea8('0x3c')](respondWithResult(_0xc0ffd8,null))['catch'](handleError(_0xc0ffd8,null));};exports[_0x0ea8('0x44')]=function(_0x2bdadd,_0x360970){return db[_0x0ea8('0x28')][_0x0ea8('0x44')](_0x2bdadd['body'],{})['then'](respondWithResult(_0x360970,0xc9))[_0x0ea8('0x3f')](handleError(_0x360970,null));};exports[_0x0ea8('0x45')]=function(_0x5e0e63,_0x3c9a5c){if(_0x5e0e63[_0x0ea8('0x46')]['id']){delete _0x5e0e63[_0x0ea8('0x46')]['id'];}return db[_0x0ea8('0x28')][_0x0ea8('0x43')]({'where':{'id':_0x5e0e63[_0x0ea8('0x41')]['id']}})[_0x0ea8('0x3c')](handleEntityNotFound(_0x3c9a5c,null))[_0x0ea8('0x3c')](saveUpdates(_0x5e0e63[_0x0ea8('0x46')],null))[_0x0ea8('0x3c')](respondWithResult(_0x3c9a5c,null))[_0x0ea8('0x3f')](handleError(_0x3c9a5c,null));};exports['destroy']=function(_0x2f7037,_0x176bdd){return db[_0x0ea8('0x28')]['find']({'where':{'id':_0x2f7037[_0x0ea8('0x41')]['id']}})[_0x0ea8('0x3c')](handleEntityNotFound(_0x176bdd,null))[_0x0ea8('0x3c')](removeEntity(_0x176bdd,null))[_0x0ea8('0x3f')](handleError(_0x176bdd,null));};exports[_0x0ea8('0x47')]=function(_0x14b128,_0x501512){return db[_0x0ea8('0x28')][_0x0ea8('0x47')]()[_0x0ea8('0x3c')](respondWithResult(_0x501512,null))['catch'](handleError(_0x501512,null));};
\ No newline at end of file
diff --git a/server/api/faxQueueReport/faxQueueReport.model.js b/server/api/faxQueueReport/faxQueueReport.model.js
index ed69745..1dd5b22 100644
--- a/server/api/faxQueueReport/faxQueueReport.model.js
+++ b/server/api/faxQueueReport/faxQueueReport.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xaf11=['exports','FaxQueueReport','report_fax_queue','uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise','path','../../config/environment','./faxQueueReport.attributes'];(function(_0x42f270,_0x452dec){var _0x57bc5b=function(_0x258159){while(--_0x258159){_0x42f270['push'](_0x42f270['shift']());}};_0x57bc5b(++_0x452dec);}(_0xaf11,0x12f));var _0x1af1=function(_0xe0c6b9,_0x21ffb8){_0xe0c6b9=_0xe0c6b9-0x0;var _0x3de6a5=_0xaf11[_0xe0c6b9];return _0x3de6a5;};'use strict';var _=require(_0x1af1('0x0'));var util=require(_0x1af1('0x1'));var logger=require(_0x1af1('0x2'))(_0x1af1('0x3'));var moment=require('moment');var BPromise=require(_0x1af1('0x4'));var rp=require(_0x1af1('0x5'));var fs=require('fs');var path=require(_0x1af1('0x6'));var rimraf=require('rimraf');var config=require(_0x1af1('0x7'));var attributes=require(_0x1af1('0x8'));module[_0x1af1('0x9')]=function(_0x4d3153,_0x36f1a0){return _0x4d3153['define'](_0x1af1('0xa'),attributes,{'tableName':_0x1af1('0xb'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x1af1('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x77e6=['define','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./faxQueueReport.attributes'];(function(_0x224785,_0x28c2bc){var _0x390f56=function(_0x224113){while(--_0x224113){_0x224785['push'](_0x224785['shift']());}};_0x390f56(++_0x28c2bc);}(_0x77e6,0x1a6));var _0x677e=function(_0x5bb636,_0x110a54){_0x5bb636=_0x5bb636-0x0;var _0x510d35=_0x77e6[_0x5bb636];return _0x510d35;};'use strict';var _=require(_0x677e('0x0'));var util=require(_0x677e('0x1'));var logger=require(_0x677e('0x2'))(_0x677e('0x3'));var moment=require(_0x677e('0x4'));var BPromise=require(_0x677e('0x5'));var rp=require(_0x677e('0x6'));var fs=require('fs');var path=require(_0x677e('0x7'));var rimraf=require('rimraf');var config=require(_0x677e('0x8'));var attributes=require(_0x677e('0x9'));module['exports']=function(_0x18c5e1,_0x591b21){return _0x18c5e1[_0x677e('0xa')]('FaxQueueReport',attributes,{'tableName':'report_fax_queue','paranoid':![],'indexes':[{'name':_0x677e('0xb'),'fields':[_0x677e('0xb')]}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/faxQueueReport/faxQueueReport.rpc.js b/server/api/faxQueueReport/faxQueueReport.rpc.js
index 9ce109a..88c6014 100644
--- a/server/api/faxQueueReport/faxQueueReport.rpc.js
+++ b/server/api/faxQueueReport/faxQueueReport.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xe782=['../../mysqldb','../../config/utils','../../config/environment','jayson/promise','http','then','info','FaxQueueReport,\x20%s,\x20%s','request\x20sent','debug','FaxQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','create','body','options','raw','CreateFaxQueueReport','UpdateFaxQueueReport','FaxQueueReport','where','limit','lodash','util','moment','randomstring','ioredis'];(function(_0x3ae38f,_0x261d36){var _0x4f69f5=function(_0x1aa35b){while(--_0x1aa35b){_0x3ae38f['push'](_0x3ae38f['shift']());}};_0x4f69f5(++_0x261d36);}(_0xe782,0x73));var _0x2e78=function(_0x3dae8a,_0x914e35){_0x3dae8a=_0x3dae8a-0x0;var _0x234a2c=_0xe782[_0x3dae8a];return _0x234a2c;};'use strict';var _=require(_0x2e78('0x0'));var util=require(_0x2e78('0x1'));var moment=require(_0x2e78('0x2'));var BPromise=require('bluebird');var rs=require(_0x2e78('0x3'));var fs=require('fs');var Redis=require(_0x2e78('0x4'));var db=require(_0x2e78('0x5'))['db'];var utils=require(_0x2e78('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x2e78('0x7'));var jayson=require(_0x2e78('0x8'));var client=jayson['client'][_0x2e78('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2c1e91,_0x3d6fab,_0x49d1e7){return new BPromise(function(_0x35f0fb,_0x307d4d){return client['request'](_0x2c1e91,_0x49d1e7)[_0x2e78('0xa')](function(_0x16ae20){logger[_0x2e78('0xb')](_0x2e78('0xc'),_0x3d6fab,_0x2e78('0xd'));logger[_0x2e78('0xe')](_0x2e78('0xf'),_0x3d6fab,_0x2e78('0xd'),JSON[_0x2e78('0x10')](_0x16ae20));if(_0x16ae20[_0x2e78('0x11')]){if(_0x16ae20['error']['code']===0x1f4){logger[_0x2e78('0x11')]('FaxQueueReport,\x20%s,\x20%s',_0x3d6fab,_0x16ae20[_0x2e78('0x11')][_0x2e78('0x12')]);return _0x307d4d(_0x16ae20[_0x2e78('0x11')]['message']);}logger['error'](_0x2e78('0xc'),_0x3d6fab,_0x16ae20[_0x2e78('0x11')][_0x2e78('0x12')]);return _0x35f0fb(_0x16ae20[_0x2e78('0x11')][_0x2e78('0x12')]);}else{logger['info']('FaxQueueReport,\x20%s,\x20%s',_0x3d6fab,_0x2e78('0xd'));_0x35f0fb(_0x16ae20[_0x2e78('0x13')]['message']);}})[_0x2e78('0x14')](function(_0x514ec8){logger[_0x2e78('0x11')](_0x2e78('0xc'),_0x3d6fab,_0x514ec8);_0x307d4d(_0x514ec8);});});}exports['CreateFaxQueueReport']=function(_0x4b381b){var _0x55744c=this;return new Promise(function(_0x15bff2,_0x4e8ab5){return db['FaxQueueReport'][_0x2e78('0x15')](_0x4b381b[_0x2e78('0x16')],{'raw':_0x4b381b[_0x2e78('0x17')]?_0x4b381b[_0x2e78('0x17')][_0x2e78('0x18')]===undefined?!![]:![]:!![]})[_0x2e78('0xa')](function(_0x479169){logger[_0x2e78('0xb')](_0x2e78('0x19'),_0x4b381b);logger['debug'](_0x2e78('0x19'),_0x4b381b,JSON[_0x2e78('0x10')](_0x479169));_0x15bff2(_0x479169);})['catch'](function(_0x333cc8){logger[_0x2e78('0x11')]('CreateFaxQueueReport',_0x333cc8[_0x2e78('0x12')],_0x4b381b);_0x4e8ab5(_0x55744c[_0x2e78('0x11')](0x1f4,_0x333cc8[_0x2e78('0x12')]));});});};exports[_0x2e78('0x1a')]=function(_0x41c030){var _0x40c522=this;return new Promise(function(_0x135f92,_0x521309){return db[_0x2e78('0x1b')]['update'](_0x41c030[_0x2e78('0x16')],{'raw':_0x41c030[_0x2e78('0x17')]?_0x41c030[_0x2e78('0x17')][_0x2e78('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x41c030[_0x2e78('0x17')]?_0x41c030[_0x2e78('0x17')][_0x2e78('0x1c')]||null:null,'attributes':_0x41c030['options']?_0x41c030[_0x2e78('0x17')]['attributes']||null:null,'limit':_0x41c030[_0x2e78('0x17')]?_0x41c030[_0x2e78('0x17')][_0x2e78('0x1d')]||null:null})[_0x2e78('0xa')](function(_0x4f619f){logger['info'](_0x2e78('0x1a'),_0x41c030);logger[_0x2e78('0xe')]('UpdateFaxQueueReport',_0x41c030,JSON['stringify'](_0x4f619f));_0x135f92(_0x4f619f);})[_0x2e78('0x14')](function(_0x59f597){logger[_0x2e78('0x11')](_0x2e78('0x1a'),_0x59f597[_0x2e78('0x12')],_0x41c030);_0x521309(_0x40c522[_0x2e78('0x11')](0x1f4,_0x59f597['message']));});});};
\ No newline at end of file
+var _0x7527=['info','result','catch','FaxQueueReport','body','options','raw','CreateFaxQueueReport','UpdateFaxQueueReport','update','attributes','limit','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','FaxQueueReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message'];(function(_0x561f42,_0x44d837){var _0x5d66c7=function(_0x100ce9){while(--_0x100ce9){_0x561f42['push'](_0x561f42['shift']());}};_0x5d66c7(++_0x44d837);}(_0x7527,0x1ec));var _0x7752=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7527[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x7752('0x0'));var fs=require('fs');var Redis=require(_0x7752('0x1'));var db=require(_0x7752('0x2'))['db'];var utils=require(_0x7752('0x3'));var logger=require(_0x7752('0x4'))(_0x7752('0x5'));var config=require(_0x7752('0x6'));var jayson=require(_0x7752('0x7'));var client=jayson['client'][_0x7752('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3a8868,_0x53b50e,_0x190902){return new BPromise(function(_0x43e199,_0x1e75b0){return client[_0x7752('0x9')](_0x3a8868,_0x190902)[_0x7752('0xa')](function(_0x3bce1f){logger['info'](_0x7752('0xb'),_0x53b50e,_0x7752('0xc'));logger[_0x7752('0xd')]('FaxQueueReport,\x20%s,\x20%s,\x20%s',_0x53b50e,'request\x20sent',JSON[_0x7752('0xe')](_0x3bce1f));if(_0x3bce1f[_0x7752('0xf')]){if(_0x3bce1f['error'][_0x7752('0x10')]===0x1f4){logger[_0x7752('0xf')](_0x7752('0xb'),_0x53b50e,_0x3bce1f[_0x7752('0xf')]['message']);return _0x1e75b0(_0x3bce1f[_0x7752('0xf')]['message']);}logger[_0x7752('0xf')](_0x7752('0xb'),_0x53b50e,_0x3bce1f[_0x7752('0xf')][_0x7752('0x11')]);return _0x43e199(_0x3bce1f['error']['message']);}else{logger[_0x7752('0x12')](_0x7752('0xb'),_0x53b50e,_0x7752('0xc'));_0x43e199(_0x3bce1f[_0x7752('0x13')]['message']);}})[_0x7752('0x14')](function(_0x5304b8){logger[_0x7752('0xf')](_0x7752('0xb'),_0x53b50e,_0x5304b8);_0x1e75b0(_0x5304b8);});});}exports['CreateFaxQueueReport']=function(_0x7e7ef9){var _0x47124f=this;return new Promise(function(_0x53ae9e,_0x18dd9d){return db[_0x7752('0x15')]['create'](_0x7e7ef9[_0x7752('0x16')],{'raw':_0x7e7ef9[_0x7752('0x17')]?_0x7e7ef9[_0x7752('0x17')][_0x7752('0x18')]===undefined?!![]:![]:!![]})[_0x7752('0xa')](function(_0x112698){logger[_0x7752('0x12')](_0x7752('0x19'),_0x7e7ef9);logger['debug']('CreateFaxQueueReport',_0x7e7ef9,JSON[_0x7752('0xe')](_0x112698));_0x53ae9e(_0x112698);})[_0x7752('0x14')](function(_0x56364a){logger[_0x7752('0xf')](_0x7752('0x19'),_0x56364a[_0x7752('0x11')],_0x7e7ef9);_0x18dd9d(_0x47124f['error'](0x1f4,_0x56364a[_0x7752('0x11')]));});});};exports[_0x7752('0x1a')]=function(_0x59aa82){var _0xd67e51=this;return new Promise(function(_0x371b92,_0x331436){return db['FaxQueueReport'][_0x7752('0x1b')](_0x59aa82[_0x7752('0x16')],{'raw':_0x59aa82['options']?_0x59aa82[_0x7752('0x17')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x59aa82['options']?_0x59aa82[_0x7752('0x17')]['where']||null:null,'attributes':_0x59aa82[_0x7752('0x17')]?_0x59aa82[_0x7752('0x17')][_0x7752('0x1c')]||null:null,'limit':_0x59aa82['options']?_0x59aa82[_0x7752('0x17')][_0x7752('0x1d')]||null:null})[_0x7752('0xa')](function(_0x278d42){logger[_0x7752('0x12')](_0x7752('0x1a'),_0x59aa82);logger[_0x7752('0xd')](_0x7752('0x1a'),_0x59aa82,JSON[_0x7752('0xe')](_0x278d42));_0x371b92(_0x278d42);})[_0x7752('0x14')](function(_0x24f867){logger[_0x7752('0xf')](_0x7752('0x1a'),_0x24f867['message'],_0x59aa82);_0x331436(_0xd67e51[_0x7752('0xf')](0x1f4,_0x24f867[_0x7752('0x11')]));});});};
\ No newline at end of file
diff --git a/server/api/faxQueueReport/index.js b/server/api/faxQueueReport/index.js
index d3c4f26..31dc712 100644
--- a/server/api/faxQueueReport/index.js
+++ b/server/api/faxQueueReport/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9f9b=['describe','show','post','isAuthenticated','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','../../components/interaction/service','./faxQueueReport.controller','get','index','/describe'];(function(_0x3a995c,_0x184a12){var _0x37f93d=function(_0x1b51eb){while(--_0x1b51eb){_0x3a995c['push'](_0x3a995c['shift']());}};_0x37f93d(++_0x184a12);}(_0x9f9b,0x96));var _0xb9f9=function(_0x51afe9,_0x2f04f1){_0x51afe9=_0x51afe9-0x0;var _0x1b4276=_0x9f9b[_0x51afe9];return _0x1b4276;};'use strict';var multer=require(_0xb9f9('0x0'));var util=require(_0xb9f9('0x1'));var path=require(_0xb9f9('0x2'));var timeout=require(_0xb9f9('0x3'));var express=require('express');var router=express[_0xb9f9('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0xb9f9('0x5'));var config=require('../../config/environment');var controller=require(_0xb9f9('0x6'));router[_0xb9f9('0x7')]('/',auth['isAuthenticated'](),controller[_0xb9f9('0x8')]);router[_0xb9f9('0x7')](_0xb9f9('0x9'),auth['isAuthenticated'](),controller[_0xb9f9('0xa')]);router[_0xb9f9('0x7')]('/:id',auth['isAuthenticated'](),controller[_0xb9f9('0xb')]);router[_0xb9f9('0xc')]('/',auth[_0xb9f9('0xd')](),controller['create']);router[_0xb9f9('0xe')](_0xb9f9('0xf'),auth[_0xb9f9('0xd')](),controller[_0xb9f9('0x10')]);router[_0xb9f9('0x11')]('/:id',auth[_0xb9f9('0xd')](),controller[_0xb9f9('0x12')]);module[_0xb9f9('0x13')]=router;
\ No newline at end of file
+var _0xcde0=['exports','multer','util','path','connect-timeout','express','../../components/interaction/service','./faxQueueReport.controller','get','isAuthenticated','index','/describe','/:id','post','create','put','update','destroy'];(function(_0xb1baff,_0x3b8591){var _0x5a7dfe=function(_0x55abd3){while(--_0x55abd3){_0xb1baff['push'](_0xb1baff['shift']());}};_0x5a7dfe(++_0x3b8591);}(_0xcde0,0x133));var _0x0cde=function(_0x56dba7,_0x597030){_0x56dba7=_0x56dba7-0x0;var _0x32e3ed=_0xcde0[_0x56dba7];return _0x32e3ed;};'use strict';var multer=require(_0x0cde('0x0'));var util=require(_0x0cde('0x1'));var path=require(_0x0cde('0x2'));var timeout=require(_0x0cde('0x3'));var express=require(_0x0cde('0x4'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x0cde('0x5'));var config=require('../../config/environment');var controller=require(_0x0cde('0x6'));router[_0x0cde('0x7')]('/',auth[_0x0cde('0x8')](),controller[_0x0cde('0x9')]);router[_0x0cde('0x7')](_0x0cde('0xa'),auth[_0x0cde('0x8')](),controller['describe']);router[_0x0cde('0x7')](_0x0cde('0xb'),auth[_0x0cde('0x8')](),controller['show']);router[_0x0cde('0xc')]('/',auth[_0x0cde('0x8')](),controller[_0x0cde('0xd')]);router[_0x0cde('0xe')]('/:id',auth['isAuthenticated'](),controller[_0x0cde('0xf')]);router['delete'](_0x0cde('0xb'),auth[_0x0cde('0x8')](),controller[_0x0cde('0x10')]);module[_0x0cde('0x11')]=router;
\ No newline at end of file
diff --git a/server/api/faxTransferReport/faxTransferReport.attributes.js b/server/api/faxTransferReport/faxTransferReport.attributes.js
index b08e278..6416bbf 100644
--- a/server/api/faxTransferReport/faxTransferReport.attributes.js
+++ b/server/api/faxTransferReport/faxTransferReport.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xce9f=['moment','sequelize','exports','STRING','account','queue','DATE','NOW'];(function(_0xf43ac5,_0x355cde){var _0x164cc8=function(_0x29c83d){while(--_0x29c83d){_0xf43ac5['push'](_0xf43ac5['shift']());}};_0x164cc8(++_0x355cde);}(_0xce9f,0xe8));var _0xfce9=function(_0x370cf0,_0x51bb6f){_0x370cf0=_0x370cf0-0x0;var _0x25c9b8=_0xce9f[_0x370cf0];return _0x25c9b8;};'use strict';var moment=require(_0xfce9('0x0'));var Sequelize=require(_0xfce9('0x1'));module[_0xfce9('0x2')]={'uniqueid':{'type':Sequelize[_0xfce9('0x3')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xfce9('0x4'),'agent',_0xfce9('0x5')),'allowNull':![],'defaultValue':_0xfce9('0x5')},'transferredAt':{'type':Sequelize[_0xfce9('0x6')],'allowNull':![],'defaultValue':Sequelize[_0xfce9('0x7')]}};
\ No newline at end of file
+var _0xcae8=['DATE','moment','sequelize','exports','STRING','ENUM','account','agent'];(function(_0x298b71,_0x59291a){var _0x4adcd6=function(_0x325152){while(--_0x325152){_0x298b71['push'](_0x298b71['shift']());}};_0x4adcd6(++_0x59291a);}(_0xcae8,0x121));var _0x8cae=function(_0x16bb0e,_0x343132){_0x16bb0e=_0x16bb0e-0x0;var _0x102b8b=_0xcae8[_0x16bb0e];return _0x102b8b;};'use strict';var moment=require(_0x8cae('0x0'));var Sequelize=require(_0x8cae('0x1'));module[_0x8cae('0x2')]={'uniqueid':{'type':Sequelize[_0x8cae('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0x8cae('0x4')](_0x8cae('0x5'),_0x8cae('0x6'),'queue'),'allowNull':![],'defaultValue':'queue'},'transferredAt':{'type':Sequelize[_0x8cae('0x7')],'allowNull':![],'defaultValue':Sequelize['NOW']}};
\ No newline at end of file
diff --git a/server/api/faxTransferReport/faxTransferReport.controller.js b/server/api/faxTransferReport/faxTransferReport.controller.js
index d7fd56b..24da8e9 100644
--- a/server/api/faxTransferReport/faxTransferReport.controller.js
+++ b/server/api/faxTransferReport/faxTransferReport.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xadb5=['map','fieldName','type','key','model','query','keys','filters','intersection','attributes','nolimit','order','sort','where','VIRTUAL','merge','options','FaxTransferReport','findAll','rows','catch','show','rawAttributes','fields','includeAll','include','find','create','body','update','describe','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','count','offset','limit','set','json','reject','save','then','destroy','stack','name','send','index'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0xadb5,0xad));var _0x5adb=function(_0x3ef8f5,_0x509faf){_0x3ef8f5=_0x3ef8f5-0x0;var _0x2b1e50=_0xadb5[_0x3ef8f5];return _0x2b1e50;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x5adb('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x5adb('0x1'));var jsonpatch=require(_0x5adb('0x2'));var rp=require(_0x5adb('0x3'));var moment=require('moment');var BPromise=require(_0x5adb('0x4'));var Mustache=require(_0x5adb('0x5'));var util=require(_0x5adb('0x6'));var path=require('path');var sox=require(_0x5adb('0x7'));var csv=require(_0x5adb('0x8'));var ejs=require(_0x5adb('0x9'));var fs=require('fs');var _=require(_0x5adb('0xa'));var squel=require(_0x5adb('0xb'));var crypto=require(_0x5adb('0xc'));var jsforce=require(_0x5adb('0xd'));var deskjs=require(_0x5adb('0xe'));var toCsv=require(_0x5adb('0x8'));var querystring=require(_0x5adb('0xf'));var Papa=require(_0x5adb('0x10'));var Redis=require(_0x5adb('0x11'));var authService=require(_0x5adb('0x12'));var qs=require(_0x5adb('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x5adb('0x14'))(_0x5adb('0x15'));var utils=require(_0x5adb('0x16'));var config=require('../../config/environment');var db=require(_0x5adb('0x17'))['db'];function respondWithStatusCode(_0x56012f,_0x2a0b70){_0x2a0b70=_0x2a0b70||0xcc;return function(_0x5433bf){if(_0x5433bf){return _0x56012f[_0x5adb('0x18')](_0x2a0b70);}return _0x56012f[_0x5adb('0x19')](_0x2a0b70)[_0x5adb('0x1a')]();};}function respondWithResult(_0x5c929a,_0x2a545b){_0x2a545b=_0x2a545b||0xc8;return function(_0x34af2c){if(_0x34af2c){return _0x5c929a[_0x5adb('0x19')](_0x2a545b)['json'](_0x34af2c);}};}function respondWithFilteredResult(_0x2312de,_0x518823){return function(_0x367d82){if(_0x367d82){var _0x42a482=_0x367d82[_0x5adb('0x1b')],_0x30614e=_0x518823[_0x5adb('0x1c')],_0x304784=_0x518823[_0x5adb('0x1c')]+_0x518823[_0x5adb('0x1d')],_0x1c0f97;if(_0x304784>=_0x42a482){_0x304784=_0x42a482;_0x1c0f97=0xc8;}else{_0x1c0f97=0xce;}_0x2312de['status'](_0x1c0f97);return _0x2312de[_0x5adb('0x1e')]('Content-Range',_0x30614e+'-'+_0x304784+'/'+_0x42a482)[_0x5adb('0x1f')](_0x367d82);}return null;};}function patchUpdates(_0x558f76){return function(_0x3ef465){try{jsonpatch['apply'](_0x3ef465,_0x558f76,!![]);}catch(_0x5e218c){return BPromise[_0x5adb('0x20')](_0x5e218c);}return _0x3ef465[_0x5adb('0x21')]();};}function saveUpdates(_0x438671,_0x1fd4a7){return function(_0x99bc6c){if(_0x99bc6c){return _0x99bc6c['update'](_0x438671)[_0x5adb('0x22')](function(_0x5c296e){return _0x5c296e;});}return null;};}function removeEntity(_0x4e9f16,_0x3754cc){return function(_0x379b33){if(_0x379b33){return _0x379b33[_0x5adb('0x23')]()[_0x5adb('0x22')](function(){_0x4e9f16[_0x5adb('0x19')](0xcc)[_0x5adb('0x1a')]();});}};}function handleEntityNotFound(_0xfd9bb9,_0x4ca150){return function(_0x4b1957){if(!_0x4b1957){_0xfd9bb9[_0x5adb('0x18')](0x194);}return _0x4b1957;};}function handleError(_0x3220cd,_0x3839fb){_0x3839fb=_0x3839fb||0x1f4;return function(_0xeb556c){logger['error'](_0xeb556c[_0x5adb('0x24')]);if(_0xeb556c[_0x5adb('0x25')]){delete _0xeb556c['name'];}_0x3220cd[_0x5adb('0x19')](_0x3839fb)[_0x5adb('0x26')](_0xeb556c);};}exports[_0x5adb('0x27')]=function(_0x55b40a,_0x13ad1d){var _0xbe21b1={},_0x3a4fca={},_0x2c64a3={'count':0x0,'rows':[]};var _0x36459b=_[_0x5adb('0x28')](db['FaxTransferReport']['rawAttributes'],function(_0x5d457e){return{'name':_0x5d457e[_0x5adb('0x29')],'type':_0x5d457e[_0x5adb('0x2a')][_0x5adb('0x2b')]};});_0x3a4fca[_0x5adb('0x2c')]=_[_0x5adb('0x28')](_0x36459b,'name');_0x3a4fca[_0x5adb('0x2d')]=_[_0x5adb('0x2e')](_0x55b40a[_0x5adb('0x2d')]);_0x3a4fca[_0x5adb('0x2f')]=_[_0x5adb('0x30')](_0x3a4fca[_0x5adb('0x2c')],_0x3a4fca[_0x5adb('0x2d')]);_0xbe21b1[_0x5adb('0x31')]=_[_0x5adb('0x30')](_0x3a4fca[_0x5adb('0x2c')],qs['fields'](_0x55b40a[_0x5adb('0x2d')]['fields']));_0xbe21b1[_0x5adb('0x31')]=_0xbe21b1[_0x5adb('0x31')]['length']?_0xbe21b1[_0x5adb('0x31')]:_0x3a4fca[_0x5adb('0x2c')];if(!_0x55b40a[_0x5adb('0x2d')]['hasOwnProperty'](_0x5adb('0x32'))){_0xbe21b1[_0x5adb('0x1d')]=qs['limit'](_0x55b40a['query'][_0x5adb('0x1d')]);_0xbe21b1['offset']=qs[_0x5adb('0x1c')](_0x55b40a[_0x5adb('0x2d')][_0x5adb('0x1c')]);}_0xbe21b1[_0x5adb('0x33')]=qs[_0x5adb('0x34')](_0x55b40a['query'][_0x5adb('0x34')]);_0xbe21b1[_0x5adb('0x35')]=qs[_0x5adb('0x2f')](_['pick'](_0x55b40a['query'],_0x3a4fca[_0x5adb('0x2f')]),_0x36459b);if(_0x55b40a[_0x5adb('0x2d')]['filter']){_0xbe21b1[_0x5adb('0x35')]=_['merge'](_0xbe21b1[_0x5adb('0x35')],{'$or':_['map'](_0x36459b,function(_0x11cb37){if(_0x11cb37['type']!==_0x5adb('0x36')){var _0x23a1db={};_0x23a1db[_0x11cb37['name']]={'$like':'%'+_0x55b40a[_0x5adb('0x2d')]['filter']+'%'};return _0x23a1db;}})});}_0xbe21b1=_[_0x5adb('0x37')]({},_0xbe21b1,_0x55b40a[_0x5adb('0x38')]);var _0xd5660c={'where':_0xbe21b1['where']};return db[_0x5adb('0x39')][_0x5adb('0x1b')](_0xd5660c)[_0x5adb('0x22')](function(_0x132803){_0x2c64a3[_0x5adb('0x1b')]=_0x132803;if(_0x55b40a['query']['includeAll']){_0xbe21b1['include']=[{'all':!![]}];}return db['FaxTransferReport'][_0x5adb('0x3a')](_0xbe21b1);})[_0x5adb('0x22')](function(_0x3a104a){_0x2c64a3[_0x5adb('0x3b')]=_0x3a104a;return _0x2c64a3;})[_0x5adb('0x22')](respondWithFilteredResult(_0x13ad1d,_0xbe21b1))[_0x5adb('0x3c')](handleError(_0x13ad1d,null));};exports[_0x5adb('0x3d')]=function(_0x3bf282,_0x478a70){var _0x53f2c6={'raw':!![],'where':{'id':_0x3bf282['params']['id']}},_0x27dbb7={};_0x27dbb7[_0x5adb('0x2c')]=_[_0x5adb('0x2e')](db[_0x5adb('0x39')][_0x5adb('0x3e')]);_0x27dbb7[_0x5adb('0x2d')]=_['keys'](_0x3bf282[_0x5adb('0x2d')]);_0x27dbb7[_0x5adb('0x2f')]=_['intersection'](_0x27dbb7[_0x5adb('0x2c')],_0x27dbb7[_0x5adb('0x2d')]);_0x53f2c6['attributes']=_[_0x5adb('0x30')](_0x27dbb7[_0x5adb('0x2c')],qs[_0x5adb('0x3f')](_0x3bf282[_0x5adb('0x2d')][_0x5adb('0x3f')]));_0x53f2c6[_0x5adb('0x31')]=_0x53f2c6[_0x5adb('0x31')]['length']?_0x53f2c6['attributes']:_0x27dbb7[_0x5adb('0x2c')];if(_0x3bf282[_0x5adb('0x2d')][_0x5adb('0x40')]){_0x53f2c6[_0x5adb('0x41')]=[{'all':!![]}];}_0x53f2c6=_['merge']({},_0x53f2c6,_0x3bf282['options']);return db[_0x5adb('0x39')][_0x5adb('0x42')](_0x53f2c6)[_0x5adb('0x22')](handleEntityNotFound(_0x478a70,null))[_0x5adb('0x22')](respondWithResult(_0x478a70,null))[_0x5adb('0x3c')](handleError(_0x478a70,null));};exports['create']=function(_0x182cbc,_0x437f52){return db['FaxTransferReport'][_0x5adb('0x43')](_0x182cbc[_0x5adb('0x44')],{})[_0x5adb('0x22')](respondWithResult(_0x437f52,0xc9))[_0x5adb('0x3c')](handleError(_0x437f52,null));};exports[_0x5adb('0x45')]=function(_0x3a5409,_0x39840e){if(_0x3a5409[_0x5adb('0x44')]['id']){delete _0x3a5409['body']['id'];}return db[_0x5adb('0x39')]['find']({'where':{'id':_0x3a5409['params']['id']}})['then'](handleEntityNotFound(_0x39840e,null))[_0x5adb('0x22')](saveUpdates(_0x3a5409[_0x5adb('0x44')],null))[_0x5adb('0x22')](respondWithResult(_0x39840e,null))['catch'](handleError(_0x39840e,null));};exports[_0x5adb('0x23')]=function(_0x5cbab5,_0x177a81){return db[_0x5adb('0x39')][_0x5adb('0x42')]({'where':{'id':_0x5cbab5['params']['id']}})[_0x5adb('0x22')](handleEntityNotFound(_0x177a81,null))['then'](removeEntity(_0x177a81,null))[_0x5adb('0x3c')](handleError(_0x177a81,null));};exports[_0x5adb('0x46')]=function(_0x55c535,_0x2402a3){return db[_0x5adb('0x39')][_0x5adb('0x46')]()[_0x5adb('0x22')](respondWithResult(_0x2402a3,null))[_0x5adb('0x3c')](handleError(_0x2402a3,null));};
\ No newline at end of file
+var _0x5f2f=['set','Content-Range','apply','reject','save','update','destroy','end','error','stack','name','send','index','map','fieldName','type','query','keys','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','FaxTransferReport','then','include','rows','catch','show','params','intersection','options','find','create','body','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../mysqldb','sendStatus','status','json','count','offset','limit'];(function(_0x2be8c2,_0x14a4b5){var _0x97f531=function(_0xcee58d){while(--_0xcee58d){_0x2be8c2['push'](_0x2be8c2['shift']());}};_0x97f531(++_0x14a4b5);}(_0x5f2f,0x73));var _0xf5f2=function(_0x128f3a,_0x929550){_0x128f3a=_0x128f3a-0x0;var _0x523696=_0x5f2f[_0x128f3a];return _0x523696;};'use strict';var pdf=require(_0xf5f2('0x0'));var emlformat=require(_0xf5f2('0x1'));var rimraf=require(_0xf5f2('0x2'));var zipdir=require(_0xf5f2('0x3'));var jsonpatch=require(_0xf5f2('0x4'));var rp=require(_0xf5f2('0x5'));var moment=require(_0xf5f2('0x6'));var BPromise=require(_0xf5f2('0x7'));var Mustache=require('mustache');var util=require('util');var path=require(_0xf5f2('0x8'));var sox=require(_0xf5f2('0x9'));var csv=require(_0xf5f2('0xa'));var ejs=require(_0xf5f2('0xb'));var fs=require('fs');var _=require(_0xf5f2('0xc'));var squel=require(_0xf5f2('0xd'));var crypto=require('crypto');var jsforce=require(_0xf5f2('0xe'));var deskjs=require(_0xf5f2('0xf'));var toCsv=require(_0xf5f2('0xa'));var querystring=require('querystring');var Papa=require(_0xf5f2('0x10'));var Redis=require(_0xf5f2('0x11'));var authService=require(_0xf5f2('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xf5f2('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xf5f2('0x14'));var utils=require(_0xf5f2('0x15'));var config=require('../../config/environment');var db=require(_0xf5f2('0x16'))['db'];function respondWithStatusCode(_0x14b51f,_0x331482){_0x331482=_0x331482||0xcc;return function(_0x3f2997){if(_0x3f2997){return _0x14b51f[_0xf5f2('0x17')](_0x331482);}return _0x14b51f[_0xf5f2('0x18')](_0x331482)['end']();};}function respondWithResult(_0x5850f4,_0xea612c){_0xea612c=_0xea612c||0xc8;return function(_0x269909){if(_0x269909){return _0x5850f4[_0xf5f2('0x18')](_0xea612c)[_0xf5f2('0x19')](_0x269909);}};}function respondWithFilteredResult(_0x4d97fc,_0xafe430){return function(_0x286197){if(_0x286197){var _0x17d656=_0x286197[_0xf5f2('0x1a')],_0x1b6dd2=_0xafe430[_0xf5f2('0x1b')],_0x23e23a=_0xafe430[_0xf5f2('0x1b')]+_0xafe430[_0xf5f2('0x1c')],_0x3a9dbb;if(_0x23e23a>=_0x17d656){_0x23e23a=_0x17d656;_0x3a9dbb=0xc8;}else{_0x3a9dbb=0xce;}_0x4d97fc[_0xf5f2('0x18')](_0x3a9dbb);return _0x4d97fc[_0xf5f2('0x1d')](_0xf5f2('0x1e'),_0x1b6dd2+'-'+_0x23e23a+'/'+_0x17d656)[_0xf5f2('0x19')](_0x286197);}return null;};}function patchUpdates(_0x3cf5ea){return function(_0x626999){try{jsonpatch[_0xf5f2('0x1f')](_0x626999,_0x3cf5ea,!![]);}catch(_0x56acc5){return BPromise[_0xf5f2('0x20')](_0x56acc5);}return _0x626999[_0xf5f2('0x21')]();};}function saveUpdates(_0x49dac2,_0x47acfc){return function(_0x2d2805){if(_0x2d2805){return _0x2d2805[_0xf5f2('0x22')](_0x49dac2)['then'](function(_0x45b74f){return _0x45b74f;});}return null;};}function removeEntity(_0x170042,_0x39e44a){return function(_0x39c024){if(_0x39c024){return _0x39c024[_0xf5f2('0x23')]()['then'](function(){_0x170042[_0xf5f2('0x18')](0xcc)[_0xf5f2('0x24')]();});}};}function handleEntityNotFound(_0x4e8bda,_0x2833fe){return function(_0x287ad5){if(!_0x287ad5){_0x4e8bda['sendStatus'](0x194);}return _0x287ad5;};}function handleError(_0x529f07,_0x5f1124){_0x5f1124=_0x5f1124||0x1f4;return function(_0x3f79d5){logger[_0xf5f2('0x25')](_0x3f79d5[_0xf5f2('0x26')]);if(_0x3f79d5[_0xf5f2('0x27')]){delete _0x3f79d5[_0xf5f2('0x27')];}_0x529f07[_0xf5f2('0x18')](_0x5f1124)[_0xf5f2('0x28')](_0x3f79d5);};}exports[_0xf5f2('0x29')]=function(_0x4ab014,_0xaa2602){var _0x102449={},_0x375ca8={},_0x31bfcb={'count':0x0,'rows':[]};var _0x198c73=_[_0xf5f2('0x2a')](db['FaxTransferReport']['rawAttributes'],function(_0x22c826){return{'name':_0x22c826[_0xf5f2('0x2b')],'type':_0x22c826[_0xf5f2('0x2c')]['key']};});_0x375ca8['model']=_[_0xf5f2('0x2a')](_0x198c73,_0xf5f2('0x27'));_0x375ca8[_0xf5f2('0x2d')]=_[_0xf5f2('0x2e')](_0x4ab014[_0xf5f2('0x2d')]);_0x375ca8['filters']=_['intersection'](_0x375ca8[_0xf5f2('0x2f')],_0x375ca8['query']);_0x102449[_0xf5f2('0x30')]=_['intersection'](_0x375ca8[_0xf5f2('0x2f')],qs[_0xf5f2('0x31')](_0x4ab014[_0xf5f2('0x2d')][_0xf5f2('0x31')]));_0x102449[_0xf5f2('0x30')]=_0x102449[_0xf5f2('0x30')][_0xf5f2('0x32')]?_0x102449[_0xf5f2('0x30')]:_0x375ca8['model'];if(!_0x4ab014[_0xf5f2('0x2d')][_0xf5f2('0x33')](_0xf5f2('0x34'))){_0x102449[_0xf5f2('0x1c')]=qs[_0xf5f2('0x1c')](_0x4ab014[_0xf5f2('0x2d')][_0xf5f2('0x1c')]);_0x102449['offset']=qs[_0xf5f2('0x1b')](_0x4ab014[_0xf5f2('0x2d')]['offset']);}_0x102449[_0xf5f2('0x35')]=qs['sort'](_0x4ab014[_0xf5f2('0x2d')][_0xf5f2('0x36')]);_0x102449[_0xf5f2('0x37')]=qs[_0xf5f2('0x38')](_['pick'](_0x4ab014['query'],_0x375ca8[_0xf5f2('0x38')]),_0x198c73);if(_0x4ab014[_0xf5f2('0x2d')][_0xf5f2('0x39')]){_0x102449['where']=_[_0xf5f2('0x3a')](_0x102449['where'],{'$or':_[_0xf5f2('0x2a')](_0x198c73,function(_0x566c47){if(_0x566c47[_0xf5f2('0x2c')]!==_0xf5f2('0x3b')){var _0x5337a6={};_0x5337a6[_0x566c47[_0xf5f2('0x27')]]={'$like':'%'+_0x4ab014[_0xf5f2('0x2d')][_0xf5f2('0x39')]+'%'};return _0x5337a6;}})});}_0x102449=_[_0xf5f2('0x3a')]({},_0x102449,_0x4ab014['options']);var _0x5d2d82={'where':_0x102449[_0xf5f2('0x37')]};return db[_0xf5f2('0x3c')][_0xf5f2('0x1a')](_0x5d2d82)[_0xf5f2('0x3d')](function(_0x2c7f65){_0x31bfcb[_0xf5f2('0x1a')]=_0x2c7f65;if(_0x4ab014[_0xf5f2('0x2d')]['includeAll']){_0x102449[_0xf5f2('0x3e')]=[{'all':!![]}];}return db[_0xf5f2('0x3c')]['findAll'](_0x102449);})[_0xf5f2('0x3d')](function(_0x3f3895){_0x31bfcb[_0xf5f2('0x3f')]=_0x3f3895;return _0x31bfcb;})[_0xf5f2('0x3d')](respondWithFilteredResult(_0xaa2602,_0x102449))[_0xf5f2('0x40')](handleError(_0xaa2602,null));};exports[_0xf5f2('0x41')]=function(_0x462ea3,_0x2083b3){var _0x574f24={'raw':!![],'where':{'id':_0x462ea3[_0xf5f2('0x42')]['id']}},_0x31c3c={};_0x31c3c[_0xf5f2('0x2f')]=_['keys'](db['FaxTransferReport']['rawAttributes']);_0x31c3c[_0xf5f2('0x2d')]=_[_0xf5f2('0x2e')](_0x462ea3['query']);_0x31c3c[_0xf5f2('0x38')]=_[_0xf5f2('0x43')](_0x31c3c[_0xf5f2('0x2f')],_0x31c3c[_0xf5f2('0x2d')]);_0x574f24[_0xf5f2('0x30')]=_[_0xf5f2('0x43')](_0x31c3c[_0xf5f2('0x2f')],qs[_0xf5f2('0x31')](_0x462ea3[_0xf5f2('0x2d')][_0xf5f2('0x31')]));_0x574f24[_0xf5f2('0x30')]=_0x574f24[_0xf5f2('0x30')][_0xf5f2('0x32')]?_0x574f24[_0xf5f2('0x30')]:_0x31c3c['model'];if(_0x462ea3[_0xf5f2('0x2d')]['includeAll']){_0x574f24[_0xf5f2('0x3e')]=[{'all':!![]}];}_0x574f24=_[_0xf5f2('0x3a')]({},_0x574f24,_0x462ea3[_0xf5f2('0x44')]);return db[_0xf5f2('0x3c')][_0xf5f2('0x45')](_0x574f24)[_0xf5f2('0x3d')](handleEntityNotFound(_0x2083b3,null))['then'](respondWithResult(_0x2083b3,null))[_0xf5f2('0x40')](handleError(_0x2083b3,null));};exports[_0xf5f2('0x46')]=function(_0x1c1497,_0x29b108){return db[_0xf5f2('0x3c')][_0xf5f2('0x46')](_0x1c1497[_0xf5f2('0x47')],{})[_0xf5f2('0x3d')](respondWithResult(_0x29b108,0xc9))['catch'](handleError(_0x29b108,null));};exports[_0xf5f2('0x22')]=function(_0x33ec29,_0x45db9a){if(_0x33ec29['body']['id']){delete _0x33ec29[_0xf5f2('0x47')]['id'];}return db[_0xf5f2('0x3c')][_0xf5f2('0x45')]({'where':{'id':_0x33ec29['params']['id']}})['then'](handleEntityNotFound(_0x45db9a,null))[_0xf5f2('0x3d')](saveUpdates(_0x33ec29[_0xf5f2('0x47')],null))['then'](respondWithResult(_0x45db9a,null))[_0xf5f2('0x40')](handleError(_0x45db9a,null));};exports['destroy']=function(_0x740321,_0x497eb8){return db[_0xf5f2('0x3c')]['find']({'where':{'id':_0x740321[_0xf5f2('0x42')]['id']}})[_0xf5f2('0x3d')](handleEntityNotFound(_0x497eb8,null))[_0xf5f2('0x3d')](removeEntity(_0x497eb8,null))[_0xf5f2('0x40')](handleError(_0x497eb8,null));};exports['describe']=function(_0x3154c1,_0x2b782f){return db['FaxTransferReport']['describe']()[_0xf5f2('0x3d')](respondWithResult(_0x2b782f,null))[_0xf5f2('0x40')](handleError(_0x2b782f,null));};
\ No newline at end of file
diff --git a/server/api/faxTransferReport/faxTransferReport.model.js b/server/api/faxTransferReport/faxTransferReport.model.js
index 44d442f..21b20fd 100644
--- a/server/api/faxTransferReport/faxTransferReport.model.js
+++ b/server/api/faxTransferReport/faxTransferReport.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9265=['bluebird','request-promise','path','rimraf','../../config/environment','./faxTransferReport.attributes','define','report_fax_transfer','uniqueid','lodash','api','moment'];(function(_0x2c2ed3,_0x18a906){var _0x2dc643=function(_0x49d831){while(--_0x49d831){_0x2c2ed3['push'](_0x2c2ed3['shift']());}};_0x2dc643(++_0x18a906);}(_0x9265,0x1dd));var _0x5926=function(_0x2e21ba,_0x129588){_0x2e21ba=_0x2e21ba-0x0;var _0xa7374a=_0x9265[_0x2e21ba];return _0xa7374a;};'use strict';var _=require(_0x5926('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x5926('0x1'));var moment=require(_0x5926('0x2'));var BPromise=require(_0x5926('0x3'));var rp=require(_0x5926('0x4'));var fs=require('fs');var path=require(_0x5926('0x5'));var rimraf=require(_0x5926('0x6'));var config=require(_0x5926('0x7'));var attributes=require(_0x5926('0x8'));module['exports']=function(_0x16ceff,_0xb2dc0e){return _0x16ceff[_0x5926('0x9')]('FaxTransferReport',attributes,{'tableName':_0x5926('0xa'),'paranoid':![],'indexes':[{'name':_0x5926('0xb'),'fields':[_0x5926('0xb')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x2242=['FaxTransferReport','report_fax_transfer','uniqueid','lodash','util','../../config/logger','moment','bluebird','path','rimraf','./faxTransferReport.attributes','exports','define'];(function(_0x2dacca,_0x3b55a5){var _0x4e8745=function(_0x4c4515){while(--_0x4c4515){_0x2dacca['push'](_0x2dacca['shift']());}};_0x4e8745(++_0x3b55a5);}(_0x2242,0x1a3));var _0x2224=function(_0x3ce7e5,_0x33960a){_0x3ce7e5=_0x3ce7e5-0x0;var _0x2425cc=_0x2242[_0x3ce7e5];return _0x2425cc;};'use strict';var _=require(_0x2224('0x0'));var util=require(_0x2224('0x1'));var logger=require(_0x2224('0x2'))('api');var moment=require(_0x2224('0x3'));var BPromise=require(_0x2224('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x2224('0x5'));var rimraf=require(_0x2224('0x6'));var config=require('../../config/environment');var attributes=require(_0x2224('0x7'));module[_0x2224('0x8')]=function(_0x23a873,_0x54d057){return _0x23a873[_0x2224('0x9')](_0x2224('0xa'),attributes,{'tableName':_0x2224('0xb'),'paranoid':![],'indexes':[{'name':_0x2224('0xc'),'fields':[_0x2224('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/faxTransferReport/faxTransferReport.rpc.js b/server/api/faxTransferReport/faxTransferReport.rpc.js
index ccdca6d..19a13d1 100644
--- a/server/api/faxTransferReport/faxTransferReport.rpc.js
+++ b/server/api/faxTransferReport/faxTransferReport.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xbc95=['message','result','lodash','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','FaxTransferReport,\x20%s,\x20%s','request\x20sent','stringify','error','code'];(function(_0x4d3e97,_0x749913){var _0x3147d7=function(_0x250599){while(--_0x250599){_0x4d3e97['push'](_0x4d3e97['shift']());}};_0x3147d7(++_0x749913);}(_0xbc95,0xb6));var _0x5bc9=function(_0x360739,_0x2ec1b2){_0x360739=_0x360739-0x0;var _0x3e23a1=_0xbc95[_0x360739];return _0x3e23a1;};'use strict';var _=require(_0x5bc9('0x0'));var util=require('util');var moment=require(_0x5bc9('0x1'));var BPromise=require('bluebird');var rs=require(_0x5bc9('0x2'));var fs=require('fs');var Redis=require(_0x5bc9('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x5bc9('0x4'));var logger=require(_0x5bc9('0x5'))(_0x5bc9('0x6'));var config=require('../../config/environment');var jayson=require(_0x5bc9('0x7'));var client=jayson[_0x5bc9('0x8')][_0x5bc9('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2df270,_0x1392a7,_0x166015){return new BPromise(function(_0x50082c,_0x5afafc){return client[_0x5bc9('0xa')](_0x2df270,_0x166015)[_0x5bc9('0xb')](function(_0x3d2274){logger[_0x5bc9('0xc')](_0x5bc9('0xd'),_0x1392a7,_0x5bc9('0xe'));logger['debug']('FaxTransferReport,\x20%s,\x20%s,\x20%s',_0x1392a7,_0x5bc9('0xe'),JSON[_0x5bc9('0xf')](_0x3d2274));if(_0x3d2274[_0x5bc9('0x10')]){if(_0x3d2274[_0x5bc9('0x10')][_0x5bc9('0x11')]===0x1f4){logger[_0x5bc9('0x10')](_0x5bc9('0xd'),_0x1392a7,_0x3d2274['error'][_0x5bc9('0x12')]);return _0x5afafc(_0x3d2274[_0x5bc9('0x10')][_0x5bc9('0x12')]);}logger[_0x5bc9('0x10')](_0x5bc9('0xd'),_0x1392a7,_0x3d2274[_0x5bc9('0x10')][_0x5bc9('0x12')]);return _0x50082c(_0x3d2274[_0x5bc9('0x10')][_0x5bc9('0x12')]);}else{logger['info'](_0x5bc9('0xd'),_0x1392a7,_0x5bc9('0xe'));_0x50082c(_0x3d2274[_0x5bc9('0x13')]['message']);}})['catch'](function(_0xec50d4){logger[_0x5bc9('0x10')]('FaxTransferReport,\x20%s,\x20%s',_0x1392a7,_0xec50d4);_0x5afafc(_0xec50d4);});});}
\ No newline at end of file
+var _0x00fd=['request\x20sent','debug','FaxTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','FaxTransferReport,\x20%s,\x20%s'];(function(_0x134c2e,_0x3573c4){var _0x2825db=function(_0x2a574d){while(--_0x2a574d){_0x134c2e['push'](_0x134c2e['shift']());}};_0x2825db(++_0x3573c4);}(_0x00fd,0x68));var _0xd00f=function(_0xd45f89,_0x49ec14){_0xd45f89=_0xd45f89-0x0;var _0x1b99b3=_0x00fd[_0xd45f89];return _0x1b99b3;};'use strict';var _=require(_0xd00f('0x0'));var util=require(_0xd00f('0x1'));var moment=require(_0xd00f('0x2'));var BPromise=require(_0xd00f('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd00f('0x4'));var db=require(_0xd00f('0x5'))['db'];var utils=require(_0xd00f('0x6'));var logger=require(_0xd00f('0x7'))(_0xd00f('0x8'));var config=require(_0xd00f('0x9'));var jayson=require(_0xd00f('0xa'));var client=jayson[_0xd00f('0xb')][_0xd00f('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x5c6855,_0x598b14,_0x257282){return new BPromise(function(_0xd60221,_0x33e124){return client['request'](_0x5c6855,_0x257282)[_0xd00f('0xd')](function(_0xeb7d20){logger[_0xd00f('0xe')](_0xd00f('0xf'),_0x598b14,_0xd00f('0x10'));logger[_0xd00f('0x11')](_0xd00f('0x12'),_0x598b14,'request\x20sent',JSON[_0xd00f('0x13')](_0xeb7d20));if(_0xeb7d20[_0xd00f('0x14')]){if(_0xeb7d20[_0xd00f('0x14')][_0xd00f('0x15')]===0x1f4){logger[_0xd00f('0x14')]('FaxTransferReport,\x20%s,\x20%s',_0x598b14,_0xeb7d20[_0xd00f('0x14')][_0xd00f('0x16')]);return _0x33e124(_0xeb7d20[_0xd00f('0x14')][_0xd00f('0x16')]);}logger['error']('FaxTransferReport,\x20%s,\x20%s',_0x598b14,_0xeb7d20[_0xd00f('0x14')][_0xd00f('0x16')]);return _0xd60221(_0xeb7d20[_0xd00f('0x14')][_0xd00f('0x16')]);}else{logger[_0xd00f('0xe')](_0xd00f('0xf'),_0x598b14,_0xd00f('0x10'));_0xd60221(_0xeb7d20['result'][_0xd00f('0x16')]);}})[_0xd00f('0x17')](function(_0x1767ab){logger[_0xd00f('0x14')](_0xd00f('0xf'),_0x598b14,_0x1767ab);_0x33e124(_0x1767ab);});});}
\ No newline at end of file
diff --git a/server/api/faxTransferReport/index.js b/server/api/faxTransferReport/index.js
index fde9354..bdef35e 100644
--- a/server/api/faxTransferReport/index.js
+++ b/server/api/faxTransferReport/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xeb59=['/describe','describe','/:id','show','create','put','update','delete','destroy','exports','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxTransferReport.controller','isAuthenticated','index','get'];(function(_0x149363,_0x3dc0c9){var _0x2fe3e4=function(_0x2b0cde){while(--_0x2b0cde){_0x149363['push'](_0x149363['shift']());}};_0x2fe3e4(++_0x3dc0c9);}(_0xeb59,0x73));var _0x9eb5=function(_0x29f80e,_0x9027ff){_0x29f80e=_0x29f80e-0x0;var _0x5c7eaa=_0xeb59[_0x29f80e];return _0x5c7eaa;};'use strict';var multer=require('multer');var util=require(_0x9eb5('0x0'));var path=require(_0x9eb5('0x1'));var timeout=require(_0x9eb5('0x2'));var express=require(_0x9eb5('0x3'));var router=express['Router']();var auth=require(_0x9eb5('0x4'));var interaction=require(_0x9eb5('0x5'));var config=require(_0x9eb5('0x6'));var controller=require(_0x9eb5('0x7'));router['get']('/',auth[_0x9eb5('0x8')](),controller[_0x9eb5('0x9')]);router[_0x9eb5('0xa')](_0x9eb5('0xb'),auth['isAuthenticated'](),controller[_0x9eb5('0xc')]);router[_0x9eb5('0xa')](_0x9eb5('0xd'),auth[_0x9eb5('0x8')](),controller[_0x9eb5('0xe')]);router['post']('/',auth[_0x9eb5('0x8')](),controller[_0x9eb5('0xf')]);router[_0x9eb5('0x10')](_0x9eb5('0xd'),auth[_0x9eb5('0x8')](),controller[_0x9eb5('0x11')]);router[_0x9eb5('0x12')](_0x9eb5('0xd'),auth[_0x9eb5('0x8')](),controller[_0x9eb5('0x13')]);module[_0x9eb5('0x14')]=router;
\ No newline at end of file
+var _0x0743=['update','delete','destroy','exports','multer','util','path','connect-timeout','../../components/interaction/service','./faxTransferReport.controller','get','index','describe','/:id','isAuthenticated','show','post','create','put'];(function(_0x4b951a,_0x22d91c){var _0x1556c8=function(_0x5d8e79){while(--_0x5d8e79){_0x4b951a['push'](_0x4b951a['shift']());}};_0x1556c8(++_0x22d91c);}(_0x0743,0x1a6));var _0x3074=function(_0xf0c749,_0x3ec299){_0xf0c749=_0xf0c749-0x0;var _0x49d64c=_0x0743[_0xf0c749];return _0x49d64c;};'use strict';var multer=require(_0x3074('0x0'));var util=require(_0x3074('0x1'));var path=require(_0x3074('0x2'));var timeout=require(_0x3074('0x3'));var express=require('express');var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x3074('0x4'));var config=require('../../config/environment');var controller=require(_0x3074('0x5'));router[_0x3074('0x6')]('/',auth['isAuthenticated'](),controller[_0x3074('0x7')]);router[_0x3074('0x6')]('/describe',auth['isAuthenticated'](),controller[_0x3074('0x8')]);router[_0x3074('0x6')](_0x3074('0x9'),auth[_0x3074('0xa')](),controller[_0x3074('0xb')]);router[_0x3074('0xc')]('/',auth[_0x3074('0xa')](),controller[_0x3074('0xd')]);router[_0x3074('0xe')](_0x3074('0x9'),auth[_0x3074('0xa')](),controller[_0x3074('0xf')]);router[_0x3074('0x10')](_0x3074('0x9'),auth[_0x3074('0xa')](),controller[_0x3074('0x11')]);module[_0x3074('0x12')]=router;
\ No newline at end of file
diff --git a/server/api/intDeskAccount/index.js b/server/api/intDeskAccount/index.js
index 13539a4..563d4d7 100644
--- a/server/api/intDeskAccount/index.js
+++ b/server/api/intDeskAccount/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x1dcc=['post','create','/:id/configurations','addConfiguration','update','destroy','exports','multer','util','path','connect-timeout','Router','../../components/interaction/service','../../config/environment','./intDeskAccount.controller','index','get','/:id','show','isAuthenticated','getFields'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x1dcc,0x1ea));var _0xc1dc=function(_0x6d884a,_0xb208ef){_0x6d884a=_0x6d884a-0x0;var _0x35a83a=_0x1dcc[_0x6d884a];return _0x35a83a;};'use strict';var multer=require(_0xc1dc('0x0'));var util=require(_0xc1dc('0x1'));var path=require(_0xc1dc('0x2'));var timeout=require(_0xc1dc('0x3'));var express=require('express');var router=express[_0xc1dc('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0xc1dc('0x5'));var config=require(_0xc1dc('0x6'));var controller=require(_0xc1dc('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0xc1dc('0x8')]);router[_0xc1dc('0x9')](_0xc1dc('0xa'),auth['isAuthenticated'](),controller[_0xc1dc('0xb')]);router[_0xc1dc('0x9')]('/:id/configurations',auth[_0xc1dc('0xc')](),controller['getConfigurations']);router[_0xc1dc('0x9')]('/:id/fields',auth[_0xc1dc('0xc')](),controller[_0xc1dc('0xd')]);router[_0xc1dc('0xe')]('/',auth[_0xc1dc('0xc')](),controller[_0xc1dc('0xf')]);router[_0xc1dc('0xe')](_0xc1dc('0x10'),auth[_0xc1dc('0xc')](),controller[_0xc1dc('0x11')]);router['put'](_0xc1dc('0xa'),auth[_0xc1dc('0xc')](),controller[_0xc1dc('0x12')]);router['delete'](_0xc1dc('0xa'),auth[_0xc1dc('0xc')](),controller[_0xc1dc('0x13')]);module[_0xc1dc('0x14')]=router;
\ No newline at end of file
+var _0x7118=['get','isAuthenticated','/:id','show','/:id/configurations','getConfigurations','/:id/fields','create','post','addConfiguration','put','update','delete','destroy','exports','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDeskAccount.controller'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x7118,0x159));var _0x8711=function(_0x47db57,_0x502179){_0x47db57=_0x47db57-0x0;var _0x59aa44=_0x7118[_0x47db57];return _0x59aa44;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x8711('0x0'));var timeout=require(_0x8711('0x1'));var express=require('express');var router=express[_0x8711('0x2')]();var auth=require(_0x8711('0x3'));var interaction=require(_0x8711('0x4'));var config=require(_0x8711('0x5'));var controller=require(_0x8711('0x6'));router[_0x8711('0x7')]('/',auth[_0x8711('0x8')](),controller['index']);router[_0x8711('0x7')](_0x8711('0x9'),auth[_0x8711('0x8')](),controller[_0x8711('0xa')]);router[_0x8711('0x7')](_0x8711('0xb'),auth[_0x8711('0x8')](),controller[_0x8711('0xc')]);router[_0x8711('0x7')](_0x8711('0xd'),auth[_0x8711('0x8')](),controller['getFields']);router['post']('/',auth[_0x8711('0x8')](),controller[_0x8711('0xe')]);router[_0x8711('0xf')]('/:id/configurations',auth['isAuthenticated'](),controller[_0x8711('0x10')]);router[_0x8711('0x11')]('/:id',auth['isAuthenticated'](),controller[_0x8711('0x12')]);router[_0x8711('0x13')](_0x8711('0x9'),auth[_0x8711('0x8')](),controller[_0x8711('0x14')]);module[_0x8711('0x15')]=router;
\ No newline at end of file
diff --git a/server/api/intDeskAccount/intDeskAccount.attributes.js b/server/api/intDeskAccount/intDeskAccount.attributes.js
index f3a173c..e62b406 100644
--- a/server/api/intDeskAccount/intDeskAccount.attributes.js
+++ b/server/api/intDeskAccount/intDeskAccount.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xde3c=['sequelize','STRING','basic','integrationTab','newTab'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0xde3c,0x78));var _0xcde3=function(_0x423fa4,_0x3b0c6f){_0x423fa4=_0x423fa4-0x0;var _0x112b85=_0xde3c[_0x423fa4];return _0x112b85;};'use strict';var Sequelize=require(_0xcde3('0x0'));module['exports']={'name':{'type':Sequelize[_0xcde3('0x1')]},'description':{'type':Sequelize[_0xcde3('0x1')]},'username':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0xcde3('0x1')]},'authType':{'type':Sequelize['ENUM'](_0xcde3('0x2')),'defaultValue':_0xcde3('0x2')},'password':{'type':Sequelize['STRING']},'consumerKey':{'type':Sequelize[_0xcde3('0x1')]},'consumerSecret':{'type':Sequelize[_0xcde3('0x1')]},'token':{'type':Sequelize['STRING']},'tokenSecret':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize[_0xcde3('0x1')]},'type':{'type':Sequelize['ENUM'](_0xcde3('0x3'),_0xcde3('0x4')),'defaultValue':_0xcde3('0x3')}};
\ No newline at end of file
+var _0xa07f=['integrationTab','sequelize','exports','STRING','basic','ENUM'];(function(_0x2d94db,_0x200b78){var _0x2a4663=function(_0x411120){while(--_0x411120){_0x2d94db['push'](_0x2d94db['shift']());}};_0x2a4663(++_0x200b78);}(_0xa07f,0xeb));var _0xfa07=function(_0xcc3729,_0x785082){_0xcc3729=_0xcc3729-0x0;var _0x16b4aa=_0xa07f[_0xcc3729];return _0x16b4aa;};'use strict';var Sequelize=require(_0xfa07('0x0'));module[_0xfa07('0x1')]={'name':{'type':Sequelize[_0xfa07('0x2')]},'description':{'type':Sequelize[_0xfa07('0x2')]},'username':{'type':Sequelize[_0xfa07('0x2')]},'remoteUri':{'type':Sequelize[_0xfa07('0x2')]},'authType':{'type':Sequelize['ENUM'](_0xfa07('0x3')),'defaultValue':'basic'},'password':{'type':Sequelize[_0xfa07('0x2')]},'consumerKey':{'type':Sequelize[_0xfa07('0x2')]},'consumerSecret':{'type':Sequelize[_0xfa07('0x2')]},'token':{'type':Sequelize[_0xfa07('0x2')]},'tokenSecret':{'type':Sequelize[_0xfa07('0x2')]},'serverUrl':{'type':Sequelize[_0xfa07('0x2')]},'type':{'type':Sequelize[_0xfa07('0x4')](_0xfa07('0x5'),'newTab'),'defaultValue':_0xfa07('0x5')}};
\ No newline at end of file
diff --git a/server/api/intDeskAccount/intDeskAccount.controller.js b/server/api/intDeskAccount/intDeskAccount.controller.js
index 9ec2b3d..37bd2f1 100644
--- a/server/api/intDeskAccount/intDeskAccount.controller.js
+++ b/server/api/intDeskAccount/intDeskAccount.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xa445=['http','test','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','info','request\x20sent','debug','DeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','DeskAccount,\x20%s,\x20%s','message','catch','sendStatus','status','end','json','count','offset','limit','set','Content-Range','save','update','destroy','then','name','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','order','sort','where','pick','filter','merge','options','DeskAccount','include','rows','show','includeAll','find','create','body','params','getConfigurations','findOne','hasOwnProperty','nolimit','addConfiguration','AccountId','Subjects','getSubjects','channel','DeskConfiguration','Descriptions','getFields','priority','remoteUri','authType','username','consumerKey','consumerSecret','tokenSecret','slice','substring','GET','format','%s/custom_fields','application/json','basic','Authorization','Basic\x20%s','%s:%s','toString','concat','_embedded','entries','active','label','statusCode','getFields,\x20%s,\x20%s,\x20%s','send','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','../../components/integrations/configuration','jayson/promise'];(function(_0x52ddbd,_0x9d2a0){var _0x50ca1d=function(_0x2c4511){while(--_0x2c4511){_0x52ddbd['push'](_0x52ddbd['shift']());}};_0x50ca1d(++_0x9d2a0);}(_0xa445,0x1d3));var _0x5a44=function(_0x39a9b8,_0x1c2b02){_0x39a9b8=_0x39a9b8-0x0;var _0x1fe68a=_0xa445[_0x39a9b8];return _0x1fe68a;};'use strict';var pdf=require(_0x5a44('0x0'));var emlformat=require(_0x5a44('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x5a44('0x2'));var jsonpatch=require(_0x5a44('0x3'));var rp=require(_0x5a44('0x4'));var moment=require(_0x5a44('0x5'));var BPromise=require(_0x5a44('0x6'));var Mustache=require(_0x5a44('0x7'));var util=require('util');var path=require(_0x5a44('0x8'));var sox=require(_0x5a44('0x9'));var csv=require(_0x5a44('0xa'));var ejs=require(_0x5a44('0xb'));var fs=require('fs');var _=require(_0x5a44('0xc'));var squel=require('squel');var crypto=require(_0x5a44('0xd'));var jsforce=require(_0x5a44('0xe'));var deskjs=require(_0x5a44('0xf'));var toCsv=require('to-csv');var querystring=require(_0x5a44('0x10'));var Papa=require(_0x5a44('0x11'));var Redis=require(_0x5a44('0x12'));var authService=require(_0x5a44('0x13'));var qs=require(_0x5a44('0x14'));var as=require(_0x5a44('0x15'));var hardwareService=require(_0x5a44('0x16'));var logger=require(_0x5a44('0x17'))(_0x5a44('0x18'));var utils=require(_0x5a44('0x19'));var config=require('../../config/environment');var db=require(_0x5a44('0x1a'))['db'];var integrations=require(_0x5a44('0x1b'));var jayson=require(_0x5a44('0x1c'));var client=jayson['client'][_0x5a44('0x1d')]({'port':0x232a});function checkPasswordPattern(_0x592f84,_0x5cf872,_0x3f25c9){if(_0x3f25c9){var _0x3cd6b2=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x3cd6b2[_0x5a44('0x1e')](_0x5cf872)){return _0x592f84;}else{throw new db['Sequelize'][(_0x5a44('0x1f'))](_0x5a44('0x20'));}}else{return _0x592f84;}}function respondWithRpcPromise(_0x2386f0,_0xbd00e5,_0x45cad7,_0x375f91){return new BPromise(function(_0x8083cc,_0x4d1fdc){var _0x40ee1c=_0x375f91||client;return _0x40ee1c['request'](_0x2386f0,_0x45cad7)['then'](function(_0x54e2fc){logger[_0x5a44('0x21')]('DeskAccount,\x20%s,\x20%s',_0xbd00e5,_0x5a44('0x22'));logger[_0x5a44('0x23')](_0x5a44('0x24'),_0xbd00e5,'request\x20sent',JSON[_0x5a44('0x25')](_0x54e2fc));if(_0x54e2fc[_0x5a44('0x26')]){if(_0x54e2fc[_0x5a44('0x26')][_0x5a44('0x27')]===0x1f4){logger['error'](_0x5a44('0x28'),_0xbd00e5,_0x54e2fc['error'][_0x5a44('0x29')]);return _0x4d1fdc(_0x54e2fc[_0x5a44('0x26')][_0x5a44('0x29')]);}logger[_0x5a44('0x26')](_0x5a44('0x28'),_0xbd00e5,_0x54e2fc['error'][_0x5a44('0x29')]);return _0x8083cc(_0x54e2fc[_0x5a44('0x26')][_0x5a44('0x29')]);}else{logger[_0x5a44('0x21')](_0x5a44('0x28'),_0xbd00e5,_0x5a44('0x22'));_0x8083cc(_0x54e2fc['result']['message']);}})[_0x5a44('0x2a')](function(_0x58fc47){logger[_0x5a44('0x26')](_0x5a44('0x28'),_0xbd00e5,_0x58fc47);_0x4d1fdc(_0x58fc47);});});}function respondWithStatusCode(_0x577489,_0x307af3){_0x307af3=_0x307af3||0xcc;return function(_0xe6215e){if(_0xe6215e){return _0x577489[_0x5a44('0x2b')](_0x307af3);}return _0x577489[_0x5a44('0x2c')](_0x307af3)[_0x5a44('0x2d')]();};}function respondWithResult(_0x2c1b1d,_0x245e0e){_0x245e0e=_0x245e0e||0xc8;return function(_0x3cabfb){if(_0x3cabfb){return _0x2c1b1d[_0x5a44('0x2c')](_0x245e0e)[_0x5a44('0x2e')](_0x3cabfb);}};}function respondWithFilteredResult(_0x41abb2,_0x62e7f6){return function(_0x39ff54){if(_0x39ff54){var _0x4aa9bf=_0x39ff54[_0x5a44('0x2f')],_0x5a4211=_0x62e7f6[_0x5a44('0x30')],_0x6dd21a=_0x62e7f6[_0x5a44('0x30')]+_0x62e7f6[_0x5a44('0x31')],_0x11e446;if(_0x6dd21a>=_0x4aa9bf){_0x6dd21a=_0x4aa9bf;_0x11e446=0xc8;}else{_0x11e446=0xce;}_0x41abb2[_0x5a44('0x2c')](_0x11e446);return _0x41abb2[_0x5a44('0x32')](_0x5a44('0x33'),_0x5a4211+'-'+_0x6dd21a+'/'+_0x4aa9bf)['json'](_0x39ff54);}return null;};}function patchUpdates(_0xe49a7d){return function(_0x131f17){try{jsonpatch['apply'](_0x131f17,_0xe49a7d,!![]);}catch(_0x459f4e){return BPromise['reject'](_0x459f4e);}return _0x131f17[_0x5a44('0x34')]();};}function saveUpdates(_0x1a9cb7,_0x5c97dc){return function(_0x4bdb1f){if(_0x4bdb1f){return _0x4bdb1f[_0x5a44('0x35')](_0x1a9cb7)['then'](function(_0x36b101){return _0x36b101;});}return null;};}function removeEntity(_0x210a47,_0x26eaa8){return function(_0x540d26){if(_0x540d26){return _0x540d26[_0x5a44('0x36')]()[_0x5a44('0x37')](function(){_0x210a47[_0x5a44('0x2c')](0xcc)[_0x5a44('0x2d')]();});}};}function handleEntityNotFound(_0x582163,_0x14cdec){return function(_0x7b8007){if(!_0x7b8007){_0x582163['sendStatus'](0x194);}return _0x7b8007;};}function handleError(_0x4f9586,_0x1be2c5){_0x1be2c5=_0x1be2c5||0x1f4;return function(_0x242da3){logger[_0x5a44('0x26')](_0x242da3['stack']);if(_0x242da3[_0x5a44('0x38')]){delete _0x242da3[_0x5a44('0x38')];}_0x4f9586[_0x5a44('0x2c')](_0x1be2c5)['send'](_0x242da3);};}exports['index']=function(_0x3657de,_0x38fa1f){var _0x29fb70={},_0x5c1cba={},_0x297202={'count':0x0,'rows':[]};var _0x44c0a6=_[_0x5a44('0x39')](db['DeskAccount'][_0x5a44('0x3a')],function(_0x1ccc75){return{'name':_0x1ccc75[_0x5a44('0x3b')],'type':_0x1ccc75[_0x5a44('0x3c')][_0x5a44('0x3d')]};});_0x5c1cba[_0x5a44('0x3e')]=_[_0x5a44('0x39')](_0x44c0a6,_0x5a44('0x38'));_0x5c1cba[_0x5a44('0x3f')]=_[_0x5a44('0x40')](_0x3657de[_0x5a44('0x3f')]);_0x5c1cba[_0x5a44('0x41')]=_[_0x5a44('0x42')](_0x5c1cba['model'],_0x5c1cba[_0x5a44('0x3f')]);_0x29fb70['attributes']=_['intersection'](_0x5c1cba[_0x5a44('0x3e')],qs['fields'](_0x3657de[_0x5a44('0x3f')][_0x5a44('0x43')]));_0x29fb70[_0x5a44('0x44')]=_0x29fb70[_0x5a44('0x44')][_0x5a44('0x45')]?_0x29fb70['attributes']:_0x5c1cba[_0x5a44('0x3e')];if(!_0x3657de[_0x5a44('0x3f')]['hasOwnProperty']('nolimit')){_0x29fb70[_0x5a44('0x31')]=qs[_0x5a44('0x31')](_0x3657de[_0x5a44('0x3f')][_0x5a44('0x31')]);_0x29fb70[_0x5a44('0x30')]=qs[_0x5a44('0x30')](_0x3657de[_0x5a44('0x3f')][_0x5a44('0x30')]);}_0x29fb70[_0x5a44('0x46')]=qs[_0x5a44('0x47')](_0x3657de['query'][_0x5a44('0x47')]);_0x29fb70[_0x5a44('0x48')]=qs[_0x5a44('0x41')](_[_0x5a44('0x49')](_0x3657de[_0x5a44('0x3f')],_0x5c1cba[_0x5a44('0x41')]),_0x44c0a6);if(_0x3657de[_0x5a44('0x3f')][_0x5a44('0x4a')]){_0x29fb70[_0x5a44('0x48')]=_[_0x5a44('0x4b')](_0x29fb70[_0x5a44('0x48')],{'$or':_['map'](_0x44c0a6,function(_0x26fadd){if(_0x26fadd[_0x5a44('0x3c')]!=='VIRTUAL'){var _0x4e7c18={};_0x4e7c18[_0x26fadd[_0x5a44('0x38')]]={'$like':'%'+_0x3657de[_0x5a44('0x3f')][_0x5a44('0x4a')]+'%'};return _0x4e7c18;}})});}_0x29fb70=_['merge']({},_0x29fb70,_0x3657de[_0x5a44('0x4c')]);var _0x4ef186={'where':_0x29fb70[_0x5a44('0x48')]};return db[_0x5a44('0x4d')][_0x5a44('0x2f')](_0x4ef186)[_0x5a44('0x37')](function(_0x255d38){_0x297202[_0x5a44('0x2f')]=_0x255d38;if(_0x3657de[_0x5a44('0x3f')]['includeAll']){_0x29fb70[_0x5a44('0x4e')]=[{'all':!![]}];}return db[_0x5a44('0x4d')]['findAll'](_0x29fb70);})[_0x5a44('0x37')](function(_0xc35920){_0x297202[_0x5a44('0x4f')]=_0xc35920;return _0x297202;})[_0x5a44('0x37')](respondWithFilteredResult(_0x38fa1f,_0x29fb70))['catch'](handleError(_0x38fa1f,null));};exports[_0x5a44('0x50')]=function(_0xf00ca1,_0x39d218){var _0x22b5b6={'raw':![],'where':{'id':_0xf00ca1['params']['id']}},_0x77f345={};_0x77f345['model']=_[_0x5a44('0x40')](db[_0x5a44('0x4d')][_0x5a44('0x3a')]);_0x77f345['query']=_[_0x5a44('0x40')](_0xf00ca1[_0x5a44('0x3f')]);_0x77f345['filters']=_[_0x5a44('0x42')](_0x77f345[_0x5a44('0x3e')],_0x77f345['query']);_0x22b5b6['attributes']=_[_0x5a44('0x42')](_0x77f345['model'],qs[_0x5a44('0x43')](_0xf00ca1['query'][_0x5a44('0x43')]));_0x22b5b6[_0x5a44('0x44')]=_0x22b5b6[_0x5a44('0x44')]['length']?_0x22b5b6[_0x5a44('0x44')]:_0x77f345['model'];if(_0xf00ca1[_0x5a44('0x3f')][_0x5a44('0x51')]){_0x22b5b6[_0x5a44('0x4e')]=[{'all':!![]}];}_0x22b5b6=_['merge']({},_0x22b5b6,_0xf00ca1[_0x5a44('0x4c')]);return db['DeskAccount'][_0x5a44('0x52')](_0x22b5b6)[_0x5a44('0x37')](handleEntityNotFound(_0x39d218,null))[_0x5a44('0x37')](respondWithResult(_0x39d218,null))['catch'](handleError(_0x39d218,null));};exports[_0x5a44('0x53')]=function(_0x7ee291,_0x387c72){return db[_0x5a44('0x4d')][_0x5a44('0x53')](_0x7ee291[_0x5a44('0x54')],{})[_0x5a44('0x37')](respondWithResult(_0x387c72,0xc9))['catch'](handleError(_0x387c72,null));};exports['update']=function(_0x260c01,_0x25398a){if(_0x260c01[_0x5a44('0x54')]['id']){delete _0x260c01['body']['id'];}return db['DeskAccount']['find']({'where':{'id':_0x260c01[_0x5a44('0x55')]['id']}})[_0x5a44('0x37')](handleEntityNotFound(_0x25398a,null))[_0x5a44('0x37')](saveUpdates(_0x260c01['body'],null))['then'](respondWithResult(_0x25398a,null))['catch'](handleError(_0x25398a,null));};exports[_0x5a44('0x36')]=function(_0x282300,_0x15cec4){return db['DeskAccount'][_0x5a44('0x52')]({'where':{'id':_0x282300[_0x5a44('0x55')]['id']}})[_0x5a44('0x37')](handleEntityNotFound(_0x15cec4,null))[_0x5a44('0x37')](removeEntity(_0x15cec4,null))[_0x5a44('0x2a')](handleError(_0x15cec4,null));};exports[_0x5a44('0x56')]=function(_0x54a706,_0x2c533b,_0x40b0b0){var _0x424989={};var _0x31bc5b={};var _0x4c5b64;var _0x475e07;return db[_0x5a44('0x4d')][_0x5a44('0x57')]({'where':{'id':_0x54a706[_0x5a44('0x55')]['id']}})[_0x5a44('0x37')](handleEntityNotFound(_0x2c533b,null))[_0x5a44('0x37')](function(_0x22daac){if(_0x22daac){_0x4c5b64=_0x22daac;_0x31bc5b[_0x5a44('0x3e')]=_[_0x5a44('0x40')](db['DeskConfiguration'][_0x5a44('0x3a')]);_0x31bc5b[_0x5a44('0x3f')]=_[_0x5a44('0x40')](_0x54a706['query']);_0x31bc5b[_0x5a44('0x41')]=_['intersection'](_0x31bc5b[_0x5a44('0x3e')],_0x31bc5b[_0x5a44('0x3f')]);_0x424989[_0x5a44('0x44')]=_[_0x5a44('0x42')](_0x31bc5b[_0x5a44('0x3e')],qs[_0x5a44('0x43')](_0x54a706['query'][_0x5a44('0x43')]));_0x424989[_0x5a44('0x44')]=_0x424989[_0x5a44('0x44')]['length']?_0x424989[_0x5a44('0x44')]:_0x31bc5b['model'];_0x424989['order']=qs[_0x5a44('0x47')](_0x54a706['query'][_0x5a44('0x47')]);_0x424989['where']=qs[_0x5a44('0x41')](_['pick'](_0x54a706['query'],_0x31bc5b[_0x5a44('0x41')]));if(_0x54a706[_0x5a44('0x3f')][_0x5a44('0x4a')]){_0x424989[_0x5a44('0x48')]=_[_0x5a44('0x4b')](_0x424989[_0x5a44('0x48')],{'$or':_[_0x5a44('0x39')](_0x424989[_0x5a44('0x44')],function(_0x4e27ae){var _0xdc8731={};_0xdc8731[_0x4e27ae]={'$like':'%'+_0x54a706[_0x5a44('0x3f')]['filter']+'%'};return _0xdc8731;})});}_0x424989=_[_0x5a44('0x4b')]({},_0x424989,_0x54a706[_0x5a44('0x4c')]);return _0x4c5b64[_0x5a44('0x56')](_0x424989);}})[_0x5a44('0x37')](function(_0x172e38){if(_0x172e38){_0x475e07=_0x172e38[_0x5a44('0x45')];if(!_0x54a706[_0x5a44('0x3f')][_0x5a44('0x58')](_0x5a44('0x59'))){_0x424989['limit']=qs[_0x5a44('0x31')](_0x54a706['query'][_0x5a44('0x31')]);_0x424989['offset']=qs[_0x5a44('0x30')](_0x54a706[_0x5a44('0x3f')][_0x5a44('0x30')]);}return _0x4c5b64[_0x5a44('0x56')](_0x424989);}})[_0x5a44('0x37')](function(_0x52d7d6){if(_0x52d7d6){return _0x52d7d6?{'count':_0x475e07,'rows':_0x52d7d6}:null;}})[_0x5a44('0x37')](respondWithResult(_0x2c533b,null))[_0x5a44('0x2a')](handleError(_0x2c533b,null));};exports[_0x5a44('0x5a')]=function(_0xafab05,_0x3efbe1,_0x1d63e5){if(_0xafab05[_0x5a44('0x54')]['id']){delete _0xafab05['body']['id'];}return db[_0x5a44('0x4d')][_0x5a44('0x57')]({'where':{'id':_0xafab05[_0x5a44('0x55')]['id']}})[_0x5a44('0x37')](handleEntityNotFound(_0x3efbe1,null))[_0x5a44('0x37')](function(_0x3c438b){if(_0x3c438b){_0xafab05['body'][_0x5a44('0x5b')]=_0x3c438b['id'];_0xafab05[_0x5a44('0x54')][_0x5a44('0x5c')]=integrations[_0x5a44('0x5d')](_0xafab05['body'][_0x5a44('0x5e')],_0xafab05['body']['type']);_0xafab05[_0x5a44('0x54')]['Descriptions']=integrations['getDescriptions'](_0xafab05['body'][_0x5a44('0x5e')],_0xafab05[_0x5a44('0x54')][_0x5a44('0x3c')]);return db[_0x5a44('0x5f')][_0x5a44('0x53')](_0xafab05[_0x5a44('0x54')],{'include':[{'model':db['DeskField'],'as':_0x5a44('0x5c')},{'model':db['DeskField'],'as':_0x5a44('0x60')}]});}return null;})[_0x5a44('0x37')](respondWithResult(_0x3efbe1,null))[_0x5a44('0x2a')](handleError(_0x3efbe1,null));};exports[_0x5a44('0x61')]=function(_0x3ed319,_0xcbc87c,_0x60a140){var _0x5336dd=[{'name':_0x5a44('0x62'),'label':_0x5a44('0x62'),'custom':![],'options':[{'name':0x1,'value':0x1},{'name':0x2,'value':0x2},{'name':0x3,'value':0x3},{'name':0x4,'value':0x4},{'name':0x5,'value':0x5},{'name':0x6,'value':0x6},{'name':0x7,'value':0x7},{'name':0x8,'value':0x8},{'name':0x9,'value':0x9},{'name':0xa,'value':0xa}]}];var _0x5d74dc='';return db[_0x5a44('0x4d')][_0x5a44('0x57')]({'where':{'id':_0x3ed319[_0x5a44('0x55')]['id']},'attributes':['id',_0x5a44('0x63'),_0x5a44('0x64'),_0x5a44('0x65'),'password',_0x5a44('0x66'),_0x5a44('0x67'),'token',_0x5a44('0x68')]})[_0x5a44('0x37')](handleEntityNotFound(_0xcbc87c,null))['then'](function(_0x26d5cc){if(_0x26d5cc){_0x5d74dc=_0x26d5cc[_0x5a44('0x63')];var _0x246685=_0x5d74dc[_0x5a44('0x69')](-0x1);if(_0x246685==='/'){_0x5d74dc=_0x5d74dc[_0x5a44('0x6a')](0x0,_0x5d74dc['lastIndexOf'](_0x246685));}var _0x1111c0={'method':_0x5a44('0x6b'),'uri':util[_0x5a44('0x6c')](_0x5a44('0x6d'),_0x5d74dc),'headers':{'Content-Type':_0x5a44('0x6e'),'Accept':_0x5a44('0x6e')},'json':!![]};if(_0x26d5cc[_0x5a44('0x64')]===_0x5a44('0x6f')){_0x1111c0['headers'][_0x5a44('0x70')]=util[_0x5a44('0x6c')](_0x5a44('0x71'),new Buffer(util[_0x5a44('0x6c')](_0x5a44('0x72'),_0x26d5cc[_0x5a44('0x65')],_0x26d5cc['password']))[_0x5a44('0x73')]('base64'));}return rp(_0x1111c0)[_0x5a44('0x37')](function(_0x1b6927){return _0x5336dd[_0x5a44('0x74')](_['map'](_0x1b6927[_0x5a44('0x75')][_0x5a44('0x76')],function(_0x3e6e6c){return{'id':_0x3e6e6c[_0x5a44('0x38')],'name':_0x3e6e6c[_0x5a44('0x38')],'type':_0x3e6e6c[_0x5a44('0x3c')],'active':_0x3e6e6c[_0x5a44('0x77')],'label':_0x3e6e6c[_0x5a44('0x78')],'custom':!![]};}));});}})['then'](function(_0x2d5263){return{'count':_0x2d5263['length'],'rows':_0x2d5263};})[_0x5a44('0x37')](respondWithResult(_0xcbc87c,null))[_0x5a44('0x2a')](function(_0x2f5a7c){var _0x5020e0=_0x3ed319[_0x5a44('0x3f')][_0x5a44('0x1e')]?0x1f4:_0x2f5a7c[_0x5a44('0x79')]||0x1f4;logger[_0x5a44('0x26')](_0x5a44('0x7a'),_0x5a44('0x61'),_0x5020e0,JSON[_0x5a44('0x25')](_0x2f5a7c));delete _0x2f5a7c[_0x5a44('0x38')];if(_0x5020e0===0x191){_0x5020e0=0x190;}_0xcbc87c['status'](_0x5020e0)[_0x5a44('0x7b')](_0x3ed319[_0x5a44('0x3f')][_0x5a44('0x1e')]?{'message':'Wrong\x20credentials','statusCode':_0x2f5a7c[_0x5a44('0x79')]}:_0x2f5a7c);});};
\ No newline at end of file
+var _0xdb16=['catch','sendStatus','status','end','json','count','set','reject','save','update','destroy','stack','name','send','map','DeskAccount','rawAttributes','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','limit','offset','order','sort','filter','merge','type','VIRTUAL','options','where','includeAll','include','findAll','rows','show','params','find','create','body','getConfigurations','findOne','DeskConfiguration','pick','nolimit','addConfiguration','AccountId','Subjects','getSubjects','channel','getDescriptions','Descriptions','getFields','priority','remoteUri','authType','username','password','consumerKey','token','tokenSecret','slice','substring','lastIndexOf','GET','format','application/json','basic','headers','Basic\x20%s','%s:%s','toString','base64','concat','_embedded','entries','active','label','statusCode','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','html-pdf','eml-format','rimraf','request-promise','moment','bluebird','mustache','path','sox','lodash','squel','crypto','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','jayson/promise','client','http','test','Sequelize','ValidationError','request','then','info','DeskAccount,\x20%s,\x20%s','request\x20sent','DeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result'];(function(_0x549e49,_0x94ee2f){var _0x53fdd3=function(_0x3a7710){while(--_0x3a7710){_0x549e49['push'](_0x549e49['shift']());}};_0x53fdd3(++_0x94ee2f);}(_0xdb16,0x153));var _0x6db1=function(_0x324fe8,_0x1ccb46){_0x324fe8=_0x324fe8-0x0;var _0x4a1cd9=_0xdb16[_0x324fe8];return _0x4a1cd9;};'use strict';var pdf=require(_0x6db1('0x0'));var emlformat=require(_0x6db1('0x1'));var rimraf=require(_0x6db1('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x6db1('0x3'));var moment=require(_0x6db1('0x4'));var BPromise=require(_0x6db1('0x5'));var Mustache=require(_0x6db1('0x6'));var util=require('util');var path=require(_0x6db1('0x7'));var sox=require(_0x6db1('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x6db1('0x9'));var squel=require(_0x6db1('0xa'));var crypto=require(_0x6db1('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x6db1('0xc'));var toCsv=require(_0x6db1('0xd'));var querystring=require(_0x6db1('0xe'));var Papa=require('papaparse');var Redis=require(_0x6db1('0xf'));var authService=require(_0x6db1('0x10'));var qs=require(_0x6db1('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x6db1('0x12'));var config=require(_0x6db1('0x13'));var db=require(_0x6db1('0x14'))['db'];var integrations=require(_0x6db1('0x15'));var jayson=require(_0x6db1('0x16'));var client=jayson[_0x6db1('0x17')][_0x6db1('0x18')]({'port':0x232a});function checkPasswordPattern(_0x3019a0,_0xc5bc2d,_0x102f66){if(_0x102f66){var _0x3c396f=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x3c396f[_0x6db1('0x19')](_0xc5bc2d)){return _0x3019a0;}else{throw new db[(_0x6db1('0x1a'))][(_0x6db1('0x1b'))]('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x3019a0;}}function respondWithRpcPromise(_0x1880fb,_0x3b1b41,_0x4c6c16,_0xb43928){return new BPromise(function(_0x387388,_0x873594){var _0x56ff6e=_0xb43928||client;return _0x56ff6e[_0x6db1('0x1c')](_0x1880fb,_0x4c6c16)[_0x6db1('0x1d')](function(_0x2aa56c){logger[_0x6db1('0x1e')](_0x6db1('0x1f'),_0x3b1b41,_0x6db1('0x20'));logger['debug'](_0x6db1('0x21'),_0x3b1b41,_0x6db1('0x20'),JSON[_0x6db1('0x22')](_0x2aa56c));if(_0x2aa56c[_0x6db1('0x23')]){if(_0x2aa56c[_0x6db1('0x23')][_0x6db1('0x24')]===0x1f4){logger['error']('DeskAccount,\x20%s,\x20%s',_0x3b1b41,_0x2aa56c[_0x6db1('0x23')][_0x6db1('0x25')]);return _0x873594(_0x2aa56c[_0x6db1('0x23')]['message']);}logger[_0x6db1('0x23')]('DeskAccount,\x20%s,\x20%s',_0x3b1b41,_0x2aa56c[_0x6db1('0x23')][_0x6db1('0x25')]);return _0x387388(_0x2aa56c[_0x6db1('0x23')]['message']);}else{logger[_0x6db1('0x1e')](_0x6db1('0x1f'),_0x3b1b41,'request\x20sent');_0x387388(_0x2aa56c[_0x6db1('0x26')][_0x6db1('0x25')]);}})[_0x6db1('0x27')](function(_0xdcfe08){logger[_0x6db1('0x23')](_0x6db1('0x1f'),_0x3b1b41,_0xdcfe08);_0x873594(_0xdcfe08);});});}function respondWithStatusCode(_0x213818,_0x2667eb){_0x2667eb=_0x2667eb||0xcc;return function(_0x2053d2){if(_0x2053d2){return _0x213818[_0x6db1('0x28')](_0x2667eb);}return _0x213818[_0x6db1('0x29')](_0x2667eb)[_0x6db1('0x2a')]();};}function respondWithResult(_0x22e583,_0x24fd52){_0x24fd52=_0x24fd52||0xc8;return function(_0x414292){if(_0x414292){return _0x22e583[_0x6db1('0x29')](_0x24fd52)[_0x6db1('0x2b')](_0x414292);}};}function respondWithFilteredResult(_0x29f2f6,_0x253a13){return function(_0x18c94a){if(_0x18c94a){var _0x565b51=_0x18c94a[_0x6db1('0x2c')],_0x103b2b=_0x253a13['offset'],_0x35e24d=_0x253a13['offset']+_0x253a13['limit'],_0x380009;if(_0x35e24d>=_0x565b51){_0x35e24d=_0x565b51;_0x380009=0xc8;}else{_0x380009=0xce;}_0x29f2f6[_0x6db1('0x29')](_0x380009);return _0x29f2f6[_0x6db1('0x2d')]('Content-Range',_0x103b2b+'-'+_0x35e24d+'/'+_0x565b51)['json'](_0x18c94a);}return null;};}function patchUpdates(_0x5bf790){return function(_0x1da629){try{jsonpatch['apply'](_0x1da629,_0x5bf790,!![]);}catch(_0x1c9fcd){return BPromise[_0x6db1('0x2e')](_0x1c9fcd);}return _0x1da629[_0x6db1('0x2f')]();};}function saveUpdates(_0x437d89,_0x21dc22){return function(_0x49cb9a){if(_0x49cb9a){return _0x49cb9a[_0x6db1('0x30')](_0x437d89)['then'](function(_0x33f117){return _0x33f117;});}return null;};}function removeEntity(_0x42f90c,_0x2f767f){return function(_0x3c716d){if(_0x3c716d){return _0x3c716d[_0x6db1('0x31')]()[_0x6db1('0x1d')](function(){_0x42f90c[_0x6db1('0x29')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3b3d50,_0x2ff9d3){return function(_0x3f5211){if(!_0x3f5211){_0x3b3d50[_0x6db1('0x28')](0x194);}return _0x3f5211;};}function handleError(_0x2c938d,_0x3db869){_0x3db869=_0x3db869||0x1f4;return function(_0xba0572){logger[_0x6db1('0x23')](_0xba0572[_0x6db1('0x32')]);if(_0xba0572['name']){delete _0xba0572[_0x6db1('0x33')];}_0x2c938d[_0x6db1('0x29')](_0x3db869)[_0x6db1('0x34')](_0xba0572);};}exports['index']=function(_0x123dd9,_0x3455fe){var _0x5351b0={},_0x15471a={},_0x5a38c1={'count':0x0,'rows':[]};var _0x371913=_[_0x6db1('0x35')](db[_0x6db1('0x36')][_0x6db1('0x37')],function(_0x1c8d98){return{'name':_0x1c8d98['fieldName'],'type':_0x1c8d98['type'][_0x6db1('0x38')]};});_0x15471a[_0x6db1('0x39')]=_[_0x6db1('0x35')](_0x371913,_0x6db1('0x33'));_0x15471a[_0x6db1('0x3a')]=_[_0x6db1('0x3b')](_0x123dd9[_0x6db1('0x3a')]);_0x15471a[_0x6db1('0x3c')]=_[_0x6db1('0x3d')](_0x15471a['model'],_0x15471a[_0x6db1('0x3a')]);_0x5351b0['attributes']=_[_0x6db1('0x3d')](_0x15471a[_0x6db1('0x39')],qs[_0x6db1('0x3e')](_0x123dd9['query'][_0x6db1('0x3e')]));_0x5351b0[_0x6db1('0x3f')]=_0x5351b0['attributes'][_0x6db1('0x40')]?_0x5351b0[_0x6db1('0x3f')]:_0x15471a[_0x6db1('0x39')];if(!_0x123dd9[_0x6db1('0x3a')][_0x6db1('0x41')]('nolimit')){_0x5351b0[_0x6db1('0x42')]=qs[_0x6db1('0x42')](_0x123dd9[_0x6db1('0x3a')][_0x6db1('0x42')]);_0x5351b0[_0x6db1('0x43')]=qs[_0x6db1('0x43')](_0x123dd9['query']['offset']);}_0x5351b0[_0x6db1('0x44')]=qs[_0x6db1('0x45')](_0x123dd9[_0x6db1('0x3a')][_0x6db1('0x45')]);_0x5351b0['where']=qs['filters'](_['pick'](_0x123dd9[_0x6db1('0x3a')],_0x15471a[_0x6db1('0x3c')]),_0x371913);if(_0x123dd9['query'][_0x6db1('0x46')]){_0x5351b0['where']=_[_0x6db1('0x47')](_0x5351b0['where'],{'$or':_[_0x6db1('0x35')](_0x371913,function(_0x5511ea){if(_0x5511ea[_0x6db1('0x48')]!==_0x6db1('0x49')){var _0x4b1a13={};_0x4b1a13[_0x5511ea[_0x6db1('0x33')]]={'$like':'%'+_0x123dd9[_0x6db1('0x3a')][_0x6db1('0x46')]+'%'};return _0x4b1a13;}})});}_0x5351b0=_[_0x6db1('0x47')]({},_0x5351b0,_0x123dd9[_0x6db1('0x4a')]);var _0x3d85d0={'where':_0x5351b0[_0x6db1('0x4b')]};return db[_0x6db1('0x36')]['count'](_0x3d85d0)[_0x6db1('0x1d')](function(_0xa7dea5){_0x5a38c1[_0x6db1('0x2c')]=_0xa7dea5;if(_0x123dd9[_0x6db1('0x3a')][_0x6db1('0x4c')]){_0x5351b0[_0x6db1('0x4d')]=[{'all':!![]}];}return db[_0x6db1('0x36')][_0x6db1('0x4e')](_0x5351b0);})[_0x6db1('0x1d')](function(_0x1c30d3){_0x5a38c1[_0x6db1('0x4f')]=_0x1c30d3;return _0x5a38c1;})['then'](respondWithFilteredResult(_0x3455fe,_0x5351b0))[_0x6db1('0x27')](handleError(_0x3455fe,null));};exports[_0x6db1('0x50')]=function(_0x35e7d8,_0x529708){var _0x7aa1e={'raw':![],'where':{'id':_0x35e7d8[_0x6db1('0x51')]['id']}},_0x16a923={};_0x16a923[_0x6db1('0x39')]=_[_0x6db1('0x3b')](db[_0x6db1('0x36')]['rawAttributes']);_0x16a923['query']=_['keys'](_0x35e7d8[_0x6db1('0x3a')]);_0x16a923[_0x6db1('0x3c')]=_[_0x6db1('0x3d')](_0x16a923[_0x6db1('0x39')],_0x16a923[_0x6db1('0x3a')]);_0x7aa1e[_0x6db1('0x3f')]=_[_0x6db1('0x3d')](_0x16a923[_0x6db1('0x39')],qs[_0x6db1('0x3e')](_0x35e7d8[_0x6db1('0x3a')][_0x6db1('0x3e')]));_0x7aa1e[_0x6db1('0x3f')]=_0x7aa1e['attributes'][_0x6db1('0x40')]?_0x7aa1e[_0x6db1('0x3f')]:_0x16a923[_0x6db1('0x39')];if(_0x35e7d8[_0x6db1('0x3a')]['includeAll']){_0x7aa1e[_0x6db1('0x4d')]=[{'all':!![]}];}_0x7aa1e=_['merge']({},_0x7aa1e,_0x35e7d8[_0x6db1('0x4a')]);return db['DeskAccount'][_0x6db1('0x52')](_0x7aa1e)[_0x6db1('0x1d')](handleEntityNotFound(_0x529708,null))[_0x6db1('0x1d')](respondWithResult(_0x529708,null))[_0x6db1('0x27')](handleError(_0x529708,null));};exports[_0x6db1('0x53')]=function(_0x13df68,_0x38d5ae){return db[_0x6db1('0x36')]['create'](_0x13df68[_0x6db1('0x54')],{})['then'](respondWithResult(_0x38d5ae,0xc9))['catch'](handleError(_0x38d5ae,null));};exports[_0x6db1('0x30')]=function(_0x4c0ab9,_0x33517f){if(_0x4c0ab9[_0x6db1('0x54')]['id']){delete _0x4c0ab9['body']['id'];}return db[_0x6db1('0x36')][_0x6db1('0x52')]({'where':{'id':_0x4c0ab9[_0x6db1('0x51')]['id']}})['then'](handleEntityNotFound(_0x33517f,null))[_0x6db1('0x1d')](saveUpdates(_0x4c0ab9['body'],null))[_0x6db1('0x1d')](respondWithResult(_0x33517f,null))[_0x6db1('0x27')](handleError(_0x33517f,null));};exports[_0x6db1('0x31')]=function(_0x45e24d,_0x3e8c9f){return db[_0x6db1('0x36')]['find']({'where':{'id':_0x45e24d['params']['id']}})[_0x6db1('0x1d')](handleEntityNotFound(_0x3e8c9f,null))[_0x6db1('0x1d')](removeEntity(_0x3e8c9f,null))[_0x6db1('0x27')](handleError(_0x3e8c9f,null));};exports[_0x6db1('0x55')]=function(_0xd21591,_0x1ad9f7,_0x1250c9){var _0xf5f72c={};var _0x467776={};var _0xa37fd0;var _0x419873;return db['DeskAccount'][_0x6db1('0x56')]({'where':{'id':_0xd21591['params']['id']}})[_0x6db1('0x1d')](handleEntityNotFound(_0x1ad9f7,null))[_0x6db1('0x1d')](function(_0x5c83b1){if(_0x5c83b1){_0xa37fd0=_0x5c83b1;_0x467776['model']=_['keys'](db[_0x6db1('0x57')][_0x6db1('0x37')]);_0x467776['query']=_[_0x6db1('0x3b')](_0xd21591['query']);_0x467776['filters']=_[_0x6db1('0x3d')](_0x467776['model'],_0x467776[_0x6db1('0x3a')]);_0xf5f72c[_0x6db1('0x3f')]=_[_0x6db1('0x3d')](_0x467776[_0x6db1('0x39')],qs['fields'](_0xd21591[_0x6db1('0x3a')][_0x6db1('0x3e')]));_0xf5f72c['attributes']=_0xf5f72c['attributes']['length']?_0xf5f72c[_0x6db1('0x3f')]:_0x467776[_0x6db1('0x39')];_0xf5f72c[_0x6db1('0x44')]=qs[_0x6db1('0x45')](_0xd21591[_0x6db1('0x3a')][_0x6db1('0x45')]);_0xf5f72c[_0x6db1('0x4b')]=qs[_0x6db1('0x3c')](_[_0x6db1('0x58')](_0xd21591[_0x6db1('0x3a')],_0x467776[_0x6db1('0x3c')]));if(_0xd21591['query']['filter']){_0xf5f72c[_0x6db1('0x4b')]=_[_0x6db1('0x47')](_0xf5f72c[_0x6db1('0x4b')],{'$or':_[_0x6db1('0x35')](_0xf5f72c[_0x6db1('0x3f')],function(_0x3a66e4){var _0x2a2660={};_0x2a2660[_0x3a66e4]={'$like':'%'+_0xd21591[_0x6db1('0x3a')][_0x6db1('0x46')]+'%'};return _0x2a2660;})});}_0xf5f72c=_[_0x6db1('0x47')]({},_0xf5f72c,_0xd21591[_0x6db1('0x4a')]);return _0xa37fd0[_0x6db1('0x55')](_0xf5f72c);}})[_0x6db1('0x1d')](function(_0x1cbd82){if(_0x1cbd82){_0x419873=_0x1cbd82[_0x6db1('0x40')];if(!_0xd21591['query'][_0x6db1('0x41')](_0x6db1('0x59'))){_0xf5f72c[_0x6db1('0x42')]=qs[_0x6db1('0x42')](_0xd21591['query']['limit']);_0xf5f72c['offset']=qs[_0x6db1('0x43')](_0xd21591[_0x6db1('0x3a')]['offset']);}return _0xa37fd0[_0x6db1('0x55')](_0xf5f72c);}})[_0x6db1('0x1d')](function(_0x167f4e){if(_0x167f4e){return _0x167f4e?{'count':_0x419873,'rows':_0x167f4e}:null;}})['then'](respondWithResult(_0x1ad9f7,null))['catch'](handleError(_0x1ad9f7,null));};exports[_0x6db1('0x5a')]=function(_0x39f6e5,_0x372a23,_0x5decd5){if(_0x39f6e5['body']['id']){delete _0x39f6e5[_0x6db1('0x54')]['id'];}return db['DeskAccount']['findOne']({'where':{'id':_0x39f6e5[_0x6db1('0x51')]['id']}})[_0x6db1('0x1d')](handleEntityNotFound(_0x372a23,null))[_0x6db1('0x1d')](function(_0xd741a4){if(_0xd741a4){_0x39f6e5['body'][_0x6db1('0x5b')]=_0xd741a4['id'];_0x39f6e5[_0x6db1('0x54')][_0x6db1('0x5c')]=integrations[_0x6db1('0x5d')](_0x39f6e5[_0x6db1('0x54')][_0x6db1('0x5e')],_0x39f6e5[_0x6db1('0x54')][_0x6db1('0x48')]);_0x39f6e5[_0x6db1('0x54')]['Descriptions']=integrations[_0x6db1('0x5f')](_0x39f6e5[_0x6db1('0x54')][_0x6db1('0x5e')],_0x39f6e5[_0x6db1('0x54')]['type']);return db[_0x6db1('0x57')][_0x6db1('0x53')](_0x39f6e5[_0x6db1('0x54')],{'include':[{'model':db['DeskField'],'as':'Subjects'},{'model':db['DeskField'],'as':_0x6db1('0x60')}]});}return null;})[_0x6db1('0x1d')](respondWithResult(_0x372a23,null))['catch'](handleError(_0x372a23,null));};exports[_0x6db1('0x61')]=function(_0x327bec,_0x35020b,_0x290c5e){var _0x2d3fca=[{'name':_0x6db1('0x62'),'label':_0x6db1('0x62'),'custom':![],'options':[{'name':0x1,'value':0x1},{'name':0x2,'value':0x2},{'name':0x3,'value':0x3},{'name':0x4,'value':0x4},{'name':0x5,'value':0x5},{'name':0x6,'value':0x6},{'name':0x7,'value':0x7},{'name':0x8,'value':0x8},{'name':0x9,'value':0x9},{'name':0xa,'value':0xa}]}];var _0x406d2c='';return db[_0x6db1('0x36')][_0x6db1('0x56')]({'where':{'id':_0x327bec[_0x6db1('0x51')]['id']},'attributes':['id',_0x6db1('0x63'),_0x6db1('0x64'),_0x6db1('0x65'),_0x6db1('0x66'),_0x6db1('0x67'),'consumerSecret',_0x6db1('0x68'),_0x6db1('0x69')]})[_0x6db1('0x1d')](handleEntityNotFound(_0x35020b,null))[_0x6db1('0x1d')](function(_0x50b660){if(_0x50b660){_0x406d2c=_0x50b660[_0x6db1('0x63')];var _0x4d24f1=_0x406d2c[_0x6db1('0x6a')](-0x1);if(_0x4d24f1==='/'){_0x406d2c=_0x406d2c[_0x6db1('0x6b')](0x0,_0x406d2c[_0x6db1('0x6c')](_0x4d24f1));}var _0xa1372d={'method':_0x6db1('0x6d'),'uri':util[_0x6db1('0x6e')]('%s/custom_fields',_0x406d2c),'headers':{'Content-Type':_0x6db1('0x6f'),'Accept':_0x6db1('0x6f')},'json':!![]};if(_0x50b660['authType']===_0x6db1('0x70')){_0xa1372d[_0x6db1('0x71')]['Authorization']=util['format'](_0x6db1('0x72'),new Buffer(util[_0x6db1('0x6e')](_0x6db1('0x73'),_0x50b660[_0x6db1('0x65')],_0x50b660['password']))[_0x6db1('0x74')](_0x6db1('0x75')));}return rp(_0xa1372d)[_0x6db1('0x1d')](function(_0x2de178){return _0x2d3fca[_0x6db1('0x76')](_[_0x6db1('0x35')](_0x2de178[_0x6db1('0x77')][_0x6db1('0x78')],function(_0x56ecee){return{'id':_0x56ecee[_0x6db1('0x33')],'name':_0x56ecee[_0x6db1('0x33')],'type':_0x56ecee[_0x6db1('0x48')],'active':_0x56ecee[_0x6db1('0x79')],'label':_0x56ecee[_0x6db1('0x7a')],'custom':!![]};}));});}})[_0x6db1('0x1d')](function(_0x96da44){return{'count':_0x96da44['length'],'rows':_0x96da44};})[_0x6db1('0x1d')](respondWithResult(_0x35020b,null))[_0x6db1('0x27')](function(_0x55c5a9){var _0x3f43cc=_0x327bec[_0x6db1('0x3a')][_0x6db1('0x19')]?0x1f4:_0x55c5a9[_0x6db1('0x7b')]||0x1f4;logger['error'](_0x6db1('0x7c'),_0x6db1('0x61'),_0x3f43cc,JSON[_0x6db1('0x22')](_0x55c5a9));delete _0x55c5a9[_0x6db1('0x33')];if(_0x3f43cc===0x191){_0x3f43cc=0x190;}_0x35020b[_0x6db1('0x29')](_0x3f43cc)[_0x6db1('0x34')](_0x327bec[_0x6db1('0x3a')]['test']?{'message':_0x6db1('0x7d'),'statusCode':_0x55c5a9[_0x6db1('0x7b')]}:_0x55c5a9);});};
\ No newline at end of file
diff --git a/server/api/intDeskAccount/intDeskAccount.model.js b/server/api/intDeskAccount/intDeskAccount.model.js
index dda74f6..b6165ba 100644
--- a/server/api/intDeskAccount/intDeskAccount.model.js
+++ b/server/api/intDeskAccount/intDeskAccount.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x8558=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./intDeskAccount.attributes','../../components/integrations/configuration','exports','DeskAccount','lodash','util'];(function(_0x3e9db4,_0x45a2b0){var _0x101478=function(_0x3dbcb7){while(--_0x3dbcb7){_0x3e9db4['push'](_0x3e9db4['shift']());}};_0x101478(++_0x45a2b0);}(_0x8558,0x1c5));var _0x8855=function(_0x115496,_0x3eaac7){_0x115496=_0x115496-0x0;var _0xb453f9=_0x8558[_0x115496];return _0xb453f9;};'use strict';var _=require(_0x8855('0x0'));var util=require(_0x8855('0x1'));var logger=require(_0x8855('0x2'))(_0x8855('0x3'));var moment=require(_0x8855('0x4'));var BPromise=require(_0x8855('0x5'));var rp=require(_0x8855('0x6'));var fs=require('fs');var path=require(_0x8855('0x7'));var rimraf=require(_0x8855('0x8'));var config=require('../../config/environment');var attributes=require(_0x8855('0x9'));var integrations=require(_0x8855('0xa'));module[_0x8855('0xb')]=function(_0x75c33c,_0x1969b6){return _0x75c33c['define'](_0x8855('0xc'),attributes,{'tableName':'int_desk_accounts','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xbf2b=['path','./intDeskAccount.attributes','../../components/integrations/configuration','exports','define','DeskAccount','lodash','util','../../config/logger','api','moment'];(function(_0x43aee5,_0x11268b){var _0x76d1d0=function(_0x3faee6){while(--_0x3faee6){_0x43aee5['push'](_0x43aee5['shift']());}};_0x76d1d0(++_0x11268b);}(_0xbf2b,0x103));var _0xbbf2=function(_0xa65d4a,_0x188ffe){_0xa65d4a=_0xa65d4a-0x0;var _0x5f5993=_0xbf2b[_0xa65d4a];return _0x5f5993;};'use strict';var _=require(_0xbbf2('0x0'));var util=require(_0xbbf2('0x1'));var logger=require(_0xbbf2('0x2'))(_0xbbf2('0x3'));var moment=require(_0xbbf2('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xbbf2('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xbbf2('0x6'));var integrations=require(_0xbbf2('0x7'));module[_0xbbf2('0x8')]=function(_0x2960cc,_0x35a355){return _0x2960cc[_0xbbf2('0x9')](_0xbbf2('0xa'),attributes,{'tableName':'int_desk_accounts','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/intDeskAccount/intDeskAccount.rpc.js b/server/api/intDeskAccount/intDeskAccount.rpc.js
index ad1fe8e..74e0c33 100644
--- a/server/api/intDeskAccount/intDeskAccount.rpc.js
+++ b/server/api/intDeskAccount/intDeskAccount.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x8979=['jayson/promise','client','request','then','info','DeskAccount,\x20%s,\x20%s','request\x20sent','debug','DeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetDeskAccount','DeskAccount','findAll','options','raw','where','attributes','limit','include','map','model','ShowDeskAccount','find','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment'];(function(_0x3b6b2c,_0xd626e6){var _0x3a9640=function(_0xa5bf8){while(--_0xa5bf8){_0x3b6b2c['push'](_0x3b6b2c['shift']());}};_0x3a9640(++_0xd626e6);}(_0x8979,0x1a8));var _0x9897=function(_0x10a100,_0x178bc9){_0x10a100=_0x10a100-0x0;var _0xdaf787=_0x8979[_0x10a100];return _0xdaf787;};'use strict';var _=require(_0x9897('0x0'));var util=require(_0x9897('0x1'));var moment=require(_0x9897('0x2'));var BPromise=require('bluebird');var rs=require(_0x9897('0x3'));var fs=require('fs');var Redis=require(_0x9897('0x4'));var db=require(_0x9897('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x9897('0x6'))('rpc');var config=require(_0x9897('0x7'));var jayson=require(_0x9897('0x8'));var client=jayson[_0x9897('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2ff2dc,_0x14afb4,_0x1141ab){return new BPromise(function(_0x5785ef,_0x52a0fe){return client[_0x9897('0xa')](_0x2ff2dc,_0x1141ab)[_0x9897('0xb')](function(_0x17b3ba){logger[_0x9897('0xc')](_0x9897('0xd'),_0x14afb4,_0x9897('0xe'));logger[_0x9897('0xf')](_0x9897('0x10'),_0x14afb4,_0x9897('0xe'),JSON[_0x9897('0x11')](_0x17b3ba));if(_0x17b3ba[_0x9897('0x12')]){if(_0x17b3ba[_0x9897('0x12')][_0x9897('0x13')]===0x1f4){logger['error']('DeskAccount,\x20%s,\x20%s',_0x14afb4,_0x17b3ba[_0x9897('0x12')]['message']);return _0x52a0fe(_0x17b3ba[_0x9897('0x12')]['message']);}logger['error'](_0x9897('0xd'),_0x14afb4,_0x17b3ba[_0x9897('0x12')]['message']);return _0x5785ef(_0x17b3ba['error'][_0x9897('0x14')]);}else{logger[_0x9897('0xc')](_0x9897('0xd'),_0x14afb4,_0x9897('0xe'));_0x5785ef(_0x17b3ba[_0x9897('0x15')][_0x9897('0x14')]);}})[_0x9897('0x16')](function(_0x5dc8f8){logger['error'](_0x9897('0xd'),_0x14afb4,_0x5dc8f8);_0x52a0fe(_0x5dc8f8);});});}exports[_0x9897('0x17')]=function(_0x14e4d0){var _0x29a120=this;return new Promise(function(_0x4f829d,_0x289873){return db[_0x9897('0x18')][_0x9897('0x19')]({'raw':_0x14e4d0['options']?_0x14e4d0[_0x9897('0x1a')][_0x9897('0x1b')]===undefined?!![]:![]:!![],'where':_0x14e4d0[_0x9897('0x1a')]?_0x14e4d0['options'][_0x9897('0x1c')]||null:null,'attributes':_0x14e4d0[_0x9897('0x1a')]?_0x14e4d0[_0x9897('0x1a')][_0x9897('0x1d')]||null:null,'limit':_0x14e4d0[_0x9897('0x1a')]?_0x14e4d0[_0x9897('0x1a')][_0x9897('0x1e')]||null:null,'include':_0x14e4d0['options']?_0x14e4d0[_0x9897('0x1a')]['include']?_['map'](_0x14e4d0[_0x9897('0x1a')][_0x9897('0x1f')],function(_0x241e61){return{'model':db[_0x241e61['model']],'as':_0x241e61['as'],'attributes':_0x241e61[_0x9897('0x1d')],'include':_0x241e61['include']?_[_0x9897('0x20')](_0x241e61[_0x9897('0x1f')],function(_0x5c6bd9){return{'model':db[_0x5c6bd9[_0x9897('0x21')]],'as':_0x5c6bd9['as'],'attributes':_0x5c6bd9[_0x9897('0x1d')],'include':_0x5c6bd9['include']?_[_0x9897('0x20')](_0x5c6bd9[_0x9897('0x1f')],function(_0x5e9346){return{'model':db[_0x5e9346[_0x9897('0x21')]],'as':_0x5e9346['as'],'attributes':_0x5e9346[_0x9897('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x45c680){logger['info'](_0x9897('0x17'),_0x14e4d0);logger[_0x9897('0xf')](_0x9897('0x17'),_0x14e4d0,JSON[_0x9897('0x11')](_0x45c680));_0x4f829d(_0x45c680);})[_0x9897('0x16')](function(_0x3c90e5){logger[_0x9897('0x12')](_0x9897('0x17'),_0x3c90e5[_0x9897('0x14')],_0x14e4d0);_0x289873(_0x29a120['error'](0x1f4,_0x3c90e5['message']));});});};exports[_0x9897('0x22')]=function(_0x5e99c9){var _0x290b49=this;return new Promise(function(_0x5e2aa1,_0x5a9637){return db[_0x9897('0x18')][_0x9897('0x23')]({'raw':_0x5e99c9[_0x9897('0x1a')]?_0x5e99c9[_0x9897('0x1a')][_0x9897('0x1b')]===undefined?!![]:![]:!![],'where':_0x5e99c9[_0x9897('0x1a')]?_0x5e99c9[_0x9897('0x1a')][_0x9897('0x1c')]||null:null,'attributes':_0x5e99c9['options']?_0x5e99c9[_0x9897('0x1a')][_0x9897('0x1d')]||null:null,'include':_0x5e99c9[_0x9897('0x1a')]?_0x5e99c9['options'][_0x9897('0x1f')]?_[_0x9897('0x20')](_0x5e99c9[_0x9897('0x1a')][_0x9897('0x1f')],function(_0x32340b){return{'model':db[_0x32340b['model']],'as':_0x32340b['as'],'attributes':_0x32340b['attributes'],'include':_0x32340b[_0x9897('0x1f')]?_[_0x9897('0x20')](_0x32340b['include'],function(_0x3dd69f){return{'model':db[_0x3dd69f['model']],'as':_0x3dd69f['as'],'attributes':_0x3dd69f[_0x9897('0x1d')],'include':_0x3dd69f[_0x9897('0x1f')]?_[_0x9897('0x20')](_0x3dd69f[_0x9897('0x1f')],function(_0x4164d7){return{'model':db[_0x4164d7[_0x9897('0x21')]],'as':_0x4164d7['as'],'attributes':_0x4164d7[_0x9897('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x257cda){logger[_0x9897('0xc')](_0x9897('0x22'),_0x5e99c9);logger[_0x9897('0xf')](_0x9897('0x22'),_0x5e99c9,JSON[_0x9897('0x11')](_0x257cda));_0x5e2aa1(_0x257cda);})[_0x9897('0x16')](function(_0x1b5654){logger[_0x9897('0x12')](_0x9897('0x22'),_0x1b5654[_0x9897('0x14')],_0x5e99c9);_0x5a9637(_0x290b49[_0x9897('0x12')](0x1f4,_0x1b5654[_0x9897('0x14')]));});});};
\ No newline at end of file
+var _0x14cd=['ioredis','../../config/utils','rpc','../../config/environment','http','request','then','info','request\x20sent','debug','DeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','DeskAccount,\x20%s,\x20%s','message','result','catch','DeskAccount','findAll','options','raw','where','attributes','include','map','model','GetDeskAccount','ShowDeskAccount','lodash','moment','bluebird','randomstring'];(function(_0x4dec3b,_0x1acb3d){var _0x76fe18=function(_0x5f5b17){while(--_0x5f5b17){_0x4dec3b['push'](_0x4dec3b['shift']());}};_0x76fe18(++_0x1acb3d);}(_0x14cd,0x1eb));var _0xd14c=function(_0x2b1fe5,_0x2968e2){_0x2b1fe5=_0x2b1fe5-0x0;var _0x5eb2af=_0x14cd[_0x2b1fe5];return _0x5eb2af;};'use strict';var _=require(_0xd14c('0x0'));var util=require('util');var moment=require(_0xd14c('0x1'));var BPromise=require(_0xd14c('0x2'));var rs=require(_0xd14c('0x3'));var fs=require('fs');var Redis=require(_0xd14c('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xd14c('0x5'));var logger=require('../../config/logger')(_0xd14c('0x6'));var config=require(_0xd14c('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0xd14c('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x28700c,_0x580195,_0x1b1c6d){return new BPromise(function(_0x326c3b,_0x5e2373){return client[_0xd14c('0x9')](_0x28700c,_0x1b1c6d)[_0xd14c('0xa')](function(_0x230fd7){logger[_0xd14c('0xb')]('DeskAccount,\x20%s,\x20%s',_0x580195,_0xd14c('0xc'));logger[_0xd14c('0xd')](_0xd14c('0xe'),_0x580195,_0xd14c('0xc'),JSON[_0xd14c('0xf')](_0x230fd7));if(_0x230fd7[_0xd14c('0x10')]){if(_0x230fd7[_0xd14c('0x10')][_0xd14c('0x11')]===0x1f4){logger[_0xd14c('0x10')]('DeskAccount,\x20%s,\x20%s',_0x580195,_0x230fd7[_0xd14c('0x10')]['message']);return _0x5e2373(_0x230fd7[_0xd14c('0x10')]['message']);}logger['error'](_0xd14c('0x12'),_0x580195,_0x230fd7['error'][_0xd14c('0x13')]);return _0x326c3b(_0x230fd7[_0xd14c('0x10')][_0xd14c('0x13')]);}else{logger[_0xd14c('0xb')](_0xd14c('0x12'),_0x580195,_0xd14c('0xc'));_0x326c3b(_0x230fd7[_0xd14c('0x14')][_0xd14c('0x13')]);}})[_0xd14c('0x15')](function(_0x2e7028){logger[_0xd14c('0x10')]('DeskAccount,\x20%s,\x20%s',_0x580195,_0x2e7028);_0x5e2373(_0x2e7028);});});}exports['GetDeskAccount']=function(_0x1e922f){var _0x3f23ed=this;return new Promise(function(_0x21c3d9,_0x4199e9){return db[_0xd14c('0x16')][_0xd14c('0x17')]({'raw':_0x1e922f['options']?_0x1e922f[_0xd14c('0x18')][_0xd14c('0x19')]===undefined?!![]:![]:!![],'where':_0x1e922f['options']?_0x1e922f[_0xd14c('0x18')][_0xd14c('0x1a')]||null:null,'attributes':_0x1e922f[_0xd14c('0x18')]?_0x1e922f['options'][_0xd14c('0x1b')]||null:null,'limit':_0x1e922f[_0xd14c('0x18')]?_0x1e922f[_0xd14c('0x18')]['limit']||null:null,'include':_0x1e922f['options']?_0x1e922f[_0xd14c('0x18')][_0xd14c('0x1c')]?_[_0xd14c('0x1d')](_0x1e922f[_0xd14c('0x18')][_0xd14c('0x1c')],function(_0x42d3a8){return{'model':db[_0x42d3a8[_0xd14c('0x1e')]],'as':_0x42d3a8['as'],'attributes':_0x42d3a8[_0xd14c('0x1b')],'include':_0x42d3a8[_0xd14c('0x1c')]?_[_0xd14c('0x1d')](_0x42d3a8[_0xd14c('0x1c')],function(_0x36d579){return{'model':db[_0x36d579[_0xd14c('0x1e')]],'as':_0x36d579['as'],'attributes':_0x36d579[_0xd14c('0x1b')],'include':_0x36d579['include']?_['map'](_0x36d579[_0xd14c('0x1c')],function(_0x5a57b8){return{'model':db[_0x5a57b8['model']],'as':_0x5a57b8['as'],'attributes':_0x5a57b8[_0xd14c('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xd14c('0xa')](function(_0x22e2d6){logger[_0xd14c('0xb')](_0xd14c('0x1f'),_0x1e922f);logger['debug'](_0xd14c('0x1f'),_0x1e922f,JSON[_0xd14c('0xf')](_0x22e2d6));_0x21c3d9(_0x22e2d6);})[_0xd14c('0x15')](function(_0x24e474){logger['error'](_0xd14c('0x1f'),_0x24e474[_0xd14c('0x13')],_0x1e922f);_0x4199e9(_0x3f23ed[_0xd14c('0x10')](0x1f4,_0x24e474['message']));});});};exports[_0xd14c('0x20')]=function(_0x250001){var _0x410689=this;return new Promise(function(_0x559e7c,_0xe21091){return db[_0xd14c('0x16')]['find']({'raw':_0x250001['options']?_0x250001[_0xd14c('0x18')][_0xd14c('0x19')]===undefined?!![]:![]:!![],'where':_0x250001[_0xd14c('0x18')]?_0x250001['options'][_0xd14c('0x1a')]||null:null,'attributes':_0x250001[_0xd14c('0x18')]?_0x250001[_0xd14c('0x18')][_0xd14c('0x1b')]||null:null,'include':_0x250001[_0xd14c('0x18')]?_0x250001[_0xd14c('0x18')][_0xd14c('0x1c')]?_['map'](_0x250001[_0xd14c('0x18')][_0xd14c('0x1c')],function(_0x24da69){return{'model':db[_0x24da69['model']],'as':_0x24da69['as'],'attributes':_0x24da69[_0xd14c('0x1b')],'include':_0x24da69[_0xd14c('0x1c')]?_['map'](_0x24da69[_0xd14c('0x1c')],function(_0x40ea67){return{'model':db[_0x40ea67['model']],'as':_0x40ea67['as'],'attributes':_0x40ea67[_0xd14c('0x1b')],'include':_0x40ea67[_0xd14c('0x1c')]?_['map'](_0x40ea67[_0xd14c('0x1c')],function(_0x5717d2){return{'model':db[_0x5717d2[_0xd14c('0x1e')]],'as':_0x5717d2['as'],'attributes':_0x5717d2[_0xd14c('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xd14c('0xa')](function(_0x542241){logger[_0xd14c('0xb')](_0xd14c('0x20'),_0x250001);logger[_0xd14c('0xd')](_0xd14c('0x20'),_0x250001,JSON['stringify'](_0x542241));_0x559e7c(_0x542241);})[_0xd14c('0x15')](function(_0xf70bd1){logger['error'](_0xd14c('0x20'),_0xf70bd1[_0xd14c('0x13')],_0x250001);_0xe21091(_0x410689[_0xd14c('0x10')](0x1f4,_0xf70bd1[_0xd14c('0x13')]));});});};
\ No newline at end of file
diff --git a/server/api/intDeskConfiguration/index.js b/server/api/intDeskConfiguration/index.js
index 77baa06..354929e 100644
--- a/server/api/intDeskConfiguration/index.js
+++ b/server/api/intDeskConfiguration/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x0b7f=['/:id/fields','getFields','/:id/subjects','/:id/descriptions','/:id/tags','getTags','post','create','setTags','put','update','destroy','exports','multer','util','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/:id','show'];(function(_0x4d5a4d,_0x1c7249){var _0x55bb93=function(_0x13cc29){while(--_0x13cc29){_0x4d5a4d['push'](_0x4d5a4d['shift']());}};_0x55bb93(++_0x1c7249);}(_0x0b7f,0x115));var _0xf0b7=function(_0x448af8,_0x557881){_0x448af8=_0x448af8-0x0;var _0x201bf9=_0x0b7f[_0x448af8];return _0x201bf9;};'use strict';var multer=require(_0xf0b7('0x0'));var util=require(_0xf0b7('0x1'));var path=require('path');var timeout=require(_0xf0b7('0x2'));var express=require('express');var router=express[_0xf0b7('0x3')]();var auth=require(_0xf0b7('0x4'));var interaction=require(_0xf0b7('0x5'));var config=require('../../config/environment');var controller=require('./intDeskConfiguration.controller');router[_0xf0b7('0x6')]('/',auth[_0xf0b7('0x7')](),controller[_0xf0b7('0x8')]);router[_0xf0b7('0x6')](_0xf0b7('0x9'),auth['isAuthenticated'](),controller[_0xf0b7('0xa')]);router[_0xf0b7('0x6')](_0xf0b7('0xb'),auth[_0xf0b7('0x7')](),controller[_0xf0b7('0xc')]);router['get'](_0xf0b7('0xd'),auth['isAuthenticated'](),controller['getSubjects']);router['get'](_0xf0b7('0xe'),auth['isAuthenticated'](),controller['getDescriptions']);router[_0xf0b7('0x6')](_0xf0b7('0xf'),auth[_0xf0b7('0x7')](),controller[_0xf0b7('0x10')]);router[_0xf0b7('0x11')]('/',auth[_0xf0b7('0x7')](),controller[_0xf0b7('0x12')]);router[_0xf0b7('0x11')]('/:id/tags',auth['isAuthenticated'](),controller[_0xf0b7('0x13')]);router[_0xf0b7('0x14')](_0xf0b7('0x9'),auth[_0xf0b7('0x7')](),controller[_0xf0b7('0x15')]);router['delete'](_0xf0b7('0x9'),auth[_0xf0b7('0x7')](),controller[_0xf0b7('0x16')]);module[_0xf0b7('0x17')]=router;
\ No newline at end of file
+var _0xb931=['../../config/environment','./intDeskConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','getTags','post','setTags','put','update','destroy','exports','path','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x999f2c,_0x184b5e){var _0x5a1554=function(_0x26aa9e){while(--_0x26aa9e){_0x999f2c['push'](_0x999f2c['shift']());}};_0x5a1554(++_0x184b5e);}(_0xb931,0x155));var _0x1b93=function(_0x2fdba9,_0x465e36){_0x2fdba9=_0x2fdba9-0x0;var _0x4b4f8b=_0xb931[_0x2fdba9];return _0x4b4f8b;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1b93('0x0'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x1b93('0x1')]();var auth=require(_0x1b93('0x2'));var interaction=require(_0x1b93('0x3'));var config=require(_0x1b93('0x4'));var controller=require(_0x1b93('0x5'));router[_0x1b93('0x6')]('/',auth[_0x1b93('0x7')](),controller[_0x1b93('0x8')]);router[_0x1b93('0x6')](_0x1b93('0x9'),auth[_0x1b93('0x7')](),controller[_0x1b93('0xa')]);router[_0x1b93('0x6')](_0x1b93('0xb'),auth[_0x1b93('0x7')](),controller['getFields']);router['get'](_0x1b93('0xc'),auth[_0x1b93('0x7')](),controller[_0x1b93('0xd')]);router['get'](_0x1b93('0xe'),auth['isAuthenticated'](),controller[_0x1b93('0xf')]);router[_0x1b93('0x6')]('/:id/tags',auth['isAuthenticated'](),controller[_0x1b93('0x10')]);router[_0x1b93('0x11')]('/',auth[_0x1b93('0x7')](),controller['create']);router[_0x1b93('0x11')]('/:id/tags',auth[_0x1b93('0x7')](),controller[_0x1b93('0x12')]);router[_0x1b93('0x13')](_0x1b93('0x9'),auth[_0x1b93('0x7')](),controller[_0x1b93('0x14')]);router['delete'](_0x1b93('0x9'),auth[_0x1b93('0x7')](),controller[_0x1b93('0x15')]);module[_0x1b93('0x16')]=router;
\ No newline at end of file
diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.attributes.js b/server/api/intDeskConfiguration/intDeskConfiguration.attributes.js
index c537446..a2f7b8a 100644
--- a/server/api/intDeskConfiguration/intDeskConfiguration.attributes.js
+++ b/server/api/intDeskConfiguration/intDeskConfiguration.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x2bcc=['exports','STRING','sequelize'];(function(_0x1d87fc,_0x1e5321){var _0x492b56=function(_0x4c6b16){while(--_0x4c6b16){_0x1d87fc['push'](_0x1d87fc['shift']());}};_0x492b56(++_0x1e5321);}(_0x2bcc,0x1d3));var _0xc2bc=function(_0x589fdb,_0x51d7d7){_0x589fdb=_0x589fdb-0x0;var _0x10483c=_0x2bcc[_0x589fdb];return _0x10483c;};'use strict';var Sequelize=require(_0xc2bc('0x0'));module[_0xc2bc('0x1')]={'name':{'type':Sequelize[_0xc2bc('0x2')]},'description':{'type':Sequelize[_0xc2bc('0x2')]}};
\ No newline at end of file
+var _0xa0d1=['sequelize','STRING'];(function(_0x489e56,_0x2e78ac){var _0x5f176c=function(_0x29d11a){while(--_0x29d11a){_0x489e56['push'](_0x489e56['shift']());}};_0x5f176c(++_0x2e78ac);}(_0xa0d1,0x186));var _0x1a0d=function(_0x5d6456,_0x58ecc7){_0x5d6456=_0x5d6456-0x0;var _0x4d66c1=_0xa0d1[_0x5d6456];return _0x4d66c1;};'use strict';var Sequelize=require(_0x1a0d('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x1a0d('0x1')]}};
\ No newline at end of file
diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.controller.js b/server/api/intDeskConfiguration/intDeskConfiguration.controller.js
index 9d5a517..09bda98 100644
--- a/server/api/intDeskConfiguration/intDeskConfiguration.controller.js
+++ b/server/api/intDeskConfiguration/intDeskConfiguration.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x5636=['The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','then','request\x20sent','stringify','error','code','DeskConfiguration,\x20%s,\x20%s','message','info','result','catch','sendStatus','end','json','offset','status','set','Content-Range','apply','reject','save','update','destroy','stack','name','send','map','DeskConfiguration','fieldName','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','limit','order','sort','pick','filter','where','type','merge','count','includeAll','findAll','rows','params','rawAttributes','length','include','options','create','body','find','getFields','nolimit','getSubjects','DeskField','getDescriptions','findOne','getTags','Tag','setTags','ids','html-pdf','eml-format','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','client','http','test','ValidationError'];(function(_0x2048ac,_0xb23af8){var _0x59bfcf=function(_0x431c39){while(--_0x431c39){_0x2048ac['push'](_0x2048ac['shift']());}};_0x59bfcf(++_0xb23af8);}(_0x5636,0x102));var _0x6563=function(_0x3cb470,_0x357b88){_0x3cb470=_0x3cb470-0x0;var _0xa4e54e=_0x5636[_0x3cb470];return _0xa4e54e;};'use strict';var pdf=require(_0x6563('0x0'));var emlformat=require(_0x6563('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x6563('0x2'));var moment=require(_0x6563('0x3'));var BPromise=require(_0x6563('0x4'));var Mustache=require('mustache');var util=require(_0x6563('0x5'));var path=require(_0x6563('0x6'));var sox=require(_0x6563('0x7'));var csv=require(_0x6563('0x8'));var ejs=require(_0x6563('0x9'));var fs=require('fs');var _=require(_0x6563('0xa'));var squel=require(_0x6563('0xb'));var crypto=require(_0x6563('0xc'));var jsforce=require(_0x6563('0xd'));var deskjs=require(_0x6563('0xe'));var toCsv=require(_0x6563('0x8'));var querystring=require(_0x6563('0xf'));var Papa=require(_0x6563('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x6563('0x11'));var as=require(_0x6563('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x6563('0x13'));var config=require(_0x6563('0x14'));var db=require(_0x6563('0x15'))['db'];var jayson=require(_0x6563('0x16'));var client=jayson[_0x6563('0x17')][_0x6563('0x18')]({'port':0x232a});function checkPasswordPattern(_0x31d3fa,_0xbbae72,_0x447f9a){if(_0x447f9a){var _0x51aeca=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x51aeca[_0x6563('0x19')](_0xbbae72)){return _0x31d3fa;}else{throw new db['Sequelize'][(_0x6563('0x1a'))](_0x6563('0x1b'));}}else{return _0x31d3fa;}}function respondWithRpcPromise(_0x33f8e4,_0x10d08c,_0x5af5d0,_0x26f26e){return new BPromise(function(_0x11baa2,_0x477d9b){var _0xd398ce=_0x26f26e||client;return _0xd398ce['request'](_0x33f8e4,_0x5af5d0)[_0x6563('0x1c')](function(_0x589632){logger['info']('DeskConfiguration,\x20%s,\x20%s',_0x10d08c,_0x6563('0x1d'));logger['debug']('DeskConfiguration,\x20%s,\x20%s,\x20%s',_0x10d08c,_0x6563('0x1d'),JSON[_0x6563('0x1e')](_0x589632));if(_0x589632[_0x6563('0x1f')]){if(_0x589632[_0x6563('0x1f')][_0x6563('0x20')]===0x1f4){logger[_0x6563('0x1f')](_0x6563('0x21'),_0x10d08c,_0x589632[_0x6563('0x1f')][_0x6563('0x22')]);return _0x477d9b(_0x589632['error'][_0x6563('0x22')]);}logger[_0x6563('0x1f')](_0x6563('0x21'),_0x10d08c,_0x589632['error'][_0x6563('0x22')]);return _0x11baa2(_0x589632['error'][_0x6563('0x22')]);}else{logger[_0x6563('0x23')]('DeskConfiguration,\x20%s,\x20%s',_0x10d08c,'request\x20sent');_0x11baa2(_0x589632[_0x6563('0x24')]['message']);}})[_0x6563('0x25')](function(_0x19f34e){logger[_0x6563('0x1f')]('DeskConfiguration,\x20%s,\x20%s',_0x10d08c,_0x19f34e);_0x477d9b(_0x19f34e);});});}function respondWithStatusCode(_0xd860d5,_0x51ff06){_0x51ff06=_0x51ff06||0xcc;return function(_0x7ea857){if(_0x7ea857){return _0xd860d5[_0x6563('0x26')](_0x51ff06);}return _0xd860d5['status'](_0x51ff06)[_0x6563('0x27')]();};}function respondWithResult(_0x28252d,_0x49a824){_0x49a824=_0x49a824||0xc8;return function(_0x2ddb2b){if(_0x2ddb2b){return _0x28252d['status'](_0x49a824)[_0x6563('0x28')](_0x2ddb2b);}};}function respondWithFilteredResult(_0x4fbb20,_0x480408){return function(_0x30f05a){if(_0x30f05a){var _0x118d31=_0x30f05a['count'],_0x17326c=_0x480408[_0x6563('0x29')],_0x2a1550=_0x480408['offset']+_0x480408['limit'],_0x3eb23b;if(_0x2a1550>=_0x118d31){_0x2a1550=_0x118d31;_0x3eb23b=0xc8;}else{_0x3eb23b=0xce;}_0x4fbb20[_0x6563('0x2a')](_0x3eb23b);return _0x4fbb20[_0x6563('0x2b')](_0x6563('0x2c'),_0x17326c+'-'+_0x2a1550+'/'+_0x118d31)[_0x6563('0x28')](_0x30f05a);}return null;};}function patchUpdates(_0x116605){return function(_0x305861){try{jsonpatch[_0x6563('0x2d')](_0x305861,_0x116605,!![]);}catch(_0x334874){return BPromise[_0x6563('0x2e')](_0x334874);}return _0x305861[_0x6563('0x2f')]();};}function saveUpdates(_0x59b1a6,_0x9b3d86){return function(_0x30b67c){if(_0x30b67c){return _0x30b67c[_0x6563('0x30')](_0x59b1a6)[_0x6563('0x1c')](function(_0x29ab06){return _0x29ab06;});}return null;};}function removeEntity(_0xb9be99,_0x1bd58a){return function(_0x571f86){if(_0x571f86){return _0x571f86[_0x6563('0x31')]()[_0x6563('0x1c')](function(){_0xb9be99[_0x6563('0x2a')](0xcc)[_0x6563('0x27')]();});}};}function handleEntityNotFound(_0x3f79da,_0x3801c1){return function(_0x574a35){if(!_0x574a35){_0x3f79da[_0x6563('0x26')](0x194);}return _0x574a35;};}function handleError(_0x3e04f3,_0x26c24b){_0x26c24b=_0x26c24b||0x1f4;return function(_0x33aa0b){logger[_0x6563('0x1f')](_0x33aa0b[_0x6563('0x32')]);if(_0x33aa0b[_0x6563('0x33')]){delete _0x33aa0b['name'];}_0x3e04f3[_0x6563('0x2a')](_0x26c24b)[_0x6563('0x34')](_0x33aa0b);};}exports['index']=function(_0xf6b446,_0x1ff47d){var _0x5b0c9f={},_0x582650={},_0x38fef5={'count':0x0,'rows':[]};var _0x5ca0ab=_[_0x6563('0x35')](db[_0x6563('0x36')]['rawAttributes'],function(_0x2d36d4){return{'name':_0x2d36d4[_0x6563('0x37')],'type':_0x2d36d4['type'][_0x6563('0x38')]};});_0x582650[_0x6563('0x39')]=_[_0x6563('0x35')](_0x5ca0ab,_0x6563('0x33'));_0x582650[_0x6563('0x3a')]=_[_0x6563('0x3b')](_0xf6b446[_0x6563('0x3a')]);_0x582650[_0x6563('0x3c')]=_[_0x6563('0x3d')](_0x582650['model'],_0x582650[_0x6563('0x3a')]);_0x5b0c9f[_0x6563('0x3e')]=_[_0x6563('0x3d')](_0x582650[_0x6563('0x39')],qs['fields'](_0xf6b446['query'][_0x6563('0x3f')]));_0x5b0c9f[_0x6563('0x3e')]=_0x5b0c9f[_0x6563('0x3e')]['length']?_0x5b0c9f[_0x6563('0x3e')]:_0x582650['model'];if(!_0xf6b446[_0x6563('0x3a')][_0x6563('0x40')]('nolimit')){_0x5b0c9f[_0x6563('0x41')]=qs[_0x6563('0x41')](_0xf6b446[_0x6563('0x3a')][_0x6563('0x41')]);_0x5b0c9f[_0x6563('0x29')]=qs[_0x6563('0x29')](_0xf6b446[_0x6563('0x3a')][_0x6563('0x29')]);}_0x5b0c9f[_0x6563('0x42')]=qs[_0x6563('0x43')](_0xf6b446[_0x6563('0x3a')]['sort']);_0x5b0c9f['where']=qs[_0x6563('0x3c')](_[_0x6563('0x44')](_0xf6b446[_0x6563('0x3a')],_0x582650[_0x6563('0x3c')]),_0x5ca0ab);if(_0xf6b446[_0x6563('0x3a')][_0x6563('0x45')]){_0x5b0c9f[_0x6563('0x46')]=_['merge'](_0x5b0c9f[_0x6563('0x46')],{'$or':_[_0x6563('0x35')](_0x5ca0ab,function(_0x41fff0){if(_0x41fff0[_0x6563('0x47')]!=='VIRTUAL'){var _0x355c97={};_0x355c97[_0x41fff0[_0x6563('0x33')]]={'$like':'%'+_0xf6b446[_0x6563('0x3a')][_0x6563('0x45')]+'%'};return _0x355c97;}})});}_0x5b0c9f=_[_0x6563('0x48')]({},_0x5b0c9f,_0xf6b446['options']);var _0x496602={'where':_0x5b0c9f[_0x6563('0x46')]};return db[_0x6563('0x36')][_0x6563('0x49')](_0x496602)['then'](function(_0x331a4e){_0x38fef5[_0x6563('0x49')]=_0x331a4e;if(_0xf6b446[_0x6563('0x3a')][_0x6563('0x4a')]){_0x5b0c9f['include']=[{'all':!![]}];}return db[_0x6563('0x36')][_0x6563('0x4b')](_0x5b0c9f);})[_0x6563('0x1c')](function(_0x55e927){_0x38fef5[_0x6563('0x4c')]=_0x55e927;return _0x38fef5;})['then'](respondWithFilteredResult(_0x1ff47d,_0x5b0c9f))[_0x6563('0x25')](handleError(_0x1ff47d,null));};exports['show']=function(_0x49090b,_0x1ef2da){var _0x11617b={'raw':![],'where':{'id':_0x49090b[_0x6563('0x4d')]['id']}},_0x2ebab0={};_0x2ebab0[_0x6563('0x39')]=_[_0x6563('0x3b')](db[_0x6563('0x36')][_0x6563('0x4e')]);_0x2ebab0[_0x6563('0x3a')]=_[_0x6563('0x3b')](_0x49090b['query']);_0x2ebab0[_0x6563('0x3c')]=_['intersection'](_0x2ebab0[_0x6563('0x39')],_0x2ebab0[_0x6563('0x3a')]);_0x11617b[_0x6563('0x3e')]=_['intersection'](_0x2ebab0[_0x6563('0x39')],qs[_0x6563('0x3f')](_0x49090b['query'][_0x6563('0x3f')]));_0x11617b[_0x6563('0x3e')]=_0x11617b[_0x6563('0x3e')][_0x6563('0x4f')]?_0x11617b[_0x6563('0x3e')]:_0x2ebab0['model'];if(_0x49090b[_0x6563('0x3a')]['includeAll']){_0x11617b[_0x6563('0x50')]=[{'all':!![]}];}_0x11617b=_['merge']({},_0x11617b,_0x49090b[_0x6563('0x51')]);return db['DeskConfiguration']['find'](_0x11617b)['then'](handleEntityNotFound(_0x1ef2da,null))['then'](respondWithResult(_0x1ef2da,null))[_0x6563('0x25')](handleError(_0x1ef2da,null));};exports['create']=function(_0x2d037c,_0x56411c){return db[_0x6563('0x36')][_0x6563('0x52')](_0x2d037c[_0x6563('0x53')],{})[_0x6563('0x1c')](respondWithResult(_0x56411c,0xc9))[_0x6563('0x25')](handleError(_0x56411c,null));};exports[_0x6563('0x30')]=function(_0x23c94a,_0xdc94f8){if(_0x23c94a[_0x6563('0x53')]['id']){delete _0x23c94a['body']['id'];}return db[_0x6563('0x36')][_0x6563('0x54')]({'where':{'id':_0x23c94a[_0x6563('0x4d')]['id']}})[_0x6563('0x1c')](handleEntityNotFound(_0xdc94f8,null))[_0x6563('0x1c')](saveUpdates(_0x23c94a[_0x6563('0x53')],null))[_0x6563('0x1c')](respondWithResult(_0xdc94f8,null))[_0x6563('0x25')](handleError(_0xdc94f8,null));};exports[_0x6563('0x31')]=function(_0x2c7e9d,_0x1fc431){return db['DeskConfiguration'][_0x6563('0x54')]({'where':{'id':_0x2c7e9d[_0x6563('0x4d')]['id']}})[_0x6563('0x1c')](handleEntityNotFound(_0x1fc431,null))[_0x6563('0x1c')](removeEntity(_0x1fc431,null))[_0x6563('0x25')](handleError(_0x1fc431,null));};exports[_0x6563('0x55')]=function(_0x3f43c2,_0x4268b2,_0x53292e){var _0xbfb2a6={};var _0x4f51d2={};var _0x1f597f;var _0x11751c;return db['DeskConfiguration']['findOne']({'where':{'id':_0x3f43c2[_0x6563('0x4d')]['id']}})[_0x6563('0x1c')](handleEntityNotFound(_0x4268b2,null))[_0x6563('0x1c')](function(_0x39fc04){if(_0x39fc04){_0x1f597f=_0x39fc04;_0x4f51d2['model']=_[_0x6563('0x3b')](db['DeskField'][_0x6563('0x4e')]);_0x4f51d2[_0x6563('0x3a')]=_['keys'](_0x3f43c2['query']);_0x4f51d2[_0x6563('0x3c')]=_['intersection'](_0x4f51d2['model'],_0x4f51d2[_0x6563('0x3a')]);_0xbfb2a6['attributes']=_[_0x6563('0x3d')](_0x4f51d2[_0x6563('0x39')],qs[_0x6563('0x3f')](_0x3f43c2[_0x6563('0x3a')]['fields']));_0xbfb2a6[_0x6563('0x3e')]=_0xbfb2a6[_0x6563('0x3e')][_0x6563('0x4f')]?_0xbfb2a6[_0x6563('0x3e')]:_0x4f51d2[_0x6563('0x39')];_0xbfb2a6[_0x6563('0x42')]=qs[_0x6563('0x43')](_0x3f43c2[_0x6563('0x3a')]['sort']);_0xbfb2a6['where']=qs[_0x6563('0x3c')](_[_0x6563('0x44')](_0x3f43c2['query'],_0x4f51d2['filters']));if(_0x3f43c2['query'][_0x6563('0x45')]){_0xbfb2a6[_0x6563('0x46')]=_[_0x6563('0x48')](_0xbfb2a6[_0x6563('0x46')],{'$or':_['map'](_0xbfb2a6[_0x6563('0x3e')],function(_0x1a5c54){var _0x386597={};_0x386597[_0x1a5c54]={'$like':'%'+_0x3f43c2[_0x6563('0x3a')][_0x6563('0x45')]+'%'};return _0x386597;})});}_0xbfb2a6=_['merge']({},_0xbfb2a6,_0x3f43c2['options']);return _0x1f597f[_0x6563('0x55')](_0xbfb2a6);}})[_0x6563('0x1c')](function(_0x2426cd){if(_0x2426cd){_0x11751c=_0x2426cd['length'];if(!_0x3f43c2[_0x6563('0x3a')]['hasOwnProperty'](_0x6563('0x56'))){_0xbfb2a6[_0x6563('0x41')]=qs[_0x6563('0x41')](_0x3f43c2[_0x6563('0x3a')][_0x6563('0x41')]);_0xbfb2a6[_0x6563('0x29')]=qs[_0x6563('0x29')](_0x3f43c2['query']['offset']);}return _0x1f597f[_0x6563('0x55')](_0xbfb2a6);}})[_0x6563('0x1c')](function(_0x2327fe){if(_0x2327fe){return _0x2327fe?{'count':_0x11751c,'rows':_0x2327fe}:null;}})[_0x6563('0x1c')](respondWithResult(_0x4268b2,null))[_0x6563('0x25')](handleError(_0x4268b2,null));};exports[_0x6563('0x57')]=function(_0x515e98,_0x4dce49,_0x504e05){var _0x20560f={};var _0x1b7fce={};var _0x2a222e;var _0x1d8edb;return db[_0x6563('0x36')]['findOne']({'where':{'id':_0x515e98[_0x6563('0x4d')]['id']}})[_0x6563('0x1c')](handleEntityNotFound(_0x4dce49,null))[_0x6563('0x1c')](function(_0x190c2f){if(_0x190c2f){_0x2a222e=_0x190c2f;_0x1b7fce['model']=_[_0x6563('0x3b')](db[_0x6563('0x58')][_0x6563('0x4e')]);_0x1b7fce[_0x6563('0x3a')]=_[_0x6563('0x3b')](_0x515e98[_0x6563('0x3a')]);_0x1b7fce[_0x6563('0x3c')]=_[_0x6563('0x3d')](_0x1b7fce[_0x6563('0x39')],_0x1b7fce[_0x6563('0x3a')]);_0x20560f[_0x6563('0x3e')]=_[_0x6563('0x3d')](_0x1b7fce[_0x6563('0x39')],qs[_0x6563('0x3f')](_0x515e98[_0x6563('0x3a')]['fields']));_0x20560f[_0x6563('0x3e')]=_0x20560f[_0x6563('0x3e')][_0x6563('0x4f')]?_0x20560f[_0x6563('0x3e')]:_0x1b7fce[_0x6563('0x39')];_0x20560f[_0x6563('0x42')]=qs[_0x6563('0x43')](_0x515e98[_0x6563('0x3a')][_0x6563('0x43')]);_0x20560f[_0x6563('0x46')]=qs['filters'](_[_0x6563('0x44')](_0x515e98[_0x6563('0x3a')],_0x1b7fce[_0x6563('0x3c')]));if(_0x515e98[_0x6563('0x3a')][_0x6563('0x45')]){_0x20560f[_0x6563('0x46')]=_[_0x6563('0x48')](_0x20560f['where'],{'$or':_[_0x6563('0x35')](_0x20560f[_0x6563('0x3e')],function(_0x2b03b4){var _0x3aaf22={};_0x3aaf22[_0x2b03b4]={'$like':'%'+_0x515e98[_0x6563('0x3a')][_0x6563('0x45')]+'%'};return _0x3aaf22;})});}_0x20560f=_['merge']({},_0x20560f,_0x515e98[_0x6563('0x51')]);return _0x2a222e[_0x6563('0x57')](_0x20560f);}})[_0x6563('0x1c')](function(_0x4ff0fa){if(_0x4ff0fa){_0x1d8edb=_0x4ff0fa[_0x6563('0x4f')];if(!_0x515e98[_0x6563('0x3a')][_0x6563('0x40')]('nolimit')){_0x20560f['limit']=qs['limit'](_0x515e98[_0x6563('0x3a')][_0x6563('0x41')]);_0x20560f[_0x6563('0x29')]=qs[_0x6563('0x29')](_0x515e98['query'][_0x6563('0x29')]);}return _0x2a222e[_0x6563('0x57')](_0x20560f);}})['then'](function(_0x4ef39c){if(_0x4ef39c){return _0x4ef39c?{'count':_0x1d8edb,'rows':_0x4ef39c}:null;}})[_0x6563('0x1c')](respondWithResult(_0x4dce49,null))[_0x6563('0x25')](handleError(_0x4dce49,null));};exports[_0x6563('0x59')]=function(_0x2fe67b,_0x4b7821,_0x1c195c){var _0x204538={};var _0x3e5200={};var _0x22c981;var _0x24d334;return db[_0x6563('0x36')][_0x6563('0x5a')]({'where':{'id':_0x2fe67b[_0x6563('0x4d')]['id']}})[_0x6563('0x1c')](handleEntityNotFound(_0x4b7821,null))['then'](function(_0x324d0b){if(_0x324d0b){_0x22c981=_0x324d0b;_0x3e5200[_0x6563('0x39')]=_[_0x6563('0x3b')](db[_0x6563('0x58')][_0x6563('0x4e')]);_0x3e5200[_0x6563('0x3a')]=_['keys'](_0x2fe67b[_0x6563('0x3a')]);_0x3e5200[_0x6563('0x3c')]=_[_0x6563('0x3d')](_0x3e5200['model'],_0x3e5200['query']);_0x204538[_0x6563('0x3e')]=_[_0x6563('0x3d')](_0x3e5200[_0x6563('0x39')],qs[_0x6563('0x3f')](_0x2fe67b[_0x6563('0x3a')]['fields']));_0x204538['attributes']=_0x204538[_0x6563('0x3e')]['length']?_0x204538[_0x6563('0x3e')]:_0x3e5200['model'];_0x204538['order']=qs[_0x6563('0x43')](_0x2fe67b[_0x6563('0x3a')][_0x6563('0x43')]);_0x204538[_0x6563('0x46')]=qs[_0x6563('0x3c')](_[_0x6563('0x44')](_0x2fe67b[_0x6563('0x3a')],_0x3e5200[_0x6563('0x3c')]));if(_0x2fe67b['query'][_0x6563('0x45')]){_0x204538[_0x6563('0x46')]=_[_0x6563('0x48')](_0x204538[_0x6563('0x46')],{'$or':_['map'](_0x204538[_0x6563('0x3e')],function(_0x5b86bd){var _0x4345e0={};_0x4345e0[_0x5b86bd]={'$like':'%'+_0x2fe67b[_0x6563('0x3a')][_0x6563('0x45')]+'%'};return _0x4345e0;})});}_0x204538=_[_0x6563('0x48')]({},_0x204538,_0x2fe67b[_0x6563('0x51')]);return _0x22c981[_0x6563('0x59')](_0x204538);}})[_0x6563('0x1c')](function(_0x32623a){if(_0x32623a){_0x24d334=_0x32623a[_0x6563('0x4f')];if(!_0x2fe67b[_0x6563('0x3a')][_0x6563('0x40')](_0x6563('0x56'))){_0x204538['limit']=qs[_0x6563('0x41')](_0x2fe67b['query'][_0x6563('0x41')]);_0x204538[_0x6563('0x29')]=qs[_0x6563('0x29')](_0x2fe67b[_0x6563('0x3a')][_0x6563('0x29')]);}return _0x22c981[_0x6563('0x59')](_0x204538);}})[_0x6563('0x1c')](function(_0x211568){if(_0x211568){return _0x211568?{'count':_0x24d334,'rows':_0x211568}:null;}})[_0x6563('0x1c')](respondWithResult(_0x4b7821,null))[_0x6563('0x25')](handleError(_0x4b7821,null));};exports[_0x6563('0x5b')]=function(_0x5a14e8,_0x23c42c,_0x442e99){var _0xd233f5={};var _0x50709d={};var _0x345715;var _0x3b5d8e;return db[_0x6563('0x36')][_0x6563('0x5a')]({'where':{'id':_0x5a14e8[_0x6563('0x4d')]['id']}})[_0x6563('0x1c')](handleEntityNotFound(_0x23c42c,null))['then'](function(_0x40bb2f){if(_0x40bb2f){_0x345715=_0x40bb2f;_0x50709d[_0x6563('0x39')]=_['keys'](db[_0x6563('0x5c')]['rawAttributes']);_0x50709d['query']=_[_0x6563('0x3b')](_0x5a14e8[_0x6563('0x3a')]);_0x50709d[_0x6563('0x3c')]=_[_0x6563('0x3d')](_0x50709d[_0x6563('0x39')],_0x50709d[_0x6563('0x3a')]);_0xd233f5[_0x6563('0x3e')]=_[_0x6563('0x3d')](_0x50709d[_0x6563('0x39')],qs[_0x6563('0x3f')](_0x5a14e8['query'][_0x6563('0x3f')]));_0xd233f5[_0x6563('0x3e')]=_0xd233f5['attributes']['length']?_0xd233f5[_0x6563('0x3e')]:_0x50709d[_0x6563('0x39')];_0xd233f5[_0x6563('0x42')]=qs[_0x6563('0x43')](_0x5a14e8['query'][_0x6563('0x43')]);_0xd233f5['where']=qs[_0x6563('0x3c')](_[_0x6563('0x44')](_0x5a14e8[_0x6563('0x3a')],_0x50709d[_0x6563('0x3c')]));if(_0x5a14e8[_0x6563('0x3a')][_0x6563('0x45')]){_0xd233f5['where']=_['merge'](_0xd233f5[_0x6563('0x46')],{'$or':_[_0x6563('0x35')](_0xd233f5['attributes'],function(_0x26753e){var _0x59702c={};_0x59702c[_0x26753e]={'$like':'%'+_0x5a14e8['query'][_0x6563('0x45')]+'%'};return _0x59702c;})});}_0xd233f5=_[_0x6563('0x48')]({},_0xd233f5,_0x5a14e8[_0x6563('0x51')]);return _0x345715[_0x6563('0x5b')](_0xd233f5);}})['then'](function(_0x139682){if(_0x139682){_0x3b5d8e=_0x139682[_0x6563('0x4f')];if(!_0x5a14e8[_0x6563('0x3a')][_0x6563('0x40')](_0x6563('0x56'))){_0xd233f5[_0x6563('0x41')]=qs[_0x6563('0x41')](_0x5a14e8['query'][_0x6563('0x41')]);_0xd233f5[_0x6563('0x29')]=qs[_0x6563('0x29')](_0x5a14e8[_0x6563('0x3a')]['offset']);}return _0x345715['getTags'](_0xd233f5);}})[_0x6563('0x1c')](function(_0x30b501){if(_0x30b501){return _0x30b501?{'count':_0x3b5d8e,'rows':_0x30b501}:null;}})[_0x6563('0x1c')](respondWithResult(_0x23c42c,null))[_0x6563('0x25')](handleError(_0x23c42c,null));};exports[_0x6563('0x5d')]=function(_0x18e58c,_0x33df27,_0x194ddb){if(_0x18e58c[_0x6563('0x53')]['id']){delete _0x18e58c['body']['id'];}return db['DeskConfiguration'][_0x6563('0x5a')]({'where':{'id':_0x18e58c[_0x6563('0x4d')]['id']}})[_0x6563('0x1c')](handleEntityNotFound(_0x33df27,null))[_0x6563('0x1c')](function(_0x30083d){if(_0x30083d){return _0x30083d[_0x6563('0x5d')](_0x18e58c['body'][_0x6563('0x5e')]||[]);}return null;})[_0x6563('0x1c')](respondWithResult(_0x33df27,null))[_0x6563('0x25')](handleError(_0x33df27,null));};
\ No newline at end of file
+var _0x4f29=['message','catch','end','status','count','offset','set','Content-Range','json','reject','save','update','then','stack','name','send','map','DeskConfiguration','rawAttributes','fieldName','type','key','keys','filters','query','attributes','intersection','model','fields','length','hasOwnProperty','nolimit','limit','order','sort','pick','where','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','find','create','body','params','destroy','getFields','findOne','getSubjects','getDescriptions','DeskField','getTags','Tag','setTags','ids','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','client','http','test','Sequelize','ValidationError','info','DeskConfiguration,\x20%s,\x20%s','debug','DeskConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code'];(function(_0x48f2ca,_0x9c9128){var _0x50b14c=function(_0x16203f){while(--_0x16203f){_0x48f2ca['push'](_0x48f2ca['shift']());}};_0x50b14c(++_0x9c9128);}(_0x4f29,0xfd));var _0x94f2=function(_0x271c16,_0x30db11){_0x271c16=_0x271c16-0x0;var _0x146ed7=_0x4f29[_0x271c16];return _0x146ed7;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x94f2('0x0'));var rimraf=require(_0x94f2('0x1'));var zipdir=require(_0x94f2('0x2'));var jsonpatch=require(_0x94f2('0x3'));var rp=require(_0x94f2('0x4'));var moment=require(_0x94f2('0x5'));var BPromise=require(_0x94f2('0x6'));var Mustache=require(_0x94f2('0x7'));var util=require(_0x94f2('0x8'));var path=require(_0x94f2('0x9'));var sox=require(_0x94f2('0xa'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x94f2('0xb'));var squel=require(_0x94f2('0xc'));var crypto=require(_0x94f2('0xd'));var jsforce=require(_0x94f2('0xe'));var deskjs=require(_0x94f2('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x94f2('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x94f2('0x11'));var as=require(_0x94f2('0x12'));var hardwareService=require(_0x94f2('0x13'));var logger=require(_0x94f2('0x14'))('api');var utils=require(_0x94f2('0x15'));var config=require(_0x94f2('0x16'));var db=require(_0x94f2('0x17'))['db'];var jayson=require(_0x94f2('0x18'));var client=jayson[_0x94f2('0x19')][_0x94f2('0x1a')]({'port':0x232a});function checkPasswordPattern(_0x39a8c5,_0x490142,_0x3b67db){if(_0x3b67db){var _0x54ee65=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x54ee65[_0x94f2('0x1b')](_0x490142)){return _0x39a8c5;}else{throw new db[(_0x94f2('0x1c'))][(_0x94f2('0x1d'))]('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x39a8c5;}}function respondWithRpcPromise(_0x5c4182,_0x292953,_0x1ae29d,_0x28d8a7){return new BPromise(function(_0x5db427,_0x8496f1){var _0x21301b=_0x28d8a7||client;return _0x21301b['request'](_0x5c4182,_0x1ae29d)['then'](function(_0x423aa8){logger[_0x94f2('0x1e')](_0x94f2('0x1f'),_0x292953,'request\x20sent');logger[_0x94f2('0x20')](_0x94f2('0x21'),_0x292953,_0x94f2('0x22'),JSON[_0x94f2('0x23')](_0x423aa8));if(_0x423aa8['error']){if(_0x423aa8[_0x94f2('0x24')][_0x94f2('0x25')]===0x1f4){logger['error'](_0x94f2('0x1f'),_0x292953,_0x423aa8[_0x94f2('0x24')][_0x94f2('0x26')]);return _0x8496f1(_0x423aa8[_0x94f2('0x24')][_0x94f2('0x26')]);}logger[_0x94f2('0x24')](_0x94f2('0x1f'),_0x292953,_0x423aa8[_0x94f2('0x24')][_0x94f2('0x26')]);return _0x5db427(_0x423aa8[_0x94f2('0x24')][_0x94f2('0x26')]);}else{logger[_0x94f2('0x1e')](_0x94f2('0x1f'),_0x292953,_0x94f2('0x22'));_0x5db427(_0x423aa8['result'][_0x94f2('0x26')]);}})[_0x94f2('0x27')](function(_0x5e25ae){logger[_0x94f2('0x24')](_0x94f2('0x1f'),_0x292953,_0x5e25ae);_0x8496f1(_0x5e25ae);});});}function respondWithStatusCode(_0x5955ce,_0x5f1a6a){_0x5f1a6a=_0x5f1a6a||0xcc;return function(_0x497291){if(_0x497291){return _0x5955ce['sendStatus'](_0x5f1a6a);}return _0x5955ce['status'](_0x5f1a6a)[_0x94f2('0x28')]();};}function respondWithResult(_0x1252eb,_0xed8d04){_0xed8d04=_0xed8d04||0xc8;return function(_0x14ae14){if(_0x14ae14){return _0x1252eb[_0x94f2('0x29')](_0xed8d04)['json'](_0x14ae14);}};}function respondWithFilteredResult(_0x1ccf31,_0x50e560){return function(_0x467d5a){if(_0x467d5a){var _0xd5b804=_0x467d5a[_0x94f2('0x2a')],_0x274659=_0x50e560[_0x94f2('0x2b')],_0x2c6463=_0x50e560[_0x94f2('0x2b')]+_0x50e560['limit'],_0x361920;if(_0x2c6463>=_0xd5b804){_0x2c6463=_0xd5b804;_0x361920=0xc8;}else{_0x361920=0xce;}_0x1ccf31[_0x94f2('0x29')](_0x361920);return _0x1ccf31[_0x94f2('0x2c')](_0x94f2('0x2d'),_0x274659+'-'+_0x2c6463+'/'+_0xd5b804)[_0x94f2('0x2e')](_0x467d5a);}return null;};}function patchUpdates(_0x547a48){return function(_0xd54694){try{jsonpatch['apply'](_0xd54694,_0x547a48,!![]);}catch(_0x246333){return BPromise[_0x94f2('0x2f')](_0x246333);}return _0xd54694[_0x94f2('0x30')]();};}function saveUpdates(_0x4c8c14,_0x4b5ce7){return function(_0x44b891){if(_0x44b891){return _0x44b891[_0x94f2('0x31')](_0x4c8c14)[_0x94f2('0x32')](function(_0x1dece2){return _0x1dece2;});}return null;};}function removeEntity(_0x25c0b0,_0x3c28b6){return function(_0x475a13){if(_0x475a13){return _0x475a13['destroy']()[_0x94f2('0x32')](function(){_0x25c0b0[_0x94f2('0x29')](0xcc)[_0x94f2('0x28')]();});}};}function handleEntityNotFound(_0xb5f868,_0x2250be){return function(_0x338b60){if(!_0x338b60){_0xb5f868['sendStatus'](0x194);}return _0x338b60;};}function handleError(_0x2fda05,_0x2ba9a4){_0x2ba9a4=_0x2ba9a4||0x1f4;return function(_0x452c99){logger[_0x94f2('0x24')](_0x452c99[_0x94f2('0x33')]);if(_0x452c99[_0x94f2('0x34')]){delete _0x452c99[_0x94f2('0x34')];}_0x2fda05[_0x94f2('0x29')](_0x2ba9a4)[_0x94f2('0x35')](_0x452c99);};}exports['index']=function(_0x39f4c2,_0x568dce){var _0x2822b5={},_0xf505e2={},_0x5ae2b9={'count':0x0,'rows':[]};var _0x3fec17=_[_0x94f2('0x36')](db[_0x94f2('0x37')][_0x94f2('0x38')],function(_0x29a194){return{'name':_0x29a194[_0x94f2('0x39')],'type':_0x29a194[_0x94f2('0x3a')][_0x94f2('0x3b')]};});_0xf505e2['model']=_[_0x94f2('0x36')](_0x3fec17,'name');_0xf505e2['query']=_[_0x94f2('0x3c')](_0x39f4c2['query']);_0xf505e2[_0x94f2('0x3d')]=_['intersection'](_0xf505e2['model'],_0xf505e2[_0x94f2('0x3e')]);_0x2822b5[_0x94f2('0x3f')]=_[_0x94f2('0x40')](_0xf505e2[_0x94f2('0x41')],qs['fields'](_0x39f4c2[_0x94f2('0x3e')][_0x94f2('0x42')]));_0x2822b5['attributes']=_0x2822b5[_0x94f2('0x3f')][_0x94f2('0x43')]?_0x2822b5[_0x94f2('0x3f')]:_0xf505e2[_0x94f2('0x41')];if(!_0x39f4c2['query'][_0x94f2('0x44')](_0x94f2('0x45'))){_0x2822b5[_0x94f2('0x46')]=qs['limit'](_0x39f4c2['query'][_0x94f2('0x46')]);_0x2822b5[_0x94f2('0x2b')]=qs[_0x94f2('0x2b')](_0x39f4c2[_0x94f2('0x3e')][_0x94f2('0x2b')]);}_0x2822b5[_0x94f2('0x47')]=qs[_0x94f2('0x48')](_0x39f4c2[_0x94f2('0x3e')][_0x94f2('0x48')]);_0x2822b5['where']=qs[_0x94f2('0x3d')](_[_0x94f2('0x49')](_0x39f4c2[_0x94f2('0x3e')],_0xf505e2['filters']),_0x3fec17);if(_0x39f4c2['query']['filter']){_0x2822b5[_0x94f2('0x4a')]=_[_0x94f2('0x4b')](_0x2822b5[_0x94f2('0x4a')],{'$or':_[_0x94f2('0x36')](_0x3fec17,function(_0x97a278){if(_0x97a278[_0x94f2('0x3a')]!==_0x94f2('0x4c')){var _0x17aab7={};_0x17aab7[_0x97a278[_0x94f2('0x34')]]={'$like':'%'+_0x39f4c2['query'][_0x94f2('0x4d')]+'%'};return _0x17aab7;}})});}_0x2822b5=_[_0x94f2('0x4b')]({},_0x2822b5,_0x39f4c2[_0x94f2('0x4e')]);var _0x360ed1={'where':_0x2822b5['where']};return db[_0x94f2('0x37')][_0x94f2('0x2a')](_0x360ed1)[_0x94f2('0x32')](function(_0x2ddcbc){_0x5ae2b9['count']=_0x2ddcbc;if(_0x39f4c2[_0x94f2('0x3e')][_0x94f2('0x4f')]){_0x2822b5[_0x94f2('0x50')]=[{'all':!![]}];}return db[_0x94f2('0x37')][_0x94f2('0x51')](_0x2822b5);})['then'](function(_0x33c6df){_0x5ae2b9[_0x94f2('0x52')]=_0x33c6df;return _0x5ae2b9;})[_0x94f2('0x32')](respondWithFilteredResult(_0x568dce,_0x2822b5))[_0x94f2('0x27')](handleError(_0x568dce,null));};exports['show']=function(_0x3a3514,_0x5d6e54){var _0x289203={'raw':![],'where':{'id':_0x3a3514['params']['id']}},_0x3559ee={};_0x3559ee['model']=_[_0x94f2('0x3c')](db['DeskConfiguration'][_0x94f2('0x38')]);_0x3559ee['query']=_[_0x94f2('0x3c')](_0x3a3514[_0x94f2('0x3e')]);_0x3559ee[_0x94f2('0x3d')]=_['intersection'](_0x3559ee['model'],_0x3559ee[_0x94f2('0x3e')]);_0x289203[_0x94f2('0x3f')]=_[_0x94f2('0x40')](_0x3559ee[_0x94f2('0x41')],qs[_0x94f2('0x42')](_0x3a3514['query'][_0x94f2('0x42')]));_0x289203[_0x94f2('0x3f')]=_0x289203[_0x94f2('0x3f')][_0x94f2('0x43')]?_0x289203[_0x94f2('0x3f')]:_0x3559ee[_0x94f2('0x41')];if(_0x3a3514[_0x94f2('0x3e')][_0x94f2('0x4f')]){_0x289203['include']=[{'all':!![]}];}_0x289203=_[_0x94f2('0x4b')]({},_0x289203,_0x3a3514[_0x94f2('0x4e')]);return db[_0x94f2('0x37')][_0x94f2('0x53')](_0x289203)[_0x94f2('0x32')](handleEntityNotFound(_0x5d6e54,null))[_0x94f2('0x32')](respondWithResult(_0x5d6e54,null))[_0x94f2('0x27')](handleError(_0x5d6e54,null));};exports[_0x94f2('0x54')]=function(_0x4aa31e,_0x25c972){return db['DeskConfiguration']['create'](_0x4aa31e[_0x94f2('0x55')],{})['then'](respondWithResult(_0x25c972,0xc9))['catch'](handleError(_0x25c972,null));};exports[_0x94f2('0x31')]=function(_0x49e30b,_0x329115){if(_0x49e30b['body']['id']){delete _0x49e30b['body']['id'];}return db[_0x94f2('0x37')][_0x94f2('0x53')]({'where':{'id':_0x49e30b[_0x94f2('0x56')]['id']}})[_0x94f2('0x32')](handleEntityNotFound(_0x329115,null))['then'](saveUpdates(_0x49e30b[_0x94f2('0x55')],null))[_0x94f2('0x32')](respondWithResult(_0x329115,null))[_0x94f2('0x27')](handleError(_0x329115,null));};exports[_0x94f2('0x57')]=function(_0x6d064a,_0x92c03d){return db[_0x94f2('0x37')][_0x94f2('0x53')]({'where':{'id':_0x6d064a[_0x94f2('0x56')]['id']}})['then'](handleEntityNotFound(_0x92c03d,null))[_0x94f2('0x32')](removeEntity(_0x92c03d,null))['catch'](handleError(_0x92c03d,null));};exports[_0x94f2('0x58')]=function(_0x2a4517,_0x4f2714,_0x3e3eb2){var _0x2b0292={};var _0x30bf5e={};var _0x2e77d1;var _0x155282;return db[_0x94f2('0x37')][_0x94f2('0x59')]({'where':{'id':_0x2a4517[_0x94f2('0x56')]['id']}})[_0x94f2('0x32')](handleEntityNotFound(_0x4f2714,null))[_0x94f2('0x32')](function(_0x263104){if(_0x263104){_0x2e77d1=_0x263104;_0x30bf5e[_0x94f2('0x41')]=_[_0x94f2('0x3c')](db['DeskField'][_0x94f2('0x38')]);_0x30bf5e[_0x94f2('0x3e')]=_[_0x94f2('0x3c')](_0x2a4517[_0x94f2('0x3e')]);_0x30bf5e[_0x94f2('0x3d')]=_[_0x94f2('0x40')](_0x30bf5e[_0x94f2('0x41')],_0x30bf5e['query']);_0x2b0292[_0x94f2('0x3f')]=_[_0x94f2('0x40')](_0x30bf5e[_0x94f2('0x41')],qs[_0x94f2('0x42')](_0x2a4517['query']['fields']));_0x2b0292[_0x94f2('0x3f')]=_0x2b0292['attributes'][_0x94f2('0x43')]?_0x2b0292[_0x94f2('0x3f')]:_0x30bf5e[_0x94f2('0x41')];_0x2b0292['order']=qs[_0x94f2('0x48')](_0x2a4517[_0x94f2('0x3e')][_0x94f2('0x48')]);_0x2b0292[_0x94f2('0x4a')]=qs['filters'](_['pick'](_0x2a4517[_0x94f2('0x3e')],_0x30bf5e[_0x94f2('0x3d')]));if(_0x2a4517[_0x94f2('0x3e')]['filter']){_0x2b0292[_0x94f2('0x4a')]=_[_0x94f2('0x4b')](_0x2b0292[_0x94f2('0x4a')],{'$or':_[_0x94f2('0x36')](_0x2b0292['attributes'],function(_0x15329e){var _0x967073={};_0x967073[_0x15329e]={'$like':'%'+_0x2a4517[_0x94f2('0x3e')][_0x94f2('0x4d')]+'%'};return _0x967073;})});}_0x2b0292=_['merge']({},_0x2b0292,_0x2a4517['options']);return _0x2e77d1['getFields'](_0x2b0292);}})[_0x94f2('0x32')](function(_0x5af59a){if(_0x5af59a){_0x155282=_0x5af59a[_0x94f2('0x43')];if(!_0x2a4517[_0x94f2('0x3e')][_0x94f2('0x44')](_0x94f2('0x45'))){_0x2b0292[_0x94f2('0x46')]=qs[_0x94f2('0x46')](_0x2a4517[_0x94f2('0x3e')][_0x94f2('0x46')]);_0x2b0292[_0x94f2('0x2b')]=qs['offset'](_0x2a4517[_0x94f2('0x3e')][_0x94f2('0x2b')]);}return _0x2e77d1[_0x94f2('0x58')](_0x2b0292);}})[_0x94f2('0x32')](function(_0x5ab919){if(_0x5ab919){return _0x5ab919?{'count':_0x155282,'rows':_0x5ab919}:null;}})[_0x94f2('0x32')](respondWithResult(_0x4f2714,null))[_0x94f2('0x27')](handleError(_0x4f2714,null));};exports[_0x94f2('0x5a')]=function(_0x53c14e,_0xc16f68,_0x3ca0be){var _0x334faa={};var _0x54589c={};var _0x4ee6a6;var _0x37f495;return db[_0x94f2('0x37')][_0x94f2('0x59')]({'where':{'id':_0x53c14e[_0x94f2('0x56')]['id']}})['then'](handleEntityNotFound(_0xc16f68,null))[_0x94f2('0x32')](function(_0x9689a0){if(_0x9689a0){_0x4ee6a6=_0x9689a0;_0x54589c[_0x94f2('0x41')]=_['keys'](db['DeskField'][_0x94f2('0x38')]);_0x54589c[_0x94f2('0x3e')]=_[_0x94f2('0x3c')](_0x53c14e[_0x94f2('0x3e')]);_0x54589c[_0x94f2('0x3d')]=_[_0x94f2('0x40')](_0x54589c[_0x94f2('0x41')],_0x54589c[_0x94f2('0x3e')]);_0x334faa[_0x94f2('0x3f')]=_['intersection'](_0x54589c['model'],qs[_0x94f2('0x42')](_0x53c14e[_0x94f2('0x3e')][_0x94f2('0x42')]));_0x334faa[_0x94f2('0x3f')]=_0x334faa[_0x94f2('0x3f')][_0x94f2('0x43')]?_0x334faa[_0x94f2('0x3f')]:_0x54589c[_0x94f2('0x41')];_0x334faa[_0x94f2('0x47')]=qs[_0x94f2('0x48')](_0x53c14e[_0x94f2('0x3e')][_0x94f2('0x48')]);_0x334faa['where']=qs[_0x94f2('0x3d')](_[_0x94f2('0x49')](_0x53c14e[_0x94f2('0x3e')],_0x54589c[_0x94f2('0x3d')]));if(_0x53c14e[_0x94f2('0x3e')][_0x94f2('0x4d')]){_0x334faa['where']=_[_0x94f2('0x4b')](_0x334faa[_0x94f2('0x4a')],{'$or':_[_0x94f2('0x36')](_0x334faa[_0x94f2('0x3f')],function(_0x4d40c7){var _0x2fc305={};_0x2fc305[_0x4d40c7]={'$like':'%'+_0x53c14e[_0x94f2('0x3e')][_0x94f2('0x4d')]+'%'};return _0x2fc305;})});}_0x334faa=_[_0x94f2('0x4b')]({},_0x334faa,_0x53c14e[_0x94f2('0x4e')]);return _0x4ee6a6[_0x94f2('0x5a')](_0x334faa);}})[_0x94f2('0x32')](function(_0x100129){if(_0x100129){_0x37f495=_0x100129[_0x94f2('0x43')];if(!_0x53c14e[_0x94f2('0x3e')][_0x94f2('0x44')](_0x94f2('0x45'))){_0x334faa[_0x94f2('0x46')]=qs['limit'](_0x53c14e[_0x94f2('0x3e')]['limit']);_0x334faa[_0x94f2('0x2b')]=qs[_0x94f2('0x2b')](_0x53c14e[_0x94f2('0x3e')]['offset']);}return _0x4ee6a6['getSubjects'](_0x334faa);}})[_0x94f2('0x32')](function(_0x54940c){if(_0x54940c){return _0x54940c?{'count':_0x37f495,'rows':_0x54940c}:null;}})['then'](respondWithResult(_0xc16f68,null))[_0x94f2('0x27')](handleError(_0xc16f68,null));};exports[_0x94f2('0x5b')]=function(_0x3bce7b,_0x402576,_0x28836b){var _0x2383d5={};var _0x5cd80a={};var _0x3ab5ef;var _0xd54900;return db[_0x94f2('0x37')][_0x94f2('0x59')]({'where':{'id':_0x3bce7b[_0x94f2('0x56')]['id']}})[_0x94f2('0x32')](handleEntityNotFound(_0x402576,null))[_0x94f2('0x32')](function(_0x83e3e7){if(_0x83e3e7){_0x3ab5ef=_0x83e3e7;_0x5cd80a[_0x94f2('0x41')]=_['keys'](db[_0x94f2('0x5c')][_0x94f2('0x38')]);_0x5cd80a[_0x94f2('0x3e')]=_[_0x94f2('0x3c')](_0x3bce7b[_0x94f2('0x3e')]);_0x5cd80a[_0x94f2('0x3d')]=_[_0x94f2('0x40')](_0x5cd80a['model'],_0x5cd80a['query']);_0x2383d5[_0x94f2('0x3f')]=_[_0x94f2('0x40')](_0x5cd80a['model'],qs['fields'](_0x3bce7b[_0x94f2('0x3e')][_0x94f2('0x42')]));_0x2383d5[_0x94f2('0x3f')]=_0x2383d5[_0x94f2('0x3f')][_0x94f2('0x43')]?_0x2383d5[_0x94f2('0x3f')]:_0x5cd80a[_0x94f2('0x41')];_0x2383d5[_0x94f2('0x47')]=qs['sort'](_0x3bce7b[_0x94f2('0x3e')]['sort']);_0x2383d5[_0x94f2('0x4a')]=qs['filters'](_[_0x94f2('0x49')](_0x3bce7b[_0x94f2('0x3e')],_0x5cd80a[_0x94f2('0x3d')]));if(_0x3bce7b['query'][_0x94f2('0x4d')]){_0x2383d5[_0x94f2('0x4a')]=_[_0x94f2('0x4b')](_0x2383d5[_0x94f2('0x4a')],{'$or':_[_0x94f2('0x36')](_0x2383d5['attributes'],function(_0x31bd7f){var _0x2a1dc6={};_0x2a1dc6[_0x31bd7f]={'$like':'%'+_0x3bce7b['query']['filter']+'%'};return _0x2a1dc6;})});}_0x2383d5=_[_0x94f2('0x4b')]({},_0x2383d5,_0x3bce7b[_0x94f2('0x4e')]);return _0x3ab5ef[_0x94f2('0x5b')](_0x2383d5);}})[_0x94f2('0x32')](function(_0x3f6530){if(_0x3f6530){_0xd54900=_0x3f6530[_0x94f2('0x43')];if(!_0x3bce7b[_0x94f2('0x3e')][_0x94f2('0x44')](_0x94f2('0x45'))){_0x2383d5[_0x94f2('0x46')]=qs['limit'](_0x3bce7b['query'][_0x94f2('0x46')]);_0x2383d5[_0x94f2('0x2b')]=qs[_0x94f2('0x2b')](_0x3bce7b[_0x94f2('0x3e')][_0x94f2('0x2b')]);}return _0x3ab5ef[_0x94f2('0x5b')](_0x2383d5);}})[_0x94f2('0x32')](function(_0x235eb0){if(_0x235eb0){return _0x235eb0?{'count':_0xd54900,'rows':_0x235eb0}:null;}})['then'](respondWithResult(_0x402576,null))[_0x94f2('0x27')](handleError(_0x402576,null));};exports[_0x94f2('0x5d')]=function(_0x3b08a6,_0xd944e0,_0x2af872){var _0x15af9f={};var _0x5e9803={};var _0x16fc3d;var _0x30130a;return db[_0x94f2('0x37')][_0x94f2('0x59')]({'where':{'id':_0x3b08a6['params']['id']}})[_0x94f2('0x32')](handleEntityNotFound(_0xd944e0,null))[_0x94f2('0x32')](function(_0x93f821){if(_0x93f821){_0x16fc3d=_0x93f821;_0x5e9803[_0x94f2('0x41')]=_[_0x94f2('0x3c')](db[_0x94f2('0x5e')][_0x94f2('0x38')]);_0x5e9803[_0x94f2('0x3e')]=_[_0x94f2('0x3c')](_0x3b08a6[_0x94f2('0x3e')]);_0x5e9803[_0x94f2('0x3d')]=_[_0x94f2('0x40')](_0x5e9803[_0x94f2('0x41')],_0x5e9803[_0x94f2('0x3e')]);_0x15af9f[_0x94f2('0x3f')]=_[_0x94f2('0x40')](_0x5e9803[_0x94f2('0x41')],qs[_0x94f2('0x42')](_0x3b08a6[_0x94f2('0x3e')][_0x94f2('0x42')]));_0x15af9f[_0x94f2('0x3f')]=_0x15af9f['attributes'][_0x94f2('0x43')]?_0x15af9f['attributes']:_0x5e9803[_0x94f2('0x41')];_0x15af9f[_0x94f2('0x47')]=qs[_0x94f2('0x48')](_0x3b08a6[_0x94f2('0x3e')][_0x94f2('0x48')]);_0x15af9f['where']=qs[_0x94f2('0x3d')](_[_0x94f2('0x49')](_0x3b08a6['query'],_0x5e9803[_0x94f2('0x3d')]));if(_0x3b08a6['query'][_0x94f2('0x4d')]){_0x15af9f[_0x94f2('0x4a')]=_['merge'](_0x15af9f[_0x94f2('0x4a')],{'$or':_[_0x94f2('0x36')](_0x15af9f[_0x94f2('0x3f')],function(_0x56ed61){var _0xe53bd1={};_0xe53bd1[_0x56ed61]={'$like':'%'+_0x3b08a6[_0x94f2('0x3e')][_0x94f2('0x4d')]+'%'};return _0xe53bd1;})});}_0x15af9f=_[_0x94f2('0x4b')]({},_0x15af9f,_0x3b08a6['options']);return _0x16fc3d['getTags'](_0x15af9f);}})[_0x94f2('0x32')](function(_0x399229){if(_0x399229){_0x30130a=_0x399229[_0x94f2('0x43')];if(!_0x3b08a6[_0x94f2('0x3e')]['hasOwnProperty']('nolimit')){_0x15af9f[_0x94f2('0x46')]=qs[_0x94f2('0x46')](_0x3b08a6['query'][_0x94f2('0x46')]);_0x15af9f[_0x94f2('0x2b')]=qs[_0x94f2('0x2b')](_0x3b08a6['query']['offset']);}return _0x16fc3d[_0x94f2('0x5d')](_0x15af9f);}})['then'](function(_0x1d48a1){if(_0x1d48a1){return _0x1d48a1?{'count':_0x30130a,'rows':_0x1d48a1}:null;}})['then'](respondWithResult(_0xd944e0,null))['catch'](handleError(_0xd944e0,null));};exports[_0x94f2('0x5f')]=function(_0x236a8,_0x303ae2,_0x296888){if(_0x236a8[_0x94f2('0x55')]['id']){delete _0x236a8[_0x94f2('0x55')]['id'];}return db[_0x94f2('0x37')]['findOne']({'where':{'id':_0x236a8[_0x94f2('0x56')]['id']}})[_0x94f2('0x32')](handleEntityNotFound(_0x303ae2,null))[_0x94f2('0x32')](function(_0x3fc22f){if(_0x3fc22f){return _0x3fc22f['setTags'](_0x236a8[_0x94f2('0x55')][_0x94f2('0x60')]||[]);}return null;})[_0x94f2('0x32')](respondWithResult(_0x303ae2,null))[_0x94f2('0x27')](handleError(_0x303ae2,null));};
\ No newline at end of file
diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.model.js b/server/api/intDeskConfiguration/intDeskConfiguration.model.js
index ac2f869..6e8e7c5 100644
--- a/server/api/intDeskConfiguration/intDeskConfiguration.model.js
+++ b/server/api/intDeskConfiguration/intDeskConfiguration.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xb92b=['moment','rimraf','../../config/environment','./intDeskConfiguration.attributes','exports','define','DeskConfiguration','int_desk_configurations','lodash','util','../../config/logger','api'];(function(_0x7661e0,_0x3bbd7b){var _0xa30c06=function(_0x124e29){while(--_0x124e29){_0x7661e0['push'](_0x7661e0['shift']());}};_0xa30c06(++_0x3bbd7b);}(_0xb92b,0xf8));var _0xbb92=function(_0x5ba3d7,_0x222974){_0x5ba3d7=_0x5ba3d7-0x0;var _0x5b0dbc=_0xb92b[_0x5ba3d7];return _0x5b0dbc;};'use strict';var _=require(_0xbb92('0x0'));var util=require(_0xbb92('0x1'));var logger=require(_0xbb92('0x2'))(_0xbb92('0x3'));var moment=require(_0xbb92('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xbb92('0x5'));var config=require(_0xbb92('0x6'));var attributes=require(_0xbb92('0x7'));module[_0xbb92('0x8')]=function(_0x849a82,_0x2ef0b9){return _0x849a82[_0xbb92('0x9')](_0xbb92('0xa'),attributes,{'tableName':_0xbb92('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x5064=['api','moment','bluebird','path','rimraf','./intDeskConfiguration.attributes','exports','DeskConfiguration','int_desk_configurations','lodash','util','../../config/logger'];(function(_0x384295,_0x1f5064){var _0x39e77f=function(_0x113344){while(--_0x113344){_0x384295['push'](_0x384295['shift']());}};_0x39e77f(++_0x1f5064);}(_0x5064,0xa5));var _0x4506=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x5064[_0x3b380d];return _0x54502b;};'use strict';var _=require(_0x4506('0x0'));var util=require(_0x4506('0x1'));var logger=require(_0x4506('0x2'))(_0x4506('0x3'));var moment=require(_0x4506('0x4'));var BPromise=require(_0x4506('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4506('0x6'));var rimraf=require(_0x4506('0x7'));var config=require('../../config/environment');var attributes=require(_0x4506('0x8'));module[_0x4506('0x9')]=function(_0x4df31f,_0x4534c1){return _0x4df31f['define'](_0x4506('0xa'),attributes,{'tableName':_0x4506('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.rpc.js b/server/api/intDeskConfiguration/intDeskConfiguration.rpc.js
index ff8b385..7293714 100644
--- a/server/api/intDeskConfiguration/intDeskConfiguration.rpc.js
+++ b/server/api/intDeskConfiguration/intDeskConfiguration.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xb6b8=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','request','then','info','DeskConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','DeskConfiguration,\x20%s,\x20%s','message','result','catch','util'];(function(_0x3d4a2b,_0xca71a8){var _0x5c55c6=function(_0x46c01a){while(--_0x46c01a){_0x3d4a2b['push'](_0x3d4a2b['shift']());}};_0x5c55c6(++_0xca71a8);}(_0xb6b8,0xc5));var _0x8b6b=function(_0x432355,_0x4e7a24){_0x432355=_0x432355-0x0;var _0x26762b=_0xb6b8[_0x432355];return _0x26762b;};'use strict';var _=require('lodash');var util=require(_0x8b6b('0x0'));var moment=require(_0x8b6b('0x1'));var BPromise=require(_0x8b6b('0x2'));var rs=require(_0x8b6b('0x3'));var fs=require('fs');var Redis=require(_0x8b6b('0x4'));var db=require(_0x8b6b('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x8b6b('0x6'))(_0x8b6b('0x7'));var config=require(_0x8b6b('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x8b6b('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x56da2a,_0x21bbc2,_0x303c21){return new BPromise(function(_0x142239,_0x21c84e){return client[_0x8b6b('0xa')](_0x56da2a,_0x303c21)[_0x8b6b('0xb')](function(_0x1f2c39){logger[_0x8b6b('0xc')]('DeskConfiguration,\x20%s,\x20%s',_0x21bbc2,'request\x20sent');logger['debug'](_0x8b6b('0xd'),_0x21bbc2,_0x8b6b('0xe'),JSON[_0x8b6b('0xf')](_0x1f2c39));if(_0x1f2c39['error']){if(_0x1f2c39[_0x8b6b('0x10')][_0x8b6b('0x11')]===0x1f4){logger['error'](_0x8b6b('0x12'),_0x21bbc2,_0x1f2c39['error'][_0x8b6b('0x13')]);return _0x21c84e(_0x1f2c39[_0x8b6b('0x10')]['message']);}logger['error'](_0x8b6b('0x12'),_0x21bbc2,_0x1f2c39['error'][_0x8b6b('0x13')]);return _0x142239(_0x1f2c39[_0x8b6b('0x10')][_0x8b6b('0x13')]);}else{logger[_0x8b6b('0xc')](_0x8b6b('0x12'),_0x21bbc2,'request\x20sent');_0x142239(_0x1f2c39[_0x8b6b('0x14')][_0x8b6b('0x13')]);}})[_0x8b6b('0x15')](function(_0x2d16c7){logger[_0x8b6b('0x10')](_0x8b6b('0x12'),_0x21bbc2,_0x2d16c7);_0x21c84e(_0x2d16c7);});});}
\ No newline at end of file
+var _0x9bb4=['error','code','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','DeskConfiguration,\x20%s,\x20%s','request\x20sent','DeskConfiguration,\x20%s,\x20%s,\x20%s'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x9bb4,0xd5));var _0x49bb=function(_0x128f02,_0x3183d3){_0x128f02=_0x128f02-0x0;var _0x3869c1=_0x9bb4[_0x128f02];return _0x3869c1;};'use strict';var _=require(_0x49bb('0x0'));var util=require(_0x49bb('0x1'));var moment=require(_0x49bb('0x2'));var BPromise=require(_0x49bb('0x3'));var rs=require(_0x49bb('0x4'));var fs=require('fs');var Redis=require(_0x49bb('0x5'));var db=require(_0x49bb('0x6'))['db'];var utils=require(_0x49bb('0x7'));var logger=require(_0x49bb('0x8'))('rpc');var config=require(_0x49bb('0x9'));var jayson=require(_0x49bb('0xa'));var client=jayson[_0x49bb('0xb')][_0x49bb('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x4d603d,_0x15c24c,_0x353853){return new BPromise(function(_0x1a4094,_0x2967d4){return client[_0x49bb('0xd')](_0x4d603d,_0x353853)['then'](function(_0x6ba4a2){logger['info'](_0x49bb('0xe'),_0x15c24c,_0x49bb('0xf'));logger['debug'](_0x49bb('0x10'),_0x15c24c,'request\x20sent',JSON['stringify'](_0x6ba4a2));if(_0x6ba4a2[_0x49bb('0x11')]){if(_0x6ba4a2['error'][_0x49bb('0x12')]===0x1f4){logger[_0x49bb('0x11')](_0x49bb('0xe'),_0x15c24c,_0x6ba4a2[_0x49bb('0x11')][_0x49bb('0x13')]);return _0x2967d4(_0x6ba4a2[_0x49bb('0x11')][_0x49bb('0x13')]);}logger[_0x49bb('0x11')](_0x49bb('0xe'),_0x15c24c,_0x6ba4a2['error'][_0x49bb('0x13')]);return _0x1a4094(_0x6ba4a2['error'][_0x49bb('0x13')]);}else{logger[_0x49bb('0x14')](_0x49bb('0xe'),_0x15c24c,_0x49bb('0xf'));_0x1a4094(_0x6ba4a2[_0x49bb('0x15')][_0x49bb('0x13')]);}})[_0x49bb('0x16')](function(_0x11bc5f){logger['error'](_0x49bb('0xe'),_0x15c24c,_0x11bc5f);_0x2967d4(_0x11bc5f);});});}
\ No newline at end of file
diff --git a/server/api/intDeskField/index.js b/server/api/intDeskField/index.js
index c8b2b5c..2fdd860 100644
--- a/server/api/intDeskField/index.js
+++ b/server/api/intDeskField/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x53e6=['post','put','update','/:id','destroy','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDeskField.controller','get','isAuthenticated','index','show'];(function(_0x508e00,_0x25fa22){var _0x5eed45=function(_0x1a1de9){while(--_0x1a1de9){_0x508e00['push'](_0x508e00['shift']());}};_0x5eed45(++_0x25fa22);}(_0x53e6,0x8a));var _0x653e=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x53e6[_0x42cae2];return _0x5f256f;};'use strict';var multer=require(_0x653e('0x0'));var util=require(_0x653e('0x1'));var path=require(_0x653e('0x2'));var timeout=require(_0x653e('0x3'));var express=require(_0x653e('0x4'));var router=express[_0x653e('0x5')]();var auth=require(_0x653e('0x6'));var interaction=require(_0x653e('0x7'));var config=require(_0x653e('0x8'));var controller=require(_0x653e('0x9'));router[_0x653e('0xa')]('/',auth[_0x653e('0xb')](),controller[_0x653e('0xc')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0x653e('0xd')]);router[_0x653e('0xe')]('/',auth['isAuthenticated'](),controller['create']);router[_0x653e('0xf')]('/:id',auth[_0x653e('0xb')](),controller[_0x653e('0x10')]);router['delete'](_0x653e('0x11'),auth[_0x653e('0xb')](),controller[_0x653e('0x12')]);module['exports']=router;
\ No newline at end of file
+var _0x13ca=['./intDeskField.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','exports','multer','path','connect-timeout','Router'];(function(_0x399552,_0x498cb1){var _0x236cfd=function(_0x2f4a9b){while(--_0x2f4a9b){_0x399552['push'](_0x399552['shift']());}};_0x236cfd(++_0x498cb1);}(_0x13ca,0x1bc));var _0xa13c=function(_0x14de14,_0xf2445e){_0x14de14=_0x14de14-0x0;var _0x150dd5=_0x13ca[_0x14de14];return _0x150dd5;};'use strict';var multer=require(_0xa13c('0x0'));var util=require('util');var path=require(_0xa13c('0x1'));var timeout=require(_0xa13c('0x2'));var express=require('express');var router=express[_0xa13c('0x3')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xa13c('0x4'));router[_0xa13c('0x5')]('/',auth[_0xa13c('0x6')](),controller[_0xa13c('0x7')]);router[_0xa13c('0x5')](_0xa13c('0x8'),auth[_0xa13c('0x6')](),controller[_0xa13c('0x9')]);router[_0xa13c('0xa')]('/',auth[_0xa13c('0x6')](),controller[_0xa13c('0xb')]);router[_0xa13c('0xc')](_0xa13c('0x8'),auth[_0xa13c('0x6')](),controller[_0xa13c('0xd')]);router[_0xa13c('0xe')](_0xa13c('0x8'),auth['isAuthenticated'](),controller['destroy']);module[_0xa13c('0xf')]=router;
\ No newline at end of file
diff --git a/server/api/intDeskField/intDeskField.attributes.js b/server/api/intDeskField/intDeskField.attributes.js
index dda4a6d..c0bde96 100644
--- a/server/api/intDeskField/intDeskField.attributes.js
+++ b/server/api/intDeskField/intDeskField.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xf46d=['customVariable','string','STRING','ENUM','variable'];(function(_0x40bffc,_0x3a45d7){var _0x3007e9=function(_0x4c8fda){while(--_0x4c8fda){_0x40bffc['push'](_0x40bffc['shift']());}};_0x3007e9(++_0x3a45d7);}(_0xf46d,0xb7));var _0xdf46=function(_0x2ae8ce,_0x2a5a1f){_0x2ae8ce=_0x2ae8ce-0x0;var _0x4bf686=_0xf46d[_0x2ae8ce];return _0x4bf686;};'use strict';var Sequelize=require('sequelize');module['exports']={'type':{'type':Sequelize[_0xdf46('0x0')]('string',_0xdf46('0x1'),_0xdf46('0x2'),'keyValue'),'defaultValue':_0xdf46('0x3')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0xdf46('0x0')](_0xdf46('0x3'),_0xdf46('0x1'),_0xdf46('0x2'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0xdf46('0x4')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0xf94a=['BOOLEAN','ENUM','string','variable','customVariable','keyValue','STRING'];(function(_0x189da6,_0x5d2378){var _0x259e67=function(_0x5e8c95){while(--_0x5e8c95){_0x189da6['push'](_0x189da6['shift']());}};_0x259e67(++_0x5d2378);}(_0xf94a,0x1c1));var _0xaf94=function(_0x279897,_0x568eea){_0x279897=_0x279897-0x0;var _0x5997ac=_0xf94a[_0x279897];return _0x5997ac;};'use strict';var Sequelize=require('sequelize');module['exports']={'type':{'type':Sequelize[_0xaf94('0x0')](_0xaf94('0x1'),_0xaf94('0x2'),_0xaf94('0x3'),_0xaf94('0x4')),'defaultValue':_0xaf94('0x1')},'content':{'type':Sequelize[_0xaf94('0x5')]},'key':{'type':Sequelize[_0xaf94('0x5')]},'keyType':{'type':Sequelize[_0xaf94('0x0')](_0xaf94('0x1'),_0xaf94('0x2'),_0xaf94('0x3'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0xaf94('0x5')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0xaf94('0x6')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xaf94('0x5')]}};
\ No newline at end of file
diff --git a/server/api/intDeskField/intDeskField.controller.js b/server/api/intDeskField/intDeskField.controller.js
index 3cbbf77..60820d2 100644
--- a/server/api/intDeskField/intDeskField.controller.js
+++ b/server/api/intDeskField/intDeskField.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x0bad=['filters','intersection','attributes','fields','length','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','include','find','create','body','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','sox','ejs','squel','crypto','desk.js','to-csv','querystring','papaparse','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','save','update','then','destroy','error','stack','name','send','index','map','DeskField','rawAttributes','type','key','model','query','keys'];(function(_0x2cd936,_0x3151a3){var _0xe30a9b=function(_0x435996){while(--_0x435996){_0x2cd936['push'](_0x2cd936['shift']());}};_0xe30a9b(++_0x3151a3);}(_0x0bad,0x1a1));var _0xd0ba=function(_0x415b10,_0x55fd39){_0x415b10=_0x415b10-0x0;var _0x55e550=_0x0bad[_0x415b10];return _0x55e550;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xd0ba('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xd0ba('0x1'));var rp=require(_0xd0ba('0x2'));var moment=require(_0xd0ba('0x3'));var BPromise=require(_0xd0ba('0x4'));var Mustache=require(_0xd0ba('0x5'));var util=require('util');var path=require('path');var sox=require(_0xd0ba('0x6'));var csv=require('to-csv');var ejs=require(_0xd0ba('0x7'));var fs=require('fs');var _=require('lodash');var squel=require(_0xd0ba('0x8'));var crypto=require(_0xd0ba('0x9'));var jsforce=require('jsforce');var deskjs=require(_0xd0ba('0xa'));var toCsv=require(_0xd0ba('0xb'));var querystring=require(_0xd0ba('0xc'));var Papa=require(_0xd0ba('0xd'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xd0ba('0xe'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xd0ba('0xf'))(_0xd0ba('0x10'));var utils=require(_0xd0ba('0x11'));var config=require('../../config/environment');var db=require(_0xd0ba('0x12'))['db'];function respondWithStatusCode(_0x3c794e,_0x4aa5fe){_0x4aa5fe=_0x4aa5fe||0xcc;return function(_0x25aa04){if(_0x25aa04){return _0x3c794e[_0xd0ba('0x13')](_0x4aa5fe);}return _0x3c794e[_0xd0ba('0x14')](_0x4aa5fe)[_0xd0ba('0x15')]();};}function respondWithResult(_0x5981e8,_0x1f946f){_0x1f946f=_0x1f946f||0xc8;return function(_0x35f551){if(_0x35f551){return _0x5981e8[_0xd0ba('0x14')](_0x1f946f)[_0xd0ba('0x16')](_0x35f551);}};}function respondWithFilteredResult(_0x5900e4,_0x1e2b46){return function(_0x3c5396){if(_0x3c5396){var _0x4cc521=_0x3c5396[_0xd0ba('0x17')],_0x26927b=_0x1e2b46[_0xd0ba('0x18')],_0x11b03f=_0x1e2b46[_0xd0ba('0x18')]+_0x1e2b46[_0xd0ba('0x19')],_0x438867;if(_0x11b03f>=_0x4cc521){_0x11b03f=_0x4cc521;_0x438867=0xc8;}else{_0x438867=0xce;}_0x5900e4['status'](_0x438867);return _0x5900e4[_0xd0ba('0x1a')](_0xd0ba('0x1b'),_0x26927b+'-'+_0x11b03f+'/'+_0x4cc521)['json'](_0x3c5396);}return null;};}function patchUpdates(_0x3fdc32){return function(_0xb3deea){try{jsonpatch['apply'](_0xb3deea,_0x3fdc32,!![]);}catch(_0x3ac123){return BPromise['reject'](_0x3ac123);}return _0xb3deea[_0xd0ba('0x1c')]();};}function saveUpdates(_0x1b982d,_0x501e75){return function(_0x7c72a7){if(_0x7c72a7){return _0x7c72a7[_0xd0ba('0x1d')](_0x1b982d)[_0xd0ba('0x1e')](function(_0x36da1f){return _0x36da1f;});}return null;};}function removeEntity(_0x521a72,_0x1a0b3a){return function(_0x2da56a){if(_0x2da56a){return _0x2da56a[_0xd0ba('0x1f')]()[_0xd0ba('0x1e')](function(){_0x521a72[_0xd0ba('0x14')](0xcc)[_0xd0ba('0x15')]();});}};}function handleEntityNotFound(_0x143a6e,_0x878c87){return function(_0x50dc62){if(!_0x50dc62){_0x143a6e[_0xd0ba('0x13')](0x194);}return _0x50dc62;};}function handleError(_0x35cd06,_0xdadb7c){_0xdadb7c=_0xdadb7c||0x1f4;return function(_0x351f38){logger[_0xd0ba('0x20')](_0x351f38[_0xd0ba('0x21')]);if(_0x351f38[_0xd0ba('0x22')]){delete _0x351f38[_0xd0ba('0x22')];}_0x35cd06['status'](_0xdadb7c)[_0xd0ba('0x23')](_0x351f38);};}exports[_0xd0ba('0x24')]=function(_0x38f845,_0x51611d){var _0x1ec45d={},_0x47b1dc={},_0x43485e={'count':0x0,'rows':[]};var _0x282a18=_[_0xd0ba('0x25')](db[_0xd0ba('0x26')][_0xd0ba('0x27')],function(_0x335975){return{'name':_0x335975['fieldName'],'type':_0x335975[_0xd0ba('0x28')][_0xd0ba('0x29')]};});_0x47b1dc[_0xd0ba('0x2a')]=_[_0xd0ba('0x25')](_0x282a18,_0xd0ba('0x22'));_0x47b1dc[_0xd0ba('0x2b')]=_[_0xd0ba('0x2c')](_0x38f845[_0xd0ba('0x2b')]);_0x47b1dc[_0xd0ba('0x2d')]=_[_0xd0ba('0x2e')](_0x47b1dc[_0xd0ba('0x2a')],_0x47b1dc[_0xd0ba('0x2b')]);_0x1ec45d[_0xd0ba('0x2f')]=_[_0xd0ba('0x2e')](_0x47b1dc['model'],qs[_0xd0ba('0x30')](_0x38f845['query'][_0xd0ba('0x30')]));_0x1ec45d[_0xd0ba('0x2f')]=_0x1ec45d['attributes'][_0xd0ba('0x31')]?_0x1ec45d[_0xd0ba('0x2f')]:_0x47b1dc[_0xd0ba('0x2a')];if(!_0x38f845['query']['hasOwnProperty']('nolimit')){_0x1ec45d[_0xd0ba('0x19')]=qs[_0xd0ba('0x19')](_0x38f845[_0xd0ba('0x2b')][_0xd0ba('0x19')]);_0x1ec45d[_0xd0ba('0x18')]=qs['offset'](_0x38f845[_0xd0ba('0x2b')]['offset']);}_0x1ec45d['order']=qs[_0xd0ba('0x32')](_0x38f845[_0xd0ba('0x2b')][_0xd0ba('0x32')]);_0x1ec45d[_0xd0ba('0x33')]=qs['filters'](_[_0xd0ba('0x34')](_0x38f845[_0xd0ba('0x2b')],_0x47b1dc[_0xd0ba('0x2d')]),_0x282a18);if(_0x38f845[_0xd0ba('0x2b')][_0xd0ba('0x35')]){_0x1ec45d[_0xd0ba('0x33')]=_[_0xd0ba('0x36')](_0x1ec45d['where'],{'$or':_['map'](_0x282a18,function(_0x1260e7){if(_0x1260e7[_0xd0ba('0x28')]!==_0xd0ba('0x37')){var _0x36ebc7={};_0x36ebc7[_0x1260e7['name']]={'$like':'%'+_0x38f845[_0xd0ba('0x2b')]['filter']+'%'};return _0x36ebc7;}})});}_0x1ec45d=_['merge']({},_0x1ec45d,_0x38f845[_0xd0ba('0x38')]);var _0x5492c9={'where':_0x1ec45d[_0xd0ba('0x33')]};return db[_0xd0ba('0x26')][_0xd0ba('0x17')](_0x5492c9)['then'](function(_0x2b8787){_0x43485e[_0xd0ba('0x17')]=_0x2b8787;if(_0x38f845[_0xd0ba('0x2b')][_0xd0ba('0x39')]){_0x1ec45d['include']=[{'all':!![]}];}return db[_0xd0ba('0x26')][_0xd0ba('0x3a')](_0x1ec45d);})[_0xd0ba('0x1e')](function(_0xf39ccd){_0x43485e[_0xd0ba('0x3b')]=_0xf39ccd;return _0x43485e;})[_0xd0ba('0x1e')](respondWithFilteredResult(_0x51611d,_0x1ec45d))[_0xd0ba('0x3c')](handleError(_0x51611d,null));};exports[_0xd0ba('0x3d')]=function(_0x5aef84,_0x44714c){var _0x37dc46={'raw':!![],'where':{'id':_0x5aef84['params']['id']}},_0x1b71fb={};_0x1b71fb[_0xd0ba('0x2a')]=_[_0xd0ba('0x2c')](db[_0xd0ba('0x26')][_0xd0ba('0x27')]);_0x1b71fb[_0xd0ba('0x2b')]=_[_0xd0ba('0x2c')](_0x5aef84[_0xd0ba('0x2b')]);_0x1b71fb[_0xd0ba('0x2d')]=_['intersection'](_0x1b71fb[_0xd0ba('0x2a')],_0x1b71fb[_0xd0ba('0x2b')]);_0x37dc46[_0xd0ba('0x2f')]=_[_0xd0ba('0x2e')](_0x1b71fb[_0xd0ba('0x2a')],qs[_0xd0ba('0x30')](_0x5aef84['query'][_0xd0ba('0x30')]));_0x37dc46['attributes']=_0x37dc46[_0xd0ba('0x2f')][_0xd0ba('0x31')]?_0x37dc46[_0xd0ba('0x2f')]:_0x1b71fb[_0xd0ba('0x2a')];if(_0x5aef84['query'][_0xd0ba('0x39')]){_0x37dc46[_0xd0ba('0x3e')]=[{'all':!![]}];}_0x37dc46=_[_0xd0ba('0x36')]({},_0x37dc46,_0x5aef84[_0xd0ba('0x38')]);return db[_0xd0ba('0x26')][_0xd0ba('0x3f')](_0x37dc46)['then'](handleEntityNotFound(_0x44714c,null))[_0xd0ba('0x1e')](respondWithResult(_0x44714c,null))[_0xd0ba('0x3c')](handleError(_0x44714c,null));};exports['create']=function(_0xd70ac7,_0x2013fe){return db[_0xd0ba('0x26')][_0xd0ba('0x40')](_0xd70ac7[_0xd0ba('0x41')],{})[_0xd0ba('0x1e')](respondWithResult(_0x2013fe,0xc9))[_0xd0ba('0x3c')](handleError(_0x2013fe,null));};exports[_0xd0ba('0x1d')]=function(_0x556692,_0x21a244){if(_0x556692[_0xd0ba('0x41')]['id']){delete _0x556692[_0xd0ba('0x41')]['id'];}return db[_0xd0ba('0x26')][_0xd0ba('0x3f')]({'where':{'id':_0x556692['params']['id']}})[_0xd0ba('0x1e')](handleEntityNotFound(_0x21a244,null))[_0xd0ba('0x1e')](saveUpdates(_0x556692['body'],null))[_0xd0ba('0x1e')](respondWithResult(_0x21a244,null))['catch'](handleError(_0x21a244,null));};exports[_0xd0ba('0x1f')]=function(_0x2b1381,_0x2d58fe){return db[_0xd0ba('0x26')]['find']({'where':{'id':_0x2b1381['params']['id']}})[_0xd0ba('0x1e')](handleEntityNotFound(_0x2d58fe,null))['then'](removeEntity(_0x2d58fe,null))['catch'](handleError(_0x2d58fe,null));};
\ No newline at end of file
+var _0x1dc8=['create','body','find','html-pdf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','DeskField','rawAttributes','fieldName','key','model','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','params'];(function(_0x22abc4,_0x289b22){var _0x500358=function(_0x5d98de){while(--_0x5d98de){_0x22abc4['push'](_0x22abc4['shift']());}};_0x500358(++_0x289b22);}(_0x1dc8,0xe1));var _0x81dc=function(_0xb2100,_0x564756){_0xb2100=_0xb2100-0x0;var _0x1e0748=_0x1dc8[_0xb2100];return _0x1e0748;};'use strict';var pdf=require(_0x81dc('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x81dc('0x1'));var jsonpatch=require(_0x81dc('0x2'));var rp=require(_0x81dc('0x3'));var moment=require('moment');var BPromise=require(_0x81dc('0x4'));var Mustache=require(_0x81dc('0x5'));var util=require('util');var path=require(_0x81dc('0x6'));var sox=require(_0x81dc('0x7'));var csv=require(_0x81dc('0x8'));var ejs=require(_0x81dc('0x9'));var fs=require('fs');var _=require(_0x81dc('0xa'));var squel=require(_0x81dc('0xb'));var crypto=require('crypto');var jsforce=require(_0x81dc('0xc'));var deskjs=require(_0x81dc('0xd'));var toCsv=require('to-csv');var querystring=require(_0x81dc('0xe'));var Papa=require(_0x81dc('0xf'));var Redis=require('ioredis');var authService=require(_0x81dc('0x10'));var qs=require(_0x81dc('0x11'));var as=require(_0x81dc('0x12'));var hardwareService=require(_0x81dc('0x13'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x81dc('0x14'));var db=require(_0x81dc('0x15'))['db'];function respondWithStatusCode(_0x2980c7,_0x2d0588){_0x2d0588=_0x2d0588||0xcc;return function(_0x188b37){if(_0x188b37){return _0x2980c7[_0x81dc('0x16')](_0x2d0588);}return _0x2980c7[_0x81dc('0x17')](_0x2d0588)[_0x81dc('0x18')]();};}function respondWithResult(_0x1f46d6,_0x439c34){_0x439c34=_0x439c34||0xc8;return function(_0x1cc8d2){if(_0x1cc8d2){return _0x1f46d6[_0x81dc('0x17')](_0x439c34)[_0x81dc('0x19')](_0x1cc8d2);}};}function respondWithFilteredResult(_0xbe1c78,_0x3754d5){return function(_0x175586){if(_0x175586){var _0x34344c=_0x175586[_0x81dc('0x1a')],_0x4faf4f=_0x3754d5[_0x81dc('0x1b')],_0x3bab0e=_0x3754d5['offset']+_0x3754d5[_0x81dc('0x1c')],_0x5c1cb7;if(_0x3bab0e>=_0x34344c){_0x3bab0e=_0x34344c;_0x5c1cb7=0xc8;}else{_0x5c1cb7=0xce;}_0xbe1c78[_0x81dc('0x17')](_0x5c1cb7);return _0xbe1c78[_0x81dc('0x1d')](_0x81dc('0x1e'),_0x4faf4f+'-'+_0x3bab0e+'/'+_0x34344c)[_0x81dc('0x19')](_0x175586);}return null;};}function patchUpdates(_0x1fd263){return function(_0x35fc32){try{jsonpatch[_0x81dc('0x1f')](_0x35fc32,_0x1fd263,!![]);}catch(_0x53819f){return BPromise[_0x81dc('0x20')](_0x53819f);}return _0x35fc32[_0x81dc('0x21')]();};}function saveUpdates(_0x54ccee,_0x4803f6){return function(_0x41d49c){if(_0x41d49c){return _0x41d49c[_0x81dc('0x22')](_0x54ccee)[_0x81dc('0x23')](function(_0xf79644){return _0xf79644;});}return null;};}function removeEntity(_0x45237e,_0x17dff0){return function(_0x51fe78){if(_0x51fe78){return _0x51fe78[_0x81dc('0x24')]()[_0x81dc('0x23')](function(){_0x45237e[_0x81dc('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3ab048,_0x4c5bd0){return function(_0x42ece7){if(!_0x42ece7){_0x3ab048[_0x81dc('0x16')](0x194);}return _0x42ece7;};}function handleError(_0x5b916f,_0x257120){_0x257120=_0x257120||0x1f4;return function(_0x4c84fd){logger[_0x81dc('0x25')](_0x4c84fd[_0x81dc('0x26')]);if(_0x4c84fd[_0x81dc('0x27')]){delete _0x4c84fd['name'];}_0x5b916f['status'](_0x257120)[_0x81dc('0x28')](_0x4c84fd);};}exports[_0x81dc('0x29')]=function(_0x58cc54,_0x5bd8be){var _0xe6f4df={},_0x440cb2={},_0x1a8381={'count':0x0,'rows':[]};var _0x50c48e=_[_0x81dc('0x2a')](db[_0x81dc('0x2b')][_0x81dc('0x2c')],function(_0x71116d){return{'name':_0x71116d[_0x81dc('0x2d')],'type':_0x71116d['type'][_0x81dc('0x2e')]};});_0x440cb2[_0x81dc('0x2f')]=_[_0x81dc('0x2a')](_0x50c48e,'name');_0x440cb2['query']=_[_0x81dc('0x30')](_0x58cc54['query']);_0x440cb2[_0x81dc('0x31')]=_[_0x81dc('0x32')](_0x440cb2[_0x81dc('0x2f')],_0x440cb2[_0x81dc('0x33')]);_0xe6f4df[_0x81dc('0x34')]=_[_0x81dc('0x32')](_0x440cb2[_0x81dc('0x2f')],qs[_0x81dc('0x35')](_0x58cc54[_0x81dc('0x33')][_0x81dc('0x35')]));_0xe6f4df[_0x81dc('0x34')]=_0xe6f4df[_0x81dc('0x34')][_0x81dc('0x36')]?_0xe6f4df['attributes']:_0x440cb2['model'];if(!_0x58cc54[_0x81dc('0x33')][_0x81dc('0x37')](_0x81dc('0x38'))){_0xe6f4df[_0x81dc('0x1c')]=qs['limit'](_0x58cc54[_0x81dc('0x33')][_0x81dc('0x1c')]);_0xe6f4df[_0x81dc('0x1b')]=qs[_0x81dc('0x1b')](_0x58cc54[_0x81dc('0x33')][_0x81dc('0x1b')]);}_0xe6f4df[_0x81dc('0x39')]=qs['sort'](_0x58cc54[_0x81dc('0x33')][_0x81dc('0x3a')]);_0xe6f4df[_0x81dc('0x3b')]=qs[_0x81dc('0x31')](_[_0x81dc('0x3c')](_0x58cc54[_0x81dc('0x33')],_0x440cb2[_0x81dc('0x31')]),_0x50c48e);if(_0x58cc54[_0x81dc('0x33')][_0x81dc('0x3d')]){_0xe6f4df[_0x81dc('0x3b')]=_['merge'](_0xe6f4df[_0x81dc('0x3b')],{'$or':_[_0x81dc('0x2a')](_0x50c48e,function(_0x51f476){if(_0x51f476['type']!==_0x81dc('0x3e')){var _0x1885f9={};_0x1885f9[_0x51f476[_0x81dc('0x27')]]={'$like':'%'+_0x58cc54[_0x81dc('0x33')][_0x81dc('0x3d')]+'%'};return _0x1885f9;}})});}_0xe6f4df=_[_0x81dc('0x3f')]({},_0xe6f4df,_0x58cc54[_0x81dc('0x40')]);var _0x4457e4={'where':_0xe6f4df[_0x81dc('0x3b')]};return db[_0x81dc('0x2b')][_0x81dc('0x1a')](_0x4457e4)[_0x81dc('0x23')](function(_0x1a5fc8){_0x1a8381[_0x81dc('0x1a')]=_0x1a5fc8;if(_0x58cc54[_0x81dc('0x33')][_0x81dc('0x41')]){_0xe6f4df[_0x81dc('0x42')]=[{'all':!![]}];}return db[_0x81dc('0x2b')][_0x81dc('0x43')](_0xe6f4df);})[_0x81dc('0x23')](function(_0x169916){_0x1a8381[_0x81dc('0x44')]=_0x169916;return _0x1a8381;})[_0x81dc('0x23')](respondWithFilteredResult(_0x5bd8be,_0xe6f4df))[_0x81dc('0x45')](handleError(_0x5bd8be,null));};exports['show']=function(_0x1cbe04,_0x594586){var _0xeb29f0={'raw':!![],'where':{'id':_0x1cbe04[_0x81dc('0x46')]['id']}},_0x1e0b73={};_0x1e0b73[_0x81dc('0x2f')]=_[_0x81dc('0x30')](db[_0x81dc('0x2b')][_0x81dc('0x2c')]);_0x1e0b73[_0x81dc('0x33')]=_[_0x81dc('0x30')](_0x1cbe04['query']);_0x1e0b73[_0x81dc('0x31')]=_['intersection'](_0x1e0b73[_0x81dc('0x2f')],_0x1e0b73[_0x81dc('0x33')]);_0xeb29f0['attributes']=_[_0x81dc('0x32')](_0x1e0b73[_0x81dc('0x2f')],qs[_0x81dc('0x35')](_0x1cbe04['query'][_0x81dc('0x35')]));_0xeb29f0[_0x81dc('0x34')]=_0xeb29f0['attributes']['length']?_0xeb29f0[_0x81dc('0x34')]:_0x1e0b73[_0x81dc('0x2f')];if(_0x1cbe04[_0x81dc('0x33')]['includeAll']){_0xeb29f0[_0x81dc('0x42')]=[{'all':!![]}];}_0xeb29f0=_['merge']({},_0xeb29f0,_0x1cbe04[_0x81dc('0x40')]);return db[_0x81dc('0x2b')]['find'](_0xeb29f0)[_0x81dc('0x23')](handleEntityNotFound(_0x594586,null))['then'](respondWithResult(_0x594586,null))[_0x81dc('0x45')](handleError(_0x594586,null));};exports[_0x81dc('0x47')]=function(_0x364ce6,_0x769d2c){return db['DeskField']['create'](_0x364ce6[_0x81dc('0x48')],{})[_0x81dc('0x23')](respondWithResult(_0x769d2c,0xc9))[_0x81dc('0x45')](handleError(_0x769d2c,null));};exports[_0x81dc('0x22')]=function(_0x5cbf2d,_0x446d77){if(_0x5cbf2d[_0x81dc('0x48')]['id']){delete _0x5cbf2d['body']['id'];}return db[_0x81dc('0x2b')][_0x81dc('0x49')]({'where':{'id':_0x5cbf2d[_0x81dc('0x46')]['id']}})['then'](handleEntityNotFound(_0x446d77,null))[_0x81dc('0x23')](saveUpdates(_0x5cbf2d['body'],null))[_0x81dc('0x23')](respondWithResult(_0x446d77,null))[_0x81dc('0x45')](handleError(_0x446d77,null));};exports[_0x81dc('0x24')]=function(_0x2e08ab,_0x2d6085){return db[_0x81dc('0x2b')][_0x81dc('0x49')]({'where':{'id':_0x2e08ab[_0x81dc('0x46')]['id']}})[_0x81dc('0x23')](handleEntityNotFound(_0x2d6085,null))[_0x81dc('0x23')](removeEntity(_0x2d6085,null))['catch'](handleError(_0x2d6085,null));};
\ No newline at end of file
diff --git a/server/api/intDeskField/intDeskField.model.js b/server/api/intDeskField/intDeskField.model.js
index b3c0e97..4e3b8d4 100644
--- a/server/api/intDeskField/intDeskField.model.js
+++ b/server/api/intDeskField/intDeskField.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x2d1a=['./intDeskField.attributes','exports','DeskField','desk_unique_index','FieldId','lodash','api','moment','bluebird','path','rimraf','../../config/environment'];(function(_0xd1e12,_0x4de0d6){var _0x596bc7=function(_0x3add16){while(--_0x3add16){_0xd1e12['push'](_0xd1e12['shift']());}};_0x596bc7(++_0x4de0d6);}(_0x2d1a,0x71));var _0xa2d1=function(_0x31e965,_0xbd1e54){_0x31e965=_0x31e965-0x0;var _0x120351=_0x2d1a[_0x31e965];return _0x120351;};'use strict';var _=require(_0xa2d1('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xa2d1('0x1'));var moment=require(_0xa2d1('0x2'));var BPromise=require(_0xa2d1('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa2d1('0x4'));var rimraf=require(_0xa2d1('0x5'));var config=require(_0xa2d1('0x6'));var attributes=require(_0xa2d1('0x7'));module[_0xa2d1('0x8')]=function(_0x4bf664,_0x3d39fd){return _0x4bf664['define'](_0xa2d1('0x9'),attributes,{'tableName':'int_desk_fields','paranoid':![],'indexes':[{'name':_0xa2d1('0xa'),'fields':['idField',_0xa2d1('0xb')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x4203=['util','api','bluebird','request-promise','path','rimraf','../../config/environment','define','int_desk_fields','desk_unique_index','idField','FieldId','lodash'];(function(_0x480c83,_0x1f8665){var _0x3368e0=function(_0xfb83fd){while(--_0xfb83fd){_0x480c83['push'](_0x480c83['shift']());}};_0x3368e0(++_0x1f8665);}(_0x4203,0x178));var _0x3420=function(_0xc67528,_0x24e2fb){_0xc67528=_0xc67528-0x0;var _0x38e26d=_0x4203[_0xc67528];return _0x38e26d;};'use strict';var _=require(_0x3420('0x0'));var util=require(_0x3420('0x1'));var logger=require('../../config/logger')(_0x3420('0x2'));var moment=require('moment');var BPromise=require(_0x3420('0x3'));var rp=require(_0x3420('0x4'));var fs=require('fs');var path=require(_0x3420('0x5'));var rimraf=require(_0x3420('0x6'));var config=require(_0x3420('0x7'));var attributes=require('./intDeskField.attributes');module['exports']=function(_0x279b3f,_0x2892e9){return _0x279b3f[_0x3420('0x8')]('DeskField',attributes,{'tableName':_0x3420('0x9'),'paranoid':![],'indexes':[{'name':_0x3420('0xa'),'fields':[_0x3420('0xb'),_0x3420('0xc')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/intDeskField/intDeskField.rpc.js b/server/api/intDeskField/intDeskField.rpc.js
index 71e74de..e4ceecd 100644
--- a/server/api/intDeskField/intDeskField.rpc.js
+++ b/server/api/intDeskField/intDeskField.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x6455=['client','http','request','then','info','DeskField,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x1bb549,_0x272f2b){var _0x82efe2=function(_0x58afd8){while(--_0x58afd8){_0x1bb549['push'](_0x1bb549['shift']());}};_0x82efe2(++_0x272f2b);}(_0x6455,0xf4));var _0x5645=function(_0x36e172,_0x22c664){_0x36e172=_0x36e172-0x0;var _0x482ad0=_0x6455[_0x36e172];return _0x482ad0;};'use strict';var _=require('lodash');var util=require(_0x5645('0x0'));var moment=require('moment');var BPromise=require(_0x5645('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5645('0x2'));var db=require(_0x5645('0x3'))['db'];var utils=require(_0x5645('0x4'));var logger=require(_0x5645('0x5'))(_0x5645('0x6'));var config=require(_0x5645('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x5645('0x8')][_0x5645('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5f3ed2,_0x588258,_0x59a99f){return new BPromise(function(_0x267c8e,_0x54af9e){return client[_0x5645('0xa')](_0x5f3ed2,_0x59a99f)[_0x5645('0xb')](function(_0x217582){logger[_0x5645('0xc')](_0x5645('0xd'),_0x588258,_0x5645('0xe'));logger['debug']('DeskField,\x20%s,\x20%s,\x20%s',_0x588258,_0x5645('0xe'),JSON[_0x5645('0xf')](_0x217582));if(_0x217582[_0x5645('0x10')]){if(_0x217582[_0x5645('0x10')][_0x5645('0x11')]===0x1f4){logger[_0x5645('0x10')](_0x5645('0xd'),_0x588258,_0x217582[_0x5645('0x10')][_0x5645('0x12')]);return _0x54af9e(_0x217582[_0x5645('0x10')][_0x5645('0x12')]);}logger[_0x5645('0x10')]('DeskField,\x20%s,\x20%s',_0x588258,_0x217582[_0x5645('0x10')][_0x5645('0x12')]);return _0x267c8e(_0x217582['error']['message']);}else{logger[_0x5645('0xc')](_0x5645('0xd'),_0x588258,_0x5645('0xe'));_0x267c8e(_0x217582[_0x5645('0x13')][_0x5645('0x12')]);}})[_0x5645('0x14')](function(_0x642862){logger[_0x5645('0x10')]('DeskField,\x20%s,\x20%s',_0x588258,_0x642862);_0x54af9e(_0x642862);});});}
\ No newline at end of file
+var _0x5539=['http','request','then','info','DeskField,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','lodash','bluebird','randomstring','../../config/utils','../../config/logger','rpc','jayson/promise','client'];(function(_0x383da5,_0x4d042b){var _0x38343b=function(_0x36a6bb){while(--_0x36a6bb){_0x383da5['push'](_0x383da5['shift']());}};_0x38343b(++_0x4d042b);}(_0x5539,0x172));var _0x9553=function(_0x4a7bf7,_0x34ffcc){_0x4a7bf7=_0x4a7bf7-0x0;var _0xbbd36c=_0x5539[_0x4a7bf7];return _0xbbd36c;};'use strict';var _=require(_0x9553('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x9553('0x1'));var rs=require(_0x9553('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x9553('0x3'));var logger=require(_0x9553('0x4'))(_0x9553('0x5'));var config=require('../../config/environment');var jayson=require(_0x9553('0x6'));var client=jayson[_0x9553('0x7')][_0x9553('0x8')]({'port':0x232a});function respondWithRpcPromise(_0xd5ae6d,_0x153e3d,_0x119f5b){return new BPromise(function(_0x4ece13,_0x1af209){return client[_0x9553('0x9')](_0xd5ae6d,_0x119f5b)[_0x9553('0xa')](function(_0x45aadc){logger[_0x9553('0xb')](_0x9553('0xc'),_0x153e3d,'request\x20sent');logger[_0x9553('0xd')]('DeskField,\x20%s,\x20%s,\x20%s',_0x153e3d,'request\x20sent',JSON[_0x9553('0xe')](_0x45aadc));if(_0x45aadc[_0x9553('0xf')]){if(_0x45aadc[_0x9553('0xf')][_0x9553('0x10')]===0x1f4){logger[_0x9553('0xf')](_0x9553('0xc'),_0x153e3d,_0x45aadc[_0x9553('0xf')]['message']);return _0x1af209(_0x45aadc[_0x9553('0xf')][_0x9553('0x11')]);}logger['error'](_0x9553('0xc'),_0x153e3d,_0x45aadc[_0x9553('0xf')][_0x9553('0x11')]);return _0x4ece13(_0x45aadc[_0x9553('0xf')][_0x9553('0x11')]);}else{logger[_0x9553('0xb')](_0x9553('0xc'),_0x153e3d,_0x9553('0x12'));_0x4ece13(_0x45aadc[_0x9553('0x13')]['message']);}})[_0x9553('0x14')](function(_0x4c2e29){logger[_0x9553('0xf')](_0x9553('0xc'),_0x153e3d,_0x4c2e29);_0x1af209(_0x4c2e29);});});}
\ No newline at end of file
diff --git a/server/api/intDynamics365Account/index.js b/server/api/intDynamics365Account/index.js
index 3658dc6..9d78624 100644
--- a/server/api/intDynamics365Account/index.js
+++ b/server/api/intDynamics365Account/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x75bd=['create','addConfiguration','put','/:id','update','destroy','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','show','/:id/configurations','/:id/fields','getFields','post'];(function(_0x91d019,_0x5223c4){var _0x19de1f=function(_0x3e1311){while(--_0x3e1311){_0x91d019['push'](_0x91d019['shift']());}};_0x19de1f(++_0x5223c4);}(_0x75bd,0x1d2));var _0xd75b=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x75bd[_0x14add3];return _0x4a174f;};'use strict';var multer=require(_0xd75b('0x0'));var util=require(_0xd75b('0x1'));var path=require(_0xd75b('0x2'));var timeout=require(_0xd75b('0x3'));var express=require(_0xd75b('0x4'));var router=express[_0xd75b('0x5')]();var auth=require(_0xd75b('0x6'));var interaction=require(_0xd75b('0x7'));var config=require(_0xd75b('0x8'));var controller=require('./intDynamics365Account.controller');router[_0xd75b('0x9')]('/',auth[_0xd75b('0xa')](),controller[_0xd75b('0xb')]);router[_0xd75b('0x9')]('/:id',auth[_0xd75b('0xa')](),controller[_0xd75b('0xc')]);router[_0xd75b('0x9')](_0xd75b('0xd'),auth[_0xd75b('0xa')](),controller['getConfigurations']);router[_0xd75b('0x9')](_0xd75b('0xe'),auth[_0xd75b('0xa')](),controller[_0xd75b('0xf')]);router[_0xd75b('0x10')]('/',auth[_0xd75b('0xa')](),controller[_0xd75b('0x11')]);router[_0xd75b('0x10')](_0xd75b('0xd'),auth['isAuthenticated'](),controller[_0xd75b('0x12')]);router[_0xd75b('0x13')](_0xd75b('0x14'),auth['isAuthenticated'](),controller[_0xd75b('0x15')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0xd75b('0x16')]);module['exports']=router;
\ No newline at end of file
+var _0xf6e5=['../../config/environment','isAuthenticated','index','/:id','show','get','/:id/configurations','getConfigurations','/:id/fields','getFields','create','post','addConfiguration','put','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x1992f1,_0x5c61f0){var _0x413dfe=function(_0x2136e5){while(--_0x2136e5){_0x1992f1['push'](_0x1992f1['shift']());}};_0x413dfe(++_0x5c61f0);}(_0xf6e5,0xa8));var _0x5f6e=function(_0x33fcba,_0x36cf87){_0x33fcba=_0x33fcba-0x0;var _0xfd2c1a=_0xf6e5[_0x33fcba];return _0xfd2c1a;};'use strict';var multer=require(_0x5f6e('0x0'));var util=require(_0x5f6e('0x1'));var path=require(_0x5f6e('0x2'));var timeout=require(_0x5f6e('0x3'));var express=require('express');var router=express[_0x5f6e('0x4')]();var auth=require(_0x5f6e('0x5'));var interaction=require(_0x5f6e('0x6'));var config=require(_0x5f6e('0x7'));var controller=require('./intDynamics365Account.controller');router['get']('/',auth[_0x5f6e('0x8')](),controller[_0x5f6e('0x9')]);router['get'](_0x5f6e('0xa'),auth[_0x5f6e('0x8')](),controller[_0x5f6e('0xb')]);router[_0x5f6e('0xc')](_0x5f6e('0xd'),auth['isAuthenticated'](),controller[_0x5f6e('0xe')]);router[_0x5f6e('0xc')](_0x5f6e('0xf'),auth[_0x5f6e('0x8')](),controller[_0x5f6e('0x10')]);router['post']('/',auth['isAuthenticated'](),controller[_0x5f6e('0x11')]);router[_0x5f6e('0x12')](_0x5f6e('0xd'),auth[_0x5f6e('0x8')](),controller[_0x5f6e('0x13')]);router[_0x5f6e('0x14')](_0x5f6e('0xa'),auth[_0x5f6e('0x8')](),controller[_0x5f6e('0x15')]);router[_0x5f6e('0x16')](_0x5f6e('0xa'),auth['isAuthenticated'](),controller[_0x5f6e('0x17')]);module[_0x5f6e('0x18')]=router;
\ No newline at end of file
diff --git a/server/api/intDynamics365Account/intDynamics365Account.attributes.js b/server/api/intDynamics365Account/intDynamics365Account.attributes.js
index d818f72..7395ff6 100644
--- a/server/api/intDynamics365Account/intDynamics365Account.attributes.js
+++ b/server/api/intDynamics365Account/intDynamics365Account.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x0c75=['STRING','sequelize'];(function(_0x1a2d1c,_0x4a1873){var _0x56eb67=function(_0x295a7d){while(--_0x295a7d){_0x1a2d1c['push'](_0x1a2d1c['shift']());}};_0x56eb67(++_0x4a1873);}(_0x0c75,0x83));var _0x50c7=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x0c75[_0x122ef9];return _0x42fba0;};'use strict';var Sequelize=require(_0x50c7('0x0'));module['exports']={'name':{'type':Sequelize[_0x50c7('0x1')]},'username':{'type':Sequelize[_0x50c7('0x1')]},'password':{'type':Sequelize[_0x50c7('0x1')]},'remoteUri':{'type':Sequelize['STRING']},'tenantId':{'type':Sequelize[_0x50c7('0x1')]},'clientId':{'type':Sequelize['STRING']},'clientSecret':{'type':Sequelize[_0x50c7('0x1')]},'serverUrl':{'type':Sequelize[_0x50c7('0x1')]},'description':{'type':Sequelize[_0x50c7('0x1')]}};
\ No newline at end of file
+var _0x9b32=['STRING','sequelize','exports'];(function(_0x302b5e,_0x564a8e){var _0x523ab7=function(_0x6aec8f){while(--_0x6aec8f){_0x302b5e['push'](_0x302b5e['shift']());}};_0x523ab7(++_0x564a8e);}(_0x9b32,0x1ab));var _0x29b3=function(_0x5a6f46,_0x193831){_0x5a6f46=_0x5a6f46-0x0;var _0x117532=_0x9b32[_0x5a6f46];return _0x117532;};'use strict';var Sequelize=require(_0x29b3('0x0'));module[_0x29b3('0x1')]={'name':{'type':Sequelize[_0x29b3('0x2')]},'username':{'type':Sequelize[_0x29b3('0x2')]},'password':{'type':Sequelize[_0x29b3('0x2')]},'remoteUri':{'type':Sequelize[_0x29b3('0x2')]},'tenantId':{'type':Sequelize['STRING']},'clientId':{'type':Sequelize['STRING']},'clientSecret':{'type':Sequelize[_0x29b3('0x2')]},'serverUrl':{'type':Sequelize[_0x29b3('0x2')]},'description':{'type':Sequelize[_0x29b3('0x2')]}};
\ No newline at end of file
diff --git a/server/api/intDynamics365Account/intDynamics365Account.controller.js b/server/api/intDynamics365Account/intDynamics365Account.controller.js
index 534c87d..f6a18ab 100644
--- a/server/api/intDynamics365Account/intDynamics365Account.controller.js
+++ b/server/api/intDynamics365Account/intDynamics365Account.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xbe1b=['filters','intersection','attributes','fields','hasOwnProperty','limit','order','sort','where','pick','filter','merge','VIRTUAL','include','rows','length','includeAll','options','create','body','find','params','destroy','findOne','Dynamics365Configuration','getConfigurations','AccountId','Subjects','channel','Descriptions','getDescriptions','Dynamics365Field','Incident','PhoneCall','title','description','caseorigincode','subject','regardingobjectid','directioncode','phonecall_activity_parties','accountidname','accountidyominame','actualserviceunits','billedserviceunits','contactidyominame','contractdetailidname','contractidname','createdbyexternalpartyname','createdbyexternalpartyyominame','createdbyname','createdbyyominame','createdon','createdonbehalfbyname','createdonbehalfbyyominame','customeridname','customeridtype','entitlementidname','entityimage_timestamp','entityimage_url','followupby','importsequencenumber','kbarticleidname','lastonholdtime','modifiedbyexternalpartyname','modifiedbyexternalpartyyominame','modifiedon','modifiedonbehalfbyname','msdyn_incidenttypename','msdyn_iotalertname','numberofchildincidents','onholdtime','owneridname','owneridtype','owneridyominame','primarycontactidname','productidname','productserialnumber','resolveby','resolvebykpiidname','responsiblecontactidname','responsiblecontactidyominame','sentimentvalue','slainvokedidname','slaname','statuscode','ticketnumber','timezoneruleversionnumber','transactioncurrencyidname','versionnumber','concat','password','remoteUri','tenantId','clientSecret','slice','%s/api/data/v9.0/','https://login.microsoftonline.com/','/oauth2/token','clientId','username','GET','Bearer\x20','4.0','value','MetadataId','EntityDefinitions(',')?$select=LogicalName&$expand=Attributes($select=LogicalName)','remove','includes','LogicalName','@odata.type','substring','lastIndexOf','PicklistAttributeMetadata','push','forEach','isNil','BooleanAttributeMetadata','StringAttributeMetadata','DoubleAttributeMetadata','BigIntAttributeMetadata','IntegerAttributeMetadata','DateTimeAttributeMetadata','StatusAttributeMetadata','EntityNameAttributeMetadata','StateAttributeMetadata','DecimalAttributeMetadata','test','statusCode','Wrong\x20credentials','$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','OptionSet','Label','Value','DisplayName',')/Attributes(',')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','TrueOption','UserLocalizedLabel','false','html-pdf','eml-format','rimraf','moment','bluebird','util','path','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','jayson/promise','client','http','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','Dynamics365Account,\x20%s,\x20%s','request\x20sent','Dynamics365Account,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','end','json','count','offset','set','Content-Range','reject','save','update','stack','name','send','map','Dynamics365Account','rawAttributes','fieldName','type','model','query','keys'];(function(_0x4a04ad,_0x3c60b1){var _0x806240=function(_0x165fe5){while(--_0x165fe5){_0x4a04ad['push'](_0x4a04ad['shift']());}};_0x806240(++_0x3c60b1);}(_0xbe1b,0x8d));var _0xbbe1=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xbe1b[_0x3dd15e];return _0x231fd0;};'use strict';var pdf=require(_0xbbe1('0x0'));var emlformat=require(_0xbbe1('0x1'));var rimraf=require(_0xbbe1('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xbbe1('0x3'));var BPromise=require(_0xbbe1('0x4'));var Mustache=require('mustache');var util=require(_0xbbe1('0x5'));var path=require(_0xbbe1('0x6'));var sox=require('sox');var csv=require(_0xbbe1('0x7'));var ejs=require(_0xbbe1('0x8'));var fs=require('fs');var _=require('lodash');var squel=require(_0xbbe1('0x9'));var crypto=require(_0xbbe1('0xa'));var jsforce=require(_0xbbe1('0xb'));var deskjs=require(_0xbbe1('0xc'));var toCsv=require(_0xbbe1('0x7'));var querystring=require(_0xbbe1('0xd'));var Papa=require(_0xbbe1('0xe'));var Redis=require(_0xbbe1('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xbbe1('0x10'));var as=require(_0xbbe1('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xbbe1('0x12'))(_0xbbe1('0x13'));var utils=require(_0xbbe1('0x14'));var config=require(_0xbbe1('0x15'));var db=require(_0xbbe1('0x16'))['db'];var integrations=require(_0xbbe1('0x17'));var jayson=require(_0xbbe1('0x18'));var client=jayson[_0xbbe1('0x19')][_0xbbe1('0x1a')]({'port':0x232a});function checkPasswordPattern(_0x34a0cd,_0x579385,_0x28da84){if(_0x28da84){var _0x1540fe=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x1540fe['test'](_0x579385)){return _0x34a0cd;}else{throw new db[(_0xbbe1('0x1b'))][(_0xbbe1('0x1c'))](_0xbbe1('0x1d'));}}else{return _0x34a0cd;}}function respondWithRpcPromise(_0x5c6e4d,_0x24ba3a,_0x38f2c1,_0x4a35ea){return new BPromise(function(_0x1447f9,_0xb52240){var _0x546eda=_0x4a35ea||client;return _0x546eda[_0xbbe1('0x1e')](_0x5c6e4d,_0x38f2c1)[_0xbbe1('0x1f')](function(_0x227764){logger[_0xbbe1('0x20')](_0xbbe1('0x21'),_0x24ba3a,_0xbbe1('0x22'));logger['debug'](_0xbbe1('0x23'),_0x24ba3a,_0xbbe1('0x22'),JSON[_0xbbe1('0x24')](_0x227764));if(_0x227764[_0xbbe1('0x25')]){if(_0x227764['error'][_0xbbe1('0x26')]===0x1f4){logger[_0xbbe1('0x25')](_0xbbe1('0x21'),_0x24ba3a,_0x227764[_0xbbe1('0x25')][_0xbbe1('0x27')]);return _0xb52240(_0x227764[_0xbbe1('0x25')]['message']);}logger[_0xbbe1('0x25')]('Dynamics365Account,\x20%s,\x20%s',_0x24ba3a,_0x227764[_0xbbe1('0x25')][_0xbbe1('0x27')]);return _0x1447f9(_0x227764[_0xbbe1('0x25')][_0xbbe1('0x27')]);}else{logger[_0xbbe1('0x20')](_0xbbe1('0x21'),_0x24ba3a,_0xbbe1('0x22'));_0x1447f9(_0x227764[_0xbbe1('0x28')][_0xbbe1('0x27')]);}})[_0xbbe1('0x29')](function(_0x5104a3){logger['error']('Dynamics365Account,\x20%s,\x20%s',_0x24ba3a,_0x5104a3);_0xb52240(_0x5104a3);});});}function respondWithStatusCode(_0x412696,_0x4d1a24){_0x4d1a24=_0x4d1a24||0xcc;return function(_0x349ab9){if(_0x349ab9){return _0x412696[_0xbbe1('0x2a')](_0x4d1a24);}return _0x412696[_0xbbe1('0x2b')](_0x4d1a24)[_0xbbe1('0x2c')]();};}function respondWithResult(_0x25ef5a,_0x4645d4){_0x4645d4=_0x4645d4||0xc8;return function(_0x2498f0){if(_0x2498f0){return _0x25ef5a[_0xbbe1('0x2b')](_0x4645d4)[_0xbbe1('0x2d')](_0x2498f0);}};}function respondWithFilteredResult(_0x1f3925,_0xefaff1){return function(_0x4cd7a0){if(_0x4cd7a0){var _0xfe9de8=_0x4cd7a0[_0xbbe1('0x2e')],_0x4dadea=_0xefaff1['offset'],_0xc135a7=_0xefaff1[_0xbbe1('0x2f')]+_0xefaff1['limit'],_0xe9808;if(_0xc135a7>=_0xfe9de8){_0xc135a7=_0xfe9de8;_0xe9808=0xc8;}else{_0xe9808=0xce;}_0x1f3925[_0xbbe1('0x2b')](_0xe9808);return _0x1f3925[_0xbbe1('0x30')](_0xbbe1('0x31'),_0x4dadea+'-'+_0xc135a7+'/'+_0xfe9de8)[_0xbbe1('0x2d')](_0x4cd7a0);}return null;};}function patchUpdates(_0x5e0545){return function(_0x264bf6){try{jsonpatch['apply'](_0x264bf6,_0x5e0545,!![]);}catch(_0x3c88fd){return BPromise[_0xbbe1('0x32')](_0x3c88fd);}return _0x264bf6[_0xbbe1('0x33')]();};}function saveUpdates(_0xf664f1,_0x55801e){return function(_0x3d85ca){if(_0x3d85ca){return _0x3d85ca[_0xbbe1('0x34')](_0xf664f1)[_0xbbe1('0x1f')](function(_0x39c9f2){return _0x39c9f2;});}return null;};}function removeEntity(_0x461ccb,_0x12f6f0){return function(_0x3ecfd0){if(_0x3ecfd0){return _0x3ecfd0['destroy']()[_0xbbe1('0x1f')](function(){_0x461ccb[_0xbbe1('0x2b')](0xcc)[_0xbbe1('0x2c')]();});}};}function handleEntityNotFound(_0x1ebf87,_0x572dff){return function(_0x554424){if(!_0x554424){_0x1ebf87[_0xbbe1('0x2a')](0x194);}return _0x554424;};}function handleError(_0x48e0e6,_0x54cf90){_0x54cf90=_0x54cf90||0x1f4;return function(_0x3176ba){logger[_0xbbe1('0x25')](_0x3176ba[_0xbbe1('0x35')]);if(_0x3176ba[_0xbbe1('0x36')]){delete _0x3176ba[_0xbbe1('0x36')];}_0x48e0e6[_0xbbe1('0x2b')](_0x54cf90)[_0xbbe1('0x37')](_0x3176ba);};}exports['index']=function(_0x27eaf4,_0xb95443){var _0x17f010={},_0x55240b={},_0x1d0101={'count':0x0,'rows':[]};var _0x2939a3=_[_0xbbe1('0x38')](db[_0xbbe1('0x39')][_0xbbe1('0x3a')],function(_0x2072ab){return{'name':_0x2072ab[_0xbbe1('0x3b')],'type':_0x2072ab[_0xbbe1('0x3c')]['key']};});_0x55240b[_0xbbe1('0x3d')]=_[_0xbbe1('0x38')](_0x2939a3,'name');_0x55240b[_0xbbe1('0x3e')]=_[_0xbbe1('0x3f')](_0x27eaf4[_0xbbe1('0x3e')]);_0x55240b[_0xbbe1('0x40')]=_[_0xbbe1('0x41')](_0x55240b[_0xbbe1('0x3d')],_0x55240b[_0xbbe1('0x3e')]);_0x17f010[_0xbbe1('0x42')]=_[_0xbbe1('0x41')](_0x55240b[_0xbbe1('0x3d')],qs[_0xbbe1('0x43')](_0x27eaf4[_0xbbe1('0x3e')][_0xbbe1('0x43')]));_0x17f010[_0xbbe1('0x42')]=_0x17f010[_0xbbe1('0x42')]['length']?_0x17f010['attributes']:_0x55240b[_0xbbe1('0x3d')];if(!_0x27eaf4[_0xbbe1('0x3e')][_0xbbe1('0x44')]('nolimit')){_0x17f010['limit']=qs[_0xbbe1('0x45')](_0x27eaf4[_0xbbe1('0x3e')][_0xbbe1('0x45')]);_0x17f010[_0xbbe1('0x2f')]=qs[_0xbbe1('0x2f')](_0x27eaf4[_0xbbe1('0x3e')][_0xbbe1('0x2f')]);}_0x17f010[_0xbbe1('0x46')]=qs[_0xbbe1('0x47')](_0x27eaf4[_0xbbe1('0x3e')]['sort']);_0x17f010[_0xbbe1('0x48')]=qs[_0xbbe1('0x40')](_[_0xbbe1('0x49')](_0x27eaf4[_0xbbe1('0x3e')],_0x55240b[_0xbbe1('0x40')]),_0x2939a3);if(_0x27eaf4[_0xbbe1('0x3e')][_0xbbe1('0x4a')]){_0x17f010[_0xbbe1('0x48')]=_[_0xbbe1('0x4b')](_0x17f010['where'],{'$or':_['map'](_0x2939a3,function(_0xd1b1c8){if(_0xd1b1c8[_0xbbe1('0x3c')]!==_0xbbe1('0x4c')){var _0x347e3d={};_0x347e3d[_0xd1b1c8['name']]={'$like':'%'+_0x27eaf4[_0xbbe1('0x3e')][_0xbbe1('0x4a')]+'%'};return _0x347e3d;}})});}_0x17f010=_[_0xbbe1('0x4b')]({},_0x17f010,_0x27eaf4['options']);var _0x25a09a={'where':_0x17f010[_0xbbe1('0x48')]};return db['Dynamics365Account'][_0xbbe1('0x2e')](_0x25a09a)[_0xbbe1('0x1f')](function(_0x3899d5){_0x1d0101[_0xbbe1('0x2e')]=_0x3899d5;if(_0x27eaf4[_0xbbe1('0x3e')]['includeAll']){_0x17f010[_0xbbe1('0x4d')]=[{'all':!![]}];}return db[_0xbbe1('0x39')]['findAll'](_0x17f010);})[_0xbbe1('0x1f')](function(_0x3c89ad){_0x1d0101[_0xbbe1('0x4e')]=_0x3c89ad;return _0x1d0101;})[_0xbbe1('0x1f')](respondWithFilteredResult(_0xb95443,_0x17f010))['catch'](handleError(_0xb95443,null));};exports['show']=function(_0x4c78ad,_0x432c71){var _0x138b4a={'raw':![],'where':{'id':_0x4c78ad['params']['id']}},_0x255cb0={};_0x255cb0[_0xbbe1('0x3d')]=_[_0xbbe1('0x3f')](db['Dynamics365Account'][_0xbbe1('0x3a')]);_0x255cb0[_0xbbe1('0x3e')]=_[_0xbbe1('0x3f')](_0x4c78ad['query']);_0x255cb0['filters']=_[_0xbbe1('0x41')](_0x255cb0[_0xbbe1('0x3d')],_0x255cb0[_0xbbe1('0x3e')]);_0x138b4a['attributes']=_['intersection'](_0x255cb0['model'],qs[_0xbbe1('0x43')](_0x4c78ad[_0xbbe1('0x3e')][_0xbbe1('0x43')]));_0x138b4a['attributes']=_0x138b4a[_0xbbe1('0x42')][_0xbbe1('0x4f')]?_0x138b4a[_0xbbe1('0x42')]:_0x255cb0['model'];if(_0x4c78ad[_0xbbe1('0x3e')][_0xbbe1('0x50')]){_0x138b4a[_0xbbe1('0x4d')]=[{'all':!![]}];}_0x138b4a=_[_0xbbe1('0x4b')]({},_0x138b4a,_0x4c78ad[_0xbbe1('0x51')]);return db[_0xbbe1('0x39')]['find'](_0x138b4a)['then'](handleEntityNotFound(_0x432c71,null))[_0xbbe1('0x1f')](respondWithResult(_0x432c71,null))[_0xbbe1('0x29')](handleError(_0x432c71,null));};exports[_0xbbe1('0x52')]=function(_0x1592de,_0x169bdc){return db[_0xbbe1('0x39')][_0xbbe1('0x52')](_0x1592de[_0xbbe1('0x53')],{})['then'](respondWithResult(_0x169bdc,0xc9))[_0xbbe1('0x29')](handleError(_0x169bdc,null));};exports[_0xbbe1('0x34')]=function(_0x3699ae,_0x37c33d){if(_0x3699ae[_0xbbe1('0x53')]['id']){delete _0x3699ae[_0xbbe1('0x53')]['id'];}return db[_0xbbe1('0x39')][_0xbbe1('0x54')]({'where':{'id':_0x3699ae[_0xbbe1('0x55')]['id']}})[_0xbbe1('0x1f')](handleEntityNotFound(_0x37c33d,null))['then'](saveUpdates(_0x3699ae[_0xbbe1('0x53')],null))['then'](respondWithResult(_0x37c33d,null))[_0xbbe1('0x29')](handleError(_0x37c33d,null));};exports[_0xbbe1('0x56')]=function(_0x5e5564,_0x50ff17){return db[_0xbbe1('0x39')][_0xbbe1('0x54')]({'where':{'id':_0x5e5564[_0xbbe1('0x55')]['id']}})[_0xbbe1('0x1f')](handleEntityNotFound(_0x50ff17,null))[_0xbbe1('0x1f')](removeEntity(_0x50ff17,null))[_0xbbe1('0x29')](handleError(_0x50ff17,null));};exports['getConfigurations']=function(_0x3a075d,_0x225cb8,_0x374207){var _0x54431e={};var _0x1dfac4={};var _0x3acd32;var _0x110325;return db['Dynamics365Account'][_0xbbe1('0x57')]({'where':{'id':_0x3a075d[_0xbbe1('0x55')]['id']}})['then'](handleEntityNotFound(_0x225cb8,null))[_0xbbe1('0x1f')](function(_0x117a9c){if(_0x117a9c){_0x3acd32=_0x117a9c;_0x1dfac4[_0xbbe1('0x3d')]=_[_0xbbe1('0x3f')](db[_0xbbe1('0x58')][_0xbbe1('0x3a')]);_0x1dfac4[_0xbbe1('0x3e')]=_['keys'](_0x3a075d['query']);_0x1dfac4['filters']=_[_0xbbe1('0x41')](_0x1dfac4[_0xbbe1('0x3d')],_0x1dfac4[_0xbbe1('0x3e')]);_0x54431e[_0xbbe1('0x42')]=_[_0xbbe1('0x41')](_0x1dfac4[_0xbbe1('0x3d')],qs[_0xbbe1('0x43')](_0x3a075d[_0xbbe1('0x3e')][_0xbbe1('0x43')]));_0x54431e[_0xbbe1('0x42')]=_0x54431e[_0xbbe1('0x42')]['length']?_0x54431e['attributes']:_0x1dfac4['model'];_0x54431e[_0xbbe1('0x46')]=qs[_0xbbe1('0x47')](_0x3a075d['query'][_0xbbe1('0x47')]);_0x54431e[_0xbbe1('0x48')]=qs[_0xbbe1('0x40')](_[_0xbbe1('0x49')](_0x3a075d[_0xbbe1('0x3e')],_0x1dfac4[_0xbbe1('0x40')]));if(_0x3a075d[_0xbbe1('0x3e')][_0xbbe1('0x4a')]){_0x54431e[_0xbbe1('0x48')]=_[_0xbbe1('0x4b')](_0x54431e[_0xbbe1('0x48')],{'$or':_['map'](_0x54431e[_0xbbe1('0x42')],function(_0x3fa7b9){var _0x27fdc5={};_0x27fdc5[_0x3fa7b9]={'$like':'%'+_0x3a075d[_0xbbe1('0x3e')][_0xbbe1('0x4a')]+'%'};return _0x27fdc5;})});}_0x54431e=_['merge']({},_0x54431e,_0x3a075d[_0xbbe1('0x51')]);return _0x3acd32[_0xbbe1('0x59')](_0x54431e);}})[_0xbbe1('0x1f')](function(_0x184509){if(_0x184509){_0x110325=_0x184509[_0xbbe1('0x4f')];if(!_0x3a075d['query'][_0xbbe1('0x44')]('nolimit')){_0x54431e[_0xbbe1('0x45')]=qs[_0xbbe1('0x45')](_0x3a075d['query'][_0xbbe1('0x45')]);_0x54431e[_0xbbe1('0x2f')]=qs[_0xbbe1('0x2f')](_0x3a075d[_0xbbe1('0x3e')][_0xbbe1('0x2f')]);}return _0x3acd32[_0xbbe1('0x59')](_0x54431e);}})[_0xbbe1('0x1f')](function(_0x1014d8){if(_0x1014d8){return _0x1014d8?{'count':_0x110325,'rows':_0x1014d8}:null;}})[_0xbbe1('0x1f')](respondWithResult(_0x225cb8,null))[_0xbbe1('0x29')](handleError(_0x225cb8,null));};exports['addConfiguration']=function(_0x4445ff,_0x1d91af,_0x4d4bf6){if(_0x4445ff[_0xbbe1('0x53')]['id']){delete _0x4445ff[_0xbbe1('0x53')]['id'];}return db[_0xbbe1('0x39')][_0xbbe1('0x57')]({'where':{'id':_0x4445ff[_0xbbe1('0x55')]['id']}})['then'](handleEntityNotFound(_0x1d91af,null))[_0xbbe1('0x1f')](function(_0x1973ef){if(_0x1973ef){_0x4445ff[_0xbbe1('0x53')][_0xbbe1('0x5a')]=_0x1973ef['id'];_0x4445ff[_0xbbe1('0x53')][_0xbbe1('0x5b')]=integrations['getSubjects'](_0x4445ff['body'][_0xbbe1('0x5c')],_0x4445ff['body'][_0xbbe1('0x3c')]);_0x4445ff[_0xbbe1('0x53')][_0xbbe1('0x5d')]=integrations[_0xbbe1('0x5e')](_0x4445ff[_0xbbe1('0x53')][_0xbbe1('0x5c')],_0x4445ff[_0xbbe1('0x53')][_0xbbe1('0x3c')]);return db[_0xbbe1('0x58')][_0xbbe1('0x52')](_0x4445ff[_0xbbe1('0x53')],{'include':[{'model':db[_0xbbe1('0x5f')],'as':'Subjects'},{'model':db[_0xbbe1('0x5f')],'as':'Descriptions'}]});}return null;})[_0xbbe1('0x1f')](respondWithResult(_0x1d91af,null))[_0xbbe1('0x29')](handleError(_0x1d91af,null));};exports['getFields']=function(_0x351f85,_0xbb68f4,_0x93569b){var _0x4c9a56=_0x351f85['query']['ticketType'];var _0x54ee02=_0x4c9a56==='incident'?_0xbbe1('0x60'):_0xbbe1('0x61');var _0x20ed2a='';var _0x402325='';var _0x240a40='';var _0x569da0='';var _0x2c9162='';var _0x42c372='';var _0x591126='';var _0x34aa05='';var _0x390854=[_0xbbe1('0x62'),_0xbbe1('0x63'),'customerid','ownerid',_0xbbe1('0x64'),_0xbbe1('0x65'),'phonenumber',_0xbbe1('0x66'),_0xbbe1('0x67'),_0xbbe1('0x68')];var _0x1943f4=[_0xbbe1('0x69'),_0xbbe1('0x6a'),_0xbbe1('0x6b'),_0xbbe1('0x6c'),'contactidname',_0xbbe1('0x6d'),_0xbbe1('0x6e'),_0xbbe1('0x6f'),_0xbbe1('0x70'),_0xbbe1('0x71'),_0xbbe1('0x72'),_0xbbe1('0x73'),_0xbbe1('0x74'),_0xbbe1('0x75'),_0xbbe1('0x76'),_0xbbe1('0x77'),_0xbbe1('0x78'),'customeridyominame','emailaddress',_0xbbe1('0x79'),_0xbbe1('0x7a'),_0xbbe1('0x7b'),'escalatedon','exchangerate','firstresponsebykpiidname',_0xbbe1('0x7c'),_0xbbe1('0x7d'),'influencescore',_0xbbe1('0x7e'),_0xbbe1('0x7f'),'masteridname',_0xbbe1('0x80'),_0xbbe1('0x81'),'modifiedbyname','modifiedbyyominame',_0xbbe1('0x82'),_0xbbe1('0x83'),'modifiedonbehalfbyyominame',_0xbbe1('0x84'),_0xbbe1('0x85'),_0xbbe1('0x86'),_0xbbe1('0x87'),'overriddencreatedon',_0xbbe1('0x88'),_0xbbe1('0x89'),_0xbbe1('0x8a'),'parentcaseidname',_0xbbe1('0x8b'),'primarycontactidyominame','prioritycodename',_0xbbe1('0x8c'),_0xbbe1('0x8d'),_0xbbe1('0x8e'),_0xbbe1('0x8f'),'responseby',_0xbbe1('0x90'),_0xbbe1('0x91'),_0xbbe1('0x92'),_0xbbe1('0x93'),_0xbbe1('0x94'),'socialprofileidname','statecode',_0xbbe1('0x95'),'subjectidname',_0xbbe1('0x96'),_0xbbe1('0x97'),_0xbbe1('0x98'),'traversedpath','utcconversiontimezonecode',_0xbbe1('0x99')];var _0x46020e=_0x390854[_0xbbe1('0x9a')](_0x1943f4);return db[_0xbbe1('0x39')][_0xbbe1('0x57')]({'where':{'id':_0x351f85['params']['id']},'attributes':['id','username',_0xbbe1('0x9b'),_0xbbe1('0x9c'),_0xbbe1('0x9d'),'clientId',_0xbbe1('0x9e')]})[_0xbbe1('0x1f')](handleEntityNotFound(_0xbb68f4,null))[_0xbbe1('0x1f')](function(_0x20970c){if(_0x20970c){_0x34aa05=_0x20970c['remoteUri'];var _0x18d1f6=_0x34aa05[_0xbbe1('0x9f')](-0x1);if(_0x18d1f6==='/'){_0x34aa05=_0x34aa05['substring'](0x0,_0x34aa05['lastIndexOf'](_0x18d1f6));}_0x591126=util['format'](_0xbbe1('0xa0'),_0x34aa05);var _0x33ead0={'method':'POST','uri':_0xbbe1('0xa1')+_0x20970c[_0xbbe1('0x9d')]+_0xbbe1('0xa2'),'form':{'client_id':_0x20970c[_0xbbe1('0xa3')],'resource':_0x34aa05,'username':_0x20970c[_0xbbe1('0xa4')],'password':_0x20970c[_0xbbe1('0x9b')],'grant_type':_0xbbe1('0x9b'),'client_secret':_0x20970c[_0xbbe1('0x9e')]},'json':!![]};return rp(_0x33ead0);}})[_0xbbe1('0x1f')](function(_0x46831e){_0x42c372=_0x46831e['access_token'];var _0x1931d5={'method':_0xbbe1('0xa5'),'uri':encodeURI(_0x591126+'EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27'+_0x54ee02+'\x27'),'headers':{'Authorization':_0xbbe1('0xa6')+_0x42c372,'If-None-Match':null,'OData-Version':_0xbbe1('0xa7')},'json':!![]};return rp(_0x1931d5);})[_0xbbe1('0x1f')](function(_0x15ae85){var _0x3973f9=_0x15ae85[_0xbbe1('0xa8')][0x0];var _0x131917=_0x3973f9[_0xbbe1('0xa9')];var _0x1c3436={'method':_0xbbe1('0xa5'),'uri':_0x591126+_0xbbe1('0xaa')+_0x131917+_0xbbe1('0xab'),'headers':{'Authorization':_0xbbe1('0xa6')+_0x42c372,'If-None-Match':null,'OData-Version':_0xbbe1('0xa7')},'json':!![]};return rp(_0x1c3436);})[_0xbbe1('0x1f')](function(_0x41ec7a){_0x20ed2a=_0x41ec7a;_0x402325=_0x20ed2a['Attributes'];_0x402325=_[_0xbbe1('0xac')](_0x402325,function(_0x3a7d1c){return!_0x46020e[_0xbbe1('0xad')](_0x3a7d1c[_0xbbe1('0xae')]);});var _0x5eb584=[];var _0x5c8b69=[];_0x402325['forEach'](function(_0xa78a9a){if(_0xa78a9a['@odata.type']){var _0x1081c8=_0xa78a9a[_0xbbe1('0xaf')][_0xbbe1('0xb0')](_0xa78a9a[_0xbbe1('0xaf')][_0xbbe1('0xb1')]('.')+0x1);if(_0x1081c8===_0xbbe1('0xb2')){_0x5eb584[_0xbbe1('0xb3')](getSelectList(_0x591126,_0x4c9a56,_0x5c8b69,_0x20ed2a[_0xbbe1('0xa9')],_0xa78a9a[_0xbbe1('0xa9')],_0x42c372));}}});return Promise['all'](_0x5eb584);})[_0xbbe1('0x1f')](function(_0x39e66c){_0x240a40=_0x39e66c[0x0];var _0x5d0840=[];var _0x42ccb2=[];_0x402325[_0xbbe1('0xb4')](function(_0xd0bb86){if(!_[_0xbbe1('0xb5')](_0xd0bb86[_0xbbe1('0xaf')])){var _0x36caf9=_0xd0bb86[_0xbbe1('0xaf')][_0xbbe1('0xb0')](_0xd0bb86['@odata.type'][_0xbbe1('0xb1')]('.')+0x1);if(_0x36caf9===_0xbbe1('0xb6')){_0x5d0840[_0xbbe1('0xb3')](getBooleanList(_0x591126,_0x4c9a56,_0x42ccb2,_0x20ed2a[_0xbbe1('0xa9')],_0xd0bb86[_0xbbe1('0xa9')],_0x42c372));}}});return Promise['all'](_0x5d0840);})[_0xbbe1('0x1f')](function(_0x5a579d){_0x569da0=_0x5a579d[0x0];var _0x501915=[];var _0x4cc49a=[];_0x402325[_0xbbe1('0xb4')](function(_0x1f42a6){if(_0x1f42a6[_0xbbe1('0xaf')]){var _0x367212=_0x1f42a6[_0xbbe1('0xaf')][_0xbbe1('0xb0')](_0x1f42a6[_0xbbe1('0xaf')][_0xbbe1('0xb1')]('.')+0x1);if(_0x367212===_0xbbe1('0xb7')||_0x367212===_0xbbe1('0xb8')||_0x367212===_0xbbe1('0xb9')||_0x367212===_0xbbe1('0xba')||_0x367212==='MemoAttributeMetadata'||_0x367212===_0xbbe1('0xbb')||_0x367212===_0xbbe1('0xbc')||_0x367212===_0xbbe1('0xbd')||_0x367212===_0xbbe1('0xbe')||_0x367212===_0xbbe1('0xbf')){_0x501915[_0xbbe1('0xb3')](getInputList(_0x591126,_0x4c9a56,_0x367212,_0x4cc49a,_0x20ed2a[_0xbbe1('0xa9')],_0x1f42a6['MetadataId'],_0x42c372));}}});return Promise['all'](_0x501915);})[_0xbbe1('0x1f')](function(_0x50d237){_0x2c9162=_0x50d237[0x0];var _0x4bd3c1=_0x240a40[_0xbbe1('0x9a')](_0x569da0)['concat'](_0x2c9162);var _0x1f4e91={'count':_0x4bd3c1[_0xbbe1('0x4f')],'rows':_0x4bd3c1};return _0x1f4e91;})[_0xbbe1('0x1f')](respondWithResult(_0xbb68f4,null))['catch'](function(_0x1ece0f){var _0x3a3384=_0x351f85['query'][_0xbbe1('0xc0')]?0x1f4:_0x1ece0f[_0xbbe1('0xc1')]||0x1f4;logger[_0xbbe1('0x25')](_0x1ece0f[_0xbbe1('0x35')]);delete _0x1ece0f[_0xbbe1('0x36')];if(_0x3a3384===0x191){_0x3a3384=0x190;}_0xbb68f4[_0xbbe1('0x2b')](_0x3a3384)[_0xbbe1('0x37')](_0x351f85[_0xbbe1('0x3e')][_0xbbe1('0xc0')]?{'message':_0xbbe1('0xc2'),'statusCode':_0x1ece0f[_0xbbe1('0xc1')]}:_0x1ece0f);});};function getSelectList(_0x55fd2b,_0x2792fa,_0x2ee461,_0xb3a086,_0x4845b1,_0x2c16b3){var _0x423055={'method':_0xbbe1('0xa5'),'uri':_0x55fd2b+_0xbbe1('0xaa')+_0xb3a086+')/Attributes('+_0x4845b1+')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?'+_0xbbe1('0xc3'),'headers':{'Authorization':_0xbbe1('0xa6')+_0x2c16b3,'If-None-Match':null,'OData-Version':_0xbbe1('0xa7')},'json':!![]};return rp(_0x423055)[_0xbbe1('0x1f')](function(_0x5241ce){var _0x2bc968=[];var _0x1c88a8=_0x5241ce[_0xbbe1('0xc4')]['Options'];_0x1c88a8['forEach'](function(_0x2ab428){_0x2bc968[_0xbbe1('0xb3')]({'name':_0x2ab428[_0xbbe1('0xc5')]['UserLocalizedLabel']['Label'],'value':String(_0x2ab428[_0xbbe1('0xc6')])});});var _0x1cee68={'id':_0x2792fa+'_'+_0x5241ce['LogicalName'],'name':_0x5241ce[_0xbbe1('0xc7')]['UserLocalizedLabel'][_0xbbe1('0xc5')],'custom':![],'options':_0x2bc968};_0x2ee461[_0xbbe1('0xb3')](_0x1cee68);return _0x2ee461;});}function getBooleanList(_0x17a355,_0x193313,_0x3c71d9,_0x9ecc00,_0x493c70,_0x25dabb){var _0x17d007={'method':'GET','uri':_0x17a355+_0xbbe1('0xaa')+_0x9ecc00+_0xbbe1('0xc8')+_0x493c70+_0xbbe1('0xc9'),'headers':{'Authorization':'Bearer\x20'+_0x25dabb,'If-None-Match':null,'OData-Version':_0xbbe1('0xa7')},'json':!![]};return rp(_0x17d007)[_0xbbe1('0x1f')](function(_0x363579){var _0x77e5a6=[];_0x77e5a6[_0xbbe1('0xb3')]({'name':_0x363579['OptionSet'][_0xbbe1('0xca')][_0xbbe1('0xc5')][_0xbbe1('0xcb')][_0xbbe1('0xc5')],'value':'true'},{'name':_0x363579[_0xbbe1('0xc4')]['FalseOption'][_0xbbe1('0xc5')][_0xbbe1('0xcb')][_0xbbe1('0xc5')],'value':_0xbbe1('0xcc')});var _0x37c2bb={'id':_0x193313+'_'+_0x363579[_0xbbe1('0xae')],'name':_0x363579[_0xbbe1('0xc7')][_0xbbe1('0xcb')][_0xbbe1('0xc5')],'custom':![],'options':_0x77e5a6};_0x3c71d9[_0xbbe1('0xb3')](_0x37c2bb);return _0x3c71d9;});}function getInputList(_0x3d0e3b,_0x14e726,_0x29349b,_0x1a25da,_0x404903,_0x470289,_0x1f1087){var _0x464d63={'method':_0xbbe1('0xa5'),'uri':_0x3d0e3b+'EntityDefinitions('+_0x404903+_0xbbe1('0xc8')+_0x470289+')/Microsoft.Dynamics.CRM.'+_0x29349b+'?$select=DisplayName,LogicalName','headers':{'Authorization':_0xbbe1('0xa6')+_0x1f1087,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x464d63)[_0xbbe1('0x1f')](function(_0x41bc5e){var _0xa8a0d9={'id':_0x14e726+'_'+_0x41bc5e[_0xbbe1('0xae')],'name':_0x41bc5e[_0xbbe1('0xc7')]['UserLocalizedLabel']?_0x41bc5e[_0xbbe1('0xc7')][_0xbbe1('0xcb')][_0xbbe1('0xc5')]:_0x41bc5e[_0xbbe1('0xae')],'custom':![],'options':[]};_0x1a25da[_0xbbe1('0xb3')](_0xa8a0d9);return _0x1a25da;});}
\ No newline at end of file
+var _0x0d94=['status','json','count','offset','limit','set','Content-Range','apply','save','update','then','destroy','sendStatus','stack','name','send','index','map','Dynamics365Account','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','filter','VIRTUAL','options','include','rows','show','length','includeAll','find','catch','create','body','params','getConfigurations','findOne','pick','merge','AccountId','channel','Descriptions','Dynamics365Configuration','Dynamics365Field','Subjects','getFields','incident','Incident','PhoneCall','title','description','customerid','ownerid','phonenumber','directioncode','phonecall_activity_parties','accountidname','accountidyominame','billedserviceunits','contactidname','contractdetailidname','contractidname','createdbyexternalpartyname','createdbyname','createdbyyominame','createdonbehalfbyname','createdonbehalfbyyominame','customeridname','customeridtype','emailaddress','entitlementidname','entityimage_timestamp','entityimage_url','escalatedon','exchangerate','followupby','importsequencenumber','influencescore','lastonholdtime','masteridname','modifiedbyexternalpartyname','modifiedbyexternalpartyyominame','modifiedbyname','modifiedbyyominame','modifiedon','modifiedonbehalfbyname','modifiedonbehalfbyyominame','msdyn_incidenttypename','onholdtime','overriddencreatedon','owneridname','owneridtype','parentcaseidname','primarycontactidname','primarycontactidyominame','prioritycodename','productidname','productserialnumber','resolveby','resolvebykpiidname','responseby','responsiblecontactidname','responsiblecontactidyominame','sentimentvalue','slainvokedidname','slaname','socialprofileidname','statecode','subjectidname','ticketnumber','timezoneruleversionnumber','transactioncurrencyidname','traversedpath','utcconversiontimezonecode','versionnumber','username','clientId','remoteUri','substring','lastIndexOf','format','%s/api/data/v9.0/','POST','https://login.microsoftonline.com/','tenantId','/oauth2/token','password','access_token','GET','EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27','MetadataId','EntityDefinitions(',')?$select=LogicalName&$expand=Attributes($select=LogicalName)','Bearer\x20','Attributes','remove','includes','LogicalName','@odata.type','PicklistAttributeMetadata','push','all','forEach','isNil','BooleanAttributeMetadata','StringAttributeMetadata','DoubleAttributeMetadata','BigIntAttributeMetadata','IntegerAttributeMetadata','MemoAttributeMetadata','DateTimeAttributeMetadata','StatusAttributeMetadata','StateAttributeMetadata','DecimalAttributeMetadata','concat','statusCode','Wrong\x20credentials',')/Attributes(','4.0','Options','Label','UserLocalizedLabel','DisplayName',')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','OptionSet','TrueOption','true','FalseOption',')/Microsoft.Dynamics.CRM.','?$select=DisplayName,LogicalName','html-pdf','eml-format','zip-dir','fast-json-patch','moment','util','sox','to-csv','ejs','lodash','jsforce','querystring','ioredis','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','../../components/integrations/configuration','client','http','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','Dynamics365Account,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Account,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','end'];(function(_0x500419,_0x549162){var _0x241c1a=function(_0x3bea1a){while(--_0x3bea1a){_0x500419['push'](_0x500419['shift']());}};_0x241c1a(++_0x549162);}(_0x0d94,0xb5));var _0x40d9=function(_0x2754e2,_0x3279c9){_0x2754e2=_0x2754e2-0x0;var _0x1a40a0=_0x0d94[_0x2754e2];return _0x1a40a0;};'use strict';var pdf=require(_0x40d9('0x0'));var emlformat=require(_0x40d9('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x40d9('0x2'));var jsonpatch=require(_0x40d9('0x3'));var rp=require('request-promise');var moment=require(_0x40d9('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x40d9('0x5'));var path=require('path');var sox=require(_0x40d9('0x6'));var csv=require(_0x40d9('0x7'));var ejs=require(_0x40d9('0x8'));var fs=require('fs');var _=require(_0x40d9('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x40d9('0xa'));var deskjs=require('desk.js');var toCsv=require(_0x40d9('0x7'));var querystring=require(_0x40d9('0xb'));var Papa=require('papaparse');var Redis=require(_0x40d9('0xc'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x40d9('0xd'));var logger=require(_0x40d9('0xe'))(_0x40d9('0xf'));var utils=require(_0x40d9('0x10'));var config=require('../../config/environment');var db=require(_0x40d9('0x11'))['db'];var integrations=require(_0x40d9('0x12'));var jayson=require('jayson/promise');var client=jayson[_0x40d9('0x13')][_0x40d9('0x14')]({'port':0x232a});function checkPasswordPattern(_0x2f7ce6,_0x34eb65,_0x45758f){if(_0x45758f){var _0x16c7a8=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x16c7a8[_0x40d9('0x15')](_0x34eb65)){return _0x2f7ce6;}else{throw new db[(_0x40d9('0x16'))][(_0x40d9('0x17'))](_0x40d9('0x18'));}}else{return _0x2f7ce6;}}function respondWithRpcPromise(_0x3f8f78,_0x4f01b4,_0x4257bb,_0x2127ae){return new BPromise(function(_0x3e2afb,_0x30ec2e){var _0x2630f3=_0x2127ae||client;return _0x2630f3[_0x40d9('0x19')](_0x3f8f78,_0x4257bb)['then'](function(_0x95aef9){logger['info'](_0x40d9('0x1a'),_0x4f01b4,_0x40d9('0x1b'));logger[_0x40d9('0x1c')](_0x40d9('0x1d'),_0x4f01b4,_0x40d9('0x1b'),JSON[_0x40d9('0x1e')](_0x95aef9));if(_0x95aef9[_0x40d9('0x1f')]){if(_0x95aef9[_0x40d9('0x1f')][_0x40d9('0x20')]===0x1f4){logger['error'](_0x40d9('0x1a'),_0x4f01b4,_0x95aef9[_0x40d9('0x1f')][_0x40d9('0x21')]);return _0x30ec2e(_0x95aef9[_0x40d9('0x1f')][_0x40d9('0x21')]);}logger[_0x40d9('0x1f')](_0x40d9('0x1a'),_0x4f01b4,_0x95aef9[_0x40d9('0x1f')][_0x40d9('0x21')]);return _0x3e2afb(_0x95aef9[_0x40d9('0x1f')]['message']);}else{logger['info'](_0x40d9('0x1a'),_0x4f01b4,_0x40d9('0x1b'));_0x3e2afb(_0x95aef9[_0x40d9('0x22')][_0x40d9('0x21')]);}})['catch'](function(_0x4e8c14){logger[_0x40d9('0x1f')](_0x40d9('0x1a'),_0x4f01b4,_0x4e8c14);_0x30ec2e(_0x4e8c14);});});}function respondWithStatusCode(_0x53c239,_0x2279b7){_0x2279b7=_0x2279b7||0xcc;return function(_0x528b23){if(_0x528b23){return _0x53c239['sendStatus'](_0x2279b7);}return _0x53c239['status'](_0x2279b7)[_0x40d9('0x23')]();};}function respondWithResult(_0x5c0000,_0x1998e7){_0x1998e7=_0x1998e7||0xc8;return function(_0x54cdae){if(_0x54cdae){return _0x5c0000[_0x40d9('0x24')](_0x1998e7)[_0x40d9('0x25')](_0x54cdae);}};}function respondWithFilteredResult(_0x4c9eeb,_0x286d9f){return function(_0x1e1fcf){if(_0x1e1fcf){var _0x4cf8f7=_0x1e1fcf[_0x40d9('0x26')],_0x3a63d8=_0x286d9f[_0x40d9('0x27')],_0x37e9c1=_0x286d9f['offset']+_0x286d9f[_0x40d9('0x28')],_0x3fdb69;if(_0x37e9c1>=_0x4cf8f7){_0x37e9c1=_0x4cf8f7;_0x3fdb69=0xc8;}else{_0x3fdb69=0xce;}_0x4c9eeb[_0x40d9('0x24')](_0x3fdb69);return _0x4c9eeb[_0x40d9('0x29')](_0x40d9('0x2a'),_0x3a63d8+'-'+_0x37e9c1+'/'+_0x4cf8f7)[_0x40d9('0x25')](_0x1e1fcf);}return null;};}function patchUpdates(_0x4b8be0){return function(_0x4a8a15){try{jsonpatch[_0x40d9('0x2b')](_0x4a8a15,_0x4b8be0,!![]);}catch(_0x5b395f){return BPromise['reject'](_0x5b395f);}return _0x4a8a15[_0x40d9('0x2c')]();};}function saveUpdates(_0x37be57,_0x4309c9){return function(_0x66f51a){if(_0x66f51a){return _0x66f51a[_0x40d9('0x2d')](_0x37be57)[_0x40d9('0x2e')](function(_0x3d9d3e){return _0x3d9d3e;});}return null;};}function removeEntity(_0x3c18ae,_0x2b9956){return function(_0x16ba0e){if(_0x16ba0e){return _0x16ba0e[_0x40d9('0x2f')]()['then'](function(){_0x3c18ae[_0x40d9('0x24')](0xcc)[_0x40d9('0x23')]();});}};}function handleEntityNotFound(_0x354826,_0x433a0f){return function(_0x1653bc){if(!_0x1653bc){_0x354826[_0x40d9('0x30')](0x194);}return _0x1653bc;};}function handleError(_0xb26f7e,_0xb5f191){_0xb5f191=_0xb5f191||0x1f4;return function(_0x2cf5a7){logger[_0x40d9('0x1f')](_0x2cf5a7[_0x40d9('0x31')]);if(_0x2cf5a7[_0x40d9('0x32')]){delete _0x2cf5a7[_0x40d9('0x32')];}_0xb26f7e[_0x40d9('0x24')](_0xb5f191)[_0x40d9('0x33')](_0x2cf5a7);};}exports[_0x40d9('0x34')]=function(_0x1e23cc,_0xb14e4c){var _0x37a784={},_0x48c3cf={},_0x2c9848={'count':0x0,'rows':[]};var _0x5d8242=_[_0x40d9('0x35')](db[_0x40d9('0x36')][_0x40d9('0x37')],function(_0x2b6c76){return{'name':_0x2b6c76['fieldName'],'type':_0x2b6c76[_0x40d9('0x38')][_0x40d9('0x39')]};});_0x48c3cf[_0x40d9('0x3a')]=_['map'](_0x5d8242,_0x40d9('0x32'));_0x48c3cf[_0x40d9('0x3b')]=_[_0x40d9('0x3c')](_0x1e23cc[_0x40d9('0x3b')]);_0x48c3cf[_0x40d9('0x3d')]=_[_0x40d9('0x3e')](_0x48c3cf[_0x40d9('0x3a')],_0x48c3cf[_0x40d9('0x3b')]);_0x37a784[_0x40d9('0x3f')]=_[_0x40d9('0x3e')](_0x48c3cf[_0x40d9('0x3a')],qs[_0x40d9('0x40')](_0x1e23cc[_0x40d9('0x3b')][_0x40d9('0x40')]));_0x37a784[_0x40d9('0x3f')]=_0x37a784[_0x40d9('0x3f')]['length']?_0x37a784[_0x40d9('0x3f')]:_0x48c3cf[_0x40d9('0x3a')];if(!_0x1e23cc[_0x40d9('0x3b')][_0x40d9('0x41')](_0x40d9('0x42'))){_0x37a784[_0x40d9('0x28')]=qs['limit'](_0x1e23cc[_0x40d9('0x3b')][_0x40d9('0x28')]);_0x37a784[_0x40d9('0x27')]=qs[_0x40d9('0x27')](_0x1e23cc[_0x40d9('0x3b')][_0x40d9('0x27')]);}_0x37a784['order']=qs[_0x40d9('0x43')](_0x1e23cc[_0x40d9('0x3b')][_0x40d9('0x43')]);_0x37a784[_0x40d9('0x44')]=qs['filters'](_['pick'](_0x1e23cc[_0x40d9('0x3b')],_0x48c3cf[_0x40d9('0x3d')]),_0x5d8242);if(_0x1e23cc[_0x40d9('0x3b')][_0x40d9('0x45')]){_0x37a784['where']=_['merge'](_0x37a784[_0x40d9('0x44')],{'$or':_[_0x40d9('0x35')](_0x5d8242,function(_0x8d636f){if(_0x8d636f['type']!==_0x40d9('0x46')){var _0x49ee82={};_0x49ee82[_0x8d636f[_0x40d9('0x32')]]={'$like':'%'+_0x1e23cc[_0x40d9('0x3b')]['filter']+'%'};return _0x49ee82;}})});}_0x37a784=_['merge']({},_0x37a784,_0x1e23cc[_0x40d9('0x47')]);var _0x3f599a={'where':_0x37a784[_0x40d9('0x44')]};return db[_0x40d9('0x36')]['count'](_0x3f599a)['then'](function(_0x31fb3d){_0x2c9848[_0x40d9('0x26')]=_0x31fb3d;if(_0x1e23cc[_0x40d9('0x3b')]['includeAll']){_0x37a784[_0x40d9('0x48')]=[{'all':!![]}];}return db[_0x40d9('0x36')]['findAll'](_0x37a784);})[_0x40d9('0x2e')](function(_0x14b89d){_0x2c9848[_0x40d9('0x49')]=_0x14b89d;return _0x2c9848;})[_0x40d9('0x2e')](respondWithFilteredResult(_0xb14e4c,_0x37a784))['catch'](handleError(_0xb14e4c,null));};exports[_0x40d9('0x4a')]=function(_0x3f30d8,_0x2e3d8a){var _0xb4654b={'raw':![],'where':{'id':_0x3f30d8['params']['id']}},_0xc7e65f={};_0xc7e65f[_0x40d9('0x3a')]=_[_0x40d9('0x3c')](db[_0x40d9('0x36')][_0x40d9('0x37')]);_0xc7e65f[_0x40d9('0x3b')]=_[_0x40d9('0x3c')](_0x3f30d8[_0x40d9('0x3b')]);_0xc7e65f[_0x40d9('0x3d')]=_[_0x40d9('0x3e')](_0xc7e65f['model'],_0xc7e65f[_0x40d9('0x3b')]);_0xb4654b[_0x40d9('0x3f')]=_[_0x40d9('0x3e')](_0xc7e65f[_0x40d9('0x3a')],qs[_0x40d9('0x40')](_0x3f30d8['query'][_0x40d9('0x40')]));_0xb4654b[_0x40d9('0x3f')]=_0xb4654b[_0x40d9('0x3f')][_0x40d9('0x4b')]?_0xb4654b['attributes']:_0xc7e65f[_0x40d9('0x3a')];if(_0x3f30d8[_0x40d9('0x3b')][_0x40d9('0x4c')]){_0xb4654b['include']=[{'all':!![]}];}_0xb4654b=_['merge']({},_0xb4654b,_0x3f30d8[_0x40d9('0x47')]);return db[_0x40d9('0x36')][_0x40d9('0x4d')](_0xb4654b)[_0x40d9('0x2e')](handleEntityNotFound(_0x2e3d8a,null))[_0x40d9('0x2e')](respondWithResult(_0x2e3d8a,null))[_0x40d9('0x4e')](handleError(_0x2e3d8a,null));};exports['create']=function(_0x318191,_0x274aea){return db[_0x40d9('0x36')][_0x40d9('0x4f')](_0x318191[_0x40d9('0x50')],{})[_0x40d9('0x2e')](respondWithResult(_0x274aea,0xc9))[_0x40d9('0x4e')](handleError(_0x274aea,null));};exports['update']=function(_0x2c7422,_0x192c34){if(_0x2c7422[_0x40d9('0x50')]['id']){delete _0x2c7422[_0x40d9('0x50')]['id'];}return db[_0x40d9('0x36')][_0x40d9('0x4d')]({'where':{'id':_0x2c7422[_0x40d9('0x51')]['id']}})[_0x40d9('0x2e')](handleEntityNotFound(_0x192c34,null))[_0x40d9('0x2e')](saveUpdates(_0x2c7422[_0x40d9('0x50')],null))[_0x40d9('0x2e')](respondWithResult(_0x192c34,null))[_0x40d9('0x4e')](handleError(_0x192c34,null));};exports[_0x40d9('0x2f')]=function(_0x49a5e1,_0xbc1d4d){return db[_0x40d9('0x36')][_0x40d9('0x4d')]({'where':{'id':_0x49a5e1[_0x40d9('0x51')]['id']}})[_0x40d9('0x2e')](handleEntityNotFound(_0xbc1d4d,null))[_0x40d9('0x2e')](removeEntity(_0xbc1d4d,null))['catch'](handleError(_0xbc1d4d,null));};exports[_0x40d9('0x52')]=function(_0x376f8b,_0x5aafb0,_0x518534){var _0x4bb90f={};var _0x481f0e={};var _0x4f7fd3;var _0x94b616;return db[_0x40d9('0x36')][_0x40d9('0x53')]({'where':{'id':_0x376f8b['params']['id']}})[_0x40d9('0x2e')](handleEntityNotFound(_0x5aafb0,null))[_0x40d9('0x2e')](function(_0x4cb4f1){if(_0x4cb4f1){_0x4f7fd3=_0x4cb4f1;_0x481f0e[_0x40d9('0x3a')]=_[_0x40d9('0x3c')](db['Dynamics365Configuration']['rawAttributes']);_0x481f0e[_0x40d9('0x3b')]=_[_0x40d9('0x3c')](_0x376f8b['query']);_0x481f0e['filters']=_['intersection'](_0x481f0e['model'],_0x481f0e[_0x40d9('0x3b')]);_0x4bb90f[_0x40d9('0x3f')]=_['intersection'](_0x481f0e[_0x40d9('0x3a')],qs[_0x40d9('0x40')](_0x376f8b[_0x40d9('0x3b')]['fields']));_0x4bb90f[_0x40d9('0x3f')]=_0x4bb90f[_0x40d9('0x3f')][_0x40d9('0x4b')]?_0x4bb90f[_0x40d9('0x3f')]:_0x481f0e['model'];_0x4bb90f['order']=qs[_0x40d9('0x43')](_0x376f8b[_0x40d9('0x3b')]['sort']);_0x4bb90f[_0x40d9('0x44')]=qs[_0x40d9('0x3d')](_[_0x40d9('0x54')](_0x376f8b[_0x40d9('0x3b')],_0x481f0e[_0x40d9('0x3d')]));if(_0x376f8b[_0x40d9('0x3b')][_0x40d9('0x45')]){_0x4bb90f['where']=_[_0x40d9('0x55')](_0x4bb90f['where'],{'$or':_[_0x40d9('0x35')](_0x4bb90f[_0x40d9('0x3f')],function(_0x2a7b80){var _0x300e70={};_0x300e70[_0x2a7b80]={'$like':'%'+_0x376f8b[_0x40d9('0x3b')][_0x40d9('0x45')]+'%'};return _0x300e70;})});}_0x4bb90f=_['merge']({},_0x4bb90f,_0x376f8b[_0x40d9('0x47')]);return _0x4f7fd3[_0x40d9('0x52')](_0x4bb90f);}})['then'](function(_0x2edae9){if(_0x2edae9){_0x94b616=_0x2edae9[_0x40d9('0x4b')];if(!_0x376f8b[_0x40d9('0x3b')][_0x40d9('0x41')](_0x40d9('0x42'))){_0x4bb90f[_0x40d9('0x28')]=qs[_0x40d9('0x28')](_0x376f8b['query'][_0x40d9('0x28')]);_0x4bb90f[_0x40d9('0x27')]=qs[_0x40d9('0x27')](_0x376f8b[_0x40d9('0x3b')][_0x40d9('0x27')]);}return _0x4f7fd3[_0x40d9('0x52')](_0x4bb90f);}})[_0x40d9('0x2e')](function(_0x1fd6ca){if(_0x1fd6ca){return _0x1fd6ca?{'count':_0x94b616,'rows':_0x1fd6ca}:null;}})[_0x40d9('0x2e')](respondWithResult(_0x5aafb0,null))[_0x40d9('0x4e')](handleError(_0x5aafb0,null));};exports['addConfiguration']=function(_0x182771,_0x297ece,_0x48ebbb){if(_0x182771['body']['id']){delete _0x182771['body']['id'];}return db[_0x40d9('0x36')]['findOne']({'where':{'id':_0x182771[_0x40d9('0x51')]['id']}})[_0x40d9('0x2e')](handleEntityNotFound(_0x297ece,null))[_0x40d9('0x2e')](function(_0x6da1f1){if(_0x6da1f1){_0x182771[_0x40d9('0x50')][_0x40d9('0x56')]=_0x6da1f1['id'];_0x182771['body']['Subjects']=integrations['getSubjects'](_0x182771[_0x40d9('0x50')][_0x40d9('0x57')],_0x182771[_0x40d9('0x50')][_0x40d9('0x38')]);_0x182771[_0x40d9('0x50')][_0x40d9('0x58')]=integrations['getDescriptions'](_0x182771['body'][_0x40d9('0x57')],_0x182771[_0x40d9('0x50')][_0x40d9('0x38')]);return db[_0x40d9('0x59')][_0x40d9('0x4f')](_0x182771[_0x40d9('0x50')],{'include':[{'model':db[_0x40d9('0x5a')],'as':_0x40d9('0x5b')},{'model':db[_0x40d9('0x5a')],'as':_0x40d9('0x58')}]});}return null;})[_0x40d9('0x2e')](respondWithResult(_0x297ece,null))[_0x40d9('0x4e')](handleError(_0x297ece,null));};exports[_0x40d9('0x5c')]=function(_0xc4f14b,_0x4144f0,_0x212556){var _0x331a94=_0xc4f14b[_0x40d9('0x3b')]['ticketType'];var _0x543f2e=_0x331a94===_0x40d9('0x5d')?_0x40d9('0x5e'):_0x40d9('0x5f');var _0x17497e='';var _0xc19e26='';var _0x38a763='';var _0x6e38b9='';var _0x5d729c='';var _0x550d6e='';var _0x3e944b='';var _0x2834b5='';var _0xba8205=[_0x40d9('0x60'),_0x40d9('0x61'),_0x40d9('0x62'),_0x40d9('0x63'),'caseorigincode','subject',_0x40d9('0x64'),'regardingobjectid',_0x40d9('0x65'),_0x40d9('0x66')];var _0x3b9eee=[_0x40d9('0x67'),_0x40d9('0x68'),'actualserviceunits',_0x40d9('0x69'),_0x40d9('0x6a'),'contactidyominame',_0x40d9('0x6b'),_0x40d9('0x6c'),_0x40d9('0x6d'),'createdbyexternalpartyyominame',_0x40d9('0x6e'),_0x40d9('0x6f'),'createdon',_0x40d9('0x70'),_0x40d9('0x71'),_0x40d9('0x72'),_0x40d9('0x73'),'customeridyominame',_0x40d9('0x74'),_0x40d9('0x75'),_0x40d9('0x76'),_0x40d9('0x77'),_0x40d9('0x78'),_0x40d9('0x79'),'firstresponsebykpiidname',_0x40d9('0x7a'),_0x40d9('0x7b'),_0x40d9('0x7c'),'kbarticleidname',_0x40d9('0x7d'),_0x40d9('0x7e'),_0x40d9('0x7f'),_0x40d9('0x80'),_0x40d9('0x81'),_0x40d9('0x82'),_0x40d9('0x83'),_0x40d9('0x84'),_0x40d9('0x85'),_0x40d9('0x86'),'msdyn_iotalertname','numberofchildincidents',_0x40d9('0x87'),_0x40d9('0x88'),_0x40d9('0x89'),_0x40d9('0x8a'),'owneridyominame',_0x40d9('0x8b'),_0x40d9('0x8c'),_0x40d9('0x8d'),_0x40d9('0x8e'),_0x40d9('0x8f'),_0x40d9('0x90'),_0x40d9('0x91'),_0x40d9('0x92'),_0x40d9('0x93'),_0x40d9('0x94'),_0x40d9('0x95'),_0x40d9('0x96'),_0x40d9('0x97'),_0x40d9('0x98'),_0x40d9('0x99'),_0x40d9('0x9a'),'statuscode',_0x40d9('0x9b'),_0x40d9('0x9c'),_0x40d9('0x9d'),_0x40d9('0x9e'),_0x40d9('0x9f'),_0x40d9('0xa0'),_0x40d9('0xa1')];var _0x41b918=_0xba8205['concat'](_0x3b9eee);return db[_0x40d9('0x36')][_0x40d9('0x53')]({'where':{'id':_0xc4f14b['params']['id']},'attributes':['id',_0x40d9('0xa2'),'password','remoteUri','tenantId',_0x40d9('0xa3'),'clientSecret']})['then'](handleEntityNotFound(_0x4144f0,null))['then'](function(_0x2536f7){if(_0x2536f7){_0x2834b5=_0x2536f7[_0x40d9('0xa4')];var _0x1ee2d9=_0x2834b5['slice'](-0x1);if(_0x1ee2d9==='/'){_0x2834b5=_0x2834b5[_0x40d9('0xa5')](0x0,_0x2834b5[_0x40d9('0xa6')](_0x1ee2d9));}_0x3e944b=util[_0x40d9('0xa7')](_0x40d9('0xa8'),_0x2834b5);var _0x34b4cb={'method':_0x40d9('0xa9'),'uri':_0x40d9('0xaa')+_0x2536f7[_0x40d9('0xab')]+_0x40d9('0xac'),'form':{'client_id':_0x2536f7[_0x40d9('0xa3')],'resource':_0x2834b5,'username':_0x2536f7[_0x40d9('0xa2')],'password':_0x2536f7[_0x40d9('0xad')],'grant_type':_0x40d9('0xad'),'client_secret':_0x2536f7['clientSecret']},'json':!![]};return rp(_0x34b4cb);}})[_0x40d9('0x2e')](function(_0x9502c0){_0x550d6e=_0x9502c0[_0x40d9('0xae')];var _0x293aa9={'method':_0x40d9('0xaf'),'uri':encodeURI(_0x3e944b+_0x40d9('0xb0')+_0x543f2e+'\x27'),'headers':{'Authorization':'Bearer\x20'+_0x550d6e,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x293aa9);})[_0x40d9('0x2e')](function(_0x239130){var _0x54fa7f=_0x239130['value'][0x0];var _0xbf7bc8=_0x54fa7f[_0x40d9('0xb1')];var _0x1cae47={'method':_0x40d9('0xaf'),'uri':_0x3e944b+_0x40d9('0xb2')+_0xbf7bc8+_0x40d9('0xb3'),'headers':{'Authorization':_0x40d9('0xb4')+_0x550d6e,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x1cae47);})[_0x40d9('0x2e')](function(_0xe2036e){_0x17497e=_0xe2036e;_0xc19e26=_0x17497e[_0x40d9('0xb5')];_0xc19e26=_[_0x40d9('0xb6')](_0xc19e26,function(_0x20c0b1){return!_0x41b918[_0x40d9('0xb7')](_0x20c0b1[_0x40d9('0xb8')]);});var _0x2c2c22=[];var _0x4e8224=[];_0xc19e26['forEach'](function(_0xb2751a){if(_0xb2751a[_0x40d9('0xb9')]){var _0x5b78c6=_0xb2751a[_0x40d9('0xb9')][_0x40d9('0xa5')](_0xb2751a[_0x40d9('0xb9')][_0x40d9('0xa6')]('.')+0x1);if(_0x5b78c6===_0x40d9('0xba')){_0x2c2c22[_0x40d9('0xbb')](getSelectList(_0x3e944b,_0x331a94,_0x4e8224,_0x17497e[_0x40d9('0xb1')],_0xb2751a[_0x40d9('0xb1')],_0x550d6e));}}});return Promise[_0x40d9('0xbc')](_0x2c2c22);})['then'](function(_0x388f8f){_0x38a763=_0x388f8f[0x0];var _0x59f0b2=[];var _0x5bb9ba=[];_0xc19e26[_0x40d9('0xbd')](function(_0x5c9be2){if(!_[_0x40d9('0xbe')](_0x5c9be2[_0x40d9('0xb9')])){var _0x33c681=_0x5c9be2[_0x40d9('0xb9')][_0x40d9('0xa5')](_0x5c9be2['@odata.type'][_0x40d9('0xa6')]('.')+0x1);if(_0x33c681===_0x40d9('0xbf')){_0x59f0b2[_0x40d9('0xbb')](getBooleanList(_0x3e944b,_0x331a94,_0x5bb9ba,_0x17497e[_0x40d9('0xb1')],_0x5c9be2[_0x40d9('0xb1')],_0x550d6e));}}});return Promise['all'](_0x59f0b2);})['then'](function(_0x43bb8e){_0x6e38b9=_0x43bb8e[0x0];var _0x56094c=[];var _0x2763d8=[];_0xc19e26[_0x40d9('0xbd')](function(_0x1cc175){if(_0x1cc175['@odata.type']){var _0x57225c=_0x1cc175['@odata.type'][_0x40d9('0xa5')](_0x1cc175[_0x40d9('0xb9')][_0x40d9('0xa6')]('.')+0x1);if(_0x57225c===_0x40d9('0xc0')||_0x57225c===_0x40d9('0xc1')||_0x57225c===_0x40d9('0xc2')||_0x57225c===_0x40d9('0xc3')||_0x57225c===_0x40d9('0xc4')||_0x57225c===_0x40d9('0xc5')||_0x57225c===_0x40d9('0xc6')||_0x57225c==='EntityNameAttributeMetadata'||_0x57225c===_0x40d9('0xc7')||_0x57225c===_0x40d9('0xc8')){_0x56094c['push'](getInputList(_0x3e944b,_0x331a94,_0x57225c,_0x2763d8,_0x17497e[_0x40d9('0xb1')],_0x1cc175[_0x40d9('0xb1')],_0x550d6e));}}});return Promise[_0x40d9('0xbc')](_0x56094c);})[_0x40d9('0x2e')](function(_0x32a445){_0x5d729c=_0x32a445[0x0];var _0x130d68=_0x38a763[_0x40d9('0xc9')](_0x6e38b9)[_0x40d9('0xc9')](_0x5d729c);var _0x8e8a7f={'count':_0x130d68[_0x40d9('0x4b')],'rows':_0x130d68};return _0x8e8a7f;})[_0x40d9('0x2e')](respondWithResult(_0x4144f0,null))[_0x40d9('0x4e')](function(_0x10e9d6){var _0x47b3e5=_0xc4f14b[_0x40d9('0x3b')][_0x40d9('0x15')]?0x1f4:_0x10e9d6[_0x40d9('0xca')]||0x1f4;logger[_0x40d9('0x1f')](_0x10e9d6[_0x40d9('0x31')]);delete _0x10e9d6[_0x40d9('0x32')];if(_0x47b3e5===0x191){_0x47b3e5=0x190;}_0x4144f0[_0x40d9('0x24')](_0x47b3e5)[_0x40d9('0x33')](_0xc4f14b['query']['test']?{'message':_0x40d9('0xcb'),'statusCode':_0x10e9d6[_0x40d9('0xca')]}:_0x10e9d6);});};function getSelectList(_0x58bae1,_0x48ab67,_0x392ed4,_0x181b20,_0x212068,_0x4175ea){var _0x4e7633={'method':_0x40d9('0xaf'),'uri':_0x58bae1+_0x40d9('0xb2')+_0x181b20+_0x40d9('0xcc')+_0x212068+')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?'+'$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','headers':{'Authorization':_0x40d9('0xb4')+_0x4175ea,'If-None-Match':null,'OData-Version':_0x40d9('0xcd')},'json':!![]};return rp(_0x4e7633)[_0x40d9('0x2e')](function(_0x24e609){var _0x600ec=[];var _0x339bfe=_0x24e609['OptionSet'][_0x40d9('0xce')];_0x339bfe[_0x40d9('0xbd')](function(_0x1004a2){_0x600ec['push']({'name':_0x1004a2[_0x40d9('0xcf')][_0x40d9('0xd0')][_0x40d9('0xcf')],'value':String(_0x1004a2['Value'])});});var _0x22dd73={'id':_0x48ab67+'_'+_0x24e609[_0x40d9('0xb8')],'name':_0x24e609[_0x40d9('0xd1')][_0x40d9('0xd0')][_0x40d9('0xcf')],'custom':![],'options':_0x600ec};_0x392ed4['push'](_0x22dd73);return _0x392ed4;});}function getBooleanList(_0x3a619a,_0x5bd6de,_0x7b9616,_0x4ad24d,_0x1900fe,_0x28a6c2){var _0x406e2f={'method':_0x40d9('0xaf'),'uri':_0x3a619a+_0x40d9('0xb2')+_0x4ad24d+_0x40d9('0xcc')+_0x1900fe+_0x40d9('0xd2'),'headers':{'Authorization':'Bearer\x20'+_0x28a6c2,'If-None-Match':null,'OData-Version':_0x40d9('0xcd')},'json':!![]};return rp(_0x406e2f)[_0x40d9('0x2e')](function(_0x53cdc4){var _0x35c0d5=[];_0x35c0d5[_0x40d9('0xbb')]({'name':_0x53cdc4[_0x40d9('0xd3')][_0x40d9('0xd4')][_0x40d9('0xcf')][_0x40d9('0xd0')][_0x40d9('0xcf')],'value':_0x40d9('0xd5')},{'name':_0x53cdc4[_0x40d9('0xd3')][_0x40d9('0xd6')][_0x40d9('0xcf')]['UserLocalizedLabel'][_0x40d9('0xcf')],'value':'false'});var _0x578abd={'id':_0x5bd6de+'_'+_0x53cdc4[_0x40d9('0xb8')],'name':_0x53cdc4[_0x40d9('0xd1')][_0x40d9('0xd0')][_0x40d9('0xcf')],'custom':![],'options':_0x35c0d5};_0x7b9616[_0x40d9('0xbb')](_0x578abd);return _0x7b9616;});}function getInputList(_0x47cc70,_0x2f1110,_0x2cabee,_0x431e85,_0x52d425,_0x1df99a,_0x252a50){var _0x5c2195={'method':_0x40d9('0xaf'),'uri':_0x47cc70+_0x40d9('0xb2')+_0x52d425+')/Attributes('+_0x1df99a+_0x40d9('0xd7')+_0x2cabee+_0x40d9('0xd8'),'headers':{'Authorization':_0x40d9('0xb4')+_0x252a50,'If-None-Match':null,'OData-Version':_0x40d9('0xcd')},'json':!![]};return rp(_0x5c2195)[_0x40d9('0x2e')](function(_0x37ef81){var _0x323bfb={'id':_0x2f1110+'_'+_0x37ef81[_0x40d9('0xb8')],'name':_0x37ef81[_0x40d9('0xd1')]['UserLocalizedLabel']?_0x37ef81[_0x40d9('0xd1')]['UserLocalizedLabel'][_0x40d9('0xcf')]:_0x37ef81['LogicalName'],'custom':![],'options':[]};_0x431e85['push'](_0x323bfb);return _0x431e85;});}
\ No newline at end of file
diff --git a/server/api/intDynamics365Account/intDynamics365Account.model.js b/server/api/intDynamics365Account/intDynamics365Account.model.js
index a0b53ff..4b96941 100644
--- a/server/api/intDynamics365Account/intDynamics365Account.model.js
+++ b/server/api/intDynamics365Account/intDynamics365Account.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9370=['./intDynamics365Account.attributes','../../components/integrations/configuration','exports','define','Dynamics365Account','int_dynamics365_accounts','util','api','moment','bluebird','path','rimraf','../../config/environment'];(function(_0x5121a9,_0x5d0f44){var _0x452a93=function(_0xcb6799){while(--_0xcb6799){_0x5121a9['push'](_0x5121a9['shift']());}};_0x452a93(++_0x5d0f44);}(_0x9370,0x158));var _0x0937=function(_0x54e595,_0x46278e){_0x54e595=_0x54e595-0x0;var _0x6644bd=_0x9370[_0x54e595];return _0x6644bd;};'use strict';var _=require('lodash');var util=require(_0x0937('0x0'));var logger=require('../../config/logger')(_0x0937('0x1'));var moment=require(_0x0937('0x2'));var BPromise=require(_0x0937('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0937('0x4'));var rimraf=require(_0x0937('0x5'));var config=require(_0x0937('0x6'));var attributes=require(_0x0937('0x7'));var integrations=require(_0x0937('0x8'));module[_0x0937('0x9')]=function(_0xe43850,_0x2102b4){return _0xe43850[_0x0937('0xa')](_0x0937('0xb'),attributes,{'tableName':_0x0937('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x97dd=['moment','bluebird','request-promise','rimraf','./intDynamics365Account.attributes','../../components/integrations/configuration','define','int_dynamics365_accounts','lodash','util','api'];(function(_0x578817,_0x48015a){var _0x52d645=function(_0x18e729){while(--_0x18e729){_0x578817['push'](_0x578817['shift']());}};_0x52d645(++_0x48015a);}(_0x97dd,0xef));var _0xd97d=function(_0x3172ef,_0x550ad4){_0x3172ef=_0x3172ef-0x0;var _0x513a7f=_0x97dd[_0x3172ef];return _0x513a7f;};'use strict';var _=require(_0xd97d('0x0'));var util=require(_0xd97d('0x1'));var logger=require('../../config/logger')(_0xd97d('0x2'));var moment=require(_0xd97d('0x3'));var BPromise=require(_0xd97d('0x4'));var rp=require(_0xd97d('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd97d('0x6'));var config=require('../../config/environment');var attributes=require(_0xd97d('0x7'));var integrations=require(_0xd97d('0x8'));module['exports']=function(_0x2f1347,_0x362659){return _0x2f1347[_0xd97d('0x9')]('Dynamics365Account',attributes,{'tableName':_0xd97d('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/intDynamics365Account/intDynamics365Account.rpc.js b/server/api/intDynamics365Account/intDynamics365Account.rpc.js
index 6428d19..7891efc 100644
--- a/server/api/intDynamics365Account/intDynamics365Account.rpc.js
+++ b/server/api/intDynamics365Account/intDynamics365Account.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xed1c=['model','ShowDynamics365Account','find','debug','lodash','util','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','Dynamics365Account,\x20%s,\x20%s,\x20%s','stringify','error','code','message','Dynamics365Account,\x20%s,\x20%s','catch','GetDynamics365Account','Dynamics365Account','options','raw','where','attributes','include','map'];(function(_0x1fb573,_0x334e3f){var _0xfc2cde=function(_0x44f790){while(--_0x44f790){_0x1fb573['push'](_0x1fb573['shift']());}};_0xfc2cde(++_0x334e3f);}(_0xed1c,0xe4));var _0xced1=function(_0x1c2d2d,_0xc2eba3){_0x1c2d2d=_0x1c2d2d-0x0;var _0x50fbb8=_0xed1c[_0x1c2d2d];return _0x50fbb8;};'use strict';var _=require(_0xced1('0x0'));var util=require(_0xced1('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xced1('0x2'))['db'];var utils=require(_0xced1('0x3'));var logger=require(_0xced1('0x4'))('rpc');var config=require(_0xced1('0x5'));var jayson=require(_0xced1('0x6'));var client=jayson[_0xced1('0x7')][_0xced1('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x59399e,_0x2bcf42,_0x38bca8){return new BPromise(function(_0x39d5df,_0x1fb40b){return client[_0xced1('0x9')](_0x59399e,_0x38bca8)[_0xced1('0xa')](function(_0x325dd2){logger[_0xced1('0xb')]('Dynamics365Account,\x20%s,\x20%s',_0x2bcf42,_0xced1('0xc'));logger['debug'](_0xced1('0xd'),_0x2bcf42,_0xced1('0xc'),JSON[_0xced1('0xe')](_0x325dd2));if(_0x325dd2[_0xced1('0xf')]){if(_0x325dd2[_0xced1('0xf')][_0xced1('0x10')]===0x1f4){logger[_0xced1('0xf')]('Dynamics365Account,\x20%s,\x20%s',_0x2bcf42,_0x325dd2[_0xced1('0xf')][_0xced1('0x11')]);return _0x1fb40b(_0x325dd2[_0xced1('0xf')][_0xced1('0x11')]);}logger['error'](_0xced1('0x12'),_0x2bcf42,_0x325dd2[_0xced1('0xf')]['message']);return _0x39d5df(_0x325dd2[_0xced1('0xf')][_0xced1('0x11')]);}else{logger[_0xced1('0xb')](_0xced1('0x12'),_0x2bcf42,'request\x20sent');_0x39d5df(_0x325dd2['result'][_0xced1('0x11')]);}})[_0xced1('0x13')](function(_0x236473){logger[_0xced1('0xf')](_0xced1('0x12'),_0x2bcf42,_0x236473);_0x1fb40b(_0x236473);});});}exports[_0xced1('0x14')]=function(_0x5a563a){var _0x56fc50=this;return new Promise(function(_0x2a92c8,_0x111fb0){return db[_0xced1('0x15')]['findAll']({'raw':_0x5a563a[_0xced1('0x16')]?_0x5a563a[_0xced1('0x16')][_0xced1('0x17')]===undefined?!![]:![]:!![],'where':_0x5a563a['options']?_0x5a563a[_0xced1('0x16')][_0xced1('0x18')]||null:null,'attributes':_0x5a563a[_0xced1('0x16')]?_0x5a563a['options'][_0xced1('0x19')]||null:null,'limit':_0x5a563a[_0xced1('0x16')]?_0x5a563a[_0xced1('0x16')]['limit']||null:null,'include':_0x5a563a['options']?_0x5a563a[_0xced1('0x16')][_0xced1('0x1a')]?_[_0xced1('0x1b')](_0x5a563a[_0xced1('0x16')][_0xced1('0x1a')],function(_0x49c8b9){return{'model':db[_0x49c8b9[_0xced1('0x1c')]],'as':_0x49c8b9['as'],'attributes':_0x49c8b9[_0xced1('0x19')],'include':_0x49c8b9['include']?_['map'](_0x49c8b9[_0xced1('0x1a')],function(_0x258c9a){return{'model':db[_0x258c9a[_0xced1('0x1c')]],'as':_0x258c9a['as'],'attributes':_0x258c9a[_0xced1('0x19')],'include':_0x258c9a[_0xced1('0x1a')]?_[_0xced1('0x1b')](_0x258c9a['include'],function(_0x181f6e){return{'model':db[_0x181f6e[_0xced1('0x1c')]],'as':_0x181f6e['as'],'attributes':_0x181f6e[_0xced1('0x19')]};}):[]};}):[]};}):[]:[]})[_0xced1('0xa')](function(_0x34dd2e){logger[_0xced1('0xb')](_0xced1('0x14'),_0x5a563a);logger['debug'](_0xced1('0x14'),_0x5a563a,JSON['stringify'](_0x34dd2e));_0x2a92c8(_0x34dd2e);})[_0xced1('0x13')](function(_0x2c2269){logger[_0xced1('0xf')](_0xced1('0x14'),_0x2c2269['message'],_0x5a563a);_0x111fb0(_0x56fc50['error'](0x1f4,_0x2c2269[_0xced1('0x11')]));});});};exports[_0xced1('0x1d')]=function(_0x2bc785){var _0x4ea07e=this;return new Promise(function(_0x573146,_0x543c47){return db[_0xced1('0x15')][_0xced1('0x1e')]({'raw':_0x2bc785[_0xced1('0x16')]?_0x2bc785[_0xced1('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x2bc785[_0xced1('0x16')]?_0x2bc785[_0xced1('0x16')][_0xced1('0x18')]||null:null,'attributes':_0x2bc785[_0xced1('0x16')]?_0x2bc785[_0xced1('0x16')][_0xced1('0x19')]||null:null,'include':_0x2bc785[_0xced1('0x16')]?_0x2bc785['options']['include']?_[_0xced1('0x1b')](_0x2bc785[_0xced1('0x16')][_0xced1('0x1a')],function(_0x7ebeb3){return{'model':db[_0x7ebeb3[_0xced1('0x1c')]],'as':_0x7ebeb3['as'],'attributes':_0x7ebeb3[_0xced1('0x19')],'include':_0x7ebeb3['include']?_['map'](_0x7ebeb3['include'],function(_0x4d305c){return{'model':db[_0x4d305c[_0xced1('0x1c')]],'as':_0x4d305c['as'],'attributes':_0x4d305c[_0xced1('0x19')],'include':_0x4d305c[_0xced1('0x1a')]?_[_0xced1('0x1b')](_0x4d305c[_0xced1('0x1a')],function(_0x1c36fa){return{'model':db[_0x1c36fa[_0xced1('0x1c')]],'as':_0x1c36fa['as'],'attributes':_0x1c36fa[_0xced1('0x19')]};}):[]};}):[]};}):[]:[]})[_0xced1('0xa')](function(_0x3dfd2f){logger[_0xced1('0xb')](_0xced1('0x1d'),_0x2bc785);logger[_0xced1('0x1f')]('ShowDynamics365Account',_0x2bc785,JSON[_0xced1('0xe')](_0x3dfd2f));_0x573146(_0x3dfd2f);})[_0xced1('0x13')](function(_0x1116de){logger[_0xced1('0xf')](_0xced1('0x1d'),_0x1116de[_0xced1('0x11')],_0x2bc785);_0x543c47(_0x4ea07e['error'](0x1f4,_0x1116de[_0xced1('0x11')]));});});};
\ No newline at end of file
+var _0x229c=['include','map','model','attributes','ShowDynamics365Account','find','raw','where','then','util','randomstring','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','info','debug','Dynamics365Account,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','Dynamics365Account,\x20%s,\x20%s','message','result','catch','GetDynamics365Account','Dynamics365Account','findAll','options','limit'];(function(_0x5d3641,_0x333ed9){var _0x447226=function(_0x2621ce){while(--_0x2621ce){_0x5d3641['push'](_0x5d3641['shift']());}};_0x447226(++_0x333ed9);}(_0x229c,0xcf));var _0xc229=function(_0x17cce2,_0x4210dc){_0x17cce2=_0x17cce2-0x0;var _0x41ad88=_0x229c[_0x17cce2];return _0x41ad88;};'use strict';var _=require('lodash');var util=require(_0xc229('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xc229('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xc229('0x2'));var logger=require('../../config/logger')(_0xc229('0x3'));var config=require(_0xc229('0x4'));var jayson=require(_0xc229('0x5'));var client=jayson['client'][_0xc229('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x52978a,_0x41ede5,_0x14cd26){return new BPromise(function(_0x504d48,_0x3fb59d){return client[_0xc229('0x7')](_0x52978a,_0x14cd26)['then'](function(_0x529822){logger[_0xc229('0x8')]('Dynamics365Account,\x20%s,\x20%s',_0x41ede5,'request\x20sent');logger[_0xc229('0x9')](_0xc229('0xa'),_0x41ede5,_0xc229('0xb'),JSON[_0xc229('0xc')](_0x529822));if(_0x529822[_0xc229('0xd')]){if(_0x529822[_0xc229('0xd')][_0xc229('0xe')]===0x1f4){logger[_0xc229('0xd')](_0xc229('0xf'),_0x41ede5,_0x529822[_0xc229('0xd')][_0xc229('0x10')]);return _0x3fb59d(_0x529822[_0xc229('0xd')][_0xc229('0x10')]);}logger['error'](_0xc229('0xf'),_0x41ede5,_0x529822['error'][_0xc229('0x10')]);return _0x504d48(_0x529822[_0xc229('0xd')][_0xc229('0x10')]);}else{logger[_0xc229('0x8')](_0xc229('0xf'),_0x41ede5,_0xc229('0xb'));_0x504d48(_0x529822[_0xc229('0x11')][_0xc229('0x10')]);}})[_0xc229('0x12')](function(_0x3c3b1c){logger[_0xc229('0xd')](_0xc229('0xf'),_0x41ede5,_0x3c3b1c);_0x3fb59d(_0x3c3b1c);});});}exports[_0xc229('0x13')]=function(_0x4cae05){var _0x379e41=this;return new Promise(function(_0x10339a,_0x393e8c){return db[_0xc229('0x14')][_0xc229('0x15')]({'raw':_0x4cae05[_0xc229('0x16')]?_0x4cae05[_0xc229('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x4cae05['options']?_0x4cae05[_0xc229('0x16')]['where']||null:null,'attributes':_0x4cae05[_0xc229('0x16')]?_0x4cae05[_0xc229('0x16')]['attributes']||null:null,'limit':_0x4cae05['options']?_0x4cae05[_0xc229('0x16')][_0xc229('0x17')]||null:null,'include':_0x4cae05[_0xc229('0x16')]?_0x4cae05[_0xc229('0x16')][_0xc229('0x18')]?_[_0xc229('0x19')](_0x4cae05[_0xc229('0x16')]['include'],function(_0x5cb52f){return{'model':db[_0x5cb52f[_0xc229('0x1a')]],'as':_0x5cb52f['as'],'attributes':_0x5cb52f[_0xc229('0x1b')],'include':_0x5cb52f['include']?_['map'](_0x5cb52f[_0xc229('0x18')],function(_0x30c711){return{'model':db[_0x30c711[_0xc229('0x1a')]],'as':_0x30c711['as'],'attributes':_0x30c711[_0xc229('0x1b')],'include':_0x30c711[_0xc229('0x18')]?_[_0xc229('0x19')](_0x30c711['include'],function(_0x103d43){return{'model':db[_0x103d43[_0xc229('0x1a')]],'as':_0x103d43['as'],'attributes':_0x103d43[_0xc229('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x524908){logger[_0xc229('0x8')]('GetDynamics365Account',_0x4cae05);logger[_0xc229('0x9')](_0xc229('0x13'),_0x4cae05,JSON[_0xc229('0xc')](_0x524908));_0x10339a(_0x524908);})[_0xc229('0x12')](function(_0xfa1ba2){logger[_0xc229('0xd')](_0xc229('0x13'),_0xfa1ba2[_0xc229('0x10')],_0x4cae05);_0x393e8c(_0x379e41[_0xc229('0xd')](0x1f4,_0xfa1ba2[_0xc229('0x10')]));});});};exports[_0xc229('0x1c')]=function(_0x3aef16){var _0x4192d0=this;return new Promise(function(_0x25cd16,_0x2e7fe7){return db[_0xc229('0x14')][_0xc229('0x1d')]({'raw':_0x3aef16[_0xc229('0x16')]?_0x3aef16[_0xc229('0x16')][_0xc229('0x1e')]===undefined?!![]:![]:!![],'where':_0x3aef16[_0xc229('0x16')]?_0x3aef16['options'][_0xc229('0x1f')]||null:null,'attributes':_0x3aef16['options']?_0x3aef16[_0xc229('0x16')][_0xc229('0x1b')]||null:null,'include':_0x3aef16['options']?_0x3aef16[_0xc229('0x16')][_0xc229('0x18')]?_[_0xc229('0x19')](_0x3aef16[_0xc229('0x16')][_0xc229('0x18')],function(_0x42b7a3){return{'model':db[_0x42b7a3['model']],'as':_0x42b7a3['as'],'attributes':_0x42b7a3[_0xc229('0x1b')],'include':_0x42b7a3[_0xc229('0x18')]?_[_0xc229('0x19')](_0x42b7a3[_0xc229('0x18')],function(_0x39a7c2){return{'model':db[_0x39a7c2[_0xc229('0x1a')]],'as':_0x39a7c2['as'],'attributes':_0x39a7c2[_0xc229('0x1b')],'include':_0x39a7c2[_0xc229('0x18')]?_[_0xc229('0x19')](_0x39a7c2[_0xc229('0x18')],function(_0x31d5bb){return{'model':db[_0x31d5bb['model']],'as':_0x31d5bb['as'],'attributes':_0x31d5bb[_0xc229('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xc229('0x20')](function(_0x251b4b){logger['info'](_0xc229('0x1c'),_0x3aef16);logger[_0xc229('0x9')]('ShowDynamics365Account',_0x3aef16,JSON['stringify'](_0x251b4b));_0x25cd16(_0x251b4b);})[_0xc229('0x12')](function(_0x4eafbd){logger['error']('ShowDynamics365Account',_0x4eafbd[_0xc229('0x10')],_0x3aef16);_0x2e7fe7(_0x4192d0['error'](0x1f4,_0x4eafbd['message']));});});};
\ No newline at end of file
diff --git a/server/api/intDynamics365Configuration/index.js b/server/api/intDynamics365Configuration/index.js
index 91072df..f6c1f5d 100644
--- a/server/api/intDynamics365Configuration/index.js
+++ b/server/api/intDynamics365Configuration/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xab68=['../../components/interaction/service','isAuthenticated','index','get','/:id','show','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','put','update','delete','destroy','path','connect-timeout','express','Router','../../components/auth/service'];(function(_0x30ae5e,_0x391fc4){var _0x1f2e93=function(_0x60307d){while(--_0x60307d){_0x30ae5e['push'](_0x30ae5e['shift']());}};_0x1f2e93(++_0x391fc4);}(_0xab68,0x18a));var _0x8ab6=function(_0x510a1f,_0x5053c5){_0x510a1f=_0x510a1f-0x0;var _0x57581b=_0xab68[_0x510a1f];return _0x57581b;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x8ab6('0x0'));var timeout=require(_0x8ab6('0x1'));var express=require(_0x8ab6('0x2'));var router=express[_0x8ab6('0x3')]();var auth=require(_0x8ab6('0x4'));var interaction=require(_0x8ab6('0x5'));var config=require('../../config/environment');var controller=require('./intDynamics365Configuration.controller');router['get']('/',auth[_0x8ab6('0x6')](),controller[_0x8ab6('0x7')]);router[_0x8ab6('0x8')](_0x8ab6('0x9'),auth['isAuthenticated'](),controller[_0x8ab6('0xa')]);router[_0x8ab6('0x8')]('/:id/fields',auth['isAuthenticated'](),controller[_0x8ab6('0xb')]);router[_0x8ab6('0x8')](_0x8ab6('0xc'),auth[_0x8ab6('0x6')](),controller[_0x8ab6('0xd')]);router[_0x8ab6('0x8')](_0x8ab6('0xe'),auth[_0x8ab6('0x6')](),controller[_0x8ab6('0xf')]);router[_0x8ab6('0x10')]('/',auth['isAuthenticated'](),controller['create']);router[_0x8ab6('0x11')]('/:id',auth['isAuthenticated'](),controller[_0x8ab6('0x12')]);router[_0x8ab6('0x13')](_0x8ab6('0x9'),auth[_0x8ab6('0x6')](),controller[_0x8ab6('0x14')]);module['exports']=router;
\ No newline at end of file
+var _0xb063=['/:id/subjects','/:id/descriptions','getDescriptions','create','put','delete','destroy','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./intDynamics365Configuration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getFields'];(function(_0x89bddd,_0x5c50e8){var _0x3a10e6=function(_0x2c887f){while(--_0x2c887f){_0x89bddd['push'](_0x89bddd['shift']());}};_0x3a10e6(++_0x5c50e8);}(_0xb063,0x14a));var _0x3b06=function(_0x25df72,_0x3bc51e){_0x25df72=_0x25df72-0x0;var _0x4d9705=_0xb063[_0x25df72];return _0x4d9705;};'use strict';var multer=require('multer');var util=require(_0x3b06('0x0'));var path=require(_0x3b06('0x1'));var timeout=require(_0x3b06('0x2'));var express=require(_0x3b06('0x3'));var router=express[_0x3b06('0x4')]();var auth=require(_0x3b06('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x3b06('0x6'));var controller=require(_0x3b06('0x7'));router[_0x3b06('0x8')]('/',auth[_0x3b06('0x9')](),controller[_0x3b06('0xa')]);router[_0x3b06('0x8')](_0x3b06('0xb'),auth[_0x3b06('0x9')](),controller[_0x3b06('0xc')]);router[_0x3b06('0x8')](_0x3b06('0xd'),auth[_0x3b06('0x9')](),controller[_0x3b06('0xe')]);router[_0x3b06('0x8')](_0x3b06('0xf'),auth['isAuthenticated'](),controller['getSubjects']);router[_0x3b06('0x8')](_0x3b06('0x10'),auth[_0x3b06('0x9')](),controller[_0x3b06('0x11')]);router['post']('/',auth['isAuthenticated'](),controller[_0x3b06('0x12')]);router[_0x3b06('0x13')](_0x3b06('0xb'),auth[_0x3b06('0x9')](),controller['update']);router[_0x3b06('0x14')]('/:id',auth['isAuthenticated'](),controller[_0x3b06('0x15')]);module[_0x3b06('0x16')]=router;
\ No newline at end of file
diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.attributes.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.attributes.js
index e53ad51..576233f 100644
--- a/server/api/intDynamics365Configuration/intDynamics365Configuration.attributes.js
+++ b/server/api/intDynamics365Configuration/intDynamics365Configuration.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xb8b7=['ENUM','phonecall','incident','sequelize','exports','STRING'];(function(_0x152678,_0x11e0ac){var _0x311a9=function(_0x4f5291){while(--_0x4f5291){_0x152678['push'](_0x152678['shift']());}};_0x311a9(++_0x11e0ac);}(_0xb8b7,0xff));var _0x7b8b=function(_0x1f9f37,_0x18776e){_0x1f9f37=_0x1f9f37-0x0;var _0x21c080=_0xb8b7[_0x1f9f37];return _0x21c080;};'use strict';var Sequelize=require(_0x7b8b('0x0'));module[_0x7b8b('0x1')]={'name':{'type':Sequelize[_0x7b8b('0x2')]},'description':{'type':Sequelize[_0x7b8b('0x2')]},'ticketType':{'type':Sequelize[_0x7b8b('0x3')]('incident',_0x7b8b('0x4')),'defaultValue':_0x7b8b('0x5')}};
\ No newline at end of file
+var _0x2838=['incident','phonecall','sequelize','STRING','ENUM'];(function(_0x214f72,_0x25a2c0){var _0x2398a8=function(_0x35e8db){while(--_0x35e8db){_0x214f72['push'](_0x214f72['shift']());}};_0x2398a8(++_0x25a2c0);}(_0x2838,0x98));var _0x8283=function(_0x5ad190,_0xd39c9e){_0x5ad190=_0x5ad190-0x0;var _0x518ed3=_0x2838[_0x5ad190];return _0x518ed3;};'use strict';var Sequelize=require(_0x8283('0x0'));module['exports']={'name':{'type':Sequelize[_0x8283('0x1')]},'description':{'type':Sequelize[_0x8283('0x1')]},'ticketType':{'type':Sequelize[_0x8283('0x2')](_0x8283('0x3'),_0x8283('0x4')),'defaultValue':_0x8283('0x3')}};
\ No newline at end of file
diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js
index 9596f56..e707cdc 100644
--- a/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js
+++ b/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xbccf=['test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','Dynamics365Configuration,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','end','offset','limit','set','Content-Range','json','apply','reject','save','destroy','name','map','Dynamics365Configuration','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','count','includeAll','include','rows','show','params','keys','length','options','find','create','body','update','getFields','findOne','pick','getSubjects','Dynamics365Field','getDescriptions','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','ejs','lodash','jsforce','to-csv','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','jayson/promise','client'];(function(_0x9f30da,_0x1efdcb){var _0x455895=function(_0x2339f8){while(--_0x2339f8){_0x9f30da['push'](_0x9f30da['shift']());}};_0x455895(++_0x1efdcb);}(_0xbccf,0x9d));var _0xfbcc=function(_0x5d2803,_0xf375bd){_0x5d2803=_0x5d2803-0x0;var _0xdcad2c=_0xbccf[_0x5d2803];return _0xdcad2c;};'use strict';var pdf=require(_0xfbcc('0x0'));var emlformat=require(_0xfbcc('0x1'));var rimraf=require(_0xfbcc('0x2'));var zipdir=require(_0xfbcc('0x3'));var jsonpatch=require(_0xfbcc('0x4'));var rp=require('request-promise');var moment=require(_0xfbcc('0x5'));var BPromise=require(_0xfbcc('0x6'));var Mustache=require(_0xfbcc('0x7'));var util=require(_0xfbcc('0x8'));var path=require(_0xfbcc('0x9'));var sox=require(_0xfbcc('0xa'));var csv=require('to-csv');var ejs=require(_0xfbcc('0xb'));var fs=require('fs');var _=require(_0xfbcc('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xfbcc('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xfbcc('0xe'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xfbcc('0xf'));var hardwareService=require(_0xfbcc('0x10'));var logger=require(_0xfbcc('0x11'))('api');var utils=require('../../config/utils');var config=require(_0xfbcc('0x12'));var db=require('../../mysqldb')['db'];var jayson=require(_0xfbcc('0x13'));var client=jayson[_0xfbcc('0x14')]['http']({'port':0x232a});function checkPasswordPattern(_0x5daffd,_0x3d04e1,_0x1bb3b9){if(_0x1bb3b9){var _0x22732c=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x22732c[_0xfbcc('0x15')](_0x3d04e1)){return _0x5daffd;}else{throw new db[(_0xfbcc('0x16'))][(_0xfbcc('0x17'))](_0xfbcc('0x18'));}}else{return _0x5daffd;}}function respondWithRpcPromise(_0x45d5d4,_0x5068cf,_0x14c8e6,_0x5ab76f){return new BPromise(function(_0x115ac3,_0x2cf89d){var _0x37f186=_0x5ab76f||client;return _0x37f186[_0xfbcc('0x19')](_0x45d5d4,_0x14c8e6)[_0xfbcc('0x1a')](function(_0x396f67){logger[_0xfbcc('0x1b')](_0xfbcc('0x1c'),_0x5068cf,_0xfbcc('0x1d'));logger[_0xfbcc('0x1e')](_0xfbcc('0x1f'),_0x5068cf,_0xfbcc('0x1d'),JSON[_0xfbcc('0x20')](_0x396f67));if(_0x396f67['error']){if(_0x396f67[_0xfbcc('0x21')][_0xfbcc('0x22')]===0x1f4){logger[_0xfbcc('0x21')](_0xfbcc('0x1c'),_0x5068cf,_0x396f67['error']['message']);return _0x2cf89d(_0x396f67[_0xfbcc('0x21')]['message']);}logger[_0xfbcc('0x21')](_0xfbcc('0x1c'),_0x5068cf,_0x396f67[_0xfbcc('0x21')][_0xfbcc('0x23')]);return _0x115ac3(_0x396f67[_0xfbcc('0x21')][_0xfbcc('0x23')]);}else{logger[_0xfbcc('0x1b')](_0xfbcc('0x1c'),_0x5068cf,'request\x20sent');_0x115ac3(_0x396f67[_0xfbcc('0x24')][_0xfbcc('0x23')]);}})[_0xfbcc('0x25')](function(_0x4ea641){logger[_0xfbcc('0x21')](_0xfbcc('0x1c'),_0x5068cf,_0x4ea641);_0x2cf89d(_0x4ea641);});});}function respondWithStatusCode(_0x3bb775,_0x3266cd){_0x3266cd=_0x3266cd||0xcc;return function(_0x24264c){if(_0x24264c){return _0x3bb775[_0xfbcc('0x26')](_0x3266cd);}return _0x3bb775[_0xfbcc('0x27')](_0x3266cd)[_0xfbcc('0x28')]();};}function respondWithResult(_0x5188f4,_0x3213a9){_0x3213a9=_0x3213a9||0xc8;return function(_0x1226b3){if(_0x1226b3){return _0x5188f4[_0xfbcc('0x27')](_0x3213a9)['json'](_0x1226b3);}};}function respondWithFilteredResult(_0x45d8d4,_0x18098b){return function(_0x155078){if(_0x155078){var _0x592246=_0x155078['count'],_0x27e9e7=_0x18098b['offset'],_0x4a7a30=_0x18098b[_0xfbcc('0x29')]+_0x18098b[_0xfbcc('0x2a')],_0x4bbda2;if(_0x4a7a30>=_0x592246){_0x4a7a30=_0x592246;_0x4bbda2=0xc8;}else{_0x4bbda2=0xce;}_0x45d8d4[_0xfbcc('0x27')](_0x4bbda2);return _0x45d8d4[_0xfbcc('0x2b')](_0xfbcc('0x2c'),_0x27e9e7+'-'+_0x4a7a30+'/'+_0x592246)[_0xfbcc('0x2d')](_0x155078);}return null;};}function patchUpdates(_0x141862){return function(_0x501156){try{jsonpatch[_0xfbcc('0x2e')](_0x501156,_0x141862,!![]);}catch(_0x40c4d7){return BPromise[_0xfbcc('0x2f')](_0x40c4d7);}return _0x501156[_0xfbcc('0x30')]();};}function saveUpdates(_0x5e6d66,_0x2b1ea0){return function(_0x362e16){if(_0x362e16){return _0x362e16['update'](_0x5e6d66)['then'](function(_0xb34539){return _0xb34539;});}return null;};}function removeEntity(_0x174318,_0x341650){return function(_0x3d471a){if(_0x3d471a){return _0x3d471a[_0xfbcc('0x31')]()[_0xfbcc('0x1a')](function(){_0x174318['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x44c7db,_0x1f098b){return function(_0x523ebb){if(!_0x523ebb){_0x44c7db['sendStatus'](0x194);}return _0x523ebb;};}function handleError(_0x5690c8,_0x50d31a){_0x50d31a=_0x50d31a||0x1f4;return function(_0xcd0d57){logger['error'](_0xcd0d57['stack']);if(_0xcd0d57['name']){delete _0xcd0d57[_0xfbcc('0x32')];}_0x5690c8[_0xfbcc('0x27')](_0x50d31a)['send'](_0xcd0d57);};}exports['index']=function(_0x33cde3,_0x51d17f){var _0x1f09b4={},_0x50b01a={},_0x398dfd={'count':0x0,'rows':[]};var _0x1c78a5=_[_0xfbcc('0x33')](db[_0xfbcc('0x34')][_0xfbcc('0x35')],function(_0x49e73f){return{'name':_0x49e73f[_0xfbcc('0x36')],'type':_0x49e73f[_0xfbcc('0x37')][_0xfbcc('0x38')]};});_0x50b01a[_0xfbcc('0x39')]=_['map'](_0x1c78a5,_0xfbcc('0x32'));_0x50b01a[_0xfbcc('0x3a')]=_['keys'](_0x33cde3[_0xfbcc('0x3a')]);_0x50b01a[_0xfbcc('0x3b')]=_[_0xfbcc('0x3c')](_0x50b01a[_0xfbcc('0x39')],_0x50b01a[_0xfbcc('0x3a')]);_0x1f09b4[_0xfbcc('0x3d')]=_[_0xfbcc('0x3c')](_0x50b01a[_0xfbcc('0x39')],qs[_0xfbcc('0x3e')](_0x33cde3['query'][_0xfbcc('0x3e')]));_0x1f09b4[_0xfbcc('0x3d')]=_0x1f09b4[_0xfbcc('0x3d')]['length']?_0x1f09b4[_0xfbcc('0x3d')]:_0x50b01a['model'];if(!_0x33cde3[_0xfbcc('0x3a')][_0xfbcc('0x3f')](_0xfbcc('0x40'))){_0x1f09b4[_0xfbcc('0x2a')]=qs[_0xfbcc('0x2a')](_0x33cde3[_0xfbcc('0x3a')][_0xfbcc('0x2a')]);_0x1f09b4[_0xfbcc('0x29')]=qs['offset'](_0x33cde3['query'][_0xfbcc('0x29')]);}_0x1f09b4['order']=qs[_0xfbcc('0x41')](_0x33cde3['query']['sort']);_0x1f09b4[_0xfbcc('0x42')]=qs['filters'](_['pick'](_0x33cde3[_0xfbcc('0x3a')],_0x50b01a['filters']),_0x1c78a5);if(_0x33cde3['query'][_0xfbcc('0x43')]){_0x1f09b4[_0xfbcc('0x42')]=_[_0xfbcc('0x44')](_0x1f09b4[_0xfbcc('0x42')],{'$or':_[_0xfbcc('0x33')](_0x1c78a5,function(_0x30b2b3){if(_0x30b2b3[_0xfbcc('0x37')]!==_0xfbcc('0x45')){var _0x2bbe1f={};_0x2bbe1f[_0x30b2b3[_0xfbcc('0x32')]]={'$like':'%'+_0x33cde3[_0xfbcc('0x3a')][_0xfbcc('0x43')]+'%'};return _0x2bbe1f;}})});}_0x1f09b4=_[_0xfbcc('0x44')]({},_0x1f09b4,_0x33cde3['options']);var _0x330c77={'where':_0x1f09b4['where']};return db['Dynamics365Configuration'][_0xfbcc('0x46')](_0x330c77)['then'](function(_0x3c96ea){_0x398dfd[_0xfbcc('0x46')]=_0x3c96ea;if(_0x33cde3[_0xfbcc('0x3a')][_0xfbcc('0x47')]){_0x1f09b4[_0xfbcc('0x48')]=[{'all':!![]}];}return db[_0xfbcc('0x34')]['findAll'](_0x1f09b4);})['then'](function(_0xc1b603){_0x398dfd[_0xfbcc('0x49')]=_0xc1b603;return _0x398dfd;})[_0xfbcc('0x1a')](respondWithFilteredResult(_0x51d17f,_0x1f09b4))[_0xfbcc('0x25')](handleError(_0x51d17f,null));};exports[_0xfbcc('0x4a')]=function(_0x40e822,_0x305716){var _0x8ee5ab={'raw':![],'where':{'id':_0x40e822[_0xfbcc('0x4b')]['id']}},_0xed754b={};_0xed754b[_0xfbcc('0x39')]=_[_0xfbcc('0x4c')](db[_0xfbcc('0x34')][_0xfbcc('0x35')]);_0xed754b[_0xfbcc('0x3a')]=_[_0xfbcc('0x4c')](_0x40e822[_0xfbcc('0x3a')]);_0xed754b[_0xfbcc('0x3b')]=_[_0xfbcc('0x3c')](_0xed754b[_0xfbcc('0x39')],_0xed754b[_0xfbcc('0x3a')]);_0x8ee5ab[_0xfbcc('0x3d')]=_['intersection'](_0xed754b[_0xfbcc('0x39')],qs[_0xfbcc('0x3e')](_0x40e822[_0xfbcc('0x3a')][_0xfbcc('0x3e')]));_0x8ee5ab[_0xfbcc('0x3d')]=_0x8ee5ab[_0xfbcc('0x3d')][_0xfbcc('0x4d')]?_0x8ee5ab[_0xfbcc('0x3d')]:_0xed754b['model'];if(_0x40e822[_0xfbcc('0x3a')][_0xfbcc('0x47')]){_0x8ee5ab['include']=[{'all':!![]}];}_0x8ee5ab=_[_0xfbcc('0x44')]({},_0x8ee5ab,_0x40e822[_0xfbcc('0x4e')]);return db['Dynamics365Configuration'][_0xfbcc('0x4f')](_0x8ee5ab)['then'](handleEntityNotFound(_0x305716,null))[_0xfbcc('0x1a')](respondWithResult(_0x305716,null))[_0xfbcc('0x25')](handleError(_0x305716,null));};exports[_0xfbcc('0x50')]=function(_0x135298,_0x3325d4){return db['Dynamics365Configuration'][_0xfbcc('0x50')](_0x135298[_0xfbcc('0x51')],{})['then'](respondWithResult(_0x3325d4,0xc9))['catch'](handleError(_0x3325d4,null));};exports[_0xfbcc('0x52')]=function(_0x2b8e47,_0x52268e){if(_0x2b8e47[_0xfbcc('0x51')]['id']){delete _0x2b8e47[_0xfbcc('0x51')]['id'];}return db['Dynamics365Configuration']['find']({'where':{'id':_0x2b8e47['params']['id']}})[_0xfbcc('0x1a')](handleEntityNotFound(_0x52268e,null))[_0xfbcc('0x1a')](saveUpdates(_0x2b8e47[_0xfbcc('0x51')],null))[_0xfbcc('0x1a')](respondWithResult(_0x52268e,null))[_0xfbcc('0x25')](handleError(_0x52268e,null));};exports[_0xfbcc('0x31')]=function(_0x34a65b,_0x4baa97){return db['Dynamics365Configuration'][_0xfbcc('0x4f')]({'where':{'id':_0x34a65b[_0xfbcc('0x4b')]['id']}})[_0xfbcc('0x1a')](handleEntityNotFound(_0x4baa97,null))[_0xfbcc('0x1a')](removeEntity(_0x4baa97,null))[_0xfbcc('0x25')](handleError(_0x4baa97,null));};exports[_0xfbcc('0x53')]=function(_0x590bc7,_0x2aed74,_0x8beb59){var _0x3f326a={};var _0x2d1cc8={};var _0x4f510e;var _0x352470;return db[_0xfbcc('0x34')][_0xfbcc('0x54')]({'where':{'id':_0x590bc7[_0xfbcc('0x4b')]['id']}})['then'](handleEntityNotFound(_0x2aed74,null))['then'](function(_0x42edcc){if(_0x42edcc){_0x4f510e=_0x42edcc;_0x2d1cc8[_0xfbcc('0x39')]=_[_0xfbcc('0x4c')](db['Dynamics365Field'][_0xfbcc('0x35')]);_0x2d1cc8[_0xfbcc('0x3a')]=_[_0xfbcc('0x4c')](_0x590bc7[_0xfbcc('0x3a')]);_0x2d1cc8[_0xfbcc('0x3b')]=_[_0xfbcc('0x3c')](_0x2d1cc8[_0xfbcc('0x39')],_0x2d1cc8['query']);_0x3f326a['attributes']=_['intersection'](_0x2d1cc8[_0xfbcc('0x39')],qs[_0xfbcc('0x3e')](_0x590bc7[_0xfbcc('0x3a')][_0xfbcc('0x3e')]));_0x3f326a['attributes']=_0x3f326a[_0xfbcc('0x3d')][_0xfbcc('0x4d')]?_0x3f326a['attributes']:_0x2d1cc8['model'];_0x3f326a['order']=qs['sort'](_0x590bc7['query'][_0xfbcc('0x41')]);_0x3f326a['where']=qs[_0xfbcc('0x3b')](_[_0xfbcc('0x55')](_0x590bc7['query'],_0x2d1cc8[_0xfbcc('0x3b')]));if(_0x590bc7[_0xfbcc('0x3a')][_0xfbcc('0x43')]){_0x3f326a['where']=_[_0xfbcc('0x44')](_0x3f326a[_0xfbcc('0x42')],{'$or':_[_0xfbcc('0x33')](_0x3f326a[_0xfbcc('0x3d')],function(_0x542e20){var _0x5721a7={};_0x5721a7[_0x542e20]={'$like':'%'+_0x590bc7[_0xfbcc('0x3a')][_0xfbcc('0x43')]+'%'};return _0x5721a7;})});}_0x3f326a=_[_0xfbcc('0x44')]({},_0x3f326a,_0x590bc7[_0xfbcc('0x4e')]);return _0x4f510e[_0xfbcc('0x53')](_0x3f326a);}})[_0xfbcc('0x1a')](function(_0x43db01){if(_0x43db01){_0x352470=_0x43db01['length'];if(!_0x590bc7[_0xfbcc('0x3a')][_0xfbcc('0x3f')](_0xfbcc('0x40'))){_0x3f326a[_0xfbcc('0x2a')]=qs['limit'](_0x590bc7['query'][_0xfbcc('0x2a')]);_0x3f326a[_0xfbcc('0x29')]=qs[_0xfbcc('0x29')](_0x590bc7[_0xfbcc('0x3a')][_0xfbcc('0x29')]);}return _0x4f510e[_0xfbcc('0x53')](_0x3f326a);}})[_0xfbcc('0x1a')](function(_0x3486bc){if(_0x3486bc){return _0x3486bc?{'count':_0x352470,'rows':_0x3486bc}:null;}})[_0xfbcc('0x1a')](respondWithResult(_0x2aed74,null))[_0xfbcc('0x25')](handleError(_0x2aed74,null));};exports[_0xfbcc('0x56')]=function(_0x5430c9,_0x570381,_0xe47cdc){var _0x284341={};var _0x268d32={};var _0x503c12;var _0x467705;return db['Dynamics365Configuration'][_0xfbcc('0x54')]({'where':{'id':_0x5430c9['params']['id']}})[_0xfbcc('0x1a')](handleEntityNotFound(_0x570381,null))['then'](function(_0x1bb6ca){if(_0x1bb6ca){_0x503c12=_0x1bb6ca;_0x268d32[_0xfbcc('0x39')]=_[_0xfbcc('0x4c')](db[_0xfbcc('0x57')]['rawAttributes']);_0x268d32[_0xfbcc('0x3a')]=_[_0xfbcc('0x4c')](_0x5430c9['query']);_0x268d32[_0xfbcc('0x3b')]=_[_0xfbcc('0x3c')](_0x268d32['model'],_0x268d32[_0xfbcc('0x3a')]);_0x284341[_0xfbcc('0x3d')]=_[_0xfbcc('0x3c')](_0x268d32[_0xfbcc('0x39')],qs['fields'](_0x5430c9[_0xfbcc('0x3a')][_0xfbcc('0x3e')]));_0x284341[_0xfbcc('0x3d')]=_0x284341[_0xfbcc('0x3d')][_0xfbcc('0x4d')]?_0x284341[_0xfbcc('0x3d')]:_0x268d32[_0xfbcc('0x39')];_0x284341['order']=qs['sort'](_0x5430c9[_0xfbcc('0x3a')][_0xfbcc('0x41')]);_0x284341[_0xfbcc('0x42')]=qs[_0xfbcc('0x3b')](_[_0xfbcc('0x55')](_0x5430c9[_0xfbcc('0x3a')],_0x268d32[_0xfbcc('0x3b')]));if(_0x5430c9[_0xfbcc('0x3a')][_0xfbcc('0x43')]){_0x284341[_0xfbcc('0x42')]=_[_0xfbcc('0x44')](_0x284341[_0xfbcc('0x42')],{'$or':_[_0xfbcc('0x33')](_0x284341[_0xfbcc('0x3d')],function(_0x59e9e7){var _0x43fd59={};_0x43fd59[_0x59e9e7]={'$like':'%'+_0x5430c9[_0xfbcc('0x3a')][_0xfbcc('0x43')]+'%'};return _0x43fd59;})});}_0x284341=_[_0xfbcc('0x44')]({},_0x284341,_0x5430c9['options']);return _0x503c12[_0xfbcc('0x56')](_0x284341);}})[_0xfbcc('0x1a')](function(_0x5c1f98){if(_0x5c1f98){_0x467705=_0x5c1f98[_0xfbcc('0x4d')];if(!_0x5430c9[_0xfbcc('0x3a')][_0xfbcc('0x3f')](_0xfbcc('0x40'))){_0x284341['limit']=qs[_0xfbcc('0x2a')](_0x5430c9[_0xfbcc('0x3a')][_0xfbcc('0x2a')]);_0x284341['offset']=qs['offset'](_0x5430c9[_0xfbcc('0x3a')][_0xfbcc('0x29')]);}return _0x503c12[_0xfbcc('0x56')](_0x284341);}})[_0xfbcc('0x1a')](function(_0x5fadbb){if(_0x5fadbb){return _0x5fadbb?{'count':_0x467705,'rows':_0x5fadbb}:null;}})['then'](respondWithResult(_0x570381,null))[_0xfbcc('0x25')](handleError(_0x570381,null));};exports['getDescriptions']=function(_0xc93aed,_0x1e8e16,_0x543e4a){var _0x45040e={};var _0x413f70={};var _0x43d604;var _0x3599cc;return db[_0xfbcc('0x34')][_0xfbcc('0x54')]({'where':{'id':_0xc93aed[_0xfbcc('0x4b')]['id']}})[_0xfbcc('0x1a')](handleEntityNotFound(_0x1e8e16,null))[_0xfbcc('0x1a')](function(_0x5c8788){if(_0x5c8788){_0x43d604=_0x5c8788;_0x413f70['model']=_['keys'](db[_0xfbcc('0x57')]['rawAttributes']);_0x413f70[_0xfbcc('0x3a')]=_[_0xfbcc('0x4c')](_0xc93aed[_0xfbcc('0x3a')]);_0x413f70[_0xfbcc('0x3b')]=_[_0xfbcc('0x3c')](_0x413f70[_0xfbcc('0x39')],_0x413f70[_0xfbcc('0x3a')]);_0x45040e[_0xfbcc('0x3d')]=_[_0xfbcc('0x3c')](_0x413f70[_0xfbcc('0x39')],qs[_0xfbcc('0x3e')](_0xc93aed['query'][_0xfbcc('0x3e')]));_0x45040e['attributes']=_0x45040e[_0xfbcc('0x3d')]['length']?_0x45040e[_0xfbcc('0x3d')]:_0x413f70[_0xfbcc('0x39')];_0x45040e['order']=qs[_0xfbcc('0x41')](_0xc93aed[_0xfbcc('0x3a')]['sort']);_0x45040e['where']=qs[_0xfbcc('0x3b')](_[_0xfbcc('0x55')](_0xc93aed[_0xfbcc('0x3a')],_0x413f70[_0xfbcc('0x3b')]));if(_0xc93aed[_0xfbcc('0x3a')][_0xfbcc('0x43')]){_0x45040e['where']=_[_0xfbcc('0x44')](_0x45040e['where'],{'$or':_[_0xfbcc('0x33')](_0x45040e[_0xfbcc('0x3d')],function(_0x4437e0){var _0x1e27a0={};_0x1e27a0[_0x4437e0]={'$like':'%'+_0xc93aed[_0xfbcc('0x3a')][_0xfbcc('0x43')]+'%'};return _0x1e27a0;})});}_0x45040e=_['merge']({},_0x45040e,_0xc93aed[_0xfbcc('0x4e')]);return _0x43d604[_0xfbcc('0x58')](_0x45040e);}})[_0xfbcc('0x1a')](function(_0x810975){if(_0x810975){_0x3599cc=_0x810975['length'];if(!_0xc93aed[_0xfbcc('0x3a')][_0xfbcc('0x3f')](_0xfbcc('0x40'))){_0x45040e['limit']=qs[_0xfbcc('0x2a')](_0xc93aed[_0xfbcc('0x3a')]['limit']);_0x45040e[_0xfbcc('0x29')]=qs[_0xfbcc('0x29')](_0xc93aed[_0xfbcc('0x3a')][_0xfbcc('0x29')]);}return _0x43d604[_0xfbcc('0x58')](_0x45040e);}})[_0xfbcc('0x1a')](function(_0xe3c2ee){if(_0xe3c2ee){return _0xe3c2ee?{'count':_0x3599cc,'rows':_0xe3c2ee}:null;}})[_0xfbcc('0x1a')](respondWithResult(_0x1e8e16,null))['catch'](handleError(_0x1e8e16,null));};
\ No newline at end of file
+var _0xc8bd=['VIRTUAL','options','Dynamics365Configuration','count','includeAll','include','rows','catch','show','params','keys','intersection','find','create','body','update','destroy','findOne','Dynamics365Field','getFields','nolimit','getSubjects','getDescriptions','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','lodash','squel','crypto','jsforce','ioredis','../../components/auth/service','../../config/logger','api','../../config/environment','jayson/promise','http','test','Sequelize','request','then','Dynamics365Configuration,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','sendStatus','status','json','offset','limit','set','reject','save','end','stack','name','send','index','map','rawAttributes','type','key','query','filters','model','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge'];(function(_0x228967,_0x170481){var _0x2492a5=function(_0x26a165){while(--_0x26a165){_0x228967['push'](_0x228967['shift']());}};_0x2492a5(++_0x170481);}(_0xc8bd,0x70));var _0xdc8b=function(_0x32083e,_0x130a41){_0x32083e=_0x32083e-0x0;var _0x1efcc7=_0xc8bd[_0x32083e];return _0x1efcc7;};'use strict';var pdf=require(_0xdc8b('0x0'));var emlformat=require(_0xdc8b('0x1'));var rimraf=require(_0xdc8b('0x2'));var zipdir=require(_0xdc8b('0x3'));var jsonpatch=require(_0xdc8b('0x4'));var rp=require(_0xdc8b('0x5'));var moment=require(_0xdc8b('0x6'));var BPromise=require(_0xdc8b('0x7'));var Mustache=require(_0xdc8b('0x8'));var util=require('util');var path=require('path');var sox=require(_0xdc8b('0x9'));var csv=require(_0xdc8b('0xa'));var ejs=require(_0xdc8b('0xb'));var fs=require('fs');var _=require(_0xdc8b('0xc'));var squel=require(_0xdc8b('0xd'));var crypto=require(_0xdc8b('0xe'));var jsforce=require(_0xdc8b('0xf'));var deskjs=require('desk.js');var toCsv=require(_0xdc8b('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xdc8b('0x10'));var authService=require(_0xdc8b('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xdc8b('0x12'))(_0xdc8b('0x13'));var utils=require('../../config/utils');var config=require(_0xdc8b('0x14'));var db=require('../../mysqldb')['db'];var jayson=require(_0xdc8b('0x15'));var client=jayson['client'][_0xdc8b('0x16')]({'port':0x232a});function checkPasswordPattern(_0x4ae68a,_0x4235ac,_0xa4b70c){if(_0xa4b70c){var _0x16d3a8=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x16d3a8[_0xdc8b('0x17')](_0x4235ac)){return _0x4ae68a;}else{throw new db[(_0xdc8b('0x18'))]['ValidationError']('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x4ae68a;}}function respondWithRpcPromise(_0x209206,_0x5d3100,_0x37b2de,_0x136247){return new BPromise(function(_0x3108f4,_0x1fcc68){var _0x33eca2=_0x136247||client;return _0x33eca2[_0xdc8b('0x19')](_0x209206,_0x37b2de)[_0xdc8b('0x1a')](function(_0x37349c){logger['info'](_0xdc8b('0x1b'),_0x5d3100,_0xdc8b('0x1c'));logger[_0xdc8b('0x1d')](_0xdc8b('0x1e'),_0x5d3100,'request\x20sent',JSON[_0xdc8b('0x1f')](_0x37349c));if(_0x37349c[_0xdc8b('0x20')]){if(_0x37349c[_0xdc8b('0x20')]['code']===0x1f4){logger[_0xdc8b('0x20')](_0xdc8b('0x1b'),_0x5d3100,_0x37349c[_0xdc8b('0x20')][_0xdc8b('0x21')]);return _0x1fcc68(_0x37349c['error'][_0xdc8b('0x21')]);}logger[_0xdc8b('0x20')](_0xdc8b('0x1b'),_0x5d3100,_0x37349c['error'][_0xdc8b('0x21')]);return _0x3108f4(_0x37349c[_0xdc8b('0x20')]['message']);}else{logger[_0xdc8b('0x22')](_0xdc8b('0x1b'),_0x5d3100,_0xdc8b('0x1c'));_0x3108f4(_0x37349c[_0xdc8b('0x23')][_0xdc8b('0x21')]);}})['catch'](function(_0x2cda3a){logger[_0xdc8b('0x20')]('Dynamics365Configuration,\x20%s,\x20%s',_0x5d3100,_0x2cda3a);_0x1fcc68(_0x2cda3a);});});}function respondWithStatusCode(_0x14367a,_0x585b12){_0x585b12=_0x585b12||0xcc;return function(_0x3da890){if(_0x3da890){return _0x14367a[_0xdc8b('0x24')](_0x585b12);}return _0x14367a[_0xdc8b('0x25')](_0x585b12)['end']();};}function respondWithResult(_0x2b08d5,_0x129dc6){_0x129dc6=_0x129dc6||0xc8;return function(_0x34bee1){if(_0x34bee1){return _0x2b08d5['status'](_0x129dc6)[_0xdc8b('0x26')](_0x34bee1);}};}function respondWithFilteredResult(_0x7b86fc,_0x24895e){return function(_0x5c3a0e){if(_0x5c3a0e){var _0x9d0d80=_0x5c3a0e['count'],_0x53b1e0=_0x24895e['offset'],_0x49fd3b=_0x24895e[_0xdc8b('0x27')]+_0x24895e[_0xdc8b('0x28')],_0x4e9867;if(_0x49fd3b>=_0x9d0d80){_0x49fd3b=_0x9d0d80;_0x4e9867=0xc8;}else{_0x4e9867=0xce;}_0x7b86fc['status'](_0x4e9867);return _0x7b86fc[_0xdc8b('0x29')]('Content-Range',_0x53b1e0+'-'+_0x49fd3b+'/'+_0x9d0d80)[_0xdc8b('0x26')](_0x5c3a0e);}return null;};}function patchUpdates(_0x2243b9){return function(_0x1322a0){try{jsonpatch['apply'](_0x1322a0,_0x2243b9,!![]);}catch(_0x548457){return BPromise[_0xdc8b('0x2a')](_0x548457);}return _0x1322a0[_0xdc8b('0x2b')]();};}function saveUpdates(_0x4b5bf7,_0x3cf77a){return function(_0xfa8a16){if(_0xfa8a16){return _0xfa8a16['update'](_0x4b5bf7)[_0xdc8b('0x1a')](function(_0x557e2b){return _0x557e2b;});}return null;};}function removeEntity(_0x536c12,_0x226bc5){return function(_0x26f62b){if(_0x26f62b){return _0x26f62b['destroy']()[_0xdc8b('0x1a')](function(){_0x536c12[_0xdc8b('0x25')](0xcc)[_0xdc8b('0x2c')]();});}};}function handleEntityNotFound(_0x1ba8d8,_0x1d1114){return function(_0x1723a2){if(!_0x1723a2){_0x1ba8d8['sendStatus'](0x194);}return _0x1723a2;};}function handleError(_0x51cbbe,_0x1f2869){_0x1f2869=_0x1f2869||0x1f4;return function(_0x4c8d3e){logger[_0xdc8b('0x20')](_0x4c8d3e[_0xdc8b('0x2d')]);if(_0x4c8d3e[_0xdc8b('0x2e')]){delete _0x4c8d3e[_0xdc8b('0x2e')];}_0x51cbbe[_0xdc8b('0x25')](_0x1f2869)[_0xdc8b('0x2f')](_0x4c8d3e);};}exports[_0xdc8b('0x30')]=function(_0x52aad9,_0xaf5a1b){var _0x5436c5={},_0x523c04={},_0x310311={'count':0x0,'rows':[]};var _0x3224dc=_[_0xdc8b('0x31')](db['Dynamics365Configuration'][_0xdc8b('0x32')],function(_0x1c0842){return{'name':_0x1c0842['fieldName'],'type':_0x1c0842[_0xdc8b('0x33')][_0xdc8b('0x34')]};});_0x523c04['model']=_[_0xdc8b('0x31')](_0x3224dc,_0xdc8b('0x2e'));_0x523c04[_0xdc8b('0x35')]=_['keys'](_0x52aad9[_0xdc8b('0x35')]);_0x523c04[_0xdc8b('0x36')]=_['intersection'](_0x523c04[_0xdc8b('0x37')],_0x523c04[_0xdc8b('0x35')]);_0x5436c5[_0xdc8b('0x38')]=_['intersection'](_0x523c04[_0xdc8b('0x37')],qs[_0xdc8b('0x39')](_0x52aad9[_0xdc8b('0x35')][_0xdc8b('0x39')]));_0x5436c5[_0xdc8b('0x38')]=_0x5436c5[_0xdc8b('0x38')][_0xdc8b('0x3a')]?_0x5436c5[_0xdc8b('0x38')]:_0x523c04['model'];if(!_0x52aad9[_0xdc8b('0x35')][_0xdc8b('0x3b')]('nolimit')){_0x5436c5[_0xdc8b('0x28')]=qs['limit'](_0x52aad9[_0xdc8b('0x35')][_0xdc8b('0x28')]);_0x5436c5[_0xdc8b('0x27')]=qs['offset'](_0x52aad9[_0xdc8b('0x35')][_0xdc8b('0x27')]);}_0x5436c5[_0xdc8b('0x3c')]=qs['sort'](_0x52aad9[_0xdc8b('0x35')][_0xdc8b('0x3d')]);_0x5436c5[_0xdc8b('0x3e')]=qs[_0xdc8b('0x36')](_[_0xdc8b('0x3f')](_0x52aad9[_0xdc8b('0x35')],_0x523c04['filters']),_0x3224dc);if(_0x52aad9[_0xdc8b('0x35')][_0xdc8b('0x40')]){_0x5436c5[_0xdc8b('0x3e')]=_[_0xdc8b('0x41')](_0x5436c5[_0xdc8b('0x3e')],{'$or':_[_0xdc8b('0x31')](_0x3224dc,function(_0x132552){if(_0x132552['type']!==_0xdc8b('0x42')){var _0x228286={};_0x228286[_0x132552[_0xdc8b('0x2e')]]={'$like':'%'+_0x52aad9['query'][_0xdc8b('0x40')]+'%'};return _0x228286;}})});}_0x5436c5=_['merge']({},_0x5436c5,_0x52aad9[_0xdc8b('0x43')]);var _0x28d0ad={'where':_0x5436c5[_0xdc8b('0x3e')]};return db[_0xdc8b('0x44')][_0xdc8b('0x45')](_0x28d0ad)[_0xdc8b('0x1a')](function(_0x170538){_0x310311[_0xdc8b('0x45')]=_0x170538;if(_0x52aad9['query'][_0xdc8b('0x46')]){_0x5436c5[_0xdc8b('0x47')]=[{'all':!![]}];}return db['Dynamics365Configuration']['findAll'](_0x5436c5);})[_0xdc8b('0x1a')](function(_0x21b62f){_0x310311[_0xdc8b('0x48')]=_0x21b62f;return _0x310311;})[_0xdc8b('0x1a')](respondWithFilteredResult(_0xaf5a1b,_0x5436c5))[_0xdc8b('0x49')](handleError(_0xaf5a1b,null));};exports[_0xdc8b('0x4a')]=function(_0x4bf6d7,_0x2653a2){var _0x218f1b={'raw':![],'where':{'id':_0x4bf6d7[_0xdc8b('0x4b')]['id']}},_0x388914={};_0x388914['model']=_[_0xdc8b('0x4c')](db[_0xdc8b('0x44')][_0xdc8b('0x32')]);_0x388914[_0xdc8b('0x35')]=_[_0xdc8b('0x4c')](_0x4bf6d7[_0xdc8b('0x35')]);_0x388914[_0xdc8b('0x36')]=_[_0xdc8b('0x4d')](_0x388914['model'],_0x388914[_0xdc8b('0x35')]);_0x218f1b['attributes']=_['intersection'](_0x388914[_0xdc8b('0x37')],qs[_0xdc8b('0x39')](_0x4bf6d7[_0xdc8b('0x35')][_0xdc8b('0x39')]));_0x218f1b[_0xdc8b('0x38')]=_0x218f1b[_0xdc8b('0x38')][_0xdc8b('0x3a')]?_0x218f1b[_0xdc8b('0x38')]:_0x388914[_0xdc8b('0x37')];if(_0x4bf6d7[_0xdc8b('0x35')][_0xdc8b('0x46')]){_0x218f1b[_0xdc8b('0x47')]=[{'all':!![]}];}_0x218f1b=_[_0xdc8b('0x41')]({},_0x218f1b,_0x4bf6d7[_0xdc8b('0x43')]);return db[_0xdc8b('0x44')][_0xdc8b('0x4e')](_0x218f1b)['then'](handleEntityNotFound(_0x2653a2,null))['then'](respondWithResult(_0x2653a2,null))[_0xdc8b('0x49')](handleError(_0x2653a2,null));};exports[_0xdc8b('0x4f')]=function(_0x3b6d65,_0x545e47){return db['Dynamics365Configuration'][_0xdc8b('0x4f')](_0x3b6d65[_0xdc8b('0x50')],{})[_0xdc8b('0x1a')](respondWithResult(_0x545e47,0xc9))[_0xdc8b('0x49')](handleError(_0x545e47,null));};exports[_0xdc8b('0x51')]=function(_0x45d6fb,_0x4f70eb){if(_0x45d6fb['body']['id']){delete _0x45d6fb[_0xdc8b('0x50')]['id'];}return db['Dynamics365Configuration'][_0xdc8b('0x4e')]({'where':{'id':_0x45d6fb[_0xdc8b('0x4b')]['id']}})[_0xdc8b('0x1a')](handleEntityNotFound(_0x4f70eb,null))[_0xdc8b('0x1a')](saveUpdates(_0x45d6fb[_0xdc8b('0x50')],null))['then'](respondWithResult(_0x4f70eb,null))[_0xdc8b('0x49')](handleError(_0x4f70eb,null));};exports[_0xdc8b('0x52')]=function(_0x43b8b9,_0x25b792){return db[_0xdc8b('0x44')][_0xdc8b('0x4e')]({'where':{'id':_0x43b8b9[_0xdc8b('0x4b')]['id']}})[_0xdc8b('0x1a')](handleEntityNotFound(_0x25b792,null))[_0xdc8b('0x1a')](removeEntity(_0x25b792,null))[_0xdc8b('0x49')](handleError(_0x25b792,null));};exports['getFields']=function(_0x3c857b,_0x4baa74,_0x296bba){var _0x10e0d0={};var _0x2cf331={};var _0x469f78;var _0xf3ecd4;return db['Dynamics365Configuration'][_0xdc8b('0x53')]({'where':{'id':_0x3c857b[_0xdc8b('0x4b')]['id']}})['then'](handleEntityNotFound(_0x4baa74,null))[_0xdc8b('0x1a')](function(_0xacad96){if(_0xacad96){_0x469f78=_0xacad96;_0x2cf331[_0xdc8b('0x37')]=_[_0xdc8b('0x4c')](db[_0xdc8b('0x54')]['rawAttributes']);_0x2cf331['query']=_['keys'](_0x3c857b[_0xdc8b('0x35')]);_0x2cf331[_0xdc8b('0x36')]=_['intersection'](_0x2cf331['model'],_0x2cf331['query']);_0x10e0d0['attributes']=_[_0xdc8b('0x4d')](_0x2cf331[_0xdc8b('0x37')],qs[_0xdc8b('0x39')](_0x3c857b[_0xdc8b('0x35')][_0xdc8b('0x39')]));_0x10e0d0[_0xdc8b('0x38')]=_0x10e0d0[_0xdc8b('0x38')][_0xdc8b('0x3a')]?_0x10e0d0[_0xdc8b('0x38')]:_0x2cf331['model'];_0x10e0d0['order']=qs[_0xdc8b('0x3d')](_0x3c857b['query'][_0xdc8b('0x3d')]);_0x10e0d0[_0xdc8b('0x3e')]=qs['filters'](_[_0xdc8b('0x3f')](_0x3c857b[_0xdc8b('0x35')],_0x2cf331['filters']));if(_0x3c857b[_0xdc8b('0x35')][_0xdc8b('0x40')]){_0x10e0d0['where']=_[_0xdc8b('0x41')](_0x10e0d0[_0xdc8b('0x3e')],{'$or':_['map'](_0x10e0d0[_0xdc8b('0x38')],function(_0x495289){var _0x499762={};_0x499762[_0x495289]={'$like':'%'+_0x3c857b[_0xdc8b('0x35')]['filter']+'%'};return _0x499762;})});}_0x10e0d0=_[_0xdc8b('0x41')]({},_0x10e0d0,_0x3c857b['options']);return _0x469f78[_0xdc8b('0x55')](_0x10e0d0);}})['then'](function(_0xd0039d){if(_0xd0039d){_0xf3ecd4=_0xd0039d[_0xdc8b('0x3a')];if(!_0x3c857b[_0xdc8b('0x35')][_0xdc8b('0x3b')](_0xdc8b('0x56'))){_0x10e0d0[_0xdc8b('0x28')]=qs[_0xdc8b('0x28')](_0x3c857b[_0xdc8b('0x35')]['limit']);_0x10e0d0[_0xdc8b('0x27')]=qs['offset'](_0x3c857b[_0xdc8b('0x35')]['offset']);}return _0x469f78[_0xdc8b('0x55')](_0x10e0d0);}})[_0xdc8b('0x1a')](function(_0x2b2236){if(_0x2b2236){return _0x2b2236?{'count':_0xf3ecd4,'rows':_0x2b2236}:null;}})[_0xdc8b('0x1a')](respondWithResult(_0x4baa74,null))[_0xdc8b('0x49')](handleError(_0x4baa74,null));};exports[_0xdc8b('0x57')]=function(_0x56222f,_0x377c79,_0x451ed1){var _0x1c9c43={};var _0x3da95d={};var _0x23a1ab;var _0x227a6e;return db[_0xdc8b('0x44')][_0xdc8b('0x53')]({'where':{'id':_0x56222f[_0xdc8b('0x4b')]['id']}})[_0xdc8b('0x1a')](handleEntityNotFound(_0x377c79,null))['then'](function(_0x1efbd8){if(_0x1efbd8){_0x23a1ab=_0x1efbd8;_0x3da95d['model']=_[_0xdc8b('0x4c')](db[_0xdc8b('0x54')]['rawAttributes']);_0x3da95d[_0xdc8b('0x35')]=_[_0xdc8b('0x4c')](_0x56222f[_0xdc8b('0x35')]);_0x3da95d[_0xdc8b('0x36')]=_[_0xdc8b('0x4d')](_0x3da95d[_0xdc8b('0x37')],_0x3da95d[_0xdc8b('0x35')]);_0x1c9c43[_0xdc8b('0x38')]=_[_0xdc8b('0x4d')](_0x3da95d[_0xdc8b('0x37')],qs[_0xdc8b('0x39')](_0x56222f[_0xdc8b('0x35')][_0xdc8b('0x39')]));_0x1c9c43[_0xdc8b('0x38')]=_0x1c9c43['attributes'][_0xdc8b('0x3a')]?_0x1c9c43[_0xdc8b('0x38')]:_0x3da95d[_0xdc8b('0x37')];_0x1c9c43[_0xdc8b('0x3c')]=qs[_0xdc8b('0x3d')](_0x56222f['query']['sort']);_0x1c9c43['where']=qs[_0xdc8b('0x36')](_[_0xdc8b('0x3f')](_0x56222f[_0xdc8b('0x35')],_0x3da95d[_0xdc8b('0x36')]));if(_0x56222f[_0xdc8b('0x35')][_0xdc8b('0x40')]){_0x1c9c43[_0xdc8b('0x3e')]=_[_0xdc8b('0x41')](_0x1c9c43['where'],{'$or':_['map'](_0x1c9c43[_0xdc8b('0x38')],function(_0x3f0740){var _0x643dfb={};_0x643dfb[_0x3f0740]={'$like':'%'+_0x56222f[_0xdc8b('0x35')][_0xdc8b('0x40')]+'%'};return _0x643dfb;})});}_0x1c9c43=_[_0xdc8b('0x41')]({},_0x1c9c43,_0x56222f[_0xdc8b('0x43')]);return _0x23a1ab[_0xdc8b('0x57')](_0x1c9c43);}})[_0xdc8b('0x1a')](function(_0x33e0ff){if(_0x33e0ff){_0x227a6e=_0x33e0ff['length'];if(!_0x56222f[_0xdc8b('0x35')]['hasOwnProperty'](_0xdc8b('0x56'))){_0x1c9c43[_0xdc8b('0x28')]=qs['limit'](_0x56222f[_0xdc8b('0x35')]['limit']);_0x1c9c43['offset']=qs['offset'](_0x56222f[_0xdc8b('0x35')][_0xdc8b('0x27')]);}return _0x23a1ab[_0xdc8b('0x57')](_0x1c9c43);}})[_0xdc8b('0x1a')](function(_0xd76f30){if(_0xd76f30){return _0xd76f30?{'count':_0x227a6e,'rows':_0xd76f30}:null;}})[_0xdc8b('0x1a')](respondWithResult(_0x377c79,null))['catch'](handleError(_0x377c79,null));};exports['getDescriptions']=function(_0x5c0e8a,_0x162769,_0x24cd5f){var _0x5cc534={};var _0x1694bf={};var _0x4a26a3;var _0x124951;return db['Dynamics365Configuration']['findOne']({'where':{'id':_0x5c0e8a[_0xdc8b('0x4b')]['id']}})['then'](handleEntityNotFound(_0x162769,null))[_0xdc8b('0x1a')](function(_0x57e123){if(_0x57e123){_0x4a26a3=_0x57e123;_0x1694bf[_0xdc8b('0x37')]=_[_0xdc8b('0x4c')](db[_0xdc8b('0x54')]['rawAttributes']);_0x1694bf['query']=_['keys'](_0x5c0e8a['query']);_0x1694bf[_0xdc8b('0x36')]=_['intersection'](_0x1694bf['model'],_0x1694bf[_0xdc8b('0x35')]);_0x5cc534['attributes']=_['intersection'](_0x1694bf[_0xdc8b('0x37')],qs['fields'](_0x5c0e8a[_0xdc8b('0x35')]['fields']));_0x5cc534[_0xdc8b('0x38')]=_0x5cc534['attributes'][_0xdc8b('0x3a')]?_0x5cc534[_0xdc8b('0x38')]:_0x1694bf[_0xdc8b('0x37')];_0x5cc534[_0xdc8b('0x3c')]=qs[_0xdc8b('0x3d')](_0x5c0e8a[_0xdc8b('0x35')][_0xdc8b('0x3d')]);_0x5cc534[_0xdc8b('0x3e')]=qs[_0xdc8b('0x36')](_[_0xdc8b('0x3f')](_0x5c0e8a[_0xdc8b('0x35')],_0x1694bf[_0xdc8b('0x36')]));if(_0x5c0e8a[_0xdc8b('0x35')][_0xdc8b('0x40')]){_0x5cc534[_0xdc8b('0x3e')]=_[_0xdc8b('0x41')](_0x5cc534[_0xdc8b('0x3e')],{'$or':_['map'](_0x5cc534[_0xdc8b('0x38')],function(_0xe1214c){var _0x110604={};_0x110604[_0xe1214c]={'$like':'%'+_0x5c0e8a[_0xdc8b('0x35')]['filter']+'%'};return _0x110604;})});}_0x5cc534=_['merge']({},_0x5cc534,_0x5c0e8a['options']);return _0x4a26a3[_0xdc8b('0x58')](_0x5cc534);}})[_0xdc8b('0x1a')](function(_0x43a56d){if(_0x43a56d){_0x124951=_0x43a56d[_0xdc8b('0x3a')];if(!_0x5c0e8a['query']['hasOwnProperty'](_0xdc8b('0x56'))){_0x5cc534[_0xdc8b('0x28')]=qs[_0xdc8b('0x28')](_0x5c0e8a[_0xdc8b('0x35')][_0xdc8b('0x28')]);_0x5cc534['offset']=qs['offset'](_0x5c0e8a[_0xdc8b('0x35')]['offset']);}return _0x4a26a3[_0xdc8b('0x58')](_0x5cc534);}})['then'](function(_0x3ab43e){if(_0x3ab43e){return _0x3ab43e?{'count':_0x124951,'rows':_0x3ab43e}:null;}})[_0xdc8b('0x1a')](respondWithResult(_0x162769,null))[_0xdc8b('0x49')](handleError(_0x162769,null));};
\ No newline at end of file
diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js
index 4d92a6a..c5859ed 100644
--- a/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js
+++ b/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xd739=['moment','request-promise','path','rimraf','../../config/environment','./intDynamics365Configuration.attributes','exports','define','Dynamics365Configuration','lodash','api'];(function(_0x2a9e2a,_0x422e3e){var _0x290b00=function(_0x1c8e2d){while(--_0x1c8e2d){_0x2a9e2a['push'](_0x2a9e2a['shift']());}};_0x290b00(++_0x422e3e);}(_0xd739,0xf0));var _0x9d73=function(_0x47a46a,_0xf9c90f){_0x47a46a=_0x47a46a-0x0;var _0x43df70=_0xd739[_0x47a46a];return _0x43df70;};'use strict';var _=require(_0x9d73('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x9d73('0x1'));var moment=require(_0x9d73('0x2'));var BPromise=require('bluebird');var rp=require(_0x9d73('0x3'));var fs=require('fs');var path=require(_0x9d73('0x4'));var rimraf=require(_0x9d73('0x5'));var config=require(_0x9d73('0x6'));var attributes=require(_0x9d73('0x7'));module[_0x9d73('0x8')]=function(_0x3c5005,_0xbbcea6){return _0x3c5005[_0x9d73('0x9')](_0x9d73('0xa'),attributes,{'tableName':'int_dynamics365_configurations','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x040f=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./intDynamics365Configuration.attributes','exports','int_dynamics365_configurations','lodash','util'];(function(_0x1f9259,_0x49bd57){var _0x111ec7=function(_0xc7e0e5){while(--_0xc7e0e5){_0x1f9259['push'](_0x1f9259['shift']());}};_0x111ec7(++_0x49bd57);}(_0x040f,0x6a));var _0xf040=function(_0x37fdf7,_0x34600f){_0x37fdf7=_0x37fdf7-0x0;var _0x1e8998=_0x040f[_0x37fdf7];return _0x1e8998;};'use strict';var _=require(_0xf040('0x0'));var util=require(_0xf040('0x1'));var logger=require(_0xf040('0x2'))(_0xf040('0x3'));var moment=require(_0xf040('0x4'));var BPromise=require(_0xf040('0x5'));var rp=require(_0xf040('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf040('0x7'));var config=require(_0xf040('0x8'));var attributes=require(_0xf040('0x9'));module[_0xf040('0xa')]=function(_0x4ceed0,_0x2ed3cb){return _0x4ceed0['define']('Dynamics365Configuration',attributes,{'tableName':_0xf040('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.rpc.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.rpc.js
index 50e0a5b..78c4ce1 100644
--- a/server/api/intDynamics365Configuration/intDynamics365Configuration.rpc.js
+++ b/server/api/intDynamics365Configuration/intDynamics365Configuration.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x1b5d=['rpc','../../config/environment','jayson/promise','client','http','request','info','Dynamics365Configuration,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','stringify','error','message','result','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x1b7ea6,_0x195a62){var _0x4fcea6=function(_0x29ace1){while(--_0x29ace1){_0x1b7ea6['push'](_0x1b7ea6['shift']());}};_0x4fcea6(++_0x195a62);}(_0x1b5d,0x7d));var _0xd1b5=function(_0x298632,_0xfaac03){_0x298632=_0x298632-0x0;var _0xfa7deb=_0x1b5d[_0x298632];return _0xfa7deb;};'use strict';var _=require(_0xd1b5('0x0'));var util=require(_0xd1b5('0x1'));var moment=require('moment');var BPromise=require(_0xd1b5('0x2'));var rs=require(_0xd1b5('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd1b5('0x4'))['db'];var utils=require(_0xd1b5('0x5'));var logger=require(_0xd1b5('0x6'))(_0xd1b5('0x7'));var config=require(_0xd1b5('0x8'));var jayson=require(_0xd1b5('0x9'));var client=jayson[_0xd1b5('0xa')][_0xd1b5('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x589d2a,_0xbef638,_0x3d414f){return new BPromise(function(_0x28b401,_0x16d2f0){return client[_0xd1b5('0xc')](_0x589d2a,_0x3d414f)['then'](function(_0x21c7bc){logger[_0xd1b5('0xd')](_0xd1b5('0xe'),_0xbef638,_0xd1b5('0xf'));logger[_0xd1b5('0x10')](_0xd1b5('0x11'),_0xbef638,_0xd1b5('0xf'),JSON[_0xd1b5('0x12')](_0x21c7bc));if(_0x21c7bc[_0xd1b5('0x13')]){if(_0x21c7bc[_0xd1b5('0x13')]['code']===0x1f4){logger[_0xd1b5('0x13')](_0xd1b5('0xe'),_0xbef638,_0x21c7bc[_0xd1b5('0x13')][_0xd1b5('0x14')]);return _0x16d2f0(_0x21c7bc[_0xd1b5('0x13')]['message']);}logger[_0xd1b5('0x13')]('Dynamics365Configuration,\x20%s,\x20%s',_0xbef638,_0x21c7bc[_0xd1b5('0x13')][_0xd1b5('0x14')]);return _0x28b401(_0x21c7bc[_0xd1b5('0x13')]['message']);}else{logger['info'](_0xd1b5('0xe'),_0xbef638,_0xd1b5('0xf'));_0x28b401(_0x21c7bc[_0xd1b5('0x15')][_0xd1b5('0x14')]);}})['catch'](function(_0x3176ce){logger[_0xd1b5('0x13')](_0xd1b5('0xe'),_0xbef638,_0x3176ce);_0x16d2f0(_0x3176ce);});});}
\ No newline at end of file
+var _0x7a5d=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','Dynamics365Configuration,\x20%s,\x20%s','debug','request\x20sent','error','code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x119d5a,_0x19b457){var _0x15bff4=function(_0x1b7c78){while(--_0x1b7c78){_0x119d5a['push'](_0x119d5a['shift']());}};_0x15bff4(++_0x19b457);}(_0x7a5d,0x1f4));var _0xd7a5=function(_0x56482c,_0x16118d){_0x56482c=_0x56482c-0x0;var _0x5aae7a=_0x7a5d[_0x56482c];return _0x5aae7a;};'use strict';var _=require(_0xd7a5('0x0'));var util=require(_0xd7a5('0x1'));var moment=require(_0xd7a5('0x2'));var BPromise=require(_0xd7a5('0x3'));var rs=require(_0xd7a5('0x4'));var fs=require('fs');var Redis=require(_0xd7a5('0x5'));var db=require(_0xd7a5('0x6'))['db'];var utils=require(_0xd7a5('0x7'));var logger=require(_0xd7a5('0x8'))(_0xd7a5('0x9'));var config=require(_0xd7a5('0xa'));var jayson=require(_0xd7a5('0xb'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x126f6c,_0x228210,_0x2f7c49){return new BPromise(function(_0x177983,_0x312ad5){return client[_0xd7a5('0xc')](_0x126f6c,_0x2f7c49)[_0xd7a5('0xd')](function(_0x44649a){logger[_0xd7a5('0xe')](_0xd7a5('0xf'),_0x228210,'request\x20sent');logger[_0xd7a5('0x10')]('Dynamics365Configuration,\x20%s,\x20%s,\x20%s',_0x228210,_0xd7a5('0x11'),JSON['stringify'](_0x44649a));if(_0x44649a[_0xd7a5('0x12')]){if(_0x44649a[_0xd7a5('0x12')][_0xd7a5('0x13')]===0x1f4){logger[_0xd7a5('0x12')](_0xd7a5('0xf'),_0x228210,_0x44649a[_0xd7a5('0x12')][_0xd7a5('0x14')]);return _0x312ad5(_0x44649a[_0xd7a5('0x12')][_0xd7a5('0x14')]);}logger['error'](_0xd7a5('0xf'),_0x228210,_0x44649a[_0xd7a5('0x12')][_0xd7a5('0x14')]);return _0x177983(_0x44649a[_0xd7a5('0x12')][_0xd7a5('0x14')]);}else{logger[_0xd7a5('0xe')](_0xd7a5('0xf'),_0x228210,_0xd7a5('0x11'));_0x177983(_0x44649a['result'][_0xd7a5('0x14')]);}})[_0xd7a5('0x15')](function(_0x593a24){logger[_0xd7a5('0x12')](_0xd7a5('0xf'),_0x228210,_0x593a24);_0x312ad5(_0x593a24);});});}
\ No newline at end of file
diff --git a/server/api/intDynamics365Field/index.js b/server/api/intDynamics365Field/index.js
index 36250ed..bda2b8d 100644
--- a/server/api/intDynamics365Field/index.js
+++ b/server/api/intDynamics365Field/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x1ba2=['update','delete','destroy','exports','multer','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','show','put','/:id'];(function(_0xf3777b,_0x896c16){var _0x155f65=function(_0x522427){while(--_0x522427){_0xf3777b['push'](_0xf3777b['shift']());}};_0x155f65(++_0x896c16);}(_0x1ba2,0xb4));var _0x21ba=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1ba2[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x21ba('0x0'));var util=require('util');var path=require(_0x21ba('0x1'));var timeout=require('connect-timeout');var express=require(_0x21ba('0x2'));var router=express[_0x21ba('0x3')]();var auth=require(_0x21ba('0x4'));var interaction=require(_0x21ba('0x5'));var config=require(_0x21ba('0x6'));var controller=require('./intDynamics365Field.controller');router[_0x21ba('0x7')]('/',auth[_0x21ba('0x8')](),controller['index']);router[_0x21ba('0x7')]('/:id',auth[_0x21ba('0x8')](),controller[_0x21ba('0x9')]);router['post']('/',auth[_0x21ba('0x8')](),controller['create']);router[_0x21ba('0xa')](_0x21ba('0xb'),auth['isAuthenticated'](),controller[_0x21ba('0xc')]);router[_0x21ba('0xd')](_0x21ba('0xb'),auth[_0x21ba('0x8')](),controller[_0x21ba('0xe')]);module[_0x21ba('0xf')]=router;
\ No newline at end of file
+var _0x6c76=['update','delete','destroy','exports','multer','util','path','express','Router','../../config/environment','./intDynamics365Field.controller','isAuthenticated','index','/:id','post','create'];(function(_0x4b13ce,_0x339cb0){var _0x427d4b=function(_0x26aaad){while(--_0x26aaad){_0x4b13ce['push'](_0x4b13ce['shift']());}};_0x427d4b(++_0x339cb0);}(_0x6c76,0x184));var _0x66c7=function(_0x172135,_0x3ee287){_0x172135=_0x172135-0x0;var _0x4cbbcb=_0x6c76[_0x172135];return _0x4cbbcb;};'use strict';var multer=require(_0x66c7('0x0'));var util=require(_0x66c7('0x1'));var path=require(_0x66c7('0x2'));var timeout=require('connect-timeout');var express=require(_0x66c7('0x3'));var router=express[_0x66c7('0x4')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x66c7('0x5'));var controller=require(_0x66c7('0x6'));router['get']('/',auth[_0x66c7('0x7')](),controller[_0x66c7('0x8')]);router['get'](_0x66c7('0x9'),auth['isAuthenticated'](),controller['show']);router[_0x66c7('0xa')]('/',auth[_0x66c7('0x7')](),controller[_0x66c7('0xb')]);router['put'](_0x66c7('0x9'),auth[_0x66c7('0x7')](),controller[_0x66c7('0xc')]);router[_0x66c7('0xd')]('/:id',auth[_0x66c7('0x7')](),controller[_0x66c7('0xe')]);module[_0x66c7('0xf')]=router;
\ No newline at end of file
diff --git a/server/api/intDynamics365Field/intDynamics365Field.attributes.js b/server/api/intDynamics365Field/intDynamics365Field.attributes.js
index 6cbbfaf..a7be698 100644
--- a/server/api/intDynamics365Field/intDynamics365Field.attributes.js
+++ b/server/api/intDynamics365Field/intDynamics365Field.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xc4f5=['customVariable','keyValue','string','STRING','BOOLEAN','ENUM','variable'];(function(_0x4fa420,_0x4df6de){var _0x39c36d=function(_0x11b9b3){while(--_0x11b9b3){_0x4fa420['push'](_0x4fa420['shift']());}};_0x39c36d(++_0x4df6de);}(_0xc4f5,0x75));var _0x5c4f=function(_0x132d9e,_0x4a0839){_0x132d9e=_0x132d9e-0x0;var _0x40b733=_0xc4f5[_0x132d9e];return _0x40b733;};'use strict';var Sequelize=require('sequelize');module['exports']={'type':{'type':Sequelize[_0x5c4f('0x0')]('string',_0x5c4f('0x1'),_0x5c4f('0x2'),_0x5c4f('0x3')),'defaultValue':_0x5c4f('0x4')},'content':{'type':Sequelize[_0x5c4f('0x5')]},'key':{'type':Sequelize[_0x5c4f('0x5')]},'keyType':{'type':Sequelize[_0x5c4f('0x0')](_0x5c4f('0x4'),_0x5c4f('0x1'),'customVariable')},'keyContent':{'type':Sequelize[_0x5c4f('0x5')]},'idField':{'type':Sequelize[_0x5c4f('0x5')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x5c4f('0x6')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x5c4f('0x5')]}};
\ No newline at end of file
+var _0x5ab4=['string','variable','keyValue','STRING','customVariable','BOOLEAN','sequelize','exports','ENUM'];(function(_0x135a56,_0x3d72e9){var _0x23e9b0=function(_0x112c32){while(--_0x112c32){_0x135a56['push'](_0x135a56['shift']());}};_0x23e9b0(++_0x3d72e9);}(_0x5ab4,0x9f));var _0x45ab=function(_0x32c560,_0xfc8c30){_0x32c560=_0x32c560-0x0;var _0x39d9cf=_0x5ab4[_0x32c560];return _0x39d9cf;};'use strict';var Sequelize=require(_0x45ab('0x0'));module[_0x45ab('0x1')]={'type':{'type':Sequelize[_0x45ab('0x2')](_0x45ab('0x3'),_0x45ab('0x4'),'customVariable',_0x45ab('0x5')),'defaultValue':_0x45ab('0x3')},'content':{'type':Sequelize[_0x45ab('0x6')]},'key':{'type':Sequelize[_0x45ab('0x6')]},'keyType':{'type':Sequelize[_0x45ab('0x2')](_0x45ab('0x3'),'variable',_0x45ab('0x7'))},'keyContent':{'type':Sequelize[_0x45ab('0x6')]},'idField':{'type':Sequelize[_0x45ab('0x6')]},'nameField':{'type':Sequelize[_0x45ab('0x6')]},'customField':{'type':Sequelize[_0x45ab('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x45ab('0x6')]}};
\ No newline at end of file
diff --git a/server/api/intDynamics365Field/intDynamics365Field.controller.js b/server/api/intDynamics365Field/intDynamics365Field.controller.js
index be2575f..05f7ee5 100644
--- a/server/api/intDynamics365Field/intDynamics365Field.controller.js
+++ b/server/api/intDynamics365Field/intDynamics365Field.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x865d=['sox','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','json','count','offset','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','map','rawAttributes','type','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','where','merge','VIRTUAL','Dynamics365Field','includeAll','include','findAll','params','keys','find','catch','create','body','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path'];(function(_0x5e86b1,_0x157198){var _0x273e9f=function(_0xadc7f6){while(--_0xadc7f6){_0x5e86b1['push'](_0x5e86b1['shift']());}};_0x273e9f(++_0x157198);}(_0x865d,0x1d9));var _0xd865=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x865d[_0x42cae2];return _0x5f256f;};'use strict';var pdf=require(_0xd865('0x0'));var emlformat=require(_0xd865('0x1'));var rimraf=require(_0xd865('0x2'));var zipdir=require(_0xd865('0x3'));var jsonpatch=require(_0xd865('0x4'));var rp=require(_0xd865('0x5'));var moment=require(_0xd865('0x6'));var BPromise=require(_0xd865('0x7'));var Mustache=require('mustache');var util=require(_0xd865('0x8'));var path=require(_0xd865('0x9'));var sox=require(_0xd865('0xa'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0xd865('0xb'));var crypto=require(_0xd865('0xc'));var jsforce=require(_0xd865('0xd'));var deskjs=require(_0xd865('0xe'));var toCsv=require(_0xd865('0xf'));var querystring=require('querystring');var Papa=require(_0xd865('0x10'));var Redis=require(_0xd865('0x11'));var authService=require(_0xd865('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xd865('0x13'));var hardwareService=require(_0xd865('0x14'));var logger=require(_0xd865('0x15'))(_0xd865('0x16'));var utils=require(_0xd865('0x17'));var config=require('../../config/environment');var db=require(_0xd865('0x18'))['db'];function respondWithStatusCode(_0x5bdba6,_0x454c04){_0x454c04=_0x454c04||0xcc;return function(_0x4d85d1){if(_0x4d85d1){return _0x5bdba6[_0xd865('0x19')](_0x454c04);}return _0x5bdba6[_0xd865('0x1a')](_0x454c04)['end']();};}function respondWithResult(_0x14d301,_0x41dd56){_0x41dd56=_0x41dd56||0xc8;return function(_0x1bface){if(_0x1bface){return _0x14d301[_0xd865('0x1a')](_0x41dd56)[_0xd865('0x1b')](_0x1bface);}};}function respondWithFilteredResult(_0x258f55,_0x554787){return function(_0x272273){if(_0x272273){var _0x192da4=_0x272273[_0xd865('0x1c')],_0x337d2d=_0x554787[_0xd865('0x1d')],_0x1f845b=_0x554787[_0xd865('0x1d')]+_0x554787[_0xd865('0x1e')],_0x291a1d;if(_0x1f845b>=_0x192da4){_0x1f845b=_0x192da4;_0x291a1d=0xc8;}else{_0x291a1d=0xce;}_0x258f55[_0xd865('0x1a')](_0x291a1d);return _0x258f55[_0xd865('0x1f')](_0xd865('0x20'),_0x337d2d+'-'+_0x1f845b+'/'+_0x192da4)[_0xd865('0x1b')](_0x272273);}return null;};}function patchUpdates(_0x361a66){return function(_0xaf327b){try{jsonpatch['apply'](_0xaf327b,_0x361a66,!![]);}catch(_0x5376c5){return BPromise[_0xd865('0x21')](_0x5376c5);}return _0xaf327b[_0xd865('0x22')]();};}function saveUpdates(_0x1d526d,_0x4cf25a){return function(_0x48e573){if(_0x48e573){return _0x48e573[_0xd865('0x23')](_0x1d526d)[_0xd865('0x24')](function(_0x38334e){return _0x38334e;});}return null;};}function removeEntity(_0xf0ef66,_0x21a7c5){return function(_0x4951d5){if(_0x4951d5){return _0x4951d5[_0xd865('0x25')]()['then'](function(){_0xf0ef66[_0xd865('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x360ffc,_0x34b99e){return function(_0x1b1f49){if(!_0x1b1f49){_0x360ffc[_0xd865('0x19')](0x194);}return _0x1b1f49;};}function handleError(_0x277662,_0x36703a){_0x36703a=_0x36703a||0x1f4;return function(_0x563509){logger[_0xd865('0x26')](_0x563509[_0xd865('0x27')]);if(_0x563509[_0xd865('0x28')]){delete _0x563509['name'];}_0x277662[_0xd865('0x1a')](_0x36703a)[_0xd865('0x29')](_0x563509);};}exports[_0xd865('0x2a')]=function(_0x5ab036,_0x2bf515){var _0x54c0ad={},_0x4ae1a9={},_0x534b75={'count':0x0,'rows':[]};var _0x2e9ec5=_[_0xd865('0x2b')](db['Dynamics365Field'][_0xd865('0x2c')],function(_0x5a90e2){return{'name':_0x5a90e2['fieldName'],'type':_0x5a90e2[_0xd865('0x2d')]['key']};});_0x4ae1a9['model']=_[_0xd865('0x2b')](_0x2e9ec5,_0xd865('0x28'));_0x4ae1a9[_0xd865('0x2e')]=_['keys'](_0x5ab036[_0xd865('0x2e')]);_0x4ae1a9[_0xd865('0x2f')]=_[_0xd865('0x30')](_0x4ae1a9[_0xd865('0x31')],_0x4ae1a9[_0xd865('0x2e')]);_0x54c0ad[_0xd865('0x32')]=_['intersection'](_0x4ae1a9['model'],qs[_0xd865('0x33')](_0x5ab036[_0xd865('0x2e')][_0xd865('0x33')]));_0x54c0ad[_0xd865('0x32')]=_0x54c0ad[_0xd865('0x32')][_0xd865('0x34')]?_0x54c0ad[_0xd865('0x32')]:_0x4ae1a9[_0xd865('0x31')];if(!_0x5ab036['query'][_0xd865('0x35')]('nolimit')){_0x54c0ad[_0xd865('0x1e')]=qs[_0xd865('0x1e')](_0x5ab036[_0xd865('0x2e')][_0xd865('0x1e')]);_0x54c0ad[_0xd865('0x1d')]=qs[_0xd865('0x1d')](_0x5ab036[_0xd865('0x2e')]['offset']);}_0x54c0ad[_0xd865('0x36')]=qs[_0xd865('0x37')](_0x5ab036[_0xd865('0x2e')]['sort']);_0x54c0ad[_0xd865('0x38')]=qs[_0xd865('0x2f')](_['pick'](_0x5ab036[_0xd865('0x2e')],_0x4ae1a9['filters']),_0x2e9ec5);if(_0x5ab036['query']['filter']){_0x54c0ad[_0xd865('0x38')]=_[_0xd865('0x39')](_0x54c0ad[_0xd865('0x38')],{'$or':_['map'](_0x2e9ec5,function(_0x442268){if(_0x442268[_0xd865('0x2d')]!==_0xd865('0x3a')){var _0x4b4e18={};_0x4b4e18[_0x442268[_0xd865('0x28')]]={'$like':'%'+_0x5ab036[_0xd865('0x2e')]['filter']+'%'};return _0x4b4e18;}})});}_0x54c0ad=_[_0xd865('0x39')]({},_0x54c0ad,_0x5ab036['options']);var _0x301829={'where':_0x54c0ad[_0xd865('0x38')]};return db[_0xd865('0x3b')][_0xd865('0x1c')](_0x301829)[_0xd865('0x24')](function(_0x1a8a93){_0x534b75['count']=_0x1a8a93;if(_0x5ab036[_0xd865('0x2e')][_0xd865('0x3c')]){_0x54c0ad[_0xd865('0x3d')]=[{'all':!![]}];}return db['Dynamics365Field'][_0xd865('0x3e')](_0x54c0ad);})['then'](function(_0x9380d3){_0x534b75['rows']=_0x9380d3;return _0x534b75;})[_0xd865('0x24')](respondWithFilteredResult(_0x2bf515,_0x54c0ad))['catch'](handleError(_0x2bf515,null));};exports['show']=function(_0x194e2a,_0x99184b){var _0x34e681={'raw':!![],'where':{'id':_0x194e2a[_0xd865('0x3f')]['id']}},_0x1f8daf={};_0x1f8daf[_0xd865('0x31')]=_[_0xd865('0x40')](db[_0xd865('0x3b')][_0xd865('0x2c')]);_0x1f8daf[_0xd865('0x2e')]=_[_0xd865('0x40')](_0x194e2a[_0xd865('0x2e')]);_0x1f8daf[_0xd865('0x2f')]=_[_0xd865('0x30')](_0x1f8daf[_0xd865('0x31')],_0x1f8daf['query']);_0x34e681[_0xd865('0x32')]=_[_0xd865('0x30')](_0x1f8daf[_0xd865('0x31')],qs[_0xd865('0x33')](_0x194e2a[_0xd865('0x2e')][_0xd865('0x33')]));_0x34e681[_0xd865('0x32')]=_0x34e681['attributes']['length']?_0x34e681[_0xd865('0x32')]:_0x1f8daf[_0xd865('0x31')];if(_0x194e2a[_0xd865('0x2e')][_0xd865('0x3c')]){_0x34e681[_0xd865('0x3d')]=[{'all':!![]}];}_0x34e681=_['merge']({},_0x34e681,_0x194e2a['options']);return db['Dynamics365Field'][_0xd865('0x41')](_0x34e681)[_0xd865('0x24')](handleEntityNotFound(_0x99184b,null))[_0xd865('0x24')](respondWithResult(_0x99184b,null))[_0xd865('0x42')](handleError(_0x99184b,null));};exports[_0xd865('0x43')]=function(_0x29fb1a,_0x17cea8){return db[_0xd865('0x3b')][_0xd865('0x43')](_0x29fb1a[_0xd865('0x44')],{})[_0xd865('0x24')](respondWithResult(_0x17cea8,0xc9))[_0xd865('0x42')](handleError(_0x17cea8,null));};exports['update']=function(_0x9a387e,_0x3daa24){if(_0x9a387e['body']['id']){delete _0x9a387e[_0xd865('0x44')]['id'];}return db[_0xd865('0x3b')][_0xd865('0x41')]({'where':{'id':_0x9a387e[_0xd865('0x3f')]['id']}})[_0xd865('0x24')](handleEntityNotFound(_0x3daa24,null))['then'](saveUpdates(_0x9a387e[_0xd865('0x44')],null))[_0xd865('0x24')](respondWithResult(_0x3daa24,null))[_0xd865('0x42')](handleError(_0x3daa24,null));};exports[_0xd865('0x25')]=function(_0x16ca4f,_0x34170e){return db[_0xd865('0x3b')][_0xd865('0x41')]({'where':{'id':_0x16ca4f[_0xd865('0x3f')]['id']}})[_0xd865('0x24')](handleEntityNotFound(_0x34170e,null))[_0xd865('0x24')](removeEntity(_0x34170e,null))[_0xd865('0x42')](handleError(_0x34170e,null));};
\ No newline at end of file
+var _0xfacc=['path','sox','to-csv','squel','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','count','offset','limit','set','Content-Range','apply','save','update','then','destroy','error','stack','name','index','rawAttributes','fieldName','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','map','filter','Dynamics365Field','includeAll','include','findAll','rows','catch','show','options','find','create','body','params','rimraf','zip-dir','request-promise','moment','bluebird','mustache'];(function(_0x4dca38,_0x5dfae1){var _0x44656c=function(_0x538a62){while(--_0x538a62){_0x4dca38['push'](_0x4dca38['shift']());}};_0x44656c(++_0x5dfae1);}(_0xfacc,0x8a));var _0xcfac=function(_0xb8e44,_0x2a6a20){_0xb8e44=_0xb8e44-0x0;var _0x3dbb16=_0xfacc[_0xb8e44];return _0x3dbb16;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0xcfac('0x0'));var zipdir=require(_0xcfac('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xcfac('0x2'));var moment=require(_0xcfac('0x3'));var BPromise=require(_0xcfac('0x4'));var Mustache=require(_0xcfac('0x5'));var util=require('util');var path=require(_0xcfac('0x6'));var sox=require(_0xcfac('0x7'));var csv=require(_0xcfac('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0xcfac('0x9'));var crypto=require('crypto');var jsforce=require(_0xcfac('0xa'));var deskjs=require(_0xcfac('0xb'));var toCsv=require(_0xcfac('0x8'));var querystring=require(_0xcfac('0xc'));var Papa=require(_0xcfac('0xd'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xcfac('0xe'));var as=require(_0xcfac('0xf'));var hardwareService=require(_0xcfac('0x10'));var logger=require(_0xcfac('0x11'))(_0xcfac('0x12'));var utils=require(_0xcfac('0x13'));var config=require(_0xcfac('0x14'));var db=require(_0xcfac('0x15'))['db'];function respondWithStatusCode(_0x37ac45,_0x20b82f){_0x20b82f=_0x20b82f||0xcc;return function(_0x1893a9){if(_0x1893a9){return _0x37ac45[_0xcfac('0x16')](_0x20b82f);}return _0x37ac45['status'](_0x20b82f)[_0xcfac('0x17')]();};}function respondWithResult(_0x282f87,_0x4a8ced){_0x4a8ced=_0x4a8ced||0xc8;return function(_0x3cce0f){if(_0x3cce0f){return _0x282f87[_0xcfac('0x18')](_0x4a8ced)[_0xcfac('0x19')](_0x3cce0f);}};}function respondWithFilteredResult(_0x191ce2,_0x556d42){return function(_0x35ddd5){if(_0x35ddd5){var _0x21ec5e=_0x35ddd5[_0xcfac('0x1a')],_0x38434a=_0x556d42[_0xcfac('0x1b')],_0x65af40=_0x556d42['offset']+_0x556d42[_0xcfac('0x1c')],_0x4d870f;if(_0x65af40>=_0x21ec5e){_0x65af40=_0x21ec5e;_0x4d870f=0xc8;}else{_0x4d870f=0xce;}_0x191ce2[_0xcfac('0x18')](_0x4d870f);return _0x191ce2[_0xcfac('0x1d')](_0xcfac('0x1e'),_0x38434a+'-'+_0x65af40+'/'+_0x21ec5e)[_0xcfac('0x19')](_0x35ddd5);}return null;};}function patchUpdates(_0x143187){return function(_0x153c92){try{jsonpatch[_0xcfac('0x1f')](_0x153c92,_0x143187,!![]);}catch(_0x2cc764){return BPromise['reject'](_0x2cc764);}return _0x153c92[_0xcfac('0x20')]();};}function saveUpdates(_0x36bc98,_0x10228b){return function(_0x37303d){if(_0x37303d){return _0x37303d[_0xcfac('0x21')](_0x36bc98)[_0xcfac('0x22')](function(_0x28a5f2){return _0x28a5f2;});}return null;};}function removeEntity(_0xeecc2f,_0x2f1d20){return function(_0x23a2fa){if(_0x23a2fa){return _0x23a2fa[_0xcfac('0x23')]()[_0xcfac('0x22')](function(){_0xeecc2f['status'](0xcc)[_0xcfac('0x17')]();});}};}function handleEntityNotFound(_0x2474a6,_0x26a4fd){return function(_0x2ee083){if(!_0x2ee083){_0x2474a6[_0xcfac('0x16')](0x194);}return _0x2ee083;};}function handleError(_0x320069,_0x56296f){_0x56296f=_0x56296f||0x1f4;return function(_0x279844){logger[_0xcfac('0x24')](_0x279844[_0xcfac('0x25')]);if(_0x279844[_0xcfac('0x26')]){delete _0x279844[_0xcfac('0x26')];}_0x320069[_0xcfac('0x18')](_0x56296f)['send'](_0x279844);};}exports[_0xcfac('0x27')]=function(_0xce4b3f,_0x2d89be){var _0x3216f0={},_0xa4e0bc={},_0x40d028={'count':0x0,'rows':[]};var _0x120fca=_['map'](db['Dynamics365Field'][_0xcfac('0x28')],function(_0x16a7e6){return{'name':_0x16a7e6[_0xcfac('0x29')],'type':_0x16a7e6['type'][_0xcfac('0x2a')]};});_0xa4e0bc[_0xcfac('0x2b')]=_['map'](_0x120fca,_0xcfac('0x26'));_0xa4e0bc[_0xcfac('0x2c')]=_[_0xcfac('0x2d')](_0xce4b3f['query']);_0xa4e0bc[_0xcfac('0x2e')]=_['intersection'](_0xa4e0bc[_0xcfac('0x2b')],_0xa4e0bc[_0xcfac('0x2c')]);_0x3216f0[_0xcfac('0x2f')]=_[_0xcfac('0x30')](_0xa4e0bc[_0xcfac('0x2b')],qs[_0xcfac('0x31')](_0xce4b3f['query']['fields']));_0x3216f0[_0xcfac('0x2f')]=_0x3216f0[_0xcfac('0x2f')][_0xcfac('0x32')]?_0x3216f0[_0xcfac('0x2f')]:_0xa4e0bc[_0xcfac('0x2b')];if(!_0xce4b3f[_0xcfac('0x2c')][_0xcfac('0x33')](_0xcfac('0x34'))){_0x3216f0[_0xcfac('0x1c')]=qs[_0xcfac('0x1c')](_0xce4b3f['query'][_0xcfac('0x1c')]);_0x3216f0[_0xcfac('0x1b')]=qs['offset'](_0xce4b3f['query'][_0xcfac('0x1b')]);}_0x3216f0[_0xcfac('0x35')]=qs['sort'](_0xce4b3f[_0xcfac('0x2c')][_0xcfac('0x36')]);_0x3216f0[_0xcfac('0x37')]=qs[_0xcfac('0x2e')](_[_0xcfac('0x38')](_0xce4b3f[_0xcfac('0x2c')],_0xa4e0bc[_0xcfac('0x2e')]),_0x120fca);if(_0xce4b3f[_0xcfac('0x2c')]['filter']){_0x3216f0[_0xcfac('0x37')]=_[_0xcfac('0x39')](_0x3216f0[_0xcfac('0x37')],{'$or':_[_0xcfac('0x3a')](_0x120fca,function(_0x496603){if(_0x496603['type']!=='VIRTUAL'){var _0x14c58c={};_0x14c58c[_0x496603[_0xcfac('0x26')]]={'$like':'%'+_0xce4b3f['query'][_0xcfac('0x3b')]+'%'};return _0x14c58c;}})});}_0x3216f0=_[_0xcfac('0x39')]({},_0x3216f0,_0xce4b3f['options']);var _0x2b30be={'where':_0x3216f0['where']};return db[_0xcfac('0x3c')][_0xcfac('0x1a')](_0x2b30be)[_0xcfac('0x22')](function(_0x218272){_0x40d028[_0xcfac('0x1a')]=_0x218272;if(_0xce4b3f[_0xcfac('0x2c')][_0xcfac('0x3d')]){_0x3216f0[_0xcfac('0x3e')]=[{'all':!![]}];}return db[_0xcfac('0x3c')][_0xcfac('0x3f')](_0x3216f0);})[_0xcfac('0x22')](function(_0x1ac17c){_0x40d028[_0xcfac('0x40')]=_0x1ac17c;return _0x40d028;})[_0xcfac('0x22')](respondWithFilteredResult(_0x2d89be,_0x3216f0))[_0xcfac('0x41')](handleError(_0x2d89be,null));};exports[_0xcfac('0x42')]=function(_0x47127e,_0x1d5787){var _0x342eab={'raw':!![],'where':{'id':_0x47127e['params']['id']}},_0x107d8b={};_0x107d8b['model']=_['keys'](db[_0xcfac('0x3c')]['rawAttributes']);_0x107d8b['query']=_[_0xcfac('0x2d')](_0x47127e[_0xcfac('0x2c')]);_0x107d8b[_0xcfac('0x2e')]=_[_0xcfac('0x30')](_0x107d8b[_0xcfac('0x2b')],_0x107d8b['query']);_0x342eab[_0xcfac('0x2f')]=_[_0xcfac('0x30')](_0x107d8b['model'],qs[_0xcfac('0x31')](_0x47127e[_0xcfac('0x2c')][_0xcfac('0x31')]));_0x342eab[_0xcfac('0x2f')]=_0x342eab[_0xcfac('0x2f')][_0xcfac('0x32')]?_0x342eab[_0xcfac('0x2f')]:_0x107d8b[_0xcfac('0x2b')];if(_0x47127e[_0xcfac('0x2c')]['includeAll']){_0x342eab[_0xcfac('0x3e')]=[{'all':!![]}];}_0x342eab=_['merge']({},_0x342eab,_0x47127e[_0xcfac('0x43')]);return db['Dynamics365Field'][_0xcfac('0x44')](_0x342eab)['then'](handleEntityNotFound(_0x1d5787,null))[_0xcfac('0x22')](respondWithResult(_0x1d5787,null))['catch'](handleError(_0x1d5787,null));};exports[_0xcfac('0x45')]=function(_0x8fe37,_0x509af1){return db[_0xcfac('0x3c')][_0xcfac('0x45')](_0x8fe37[_0xcfac('0x46')],{})[_0xcfac('0x22')](respondWithResult(_0x509af1,0xc9))[_0xcfac('0x41')](handleError(_0x509af1,null));};exports[_0xcfac('0x21')]=function(_0x1119d2,_0x210d17){if(_0x1119d2[_0xcfac('0x46')]['id']){delete _0x1119d2[_0xcfac('0x46')]['id'];}return db['Dynamics365Field'][_0xcfac('0x44')]({'where':{'id':_0x1119d2[_0xcfac('0x47')]['id']}})[_0xcfac('0x22')](handleEntityNotFound(_0x210d17,null))['then'](saveUpdates(_0x1119d2[_0xcfac('0x46')],null))[_0xcfac('0x22')](respondWithResult(_0x210d17,null))[_0xcfac('0x41')](handleError(_0x210d17,null));};exports[_0xcfac('0x23')]=function(_0x1a3deb,_0x491768){return db[_0xcfac('0x3c')][_0xcfac('0x44')]({'where':{'id':_0x1a3deb['params']['id']}})[_0xcfac('0x22')](handleEntityNotFound(_0x491768,null))[_0xcfac('0x22')](removeEntity(_0x491768,null))[_0xcfac('0x41')](handleError(_0x491768,null));};
\ No newline at end of file
diff --git a/server/api/intDynamics365Field/intDynamics365Field.model.js b/server/api/intDynamics365Field/intDynamics365Field.model.js
index 2f559ef..9f1269c 100644
--- a/server/api/intDynamics365Field/intDynamics365Field.model.js
+++ b/server/api/intDynamics365Field/intDynamics365Field.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xab10=['../../config/logger','api','moment','path','rimraf','../../config/environment','./intDynamics365Field.attributes','exports','define','Dynamics365Field','dynamics365_unique_index','idField','FieldId','lodash'];(function(_0x1a8f86,_0x5ed9c4){var _0x20d876=function(_0x596e1b){while(--_0x596e1b){_0x1a8f86['push'](_0x1a8f86['shift']());}};_0x20d876(++_0x5ed9c4);}(_0xab10,0x117));var _0x0ab1=function(_0x373a7b,_0x7e9e31){_0x373a7b=_0x373a7b-0x0;var _0x5e589c=_0xab10[_0x373a7b];return _0x5e589c;};'use strict';var _=require(_0x0ab1('0x0'));var util=require('util');var logger=require(_0x0ab1('0x1'))(_0x0ab1('0x2'));var moment=require(_0x0ab1('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x0ab1('0x4'));var rimraf=require(_0x0ab1('0x5'));var config=require(_0x0ab1('0x6'));var attributes=require(_0x0ab1('0x7'));module[_0x0ab1('0x8')]=function(_0x2ed90b,_0x3668fa){return _0x2ed90b[_0x0ab1('0x9')](_0x0ab1('0xa'),attributes,{'tableName':'int_dynamics365_fields','paranoid':![],'indexes':[{'name':_0x0ab1('0xb'),'fields':[_0x0ab1('0xc'),_0x0ab1('0xd')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x3152=['path','rimraf','../../config/environment','./intDynamics365Field.attributes','define','Dynamics365Field','int_dynamics365_fields','dynamics365_unique_index','idField','../../config/logger','api','bluebird','request-promise'];(function(_0x30f323,_0x587ab7){var _0x442877=function(_0x4bc180){while(--_0x4bc180){_0x30f323['push'](_0x30f323['shift']());}};_0x442877(++_0x587ab7);}(_0x3152,0x64));var _0x2315=function(_0x199572,_0x33e667){_0x199572=_0x199572-0x0;var _0x13cfa3=_0x3152[_0x199572];return _0x13cfa3;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x2315('0x0'))(_0x2315('0x1'));var moment=require('moment');var BPromise=require(_0x2315('0x2'));var rp=require(_0x2315('0x3'));var fs=require('fs');var path=require(_0x2315('0x4'));var rimraf=require(_0x2315('0x5'));var config=require(_0x2315('0x6'));var attributes=require(_0x2315('0x7'));module['exports']=function(_0x30ecc7,_0x29b651){return _0x30ecc7[_0x2315('0x8')](_0x2315('0x9'),attributes,{'tableName':_0x2315('0xa'),'paranoid':![],'indexes':[{'name':_0x2315('0xb'),'fields':[_0x2315('0xc'),'FieldId'],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/intDynamics365Field/intDynamics365Field.rpc.js b/server/api/intDynamics365Field/intDynamics365Field.rpc.js
index 9d452dc..f6ab487 100644
--- a/server/api/intDynamics365Field/intDynamics365Field.rpc.js
+++ b/server/api/intDynamics365Field/intDynamics365Field.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x8ca9=['info','Dynamics365Field,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Field,\x20%s,\x20%s,\x20%s','stringify','error','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','jayson/promise','http','request','then'];(function(_0x5bbc68,_0xa50938){var _0x2681a6=function(_0x2a05b2){while(--_0x2a05b2){_0x5bbc68['push'](_0x5bbc68['shift']());}};_0x2681a6(++_0xa50938);}(_0x8ca9,0x9c));var _0x98ca=function(_0x51a6e8,_0x3e754a){_0x51a6e8=_0x51a6e8-0x0;var _0xda6ca=_0x8ca9[_0x51a6e8];return _0xda6ca;};'use strict';var _=require(_0x98ca('0x0'));var util=require(_0x98ca('0x1'));var moment=require(_0x98ca('0x2'));var BPromise=require(_0x98ca('0x3'));var rs=require(_0x98ca('0x4'));var fs=require('fs');var Redis=require(_0x98ca('0x5'));var db=require(_0x98ca('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x98ca('0x7'));var config=require('../../config/environment');var jayson=require(_0x98ca('0x8'));var client=jayson['client'][_0x98ca('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xca4097,_0x18c349,_0x2852a0){return new BPromise(function(_0x323c95,_0x28a37a){return client[_0x98ca('0xa')](_0xca4097,_0x2852a0)[_0x98ca('0xb')](function(_0x277c29){logger[_0x98ca('0xc')](_0x98ca('0xd'),_0x18c349,_0x98ca('0xe'));logger[_0x98ca('0xf')](_0x98ca('0x10'),_0x18c349,_0x98ca('0xe'),JSON[_0x98ca('0x11')](_0x277c29));if(_0x277c29[_0x98ca('0x12')]){if(_0x277c29[_0x98ca('0x12')]['code']===0x1f4){logger[_0x98ca('0x12')](_0x98ca('0xd'),_0x18c349,_0x277c29[_0x98ca('0x12')][_0x98ca('0x13')]);return _0x28a37a(_0x277c29['error'][_0x98ca('0x13')]);}logger[_0x98ca('0x12')](_0x98ca('0xd'),_0x18c349,_0x277c29[_0x98ca('0x12')][_0x98ca('0x13')]);return _0x323c95(_0x277c29[_0x98ca('0x12')][_0x98ca('0x13')]);}else{logger['info'](_0x98ca('0xd'),_0x18c349,_0x98ca('0xe'));_0x323c95(_0x277c29[_0x98ca('0x14')][_0x98ca('0x13')]);}})['catch'](function(_0x238c1a){logger[_0x98ca('0x12')](_0x98ca('0xd'),_0x18c349,_0x238c1a);_0x28a37a(_0x238c1a);});});}
\ No newline at end of file
+var _0xfe39=['../../config/environment','jayson/promise','client','http','request','then','info','Dynamics365Field,\x20%s,\x20%s','Dynamics365Field,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','lodash','util','bluebird','../../mysqldb','../../config/utils'];(function(_0x3502e2,_0x111b54){var _0x5a4aea=function(_0x5375e4){while(--_0x5375e4){_0x3502e2['push'](_0x3502e2['shift']());}};_0x5a4aea(++_0x111b54);}(_0xfe39,0x1b3));var _0x9fe3=function(_0x11005e,_0x20c3d2){_0x11005e=_0x11005e-0x0;var _0x29338f=_0xfe39[_0x11005e];return _0x29338f;};'use strict';var _=require(_0x9fe3('0x0'));var util=require(_0x9fe3('0x1'));var moment=require('moment');var BPromise=require(_0x9fe3('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9fe3('0x3'))['db'];var utils=require(_0x9fe3('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0x9fe3('0x5'));var jayson=require(_0x9fe3('0x6'));var client=jayson[_0x9fe3('0x7')][_0x9fe3('0x8')]({'port':0x232a});function respondWithRpcPromise(_0xc469b7,_0x4183ce,_0x25868f){return new BPromise(function(_0x5a3bd6,_0x211eb2){return client[_0x9fe3('0x9')](_0xc469b7,_0x25868f)[_0x9fe3('0xa')](function(_0x35c391){logger[_0x9fe3('0xb')](_0x9fe3('0xc'),_0x4183ce,'request\x20sent');logger['debug'](_0x9fe3('0xd'),_0x4183ce,_0x9fe3('0xe'),JSON['stringify'](_0x35c391));if(_0x35c391[_0x9fe3('0xf')]){if(_0x35c391[_0x9fe3('0xf')][_0x9fe3('0x10')]===0x1f4){logger[_0x9fe3('0xf')]('Dynamics365Field,\x20%s,\x20%s',_0x4183ce,_0x35c391[_0x9fe3('0xf')][_0x9fe3('0x11')]);return _0x211eb2(_0x35c391[_0x9fe3('0xf')][_0x9fe3('0x11')]);}logger['error']('Dynamics365Field,\x20%s,\x20%s',_0x4183ce,_0x35c391[_0x9fe3('0xf')][_0x9fe3('0x11')]);return _0x5a3bd6(_0x35c391[_0x9fe3('0xf')][_0x9fe3('0x11')]);}else{logger[_0x9fe3('0xb')]('Dynamics365Field,\x20%s,\x20%s',_0x4183ce,'request\x20sent');_0x5a3bd6(_0x35c391[_0x9fe3('0x12')][_0x9fe3('0x11')]);}})[_0x9fe3('0x13')](function(_0x2d28d4){logger['error'](_0x9fe3('0xc'),_0x4183ce,_0x2d28d4);_0x211eb2(_0x2d28d4);});});}
\ No newline at end of file
diff --git a/server/api/intFreshdeskAccount/index.js b/server/api/intFreshdeskAccount/index.js
index 25320c2..61ad688 100644
--- a/server/api/intFreshdeskAccount/index.js
+++ b/server/api/intFreshdeskAccount/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x8801=['/:id','isAuthenticated','show','/:id/configurations','getConfigurations','getFields','post','addConfiguration','put','delete','exports','util','express','../../components/interaction/service','../../config/environment','get','index'];(function(_0x4aac5a,_0x15b04c){var _0x42e7bc=function(_0x1da766){while(--_0x1da766){_0x4aac5a['push'](_0x4aac5a['shift']());}};_0x42e7bc(++_0x15b04c);}(_0x8801,0x11b));var _0x1880=function(_0x51ef72,_0x42f4ca){_0x51ef72=_0x51ef72-0x0;var _0x5c4305=_0x8801[_0x51ef72];return _0x5c4305;};'use strict';var multer=require('multer');var util=require(_0x1880('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x1880('0x1'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x1880('0x2'));var config=require(_0x1880('0x3'));var controller=require('./intFreshdeskAccount.controller');router[_0x1880('0x4')]('/',auth['isAuthenticated'](),controller[_0x1880('0x5')]);router[_0x1880('0x4')](_0x1880('0x6'),auth[_0x1880('0x7')](),controller[_0x1880('0x8')]);router['get'](_0x1880('0x9'),auth['isAuthenticated'](),controller[_0x1880('0xa')]);router[_0x1880('0x4')]('/:id/fields',auth[_0x1880('0x7')](),controller[_0x1880('0xb')]);router[_0x1880('0xc')]('/',auth[_0x1880('0x7')](),controller['create']);router['post']('/:id/configurations',auth[_0x1880('0x7')](),controller[_0x1880('0xd')]);router[_0x1880('0xe')]('/:id',auth[_0x1880('0x7')](),controller['update']);router[_0x1880('0xf')]('/:id',auth[_0x1880('0x7')](),controller['destroy']);module[_0x1880('0x10')]=router;
\ No newline at end of file
+var _0x42fe=['show','/:id/configurations','getConfigurations','/:id/fields','isAuthenticated','addConfiguration','put','/:id','update','delete','exports','util','path','express','Router','../../components/auth/service','../../components/interaction/service','get','index'];(function(_0x187d80,_0x5b793f){var _0x498a77=function(_0x633dc9){while(--_0x633dc9){_0x187d80['push'](_0x187d80['shift']());}};_0x498a77(++_0x5b793f);}(_0x42fe,0x161));var _0xe42f=function(_0x4271f1,_0xdbdc80){_0x4271f1=_0x4271f1-0x0;var _0x1bc9c9=_0x42fe[_0x4271f1];return _0x1bc9c9;};'use strict';var multer=require('multer');var util=require(_0xe42f('0x0'));var path=require(_0xe42f('0x1'));var timeout=require('connect-timeout');var express=require(_0xe42f('0x2'));var router=express[_0xe42f('0x3')]();var auth=require(_0xe42f('0x4'));var interaction=require(_0xe42f('0x5'));var config=require('../../config/environment');var controller=require('./intFreshdeskAccount.controller');router[_0xe42f('0x6')]('/',auth['isAuthenticated'](),controller[_0xe42f('0x7')]);router[_0xe42f('0x6')]('/:id',auth['isAuthenticated'](),controller[_0xe42f('0x8')]);router['get'](_0xe42f('0x9'),auth['isAuthenticated'](),controller[_0xe42f('0xa')]);router[_0xe42f('0x6')](_0xe42f('0xb'),auth[_0xe42f('0xc')](),controller['getFields']);router['post']('/',auth[_0xe42f('0xc')](),controller['create']);router['post']('/:id/configurations',auth[_0xe42f('0xc')](),controller[_0xe42f('0xd')]);router[_0xe42f('0xe')](_0xe42f('0xf'),auth[_0xe42f('0xc')](),controller[_0xe42f('0x10')]);router[_0xe42f('0x11')]('/:id',auth[_0xe42f('0xc')](),controller['destroy']);module[_0xe42f('0x12')]=router;
\ No newline at end of file
diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js
index dfcae70..f588cc4 100644
--- a/server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js
+++ b/server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x056b=['username','remoteUri','exports','STRING'];(function(_0x4e9b66,_0x285d76){var _0x45fb71=function(_0x1afdfa){while(--_0x1afdfa){_0x4e9b66['push'](_0x4e9b66['shift']());}};_0x45fb71(++_0x285d76);}(_0x056b,0xb6));var _0xb056=function(_0x370c8f,_0x3c429d){_0x370c8f=_0x370c8f-0x0;var _0x180dde=_0x056b[_0x370c8f];return _0x180dde;};'use strict';var Sequelize=require('sequelize');module[_0xb056('0x0')]={'name':{'type':Sequelize[_0xb056('0x1')]},'description':{'type':Sequelize[_0xb056('0x1')]},'username':{'type':Sequelize[_0xb056('0x1')],'unique':_0xb056('0x2')},'apiKey':{'type':Sequelize[_0xb056('0x1')]},'remoteUri':{'type':Sequelize[_0xb056('0x1')],'unique':_0xb056('0x3')},'serverUrl':{'type':Sequelize[_0xb056('0x1')]}};
\ No newline at end of file
+var _0x866a=['username','remoteUri','exports','STRING'];(function(_0x1e974b,_0x132f0d){var _0x387899=function(_0x141df5){while(--_0x141df5){_0x1e974b['push'](_0x1e974b['shift']());}};_0x387899(++_0x132f0d);}(_0x866a,0x156));var _0xa866=function(_0xe4ee1e,_0xea8b9b){_0xe4ee1e=_0xe4ee1e-0x0;var _0x22f903=_0x866a[_0xe4ee1e];return _0x22f903;};'use strict';var Sequelize=require('sequelize');module[_0xa866('0x0')]={'name':{'type':Sequelize[_0xa866('0x1')]},'description':{'type':Sequelize[_0xa866('0x1')]},'username':{'type':Sequelize[_0xa866('0x1')],'unique':_0xa866('0x2')},'apiKey':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0xa866('0x1')],'unique':_0xa866('0x3')},'serverUrl':{'type':Sequelize[_0xa866('0x1')]}};
\ No newline at end of file
diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.controller.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.controller.js
index 8ca3c53..678ebee 100644
--- a/server/api/intFreshdeskAccount/intFreshdeskAccount.controller.js
+++ b/server/api/intFreshdeskAccount/intFreshdeskAccount.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x1cb9=['reject','save','update','destroy','name','send','index','FreshdeskAccount','rawAttributes','fieldName','type','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','filter','merge','where','VIRTUAL','options','count','includeAll','findAll','keys','include','find','create','body','params','getConfigurations','findOne','order','pick','addConfiguration','AccountId','Descriptions','channel','FreshdeskConfiguration','Subjects','FreshdeskField','getFields','remoteUri','slice','substring','GET','format','api/v2/ticket_fields','Basic\x20%s','%s:X','apiKey','toString','base64','requester','subject','agent','description','priority','group','ticket_type','company','remove','includes','default','custom_text','custom_dropdown','choices','capitalize','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../components/integrations/configuration','jayson/promise','http','Sequelize','ValidationError','then','info','FreshdeskAccount,\x20%s,\x20%s','debug','FreshdeskAccount,\x20%s,\x20%s,\x20%s','stringify','code','error','message','request\x20sent','result','catch','sendStatus','end','status','offset','limit','set','Content-Range','json','apply'];(function(_0x56482c,_0x16118d){var _0x5aae7a=function(_0x52512f){while(--_0x52512f){_0x56482c['push'](_0x56482c['shift']());}};_0x5aae7a(++_0x16118d);}(_0x1cb9,0x14e));var _0x91cb=function(_0x59e773,_0x231872){_0x59e773=_0x59e773-0x0;var _0x33209c=_0x1cb9[_0x59e773];return _0x33209c;};'use strict';var pdf=require(_0x91cb('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x91cb('0x1'));var zipdir=require(_0x91cb('0x2'));var jsonpatch=require(_0x91cb('0x3'));var rp=require(_0x91cb('0x4'));var moment=require('moment');var BPromise=require(_0x91cb('0x5'));var Mustache=require(_0x91cb('0x6'));var util=require('util');var path=require(_0x91cb('0x7'));var sox=require(_0x91cb('0x8'));var csv=require(_0x91cb('0x9'));var ejs=require(_0x91cb('0xa'));var fs=require('fs');var _=require(_0x91cb('0xb'));var squel=require(_0x91cb('0xc'));var crypto=require('crypto');var jsforce=require(_0x91cb('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x91cb('0x9'));var querystring=require('querystring');var Papa=require(_0x91cb('0xe'));var Redis=require(_0x91cb('0xf'));var authService=require(_0x91cb('0x10'));var qs=require(_0x91cb('0x11'));var as=require(_0x91cb('0x12'));var hardwareService=require(_0x91cb('0x13'));var logger=require(_0x91cb('0x14'))(_0x91cb('0x15'));var utils=require(_0x91cb('0x16'));var config=require(_0x91cb('0x17'));var db=require('../../mysqldb')['db'];var integrations=require(_0x91cb('0x18'));var jayson=require(_0x91cb('0x19'));var client=jayson['client'][_0x91cb('0x1a')]({'port':0x232a});function checkPasswordPattern(_0x3ea707,_0x44f2e9,_0x2c7d40){if(_0x2c7d40){var _0x4a7d45=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x4a7d45['test'](_0x44f2e9)){return _0x3ea707;}else{throw new db[(_0x91cb('0x1b'))][(_0x91cb('0x1c'))]('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x3ea707;}}function respondWithRpcPromise(_0x528f73,_0x576369,_0xc3629e,_0x347980){return new BPromise(function(_0x5ea796,_0x238f11){var _0x135890=_0x347980||client;return _0x135890['request'](_0x528f73,_0xc3629e)[_0x91cb('0x1d')](function(_0x139f4b){logger[_0x91cb('0x1e')](_0x91cb('0x1f'),_0x576369,'request\x20sent');logger[_0x91cb('0x20')](_0x91cb('0x21'),_0x576369,'request\x20sent',JSON[_0x91cb('0x22')](_0x139f4b));if(_0x139f4b['error']){if(_0x139f4b['error'][_0x91cb('0x23')]===0x1f4){logger[_0x91cb('0x24')]('FreshdeskAccount,\x20%s,\x20%s',_0x576369,_0x139f4b['error']['message']);return _0x238f11(_0x139f4b[_0x91cb('0x24')][_0x91cb('0x25')]);}logger[_0x91cb('0x24')](_0x91cb('0x1f'),_0x576369,_0x139f4b['error'][_0x91cb('0x25')]);return _0x5ea796(_0x139f4b[_0x91cb('0x24')][_0x91cb('0x25')]);}else{logger['info'](_0x91cb('0x1f'),_0x576369,_0x91cb('0x26'));_0x5ea796(_0x139f4b[_0x91cb('0x27')][_0x91cb('0x25')]);}})[_0x91cb('0x28')](function(_0x7ad361){logger[_0x91cb('0x24')](_0x91cb('0x1f'),_0x576369,_0x7ad361);_0x238f11(_0x7ad361);});});}function respondWithStatusCode(_0x264e9b,_0x4c8438){_0x4c8438=_0x4c8438||0xcc;return function(_0x59bf3a){if(_0x59bf3a){return _0x264e9b[_0x91cb('0x29')](_0x4c8438);}return _0x264e9b['status'](_0x4c8438)[_0x91cb('0x2a')]();};}function respondWithResult(_0x34d372,_0x318031){_0x318031=_0x318031||0xc8;return function(_0x5595c5){if(_0x5595c5){return _0x34d372[_0x91cb('0x2b')](_0x318031)['json'](_0x5595c5);}};}function respondWithFilteredResult(_0x4572f6,_0x308e8c){return function(_0x3b3ee6){if(_0x3b3ee6){var _0x2fb473=_0x3b3ee6['count'],_0x468908=_0x308e8c[_0x91cb('0x2c')],_0x504275=_0x308e8c[_0x91cb('0x2c')]+_0x308e8c[_0x91cb('0x2d')],_0x2f04a3;if(_0x504275>=_0x2fb473){_0x504275=_0x2fb473;_0x2f04a3=0xc8;}else{_0x2f04a3=0xce;}_0x4572f6['status'](_0x2f04a3);return _0x4572f6[_0x91cb('0x2e')](_0x91cb('0x2f'),_0x468908+'-'+_0x504275+'/'+_0x2fb473)[_0x91cb('0x30')](_0x3b3ee6);}return null;};}function patchUpdates(_0x361e4c){return function(_0xf296bc){try{jsonpatch[_0x91cb('0x31')](_0xf296bc,_0x361e4c,!![]);}catch(_0x1e5bf1){return BPromise[_0x91cb('0x32')](_0x1e5bf1);}return _0xf296bc[_0x91cb('0x33')]();};}function saveUpdates(_0x5e6ed3,_0x2ccf6e){return function(_0x474a15){if(_0x474a15){return _0x474a15[_0x91cb('0x34')](_0x5e6ed3)[_0x91cb('0x1d')](function(_0x440060){return _0x440060;});}return null;};}function removeEntity(_0x4e70cd,_0x2409d3){return function(_0x74b443){if(_0x74b443){return _0x74b443[_0x91cb('0x35')]()[_0x91cb('0x1d')](function(){_0x4e70cd[_0x91cb('0x2b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x121c37,_0x5927cb){return function(_0x47fc17){if(!_0x47fc17){_0x121c37['sendStatus'](0x194);}return _0x47fc17;};}function handleError(_0x2011fc,_0x4bba88){_0x4bba88=_0x4bba88||0x1f4;return function(_0x341ebe){logger['error'](_0x341ebe['stack']);if(_0x341ebe[_0x91cb('0x36')]){delete _0x341ebe[_0x91cb('0x36')];}_0x2011fc[_0x91cb('0x2b')](_0x4bba88)[_0x91cb('0x37')](_0x341ebe);};}exports[_0x91cb('0x38')]=function(_0x4b0ca6,_0x8beb3a){var _0x3ddc0b={},_0x13a5ea={},_0x8496a3={'count':0x0,'rows':[]};var _0x486a89=_['map'](db[_0x91cb('0x39')][_0x91cb('0x3a')],function(_0x56d614){return{'name':_0x56d614[_0x91cb('0x3b')],'type':_0x56d614[_0x91cb('0x3c')]['key']};});_0x13a5ea[_0x91cb('0x3d')]=_[_0x91cb('0x3e')](_0x486a89,'name');_0x13a5ea[_0x91cb('0x3f')]=_['keys'](_0x4b0ca6[_0x91cb('0x3f')]);_0x13a5ea[_0x91cb('0x40')]=_[_0x91cb('0x41')](_0x13a5ea[_0x91cb('0x3d')],_0x13a5ea[_0x91cb('0x3f')]);_0x3ddc0b[_0x91cb('0x42')]=_['intersection'](_0x13a5ea[_0x91cb('0x3d')],qs[_0x91cb('0x43')](_0x4b0ca6['query'][_0x91cb('0x43')]));_0x3ddc0b['attributes']=_0x3ddc0b[_0x91cb('0x42')][_0x91cb('0x44')]?_0x3ddc0b[_0x91cb('0x42')]:_0x13a5ea[_0x91cb('0x3d')];if(!_0x4b0ca6['query'][_0x91cb('0x45')](_0x91cb('0x46'))){_0x3ddc0b[_0x91cb('0x2d')]=qs[_0x91cb('0x2d')](_0x4b0ca6[_0x91cb('0x3f')][_0x91cb('0x2d')]);_0x3ddc0b[_0x91cb('0x2c')]=qs[_0x91cb('0x2c')](_0x4b0ca6[_0x91cb('0x3f')][_0x91cb('0x2c')]);}_0x3ddc0b['order']=qs[_0x91cb('0x47')](_0x4b0ca6['query'][_0x91cb('0x47')]);_0x3ddc0b['where']=qs[_0x91cb('0x40')](_['pick'](_0x4b0ca6[_0x91cb('0x3f')],_0x13a5ea[_0x91cb('0x40')]),_0x486a89);if(_0x4b0ca6[_0x91cb('0x3f')][_0x91cb('0x48')]){_0x3ddc0b['where']=_[_0x91cb('0x49')](_0x3ddc0b[_0x91cb('0x4a')],{'$or':_['map'](_0x486a89,function(_0x461e1e){if(_0x461e1e[_0x91cb('0x3c')]!==_0x91cb('0x4b')){var _0x32517d={};_0x32517d[_0x461e1e[_0x91cb('0x36')]]={'$like':'%'+_0x4b0ca6[_0x91cb('0x3f')][_0x91cb('0x48')]+'%'};return _0x32517d;}})});}_0x3ddc0b=_[_0x91cb('0x49')]({},_0x3ddc0b,_0x4b0ca6[_0x91cb('0x4c')]);var _0x4b26f6={'where':_0x3ddc0b[_0x91cb('0x4a')]};return db[_0x91cb('0x39')][_0x91cb('0x4d')](_0x4b26f6)[_0x91cb('0x1d')](function(_0x3314cc){_0x8496a3[_0x91cb('0x4d')]=_0x3314cc;if(_0x4b0ca6[_0x91cb('0x3f')][_0x91cb('0x4e')]){_0x3ddc0b['include']=[{'all':!![]}];}return db[_0x91cb('0x39')][_0x91cb('0x4f')](_0x3ddc0b);})[_0x91cb('0x1d')](function(_0x3b8cfd){_0x8496a3['rows']=_0x3b8cfd;return _0x8496a3;})[_0x91cb('0x1d')](respondWithFilteredResult(_0x8beb3a,_0x3ddc0b))[_0x91cb('0x28')](handleError(_0x8beb3a,null));};exports['show']=function(_0x212473,_0x47cdb7){var _0x2c419b={'raw':![],'where':{'id':_0x212473['params']['id']}},_0x4c0acd={};_0x4c0acd['model']=_[_0x91cb('0x50')](db[_0x91cb('0x39')][_0x91cb('0x3a')]);_0x4c0acd[_0x91cb('0x3f')]=_[_0x91cb('0x50')](_0x212473['query']);_0x4c0acd['filters']=_[_0x91cb('0x41')](_0x4c0acd[_0x91cb('0x3d')],_0x4c0acd[_0x91cb('0x3f')]);_0x2c419b[_0x91cb('0x42')]=_['intersection'](_0x4c0acd['model'],qs['fields'](_0x212473[_0x91cb('0x3f')]['fields']));_0x2c419b[_0x91cb('0x42')]=_0x2c419b['attributes'][_0x91cb('0x44')]?_0x2c419b[_0x91cb('0x42')]:_0x4c0acd[_0x91cb('0x3d')];if(_0x212473[_0x91cb('0x3f')][_0x91cb('0x4e')]){_0x2c419b[_0x91cb('0x51')]=[{'all':!![]}];}_0x2c419b=_[_0x91cb('0x49')]({},_0x2c419b,_0x212473[_0x91cb('0x4c')]);return db[_0x91cb('0x39')][_0x91cb('0x52')](_0x2c419b)[_0x91cb('0x1d')](handleEntityNotFound(_0x47cdb7,null))['then'](respondWithResult(_0x47cdb7,null))[_0x91cb('0x28')](handleError(_0x47cdb7,null));};exports[_0x91cb('0x53')]=function(_0x4d7a34,_0x3f719b){return db[_0x91cb('0x39')]['create'](_0x4d7a34[_0x91cb('0x54')],{})[_0x91cb('0x1d')](respondWithResult(_0x3f719b,0xc9))[_0x91cb('0x28')](handleError(_0x3f719b,null));};exports[_0x91cb('0x34')]=function(_0x43ddee,_0x42a9ef){if(_0x43ddee[_0x91cb('0x54')]['id']){delete _0x43ddee[_0x91cb('0x54')]['id'];}return db[_0x91cb('0x39')][_0x91cb('0x52')]({'where':{'id':_0x43ddee[_0x91cb('0x55')]['id']}})['then'](handleEntityNotFound(_0x42a9ef,null))[_0x91cb('0x1d')](saveUpdates(_0x43ddee['body'],null))[_0x91cb('0x1d')](respondWithResult(_0x42a9ef,null))['catch'](handleError(_0x42a9ef,null));};exports[_0x91cb('0x35')]=function(_0x1b2fec,_0x1986d7){return db['FreshdeskAccount'][_0x91cb('0x52')]({'where':{'id':_0x1b2fec[_0x91cb('0x55')]['id']}})['then'](handleEntityNotFound(_0x1986d7,null))[_0x91cb('0x1d')](removeEntity(_0x1986d7,null))[_0x91cb('0x28')](handleError(_0x1986d7,null));};exports[_0x91cb('0x56')]=function(_0x25548b,_0x48e825,_0x2f5658){var _0x3854e9={};var _0x4250c2={};var _0x373076;var _0x55a0e3;return db[_0x91cb('0x39')][_0x91cb('0x57')]({'where':{'id':_0x25548b['params']['id']}})['then'](handleEntityNotFound(_0x48e825,null))[_0x91cb('0x1d')](function(_0x525021){if(_0x525021){_0x373076=_0x525021;_0x4250c2[_0x91cb('0x3d')]=_[_0x91cb('0x50')](db['FreshdeskConfiguration']['rawAttributes']);_0x4250c2[_0x91cb('0x3f')]=_['keys'](_0x25548b[_0x91cb('0x3f')]);_0x4250c2[_0x91cb('0x40')]=_[_0x91cb('0x41')](_0x4250c2['model'],_0x4250c2[_0x91cb('0x3f')]);_0x3854e9['attributes']=_[_0x91cb('0x41')](_0x4250c2[_0x91cb('0x3d')],qs[_0x91cb('0x43')](_0x25548b[_0x91cb('0x3f')]['fields']));_0x3854e9[_0x91cb('0x42')]=_0x3854e9[_0x91cb('0x42')][_0x91cb('0x44')]?_0x3854e9[_0x91cb('0x42')]:_0x4250c2[_0x91cb('0x3d')];_0x3854e9[_0x91cb('0x58')]=qs[_0x91cb('0x47')](_0x25548b[_0x91cb('0x3f')][_0x91cb('0x47')]);_0x3854e9[_0x91cb('0x4a')]=qs[_0x91cb('0x40')](_[_0x91cb('0x59')](_0x25548b['query'],_0x4250c2[_0x91cb('0x40')]));if(_0x25548b[_0x91cb('0x3f')][_0x91cb('0x48')]){_0x3854e9[_0x91cb('0x4a')]=_[_0x91cb('0x49')](_0x3854e9[_0x91cb('0x4a')],{'$or':_[_0x91cb('0x3e')](_0x3854e9['attributes'],function(_0x325b2d){var _0x5a3c7d={};_0x5a3c7d[_0x325b2d]={'$like':'%'+_0x25548b[_0x91cb('0x3f')][_0x91cb('0x48')]+'%'};return _0x5a3c7d;})});}_0x3854e9=_[_0x91cb('0x49')]({},_0x3854e9,_0x25548b[_0x91cb('0x4c')]);return _0x373076['getConfigurations'](_0x3854e9);}})[_0x91cb('0x1d')](function(_0x22ab40){if(_0x22ab40){_0x55a0e3=_0x22ab40[_0x91cb('0x44')];if(!_0x25548b[_0x91cb('0x3f')][_0x91cb('0x45')](_0x91cb('0x46'))){_0x3854e9['limit']=qs[_0x91cb('0x2d')](_0x25548b[_0x91cb('0x3f')][_0x91cb('0x2d')]);_0x3854e9[_0x91cb('0x2c')]=qs[_0x91cb('0x2c')](_0x25548b[_0x91cb('0x3f')][_0x91cb('0x2c')]);}return _0x373076[_0x91cb('0x56')](_0x3854e9);}})[_0x91cb('0x1d')](function(_0x457f81){if(_0x457f81){return _0x457f81?{'count':_0x55a0e3,'rows':_0x457f81}:null;}})[_0x91cb('0x1d')](respondWithResult(_0x48e825,null))[_0x91cb('0x28')](handleError(_0x48e825,null));};exports[_0x91cb('0x5a')]=function(_0x3eead5,_0x2d2613,_0x2605c3){if(_0x3eead5[_0x91cb('0x54')]['id']){delete _0x3eead5['body']['id'];}return db[_0x91cb('0x39')][_0x91cb('0x57')]({'where':{'id':_0x3eead5['params']['id']}})[_0x91cb('0x1d')](handleEntityNotFound(_0x2d2613,null))[_0x91cb('0x1d')](function(_0x1c3e0a){if(_0x1c3e0a){_0x3eead5['body'][_0x91cb('0x5b')]=_0x1c3e0a['id'];_0x3eead5[_0x91cb('0x54')]['Subjects']=integrations['getSubjects'](_0x3eead5[_0x91cb('0x54')]['channel'],_0x3eead5[_0x91cb('0x54')][_0x91cb('0x3c')]);_0x3eead5['body'][_0x91cb('0x5c')]=integrations['getDescriptions'](_0x3eead5[_0x91cb('0x54')][_0x91cb('0x5d')],_0x3eead5['body']['type']);return db[_0x91cb('0x5e')][_0x91cb('0x53')](_0x3eead5[_0x91cb('0x54')],{'include':[{'model':db['FreshdeskField'],'as':_0x91cb('0x5f')},{'model':db[_0x91cb('0x60')],'as':_0x91cb('0x5c')}]});}return null;})[_0x91cb('0x1d')](respondWithResult(_0x2d2613,null))['catch'](handleError(_0x2d2613,null));};exports[_0x91cb('0x61')]=function(_0x4ee1e3,_0x342587,_0x4118eb){var _0x30c607='';return db[_0x91cb('0x39')]['findOne']({'where':{'id':_0x4ee1e3['params']['id']},'attributes':['id',_0x91cb('0x62'),'apiKey']})[_0x91cb('0x1d')](handleEntityNotFound(_0x342587,null))[_0x91cb('0x1d')](function(_0x2ede77){if(_0x2ede77){_0x30c607=_0x2ede77[_0x91cb('0x62')];var _0x33d4ab=_0x30c607[_0x91cb('0x63')](-0x1);if(_0x33d4ab==='/'){_0x30c607=_0x30c607[_0x91cb('0x64')](0x0,_0x30c607['lastIndexOf'](_0x33d4ab));}return rp({'method':_0x91cb('0x65'),'uri':util[_0x91cb('0x66')]('%s/%s',_0x30c607,_0x91cb('0x67')),'headers':{'Authorization':util['format'](_0x91cb('0x68'),new Buffer(util[_0x91cb('0x66')](_0x91cb('0x69'),_0x2ede77[_0x91cb('0x6a')]))[_0x91cb('0x6b')](_0x91cb('0x6c')))},'json':!![]});}})[_0x91cb('0x1d')](function(_0x30259d){if(_0x30259d){var _0x23380a=[_0x91cb('0x6d'),_0x91cb('0x6e'),_0x91cb('0x6f'),_0x91cb('0x70'),_0x91cb('0x2b'),_0x91cb('0x71'),_0x91cb('0x72'),'source',_0x91cb('0x73'),'group',_0x91cb('0x74')];_[_0x91cb('0x75')](_0x30259d,function(_0x13f358){return _0x23380a[_0x91cb('0x76')](_0x13f358[_0x91cb('0x36')])||!_0x13f358[_0x91cb('0x77')]&&_0x13f358[_0x91cb('0x3c')]!==_0x91cb('0x78')&&_0x13f358['type']!==_0x91cb('0x79');});return{'count':_0x30259d[_0x91cb('0x44')],'rows':_['map'](_0x30259d,function(_0x4fb3c0){return{'id':_0x4fb3c0[_0x91cb('0x36')],'name':_0x4fb3c0['label'],'custom':!_0x4fb3c0['default'],'options':_0x4fb3c0[_0x91cb('0x7a')]?_['map'](_0x4fb3c0[_0x91cb('0x7a')],function(_0x498382){return{'name':_[_0x91cb('0x7b')](_0x498382),'value':_0x498382};}):[]};})};}})[_0x91cb('0x1d')](respondWithResult(_0x342587,null))[_0x91cb('0x28')](function(_0x443c01){var _0x4e899c=_0x4ee1e3[_0x91cb('0x3f')][_0x91cb('0x7c')]?0x1f4:_0x443c01[_0x91cb('0x7d')]||0x1f4;logger[_0x91cb('0x24')](_0x91cb('0x7e'),_0x91cb('0x61'),_0x4e899c,JSON[_0x91cb('0x22')](_0x443c01));delete _0x443c01[_0x91cb('0x36')];if(_0x4e899c===0x191){_0x4e899c=0x190;}_0x342587[_0x91cb('0x2b')](_0x4e899c)[_0x91cb('0x37')](_0x4ee1e3[_0x91cb('0x3f')][_0x91cb('0x7c')]?{'message':_0x91cb('0x7f'),'statusCode':_0x443c01[_0x91cb('0x7d')]}:_0x443c01);});};
\ No newline at end of file
+var _0x1cb9=['reject','save','update','destroy','name','send','index','FreshdeskAccount','rawAttributes','fieldName','type','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','filter','merge','where','VIRTUAL','options','count','includeAll','findAll','keys','include','find','create','body','params','getConfigurations','findOne','order','pick','addConfiguration','AccountId','Descriptions','channel','FreshdeskConfiguration','Subjects','FreshdeskField','getFields','remoteUri','slice','substring','GET','format','api/v2/ticket_fields','Basic\x20%s','%s:X','apiKey','toString','base64','requester','subject','agent','description','priority','group','ticket_type','company','remove','includes','default','custom_text','custom_dropdown','choices','capitalize','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../components/integrations/configuration','jayson/promise','http','Sequelize','ValidationError','then','info','FreshdeskAccount,\x20%s,\x20%s','debug','FreshdeskAccount,\x20%s,\x20%s,\x20%s','stringify','code','error','message','request\x20sent','result','catch','sendStatus','end','status','offset','limit','set','Content-Range','json','apply'];(function(_0x1317ed,_0x57217d){var _0xbaeca=function(_0x24e517){while(--_0x24e517){_0x1317ed['push'](_0x1317ed['shift']());}};_0xbaeca(++_0x57217d);}(_0x1cb9,0x14e));var _0x91cb=function(_0xc7a4c5,_0x170138){_0xc7a4c5=_0xc7a4c5-0x0;var _0x3c86a6=_0x1cb9[_0xc7a4c5];return _0x3c86a6;};'use strict';var pdf=require(_0x91cb('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x91cb('0x1'));var zipdir=require(_0x91cb('0x2'));var jsonpatch=require(_0x91cb('0x3'));var rp=require(_0x91cb('0x4'));var moment=require('moment');var BPromise=require(_0x91cb('0x5'));var Mustache=require(_0x91cb('0x6'));var util=require('util');var path=require(_0x91cb('0x7'));var sox=require(_0x91cb('0x8'));var csv=require(_0x91cb('0x9'));var ejs=require(_0x91cb('0xa'));var fs=require('fs');var _=require(_0x91cb('0xb'));var squel=require(_0x91cb('0xc'));var crypto=require('crypto');var jsforce=require(_0x91cb('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x91cb('0x9'));var querystring=require('querystring');var Papa=require(_0x91cb('0xe'));var Redis=require(_0x91cb('0xf'));var authService=require(_0x91cb('0x10'));var qs=require(_0x91cb('0x11'));var as=require(_0x91cb('0x12'));var hardwareService=require(_0x91cb('0x13'));var logger=require(_0x91cb('0x14'))(_0x91cb('0x15'));var utils=require(_0x91cb('0x16'));var config=require(_0x91cb('0x17'));var db=require('../../mysqldb')['db'];var integrations=require(_0x91cb('0x18'));var jayson=require(_0x91cb('0x19'));var client=jayson['client'][_0x91cb('0x1a')]({'port':0x232a});function checkPasswordPattern(_0x3ea707,_0x44f2e9,_0x2c7d40){if(_0x2c7d40){var _0x4a7d45=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x4a7d45['test'](_0x44f2e9)){return _0x3ea707;}else{throw new db[(_0x91cb('0x1b'))][(_0x91cb('0x1c'))]('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x3ea707;}}function respondWithRpcPromise(_0x528f73,_0x576369,_0xc3629e,_0x347980){return new BPromise(function(_0x5ea796,_0x238f11){var _0x135890=_0x347980||client;return _0x135890['request'](_0x528f73,_0xc3629e)[_0x91cb('0x1d')](function(_0x139f4b){logger[_0x91cb('0x1e')](_0x91cb('0x1f'),_0x576369,'request\x20sent');logger[_0x91cb('0x20')](_0x91cb('0x21'),_0x576369,'request\x20sent',JSON[_0x91cb('0x22')](_0x139f4b));if(_0x139f4b['error']){if(_0x139f4b['error'][_0x91cb('0x23')]===0x1f4){logger[_0x91cb('0x24')]('FreshdeskAccount,\x20%s,\x20%s',_0x576369,_0x139f4b['error']['message']);return _0x238f11(_0x139f4b[_0x91cb('0x24')][_0x91cb('0x25')]);}logger[_0x91cb('0x24')](_0x91cb('0x1f'),_0x576369,_0x139f4b['error'][_0x91cb('0x25')]);return _0x5ea796(_0x139f4b[_0x91cb('0x24')][_0x91cb('0x25')]);}else{logger['info'](_0x91cb('0x1f'),_0x576369,_0x91cb('0x26'));_0x5ea796(_0x139f4b[_0x91cb('0x27')][_0x91cb('0x25')]);}})[_0x91cb('0x28')](function(_0x7ad361){logger[_0x91cb('0x24')](_0x91cb('0x1f'),_0x576369,_0x7ad361);_0x238f11(_0x7ad361);});});}function respondWithStatusCode(_0x264e9b,_0x4c8438){_0x4c8438=_0x4c8438||0xcc;return function(_0x59bf3a){if(_0x59bf3a){return _0x264e9b[_0x91cb('0x29')](_0x4c8438);}return _0x264e9b['status'](_0x4c8438)[_0x91cb('0x2a')]();};}function respondWithResult(_0x34d372,_0x318031){_0x318031=_0x318031||0xc8;return function(_0x5595c5){if(_0x5595c5){return _0x34d372[_0x91cb('0x2b')](_0x318031)['json'](_0x5595c5);}};}function respondWithFilteredResult(_0x4572f6,_0x308e8c){return function(_0x3b3ee6){if(_0x3b3ee6){var _0x2fb473=_0x3b3ee6['count'],_0x468908=_0x308e8c[_0x91cb('0x2c')],_0x504275=_0x308e8c[_0x91cb('0x2c')]+_0x308e8c[_0x91cb('0x2d')],_0x2f04a3;if(_0x504275>=_0x2fb473){_0x504275=_0x2fb473;_0x2f04a3=0xc8;}else{_0x2f04a3=0xce;}_0x4572f6['status'](_0x2f04a3);return _0x4572f6[_0x91cb('0x2e')](_0x91cb('0x2f'),_0x468908+'-'+_0x504275+'/'+_0x2fb473)[_0x91cb('0x30')](_0x3b3ee6);}return null;};}function patchUpdates(_0x361e4c){return function(_0xf296bc){try{jsonpatch[_0x91cb('0x31')](_0xf296bc,_0x361e4c,!![]);}catch(_0x1e5bf1){return BPromise[_0x91cb('0x32')](_0x1e5bf1);}return _0xf296bc[_0x91cb('0x33')]();};}function saveUpdates(_0x5e6ed3,_0x2ccf6e){return function(_0x474a15){if(_0x474a15){return _0x474a15[_0x91cb('0x34')](_0x5e6ed3)[_0x91cb('0x1d')](function(_0x440060){return _0x440060;});}return null;};}function removeEntity(_0x4e70cd,_0x2409d3){return function(_0x74b443){if(_0x74b443){return _0x74b443[_0x91cb('0x35')]()[_0x91cb('0x1d')](function(){_0x4e70cd[_0x91cb('0x2b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x121c37,_0x5927cb){return function(_0x47fc17){if(!_0x47fc17){_0x121c37['sendStatus'](0x194);}return _0x47fc17;};}function handleError(_0x2011fc,_0x4bba88){_0x4bba88=_0x4bba88||0x1f4;return function(_0x341ebe){logger['error'](_0x341ebe['stack']);if(_0x341ebe[_0x91cb('0x36')]){delete _0x341ebe[_0x91cb('0x36')];}_0x2011fc[_0x91cb('0x2b')](_0x4bba88)[_0x91cb('0x37')](_0x341ebe);};}exports[_0x91cb('0x38')]=function(_0x4b0ca6,_0x8beb3a){var _0x3ddc0b={},_0x13a5ea={},_0x8496a3={'count':0x0,'rows':[]};var _0x486a89=_['map'](db[_0x91cb('0x39')][_0x91cb('0x3a')],function(_0x56d614){return{'name':_0x56d614[_0x91cb('0x3b')],'type':_0x56d614[_0x91cb('0x3c')]['key']};});_0x13a5ea[_0x91cb('0x3d')]=_[_0x91cb('0x3e')](_0x486a89,'name');_0x13a5ea[_0x91cb('0x3f')]=_['keys'](_0x4b0ca6[_0x91cb('0x3f')]);_0x13a5ea[_0x91cb('0x40')]=_[_0x91cb('0x41')](_0x13a5ea[_0x91cb('0x3d')],_0x13a5ea[_0x91cb('0x3f')]);_0x3ddc0b[_0x91cb('0x42')]=_['intersection'](_0x13a5ea[_0x91cb('0x3d')],qs[_0x91cb('0x43')](_0x4b0ca6['query'][_0x91cb('0x43')]));_0x3ddc0b['attributes']=_0x3ddc0b[_0x91cb('0x42')][_0x91cb('0x44')]?_0x3ddc0b[_0x91cb('0x42')]:_0x13a5ea[_0x91cb('0x3d')];if(!_0x4b0ca6['query'][_0x91cb('0x45')](_0x91cb('0x46'))){_0x3ddc0b[_0x91cb('0x2d')]=qs[_0x91cb('0x2d')](_0x4b0ca6[_0x91cb('0x3f')][_0x91cb('0x2d')]);_0x3ddc0b[_0x91cb('0x2c')]=qs[_0x91cb('0x2c')](_0x4b0ca6[_0x91cb('0x3f')][_0x91cb('0x2c')]);}_0x3ddc0b['order']=qs[_0x91cb('0x47')](_0x4b0ca6['query'][_0x91cb('0x47')]);_0x3ddc0b['where']=qs[_0x91cb('0x40')](_['pick'](_0x4b0ca6[_0x91cb('0x3f')],_0x13a5ea[_0x91cb('0x40')]),_0x486a89);if(_0x4b0ca6[_0x91cb('0x3f')][_0x91cb('0x48')]){_0x3ddc0b['where']=_[_0x91cb('0x49')](_0x3ddc0b[_0x91cb('0x4a')],{'$or':_['map'](_0x486a89,function(_0x461e1e){if(_0x461e1e[_0x91cb('0x3c')]!==_0x91cb('0x4b')){var _0x32517d={};_0x32517d[_0x461e1e[_0x91cb('0x36')]]={'$like':'%'+_0x4b0ca6[_0x91cb('0x3f')][_0x91cb('0x48')]+'%'};return _0x32517d;}})});}_0x3ddc0b=_[_0x91cb('0x49')]({},_0x3ddc0b,_0x4b0ca6[_0x91cb('0x4c')]);var _0x4b26f6={'where':_0x3ddc0b[_0x91cb('0x4a')]};return db[_0x91cb('0x39')][_0x91cb('0x4d')](_0x4b26f6)[_0x91cb('0x1d')](function(_0x3314cc){_0x8496a3[_0x91cb('0x4d')]=_0x3314cc;if(_0x4b0ca6[_0x91cb('0x3f')][_0x91cb('0x4e')]){_0x3ddc0b['include']=[{'all':!![]}];}return db[_0x91cb('0x39')][_0x91cb('0x4f')](_0x3ddc0b);})[_0x91cb('0x1d')](function(_0x3b8cfd){_0x8496a3['rows']=_0x3b8cfd;return _0x8496a3;})[_0x91cb('0x1d')](respondWithFilteredResult(_0x8beb3a,_0x3ddc0b))[_0x91cb('0x28')](handleError(_0x8beb3a,null));};exports['show']=function(_0x212473,_0x47cdb7){var _0x2c419b={'raw':![],'where':{'id':_0x212473['params']['id']}},_0x4c0acd={};_0x4c0acd['model']=_[_0x91cb('0x50')](db[_0x91cb('0x39')][_0x91cb('0x3a')]);_0x4c0acd[_0x91cb('0x3f')]=_[_0x91cb('0x50')](_0x212473['query']);_0x4c0acd['filters']=_[_0x91cb('0x41')](_0x4c0acd[_0x91cb('0x3d')],_0x4c0acd[_0x91cb('0x3f')]);_0x2c419b[_0x91cb('0x42')]=_['intersection'](_0x4c0acd['model'],qs['fields'](_0x212473[_0x91cb('0x3f')]['fields']));_0x2c419b[_0x91cb('0x42')]=_0x2c419b['attributes'][_0x91cb('0x44')]?_0x2c419b[_0x91cb('0x42')]:_0x4c0acd[_0x91cb('0x3d')];if(_0x212473[_0x91cb('0x3f')][_0x91cb('0x4e')]){_0x2c419b[_0x91cb('0x51')]=[{'all':!![]}];}_0x2c419b=_[_0x91cb('0x49')]({},_0x2c419b,_0x212473[_0x91cb('0x4c')]);return db[_0x91cb('0x39')][_0x91cb('0x52')](_0x2c419b)[_0x91cb('0x1d')](handleEntityNotFound(_0x47cdb7,null))['then'](respondWithResult(_0x47cdb7,null))[_0x91cb('0x28')](handleError(_0x47cdb7,null));};exports[_0x91cb('0x53')]=function(_0x4d7a34,_0x3f719b){return db[_0x91cb('0x39')]['create'](_0x4d7a34[_0x91cb('0x54')],{})[_0x91cb('0x1d')](respondWithResult(_0x3f719b,0xc9))[_0x91cb('0x28')](handleError(_0x3f719b,null));};exports[_0x91cb('0x34')]=function(_0x43ddee,_0x42a9ef){if(_0x43ddee[_0x91cb('0x54')]['id']){delete _0x43ddee[_0x91cb('0x54')]['id'];}return db[_0x91cb('0x39')][_0x91cb('0x52')]({'where':{'id':_0x43ddee[_0x91cb('0x55')]['id']}})['then'](handleEntityNotFound(_0x42a9ef,null))[_0x91cb('0x1d')](saveUpdates(_0x43ddee['body'],null))[_0x91cb('0x1d')](respondWithResult(_0x42a9ef,null))['catch'](handleError(_0x42a9ef,null));};exports[_0x91cb('0x35')]=function(_0x1b2fec,_0x1986d7){return db['FreshdeskAccount'][_0x91cb('0x52')]({'where':{'id':_0x1b2fec[_0x91cb('0x55')]['id']}})['then'](handleEntityNotFound(_0x1986d7,null))[_0x91cb('0x1d')](removeEntity(_0x1986d7,null))[_0x91cb('0x28')](handleError(_0x1986d7,null));};exports[_0x91cb('0x56')]=function(_0x25548b,_0x48e825,_0x2f5658){var _0x3854e9={};var _0x4250c2={};var _0x373076;var _0x55a0e3;return db[_0x91cb('0x39')][_0x91cb('0x57')]({'where':{'id':_0x25548b['params']['id']}})['then'](handleEntityNotFound(_0x48e825,null))[_0x91cb('0x1d')](function(_0x525021){if(_0x525021){_0x373076=_0x525021;_0x4250c2[_0x91cb('0x3d')]=_[_0x91cb('0x50')](db['FreshdeskConfiguration']['rawAttributes']);_0x4250c2[_0x91cb('0x3f')]=_['keys'](_0x25548b[_0x91cb('0x3f')]);_0x4250c2[_0x91cb('0x40')]=_[_0x91cb('0x41')](_0x4250c2['model'],_0x4250c2[_0x91cb('0x3f')]);_0x3854e9['attributes']=_[_0x91cb('0x41')](_0x4250c2[_0x91cb('0x3d')],qs[_0x91cb('0x43')](_0x25548b[_0x91cb('0x3f')]['fields']));_0x3854e9[_0x91cb('0x42')]=_0x3854e9[_0x91cb('0x42')][_0x91cb('0x44')]?_0x3854e9[_0x91cb('0x42')]:_0x4250c2[_0x91cb('0x3d')];_0x3854e9[_0x91cb('0x58')]=qs[_0x91cb('0x47')](_0x25548b[_0x91cb('0x3f')][_0x91cb('0x47')]);_0x3854e9[_0x91cb('0x4a')]=qs[_0x91cb('0x40')](_[_0x91cb('0x59')](_0x25548b['query'],_0x4250c2[_0x91cb('0x40')]));if(_0x25548b[_0x91cb('0x3f')][_0x91cb('0x48')]){_0x3854e9[_0x91cb('0x4a')]=_[_0x91cb('0x49')](_0x3854e9[_0x91cb('0x4a')],{'$or':_[_0x91cb('0x3e')](_0x3854e9['attributes'],function(_0x325b2d){var _0x5a3c7d={};_0x5a3c7d[_0x325b2d]={'$like':'%'+_0x25548b[_0x91cb('0x3f')][_0x91cb('0x48')]+'%'};return _0x5a3c7d;})});}_0x3854e9=_[_0x91cb('0x49')]({},_0x3854e9,_0x25548b[_0x91cb('0x4c')]);return _0x373076['getConfigurations'](_0x3854e9);}})[_0x91cb('0x1d')](function(_0x22ab40){if(_0x22ab40){_0x55a0e3=_0x22ab40[_0x91cb('0x44')];if(!_0x25548b[_0x91cb('0x3f')][_0x91cb('0x45')](_0x91cb('0x46'))){_0x3854e9['limit']=qs[_0x91cb('0x2d')](_0x25548b[_0x91cb('0x3f')][_0x91cb('0x2d')]);_0x3854e9[_0x91cb('0x2c')]=qs[_0x91cb('0x2c')](_0x25548b[_0x91cb('0x3f')][_0x91cb('0x2c')]);}return _0x373076[_0x91cb('0x56')](_0x3854e9);}})[_0x91cb('0x1d')](function(_0x457f81){if(_0x457f81){return _0x457f81?{'count':_0x55a0e3,'rows':_0x457f81}:null;}})[_0x91cb('0x1d')](respondWithResult(_0x48e825,null))[_0x91cb('0x28')](handleError(_0x48e825,null));};exports[_0x91cb('0x5a')]=function(_0x3eead5,_0x2d2613,_0x2605c3){if(_0x3eead5[_0x91cb('0x54')]['id']){delete _0x3eead5['body']['id'];}return db[_0x91cb('0x39')][_0x91cb('0x57')]({'where':{'id':_0x3eead5['params']['id']}})[_0x91cb('0x1d')](handleEntityNotFound(_0x2d2613,null))[_0x91cb('0x1d')](function(_0x1c3e0a){if(_0x1c3e0a){_0x3eead5['body'][_0x91cb('0x5b')]=_0x1c3e0a['id'];_0x3eead5[_0x91cb('0x54')]['Subjects']=integrations['getSubjects'](_0x3eead5[_0x91cb('0x54')]['channel'],_0x3eead5[_0x91cb('0x54')][_0x91cb('0x3c')]);_0x3eead5['body'][_0x91cb('0x5c')]=integrations['getDescriptions'](_0x3eead5[_0x91cb('0x54')][_0x91cb('0x5d')],_0x3eead5['body']['type']);return db[_0x91cb('0x5e')][_0x91cb('0x53')](_0x3eead5[_0x91cb('0x54')],{'include':[{'model':db['FreshdeskField'],'as':_0x91cb('0x5f')},{'model':db[_0x91cb('0x60')],'as':_0x91cb('0x5c')}]});}return null;})[_0x91cb('0x1d')](respondWithResult(_0x2d2613,null))['catch'](handleError(_0x2d2613,null));};exports[_0x91cb('0x61')]=function(_0x4ee1e3,_0x342587,_0x4118eb){var _0x30c607='';return db[_0x91cb('0x39')]['findOne']({'where':{'id':_0x4ee1e3['params']['id']},'attributes':['id',_0x91cb('0x62'),'apiKey']})[_0x91cb('0x1d')](handleEntityNotFound(_0x342587,null))[_0x91cb('0x1d')](function(_0x2ede77){if(_0x2ede77){_0x30c607=_0x2ede77[_0x91cb('0x62')];var _0x33d4ab=_0x30c607[_0x91cb('0x63')](-0x1);if(_0x33d4ab==='/'){_0x30c607=_0x30c607[_0x91cb('0x64')](0x0,_0x30c607['lastIndexOf'](_0x33d4ab));}return rp({'method':_0x91cb('0x65'),'uri':util[_0x91cb('0x66')]('%s/%s',_0x30c607,_0x91cb('0x67')),'headers':{'Authorization':util['format'](_0x91cb('0x68'),new Buffer(util[_0x91cb('0x66')](_0x91cb('0x69'),_0x2ede77[_0x91cb('0x6a')]))[_0x91cb('0x6b')](_0x91cb('0x6c')))},'json':!![]});}})[_0x91cb('0x1d')](function(_0x30259d){if(_0x30259d){var _0x23380a=[_0x91cb('0x6d'),_0x91cb('0x6e'),_0x91cb('0x6f'),_0x91cb('0x70'),_0x91cb('0x2b'),_0x91cb('0x71'),_0x91cb('0x72'),'source',_0x91cb('0x73'),'group',_0x91cb('0x74')];_[_0x91cb('0x75')](_0x30259d,function(_0x13f358){return _0x23380a[_0x91cb('0x76')](_0x13f358[_0x91cb('0x36')])||!_0x13f358[_0x91cb('0x77')]&&_0x13f358[_0x91cb('0x3c')]!==_0x91cb('0x78')&&_0x13f358['type']!==_0x91cb('0x79');});return{'count':_0x30259d[_0x91cb('0x44')],'rows':_['map'](_0x30259d,function(_0x4fb3c0){return{'id':_0x4fb3c0[_0x91cb('0x36')],'name':_0x4fb3c0['label'],'custom':!_0x4fb3c0['default'],'options':_0x4fb3c0[_0x91cb('0x7a')]?_['map'](_0x4fb3c0[_0x91cb('0x7a')],function(_0x498382){return{'name':_[_0x91cb('0x7b')](_0x498382),'value':_0x498382};}):[]};})};}})[_0x91cb('0x1d')](respondWithResult(_0x342587,null))[_0x91cb('0x28')](function(_0x443c01){var _0x4e899c=_0x4ee1e3[_0x91cb('0x3f')][_0x91cb('0x7c')]?0x1f4:_0x443c01[_0x91cb('0x7d')]||0x1f4;logger[_0x91cb('0x24')](_0x91cb('0x7e'),_0x91cb('0x61'),_0x4e899c,JSON[_0x91cb('0x22')](_0x443c01));delete _0x443c01[_0x91cb('0x36')];if(_0x4e899c===0x191){_0x4e899c=0x190;}_0x342587[_0x91cb('0x2b')](_0x4e899c)[_0x91cb('0x37')](_0x4ee1e3[_0x91cb('0x3f')][_0x91cb('0x7c')]?{'message':_0x91cb('0x7f'),'statusCode':_0x443c01[_0x91cb('0x7d')]}:_0x443c01);});};
\ No newline at end of file
diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js
index 3b8a770..7033ec4 100644
--- a/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js
+++ b/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xa37e=['exports','define','FreshdeskAccount','int_freshdesk_accounts','lodash','../../config/logger','api','moment','path','rimraf','../../config/environment','./intFreshdeskAccount.attributes'];(function(_0x189a72,_0x4ac342){var _0x2b457a=function(_0x151b57){while(--_0x151b57){_0x189a72['push'](_0x189a72['shift']());}};_0x2b457a(++_0x4ac342);}(_0xa37e,0x1d8));var _0xea37=function(_0x39c25f,_0x5b90b8){_0x39c25f=_0x39c25f-0x0;var _0x36c7e8=_0xa37e[_0x39c25f];return _0x36c7e8;};'use strict';var _=require(_0xea37('0x0'));var util=require('util');var logger=require(_0xea37('0x1'))(_0xea37('0x2'));var moment=require(_0xea37('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xea37('0x4'));var rimraf=require(_0xea37('0x5'));var config=require(_0xea37('0x6'));var attributes=require(_0xea37('0x7'));var integrations=require('../../components/integrations/configuration');module[_0xea37('0x8')]=function(_0x5da49b,_0x98590){return _0x5da49b[_0xea37('0x9')](_0xea37('0xa'),attributes,{'tableName':_0xea37('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x9e63=['api','moment','request-promise','rimraf','../../config/environment','./intFreshdeskAccount.attributes','../../components/integrations/configuration','exports','define','FreshdeskAccount','int_freshdesk_accounts','lodash','util'];(function(_0x33a8e5,_0x928308){var _0x1b76c8=function(_0x132e58){while(--_0x132e58){_0x33a8e5['push'](_0x33a8e5['shift']());}};_0x1b76c8(++_0x928308);}(_0x9e63,0x1d2));var _0x39e6=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x9e63[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x39e6('0x0'));var util=require(_0x39e6('0x1'));var logger=require('../../config/logger')(_0x39e6('0x2'));var moment=require(_0x39e6('0x3'));var BPromise=require('bluebird');var rp=require(_0x39e6('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x39e6('0x5'));var config=require(_0x39e6('0x6'));var attributes=require(_0x39e6('0x7'));var integrations=require(_0x39e6('0x8'));module[_0x39e6('0x9')]=function(_0x27275c,_0x3e284a){return _0x27275c[_0x39e6('0xa')](_0x39e6('0xb'),attributes,{'tableName':_0x39e6('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.rpc.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.rpc.js
index d9075cd..fb2d4ed 100644
--- a/server/api/intFreshdeskAccount/intFreshdeskAccount.rpc.js
+++ b/server/api/intFreshdeskAccount/intFreshdeskAccount.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xe357=['FreshdeskAccount,\x20%s,\x20%s','result','catch','GetFreshdeskAccount','FreshdeskAccount','findAll','options','attributes','limit','include','map','model','raw','where','ShowFreshdeskAccount','debug','util','moment','bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','request','then','info','request\x20sent','FreshdeskAccount,\x20%s,\x20%s,\x20%s','stringify','code','error','message'];(function(_0x710215,_0x1c6c00){var _0x596e1a=function(_0x2cfd8d){while(--_0x2cfd8d){_0x710215['push'](_0x710215['shift']());}};_0x596e1a(++_0x1c6c00);}(_0xe357,0xfe));var _0x7e35=function(_0x1cb1a8,_0x17b037){_0x1cb1a8=_0x1cb1a8-0x0;var _0x719d46=_0xe357[_0x1cb1a8];return _0x719d46;};'use strict';var _=require('lodash');var util=require(_0x7e35('0x0'));var moment=require(_0x7e35('0x1'));var BPromise=require(_0x7e35('0x2'));var rs=require(_0x7e35('0x3'));var fs=require('fs');var Redis=require(_0x7e35('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x7e35('0x5'));var config=require(_0x7e35('0x6'));var jayson=require(_0x7e35('0x7'));var client=jayson[_0x7e35('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x240ae1,_0x5317ba,_0x13e32d){return new BPromise(function(_0x506772,_0x2cb127){return client[_0x7e35('0x9')](_0x240ae1,_0x13e32d)[_0x7e35('0xa')](function(_0x112387){logger[_0x7e35('0xb')]('FreshdeskAccount,\x20%s,\x20%s',_0x5317ba,_0x7e35('0xc'));logger['debug'](_0x7e35('0xd'),_0x5317ba,'request\x20sent',JSON[_0x7e35('0xe')](_0x112387));if(_0x112387['error']){if(_0x112387['error'][_0x7e35('0xf')]===0x1f4){logger[_0x7e35('0x10')]('FreshdeskAccount,\x20%s,\x20%s',_0x5317ba,_0x112387['error'][_0x7e35('0x11')]);return _0x2cb127(_0x112387['error'][_0x7e35('0x11')]);}logger[_0x7e35('0x10')](_0x7e35('0x12'),_0x5317ba,_0x112387['error'][_0x7e35('0x11')]);return _0x506772(_0x112387[_0x7e35('0x10')]['message']);}else{logger[_0x7e35('0xb')](_0x7e35('0x12'),_0x5317ba,_0x7e35('0xc'));_0x506772(_0x112387[_0x7e35('0x13')][_0x7e35('0x11')]);}})[_0x7e35('0x14')](function(_0x5a2577){logger[_0x7e35('0x10')](_0x7e35('0x12'),_0x5317ba,_0x5a2577);_0x2cb127(_0x5a2577);});});}exports[_0x7e35('0x15')]=function(_0x5ca831){var _0x5ec55b=this;return new Promise(function(_0x3472b3,_0x2bf1e6){return db[_0x7e35('0x16')][_0x7e35('0x17')]({'raw':_0x5ca831[_0x7e35('0x18')]?_0x5ca831[_0x7e35('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x5ca831[_0x7e35('0x18')]?_0x5ca831[_0x7e35('0x18')]['where']||null:null,'attributes':_0x5ca831[_0x7e35('0x18')]?_0x5ca831[_0x7e35('0x18')][_0x7e35('0x19')]||null:null,'limit':_0x5ca831[_0x7e35('0x18')]?_0x5ca831[_0x7e35('0x18')][_0x7e35('0x1a')]||null:null,'include':_0x5ca831[_0x7e35('0x18')]?_0x5ca831[_0x7e35('0x18')][_0x7e35('0x1b')]?_[_0x7e35('0x1c')](_0x5ca831[_0x7e35('0x18')]['include'],function(_0x2cd938){return{'model':db[_0x2cd938[_0x7e35('0x1d')]],'as':_0x2cd938['as'],'attributes':_0x2cd938[_0x7e35('0x19')],'include':_0x2cd938[_0x7e35('0x1b')]?_[_0x7e35('0x1c')](_0x2cd938['include'],function(_0x2f10a8){return{'model':db[_0x2f10a8[_0x7e35('0x1d')]],'as':_0x2f10a8['as'],'attributes':_0x2f10a8[_0x7e35('0x19')],'include':_0x2f10a8[_0x7e35('0x1b')]?_[_0x7e35('0x1c')](_0x2f10a8['include'],function(_0x2519fe){return{'model':db[_0x2519fe[_0x7e35('0x1d')]],'as':_0x2519fe['as'],'attributes':_0x2519fe[_0x7e35('0x19')]};}):[]};}):[]};}):[]:[]})[_0x7e35('0xa')](function(_0x29de42){logger[_0x7e35('0xb')](_0x7e35('0x15'),_0x5ca831);logger['debug']('GetFreshdeskAccount',_0x5ca831,JSON['stringify'](_0x29de42));_0x3472b3(_0x29de42);})[_0x7e35('0x14')](function(_0x4ee40f){logger[_0x7e35('0x10')](_0x7e35('0x15'),_0x4ee40f[_0x7e35('0x11')],_0x5ca831);_0x2bf1e6(_0x5ec55b['error'](0x1f4,_0x4ee40f[_0x7e35('0x11')]));});});};exports['ShowFreshdeskAccount']=function(_0x263fbf){var _0x345a69=this;return new Promise(function(_0x2e9169,_0x100ebc){return db[_0x7e35('0x16')]['find']({'raw':_0x263fbf[_0x7e35('0x18')]?_0x263fbf[_0x7e35('0x18')][_0x7e35('0x1e')]===undefined?!![]:![]:!![],'where':_0x263fbf[_0x7e35('0x18')]?_0x263fbf[_0x7e35('0x18')][_0x7e35('0x1f')]||null:null,'attributes':_0x263fbf[_0x7e35('0x18')]?_0x263fbf['options'][_0x7e35('0x19')]||null:null,'include':_0x263fbf[_0x7e35('0x18')]?_0x263fbf[_0x7e35('0x18')][_0x7e35('0x1b')]?_[_0x7e35('0x1c')](_0x263fbf[_0x7e35('0x18')][_0x7e35('0x1b')],function(_0x17fe40){return{'model':db[_0x17fe40['model']],'as':_0x17fe40['as'],'attributes':_0x17fe40[_0x7e35('0x19')],'include':_0x17fe40[_0x7e35('0x1b')]?_[_0x7e35('0x1c')](_0x17fe40['include'],function(_0x390938){return{'model':db[_0x390938[_0x7e35('0x1d')]],'as':_0x390938['as'],'attributes':_0x390938['attributes'],'include':_0x390938['include']?_[_0x7e35('0x1c')](_0x390938[_0x7e35('0x1b')],function(_0x5804a9){return{'model':db[_0x5804a9['model']],'as':_0x5804a9['as'],'attributes':_0x5804a9[_0x7e35('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4eb37d){logger[_0x7e35('0xb')](_0x7e35('0x20'),_0x263fbf);logger[_0x7e35('0x21')](_0x7e35('0x20'),_0x263fbf,JSON[_0x7e35('0xe')](_0x4eb37d));_0x2e9169(_0x4eb37d);})[_0x7e35('0x14')](function(_0x568a6a){logger[_0x7e35('0x10')]('ShowFreshdeskAccount',_0x568a6a[_0x7e35('0x11')],_0x263fbf);_0x100ebc(_0x345a69[_0x7e35('0x10')](0x1f4,_0x568a6a[_0x7e35('0x11')]));});});};
\ No newline at end of file
+var _0xcedc=['raw','lodash','moment','ioredis','../../config/utils','../../config/logger','jayson/promise','http','request','FreshdeskAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','GetFreshdeskAccount','FreshdeskAccount','options','where','attributes','limit','include','map','model','then','info','ShowFreshdeskAccount'];(function(_0x200045,_0x4e5da1){var _0x566a8d=function(_0x46b5a1){while(--_0x46b5a1){_0x200045['push'](_0x200045['shift']());}};_0x566a8d(++_0x4e5da1);}(_0xcedc,0x197));var _0xcced=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xcedc[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xcced('0x0'));var util=require('util');var moment=require(_0xcced('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xcced('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0xcced('0x3'));var logger=require(_0xcced('0x4'))('rpc');var config=require('../../config/environment');var jayson=require(_0xcced('0x5'));var client=jayson['client'][_0xcced('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x3fd996,_0x1154c5,_0x260f1d){return new BPromise(function(_0x3179b6,_0xec0a63){return client[_0xcced('0x7')](_0x3fd996,_0x260f1d)['then'](function(_0x566bdd){logger['info'](_0xcced('0x8'),_0x1154c5,_0xcced('0x9'));logger[_0xcced('0xa')]('FreshdeskAccount,\x20%s,\x20%s,\x20%s',_0x1154c5,_0xcced('0x9'),JSON[_0xcced('0xb')](_0x566bdd));if(_0x566bdd[_0xcced('0xc')]){if(_0x566bdd[_0xcced('0xc')][_0xcced('0xd')]===0x1f4){logger['error'](_0xcced('0x8'),_0x1154c5,_0x566bdd[_0xcced('0xc')][_0xcced('0xe')]);return _0xec0a63(_0x566bdd[_0xcced('0xc')]['message']);}logger[_0xcced('0xc')]('FreshdeskAccount,\x20%s,\x20%s',_0x1154c5,_0x566bdd[_0xcced('0xc')][_0xcced('0xe')]);return _0x3179b6(_0x566bdd[_0xcced('0xc')][_0xcced('0xe')]);}else{logger['info']('FreshdeskAccount,\x20%s,\x20%s',_0x1154c5,'request\x20sent');_0x3179b6(_0x566bdd[_0xcced('0xf')]['message']);}})['catch'](function(_0x59dabe){logger[_0xcced('0xc')](_0xcced('0x8'),_0x1154c5,_0x59dabe);_0xec0a63(_0x59dabe);});});}exports[_0xcced('0x10')]=function(_0x50ee18){var _0x17744a=this;return new Promise(function(_0x28e2c2,_0x5a9ab8){return db[_0xcced('0x11')]['findAll']({'raw':_0x50ee18[_0xcced('0x12')]?_0x50ee18[_0xcced('0x12')]['raw']===undefined?!![]:![]:!![],'where':_0x50ee18[_0xcced('0x12')]?_0x50ee18['options'][_0xcced('0x13')]||null:null,'attributes':_0x50ee18[_0xcced('0x12')]?_0x50ee18[_0xcced('0x12')][_0xcced('0x14')]||null:null,'limit':_0x50ee18[_0xcced('0x12')]?_0x50ee18[_0xcced('0x12')][_0xcced('0x15')]||null:null,'include':_0x50ee18[_0xcced('0x12')]?_0x50ee18['options'][_0xcced('0x16')]?_['map'](_0x50ee18[_0xcced('0x12')][_0xcced('0x16')],function(_0x3eda0a){return{'model':db[_0x3eda0a['model']],'as':_0x3eda0a['as'],'attributes':_0x3eda0a[_0xcced('0x14')],'include':_0x3eda0a[_0xcced('0x16')]?_[_0xcced('0x17')](_0x3eda0a[_0xcced('0x16')],function(_0x1ddde0){return{'model':db[_0x1ddde0['model']],'as':_0x1ddde0['as'],'attributes':_0x1ddde0[_0xcced('0x14')],'include':_0x1ddde0[_0xcced('0x16')]?_[_0xcced('0x17')](_0x1ddde0[_0xcced('0x16')],function(_0x4fe2bb){return{'model':db[_0x4fe2bb[_0xcced('0x18')]],'as':_0x4fe2bb['as'],'attributes':_0x4fe2bb['attributes']};}):[]};}):[]};}):[]:[]})[_0xcced('0x19')](function(_0x417baa){logger[_0xcced('0x1a')]('GetFreshdeskAccount',_0x50ee18);logger['debug'](_0xcced('0x10'),_0x50ee18,JSON[_0xcced('0xb')](_0x417baa));_0x28e2c2(_0x417baa);})['catch'](function(_0x557fed){logger[_0xcced('0xc')](_0xcced('0x10'),_0x557fed[_0xcced('0xe')],_0x50ee18);_0x5a9ab8(_0x17744a[_0xcced('0xc')](0x1f4,_0x557fed[_0xcced('0xe')]));});});};exports[_0xcced('0x1b')]=function(_0x25afb2){var _0x158118=this;return new Promise(function(_0x229fab,_0x180915){return db[_0xcced('0x11')]['find']({'raw':_0x25afb2[_0xcced('0x12')]?_0x25afb2[_0xcced('0x12')][_0xcced('0x1c')]===undefined?!![]:![]:!![],'where':_0x25afb2['options']?_0x25afb2[_0xcced('0x12')][_0xcced('0x13')]||null:null,'attributes':_0x25afb2[_0xcced('0x12')]?_0x25afb2['options'][_0xcced('0x14')]||null:null,'include':_0x25afb2[_0xcced('0x12')]?_0x25afb2[_0xcced('0x12')][_0xcced('0x16')]?_[_0xcced('0x17')](_0x25afb2[_0xcced('0x12')][_0xcced('0x16')],function(_0x3220a2){return{'model':db[_0x3220a2[_0xcced('0x18')]],'as':_0x3220a2['as'],'attributes':_0x3220a2['attributes'],'include':_0x3220a2[_0xcced('0x16')]?_[_0xcced('0x17')](_0x3220a2[_0xcced('0x16')],function(_0x441245){return{'model':db[_0x441245['model']],'as':_0x441245['as'],'attributes':_0x441245[_0xcced('0x14')],'include':_0x441245[_0xcced('0x16')]?_[_0xcced('0x17')](_0x441245[_0xcced('0x16')],function(_0x4c27f9){return{'model':db[_0x4c27f9['model']],'as':_0x4c27f9['as'],'attributes':_0x4c27f9[_0xcced('0x14')]};}):[]};}):[]};}):[]:[]})[_0xcced('0x19')](function(_0x341777){logger['info']('ShowFreshdeskAccount',_0x25afb2);logger['debug'](_0xcced('0x1b'),_0x25afb2,JSON[_0xcced('0xb')](_0x341777));_0x229fab(_0x341777);})['catch'](function(_0x2d49bf){logger[_0xcced('0xc')](_0xcced('0x1b'),_0x2d49bf[_0xcced('0xe')],_0x25afb2);_0x180915(_0x158118[_0xcced('0xc')](0x1f4,_0x2d49bf['message']));});});};
\ No newline at end of file
diff --git a/server/api/intFreshdeskConfiguration/index.js b/server/api/intFreshdeskConfiguration/index.js
index 0aeb3a5..516c798 100644
--- a/server/api/intFreshdeskConfiguration/index.js
+++ b/server/api/intFreshdeskConfiguration/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x8355=['express','Router','../../components/auth/service','../../config/environment','./intFreshdeskConfiguration.controller','get','isAuthenticated','/:id','show','/:id/subjects','getSubjects','/:id/tags','post','create','setTags','put','destroy','exports','util','connect-timeout'];(function(_0x336c9e,_0x479b53){var _0x34befe=function(_0x1681f9){while(--_0x1681f9){_0x336c9e['push'](_0x336c9e['shift']());}};_0x34befe(++_0x479b53);}(_0x8355,0x1a2));var _0x5835=function(_0x4bc47d,_0x4739e2){_0x4bc47d=_0x4bc47d-0x0;var _0x8f8bf9=_0x8355[_0x4bc47d];return _0x8f8bf9;};'use strict';var multer=require('multer');var util=require(_0x5835('0x0'));var path=require('path');var timeout=require(_0x5835('0x1'));var express=require(_0x5835('0x2'));var router=express[_0x5835('0x3')]();var auth=require(_0x5835('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x5835('0x5'));var controller=require(_0x5835('0x6'));router[_0x5835('0x7')]('/',auth[_0x5835('0x8')](),controller['index']);router[_0x5835('0x7')](_0x5835('0x9'),auth[_0x5835('0x8')](),controller[_0x5835('0xa')]);router['get']('/:id/fields',auth[_0x5835('0x8')](),controller['getFields']);router[_0x5835('0x7')](_0x5835('0xb'),auth[_0x5835('0x8')](),controller[_0x5835('0xc')]);router[_0x5835('0x7')]('/:id/descriptions',auth[_0x5835('0x8')](),controller['getDescriptions']);router[_0x5835('0x7')](_0x5835('0xd'),auth[_0x5835('0x8')](),controller['getTags']);router[_0x5835('0xe')]('/',auth[_0x5835('0x8')](),controller[_0x5835('0xf')]);router[_0x5835('0xe')](_0x5835('0xd'),auth['isAuthenticated'](),controller[_0x5835('0x10')]);router[_0x5835('0x11')]('/:id',auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth[_0x5835('0x8')](),controller[_0x5835('0x12')]);module[_0x5835('0x13')]=router;
\ No newline at end of file
+var _0x824c=['../../components/interaction/service','../../config/environment','./intFreshdeskConfiguration.controller','get','isAuthenticated','index','/:id/fields','getFields','/:id/subjects','/:id/descriptions','getDescriptions','post','create','/:id/tags','setTags','put','/:id','delete','destroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service'];(function(_0x562b5f,_0x533966){var _0x128a56=function(_0x493447){while(--_0x493447){_0x562b5f['push'](_0x562b5f['shift']());}};_0x128a56(++_0x533966);}(_0x824c,0x1ce));var _0xc824=function(_0x1c807a,_0x5e6b1f){_0x1c807a=_0x1c807a-0x0;var _0x7b9227=_0x824c[_0x1c807a];return _0x7b9227;};'use strict';var multer=require(_0xc824('0x0'));var util=require(_0xc824('0x1'));var path=require(_0xc824('0x2'));var timeout=require(_0xc824('0x3'));var express=require('express');var router=express[_0xc824('0x4')]();var auth=require(_0xc824('0x5'));var interaction=require(_0xc824('0x6'));var config=require(_0xc824('0x7'));var controller=require(_0xc824('0x8'));router[_0xc824('0x9')]('/',auth[_0xc824('0xa')](),controller[_0xc824('0xb')]);router['get']('/:id',auth[_0xc824('0xa')](),controller['show']);router[_0xc824('0x9')](_0xc824('0xc'),auth[_0xc824('0xa')](),controller[_0xc824('0xd')]);router['get'](_0xc824('0xe'),auth['isAuthenticated'](),controller['getSubjects']);router[_0xc824('0x9')](_0xc824('0xf'),auth[_0xc824('0xa')](),controller[_0xc824('0x10')]);router['get']('/:id/tags',auth[_0xc824('0xa')](),controller['getTags']);router[_0xc824('0x11')]('/',auth[_0xc824('0xa')](),controller[_0xc824('0x12')]);router['post'](_0xc824('0x13'),auth['isAuthenticated'](),controller[_0xc824('0x14')]);router[_0xc824('0x15')](_0xc824('0x16'),auth['isAuthenticated'](),controller['update']);router[_0xc824('0x17')](_0xc824('0x16'),auth[_0xc824('0xa')](),controller[_0xc824('0x18')]);module[_0xc824('0x19')]=router;
\ No newline at end of file
diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.attributes.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.attributes.js
index 6a9d4fa..eff82af 100644
--- a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.attributes.js
+++ b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x0d62=['STRING'];(function(_0x2af276,_0xb15ec5){var _0x4c586e=function(_0x681843){while(--_0x681843){_0x2af276['push'](_0x2af276['shift']());}};_0x4c586e(++_0xb15ec5);}(_0x0d62,0x118));var _0x20d6=function(_0x25248b,_0x3c8491){_0x25248b=_0x25248b-0x0;var _0x509939=_0x0d62[_0x25248b];return _0x509939;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x20d6('0x0')]},'description':{'type':Sequelize[_0x20d6('0x0')]}};
\ No newline at end of file
+var _0x4e48=['STRING','sequelize','exports'];(function(_0x3210fa,_0x5d2edf){var _0xebc2d9=function(_0x4b4216){while(--_0x4b4216){_0x3210fa['push'](_0x3210fa['shift']());}};_0xebc2d9(++_0x5d2edf);}(_0x4e48,0xd9));var _0x84e4=function(_0x3f48f5,_0x3a7dd6){_0x3f48f5=_0x3f48f5-0x0;var _0x25d660=_0x4e48[_0x3f48f5];return _0x25d660;};'use strict';var Sequelize=require(_0x84e4('0x0'));module[_0x84e4('0x1')]={'name':{'type':Sequelize[_0x84e4('0x2')]},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js
index 8f03b00..cdd1480 100644
--- a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js
+++ b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x68de=['offset','limit','set','Content-Range','apply','reject','save','update','destroy','stack','name','send','index','map','FreshdeskConfiguration','rawAttributes','fieldName','type','key','query','filters','intersection','fields','attributes','model','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','show','params','keys','find','create','body','length','getFields','hasOwnProperty','getSubjects','findOne','getDescriptions','FreshdeskField','getTags','Tag','setTags','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../mysqldb','jayson/promise','client','test','Sequelize','request','then','info','FreshdeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','end','count'];(function(_0x182377,_0xd15726){var _0x21a0ab=function(_0x1d6730){while(--_0x1d6730){_0x182377['push'](_0x182377['shift']());}};_0x21a0ab(++_0xd15726);}(_0x68de,0xfa));var _0xe68d=function(_0x4503df,_0xfec122){_0x4503df=_0x4503df-0x0;var _0x3f1b2b=_0x68de[_0x4503df];return _0x3f1b2b;};'use strict';var pdf=require(_0xe68d('0x0'));var emlformat=require(_0xe68d('0x1'));var rimraf=require(_0xe68d('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe68d('0x3'));var rp=require(_0xe68d('0x4'));var moment=require(_0xe68d('0x5'));var BPromise=require(_0xe68d('0x6'));var Mustache=require('mustache');var util=require(_0xe68d('0x7'));var path=require(_0xe68d('0x8'));var sox=require(_0xe68d('0x9'));var csv=require(_0xe68d('0xa'));var ejs=require(_0xe68d('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0xe68d('0xc'));var crypto=require('crypto');var jsforce=require(_0xe68d('0xd'));var deskjs=require(_0xe68d('0xe'));var toCsv=require(_0xe68d('0xa'));var querystring=require(_0xe68d('0xf'));var Papa=require(_0xe68d('0x10'));var Redis=require(_0xe68d('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xe68d('0x12'));var as=require(_0xe68d('0x13'));var hardwareService=require(_0xe68d('0x14'));var logger=require('../../config/logger')(_0xe68d('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0xe68d('0x16'))['db'];var jayson=require(_0xe68d('0x17'));var client=jayson[_0xe68d('0x18')]['http']({'port':0x232a});function checkPasswordPattern(_0x42e532,_0x5afe30,_0x398ba3){if(_0x398ba3){var _0x196e5c=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x196e5c[_0xe68d('0x19')](_0x5afe30)){return _0x42e532;}else{throw new db[(_0xe68d('0x1a'))]['ValidationError']('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x42e532;}}function respondWithRpcPromise(_0xa445d8,_0x1f0baa,_0x2ece27,_0x459352){return new BPromise(function(_0x25c502,_0x216777){var _0x3b6364=_0x459352||client;return _0x3b6364[_0xe68d('0x1b')](_0xa445d8,_0x2ece27)[_0xe68d('0x1c')](function(_0x2f9dc7){logger[_0xe68d('0x1d')](_0xe68d('0x1e'),_0x1f0baa,_0xe68d('0x1f'));logger[_0xe68d('0x20')](_0xe68d('0x21'),_0x1f0baa,'request\x20sent',JSON[_0xe68d('0x22')](_0x2f9dc7));if(_0x2f9dc7[_0xe68d('0x23')]){if(_0x2f9dc7[_0xe68d('0x23')][_0xe68d('0x24')]===0x1f4){logger[_0xe68d('0x23')](_0xe68d('0x1e'),_0x1f0baa,_0x2f9dc7[_0xe68d('0x23')][_0xe68d('0x25')]);return _0x216777(_0x2f9dc7[_0xe68d('0x23')][_0xe68d('0x25')]);}logger[_0xe68d('0x23')](_0xe68d('0x1e'),_0x1f0baa,_0x2f9dc7[_0xe68d('0x23')]['message']);return _0x25c502(_0x2f9dc7[_0xe68d('0x23')]['message']);}else{logger[_0xe68d('0x1d')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x1f0baa,'request\x20sent');_0x25c502(_0x2f9dc7[_0xe68d('0x26')][_0xe68d('0x25')]);}})[_0xe68d('0x27')](function(_0x1fd98a){logger['error']('FreshdeskConfiguration,\x20%s,\x20%s',_0x1f0baa,_0x1fd98a);_0x216777(_0x1fd98a);});});}function respondWithStatusCode(_0x53b957,_0x5cead6){_0x5cead6=_0x5cead6||0xcc;return function(_0x19fc4a){if(_0x19fc4a){return _0x53b957[_0xe68d('0x28')](_0x5cead6);}return _0x53b957[_0xe68d('0x29')](_0x5cead6)[_0xe68d('0x2a')]();};}function respondWithResult(_0x9ae1f4,_0x183c4b){_0x183c4b=_0x183c4b||0xc8;return function(_0x489374){if(_0x489374){return _0x9ae1f4[_0xe68d('0x29')](_0x183c4b)['json'](_0x489374);}};}function respondWithFilteredResult(_0x5d7e7e,_0x453c5f){return function(_0x5b4980){if(_0x5b4980){var _0x71c33=_0x5b4980[_0xe68d('0x2b')],_0x14955a=_0x453c5f[_0xe68d('0x2c')],_0x57e8f5=_0x453c5f[_0xe68d('0x2c')]+_0x453c5f[_0xe68d('0x2d')],_0x497a43;if(_0x57e8f5>=_0x71c33){_0x57e8f5=_0x71c33;_0x497a43=0xc8;}else{_0x497a43=0xce;}_0x5d7e7e[_0xe68d('0x29')](_0x497a43);return _0x5d7e7e[_0xe68d('0x2e')](_0xe68d('0x2f'),_0x14955a+'-'+_0x57e8f5+'/'+_0x71c33)['json'](_0x5b4980);}return null;};}function patchUpdates(_0x2eb3b6){return function(_0x1fc4f2){try{jsonpatch[_0xe68d('0x30')](_0x1fc4f2,_0x2eb3b6,!![]);}catch(_0x25999e){return BPromise[_0xe68d('0x31')](_0x25999e);}return _0x1fc4f2[_0xe68d('0x32')]();};}function saveUpdates(_0x1c7360,_0x43caf2){return function(_0x288e8c){if(_0x288e8c){return _0x288e8c[_0xe68d('0x33')](_0x1c7360)[_0xe68d('0x1c')](function(_0x4cd725){return _0x4cd725;});}return null;};}function removeEntity(_0x5c27ab,_0x8cfee){return function(_0x3f1275){if(_0x3f1275){return _0x3f1275[_0xe68d('0x34')]()[_0xe68d('0x1c')](function(){_0x5c27ab['status'](0xcc)[_0xe68d('0x2a')]();});}};}function handleEntityNotFound(_0x2d5414,_0x59026e){return function(_0x4bba56){if(!_0x4bba56){_0x2d5414[_0xe68d('0x28')](0x194);}return _0x4bba56;};}function handleError(_0x2f0459,_0x45ba6b){_0x45ba6b=_0x45ba6b||0x1f4;return function(_0x43402e){logger[_0xe68d('0x23')](_0x43402e[_0xe68d('0x35')]);if(_0x43402e[_0xe68d('0x36')]){delete _0x43402e[_0xe68d('0x36')];}_0x2f0459['status'](_0x45ba6b)[_0xe68d('0x37')](_0x43402e);};}exports[_0xe68d('0x38')]=function(_0xd97d11,_0x49bdba){var _0x599dcc={},_0x2577cb={},_0x4f1695={'count':0x0,'rows':[]};var _0x53c1a2=_[_0xe68d('0x39')](db[_0xe68d('0x3a')][_0xe68d('0x3b')],function(_0x379b17){return{'name':_0x379b17[_0xe68d('0x3c')],'type':_0x379b17[_0xe68d('0x3d')][_0xe68d('0x3e')]};});_0x2577cb['model']=_[_0xe68d('0x39')](_0x53c1a2,_0xe68d('0x36'));_0x2577cb[_0xe68d('0x3f')]=_['keys'](_0xd97d11[_0xe68d('0x3f')]);_0x2577cb[_0xe68d('0x40')]=_['intersection'](_0x2577cb['model'],_0x2577cb[_0xe68d('0x3f')]);_0x599dcc['attributes']=_[_0xe68d('0x41')](_0x2577cb['model'],qs[_0xe68d('0x42')](_0xd97d11[_0xe68d('0x3f')][_0xe68d('0x42')]));_0x599dcc['attributes']=_0x599dcc['attributes']['length']?_0x599dcc[_0xe68d('0x43')]:_0x2577cb[_0xe68d('0x44')];if(!_0xd97d11[_0xe68d('0x3f')]['hasOwnProperty'](_0xe68d('0x45'))){_0x599dcc[_0xe68d('0x2d')]=qs['limit'](_0xd97d11['query'][_0xe68d('0x2d')]);_0x599dcc['offset']=qs[_0xe68d('0x2c')](_0xd97d11['query'][_0xe68d('0x2c')]);}_0x599dcc[_0xe68d('0x46')]=qs[_0xe68d('0x47')](_0xd97d11[_0xe68d('0x3f')][_0xe68d('0x47')]);_0x599dcc[_0xe68d('0x48')]=qs[_0xe68d('0x40')](_[_0xe68d('0x49')](_0xd97d11[_0xe68d('0x3f')],_0x2577cb[_0xe68d('0x40')]),_0x53c1a2);if(_0xd97d11[_0xe68d('0x3f')][_0xe68d('0x4a')]){_0x599dcc[_0xe68d('0x48')]=_['merge'](_0x599dcc['where'],{'$or':_[_0xe68d('0x39')](_0x53c1a2,function(_0x538c6e){if(_0x538c6e[_0xe68d('0x3d')]!==_0xe68d('0x4b')){var _0x26c09f={};_0x26c09f[_0x538c6e[_0xe68d('0x36')]]={'$like':'%'+_0xd97d11[_0xe68d('0x3f')][_0xe68d('0x4a')]+'%'};return _0x26c09f;}})});}_0x599dcc=_[_0xe68d('0x4c')]({},_0x599dcc,_0xd97d11[_0xe68d('0x4d')]);var _0x3c4139={'where':_0x599dcc[_0xe68d('0x48')]};return db[_0xe68d('0x3a')][_0xe68d('0x2b')](_0x3c4139)[_0xe68d('0x1c')](function(_0x6e8ef4){_0x4f1695[_0xe68d('0x2b')]=_0x6e8ef4;if(_0xd97d11[_0xe68d('0x3f')][_0xe68d('0x4e')]){_0x599dcc[_0xe68d('0x4f')]=[{'all':!![]}];}return db['FreshdeskConfiguration'][_0xe68d('0x50')](_0x599dcc);})['then'](function(_0x50d627){_0x4f1695[_0xe68d('0x51')]=_0x50d627;return _0x4f1695;})[_0xe68d('0x1c')](respondWithFilteredResult(_0x49bdba,_0x599dcc))[_0xe68d('0x27')](handleError(_0x49bdba,null));};exports[_0xe68d('0x52')]=function(_0x46ff19,_0x114c12){var _0x2e042e={'raw':![],'where':{'id':_0x46ff19[_0xe68d('0x53')]['id']}},_0x3812e4={};_0x3812e4[_0xe68d('0x44')]=_[_0xe68d('0x54')](db[_0xe68d('0x3a')]['rawAttributes']);_0x3812e4[_0xe68d('0x3f')]=_[_0xe68d('0x54')](_0x46ff19[_0xe68d('0x3f')]);_0x3812e4['filters']=_[_0xe68d('0x41')](_0x3812e4[_0xe68d('0x44')],_0x3812e4['query']);_0x2e042e[_0xe68d('0x43')]=_[_0xe68d('0x41')](_0x3812e4['model'],qs['fields'](_0x46ff19[_0xe68d('0x3f')][_0xe68d('0x42')]));_0x2e042e['attributes']=_0x2e042e['attributes']['length']?_0x2e042e[_0xe68d('0x43')]:_0x3812e4[_0xe68d('0x44')];if(_0x46ff19[_0xe68d('0x3f')][_0xe68d('0x4e')]){_0x2e042e[_0xe68d('0x4f')]=[{'all':!![]}];}_0x2e042e=_[_0xe68d('0x4c')]({},_0x2e042e,_0x46ff19[_0xe68d('0x4d')]);return db['FreshdeskConfiguration'][_0xe68d('0x55')](_0x2e042e)[_0xe68d('0x1c')](handleEntityNotFound(_0x114c12,null))[_0xe68d('0x1c')](respondWithResult(_0x114c12,null))[_0xe68d('0x27')](handleError(_0x114c12,null));};exports[_0xe68d('0x56')]=function(_0x177fc6,_0x4fdbfa){return db[_0xe68d('0x3a')][_0xe68d('0x56')](_0x177fc6['body'],{})[_0xe68d('0x1c')](respondWithResult(_0x4fdbfa,0xc9))[_0xe68d('0x27')](handleError(_0x4fdbfa,null));};exports[_0xe68d('0x33')]=function(_0x1ad409,_0x418bbb){if(_0x1ad409['body']['id']){delete _0x1ad409[_0xe68d('0x57')]['id'];}return db[_0xe68d('0x3a')]['find']({'where':{'id':_0x1ad409['params']['id']}})[_0xe68d('0x1c')](handleEntityNotFound(_0x418bbb,null))['then'](saveUpdates(_0x1ad409['body'],null))[_0xe68d('0x1c')](respondWithResult(_0x418bbb,null))[_0xe68d('0x27')](handleError(_0x418bbb,null));};exports['destroy']=function(_0x2e9132,_0x46e4fa){return db[_0xe68d('0x3a')]['find']({'where':{'id':_0x2e9132['params']['id']}})[_0xe68d('0x1c')](handleEntityNotFound(_0x46e4fa,null))['then'](removeEntity(_0x46e4fa,null))[_0xe68d('0x27')](handleError(_0x46e4fa,null));};exports['getFields']=function(_0x42392a,_0x47b79d,_0x17303f){var _0x9056d3={};var _0x749531={};var _0x1752f0;var _0x3dc19f;return db[_0xe68d('0x3a')]['findOne']({'where':{'id':_0x42392a['params']['id']}})[_0xe68d('0x1c')](handleEntityNotFound(_0x47b79d,null))['then'](function(_0x24a8db){if(_0x24a8db){_0x1752f0=_0x24a8db;_0x749531[_0xe68d('0x44')]=_[_0xe68d('0x54')](db['FreshdeskField']['rawAttributes']);_0x749531['query']=_['keys'](_0x42392a['query']);_0x749531[_0xe68d('0x40')]=_['intersection'](_0x749531[_0xe68d('0x44')],_0x749531[_0xe68d('0x3f')]);_0x9056d3[_0xe68d('0x43')]=_[_0xe68d('0x41')](_0x749531['model'],qs['fields'](_0x42392a['query'][_0xe68d('0x42')]));_0x9056d3[_0xe68d('0x43')]=_0x9056d3[_0xe68d('0x43')][_0xe68d('0x58')]?_0x9056d3['attributes']:_0x749531[_0xe68d('0x44')];_0x9056d3[_0xe68d('0x46')]=qs[_0xe68d('0x47')](_0x42392a['query']['sort']);_0x9056d3[_0xe68d('0x48')]=qs[_0xe68d('0x40')](_[_0xe68d('0x49')](_0x42392a[_0xe68d('0x3f')],_0x749531[_0xe68d('0x40')]));if(_0x42392a[_0xe68d('0x3f')][_0xe68d('0x4a')]){_0x9056d3['where']=_['merge'](_0x9056d3[_0xe68d('0x48')],{'$or':_[_0xe68d('0x39')](_0x9056d3[_0xe68d('0x43')],function(_0x27daa5){var _0x22ecac={};_0x22ecac[_0x27daa5]={'$like':'%'+_0x42392a[_0xe68d('0x3f')][_0xe68d('0x4a')]+'%'};return _0x22ecac;})});}_0x9056d3=_[_0xe68d('0x4c')]({},_0x9056d3,_0x42392a[_0xe68d('0x4d')]);return _0x1752f0[_0xe68d('0x59')](_0x9056d3);}})[_0xe68d('0x1c')](function(_0xa17fa6){if(_0xa17fa6){_0x3dc19f=_0xa17fa6['length'];if(!_0x42392a[_0xe68d('0x3f')][_0xe68d('0x5a')](_0xe68d('0x45'))){_0x9056d3[_0xe68d('0x2d')]=qs['limit'](_0x42392a[_0xe68d('0x3f')][_0xe68d('0x2d')]);_0x9056d3[_0xe68d('0x2c')]=qs[_0xe68d('0x2c')](_0x42392a[_0xe68d('0x3f')]['offset']);}return _0x1752f0[_0xe68d('0x59')](_0x9056d3);}})[_0xe68d('0x1c')](function(_0x19e10f){if(_0x19e10f){return _0x19e10f?{'count':_0x3dc19f,'rows':_0x19e10f}:null;}})['then'](respondWithResult(_0x47b79d,null))['catch'](handleError(_0x47b79d,null));};exports[_0xe68d('0x5b')]=function(_0x24fd90,_0x367753,_0x3b9fe9){var _0xee4c8f={};var _0x58c988={};var _0x3f26d0;var _0x39293e;return db[_0xe68d('0x3a')][_0xe68d('0x5c')]({'where':{'id':_0x24fd90[_0xe68d('0x53')]['id']}})[_0xe68d('0x1c')](handleEntityNotFound(_0x367753,null))['then'](function(_0x3cd057){if(_0x3cd057){_0x3f26d0=_0x3cd057;_0x58c988[_0xe68d('0x44')]=_[_0xe68d('0x54')](db['FreshdeskField']['rawAttributes']);_0x58c988[_0xe68d('0x3f')]=_[_0xe68d('0x54')](_0x24fd90['query']);_0x58c988[_0xe68d('0x40')]=_['intersection'](_0x58c988['model'],_0x58c988[_0xe68d('0x3f')]);_0xee4c8f[_0xe68d('0x43')]=_['intersection'](_0x58c988['model'],qs[_0xe68d('0x42')](_0x24fd90[_0xe68d('0x3f')][_0xe68d('0x42')]));_0xee4c8f[_0xe68d('0x43')]=_0xee4c8f[_0xe68d('0x43')][_0xe68d('0x58')]?_0xee4c8f[_0xe68d('0x43')]:_0x58c988['model'];_0xee4c8f[_0xe68d('0x46')]=qs[_0xe68d('0x47')](_0x24fd90[_0xe68d('0x3f')][_0xe68d('0x47')]);_0xee4c8f[_0xe68d('0x48')]=qs[_0xe68d('0x40')](_['pick'](_0x24fd90[_0xe68d('0x3f')],_0x58c988[_0xe68d('0x40')]));if(_0x24fd90[_0xe68d('0x3f')][_0xe68d('0x4a')]){_0xee4c8f[_0xe68d('0x48')]=_['merge'](_0xee4c8f[_0xe68d('0x48')],{'$or':_[_0xe68d('0x39')](_0xee4c8f[_0xe68d('0x43')],function(_0x1a5471){var _0x4a847b={};_0x4a847b[_0x1a5471]={'$like':'%'+_0x24fd90[_0xe68d('0x3f')][_0xe68d('0x4a')]+'%'};return _0x4a847b;})});}_0xee4c8f=_[_0xe68d('0x4c')]({},_0xee4c8f,_0x24fd90[_0xe68d('0x4d')]);return _0x3f26d0[_0xe68d('0x5b')](_0xee4c8f);}})[_0xe68d('0x1c')](function(_0x154898){if(_0x154898){_0x39293e=_0x154898['length'];if(!_0x24fd90['query'][_0xe68d('0x5a')]('nolimit')){_0xee4c8f[_0xe68d('0x2d')]=qs[_0xe68d('0x2d')](_0x24fd90['query'][_0xe68d('0x2d')]);_0xee4c8f[_0xe68d('0x2c')]=qs[_0xe68d('0x2c')](_0x24fd90[_0xe68d('0x3f')][_0xe68d('0x2c')]);}return _0x3f26d0[_0xe68d('0x5b')](_0xee4c8f);}})['then'](function(_0x17749d){if(_0x17749d){return _0x17749d?{'count':_0x39293e,'rows':_0x17749d}:null;}})['then'](respondWithResult(_0x367753,null))[_0xe68d('0x27')](handleError(_0x367753,null));};exports[_0xe68d('0x5d')]=function(_0x4ebc8c,_0x160722,_0x4a22cc){var _0x48e7e5={};var _0x23abe5={};var _0x4097da;var _0x51e1c;return db['FreshdeskConfiguration'][_0xe68d('0x5c')]({'where':{'id':_0x4ebc8c['params']['id']}})[_0xe68d('0x1c')](handleEntityNotFound(_0x160722,null))['then'](function(_0x241ef1){if(_0x241ef1){_0x4097da=_0x241ef1;_0x23abe5['model']=_[_0xe68d('0x54')](db[_0xe68d('0x5e')][_0xe68d('0x3b')]);_0x23abe5[_0xe68d('0x3f')]=_['keys'](_0x4ebc8c[_0xe68d('0x3f')]);_0x23abe5['filters']=_[_0xe68d('0x41')](_0x23abe5[_0xe68d('0x44')],_0x23abe5[_0xe68d('0x3f')]);_0x48e7e5['attributes']=_[_0xe68d('0x41')](_0x23abe5[_0xe68d('0x44')],qs[_0xe68d('0x42')](_0x4ebc8c[_0xe68d('0x3f')][_0xe68d('0x42')]));_0x48e7e5[_0xe68d('0x43')]=_0x48e7e5[_0xe68d('0x43')][_0xe68d('0x58')]?_0x48e7e5[_0xe68d('0x43')]:_0x23abe5[_0xe68d('0x44')];_0x48e7e5[_0xe68d('0x46')]=qs['sort'](_0x4ebc8c[_0xe68d('0x3f')][_0xe68d('0x47')]);_0x48e7e5[_0xe68d('0x48')]=qs[_0xe68d('0x40')](_['pick'](_0x4ebc8c[_0xe68d('0x3f')],_0x23abe5[_0xe68d('0x40')]));if(_0x4ebc8c[_0xe68d('0x3f')][_0xe68d('0x4a')]){_0x48e7e5[_0xe68d('0x48')]=_[_0xe68d('0x4c')](_0x48e7e5['where'],{'$or':_[_0xe68d('0x39')](_0x48e7e5[_0xe68d('0x43')],function(_0x2ed744){var _0x81326b={};_0x81326b[_0x2ed744]={'$like':'%'+_0x4ebc8c[_0xe68d('0x3f')][_0xe68d('0x4a')]+'%'};return _0x81326b;})});}_0x48e7e5=_[_0xe68d('0x4c')]({},_0x48e7e5,_0x4ebc8c['options']);return _0x4097da[_0xe68d('0x5d')](_0x48e7e5);}})[_0xe68d('0x1c')](function(_0x40c44b){if(_0x40c44b){_0x51e1c=_0x40c44b[_0xe68d('0x58')];if(!_0x4ebc8c['query'][_0xe68d('0x5a')](_0xe68d('0x45'))){_0x48e7e5['limit']=qs['limit'](_0x4ebc8c['query']['limit']);_0x48e7e5[_0xe68d('0x2c')]=qs[_0xe68d('0x2c')](_0x4ebc8c[_0xe68d('0x3f')][_0xe68d('0x2c')]);}return _0x4097da[_0xe68d('0x5d')](_0x48e7e5);}})[_0xe68d('0x1c')](function(_0x51045a){if(_0x51045a){return _0x51045a?{'count':_0x51e1c,'rows':_0x51045a}:null;}})[_0xe68d('0x1c')](respondWithResult(_0x160722,null))[_0xe68d('0x27')](handleError(_0x160722,null));};exports[_0xe68d('0x5f')]=function(_0x44aaa1,_0x464deb,_0x2753ca){var _0x4f37e1={};var _0x5512af={};var _0x2d2f6e;var _0x433120;return db['FreshdeskConfiguration'][_0xe68d('0x5c')]({'where':{'id':_0x44aaa1[_0xe68d('0x53')]['id']}})[_0xe68d('0x1c')](handleEntityNotFound(_0x464deb,null))[_0xe68d('0x1c')](function(_0x314b34){if(_0x314b34){_0x2d2f6e=_0x314b34;_0x5512af['model']=_[_0xe68d('0x54')](db[_0xe68d('0x60')][_0xe68d('0x3b')]);_0x5512af[_0xe68d('0x3f')]=_[_0xe68d('0x54')](_0x44aaa1[_0xe68d('0x3f')]);_0x5512af[_0xe68d('0x40')]=_[_0xe68d('0x41')](_0x5512af[_0xe68d('0x44')],_0x5512af['query']);_0x4f37e1['attributes']=_[_0xe68d('0x41')](_0x5512af[_0xe68d('0x44')],qs[_0xe68d('0x42')](_0x44aaa1[_0xe68d('0x3f')][_0xe68d('0x42')]));_0x4f37e1[_0xe68d('0x43')]=_0x4f37e1[_0xe68d('0x43')][_0xe68d('0x58')]?_0x4f37e1[_0xe68d('0x43')]:_0x5512af[_0xe68d('0x44')];_0x4f37e1[_0xe68d('0x46')]=qs[_0xe68d('0x47')](_0x44aaa1[_0xe68d('0x3f')][_0xe68d('0x47')]);_0x4f37e1['where']=qs[_0xe68d('0x40')](_[_0xe68d('0x49')](_0x44aaa1[_0xe68d('0x3f')],_0x5512af[_0xe68d('0x40')]));if(_0x44aaa1[_0xe68d('0x3f')][_0xe68d('0x4a')]){_0x4f37e1[_0xe68d('0x48')]=_['merge'](_0x4f37e1[_0xe68d('0x48')],{'$or':_[_0xe68d('0x39')](_0x4f37e1[_0xe68d('0x43')],function(_0x7c3134){var _0x4338a5={};_0x4338a5[_0x7c3134]={'$like':'%'+_0x44aaa1[_0xe68d('0x3f')][_0xe68d('0x4a')]+'%'};return _0x4338a5;})});}_0x4f37e1=_['merge']({},_0x4f37e1,_0x44aaa1['options']);return _0x2d2f6e[_0xe68d('0x5f')](_0x4f37e1);}})[_0xe68d('0x1c')](function(_0x3facba){if(_0x3facba){_0x433120=_0x3facba[_0xe68d('0x58')];if(!_0x44aaa1[_0xe68d('0x3f')][_0xe68d('0x5a')](_0xe68d('0x45'))){_0x4f37e1[_0xe68d('0x2d')]=qs[_0xe68d('0x2d')](_0x44aaa1[_0xe68d('0x3f')]['limit']);_0x4f37e1['offset']=qs[_0xe68d('0x2c')](_0x44aaa1[_0xe68d('0x3f')][_0xe68d('0x2c')]);}return _0x2d2f6e[_0xe68d('0x5f')](_0x4f37e1);}})[_0xe68d('0x1c')](function(_0x4bfa62){if(_0x4bfa62){return _0x4bfa62?{'count':_0x433120,'rows':_0x4bfa62}:null;}})[_0xe68d('0x1c')](respondWithResult(_0x464deb,null))['catch'](handleError(_0x464deb,null));};exports['setTags']=function(_0x569b08,_0x19c60f,_0x52a897){if(_0x569b08[_0xe68d('0x57')]['id']){delete _0x569b08[_0xe68d('0x57')]['id'];}return db[_0xe68d('0x3a')][_0xe68d('0x5c')]({'where':{'id':_0x569b08[_0xe68d('0x53')]['id']}})[_0xe68d('0x1c')](handleEntityNotFound(_0x19c60f,null))['then'](function(_0x3563d8){if(_0x3563d8){return _0x3563d8[_0xe68d('0x61')](_0x569b08[_0xe68d('0x57')]['ids']||[]);}return null;})['then'](respondWithResult(_0x19c60f,null))[_0xe68d('0x27')](handleError(_0x19c60f,null));};
\ No newline at end of file
+var _0x6b1d=['find','create','body','getFields','FreshdeskField','hasOwnProperty','getSubjects','findOne','getDescriptions','getTags','setTags','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','client','http','test','Sequelize','ValidationError','request','then','info','FreshdeskConfiguration,\x20%s,\x20%s','debug','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','code','error','message','request\x20sent','result','catch','sendStatus','status','end','json','count','offset','limit','set','Content-Range','reject','save','update','destroy','stack','index','map','FreshdeskConfiguration','type','key','model','name','keys','query','attributes','intersection','fields','length','nolimit','order','sort','where','filters','pick','filter','merge','options','includeAll','include','findAll','show','params','rawAttributes'];(function(_0x16d10f,_0x2ba2d5){var _0x50c823=function(_0x44e43f){while(--_0x44e43f){_0x16d10f['push'](_0x16d10f['shift']());}};_0x50c823(++_0x2ba2d5);}(_0x6b1d,0xc9));var _0xd6b1=function(_0x705b98,_0x1c345b){_0x705b98=_0x705b98-0x0;var _0x47b72f=_0x6b1d[_0x705b98];return _0x47b72f;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xd6b1('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd6b1('0x1'));var jsonpatch=require(_0xd6b1('0x2'));var rp=require(_0xd6b1('0x3'));var moment=require(_0xd6b1('0x4'));var BPromise=require(_0xd6b1('0x5'));var Mustache=require('mustache');var util=require(_0xd6b1('0x6'));var path=require('path');var sox=require(_0xd6b1('0x7'));var csv=require(_0xd6b1('0x8'));var ejs=require(_0xd6b1('0x9'));var fs=require('fs');var _=require(_0xd6b1('0xa'));var squel=require(_0xd6b1('0xb'));var crypto=require(_0xd6b1('0xc'));var jsforce=require(_0xd6b1('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xd6b1('0x8'));var querystring=require(_0xd6b1('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xd6b1('0xf'));var qs=require(_0xd6b1('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd6b1('0x11'));var logger=require(_0xd6b1('0x12'))(_0xd6b1('0x13'));var utils=require(_0xd6b1('0x14'));var config=require(_0xd6b1('0x15'));var db=require(_0xd6b1('0x16'))['db'];var jayson=require(_0xd6b1('0x17'));var client=jayson[_0xd6b1('0x18')][_0xd6b1('0x19')]({'port':0x232a});function checkPasswordPattern(_0x1a2341,_0x2c3269,_0x506f09){if(_0x506f09){var _0x20210b=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x20210b[_0xd6b1('0x1a')](_0x2c3269)){return _0x1a2341;}else{throw new db[(_0xd6b1('0x1b'))][(_0xd6b1('0x1c'))]('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x1a2341;}}function respondWithRpcPromise(_0x2ca32b,_0x26a6ad,_0x5115ff,_0x426e9e){return new BPromise(function(_0x2ad390,_0x25452e){var _0x563651=_0x426e9e||client;return _0x563651[_0xd6b1('0x1d')](_0x2ca32b,_0x5115ff)[_0xd6b1('0x1e')](function(_0x3cbdfe){logger[_0xd6b1('0x1f')](_0xd6b1('0x20'),_0x26a6ad,'request\x20sent');logger[_0xd6b1('0x21')](_0xd6b1('0x22'),_0x26a6ad,'request\x20sent',JSON[_0xd6b1('0x23')](_0x3cbdfe));if(_0x3cbdfe['error']){if(_0x3cbdfe['error'][_0xd6b1('0x24')]===0x1f4){logger[_0xd6b1('0x25')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x26a6ad,_0x3cbdfe[_0xd6b1('0x25')][_0xd6b1('0x26')]);return _0x25452e(_0x3cbdfe['error'][_0xd6b1('0x26')]);}logger[_0xd6b1('0x25')](_0xd6b1('0x20'),_0x26a6ad,_0x3cbdfe[_0xd6b1('0x25')][_0xd6b1('0x26')]);return _0x2ad390(_0x3cbdfe['error'][_0xd6b1('0x26')]);}else{logger[_0xd6b1('0x1f')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x26a6ad,_0xd6b1('0x27'));_0x2ad390(_0x3cbdfe[_0xd6b1('0x28')][_0xd6b1('0x26')]);}})[_0xd6b1('0x29')](function(_0x44c160){logger[_0xd6b1('0x25')](_0xd6b1('0x20'),_0x26a6ad,_0x44c160);_0x25452e(_0x44c160);});});}function respondWithStatusCode(_0x88a845,_0x522c1e){_0x522c1e=_0x522c1e||0xcc;return function(_0x2bee7b){if(_0x2bee7b){return _0x88a845[_0xd6b1('0x2a')](_0x522c1e);}return _0x88a845[_0xd6b1('0x2b')](_0x522c1e)[_0xd6b1('0x2c')]();};}function respondWithResult(_0xd01925,_0x3a40a8){_0x3a40a8=_0x3a40a8||0xc8;return function(_0x3fbfdf){if(_0x3fbfdf){return _0xd01925[_0xd6b1('0x2b')](_0x3a40a8)[_0xd6b1('0x2d')](_0x3fbfdf);}};}function respondWithFilteredResult(_0x72fbe0,_0x35298f){return function(_0x102ca1){if(_0x102ca1){var _0xd1280f=_0x102ca1[_0xd6b1('0x2e')],_0x5c69e2=_0x35298f['offset'],_0x1f7cc9=_0x35298f[_0xd6b1('0x2f')]+_0x35298f[_0xd6b1('0x30')],_0x343c29;if(_0x1f7cc9>=_0xd1280f){_0x1f7cc9=_0xd1280f;_0x343c29=0xc8;}else{_0x343c29=0xce;}_0x72fbe0[_0xd6b1('0x2b')](_0x343c29);return _0x72fbe0[_0xd6b1('0x31')](_0xd6b1('0x32'),_0x5c69e2+'-'+_0x1f7cc9+'/'+_0xd1280f)[_0xd6b1('0x2d')](_0x102ca1);}return null;};}function patchUpdates(_0x1cfe9a){return function(_0x1ed884){try{jsonpatch['apply'](_0x1ed884,_0x1cfe9a,!![]);}catch(_0x5179a9){return BPromise[_0xd6b1('0x33')](_0x5179a9);}return _0x1ed884[_0xd6b1('0x34')]();};}function saveUpdates(_0x1bd144,_0x3192f0){return function(_0x2d74e1){if(_0x2d74e1){return _0x2d74e1[_0xd6b1('0x35')](_0x1bd144)[_0xd6b1('0x1e')](function(_0x4a1027){return _0x4a1027;});}return null;};}function removeEntity(_0x4df3b1,_0x173ef4){return function(_0xc43c61){if(_0xc43c61){return _0xc43c61[_0xd6b1('0x36')]()[_0xd6b1('0x1e')](function(){_0x4df3b1[_0xd6b1('0x2b')](0xcc)[_0xd6b1('0x2c')]();});}};}function handleEntityNotFound(_0x5aad30,_0x3a7b5f){return function(_0x325673){if(!_0x325673){_0x5aad30[_0xd6b1('0x2a')](0x194);}return _0x325673;};}function handleError(_0x175394,_0x3f2f0e){_0x3f2f0e=_0x3f2f0e||0x1f4;return function(_0x500f80){logger[_0xd6b1('0x25')](_0x500f80[_0xd6b1('0x37')]);if(_0x500f80['name']){delete _0x500f80['name'];}_0x175394['status'](_0x3f2f0e)['send'](_0x500f80);};}exports[_0xd6b1('0x38')]=function(_0x2898b5,_0x398150){var _0x2b02dc={},_0x21d248={},_0x14cd4e={'count':0x0,'rows':[]};var _0x2c030d=_[_0xd6b1('0x39')](db[_0xd6b1('0x3a')]['rawAttributes'],function(_0x202d98){return{'name':_0x202d98['fieldName'],'type':_0x202d98[_0xd6b1('0x3b')][_0xd6b1('0x3c')]};});_0x21d248[_0xd6b1('0x3d')]=_['map'](_0x2c030d,_0xd6b1('0x3e'));_0x21d248['query']=_[_0xd6b1('0x3f')](_0x2898b5['query']);_0x21d248['filters']=_['intersection'](_0x21d248[_0xd6b1('0x3d')],_0x21d248[_0xd6b1('0x40')]);_0x2b02dc[_0xd6b1('0x41')]=_[_0xd6b1('0x42')](_0x21d248['model'],qs[_0xd6b1('0x43')](_0x2898b5[_0xd6b1('0x40')][_0xd6b1('0x43')]));_0x2b02dc[_0xd6b1('0x41')]=_0x2b02dc[_0xd6b1('0x41')][_0xd6b1('0x44')]?_0x2b02dc['attributes']:_0x21d248['model'];if(!_0x2898b5['query']['hasOwnProperty'](_0xd6b1('0x45'))){_0x2b02dc[_0xd6b1('0x30')]=qs[_0xd6b1('0x30')](_0x2898b5[_0xd6b1('0x40')][_0xd6b1('0x30')]);_0x2b02dc[_0xd6b1('0x2f')]=qs[_0xd6b1('0x2f')](_0x2898b5[_0xd6b1('0x40')][_0xd6b1('0x2f')]);}_0x2b02dc[_0xd6b1('0x46')]=qs['sort'](_0x2898b5[_0xd6b1('0x40')][_0xd6b1('0x47')]);_0x2b02dc[_0xd6b1('0x48')]=qs[_0xd6b1('0x49')](_[_0xd6b1('0x4a')](_0x2898b5[_0xd6b1('0x40')],_0x21d248['filters']),_0x2c030d);if(_0x2898b5[_0xd6b1('0x40')][_0xd6b1('0x4b')]){_0x2b02dc['where']=_[_0xd6b1('0x4c')](_0x2b02dc[_0xd6b1('0x48')],{'$or':_[_0xd6b1('0x39')](_0x2c030d,function(_0x114840){if(_0x114840['type']!=='VIRTUAL'){var _0x208a4b={};_0x208a4b[_0x114840[_0xd6b1('0x3e')]]={'$like':'%'+_0x2898b5['query'][_0xd6b1('0x4b')]+'%'};return _0x208a4b;}})});}_0x2b02dc=_[_0xd6b1('0x4c')]({},_0x2b02dc,_0x2898b5[_0xd6b1('0x4d')]);var _0x5cfcb8={'where':_0x2b02dc['where']};return db[_0xd6b1('0x3a')]['count'](_0x5cfcb8)['then'](function(_0x56f5ec){_0x14cd4e['count']=_0x56f5ec;if(_0x2898b5['query'][_0xd6b1('0x4e')]){_0x2b02dc[_0xd6b1('0x4f')]=[{'all':!![]}];}return db[_0xd6b1('0x3a')][_0xd6b1('0x50')](_0x2b02dc);})[_0xd6b1('0x1e')](function(_0x1e957f){_0x14cd4e['rows']=_0x1e957f;return _0x14cd4e;})[_0xd6b1('0x1e')](respondWithFilteredResult(_0x398150,_0x2b02dc))[_0xd6b1('0x29')](handleError(_0x398150,null));};exports[_0xd6b1('0x51')]=function(_0x1a2a93,_0x12ad7f){var _0x2d568c={'raw':![],'where':{'id':_0x1a2a93[_0xd6b1('0x52')]['id']}},_0x2bd643={};_0x2bd643[_0xd6b1('0x3d')]=_[_0xd6b1('0x3f')](db[_0xd6b1('0x3a')][_0xd6b1('0x53')]);_0x2bd643[_0xd6b1('0x40')]=_[_0xd6b1('0x3f')](_0x1a2a93[_0xd6b1('0x40')]);_0x2bd643[_0xd6b1('0x49')]=_[_0xd6b1('0x42')](_0x2bd643[_0xd6b1('0x3d')],_0x2bd643[_0xd6b1('0x40')]);_0x2d568c[_0xd6b1('0x41')]=_[_0xd6b1('0x42')](_0x2bd643[_0xd6b1('0x3d')],qs[_0xd6b1('0x43')](_0x1a2a93['query'][_0xd6b1('0x43')]));_0x2d568c[_0xd6b1('0x41')]=_0x2d568c[_0xd6b1('0x41')][_0xd6b1('0x44')]?_0x2d568c['attributes']:_0x2bd643[_0xd6b1('0x3d')];if(_0x1a2a93[_0xd6b1('0x40')][_0xd6b1('0x4e')]){_0x2d568c[_0xd6b1('0x4f')]=[{'all':!![]}];}_0x2d568c=_['merge']({},_0x2d568c,_0x1a2a93[_0xd6b1('0x4d')]);return db[_0xd6b1('0x3a')][_0xd6b1('0x54')](_0x2d568c)[_0xd6b1('0x1e')](handleEntityNotFound(_0x12ad7f,null))[_0xd6b1('0x1e')](respondWithResult(_0x12ad7f,null))[_0xd6b1('0x29')](handleError(_0x12ad7f,null));};exports['create']=function(_0x2f4a9f,_0x5b2f4d){return db[_0xd6b1('0x3a')][_0xd6b1('0x55')](_0x2f4a9f[_0xd6b1('0x56')],{})['then'](respondWithResult(_0x5b2f4d,0xc9))['catch'](handleError(_0x5b2f4d,null));};exports['update']=function(_0x12a642,_0x35b515){if(_0x12a642[_0xd6b1('0x56')]['id']){delete _0x12a642[_0xd6b1('0x56')]['id'];}return db[_0xd6b1('0x3a')]['find']({'where':{'id':_0x12a642[_0xd6b1('0x52')]['id']}})[_0xd6b1('0x1e')](handleEntityNotFound(_0x35b515,null))[_0xd6b1('0x1e')](saveUpdates(_0x12a642[_0xd6b1('0x56')],null))[_0xd6b1('0x1e')](respondWithResult(_0x35b515,null))[_0xd6b1('0x29')](handleError(_0x35b515,null));};exports[_0xd6b1('0x36')]=function(_0x39aa54,_0x3c005f){return db[_0xd6b1('0x3a')][_0xd6b1('0x54')]({'where':{'id':_0x39aa54[_0xd6b1('0x52')]['id']}})[_0xd6b1('0x1e')](handleEntityNotFound(_0x3c005f,null))[_0xd6b1('0x1e')](removeEntity(_0x3c005f,null))[_0xd6b1('0x29')](handleError(_0x3c005f,null));};exports[_0xd6b1('0x57')]=function(_0x2c17f3,_0x5e8bac,_0xaaf2d5){var _0x1a850e={};var _0x3c4dcc={};var _0x98da8b;var _0x474bd2;return db[_0xd6b1('0x3a')]['findOne']({'where':{'id':_0x2c17f3['params']['id']}})[_0xd6b1('0x1e')](handleEntityNotFound(_0x5e8bac,null))[_0xd6b1('0x1e')](function(_0x5e5ede){if(_0x5e5ede){_0x98da8b=_0x5e5ede;_0x3c4dcc[_0xd6b1('0x3d')]=_[_0xd6b1('0x3f')](db[_0xd6b1('0x58')]['rawAttributes']);_0x3c4dcc[_0xd6b1('0x40')]=_[_0xd6b1('0x3f')](_0x2c17f3[_0xd6b1('0x40')]);_0x3c4dcc[_0xd6b1('0x49')]=_[_0xd6b1('0x42')](_0x3c4dcc[_0xd6b1('0x3d')],_0x3c4dcc[_0xd6b1('0x40')]);_0x1a850e[_0xd6b1('0x41')]=_[_0xd6b1('0x42')](_0x3c4dcc['model'],qs['fields'](_0x2c17f3[_0xd6b1('0x40')][_0xd6b1('0x43')]));_0x1a850e[_0xd6b1('0x41')]=_0x1a850e['attributes'][_0xd6b1('0x44')]?_0x1a850e[_0xd6b1('0x41')]:_0x3c4dcc['model'];_0x1a850e[_0xd6b1('0x46')]=qs[_0xd6b1('0x47')](_0x2c17f3[_0xd6b1('0x40')][_0xd6b1('0x47')]);_0x1a850e[_0xd6b1('0x48')]=qs['filters'](_[_0xd6b1('0x4a')](_0x2c17f3[_0xd6b1('0x40')],_0x3c4dcc['filters']));if(_0x2c17f3[_0xd6b1('0x40')]['filter']){_0x1a850e[_0xd6b1('0x48')]=_[_0xd6b1('0x4c')](_0x1a850e[_0xd6b1('0x48')],{'$or':_[_0xd6b1('0x39')](_0x1a850e['attributes'],function(_0x370620){var _0x163981={};_0x163981[_0x370620]={'$like':'%'+_0x2c17f3[_0xd6b1('0x40')][_0xd6b1('0x4b')]+'%'};return _0x163981;})});}_0x1a850e=_[_0xd6b1('0x4c')]({},_0x1a850e,_0x2c17f3[_0xd6b1('0x4d')]);return _0x98da8b[_0xd6b1('0x57')](_0x1a850e);}})['then'](function(_0x4e5b25){if(_0x4e5b25){_0x474bd2=_0x4e5b25[_0xd6b1('0x44')];if(!_0x2c17f3[_0xd6b1('0x40')][_0xd6b1('0x59')](_0xd6b1('0x45'))){_0x1a850e[_0xd6b1('0x30')]=qs[_0xd6b1('0x30')](_0x2c17f3['query'][_0xd6b1('0x30')]);_0x1a850e[_0xd6b1('0x2f')]=qs[_0xd6b1('0x2f')](_0x2c17f3[_0xd6b1('0x40')][_0xd6b1('0x2f')]);}return _0x98da8b['getFields'](_0x1a850e);}})[_0xd6b1('0x1e')](function(_0x50884b){if(_0x50884b){return _0x50884b?{'count':_0x474bd2,'rows':_0x50884b}:null;}})[_0xd6b1('0x1e')](respondWithResult(_0x5e8bac,null))[_0xd6b1('0x29')](handleError(_0x5e8bac,null));};exports[_0xd6b1('0x5a')]=function(_0x4fa51b,_0x2dd4c7,_0x3c8679){var _0x597438={};var _0x2b808a={};var _0x38ac1c;var _0x103d5c;return db[_0xd6b1('0x3a')][_0xd6b1('0x5b')]({'where':{'id':_0x4fa51b['params']['id']}})[_0xd6b1('0x1e')](handleEntityNotFound(_0x2dd4c7,null))[_0xd6b1('0x1e')](function(_0x1d3045){if(_0x1d3045){_0x38ac1c=_0x1d3045;_0x2b808a['model']=_[_0xd6b1('0x3f')](db[_0xd6b1('0x58')][_0xd6b1('0x53')]);_0x2b808a[_0xd6b1('0x40')]=_[_0xd6b1('0x3f')](_0x4fa51b[_0xd6b1('0x40')]);_0x2b808a[_0xd6b1('0x49')]=_[_0xd6b1('0x42')](_0x2b808a['model'],_0x2b808a['query']);_0x597438[_0xd6b1('0x41')]=_['intersection'](_0x2b808a[_0xd6b1('0x3d')],qs[_0xd6b1('0x43')](_0x4fa51b[_0xd6b1('0x40')]['fields']));_0x597438[_0xd6b1('0x41')]=_0x597438['attributes'][_0xd6b1('0x44')]?_0x597438[_0xd6b1('0x41')]:_0x2b808a[_0xd6b1('0x3d')];_0x597438[_0xd6b1('0x46')]=qs[_0xd6b1('0x47')](_0x4fa51b[_0xd6b1('0x40')][_0xd6b1('0x47')]);_0x597438[_0xd6b1('0x48')]=qs['filters'](_[_0xd6b1('0x4a')](_0x4fa51b[_0xd6b1('0x40')],_0x2b808a[_0xd6b1('0x49')]));if(_0x4fa51b[_0xd6b1('0x40')]['filter']){_0x597438['where']=_['merge'](_0x597438[_0xd6b1('0x48')],{'$or':_['map'](_0x597438['attributes'],function(_0x55e38d){var _0x4065cc={};_0x4065cc[_0x55e38d]={'$like':'%'+_0x4fa51b[_0xd6b1('0x40')][_0xd6b1('0x4b')]+'%'};return _0x4065cc;})});}_0x597438=_[_0xd6b1('0x4c')]({},_0x597438,_0x4fa51b[_0xd6b1('0x4d')]);return _0x38ac1c['getSubjects'](_0x597438);}})[_0xd6b1('0x1e')](function(_0x3b0f83){if(_0x3b0f83){_0x103d5c=_0x3b0f83[_0xd6b1('0x44')];if(!_0x4fa51b[_0xd6b1('0x40')][_0xd6b1('0x59')](_0xd6b1('0x45'))){_0x597438['limit']=qs[_0xd6b1('0x30')](_0x4fa51b[_0xd6b1('0x40')][_0xd6b1('0x30')]);_0x597438['offset']=qs[_0xd6b1('0x2f')](_0x4fa51b[_0xd6b1('0x40')]['offset']);}return _0x38ac1c['getSubjects'](_0x597438);}})[_0xd6b1('0x1e')](function(_0x4d11a4){if(_0x4d11a4){return _0x4d11a4?{'count':_0x103d5c,'rows':_0x4d11a4}:null;}})[_0xd6b1('0x1e')](respondWithResult(_0x2dd4c7,null))[_0xd6b1('0x29')](handleError(_0x2dd4c7,null));};exports[_0xd6b1('0x5c')]=function(_0x3c2e43,_0x34ec1b,_0x659201){var _0x3804ac={};var _0x422c2b={};var _0xfbdaf5;var _0x3b1539;return db[_0xd6b1('0x3a')][_0xd6b1('0x5b')]({'where':{'id':_0x3c2e43['params']['id']}})[_0xd6b1('0x1e')](handleEntityNotFound(_0x34ec1b,null))['then'](function(_0x1eb637){if(_0x1eb637){_0xfbdaf5=_0x1eb637;_0x422c2b[_0xd6b1('0x3d')]=_[_0xd6b1('0x3f')](db[_0xd6b1('0x58')][_0xd6b1('0x53')]);_0x422c2b[_0xd6b1('0x40')]=_[_0xd6b1('0x3f')](_0x3c2e43['query']);_0x422c2b[_0xd6b1('0x49')]=_[_0xd6b1('0x42')](_0x422c2b['model'],_0x422c2b[_0xd6b1('0x40')]);_0x3804ac[_0xd6b1('0x41')]=_[_0xd6b1('0x42')](_0x422c2b[_0xd6b1('0x3d')],qs['fields'](_0x3c2e43['query'][_0xd6b1('0x43')]));_0x3804ac['attributes']=_0x3804ac[_0xd6b1('0x41')]['length']?_0x3804ac[_0xd6b1('0x41')]:_0x422c2b[_0xd6b1('0x3d')];_0x3804ac['order']=qs['sort'](_0x3c2e43[_0xd6b1('0x40')][_0xd6b1('0x47')]);_0x3804ac[_0xd6b1('0x48')]=qs['filters'](_[_0xd6b1('0x4a')](_0x3c2e43['query'],_0x422c2b[_0xd6b1('0x49')]));if(_0x3c2e43['query'][_0xd6b1('0x4b')]){_0x3804ac[_0xd6b1('0x48')]=_[_0xd6b1('0x4c')](_0x3804ac['where'],{'$or':_[_0xd6b1('0x39')](_0x3804ac['attributes'],function(_0x2a37d5){var _0x394488={};_0x394488[_0x2a37d5]={'$like':'%'+_0x3c2e43['query']['filter']+'%'};return _0x394488;})});}_0x3804ac=_['merge']({},_0x3804ac,_0x3c2e43[_0xd6b1('0x4d')]);return _0xfbdaf5[_0xd6b1('0x5c')](_0x3804ac);}})[_0xd6b1('0x1e')](function(_0x3647fd){if(_0x3647fd){_0x3b1539=_0x3647fd[_0xd6b1('0x44')];if(!_0x3c2e43[_0xd6b1('0x40')]['hasOwnProperty'](_0xd6b1('0x45'))){_0x3804ac[_0xd6b1('0x30')]=qs[_0xd6b1('0x30')](_0x3c2e43[_0xd6b1('0x40')]['limit']);_0x3804ac[_0xd6b1('0x2f')]=qs[_0xd6b1('0x2f')](_0x3c2e43[_0xd6b1('0x40')][_0xd6b1('0x2f')]);}return _0xfbdaf5[_0xd6b1('0x5c')](_0x3804ac);}})[_0xd6b1('0x1e')](function(_0xd4167b){if(_0xd4167b){return _0xd4167b?{'count':_0x3b1539,'rows':_0xd4167b}:null;}})['then'](respondWithResult(_0x34ec1b,null))[_0xd6b1('0x29')](handleError(_0x34ec1b,null));};exports[_0xd6b1('0x5d')]=function(_0x223e4a,_0x59bc1e,_0x5cccf5){var _0x47d369={};var _0x36d1f2={};var _0x5d8996;var _0x3a0306;return db[_0xd6b1('0x3a')][_0xd6b1('0x5b')]({'where':{'id':_0x223e4a[_0xd6b1('0x52')]['id']}})[_0xd6b1('0x1e')](handleEntityNotFound(_0x59bc1e,null))['then'](function(_0x388272){if(_0x388272){_0x5d8996=_0x388272;_0x36d1f2[_0xd6b1('0x3d')]=_[_0xd6b1('0x3f')](db['Tag'][_0xd6b1('0x53')]);_0x36d1f2[_0xd6b1('0x40')]=_['keys'](_0x223e4a[_0xd6b1('0x40')]);_0x36d1f2[_0xd6b1('0x49')]=_['intersection'](_0x36d1f2['model'],_0x36d1f2[_0xd6b1('0x40')]);_0x47d369['attributes']=_[_0xd6b1('0x42')](_0x36d1f2[_0xd6b1('0x3d')],qs['fields'](_0x223e4a[_0xd6b1('0x40')][_0xd6b1('0x43')]));_0x47d369['attributes']=_0x47d369[_0xd6b1('0x41')][_0xd6b1('0x44')]?_0x47d369[_0xd6b1('0x41')]:_0x36d1f2[_0xd6b1('0x3d')];_0x47d369['order']=qs[_0xd6b1('0x47')](_0x223e4a[_0xd6b1('0x40')]['sort']);_0x47d369[_0xd6b1('0x48')]=qs['filters'](_[_0xd6b1('0x4a')](_0x223e4a[_0xd6b1('0x40')],_0x36d1f2[_0xd6b1('0x49')]));if(_0x223e4a[_0xd6b1('0x40')][_0xd6b1('0x4b')]){_0x47d369['where']=_[_0xd6b1('0x4c')](_0x47d369[_0xd6b1('0x48')],{'$or':_[_0xd6b1('0x39')](_0x47d369[_0xd6b1('0x41')],function(_0x30b9f4){var _0x3ac767={};_0x3ac767[_0x30b9f4]={'$like':'%'+_0x223e4a[_0xd6b1('0x40')][_0xd6b1('0x4b')]+'%'};return _0x3ac767;})});}_0x47d369=_[_0xd6b1('0x4c')]({},_0x47d369,_0x223e4a[_0xd6b1('0x4d')]);return _0x5d8996[_0xd6b1('0x5d')](_0x47d369);}})[_0xd6b1('0x1e')](function(_0x565432){if(_0x565432){_0x3a0306=_0x565432[_0xd6b1('0x44')];if(!_0x223e4a[_0xd6b1('0x40')][_0xd6b1('0x59')](_0xd6b1('0x45'))){_0x47d369[_0xd6b1('0x30')]=qs[_0xd6b1('0x30')](_0x223e4a['query'][_0xd6b1('0x30')]);_0x47d369[_0xd6b1('0x2f')]=qs[_0xd6b1('0x2f')](_0x223e4a[_0xd6b1('0x40')][_0xd6b1('0x2f')]);}return _0x5d8996['getTags'](_0x47d369);}})[_0xd6b1('0x1e')](function(_0x5cb128){if(_0x5cb128){return _0x5cb128?{'count':_0x3a0306,'rows':_0x5cb128}:null;}})['then'](respondWithResult(_0x59bc1e,null))[_0xd6b1('0x29')](handleError(_0x59bc1e,null));};exports[_0xd6b1('0x5e')]=function(_0xd34f08,_0x24b6bf,_0x35f04b){if(_0xd34f08[_0xd6b1('0x56')]['id']){delete _0xd34f08['body']['id'];}return db[_0xd6b1('0x3a')]['findOne']({'where':{'id':_0xd34f08[_0xd6b1('0x52')]['id']}})[_0xd6b1('0x1e')](handleEntityNotFound(_0x24b6bf,null))[_0xd6b1('0x1e')](function(_0x4b77de){if(_0x4b77de){return _0x4b77de['setTags'](_0xd34f08[_0xd6b1('0x56')]['ids']||[]);}return null;})[_0xd6b1('0x1e')](respondWithResult(_0x24b6bf,null))[_0xd6b1('0x29')](handleError(_0x24b6bf,null));};
\ No newline at end of file
diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js
index efb3d65..5a2edb9 100644
--- a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js
+++ b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xabce=['util','../../config/logger','api','moment','path','rimraf','../../config/environment','define','int_freshdesk_configurations','lodash'];(function(_0x3c093a,_0x5db48e){var _0xd278c9=function(_0xbf8b3b){while(--_0xbf8b3b){_0x3c093a['push'](_0x3c093a['shift']());}};_0xd278c9(++_0x5db48e);}(_0xabce,0x103));var _0xeabc=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xabce[_0x501510];return _0x1e6ee5;};'use strict';var _=require(_0xeabc('0x0'));var util=require(_0xeabc('0x1'));var logger=require(_0xeabc('0x2'))(_0xeabc('0x3'));var moment=require(_0xeabc('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xeabc('0x5'));var rimraf=require(_0xeabc('0x6'));var config=require(_0xeabc('0x7'));var attributes=require('./intFreshdeskConfiguration.attributes');module['exports']=function(_0x1b07a8,_0x52a4d7){return _0x1b07a8[_0xeabc('0x8')]('FreshdeskConfiguration',attributes,{'tableName':_0xeabc('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x9957=['exports','define','FreshdeskConfiguration','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./intFreshdeskConfiguration.attributes'];(function(_0x31ced5,_0x5d5415){var _0x10d9e5=function(_0x2e51a5){while(--_0x2e51a5){_0x31ced5['push'](_0x31ced5['shift']());}};_0x10d9e5(++_0x5d5415);}(_0x9957,0x93));var _0x7995=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x9957[_0x4cf98e];return _0x1623ac;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'int_freshdesk_configurations','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.rpc.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.rpc.js
index ddfaf23..c15301f 100644
--- a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.rpc.js
+++ b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xbcda=['catch','lodash','util','moment','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request','info','FreshdeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x110c3d,_0x12ee06){var _0x226d67=function(_0x1fb6e1){while(--_0x1fb6e1){_0x110c3d['push'](_0x110c3d['shift']());}};_0x226d67(++_0x12ee06);}(_0xbcda,0x190));var _0xabcd=function(_0xbe200f,_0x4b50eb){_0xbe200f=_0xbe200f-0x0;var _0x192597=_0xbcda[_0xbe200f];return _0x192597;};'use strict';var _=require(_0xabcd('0x0'));var util=require(_0xabcd('0x1'));var moment=require(_0xabcd('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xabcd('0x3'));var db=require(_0xabcd('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xabcd('0x5'))(_0xabcd('0x6'));var config=require(_0xabcd('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xabcd('0x8')][_0xabcd('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x15c817,_0x3f6199,_0xaa0962){return new BPromise(function(_0x21b25a,_0x1668ca){return client[_0xabcd('0xa')](_0x15c817,_0xaa0962)['then'](function(_0x2a9982){logger[_0xabcd('0xb')](_0xabcd('0xc'),_0x3f6199,_0xabcd('0xd'));logger[_0xabcd('0xe')](_0xabcd('0xf'),_0x3f6199,_0xabcd('0xd'),JSON[_0xabcd('0x10')](_0x2a9982));if(_0x2a9982[_0xabcd('0x11')]){if(_0x2a9982[_0xabcd('0x11')][_0xabcd('0x12')]===0x1f4){logger['error']('FreshdeskConfiguration,\x20%s,\x20%s',_0x3f6199,_0x2a9982[_0xabcd('0x11')][_0xabcd('0x13')]);return _0x1668ca(_0x2a9982[_0xabcd('0x11')][_0xabcd('0x13')]);}logger[_0xabcd('0x11')](_0xabcd('0xc'),_0x3f6199,_0x2a9982[_0xabcd('0x11')][_0xabcd('0x13')]);return _0x21b25a(_0x2a9982[_0xabcd('0x11')]['message']);}else{logger[_0xabcd('0xb')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x3f6199,_0xabcd('0xd'));_0x21b25a(_0x2a9982['result'][_0xabcd('0x13')]);}})[_0xabcd('0x14')](function(_0x39b67e){logger['error'](_0xabcd('0xc'),_0x3f6199,_0x39b67e);_0x1668ca(_0x39b67e);});});}
\ No newline at end of file
+var _0x9204=['FreshdeskConfiguration,\x20%s,\x20%s','request\x20sent','stringify','error','message','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info'];(function(_0x535fb4,_0x4c60bb){var _0x3da227=function(_0x374fde){while(--_0x374fde){_0x535fb4['push'](_0x535fb4['shift']());}};_0x3da227(++_0x4c60bb);}(_0x9204,0x9e));var _0x4920=function(_0x1d9974,_0x3ededa){_0x1d9974=_0x1d9974-0x0;var _0x4cb52f=_0x9204[_0x1d9974];return _0x4cb52f;};'use strict';var _=require(_0x4920('0x0'));var util=require(_0x4920('0x1'));var moment=require(_0x4920('0x2'));var BPromise=require('bluebird');var rs=require(_0x4920('0x3'));var fs=require('fs');var Redis=require(_0x4920('0x4'));var db=require(_0x4920('0x5'))['db'];var utils=require(_0x4920('0x6'));var logger=require(_0x4920('0x7'))(_0x4920('0x8'));var config=require(_0x4920('0x9'));var jayson=require(_0x4920('0xa'));var client=jayson['client'][_0x4920('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x133e22,_0x20b212,_0x4d90ad){return new BPromise(function(_0x21f3ce,_0x530bab){return client['request'](_0x133e22,_0x4d90ad)['then'](function(_0x511e13){logger[_0x4920('0xc')](_0x4920('0xd'),_0x20b212,_0x4920('0xe'));logger['debug']('FreshdeskConfiguration,\x20%s,\x20%s,\x20%s',_0x20b212,_0x4920('0xe'),JSON[_0x4920('0xf')](_0x511e13));if(_0x511e13['error']){if(_0x511e13[_0x4920('0x10')]['code']===0x1f4){logger[_0x4920('0x10')](_0x4920('0xd'),_0x20b212,_0x511e13['error'][_0x4920('0x11')]);return _0x530bab(_0x511e13[_0x4920('0x10')][_0x4920('0x11')]);}logger['error'](_0x4920('0xd'),_0x20b212,_0x511e13[_0x4920('0x10')][_0x4920('0x11')]);return _0x21f3ce(_0x511e13['error'][_0x4920('0x11')]);}else{logger[_0x4920('0xc')](_0x4920('0xd'),_0x20b212,_0x4920('0xe'));_0x21f3ce(_0x511e13['result'][_0x4920('0x11')]);}})[_0x4920('0x12')](function(_0x163ee7){logger[_0x4920('0x10')](_0x4920('0xd'),_0x20b212,_0x163ee7);_0x530bab(_0x163ee7);});});}
\ No newline at end of file
diff --git a/server/api/intFreshdeskField/index.js b/server/api/intFreshdeskField/index.js
index 4238522..d0c91b6 100644
--- a/server/api/intFreshdeskField/index.js
+++ b/server/api/intFreshdeskField/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x3e74=['connect-timeout','express','../../components/interaction/service','./intFreshdeskField.controller','get','isAuthenticated','index','show','post','create','/:id','delete','destroy','multer','path'];(function(_0x286beb,_0x47982e){var _0x20b3b9=function(_0x40daee){while(--_0x40daee){_0x286beb['push'](_0x286beb['shift']());}};_0x20b3b9(++_0x47982e);}(_0x3e74,0x175));var _0x43e7=function(_0x178b22,_0x217ec2){_0x178b22=_0x178b22-0x0;var _0xc9b826=_0x3e74[_0x178b22];return _0xc9b826;};'use strict';var multer=require(_0x43e7('0x0'));var util=require('util');var path=require(_0x43e7('0x1'));var timeout=require(_0x43e7('0x2'));var express=require(_0x43e7('0x3'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x43e7('0x4'));var config=require('../../config/environment');var controller=require(_0x43e7('0x5'));router[_0x43e7('0x6')]('/',auth[_0x43e7('0x7')](),controller[_0x43e7('0x8')]);router[_0x43e7('0x6')]('/:id',auth[_0x43e7('0x7')](),controller[_0x43e7('0x9')]);router[_0x43e7('0xa')]('/',auth[_0x43e7('0x7')](),controller[_0x43e7('0xb')]);router['put'](_0x43e7('0xc'),auth['isAuthenticated'](),controller['update']);router[_0x43e7('0xd')](_0x43e7('0xc'),auth['isAuthenticated'](),controller[_0x43e7('0xe')]);module['exports']=router;
\ No newline at end of file
+var _0x9c44=['/:id','isAuthenticated','show','create','put','delete','destroy','exports','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','get','index'];(function(_0x2d48fa,_0x103065){var _0x4645b7=function(_0x5c8751){while(--_0x5c8751){_0x2d48fa['push'](_0x2d48fa['shift']());}};_0x4645b7(++_0x103065);}(_0x9c44,0x178));var _0x49c4=function(_0x3b0731,_0xcf9925){_0x3b0731=_0x3b0731-0x0;var _0x4204d7=_0x9c44[_0x3b0731];return _0x4204d7;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var auth=require(_0x49c4('0x4'));var interaction=require(_0x49c4('0x5'));var config=require('../../config/environment');var controller=require('./intFreshdeskField.controller');router[_0x49c4('0x6')]('/',auth['isAuthenticated'](),controller[_0x49c4('0x7')]);router[_0x49c4('0x6')](_0x49c4('0x8'),auth[_0x49c4('0x9')](),controller[_0x49c4('0xa')]);router['post']('/',auth[_0x49c4('0x9')](),controller[_0x49c4('0xb')]);router[_0x49c4('0xc')](_0x49c4('0x8'),auth['isAuthenticated'](),controller['update']);router[_0x49c4('0xd')](_0x49c4('0x8'),auth['isAuthenticated'](),controller[_0x49c4('0xe')]);module[_0x49c4('0xf')]=router;
\ No newline at end of file
diff --git a/server/api/intFreshdeskField/intFreshdeskField.attributes.js b/server/api/intFreshdeskField/intFreshdeskField.attributes.js
index 48947c2..687ba44 100644
--- a/server/api/intFreshdeskField/intFreshdeskField.attributes.js
+++ b/server/api/intFreshdeskField/intFreshdeskField.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x029b=['string','variable','keyValue','ENUM','customVariable','STRING','sequelize','exports'];(function(_0x4112fb,_0x40d0c0){var _0x227ab4=function(_0x1765e4){while(--_0x1765e4){_0x4112fb['push'](_0x4112fb['shift']());}};_0x227ab4(++_0x40d0c0);}(_0x029b,0x66));var _0xb029=function(_0x26266d,_0x514c4e){_0x26266d=_0x26266d-0x0;var _0x4738ef=_0x029b[_0x26266d];return _0x4738ef;};'use strict';var Sequelize=require(_0xb029('0x0'));module[_0xb029('0x1')]={'type':{'type':Sequelize['ENUM'](_0xb029('0x2'),_0xb029('0x3'),'customVariable',_0xb029('0x4')),'defaultValue':_0xb029('0x2')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0xb029('0x5')](_0xb029('0x2'),_0xb029('0x3'),_0xb029('0x6'))},'keyContent':{'type':Sequelize[_0xb029('0x7')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0xb029('0x7')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xb029('0x7')]}};
\ No newline at end of file
+var _0x297b=['string','variable','STRING','sequelize','ENUM'];(function(_0x272ac4,_0x399959){var _0x43167d=function(_0x52e1f5){while(--_0x52e1f5){_0x272ac4['push'](_0x272ac4['shift']());}};_0x43167d(++_0x399959);}(_0x297b,0x85));var _0xb297=function(_0x4e676e,_0x2a7c6d){_0x4e676e=_0x4e676e-0x0;var _0x336a3c=_0x297b[_0x4e676e];return _0x336a3c;};'use strict';var Sequelize=require(_0xb297('0x0'));module['exports']={'type':{'type':Sequelize[_0xb297('0x1')](_0xb297('0x2'),_0xb297('0x3'),'customVariable','keyValue'),'defaultValue':_0xb297('0x2')},'content':{'type':Sequelize[_0xb297('0x4')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0xb297('0x1')](_0xb297('0x2'),'variable','customVariable')},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0xb297('0x4')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xb297('0x4')]}};
\ No newline at end of file
diff --git a/server/api/intFreshdeskField/intFreshdeskField.controller.js b/server/api/intFreshdeskField/intFreshdeskField.controller.js
index 82e79ab..d4cf268 100644
--- a/server/api/intFreshdeskField/intFreshdeskField.controller.js
+++ b/server/api/intFreshdeskField/intFreshdeskField.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xdb68=['catch','show','params','keys','fields','find','create','body','html-pdf','eml-format','rimraf','moment','path','sox','to-csv','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','count','offset','set','Content-Range','reject','save','update','then','destroy','stack','name','index','map','FreshdeskField','rawAttributes','type','key','model','filters','intersection','query','attributes','length','hasOwnProperty','nolimit','limit','order','sort','pick','filter','where','VIRTUAL','merge','options','includeAll','include','findAll'];(function(_0x8cb2f9,_0x2b8706){var _0x164887=function(_0x1812cc){while(--_0x1812cc){_0x8cb2f9['push'](_0x8cb2f9['shift']());}};_0x164887(++_0x2b8706);}(_0xdb68,0x92));var _0x8db6=function(_0xdeefbd,_0x9e1b3d){_0xdeefbd=_0xdeefbd-0x0;var _0x4ff63f=_0xdb68[_0xdeefbd];return _0x4ff63f;};'use strict';var pdf=require(_0x8db6('0x0'));var emlformat=require(_0x8db6('0x1'));var rimraf=require(_0x8db6('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x8db6('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x8db6('0x4'));var sox=require(_0x8db6('0x5'));var csv=require(_0x8db6('0x6'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x8db6('0x7'));var squel=require(_0x8db6('0x8'));var crypto=require('crypto');var jsforce=require(_0x8db6('0x9'));var deskjs=require(_0x8db6('0xa'));var toCsv=require(_0x8db6('0x6'));var querystring=require(_0x8db6('0xb'));var Papa=require(_0x8db6('0xc'));var Redis=require('ioredis');var authService=require(_0x8db6('0xd'));var qs=require('../../components/parsers/qs');var as=require(_0x8db6('0xe'));var hardwareService=require(_0x8db6('0xf'));var logger=require(_0x8db6('0x10'))(_0x8db6('0x11'));var utils=require(_0x8db6('0x12'));var config=require(_0x8db6('0x13'));var db=require(_0x8db6('0x14'))['db'];function respondWithStatusCode(_0x81e036,_0x79ad5d){_0x79ad5d=_0x79ad5d||0xcc;return function(_0xb48385){if(_0xb48385){return _0x81e036['sendStatus'](_0x79ad5d);}return _0x81e036[_0x8db6('0x15')](_0x79ad5d)[_0x8db6('0x16')]();};}function respondWithResult(_0x59076b,_0x526ef9){_0x526ef9=_0x526ef9||0xc8;return function(_0x20a398){if(_0x20a398){return _0x59076b[_0x8db6('0x15')](_0x526ef9)[_0x8db6('0x17')](_0x20a398);}};}function respondWithFilteredResult(_0x3f9809,_0x13c10a){return function(_0x1dd89c){if(_0x1dd89c){var _0x28da59=_0x1dd89c[_0x8db6('0x18')],_0x124a49=_0x13c10a[_0x8db6('0x19')],_0x4d4917=_0x13c10a['offset']+_0x13c10a['limit'],_0x4f2c12;if(_0x4d4917>=_0x28da59){_0x4d4917=_0x28da59;_0x4f2c12=0xc8;}else{_0x4f2c12=0xce;}_0x3f9809[_0x8db6('0x15')](_0x4f2c12);return _0x3f9809[_0x8db6('0x1a')](_0x8db6('0x1b'),_0x124a49+'-'+_0x4d4917+'/'+_0x28da59)[_0x8db6('0x17')](_0x1dd89c);}return null;};}function patchUpdates(_0xca2de1){return function(_0x5ce157){try{jsonpatch['apply'](_0x5ce157,_0xca2de1,!![]);}catch(_0x36a5f6){return BPromise[_0x8db6('0x1c')](_0x36a5f6);}return _0x5ce157[_0x8db6('0x1d')]();};}function saveUpdates(_0x4c9221,_0x1f2ddd){return function(_0x474040){if(_0x474040){return _0x474040[_0x8db6('0x1e')](_0x4c9221)[_0x8db6('0x1f')](function(_0x1775d3){return _0x1775d3;});}return null;};}function removeEntity(_0x5ae69f,_0x5dda78){return function(_0x44932b){if(_0x44932b){return _0x44932b[_0x8db6('0x20')]()[_0x8db6('0x1f')](function(){_0x5ae69f[_0x8db6('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1e3490,_0x5c9aaa){return function(_0x532cd1){if(!_0x532cd1){_0x1e3490['sendStatus'](0x194);}return _0x532cd1;};}function handleError(_0xaed34c,_0x29b397){_0x29b397=_0x29b397||0x1f4;return function(_0x40f585){logger['error'](_0x40f585[_0x8db6('0x21')]);if(_0x40f585[_0x8db6('0x22')]){delete _0x40f585[_0x8db6('0x22')];}_0xaed34c[_0x8db6('0x15')](_0x29b397)['send'](_0x40f585);};}exports[_0x8db6('0x23')]=function(_0x5a32b8,_0x269575){var _0x1d6e74={},_0x367581={},_0xe412a5={'count':0x0,'rows':[]};var _0x4dedf1=_[_0x8db6('0x24')](db[_0x8db6('0x25')][_0x8db6('0x26')],function(_0x323ee5){return{'name':_0x323ee5['fieldName'],'type':_0x323ee5[_0x8db6('0x27')][_0x8db6('0x28')]};});_0x367581[_0x8db6('0x29')]=_[_0x8db6('0x24')](_0x4dedf1,_0x8db6('0x22'));_0x367581['query']=_['keys'](_0x5a32b8['query']);_0x367581[_0x8db6('0x2a')]=_[_0x8db6('0x2b')](_0x367581['model'],_0x367581[_0x8db6('0x2c')]);_0x1d6e74[_0x8db6('0x2d')]=_['intersection'](_0x367581[_0x8db6('0x29')],qs['fields'](_0x5a32b8[_0x8db6('0x2c')]['fields']));_0x1d6e74[_0x8db6('0x2d')]=_0x1d6e74[_0x8db6('0x2d')][_0x8db6('0x2e')]?_0x1d6e74[_0x8db6('0x2d')]:_0x367581['model'];if(!_0x5a32b8[_0x8db6('0x2c')][_0x8db6('0x2f')](_0x8db6('0x30'))){_0x1d6e74['limit']=qs[_0x8db6('0x31')](_0x5a32b8[_0x8db6('0x2c')][_0x8db6('0x31')]);_0x1d6e74[_0x8db6('0x19')]=qs[_0x8db6('0x19')](_0x5a32b8[_0x8db6('0x2c')][_0x8db6('0x19')]);}_0x1d6e74[_0x8db6('0x32')]=qs['sort'](_0x5a32b8[_0x8db6('0x2c')][_0x8db6('0x33')]);_0x1d6e74['where']=qs[_0x8db6('0x2a')](_[_0x8db6('0x34')](_0x5a32b8[_0x8db6('0x2c')],_0x367581[_0x8db6('0x2a')]),_0x4dedf1);if(_0x5a32b8[_0x8db6('0x2c')][_0x8db6('0x35')]){_0x1d6e74[_0x8db6('0x36')]=_['merge'](_0x1d6e74[_0x8db6('0x36')],{'$or':_[_0x8db6('0x24')](_0x4dedf1,function(_0x28691a){if(_0x28691a[_0x8db6('0x27')]!==_0x8db6('0x37')){var _0x51fab7={};_0x51fab7[_0x28691a[_0x8db6('0x22')]]={'$like':'%'+_0x5a32b8[_0x8db6('0x2c')]['filter']+'%'};return _0x51fab7;}})});}_0x1d6e74=_[_0x8db6('0x38')]({},_0x1d6e74,_0x5a32b8[_0x8db6('0x39')]);var _0x390689={'where':_0x1d6e74[_0x8db6('0x36')]};return db[_0x8db6('0x25')]['count'](_0x390689)[_0x8db6('0x1f')](function(_0x52ac19){_0xe412a5['count']=_0x52ac19;if(_0x5a32b8['query'][_0x8db6('0x3a')]){_0x1d6e74[_0x8db6('0x3b')]=[{'all':!![]}];}return db[_0x8db6('0x25')][_0x8db6('0x3c')](_0x1d6e74);})['then'](function(_0x334b2c){_0xe412a5['rows']=_0x334b2c;return _0xe412a5;})[_0x8db6('0x1f')](respondWithFilteredResult(_0x269575,_0x1d6e74))[_0x8db6('0x3d')](handleError(_0x269575,null));};exports[_0x8db6('0x3e')]=function(_0x2d8631,_0x50fd58){var _0x193d59={'raw':!![],'where':{'id':_0x2d8631[_0x8db6('0x3f')]['id']}},_0x1ae49b={};_0x1ae49b['model']=_[_0x8db6('0x40')](db[_0x8db6('0x25')][_0x8db6('0x26')]);_0x1ae49b[_0x8db6('0x2c')]=_[_0x8db6('0x40')](_0x2d8631[_0x8db6('0x2c')]);_0x1ae49b[_0x8db6('0x2a')]=_['intersection'](_0x1ae49b['model'],_0x1ae49b[_0x8db6('0x2c')]);_0x193d59[_0x8db6('0x2d')]=_[_0x8db6('0x2b')](_0x1ae49b[_0x8db6('0x29')],qs[_0x8db6('0x41')](_0x2d8631[_0x8db6('0x2c')][_0x8db6('0x41')]));_0x193d59[_0x8db6('0x2d')]=_0x193d59[_0x8db6('0x2d')][_0x8db6('0x2e')]?_0x193d59[_0x8db6('0x2d')]:_0x1ae49b[_0x8db6('0x29')];if(_0x2d8631[_0x8db6('0x2c')][_0x8db6('0x3a')]){_0x193d59[_0x8db6('0x3b')]=[{'all':!![]}];}_0x193d59=_[_0x8db6('0x38')]({},_0x193d59,_0x2d8631[_0x8db6('0x39')]);return db[_0x8db6('0x25')][_0x8db6('0x42')](_0x193d59)[_0x8db6('0x1f')](handleEntityNotFound(_0x50fd58,null))[_0x8db6('0x1f')](respondWithResult(_0x50fd58,null))[_0x8db6('0x3d')](handleError(_0x50fd58,null));};exports['create']=function(_0x73dfe7,_0x1106d7){return db['FreshdeskField'][_0x8db6('0x43')](_0x73dfe7[_0x8db6('0x44')],{})[_0x8db6('0x1f')](respondWithResult(_0x1106d7,0xc9))[_0x8db6('0x3d')](handleError(_0x1106d7,null));};exports[_0x8db6('0x1e')]=function(_0x5bdfa1,_0x1657b7){if(_0x5bdfa1[_0x8db6('0x44')]['id']){delete _0x5bdfa1[_0x8db6('0x44')]['id'];}return db[_0x8db6('0x25')][_0x8db6('0x42')]({'where':{'id':_0x5bdfa1[_0x8db6('0x3f')]['id']}})['then'](handleEntityNotFound(_0x1657b7,null))[_0x8db6('0x1f')](saveUpdates(_0x5bdfa1[_0x8db6('0x44')],null))[_0x8db6('0x1f')](respondWithResult(_0x1657b7,null))[_0x8db6('0x3d')](handleError(_0x1657b7,null));};exports[_0x8db6('0x20')]=function(_0x4cd7dc,_0x593429){return db[_0x8db6('0x25')]['find']({'where':{'id':_0x4cd7dc[_0x8db6('0x3f')]['id']}})['then'](handleEntityNotFound(_0x593429,null))[_0x8db6('0x1f')](removeEntity(_0x593429,null))[_0x8db6('0x3d')](handleError(_0x593429,null));};
\ No newline at end of file
+var _0x4d02=['model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','offset','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','rows','catch','show','rawAttributes','create','update','body','find','params','rimraf','zip-dir','fast-json-patch','request-promise','util','path','ejs','lodash','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','count','limit','set','json','apply','save','then','destroy','end','sendStatus','error','stack','name','send','index','map','FreshdeskField','fieldName','type','key'];(function(_0x38854e,_0x23cbc9){var _0x3f8415=function(_0x4e493e){while(--_0x4e493e){_0x38854e['push'](_0x38854e['shift']());}};_0x3f8415(++_0x23cbc9);}(_0x4d02,0x142));var _0x24d0=function(_0x48b99d,_0x5bacc5){_0x48b99d=_0x48b99d-0x0;var _0x162026=_0x4d02[_0x48b99d];return _0x162026;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x24d0('0x0'));var zipdir=require(_0x24d0('0x1'));var jsonpatch=require(_0x24d0('0x2'));var rp=require(_0x24d0('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x24d0('0x4'));var path=require(_0x24d0('0x5'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x24d0('0x6'));var fs=require('fs');var _=require(_0x24d0('0x7'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x24d0('0x8'));var deskjs=require(_0x24d0('0x9'));var toCsv=require(_0x24d0('0xa'));var querystring=require(_0x24d0('0xb'));var Papa=require(_0x24d0('0xc'));var Redis=require(_0x24d0('0xd'));var authService=require(_0x24d0('0xe'));var qs=require(_0x24d0('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x24d0('0x10'));var logger=require(_0x24d0('0x11'))(_0x24d0('0x12'));var utils=require(_0x24d0('0x13'));var config=require(_0x24d0('0x14'));var db=require(_0x24d0('0x15'))['db'];function respondWithStatusCode(_0x9815d7,_0x241da7){_0x241da7=_0x241da7||0xcc;return function(_0x29c554){if(_0x29c554){return _0x9815d7['sendStatus'](_0x241da7);}return _0x9815d7[_0x24d0('0x16')](_0x241da7)['end']();};}function respondWithResult(_0x21d2ae,_0x2b45f3){_0x2b45f3=_0x2b45f3||0xc8;return function(_0x3c89cf){if(_0x3c89cf){return _0x21d2ae[_0x24d0('0x16')](_0x2b45f3)['json'](_0x3c89cf);}};}function respondWithFilteredResult(_0x6d52cd,_0x1aa392){return function(_0xd88607){if(_0xd88607){var _0x6c902=_0xd88607[_0x24d0('0x17')],_0x59af22=_0x1aa392['offset'],_0x484d7a=_0x1aa392['offset']+_0x1aa392[_0x24d0('0x18')],_0x595e8b;if(_0x484d7a>=_0x6c902){_0x484d7a=_0x6c902;_0x595e8b=0xc8;}else{_0x595e8b=0xce;}_0x6d52cd[_0x24d0('0x16')](_0x595e8b);return _0x6d52cd[_0x24d0('0x19')]('Content-Range',_0x59af22+'-'+_0x484d7a+'/'+_0x6c902)[_0x24d0('0x1a')](_0xd88607);}return null;};}function patchUpdates(_0x38a44b){return function(_0x37a90a){try{jsonpatch[_0x24d0('0x1b')](_0x37a90a,_0x38a44b,!![]);}catch(_0x445da5){return BPromise['reject'](_0x445da5);}return _0x37a90a[_0x24d0('0x1c')]();};}function saveUpdates(_0x24b985,_0x48e1ef){return function(_0x268038){if(_0x268038){return _0x268038['update'](_0x24b985)[_0x24d0('0x1d')](function(_0x4d1a06){return _0x4d1a06;});}return null;};}function removeEntity(_0x55ce03,_0x3a3f66){return function(_0x528785){if(_0x528785){return _0x528785[_0x24d0('0x1e')]()[_0x24d0('0x1d')](function(){_0x55ce03['status'](0xcc)[_0x24d0('0x1f')]();});}};}function handleEntityNotFound(_0x2a40ea,_0x33879d){return function(_0x581f44){if(!_0x581f44){_0x2a40ea[_0x24d0('0x20')](0x194);}return _0x581f44;};}function handleError(_0xa20fd5,_0x15b628){_0x15b628=_0x15b628||0x1f4;return function(_0x297f5a){logger[_0x24d0('0x21')](_0x297f5a[_0x24d0('0x22')]);if(_0x297f5a[_0x24d0('0x23')]){delete _0x297f5a[_0x24d0('0x23')];}_0xa20fd5[_0x24d0('0x16')](_0x15b628)[_0x24d0('0x24')](_0x297f5a);};}exports[_0x24d0('0x25')]=function(_0x5dec7b,_0x3c40ba){var _0x5edbc0={},_0x2d2499={},_0x5e4cae={'count':0x0,'rows':[]};var _0xc12fbc=_[_0x24d0('0x26')](db[_0x24d0('0x27')]['rawAttributes'],function(_0x558fa9){return{'name':_0x558fa9[_0x24d0('0x28')],'type':_0x558fa9[_0x24d0('0x29')][_0x24d0('0x2a')]};});_0x2d2499[_0x24d0('0x2b')]=_[_0x24d0('0x26')](_0xc12fbc,_0x24d0('0x23'));_0x2d2499['query']=_[_0x24d0('0x2c')](_0x5dec7b[_0x24d0('0x2d')]);_0x2d2499[_0x24d0('0x2e')]=_[_0x24d0('0x2f')](_0x2d2499[_0x24d0('0x2b')],_0x2d2499[_0x24d0('0x2d')]);_0x5edbc0[_0x24d0('0x30')]=_['intersection'](_0x2d2499[_0x24d0('0x2b')],qs[_0x24d0('0x31')](_0x5dec7b[_0x24d0('0x2d')][_0x24d0('0x31')]));_0x5edbc0[_0x24d0('0x30')]=_0x5edbc0[_0x24d0('0x30')][_0x24d0('0x32')]?_0x5edbc0['attributes']:_0x2d2499['model'];if(!_0x5dec7b[_0x24d0('0x2d')][_0x24d0('0x33')](_0x24d0('0x34'))){_0x5edbc0[_0x24d0('0x18')]=qs['limit'](_0x5dec7b[_0x24d0('0x2d')][_0x24d0('0x18')]);_0x5edbc0[_0x24d0('0x35')]=qs['offset'](_0x5dec7b[_0x24d0('0x2d')][_0x24d0('0x35')]);}_0x5edbc0[_0x24d0('0x36')]=qs[_0x24d0('0x37')](_0x5dec7b[_0x24d0('0x2d')][_0x24d0('0x37')]);_0x5edbc0['where']=qs[_0x24d0('0x2e')](_[_0x24d0('0x38')](_0x5dec7b['query'],_0x2d2499[_0x24d0('0x2e')]),_0xc12fbc);if(_0x5dec7b['query'][_0x24d0('0x39')]){_0x5edbc0[_0x24d0('0x3a')]=_[_0x24d0('0x3b')](_0x5edbc0[_0x24d0('0x3a')],{'$or':_[_0x24d0('0x26')](_0xc12fbc,function(_0x112802){if(_0x112802[_0x24d0('0x29')]!==_0x24d0('0x3c')){var _0x4859c3={};_0x4859c3[_0x112802['name']]={'$like':'%'+_0x5dec7b[_0x24d0('0x2d')]['filter']+'%'};return _0x4859c3;}})});}_0x5edbc0=_[_0x24d0('0x3b')]({},_0x5edbc0,_0x5dec7b[_0x24d0('0x3d')]);var _0x143a5f={'where':_0x5edbc0[_0x24d0('0x3a')]};return db[_0x24d0('0x27')][_0x24d0('0x17')](_0x143a5f)[_0x24d0('0x1d')](function(_0x44cebe){_0x5e4cae[_0x24d0('0x17')]=_0x44cebe;if(_0x5dec7b['query'][_0x24d0('0x3e')]){_0x5edbc0[_0x24d0('0x3f')]=[{'all':!![]}];}return db[_0x24d0('0x27')]['findAll'](_0x5edbc0);})[_0x24d0('0x1d')](function(_0x586c3f){_0x5e4cae[_0x24d0('0x40')]=_0x586c3f;return _0x5e4cae;})['then'](respondWithFilteredResult(_0x3c40ba,_0x5edbc0))[_0x24d0('0x41')](handleError(_0x3c40ba,null));};exports[_0x24d0('0x42')]=function(_0x274439,_0x204ec7){var _0x467e87={'raw':!![],'where':{'id':_0x274439['params']['id']}},_0x1d0ab5={};_0x1d0ab5[_0x24d0('0x2b')]=_[_0x24d0('0x2c')](db[_0x24d0('0x27')][_0x24d0('0x43')]);_0x1d0ab5['query']=_['keys'](_0x274439[_0x24d0('0x2d')]);_0x1d0ab5['filters']=_[_0x24d0('0x2f')](_0x1d0ab5[_0x24d0('0x2b')],_0x1d0ab5[_0x24d0('0x2d')]);_0x467e87['attributes']=_[_0x24d0('0x2f')](_0x1d0ab5['model'],qs[_0x24d0('0x31')](_0x274439[_0x24d0('0x2d')]['fields']));_0x467e87[_0x24d0('0x30')]=_0x467e87[_0x24d0('0x30')][_0x24d0('0x32')]?_0x467e87['attributes']:_0x1d0ab5[_0x24d0('0x2b')];if(_0x274439[_0x24d0('0x2d')][_0x24d0('0x3e')]){_0x467e87['include']=[{'all':!![]}];}_0x467e87=_[_0x24d0('0x3b')]({},_0x467e87,_0x274439[_0x24d0('0x3d')]);return db[_0x24d0('0x27')]['find'](_0x467e87)[_0x24d0('0x1d')](handleEntityNotFound(_0x204ec7,null))[_0x24d0('0x1d')](respondWithResult(_0x204ec7,null))[_0x24d0('0x41')](handleError(_0x204ec7,null));};exports[_0x24d0('0x44')]=function(_0x5a8f44,_0xd35985){return db[_0x24d0('0x27')][_0x24d0('0x44')](_0x5a8f44['body'],{})['then'](respondWithResult(_0xd35985,0xc9))['catch'](handleError(_0xd35985,null));};exports[_0x24d0('0x45')]=function(_0x3655d5,_0x5d9070){if(_0x3655d5[_0x24d0('0x46')]['id']){delete _0x3655d5[_0x24d0('0x46')]['id'];}return db['FreshdeskField'][_0x24d0('0x47')]({'where':{'id':_0x3655d5[_0x24d0('0x48')]['id']}})[_0x24d0('0x1d')](handleEntityNotFound(_0x5d9070,null))[_0x24d0('0x1d')](saveUpdates(_0x3655d5['body'],null))[_0x24d0('0x1d')](respondWithResult(_0x5d9070,null))[_0x24d0('0x41')](handleError(_0x5d9070,null));};exports[_0x24d0('0x1e')]=function(_0xcfb675,_0x3522a0){return db[_0x24d0('0x27')]['find']({'where':{'id':_0xcfb675[_0x24d0('0x48')]['id']}})[_0x24d0('0x1d')](handleEntityNotFound(_0x3522a0,null))[_0x24d0('0x1d')](removeEntity(_0x3522a0,null))[_0x24d0('0x41')](handleError(_0x3522a0,null));};
\ No newline at end of file
diff --git a/server/api/intFreshdeskField/intFreshdeskField.model.js b/server/api/intFreshdeskField/intFreshdeskField.model.js
index e278c7d..ca34562 100644
--- a/server/api/intFreshdeskField/intFreshdeskField.model.js
+++ b/server/api/intFreshdeskField/intFreshdeskField.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x47ee=['define','int_freshdesk_fields','freshdesk_unique_index','idField','util','api','request-promise','path','../../config/environment','./intFreshdeskField.attributes','exports'];(function(_0x183a9b,_0x296e80){var _0x21f4e4=function(_0x4b4fa4){while(--_0x4b4fa4){_0x183a9b['push'](_0x183a9b['shift']());}};_0x21f4e4(++_0x296e80);}(_0x47ee,0xeb));var _0xe47e=function(_0x4326fd,_0x226fad){_0x4326fd=_0x4326fd-0x0;var _0x5bc652=_0x47ee[_0x4326fd];return _0x5bc652;};'use strict';var _=require('lodash');var util=require(_0xe47e('0x0'));var logger=require('../../config/logger')(_0xe47e('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xe47e('0x2'));var fs=require('fs');var path=require(_0xe47e('0x3'));var rimraf=require('rimraf');var config=require(_0xe47e('0x4'));var attributes=require(_0xe47e('0x5'));module[_0xe47e('0x6')]=function(_0x208a5b,_0x207dd9){return _0x208a5b[_0xe47e('0x7')]('FreshdeskField',attributes,{'tableName':_0xe47e('0x8'),'paranoid':![],'indexes':[{'name':_0xe47e('0x9'),'fields':[_0xe47e('0xa'),'FieldId'],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xee04=['rimraf','../../config/environment','./intFreshdeskField.attributes','exports','define','FreshdeskField','freshdesk_unique_index','idField','FieldId','lodash','util','../../config/logger','bluebird','request-promise','path'];(function(_0x3b0dfe,_0x17e497){var _0x39b508=function(_0x475b0a){while(--_0x475b0a){_0x3b0dfe['push'](_0x3b0dfe['shift']());}};_0x39b508(++_0x17e497);}(_0xee04,0x1cb));var _0x4ee0=function(_0x1cc066,_0x23411e){_0x1cc066=_0x1cc066-0x0;var _0x2b058b=_0xee04[_0x1cc066];return _0x2b058b;};'use strict';var _=require(_0x4ee0('0x0'));var util=require(_0x4ee0('0x1'));var logger=require(_0x4ee0('0x2'))('api');var moment=require('moment');var BPromise=require(_0x4ee0('0x3'));var rp=require(_0x4ee0('0x4'));var fs=require('fs');var path=require(_0x4ee0('0x5'));var rimraf=require(_0x4ee0('0x6'));var config=require(_0x4ee0('0x7'));var attributes=require(_0x4ee0('0x8'));module[_0x4ee0('0x9')]=function(_0x18e2e2,_0x113df7){return _0x18e2e2[_0x4ee0('0xa')](_0x4ee0('0xb'),attributes,{'tableName':'int_freshdesk_fields','paranoid':![],'indexes':[{'name':_0x4ee0('0xc'),'fields':[_0x4ee0('0xd'),_0x4ee0('0xe')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/intFreshdeskField/intFreshdeskField.rpc.js b/server/api/intFreshdeskField/intFreshdeskField.rpc.js
index 57c57a3..13d9eae 100644
--- a/server/api/intFreshdeskField/intFreshdeskField.rpc.js
+++ b/server/api/intFreshdeskField/intFreshdeskField.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7a54=['info','FreshdeskField,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x7a54,0x106));var _0x47a5=function(_0x4ff6b9,_0x56ad3e){_0x4ff6b9=_0x4ff6b9-0x0;var _0x2978c9=_0x7a54[_0x4ff6b9];return _0x2978c9;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('FreshdeskField,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});}
\ No newline at end of file
+var _0xb10b=['stringify','error','message','result','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','FreshdeskField,\x20%s,\x20%s','FreshdeskField,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x29a963,_0x3d73ee){var _0x392db7=function(_0x3cb7a4){while(--_0x3cb7a4){_0x29a963['push'](_0x29a963['shift']());}};_0x392db7(++_0x3d73ee);}(_0xb10b,0x12a));var _0xbb10=function(_0x382987,_0x58058b){_0x382987=_0x382987-0x0;var _0x29eb57=_0xb10b[_0x382987];return _0x29eb57;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var moment=require(_0xbb10('0x1'));var BPromise=require(_0xbb10('0x2'));var rs=require(_0xbb10('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbb10('0x4'))['db'];var utils=require(_0xbb10('0x5'));var logger=require(_0xbb10('0x6'))(_0xbb10('0x7'));var config=require(_0xbb10('0x8'));var jayson=require(_0xbb10('0x9'));var client=jayson['client'][_0xbb10('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3cdd53,_0x513741,_0x1b9e94){return new BPromise(function(_0x3fb675,_0x21370f){return client[_0xbb10('0xb')](_0x3cdd53,_0x1b9e94)[_0xbb10('0xc')](function(_0x1ce33e){logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,'request\x20sent');logger['debug'](_0xbb10('0xf'),_0x513741,_0xbb10('0x10'),JSON[_0xbb10('0x11')](_0x1ce33e));if(_0x1ce33e['error']){if(_0x1ce33e[_0xbb10('0x12')]['code']===0x1f4){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x21370f(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}logger['error'](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x3fb675(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}else{logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,_0xbb10('0x10'));_0x3fb675(_0x1ce33e[_0xbb10('0x14')][_0xbb10('0x13')]);}})['catch'](function(_0x2eca0f){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x2eca0f);_0x21370f(_0x2eca0f);});});}
\ No newline at end of file
diff --git a/server/api/intFreshsalesAccount/index.js b/server/api/intFreshsalesAccount/index.js
index 598ac48..6b4580a 100644
--- a/server/api/intFreshsalesAccount/index.js
+++ b/server/api/intFreshsalesAccount/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x6a31=['destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshsalesAccount.controller','get','isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','getFields','post','put','delete'];(function(_0x401dbc,_0x536a53){var _0x3b64c3=function(_0x28bbc2){while(--_0x28bbc2){_0x401dbc['push'](_0x401dbc['shift']());}};_0x3b64c3(++_0x536a53);}(_0x6a31,0x172));var _0x16a3=function(_0x13e741,_0x5d3c24){_0x13e741=_0x13e741-0x0;var _0x3f8bb3=_0x6a31[_0x13e741];return _0x3f8bb3;};'use strict';var multer=require(_0x16a3('0x0'));var util=require(_0x16a3('0x1'));var path=require(_0x16a3('0x2'));var timeout=require(_0x16a3('0x3'));var express=require(_0x16a3('0x4'));var router=express[_0x16a3('0x5')]();var auth=require(_0x16a3('0x6'));var interaction=require(_0x16a3('0x7'));var config=require(_0x16a3('0x8'));var controller=require(_0x16a3('0x9'));router[_0x16a3('0xa')]('/',auth[_0x16a3('0xb')](),controller[_0x16a3('0xc')]);router[_0x16a3('0xa')](_0x16a3('0xd'),auth[_0x16a3('0xb')](),controller[_0x16a3('0xe')]);router['get'](_0x16a3('0xf'),auth['isAuthenticated'](),controller[_0x16a3('0x10')]);router[_0x16a3('0xa')]('/:id/fields',auth[_0x16a3('0xb')](),controller[_0x16a3('0x11')]);router[_0x16a3('0x12')]('/',auth[_0x16a3('0xb')](),controller['create']);router[_0x16a3('0x12')](_0x16a3('0xf'),auth[_0x16a3('0xb')](),controller['addConfiguration']);router[_0x16a3('0x13')](_0x16a3('0xd'),auth['isAuthenticated'](),controller['update']);router[_0x16a3('0x14')]('/:id',auth[_0x16a3('0xb')](),controller[_0x16a3('0x15')]);module[_0x16a3('0x16')]=router;
\ No newline at end of file
+var _0xe9e1=['multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshsalesAccount.controller','index','get','isAuthenticated','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','addConfiguration','put','/:id','delete'];(function(_0x4df9a0,_0xfed92){var _0x9c6e43=function(_0x4c4dde){while(--_0x4c4dde){_0x4df9a0['push'](_0x4df9a0['shift']());}};_0x9c6e43(++_0xfed92);}(_0xe9e1,0xb0));var _0x1e9e=function(_0x50cd37,_0x5f3b94){_0x50cd37=_0x50cd37-0x0;var _0x4492b4=_0xe9e1[_0x50cd37];return _0x4492b4;};'use strict';var multer=require(_0x1e9e('0x0'));var util=require(_0x1e9e('0x1'));var path=require(_0x1e9e('0x2'));var timeout=require(_0x1e9e('0x3'));var express=require('express');var router=express[_0x1e9e('0x4')]();var auth=require(_0x1e9e('0x5'));var interaction=require(_0x1e9e('0x6'));var config=require(_0x1e9e('0x7'));var controller=require(_0x1e9e('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0x1e9e('0x9')]);router[_0x1e9e('0xa')]('/:id',auth[_0x1e9e('0xb')](),controller[_0x1e9e('0xc')]);router['get'](_0x1e9e('0xd'),auth[_0x1e9e('0xb')](),controller[_0x1e9e('0xe')]);router[_0x1e9e('0xa')](_0x1e9e('0xf'),auth[_0x1e9e('0xb')](),controller[_0x1e9e('0x10')]);router[_0x1e9e('0x11')]('/',auth['isAuthenticated'](),controller['create']);router[_0x1e9e('0x11')](_0x1e9e('0xd'),auth[_0x1e9e('0xb')](),controller[_0x1e9e('0x12')]);router[_0x1e9e('0x13')](_0x1e9e('0x14'),auth[_0x1e9e('0xb')](),controller['update']);router[_0x1e9e('0x15')](_0x1e9e('0x14'),auth[_0x1e9e('0xb')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.attributes.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.attributes.js
index 3e89485..1113370 100644
--- a/server/api/intFreshsalesAccount/intFreshsalesAccount.attributes.js
+++ b/server/api/intFreshsalesAccount/intFreshsalesAccount.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xa848=['STRING','username','remoteUri','sequelize','exports'];(function(_0x48d139,_0x53a2b5){var _0x13508d=function(_0x437f88){while(--_0x437f88){_0x48d139['push'](_0x48d139['shift']());}};_0x13508d(++_0x53a2b5);}(_0xa848,0x99));var _0x8a84=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0xa848[_0x397e5f];return _0x5302b8;};'use strict';var Sequelize=require(_0x8a84('0x0'));module[_0x8a84('0x1')]={'name':{'type':Sequelize[_0x8a84('0x2')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x8a84('0x2')],'unique':_0x8a84('0x3')},'apiKey':{'type':Sequelize[_0x8a84('0x2')]},'remoteUri':{'type':Sequelize[_0x8a84('0x2')],'unique':_0x8a84('0x4')},'serverUrl':{'type':Sequelize[_0x8a84('0x2')]}};
\ No newline at end of file
+var _0xf61e=['remoteUri','sequelize','exports','STRING','username'];(function(_0x3ea0af,_0x462535){var _0x37b9ab=function(_0x42d565){while(--_0x42d565){_0x3ea0af['push'](_0x3ea0af['shift']());}};_0x37b9ab(++_0x462535);}(_0xf61e,0x191));var _0xef61=function(_0x31ea24,_0x18364e){_0x31ea24=_0x31ea24-0x0;var _0x1fb0ca=_0xf61e[_0x31ea24];return _0x1fb0ca;};'use strict';var Sequelize=require(_0xef61('0x0'));module[_0xef61('0x1')]={'name':{'type':Sequelize[_0xef61('0x2')]},'description':{'type':Sequelize[_0xef61('0x2')]},'username':{'type':Sequelize[_0xef61('0x2')],'unique':_0xef61('0x3')},'apiKey':{'type':Sequelize[_0xef61('0x2')]},'remoteUri':{'type':Sequelize[_0xef61('0x2')],'unique':_0xef61('0x4')},'serverUrl':{'type':Sequelize[_0xef61('0x2')]}};
\ No newline at end of file
diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.controller.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.controller.js
index 7e1bbdf..42af4b9 100644
--- a/server/api/intFreshsalesAccount/intFreshsalesAccount.controller.js
+++ b/server/api/intFreshsalesAccount/intFreshsalesAccount.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x1851=['GET','format','/api/selector/owners','Token\x20token=','statusCode','Wrong\x20credentials','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','bluebird','path','sox','to-csv','ejs','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/environment','../../mysqldb','jayson/promise','client','http','test','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','FreshsalesAccount,\x20%s,\x20%s','request\x20sent','FreshsalesAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','end','status','json','count','offset','limit','set','apply','save','update','then','destroy','sendStatus','stack','name','send','index','FreshsalesAccount','rawAttributes','fieldName','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','includeAll','findAll','rows','catch','params','include','options','body','find','getConfigurations','findOne','FreshsalesConfiguration','addConfiguration','AccountId','channel','type','Descriptions','getDescriptions','create','FreshsalesField','Subjects','getFields','username','apiKey','remoteUri','slice','lastIndexOf'];(function(_0x2dfe05,_0xc45b75){var _0x456bc6=function(_0x15f5ee){while(--_0x15f5ee){_0x2dfe05['push'](_0x2dfe05['shift']());}};_0x456bc6(++_0xc45b75);}(_0x1851,0x1ae));var _0x1185=function(_0x5370d8,_0x5ae45d){_0x5370d8=_0x5370d8-0x0;var _0x424bfc=_0x1851[_0x5370d8];return _0x424bfc;};'use strict';var pdf=require(_0x1185('0x0'));var emlformat=require(_0x1185('0x1'));var rimraf=require(_0x1185('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x1185('0x3'));var rp=require(_0x1185('0x4'));var moment=require('moment');var BPromise=require(_0x1185('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x1185('0x6'));var sox=require(_0x1185('0x7'));var csv=require(_0x1185('0x8'));var ejs=require(_0x1185('0x9'));var fs=require('fs');var _=require('lodash');var squel=require(_0x1185('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x1185('0xb'));var toCsv=require('to-csv');var querystring=require(_0x1185('0xc'));var Papa=require(_0x1185('0xd'));var Redis=require(_0x1185('0xe'));var authService=require(_0x1185('0xf'));var qs=require(_0x1185('0x10'));var as=require(_0x1185('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x1185('0x12'));var utils=require('../../config/utils');var config=require(_0x1185('0x13'));var db=require(_0x1185('0x14'))['db'];var integrations=require('../../components/integrations/configuration');var jayson=require(_0x1185('0x15'));var client=jayson[_0x1185('0x16')][_0x1185('0x17')]({'port':0x232a});function checkPasswordPattern(_0x531828,_0x2dbc21,_0x28d94a){if(_0x28d94a){var _0x581522=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x581522[_0x1185('0x18')](_0x2dbc21)){return _0x531828;}else{throw new db['Sequelize'][(_0x1185('0x19'))](_0x1185('0x1a'));}}else{return _0x531828;}}function respondWithRpcPromise(_0x254967,_0x4bbd34,_0x5e9d1f,_0x28b32b){return new BPromise(function(_0x16c4db,_0x3bd4f4){var _0x5b65b6=_0x28b32b||client;return _0x5b65b6[_0x1185('0x1b')](_0x254967,_0x5e9d1f)['then'](function(_0x34b584){logger['info'](_0x1185('0x1c'),_0x4bbd34,_0x1185('0x1d'));logger['debug'](_0x1185('0x1e'),_0x4bbd34,_0x1185('0x1d'),JSON[_0x1185('0x1f')](_0x34b584));if(_0x34b584['error']){if(_0x34b584[_0x1185('0x20')]['code']===0x1f4){logger[_0x1185('0x20')](_0x1185('0x1c'),_0x4bbd34,_0x34b584[_0x1185('0x20')][_0x1185('0x21')]);return _0x3bd4f4(_0x34b584[_0x1185('0x20')]['message']);}logger[_0x1185('0x20')](_0x1185('0x1c'),_0x4bbd34,_0x34b584[_0x1185('0x20')][_0x1185('0x21')]);return _0x16c4db(_0x34b584[_0x1185('0x20')]['message']);}else{logger[_0x1185('0x22')](_0x1185('0x1c'),_0x4bbd34,_0x1185('0x1d'));_0x16c4db(_0x34b584[_0x1185('0x23')]['message']);}})['catch'](function(_0xbb6f77){logger[_0x1185('0x20')]('FreshsalesAccount,\x20%s,\x20%s',_0x4bbd34,_0xbb6f77);_0x3bd4f4(_0xbb6f77);});});}function respondWithStatusCode(_0x4f72f1,_0x949f50){_0x949f50=_0x949f50||0xcc;return function(_0x54189e){if(_0x54189e){return _0x4f72f1['sendStatus'](_0x949f50);}return _0x4f72f1['status'](_0x949f50)[_0x1185('0x24')]();};}function respondWithResult(_0x5ca7b5,_0x4b94ef){_0x4b94ef=_0x4b94ef||0xc8;return function(_0x4aee08){if(_0x4aee08){return _0x5ca7b5[_0x1185('0x25')](_0x4b94ef)[_0x1185('0x26')](_0x4aee08);}};}function respondWithFilteredResult(_0x5fe507,_0x3fc209){return function(_0x19eb86){if(_0x19eb86){var _0xda75e3=_0x19eb86[_0x1185('0x27')],_0x5ba18f=_0x3fc209[_0x1185('0x28')],_0x151874=_0x3fc209['offset']+_0x3fc209[_0x1185('0x29')],_0x4cfdf4;if(_0x151874>=_0xda75e3){_0x151874=_0xda75e3;_0x4cfdf4=0xc8;}else{_0x4cfdf4=0xce;}_0x5fe507[_0x1185('0x25')](_0x4cfdf4);return _0x5fe507[_0x1185('0x2a')]('Content-Range',_0x5ba18f+'-'+_0x151874+'/'+_0xda75e3)['json'](_0x19eb86);}return null;};}function patchUpdates(_0x5db83d){return function(_0x38aa25){try{jsonpatch[_0x1185('0x2b')](_0x38aa25,_0x5db83d,!![]);}catch(_0x3a6cb2){return BPromise['reject'](_0x3a6cb2);}return _0x38aa25[_0x1185('0x2c')]();};}function saveUpdates(_0x596b39,_0x5557af){return function(_0x3ae00c){if(_0x3ae00c){return _0x3ae00c[_0x1185('0x2d')](_0x596b39)[_0x1185('0x2e')](function(_0xe47976){return _0xe47976;});}return null;};}function removeEntity(_0x1c4b1d,_0x2f2bd5){return function(_0x27d37b){if(_0x27d37b){return _0x27d37b[_0x1185('0x2f')]()['then'](function(){_0x1c4b1d[_0x1185('0x25')](0xcc)[_0x1185('0x24')]();});}};}function handleEntityNotFound(_0x1e88ed,_0x182a2f){return function(_0x1df44f){if(!_0x1df44f){_0x1e88ed[_0x1185('0x30')](0x194);}return _0x1df44f;};}function handleError(_0x2f68f3,_0x5f04ad){_0x5f04ad=_0x5f04ad||0x1f4;return function(_0x1aacc0){logger[_0x1185('0x20')](_0x1aacc0[_0x1185('0x31')]);if(_0x1aacc0[_0x1185('0x32')]){delete _0x1aacc0[_0x1185('0x32')];}_0x2f68f3[_0x1185('0x25')](_0x5f04ad)[_0x1185('0x33')](_0x1aacc0);};}exports[_0x1185('0x34')]=function(_0x43c206,_0x598168){var _0x46ab3a={},_0x77b0d4={},_0xb6dba0={'count':0x0,'rows':[]};var _0x36dca2=_['map'](db[_0x1185('0x35')][_0x1185('0x36')],function(_0x1ccb49){return{'name':_0x1ccb49[_0x1185('0x37')],'type':_0x1ccb49['type'][_0x1185('0x38')]};});_0x77b0d4[_0x1185('0x39')]=_[_0x1185('0x3a')](_0x36dca2,_0x1185('0x32'));_0x77b0d4[_0x1185('0x3b')]=_[_0x1185('0x3c')](_0x43c206[_0x1185('0x3b')]);_0x77b0d4[_0x1185('0x3d')]=_[_0x1185('0x3e')](_0x77b0d4[_0x1185('0x39')],_0x77b0d4[_0x1185('0x3b')]);_0x46ab3a[_0x1185('0x3f')]=_[_0x1185('0x3e')](_0x77b0d4[_0x1185('0x39')],qs[_0x1185('0x40')](_0x43c206[_0x1185('0x3b')][_0x1185('0x40')]));_0x46ab3a[_0x1185('0x3f')]=_0x46ab3a[_0x1185('0x3f')][_0x1185('0x41')]?_0x46ab3a[_0x1185('0x3f')]:_0x77b0d4['model'];if(!_0x43c206[_0x1185('0x3b')][_0x1185('0x42')](_0x1185('0x43'))){_0x46ab3a[_0x1185('0x29')]=qs[_0x1185('0x29')](_0x43c206[_0x1185('0x3b')][_0x1185('0x29')]);_0x46ab3a[_0x1185('0x28')]=qs[_0x1185('0x28')](_0x43c206[_0x1185('0x3b')][_0x1185('0x28')]);}_0x46ab3a[_0x1185('0x44')]=qs[_0x1185('0x45')](_0x43c206[_0x1185('0x3b')]['sort']);_0x46ab3a[_0x1185('0x46')]=qs[_0x1185('0x3d')](_['pick'](_0x43c206['query'],_0x77b0d4[_0x1185('0x3d')]),_0x36dca2);if(_0x43c206[_0x1185('0x3b')][_0x1185('0x47')]){_0x46ab3a[_0x1185('0x46')]=_[_0x1185('0x48')](_0x46ab3a[_0x1185('0x46')],{'$or':_['map'](_0x36dca2,function(_0x3a9105){if(_0x3a9105['type']!=='VIRTUAL'){var _0x305e8a={};_0x305e8a[_0x3a9105[_0x1185('0x32')]]={'$like':'%'+_0x43c206['query']['filter']+'%'};return _0x305e8a;}})});}_0x46ab3a=_[_0x1185('0x48')]({},_0x46ab3a,_0x43c206['options']);var _0x522aec={'where':_0x46ab3a[_0x1185('0x46')]};return db[_0x1185('0x35')][_0x1185('0x27')](_0x522aec)[_0x1185('0x2e')](function(_0x1d7e45){_0xb6dba0[_0x1185('0x27')]=_0x1d7e45;if(_0x43c206[_0x1185('0x3b')][_0x1185('0x49')]){_0x46ab3a['include']=[{'all':!![]}];}return db[_0x1185('0x35')][_0x1185('0x4a')](_0x46ab3a);})[_0x1185('0x2e')](function(_0x13680a){_0xb6dba0[_0x1185('0x4b')]=_0x13680a;return _0xb6dba0;})['then'](respondWithFilteredResult(_0x598168,_0x46ab3a))[_0x1185('0x4c')](handleError(_0x598168,null));};exports['show']=function(_0x35347a,_0x1321cf){var _0x22c414={'raw':![],'where':{'id':_0x35347a[_0x1185('0x4d')]['id']}},_0x24d05e={};_0x24d05e[_0x1185('0x39')]=_[_0x1185('0x3c')](db[_0x1185('0x35')][_0x1185('0x36')]);_0x24d05e['query']=_[_0x1185('0x3c')](_0x35347a[_0x1185('0x3b')]);_0x24d05e[_0x1185('0x3d')]=_[_0x1185('0x3e')](_0x24d05e[_0x1185('0x39')],_0x24d05e[_0x1185('0x3b')]);_0x22c414[_0x1185('0x3f')]=_['intersection'](_0x24d05e[_0x1185('0x39')],qs['fields'](_0x35347a[_0x1185('0x3b')]['fields']));_0x22c414[_0x1185('0x3f')]=_0x22c414['attributes']['length']?_0x22c414['attributes']:_0x24d05e[_0x1185('0x39')];if(_0x35347a[_0x1185('0x3b')]['includeAll']){_0x22c414[_0x1185('0x4e')]=[{'all':!![]}];}_0x22c414=_[_0x1185('0x48')]({},_0x22c414,_0x35347a[_0x1185('0x4f')]);return db[_0x1185('0x35')]['find'](_0x22c414)[_0x1185('0x2e')](handleEntityNotFound(_0x1321cf,null))['then'](respondWithResult(_0x1321cf,null))[_0x1185('0x4c')](handleError(_0x1321cf,null));};exports['create']=function(_0x51f769,_0x3760f8){return db[_0x1185('0x35')]['create'](_0x51f769[_0x1185('0x50')],{})[_0x1185('0x2e')](respondWithResult(_0x3760f8,0xc9))[_0x1185('0x4c')](handleError(_0x3760f8,null));};exports[_0x1185('0x2d')]=function(_0x372f4c,_0x5c78b2){if(_0x372f4c[_0x1185('0x50')]['id']){delete _0x372f4c['body']['id'];}return db[_0x1185('0x35')][_0x1185('0x51')]({'where':{'id':_0x372f4c[_0x1185('0x4d')]['id']}})['then'](handleEntityNotFound(_0x5c78b2,null))['then'](saveUpdates(_0x372f4c[_0x1185('0x50')],null))[_0x1185('0x2e')](respondWithResult(_0x5c78b2,null))[_0x1185('0x4c')](handleError(_0x5c78b2,null));};exports['destroy']=function(_0x19e694,_0x20e441){return db[_0x1185('0x35')][_0x1185('0x51')]({'where':{'id':_0x19e694[_0x1185('0x4d')]['id']}})[_0x1185('0x2e')](handleEntityNotFound(_0x20e441,null))[_0x1185('0x2e')](removeEntity(_0x20e441,null))[_0x1185('0x4c')](handleError(_0x20e441,null));};exports[_0x1185('0x52')]=function(_0x2fa269,_0x5e8c03,_0x54ba3a){var _0x1b870d={};var _0x1a2744={};var _0x1a9a68;var _0x45fa69;return db[_0x1185('0x35')][_0x1185('0x53')]({'where':{'id':_0x2fa269[_0x1185('0x4d')]['id']}})[_0x1185('0x2e')](handleEntityNotFound(_0x5e8c03,null))[_0x1185('0x2e')](function(_0x36cc55){if(_0x36cc55){_0x1a9a68=_0x36cc55;_0x1a2744['model']=_[_0x1185('0x3c')](db[_0x1185('0x54')][_0x1185('0x36')]);_0x1a2744[_0x1185('0x3b')]=_[_0x1185('0x3c')](_0x2fa269[_0x1185('0x3b')]);_0x1a2744[_0x1185('0x3d')]=_['intersection'](_0x1a2744[_0x1185('0x39')],_0x1a2744[_0x1185('0x3b')]);_0x1b870d[_0x1185('0x3f')]=_[_0x1185('0x3e')](_0x1a2744[_0x1185('0x39')],qs['fields'](_0x2fa269['query']['fields']));_0x1b870d[_0x1185('0x3f')]=_0x1b870d[_0x1185('0x3f')]['length']?_0x1b870d[_0x1185('0x3f')]:_0x1a2744[_0x1185('0x39')];_0x1b870d[_0x1185('0x44')]=qs[_0x1185('0x45')](_0x2fa269[_0x1185('0x3b')][_0x1185('0x45')]);_0x1b870d[_0x1185('0x46')]=qs[_0x1185('0x3d')](_['pick'](_0x2fa269[_0x1185('0x3b')],_0x1a2744[_0x1185('0x3d')]));if(_0x2fa269['query'][_0x1185('0x47')]){_0x1b870d[_0x1185('0x46')]=_[_0x1185('0x48')](_0x1b870d[_0x1185('0x46')],{'$or':_['map'](_0x1b870d[_0x1185('0x3f')],function(_0xc422a6){var _0x3cb5cb={};_0x3cb5cb[_0xc422a6]={'$like':'%'+_0x2fa269[_0x1185('0x3b')]['filter']+'%'};return _0x3cb5cb;})});}_0x1b870d=_[_0x1185('0x48')]({},_0x1b870d,_0x2fa269[_0x1185('0x4f')]);return _0x1a9a68[_0x1185('0x52')](_0x1b870d);}})[_0x1185('0x2e')](function(_0x182b3d){if(_0x182b3d){_0x45fa69=_0x182b3d[_0x1185('0x41')];if(!_0x2fa269['query']['hasOwnProperty'](_0x1185('0x43'))){_0x1b870d[_0x1185('0x29')]=qs[_0x1185('0x29')](_0x2fa269[_0x1185('0x3b')][_0x1185('0x29')]);_0x1b870d[_0x1185('0x28')]=qs['offset'](_0x2fa269['query']['offset']);}return _0x1a9a68['getConfigurations'](_0x1b870d);}})['then'](function(_0x3af16d){if(_0x3af16d){return _0x3af16d?{'count':_0x45fa69,'rows':_0x3af16d}:null;}})[_0x1185('0x2e')](respondWithResult(_0x5e8c03,null))[_0x1185('0x4c')](handleError(_0x5e8c03,null));};exports[_0x1185('0x55')]=function(_0x3f9745,_0x58119a,_0x37daa0){if(_0x3f9745['body']['id']){delete _0x3f9745[_0x1185('0x50')]['id'];}return db[_0x1185('0x35')][_0x1185('0x53')]({'where':{'id':_0x3f9745[_0x1185('0x4d')]['id']}})[_0x1185('0x2e')](handleEntityNotFound(_0x58119a,null))['then'](function(_0x558699){if(_0x558699){_0x3f9745['body'][_0x1185('0x56')]=_0x558699['id'];_0x3f9745[_0x1185('0x50')]['Subjects']=integrations['getSubjects'](_0x3f9745[_0x1185('0x50')][_0x1185('0x57')],_0x3f9745['body'][_0x1185('0x58')]);_0x3f9745[_0x1185('0x50')][_0x1185('0x59')]=integrations[_0x1185('0x5a')](_0x3f9745[_0x1185('0x50')][_0x1185('0x57')],_0x3f9745[_0x1185('0x50')][_0x1185('0x58')]);return db['FreshsalesConfiguration'][_0x1185('0x5b')](_0x3f9745['body'],{'include':[{'model':db[_0x1185('0x5c')],'as':_0x1185('0x5d')},{'model':db[_0x1185('0x5c')],'as':_0x1185('0x59')}]});}return null;})['then'](respondWithResult(_0x58119a,null))[_0x1185('0x4c')](handleError(_0x58119a,null));};exports[_0x1185('0x5e')]=function(_0x3b672a,_0x13577d,_0x4a46c8){var _0x3a3a4e='';var _0x3cf569='';return db[_0x1185('0x35')][_0x1185('0x53')]({'where':{'id':_0x3b672a[_0x1185('0x4d')]['id']},'attributes':['id',_0x1185('0x5f'),'remoteUri',_0x1185('0x60')]})[_0x1185('0x2e')](handleEntityNotFound(_0x13577d,null))[_0x1185('0x2e')](function(_0xddf41f){if(_0xddf41f){_0x3cf569=_0xddf41f['username'];_0x3a3a4e=_0xddf41f[_0x1185('0x61')];var _0x3909ec=_0xddf41f[_0x1185('0x61')][_0x1185('0x62')](-0x1);if(_0x3909ec==='/'){_0x3a3a4e=_0x3a3a4e['substring'](0x0,_0x3a3a4e[_0x1185('0x63')](_0x3909ec));}return rp({'method':_0x1185('0x64'),'uri':util[_0x1185('0x65')]('%s%s',_0x3a3a4e,_0x1185('0x66')),'headers':{'Authorization':_0x1185('0x67')+_0xddf41f[_0x1185('0x60')]},'json':!![]});}})[_0x1185('0x2e')](function(_0x572fb8){if(_0x572fb8){var _0x349bbb=_0x572fb8['users'];var _0x1842ce=![];var _0x38a859=null;for(_0x38a859=0x0;_0x38a859<_0x349bbb['length'];_0x38a859++){if(_0x349bbb[_0x38a859]['email']===_0x3cf569){_0x1842ce=!![];}}if(_0x1842ce){return!![];}else{throw new Error({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}}})[_0x1185('0x2e')](respondWithResult(_0x13577d,null))[_0x1185('0x4c')](function(_0x41e503){var _0x526e34=_0x3b672a[_0x1185('0x3b')][_0x1185('0x18')]?0x1f4:_0x41e503[_0x1185('0x68')]||0x1f4;logger[_0x1185('0x20')]('getFields,\x20%s,\x20%s,\x20%s',_0x1185('0x5e'),_0x526e34,JSON[_0x1185('0x1f')](_0x41e503));delete _0x41e503[_0x1185('0x32')];if(_0x526e34===0x191){_0x526e34=0x190;}_0x13577d[_0x1185('0x25')](_0x526e34)[_0x1185('0x33')](_0x3b672a[_0x1185('0x3b')][_0x1185('0x18')]?{'message':_0x1185('0x69'),'statusCode':_0x41e503[_0x1185('0x68')]}:_0x41e503);});};
\ No newline at end of file
+var _0x4262=['VIRTUAL','options','includeAll','params','include','find','create','body','destroy','getConfigurations','findOne','rawAttributes','order','merge','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','FreshsalesConfiguration','FreshsalesField','getFields','username','apiKey','slice','GET','format','%s%s','/api/selector/owners','Token\x20token=','email','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','jayson/promise','http','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','request\x20sent','debug','error','code','FreshsalesAccount,\x20%s,\x20%s','message','result','catch','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','sendStatus','name','index','map','FreshsalesAccount','type','key','model','keys','filters','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter'];(function(_0x24baf9,_0x38f142){var _0xbccc3d=function(_0x339615){while(--_0x339615){_0x24baf9['push'](_0x24baf9['shift']());}};_0xbccc3d(++_0x38f142);}(_0x4262,0x95));var _0x2426=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x4262[_0x1facfa];return _0x9ec701;};'use strict';var pdf=require(_0x2426('0x0'));var emlformat=require(_0x2426('0x1'));var rimraf=require(_0x2426('0x2'));var zipdir=require(_0x2426('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x2426('0x4'));var moment=require(_0x2426('0x5'));var BPromise=require(_0x2426('0x6'));var Mustache=require(_0x2426('0x7'));var util=require(_0x2426('0x8'));var path=require(_0x2426('0x9'));var sox=require(_0x2426('0xa'));var csv=require(_0x2426('0xb'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x2426('0xc'));var crypto=require('crypto');var jsforce=require(_0x2426('0xd'));var deskjs=require(_0x2426('0xe'));var toCsv=require(_0x2426('0xb'));var querystring=require(_0x2426('0xf'));var Papa=require(_0x2426('0x10'));var Redis=require(_0x2426('0x11'));var authService=require(_0x2426('0x12'));var qs=require(_0x2426('0x13'));var as=require(_0x2426('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x2426('0x15'))(_0x2426('0x16'));var utils=require(_0x2426('0x17'));var config=require(_0x2426('0x18'));var db=require(_0x2426('0x19'))['db'];var integrations=require(_0x2426('0x1a'));var jayson=require(_0x2426('0x1b'));var client=jayson['client'][_0x2426('0x1c')]({'port':0x232a});function checkPasswordPattern(_0x139f73,_0x43c378,_0x183d5c){if(_0x183d5c){var _0x1d6307=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x1d6307[_0x2426('0x1d')](_0x43c378)){return _0x139f73;}else{throw new db[(_0x2426('0x1e'))][(_0x2426('0x1f'))](_0x2426('0x20'));}}else{return _0x139f73;}}function respondWithRpcPromise(_0x3fb4e8,_0x3b49d7,_0x4247a5,_0x14de12){return new BPromise(function(_0x37f8a0,_0x494762){var _0x58c6ee=_0x14de12||client;return _0x58c6ee[_0x2426('0x21')](_0x3fb4e8,_0x4247a5)[_0x2426('0x22')](function(_0x12f0f6){logger[_0x2426('0x23')]('FreshsalesAccount,\x20%s,\x20%s',_0x3b49d7,_0x2426('0x24'));logger[_0x2426('0x25')]('FreshsalesAccount,\x20%s,\x20%s,\x20%s',_0x3b49d7,_0x2426('0x24'),JSON['stringify'](_0x12f0f6));if(_0x12f0f6[_0x2426('0x26')]){if(_0x12f0f6[_0x2426('0x26')][_0x2426('0x27')]===0x1f4){logger['error'](_0x2426('0x28'),_0x3b49d7,_0x12f0f6[_0x2426('0x26')]['message']);return _0x494762(_0x12f0f6[_0x2426('0x26')][_0x2426('0x29')]);}logger[_0x2426('0x26')](_0x2426('0x28'),_0x3b49d7,_0x12f0f6[_0x2426('0x26')][_0x2426('0x29')]);return _0x37f8a0(_0x12f0f6[_0x2426('0x26')][_0x2426('0x29')]);}else{logger[_0x2426('0x23')](_0x2426('0x28'),_0x3b49d7,_0x2426('0x24'));_0x37f8a0(_0x12f0f6[_0x2426('0x2a')][_0x2426('0x29')]);}})[_0x2426('0x2b')](function(_0x15849d){logger[_0x2426('0x26')]('FreshsalesAccount,\x20%s,\x20%s',_0x3b49d7,_0x15849d);_0x494762(_0x15849d);});});}function respondWithStatusCode(_0x5285ea,_0x73d524){_0x73d524=_0x73d524||0xcc;return function(_0x155a3c){if(_0x155a3c){return _0x5285ea['sendStatus'](_0x73d524);}return _0x5285ea[_0x2426('0x2c')](_0x73d524)[_0x2426('0x2d')]();};}function respondWithResult(_0x136972,_0x1fc92f){_0x1fc92f=_0x1fc92f||0xc8;return function(_0x4a56da){if(_0x4a56da){return _0x136972[_0x2426('0x2c')](_0x1fc92f)[_0x2426('0x2e')](_0x4a56da);}};}function respondWithFilteredResult(_0x17822c,_0x11d098){return function(_0x467249){if(_0x467249){var _0x44b7bb=_0x467249[_0x2426('0x2f')],_0x4a586c=_0x11d098[_0x2426('0x30')],_0xbde823=_0x11d098[_0x2426('0x30')]+_0x11d098[_0x2426('0x31')],_0x1d76ee;if(_0xbde823>=_0x44b7bb){_0xbde823=_0x44b7bb;_0x1d76ee=0xc8;}else{_0x1d76ee=0xce;}_0x17822c['status'](_0x1d76ee);return _0x17822c[_0x2426('0x32')](_0x2426('0x33'),_0x4a586c+'-'+_0xbde823+'/'+_0x44b7bb)[_0x2426('0x2e')](_0x467249);}return null;};}function patchUpdates(_0x49c6a0){return function(_0x37d7d2){try{jsonpatch[_0x2426('0x34')](_0x37d7d2,_0x49c6a0,!![]);}catch(_0x37e145){return BPromise[_0x2426('0x35')](_0x37e145);}return _0x37d7d2[_0x2426('0x36')]();};}function saveUpdates(_0x2df44d,_0x320314){return function(_0x52c64a){if(_0x52c64a){return _0x52c64a[_0x2426('0x37')](_0x2df44d)['then'](function(_0x3692eb){return _0x3692eb;});}return null;};}function removeEntity(_0x562ce5,_0x377ba1){return function(_0x3ee90f){if(_0x3ee90f){return _0x3ee90f['destroy']()[_0x2426('0x22')](function(){_0x562ce5[_0x2426('0x2c')](0xcc)[_0x2426('0x2d')]();});}};}function handleEntityNotFound(_0x5ac986,_0x4badcd){return function(_0xeb65b5){if(!_0xeb65b5){_0x5ac986[_0x2426('0x38')](0x194);}return _0xeb65b5;};}function handleError(_0xb72a0b,_0xd34d71){_0xd34d71=_0xd34d71||0x1f4;return function(_0x1d162c){logger['error'](_0x1d162c['stack']);if(_0x1d162c['name']){delete _0x1d162c[_0x2426('0x39')];}_0xb72a0b[_0x2426('0x2c')](_0xd34d71)['send'](_0x1d162c);};}exports[_0x2426('0x3a')]=function(_0x20b5e4,_0x588435){var _0x2a155b={},_0x3bacd9={},_0x10f1ad={'count':0x0,'rows':[]};var _0x45a493=_[_0x2426('0x3b')](db[_0x2426('0x3c')]['rawAttributes'],function(_0x551bee){return{'name':_0x551bee['fieldName'],'type':_0x551bee[_0x2426('0x3d')][_0x2426('0x3e')]};});_0x3bacd9[_0x2426('0x3f')]=_['map'](_0x45a493,'name');_0x3bacd9['query']=_[_0x2426('0x40')](_0x20b5e4['query']);_0x3bacd9[_0x2426('0x41')]=_['intersection'](_0x3bacd9[_0x2426('0x3f')],_0x3bacd9[_0x2426('0x42')]);_0x2a155b[_0x2426('0x43')]=_[_0x2426('0x44')](_0x3bacd9[_0x2426('0x3f')],qs[_0x2426('0x45')](_0x20b5e4[_0x2426('0x42')][_0x2426('0x45')]));_0x2a155b[_0x2426('0x43')]=_0x2a155b[_0x2426('0x43')][_0x2426('0x46')]?_0x2a155b[_0x2426('0x43')]:_0x3bacd9[_0x2426('0x3f')];if(!_0x20b5e4[_0x2426('0x42')][_0x2426('0x47')](_0x2426('0x48'))){_0x2a155b[_0x2426('0x31')]=qs[_0x2426('0x31')](_0x20b5e4[_0x2426('0x42')][_0x2426('0x31')]);_0x2a155b['offset']=qs[_0x2426('0x30')](_0x20b5e4[_0x2426('0x42')][_0x2426('0x30')]);}_0x2a155b['order']=qs['sort'](_0x20b5e4[_0x2426('0x42')][_0x2426('0x49')]);_0x2a155b[_0x2426('0x4a')]=qs[_0x2426('0x41')](_[_0x2426('0x4b')](_0x20b5e4['query'],_0x3bacd9[_0x2426('0x41')]),_0x45a493);if(_0x20b5e4[_0x2426('0x42')][_0x2426('0x4c')]){_0x2a155b['where']=_['merge'](_0x2a155b[_0x2426('0x4a')],{'$or':_[_0x2426('0x3b')](_0x45a493,function(_0x47c67c){if(_0x47c67c[_0x2426('0x3d')]!==_0x2426('0x4d')){var _0x1ef176={};_0x1ef176[_0x47c67c[_0x2426('0x39')]]={'$like':'%'+_0x20b5e4[_0x2426('0x42')][_0x2426('0x4c')]+'%'};return _0x1ef176;}})});}_0x2a155b=_['merge']({},_0x2a155b,_0x20b5e4[_0x2426('0x4e')]);var _0x4ffafe={'where':_0x2a155b[_0x2426('0x4a')]};return db[_0x2426('0x3c')][_0x2426('0x2f')](_0x4ffafe)['then'](function(_0x447530){_0x10f1ad[_0x2426('0x2f')]=_0x447530;if(_0x20b5e4['query'][_0x2426('0x4f')]){_0x2a155b['include']=[{'all':!![]}];}return db[_0x2426('0x3c')]['findAll'](_0x2a155b);})[_0x2426('0x22')](function(_0x4be5bc){_0x10f1ad['rows']=_0x4be5bc;return _0x10f1ad;})['then'](respondWithFilteredResult(_0x588435,_0x2a155b))[_0x2426('0x2b')](handleError(_0x588435,null));};exports['show']=function(_0x2a70d9,_0x4c3518){var _0x33155f={'raw':![],'where':{'id':_0x2a70d9[_0x2426('0x50')]['id']}},_0x4c4e90={};_0x4c4e90[_0x2426('0x3f')]=_[_0x2426('0x40')](db[_0x2426('0x3c')]['rawAttributes']);_0x4c4e90[_0x2426('0x42')]=_['keys'](_0x2a70d9[_0x2426('0x42')]);_0x4c4e90[_0x2426('0x41')]=_[_0x2426('0x44')](_0x4c4e90[_0x2426('0x3f')],_0x4c4e90['query']);_0x33155f[_0x2426('0x43')]=_[_0x2426('0x44')](_0x4c4e90[_0x2426('0x3f')],qs[_0x2426('0x45')](_0x2a70d9[_0x2426('0x42')][_0x2426('0x45')]));_0x33155f['attributes']=_0x33155f[_0x2426('0x43')][_0x2426('0x46')]?_0x33155f[_0x2426('0x43')]:_0x4c4e90[_0x2426('0x3f')];if(_0x2a70d9[_0x2426('0x42')]['includeAll']){_0x33155f[_0x2426('0x51')]=[{'all':!![]}];}_0x33155f=_['merge']({},_0x33155f,_0x2a70d9[_0x2426('0x4e')]);return db[_0x2426('0x3c')][_0x2426('0x52')](_0x33155f)[_0x2426('0x22')](handleEntityNotFound(_0x4c3518,null))[_0x2426('0x22')](respondWithResult(_0x4c3518,null))[_0x2426('0x2b')](handleError(_0x4c3518,null));};exports[_0x2426('0x53')]=function(_0x2b6642,_0x284fd1){return db[_0x2426('0x3c')][_0x2426('0x53')](_0x2b6642[_0x2426('0x54')],{})[_0x2426('0x22')](respondWithResult(_0x284fd1,0xc9))['catch'](handleError(_0x284fd1,null));};exports[_0x2426('0x37')]=function(_0x52a1df,_0x87be25){if(_0x52a1df[_0x2426('0x54')]['id']){delete _0x52a1df[_0x2426('0x54')]['id'];}return db[_0x2426('0x3c')][_0x2426('0x52')]({'where':{'id':_0x52a1df['params']['id']}})[_0x2426('0x22')](handleEntityNotFound(_0x87be25,null))['then'](saveUpdates(_0x52a1df[_0x2426('0x54')],null))[_0x2426('0x22')](respondWithResult(_0x87be25,null))[_0x2426('0x2b')](handleError(_0x87be25,null));};exports[_0x2426('0x55')]=function(_0x1f2dfe,_0x5448d4){return db['FreshsalesAccount'][_0x2426('0x52')]({'where':{'id':_0x1f2dfe[_0x2426('0x50')]['id']}})[_0x2426('0x22')](handleEntityNotFound(_0x5448d4,null))[_0x2426('0x22')](removeEntity(_0x5448d4,null))['catch'](handleError(_0x5448d4,null));};exports[_0x2426('0x56')]=function(_0x16eefd,_0x30ede7,_0x288996){var _0x35668e={};var _0x7a6120={};var _0x2ae55b;var _0x9974a8;return db[_0x2426('0x3c')][_0x2426('0x57')]({'where':{'id':_0x16eefd[_0x2426('0x50')]['id']}})[_0x2426('0x22')](handleEntityNotFound(_0x30ede7,null))[_0x2426('0x22')](function(_0x3dfb33){if(_0x3dfb33){_0x2ae55b=_0x3dfb33;_0x7a6120[_0x2426('0x3f')]=_[_0x2426('0x40')](db['FreshsalesConfiguration'][_0x2426('0x58')]);_0x7a6120[_0x2426('0x42')]=_[_0x2426('0x40')](_0x16eefd['query']);_0x7a6120['filters']=_[_0x2426('0x44')](_0x7a6120[_0x2426('0x3f')],_0x7a6120[_0x2426('0x42')]);_0x35668e[_0x2426('0x43')]=_['intersection'](_0x7a6120[_0x2426('0x3f')],qs[_0x2426('0x45')](_0x16eefd[_0x2426('0x42')]['fields']));_0x35668e[_0x2426('0x43')]=_0x35668e[_0x2426('0x43')][_0x2426('0x46')]?_0x35668e[_0x2426('0x43')]:_0x7a6120['model'];_0x35668e[_0x2426('0x59')]=qs[_0x2426('0x49')](_0x16eefd[_0x2426('0x42')]['sort']);_0x35668e[_0x2426('0x4a')]=qs[_0x2426('0x41')](_[_0x2426('0x4b')](_0x16eefd['query'],_0x7a6120[_0x2426('0x41')]));if(_0x16eefd[_0x2426('0x42')]['filter']){_0x35668e['where']=_['merge'](_0x35668e[_0x2426('0x4a')],{'$or':_[_0x2426('0x3b')](_0x35668e['attributes'],function(_0x2f5468){var _0x92535={};_0x92535[_0x2f5468]={'$like':'%'+_0x16eefd[_0x2426('0x42')][_0x2426('0x4c')]+'%'};return _0x92535;})});}_0x35668e=_[_0x2426('0x5a')]({},_0x35668e,_0x16eefd[_0x2426('0x4e')]);return _0x2ae55b['getConfigurations'](_0x35668e);}})[_0x2426('0x22')](function(_0x39582f){if(_0x39582f){_0x9974a8=_0x39582f[_0x2426('0x46')];if(!_0x16eefd[_0x2426('0x42')]['hasOwnProperty'](_0x2426('0x48'))){_0x35668e[_0x2426('0x31')]=qs[_0x2426('0x31')](_0x16eefd[_0x2426('0x42')][_0x2426('0x31')]);_0x35668e[_0x2426('0x30')]=qs[_0x2426('0x30')](_0x16eefd[_0x2426('0x42')][_0x2426('0x30')]);}return _0x2ae55b[_0x2426('0x56')](_0x35668e);}})['then'](function(_0x470587){if(_0x470587){return _0x470587?{'count':_0x9974a8,'rows':_0x470587}:null;}})[_0x2426('0x22')](respondWithResult(_0x30ede7,null))[_0x2426('0x2b')](handleError(_0x30ede7,null));};exports[_0x2426('0x5b')]=function(_0xb1705a,_0x1a0c03,_0x23c605){if(_0xb1705a[_0x2426('0x54')]['id']){delete _0xb1705a[_0x2426('0x54')]['id'];}return db[_0x2426('0x3c')]['findOne']({'where':{'id':_0xb1705a[_0x2426('0x50')]['id']}})['then'](handleEntityNotFound(_0x1a0c03,null))[_0x2426('0x22')](function(_0x6905dd){if(_0x6905dd){_0xb1705a['body'][_0x2426('0x5c')]=_0x6905dd['id'];_0xb1705a[_0x2426('0x54')][_0x2426('0x5d')]=integrations[_0x2426('0x5e')](_0xb1705a[_0x2426('0x54')][_0x2426('0x5f')],_0xb1705a[_0x2426('0x54')][_0x2426('0x3d')]);_0xb1705a[_0x2426('0x54')][_0x2426('0x60')]=integrations['getDescriptions'](_0xb1705a[_0x2426('0x54')][_0x2426('0x5f')],_0xb1705a[_0x2426('0x54')][_0x2426('0x3d')]);return db[_0x2426('0x61')][_0x2426('0x53')](_0xb1705a['body'],{'include':[{'model':db[_0x2426('0x62')],'as':_0x2426('0x5d')},{'model':db[_0x2426('0x62')],'as':_0x2426('0x60')}]});}return null;})['then'](respondWithResult(_0x1a0c03,null))['catch'](handleError(_0x1a0c03,null));};exports[_0x2426('0x63')]=function(_0x3a0e80,_0x4b7a00,_0xa1f27b){var _0x3df568='';var _0x597bd8='';return db[_0x2426('0x3c')]['findOne']({'where':{'id':_0x3a0e80['params']['id']},'attributes':['id',_0x2426('0x64'),'remoteUri',_0x2426('0x65')]})[_0x2426('0x22')](handleEntityNotFound(_0x4b7a00,null))[_0x2426('0x22')](function(_0x307e68){if(_0x307e68){_0x597bd8=_0x307e68[_0x2426('0x64')];_0x3df568=_0x307e68['remoteUri'];var _0x243d44=_0x307e68['remoteUri'][_0x2426('0x66')](-0x1);if(_0x243d44==='/'){_0x3df568=_0x3df568['substring'](0x0,_0x3df568['lastIndexOf'](_0x243d44));}return rp({'method':_0x2426('0x67'),'uri':util[_0x2426('0x68')](_0x2426('0x69'),_0x3df568,_0x2426('0x6a')),'headers':{'Authorization':_0x2426('0x6b')+_0x307e68[_0x2426('0x65')]},'json':!![]});}})[_0x2426('0x22')](function(_0x135ae7){if(_0x135ae7){var _0xf06aa4=_0x135ae7['users'];var _0xc80cef=![];var _0x121f45=null;for(_0x121f45=0x0;_0x121f45<_0xf06aa4['length'];_0x121f45++){if(_0xf06aa4[_0x121f45][_0x2426('0x6c')]===_0x597bd8){_0xc80cef=!![];}}if(_0xc80cef){return!![];}else{throw new Error({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}}})[_0x2426('0x22')](respondWithResult(_0x4b7a00,null))['catch'](function(_0x2eba97){var _0x1c0a6e=_0x3a0e80[_0x2426('0x42')][_0x2426('0x1d')]?0x1f4:_0x2eba97[_0x2426('0x6d')]||0x1f4;logger[_0x2426('0x26')](_0x2426('0x6e'),_0x2426('0x63'),_0x1c0a6e,JSON[_0x2426('0x6f')](_0x2eba97));delete _0x2eba97[_0x2426('0x39')];if(_0x1c0a6e===0x191){_0x1c0a6e=0x190;}_0x4b7a00[_0x2426('0x2c')](_0x1c0a6e)['send'](_0x3a0e80[_0x2426('0x42')][_0x2426('0x1d')]?{'message':_0x2426('0x70'),'statusCode':_0x2eba97[_0x2426('0x6d')]}:_0x2eba97);});};
\ No newline at end of file
diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js
index 8d1af14..c799d9d 100644
--- a/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js
+++ b/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x56e7=['exports','define','int_freshsales_accounts','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intFreshsalesAccount.attributes'];(function(_0x14ad71,_0x5cff4d){var _0x33ebc9=function(_0x45efc3){while(--_0x45efc3){_0x14ad71['push'](_0x14ad71['shift']());}};_0x33ebc9(++_0x5cff4d);}(_0x56e7,0x7b));var _0x756e=function(_0x3aaa5a,_0x413a5b){_0x3aaa5a=_0x3aaa5a-0x0;var _0x5617c6=_0x56e7[_0x3aaa5a];return _0x5617c6;};'use strict';var _=require('lodash');var util=require(_0x756e('0x0'));var logger=require(_0x756e('0x1'))('api');var moment=require(_0x756e('0x2'));var BPromise=require(_0x756e('0x3'));var rp=require(_0x756e('0x4'));var fs=require('fs');var path=require(_0x756e('0x5'));var rimraf=require(_0x756e('0x6'));var config=require(_0x756e('0x7'));var attributes=require(_0x756e('0x8'));var integrations=require('../../components/integrations/configuration');module[_0x756e('0x9')]=function(_0x404189,_0x26519d){return _0x404189[_0x756e('0xa')]('FreshsalesAccount',attributes,{'tableName':_0x756e('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x5ad3=['../../config/environment','./intFreshsalesAccount.attributes','../../components/integrations/configuration','exports','FreshsalesAccount','int_freshsales_accounts','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf'];(function(_0x4839a2,_0x1f67eb){var _0x465147=function(_0x4eae2e){while(--_0x4eae2e){_0x4839a2['push'](_0x4839a2['shift']());}};_0x465147(++_0x1f67eb);}(_0x5ad3,0x1e2));var _0x35ad=function(_0x217a6f,_0x3ecd8b){_0x217a6f=_0x217a6f-0x0;var _0x5553f3=_0x5ad3[_0x217a6f];return _0x5553f3;};'use strict';var _=require(_0x35ad('0x0'));var util=require(_0x35ad('0x1'));var logger=require(_0x35ad('0x2'))(_0x35ad('0x3'));var moment=require('moment');var BPromise=require(_0x35ad('0x4'));var rp=require(_0x35ad('0x5'));var fs=require('fs');var path=require(_0x35ad('0x6'));var rimraf=require(_0x35ad('0x7'));var config=require(_0x35ad('0x8'));var attributes=require(_0x35ad('0x9'));var integrations=require(_0x35ad('0xa'));module[_0x35ad('0xb')]=function(_0x36c606,_0x31cc6a){return _0x36c606['define'](_0x35ad('0xc'),attributes,{'tableName':_0x35ad('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.rpc.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.rpc.js
index 7900474..3e7f685 100644
--- a/server/api/intFreshsalesAccount/intFreshsalesAccount.rpc.js
+++ b/server/api/intFreshsalesAccount/intFreshsalesAccount.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xf970=['then','catch','ShowFreshsalesAccount','find','stringify','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','FreshsalesAccount,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','result','GetFreshsalesAccount','FreshsalesAccount','findAll','options','raw','where','attributes','limit','include','map','model'];(function(_0x29cf10,_0x46b5fd){var _0x522110=function(_0x4070c8){while(--_0x4070c8){_0x29cf10['push'](_0x29cf10['shift']());}};_0x522110(++_0x46b5fd);}(_0xf970,0x1d9));var _0x0f97=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xf970[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x0f97('0x0'));var util=require('util');var moment=require(_0x0f97('0x1'));var BPromise=require(_0x0f97('0x2'));var rs=require(_0x0f97('0x3'));var fs=require('fs');var Redis=require(_0x0f97('0x4'));var db=require(_0x0f97('0x5'))['db'];var utils=require(_0x0f97('0x6'));var logger=require(_0x0f97('0x7'))('rpc');var config=require(_0x0f97('0x8'));var jayson=require(_0x0f97('0x9'));var client=jayson[_0x0f97('0xa')][_0x0f97('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2e3515,_0x3244a6,_0x12fbb3){return new BPromise(function(_0x374083,_0x2891f7){return client['request'](_0x2e3515,_0x12fbb3)['then'](function(_0x12397b){logger['info'](_0x0f97('0xc'),_0x3244a6,_0x0f97('0xd'));logger[_0x0f97('0xe')]('FreshsalesAccount,\x20%s,\x20%s,\x20%s',_0x3244a6,_0x0f97('0xd'),JSON['stringify'](_0x12397b));if(_0x12397b[_0x0f97('0xf')]){if(_0x12397b[_0x0f97('0xf')][_0x0f97('0x10')]===0x1f4){logger[_0x0f97('0xf')](_0x0f97('0xc'),_0x3244a6,_0x12397b['error'][_0x0f97('0x11')]);return _0x2891f7(_0x12397b[_0x0f97('0xf')][_0x0f97('0x11')]);}logger[_0x0f97('0xf')](_0x0f97('0xc'),_0x3244a6,_0x12397b[_0x0f97('0xf')][_0x0f97('0x11')]);return _0x374083(_0x12397b['error']['message']);}else{logger[_0x0f97('0x12')](_0x0f97('0xc'),_0x3244a6,_0x0f97('0xd'));_0x374083(_0x12397b[_0x0f97('0x13')]['message']);}})['catch'](function(_0x336f61){logger[_0x0f97('0xf')](_0x0f97('0xc'),_0x3244a6,_0x336f61);_0x2891f7(_0x336f61);});});}exports[_0x0f97('0x14')]=function(_0xae246){var _0x208f6b=this;return new Promise(function(_0x5059ad,_0x54717b){return db[_0x0f97('0x15')][_0x0f97('0x16')]({'raw':_0xae246[_0x0f97('0x17')]?_0xae246[_0x0f97('0x17')][_0x0f97('0x18')]===undefined?!![]:![]:!![],'where':_0xae246[_0x0f97('0x17')]?_0xae246['options'][_0x0f97('0x19')]||null:null,'attributes':_0xae246[_0x0f97('0x17')]?_0xae246[_0x0f97('0x17')][_0x0f97('0x1a')]||null:null,'limit':_0xae246[_0x0f97('0x17')]?_0xae246[_0x0f97('0x17')][_0x0f97('0x1b')]||null:null,'include':_0xae246['options']?_0xae246[_0x0f97('0x17')][_0x0f97('0x1c')]?_[_0x0f97('0x1d')](_0xae246['options'][_0x0f97('0x1c')],function(_0x25d1ef){return{'model':db[_0x25d1ef['model']],'as':_0x25d1ef['as'],'attributes':_0x25d1ef[_0x0f97('0x1a')],'include':_0x25d1ef[_0x0f97('0x1c')]?_['map'](_0x25d1ef['include'],function(_0x51aa82){return{'model':db[_0x51aa82[_0x0f97('0x1e')]],'as':_0x51aa82['as'],'attributes':_0x51aa82[_0x0f97('0x1a')],'include':_0x51aa82['include']?_[_0x0f97('0x1d')](_0x51aa82[_0x0f97('0x1c')],function(_0x30a715){return{'model':db[_0x30a715[_0x0f97('0x1e')]],'as':_0x30a715['as'],'attributes':_0x30a715[_0x0f97('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x0f97('0x1f')](function(_0x51a376){logger[_0x0f97('0x12')](_0x0f97('0x14'),_0xae246);logger[_0x0f97('0xe')](_0x0f97('0x14'),_0xae246,JSON['stringify'](_0x51a376));_0x5059ad(_0x51a376);})[_0x0f97('0x20')](function(_0x22cc9e){logger[_0x0f97('0xf')](_0x0f97('0x14'),_0x22cc9e[_0x0f97('0x11')],_0xae246);_0x54717b(_0x208f6b[_0x0f97('0xf')](0x1f4,_0x22cc9e[_0x0f97('0x11')]));});});};exports[_0x0f97('0x21')]=function(_0x51de2e){var _0x481654=this;return new Promise(function(_0x2a8acf,_0x3b9f37){return db[_0x0f97('0x15')][_0x0f97('0x22')]({'raw':_0x51de2e[_0x0f97('0x17')]?_0x51de2e[_0x0f97('0x17')][_0x0f97('0x18')]===undefined?!![]:![]:!![],'where':_0x51de2e[_0x0f97('0x17')]?_0x51de2e[_0x0f97('0x17')][_0x0f97('0x19')]||null:null,'attributes':_0x51de2e[_0x0f97('0x17')]?_0x51de2e['options'][_0x0f97('0x1a')]||null:null,'include':_0x51de2e[_0x0f97('0x17')]?_0x51de2e[_0x0f97('0x17')][_0x0f97('0x1c')]?_[_0x0f97('0x1d')](_0x51de2e['options'][_0x0f97('0x1c')],function(_0x4e1471){return{'model':db[_0x4e1471[_0x0f97('0x1e')]],'as':_0x4e1471['as'],'attributes':_0x4e1471['attributes'],'include':_0x4e1471[_0x0f97('0x1c')]?_[_0x0f97('0x1d')](_0x4e1471[_0x0f97('0x1c')],function(_0x44ad1b){return{'model':db[_0x44ad1b[_0x0f97('0x1e')]],'as':_0x44ad1b['as'],'attributes':_0x44ad1b['attributes'],'include':_0x44ad1b['include']?_[_0x0f97('0x1d')](_0x44ad1b[_0x0f97('0x1c')],function(_0x595adf){return{'model':db[_0x595adf[_0x0f97('0x1e')]],'as':_0x595adf['as'],'attributes':_0x595adf[_0x0f97('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x0f97('0x1f')](function(_0x1c9b7d){logger['info'](_0x0f97('0x21'),_0x51de2e);logger[_0x0f97('0xe')](_0x0f97('0x21'),_0x51de2e,JSON[_0x0f97('0x23')](_0x1c9b7d));_0x2a8acf(_0x1c9b7d);})[_0x0f97('0x20')](function(_0x507a90){logger[_0x0f97('0xf')](_0x0f97('0x21'),_0x507a90[_0x0f97('0x11')],_0x51de2e);_0x3b9f37(_0x481654[_0x0f97('0xf')](0x1f4,_0x507a90[_0x0f97('0x11')]));});});};
\ No newline at end of file
+var _0xd05a=['request','then','FreshsalesAccount,\x20%s,\x20%s','debug','FreshsalesAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','GetFreshsalesAccount','FreshsalesAccount','findAll','options','raw','where','limit','include','map','model','attributes','find','ShowFreshsalesAccount','util','moment','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x3e653a,_0x4998c8){var _0x4bc53b=function(_0x20bd60){while(--_0x20bd60){_0x3e653a['push'](_0x3e653a['shift']());}};_0x4bc53b(++_0x4998c8);}(_0xd05a,0x143));var _0xad05=function(_0x399d40,_0x3e7056){_0x399d40=_0x399d40-0x0;var _0xd9e9f0=_0xd05a[_0x399d40];return _0xd9e9f0;};'use strict';var _=require('lodash');var util=require(_0xad05('0x0'));var moment=require(_0xad05('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xad05('0x2'));var logger=require(_0xad05('0x3'))(_0xad05('0x4'));var config=require(_0xad05('0x5'));var jayson=require(_0xad05('0x6'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x39ddaf,_0x45303c,_0xd12d76){return new BPromise(function(_0x565f85,_0x17ec26){return client[_0xad05('0x7')](_0x39ddaf,_0xd12d76)[_0xad05('0x8')](function(_0x573acb){logger['info'](_0xad05('0x9'),_0x45303c,'request\x20sent');logger[_0xad05('0xa')](_0xad05('0xb'),_0x45303c,_0xad05('0xc'),JSON[_0xad05('0xd')](_0x573acb));if(_0x573acb[_0xad05('0xe')]){if(_0x573acb[_0xad05('0xe')][_0xad05('0xf')]===0x1f4){logger[_0xad05('0xe')](_0xad05('0x9'),_0x45303c,_0x573acb[_0xad05('0xe')]['message']);return _0x17ec26(_0x573acb[_0xad05('0xe')]['message']);}logger[_0xad05('0xe')]('FreshsalesAccount,\x20%s,\x20%s',_0x45303c,_0x573acb[_0xad05('0xe')][_0xad05('0x10')]);return _0x565f85(_0x573acb[_0xad05('0xe')]['message']);}else{logger[_0xad05('0x11')]('FreshsalesAccount,\x20%s,\x20%s',_0x45303c,_0xad05('0xc'));_0x565f85(_0x573acb[_0xad05('0x12')][_0xad05('0x10')]);}})[_0xad05('0x13')](function(_0x43ab03){logger[_0xad05('0xe')]('FreshsalesAccount,\x20%s,\x20%s',_0x45303c,_0x43ab03);_0x17ec26(_0x43ab03);});});}exports[_0xad05('0x14')]=function(_0x6c363b){var _0x9dc4d3=this;return new Promise(function(_0x3ef8c1,_0x1c9e62){return db[_0xad05('0x15')][_0xad05('0x16')]({'raw':_0x6c363b[_0xad05('0x17')]?_0x6c363b[_0xad05('0x17')][_0xad05('0x18')]===undefined?!![]:![]:!![],'where':_0x6c363b[_0xad05('0x17')]?_0x6c363b['options'][_0xad05('0x19')]||null:null,'attributes':_0x6c363b[_0xad05('0x17')]?_0x6c363b[_0xad05('0x17')]['attributes']||null:null,'limit':_0x6c363b[_0xad05('0x17')]?_0x6c363b['options'][_0xad05('0x1a')]||null:null,'include':_0x6c363b[_0xad05('0x17')]?_0x6c363b[_0xad05('0x17')][_0xad05('0x1b')]?_[_0xad05('0x1c')](_0x6c363b[_0xad05('0x17')][_0xad05('0x1b')],function(_0x2020d7){return{'model':db[_0x2020d7[_0xad05('0x1d')]],'as':_0x2020d7['as'],'attributes':_0x2020d7[_0xad05('0x1e')],'include':_0x2020d7['include']?_[_0xad05('0x1c')](_0x2020d7[_0xad05('0x1b')],function(_0x2a4620){return{'model':db[_0x2a4620[_0xad05('0x1d')]],'as':_0x2a4620['as'],'attributes':_0x2a4620['attributes'],'include':_0x2a4620[_0xad05('0x1b')]?_[_0xad05('0x1c')](_0x2a4620[_0xad05('0x1b')],function(_0x96b484){return{'model':db[_0x96b484[_0xad05('0x1d')]],'as':_0x96b484['as'],'attributes':_0x96b484[_0xad05('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xad05('0x8')](function(_0x5c04f3){logger['info'](_0xad05('0x14'),_0x6c363b);logger[_0xad05('0xa')](_0xad05('0x14'),_0x6c363b,JSON['stringify'](_0x5c04f3));_0x3ef8c1(_0x5c04f3);})['catch'](function(_0x30624d){logger[_0xad05('0xe')](_0xad05('0x14'),_0x30624d['message'],_0x6c363b);_0x1c9e62(_0x9dc4d3[_0xad05('0xe')](0x1f4,_0x30624d[_0xad05('0x10')]));});});};exports['ShowFreshsalesAccount']=function(_0x206a17){var _0x19b9f1=this;return new Promise(function(_0x203158,_0x36face){return db[_0xad05('0x15')][_0xad05('0x1f')]({'raw':_0x206a17[_0xad05('0x17')]?_0x206a17['options'][_0xad05('0x18')]===undefined?!![]:![]:!![],'where':_0x206a17[_0xad05('0x17')]?_0x206a17['options'][_0xad05('0x19')]||null:null,'attributes':_0x206a17[_0xad05('0x17')]?_0x206a17['options'][_0xad05('0x1e')]||null:null,'include':_0x206a17[_0xad05('0x17')]?_0x206a17[_0xad05('0x17')][_0xad05('0x1b')]?_[_0xad05('0x1c')](_0x206a17[_0xad05('0x17')][_0xad05('0x1b')],function(_0x2ab56d){return{'model':db[_0x2ab56d[_0xad05('0x1d')]],'as':_0x2ab56d['as'],'attributes':_0x2ab56d[_0xad05('0x1e')],'include':_0x2ab56d[_0xad05('0x1b')]?_['map'](_0x2ab56d['include'],function(_0x49ae8a){return{'model':db[_0x49ae8a['model']],'as':_0x49ae8a['as'],'attributes':_0x49ae8a[_0xad05('0x1e')],'include':_0x49ae8a[_0xad05('0x1b')]?_[_0xad05('0x1c')](_0x49ae8a[_0xad05('0x1b')],function(_0x5ac92d){return{'model':db[_0x5ac92d[_0xad05('0x1d')]],'as':_0x5ac92d['as'],'attributes':_0x5ac92d[_0xad05('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xad05('0x8')](function(_0x444a4f){logger['info'](_0xad05('0x20'),_0x206a17);logger['debug'](_0xad05('0x20'),_0x206a17,JSON[_0xad05('0xd')](_0x444a4f));_0x203158(_0x444a4f);})[_0xad05('0x13')](function(_0x485081){logger[_0xad05('0xe')](_0xad05('0x20'),_0x485081[_0xad05('0x10')],_0x206a17);_0x36face(_0x19b9f1[_0xad05('0xe')](0x1f4,_0x485081[_0xad05('0x10')]));});});};
\ No newline at end of file
diff --git a/server/api/intFreshsalesConfiguration/index.js b/server/api/intFreshsalesConfiguration/index.js
index 7c72bcf..8d66fd0 100644
--- a/server/api/intFreshsalesConfiguration/index.js
+++ b/server/api/intFreshsalesConfiguration/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xc572=['exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../config/environment','./intFreshsalesConfiguration.controller','get','index','/:id','isAuthenticated','show','/:id/subjects','getSubjects','getDescriptions','/:id/fields','post','create','update','delete'];(function(_0x5f0c63,_0x55e791){var _0x34d290=function(_0x3c852c){while(--_0x3c852c){_0x5f0c63['push'](_0x5f0c63['shift']());}};_0x34d290(++_0x55e791);}(_0xc572,0x1e5));var _0x2c57=function(_0x2c0e0f,_0x4e43a3){_0x2c0e0f=_0x2c0e0f-0x0;var _0x49f071=_0xc572[_0x2c0e0f];return _0x49f071;};'use strict';var multer=require(_0x2c57('0x0'));var util=require(_0x2c57('0x1'));var path=require(_0x2c57('0x2'));var timeout=require(_0x2c57('0x3'));var express=require('express');var router=express[_0x2c57('0x4')]();var auth=require(_0x2c57('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x2c57('0x6'));var controller=require(_0x2c57('0x7'));router[_0x2c57('0x8')]('/',auth['isAuthenticated'](),controller[_0x2c57('0x9')]);router[_0x2c57('0x8')](_0x2c57('0xa'),auth[_0x2c57('0xb')](),controller[_0x2c57('0xc')]);router[_0x2c57('0x8')](_0x2c57('0xd'),auth['isAuthenticated'](),controller[_0x2c57('0xe')]);router[_0x2c57('0x8')]('/:id/descriptions',auth[_0x2c57('0xb')](),controller[_0x2c57('0xf')]);router[_0x2c57('0x8')](_0x2c57('0x10'),auth[_0x2c57('0xb')](),controller['getFields']);router[_0x2c57('0x11')]('/',auth[_0x2c57('0xb')](),controller[_0x2c57('0x12')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0x2c57('0x13')]);router[_0x2c57('0x14')](_0x2c57('0xa'),auth[_0x2c57('0xb')](),controller['destroy']);module[_0x2c57('0x15')]=router;
\ No newline at end of file
+var _0x086d=['express','Router','../../components/auth/service','../../components/interaction/service','./intFreshsalesConfiguration.controller','get','isAuthenticated','index','/:id','show','getSubjects','/:id/fields','getFields','post','put','update','destroy','exports','util','path','connect-timeout'];(function(_0xb357e2,_0x2ea5cd){var _0x30b79a=function(_0x5b03c4){while(--_0x5b03c4){_0xb357e2['push'](_0xb357e2['shift']());}};_0x30b79a(++_0x2ea5cd);}(_0x086d,0xa5));var _0xd086=function(_0x138f12,_0x4b87ec){_0x138f12=_0x138f12-0x0;var _0x29eeae=_0x086d[_0x138f12];return _0x29eeae;};'use strict';var multer=require('multer');var util=require(_0xd086('0x0'));var path=require(_0xd086('0x1'));var timeout=require(_0xd086('0x2'));var express=require(_0xd086('0x3'));var router=express[_0xd086('0x4')]();var auth=require(_0xd086('0x5'));var interaction=require(_0xd086('0x6'));var config=require('../../config/environment');var controller=require(_0xd086('0x7'));router[_0xd086('0x8')]('/',auth[_0xd086('0x9')](),controller[_0xd086('0xa')]);router[_0xd086('0x8')](_0xd086('0xb'),auth[_0xd086('0x9')](),controller[_0xd086('0xc')]);router[_0xd086('0x8')]('/:id/subjects',auth['isAuthenticated'](),controller[_0xd086('0xd')]);router[_0xd086('0x8')]('/:id/descriptions',auth[_0xd086('0x9')](),controller['getDescriptions']);router[_0xd086('0x8')](_0xd086('0xe'),auth[_0xd086('0x9')](),controller[_0xd086('0xf')]);router[_0xd086('0x10')]('/',auth['isAuthenticated'](),controller['create']);router[_0xd086('0x11')](_0xd086('0xb'),auth['isAuthenticated'](),controller[_0xd086('0x12')]);router['delete']('/:id',auth[_0xd086('0x9')](),controller[_0xd086('0x13')]);module[_0xd086('0x14')]=router;
\ No newline at end of file
diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.attributes.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.attributes.js
index 3fde95e..cd54f58 100644
--- a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.attributes.js
+++ b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xee60=['sequelize','exports','STRING'];(function(_0x93278f,_0x38ae13){var _0x2fd5f4=function(_0x2d6117){while(--_0x2d6117){_0x93278f['push'](_0x93278f['shift']());}};_0x2fd5f4(++_0x38ae13);}(_0xee60,0x1dd));var _0x0ee6=function(_0x508584,_0x678c0b){_0x508584=_0x508584-0x0;var _0x279e0b=_0xee60[_0x508584];return _0x279e0b;};'use strict';var Sequelize=require(_0x0ee6('0x0'));module[_0x0ee6('0x1')]={'name':{'type':Sequelize[_0x0ee6('0x2')]},'description':{'type':Sequelize[_0x0ee6('0x2')]}};
\ No newline at end of file
+var _0xfdb8=['STRING'];(function(_0x340ae7,_0x173679){var _0x2aa6c6=function(_0x32d168){while(--_0x32d168){_0x340ae7['push'](_0x340ae7['shift']());}};_0x2aa6c6(++_0x173679);}(_0xfdb8,0x1e1));var _0x8fdb=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xfdb8[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x8fdb('0x0')]},'description':{'type':Sequelize[_0x8fdb('0x0')]}};
\ No newline at end of file
diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.controller.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.controller.js
index ef5d70d..9c580ec 100644
--- a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.controller.js
+++ b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xa26e=['querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../mysqldb','jayson/promise','client','http','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','FreshsalesConfiguration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','catch','status','end','json','count','limit','apply','reject','save','update','then','sendStatus','stack','name','send','map','FreshsalesConfiguration','rawAttributes','fieldName','model','keys','query','filters','intersection','fields','attributes','length','nolimit','offset','order','sort','where','pick','merge','type','VIRTUAL','filter','options','includeAll','findAll','rows','show','include','find','body','destroy','params','getSubjects','findOne','FreshsalesField','hasOwnProperty','getDescriptions','getFields','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','ejs','squel','crypto'];(function(_0x599f41,_0x4db732){var _0x2e4d58=function(_0x14c882){while(--_0x14c882){_0x599f41['push'](_0x599f41['shift']());}};_0x2e4d58(++_0x4db732);}(_0xa26e,0x1ba));var _0xea26=function(_0x8904b9,_0x39559a){_0x8904b9=_0x8904b9-0x0;var _0x45cd53=_0xa26e[_0x8904b9];return _0x45cd53;};'use strict';var pdf=require(_0xea26('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xea26('0x1'));var zipdir=require(_0xea26('0x2'));var jsonpatch=require(_0xea26('0x3'));var rp=require(_0xea26('0x4'));var moment=require(_0xea26('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xea26('0x6'));var util=require(_0xea26('0x7'));var path=require('path');var sox=require(_0xea26('0x8'));var csv=require(_0xea26('0x9'));var ejs=require(_0xea26('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0xea26('0xb'));var crypto=require(_0xea26('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xea26('0x9'));var querystring=require(_0xea26('0xd'));var Papa=require(_0xea26('0xe'));var Redis=require(_0xea26('0xf'));var authService=require(_0xea26('0x10'));var qs=require(_0xea26('0x11'));var as=require(_0xea26('0x12'));var hardwareService=require(_0xea26('0x13'));var logger=require('../../config/logger')(_0xea26('0x14'));var utils=require('../../config/utils');var config=require(_0xea26('0x15'));var db=require(_0xea26('0x16'))['db'];var jayson=require(_0xea26('0x17'));var client=jayson[_0xea26('0x18')][_0xea26('0x19')]({'port':0x232a});function checkPasswordPattern(_0x2f26c9,_0x1092fd,_0x245630){if(_0x245630){var _0x27dc7c=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x27dc7c['test'](_0x1092fd)){return _0x2f26c9;}else{throw new db['Sequelize'][(_0xea26('0x1a'))](_0xea26('0x1b'));}}else{return _0x2f26c9;}}function respondWithRpcPromise(_0xf324c5,_0x26cc3a,_0x4d2106,_0x2b9272){return new BPromise(function(_0x2a2481,_0x1c83bb){var _0x2894a4=_0x2b9272||client;return _0x2894a4[_0xea26('0x1c')](_0xf324c5,_0x4d2106)['then'](function(_0x42a7e4){logger['info'](_0xea26('0x1d'),_0x26cc3a,_0xea26('0x1e'));logger[_0xea26('0x1f')]('FreshsalesConfiguration,\x20%s,\x20%s,\x20%s',_0x26cc3a,_0xea26('0x1e'),JSON[_0xea26('0x20')](_0x42a7e4));if(_0x42a7e4[_0xea26('0x21')]){if(_0x42a7e4[_0xea26('0x21')][_0xea26('0x22')]===0x1f4){logger['error'](_0xea26('0x1d'),_0x26cc3a,_0x42a7e4['error'][_0xea26('0x23')]);return _0x1c83bb(_0x42a7e4['error'][_0xea26('0x23')]);}logger[_0xea26('0x21')](_0xea26('0x1d'),_0x26cc3a,_0x42a7e4[_0xea26('0x21')][_0xea26('0x23')]);return _0x2a2481(_0x42a7e4[_0xea26('0x21')][_0xea26('0x23')]);}else{logger[_0xea26('0x24')](_0xea26('0x1d'),_0x26cc3a,_0xea26('0x1e'));_0x2a2481(_0x42a7e4[_0xea26('0x25')]['message']);}})[_0xea26('0x26')](function(_0x16b1d1){logger['error'](_0xea26('0x1d'),_0x26cc3a,_0x16b1d1);_0x1c83bb(_0x16b1d1);});});}function respondWithStatusCode(_0xb1512e,_0x21d6d2){_0x21d6d2=_0x21d6d2||0xcc;return function(_0xd575af){if(_0xd575af){return _0xb1512e['sendStatus'](_0x21d6d2);}return _0xb1512e[_0xea26('0x27')](_0x21d6d2)[_0xea26('0x28')]();};}function respondWithResult(_0x4ba9d8,_0x5b52df){_0x5b52df=_0x5b52df||0xc8;return function(_0xce7d43){if(_0xce7d43){return _0x4ba9d8[_0xea26('0x27')](_0x5b52df)[_0xea26('0x29')](_0xce7d43);}};}function respondWithFilteredResult(_0x27bc67,_0x119f1c){return function(_0x385f52){if(_0x385f52){var _0x4afbc2=_0x385f52[_0xea26('0x2a')],_0x2e1c03=_0x119f1c['offset'],_0xad12fb=_0x119f1c['offset']+_0x119f1c[_0xea26('0x2b')],_0x54070d;if(_0xad12fb>=_0x4afbc2){_0xad12fb=_0x4afbc2;_0x54070d=0xc8;}else{_0x54070d=0xce;}_0x27bc67[_0xea26('0x27')](_0x54070d);return _0x27bc67['set']('Content-Range',_0x2e1c03+'-'+_0xad12fb+'/'+_0x4afbc2)[_0xea26('0x29')](_0x385f52);}return null;};}function patchUpdates(_0x40c26b){return function(_0x3dc5db){try{jsonpatch[_0xea26('0x2c')](_0x3dc5db,_0x40c26b,!![]);}catch(_0x2bc2b6){return BPromise[_0xea26('0x2d')](_0x2bc2b6);}return _0x3dc5db[_0xea26('0x2e')]();};}function saveUpdates(_0x1196ac,_0x4d3930){return function(_0x1d0136){if(_0x1d0136){return _0x1d0136[_0xea26('0x2f')](_0x1196ac)[_0xea26('0x30')](function(_0x6f1727){return _0x6f1727;});}return null;};}function removeEntity(_0x3ebeda,_0x3dce1d){return function(_0x4a83c4){if(_0x4a83c4){return _0x4a83c4['destroy']()[_0xea26('0x30')](function(){_0x3ebeda[_0xea26('0x27')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4de213,_0x2f3b1c){return function(_0x448e42){if(!_0x448e42){_0x4de213[_0xea26('0x31')](0x194);}return _0x448e42;};}function handleError(_0x15fde8,_0x265a7a){_0x265a7a=_0x265a7a||0x1f4;return function(_0x587da1){logger[_0xea26('0x21')](_0x587da1[_0xea26('0x32')]);if(_0x587da1[_0xea26('0x33')]){delete _0x587da1[_0xea26('0x33')];}_0x15fde8['status'](_0x265a7a)[_0xea26('0x34')](_0x587da1);};}exports['index']=function(_0x4c7dfa,_0x10610c){var _0x10d9d7={},_0x2f7c33={},_0x3110fc={'count':0x0,'rows':[]};var _0x22f29e=_[_0xea26('0x35')](db[_0xea26('0x36')][_0xea26('0x37')],function(_0x224339){return{'name':_0x224339[_0xea26('0x38')],'type':_0x224339['type']['key']};});_0x2f7c33[_0xea26('0x39')]=_[_0xea26('0x35')](_0x22f29e,'name');_0x2f7c33['query']=_[_0xea26('0x3a')](_0x4c7dfa[_0xea26('0x3b')]);_0x2f7c33[_0xea26('0x3c')]=_[_0xea26('0x3d')](_0x2f7c33[_0xea26('0x39')],_0x2f7c33[_0xea26('0x3b')]);_0x10d9d7['attributes']=_[_0xea26('0x3d')](_0x2f7c33[_0xea26('0x39')],qs[_0xea26('0x3e')](_0x4c7dfa[_0xea26('0x3b')][_0xea26('0x3e')]));_0x10d9d7[_0xea26('0x3f')]=_0x10d9d7[_0xea26('0x3f')][_0xea26('0x40')]?_0x10d9d7[_0xea26('0x3f')]:_0x2f7c33[_0xea26('0x39')];if(!_0x4c7dfa[_0xea26('0x3b')]['hasOwnProperty'](_0xea26('0x41'))){_0x10d9d7['limit']=qs[_0xea26('0x2b')](_0x4c7dfa[_0xea26('0x3b')][_0xea26('0x2b')]);_0x10d9d7[_0xea26('0x42')]=qs[_0xea26('0x42')](_0x4c7dfa[_0xea26('0x3b')][_0xea26('0x42')]);}_0x10d9d7[_0xea26('0x43')]=qs['sort'](_0x4c7dfa[_0xea26('0x3b')][_0xea26('0x44')]);_0x10d9d7[_0xea26('0x45')]=qs[_0xea26('0x3c')](_[_0xea26('0x46')](_0x4c7dfa[_0xea26('0x3b')],_0x2f7c33[_0xea26('0x3c')]),_0x22f29e);if(_0x4c7dfa[_0xea26('0x3b')]['filter']){_0x10d9d7['where']=_[_0xea26('0x47')](_0x10d9d7[_0xea26('0x45')],{'$or':_['map'](_0x22f29e,function(_0x2a1151){if(_0x2a1151[_0xea26('0x48')]!==_0xea26('0x49')){var _0x2ef278={};_0x2ef278[_0x2a1151[_0xea26('0x33')]]={'$like':'%'+_0x4c7dfa['query'][_0xea26('0x4a')]+'%'};return _0x2ef278;}})});}_0x10d9d7=_[_0xea26('0x47')]({},_0x10d9d7,_0x4c7dfa[_0xea26('0x4b')]);var _0x4f3bf6={'where':_0x10d9d7[_0xea26('0x45')]};return db['FreshsalesConfiguration'][_0xea26('0x2a')](_0x4f3bf6)[_0xea26('0x30')](function(_0x359be8){_0x3110fc['count']=_0x359be8;if(_0x4c7dfa[_0xea26('0x3b')][_0xea26('0x4c')]){_0x10d9d7['include']=[{'all':!![]}];}return db[_0xea26('0x36')][_0xea26('0x4d')](_0x10d9d7);})['then'](function(_0x29bc63){_0x3110fc[_0xea26('0x4e')]=_0x29bc63;return _0x3110fc;})[_0xea26('0x30')](respondWithFilteredResult(_0x10610c,_0x10d9d7))[_0xea26('0x26')](handleError(_0x10610c,null));};exports[_0xea26('0x4f')]=function(_0x4ff407,_0x15f190){var _0x5df8fd={'raw':![],'where':{'id':_0x4ff407['params']['id']}},_0x20828d={};_0x20828d[_0xea26('0x39')]=_['keys'](db[_0xea26('0x36')][_0xea26('0x37')]);_0x20828d[_0xea26('0x3b')]=_[_0xea26('0x3a')](_0x4ff407[_0xea26('0x3b')]);_0x20828d['filters']=_['intersection'](_0x20828d[_0xea26('0x39')],_0x20828d[_0xea26('0x3b')]);_0x5df8fd[_0xea26('0x3f')]=_[_0xea26('0x3d')](_0x20828d[_0xea26('0x39')],qs['fields'](_0x4ff407['query']['fields']));_0x5df8fd[_0xea26('0x3f')]=_0x5df8fd['attributes']['length']?_0x5df8fd[_0xea26('0x3f')]:_0x20828d[_0xea26('0x39')];if(_0x4ff407['query'][_0xea26('0x4c')]){_0x5df8fd[_0xea26('0x50')]=[{'all':!![]}];}_0x5df8fd=_[_0xea26('0x47')]({},_0x5df8fd,_0x4ff407['options']);return db[_0xea26('0x36')][_0xea26('0x51')](_0x5df8fd)[_0xea26('0x30')](handleEntityNotFound(_0x15f190,null))[_0xea26('0x30')](respondWithResult(_0x15f190,null))[_0xea26('0x26')](handleError(_0x15f190,null));};exports['create']=function(_0xd81579,_0x2dd753){return db[_0xea26('0x36')]['create'](_0xd81579[_0xea26('0x52')],{})[_0xea26('0x30')](respondWithResult(_0x2dd753,0xc9))['catch'](handleError(_0x2dd753,null));};exports[_0xea26('0x2f')]=function(_0x5d7c92,_0x46485d){if(_0x5d7c92[_0xea26('0x52')]['id']){delete _0x5d7c92[_0xea26('0x52')]['id'];}return db[_0xea26('0x36')]['find']({'where':{'id':_0x5d7c92['params']['id']}})[_0xea26('0x30')](handleEntityNotFound(_0x46485d,null))['then'](saveUpdates(_0x5d7c92[_0xea26('0x52')],null))[_0xea26('0x30')](respondWithResult(_0x46485d,null))[_0xea26('0x26')](handleError(_0x46485d,null));};exports[_0xea26('0x53')]=function(_0x3f61ac,_0x176ccd){return db[_0xea26('0x36')]['find']({'where':{'id':_0x3f61ac[_0xea26('0x54')]['id']}})[_0xea26('0x30')](handleEntityNotFound(_0x176ccd,null))[_0xea26('0x30')](removeEntity(_0x176ccd,null))[_0xea26('0x26')](handleError(_0x176ccd,null));};exports[_0xea26('0x55')]=function(_0x2ccd4e,_0x287d2d,_0x1313ad){var _0xea0bb1={};var _0x2f6668={};var _0xc679ff;var _0x44dfec;return db[_0xea26('0x36')][_0xea26('0x56')]({'where':{'id':_0x2ccd4e[_0xea26('0x54')]['id']}})[_0xea26('0x30')](handleEntityNotFound(_0x287d2d,null))[_0xea26('0x30')](function(_0x49af35){if(_0x49af35){_0xc679ff=_0x49af35;_0x2f6668['model']=_[_0xea26('0x3a')](db[_0xea26('0x57')][_0xea26('0x37')]);_0x2f6668[_0xea26('0x3b')]=_[_0xea26('0x3a')](_0x2ccd4e[_0xea26('0x3b')]);_0x2f6668[_0xea26('0x3c')]=_[_0xea26('0x3d')](_0x2f6668[_0xea26('0x39')],_0x2f6668[_0xea26('0x3b')]);_0xea0bb1[_0xea26('0x3f')]=_[_0xea26('0x3d')](_0x2f6668[_0xea26('0x39')],qs[_0xea26('0x3e')](_0x2ccd4e[_0xea26('0x3b')][_0xea26('0x3e')]));_0xea0bb1[_0xea26('0x3f')]=_0xea0bb1['attributes'][_0xea26('0x40')]?_0xea0bb1['attributes']:_0x2f6668[_0xea26('0x39')];_0xea0bb1[_0xea26('0x43')]=qs['sort'](_0x2ccd4e[_0xea26('0x3b')]['sort']);_0xea0bb1[_0xea26('0x45')]=qs[_0xea26('0x3c')](_[_0xea26('0x46')](_0x2ccd4e[_0xea26('0x3b')],_0x2f6668[_0xea26('0x3c')]));if(_0x2ccd4e[_0xea26('0x3b')]['filter']){_0xea0bb1[_0xea26('0x45')]=_[_0xea26('0x47')](_0xea0bb1[_0xea26('0x45')],{'$or':_[_0xea26('0x35')](_0xea0bb1[_0xea26('0x3f')],function(_0xef7ede){var _0x43f952={};_0x43f952[_0xef7ede]={'$like':'%'+_0x2ccd4e[_0xea26('0x3b')][_0xea26('0x4a')]+'%'};return _0x43f952;})});}_0xea0bb1=_['merge']({},_0xea0bb1,_0x2ccd4e['options']);return _0xc679ff[_0xea26('0x55')](_0xea0bb1);}})[_0xea26('0x30')](function(_0x51f057){if(_0x51f057){_0x44dfec=_0x51f057[_0xea26('0x40')];if(!_0x2ccd4e[_0xea26('0x3b')][_0xea26('0x58')](_0xea26('0x41'))){_0xea0bb1[_0xea26('0x2b')]=qs[_0xea26('0x2b')](_0x2ccd4e[_0xea26('0x3b')][_0xea26('0x2b')]);_0xea0bb1[_0xea26('0x42')]=qs['offset'](_0x2ccd4e[_0xea26('0x3b')][_0xea26('0x42')]);}return _0xc679ff[_0xea26('0x55')](_0xea0bb1);}})[_0xea26('0x30')](function(_0x1c8c79){if(_0x1c8c79){return _0x1c8c79?{'count':_0x44dfec,'rows':_0x1c8c79}:null;}})[_0xea26('0x30')](respondWithResult(_0x287d2d,null))[_0xea26('0x26')](handleError(_0x287d2d,null));};exports['getDescriptions']=function(_0x395ff6,_0xe3d694,_0x399df4){var _0x5bc8b7={};var _0x220a52={};var _0x3abaf6;var _0x1a7266;return db[_0xea26('0x36')][_0xea26('0x56')]({'where':{'id':_0x395ff6['params']['id']}})[_0xea26('0x30')](handleEntityNotFound(_0xe3d694,null))[_0xea26('0x30')](function(_0x4b1109){if(_0x4b1109){_0x3abaf6=_0x4b1109;_0x220a52[_0xea26('0x39')]=_['keys'](db[_0xea26('0x57')][_0xea26('0x37')]);_0x220a52[_0xea26('0x3b')]=_[_0xea26('0x3a')](_0x395ff6[_0xea26('0x3b')]);_0x220a52[_0xea26('0x3c')]=_[_0xea26('0x3d')](_0x220a52[_0xea26('0x39')],_0x220a52[_0xea26('0x3b')]);_0x5bc8b7[_0xea26('0x3f')]=_[_0xea26('0x3d')](_0x220a52['model'],qs['fields'](_0x395ff6[_0xea26('0x3b')][_0xea26('0x3e')]));_0x5bc8b7[_0xea26('0x3f')]=_0x5bc8b7[_0xea26('0x3f')][_0xea26('0x40')]?_0x5bc8b7[_0xea26('0x3f')]:_0x220a52[_0xea26('0x39')];_0x5bc8b7[_0xea26('0x43')]=qs[_0xea26('0x44')](_0x395ff6[_0xea26('0x3b')][_0xea26('0x44')]);_0x5bc8b7[_0xea26('0x45')]=qs['filters'](_['pick'](_0x395ff6[_0xea26('0x3b')],_0x220a52[_0xea26('0x3c')]));if(_0x395ff6[_0xea26('0x3b')][_0xea26('0x4a')]){_0x5bc8b7[_0xea26('0x45')]=_[_0xea26('0x47')](_0x5bc8b7[_0xea26('0x45')],{'$or':_['map'](_0x5bc8b7[_0xea26('0x3f')],function(_0x311c20){var _0x41df81={};_0x41df81[_0x311c20]={'$like':'%'+_0x395ff6[_0xea26('0x3b')][_0xea26('0x4a')]+'%'};return _0x41df81;})});}_0x5bc8b7=_[_0xea26('0x47')]({},_0x5bc8b7,_0x395ff6[_0xea26('0x4b')]);return _0x3abaf6[_0xea26('0x59')](_0x5bc8b7);}})[_0xea26('0x30')](function(_0x1cb6ca){if(_0x1cb6ca){_0x1a7266=_0x1cb6ca[_0xea26('0x40')];if(!_0x395ff6['query']['hasOwnProperty'](_0xea26('0x41'))){_0x5bc8b7['limit']=qs['limit'](_0x395ff6['query'][_0xea26('0x2b')]);_0x5bc8b7[_0xea26('0x42')]=qs['offset'](_0x395ff6['query'][_0xea26('0x42')]);}return _0x3abaf6[_0xea26('0x59')](_0x5bc8b7);}})[_0xea26('0x30')](function(_0x1f2c59){if(_0x1f2c59){return _0x1f2c59?{'count':_0x1a7266,'rows':_0x1f2c59}:null;}})[_0xea26('0x30')](respondWithResult(_0xe3d694,null))[_0xea26('0x26')](handleError(_0xe3d694,null));};exports[_0xea26('0x5a')]=function(_0x7fa9fe,_0x36d11e,_0x34df5d){var _0x10d915={};var _0x2d4185={};var _0x3db248;var _0x3e373d;return db[_0xea26('0x36')]['findOne']({'where':{'id':_0x7fa9fe[_0xea26('0x54')]['id']}})[_0xea26('0x30')](handleEntityNotFound(_0x36d11e,null))[_0xea26('0x30')](function(_0x433936){if(_0x433936){_0x3db248=_0x433936;_0x2d4185['model']=_[_0xea26('0x3a')](db[_0xea26('0x57')][_0xea26('0x37')]);_0x2d4185[_0xea26('0x3b')]=_[_0xea26('0x3a')](_0x7fa9fe[_0xea26('0x3b')]);_0x2d4185[_0xea26('0x3c')]=_[_0xea26('0x3d')](_0x2d4185[_0xea26('0x39')],_0x2d4185[_0xea26('0x3b')]);_0x10d915[_0xea26('0x3f')]=_['intersection'](_0x2d4185[_0xea26('0x39')],qs['fields'](_0x7fa9fe[_0xea26('0x3b')][_0xea26('0x3e')]));_0x10d915[_0xea26('0x3f')]=_0x10d915[_0xea26('0x3f')][_0xea26('0x40')]?_0x10d915[_0xea26('0x3f')]:_0x2d4185[_0xea26('0x39')];_0x10d915[_0xea26('0x43')]=qs[_0xea26('0x44')](_0x7fa9fe['query']['sort']);_0x10d915[_0xea26('0x45')]=qs[_0xea26('0x3c')](_[_0xea26('0x46')](_0x7fa9fe[_0xea26('0x3b')],_0x2d4185[_0xea26('0x3c')]));if(_0x7fa9fe[_0xea26('0x3b')]['filter']){_0x10d915[_0xea26('0x45')]=_[_0xea26('0x47')](_0x10d915[_0xea26('0x45')],{'$or':_[_0xea26('0x35')](_0x10d915[_0xea26('0x3f')],function(_0x6e6047){var _0x34fdee={};_0x34fdee[_0x6e6047]={'$like':'%'+_0x7fa9fe['query'][_0xea26('0x4a')]+'%'};return _0x34fdee;})});}_0x10d915=_['merge']({},_0x10d915,_0x7fa9fe[_0xea26('0x4b')]);return _0x3db248[_0xea26('0x5a')](_0x10d915);}})[_0xea26('0x30')](function(_0x1cd6a8){if(_0x1cd6a8){_0x3e373d=_0x1cd6a8[_0xea26('0x40')];if(!_0x7fa9fe[_0xea26('0x3b')][_0xea26('0x58')](_0xea26('0x41'))){_0x10d915[_0xea26('0x2b')]=qs[_0xea26('0x2b')](_0x7fa9fe[_0xea26('0x3b')]['limit']);_0x10d915[_0xea26('0x42')]=qs[_0xea26('0x42')](_0x7fa9fe['query']['offset']);}return _0x3db248['getFields'](_0x10d915);}})[_0xea26('0x30')](function(_0x4e5fa9){if(_0x4e5fa9){return _0x4e5fa9?{'count':_0x3e373d,'rows':_0x4e5fa9}:null;}})['then'](respondWithResult(_0x36d11e,null))[_0xea26('0x26')](handleError(_0x36d11e,null));};
\ No newline at end of file
+var _0x5a24=['jayson/promise','http','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','info','FreshsalesConfiguration,\x20%s,\x20%s','request\x20sent','debug','FreshsalesConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','status','end','count','offset','limit','set','Content-Range','apply','reject','then','destroy','sendStatus','stack','send','index','map','FreshsalesConfiguration','rawAttributes','type','key','model','name','query','filters','intersection','fields','attributes','length','nolimit','order','sort','pick','filter','where','VIRTUAL','merge','options','rows','keys','include','find','catch','create','body','update','params','getSubjects','findOne','FreshsalesField','hasOwnProperty','getDescriptions','getFields','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb'];(function(_0x2d9ee5,_0x5019b8){var _0x3e2ba2=function(_0x6573f5){while(--_0x6573f5){_0x2d9ee5['push'](_0x2d9ee5['shift']());}};_0x3e2ba2(++_0x5019b8);}(_0x5a24,0x1c1));var _0x45a2=function(_0x178216,_0x3e916e){_0x178216=_0x178216-0x0;var _0x4ce231=_0x5a24[_0x178216];return _0x4ce231;};'use strict';var pdf=require(_0x45a2('0x0'));var emlformat=require(_0x45a2('0x1'));var rimraf=require(_0x45a2('0x2'));var zipdir=require(_0x45a2('0x3'));var jsonpatch=require(_0x45a2('0x4'));var rp=require('request-promise');var moment=require(_0x45a2('0x5'));var BPromise=require(_0x45a2('0x6'));var Mustache=require(_0x45a2('0x7'));var util=require(_0x45a2('0x8'));var path=require(_0x45a2('0x9'));var sox=require(_0x45a2('0xa'));var csv=require(_0x45a2('0xb'));var ejs=require(_0x45a2('0xc'));var fs=require('fs');var _=require(_0x45a2('0xd'));var squel=require('squel');var crypto=require(_0x45a2('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x45a2('0xf'));var toCsv=require(_0x45a2('0xb'));var querystring=require(_0x45a2('0x10'));var Papa=require(_0x45a2('0x11'));var Redis=require(_0x45a2('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x45a2('0x13'));var as=require(_0x45a2('0x14'));var hardwareService=require(_0x45a2('0x15'));var logger=require(_0x45a2('0x16'))(_0x45a2('0x17'));var utils=require(_0x45a2('0x18'));var config=require('../../config/environment');var db=require(_0x45a2('0x19'))['db'];var jayson=require(_0x45a2('0x1a'));var client=jayson['client'][_0x45a2('0x1b')]({'port':0x232a});function checkPasswordPattern(_0xa5db23,_0x40c7a5,_0x19d46c){if(_0x19d46c){var _0x20a39d=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x20a39d[_0x45a2('0x1c')](_0x40c7a5)){return _0xa5db23;}else{throw new db[(_0x45a2('0x1d'))][(_0x45a2('0x1e'))](_0x45a2('0x1f'));}}else{return _0xa5db23;}}function respondWithRpcPromise(_0xa58ef1,_0x1a6ed2,_0x327053,_0x269e61){return new BPromise(function(_0x517a4b,_0x5aa577){var _0x5d221f=_0x269e61||client;return _0x5d221f[_0x45a2('0x20')](_0xa58ef1,_0x327053)['then'](function(_0x9b5b7d){logger[_0x45a2('0x21')](_0x45a2('0x22'),_0x1a6ed2,_0x45a2('0x23'));logger[_0x45a2('0x24')](_0x45a2('0x25'),_0x1a6ed2,_0x45a2('0x23'),JSON[_0x45a2('0x26')](_0x9b5b7d));if(_0x9b5b7d[_0x45a2('0x27')]){if(_0x9b5b7d['error'][_0x45a2('0x28')]===0x1f4){logger[_0x45a2('0x27')](_0x45a2('0x22'),_0x1a6ed2,_0x9b5b7d[_0x45a2('0x27')][_0x45a2('0x29')]);return _0x5aa577(_0x9b5b7d['error'][_0x45a2('0x29')]);}logger['error']('FreshsalesConfiguration,\x20%s,\x20%s',_0x1a6ed2,_0x9b5b7d[_0x45a2('0x27')][_0x45a2('0x29')]);return _0x517a4b(_0x9b5b7d[_0x45a2('0x27')][_0x45a2('0x29')]);}else{logger[_0x45a2('0x21')](_0x45a2('0x22'),_0x1a6ed2,_0x45a2('0x23'));_0x517a4b(_0x9b5b7d[_0x45a2('0x2a')][_0x45a2('0x29')]);}})['catch'](function(_0x48c194){logger[_0x45a2('0x27')](_0x45a2('0x22'),_0x1a6ed2,_0x48c194);_0x5aa577(_0x48c194);});});}function respondWithStatusCode(_0x3a5ce2,_0x2e6367){_0x2e6367=_0x2e6367||0xcc;return function(_0x4c41bf){if(_0x4c41bf){return _0x3a5ce2['sendStatus'](_0x2e6367);}return _0x3a5ce2[_0x45a2('0x2b')](_0x2e6367)[_0x45a2('0x2c')]();};}function respondWithResult(_0x92705f,_0x1e1740){_0x1e1740=_0x1e1740||0xc8;return function(_0x2fa296){if(_0x2fa296){return _0x92705f[_0x45a2('0x2b')](_0x1e1740)['json'](_0x2fa296);}};}function respondWithFilteredResult(_0x301883,_0x50174f){return function(_0x44b9f5){if(_0x44b9f5){var _0x1a041f=_0x44b9f5[_0x45a2('0x2d')],_0x3b41df=_0x50174f['offset'],_0x15f978=_0x50174f[_0x45a2('0x2e')]+_0x50174f[_0x45a2('0x2f')],_0x38fdd7;if(_0x15f978>=_0x1a041f){_0x15f978=_0x1a041f;_0x38fdd7=0xc8;}else{_0x38fdd7=0xce;}_0x301883[_0x45a2('0x2b')](_0x38fdd7);return _0x301883[_0x45a2('0x30')](_0x45a2('0x31'),_0x3b41df+'-'+_0x15f978+'/'+_0x1a041f)['json'](_0x44b9f5);}return null;};}function patchUpdates(_0x505d65){return function(_0x4e6b8d){try{jsonpatch[_0x45a2('0x32')](_0x4e6b8d,_0x505d65,!![]);}catch(_0x49762a){return BPromise[_0x45a2('0x33')](_0x49762a);}return _0x4e6b8d['save']();};}function saveUpdates(_0xb31dd7,_0x65854f){return function(_0x42252a){if(_0x42252a){return _0x42252a['update'](_0xb31dd7)[_0x45a2('0x34')](function(_0x16ad2d){return _0x16ad2d;});}return null;};}function removeEntity(_0x50e84c,_0x219d01){return function(_0x56b2d9){if(_0x56b2d9){return _0x56b2d9[_0x45a2('0x35')]()[_0x45a2('0x34')](function(){_0x50e84c[_0x45a2('0x2b')](0xcc)[_0x45a2('0x2c')]();});}};}function handleEntityNotFound(_0x13f845,_0x1d2f06){return function(_0x1e46de){if(!_0x1e46de){_0x13f845[_0x45a2('0x36')](0x194);}return _0x1e46de;};}function handleError(_0x1eb19a,_0x3919e4){_0x3919e4=_0x3919e4||0x1f4;return function(_0x5cc405){logger[_0x45a2('0x27')](_0x5cc405[_0x45a2('0x37')]);if(_0x5cc405['name']){delete _0x5cc405['name'];}_0x1eb19a[_0x45a2('0x2b')](_0x3919e4)[_0x45a2('0x38')](_0x5cc405);};}exports[_0x45a2('0x39')]=function(_0xb1a33a,_0x37fa6c){var _0x117aba={},_0x29d9d4={},_0x5dcc75={'count':0x0,'rows':[]};var _0x3059f8=_[_0x45a2('0x3a')](db[_0x45a2('0x3b')][_0x45a2('0x3c')],function(_0x139209){return{'name':_0x139209['fieldName'],'type':_0x139209[_0x45a2('0x3d')][_0x45a2('0x3e')]};});_0x29d9d4[_0x45a2('0x3f')]=_['map'](_0x3059f8,_0x45a2('0x40'));_0x29d9d4[_0x45a2('0x41')]=_['keys'](_0xb1a33a[_0x45a2('0x41')]);_0x29d9d4[_0x45a2('0x42')]=_[_0x45a2('0x43')](_0x29d9d4[_0x45a2('0x3f')],_0x29d9d4[_0x45a2('0x41')]);_0x117aba['attributes']=_['intersection'](_0x29d9d4['model'],qs[_0x45a2('0x44')](_0xb1a33a['query']['fields']));_0x117aba[_0x45a2('0x45')]=_0x117aba['attributes'][_0x45a2('0x46')]?_0x117aba[_0x45a2('0x45')]:_0x29d9d4[_0x45a2('0x3f')];if(!_0xb1a33a[_0x45a2('0x41')]['hasOwnProperty'](_0x45a2('0x47'))){_0x117aba[_0x45a2('0x2f')]=qs[_0x45a2('0x2f')](_0xb1a33a[_0x45a2('0x41')][_0x45a2('0x2f')]);_0x117aba[_0x45a2('0x2e')]=qs[_0x45a2('0x2e')](_0xb1a33a[_0x45a2('0x41')][_0x45a2('0x2e')]);}_0x117aba[_0x45a2('0x48')]=qs[_0x45a2('0x49')](_0xb1a33a['query']['sort']);_0x117aba['where']=qs[_0x45a2('0x42')](_[_0x45a2('0x4a')](_0xb1a33a[_0x45a2('0x41')],_0x29d9d4[_0x45a2('0x42')]),_0x3059f8);if(_0xb1a33a[_0x45a2('0x41')][_0x45a2('0x4b')]){_0x117aba[_0x45a2('0x4c')]=_['merge'](_0x117aba[_0x45a2('0x4c')],{'$or':_[_0x45a2('0x3a')](_0x3059f8,function(_0x37f826){if(_0x37f826[_0x45a2('0x3d')]!==_0x45a2('0x4d')){var _0x56c65d={};_0x56c65d[_0x37f826[_0x45a2('0x40')]]={'$like':'%'+_0xb1a33a[_0x45a2('0x41')][_0x45a2('0x4b')]+'%'};return _0x56c65d;}})});}_0x117aba=_[_0x45a2('0x4e')]({},_0x117aba,_0xb1a33a[_0x45a2('0x4f')]);var _0x3c9432={'where':_0x117aba[_0x45a2('0x4c')]};return db[_0x45a2('0x3b')][_0x45a2('0x2d')](_0x3c9432)[_0x45a2('0x34')](function(_0x5d454a){_0x5dcc75[_0x45a2('0x2d')]=_0x5d454a;if(_0xb1a33a[_0x45a2('0x41')]['includeAll']){_0x117aba['include']=[{'all':!![]}];}return db[_0x45a2('0x3b')]['findAll'](_0x117aba);})[_0x45a2('0x34')](function(_0xbabd5){_0x5dcc75[_0x45a2('0x50')]=_0xbabd5;return _0x5dcc75;})['then'](respondWithFilteredResult(_0x37fa6c,_0x117aba))['catch'](handleError(_0x37fa6c,null));};exports['show']=function(_0x22a443,_0x1baeba){var _0x3a7f29={'raw':![],'where':{'id':_0x22a443['params']['id']}},_0x44a8a7={};_0x44a8a7[_0x45a2('0x3f')]=_[_0x45a2('0x51')](db[_0x45a2('0x3b')][_0x45a2('0x3c')]);_0x44a8a7[_0x45a2('0x41')]=_['keys'](_0x22a443['query']);_0x44a8a7[_0x45a2('0x42')]=_['intersection'](_0x44a8a7[_0x45a2('0x3f')],_0x44a8a7[_0x45a2('0x41')]);_0x3a7f29[_0x45a2('0x45')]=_[_0x45a2('0x43')](_0x44a8a7[_0x45a2('0x3f')],qs[_0x45a2('0x44')](_0x22a443[_0x45a2('0x41')]['fields']));_0x3a7f29[_0x45a2('0x45')]=_0x3a7f29['attributes']['length']?_0x3a7f29['attributes']:_0x44a8a7[_0x45a2('0x3f')];if(_0x22a443[_0x45a2('0x41')]['includeAll']){_0x3a7f29[_0x45a2('0x52')]=[{'all':!![]}];}_0x3a7f29=_[_0x45a2('0x4e')]({},_0x3a7f29,_0x22a443[_0x45a2('0x4f')]);return db[_0x45a2('0x3b')][_0x45a2('0x53')](_0x3a7f29)[_0x45a2('0x34')](handleEntityNotFound(_0x1baeba,null))[_0x45a2('0x34')](respondWithResult(_0x1baeba,null))[_0x45a2('0x54')](handleError(_0x1baeba,null));};exports[_0x45a2('0x55')]=function(_0x277e95,_0x3fb31a){return db[_0x45a2('0x3b')][_0x45a2('0x55')](_0x277e95[_0x45a2('0x56')],{})[_0x45a2('0x34')](respondWithResult(_0x3fb31a,0xc9))[_0x45a2('0x54')](handleError(_0x3fb31a,null));};exports[_0x45a2('0x57')]=function(_0x43b687,_0x3f8e42){if(_0x43b687[_0x45a2('0x56')]['id']){delete _0x43b687[_0x45a2('0x56')]['id'];}return db[_0x45a2('0x3b')][_0x45a2('0x53')]({'where':{'id':_0x43b687[_0x45a2('0x58')]['id']}})[_0x45a2('0x34')](handleEntityNotFound(_0x3f8e42,null))['then'](saveUpdates(_0x43b687[_0x45a2('0x56')],null))[_0x45a2('0x34')](respondWithResult(_0x3f8e42,null))[_0x45a2('0x54')](handleError(_0x3f8e42,null));};exports['destroy']=function(_0x48da42,_0x2eb4d0){return db[_0x45a2('0x3b')][_0x45a2('0x53')]({'where':{'id':_0x48da42[_0x45a2('0x58')]['id']}})[_0x45a2('0x34')](handleEntityNotFound(_0x2eb4d0,null))[_0x45a2('0x34')](removeEntity(_0x2eb4d0,null))[_0x45a2('0x54')](handleError(_0x2eb4d0,null));};exports[_0x45a2('0x59')]=function(_0x2f9555,_0x587d29,_0x52c465){var _0x2eaf0d={};var _0x3bdefa={};var _0xccf193;var _0x4a3307;return db[_0x45a2('0x3b')][_0x45a2('0x5a')]({'where':{'id':_0x2f9555[_0x45a2('0x58')]['id']}})[_0x45a2('0x34')](handleEntityNotFound(_0x587d29,null))['then'](function(_0x74114e){if(_0x74114e){_0xccf193=_0x74114e;_0x3bdefa[_0x45a2('0x3f')]=_[_0x45a2('0x51')](db[_0x45a2('0x5b')][_0x45a2('0x3c')]);_0x3bdefa[_0x45a2('0x41')]=_[_0x45a2('0x51')](_0x2f9555[_0x45a2('0x41')]);_0x3bdefa[_0x45a2('0x42')]=_[_0x45a2('0x43')](_0x3bdefa[_0x45a2('0x3f')],_0x3bdefa['query']);_0x2eaf0d[_0x45a2('0x45')]=_[_0x45a2('0x43')](_0x3bdefa['model'],qs[_0x45a2('0x44')](_0x2f9555[_0x45a2('0x41')]['fields']));_0x2eaf0d[_0x45a2('0x45')]=_0x2eaf0d['attributes'][_0x45a2('0x46')]?_0x2eaf0d[_0x45a2('0x45')]:_0x3bdefa[_0x45a2('0x3f')];_0x2eaf0d['order']=qs['sort'](_0x2f9555[_0x45a2('0x41')]['sort']);_0x2eaf0d[_0x45a2('0x4c')]=qs[_0x45a2('0x42')](_[_0x45a2('0x4a')](_0x2f9555[_0x45a2('0x41')],_0x3bdefa[_0x45a2('0x42')]));if(_0x2f9555['query'][_0x45a2('0x4b')]){_0x2eaf0d[_0x45a2('0x4c')]=_[_0x45a2('0x4e')](_0x2eaf0d[_0x45a2('0x4c')],{'$or':_['map'](_0x2eaf0d['attributes'],function(_0x793688){var _0x896fa9={};_0x896fa9[_0x793688]={'$like':'%'+_0x2f9555[_0x45a2('0x41')]['filter']+'%'};return _0x896fa9;})});}_0x2eaf0d=_[_0x45a2('0x4e')]({},_0x2eaf0d,_0x2f9555[_0x45a2('0x4f')]);return _0xccf193[_0x45a2('0x59')](_0x2eaf0d);}})[_0x45a2('0x34')](function(_0x352a76){if(_0x352a76){_0x4a3307=_0x352a76[_0x45a2('0x46')];if(!_0x2f9555[_0x45a2('0x41')][_0x45a2('0x5c')](_0x45a2('0x47'))){_0x2eaf0d[_0x45a2('0x2f')]=qs[_0x45a2('0x2f')](_0x2f9555[_0x45a2('0x41')][_0x45a2('0x2f')]);_0x2eaf0d[_0x45a2('0x2e')]=qs[_0x45a2('0x2e')](_0x2f9555['query'][_0x45a2('0x2e')]);}return _0xccf193[_0x45a2('0x59')](_0x2eaf0d);}})[_0x45a2('0x34')](function(_0x543485){if(_0x543485){return _0x543485?{'count':_0x4a3307,'rows':_0x543485}:null;}})['then'](respondWithResult(_0x587d29,null))[_0x45a2('0x54')](handleError(_0x587d29,null));};exports['getDescriptions']=function(_0xb177ba,_0x2761ca,_0x57c426){var _0x171068={};var _0x545843={};var _0x88c232;var _0x56bc50;return db[_0x45a2('0x3b')][_0x45a2('0x5a')]({'where':{'id':_0xb177ba['params']['id']}})[_0x45a2('0x34')](handleEntityNotFound(_0x2761ca,null))['then'](function(_0x1d4221){if(_0x1d4221){_0x88c232=_0x1d4221;_0x545843[_0x45a2('0x3f')]=_[_0x45a2('0x51')](db[_0x45a2('0x5b')][_0x45a2('0x3c')]);_0x545843[_0x45a2('0x41')]=_[_0x45a2('0x51')](_0xb177ba[_0x45a2('0x41')]);_0x545843[_0x45a2('0x42')]=_[_0x45a2('0x43')](_0x545843[_0x45a2('0x3f')],_0x545843['query']);_0x171068[_0x45a2('0x45')]=_[_0x45a2('0x43')](_0x545843[_0x45a2('0x3f')],qs[_0x45a2('0x44')](_0xb177ba[_0x45a2('0x41')][_0x45a2('0x44')]));_0x171068[_0x45a2('0x45')]=_0x171068['attributes'][_0x45a2('0x46')]?_0x171068['attributes']:_0x545843[_0x45a2('0x3f')];_0x171068['order']=qs[_0x45a2('0x49')](_0xb177ba[_0x45a2('0x41')][_0x45a2('0x49')]);_0x171068['where']=qs['filters'](_[_0x45a2('0x4a')](_0xb177ba[_0x45a2('0x41')],_0x545843[_0x45a2('0x42')]));if(_0xb177ba[_0x45a2('0x41')][_0x45a2('0x4b')]){_0x171068[_0x45a2('0x4c')]=_[_0x45a2('0x4e')](_0x171068[_0x45a2('0x4c')],{'$or':_[_0x45a2('0x3a')](_0x171068[_0x45a2('0x45')],function(_0x386c0f){var _0x5e540f={};_0x5e540f[_0x386c0f]={'$like':'%'+_0xb177ba[_0x45a2('0x41')][_0x45a2('0x4b')]+'%'};return _0x5e540f;})});}_0x171068=_[_0x45a2('0x4e')]({},_0x171068,_0xb177ba[_0x45a2('0x4f')]);return _0x88c232[_0x45a2('0x5d')](_0x171068);}})[_0x45a2('0x34')](function(_0x16413a){if(_0x16413a){_0x56bc50=_0x16413a[_0x45a2('0x46')];if(!_0xb177ba[_0x45a2('0x41')][_0x45a2('0x5c')](_0x45a2('0x47'))){_0x171068[_0x45a2('0x2f')]=qs[_0x45a2('0x2f')](_0xb177ba[_0x45a2('0x41')][_0x45a2('0x2f')]);_0x171068[_0x45a2('0x2e')]=qs['offset'](_0xb177ba['query'][_0x45a2('0x2e')]);}return _0x88c232['getDescriptions'](_0x171068);}})[_0x45a2('0x34')](function(_0x3729d8){if(_0x3729d8){return _0x3729d8?{'count':_0x56bc50,'rows':_0x3729d8}:null;}})[_0x45a2('0x34')](respondWithResult(_0x2761ca,null))[_0x45a2('0x54')](handleError(_0x2761ca,null));};exports[_0x45a2('0x5e')]=function(_0x51fcfa,_0x8bd586,_0x322030){var _0x4e5f2b={};var _0x2d2c17={};var _0x253e95;var _0x2d8200;return db[_0x45a2('0x3b')][_0x45a2('0x5a')]({'where':{'id':_0x51fcfa['params']['id']}})[_0x45a2('0x34')](handleEntityNotFound(_0x8bd586,null))[_0x45a2('0x34')](function(_0x4da9a7){if(_0x4da9a7){_0x253e95=_0x4da9a7;_0x2d2c17[_0x45a2('0x3f')]=_[_0x45a2('0x51')](db[_0x45a2('0x5b')]['rawAttributes']);_0x2d2c17[_0x45a2('0x41')]=_[_0x45a2('0x51')](_0x51fcfa[_0x45a2('0x41')]);_0x2d2c17[_0x45a2('0x42')]=_[_0x45a2('0x43')](_0x2d2c17[_0x45a2('0x3f')],_0x2d2c17['query']);_0x4e5f2b[_0x45a2('0x45')]=_[_0x45a2('0x43')](_0x2d2c17[_0x45a2('0x3f')],qs[_0x45a2('0x44')](_0x51fcfa[_0x45a2('0x41')][_0x45a2('0x44')]));_0x4e5f2b[_0x45a2('0x45')]=_0x4e5f2b[_0x45a2('0x45')][_0x45a2('0x46')]?_0x4e5f2b[_0x45a2('0x45')]:_0x2d2c17['model'];_0x4e5f2b[_0x45a2('0x48')]=qs[_0x45a2('0x49')](_0x51fcfa['query'][_0x45a2('0x49')]);_0x4e5f2b[_0x45a2('0x4c')]=qs[_0x45a2('0x42')](_[_0x45a2('0x4a')](_0x51fcfa[_0x45a2('0x41')],_0x2d2c17[_0x45a2('0x42')]));if(_0x51fcfa[_0x45a2('0x41')][_0x45a2('0x4b')]){_0x4e5f2b[_0x45a2('0x4c')]=_[_0x45a2('0x4e')](_0x4e5f2b[_0x45a2('0x4c')],{'$or':_['map'](_0x4e5f2b[_0x45a2('0x45')],function(_0x31e16a){var _0x26a25b={};_0x26a25b[_0x31e16a]={'$like':'%'+_0x51fcfa[_0x45a2('0x41')]['filter']+'%'};return _0x26a25b;})});}_0x4e5f2b=_['merge']({},_0x4e5f2b,_0x51fcfa[_0x45a2('0x4f')]);return _0x253e95['getFields'](_0x4e5f2b);}})['then'](function(_0x5bec82){if(_0x5bec82){_0x2d8200=_0x5bec82[_0x45a2('0x46')];if(!_0x51fcfa[_0x45a2('0x41')][_0x45a2('0x5c')](_0x45a2('0x47'))){_0x4e5f2b['limit']=qs[_0x45a2('0x2f')](_0x51fcfa[_0x45a2('0x41')][_0x45a2('0x2f')]);_0x4e5f2b[_0x45a2('0x2e')]=qs[_0x45a2('0x2e')](_0x51fcfa['query']['offset']);}return _0x253e95[_0x45a2('0x5e')](_0x4e5f2b);}})[_0x45a2('0x34')](function(_0x462898){if(_0x462898){return _0x462898?{'count':_0x2d8200,'rows':_0x462898}:null;}})[_0x45a2('0x34')](respondWithResult(_0x8bd586,null))[_0x45a2('0x54')](handleError(_0x8bd586,null));};
\ No newline at end of file
diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js
index cc61129..fe63016 100644
--- a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js
+++ b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x2c59=['int_freshsales_configurations','lodash','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./intFreshsalesConfiguration.attributes','define'];(function(_0x57426f,_0x52f0d3){var _0xe15733=function(_0x11bd27){while(--_0x11bd27){_0x57426f['push'](_0x57426f['shift']());}};_0xe15733(++_0x52f0d3);}(_0x2c59,0x16c));var _0x92c5=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x2c59[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x92c5('0x0'));var util=require('util');var logger=require(_0x92c5('0x1'))(_0x92c5('0x2'));var moment=require(_0x92c5('0x3'));var BPromise=require(_0x92c5('0x4'));var rp=require(_0x92c5('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x92c5('0x6'));var config=require(_0x92c5('0x7'));var attributes=require(_0x92c5('0x8'));module['exports']=function(_0x4cf76d,_0x59cf6a){return _0x4cf76d[_0x92c5('0x9')]('FreshsalesConfiguration',attributes,{'tableName':_0x92c5('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xc778=['exports','define','FreshsalesConfiguration','int_freshsales_configurations','lodash','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./intFreshsalesConfiguration.attributes'];(function(_0x104a84,_0x285970){var _0x4973ff=function(_0x5064e7){while(--_0x5064e7){_0x104a84['push'](_0x104a84['shift']());}};_0x4973ff(++_0x285970);}(_0xc778,0x149));var _0x8c77=function(_0x2e6812,_0x329578){_0x2e6812=_0x2e6812-0x0;var _0x49ccd5=_0xc778[_0x2e6812];return _0x49ccd5;};'use strict';var _=require(_0x8c77('0x0'));var util=require('util');var logger=require(_0x8c77('0x1'))(_0x8c77('0x2'));var moment=require(_0x8c77('0x3'));var BPromise=require(_0x8c77('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8c77('0x5'));var rimraf=require(_0x8c77('0x6'));var config=require(_0x8c77('0x7'));var attributes=require(_0x8c77('0x8'));module[_0x8c77('0x9')]=function(_0x493c5f,_0x53848d){return _0x493c5f[_0x8c77('0xa')](_0x8c77('0xb'),attributes,{'tableName':_0x8c77('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.rpc.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.rpc.js
index 26c61d1..2d23f05 100644
--- a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.rpc.js
+++ b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x0efe=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','request\x20sent','debug','FreshsalesConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','FreshsalesConfiguration,\x20%s,\x20%s','message','info','result','catch','lodash','util','bluebird'];(function(_0x481ee1,_0x4a2684){var _0x904c27=function(_0x243078){while(--_0x243078){_0x481ee1['push'](_0x481ee1['shift']());}};_0x904c27(++_0x4a2684);}(_0x0efe,0x110));var _0xe0ef=function(_0x559acf,_0x49f635){_0x559acf=_0x559acf-0x0;var _0x1c46a8=_0x0efe[_0x559acf];return _0x1c46a8;};'use strict';var _=require(_0xe0ef('0x0'));var util=require(_0xe0ef('0x1'));var moment=require('moment');var BPromise=require(_0xe0ef('0x2'));var rs=require(_0xe0ef('0x3'));var fs=require('fs');var Redis=require(_0xe0ef('0x4'));var db=require(_0xe0ef('0x5'))['db'];var utils=require(_0xe0ef('0x6'));var logger=require(_0xe0ef('0x7'))(_0xe0ef('0x8'));var config=require(_0xe0ef('0x9'));var jayson=require(_0xe0ef('0xa'));var client=jayson[_0xe0ef('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x49643a,_0x3a6030,_0x1a57fb){return new BPromise(function(_0x161f87,_0xa4f9be){return client[_0xe0ef('0xc')](_0x49643a,_0x1a57fb)[_0xe0ef('0xd')](function(_0x18f982){logger['info']('FreshsalesConfiguration,\x20%s,\x20%s',_0x3a6030,_0xe0ef('0xe'));logger[_0xe0ef('0xf')](_0xe0ef('0x10'),_0x3a6030,'request\x20sent',JSON[_0xe0ef('0x11')](_0x18f982));if(_0x18f982[_0xe0ef('0x12')]){if(_0x18f982['error'][_0xe0ef('0x13')]===0x1f4){logger['error'](_0xe0ef('0x14'),_0x3a6030,_0x18f982[_0xe0ef('0x12')][_0xe0ef('0x15')]);return _0xa4f9be(_0x18f982['error']['message']);}logger[_0xe0ef('0x12')](_0xe0ef('0x14'),_0x3a6030,_0x18f982[_0xe0ef('0x12')][_0xe0ef('0x15')]);return _0x161f87(_0x18f982[_0xe0ef('0x12')][_0xe0ef('0x15')]);}else{logger[_0xe0ef('0x16')](_0xe0ef('0x14'),_0x3a6030,'request\x20sent');_0x161f87(_0x18f982[_0xe0ef('0x17')][_0xe0ef('0x15')]);}})[_0xe0ef('0x18')](function(_0xe9b6d4){logger[_0xe0ef('0x12')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x3a6030,_0xe9b6d4);_0xa4f9be(_0xe9b6d4);});});}
\ No newline at end of file
+var _0x151b=['bluebird','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','http','then','request\x20sent','debug','FreshsalesConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','FreshsalesConfiguration,\x20%s,\x20%s','message','info','result','catch','lodash'];(function(_0x18dc83,_0x462295){var _0x8236a2=function(_0x448df4){while(--_0x448df4){_0x18dc83['push'](_0x18dc83['shift']());}};_0x8236a2(++_0x462295);}(_0x151b,0x153));var _0xb151=function(_0x1c8e2b,_0x56d423){_0x1c8e2b=_0x1c8e2b-0x0;var _0x44b490=_0x151b[_0x1c8e2b];return _0x44b490;};'use strict';var _=require(_0xb151('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xb151('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb151('0x2'));var db=require(_0xb151('0x3'))['db'];var utils=require(_0xb151('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0xb151('0x5'));var jayson=require(_0xb151('0x6'));var client=jayson['client'][_0xb151('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x4ba994,_0xd89657,_0x352713){return new BPromise(function(_0x46fdb0,_0x484caf){return client['request'](_0x4ba994,_0x352713)[_0xb151('0x8')](function(_0x20f1b2){logger['info']('FreshsalesConfiguration,\x20%s,\x20%s',_0xd89657,_0xb151('0x9'));logger[_0xb151('0xa')](_0xb151('0xb'),_0xd89657,_0xb151('0x9'),JSON[_0xb151('0xc')](_0x20f1b2));if(_0x20f1b2[_0xb151('0xd')]){if(_0x20f1b2[_0xb151('0xd')][_0xb151('0xe')]===0x1f4){logger[_0xb151('0xd')](_0xb151('0xf'),_0xd89657,_0x20f1b2['error'][_0xb151('0x10')]);return _0x484caf(_0x20f1b2['error'][_0xb151('0x10')]);}logger[_0xb151('0xd')](_0xb151('0xf'),_0xd89657,_0x20f1b2[_0xb151('0xd')]['message']);return _0x46fdb0(_0x20f1b2[_0xb151('0xd')][_0xb151('0x10')]);}else{logger[_0xb151('0x11')]('FreshsalesConfiguration,\x20%s,\x20%s',_0xd89657,'request\x20sent');_0x46fdb0(_0x20f1b2[_0xb151('0x12')]['message']);}})[_0xb151('0x13')](function(_0x4ca435){logger[_0xb151('0xd')]('FreshsalesConfiguration,\x20%s,\x20%s',_0xd89657,_0x4ca435);_0x484caf(_0x4ca435);});});}
\ No newline at end of file
diff --git a/server/api/intFreshsalesField/index.js b/server/api/intFreshsalesField/index.js
index c4d9055..e6646d6 100644
--- a/server/api/intFreshsalesField/index.js
+++ b/server/api/intFreshsalesField/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xd095=['get','isAuthenticated','create','put','update','delete','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshsalesField.controller'];(function(_0x317e30,_0x32ad66){var _0x203788=function(_0x264d38){while(--_0x264d38){_0x317e30['push'](_0x317e30['shift']());}};_0x203788(++_0x32ad66);}(_0xd095,0x97));var _0x5d09=function(_0x565ed7,_0x398228){_0x565ed7=_0x565ed7-0x0;var _0x183ad7=_0xd095[_0x565ed7];return _0x183ad7;};'use strict';var multer=require(_0x5d09('0x0'));var util=require(_0x5d09('0x1'));var path=require(_0x5d09('0x2'));var timeout=require('connect-timeout');var express=require(_0x5d09('0x3'));var router=express[_0x5d09('0x4')]();var auth=require(_0x5d09('0x5'));var interaction=require(_0x5d09('0x6'));var config=require(_0x5d09('0x7'));var controller=require(_0x5d09('0x8'));router[_0x5d09('0x9')]('/',auth[_0x5d09('0xa')](),controller['index']);router[_0x5d09('0x9')]('/:id',auth[_0x5d09('0xa')](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller[_0x5d09('0xb')]);router[_0x5d09('0xc')]('/:id',auth['isAuthenticated'](),controller[_0x5d09('0xd')]);router[_0x5d09('0xe')]('/:id',auth[_0x5d09('0xa')](),controller['destroy']);module[_0x5d09('0xf')]=router;
\ No newline at end of file
+var _0xeacb=['util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./intFreshsalesField.controller','get','isAuthenticated','/:id','show','post','create','update','delete','destroy','exports','multer'];(function(_0x3da9b1,_0x7db7b8){var _0x4c7061=function(_0x23da67){while(--_0x23da67){_0x3da9b1['push'](_0x3da9b1['shift']());}};_0x4c7061(++_0x7db7b8);}(_0xeacb,0x1b4));var _0xbeac=function(_0x5ca8a1,_0x4a1863){_0x5ca8a1=_0x5ca8a1-0x0;var _0x35838a=_0xeacb[_0x5ca8a1];return _0x35838a;};'use strict';var multer=require(_0xbeac('0x0'));var util=require(_0xbeac('0x1'));var path=require(_0xbeac('0x2'));var timeout=require(_0xbeac('0x3'));var express=require(_0xbeac('0x4'));var router=express[_0xbeac('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0xbeac('0x6'));var config=require(_0xbeac('0x7'));var controller=require(_0xbeac('0x8'));router[_0xbeac('0x9')]('/',auth[_0xbeac('0xa')](),controller['index']);router['get'](_0xbeac('0xb'),auth['isAuthenticated'](),controller[_0xbeac('0xc')]);router[_0xbeac('0xd')]('/',auth[_0xbeac('0xa')](),controller[_0xbeac('0xe')]);router['put'](_0xbeac('0xb'),auth['isAuthenticated'](),controller[_0xbeac('0xf')]);router[_0xbeac('0x10')](_0xbeac('0xb'),auth['isAuthenticated'](),controller[_0xbeac('0x11')]);module[_0xbeac('0x12')]=router;
\ No newline at end of file
diff --git a/server/api/intFreshsalesField/intFreshsalesField.attributes.js b/server/api/intFreshsalesField/intFreshsalesField.attributes.js
index f2208df..4dcfee7 100644
--- a/server/api/intFreshsalesField/intFreshsalesField.attributes.js
+++ b/server/api/intFreshsalesField/intFreshsalesField.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x04cc=['exports','ENUM','variable','customVariable','keyValue','string','STRING','BOOLEAN','sequelize'];(function(_0x54d4fe,_0x55e869){var _0x1ab5bb=function(_0x5b1af2){while(--_0x5b1af2){_0x54d4fe['push'](_0x54d4fe['shift']());}};_0x1ab5bb(++_0x55e869);}(_0x04cc,0x10d));var _0xc04c=function(_0x2a990c,_0x241e85){_0x2a990c=_0x2a990c-0x0;var _0x47d328=_0x04cc[_0x2a990c];return _0x47d328;};'use strict';var Sequelize=require(_0xc04c('0x0'));module[_0xc04c('0x1')]={'type':{'type':Sequelize[_0xc04c('0x2')]('string',_0xc04c('0x3'),_0xc04c('0x4'),_0xc04c('0x5')),'defaultValue':_0xc04c('0x6')},'content':{'type':Sequelize[_0xc04c('0x7')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0xc04c('0x2')]('string',_0xc04c('0x3'),'customVariable')},'keyContent':{'type':Sequelize[_0xc04c('0x7')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0xc04c('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xc04c('0x7')]}};
\ No newline at end of file
+var _0x4cbc=['BOOLEAN','exports','string','variable','customVariable','STRING'];(function(_0x350d02,_0x5eb6f9){var _0x2cd70e=function(_0x351419){while(--_0x351419){_0x350d02['push'](_0x350d02['shift']());}};_0x2cd70e(++_0x5eb6f9);}(_0x4cbc,0x127));var _0xc4cb=function(_0x1a5b50,_0x178c12){_0x1a5b50=_0x1a5b50-0x0;var _0x1c325f=_0x4cbc[_0x1a5b50];return _0x1c325f;};'use strict';var Sequelize=require('sequelize');module[_0xc4cb('0x0')]={'type':{'type':Sequelize['ENUM'](_0xc4cb('0x1'),_0xc4cb('0x2'),_0xc4cb('0x3'),'keyValue'),'defaultValue':_0xc4cb('0x1')},'content':{'type':Sequelize[_0xc4cb('0x4')]},'key':{'type':Sequelize[_0xc4cb('0x4')]},'keyType':{'type':Sequelize['ENUM'](_0xc4cb('0x1'),'variable',_0xc4cb('0x3'))},'keyContent':{'type':Sequelize[_0xc4cb('0x4')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0xc4cb('0x5')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xc4cb('0x4')]}};
\ No newline at end of file
diff --git a/server/api/intFreshsalesField/intFreshsalesField.controller.js b/server/api/intFreshsalesField/intFreshsalesField.controller.js
index 68fc442..c181a6c 100644
--- a/server/api/intFreshsalesField/intFreshsalesField.controller.js
+++ b/server/api/intFreshsalesField/intFreshsalesField.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x28dd=['pick','filter','merge','type','VIRTUAL','options','includeAll','rows','catch','show','include','find','create','body','params','html-pdf','eml-format','zip-dir','fast-json-patch','util','path','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','index','map','FreshsalesField','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where'];(function(_0x36dafa,_0x150e86){var _0xbbe36f=function(_0x2fbb22){while(--_0x2fbb22){_0x36dafa['push'](_0x36dafa['shift']());}};_0xbbe36f(++_0x150e86);}(_0x28dd,0x181));var _0xd28d=function(_0x7d78f,_0x22d980){_0x7d78f=_0x7d78f-0x0;var _0x1005c3=_0x28dd[_0x7d78f];return _0x1005c3;};'use strict';var pdf=require(_0xd28d('0x0'));var emlformat=require(_0xd28d('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xd28d('0x2'));var jsonpatch=require(_0xd28d('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xd28d('0x4'));var path=require(_0xd28d('0x5'));var sox=require('sox');var csv=require(_0xd28d('0x6'));var ejs=require(_0xd28d('0x7'));var fs=require('fs');var _=require(_0xd28d('0x8'));var squel=require(_0xd28d('0x9'));var crypto=require('crypto');var jsforce=require(_0xd28d('0xa'));var deskjs=require(_0xd28d('0xb'));var toCsv=require('to-csv');var querystring=require(_0xd28d('0xc'));var Papa=require(_0xd28d('0xd'));var Redis=require(_0xd28d('0xe'));var authService=require(_0xd28d('0xf'));var qs=require(_0xd28d('0x10'));var as=require(_0xd28d('0x11'));var hardwareService=require(_0xd28d('0x12'));var logger=require(_0xd28d('0x13'))(_0xd28d('0x14'));var utils=require('../../config/utils');var config=require(_0xd28d('0x15'));var db=require(_0xd28d('0x16'))['db'];function respondWithStatusCode(_0x5c77f7,_0x41713c){_0x41713c=_0x41713c||0xcc;return function(_0x163bab){if(_0x163bab){return _0x5c77f7[_0xd28d('0x17')](_0x41713c);}return _0x5c77f7[_0xd28d('0x18')](_0x41713c)[_0xd28d('0x19')]();};}function respondWithResult(_0x37cea4,_0x43cf66){_0x43cf66=_0x43cf66||0xc8;return function(_0x33e9ee){if(_0x33e9ee){return _0x37cea4[_0xd28d('0x18')](_0x43cf66)[_0xd28d('0x1a')](_0x33e9ee);}};}function respondWithFilteredResult(_0x3b7f3c,_0x60df8a){return function(_0xcbd27a){if(_0xcbd27a){var _0x1c10d4=_0xcbd27a[_0xd28d('0x1b')],_0x5aaa7c=_0x60df8a['offset'],_0x5f0866=_0x60df8a[_0xd28d('0x1c')]+_0x60df8a[_0xd28d('0x1d')],_0x29991c;if(_0x5f0866>=_0x1c10d4){_0x5f0866=_0x1c10d4;_0x29991c=0xc8;}else{_0x29991c=0xce;}_0x3b7f3c['status'](_0x29991c);return _0x3b7f3c[_0xd28d('0x1e')](_0xd28d('0x1f'),_0x5aaa7c+'-'+_0x5f0866+'/'+_0x1c10d4)[_0xd28d('0x1a')](_0xcbd27a);}return null;};}function patchUpdates(_0x128150){return function(_0x57ad04){try{jsonpatch[_0xd28d('0x20')](_0x57ad04,_0x128150,!![]);}catch(_0x3a6098){return BPromise[_0xd28d('0x21')](_0x3a6098);}return _0x57ad04[_0xd28d('0x22')]();};}function saveUpdates(_0x321614,_0x2d1c57){return function(_0x4b8fba){if(_0x4b8fba){return _0x4b8fba[_0xd28d('0x23')](_0x321614)[_0xd28d('0x24')](function(_0x577f48){return _0x577f48;});}return null;};}function removeEntity(_0x6abf4a,_0x843704){return function(_0x101e9d){if(_0x101e9d){return _0x101e9d[_0xd28d('0x25')]()[_0xd28d('0x24')](function(){_0x6abf4a[_0xd28d('0x18')](0xcc)[_0xd28d('0x19')]();});}};}function handleEntityNotFound(_0x5e0c15,_0x21b7c7){return function(_0x18bfc0){if(!_0x18bfc0){_0x5e0c15[_0xd28d('0x17')](0x194);}return _0x18bfc0;};}function handleError(_0x12753a,_0x40d2bf){_0x40d2bf=_0x40d2bf||0x1f4;return function(_0x490e8f){logger['error'](_0x490e8f[_0xd28d('0x26')]);if(_0x490e8f[_0xd28d('0x27')]){delete _0x490e8f[_0xd28d('0x27')];}_0x12753a[_0xd28d('0x18')](_0x40d2bf)[_0xd28d('0x28')](_0x490e8f);};}exports[_0xd28d('0x29')]=function(_0x3a46f9,_0x41c717){var _0x58ff3f={},_0x3c27bd={},_0x314353={'count':0x0,'rows':[]};var _0xb77954=_[_0xd28d('0x2a')](db[_0xd28d('0x2b')][_0xd28d('0x2c')],function(_0x409400){return{'name':_0x409400[_0xd28d('0x2d')],'type':_0x409400['type'][_0xd28d('0x2e')]};});_0x3c27bd[_0xd28d('0x2f')]=_['map'](_0xb77954,_0xd28d('0x27'));_0x3c27bd[_0xd28d('0x30')]=_[_0xd28d('0x31')](_0x3a46f9[_0xd28d('0x30')]);_0x3c27bd[_0xd28d('0x32')]=_[_0xd28d('0x33')](_0x3c27bd[_0xd28d('0x2f')],_0x3c27bd[_0xd28d('0x30')]);_0x58ff3f[_0xd28d('0x34')]=_['intersection'](_0x3c27bd[_0xd28d('0x2f')],qs[_0xd28d('0x35')](_0x3a46f9['query'][_0xd28d('0x35')]));_0x58ff3f[_0xd28d('0x34')]=_0x58ff3f['attributes'][_0xd28d('0x36')]?_0x58ff3f['attributes']:_0x3c27bd[_0xd28d('0x2f')];if(!_0x3a46f9[_0xd28d('0x30')][_0xd28d('0x37')](_0xd28d('0x38'))){_0x58ff3f['limit']=qs['limit'](_0x3a46f9[_0xd28d('0x30')]['limit']);_0x58ff3f['offset']=qs[_0xd28d('0x1c')](_0x3a46f9[_0xd28d('0x30')][_0xd28d('0x1c')]);}_0x58ff3f['order']=qs[_0xd28d('0x39')](_0x3a46f9[_0xd28d('0x30')][_0xd28d('0x39')]);_0x58ff3f[_0xd28d('0x3a')]=qs[_0xd28d('0x32')](_[_0xd28d('0x3b')](_0x3a46f9[_0xd28d('0x30')],_0x3c27bd[_0xd28d('0x32')]),_0xb77954);if(_0x3a46f9['query'][_0xd28d('0x3c')]){_0x58ff3f[_0xd28d('0x3a')]=_[_0xd28d('0x3d')](_0x58ff3f[_0xd28d('0x3a')],{'$or':_[_0xd28d('0x2a')](_0xb77954,function(_0x1d13a8){if(_0x1d13a8[_0xd28d('0x3e')]!==_0xd28d('0x3f')){var _0x4205b9={};_0x4205b9[_0x1d13a8[_0xd28d('0x27')]]={'$like':'%'+_0x3a46f9['query'][_0xd28d('0x3c')]+'%'};return _0x4205b9;}})});}_0x58ff3f=_['merge']({},_0x58ff3f,_0x3a46f9[_0xd28d('0x40')]);var _0x3fb4a8={'where':_0x58ff3f['where']};return db[_0xd28d('0x2b')]['count'](_0x3fb4a8)[_0xd28d('0x24')](function(_0x2f62c7){_0x314353['count']=_0x2f62c7;if(_0x3a46f9[_0xd28d('0x30')][_0xd28d('0x41')]){_0x58ff3f['include']=[{'all':!![]}];}return db[_0xd28d('0x2b')]['findAll'](_0x58ff3f);})['then'](function(_0x5bf0fe){_0x314353[_0xd28d('0x42')]=_0x5bf0fe;return _0x314353;})['then'](respondWithFilteredResult(_0x41c717,_0x58ff3f))[_0xd28d('0x43')](handleError(_0x41c717,null));};exports[_0xd28d('0x44')]=function(_0x36a6c5,_0x42df73){var _0xd92e8={'raw':!![],'where':{'id':_0x36a6c5['params']['id']}},_0x4905cf={};_0x4905cf['model']=_[_0xd28d('0x31')](db[_0xd28d('0x2b')][_0xd28d('0x2c')]);_0x4905cf['query']=_[_0xd28d('0x31')](_0x36a6c5[_0xd28d('0x30')]);_0x4905cf[_0xd28d('0x32')]=_[_0xd28d('0x33')](_0x4905cf[_0xd28d('0x2f')],_0x4905cf[_0xd28d('0x30')]);_0xd92e8['attributes']=_['intersection'](_0x4905cf['model'],qs[_0xd28d('0x35')](_0x36a6c5[_0xd28d('0x30')][_0xd28d('0x35')]));_0xd92e8[_0xd28d('0x34')]=_0xd92e8['attributes'][_0xd28d('0x36')]?_0xd92e8['attributes']:_0x4905cf[_0xd28d('0x2f')];if(_0x36a6c5['query'][_0xd28d('0x41')]){_0xd92e8[_0xd28d('0x45')]=[{'all':!![]}];}_0xd92e8=_[_0xd28d('0x3d')]({},_0xd92e8,_0x36a6c5[_0xd28d('0x40')]);return db[_0xd28d('0x2b')][_0xd28d('0x46')](_0xd92e8)['then'](handleEntityNotFound(_0x42df73,null))[_0xd28d('0x24')](respondWithResult(_0x42df73,null))[_0xd28d('0x43')](handleError(_0x42df73,null));};exports[_0xd28d('0x47')]=function(_0x1ec628,_0x2164e2){return db[_0xd28d('0x2b')]['create'](_0x1ec628[_0xd28d('0x48')],{})['then'](respondWithResult(_0x2164e2,0xc9))[_0xd28d('0x43')](handleError(_0x2164e2,null));};exports[_0xd28d('0x23')]=function(_0x231181,_0x31d2ac){if(_0x231181[_0xd28d('0x48')]['id']){delete _0x231181[_0xd28d('0x48')]['id'];}return db[_0xd28d('0x2b')]['find']({'where':{'id':_0x231181[_0xd28d('0x49')]['id']}})['then'](handleEntityNotFound(_0x31d2ac,null))[_0xd28d('0x24')](saveUpdates(_0x231181[_0xd28d('0x48')],null))[_0xd28d('0x24')](respondWithResult(_0x31d2ac,null))['catch'](handleError(_0x31d2ac,null));};exports[_0xd28d('0x25')]=function(_0x50f875,_0x35b9af){return db[_0xd28d('0x2b')][_0xd28d('0x46')]({'where':{'id':_0x50f875[_0xd28d('0x49')]['id']}})[_0xd28d('0x24')](handleEntityNotFound(_0x35b9af,null))[_0xd28d('0x24')](removeEntity(_0x35b9af,null))[_0xd28d('0x43')](handleError(_0x35b9af,null));};
\ No newline at end of file
+var _0x69e8=['apply','reject','update','then','destroy','error','send','index','FreshsalesField','rawAttributes','fieldName','type','key','model','map','name','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','filter','merge','where','includeAll','include','rows','show','params','find','create','catch','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range'];(function(_0x4bcc13,_0x3faaff){var _0x5f1ccc=function(_0x211dc4){while(--_0x211dc4){_0x4bcc13['push'](_0x4bcc13['shift']());}};_0x5f1ccc(++_0x3faaff);}(_0x69e8,0x1c3));var _0x869e=function(_0x1b97f9,_0x3c3c1c){_0x1b97f9=_0x1b97f9-0x0;var _0x34f1ce=_0x69e8[_0x1b97f9];return _0x34f1ce;};'use strict';var pdf=require(_0x869e('0x0'));var emlformat=require(_0x869e('0x1'));var rimraf=require(_0x869e('0x2'));var zipdir=require(_0x869e('0x3'));var jsonpatch=require(_0x869e('0x4'));var rp=require(_0x869e('0x5'));var moment=require('moment');var BPromise=require(_0x869e('0x6'));var Mustache=require('mustache');var util=require(_0x869e('0x7'));var path=require(_0x869e('0x8'));var sox=require(_0x869e('0x9'));var csv=require(_0x869e('0xa'));var ejs=require(_0x869e('0xb'));var fs=require('fs');var _=require(_0x869e('0xc'));var squel=require(_0x869e('0xd'));var crypto=require(_0x869e('0xe'));var jsforce=require(_0x869e('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x869e('0xa'));var querystring=require(_0x869e('0x10'));var Papa=require(_0x869e('0x11'));var Redis=require('ioredis');var authService=require(_0x869e('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x869e('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x869e('0x14'))('api');var utils=require(_0x869e('0x15'));var config=require('../../config/environment');var db=require(_0x869e('0x16'))['db'];function respondWithStatusCode(_0x331b86,_0x4314ce){_0x4314ce=_0x4314ce||0xcc;return function(_0x19eb15){if(_0x19eb15){return _0x331b86[_0x869e('0x17')](_0x4314ce);}return _0x331b86[_0x869e('0x18')](_0x4314ce)[_0x869e('0x19')]();};}function respondWithResult(_0x44b717,_0x576242){_0x576242=_0x576242||0xc8;return function(_0x5e8076){if(_0x5e8076){return _0x44b717['status'](_0x576242)[_0x869e('0x1a')](_0x5e8076);}};}function respondWithFilteredResult(_0x169c7f,_0xa2119){return function(_0x2d789e){if(_0x2d789e){var _0x31239d=_0x2d789e[_0x869e('0x1b')],_0x8bdb89=_0xa2119[_0x869e('0x1c')],_0xf42dac=_0xa2119[_0x869e('0x1c')]+_0xa2119[_0x869e('0x1d')],_0xe6e450;if(_0xf42dac>=_0x31239d){_0xf42dac=_0x31239d;_0xe6e450=0xc8;}else{_0xe6e450=0xce;}_0x169c7f[_0x869e('0x18')](_0xe6e450);return _0x169c7f[_0x869e('0x1e')](_0x869e('0x1f'),_0x8bdb89+'-'+_0xf42dac+'/'+_0x31239d)[_0x869e('0x1a')](_0x2d789e);}return null;};}function patchUpdates(_0x303607){return function(_0x1a1efa){try{jsonpatch[_0x869e('0x20')](_0x1a1efa,_0x303607,!![]);}catch(_0x9f7504){return BPromise[_0x869e('0x21')](_0x9f7504);}return _0x1a1efa['save']();};}function saveUpdates(_0x1c8416,_0x10244e){return function(_0x5d60bd){if(_0x5d60bd){return _0x5d60bd[_0x869e('0x22')](_0x1c8416)[_0x869e('0x23')](function(_0x45bcb4){return _0x45bcb4;});}return null;};}function removeEntity(_0x4297f9,_0x59dc9e){return function(_0x4cb3e7){if(_0x4cb3e7){return _0x4cb3e7[_0x869e('0x24')]()[_0x869e('0x23')](function(){_0x4297f9[_0x869e('0x18')](0xcc)[_0x869e('0x19')]();});}};}function handleEntityNotFound(_0x509432,_0x5b5c56){return function(_0xe38b91){if(!_0xe38b91){_0x509432[_0x869e('0x17')](0x194);}return _0xe38b91;};}function handleError(_0x43b1d9,_0x13607a){_0x13607a=_0x13607a||0x1f4;return function(_0x5e7ee8){logger[_0x869e('0x25')](_0x5e7ee8['stack']);if(_0x5e7ee8['name']){delete _0x5e7ee8['name'];}_0x43b1d9[_0x869e('0x18')](_0x13607a)[_0x869e('0x26')](_0x5e7ee8);};}exports[_0x869e('0x27')]=function(_0x10fc89,_0x42b290){var _0x1dc337={},_0x277fc3={},_0x311937={'count':0x0,'rows':[]};var _0x3b2a00=_['map'](db[_0x869e('0x28')][_0x869e('0x29')],function(_0x4df0e8){return{'name':_0x4df0e8[_0x869e('0x2a')],'type':_0x4df0e8[_0x869e('0x2b')][_0x869e('0x2c')]};});_0x277fc3[_0x869e('0x2d')]=_[_0x869e('0x2e')](_0x3b2a00,_0x869e('0x2f'));_0x277fc3[_0x869e('0x30')]=_[_0x869e('0x31')](_0x10fc89[_0x869e('0x30')]);_0x277fc3[_0x869e('0x32')]=_[_0x869e('0x33')](_0x277fc3['model'],_0x277fc3['query']);_0x1dc337[_0x869e('0x34')]=_[_0x869e('0x33')](_0x277fc3[_0x869e('0x2d')],qs[_0x869e('0x35')](_0x10fc89['query']['fields']));_0x1dc337[_0x869e('0x34')]=_0x1dc337[_0x869e('0x34')][_0x869e('0x36')]?_0x1dc337[_0x869e('0x34')]:_0x277fc3['model'];if(!_0x10fc89['query'][_0x869e('0x37')](_0x869e('0x38'))){_0x1dc337[_0x869e('0x1d')]=qs[_0x869e('0x1d')](_0x10fc89[_0x869e('0x30')]['limit']);_0x1dc337[_0x869e('0x1c')]=qs[_0x869e('0x1c')](_0x10fc89[_0x869e('0x30')]['offset']);}_0x1dc337['order']=qs[_0x869e('0x39')](_0x10fc89[_0x869e('0x30')]['sort']);_0x1dc337['where']=qs[_0x869e('0x32')](_['pick'](_0x10fc89[_0x869e('0x30')],_0x277fc3[_0x869e('0x32')]),_0x3b2a00);if(_0x10fc89[_0x869e('0x30')][_0x869e('0x3a')]){_0x1dc337['where']=_[_0x869e('0x3b')](_0x1dc337[_0x869e('0x3c')],{'$or':_['map'](_0x3b2a00,function(_0x30e1f0){if(_0x30e1f0[_0x869e('0x2b')]!=='VIRTUAL'){var _0x27288d={};_0x27288d[_0x30e1f0[_0x869e('0x2f')]]={'$like':'%'+_0x10fc89[_0x869e('0x30')][_0x869e('0x3a')]+'%'};return _0x27288d;}})});}_0x1dc337=_[_0x869e('0x3b')]({},_0x1dc337,_0x10fc89['options']);var _0x2ec0a5={'where':_0x1dc337['where']};return db[_0x869e('0x28')]['count'](_0x2ec0a5)[_0x869e('0x23')](function(_0x45132f){_0x311937[_0x869e('0x1b')]=_0x45132f;if(_0x10fc89[_0x869e('0x30')][_0x869e('0x3d')]){_0x1dc337[_0x869e('0x3e')]=[{'all':!![]}];}return db[_0x869e('0x28')]['findAll'](_0x1dc337);})[_0x869e('0x23')](function(_0x4a25ab){_0x311937[_0x869e('0x3f')]=_0x4a25ab;return _0x311937;})['then'](respondWithFilteredResult(_0x42b290,_0x1dc337))['catch'](handleError(_0x42b290,null));};exports[_0x869e('0x40')]=function(_0x5288b1,_0x2dcf17){var _0x4b80bb={'raw':!![],'where':{'id':_0x5288b1[_0x869e('0x41')]['id']}},_0x5c4ff5={};_0x5c4ff5['model']=_[_0x869e('0x31')](db[_0x869e('0x28')]['rawAttributes']);_0x5c4ff5[_0x869e('0x30')]=_[_0x869e('0x31')](_0x5288b1[_0x869e('0x30')]);_0x5c4ff5[_0x869e('0x32')]=_[_0x869e('0x33')](_0x5c4ff5[_0x869e('0x2d')],_0x5c4ff5['query']);_0x4b80bb[_0x869e('0x34')]=_[_0x869e('0x33')](_0x5c4ff5[_0x869e('0x2d')],qs[_0x869e('0x35')](_0x5288b1[_0x869e('0x30')]['fields']));_0x4b80bb['attributes']=_0x4b80bb[_0x869e('0x34')]['length']?_0x4b80bb[_0x869e('0x34')]:_0x5c4ff5[_0x869e('0x2d')];if(_0x5288b1[_0x869e('0x30')]['includeAll']){_0x4b80bb['include']=[{'all':!![]}];}_0x4b80bb=_[_0x869e('0x3b')]({},_0x4b80bb,_0x5288b1['options']);return db[_0x869e('0x28')][_0x869e('0x42')](_0x4b80bb)['then'](handleEntityNotFound(_0x2dcf17,null))['then'](respondWithResult(_0x2dcf17,null))['catch'](handleError(_0x2dcf17,null));};exports['create']=function(_0xc4e3e3,_0xb3921d){return db[_0x869e('0x28')][_0x869e('0x43')](_0xc4e3e3['body'],{})[_0x869e('0x23')](respondWithResult(_0xb3921d,0xc9))[_0x869e('0x44')](handleError(_0xb3921d,null));};exports['update']=function(_0x669a5c,_0x33433e){if(_0x669a5c['body']['id']){delete _0x669a5c['body']['id'];}return db['FreshsalesField']['find']({'where':{'id':_0x669a5c[_0x869e('0x41')]['id']}})[_0x869e('0x23')](handleEntityNotFound(_0x33433e,null))['then'](saveUpdates(_0x669a5c['body'],null))[_0x869e('0x23')](respondWithResult(_0x33433e,null))[_0x869e('0x44')](handleError(_0x33433e,null));};exports[_0x869e('0x24')]=function(_0x30b524,_0x2b3565){return db[_0x869e('0x28')][_0x869e('0x42')]({'where':{'id':_0x30b524[_0x869e('0x41')]['id']}})[_0x869e('0x23')](handleEntityNotFound(_0x2b3565,null))[_0x869e('0x23')](removeEntity(_0x2b3565,null))[_0x869e('0x44')](handleError(_0x2b3565,null));};
\ No newline at end of file
diff --git a/server/api/intFreshsalesField/intFreshsalesField.model.js b/server/api/intFreshsalesField/intFreshsalesField.model.js
index 89a7f8e..7d97ff3 100644
--- a/server/api/intFreshsalesField/intFreshsalesField.model.js
+++ b/server/api/intFreshsalesField/intFreshsalesField.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7f3c=['idField','FieldId','util','api','moment','bluebird','request-promise','path','../../config/environment','./intFreshsalesField.attributes','exports','define','FreshsalesField','int_freshsales_fields','freshsales_unique_index'];(function(_0x366279,_0x209a2b){var _0x3d11b1=function(_0x2541ae){while(--_0x2541ae){_0x366279['push'](_0x366279['shift']());}};_0x3d11b1(++_0x209a2b);}(_0x7f3c,0x16a));var _0xc7f3=function(_0x36bf88,_0x15c459){_0x36bf88=_0x36bf88-0x0;var _0x332914=_0x7f3c[_0x36bf88];return _0x332914;};'use strict';var _=require('lodash');var util=require(_0xc7f3('0x0'));var logger=require('../../config/logger')(_0xc7f3('0x1'));var moment=require(_0xc7f3('0x2'));var BPromise=require(_0xc7f3('0x3'));var rp=require(_0xc7f3('0x4'));var fs=require('fs');var path=require(_0xc7f3('0x5'));var rimraf=require('rimraf');var config=require(_0xc7f3('0x6'));var attributes=require(_0xc7f3('0x7'));module[_0xc7f3('0x8')]=function(_0x560eec,_0x3745ae){return _0x560eec[_0xc7f3('0x9')](_0xc7f3('0xa'),attributes,{'tableName':_0xc7f3('0xb'),'paranoid':![],'indexes':[{'name':_0xc7f3('0xc'),'fields':[_0xc7f3('0xd'),_0xc7f3('0xe')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x92ca=['lodash','util','../../config/logger','moment','request-promise','path','../../config/environment','exports','define','FreshsalesField','int_freshsales_fields','idField','FieldId'];(function(_0x3d1c2a,_0x2ac29c){var _0x503dd4=function(_0xd2a322){while(--_0xd2a322){_0x3d1c2a['push'](_0x3d1c2a['shift']());}};_0x503dd4(++_0x2ac29c);}(_0x92ca,0xf7));var _0xa92c=function(_0x11c1a1,_0x17ba8c){_0x11c1a1=_0x11c1a1-0x0;var _0x483746=_0x92ca[_0x11c1a1];return _0x483746;};'use strict';var _=require(_0xa92c('0x0'));var util=require(_0xa92c('0x1'));var logger=require(_0xa92c('0x2'))('api');var moment=require(_0xa92c('0x3'));var BPromise=require('bluebird');var rp=require(_0xa92c('0x4'));var fs=require('fs');var path=require(_0xa92c('0x5'));var rimraf=require('rimraf');var config=require(_0xa92c('0x6'));var attributes=require('./intFreshsalesField.attributes');module[_0xa92c('0x7')]=function(_0x5680ae,_0x20772f){return _0x5680ae[_0xa92c('0x8')](_0xa92c('0x9'),attributes,{'tableName':_0xa92c('0xa'),'paranoid':![],'indexes':[{'name':'freshsales_unique_index','fields':[_0xa92c('0xb'),_0xa92c('0xc')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/intFreshsalesField/intFreshsalesField.rpc.js b/server/api/intFreshsalesField/intFreshsalesField.rpc.js
index 831363c..e2c4b3c 100644
--- a/server/api/intFreshsalesField/intFreshsalesField.rpc.js
+++ b/server/api/intFreshsalesField/intFreshsalesField.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x8ae8=['http','request','info','FreshsalesField,\x20%s,\x20%s','debug','FreshsalesField,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client'];(function(_0x1e7b16,_0x4607a1){var _0x37fadc=function(_0x1fc9ce){while(--_0x1fc9ce){_0x1e7b16['push'](_0x1e7b16['shift']());}};_0x37fadc(++_0x4607a1);}(_0x8ae8,0xda));var _0x88ae=function(_0xe0dee2,_0x35d2a8){_0xe0dee2=_0xe0dee2-0x0;var _0x568ed0=_0x8ae8[_0xe0dee2];return _0x568ed0;};'use strict';var _=require(_0x88ae('0x0'));var util=require(_0x88ae('0x1'));var moment=require(_0x88ae('0x2'));var BPromise=require(_0x88ae('0x3'));var rs=require(_0x88ae('0x4'));var fs=require('fs');var Redis=require(_0x88ae('0x5'));var db=require(_0x88ae('0x6'))['db'];var utils=require(_0x88ae('0x7'));var logger=require(_0x88ae('0x8'))(_0x88ae('0x9'));var config=require(_0x88ae('0xa'));var jayson=require('jayson/promise');var client=jayson[_0x88ae('0xb')][_0x88ae('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x1b2e01,_0x4e3497,_0xd67176){return new BPromise(function(_0x2b3fe3,_0x94556f){return client[_0x88ae('0xd')](_0x1b2e01,_0xd67176)['then'](function(_0x2a97e3){logger[_0x88ae('0xe')](_0x88ae('0xf'),_0x4e3497,'request\x20sent');logger[_0x88ae('0x10')](_0x88ae('0x11'),_0x4e3497,_0x88ae('0x12'),JSON['stringify'](_0x2a97e3));if(_0x2a97e3[_0x88ae('0x13')]){if(_0x2a97e3[_0x88ae('0x13')][_0x88ae('0x14')]===0x1f4){logger[_0x88ae('0x13')]('FreshsalesField,\x20%s,\x20%s',_0x4e3497,_0x2a97e3['error'][_0x88ae('0x15')]);return _0x94556f(_0x2a97e3[_0x88ae('0x13')][_0x88ae('0x15')]);}logger[_0x88ae('0x13')]('FreshsalesField,\x20%s,\x20%s',_0x4e3497,_0x2a97e3[_0x88ae('0x13')]['message']);return _0x2b3fe3(_0x2a97e3['error'][_0x88ae('0x15')]);}else{logger['info'](_0x88ae('0xf'),_0x4e3497,_0x88ae('0x12'));_0x2b3fe3(_0x2a97e3[_0x88ae('0x16')][_0x88ae('0x15')]);}})['catch'](function(_0x2e4437){logger['error']('FreshsalesField,\x20%s,\x20%s',_0x4e3497,_0x2e4437);_0x94556f(_0x2e4437);});});}
\ No newline at end of file
+var _0x51ef=['message','FreshsalesField,\x20%s,\x20%s','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','then','info','request\x20sent','debug','FreshsalesField,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x51ef,0x18f));var _0xf51e=function(_0x46392f,_0x43e275){_0x46392f=_0x46392f-0x0;var _0x39e145=_0x51ef[_0x46392f];return _0x39e145;};'use strict';var _=require(_0xf51e('0x0'));var util=require('util');var moment=require(_0xf51e('0x1'));var BPromise=require(_0xf51e('0x2'));var rs=require(_0xf51e('0x3'));var fs=require('fs');var Redis=require(_0xf51e('0x4'));var db=require(_0xf51e('0x5'))['db'];var utils=require(_0xf51e('0x6'));var logger=require(_0xf51e('0x7'))(_0xf51e('0x8'));var config=require(_0xf51e('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xf51e('0xa')][_0xf51e('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4c8c79,_0x5145e8,_0x4f63ca){return new BPromise(function(_0x14d636,_0x3090b5){return client['request'](_0x4c8c79,_0x4f63ca)[_0xf51e('0xc')](function(_0x4017fe){logger[_0xf51e('0xd')]('FreshsalesField,\x20%s,\x20%s',_0x5145e8,_0xf51e('0xe'));logger[_0xf51e('0xf')](_0xf51e('0x10'),_0x5145e8,'request\x20sent',JSON[_0xf51e('0x11')](_0x4017fe));if(_0x4017fe[_0xf51e('0x12')]){if(_0x4017fe['error']['code']===0x1f4){logger[_0xf51e('0x12')]('FreshsalesField,\x20%s,\x20%s',_0x5145e8,_0x4017fe['error'][_0xf51e('0x13')]);return _0x3090b5(_0x4017fe[_0xf51e('0x12')]['message']);}logger[_0xf51e('0x12')](_0xf51e('0x14'),_0x5145e8,_0x4017fe[_0xf51e('0x12')][_0xf51e('0x13')]);return _0x14d636(_0x4017fe[_0xf51e('0x12')][_0xf51e('0x13')]);}else{logger[_0xf51e('0xd')](_0xf51e('0x14'),_0x5145e8,_0xf51e('0xe'));_0x14d636(_0x4017fe['result'][_0xf51e('0x13')]);}})[_0xf51e('0x15')](function(_0x235de9){logger[_0xf51e('0x12')](_0xf51e('0x14'),_0x5145e8,_0x235de9);_0x3090b5(_0x235de9);});});}
\ No newline at end of file
diff --git a/server/api/intSalesforceAccount/index.js b/server/api/intSalesforceAccount/index.js
index bf97267..eb7f077 100644
--- a/server/api/intSalesforceAccount/index.js
+++ b/server/api/intSalesforceAccount/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x802c=['get','isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','put','update','delete','destroy','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','./intSalesforceAccount.controller'];(function(_0x13e56a,_0x3f48f1){var _0x4ee48e=function(_0x5c0ef1){while(--_0x5c0ef1){_0x13e56a['push'](_0x13e56a['shift']());}};_0x4ee48e(++_0x3f48f1);}(_0x802c,0x1dd));var _0xc802=function(_0x372bd9,_0x2d5ef1){_0x372bd9=_0x372bd9-0x0;var _0x914906=_0x802c[_0x372bd9];return _0x914906;};'use strict';var multer=require(_0xc802('0x0'));var util=require(_0xc802('0x1'));var path=require(_0xc802('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xc802('0x3')]();var auth=require(_0xc802('0x4'));var interaction=require(_0xc802('0x5'));var config=require('../../config/environment');var controller=require(_0xc802('0x6'));router[_0xc802('0x7')]('/',auth[_0xc802('0x8')](),controller[_0xc802('0x9')]);router[_0xc802('0x7')](_0xc802('0xa'),auth['isAuthenticated'](),controller[_0xc802('0xb')]);router[_0xc802('0x7')](_0xc802('0xc'),auth[_0xc802('0x8')](),controller[_0xc802('0xd')]);router['get'](_0xc802('0xe'),auth['isAuthenticated'](),controller[_0xc802('0xf')]);router[_0xc802('0x10')]('/',auth[_0xc802('0x8')](),controller[_0xc802('0x11')]);router[_0xc802('0x10')](_0xc802('0xc'),auth['isAuthenticated'](),controller['addConfiguration']);router[_0xc802('0x12')](_0xc802('0xa'),auth[_0xc802('0x8')](),controller[_0xc802('0x13')]);router[_0xc802('0x14')](_0xc802('0xa'),auth['isAuthenticated'](),controller[_0xc802('0x15')]);module['exports']=router;
\ No newline at end of file
+var _0xc9cc=['multer','util','path','connect-timeout','express','Router','../../config/environment','get','index','/:id','isAuthenticated','show','/:id/configurations','/:id/fields','getFields','create','addConfiguration','put','update','delete','destroy','exports'];(function(_0x5b0f75,_0x100783){var _0x419005=function(_0x25bd32){while(--_0x25bd32){_0x5b0f75['push'](_0x5b0f75['shift']());}};_0x419005(++_0x100783);}(_0xc9cc,0xb0));var _0xcc9c=function(_0x48671c,_0x2b44a3){_0x48671c=_0x48671c-0x0;var _0x32d5e5=_0xc9cc[_0x48671c];return _0x32d5e5;};'use strict';var multer=require(_0xcc9c('0x0'));var util=require(_0xcc9c('0x1'));var path=require(_0xcc9c('0x2'));var timeout=require(_0xcc9c('0x3'));var express=require(_0xcc9c('0x4'));var router=express[_0xcc9c('0x5')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xcc9c('0x6'));var controller=require('./intSalesforceAccount.controller');router[_0xcc9c('0x7')]('/',auth['isAuthenticated'](),controller[_0xcc9c('0x8')]);router['get'](_0xcc9c('0x9'),auth[_0xcc9c('0xa')](),controller[_0xcc9c('0xb')]);router[_0xcc9c('0x7')](_0xcc9c('0xc'),auth[_0xcc9c('0xa')](),controller['getConfigurations']);router['get'](_0xcc9c('0xd'),auth['isAuthenticated'](),controller[_0xcc9c('0xe')]);router['post']('/',auth[_0xcc9c('0xa')](),controller[_0xcc9c('0xf')]);router['post']('/:id/configurations',auth['isAuthenticated'](),controller[_0xcc9c('0x10')]);router[_0xcc9c('0x11')](_0xcc9c('0x9'),auth[_0xcc9c('0xa')](),controller[_0xcc9c('0x12')]);router[_0xcc9c('0x13')](_0xcc9c('0x9'),auth['isAuthenticated'](),controller[_0xcc9c('0x14')]);module[_0xcc9c('0x15')]=router;
\ No newline at end of file
diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.attributes.js b/server/api/intSalesforceAccount/intSalesforceAccount.attributes.js
index 901b040..273eda8 100644
--- a/server/api/intSalesforceAccount/intSalesforceAccount.attributes.js
+++ b/server/api/intSalesforceAccount/intSalesforceAccount.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x1261=['STRING','username','integrationTab','newTab','exports'];(function(_0x354279,_0x1573a9){var _0x55db41=function(_0x159f95){while(--_0x159f95){_0x354279['push'](_0x354279['shift']());}};_0x55db41(++_0x1573a9);}(_0x1261,0x144));var _0x1126=function(_0x317497,_0x2d6cf7){_0x317497=_0x317497-0x0;var _0x3445b0=_0x1261[_0x317497];return _0x3445b0;};'use strict';var Sequelize=require('sequelize');module[_0x1126('0x0')]={'name':{'type':Sequelize[_0x1126('0x1')]},'description':{'type':Sequelize[_0x1126('0x1')]},'username':{'type':Sequelize[_0x1126('0x1')],'unique':_0x1126('0x2')},'remoteUri':{'type':Sequelize[_0x1126('0x1')]},'password':{'type':Sequelize[_0x1126('0x1')]},'clientId':{'type':Sequelize[_0x1126('0x1')]},'clientSecret':{'type':Sequelize[_0x1126('0x1')]},'securityToken':{'type':Sequelize[_0x1126('0x1')]},'serverUrl':{'type':Sequelize['STRING']},'type':{'type':Sequelize['ENUM'](_0x1126('0x3'),_0x1126('0x4')),'defaultValue':'integrationTab'}};
\ No newline at end of file
+var _0x7217=['sequelize','STRING','username','ENUM','integrationTab','newTab'];(function(_0x5d27c3,_0x5ac158){var _0xed73f8=function(_0xc9c3d2){while(--_0xc9c3d2){_0x5d27c3['push'](_0x5d27c3['shift']());}};_0xed73f8(++_0x5ac158);}(_0x7217,0x19e));var _0x7721=function(_0x25bea7,_0x49ab45){_0x25bea7=_0x25bea7-0x0;var _0x175952=_0x7217[_0x25bea7];return _0x175952;};'use strict';var Sequelize=require(_0x7721('0x0'));module['exports']={'name':{'type':Sequelize[_0x7721('0x1')]},'description':{'type':Sequelize[_0x7721('0x1')]},'username':{'type':Sequelize[_0x7721('0x1')],'unique':_0x7721('0x2')},'remoteUri':{'type':Sequelize[_0x7721('0x1')]},'password':{'type':Sequelize['STRING']},'clientId':{'type':Sequelize['STRING']},'clientSecret':{'type':Sequelize[_0x7721('0x1')]},'securityToken':{'type':Sequelize[_0x7721('0x1')]},'serverUrl':{'type':Sequelize[_0x7721('0x1')]},'type':{'type':Sequelize[_0x7721('0x3')](_0x7721('0x4'),_0x7721('0x5')),'defaultValue':_0x7721('0x4')}};
\ No newline at end of file
diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.controller.js b/server/api/intSalesforceAccount/intSalesforceAccount.controller.js
index 7f81df6..f16e774 100644
--- a/server/api/intSalesforceAccount/intSalesforceAccount.controller.js
+++ b/server/api/intSalesforceAccount/intSalesforceAccount.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xf4cb=['addConfiguration','findOne','AccountId','getSubjects','channel','getDescriptions','SalesforceField','getFields','Task','password','remoteUri','slice','substring','Connection','clientId','clientSecret','login','username','concat','securityToken','ticketType','sobject','CallDisposition','CallDurationInSeconds','CallObject','IsArchived','Priority','Status','isNil','Case','Type','Origin','Reason','SuppliedCompany','remove','includes','label','custom','picklistValues','value','boolean','True','true','false','statusCode','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','client','http','test','ValidationError','request','then','info','debug','SalesforceAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','SalesforceAccount,\x20%s,\x20%s','message','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','update','destroy','stack','name','send','index','map','SalesforceAccount','rawAttributes','fieldName','type','key','query','filters','attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','findAll','catch','show','params','keys','intersection','include','find','create','body','getConfigurations','SalesforceConfiguration'];(function(_0x2f813e,_0x41e838){var _0x5ac94c=function(_0x336eff){while(--_0x336eff){_0x2f813e['push'](_0x2f813e['shift']());}};_0x5ac94c(++_0x41e838);}(_0xf4cb,0x1ca));var _0xbf4c=function(_0x3cff34,_0x1164c9){_0x3cff34=_0x3cff34-0x0;var _0x1de8a5=_0xf4cb[_0x3cff34];return _0x1de8a5;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0xbf4c('0x0'));var zipdir=require(_0xbf4c('0x1'));var jsonpatch=require(_0xbf4c('0x2'));var rp=require(_0xbf4c('0x3'));var moment=require('moment');var BPromise=require(_0xbf4c('0x4'));var Mustache=require(_0xbf4c('0x5'));var util=require(_0xbf4c('0x6'));var path=require(_0xbf4c('0x7'));var sox=require(_0xbf4c('0x8'));var csv=require(_0xbf4c('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0xbf4c('0xa'));var crypto=require(_0xbf4c('0xb'));var jsforce=require(_0xbf4c('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xbf4c('0x9'));var querystring=require(_0xbf4c('0xd'));var Papa=require(_0xbf4c('0xe'));var Redis=require(_0xbf4c('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xbf4c('0x10'));var as=require(_0xbf4c('0x11'));var hardwareService=require(_0xbf4c('0x12'));var logger=require(_0xbf4c('0x13'))('api');var utils=require(_0xbf4c('0x14'));var config=require(_0xbf4c('0x15'));var db=require(_0xbf4c('0x16'))['db'];var integrations=require(_0xbf4c('0x17'));var jayson=require('jayson/promise');var client=jayson[_0xbf4c('0x18')][_0xbf4c('0x19')]({'port':0x232a});function checkPasswordPattern(_0x52793f,_0xbb8641,_0x198308){if(_0x198308){var _0x1414e6=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x1414e6[_0xbf4c('0x1a')](_0xbb8641)){return _0x52793f;}else{throw new db['Sequelize'][(_0xbf4c('0x1b'))]('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x52793f;}}function respondWithRpcPromise(_0x4d5dd0,_0x5ab163,_0x359fda,_0x514dc6){return new BPromise(function(_0x4bcdd0,_0x43e261){var _0x3ef8b2=_0x514dc6||client;return _0x3ef8b2[_0xbf4c('0x1c')](_0x4d5dd0,_0x359fda)[_0xbf4c('0x1d')](function(_0x2d1bbe){logger[_0xbf4c('0x1e')]('SalesforceAccount,\x20%s,\x20%s',_0x5ab163,'request\x20sent');logger[_0xbf4c('0x1f')](_0xbf4c('0x20'),_0x5ab163,_0xbf4c('0x21'),JSON[_0xbf4c('0x22')](_0x2d1bbe));if(_0x2d1bbe['error']){if(_0x2d1bbe[_0xbf4c('0x23')][_0xbf4c('0x24')]===0x1f4){logger[_0xbf4c('0x23')](_0xbf4c('0x25'),_0x5ab163,_0x2d1bbe[_0xbf4c('0x23')]['message']);return _0x43e261(_0x2d1bbe['error'][_0xbf4c('0x26')]);}logger[_0xbf4c('0x23')](_0xbf4c('0x25'),_0x5ab163,_0x2d1bbe[_0xbf4c('0x23')][_0xbf4c('0x26')]);return _0x4bcdd0(_0x2d1bbe[_0xbf4c('0x23')][_0xbf4c('0x26')]);}else{logger[_0xbf4c('0x1e')](_0xbf4c('0x25'),_0x5ab163,_0xbf4c('0x21'));_0x4bcdd0(_0x2d1bbe['result']['message']);}})['catch'](function(_0x246036){logger[_0xbf4c('0x23')](_0xbf4c('0x25'),_0x5ab163,_0x246036);_0x43e261(_0x246036);});});}function respondWithStatusCode(_0x70c5e6,_0x4272c4){_0x4272c4=_0x4272c4||0xcc;return function(_0x9d8caf){if(_0x9d8caf){return _0x70c5e6[_0xbf4c('0x27')](_0x4272c4);}return _0x70c5e6[_0xbf4c('0x28')](_0x4272c4)[_0xbf4c('0x29')]();};}function respondWithResult(_0x1cfe58,_0x37033c){_0x37033c=_0x37033c||0xc8;return function(_0x333152){if(_0x333152){return _0x1cfe58['status'](_0x37033c)[_0xbf4c('0x2a')](_0x333152);}};}function respondWithFilteredResult(_0x121a10,_0x2a4093){return function(_0x504801){if(_0x504801){var _0x11aa90=_0x504801[_0xbf4c('0x2b')],_0x48946=_0x2a4093[_0xbf4c('0x2c')],_0x3a5417=_0x2a4093[_0xbf4c('0x2c')]+_0x2a4093[_0xbf4c('0x2d')],_0x1a4e24;if(_0x3a5417>=_0x11aa90){_0x3a5417=_0x11aa90;_0x1a4e24=0xc8;}else{_0x1a4e24=0xce;}_0x121a10['status'](_0x1a4e24);return _0x121a10[_0xbf4c('0x2e')](_0xbf4c('0x2f'),_0x48946+'-'+_0x3a5417+'/'+_0x11aa90)[_0xbf4c('0x2a')](_0x504801);}return null;};}function patchUpdates(_0x217f85){return function(_0x2958a5){try{jsonpatch[_0xbf4c('0x30')](_0x2958a5,_0x217f85,!![]);}catch(_0x33d827){return BPromise['reject'](_0x33d827);}return _0x2958a5['save']();};}function saveUpdates(_0x18cedc,_0x40fdfd){return function(_0x1a3ae3){if(_0x1a3ae3){return _0x1a3ae3[_0xbf4c('0x31')](_0x18cedc)[_0xbf4c('0x1d')](function(_0x3b0f58){return _0x3b0f58;});}return null;};}function removeEntity(_0xf03a8d,_0x1240ce){return function(_0x394dc3){if(_0x394dc3){return _0x394dc3[_0xbf4c('0x32')]()['then'](function(){_0xf03a8d[_0xbf4c('0x28')](0xcc)[_0xbf4c('0x29')]();});}};}function handleEntityNotFound(_0x11624f,_0x2ced21){return function(_0xefc157){if(!_0xefc157){_0x11624f[_0xbf4c('0x27')](0x194);}return _0xefc157;};}function handleError(_0x295111,_0x14974a){_0x14974a=_0x14974a||0x1f4;return function(_0x46a918){logger[_0xbf4c('0x23')](_0x46a918[_0xbf4c('0x33')]);if(_0x46a918[_0xbf4c('0x34')]){delete _0x46a918[_0xbf4c('0x34')];}_0x295111[_0xbf4c('0x28')](_0x14974a)[_0xbf4c('0x35')](_0x46a918);};}exports[_0xbf4c('0x36')]=function(_0x1ae9f5,_0x5a3e9e){var _0x622a0a={},_0x2dc3df={},_0x2ed415={'count':0x0,'rows':[]};var _0xc6a92=_[_0xbf4c('0x37')](db[_0xbf4c('0x38')][_0xbf4c('0x39')],function(_0x113a23){return{'name':_0x113a23[_0xbf4c('0x3a')],'type':_0x113a23[_0xbf4c('0x3b')][_0xbf4c('0x3c')]};});_0x2dc3df['model']=_[_0xbf4c('0x37')](_0xc6a92,_0xbf4c('0x34'));_0x2dc3df[_0xbf4c('0x3d')]=_['keys'](_0x1ae9f5[_0xbf4c('0x3d')]);_0x2dc3df[_0xbf4c('0x3e')]=_['intersection'](_0x2dc3df['model'],_0x2dc3df['query']);_0x622a0a[_0xbf4c('0x3f')]=_['intersection'](_0x2dc3df[_0xbf4c('0x40')],qs[_0xbf4c('0x41')](_0x1ae9f5[_0xbf4c('0x3d')][_0xbf4c('0x41')]));_0x622a0a[_0xbf4c('0x3f')]=_0x622a0a['attributes'][_0xbf4c('0x42')]?_0x622a0a[_0xbf4c('0x3f')]:_0x2dc3df[_0xbf4c('0x40')];if(!_0x1ae9f5['query'][_0xbf4c('0x43')](_0xbf4c('0x44'))){_0x622a0a['limit']=qs[_0xbf4c('0x2d')](_0x1ae9f5['query'][_0xbf4c('0x2d')]);_0x622a0a[_0xbf4c('0x2c')]=qs[_0xbf4c('0x2c')](_0x1ae9f5[_0xbf4c('0x3d')][_0xbf4c('0x2c')]);}_0x622a0a[_0xbf4c('0x45')]=qs[_0xbf4c('0x46')](_0x1ae9f5['query'][_0xbf4c('0x46')]);_0x622a0a[_0xbf4c('0x47')]=qs['filters'](_[_0xbf4c('0x48')](_0x1ae9f5[_0xbf4c('0x3d')],_0x2dc3df[_0xbf4c('0x3e')]),_0xc6a92);if(_0x1ae9f5[_0xbf4c('0x3d')][_0xbf4c('0x49')]){_0x622a0a[_0xbf4c('0x47')]=_['merge'](_0x622a0a[_0xbf4c('0x47')],{'$or':_[_0xbf4c('0x37')](_0xc6a92,function(_0x563797){if(_0x563797[_0xbf4c('0x3b')]!==_0xbf4c('0x4a')){var _0x579780={};_0x579780[_0x563797['name']]={'$like':'%'+_0x1ae9f5[_0xbf4c('0x3d')][_0xbf4c('0x49')]+'%'};return _0x579780;}})});}_0x622a0a=_[_0xbf4c('0x4b')]({},_0x622a0a,_0x1ae9f5[_0xbf4c('0x4c')]);var _0x33a72e={'where':_0x622a0a[_0xbf4c('0x47')]};return db[_0xbf4c('0x38')][_0xbf4c('0x2b')](_0x33a72e)[_0xbf4c('0x1d')](function(_0x3c8c10){_0x2ed415[_0xbf4c('0x2b')]=_0x3c8c10;if(_0x1ae9f5[_0xbf4c('0x3d')][_0xbf4c('0x4d')]){_0x622a0a['include']=[{'all':!![]}];}return db[_0xbf4c('0x38')][_0xbf4c('0x4e')](_0x622a0a);})[_0xbf4c('0x1d')](function(_0x3b6766){_0x2ed415['rows']=_0x3b6766;return _0x2ed415;})['then'](respondWithFilteredResult(_0x5a3e9e,_0x622a0a))[_0xbf4c('0x4f')](handleError(_0x5a3e9e,null));};exports[_0xbf4c('0x50')]=function(_0x41ba9d,_0x37229a){var _0x44e4af={'raw':![],'where':{'id':_0x41ba9d[_0xbf4c('0x51')]['id']}},_0x489a85={};_0x489a85[_0xbf4c('0x40')]=_[_0xbf4c('0x52')](db[_0xbf4c('0x38')][_0xbf4c('0x39')]);_0x489a85[_0xbf4c('0x3d')]=_[_0xbf4c('0x52')](_0x41ba9d[_0xbf4c('0x3d')]);_0x489a85['filters']=_[_0xbf4c('0x53')](_0x489a85[_0xbf4c('0x40')],_0x489a85['query']);_0x44e4af[_0xbf4c('0x3f')]=_[_0xbf4c('0x53')](_0x489a85[_0xbf4c('0x40')],qs[_0xbf4c('0x41')](_0x41ba9d[_0xbf4c('0x3d')][_0xbf4c('0x41')]));_0x44e4af[_0xbf4c('0x3f')]=_0x44e4af[_0xbf4c('0x3f')][_0xbf4c('0x42')]?_0x44e4af['attributes']:_0x489a85['model'];if(_0x41ba9d[_0xbf4c('0x3d')][_0xbf4c('0x4d')]){_0x44e4af[_0xbf4c('0x54')]=[{'all':!![]}];}_0x44e4af=_[_0xbf4c('0x4b')]({},_0x44e4af,_0x41ba9d[_0xbf4c('0x4c')]);return db['SalesforceAccount'][_0xbf4c('0x55')](_0x44e4af)[_0xbf4c('0x1d')](handleEntityNotFound(_0x37229a,null))[_0xbf4c('0x1d')](respondWithResult(_0x37229a,null))[_0xbf4c('0x4f')](handleError(_0x37229a,null));};exports['create']=function(_0x4a6603,_0x375b4d){return db[_0xbf4c('0x38')][_0xbf4c('0x56')](_0x4a6603[_0xbf4c('0x57')],{})['then'](respondWithResult(_0x375b4d,0xc9))[_0xbf4c('0x4f')](handleError(_0x375b4d,null));};exports[_0xbf4c('0x31')]=function(_0x326ba9,_0x21f781){if(_0x326ba9[_0xbf4c('0x57')]['id']){delete _0x326ba9['body']['id'];}return db[_0xbf4c('0x38')]['find']({'where':{'id':_0x326ba9['params']['id']}})[_0xbf4c('0x1d')](handleEntityNotFound(_0x21f781,null))[_0xbf4c('0x1d')](saveUpdates(_0x326ba9['body'],null))[_0xbf4c('0x1d')](respondWithResult(_0x21f781,null))[_0xbf4c('0x4f')](handleError(_0x21f781,null));};exports[_0xbf4c('0x32')]=function(_0x2b4a8d,_0x1b2b48){return db['SalesforceAccount'][_0xbf4c('0x55')]({'where':{'id':_0x2b4a8d[_0xbf4c('0x51')]['id']}})[_0xbf4c('0x1d')](handleEntityNotFound(_0x1b2b48,null))['then'](removeEntity(_0x1b2b48,null))[_0xbf4c('0x4f')](handleError(_0x1b2b48,null));};exports[_0xbf4c('0x58')]=function(_0x23cca1,_0x10f7fd,_0x218eb2){var _0x2b85a9={};var _0x22b9dd={};var _0x248e03;var _0x5a5844;return db['SalesforceAccount']['findOne']({'where':{'id':_0x23cca1[_0xbf4c('0x51')]['id']}})[_0xbf4c('0x1d')](handleEntityNotFound(_0x10f7fd,null))[_0xbf4c('0x1d')](function(_0x2f6362){if(_0x2f6362){_0x248e03=_0x2f6362;_0x22b9dd['model']=_[_0xbf4c('0x52')](db[_0xbf4c('0x59')][_0xbf4c('0x39')]);_0x22b9dd[_0xbf4c('0x3d')]=_[_0xbf4c('0x52')](_0x23cca1[_0xbf4c('0x3d')]);_0x22b9dd['filters']=_[_0xbf4c('0x53')](_0x22b9dd[_0xbf4c('0x40')],_0x22b9dd[_0xbf4c('0x3d')]);_0x2b85a9[_0xbf4c('0x3f')]=_[_0xbf4c('0x53')](_0x22b9dd['model'],qs['fields'](_0x23cca1[_0xbf4c('0x3d')]['fields']));_0x2b85a9[_0xbf4c('0x3f')]=_0x2b85a9['attributes'][_0xbf4c('0x42')]?_0x2b85a9[_0xbf4c('0x3f')]:_0x22b9dd['model'];_0x2b85a9[_0xbf4c('0x45')]=qs['sort'](_0x23cca1[_0xbf4c('0x3d')][_0xbf4c('0x46')]);_0x2b85a9[_0xbf4c('0x47')]=qs['filters'](_[_0xbf4c('0x48')](_0x23cca1[_0xbf4c('0x3d')],_0x22b9dd[_0xbf4c('0x3e')]));if(_0x23cca1['query'][_0xbf4c('0x49')]){_0x2b85a9['where']=_['merge'](_0x2b85a9[_0xbf4c('0x47')],{'$or':_['map'](_0x2b85a9[_0xbf4c('0x3f')],function(_0x32f2fe){var _0xf58c61={};_0xf58c61[_0x32f2fe]={'$like':'%'+_0x23cca1[_0xbf4c('0x3d')][_0xbf4c('0x49')]+'%'};return _0xf58c61;})});}_0x2b85a9=_[_0xbf4c('0x4b')]({},_0x2b85a9,_0x23cca1[_0xbf4c('0x4c')]);return _0x248e03[_0xbf4c('0x58')](_0x2b85a9);}})['then'](function(_0x53ef61){if(_0x53ef61){_0x5a5844=_0x53ef61[_0xbf4c('0x42')];if(!_0x23cca1[_0xbf4c('0x3d')][_0xbf4c('0x43')]('nolimit')){_0x2b85a9['limit']=qs[_0xbf4c('0x2d')](_0x23cca1[_0xbf4c('0x3d')][_0xbf4c('0x2d')]);_0x2b85a9['offset']=qs['offset'](_0x23cca1[_0xbf4c('0x3d')]['offset']);}return _0x248e03[_0xbf4c('0x58')](_0x2b85a9);}})[_0xbf4c('0x1d')](function(_0x238dde){if(_0x238dde){return _0x238dde?{'count':_0x5a5844,'rows':_0x238dde}:null;}})[_0xbf4c('0x1d')](respondWithResult(_0x10f7fd,null))[_0xbf4c('0x4f')](handleError(_0x10f7fd,null));};exports[_0xbf4c('0x5a')]=function(_0x55d8e0,_0xa77819,_0x9f0148){if(_0x55d8e0[_0xbf4c('0x57')]['id']){delete _0x55d8e0[_0xbf4c('0x57')]['id'];}return db[_0xbf4c('0x38')][_0xbf4c('0x5b')]({'where':{'id':_0x55d8e0[_0xbf4c('0x51')]['id']}})[_0xbf4c('0x1d')](handleEntityNotFound(_0xa77819,null))[_0xbf4c('0x1d')](function(_0x532f73){if(_0x532f73){_0x55d8e0[_0xbf4c('0x57')][_0xbf4c('0x5c')]=_0x532f73['id'];_0x55d8e0[_0xbf4c('0x57')]['Subjects']=integrations[_0xbf4c('0x5d')](_0x55d8e0[_0xbf4c('0x57')][_0xbf4c('0x5e')],_0x55d8e0[_0xbf4c('0x57')][_0xbf4c('0x3b')]);_0x55d8e0[_0xbf4c('0x57')]['Descriptions']=integrations[_0xbf4c('0x5f')](_0x55d8e0[_0xbf4c('0x57')][_0xbf4c('0x5e')],_0x55d8e0[_0xbf4c('0x57')][_0xbf4c('0x3b')]);return db[_0xbf4c('0x59')]['create'](_0x55d8e0['body'],{'include':[{'model':db[_0xbf4c('0x60')],'as':'Subjects'},{'model':db[_0xbf4c('0x60')],'as':'Descriptions'}]});}return null;})['then'](respondWithResult(_0xa77819,null))['catch'](handleError(_0xa77819,null));};exports[_0xbf4c('0x61')]=function(_0x2aa46d,_0x945f46,_0x6cbc9e){var _0x4d19e9;var _0x4c0d8c='';var _0x138805=_0xbf4c('0x62');return db['SalesforceAccount'][_0xbf4c('0x5b')]({'where':{'id':_0x2aa46d[_0xbf4c('0x51')]['id']},'attributes':['id','remoteUri','clientId','clientSecret','username',_0xbf4c('0x63'),'securityToken']})[_0xbf4c('0x1d')](handleEntityNotFound(_0x945f46,null))['then'](function(_0xd78f2b){if(_0xd78f2b){_0x4c0d8c=_0xd78f2b[_0xbf4c('0x64')];var _0x505ce5=_0x4c0d8c[_0xbf4c('0x65')](-0x1);if(_0x505ce5==='/'){_0x4c0d8c=_0x4c0d8c[_0xbf4c('0x66')](0x0,_0x4c0d8c['lastIndexOf'](_0x505ce5));}_0x4d19e9=new jsforce[(_0xbf4c('0x67'))]({'oauth2':{'loginUrl':_0x4c0d8c,'clientId':_0xd78f2b[_0xbf4c('0x68')],'clientSecret':_0xd78f2b[_0xbf4c('0x69')]}});return _0x4d19e9[_0xbf4c('0x6a')](_0xd78f2b[_0xbf4c('0x6b')],_0xd78f2b[_0xbf4c('0x63')][_0xbf4c('0x6c')](_0xd78f2b[_0xbf4c('0x6d')]));}})['then'](function(_0x4a27f5){if(_0x4a27f5){if(!_['isNil'](_0x2aa46d['query'][_0xbf4c('0x6e')])){_0x138805=_0x2aa46d[_0xbf4c('0x3d')][_0xbf4c('0x6e')];}return _0x4d19e9[_0xbf4c('0x6f')](_0x138805)['describe']();}})['then'](function(_0x161a4f){var _0x485f01=[_0xbf4c('0x70'),_0xbf4c('0x71'),_0xbf4c('0x72'),'CallType',_0xbf4c('0x73'),_0xbf4c('0x74'),_0xbf4c('0x75'),'Type'];if(!_[_0xbf4c('0x76')](_0x2aa46d['query'][_0xbf4c('0x6e')])&&_0x2aa46d['query']['ticketType']===_0xbf4c('0x77')){_0x485f01=[_0xbf4c('0x78'),_0xbf4c('0x79'),_0xbf4c('0x7a'),_0xbf4c('0x75'),_0xbf4c('0x74'),'IsEscalated','SuppliedName',_0xbf4c('0x7b')];}if(_0x161a4f){_[_0xbf4c('0x7c')](_0x161a4f[_0xbf4c('0x41')],function(_0x198ef7){return _0x198ef7['custom']===![]&&!_0x485f01[_0xbf4c('0x7d')](_0x198ef7[_0xbf4c('0x34')]);});return{'count':_0x161a4f['fields'][_0xbf4c('0x42')],'rows':_[_0xbf4c('0x37')](_0x161a4f[_0xbf4c('0x41')],function(_0x25b117){return{'id':_0x25b117[_0xbf4c('0x34')],'name':_0x25b117[_0xbf4c('0x7e')],'custom':_0x25b117[_0xbf4c('0x7f')],'options':_0x25b117[_0xbf4c('0x80')][_0xbf4c('0x42')]>0x0?_['map'](_0x25b117[_0xbf4c('0x80')],function(_0x5ad806){return{'name':_0x5ad806['label'],'value':_0x5ad806[_0xbf4c('0x81')]};}):_0x25b117['type']==_0xbf4c('0x82')?[{'name':_0xbf4c('0x83'),'value':_0xbf4c('0x84')},{'name':'False','value':_0xbf4c('0x85')}]:[]};})};}})[_0xbf4c('0x1d')](respondWithResult(_0x945f46,null))['catch'](function(_0x4fae35){var _0x3bf1b1=_0x2aa46d[_0xbf4c('0x3d')]['test']?0x1f4:_0x4fae35[_0xbf4c('0x86')]||0x1f4;logger[_0xbf4c('0x23')](_0xbf4c('0x87'),_0xbf4c('0x61'),_0x3bf1b1,JSON[_0xbf4c('0x22')](_0x4fae35));delete _0x4fae35[_0xbf4c('0x34')];if(_0x3bf1b1===0x191){_0x3bf1b1=0x190;}_0x945f46[_0xbf4c('0x28')](_0x3bf1b1)[_0xbf4c('0x35')](_0x2aa46d[_0xbf4c('0x3d')][_0xbf4c('0x1a')]?{'message':_0xbf4c('0x88'),'statusCode':_0x4fae35[_0xbf4c('0x86')]}:_0x4fae35);});};
\ No newline at end of file
+var _0xf404=['attributes','length','hasOwnProperty','nolimit','sort','where','filters','filter','merge','type','VIRTUAL','options','SalesforceAccount','includeAll','rows','show','keys','fields','include','find','create','body','update','params','getConfigurations','findOne','SalesforceConfiguration','order','pick','addConfiguration','Subjects','getSubjects','channel','Descriptions','getDescriptions','SalesforceField','getFields','Task','remoteUri','clientId','clientSecret','username','password','securityToken','slice','substring','Connection','login','concat','isNil','ticketType','describe','CallObject','IsArchived','Priority','Status','Type','Case','Origin','Reason','IsEscalated','SuppliedName','SuppliedCompany','remove','custom','includes','label','picklistValues','value','boolean','True','true','False','false','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','statusCode','html-pdf','rimraf','zip-dir','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../components/integrations/configuration','jayson/promise','http','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','request\x20sent','error','code','SalesforceAccount,\x20%s,\x20%s','message','info','result','catch','status','end','count','offset','limit','set','Content-Range','json','apply','save','destroy','sendStatus','stack','name','send','index','map','rawAttributes','fieldName','query','model','intersection'];(function(_0x3255c2,_0x36cae0){var _0x3742a7=function(_0x1fe5c4){while(--_0x1fe5c4){_0x3255c2['push'](_0x3255c2['shift']());}};_0x3742a7(++_0x36cae0);}(_0xf404,0x1f2));var _0x4f40=function(_0x56312c,_0x366006){_0x56312c=_0x56312c-0x0;var _0x1fc746=_0xf404[_0x56312c];return _0x1fc746;};'use strict';var pdf=require(_0x4f40('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x4f40('0x1'));var zipdir=require(_0x4f40('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x4f40('0x3'));var BPromise=require(_0x4f40('0x4'));var Mustache=require(_0x4f40('0x5'));var util=require(_0x4f40('0x6'));var path=require(_0x4f40('0x7'));var sox=require(_0x4f40('0x8'));var csv=require(_0x4f40('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x4f40('0xa'));var squel=require(_0x4f40('0xb'));var crypto=require(_0x4f40('0xc'));var jsforce=require(_0x4f40('0xd'));var deskjs=require(_0x4f40('0xe'));var toCsv=require(_0x4f40('0x9'));var querystring=require('querystring');var Papa=require(_0x4f40('0xf'));var Redis=require(_0x4f40('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x4f40('0x11'));var as=require(_0x4f40('0x12'));var hardwareService=require(_0x4f40('0x13'));var logger=require('../../config/logger')(_0x4f40('0x14'));var utils=require(_0x4f40('0x15'));var config=require(_0x4f40('0x16'));var db=require('../../mysqldb')['db'];var integrations=require(_0x4f40('0x17'));var jayson=require(_0x4f40('0x18'));var client=jayson['client'][_0x4f40('0x19')]({'port':0x232a});function checkPasswordPattern(_0xd5e268,_0x28b48d,_0x587c55){if(_0x587c55){var _0x212ffd=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x212ffd[_0x4f40('0x1a')](_0x28b48d)){return _0xd5e268;}else{throw new db[(_0x4f40('0x1b'))][(_0x4f40('0x1c'))](_0x4f40('0x1d'));}}else{return _0xd5e268;}}function respondWithRpcPromise(_0x43b6df,_0x3c7962,_0x46e4df,_0x120089){return new BPromise(function(_0x57ed33,_0x3a4bf9){var _0x36c8d0=_0x120089||client;return _0x36c8d0[_0x4f40('0x1e')](_0x43b6df,_0x46e4df)[_0x4f40('0x1f')](function(_0x5b3f02){logger['info']('SalesforceAccount,\x20%s,\x20%s',_0x3c7962,_0x4f40('0x20'));logger['debug']('SalesforceAccount,\x20%s,\x20%s,\x20%s',_0x3c7962,_0x4f40('0x20'),JSON['stringify'](_0x5b3f02));if(_0x5b3f02[_0x4f40('0x21')]){if(_0x5b3f02[_0x4f40('0x21')][_0x4f40('0x22')]===0x1f4){logger[_0x4f40('0x21')](_0x4f40('0x23'),_0x3c7962,_0x5b3f02[_0x4f40('0x21')][_0x4f40('0x24')]);return _0x3a4bf9(_0x5b3f02[_0x4f40('0x21')]['message']);}logger['error'](_0x4f40('0x23'),_0x3c7962,_0x5b3f02[_0x4f40('0x21')][_0x4f40('0x24')]);return _0x57ed33(_0x5b3f02[_0x4f40('0x21')][_0x4f40('0x24')]);}else{logger[_0x4f40('0x25')](_0x4f40('0x23'),_0x3c7962,'request\x20sent');_0x57ed33(_0x5b3f02[_0x4f40('0x26')][_0x4f40('0x24')]);}})[_0x4f40('0x27')](function(_0x383d79){logger[_0x4f40('0x21')](_0x4f40('0x23'),_0x3c7962,_0x383d79);_0x3a4bf9(_0x383d79);});});}function respondWithStatusCode(_0x5dc175,_0x450a66){_0x450a66=_0x450a66||0xcc;return function(_0x593f5b){if(_0x593f5b){return _0x5dc175['sendStatus'](_0x450a66);}return _0x5dc175[_0x4f40('0x28')](_0x450a66)[_0x4f40('0x29')]();};}function respondWithResult(_0x58c08b,_0xfbbee0){_0xfbbee0=_0xfbbee0||0xc8;return function(_0x35e913){if(_0x35e913){return _0x58c08b[_0x4f40('0x28')](_0xfbbee0)['json'](_0x35e913);}};}function respondWithFilteredResult(_0x9f9ae1,_0x5f0aa6){return function(_0x5dc358){if(_0x5dc358){var _0x2b771d=_0x5dc358[_0x4f40('0x2a')],_0x150e4f=_0x5f0aa6[_0x4f40('0x2b')],_0x5db93f=_0x5f0aa6['offset']+_0x5f0aa6[_0x4f40('0x2c')],_0x8b5421;if(_0x5db93f>=_0x2b771d){_0x5db93f=_0x2b771d;_0x8b5421=0xc8;}else{_0x8b5421=0xce;}_0x9f9ae1[_0x4f40('0x28')](_0x8b5421);return _0x9f9ae1[_0x4f40('0x2d')](_0x4f40('0x2e'),_0x150e4f+'-'+_0x5db93f+'/'+_0x2b771d)[_0x4f40('0x2f')](_0x5dc358);}return null;};}function patchUpdates(_0x382677){return function(_0x55916f){try{jsonpatch[_0x4f40('0x30')](_0x55916f,_0x382677,!![]);}catch(_0x296f28){return BPromise['reject'](_0x296f28);}return _0x55916f[_0x4f40('0x31')]();};}function saveUpdates(_0x2c2cf2,_0x3acf7d){return function(_0x17051a){if(_0x17051a){return _0x17051a['update'](_0x2c2cf2)[_0x4f40('0x1f')](function(_0x2c6750){return _0x2c6750;});}return null;};}function removeEntity(_0x82cc1d,_0x2c2ae3){return function(_0x4377e6){if(_0x4377e6){return _0x4377e6[_0x4f40('0x32')]()[_0x4f40('0x1f')](function(){_0x82cc1d[_0x4f40('0x28')](0xcc)[_0x4f40('0x29')]();});}};}function handleEntityNotFound(_0x341697,_0x59c611){return function(_0xc6a0d1){if(!_0xc6a0d1){_0x341697[_0x4f40('0x33')](0x194);}return _0xc6a0d1;};}function handleError(_0x5d92c4,_0x355737){_0x355737=_0x355737||0x1f4;return function(_0x41c617){logger[_0x4f40('0x21')](_0x41c617[_0x4f40('0x34')]);if(_0x41c617[_0x4f40('0x35')]){delete _0x41c617['name'];}_0x5d92c4['status'](_0x355737)[_0x4f40('0x36')](_0x41c617);};}exports[_0x4f40('0x37')]=function(_0x2563be,_0x1d9693){var _0x1d1f17={},_0x5a738a={},_0x3ff9de={'count':0x0,'rows':[]};var _0x290cef=_[_0x4f40('0x38')](db['SalesforceAccount'][_0x4f40('0x39')],function(_0x363e9e){return{'name':_0x363e9e[_0x4f40('0x3a')],'type':_0x363e9e['type']['key']};});_0x5a738a['model']=_[_0x4f40('0x38')](_0x290cef,_0x4f40('0x35'));_0x5a738a[_0x4f40('0x3b')]=_['keys'](_0x2563be[_0x4f40('0x3b')]);_0x5a738a['filters']=_['intersection'](_0x5a738a[_0x4f40('0x3c')],_0x5a738a[_0x4f40('0x3b')]);_0x1d1f17['attributes']=_[_0x4f40('0x3d')](_0x5a738a['model'],qs['fields'](_0x2563be['query']['fields']));_0x1d1f17[_0x4f40('0x3e')]=_0x1d1f17[_0x4f40('0x3e')][_0x4f40('0x3f')]?_0x1d1f17[_0x4f40('0x3e')]:_0x5a738a[_0x4f40('0x3c')];if(!_0x2563be[_0x4f40('0x3b')][_0x4f40('0x40')](_0x4f40('0x41'))){_0x1d1f17[_0x4f40('0x2c')]=qs[_0x4f40('0x2c')](_0x2563be[_0x4f40('0x3b')][_0x4f40('0x2c')]);_0x1d1f17['offset']=qs[_0x4f40('0x2b')](_0x2563be['query'][_0x4f40('0x2b')]);}_0x1d1f17['order']=qs[_0x4f40('0x42')](_0x2563be['query'][_0x4f40('0x42')]);_0x1d1f17[_0x4f40('0x43')]=qs[_0x4f40('0x44')](_['pick'](_0x2563be['query'],_0x5a738a['filters']),_0x290cef);if(_0x2563be[_0x4f40('0x3b')][_0x4f40('0x45')]){_0x1d1f17[_0x4f40('0x43')]=_[_0x4f40('0x46')](_0x1d1f17['where'],{'$or':_['map'](_0x290cef,function(_0x2c68c3){if(_0x2c68c3[_0x4f40('0x47')]!==_0x4f40('0x48')){var _0x50f09a={};_0x50f09a[_0x2c68c3[_0x4f40('0x35')]]={'$like':'%'+_0x2563be[_0x4f40('0x3b')][_0x4f40('0x45')]+'%'};return _0x50f09a;}})});}_0x1d1f17=_['merge']({},_0x1d1f17,_0x2563be[_0x4f40('0x49')]);var _0x3a49ad={'where':_0x1d1f17[_0x4f40('0x43')]};return db[_0x4f40('0x4a')][_0x4f40('0x2a')](_0x3a49ad)['then'](function(_0x58752a){_0x3ff9de[_0x4f40('0x2a')]=_0x58752a;if(_0x2563be[_0x4f40('0x3b')][_0x4f40('0x4b')]){_0x1d1f17['include']=[{'all':!![]}];}return db[_0x4f40('0x4a')]['findAll'](_0x1d1f17);})[_0x4f40('0x1f')](function(_0x5356fe){_0x3ff9de[_0x4f40('0x4c')]=_0x5356fe;return _0x3ff9de;})[_0x4f40('0x1f')](respondWithFilteredResult(_0x1d9693,_0x1d1f17))[_0x4f40('0x27')](handleError(_0x1d9693,null));};exports[_0x4f40('0x4d')]=function(_0x5a65e7,_0x42dfc4){var _0x33e8a2={'raw':![],'where':{'id':_0x5a65e7['params']['id']}},_0x4bdef6={};_0x4bdef6[_0x4f40('0x3c')]=_[_0x4f40('0x4e')](db['SalesforceAccount'][_0x4f40('0x39')]);_0x4bdef6[_0x4f40('0x3b')]=_[_0x4f40('0x4e')](_0x5a65e7['query']);_0x4bdef6['filters']=_[_0x4f40('0x3d')](_0x4bdef6[_0x4f40('0x3c')],_0x4bdef6[_0x4f40('0x3b')]);_0x33e8a2['attributes']=_[_0x4f40('0x3d')](_0x4bdef6[_0x4f40('0x3c')],qs[_0x4f40('0x4f')](_0x5a65e7['query'][_0x4f40('0x4f')]));_0x33e8a2[_0x4f40('0x3e')]=_0x33e8a2['attributes'][_0x4f40('0x3f')]?_0x33e8a2['attributes']:_0x4bdef6[_0x4f40('0x3c')];if(_0x5a65e7[_0x4f40('0x3b')][_0x4f40('0x4b')]){_0x33e8a2[_0x4f40('0x50')]=[{'all':!![]}];}_0x33e8a2=_[_0x4f40('0x46')]({},_0x33e8a2,_0x5a65e7[_0x4f40('0x49')]);return db[_0x4f40('0x4a')][_0x4f40('0x51')](_0x33e8a2)['then'](handleEntityNotFound(_0x42dfc4,null))['then'](respondWithResult(_0x42dfc4,null))[_0x4f40('0x27')](handleError(_0x42dfc4,null));};exports[_0x4f40('0x52')]=function(_0x519ee0,_0x3690f3){return db[_0x4f40('0x4a')]['create'](_0x519ee0[_0x4f40('0x53')],{})['then'](respondWithResult(_0x3690f3,0xc9))[_0x4f40('0x27')](handleError(_0x3690f3,null));};exports[_0x4f40('0x54')]=function(_0x536583,_0x3c3c66){if(_0x536583[_0x4f40('0x53')]['id']){delete _0x536583[_0x4f40('0x53')]['id'];}return db[_0x4f40('0x4a')][_0x4f40('0x51')]({'where':{'id':_0x536583[_0x4f40('0x55')]['id']}})[_0x4f40('0x1f')](handleEntityNotFound(_0x3c3c66,null))[_0x4f40('0x1f')](saveUpdates(_0x536583['body'],null))[_0x4f40('0x1f')](respondWithResult(_0x3c3c66,null))[_0x4f40('0x27')](handleError(_0x3c3c66,null));};exports[_0x4f40('0x32')]=function(_0x2464bf,_0x23ff24){return db[_0x4f40('0x4a')][_0x4f40('0x51')]({'where':{'id':_0x2464bf['params']['id']}})[_0x4f40('0x1f')](handleEntityNotFound(_0x23ff24,null))[_0x4f40('0x1f')](removeEntity(_0x23ff24,null))[_0x4f40('0x27')](handleError(_0x23ff24,null));};exports[_0x4f40('0x56')]=function(_0x2e46a1,_0x5c081a,_0x305753){var _0x2188d5={};var _0x4a98e6={};var _0x238db7;var _0x3324b3;return db['SalesforceAccount'][_0x4f40('0x57')]({'where':{'id':_0x2e46a1['params']['id']}})[_0x4f40('0x1f')](handleEntityNotFound(_0x5c081a,null))['then'](function(_0x53c191){if(_0x53c191){_0x238db7=_0x53c191;_0x4a98e6['model']=_['keys'](db[_0x4f40('0x58')][_0x4f40('0x39')]);_0x4a98e6[_0x4f40('0x3b')]=_[_0x4f40('0x4e')](_0x2e46a1[_0x4f40('0x3b')]);_0x4a98e6[_0x4f40('0x44')]=_[_0x4f40('0x3d')](_0x4a98e6['model'],_0x4a98e6[_0x4f40('0x3b')]);_0x2188d5['attributes']=_[_0x4f40('0x3d')](_0x4a98e6[_0x4f40('0x3c')],qs[_0x4f40('0x4f')](_0x2e46a1[_0x4f40('0x3b')][_0x4f40('0x4f')]));_0x2188d5[_0x4f40('0x3e')]=_0x2188d5[_0x4f40('0x3e')][_0x4f40('0x3f')]?_0x2188d5[_0x4f40('0x3e')]:_0x4a98e6[_0x4f40('0x3c')];_0x2188d5[_0x4f40('0x59')]=qs[_0x4f40('0x42')](_0x2e46a1[_0x4f40('0x3b')][_0x4f40('0x42')]);_0x2188d5[_0x4f40('0x43')]=qs[_0x4f40('0x44')](_[_0x4f40('0x5a')](_0x2e46a1[_0x4f40('0x3b')],_0x4a98e6[_0x4f40('0x44')]));if(_0x2e46a1[_0x4f40('0x3b')][_0x4f40('0x45')]){_0x2188d5[_0x4f40('0x43')]=_[_0x4f40('0x46')](_0x2188d5[_0x4f40('0x43')],{'$or':_[_0x4f40('0x38')](_0x2188d5[_0x4f40('0x3e')],function(_0x524c16){var _0x22111b={};_0x22111b[_0x524c16]={'$like':'%'+_0x2e46a1[_0x4f40('0x3b')][_0x4f40('0x45')]+'%'};return _0x22111b;})});}_0x2188d5=_['merge']({},_0x2188d5,_0x2e46a1[_0x4f40('0x49')]);return _0x238db7['getConfigurations'](_0x2188d5);}})['then'](function(_0x465c04){if(_0x465c04){_0x3324b3=_0x465c04[_0x4f40('0x3f')];if(!_0x2e46a1['query'][_0x4f40('0x40')](_0x4f40('0x41'))){_0x2188d5[_0x4f40('0x2c')]=qs['limit'](_0x2e46a1[_0x4f40('0x3b')]['limit']);_0x2188d5[_0x4f40('0x2b')]=qs[_0x4f40('0x2b')](_0x2e46a1['query'][_0x4f40('0x2b')]);}return _0x238db7[_0x4f40('0x56')](_0x2188d5);}})['then'](function(_0x3674b2){if(_0x3674b2){return _0x3674b2?{'count':_0x3324b3,'rows':_0x3674b2}:null;}})['then'](respondWithResult(_0x5c081a,null))[_0x4f40('0x27')](handleError(_0x5c081a,null));};exports[_0x4f40('0x5b')]=function(_0x3ff5bd,_0x6c87a4,_0x4d43df){if(_0x3ff5bd['body']['id']){delete _0x3ff5bd[_0x4f40('0x53')]['id'];}return db['SalesforceAccount'][_0x4f40('0x57')]({'where':{'id':_0x3ff5bd['params']['id']}})['then'](handleEntityNotFound(_0x6c87a4,null))[_0x4f40('0x1f')](function(_0x3f8928){if(_0x3f8928){_0x3ff5bd[_0x4f40('0x53')]['AccountId']=_0x3f8928['id'];_0x3ff5bd[_0x4f40('0x53')][_0x4f40('0x5c')]=integrations[_0x4f40('0x5d')](_0x3ff5bd[_0x4f40('0x53')][_0x4f40('0x5e')],_0x3ff5bd['body'][_0x4f40('0x47')]);_0x3ff5bd[_0x4f40('0x53')][_0x4f40('0x5f')]=integrations[_0x4f40('0x60')](_0x3ff5bd['body'][_0x4f40('0x5e')],_0x3ff5bd[_0x4f40('0x53')][_0x4f40('0x47')]);return db[_0x4f40('0x58')][_0x4f40('0x52')](_0x3ff5bd[_0x4f40('0x53')],{'include':[{'model':db[_0x4f40('0x61')],'as':_0x4f40('0x5c')},{'model':db['SalesforceField'],'as':_0x4f40('0x5f')}]});}return null;})['then'](respondWithResult(_0x6c87a4,null))['catch'](handleError(_0x6c87a4,null));};exports[_0x4f40('0x62')]=function(_0x2a182e,_0x4a73cc,_0x24d377){var _0x594e9f;var _0x51c1f5='';var _0x4b4694=_0x4f40('0x63');return db[_0x4f40('0x4a')]['findOne']({'where':{'id':_0x2a182e['params']['id']},'attributes':['id',_0x4f40('0x64'),_0x4f40('0x65'),_0x4f40('0x66'),_0x4f40('0x67'),_0x4f40('0x68'),_0x4f40('0x69')]})['then'](handleEntityNotFound(_0x4a73cc,null))[_0x4f40('0x1f')](function(_0x1801d0){if(_0x1801d0){_0x51c1f5=_0x1801d0[_0x4f40('0x64')];var _0x1e2279=_0x51c1f5[_0x4f40('0x6a')](-0x1);if(_0x1e2279==='/'){_0x51c1f5=_0x51c1f5[_0x4f40('0x6b')](0x0,_0x51c1f5['lastIndexOf'](_0x1e2279));}_0x594e9f=new jsforce[(_0x4f40('0x6c'))]({'oauth2':{'loginUrl':_0x51c1f5,'clientId':_0x1801d0[_0x4f40('0x65')],'clientSecret':_0x1801d0[_0x4f40('0x66')]}});return _0x594e9f[_0x4f40('0x6d')](_0x1801d0[_0x4f40('0x67')],_0x1801d0[_0x4f40('0x68')][_0x4f40('0x6e')](_0x1801d0['securityToken']));}})[_0x4f40('0x1f')](function(_0x3239ae){if(_0x3239ae){if(!_[_0x4f40('0x6f')](_0x2a182e['query'][_0x4f40('0x70')])){_0x4b4694=_0x2a182e[_0x4f40('0x3b')]['ticketType'];}return _0x594e9f['sobject'](_0x4b4694)[_0x4f40('0x71')]();}})['then'](function(_0x459564){var _0xf979d1=['CallDisposition','CallDurationInSeconds',_0x4f40('0x72'),'CallType',_0x4f40('0x73'),_0x4f40('0x74'),_0x4f40('0x75'),_0x4f40('0x76')];if(!_[_0x4f40('0x6f')](_0x2a182e[_0x4f40('0x3b')][_0x4f40('0x70')])&&_0x2a182e['query'][_0x4f40('0x70')]===_0x4f40('0x77')){_0xf979d1=[_0x4f40('0x76'),_0x4f40('0x78'),_0x4f40('0x79'),_0x4f40('0x75'),_0x4f40('0x74'),_0x4f40('0x7a'),_0x4f40('0x7b'),_0x4f40('0x7c')];}if(_0x459564){_[_0x4f40('0x7d')](_0x459564[_0x4f40('0x4f')],function(_0x424fb6){return _0x424fb6[_0x4f40('0x7e')]===![]&&!_0xf979d1[_0x4f40('0x7f')](_0x424fb6['name']);});return{'count':_0x459564[_0x4f40('0x4f')]['length'],'rows':_[_0x4f40('0x38')](_0x459564[_0x4f40('0x4f')],function(_0xb77add){return{'id':_0xb77add[_0x4f40('0x35')],'name':_0xb77add[_0x4f40('0x80')],'custom':_0xb77add['custom'],'options':_0xb77add[_0x4f40('0x81')][_0x4f40('0x3f')]>0x0?_['map'](_0xb77add[_0x4f40('0x81')],function(_0x6e8106){return{'name':_0x6e8106[_0x4f40('0x80')],'value':_0x6e8106[_0x4f40('0x82')]};}):_0xb77add[_0x4f40('0x47')]==_0x4f40('0x83')?[{'name':_0x4f40('0x84'),'value':_0x4f40('0x85')},{'name':_0x4f40('0x86'),'value':_0x4f40('0x87')}]:[]};})};}})[_0x4f40('0x1f')](respondWithResult(_0x4a73cc,null))[_0x4f40('0x27')](function(_0x1e96da){var _0x2a2759=_0x2a182e[_0x4f40('0x3b')][_0x4f40('0x1a')]?0x1f4:_0x1e96da['statusCode']||0x1f4;logger[_0x4f40('0x21')](_0x4f40('0x88'),_0x4f40('0x62'),_0x2a2759,JSON[_0x4f40('0x89')](_0x1e96da));delete _0x1e96da[_0x4f40('0x35')];if(_0x2a2759===0x191){_0x2a2759=0x190;}_0x4a73cc['status'](_0x2a2759)[_0x4f40('0x36')](_0x2a182e['query'][_0x4f40('0x1a')]?{'message':_0x4f40('0x8a'),'statusCode':_0x1e96da[_0x4f40('0x8b')]}:_0x1e96da);});};
\ No newline at end of file
diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.model.js b/server/api/intSalesforceAccount/intSalesforceAccount.model.js
index f31ae58..df23125 100644
--- a/server/api/intSalesforceAccount/intSalesforceAccount.model.js
+++ b/server/api/intSalesforceAccount/intSalesforceAccount.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9bf1=['../../config/environment','./intSalesforceAccount.attributes','../../components/integrations/configuration','exports','SalesforceAccount','int_salesforce_accounts','util','../../config/logger','api','moment','request-promise','path','rimraf'];(function(_0x3c6b7d,_0x5f0d90){var _0x1d3ed2=function(_0x1a8f35){while(--_0x1a8f35){_0x3c6b7d['push'](_0x3c6b7d['shift']());}};_0x1d3ed2(++_0x5f0d90);}(_0x9bf1,0x1da));var _0x19bf=function(_0x18cd5b,_0x10240b){_0x18cd5b=_0x18cd5b-0x0;var _0x5eaa52=_0x9bf1[_0x18cd5b];return _0x5eaa52;};'use strict';var _=require('lodash');var util=require(_0x19bf('0x0'));var logger=require(_0x19bf('0x1'))(_0x19bf('0x2'));var moment=require(_0x19bf('0x3'));var BPromise=require('bluebird');var rp=require(_0x19bf('0x4'));var fs=require('fs');var path=require(_0x19bf('0x5'));var rimraf=require(_0x19bf('0x6'));var config=require(_0x19bf('0x7'));var attributes=require(_0x19bf('0x8'));var integrations=require(_0x19bf('0x9'));module[_0x19bf('0xa')]=function(_0x5bff5b,_0x500e4a){return _0x5bff5b['define'](_0x19bf('0xb'),attributes,{'tableName':_0x19bf('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xdff7=['api','bluebird','request-promise','path','../../config/environment','./intSalesforceAccount.attributes','../../components/integrations/configuration','exports','define','int_salesforce_accounts','util','../../config/logger'];(function(_0x4dce6a,_0x395a1e){var _0x2018cf=function(_0x4e0364){while(--_0x4e0364){_0x4dce6a['push'](_0x4dce6a['shift']());}};_0x2018cf(++_0x395a1e);}(_0xdff7,0x166));var _0x7dff=function(_0x1d11f3,_0x185790){_0x1d11f3=_0x1d11f3-0x0;var _0x5223ee=_0xdff7[_0x1d11f3];return _0x5223ee;};'use strict';var _=require('lodash');var util=require(_0x7dff('0x0'));var logger=require(_0x7dff('0x1'))(_0x7dff('0x2'));var moment=require('moment');var BPromise=require(_0x7dff('0x3'));var rp=require(_0x7dff('0x4'));var fs=require('fs');var path=require(_0x7dff('0x5'));var rimraf=require('rimraf');var config=require(_0x7dff('0x6'));var attributes=require(_0x7dff('0x7'));var integrations=require(_0x7dff('0x8'));module[_0x7dff('0x9')]=function(_0x541187,_0x591ff7){return _0x541187[_0x7dff('0xa')]('SalesforceAccount',attributes,{'tableName':_0x7dff('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.rpc.js b/server/api/intSalesforceAccount/intSalesforceAccount.rpc.js
index ddeb4de..bbfadb7 100644
--- a/server/api/intSalesforceAccount/intSalesforceAccount.rpc.js
+++ b/server/api/intSalesforceAccount/intSalesforceAccount.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9aea=['attributes','limit','include','map','model','GetSalesforceAccount','stringify','catch','ShowSalesforceAccount','find','raw','lodash','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','SalesforceAccount,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','SalesforceAccount','findAll','options','where'];(function(_0x3b3a82,_0x53b5e0){var _0x267063=function(_0x5aaf3d){while(--_0x5aaf3d){_0x3b3a82['push'](_0x3b3a82['shift']());}};_0x267063(++_0x53b5e0);}(_0x9aea,0xdd));var _0xa9ae=function(_0x215dda,_0x517862){_0x215dda=_0x215dda-0x0;var _0x24104f=_0x9aea[_0x215dda];return _0x24104f;};'use strict';var _=require(_0xa9ae('0x0'));var util=require('util');var moment=require(_0xa9ae('0x1'));var BPromise=require('bluebird');var rs=require(_0xa9ae('0x2'));var fs=require('fs');var Redis=require(_0xa9ae('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xa9ae('0x4'));var logger=require(_0xa9ae('0x5'))(_0xa9ae('0x6'));var config=require(_0xa9ae('0x7'));var jayson=require(_0xa9ae('0x8'));var client=jayson['client'][_0xa9ae('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x22734b,_0x1e57c4,_0x53e52c){return new BPromise(function(_0x1f2e4b,_0x3917f0){return client[_0xa9ae('0xa')](_0x22734b,_0x53e52c)[_0xa9ae('0xb')](function(_0x1882dc){logger[_0xa9ae('0xc')](_0xa9ae('0xd'),_0x1e57c4,_0xa9ae('0xe'));logger[_0xa9ae('0xf')]('SalesforceAccount,\x20%s,\x20%s,\x20%s',_0x1e57c4,_0xa9ae('0xe'),JSON['stringify'](_0x1882dc));if(_0x1882dc[_0xa9ae('0x10')]){if(_0x1882dc[_0xa9ae('0x10')][_0xa9ae('0x11')]===0x1f4){logger[_0xa9ae('0x10')](_0xa9ae('0xd'),_0x1e57c4,_0x1882dc[_0xa9ae('0x10')][_0xa9ae('0x12')]);return _0x3917f0(_0x1882dc[_0xa9ae('0x10')]['message']);}logger[_0xa9ae('0x10')](_0xa9ae('0xd'),_0x1e57c4,_0x1882dc[_0xa9ae('0x10')][_0xa9ae('0x12')]);return _0x1f2e4b(_0x1882dc['error'][_0xa9ae('0x12')]);}else{logger[_0xa9ae('0xc')](_0xa9ae('0xd'),_0x1e57c4,_0xa9ae('0xe'));_0x1f2e4b(_0x1882dc[_0xa9ae('0x13')][_0xa9ae('0x12')]);}})['catch'](function(_0x3e4810){logger[_0xa9ae('0x10')](_0xa9ae('0xd'),_0x1e57c4,_0x3e4810);_0x3917f0(_0x3e4810);});});}exports['GetSalesforceAccount']=function(_0x4dbb30){var _0xb078d2=this;return new Promise(function(_0x581345,_0x59e7dd){return db[_0xa9ae('0x14')][_0xa9ae('0x15')]({'raw':_0x4dbb30[_0xa9ae('0x16')]?_0x4dbb30[_0xa9ae('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x4dbb30[_0xa9ae('0x16')]?_0x4dbb30[_0xa9ae('0x16')][_0xa9ae('0x17')]||null:null,'attributes':_0x4dbb30[_0xa9ae('0x16')]?_0x4dbb30[_0xa9ae('0x16')][_0xa9ae('0x18')]||null:null,'limit':_0x4dbb30[_0xa9ae('0x16')]?_0x4dbb30['options'][_0xa9ae('0x19')]||null:null,'include':_0x4dbb30['options']?_0x4dbb30['options']['include']?_['map'](_0x4dbb30[_0xa9ae('0x16')]['include'],function(_0x13fb05){return{'model':db[_0x13fb05['model']],'as':_0x13fb05['as'],'attributes':_0x13fb05[_0xa9ae('0x18')],'include':_0x13fb05[_0xa9ae('0x1a')]?_[_0xa9ae('0x1b')](_0x13fb05[_0xa9ae('0x1a')],function(_0x12b061){return{'model':db[_0x12b061[_0xa9ae('0x1c')]],'as':_0x12b061['as'],'attributes':_0x12b061[_0xa9ae('0x18')],'include':_0x12b061['include']?_[_0xa9ae('0x1b')](_0x12b061[_0xa9ae('0x1a')],function(_0x2aac9e){return{'model':db[_0x2aac9e[_0xa9ae('0x1c')]],'as':_0x2aac9e['as'],'attributes':_0x2aac9e[_0xa9ae('0x18')]};}):[]};}):[]};}):[]:[]})[_0xa9ae('0xb')](function(_0xb12fa8){logger['info']('GetSalesforceAccount',_0x4dbb30);logger[_0xa9ae('0xf')](_0xa9ae('0x1d'),_0x4dbb30,JSON[_0xa9ae('0x1e')](_0xb12fa8));_0x581345(_0xb12fa8);})[_0xa9ae('0x1f')](function(_0x74cd94){logger['error']('GetSalesforceAccount',_0x74cd94[_0xa9ae('0x12')],_0x4dbb30);_0x59e7dd(_0xb078d2[_0xa9ae('0x10')](0x1f4,_0x74cd94[_0xa9ae('0x12')]));});});};exports[_0xa9ae('0x20')]=function(_0x314969){var _0x36bc28=this;return new Promise(function(_0x5d0c84,_0x5415f1){return db[_0xa9ae('0x14')][_0xa9ae('0x21')]({'raw':_0x314969[_0xa9ae('0x16')]?_0x314969[_0xa9ae('0x16')][_0xa9ae('0x22')]===undefined?!![]:![]:!![],'where':_0x314969[_0xa9ae('0x16')]?_0x314969[_0xa9ae('0x16')][_0xa9ae('0x17')]||null:null,'attributes':_0x314969['options']?_0x314969[_0xa9ae('0x16')]['attributes']||null:null,'include':_0x314969[_0xa9ae('0x16')]?_0x314969[_0xa9ae('0x16')][_0xa9ae('0x1a')]?_['map'](_0x314969[_0xa9ae('0x16')][_0xa9ae('0x1a')],function(_0x383511){return{'model':db[_0x383511[_0xa9ae('0x1c')]],'as':_0x383511['as'],'attributes':_0x383511[_0xa9ae('0x18')],'include':_0x383511['include']?_[_0xa9ae('0x1b')](_0x383511[_0xa9ae('0x1a')],function(_0x44053a){return{'model':db[_0x44053a['model']],'as':_0x44053a['as'],'attributes':_0x44053a['attributes'],'include':_0x44053a[_0xa9ae('0x1a')]?_[_0xa9ae('0x1b')](_0x44053a[_0xa9ae('0x1a')],function(_0x1a01a4){return{'model':db[_0x1a01a4['model']],'as':_0x1a01a4['as'],'attributes':_0x1a01a4[_0xa9ae('0x18')]};}):[]};}):[]};}):[]:[]})[_0xa9ae('0xb')](function(_0x231192){logger[_0xa9ae('0xc')](_0xa9ae('0x20'),_0x314969);logger['debug'](_0xa9ae('0x20'),_0x314969,JSON['stringify'](_0x231192));_0x5d0c84(_0x231192);})[_0xa9ae('0x1f')](function(_0x38f360){logger[_0xa9ae('0x10')]('ShowSalesforceAccount',_0x38f360[_0xa9ae('0x12')],_0x314969);_0x5415f1(_0x36bc28[_0xa9ae('0x10')](0x1f4,_0x38f360[_0xa9ae('0x12')]));});});};
\ No newline at end of file
+var _0x6f7a=['then','info','debug','SalesforceAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','SalesforceAccount,\x20%s,\x20%s','message','request\x20sent','result','catch','SalesforceAccount','options','raw','where','attributes','include','model','map','GetSalesforceAccount','ShowSalesforceAccount','find','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request'];(function(_0x56f9f8,_0x28498e){var _0x9728f3=function(_0x4c9295){while(--_0x4c9295){_0x56f9f8['push'](_0x56f9f8['shift']());}};_0x9728f3(++_0x28498e);}(_0x6f7a,0x1ae));var _0xa6f7=function(_0x255179,_0x461bd3){_0x255179=_0x255179-0x0;var _0x5999a2=_0x6f7a[_0x255179];return _0x5999a2;};'use strict';var _=require(_0xa6f7('0x0'));var util=require(_0xa6f7('0x1'));var moment=require(_0xa6f7('0x2'));var BPromise=require(_0xa6f7('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa6f7('0x4'));var db=require(_0xa6f7('0x5'))['db'];var utils=require(_0xa6f7('0x6'));var logger=require(_0xa6f7('0x7'))(_0xa6f7('0x8'));var config=require(_0xa6f7('0x9'));var jayson=require(_0xa6f7('0xa'));var client=jayson[_0xa6f7('0xb')][_0xa6f7('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x335aaa,_0x1a06d1,_0x481a8c){return new BPromise(function(_0x4b4f9e,_0x30f2a7){return client[_0xa6f7('0xd')](_0x335aaa,_0x481a8c)[_0xa6f7('0xe')](function(_0x362404){logger[_0xa6f7('0xf')]('SalesforceAccount,\x20%s,\x20%s',_0x1a06d1,'request\x20sent');logger[_0xa6f7('0x10')](_0xa6f7('0x11'),_0x1a06d1,'request\x20sent',JSON[_0xa6f7('0x12')](_0x362404));if(_0x362404['error']){if(_0x362404[_0xa6f7('0x13')][_0xa6f7('0x14')]===0x1f4){logger[_0xa6f7('0x13')](_0xa6f7('0x15'),_0x1a06d1,_0x362404['error'][_0xa6f7('0x16')]);return _0x30f2a7(_0x362404['error'][_0xa6f7('0x16')]);}logger[_0xa6f7('0x13')](_0xa6f7('0x15'),_0x1a06d1,_0x362404['error'][_0xa6f7('0x16')]);return _0x4b4f9e(_0x362404['error'][_0xa6f7('0x16')]);}else{logger['info'](_0xa6f7('0x15'),_0x1a06d1,_0xa6f7('0x17'));_0x4b4f9e(_0x362404[_0xa6f7('0x18')]['message']);}})[_0xa6f7('0x19')](function(_0x22635e){logger[_0xa6f7('0x13')](_0xa6f7('0x15'),_0x1a06d1,_0x22635e);_0x30f2a7(_0x22635e);});});}exports['GetSalesforceAccount']=function(_0x4a8827){var _0xba7755=this;return new Promise(function(_0x5298ba,_0x378967){return db[_0xa6f7('0x1a')]['findAll']({'raw':_0x4a8827[_0xa6f7('0x1b')]?_0x4a8827[_0xa6f7('0x1b')][_0xa6f7('0x1c')]===undefined?!![]:![]:!![],'where':_0x4a8827[_0xa6f7('0x1b')]?_0x4a8827[_0xa6f7('0x1b')][_0xa6f7('0x1d')]||null:null,'attributes':_0x4a8827['options']?_0x4a8827[_0xa6f7('0x1b')][_0xa6f7('0x1e')]||null:null,'limit':_0x4a8827['options']?_0x4a8827['options']['limit']||null:null,'include':_0x4a8827[_0xa6f7('0x1b')]?_0x4a8827[_0xa6f7('0x1b')]['include']?_['map'](_0x4a8827['options'][_0xa6f7('0x1f')],function(_0xc77e8e){return{'model':db[_0xc77e8e[_0xa6f7('0x20')]],'as':_0xc77e8e['as'],'attributes':_0xc77e8e['attributes'],'include':_0xc77e8e['include']?_[_0xa6f7('0x21')](_0xc77e8e['include'],function(_0x47ef97){return{'model':db[_0x47ef97[_0xa6f7('0x20')]],'as':_0x47ef97['as'],'attributes':_0x47ef97['attributes'],'include':_0x47ef97[_0xa6f7('0x1f')]?_[_0xa6f7('0x21')](_0x47ef97[_0xa6f7('0x1f')],function(_0x2b4c6c){return{'model':db[_0x2b4c6c[_0xa6f7('0x20')]],'as':_0x2b4c6c['as'],'attributes':_0x2b4c6c['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x1c419b){logger[_0xa6f7('0xf')]('GetSalesforceAccount',_0x4a8827);logger[_0xa6f7('0x10')](_0xa6f7('0x22'),_0x4a8827,JSON[_0xa6f7('0x12')](_0x1c419b));_0x5298ba(_0x1c419b);})[_0xa6f7('0x19')](function(_0x224f5a){logger[_0xa6f7('0x13')](_0xa6f7('0x22'),_0x224f5a[_0xa6f7('0x16')],_0x4a8827);_0x378967(_0xba7755[_0xa6f7('0x13')](0x1f4,_0x224f5a[_0xa6f7('0x16')]));});});};exports[_0xa6f7('0x23')]=function(_0x278bad){var _0x52f9c1=this;return new Promise(function(_0x442ccf,_0x42dc49){return db['SalesforceAccount'][_0xa6f7('0x24')]({'raw':_0x278bad[_0xa6f7('0x1b')]?_0x278bad['options']['raw']===undefined?!![]:![]:!![],'where':_0x278bad[_0xa6f7('0x1b')]?_0x278bad[_0xa6f7('0x1b')][_0xa6f7('0x1d')]||null:null,'attributes':_0x278bad[_0xa6f7('0x1b')]?_0x278bad[_0xa6f7('0x1b')]['attributes']||null:null,'include':_0x278bad['options']?_0x278bad[_0xa6f7('0x1b')]['include']?_[_0xa6f7('0x21')](_0x278bad[_0xa6f7('0x1b')][_0xa6f7('0x1f')],function(_0x237e5d){return{'model':db[_0x237e5d[_0xa6f7('0x20')]],'as':_0x237e5d['as'],'attributes':_0x237e5d[_0xa6f7('0x1e')],'include':_0x237e5d['include']?_[_0xa6f7('0x21')](_0x237e5d[_0xa6f7('0x1f')],function(_0x1a5de5){return{'model':db[_0x1a5de5['model']],'as':_0x1a5de5['as'],'attributes':_0x1a5de5[_0xa6f7('0x1e')],'include':_0x1a5de5['include']?_[_0xa6f7('0x21')](_0x1a5de5[_0xa6f7('0x1f')],function(_0x45837c){return{'model':db[_0x45837c['model']],'as':_0x45837c['as'],'attributes':_0x45837c[_0xa6f7('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xa6f7('0xe')](function(_0x3b3bc2){logger[_0xa6f7('0xf')](_0xa6f7('0x23'),_0x278bad);logger[_0xa6f7('0x10')]('ShowSalesforceAccount',_0x278bad,JSON[_0xa6f7('0x12')](_0x3b3bc2));_0x442ccf(_0x3b3bc2);})[_0xa6f7('0x19')](function(_0xc25a1b){logger[_0xa6f7('0x13')](_0xa6f7('0x23'),_0xc25a1b[_0xa6f7('0x16')],_0x278bad);_0x42dc49(_0x52f9c1[_0xa6f7('0x13')](0x1f4,_0xc25a1b[_0xa6f7('0x16')]));});});};
\ No newline at end of file
diff --git a/server/api/intSalesforceConfiguration/index.js b/server/api/intSalesforceConfiguration/index.js
index 81c271c..8ef5aa1 100644
--- a/server/api/intSalesforceConfiguration/index.js
+++ b/server/api/intSalesforceConfiguration/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xd9f4=['../../components/interaction/service','../../config/environment','isAuthenticated','index','get','getFields','/:id/subjects','/:id/descriptions','getDescriptions','post','create','put','/:id','update','destroy','exports','multer','util','connect-timeout','express'];(function(_0x26e949,_0x38ed2c){var _0x44daf6=function(_0x5b2496){while(--_0x5b2496){_0x26e949['push'](_0x26e949['shift']());}};_0x44daf6(++_0x38ed2c);}(_0xd9f4,0x1f0));var _0x4d9f=function(_0x33032e,_0x31411a){_0x33032e=_0x33032e-0x0;var _0x13316b=_0xd9f4[_0x33032e];return _0x13316b;};'use strict';var multer=require(_0x4d9f('0x0'));var util=require(_0x4d9f('0x1'));var path=require('path');var timeout=require(_0x4d9f('0x2'));var express=require(_0x4d9f('0x3'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x4d9f('0x4'));var config=require(_0x4d9f('0x5'));var controller=require('./intSalesforceConfiguration.controller');router['get']('/',auth[_0x4d9f('0x6')](),controller[_0x4d9f('0x7')]);router[_0x4d9f('0x8')]('/:id',auth[_0x4d9f('0x6')](),controller['show']);router[_0x4d9f('0x8')]('/:id/fields',auth[_0x4d9f('0x6')](),controller[_0x4d9f('0x9')]);router[_0x4d9f('0x8')](_0x4d9f('0xa'),auth[_0x4d9f('0x6')](),controller['getSubjects']);router['get'](_0x4d9f('0xb'),auth[_0x4d9f('0x6')](),controller[_0x4d9f('0xc')]);router[_0x4d9f('0xd')]('/',auth['isAuthenticated'](),controller[_0x4d9f('0xe')]);router[_0x4d9f('0xf')](_0x4d9f('0x10'),auth[_0x4d9f('0x6')](),controller[_0x4d9f('0x11')]);router['delete'](_0x4d9f('0x10'),auth['isAuthenticated'](),controller[_0x4d9f('0x12')]);module[_0x4d9f('0x13')]=router;
\ No newline at end of file
+var _0x16da=['get','/:id/fields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','create','put','delete','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','./intSalesforceConfiguration.controller','isAuthenticated','/:id','show'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x16da,0x13f));var _0xa16d=function(_0x74638e,_0x223f84){_0x74638e=_0x74638e-0x0;var _0x2f3f27=_0x16da[_0x74638e];return _0x2f3f27;};'use strict';var multer=require(_0xa16d('0x0'));var util=require(_0xa16d('0x1'));var path=require(_0xa16d('0x2'));var timeout=require('connect-timeout');var express=require(_0xa16d('0x3'));var router=express[_0xa16d('0x4')]();var auth=require(_0xa16d('0x5'));var interaction=require(_0xa16d('0x6'));var config=require('../../config/environment');var controller=require(_0xa16d('0x7'));router['get']('/',auth[_0xa16d('0x8')](),controller['index']);router['get'](_0xa16d('0x9'),auth[_0xa16d('0x8')](),controller[_0xa16d('0xa')]);router[_0xa16d('0xb')](_0xa16d('0xc'),auth[_0xa16d('0x8')](),controller['getFields']);router[_0xa16d('0xb')](_0xa16d('0xd'),auth[_0xa16d('0x8')](),controller[_0xa16d('0xe')]);router['get'](_0xa16d('0xf'),auth[_0xa16d('0x8')](),controller[_0xa16d('0x10')]);router[_0xa16d('0x11')]('/',auth[_0xa16d('0x8')](),controller[_0xa16d('0x12')]);router[_0xa16d('0x13')](_0xa16d('0x9'),auth[_0xa16d('0x8')](),controller['update']);router[_0xa16d('0x14')](_0xa16d('0x9'),auth[_0xa16d('0x8')](),controller['destroy']);module[_0xa16d('0x15')]=router;
\ No newline at end of file
diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js
index f7e1588..68b7db2 100644
--- a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js
+++ b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xb864=['contact','lead','sequelize','exports','STRING','ENUM','Task','Case','contact_lead'];(function(_0x2a4a83,_0x187c51){var _0x44a2b0=function(_0x3df495){while(--_0x3df495){_0x2a4a83['push'](_0x2a4a83['shift']());}};_0x44a2b0(++_0x187c51);}(_0xb864,0x1df));var _0x4b86=function(_0x53af11,_0x1f7f88){_0x53af11=_0x53af11-0x0;var _0x32a0fd=_0xb864[_0x53af11];return _0x32a0fd;};'use strict';var Sequelize=require(_0x4b86('0x0'));module[_0x4b86('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x4b86('0x2')]},'ticketType':{'type':Sequelize[_0x4b86('0x3')](_0x4b86('0x4'),_0x4b86('0x5')),'defaultValue':'Task'},'moduleSearch':{'type':Sequelize['ENUM'](_0x4b86('0x6'),_0x4b86('0x7'),_0x4b86('0x8')),'defaultValue':_0x4b86('0x6')},'moduleCreate':{'type':Sequelize[_0x4b86('0x3')]('nothing',_0x4b86('0x7'),_0x4b86('0x8')),'defaultValue':'lead'}};
\ No newline at end of file
+var _0x819c=['exports','STRING','ENUM','Task','Case','contact','lead','contact_lead','sequelize'];(function(_0x38e4e7,_0x49fe18){var _0x5a0efd=function(_0x28304c){while(--_0x28304c){_0x38e4e7['push'](_0x38e4e7['shift']());}};_0x5a0efd(++_0x49fe18);}(_0x819c,0x182));var _0xc819=function(_0x4523f7,_0x5d13a1){_0x4523f7=_0x4523f7-0x0;var _0x43f8f8=_0x819c[_0x4523f7];return _0x43f8f8;};'use strict';var Sequelize=require(_0xc819('0x0'));module[_0xc819('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xc819('0x2')]},'ticketType':{'type':Sequelize[_0xc819('0x3')](_0xc819('0x4'),_0xc819('0x5')),'defaultValue':_0xc819('0x4')},'moduleSearch':{'type':Sequelize[_0xc819('0x3')]('contact_lead',_0xc819('0x6'),_0xc819('0x7')),'defaultValue':_0xc819('0x8')},'moduleCreate':{'type':Sequelize[_0xc819('0x3')]('nothing','contact',_0xc819('0x7')),'defaultValue':_0xc819('0x7')}};
\ No newline at end of file
diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js
index be57fa7..39811af 100644
--- a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js
+++ b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xab05=['limit','set','apply','reject','save','update','then','destroy','stack','name','send','index','map','SalesforceConfiguration','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','findAll','rows','show','keys','length','includeAll','include','find','create','body','getFields','findOne','params','SalesforceField','getSubjects','getDescriptions','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../mysqldb','jayson/promise','client','http','Sequelize','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','SalesforceConfiguration,\x20%s,\x20%s','request\x20sent','debug','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','stringify','code','error','message','info','catch','sendStatus','status','end','json','count','offset'];(function(_0xcb1264,_0x547aee){var _0x255c60=function(_0x1eaa0f){while(--_0x1eaa0f){_0xcb1264['push'](_0xcb1264['shift']());}};_0x255c60(++_0x547aee);}(_0xab05,0x1b6));var _0x5ab0=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0xab05[_0xbca1b1];return _0x4e1686;};'use strict';var pdf=require(_0x5ab0('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x5ab0('0x1'));var zipdir=require(_0x5ab0('0x2'));var jsonpatch=require(_0x5ab0('0x3'));var rp=require(_0x5ab0('0x4'));var moment=require(_0x5ab0('0x5'));var BPromise=require(_0x5ab0('0x6'));var Mustache=require(_0x5ab0('0x7'));var util=require(_0x5ab0('0x8'));var path=require(_0x5ab0('0x9'));var sox=require(_0x5ab0('0xa'));var csv=require(_0x5ab0('0xb'));var ejs=require(_0x5ab0('0xc'));var fs=require('fs');var _=require(_0x5ab0('0xd'));var squel=require(_0x5ab0('0xe'));var crypto=require(_0x5ab0('0xf'));var jsforce=require(_0x5ab0('0x10'));var deskjs=require(_0x5ab0('0x11'));var toCsv=require(_0x5ab0('0xb'));var querystring=require(_0x5ab0('0x12'));var Papa=require(_0x5ab0('0x13'));var Redis=require('ioredis');var authService=require(_0x5ab0('0x14'));var qs=require(_0x5ab0('0x15'));var as=require(_0x5ab0('0x16'));var hardwareService=require(_0x5ab0('0x17'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x5ab0('0x18'))['db'];var jayson=require(_0x5ab0('0x19'));var client=jayson[_0x5ab0('0x1a')][_0x5ab0('0x1b')]({'port':0x232a});function checkPasswordPattern(_0x3ec77f,_0x28fa42,_0x2b0cb2){if(_0x2b0cb2){var _0x4c80c9=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x4c80c9['test'](_0x28fa42)){return _0x3ec77f;}else{throw new db[(_0x5ab0('0x1c'))]['ValidationError'](_0x5ab0('0x1d'));}}else{return _0x3ec77f;}}function respondWithRpcPromise(_0x3a210c,_0x55b0b5,_0x42e500,_0x2a382d){return new BPromise(function(_0x475b82,_0x54a1fc){var _0xbc3efa=_0x2a382d||client;return _0xbc3efa[_0x5ab0('0x1e')](_0x3a210c,_0x42e500)['then'](function(_0x5a8a18){logger['info'](_0x5ab0('0x1f'),_0x55b0b5,_0x5ab0('0x20'));logger[_0x5ab0('0x21')](_0x5ab0('0x22'),_0x55b0b5,_0x5ab0('0x20'),JSON[_0x5ab0('0x23')](_0x5a8a18));if(_0x5a8a18['error']){if(_0x5a8a18['error'][_0x5ab0('0x24')]===0x1f4){logger['error'](_0x5ab0('0x1f'),_0x55b0b5,_0x5a8a18[_0x5ab0('0x25')][_0x5ab0('0x26')]);return _0x54a1fc(_0x5a8a18['error'][_0x5ab0('0x26')]);}logger[_0x5ab0('0x25')](_0x5ab0('0x1f'),_0x55b0b5,_0x5a8a18[_0x5ab0('0x25')][_0x5ab0('0x26')]);return _0x475b82(_0x5a8a18[_0x5ab0('0x25')][_0x5ab0('0x26')]);}else{logger[_0x5ab0('0x27')]('SalesforceConfiguration,\x20%s,\x20%s',_0x55b0b5,_0x5ab0('0x20'));_0x475b82(_0x5a8a18['result']['message']);}})[_0x5ab0('0x28')](function(_0x4081e1){logger['error'](_0x5ab0('0x1f'),_0x55b0b5,_0x4081e1);_0x54a1fc(_0x4081e1);});});}function respondWithStatusCode(_0x414f52,_0x1c7364){_0x1c7364=_0x1c7364||0xcc;return function(_0x284883){if(_0x284883){return _0x414f52[_0x5ab0('0x29')](_0x1c7364);}return _0x414f52[_0x5ab0('0x2a')](_0x1c7364)[_0x5ab0('0x2b')]();};}function respondWithResult(_0x441272,_0x5e0b03){_0x5e0b03=_0x5e0b03||0xc8;return function(_0x29b146){if(_0x29b146){return _0x441272[_0x5ab0('0x2a')](_0x5e0b03)[_0x5ab0('0x2c')](_0x29b146);}};}function respondWithFilteredResult(_0x94fa1,_0x39d000){return function(_0xc18a0d){if(_0xc18a0d){var _0x498a1d=_0xc18a0d[_0x5ab0('0x2d')],_0x44926c=_0x39d000[_0x5ab0('0x2e')],_0x4985be=_0x39d000[_0x5ab0('0x2e')]+_0x39d000[_0x5ab0('0x2f')],_0x19221f;if(_0x4985be>=_0x498a1d){_0x4985be=_0x498a1d;_0x19221f=0xc8;}else{_0x19221f=0xce;}_0x94fa1[_0x5ab0('0x2a')](_0x19221f);return _0x94fa1[_0x5ab0('0x30')]('Content-Range',_0x44926c+'-'+_0x4985be+'/'+_0x498a1d)[_0x5ab0('0x2c')](_0xc18a0d);}return null;};}function patchUpdates(_0x35e0c2){return function(_0x2df1a5){try{jsonpatch[_0x5ab0('0x31')](_0x2df1a5,_0x35e0c2,!![]);}catch(_0x59929d){return BPromise[_0x5ab0('0x32')](_0x59929d);}return _0x2df1a5[_0x5ab0('0x33')]();};}function saveUpdates(_0x5e0ee4,_0x4acc05){return function(_0x36ea20){if(_0x36ea20){return _0x36ea20[_0x5ab0('0x34')](_0x5e0ee4)[_0x5ab0('0x35')](function(_0x4c9ea3){return _0x4c9ea3;});}return null;};}function removeEntity(_0x46484b,_0x1b0c68){return function(_0x55ed25){if(_0x55ed25){return _0x55ed25[_0x5ab0('0x36')]()[_0x5ab0('0x35')](function(){_0x46484b[_0x5ab0('0x2a')](0xcc)[_0x5ab0('0x2b')]();});}};}function handleEntityNotFound(_0x273555,_0x30d55d){return function(_0x1acc58){if(!_0x1acc58){_0x273555['sendStatus'](0x194);}return _0x1acc58;};}function handleError(_0x1e23d6,_0x1b470f){_0x1b470f=_0x1b470f||0x1f4;return function(_0x252471){logger[_0x5ab0('0x25')](_0x252471[_0x5ab0('0x37')]);if(_0x252471['name']){delete _0x252471[_0x5ab0('0x38')];}_0x1e23d6['status'](_0x1b470f)[_0x5ab0('0x39')](_0x252471);};}exports[_0x5ab0('0x3a')]=function(_0x436ad4,_0x2c2610){var _0x10381f={},_0x2ba2cb={},_0x733e39={'count':0x0,'rows':[]};var _0x5ab7b4=_[_0x5ab0('0x3b')](db[_0x5ab0('0x3c')][_0x5ab0('0x3d')],function(_0x529d64){return{'name':_0x529d64[_0x5ab0('0x3e')],'type':_0x529d64[_0x5ab0('0x3f')][_0x5ab0('0x40')]};});_0x2ba2cb[_0x5ab0('0x41')]=_[_0x5ab0('0x3b')](_0x5ab7b4,_0x5ab0('0x38'));_0x2ba2cb[_0x5ab0('0x42')]=_['keys'](_0x436ad4[_0x5ab0('0x42')]);_0x2ba2cb[_0x5ab0('0x43')]=_[_0x5ab0('0x44')](_0x2ba2cb[_0x5ab0('0x41')],_0x2ba2cb['query']);_0x10381f[_0x5ab0('0x45')]=_[_0x5ab0('0x44')](_0x2ba2cb[_0x5ab0('0x41')],qs[_0x5ab0('0x46')](_0x436ad4['query'][_0x5ab0('0x46')]));_0x10381f['attributes']=_0x10381f['attributes']['length']?_0x10381f[_0x5ab0('0x45')]:_0x2ba2cb[_0x5ab0('0x41')];if(!_0x436ad4['query'][_0x5ab0('0x47')](_0x5ab0('0x48'))){_0x10381f[_0x5ab0('0x2f')]=qs[_0x5ab0('0x2f')](_0x436ad4[_0x5ab0('0x42')][_0x5ab0('0x2f')]);_0x10381f[_0x5ab0('0x2e')]=qs[_0x5ab0('0x2e')](_0x436ad4[_0x5ab0('0x42')][_0x5ab0('0x2e')]);}_0x10381f[_0x5ab0('0x49')]=qs[_0x5ab0('0x4a')](_0x436ad4[_0x5ab0('0x42')][_0x5ab0('0x4a')]);_0x10381f[_0x5ab0('0x4b')]=qs['filters'](_[_0x5ab0('0x4c')](_0x436ad4[_0x5ab0('0x42')],_0x2ba2cb[_0x5ab0('0x43')]),_0x5ab7b4);if(_0x436ad4[_0x5ab0('0x42')][_0x5ab0('0x4d')]){_0x10381f[_0x5ab0('0x4b')]=_[_0x5ab0('0x4e')](_0x10381f[_0x5ab0('0x4b')],{'$or':_['map'](_0x5ab7b4,function(_0x22a690){if(_0x22a690[_0x5ab0('0x3f')]!==_0x5ab0('0x4f')){var _0x589e56={};_0x589e56[_0x22a690[_0x5ab0('0x38')]]={'$like':'%'+_0x436ad4['query'][_0x5ab0('0x4d')]+'%'};return _0x589e56;}})});}_0x10381f=_[_0x5ab0('0x4e')]({},_0x10381f,_0x436ad4[_0x5ab0('0x50')]);var _0x7c1d3c={'where':_0x10381f['where']};return db[_0x5ab0('0x3c')]['count'](_0x7c1d3c)[_0x5ab0('0x35')](function(_0x3c5de2){_0x733e39[_0x5ab0('0x2d')]=_0x3c5de2;if(_0x436ad4[_0x5ab0('0x42')]['includeAll']){_0x10381f['include']=[{'all':!![]}];}return db[_0x5ab0('0x3c')][_0x5ab0('0x51')](_0x10381f);})[_0x5ab0('0x35')](function(_0x2dd043){_0x733e39[_0x5ab0('0x52')]=_0x2dd043;return _0x733e39;})[_0x5ab0('0x35')](respondWithFilteredResult(_0x2c2610,_0x10381f))[_0x5ab0('0x28')](handleError(_0x2c2610,null));};exports[_0x5ab0('0x53')]=function(_0xb3f1df,_0x35b8ec){var _0x4ccaac={'raw':![],'where':{'id':_0xb3f1df['params']['id']}},_0x51c78a={};_0x51c78a[_0x5ab0('0x41')]=_[_0x5ab0('0x54')](db[_0x5ab0('0x3c')][_0x5ab0('0x3d')]);_0x51c78a[_0x5ab0('0x42')]=_[_0x5ab0('0x54')](_0xb3f1df['query']);_0x51c78a[_0x5ab0('0x43')]=_['intersection'](_0x51c78a[_0x5ab0('0x41')],_0x51c78a[_0x5ab0('0x42')]);_0x4ccaac[_0x5ab0('0x45')]=_['intersection'](_0x51c78a[_0x5ab0('0x41')],qs[_0x5ab0('0x46')](_0xb3f1df[_0x5ab0('0x42')][_0x5ab0('0x46')]));_0x4ccaac[_0x5ab0('0x45')]=_0x4ccaac[_0x5ab0('0x45')][_0x5ab0('0x55')]?_0x4ccaac[_0x5ab0('0x45')]:_0x51c78a[_0x5ab0('0x41')];if(_0xb3f1df[_0x5ab0('0x42')][_0x5ab0('0x56')]){_0x4ccaac[_0x5ab0('0x57')]=[{'all':!![]}];}_0x4ccaac=_[_0x5ab0('0x4e')]({},_0x4ccaac,_0xb3f1df[_0x5ab0('0x50')]);return db[_0x5ab0('0x3c')][_0x5ab0('0x58')](_0x4ccaac)[_0x5ab0('0x35')](handleEntityNotFound(_0x35b8ec,null))[_0x5ab0('0x35')](respondWithResult(_0x35b8ec,null))['catch'](handleError(_0x35b8ec,null));};exports[_0x5ab0('0x59')]=function(_0x1d9288,_0x5ca422){return db[_0x5ab0('0x3c')]['create'](_0x1d9288[_0x5ab0('0x5a')],{})['then'](respondWithResult(_0x5ca422,0xc9))[_0x5ab0('0x28')](handleError(_0x5ca422,null));};exports[_0x5ab0('0x34')]=function(_0x3f4ad8,_0x15cd52){if(_0x3f4ad8[_0x5ab0('0x5a')]['id']){delete _0x3f4ad8[_0x5ab0('0x5a')]['id'];}return db[_0x5ab0('0x3c')][_0x5ab0('0x58')]({'where':{'id':_0x3f4ad8['params']['id']}})[_0x5ab0('0x35')](handleEntityNotFound(_0x15cd52,null))[_0x5ab0('0x35')](saveUpdates(_0x3f4ad8['body'],null))[_0x5ab0('0x35')](respondWithResult(_0x15cd52,null))[_0x5ab0('0x28')](handleError(_0x15cd52,null));};exports[_0x5ab0('0x36')]=function(_0x56f621,_0x136f41){return db[_0x5ab0('0x3c')][_0x5ab0('0x58')]({'where':{'id':_0x56f621['params']['id']}})[_0x5ab0('0x35')](handleEntityNotFound(_0x136f41,null))[_0x5ab0('0x35')](removeEntity(_0x136f41,null))[_0x5ab0('0x28')](handleError(_0x136f41,null));};exports[_0x5ab0('0x5b')]=function(_0x39cb26,_0x1ebee9,_0x5d5318){var _0x5e241f={};var _0x2f3e8b={};var _0x493840;var _0x529b97;return db[_0x5ab0('0x3c')][_0x5ab0('0x5c')]({'where':{'id':_0x39cb26[_0x5ab0('0x5d')]['id']}})['then'](handleEntityNotFound(_0x1ebee9,null))[_0x5ab0('0x35')](function(_0xc452e7){if(_0xc452e7){_0x493840=_0xc452e7;_0x2f3e8b['model']=_['keys'](db[_0x5ab0('0x5e')][_0x5ab0('0x3d')]);_0x2f3e8b['query']=_[_0x5ab0('0x54')](_0x39cb26[_0x5ab0('0x42')]);_0x2f3e8b[_0x5ab0('0x43')]=_[_0x5ab0('0x44')](_0x2f3e8b[_0x5ab0('0x41')],_0x2f3e8b[_0x5ab0('0x42')]);_0x5e241f[_0x5ab0('0x45')]=_[_0x5ab0('0x44')](_0x2f3e8b['model'],qs[_0x5ab0('0x46')](_0x39cb26[_0x5ab0('0x42')][_0x5ab0('0x46')]));_0x5e241f[_0x5ab0('0x45')]=_0x5e241f[_0x5ab0('0x45')]['length']?_0x5e241f[_0x5ab0('0x45')]:_0x2f3e8b['model'];_0x5e241f[_0x5ab0('0x49')]=qs['sort'](_0x39cb26['query'][_0x5ab0('0x4a')]);_0x5e241f[_0x5ab0('0x4b')]=qs[_0x5ab0('0x43')](_[_0x5ab0('0x4c')](_0x39cb26[_0x5ab0('0x42')],_0x2f3e8b[_0x5ab0('0x43')]));if(_0x39cb26[_0x5ab0('0x42')][_0x5ab0('0x4d')]){_0x5e241f[_0x5ab0('0x4b')]=_[_0x5ab0('0x4e')](_0x5e241f[_0x5ab0('0x4b')],{'$or':_[_0x5ab0('0x3b')](_0x5e241f[_0x5ab0('0x45')],function(_0x3e604c){var _0x3f65cb={};_0x3f65cb[_0x3e604c]={'$like':'%'+_0x39cb26['query']['filter']+'%'};return _0x3f65cb;})});}_0x5e241f=_[_0x5ab0('0x4e')]({},_0x5e241f,_0x39cb26[_0x5ab0('0x50')]);return _0x493840[_0x5ab0('0x5b')](_0x5e241f);}})['then'](function(_0x5a4eb1){if(_0x5a4eb1){_0x529b97=_0x5a4eb1[_0x5ab0('0x55')];if(!_0x39cb26[_0x5ab0('0x42')][_0x5ab0('0x47')](_0x5ab0('0x48'))){_0x5e241f[_0x5ab0('0x2f')]=qs[_0x5ab0('0x2f')](_0x39cb26[_0x5ab0('0x42')]['limit']);_0x5e241f[_0x5ab0('0x2e')]=qs['offset'](_0x39cb26['query'][_0x5ab0('0x2e')]);}return _0x493840[_0x5ab0('0x5b')](_0x5e241f);}})[_0x5ab0('0x35')](function(_0x31c9e6){if(_0x31c9e6){return _0x31c9e6?{'count':_0x529b97,'rows':_0x31c9e6}:null;}})[_0x5ab0('0x35')](respondWithResult(_0x1ebee9,null))[_0x5ab0('0x28')](handleError(_0x1ebee9,null));};exports[_0x5ab0('0x5f')]=function(_0x50974f,_0x59a937,_0x1eac56){var _0x7a9465={};var _0x4a4f79={};var _0x3f80fc;var _0x1a32ee;return db[_0x5ab0('0x3c')][_0x5ab0('0x5c')]({'where':{'id':_0x50974f[_0x5ab0('0x5d')]['id']}})['then'](handleEntityNotFound(_0x59a937,null))[_0x5ab0('0x35')](function(_0x2ae5e8){if(_0x2ae5e8){_0x3f80fc=_0x2ae5e8;_0x4a4f79[_0x5ab0('0x41')]=_[_0x5ab0('0x54')](db['SalesforceField']['rawAttributes']);_0x4a4f79['query']=_[_0x5ab0('0x54')](_0x50974f[_0x5ab0('0x42')]);_0x4a4f79['filters']=_[_0x5ab0('0x44')](_0x4a4f79[_0x5ab0('0x41')],_0x4a4f79['query']);_0x7a9465[_0x5ab0('0x45')]=_[_0x5ab0('0x44')](_0x4a4f79['model'],qs[_0x5ab0('0x46')](_0x50974f[_0x5ab0('0x42')]['fields']));_0x7a9465[_0x5ab0('0x45')]=_0x7a9465[_0x5ab0('0x45')][_0x5ab0('0x55')]?_0x7a9465[_0x5ab0('0x45')]:_0x4a4f79[_0x5ab0('0x41')];_0x7a9465[_0x5ab0('0x49')]=qs['sort'](_0x50974f[_0x5ab0('0x42')][_0x5ab0('0x4a')]);_0x7a9465[_0x5ab0('0x4b')]=qs['filters'](_[_0x5ab0('0x4c')](_0x50974f[_0x5ab0('0x42')],_0x4a4f79[_0x5ab0('0x43')]));if(_0x50974f['query'][_0x5ab0('0x4d')]){_0x7a9465['where']=_[_0x5ab0('0x4e')](_0x7a9465[_0x5ab0('0x4b')],{'$or':_[_0x5ab0('0x3b')](_0x7a9465[_0x5ab0('0x45')],function(_0x187e1e){var _0x5ea9c6={};_0x5ea9c6[_0x187e1e]={'$like':'%'+_0x50974f[_0x5ab0('0x42')]['filter']+'%'};return _0x5ea9c6;})});}_0x7a9465=_[_0x5ab0('0x4e')]({},_0x7a9465,_0x50974f[_0x5ab0('0x50')]);return _0x3f80fc['getSubjects'](_0x7a9465);}})[_0x5ab0('0x35')](function(_0x320e62){if(_0x320e62){_0x1a32ee=_0x320e62[_0x5ab0('0x55')];if(!_0x50974f['query'][_0x5ab0('0x47')](_0x5ab0('0x48'))){_0x7a9465[_0x5ab0('0x2f')]=qs[_0x5ab0('0x2f')](_0x50974f[_0x5ab0('0x42')][_0x5ab0('0x2f')]);_0x7a9465[_0x5ab0('0x2e')]=qs[_0x5ab0('0x2e')](_0x50974f[_0x5ab0('0x42')][_0x5ab0('0x2e')]);}return _0x3f80fc[_0x5ab0('0x5f')](_0x7a9465);}})['then'](function(_0x4bc135){if(_0x4bc135){return _0x4bc135?{'count':_0x1a32ee,'rows':_0x4bc135}:null;}})[_0x5ab0('0x35')](respondWithResult(_0x59a937,null))[_0x5ab0('0x28')](handleError(_0x59a937,null));};exports[_0x5ab0('0x60')]=function(_0xb1f150,_0x308200,_0x301157){var _0x3fdfca={};var _0x4c9026={};var _0x3ad009;var _0x580bfa;return db[_0x5ab0('0x3c')][_0x5ab0('0x5c')]({'where':{'id':_0xb1f150['params']['id']}})[_0x5ab0('0x35')](handleEntityNotFound(_0x308200,null))[_0x5ab0('0x35')](function(_0x545a38){if(_0x545a38){_0x3ad009=_0x545a38;_0x4c9026[_0x5ab0('0x41')]=_[_0x5ab0('0x54')](db[_0x5ab0('0x5e')][_0x5ab0('0x3d')]);_0x4c9026[_0x5ab0('0x42')]=_['keys'](_0xb1f150[_0x5ab0('0x42')]);_0x4c9026[_0x5ab0('0x43')]=_[_0x5ab0('0x44')](_0x4c9026[_0x5ab0('0x41')],_0x4c9026['query']);_0x3fdfca['attributes']=_['intersection'](_0x4c9026['model'],qs[_0x5ab0('0x46')](_0xb1f150['query'][_0x5ab0('0x46')]));_0x3fdfca['attributes']=_0x3fdfca[_0x5ab0('0x45')][_0x5ab0('0x55')]?_0x3fdfca[_0x5ab0('0x45')]:_0x4c9026[_0x5ab0('0x41')];_0x3fdfca[_0x5ab0('0x49')]=qs[_0x5ab0('0x4a')](_0xb1f150[_0x5ab0('0x42')][_0x5ab0('0x4a')]);_0x3fdfca[_0x5ab0('0x4b')]=qs[_0x5ab0('0x43')](_[_0x5ab0('0x4c')](_0xb1f150['query'],_0x4c9026['filters']));if(_0xb1f150[_0x5ab0('0x42')][_0x5ab0('0x4d')]){_0x3fdfca[_0x5ab0('0x4b')]=_[_0x5ab0('0x4e')](_0x3fdfca[_0x5ab0('0x4b')],{'$or':_[_0x5ab0('0x3b')](_0x3fdfca[_0x5ab0('0x45')],function(_0x443e96){var _0x35647c={};_0x35647c[_0x443e96]={'$like':'%'+_0xb1f150[_0x5ab0('0x42')][_0x5ab0('0x4d')]+'%'};return _0x35647c;})});}_0x3fdfca=_['merge']({},_0x3fdfca,_0xb1f150['options']);return _0x3ad009[_0x5ab0('0x60')](_0x3fdfca);}})[_0x5ab0('0x35')](function(_0xe1ba42){if(_0xe1ba42){_0x580bfa=_0xe1ba42[_0x5ab0('0x55')];if(!_0xb1f150[_0x5ab0('0x42')]['hasOwnProperty'](_0x5ab0('0x48'))){_0x3fdfca[_0x5ab0('0x2f')]=qs[_0x5ab0('0x2f')](_0xb1f150[_0x5ab0('0x42')]['limit']);_0x3fdfca[_0x5ab0('0x2e')]=qs[_0x5ab0('0x2e')](_0xb1f150[_0x5ab0('0x42')][_0x5ab0('0x2e')]);}return _0x3ad009[_0x5ab0('0x60')](_0x3fdfca);}})['then'](function(_0x30ebbe){if(_0x30ebbe){return _0x30ebbe?{'count':_0x580bfa,'rows':_0x30ebbe}:null;}})[_0x5ab0('0x35')](respondWithResult(_0x308200,null))['catch'](handleError(_0x308200,null));};
\ No newline at end of file
+var _0x319c=['stringify','error','code','message','info','result','catch','status','json','count','offset','set','Content-Range','apply','reject','save','update','destroy','end','sendStatus','stack','name','send','index','map','rawAttributes','type','model','query','keys','intersection','attributes','fields','length','nolimit','limit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','SalesforceConfiguration','find','create','body','getFields','findOne','SalesforceField','hasOwnProperty','getSubjects','getDescriptions','html-pdf','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','client','http','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','SalesforceConfiguration,\x20%s,\x20%s','request\x20sent','debug','SalesforceConfiguration,\x20%s,\x20%s,\x20%s'];(function(_0x399e3b,_0x5dd3d2){var _0x28c6a4=function(_0x7d77c1){while(--_0x7d77c1){_0x399e3b['push'](_0x399e3b['shift']());}};_0x28c6a4(++_0x5dd3d2);}(_0x319c,0x1d9));var _0xc319=function(_0x45b034,_0x3a57dd){_0x45b034=_0x45b034-0x0;var _0x509cb0=_0x319c[_0x45b034];return _0x509cb0;};'use strict';var pdf=require(_0xc319('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xc319('0x1'));var zipdir=require(_0xc319('0x2'));var jsonpatch=require(_0xc319('0x3'));var rp=require('request-promise');var moment=require(_0xc319('0x4'));var BPromise=require(_0xc319('0x5'));var Mustache=require(_0xc319('0x6'));var util=require(_0xc319('0x7'));var path=require(_0xc319('0x8'));var sox=require(_0xc319('0x9'));var csv=require(_0xc319('0xa'));var ejs=require(_0xc319('0xb'));var fs=require('fs');var _=require(_0xc319('0xc'));var squel=require(_0xc319('0xd'));var crypto=require(_0xc319('0xe'));var jsforce=require(_0xc319('0xf'));var deskjs=require(_0xc319('0x10'));var toCsv=require('to-csv');var querystring=require(_0xc319('0x11'));var Papa=require(_0xc319('0x12'));var Redis=require(_0xc319('0x13'));var authService=require(_0xc319('0x14'));var qs=require(_0xc319('0x15'));var as=require(_0xc319('0x16'));var hardwareService=require(_0xc319('0x17'));var logger=require(_0xc319('0x18'))(_0xc319('0x19'));var utils=require(_0xc319('0x1a'));var config=require(_0xc319('0x1b'));var db=require(_0xc319('0x1c'))['db'];var jayson=require(_0xc319('0x1d'));var client=jayson[_0xc319('0x1e')][_0xc319('0x1f')]({'port':0x232a});function checkPasswordPattern(_0x277741,_0x5879dc,_0x1d9439){if(_0x1d9439){var _0x33767b=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x33767b[_0xc319('0x20')](_0x5879dc)){return _0x277741;}else{throw new db[(_0xc319('0x21'))][(_0xc319('0x22'))](_0xc319('0x23'));}}else{return _0x277741;}}function respondWithRpcPromise(_0x10bae6,_0x5183c7,_0x4ff6cd,_0x431c63){return new BPromise(function(_0x5451dc,_0x5d6a94){var _0x43149a=_0x431c63||client;return _0x43149a[_0xc319('0x24')](_0x10bae6,_0x4ff6cd)[_0xc319('0x25')](function(_0x13242b){logger['info'](_0xc319('0x26'),_0x5183c7,_0xc319('0x27'));logger[_0xc319('0x28')](_0xc319('0x29'),_0x5183c7,_0xc319('0x27'),JSON[_0xc319('0x2a')](_0x13242b));if(_0x13242b['error']){if(_0x13242b[_0xc319('0x2b')][_0xc319('0x2c')]===0x1f4){logger[_0xc319('0x2b')](_0xc319('0x26'),_0x5183c7,_0x13242b[_0xc319('0x2b')][_0xc319('0x2d')]);return _0x5d6a94(_0x13242b[_0xc319('0x2b')][_0xc319('0x2d')]);}logger[_0xc319('0x2b')](_0xc319('0x26'),_0x5183c7,_0x13242b[_0xc319('0x2b')]['message']);return _0x5451dc(_0x13242b['error'][_0xc319('0x2d')]);}else{logger[_0xc319('0x2e')](_0xc319('0x26'),_0x5183c7,_0xc319('0x27'));_0x5451dc(_0x13242b[_0xc319('0x2f')][_0xc319('0x2d')]);}})[_0xc319('0x30')](function(_0x1ed6b7){logger[_0xc319('0x2b')](_0xc319('0x26'),_0x5183c7,_0x1ed6b7);_0x5d6a94(_0x1ed6b7);});});}function respondWithStatusCode(_0x1c9d84,_0x570104){_0x570104=_0x570104||0xcc;return function(_0x1aa2e9){if(_0x1aa2e9){return _0x1c9d84['sendStatus'](_0x570104);}return _0x1c9d84[_0xc319('0x31')](_0x570104)['end']();};}function respondWithResult(_0x303e80,_0x5b122b){_0x5b122b=_0x5b122b||0xc8;return function(_0x20250b){if(_0x20250b){return _0x303e80['status'](_0x5b122b)[_0xc319('0x32')](_0x20250b);}};}function respondWithFilteredResult(_0x220ad5,_0x5b2500){return function(_0x1dd654){if(_0x1dd654){var _0x387caf=_0x1dd654[_0xc319('0x33')],_0x310485=_0x5b2500[_0xc319('0x34')],_0x2f5ea5=_0x5b2500[_0xc319('0x34')]+_0x5b2500['limit'],_0x5b4f71;if(_0x2f5ea5>=_0x387caf){_0x2f5ea5=_0x387caf;_0x5b4f71=0xc8;}else{_0x5b4f71=0xce;}_0x220ad5[_0xc319('0x31')](_0x5b4f71);return _0x220ad5[_0xc319('0x35')](_0xc319('0x36'),_0x310485+'-'+_0x2f5ea5+'/'+_0x387caf)[_0xc319('0x32')](_0x1dd654);}return null;};}function patchUpdates(_0xc1001){return function(_0x2cd374){try{jsonpatch[_0xc319('0x37')](_0x2cd374,_0xc1001,!![]);}catch(_0x24f9e9){return BPromise[_0xc319('0x38')](_0x24f9e9);}return _0x2cd374[_0xc319('0x39')]();};}function saveUpdates(_0x227c34,_0x588af0){return function(_0x3d59b0){if(_0x3d59b0){return _0x3d59b0[_0xc319('0x3a')](_0x227c34)[_0xc319('0x25')](function(_0x29947c){return _0x29947c;});}return null;};}function removeEntity(_0x338a6e,_0x5df32e){return function(_0x3640b6){if(_0x3640b6){return _0x3640b6[_0xc319('0x3b')]()[_0xc319('0x25')](function(){_0x338a6e['status'](0xcc)[_0xc319('0x3c')]();});}};}function handleEntityNotFound(_0x1e1d36,_0x4fdc17){return function(_0x1c8ef5){if(!_0x1c8ef5){_0x1e1d36[_0xc319('0x3d')](0x194);}return _0x1c8ef5;};}function handleError(_0xbc12fe,_0x520282){_0x520282=_0x520282||0x1f4;return function(_0x8cae90){logger[_0xc319('0x2b')](_0x8cae90[_0xc319('0x3e')]);if(_0x8cae90['name']){delete _0x8cae90[_0xc319('0x3f')];}_0xbc12fe[_0xc319('0x31')](_0x520282)[_0xc319('0x40')](_0x8cae90);};}exports[_0xc319('0x41')]=function(_0x43c8a1,_0xaca19a){var _0x5046f1={},_0x9906de={},_0x5e1c8a={'count':0x0,'rows':[]};var _0x22d8e0=_[_0xc319('0x42')](db['SalesforceConfiguration'][_0xc319('0x43')],function(_0xeba7c4){return{'name':_0xeba7c4['fieldName'],'type':_0xeba7c4[_0xc319('0x44')]['key']};});_0x9906de[_0xc319('0x45')]=_[_0xc319('0x42')](_0x22d8e0,'name');_0x9906de[_0xc319('0x46')]=_[_0xc319('0x47')](_0x43c8a1[_0xc319('0x46')]);_0x9906de['filters']=_[_0xc319('0x48')](_0x9906de[_0xc319('0x45')],_0x9906de[_0xc319('0x46')]);_0x5046f1[_0xc319('0x49')]=_[_0xc319('0x48')](_0x9906de['model'],qs[_0xc319('0x4a')](_0x43c8a1[_0xc319('0x46')]['fields']));_0x5046f1[_0xc319('0x49')]=_0x5046f1['attributes'][_0xc319('0x4b')]?_0x5046f1[_0xc319('0x49')]:_0x9906de[_0xc319('0x45')];if(!_0x43c8a1[_0xc319('0x46')]['hasOwnProperty'](_0xc319('0x4c'))){_0x5046f1['limit']=qs['limit'](_0x43c8a1['query'][_0xc319('0x4d')]);_0x5046f1[_0xc319('0x34')]=qs['offset'](_0x43c8a1[_0xc319('0x46')][_0xc319('0x34')]);}_0x5046f1[_0xc319('0x4e')]=qs[_0xc319('0x4f')](_0x43c8a1[_0xc319('0x46')][_0xc319('0x4f')]);_0x5046f1[_0xc319('0x50')]=qs[_0xc319('0x51')](_[_0xc319('0x52')](_0x43c8a1[_0xc319('0x46')],_0x9906de['filters']),_0x22d8e0);if(_0x43c8a1[_0xc319('0x46')][_0xc319('0x53')]){_0x5046f1[_0xc319('0x50')]=_[_0xc319('0x54')](_0x5046f1[_0xc319('0x50')],{'$or':_[_0xc319('0x42')](_0x22d8e0,function(_0x936026){if(_0x936026['type']!==_0xc319('0x55')){var _0xf5cc0a={};_0xf5cc0a[_0x936026['name']]={'$like':'%'+_0x43c8a1['query'][_0xc319('0x53')]+'%'};return _0xf5cc0a;}})});}_0x5046f1=_[_0xc319('0x54')]({},_0x5046f1,_0x43c8a1[_0xc319('0x56')]);var _0x4b7cfc={'where':_0x5046f1[_0xc319('0x50')]};return db['SalesforceConfiguration']['count'](_0x4b7cfc)[_0xc319('0x25')](function(_0x28c957){_0x5e1c8a[_0xc319('0x33')]=_0x28c957;if(_0x43c8a1['query'][_0xc319('0x57')]){_0x5046f1[_0xc319('0x58')]=[{'all':!![]}];}return db['SalesforceConfiguration'][_0xc319('0x59')](_0x5046f1);})[_0xc319('0x25')](function(_0x569f37){_0x5e1c8a[_0xc319('0x5a')]=_0x569f37;return _0x5e1c8a;})[_0xc319('0x25')](respondWithFilteredResult(_0xaca19a,_0x5046f1))[_0xc319('0x30')](handleError(_0xaca19a,null));};exports[_0xc319('0x5b')]=function(_0x30db89,_0x3a3b70){var _0x606308={'raw':![],'where':{'id':_0x30db89[_0xc319('0x5c')]['id']}},_0x3b5166={};_0x3b5166[_0xc319('0x45')]=_[_0xc319('0x47')](db[_0xc319('0x5d')][_0xc319('0x43')]);_0x3b5166[_0xc319('0x46')]=_[_0xc319('0x47')](_0x30db89['query']);_0x3b5166[_0xc319('0x51')]=_['intersection'](_0x3b5166[_0xc319('0x45')],_0x3b5166[_0xc319('0x46')]);_0x606308[_0xc319('0x49')]=_['intersection'](_0x3b5166['model'],qs[_0xc319('0x4a')](_0x30db89[_0xc319('0x46')]['fields']));_0x606308[_0xc319('0x49')]=_0x606308[_0xc319('0x49')][_0xc319('0x4b')]?_0x606308[_0xc319('0x49')]:_0x3b5166['model'];if(_0x30db89[_0xc319('0x46')][_0xc319('0x57')]){_0x606308[_0xc319('0x58')]=[{'all':!![]}];}_0x606308=_[_0xc319('0x54')]({},_0x606308,_0x30db89['options']);return db[_0xc319('0x5d')][_0xc319('0x5e')](_0x606308)['then'](handleEntityNotFound(_0x3a3b70,null))[_0xc319('0x25')](respondWithResult(_0x3a3b70,null))[_0xc319('0x30')](handleError(_0x3a3b70,null));};exports[_0xc319('0x5f')]=function(_0x142491,_0x477ae0){return db[_0xc319('0x5d')][_0xc319('0x5f')](_0x142491[_0xc319('0x60')],{})['then'](respondWithResult(_0x477ae0,0xc9))[_0xc319('0x30')](handleError(_0x477ae0,null));};exports['update']=function(_0x4e0fbf,_0x7c99a1){if(_0x4e0fbf[_0xc319('0x60')]['id']){delete _0x4e0fbf['body']['id'];}return db[_0xc319('0x5d')]['find']({'where':{'id':_0x4e0fbf[_0xc319('0x5c')]['id']}})[_0xc319('0x25')](handleEntityNotFound(_0x7c99a1,null))[_0xc319('0x25')](saveUpdates(_0x4e0fbf[_0xc319('0x60')],null))[_0xc319('0x25')](respondWithResult(_0x7c99a1,null))[_0xc319('0x30')](handleError(_0x7c99a1,null));};exports['destroy']=function(_0x3dacfc,_0x1f5406){return db[_0xc319('0x5d')][_0xc319('0x5e')]({'where':{'id':_0x3dacfc[_0xc319('0x5c')]['id']}})[_0xc319('0x25')](handleEntityNotFound(_0x1f5406,null))[_0xc319('0x25')](removeEntity(_0x1f5406,null))[_0xc319('0x30')](handleError(_0x1f5406,null));};exports[_0xc319('0x61')]=function(_0x380a37,_0x492dc3,_0x3838c5){var _0x1dc2fa={};var _0x3bf208={};var _0x396765;var _0x11bcb4;return db[_0xc319('0x5d')][_0xc319('0x62')]({'where':{'id':_0x380a37[_0xc319('0x5c')]['id']}})[_0xc319('0x25')](handleEntityNotFound(_0x492dc3,null))[_0xc319('0x25')](function(_0x2d7e10){if(_0x2d7e10){_0x396765=_0x2d7e10;_0x3bf208[_0xc319('0x45')]=_[_0xc319('0x47')](db[_0xc319('0x63')]['rawAttributes']);_0x3bf208['query']=_[_0xc319('0x47')](_0x380a37[_0xc319('0x46')]);_0x3bf208[_0xc319('0x51')]=_[_0xc319('0x48')](_0x3bf208[_0xc319('0x45')],_0x3bf208[_0xc319('0x46')]);_0x1dc2fa[_0xc319('0x49')]=_[_0xc319('0x48')](_0x3bf208[_0xc319('0x45')],qs[_0xc319('0x4a')](_0x380a37[_0xc319('0x46')]['fields']));_0x1dc2fa['attributes']=_0x1dc2fa[_0xc319('0x49')]['length']?_0x1dc2fa['attributes']:_0x3bf208[_0xc319('0x45')];_0x1dc2fa['order']=qs['sort'](_0x380a37[_0xc319('0x46')]['sort']);_0x1dc2fa[_0xc319('0x50')]=qs[_0xc319('0x51')](_['pick'](_0x380a37['query'],_0x3bf208[_0xc319('0x51')]));if(_0x380a37[_0xc319('0x46')][_0xc319('0x53')]){_0x1dc2fa[_0xc319('0x50')]=_[_0xc319('0x54')](_0x1dc2fa['where'],{'$or':_[_0xc319('0x42')](_0x1dc2fa[_0xc319('0x49')],function(_0x1478da){var _0x31e044={};_0x31e044[_0x1478da]={'$like':'%'+_0x380a37[_0xc319('0x46')][_0xc319('0x53')]+'%'};return _0x31e044;})});}_0x1dc2fa=_['merge']({},_0x1dc2fa,_0x380a37[_0xc319('0x56')]);return _0x396765[_0xc319('0x61')](_0x1dc2fa);}})[_0xc319('0x25')](function(_0xa0b485){if(_0xa0b485){_0x11bcb4=_0xa0b485['length'];if(!_0x380a37[_0xc319('0x46')][_0xc319('0x64')]('nolimit')){_0x1dc2fa[_0xc319('0x4d')]=qs[_0xc319('0x4d')](_0x380a37[_0xc319('0x46')][_0xc319('0x4d')]);_0x1dc2fa['offset']=qs[_0xc319('0x34')](_0x380a37['query'][_0xc319('0x34')]);}return _0x396765[_0xc319('0x61')](_0x1dc2fa);}})[_0xc319('0x25')](function(_0x5034b1){if(_0x5034b1){return _0x5034b1?{'count':_0x11bcb4,'rows':_0x5034b1}:null;}})['then'](respondWithResult(_0x492dc3,null))[_0xc319('0x30')](handleError(_0x492dc3,null));};exports[_0xc319('0x65')]=function(_0x3077de,_0xa5af16,_0x352a52){var _0x474f56={};var _0x4010c1={};var _0x124443;var _0x57003a;return db[_0xc319('0x5d')][_0xc319('0x62')]({'where':{'id':_0x3077de['params']['id']}})[_0xc319('0x25')](handleEntityNotFound(_0xa5af16,null))[_0xc319('0x25')](function(_0x12bd33){if(_0x12bd33){_0x124443=_0x12bd33;_0x4010c1[_0xc319('0x45')]=_[_0xc319('0x47')](db[_0xc319('0x63')][_0xc319('0x43')]);_0x4010c1['query']=_[_0xc319('0x47')](_0x3077de[_0xc319('0x46')]);_0x4010c1[_0xc319('0x51')]=_[_0xc319('0x48')](_0x4010c1['model'],_0x4010c1[_0xc319('0x46')]);_0x474f56[_0xc319('0x49')]=_[_0xc319('0x48')](_0x4010c1[_0xc319('0x45')],qs['fields'](_0x3077de[_0xc319('0x46')][_0xc319('0x4a')]));_0x474f56[_0xc319('0x49')]=_0x474f56[_0xc319('0x49')][_0xc319('0x4b')]?_0x474f56[_0xc319('0x49')]:_0x4010c1[_0xc319('0x45')];_0x474f56[_0xc319('0x4e')]=qs[_0xc319('0x4f')](_0x3077de[_0xc319('0x46')]['sort']);_0x474f56[_0xc319('0x50')]=qs[_0xc319('0x51')](_[_0xc319('0x52')](_0x3077de['query'],_0x4010c1['filters']));if(_0x3077de[_0xc319('0x46')][_0xc319('0x53')]){_0x474f56['where']=_['merge'](_0x474f56['where'],{'$or':_[_0xc319('0x42')](_0x474f56['attributes'],function(_0x2a711a){var _0x8db6dc={};_0x8db6dc[_0x2a711a]={'$like':'%'+_0x3077de['query'][_0xc319('0x53')]+'%'};return _0x8db6dc;})});}_0x474f56=_[_0xc319('0x54')]({},_0x474f56,_0x3077de[_0xc319('0x56')]);return _0x124443[_0xc319('0x65')](_0x474f56);}})[_0xc319('0x25')](function(_0x1e3877){if(_0x1e3877){_0x57003a=_0x1e3877[_0xc319('0x4b')];if(!_0x3077de[_0xc319('0x46')][_0xc319('0x64')](_0xc319('0x4c'))){_0x474f56[_0xc319('0x4d')]=qs[_0xc319('0x4d')](_0x3077de[_0xc319('0x46')][_0xc319('0x4d')]);_0x474f56[_0xc319('0x34')]=qs['offset'](_0x3077de[_0xc319('0x46')][_0xc319('0x34')]);}return _0x124443[_0xc319('0x65')](_0x474f56);}})[_0xc319('0x25')](function(_0x25580a){if(_0x25580a){return _0x25580a?{'count':_0x57003a,'rows':_0x25580a}:null;}})[_0xc319('0x25')](respondWithResult(_0xa5af16,null))['catch'](handleError(_0xa5af16,null));};exports[_0xc319('0x66')]=function(_0x1ffe1e,_0x19d6b6,_0x592e1b){var _0x1e1dd9={};var _0x58ef01={};var _0x49cc56;var _0x5d559f;return db['SalesforceConfiguration'][_0xc319('0x62')]({'where':{'id':_0x1ffe1e['params']['id']}})[_0xc319('0x25')](handleEntityNotFound(_0x19d6b6,null))[_0xc319('0x25')](function(_0x2081e3){if(_0x2081e3){_0x49cc56=_0x2081e3;_0x58ef01[_0xc319('0x45')]=_[_0xc319('0x47')](db[_0xc319('0x63')][_0xc319('0x43')]);_0x58ef01[_0xc319('0x46')]=_['keys'](_0x1ffe1e[_0xc319('0x46')]);_0x58ef01[_0xc319('0x51')]=_[_0xc319('0x48')](_0x58ef01['model'],_0x58ef01[_0xc319('0x46')]);_0x1e1dd9['attributes']=_[_0xc319('0x48')](_0x58ef01['model'],qs[_0xc319('0x4a')](_0x1ffe1e[_0xc319('0x46')][_0xc319('0x4a')]));_0x1e1dd9[_0xc319('0x49')]=_0x1e1dd9['attributes']['length']?_0x1e1dd9[_0xc319('0x49')]:_0x58ef01['model'];_0x1e1dd9[_0xc319('0x4e')]=qs['sort'](_0x1ffe1e[_0xc319('0x46')]['sort']);_0x1e1dd9[_0xc319('0x50')]=qs[_0xc319('0x51')](_[_0xc319('0x52')](_0x1ffe1e[_0xc319('0x46')],_0x58ef01[_0xc319('0x51')]));if(_0x1ffe1e[_0xc319('0x46')][_0xc319('0x53')]){_0x1e1dd9[_0xc319('0x50')]=_[_0xc319('0x54')](_0x1e1dd9[_0xc319('0x50')],{'$or':_['map'](_0x1e1dd9[_0xc319('0x49')],function(_0x5ba082){var _0x38d05a={};_0x38d05a[_0x5ba082]={'$like':'%'+_0x1ffe1e[_0xc319('0x46')][_0xc319('0x53')]+'%'};return _0x38d05a;})});}_0x1e1dd9=_[_0xc319('0x54')]({},_0x1e1dd9,_0x1ffe1e['options']);return _0x49cc56[_0xc319('0x66')](_0x1e1dd9);}})[_0xc319('0x25')](function(_0x4d183d){if(_0x4d183d){_0x5d559f=_0x4d183d[_0xc319('0x4b')];if(!_0x1ffe1e[_0xc319('0x46')][_0xc319('0x64')](_0xc319('0x4c'))){_0x1e1dd9[_0xc319('0x4d')]=qs[_0xc319('0x4d')](_0x1ffe1e[_0xc319('0x46')][_0xc319('0x4d')]);_0x1e1dd9['offset']=qs[_0xc319('0x34')](_0x1ffe1e[_0xc319('0x46')][_0xc319('0x34')]);}return _0x49cc56['getDescriptions'](_0x1e1dd9);}})[_0xc319('0x25')](function(_0x31bb4f){if(_0x31bb4f){return _0x31bb4f?{'count':_0x5d559f,'rows':_0x31bb4f}:null;}})[_0xc319('0x25')](respondWithResult(_0x19d6b6,null))['catch'](handleError(_0x19d6b6,null));};
\ No newline at end of file
diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js
index 16e92aa..ca3a632 100644
--- a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js
+++ b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x566f=['rimraf','../../config/environment','exports','define','int_salesforce_configurations','lodash','util','api','moment','request-promise','path'];(function(_0x4f4126,_0x3ab2de){var _0xf5693=function(_0x5bdb6b){while(--_0x5bdb6b){_0x4f4126['push'](_0x4f4126['shift']());}};_0xf5693(++_0x3ab2de);}(_0x566f,0x15a));var _0xf566=function(_0x40cc89,_0x138ceb){_0x40cc89=_0x40cc89-0x0;var _0x5a4484=_0x566f[_0x40cc89];return _0x5a4484;};'use strict';var _=require(_0xf566('0x0'));var util=require(_0xf566('0x1'));var logger=require('../../config/logger')(_0xf566('0x2'));var moment=require(_0xf566('0x3'));var BPromise=require('bluebird');var rp=require(_0xf566('0x4'));var fs=require('fs');var path=require(_0xf566('0x5'));var rimraf=require(_0xf566('0x6'));var config=require(_0xf566('0x7'));var attributes=require('./intSalesforceConfiguration.attributes');module[_0xf566('0x8')]=function(_0x3fbb67,_0x5a301b){return _0x3fbb67[_0xf566('0x9')]('SalesforceConfiguration',attributes,{'tableName':_0xf566('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xb09b=['api','moment','bluebird','path','rimraf','../../config/environment','./intSalesforceConfiguration.attributes','exports','int_salesforce_configurations','util','../../config/logger'];(function(_0x497454,_0x1642f9){var _0x4858f0=function(_0x2a5a7c){while(--_0x2a5a7c){_0x497454['push'](_0x497454['shift']());}};_0x4858f0(++_0x1642f9);}(_0xb09b,0x195));var _0xbb09=function(_0x57a6e5,_0x57d7e9){_0x57a6e5=_0x57a6e5-0x0;var _0x540d07=_0xb09b[_0x57a6e5];return _0x540d07;};'use strict';var _=require('lodash');var util=require(_0xbb09('0x0'));var logger=require(_0xbb09('0x1'))(_0xbb09('0x2'));var moment=require(_0xbb09('0x3'));var BPromise=require(_0xbb09('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xbb09('0x5'));var rimraf=require(_0xbb09('0x6'));var config=require(_0xbb09('0x7'));var attributes=require(_0xbb09('0x8'));module[_0xbb09('0x9')]=function(_0x503fea,_0x167207){return _0x503fea['define']('SalesforceConfiguration',attributes,{'tableName':_0xbb09('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.rpc.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.rpc.js
index 1b064a6..c700147 100644
--- a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.rpc.js
+++ b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xc858=['moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','SalesforceConfiguration,\x20%s,\x20%s','request\x20sent','debug','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','util'];(function(_0x4f9b18,_0x2cb5ca){var _0x29f20c=function(_0x268b3d){while(--_0x268b3d){_0x4f9b18['push'](_0x4f9b18['shift']());}};_0x29f20c(++_0x2cb5ca);}(_0xc858,0x1c0));var _0x8c85=function(_0x17e730,_0xa878f6){_0x17e730=_0x17e730-0x0;var _0x21f52d=_0xc858[_0x17e730];return _0x21f52d;};'use strict';var _=require(_0x8c85('0x0'));var util=require(_0x8c85('0x1'));var moment=require(_0x8c85('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8c85('0x3'));var db=require(_0x8c85('0x4'))['db'];var utils=require(_0x8c85('0x5'));var logger=require(_0x8c85('0x6'))(_0x8c85('0x7'));var config=require(_0x8c85('0x8'));var jayson=require(_0x8c85('0x9'));var client=jayson[_0x8c85('0xa')][_0x8c85('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x324ddf,_0x2dac35,_0x1b0e46){return new BPromise(function(_0xe58934,_0x61835c){return client[_0x8c85('0xc')](_0x324ddf,_0x1b0e46)[_0x8c85('0xd')](function(_0x546df4){logger['info'](_0x8c85('0xe'),_0x2dac35,_0x8c85('0xf'));logger[_0x8c85('0x10')](_0x8c85('0x11'),_0x2dac35,_0x8c85('0xf'),JSON[_0x8c85('0x12')](_0x546df4));if(_0x546df4[_0x8c85('0x13')]){if(_0x546df4[_0x8c85('0x13')][_0x8c85('0x14')]===0x1f4){logger['error'](_0x8c85('0xe'),_0x2dac35,_0x546df4[_0x8c85('0x13')][_0x8c85('0x15')]);return _0x61835c(_0x546df4['error'][_0x8c85('0x15')]);}logger[_0x8c85('0x13')](_0x8c85('0xe'),_0x2dac35,_0x546df4['error'][_0x8c85('0x15')]);return _0xe58934(_0x546df4['error']['message']);}else{logger[_0x8c85('0x16')](_0x8c85('0xe'),_0x2dac35,'request\x20sent');_0xe58934(_0x546df4[_0x8c85('0x17')][_0x8c85('0x15')]);}})[_0x8c85('0x18')](function(_0x21d9d8){logger[_0x8c85('0x13')](_0x8c85('0xe'),_0x2dac35,_0x21d9d8);_0x61835c(_0x21d9d8);});});}
\ No newline at end of file
+var _0x261b=['message','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/environment','jayson/promise','client','http','request','then','info','SalesforceConfiguration,\x20%s,\x20%s','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','error','code'];(function(_0x14b86f,_0x31b7e2){var _0x1354e3=function(_0x2436bd){while(--_0x2436bd){_0x14b86f['push'](_0x14b86f['shift']());}};_0x1354e3(++_0x31b7e2);}(_0x261b,0x145));var _0xb261=function(_0x1f343a,_0x4b2c8e){_0x1f343a=_0x1f343a-0x0;var _0x5a94fa=_0x261b[_0x1f343a];return _0x5a94fa;};'use strict';var _=require(_0xb261('0x0'));var util=require('util');var moment=require(_0xb261('0x1'));var BPromise=require('bluebird');var rs=require(_0xb261('0x2'));var fs=require('fs');var Redis=require(_0xb261('0x3'));var db=require(_0xb261('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0xb261('0x5'));var jayson=require(_0xb261('0x6'));var client=jayson[_0xb261('0x7')][_0xb261('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x6c650e,_0x5ea869,_0xeac159){return new BPromise(function(_0x2798a8,_0x3ae24e){return client[_0xb261('0x9')](_0x6c650e,_0xeac159)[_0xb261('0xa')](function(_0x43bdec){logger[_0xb261('0xb')](_0xb261('0xc'),_0x5ea869,'request\x20sent');logger['debug'](_0xb261('0xd'),_0x5ea869,_0xb261('0xe'),JSON['stringify'](_0x43bdec));if(_0x43bdec[_0xb261('0xf')]){if(_0x43bdec['error'][_0xb261('0x10')]===0x1f4){logger[_0xb261('0xf')]('SalesforceConfiguration,\x20%s,\x20%s',_0x5ea869,_0x43bdec[_0xb261('0xf')]['message']);return _0x3ae24e(_0x43bdec[_0xb261('0xf')][_0xb261('0x11')]);}logger['error'](_0xb261('0xc'),_0x5ea869,_0x43bdec[_0xb261('0xf')][_0xb261('0x11')]);return _0x2798a8(_0x43bdec[_0xb261('0xf')][_0xb261('0x11')]);}else{logger['info'](_0xb261('0xc'),_0x5ea869,'request\x20sent');_0x2798a8(_0x43bdec['result'][_0xb261('0x11')]);}})['catch'](function(_0x2b3d34){logger[_0xb261('0xf')](_0xb261('0xc'),_0x5ea869,_0x2b3d34);_0x3ae24e(_0x2b3d34);});});}
\ No newline at end of file
diff --git a/server/api/intSalesforceField/index.js b/server/api/intSalesforceField/index.js
index b9e6e6d..fca2da9 100644
--- a/server/api/intSalesforceField/index.js
+++ b/server/api/intSalesforceField/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x0a6b=['show','post','/:id','update','delete','destroy','multer','express','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','isAuthenticated'];(function(_0xb129f,_0x1866ff){var _0x4d519e=function(_0xa9e8f8){while(--_0xa9e8f8){_0xb129f['push'](_0xb129f['shift']());}};_0x4d519e(++_0x1866ff);}(_0x0a6b,0x18e));var _0xb0a6=function(_0x221715,_0x2f4acd){_0x221715=_0x221715-0x0;var _0x130c1f=_0x0a6b[_0x221715];return _0x130c1f;};'use strict';var multer=require(_0xb0a6('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0xb0a6('0x1'));var router=express['Router']();var auth=require(_0xb0a6('0x2'));var interaction=require(_0xb0a6('0x3'));var config=require(_0xb0a6('0x4'));var controller=require('./intSalesforceField.controller');router[_0xb0a6('0x5')]('/',auth['isAuthenticated'](),controller[_0xb0a6('0x6')]);router[_0xb0a6('0x5')]('/:id',auth[_0xb0a6('0x7')](),controller[_0xb0a6('0x8')]);router[_0xb0a6('0x9')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0xb0a6('0xa'),auth[_0xb0a6('0x7')](),controller[_0xb0a6('0xb')]);router[_0xb0a6('0xc')]('/:id',auth[_0xb0a6('0x7')](),controller[_0xb0a6('0xd')]);module['exports']=router;
\ No newline at end of file
+var _0x2ef3=['post','create','put','update','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show'];(function(_0x48cf3b,_0x1063ab){var _0x428539=function(_0x5329bc){while(--_0x5329bc){_0x48cf3b['push'](_0x48cf3b['shift']());}};_0x428539(++_0x1063ab);}(_0x2ef3,0xba));var _0x32ef=function(_0x1c01b1,_0x1ce1df){_0x1c01b1=_0x1c01b1-0x0;var _0x41ef38=_0x2ef3[_0x1c01b1];return _0x41ef38;};'use strict';var multer=require(_0x32ef('0x0'));var util=require(_0x32ef('0x1'));var path=require(_0x32ef('0x2'));var timeout=require(_0x32ef('0x3'));var express=require(_0x32ef('0x4'));var router=express[_0x32ef('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0x32ef('0x6'));var config=require(_0x32ef('0x7'));var controller=require('./intSalesforceField.controller');router[_0x32ef('0x8')]('/',auth[_0x32ef('0x9')](),controller['index']);router['get'](_0x32ef('0xa'),auth[_0x32ef('0x9')](),controller[_0x32ef('0xb')]);router[_0x32ef('0xc')]('/',auth[_0x32ef('0x9')](),controller[_0x32ef('0xd')]);router[_0x32ef('0xe')](_0x32ef('0xa'),auth[_0x32ef('0x9')](),controller[_0x32ef('0xf')]);router['delete']('/:id',auth[_0x32ef('0x9')](),controller[_0x32ef('0x10')]);module[_0x32ef('0x11')]=router;
\ No newline at end of file
diff --git a/server/api/intSalesforceField/intSalesforceField.attributes.js b/server/api/intSalesforceField/intSalesforceField.attributes.js
index e5af49c..50c2d06 100644
--- a/server/api/intSalesforceField/intSalesforceField.attributes.js
+++ b/server/api/intSalesforceField/intSalesforceField.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9b8c=['string','variable','customVariable','keyValue','STRING','sequelize','ENUM'];(function(_0x4f6ea8,_0x191395){var _0x39f538=function(_0x8aa4c9){while(--_0x8aa4c9){_0x4f6ea8['push'](_0x4f6ea8['shift']());}};_0x39f538(++_0x191395);}(_0x9b8c,0x155));var _0xc9b8=function(_0x2731f0,_0x126b1b){_0x2731f0=_0x2731f0-0x0;var _0x36a180=_0x9b8c[_0x2731f0];return _0x36a180;};'use strict';var Sequelize=require(_0xc9b8('0x0'));module['exports']={'type':{'type':Sequelize[_0xc9b8('0x1')](_0xc9b8('0x2'),_0xc9b8('0x3'),_0xc9b8('0x4'),_0xc9b8('0x5')),'defaultValue':_0xc9b8('0x2')},'content':{'type':Sequelize[_0xc9b8('0x6')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0xc9b8('0x1')](_0xc9b8('0x2'),_0xc9b8('0x3'),_0xc9b8('0x4'))},'keyContent':{'type':Sequelize[_0xc9b8('0x6')]},'idField':{'type':Sequelize[_0xc9b8('0x6')]},'variableName':{'type':Sequelize[_0xc9b8('0x6')]}};
\ No newline at end of file
+var _0x8a6c=['variable','customVariable','keyValue','STRING','sequelize','exports','ENUM','string'];(function(_0x3408c0,_0x271ef8){var _0x48335a=function(_0x77a51e){while(--_0x77a51e){_0x3408c0['push'](_0x3408c0['shift']());}};_0x48335a(++_0x271ef8);}(_0x8a6c,0x64));var _0xc8a6=function(_0x300192,_0xd86964){_0x300192=_0x300192-0x0;var _0x2d36b1=_0x8a6c[_0x300192];return _0x2d36b1;};'use strict';var Sequelize=require(_0xc8a6('0x0'));module[_0xc8a6('0x1')]={'type':{'type':Sequelize[_0xc8a6('0x2')](_0xc8a6('0x3'),_0xc8a6('0x4'),_0xc8a6('0x5'),_0xc8a6('0x6')),'defaultValue':'string'},'content':{'type':Sequelize[_0xc8a6('0x7')]},'key':{'type':Sequelize[_0xc8a6('0x7')]},'keyType':{'type':Sequelize[_0xc8a6('0x2')](_0xc8a6('0x3'),_0xc8a6('0x4'),'customVariable')},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0xc8a6('0x7')]},'variableName':{'type':Sequelize[_0xc8a6('0x7')]}};
\ No newline at end of file
diff --git a/server/api/intSalesforceField/intSalesforceField.controller.js b/server/api/intSalesforceField/intSalesforceField.controller.js
index 0f6d916..0fd2f28 100644
--- a/server/api/intSalesforceField/intSalesforceField.controller.js
+++ b/server/api/intSalesforceField/intSalesforceField.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xca04=['order','sort','pick','filter','where','merge','VIRTUAL','options','SalesforceField','includeAll','include','findAll','rows','params','keys','rawAttributes','find','create','catch','body','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../mysqldb','status','end','count','offset','limit','Content-Range','json','apply','reject','save','update','destroy','then','sendStatus','error','stack','name','index','map','type','key','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit'];(function(_0x3635b9,_0x48ef56){var _0x290d8c=function(_0x4a4305){while(--_0x4a4305){_0x3635b9['push'](_0x3635b9['shift']());}};_0x290d8c(++_0x48ef56);}(_0xca04,0x138));var _0x4ca0=function(_0x5e8319,_0x391c07){_0x5e8319=_0x5e8319-0x0;var _0x3ced38=_0xca04[_0x5e8319];return _0x3ced38;};'use strict';var pdf=require(_0x4ca0('0x0'));var emlformat=require(_0x4ca0('0x1'));var rimraf=require(_0x4ca0('0x2'));var zipdir=require(_0x4ca0('0x3'));var jsonpatch=require(_0x4ca0('0x4'));var rp=require(_0x4ca0('0x5'));var moment=require(_0x4ca0('0x6'));var BPromise=require('bluebird');var Mustache=require(_0x4ca0('0x7'));var util=require(_0x4ca0('0x8'));var path=require(_0x4ca0('0x9'));var sox=require(_0x4ca0('0xa'));var csv=require(_0x4ca0('0xb'));var ejs=require(_0x4ca0('0xc'));var fs=require('fs');var _=require(_0x4ca0('0xd'));var squel=require(_0x4ca0('0xe'));var crypto=require('crypto');var jsforce=require(_0x4ca0('0xf'));var deskjs=require(_0x4ca0('0x10'));var toCsv=require(_0x4ca0('0xb'));var querystring=require(_0x4ca0('0x11'));var Papa=require('papaparse');var Redis=require(_0x4ca0('0x12'));var authService=require(_0x4ca0('0x13'));var qs=require(_0x4ca0('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4ca0('0x15'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x4ca0('0x16'))['db'];function respondWithStatusCode(_0x1d1cbf,_0x5e2d13){_0x5e2d13=_0x5e2d13||0xcc;return function(_0x399a23){if(_0x399a23){return _0x1d1cbf['sendStatus'](_0x5e2d13);}return _0x1d1cbf[_0x4ca0('0x17')](_0x5e2d13)[_0x4ca0('0x18')]();};}function respondWithResult(_0xb9bae5,_0x2a5241){_0x2a5241=_0x2a5241||0xc8;return function(_0xbb28ff){if(_0xbb28ff){return _0xb9bae5[_0x4ca0('0x17')](_0x2a5241)['json'](_0xbb28ff);}};}function respondWithFilteredResult(_0xcaceec,_0x436964){return function(_0xdddca9){if(_0xdddca9){var _0x1e4aaf=_0xdddca9[_0x4ca0('0x19')],_0x540490=_0x436964[_0x4ca0('0x1a')],_0x58cfbd=_0x436964['offset']+_0x436964[_0x4ca0('0x1b')],_0x108dfe;if(_0x58cfbd>=_0x1e4aaf){_0x58cfbd=_0x1e4aaf;_0x108dfe=0xc8;}else{_0x108dfe=0xce;}_0xcaceec['status'](_0x108dfe);return _0xcaceec['set'](_0x4ca0('0x1c'),_0x540490+'-'+_0x58cfbd+'/'+_0x1e4aaf)[_0x4ca0('0x1d')](_0xdddca9);}return null;};}function patchUpdates(_0x1eaa3a){return function(_0x42a185){try{jsonpatch[_0x4ca0('0x1e')](_0x42a185,_0x1eaa3a,!![]);}catch(_0x4083c6){return BPromise[_0x4ca0('0x1f')](_0x4083c6);}return _0x42a185[_0x4ca0('0x20')]();};}function saveUpdates(_0x551bc6,_0x17bd3f){return function(_0x280bae){if(_0x280bae){return _0x280bae[_0x4ca0('0x21')](_0x551bc6)['then'](function(_0x2e1e56){return _0x2e1e56;});}return null;};}function removeEntity(_0x48a406,_0x2dccf4){return function(_0x431b4e){if(_0x431b4e){return _0x431b4e[_0x4ca0('0x22')]()[_0x4ca0('0x23')](function(){_0x48a406[_0x4ca0('0x17')](0xcc)[_0x4ca0('0x18')]();});}};}function handleEntityNotFound(_0x3b4941,_0x28e255){return function(_0x15f50a){if(!_0x15f50a){_0x3b4941[_0x4ca0('0x24')](0x194);}return _0x15f50a;};}function handleError(_0x45fb8b,_0x141122){_0x141122=_0x141122||0x1f4;return function(_0x38a5d0){logger[_0x4ca0('0x25')](_0x38a5d0[_0x4ca0('0x26')]);if(_0x38a5d0[_0x4ca0('0x27')]){delete _0x38a5d0['name'];}_0x45fb8b[_0x4ca0('0x17')](_0x141122)['send'](_0x38a5d0);};}exports[_0x4ca0('0x28')]=function(_0x485bda,_0x27bcc2){var _0x9a6b06={},_0xa8fb54={},_0x453f24={'count':0x0,'rows':[]};var _0x5b4ebf=_[_0x4ca0('0x29')](db['SalesforceField']['rawAttributes'],function(_0x5ede72){return{'name':_0x5ede72['fieldName'],'type':_0x5ede72[_0x4ca0('0x2a')][_0x4ca0('0x2b')]};});_0xa8fb54['model']=_[_0x4ca0('0x29')](_0x5b4ebf,'name');_0xa8fb54['query']=_['keys'](_0x485bda[_0x4ca0('0x2c')]);_0xa8fb54[_0x4ca0('0x2d')]=_[_0x4ca0('0x2e')](_0xa8fb54[_0x4ca0('0x2f')],_0xa8fb54[_0x4ca0('0x2c')]);_0x9a6b06[_0x4ca0('0x30')]=_['intersection'](_0xa8fb54['model'],qs['fields'](_0x485bda[_0x4ca0('0x2c')][_0x4ca0('0x31')]));_0x9a6b06[_0x4ca0('0x30')]=_0x9a6b06['attributes'][_0x4ca0('0x32')]?_0x9a6b06[_0x4ca0('0x30')]:_0xa8fb54[_0x4ca0('0x2f')];if(!_0x485bda[_0x4ca0('0x2c')][_0x4ca0('0x33')](_0x4ca0('0x34'))){_0x9a6b06[_0x4ca0('0x1b')]=qs[_0x4ca0('0x1b')](_0x485bda[_0x4ca0('0x2c')][_0x4ca0('0x1b')]);_0x9a6b06[_0x4ca0('0x1a')]=qs[_0x4ca0('0x1a')](_0x485bda[_0x4ca0('0x2c')]['offset']);}_0x9a6b06[_0x4ca0('0x35')]=qs[_0x4ca0('0x36')](_0x485bda[_0x4ca0('0x2c')][_0x4ca0('0x36')]);_0x9a6b06['where']=qs['filters'](_[_0x4ca0('0x37')](_0x485bda['query'],_0xa8fb54[_0x4ca0('0x2d')]),_0x5b4ebf);if(_0x485bda[_0x4ca0('0x2c')][_0x4ca0('0x38')]){_0x9a6b06[_0x4ca0('0x39')]=_[_0x4ca0('0x3a')](_0x9a6b06[_0x4ca0('0x39')],{'$or':_[_0x4ca0('0x29')](_0x5b4ebf,function(_0x5b14f3){if(_0x5b14f3[_0x4ca0('0x2a')]!==_0x4ca0('0x3b')){var _0xe2729={};_0xe2729[_0x5b14f3[_0x4ca0('0x27')]]={'$like':'%'+_0x485bda[_0x4ca0('0x2c')][_0x4ca0('0x38')]+'%'};return _0xe2729;}})});}_0x9a6b06=_[_0x4ca0('0x3a')]({},_0x9a6b06,_0x485bda[_0x4ca0('0x3c')]);var _0x39b499={'where':_0x9a6b06[_0x4ca0('0x39')]};return db[_0x4ca0('0x3d')][_0x4ca0('0x19')](_0x39b499)[_0x4ca0('0x23')](function(_0x54f403){_0x453f24['count']=_0x54f403;if(_0x485bda[_0x4ca0('0x2c')][_0x4ca0('0x3e')]){_0x9a6b06[_0x4ca0('0x3f')]=[{'all':!![]}];}return db['SalesforceField'][_0x4ca0('0x40')](_0x9a6b06);})[_0x4ca0('0x23')](function(_0x3cc396){_0x453f24[_0x4ca0('0x41')]=_0x3cc396;return _0x453f24;})[_0x4ca0('0x23')](respondWithFilteredResult(_0x27bcc2,_0x9a6b06))['catch'](handleError(_0x27bcc2,null));};exports['show']=function(_0x67040,_0x4d5a12){var _0x6502f0={'raw':!![],'where':{'id':_0x67040[_0x4ca0('0x42')]['id']}},_0x969b32={};_0x969b32[_0x4ca0('0x2f')]=_[_0x4ca0('0x43')](db[_0x4ca0('0x3d')][_0x4ca0('0x44')]);_0x969b32['query']=_[_0x4ca0('0x43')](_0x67040[_0x4ca0('0x2c')]);_0x969b32[_0x4ca0('0x2d')]=_[_0x4ca0('0x2e')](_0x969b32[_0x4ca0('0x2f')],_0x969b32[_0x4ca0('0x2c')]);_0x6502f0[_0x4ca0('0x30')]=_[_0x4ca0('0x2e')](_0x969b32[_0x4ca0('0x2f')],qs[_0x4ca0('0x31')](_0x67040[_0x4ca0('0x2c')][_0x4ca0('0x31')]));_0x6502f0['attributes']=_0x6502f0[_0x4ca0('0x30')]['length']?_0x6502f0[_0x4ca0('0x30')]:_0x969b32['model'];if(_0x67040[_0x4ca0('0x2c')][_0x4ca0('0x3e')]){_0x6502f0['include']=[{'all':!![]}];}_0x6502f0=_['merge']({},_0x6502f0,_0x67040[_0x4ca0('0x3c')]);return db[_0x4ca0('0x3d')][_0x4ca0('0x45')](_0x6502f0)[_0x4ca0('0x23')](handleEntityNotFound(_0x4d5a12,null))[_0x4ca0('0x23')](respondWithResult(_0x4d5a12,null))['catch'](handleError(_0x4d5a12,null));};exports[_0x4ca0('0x46')]=function(_0x537010,_0x1c24ea){return db[_0x4ca0('0x3d')][_0x4ca0('0x46')](_0x537010['body'],{})[_0x4ca0('0x23')](respondWithResult(_0x1c24ea,0xc9))[_0x4ca0('0x47')](handleError(_0x1c24ea,null));};exports['update']=function(_0x2bce8c,_0x447dc3){if(_0x2bce8c[_0x4ca0('0x48')]['id']){delete _0x2bce8c[_0x4ca0('0x48')]['id'];}return db[_0x4ca0('0x3d')][_0x4ca0('0x45')]({'where':{'id':_0x2bce8c[_0x4ca0('0x42')]['id']}})[_0x4ca0('0x23')](handleEntityNotFound(_0x447dc3,null))['then'](saveUpdates(_0x2bce8c['body'],null))[_0x4ca0('0x23')](respondWithResult(_0x447dc3,null))[_0x4ca0('0x47')](handleError(_0x447dc3,null));};exports['destroy']=function(_0x4bcd5b,_0x1093da){return db[_0x4ca0('0x3d')]['find']({'where':{'id':_0x4bcd5b[_0x4ca0('0x42')]['id']}})['then'](handleEntityNotFound(_0x1093da,null))[_0x4ca0('0x23')](removeEntity(_0x1093da,null))[_0x4ca0('0x47')](handleError(_0x1093da,null));};
\ No newline at end of file
+var _0xaa87=['moment','bluebird','mustache','util','path','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','json','count','offset','status','set','apply','reject','save','update','then','destroy','end','error','name','send','index','map','rawAttributes','fieldName','type','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','limit','order','sort','where','filter','VIRTUAL','merge','options','SalesforceField','includeAll','include','findAll','rows','show','params','length','catch','create','body','find','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise'];(function(_0x6b9865,_0x13202f){var _0x4c2935=function(_0x540900){while(--_0x540900){_0x6b9865['push'](_0x6b9865['shift']());}};_0x4c2935(++_0x13202f);}(_0xaa87,0x1ce));var _0x7aa8=function(_0x36ed48,_0x1ee0d4){_0x36ed48=_0x36ed48-0x0;var _0x51c63a=_0xaa87[_0x36ed48];return _0x51c63a;};'use strict';var pdf=require(_0x7aa8('0x0'));var emlformat=require(_0x7aa8('0x1'));var rimraf=require(_0x7aa8('0x2'));var zipdir=require(_0x7aa8('0x3'));var jsonpatch=require(_0x7aa8('0x4'));var rp=require(_0x7aa8('0x5'));var moment=require(_0x7aa8('0x6'));var BPromise=require(_0x7aa8('0x7'));var Mustache=require(_0x7aa8('0x8'));var util=require(_0x7aa8('0x9'));var path=require(_0x7aa8('0xa'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x7aa8('0xb'));var fs=require('fs');var _=require(_0x7aa8('0xc'));var squel=require(_0x7aa8('0xd'));var crypto=require(_0x7aa8('0xe'));var jsforce=require(_0x7aa8('0xf'));var deskjs=require(_0x7aa8('0x10'));var toCsv=require(_0x7aa8('0x11'));var querystring=require(_0x7aa8('0x12'));var Papa=require(_0x7aa8('0x13'));var Redis=require(_0x7aa8('0x14'));var authService=require(_0x7aa8('0x15'));var qs=require(_0x7aa8('0x16'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7aa8('0x17'));var logger=require(_0x7aa8('0x18'))(_0x7aa8('0x19'));var utils=require('../../config/utils');var config=require(_0x7aa8('0x1a'));var db=require(_0x7aa8('0x1b'))['db'];function respondWithStatusCode(_0x74a7bf,_0x59d256){_0x59d256=_0x59d256||0xcc;return function(_0x3b4ea4){if(_0x3b4ea4){return _0x74a7bf[_0x7aa8('0x1c')](_0x59d256);}return _0x74a7bf['status'](_0x59d256)['end']();};}function respondWithResult(_0x509ce2,_0x2b779f){_0x2b779f=_0x2b779f||0xc8;return function(_0x4d36f3){if(_0x4d36f3){return _0x509ce2['status'](_0x2b779f)[_0x7aa8('0x1d')](_0x4d36f3);}};}function respondWithFilteredResult(_0x312d0f,_0x227138){return function(_0x1c951b){if(_0x1c951b){var _0x2a58e6=_0x1c951b[_0x7aa8('0x1e')],_0x3ee319=_0x227138[_0x7aa8('0x1f')],_0x451b07=_0x227138[_0x7aa8('0x1f')]+_0x227138['limit'],_0x3d3f26;if(_0x451b07>=_0x2a58e6){_0x451b07=_0x2a58e6;_0x3d3f26=0xc8;}else{_0x3d3f26=0xce;}_0x312d0f[_0x7aa8('0x20')](_0x3d3f26);return _0x312d0f[_0x7aa8('0x21')]('Content-Range',_0x3ee319+'-'+_0x451b07+'/'+_0x2a58e6)[_0x7aa8('0x1d')](_0x1c951b);}return null;};}function patchUpdates(_0x3e5519){return function(_0x37862e){try{jsonpatch[_0x7aa8('0x22')](_0x37862e,_0x3e5519,!![]);}catch(_0xabe494){return BPromise[_0x7aa8('0x23')](_0xabe494);}return _0x37862e[_0x7aa8('0x24')]();};}function saveUpdates(_0xc84200,_0x5d0043){return function(_0x1f713f){if(_0x1f713f){return _0x1f713f[_0x7aa8('0x25')](_0xc84200)[_0x7aa8('0x26')](function(_0x4e40f6){return _0x4e40f6;});}return null;};}function removeEntity(_0x5258da,_0x4bd8d6){return function(_0x2652a1){if(_0x2652a1){return _0x2652a1[_0x7aa8('0x27')]()[_0x7aa8('0x26')](function(){_0x5258da['status'](0xcc)[_0x7aa8('0x28')]();});}};}function handleEntityNotFound(_0x6182bd,_0x1315be){return function(_0x4b4868){if(!_0x4b4868){_0x6182bd[_0x7aa8('0x1c')](0x194);}return _0x4b4868;};}function handleError(_0x2b7b6e,_0x2c390b){_0x2c390b=_0x2c390b||0x1f4;return function(_0x488492){logger[_0x7aa8('0x29')](_0x488492['stack']);if(_0x488492[_0x7aa8('0x2a')]){delete _0x488492['name'];}_0x2b7b6e[_0x7aa8('0x20')](_0x2c390b)[_0x7aa8('0x2b')](_0x488492);};}exports[_0x7aa8('0x2c')]=function(_0x23e4ae,_0x319d76){var _0x2bf12c={},_0x2d0f2c={},_0x2e6c99={'count':0x0,'rows':[]};var _0xd58624=_[_0x7aa8('0x2d')](db['SalesforceField'][_0x7aa8('0x2e')],function(_0x21e350){return{'name':_0x21e350[_0x7aa8('0x2f')],'type':_0x21e350[_0x7aa8('0x30')]['key']};});_0x2d0f2c[_0x7aa8('0x31')]=_['map'](_0xd58624,_0x7aa8('0x2a'));_0x2d0f2c[_0x7aa8('0x32')]=_[_0x7aa8('0x33')](_0x23e4ae[_0x7aa8('0x32')]);_0x2d0f2c[_0x7aa8('0x34')]=_[_0x7aa8('0x35')](_0x2d0f2c[_0x7aa8('0x31')],_0x2d0f2c['query']);_0x2bf12c['attributes']=_[_0x7aa8('0x35')](_0x2d0f2c[_0x7aa8('0x31')],qs[_0x7aa8('0x36')](_0x23e4ae['query']['fields']));_0x2bf12c[_0x7aa8('0x37')]=_0x2bf12c['attributes']['length']?_0x2bf12c[_0x7aa8('0x37')]:_0x2d0f2c[_0x7aa8('0x31')];if(!_0x23e4ae['query'][_0x7aa8('0x38')](_0x7aa8('0x39'))){_0x2bf12c[_0x7aa8('0x3a')]=qs[_0x7aa8('0x3a')](_0x23e4ae[_0x7aa8('0x32')][_0x7aa8('0x3a')]);_0x2bf12c['offset']=qs['offset'](_0x23e4ae[_0x7aa8('0x32')]['offset']);}_0x2bf12c[_0x7aa8('0x3b')]=qs[_0x7aa8('0x3c')](_0x23e4ae['query']['sort']);_0x2bf12c[_0x7aa8('0x3d')]=qs['filters'](_['pick'](_0x23e4ae[_0x7aa8('0x32')],_0x2d0f2c['filters']),_0xd58624);if(_0x23e4ae[_0x7aa8('0x32')][_0x7aa8('0x3e')]){_0x2bf12c[_0x7aa8('0x3d')]=_['merge'](_0x2bf12c[_0x7aa8('0x3d')],{'$or':_['map'](_0xd58624,function(_0x1b6bc1){if(_0x1b6bc1[_0x7aa8('0x30')]!==_0x7aa8('0x3f')){var _0x18a63a={};_0x18a63a[_0x1b6bc1[_0x7aa8('0x2a')]]={'$like':'%'+_0x23e4ae[_0x7aa8('0x32')][_0x7aa8('0x3e')]+'%'};return _0x18a63a;}})});}_0x2bf12c=_[_0x7aa8('0x40')]({},_0x2bf12c,_0x23e4ae[_0x7aa8('0x41')]);var _0x3a2569={'where':_0x2bf12c['where']};return db[_0x7aa8('0x42')][_0x7aa8('0x1e')](_0x3a2569)[_0x7aa8('0x26')](function(_0x2b8707){_0x2e6c99[_0x7aa8('0x1e')]=_0x2b8707;if(_0x23e4ae[_0x7aa8('0x32')][_0x7aa8('0x43')]){_0x2bf12c[_0x7aa8('0x44')]=[{'all':!![]}];}return db[_0x7aa8('0x42')][_0x7aa8('0x45')](_0x2bf12c);})[_0x7aa8('0x26')](function(_0x52f37d){_0x2e6c99[_0x7aa8('0x46')]=_0x52f37d;return _0x2e6c99;})['then'](respondWithFilteredResult(_0x319d76,_0x2bf12c))['catch'](handleError(_0x319d76,null));};exports[_0x7aa8('0x47')]=function(_0xa8fa1a,_0x32a5aa){var _0x144a81={'raw':!![],'where':{'id':_0xa8fa1a[_0x7aa8('0x48')]['id']}},_0x181808={};_0x181808['model']=_['keys'](db[_0x7aa8('0x42')][_0x7aa8('0x2e')]);_0x181808[_0x7aa8('0x32')]=_[_0x7aa8('0x33')](_0xa8fa1a[_0x7aa8('0x32')]);_0x181808[_0x7aa8('0x34')]=_['intersection'](_0x181808[_0x7aa8('0x31')],_0x181808['query']);_0x144a81[_0x7aa8('0x37')]=_['intersection'](_0x181808[_0x7aa8('0x31')],qs['fields'](_0xa8fa1a['query'][_0x7aa8('0x36')]));_0x144a81[_0x7aa8('0x37')]=_0x144a81['attributes'][_0x7aa8('0x49')]?_0x144a81[_0x7aa8('0x37')]:_0x181808[_0x7aa8('0x31')];if(_0xa8fa1a[_0x7aa8('0x32')][_0x7aa8('0x43')]){_0x144a81[_0x7aa8('0x44')]=[{'all':!![]}];}_0x144a81=_[_0x7aa8('0x40')]({},_0x144a81,_0xa8fa1a[_0x7aa8('0x41')]);return db['SalesforceField']['find'](_0x144a81)[_0x7aa8('0x26')](handleEntityNotFound(_0x32a5aa,null))[_0x7aa8('0x26')](respondWithResult(_0x32a5aa,null))[_0x7aa8('0x4a')](handleError(_0x32a5aa,null));};exports['create']=function(_0x4d1843,_0x43ae68){return db[_0x7aa8('0x42')][_0x7aa8('0x4b')](_0x4d1843[_0x7aa8('0x4c')],{})['then'](respondWithResult(_0x43ae68,0xc9))['catch'](handleError(_0x43ae68,null));};exports[_0x7aa8('0x25')]=function(_0x3c0bb1,_0x6e5c01){if(_0x3c0bb1[_0x7aa8('0x4c')]['id']){delete _0x3c0bb1['body']['id'];}return db[_0x7aa8('0x42')]['find']({'where':{'id':_0x3c0bb1['params']['id']}})[_0x7aa8('0x26')](handleEntityNotFound(_0x6e5c01,null))[_0x7aa8('0x26')](saveUpdates(_0x3c0bb1[_0x7aa8('0x4c')],null))['then'](respondWithResult(_0x6e5c01,null))[_0x7aa8('0x4a')](handleError(_0x6e5c01,null));};exports['destroy']=function(_0x4b44b5,_0x28edb0){return db[_0x7aa8('0x42')][_0x7aa8('0x4d')]({'where':{'id':_0x4b44b5[_0x7aa8('0x48')]['id']}})[_0x7aa8('0x26')](handleEntityNotFound(_0x28edb0,null))[_0x7aa8('0x26')](removeEntity(_0x28edb0,null))[_0x7aa8('0x4a')](handleError(_0x28edb0,null));};
\ No newline at end of file
diff --git a/server/api/intSalesforceField/intSalesforceField.model.js b/server/api/intSalesforceField/intSalesforceField.model.js
index c9a161b..853e300 100644
--- a/server/api/intSalesforceField/intSalesforceField.model.js
+++ b/server/api/intSalesforceField/intSalesforceField.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x0089=['moment','request-promise','path','../../config/environment','./intSalesforceField.attributes','exports','define','int_salesforce_fields','salesforce_unique_index','idField','FieldId','../../config/logger','api'];(function(_0xfff52e,_0xd803f6){var _0x42876e=function(_0x4652bc){while(--_0x4652bc){_0xfff52e['push'](_0xfff52e['shift']());}};_0x42876e(++_0xd803f6);}(_0x0089,0x11c));var _0x9008=function(_0xf85242,_0x113527){_0xf85242=_0xf85242-0x0;var _0x461cb7=_0x0089[_0xf85242];return _0x461cb7;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x9008('0x0'))(_0x9008('0x1'));var moment=require(_0x9008('0x2'));var BPromise=require('bluebird');var rp=require(_0x9008('0x3'));var fs=require('fs');var path=require(_0x9008('0x4'));var rimraf=require('rimraf');var config=require(_0x9008('0x5'));var attributes=require(_0x9008('0x6'));module[_0x9008('0x7')]=function(_0x4498cc,_0x3e7e51){return _0x4498cc[_0x9008('0x8')]('SalesforceField',attributes,{'tableName':_0x9008('0x9'),'paranoid':![],'indexes':[{'name':_0x9008('0xa'),'fields':[_0x9008('0xb'),_0x9008('0xc')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x581b=['api','request-promise','define','SalesforceField','int_salesforce_fields','salesforce_unique_index','idField','FieldId','util','../../config/logger'];(function(_0x2f358c,_0x3cfe1b){var _0xff636a=function(_0x3b0102){while(--_0x3b0102){_0x2f358c['push'](_0x2f358c['shift']());}};_0xff636a(++_0x3cfe1b);}(_0x581b,0x184));var _0xb581=function(_0x29db36,_0x410ae9){_0x29db36=_0x29db36-0x0;var _0x234e87=_0x581b[_0x29db36];return _0x234e87;};'use strict';var _=require('lodash');var util=require(_0xb581('0x0'));var logger=require(_0xb581('0x1'))(_0xb581('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xb581('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./intSalesforceField.attributes');module['exports']=function(_0x25ba6e,_0x1860c2){return _0x25ba6e[_0xb581('0x4')](_0xb581('0x5'),attributes,{'tableName':_0xb581('0x6'),'paranoid':![],'indexes':[{'name':_0xb581('0x7'),'fields':[_0xb581('0x8'),_0xb581('0x9')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/intSalesforceField/intSalesforceField.rpc.js b/server/api/intSalesforceField/intSalesforceField.rpc.js
index e155ed3..4dbdc3e 100644
--- a/server/api/intSalesforceField/intSalesforceField.rpc.js
+++ b/server/api/intSalesforceField/intSalesforceField.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xa571=['request','then','info','SalesforceField,\x20%s,\x20%s','request\x20sent','debug','SalesforceField,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','rpc','jayson/promise','client','http'];(function(_0x57d13b,_0x52d8cb){var _0x467696=function(_0x153000){while(--_0x153000){_0x57d13b['push'](_0x57d13b['shift']());}};_0x467696(++_0x52d8cb);}(_0xa571,0x107));var _0x1a57=function(_0x10c90e,_0x2a0672){_0x10c90e=_0x10c90e-0x0;var _0x2fbfee=_0xa571[_0x10c90e];return _0x2fbfee;};'use strict';var _=require(_0x1a57('0x0'));var util=require(_0x1a57('0x1'));var moment=require(_0x1a57('0x2'));var BPromise=require(_0x1a57('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1a57('0x4'));var db=require(_0x1a57('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x1a57('0x6'));var config=require('../../config/environment');var jayson=require(_0x1a57('0x7'));var client=jayson[_0x1a57('0x8')][_0x1a57('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3c5352,_0x2492f5,_0x924873){return new BPromise(function(_0x5d9f45,_0x3edb40){return client[_0x1a57('0xa')](_0x3c5352,_0x924873)[_0x1a57('0xb')](function(_0x58e266){logger[_0x1a57('0xc')](_0x1a57('0xd'),_0x2492f5,_0x1a57('0xe'));logger[_0x1a57('0xf')](_0x1a57('0x10'),_0x2492f5,_0x1a57('0xe'),JSON[_0x1a57('0x11')](_0x58e266));if(_0x58e266[_0x1a57('0x12')]){if(_0x58e266['error']['code']===0x1f4){logger[_0x1a57('0x12')](_0x1a57('0xd'),_0x2492f5,_0x58e266[_0x1a57('0x12')]['message']);return _0x3edb40(_0x58e266[_0x1a57('0x12')][_0x1a57('0x13')]);}logger['error'](_0x1a57('0xd'),_0x2492f5,_0x58e266['error'][_0x1a57('0x13')]);return _0x5d9f45(_0x58e266[_0x1a57('0x12')][_0x1a57('0x13')]);}else{logger[_0x1a57('0xc')]('SalesforceField,\x20%s,\x20%s',_0x2492f5,_0x1a57('0xe'));_0x5d9f45(_0x58e266['result']['message']);}})[_0x1a57('0x14')](function(_0x1c537f){logger[_0x1a57('0x12')]('SalesforceField,\x20%s,\x20%s',_0x2492f5,_0x1c537f);_0x3edb40(_0x1c537f);});});}
\ No newline at end of file
+var _0xdace=['request\x20sent','debug','stringify','error','code','SalesforceField,\x20%s,\x20%s','message','info','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then'];(function(_0xd0b415,_0x149675){var _0x2bdf2c=function(_0x59fbfa){while(--_0x59fbfa){_0xd0b415['push'](_0xd0b415['shift']());}};_0x2bdf2c(++_0x149675);}(_0xdace,0xc5));var _0xedac=function(_0x37b7b6,_0x165a5c){_0x37b7b6=_0x37b7b6-0x0;var _0x10c4c3=_0xdace[_0x37b7b6];return _0x10c4c3;};'use strict';var _=require(_0xedac('0x0'));var util=require('util');var moment=require(_0xedac('0x1'));var BPromise=require(_0xedac('0x2'));var rs=require(_0xedac('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xedac('0x4'))['db'];var utils=require(_0xedac('0x5'));var logger=require(_0xedac('0x6'))(_0xedac('0x7'));var config=require('../../config/environment');var jayson=require(_0xedac('0x8'));var client=jayson[_0xedac('0x9')][_0xedac('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5ecbd3,_0x4081c6,_0x21440e){return new BPromise(function(_0x162eea,_0x53fa43){return client[_0xedac('0xb')](_0x5ecbd3,_0x21440e)[_0xedac('0xc')](function(_0xc98887){logger['info']('SalesforceField,\x20%s,\x20%s',_0x4081c6,_0xedac('0xd'));logger[_0xedac('0xe')]('SalesforceField,\x20%s,\x20%s,\x20%s',_0x4081c6,'request\x20sent',JSON[_0xedac('0xf')](_0xc98887));if(_0xc98887[_0xedac('0x10')]){if(_0xc98887['error'][_0xedac('0x11')]===0x1f4){logger['error'](_0xedac('0x12'),_0x4081c6,_0xc98887[_0xedac('0x10')][_0xedac('0x13')]);return _0x53fa43(_0xc98887[_0xedac('0x10')][_0xedac('0x13')]);}logger[_0xedac('0x10')](_0xedac('0x12'),_0x4081c6,_0xc98887[_0xedac('0x10')]['message']);return _0x162eea(_0xc98887[_0xedac('0x10')][_0xedac('0x13')]);}else{logger[_0xedac('0x14')](_0xedac('0x12'),_0x4081c6,_0xedac('0xd'));_0x162eea(_0xc98887['result'][_0xedac('0x13')]);}})['catch'](function(_0xddc7b8){logger[_0xedac('0x10')](_0xedac('0x12'),_0x4081c6,_0xddc7b8);_0x53fa43(_0xddc7b8);});});}
\ No newline at end of file
diff --git a/server/api/intServicenowAccount/index.js b/server/api/intServicenowAccount/index.js
index 8a45211..367a8fe 100644
--- a/server/api/intServicenowAccount/index.js
+++ b/server/api/intServicenowAccount/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x3de2=['post','addConfiguration','/:id','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','../../config/environment','./intServicenowAccount.controller','get','isAuthenticated','show','/:id/configurations','getConfigurations'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x3de2,0x79));var _0x23de=function(_0x403c20,_0x4a7b99){_0x403c20=_0x403c20-0x0;var _0x2b271a=_0x3de2[_0x403c20];return _0x2b271a;};'use strict';var multer=require(_0x23de('0x0'));var util=require('util');var path=require(_0x23de('0x1'));var timeout=require(_0x23de('0x2'));var express=require(_0x23de('0x3'));var router=express[_0x23de('0x4')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x23de('0x5'));var controller=require(_0x23de('0x6'));router[_0x23de('0x7')]('/',auth[_0x23de('0x8')](),controller['index']);router[_0x23de('0x7')]('/:id',auth[_0x23de('0x8')](),controller[_0x23de('0x9')]);router[_0x23de('0x7')](_0x23de('0xa'),auth[_0x23de('0x8')](),controller[_0x23de('0xb')]);router[_0x23de('0x7')]('/:id/fields',auth[_0x23de('0x8')](),controller['getFields']);router[_0x23de('0xc')]('/',auth[_0x23de('0x8')](),controller['create']);router['post'](_0x23de('0xa'),auth['isAuthenticated'](),controller[_0x23de('0xd')]);router['put'](_0x23de('0xe'),auth[_0x23de('0x8')](),controller[_0x23de('0xf')]);router[_0x23de('0x10')](_0x23de('0xe'),auth[_0x23de('0x8')](),controller[_0x23de('0x11')]);module[_0x23de('0x12')]=router;
\ No newline at end of file
+var _0x4262=['util','path','express','../../components/auth/service','./intServicenowAccount.controller','get','isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','/:id/fields','getFields','create','post','addConfiguration','update','delete','destroy','exports','multer'];(function(_0x986d0c,_0x4d9432){var _0x5c7169=function(_0x2eb7ef){while(--_0x2eb7ef){_0x986d0c['push'](_0x986d0c['shift']());}};_0x5c7169(++_0x4d9432);}(_0x4262,0x15f));var _0x2426=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0x4262[_0x502c7d];return _0x30b7ed;};'use strict';var multer=require(_0x2426('0x0'));var util=require(_0x2426('0x1'));var path=require(_0x2426('0x2'));var timeout=require('connect-timeout');var express=require(_0x2426('0x3'));var router=express['Router']();var auth=require(_0x2426('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x2426('0x5'));router[_0x2426('0x6')]('/',auth[_0x2426('0x7')](),controller[_0x2426('0x8')]);router['get'](_0x2426('0x9'),auth[_0x2426('0x7')](),controller[_0x2426('0xa')]);router[_0x2426('0x6')](_0x2426('0xb'),auth['isAuthenticated'](),controller[_0x2426('0xc')]);router[_0x2426('0x6')](_0x2426('0xd'),auth[_0x2426('0x7')](),controller[_0x2426('0xe')]);router['post']('/',auth['isAuthenticated'](),controller[_0x2426('0xf')]);router[_0x2426('0x10')](_0x2426('0xb'),auth[_0x2426('0x7')](),controller[_0x2426('0x11')]);router['put'](_0x2426('0x9'),auth[_0x2426('0x7')](),controller[_0x2426('0x12')]);router[_0x2426('0x13')]('/:id',auth[_0x2426('0x7')](),controller[_0x2426('0x14')]);module[_0x2426('0x15')]=router;
\ No newline at end of file
diff --git a/server/api/intServicenowAccount/intServicenowAccount.attributes.js b/server/api/intServicenowAccount/intServicenowAccount.attributes.js
index ecbca31..6e43284 100644
--- a/server/api/intServicenowAccount/intServicenowAccount.attributes.js
+++ b/server/api/intServicenowAccount/intServicenowAccount.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x6dc5=['exports','STRING','remoteUri','sequelize'];(function(_0x1b0196,_0x46b5fc){var _0x79d318=function(_0x246e15){while(--_0x246e15){_0x1b0196['push'](_0x1b0196['shift']());}};_0x79d318(++_0x46b5fc);}(_0x6dc5,0x18b));var _0x56dc=function(_0x5234c2,_0x5f4bfe){_0x5234c2=_0x5234c2-0x0;var _0x53a9c5=_0x6dc5[_0x5234c2];return _0x53a9c5;};'use strict';var Sequelize=require(_0x56dc('0x0'));module[_0x56dc('0x1')]={'name':{'type':Sequelize[_0x56dc('0x2')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x56dc('0x2')],'unique':'username'},'password':{'type':Sequelize[_0x56dc('0x2')]},'email':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x56dc('0x2')],'unique':_0x56dc('0x3')},'serverUrl':{'type':Sequelize[_0x56dc('0x2')]}};
\ No newline at end of file
+var _0x26a3=['remoteUri','sequelize','exports','STRING'];(function(_0x356866,_0xece868){var _0x1bfad3=function(_0x2bd143){while(--_0x2bd143){_0x356866['push'](_0x356866['shift']());}};_0x1bfad3(++_0xece868);}(_0x26a3,0x155));var _0x326a=function(_0x2f6a61,_0x3953fa){_0x2f6a61=_0x2f6a61-0x0;var _0x414911=_0x26a3[_0x2f6a61];return _0x414911;};'use strict';var Sequelize=require(_0x326a('0x0'));module[_0x326a('0x1')]={'name':{'type':Sequelize[_0x326a('0x2')]},'description':{'type':Sequelize[_0x326a('0x2')]},'username':{'type':Sequelize[_0x326a('0x2')],'unique':'username'},'password':{'type':Sequelize[_0x326a('0x2')]},'email':{'type':Sequelize[_0x326a('0x2')]},'remoteUri':{'type':Sequelize[_0x326a('0x2')],'unique':_0x326a('0x3')},'serverUrl':{'type':Sequelize[_0x326a('0x2')]}};
\ No newline at end of file
diff --git a/server/api/intServicenowAccount/intServicenowAccount.controller.js b/server/api/intServicenowAccount/intServicenowAccount.controller.js
index ff6cc8f..ceed828 100644
--- a/server/api/intServicenowAccount/intServicenowAccount.controller.js
+++ b/server/api/intServicenowAccount/intServicenowAccount.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x99e9=['closed_by','sys_id','contact_type','urgency','problem_id','company','activity_due','assigned_to','comments','sla_due','approval','comments_and_work_notes','due_date','reopen_count','sys_tags','upon_approval','correlation_id','location','email','remoteUri','serverUrl','substring','lastIndexOf','format','%s/api/now/doc/table/schema/','%s/api/now/table/','username','password','GET','incident?sysparm_display_value=all','log','incident\x20table\x20objects','assign','includes','forEach','internalType','label','push','all','TCL:\x20_object','remove','TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom','ServiceNow\x20error:\x20','statusCode','stack','send','boolean','True','true','False','inactive','false','value','html-pdf','rimraf','zip-dir','request-promise','moment','bluebird','util','lodash','squel','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','../../components/integrations/configuration','jayson/promise','http','test','Sequelize','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','request\x20sent','ServicenowAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','ServicenowAccount,\x20%s,\x20%s','result','catch','status','end','json','offset','limit','set','apply','reject','save','update','destroy','sendStatus','name','index','map','ServicenowAccount','rawAttributes','fieldName','type','key','model','query','keys','filters','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','filter','options','count','includeAll','findAll','rows','show','params','intersection','find','create','body','findOne','ServicenowConfiguration','pick','getConfigurations','addConfiguration','Subjects','getSubjects','channel','Descriptions','getDescriptions','getFields','hold_reason','subcategory','close_code','notify','incident_state','severity','category','parent','caused_by','watch_list','upon_reject','sys_updated_on','child_incidents','resolved_by','sys_updated_by','opened_by','user_input','sys_created_on','sys_domain','state','sys_created_by','knowledge','calendar_stc','closed_at','cmdb_ci','delivery_plan','impact','work_notes_list','business_service','priority','sys_domain_path','rfc','time_worked','expected_start','opened_at','business_duration','group_list','work_end','reopened_time','resolved_at','caller_id','work_notes','short_description','correlation_display','work_start','assignment_group','business_stc','description','calendar_duration','sys_class_name','close_notes'];(function(_0x88cd7b,_0x4c884c){var _0x56fcc8=function(_0x513b3d){while(--_0x513b3d){_0x88cd7b['push'](_0x88cd7b['shift']());}};_0x56fcc8(++_0x4c884c);}(_0x99e9,0x1bf));var _0x999e=function(_0x43186d,_0x4b40ec){_0x43186d=_0x43186d-0x0;var _0x5f562c=_0x99e9[_0x43186d];return _0x5f562c;};'use strict';var pdf=require(_0x999e('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x999e('0x1'));var zipdir=require(_0x999e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x999e('0x3'));var moment=require(_0x999e('0x4'));var BPromise=require(_0x999e('0x5'));var Mustache=require('mustache');var util=require(_0x999e('0x6'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x999e('0x7'));var squel=require(_0x999e('0x8'));var crypto=require('crypto');var jsforce=require(_0x999e('0x9'));var deskjs=require(_0x999e('0xa'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x999e('0xb'));var authService=require(_0x999e('0xc'));var qs=require('../../components/parsers/qs');var as=require(_0x999e('0xd'));var hardwareService=require(_0x999e('0xe'));var logger=require(_0x999e('0xf'))('api');var utils=require(_0x999e('0x10'));var config=require('../../config/environment');var db=require(_0x999e('0x11'))['db'];var integrations=require(_0x999e('0x12'));var jayson=require(_0x999e('0x13'));var client=jayson['client'][_0x999e('0x14')]({'port':0x232a});function checkPasswordPattern(_0xec715f,_0x5b1e15,_0x44fc23){if(_0x44fc23){var _0x393c2e=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x393c2e[_0x999e('0x15')](_0x5b1e15)){return _0xec715f;}else{throw new db[(_0x999e('0x16'))]['ValidationError'](_0x999e('0x17'));}}else{return _0xec715f;}}function respondWithRpcPromise(_0x20df91,_0x5ceaa6,_0x2a2c34,_0x481cdf){return new BPromise(function(_0x5eafe6,_0x316d30){var _0xc3fdcd=_0x481cdf||client;return _0xc3fdcd[_0x999e('0x18')](_0x20df91,_0x2a2c34)[_0x999e('0x19')](function(_0x221af5){logger[_0x999e('0x1a')]('ServicenowAccount,\x20%s,\x20%s',_0x5ceaa6,_0x999e('0x1b'));logger['debug'](_0x999e('0x1c'),_0x5ceaa6,'request\x20sent',JSON[_0x999e('0x1d')](_0x221af5));if(_0x221af5['error']){if(_0x221af5[_0x999e('0x1e')][_0x999e('0x1f')]===0x1f4){logger[_0x999e('0x1e')]('ServicenowAccount,\x20%s,\x20%s',_0x5ceaa6,_0x221af5[_0x999e('0x1e')][_0x999e('0x20')]);return _0x316d30(_0x221af5[_0x999e('0x1e')][_0x999e('0x20')]);}logger[_0x999e('0x1e')]('ServicenowAccount,\x20%s,\x20%s',_0x5ceaa6,_0x221af5['error'][_0x999e('0x20')]);return _0x5eafe6(_0x221af5['error'][_0x999e('0x20')]);}else{logger['info'](_0x999e('0x21'),_0x5ceaa6,'request\x20sent');_0x5eafe6(_0x221af5[_0x999e('0x22')]['message']);}})[_0x999e('0x23')](function(_0x1d1739){logger[_0x999e('0x1e')](_0x999e('0x21'),_0x5ceaa6,_0x1d1739);_0x316d30(_0x1d1739);});});}function respondWithStatusCode(_0x2697f1,_0x251ae5){_0x251ae5=_0x251ae5||0xcc;return function(_0x514bef){if(_0x514bef){return _0x2697f1['sendStatus'](_0x251ae5);}return _0x2697f1[_0x999e('0x24')](_0x251ae5)[_0x999e('0x25')]();};}function respondWithResult(_0x3d3cbd,_0x3e151b){_0x3e151b=_0x3e151b||0xc8;return function(_0x1a6606){if(_0x1a6606){return _0x3d3cbd['status'](_0x3e151b)[_0x999e('0x26')](_0x1a6606);}};}function respondWithFilteredResult(_0x4240ca,_0x5d34cd){return function(_0x2818a9){if(_0x2818a9){var _0x2a59ba=_0x2818a9['count'],_0x30a106=_0x5d34cd['offset'],_0x49694b=_0x5d34cd[_0x999e('0x27')]+_0x5d34cd[_0x999e('0x28')],_0x2fc0cf;if(_0x49694b>=_0x2a59ba){_0x49694b=_0x2a59ba;_0x2fc0cf=0xc8;}else{_0x2fc0cf=0xce;}_0x4240ca[_0x999e('0x24')](_0x2fc0cf);return _0x4240ca[_0x999e('0x29')]('Content-Range',_0x30a106+'-'+_0x49694b+'/'+_0x2a59ba)['json'](_0x2818a9);}return null;};}function patchUpdates(_0x5c7cdb){return function(_0x49328a){try{jsonpatch[_0x999e('0x2a')](_0x49328a,_0x5c7cdb,!![]);}catch(_0x442c15){return BPromise[_0x999e('0x2b')](_0x442c15);}return _0x49328a[_0x999e('0x2c')]();};}function saveUpdates(_0x4ae12a,_0x168391){return function(_0x4b4dd2){if(_0x4b4dd2){return _0x4b4dd2[_0x999e('0x2d')](_0x4ae12a)[_0x999e('0x19')](function(_0x1c7e57){return _0x1c7e57;});}return null;};}function removeEntity(_0x279444,_0x2b855d){return function(_0x3b32d5){if(_0x3b32d5){return _0x3b32d5[_0x999e('0x2e')]()[_0x999e('0x19')](function(){_0x279444[_0x999e('0x24')](0xcc)[_0x999e('0x25')]();});}};}function handleEntityNotFound(_0x4edb5f,_0x32803c){return function(_0x1f29b9){if(!_0x1f29b9){_0x4edb5f[_0x999e('0x2f')](0x194);}return _0x1f29b9;};}function handleError(_0x302876,_0x5518aa){_0x5518aa=_0x5518aa||0x1f4;return function(_0x308edc){logger[_0x999e('0x1e')](_0x308edc['stack']);if(_0x308edc[_0x999e('0x30')]){delete _0x308edc[_0x999e('0x30')];}_0x302876[_0x999e('0x24')](_0x5518aa)['send'](_0x308edc);};}exports[_0x999e('0x31')]=function(_0x1f90fc,_0x5d2875){var _0x4e717d={},_0x1d53d8={},_0x2611fd={'count':0x0,'rows':[]};var _0x210c58=_[_0x999e('0x32')](db[_0x999e('0x33')][_0x999e('0x34')],function(_0x1ed1a3){return{'name':_0x1ed1a3[_0x999e('0x35')],'type':_0x1ed1a3[_0x999e('0x36')][_0x999e('0x37')]};});_0x1d53d8[_0x999e('0x38')]=_[_0x999e('0x32')](_0x210c58,_0x999e('0x30'));_0x1d53d8[_0x999e('0x39')]=_[_0x999e('0x3a')](_0x1f90fc['query']);_0x1d53d8[_0x999e('0x3b')]=_['intersection'](_0x1d53d8[_0x999e('0x38')],_0x1d53d8[_0x999e('0x39')]);_0x4e717d['attributes']=_['intersection'](_0x1d53d8['model'],qs[_0x999e('0x3c')](_0x1f90fc[_0x999e('0x39')][_0x999e('0x3c')]));_0x4e717d[_0x999e('0x3d')]=_0x4e717d[_0x999e('0x3d')][_0x999e('0x3e')]?_0x4e717d[_0x999e('0x3d')]:_0x1d53d8[_0x999e('0x38')];if(!_0x1f90fc[_0x999e('0x39')][_0x999e('0x3f')](_0x999e('0x40'))){_0x4e717d[_0x999e('0x28')]=qs[_0x999e('0x28')](_0x1f90fc[_0x999e('0x39')][_0x999e('0x28')]);_0x4e717d[_0x999e('0x27')]=qs[_0x999e('0x27')](_0x1f90fc['query'][_0x999e('0x27')]);}_0x4e717d[_0x999e('0x41')]=qs[_0x999e('0x42')](_0x1f90fc[_0x999e('0x39')][_0x999e('0x42')]);_0x4e717d[_0x999e('0x43')]=qs[_0x999e('0x3b')](_['pick'](_0x1f90fc[_0x999e('0x39')],_0x1d53d8[_0x999e('0x3b')]),_0x210c58);if(_0x1f90fc[_0x999e('0x39')]['filter']){_0x4e717d[_0x999e('0x43')]=_[_0x999e('0x44')](_0x4e717d[_0x999e('0x43')],{'$or':_[_0x999e('0x32')](_0x210c58,function(_0x18969d){if(_0x18969d[_0x999e('0x36')]!==_0x999e('0x45')){var _0xfb243a={};_0xfb243a[_0x18969d[_0x999e('0x30')]]={'$like':'%'+_0x1f90fc['query'][_0x999e('0x46')]+'%'};return _0xfb243a;}})});}_0x4e717d=_[_0x999e('0x44')]({},_0x4e717d,_0x1f90fc[_0x999e('0x47')]);var _0x4f697b={'where':_0x4e717d['where']};return db[_0x999e('0x33')][_0x999e('0x48')](_0x4f697b)[_0x999e('0x19')](function(_0x4d5747){_0x2611fd[_0x999e('0x48')]=_0x4d5747;if(_0x1f90fc[_0x999e('0x39')][_0x999e('0x49')]){_0x4e717d['include']=[{'all':!![]}];}return db[_0x999e('0x33')][_0x999e('0x4a')](_0x4e717d);})[_0x999e('0x19')](function(_0x5cf710){_0x2611fd[_0x999e('0x4b')]=_0x5cf710;return _0x2611fd;})['then'](respondWithFilteredResult(_0x5d2875,_0x4e717d))['catch'](handleError(_0x5d2875,null));};exports[_0x999e('0x4c')]=function(_0x2a5d1e,_0xdb5a5a){var _0x3fe3c9={'raw':![],'where':{'id':_0x2a5d1e[_0x999e('0x4d')]['id']}},_0x2b1296={};_0x2b1296['model']=_[_0x999e('0x3a')](db[_0x999e('0x33')][_0x999e('0x34')]);_0x2b1296['query']=_[_0x999e('0x3a')](_0x2a5d1e[_0x999e('0x39')]);_0x2b1296[_0x999e('0x3b')]=_['intersection'](_0x2b1296[_0x999e('0x38')],_0x2b1296['query']);_0x3fe3c9[_0x999e('0x3d')]=_[_0x999e('0x4e')](_0x2b1296['model'],qs['fields'](_0x2a5d1e[_0x999e('0x39')][_0x999e('0x3c')]));_0x3fe3c9[_0x999e('0x3d')]=_0x3fe3c9[_0x999e('0x3d')]['length']?_0x3fe3c9[_0x999e('0x3d')]:_0x2b1296[_0x999e('0x38')];if(_0x2a5d1e[_0x999e('0x39')][_0x999e('0x49')]){_0x3fe3c9['include']=[{'all':!![]}];}_0x3fe3c9=_[_0x999e('0x44')]({},_0x3fe3c9,_0x2a5d1e['options']);return db[_0x999e('0x33')][_0x999e('0x4f')](_0x3fe3c9)['then'](handleEntityNotFound(_0xdb5a5a,null))[_0x999e('0x19')](respondWithResult(_0xdb5a5a,null))['catch'](handleError(_0xdb5a5a,null));};exports[_0x999e('0x50')]=function(_0xb27f9d,_0x8bc1ff){return db['ServicenowAccount'][_0x999e('0x50')](_0xb27f9d[_0x999e('0x51')],{})[_0x999e('0x19')](respondWithResult(_0x8bc1ff,0xc9))['catch'](handleError(_0x8bc1ff,null));};exports[_0x999e('0x2d')]=function(_0x2bced0,_0x4bbbf9){if(_0x2bced0['body']['id']){delete _0x2bced0[_0x999e('0x51')]['id'];}return db['ServicenowAccount'][_0x999e('0x4f')]({'where':{'id':_0x2bced0[_0x999e('0x4d')]['id']}})[_0x999e('0x19')](handleEntityNotFound(_0x4bbbf9,null))['then'](saveUpdates(_0x2bced0[_0x999e('0x51')],null))[_0x999e('0x19')](respondWithResult(_0x4bbbf9,null))['catch'](handleError(_0x4bbbf9,null));};exports['destroy']=function(_0x57a46c,_0x39a6c3){return db[_0x999e('0x33')][_0x999e('0x4f')]({'where':{'id':_0x57a46c[_0x999e('0x4d')]['id']}})['then'](handleEntityNotFound(_0x39a6c3,null))[_0x999e('0x19')](removeEntity(_0x39a6c3,null))[_0x999e('0x23')](handleError(_0x39a6c3,null));};exports['getConfigurations']=function(_0x5f428e,_0x5417cc,_0x313f5f){var _0x2d5697={};var _0x387556={};var _0x2b9014;var _0x8d5690;return db[_0x999e('0x33')][_0x999e('0x52')]({'where':{'id':_0x5f428e[_0x999e('0x4d')]['id']}})['then'](handleEntityNotFound(_0x5417cc,null))[_0x999e('0x19')](function(_0x4fbd14){if(_0x4fbd14){_0x2b9014=_0x4fbd14;_0x387556[_0x999e('0x38')]=_[_0x999e('0x3a')](db[_0x999e('0x53')][_0x999e('0x34')]);_0x387556[_0x999e('0x39')]=_[_0x999e('0x3a')](_0x5f428e[_0x999e('0x39')]);_0x387556[_0x999e('0x3b')]=_[_0x999e('0x4e')](_0x387556[_0x999e('0x38')],_0x387556[_0x999e('0x39')]);_0x2d5697[_0x999e('0x3d')]=_[_0x999e('0x4e')](_0x387556[_0x999e('0x38')],qs['fields'](_0x5f428e['query'][_0x999e('0x3c')]));_0x2d5697[_0x999e('0x3d')]=_0x2d5697[_0x999e('0x3d')][_0x999e('0x3e')]?_0x2d5697['attributes']:_0x387556['model'];_0x2d5697[_0x999e('0x41')]=qs[_0x999e('0x42')](_0x5f428e[_0x999e('0x39')][_0x999e('0x42')]);_0x2d5697[_0x999e('0x43')]=qs[_0x999e('0x3b')](_[_0x999e('0x54')](_0x5f428e['query'],_0x387556[_0x999e('0x3b')]));if(_0x5f428e[_0x999e('0x39')]['filter']){_0x2d5697[_0x999e('0x43')]=_['merge'](_0x2d5697[_0x999e('0x43')],{'$or':_[_0x999e('0x32')](_0x2d5697[_0x999e('0x3d')],function(_0x4df635){var _0x4e0d70={};_0x4e0d70[_0x4df635]={'$like':'%'+_0x5f428e['query'][_0x999e('0x46')]+'%'};return _0x4e0d70;})});}_0x2d5697=_[_0x999e('0x44')]({},_0x2d5697,_0x5f428e[_0x999e('0x47')]);return _0x2b9014[_0x999e('0x55')](_0x2d5697);}})[_0x999e('0x19')](function(_0x4ce499){if(_0x4ce499){_0x8d5690=_0x4ce499['length'];if(!_0x5f428e[_0x999e('0x39')][_0x999e('0x3f')](_0x999e('0x40'))){_0x2d5697[_0x999e('0x28')]=qs['limit'](_0x5f428e[_0x999e('0x39')][_0x999e('0x28')]);_0x2d5697['offset']=qs['offset'](_0x5f428e['query'][_0x999e('0x27')]);}return _0x2b9014[_0x999e('0x55')](_0x2d5697);}})['then'](function(_0x72ff12){if(_0x72ff12){return _0x72ff12?{'count':_0x8d5690,'rows':_0x72ff12}:null;}})[_0x999e('0x19')](respondWithResult(_0x5417cc,null))['catch'](handleError(_0x5417cc,null));};exports[_0x999e('0x56')]=function(_0x53a98c,_0x34f993,_0x3fd9b4){if(_0x53a98c['body']['id']){delete _0x53a98c[_0x999e('0x51')]['id'];}return db[_0x999e('0x33')]['findOne']({'where':{'id':_0x53a98c[_0x999e('0x4d')]['id']}})['then'](handleEntityNotFound(_0x34f993,null))[_0x999e('0x19')](function(_0x5ce398){if(_0x5ce398){_0x53a98c[_0x999e('0x51')]['AccountId']=_0x5ce398['id'];_0x53a98c[_0x999e('0x51')][_0x999e('0x57')]=integrations[_0x999e('0x58')](_0x53a98c[_0x999e('0x51')][_0x999e('0x59')],_0x53a98c['body']['type']);_0x53a98c[_0x999e('0x51')][_0x999e('0x5a')]=integrations[_0x999e('0x5b')](_0x53a98c['body']['channel'],_0x53a98c[_0x999e('0x51')]['type']);return db[_0x999e('0x53')]['create'](_0x53a98c[_0x999e('0x51')],{'include':[{'model':db['ServicenowField'],'as':_0x999e('0x57')},{'model':db['ServicenowField'],'as':_0x999e('0x5a')}]});}return null;})[_0x999e('0x19')](respondWithResult(_0x34f993,null))[_0x999e('0x23')](handleError(_0x34f993,null));};exports[_0x999e('0x5c')]=function(_0x48ef0d,_0x4a1156,_0x3624b8){var _0x27050d=['made_sla',_0x999e('0x5d'),'knowledge',_0x999e('0x5e'),_0x999e('0x5f'),_0x999e('0x60'),_0x999e('0x61'),_0x999e('0x62'),_0x999e('0x63')];var _0x12d537=[_0x999e('0x64'),'made_sla',_0x999e('0x65'),_0x999e('0x66'),_0x999e('0x67'),_0x999e('0x68'),_0x999e('0x69'),_0x999e('0x5d'),'approval_history','number',_0x999e('0x6a'),_0x999e('0x6b'),_0x999e('0x6c'),_0x999e('0x6d'),_0x999e('0x6e'),_0x999e('0x6f'),_0x999e('0x70'),_0x999e('0x71'),_0x999e('0x72'),_0x999e('0x41'),_0x999e('0x73'),_0x999e('0x74'),_0x999e('0x75'),_0x999e('0x76'),_0x999e('0x77'),'active',_0x999e('0x78'),_0x999e('0x79'),_0x999e('0x7a'),_0x999e('0x7b'),_0x999e('0x7c'),_0x999e('0x7d'),_0x999e('0x7e'),_0x999e('0x7f'),_0x999e('0x80'),_0x999e('0x81'),_0x999e('0x82'),_0x999e('0x83'),_0x999e('0x84'),_0x999e('0x85'),'approval_set',_0x999e('0x5e'),_0x999e('0x86'),_0x999e('0x87'),_0x999e('0x5f'),_0x999e('0x88'),'delivery_task',_0x999e('0x89'),_0x999e('0x8a'),_0x999e('0x8b'),'additional_assignee_list',_0x999e('0x8c'),_0x999e('0x8d'),_0x999e('0x60'),_0x999e('0x8e'),_0x999e('0x8f'),_0x999e('0x90'),'follow_up','parent_incident',_0x999e('0x91'),_0x999e('0x92'),'reopened_by',_0x999e('0x61'),_0x999e('0x93'),_0x999e('0x94'),_0x999e('0x95'),'reassignment_count',_0x999e('0x96'),_0x999e('0x97'),_0x999e('0x62'),_0x999e('0x98'),_0x999e('0x99'),_0x999e('0x9a'),_0x999e('0x9b'),_0x999e('0x9c'),'sys_mod_count',_0x999e('0x9d'),_0x999e('0x9e'),'escalation',_0x999e('0x9f'),_0x999e('0xa0'),_0x999e('0xa1'),_0x999e('0x63')];var _0x118bab='';var _0x33e647='';var _0x25ff42=[];var _0x25e517='';var _0x1342f5='';var _0x3ecabf=[];var _0xfd0835='';var _0x43668e='';var _0x1f6cb3={};var _0x23d41b='';return db[_0x999e('0x33')][_0x999e('0x52')]({'where':{'id':_0x48ef0d[_0x999e('0x4d')]['id']},'attributes':['id','username','password',_0x999e('0xa2'),_0x999e('0xa3'),_0x999e('0xa4')]})[_0x999e('0x19')](handleEntityNotFound(_0x4a1156,null))['then'](function(_0x294ff3){if(_0x294ff3){_0x23d41b=_0x294ff3[_0x999e('0xa3')];var _0x2bfc1b=_0x23d41b['slice'](-0x1);if(_0x2bfc1b==='/'){_0x23d41b=_0x23d41b[_0x999e('0xa5')](0x0,_0x23d41b[_0x999e('0xa6')](_0x2bfc1b));}_0x43668e=util[_0x999e('0xa7')](_0x999e('0xa8'),_0x23d41b);_0xfd0835=util[_0x999e('0xa7')](_0x999e('0xa9'),_0x23d41b);_0x1f6cb3={'user':_0x294ff3[_0x999e('0xaa')],'pass':_0x294ff3[_0x999e('0xab')]};var _0x25150b={'method':_0x999e('0xac'),'uri':_0x43668e+_0x999e('0xad'),'auth':_0x1f6cb3,'json':!![]};return rp(_0x25150b);}})[_0x999e('0x19')](function(_0xc50d7a){if(_0xc50d7a[_0x999e('0x22')][_0x999e('0x3e')]>0x0){_0x118bab=_0xc50d7a[_0x999e('0x22')];}console[_0x999e('0xae')](_0x999e('0xaf'),_0x118bab);_0x3ecabf=[];_0x33e647=Object[_0x999e('0xb0')]([],_0x118bab);_['remove'](_0x33e647,function(_0x2cd8c0){return!_0x27050d[_0x999e('0xb1')](_0x2cd8c0['name']);});_0x33e647[_0x999e('0xb2')](function(_0x5a4ddc){var _0x1758f3=createFieldObject(_0xfd0835,_0x1f6cb3,_0x5a4ddc[_0x999e('0xb3')],_0x5a4ddc[_0x999e('0x30')],_0x5a4ddc[_0x999e('0xb4')],![]);_0x3ecabf[_0x999e('0xb5')](_0x1758f3);});return Promise[_0x999e('0xb6')](_0x3ecabf);})[_0x999e('0x19')](function(_0x3b6f0f){_0x25ff42=_0x3b6f0f;_0x25e517=Object['assign']([],_0x118bab);console['log'](_0x999e('0xb7'),_0x118bab);_[_0x999e('0xb8')](_0x25e517,function(_0x15656d){return _0x12d537[_0x999e('0xb1')](_0x15656d['name']);});console[_0x999e('0xae')](_0x999e('0xb9'),_0x25e517);_0x3ecabf=[];_0x25e517['forEach'](function(_0x20ed50){var _0x41b524=createFieldObject(_0xfd0835,_0x1f6cb3,_0x20ed50[_0x999e('0xb3')],_0x20ed50[_0x999e('0x30')],_0x20ed50[_0x999e('0xb4')],!![]);_0x3ecabf[_0x999e('0xb5')](_0x41b524);});return Promise[_0x999e('0xb6')](_0x3ecabf);})[_0x999e('0x19')](function(_0x50d71f){_0x1342f5=_0x50d71f;var _0x3ebe3d=_0x25ff42['concat'](_0x1342f5);return{'count':_0x3ebe3d['length'],'rows':_0x3ebe3d};})[_0x999e('0x19')](respondWithResult(_0x4a1156,null))[_0x999e('0x23')](function(_0x3d8810){console['log'](_0x999e('0xba')+_0x3d8810);var _0x19a541=_0x48ef0d[_0x999e('0x39')][_0x999e('0x15')]?0x1f4:_0x3d8810[_0x999e('0xbb')]||0x1f4;logger[_0x999e('0x1e')](_0x3d8810[_0x999e('0xbc')]);delete _0x3d8810[_0x999e('0x30')];if(_0x19a541===0x191){_0x19a541=0x190;}_0x4a1156[_0x999e('0x24')](_0x19a541)[_0x999e('0xbd')](_0x48ef0d[_0x999e('0x39')]['test']?{'message':'Wrong\x20credentials','statusCode':_0x3d8810['statusCode']}:_0x3d8810);});};function createFieldObject(_0x36757f,_0x15b816,_0x43608d,_0x3189e4,_0x3f55c1,_0x4658a5){return new Promise(function(_0x36cb47,_0x42d239){var _0x41f9fa={'id':_0x3189e4,'name':_0x3f55c1,'custom':_0x4658a5};if(_0x43608d===_0x999e('0xbe')){_0x41f9fa['options']=[{'name':_0x999e('0xbf'),'value':_0x999e('0xc0')},{'name':_0x999e('0xc1'),'value':'false'}];_0x36cb47(_0x41f9fa);}else{var _0x151efe={'method':_0x999e('0xac'),'uri':_0x36757f+'sys_choice?sysparm_query=name=incident^element='+_0x3189e4,'auth':_0x15b816,'json':!![]};return rp(_0x151efe)[_0x999e('0x19')](function(_0x2646e9){var _0x31a22e=[];if(_0x2646e9['result'][_0x999e('0x3e')]>0x0){_0x2646e9[_0x999e('0x22')]['forEach'](function(_0x37213e){if(_0x37213e[_0x999e('0xc2')]===_0x999e('0xc3')){var _0x135bcd={'name':_0x37213e[_0x999e('0xb4')],'value':_0x37213e[_0x999e('0xc4')]};_0x31a22e[_0x999e('0xb5')](_0x135bcd);}});}_0x41f9fa[_0x999e('0x47')]=_0x31a22e;if(_0x41f9fa[_0x999e('0x47')][_0x999e('0x3e')]>0x0){_0x36cb47(_0x41f9fa);}else{if(_0x4658a5==![]){_0x36cb47();}else{_0x36cb47(_0x41f9fa);}}});}});}
\ No newline at end of file
+var _0x4bce=['ServicenowConfiguration','getConfigurations','hasOwnProperty','addConfiguration','findOne','AccountId','getSubjects','channel','getDescriptions','ServicenowField','Subjects','made_sla','subcategory','close_code','notify','incident_state','severity','category','caused_by','watch_list','upon_reject','sys_updated_on','child_incidents','number','resolved_by','sys_updated_by','opened_by','sys_created_on','state','sys_created_by','closed_at','delivery_plan','impact','active','work_notes_list','business_service','priority','sys_domain_path','rfc','time_worked','expected_start','opened_at','work_end','reopened_time','caller_id','work_notes','short_description','correlation_display','delivery_task','work_start','assignment_group','additional_assignee_list','description','calendar_duration','sys_class_name','close_notes','closed_by','follow_up','parent_incident','contact_type','urgency','problem_id','reassignment_count','activity_due','comments','sla_due','approval','comments_and_work_notes','due_date','sys_mod_count','sys_tags','location','username','password','email','remoteUri','serverUrl','slice','lastIndexOf','format','%s/api/now/doc/table/schema/','%s/api/now/table/','incident?sysparm_display_value=all','incident\x20table\x20objects','assign','remove','includes','internalType','label','push','log','TCL:\x20_object','forEach','concat','ServiceNow\x20error:\x20','statusCode','Wrong\x20credentials','True','false','sys_choice?sysparm_query=name=incident^element=','inactive','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../mysqldb','../../components/integrations/configuration','jayson/promise','client','http','test','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','ServicenowAccount,\x20%s,\x20%s','request\x20sent','debug','ServicenowAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','end','offset','limit','set','Content-Range','apply','reject','save','update','stack','name','send','index','map','ServicenowAccount','rawAttributes','fieldName','key','model','query','filters','attributes','intersection','fields','nolimit','order','sort','pick','filter','merge','where','type','options','count','includeAll','include','rows','params','keys','length','find','create','body','destroy'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4bce,0x1e5));var _0xe4bc=function(_0xa8883,_0x1f107f){_0xa8883=_0xa8883-0x0;var _0x479426=_0x4bce[_0xa8883];return _0x479426;};'use strict';var pdf=require(_0xe4bc('0x0'));var emlformat=require(_0xe4bc('0x1'));var rimraf=require(_0xe4bc('0x2'));var zipdir=require(_0xe4bc('0x3'));var jsonpatch=require(_0xe4bc('0x4'));var rp=require(_0xe4bc('0x5'));var moment=require(_0xe4bc('0x6'));var BPromise=require(_0xe4bc('0x7'));var Mustache=require(_0xe4bc('0x8'));var util=require(_0xe4bc('0x9'));var path=require('path');var sox=require(_0xe4bc('0xa'));var csv=require(_0xe4bc('0xb'));var ejs=require(_0xe4bc('0xc'));var fs=require('fs');var _=require(_0xe4bc('0xd'));var squel=require(_0xe4bc('0xe'));var crypto=require(_0xe4bc('0xf'));var jsforce=require(_0xe4bc('0x10'));var deskjs=require(_0xe4bc('0x11'));var toCsv=require(_0xe4bc('0xb'));var querystring=require('querystring');var Papa=require(_0xe4bc('0x12'));var Redis=require(_0xe4bc('0x13'));var authService=require(_0xe4bc('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0xe4bc('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xe4bc('0x16'))(_0xe4bc('0x17'));var utils=require(_0xe4bc('0x18'));var config=require('../../config/environment');var db=require(_0xe4bc('0x19'))['db'];var integrations=require(_0xe4bc('0x1a'));var jayson=require(_0xe4bc('0x1b'));var client=jayson[_0xe4bc('0x1c')][_0xe4bc('0x1d')]({'port':0x232a});function checkPasswordPattern(_0x5609fa,_0x10f653,_0x30939c){if(_0x30939c){var _0x42a8ce=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x42a8ce[_0xe4bc('0x1e')](_0x10f653)){return _0x5609fa;}else{throw new db['Sequelize'][(_0xe4bc('0x1f'))](_0xe4bc('0x20'));}}else{return _0x5609fa;}}function respondWithRpcPromise(_0x60145c,_0x138983,_0x3515b1,_0x4c63bc){return new BPromise(function(_0x370827,_0x59d913){var _0x65343e=_0x4c63bc||client;return _0x65343e[_0xe4bc('0x21')](_0x60145c,_0x3515b1)[_0xe4bc('0x22')](function(_0xb76835){logger['info'](_0xe4bc('0x23'),_0x138983,_0xe4bc('0x24'));logger[_0xe4bc('0x25')](_0xe4bc('0x26'),_0x138983,_0xe4bc('0x24'),JSON[_0xe4bc('0x27')](_0xb76835));if(_0xb76835[_0xe4bc('0x28')]){if(_0xb76835[_0xe4bc('0x28')][_0xe4bc('0x29')]===0x1f4){logger[_0xe4bc('0x28')](_0xe4bc('0x23'),_0x138983,_0xb76835[_0xe4bc('0x28')][_0xe4bc('0x2a')]);return _0x59d913(_0xb76835[_0xe4bc('0x28')]['message']);}logger[_0xe4bc('0x28')]('ServicenowAccount,\x20%s,\x20%s',_0x138983,_0xb76835[_0xe4bc('0x28')][_0xe4bc('0x2a')]);return _0x370827(_0xb76835['error'][_0xe4bc('0x2a')]);}else{logger['info'](_0xe4bc('0x23'),_0x138983,'request\x20sent');_0x370827(_0xb76835[_0xe4bc('0x2b')][_0xe4bc('0x2a')]);}})[_0xe4bc('0x2c')](function(_0x44eab2){logger[_0xe4bc('0x28')](_0xe4bc('0x23'),_0x138983,_0x44eab2);_0x59d913(_0x44eab2);});});}function respondWithStatusCode(_0x3d1ed4,_0x48951d){_0x48951d=_0x48951d||0xcc;return function(_0x4658f2){if(_0x4658f2){return _0x3d1ed4[_0xe4bc('0x2d')](_0x48951d);}return _0x3d1ed4[_0xe4bc('0x2e')](_0x48951d)[_0xe4bc('0x2f')]();};}function respondWithResult(_0x4b8350,_0x4de5f3){_0x4de5f3=_0x4de5f3||0xc8;return function(_0x513111){if(_0x513111){return _0x4b8350[_0xe4bc('0x2e')](_0x4de5f3)['json'](_0x513111);}};}function respondWithFilteredResult(_0x49ece7,_0x4f08ce){return function(_0x4cd3db){if(_0x4cd3db){var _0x4e2813=_0x4cd3db['count'],_0x3a1eea=_0x4f08ce['offset'],_0x45de75=_0x4f08ce[_0xe4bc('0x30')]+_0x4f08ce[_0xe4bc('0x31')],_0x2e5eb1;if(_0x45de75>=_0x4e2813){_0x45de75=_0x4e2813;_0x2e5eb1=0xc8;}else{_0x2e5eb1=0xce;}_0x49ece7[_0xe4bc('0x2e')](_0x2e5eb1);return _0x49ece7[_0xe4bc('0x32')](_0xe4bc('0x33'),_0x3a1eea+'-'+_0x45de75+'/'+_0x4e2813)['json'](_0x4cd3db);}return null;};}function patchUpdates(_0x12a47b){return function(_0xc10f03){try{jsonpatch[_0xe4bc('0x34')](_0xc10f03,_0x12a47b,!![]);}catch(_0x817971){return BPromise[_0xe4bc('0x35')](_0x817971);}return _0xc10f03[_0xe4bc('0x36')]();};}function saveUpdates(_0x2eb8e2,_0x42c0c9){return function(_0x2cbaf4){if(_0x2cbaf4){return _0x2cbaf4[_0xe4bc('0x37')](_0x2eb8e2)[_0xe4bc('0x22')](function(_0x5e4263){return _0x5e4263;});}return null;};}function removeEntity(_0xc28d30,_0x8e0fba){return function(_0x1fdd63){if(_0x1fdd63){return _0x1fdd63['destroy']()[_0xe4bc('0x22')](function(){_0xc28d30[_0xe4bc('0x2e')](0xcc)[_0xe4bc('0x2f')]();});}};}function handleEntityNotFound(_0x14974f,_0x3c01ec){return function(_0x18b2f2){if(!_0x18b2f2){_0x14974f['sendStatus'](0x194);}return _0x18b2f2;};}function handleError(_0x19db69,_0x32f523){_0x32f523=_0x32f523||0x1f4;return function(_0x6c176f){logger['error'](_0x6c176f[_0xe4bc('0x38')]);if(_0x6c176f[_0xe4bc('0x39')]){delete _0x6c176f[_0xe4bc('0x39')];}_0x19db69[_0xe4bc('0x2e')](_0x32f523)[_0xe4bc('0x3a')](_0x6c176f);};}exports[_0xe4bc('0x3b')]=function(_0x4e01c0,_0x202d1e){var _0x293fb3={},_0x29919d={},_0x576fa2={'count':0x0,'rows':[]};var _0x34ef86=_[_0xe4bc('0x3c')](db[_0xe4bc('0x3d')][_0xe4bc('0x3e')],function(_0x17d5b9){return{'name':_0x17d5b9[_0xe4bc('0x3f')],'type':_0x17d5b9['type'][_0xe4bc('0x40')]};});_0x29919d[_0xe4bc('0x41')]=_[_0xe4bc('0x3c')](_0x34ef86,_0xe4bc('0x39'));_0x29919d[_0xe4bc('0x42')]=_['keys'](_0x4e01c0[_0xe4bc('0x42')]);_0x29919d[_0xe4bc('0x43')]=_['intersection'](_0x29919d[_0xe4bc('0x41')],_0x29919d['query']);_0x293fb3[_0xe4bc('0x44')]=_[_0xe4bc('0x45')](_0x29919d['model'],qs['fields'](_0x4e01c0[_0xe4bc('0x42')][_0xe4bc('0x46')]));_0x293fb3[_0xe4bc('0x44')]=_0x293fb3[_0xe4bc('0x44')]['length']?_0x293fb3['attributes']:_0x29919d[_0xe4bc('0x41')];if(!_0x4e01c0[_0xe4bc('0x42')]['hasOwnProperty'](_0xe4bc('0x47'))){_0x293fb3[_0xe4bc('0x31')]=qs[_0xe4bc('0x31')](_0x4e01c0[_0xe4bc('0x42')][_0xe4bc('0x31')]);_0x293fb3['offset']=qs[_0xe4bc('0x30')](_0x4e01c0[_0xe4bc('0x42')][_0xe4bc('0x30')]);}_0x293fb3[_0xe4bc('0x48')]=qs['sort'](_0x4e01c0[_0xe4bc('0x42')][_0xe4bc('0x49')]);_0x293fb3['where']=qs[_0xe4bc('0x43')](_[_0xe4bc('0x4a')](_0x4e01c0[_0xe4bc('0x42')],_0x29919d[_0xe4bc('0x43')]),_0x34ef86);if(_0x4e01c0[_0xe4bc('0x42')][_0xe4bc('0x4b')]){_0x293fb3['where']=_[_0xe4bc('0x4c')](_0x293fb3[_0xe4bc('0x4d')],{'$or':_[_0xe4bc('0x3c')](_0x34ef86,function(_0x4a1575){if(_0x4a1575[_0xe4bc('0x4e')]!=='VIRTUAL'){var _0x1ad483={};_0x1ad483[_0x4a1575[_0xe4bc('0x39')]]={'$like':'%'+_0x4e01c0['query'][_0xe4bc('0x4b')]+'%'};return _0x1ad483;}})});}_0x293fb3=_[_0xe4bc('0x4c')]({},_0x293fb3,_0x4e01c0[_0xe4bc('0x4f')]);var _0x3a7c43={'where':_0x293fb3[_0xe4bc('0x4d')]};return db[_0xe4bc('0x3d')][_0xe4bc('0x50')](_0x3a7c43)[_0xe4bc('0x22')](function(_0x19558d){_0x576fa2[_0xe4bc('0x50')]=_0x19558d;if(_0x4e01c0[_0xe4bc('0x42')][_0xe4bc('0x51')]){_0x293fb3[_0xe4bc('0x52')]=[{'all':!![]}];}return db[_0xe4bc('0x3d')]['findAll'](_0x293fb3);})[_0xe4bc('0x22')](function(_0x3c2527){_0x576fa2[_0xe4bc('0x53')]=_0x3c2527;return _0x576fa2;})['then'](respondWithFilteredResult(_0x202d1e,_0x293fb3))[_0xe4bc('0x2c')](handleError(_0x202d1e,null));};exports['show']=function(_0x191058,_0x5defa2){var _0x318a26={'raw':![],'where':{'id':_0x191058[_0xe4bc('0x54')]['id']}},_0x299978={};_0x299978[_0xe4bc('0x41')]=_[_0xe4bc('0x55')](db[_0xe4bc('0x3d')][_0xe4bc('0x3e')]);_0x299978[_0xe4bc('0x42')]=_['keys'](_0x191058['query']);_0x299978['filters']=_[_0xe4bc('0x45')](_0x299978[_0xe4bc('0x41')],_0x299978[_0xe4bc('0x42')]);_0x318a26[_0xe4bc('0x44')]=_[_0xe4bc('0x45')](_0x299978[_0xe4bc('0x41')],qs[_0xe4bc('0x46')](_0x191058['query'][_0xe4bc('0x46')]));_0x318a26[_0xe4bc('0x44')]=_0x318a26[_0xe4bc('0x44')][_0xe4bc('0x56')]?_0x318a26[_0xe4bc('0x44')]:_0x299978['model'];if(_0x191058['query'][_0xe4bc('0x51')]){_0x318a26['include']=[{'all':!![]}];}_0x318a26=_[_0xe4bc('0x4c')]({},_0x318a26,_0x191058['options']);return db[_0xe4bc('0x3d')][_0xe4bc('0x57')](_0x318a26)[_0xe4bc('0x22')](handleEntityNotFound(_0x5defa2,null))['then'](respondWithResult(_0x5defa2,null))[_0xe4bc('0x2c')](handleError(_0x5defa2,null));};exports[_0xe4bc('0x58')]=function(_0x48d59b,_0x517e65){return db[_0xe4bc('0x3d')]['create'](_0x48d59b[_0xe4bc('0x59')],{})[_0xe4bc('0x22')](respondWithResult(_0x517e65,0xc9))[_0xe4bc('0x2c')](handleError(_0x517e65,null));};exports[_0xe4bc('0x37')]=function(_0x46d4a9,_0x18aaa5){if(_0x46d4a9[_0xe4bc('0x59')]['id']){delete _0x46d4a9[_0xe4bc('0x59')]['id'];}return db[_0xe4bc('0x3d')][_0xe4bc('0x57')]({'where':{'id':_0x46d4a9[_0xe4bc('0x54')]['id']}})['then'](handleEntityNotFound(_0x18aaa5,null))[_0xe4bc('0x22')](saveUpdates(_0x46d4a9[_0xe4bc('0x59')],null))[_0xe4bc('0x22')](respondWithResult(_0x18aaa5,null))['catch'](handleError(_0x18aaa5,null));};exports[_0xe4bc('0x5a')]=function(_0x3c361,_0x4d39f){return db['ServicenowAccount'][_0xe4bc('0x57')]({'where':{'id':_0x3c361[_0xe4bc('0x54')]['id']}})['then'](handleEntityNotFound(_0x4d39f,null))[_0xe4bc('0x22')](removeEntity(_0x4d39f,null))[_0xe4bc('0x2c')](handleError(_0x4d39f,null));};exports['getConfigurations']=function(_0x5baf1,_0x2ce120,_0x5cd81d){var _0x41d416={};var _0x2efed4={};var _0x1901a4;var _0x214012;return db[_0xe4bc('0x3d')]['findOne']({'where':{'id':_0x5baf1[_0xe4bc('0x54')]['id']}})[_0xe4bc('0x22')](handleEntityNotFound(_0x2ce120,null))[_0xe4bc('0x22')](function(_0x576e99){if(_0x576e99){_0x1901a4=_0x576e99;_0x2efed4[_0xe4bc('0x41')]=_[_0xe4bc('0x55')](db[_0xe4bc('0x5b')]['rawAttributes']);_0x2efed4[_0xe4bc('0x42')]=_[_0xe4bc('0x55')](_0x5baf1['query']);_0x2efed4['filters']=_[_0xe4bc('0x45')](_0x2efed4[_0xe4bc('0x41')],_0x2efed4[_0xe4bc('0x42')]);_0x41d416[_0xe4bc('0x44')]=_[_0xe4bc('0x45')](_0x2efed4[_0xe4bc('0x41')],qs['fields'](_0x5baf1[_0xe4bc('0x42')][_0xe4bc('0x46')]));_0x41d416[_0xe4bc('0x44')]=_0x41d416[_0xe4bc('0x44')][_0xe4bc('0x56')]?_0x41d416[_0xe4bc('0x44')]:_0x2efed4[_0xe4bc('0x41')];_0x41d416[_0xe4bc('0x48')]=qs[_0xe4bc('0x49')](_0x5baf1[_0xe4bc('0x42')]['sort']);_0x41d416[_0xe4bc('0x4d')]=qs['filters'](_[_0xe4bc('0x4a')](_0x5baf1[_0xe4bc('0x42')],_0x2efed4[_0xe4bc('0x43')]));if(_0x5baf1[_0xe4bc('0x42')][_0xe4bc('0x4b')]){_0x41d416[_0xe4bc('0x4d')]=_[_0xe4bc('0x4c')](_0x41d416[_0xe4bc('0x4d')],{'$or':_['map'](_0x41d416['attributes'],function(_0x5b7506){var _0x5207c9={};_0x5207c9[_0x5b7506]={'$like':'%'+_0x5baf1['query'][_0xe4bc('0x4b')]+'%'};return _0x5207c9;})});}_0x41d416=_['merge']({},_0x41d416,_0x5baf1[_0xe4bc('0x4f')]);return _0x1901a4[_0xe4bc('0x5c')](_0x41d416);}})['then'](function(_0x37e080){if(_0x37e080){_0x214012=_0x37e080[_0xe4bc('0x56')];if(!_0x5baf1['query'][_0xe4bc('0x5d')]('nolimit')){_0x41d416[_0xe4bc('0x31')]=qs['limit'](_0x5baf1[_0xe4bc('0x42')][_0xe4bc('0x31')]);_0x41d416['offset']=qs[_0xe4bc('0x30')](_0x5baf1[_0xe4bc('0x42')][_0xe4bc('0x30')]);}return _0x1901a4[_0xe4bc('0x5c')](_0x41d416);}})[_0xe4bc('0x22')](function(_0x27e542){if(_0x27e542){return _0x27e542?{'count':_0x214012,'rows':_0x27e542}:null;}})[_0xe4bc('0x22')](respondWithResult(_0x2ce120,null))['catch'](handleError(_0x2ce120,null));};exports[_0xe4bc('0x5e')]=function(_0x20da8c,_0x3618cf,_0x1a8bca){if(_0x20da8c['body']['id']){delete _0x20da8c[_0xe4bc('0x59')]['id'];}return db[_0xe4bc('0x3d')][_0xe4bc('0x5f')]({'where':{'id':_0x20da8c[_0xe4bc('0x54')]['id']}})['then'](handleEntityNotFound(_0x3618cf,null))[_0xe4bc('0x22')](function(_0x5ba707){if(_0x5ba707){_0x20da8c['body'][_0xe4bc('0x60')]=_0x5ba707['id'];_0x20da8c[_0xe4bc('0x59')]['Subjects']=integrations[_0xe4bc('0x61')](_0x20da8c[_0xe4bc('0x59')][_0xe4bc('0x62')],_0x20da8c['body'][_0xe4bc('0x4e')]);_0x20da8c[_0xe4bc('0x59')]['Descriptions']=integrations[_0xe4bc('0x63')](_0x20da8c[_0xe4bc('0x59')][_0xe4bc('0x62')],_0x20da8c[_0xe4bc('0x59')][_0xe4bc('0x4e')]);return db[_0xe4bc('0x5b')][_0xe4bc('0x58')](_0x20da8c[_0xe4bc('0x59')],{'include':[{'model':db[_0xe4bc('0x64')],'as':_0xe4bc('0x65')},{'model':db[_0xe4bc('0x64')],'as':'Descriptions'}]});}return null;})[_0xe4bc('0x22')](respondWithResult(_0x3618cf,null))[_0xe4bc('0x2c')](handleError(_0x3618cf,null));};exports['getFields']=function(_0x3c0c40,_0x2f54f9,_0x21d0fd){var _0x159e55=[_0xe4bc('0x66'),'hold_reason','knowledge',_0xe4bc('0x67'),_0xe4bc('0x68'),_0xe4bc('0x69'),_0xe4bc('0x6a'),_0xe4bc('0x6b'),_0xe4bc('0x6c')];var _0x3539db=['parent',_0xe4bc('0x66'),_0xe4bc('0x6d'),_0xe4bc('0x6e'),_0xe4bc('0x6f'),_0xe4bc('0x70'),_0xe4bc('0x71'),'hold_reason','approval_history',_0xe4bc('0x72'),_0xe4bc('0x73'),_0xe4bc('0x74'),_0xe4bc('0x75'),'user_input',_0xe4bc('0x76'),'sys_domain',_0xe4bc('0x77'),_0xe4bc('0x78'),'knowledge',_0xe4bc('0x48'),'calendar_stc',_0xe4bc('0x79'),'cmdb_ci',_0xe4bc('0x7a'),_0xe4bc('0x7b'),_0xe4bc('0x7c'),_0xe4bc('0x7d'),_0xe4bc('0x7e'),_0xe4bc('0x7f'),_0xe4bc('0x80'),_0xe4bc('0x81'),_0xe4bc('0x82'),_0xe4bc('0x83'),_0xe4bc('0x84'),'business_duration','group_list',_0xe4bc('0x85'),_0xe4bc('0x86'),'resolved_at',_0xe4bc('0x87'),'approval_set',_0xe4bc('0x67'),_0xe4bc('0x88'),_0xe4bc('0x89'),'close_code',_0xe4bc('0x8a'),_0xe4bc('0x8b'),_0xe4bc('0x8c'),_0xe4bc('0x8d'),'business_stc',_0xe4bc('0x8e'),_0xe4bc('0x8f'),_0xe4bc('0x90'),_0xe4bc('0x69'),_0xe4bc('0x91'),_0xe4bc('0x92'),_0xe4bc('0x93'),_0xe4bc('0x94'),_0xe4bc('0x95'),'sys_id',_0xe4bc('0x96'),'reopened_by',_0xe4bc('0x6a'),_0xe4bc('0x97'),_0xe4bc('0x98'),'company',_0xe4bc('0x99'),_0xe4bc('0x9a'),'assigned_to','severity',_0xe4bc('0x9b'),_0xe4bc('0x9c'),_0xe4bc('0x9d'),_0xe4bc('0x9e'),_0xe4bc('0x9f'),_0xe4bc('0xa0'),'reopen_count',_0xe4bc('0xa1'),'escalation','upon_approval','correlation_id',_0xe4bc('0xa2'),_0xe4bc('0x6c')];var _0x323ad1='';var _0x503cdf='';var _0x127c82=[];var _0x3f2d64='';var _0x3950d0='';var _0x522395=[];var _0xb77f8a='';var _0x3b7471='';var _0x3a1d7e={};var _0x198269='';return db[_0xe4bc('0x3d')][_0xe4bc('0x5f')]({'where':{'id':_0x3c0c40[_0xe4bc('0x54')]['id']},'attributes':['id',_0xe4bc('0xa3'),_0xe4bc('0xa4'),_0xe4bc('0xa5'),_0xe4bc('0xa6'),_0xe4bc('0xa7')]})[_0xe4bc('0x22')](handleEntityNotFound(_0x2f54f9,null))['then'](function(_0x2ebcce){if(_0x2ebcce){_0x198269=_0x2ebcce['remoteUri'];var _0x460bf8=_0x198269[_0xe4bc('0xa8')](-0x1);if(_0x460bf8==='/'){_0x198269=_0x198269['substring'](0x0,_0x198269[_0xe4bc('0xa9')](_0x460bf8));}_0x3b7471=util[_0xe4bc('0xaa')](_0xe4bc('0xab'),_0x198269);_0xb77f8a=util[_0xe4bc('0xaa')](_0xe4bc('0xac'),_0x198269);_0x3a1d7e={'user':_0x2ebcce[_0xe4bc('0xa3')],'pass':_0x2ebcce[_0xe4bc('0xa4')]};var _0x915488={'method':'GET','uri':_0x3b7471+_0xe4bc('0xad'),'auth':_0x3a1d7e,'json':!![]};return rp(_0x915488);}})[_0xe4bc('0x22')](function(_0x59f0e0){if(_0x59f0e0[_0xe4bc('0x2b')][_0xe4bc('0x56')]>0x0){_0x323ad1=_0x59f0e0['result'];}console['log'](_0xe4bc('0xae'),_0x323ad1);_0x522395=[];_0x503cdf=Object[_0xe4bc('0xaf')]([],_0x323ad1);_[_0xe4bc('0xb0')](_0x503cdf,function(_0x32dd30){return!_0x159e55[_0xe4bc('0xb1')](_0x32dd30['name']);});_0x503cdf['forEach'](function(_0x362aba){var _0x235cb3=createFieldObject(_0xb77f8a,_0x3a1d7e,_0x362aba[_0xe4bc('0xb2')],_0x362aba[_0xe4bc('0x39')],_0x362aba[_0xe4bc('0xb3')],![]);_0x522395[_0xe4bc('0xb4')](_0x235cb3);});return Promise['all'](_0x522395);})[_0xe4bc('0x22')](function(_0x3486fc){_0x127c82=_0x3486fc;_0x3f2d64=Object[_0xe4bc('0xaf')]([],_0x323ad1);console[_0xe4bc('0xb5')](_0xe4bc('0xb6'),_0x323ad1);_[_0xe4bc('0xb0')](_0x3f2d64,function(_0x982953){return _0x3539db[_0xe4bc('0xb1')](_0x982953[_0xe4bc('0x39')]);});console[_0xe4bc('0xb5')]('TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom',_0x3f2d64);_0x522395=[];_0x3f2d64[_0xe4bc('0xb7')](function(_0x32d9c0){var _0x2c528e=createFieldObject(_0xb77f8a,_0x3a1d7e,_0x32d9c0['internalType'],_0x32d9c0['name'],_0x32d9c0['label'],!![]);_0x522395[_0xe4bc('0xb4')](_0x2c528e);});return Promise['all'](_0x522395);})['then'](function(_0x1c31cc){_0x3950d0=_0x1c31cc;var _0x48862f=_0x127c82[_0xe4bc('0xb8')](_0x3950d0);return{'count':_0x48862f[_0xe4bc('0x56')],'rows':_0x48862f};})[_0xe4bc('0x22')](respondWithResult(_0x2f54f9,null))['catch'](function(_0x2bf498){console['log'](_0xe4bc('0xb9')+_0x2bf498);var _0x1011e0=_0x3c0c40[_0xe4bc('0x42')][_0xe4bc('0x1e')]?0x1f4:_0x2bf498[_0xe4bc('0xba')]||0x1f4;logger[_0xe4bc('0x28')](_0x2bf498[_0xe4bc('0x38')]);delete _0x2bf498[_0xe4bc('0x39')];if(_0x1011e0===0x191){_0x1011e0=0x190;}_0x2f54f9['status'](_0x1011e0)[_0xe4bc('0x3a')](_0x3c0c40[_0xe4bc('0x42')][_0xe4bc('0x1e')]?{'message':_0xe4bc('0xbb'),'statusCode':_0x2bf498[_0xe4bc('0xba')]}:_0x2bf498);});};function createFieldObject(_0x3dafe1,_0x39d546,_0x233ccf,_0x11e278,_0x258749,_0x5e411c){return new Promise(function(_0x1ef993,_0x4993af){var _0x4b6926={'id':_0x11e278,'name':_0x258749,'custom':_0x5e411c};if(_0x233ccf==='boolean'){_0x4b6926[_0xe4bc('0x4f')]=[{'name':_0xe4bc('0xbc'),'value':'true'},{'name':'False','value':_0xe4bc('0xbd')}];_0x1ef993(_0x4b6926);}else{var _0x441314={'method':'GET','uri':_0x3dafe1+_0xe4bc('0xbe')+_0x11e278,'auth':_0x39d546,'json':!![]};return rp(_0x441314)[_0xe4bc('0x22')](function(_0x11e28a){var _0x35a97b=[];if(_0x11e28a[_0xe4bc('0x2b')][_0xe4bc('0x56')]>0x0){_0x11e28a[_0xe4bc('0x2b')][_0xe4bc('0xb7')](function(_0x5af7b3){if(_0x5af7b3[_0xe4bc('0xbf')]===_0xe4bc('0xbd')){var _0x46b6f0={'name':_0x5af7b3[_0xe4bc('0xb3')],'value':_0x5af7b3['value']};_0x35a97b[_0xe4bc('0xb4')](_0x46b6f0);}});}_0x4b6926[_0xe4bc('0x4f')]=_0x35a97b;if(_0x4b6926[_0xe4bc('0x4f')][_0xe4bc('0x56')]>0x0){_0x1ef993(_0x4b6926);}else{if(_0x5e411c==![]){_0x1ef993();}else{_0x1ef993(_0x4b6926);}}});}});}
\ No newline at end of file
diff --git a/server/api/intServicenowAccount/intServicenowAccount.model.js b/server/api/intServicenowAccount/intServicenowAccount.model.js
index 13832bf..0128eac 100644
--- a/server/api/intServicenowAccount/intServicenowAccount.model.js
+++ b/server/api/intServicenowAccount/intServicenowAccount.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7ef8=['../../components/integrations/configuration','define','ServicenowAccount','lodash','util','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment','./intServicenowAccount.attributes'];(function(_0x30aa39,_0x18b317){var _0x47bab8=function(_0x313786){while(--_0x313786){_0x30aa39['push'](_0x30aa39['shift']());}};_0x47bab8(++_0x18b317);}(_0x7ef8,0x123));var _0x87ef=function(_0x3014a4,_0x56b5aa){_0x3014a4=_0x3014a4-0x0;var _0x4ff3da=_0x7ef8[_0x3014a4];return _0x4ff3da;};'use strict';var _=require(_0x87ef('0x0'));var util=require(_0x87ef('0x1'));var logger=require(_0x87ef('0x2'))(_0x87ef('0x3'));var moment=require('moment');var BPromise=require(_0x87ef('0x4'));var rp=require(_0x87ef('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x87ef('0x6'));var config=require(_0x87ef('0x7'));var attributes=require(_0x87ef('0x8'));var integrations=require(_0x87ef('0x9'));module['exports']=function(_0xc71a0f,_0x2a1825){return _0xc71a0f[_0x87ef('0xa')](_0x87ef('0xb'),attributes,{'tableName':'int_servicenow_accounts','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x4387=['request-promise','path','rimraf','../../config/environment','./intServicenowAccount.attributes','../../components/integrations/configuration','exports','define','ServicenowAccount','int_servicenow_accounts','../../config/logger','api','moment','bluebird'];(function(_0x21bf27,_0x4bd500){var _0x36ad9e=function(_0xf609ae){while(--_0xf609ae){_0x21bf27['push'](_0x21bf27['shift']());}};_0x36ad9e(++_0x4bd500);}(_0x4387,0xa4));var _0x7438=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4387[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x7438('0x0'))(_0x7438('0x1'));var moment=require(_0x7438('0x2'));var BPromise=require(_0x7438('0x3'));var rp=require(_0x7438('0x4'));var fs=require('fs');var path=require(_0x7438('0x5'));var rimraf=require(_0x7438('0x6'));var config=require(_0x7438('0x7'));var attributes=require(_0x7438('0x8'));var integrations=require(_0x7438('0x9'));module[_0x7438('0xa')]=function(_0x133131,_0x57ed32){return _0x133131[_0x7438('0xb')](_0x7438('0xc'),attributes,{'tableName':_0x7438('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/intServicenowAccount/intServicenowAccount.rpc.js b/server/api/intServicenowAccount/intServicenowAccount.rpc.js
index 0aea3b6..11fde7e 100644
--- a/server/api/intServicenowAccount/intServicenowAccount.rpc.js
+++ b/server/api/intServicenowAccount/intServicenowAccount.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7d91=['jayson/promise','client','http','request','then','info','ServicenowAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','findAll','options','attributes','limit','include','map','model','GetServicenowAccount','ShowServicenowAccount','ServicenowAccount','raw','where','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x3edb0b,_0xb5450e){var _0x4107d9=function(_0x14d3d6){while(--_0x14d3d6){_0x3edb0b['push'](_0x3edb0b['shift']());}};_0x4107d9(++_0xb5450e);}(_0x7d91,0x87));var _0x17d9=function(_0x1fae3c,_0x41a75c){_0x1fae3c=_0x1fae3c-0x0;var _0x384ddf=_0x7d91[_0x1fae3c];return _0x384ddf;};'use strict';var _=require(_0x17d9('0x0'));var util=require(_0x17d9('0x1'));var moment=require('moment');var BPromise=require(_0x17d9('0x2'));var rs=require(_0x17d9('0x3'));var fs=require('fs');var Redis=require(_0x17d9('0x4'));var db=require(_0x17d9('0x5'))['db'];var utils=require(_0x17d9('0x6'));var logger=require(_0x17d9('0x7'))(_0x17d9('0x8'));var config=require('../../config/environment');var jayson=require(_0x17d9('0x9'));var client=jayson[_0x17d9('0xa')][_0x17d9('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1b3606,_0x21d8fd,_0x1942ba){return new BPromise(function(_0x1806f3,_0x2c6b45){return client[_0x17d9('0xc')](_0x1b3606,_0x1942ba)[_0x17d9('0xd')](function(_0x26c66b){logger[_0x17d9('0xe')](_0x17d9('0xf'),_0x21d8fd,_0x17d9('0x10'));logger[_0x17d9('0x11')]('ServicenowAccount,\x20%s,\x20%s,\x20%s',_0x21d8fd,'request\x20sent',JSON[_0x17d9('0x12')](_0x26c66b));if(_0x26c66b['error']){if(_0x26c66b[_0x17d9('0x13')][_0x17d9('0x14')]===0x1f4){logger[_0x17d9('0x13')](_0x17d9('0xf'),_0x21d8fd,_0x26c66b['error']['message']);return _0x2c6b45(_0x26c66b[_0x17d9('0x13')][_0x17d9('0x15')]);}logger[_0x17d9('0x13')](_0x17d9('0xf'),_0x21d8fd,_0x26c66b['error'][_0x17d9('0x15')]);return _0x1806f3(_0x26c66b[_0x17d9('0x13')]['message']);}else{logger[_0x17d9('0xe')](_0x17d9('0xf'),_0x21d8fd,_0x17d9('0x10'));_0x1806f3(_0x26c66b[_0x17d9('0x16')][_0x17d9('0x15')]);}})[_0x17d9('0x17')](function(_0x519b5f){logger[_0x17d9('0x13')](_0x17d9('0xf'),_0x21d8fd,_0x519b5f);_0x2c6b45(_0x519b5f);});});}exports['GetServicenowAccount']=function(_0x34750f){var _0x2fa015=this;return new Promise(function(_0x31590a,_0x1f7b71){return db['ServicenowAccount'][_0x17d9('0x18')]({'raw':_0x34750f[_0x17d9('0x19')]?_0x34750f['options']['raw']===undefined?!![]:![]:!![],'where':_0x34750f[_0x17d9('0x19')]?_0x34750f[_0x17d9('0x19')]['where']||null:null,'attributes':_0x34750f[_0x17d9('0x19')]?_0x34750f[_0x17d9('0x19')][_0x17d9('0x1a')]||null:null,'limit':_0x34750f[_0x17d9('0x19')]?_0x34750f[_0x17d9('0x19')][_0x17d9('0x1b')]||null:null,'include':_0x34750f['options']?_0x34750f[_0x17d9('0x19')][_0x17d9('0x1c')]?_[_0x17d9('0x1d')](_0x34750f[_0x17d9('0x19')][_0x17d9('0x1c')],function(_0x1974fb){return{'model':db[_0x1974fb[_0x17d9('0x1e')]],'as':_0x1974fb['as'],'attributes':_0x1974fb[_0x17d9('0x1a')],'include':_0x1974fb[_0x17d9('0x1c')]?_[_0x17d9('0x1d')](_0x1974fb[_0x17d9('0x1c')],function(_0x4e538b){return{'model':db[_0x4e538b[_0x17d9('0x1e')]],'as':_0x4e538b['as'],'attributes':_0x4e538b[_0x17d9('0x1a')],'include':_0x4e538b['include']?_[_0x17d9('0x1d')](_0x4e538b['include'],function(_0x3ad927){return{'model':db[_0x3ad927[_0x17d9('0x1e')]],'as':_0x3ad927['as'],'attributes':_0x3ad927[_0x17d9('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x17d9('0xd')](function(_0x345d77){logger[_0x17d9('0xe')]('GetServicenowAccount',_0x34750f);logger[_0x17d9('0x11')](_0x17d9('0x1f'),_0x34750f,JSON[_0x17d9('0x12')](_0x345d77));_0x31590a(_0x345d77);})[_0x17d9('0x17')](function(_0x21eb29){logger['error'](_0x17d9('0x1f'),_0x21eb29['message'],_0x34750f);_0x1f7b71(_0x2fa015[_0x17d9('0x13')](0x1f4,_0x21eb29[_0x17d9('0x15')]));});});};exports[_0x17d9('0x20')]=function(_0x230725){var _0x539dd0=this;return new Promise(function(_0x26f77f,_0x1c97aa){return db[_0x17d9('0x21')]['find']({'raw':_0x230725['options']?_0x230725[_0x17d9('0x19')][_0x17d9('0x22')]===undefined?!![]:![]:!![],'where':_0x230725[_0x17d9('0x19')]?_0x230725[_0x17d9('0x19')][_0x17d9('0x23')]||null:null,'attributes':_0x230725[_0x17d9('0x19')]?_0x230725[_0x17d9('0x19')][_0x17d9('0x1a')]||null:null,'include':_0x230725[_0x17d9('0x19')]?_0x230725['options']['include']?_[_0x17d9('0x1d')](_0x230725[_0x17d9('0x19')][_0x17d9('0x1c')],function(_0x3c8b82){return{'model':db[_0x3c8b82[_0x17d9('0x1e')]],'as':_0x3c8b82['as'],'attributes':_0x3c8b82[_0x17d9('0x1a')],'include':_0x3c8b82[_0x17d9('0x1c')]?_[_0x17d9('0x1d')](_0x3c8b82['include'],function(_0x36a029){return{'model':db[_0x36a029[_0x17d9('0x1e')]],'as':_0x36a029['as'],'attributes':_0x36a029[_0x17d9('0x1a')],'include':_0x36a029[_0x17d9('0x1c')]?_[_0x17d9('0x1d')](_0x36a029[_0x17d9('0x1c')],function(_0x1662a3){return{'model':db[_0x1662a3['model']],'as':_0x1662a3['as'],'attributes':_0x1662a3['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x505445){logger[_0x17d9('0xe')](_0x17d9('0x20'),_0x230725);logger[_0x17d9('0x11')](_0x17d9('0x20'),_0x230725,JSON[_0x17d9('0x12')](_0x505445));_0x26f77f(_0x505445);})[_0x17d9('0x17')](function(_0x1b1925){logger[_0x17d9('0x13')]('ShowServicenowAccount',_0x1b1925[_0x17d9('0x15')],_0x230725);_0x1c97aa(_0x539dd0['error'](0x1f4,_0x1b1925[_0x17d9('0x15')]));});});};
\ No newline at end of file
+var _0x698d=['result','catch','GetServicenowAccount','ServicenowAccount','findAll','options','raw','where','include','map','attributes','model','debug','stringify','ShowServicenowAccount','find','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','request','then','ServicenowAccount,\x20%s,\x20%s','request\x20sent','ServicenowAccount,\x20%s,\x20%s,\x20%s','error','code','message','info'];(function(_0xcb0eb2,_0x3906bf){var _0xbab9b8=function(_0x24fa8a){while(--_0x24fa8a){_0xcb0eb2['push'](_0xcb0eb2['shift']());}};_0xbab9b8(++_0x3906bf);}(_0x698d,0x16e));var _0xd698=function(_0x44acbd,_0x4bba52){_0x44acbd=_0x44acbd-0x0;var _0x4793bc=_0x698d[_0x44acbd];return _0x4793bc;};'use strict';var _=require('lodash');var util=require(_0xd698('0x0'));var moment=require(_0xd698('0x1'));var BPromise=require(_0xd698('0x2'));var rs=require(_0xd698('0x3'));var fs=require('fs');var Redis=require(_0xd698('0x4'));var db=require(_0xd698('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xd698('0x6'))('rpc');var config=require(_0xd698('0x7'));var jayson=require(_0xd698('0x8'));var client=jayson[_0xd698('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4ea9ca,_0x5545f6,_0x584378){return new BPromise(function(_0x441919,_0x3fae87){return client[_0xd698('0xa')](_0x4ea9ca,_0x584378)[_0xd698('0xb')](function(_0x365929){logger['info'](_0xd698('0xc'),_0x5545f6,_0xd698('0xd'));logger['debug'](_0xd698('0xe'),_0x5545f6,_0xd698('0xd'),JSON['stringify'](_0x365929));if(_0x365929[_0xd698('0xf')]){if(_0x365929['error'][_0xd698('0x10')]===0x1f4){logger['error']('ServicenowAccount,\x20%s,\x20%s',_0x5545f6,_0x365929[_0xd698('0xf')][_0xd698('0x11')]);return _0x3fae87(_0x365929[_0xd698('0xf')][_0xd698('0x11')]);}logger[_0xd698('0xf')](_0xd698('0xc'),_0x5545f6,_0x365929[_0xd698('0xf')][_0xd698('0x11')]);return _0x441919(_0x365929[_0xd698('0xf')][_0xd698('0x11')]);}else{logger[_0xd698('0x12')](_0xd698('0xc'),_0x5545f6,_0xd698('0xd'));_0x441919(_0x365929[_0xd698('0x13')][_0xd698('0x11')]);}})[_0xd698('0x14')](function(_0x7e60a6){logger[_0xd698('0xf')](_0xd698('0xc'),_0x5545f6,_0x7e60a6);_0x3fae87(_0x7e60a6);});});}exports[_0xd698('0x15')]=function(_0xab6b68){var _0x18b7fe=this;return new Promise(function(_0x39f145,_0x180c09){return db[_0xd698('0x16')][_0xd698('0x17')]({'raw':_0xab6b68[_0xd698('0x18')]?_0xab6b68[_0xd698('0x18')][_0xd698('0x19')]===undefined?!![]:![]:!![],'where':_0xab6b68[_0xd698('0x18')]?_0xab6b68['options'][_0xd698('0x1a')]||null:null,'attributes':_0xab6b68[_0xd698('0x18')]?_0xab6b68['options']['attributes']||null:null,'limit':_0xab6b68[_0xd698('0x18')]?_0xab6b68[_0xd698('0x18')]['limit']||null:null,'include':_0xab6b68[_0xd698('0x18')]?_0xab6b68[_0xd698('0x18')][_0xd698('0x1b')]?_[_0xd698('0x1c')](_0xab6b68[_0xd698('0x18')]['include'],function(_0x32bc91){return{'model':db[_0x32bc91['model']],'as':_0x32bc91['as'],'attributes':_0x32bc91[_0xd698('0x1d')],'include':_0x32bc91[_0xd698('0x1b')]?_[_0xd698('0x1c')](_0x32bc91[_0xd698('0x1b')],function(_0x50402b){return{'model':db[_0x50402b[_0xd698('0x1e')]],'as':_0x50402b['as'],'attributes':_0x50402b[_0xd698('0x1d')],'include':_0x50402b[_0xd698('0x1b')]?_[_0xd698('0x1c')](_0x50402b[_0xd698('0x1b')],function(_0x224476){return{'model':db[_0x224476['model']],'as':_0x224476['as'],'attributes':_0x224476[_0xd698('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xd698('0xb')](function(_0x33de06){logger[_0xd698('0x12')]('GetServicenowAccount',_0xab6b68);logger[_0xd698('0x1f')]('GetServicenowAccount',_0xab6b68,JSON[_0xd698('0x20')](_0x33de06));_0x39f145(_0x33de06);})[_0xd698('0x14')](function(_0x9c1147){logger['error'](_0xd698('0x15'),_0x9c1147[_0xd698('0x11')],_0xab6b68);_0x180c09(_0x18b7fe[_0xd698('0xf')](0x1f4,_0x9c1147['message']));});});};exports[_0xd698('0x21')]=function(_0x3a9cac){var _0x5c3ec1=this;return new Promise(function(_0x542a74,_0x5f2659){return db[_0xd698('0x16')][_0xd698('0x22')]({'raw':_0x3a9cac['options']?_0x3a9cac['options'][_0xd698('0x19')]===undefined?!![]:![]:!![],'where':_0x3a9cac['options']?_0x3a9cac['options'][_0xd698('0x1a')]||null:null,'attributes':_0x3a9cac['options']?_0x3a9cac[_0xd698('0x18')][_0xd698('0x1d')]||null:null,'include':_0x3a9cac['options']?_0x3a9cac[_0xd698('0x18')][_0xd698('0x1b')]?_[_0xd698('0x1c')](_0x3a9cac['options'][_0xd698('0x1b')],function(_0x5f4b1b){return{'model':db[_0x5f4b1b[_0xd698('0x1e')]],'as':_0x5f4b1b['as'],'attributes':_0x5f4b1b['attributes'],'include':_0x5f4b1b[_0xd698('0x1b')]?_['map'](_0x5f4b1b[_0xd698('0x1b')],function(_0x3adf0c){return{'model':db[_0x3adf0c[_0xd698('0x1e')]],'as':_0x3adf0c['as'],'attributes':_0x3adf0c[_0xd698('0x1d')],'include':_0x3adf0c[_0xd698('0x1b')]?_[_0xd698('0x1c')](_0x3adf0c[_0xd698('0x1b')],function(_0x2fa3c9){return{'model':db[_0x2fa3c9[_0xd698('0x1e')]],'as':_0x2fa3c9['as'],'attributes':_0x2fa3c9[_0xd698('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xd698('0xb')](function(_0x3647cf){logger[_0xd698('0x12')](_0xd698('0x21'),_0x3a9cac);logger[_0xd698('0x1f')](_0xd698('0x21'),_0x3a9cac,JSON[_0xd698('0x20')](_0x3647cf));_0x542a74(_0x3647cf);})[_0xd698('0x14')](function(_0x11f35a){logger[_0xd698('0xf')](_0xd698('0x21'),_0x11f35a[_0xd698('0x11')],_0x3a9cac);_0x5f2659(_0x5c3ec1[_0xd698('0xf')](0x1f4,_0x11f35a[_0xd698('0x11')]));});});};
\ No newline at end of file
diff --git a/server/api/intServicenowConfiguration/index.js b/server/api/intServicenowConfiguration/index.js
index 39508bd..d381e10 100644
--- a/server/api/intServicenowConfiguration/index.js
+++ b/server/api/intServicenowConfiguration/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xcf34=['../../components/auth/service','../../components/interaction/service','./intServicenowConfiguration.controller','get','isAuthenticated','index','show','/:id/fields','getFields','getSubjects','/:id/descriptions','getDescriptions','post','create','put','/:id','update','delete','exports','multer','util','connect-timeout','express','Router'];(function(_0x32d002,_0x40d845){var _0x4208bf=function(_0x25693f){while(--_0x25693f){_0x32d002['push'](_0x32d002['shift']());}};_0x4208bf(++_0x40d845);}(_0xcf34,0xbb));var _0x4cf3=function(_0xf74372,_0x51fe82){_0xf74372=_0xf74372-0x0;var _0x36bb65=_0xcf34[_0xf74372];return _0x36bb65;};'use strict';var multer=require(_0x4cf3('0x0'));var util=require(_0x4cf3('0x1'));var path=require('path');var timeout=require(_0x4cf3('0x2'));var express=require(_0x4cf3('0x3'));var router=express[_0x4cf3('0x4')]();var auth=require(_0x4cf3('0x5'));var interaction=require(_0x4cf3('0x6'));var config=require('../../config/environment');var controller=require(_0x4cf3('0x7'));router[_0x4cf3('0x8')]('/',auth[_0x4cf3('0x9')](),controller[_0x4cf3('0xa')]);router[_0x4cf3('0x8')]('/:id',auth[_0x4cf3('0x9')](),controller[_0x4cf3('0xb')]);router['get'](_0x4cf3('0xc'),auth['isAuthenticated'](),controller[_0x4cf3('0xd')]);router[_0x4cf3('0x8')]('/:id/subjects',auth['isAuthenticated'](),controller[_0x4cf3('0xe')]);router[_0x4cf3('0x8')](_0x4cf3('0xf'),auth[_0x4cf3('0x9')](),controller[_0x4cf3('0x10')]);router[_0x4cf3('0x11')]('/',auth[_0x4cf3('0x9')](),controller[_0x4cf3('0x12')]);router[_0x4cf3('0x13')](_0x4cf3('0x14'),auth[_0x4cf3('0x9')](),controller[_0x4cf3('0x15')]);router[_0x4cf3('0x16')]('/:id',auth[_0x4cf3('0x9')](),controller['destroy']);module[_0x4cf3('0x17')]=router;
\ No newline at end of file
+var _0xb3f3=['multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','create','put','delete','destroy','exports'];(function(_0x1e9ef5,_0x220b1d){var _0x4edda3=function(_0x2f6655){while(--_0x2f6655){_0x1e9ef5['push'](_0x1e9ef5['shift']());}};_0x4edda3(++_0x220b1d);}(_0xb3f3,0x190));var _0x3b3f=function(_0x58c654,_0x56f774){_0x58c654=_0x58c654-0x0;var _0x1b1164=_0xb3f3[_0x58c654];return _0x1b1164;};'use strict';var multer=require(_0x3b3f('0x0'));var util=require(_0x3b3f('0x1'));var path=require(_0x3b3f('0x2'));var timeout=require(_0x3b3f('0x3'));var express=require(_0x3b3f('0x4'));var router=express[_0x3b3f('0x5')]();var auth=require(_0x3b3f('0x6'));var interaction=require(_0x3b3f('0x7'));var config=require(_0x3b3f('0x8'));var controller=require('./intServicenowConfiguration.controller');router[_0x3b3f('0x9')]('/',auth[_0x3b3f('0xa')](),controller['index']);router[_0x3b3f('0x9')](_0x3b3f('0xb'),auth['isAuthenticated'](),controller[_0x3b3f('0xc')]);router['get'](_0x3b3f('0xd'),auth['isAuthenticated'](),controller[_0x3b3f('0xe')]);router['get'](_0x3b3f('0xf'),auth['isAuthenticated'](),controller[_0x3b3f('0x10')]);router[_0x3b3f('0x9')](_0x3b3f('0x11'),auth['isAuthenticated'](),controller[_0x3b3f('0x12')]);router[_0x3b3f('0x13')]('/',auth[_0x3b3f('0xa')](),controller[_0x3b3f('0x14')]);router[_0x3b3f('0x15')](_0x3b3f('0xb'),auth['isAuthenticated'](),controller['update']);router[_0x3b3f('0x16')]('/:id',auth[_0x3b3f('0xa')](),controller[_0x3b3f('0x17')]);module[_0x3b3f('0x18')]=router;
\ No newline at end of file
diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js
index c7bba50..49e1b60 100644
--- a/server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js
+++ b/server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x0c99=['exports','STRING','sequelize'];(function(_0x435805,_0x297260){var _0x4ddd9b=function(_0x19dea9){while(--_0x19dea9){_0x435805['push'](_0x435805['shift']());}};_0x4ddd9b(++_0x297260);}(_0x0c99,0xcb));var _0x90c9=function(_0x52e0ee,_0x52f7c1){_0x52e0ee=_0x52e0ee-0x0;var _0x32534c=_0x0c99[_0x52e0ee];return _0x32534c;};'use strict';var Sequelize=require(_0x90c9('0x0'));module[_0x90c9('0x1')]={'name':{'type':Sequelize[_0x90c9('0x2')]},'description':{'type':Sequelize[_0x90c9('0x2')]}};
\ No newline at end of file
+var _0xc0ef=['exports','STRING','sequelize'];(function(_0xddfaba,_0x190d4b){var _0x549f70=function(_0x22acc3){while(--_0x22acc3){_0xddfaba['push'](_0xddfaba['shift']());}};_0x549f70(++_0x190d4b);}(_0xc0ef,0xf8));var _0xfc0e=function(_0x4ca0c2,_0x2df1be){_0x4ca0c2=_0x4ca0c2-0x0;var _0x1e2836=_0xc0ef[_0x4ca0c2];return _0x1e2836;};'use strict';var Sequelize=require(_0xfc0e('0x0'));module[_0xfc0e('0x1')]={'name':{'type':Sequelize[_0xfc0e('0x2')]},'description':{'type':Sequelize[_0xfc0e('0x2')]}};
\ No newline at end of file
diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js
index 2fcb16a..e743a28 100644
--- a/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js
+++ b/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x0972=['ServicenowField','pick','getFields','getSubjects','getDescriptions','eml-format','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','client','http','test','Sequelize','ValidationError','request','then','info','ServicenowConfiguration,\x20%s,\x20%s','debug','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','sendStatus','status','json','count','offset','limit','apply','reject','update','destroy','end','name','send','index','map','ServicenowConfiguration','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','filter','where','VIRTUAL','merge','options','findAll','rows','params','length','includeAll','include','find','create','body','findOne'];(function(_0x2b4fc4,_0x5b0c6d){var _0x25e0ac=function(_0x15c0bb){while(--_0x15c0bb){_0x2b4fc4['push'](_0x2b4fc4['shift']());}};_0x25e0ac(++_0x5b0c6d);}(_0x0972,0x64));var _0x2097=function(_0x36630d,_0xa6c486){_0x36630d=_0x36630d-0x0;var _0xd59a11=_0x0972[_0x36630d];return _0xd59a11;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x2097('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x2097('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x2097('0x2'));var moment=require(_0x2097('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x2097('0x4'));var util=require(_0x2097('0x5'));var path=require(_0x2097('0x6'));var sox=require(_0x2097('0x7'));var csv=require(_0x2097('0x8'));var ejs=require(_0x2097('0x9'));var fs=require('fs');var _=require(_0x2097('0xa'));var squel=require('squel');var crypto=require(_0x2097('0xb'));var jsforce=require(_0x2097('0xc'));var deskjs=require(_0x2097('0xd'));var toCsv=require(_0x2097('0x8'));var querystring=require(_0x2097('0xe'));var Papa=require('papaparse');var Redis=require(_0x2097('0xf'));var authService=require(_0x2097('0x10'));var qs=require(_0x2097('0x11'));var as=require(_0x2097('0x12'));var hardwareService=require(_0x2097('0x13'));var logger=require(_0x2097('0x14'))(_0x2097('0x15'));var utils=require(_0x2097('0x16'));var config=require(_0x2097('0x17'));var db=require(_0x2097('0x18'))['db'];var jayson=require(_0x2097('0x19'));var client=jayson[_0x2097('0x1a')][_0x2097('0x1b')]({'port':0x232a});function checkPasswordPattern(_0x16871b,_0x24ca42,_0x3e3fdc){if(_0x3e3fdc){var _0x185be8=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x185be8[_0x2097('0x1c')](_0x24ca42)){return _0x16871b;}else{throw new db[(_0x2097('0x1d'))][(_0x2097('0x1e'))]('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x16871b;}}function respondWithRpcPromise(_0x639c14,_0x35c062,_0x4d31bc,_0x4eec05){return new BPromise(function(_0x4fc8c5,_0x409deb){var _0x588396=_0x4eec05||client;return _0x588396[_0x2097('0x1f')](_0x639c14,_0x4d31bc)[_0x2097('0x20')](function(_0x43fec9){logger[_0x2097('0x21')](_0x2097('0x22'),_0x35c062,'request\x20sent');logger[_0x2097('0x23')](_0x2097('0x24'),_0x35c062,_0x2097('0x25'),JSON[_0x2097('0x26')](_0x43fec9));if(_0x43fec9[_0x2097('0x27')]){if(_0x43fec9[_0x2097('0x27')][_0x2097('0x28')]===0x1f4){logger[_0x2097('0x27')]('ServicenowConfiguration,\x20%s,\x20%s',_0x35c062,_0x43fec9['error'][_0x2097('0x29')]);return _0x409deb(_0x43fec9['error'][_0x2097('0x29')]);}logger[_0x2097('0x27')]('ServicenowConfiguration,\x20%s,\x20%s',_0x35c062,_0x43fec9[_0x2097('0x27')]['message']);return _0x4fc8c5(_0x43fec9[_0x2097('0x27')][_0x2097('0x29')]);}else{logger[_0x2097('0x21')](_0x2097('0x22'),_0x35c062,_0x2097('0x25'));_0x4fc8c5(_0x43fec9[_0x2097('0x2a')]['message']);}})[_0x2097('0x2b')](function(_0x500234){logger[_0x2097('0x27')](_0x2097('0x22'),_0x35c062,_0x500234);_0x409deb(_0x500234);});});}function respondWithStatusCode(_0x345875,_0x9f59bc){_0x9f59bc=_0x9f59bc||0xcc;return function(_0x499988){if(_0x499988){return _0x345875[_0x2097('0x2c')](_0x9f59bc);}return _0x345875[_0x2097('0x2d')](_0x9f59bc)['end']();};}function respondWithResult(_0x1229fc,_0x5ed0fa){_0x5ed0fa=_0x5ed0fa||0xc8;return function(_0x29b879){if(_0x29b879){return _0x1229fc['status'](_0x5ed0fa)[_0x2097('0x2e')](_0x29b879);}};}function respondWithFilteredResult(_0x33e8d1,_0x407a2a){return function(_0x7eefb4){if(_0x7eefb4){var _0x410afa=_0x7eefb4[_0x2097('0x2f')],_0x36228c=_0x407a2a[_0x2097('0x30')],_0x450e0b=_0x407a2a['offset']+_0x407a2a[_0x2097('0x31')],_0x4b443d;if(_0x450e0b>=_0x410afa){_0x450e0b=_0x410afa;_0x4b443d=0xc8;}else{_0x4b443d=0xce;}_0x33e8d1[_0x2097('0x2d')](_0x4b443d);return _0x33e8d1['set']('Content-Range',_0x36228c+'-'+_0x450e0b+'/'+_0x410afa)[_0x2097('0x2e')](_0x7eefb4);}return null;};}function patchUpdates(_0x11b051){return function(_0x1649c8){try{jsonpatch[_0x2097('0x32')](_0x1649c8,_0x11b051,!![]);}catch(_0x74ccdc){return BPromise[_0x2097('0x33')](_0x74ccdc);}return _0x1649c8['save']();};}function saveUpdates(_0xe1a381,_0x56bb42){return function(_0x193160){if(_0x193160){return _0x193160[_0x2097('0x34')](_0xe1a381)[_0x2097('0x20')](function(_0x1e8af9){return _0x1e8af9;});}return null;};}function removeEntity(_0x44e398,_0x395d9f){return function(_0x9bc312){if(_0x9bc312){return _0x9bc312[_0x2097('0x35')]()[_0x2097('0x20')](function(){_0x44e398['status'](0xcc)[_0x2097('0x36')]();});}};}function handleEntityNotFound(_0x40baed,_0x23334d){return function(_0x494131){if(!_0x494131){_0x40baed[_0x2097('0x2c')](0x194);}return _0x494131;};}function handleError(_0x3bda50,_0x3c2fa6){_0x3c2fa6=_0x3c2fa6||0x1f4;return function(_0x396162){logger['error'](_0x396162['stack']);if(_0x396162['name']){delete _0x396162[_0x2097('0x37')];}_0x3bda50[_0x2097('0x2d')](_0x3c2fa6)[_0x2097('0x38')](_0x396162);};}exports[_0x2097('0x39')]=function(_0x3710e0,_0x296281){var _0x49b724={},_0x379032={},_0xf65266={'count':0x0,'rows':[]};var _0x2cf259=_[_0x2097('0x3a')](db[_0x2097('0x3b')][_0x2097('0x3c')],function(_0x52b937){return{'name':_0x52b937[_0x2097('0x3d')],'type':_0x52b937[_0x2097('0x3e')][_0x2097('0x3f')]};});_0x379032['model']=_['map'](_0x2cf259,_0x2097('0x37'));_0x379032[_0x2097('0x40')]=_[_0x2097('0x41')](_0x3710e0[_0x2097('0x40')]);_0x379032[_0x2097('0x42')]=_[_0x2097('0x43')](_0x379032[_0x2097('0x44')],_0x379032[_0x2097('0x40')]);_0x49b724[_0x2097('0x45')]=_[_0x2097('0x43')](_0x379032[_0x2097('0x44')],qs[_0x2097('0x46')](_0x3710e0['query'][_0x2097('0x46')]));_0x49b724[_0x2097('0x45')]=_0x49b724[_0x2097('0x45')]['length']?_0x49b724[_0x2097('0x45')]:_0x379032[_0x2097('0x44')];if(!_0x3710e0[_0x2097('0x40')][_0x2097('0x47')](_0x2097('0x48'))){_0x49b724[_0x2097('0x31')]=qs[_0x2097('0x31')](_0x3710e0[_0x2097('0x40')]['limit']);_0x49b724[_0x2097('0x30')]=qs[_0x2097('0x30')](_0x3710e0[_0x2097('0x40')][_0x2097('0x30')]);}_0x49b724[_0x2097('0x49')]=qs[_0x2097('0x4a')](_0x3710e0[_0x2097('0x40')][_0x2097('0x4a')]);_0x49b724['where']=qs[_0x2097('0x42')](_['pick'](_0x3710e0[_0x2097('0x40')],_0x379032[_0x2097('0x42')]),_0x2cf259);if(_0x3710e0[_0x2097('0x40')][_0x2097('0x4b')]){_0x49b724[_0x2097('0x4c')]=_['merge'](_0x49b724[_0x2097('0x4c')],{'$or':_[_0x2097('0x3a')](_0x2cf259,function(_0x113c3b){if(_0x113c3b[_0x2097('0x3e')]!==_0x2097('0x4d')){var _0x58c7bd={};_0x58c7bd[_0x113c3b[_0x2097('0x37')]]={'$like':'%'+_0x3710e0[_0x2097('0x40')][_0x2097('0x4b')]+'%'};return _0x58c7bd;}})});}_0x49b724=_[_0x2097('0x4e')]({},_0x49b724,_0x3710e0[_0x2097('0x4f')]);var _0x22c4c6={'where':_0x49b724[_0x2097('0x4c')]};return db[_0x2097('0x3b')]['count'](_0x22c4c6)[_0x2097('0x20')](function(_0x594804){_0xf65266[_0x2097('0x2f')]=_0x594804;if(_0x3710e0[_0x2097('0x40')]['includeAll']){_0x49b724['include']=[{'all':!![]}];}return db['ServicenowConfiguration'][_0x2097('0x50')](_0x49b724);})[_0x2097('0x20')](function(_0x4c4ef9){_0xf65266[_0x2097('0x51')]=_0x4c4ef9;return _0xf65266;})[_0x2097('0x20')](respondWithFilteredResult(_0x296281,_0x49b724))['catch'](handleError(_0x296281,null));};exports['show']=function(_0x23acf3,_0x21829d){var _0x1b4de6={'raw':![],'where':{'id':_0x23acf3[_0x2097('0x52')]['id']}},_0x5a0c05={};_0x5a0c05[_0x2097('0x44')]=_['keys'](db[_0x2097('0x3b')][_0x2097('0x3c')]);_0x5a0c05[_0x2097('0x40')]=_[_0x2097('0x41')](_0x23acf3[_0x2097('0x40')]);_0x5a0c05['filters']=_['intersection'](_0x5a0c05[_0x2097('0x44')],_0x5a0c05[_0x2097('0x40')]);_0x1b4de6[_0x2097('0x45')]=_['intersection'](_0x5a0c05['model'],qs[_0x2097('0x46')](_0x23acf3[_0x2097('0x40')]['fields']));_0x1b4de6[_0x2097('0x45')]=_0x1b4de6[_0x2097('0x45')][_0x2097('0x53')]?_0x1b4de6[_0x2097('0x45')]:_0x5a0c05[_0x2097('0x44')];if(_0x23acf3['query'][_0x2097('0x54')]){_0x1b4de6[_0x2097('0x55')]=[{'all':!![]}];}_0x1b4de6=_[_0x2097('0x4e')]({},_0x1b4de6,_0x23acf3['options']);return db[_0x2097('0x3b')][_0x2097('0x56')](_0x1b4de6)['then'](handleEntityNotFound(_0x21829d,null))[_0x2097('0x20')](respondWithResult(_0x21829d,null))['catch'](handleError(_0x21829d,null));};exports[_0x2097('0x57')]=function(_0x56a0d1,_0x48742a){return db['ServicenowConfiguration'][_0x2097('0x57')](_0x56a0d1['body'],{})['then'](respondWithResult(_0x48742a,0xc9))[_0x2097('0x2b')](handleError(_0x48742a,null));};exports['update']=function(_0x597322,_0x5465ea){if(_0x597322['body']['id']){delete _0x597322[_0x2097('0x58')]['id'];}return db[_0x2097('0x3b')][_0x2097('0x56')]({'where':{'id':_0x597322[_0x2097('0x52')]['id']}})[_0x2097('0x20')](handleEntityNotFound(_0x5465ea,null))['then'](saveUpdates(_0x597322[_0x2097('0x58')],null))['then'](respondWithResult(_0x5465ea,null))[_0x2097('0x2b')](handleError(_0x5465ea,null));};exports[_0x2097('0x35')]=function(_0x24f166,_0x55e3cd){return db[_0x2097('0x3b')][_0x2097('0x56')]({'where':{'id':_0x24f166[_0x2097('0x52')]['id']}})[_0x2097('0x20')](handleEntityNotFound(_0x55e3cd,null))[_0x2097('0x20')](removeEntity(_0x55e3cd,null))['catch'](handleError(_0x55e3cd,null));};exports['getFields']=function(_0x265eac,_0x275578,_0x4cc782){var _0x4ddb4b={};var _0x4c5f0d={};var _0x5781aa;var _0x14b2d4;return db['ServicenowConfiguration'][_0x2097('0x59')]({'where':{'id':_0x265eac[_0x2097('0x52')]['id']}})['then'](handleEntityNotFound(_0x275578,null))[_0x2097('0x20')](function(_0x234e7d){if(_0x234e7d){_0x5781aa=_0x234e7d;_0x4c5f0d[_0x2097('0x44')]=_[_0x2097('0x41')](db[_0x2097('0x5a')][_0x2097('0x3c')]);_0x4c5f0d[_0x2097('0x40')]=_[_0x2097('0x41')](_0x265eac[_0x2097('0x40')]);_0x4c5f0d['filters']=_[_0x2097('0x43')](_0x4c5f0d[_0x2097('0x44')],_0x4c5f0d[_0x2097('0x40')]);_0x4ddb4b[_0x2097('0x45')]=_[_0x2097('0x43')](_0x4c5f0d[_0x2097('0x44')],qs['fields'](_0x265eac[_0x2097('0x40')][_0x2097('0x46')]));_0x4ddb4b[_0x2097('0x45')]=_0x4ddb4b[_0x2097('0x45')][_0x2097('0x53')]?_0x4ddb4b['attributes']:_0x4c5f0d[_0x2097('0x44')];_0x4ddb4b[_0x2097('0x49')]=qs['sort'](_0x265eac['query']['sort']);_0x4ddb4b[_0x2097('0x4c')]=qs[_0x2097('0x42')](_[_0x2097('0x5b')](_0x265eac[_0x2097('0x40')],_0x4c5f0d[_0x2097('0x42')]));if(_0x265eac[_0x2097('0x40')][_0x2097('0x4b')]){_0x4ddb4b[_0x2097('0x4c')]=_[_0x2097('0x4e')](_0x4ddb4b['where'],{'$or':_['map'](_0x4ddb4b[_0x2097('0x45')],function(_0x34d832){var _0x1eeb30={};_0x1eeb30[_0x34d832]={'$like':'%'+_0x265eac[_0x2097('0x40')][_0x2097('0x4b')]+'%'};return _0x1eeb30;})});}_0x4ddb4b=_[_0x2097('0x4e')]({},_0x4ddb4b,_0x265eac['options']);return _0x5781aa[_0x2097('0x5c')](_0x4ddb4b);}})[_0x2097('0x20')](function(_0x1614ca){if(_0x1614ca){_0x14b2d4=_0x1614ca[_0x2097('0x53')];if(!_0x265eac['query']['hasOwnProperty'](_0x2097('0x48'))){_0x4ddb4b[_0x2097('0x31')]=qs['limit'](_0x265eac[_0x2097('0x40')][_0x2097('0x31')]);_0x4ddb4b[_0x2097('0x30')]=qs[_0x2097('0x30')](_0x265eac[_0x2097('0x40')][_0x2097('0x30')]);}return _0x5781aa[_0x2097('0x5c')](_0x4ddb4b);}})[_0x2097('0x20')](function(_0x54159e){if(_0x54159e){return _0x54159e?{'count':_0x14b2d4,'rows':_0x54159e}:null;}})[_0x2097('0x20')](respondWithResult(_0x275578,null))[_0x2097('0x2b')](handleError(_0x275578,null));};exports['getSubjects']=function(_0x1742a9,_0xd81d45,_0x2bde2b){var _0x143c4f={};var _0x307c43={};var _0x46d6b5;var _0x4592c2;return db[_0x2097('0x3b')][_0x2097('0x59')]({'where':{'id':_0x1742a9[_0x2097('0x52')]['id']}})[_0x2097('0x20')](handleEntityNotFound(_0xd81d45,null))['then'](function(_0xf365a4){if(_0xf365a4){_0x46d6b5=_0xf365a4;_0x307c43[_0x2097('0x44')]=_[_0x2097('0x41')](db[_0x2097('0x5a')][_0x2097('0x3c')]);_0x307c43['query']=_[_0x2097('0x41')](_0x1742a9[_0x2097('0x40')]);_0x307c43[_0x2097('0x42')]=_['intersection'](_0x307c43[_0x2097('0x44')],_0x307c43['query']);_0x143c4f[_0x2097('0x45')]=_['intersection'](_0x307c43[_0x2097('0x44')],qs['fields'](_0x1742a9[_0x2097('0x40')]['fields']));_0x143c4f[_0x2097('0x45')]=_0x143c4f[_0x2097('0x45')][_0x2097('0x53')]?_0x143c4f[_0x2097('0x45')]:_0x307c43[_0x2097('0x44')];_0x143c4f['order']=qs[_0x2097('0x4a')](_0x1742a9[_0x2097('0x40')][_0x2097('0x4a')]);_0x143c4f[_0x2097('0x4c')]=qs[_0x2097('0x42')](_[_0x2097('0x5b')](_0x1742a9[_0x2097('0x40')],_0x307c43[_0x2097('0x42')]));if(_0x1742a9[_0x2097('0x40')][_0x2097('0x4b')]){_0x143c4f[_0x2097('0x4c')]=_[_0x2097('0x4e')](_0x143c4f[_0x2097('0x4c')],{'$or':_[_0x2097('0x3a')](_0x143c4f[_0x2097('0x45')],function(_0xf3831c){var _0x57a31e={};_0x57a31e[_0xf3831c]={'$like':'%'+_0x1742a9[_0x2097('0x40')]['filter']+'%'};return _0x57a31e;})});}_0x143c4f=_['merge']({},_0x143c4f,_0x1742a9[_0x2097('0x4f')]);return _0x46d6b5[_0x2097('0x5d')](_0x143c4f);}})[_0x2097('0x20')](function(_0x4b33d2){if(_0x4b33d2){_0x4592c2=_0x4b33d2[_0x2097('0x53')];if(!_0x1742a9[_0x2097('0x40')][_0x2097('0x47')](_0x2097('0x48'))){_0x143c4f['limit']=qs[_0x2097('0x31')](_0x1742a9['query'][_0x2097('0x31')]);_0x143c4f[_0x2097('0x30')]=qs[_0x2097('0x30')](_0x1742a9[_0x2097('0x40')]['offset']);}return _0x46d6b5[_0x2097('0x5d')](_0x143c4f);}})[_0x2097('0x20')](function(_0x31ec19){if(_0x31ec19){return _0x31ec19?{'count':_0x4592c2,'rows':_0x31ec19}:null;}})['then'](respondWithResult(_0xd81d45,null))[_0x2097('0x2b')](handleError(_0xd81d45,null));};exports[_0x2097('0x5e')]=function(_0x382302,_0x50ea7d,_0x99f3dd){var _0x33a572={};var _0x266d21={};var _0x1afdd5;var _0x336cda;return db[_0x2097('0x3b')]['findOne']({'where':{'id':_0x382302['params']['id']}})[_0x2097('0x20')](handleEntityNotFound(_0x50ea7d,null))[_0x2097('0x20')](function(_0x4213d0){if(_0x4213d0){_0x1afdd5=_0x4213d0;_0x266d21[_0x2097('0x44')]=_[_0x2097('0x41')](db[_0x2097('0x5a')]['rawAttributes']);_0x266d21[_0x2097('0x40')]=_[_0x2097('0x41')](_0x382302[_0x2097('0x40')]);_0x266d21[_0x2097('0x42')]=_[_0x2097('0x43')](_0x266d21[_0x2097('0x44')],_0x266d21[_0x2097('0x40')]);_0x33a572['attributes']=_[_0x2097('0x43')](_0x266d21[_0x2097('0x44')],qs[_0x2097('0x46')](_0x382302[_0x2097('0x40')][_0x2097('0x46')]));_0x33a572[_0x2097('0x45')]=_0x33a572['attributes']['length']?_0x33a572[_0x2097('0x45')]:_0x266d21['model'];_0x33a572['order']=qs[_0x2097('0x4a')](_0x382302[_0x2097('0x40')][_0x2097('0x4a')]);_0x33a572[_0x2097('0x4c')]=qs[_0x2097('0x42')](_[_0x2097('0x5b')](_0x382302[_0x2097('0x40')],_0x266d21[_0x2097('0x42')]));if(_0x382302['query'][_0x2097('0x4b')]){_0x33a572[_0x2097('0x4c')]=_[_0x2097('0x4e')](_0x33a572[_0x2097('0x4c')],{'$or':_[_0x2097('0x3a')](_0x33a572['attributes'],function(_0x2789ed){var _0xc439e0={};_0xc439e0[_0x2789ed]={'$like':'%'+_0x382302[_0x2097('0x40')][_0x2097('0x4b')]+'%'};return _0xc439e0;})});}_0x33a572=_[_0x2097('0x4e')]({},_0x33a572,_0x382302[_0x2097('0x4f')]);return _0x1afdd5['getDescriptions'](_0x33a572);}})[_0x2097('0x20')](function(_0x79f858){if(_0x79f858){_0x336cda=_0x79f858['length'];if(!_0x382302['query']['hasOwnProperty']('nolimit')){_0x33a572[_0x2097('0x31')]=qs[_0x2097('0x31')](_0x382302[_0x2097('0x40')][_0x2097('0x31')]);_0x33a572[_0x2097('0x30')]=qs['offset'](_0x382302[_0x2097('0x40')][_0x2097('0x30')]);}return _0x1afdd5[_0x2097('0x5e')](_0x33a572);}})[_0x2097('0x20')](function(_0x1afc2d){if(_0x1afc2d){return _0x1afc2d?{'count':_0x336cda,'rows':_0x1afc2d}:null;}})[_0x2097('0x20')](respondWithResult(_0x50ea7d,null))['catch'](handleError(_0x50ea7d,null));};
\ No newline at end of file
+var _0x80ed=['rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','client','http','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','ServicenowConfiguration,\x20%s,\x20%s','request\x20sent','debug','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','status','json','count','offset','limit','Content-Range','apply','update','end','sendStatus','stack','name','send','index','map','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','merge','type','options','ServicenowConfiguration','includeAll','include','rows','show','params','fields','find','create','body','getFields','findOne','ServicenowField','pick','filter','getSubjects','getDescriptions','html-pdf'];(function(_0x10349d,_0x196fa5){var _0x4e4b72=function(_0x402bcc){while(--_0x402bcc){_0x10349d['push'](_0x10349d['shift']());}};_0x4e4b72(++_0x196fa5);}(_0x80ed,0x11c));var _0xd80e=function(_0x183ac6,_0x116612){_0x183ac6=_0x183ac6-0x0;var _0xd88667=_0x80ed[_0x183ac6];return _0xd88667;};'use strict';var pdf=require(_0xd80e('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xd80e('0x1'));var zipdir=require(_0xd80e('0x2'));var jsonpatch=require(_0xd80e('0x3'));var rp=require('request-promise');var moment=require(_0xd80e('0x4'));var BPromise=require(_0xd80e('0x5'));var Mustache=require(_0xd80e('0x6'));var util=require(_0xd80e('0x7'));var path=require('path');var sox=require(_0xd80e('0x8'));var csv=require(_0xd80e('0x9'));var ejs=require(_0xd80e('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0xd80e('0xb'));var crypto=require(_0xd80e('0xc'));var jsforce=require(_0xd80e('0xd'));var deskjs=require(_0xd80e('0xe'));var toCsv=require(_0xd80e('0x9'));var querystring=require(_0xd80e('0xf'));var Papa=require(_0xd80e('0x10'));var Redis=require(_0xd80e('0x11'));var authService=require(_0xd80e('0x12'));var qs=require(_0xd80e('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd80e('0x14'));var logger=require(_0xd80e('0x15'))(_0xd80e('0x16'));var utils=require(_0xd80e('0x17'));var config=require(_0xd80e('0x18'));var db=require(_0xd80e('0x19'))['db'];var jayson=require(_0xd80e('0x1a'));var client=jayson[_0xd80e('0x1b')][_0xd80e('0x1c')]({'port':0x232a});function checkPasswordPattern(_0x4fb01c,_0x5691a1,_0x5eb3b2){if(_0x5eb3b2){var _0x57fefb=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x57fefb[_0xd80e('0x1d')](_0x5691a1)){return _0x4fb01c;}else{throw new db[(_0xd80e('0x1e'))][(_0xd80e('0x1f'))](_0xd80e('0x20'));}}else{return _0x4fb01c;}}function respondWithRpcPromise(_0x449c60,_0x58a17e,_0x595683,_0x2c8c61){return new BPromise(function(_0x3124e8,_0x3b48ae){var _0x40a4d5=_0x2c8c61||client;return _0x40a4d5[_0xd80e('0x21')](_0x449c60,_0x595683)[_0xd80e('0x22')](function(_0x22ab67){logger['info'](_0xd80e('0x23'),_0x58a17e,_0xd80e('0x24'));logger[_0xd80e('0x25')](_0xd80e('0x26'),_0x58a17e,'request\x20sent',JSON[_0xd80e('0x27')](_0x22ab67));if(_0x22ab67[_0xd80e('0x28')]){if(_0x22ab67[_0xd80e('0x28')]['code']===0x1f4){logger[_0xd80e('0x28')](_0xd80e('0x23'),_0x58a17e,_0x22ab67[_0xd80e('0x28')][_0xd80e('0x29')]);return _0x3b48ae(_0x22ab67[_0xd80e('0x28')]['message']);}logger['error'](_0xd80e('0x23'),_0x58a17e,_0x22ab67[_0xd80e('0x28')][_0xd80e('0x29')]);return _0x3124e8(_0x22ab67[_0xd80e('0x28')][_0xd80e('0x29')]);}else{logger[_0xd80e('0x2a')](_0xd80e('0x23'),_0x58a17e,'request\x20sent');_0x3124e8(_0x22ab67[_0xd80e('0x2b')][_0xd80e('0x29')]);}})[_0xd80e('0x2c')](function(_0x5b0d6d){logger[_0xd80e('0x28')](_0xd80e('0x23'),_0x58a17e,_0x5b0d6d);_0x3b48ae(_0x5b0d6d);});});}function respondWithStatusCode(_0xe9bb59,_0x482779){_0x482779=_0x482779||0xcc;return function(_0x521aa4){if(_0x521aa4){return _0xe9bb59['sendStatus'](_0x482779);}return _0xe9bb59[_0xd80e('0x2d')](_0x482779)['end']();};}function respondWithResult(_0x9f9287,_0x1044cc){_0x1044cc=_0x1044cc||0xc8;return function(_0x4e8ed9){if(_0x4e8ed9){return _0x9f9287[_0xd80e('0x2d')](_0x1044cc)[_0xd80e('0x2e')](_0x4e8ed9);}};}function respondWithFilteredResult(_0x30d6fc,_0x46c05d){return function(_0x5376eb){if(_0x5376eb){var _0x15f317=_0x5376eb[_0xd80e('0x2f')],_0x1ad3bc=_0x46c05d[_0xd80e('0x30')],_0x845451=_0x46c05d[_0xd80e('0x30')]+_0x46c05d[_0xd80e('0x31')],_0x39088b;if(_0x845451>=_0x15f317){_0x845451=_0x15f317;_0x39088b=0xc8;}else{_0x39088b=0xce;}_0x30d6fc['status'](_0x39088b);return _0x30d6fc['set'](_0xd80e('0x32'),_0x1ad3bc+'-'+_0x845451+'/'+_0x15f317)[_0xd80e('0x2e')](_0x5376eb);}return null;};}function patchUpdates(_0x400220){return function(_0x32360c){try{jsonpatch[_0xd80e('0x33')](_0x32360c,_0x400220,!![]);}catch(_0x44b440){return BPromise['reject'](_0x44b440);}return _0x32360c['save']();};}function saveUpdates(_0x39c124,_0x2d6ae5){return function(_0x380f4f){if(_0x380f4f){return _0x380f4f[_0xd80e('0x34')](_0x39c124)[_0xd80e('0x22')](function(_0x36c554){return _0x36c554;});}return null;};}function removeEntity(_0x289164,_0x1a0dfe){return function(_0x4fd1b2){if(_0x4fd1b2){return _0x4fd1b2['destroy']()[_0xd80e('0x22')](function(){_0x289164[_0xd80e('0x2d')](0xcc)[_0xd80e('0x35')]();});}};}function handleEntityNotFound(_0x12d113,_0x447b70){return function(_0x271b23){if(!_0x271b23){_0x12d113[_0xd80e('0x36')](0x194);}return _0x271b23;};}function handleError(_0x3cb956,_0x2ea0dd){_0x2ea0dd=_0x2ea0dd||0x1f4;return function(_0x192c08){logger['error'](_0x192c08[_0xd80e('0x37')]);if(_0x192c08['name']){delete _0x192c08[_0xd80e('0x38')];}_0x3cb956[_0xd80e('0x2d')](_0x2ea0dd)[_0xd80e('0x39')](_0x192c08);};}exports[_0xd80e('0x3a')]=function(_0x5a1fda,_0x3e44d7){var _0x54a969={},_0x3275fa={},_0x4f15a9={'count':0x0,'rows':[]};var _0xfb551a=_[_0xd80e('0x3b')](db['ServicenowConfiguration'][_0xd80e('0x3c')],function(_0x41ac0d){return{'name':_0x41ac0d[_0xd80e('0x3d')],'type':_0x41ac0d['type'][_0xd80e('0x3e')]};});_0x3275fa[_0xd80e('0x3f')]=_[_0xd80e('0x3b')](_0xfb551a,_0xd80e('0x38'));_0x3275fa[_0xd80e('0x40')]=_[_0xd80e('0x41')](_0x5a1fda[_0xd80e('0x40')]);_0x3275fa[_0xd80e('0x42')]=_[_0xd80e('0x43')](_0x3275fa['model'],_0x3275fa['query']);_0x54a969['attributes']=_[_0xd80e('0x43')](_0x3275fa[_0xd80e('0x3f')],qs['fields'](_0x5a1fda[_0xd80e('0x40')]['fields']));_0x54a969[_0xd80e('0x44')]=_0x54a969['attributes'][_0xd80e('0x45')]?_0x54a969[_0xd80e('0x44')]:_0x3275fa['model'];if(!_0x5a1fda['query'][_0xd80e('0x46')](_0xd80e('0x47'))){_0x54a969[_0xd80e('0x31')]=qs[_0xd80e('0x31')](_0x5a1fda[_0xd80e('0x40')][_0xd80e('0x31')]);_0x54a969[_0xd80e('0x30')]=qs[_0xd80e('0x30')](_0x5a1fda[_0xd80e('0x40')][_0xd80e('0x30')]);}_0x54a969[_0xd80e('0x48')]=qs[_0xd80e('0x49')](_0x5a1fda[_0xd80e('0x40')][_0xd80e('0x49')]);_0x54a969[_0xd80e('0x4a')]=qs[_0xd80e('0x42')](_['pick'](_0x5a1fda['query'],_0x3275fa['filters']),_0xfb551a);if(_0x5a1fda[_0xd80e('0x40')]['filter']){_0x54a969[_0xd80e('0x4a')]=_[_0xd80e('0x4b')](_0x54a969[_0xd80e('0x4a')],{'$or':_[_0xd80e('0x3b')](_0xfb551a,function(_0x2612e7){if(_0x2612e7[_0xd80e('0x4c')]!=='VIRTUAL'){var _0x5cf97a={};_0x5cf97a[_0x2612e7['name']]={'$like':'%'+_0x5a1fda[_0xd80e('0x40')]['filter']+'%'};return _0x5cf97a;}})});}_0x54a969=_[_0xd80e('0x4b')]({},_0x54a969,_0x5a1fda[_0xd80e('0x4d')]);var _0x2a3db3={'where':_0x54a969[_0xd80e('0x4a')]};return db[_0xd80e('0x4e')]['count'](_0x2a3db3)[_0xd80e('0x22')](function(_0x4353f2){_0x4f15a9[_0xd80e('0x2f')]=_0x4353f2;if(_0x5a1fda['query'][_0xd80e('0x4f')]){_0x54a969[_0xd80e('0x50')]=[{'all':!![]}];}return db[_0xd80e('0x4e')]['findAll'](_0x54a969);})[_0xd80e('0x22')](function(_0x29aaa0){_0x4f15a9[_0xd80e('0x51')]=_0x29aaa0;return _0x4f15a9;})[_0xd80e('0x22')](respondWithFilteredResult(_0x3e44d7,_0x54a969))[_0xd80e('0x2c')](handleError(_0x3e44d7,null));};exports[_0xd80e('0x52')]=function(_0x56ba81,_0x5aad1b){var _0x275985={'raw':![],'where':{'id':_0x56ba81[_0xd80e('0x53')]['id']}},_0x27134e={};_0x27134e['model']=_['keys'](db[_0xd80e('0x4e')][_0xd80e('0x3c')]);_0x27134e[_0xd80e('0x40')]=_[_0xd80e('0x41')](_0x56ba81[_0xd80e('0x40')]);_0x27134e['filters']=_[_0xd80e('0x43')](_0x27134e['model'],_0x27134e[_0xd80e('0x40')]);_0x275985[_0xd80e('0x44')]=_['intersection'](_0x27134e[_0xd80e('0x3f')],qs[_0xd80e('0x54')](_0x56ba81[_0xd80e('0x40')][_0xd80e('0x54')]));_0x275985[_0xd80e('0x44')]=_0x275985[_0xd80e('0x44')][_0xd80e('0x45')]?_0x275985['attributes']:_0x27134e[_0xd80e('0x3f')];if(_0x56ba81[_0xd80e('0x40')][_0xd80e('0x4f')]){_0x275985['include']=[{'all':!![]}];}_0x275985=_['merge']({},_0x275985,_0x56ba81[_0xd80e('0x4d')]);return db[_0xd80e('0x4e')][_0xd80e('0x55')](_0x275985)[_0xd80e('0x22')](handleEntityNotFound(_0x5aad1b,null))[_0xd80e('0x22')](respondWithResult(_0x5aad1b,null))[_0xd80e('0x2c')](handleError(_0x5aad1b,null));};exports[_0xd80e('0x56')]=function(_0x3984fe,_0x5205c4){return db[_0xd80e('0x4e')]['create'](_0x3984fe[_0xd80e('0x57')],{})[_0xd80e('0x22')](respondWithResult(_0x5205c4,0xc9))[_0xd80e('0x2c')](handleError(_0x5205c4,null));};exports[_0xd80e('0x34')]=function(_0x915fcf,_0x11a21a){if(_0x915fcf['body']['id']){delete _0x915fcf[_0xd80e('0x57')]['id'];}return db['ServicenowConfiguration'][_0xd80e('0x55')]({'where':{'id':_0x915fcf[_0xd80e('0x53')]['id']}})['then'](handleEntityNotFound(_0x11a21a,null))['then'](saveUpdates(_0x915fcf[_0xd80e('0x57')],null))[_0xd80e('0x22')](respondWithResult(_0x11a21a,null))[_0xd80e('0x2c')](handleError(_0x11a21a,null));};exports['destroy']=function(_0x568770,_0x1ba0ed){return db[_0xd80e('0x4e')]['find']({'where':{'id':_0x568770[_0xd80e('0x53')]['id']}})[_0xd80e('0x22')](handleEntityNotFound(_0x1ba0ed,null))[_0xd80e('0x22')](removeEntity(_0x1ba0ed,null))['catch'](handleError(_0x1ba0ed,null));};exports[_0xd80e('0x58')]=function(_0x589c0b,_0x720eab,_0x392704){var _0x3d8e46={};var _0x29ce58={};var _0x5e892a;var _0x2df79e;return db['ServicenowConfiguration'][_0xd80e('0x59')]({'where':{'id':_0x589c0b['params']['id']}})[_0xd80e('0x22')](handleEntityNotFound(_0x720eab,null))[_0xd80e('0x22')](function(_0x4252eb){if(_0x4252eb){_0x5e892a=_0x4252eb;_0x29ce58[_0xd80e('0x3f')]=_['keys'](db[_0xd80e('0x5a')][_0xd80e('0x3c')]);_0x29ce58['query']=_[_0xd80e('0x41')](_0x589c0b[_0xd80e('0x40')]);_0x29ce58[_0xd80e('0x42')]=_[_0xd80e('0x43')](_0x29ce58['model'],_0x29ce58[_0xd80e('0x40')]);_0x3d8e46[_0xd80e('0x44')]=_['intersection'](_0x29ce58[_0xd80e('0x3f')],qs[_0xd80e('0x54')](_0x589c0b[_0xd80e('0x40')]['fields']));_0x3d8e46['attributes']=_0x3d8e46['attributes']['length']?_0x3d8e46[_0xd80e('0x44')]:_0x29ce58['model'];_0x3d8e46[_0xd80e('0x48')]=qs[_0xd80e('0x49')](_0x589c0b[_0xd80e('0x40')]['sort']);_0x3d8e46[_0xd80e('0x4a')]=qs[_0xd80e('0x42')](_[_0xd80e('0x5b')](_0x589c0b[_0xd80e('0x40')],_0x29ce58[_0xd80e('0x42')]));if(_0x589c0b[_0xd80e('0x40')][_0xd80e('0x5c')]){_0x3d8e46[_0xd80e('0x4a')]=_[_0xd80e('0x4b')](_0x3d8e46['where'],{'$or':_['map'](_0x3d8e46[_0xd80e('0x44')],function(_0x410ed6){var _0x10104c={};_0x10104c[_0x410ed6]={'$like':'%'+_0x589c0b[_0xd80e('0x40')]['filter']+'%'};return _0x10104c;})});}_0x3d8e46=_[_0xd80e('0x4b')]({},_0x3d8e46,_0x589c0b[_0xd80e('0x4d')]);return _0x5e892a[_0xd80e('0x58')](_0x3d8e46);}})[_0xd80e('0x22')](function(_0x130148){if(_0x130148){_0x2df79e=_0x130148['length'];if(!_0x589c0b[_0xd80e('0x40')][_0xd80e('0x46')](_0xd80e('0x47'))){_0x3d8e46[_0xd80e('0x31')]=qs['limit'](_0x589c0b[_0xd80e('0x40')][_0xd80e('0x31')]);_0x3d8e46[_0xd80e('0x30')]=qs[_0xd80e('0x30')](_0x589c0b[_0xd80e('0x40')][_0xd80e('0x30')]);}return _0x5e892a['getFields'](_0x3d8e46);}})[_0xd80e('0x22')](function(_0x393fb6){if(_0x393fb6){return _0x393fb6?{'count':_0x2df79e,'rows':_0x393fb6}:null;}})['then'](respondWithResult(_0x720eab,null))[_0xd80e('0x2c')](handleError(_0x720eab,null));};exports[_0xd80e('0x5d')]=function(_0x2f6fc8,_0x1d7a25,_0x5d91ae){var _0x324a79={};var _0x571951={};var _0x314fbb;var _0x879165;return db[_0xd80e('0x4e')][_0xd80e('0x59')]({'where':{'id':_0x2f6fc8[_0xd80e('0x53')]['id']}})['then'](handleEntityNotFound(_0x1d7a25,null))[_0xd80e('0x22')](function(_0x2fe14a){if(_0x2fe14a){_0x314fbb=_0x2fe14a;_0x571951[_0xd80e('0x3f')]=_[_0xd80e('0x41')](db['ServicenowField'][_0xd80e('0x3c')]);_0x571951[_0xd80e('0x40')]=_['keys'](_0x2f6fc8[_0xd80e('0x40')]);_0x571951[_0xd80e('0x42')]=_[_0xd80e('0x43')](_0x571951[_0xd80e('0x3f')],_0x571951[_0xd80e('0x40')]);_0x324a79[_0xd80e('0x44')]=_['intersection'](_0x571951['model'],qs[_0xd80e('0x54')](_0x2f6fc8['query']['fields']));_0x324a79[_0xd80e('0x44')]=_0x324a79[_0xd80e('0x44')][_0xd80e('0x45')]?_0x324a79[_0xd80e('0x44')]:_0x571951[_0xd80e('0x3f')];_0x324a79[_0xd80e('0x48')]=qs[_0xd80e('0x49')](_0x2f6fc8[_0xd80e('0x40')]['sort']);_0x324a79[_0xd80e('0x4a')]=qs[_0xd80e('0x42')](_[_0xd80e('0x5b')](_0x2f6fc8[_0xd80e('0x40')],_0x571951['filters']));if(_0x2f6fc8[_0xd80e('0x40')][_0xd80e('0x5c')]){_0x324a79['where']=_[_0xd80e('0x4b')](_0x324a79[_0xd80e('0x4a')],{'$or':_['map'](_0x324a79[_0xd80e('0x44')],function(_0x160dc4){var _0x472dd3={};_0x472dd3[_0x160dc4]={'$like':'%'+_0x2f6fc8[_0xd80e('0x40')][_0xd80e('0x5c')]+'%'};return _0x472dd3;})});}_0x324a79=_[_0xd80e('0x4b')]({},_0x324a79,_0x2f6fc8[_0xd80e('0x4d')]);return _0x314fbb[_0xd80e('0x5d')](_0x324a79);}})[_0xd80e('0x22')](function(_0x3d1a6c){if(_0x3d1a6c){_0x879165=_0x3d1a6c['length'];if(!_0x2f6fc8[_0xd80e('0x40')][_0xd80e('0x46')]('nolimit')){_0x324a79[_0xd80e('0x31')]=qs[_0xd80e('0x31')](_0x2f6fc8[_0xd80e('0x40')]['limit']);_0x324a79[_0xd80e('0x30')]=qs['offset'](_0x2f6fc8[_0xd80e('0x40')][_0xd80e('0x30')]);}return _0x314fbb[_0xd80e('0x5d')](_0x324a79);}})[_0xd80e('0x22')](function(_0x35cdce){if(_0x35cdce){return _0x35cdce?{'count':_0x879165,'rows':_0x35cdce}:null;}})['then'](respondWithResult(_0x1d7a25,null))[_0xd80e('0x2c')](handleError(_0x1d7a25,null));};exports[_0xd80e('0x5e')]=function(_0x33b72a,_0x2ce54f,_0xb0ec86){var _0x188971={};var _0x28657a={};var _0x12ae3e;var _0x29a279;return db[_0xd80e('0x4e')][_0xd80e('0x59')]({'where':{'id':_0x33b72a[_0xd80e('0x53')]['id']}})[_0xd80e('0x22')](handleEntityNotFound(_0x2ce54f,null))[_0xd80e('0x22')](function(_0x5ddd1f){if(_0x5ddd1f){_0x12ae3e=_0x5ddd1f;_0x28657a[_0xd80e('0x3f')]=_['keys'](db['ServicenowField']['rawAttributes']);_0x28657a[_0xd80e('0x40')]=_[_0xd80e('0x41')](_0x33b72a[_0xd80e('0x40')]);_0x28657a[_0xd80e('0x42')]=_['intersection'](_0x28657a[_0xd80e('0x3f')],_0x28657a[_0xd80e('0x40')]);_0x188971[_0xd80e('0x44')]=_['intersection'](_0x28657a['model'],qs[_0xd80e('0x54')](_0x33b72a['query'][_0xd80e('0x54')]));_0x188971[_0xd80e('0x44')]=_0x188971[_0xd80e('0x44')][_0xd80e('0x45')]?_0x188971[_0xd80e('0x44')]:_0x28657a[_0xd80e('0x3f')];_0x188971[_0xd80e('0x48')]=qs['sort'](_0x33b72a['query']['sort']);_0x188971[_0xd80e('0x4a')]=qs[_0xd80e('0x42')](_[_0xd80e('0x5b')](_0x33b72a[_0xd80e('0x40')],_0x28657a[_0xd80e('0x42')]));if(_0x33b72a[_0xd80e('0x40')][_0xd80e('0x5c')]){_0x188971[_0xd80e('0x4a')]=_[_0xd80e('0x4b')](_0x188971[_0xd80e('0x4a')],{'$or':_[_0xd80e('0x3b')](_0x188971[_0xd80e('0x44')],function(_0xebea83){var _0x4cecdb={};_0x4cecdb[_0xebea83]={'$like':'%'+_0x33b72a[_0xd80e('0x40')][_0xd80e('0x5c')]+'%'};return _0x4cecdb;})});}_0x188971=_[_0xd80e('0x4b')]({},_0x188971,_0x33b72a[_0xd80e('0x4d')]);return _0x12ae3e[_0xd80e('0x5e')](_0x188971);}})[_0xd80e('0x22')](function(_0x34fcb2){if(_0x34fcb2){_0x29a279=_0x34fcb2[_0xd80e('0x45')];if(!_0x33b72a[_0xd80e('0x40')][_0xd80e('0x46')]('nolimit')){_0x188971[_0xd80e('0x31')]=qs[_0xd80e('0x31')](_0x33b72a[_0xd80e('0x40')][_0xd80e('0x31')]);_0x188971['offset']=qs['offset'](_0x33b72a['query'][_0xd80e('0x30')]);}return _0x12ae3e[_0xd80e('0x5e')](_0x188971);}})['then'](function(_0xb5b831){if(_0xb5b831){return _0xb5b831?{'count':_0x29a279,'rows':_0xb5b831}:null;}})[_0xd80e('0x22')](respondWithResult(_0x2ce54f,null))[_0xd80e('0x2c')](handleError(_0x2ce54f,null));};
\ No newline at end of file
diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js
index dacb197..1db4aaf 100644
--- a/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js
+++ b/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xb697=['../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./intServicenowConfiguration.attributes','define','int_servicenow_configurations','lodash','util'];(function(_0xeef1ba,_0x46d82d){var _0x36dfa4=function(_0x2f0597){while(--_0x2f0597){_0xeef1ba['push'](_0xeef1ba['shift']());}};_0x36dfa4(++_0x46d82d);}(_0xb697,0x142));var _0x7b69=function(_0x5a86f6,_0x23e978){_0x5a86f6=_0x5a86f6-0x0;var _0x152235=_0xb697[_0x5a86f6];return _0x152235;};'use strict';var _=require(_0x7b69('0x0'));var util=require(_0x7b69('0x1'));var logger=require(_0x7b69('0x2'))(_0x7b69('0x3'));var moment=require(_0x7b69('0x4'));var BPromise=require('bluebird');var rp=require(_0x7b69('0x5'));var fs=require('fs');var path=require(_0x7b69('0x6'));var rimraf=require(_0x7b69('0x7'));var config=require(_0x7b69('0x8'));var attributes=require(_0x7b69('0x9'));module['exports']=function(_0x244582,_0x5e1ba7){return _0x244582[_0x7b69('0xa')]('ServicenowConfiguration',attributes,{'tableName':_0x7b69('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x2d18=['../../config/environment','./intServicenowConfiguration.attributes','exports','define','lodash','util','../../config/logger','api','request-promise','path','rimraf'];(function(_0x2f1eca,_0x171395){var _0x3f3dad=function(_0x18986b){while(--_0x18986b){_0x2f1eca['push'](_0x2f1eca['shift']());}};_0x3f3dad(++_0x171395);}(_0x2d18,0xd5));var _0x82d1=function(_0x31bc2d,_0x1c94fc){_0x31bc2d=_0x31bc2d-0x0;var _0x3c149e=_0x2d18[_0x31bc2d];return _0x3c149e;};'use strict';var _=require(_0x82d1('0x0'));var util=require(_0x82d1('0x1'));var logger=require(_0x82d1('0x2'))(_0x82d1('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x82d1('0x4'));var fs=require('fs');var path=require(_0x82d1('0x5'));var rimraf=require(_0x82d1('0x6'));var config=require(_0x82d1('0x7'));var attributes=require(_0x82d1('0x8'));module[_0x82d1('0x9')]=function(_0x32b9c8,_0x3e36a0){return _0x32b9c8[_0x82d1('0xa')]('ServicenowConfiguration',attributes,{'tableName':'int_servicenow_configurations','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.rpc.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.rpc.js
index ad28303..247c53b 100644
--- a/server/api/intServicenowConfiguration/intServicenowConfiguration.rpc.js
+++ b/server/api/intServicenowConfiguration/intServicenowConfiguration.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x3804=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','ServicenowConfiguration,\x20%s,\x20%s','debug','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x4744d9,_0x21abae){var _0x38e47e=function(_0x24d6dc){while(--_0x24d6dc){_0x4744d9['push'](_0x4744d9['shift']());}};_0x38e47e(++_0x21abae);}(_0x3804,0x10c));var _0x4380=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3804[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x4380('0x0'));var util=require(_0x4380('0x1'));var moment=require(_0x4380('0x2'));var BPromise=require(_0x4380('0x3'));var rs=require(_0x4380('0x4'));var fs=require('fs');var Redis=require(_0x4380('0x5'));var db=require(_0x4380('0x6'))['db'];var utils=require(_0x4380('0x7'));var logger=require(_0x4380('0x8'))(_0x4380('0x9'));var config=require(_0x4380('0xa'));var jayson=require(_0x4380('0xb'));var client=jayson[_0x4380('0xc')][_0x4380('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x58b9c2,_0x1cd86b,_0x14d09d){return new BPromise(function(_0x1a8c8a,_0x464660){return client[_0x4380('0xe')](_0x58b9c2,_0x14d09d)['then'](function(_0x2b77f8){logger[_0x4380('0xf')](_0x4380('0x10'),_0x1cd86b,'request\x20sent');logger[_0x4380('0x11')](_0x4380('0x12'),_0x1cd86b,_0x4380('0x13'),JSON[_0x4380('0x14')](_0x2b77f8));if(_0x2b77f8[_0x4380('0x15')]){if(_0x2b77f8['error']['code']===0x1f4){logger[_0x4380('0x15')](_0x4380('0x10'),_0x1cd86b,_0x2b77f8[_0x4380('0x15')]['message']);return _0x464660(_0x2b77f8[_0x4380('0x15')]['message']);}logger['error']('ServicenowConfiguration,\x20%s,\x20%s',_0x1cd86b,_0x2b77f8[_0x4380('0x15')][_0x4380('0x16')]);return _0x1a8c8a(_0x2b77f8[_0x4380('0x15')][_0x4380('0x16')]);}else{logger[_0x4380('0xf')](_0x4380('0x10'),_0x1cd86b,_0x4380('0x13'));_0x1a8c8a(_0x2b77f8[_0x4380('0x17')][_0x4380('0x16')]);}})[_0x4380('0x18')](function(_0x52c742){logger[_0x4380('0x15')](_0x4380('0x10'),_0x1cd86b,_0x52c742);_0x464660(_0x52c742);});});}
\ No newline at end of file
+var _0x134d=['../../config/utils','../../config/logger','rpc','http','request','then','ServicenowConfiguration,\x20%s,\x20%s','request\x20sent','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb'];(function(_0x1ebee8,_0x1251fc){var _0x46529c=function(_0x4c2fec){while(--_0x4c2fec){_0x1ebee8['push'](_0x1ebee8['shift']());}};_0x46529c(++_0x1251fc);}(_0x134d,0x8d));var _0xd134=function(_0x71174c,_0x42a7d6){_0x71174c=_0x71174c-0x0;var _0x4b6b9d=_0x134d[_0x71174c];return _0x4b6b9d;};'use strict';var _=require(_0xd134('0x0'));var util=require(_0xd134('0x1'));var moment=require(_0xd134('0x2'));var BPromise=require(_0xd134('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd134('0x4'));var db=require(_0xd134('0x5'))['db'];var utils=require(_0xd134('0x6'));var logger=require(_0xd134('0x7'))(_0xd134('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0xd134('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1290f6,_0x1b7cd6,_0x3654c0){return new BPromise(function(_0x22e0fd,_0x5e370c){return client[_0xd134('0xa')](_0x1290f6,_0x3654c0)[_0xd134('0xb')](function(_0x146b8a){logger['info'](_0xd134('0xc'),_0x1b7cd6,_0xd134('0xd'));logger['debug'](_0xd134('0xe'),_0x1b7cd6,'request\x20sent',JSON[_0xd134('0xf')](_0x146b8a));if(_0x146b8a[_0xd134('0x10')]){if(_0x146b8a[_0xd134('0x10')][_0xd134('0x11')]===0x1f4){logger[_0xd134('0x10')](_0xd134('0xc'),_0x1b7cd6,_0x146b8a['error']['message']);return _0x5e370c(_0x146b8a[_0xd134('0x10')][_0xd134('0x12')]);}logger[_0xd134('0x10')](_0xd134('0xc'),_0x1b7cd6,_0x146b8a[_0xd134('0x10')][_0xd134('0x12')]);return _0x22e0fd(_0x146b8a[_0xd134('0x10')][_0xd134('0x12')]);}else{logger['info'](_0xd134('0xc'),_0x1b7cd6,'request\x20sent');_0x22e0fd(_0x146b8a[_0xd134('0x13')][_0xd134('0x12')]);}})[_0xd134('0x14')](function(_0x11bb28){logger[_0xd134('0x10')](_0xd134('0xc'),_0x1b7cd6,_0x11bb28);_0x5e370c(_0x11bb28);});});}
\ No newline at end of file
diff --git a/server/api/intServicenowField/index.js b/server/api/intServicenowField/index.js
index 0a4b552..ec434bd 100644
--- a/server/api/intServicenowField/index.js
+++ b/server/api/intServicenowField/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9057=['update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','./intServicenowField.controller','get','index','show','post','isAuthenticated','create','/:id'];(function(_0x160877,_0x14eb80){var _0x35933c=function(_0x4496ce){while(--_0x4496ce){_0x160877['push'](_0x160877['shift']());}};_0x35933c(++_0x14eb80);}(_0x9057,0x134));var _0x7905=function(_0x289891,_0x49a0fa){_0x289891=_0x289891-0x0;var _0x31cf2e=_0x9057[_0x289891];return _0x31cf2e;};'use strict';var multer=require(_0x7905('0x0'));var util=require(_0x7905('0x1'));var path=require(_0x7905('0x2'));var timeout=require(_0x7905('0x3'));var express=require(_0x7905('0x4'));var router=express[_0x7905('0x5')]();var auth=require(_0x7905('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x7905('0x7'));router[_0x7905('0x8')]('/',auth['isAuthenticated'](),controller[_0x7905('0x9')]);router[_0x7905('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x7905('0xa')]);router[_0x7905('0xb')]('/',auth[_0x7905('0xc')](),controller[_0x7905('0xd')]);router['put'](_0x7905('0xe'),auth[_0x7905('0xc')](),controller[_0x7905('0xf')]);router[_0x7905('0x10')]('/:id',auth[_0x7905('0xc')](),controller[_0x7905('0x11')]);module[_0x7905('0x12')]=router;
\ No newline at end of file
+var _0x3b2c=['/:id','post','create','put','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./intServicenowField.controller','isAuthenticated','index','get'];(function(_0x53417c,_0x126dee){var _0x49407d=function(_0x1b1737){while(--_0x1b1737){_0x53417c['push'](_0x53417c['shift']());}};_0x49407d(++_0x126dee);}(_0x3b2c,0x75));var _0xc3b2=function(_0x23134c,_0x1e9a42){_0x23134c=_0x23134c-0x0;var _0x13a5ec=_0x3b2c[_0x23134c];return _0x13a5ec;};'use strict';var multer=require(_0xc3b2('0x0'));var util=require(_0xc3b2('0x1'));var path=require('path');var timeout=require(_0xc3b2('0x2'));var express=require(_0xc3b2('0x3'));var router=express[_0xc3b2('0x4')]();var auth=require(_0xc3b2('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xc3b2('0x6'));var controller=require(_0xc3b2('0x7'));router['get']('/',auth[_0xc3b2('0x8')](),controller[_0xc3b2('0x9')]);router[_0xc3b2('0xa')](_0xc3b2('0xb'),auth[_0xc3b2('0x8')](),controller['show']);router[_0xc3b2('0xc')]('/',auth[_0xc3b2('0x8')](),controller[_0xc3b2('0xd')]);router[_0xc3b2('0xe')](_0xc3b2('0xb'),auth[_0xc3b2('0x8')](),controller['update']);router['delete'](_0xc3b2('0xb'),auth[_0xc3b2('0x8')](),controller['destroy']);module[_0xc3b2('0xf')]=router;
\ No newline at end of file
diff --git a/server/api/intServicenowField/intServicenowField.attributes.js b/server/api/intServicenowField/intServicenowField.attributes.js
index 23e8927..5d98b9e 100644
--- a/server/api/intServicenowField/intServicenowField.attributes.js
+++ b/server/api/intServicenowField/intServicenowField.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x5393=['keyValue','string','STRING','ENUM','sequelize','exports','variable'];(function(_0x3b1738,_0x3f9e8b){var _0x4a4cc4=function(_0x28bbcf){while(--_0x28bbcf){_0x3b1738['push'](_0x3b1738['shift']());}};_0x4a4cc4(++_0x3f9e8b);}(_0x5393,0x1b6));var _0x3539=function(_0x31ed45,_0x299f5a){_0x31ed45=_0x31ed45-0x0;var _0x46888a=_0x5393[_0x31ed45];return _0x46888a;};'use strict';var Sequelize=require(_0x3539('0x0'));module[_0x3539('0x1')]={'type':{'type':Sequelize['ENUM']('string',_0x3539('0x2'),'customVariable',_0x3539('0x3')),'defaultValue':_0x3539('0x4')},'content':{'type':Sequelize[_0x3539('0x5')]},'key':{'type':Sequelize[_0x3539('0x5')]},'keyType':{'type':Sequelize[_0x3539('0x6')](_0x3539('0x4'),'variable','customVariable')},'keyContent':{'type':Sequelize[_0x3539('0x5')]},'idField':{'type':Sequelize[_0x3539('0x5')]},'nameField':{'type':Sequelize[_0x3539('0x5')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x3539('0x5')]}};
\ No newline at end of file
+var _0x6d7c=['customVariable','keyValue','STRING','variable','BOOLEAN','sequelize','exports','ENUM','string'];(function(_0x5a7d5f,_0x5695cb){var _0x5dcded=function(_0x13f053){while(--_0x13f053){_0x5a7d5f['push'](_0x5a7d5f['shift']());}};_0x5dcded(++_0x5695cb);}(_0x6d7c,0x1c7));var _0xc6d7=function(_0x342107,_0x3dc07e){_0x342107=_0x342107-0x0;var _0x46328c=_0x6d7c[_0x342107];return _0x46328c;};'use strict';var Sequelize=require(_0xc6d7('0x0'));module[_0xc6d7('0x1')]={'type':{'type':Sequelize[_0xc6d7('0x2')](_0xc6d7('0x3'),'variable',_0xc6d7('0x4'),_0xc6d7('0x5')),'defaultValue':_0xc6d7('0x3')},'content':{'type':Sequelize[_0xc6d7('0x6')]},'key':{'type':Sequelize[_0xc6d7('0x6')]},'keyType':{'type':Sequelize[_0xc6d7('0x2')](_0xc6d7('0x3'),_0xc6d7('0x7'),_0xc6d7('0x4'))},'keyContent':{'type':Sequelize[_0xc6d7('0x6')]},'idField':{'type':Sequelize[_0xc6d7('0x6')]},'nameField':{'type':Sequelize[_0xc6d7('0x6')]},'customField':{'type':Sequelize[_0xc6d7('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}};
\ No newline at end of file
diff --git a/server/api/intServicenowField/intServicenowField.controller.js b/server/api/intServicenowField/intServicenowField.controller.js
index 6bd3ba8..36953ab 100644
--- a/server/api/intServicenowField/intServicenowField.controller.js
+++ b/server/api/intServicenowField/intServicenowField.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xa9e0=['sort','where','pick','filter','VIRTUAL','merge','options','include','findAll','catch','params','includeAll','create','body','find','html-pdf','eml-format','rimraf','request-promise','bluebird','mustache','util','path','sox','ejs','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../mysqldb','sendStatus','status','json','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','end','error','name','send','index','map','ServicenowField','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','limit'];(function(_0x1094e8,_0x10317a){var _0x1bc9ab=function(_0x209240){while(--_0x209240){_0x1094e8['push'](_0x1094e8['shift']());}};_0x1bc9ab(++_0x10317a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x311c35,_0x534915){_0x311c35=_0x311c35-0x0;var _0x5cc50c=_0xa9e0[_0x311c35];return _0x5cc50c;};'use strict';var pdf=require(_0x0a9e('0x0'));var emlformat=require(_0x0a9e('0x1'));var rimraf=require(_0x0a9e('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0a9e('0x3'));var moment=require('moment');var BPromise=require(_0x0a9e('0x4'));var Mustache=require(_0x0a9e('0x5'));var util=require(_0x0a9e('0x6'));var path=require(_0x0a9e('0x7'));var sox=require(_0x0a9e('0x8'));var csv=require('to-csv');var ejs=require(_0x0a9e('0x9'));var fs=require('fs');var _=require(_0x0a9e('0xa'));var squel=require(_0x0a9e('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0a9e('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0a9e('0xd'));var Redis=require(_0x0a9e('0xe'));var authService=require(_0x0a9e('0xf'));var qs=require(_0x0a9e('0x10'));var as=require(_0x0a9e('0x11'));var hardwareService=require(_0x0a9e('0x12'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x0a9e('0x13'))['db'];function respondWithStatusCode(_0x36471c,_0xd5b662){_0xd5b662=_0xd5b662||0xcc;return function(_0x26d672){if(_0x26d672){return _0x36471c[_0x0a9e('0x14')](_0xd5b662);}return _0x36471c[_0x0a9e('0x15')](_0xd5b662)['end']();};}function respondWithResult(_0x4283ce,_0x239b12){_0x239b12=_0x239b12||0xc8;return function(_0x2b4227){if(_0x2b4227){return _0x4283ce[_0x0a9e('0x15')](_0x239b12)[_0x0a9e('0x16')](_0x2b4227);}};}function respondWithFilteredResult(_0x4d5611,_0x52a03d){return function(_0x22dccb){if(_0x22dccb){var _0x5d0880=_0x22dccb[_0x0a9e('0x17')],_0x1985b6=_0x52a03d['offset'],_0x519dfd=_0x52a03d[_0x0a9e('0x18')]+_0x52a03d['limit'],_0x16033c;if(_0x519dfd>=_0x5d0880){_0x519dfd=_0x5d0880;_0x16033c=0xc8;}else{_0x16033c=0xce;}_0x4d5611[_0x0a9e('0x15')](_0x16033c);return _0x4d5611[_0x0a9e('0x19')](_0x0a9e('0x1a'),_0x1985b6+'-'+_0x519dfd+'/'+_0x5d0880)[_0x0a9e('0x16')](_0x22dccb);}return null;};}function patchUpdates(_0x31b1ca){return function(_0x2eb11f){try{jsonpatch[_0x0a9e('0x1b')](_0x2eb11f,_0x31b1ca,!![]);}catch(_0x20559e){return BPromise[_0x0a9e('0x1c')](_0x20559e);}return _0x2eb11f[_0x0a9e('0x1d')]();};}function saveUpdates(_0x1c696a,_0x105080){return function(_0x4bb1e3){if(_0x4bb1e3){return _0x4bb1e3[_0x0a9e('0x1e')](_0x1c696a)[_0x0a9e('0x1f')](function(_0x53682f){return _0x53682f;});}return null;};}function removeEntity(_0x20f109,_0x5a09ef){return function(_0x588269){if(_0x588269){return _0x588269[_0x0a9e('0x20')]()[_0x0a9e('0x1f')](function(){_0x20f109[_0x0a9e('0x15')](0xcc)[_0x0a9e('0x21')]();});}};}function handleEntityNotFound(_0x4abc77,_0xfb6e48){return function(_0x2fb0e4){if(!_0x2fb0e4){_0x4abc77[_0x0a9e('0x14')](0x194);}return _0x2fb0e4;};}function handleError(_0x4d00e6,_0x370d86){_0x370d86=_0x370d86||0x1f4;return function(_0x42ac8f){logger[_0x0a9e('0x22')](_0x42ac8f['stack']);if(_0x42ac8f['name']){delete _0x42ac8f[_0x0a9e('0x23')];}_0x4d00e6[_0x0a9e('0x15')](_0x370d86)[_0x0a9e('0x24')](_0x42ac8f);};}exports[_0x0a9e('0x25')]=function(_0x526cf3,_0x384319){var _0x479bc4={},_0x45a1e7={},_0x5bfb33={'count':0x0,'rows':[]};var _0x1dc186=_[_0x0a9e('0x26')](db[_0x0a9e('0x27')][_0x0a9e('0x28')],function(_0x140511){return{'name':_0x140511[_0x0a9e('0x29')],'type':_0x140511[_0x0a9e('0x2a')][_0x0a9e('0x2b')]};});_0x45a1e7['model']=_[_0x0a9e('0x26')](_0x1dc186,_0x0a9e('0x23'));_0x45a1e7[_0x0a9e('0x2c')]=_[_0x0a9e('0x2d')](_0x526cf3['query']);_0x45a1e7[_0x0a9e('0x2e')]=_[_0x0a9e('0x2f')](_0x45a1e7[_0x0a9e('0x30')],_0x45a1e7[_0x0a9e('0x2c')]);_0x479bc4[_0x0a9e('0x31')]=_[_0x0a9e('0x2f')](_0x45a1e7[_0x0a9e('0x30')],qs[_0x0a9e('0x32')](_0x526cf3[_0x0a9e('0x2c')]['fields']));_0x479bc4[_0x0a9e('0x31')]=_0x479bc4['attributes'][_0x0a9e('0x33')]?_0x479bc4[_0x0a9e('0x31')]:_0x45a1e7[_0x0a9e('0x30')];if(!_0x526cf3[_0x0a9e('0x2c')][_0x0a9e('0x34')]('nolimit')){_0x479bc4[_0x0a9e('0x35')]=qs[_0x0a9e('0x35')](_0x526cf3[_0x0a9e('0x2c')][_0x0a9e('0x35')]);_0x479bc4[_0x0a9e('0x18')]=qs[_0x0a9e('0x18')](_0x526cf3[_0x0a9e('0x2c')][_0x0a9e('0x18')]);}_0x479bc4['order']=qs[_0x0a9e('0x36')](_0x526cf3['query'][_0x0a9e('0x36')]);_0x479bc4[_0x0a9e('0x37')]=qs[_0x0a9e('0x2e')](_[_0x0a9e('0x38')](_0x526cf3['query'],_0x45a1e7[_0x0a9e('0x2e')]),_0x1dc186);if(_0x526cf3[_0x0a9e('0x2c')][_0x0a9e('0x39')]){_0x479bc4[_0x0a9e('0x37')]=_['merge'](_0x479bc4['where'],{'$or':_[_0x0a9e('0x26')](_0x1dc186,function(_0x5640eb){if(_0x5640eb[_0x0a9e('0x2a')]!==_0x0a9e('0x3a')){var _0x381c37={};_0x381c37[_0x5640eb[_0x0a9e('0x23')]]={'$like':'%'+_0x526cf3['query'][_0x0a9e('0x39')]+'%'};return _0x381c37;}})});}_0x479bc4=_[_0x0a9e('0x3b')]({},_0x479bc4,_0x526cf3[_0x0a9e('0x3c')]);var _0x533942={'where':_0x479bc4[_0x0a9e('0x37')]};return db[_0x0a9e('0x27')][_0x0a9e('0x17')](_0x533942)['then'](function(_0x546ef8){_0x5bfb33[_0x0a9e('0x17')]=_0x546ef8;if(_0x526cf3[_0x0a9e('0x2c')]['includeAll']){_0x479bc4[_0x0a9e('0x3d')]=[{'all':!![]}];}return db[_0x0a9e('0x27')][_0x0a9e('0x3e')](_0x479bc4);})[_0x0a9e('0x1f')](function(_0x4b38d9){_0x5bfb33['rows']=_0x4b38d9;return _0x5bfb33;})[_0x0a9e('0x1f')](respondWithFilteredResult(_0x384319,_0x479bc4))[_0x0a9e('0x3f')](handleError(_0x384319,null));};exports['show']=function(_0x183991,_0x1dec2e){var _0x1459bb={'raw':!![],'where':{'id':_0x183991[_0x0a9e('0x40')]['id']}},_0x5b4f5e={};_0x5b4f5e[_0x0a9e('0x30')]=_[_0x0a9e('0x2d')](db[_0x0a9e('0x27')][_0x0a9e('0x28')]);_0x5b4f5e[_0x0a9e('0x2c')]=_[_0x0a9e('0x2d')](_0x183991[_0x0a9e('0x2c')]);_0x5b4f5e[_0x0a9e('0x2e')]=_[_0x0a9e('0x2f')](_0x5b4f5e[_0x0a9e('0x30')],_0x5b4f5e[_0x0a9e('0x2c')]);_0x1459bb[_0x0a9e('0x31')]=_[_0x0a9e('0x2f')](_0x5b4f5e[_0x0a9e('0x30')],qs['fields'](_0x183991['query'][_0x0a9e('0x32')]));_0x1459bb[_0x0a9e('0x31')]=_0x1459bb[_0x0a9e('0x31')][_0x0a9e('0x33')]?_0x1459bb[_0x0a9e('0x31')]:_0x5b4f5e[_0x0a9e('0x30')];if(_0x183991[_0x0a9e('0x2c')][_0x0a9e('0x41')]){_0x1459bb[_0x0a9e('0x3d')]=[{'all':!![]}];}_0x1459bb=_[_0x0a9e('0x3b')]({},_0x1459bb,_0x183991[_0x0a9e('0x3c')]);return db[_0x0a9e('0x27')]['find'](_0x1459bb)[_0x0a9e('0x1f')](handleEntityNotFound(_0x1dec2e,null))[_0x0a9e('0x1f')](respondWithResult(_0x1dec2e,null))[_0x0a9e('0x3f')](handleError(_0x1dec2e,null));};exports[_0x0a9e('0x42')]=function(_0x2e8caf,_0xbe9d19){return db[_0x0a9e('0x27')][_0x0a9e('0x42')](_0x2e8caf['body'],{})[_0x0a9e('0x1f')](respondWithResult(_0xbe9d19,0xc9))['catch'](handleError(_0xbe9d19,null));};exports[_0x0a9e('0x1e')]=function(_0x476688,_0x8d6dd1){if(_0x476688['body']['id']){delete _0x476688[_0x0a9e('0x43')]['id'];}return db[_0x0a9e('0x27')][_0x0a9e('0x44')]({'where':{'id':_0x476688[_0x0a9e('0x40')]['id']}})[_0x0a9e('0x1f')](handleEntityNotFound(_0x8d6dd1,null))[_0x0a9e('0x1f')](saveUpdates(_0x476688[_0x0a9e('0x43')],null))['then'](respondWithResult(_0x8d6dd1,null))[_0x0a9e('0x3f')](handleError(_0x8d6dd1,null));};exports[_0x0a9e('0x20')]=function(_0x1b5e80,_0x16f976){return db[_0x0a9e('0x27')][_0x0a9e('0x44')]({'where':{'id':_0x1b5e80[_0x0a9e('0x40')]['id']}})[_0x0a9e('0x1f')](handleEntityNotFound(_0x16f976,null))[_0x0a9e('0x1f')](removeEntity(_0x16f976,null))['catch'](handleError(_0x16f976,null));};
\ No newline at end of file
+var _0xa9e0=['sort','where','pick','filter','VIRTUAL','merge','options','include','findAll','catch','params','includeAll','create','body','find','html-pdf','eml-format','rimraf','request-promise','bluebird','mustache','util','path','sox','ejs','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../mysqldb','sendStatus','status','json','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','end','error','name','send','index','map','ServicenowField','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','limit'];(function(_0x5a2dac,_0x5f1c81){var _0x14deec=function(_0x959d5e){while(--_0x959d5e){_0x5a2dac['push'](_0x5a2dac['shift']());}};_0x14deec(++_0x5f1c81);}(_0xa9e0,0x123));var _0x0a9e=function(_0x29b609,_0x19d388){_0x29b609=_0x29b609-0x0;var _0x54c952=_0xa9e0[_0x29b609];return _0x54c952;};'use strict';var pdf=require(_0x0a9e('0x0'));var emlformat=require(_0x0a9e('0x1'));var rimraf=require(_0x0a9e('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0a9e('0x3'));var moment=require('moment');var BPromise=require(_0x0a9e('0x4'));var Mustache=require(_0x0a9e('0x5'));var util=require(_0x0a9e('0x6'));var path=require(_0x0a9e('0x7'));var sox=require(_0x0a9e('0x8'));var csv=require('to-csv');var ejs=require(_0x0a9e('0x9'));var fs=require('fs');var _=require(_0x0a9e('0xa'));var squel=require(_0x0a9e('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0a9e('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0a9e('0xd'));var Redis=require(_0x0a9e('0xe'));var authService=require(_0x0a9e('0xf'));var qs=require(_0x0a9e('0x10'));var as=require(_0x0a9e('0x11'));var hardwareService=require(_0x0a9e('0x12'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x0a9e('0x13'))['db'];function respondWithStatusCode(_0x36471c,_0xd5b662){_0xd5b662=_0xd5b662||0xcc;return function(_0x26d672){if(_0x26d672){return _0x36471c[_0x0a9e('0x14')](_0xd5b662);}return _0x36471c[_0x0a9e('0x15')](_0xd5b662)['end']();};}function respondWithResult(_0x4283ce,_0x239b12){_0x239b12=_0x239b12||0xc8;return function(_0x2b4227){if(_0x2b4227){return _0x4283ce[_0x0a9e('0x15')](_0x239b12)[_0x0a9e('0x16')](_0x2b4227);}};}function respondWithFilteredResult(_0x4d5611,_0x52a03d){return function(_0x22dccb){if(_0x22dccb){var _0x5d0880=_0x22dccb[_0x0a9e('0x17')],_0x1985b6=_0x52a03d['offset'],_0x519dfd=_0x52a03d[_0x0a9e('0x18')]+_0x52a03d['limit'],_0x16033c;if(_0x519dfd>=_0x5d0880){_0x519dfd=_0x5d0880;_0x16033c=0xc8;}else{_0x16033c=0xce;}_0x4d5611[_0x0a9e('0x15')](_0x16033c);return _0x4d5611[_0x0a9e('0x19')](_0x0a9e('0x1a'),_0x1985b6+'-'+_0x519dfd+'/'+_0x5d0880)[_0x0a9e('0x16')](_0x22dccb);}return null;};}function patchUpdates(_0x31b1ca){return function(_0x2eb11f){try{jsonpatch[_0x0a9e('0x1b')](_0x2eb11f,_0x31b1ca,!![]);}catch(_0x20559e){return BPromise[_0x0a9e('0x1c')](_0x20559e);}return _0x2eb11f[_0x0a9e('0x1d')]();};}function saveUpdates(_0x1c696a,_0x105080){return function(_0x4bb1e3){if(_0x4bb1e3){return _0x4bb1e3[_0x0a9e('0x1e')](_0x1c696a)[_0x0a9e('0x1f')](function(_0x53682f){return _0x53682f;});}return null;};}function removeEntity(_0x20f109,_0x5a09ef){return function(_0x588269){if(_0x588269){return _0x588269[_0x0a9e('0x20')]()[_0x0a9e('0x1f')](function(){_0x20f109[_0x0a9e('0x15')](0xcc)[_0x0a9e('0x21')]();});}};}function handleEntityNotFound(_0x4abc77,_0xfb6e48){return function(_0x2fb0e4){if(!_0x2fb0e4){_0x4abc77[_0x0a9e('0x14')](0x194);}return _0x2fb0e4;};}function handleError(_0x4d00e6,_0x370d86){_0x370d86=_0x370d86||0x1f4;return function(_0x42ac8f){logger[_0x0a9e('0x22')](_0x42ac8f['stack']);if(_0x42ac8f['name']){delete _0x42ac8f[_0x0a9e('0x23')];}_0x4d00e6[_0x0a9e('0x15')](_0x370d86)[_0x0a9e('0x24')](_0x42ac8f);};}exports[_0x0a9e('0x25')]=function(_0x526cf3,_0x384319){var _0x479bc4={},_0x45a1e7={},_0x5bfb33={'count':0x0,'rows':[]};var _0x1dc186=_[_0x0a9e('0x26')](db[_0x0a9e('0x27')][_0x0a9e('0x28')],function(_0x140511){return{'name':_0x140511[_0x0a9e('0x29')],'type':_0x140511[_0x0a9e('0x2a')][_0x0a9e('0x2b')]};});_0x45a1e7['model']=_[_0x0a9e('0x26')](_0x1dc186,_0x0a9e('0x23'));_0x45a1e7[_0x0a9e('0x2c')]=_[_0x0a9e('0x2d')](_0x526cf3['query']);_0x45a1e7[_0x0a9e('0x2e')]=_[_0x0a9e('0x2f')](_0x45a1e7[_0x0a9e('0x30')],_0x45a1e7[_0x0a9e('0x2c')]);_0x479bc4[_0x0a9e('0x31')]=_[_0x0a9e('0x2f')](_0x45a1e7[_0x0a9e('0x30')],qs[_0x0a9e('0x32')](_0x526cf3[_0x0a9e('0x2c')]['fields']));_0x479bc4[_0x0a9e('0x31')]=_0x479bc4['attributes'][_0x0a9e('0x33')]?_0x479bc4[_0x0a9e('0x31')]:_0x45a1e7[_0x0a9e('0x30')];if(!_0x526cf3[_0x0a9e('0x2c')][_0x0a9e('0x34')]('nolimit')){_0x479bc4[_0x0a9e('0x35')]=qs[_0x0a9e('0x35')](_0x526cf3[_0x0a9e('0x2c')][_0x0a9e('0x35')]);_0x479bc4[_0x0a9e('0x18')]=qs[_0x0a9e('0x18')](_0x526cf3[_0x0a9e('0x2c')][_0x0a9e('0x18')]);}_0x479bc4['order']=qs[_0x0a9e('0x36')](_0x526cf3['query'][_0x0a9e('0x36')]);_0x479bc4[_0x0a9e('0x37')]=qs[_0x0a9e('0x2e')](_[_0x0a9e('0x38')](_0x526cf3['query'],_0x45a1e7[_0x0a9e('0x2e')]),_0x1dc186);if(_0x526cf3[_0x0a9e('0x2c')][_0x0a9e('0x39')]){_0x479bc4[_0x0a9e('0x37')]=_['merge'](_0x479bc4['where'],{'$or':_[_0x0a9e('0x26')](_0x1dc186,function(_0x5640eb){if(_0x5640eb[_0x0a9e('0x2a')]!==_0x0a9e('0x3a')){var _0x381c37={};_0x381c37[_0x5640eb[_0x0a9e('0x23')]]={'$like':'%'+_0x526cf3['query'][_0x0a9e('0x39')]+'%'};return _0x381c37;}})});}_0x479bc4=_[_0x0a9e('0x3b')]({},_0x479bc4,_0x526cf3[_0x0a9e('0x3c')]);var _0x533942={'where':_0x479bc4[_0x0a9e('0x37')]};return db[_0x0a9e('0x27')][_0x0a9e('0x17')](_0x533942)['then'](function(_0x546ef8){_0x5bfb33[_0x0a9e('0x17')]=_0x546ef8;if(_0x526cf3[_0x0a9e('0x2c')]['includeAll']){_0x479bc4[_0x0a9e('0x3d')]=[{'all':!![]}];}return db[_0x0a9e('0x27')][_0x0a9e('0x3e')](_0x479bc4);})[_0x0a9e('0x1f')](function(_0x4b38d9){_0x5bfb33['rows']=_0x4b38d9;return _0x5bfb33;})[_0x0a9e('0x1f')](respondWithFilteredResult(_0x384319,_0x479bc4))[_0x0a9e('0x3f')](handleError(_0x384319,null));};exports['show']=function(_0x183991,_0x1dec2e){var _0x1459bb={'raw':!![],'where':{'id':_0x183991[_0x0a9e('0x40')]['id']}},_0x5b4f5e={};_0x5b4f5e[_0x0a9e('0x30')]=_[_0x0a9e('0x2d')](db[_0x0a9e('0x27')][_0x0a9e('0x28')]);_0x5b4f5e[_0x0a9e('0x2c')]=_[_0x0a9e('0x2d')](_0x183991[_0x0a9e('0x2c')]);_0x5b4f5e[_0x0a9e('0x2e')]=_[_0x0a9e('0x2f')](_0x5b4f5e[_0x0a9e('0x30')],_0x5b4f5e[_0x0a9e('0x2c')]);_0x1459bb[_0x0a9e('0x31')]=_[_0x0a9e('0x2f')](_0x5b4f5e[_0x0a9e('0x30')],qs['fields'](_0x183991['query'][_0x0a9e('0x32')]));_0x1459bb[_0x0a9e('0x31')]=_0x1459bb[_0x0a9e('0x31')][_0x0a9e('0x33')]?_0x1459bb[_0x0a9e('0x31')]:_0x5b4f5e[_0x0a9e('0x30')];if(_0x183991[_0x0a9e('0x2c')][_0x0a9e('0x41')]){_0x1459bb[_0x0a9e('0x3d')]=[{'all':!![]}];}_0x1459bb=_[_0x0a9e('0x3b')]({},_0x1459bb,_0x183991[_0x0a9e('0x3c')]);return db[_0x0a9e('0x27')]['find'](_0x1459bb)[_0x0a9e('0x1f')](handleEntityNotFound(_0x1dec2e,null))[_0x0a9e('0x1f')](respondWithResult(_0x1dec2e,null))[_0x0a9e('0x3f')](handleError(_0x1dec2e,null));};exports[_0x0a9e('0x42')]=function(_0x2e8caf,_0xbe9d19){return db[_0x0a9e('0x27')][_0x0a9e('0x42')](_0x2e8caf['body'],{})[_0x0a9e('0x1f')](respondWithResult(_0xbe9d19,0xc9))['catch'](handleError(_0xbe9d19,null));};exports[_0x0a9e('0x1e')]=function(_0x476688,_0x8d6dd1){if(_0x476688['body']['id']){delete _0x476688[_0x0a9e('0x43')]['id'];}return db[_0x0a9e('0x27')][_0x0a9e('0x44')]({'where':{'id':_0x476688[_0x0a9e('0x40')]['id']}})[_0x0a9e('0x1f')](handleEntityNotFound(_0x8d6dd1,null))[_0x0a9e('0x1f')](saveUpdates(_0x476688[_0x0a9e('0x43')],null))['then'](respondWithResult(_0x8d6dd1,null))[_0x0a9e('0x3f')](handleError(_0x8d6dd1,null));};exports[_0x0a9e('0x20')]=function(_0x1b5e80,_0x16f976){return db[_0x0a9e('0x27')][_0x0a9e('0x44')]({'where':{'id':_0x1b5e80[_0x0a9e('0x40')]['id']}})[_0x0a9e('0x1f')](handleEntityNotFound(_0x16f976,null))[_0x0a9e('0x1f')](removeEntity(_0x16f976,null))['catch'](handleError(_0x16f976,null));};
\ No newline at end of file
diff --git a/server/api/intServicenowField/intServicenowField.model.js b/server/api/intServicenowField/intServicenowField.model.js
index 78ea51a..ee29679 100644
--- a/server/api/intServicenowField/intServicenowField.model.js
+++ b/server/api/intServicenowField/intServicenowField.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x60ea=['FieldId','lodash','util','api','bluebird','request-promise','path','rimraf','../../config/environment','define','ServicenowField','int_servicenow_fields','servicenow_unique_index','idField'];(function(_0x1b986e,_0x2ebaee){var _0x54ca2e=function(_0x34f03c){while(--_0x34f03c){_0x1b986e['push'](_0x1b986e['shift']());}};_0x54ca2e(++_0x2ebaee);}(_0x60ea,0x71));var _0xa60e=function(_0x205520,_0x2ac651){_0x205520=_0x205520-0x0;var _0x369862=_0x60ea[_0x205520];return _0x369862;};'use strict';var _=require(_0xa60e('0x0'));var util=require(_0xa60e('0x1'));var logger=require('../../config/logger')(_0xa60e('0x2'));var moment=require('moment');var BPromise=require(_0xa60e('0x3'));var rp=require(_0xa60e('0x4'));var fs=require('fs');var path=require(_0xa60e('0x5'));var rimraf=require(_0xa60e('0x6'));var config=require(_0xa60e('0x7'));var attributes=require('./intServicenowField.attributes');module['exports']=function(_0x38d4a1,_0x4ea389){return _0x38d4a1[_0xa60e('0x8')](_0xa60e('0x9'),attributes,{'tableName':_0xa60e('0xa'),'paranoid':![],'indexes':[{'name':_0xa60e('0xb'),'fields':[_0xa60e('0xc'),_0xa60e('0xd')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x2045=['../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment','./intServicenowField.attributes','define','int_servicenow_fields','servicenow_unique_index','idField','FieldId','lodash','util'];(function(_0x5a5a2d,_0xf7e83f){var _0x36ed27=function(_0x4ce00e){while(--_0x4ce00e){_0x5a5a2d['push'](_0x5a5a2d['shift']());}};_0x36ed27(++_0xf7e83f);}(_0x2045,0x6e));var _0x5204=function(_0x46ae5a,_0x2a38d0){_0x46ae5a=_0x46ae5a-0x0;var _0x434986=_0x2045[_0x46ae5a];return _0x434986;};'use strict';var _=require(_0x5204('0x0'));var util=require(_0x5204('0x1'));var logger=require(_0x5204('0x2'))(_0x5204('0x3'));var moment=require('moment');var BPromise=require(_0x5204('0x4'));var rp=require(_0x5204('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x5204('0x6'));var config=require(_0x5204('0x7'));var attributes=require(_0x5204('0x8'));module['exports']=function(_0x4b557b,_0x5428c1){return _0x4b557b[_0x5204('0x9')]('ServicenowField',attributes,{'tableName':_0x5204('0xa'),'paranoid':![],'indexes':[{'name':_0x5204('0xb'),'fields':[_0x5204('0xc'),_0x5204('0xd')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/intServicenowField/intServicenowField.rpc.js b/server/api/intServicenowField/intServicenowField.rpc.js
index a75f667..a72e35f 100644
--- a/server/api/intServicenowField/intServicenowField.rpc.js
+++ b/server/api/intServicenowField/intServicenowField.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xd7d2=['error','code','message','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','ServicenowField,\x20%s,\x20%s','request\x20sent','ServicenowField,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x5862cb,_0x365117){var _0x45d448=function(_0x163e4a){while(--_0x163e4a){_0x5862cb['push'](_0x5862cb['shift']());}};_0x45d448(++_0x365117);}(_0xd7d2,0x10b));var _0x2d7d=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0xd7d2[_0x432682];return _0x463d05;};'use strict';var _=require(_0x2d7d('0x0'));var util=require(_0x2d7d('0x1'));var moment=require(_0x2d7d('0x2'));var BPromise=require(_0x2d7d('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2d7d('0x4'));var db=require(_0x2d7d('0x5'))['db'];var utils=require(_0x2d7d('0x6'));var logger=require(_0x2d7d('0x7'))('rpc');var config=require(_0x2d7d('0x8'));var jayson=require(_0x2d7d('0x9'));var client=jayson[_0x2d7d('0xa')][_0x2d7d('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2679b4,_0x5ce786,_0x29afa0){return new BPromise(function(_0x49b0df,_0x1b2e82){return client[_0x2d7d('0xc')](_0x2679b4,_0x29afa0)[_0x2d7d('0xd')](function(_0x55bbf9){logger[_0x2d7d('0xe')](_0x2d7d('0xf'),_0x5ce786,_0x2d7d('0x10'));logger['debug'](_0x2d7d('0x11'),_0x5ce786,_0x2d7d('0x10'),JSON[_0x2d7d('0x12')](_0x55bbf9));if(_0x55bbf9[_0x2d7d('0x13')]){if(_0x55bbf9[_0x2d7d('0x13')][_0x2d7d('0x14')]===0x1f4){logger[_0x2d7d('0x13')](_0x2d7d('0xf'),_0x5ce786,_0x55bbf9[_0x2d7d('0x13')][_0x2d7d('0x15')]);return _0x1b2e82(_0x55bbf9[_0x2d7d('0x13')]['message']);}logger[_0x2d7d('0x13')](_0x2d7d('0xf'),_0x5ce786,_0x55bbf9[_0x2d7d('0x13')][_0x2d7d('0x15')]);return _0x49b0df(_0x55bbf9['error'][_0x2d7d('0x15')]);}else{logger[_0x2d7d('0xe')](_0x2d7d('0xf'),_0x5ce786,_0x2d7d('0x10'));_0x49b0df(_0x55bbf9['result'][_0x2d7d('0x15')]);}})['catch'](function(_0x5e4d9a){logger[_0x2d7d('0x13')](_0x2d7d('0xf'),_0x5ce786,_0x5e4d9a);_0x1b2e82(_0x5e4d9a);});});}
\ No newline at end of file
+var _0x66ee=['request','then','info','ServicenowField,\x20%s,\x20%s','request\x20sent','ServicenowField,\x20%s,\x20%s,\x20%s','error','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x4dbaad,_0x730318){var _0x226c72=function(_0x501972){while(--_0x501972){_0x4dbaad['push'](_0x4dbaad['shift']());}};_0x226c72(++_0x730318);}(_0x66ee,0x1ab));var _0xe66e=function(_0x53408b,_0x17a924){_0x53408b=_0x53408b-0x0;var _0x1c3fd0=_0x66ee[_0x53408b];return _0x1c3fd0;};'use strict';var _=require(_0xe66e('0x0'));var util=require(_0xe66e('0x1'));var moment=require(_0xe66e('0x2'));var BPromise=require(_0xe66e('0x3'));var rs=require(_0xe66e('0x4'));var fs=require('fs');var Redis=require(_0xe66e('0x5'));var db=require(_0xe66e('0x6'))['db'];var utils=require(_0xe66e('0x7'));var logger=require(_0xe66e('0x8'))(_0xe66e('0x9'));var config=require(_0xe66e('0xa'));var jayson=require(_0xe66e('0xb'));var client=jayson['client'][_0xe66e('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x47f103,_0x4f0f13,_0x3f86fa){return new BPromise(function(_0x2befb4,_0x1f4d0a){return client[_0xe66e('0xd')](_0x47f103,_0x3f86fa)[_0xe66e('0xe')](function(_0x814ee0){logger[_0xe66e('0xf')](_0xe66e('0x10'),_0x4f0f13,_0xe66e('0x11'));logger['debug'](_0xe66e('0x12'),_0x4f0f13,_0xe66e('0x11'),JSON['stringify'](_0x814ee0));if(_0x814ee0[_0xe66e('0x13')]){if(_0x814ee0[_0xe66e('0x13')]['code']===0x1f4){logger['error'](_0xe66e('0x10'),_0x4f0f13,_0x814ee0[_0xe66e('0x13')][_0xe66e('0x14')]);return _0x1f4d0a(_0x814ee0['error'][_0xe66e('0x14')]);}logger['error'](_0xe66e('0x10'),_0x4f0f13,_0x814ee0[_0xe66e('0x13')][_0xe66e('0x14')]);return _0x2befb4(_0x814ee0['error'][_0xe66e('0x14')]);}else{logger['info'](_0xe66e('0x10'),_0x4f0f13,'request\x20sent');_0x2befb4(_0x814ee0['result'][_0xe66e('0x14')]);}})[_0xe66e('0x15')](function(_0x5f5be3){logger['error']('ServicenowField,\x20%s,\x20%s',_0x4f0f13,_0x5f5be3);_0x1f4d0a(_0x5f5be3);});});}
\ No newline at end of file
diff --git a/server/api/intSugarcrmAccount/index.js b/server/api/intSugarcrmAccount/index.js
index b3254d2..b5b524d 100644
--- a/server/api/intSugarcrmAccount/index.js
+++ b/server/api/intSugarcrmAccount/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xeefa=['/:id/fields','getFields','post','create','/:id/configurations','addConfiguration','put','update','delete','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSugarcrmAccount.controller','get','isAuthenticated','index','getConfigurations'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xeefa,0x195));var _0xaeef=function(_0x5c465a,_0xf2d0a1){_0x5c465a=_0x5c465a-0x0;var _0x26bd64=_0xeefa[_0x5c465a];return _0x26bd64;};'use strict';var multer=require('multer');var util=require(_0xaeef('0x0'));var path=require(_0xaeef('0x1'));var timeout=require(_0xaeef('0x2'));var express=require(_0xaeef('0x3'));var router=express[_0xaeef('0x4')]();var auth=require(_0xaeef('0x5'));var interaction=require(_0xaeef('0x6'));var config=require(_0xaeef('0x7'));var controller=require(_0xaeef('0x8'));router[_0xaeef('0x9')]('/',auth[_0xaeef('0xa')](),controller[_0xaeef('0xb')]);router['get']('/:id',auth[_0xaeef('0xa')](),controller['show']);router[_0xaeef('0x9')]('/:id/configurations',auth[_0xaeef('0xa')](),controller[_0xaeef('0xc')]);router[_0xaeef('0x9')](_0xaeef('0xd'),auth[_0xaeef('0xa')](),controller[_0xaeef('0xe')]);router[_0xaeef('0xf')]('/',auth[_0xaeef('0xa')](),controller[_0xaeef('0x10')]);router['post'](_0xaeef('0x11'),auth[_0xaeef('0xa')](),controller[_0xaeef('0x12')]);router[_0xaeef('0x13')]('/:id',auth['isAuthenticated'](),controller[_0xaeef('0x14')]);router[_0xaeef('0x15')]('/:id',auth['isAuthenticated'](),controller['destroy']);module['exports']=router;
\ No newline at end of file
+var _0xc29a=['connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSugarcrmAccount.controller','get','isAuthenticated','index','/:id','show','/:id/configurations','/:id/fields','getFields','post','create','addConfiguration','put','update','delete','exports','multer','util'];(function(_0x50565a,_0x3c276d){var _0x1f17a9=function(_0x315279){while(--_0x315279){_0x50565a['push'](_0x50565a['shift']());}};_0x1f17a9(++_0x3c276d);}(_0xc29a,0xcd));var _0xac29=function(_0x1c1532,_0x58f42e){_0x1c1532=_0x1c1532-0x0;var _0x150b7a=_0xc29a[_0x1c1532];return _0x150b7a;};'use strict';var multer=require(_0xac29('0x0'));var util=require(_0xac29('0x1'));var path=require('path');var timeout=require(_0xac29('0x2'));var express=require(_0xac29('0x3'));var router=express['Router']();var auth=require(_0xac29('0x4'));var interaction=require(_0xac29('0x5'));var config=require(_0xac29('0x6'));var controller=require(_0xac29('0x7'));router[_0xac29('0x8')]('/',auth[_0xac29('0x9')](),controller[_0xac29('0xa')]);router[_0xac29('0x8')](_0xac29('0xb'),auth['isAuthenticated'](),controller[_0xac29('0xc')]);router[_0xac29('0x8')](_0xac29('0xd'),auth[_0xac29('0x9')](),controller['getConfigurations']);router[_0xac29('0x8')](_0xac29('0xe'),auth[_0xac29('0x9')](),controller[_0xac29('0xf')]);router[_0xac29('0x10')]('/',auth[_0xac29('0x9')](),controller[_0xac29('0x11')]);router[_0xac29('0x10')](_0xac29('0xd'),auth[_0xac29('0x9')](),controller[_0xac29('0x12')]);router[_0xac29('0x13')](_0xac29('0xb'),auth[_0xac29('0x9')](),controller[_0xac29('0x14')]);router[_0xac29('0x15')](_0xac29('0xb'),auth[_0xac29('0x9')](),controller['destroy']);module[_0xac29('0x16')]=router;
\ No newline at end of file
diff --git a/server/api/intSugarcrmAccount/intSugarcrmAccount.attributes.js b/server/api/intSugarcrmAccount/intSugarcrmAccount.attributes.js
index 3b8a970..834383d 100644
--- a/server/api/intSugarcrmAccount/intSugarcrmAccount.attributes.js
+++ b/server/api/intSugarcrmAccount/intSugarcrmAccount.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xdcdc=['sequelize','exports','STRING','username','remoteUri'];(function(_0x209eca,_0x2e57d1){var _0x2dad03=function(_0x30cf72){while(--_0x30cf72){_0x209eca['push'](_0x209eca['shift']());}};_0x2dad03(++_0x2e57d1);}(_0xdcdc,0x8c));var _0xcdcd=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0xdcdc[_0x1facfa];return _0x9ec701;};'use strict';var Sequelize=require(_0xcdcd('0x0'));module[_0xcdcd('0x1')]={'name':{'type':Sequelize[_0xcdcd('0x2')]},'description':{'type':Sequelize[_0xcdcd('0x2')]},'username':{'type':Sequelize[_0xcdcd('0x2')],'unique':_0xcdcd('0x3')},'password':{'type':Sequelize[_0xcdcd('0x2')]},'remoteUri':{'type':Sequelize[_0xcdcd('0x2')],'unique':_0xcdcd('0x4')},'serverUrl':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x68ef=['STRING','username','sequelize'];(function(_0x33c2fc,_0x4b2269){var _0xfafed4=function(_0x2230bd){while(--_0x2230bd){_0x33c2fc['push'](_0x33c2fc['shift']());}};_0xfafed4(++_0x4b2269);}(_0x68ef,0x10a));var _0xf68e=function(_0x355a19,_0x570f37){_0x355a19=_0x355a19-0x0;var _0xf6b59a=_0x68ef[_0x355a19];return _0xf6b59a;};'use strict';var Sequelize=require(_0xf68e('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xf68e('0x1')]},'username':{'type':Sequelize[_0xf68e('0x1')],'unique':_0xf68e('0x2')},'password':{'type':Sequelize[_0xf68e('0x1')]},'remoteUri':{'type':Sequelize['STRING'],'unique':'remoteUri'},'serverUrl':{'type':Sequelize[_0xf68e('0x1')]}};
\ No newline at end of file
diff --git a/server/api/intSugarcrmAccount/intSugarcrmAccount.controller.js b/server/api/intSugarcrmAccount/intSugarcrmAccount.controller.js
index dd119ba..0d2ab51 100644
--- a/server/api/intSugarcrmAccount/intSugarcrmAccount.controller.js
+++ b/server/api/intSugarcrmAccount/intSugarcrmAccount.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xd5dd=['send','index','rawAttributes','fieldName','type','key','model','map','query','keys','attributes','fields','hasOwnProperty','order','sort','filters','filter','where','merge','VIRTUAL','options','includeAll','include','SugarcrmAccount','findAll','rows','show','params','length','find','create','body','update','getConfigurations','findOne','SugarcrmConfiguration','intersection','pick','nolimit','addConfiguration','Subjects','channel','Descriptions','getDescriptions','getFields','assigned_user_id','created_by','description','date_start','parent_type','parent_name','username','password','remoteUri','substring','lastIndexOf','POST','%s%s','/service/v4_1/rest.php','JSON','stringify','PLAIN','xCALLY\x20Motion\x20Integration','Password\x20Expired','Calls','values','remove','includes','label','endsWith','statusCode','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','eml-format','rimraf','zip-dir','request-promise','moment','util','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','client','http','test','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','SugarcrmAccount,\x20%s,\x20%s','request\x20sent','debug','SugarcrmAccount,\x20%s,\x20%s,\x20%s','error','message','catch','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','destroy','stack','name'];(function(_0x152e48,_0x25f775){var _0x30b1a4=function(_0x5dcbf3){while(--_0x5dcbf3){_0x152e48['push'](_0x152e48['shift']());}};_0x30b1a4(++_0x25f775);}(_0xd5dd,0x143));var _0xdd5d=function(_0x415d54,_0x3fcb6c){_0x415d54=_0x415d54-0x0;var _0x566073=_0xd5dd[_0x415d54];return _0x566073;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xdd5d('0x0'));var rimraf=require(_0xdd5d('0x1'));var zipdir=require(_0xdd5d('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xdd5d('0x3'));var moment=require(_0xdd5d('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xdd5d('0x5'));var path=require('path');var sox=require(_0xdd5d('0x6'));var csv=require('to-csv');var ejs=require(_0xdd5d('0x7'));var fs=require('fs');var _=require(_0xdd5d('0x8'));var squel=require(_0xdd5d('0x9'));var crypto=require(_0xdd5d('0xa'));var jsforce=require(_0xdd5d('0xb'));var deskjs=require(_0xdd5d('0xc'));var toCsv=require(_0xdd5d('0xd'));var querystring=require('querystring');var Papa=require(_0xdd5d('0xe'));var Redis=require('ioredis');var authService=require(_0xdd5d('0xf'));var qs=require(_0xdd5d('0x10'));var as=require(_0xdd5d('0x11'));var hardwareService=require(_0xdd5d('0x12'));var logger=require(_0xdd5d('0x13'))(_0xdd5d('0x14'));var utils=require(_0xdd5d('0x15'));var config=require(_0xdd5d('0x16'));var db=require(_0xdd5d('0x17'))['db'];var integrations=require('../../components/integrations/configuration');var jayson=require('jayson/promise');var client=jayson[_0xdd5d('0x18')][_0xdd5d('0x19')]({'port':0x232a});function checkPasswordPattern(_0x3ad43c,_0x11c7b0,_0x293b85){if(_0x293b85){var _0x4fb8c7=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x4fb8c7[_0xdd5d('0x1a')](_0x11c7b0)){return _0x3ad43c;}else{throw new db['Sequelize'][(_0xdd5d('0x1b'))](_0xdd5d('0x1c'));}}else{return _0x3ad43c;}}function respondWithRpcPromise(_0x1ca441,_0x2f1d28,_0x3b7fbf,_0x567959){return new BPromise(function(_0x45bbbe,_0x36db0c){var _0x46790c=_0x567959||client;return _0x46790c[_0xdd5d('0x1d')](_0x1ca441,_0x3b7fbf)[_0xdd5d('0x1e')](function(_0xe6b3d3){logger[_0xdd5d('0x1f')](_0xdd5d('0x20'),_0x2f1d28,_0xdd5d('0x21'));logger[_0xdd5d('0x22')](_0xdd5d('0x23'),_0x2f1d28,'request\x20sent',JSON['stringify'](_0xe6b3d3));if(_0xe6b3d3[_0xdd5d('0x24')]){if(_0xe6b3d3[_0xdd5d('0x24')]['code']===0x1f4){logger[_0xdd5d('0x24')]('SugarcrmAccount,\x20%s,\x20%s',_0x2f1d28,_0xe6b3d3[_0xdd5d('0x24')][_0xdd5d('0x25')]);return _0x36db0c(_0xe6b3d3['error'][_0xdd5d('0x25')]);}logger['error'](_0xdd5d('0x20'),_0x2f1d28,_0xe6b3d3[_0xdd5d('0x24')][_0xdd5d('0x25')]);return _0x45bbbe(_0xe6b3d3[_0xdd5d('0x24')][_0xdd5d('0x25')]);}else{logger[_0xdd5d('0x1f')](_0xdd5d('0x20'),_0x2f1d28,_0xdd5d('0x21'));_0x45bbbe(_0xe6b3d3['result'][_0xdd5d('0x25')]);}})[_0xdd5d('0x26')](function(_0x1481d2){logger[_0xdd5d('0x24')](_0xdd5d('0x20'),_0x2f1d28,_0x1481d2);_0x36db0c(_0x1481d2);});});}function respondWithStatusCode(_0x1cad1a,_0x935050){_0x935050=_0x935050||0xcc;return function(_0x542dc1){if(_0x542dc1){return _0x1cad1a[_0xdd5d('0x27')](_0x935050);}return _0x1cad1a[_0xdd5d('0x28')](_0x935050)[_0xdd5d('0x29')]();};}function respondWithResult(_0x35a7a7,_0x3318bd){_0x3318bd=_0x3318bd||0xc8;return function(_0x30e1d1){if(_0x30e1d1){return _0x35a7a7[_0xdd5d('0x28')](_0x3318bd)[_0xdd5d('0x2a')](_0x30e1d1);}};}function respondWithFilteredResult(_0x5c34b7,_0x232c91){return function(_0x1d803c){if(_0x1d803c){var _0x40fd9d=_0x1d803c[_0xdd5d('0x2b')],_0x319996=_0x232c91[_0xdd5d('0x2c')],_0x1dda77=_0x232c91['offset']+_0x232c91[_0xdd5d('0x2d')],_0x44e5f9;if(_0x1dda77>=_0x40fd9d){_0x1dda77=_0x40fd9d;_0x44e5f9=0xc8;}else{_0x44e5f9=0xce;}_0x5c34b7['status'](_0x44e5f9);return _0x5c34b7[_0xdd5d('0x2e')](_0xdd5d('0x2f'),_0x319996+'-'+_0x1dda77+'/'+_0x40fd9d)['json'](_0x1d803c);}return null;};}function patchUpdates(_0x4faf35){return function(_0x55640f){try{jsonpatch[_0xdd5d('0x30')](_0x55640f,_0x4faf35,!![]);}catch(_0x58ad5d){return BPromise['reject'](_0x58ad5d);}return _0x55640f['save']();};}function saveUpdates(_0x5710f1,_0x547e4f){return function(_0x50c74e){if(_0x50c74e){return _0x50c74e['update'](_0x5710f1)[_0xdd5d('0x1e')](function(_0x110dc5){return _0x110dc5;});}return null;};}function removeEntity(_0x4a3113,_0x2d6755){return function(_0x4ccb62){if(_0x4ccb62){return _0x4ccb62[_0xdd5d('0x31')]()[_0xdd5d('0x1e')](function(){_0x4a3113['status'](0xcc)[_0xdd5d('0x29')]();});}};}function handleEntityNotFound(_0x52711e,_0x6fefdf){return function(_0x9bd39c){if(!_0x9bd39c){_0x52711e['sendStatus'](0x194);}return _0x9bd39c;};}function handleError(_0x1da352,_0x37ac37){_0x37ac37=_0x37ac37||0x1f4;return function(_0x4fa3f7){logger[_0xdd5d('0x24')](_0x4fa3f7[_0xdd5d('0x32')]);if(_0x4fa3f7[_0xdd5d('0x33')]){delete _0x4fa3f7[_0xdd5d('0x33')];}_0x1da352[_0xdd5d('0x28')](_0x37ac37)[_0xdd5d('0x34')](_0x4fa3f7);};}exports[_0xdd5d('0x35')]=function(_0x4cea22,_0x3793aa){var _0x519252={},_0x5d8cc0={},_0xe5effc={'count':0x0,'rows':[]};var _0x4fee6c=_['map'](db['SugarcrmAccount'][_0xdd5d('0x36')],function(_0x48b39d){return{'name':_0x48b39d[_0xdd5d('0x37')],'type':_0x48b39d[_0xdd5d('0x38')][_0xdd5d('0x39')]};});_0x5d8cc0[_0xdd5d('0x3a')]=_[_0xdd5d('0x3b')](_0x4fee6c,_0xdd5d('0x33'));_0x5d8cc0[_0xdd5d('0x3c')]=_[_0xdd5d('0x3d')](_0x4cea22[_0xdd5d('0x3c')]);_0x5d8cc0['filters']=_['intersection'](_0x5d8cc0[_0xdd5d('0x3a')],_0x5d8cc0['query']);_0x519252[_0xdd5d('0x3e')]=_['intersection'](_0x5d8cc0['model'],qs['fields'](_0x4cea22[_0xdd5d('0x3c')][_0xdd5d('0x3f')]));_0x519252[_0xdd5d('0x3e')]=_0x519252[_0xdd5d('0x3e')]['length']?_0x519252[_0xdd5d('0x3e')]:_0x5d8cc0[_0xdd5d('0x3a')];if(!_0x4cea22[_0xdd5d('0x3c')][_0xdd5d('0x40')]('nolimit')){_0x519252['limit']=qs[_0xdd5d('0x2d')](_0x4cea22['query'][_0xdd5d('0x2d')]);_0x519252[_0xdd5d('0x2c')]=qs[_0xdd5d('0x2c')](_0x4cea22[_0xdd5d('0x3c')][_0xdd5d('0x2c')]);}_0x519252[_0xdd5d('0x41')]=qs[_0xdd5d('0x42')](_0x4cea22[_0xdd5d('0x3c')][_0xdd5d('0x42')]);_0x519252['where']=qs[_0xdd5d('0x43')](_['pick'](_0x4cea22[_0xdd5d('0x3c')],_0x5d8cc0[_0xdd5d('0x43')]),_0x4fee6c);if(_0x4cea22[_0xdd5d('0x3c')][_0xdd5d('0x44')]){_0x519252[_0xdd5d('0x45')]=_[_0xdd5d('0x46')](_0x519252[_0xdd5d('0x45')],{'$or':_[_0xdd5d('0x3b')](_0x4fee6c,function(_0x26e35d){if(_0x26e35d[_0xdd5d('0x38')]!==_0xdd5d('0x47')){var _0x5de08d={};_0x5de08d[_0x26e35d[_0xdd5d('0x33')]]={'$like':'%'+_0x4cea22['query'][_0xdd5d('0x44')]+'%'};return _0x5de08d;}})});}_0x519252=_['merge']({},_0x519252,_0x4cea22[_0xdd5d('0x48')]);var _0x5b8570={'where':_0x519252[_0xdd5d('0x45')]};return db['SugarcrmAccount'][_0xdd5d('0x2b')](_0x5b8570)[_0xdd5d('0x1e')](function(_0x26119e){_0xe5effc[_0xdd5d('0x2b')]=_0x26119e;if(_0x4cea22[_0xdd5d('0x3c')][_0xdd5d('0x49')]){_0x519252[_0xdd5d('0x4a')]=[{'all':!![]}];}return db[_0xdd5d('0x4b')][_0xdd5d('0x4c')](_0x519252);})[_0xdd5d('0x1e')](function(_0x1b6210){_0xe5effc[_0xdd5d('0x4d')]=_0x1b6210;return _0xe5effc;})['then'](respondWithFilteredResult(_0x3793aa,_0x519252))[_0xdd5d('0x26')](handleError(_0x3793aa,null));};exports[_0xdd5d('0x4e')]=function(_0x27b911,_0x345b36){var _0x4b87c9={'raw':![],'where':{'id':_0x27b911[_0xdd5d('0x4f')]['id']}},_0x30379f={};_0x30379f[_0xdd5d('0x3a')]=_['keys'](db['SugarcrmAccount']['rawAttributes']);_0x30379f[_0xdd5d('0x3c')]=_['keys'](_0x27b911[_0xdd5d('0x3c')]);_0x30379f[_0xdd5d('0x43')]=_['intersection'](_0x30379f['model'],_0x30379f[_0xdd5d('0x3c')]);_0x4b87c9[_0xdd5d('0x3e')]=_['intersection'](_0x30379f[_0xdd5d('0x3a')],qs['fields'](_0x27b911[_0xdd5d('0x3c')][_0xdd5d('0x3f')]));_0x4b87c9[_0xdd5d('0x3e')]=_0x4b87c9[_0xdd5d('0x3e')][_0xdd5d('0x50')]?_0x4b87c9['attributes']:_0x30379f[_0xdd5d('0x3a')];if(_0x27b911['query'][_0xdd5d('0x49')]){_0x4b87c9[_0xdd5d('0x4a')]=[{'all':!![]}];}_0x4b87c9=_[_0xdd5d('0x46')]({},_0x4b87c9,_0x27b911[_0xdd5d('0x48')]);return db[_0xdd5d('0x4b')][_0xdd5d('0x51')](_0x4b87c9)[_0xdd5d('0x1e')](handleEntityNotFound(_0x345b36,null))[_0xdd5d('0x1e')](respondWithResult(_0x345b36,null))['catch'](handleError(_0x345b36,null));};exports[_0xdd5d('0x52')]=function(_0x5985f3,_0x36d404){return db[_0xdd5d('0x4b')][_0xdd5d('0x52')](_0x5985f3[_0xdd5d('0x53')],{})[_0xdd5d('0x1e')](respondWithResult(_0x36d404,0xc9))[_0xdd5d('0x26')](handleError(_0x36d404,null));};exports[_0xdd5d('0x54')]=function(_0x5da645,_0x4b15fe){if(_0x5da645[_0xdd5d('0x53')]['id']){delete _0x5da645[_0xdd5d('0x53')]['id'];}return db[_0xdd5d('0x4b')]['find']({'where':{'id':_0x5da645[_0xdd5d('0x4f')]['id']}})[_0xdd5d('0x1e')](handleEntityNotFound(_0x4b15fe,null))[_0xdd5d('0x1e')](saveUpdates(_0x5da645[_0xdd5d('0x53')],null))['then'](respondWithResult(_0x4b15fe,null))[_0xdd5d('0x26')](handleError(_0x4b15fe,null));};exports[_0xdd5d('0x31')]=function(_0x1e2bee,_0x186f87){return db[_0xdd5d('0x4b')][_0xdd5d('0x51')]({'where':{'id':_0x1e2bee['params']['id']}})[_0xdd5d('0x1e')](handleEntityNotFound(_0x186f87,null))[_0xdd5d('0x1e')](removeEntity(_0x186f87,null))[_0xdd5d('0x26')](handleError(_0x186f87,null));};exports[_0xdd5d('0x55')]=function(_0x1b2112,_0x4f7870,_0x29521e){var _0x6b89f9={};var _0x2adc46={};var _0x2975b4;var _0x4443b9;return db[_0xdd5d('0x4b')][_0xdd5d('0x56')]({'where':{'id':_0x1b2112[_0xdd5d('0x4f')]['id']}})[_0xdd5d('0x1e')](handleEntityNotFound(_0x4f7870,null))[_0xdd5d('0x1e')](function(_0x5868fb){if(_0x5868fb){_0x2975b4=_0x5868fb;_0x2adc46[_0xdd5d('0x3a')]=_[_0xdd5d('0x3d')](db[_0xdd5d('0x57')]['rawAttributes']);_0x2adc46[_0xdd5d('0x3c')]=_[_0xdd5d('0x3d')](_0x1b2112[_0xdd5d('0x3c')]);_0x2adc46[_0xdd5d('0x43')]=_['intersection'](_0x2adc46[_0xdd5d('0x3a')],_0x2adc46[_0xdd5d('0x3c')]);_0x6b89f9[_0xdd5d('0x3e')]=_[_0xdd5d('0x58')](_0x2adc46[_0xdd5d('0x3a')],qs[_0xdd5d('0x3f')](_0x1b2112[_0xdd5d('0x3c')][_0xdd5d('0x3f')]));_0x6b89f9[_0xdd5d('0x3e')]=_0x6b89f9[_0xdd5d('0x3e')][_0xdd5d('0x50')]?_0x6b89f9['attributes']:_0x2adc46[_0xdd5d('0x3a')];_0x6b89f9[_0xdd5d('0x41')]=qs[_0xdd5d('0x42')](_0x1b2112[_0xdd5d('0x3c')][_0xdd5d('0x42')]);_0x6b89f9['where']=qs[_0xdd5d('0x43')](_[_0xdd5d('0x59')](_0x1b2112[_0xdd5d('0x3c')],_0x2adc46[_0xdd5d('0x43')]));if(_0x1b2112[_0xdd5d('0x3c')][_0xdd5d('0x44')]){_0x6b89f9[_0xdd5d('0x45')]=_[_0xdd5d('0x46')](_0x6b89f9[_0xdd5d('0x45')],{'$or':_[_0xdd5d('0x3b')](_0x6b89f9[_0xdd5d('0x3e')],function(_0x4705c2){var _0x1fdd62={};_0x1fdd62[_0x4705c2]={'$like':'%'+_0x1b2112[_0xdd5d('0x3c')][_0xdd5d('0x44')]+'%'};return _0x1fdd62;})});}_0x6b89f9=_[_0xdd5d('0x46')]({},_0x6b89f9,_0x1b2112['options']);return _0x2975b4[_0xdd5d('0x55')](_0x6b89f9);}})['then'](function(_0x13e735){if(_0x13e735){_0x4443b9=_0x13e735[_0xdd5d('0x50')];if(!_0x1b2112['query'][_0xdd5d('0x40')](_0xdd5d('0x5a'))){_0x6b89f9[_0xdd5d('0x2d')]=qs[_0xdd5d('0x2d')](_0x1b2112[_0xdd5d('0x3c')][_0xdd5d('0x2d')]);_0x6b89f9[_0xdd5d('0x2c')]=qs[_0xdd5d('0x2c')](_0x1b2112['query']['offset']);}return _0x2975b4['getConfigurations'](_0x6b89f9);}})[_0xdd5d('0x1e')](function(_0x47b0be){if(_0x47b0be){return _0x47b0be?{'count':_0x4443b9,'rows':_0x47b0be}:null;}})[_0xdd5d('0x1e')](respondWithResult(_0x4f7870,null))[_0xdd5d('0x26')](handleError(_0x4f7870,null));};exports[_0xdd5d('0x5b')]=function(_0x43b8b9,_0x45e388,_0x348fe5){if(_0x43b8b9[_0xdd5d('0x53')]['id']){delete _0x43b8b9[_0xdd5d('0x53')]['id'];}return db['SugarcrmAccount'][_0xdd5d('0x56')]({'where':{'id':_0x43b8b9[_0xdd5d('0x4f')]['id']}})[_0xdd5d('0x1e')](handleEntityNotFound(_0x45e388,null))[_0xdd5d('0x1e')](function(_0x3afb60){if(_0x3afb60){_0x43b8b9['body']['AccountId']=_0x3afb60['id'];_0x43b8b9[_0xdd5d('0x53')][_0xdd5d('0x5c')]=integrations['getSubjects'](_0x43b8b9['body'][_0xdd5d('0x5d')],_0x43b8b9['body'][_0xdd5d('0x38')]);_0x43b8b9[_0xdd5d('0x53')][_0xdd5d('0x5e')]=integrations[_0xdd5d('0x5f')](_0x43b8b9[_0xdd5d('0x53')][_0xdd5d('0x5d')],_0x43b8b9['body'][_0xdd5d('0x38')]);return db[_0xdd5d('0x57')]['create'](_0x43b8b9[_0xdd5d('0x53')],{'include':[{'model':db['SugarcrmField'],'as':_0xdd5d('0x5c')},{'model':db['SugarcrmField'],'as':_0xdd5d('0x5e')}]});}return null;})[_0xdd5d('0x1e')](respondWithResult(_0x45e388,null))['catch'](handleError(_0x45e388,null));};exports[_0xdd5d('0x60')]=function(_0x78c1c0,_0x309f21,_0x5b1007){var _0x1737e6='';var _0x56e5cf=['id',_0xdd5d('0x33'),_0xdd5d('0x61'),_0xdd5d('0x62'),_0xdd5d('0x63'),_0xdd5d('0x64'),'duration_hours','duration_minutes','parent_id',_0xdd5d('0x65'),_0xdd5d('0x66'),'direction'];return db[_0xdd5d('0x4b')][_0xdd5d('0x56')]({'where':{'id':_0x78c1c0[_0xdd5d('0x4f')]['id']},'attributes':['id',_0xdd5d('0x67'),_0xdd5d('0x68'),_0xdd5d('0x69')]})[_0xdd5d('0x1e')](handleEntityNotFound(_0x309f21,null))[_0xdd5d('0x1e')](function(_0x11722a){if(_0x11722a){_0x1737e6=_0x11722a[_0xdd5d('0x69')];var _0x4035db=_0x1737e6['slice'](-0x1);if(_0x4035db==='/'){_0x1737e6=_0x1737e6[_0xdd5d('0x6a')](0x0,_0x1737e6[_0xdd5d('0x6b')](_0x4035db));}return rp({'method':_0xdd5d('0x6c'),'uri':util['format'](_0xdd5d('0x6d'),_0x1737e6,_0xdd5d('0x6e')),'json':!![],'form':{'method':'login','input_type':_0xdd5d('0x6f'),'response_type':_0xdd5d('0x6f'),'rest_data':JSON[_0xdd5d('0x70')]({'user_auth':{'user_name':_0x11722a[_0xdd5d('0x67')],'password':_0x11722a['password'],'encryption':_0xdd5d('0x71')},'application':_0xdd5d('0x72')})}});}})[_0xdd5d('0x1e')](function(_0x28514c){if(_0x28514c&&_0x28514c[_0xdd5d('0x33')]!=='Invalid\x20Login'&&_0x28514c[_0xdd5d('0x33')]!==_0xdd5d('0x73')){return rp({'method':'POST','uri':util['format'](_0xdd5d('0x6d'),_0x1737e6,_0xdd5d('0x6e')),'json':!![],'form':{'method':'get_module_fields','input_type':'JSON','response_type':_0xdd5d('0x6f'),'rest_data':JSON['stringify']({'session':_0x28514c['id'],'module_name':_0xdd5d('0x74')})}})[_0xdd5d('0x1e')](function(_0x28bd53){if(_0x28bd53){var _0x42750a=_[_0xdd5d('0x75')](_0x28bd53['module_fields']);_[_0xdd5d('0x76')](_0x42750a,function(_0x3f18c6){return _0x56e5cf[_0xdd5d('0x77')](_0x3f18c6[_0xdd5d('0x33')]);});return{'count':_0x42750a[_0xdd5d('0x50')],'rows':_['map'](_0x42750a,function(_0xcc0986){return{'id':_0xcc0986[_0xdd5d('0x33')],'name':_0xcc0986[_0xdd5d('0x78')],'custom':_[_0xdd5d('0x79')](_0xcc0986[_0xdd5d('0x33')],'_c')?!![]:![],'options':_0xcc0986['options']?_[_0xdd5d('0x3b')](_['values'](_0xcc0986[_0xdd5d('0x48')]),function(_0x2aacd2){return{'name':_0x2aacd2['value'],'value':_0x2aacd2[_0xdd5d('0x33')]};}):[]};})};}})[_0xdd5d('0x1e')](respondWithResult(_0x309f21,null))[_0xdd5d('0x26')](function(_0x2d0c95){var _0x218d5c=_0x78c1c0[_0xdd5d('0x3c')][_0xdd5d('0x1a')]?0x1f4:_0x2d0c95[_0xdd5d('0x7a')]||0x1f4;logger[_0xdd5d('0x24')](_0xdd5d('0x7b'),'getFields',_0x218d5c,JSON[_0xdd5d('0x70')](_0x2d0c95));delete _0x2d0c95['name'];if(_0x218d5c===0x191){_0x218d5c=0x190;}_0x309f21[_0xdd5d('0x28')](_0x218d5c)[_0xdd5d('0x34')](_0x78c1c0[_0xdd5d('0x3c')][_0xdd5d('0x1a')]?{'message':_0xdd5d('0x7c'),'statusCode':_0x2d0c95[_0xdd5d('0x7a')]}:_0x2d0c95);});}else{var _0x3f4185=0x1f4;_0x309f21[_0xdd5d('0x28')](_0x3f4185)[_0xdd5d('0x34')]({'message':'Wrong\x20credentials','statusCode':0x190});}});};
\ No newline at end of file
+var _0x5dcb=['xCALLY\x20Motion\x20Integration','Password\x20Expired','format','Calls','values','module_fields','remove','includes','value','statusCode','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','http','test','Sequelize','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','info','SugarcrmAccount,\x20%s,\x20%s','SugarcrmAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','sendStatus','status','end','count','offset','limit','set','Content-Range','json','apply','save','update','then','stack','name','send','index','map','SugarcrmAccount','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','params','find','create','body','getConfigurations','AccountId','Subjects','channel','getDescriptions','SugarcrmConfiguration','SugarcrmField','Descriptions','getFields','assigned_user_id','description','date_start','parent_id','parent_type','parent_name','username','password','remoteUri','slice','substring','lastIndexOf','POST','%s%s','/service/v4_1/rest.php','JSON','PLAIN'];(function(_0xbccf,_0x5f3f74){var _0x24c504=function(_0x1442a0){while(--_0x1442a0){_0xbccf['push'](_0xbccf['shift']());}};_0x24c504(++_0x5f3f74);}(_0x5dcb,0x186));var _0xb5dc=function(_0x4d8666,_0x2ff19d){_0x4d8666=_0x4d8666-0x0;var _0x37175b=_0x5dcb[_0x4d8666];return _0x37175b;};'use strict';var pdf=require(_0xb5dc('0x0'));var emlformat=require(_0xb5dc('0x1'));var rimraf=require(_0xb5dc('0x2'));var zipdir=require(_0xb5dc('0x3'));var jsonpatch=require(_0xb5dc('0x4'));var rp=require(_0xb5dc('0x5'));var moment=require('moment');var BPromise=require(_0xb5dc('0x6'));var Mustache=require('mustache');var util=require(_0xb5dc('0x7'));var path=require('path');var sox=require(_0xb5dc('0x8'));var csv=require(_0xb5dc('0x9'));var ejs=require(_0xb5dc('0xa'));var fs=require('fs');var _=require(_0xb5dc('0xb'));var squel=require(_0xb5dc('0xc'));var crypto=require(_0xb5dc('0xd'));var jsforce=require(_0xb5dc('0xe'));var deskjs=require(_0xb5dc('0xf'));var toCsv=require(_0xb5dc('0x9'));var querystring=require(_0xb5dc('0x10'));var Papa=require(_0xb5dc('0x11'));var Redis=require(_0xb5dc('0x12'));var authService=require(_0xb5dc('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xb5dc('0x14'))(_0xb5dc('0x15'));var utils=require(_0xb5dc('0x16'));var config=require(_0xb5dc('0x17'));var db=require(_0xb5dc('0x18'))['db'];var integrations=require('../../components/integrations/configuration');var jayson=require(_0xb5dc('0x19'));var client=jayson['client'][_0xb5dc('0x1a')]({'port':0x232a});function checkPasswordPattern(_0x1843f3,_0x4c9e51,_0x502896){if(_0x502896){var _0x62d91c=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x62d91c[_0xb5dc('0x1b')](_0x4c9e51)){return _0x1843f3;}else{throw new db[(_0xb5dc('0x1c'))]['ValidationError'](_0xb5dc('0x1d'));}}else{return _0x1843f3;}}function respondWithRpcPromise(_0x1f9a84,_0x59ee7a,_0x46b354,_0xb75f0c){return new BPromise(function(_0x3217fa,_0x3064c){var _0x4984c7=_0xb75f0c||client;return _0x4984c7[_0xb5dc('0x1e')](_0x1f9a84,_0x46b354)['then'](function(_0xeaa3f7){logger[_0xb5dc('0x1f')](_0xb5dc('0x20'),_0x59ee7a,'request\x20sent');logger['debug'](_0xb5dc('0x21'),_0x59ee7a,_0xb5dc('0x22'),JSON[_0xb5dc('0x23')](_0xeaa3f7));if(_0xeaa3f7[_0xb5dc('0x24')]){if(_0xeaa3f7[_0xb5dc('0x24')][_0xb5dc('0x25')]===0x1f4){logger[_0xb5dc('0x24')](_0xb5dc('0x20'),_0x59ee7a,_0xeaa3f7['error'][_0xb5dc('0x26')]);return _0x3064c(_0xeaa3f7[_0xb5dc('0x24')][_0xb5dc('0x26')]);}logger[_0xb5dc('0x24')](_0xb5dc('0x20'),_0x59ee7a,_0xeaa3f7[_0xb5dc('0x24')][_0xb5dc('0x26')]);return _0x3217fa(_0xeaa3f7[_0xb5dc('0x24')]['message']);}else{logger[_0xb5dc('0x1f')](_0xb5dc('0x20'),_0x59ee7a,_0xb5dc('0x22'));_0x3217fa(_0xeaa3f7['result']['message']);}})[_0xb5dc('0x27')](function(_0x1d038c){logger['error'](_0xb5dc('0x20'),_0x59ee7a,_0x1d038c);_0x3064c(_0x1d038c);});});}function respondWithStatusCode(_0x261918,_0x3e59c7){_0x3e59c7=_0x3e59c7||0xcc;return function(_0x3ca6f7){if(_0x3ca6f7){return _0x261918[_0xb5dc('0x28')](_0x3e59c7);}return _0x261918[_0xb5dc('0x29')](_0x3e59c7)[_0xb5dc('0x2a')]();};}function respondWithResult(_0x47ecb1,_0x42f7f0){_0x42f7f0=_0x42f7f0||0xc8;return function(_0x562dfc){if(_0x562dfc){return _0x47ecb1[_0xb5dc('0x29')](_0x42f7f0)['json'](_0x562dfc);}};}function respondWithFilteredResult(_0x55e204,_0x403f02){return function(_0x399ba5){if(_0x399ba5){var _0x52793e=_0x399ba5[_0xb5dc('0x2b')],_0x5541b3=_0x403f02[_0xb5dc('0x2c')],_0x5d0045=_0x403f02[_0xb5dc('0x2c')]+_0x403f02[_0xb5dc('0x2d')],_0x3bcb74;if(_0x5d0045>=_0x52793e){_0x5d0045=_0x52793e;_0x3bcb74=0xc8;}else{_0x3bcb74=0xce;}_0x55e204[_0xb5dc('0x29')](_0x3bcb74);return _0x55e204[_0xb5dc('0x2e')](_0xb5dc('0x2f'),_0x5541b3+'-'+_0x5d0045+'/'+_0x52793e)[_0xb5dc('0x30')](_0x399ba5);}return null;};}function patchUpdates(_0x3c9c09){return function(_0x4bee4d){try{jsonpatch[_0xb5dc('0x31')](_0x4bee4d,_0x3c9c09,!![]);}catch(_0x47d48c){return BPromise['reject'](_0x47d48c);}return _0x4bee4d[_0xb5dc('0x32')]();};}function saveUpdates(_0x430ff3,_0x72458d){return function(_0x5959bb){if(_0x5959bb){return _0x5959bb[_0xb5dc('0x33')](_0x430ff3)[_0xb5dc('0x34')](function(_0x4cdc93){return _0x4cdc93;});}return null;};}function removeEntity(_0x1341c5,_0x585a2e){return function(_0xc0837b){if(_0xc0837b){return _0xc0837b['destroy']()['then'](function(){_0x1341c5[_0xb5dc('0x29')](0xcc)[_0xb5dc('0x2a')]();});}};}function handleEntityNotFound(_0x4ac7d3,_0x398b64){return function(_0x4dc446){if(!_0x4dc446){_0x4ac7d3[_0xb5dc('0x28')](0x194);}return _0x4dc446;};}function handleError(_0x23c5bd,_0x101a4){_0x101a4=_0x101a4||0x1f4;return function(_0x4f78af){logger[_0xb5dc('0x24')](_0x4f78af[_0xb5dc('0x35')]);if(_0x4f78af[_0xb5dc('0x36')]){delete _0x4f78af[_0xb5dc('0x36')];}_0x23c5bd['status'](_0x101a4)[_0xb5dc('0x37')](_0x4f78af);};}exports[_0xb5dc('0x38')]=function(_0x24b57f,_0x1b9145){var _0x4aeaf3={},_0x361c2a={},_0x530103={'count':0x0,'rows':[]};var _0x33ad30=_[_0xb5dc('0x39')](db[_0xb5dc('0x3a')][_0xb5dc('0x3b')],function(_0x54f263){return{'name':_0x54f263['fieldName'],'type':_0x54f263[_0xb5dc('0x3c')][_0xb5dc('0x3d')]};});_0x361c2a[_0xb5dc('0x3e')]=_[_0xb5dc('0x39')](_0x33ad30,_0xb5dc('0x36'));_0x361c2a[_0xb5dc('0x3f')]=_[_0xb5dc('0x40')](_0x24b57f[_0xb5dc('0x3f')]);_0x361c2a[_0xb5dc('0x41')]=_[_0xb5dc('0x42')](_0x361c2a[_0xb5dc('0x3e')],_0x361c2a[_0xb5dc('0x3f')]);_0x4aeaf3[_0xb5dc('0x43')]=_[_0xb5dc('0x42')](_0x361c2a[_0xb5dc('0x3e')],qs[_0xb5dc('0x44')](_0x24b57f[_0xb5dc('0x3f')][_0xb5dc('0x44')]));_0x4aeaf3[_0xb5dc('0x43')]=_0x4aeaf3[_0xb5dc('0x43')][_0xb5dc('0x45')]?_0x4aeaf3[_0xb5dc('0x43')]:_0x361c2a[_0xb5dc('0x3e')];if(!_0x24b57f['query'][_0xb5dc('0x46')](_0xb5dc('0x47'))){_0x4aeaf3[_0xb5dc('0x2d')]=qs[_0xb5dc('0x2d')](_0x24b57f[_0xb5dc('0x3f')][_0xb5dc('0x2d')]);_0x4aeaf3[_0xb5dc('0x2c')]=qs[_0xb5dc('0x2c')](_0x24b57f[_0xb5dc('0x3f')]['offset']);}_0x4aeaf3[_0xb5dc('0x48')]=qs[_0xb5dc('0x49')](_0x24b57f[_0xb5dc('0x3f')][_0xb5dc('0x49')]);_0x4aeaf3['where']=qs['filters'](_[_0xb5dc('0x4a')](_0x24b57f[_0xb5dc('0x3f')],_0x361c2a[_0xb5dc('0x41')]),_0x33ad30);if(_0x24b57f[_0xb5dc('0x3f')][_0xb5dc('0x4b')]){_0x4aeaf3[_0xb5dc('0x4c')]=_[_0xb5dc('0x4d')](_0x4aeaf3['where'],{'$or':_['map'](_0x33ad30,function(_0x4f5f72){if(_0x4f5f72['type']!==_0xb5dc('0x4e')){var _0xcc82de={};_0xcc82de[_0x4f5f72[_0xb5dc('0x36')]]={'$like':'%'+_0x24b57f['query'][_0xb5dc('0x4b')]+'%'};return _0xcc82de;}})});}_0x4aeaf3=_[_0xb5dc('0x4d')]({},_0x4aeaf3,_0x24b57f[_0xb5dc('0x4f')]);var _0x107cf7={'where':_0x4aeaf3[_0xb5dc('0x4c')]};return db[_0xb5dc('0x3a')]['count'](_0x107cf7)['then'](function(_0x199f82){_0x530103[_0xb5dc('0x2b')]=_0x199f82;if(_0x24b57f[_0xb5dc('0x3f')][_0xb5dc('0x50')]){_0x4aeaf3[_0xb5dc('0x51')]=[{'all':!![]}];}return db['SugarcrmAccount'][_0xb5dc('0x52')](_0x4aeaf3);})[_0xb5dc('0x34')](function(_0x494e9b){_0x530103[_0xb5dc('0x53')]=_0x494e9b;return _0x530103;})[_0xb5dc('0x34')](respondWithFilteredResult(_0x1b9145,_0x4aeaf3))['catch'](handleError(_0x1b9145,null));};exports['show']=function(_0x56744b,_0x2597d5){var _0xf119b1={'raw':![],'where':{'id':_0x56744b[_0xb5dc('0x54')]['id']}},_0x3f651f={};_0x3f651f[_0xb5dc('0x3e')]=_['keys'](db[_0xb5dc('0x3a')][_0xb5dc('0x3b')]);_0x3f651f[_0xb5dc('0x3f')]=_['keys'](_0x56744b['query']);_0x3f651f[_0xb5dc('0x41')]=_['intersection'](_0x3f651f[_0xb5dc('0x3e')],_0x3f651f[_0xb5dc('0x3f')]);_0xf119b1['attributes']=_[_0xb5dc('0x42')](_0x3f651f['model'],qs[_0xb5dc('0x44')](_0x56744b[_0xb5dc('0x3f')][_0xb5dc('0x44')]));_0xf119b1[_0xb5dc('0x43')]=_0xf119b1[_0xb5dc('0x43')][_0xb5dc('0x45')]?_0xf119b1[_0xb5dc('0x43')]:_0x3f651f[_0xb5dc('0x3e')];if(_0x56744b['query']['includeAll']){_0xf119b1['include']=[{'all':!![]}];}_0xf119b1=_[_0xb5dc('0x4d')]({},_0xf119b1,_0x56744b[_0xb5dc('0x4f')]);return db[_0xb5dc('0x3a')][_0xb5dc('0x55')](_0xf119b1)[_0xb5dc('0x34')](handleEntityNotFound(_0x2597d5,null))[_0xb5dc('0x34')](respondWithResult(_0x2597d5,null))[_0xb5dc('0x27')](handleError(_0x2597d5,null));};exports[_0xb5dc('0x56')]=function(_0x9ea8c,_0x372ae0){return db['SugarcrmAccount'][_0xb5dc('0x56')](_0x9ea8c['body'],{})[_0xb5dc('0x34')](respondWithResult(_0x372ae0,0xc9))[_0xb5dc('0x27')](handleError(_0x372ae0,null));};exports[_0xb5dc('0x33')]=function(_0x4018c9,_0x42c8d8){if(_0x4018c9[_0xb5dc('0x57')]['id']){delete _0x4018c9[_0xb5dc('0x57')]['id'];}return db['SugarcrmAccount'][_0xb5dc('0x55')]({'where':{'id':_0x4018c9[_0xb5dc('0x54')]['id']}})['then'](handleEntityNotFound(_0x42c8d8,null))[_0xb5dc('0x34')](saveUpdates(_0x4018c9[_0xb5dc('0x57')],null))[_0xb5dc('0x34')](respondWithResult(_0x42c8d8,null))['catch'](handleError(_0x42c8d8,null));};exports['destroy']=function(_0x21afef,_0x1fb1b9){return db['SugarcrmAccount'][_0xb5dc('0x55')]({'where':{'id':_0x21afef[_0xb5dc('0x54')]['id']}})[_0xb5dc('0x34')](handleEntityNotFound(_0x1fb1b9,null))[_0xb5dc('0x34')](removeEntity(_0x1fb1b9,null))[_0xb5dc('0x27')](handleError(_0x1fb1b9,null));};exports['getConfigurations']=function(_0x44ee4a,_0x7d82a4,_0x52dd32){var _0x59587a={};var _0x3816e5={};var _0x43ca44;var _0x1534bf;return db['SugarcrmAccount']['findOne']({'where':{'id':_0x44ee4a[_0xb5dc('0x54')]['id']}})[_0xb5dc('0x34')](handleEntityNotFound(_0x7d82a4,null))['then'](function(_0xa8ca7f){if(_0xa8ca7f){_0x43ca44=_0xa8ca7f;_0x3816e5[_0xb5dc('0x3e')]=_[_0xb5dc('0x40')](db['SugarcrmConfiguration'][_0xb5dc('0x3b')]);_0x3816e5['query']=_['keys'](_0x44ee4a[_0xb5dc('0x3f')]);_0x3816e5[_0xb5dc('0x41')]=_[_0xb5dc('0x42')](_0x3816e5[_0xb5dc('0x3e')],_0x3816e5[_0xb5dc('0x3f')]);_0x59587a[_0xb5dc('0x43')]=_[_0xb5dc('0x42')](_0x3816e5[_0xb5dc('0x3e')],qs[_0xb5dc('0x44')](_0x44ee4a[_0xb5dc('0x3f')]['fields']));_0x59587a['attributes']=_0x59587a['attributes'][_0xb5dc('0x45')]?_0x59587a['attributes']:_0x3816e5[_0xb5dc('0x3e')];_0x59587a['order']=qs[_0xb5dc('0x49')](_0x44ee4a['query'][_0xb5dc('0x49')]);_0x59587a[_0xb5dc('0x4c')]=qs[_0xb5dc('0x41')](_['pick'](_0x44ee4a['query'],_0x3816e5['filters']));if(_0x44ee4a[_0xb5dc('0x3f')][_0xb5dc('0x4b')]){_0x59587a[_0xb5dc('0x4c')]=_[_0xb5dc('0x4d')](_0x59587a[_0xb5dc('0x4c')],{'$or':_[_0xb5dc('0x39')](_0x59587a['attributes'],function(_0x1af691){var _0x5619a8={};_0x5619a8[_0x1af691]={'$like':'%'+_0x44ee4a[_0xb5dc('0x3f')][_0xb5dc('0x4b')]+'%'};return _0x5619a8;})});}_0x59587a=_[_0xb5dc('0x4d')]({},_0x59587a,_0x44ee4a['options']);return _0x43ca44[_0xb5dc('0x58')](_0x59587a);}})['then'](function(_0x1e313b){if(_0x1e313b){_0x1534bf=_0x1e313b[_0xb5dc('0x45')];if(!_0x44ee4a[_0xb5dc('0x3f')][_0xb5dc('0x46')](_0xb5dc('0x47'))){_0x59587a['limit']=qs[_0xb5dc('0x2d')](_0x44ee4a[_0xb5dc('0x3f')][_0xb5dc('0x2d')]);_0x59587a[_0xb5dc('0x2c')]=qs[_0xb5dc('0x2c')](_0x44ee4a['query'][_0xb5dc('0x2c')]);}return _0x43ca44[_0xb5dc('0x58')](_0x59587a);}})[_0xb5dc('0x34')](function(_0x1aa3b8){if(_0x1aa3b8){return _0x1aa3b8?{'count':_0x1534bf,'rows':_0x1aa3b8}:null;}})[_0xb5dc('0x34')](respondWithResult(_0x7d82a4,null))['catch'](handleError(_0x7d82a4,null));};exports['addConfiguration']=function(_0x61f0e9,_0x3962d3,_0x5d51ce){if(_0x61f0e9[_0xb5dc('0x57')]['id']){delete _0x61f0e9[_0xb5dc('0x57')]['id'];}return db[_0xb5dc('0x3a')]['findOne']({'where':{'id':_0x61f0e9[_0xb5dc('0x54')]['id']}})[_0xb5dc('0x34')](handleEntityNotFound(_0x3962d3,null))[_0xb5dc('0x34')](function(_0x2c2411){if(_0x2c2411){_0x61f0e9[_0xb5dc('0x57')][_0xb5dc('0x59')]=_0x2c2411['id'];_0x61f0e9[_0xb5dc('0x57')][_0xb5dc('0x5a')]=integrations['getSubjects'](_0x61f0e9[_0xb5dc('0x57')][_0xb5dc('0x5b')],_0x61f0e9['body'][_0xb5dc('0x3c')]);_0x61f0e9[_0xb5dc('0x57')]['Descriptions']=integrations[_0xb5dc('0x5c')](_0x61f0e9['body']['channel'],_0x61f0e9[_0xb5dc('0x57')][_0xb5dc('0x3c')]);return db[_0xb5dc('0x5d')][_0xb5dc('0x56')](_0x61f0e9['body'],{'include':[{'model':db['SugarcrmField'],'as':_0xb5dc('0x5a')},{'model':db[_0xb5dc('0x5e')],'as':_0xb5dc('0x5f')}]});}return null;})[_0xb5dc('0x34')](respondWithResult(_0x3962d3,null))['catch'](handleError(_0x3962d3,null));};exports[_0xb5dc('0x60')]=function(_0x45ea60,_0x59ec49,_0x93f342){var _0x58cd9b='';var _0xe5f0ac=['id',_0xb5dc('0x36'),_0xb5dc('0x61'),'created_by',_0xb5dc('0x62'),_0xb5dc('0x63'),'duration_hours','duration_minutes',_0xb5dc('0x64'),_0xb5dc('0x65'),_0xb5dc('0x66'),'direction'];return db['SugarcrmAccount']['findOne']({'where':{'id':_0x45ea60['params']['id']},'attributes':['id',_0xb5dc('0x67'),_0xb5dc('0x68'),_0xb5dc('0x69')]})[_0xb5dc('0x34')](handleEntityNotFound(_0x59ec49,null))[_0xb5dc('0x34')](function(_0x7b0baf){if(_0x7b0baf){_0x58cd9b=_0x7b0baf[_0xb5dc('0x69')];var _0x54b2cc=_0x58cd9b[_0xb5dc('0x6a')](-0x1);if(_0x54b2cc==='/'){_0x58cd9b=_0x58cd9b[_0xb5dc('0x6b')](0x0,_0x58cd9b[_0xb5dc('0x6c')](_0x54b2cc));}return rp({'method':_0xb5dc('0x6d'),'uri':util['format'](_0xb5dc('0x6e'),_0x58cd9b,_0xb5dc('0x6f')),'json':!![],'form':{'method':'login','input_type':_0xb5dc('0x70'),'response_type':_0xb5dc('0x70'),'rest_data':JSON[_0xb5dc('0x23')]({'user_auth':{'user_name':_0x7b0baf[_0xb5dc('0x67')],'password':_0x7b0baf[_0xb5dc('0x68')],'encryption':_0xb5dc('0x71')},'application':_0xb5dc('0x72')})}});}})[_0xb5dc('0x34')](function(_0x198b56){if(_0x198b56&&_0x198b56[_0xb5dc('0x36')]!=='Invalid\x20Login'&&_0x198b56[_0xb5dc('0x36')]!==_0xb5dc('0x73')){return rp({'method':_0xb5dc('0x6d'),'uri':util[_0xb5dc('0x74')]('%s%s',_0x58cd9b,_0xb5dc('0x6f')),'json':!![],'form':{'method':'get_module_fields','input_type':_0xb5dc('0x70'),'response_type':'JSON','rest_data':JSON[_0xb5dc('0x23')]({'session':_0x198b56['id'],'module_name':_0xb5dc('0x75')})}})[_0xb5dc('0x34')](function(_0x590299){if(_0x590299){var _0x507a9b=_[_0xb5dc('0x76')](_0x590299[_0xb5dc('0x77')]);_[_0xb5dc('0x78')](_0x507a9b,function(_0x2b28a0){return _0xe5f0ac[_0xb5dc('0x79')](_0x2b28a0[_0xb5dc('0x36')]);});return{'count':_0x507a9b['length'],'rows':_['map'](_0x507a9b,function(_0x1dcabc){return{'id':_0x1dcabc[_0xb5dc('0x36')],'name':_0x1dcabc['label'],'custom':_['endsWith'](_0x1dcabc['name'],'_c')?!![]:![],'options':_0x1dcabc['options']?_[_0xb5dc('0x39')](_['values'](_0x1dcabc[_0xb5dc('0x4f')]),function(_0x263d38){return{'name':_0x263d38[_0xb5dc('0x7a')],'value':_0x263d38[_0xb5dc('0x36')]};}):[]};})};}})[_0xb5dc('0x34')](respondWithResult(_0x59ec49,null))[_0xb5dc('0x27')](function(_0x2b1da0){var _0x519797=_0x45ea60[_0xb5dc('0x3f')][_0xb5dc('0x1b')]?0x1f4:_0x2b1da0[_0xb5dc('0x7b')]||0x1f4;logger[_0xb5dc('0x24')](_0xb5dc('0x7c'),_0xb5dc('0x60'),_0x519797,JSON['stringify'](_0x2b1da0));delete _0x2b1da0['name'];if(_0x519797===0x191){_0x519797=0x190;}_0x59ec49['status'](_0x519797)[_0xb5dc('0x37')](_0x45ea60[_0xb5dc('0x3f')][_0xb5dc('0x1b')]?{'message':_0xb5dc('0x7d'),'statusCode':_0x2b1da0[_0xb5dc('0x7b')]}:_0x2b1da0);});}else{var _0x1920d2=0x1f4;_0x59ec49[_0xb5dc('0x29')](_0x1920d2)[_0xb5dc('0x37')]({'message':_0xb5dc('0x7d'),'statusCode':0x190});}});};
\ No newline at end of file
diff --git a/server/api/intSugarcrmAccount/intSugarcrmAccount.model.js b/server/api/intSugarcrmAccount/intSugarcrmAccount.model.js
index 1daddea..7c5332a 100644
--- a/server/api/intSugarcrmAccount/intSugarcrmAccount.model.js
+++ b/server/api/intSugarcrmAccount/intSugarcrmAccount.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x87eb=['bluebird','path','rimraf','../../config/environment','./intSugarcrmAccount.attributes','../../components/integrations/configuration','exports','define','SugarcrmAccount','int_sugarcrm_accounts','lodash','util','../../config/logger','api','moment'];(function(_0x3b65ea,_0x1e1da0){var _0x1b0bce=function(_0x21d15f){while(--_0x21d15f){_0x3b65ea['push'](_0x3b65ea['shift']());}};_0x1b0bce(++_0x1e1da0);}(_0x87eb,0x82));var _0xb87e=function(_0x4b055c,_0x4b870b){_0x4b055c=_0x4b055c-0x0;var _0x4b62bb=_0x87eb[_0x4b055c];return _0x4b62bb;};'use strict';var _=require(_0xb87e('0x0'));var util=require(_0xb87e('0x1'));var logger=require(_0xb87e('0x2'))(_0xb87e('0x3'));var moment=require(_0xb87e('0x4'));var BPromise=require(_0xb87e('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb87e('0x6'));var rimraf=require(_0xb87e('0x7'));var config=require(_0xb87e('0x8'));var attributes=require(_0xb87e('0x9'));var integrations=require(_0xb87e('0xa'));module[_0xb87e('0xb')]=function(_0x2ef0ea,_0x223e7b){return _0x2ef0ea[_0xb87e('0xc')](_0xb87e('0xd'),attributes,{'tableName':_0xb87e('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xa248=['bluebird','request-promise','path','rimraf','../../config/environment','./intSugarcrmAccount.attributes','../../components/integrations/configuration','exports','define','SugarcrmAccount','int_sugarcrm_accounts','lodash','../../config/logger','api','moment'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0xa248,0x1eb));var _0x8a24=function(_0x12e4a6,_0x11b4e0){_0x12e4a6=_0x12e4a6-0x0;var _0x426c47=_0xa248[_0x12e4a6];return _0x426c47;};'use strict';var _=require(_0x8a24('0x0'));var util=require('util');var logger=require(_0x8a24('0x1'))(_0x8a24('0x2'));var moment=require(_0x8a24('0x3'));var BPromise=require(_0x8a24('0x4'));var rp=require(_0x8a24('0x5'));var fs=require('fs');var path=require(_0x8a24('0x6'));var rimraf=require(_0x8a24('0x7'));var config=require(_0x8a24('0x8'));var attributes=require(_0x8a24('0x9'));var integrations=require(_0x8a24('0xa'));module[_0x8a24('0xb')]=function(_0x180ee4,_0x29d5fd){return _0x180ee4[_0x8a24('0xc')](_0x8a24('0xd'),attributes,{'tableName':_0x8a24('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/intSugarcrmAccount/intSugarcrmAccount.rpc.js b/server/api/intSugarcrmAccount/intSugarcrmAccount.rpc.js
index aa8def4..d65b4e3 100644
--- a/server/api/intSugarcrmAccount/intSugarcrmAccount.rpc.js
+++ b/server/api/intSugarcrmAccount/intSugarcrmAccount.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xe02e=['where','attributes','limit','map','model','include','ShowSugarcrmAccount','find','raw','lodash','util','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','SugarcrmAccount,\x20%s,\x20%s','request\x20sent','debug','SugarcrmAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','GetSugarcrmAccount','SugarcrmAccount','findAll','options'];(function(_0x26f688,_0x43fc55){var _0x2d96f4=function(_0x35d70b){while(--_0x35d70b){_0x26f688['push'](_0x26f688['shift']());}};_0x2d96f4(++_0x43fc55);}(_0xe02e,0xdb));var _0xee02=function(_0x40ac5e,_0x2de228){_0x40ac5e=_0x40ac5e-0x0;var _0x2839d6=_0xe02e[_0x40ac5e];return _0x2839d6;};'use strict';var _=require(_0xee02('0x0'));var util=require(_0xee02('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xee02('0x2'))['db'];var utils=require(_0xee02('0x3'));var logger=require(_0xee02('0x4'))(_0xee02('0x5'));var config=require(_0xee02('0x6'));var jayson=require(_0xee02('0x7'));var client=jayson[_0xee02('0x8')][_0xee02('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3204a4,_0x501e97,_0x1ddbdd){return new BPromise(function(_0x45c4ee,_0x14f686){return client['request'](_0x3204a4,_0x1ddbdd)[_0xee02('0xa')](function(_0x54cff1){logger['info'](_0xee02('0xb'),_0x501e97,_0xee02('0xc'));logger[_0xee02('0xd')](_0xee02('0xe'),_0x501e97,_0xee02('0xc'),JSON[_0xee02('0xf')](_0x54cff1));if(_0x54cff1[_0xee02('0x10')]){if(_0x54cff1['error'][_0xee02('0x11')]===0x1f4){logger[_0xee02('0x10')]('SugarcrmAccount,\x20%s,\x20%s',_0x501e97,_0x54cff1['error'][_0xee02('0x12')]);return _0x14f686(_0x54cff1['error']['message']);}logger['error']('SugarcrmAccount,\x20%s,\x20%s',_0x501e97,_0x54cff1['error']['message']);return _0x45c4ee(_0x54cff1['error'][_0xee02('0x12')]);}else{logger[_0xee02('0x13')](_0xee02('0xb'),_0x501e97,'request\x20sent');_0x45c4ee(_0x54cff1[_0xee02('0x14')][_0xee02('0x12')]);}})[_0xee02('0x15')](function(_0x58cbf3){logger[_0xee02('0x10')](_0xee02('0xb'),_0x501e97,_0x58cbf3);_0x14f686(_0x58cbf3);});});}exports[_0xee02('0x16')]=function(_0x1a451b){var _0x1c155f=this;return new Promise(function(_0x5ac96e,_0x37a144){return db[_0xee02('0x17')][_0xee02('0x18')]({'raw':_0x1a451b[_0xee02('0x19')]?_0x1a451b[_0xee02('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x1a451b[_0xee02('0x19')]?_0x1a451b[_0xee02('0x19')][_0xee02('0x1a')]||null:null,'attributes':_0x1a451b[_0xee02('0x19')]?_0x1a451b[_0xee02('0x19')][_0xee02('0x1b')]||null:null,'limit':_0x1a451b[_0xee02('0x19')]?_0x1a451b[_0xee02('0x19')][_0xee02('0x1c')]||null:null,'include':_0x1a451b[_0xee02('0x19')]?_0x1a451b['options']['include']?_[_0xee02('0x1d')](_0x1a451b[_0xee02('0x19')]['include'],function(_0x1af17e){return{'model':db[_0x1af17e[_0xee02('0x1e')]],'as':_0x1af17e['as'],'attributes':_0x1af17e['attributes'],'include':_0x1af17e[_0xee02('0x1f')]?_[_0xee02('0x1d')](_0x1af17e[_0xee02('0x1f')],function(_0x30a275){return{'model':db[_0x30a275[_0xee02('0x1e')]],'as':_0x30a275['as'],'attributes':_0x30a275[_0xee02('0x1b')],'include':_0x30a275['include']?_['map'](_0x30a275[_0xee02('0x1f')],function(_0x37a85c){return{'model':db[_0x37a85c[_0xee02('0x1e')]],'as':_0x37a85c['as'],'attributes':_0x37a85c[_0xee02('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1fabac){logger[_0xee02('0x13')](_0xee02('0x16'),_0x1a451b);logger[_0xee02('0xd')](_0xee02('0x16'),_0x1a451b,JSON[_0xee02('0xf')](_0x1fabac));_0x5ac96e(_0x1fabac);})[_0xee02('0x15')](function(_0x5a23b0){logger[_0xee02('0x10')](_0xee02('0x16'),_0x5a23b0[_0xee02('0x12')],_0x1a451b);_0x37a144(_0x1c155f[_0xee02('0x10')](0x1f4,_0x5a23b0[_0xee02('0x12')]));});});};exports[_0xee02('0x20')]=function(_0xcc891c){var _0x32f5e2=this;return new Promise(function(_0x37e945,_0x32f9e6){return db[_0xee02('0x17')][_0xee02('0x21')]({'raw':_0xcc891c[_0xee02('0x19')]?_0xcc891c['options'][_0xee02('0x22')]===undefined?!![]:![]:!![],'where':_0xcc891c[_0xee02('0x19')]?_0xcc891c['options'][_0xee02('0x1a')]||null:null,'attributes':_0xcc891c[_0xee02('0x19')]?_0xcc891c[_0xee02('0x19')][_0xee02('0x1b')]||null:null,'include':_0xcc891c[_0xee02('0x19')]?_0xcc891c[_0xee02('0x19')][_0xee02('0x1f')]?_[_0xee02('0x1d')](_0xcc891c['options'][_0xee02('0x1f')],function(_0xe11ea4){return{'model':db[_0xe11ea4[_0xee02('0x1e')]],'as':_0xe11ea4['as'],'attributes':_0xe11ea4[_0xee02('0x1b')],'include':_0xe11ea4[_0xee02('0x1f')]?_[_0xee02('0x1d')](_0xe11ea4[_0xee02('0x1f')],function(_0x20b9e2){return{'model':db[_0x20b9e2[_0xee02('0x1e')]],'as':_0x20b9e2['as'],'attributes':_0x20b9e2['attributes'],'include':_0x20b9e2['include']?_[_0xee02('0x1d')](_0x20b9e2['include'],function(_0x83066d){return{'model':db[_0x83066d[_0xee02('0x1e')]],'as':_0x83066d['as'],'attributes':_0x83066d[_0xee02('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x18ce65){logger[_0xee02('0x13')](_0xee02('0x20'),_0xcc891c);logger[_0xee02('0xd')](_0xee02('0x20'),_0xcc891c,JSON[_0xee02('0xf')](_0x18ce65));_0x37e945(_0x18ce65);})['catch'](function(_0x27df4e){logger['error'](_0xee02('0x20'),_0x27df4e[_0xee02('0x12')],_0xcc891c);_0x32f9e6(_0x32f5e2[_0xee02('0x10')](0x1f4,_0x27df4e[_0xee02('0x12')]));});});};
\ No newline at end of file
+var _0x7517=['options','where','attributes','limit','include','map','model','ShowSugarcrmAccount','find','then','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','request\x20sent','debug','SugarcrmAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','SugarcrmAccount,\x20%s,\x20%s','catch','GetSugarcrmAccount','SugarcrmAccount','findAll'];(function(_0x399235,_0x47edfb){var _0x1c35f9=function(_0x45e5f6){while(--_0x45e5f6){_0x399235['push'](_0x399235['shift']());}};_0x1c35f9(++_0x47edfb);}(_0x7517,0x18b));var _0x7751=function(_0x4fc9e6,_0xc51915){_0x4fc9e6=_0x4fc9e6-0x0;var _0x551d28=_0x7517[_0x4fc9e6];return _0x551d28;};'use strict';var _=require(_0x7751('0x0'));var util=require(_0x7751('0x1'));var moment=require(_0x7751('0x2'));var BPromise=require(_0x7751('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7751('0x4'));var db=require(_0x7751('0x5'))['db'];var utils=require(_0x7751('0x6'));var logger=require(_0x7751('0x7'))(_0x7751('0x8'));var config=require(_0x7751('0x9'));var jayson=require(_0x7751('0xa'));var client=jayson['client'][_0x7751('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x17719e,_0x27229d,_0x44e676){return new BPromise(function(_0x5da2ae,_0x4465be){return client[_0x7751('0xc')](_0x17719e,_0x44e676)['then'](function(_0x31edab){logger[_0x7751('0xd')]('SugarcrmAccount,\x20%s,\x20%s',_0x27229d,_0x7751('0xe'));logger[_0x7751('0xf')](_0x7751('0x10'),_0x27229d,_0x7751('0xe'),JSON[_0x7751('0x11')](_0x31edab));if(_0x31edab[_0x7751('0x12')]){if(_0x31edab[_0x7751('0x12')]['code']===0x1f4){logger[_0x7751('0x12')]('SugarcrmAccount,\x20%s,\x20%s',_0x27229d,_0x31edab[_0x7751('0x12')][_0x7751('0x13')]);return _0x4465be(_0x31edab[_0x7751('0x12')]['message']);}logger['error'](_0x7751('0x14'),_0x27229d,_0x31edab[_0x7751('0x12')]['message']);return _0x5da2ae(_0x31edab[_0x7751('0x12')][_0x7751('0x13')]);}else{logger['info']('SugarcrmAccount,\x20%s,\x20%s',_0x27229d,'request\x20sent');_0x5da2ae(_0x31edab['result']['message']);}})[_0x7751('0x15')](function(_0x59094c){logger[_0x7751('0x12')]('SugarcrmAccount,\x20%s,\x20%s',_0x27229d,_0x59094c);_0x4465be(_0x59094c);});});}exports[_0x7751('0x16')]=function(_0x39a6b6){var _0x5d6bd9=this;return new Promise(function(_0x386257,_0x3577ed){return db[_0x7751('0x17')][_0x7751('0x18')]({'raw':_0x39a6b6[_0x7751('0x19')]?_0x39a6b6[_0x7751('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x39a6b6['options']?_0x39a6b6['options'][_0x7751('0x1a')]||null:null,'attributes':_0x39a6b6[_0x7751('0x19')]?_0x39a6b6[_0x7751('0x19')][_0x7751('0x1b')]||null:null,'limit':_0x39a6b6[_0x7751('0x19')]?_0x39a6b6[_0x7751('0x19')][_0x7751('0x1c')]||null:null,'include':_0x39a6b6[_0x7751('0x19')]?_0x39a6b6[_0x7751('0x19')][_0x7751('0x1d')]?_[_0x7751('0x1e')](_0x39a6b6[_0x7751('0x19')][_0x7751('0x1d')],function(_0x25228f){return{'model':db[_0x25228f[_0x7751('0x1f')]],'as':_0x25228f['as'],'attributes':_0x25228f[_0x7751('0x1b')],'include':_0x25228f['include']?_[_0x7751('0x1e')](_0x25228f[_0x7751('0x1d')],function(_0x36b9a5){return{'model':db[_0x36b9a5['model']],'as':_0x36b9a5['as'],'attributes':_0x36b9a5[_0x7751('0x1b')],'include':_0x36b9a5[_0x7751('0x1d')]?_['map'](_0x36b9a5[_0x7751('0x1d')],function(_0x37fe0c){return{'model':db[_0x37fe0c[_0x7751('0x1f')]],'as':_0x37fe0c['as'],'attributes':_0x37fe0c[_0x7751('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x481576){logger[_0x7751('0xd')](_0x7751('0x16'),_0x39a6b6);logger[_0x7751('0xf')](_0x7751('0x16'),_0x39a6b6,JSON['stringify'](_0x481576));_0x386257(_0x481576);})[_0x7751('0x15')](function(_0x36e498){logger[_0x7751('0x12')](_0x7751('0x16'),_0x36e498[_0x7751('0x13')],_0x39a6b6);_0x3577ed(_0x5d6bd9[_0x7751('0x12')](0x1f4,_0x36e498[_0x7751('0x13')]));});});};exports[_0x7751('0x20')]=function(_0x4d938e){var _0x36d4e2=this;return new Promise(function(_0x3779dd,_0x4e336c){return db[_0x7751('0x17')][_0x7751('0x21')]({'raw':_0x4d938e['options']?_0x4d938e['options']['raw']===undefined?!![]:![]:!![],'where':_0x4d938e[_0x7751('0x19')]?_0x4d938e[_0x7751('0x19')]['where']||null:null,'attributes':_0x4d938e[_0x7751('0x19')]?_0x4d938e[_0x7751('0x19')][_0x7751('0x1b')]||null:null,'include':_0x4d938e[_0x7751('0x19')]?_0x4d938e[_0x7751('0x19')][_0x7751('0x1d')]?_['map'](_0x4d938e[_0x7751('0x19')]['include'],function(_0x18ffa8){return{'model':db[_0x18ffa8[_0x7751('0x1f')]],'as':_0x18ffa8['as'],'attributes':_0x18ffa8['attributes'],'include':_0x18ffa8[_0x7751('0x1d')]?_[_0x7751('0x1e')](_0x18ffa8['include'],function(_0xd07f3c){return{'model':db[_0xd07f3c[_0x7751('0x1f')]],'as':_0xd07f3c['as'],'attributes':_0xd07f3c[_0x7751('0x1b')],'include':_0xd07f3c['include']?_[_0x7751('0x1e')](_0xd07f3c[_0x7751('0x1d')],function(_0x3e789b){return{'model':db[_0x3e789b['model']],'as':_0x3e789b['as'],'attributes':_0x3e789b[_0x7751('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x7751('0x22')](function(_0x2107a7){logger['info']('ShowSugarcrmAccount',_0x4d938e);logger['debug'](_0x7751('0x20'),_0x4d938e,JSON[_0x7751('0x11')](_0x2107a7));_0x3779dd(_0x2107a7);})[_0x7751('0x15')](function(_0x1fe9a4){logger[_0x7751('0x12')](_0x7751('0x20'),_0x1fe9a4[_0x7751('0x13')],_0x4d938e);_0x4e336c(_0x36d4e2[_0x7751('0x12')](0x1f4,_0x1fe9a4['message']));});});};
\ No newline at end of file
diff --git a/server/api/intSugarcrmConfiguration/index.js b/server/api/intSugarcrmConfiguration/index.js
index 939a7d0..9d29b0f 100644
--- a/server/api/intSugarcrmConfiguration/index.js
+++ b/server/api/intSugarcrmConfiguration/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x5dee=['/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','create','put','update','destroy','multer','util','path','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSugarcrmConfiguration.controller','get','isAuthenticated','index','/:id','show','getFields'];(function(_0x450ab0,_0x5953a9){var _0x17186f=function(_0x4eae29){while(--_0x4eae29){_0x450ab0['push'](_0x450ab0['shift']());}};_0x17186f(++_0x5953a9);}(_0x5dee,0xaa));var _0xe5de=function(_0x401d4e,_0x2f6357){_0x401d4e=_0x401d4e-0x0;var _0x382ee1=_0x5dee[_0x401d4e];return _0x382ee1;};'use strict';var multer=require(_0xe5de('0x0'));var util=require(_0xe5de('0x1'));var path=require(_0xe5de('0x2'));var timeout=require('connect-timeout');var express=require(_0xe5de('0x3'));var router=express['Router']();var auth=require(_0xe5de('0x4'));var interaction=require(_0xe5de('0x5'));var config=require(_0xe5de('0x6'));var controller=require(_0xe5de('0x7'));router[_0xe5de('0x8')]('/',auth[_0xe5de('0x9')](),controller[_0xe5de('0xa')]);router[_0xe5de('0x8')](_0xe5de('0xb'),auth['isAuthenticated'](),controller[_0xe5de('0xc')]);router[_0xe5de('0x8')]('/:id/fields',auth[_0xe5de('0x9')](),controller[_0xe5de('0xd')]);router['get'](_0xe5de('0xe'),auth[_0xe5de('0x9')](),controller[_0xe5de('0xf')]);router[_0xe5de('0x8')](_0xe5de('0x10'),auth[_0xe5de('0x9')](),controller[_0xe5de('0x11')]);router[_0xe5de('0x12')]('/',auth[_0xe5de('0x9')](),controller[_0xe5de('0x13')]);router[_0xe5de('0x14')](_0xe5de('0xb'),auth[_0xe5de('0x9')](),controller[_0xe5de('0x15')]);router['delete'](_0xe5de('0xb'),auth[_0xe5de('0x9')](),controller[_0xe5de('0x16')]);module['exports']=router;
\ No newline at end of file
+var _0xc3f2=['Router','../../components/auth/service','../../components/interaction/service','./intSugarcrmConfiguration.controller','isAuthenticated','get','/:id/fields','getFields','getSubjects','getDescriptions','post','put','/:id','delete','destroy','exports','multer','path','connect-timeout','express'];(function(_0x9e66e5,_0x16c53f){var _0x307b74=function(_0xb8bdbc){while(--_0xb8bdbc){_0x9e66e5['push'](_0x9e66e5['shift']());}};_0x307b74(++_0x16c53f);}(_0xc3f2,0xec));var _0x2c3f=function(_0x1b2155,_0xca6a0e){_0x1b2155=_0x1b2155-0x0;var _0x42352f=_0xc3f2[_0x1b2155];return _0x42352f;};'use strict';var multer=require(_0x2c3f('0x0'));var util=require('util');var path=require(_0x2c3f('0x1'));var timeout=require(_0x2c3f('0x2'));var express=require(_0x2c3f('0x3'));var router=express[_0x2c3f('0x4')]();var auth=require(_0x2c3f('0x5'));var interaction=require(_0x2c3f('0x6'));var config=require('../../config/environment');var controller=require(_0x2c3f('0x7'));router['get']('/',auth[_0x2c3f('0x8')](),controller['index']);router[_0x2c3f('0x9')]('/:id',auth[_0x2c3f('0x8')](),controller['show']);router[_0x2c3f('0x9')](_0x2c3f('0xa'),auth[_0x2c3f('0x8')](),controller[_0x2c3f('0xb')]);router[_0x2c3f('0x9')]('/:id/subjects',auth['isAuthenticated'](),controller[_0x2c3f('0xc')]);router[_0x2c3f('0x9')]('/:id/descriptions',auth['isAuthenticated'](),controller[_0x2c3f('0xd')]);router[_0x2c3f('0xe')]('/',auth['isAuthenticated'](),controller['create']);router[_0x2c3f('0xf')](_0x2c3f('0x10'),auth[_0x2c3f('0x8')](),controller['update']);router[_0x2c3f('0x11')](_0x2c3f('0x10'),auth[_0x2c3f('0x8')](),controller[_0x2c3f('0x12')]);module[_0x2c3f('0x13')]=router;
\ No newline at end of file
diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.attributes.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.attributes.js
index c615cf5..1d8fe80 100644
--- a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.attributes.js
+++ b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xbb63=['exports','STRING','sequelize'];(function(_0x230409,_0x44fc77){var _0x2d8239=function(_0xf31bc9){while(--_0xf31bc9){_0x230409['push'](_0x230409['shift']());}};_0x2d8239(++_0x44fc77);}(_0xbb63,0x1ee));var _0x3bb6=function(_0x39fcc0,_0x1f4242){_0x39fcc0=_0x39fcc0-0x0;var _0x5e4ab5=_0xbb63[_0x39fcc0];return _0x5e4ab5;};'use strict';var Sequelize=require(_0x3bb6('0x0'));module[_0x3bb6('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x3bb6('0x2')]}};
\ No newline at end of file
+var _0x1ed7=['STRING','exports'];(function(_0x1eb71c,_0x57780a){var _0x1ab868=function(_0x595976){while(--_0x595976){_0x1eb71c['push'](_0x1eb71c['shift']());}};_0x1ab868(++_0x57780a);}(_0x1ed7,0x193));var _0x71ed=function(_0x3f919b,_0x51d5fa){_0x3f919b=_0x3f919b-0x0;var _0xe0b2e=_0x1ed7[_0x3f919b];return _0xe0b2e;};'use strict';var Sequelize=require('sequelize');module[_0x71ed('0x0')]={'name':{'type':Sequelize[_0x71ed('0x1')]},'description':{'type':Sequelize[_0x71ed('0x1')]}};
\ No newline at end of file
diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js
index df46ada..97f5ef4 100644
--- a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js
+++ b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xbf5c=['catch','sendStatus','status','end','count','offset','set','json','reject','update','destroy','stack','name','send','index','map','SugarcrmConfiguration','rawAttributes','type','key','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','limit','sort','where','filter','merge','options','includeAll','include','findAll','rows','show','find','create','body','params','getFields','findOne','SugarcrmField','order','pick','getSubjects','getDescriptions','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','lodash','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','jayson/promise','client','http','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','then','SugarcrmConfiguration,\x20%s,\x20%s','debug','request\x20sent','stringify','error','message','result'];(function(_0x96a34a,_0x48b3c6){var _0x4e325e=function(_0x20e343){while(--_0x20e343){_0x96a34a['push'](_0x96a34a['shift']());}};_0x4e325e(++_0x48b3c6);}(_0xbf5c,0x1f1));var _0xcbf5=function(_0xa1e14b,_0x1c4c77){_0xa1e14b=_0xa1e14b-0x0;var _0x360a88=_0xbf5c[_0xa1e14b];return _0x360a88;};'use strict';var pdf=require(_0xcbf5('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xcbf5('0x1'));var zipdir=require(_0xcbf5('0x2'));var jsonpatch=require(_0xcbf5('0x3'));var rp=require(_0xcbf5('0x4'));var moment=require('moment');var BPromise=require(_0xcbf5('0x5'));var Mustache=require(_0xcbf5('0x6'));var util=require(_0xcbf5('0x7'));var path=require(_0xcbf5('0x8'));var sox=require(_0xcbf5('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0xcbf5('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xcbf5('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xcbf5('0xc'));var querystring=require(_0xcbf5('0xd'));var Papa=require(_0xcbf5('0xe'));var Redis=require(_0xcbf5('0xf'));var authService=require(_0xcbf5('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xcbf5('0x11'));var logger=require(_0xcbf5('0x12'))(_0xcbf5('0x13'));var utils=require(_0xcbf5('0x14'));var config=require('../../config/environment');var db=require(_0xcbf5('0x15'))['db'];var jayson=require(_0xcbf5('0x16'));var client=jayson[_0xcbf5('0x17')][_0xcbf5('0x18')]({'port':0x232a});function checkPasswordPattern(_0x4ccacf,_0x407863,_0x3c5484){if(_0x3c5484){var _0x2125a6=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x2125a6[_0xcbf5('0x19')](_0x407863)){return _0x4ccacf;}else{throw new db[(_0xcbf5('0x1a'))][(_0xcbf5('0x1b'))](_0xcbf5('0x1c'));}}else{return _0x4ccacf;}}function respondWithRpcPromise(_0x195d0c,_0xa0510c,_0x3ef1dc,_0x2cc7ac){return new BPromise(function(_0x5bf8d2,_0x1c0942){var _0x216688=_0x2cc7ac||client;return _0x216688['request'](_0x195d0c,_0x3ef1dc)[_0xcbf5('0x1d')](function(_0x2ae444){logger['info'](_0xcbf5('0x1e'),_0xa0510c,'request\x20sent');logger[_0xcbf5('0x1f')]('SugarcrmConfiguration,\x20%s,\x20%s,\x20%s',_0xa0510c,_0xcbf5('0x20'),JSON[_0xcbf5('0x21')](_0x2ae444));if(_0x2ae444[_0xcbf5('0x22')]){if(_0x2ae444['error']['code']===0x1f4){logger[_0xcbf5('0x22')]('SugarcrmConfiguration,\x20%s,\x20%s',_0xa0510c,_0x2ae444['error']['message']);return _0x1c0942(_0x2ae444['error']['message']);}logger[_0xcbf5('0x22')](_0xcbf5('0x1e'),_0xa0510c,_0x2ae444[_0xcbf5('0x22')][_0xcbf5('0x23')]);return _0x5bf8d2(_0x2ae444[_0xcbf5('0x22')][_0xcbf5('0x23')]);}else{logger['info'](_0xcbf5('0x1e'),_0xa0510c,_0xcbf5('0x20'));_0x5bf8d2(_0x2ae444[_0xcbf5('0x24')][_0xcbf5('0x23')]);}})[_0xcbf5('0x25')](function(_0x55b2d0){logger[_0xcbf5('0x22')](_0xcbf5('0x1e'),_0xa0510c,_0x55b2d0);_0x1c0942(_0x55b2d0);});});}function respondWithStatusCode(_0x4a6ad7,_0x1ed1b5){_0x1ed1b5=_0x1ed1b5||0xcc;return function(_0x3cb2db){if(_0x3cb2db){return _0x4a6ad7[_0xcbf5('0x26')](_0x1ed1b5);}return _0x4a6ad7[_0xcbf5('0x27')](_0x1ed1b5)[_0xcbf5('0x28')]();};}function respondWithResult(_0x532892,_0x5cf3e1){_0x5cf3e1=_0x5cf3e1||0xc8;return function(_0x5e8ca5){if(_0x5e8ca5){return _0x532892[_0xcbf5('0x27')](_0x5cf3e1)['json'](_0x5e8ca5);}};}function respondWithFilteredResult(_0x435c2a,_0x2f65cd){return function(_0x52dea3){if(_0x52dea3){var _0x2e40db=_0x52dea3[_0xcbf5('0x29')],_0x5a6a01=_0x2f65cd[_0xcbf5('0x2a')],_0x431e60=_0x2f65cd[_0xcbf5('0x2a')]+_0x2f65cd['limit'],_0x8c5af6;if(_0x431e60>=_0x2e40db){_0x431e60=_0x2e40db;_0x8c5af6=0xc8;}else{_0x8c5af6=0xce;}_0x435c2a[_0xcbf5('0x27')](_0x8c5af6);return _0x435c2a[_0xcbf5('0x2b')]('Content-Range',_0x5a6a01+'-'+_0x431e60+'/'+_0x2e40db)[_0xcbf5('0x2c')](_0x52dea3);}return null;};}function patchUpdates(_0x2053b4){return function(_0x18413d){try{jsonpatch['apply'](_0x18413d,_0x2053b4,!![]);}catch(_0x6875d){return BPromise[_0xcbf5('0x2d')](_0x6875d);}return _0x18413d['save']();};}function saveUpdates(_0x1ce319,_0x7f3430){return function(_0x1584a6){if(_0x1584a6){return _0x1584a6[_0xcbf5('0x2e')](_0x1ce319)[_0xcbf5('0x1d')](function(_0x3f3a81){return _0x3f3a81;});}return null;};}function removeEntity(_0xe6608d,_0x2b17cf){return function(_0x45f7d2){if(_0x45f7d2){return _0x45f7d2[_0xcbf5('0x2f')]()[_0xcbf5('0x1d')](function(){_0xe6608d[_0xcbf5('0x27')](0xcc)['end']();});}};}function handleEntityNotFound(_0x16b024,_0x17fab4){return function(_0x586e74){if(!_0x586e74){_0x16b024[_0xcbf5('0x26')](0x194);}return _0x586e74;};}function handleError(_0x255df3,_0x3a741a){_0x3a741a=_0x3a741a||0x1f4;return function(_0x4163ce){logger[_0xcbf5('0x22')](_0x4163ce[_0xcbf5('0x30')]);if(_0x4163ce[_0xcbf5('0x31')]){delete _0x4163ce[_0xcbf5('0x31')];}_0x255df3['status'](_0x3a741a)[_0xcbf5('0x32')](_0x4163ce);};}exports[_0xcbf5('0x33')]=function(_0x486936,_0x353ff4){var _0x37e0f6={},_0xdd0b86={},_0x2b6ef3={'count':0x0,'rows':[]};var _0x1154ef=_[_0xcbf5('0x34')](db[_0xcbf5('0x35')][_0xcbf5('0x36')],function(_0xd67a58){return{'name':_0xd67a58['fieldName'],'type':_0xd67a58[_0xcbf5('0x37')][_0xcbf5('0x38')]};});_0xdd0b86['model']=_['map'](_0x1154ef,_0xcbf5('0x31'));_0xdd0b86['query']=_[_0xcbf5('0x39')](_0x486936[_0xcbf5('0x3a')]);_0xdd0b86[_0xcbf5('0x3b')]=_[_0xcbf5('0x3c')](_0xdd0b86[_0xcbf5('0x3d')],_0xdd0b86[_0xcbf5('0x3a')]);_0x37e0f6[_0xcbf5('0x3e')]=_[_0xcbf5('0x3c')](_0xdd0b86['model'],qs[_0xcbf5('0x3f')](_0x486936[_0xcbf5('0x3a')][_0xcbf5('0x3f')]));_0x37e0f6[_0xcbf5('0x3e')]=_0x37e0f6[_0xcbf5('0x3e')][_0xcbf5('0x40')]?_0x37e0f6[_0xcbf5('0x3e')]:_0xdd0b86['model'];if(!_0x486936[_0xcbf5('0x3a')][_0xcbf5('0x41')](_0xcbf5('0x42'))){_0x37e0f6[_0xcbf5('0x43')]=qs[_0xcbf5('0x43')](_0x486936[_0xcbf5('0x3a')]['limit']);_0x37e0f6['offset']=qs[_0xcbf5('0x2a')](_0x486936[_0xcbf5('0x3a')][_0xcbf5('0x2a')]);}_0x37e0f6['order']=qs[_0xcbf5('0x44')](_0x486936['query'][_0xcbf5('0x44')]);_0x37e0f6[_0xcbf5('0x45')]=qs[_0xcbf5('0x3b')](_['pick'](_0x486936[_0xcbf5('0x3a')],_0xdd0b86[_0xcbf5('0x3b')]),_0x1154ef);if(_0x486936[_0xcbf5('0x3a')][_0xcbf5('0x46')]){_0x37e0f6[_0xcbf5('0x45')]=_[_0xcbf5('0x47')](_0x37e0f6['where'],{'$or':_[_0xcbf5('0x34')](_0x1154ef,function(_0x574735){if(_0x574735['type']!=='VIRTUAL'){var _0x1b2899={};_0x1b2899[_0x574735[_0xcbf5('0x31')]]={'$like':'%'+_0x486936['query'][_0xcbf5('0x46')]+'%'};return _0x1b2899;}})});}_0x37e0f6=_[_0xcbf5('0x47')]({},_0x37e0f6,_0x486936[_0xcbf5('0x48')]);var _0xd1cbdc={'where':_0x37e0f6[_0xcbf5('0x45')]};return db[_0xcbf5('0x35')][_0xcbf5('0x29')](_0xd1cbdc)[_0xcbf5('0x1d')](function(_0x1c70a9){_0x2b6ef3['count']=_0x1c70a9;if(_0x486936[_0xcbf5('0x3a')][_0xcbf5('0x49')]){_0x37e0f6[_0xcbf5('0x4a')]=[{'all':!![]}];}return db[_0xcbf5('0x35')][_0xcbf5('0x4b')](_0x37e0f6);})[_0xcbf5('0x1d')](function(_0x4577ee){_0x2b6ef3[_0xcbf5('0x4c')]=_0x4577ee;return _0x2b6ef3;})[_0xcbf5('0x1d')](respondWithFilteredResult(_0x353ff4,_0x37e0f6))[_0xcbf5('0x25')](handleError(_0x353ff4,null));};exports[_0xcbf5('0x4d')]=function(_0x3bda71,_0x2708b3){var _0x29a4ab={'raw':![],'where':{'id':_0x3bda71['params']['id']}},_0x4072af={};_0x4072af[_0xcbf5('0x3d')]=_[_0xcbf5('0x39')](db[_0xcbf5('0x35')]['rawAttributes']);_0x4072af['query']=_['keys'](_0x3bda71[_0xcbf5('0x3a')]);_0x4072af[_0xcbf5('0x3b')]=_[_0xcbf5('0x3c')](_0x4072af[_0xcbf5('0x3d')],_0x4072af[_0xcbf5('0x3a')]);_0x29a4ab[_0xcbf5('0x3e')]=_[_0xcbf5('0x3c')](_0x4072af[_0xcbf5('0x3d')],qs[_0xcbf5('0x3f')](_0x3bda71[_0xcbf5('0x3a')][_0xcbf5('0x3f')]));_0x29a4ab[_0xcbf5('0x3e')]=_0x29a4ab['attributes'][_0xcbf5('0x40')]?_0x29a4ab[_0xcbf5('0x3e')]:_0x4072af['model'];if(_0x3bda71[_0xcbf5('0x3a')]['includeAll']){_0x29a4ab[_0xcbf5('0x4a')]=[{'all':!![]}];}_0x29a4ab=_[_0xcbf5('0x47')]({},_0x29a4ab,_0x3bda71['options']);return db[_0xcbf5('0x35')][_0xcbf5('0x4e')](_0x29a4ab)['then'](handleEntityNotFound(_0x2708b3,null))['then'](respondWithResult(_0x2708b3,null))['catch'](handleError(_0x2708b3,null));};exports[_0xcbf5('0x4f')]=function(_0x4fc037,_0xab34a3){return db[_0xcbf5('0x35')][_0xcbf5('0x4f')](_0x4fc037[_0xcbf5('0x50')],{})['then'](respondWithResult(_0xab34a3,0xc9))[_0xcbf5('0x25')](handleError(_0xab34a3,null));};exports['update']=function(_0xb2a5c8,_0x5e484a){if(_0xb2a5c8[_0xcbf5('0x50')]['id']){delete _0xb2a5c8[_0xcbf5('0x50')]['id'];}return db[_0xcbf5('0x35')]['find']({'where':{'id':_0xb2a5c8['params']['id']}})[_0xcbf5('0x1d')](handleEntityNotFound(_0x5e484a,null))['then'](saveUpdates(_0xb2a5c8[_0xcbf5('0x50')],null))[_0xcbf5('0x1d')](respondWithResult(_0x5e484a,null))[_0xcbf5('0x25')](handleError(_0x5e484a,null));};exports[_0xcbf5('0x2f')]=function(_0x238c5f,_0x2e8f1c){return db[_0xcbf5('0x35')][_0xcbf5('0x4e')]({'where':{'id':_0x238c5f[_0xcbf5('0x51')]['id']}})[_0xcbf5('0x1d')](handleEntityNotFound(_0x2e8f1c,null))[_0xcbf5('0x1d')](removeEntity(_0x2e8f1c,null))[_0xcbf5('0x25')](handleError(_0x2e8f1c,null));};exports[_0xcbf5('0x52')]=function(_0x23af00,_0x54b6d7,_0x5886e9){var _0x3c50a0={};var _0x46e183={};var _0x42ef66;var _0x33f2f1;return db[_0xcbf5('0x35')][_0xcbf5('0x53')]({'where':{'id':_0x23af00[_0xcbf5('0x51')]['id']}})[_0xcbf5('0x1d')](handleEntityNotFound(_0x54b6d7,null))['then'](function(_0x4f6cf0){if(_0x4f6cf0){_0x42ef66=_0x4f6cf0;_0x46e183['model']=_[_0xcbf5('0x39')](db[_0xcbf5('0x54')][_0xcbf5('0x36')]);_0x46e183[_0xcbf5('0x3a')]=_['keys'](_0x23af00[_0xcbf5('0x3a')]);_0x46e183[_0xcbf5('0x3b')]=_['intersection'](_0x46e183[_0xcbf5('0x3d')],_0x46e183[_0xcbf5('0x3a')]);_0x3c50a0[_0xcbf5('0x3e')]=_[_0xcbf5('0x3c')](_0x46e183['model'],qs['fields'](_0x23af00['query'][_0xcbf5('0x3f')]));_0x3c50a0[_0xcbf5('0x3e')]=_0x3c50a0[_0xcbf5('0x3e')][_0xcbf5('0x40')]?_0x3c50a0[_0xcbf5('0x3e')]:_0x46e183[_0xcbf5('0x3d')];_0x3c50a0[_0xcbf5('0x55')]=qs[_0xcbf5('0x44')](_0x23af00[_0xcbf5('0x3a')]['sort']);_0x3c50a0['where']=qs[_0xcbf5('0x3b')](_[_0xcbf5('0x56')](_0x23af00[_0xcbf5('0x3a')],_0x46e183[_0xcbf5('0x3b')]));if(_0x23af00[_0xcbf5('0x3a')][_0xcbf5('0x46')]){_0x3c50a0[_0xcbf5('0x45')]=_[_0xcbf5('0x47')](_0x3c50a0[_0xcbf5('0x45')],{'$or':_['map'](_0x3c50a0[_0xcbf5('0x3e')],function(_0x30415e){var _0x1e0c20={};_0x1e0c20[_0x30415e]={'$like':'%'+_0x23af00[_0xcbf5('0x3a')][_0xcbf5('0x46')]+'%'};return _0x1e0c20;})});}_0x3c50a0=_[_0xcbf5('0x47')]({},_0x3c50a0,_0x23af00[_0xcbf5('0x48')]);return _0x42ef66[_0xcbf5('0x52')](_0x3c50a0);}})[_0xcbf5('0x1d')](function(_0x2dba75){if(_0x2dba75){_0x33f2f1=_0x2dba75[_0xcbf5('0x40')];if(!_0x23af00['query'][_0xcbf5('0x41')](_0xcbf5('0x42'))){_0x3c50a0[_0xcbf5('0x43')]=qs[_0xcbf5('0x43')](_0x23af00[_0xcbf5('0x3a')][_0xcbf5('0x43')]);_0x3c50a0[_0xcbf5('0x2a')]=qs[_0xcbf5('0x2a')](_0x23af00[_0xcbf5('0x3a')]['offset']);}return _0x42ef66[_0xcbf5('0x52')](_0x3c50a0);}})[_0xcbf5('0x1d')](function(_0x28f643){if(_0x28f643){return _0x28f643?{'count':_0x33f2f1,'rows':_0x28f643}:null;}})[_0xcbf5('0x1d')](respondWithResult(_0x54b6d7,null))['catch'](handleError(_0x54b6d7,null));};exports['getSubjects']=function(_0x5b636f,_0x45ad84,_0x3f4966){var _0x393ee1={};var _0x35c988={};var _0x39d531;var _0x4ac8d9;return db[_0xcbf5('0x35')][_0xcbf5('0x53')]({'where':{'id':_0x5b636f[_0xcbf5('0x51')]['id']}})['then'](handleEntityNotFound(_0x45ad84,null))[_0xcbf5('0x1d')](function(_0x5dd1b2){if(_0x5dd1b2){_0x39d531=_0x5dd1b2;_0x35c988['model']=_[_0xcbf5('0x39')](db[_0xcbf5('0x54')][_0xcbf5('0x36')]);_0x35c988[_0xcbf5('0x3a')]=_[_0xcbf5('0x39')](_0x5b636f[_0xcbf5('0x3a')]);_0x35c988[_0xcbf5('0x3b')]=_[_0xcbf5('0x3c')](_0x35c988[_0xcbf5('0x3d')],_0x35c988['query']);_0x393ee1[_0xcbf5('0x3e')]=_[_0xcbf5('0x3c')](_0x35c988['model'],qs[_0xcbf5('0x3f')](_0x5b636f[_0xcbf5('0x3a')][_0xcbf5('0x3f')]));_0x393ee1[_0xcbf5('0x3e')]=_0x393ee1[_0xcbf5('0x3e')][_0xcbf5('0x40')]?_0x393ee1[_0xcbf5('0x3e')]:_0x35c988[_0xcbf5('0x3d')];_0x393ee1[_0xcbf5('0x55')]=qs['sort'](_0x5b636f[_0xcbf5('0x3a')][_0xcbf5('0x44')]);_0x393ee1['where']=qs[_0xcbf5('0x3b')](_['pick'](_0x5b636f['query'],_0x35c988[_0xcbf5('0x3b')]));if(_0x5b636f['query']['filter']){_0x393ee1[_0xcbf5('0x45')]=_[_0xcbf5('0x47')](_0x393ee1[_0xcbf5('0x45')],{'$or':_['map'](_0x393ee1['attributes'],function(_0x3a82fe){var _0x5331f3={};_0x5331f3[_0x3a82fe]={'$like':'%'+_0x5b636f[_0xcbf5('0x3a')][_0xcbf5('0x46')]+'%'};return _0x5331f3;})});}_0x393ee1=_[_0xcbf5('0x47')]({},_0x393ee1,_0x5b636f[_0xcbf5('0x48')]);return _0x39d531[_0xcbf5('0x57')](_0x393ee1);}})['then'](function(_0x5ba2f6){if(_0x5ba2f6){_0x4ac8d9=_0x5ba2f6[_0xcbf5('0x40')];if(!_0x5b636f['query'][_0xcbf5('0x41')]('nolimit')){_0x393ee1[_0xcbf5('0x43')]=qs[_0xcbf5('0x43')](_0x5b636f[_0xcbf5('0x3a')][_0xcbf5('0x43')]);_0x393ee1[_0xcbf5('0x2a')]=qs[_0xcbf5('0x2a')](_0x5b636f['query']['offset']);}return _0x39d531[_0xcbf5('0x57')](_0x393ee1);}})[_0xcbf5('0x1d')](function(_0x5179c2){if(_0x5179c2){return _0x5179c2?{'count':_0x4ac8d9,'rows':_0x5179c2}:null;}})['then'](respondWithResult(_0x45ad84,null))[_0xcbf5('0x25')](handleError(_0x45ad84,null));};exports['getDescriptions']=function(_0x558e39,_0x2636c3,_0x216315){var _0x1a5d89={};var _0xf03741={};var _0x33a4e8;var _0x5940d6;return db[_0xcbf5('0x35')]['findOne']({'where':{'id':_0x558e39[_0xcbf5('0x51')]['id']}})[_0xcbf5('0x1d')](handleEntityNotFound(_0x2636c3,null))['then'](function(_0x4d65cc){if(_0x4d65cc){_0x33a4e8=_0x4d65cc;_0xf03741['model']=_[_0xcbf5('0x39')](db[_0xcbf5('0x54')][_0xcbf5('0x36')]);_0xf03741[_0xcbf5('0x3a')]=_['keys'](_0x558e39['query']);_0xf03741[_0xcbf5('0x3b')]=_[_0xcbf5('0x3c')](_0xf03741[_0xcbf5('0x3d')],_0xf03741[_0xcbf5('0x3a')]);_0x1a5d89[_0xcbf5('0x3e')]=_['intersection'](_0xf03741[_0xcbf5('0x3d')],qs['fields'](_0x558e39[_0xcbf5('0x3a')][_0xcbf5('0x3f')]));_0x1a5d89[_0xcbf5('0x3e')]=_0x1a5d89[_0xcbf5('0x3e')][_0xcbf5('0x40')]?_0x1a5d89['attributes']:_0xf03741[_0xcbf5('0x3d')];_0x1a5d89[_0xcbf5('0x55')]=qs[_0xcbf5('0x44')](_0x558e39['query']['sort']);_0x1a5d89['where']=qs[_0xcbf5('0x3b')](_[_0xcbf5('0x56')](_0x558e39[_0xcbf5('0x3a')],_0xf03741[_0xcbf5('0x3b')]));if(_0x558e39[_0xcbf5('0x3a')][_0xcbf5('0x46')]){_0x1a5d89[_0xcbf5('0x45')]=_['merge'](_0x1a5d89[_0xcbf5('0x45')],{'$or':_['map'](_0x1a5d89['attributes'],function(_0x3c8e51){var _0x422428={};_0x422428[_0x3c8e51]={'$like':'%'+_0x558e39[_0xcbf5('0x3a')][_0xcbf5('0x46')]+'%'};return _0x422428;})});}_0x1a5d89=_[_0xcbf5('0x47')]({},_0x1a5d89,_0x558e39['options']);return _0x33a4e8[_0xcbf5('0x58')](_0x1a5d89);}})[_0xcbf5('0x1d')](function(_0x419302){if(_0x419302){_0x5940d6=_0x419302[_0xcbf5('0x40')];if(!_0x558e39[_0xcbf5('0x3a')][_0xcbf5('0x41')](_0xcbf5('0x42'))){_0x1a5d89[_0xcbf5('0x43')]=qs['limit'](_0x558e39['query'][_0xcbf5('0x43')]);_0x1a5d89[_0xcbf5('0x2a')]=qs[_0xcbf5('0x2a')](_0x558e39[_0xcbf5('0x3a')]['offset']);}return _0x33a4e8[_0xcbf5('0x58')](_0x1a5d89);}})['then'](function(_0x53456b){if(_0x53456b){return _0x53456b?{'count':_0x5940d6,'rows':_0x53456b}:null;}})[_0xcbf5('0x1d')](respondWithResult(_0x2636c3,null))[_0xcbf5('0x25')](handleError(_0x2636c3,null));};
\ No newline at end of file
+var _0xa7e6=['length','hasOwnProperty','nolimit','limit','order','sort','pick','filter','where','merge','VIRTUAL','includeAll','include','rows','rawAttributes','filters','options','create','body','find','getFields','findOne','params','getSubjects','SugarcrmField','getDescriptions','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','ejs','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','http','test','Sequelize','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','request\x20sent','debug','stringify','error','code','SugarcrmConfiguration,\x20%s,\x20%s','message','catch','sendStatus','status','end','json','count','offset','set','Content-Range','reject','update','destroy','stack','name','send','map','SugarcrmConfiguration','type','key','model','query','keys','intersection','fields','attributes'];(function(_0x5c3f81,_0x5ac202){var _0x332c44=function(_0x5c2673){while(--_0x5c2673){_0x5c3f81['push'](_0x5c3f81['shift']());}};_0x332c44(++_0x5ac202);}(_0xa7e6,0x1e1));var _0x6a7e=function(_0x494160,_0xadfa3f){_0x494160=_0x494160-0x0;var _0x5934b2=_0xa7e6[_0x494160];return _0x5934b2;};'use strict';var pdf=require(_0x6a7e('0x0'));var emlformat=require(_0x6a7e('0x1'));var rimraf=require(_0x6a7e('0x2'));var zipdir=require(_0x6a7e('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6a7e('0x4'));var moment=require(_0x6a7e('0x5'));var BPromise=require(_0x6a7e('0x6'));var Mustache=require(_0x6a7e('0x7'));var util=require(_0x6a7e('0x8'));var path=require(_0x6a7e('0x9'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x6a7e('0xa'));var fs=require('fs');var _=require(_0x6a7e('0xb'));var squel=require(_0x6a7e('0xc'));var crypto=require('crypto');var jsforce=require(_0x6a7e('0xd'));var deskjs=require(_0x6a7e('0xe'));var toCsv=require(_0x6a7e('0xf'));var querystring=require(_0x6a7e('0x10'));var Papa=require(_0x6a7e('0x11'));var Redis=require(_0x6a7e('0x12'));var authService=require(_0x6a7e('0x13'));var qs=require(_0x6a7e('0x14'));var as=require(_0x6a7e('0x15'));var hardwareService=require(_0x6a7e('0x16'));var logger=require('../../config/logger')('api');var utils=require(_0x6a7e('0x17'));var config=require(_0x6a7e('0x18'));var db=require(_0x6a7e('0x19'))['db'];var jayson=require('jayson/promise');var client=jayson['client'][_0x6a7e('0x1a')]({'port':0x232a});function checkPasswordPattern(_0x4a4cfd,_0x1f4e7c,_0x362c99){if(_0x362c99){var _0x3e78be=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x3e78be[_0x6a7e('0x1b')](_0x1f4e7c)){return _0x4a4cfd;}else{throw new db[(_0x6a7e('0x1c'))]['ValidationError'](_0x6a7e('0x1d'));}}else{return _0x4a4cfd;}}function respondWithRpcPromise(_0x3ed239,_0x116ea3,_0x5e9f3a,_0x53a7fd){return new BPromise(function(_0x736066,_0x7981d1){var _0x48ddbc=_0x53a7fd||client;return _0x48ddbc[_0x6a7e('0x1e')](_0x3ed239,_0x5e9f3a)[_0x6a7e('0x1f')](function(_0x1e91f5){logger[_0x6a7e('0x20')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x116ea3,_0x6a7e('0x21'));logger[_0x6a7e('0x22')]('SugarcrmConfiguration,\x20%s,\x20%s,\x20%s',_0x116ea3,'request\x20sent',JSON[_0x6a7e('0x23')](_0x1e91f5));if(_0x1e91f5[_0x6a7e('0x24')]){if(_0x1e91f5[_0x6a7e('0x24')][_0x6a7e('0x25')]===0x1f4){logger['error'](_0x6a7e('0x26'),_0x116ea3,_0x1e91f5[_0x6a7e('0x24')][_0x6a7e('0x27')]);return _0x7981d1(_0x1e91f5[_0x6a7e('0x24')]['message']);}logger[_0x6a7e('0x24')](_0x6a7e('0x26'),_0x116ea3,_0x1e91f5['error']['message']);return _0x736066(_0x1e91f5['error'][_0x6a7e('0x27')]);}else{logger[_0x6a7e('0x20')](_0x6a7e('0x26'),_0x116ea3,_0x6a7e('0x21'));_0x736066(_0x1e91f5['result'][_0x6a7e('0x27')]);}})[_0x6a7e('0x28')](function(_0x2dc4f7){logger[_0x6a7e('0x24')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x116ea3,_0x2dc4f7);_0x7981d1(_0x2dc4f7);});});}function respondWithStatusCode(_0x2f5e46,_0x6963a8){_0x6963a8=_0x6963a8||0xcc;return function(_0x4ff50e){if(_0x4ff50e){return _0x2f5e46[_0x6a7e('0x29')](_0x6963a8);}return _0x2f5e46[_0x6a7e('0x2a')](_0x6963a8)[_0x6a7e('0x2b')]();};}function respondWithResult(_0x2e61e5,_0x5cd3ff){_0x5cd3ff=_0x5cd3ff||0xc8;return function(_0x3f5f82){if(_0x3f5f82){return _0x2e61e5[_0x6a7e('0x2a')](_0x5cd3ff)[_0x6a7e('0x2c')](_0x3f5f82);}};}function respondWithFilteredResult(_0x53b257,_0x322638){return function(_0x553f82){if(_0x553f82){var _0x57c0fd=_0x553f82[_0x6a7e('0x2d')],_0x459d9f=_0x322638[_0x6a7e('0x2e')],_0x21007f=_0x322638['offset']+_0x322638['limit'],_0x244d69;if(_0x21007f>=_0x57c0fd){_0x21007f=_0x57c0fd;_0x244d69=0xc8;}else{_0x244d69=0xce;}_0x53b257[_0x6a7e('0x2a')](_0x244d69);return _0x53b257[_0x6a7e('0x2f')](_0x6a7e('0x30'),_0x459d9f+'-'+_0x21007f+'/'+_0x57c0fd)[_0x6a7e('0x2c')](_0x553f82);}return null;};}function patchUpdates(_0x3359de){return function(_0x1bfce7){try{jsonpatch['apply'](_0x1bfce7,_0x3359de,!![]);}catch(_0x5a8dd3){return BPromise[_0x6a7e('0x31')](_0x5a8dd3);}return _0x1bfce7['save']();};}function saveUpdates(_0x20daae,_0x454a69){return function(_0x1d9ef0){if(_0x1d9ef0){return _0x1d9ef0[_0x6a7e('0x32')](_0x20daae)['then'](function(_0x32f2f8){return _0x32f2f8;});}return null;};}function removeEntity(_0x31e77b,_0x29613e){return function(_0x3d8dd6){if(_0x3d8dd6){return _0x3d8dd6[_0x6a7e('0x33')]()['then'](function(){_0x31e77b[_0x6a7e('0x2a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3796a4,_0x5e34de){return function(_0xdb7028){if(!_0xdb7028){_0x3796a4[_0x6a7e('0x29')](0x194);}return _0xdb7028;};}function handleError(_0x375886,_0x5371be){_0x5371be=_0x5371be||0x1f4;return function(_0xc5dedc){logger[_0x6a7e('0x24')](_0xc5dedc[_0x6a7e('0x34')]);if(_0xc5dedc[_0x6a7e('0x35')]){delete _0xc5dedc[_0x6a7e('0x35')];}_0x375886[_0x6a7e('0x2a')](_0x5371be)[_0x6a7e('0x36')](_0xc5dedc);};}exports['index']=function(_0x4b6c51,_0x58a124){var _0x1dcf76={},_0x5c02de={},_0x483b4b={'count':0x0,'rows':[]};var _0x280fe6=_[_0x6a7e('0x37')](db[_0x6a7e('0x38')]['rawAttributes'],function(_0x3eb4e4){return{'name':_0x3eb4e4['fieldName'],'type':_0x3eb4e4[_0x6a7e('0x39')][_0x6a7e('0x3a')]};});_0x5c02de[_0x6a7e('0x3b')]=_[_0x6a7e('0x37')](_0x280fe6,'name');_0x5c02de[_0x6a7e('0x3c')]=_[_0x6a7e('0x3d')](_0x4b6c51[_0x6a7e('0x3c')]);_0x5c02de['filters']=_[_0x6a7e('0x3e')](_0x5c02de['model'],_0x5c02de[_0x6a7e('0x3c')]);_0x1dcf76['attributes']=_[_0x6a7e('0x3e')](_0x5c02de[_0x6a7e('0x3b')],qs['fields'](_0x4b6c51[_0x6a7e('0x3c')][_0x6a7e('0x3f')]));_0x1dcf76['attributes']=_0x1dcf76[_0x6a7e('0x40')][_0x6a7e('0x41')]?_0x1dcf76['attributes']:_0x5c02de[_0x6a7e('0x3b')];if(!_0x4b6c51[_0x6a7e('0x3c')][_0x6a7e('0x42')](_0x6a7e('0x43'))){_0x1dcf76[_0x6a7e('0x44')]=qs[_0x6a7e('0x44')](_0x4b6c51[_0x6a7e('0x3c')]['limit']);_0x1dcf76[_0x6a7e('0x2e')]=qs[_0x6a7e('0x2e')](_0x4b6c51[_0x6a7e('0x3c')]['offset']);}_0x1dcf76[_0x6a7e('0x45')]=qs[_0x6a7e('0x46')](_0x4b6c51[_0x6a7e('0x3c')][_0x6a7e('0x46')]);_0x1dcf76['where']=qs['filters'](_[_0x6a7e('0x47')](_0x4b6c51[_0x6a7e('0x3c')],_0x5c02de['filters']),_0x280fe6);if(_0x4b6c51[_0x6a7e('0x3c')][_0x6a7e('0x48')]){_0x1dcf76[_0x6a7e('0x49')]=_[_0x6a7e('0x4a')](_0x1dcf76[_0x6a7e('0x49')],{'$or':_[_0x6a7e('0x37')](_0x280fe6,function(_0x2f3ea0){if(_0x2f3ea0['type']!==_0x6a7e('0x4b')){var _0x25cf8c={};_0x25cf8c[_0x2f3ea0['name']]={'$like':'%'+_0x4b6c51[_0x6a7e('0x3c')][_0x6a7e('0x48')]+'%'};return _0x25cf8c;}})});}_0x1dcf76=_[_0x6a7e('0x4a')]({},_0x1dcf76,_0x4b6c51['options']);var _0x5d5872={'where':_0x1dcf76[_0x6a7e('0x49')]};return db['SugarcrmConfiguration'][_0x6a7e('0x2d')](_0x5d5872)['then'](function(_0x31a23f){_0x483b4b[_0x6a7e('0x2d')]=_0x31a23f;if(_0x4b6c51[_0x6a7e('0x3c')][_0x6a7e('0x4c')]){_0x1dcf76[_0x6a7e('0x4d')]=[{'all':!![]}];}return db[_0x6a7e('0x38')]['findAll'](_0x1dcf76);})['then'](function(_0x4da18f){_0x483b4b[_0x6a7e('0x4e')]=_0x4da18f;return _0x483b4b;})[_0x6a7e('0x1f')](respondWithFilteredResult(_0x58a124,_0x1dcf76))['catch'](handleError(_0x58a124,null));};exports['show']=function(_0x3eac32,_0x5f26b4){var _0x22418b={'raw':![],'where':{'id':_0x3eac32['params']['id']}},_0x230937={};_0x230937[_0x6a7e('0x3b')]=_[_0x6a7e('0x3d')](db[_0x6a7e('0x38')][_0x6a7e('0x4f')]);_0x230937[_0x6a7e('0x3c')]=_['keys'](_0x3eac32[_0x6a7e('0x3c')]);_0x230937[_0x6a7e('0x50')]=_['intersection'](_0x230937[_0x6a7e('0x3b')],_0x230937[_0x6a7e('0x3c')]);_0x22418b['attributes']=_[_0x6a7e('0x3e')](_0x230937['model'],qs['fields'](_0x3eac32[_0x6a7e('0x3c')][_0x6a7e('0x3f')]));_0x22418b[_0x6a7e('0x40')]=_0x22418b[_0x6a7e('0x40')]['length']?_0x22418b[_0x6a7e('0x40')]:_0x230937['model'];if(_0x3eac32['query'][_0x6a7e('0x4c')]){_0x22418b[_0x6a7e('0x4d')]=[{'all':!![]}];}_0x22418b=_[_0x6a7e('0x4a')]({},_0x22418b,_0x3eac32[_0x6a7e('0x51')]);return db['SugarcrmConfiguration']['find'](_0x22418b)[_0x6a7e('0x1f')](handleEntityNotFound(_0x5f26b4,null))['then'](respondWithResult(_0x5f26b4,null))[_0x6a7e('0x28')](handleError(_0x5f26b4,null));};exports[_0x6a7e('0x52')]=function(_0x72e5ae,_0x1b0fb9){return db[_0x6a7e('0x38')]['create'](_0x72e5ae['body'],{})[_0x6a7e('0x1f')](respondWithResult(_0x1b0fb9,0xc9))[_0x6a7e('0x28')](handleError(_0x1b0fb9,null));};exports[_0x6a7e('0x32')]=function(_0x13f655,_0x464a2c){if(_0x13f655['body']['id']){delete _0x13f655[_0x6a7e('0x53')]['id'];}return db[_0x6a7e('0x38')]['find']({'where':{'id':_0x13f655['params']['id']}})[_0x6a7e('0x1f')](handleEntityNotFound(_0x464a2c,null))[_0x6a7e('0x1f')](saveUpdates(_0x13f655[_0x6a7e('0x53')],null))['then'](respondWithResult(_0x464a2c,null))[_0x6a7e('0x28')](handleError(_0x464a2c,null));};exports[_0x6a7e('0x33')]=function(_0x1ec33f,_0x56068f){return db[_0x6a7e('0x38')][_0x6a7e('0x54')]({'where':{'id':_0x1ec33f['params']['id']}})['then'](handleEntityNotFound(_0x56068f,null))[_0x6a7e('0x1f')](removeEntity(_0x56068f,null))[_0x6a7e('0x28')](handleError(_0x56068f,null));};exports[_0x6a7e('0x55')]=function(_0x511c68,_0x32eeb7,_0x5d8b4e){var _0x2de8de={};var _0x39f493={};var _0x106dc0;var _0x46d384;return db[_0x6a7e('0x38')][_0x6a7e('0x56')]({'where':{'id':_0x511c68[_0x6a7e('0x57')]['id']}})['then'](handleEntityNotFound(_0x32eeb7,null))[_0x6a7e('0x1f')](function(_0x576316){if(_0x576316){_0x106dc0=_0x576316;_0x39f493['model']=_[_0x6a7e('0x3d')](db['SugarcrmField']['rawAttributes']);_0x39f493[_0x6a7e('0x3c')]=_[_0x6a7e('0x3d')](_0x511c68['query']);_0x39f493[_0x6a7e('0x50')]=_['intersection'](_0x39f493[_0x6a7e('0x3b')],_0x39f493['query']);_0x2de8de[_0x6a7e('0x40')]=_[_0x6a7e('0x3e')](_0x39f493[_0x6a7e('0x3b')],qs[_0x6a7e('0x3f')](_0x511c68[_0x6a7e('0x3c')][_0x6a7e('0x3f')]));_0x2de8de['attributes']=_0x2de8de[_0x6a7e('0x40')][_0x6a7e('0x41')]?_0x2de8de[_0x6a7e('0x40')]:_0x39f493[_0x6a7e('0x3b')];_0x2de8de['order']=qs[_0x6a7e('0x46')](_0x511c68[_0x6a7e('0x3c')][_0x6a7e('0x46')]);_0x2de8de[_0x6a7e('0x49')]=qs[_0x6a7e('0x50')](_[_0x6a7e('0x47')](_0x511c68[_0x6a7e('0x3c')],_0x39f493[_0x6a7e('0x50')]));if(_0x511c68[_0x6a7e('0x3c')][_0x6a7e('0x48')]){_0x2de8de[_0x6a7e('0x49')]=_[_0x6a7e('0x4a')](_0x2de8de['where'],{'$or':_['map'](_0x2de8de[_0x6a7e('0x40')],function(_0x2e10d4){var _0x4cf4f0={};_0x4cf4f0[_0x2e10d4]={'$like':'%'+_0x511c68[_0x6a7e('0x3c')][_0x6a7e('0x48')]+'%'};return _0x4cf4f0;})});}_0x2de8de=_[_0x6a7e('0x4a')]({},_0x2de8de,_0x511c68[_0x6a7e('0x51')]);return _0x106dc0[_0x6a7e('0x55')](_0x2de8de);}})[_0x6a7e('0x1f')](function(_0x146944){if(_0x146944){_0x46d384=_0x146944[_0x6a7e('0x41')];if(!_0x511c68['query']['hasOwnProperty']('nolimit')){_0x2de8de['limit']=qs[_0x6a7e('0x44')](_0x511c68[_0x6a7e('0x3c')][_0x6a7e('0x44')]);_0x2de8de[_0x6a7e('0x2e')]=qs[_0x6a7e('0x2e')](_0x511c68['query'][_0x6a7e('0x2e')]);}return _0x106dc0['getFields'](_0x2de8de);}})[_0x6a7e('0x1f')](function(_0x5f57ba){if(_0x5f57ba){return _0x5f57ba?{'count':_0x46d384,'rows':_0x5f57ba}:null;}})['then'](respondWithResult(_0x32eeb7,null))['catch'](handleError(_0x32eeb7,null));};exports[_0x6a7e('0x58')]=function(_0x3c4aab,_0x57f8a4,_0x3f832c){var _0x880425={};var _0x138f62={};var _0x33b40a;var _0x24c216;return db[_0x6a7e('0x38')][_0x6a7e('0x56')]({'where':{'id':_0x3c4aab[_0x6a7e('0x57')]['id']}})[_0x6a7e('0x1f')](handleEntityNotFound(_0x57f8a4,null))[_0x6a7e('0x1f')](function(_0x327606){if(_0x327606){_0x33b40a=_0x327606;_0x138f62[_0x6a7e('0x3b')]=_[_0x6a7e('0x3d')](db[_0x6a7e('0x59')][_0x6a7e('0x4f')]);_0x138f62['query']=_[_0x6a7e('0x3d')](_0x3c4aab[_0x6a7e('0x3c')]);_0x138f62[_0x6a7e('0x50')]=_[_0x6a7e('0x3e')](_0x138f62[_0x6a7e('0x3b')],_0x138f62[_0x6a7e('0x3c')]);_0x880425['attributes']=_[_0x6a7e('0x3e')](_0x138f62[_0x6a7e('0x3b')],qs['fields'](_0x3c4aab[_0x6a7e('0x3c')][_0x6a7e('0x3f')]));_0x880425[_0x6a7e('0x40')]=_0x880425[_0x6a7e('0x40')][_0x6a7e('0x41')]?_0x880425[_0x6a7e('0x40')]:_0x138f62['model'];_0x880425['order']=qs[_0x6a7e('0x46')](_0x3c4aab[_0x6a7e('0x3c')][_0x6a7e('0x46')]);_0x880425['where']=qs['filters'](_[_0x6a7e('0x47')](_0x3c4aab[_0x6a7e('0x3c')],_0x138f62[_0x6a7e('0x50')]));if(_0x3c4aab[_0x6a7e('0x3c')][_0x6a7e('0x48')]){_0x880425[_0x6a7e('0x49')]=_[_0x6a7e('0x4a')](_0x880425['where'],{'$or':_[_0x6a7e('0x37')](_0x880425['attributes'],function(_0x213699){var _0x494317={};_0x494317[_0x213699]={'$like':'%'+_0x3c4aab[_0x6a7e('0x3c')][_0x6a7e('0x48')]+'%'};return _0x494317;})});}_0x880425=_[_0x6a7e('0x4a')]({},_0x880425,_0x3c4aab[_0x6a7e('0x51')]);return _0x33b40a[_0x6a7e('0x58')](_0x880425);}})[_0x6a7e('0x1f')](function(_0x5206c4){if(_0x5206c4){_0x24c216=_0x5206c4[_0x6a7e('0x41')];if(!_0x3c4aab[_0x6a7e('0x3c')][_0x6a7e('0x42')](_0x6a7e('0x43'))){_0x880425[_0x6a7e('0x44')]=qs[_0x6a7e('0x44')](_0x3c4aab[_0x6a7e('0x3c')][_0x6a7e('0x44')]);_0x880425[_0x6a7e('0x2e')]=qs[_0x6a7e('0x2e')](_0x3c4aab[_0x6a7e('0x3c')][_0x6a7e('0x2e')]);}return _0x33b40a[_0x6a7e('0x58')](_0x880425);}})[_0x6a7e('0x1f')](function(_0x4e68c9){if(_0x4e68c9){return _0x4e68c9?{'count':_0x24c216,'rows':_0x4e68c9}:null;}})[_0x6a7e('0x1f')](respondWithResult(_0x57f8a4,null))[_0x6a7e('0x28')](handleError(_0x57f8a4,null));};exports[_0x6a7e('0x5a')]=function(_0x260460,_0x4a7941,_0x3f11eb){var _0x41a922={};var _0x1d2775={};var _0x26eedf;var _0x2d8e99;return db[_0x6a7e('0x38')][_0x6a7e('0x56')]({'where':{'id':_0x260460[_0x6a7e('0x57')]['id']}})[_0x6a7e('0x1f')](handleEntityNotFound(_0x4a7941,null))[_0x6a7e('0x1f')](function(_0x292a7f){if(_0x292a7f){_0x26eedf=_0x292a7f;_0x1d2775[_0x6a7e('0x3b')]=_['keys'](db[_0x6a7e('0x59')][_0x6a7e('0x4f')]);_0x1d2775['query']=_[_0x6a7e('0x3d')](_0x260460[_0x6a7e('0x3c')]);_0x1d2775[_0x6a7e('0x50')]=_[_0x6a7e('0x3e')](_0x1d2775[_0x6a7e('0x3b')],_0x1d2775[_0x6a7e('0x3c')]);_0x41a922[_0x6a7e('0x40')]=_[_0x6a7e('0x3e')](_0x1d2775[_0x6a7e('0x3b')],qs[_0x6a7e('0x3f')](_0x260460[_0x6a7e('0x3c')]['fields']));_0x41a922['attributes']=_0x41a922[_0x6a7e('0x40')][_0x6a7e('0x41')]?_0x41a922[_0x6a7e('0x40')]:_0x1d2775[_0x6a7e('0x3b')];_0x41a922[_0x6a7e('0x45')]=qs[_0x6a7e('0x46')](_0x260460[_0x6a7e('0x3c')][_0x6a7e('0x46')]);_0x41a922[_0x6a7e('0x49')]=qs[_0x6a7e('0x50')](_[_0x6a7e('0x47')](_0x260460[_0x6a7e('0x3c')],_0x1d2775[_0x6a7e('0x50')]));if(_0x260460[_0x6a7e('0x3c')][_0x6a7e('0x48')]){_0x41a922[_0x6a7e('0x49')]=_[_0x6a7e('0x4a')](_0x41a922[_0x6a7e('0x49')],{'$or':_[_0x6a7e('0x37')](_0x41a922[_0x6a7e('0x40')],function(_0x122a19){var _0x2266cd={};_0x2266cd[_0x122a19]={'$like':'%'+_0x260460[_0x6a7e('0x3c')]['filter']+'%'};return _0x2266cd;})});}_0x41a922=_[_0x6a7e('0x4a')]({},_0x41a922,_0x260460['options']);return _0x26eedf['getDescriptions'](_0x41a922);}})[_0x6a7e('0x1f')](function(_0x246a1a){if(_0x246a1a){_0x2d8e99=_0x246a1a[_0x6a7e('0x41')];if(!_0x260460[_0x6a7e('0x3c')][_0x6a7e('0x42')]('nolimit')){_0x41a922[_0x6a7e('0x44')]=qs[_0x6a7e('0x44')](_0x260460['query'][_0x6a7e('0x44')]);_0x41a922[_0x6a7e('0x2e')]=qs[_0x6a7e('0x2e')](_0x260460[_0x6a7e('0x3c')]['offset']);}return _0x26eedf[_0x6a7e('0x5a')](_0x41a922);}})['then'](function(_0x29d2b6){if(_0x29d2b6){return _0x29d2b6?{'count':_0x2d8e99,'rows':_0x29d2b6}:null;}})['then'](respondWithResult(_0x4a7941,null))[_0x6a7e('0x28')](handleError(_0x4a7941,null));};
\ No newline at end of file
diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js
index e359b9a..7b06d28 100644
--- a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js
+++ b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x86be=['path','../../config/environment','SugarcrmConfiguration','int_sugarcrm_configurations','lodash','util','../../config/logger','moment','bluebird','request-promise'];(function(_0x33ca16,_0x1365f3){var _0x7dc0cf=function(_0x434a78){while(--_0x434a78){_0x33ca16['push'](_0x33ca16['shift']());}};_0x7dc0cf(++_0x1365f3);}(_0x86be,0xea));var _0xe86b=function(_0x53687c,_0x346398){_0x53687c=_0x53687c-0x0;var _0x3fb8f2=_0x86be[_0x53687c];return _0x3fb8f2;};'use strict';var _=require(_0xe86b('0x0'));var util=require(_0xe86b('0x1'));var logger=require(_0xe86b('0x2'))('api');var moment=require(_0xe86b('0x3'));var BPromise=require(_0xe86b('0x4'));var rp=require(_0xe86b('0x5'));var fs=require('fs');var path=require(_0xe86b('0x6'));var rimraf=require('rimraf');var config=require(_0xe86b('0x7'));var attributes=require('./intSugarcrmConfiguration.attributes');module['exports']=function(_0x2f8de8,_0x223d58){return _0x2f8de8['define'](_0xe86b('0x8'),attributes,{'tableName':_0xe86b('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x944f=['exports','SugarcrmConfiguration','int_sugarcrm_configurations','lodash','util','../../config/logger','api','bluebird','request-promise','path','./intSugarcrmConfiguration.attributes'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x944f,0xc9));var _0xf944=function(_0x2c5987,_0x101621){_0x2c5987=_0x2c5987-0x0;var _0x55773d=_0x944f[_0x2c5987];return _0x55773d;};'use strict';var _=require(_0xf944('0x0'));var util=require(_0xf944('0x1'));var logger=require(_0xf944('0x2'))(_0xf944('0x3'));var moment=require('moment');var BPromise=require(_0xf944('0x4'));var rp=require(_0xf944('0x5'));var fs=require('fs');var path=require(_0xf944('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xf944('0x7'));module[_0xf944('0x8')]=function(_0x5bec62,_0x14d6ca){return _0x5bec62['define'](_0xf944('0x9'),attributes,{'tableName':_0xf944('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.rpc.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.rpc.js
index 39f358a..09cef63 100644
--- a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.rpc.js
+++ b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x4ca3=['request','then','SugarcrmConfiguration,\x20%s,\x20%s','request\x20sent','debug','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','error','message','info','catch','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http'];(function(_0x5d7c8a,_0x2cf80c){var _0x4757d6=function(_0x564e66){while(--_0x564e66){_0x5d7c8a['push'](_0x5d7c8a['shift']());}};_0x4757d6(++_0x2cf80c);}(_0x4ca3,0x136));var _0x34ca=function(_0x22dc3e,_0x39ab8d){_0x22dc3e=_0x22dc3e-0x0;var _0x38eb6c=_0x4ca3[_0x22dc3e];return _0x38eb6c;};'use strict';var _=require('lodash');var util=require(_0x34ca('0x0'));var moment=require('moment');var BPromise=require(_0x34ca('0x1'));var rs=require(_0x34ca('0x2'));var fs=require('fs');var Redis=require(_0x34ca('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x34ca('0x4'));var logger=require(_0x34ca('0x5'))('rpc');var config=require(_0x34ca('0x6'));var jayson=require(_0x34ca('0x7'));var client=jayson[_0x34ca('0x8')][_0x34ca('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x192b8f,_0x38b1a4,_0x254a64){return new BPromise(function(_0x6dc691,_0x3bc6dd){return client[_0x34ca('0xa')](_0x192b8f,_0x254a64)[_0x34ca('0xb')](function(_0x36a1a5){logger['info'](_0x34ca('0xc'),_0x38b1a4,_0x34ca('0xd'));logger[_0x34ca('0xe')](_0x34ca('0xf'),_0x38b1a4,'request\x20sent',JSON['stringify'](_0x36a1a5));if(_0x36a1a5[_0x34ca('0x10')]){if(_0x36a1a5[_0x34ca('0x10')]['code']===0x1f4){logger[_0x34ca('0x10')](_0x34ca('0xc'),_0x38b1a4,_0x36a1a5[_0x34ca('0x10')]['message']);return _0x3bc6dd(_0x36a1a5['error'][_0x34ca('0x11')]);}logger[_0x34ca('0x10')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x38b1a4,_0x36a1a5[_0x34ca('0x10')][_0x34ca('0x11')]);return _0x6dc691(_0x36a1a5[_0x34ca('0x10')][_0x34ca('0x11')]);}else{logger[_0x34ca('0x12')](_0x34ca('0xc'),_0x38b1a4,_0x34ca('0xd'));_0x6dc691(_0x36a1a5['result'][_0x34ca('0x11')]);}})[_0x34ca('0x13')](function(_0x22d6f5){logger[_0x34ca('0x10')](_0x34ca('0xc'),_0x38b1a4,_0x22d6f5);_0x3bc6dd(_0x22d6f5);});});}
\ No newline at end of file
+var _0x7e37=['then','info','SugarcrmConfiguration,\x20%s,\x20%s','request\x20sent','debug','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request'];(function(_0x7e2eb0,_0x17cd58){var _0xd92de4=function(_0x5d005b){while(--_0x5d005b){_0x7e2eb0['push'](_0x7e2eb0['shift']());}};_0xd92de4(++_0x17cd58);}(_0x7e37,0x178));var _0x77e3=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7e37[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x77e3('0x0'));var util=require(_0x77e3('0x1'));var moment=require(_0x77e3('0x2'));var BPromise=require(_0x77e3('0x3'));var rs=require(_0x77e3('0x4'));var fs=require('fs');var Redis=require(_0x77e3('0x5'));var db=require(_0x77e3('0x6'))['db'];var utils=require(_0x77e3('0x7'));var logger=require(_0x77e3('0x8'))(_0x77e3('0x9'));var config=require(_0x77e3('0xa'));var jayson=require(_0x77e3('0xb'));var client=jayson['client'][_0x77e3('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x4fd54d,_0x477c84,_0x1af757){return new BPromise(function(_0x455f59,_0x33f658){return client[_0x77e3('0xd')](_0x4fd54d,_0x1af757)[_0x77e3('0xe')](function(_0x71f85){logger[_0x77e3('0xf')](_0x77e3('0x10'),_0x477c84,_0x77e3('0x11'));logger[_0x77e3('0x12')](_0x77e3('0x13'),_0x477c84,_0x77e3('0x11'),JSON[_0x77e3('0x14')](_0x71f85));if(_0x71f85[_0x77e3('0x15')]){if(_0x71f85[_0x77e3('0x15')][_0x77e3('0x16')]===0x1f4){logger['error'](_0x77e3('0x10'),_0x477c84,_0x71f85[_0x77e3('0x15')][_0x77e3('0x17')]);return _0x33f658(_0x71f85['error']['message']);}logger[_0x77e3('0x15')](_0x77e3('0x10'),_0x477c84,_0x71f85[_0x77e3('0x15')][_0x77e3('0x17')]);return _0x455f59(_0x71f85[_0x77e3('0x15')][_0x77e3('0x17')]);}else{logger[_0x77e3('0xf')](_0x77e3('0x10'),_0x477c84,_0x77e3('0x11'));_0x455f59(_0x71f85[_0x77e3('0x18')]['message']);}})[_0x77e3('0x19')](function(_0x385ed6){logger[_0x77e3('0x15')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x477c84,_0x385ed6);_0x33f658(_0x385ed6);});});}
\ No newline at end of file
diff --git a/server/api/intSugarcrmField/index.js b/server/api/intSugarcrmField/index.js
index ec81bb2..8c0cd58 100644
--- a/server/api/intSugarcrmField/index.js
+++ b/server/api/intSugarcrmField/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xa5f3=['post','create','/:id','delete','destroy','multer','util','./intSugarcrmField.controller','get','isAuthenticated','index','show'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0xa5f3,0x16d));var _0x3a5f=function(_0x48042f,_0x590844){_0x48042f=_0x48042f-0x0;var _0x143891=_0xa5f3[_0x48042f];return _0x143891;};'use strict';var multer=require(_0x3a5f('0x0'));var util=require(_0x3a5f('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x3a5f('0x2'));router[_0x3a5f('0x3')]('/',auth[_0x3a5f('0x4')](),controller[_0x3a5f('0x5')]);router[_0x3a5f('0x3')]('/:id',auth[_0x3a5f('0x4')](),controller[_0x3a5f('0x6')]);router[_0x3a5f('0x7')]('/',auth[_0x3a5f('0x4')](),controller[_0x3a5f('0x8')]);router['put'](_0x3a5f('0x9'),auth['isAuthenticated'](),controller['update']);router[_0x3a5f('0xa')]('/:id',auth[_0x3a5f('0x4')](),controller[_0x3a5f('0xb')]);module['exports']=router;
\ No newline at end of file
+var _0xd93a=['multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','post','put','update','delete','/:id','destroy','exports'];(function(_0x113945,_0x102a24){var _0x5836c8=function(_0x5430a8){while(--_0x5430a8){_0x113945['push'](_0x113945['shift']());}};_0x5836c8(++_0x102a24);}(_0xd93a,0x1c2));var _0xad93=function(_0x299fcd,_0x6b0886){_0x299fcd=_0x299fcd-0x0;var _0x4b15b0=_0xd93a[_0x299fcd];return _0x4b15b0;};'use strict';var multer=require(_0xad93('0x0'));var util=require(_0xad93('0x1'));var path=require('path');var timeout=require(_0xad93('0x2'));var express=require(_0xad93('0x3'));var router=express[_0xad93('0x4')]();var auth=require(_0xad93('0x5'));var interaction=require(_0xad93('0x6'));var config=require(_0xad93('0x7'));var controller=require('./intSugarcrmField.controller');router[_0xad93('0x8')]('/',auth[_0xad93('0x9')](),controller[_0xad93('0xa')]);router['get']('/:id',auth[_0xad93('0x9')](),controller['show']);router[_0xad93('0xb')]('/',auth[_0xad93('0x9')](),controller['create']);router[_0xad93('0xc')]('/:id',auth[_0xad93('0x9')](),controller[_0xad93('0xd')]);router[_0xad93('0xe')](_0xad93('0xf'),auth[_0xad93('0x9')](),controller[_0xad93('0x10')]);module[_0xad93('0x11')]=router;
\ No newline at end of file
diff --git a/server/api/intSugarcrmField/intSugarcrmField.attributes.js b/server/api/intSugarcrmField/intSugarcrmField.attributes.js
index 8cd378d..cf64558 100644
--- a/server/api/intSugarcrmField/intSugarcrmField.attributes.js
+++ b/server/api/intSugarcrmField/intSugarcrmField.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xbd50=['ENUM','variable','customVariable','keyValue','string','STRING','sequelize','exports'];(function(_0x23a39e,_0x746eb9){var _0x24b30f=function(_0x239e0d){while(--_0x239e0d){_0x23a39e['push'](_0x23a39e['shift']());}};_0x24b30f(++_0x746eb9);}(_0xbd50,0x196));var _0x0bd5=function(_0x4fdf4b,_0x937091){_0x4fdf4b=_0x4fdf4b-0x0;var _0x257469=_0xbd50[_0x4fdf4b];return _0x257469;};'use strict';var Sequelize=require(_0x0bd5('0x0'));module[_0x0bd5('0x1')]={'type':{'type':Sequelize[_0x0bd5('0x2')]('string',_0x0bd5('0x3'),_0x0bd5('0x4'),_0x0bd5('0x5')),'defaultValue':_0x0bd5('0x6')},'content':{'type':Sequelize[_0x0bd5('0x7')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize['ENUM']('string',_0x0bd5('0x3'),_0x0bd5('0x4'))},'keyContent':{'type':Sequelize[_0x0bd5('0x7')]},'idField':{'type':Sequelize[_0x0bd5('0x7')]},'nameField':{'type':Sequelize[_0x0bd5('0x7')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x3379=['ENUM','string','customVariable','keyValue','STRING','variable','BOOLEAN','sequelize','exports'];(function(_0x4b055c,_0x4b870b){var _0x4b62bb=function(_0x4884c2){while(--_0x4884c2){_0x4b055c['push'](_0x4b055c['shift']());}};_0x4b62bb(++_0x4b870b);}(_0x3379,0x115));var _0x9337=function(_0x59168e,_0x1cf8c8){_0x59168e=_0x59168e-0x0;var _0xb16e0c=_0x3379[_0x59168e];return _0xb16e0c;};'use strict';var Sequelize=require(_0x9337('0x0'));module[_0x9337('0x1')]={'type':{'type':Sequelize[_0x9337('0x2')](_0x9337('0x3'),'variable',_0x9337('0x4'),_0x9337('0x5')),'defaultValue':_0x9337('0x3')},'content':{'type':Sequelize[_0x9337('0x6')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x9337('0x2')](_0x9337('0x3'),_0x9337('0x7'),_0x9337('0x4'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x9337('0x6')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x9337('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x9337('0x6')]}};
\ No newline at end of file
diff --git a/server/api/intSugarcrmField/intSugarcrmField.controller.js b/server/api/intSugarcrmField/intSugarcrmField.controller.js
index 1eedf0d..72e9470 100644
--- a/server/api/intSugarcrmField/intSugarcrmField.controller.js
+++ b/server/api/intSugarcrmField/intSugarcrmField.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x1098=['sendStatus','error','stack','name','send','index','map','SugarcrmField','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','count','include','findAll','rows','catch','show','params','find','create','body','destroy','eml-format','zip-dir','request-promise','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','status','json','offset','limit','set','Content-Range','update','then','end'];(function(_0x4d2b72,_0xddc780){var _0x59a924=function(_0xbb996e){while(--_0xbb996e){_0x4d2b72['push'](_0x4d2b72['shift']());}};_0x59a924(++_0xddc780);}(_0x1098,0x72));var _0x8109=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1098[_0x3dd15e];return _0x231fd0;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x8109('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x8109('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x8109('0x2'));var moment=require('moment');var BPromise=require(_0x8109('0x3'));var Mustache=require(_0x8109('0x4'));var util=require('util');var path=require(_0x8109('0x5'));var sox=require(_0x8109('0x6'));var csv=require(_0x8109('0x7'));var ejs=require(_0x8109('0x8'));var fs=require('fs');var _=require(_0x8109('0x9'));var squel=require(_0x8109('0xa'));var crypto=require(_0x8109('0xb'));var jsforce=require(_0x8109('0xc'));var deskjs=require(_0x8109('0xd'));var toCsv=require(_0x8109('0x7'));var querystring=require(_0x8109('0xe'));var Papa=require(_0x8109('0xf'));var Redis=require(_0x8109('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x8109('0x11'));var as=require(_0x8109('0x12'));var hardwareService=require(_0x8109('0x13'));var logger=require(_0x8109('0x14'))('api');var utils=require('../../config/utils');var config=require(_0x8109('0x15'));var db=require(_0x8109('0x16'))['db'];function respondWithStatusCode(_0x35934d,_0x3b871b){_0x3b871b=_0x3b871b||0xcc;return function(_0x22ed27){if(_0x22ed27){return _0x35934d['sendStatus'](_0x3b871b);}return _0x35934d[_0x8109('0x17')](_0x3b871b)['end']();};}function respondWithResult(_0x2fe76c,_0x54c2a9){_0x54c2a9=_0x54c2a9||0xc8;return function(_0x5cd47b){if(_0x5cd47b){return _0x2fe76c[_0x8109('0x17')](_0x54c2a9)[_0x8109('0x18')](_0x5cd47b);}};}function respondWithFilteredResult(_0x18c7e6,_0x2a5ff8){return function(_0xff501a){if(_0xff501a){var _0x30ce0b=_0xff501a['count'],_0x106145=_0x2a5ff8[_0x8109('0x19')],_0x1a9484=_0x2a5ff8[_0x8109('0x19')]+_0x2a5ff8[_0x8109('0x1a')],_0x20d915;if(_0x1a9484>=_0x30ce0b){_0x1a9484=_0x30ce0b;_0x20d915=0xc8;}else{_0x20d915=0xce;}_0x18c7e6[_0x8109('0x17')](_0x20d915);return _0x18c7e6[_0x8109('0x1b')](_0x8109('0x1c'),_0x106145+'-'+_0x1a9484+'/'+_0x30ce0b)['json'](_0xff501a);}return null;};}function patchUpdates(_0x2b4687){return function(_0x2ff1b1){try{jsonpatch['apply'](_0x2ff1b1,_0x2b4687,!![]);}catch(_0x19d2cf){return BPromise['reject'](_0x19d2cf);}return _0x2ff1b1['save']();};}function saveUpdates(_0x2d1606,_0x1266d4){return function(_0x3c2788){if(_0x3c2788){return _0x3c2788[_0x8109('0x1d')](_0x2d1606)[_0x8109('0x1e')](function(_0x2d7281){return _0x2d7281;});}return null;};}function removeEntity(_0x5c64e2,_0x247447){return function(_0x193d0a){if(_0x193d0a){return _0x193d0a['destroy']()['then'](function(){_0x5c64e2[_0x8109('0x17')](0xcc)[_0x8109('0x1f')]();});}};}function handleEntityNotFound(_0x230a83,_0x48b8b9){return function(_0x1ee386){if(!_0x1ee386){_0x230a83[_0x8109('0x20')](0x194);}return _0x1ee386;};}function handleError(_0x5645f0,_0x587f97){_0x587f97=_0x587f97||0x1f4;return function(_0x5a291d){logger[_0x8109('0x21')](_0x5a291d[_0x8109('0x22')]);if(_0x5a291d[_0x8109('0x23')]){delete _0x5a291d[_0x8109('0x23')];}_0x5645f0[_0x8109('0x17')](_0x587f97)[_0x8109('0x24')](_0x5a291d);};}exports[_0x8109('0x25')]=function(_0x4bdd48,_0x4ce1e3){var _0x3752f6={},_0x1aecf0={},_0x196e04={'count':0x0,'rows':[]};var _0x1a078a=_[_0x8109('0x26')](db[_0x8109('0x27')][_0x8109('0x28')],function(_0x56f11a){return{'name':_0x56f11a[_0x8109('0x29')],'type':_0x56f11a['type'][_0x8109('0x2a')]};});_0x1aecf0[_0x8109('0x2b')]=_['map'](_0x1a078a,_0x8109('0x23'));_0x1aecf0[_0x8109('0x2c')]=_[_0x8109('0x2d')](_0x4bdd48[_0x8109('0x2c')]);_0x1aecf0[_0x8109('0x2e')]=_[_0x8109('0x2f')](_0x1aecf0[_0x8109('0x2b')],_0x1aecf0[_0x8109('0x2c')]);_0x3752f6[_0x8109('0x30')]=_[_0x8109('0x2f')](_0x1aecf0['model'],qs['fields'](_0x4bdd48['query'][_0x8109('0x31')]));_0x3752f6[_0x8109('0x30')]=_0x3752f6['attributes'][_0x8109('0x32')]?_0x3752f6[_0x8109('0x30')]:_0x1aecf0[_0x8109('0x2b')];if(!_0x4bdd48['query'][_0x8109('0x33')](_0x8109('0x34'))){_0x3752f6[_0x8109('0x1a')]=qs[_0x8109('0x1a')](_0x4bdd48[_0x8109('0x2c')][_0x8109('0x1a')]);_0x3752f6['offset']=qs[_0x8109('0x19')](_0x4bdd48[_0x8109('0x2c')][_0x8109('0x19')]);}_0x3752f6[_0x8109('0x35')]=qs[_0x8109('0x36')](_0x4bdd48[_0x8109('0x2c')][_0x8109('0x36')]);_0x3752f6[_0x8109('0x37')]=qs[_0x8109('0x2e')](_[_0x8109('0x38')](_0x4bdd48[_0x8109('0x2c')],_0x1aecf0[_0x8109('0x2e')]),_0x1a078a);if(_0x4bdd48[_0x8109('0x2c')][_0x8109('0x39')]){_0x3752f6[_0x8109('0x37')]=_[_0x8109('0x3a')](_0x3752f6[_0x8109('0x37')],{'$or':_['map'](_0x1a078a,function(_0xfcde20){if(_0xfcde20[_0x8109('0x3b')]!==_0x8109('0x3c')){var _0x2bb81f={};_0x2bb81f[_0xfcde20['name']]={'$like':'%'+_0x4bdd48[_0x8109('0x2c')][_0x8109('0x39')]+'%'};return _0x2bb81f;}})});}_0x3752f6=_[_0x8109('0x3a')]({},_0x3752f6,_0x4bdd48[_0x8109('0x3d')]);var _0x46b9ef={'where':_0x3752f6[_0x8109('0x37')]};return db['SugarcrmField'][_0x8109('0x3e')](_0x46b9ef)['then'](function(_0x2e08d3){_0x196e04['count']=_0x2e08d3;if(_0x4bdd48[_0x8109('0x2c')]['includeAll']){_0x3752f6[_0x8109('0x3f')]=[{'all':!![]}];}return db[_0x8109('0x27')][_0x8109('0x40')](_0x3752f6);})[_0x8109('0x1e')](function(_0x16598c){_0x196e04[_0x8109('0x41')]=_0x16598c;return _0x196e04;})[_0x8109('0x1e')](respondWithFilteredResult(_0x4ce1e3,_0x3752f6))[_0x8109('0x42')](handleError(_0x4ce1e3,null));};exports[_0x8109('0x43')]=function(_0x4ee55b,_0x3cb003){var _0x595bee={'raw':!![],'where':{'id':_0x4ee55b[_0x8109('0x44')]['id']}},_0x18c90c={};_0x18c90c[_0x8109('0x2b')]=_['keys'](db[_0x8109('0x27')]['rawAttributes']);_0x18c90c[_0x8109('0x2c')]=_[_0x8109('0x2d')](_0x4ee55b[_0x8109('0x2c')]);_0x18c90c[_0x8109('0x2e')]=_[_0x8109('0x2f')](_0x18c90c[_0x8109('0x2b')],_0x18c90c[_0x8109('0x2c')]);_0x595bee['attributes']=_[_0x8109('0x2f')](_0x18c90c[_0x8109('0x2b')],qs[_0x8109('0x31')](_0x4ee55b[_0x8109('0x2c')][_0x8109('0x31')]));_0x595bee[_0x8109('0x30')]=_0x595bee[_0x8109('0x30')][_0x8109('0x32')]?_0x595bee[_0x8109('0x30')]:_0x18c90c[_0x8109('0x2b')];if(_0x4ee55b[_0x8109('0x2c')]['includeAll']){_0x595bee[_0x8109('0x3f')]=[{'all':!![]}];}_0x595bee=_[_0x8109('0x3a')]({},_0x595bee,_0x4ee55b[_0x8109('0x3d')]);return db[_0x8109('0x27')][_0x8109('0x45')](_0x595bee)[_0x8109('0x1e')](handleEntityNotFound(_0x3cb003,null))[_0x8109('0x1e')](respondWithResult(_0x3cb003,null))['catch'](handleError(_0x3cb003,null));};exports[_0x8109('0x46')]=function(_0x394d6a,_0x1a8b20){return db[_0x8109('0x27')][_0x8109('0x46')](_0x394d6a[_0x8109('0x47')],{})[_0x8109('0x1e')](respondWithResult(_0x1a8b20,0xc9))[_0x8109('0x42')](handleError(_0x1a8b20,null));};exports[_0x8109('0x1d')]=function(_0x4bbb3f,_0x579dcb){if(_0x4bbb3f[_0x8109('0x47')]['id']){delete _0x4bbb3f[_0x8109('0x47')]['id'];}return db['SugarcrmField'][_0x8109('0x45')]({'where':{'id':_0x4bbb3f['params']['id']}})['then'](handleEntityNotFound(_0x579dcb,null))[_0x8109('0x1e')](saveUpdates(_0x4bbb3f[_0x8109('0x47')],null))[_0x8109('0x1e')](respondWithResult(_0x579dcb,null))[_0x8109('0x42')](handleError(_0x579dcb,null));};exports[_0x8109('0x48')]=function(_0x21a004,_0x53b3fd){return db[_0x8109('0x27')][_0x8109('0x45')]({'where':{'id':_0x21a004[_0x8109('0x44')]['id']}})[_0x8109('0x1e')](handleEntityNotFound(_0x53b3fd,null))[_0x8109('0x1e')](removeEntity(_0x53b3fd,null))['catch'](handleError(_0x53b3fd,null));};
\ No newline at end of file
+var _0x431f=['html-pdf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','end','json','limit','status','set','apply','save','update','then','destroy','error','stack','name','send','map','SugarcrmField','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','offset','order','sort','pick','where','merge','filter','options','count','includeAll','include','findAll','rows','catch','show','params','length','find','create','body'];(function(_0x4bda2f,_0x1a3dd1){var _0x418568=function(_0x2bf08d){while(--_0x2bf08d){_0x4bda2f['push'](_0x4bda2f['shift']());}};_0x418568(++_0x1a3dd1);}(_0x431f,0xe7));var _0xf431=function(_0x58b92f,_0x161ad9){_0x58b92f=_0x58b92f-0x0;var _0x25d645=_0x431f[_0x58b92f];return _0x25d645;};'use strict';var pdf=require(_0xf431('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xf431('0x1'));var jsonpatch=require(_0xf431('0x2'));var rp=require(_0xf431('0x3'));var moment=require(_0xf431('0x4'));var BPromise=require(_0xf431('0x5'));var Mustache=require(_0xf431('0x6'));var util=require(_0xf431('0x7'));var path=require(_0xf431('0x8'));var sox=require(_0xf431('0x9'));var csv=require(_0xf431('0xa'));var ejs=require(_0xf431('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0xf431('0xc'));var crypto=require(_0xf431('0xd'));var jsforce=require(_0xf431('0xe'));var deskjs=require(_0xf431('0xf'));var toCsv=require(_0xf431('0xa'));var querystring=require(_0xf431('0x10'));var Papa=require(_0xf431('0x11'));var Redis=require(_0xf431('0x12'));var authService=require(_0xf431('0x13'));var qs=require(_0xf431('0x14'));var as=require(_0xf431('0x15'));var hardwareService=require(_0xf431('0x16'));var logger=require(_0xf431('0x17'))(_0xf431('0x18'));var utils=require(_0xf431('0x19'));var config=require('../../config/environment');var db=require(_0xf431('0x1a'))['db'];function respondWithStatusCode(_0x4e9327,_0x2c8ae5){_0x2c8ae5=_0x2c8ae5||0xcc;return function(_0x3e94a9){if(_0x3e94a9){return _0x4e9327[_0xf431('0x1b')](_0x2c8ae5);}return _0x4e9327['status'](_0x2c8ae5)[_0xf431('0x1c')]();};}function respondWithResult(_0x2f7e10,_0x28f7c3){_0x28f7c3=_0x28f7c3||0xc8;return function(_0x151bf9){if(_0x151bf9){return _0x2f7e10['status'](_0x28f7c3)[_0xf431('0x1d')](_0x151bf9);}};}function respondWithFilteredResult(_0x136073,_0x1074ec){return function(_0x4bd828){if(_0x4bd828){var _0x289045=_0x4bd828['count'],_0x429de8=_0x1074ec['offset'],_0x311c5c=_0x1074ec['offset']+_0x1074ec[_0xf431('0x1e')],_0x16f011;if(_0x311c5c>=_0x289045){_0x311c5c=_0x289045;_0x16f011=0xc8;}else{_0x16f011=0xce;}_0x136073[_0xf431('0x1f')](_0x16f011);return _0x136073[_0xf431('0x20')]('Content-Range',_0x429de8+'-'+_0x311c5c+'/'+_0x289045)['json'](_0x4bd828);}return null;};}function patchUpdates(_0x2c02ba){return function(_0x4d3e6d){try{jsonpatch[_0xf431('0x21')](_0x4d3e6d,_0x2c02ba,!![]);}catch(_0x179840){return BPromise['reject'](_0x179840);}return _0x4d3e6d[_0xf431('0x22')]();};}function saveUpdates(_0x3e36bd,_0x34b589){return function(_0xe7b680){if(_0xe7b680){return _0xe7b680[_0xf431('0x23')](_0x3e36bd)[_0xf431('0x24')](function(_0x501be5){return _0x501be5;});}return null;};}function removeEntity(_0x43b828,_0xec3975){return function(_0x40aa43){if(_0x40aa43){return _0x40aa43[_0xf431('0x25')]()[_0xf431('0x24')](function(){_0x43b828[_0xf431('0x1f')](0xcc)[_0xf431('0x1c')]();});}};}function handleEntityNotFound(_0x166890,_0x3fa032){return function(_0x17eb02){if(!_0x17eb02){_0x166890[_0xf431('0x1b')](0x194);}return _0x17eb02;};}function handleError(_0x389bdd,_0x563836){_0x563836=_0x563836||0x1f4;return function(_0x9f43c4){logger[_0xf431('0x26')](_0x9f43c4[_0xf431('0x27')]);if(_0x9f43c4['name']){delete _0x9f43c4[_0xf431('0x28')];}_0x389bdd['status'](_0x563836)[_0xf431('0x29')](_0x9f43c4);};}exports['index']=function(_0x5c71d4,_0x5b5b20){var _0x5f09e3={},_0x31b505={},_0x100a11={'count':0x0,'rows':[]};var _0x1f5f20=_[_0xf431('0x2a')](db[_0xf431('0x2b')][_0xf431('0x2c')],function(_0x3e2c1d){return{'name':_0x3e2c1d[_0xf431('0x2d')],'type':_0x3e2c1d[_0xf431('0x2e')][_0xf431('0x2f')]};});_0x31b505[_0xf431('0x30')]=_[_0xf431('0x2a')](_0x1f5f20,'name');_0x31b505[_0xf431('0x31')]=_[_0xf431('0x32')](_0x5c71d4['query']);_0x31b505[_0xf431('0x33')]=_[_0xf431('0x34')](_0x31b505[_0xf431('0x30')],_0x31b505['query']);_0x5f09e3[_0xf431('0x35')]=_['intersection'](_0x31b505[_0xf431('0x30')],qs['fields'](_0x5c71d4['query'][_0xf431('0x36')]));_0x5f09e3[_0xf431('0x35')]=_0x5f09e3['attributes']['length']?_0x5f09e3[_0xf431('0x35')]:_0x31b505[_0xf431('0x30')];if(!_0x5c71d4['query'][_0xf431('0x37')](_0xf431('0x38'))){_0x5f09e3[_0xf431('0x1e')]=qs[_0xf431('0x1e')](_0x5c71d4[_0xf431('0x31')][_0xf431('0x1e')]);_0x5f09e3[_0xf431('0x39')]=qs[_0xf431('0x39')](_0x5c71d4[_0xf431('0x31')][_0xf431('0x39')]);}_0x5f09e3[_0xf431('0x3a')]=qs[_0xf431('0x3b')](_0x5c71d4[_0xf431('0x31')][_0xf431('0x3b')]);_0x5f09e3['where']=qs['filters'](_[_0xf431('0x3c')](_0x5c71d4[_0xf431('0x31')],_0x31b505[_0xf431('0x33')]),_0x1f5f20);if(_0x5c71d4[_0xf431('0x31')]['filter']){_0x5f09e3[_0xf431('0x3d')]=_[_0xf431('0x3e')](_0x5f09e3[_0xf431('0x3d')],{'$or':_[_0xf431('0x2a')](_0x1f5f20,function(_0x35d90a){if(_0x35d90a[_0xf431('0x2e')]!=='VIRTUAL'){var _0x2df5d0={};_0x2df5d0[_0x35d90a[_0xf431('0x28')]]={'$like':'%'+_0x5c71d4[_0xf431('0x31')][_0xf431('0x3f')]+'%'};return _0x2df5d0;}})});}_0x5f09e3=_[_0xf431('0x3e')]({},_0x5f09e3,_0x5c71d4[_0xf431('0x40')]);var _0x13621a={'where':_0x5f09e3[_0xf431('0x3d')]};return db[_0xf431('0x2b')][_0xf431('0x41')](_0x13621a)['then'](function(_0xd742d0){_0x100a11['count']=_0xd742d0;if(_0x5c71d4['query'][_0xf431('0x42')]){_0x5f09e3[_0xf431('0x43')]=[{'all':!![]}];}return db[_0xf431('0x2b')][_0xf431('0x44')](_0x5f09e3);})['then'](function(_0x2fdc5c){_0x100a11[_0xf431('0x45')]=_0x2fdc5c;return _0x100a11;})[_0xf431('0x24')](respondWithFilteredResult(_0x5b5b20,_0x5f09e3))[_0xf431('0x46')](handleError(_0x5b5b20,null));};exports[_0xf431('0x47')]=function(_0x3a6a06,_0xfaae45){var _0x360339={'raw':!![],'where':{'id':_0x3a6a06[_0xf431('0x48')]['id']}},_0x3c3d54={};_0x3c3d54[_0xf431('0x30')]=_[_0xf431('0x32')](db[_0xf431('0x2b')][_0xf431('0x2c')]);_0x3c3d54[_0xf431('0x31')]=_[_0xf431('0x32')](_0x3a6a06[_0xf431('0x31')]);_0x3c3d54[_0xf431('0x33')]=_[_0xf431('0x34')](_0x3c3d54[_0xf431('0x30')],_0x3c3d54[_0xf431('0x31')]);_0x360339['attributes']=_['intersection'](_0x3c3d54[_0xf431('0x30')],qs[_0xf431('0x36')](_0x3a6a06['query'][_0xf431('0x36')]));_0x360339[_0xf431('0x35')]=_0x360339['attributes'][_0xf431('0x49')]?_0x360339['attributes']:_0x3c3d54[_0xf431('0x30')];if(_0x3a6a06[_0xf431('0x31')][_0xf431('0x42')]){_0x360339[_0xf431('0x43')]=[{'all':!![]}];}_0x360339=_[_0xf431('0x3e')]({},_0x360339,_0x3a6a06[_0xf431('0x40')]);return db['SugarcrmField'][_0xf431('0x4a')](_0x360339)['then'](handleEntityNotFound(_0xfaae45,null))[_0xf431('0x24')](respondWithResult(_0xfaae45,null))[_0xf431('0x46')](handleError(_0xfaae45,null));};exports['create']=function(_0x389adb,_0x222f9c){return db[_0xf431('0x2b')][_0xf431('0x4b')](_0x389adb[_0xf431('0x4c')],{})[_0xf431('0x24')](respondWithResult(_0x222f9c,0xc9))[_0xf431('0x46')](handleError(_0x222f9c,null));};exports[_0xf431('0x23')]=function(_0x38de5d,_0x25164d){if(_0x38de5d['body']['id']){delete _0x38de5d[_0xf431('0x4c')]['id'];}return db[_0xf431('0x2b')][_0xf431('0x4a')]({'where':{'id':_0x38de5d['params']['id']}})['then'](handleEntityNotFound(_0x25164d,null))[_0xf431('0x24')](saveUpdates(_0x38de5d[_0xf431('0x4c')],null))[_0xf431('0x24')](respondWithResult(_0x25164d,null))[_0xf431('0x46')](handleError(_0x25164d,null));};exports[_0xf431('0x25')]=function(_0x3365fd,_0x100cb9){return db[_0xf431('0x2b')][_0xf431('0x4a')]({'where':{'id':_0x3365fd[_0xf431('0x48')]['id']}})['then'](handleEntityNotFound(_0x100cb9,null))[_0xf431('0x24')](removeEntity(_0x100cb9,null))[_0xf431('0x46')](handleError(_0x100cb9,null));};
\ No newline at end of file
diff --git a/server/api/intSugarcrmField/intSugarcrmField.model.js b/server/api/intSugarcrmField/intSugarcrmField.model.js
index b9a350c..4abf538 100644
--- a/server/api/intSugarcrmField/intSugarcrmField.model.js
+++ b/server/api/intSugarcrmField/intSugarcrmField.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x78a7=['exports','sugarcrm_unique_index','FieldId','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intSugarcrmField.attributes'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x78a7,0x92));var _0x778a=function(_0x3fb23b,_0x4ee81f){_0x3fb23b=_0x3fb23b-0x0;var _0xc01a25=_0x78a7[_0x3fb23b];return _0xc01a25;};'use strict';var _=require(_0x778a('0x0'));var util=require(_0x778a('0x1'));var logger=require('../../config/logger')(_0x778a('0x2'));var moment=require(_0x778a('0x3'));var BPromise=require(_0x778a('0x4'));var rp=require(_0x778a('0x5'));var fs=require('fs');var path=require(_0x778a('0x6'));var rimraf=require(_0x778a('0x7'));var config=require(_0x778a('0x8'));var attributes=require(_0x778a('0x9'));module[_0x778a('0xa')]=function(_0x206638,_0x3c1ee5){return _0x206638['define']('SugarcrmField',attributes,{'tableName':'int_sugarcrm_fields','paranoid':![],'indexes':[{'name':_0x778a('0xb'),'fields':['idField',_0x778a('0xc')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x0e62=['./intSugarcrmField.attributes','exports','define','SugarcrmField','sugarcrm_unique_index','idField','FieldId','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x3cf980,_0x4bb561){var _0x412e66=function(_0x4849d4){while(--_0x4849d4){_0x3cf980['push'](_0x3cf980['shift']());}};_0x412e66(++_0x4bb561);}(_0x0e62,0xa7));var _0x20e6=function(_0x55c158,_0x33a7c6){_0x55c158=_0x55c158-0x0;var _0x68f39=_0x0e62[_0x55c158];return _0x68f39;};'use strict';var _=require(_0x20e6('0x0'));var util=require(_0x20e6('0x1'));var logger=require(_0x20e6('0x2'))(_0x20e6('0x3'));var moment=require('moment');var BPromise=require(_0x20e6('0x4'));var rp=require(_0x20e6('0x5'));var fs=require('fs');var path=require(_0x20e6('0x6'));var rimraf=require(_0x20e6('0x7'));var config=require(_0x20e6('0x8'));var attributes=require(_0x20e6('0x9'));module[_0x20e6('0xa')]=function(_0x45c7ca,_0x44484e){return _0x45c7ca[_0x20e6('0xb')](_0x20e6('0xc'),attributes,{'tableName':'int_sugarcrm_fields','paranoid':![],'indexes':[{'name':_0x20e6('0xd'),'fields':[_0x20e6('0xe'),_0x20e6('0xf')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/intSugarcrmField/intSugarcrmField.rpc.js b/server/api/intSugarcrmField/intSugarcrmField.rpc.js
index cffba85..1caa878 100644
--- a/server/api/intSugarcrmField/intSugarcrmField.rpc.js
+++ b/server/api/intSugarcrmField/intSugarcrmField.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xb10b=['stringify','error','message','result','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','SugarcrmField,\x20%s,\x20%s','SugarcrmField,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x51f643,_0x1e9cea){var _0x3c762b=function(_0x2d23ef){while(--_0x2d23ef){_0x51f643['push'](_0x51f643['shift']());}};_0x3c762b(++_0x1e9cea);}(_0xb10b,0x12a));var _0xbb10=function(_0x96691d,_0x544a9d){_0x96691d=_0x96691d-0x0;var _0x5a79ca=_0xb10b[_0x96691d];return _0x5a79ca;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var moment=require(_0xbb10('0x1'));var BPromise=require(_0xbb10('0x2'));var rs=require(_0xbb10('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbb10('0x4'))['db'];var utils=require(_0xbb10('0x5'));var logger=require(_0xbb10('0x6'))(_0xbb10('0x7'));var config=require(_0xbb10('0x8'));var jayson=require(_0xbb10('0x9'));var client=jayson['client'][_0xbb10('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3cdd53,_0x513741,_0x1b9e94){return new BPromise(function(_0x3fb675,_0x21370f){return client[_0xbb10('0xb')](_0x3cdd53,_0x1b9e94)[_0xbb10('0xc')](function(_0x1ce33e){logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,'request\x20sent');logger['debug'](_0xbb10('0xf'),_0x513741,_0xbb10('0x10'),JSON[_0xbb10('0x11')](_0x1ce33e));if(_0x1ce33e['error']){if(_0x1ce33e[_0xbb10('0x12')]['code']===0x1f4){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x21370f(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}logger['error'](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x3fb675(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}else{logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,_0xbb10('0x10'));_0x3fb675(_0x1ce33e[_0xbb10('0x14')][_0xbb10('0x13')]);}})['catch'](function(_0x2eca0f){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x2eca0f);_0x21370f(_0x2eca0f);});});}
\ No newline at end of file
+var _0x5f66=['../../mysqldb','../../config/utils','rpc','jayson/promise','client','request','then','SugarcrmField,\x20%s,\x20%s','request\x20sent','debug','SugarcrmField,\x20%s,\x20%s,\x20%s','stringify','code','message','error','info','catch','util','bluebird','randomstring','ioredis'];(function(_0x41656c,_0x45e0c2){var _0x319f9c=function(_0x173edb){while(--_0x173edb){_0x41656c['push'](_0x41656c['shift']());}};_0x319f9c(++_0x45e0c2);}(_0x5f66,0x1a0));var _0x65f6=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0x5f66[_0x2b4411];return _0x8e41ef;};'use strict';var _=require('lodash');var util=require(_0x65f6('0x0'));var moment=require('moment');var BPromise=require(_0x65f6('0x1'));var rs=require(_0x65f6('0x2'));var fs=require('fs');var Redis=require(_0x65f6('0x3'));var db=require(_0x65f6('0x4'))['db'];var utils=require(_0x65f6('0x5'));var logger=require('../../config/logger')(_0x65f6('0x6'));var config=require('../../config/environment');var jayson=require(_0x65f6('0x7'));var client=jayson[_0x65f6('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4ed98f,_0x1c0e12,_0x2c6571){return new BPromise(function(_0x112079,_0x8f6451){return client[_0x65f6('0x9')](_0x4ed98f,_0x2c6571)[_0x65f6('0xa')](function(_0x48d85c){logger['info'](_0x65f6('0xb'),_0x1c0e12,_0x65f6('0xc'));logger[_0x65f6('0xd')](_0x65f6('0xe'),_0x1c0e12,'request\x20sent',JSON[_0x65f6('0xf')](_0x48d85c));if(_0x48d85c['error']){if(_0x48d85c['error'][_0x65f6('0x10')]===0x1f4){logger['error'](_0x65f6('0xb'),_0x1c0e12,_0x48d85c['error'][_0x65f6('0x11')]);return _0x8f6451(_0x48d85c[_0x65f6('0x12')][_0x65f6('0x11')]);}logger[_0x65f6('0x12')](_0x65f6('0xb'),_0x1c0e12,_0x48d85c[_0x65f6('0x12')][_0x65f6('0x11')]);return _0x112079(_0x48d85c[_0x65f6('0x12')][_0x65f6('0x11')]);}else{logger[_0x65f6('0x13')]('SugarcrmField,\x20%s,\x20%s',_0x1c0e12,_0x65f6('0xc'));_0x112079(_0x48d85c['result']['message']);}})[_0x65f6('0x14')](function(_0x5c69f8){logger[_0x65f6('0x12')](_0x65f6('0xb'),_0x1c0e12,_0x5c69f8);_0x8f6451(_0x5c69f8);});});}
\ No newline at end of file
diff --git a/server/api/intVtigerAccount/index.js b/server/api/intVtigerAccount/index.js
index f824583..28273b2 100644
--- a/server/api/intVtigerAccount/index.js
+++ b/server/api/intVtigerAccount/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x3033=['destroy','exports','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./intVtigerAccount.controller','get','isAuthenticated','index','/:id','show','/:id/configurations','/:id/fields','getFields','post','create','addConfiguration','put','update','delete'];(function(_0x5c52a3,_0x13c8d5){var _0x5537b9=function(_0x469e93){while(--_0x469e93){_0x5c52a3['push'](_0x5c52a3['shift']());}};_0x5537b9(++_0x13c8d5);}(_0x3033,0xff));var _0x3303=function(_0x53fa30,_0x27d970){_0x53fa30=_0x53fa30-0x0;var _0x35610f=_0x3033[_0x53fa30];return _0x35610f;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3303('0x0'));var timeout=require(_0x3303('0x1'));var express=require(_0x3303('0x2'));var router=express[_0x3303('0x3')]();var auth=require(_0x3303('0x4'));var interaction=require(_0x3303('0x5'));var config=require('../../config/environment');var controller=require(_0x3303('0x6'));router[_0x3303('0x7')]('/',auth[_0x3303('0x8')](),controller[_0x3303('0x9')]);router[_0x3303('0x7')](_0x3303('0xa'),auth[_0x3303('0x8')](),controller[_0x3303('0xb')]);router[_0x3303('0x7')](_0x3303('0xc'),auth[_0x3303('0x8')](),controller['getConfigurations']);router[_0x3303('0x7')](_0x3303('0xd'),auth[_0x3303('0x8')](),controller[_0x3303('0xe')]);router[_0x3303('0xf')]('/',auth['isAuthenticated'](),controller[_0x3303('0x10')]);router[_0x3303('0xf')](_0x3303('0xc'),auth[_0x3303('0x8')](),controller[_0x3303('0x11')]);router[_0x3303('0x12')](_0x3303('0xa'),auth['isAuthenticated'](),controller[_0x3303('0x13')]);router[_0x3303('0x14')](_0x3303('0xa'),auth[_0x3303('0x8')](),controller[_0x3303('0x15')]);module[_0x3303('0x16')]=router;
\ No newline at end of file
+var _0x94f3=['/:id/fields','getFields','post','create','put','update','delete','destroy','exports','util','connect-timeout','express','Router','../../components/auth/service','../../config/environment','get','index','/:id','isAuthenticated','show','/:id/configurations','getConfigurations'];(function(_0x18a246,_0x2c607a){var _0x110651=function(_0x2da7cd){while(--_0x2da7cd){_0x18a246['push'](_0x18a246['shift']());}};_0x110651(++_0x2c607a);}(_0x94f3,0x153));var _0x394f=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x94f3[_0x122ef9];return _0x42fba0;};'use strict';var multer=require('multer');var util=require(_0x394f('0x0'));var path=require('path');var timeout=require(_0x394f('0x1'));var express=require(_0x394f('0x2'));var router=express[_0x394f('0x3')]();var auth=require(_0x394f('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x394f('0x5'));var controller=require('./intVtigerAccount.controller');router[_0x394f('0x6')]('/',auth['isAuthenticated'](),controller[_0x394f('0x7')]);router['get'](_0x394f('0x8'),auth[_0x394f('0x9')](),controller[_0x394f('0xa')]);router['get'](_0x394f('0xb'),auth[_0x394f('0x9')](),controller[_0x394f('0xc')]);router[_0x394f('0x6')](_0x394f('0xd'),auth[_0x394f('0x9')](),controller[_0x394f('0xe')]);router[_0x394f('0xf')]('/',auth[_0x394f('0x9')](),controller[_0x394f('0x10')]);router[_0x394f('0xf')](_0x394f('0xb'),auth[_0x394f('0x9')](),controller['addConfiguration']);router[_0x394f('0x11')](_0x394f('0x8'),auth[_0x394f('0x9')](),controller[_0x394f('0x12')]);router[_0x394f('0x13')](_0x394f('0x8'),auth[_0x394f('0x9')](),controller[_0x394f('0x14')]);module[_0x394f('0x15')]=router;
\ No newline at end of file
diff --git a/server/api/intVtigerAccount/intVtigerAccount.attributes.js b/server/api/intVtigerAccount/intVtigerAccount.attributes.js
index 24de788..3f22993 100644
--- a/server/api/intVtigerAccount/intVtigerAccount.attributes.js
+++ b/server/api/intVtigerAccount/intVtigerAccount.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x2a85=['exports','STRING','sequelize'];(function(_0x431812,_0x1fec43){var _0x1f9fa2=function(_0x1279e4){while(--_0x1279e4){_0x431812['push'](_0x431812['shift']());}};_0x1f9fa2(++_0x1fec43);}(_0x2a85,0x1df));var _0x52a8=function(_0x184d86,_0x180b98){_0x184d86=_0x184d86-0x0;var _0x4f3c4e=_0x2a85[_0x184d86];return _0x4f3c4e;};'use strict';var Sequelize=require(_0x52a8('0x0'));module[_0x52a8('0x1')]={'name':{'type':Sequelize[_0x52a8('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x52a8('0x2')]},'username':{'type':Sequelize[_0x52a8('0x2')],'allowNull':![]},'moduleName':{'type':Sequelize[_0x52a8('0x2')],'allowNull':![],'defaultValue':'HelpDesk'},'remoteUri':{'type':Sequelize[_0x52a8('0x2')],'allowNull':![]},'serverUrl':{'type':Sequelize[_0x52a8('0x2')]},'accessKey':{'type':Sequelize[_0x52a8('0x2')],'allowNull':![]}};
\ No newline at end of file
+var _0x437e=['STRING','sequelize','exports'];(function(_0x282173,_0x2abfce){var _0x8e4efa=function(_0x16dcfc){while(--_0x16dcfc){_0x282173['push'](_0x282173['shift']());}};_0x8e4efa(++_0x2abfce);}(_0x437e,0x1d2));var _0xe437=function(_0x43ad18,_0x21f334){_0x43ad18=_0x43ad18-0x0;var _0x3bdc6a=_0x437e[_0x43ad18];return _0x3bdc6a;};'use strict';var Sequelize=require(_0xe437('0x0'));module[_0xe437('0x1')]={'name':{'type':Sequelize[_0xe437('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xe437('0x2')]},'username':{'type':Sequelize[_0xe437('0x2')],'allowNull':![]},'moduleName':{'type':Sequelize[_0xe437('0x2')],'allowNull':![],'defaultValue':'HelpDesk'},'remoteUri':{'type':Sequelize['STRING'],'allowNull':![]},'serverUrl':{'type':Sequelize[_0xe437('0x2')]},'accessKey':{'type':Sequelize[_0xe437('0x2')],'allowNull':![]}};
\ No newline at end of file
diff --git a/server/api/intVtigerAccount/intVtigerAccount.controller.js b/server/api/intVtigerAccount/intVtigerAccount.controller.js
index e7187f1..d393032 100644
--- a/server/api/intVtigerAccount/intVtigerAccount.controller.js
+++ b/server/api/intVtigerAccount/intVtigerAccount.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xcebd=['The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','VtigerAccount,\x20%s,\x20%s','request\x20sent','debug','VtigerAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','sendStatus','status','end','json','count','offset','limit','set','save','update','send','index','rawAttributes','fieldName','key','model','map','name','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','pick','filter','where','merge','type','VIRTUAL','options','VtigerAccount','include','show','params','keys','includeAll','find','body','destroy','getConfigurations','VtigerConfiguration','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','create','VtigerField','md5','getFields','username','description','moduleName','remoteUri','serverUrl','accessKey','substring','lastIndexOf','format','%s/webservice.php','GET','getchallenge','success','POST','login','token','describe','sessionName','autogenerated','owner','remove','editable','false','startsWith','cf_','picklistValues','label','value','log','vTiger\x20error:\x20','statusCode','Wrong\x20credentials','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','jayson/promise','client','test','Sequelize','ValidationError'];(function(_0x334ad9,_0x2b6ffa){var _0x556478=function(_0x4cdd9b){while(--_0x4cdd9b){_0x334ad9['push'](_0x334ad9['shift']());}};_0x556478(++_0x2b6ffa);}(_0xcebd,0x66));var _0xdceb=function(_0x8aef87,_0x5b37be){_0x8aef87=_0x8aef87-0x0;var _0x52c9ae=_0xcebd[_0x8aef87];return _0x52c9ae;};'use strict';var pdf=require(_0xdceb('0x0'));var emlformat=require(_0xdceb('0x1'));var rimraf=require(_0xdceb('0x2'));var zipdir=require(_0xdceb('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0xdceb('0x4'));var moment=require(_0xdceb('0x5'));var BPromise=require(_0xdceb('0x6'));var Mustache=require(_0xdceb('0x7'));var util=require(_0xdceb('0x8'));var path=require(_0xdceb('0x9'));var sox=require('sox');var csv=require(_0xdceb('0xa'));var ejs=require(_0xdceb('0xb'));var fs=require('fs');var _=require(_0xdceb('0xc'));var squel=require(_0xdceb('0xd'));var crypto=require(_0xdceb('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xdceb('0xf'));var toCsv=require(_0xdceb('0xa'));var querystring=require(_0xdceb('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xdceb('0x11'));var qs=require(_0xdceb('0x12'));var as=require(_0xdceb('0x13'));var hardwareService=require(_0xdceb('0x14'));var logger=require(_0xdceb('0x15'))(_0xdceb('0x16'));var utils=require(_0xdceb('0x17'));var config=require('../../config/environment');var db=require(_0xdceb('0x18'))['db'];var integrations=require('../../components/integrations/configuration');var jayson=require(_0xdceb('0x19'));var client=jayson[_0xdceb('0x1a')]['http']({'port':0x232a});function checkPasswordPattern(_0x16f5ee,_0x5efced,_0xd641a3){if(_0xd641a3){var _0x1799a1=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x1799a1[_0xdceb('0x1b')](_0x5efced)){return _0x16f5ee;}else{throw new db[(_0xdceb('0x1c'))][(_0xdceb('0x1d'))](_0xdceb('0x1e'));}}else{return _0x16f5ee;}}function respondWithRpcPromise(_0x125b25,_0x53957c,_0x2c722f,_0x8c9ae4){return new BPromise(function(_0x2dd2f5,_0x227134){var _0x4091ad=_0x8c9ae4||client;return _0x4091ad[_0xdceb('0x1f')](_0x125b25,_0x2c722f)[_0xdceb('0x20')](function(_0x5e66de){logger['info'](_0xdceb('0x21'),_0x53957c,_0xdceb('0x22'));logger[_0xdceb('0x23')](_0xdceb('0x24'),_0x53957c,_0xdceb('0x22'),JSON[_0xdceb('0x25')](_0x5e66de));if(_0x5e66de[_0xdceb('0x26')]){if(_0x5e66de[_0xdceb('0x26')][_0xdceb('0x27')]===0x1f4){logger[_0xdceb('0x26')](_0xdceb('0x21'),_0x53957c,_0x5e66de[_0xdceb('0x26')][_0xdceb('0x28')]);return _0x227134(_0x5e66de[_0xdceb('0x26')]['message']);}logger[_0xdceb('0x26')]('VtigerAccount,\x20%s,\x20%s',_0x53957c,_0x5e66de['error'][_0xdceb('0x28')]);return _0x2dd2f5(_0x5e66de[_0xdceb('0x26')][_0xdceb('0x28')]);}else{logger[_0xdceb('0x29')](_0xdceb('0x21'),_0x53957c,'request\x20sent');_0x2dd2f5(_0x5e66de[_0xdceb('0x2a')][_0xdceb('0x28')]);}})[_0xdceb('0x2b')](function(_0x1c4ff3){logger[_0xdceb('0x26')](_0xdceb('0x21'),_0x53957c,_0x1c4ff3);_0x227134(_0x1c4ff3);});});}function respondWithStatusCode(_0x205f06,_0x3b3362){_0x3b3362=_0x3b3362||0xcc;return function(_0x209f29){if(_0x209f29){return _0x205f06[_0xdceb('0x2c')](_0x3b3362);}return _0x205f06[_0xdceb('0x2d')](_0x3b3362)[_0xdceb('0x2e')]();};}function respondWithResult(_0x375bf1,_0x5ed5a7){_0x5ed5a7=_0x5ed5a7||0xc8;return function(_0x401766){if(_0x401766){return _0x375bf1[_0xdceb('0x2d')](_0x5ed5a7)[_0xdceb('0x2f')](_0x401766);}};}function respondWithFilteredResult(_0x1174ce,_0x38dad5){return function(_0x4687bf){if(_0x4687bf){var _0x2b1328=_0x4687bf[_0xdceb('0x30')],_0x8f9038=_0x38dad5['offset'],_0xb3353f=_0x38dad5[_0xdceb('0x31')]+_0x38dad5[_0xdceb('0x32')],_0x197160;if(_0xb3353f>=_0x2b1328){_0xb3353f=_0x2b1328;_0x197160=0xc8;}else{_0x197160=0xce;}_0x1174ce['status'](_0x197160);return _0x1174ce[_0xdceb('0x33')]('Content-Range',_0x8f9038+'-'+_0xb3353f+'/'+_0x2b1328)[_0xdceb('0x2f')](_0x4687bf);}return null;};}function patchUpdates(_0x364506){return function(_0x2b0b78){try{jsonpatch['apply'](_0x2b0b78,_0x364506,!![]);}catch(_0x51c13f){return BPromise['reject'](_0x51c13f);}return _0x2b0b78[_0xdceb('0x34')]();};}function saveUpdates(_0x23acbf,_0x4d2cf6){return function(_0x2b789e){if(_0x2b789e){return _0x2b789e[_0xdceb('0x35')](_0x23acbf)[_0xdceb('0x20')](function(_0x4b43c6){return _0x4b43c6;});}return null;};}function removeEntity(_0x3777f6,_0x3b3d33){return function(_0x412785){if(_0x412785){return _0x412785['destroy']()[_0xdceb('0x20')](function(){_0x3777f6[_0xdceb('0x2d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2a3de6,_0x3ef6ee){return function(_0x412b57){if(!_0x412b57){_0x2a3de6[_0xdceb('0x2c')](0x194);}return _0x412b57;};}function handleError(_0x27089d,_0x47966a){_0x47966a=_0x47966a||0x1f4;return function(_0x40a25e){logger['error'](_0x40a25e['stack']);if(_0x40a25e['name']){delete _0x40a25e['name'];}_0x27089d[_0xdceb('0x2d')](_0x47966a)[_0xdceb('0x36')](_0x40a25e);};}exports[_0xdceb('0x37')]=function(_0x349880,_0x8b846c){var _0x2a876c={},_0x3e7a6a={},_0x5a05d3={'count':0x0,'rows':[]};var _0x1c195=_['map'](db['VtigerAccount'][_0xdceb('0x38')],function(_0x4a7dd0){return{'name':_0x4a7dd0[_0xdceb('0x39')],'type':_0x4a7dd0['type'][_0xdceb('0x3a')]};});_0x3e7a6a[_0xdceb('0x3b')]=_[_0xdceb('0x3c')](_0x1c195,_0xdceb('0x3d'));_0x3e7a6a[_0xdceb('0x3e')]=_['keys'](_0x349880['query']);_0x3e7a6a[_0xdceb('0x3f')]=_[_0xdceb('0x40')](_0x3e7a6a[_0xdceb('0x3b')],_0x3e7a6a[_0xdceb('0x3e')]);_0x2a876c[_0xdceb('0x41')]=_[_0xdceb('0x40')](_0x3e7a6a[_0xdceb('0x3b')],qs[_0xdceb('0x42')](_0x349880['query'][_0xdceb('0x42')]));_0x2a876c[_0xdceb('0x41')]=_0x2a876c[_0xdceb('0x41')][_0xdceb('0x43')]?_0x2a876c[_0xdceb('0x41')]:_0x3e7a6a[_0xdceb('0x3b')];if(!_0x349880['query'][_0xdceb('0x44')]('nolimit')){_0x2a876c['limit']=qs[_0xdceb('0x32')](_0x349880['query'][_0xdceb('0x32')]);_0x2a876c['offset']=qs[_0xdceb('0x31')](_0x349880[_0xdceb('0x3e')][_0xdceb('0x31')]);}_0x2a876c[_0xdceb('0x45')]=qs['sort'](_0x349880[_0xdceb('0x3e')][_0xdceb('0x46')]);_0x2a876c['where']=qs[_0xdceb('0x3f')](_[_0xdceb('0x47')](_0x349880['query'],_0x3e7a6a[_0xdceb('0x3f')]),_0x1c195);if(_0x349880['query'][_0xdceb('0x48')]){_0x2a876c[_0xdceb('0x49')]=_[_0xdceb('0x4a')](_0x2a876c[_0xdceb('0x49')],{'$or':_[_0xdceb('0x3c')](_0x1c195,function(_0x52f73c){if(_0x52f73c[_0xdceb('0x4b')]!==_0xdceb('0x4c')){var _0xaefd6b={};_0xaefd6b[_0x52f73c[_0xdceb('0x3d')]]={'$like':'%'+_0x349880['query'][_0xdceb('0x48')]+'%'};return _0xaefd6b;}})});}_0x2a876c=_[_0xdceb('0x4a')]({},_0x2a876c,_0x349880[_0xdceb('0x4d')]);var _0x373eb4={'where':_0x2a876c[_0xdceb('0x49')]};return db[_0xdceb('0x4e')]['count'](_0x373eb4)['then'](function(_0x54386b){_0x5a05d3[_0xdceb('0x30')]=_0x54386b;if(_0x349880['query']['includeAll']){_0x2a876c[_0xdceb('0x4f')]=[{'all':!![]}];}return db[_0xdceb('0x4e')]['findAll'](_0x2a876c);})[_0xdceb('0x20')](function(_0x154725){_0x5a05d3['rows']=_0x154725;return _0x5a05d3;})['then'](respondWithFilteredResult(_0x8b846c,_0x2a876c))[_0xdceb('0x2b')](handleError(_0x8b846c,null));};exports[_0xdceb('0x50')]=function(_0x29463e,_0x58fbbf){var _0x258135={'raw':![],'where':{'id':_0x29463e[_0xdceb('0x51')]['id']}},_0xdfba7a={};_0xdfba7a['model']=_['keys'](db[_0xdceb('0x4e')]['rawAttributes']);_0xdfba7a[_0xdceb('0x3e')]=_[_0xdceb('0x52')](_0x29463e['query']);_0xdfba7a['filters']=_[_0xdceb('0x40')](_0xdfba7a[_0xdceb('0x3b')],_0xdfba7a[_0xdceb('0x3e')]);_0x258135['attributes']=_[_0xdceb('0x40')](_0xdfba7a[_0xdceb('0x3b')],qs[_0xdceb('0x42')](_0x29463e[_0xdceb('0x3e')][_0xdceb('0x42')]));_0x258135[_0xdceb('0x41')]=_0x258135[_0xdceb('0x41')][_0xdceb('0x43')]?_0x258135['attributes']:_0xdfba7a['model'];if(_0x29463e[_0xdceb('0x3e')][_0xdceb('0x53')]){_0x258135['include']=[{'all':!![]}];}_0x258135=_[_0xdceb('0x4a')]({},_0x258135,_0x29463e[_0xdceb('0x4d')]);return db['VtigerAccount'][_0xdceb('0x54')](_0x258135)['then'](handleEntityNotFound(_0x58fbbf,null))[_0xdceb('0x20')](respondWithResult(_0x58fbbf,null))[_0xdceb('0x2b')](handleError(_0x58fbbf,null));};exports['create']=function(_0x1a8119,_0x3e0606){return db['VtigerAccount']['create'](_0x1a8119[_0xdceb('0x55')],{})[_0xdceb('0x20')](respondWithResult(_0x3e0606,0xc9))[_0xdceb('0x2b')](handleError(_0x3e0606,null));};exports['update']=function(_0x4f76a2,_0x16a23f){if(_0x4f76a2[_0xdceb('0x55')]['id']){delete _0x4f76a2[_0xdceb('0x55')]['id'];}return db['VtigerAccount'][_0xdceb('0x54')]({'where':{'id':_0x4f76a2[_0xdceb('0x51')]['id']}})[_0xdceb('0x20')](handleEntityNotFound(_0x16a23f,null))[_0xdceb('0x20')](saveUpdates(_0x4f76a2[_0xdceb('0x55')],null))[_0xdceb('0x20')](respondWithResult(_0x16a23f,null))[_0xdceb('0x2b')](handleError(_0x16a23f,null));};exports[_0xdceb('0x56')]=function(_0x5e16c4,_0x333aee){return db[_0xdceb('0x4e')][_0xdceb('0x54')]({'where':{'id':_0x5e16c4[_0xdceb('0x51')]['id']}})[_0xdceb('0x20')](handleEntityNotFound(_0x333aee,null))[_0xdceb('0x20')](removeEntity(_0x333aee,null))[_0xdceb('0x2b')](handleError(_0x333aee,null));};exports[_0xdceb('0x57')]=function(_0x15196e,_0x153246,_0x8bfd29){var _0x64c51c={};var _0x421aa5={};var _0x25621b;var _0x4b46ae;return db[_0xdceb('0x4e')]['findOne']({'where':{'id':_0x15196e['params']['id']}})[_0xdceb('0x20')](handleEntityNotFound(_0x153246,null))[_0xdceb('0x20')](function(_0x3fa6d5){if(_0x3fa6d5){_0x25621b=_0x3fa6d5;_0x421aa5[_0xdceb('0x3b')]=_[_0xdceb('0x52')](db[_0xdceb('0x58')]['rawAttributes']);_0x421aa5[_0xdceb('0x3e')]=_['keys'](_0x15196e['query']);_0x421aa5[_0xdceb('0x3f')]=_[_0xdceb('0x40')](_0x421aa5[_0xdceb('0x3b')],_0x421aa5[_0xdceb('0x3e')]);_0x64c51c[_0xdceb('0x41')]=_[_0xdceb('0x40')](_0x421aa5['model'],qs[_0xdceb('0x42')](_0x15196e[_0xdceb('0x3e')][_0xdceb('0x42')]));_0x64c51c[_0xdceb('0x41')]=_0x64c51c[_0xdceb('0x41')][_0xdceb('0x43')]?_0x64c51c[_0xdceb('0x41')]:_0x421aa5['model'];_0x64c51c[_0xdceb('0x45')]=qs['sort'](_0x15196e[_0xdceb('0x3e')][_0xdceb('0x46')]);_0x64c51c['where']=qs[_0xdceb('0x3f')](_[_0xdceb('0x47')](_0x15196e[_0xdceb('0x3e')],_0x421aa5[_0xdceb('0x3f')]));if(_0x15196e[_0xdceb('0x3e')]['filter']){_0x64c51c[_0xdceb('0x49')]=_[_0xdceb('0x4a')](_0x64c51c[_0xdceb('0x49')],{'$or':_[_0xdceb('0x3c')](_0x64c51c['attributes'],function(_0x143b3b){var _0xc7c484={};_0xc7c484[_0x143b3b]={'$like':'%'+_0x15196e['query']['filter']+'%'};return _0xc7c484;})});}_0x64c51c=_[_0xdceb('0x4a')]({},_0x64c51c,_0x15196e['options']);return _0x25621b['getConfigurations'](_0x64c51c);}})['then'](function(_0x1a2c48){if(_0x1a2c48){_0x4b46ae=_0x1a2c48[_0xdceb('0x43')];if(!_0x15196e[_0xdceb('0x3e')][_0xdceb('0x44')]('nolimit')){_0x64c51c[_0xdceb('0x32')]=qs[_0xdceb('0x32')](_0x15196e['query'][_0xdceb('0x32')]);_0x64c51c[_0xdceb('0x31')]=qs[_0xdceb('0x31')](_0x15196e[_0xdceb('0x3e')][_0xdceb('0x31')]);}return _0x25621b[_0xdceb('0x57')](_0x64c51c);}})[_0xdceb('0x20')](function(_0xc83f74){if(_0xc83f74){return _0xc83f74?{'count':_0x4b46ae,'rows':_0xc83f74}:null;}})[_0xdceb('0x20')](respondWithResult(_0x153246,null))[_0xdceb('0x2b')](handleError(_0x153246,null));};exports[_0xdceb('0x59')]=function(_0x49b501,_0x2f88a1,_0x4d7e11){if(_0x49b501[_0xdceb('0x55')]['id']){delete _0x49b501[_0xdceb('0x55')]['id'];}return db[_0xdceb('0x4e')]['findOne']({'where':{'id':_0x49b501['params']['id']}})[_0xdceb('0x20')](handleEntityNotFound(_0x2f88a1,null))[_0xdceb('0x20')](function(_0x595a85){if(_0x595a85){_0x49b501['body'][_0xdceb('0x5a')]=_0x595a85['id'];_0x49b501['body'][_0xdceb('0x5b')]=integrations[_0xdceb('0x5c')](_0x49b501[_0xdceb('0x55')][_0xdceb('0x5d')],_0x49b501[_0xdceb('0x55')]['type']);_0x49b501[_0xdceb('0x55')][_0xdceb('0x5e')]=integrations[_0xdceb('0x5f')](_0x49b501[_0xdceb('0x55')][_0xdceb('0x5d')],_0x49b501[_0xdceb('0x55')][_0xdceb('0x4b')]);return db['VtigerConfiguration'][_0xdceb('0x60')](_0x49b501[_0xdceb('0x55')],{'include':[{'model':db['VtigerField'],'as':_0xdceb('0x5b')},{'model':db[_0xdceb('0x61')],'as':_0xdceb('0x5e')}]});}return null;})[_0xdceb('0x20')](respondWithResult(_0x2f88a1,null))[_0xdceb('0x2b')](handleError(_0x2f88a1,null));};var md5=require(_0xdceb('0x62'));exports[_0xdceb('0x63')]=function(_0x198df4,_0x55f108,_0x14e844){var _0x4c4f5f=null;var _0x4dcc97=null;var _0x396f31=null;var _0x514436=null;var _0x46f8b0='';return db[_0xdceb('0x4e')]['findOne']({'where':{'id':_0x198df4[_0xdceb('0x51')]['id']},'attributes':['id',_0xdceb('0x3d'),_0xdceb('0x64'),_0xdceb('0x65'),_0xdceb('0x66'),_0xdceb('0x67'),_0xdceb('0x68'),_0xdceb('0x69')]})['then'](handleEntityNotFound(_0x55f108,null))[_0xdceb('0x20')](function(_0x503cd1){if(_0x503cd1){_0x4c4f5f=_0x503cd1['username'];_0x4dcc97=_0x503cd1[_0xdceb('0x69')];_0x396f31=_0x503cd1['moduleName'];_0x46f8b0=_0x503cd1['remoteUri'];var _0x21a01e=_0x46f8b0['slice'](-0x1);if(_0x21a01e==='/'){_0x46f8b0=_0x46f8b0[_0xdceb('0x6a')](0x0,_0x46f8b0[_0xdceb('0x6b')](_0x21a01e));}_0x514436=util[_0xdceb('0x6c')](_0xdceb('0x6d'),_0x46f8b0);var _0x17641c={'method':_0xdceb('0x6e'),'uri':_0x514436,'qs':{'operation':_0xdceb('0x6f'),'username':_0x503cd1[_0xdceb('0x64')]},'json':!![]};return rp(_0x17641c);}})[_0xdceb('0x20')](function(_0x30eb58){if(_0x30eb58[_0xdceb('0x70')]){var _0x5eb0e7={'method':_0xdceb('0x71'),'uri':_0x514436,'form':{'operation':_0xdceb('0x72'),'username':_0x4c4f5f,'accessKey':md5(_0x30eb58['result'][_0xdceb('0x73')]+_0x4dcc97)},'json':!![]};return rp(_0x5eb0e7);}})[_0xdceb('0x20')](function(_0x1862a7){if(_0x1862a7['success']){var _0x3a68ba={'method':_0xdceb('0x6e'),'uri':_0x514436,'qs':{'operation':_0xdceb('0x74'),'username':_0x4c4f5f,'sessionName':_0x1862a7[_0xdceb('0x2a')][_0xdceb('0x75')],'elementType':_0x396f31},'json':!![]};return rp(_0x3a68ba);}})[_0xdceb('0x20')](function(_0x28a07d){if(_0x28a07d['success']){var _0x534961=[_0xdceb('0x76'),'reference',_0xdceb('0x77')];_[_0xdceb('0x78')](_0x28a07d[_0xdceb('0x2a')][_0xdceb('0x42')],function(_0x3a3342){return _0x534961['includes'](_0x3a3342[_0xdceb('0x4b')][_0xdceb('0x3d')]);});_[_0xdceb('0x78')](_0x28a07d[_0xdceb('0x2a')]['fields'],function(_0x6c7bd0){return _0x6c7bd0[_0xdceb('0x79')]===_0xdceb('0x7a');});return{'count':_0x28a07d['result'][_0xdceb('0x42')][_0xdceb('0x43')],'rows':_[_0xdceb('0x3c')](_0x28a07d[_0xdceb('0x2a')][_0xdceb('0x42')],function(_0x51e00d){return{'id':_0x51e00d[_0xdceb('0x3d')],'name':_0x51e00d['label'],'custom':_[_0xdceb('0x7b')](_0x51e00d[_0xdceb('0x3d')],_0xdceb('0x7c'))?!![]:![],'options':_0x51e00d['type'][_0xdceb('0x3d')]==='picklist'&&_0x51e00d['type'][_0xdceb('0x7d')]['length']>0x0?_[_0xdceb('0x3c')](_0x51e00d[_0xdceb('0x4b')]['picklistValues'],function(_0x282045){return{'name':_0x282045[_0xdceb('0x7e')],'value':_0x282045[_0xdceb('0x7f')]};}):[]};})};}})[_0xdceb('0x20')](respondWithResult(_0x55f108,null))[_0xdceb('0x2b')](function(_0x50e771){console[_0xdceb('0x80')](_0xdceb('0x81')+_0x50e771);var _0x17d0c5=_0x198df4[_0xdceb('0x3e')]['test']?0x1f4:_0x50e771[_0xdceb('0x82')]||0x1f4;logger['error']('getFields,\x20%s,\x20%s,\x20%s',_0xdceb('0x63'),_0x17d0c5,JSON['stringify'](_0x50e771));delete _0x50e771['name'];if(_0x17d0c5===0x191){_0x17d0c5=0x190;}_0x55f108[_0xdceb('0x2d')](_0x17d0c5)[_0xdceb('0x36')](_0x198df4[_0xdceb('0x3e')][_0xdceb('0x1b')]?{'message':_0xdceb('0x83'),'statusCode':_0x50e771[_0xdceb('0x82')]}:_0x50e771);});};
\ No newline at end of file
+var _0x4c9e=['editable','false','cf_','picklist','label','log','vTiger\x20error:\x20','statusCode','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','../../components/integrations/configuration','client','http','test','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','request\x20sent','debug','stringify','error','code','VtigerAccount,\x20%s,\x20%s','message','result','catch','end','status','json','count','limit','set','reject','save','destroy','sendStatus','send','index','map','rawAttributes','fieldName','type','key','model','name','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','offset','sort','where','pick','filter','merge','VIRTUAL','options','VtigerAccount','rows','show','params','keys','length','includeAll','include','find','create','body','update','getConfigurations','findOne','VtigerConfiguration','order','addConfiguration','AccountId','Subjects','getSubjects','channel','getDescriptions','VtigerField','Descriptions','md5','getFields','description','moduleName','serverUrl','accessKey','substring','lastIndexOf','%s/webservice.php','getchallenge','success','POST','login','token','GET','describe','sessionName','autogenerated','reference','owner','remove','includes'];(function(_0x434351,_0x28e2b1){var _0x5ecfb5=function(_0x2efd0d){while(--_0x2efd0d){_0x434351['push'](_0x434351['shift']());}};_0x5ecfb5(++_0x28e2b1);}(_0x4c9e,0x191));var _0xe4c9=function(_0x33032e,_0x31411a){_0x33032e=_0x33032e-0x0;var _0x13316b=_0x4c9e[_0x33032e];return _0x13316b;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0xe4c9('0x0'));var zipdir=require(_0xe4c9('0x1'));var jsonpatch=require(_0xe4c9('0x2'));var rp=require(_0xe4c9('0x3'));var moment=require(_0xe4c9('0x4'));var BPromise=require(_0xe4c9('0x5'));var Mustache=require('mustache');var util=require(_0xe4c9('0x6'));var path=require(_0xe4c9('0x7'));var sox=require(_0xe4c9('0x8'));var csv=require(_0xe4c9('0x9'));var ejs=require(_0xe4c9('0xa'));var fs=require('fs');var _=require(_0xe4c9('0xb'));var squel=require(_0xe4c9('0xc'));var crypto=require(_0xe4c9('0xd'));var jsforce=require(_0xe4c9('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xe4c9('0x9'));var querystring=require(_0xe4c9('0xf'));var Papa=require(_0xe4c9('0x10'));var Redis=require('ioredis');var authService=require(_0xe4c9('0x11'));var qs=require(_0xe4c9('0x12'));var as=require(_0xe4c9('0x13'));var hardwareService=require(_0xe4c9('0x14'));var logger=require(_0xe4c9('0x15'))(_0xe4c9('0x16'));var utils=require(_0xe4c9('0x17'));var config=require('../../config/environment');var db=require(_0xe4c9('0x18'))['db'];var integrations=require(_0xe4c9('0x19'));var jayson=require('jayson/promise');var client=jayson[_0xe4c9('0x1a')][_0xe4c9('0x1b')]({'port':0x232a});function checkPasswordPattern(_0x2d033f,_0x172819,_0x39fff9){if(_0x39fff9){var _0x4464c6=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x4464c6[_0xe4c9('0x1c')](_0x172819)){return _0x2d033f;}else{throw new db['Sequelize'][(_0xe4c9('0x1d'))](_0xe4c9('0x1e'));}}else{return _0x2d033f;}}function respondWithRpcPromise(_0x3d06b3,_0x593ae1,_0x2b1751,_0x36f7e0){return new BPromise(function(_0x3cd162,_0x4b288b){var _0x111632=_0x36f7e0||client;return _0x111632[_0xe4c9('0x1f')](_0x3d06b3,_0x2b1751)[_0xe4c9('0x20')](function(_0x4f1775){logger[_0xe4c9('0x21')]('VtigerAccount,\x20%s,\x20%s',_0x593ae1,_0xe4c9('0x22'));logger[_0xe4c9('0x23')]('VtigerAccount,\x20%s,\x20%s,\x20%s',_0x593ae1,_0xe4c9('0x22'),JSON[_0xe4c9('0x24')](_0x4f1775));if(_0x4f1775[_0xe4c9('0x25')]){if(_0x4f1775[_0xe4c9('0x25')][_0xe4c9('0x26')]===0x1f4){logger[_0xe4c9('0x25')](_0xe4c9('0x27'),_0x593ae1,_0x4f1775[_0xe4c9('0x25')]['message']);return _0x4b288b(_0x4f1775[_0xe4c9('0x25')][_0xe4c9('0x28')]);}logger[_0xe4c9('0x25')](_0xe4c9('0x27'),_0x593ae1,_0x4f1775[_0xe4c9('0x25')][_0xe4c9('0x28')]);return _0x3cd162(_0x4f1775[_0xe4c9('0x25')][_0xe4c9('0x28')]);}else{logger[_0xe4c9('0x21')]('VtigerAccount,\x20%s,\x20%s',_0x593ae1,_0xe4c9('0x22'));_0x3cd162(_0x4f1775[_0xe4c9('0x29')][_0xe4c9('0x28')]);}})[_0xe4c9('0x2a')](function(_0x71a775){logger['error'](_0xe4c9('0x27'),_0x593ae1,_0x71a775);_0x4b288b(_0x71a775);});});}function respondWithStatusCode(_0x4de2d1,_0x12e4cf){_0x12e4cf=_0x12e4cf||0xcc;return function(_0x232afe){if(_0x232afe){return _0x4de2d1['sendStatus'](_0x12e4cf);}return _0x4de2d1['status'](_0x12e4cf)[_0xe4c9('0x2b')]();};}function respondWithResult(_0x536594,_0x4cab48){_0x4cab48=_0x4cab48||0xc8;return function(_0xd1a4c3){if(_0xd1a4c3){return _0x536594[_0xe4c9('0x2c')](_0x4cab48)[_0xe4c9('0x2d')](_0xd1a4c3);}};}function respondWithFilteredResult(_0x24080f,_0x5eef8c){return function(_0x334e7c){if(_0x334e7c){var _0x4c34d2=_0x334e7c[_0xe4c9('0x2e')],_0x237773=_0x5eef8c['offset'],_0x1c1e1f=_0x5eef8c['offset']+_0x5eef8c[_0xe4c9('0x2f')],_0x41b281;if(_0x1c1e1f>=_0x4c34d2){_0x1c1e1f=_0x4c34d2;_0x41b281=0xc8;}else{_0x41b281=0xce;}_0x24080f['status'](_0x41b281);return _0x24080f[_0xe4c9('0x30')]('Content-Range',_0x237773+'-'+_0x1c1e1f+'/'+_0x4c34d2)[_0xe4c9('0x2d')](_0x334e7c);}return null;};}function patchUpdates(_0x2f630c){return function(_0x55c0fe){try{jsonpatch['apply'](_0x55c0fe,_0x2f630c,!![]);}catch(_0x3aa384){return BPromise[_0xe4c9('0x31')](_0x3aa384);}return _0x55c0fe[_0xe4c9('0x32')]();};}function saveUpdates(_0x45d70f,_0x581227){return function(_0x1c486f){if(_0x1c486f){return _0x1c486f['update'](_0x45d70f)[_0xe4c9('0x20')](function(_0x4e00cc){return _0x4e00cc;});}return null;};}function removeEntity(_0x3f3d88,_0x339eeb){return function(_0x383a20){if(_0x383a20){return _0x383a20[_0xe4c9('0x33')]()[_0xe4c9('0x20')](function(){_0x3f3d88[_0xe4c9('0x2c')](0xcc)[_0xe4c9('0x2b')]();});}};}function handleEntityNotFound(_0x283033,_0x4bf626){return function(_0x2a42db){if(!_0x2a42db){_0x283033[_0xe4c9('0x34')](0x194);}return _0x2a42db;};}function handleError(_0x1a8451,_0x202b5a){_0x202b5a=_0x202b5a||0x1f4;return function(_0x1cb23f){logger[_0xe4c9('0x25')](_0x1cb23f['stack']);if(_0x1cb23f['name']){delete _0x1cb23f['name'];}_0x1a8451['status'](_0x202b5a)[_0xe4c9('0x35')](_0x1cb23f);};}exports[_0xe4c9('0x36')]=function(_0x37f1ac,_0x10ddf3){var _0x6763f={},_0xf109e8={},_0x4c4363={'count':0x0,'rows':[]};var _0x542bb=_[_0xe4c9('0x37')](db['VtigerAccount'][_0xe4c9('0x38')],function(_0x52538d){return{'name':_0x52538d[_0xe4c9('0x39')],'type':_0x52538d[_0xe4c9('0x3a')][_0xe4c9('0x3b')]};});_0xf109e8[_0xe4c9('0x3c')]=_[_0xe4c9('0x37')](_0x542bb,_0xe4c9('0x3d'));_0xf109e8[_0xe4c9('0x3e')]=_['keys'](_0x37f1ac[_0xe4c9('0x3e')]);_0xf109e8[_0xe4c9('0x3f')]=_[_0xe4c9('0x40')](_0xf109e8[_0xe4c9('0x3c')],_0xf109e8[_0xe4c9('0x3e')]);_0x6763f['attributes']=_[_0xe4c9('0x40')](_0xf109e8[_0xe4c9('0x3c')],qs[_0xe4c9('0x41')](_0x37f1ac['query'][_0xe4c9('0x41')]));_0x6763f[_0xe4c9('0x42')]=_0x6763f[_0xe4c9('0x42')]['length']?_0x6763f[_0xe4c9('0x42')]:_0xf109e8[_0xe4c9('0x3c')];if(!_0x37f1ac[_0xe4c9('0x3e')][_0xe4c9('0x43')](_0xe4c9('0x44'))){_0x6763f[_0xe4c9('0x2f')]=qs[_0xe4c9('0x2f')](_0x37f1ac[_0xe4c9('0x3e')][_0xe4c9('0x2f')]);_0x6763f[_0xe4c9('0x45')]=qs['offset'](_0x37f1ac[_0xe4c9('0x3e')][_0xe4c9('0x45')]);}_0x6763f['order']=qs[_0xe4c9('0x46')](_0x37f1ac['query']['sort']);_0x6763f[_0xe4c9('0x47')]=qs[_0xe4c9('0x3f')](_[_0xe4c9('0x48')](_0x37f1ac[_0xe4c9('0x3e')],_0xf109e8[_0xe4c9('0x3f')]),_0x542bb);if(_0x37f1ac[_0xe4c9('0x3e')][_0xe4c9('0x49')]){_0x6763f[_0xe4c9('0x47')]=_[_0xe4c9('0x4a')](_0x6763f[_0xe4c9('0x47')],{'$or':_[_0xe4c9('0x37')](_0x542bb,function(_0x2fae9e){if(_0x2fae9e[_0xe4c9('0x3a')]!==_0xe4c9('0x4b')){var _0x11a0dc={};_0x11a0dc[_0x2fae9e[_0xe4c9('0x3d')]]={'$like':'%'+_0x37f1ac[_0xe4c9('0x3e')]['filter']+'%'};return _0x11a0dc;}})});}_0x6763f=_['merge']({},_0x6763f,_0x37f1ac[_0xe4c9('0x4c')]);var _0x5db389={'where':_0x6763f[_0xe4c9('0x47')]};return db['VtigerAccount'][_0xe4c9('0x2e')](_0x5db389)['then'](function(_0x4c5fde){_0x4c4363['count']=_0x4c5fde;if(_0x37f1ac[_0xe4c9('0x3e')]['includeAll']){_0x6763f['include']=[{'all':!![]}];}return db[_0xe4c9('0x4d')]['findAll'](_0x6763f);})[_0xe4c9('0x20')](function(_0x3b157a){_0x4c4363[_0xe4c9('0x4e')]=_0x3b157a;return _0x4c4363;})[_0xe4c9('0x20')](respondWithFilteredResult(_0x10ddf3,_0x6763f))[_0xe4c9('0x2a')](handleError(_0x10ddf3,null));};exports[_0xe4c9('0x4f')]=function(_0x454b2f,_0x354ff3){var _0x175e55={'raw':![],'where':{'id':_0x454b2f[_0xe4c9('0x50')]['id']}},_0x4095f7={};_0x4095f7[_0xe4c9('0x3c')]=_[_0xe4c9('0x51')](db[_0xe4c9('0x4d')][_0xe4c9('0x38')]);_0x4095f7['query']=_[_0xe4c9('0x51')](_0x454b2f[_0xe4c9('0x3e')]);_0x4095f7[_0xe4c9('0x3f')]=_[_0xe4c9('0x40')](_0x4095f7['model'],_0x4095f7[_0xe4c9('0x3e')]);_0x175e55[_0xe4c9('0x42')]=_[_0xe4c9('0x40')](_0x4095f7[_0xe4c9('0x3c')],qs[_0xe4c9('0x41')](_0x454b2f['query']['fields']));_0x175e55[_0xe4c9('0x42')]=_0x175e55[_0xe4c9('0x42')][_0xe4c9('0x52')]?_0x175e55[_0xe4c9('0x42')]:_0x4095f7[_0xe4c9('0x3c')];if(_0x454b2f[_0xe4c9('0x3e')][_0xe4c9('0x53')]){_0x175e55[_0xe4c9('0x54')]=[{'all':!![]}];}_0x175e55=_[_0xe4c9('0x4a')]({},_0x175e55,_0x454b2f[_0xe4c9('0x4c')]);return db[_0xe4c9('0x4d')][_0xe4c9('0x55')](_0x175e55)['then'](handleEntityNotFound(_0x354ff3,null))[_0xe4c9('0x20')](respondWithResult(_0x354ff3,null))[_0xe4c9('0x2a')](handleError(_0x354ff3,null));};exports[_0xe4c9('0x56')]=function(_0x5e00c7,_0x4bc340){return db[_0xe4c9('0x4d')][_0xe4c9('0x56')](_0x5e00c7[_0xe4c9('0x57')],{})[_0xe4c9('0x20')](respondWithResult(_0x4bc340,0xc9))['catch'](handleError(_0x4bc340,null));};exports[_0xe4c9('0x58')]=function(_0x304b94,_0x48ea1c){if(_0x304b94['body']['id']){delete _0x304b94[_0xe4c9('0x57')]['id'];}return db[_0xe4c9('0x4d')]['find']({'where':{'id':_0x304b94[_0xe4c9('0x50')]['id']}})[_0xe4c9('0x20')](handleEntityNotFound(_0x48ea1c,null))['then'](saveUpdates(_0x304b94['body'],null))[_0xe4c9('0x20')](respondWithResult(_0x48ea1c,null))['catch'](handleError(_0x48ea1c,null));};exports[_0xe4c9('0x33')]=function(_0x91e6af,_0x59a17a){return db[_0xe4c9('0x4d')]['find']({'where':{'id':_0x91e6af['params']['id']}})[_0xe4c9('0x20')](handleEntityNotFound(_0x59a17a,null))[_0xe4c9('0x20')](removeEntity(_0x59a17a,null))[_0xe4c9('0x2a')](handleError(_0x59a17a,null));};exports[_0xe4c9('0x59')]=function(_0x5997d3,_0x49f6e9,_0x570f0c){var _0x4f29b8={};var _0x34680f={};var _0x97e2fd;var _0x32c3e6;return db[_0xe4c9('0x4d')][_0xe4c9('0x5a')]({'where':{'id':_0x5997d3['params']['id']}})[_0xe4c9('0x20')](handleEntityNotFound(_0x49f6e9,null))[_0xe4c9('0x20')](function(_0x4342b0){if(_0x4342b0){_0x97e2fd=_0x4342b0;_0x34680f[_0xe4c9('0x3c')]=_[_0xe4c9('0x51')](db[_0xe4c9('0x5b')]['rawAttributes']);_0x34680f[_0xe4c9('0x3e')]=_[_0xe4c9('0x51')](_0x5997d3[_0xe4c9('0x3e')]);_0x34680f[_0xe4c9('0x3f')]=_['intersection'](_0x34680f['model'],_0x34680f['query']);_0x4f29b8[_0xe4c9('0x42')]=_[_0xe4c9('0x40')](_0x34680f[_0xe4c9('0x3c')],qs[_0xe4c9('0x41')](_0x5997d3['query'][_0xe4c9('0x41')]));_0x4f29b8[_0xe4c9('0x42')]=_0x4f29b8['attributes'][_0xe4c9('0x52')]?_0x4f29b8[_0xe4c9('0x42')]:_0x34680f['model'];_0x4f29b8[_0xe4c9('0x5c')]=qs[_0xe4c9('0x46')](_0x5997d3['query']['sort']);_0x4f29b8[_0xe4c9('0x47')]=qs[_0xe4c9('0x3f')](_[_0xe4c9('0x48')](_0x5997d3[_0xe4c9('0x3e')],_0x34680f[_0xe4c9('0x3f')]));if(_0x5997d3[_0xe4c9('0x3e')][_0xe4c9('0x49')]){_0x4f29b8[_0xe4c9('0x47')]=_[_0xe4c9('0x4a')](_0x4f29b8[_0xe4c9('0x47')],{'$or':_[_0xe4c9('0x37')](_0x4f29b8['attributes'],function(_0x170fa0){var _0x18ccb2={};_0x18ccb2[_0x170fa0]={'$like':'%'+_0x5997d3['query']['filter']+'%'};return _0x18ccb2;})});}_0x4f29b8=_[_0xe4c9('0x4a')]({},_0x4f29b8,_0x5997d3[_0xe4c9('0x4c')]);return _0x97e2fd[_0xe4c9('0x59')](_0x4f29b8);}})[_0xe4c9('0x20')](function(_0x5c28f7){if(_0x5c28f7){_0x32c3e6=_0x5c28f7[_0xe4c9('0x52')];if(!_0x5997d3[_0xe4c9('0x3e')]['hasOwnProperty']('nolimit')){_0x4f29b8[_0xe4c9('0x2f')]=qs[_0xe4c9('0x2f')](_0x5997d3[_0xe4c9('0x3e')][_0xe4c9('0x2f')]);_0x4f29b8['offset']=qs['offset'](_0x5997d3[_0xe4c9('0x3e')][_0xe4c9('0x45')]);}return _0x97e2fd[_0xe4c9('0x59')](_0x4f29b8);}})['then'](function(_0x130810){if(_0x130810){return _0x130810?{'count':_0x32c3e6,'rows':_0x130810}:null;}})[_0xe4c9('0x20')](respondWithResult(_0x49f6e9,null))[_0xe4c9('0x2a')](handleError(_0x49f6e9,null));};exports[_0xe4c9('0x5d')]=function(_0x4d063d,_0x276f1d,_0x358ce5){if(_0x4d063d['body']['id']){delete _0x4d063d['body']['id'];}return db['VtigerAccount']['findOne']({'where':{'id':_0x4d063d[_0xe4c9('0x50')]['id']}})[_0xe4c9('0x20')](handleEntityNotFound(_0x276f1d,null))[_0xe4c9('0x20')](function(_0x2613c5){if(_0x2613c5){_0x4d063d[_0xe4c9('0x57')][_0xe4c9('0x5e')]=_0x2613c5['id'];_0x4d063d[_0xe4c9('0x57')][_0xe4c9('0x5f')]=integrations[_0xe4c9('0x60')](_0x4d063d[_0xe4c9('0x57')][_0xe4c9('0x61')],_0x4d063d['body']['type']);_0x4d063d[_0xe4c9('0x57')]['Descriptions']=integrations[_0xe4c9('0x62')](_0x4d063d['body'][_0xe4c9('0x61')],_0x4d063d[_0xe4c9('0x57')][_0xe4c9('0x3a')]);return db[_0xe4c9('0x5b')]['create'](_0x4d063d[_0xe4c9('0x57')],{'include':[{'model':db[_0xe4c9('0x63')],'as':_0xe4c9('0x5f')},{'model':db[_0xe4c9('0x63')],'as':_0xe4c9('0x64')}]});}return null;})[_0xe4c9('0x20')](respondWithResult(_0x276f1d,null))['catch'](handleError(_0x276f1d,null));};var md5=require(_0xe4c9('0x65'));exports[_0xe4c9('0x66')]=function(_0x2e3c21,_0x3896e6,_0x11efed){var _0x89e00c=null;var _0x4881e5=null;var _0x1fdb9f=null;var _0x49a8ac=null;var _0x45a14f='';return db[_0xe4c9('0x4d')][_0xe4c9('0x5a')]({'where':{'id':_0x2e3c21['params']['id']},'attributes':['id',_0xe4c9('0x3d'),'username',_0xe4c9('0x67'),_0xe4c9('0x68'),'remoteUri',_0xe4c9('0x69'),_0xe4c9('0x6a')]})[_0xe4c9('0x20')](handleEntityNotFound(_0x3896e6,null))[_0xe4c9('0x20')](function(_0x18fa6e){if(_0x18fa6e){_0x89e00c=_0x18fa6e['username'];_0x4881e5=_0x18fa6e['accessKey'];_0x1fdb9f=_0x18fa6e[_0xe4c9('0x68')];_0x45a14f=_0x18fa6e['remoteUri'];var _0x9cb53d=_0x45a14f['slice'](-0x1);if(_0x9cb53d==='/'){_0x45a14f=_0x45a14f[_0xe4c9('0x6b')](0x0,_0x45a14f[_0xe4c9('0x6c')](_0x9cb53d));}_0x49a8ac=util['format'](_0xe4c9('0x6d'),_0x45a14f);var _0x401f23={'method':'GET','uri':_0x49a8ac,'qs':{'operation':_0xe4c9('0x6e'),'username':_0x18fa6e['username']},'json':!![]};return rp(_0x401f23);}})['then'](function(_0x2195f9){if(_0x2195f9[_0xe4c9('0x6f')]){var _0xbdadbd={'method':_0xe4c9('0x70'),'uri':_0x49a8ac,'form':{'operation':_0xe4c9('0x71'),'username':_0x89e00c,'accessKey':md5(_0x2195f9[_0xe4c9('0x29')][_0xe4c9('0x72')]+_0x4881e5)},'json':!![]};return rp(_0xbdadbd);}})['then'](function(_0x1d9191){if(_0x1d9191['success']){var _0x251ef2={'method':_0xe4c9('0x73'),'uri':_0x49a8ac,'qs':{'operation':_0xe4c9('0x74'),'username':_0x89e00c,'sessionName':_0x1d9191[_0xe4c9('0x29')][_0xe4c9('0x75')],'elementType':_0x1fdb9f},'json':!![]};return rp(_0x251ef2);}})[_0xe4c9('0x20')](function(_0x464f67){if(_0x464f67[_0xe4c9('0x6f')]){var _0x33b226=[_0xe4c9('0x76'),_0xe4c9('0x77'),_0xe4c9('0x78')];_[_0xe4c9('0x79')](_0x464f67[_0xe4c9('0x29')]['fields'],function(_0x4f161f){return _0x33b226[_0xe4c9('0x7a')](_0x4f161f[_0xe4c9('0x3a')][_0xe4c9('0x3d')]);});_[_0xe4c9('0x79')](_0x464f67[_0xe4c9('0x29')][_0xe4c9('0x41')],function(_0x31c5dc){return _0x31c5dc[_0xe4c9('0x7b')]===_0xe4c9('0x7c');});return{'count':_0x464f67[_0xe4c9('0x29')][_0xe4c9('0x41')]['length'],'rows':_[_0xe4c9('0x37')](_0x464f67['result'][_0xe4c9('0x41')],function(_0x53a058){return{'id':_0x53a058[_0xe4c9('0x3d')],'name':_0x53a058['label'],'custom':_['startsWith'](_0x53a058['name'],_0xe4c9('0x7d'))?!![]:![],'options':_0x53a058['type'][_0xe4c9('0x3d')]===_0xe4c9('0x7e')&&_0x53a058[_0xe4c9('0x3a')]['picklistValues'][_0xe4c9('0x52')]>0x0?_[_0xe4c9('0x37')](_0x53a058['type']['picklistValues'],function(_0x3e3f9e){return{'name':_0x3e3f9e[_0xe4c9('0x7f')],'value':_0x3e3f9e['value']};}):[]};})};}})['then'](respondWithResult(_0x3896e6,null))[_0xe4c9('0x2a')](function(_0x3076b0){console[_0xe4c9('0x80')](_0xe4c9('0x81')+_0x3076b0);var _0x144e11=_0x2e3c21[_0xe4c9('0x3e')][_0xe4c9('0x1c')]?0x1f4:_0x3076b0[_0xe4c9('0x82')]||0x1f4;logger[_0xe4c9('0x25')]('getFields,\x20%s,\x20%s,\x20%s',_0xe4c9('0x66'),_0x144e11,JSON[_0xe4c9('0x24')](_0x3076b0));delete _0x3076b0[_0xe4c9('0x3d')];if(_0x144e11===0x191){_0x144e11=0x190;}_0x3896e6['status'](_0x144e11)[_0xe4c9('0x35')](_0x2e3c21[_0xe4c9('0x3e')][_0xe4c9('0x1c')]?{'message':'Wrong\x20credentials','statusCode':_0x3076b0[_0xe4c9('0x82')]}:_0x3076b0);});};
\ No newline at end of file
diff --git a/server/api/intVtigerAccount/intVtigerAccount.model.js b/server/api/intVtigerAccount/intVtigerAccount.model.js
index 4927916..f8dd6b6 100644
--- a/server/api/intVtigerAccount/intVtigerAccount.model.js
+++ b/server/api/intVtigerAccount/intVtigerAccount.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xac90=['lodash','util','../../config/logger','api','path','rimraf','./intVtigerAccount.attributes','../../components/integrations/configuration','exports','define','VtigerAccount','int_vtiger_accounts'];(function(_0x57a1e9,_0x59aeae){var _0x2acbec=function(_0x53f7d7){while(--_0x53f7d7){_0x57a1e9['push'](_0x57a1e9['shift']());}};_0x2acbec(++_0x59aeae);}(_0xac90,0x9c));var _0x0ac9=function(_0x489cb1,_0x41c67d){_0x489cb1=_0x489cb1-0x0;var _0x494a6b=_0xac90[_0x489cb1];return _0x494a6b;};'use strict';var _=require(_0x0ac9('0x0'));var util=require(_0x0ac9('0x1'));var logger=require(_0x0ac9('0x2'))(_0x0ac9('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x0ac9('0x4'));var rimraf=require(_0x0ac9('0x5'));var config=require('../../config/environment');var attributes=require(_0x0ac9('0x6'));var integrations=require(_0x0ac9('0x7'));module[_0x0ac9('0x8')]=function(_0x287af1,_0x1ea687){return _0x287af1[_0x0ac9('0x9')](_0x0ac9('0xa'),attributes,{'tableName':_0x0ac9('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xf3fa=['request-promise','rimraf','../../config/environment','./intVtigerAccount.attributes','define','int_vtiger_accounts','lodash','util','api'];(function(_0x5d67c7,_0x52f115){var _0x54401f=function(_0x237077){while(--_0x237077){_0x5d67c7['push'](_0x5d67c7['shift']());}};_0x54401f(++_0x52f115);}(_0xf3fa,0x8d));var _0xaf3f=function(_0x51c39f,_0x5bfb0b){_0x51c39f=_0x51c39f-0x0;var _0x274221=_0xf3fa[_0x51c39f];return _0x274221;};'use strict';var _=require(_0xaf3f('0x0'));var util=require(_0xaf3f('0x1'));var logger=require('../../config/logger')(_0xaf3f('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xaf3f('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xaf3f('0x4'));var config=require(_0xaf3f('0x5'));var attributes=require(_0xaf3f('0x6'));var integrations=require('../../components/integrations/configuration');module['exports']=function(_0x274f51,_0xff7d2b){return _0x274f51[_0xaf3f('0x7')]('VtigerAccount',attributes,{'tableName':_0xaf3f('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/intVtigerAccount/intVtigerAccount.rpc.js b/server/api/intVtigerAccount/intVtigerAccount.rpc.js
index 6746094..d6f3664 100644
--- a/server/api/intVtigerAccount/intVtigerAccount.rpc.js
+++ b/server/api/intVtigerAccount/intVtigerAccount.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x537f=['VtigerAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','VtigerAccount','options','raw','limit','include','map','model','attributes','GetVtigerAccount','find','where','ShowVtigerAccount','util','moment','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request','then','info','VtigerAccount,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x5f55c6,_0x2f3797){var _0x56605d=function(_0x3de233){while(--_0x3de233){_0x5f55c6['push'](_0x5f55c6['shift']());}};_0x56605d(++_0x2f3797);}(_0x537f,0x1e0));var _0xf537=function(_0x52e876,_0x390b3b){_0x52e876=_0x52e876-0x0;var _0x579b98=_0x537f[_0x52e876];return _0x579b98;};'use strict';var _=require('lodash');var util=require(_0xf537('0x0'));var moment=require(_0xf537('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf537('0x2'));var db=require(_0xf537('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xf537('0x4'))(_0xf537('0x5'));var config=require(_0xf537('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xf537('0x7')][_0xf537('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x55891e,_0x30387a,_0xa19af0){return new BPromise(function(_0x4de4a4,_0x550cc8){return client[_0xf537('0x9')](_0x55891e,_0xa19af0)[_0xf537('0xa')](function(_0x76b370){logger[_0xf537('0xb')](_0xf537('0xc'),_0x30387a,_0xf537('0xd'));logger[_0xf537('0xe')](_0xf537('0xf'),_0x30387a,_0xf537('0xd'),JSON[_0xf537('0x10')](_0x76b370));if(_0x76b370[_0xf537('0x11')]){if(_0x76b370[_0xf537('0x11')][_0xf537('0x12')]===0x1f4){logger[_0xf537('0x11')](_0xf537('0xc'),_0x30387a,_0x76b370[_0xf537('0x11')]['message']);return _0x550cc8(_0x76b370[_0xf537('0x11')][_0xf537('0x13')]);}logger[_0xf537('0x11')]('VtigerAccount,\x20%s,\x20%s',_0x30387a,_0x76b370['error'][_0xf537('0x13')]);return _0x4de4a4(_0x76b370[_0xf537('0x11')][_0xf537('0x13')]);}else{logger['info'](_0xf537('0xc'),_0x30387a,_0xf537('0xd'));_0x4de4a4(_0x76b370['result'][_0xf537('0x13')]);}})[_0xf537('0x14')](function(_0x1d048a){logger[_0xf537('0x11')]('VtigerAccount,\x20%s,\x20%s',_0x30387a,_0x1d048a);_0x550cc8(_0x1d048a);});});}exports['GetVtigerAccount']=function(_0x313d96){var _0x569db1=this;return new Promise(function(_0xbcc6f3,_0x381bf7){return db[_0xf537('0x15')]['findAll']({'raw':_0x313d96[_0xf537('0x16')]?_0x313d96[_0xf537('0x16')][_0xf537('0x17')]===undefined?!![]:![]:!![],'where':_0x313d96[_0xf537('0x16')]?_0x313d96[_0xf537('0x16')]['where']||null:null,'attributes':_0x313d96[_0xf537('0x16')]?_0x313d96[_0xf537('0x16')]['attributes']||null:null,'limit':_0x313d96['options']?_0x313d96[_0xf537('0x16')][_0xf537('0x18')]||null:null,'include':_0x313d96[_0xf537('0x16')]?_0x313d96[_0xf537('0x16')][_0xf537('0x19')]?_[_0xf537('0x1a')](_0x313d96[_0xf537('0x16')][_0xf537('0x19')],function(_0x1e4bf9){return{'model':db[_0x1e4bf9['model']],'as':_0x1e4bf9['as'],'attributes':_0x1e4bf9['attributes'],'include':_0x1e4bf9[_0xf537('0x19')]?_['map'](_0x1e4bf9[_0xf537('0x19')],function(_0x1188eb){return{'model':db[_0x1188eb[_0xf537('0x1b')]],'as':_0x1188eb['as'],'attributes':_0x1188eb[_0xf537('0x1c')],'include':_0x1188eb[_0xf537('0x19')]?_['map'](_0x1188eb[_0xf537('0x19')],function(_0x288cf0){return{'model':db[_0x288cf0[_0xf537('0x1b')]],'as':_0x288cf0['as'],'attributes':_0x288cf0[_0xf537('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xf537('0xa')](function(_0x3c8470){logger[_0xf537('0xb')]('GetVtigerAccount',_0x313d96);logger['debug'](_0xf537('0x1d'),_0x313d96,JSON[_0xf537('0x10')](_0x3c8470));_0xbcc6f3(_0x3c8470);})['catch'](function(_0x104a17){logger[_0xf537('0x11')]('GetVtigerAccount',_0x104a17[_0xf537('0x13')],_0x313d96);_0x381bf7(_0x569db1['error'](0x1f4,_0x104a17['message']));});});};exports['ShowVtigerAccount']=function(_0x3653c7){var _0x4a272f=this;return new Promise(function(_0x4a3182,_0xa5ae8c){return db['VtigerAccount'][_0xf537('0x1e')]({'raw':_0x3653c7[_0xf537('0x16')]?_0x3653c7['options'][_0xf537('0x17')]===undefined?!![]:![]:!![],'where':_0x3653c7[_0xf537('0x16')]?_0x3653c7['options'][_0xf537('0x1f')]||null:null,'attributes':_0x3653c7[_0xf537('0x16')]?_0x3653c7[_0xf537('0x16')][_0xf537('0x1c')]||null:null,'include':_0x3653c7['options']?_0x3653c7['options'][_0xf537('0x19')]?_['map'](_0x3653c7['options'][_0xf537('0x19')],function(_0x56f787){return{'model':db[_0x56f787[_0xf537('0x1b')]],'as':_0x56f787['as'],'attributes':_0x56f787['attributes'],'include':_0x56f787[_0xf537('0x19')]?_[_0xf537('0x1a')](_0x56f787['include'],function(_0x663b24){return{'model':db[_0x663b24[_0xf537('0x1b')]],'as':_0x663b24['as'],'attributes':_0x663b24[_0xf537('0x1c')],'include':_0x663b24['include']?_[_0xf537('0x1a')](_0x663b24[_0xf537('0x19')],function(_0x4d6292){return{'model':db[_0x4d6292[_0xf537('0x1b')]],'as':_0x4d6292['as'],'attributes':_0x4d6292[_0xf537('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xf537('0xa')](function(_0x5b5d37){logger['info'](_0xf537('0x20'),_0x3653c7);logger['debug'](_0xf537('0x20'),_0x3653c7,JSON[_0xf537('0x10')](_0x5b5d37));_0x4a3182(_0x5b5d37);})[_0xf537('0x14')](function(_0x5ae589){logger[_0xf537('0x11')]('ShowVtigerAccount',_0x5ae589['message'],_0x3653c7);_0xa5ae8c(_0x4a272f[_0xf537('0x11')](0x1f4,_0x5ae589[_0xf537('0x13')]));});});};
\ No newline at end of file
+var _0x731e=['error','code','message','findAll','options','raw','where','limit','include','map','model','attributes','GetVtigerAccount','debug','ShowVtigerAccount','VtigerAccount','find','catch','lodash','util','bluebird','../../mysqldb','../../config/utils','rpc','http','then','info','VtigerAccount,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x1f8974,_0x1cf003){var _0x28a046=function(_0x1edabd){while(--_0x1edabd){_0x1f8974['push'](_0x1f8974['shift']());}};_0x28a046(++_0x1cf003);}(_0x731e,0x198));var _0xe731=function(_0x3e0c78,_0x347a58){_0x3e0c78=_0x3e0c78-0x0;var _0x201901=_0x731e[_0x3e0c78];return _0x201901;};'use strict';var _=require(_0xe731('0x0'));var util=require(_0xe731('0x1'));var moment=require('moment');var BPromise=require(_0xe731('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe731('0x3'))['db'];var utils=require(_0xe731('0x4'));var logger=require('../../config/logger')(_0xe731('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0xe731('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x1b3d6f,_0x13ea51,_0x15a287){return new BPromise(function(_0x31fe18,_0x36cbdf){return client['request'](_0x1b3d6f,_0x15a287)[_0xe731('0x7')](function(_0x47a98b){logger[_0xe731('0x8')](_0xe731('0x9'),_0x13ea51,_0xe731('0xa'));logger['debug']('VtigerAccount,\x20%s,\x20%s,\x20%s',_0x13ea51,_0xe731('0xa'),JSON[_0xe731('0xb')](_0x47a98b));if(_0x47a98b[_0xe731('0xc')]){if(_0x47a98b[_0xe731('0xc')][_0xe731('0xd')]===0x1f4){logger[_0xe731('0xc')]('VtigerAccount,\x20%s,\x20%s',_0x13ea51,_0x47a98b[_0xe731('0xc')][_0xe731('0xe')]);return _0x36cbdf(_0x47a98b[_0xe731('0xc')][_0xe731('0xe')]);}logger[_0xe731('0xc')](_0xe731('0x9'),_0x13ea51,_0x47a98b[_0xe731('0xc')][_0xe731('0xe')]);return _0x31fe18(_0x47a98b[_0xe731('0xc')][_0xe731('0xe')]);}else{logger['info']('VtigerAccount,\x20%s,\x20%s',_0x13ea51,'request\x20sent');_0x31fe18(_0x47a98b['result'][_0xe731('0xe')]);}})['catch'](function(_0x2743e2){logger[_0xe731('0xc')](_0xe731('0x9'),_0x13ea51,_0x2743e2);_0x36cbdf(_0x2743e2);});});}exports['GetVtigerAccount']=function(_0x5e166f){var _0x5f1969=this;return new Promise(function(_0x45b7a4,_0x598a02){return db['VtigerAccount'][_0xe731('0xf')]({'raw':_0x5e166f[_0xe731('0x10')]?_0x5e166f[_0xe731('0x10')][_0xe731('0x11')]===undefined?!![]:![]:!![],'where':_0x5e166f[_0xe731('0x10')]?_0x5e166f['options'][_0xe731('0x12')]||null:null,'attributes':_0x5e166f[_0xe731('0x10')]?_0x5e166f[_0xe731('0x10')]['attributes']||null:null,'limit':_0x5e166f['options']?_0x5e166f['options'][_0xe731('0x13')]||null:null,'include':_0x5e166f['options']?_0x5e166f[_0xe731('0x10')][_0xe731('0x14')]?_[_0xe731('0x15')](_0x5e166f[_0xe731('0x10')][_0xe731('0x14')],function(_0x3e5693){return{'model':db[_0x3e5693[_0xe731('0x16')]],'as':_0x3e5693['as'],'attributes':_0x3e5693['attributes'],'include':_0x3e5693[_0xe731('0x14')]?_[_0xe731('0x15')](_0x3e5693[_0xe731('0x14')],function(_0x35b875){return{'model':db[_0x35b875['model']],'as':_0x35b875['as'],'attributes':_0x35b875['attributes'],'include':_0x35b875[_0xe731('0x14')]?_['map'](_0x35b875[_0xe731('0x14')],function(_0x351c20){return{'model':db[_0x351c20['model']],'as':_0x351c20['as'],'attributes':_0x351c20[_0xe731('0x17')]};}):[]};}):[]};}):[]:[]})[_0xe731('0x7')](function(_0xae06bb){logger[_0xe731('0x8')](_0xe731('0x18'),_0x5e166f);logger[_0xe731('0x19')](_0xe731('0x18'),_0x5e166f,JSON[_0xe731('0xb')](_0xae06bb));_0x45b7a4(_0xae06bb);})['catch'](function(_0x5c23ad){logger[_0xe731('0xc')]('GetVtigerAccount',_0x5c23ad[_0xe731('0xe')],_0x5e166f);_0x598a02(_0x5f1969[_0xe731('0xc')](0x1f4,_0x5c23ad[_0xe731('0xe')]));});});};exports[_0xe731('0x1a')]=function(_0x5607fa){var _0x478c06=this;return new Promise(function(_0x4129dd,_0x1d3ff8){return db[_0xe731('0x1b')][_0xe731('0x1c')]({'raw':_0x5607fa['options']?_0x5607fa[_0xe731('0x10')][_0xe731('0x11')]===undefined?!![]:![]:!![],'where':_0x5607fa['options']?_0x5607fa[_0xe731('0x10')][_0xe731('0x12')]||null:null,'attributes':_0x5607fa['options']?_0x5607fa[_0xe731('0x10')][_0xe731('0x17')]||null:null,'include':_0x5607fa[_0xe731('0x10')]?_0x5607fa[_0xe731('0x10')][_0xe731('0x14')]?_['map'](_0x5607fa['options'][_0xe731('0x14')],function(_0x10ba2d){return{'model':db[_0x10ba2d[_0xe731('0x16')]],'as':_0x10ba2d['as'],'attributes':_0x10ba2d['attributes'],'include':_0x10ba2d['include']?_['map'](_0x10ba2d[_0xe731('0x14')],function(_0x11b482){return{'model':db[_0x11b482['model']],'as':_0x11b482['as'],'attributes':_0x11b482['attributes'],'include':_0x11b482[_0xe731('0x14')]?_[_0xe731('0x15')](_0x11b482[_0xe731('0x14')],function(_0xc7bb69){return{'model':db[_0xc7bb69[_0xe731('0x16')]],'as':_0xc7bb69['as'],'attributes':_0xc7bb69[_0xe731('0x17')]};}):[]};}):[]};}):[]:[]})[_0xe731('0x7')](function(_0x218d46){logger['info']('ShowVtigerAccount',_0x5607fa);logger[_0xe731('0x19')](_0xe731('0x1a'),_0x5607fa,JSON[_0xe731('0xb')](_0x218d46));_0x4129dd(_0x218d46);})[_0xe731('0x1d')](function(_0x54e502){logger[_0xe731('0xc')](_0xe731('0x1a'),_0x54e502[_0xe731('0xe')],_0x5607fa);_0x1d3ff8(_0x478c06[_0xe731('0xc')](0x1f4,_0x54e502[_0xe731('0xe')]));});});};
\ No newline at end of file
diff --git a/server/api/intVtigerConfiguration/index.js b/server/api/intVtigerConfiguration/index.js
index fa19436..ba5bfcb 100644
--- a/server/api/intVtigerConfiguration/index.js
+++ b/server/api/intVtigerConfiguration/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xd8b0=['isAuthenticated','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','create','put','update','delete','destroy','exports','multer','util','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intVtigerConfiguration.controller','index','get','/:id','show'];(function(_0x227c55,_0x49db56){var _0x49e02b=function(_0x5bdd70){while(--_0x5bdd70){_0x227c55['push'](_0x227c55['shift']());}};_0x49e02b(++_0x49db56);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var auth=require(_0x0d8b('0x3'));var interaction=require(_0x0d8b('0x4'));var config=require(_0x0d8b('0x5'));var controller=require(_0x0d8b('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0x0d8b('0x7')]);router[_0x0d8b('0x8')](_0x0d8b('0x9'),auth['isAuthenticated'](),controller[_0x0d8b('0xa')]);router[_0x0d8b('0x8')]('/:id/fields',auth[_0x0d8b('0xb')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0x8')](_0x0d8b('0xd'),auth[_0x0d8b('0xb')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0x8')](_0x0d8b('0xf'),auth['isAuthenticated'](),controller[_0x0d8b('0x10')]);router['post']('/',auth[_0x0d8b('0xb')](),controller[_0x0d8b('0x11')]);router[_0x0d8b('0x12')](_0x0d8b('0x9'),auth[_0x0d8b('0xb')](),controller[_0x0d8b('0x13')]);router[_0x0d8b('0x14')](_0x0d8b('0x9'),auth[_0x0d8b('0xb')](),controller[_0x0d8b('0x15')]);module[_0x0d8b('0x16')]=router;
\ No newline at end of file
+var _0x5f2f=['put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/:id','/:id/fields','/:id/subjects','getDescriptions','post','create'];(function(_0x1edbab,_0x1c9af3){var _0x57c56b=function(_0x3fc7dd){while(--_0x3fc7dd){_0x1edbab['push'](_0x1edbab['shift']());}};_0x57c56b(++_0x1c9af3);}(_0x5f2f,0x73));var _0xf5f2=function(_0x340a3b,_0x27b82a){_0x340a3b=_0x340a3b-0x0;var _0x5104b6=_0x5f2f[_0x340a3b];return _0x5104b6;};'use strict';var multer=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var path=require(_0xf5f2('0x2'));var timeout=require(_0xf5f2('0x3'));var express=require(_0xf5f2('0x4'));var router=express[_0xf5f2('0x5')]();var auth=require(_0xf5f2('0x6'));var interaction=require(_0xf5f2('0x7'));var config=require('../../config/environment');var controller=require('./intVtigerConfiguration.controller');router[_0xf5f2('0x8')]('/',auth[_0xf5f2('0x9')](),controller[_0xf5f2('0xa')]);router[_0xf5f2('0x8')](_0xf5f2('0xb'),auth[_0xf5f2('0x9')](),controller['show']);router[_0xf5f2('0x8')](_0xf5f2('0xc'),auth[_0xf5f2('0x9')](),controller['getFields']);router[_0xf5f2('0x8')](_0xf5f2('0xd'),auth[_0xf5f2('0x9')](),controller['getSubjects']);router[_0xf5f2('0x8')]('/:id/descriptions',auth['isAuthenticated'](),controller[_0xf5f2('0xe')]);router[_0xf5f2('0xf')]('/',auth['isAuthenticated'](),controller[_0xf5f2('0x10')]);router[_0xf5f2('0x11')](_0xf5f2('0xb'),auth[_0xf5f2('0x9')](),controller[_0xf5f2('0x12')]);router[_0xf5f2('0x13')]('/:id',auth[_0xf5f2('0x9')](),controller[_0xf5f2('0x14')]);module[_0xf5f2('0x15')]=router;
\ No newline at end of file
diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.attributes.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.attributes.js
index 5a20b4d..2c0cba8 100644
--- a/server/api/intVtigerConfiguration/intVtigerConfiguration.attributes.js
+++ b/server/api/intVtigerConfiguration/intVtigerConfiguration.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x1542=['STRING','sequelize','exports'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x1542,0x1d8));var _0x2154=function(_0x76e00d,_0x551f77){_0x76e00d=_0x76e00d-0x0;var _0x32e584=_0x1542[_0x76e00d];return _0x32e584;};'use strict';var Sequelize=require(_0x2154('0x0'));module[_0x2154('0x1')]={'name':{'type':Sequelize[_0x2154('0x2')]},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x80cd=['exports','STRING','sequelize'];(function(_0x36efe1,_0x10ca5b){var _0x3127c3=function(_0x52c7b){while(--_0x52c7b){_0x36efe1['push'](_0x36efe1['shift']());}};_0x3127c3(++_0x10ca5b);}(_0x80cd,0xfb));var _0xd80c=function(_0x178668,_0x1ec300){_0x178668=_0x178668-0x0;var _0x26107d=_0x80cd[_0x178668];return _0x26107d;};'use strict';var Sequelize=require(_0xd80c('0x0'));module[_0xd80c('0x1')]={'name':{'type':Sequelize[_0xd80c('0x2')]},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js
index f5d4442..3df242b 100644
--- a/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js
+++ b/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x92ca=['error','VtigerConfiguration,\x20%s,\x20%s','message','info','result','catch','status','end','json','count','offset','limit','set','Content-Range','reject','save','then','destroy','sendStatus','stack','name','send','map','VtigerConfiguration','type','key','query','keys','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','merge','includeAll','findAll','show','rawAttributes','include','options','find','create','body','update','params','findOne','VtigerField','getFields','getSubjects','getDescriptions','eml-format','rimraf','bluebird','mustache','util','path','sox','ejs','squel','crypto','jsforce','desk.js','to-csv','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','jayson/promise','client','http','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','request\x20sent','debug','VtigerConfiguration,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x3a2118,_0x31fc3c){var _0x1d181d=function(_0x26a734){while(--_0x26a734){_0x3a2118['push'](_0x3a2118['shift']());}};_0x1d181d(++_0x31fc3c);}(_0x92ca,0x95));var _0xa92c=function(_0x62c286,_0x8afc5f){_0x62c286=_0x62c286-0x0;var _0x446c09=_0x92ca[_0x62c286];return _0x446c09;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xa92c('0x0'));var rimraf=require(_0xa92c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xa92c('0x2'));var Mustache=require(_0xa92c('0x3'));var util=require(_0xa92c('0x4'));var path=require(_0xa92c('0x5'));var sox=require(_0xa92c('0x6'));var csv=require('to-csv');var ejs=require(_0xa92c('0x7'));var fs=require('fs');var _=require('lodash');var squel=require(_0xa92c('0x8'));var crypto=require(_0xa92c('0x9'));var jsforce=require(_0xa92c('0xa'));var deskjs=require(_0xa92c('0xb'));var toCsv=require(_0xa92c('0xc'));var querystring=require('querystring');var Papa=require(_0xa92c('0xd'));var Redis=require('ioredis');var authService=require(_0xa92c('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0xa92c('0xf'));var hardwareService=require(_0xa92c('0x10'));var logger=require(_0xa92c('0x11'))(_0xa92c('0x12'));var utils=require(_0xa92c('0x13'));var config=require('../../config/environment');var db=require(_0xa92c('0x14'))['db'];var jayson=require(_0xa92c('0x15'));var client=jayson[_0xa92c('0x16')][_0xa92c('0x17')]({'port':0x232a});function checkPasswordPattern(_0x586eb8,_0x3157f9,_0x438d7a){if(_0x438d7a){var _0x135f1c=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x135f1c[_0xa92c('0x18')](_0x3157f9)){return _0x586eb8;}else{throw new db[(_0xa92c('0x19'))][(_0xa92c('0x1a'))](_0xa92c('0x1b'));}}else{return _0x586eb8;}}function respondWithRpcPromise(_0x55842e,_0x2f0e79,_0x3b67e0,_0x38863b){return new BPromise(function(_0x3b6e2c,_0x114033){var _0x477403=_0x38863b||client;return _0x477403[_0xa92c('0x1c')](_0x55842e,_0x3b67e0)['then'](function(_0x574eec){logger['info']('VtigerConfiguration,\x20%s,\x20%s',_0x2f0e79,_0xa92c('0x1d'));logger[_0xa92c('0x1e')](_0xa92c('0x1f'),_0x2f0e79,_0xa92c('0x1d'),JSON[_0xa92c('0x20')](_0x574eec));if(_0x574eec[_0xa92c('0x21')]){if(_0x574eec['error']['code']===0x1f4){logger[_0xa92c('0x21')](_0xa92c('0x22'),_0x2f0e79,_0x574eec[_0xa92c('0x21')][_0xa92c('0x23')]);return _0x114033(_0x574eec[_0xa92c('0x21')][_0xa92c('0x23')]);}logger[_0xa92c('0x21')]('VtigerConfiguration,\x20%s,\x20%s',_0x2f0e79,_0x574eec[_0xa92c('0x21')][_0xa92c('0x23')]);return _0x3b6e2c(_0x574eec[_0xa92c('0x21')][_0xa92c('0x23')]);}else{logger[_0xa92c('0x24')](_0xa92c('0x22'),_0x2f0e79,'request\x20sent');_0x3b6e2c(_0x574eec[_0xa92c('0x25')][_0xa92c('0x23')]);}})[_0xa92c('0x26')](function(_0x12cc59){logger[_0xa92c('0x21')](_0xa92c('0x22'),_0x2f0e79,_0x12cc59);_0x114033(_0x12cc59);});});}function respondWithStatusCode(_0x4cd4cd,_0x268351){_0x268351=_0x268351||0xcc;return function(_0x41a11f){if(_0x41a11f){return _0x4cd4cd['sendStatus'](_0x268351);}return _0x4cd4cd[_0xa92c('0x27')](_0x268351)[_0xa92c('0x28')]();};}function respondWithResult(_0x5b5e7d,_0x5deb10){_0x5deb10=_0x5deb10||0xc8;return function(_0x4ef3ae){if(_0x4ef3ae){return _0x5b5e7d[_0xa92c('0x27')](_0x5deb10)[_0xa92c('0x29')](_0x4ef3ae);}};}function respondWithFilteredResult(_0xf4f308,_0x42ac13){return function(_0x834096){if(_0x834096){var _0x723963=_0x834096[_0xa92c('0x2a')],_0x35e0ad=_0x42ac13[_0xa92c('0x2b')],_0x408530=_0x42ac13[_0xa92c('0x2b')]+_0x42ac13[_0xa92c('0x2c')],_0x4063a3;if(_0x408530>=_0x723963){_0x408530=_0x723963;_0x4063a3=0xc8;}else{_0x4063a3=0xce;}_0xf4f308['status'](_0x4063a3);return _0xf4f308[_0xa92c('0x2d')](_0xa92c('0x2e'),_0x35e0ad+'-'+_0x408530+'/'+_0x723963)[_0xa92c('0x29')](_0x834096);}return null;};}function patchUpdates(_0x2adb3a){return function(_0x59122a){try{jsonpatch['apply'](_0x59122a,_0x2adb3a,!![]);}catch(_0x465dd3){return BPromise[_0xa92c('0x2f')](_0x465dd3);}return _0x59122a[_0xa92c('0x30')]();};}function saveUpdates(_0x1904ea,_0x3d57a2){return function(_0x1bb938){if(_0x1bb938){return _0x1bb938['update'](_0x1904ea)[_0xa92c('0x31')](function(_0x16fe01){return _0x16fe01;});}return null;};}function removeEntity(_0x2526e7,_0x42a2b4){return function(_0x40af76){if(_0x40af76){return _0x40af76[_0xa92c('0x32')]()['then'](function(){_0x2526e7['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x467d02,_0x2948e0){return function(_0x25a043){if(!_0x25a043){_0x467d02[_0xa92c('0x33')](0x194);}return _0x25a043;};}function handleError(_0x739dd9,_0x53d8fe){_0x53d8fe=_0x53d8fe||0x1f4;return function(_0x382f1e){logger[_0xa92c('0x21')](_0x382f1e[_0xa92c('0x34')]);if(_0x382f1e[_0xa92c('0x35')]){delete _0x382f1e[_0xa92c('0x35')];}_0x739dd9['status'](_0x53d8fe)[_0xa92c('0x36')](_0x382f1e);};}exports['index']=function(_0x27af36,_0xedaf1a){var _0x336588={},_0x56143c={},_0x49f20b={'count':0x0,'rows':[]};var _0x10362a=_[_0xa92c('0x37')](db[_0xa92c('0x38')]['rawAttributes'],function(_0x247c7e){return{'name':_0x247c7e['fieldName'],'type':_0x247c7e[_0xa92c('0x39')][_0xa92c('0x3a')]};});_0x56143c['model']=_[_0xa92c('0x37')](_0x10362a,'name');_0x56143c[_0xa92c('0x3b')]=_[_0xa92c('0x3c')](_0x27af36[_0xa92c('0x3b')]);_0x56143c['filters']=_[_0xa92c('0x3d')](_0x56143c[_0xa92c('0x3e')],_0x56143c[_0xa92c('0x3b')]);_0x336588['attributes']=_[_0xa92c('0x3d')](_0x56143c[_0xa92c('0x3e')],qs[_0xa92c('0x3f')](_0x27af36[_0xa92c('0x3b')]['fields']));_0x336588[_0xa92c('0x40')]=_0x336588['attributes'][_0xa92c('0x41')]?_0x336588['attributes']:_0x56143c[_0xa92c('0x3e')];if(!_0x27af36[_0xa92c('0x3b')][_0xa92c('0x42')](_0xa92c('0x43'))){_0x336588[_0xa92c('0x2c')]=qs[_0xa92c('0x2c')](_0x27af36['query'][_0xa92c('0x2c')]);_0x336588[_0xa92c('0x2b')]=qs[_0xa92c('0x2b')](_0x27af36[_0xa92c('0x3b')]['offset']);}_0x336588[_0xa92c('0x44')]=qs[_0xa92c('0x45')](_0x27af36[_0xa92c('0x3b')]['sort']);_0x336588['where']=qs[_0xa92c('0x46')](_[_0xa92c('0x47')](_0x27af36[_0xa92c('0x3b')],_0x56143c[_0xa92c('0x46')]),_0x10362a);if(_0x27af36[_0xa92c('0x3b')][_0xa92c('0x48')]){_0x336588[_0xa92c('0x49')]=_[_0xa92c('0x4a')](_0x336588[_0xa92c('0x49')],{'$or':_['map'](_0x10362a,function(_0xbc62ef){if(_0xbc62ef[_0xa92c('0x39')]!=='VIRTUAL'){var _0x50c468={};_0x50c468[_0xbc62ef['name']]={'$like':'%'+_0x27af36[_0xa92c('0x3b')][_0xa92c('0x48')]+'%'};return _0x50c468;}})});}_0x336588=_[_0xa92c('0x4a')]({},_0x336588,_0x27af36['options']);var _0x12d49f={'where':_0x336588[_0xa92c('0x49')]};return db['VtigerConfiguration'][_0xa92c('0x2a')](_0x12d49f)[_0xa92c('0x31')](function(_0x112282){_0x49f20b['count']=_0x112282;if(_0x27af36[_0xa92c('0x3b')][_0xa92c('0x4b')]){_0x336588['include']=[{'all':!![]}];}return db[_0xa92c('0x38')][_0xa92c('0x4c')](_0x336588);})[_0xa92c('0x31')](function(_0x3c0377){_0x49f20b['rows']=_0x3c0377;return _0x49f20b;})[_0xa92c('0x31')](respondWithFilteredResult(_0xedaf1a,_0x336588))[_0xa92c('0x26')](handleError(_0xedaf1a,null));};exports[_0xa92c('0x4d')]=function(_0xdd9591,_0x589692){var _0x45b710={'raw':![],'where':{'id':_0xdd9591['params']['id']}},_0x2e11af={};_0x2e11af[_0xa92c('0x3e')]=_[_0xa92c('0x3c')](db[_0xa92c('0x38')][_0xa92c('0x4e')]);_0x2e11af[_0xa92c('0x3b')]=_[_0xa92c('0x3c')](_0xdd9591[_0xa92c('0x3b')]);_0x2e11af['filters']=_['intersection'](_0x2e11af[_0xa92c('0x3e')],_0x2e11af[_0xa92c('0x3b')]);_0x45b710[_0xa92c('0x40')]=_[_0xa92c('0x3d')](_0x2e11af[_0xa92c('0x3e')],qs[_0xa92c('0x3f')](_0xdd9591[_0xa92c('0x3b')]['fields']));_0x45b710[_0xa92c('0x40')]=_0x45b710[_0xa92c('0x40')][_0xa92c('0x41')]?_0x45b710[_0xa92c('0x40')]:_0x2e11af[_0xa92c('0x3e')];if(_0xdd9591['query'][_0xa92c('0x4b')]){_0x45b710[_0xa92c('0x4f')]=[{'all':!![]}];}_0x45b710=_[_0xa92c('0x4a')]({},_0x45b710,_0xdd9591[_0xa92c('0x50')]);return db[_0xa92c('0x38')][_0xa92c('0x51')](_0x45b710)[_0xa92c('0x31')](handleEntityNotFound(_0x589692,null))['then'](respondWithResult(_0x589692,null))[_0xa92c('0x26')](handleError(_0x589692,null));};exports[_0xa92c('0x52')]=function(_0x3e4cba,_0x48ab0e){return db[_0xa92c('0x38')][_0xa92c('0x52')](_0x3e4cba[_0xa92c('0x53')],{})[_0xa92c('0x31')](respondWithResult(_0x48ab0e,0xc9))['catch'](handleError(_0x48ab0e,null));};exports[_0xa92c('0x54')]=function(_0x1eb1ed,_0x1fb424){if(_0x1eb1ed[_0xa92c('0x53')]['id']){delete _0x1eb1ed['body']['id'];}return db[_0xa92c('0x38')]['find']({'where':{'id':_0x1eb1ed[_0xa92c('0x55')]['id']}})['then'](handleEntityNotFound(_0x1fb424,null))['then'](saveUpdates(_0x1eb1ed[_0xa92c('0x53')],null))[_0xa92c('0x31')](respondWithResult(_0x1fb424,null))['catch'](handleError(_0x1fb424,null));};exports[_0xa92c('0x32')]=function(_0xd4b319,_0x301e37){return db[_0xa92c('0x38')]['find']({'where':{'id':_0xd4b319['params']['id']}})[_0xa92c('0x31')](handleEntityNotFound(_0x301e37,null))[_0xa92c('0x31')](removeEntity(_0x301e37,null))[_0xa92c('0x26')](handleError(_0x301e37,null));};exports['getFields']=function(_0x38e294,_0x52c6c8,_0x44cc93){var _0x4c8cb7={};var _0xc68314={};var _0x53b2df;var _0x560f7a;return db[_0xa92c('0x38')][_0xa92c('0x56')]({'where':{'id':_0x38e294[_0xa92c('0x55')]['id']}})[_0xa92c('0x31')](handleEntityNotFound(_0x52c6c8,null))[_0xa92c('0x31')](function(_0x227fc6){if(_0x227fc6){_0x53b2df=_0x227fc6;_0xc68314[_0xa92c('0x3e')]=_[_0xa92c('0x3c')](db[_0xa92c('0x57')][_0xa92c('0x4e')]);_0xc68314[_0xa92c('0x3b')]=_[_0xa92c('0x3c')](_0x38e294[_0xa92c('0x3b')]);_0xc68314[_0xa92c('0x46')]=_['intersection'](_0xc68314[_0xa92c('0x3e')],_0xc68314[_0xa92c('0x3b')]);_0x4c8cb7[_0xa92c('0x40')]=_[_0xa92c('0x3d')](_0xc68314[_0xa92c('0x3e')],qs[_0xa92c('0x3f')](_0x38e294[_0xa92c('0x3b')][_0xa92c('0x3f')]));_0x4c8cb7[_0xa92c('0x40')]=_0x4c8cb7[_0xa92c('0x40')]['length']?_0x4c8cb7[_0xa92c('0x40')]:_0xc68314[_0xa92c('0x3e')];_0x4c8cb7[_0xa92c('0x44')]=qs[_0xa92c('0x45')](_0x38e294['query'][_0xa92c('0x45')]);_0x4c8cb7[_0xa92c('0x49')]=qs[_0xa92c('0x46')](_['pick'](_0x38e294[_0xa92c('0x3b')],_0xc68314[_0xa92c('0x46')]));if(_0x38e294[_0xa92c('0x3b')]['filter']){_0x4c8cb7[_0xa92c('0x49')]=_[_0xa92c('0x4a')](_0x4c8cb7[_0xa92c('0x49')],{'$or':_[_0xa92c('0x37')](_0x4c8cb7[_0xa92c('0x40')],function(_0x5c11a7){var _0x4b0300={};_0x4b0300[_0x5c11a7]={'$like':'%'+_0x38e294['query'][_0xa92c('0x48')]+'%'};return _0x4b0300;})});}_0x4c8cb7=_[_0xa92c('0x4a')]({},_0x4c8cb7,_0x38e294[_0xa92c('0x50')]);return _0x53b2df[_0xa92c('0x58')](_0x4c8cb7);}})[_0xa92c('0x31')](function(_0x5619af){if(_0x5619af){_0x560f7a=_0x5619af['length'];if(!_0x38e294[_0xa92c('0x3b')][_0xa92c('0x42')]('nolimit')){_0x4c8cb7[_0xa92c('0x2c')]=qs['limit'](_0x38e294[_0xa92c('0x3b')]['limit']);_0x4c8cb7[_0xa92c('0x2b')]=qs[_0xa92c('0x2b')](_0x38e294[_0xa92c('0x3b')][_0xa92c('0x2b')]);}return _0x53b2df['getFields'](_0x4c8cb7);}})[_0xa92c('0x31')](function(_0x17d178){if(_0x17d178){return _0x17d178?{'count':_0x560f7a,'rows':_0x17d178}:null;}})[_0xa92c('0x31')](respondWithResult(_0x52c6c8,null))[_0xa92c('0x26')](handleError(_0x52c6c8,null));};exports['getSubjects']=function(_0x49a5c0,_0x11d557,_0x5d8075){var _0xd68ef3={};var _0x579aa2={};var _0x589c6f;var _0x123519;return db[_0xa92c('0x38')][_0xa92c('0x56')]({'where':{'id':_0x49a5c0['params']['id']}})[_0xa92c('0x31')](handleEntityNotFound(_0x11d557,null))['then'](function(_0x25d416){if(_0x25d416){_0x589c6f=_0x25d416;_0x579aa2[_0xa92c('0x3e')]=_[_0xa92c('0x3c')](db['VtigerField'][_0xa92c('0x4e')]);_0x579aa2[_0xa92c('0x3b')]=_[_0xa92c('0x3c')](_0x49a5c0[_0xa92c('0x3b')]);_0x579aa2[_0xa92c('0x46')]=_[_0xa92c('0x3d')](_0x579aa2['model'],_0x579aa2[_0xa92c('0x3b')]);_0xd68ef3[_0xa92c('0x40')]=_[_0xa92c('0x3d')](_0x579aa2[_0xa92c('0x3e')],qs[_0xa92c('0x3f')](_0x49a5c0[_0xa92c('0x3b')][_0xa92c('0x3f')]));_0xd68ef3[_0xa92c('0x40')]=_0xd68ef3['attributes'][_0xa92c('0x41')]?_0xd68ef3[_0xa92c('0x40')]:_0x579aa2[_0xa92c('0x3e')];_0xd68ef3['order']=qs[_0xa92c('0x45')](_0x49a5c0['query'][_0xa92c('0x45')]);_0xd68ef3[_0xa92c('0x49')]=qs[_0xa92c('0x46')](_[_0xa92c('0x47')](_0x49a5c0[_0xa92c('0x3b')],_0x579aa2[_0xa92c('0x46')]));if(_0x49a5c0[_0xa92c('0x3b')][_0xa92c('0x48')]){_0xd68ef3[_0xa92c('0x49')]=_[_0xa92c('0x4a')](_0xd68ef3[_0xa92c('0x49')],{'$or':_[_0xa92c('0x37')](_0xd68ef3[_0xa92c('0x40')],function(_0x196a3e){var _0x3c428a={};_0x3c428a[_0x196a3e]={'$like':'%'+_0x49a5c0[_0xa92c('0x3b')][_0xa92c('0x48')]+'%'};return _0x3c428a;})});}_0xd68ef3=_[_0xa92c('0x4a')]({},_0xd68ef3,_0x49a5c0[_0xa92c('0x50')]);return _0x589c6f[_0xa92c('0x59')](_0xd68ef3);}})[_0xa92c('0x31')](function(_0xfa4fab){if(_0xfa4fab){_0x123519=_0xfa4fab[_0xa92c('0x41')];if(!_0x49a5c0[_0xa92c('0x3b')][_0xa92c('0x42')](_0xa92c('0x43'))){_0xd68ef3['limit']=qs[_0xa92c('0x2c')](_0x49a5c0['query'][_0xa92c('0x2c')]);_0xd68ef3['offset']=qs[_0xa92c('0x2b')](_0x49a5c0[_0xa92c('0x3b')][_0xa92c('0x2b')]);}return _0x589c6f['getSubjects'](_0xd68ef3);}})[_0xa92c('0x31')](function(_0x1ee9c5){if(_0x1ee9c5){return _0x1ee9c5?{'count':_0x123519,'rows':_0x1ee9c5}:null;}})[_0xa92c('0x31')](respondWithResult(_0x11d557,null))[_0xa92c('0x26')](handleError(_0x11d557,null));};exports[_0xa92c('0x5a')]=function(_0x5cbfcb,_0x4231f5,_0x505db1){var _0x57b726={};var _0x4c5a7f={};var _0x3812ba;var _0x3ff67c;return db[_0xa92c('0x38')][_0xa92c('0x56')]({'where':{'id':_0x5cbfcb[_0xa92c('0x55')]['id']}})[_0xa92c('0x31')](handleEntityNotFound(_0x4231f5,null))[_0xa92c('0x31')](function(_0x4f4804){if(_0x4f4804){_0x3812ba=_0x4f4804;_0x4c5a7f['model']=_['keys'](db[_0xa92c('0x57')]['rawAttributes']);_0x4c5a7f[_0xa92c('0x3b')]=_[_0xa92c('0x3c')](_0x5cbfcb[_0xa92c('0x3b')]);_0x4c5a7f['filters']=_[_0xa92c('0x3d')](_0x4c5a7f[_0xa92c('0x3e')],_0x4c5a7f[_0xa92c('0x3b')]);_0x57b726[_0xa92c('0x40')]=_[_0xa92c('0x3d')](_0x4c5a7f['model'],qs[_0xa92c('0x3f')](_0x5cbfcb['query']['fields']));_0x57b726[_0xa92c('0x40')]=_0x57b726[_0xa92c('0x40')][_0xa92c('0x41')]?_0x57b726['attributes']:_0x4c5a7f[_0xa92c('0x3e')];_0x57b726['order']=qs[_0xa92c('0x45')](_0x5cbfcb['query'][_0xa92c('0x45')]);_0x57b726[_0xa92c('0x49')]=qs[_0xa92c('0x46')](_[_0xa92c('0x47')](_0x5cbfcb[_0xa92c('0x3b')],_0x4c5a7f['filters']));if(_0x5cbfcb[_0xa92c('0x3b')]['filter']){_0x57b726[_0xa92c('0x49')]=_['merge'](_0x57b726[_0xa92c('0x49')],{'$or':_['map'](_0x57b726[_0xa92c('0x40')],function(_0x312298){var _0x22d28a={};_0x22d28a[_0x312298]={'$like':'%'+_0x5cbfcb[_0xa92c('0x3b')][_0xa92c('0x48')]+'%'};return _0x22d28a;})});}_0x57b726=_[_0xa92c('0x4a')]({},_0x57b726,_0x5cbfcb['options']);return _0x3812ba[_0xa92c('0x5a')](_0x57b726);}})[_0xa92c('0x31')](function(_0x94edb5){if(_0x94edb5){_0x3ff67c=_0x94edb5[_0xa92c('0x41')];if(!_0x5cbfcb[_0xa92c('0x3b')][_0xa92c('0x42')]('nolimit')){_0x57b726['limit']=qs[_0xa92c('0x2c')](_0x5cbfcb[_0xa92c('0x3b')][_0xa92c('0x2c')]);_0x57b726['offset']=qs[_0xa92c('0x2b')](_0x5cbfcb[_0xa92c('0x3b')]['offset']);}return _0x3812ba['getDescriptions'](_0x57b726);}})['then'](function(_0x5d35bd){if(_0x5d35bd){return _0x5d35bd?{'count':_0x3ff67c,'rows':_0x5d35bd}:null;}})['then'](respondWithResult(_0x4231f5,null))['catch'](handleError(_0x4231f5,null));};
\ No newline at end of file
+var _0x5640=['info','VtigerConfiguration,\x20%s,\x20%s','request\x20sent','debug','VtigerConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','sendStatus','status','end','json','offset','limit','Content-Range','apply','reject','save','update','destroy','stack','send','index','map','VtigerConfiguration','rawAttributes','fieldName','type','key','model','name','query','keys','filters','fields','length','attributes','nolimit','order','sort','pick','where','merge','VIRTUAL','filter','options','count','includeAll','include','findAll','rows','params','create','body','find','VtigerField','intersection','hasOwnProperty','getFields','getSubjects','findOne','getDescriptions','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','client','test','Sequelize','request','then'];(function(_0x2aecb2,_0x343312){var _0x3ebb80=function(_0x19fab3){while(--_0x19fab3){_0x2aecb2['push'](_0x2aecb2['shift']());}};_0x3ebb80(++_0x343312);}(_0x5640,0x1b0));var _0x0564=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0x5640[_0x502c7d];return _0x30b7ed;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x0564('0x0'));var zipdir=require(_0x0564('0x1'));var jsonpatch=require(_0x0564('0x2'));var rp=require(_0x0564('0x3'));var moment=require(_0x0564('0x4'));var BPromise=require(_0x0564('0x5'));var Mustache=require('mustache');var util=require(_0x0564('0x6'));var path=require(_0x0564('0x7'));var sox=require('sox');var csv=require(_0x0564('0x8'));var ejs=require(_0x0564('0x9'));var fs=require('fs');var _=require(_0x0564('0xa'));var squel=require(_0x0564('0xb'));var crypto=require(_0x0564('0xc'));var jsforce=require(_0x0564('0xd'));var deskjs=require(_0x0564('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0564('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x0564('0x10'));var as=require(_0x0564('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x0564('0x12'))('api');var utils=require(_0x0564('0x13'));var config=require(_0x0564('0x14'));var db=require(_0x0564('0x15'))['db'];var jayson=require(_0x0564('0x16'));var client=jayson[_0x0564('0x17')]['http']({'port':0x232a});function checkPasswordPattern(_0x500322,_0x109e2e,_0x5d3012){if(_0x5d3012){var _0x5bfb77=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x5bfb77[_0x0564('0x18')](_0x109e2e)){return _0x500322;}else{throw new db[(_0x0564('0x19'))]['ValidationError']('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x500322;}}function respondWithRpcPromise(_0x4dbd81,_0x209cd4,_0xee21fc,_0x426a61){return new BPromise(function(_0xec3047,_0x3b911f){var _0x4d4ce6=_0x426a61||client;return _0x4d4ce6[_0x0564('0x1a')](_0x4dbd81,_0xee21fc)[_0x0564('0x1b')](function(_0x1e76d0){logger[_0x0564('0x1c')](_0x0564('0x1d'),_0x209cd4,_0x0564('0x1e'));logger[_0x0564('0x1f')](_0x0564('0x20'),_0x209cd4,_0x0564('0x1e'),JSON[_0x0564('0x21')](_0x1e76d0));if(_0x1e76d0[_0x0564('0x22')]){if(_0x1e76d0[_0x0564('0x22')][_0x0564('0x23')]===0x1f4){logger[_0x0564('0x22')]('VtigerConfiguration,\x20%s,\x20%s',_0x209cd4,_0x1e76d0[_0x0564('0x22')][_0x0564('0x24')]);return _0x3b911f(_0x1e76d0[_0x0564('0x22')]['message']);}logger[_0x0564('0x22')](_0x0564('0x1d'),_0x209cd4,_0x1e76d0[_0x0564('0x22')][_0x0564('0x24')]);return _0xec3047(_0x1e76d0['error'][_0x0564('0x24')]);}else{logger[_0x0564('0x1c')](_0x0564('0x1d'),_0x209cd4,_0x0564('0x1e'));_0xec3047(_0x1e76d0['result'][_0x0564('0x24')]);}})[_0x0564('0x25')](function(_0x2b316d){logger[_0x0564('0x22')](_0x0564('0x1d'),_0x209cd4,_0x2b316d);_0x3b911f(_0x2b316d);});});}function respondWithStatusCode(_0x122ef2,_0x1b01d7){_0x1b01d7=_0x1b01d7||0xcc;return function(_0x1449bb){if(_0x1449bb){return _0x122ef2[_0x0564('0x26')](_0x1b01d7);}return _0x122ef2[_0x0564('0x27')](_0x1b01d7)[_0x0564('0x28')]();};}function respondWithResult(_0x23eb4f,_0x1d723a){_0x1d723a=_0x1d723a||0xc8;return function(_0x96c7b5){if(_0x96c7b5){return _0x23eb4f[_0x0564('0x27')](_0x1d723a)[_0x0564('0x29')](_0x96c7b5);}};}function respondWithFilteredResult(_0x19e909,_0x110a90){return function(_0x9baea1){if(_0x9baea1){var _0x4af737=_0x9baea1['count'],_0x37eec3=_0x110a90[_0x0564('0x2a')],_0x165940=_0x110a90[_0x0564('0x2a')]+_0x110a90[_0x0564('0x2b')],_0x5e829a;if(_0x165940>=_0x4af737){_0x165940=_0x4af737;_0x5e829a=0xc8;}else{_0x5e829a=0xce;}_0x19e909[_0x0564('0x27')](_0x5e829a);return _0x19e909['set'](_0x0564('0x2c'),_0x37eec3+'-'+_0x165940+'/'+_0x4af737)['json'](_0x9baea1);}return null;};}function patchUpdates(_0x15a9b4){return function(_0x40a706){try{jsonpatch[_0x0564('0x2d')](_0x40a706,_0x15a9b4,!![]);}catch(_0x68996){return BPromise[_0x0564('0x2e')](_0x68996);}return _0x40a706[_0x0564('0x2f')]();};}function saveUpdates(_0x152d19,_0x2d273e){return function(_0x3bd300){if(_0x3bd300){return _0x3bd300[_0x0564('0x30')](_0x152d19)[_0x0564('0x1b')](function(_0xfa562a){return _0xfa562a;});}return null;};}function removeEntity(_0x5034d2,_0x555884){return function(_0x1f8ba7){if(_0x1f8ba7){return _0x1f8ba7[_0x0564('0x31')]()['then'](function(){_0x5034d2[_0x0564('0x27')](0xcc)[_0x0564('0x28')]();});}};}function handleEntityNotFound(_0x1a59be,_0x31520e){return function(_0x40c61f){if(!_0x40c61f){_0x1a59be[_0x0564('0x26')](0x194);}return _0x40c61f;};}function handleError(_0x68362f,_0x34d99c){_0x34d99c=_0x34d99c||0x1f4;return function(_0x4da183){logger[_0x0564('0x22')](_0x4da183[_0x0564('0x32')]);if(_0x4da183['name']){delete _0x4da183['name'];}_0x68362f[_0x0564('0x27')](_0x34d99c)[_0x0564('0x33')](_0x4da183);};}exports[_0x0564('0x34')]=function(_0x49733b,_0x5d7113){var _0x1bf561={},_0x54eb8a={},_0x554e47={'count':0x0,'rows':[]};var _0x2725a2=_[_0x0564('0x35')](db[_0x0564('0x36')][_0x0564('0x37')],function(_0x1e7bee){return{'name':_0x1e7bee[_0x0564('0x38')],'type':_0x1e7bee[_0x0564('0x39')][_0x0564('0x3a')]};});_0x54eb8a[_0x0564('0x3b')]=_[_0x0564('0x35')](_0x2725a2,_0x0564('0x3c'));_0x54eb8a[_0x0564('0x3d')]=_[_0x0564('0x3e')](_0x49733b[_0x0564('0x3d')]);_0x54eb8a[_0x0564('0x3f')]=_['intersection'](_0x54eb8a[_0x0564('0x3b')],_0x54eb8a[_0x0564('0x3d')]);_0x1bf561['attributes']=_['intersection'](_0x54eb8a[_0x0564('0x3b')],qs[_0x0564('0x40')](_0x49733b['query'][_0x0564('0x40')]));_0x1bf561['attributes']=_0x1bf561['attributes'][_0x0564('0x41')]?_0x1bf561[_0x0564('0x42')]:_0x54eb8a[_0x0564('0x3b')];if(!_0x49733b[_0x0564('0x3d')]['hasOwnProperty'](_0x0564('0x43'))){_0x1bf561[_0x0564('0x2b')]=qs[_0x0564('0x2b')](_0x49733b[_0x0564('0x3d')][_0x0564('0x2b')]);_0x1bf561[_0x0564('0x2a')]=qs['offset'](_0x49733b[_0x0564('0x3d')][_0x0564('0x2a')]);}_0x1bf561[_0x0564('0x44')]=qs['sort'](_0x49733b['query'][_0x0564('0x45')]);_0x1bf561['where']=qs[_0x0564('0x3f')](_[_0x0564('0x46')](_0x49733b[_0x0564('0x3d')],_0x54eb8a[_0x0564('0x3f')]),_0x2725a2);if(_0x49733b['query']['filter']){_0x1bf561[_0x0564('0x47')]=_[_0x0564('0x48')](_0x1bf561[_0x0564('0x47')],{'$or':_[_0x0564('0x35')](_0x2725a2,function(_0x393b56){if(_0x393b56[_0x0564('0x39')]!==_0x0564('0x49')){var _0x38d6ac={};_0x38d6ac[_0x393b56['name']]={'$like':'%'+_0x49733b[_0x0564('0x3d')][_0x0564('0x4a')]+'%'};return _0x38d6ac;}})});}_0x1bf561=_[_0x0564('0x48')]({},_0x1bf561,_0x49733b[_0x0564('0x4b')]);var _0x2acab5={'where':_0x1bf561['where']};return db['VtigerConfiguration']['count'](_0x2acab5)[_0x0564('0x1b')](function(_0x5d1026){_0x554e47[_0x0564('0x4c')]=_0x5d1026;if(_0x49733b[_0x0564('0x3d')][_0x0564('0x4d')]){_0x1bf561[_0x0564('0x4e')]=[{'all':!![]}];}return db[_0x0564('0x36')][_0x0564('0x4f')](_0x1bf561);})[_0x0564('0x1b')](function(_0xdcfeb4){_0x554e47[_0x0564('0x50')]=_0xdcfeb4;return _0x554e47;})['then'](respondWithFilteredResult(_0x5d7113,_0x1bf561))[_0x0564('0x25')](handleError(_0x5d7113,null));};exports['show']=function(_0xf3e1e3,_0x138f43){var _0x46e493={'raw':![],'where':{'id':_0xf3e1e3[_0x0564('0x51')]['id']}},_0x47d783={};_0x47d783['model']=_[_0x0564('0x3e')](db[_0x0564('0x36')][_0x0564('0x37')]);_0x47d783[_0x0564('0x3d')]=_[_0x0564('0x3e')](_0xf3e1e3[_0x0564('0x3d')]);_0x47d783[_0x0564('0x3f')]=_['intersection'](_0x47d783[_0x0564('0x3b')],_0x47d783['query']);_0x46e493['attributes']=_['intersection'](_0x47d783[_0x0564('0x3b')],qs[_0x0564('0x40')](_0xf3e1e3[_0x0564('0x3d')][_0x0564('0x40')]));_0x46e493[_0x0564('0x42')]=_0x46e493[_0x0564('0x42')][_0x0564('0x41')]?_0x46e493[_0x0564('0x42')]:_0x47d783[_0x0564('0x3b')];if(_0xf3e1e3[_0x0564('0x3d')][_0x0564('0x4d')]){_0x46e493[_0x0564('0x4e')]=[{'all':!![]}];}_0x46e493=_['merge']({},_0x46e493,_0xf3e1e3[_0x0564('0x4b')]);return db[_0x0564('0x36')]['find'](_0x46e493)[_0x0564('0x1b')](handleEntityNotFound(_0x138f43,null))[_0x0564('0x1b')](respondWithResult(_0x138f43,null))['catch'](handleError(_0x138f43,null));};exports[_0x0564('0x52')]=function(_0x1fd419,_0x48b73b){return db[_0x0564('0x36')][_0x0564('0x52')](_0x1fd419[_0x0564('0x53')],{})[_0x0564('0x1b')](respondWithResult(_0x48b73b,0xc9))[_0x0564('0x25')](handleError(_0x48b73b,null));};exports[_0x0564('0x30')]=function(_0x46cf0d,_0x27cf8a){if(_0x46cf0d[_0x0564('0x53')]['id']){delete _0x46cf0d[_0x0564('0x53')]['id'];}return db[_0x0564('0x36')][_0x0564('0x54')]({'where':{'id':_0x46cf0d[_0x0564('0x51')]['id']}})['then'](handleEntityNotFound(_0x27cf8a,null))[_0x0564('0x1b')](saveUpdates(_0x46cf0d[_0x0564('0x53')],null))[_0x0564('0x1b')](respondWithResult(_0x27cf8a,null))[_0x0564('0x25')](handleError(_0x27cf8a,null));};exports[_0x0564('0x31')]=function(_0x34f0f7,_0x556a11){return db[_0x0564('0x36')][_0x0564('0x54')]({'where':{'id':_0x34f0f7[_0x0564('0x51')]['id']}})[_0x0564('0x1b')](handleEntityNotFound(_0x556a11,null))[_0x0564('0x1b')](removeEntity(_0x556a11,null))[_0x0564('0x25')](handleError(_0x556a11,null));};exports['getFields']=function(_0x36ce67,_0x2b976c,_0x525e0e){var _0x40bb56={};var _0x2df1a5={};var _0x5e8aa4;var _0x13f2b9;return db[_0x0564('0x36')]['findOne']({'where':{'id':_0x36ce67[_0x0564('0x51')]['id']}})[_0x0564('0x1b')](handleEntityNotFound(_0x2b976c,null))[_0x0564('0x1b')](function(_0x423292){if(_0x423292){_0x5e8aa4=_0x423292;_0x2df1a5[_0x0564('0x3b')]=_[_0x0564('0x3e')](db[_0x0564('0x55')]['rawAttributes']);_0x2df1a5[_0x0564('0x3d')]=_[_0x0564('0x3e')](_0x36ce67[_0x0564('0x3d')]);_0x2df1a5[_0x0564('0x3f')]=_[_0x0564('0x56')](_0x2df1a5[_0x0564('0x3b')],_0x2df1a5[_0x0564('0x3d')]);_0x40bb56['attributes']=_[_0x0564('0x56')](_0x2df1a5[_0x0564('0x3b')],qs['fields'](_0x36ce67['query'][_0x0564('0x40')]));_0x40bb56['attributes']=_0x40bb56[_0x0564('0x42')]['length']?_0x40bb56['attributes']:_0x2df1a5[_0x0564('0x3b')];_0x40bb56[_0x0564('0x44')]=qs['sort'](_0x36ce67[_0x0564('0x3d')][_0x0564('0x45')]);_0x40bb56['where']=qs[_0x0564('0x3f')](_[_0x0564('0x46')](_0x36ce67[_0x0564('0x3d')],_0x2df1a5[_0x0564('0x3f')]));if(_0x36ce67[_0x0564('0x3d')][_0x0564('0x4a')]){_0x40bb56['where']=_[_0x0564('0x48')](_0x40bb56[_0x0564('0x47')],{'$or':_[_0x0564('0x35')](_0x40bb56['attributes'],function(_0x3b2221){var _0x1f1068={};_0x1f1068[_0x3b2221]={'$like':'%'+_0x36ce67[_0x0564('0x3d')][_0x0564('0x4a')]+'%'};return _0x1f1068;})});}_0x40bb56=_[_0x0564('0x48')]({},_0x40bb56,_0x36ce67[_0x0564('0x4b')]);return _0x5e8aa4['getFields'](_0x40bb56);}})['then'](function(_0x2c8640){if(_0x2c8640){_0x13f2b9=_0x2c8640[_0x0564('0x41')];if(!_0x36ce67[_0x0564('0x3d')][_0x0564('0x57')](_0x0564('0x43'))){_0x40bb56[_0x0564('0x2b')]=qs['limit'](_0x36ce67[_0x0564('0x3d')][_0x0564('0x2b')]);_0x40bb56[_0x0564('0x2a')]=qs['offset'](_0x36ce67['query'][_0x0564('0x2a')]);}return _0x5e8aa4[_0x0564('0x58')](_0x40bb56);}})[_0x0564('0x1b')](function(_0x5bd365){if(_0x5bd365){return _0x5bd365?{'count':_0x13f2b9,'rows':_0x5bd365}:null;}})[_0x0564('0x1b')](respondWithResult(_0x2b976c,null))[_0x0564('0x25')](handleError(_0x2b976c,null));};exports[_0x0564('0x59')]=function(_0x5cf4de,_0x50355d,_0x859c1){var _0x4c4b82={};var _0xc6a431={};var _0x54d07b;var _0x15a690;return db[_0x0564('0x36')][_0x0564('0x5a')]({'where':{'id':_0x5cf4de[_0x0564('0x51')]['id']}})[_0x0564('0x1b')](handleEntityNotFound(_0x50355d,null))[_0x0564('0x1b')](function(_0x53639b){if(_0x53639b){_0x54d07b=_0x53639b;_0xc6a431[_0x0564('0x3b')]=_[_0x0564('0x3e')](db[_0x0564('0x55')][_0x0564('0x37')]);_0xc6a431['query']=_[_0x0564('0x3e')](_0x5cf4de[_0x0564('0x3d')]);_0xc6a431[_0x0564('0x3f')]=_[_0x0564('0x56')](_0xc6a431[_0x0564('0x3b')],_0xc6a431['query']);_0x4c4b82[_0x0564('0x42')]=_[_0x0564('0x56')](_0xc6a431[_0x0564('0x3b')],qs['fields'](_0x5cf4de[_0x0564('0x3d')][_0x0564('0x40')]));_0x4c4b82[_0x0564('0x42')]=_0x4c4b82['attributes'][_0x0564('0x41')]?_0x4c4b82[_0x0564('0x42')]:_0xc6a431[_0x0564('0x3b')];_0x4c4b82[_0x0564('0x44')]=qs['sort'](_0x5cf4de[_0x0564('0x3d')][_0x0564('0x45')]);_0x4c4b82[_0x0564('0x47')]=qs['filters'](_[_0x0564('0x46')](_0x5cf4de[_0x0564('0x3d')],_0xc6a431['filters']));if(_0x5cf4de[_0x0564('0x3d')][_0x0564('0x4a')]){_0x4c4b82['where']=_['merge'](_0x4c4b82[_0x0564('0x47')],{'$or':_['map'](_0x4c4b82['attributes'],function(_0x575817){var _0x5171db={};_0x5171db[_0x575817]={'$like':'%'+_0x5cf4de[_0x0564('0x3d')][_0x0564('0x4a')]+'%'};return _0x5171db;})});}_0x4c4b82=_['merge']({},_0x4c4b82,_0x5cf4de[_0x0564('0x4b')]);return _0x54d07b[_0x0564('0x59')](_0x4c4b82);}})[_0x0564('0x1b')](function(_0x31c051){if(_0x31c051){_0x15a690=_0x31c051[_0x0564('0x41')];if(!_0x5cf4de[_0x0564('0x3d')][_0x0564('0x57')](_0x0564('0x43'))){_0x4c4b82[_0x0564('0x2b')]=qs[_0x0564('0x2b')](_0x5cf4de[_0x0564('0x3d')]['limit']);_0x4c4b82[_0x0564('0x2a')]=qs[_0x0564('0x2a')](_0x5cf4de[_0x0564('0x3d')][_0x0564('0x2a')]);}return _0x54d07b['getSubjects'](_0x4c4b82);}})['then'](function(_0x5c1c22){if(_0x5c1c22){return _0x5c1c22?{'count':_0x15a690,'rows':_0x5c1c22}:null;}})[_0x0564('0x1b')](respondWithResult(_0x50355d,null))[_0x0564('0x25')](handleError(_0x50355d,null));};exports['getDescriptions']=function(_0x2906c8,_0x2302a4,_0x36dfe4){var _0x10a42a={};var _0x465195={};var _0x1efb93;var _0x3ae8dd;return db['VtigerConfiguration'][_0x0564('0x5a')]({'where':{'id':_0x2906c8[_0x0564('0x51')]['id']}})[_0x0564('0x1b')](handleEntityNotFound(_0x2302a4,null))[_0x0564('0x1b')](function(_0x32f5d5){if(_0x32f5d5){_0x1efb93=_0x32f5d5;_0x465195[_0x0564('0x3b')]=_['keys'](db[_0x0564('0x55')][_0x0564('0x37')]);_0x465195[_0x0564('0x3d')]=_['keys'](_0x2906c8[_0x0564('0x3d')]);_0x465195[_0x0564('0x3f')]=_[_0x0564('0x56')](_0x465195['model'],_0x465195[_0x0564('0x3d')]);_0x10a42a[_0x0564('0x42')]=_['intersection'](_0x465195[_0x0564('0x3b')],qs[_0x0564('0x40')](_0x2906c8['query'][_0x0564('0x40')]));_0x10a42a[_0x0564('0x42')]=_0x10a42a[_0x0564('0x42')][_0x0564('0x41')]?_0x10a42a[_0x0564('0x42')]:_0x465195[_0x0564('0x3b')];_0x10a42a[_0x0564('0x44')]=qs[_0x0564('0x45')](_0x2906c8[_0x0564('0x3d')][_0x0564('0x45')]);_0x10a42a[_0x0564('0x47')]=qs[_0x0564('0x3f')](_['pick'](_0x2906c8[_0x0564('0x3d')],_0x465195[_0x0564('0x3f')]));if(_0x2906c8[_0x0564('0x3d')][_0x0564('0x4a')]){_0x10a42a[_0x0564('0x47')]=_[_0x0564('0x48')](_0x10a42a['where'],{'$or':_['map'](_0x10a42a[_0x0564('0x42')],function(_0x26dda0){var _0x565bcf={};_0x565bcf[_0x26dda0]={'$like':'%'+_0x2906c8[_0x0564('0x3d')][_0x0564('0x4a')]+'%'};return _0x565bcf;})});}_0x10a42a=_['merge']({},_0x10a42a,_0x2906c8[_0x0564('0x4b')]);return _0x1efb93[_0x0564('0x5b')](_0x10a42a);}})[_0x0564('0x1b')](function(_0x991377){if(_0x991377){_0x3ae8dd=_0x991377[_0x0564('0x41')];if(!_0x2906c8['query'][_0x0564('0x57')]('nolimit')){_0x10a42a[_0x0564('0x2b')]=qs[_0x0564('0x2b')](_0x2906c8[_0x0564('0x3d')]['limit']);_0x10a42a[_0x0564('0x2a')]=qs[_0x0564('0x2a')](_0x2906c8['query'][_0x0564('0x2a')]);}return _0x1efb93[_0x0564('0x5b')](_0x10a42a);}})['then'](function(_0xccf7bc){if(_0xccf7bc){return _0xccf7bc?{'count':_0x3ae8dd,'rows':_0xccf7bc}:null;}})[_0x0564('0x1b')](respondWithResult(_0x2302a4,null))[_0x0564('0x25')](handleError(_0x2302a4,null));};
\ No newline at end of file
diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js
index eb0c0a1..2974ce1 100644
--- a/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js
+++ b/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x88de=['moment','request-promise','path','rimraf','../../config/environment','./intVtigerConfiguration.attributes','exports','VtigerConfiguration','int_vtiger_configurations','../../config/logger','api'];(function(_0x569fa6,_0x3210ef){var _0x48d047=function(_0x283812){while(--_0x283812){_0x569fa6['push'](_0x569fa6['shift']());}};_0x48d047(++_0x3210ef);}(_0x88de,0xb9));var _0xe88d=function(_0x5a121a,_0x59b77c){_0x5a121a=_0x5a121a-0x0;var _0x1edd1c=_0x88de[_0x5a121a];return _0x1edd1c;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xe88d('0x0'))(_0xe88d('0x1'));var moment=require(_0xe88d('0x2'));var BPromise=require('bluebird');var rp=require(_0xe88d('0x3'));var fs=require('fs');var path=require(_0xe88d('0x4'));var rimraf=require(_0xe88d('0x5'));var config=require(_0xe88d('0x6'));var attributes=require(_0xe88d('0x7'));module[_0xe88d('0x8')]=function(_0x4f613c,_0x3ef6e8){return _0x4f613c['define'](_0xe88d('0x9'),attributes,{'tableName':_0xe88d('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x11d0=['../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./intVtigerConfiguration.attributes','define','VtigerConfiguration','lodash','util'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x11d0,0x1d2));var _0x011d=function(_0x4378d5,_0x39b734){_0x4378d5=_0x4378d5-0x0;var _0xa27c3b=_0x11d0[_0x4378d5];return _0xa27c3b;};'use strict';var _=require(_0x011d('0x0'));var util=require(_0x011d('0x1'));var logger=require(_0x011d('0x2'))(_0x011d('0x3'));var moment=require('moment');var BPromise=require(_0x011d('0x4'));var rp=require(_0x011d('0x5'));var fs=require('fs');var path=require(_0x011d('0x6'));var rimraf=require(_0x011d('0x7'));var config=require(_0x011d('0x8'));var attributes=require(_0x011d('0x9'));module['exports']=function(_0x104af0,_0x38147b){return _0x104af0[_0x011d('0xa')](_0x011d('0xb'),attributes,{'tableName':'int_vtiger_configurations','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.rpc.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.rpc.js
index 3755a71..6e9a2b7 100644
--- a/server/api/intVtigerConfiguration/intVtigerConfiguration.rpc.js
+++ b/server/api/intVtigerConfiguration/intVtigerConfiguration.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xa457=['request','then','request\x20sent','debug','VtigerConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','VtigerConfiguration,\x20%s,\x20%s','message','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xa457,0x79));var _0x7a45=function(_0x31a494,_0x4dff0d){_0x31a494=_0x31a494-0x0;var _0x573129=_0xa457[_0x31a494];return _0x573129;};'use strict';var _=require(_0x7a45('0x0'));var util=require(_0x7a45('0x1'));var moment=require(_0x7a45('0x2'));var BPromise=require('bluebird');var rs=require(_0x7a45('0x3'));var fs=require('fs');var Redis=require(_0x7a45('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x7a45('0x5'));var logger=require(_0x7a45('0x6'))(_0x7a45('0x7'));var config=require('../../config/environment');var jayson=require(_0x7a45('0x8'));var client=jayson[_0x7a45('0x9')][_0x7a45('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x591141,_0x55e37c,_0x2e1db9){return new BPromise(function(_0x4d2a07,_0x454300){return client[_0x7a45('0xb')](_0x591141,_0x2e1db9)[_0x7a45('0xc')](function(_0x976ce8){logger['info']('VtigerConfiguration,\x20%s,\x20%s',_0x55e37c,_0x7a45('0xd'));logger[_0x7a45('0xe')](_0x7a45('0xf'),_0x55e37c,'request\x20sent',JSON[_0x7a45('0x10')](_0x976ce8));if(_0x976ce8[_0x7a45('0x11')]){if(_0x976ce8[_0x7a45('0x11')]['code']===0x1f4){logger[_0x7a45('0x11')](_0x7a45('0x12'),_0x55e37c,_0x976ce8[_0x7a45('0x11')][_0x7a45('0x13')]);return _0x454300(_0x976ce8['error'][_0x7a45('0x13')]);}logger['error'](_0x7a45('0x12'),_0x55e37c,_0x976ce8[_0x7a45('0x11')]['message']);return _0x4d2a07(_0x976ce8['error']['message']);}else{logger['info'](_0x7a45('0x12'),_0x55e37c,_0x7a45('0xd'));_0x4d2a07(_0x976ce8[_0x7a45('0x14')][_0x7a45('0x13')]);}})[_0x7a45('0x15')](function(_0x57d420){logger[_0x7a45('0x11')](_0x7a45('0x12'),_0x55e37c,_0x57d420);_0x454300(_0x57d420);});});}
\ No newline at end of file
+var _0xcabe=['VtigerConfiguration,\x20%s,\x20%s','request\x20sent','VtigerConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','info'];(function(_0x56099d,_0x1ae5de){var _0x13d2bf=function(_0x226a34){while(--_0x226a34){_0x56099d['push'](_0x56099d['shift']());}};_0x13d2bf(++_0x1ae5de);}(_0xcabe,0x76));var _0xecab=function(_0x15a074,_0x2ebf5b){_0x15a074=_0x15a074-0x0;var _0x1dabc8=_0xcabe[_0x15a074];return _0x1dabc8;};'use strict';var _=require(_0xecab('0x0'));var util=require(_0xecab('0x1'));var moment=require(_0xecab('0x2'));var BPromise=require(_0xecab('0x3'));var rs=require(_0xecab('0x4'));var fs=require('fs');var Redis=require(_0xecab('0x5'));var db=require(_0xecab('0x6'))['db'];var utils=require(_0xecab('0x7'));var logger=require(_0xecab('0x8'))(_0xecab('0x9'));var config=require('../../config/environment');var jayson=require(_0xecab('0xa'));var client=jayson['client'][_0xecab('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x364d29,_0x4367a4,_0x1d8d74){return new BPromise(function(_0x58ab19,_0x127c12){return client[_0xecab('0xc')](_0x364d29,_0x1d8d74)['then'](function(_0x2a0a2d){logger[_0xecab('0xd')](_0xecab('0xe'),_0x4367a4,_0xecab('0xf'));logger['debug'](_0xecab('0x10'),_0x4367a4,_0xecab('0xf'),JSON['stringify'](_0x2a0a2d));if(_0x2a0a2d[_0xecab('0x11')]){if(_0x2a0a2d['error'][_0xecab('0x12')]===0x1f4){logger[_0xecab('0x11')](_0xecab('0xe'),_0x4367a4,_0x2a0a2d['error'][_0xecab('0x13')]);return _0x127c12(_0x2a0a2d[_0xecab('0x11')][_0xecab('0x13')]);}logger[_0xecab('0x11')](_0xecab('0xe'),_0x4367a4,_0x2a0a2d['error'][_0xecab('0x13')]);return _0x58ab19(_0x2a0a2d[_0xecab('0x11')][_0xecab('0x13')]);}else{logger[_0xecab('0xd')](_0xecab('0xe'),_0x4367a4,_0xecab('0xf'));_0x58ab19(_0x2a0a2d[_0xecab('0x14')][_0xecab('0x13')]);}})[_0xecab('0x15')](function(_0x382ceb){logger[_0xecab('0x11')](_0xecab('0xe'),_0x4367a4,_0x382ceb);_0x127c12(_0x382ceb);});});}
\ No newline at end of file
diff --git a/server/api/intVtigerField/index.js b/server/api/intVtigerField/index.js
index 01c3a1d..87e87a5 100644
--- a/server/api/intVtigerField/index.js
+++ b/server/api/intVtigerField/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x5518=['path','connect-timeout','Router','../../components/interaction/service','../../config/environment','./intVtigerField.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','destroy','exports','multer','util'];(function(_0xf44d31,_0x1b1968){var _0x3f4f97=function(_0x1cc3be){while(--_0x1cc3be){_0xf44d31['push'](_0xf44d31['shift']());}};_0x3f4f97(++_0x1b1968);}(_0x5518,0x108));var _0x8551=function(_0x12aa02,_0x116599){_0x12aa02=_0x12aa02-0x0;var _0x3deddd=_0x5518[_0x12aa02];return _0x3deddd;};'use strict';var multer=require(_0x8551('0x0'));var util=require(_0x8551('0x1'));var path=require(_0x8551('0x2'));var timeout=require(_0x8551('0x3'));var express=require('express');var router=express[_0x8551('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x8551('0x5'));var config=require(_0x8551('0x6'));var controller=require(_0x8551('0x7'));router[_0x8551('0x8')]('/',auth[_0x8551('0x9')](),controller[_0x8551('0xa')]);router[_0x8551('0x8')](_0x8551('0xb'),auth['isAuthenticated'](),controller[_0x8551('0xc')]);router[_0x8551('0xd')]('/',auth[_0x8551('0x9')](),controller[_0x8551('0xe')]);router[_0x8551('0xf')](_0x8551('0xb'),auth[_0x8551('0x9')](),controller[_0x8551('0x10')]);router['delete'](_0x8551('0xb'),auth[_0x8551('0x9')](),controller[_0x8551('0x11')]);module[_0x8551('0x12')]=router;
\ No newline at end of file
+var _0x7992=['../../config/environment','./intVtigerField.controller','get','isAuthenticated','/:id','show','create','put','update','delete','destroy','multer','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7992,0x15f));var _0x2799=function(_0x7dbd65,_0x18da49){_0x7dbd65=_0x7dbd65-0x0;var _0x33d551=_0x7992[_0x7dbd65];return _0x33d551;};'use strict';var multer=require(_0x2799('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x2799('0x1'));var express=require(_0x2799('0x2'));var router=express[_0x2799('0x3')]();var auth=require(_0x2799('0x4'));var interaction=require(_0x2799('0x5'));var config=require(_0x2799('0x6'));var controller=require(_0x2799('0x7'));router[_0x2799('0x8')]('/',auth[_0x2799('0x9')](),controller['index']);router[_0x2799('0x8')](_0x2799('0xa'),auth[_0x2799('0x9')](),controller[_0x2799('0xb')]);router['post']('/',auth[_0x2799('0x9')](),controller[_0x2799('0xc')]);router[_0x2799('0xd')](_0x2799('0xa'),auth[_0x2799('0x9')](),controller[_0x2799('0xe')]);router[_0x2799('0xf')]('/:id',auth[_0x2799('0x9')](),controller[_0x2799('0x10')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/intVtigerField/intVtigerField.attributes.js b/server/api/intVtigerField/intVtigerField.attributes.js
index 437d798..a976aaf 100644
--- a/server/api/intVtigerField/intVtigerField.attributes.js
+++ b/server/api/intVtigerField/intVtigerField.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xf534=['variable','BOOLEAN','sequelize','exports','string','customVariable','STRING','ENUM'];(function(_0x465028,_0x4570ac){var _0xb783d4=function(_0x5458c5){while(--_0x5458c5){_0x465028['push'](_0x465028['shift']());}};_0xb783d4(++_0x4570ac);}(_0xf534,0x9a));var _0x4f53=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xf534[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0x4f53('0x0'));module[_0x4f53('0x1')]={'type':{'type':Sequelize['ENUM'](_0x4f53('0x2'),'variable',_0x4f53('0x3'),'keyValue'),'defaultValue':_0x4f53('0x2')},'content':{'type':Sequelize[_0x4f53('0x4')]},'key':{'type':Sequelize[_0x4f53('0x4')]},'keyType':{'type':Sequelize[_0x4f53('0x5')](_0x4f53('0x2'),_0x4f53('0x6'),_0x4f53('0x3'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x4f53('0x4')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x4f53('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x4f53('0x4')]}};
\ No newline at end of file
+var _0x99c9=['BOOLEAN','sequelize','exports','ENUM','string','variable','customVariable','keyValue','STRING'];(function(_0x10cdfa,_0x15e2f7){var _0x2ab367=function(_0x277681){while(--_0x277681){_0x10cdfa['push'](_0x10cdfa['shift']());}};_0x2ab367(++_0x15e2f7);}(_0x99c9,0x13c));var _0x999c=function(_0x1cc8fe,_0x105328){_0x1cc8fe=_0x1cc8fe-0x0;var _0x230054=_0x99c9[_0x1cc8fe];return _0x230054;};'use strict';var Sequelize=require(_0x999c('0x0'));module[_0x999c('0x1')]={'type':{'type':Sequelize[_0x999c('0x2')](_0x999c('0x3'),_0x999c('0x4'),_0x999c('0x5'),_0x999c('0x6')),'defaultValue':'string'},'content':{'type':Sequelize[_0x999c('0x7')]},'key':{'type':Sequelize[_0x999c('0x7')]},'keyType':{'type':Sequelize[_0x999c('0x2')](_0x999c('0x3'),_0x999c('0x4'),_0x999c('0x5'))},'keyContent':{'type':Sequelize[_0x999c('0x7')]},'idField':{'type':Sequelize[_0x999c('0x7')]},'nameField':{'type':Sequelize[_0x999c('0x7')]},'customField':{'type':Sequelize[_0x999c('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x999c('0x7')]}};
\ No newline at end of file
diff --git a/server/api/intVtigerField/intVtigerField.controller.js b/server/api/intVtigerField/intVtigerField.controller.js
index 9a9b499..9ea54be 100644
--- a/server/api/intVtigerField/intVtigerField.controller.js
+++ b/server/api/intVtigerField/intVtigerField.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x1e0c=['crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','status','end','json','count','set','Content-Range','reject','save','update','then','sendStatus','stack','name','VtigerField','type','key','model','map','query','keys','filters','attributes','fields','hasOwnProperty','nolimit','limit','offset','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','rows','catch','show','params','intersection','length','find','create','body','destroy','html-pdf','eml-format','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash'];(function(_0x406e1d,_0x58be6a){var _0x175567=function(_0x244575){while(--_0x244575){_0x406e1d['push'](_0x406e1d['shift']());}};_0x175567(++_0x58be6a);}(_0x1e0c,0xc7));var _0xc1e0=function(_0x3f4e4c,_0x4f4d9f){_0x3f4e4c=_0x3f4e4c-0x0;var _0x3c6359=_0x1e0c[_0x3f4e4c];return _0x3c6359;};'use strict';var pdf=require(_0xc1e0('0x0'));var emlformat=require(_0xc1e0('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xc1e0('0x2'));var rp=require('request-promise');var moment=require(_0xc1e0('0x3'));var BPromise=require(_0xc1e0('0x4'));var Mustache=require(_0xc1e0('0x5'));var util=require(_0xc1e0('0x6'));var path=require('path');var sox=require(_0xc1e0('0x7'));var csv=require(_0xc1e0('0x8'));var ejs=require(_0xc1e0('0x9'));var fs=require('fs');var _=require(_0xc1e0('0xa'));var squel=require('squel');var crypto=require(_0xc1e0('0xb'));var jsforce=require(_0xc1e0('0xc'));var deskjs=require(_0xc1e0('0xd'));var toCsv=require(_0xc1e0('0x8'));var querystring=require(_0xc1e0('0xe'));var Papa=require(_0xc1e0('0xf'));var Redis=require(_0xc1e0('0x10'));var authService=require(_0xc1e0('0x11'));var qs=require(_0xc1e0('0x12'));var as=require(_0xc1e0('0x13'));var hardwareService=require(_0xc1e0('0x14'));var logger=require(_0xc1e0('0x15'))(_0xc1e0('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3acb89,_0x53e8c5){_0x53e8c5=_0x53e8c5||0xcc;return function(_0x4a5acb){if(_0x4a5acb){return _0x3acb89['sendStatus'](_0x53e8c5);}return _0x3acb89[_0xc1e0('0x17')](_0x53e8c5)[_0xc1e0('0x18')]();};}function respondWithResult(_0x30a80c,_0x23660d){_0x23660d=_0x23660d||0xc8;return function(_0x5c4dad){if(_0x5c4dad){return _0x30a80c[_0xc1e0('0x17')](_0x23660d)[_0xc1e0('0x19')](_0x5c4dad);}};}function respondWithFilteredResult(_0x4be4bc,_0x408c84){return function(_0x14492f){if(_0x14492f){var _0x493024=_0x14492f[_0xc1e0('0x1a')],_0x48ed32=_0x408c84['offset'],_0x277444=_0x408c84['offset']+_0x408c84['limit'],_0x42fe84;if(_0x277444>=_0x493024){_0x277444=_0x493024;_0x42fe84=0xc8;}else{_0x42fe84=0xce;}_0x4be4bc[_0xc1e0('0x17')](_0x42fe84);return _0x4be4bc[_0xc1e0('0x1b')](_0xc1e0('0x1c'),_0x48ed32+'-'+_0x277444+'/'+_0x493024)[_0xc1e0('0x19')](_0x14492f);}return null;};}function patchUpdates(_0x1dc671){return function(_0x3d6ea9){try{jsonpatch['apply'](_0x3d6ea9,_0x1dc671,!![]);}catch(_0x7d550f){return BPromise[_0xc1e0('0x1d')](_0x7d550f);}return _0x3d6ea9[_0xc1e0('0x1e')]();};}function saveUpdates(_0x1bb079,_0x327d7a){return function(_0x205320){if(_0x205320){return _0x205320[_0xc1e0('0x1f')](_0x1bb079)[_0xc1e0('0x20')](function(_0x1ef8b7){return _0x1ef8b7;});}return null;};}function removeEntity(_0x4980ce,_0x51cef8){return function(_0x16fe3b){if(_0x16fe3b){return _0x16fe3b['destroy']()['then'](function(){_0x4980ce[_0xc1e0('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x57d01b,_0x213446){return function(_0x3cbf5a){if(!_0x3cbf5a){_0x57d01b[_0xc1e0('0x21')](0x194);}return _0x3cbf5a;};}function handleError(_0x2eb078,_0x205032){_0x205032=_0x205032||0x1f4;return function(_0x1a4821){logger['error'](_0x1a4821[_0xc1e0('0x22')]);if(_0x1a4821['name']){delete _0x1a4821[_0xc1e0('0x23')];}_0x2eb078[_0xc1e0('0x17')](_0x205032)['send'](_0x1a4821);};}exports['index']=function(_0x54a612,_0x4751ea){var _0x577c6c={},_0x2a8aa8={},_0x341d42={'count':0x0,'rows':[]};var _0x66b708=_['map'](db[_0xc1e0('0x24')]['rawAttributes'],function(_0x3867fb){return{'name':_0x3867fb['fieldName'],'type':_0x3867fb[_0xc1e0('0x25')][_0xc1e0('0x26')]};});_0x2a8aa8[_0xc1e0('0x27')]=_[_0xc1e0('0x28')](_0x66b708,'name');_0x2a8aa8[_0xc1e0('0x29')]=_[_0xc1e0('0x2a')](_0x54a612[_0xc1e0('0x29')]);_0x2a8aa8[_0xc1e0('0x2b')]=_['intersection'](_0x2a8aa8['model'],_0x2a8aa8[_0xc1e0('0x29')]);_0x577c6c[_0xc1e0('0x2c')]=_['intersection'](_0x2a8aa8[_0xc1e0('0x27')],qs[_0xc1e0('0x2d')](_0x54a612[_0xc1e0('0x29')][_0xc1e0('0x2d')]));_0x577c6c[_0xc1e0('0x2c')]=_0x577c6c[_0xc1e0('0x2c')]['length']?_0x577c6c[_0xc1e0('0x2c')]:_0x2a8aa8['model'];if(!_0x54a612[_0xc1e0('0x29')][_0xc1e0('0x2e')](_0xc1e0('0x2f'))){_0x577c6c[_0xc1e0('0x30')]=qs['limit'](_0x54a612[_0xc1e0('0x29')][_0xc1e0('0x30')]);_0x577c6c[_0xc1e0('0x31')]=qs[_0xc1e0('0x31')](_0x54a612[_0xc1e0('0x29')][_0xc1e0('0x31')]);}_0x577c6c[_0xc1e0('0x32')]=qs[_0xc1e0('0x33')](_0x54a612[_0xc1e0('0x29')][_0xc1e0('0x33')]);_0x577c6c[_0xc1e0('0x34')]=qs['filters'](_[_0xc1e0('0x35')](_0x54a612[_0xc1e0('0x29')],_0x2a8aa8['filters']),_0x66b708);if(_0x54a612[_0xc1e0('0x29')][_0xc1e0('0x36')]){_0x577c6c['where']=_['merge'](_0x577c6c['where'],{'$or':_[_0xc1e0('0x28')](_0x66b708,function(_0x382895){if(_0x382895['type']!==_0xc1e0('0x37')){var _0x128579={};_0x128579[_0x382895[_0xc1e0('0x23')]]={'$like':'%'+_0x54a612['query']['filter']+'%'};return _0x128579;}})});}_0x577c6c=_[_0xc1e0('0x38')]({},_0x577c6c,_0x54a612[_0xc1e0('0x39')]);var _0x22bd84={'where':_0x577c6c['where']};return db[_0xc1e0('0x24')][_0xc1e0('0x1a')](_0x22bd84)[_0xc1e0('0x20')](function(_0x2354d8){_0x341d42[_0xc1e0('0x1a')]=_0x2354d8;if(_0x54a612[_0xc1e0('0x29')][_0xc1e0('0x3a')]){_0x577c6c[_0xc1e0('0x3b')]=[{'all':!![]}];}return db['VtigerField']['findAll'](_0x577c6c);})[_0xc1e0('0x20')](function(_0x1960a4){_0x341d42[_0xc1e0('0x3c')]=_0x1960a4;return _0x341d42;})[_0xc1e0('0x20')](respondWithFilteredResult(_0x4751ea,_0x577c6c))[_0xc1e0('0x3d')](handleError(_0x4751ea,null));};exports[_0xc1e0('0x3e')]=function(_0x1e8c83,_0x3fd75b){var _0x2b11b4={'raw':!![],'where':{'id':_0x1e8c83[_0xc1e0('0x3f')]['id']}},_0x49c1af={};_0x49c1af[_0xc1e0('0x27')]=_['keys'](db[_0xc1e0('0x24')]['rawAttributes']);_0x49c1af[_0xc1e0('0x29')]=_['keys'](_0x1e8c83[_0xc1e0('0x29')]);_0x49c1af['filters']=_[_0xc1e0('0x40')](_0x49c1af[_0xc1e0('0x27')],_0x49c1af['query']);_0x2b11b4[_0xc1e0('0x2c')]=_[_0xc1e0('0x40')](_0x49c1af[_0xc1e0('0x27')],qs[_0xc1e0('0x2d')](_0x1e8c83[_0xc1e0('0x29')][_0xc1e0('0x2d')]));_0x2b11b4[_0xc1e0('0x2c')]=_0x2b11b4[_0xc1e0('0x2c')][_0xc1e0('0x41')]?_0x2b11b4[_0xc1e0('0x2c')]:_0x49c1af[_0xc1e0('0x27')];if(_0x1e8c83['query'][_0xc1e0('0x3a')]){_0x2b11b4[_0xc1e0('0x3b')]=[{'all':!![]}];}_0x2b11b4=_[_0xc1e0('0x38')]({},_0x2b11b4,_0x1e8c83[_0xc1e0('0x39')]);return db['VtigerField'][_0xc1e0('0x42')](_0x2b11b4)[_0xc1e0('0x20')](handleEntityNotFound(_0x3fd75b,null))['then'](respondWithResult(_0x3fd75b,null))['catch'](handleError(_0x3fd75b,null));};exports[_0xc1e0('0x43')]=function(_0x441b4f,_0x21cd7c){return db[_0xc1e0('0x24')][_0xc1e0('0x43')](_0x441b4f[_0xc1e0('0x44')],{})[_0xc1e0('0x20')](respondWithResult(_0x21cd7c,0xc9))[_0xc1e0('0x3d')](handleError(_0x21cd7c,null));};exports['update']=function(_0x99b5f5,_0x5de9c9){if(_0x99b5f5[_0xc1e0('0x44')]['id']){delete _0x99b5f5[_0xc1e0('0x44')]['id'];}return db['VtigerField'][_0xc1e0('0x42')]({'where':{'id':_0x99b5f5['params']['id']}})[_0xc1e0('0x20')](handleEntityNotFound(_0x5de9c9,null))['then'](saveUpdates(_0x99b5f5[_0xc1e0('0x44')],null))['then'](respondWithResult(_0x5de9c9,null))[_0xc1e0('0x3d')](handleError(_0x5de9c9,null));};exports[_0xc1e0('0x45')]=function(_0x3856e4,_0x220f51){return db[_0xc1e0('0x24')][_0xc1e0('0x42')]({'where':{'id':_0x3856e4[_0xc1e0('0x3f')]['id']}})[_0xc1e0('0x20')](handleEntityNotFound(_0x220f51,null))['then'](removeEntity(_0x220f51,null))['catch'](handleError(_0x220f51,null));};
\ No newline at end of file
+var _0xef17=['ejs','lodash','squel','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','offset','limit','set','Content-Range','apply','save','update','then','error','stack','name','send','index','VtigerField','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','where','pick','map','VIRTUAL','filter','merge','options','count','includeAll','include','findAll','rows','catch','show','params','find','create','body','destroy','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox'];(function(_0xf27f1e,_0x214175){var _0x127706=function(_0x264a25){while(--_0x264a25){_0xf27f1e['push'](_0xf27f1e['shift']());}};_0x127706(++_0x214175);}(_0xef17,0x1be));var _0x7ef1=function(_0x575fc9,_0x29cba0){_0x575fc9=_0x575fc9-0x0;var _0x56e239=_0xef17[_0x575fc9];return _0x56e239;};'use strict';var pdf=require(_0x7ef1('0x0'));var emlformat=require(_0x7ef1('0x1'));var rimraf=require(_0x7ef1('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x7ef1('0x3'));var rp=require(_0x7ef1('0x4'));var moment=require(_0x7ef1('0x5'));var BPromise=require(_0x7ef1('0x6'));var Mustache=require(_0x7ef1('0x7'));var util=require(_0x7ef1('0x8'));var path=require('path');var sox=require(_0x7ef1('0x9'));var csv=require('to-csv');var ejs=require(_0x7ef1('0xa'));var fs=require('fs');var _=require(_0x7ef1('0xb'));var squel=require(_0x7ef1('0xc'));var crypto=require('crypto');var jsforce=require(_0x7ef1('0xd'));var deskjs=require(_0x7ef1('0xe'));var toCsv=require(_0x7ef1('0xf'));var querystring=require('querystring');var Papa=require(_0x7ef1('0x10'));var Redis=require(_0x7ef1('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x7ef1('0x12'));var as=require(_0x7ef1('0x13'));var hardwareService=require(_0x7ef1('0x14'));var logger=require('../../config/logger')(_0x7ef1('0x15'));var utils=require(_0x7ef1('0x16'));var config=require(_0x7ef1('0x17'));var db=require(_0x7ef1('0x18'))['db'];function respondWithStatusCode(_0x2971da,_0x346c33){_0x346c33=_0x346c33||0xcc;return function(_0x53d048){if(_0x53d048){return _0x2971da[_0x7ef1('0x19')](_0x346c33);}return _0x2971da[_0x7ef1('0x1a')](_0x346c33)[_0x7ef1('0x1b')]();};}function respondWithResult(_0x5eec9e,_0x5083c3){_0x5083c3=_0x5083c3||0xc8;return function(_0x295ae9){if(_0x295ae9){return _0x5eec9e[_0x7ef1('0x1a')](_0x5083c3)['json'](_0x295ae9);}};}function respondWithFilteredResult(_0x1d23e6,_0x5b8cca){return function(_0x59eb42){if(_0x59eb42){var _0x32ea76=_0x59eb42['count'],_0x413bb8=_0x5b8cca[_0x7ef1('0x1c')],_0x521ce7=_0x5b8cca['offset']+_0x5b8cca[_0x7ef1('0x1d')],_0x1bfe91;if(_0x521ce7>=_0x32ea76){_0x521ce7=_0x32ea76;_0x1bfe91=0xc8;}else{_0x1bfe91=0xce;}_0x1d23e6[_0x7ef1('0x1a')](_0x1bfe91);return _0x1d23e6[_0x7ef1('0x1e')](_0x7ef1('0x1f'),_0x413bb8+'-'+_0x521ce7+'/'+_0x32ea76)['json'](_0x59eb42);}return null;};}function patchUpdates(_0x4325d8){return function(_0xd614ec){try{jsonpatch[_0x7ef1('0x20')](_0xd614ec,_0x4325d8,!![]);}catch(_0x4753dc){return BPromise['reject'](_0x4753dc);}return _0xd614ec[_0x7ef1('0x21')]();};}function saveUpdates(_0x1411c5,_0x3a9db5){return function(_0x2e9275){if(_0x2e9275){return _0x2e9275[_0x7ef1('0x22')](_0x1411c5)[_0x7ef1('0x23')](function(_0x4961c7){return _0x4961c7;});}return null;};}function removeEntity(_0x3bee12,_0x2f00cd){return function(_0x2f53c5){if(_0x2f53c5){return _0x2f53c5['destroy']()[_0x7ef1('0x23')](function(){_0x3bee12['status'](0xcc)[_0x7ef1('0x1b')]();});}};}function handleEntityNotFound(_0xb18b7d,_0x9a45c6){return function(_0x29fbca){if(!_0x29fbca){_0xb18b7d[_0x7ef1('0x19')](0x194);}return _0x29fbca;};}function handleError(_0x233d04,_0x5701de){_0x5701de=_0x5701de||0x1f4;return function(_0x1402ce){logger[_0x7ef1('0x24')](_0x1402ce[_0x7ef1('0x25')]);if(_0x1402ce[_0x7ef1('0x26')]){delete _0x1402ce[_0x7ef1('0x26')];}_0x233d04[_0x7ef1('0x1a')](_0x5701de)[_0x7ef1('0x27')](_0x1402ce);};}exports[_0x7ef1('0x28')]=function(_0x2e24d0,_0x7144f5){var _0x36379c={},_0xda9fb2={},_0x51645b={'count':0x0,'rows':[]};var _0x4d5fb0=_['map'](db[_0x7ef1('0x29')][_0x7ef1('0x2a')],function(_0x65924){return{'name':_0x65924[_0x7ef1('0x2b')],'type':_0x65924[_0x7ef1('0x2c')][_0x7ef1('0x2d')]};});_0xda9fb2[_0x7ef1('0x2e')]=_['map'](_0x4d5fb0,_0x7ef1('0x26'));_0xda9fb2[_0x7ef1('0x2f')]=_[_0x7ef1('0x30')](_0x2e24d0['query']);_0xda9fb2[_0x7ef1('0x31')]=_[_0x7ef1('0x32')](_0xda9fb2[_0x7ef1('0x2e')],_0xda9fb2['query']);_0x36379c[_0x7ef1('0x33')]=_[_0x7ef1('0x32')](_0xda9fb2[_0x7ef1('0x2e')],qs[_0x7ef1('0x34')](_0x2e24d0[_0x7ef1('0x2f')]['fields']));_0x36379c[_0x7ef1('0x33')]=_0x36379c[_0x7ef1('0x33')][_0x7ef1('0x35')]?_0x36379c['attributes']:_0xda9fb2['model'];if(!_0x2e24d0['query'][_0x7ef1('0x36')](_0x7ef1('0x37'))){_0x36379c[_0x7ef1('0x1d')]=qs[_0x7ef1('0x1d')](_0x2e24d0['query']['limit']);_0x36379c['offset']=qs['offset'](_0x2e24d0[_0x7ef1('0x2f')][_0x7ef1('0x1c')]);}_0x36379c[_0x7ef1('0x38')]=qs['sort'](_0x2e24d0[_0x7ef1('0x2f')]['sort']);_0x36379c[_0x7ef1('0x39')]=qs[_0x7ef1('0x31')](_[_0x7ef1('0x3a')](_0x2e24d0['query'],_0xda9fb2['filters']),_0x4d5fb0);if(_0x2e24d0[_0x7ef1('0x2f')]['filter']){_0x36379c[_0x7ef1('0x39')]=_['merge'](_0x36379c[_0x7ef1('0x39')],{'$or':_[_0x7ef1('0x3b')](_0x4d5fb0,function(_0x15ccb4){if(_0x15ccb4['type']!==_0x7ef1('0x3c')){var _0x283c09={};_0x283c09[_0x15ccb4[_0x7ef1('0x26')]]={'$like':'%'+_0x2e24d0[_0x7ef1('0x2f')][_0x7ef1('0x3d')]+'%'};return _0x283c09;}})});}_0x36379c=_[_0x7ef1('0x3e')]({},_0x36379c,_0x2e24d0[_0x7ef1('0x3f')]);var _0x876573={'where':_0x36379c[_0x7ef1('0x39')]};return db[_0x7ef1('0x29')][_0x7ef1('0x40')](_0x876573)['then'](function(_0x1d1829){_0x51645b[_0x7ef1('0x40')]=_0x1d1829;if(_0x2e24d0[_0x7ef1('0x2f')][_0x7ef1('0x41')]){_0x36379c[_0x7ef1('0x42')]=[{'all':!![]}];}return db[_0x7ef1('0x29')][_0x7ef1('0x43')](_0x36379c);})['then'](function(_0x3dd74b){_0x51645b[_0x7ef1('0x44')]=_0x3dd74b;return _0x51645b;})[_0x7ef1('0x23')](respondWithFilteredResult(_0x7144f5,_0x36379c))[_0x7ef1('0x45')](handleError(_0x7144f5,null));};exports[_0x7ef1('0x46')]=function(_0x5ead20,_0xf662cf){var _0x1a235a={'raw':!![],'where':{'id':_0x5ead20[_0x7ef1('0x47')]['id']}},_0x414c55={};_0x414c55[_0x7ef1('0x2e')]=_[_0x7ef1('0x30')](db[_0x7ef1('0x29')][_0x7ef1('0x2a')]);_0x414c55[_0x7ef1('0x2f')]=_[_0x7ef1('0x30')](_0x5ead20['query']);_0x414c55['filters']=_[_0x7ef1('0x32')](_0x414c55['model'],_0x414c55[_0x7ef1('0x2f')]);_0x1a235a[_0x7ef1('0x33')]=_[_0x7ef1('0x32')](_0x414c55[_0x7ef1('0x2e')],qs['fields'](_0x5ead20[_0x7ef1('0x2f')][_0x7ef1('0x34')]));_0x1a235a['attributes']=_0x1a235a['attributes'][_0x7ef1('0x35')]?_0x1a235a[_0x7ef1('0x33')]:_0x414c55[_0x7ef1('0x2e')];if(_0x5ead20['query'][_0x7ef1('0x41')]){_0x1a235a[_0x7ef1('0x42')]=[{'all':!![]}];}_0x1a235a=_[_0x7ef1('0x3e')]({},_0x1a235a,_0x5ead20[_0x7ef1('0x3f')]);return db[_0x7ef1('0x29')][_0x7ef1('0x48')](_0x1a235a)[_0x7ef1('0x23')](handleEntityNotFound(_0xf662cf,null))[_0x7ef1('0x23')](respondWithResult(_0xf662cf,null))[_0x7ef1('0x45')](handleError(_0xf662cf,null));};exports['create']=function(_0xc4343a,_0x2cb960){return db[_0x7ef1('0x29')][_0x7ef1('0x49')](_0xc4343a[_0x7ef1('0x4a')],{})['then'](respondWithResult(_0x2cb960,0xc9))[_0x7ef1('0x45')](handleError(_0x2cb960,null));};exports[_0x7ef1('0x22')]=function(_0x4cf13c,_0x20eb72){if(_0x4cf13c[_0x7ef1('0x4a')]['id']){delete _0x4cf13c[_0x7ef1('0x4a')]['id'];}return db[_0x7ef1('0x29')][_0x7ef1('0x48')]({'where':{'id':_0x4cf13c[_0x7ef1('0x47')]['id']}})[_0x7ef1('0x23')](handleEntityNotFound(_0x20eb72,null))['then'](saveUpdates(_0x4cf13c[_0x7ef1('0x4a')],null))['then'](respondWithResult(_0x20eb72,null))[_0x7ef1('0x45')](handleError(_0x20eb72,null));};exports[_0x7ef1('0x4b')]=function(_0x6bde4e,_0x57175b){return db[_0x7ef1('0x29')]['find']({'where':{'id':_0x6bde4e['params']['id']}})[_0x7ef1('0x23')](handleEntityNotFound(_0x57175b,null))['then'](removeEntity(_0x57175b,null))[_0x7ef1('0x45')](handleError(_0x57175b,null));};
\ No newline at end of file
diff --git a/server/api/intVtigerField/intVtigerField.model.js b/server/api/intVtigerField/intVtigerField.model.js
index 53e1c44..8571ff0 100644
--- a/server/api/intVtigerField/intVtigerField.model.js
+++ b/server/api/intVtigerField/intVtigerField.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9bde=['util','api','bluebird','request-promise','path','rimraf','../../config/environment','./intVtigerField.attributes','exports','define','VtigerField','int_vtiger_fields','vtiger_unique_index','idField','FieldId'];(function(_0x26a818,_0x40708a){var _0x5d8ca0=function(_0x3cc7ed){while(--_0x3cc7ed){_0x26a818['push'](_0x26a818['shift']());}};_0x5d8ca0(++_0x40708a);}(_0x9bde,0xe1));var _0xe9bd=function(_0x3601f0,_0x34dda6){_0x3601f0=_0x3601f0-0x0;var _0x25e9db=_0x9bde[_0x3601f0];return _0x25e9db;};'use strict';var _=require('lodash');var util=require(_0xe9bd('0x0'));var logger=require('../../config/logger')(_0xe9bd('0x1'));var moment=require('moment');var BPromise=require(_0xe9bd('0x2'));var rp=require(_0xe9bd('0x3'));var fs=require('fs');var path=require(_0xe9bd('0x4'));var rimraf=require(_0xe9bd('0x5'));var config=require(_0xe9bd('0x6'));var attributes=require(_0xe9bd('0x7'));module[_0xe9bd('0x8')]=function(_0x4fd7b8,_0x4763e9){return _0x4fd7b8[_0xe9bd('0x9')](_0xe9bd('0xa'),attributes,{'tableName':_0xe9bd('0xb'),'paranoid':![],'indexes':[{'name':_0xe9bd('0xc'),'fields':[_0xe9bd('0xd'),_0xe9bd('0xe')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xa9e0=['define','VtigerField','idField','lodash','util','../../config/logger','bluebird','path','rimraf','../../config/environment','./intVtigerField.attributes','exports'];(function(_0x601338,_0x3e39ad){var _0x33a783=function(_0x2c4e36){while(--_0x2c4e36){_0x601338['push'](_0x601338['shift']());}};_0x33a783(++_0x3e39ad);}(_0xa9e0,0x123));var _0x0a9e=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xa9e0[_0x501510];return _0x1e6ee5;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var logger=require(_0x0a9e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x0a9e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0a9e('0x4'));var rimraf=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var attributes=require(_0x0a9e('0x7'));module[_0x0a9e('0x8')]=function(_0x57b080,_0x219af0){return _0x57b080[_0x0a9e('0x9')](_0x0a9e('0xa'),attributes,{'tableName':'int_vtiger_fields','paranoid':![],'indexes':[{'name':'vtiger_unique_index','fields':[_0x0a9e('0xb'),'FieldId'],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/intVtigerField/intVtigerField.rpc.js b/server/api/intVtigerField/intVtigerField.rpc.js
index 8e7da85..f37337b 100644
--- a/server/api/intVtigerField/intVtigerField.rpc.js
+++ b/server/api/intVtigerField/intVtigerField.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x8ba6=['ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','info','VtigerField,\x20%s,\x20%s','request\x20sent','debug','VtigerField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','moment','randomstring'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x8ba6,0x11b));var _0x68ba=function(_0xc38b80,_0x1e8df9){_0xc38b80=_0xc38b80-0x0;var _0x30388d=_0x8ba6[_0xc38b80];return _0x30388d;};'use strict';var _=require(_0x68ba('0x0'));var util=require('util');var moment=require(_0x68ba('0x1'));var BPromise=require('bluebird');var rs=require(_0x68ba('0x2'));var fs=require('fs');var Redis=require(_0x68ba('0x3'));var db=require(_0x68ba('0x4'))['db'];var utils=require(_0x68ba('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x68ba('0x6'));var jayson=require(_0x68ba('0x7'));var client=jayson[_0x68ba('0x8')][_0x68ba('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2ad848,_0x1ba7fa,_0x97b7a){return new BPromise(function(_0xc67bf0,_0x5aa5bd){return client[_0x68ba('0xa')](_0x2ad848,_0x97b7a)[_0x68ba('0xb')](function(_0x1ec922){logger[_0x68ba('0xc')](_0x68ba('0xd'),_0x1ba7fa,_0x68ba('0xe'));logger[_0x68ba('0xf')](_0x68ba('0x10'),_0x1ba7fa,_0x68ba('0xe'),JSON[_0x68ba('0x11')](_0x1ec922));if(_0x1ec922['error']){if(_0x1ec922[_0x68ba('0x12')][_0x68ba('0x13')]===0x1f4){logger['error']('VtigerField,\x20%s,\x20%s',_0x1ba7fa,_0x1ec922[_0x68ba('0x12')]['message']);return _0x5aa5bd(_0x1ec922[_0x68ba('0x12')][_0x68ba('0x14')]);}logger[_0x68ba('0x12')](_0x68ba('0xd'),_0x1ba7fa,_0x1ec922[_0x68ba('0x12')][_0x68ba('0x14')]);return _0xc67bf0(_0x1ec922[_0x68ba('0x12')]['message']);}else{logger[_0x68ba('0xc')](_0x68ba('0xd'),_0x1ba7fa,_0x68ba('0xe'));_0xc67bf0(_0x1ec922[_0x68ba('0x15')][_0x68ba('0x14')]);}})['catch'](function(_0x2babf4){logger[_0x68ba('0x12')]('VtigerField,\x20%s,\x20%s',_0x1ba7fa,_0x2babf4);_0x5aa5bd(_0x2babf4);});});}
\ No newline at end of file
+var _0xa3db=['client','http','request','then','info','request\x20sent','debug','VtigerField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','VtigerField,\x20%s,\x20%s','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','../../config/environment'];(function(_0x51c819,_0xd812db){var _0x15c5d2=function(_0x2977f0){while(--_0x2977f0){_0x51c819['push'](_0x51c819['shift']());}};_0x15c5d2(++_0xd812db);}(_0xa3db,0x10c));var _0xba3d=function(_0x1b3706,_0x405791){_0x1b3706=_0x1b3706-0x0;var _0x5cd3a5=_0xa3db[_0x1b3706];return _0x5cd3a5;};'use strict';var _=require(_0xba3d('0x0'));var util=require(_0xba3d('0x1'));var moment=require(_0xba3d('0x2'));var BPromise=require(_0xba3d('0x3'));var rs=require(_0xba3d('0x4'));var fs=require('fs');var Redis=require(_0xba3d('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xba3d('0x6'))('rpc');var config=require(_0xba3d('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xba3d('0x8')][_0xba3d('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x477583,_0x1bacd7,_0x1bd181){return new BPromise(function(_0x426868,_0x3b69e9){return client[_0xba3d('0xa')](_0x477583,_0x1bd181)[_0xba3d('0xb')](function(_0x102fe6){logger[_0xba3d('0xc')]('VtigerField,\x20%s,\x20%s',_0x1bacd7,_0xba3d('0xd'));logger[_0xba3d('0xe')](_0xba3d('0xf'),_0x1bacd7,_0xba3d('0xd'),JSON[_0xba3d('0x10')](_0x102fe6));if(_0x102fe6['error']){if(_0x102fe6[_0xba3d('0x11')][_0xba3d('0x12')]===0x1f4){logger[_0xba3d('0x11')]('VtigerField,\x20%s,\x20%s',_0x1bacd7,_0x102fe6['error'][_0xba3d('0x13')]);return _0x3b69e9(_0x102fe6[_0xba3d('0x11')]['message']);}logger['error'](_0xba3d('0x14'),_0x1bacd7,_0x102fe6['error'][_0xba3d('0x13')]);return _0x426868(_0x102fe6[_0xba3d('0x11')][_0xba3d('0x13')]);}else{logger[_0xba3d('0xc')](_0xba3d('0x14'),_0x1bacd7,_0xba3d('0xd'));_0x426868(_0x102fe6[_0xba3d('0x15')][_0xba3d('0x13')]);}})[_0xba3d('0x16')](function(_0x2ce092){logger['error'](_0xba3d('0x14'),_0x1bacd7,_0x2ce092);_0x3b69e9(_0x2ce092);});});}
\ No newline at end of file
diff --git a/server/api/intZendeskAccount/index.js b/server/api/intZendeskAccount/index.js
index 3c3bc6a..f72ec39 100644
--- a/server/api/intZendeskAccount/index.js
+++ b/server/api/intZendeskAccount/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x17a7=['multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZendeskAccount.controller','get','isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','addConfiguration','put','update','exports'];(function(_0x4d59a5,_0x188334){var _0x59bc80=function(_0x244c1e){while(--_0x244c1e){_0x4d59a5['push'](_0x4d59a5['shift']());}};_0x59bc80(++_0x188334);}(_0x17a7,0xfd));var _0x717a=function(_0x161bba,_0x148aaa){_0x161bba=_0x161bba-0x0;var _0x595113=_0x17a7[_0x161bba];return _0x595113;};'use strict';var multer=require(_0x717a('0x0'));var util=require(_0x717a('0x1'));var path=require(_0x717a('0x2'));var timeout=require('connect-timeout');var express=require(_0x717a('0x3'));var router=express[_0x717a('0x4')]();var auth=require(_0x717a('0x5'));var interaction=require(_0x717a('0x6'));var config=require(_0x717a('0x7'));var controller=require(_0x717a('0x8'));router[_0x717a('0x9')]('/',auth[_0x717a('0xa')](),controller[_0x717a('0xb')]);router[_0x717a('0x9')](_0x717a('0xc'),auth[_0x717a('0xa')](),controller[_0x717a('0xd')]);router['get'](_0x717a('0xe'),auth[_0x717a('0xa')](),controller[_0x717a('0xf')]);router[_0x717a('0x9')](_0x717a('0x10'),auth[_0x717a('0xa')](),controller[_0x717a('0x11')]);router[_0x717a('0x12')]('/',auth[_0x717a('0xa')](),controller['create']);router[_0x717a('0x12')]('/:id/configurations',auth['isAuthenticated'](),controller[_0x717a('0x13')]);router[_0x717a('0x14')]('/:id',auth[_0x717a('0xa')](),controller[_0x717a('0x15')]);router['delete'](_0x717a('0xc'),auth[_0x717a('0xa')](),controller['destroy']);module[_0x717a('0x16')]=router;
\ No newline at end of file
+var _0xc274=['../../config/environment','get','isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','update','delete','destroy','exports','multer','util','path','connect-timeout','express','../../components/interaction/service'];(function(_0x3f3858,_0x5b79a6){var _0x3fcee5=function(_0x33e072){while(--_0x33e072){_0x3f3858['push'](_0x3f3858['shift']());}};_0x3fcee5(++_0x5b79a6);}(_0xc274,0x6d));var _0x4c27=function(_0x2be959,_0x1add11){_0x2be959=_0x2be959-0x0;var _0x18487e=_0xc274[_0x2be959];return _0x18487e;};'use strict';var multer=require(_0x4c27('0x0'));var util=require(_0x4c27('0x1'));var path=require(_0x4c27('0x2'));var timeout=require(_0x4c27('0x3'));var express=require(_0x4c27('0x4'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x4c27('0x5'));var config=require(_0x4c27('0x6'));var controller=require('./intZendeskAccount.controller');router[_0x4c27('0x7')]('/',auth[_0x4c27('0x8')](),controller[_0x4c27('0x9')]);router[_0x4c27('0x7')](_0x4c27('0xa'),auth[_0x4c27('0x8')](),controller[_0x4c27('0xb')]);router['get'](_0x4c27('0xc'),auth[_0x4c27('0x8')](),controller[_0x4c27('0xd')]);router[_0x4c27('0x7')](_0x4c27('0xe'),auth[_0x4c27('0x8')](),controller[_0x4c27('0xf')]);router[_0x4c27('0x10')]('/',auth[_0x4c27('0x8')](),controller[_0x4c27('0x11')]);router[_0x4c27('0x10')]('/:id/configurations',auth['isAuthenticated'](),controller[_0x4c27('0x12')]);router['put'](_0x4c27('0xa'),auth[_0x4c27('0x8')](),controller[_0x4c27('0x13')]);router[_0x4c27('0x14')](_0x4c27('0xa'),auth[_0x4c27('0x8')](),controller[_0x4c27('0x15')]);module[_0x4c27('0x16')]=router;
\ No newline at end of file
diff --git a/server/api/intZendeskAccount/intZendeskAccount.attributes.js b/server/api/intZendeskAccount/intZendeskAccount.attributes.js
index db746c7..5ab6a39 100644
--- a/server/api/intZendeskAccount/intZendeskAccount.attributes.js
+++ b/server/api/intZendeskAccount/intZendeskAccount.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x46ee=['STRING','remoteUri','password','token','ENUM','integrationTab','newTab','exports'];(function(_0x5dfe4e,_0x2188ec){var _0x20b1fb=function(_0x256950){while(--_0x256950){_0x5dfe4e['push'](_0x5dfe4e['shift']());}};_0x20b1fb(++_0x2188ec);}(_0x46ee,0xb7));var _0xe46e=function(_0xb93ef9,_0x3547ca){_0xb93ef9=_0xb93ef9-0x0;var _0x5c7094=_0x46ee[_0xb93ef9];return _0x5c7094;};'use strict';var Sequelize=require('sequelize');module[_0xe46e('0x0')]={'name':{'type':Sequelize[_0xe46e('0x1')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0xe46e('0x1')],'unique':'username'},'password':{'type':Sequelize['STRING']},'token':{'type':Sequelize[_0xe46e('0x1')]},'remoteUri':{'type':Sequelize[_0xe46e('0x1')],'unique':_0xe46e('0x2')},'authType':{'type':Sequelize['ENUM'](_0xe46e('0x3'),_0xe46e('0x4')),'defaultValue':_0xe46e('0x3')},'serverUrl':{'type':Sequelize[_0xe46e('0x1')]},'type':{'type':Sequelize[_0xe46e('0x5')](_0xe46e('0x6'),_0xe46e('0x7')),'defaultValue':_0xe46e('0x6')}};
\ No newline at end of file
+var _0x02ce=['ENUM','password','token','newTab','integrationTab','sequelize','exports','STRING','remoteUri'];(function(_0x5998d0,_0x24ad81){var _0x47149d=function(_0x5e4d63){while(--_0x5e4d63){_0x5998d0['push'](_0x5998d0['shift']());}};_0x47149d(++_0x24ad81);}(_0x02ce,0x1ac));var _0xe02c=function(_0x5531ef,_0x79ea80){_0x5531ef=_0x5531ef-0x0;var _0x138b92=_0x02ce[_0x5531ef];return _0x138b92;};'use strict';var Sequelize=require(_0xe02c('0x0'));module[_0xe02c('0x1')]={'name':{'type':Sequelize[_0xe02c('0x2')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0xe02c('0x2')],'unique':'username'},'password':{'type':Sequelize[_0xe02c('0x2')]},'token':{'type':Sequelize[_0xe02c('0x2')]},'remoteUri':{'type':Sequelize[_0xe02c('0x2')],'unique':_0xe02c('0x3')},'authType':{'type':Sequelize[_0xe02c('0x4')](_0xe02c('0x5'),_0xe02c('0x6')),'defaultValue':_0xe02c('0x5')},'serverUrl':{'type':Sequelize[_0xe02c('0x2')]},'type':{'type':Sequelize['ENUM']('integrationTab',_0xe02c('0x7')),'defaultValue':_0xe02c('0x8')}};
\ No newline at end of file
diff --git a/server/api/intZendeskAccount/intZendeskAccount.controller.js b/server/api/intZendeskAccount/intZendeskAccount.controller.js
index 5c124fc..68acaa9 100644
--- a/server/api/intZendeskAccount/intZendeskAccount.controller.js
+++ b/server/api/intZendeskAccount/intZendeskAccount.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xfbd7=['ejs','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../mysqldb','../../components/integrations/configuration','jayson/promise','http','test','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','ZendeskAccount,\x20%s,\x20%s','request\x20sent','ZendeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','sendStatus','status','end','count','offset','limit','set','Content-Range','json','apply','reject','stack','name','send','index','rawAttributes','fieldName','key','model','query','keys','filters','attributes','intersection','fields','length','nolimit','sort','where','pick','filter','merge','map','type','VIRTUAL','includeAll','include','rows','catch','params','ZendeskAccount','options','create','update','body','destroy','find','getConfigurations','findOne','ZendeskConfiguration','hasOwnProperty','addConfiguration','Subjects','getSubjects','channel','Descriptions','getDescriptions','ZendeskField','getFields','username','password','token','authType','remoteUri','slice','lastIndexOf','format','%s/%s','ticket_fields','headers','Basic\x20%s','toString','base64','%s/token:%s','Sequelize','Unknown\x20authentication\x20type','subject','description','remove','position','system_field_options','custom_field_options','statusCode','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','eml-format','rimraf','bluebird','mustache','util','path','to-csv'];(function(_0x2d2891,_0x4b8dfc){var _0x235af2=function(_0x24884a){while(--_0x24884a){_0x2d2891['push'](_0x2d2891['shift']());}};_0x235af2(++_0x4b8dfc);}(_0xfbd7,0x1dd));var _0x7fbd=function(_0x30e86a,_0x43751b){_0x30e86a=_0x30e86a-0x0;var _0x100869=_0xfbd7[_0x30e86a];return _0x100869;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x7fbd('0x0'));var rimraf=require(_0x7fbd('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x7fbd('0x2'));var Mustache=require(_0x7fbd('0x3'));var util=require(_0x7fbd('0x4'));var path=require(_0x7fbd('0x5'));var sox=require('sox');var csv=require(_0x7fbd('0x6'));var ejs=require(_0x7fbd('0x7'));var fs=require('fs');var _=require(_0x7fbd('0x8'));var squel=require(_0x7fbd('0x9'));var crypto=require(_0x7fbd('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x7fbd('0xb'));var toCsv=require(_0x7fbd('0x6'));var querystring=require(_0x7fbd('0xc'));var Papa=require(_0x7fbd('0xd'));var Redis=require(_0x7fbd('0xe'));var authService=require(_0x7fbd('0xf'));var qs=require(_0x7fbd('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x7fbd('0x11'))(_0x7fbd('0x12'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x7fbd('0x13'))['db'];var integrations=require(_0x7fbd('0x14'));var jayson=require(_0x7fbd('0x15'));var client=jayson['client'][_0x7fbd('0x16')]({'port':0x232a});function checkPasswordPattern(_0x3f6299,_0x51e044,_0x228870){if(_0x228870){var _0x6d52f=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x6d52f[_0x7fbd('0x17')](_0x51e044)){return _0x3f6299;}else{throw new db['Sequelize'][(_0x7fbd('0x18'))](_0x7fbd('0x19'));}}else{return _0x3f6299;}}function respondWithRpcPromise(_0x626975,_0x404b27,_0x399722,_0x1ed4a9){return new BPromise(function(_0x240074,_0x227cd0){var _0x17b3c0=_0x1ed4a9||client;return _0x17b3c0[_0x7fbd('0x1a')](_0x626975,_0x399722)[_0x7fbd('0x1b')](function(_0x429fa9){logger[_0x7fbd('0x1c')](_0x7fbd('0x1d'),_0x404b27,_0x7fbd('0x1e'));logger['debug'](_0x7fbd('0x1f'),_0x404b27,'request\x20sent',JSON[_0x7fbd('0x20')](_0x429fa9));if(_0x429fa9['error']){if(_0x429fa9[_0x7fbd('0x21')][_0x7fbd('0x22')]===0x1f4){logger[_0x7fbd('0x21')](_0x7fbd('0x1d'),_0x404b27,_0x429fa9[_0x7fbd('0x21')][_0x7fbd('0x23')]);return _0x227cd0(_0x429fa9[_0x7fbd('0x21')]['message']);}logger[_0x7fbd('0x21')]('ZendeskAccount,\x20%s,\x20%s',_0x404b27,_0x429fa9[_0x7fbd('0x21')][_0x7fbd('0x23')]);return _0x240074(_0x429fa9[_0x7fbd('0x21')]['message']);}else{logger[_0x7fbd('0x1c')](_0x7fbd('0x1d'),_0x404b27,'request\x20sent');_0x240074(_0x429fa9['result'][_0x7fbd('0x23')]);}})['catch'](function(_0x1a4ffc){logger[_0x7fbd('0x21')](_0x7fbd('0x1d'),_0x404b27,_0x1a4ffc);_0x227cd0(_0x1a4ffc);});});}function respondWithStatusCode(_0x4fef16,_0x170cdb){_0x170cdb=_0x170cdb||0xcc;return function(_0x168d7b){if(_0x168d7b){return _0x4fef16[_0x7fbd('0x24')](_0x170cdb);}return _0x4fef16[_0x7fbd('0x25')](_0x170cdb)[_0x7fbd('0x26')]();};}function respondWithResult(_0x3562f0,_0x3f1323){_0x3f1323=_0x3f1323||0xc8;return function(_0x1ecfe6){if(_0x1ecfe6){return _0x3562f0[_0x7fbd('0x25')](_0x3f1323)['json'](_0x1ecfe6);}};}function respondWithFilteredResult(_0x3b7ce4,_0x527512){return function(_0x3ff2d6){if(_0x3ff2d6){var _0x152c50=_0x3ff2d6[_0x7fbd('0x27')],_0x116a97=_0x527512['offset'],_0x134e85=_0x527512[_0x7fbd('0x28')]+_0x527512[_0x7fbd('0x29')],_0x50ddeb;if(_0x134e85>=_0x152c50){_0x134e85=_0x152c50;_0x50ddeb=0xc8;}else{_0x50ddeb=0xce;}_0x3b7ce4[_0x7fbd('0x25')](_0x50ddeb);return _0x3b7ce4[_0x7fbd('0x2a')](_0x7fbd('0x2b'),_0x116a97+'-'+_0x134e85+'/'+_0x152c50)[_0x7fbd('0x2c')](_0x3ff2d6);}return null;};}function patchUpdates(_0x3b0392){return function(_0x24acf9){try{jsonpatch[_0x7fbd('0x2d')](_0x24acf9,_0x3b0392,!![]);}catch(_0x32934c){return BPromise[_0x7fbd('0x2e')](_0x32934c);}return _0x24acf9['save']();};}function saveUpdates(_0x34b17f,_0x52f754){return function(_0x5cd604){if(_0x5cd604){return _0x5cd604['update'](_0x34b17f)['then'](function(_0x567f57){return _0x567f57;});}return null;};}function removeEntity(_0xf223ba,_0x406a8f){return function(_0xeada54){if(_0xeada54){return _0xeada54['destroy']()['then'](function(){_0xf223ba[_0x7fbd('0x25')](0xcc)[_0x7fbd('0x26')]();});}};}function handleEntityNotFound(_0x4e335e,_0xe49566){return function(_0xf4b5a2){if(!_0xf4b5a2){_0x4e335e['sendStatus'](0x194);}return _0xf4b5a2;};}function handleError(_0x10708f,_0x5763f9){_0x5763f9=_0x5763f9||0x1f4;return function(_0x405d1f){logger[_0x7fbd('0x21')](_0x405d1f[_0x7fbd('0x2f')]);if(_0x405d1f[_0x7fbd('0x30')]){delete _0x405d1f['name'];}_0x10708f[_0x7fbd('0x25')](_0x5763f9)[_0x7fbd('0x31')](_0x405d1f);};}exports[_0x7fbd('0x32')]=function(_0x512d5b,_0x3fafb7){var _0x57077d={},_0x1ff088={},_0x1fc910={'count':0x0,'rows':[]};var _0x44ede3=_['map'](db['ZendeskAccount'][_0x7fbd('0x33')],function(_0x3b0e45){return{'name':_0x3b0e45[_0x7fbd('0x34')],'type':_0x3b0e45['type'][_0x7fbd('0x35')]};});_0x1ff088[_0x7fbd('0x36')]=_['map'](_0x44ede3,_0x7fbd('0x30'));_0x1ff088[_0x7fbd('0x37')]=_[_0x7fbd('0x38')](_0x512d5b[_0x7fbd('0x37')]);_0x1ff088[_0x7fbd('0x39')]=_['intersection'](_0x1ff088['model'],_0x1ff088[_0x7fbd('0x37')]);_0x57077d[_0x7fbd('0x3a')]=_[_0x7fbd('0x3b')](_0x1ff088[_0x7fbd('0x36')],qs[_0x7fbd('0x3c')](_0x512d5b[_0x7fbd('0x37')]['fields']));_0x57077d[_0x7fbd('0x3a')]=_0x57077d[_0x7fbd('0x3a')][_0x7fbd('0x3d')]?_0x57077d[_0x7fbd('0x3a')]:_0x1ff088[_0x7fbd('0x36')];if(!_0x512d5b[_0x7fbd('0x37')]['hasOwnProperty'](_0x7fbd('0x3e'))){_0x57077d[_0x7fbd('0x29')]=qs[_0x7fbd('0x29')](_0x512d5b[_0x7fbd('0x37')]['limit']);_0x57077d[_0x7fbd('0x28')]=qs['offset'](_0x512d5b['query'][_0x7fbd('0x28')]);}_0x57077d['order']=qs[_0x7fbd('0x3f')](_0x512d5b[_0x7fbd('0x37')][_0x7fbd('0x3f')]);_0x57077d[_0x7fbd('0x40')]=qs[_0x7fbd('0x39')](_[_0x7fbd('0x41')](_0x512d5b[_0x7fbd('0x37')],_0x1ff088[_0x7fbd('0x39')]),_0x44ede3);if(_0x512d5b[_0x7fbd('0x37')][_0x7fbd('0x42')]){_0x57077d[_0x7fbd('0x40')]=_[_0x7fbd('0x43')](_0x57077d[_0x7fbd('0x40')],{'$or':_[_0x7fbd('0x44')](_0x44ede3,function(_0x48c1d5){if(_0x48c1d5[_0x7fbd('0x45')]!==_0x7fbd('0x46')){var _0xe5689f={};_0xe5689f[_0x48c1d5['name']]={'$like':'%'+_0x512d5b[_0x7fbd('0x37')][_0x7fbd('0x42')]+'%'};return _0xe5689f;}})});}_0x57077d=_[_0x7fbd('0x43')]({},_0x57077d,_0x512d5b['options']);var _0x2bc90b={'where':_0x57077d['where']};return db['ZendeskAccount'][_0x7fbd('0x27')](_0x2bc90b)[_0x7fbd('0x1b')](function(_0x5f185c){_0x1fc910[_0x7fbd('0x27')]=_0x5f185c;if(_0x512d5b[_0x7fbd('0x37')][_0x7fbd('0x47')]){_0x57077d[_0x7fbd('0x48')]=[{'all':!![]}];}return db['ZendeskAccount']['findAll'](_0x57077d);})[_0x7fbd('0x1b')](function(_0xdab847){_0x1fc910[_0x7fbd('0x49')]=_0xdab847;return _0x1fc910;})[_0x7fbd('0x1b')](respondWithFilteredResult(_0x3fafb7,_0x57077d))[_0x7fbd('0x4a')](handleError(_0x3fafb7,null));};exports['show']=function(_0x3dd1db,_0x421149){var _0x485006={'raw':![],'where':{'id':_0x3dd1db[_0x7fbd('0x4b')]['id']}},_0x40420f={};_0x40420f[_0x7fbd('0x36')]=_[_0x7fbd('0x38')](db[_0x7fbd('0x4c')][_0x7fbd('0x33')]);_0x40420f[_0x7fbd('0x37')]=_[_0x7fbd('0x38')](_0x3dd1db['query']);_0x40420f[_0x7fbd('0x39')]=_['intersection'](_0x40420f['model'],_0x40420f[_0x7fbd('0x37')]);_0x485006[_0x7fbd('0x3a')]=_[_0x7fbd('0x3b')](_0x40420f[_0x7fbd('0x36')],qs['fields'](_0x3dd1db[_0x7fbd('0x37')]['fields']));_0x485006[_0x7fbd('0x3a')]=_0x485006[_0x7fbd('0x3a')][_0x7fbd('0x3d')]?_0x485006[_0x7fbd('0x3a')]:_0x40420f[_0x7fbd('0x36')];if(_0x3dd1db[_0x7fbd('0x37')][_0x7fbd('0x47')]){_0x485006[_0x7fbd('0x48')]=[{'all':!![]}];}_0x485006=_[_0x7fbd('0x43')]({},_0x485006,_0x3dd1db[_0x7fbd('0x4d')]);return db[_0x7fbd('0x4c')]['find'](_0x485006)[_0x7fbd('0x1b')](handleEntityNotFound(_0x421149,null))[_0x7fbd('0x1b')](respondWithResult(_0x421149,null))[_0x7fbd('0x4a')](handleError(_0x421149,null));};exports[_0x7fbd('0x4e')]=function(_0xaab636,_0x4d1d96){return db[_0x7fbd('0x4c')][_0x7fbd('0x4e')](_0xaab636['body'],{})['then'](respondWithResult(_0x4d1d96,0xc9))['catch'](handleError(_0x4d1d96,null));};exports[_0x7fbd('0x4f')]=function(_0x26ff6b,_0xd1d62b){if(_0x26ff6b['body']['id']){delete _0x26ff6b[_0x7fbd('0x50')]['id'];}return db['ZendeskAccount']['find']({'where':{'id':_0x26ff6b['params']['id']}})[_0x7fbd('0x1b')](handleEntityNotFound(_0xd1d62b,null))[_0x7fbd('0x1b')](saveUpdates(_0x26ff6b['body'],null))[_0x7fbd('0x1b')](respondWithResult(_0xd1d62b,null))[_0x7fbd('0x4a')](handleError(_0xd1d62b,null));};exports[_0x7fbd('0x51')]=function(_0x5b39b7,_0x38fcad){return db[_0x7fbd('0x4c')][_0x7fbd('0x52')]({'where':{'id':_0x5b39b7[_0x7fbd('0x4b')]['id']}})['then'](handleEntityNotFound(_0x38fcad,null))['then'](removeEntity(_0x38fcad,null))[_0x7fbd('0x4a')](handleError(_0x38fcad,null));};exports[_0x7fbd('0x53')]=function(_0x3102d5,_0x485b07,_0x1b4963){var _0x471430={};var _0x494997={};var _0x122925;var _0x13ff40;return db['ZendeskAccount'][_0x7fbd('0x54')]({'where':{'id':_0x3102d5[_0x7fbd('0x4b')]['id']}})[_0x7fbd('0x1b')](handleEntityNotFound(_0x485b07,null))[_0x7fbd('0x1b')](function(_0x522fbe){if(_0x522fbe){_0x122925=_0x522fbe;_0x494997[_0x7fbd('0x36')]=_['keys'](db[_0x7fbd('0x55')][_0x7fbd('0x33')]);_0x494997[_0x7fbd('0x37')]=_[_0x7fbd('0x38')](_0x3102d5['query']);_0x494997['filters']=_[_0x7fbd('0x3b')](_0x494997[_0x7fbd('0x36')],_0x494997[_0x7fbd('0x37')]);_0x471430[_0x7fbd('0x3a')]=_[_0x7fbd('0x3b')](_0x494997['model'],qs[_0x7fbd('0x3c')](_0x3102d5['query']['fields']));_0x471430['attributes']=_0x471430[_0x7fbd('0x3a')][_0x7fbd('0x3d')]?_0x471430[_0x7fbd('0x3a')]:_0x494997[_0x7fbd('0x36')];_0x471430['order']=qs['sort'](_0x3102d5[_0x7fbd('0x37')][_0x7fbd('0x3f')]);_0x471430['where']=qs[_0x7fbd('0x39')](_[_0x7fbd('0x41')](_0x3102d5[_0x7fbd('0x37')],_0x494997[_0x7fbd('0x39')]));if(_0x3102d5[_0x7fbd('0x37')][_0x7fbd('0x42')]){_0x471430['where']=_[_0x7fbd('0x43')](_0x471430[_0x7fbd('0x40')],{'$or':_[_0x7fbd('0x44')](_0x471430['attributes'],function(_0x20e97f){var _0x28cc4e={};_0x28cc4e[_0x20e97f]={'$like':'%'+_0x3102d5[_0x7fbd('0x37')][_0x7fbd('0x42')]+'%'};return _0x28cc4e;})});}_0x471430=_[_0x7fbd('0x43')]({},_0x471430,_0x3102d5[_0x7fbd('0x4d')]);return _0x122925[_0x7fbd('0x53')](_0x471430);}})[_0x7fbd('0x1b')](function(_0x1f6e08){if(_0x1f6e08){_0x13ff40=_0x1f6e08['length'];if(!_0x3102d5['query'][_0x7fbd('0x56')](_0x7fbd('0x3e'))){_0x471430['limit']=qs[_0x7fbd('0x29')](_0x3102d5[_0x7fbd('0x37')][_0x7fbd('0x29')]);_0x471430[_0x7fbd('0x28')]=qs['offset'](_0x3102d5[_0x7fbd('0x37')][_0x7fbd('0x28')]);}return _0x122925[_0x7fbd('0x53')](_0x471430);}})[_0x7fbd('0x1b')](function(_0x2451a2){if(_0x2451a2){return _0x2451a2?{'count':_0x13ff40,'rows':_0x2451a2}:null;}})[_0x7fbd('0x1b')](respondWithResult(_0x485b07,null))[_0x7fbd('0x4a')](handleError(_0x485b07,null));};exports[_0x7fbd('0x57')]=function(_0x1044ee,_0x4ed09b,_0x37fb02){if(_0x1044ee[_0x7fbd('0x50')]['id']){delete _0x1044ee[_0x7fbd('0x50')]['id'];}return db[_0x7fbd('0x4c')][_0x7fbd('0x54')]({'where':{'id':_0x1044ee[_0x7fbd('0x4b')]['id']}})[_0x7fbd('0x1b')](handleEntityNotFound(_0x4ed09b,null))[_0x7fbd('0x1b')](function(_0x3a5013){if(_0x3a5013){_0x1044ee[_0x7fbd('0x50')]['AccountId']=_0x3a5013['id'];_0x1044ee[_0x7fbd('0x50')][_0x7fbd('0x58')]=integrations[_0x7fbd('0x59')](_0x1044ee['body'][_0x7fbd('0x5a')],_0x1044ee[_0x7fbd('0x50')][_0x7fbd('0x45')]);_0x1044ee['body'][_0x7fbd('0x5b')]=integrations[_0x7fbd('0x5c')](_0x1044ee[_0x7fbd('0x50')]['channel'],_0x1044ee['body'][_0x7fbd('0x45')]);return db[_0x7fbd('0x55')][_0x7fbd('0x4e')](_0x1044ee['body'],{'include':[{'model':db[_0x7fbd('0x5d')],'as':'Subjects'},{'model':db['ZendeskField'],'as':'Descriptions'}]});}return null;})[_0x7fbd('0x1b')](respondWithResult(_0x4ed09b,null))[_0x7fbd('0x4a')](handleError(_0x4ed09b,null));};exports[_0x7fbd('0x5e')]=function(_0x3474bb,_0x5b9e86,_0x2d8d22){var _0x227bf5='';return db[_0x7fbd('0x4c')][_0x7fbd('0x54')]({'where':{'id':_0x3474bb[_0x7fbd('0x4b')]['id']},'attributes':['id',_0x7fbd('0x5f'),_0x7fbd('0x60'),_0x7fbd('0x61'),_0x7fbd('0x62'),_0x7fbd('0x63')]})[_0x7fbd('0x1b')](handleEntityNotFound(_0x5b9e86,null))['then'](function(_0x3b3403){if(_0x3b3403){_0x227bf5=_0x3b3403[_0x7fbd('0x63')];var _0x139b1e=_0x227bf5[_0x7fbd('0x64')](-0x1);if(_0x139b1e==='/'){_0x227bf5=_0x227bf5['substring'](0x0,_0x227bf5[_0x7fbd('0x65')](_0x139b1e));}var _0x2b0281={'method':'GET','uri':util[_0x7fbd('0x66')](_0x7fbd('0x67'),_0x227bf5,_0x7fbd('0x68')),'json':!![]};switch(_0x3b3403[_0x7fbd('0x62')]){case _0x7fbd('0x60'):_0x2b0281[_0x7fbd('0x69')]={'Authorization':util[_0x7fbd('0x66')](_0x7fbd('0x6a'),new Buffer(util[_0x7fbd('0x66')]('%s:%s',_0x3b3403['username'],_0x3b3403[_0x7fbd('0x60')]))[_0x7fbd('0x6b')](_0x7fbd('0x6c')))};break;case _0x7fbd('0x61'):_0x2b0281[_0x7fbd('0x69')]={'Authorization':util[_0x7fbd('0x66')](_0x7fbd('0x6a'),new Buffer(util[_0x7fbd('0x66')](_0x7fbd('0x6d'),_0x3b3403['username'],_0x3b3403[_0x7fbd('0x61')]))[_0x7fbd('0x6b')](_0x7fbd('0x6c')))};break;default:throw new db[(_0x7fbd('0x6e'))][(_0x7fbd('0x18'))](_0x7fbd('0x6f'));}return rp(_0x2b0281);}})['then'](function(_0x4591d8){if(_0x4591d8){var _0x880517=[_0x7fbd('0x70'),_0x7fbd('0x71'),'group','assignee'];_[_0x7fbd('0x72')](_0x4591d8[_0x7fbd('0x68')],function(_0x5946d5){return _0x880517['includes'](_0x5946d5[_0x7fbd('0x45')]);});return{'count':_0x4591d8[_0x7fbd('0x68')][_0x7fbd('0x3d')],'rows':_['map'](_0x4591d8[_0x7fbd('0x68')],function(_0x23bdc2){return{'id':_0x23bdc2['id'],'name':_0x23bdc2['position']>0x7?_0x23bdc2['title']:_0x23bdc2[_0x7fbd('0x45')],'custom':_0x23bdc2[_0x7fbd('0x73')]>0x7?!![]:![],'options':_0x23bdc2[_0x7fbd('0x74')]?_0x23bdc2[_0x7fbd('0x74')]:_0x23bdc2[_0x7fbd('0x75')]?_0x23bdc2[_0x7fbd('0x75')]:[]};})};}})[_0x7fbd('0x1b')](respondWithResult(_0x5b9e86,null))[_0x7fbd('0x4a')](function(_0x2abd50){var _0x8d098b=_0x3474bb[_0x7fbd('0x37')]['test']?0x1f4:_0x2abd50[_0x7fbd('0x76')]||0x1f4;logger[_0x7fbd('0x21')](_0x7fbd('0x77'),'getFields',_0x8d098b,JSON[_0x7fbd('0x20')](_0x2abd50));delete _0x2abd50[_0x7fbd('0x30')];if(_0x8d098b===0x191){_0x8d098b=0x190;}_0x5b9e86['status'](_0x8d098b)[_0x7fbd('0x31')](_0x3474bb['query'][_0x7fbd('0x17')]?{'message':_0x7fbd('0x78'),'statusCode':_0x2abd50[_0x7fbd('0x76')]}:_0x2abd50);});};
\ No newline at end of file
+var _0xb7fc=['then','info','ZendeskAccount,\x20%s,\x20%s','request\x20sent','debug','ZendeskAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','sendStatus','status','end','json','offset','limit','set','Content-Range','save','destroy','name','send','index','ZendeskAccount','rawAttributes','fieldName','key','map','query','keys','intersection','model','fields','attributes','hasOwnProperty','order','sort','where','pick','filter','type','VIRTUAL','merge','options','count','includeAll','findAll','show','params','filters','include','find','create','body','update','getConfigurations','findOne','ZendeskConfiguration','length','nolimit','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','ZendeskField','getFields','username','token','authType','remoteUri','slice','substring','lastIndexOf','GET','format','%s/%s','ticket_fields','password','headers','toString','Basic\x20%s','%s/token:%s','base64','Sequelize','ValidationError','Unknown\x20authentication\x20type','subject','description','remove','position','system_field_options','custom_field_options','statusCode','stringify','test','Wrong\x20credentials','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','../../components/integrations/configuration','jayson/promise','client','http'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb7fc,0x1ec));var _0xcb7f=function(_0x48f8c4,_0x4e3dba){_0x48f8c4=_0x48f8c4-0x0;var _0x118849=_0xb7fc[_0x48f8c4];return _0x118849;};'use strict';var pdf=require(_0xcb7f('0x0'));var emlformat=require(_0xcb7f('0x1'));var rimraf=require(_0xcb7f('0x2'));var zipdir=require(_0xcb7f('0x3'));var jsonpatch=require(_0xcb7f('0x4'));var rp=require(_0xcb7f('0x5'));var moment=require(_0xcb7f('0x6'));var BPromise=require('bluebird');var Mustache=require(_0xcb7f('0x7'));var util=require(_0xcb7f('0x8'));var path=require(_0xcb7f('0x9'));var sox=require(_0xcb7f('0xa'));var csv=require(_0xcb7f('0xb'));var ejs=require(_0xcb7f('0xc'));var fs=require('fs');var _=require(_0xcb7f('0xd'));var squel=require(_0xcb7f('0xe'));var crypto=require(_0xcb7f('0xf'));var jsforce=require(_0xcb7f('0x10'));var deskjs=require(_0xcb7f('0x11'));var toCsv=require(_0xcb7f('0xb'));var querystring=require(_0xcb7f('0x12'));var Papa=require(_0xcb7f('0x13'));var Redis=require(_0xcb7f('0x14'));var authService=require(_0xcb7f('0x15'));var qs=require('../../components/parsers/qs');var as=require(_0xcb7f('0x16'));var hardwareService=require(_0xcb7f('0x17'));var logger=require(_0xcb7f('0x18'))(_0xcb7f('0x19'));var utils=require(_0xcb7f('0x1a'));var config=require('../../config/environment');var db=require(_0xcb7f('0x1b'))['db'];var integrations=require(_0xcb7f('0x1c'));var jayson=require(_0xcb7f('0x1d'));var client=jayson[_0xcb7f('0x1e')][_0xcb7f('0x1f')]({'port':0x232a});function checkPasswordPattern(_0x966e75,_0x19e9e9,_0x2ac4de){if(_0x2ac4de){var _0x2b56ee=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x2b56ee['test'](_0x19e9e9)){return _0x966e75;}else{throw new db['Sequelize']['ValidationError']('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x966e75;}}function respondWithRpcPromise(_0x20152d,_0x114d3a,_0x52953f,_0xc6d901){return new BPromise(function(_0x5be246,_0x2666f8){var _0x145d63=_0xc6d901||client;return _0x145d63['request'](_0x20152d,_0x52953f)[_0xcb7f('0x20')](function(_0xc9e2d2){logger[_0xcb7f('0x21')](_0xcb7f('0x22'),_0x114d3a,_0xcb7f('0x23'));logger[_0xcb7f('0x24')](_0xcb7f('0x25'),_0x114d3a,'request\x20sent',JSON['stringify'](_0xc9e2d2));if(_0xc9e2d2[_0xcb7f('0x26')]){if(_0xc9e2d2[_0xcb7f('0x26')][_0xcb7f('0x27')]===0x1f4){logger[_0xcb7f('0x26')](_0xcb7f('0x22'),_0x114d3a,_0xc9e2d2[_0xcb7f('0x26')][_0xcb7f('0x28')]);return _0x2666f8(_0xc9e2d2[_0xcb7f('0x26')]['message']);}logger[_0xcb7f('0x26')]('ZendeskAccount,\x20%s,\x20%s',_0x114d3a,_0xc9e2d2[_0xcb7f('0x26')][_0xcb7f('0x28')]);return _0x5be246(_0xc9e2d2[_0xcb7f('0x26')][_0xcb7f('0x28')]);}else{logger['info'](_0xcb7f('0x22'),_0x114d3a,_0xcb7f('0x23'));_0x5be246(_0xc9e2d2[_0xcb7f('0x29')][_0xcb7f('0x28')]);}})[_0xcb7f('0x2a')](function(_0x1ba3e9){logger[_0xcb7f('0x26')](_0xcb7f('0x22'),_0x114d3a,_0x1ba3e9);_0x2666f8(_0x1ba3e9);});});}function respondWithStatusCode(_0x2aba6f,_0x5bc48a){_0x5bc48a=_0x5bc48a||0xcc;return function(_0x1c5115){if(_0x1c5115){return _0x2aba6f[_0xcb7f('0x2b')](_0x5bc48a);}return _0x2aba6f[_0xcb7f('0x2c')](_0x5bc48a)[_0xcb7f('0x2d')]();};}function respondWithResult(_0x11d992,_0x10fc6){_0x10fc6=_0x10fc6||0xc8;return function(_0x5735d9){if(_0x5735d9){return _0x11d992[_0xcb7f('0x2c')](_0x10fc6)[_0xcb7f('0x2e')](_0x5735d9);}};}function respondWithFilteredResult(_0x57bf10,_0x47987d){return function(_0x44c11e){if(_0x44c11e){var _0x10c0c4=_0x44c11e['count'],_0x40eb0b=_0x47987d[_0xcb7f('0x2f')],_0x4fa487=_0x47987d[_0xcb7f('0x2f')]+_0x47987d[_0xcb7f('0x30')],_0x228053;if(_0x4fa487>=_0x10c0c4){_0x4fa487=_0x10c0c4;_0x228053=0xc8;}else{_0x228053=0xce;}_0x57bf10[_0xcb7f('0x2c')](_0x228053);return _0x57bf10[_0xcb7f('0x31')](_0xcb7f('0x32'),_0x40eb0b+'-'+_0x4fa487+'/'+_0x10c0c4)['json'](_0x44c11e);}return null;};}function patchUpdates(_0x18861c){return function(_0x2c1f31){try{jsonpatch['apply'](_0x2c1f31,_0x18861c,!![]);}catch(_0x40377b){return BPromise['reject'](_0x40377b);}return _0x2c1f31[_0xcb7f('0x33')]();};}function saveUpdates(_0x3403f3,_0x4c6c6c){return function(_0x308dc2){if(_0x308dc2){return _0x308dc2['update'](_0x3403f3)[_0xcb7f('0x20')](function(_0x1a41fa){return _0x1a41fa;});}return null;};}function removeEntity(_0x45226d,_0xff290a){return function(_0x59ea15){if(_0x59ea15){return _0x59ea15[_0xcb7f('0x34')]()[_0xcb7f('0x20')](function(){_0x45226d[_0xcb7f('0x2c')](0xcc)[_0xcb7f('0x2d')]();});}};}function handleEntityNotFound(_0x36247c,_0x3e98f6){return function(_0x3011af){if(!_0x3011af){_0x36247c[_0xcb7f('0x2b')](0x194);}return _0x3011af;};}function handleError(_0x52d637,_0x5b4c30){_0x5b4c30=_0x5b4c30||0x1f4;return function(_0x36bfa6){logger['error'](_0x36bfa6['stack']);if(_0x36bfa6[_0xcb7f('0x35')]){delete _0x36bfa6[_0xcb7f('0x35')];}_0x52d637[_0xcb7f('0x2c')](_0x5b4c30)[_0xcb7f('0x36')](_0x36bfa6);};}exports[_0xcb7f('0x37')]=function(_0x972478,_0x181243){var _0x3a1bfd={},_0x776af3={},_0x33d383={'count':0x0,'rows':[]};var _0x1be6ef=_['map'](db[_0xcb7f('0x38')][_0xcb7f('0x39')],function(_0x7462){return{'name':_0x7462[_0xcb7f('0x3a')],'type':_0x7462['type'][_0xcb7f('0x3b')]};});_0x776af3['model']=_[_0xcb7f('0x3c')](_0x1be6ef,'name');_0x776af3[_0xcb7f('0x3d')]=_[_0xcb7f('0x3e')](_0x972478['query']);_0x776af3['filters']=_[_0xcb7f('0x3f')](_0x776af3[_0xcb7f('0x40')],_0x776af3[_0xcb7f('0x3d')]);_0x3a1bfd['attributes']=_[_0xcb7f('0x3f')](_0x776af3[_0xcb7f('0x40')],qs[_0xcb7f('0x41')](_0x972478['query']['fields']));_0x3a1bfd['attributes']=_0x3a1bfd['attributes']['length']?_0x3a1bfd[_0xcb7f('0x42')]:_0x776af3[_0xcb7f('0x40')];if(!_0x972478[_0xcb7f('0x3d')][_0xcb7f('0x43')]('nolimit')){_0x3a1bfd[_0xcb7f('0x30')]=qs[_0xcb7f('0x30')](_0x972478[_0xcb7f('0x3d')][_0xcb7f('0x30')]);_0x3a1bfd['offset']=qs['offset'](_0x972478[_0xcb7f('0x3d')][_0xcb7f('0x2f')]);}_0x3a1bfd[_0xcb7f('0x44')]=qs[_0xcb7f('0x45')](_0x972478['query'][_0xcb7f('0x45')]);_0x3a1bfd[_0xcb7f('0x46')]=qs['filters'](_[_0xcb7f('0x47')](_0x972478['query'],_0x776af3['filters']),_0x1be6ef);if(_0x972478[_0xcb7f('0x3d')][_0xcb7f('0x48')]){_0x3a1bfd['where']=_['merge'](_0x3a1bfd[_0xcb7f('0x46')],{'$or':_['map'](_0x1be6ef,function(_0x24fbf1){if(_0x24fbf1[_0xcb7f('0x49')]!==_0xcb7f('0x4a')){var _0x15ed88={};_0x15ed88[_0x24fbf1[_0xcb7f('0x35')]]={'$like':'%'+_0x972478[_0xcb7f('0x3d')][_0xcb7f('0x48')]+'%'};return _0x15ed88;}})});}_0x3a1bfd=_[_0xcb7f('0x4b')]({},_0x3a1bfd,_0x972478[_0xcb7f('0x4c')]);var _0x4c0363={'where':_0x3a1bfd[_0xcb7f('0x46')]};return db['ZendeskAccount']['count'](_0x4c0363)[_0xcb7f('0x20')](function(_0x5177ab){_0x33d383[_0xcb7f('0x4d')]=_0x5177ab;if(_0x972478[_0xcb7f('0x3d')][_0xcb7f('0x4e')]){_0x3a1bfd['include']=[{'all':!![]}];}return db[_0xcb7f('0x38')][_0xcb7f('0x4f')](_0x3a1bfd);})[_0xcb7f('0x20')](function(_0x558a98){_0x33d383['rows']=_0x558a98;return _0x33d383;})[_0xcb7f('0x20')](respondWithFilteredResult(_0x181243,_0x3a1bfd))[_0xcb7f('0x2a')](handleError(_0x181243,null));};exports[_0xcb7f('0x50')]=function(_0x2a5467,_0x64488){var _0x22f429={'raw':![],'where':{'id':_0x2a5467[_0xcb7f('0x51')]['id']}},_0x22176c={};_0x22176c['model']=_['keys'](db[_0xcb7f('0x38')][_0xcb7f('0x39')]);_0x22176c[_0xcb7f('0x3d')]=_[_0xcb7f('0x3e')](_0x2a5467[_0xcb7f('0x3d')]);_0x22176c[_0xcb7f('0x52')]=_[_0xcb7f('0x3f')](_0x22176c[_0xcb7f('0x40')],_0x22176c[_0xcb7f('0x3d')]);_0x22f429[_0xcb7f('0x42')]=_[_0xcb7f('0x3f')](_0x22176c[_0xcb7f('0x40')],qs['fields'](_0x2a5467[_0xcb7f('0x3d')]['fields']));_0x22f429[_0xcb7f('0x42')]=_0x22f429[_0xcb7f('0x42')]['length']?_0x22f429[_0xcb7f('0x42')]:_0x22176c[_0xcb7f('0x40')];if(_0x2a5467[_0xcb7f('0x3d')][_0xcb7f('0x4e')]){_0x22f429[_0xcb7f('0x53')]=[{'all':!![]}];}_0x22f429=_[_0xcb7f('0x4b')]({},_0x22f429,_0x2a5467[_0xcb7f('0x4c')]);return db[_0xcb7f('0x38')][_0xcb7f('0x54')](_0x22f429)[_0xcb7f('0x20')](handleEntityNotFound(_0x64488,null))[_0xcb7f('0x20')](respondWithResult(_0x64488,null))[_0xcb7f('0x2a')](handleError(_0x64488,null));};exports[_0xcb7f('0x55')]=function(_0x1025c5,_0x23b740){return db[_0xcb7f('0x38')]['create'](_0x1025c5[_0xcb7f('0x56')],{})['then'](respondWithResult(_0x23b740,0xc9))[_0xcb7f('0x2a')](handleError(_0x23b740,null));};exports[_0xcb7f('0x57')]=function(_0x175da0,_0x5add39){if(_0x175da0['body']['id']){delete _0x175da0[_0xcb7f('0x56')]['id'];}return db[_0xcb7f('0x38')][_0xcb7f('0x54')]({'where':{'id':_0x175da0[_0xcb7f('0x51')]['id']}})[_0xcb7f('0x20')](handleEntityNotFound(_0x5add39,null))[_0xcb7f('0x20')](saveUpdates(_0x175da0[_0xcb7f('0x56')],null))[_0xcb7f('0x20')](respondWithResult(_0x5add39,null))[_0xcb7f('0x2a')](handleError(_0x5add39,null));};exports[_0xcb7f('0x34')]=function(_0x2be27c,_0x176e26){return db['ZendeskAccount'][_0xcb7f('0x54')]({'where':{'id':_0x2be27c['params']['id']}})[_0xcb7f('0x20')](handleEntityNotFound(_0x176e26,null))[_0xcb7f('0x20')](removeEntity(_0x176e26,null))[_0xcb7f('0x2a')](handleError(_0x176e26,null));};exports[_0xcb7f('0x58')]=function(_0x4c6934,_0x18c7e2,_0x494fd2){var _0xe63dd0={};var _0x292a03={};var _0x40cc49;var _0x2baf38;return db[_0xcb7f('0x38')][_0xcb7f('0x59')]({'where':{'id':_0x4c6934['params']['id']}})[_0xcb7f('0x20')](handleEntityNotFound(_0x18c7e2,null))[_0xcb7f('0x20')](function(_0x5458d0){if(_0x5458d0){_0x40cc49=_0x5458d0;_0x292a03['model']=_[_0xcb7f('0x3e')](db[_0xcb7f('0x5a')][_0xcb7f('0x39')]);_0x292a03[_0xcb7f('0x3d')]=_[_0xcb7f('0x3e')](_0x4c6934[_0xcb7f('0x3d')]);_0x292a03[_0xcb7f('0x52')]=_['intersection'](_0x292a03[_0xcb7f('0x40')],_0x292a03[_0xcb7f('0x3d')]);_0xe63dd0[_0xcb7f('0x42')]=_['intersection'](_0x292a03[_0xcb7f('0x40')],qs[_0xcb7f('0x41')](_0x4c6934[_0xcb7f('0x3d')][_0xcb7f('0x41')]));_0xe63dd0[_0xcb7f('0x42')]=_0xe63dd0[_0xcb7f('0x42')][_0xcb7f('0x5b')]?_0xe63dd0[_0xcb7f('0x42')]:_0x292a03[_0xcb7f('0x40')];_0xe63dd0[_0xcb7f('0x44')]=qs['sort'](_0x4c6934[_0xcb7f('0x3d')]['sort']);_0xe63dd0['where']=qs[_0xcb7f('0x52')](_['pick'](_0x4c6934[_0xcb7f('0x3d')],_0x292a03[_0xcb7f('0x52')]));if(_0x4c6934['query'][_0xcb7f('0x48')]){_0xe63dd0[_0xcb7f('0x46')]=_[_0xcb7f('0x4b')](_0xe63dd0[_0xcb7f('0x46')],{'$or':_[_0xcb7f('0x3c')](_0xe63dd0['attributes'],function(_0x1a4d70){var _0x1deeb6={};_0x1deeb6[_0x1a4d70]={'$like':'%'+_0x4c6934[_0xcb7f('0x3d')][_0xcb7f('0x48')]+'%'};return _0x1deeb6;})});}_0xe63dd0=_[_0xcb7f('0x4b')]({},_0xe63dd0,_0x4c6934[_0xcb7f('0x4c')]);return _0x40cc49[_0xcb7f('0x58')](_0xe63dd0);}})[_0xcb7f('0x20')](function(_0x57bfcd){if(_0x57bfcd){_0x2baf38=_0x57bfcd[_0xcb7f('0x5b')];if(!_0x4c6934[_0xcb7f('0x3d')][_0xcb7f('0x43')](_0xcb7f('0x5c'))){_0xe63dd0[_0xcb7f('0x30')]=qs[_0xcb7f('0x30')](_0x4c6934['query']['limit']);_0xe63dd0[_0xcb7f('0x2f')]=qs[_0xcb7f('0x2f')](_0x4c6934[_0xcb7f('0x3d')][_0xcb7f('0x2f')]);}return _0x40cc49['getConfigurations'](_0xe63dd0);}})[_0xcb7f('0x20')](function(_0x139c0f){if(_0x139c0f){return _0x139c0f?{'count':_0x2baf38,'rows':_0x139c0f}:null;}})[_0xcb7f('0x20')](respondWithResult(_0x18c7e2,null))[_0xcb7f('0x2a')](handleError(_0x18c7e2,null));};exports['addConfiguration']=function(_0x3f59f4,_0x91ca5f,_0x2ce2d5){if(_0x3f59f4['body']['id']){delete _0x3f59f4['body']['id'];}return db[_0xcb7f('0x38')][_0xcb7f('0x59')]({'where':{'id':_0x3f59f4[_0xcb7f('0x51')]['id']}})[_0xcb7f('0x20')](handleEntityNotFound(_0x91ca5f,null))[_0xcb7f('0x20')](function(_0x115f9f){if(_0x115f9f){_0x3f59f4[_0xcb7f('0x56')][_0xcb7f('0x5d')]=_0x115f9f['id'];_0x3f59f4[_0xcb7f('0x56')][_0xcb7f('0x5e')]=integrations[_0xcb7f('0x5f')](_0x3f59f4[_0xcb7f('0x56')][_0xcb7f('0x60')],_0x3f59f4[_0xcb7f('0x56')][_0xcb7f('0x49')]);_0x3f59f4['body'][_0xcb7f('0x61')]=integrations[_0xcb7f('0x62')](_0x3f59f4['body']['channel'],_0x3f59f4[_0xcb7f('0x56')][_0xcb7f('0x49')]);return db[_0xcb7f('0x5a')][_0xcb7f('0x55')](_0x3f59f4[_0xcb7f('0x56')],{'include':[{'model':db[_0xcb7f('0x63')],'as':_0xcb7f('0x5e')},{'model':db[_0xcb7f('0x63')],'as':'Descriptions'}]});}return null;})['then'](respondWithResult(_0x91ca5f,null))[_0xcb7f('0x2a')](handleError(_0x91ca5f,null));};exports[_0xcb7f('0x64')]=function(_0x3e6d46,_0x436d80,_0x23ec3c){var _0x33e0c0='';return db[_0xcb7f('0x38')][_0xcb7f('0x59')]({'where':{'id':_0x3e6d46[_0xcb7f('0x51')]['id']},'attributes':['id',_0xcb7f('0x65'),'password',_0xcb7f('0x66'),_0xcb7f('0x67'),_0xcb7f('0x68')]})[_0xcb7f('0x20')](handleEntityNotFound(_0x436d80,null))[_0xcb7f('0x20')](function(_0x51e87b){if(_0x51e87b){_0x33e0c0=_0x51e87b[_0xcb7f('0x68')];var _0x7eb3ce=_0x33e0c0[_0xcb7f('0x69')](-0x1);if(_0x7eb3ce==='/'){_0x33e0c0=_0x33e0c0[_0xcb7f('0x6a')](0x0,_0x33e0c0[_0xcb7f('0x6b')](_0x7eb3ce));}var _0x51f047={'method':_0xcb7f('0x6c'),'uri':util[_0xcb7f('0x6d')](_0xcb7f('0x6e'),_0x33e0c0,_0xcb7f('0x6f')),'json':!![]};switch(_0x51e87b['authType']){case _0xcb7f('0x70'):_0x51f047[_0xcb7f('0x71')]={'Authorization':util[_0xcb7f('0x6d')]('Basic\x20%s',new Buffer(util[_0xcb7f('0x6d')]('%s:%s',_0x51e87b['username'],_0x51e87b[_0xcb7f('0x70')]))[_0xcb7f('0x72')]('base64'))};break;case'token':_0x51f047[_0xcb7f('0x71')]={'Authorization':util['format'](_0xcb7f('0x73'),new Buffer(util[_0xcb7f('0x6d')](_0xcb7f('0x74'),_0x51e87b[_0xcb7f('0x65')],_0x51e87b['token']))[_0xcb7f('0x72')](_0xcb7f('0x75')))};break;default:throw new db[(_0xcb7f('0x76'))][(_0xcb7f('0x77'))](_0xcb7f('0x78'));}return rp(_0x51f047);}})[_0xcb7f('0x20')](function(_0x1d1249){if(_0x1d1249){var _0x427e11=[_0xcb7f('0x79'),_0xcb7f('0x7a'),'group','assignee'];_[_0xcb7f('0x7b')](_0x1d1249[_0xcb7f('0x6f')],function(_0x548cb0){return _0x427e11['includes'](_0x548cb0[_0xcb7f('0x49')]);});return{'count':_0x1d1249[_0xcb7f('0x6f')][_0xcb7f('0x5b')],'rows':_[_0xcb7f('0x3c')](_0x1d1249[_0xcb7f('0x6f')],function(_0x1cea0b){return{'id':_0x1cea0b['id'],'name':_0x1cea0b[_0xcb7f('0x7c')]>0x7?_0x1cea0b['title']:_0x1cea0b['type'],'custom':_0x1cea0b['position']>0x7?!![]:![],'options':_0x1cea0b[_0xcb7f('0x7d')]?_0x1cea0b[_0xcb7f('0x7d')]:_0x1cea0b[_0xcb7f('0x7e')]?_0x1cea0b['custom_field_options']:[]};})};}})[_0xcb7f('0x20')](respondWithResult(_0x436d80,null))[_0xcb7f('0x2a')](function(_0x25339f){var _0x51f36b=_0x3e6d46[_0xcb7f('0x3d')]['test']?0x1f4:_0x25339f[_0xcb7f('0x7f')]||0x1f4;logger['error']('getFields,\x20%s,\x20%s,\x20%s',_0xcb7f('0x64'),_0x51f36b,JSON[_0xcb7f('0x80')](_0x25339f));delete _0x25339f[_0xcb7f('0x35')];if(_0x51f36b===0x191){_0x51f36b=0x190;}_0x436d80[_0xcb7f('0x2c')](_0x51f36b)[_0xcb7f('0x36')](_0x3e6d46[_0xcb7f('0x3d')][_0xcb7f('0x81')]?{'message':_0xcb7f('0x82'),'statusCode':_0x25339f['statusCode']}:_0x25339f);});};
\ No newline at end of file
diff --git a/server/api/intZendeskAccount/intZendeskAccount.model.js b/server/api/intZendeskAccount/intZendeskAccount.model.js
index 347a663..36606a1 100644
--- a/server/api/intZendeskAccount/intZendeskAccount.model.js
+++ b/server/api/intZendeskAccount/intZendeskAccount.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x338b=['bluebird','request-promise','path','rimraf','../../config/environment','./intZendeskAccount.attributes','exports','define','ZendeskAccount','lodash','util','../../config/logger','api','moment'];(function(_0x1db251,_0xf0443d){var _0x56685a=function(_0x6ec6b7){while(--_0x6ec6b7){_0x1db251['push'](_0x1db251['shift']());}};_0x56685a(++_0xf0443d);}(_0x338b,0x1bb));var _0xb338=function(_0x2c0def,_0x19eb50){_0x2c0def=_0x2c0def-0x0;var _0x3fbc3e=_0x338b[_0x2c0def];return _0x3fbc3e;};'use strict';var _=require(_0xb338('0x0'));var util=require(_0xb338('0x1'));var logger=require(_0xb338('0x2'))(_0xb338('0x3'));var moment=require(_0xb338('0x4'));var BPromise=require(_0xb338('0x5'));var rp=require(_0xb338('0x6'));var fs=require('fs');var path=require(_0xb338('0x7'));var rimraf=require(_0xb338('0x8'));var config=require(_0xb338('0x9'));var attributes=require(_0xb338('0xa'));var integrations=require('../../components/integrations/configuration');module[_0xb338('0xb')]=function(_0x382da1,_0x141d58){return _0x382da1[_0xb338('0xc')](_0xb338('0xd'),attributes,{'tableName':'int_zendesk_accounts','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x6c5c=['bluebird','request-promise','path','rimraf','../../config/environment','../../components/integrations/configuration','exports','define','ZendeskAccount','int_zendesk_accounts','util','../../config/logger','api','moment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6c5c,0x1d8));var _0xc6c5=function(_0x40586c,_0x31b5fd){_0x40586c=_0x40586c-0x0;var _0x10415a=_0x6c5c[_0x40586c];return _0x10415a;};'use strict';var _=require('lodash');var util=require(_0xc6c5('0x0'));var logger=require(_0xc6c5('0x1'))(_0xc6c5('0x2'));var moment=require(_0xc6c5('0x3'));var BPromise=require(_0xc6c5('0x4'));var rp=require(_0xc6c5('0x5'));var fs=require('fs');var path=require(_0xc6c5('0x6'));var rimraf=require(_0xc6c5('0x7'));var config=require(_0xc6c5('0x8'));var attributes=require('./intZendeskAccount.attributes');var integrations=require(_0xc6c5('0x9'));module[_0xc6c5('0xa')]=function(_0x2de55c,_0x11f71a){return _0x2de55c[_0xc6c5('0xb')](_0xc6c5('0xc'),attributes,{'tableName':_0xc6c5('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/intZendeskAccount/intZendeskAccount.rpc.js b/server/api/intZendeskAccount/intZendeskAccount.rpc.js
index 58a28d7..365a6c5 100644
--- a/server/api/intZendeskAccount/intZendeskAccount.rpc.js
+++ b/server/api/intZendeskAccount/intZendeskAccount.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xcb91=['../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','info','ZendeskAccount,\x20%s,\x20%s','request\x20sent','debug','ZendeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','GetZendeskAccount','ZendeskAccount','findAll','options','raw','attributes','include','map','model','then','ShowZendeskAccount','find','where','moment','bluebird','randomstring','ioredis'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x596284,_0x1cd02b){_0x596284=_0x596284-0x0;var _0x5313c6=_0xcb91[_0x596284];return _0x5313c6;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x1cb9('0x0'));var BPromise=require(_0x1cb9('0x1'));var rs=require(_0x1cb9('0x2'));var fs=require('fs');var Redis=require(_0x1cb9('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x1cb9('0x4'));var logger=require(_0x1cb9('0x5'))('rpc');var config=require(_0x1cb9('0x6'));var jayson=require(_0x1cb9('0x7'));var client=jayson['client'][_0x1cb9('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3f7deb,_0x4ffe20,_0x38737d){return new BPromise(function(_0x12567c,_0x59d1be){return client[_0x1cb9('0x9')](_0x3f7deb,_0x38737d)['then'](function(_0x567139){logger[_0x1cb9('0xa')](_0x1cb9('0xb'),_0x4ffe20,_0x1cb9('0xc'));logger[_0x1cb9('0xd')](_0x1cb9('0xe'),_0x4ffe20,'request\x20sent',JSON[_0x1cb9('0xf')](_0x567139));if(_0x567139[_0x1cb9('0x10')]){if(_0x567139[_0x1cb9('0x10')][_0x1cb9('0x11')]===0x1f4){logger[_0x1cb9('0x10')]('ZendeskAccount,\x20%s,\x20%s',_0x4ffe20,_0x567139['error']['message']);return _0x59d1be(_0x567139[_0x1cb9('0x10')][_0x1cb9('0x12')]);}logger[_0x1cb9('0x10')](_0x1cb9('0xb'),_0x4ffe20,_0x567139['error'][_0x1cb9('0x12')]);return _0x12567c(_0x567139[_0x1cb9('0x10')][_0x1cb9('0x12')]);}else{logger[_0x1cb9('0xa')](_0x1cb9('0xb'),_0x4ffe20,'request\x20sent');_0x12567c(_0x567139['result'][_0x1cb9('0x12')]);}})[_0x1cb9('0x13')](function(_0x3904b7){logger[_0x1cb9('0x10')](_0x1cb9('0xb'),_0x4ffe20,_0x3904b7);_0x59d1be(_0x3904b7);});});}exports[_0x1cb9('0x14')]=function(_0x23d3a9){var _0x4e1340=this;return new Promise(function(_0x479d43,_0x1b2fa6){return db[_0x1cb9('0x15')][_0x1cb9('0x16')]({'raw':_0x23d3a9[_0x1cb9('0x17')]?_0x23d3a9[_0x1cb9('0x17')][_0x1cb9('0x18')]===undefined?!![]:![]:!![],'where':_0x23d3a9[_0x1cb9('0x17')]?_0x23d3a9['options']['where']||null:null,'attributes':_0x23d3a9[_0x1cb9('0x17')]?_0x23d3a9['options'][_0x1cb9('0x19')]||null:null,'limit':_0x23d3a9[_0x1cb9('0x17')]?_0x23d3a9['options']['limit']||null:null,'include':_0x23d3a9[_0x1cb9('0x17')]?_0x23d3a9[_0x1cb9('0x17')][_0x1cb9('0x1a')]?_[_0x1cb9('0x1b')](_0x23d3a9[_0x1cb9('0x17')][_0x1cb9('0x1a')],function(_0x59ebea){return{'model':db[_0x59ebea['model']],'as':_0x59ebea['as'],'attributes':_0x59ebea[_0x1cb9('0x19')],'include':_0x59ebea['include']?_[_0x1cb9('0x1b')](_0x59ebea[_0x1cb9('0x1a')],function(_0x69b4c8){return{'model':db[_0x69b4c8[_0x1cb9('0x1c')]],'as':_0x69b4c8['as'],'attributes':_0x69b4c8[_0x1cb9('0x19')],'include':_0x69b4c8['include']?_[_0x1cb9('0x1b')](_0x69b4c8[_0x1cb9('0x1a')],function(_0x4c8d76){return{'model':db[_0x4c8d76[_0x1cb9('0x1c')]],'as':_0x4c8d76['as'],'attributes':_0x4c8d76[_0x1cb9('0x19')]};}):[]};}):[]};}):[]:[]})[_0x1cb9('0x1d')](function(_0x1804fd){logger[_0x1cb9('0xa')](_0x1cb9('0x14'),_0x23d3a9);logger[_0x1cb9('0xd')](_0x1cb9('0x14'),_0x23d3a9,JSON[_0x1cb9('0xf')](_0x1804fd));_0x479d43(_0x1804fd);})[_0x1cb9('0x13')](function(_0x48888d){logger[_0x1cb9('0x10')]('GetZendeskAccount',_0x48888d[_0x1cb9('0x12')],_0x23d3a9);_0x1b2fa6(_0x4e1340['error'](0x1f4,_0x48888d[_0x1cb9('0x12')]));});});};exports[_0x1cb9('0x1e')]=function(_0x3cd7f5){var _0x2038aa=this;return new Promise(function(_0x561d89,_0x1c701f){return db['ZendeskAccount'][_0x1cb9('0x1f')]({'raw':_0x3cd7f5[_0x1cb9('0x17')]?_0x3cd7f5[_0x1cb9('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x3cd7f5[_0x1cb9('0x17')]?_0x3cd7f5['options'][_0x1cb9('0x20')]||null:null,'attributes':_0x3cd7f5['options']?_0x3cd7f5[_0x1cb9('0x17')][_0x1cb9('0x19')]||null:null,'include':_0x3cd7f5[_0x1cb9('0x17')]?_0x3cd7f5[_0x1cb9('0x17')]['include']?_[_0x1cb9('0x1b')](_0x3cd7f5[_0x1cb9('0x17')][_0x1cb9('0x1a')],function(_0x91a1db){return{'model':db[_0x91a1db[_0x1cb9('0x1c')]],'as':_0x91a1db['as'],'attributes':_0x91a1db[_0x1cb9('0x19')],'include':_0x91a1db[_0x1cb9('0x1a')]?_[_0x1cb9('0x1b')](_0x91a1db[_0x1cb9('0x1a')],function(_0x1de287){return{'model':db[_0x1de287[_0x1cb9('0x1c')]],'as':_0x1de287['as'],'attributes':_0x1de287[_0x1cb9('0x19')],'include':_0x1de287[_0x1cb9('0x1a')]?_['map'](_0x1de287['include'],function(_0x299ff8){return{'model':db[_0x299ff8[_0x1cb9('0x1c')]],'as':_0x299ff8['as'],'attributes':_0x299ff8[_0x1cb9('0x19')]};}):[]};}):[]};}):[]:[]})[_0x1cb9('0x1d')](function(_0x385daa){logger[_0x1cb9('0xa')](_0x1cb9('0x1e'),_0x3cd7f5);logger[_0x1cb9('0xd')]('ShowZendeskAccount',_0x3cd7f5,JSON[_0x1cb9('0xf')](_0x385daa));_0x561d89(_0x385daa);})[_0x1cb9('0x13')](function(_0xefe136){logger['error'](_0x1cb9('0x1e'),_0xefe136['message'],_0x3cd7f5);_0x1c701f(_0x2038aa[_0x1cb9('0x10')](0x1f4,_0xefe136['message']));});});};
\ No newline at end of file
+var _0x757a=['stringify','error','message','result','catch','GetZendeskAccount','ZendeskAccount','findAll','options','where','attributes','limit','include','map','model','ShowZendeskAccount','find','raw','util','moment','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','ZendeskAccount,\x20%s,\x20%s','request\x20sent','debug','ZendeskAccount,\x20%s,\x20%s,\x20%s'];(function(_0xdafaa7,_0x408dda){var _0x57ed2f=function(_0x5e0e8e){while(--_0x5e0e8e){_0xdafaa7['push'](_0xdafaa7['shift']());}};_0x57ed2f(++_0x408dda);}(_0x757a,0xde));var _0xa757=function(_0x38de2d,_0x1122da){_0x38de2d=_0x38de2d-0x0;var _0x2e54f8=_0x757a[_0x38de2d];return _0x2e54f8;};'use strict';var _=require('lodash');var util=require(_0xa757('0x0'));var moment=require(_0xa757('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa757('0x2'))['db'];var utils=require(_0xa757('0x3'));var logger=require(_0xa757('0x4'))(_0xa757('0x5'));var config=require(_0xa757('0x6'));var jayson=require(_0xa757('0x7'));var client=jayson['client'][_0xa757('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4343b6,_0x53be0e,_0x2930fa){return new BPromise(function(_0x2f7793,_0x447344){return client[_0xa757('0x9')](_0x4343b6,_0x2930fa)[_0xa757('0xa')](function(_0x5aef8a){logger[_0xa757('0xb')](_0xa757('0xc'),_0x53be0e,_0xa757('0xd'));logger[_0xa757('0xe')](_0xa757('0xf'),_0x53be0e,_0xa757('0xd'),JSON[_0xa757('0x10')](_0x5aef8a));if(_0x5aef8a['error']){if(_0x5aef8a['error']['code']===0x1f4){logger['error']('ZendeskAccount,\x20%s,\x20%s',_0x53be0e,_0x5aef8a[_0xa757('0x11')]['message']);return _0x447344(_0x5aef8a['error'][_0xa757('0x12')]);}logger['error']('ZendeskAccount,\x20%s,\x20%s',_0x53be0e,_0x5aef8a[_0xa757('0x11')][_0xa757('0x12')]);return _0x2f7793(_0x5aef8a[_0xa757('0x11')][_0xa757('0x12')]);}else{logger[_0xa757('0xb')](_0xa757('0xc'),_0x53be0e,_0xa757('0xd'));_0x2f7793(_0x5aef8a[_0xa757('0x13')][_0xa757('0x12')]);}})[_0xa757('0x14')](function(_0x50aac1){logger[_0xa757('0x11')](_0xa757('0xc'),_0x53be0e,_0x50aac1);_0x447344(_0x50aac1);});});}exports[_0xa757('0x15')]=function(_0x4d9f58){var _0x54b305=this;return new Promise(function(_0x151c04,_0x468d45){return db[_0xa757('0x16')][_0xa757('0x17')]({'raw':_0x4d9f58[_0xa757('0x18')]?_0x4d9f58[_0xa757('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x4d9f58[_0xa757('0x18')]?_0x4d9f58['options'][_0xa757('0x19')]||null:null,'attributes':_0x4d9f58[_0xa757('0x18')]?_0x4d9f58[_0xa757('0x18')][_0xa757('0x1a')]||null:null,'limit':_0x4d9f58['options']?_0x4d9f58['options'][_0xa757('0x1b')]||null:null,'include':_0x4d9f58[_0xa757('0x18')]?_0x4d9f58[_0xa757('0x18')][_0xa757('0x1c')]?_[_0xa757('0x1d')](_0x4d9f58[_0xa757('0x18')][_0xa757('0x1c')],function(_0x21f1af){return{'model':db[_0x21f1af[_0xa757('0x1e')]],'as':_0x21f1af['as'],'attributes':_0x21f1af['attributes'],'include':_0x21f1af[_0xa757('0x1c')]?_['map'](_0x21f1af[_0xa757('0x1c')],function(_0x47903b){return{'model':db[_0x47903b[_0xa757('0x1e')]],'as':_0x47903b['as'],'attributes':_0x47903b[_0xa757('0x1a')],'include':_0x47903b[_0xa757('0x1c')]?_['map'](_0x47903b[_0xa757('0x1c')],function(_0xcd98bd){return{'model':db[_0xcd98bd[_0xa757('0x1e')]],'as':_0xcd98bd['as'],'attributes':_0xcd98bd[_0xa757('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x449a7d){logger['info']('GetZendeskAccount',_0x4d9f58);logger['debug']('GetZendeskAccount',_0x4d9f58,JSON[_0xa757('0x10')](_0x449a7d));_0x151c04(_0x449a7d);})['catch'](function(_0x2208f9){logger[_0xa757('0x11')]('GetZendeskAccount',_0x2208f9[_0xa757('0x12')],_0x4d9f58);_0x468d45(_0x54b305['error'](0x1f4,_0x2208f9[_0xa757('0x12')]));});});};exports[_0xa757('0x1f')]=function(_0x5307c3){var _0x235e54=this;return new Promise(function(_0x5ade7b,_0x3a4a66){return db[_0xa757('0x16')][_0xa757('0x20')]({'raw':_0x5307c3[_0xa757('0x18')]?_0x5307c3[_0xa757('0x18')][_0xa757('0x21')]===undefined?!![]:![]:!![],'where':_0x5307c3[_0xa757('0x18')]?_0x5307c3[_0xa757('0x18')][_0xa757('0x19')]||null:null,'attributes':_0x5307c3[_0xa757('0x18')]?_0x5307c3[_0xa757('0x18')][_0xa757('0x1a')]||null:null,'include':_0x5307c3[_0xa757('0x18')]?_0x5307c3[_0xa757('0x18')][_0xa757('0x1c')]?_[_0xa757('0x1d')](_0x5307c3[_0xa757('0x18')][_0xa757('0x1c')],function(_0x1eacde){return{'model':db[_0x1eacde[_0xa757('0x1e')]],'as':_0x1eacde['as'],'attributes':_0x1eacde[_0xa757('0x1a')],'include':_0x1eacde[_0xa757('0x1c')]?_[_0xa757('0x1d')](_0x1eacde[_0xa757('0x1c')],function(_0x59700d){return{'model':db[_0x59700d[_0xa757('0x1e')]],'as':_0x59700d['as'],'attributes':_0x59700d[_0xa757('0x1a')],'include':_0x59700d[_0xa757('0x1c')]?_[_0xa757('0x1d')](_0x59700d[_0xa757('0x1c')],function(_0x51e2aa){return{'model':db[_0x51e2aa[_0xa757('0x1e')]],'as':_0x51e2aa['as'],'attributes':_0x51e2aa[_0xa757('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xa757('0xa')](function(_0x2c34b1){logger[_0xa757('0xb')](_0xa757('0x1f'),_0x5307c3);logger['debug'](_0xa757('0x1f'),_0x5307c3,JSON[_0xa757('0x10')](_0x2c34b1));_0x5ade7b(_0x2c34b1);})[_0xa757('0x14')](function(_0xc34409){logger[_0xa757('0x11')](_0xa757('0x1f'),_0xc34409[_0xa757('0x12')],_0x5307c3);_0x3a4a66(_0x235e54[_0xa757('0x11')](0x1f4,_0xc34409[_0xa757('0x12')]));});});};
\ No newline at end of file
diff --git a/server/api/intZendeskConfiguration/index.js b/server/api/intZendeskConfiguration/index.js
index 7dca79f..e14632f 100644
--- a/server/api/intZendeskConfiguration/index.js
+++ b/server/api/intZendeskConfiguration/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xcbbf=['put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../config/environment','./intZendeskConfiguration.controller','isAuthenticated','get','/:id','show','/:id/fields','getFields','getSubjects','/:id/descriptions','getDescriptions','/:id/tags','getTags','post','create','setTags'];(function(_0x1196bd,_0xba4aea){var _0x26014f=function(_0x542a3d){while(--_0x542a3d){_0x1196bd['push'](_0x1196bd['shift']());}};_0x26014f(++_0xba4aea);}(_0xcbbf,0x8c));var _0xfcbb=function(_0x30b9e3,_0x42eb82){_0x30b9e3=_0x30b9e3-0x0;var _0x4f26de=_0xcbbf[_0x30b9e3];return _0x4f26de;};'use strict';var multer=require(_0xfcbb('0x0'));var util=require(_0xfcbb('0x1'));var path=require(_0xfcbb('0x2'));var timeout=require(_0xfcbb('0x3'));var express=require(_0xfcbb('0x4'));var router=express['Router']();var auth=require(_0xfcbb('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xfcbb('0x6'));var controller=require(_0xfcbb('0x7'));router['get']('/',auth[_0xfcbb('0x8')](),controller['index']);router[_0xfcbb('0x9')](_0xfcbb('0xa'),auth[_0xfcbb('0x8')](),controller[_0xfcbb('0xb')]);router[_0xfcbb('0x9')](_0xfcbb('0xc'),auth[_0xfcbb('0x8')](),controller[_0xfcbb('0xd')]);router['get']('/:id/subjects',auth[_0xfcbb('0x8')](),controller[_0xfcbb('0xe')]);router[_0xfcbb('0x9')](_0xfcbb('0xf'),auth[_0xfcbb('0x8')](),controller[_0xfcbb('0x10')]);router[_0xfcbb('0x9')](_0xfcbb('0x11'),auth[_0xfcbb('0x8')](),controller[_0xfcbb('0x12')]);router[_0xfcbb('0x13')]('/',auth[_0xfcbb('0x8')](),controller[_0xfcbb('0x14')]);router['post'](_0xfcbb('0x11'),auth['isAuthenticated'](),controller[_0xfcbb('0x15')]);router[_0xfcbb('0x16')](_0xfcbb('0xa'),auth['isAuthenticated'](),controller[_0xfcbb('0x17')]);router[_0xfcbb('0x18')](_0xfcbb('0xa'),auth[_0xfcbb('0x8')](),controller[_0xfcbb('0x19')]);module[_0xfcbb('0x1a')]=router;
\ No newline at end of file
+var _0xf8ff=['exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZendeskConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','getSubjects','/:id/descriptions','getDescriptions','/:id/tags','getTags','post','setTags','put','delete','destroy'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0xf8ff,0x1a1));var _0xff8f=function(_0x5c18ef,_0xa2e81d){_0x5c18ef=_0x5c18ef-0x0;var _0x33789d=_0xf8ff[_0x5c18ef];return _0x33789d;};'use strict';var multer=require(_0xff8f('0x0'));var util=require(_0xff8f('0x1'));var path=require(_0xff8f('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xff8f('0x3')]();var auth=require(_0xff8f('0x4'));var interaction=require(_0xff8f('0x5'));var config=require(_0xff8f('0x6'));var controller=require(_0xff8f('0x7'));router[_0xff8f('0x8')]('/',auth[_0xff8f('0x9')](),controller[_0xff8f('0xa')]);router[_0xff8f('0x8')](_0xff8f('0xb'),auth['isAuthenticated'](),controller[_0xff8f('0xc')]);router[_0xff8f('0x8')](_0xff8f('0xd'),auth[_0xff8f('0x9')](),controller[_0xff8f('0xe')]);router[_0xff8f('0x8')]('/:id/subjects',auth[_0xff8f('0x9')](),controller[_0xff8f('0xf')]);router['get'](_0xff8f('0x10'),auth[_0xff8f('0x9')](),controller[_0xff8f('0x11')]);router[_0xff8f('0x8')](_0xff8f('0x12'),auth['isAuthenticated'](),controller[_0xff8f('0x13')]);router[_0xff8f('0x14')]('/',auth[_0xff8f('0x9')](),controller['create']);router[_0xff8f('0x14')]('/:id/tags',auth[_0xff8f('0x9')](),controller[_0xff8f('0x15')]);router[_0xff8f('0x16')]('/:id',auth[_0xff8f('0x9')](),controller['update']);router[_0xff8f('0x17')](_0xff8f('0xb'),auth[_0xff8f('0x9')](),controller[_0xff8f('0x18')]);module[_0xff8f('0x19')]=router;
\ No newline at end of file
diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js
index ee2866a..5e2bdcb 100644
--- a/server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js
+++ b/server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xf222=['exports','STRING','sequelize'];(function(_0x42bf9e,_0x54a2f0){var _0x48b8f0=function(_0x3fbd67){while(--_0x3fbd67){_0x42bf9e['push'](_0x42bf9e['shift']());}};_0x48b8f0(++_0x54a2f0);}(_0xf222,0x107));var _0x2f22=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0xf222[_0x432682];return _0x463d05;};'use strict';var Sequelize=require(_0x2f22('0x0'));module[_0x2f22('0x1')]={'name':{'type':Sequelize[_0x2f22('0x2')]},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x053d=['STRING','sequelize'];(function(_0x1da527,_0x2dc953){var _0x40fc7c=function(_0x9949f5){while(--_0x9949f5){_0x1da527['push'](_0x1da527['shift']());}};_0x40fc7c(++_0x2dc953);}(_0x053d,0x1d3));var _0xd053=function(_0x365f5c,_0x403d36){_0x365f5c=_0x365f5c-0x0;var _0x255a91=_0x053d[_0x365f5c];return _0x255a91;};'use strict';var Sequelize=require(_0xd053('0x0'));module['exports']={'name':{'type':Sequelize[_0xd053('0x1')]},'description':{'type':Sequelize[_0xd053('0x1')]}};
\ No newline at end of file
diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js
index fdeb5d1..904f586 100644
--- a/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js
+++ b/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9247=['../../config/logger','api','../../config/utils','jayson/promise','client','test','request','then','info','ZendeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','status','end','json','count','offset','limit','Content-Range','apply','reject','save','update','sendStatus','name','send','map','ZendeskConfiguration','rawAttributes','type','key','model','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','rows','catch','show','params','keys','length','includeAll','find','create','body','destroy','getFields','findOne','ZendeskField','getSubjects','getDescriptions','Tag','getTags','ids','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0x271e0f,_0x5456a4){var _0x4d518a=function(_0x3e517a){while(--_0x3e517a){_0x271e0f['push'](_0x271e0f['shift']());}};_0x4d518a(++_0x5456a4);}(_0x9247,0x104));var _0x7924=function(_0x3fccd0,_0x135d78){_0x3fccd0=_0x3fccd0-0x0;var _0x5a250a=_0x9247[_0x3fccd0];return _0x5a250a;};'use strict';var pdf=require(_0x7924('0x0'));var emlformat=require(_0x7924('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x7924('0x2'));var jsonpatch=require(_0x7924('0x3'));var rp=require(_0x7924('0x4'));var moment=require(_0x7924('0x5'));var BPromise=require(_0x7924('0x6'));var Mustache=require(_0x7924('0x7'));var util=require(_0x7924('0x8'));var path=require(_0x7924('0x9'));var sox=require(_0x7924('0xa'));var csv=require(_0x7924('0xb'));var ejs=require(_0x7924('0xc'));var fs=require('fs');var _=require(_0x7924('0xd'));var squel=require(_0x7924('0xe'));var crypto=require('crypto');var jsforce=require(_0x7924('0xf'));var deskjs=require(_0x7924('0x10'));var toCsv=require(_0x7924('0xb'));var querystring=require(_0x7924('0x11'));var Papa=require(_0x7924('0x12'));var Redis=require(_0x7924('0x13'));var authService=require('../../components/auth/service');var qs=require(_0x7924('0x14'));var as=require(_0x7924('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x7924('0x16'))(_0x7924('0x17'));var utils=require(_0x7924('0x18'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];var jayson=require(_0x7924('0x19'));var client=jayson[_0x7924('0x1a')]['http']({'port':0x232a});function checkPasswordPattern(_0x213056,_0x5da7b8,_0x543aa8){if(_0x543aa8){var _0x2fa2e2=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x2fa2e2[_0x7924('0x1b')](_0x5da7b8)){return _0x213056;}else{throw new db['Sequelize']['ValidationError']('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x213056;}}function respondWithRpcPromise(_0x469bd0,_0x1e6c84,_0x40a8c7,_0x1cebb0){return new BPromise(function(_0x5191ca,_0x492a98){var _0x406935=_0x1cebb0||client;return _0x406935[_0x7924('0x1c')](_0x469bd0,_0x40a8c7)[_0x7924('0x1d')](function(_0x5cf04c){logger[_0x7924('0x1e')](_0x7924('0x1f'),_0x1e6c84,_0x7924('0x20'));logger[_0x7924('0x21')]('ZendeskConfiguration,\x20%s,\x20%s,\x20%s',_0x1e6c84,_0x7924('0x20'),JSON[_0x7924('0x22')](_0x5cf04c));if(_0x5cf04c['error']){if(_0x5cf04c[_0x7924('0x23')][_0x7924('0x24')]===0x1f4){logger[_0x7924('0x23')]('ZendeskConfiguration,\x20%s,\x20%s',_0x1e6c84,_0x5cf04c[_0x7924('0x23')][_0x7924('0x25')]);return _0x492a98(_0x5cf04c[_0x7924('0x23')]['message']);}logger[_0x7924('0x23')](_0x7924('0x1f'),_0x1e6c84,_0x5cf04c[_0x7924('0x23')][_0x7924('0x25')]);return _0x5191ca(_0x5cf04c[_0x7924('0x23')][_0x7924('0x25')]);}else{logger[_0x7924('0x1e')](_0x7924('0x1f'),_0x1e6c84,_0x7924('0x20'));_0x5191ca(_0x5cf04c[_0x7924('0x26')][_0x7924('0x25')]);}})['catch'](function(_0x2836ac){logger['error'](_0x7924('0x1f'),_0x1e6c84,_0x2836ac);_0x492a98(_0x2836ac);});});}function respondWithStatusCode(_0x139a87,_0x529314){_0x529314=_0x529314||0xcc;return function(_0x161492){if(_0x161492){return _0x139a87['sendStatus'](_0x529314);}return _0x139a87[_0x7924('0x27')](_0x529314)[_0x7924('0x28')]();};}function respondWithResult(_0x48e82b,_0x28d8e2){_0x28d8e2=_0x28d8e2||0xc8;return function(_0x1d2567){if(_0x1d2567){return _0x48e82b[_0x7924('0x27')](_0x28d8e2)[_0x7924('0x29')](_0x1d2567);}};}function respondWithFilteredResult(_0x38dde1,_0x24ddaf){return function(_0x48c78d){if(_0x48c78d){var _0x75d8f4=_0x48c78d[_0x7924('0x2a')],_0x5d0194=_0x24ddaf['offset'],_0x292924=_0x24ddaf[_0x7924('0x2b')]+_0x24ddaf[_0x7924('0x2c')],_0x31663a;if(_0x292924>=_0x75d8f4){_0x292924=_0x75d8f4;_0x31663a=0xc8;}else{_0x31663a=0xce;}_0x38dde1[_0x7924('0x27')](_0x31663a);return _0x38dde1['set'](_0x7924('0x2d'),_0x5d0194+'-'+_0x292924+'/'+_0x75d8f4)['json'](_0x48c78d);}return null;};}function patchUpdates(_0x5f0af4){return function(_0x2364c6){try{jsonpatch[_0x7924('0x2e')](_0x2364c6,_0x5f0af4,!![]);}catch(_0x528fc4){return BPromise[_0x7924('0x2f')](_0x528fc4);}return _0x2364c6[_0x7924('0x30')]();};}function saveUpdates(_0x44ef0b,_0x135f50){return function(_0x4c337d){if(_0x4c337d){return _0x4c337d[_0x7924('0x31')](_0x44ef0b)[_0x7924('0x1d')](function(_0x2e5685){return _0x2e5685;});}return null;};}function removeEntity(_0x1a3459,_0x42ee2a){return function(_0xd309fe){if(_0xd309fe){return _0xd309fe['destroy']()[_0x7924('0x1d')](function(){_0x1a3459[_0x7924('0x27')](0xcc)[_0x7924('0x28')]();});}};}function handleEntityNotFound(_0x56c39a,_0x1b1663){return function(_0x398cbc){if(!_0x398cbc){_0x56c39a[_0x7924('0x32')](0x194);}return _0x398cbc;};}function handleError(_0x6804a,_0x230259){_0x230259=_0x230259||0x1f4;return function(_0xfc3ee8){logger['error'](_0xfc3ee8['stack']);if(_0xfc3ee8[_0x7924('0x33')]){delete _0xfc3ee8[_0x7924('0x33')];}_0x6804a['status'](_0x230259)[_0x7924('0x34')](_0xfc3ee8);};}exports['index']=function(_0x41da90,_0x96223b){var _0x5202ed={},_0x5f0828={},_0x35ce46={'count':0x0,'rows':[]};var _0x2e2b90=_[_0x7924('0x35')](db[_0x7924('0x36')][_0x7924('0x37')],function(_0x3216b9){return{'name':_0x3216b9['fieldName'],'type':_0x3216b9[_0x7924('0x38')][_0x7924('0x39')]};});_0x5f0828[_0x7924('0x3a')]=_['map'](_0x2e2b90,_0x7924('0x33'));_0x5f0828[_0x7924('0x3b')]=_['keys'](_0x41da90[_0x7924('0x3b')]);_0x5f0828[_0x7924('0x3c')]=_['intersection'](_0x5f0828[_0x7924('0x3a')],_0x5f0828['query']);_0x5202ed['attributes']=_[_0x7924('0x3d')](_0x5f0828[_0x7924('0x3a')],qs[_0x7924('0x3e')](_0x41da90[_0x7924('0x3b')]['fields']));_0x5202ed['attributes']=_0x5202ed[_0x7924('0x3f')]['length']?_0x5202ed[_0x7924('0x3f')]:_0x5f0828[_0x7924('0x3a')];if(!_0x41da90['query'][_0x7924('0x40')](_0x7924('0x41'))){_0x5202ed[_0x7924('0x2c')]=qs['limit'](_0x41da90[_0x7924('0x3b')][_0x7924('0x2c')]);_0x5202ed[_0x7924('0x2b')]=qs[_0x7924('0x2b')](_0x41da90[_0x7924('0x3b')][_0x7924('0x2b')]);}_0x5202ed[_0x7924('0x42')]=qs['sort'](_0x41da90[_0x7924('0x3b')][_0x7924('0x43')]);_0x5202ed[_0x7924('0x44')]=qs[_0x7924('0x3c')](_[_0x7924('0x45')](_0x41da90[_0x7924('0x3b')],_0x5f0828['filters']),_0x2e2b90);if(_0x41da90[_0x7924('0x3b')][_0x7924('0x46')]){_0x5202ed['where']=_[_0x7924('0x47')](_0x5202ed[_0x7924('0x44')],{'$or':_['map'](_0x2e2b90,function(_0x205a6b){if(_0x205a6b[_0x7924('0x38')]!==_0x7924('0x48')){var _0x255c3c={};_0x255c3c[_0x205a6b['name']]={'$like':'%'+_0x41da90[_0x7924('0x3b')][_0x7924('0x46')]+'%'};return _0x255c3c;}})});}_0x5202ed=_[_0x7924('0x47')]({},_0x5202ed,_0x41da90[_0x7924('0x49')]);var _0x14d2fd={'where':_0x5202ed[_0x7924('0x44')]};return db['ZendeskConfiguration'][_0x7924('0x2a')](_0x14d2fd)[_0x7924('0x1d')](function(_0x2529ba){_0x35ce46[_0x7924('0x2a')]=_0x2529ba;if(_0x41da90['query']['includeAll']){_0x5202ed[_0x7924('0x4a')]=[{'all':!![]}];}return db[_0x7924('0x36')]['findAll'](_0x5202ed);})[_0x7924('0x1d')](function(_0x453975){_0x35ce46[_0x7924('0x4b')]=_0x453975;return _0x35ce46;})[_0x7924('0x1d')](respondWithFilteredResult(_0x96223b,_0x5202ed))[_0x7924('0x4c')](handleError(_0x96223b,null));};exports[_0x7924('0x4d')]=function(_0x4ce172,_0x24b28f){var _0x4b4db7={'raw':![],'where':{'id':_0x4ce172[_0x7924('0x4e')]['id']}},_0x1aed07={};_0x1aed07[_0x7924('0x3a')]=_[_0x7924('0x4f')](db[_0x7924('0x36')]['rawAttributes']);_0x1aed07[_0x7924('0x3b')]=_[_0x7924('0x4f')](_0x4ce172['query']);_0x1aed07[_0x7924('0x3c')]=_[_0x7924('0x3d')](_0x1aed07[_0x7924('0x3a')],_0x1aed07[_0x7924('0x3b')]);_0x4b4db7[_0x7924('0x3f')]=_[_0x7924('0x3d')](_0x1aed07['model'],qs[_0x7924('0x3e')](_0x4ce172['query'][_0x7924('0x3e')]));_0x4b4db7[_0x7924('0x3f')]=_0x4b4db7['attributes'][_0x7924('0x50')]?_0x4b4db7[_0x7924('0x3f')]:_0x1aed07[_0x7924('0x3a')];if(_0x4ce172[_0x7924('0x3b')][_0x7924('0x51')]){_0x4b4db7['include']=[{'all':!![]}];}_0x4b4db7=_[_0x7924('0x47')]({},_0x4b4db7,_0x4ce172[_0x7924('0x49')]);return db[_0x7924('0x36')][_0x7924('0x52')](_0x4b4db7)[_0x7924('0x1d')](handleEntityNotFound(_0x24b28f,null))[_0x7924('0x1d')](respondWithResult(_0x24b28f,null))['catch'](handleError(_0x24b28f,null));};exports['create']=function(_0x2e9db3,_0x4e815c){return db['ZendeskConfiguration'][_0x7924('0x53')](_0x2e9db3[_0x7924('0x54')],{})[_0x7924('0x1d')](respondWithResult(_0x4e815c,0xc9))['catch'](handleError(_0x4e815c,null));};exports[_0x7924('0x31')]=function(_0x47c8f7,_0x163432){if(_0x47c8f7[_0x7924('0x54')]['id']){delete _0x47c8f7[_0x7924('0x54')]['id'];}return db[_0x7924('0x36')]['find']({'where':{'id':_0x47c8f7[_0x7924('0x4e')]['id']}})['then'](handleEntityNotFound(_0x163432,null))['then'](saveUpdates(_0x47c8f7[_0x7924('0x54')],null))['then'](respondWithResult(_0x163432,null))['catch'](handleError(_0x163432,null));};exports[_0x7924('0x55')]=function(_0x446aa8,_0x272e27){return db['ZendeskConfiguration']['find']({'where':{'id':_0x446aa8[_0x7924('0x4e')]['id']}})[_0x7924('0x1d')](handleEntityNotFound(_0x272e27,null))[_0x7924('0x1d')](removeEntity(_0x272e27,null))['catch'](handleError(_0x272e27,null));};exports[_0x7924('0x56')]=function(_0x446801,_0x796662,_0x69a8a1){var _0x412014={};var _0x240596={};var _0x379e29;var _0x5ddc59;return db[_0x7924('0x36')][_0x7924('0x57')]({'where':{'id':_0x446801[_0x7924('0x4e')]['id']}})[_0x7924('0x1d')](handleEntityNotFound(_0x796662,null))[_0x7924('0x1d')](function(_0x287e07){if(_0x287e07){_0x379e29=_0x287e07;_0x240596['model']=_[_0x7924('0x4f')](db[_0x7924('0x58')][_0x7924('0x37')]);_0x240596['query']=_[_0x7924('0x4f')](_0x446801[_0x7924('0x3b')]);_0x240596[_0x7924('0x3c')]=_[_0x7924('0x3d')](_0x240596[_0x7924('0x3a')],_0x240596['query']);_0x412014[_0x7924('0x3f')]=_['intersection'](_0x240596[_0x7924('0x3a')],qs[_0x7924('0x3e')](_0x446801[_0x7924('0x3b')][_0x7924('0x3e')]));_0x412014[_0x7924('0x3f')]=_0x412014['attributes'][_0x7924('0x50')]?_0x412014['attributes']:_0x240596['model'];_0x412014[_0x7924('0x42')]=qs[_0x7924('0x43')](_0x446801[_0x7924('0x3b')]['sort']);_0x412014['where']=qs['filters'](_['pick'](_0x446801['query'],_0x240596['filters']));if(_0x446801[_0x7924('0x3b')]['filter']){_0x412014[_0x7924('0x44')]=_['merge'](_0x412014[_0x7924('0x44')],{'$or':_[_0x7924('0x35')](_0x412014[_0x7924('0x3f')],function(_0x39e141){var _0x406e04={};_0x406e04[_0x39e141]={'$like':'%'+_0x446801[_0x7924('0x3b')]['filter']+'%'};return _0x406e04;})});}_0x412014=_[_0x7924('0x47')]({},_0x412014,_0x446801[_0x7924('0x49')]);return _0x379e29['getFields'](_0x412014);}})[_0x7924('0x1d')](function(_0x223e1b){if(_0x223e1b){_0x5ddc59=_0x223e1b[_0x7924('0x50')];if(!_0x446801[_0x7924('0x3b')][_0x7924('0x40')](_0x7924('0x41'))){_0x412014[_0x7924('0x2c')]=qs[_0x7924('0x2c')](_0x446801[_0x7924('0x3b')]['limit']);_0x412014[_0x7924('0x2b')]=qs[_0x7924('0x2b')](_0x446801[_0x7924('0x3b')][_0x7924('0x2b')]);}return _0x379e29[_0x7924('0x56')](_0x412014);}})[_0x7924('0x1d')](function(_0x40ff7f){if(_0x40ff7f){return _0x40ff7f?{'count':_0x5ddc59,'rows':_0x40ff7f}:null;}})['then'](respondWithResult(_0x796662,null))[_0x7924('0x4c')](handleError(_0x796662,null));};exports['getSubjects']=function(_0x4dfa8f,_0x2fe0e9,_0x363eca){var _0x12f8d7={};var _0x326e2c={};var _0x47a9a5;var _0xe9a293;return db[_0x7924('0x36')][_0x7924('0x57')]({'where':{'id':_0x4dfa8f[_0x7924('0x4e')]['id']}})['then'](handleEntityNotFound(_0x2fe0e9,null))['then'](function(_0x1d5b98){if(_0x1d5b98){_0x47a9a5=_0x1d5b98;_0x326e2c[_0x7924('0x3a')]=_[_0x7924('0x4f')](db['ZendeskField'][_0x7924('0x37')]);_0x326e2c['query']=_['keys'](_0x4dfa8f[_0x7924('0x3b')]);_0x326e2c[_0x7924('0x3c')]=_[_0x7924('0x3d')](_0x326e2c[_0x7924('0x3a')],_0x326e2c[_0x7924('0x3b')]);_0x12f8d7['attributes']=_['intersection'](_0x326e2c[_0x7924('0x3a')],qs[_0x7924('0x3e')](_0x4dfa8f[_0x7924('0x3b')][_0x7924('0x3e')]));_0x12f8d7[_0x7924('0x3f')]=_0x12f8d7[_0x7924('0x3f')]['length']?_0x12f8d7[_0x7924('0x3f')]:_0x326e2c['model'];_0x12f8d7[_0x7924('0x42')]=qs[_0x7924('0x43')](_0x4dfa8f[_0x7924('0x3b')][_0x7924('0x43')]);_0x12f8d7[_0x7924('0x44')]=qs['filters'](_[_0x7924('0x45')](_0x4dfa8f['query'],_0x326e2c[_0x7924('0x3c')]));if(_0x4dfa8f[_0x7924('0x3b')][_0x7924('0x46')]){_0x12f8d7['where']=_[_0x7924('0x47')](_0x12f8d7['where'],{'$or':_[_0x7924('0x35')](_0x12f8d7[_0x7924('0x3f')],function(_0x4f83a4){var _0x52193d={};_0x52193d[_0x4f83a4]={'$like':'%'+_0x4dfa8f[_0x7924('0x3b')]['filter']+'%'};return _0x52193d;})});}_0x12f8d7=_[_0x7924('0x47')]({},_0x12f8d7,_0x4dfa8f[_0x7924('0x49')]);return _0x47a9a5['getSubjects'](_0x12f8d7);}})[_0x7924('0x1d')](function(_0x41a6b7){if(_0x41a6b7){_0xe9a293=_0x41a6b7[_0x7924('0x50')];if(!_0x4dfa8f[_0x7924('0x3b')]['hasOwnProperty']('nolimit')){_0x12f8d7[_0x7924('0x2c')]=qs[_0x7924('0x2c')](_0x4dfa8f[_0x7924('0x3b')][_0x7924('0x2c')]);_0x12f8d7[_0x7924('0x2b')]=qs[_0x7924('0x2b')](_0x4dfa8f[_0x7924('0x3b')][_0x7924('0x2b')]);}return _0x47a9a5[_0x7924('0x59')](_0x12f8d7);}})[_0x7924('0x1d')](function(_0x199008){if(_0x199008){return _0x199008?{'count':_0xe9a293,'rows':_0x199008}:null;}})[_0x7924('0x1d')](respondWithResult(_0x2fe0e9,null))[_0x7924('0x4c')](handleError(_0x2fe0e9,null));};exports[_0x7924('0x5a')]=function(_0x124490,_0x58bfba,_0x19730a){var _0x3a7b33={};var _0xbf59a5={};var _0x2edce0;var _0x1e3d16;return db[_0x7924('0x36')][_0x7924('0x57')]({'where':{'id':_0x124490[_0x7924('0x4e')]['id']}})['then'](handleEntityNotFound(_0x58bfba,null))[_0x7924('0x1d')](function(_0x33001e){if(_0x33001e){_0x2edce0=_0x33001e;_0xbf59a5[_0x7924('0x3a')]=_[_0x7924('0x4f')](db[_0x7924('0x58')][_0x7924('0x37')]);_0xbf59a5[_0x7924('0x3b')]=_[_0x7924('0x4f')](_0x124490[_0x7924('0x3b')]);_0xbf59a5['filters']=_[_0x7924('0x3d')](_0xbf59a5[_0x7924('0x3a')],_0xbf59a5[_0x7924('0x3b')]);_0x3a7b33[_0x7924('0x3f')]=_[_0x7924('0x3d')](_0xbf59a5[_0x7924('0x3a')],qs[_0x7924('0x3e')](_0x124490[_0x7924('0x3b')][_0x7924('0x3e')]));_0x3a7b33['attributes']=_0x3a7b33[_0x7924('0x3f')]['length']?_0x3a7b33[_0x7924('0x3f')]:_0xbf59a5[_0x7924('0x3a')];_0x3a7b33[_0x7924('0x42')]=qs[_0x7924('0x43')](_0x124490['query'][_0x7924('0x43')]);_0x3a7b33['where']=qs[_0x7924('0x3c')](_[_0x7924('0x45')](_0x124490[_0x7924('0x3b')],_0xbf59a5[_0x7924('0x3c')]));if(_0x124490['query'][_0x7924('0x46')]){_0x3a7b33['where']=_[_0x7924('0x47')](_0x3a7b33[_0x7924('0x44')],{'$or':_[_0x7924('0x35')](_0x3a7b33['attributes'],function(_0x4954db){var _0x5a00c9={};_0x5a00c9[_0x4954db]={'$like':'%'+_0x124490['query'][_0x7924('0x46')]+'%'};return _0x5a00c9;})});}_0x3a7b33=_[_0x7924('0x47')]({},_0x3a7b33,_0x124490[_0x7924('0x49')]);return _0x2edce0[_0x7924('0x5a')](_0x3a7b33);}})['then'](function(_0xaa6532){if(_0xaa6532){_0x1e3d16=_0xaa6532['length'];if(!_0x124490[_0x7924('0x3b')][_0x7924('0x40')](_0x7924('0x41'))){_0x3a7b33[_0x7924('0x2c')]=qs[_0x7924('0x2c')](_0x124490[_0x7924('0x3b')][_0x7924('0x2c')]);_0x3a7b33['offset']=qs[_0x7924('0x2b')](_0x124490[_0x7924('0x3b')]['offset']);}return _0x2edce0[_0x7924('0x5a')](_0x3a7b33);}})[_0x7924('0x1d')](function(_0x4c6626){if(_0x4c6626){return _0x4c6626?{'count':_0x1e3d16,'rows':_0x4c6626}:null;}})[_0x7924('0x1d')](respondWithResult(_0x58bfba,null))[_0x7924('0x4c')](handleError(_0x58bfba,null));};exports['getTags']=function(_0x37f025,_0x278dc3,_0x2c1e00){var _0x31ff30={};var _0x27e1a5={};var _0x1ec9ce;var _0x5819e5;return db['ZendeskConfiguration'][_0x7924('0x57')]({'where':{'id':_0x37f025[_0x7924('0x4e')]['id']}})[_0x7924('0x1d')](handleEntityNotFound(_0x278dc3,null))[_0x7924('0x1d')](function(_0x35ecfc){if(_0x35ecfc){_0x1ec9ce=_0x35ecfc;_0x27e1a5[_0x7924('0x3a')]=_[_0x7924('0x4f')](db[_0x7924('0x5b')][_0x7924('0x37')]);_0x27e1a5[_0x7924('0x3b')]=_[_0x7924('0x4f')](_0x37f025['query']);_0x27e1a5['filters']=_[_0x7924('0x3d')](_0x27e1a5[_0x7924('0x3a')],_0x27e1a5[_0x7924('0x3b')]);_0x31ff30[_0x7924('0x3f')]=_['intersection'](_0x27e1a5[_0x7924('0x3a')],qs[_0x7924('0x3e')](_0x37f025[_0x7924('0x3b')]['fields']));_0x31ff30[_0x7924('0x3f')]=_0x31ff30[_0x7924('0x3f')][_0x7924('0x50')]?_0x31ff30[_0x7924('0x3f')]:_0x27e1a5[_0x7924('0x3a')];_0x31ff30[_0x7924('0x42')]=qs[_0x7924('0x43')](_0x37f025['query'][_0x7924('0x43')]);_0x31ff30[_0x7924('0x44')]=qs['filters'](_['pick'](_0x37f025[_0x7924('0x3b')],_0x27e1a5[_0x7924('0x3c')]));if(_0x37f025['query'][_0x7924('0x46')]){_0x31ff30[_0x7924('0x44')]=_['merge'](_0x31ff30[_0x7924('0x44')],{'$or':_[_0x7924('0x35')](_0x31ff30[_0x7924('0x3f')],function(_0x3cb4b6){var _0x26f06c={};_0x26f06c[_0x3cb4b6]={'$like':'%'+_0x37f025[_0x7924('0x3b')][_0x7924('0x46')]+'%'};return _0x26f06c;})});}_0x31ff30=_['merge']({},_0x31ff30,_0x37f025['options']);return _0x1ec9ce[_0x7924('0x5c')](_0x31ff30);}})[_0x7924('0x1d')](function(_0x3c70f9){if(_0x3c70f9){_0x5819e5=_0x3c70f9[_0x7924('0x50')];if(!_0x37f025[_0x7924('0x3b')]['hasOwnProperty']('nolimit')){_0x31ff30['limit']=qs[_0x7924('0x2c')](_0x37f025[_0x7924('0x3b')][_0x7924('0x2c')]);_0x31ff30['offset']=qs[_0x7924('0x2b')](_0x37f025['query'][_0x7924('0x2b')]);}return _0x1ec9ce['getTags'](_0x31ff30);}})['then'](function(_0x97c790){if(_0x97c790){return _0x97c790?{'count':_0x5819e5,'rows':_0x97c790}:null;}})[_0x7924('0x1d')](respondWithResult(_0x278dc3,null))['catch'](handleError(_0x278dc3,null));};exports['setTags']=function(_0x469aa4,_0x300b5d,_0x21e520){if(_0x469aa4[_0x7924('0x54')]['id']){delete _0x469aa4['body']['id'];}return db['ZendeskConfiguration'][_0x7924('0x57')]({'where':{'id':_0x469aa4['params']['id']}})[_0x7924('0x1d')](handleEntityNotFound(_0x300b5d,null))[_0x7924('0x1d')](function(_0x2808a5){if(_0x2808a5){return _0x2808a5['setTags'](_0x469aa4[_0x7924('0x54')][_0x7924('0x5d')]||[]);}return null;})[_0x7924('0x1d')](respondWithResult(_0x300b5d,null))['catch'](handleError(_0x300b5d,null));};
\ No newline at end of file
+var _0x0109=['ioredis','../../components/auth/service','../../components/parsers/qs','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','client','http','test','Sequelize','ValidationError','info','ZendeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch','end','status','count','offset','limit','set','json','apply','reject','save','then','destroy','sendStatus','stack','name','send','index','ZendeskConfiguration','fieldName','type','key','model','map','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','includeAll','findAll','rows','show','rawAttributes','keys','length','include','options','find','create','update','body','params','findOne','ZendeskField','getFields','getSubjects','order','getDescriptions','getTags','Tag','setTags','ids','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x0109,0x1e3));var _0x9010=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x0109[_0xbca1b1];return _0x4e1686;};'use strict';var pdf=require(_0x9010('0x0'));var emlformat=require(_0x9010('0x1'));var rimraf=require(_0x9010('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x9010('0x3'));var rp=require(_0x9010('0x4'));var moment=require(_0x9010('0x5'));var BPromise=require(_0x9010('0x6'));var Mustache=require(_0x9010('0x7'));var util=require(_0x9010('0x8'));var path=require('path');var sox=require('sox');var csv=require(_0x9010('0x9'));var ejs=require(_0x9010('0xa'));var fs=require('fs');var _=require(_0x9010('0xb'));var squel=require(_0x9010('0xc'));var crypto=require(_0x9010('0xd'));var jsforce=require(_0x9010('0xe'));var deskjs=require(_0x9010('0xf'));var toCsv=require(_0x9010('0x9'));var querystring=require('querystring');var Papa=require(_0x9010('0x10'));var Redis=require(_0x9010('0x11'));var authService=require(_0x9010('0x12'));var qs=require(_0x9010('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x9010('0x14'));var config=require(_0x9010('0x15'));var db=require(_0x9010('0x16'))['db'];var jayson=require(_0x9010('0x17'));var client=jayson[_0x9010('0x18')][_0x9010('0x19')]({'port':0x232a});function checkPasswordPattern(_0xdba540,_0x3011ad,_0x4d206c){if(_0x4d206c){var _0x529cdf=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x529cdf[_0x9010('0x1a')](_0x3011ad)){return _0xdba540;}else{throw new db[(_0x9010('0x1b'))][(_0x9010('0x1c'))]('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0xdba540;}}function respondWithRpcPromise(_0x1a0ea8,_0x12d3ad,_0x195e5f,_0x493325){return new BPromise(function(_0x3ccce5,_0x55f30f){var _0x44c966=_0x493325||client;return _0x44c966['request'](_0x1a0ea8,_0x195e5f)['then'](function(_0x4af92f){logger[_0x9010('0x1d')](_0x9010('0x1e'),_0x12d3ad,_0x9010('0x1f'));logger[_0x9010('0x20')](_0x9010('0x21'),_0x12d3ad,_0x9010('0x1f'),JSON[_0x9010('0x22')](_0x4af92f));if(_0x4af92f['error']){if(_0x4af92f['error'][_0x9010('0x23')]===0x1f4){logger[_0x9010('0x24')]('ZendeskConfiguration,\x20%s,\x20%s',_0x12d3ad,_0x4af92f[_0x9010('0x24')][_0x9010('0x25')]);return _0x55f30f(_0x4af92f[_0x9010('0x24')][_0x9010('0x25')]);}logger[_0x9010('0x24')](_0x9010('0x1e'),_0x12d3ad,_0x4af92f[_0x9010('0x24')]['message']);return _0x3ccce5(_0x4af92f['error'][_0x9010('0x25')]);}else{logger['info']('ZendeskConfiguration,\x20%s,\x20%s',_0x12d3ad,_0x9010('0x1f'));_0x3ccce5(_0x4af92f[_0x9010('0x26')][_0x9010('0x25')]);}})[_0x9010('0x27')](function(_0x24fadc){logger[_0x9010('0x24')](_0x9010('0x1e'),_0x12d3ad,_0x24fadc);_0x55f30f(_0x24fadc);});});}function respondWithStatusCode(_0x53ec8e,_0x5e9c79){_0x5e9c79=_0x5e9c79||0xcc;return function(_0x2408ba){if(_0x2408ba){return _0x53ec8e['sendStatus'](_0x5e9c79);}return _0x53ec8e['status'](_0x5e9c79)[_0x9010('0x28')]();};}function respondWithResult(_0x4fcff0,_0x49add2){_0x49add2=_0x49add2||0xc8;return function(_0x2d232f){if(_0x2d232f){return _0x4fcff0[_0x9010('0x29')](_0x49add2)['json'](_0x2d232f);}};}function respondWithFilteredResult(_0x575b56,_0x2b1fc1){return function(_0x32a826){if(_0x32a826){var _0x2f566b=_0x32a826[_0x9010('0x2a')],_0x4becac=_0x2b1fc1['offset'],_0x9b38e0=_0x2b1fc1[_0x9010('0x2b')]+_0x2b1fc1[_0x9010('0x2c')],_0x5b518c;if(_0x9b38e0>=_0x2f566b){_0x9b38e0=_0x2f566b;_0x5b518c=0xc8;}else{_0x5b518c=0xce;}_0x575b56[_0x9010('0x29')](_0x5b518c);return _0x575b56[_0x9010('0x2d')]('Content-Range',_0x4becac+'-'+_0x9b38e0+'/'+_0x2f566b)[_0x9010('0x2e')](_0x32a826);}return null;};}function patchUpdates(_0x348781){return function(_0x578629){try{jsonpatch[_0x9010('0x2f')](_0x578629,_0x348781,!![]);}catch(_0xec7f31){return BPromise[_0x9010('0x30')](_0xec7f31);}return _0x578629[_0x9010('0x31')]();};}function saveUpdates(_0x5a7691,_0x3f9e70){return function(_0xca2fc7){if(_0xca2fc7){return _0xca2fc7['update'](_0x5a7691)[_0x9010('0x32')](function(_0x4f1433){return _0x4f1433;});}return null;};}function removeEntity(_0x5401dd,_0x48c43b){return function(_0x5b49de){if(_0x5b49de){return _0x5b49de[_0x9010('0x33')]()[_0x9010('0x32')](function(){_0x5401dd['status'](0xcc)[_0x9010('0x28')]();});}};}function handleEntityNotFound(_0xc1c97f,_0x12630c){return function(_0x4cea27){if(!_0x4cea27){_0xc1c97f[_0x9010('0x34')](0x194);}return _0x4cea27;};}function handleError(_0x2ed7a6,_0x49174a){_0x49174a=_0x49174a||0x1f4;return function(_0x38193f){logger['error'](_0x38193f[_0x9010('0x35')]);if(_0x38193f[_0x9010('0x36')]){delete _0x38193f[_0x9010('0x36')];}_0x2ed7a6[_0x9010('0x29')](_0x49174a)[_0x9010('0x37')](_0x38193f);};}exports[_0x9010('0x38')]=function(_0x16c248,_0x16a8bb){var _0xc08ac={},_0x15bac6={},_0x1372d8={'count':0x0,'rows':[]};var _0x52a60b=_['map'](db[_0x9010('0x39')]['rawAttributes'],function(_0x3ee6d8){return{'name':_0x3ee6d8[_0x9010('0x3a')],'type':_0x3ee6d8[_0x9010('0x3b')][_0x9010('0x3c')]};});_0x15bac6[_0x9010('0x3d')]=_[_0x9010('0x3e')](_0x52a60b,_0x9010('0x36'));_0x15bac6[_0x9010('0x3f')]=_['keys'](_0x16c248['query']);_0x15bac6[_0x9010('0x40')]=_[_0x9010('0x41')](_0x15bac6[_0x9010('0x3d')],_0x15bac6['query']);_0xc08ac[_0x9010('0x42')]=_[_0x9010('0x41')](_0x15bac6['model'],qs['fields'](_0x16c248[_0x9010('0x3f')][_0x9010('0x43')]));_0xc08ac[_0x9010('0x42')]=_0xc08ac[_0x9010('0x42')]['length']?_0xc08ac['attributes']:_0x15bac6[_0x9010('0x3d')];if(!_0x16c248['query'][_0x9010('0x44')](_0x9010('0x45'))){_0xc08ac[_0x9010('0x2c')]=qs[_0x9010('0x2c')](_0x16c248['query'][_0x9010('0x2c')]);_0xc08ac['offset']=qs[_0x9010('0x2b')](_0x16c248[_0x9010('0x3f')][_0x9010('0x2b')]);}_0xc08ac['order']=qs['sort'](_0x16c248[_0x9010('0x3f')][_0x9010('0x46')]);_0xc08ac[_0x9010('0x47')]=qs[_0x9010('0x40')](_[_0x9010('0x48')](_0x16c248[_0x9010('0x3f')],_0x15bac6[_0x9010('0x40')]),_0x52a60b);if(_0x16c248[_0x9010('0x3f')][_0x9010('0x49')]){_0xc08ac[_0x9010('0x47')]=_[_0x9010('0x4a')](_0xc08ac[_0x9010('0x47')],{'$or':_[_0x9010('0x3e')](_0x52a60b,function(_0x4cf67e){if(_0x4cf67e[_0x9010('0x3b')]!==_0x9010('0x4b')){var _0x18875f={};_0x18875f[_0x4cf67e[_0x9010('0x36')]]={'$like':'%'+_0x16c248[_0x9010('0x3f')][_0x9010('0x49')]+'%'};return _0x18875f;}})});}_0xc08ac=_[_0x9010('0x4a')]({},_0xc08ac,_0x16c248['options']);var _0x2f9b0b={'where':_0xc08ac['where']};return db[_0x9010('0x39')][_0x9010('0x2a')](_0x2f9b0b)[_0x9010('0x32')](function(_0x1634ea){_0x1372d8[_0x9010('0x2a')]=_0x1634ea;if(_0x16c248[_0x9010('0x3f')][_0x9010('0x4c')]){_0xc08ac['include']=[{'all':!![]}];}return db[_0x9010('0x39')][_0x9010('0x4d')](_0xc08ac);})[_0x9010('0x32')](function(_0x27086f){_0x1372d8[_0x9010('0x4e')]=_0x27086f;return _0x1372d8;})['then'](respondWithFilteredResult(_0x16a8bb,_0xc08ac))[_0x9010('0x27')](handleError(_0x16a8bb,null));};exports[_0x9010('0x4f')]=function(_0x2613d4,_0x48ca70){var _0x492977={'raw':![],'where':{'id':_0x2613d4['params']['id']}},_0xedd2c8={};_0xedd2c8[_0x9010('0x3d')]=_['keys'](db['ZendeskConfiguration'][_0x9010('0x50')]);_0xedd2c8['query']=_[_0x9010('0x51')](_0x2613d4['query']);_0xedd2c8['filters']=_[_0x9010('0x41')](_0xedd2c8['model'],_0xedd2c8[_0x9010('0x3f')]);_0x492977[_0x9010('0x42')]=_['intersection'](_0xedd2c8['model'],qs['fields'](_0x2613d4['query'][_0x9010('0x43')]));_0x492977[_0x9010('0x42')]=_0x492977[_0x9010('0x42')][_0x9010('0x52')]?_0x492977[_0x9010('0x42')]:_0xedd2c8[_0x9010('0x3d')];if(_0x2613d4['query'][_0x9010('0x4c')]){_0x492977[_0x9010('0x53')]=[{'all':!![]}];}_0x492977=_[_0x9010('0x4a')]({},_0x492977,_0x2613d4[_0x9010('0x54')]);return db[_0x9010('0x39')][_0x9010('0x55')](_0x492977)[_0x9010('0x32')](handleEntityNotFound(_0x48ca70,null))[_0x9010('0x32')](respondWithResult(_0x48ca70,null))[_0x9010('0x27')](handleError(_0x48ca70,null));};exports[_0x9010('0x56')]=function(_0x2e0c4f,_0x42904c){return db['ZendeskConfiguration'][_0x9010('0x56')](_0x2e0c4f['body'],{})['then'](respondWithResult(_0x42904c,0xc9))[_0x9010('0x27')](handleError(_0x42904c,null));};exports[_0x9010('0x57')]=function(_0xc7adde,_0x12cffd){if(_0xc7adde[_0x9010('0x58')]['id']){delete _0xc7adde[_0x9010('0x58')]['id'];}return db[_0x9010('0x39')][_0x9010('0x55')]({'where':{'id':_0xc7adde[_0x9010('0x59')]['id']}})[_0x9010('0x32')](handleEntityNotFound(_0x12cffd,null))[_0x9010('0x32')](saveUpdates(_0xc7adde[_0x9010('0x58')],null))['then'](respondWithResult(_0x12cffd,null))[_0x9010('0x27')](handleError(_0x12cffd,null));};exports['destroy']=function(_0x455ef0,_0x2dcace){return db[_0x9010('0x39')]['find']({'where':{'id':_0x455ef0['params']['id']}})['then'](handleEntityNotFound(_0x2dcace,null))[_0x9010('0x32')](removeEntity(_0x2dcace,null))['catch'](handleError(_0x2dcace,null));};exports['getFields']=function(_0x37a894,_0x1a0d58,_0x304de7){var _0x1e1575={};var _0x24934b={};var _0x10d977;var _0x58a0f3;return db[_0x9010('0x39')][_0x9010('0x5a')]({'where':{'id':_0x37a894[_0x9010('0x59')]['id']}})[_0x9010('0x32')](handleEntityNotFound(_0x1a0d58,null))[_0x9010('0x32')](function(_0x274740){if(_0x274740){_0x10d977=_0x274740;_0x24934b['model']=_[_0x9010('0x51')](db[_0x9010('0x5b')][_0x9010('0x50')]);_0x24934b['query']=_[_0x9010('0x51')](_0x37a894['query']);_0x24934b[_0x9010('0x40')]=_[_0x9010('0x41')](_0x24934b['model'],_0x24934b[_0x9010('0x3f')]);_0x1e1575['attributes']=_[_0x9010('0x41')](_0x24934b[_0x9010('0x3d')],qs[_0x9010('0x43')](_0x37a894[_0x9010('0x3f')][_0x9010('0x43')]));_0x1e1575[_0x9010('0x42')]=_0x1e1575[_0x9010('0x42')][_0x9010('0x52')]?_0x1e1575['attributes']:_0x24934b[_0x9010('0x3d')];_0x1e1575['order']=qs['sort'](_0x37a894['query'][_0x9010('0x46')]);_0x1e1575[_0x9010('0x47')]=qs[_0x9010('0x40')](_[_0x9010('0x48')](_0x37a894[_0x9010('0x3f')],_0x24934b[_0x9010('0x40')]));if(_0x37a894['query'][_0x9010('0x49')]){_0x1e1575[_0x9010('0x47')]=_[_0x9010('0x4a')](_0x1e1575[_0x9010('0x47')],{'$or':_[_0x9010('0x3e')](_0x1e1575[_0x9010('0x42')],function(_0x4e9ab7){var _0xe42433={};_0xe42433[_0x4e9ab7]={'$like':'%'+_0x37a894[_0x9010('0x3f')][_0x9010('0x49')]+'%'};return _0xe42433;})});}_0x1e1575=_[_0x9010('0x4a')]({},_0x1e1575,_0x37a894[_0x9010('0x54')]);return _0x10d977[_0x9010('0x5c')](_0x1e1575);}})['then'](function(_0x352ead){if(_0x352ead){_0x58a0f3=_0x352ead[_0x9010('0x52')];if(!_0x37a894[_0x9010('0x3f')][_0x9010('0x44')]('nolimit')){_0x1e1575[_0x9010('0x2c')]=qs[_0x9010('0x2c')](_0x37a894[_0x9010('0x3f')][_0x9010('0x2c')]);_0x1e1575[_0x9010('0x2b')]=qs[_0x9010('0x2b')](_0x37a894[_0x9010('0x3f')][_0x9010('0x2b')]);}return _0x10d977[_0x9010('0x5c')](_0x1e1575);}})['then'](function(_0x2c3e4b){if(_0x2c3e4b){return _0x2c3e4b?{'count':_0x58a0f3,'rows':_0x2c3e4b}:null;}})['then'](respondWithResult(_0x1a0d58,null))[_0x9010('0x27')](handleError(_0x1a0d58,null));};exports[_0x9010('0x5d')]=function(_0x1742fb,_0x65fe85,_0x2fc97d){var _0x1c2d56={};var _0x4a1675={};var _0x2a5211;var _0xe137d2;return db['ZendeskConfiguration'][_0x9010('0x5a')]({'where':{'id':_0x1742fb['params']['id']}})['then'](handleEntityNotFound(_0x65fe85,null))['then'](function(_0x44da86){if(_0x44da86){_0x2a5211=_0x44da86;_0x4a1675[_0x9010('0x3d')]=_[_0x9010('0x51')](db['ZendeskField'][_0x9010('0x50')]);_0x4a1675[_0x9010('0x3f')]=_['keys'](_0x1742fb[_0x9010('0x3f')]);_0x4a1675['filters']=_[_0x9010('0x41')](_0x4a1675[_0x9010('0x3d')],_0x4a1675[_0x9010('0x3f')]);_0x1c2d56[_0x9010('0x42')]=_[_0x9010('0x41')](_0x4a1675['model'],qs[_0x9010('0x43')](_0x1742fb[_0x9010('0x3f')][_0x9010('0x43')]));_0x1c2d56[_0x9010('0x42')]=_0x1c2d56[_0x9010('0x42')]['length']?_0x1c2d56['attributes']:_0x4a1675[_0x9010('0x3d')];_0x1c2d56[_0x9010('0x5e')]=qs[_0x9010('0x46')](_0x1742fb[_0x9010('0x3f')]['sort']);_0x1c2d56['where']=qs[_0x9010('0x40')](_[_0x9010('0x48')](_0x1742fb[_0x9010('0x3f')],_0x4a1675[_0x9010('0x40')]));if(_0x1742fb[_0x9010('0x3f')]['filter']){_0x1c2d56['where']=_[_0x9010('0x4a')](_0x1c2d56[_0x9010('0x47')],{'$or':_[_0x9010('0x3e')](_0x1c2d56[_0x9010('0x42')],function(_0x4e4896){var _0x2a9365={};_0x2a9365[_0x4e4896]={'$like':'%'+_0x1742fb[_0x9010('0x3f')][_0x9010('0x49')]+'%'};return _0x2a9365;})});}_0x1c2d56=_[_0x9010('0x4a')]({},_0x1c2d56,_0x1742fb[_0x9010('0x54')]);return _0x2a5211[_0x9010('0x5d')](_0x1c2d56);}})[_0x9010('0x32')](function(_0x25afbf){if(_0x25afbf){_0xe137d2=_0x25afbf[_0x9010('0x52')];if(!_0x1742fb['query'][_0x9010('0x44')]('nolimit')){_0x1c2d56[_0x9010('0x2c')]=qs[_0x9010('0x2c')](_0x1742fb[_0x9010('0x3f')]['limit']);_0x1c2d56[_0x9010('0x2b')]=qs['offset'](_0x1742fb[_0x9010('0x3f')]['offset']);}return _0x2a5211[_0x9010('0x5d')](_0x1c2d56);}})[_0x9010('0x32')](function(_0x149c58){if(_0x149c58){return _0x149c58?{'count':_0xe137d2,'rows':_0x149c58}:null;}})[_0x9010('0x32')](respondWithResult(_0x65fe85,null))[_0x9010('0x27')](handleError(_0x65fe85,null));};exports['getDescriptions']=function(_0x2c7ee1,_0x4502ca,_0x2fe84e){var _0x4c8daf={};var _0x50dc40={};var _0x10c362;var _0x746879;return db[_0x9010('0x39')][_0x9010('0x5a')]({'where':{'id':_0x2c7ee1['params']['id']}})[_0x9010('0x32')](handleEntityNotFound(_0x4502ca,null))[_0x9010('0x32')](function(_0x176887){if(_0x176887){_0x10c362=_0x176887;_0x50dc40[_0x9010('0x3d')]=_[_0x9010('0x51')](db[_0x9010('0x5b')][_0x9010('0x50')]);_0x50dc40[_0x9010('0x3f')]=_[_0x9010('0x51')](_0x2c7ee1[_0x9010('0x3f')]);_0x50dc40['filters']=_[_0x9010('0x41')](_0x50dc40['model'],_0x50dc40[_0x9010('0x3f')]);_0x4c8daf[_0x9010('0x42')]=_['intersection'](_0x50dc40['model'],qs[_0x9010('0x43')](_0x2c7ee1[_0x9010('0x3f')][_0x9010('0x43')]));_0x4c8daf[_0x9010('0x42')]=_0x4c8daf[_0x9010('0x42')][_0x9010('0x52')]?_0x4c8daf['attributes']:_0x50dc40[_0x9010('0x3d')];_0x4c8daf[_0x9010('0x5e')]=qs[_0x9010('0x46')](_0x2c7ee1[_0x9010('0x3f')][_0x9010('0x46')]);_0x4c8daf[_0x9010('0x47')]=qs[_0x9010('0x40')](_[_0x9010('0x48')](_0x2c7ee1[_0x9010('0x3f')],_0x50dc40['filters']));if(_0x2c7ee1['query'][_0x9010('0x49')]){_0x4c8daf[_0x9010('0x47')]=_[_0x9010('0x4a')](_0x4c8daf[_0x9010('0x47')],{'$or':_[_0x9010('0x3e')](_0x4c8daf[_0x9010('0x42')],function(_0x52ce8d){var _0x2778e4={};_0x2778e4[_0x52ce8d]={'$like':'%'+_0x2c7ee1[_0x9010('0x3f')][_0x9010('0x49')]+'%'};return _0x2778e4;})});}_0x4c8daf=_[_0x9010('0x4a')]({},_0x4c8daf,_0x2c7ee1[_0x9010('0x54')]);return _0x10c362[_0x9010('0x5f')](_0x4c8daf);}})[_0x9010('0x32')](function(_0x46ece3){if(_0x46ece3){_0x746879=_0x46ece3[_0x9010('0x52')];if(!_0x2c7ee1[_0x9010('0x3f')][_0x9010('0x44')](_0x9010('0x45'))){_0x4c8daf['limit']=qs[_0x9010('0x2c')](_0x2c7ee1[_0x9010('0x3f')][_0x9010('0x2c')]);_0x4c8daf[_0x9010('0x2b')]=qs[_0x9010('0x2b')](_0x2c7ee1['query'][_0x9010('0x2b')]);}return _0x10c362[_0x9010('0x5f')](_0x4c8daf);}})[_0x9010('0x32')](function(_0x42015f){if(_0x42015f){return _0x42015f?{'count':_0x746879,'rows':_0x42015f}:null;}})[_0x9010('0x32')](respondWithResult(_0x4502ca,null))[_0x9010('0x27')](handleError(_0x4502ca,null));};exports[_0x9010('0x60')]=function(_0x38e765,_0x10b7a5,_0x21fd51){var _0x59bd76={};var _0x400812={};var _0x32f4a9;var _0x3cb4aa;return db[_0x9010('0x39')][_0x9010('0x5a')]({'where':{'id':_0x38e765['params']['id']}})['then'](handleEntityNotFound(_0x10b7a5,null))[_0x9010('0x32')](function(_0x5c1f7f){if(_0x5c1f7f){_0x32f4a9=_0x5c1f7f;_0x400812[_0x9010('0x3d')]=_[_0x9010('0x51')](db[_0x9010('0x61')][_0x9010('0x50')]);_0x400812[_0x9010('0x3f')]=_['keys'](_0x38e765[_0x9010('0x3f')]);_0x400812['filters']=_[_0x9010('0x41')](_0x400812[_0x9010('0x3d')],_0x400812[_0x9010('0x3f')]);_0x59bd76[_0x9010('0x42')]=_['intersection'](_0x400812[_0x9010('0x3d')],qs[_0x9010('0x43')](_0x38e765[_0x9010('0x3f')][_0x9010('0x43')]));_0x59bd76[_0x9010('0x42')]=_0x59bd76[_0x9010('0x42')][_0x9010('0x52')]?_0x59bd76[_0x9010('0x42')]:_0x400812['model'];_0x59bd76[_0x9010('0x5e')]=qs[_0x9010('0x46')](_0x38e765[_0x9010('0x3f')]['sort']);_0x59bd76[_0x9010('0x47')]=qs['filters'](_[_0x9010('0x48')](_0x38e765[_0x9010('0x3f')],_0x400812[_0x9010('0x40')]));if(_0x38e765[_0x9010('0x3f')][_0x9010('0x49')]){_0x59bd76[_0x9010('0x47')]=_[_0x9010('0x4a')](_0x59bd76[_0x9010('0x47')],{'$or':_[_0x9010('0x3e')](_0x59bd76[_0x9010('0x42')],function(_0x5387f6){var _0x7c0e42={};_0x7c0e42[_0x5387f6]={'$like':'%'+_0x38e765[_0x9010('0x3f')][_0x9010('0x49')]+'%'};return _0x7c0e42;})});}_0x59bd76=_[_0x9010('0x4a')]({},_0x59bd76,_0x38e765['options']);return _0x32f4a9[_0x9010('0x60')](_0x59bd76);}})['then'](function(_0x59f677){if(_0x59f677){_0x3cb4aa=_0x59f677[_0x9010('0x52')];if(!_0x38e765[_0x9010('0x3f')]['hasOwnProperty']('nolimit')){_0x59bd76['limit']=qs[_0x9010('0x2c')](_0x38e765[_0x9010('0x3f')][_0x9010('0x2c')]);_0x59bd76['offset']=qs['offset'](_0x38e765[_0x9010('0x3f')]['offset']);}return _0x32f4a9[_0x9010('0x60')](_0x59bd76);}})['then'](function(_0x4548ad){if(_0x4548ad){return _0x4548ad?{'count':_0x3cb4aa,'rows':_0x4548ad}:null;}})[_0x9010('0x32')](respondWithResult(_0x10b7a5,null))[_0x9010('0x27')](handleError(_0x10b7a5,null));};exports[_0x9010('0x62')]=function(_0x13d62b,_0x191d1c,_0x5b312d){if(_0x13d62b[_0x9010('0x58')]['id']){delete _0x13d62b['body']['id'];}return db['ZendeskConfiguration'][_0x9010('0x5a')]({'where':{'id':_0x13d62b[_0x9010('0x59')]['id']}})['then'](handleEntityNotFound(_0x191d1c,null))[_0x9010('0x32')](function(_0x25236c){if(_0x25236c){return _0x25236c[_0x9010('0x62')](_0x13d62b[_0x9010('0x58')][_0x9010('0x63')]||[]);}return null;})[_0x9010('0x32')](respondWithResult(_0x191d1c,null))[_0x9010('0x27')](handleError(_0x191d1c,null));};
\ No newline at end of file
diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js
index 0fec523..02afdd6 100644
--- a/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js
+++ b/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x50a3=['define','ZendeskConfiguration','int_zendesk_configurations','lodash','../../config/logger','bluebird','rimraf','../../config/environment','exports'];(function(_0x38e72d,_0x167d10){var _0x388a26=function(_0x2c9e94){while(--_0x2c9e94){_0x38e72d['push'](_0x38e72d['shift']());}};_0x388a26(++_0x167d10);}(_0x50a3,0x198));var _0x350a=function(_0x2e913b,_0x4b7071){_0x2e913b=_0x2e913b-0x0;var _0x173899=_0x50a3[_0x2e913b];return _0x173899;};'use strict';var _=require(_0x350a('0x0'));var util=require('util');var logger=require(_0x350a('0x1'))('api');var moment=require('moment');var BPromise=require(_0x350a('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x350a('0x3'));var config=require(_0x350a('0x4'));var attributes=require('./intZendeskConfiguration.attributes');module[_0x350a('0x5')]=function(_0xa53ae1,_0x2a4b94){return _0xa53ae1[_0x350a('0x6')](_0x350a('0x7'),attributes,{'tableName':_0x350a('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x9baf=['../../config/environment','./intZendeskConfiguration.attributes','exports','define','int_zendesk_configurations','../../config/logger','api','moment','bluebird','request-promise','rimraf'];(function(_0x580005,_0x55e402){var _0x12defc=function(_0xb57f09){while(--_0xb57f09){_0x580005['push'](_0x580005['shift']());}};_0x12defc(++_0x55e402);}(_0x9baf,0x1f4));var _0xf9ba=function(_0x4c3ad0,_0x11b23b){_0x4c3ad0=_0x4c3ad0-0x0;var _0x2766de=_0x9baf[_0x4c3ad0];return _0x2766de;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xf9ba('0x0'))(_0xf9ba('0x1'));var moment=require(_0xf9ba('0x2'));var BPromise=require(_0xf9ba('0x3'));var rp=require(_0xf9ba('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf9ba('0x5'));var config=require(_0xf9ba('0x6'));var attributes=require(_0xf9ba('0x7'));module[_0xf9ba('0x8')]=function(_0x28abd7,_0x1bdaba){return _0x28abd7[_0xf9ba('0x9')]('ZendeskConfiguration',attributes,{'tableName':_0xf9ba('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.rpc.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.rpc.js
index 4a37869..2ef9403 100644
--- a/server/api/intZendeskConfiguration/intZendeskConfiguration.rpc.js
+++ b/server/api/intZendeskConfiguration/intZendeskConfiguration.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x3277=['rpc','request','then','info','ZendeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','result','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x543084,_0x4337f5){var _0x306a57=function(_0x2769ed){while(--_0x2769ed){_0x543084['push'](_0x543084['shift']());}};_0x306a57(++_0x4337f5);}(_0x3277,0x12c));var _0x7327=function(_0x15695b,_0x259c66){_0x15695b=_0x15695b-0x0;var _0x2282ca=_0x3277[_0x15695b];return _0x2282ca;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x7327('0x0'));var BPromise=require('bluebird');var rs=require(_0x7327('0x1'));var fs=require('fs');var Redis=require(_0x7327('0x2'));var db=require(_0x7327('0x3'))['db'];var utils=require(_0x7327('0x4'));var logger=require(_0x7327('0x5'))(_0x7327('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x10adcf,_0x500567,_0x54370d){return new BPromise(function(_0x33c7b8,_0x496ec2){return client[_0x7327('0x7')](_0x10adcf,_0x54370d)[_0x7327('0x8')](function(_0x416a7e){logger[_0x7327('0x9')](_0x7327('0xa'),_0x500567,_0x7327('0xb'));logger[_0x7327('0xc')](_0x7327('0xd'),_0x500567,_0x7327('0xb'),JSON[_0x7327('0xe')](_0x416a7e));if(_0x416a7e[_0x7327('0xf')]){if(_0x416a7e['error']['code']===0x1f4){logger['error'](_0x7327('0xa'),_0x500567,_0x416a7e[_0x7327('0xf')]['message']);return _0x496ec2(_0x416a7e['error'][_0x7327('0x10')]);}logger[_0x7327('0xf')](_0x7327('0xa'),_0x500567,_0x416a7e[_0x7327('0xf')]['message']);return _0x33c7b8(_0x416a7e['error'][_0x7327('0x10')]);}else{logger[_0x7327('0x9')](_0x7327('0xa'),_0x500567,'request\x20sent');_0x33c7b8(_0x416a7e[_0x7327('0x11')]['message']);}})['catch'](function(_0x1a9419){logger['error'](_0x7327('0xa'),_0x500567,_0x1a9419);_0x496ec2(_0x1a9419);});});}
\ No newline at end of file
+var _0x49e2=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','request\x20sent','stringify','error','code','ZendeskConfiguration,\x20%s,\x20%s','message','result','catch','moment'];(function(_0x34fc0a,_0x227d88){var _0x27cf4d=function(_0x2cc5e6){while(--_0x2cc5e6){_0x34fc0a['push'](_0x34fc0a['shift']());}};_0x27cf4d(++_0x227d88);}(_0x49e2,0x18b));var _0x249e=function(_0x35cacd,_0xd36737){_0x35cacd=_0x35cacd-0x0;var _0x3505ee=_0x49e2[_0x35cacd];return _0x3505ee;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x249e('0x0'));var BPromise=require(_0x249e('0x1'));var rs=require(_0x249e('0x2'));var fs=require('fs');var Redis=require(_0x249e('0x3'));var db=require(_0x249e('0x4'))['db'];var utils=require(_0x249e('0x5'));var logger=require(_0x249e('0x6'))(_0x249e('0x7'));var config=require(_0x249e('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x249e('0x9')][_0x249e('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3a3629,_0x5abe4d,_0x23b7c6){return new BPromise(function(_0xdec6e,_0x305cd8){return client[_0x249e('0xb')](_0x3a3629,_0x23b7c6)[_0x249e('0xc')](function(_0x474e35){logger[_0x249e('0xd')]('ZendeskConfiguration,\x20%s,\x20%s',_0x5abe4d,_0x249e('0xe'));logger['debug']('ZendeskConfiguration,\x20%s,\x20%s,\x20%s',_0x5abe4d,_0x249e('0xe'),JSON[_0x249e('0xf')](_0x474e35));if(_0x474e35[_0x249e('0x10')]){if(_0x474e35[_0x249e('0x10')][_0x249e('0x11')]===0x1f4){logger[_0x249e('0x10')](_0x249e('0x12'),_0x5abe4d,_0x474e35['error'][_0x249e('0x13')]);return _0x305cd8(_0x474e35[_0x249e('0x10')][_0x249e('0x13')]);}logger['error'](_0x249e('0x12'),_0x5abe4d,_0x474e35[_0x249e('0x10')]['message']);return _0xdec6e(_0x474e35[_0x249e('0x10')][_0x249e('0x13')]);}else{logger['info'](_0x249e('0x12'),_0x5abe4d,'request\x20sent');_0xdec6e(_0x474e35[_0x249e('0x14')][_0x249e('0x13')]);}})[_0x249e('0x15')](function(_0x48b08e){logger['error'](_0x249e('0x12'),_0x5abe4d,_0x48b08e);_0x305cd8(_0x48b08e);});});}
\ No newline at end of file
diff --git a/server/api/intZendeskField/index.js b/server/api/intZendeskField/index.js
index 8492891..1b4a455 100644
--- a/server/api/intZendeskField/index.js
+++ b/server/api/intZendeskField/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x2617=['put','update','delete','exports','multer','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./intZendeskField.controller','get','isAuthenticated','index','/:id','show','post','create'];(function(_0x35b18a,_0x6b2fbe){var _0x4db1bd=function(_0x389e62){while(--_0x389e62){_0x35b18a['push'](_0x35b18a['shift']());}};_0x4db1bd(++_0x6b2fbe);}(_0x2617,0xb8));var _0x7261=function(_0x56b44b,_0x153618){_0x56b44b=_0x56b44b-0x0;var _0x482ca9=_0x2617[_0x56b44b];return _0x482ca9;};'use strict';var multer=require(_0x7261('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x7261('0x1'));var express=require(_0x7261('0x2'));var router=express[_0x7261('0x3')]();var auth=require(_0x7261('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x7261('0x5'));var controller=require(_0x7261('0x6'));router[_0x7261('0x7')]('/',auth[_0x7261('0x8')](),controller[_0x7261('0x9')]);router[_0x7261('0x7')](_0x7261('0xa'),auth[_0x7261('0x8')](),controller[_0x7261('0xb')]);router[_0x7261('0xc')]('/',auth[_0x7261('0x8')](),controller[_0x7261('0xd')]);router[_0x7261('0xe')](_0x7261('0xa'),auth[_0x7261('0x8')](),controller[_0x7261('0xf')]);router[_0x7261('0x10')](_0x7261('0xa'),auth['isAuthenticated'](),controller['destroy']);module[_0x7261('0x11')]=router;
\ No newline at end of file
+var _0x5762=['isAuthenticated','index','/:id','show','create','delete','destroy','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./intZendeskField.controller','get'];(function(_0x1b0126,_0x2b37e2){var _0x491308=function(_0x5c347d){while(--_0x5c347d){_0x1b0126['push'](_0x1b0126['shift']());}};_0x491308(++_0x2b37e2);}(_0x5762,0xc2));var _0x2576=function(_0x126420,_0x476f16){_0x126420=_0x126420-0x0;var _0x4e6517=_0x5762[_0x126420];return _0x4e6517;};'use strict';var multer=require(_0x2576('0x0'));var util=require(_0x2576('0x1'));var path=require(_0x2576('0x2'));var timeout=require(_0x2576('0x3'));var express=require(_0x2576('0x4'));var router=express[_0x2576('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0x2576('0x6'));var config=require(_0x2576('0x7'));var controller=require(_0x2576('0x8'));router[_0x2576('0x9')]('/',auth[_0x2576('0xa')](),controller[_0x2576('0xb')]);router[_0x2576('0x9')](_0x2576('0xc'),auth['isAuthenticated'](),controller[_0x2576('0xd')]);router['post']('/',auth[_0x2576('0xa')](),controller[_0x2576('0xe')]);router['put']('/:id',auth[_0x2576('0xa')](),controller['update']);router[_0x2576('0xf')](_0x2576('0xc'),auth[_0x2576('0xa')](),controller[_0x2576('0x10')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/intZendeskField/intZendeskField.attributes.js b/server/api/intZendeskField/intZendeskField.attributes.js
index bbcf19e..0d88d16 100644
--- a/server/api/intZendeskField/intZendeskField.attributes.js
+++ b/server/api/intZendeskField/intZendeskField.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xe233=['variable','customVariable','BOOLEAN','sequelize','string','keyValue','STRING','ENUM'];(function(_0x265aa2,_0x220072){var _0x447a3a=function(_0x1512cc){while(--_0x1512cc){_0x265aa2['push'](_0x265aa2['shift']());}};_0x447a3a(++_0x220072);}(_0xe233,0x15b));var _0x3e23=function(_0x5a872c,_0x30c88b){_0x5a872c=_0x5a872c-0x0;var _0x5df4c9=_0xe233[_0x5a872c];return _0x5df4c9;};'use strict';var Sequelize=require(_0x3e23('0x0'));module['exports']={'type':{'type':Sequelize['ENUM'](_0x3e23('0x1'),'variable','customVariable',_0x3e23('0x2')),'defaultValue':_0x3e23('0x1')},'content':{'type':Sequelize[_0x3e23('0x3')]},'key':{'type':Sequelize[_0x3e23('0x3')]},'keyType':{'type':Sequelize[_0x3e23('0x4')]('string',_0x3e23('0x5'),_0x3e23('0x6'))},'keyContent':{'type':Sequelize[_0x3e23('0x3')]},'idField':{'type':Sequelize[_0x3e23('0x3')]},'nameField':{'type':Sequelize[_0x3e23('0x3')]},'customField':{'type':Sequelize[_0x3e23('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x3e23('0x3')]}};
\ No newline at end of file
+var _0xbe52=['variable','keyValue','STRING','customVariable','BOOLEAN','sequelize','exports','ENUM','string'];(function(_0x1035c1,_0x2d8583){var _0x308d67=function(_0x58ddb6){while(--_0x58ddb6){_0x1035c1['push'](_0x1035c1['shift']());}};_0x308d67(++_0x2d8583);}(_0xbe52,0x164));var _0x2be5=function(_0x3fc1a7,_0x4416b9){_0x3fc1a7=_0x3fc1a7-0x0;var _0x28f0b3=_0xbe52[_0x3fc1a7];return _0x28f0b3;};'use strict';var Sequelize=require(_0x2be5('0x0'));module[_0x2be5('0x1')]={'type':{'type':Sequelize[_0x2be5('0x2')](_0x2be5('0x3'),_0x2be5('0x4'),'customVariable',_0x2be5('0x5')),'defaultValue':_0x2be5('0x3')},'content':{'type':Sequelize[_0x2be5('0x6')]},'key':{'type':Sequelize[_0x2be5('0x6')]},'keyType':{'type':Sequelize[_0x2be5('0x2')](_0x2be5('0x3'),_0x2be5('0x4'),_0x2be5('0x7'))},'keyContent':{'type':Sequelize[_0x2be5('0x6')]},'idField':{'type':Sequelize[_0x2be5('0x6')]},'nameField':{'type':Sequelize[_0x2be5('0x6')]},'customField':{'type':Sequelize[_0x2be5('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}};
\ No newline at end of file
diff --git a/server/api/intZendeskField/intZendeskField.controller.js b/server/api/intZendeskField/intZendeskField.controller.js
index 0f0b711..9e9c8ee 100644
--- a/server/api/intZendeskField/intZendeskField.controller.js
+++ b/server/api/intZendeskField/intZendeskField.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x8aca=['send','rawAttributes','fieldName','type','key','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','map','VIRTUAL','options','ZendeskField','include','findAll','rows','catch','show','params','includeAll','find','create','body','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','save','update','then','destroy','name'];(function(_0xf38f9d,_0xbc3473){var _0x208abd=function(_0x5f1261){while(--_0x5f1261){_0xf38f9d['push'](_0xf38f9d['shift']());}};_0x208abd(++_0xbc3473);}(_0x8aca,0x1ea));var _0xa8ac=function(_0x33554b,_0x48162b){_0x33554b=_0x33554b-0x0;var _0x256954=_0x8aca[_0x33554b];return _0x256954;};'use strict';var pdf=require(_0xa8ac('0x0'));var emlformat=require(_0xa8ac('0x1'));var rimraf=require(_0xa8ac('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa8ac('0x3'));var rp=require(_0xa8ac('0x4'));var moment=require(_0xa8ac('0x5'));var BPromise=require(_0xa8ac('0x6'));var Mustache=require(_0xa8ac('0x7'));var util=require(_0xa8ac('0x8'));var path=require('path');var sox=require(_0xa8ac('0x9'));var csv=require(_0xa8ac('0xa'));var ejs=require(_0xa8ac('0xb'));var fs=require('fs');var _=require(_0xa8ac('0xc'));var squel=require(_0xa8ac('0xd'));var crypto=require(_0xa8ac('0xe'));var jsforce=require(_0xa8ac('0xf'));var deskjs=require(_0xa8ac('0x10'));var toCsv=require(_0xa8ac('0xa'));var querystring=require(_0xa8ac('0x11'));var Papa=require(_0xa8ac('0x12'));var Redis=require(_0xa8ac('0x13'));var authService=require('../../components/auth/service');var qs=require(_0xa8ac('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa8ac('0x15'));var logger=require(_0xa8ac('0x16'))(_0xa8ac('0x17'));var utils=require(_0xa8ac('0x18'));var config=require(_0xa8ac('0x19'));var db=require(_0xa8ac('0x1a'))['db'];function respondWithStatusCode(_0x306602,_0x28dcf6){_0x28dcf6=_0x28dcf6||0xcc;return function(_0x50887e){if(_0x50887e){return _0x306602[_0xa8ac('0x1b')](_0x28dcf6);}return _0x306602[_0xa8ac('0x1c')](_0x28dcf6)[_0xa8ac('0x1d')]();};}function respondWithResult(_0x343e7a,_0x410060){_0x410060=_0x410060||0xc8;return function(_0x5de1ed){if(_0x5de1ed){return _0x343e7a['status'](_0x410060)[_0xa8ac('0x1e')](_0x5de1ed);}};}function respondWithFilteredResult(_0x47a642,_0x759fb4){return function(_0x46ba45){if(_0x46ba45){var _0x5e3b20=_0x46ba45[_0xa8ac('0x1f')],_0xf06b49=_0x759fb4[_0xa8ac('0x20')],_0x36e988=_0x759fb4[_0xa8ac('0x20')]+_0x759fb4[_0xa8ac('0x21')],_0x22bf90;if(_0x36e988>=_0x5e3b20){_0x36e988=_0x5e3b20;_0x22bf90=0xc8;}else{_0x22bf90=0xce;}_0x47a642[_0xa8ac('0x1c')](_0x22bf90);return _0x47a642[_0xa8ac('0x22')](_0xa8ac('0x23'),_0xf06b49+'-'+_0x36e988+'/'+_0x5e3b20)[_0xa8ac('0x1e')](_0x46ba45);}return null;};}function patchUpdates(_0x1af7aa){return function(_0x58558d){try{jsonpatch[_0xa8ac('0x24')](_0x58558d,_0x1af7aa,!![]);}catch(_0x4a6ae8){return BPromise['reject'](_0x4a6ae8);}return _0x58558d[_0xa8ac('0x25')]();};}function saveUpdates(_0x168520,_0x3c0b6a){return function(_0x13a225){if(_0x13a225){return _0x13a225[_0xa8ac('0x26')](_0x168520)[_0xa8ac('0x27')](function(_0x2e1004){return _0x2e1004;});}return null;};}function removeEntity(_0x53486f,_0x587139){return function(_0x1519bb){if(_0x1519bb){return _0x1519bb[_0xa8ac('0x28')]()['then'](function(){_0x53486f[_0xa8ac('0x1c')](0xcc)[_0xa8ac('0x1d')]();});}};}function handleEntityNotFound(_0xab5062,_0x3be49d){return function(_0x5bda56){if(!_0x5bda56){_0xab5062[_0xa8ac('0x1b')](0x194);}return _0x5bda56;};}function handleError(_0x59644c,_0x38440c){_0x38440c=_0x38440c||0x1f4;return function(_0x202449){logger['error'](_0x202449['stack']);if(_0x202449[_0xa8ac('0x29')]){delete _0x202449['name'];}_0x59644c[_0xa8ac('0x1c')](_0x38440c)[_0xa8ac('0x2a')](_0x202449);};}exports['index']=function(_0x3c54ad,_0x2f225e){var _0x418771={},_0x3bd698={},_0x31825d={'count':0x0,'rows':[]};var _0x16252e=_['map'](db['ZendeskField'][_0xa8ac('0x2b')],function(_0x2c9146){return{'name':_0x2c9146[_0xa8ac('0x2c')],'type':_0x2c9146[_0xa8ac('0x2d')][_0xa8ac('0x2e')]};});_0x3bd698['model']=_['map'](_0x16252e,_0xa8ac('0x29'));_0x3bd698['query']=_[_0xa8ac('0x2f')](_0x3c54ad[_0xa8ac('0x30')]);_0x3bd698[_0xa8ac('0x31')]=_[_0xa8ac('0x32')](_0x3bd698[_0xa8ac('0x33')],_0x3bd698['query']);_0x418771[_0xa8ac('0x34')]=_['intersection'](_0x3bd698[_0xa8ac('0x33')],qs[_0xa8ac('0x35')](_0x3c54ad[_0xa8ac('0x30')]['fields']));_0x418771[_0xa8ac('0x34')]=_0x418771['attributes'][_0xa8ac('0x36')]?_0x418771[_0xa8ac('0x34')]:_0x3bd698[_0xa8ac('0x33')];if(!_0x3c54ad[_0xa8ac('0x30')][_0xa8ac('0x37')]('nolimit')){_0x418771[_0xa8ac('0x21')]=qs[_0xa8ac('0x21')](_0x3c54ad[_0xa8ac('0x30')][_0xa8ac('0x21')]);_0x418771['offset']=qs[_0xa8ac('0x20')](_0x3c54ad[_0xa8ac('0x30')][_0xa8ac('0x20')]);}_0x418771[_0xa8ac('0x38')]=qs[_0xa8ac('0x39')](_0x3c54ad[_0xa8ac('0x30')]['sort']);_0x418771[_0xa8ac('0x3a')]=qs[_0xa8ac('0x31')](_[_0xa8ac('0x3b')](_0x3c54ad[_0xa8ac('0x30')],_0x3bd698[_0xa8ac('0x31')]),_0x16252e);if(_0x3c54ad[_0xa8ac('0x30')][_0xa8ac('0x3c')]){_0x418771[_0xa8ac('0x3a')]=_[_0xa8ac('0x3d')](_0x418771[_0xa8ac('0x3a')],{'$or':_[_0xa8ac('0x3e')](_0x16252e,function(_0x3640d6){if(_0x3640d6[_0xa8ac('0x2d')]!==_0xa8ac('0x3f')){var _0x512e51={};_0x512e51[_0x3640d6[_0xa8ac('0x29')]]={'$like':'%'+_0x3c54ad[_0xa8ac('0x30')][_0xa8ac('0x3c')]+'%'};return _0x512e51;}})});}_0x418771=_[_0xa8ac('0x3d')]({},_0x418771,_0x3c54ad[_0xa8ac('0x40')]);var _0x3a162c={'where':_0x418771['where']};return db[_0xa8ac('0x41')][_0xa8ac('0x1f')](_0x3a162c)[_0xa8ac('0x27')](function(_0x53e10d){_0x31825d[_0xa8ac('0x1f')]=_0x53e10d;if(_0x3c54ad[_0xa8ac('0x30')]['includeAll']){_0x418771[_0xa8ac('0x42')]=[{'all':!![]}];}return db[_0xa8ac('0x41')][_0xa8ac('0x43')](_0x418771);})[_0xa8ac('0x27')](function(_0x3fd07c){_0x31825d[_0xa8ac('0x44')]=_0x3fd07c;return _0x31825d;})[_0xa8ac('0x27')](respondWithFilteredResult(_0x2f225e,_0x418771))[_0xa8ac('0x45')](handleError(_0x2f225e,null));};exports[_0xa8ac('0x46')]=function(_0x4d9ab5,_0xa2bb09){var _0xa6eb49={'raw':!![],'where':{'id':_0x4d9ab5[_0xa8ac('0x47')]['id']}},_0x207f7d={};_0x207f7d['model']=_[_0xa8ac('0x2f')](db[_0xa8ac('0x41')]['rawAttributes']);_0x207f7d[_0xa8ac('0x30')]=_[_0xa8ac('0x2f')](_0x4d9ab5[_0xa8ac('0x30')]);_0x207f7d[_0xa8ac('0x31')]=_[_0xa8ac('0x32')](_0x207f7d['model'],_0x207f7d[_0xa8ac('0x30')]);_0xa6eb49[_0xa8ac('0x34')]=_[_0xa8ac('0x32')](_0x207f7d[_0xa8ac('0x33')],qs[_0xa8ac('0x35')](_0x4d9ab5[_0xa8ac('0x30')]['fields']));_0xa6eb49['attributes']=_0xa6eb49[_0xa8ac('0x34')]['length']?_0xa6eb49[_0xa8ac('0x34')]:_0x207f7d['model'];if(_0x4d9ab5[_0xa8ac('0x30')][_0xa8ac('0x48')]){_0xa6eb49[_0xa8ac('0x42')]=[{'all':!![]}];}_0xa6eb49=_[_0xa8ac('0x3d')]({},_0xa6eb49,_0x4d9ab5[_0xa8ac('0x40')]);return db[_0xa8ac('0x41')][_0xa8ac('0x49')](_0xa6eb49)[_0xa8ac('0x27')](handleEntityNotFound(_0xa2bb09,null))['then'](respondWithResult(_0xa2bb09,null))['catch'](handleError(_0xa2bb09,null));};exports[_0xa8ac('0x4a')]=function(_0x462673,_0x2915f4){return db[_0xa8ac('0x41')][_0xa8ac('0x4a')](_0x462673[_0xa8ac('0x4b')],{})['then'](respondWithResult(_0x2915f4,0xc9))[_0xa8ac('0x45')](handleError(_0x2915f4,null));};exports[_0xa8ac('0x26')]=function(_0x5de104,_0x25b6ca){if(_0x5de104[_0xa8ac('0x4b')]['id']){delete _0x5de104[_0xa8ac('0x4b')]['id'];}return db['ZendeskField'][_0xa8ac('0x49')]({'where':{'id':_0x5de104[_0xa8ac('0x47')]['id']}})[_0xa8ac('0x27')](handleEntityNotFound(_0x25b6ca,null))[_0xa8ac('0x27')](saveUpdates(_0x5de104['body'],null))[_0xa8ac('0x27')](respondWithResult(_0x25b6ca,null))[_0xa8ac('0x45')](handleError(_0x25b6ca,null));};exports['destroy']=function(_0x18f4a4,_0x2659e3){return db[_0xa8ac('0x41')]['find']({'where':{'id':_0x18f4a4[_0xa8ac('0x47')]['id']}})[_0xa8ac('0x27')](handleEntityNotFound(_0x2659e3,null))[_0xa8ac('0x27')](removeEntity(_0x2659e3,null))['catch'](handleError(_0x2659e3,null));};
\ No newline at end of file
+var _0x5605=['api','../../config/utils','../../config/environment','sendStatus','status','end','count','offset','limit','set','Content-Range','json','reject','then','error','stack','name','send','map','ZendeskField','rawAttributes','fieldName','type','key','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','show','params','includeAll','find','create','body','catch','update','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','lodash','squel','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger'];(function(_0x59935c,_0x9d6668){var _0x48cb71=function(_0x571946){while(--_0x571946){_0x59935c['push'](_0x59935c['shift']());}};_0x48cb71(++_0x9d6668);}(_0x5605,0x15c));var _0x5560=function(_0x4d1744,_0x4171ea){_0x4d1744=_0x4d1744-0x0;var _0x115232=_0x5605[_0x4d1744];return _0x115232;};'use strict';var pdf=require(_0x5560('0x0'));var emlformat=require(_0x5560('0x1'));var rimraf=require(_0x5560('0x2'));var zipdir=require(_0x5560('0x3'));var jsonpatch=require(_0x5560('0x4'));var rp=require(_0x5560('0x5'));var moment=require(_0x5560('0x6'));var BPromise=require(_0x5560('0x7'));var Mustache=require(_0x5560('0x8'));var util=require(_0x5560('0x9'));var path=require('path');var sox=require(_0x5560('0xa'));var csv=require('to-csv');var ejs=require(_0x5560('0xb'));var fs=require('fs');var _=require(_0x5560('0xc'));var squel=require(_0x5560('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x5560('0xe'));var querystring=require(_0x5560('0xf'));var Papa=require(_0x5560('0x10'));var Redis=require('ioredis');var authService=require(_0x5560('0x11'));var qs=require(_0x5560('0x12'));var as=require(_0x5560('0x13'));var hardwareService=require(_0x5560('0x14'));var logger=require(_0x5560('0x15'))(_0x5560('0x16'));var utils=require(_0x5560('0x17'));var config=require(_0x5560('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x443234,_0x2f7b5a){_0x2f7b5a=_0x2f7b5a||0xcc;return function(_0x14ebd2){if(_0x14ebd2){return _0x443234[_0x5560('0x19')](_0x2f7b5a);}return _0x443234[_0x5560('0x1a')](_0x2f7b5a)[_0x5560('0x1b')]();};}function respondWithResult(_0x1edeb2,_0x239ec9){_0x239ec9=_0x239ec9||0xc8;return function(_0xc3a27d){if(_0xc3a27d){return _0x1edeb2['status'](_0x239ec9)['json'](_0xc3a27d);}};}function respondWithFilteredResult(_0x47b63,_0x4c9fc2){return function(_0x4e3fc2){if(_0x4e3fc2){var _0x4fc359=_0x4e3fc2[_0x5560('0x1c')],_0x14ca4d=_0x4c9fc2[_0x5560('0x1d')],_0x123d35=_0x4c9fc2[_0x5560('0x1d')]+_0x4c9fc2[_0x5560('0x1e')],_0x30bbdd;if(_0x123d35>=_0x4fc359){_0x123d35=_0x4fc359;_0x30bbdd=0xc8;}else{_0x30bbdd=0xce;}_0x47b63[_0x5560('0x1a')](_0x30bbdd);return _0x47b63[_0x5560('0x1f')](_0x5560('0x20'),_0x14ca4d+'-'+_0x123d35+'/'+_0x4fc359)[_0x5560('0x21')](_0x4e3fc2);}return null;};}function patchUpdates(_0x28f00e){return function(_0x1b153e){try{jsonpatch['apply'](_0x1b153e,_0x28f00e,!![]);}catch(_0x553d39){return BPromise[_0x5560('0x22')](_0x553d39);}return _0x1b153e['save']();};}function saveUpdates(_0x15cd0a,_0x52bcfb){return function(_0x46fcff){if(_0x46fcff){return _0x46fcff['update'](_0x15cd0a)[_0x5560('0x23')](function(_0x4218a6){return _0x4218a6;});}return null;};}function removeEntity(_0x1cb275,_0x271b87){return function(_0x785d21){if(_0x785d21){return _0x785d21['destroy']()['then'](function(){_0x1cb275[_0x5560('0x1a')](0xcc)[_0x5560('0x1b')]();});}};}function handleEntityNotFound(_0x54acef,_0x32f56a){return function(_0x465cff){if(!_0x465cff){_0x54acef[_0x5560('0x19')](0x194);}return _0x465cff;};}function handleError(_0x2bcd93,_0x5ae084){_0x5ae084=_0x5ae084||0x1f4;return function(_0x5219d9){logger[_0x5560('0x24')](_0x5219d9[_0x5560('0x25')]);if(_0x5219d9[_0x5560('0x26')]){delete _0x5219d9[_0x5560('0x26')];}_0x2bcd93[_0x5560('0x1a')](_0x5ae084)[_0x5560('0x27')](_0x5219d9);};}exports['index']=function(_0x5ed416,_0x518000){var _0xedd05d={},_0x3a7ad8={},_0x2f4a60={'count':0x0,'rows':[]};var _0x1175dc=_[_0x5560('0x28')](db[_0x5560('0x29')][_0x5560('0x2a')],function(_0x2d314c){return{'name':_0x2d314c[_0x5560('0x2b')],'type':_0x2d314c[_0x5560('0x2c')][_0x5560('0x2d')]};});_0x3a7ad8['model']=_[_0x5560('0x28')](_0x1175dc,_0x5560('0x26'));_0x3a7ad8['query']=_[_0x5560('0x2e')](_0x5ed416[_0x5560('0x2f')]);_0x3a7ad8[_0x5560('0x30')]=_[_0x5560('0x31')](_0x3a7ad8[_0x5560('0x32')],_0x3a7ad8['query']);_0xedd05d[_0x5560('0x33')]=_[_0x5560('0x31')](_0x3a7ad8['model'],qs[_0x5560('0x34')](_0x5ed416['query'][_0x5560('0x34')]));_0xedd05d['attributes']=_0xedd05d[_0x5560('0x33')][_0x5560('0x35')]?_0xedd05d[_0x5560('0x33')]:_0x3a7ad8['model'];if(!_0x5ed416[_0x5560('0x2f')][_0x5560('0x36')](_0x5560('0x37'))){_0xedd05d['limit']=qs['limit'](_0x5ed416[_0x5560('0x2f')][_0x5560('0x1e')]);_0xedd05d['offset']=qs[_0x5560('0x1d')](_0x5ed416['query'][_0x5560('0x1d')]);}_0xedd05d[_0x5560('0x38')]=qs[_0x5560('0x39')](_0x5ed416['query'][_0x5560('0x39')]);_0xedd05d[_0x5560('0x3a')]=qs[_0x5560('0x30')](_[_0x5560('0x3b')](_0x5ed416[_0x5560('0x2f')],_0x3a7ad8[_0x5560('0x30')]),_0x1175dc);if(_0x5ed416[_0x5560('0x2f')][_0x5560('0x3c')]){_0xedd05d[_0x5560('0x3a')]=_[_0x5560('0x3d')](_0xedd05d[_0x5560('0x3a')],{'$or':_[_0x5560('0x28')](_0x1175dc,function(_0x1a79b7){if(_0x1a79b7[_0x5560('0x2c')]!==_0x5560('0x3e')){var _0x5d7a59={};_0x5d7a59[_0x1a79b7['name']]={'$like':'%'+_0x5ed416[_0x5560('0x2f')][_0x5560('0x3c')]+'%'};return _0x5d7a59;}})});}_0xedd05d=_['merge']({},_0xedd05d,_0x5ed416[_0x5560('0x3f')]);var _0x249f7a={'where':_0xedd05d[_0x5560('0x3a')]};return db[_0x5560('0x29')][_0x5560('0x1c')](_0x249f7a)[_0x5560('0x23')](function(_0x1666b4){_0x2f4a60['count']=_0x1666b4;if(_0x5ed416[_0x5560('0x2f')]['includeAll']){_0xedd05d[_0x5560('0x40')]=[{'all':!![]}];}return db['ZendeskField'][_0x5560('0x41')](_0xedd05d);})[_0x5560('0x23')](function(_0x1d43ba){_0x2f4a60['rows']=_0x1d43ba;return _0x2f4a60;})[_0x5560('0x23')](respondWithFilteredResult(_0x518000,_0xedd05d))['catch'](handleError(_0x518000,null));};exports[_0x5560('0x42')]=function(_0x448df2,_0x19538a){var _0xbcfdc4={'raw':!![],'where':{'id':_0x448df2[_0x5560('0x43')]['id']}},_0x173d4f={};_0x173d4f[_0x5560('0x32')]=_['keys'](db['ZendeskField'][_0x5560('0x2a')]);_0x173d4f[_0x5560('0x2f')]=_[_0x5560('0x2e')](_0x448df2['query']);_0x173d4f[_0x5560('0x30')]=_[_0x5560('0x31')](_0x173d4f[_0x5560('0x32')],_0x173d4f[_0x5560('0x2f')]);_0xbcfdc4[_0x5560('0x33')]=_[_0x5560('0x31')](_0x173d4f['model'],qs[_0x5560('0x34')](_0x448df2[_0x5560('0x2f')][_0x5560('0x34')]));_0xbcfdc4[_0x5560('0x33')]=_0xbcfdc4['attributes'][_0x5560('0x35')]?_0xbcfdc4[_0x5560('0x33')]:_0x173d4f[_0x5560('0x32')];if(_0x448df2[_0x5560('0x2f')][_0x5560('0x44')]){_0xbcfdc4[_0x5560('0x40')]=[{'all':!![]}];}_0xbcfdc4=_[_0x5560('0x3d')]({},_0xbcfdc4,_0x448df2[_0x5560('0x3f')]);return db[_0x5560('0x29')][_0x5560('0x45')](_0xbcfdc4)['then'](handleEntityNotFound(_0x19538a,null))[_0x5560('0x23')](respondWithResult(_0x19538a,null))['catch'](handleError(_0x19538a,null));};exports[_0x5560('0x46')]=function(_0x453f51,_0x183458){return db[_0x5560('0x29')]['create'](_0x453f51[_0x5560('0x47')],{})[_0x5560('0x23')](respondWithResult(_0x183458,0xc9))[_0x5560('0x48')](handleError(_0x183458,null));};exports[_0x5560('0x49')]=function(_0x4becd4,_0x2de99e){if(_0x4becd4[_0x5560('0x47')]['id']){delete _0x4becd4[_0x5560('0x47')]['id'];}return db[_0x5560('0x29')][_0x5560('0x45')]({'where':{'id':_0x4becd4[_0x5560('0x43')]['id']}})[_0x5560('0x23')](handleEntityNotFound(_0x2de99e,null))[_0x5560('0x23')](saveUpdates(_0x4becd4[_0x5560('0x47')],null))[_0x5560('0x23')](respondWithResult(_0x2de99e,null))[_0x5560('0x48')](handleError(_0x2de99e,null));};exports['destroy']=function(_0x3d3ffc,_0x34b800){return db[_0x5560('0x29')]['find']({'where':{'id':_0x3d3ffc[_0x5560('0x43')]['id']}})[_0x5560('0x23')](handleEntityNotFound(_0x34b800,null))[_0x5560('0x23')](removeEntity(_0x34b800,null))[_0x5560('0x48')](handleError(_0x34b800,null));};
\ No newline at end of file
diff --git a/server/api/intZendeskField/intZendeskField.model.js b/server/api/intZendeskField/intZendeskField.model.js
index 0b499de..29abbc4 100644
--- a/server/api/intZendeskField/intZendeskField.model.js
+++ b/server/api/intZendeskField/intZendeskField.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xa149=['moment','bluebird','request-promise','path','rimraf','./intZendeskField.attributes','exports','define','ZendeskField','int_zendesk_fields','zendesk_unique_index','idField','lodash','util','../../config/logger','api'];(function(_0x379799,_0x4ccf16){var _0x46e431=function(_0x34bd4d){while(--_0x34bd4d){_0x379799['push'](_0x379799['shift']());}};_0x46e431(++_0x4ccf16);}(_0xa149,0x18c));var _0x9a14=function(_0x395bb6,_0x450703){_0x395bb6=_0x395bb6-0x0;var _0x3385b2=_0xa149[_0x395bb6];return _0x3385b2;};'use strict';var _=require(_0x9a14('0x0'));var util=require(_0x9a14('0x1'));var logger=require(_0x9a14('0x2'))(_0x9a14('0x3'));var moment=require(_0x9a14('0x4'));var BPromise=require(_0x9a14('0x5'));var rp=require(_0x9a14('0x6'));var fs=require('fs');var path=require(_0x9a14('0x7'));var rimraf=require(_0x9a14('0x8'));var config=require('../../config/environment');var attributes=require(_0x9a14('0x9'));module[_0x9a14('0xa')]=function(_0x5abb12,_0x417648){return _0x5abb12[_0x9a14('0xb')](_0x9a14('0xc'),attributes,{'tableName':_0x9a14('0xd'),'paranoid':![],'indexes':[{'name':_0x9a14('0xe'),'fields':[_0x9a14('0xf'),'FieldId'],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xb62e=['../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./intZendeskField.attributes','define','int_zendesk_fields','zendesk_unique_index','idField','FieldId','lodash','util'];(function(_0x236d24,_0x29e80a){var _0x1574cf=function(_0x5d1dad){while(--_0x5d1dad){_0x236d24['push'](_0x236d24['shift']());}};_0x1574cf(++_0x29e80a);}(_0xb62e,0x1de));var _0xeb62=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0xb62e[_0x1ac595];return _0x455fff;};'use strict';var _=require(_0xeb62('0x0'));var util=require(_0xeb62('0x1'));var logger=require(_0xeb62('0x2'))(_0xeb62('0x3'));var moment=require('moment');var BPromise=require(_0xeb62('0x4'));var rp=require(_0xeb62('0x5'));var fs=require('fs');var path=require(_0xeb62('0x6'));var rimraf=require(_0xeb62('0x7'));var config=require(_0xeb62('0x8'));var attributes=require(_0xeb62('0x9'));module['exports']=function(_0x3ec879,_0x455e1a){return _0x3ec879[_0xeb62('0xa')]('ZendeskField',attributes,{'tableName':_0xeb62('0xb'),'paranoid':![],'indexes':[{'name':_0xeb62('0xc'),'fields':[_0xeb62('0xd'),_0xeb62('0xe')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/intZendeskField/intZendeskField.rpc.js b/server/api/intZendeskField/intZendeskField.rpc.js
index e2b6540..76618ad 100644
--- a/server/api/intZendeskField/intZendeskField.rpc.js
+++ b/server/api/intZendeskField/intZendeskField.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x0630=['then','info','ZendeskField,\x20%s,\x20%s','debug','ZendeskField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x2923dd,_0x170399){var _0x2148e7=function(_0x1b410c){while(--_0x1b410c){_0x2923dd['push'](_0x2923dd['shift']());}};_0x2148e7(++_0x170399);}(_0x0630,0xfc));var _0x0063=function(_0x38a716,_0x4eb822){_0x38a716=_0x38a716-0x0;var _0xbb1313=_0x0630[_0x38a716];return _0xbb1313;};'use strict';var _=require('lodash');var util=require(_0x0063('0x0'));var moment=require(_0x0063('0x1'));var BPromise=require('bluebird');var rs=require(_0x0063('0x2'));var fs=require('fs');var Redis=require(_0x0063('0x3'));var db=require(_0x0063('0x4'))['db'];var utils=require(_0x0063('0x5'));var logger=require(_0x0063('0x6'))(_0x0063('0x7'));var config=require(_0x0063('0x8'));var jayson=require(_0x0063('0x9'));var client=jayson[_0x0063('0xa')][_0x0063('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2e1aaf,_0x3cf560,_0x220045){return new BPromise(function(_0x1be753,_0x55539a){return client['request'](_0x2e1aaf,_0x220045)[_0x0063('0xc')](function(_0x2355cf){logger[_0x0063('0xd')](_0x0063('0xe'),_0x3cf560,'request\x20sent');logger[_0x0063('0xf')](_0x0063('0x10'),_0x3cf560,_0x0063('0x11'),JSON[_0x0063('0x12')](_0x2355cf));if(_0x2355cf[_0x0063('0x13')]){if(_0x2355cf['error'][_0x0063('0x14')]===0x1f4){logger[_0x0063('0x13')](_0x0063('0xe'),_0x3cf560,_0x2355cf[_0x0063('0x13')]['message']);return _0x55539a(_0x2355cf['error'][_0x0063('0x15')]);}logger[_0x0063('0x13')]('ZendeskField,\x20%s,\x20%s',_0x3cf560,_0x2355cf[_0x0063('0x13')][_0x0063('0x15')]);return _0x1be753(_0x2355cf[_0x0063('0x13')][_0x0063('0x15')]);}else{logger['info'](_0x0063('0xe'),_0x3cf560,'request\x20sent');_0x1be753(_0x2355cf[_0x0063('0x16')][_0x0063('0x15')]);}})[_0x0063('0x17')](function(_0xe776fc){logger[_0x0063('0x13')](_0x0063('0xe'),_0x3cf560,_0xe776fc);_0x55539a(_0xe776fc);});});}
\ No newline at end of file
+var _0x57d7=['request\x20sent','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','ZendeskField,\x20%s,\x20%s','debug','ZendeskField,\x20%s,\x20%s,\x20%s'];(function(_0xf51415,_0x183a95){var _0x5bb030=function(_0x60f16){while(--_0x60f16){_0xf51415['push'](_0xf51415['shift']());}};_0x5bb030(++_0x183a95);}(_0x57d7,0x10e));var _0x757d=function(_0x1460f6,_0x59051a){_0x1460f6=_0x1460f6-0x0;var _0x46ce94=_0x57d7[_0x1460f6];return _0x46ce94;};'use strict';var _=require(_0x757d('0x0'));var util=require('util');var moment=require(_0x757d('0x1'));var BPromise=require(_0x757d('0x2'));var rs=require(_0x757d('0x3'));var fs=require('fs');var Redis=require(_0x757d('0x4'));var db=require(_0x757d('0x5'))['db'];var utils=require(_0x757d('0x6'));var logger=require(_0x757d('0x7'))(_0x757d('0x8'));var config=require('../../config/environment');var jayson=require(_0x757d('0x9'));var client=jayson[_0x757d('0xa')][_0x757d('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4b0b01,_0x29678c,_0x21cc5e){return new BPromise(function(_0x1eb79e,_0xbf7fa0){return client[_0x757d('0xc')](_0x4b0b01,_0x21cc5e)[_0x757d('0xd')](function(_0x4eaead){logger[_0x757d('0xe')](_0x757d('0xf'),_0x29678c,'request\x20sent');logger[_0x757d('0x10')](_0x757d('0x11'),_0x29678c,_0x757d('0x12'),JSON['stringify'](_0x4eaead));if(_0x4eaead[_0x757d('0x13')]){if(_0x4eaead[_0x757d('0x13')][_0x757d('0x14')]===0x1f4){logger['error'](_0x757d('0xf'),_0x29678c,_0x4eaead[_0x757d('0x13')][_0x757d('0x15')]);return _0xbf7fa0(_0x4eaead[_0x757d('0x13')][_0x757d('0x15')]);}logger[_0x757d('0x13')](_0x757d('0xf'),_0x29678c,_0x4eaead['error']['message']);return _0x1eb79e(_0x4eaead['error'][_0x757d('0x15')]);}else{logger[_0x757d('0xe')]('ZendeskField,\x20%s,\x20%s',_0x29678c,'request\x20sent');_0x1eb79e(_0x4eaead[_0x757d('0x16')][_0x757d('0x15')]);}})[_0x757d('0x17')](function(_0xd999b){logger[_0x757d('0x13')](_0x757d('0xf'),_0x29678c,_0xd999b);_0xbf7fa0(_0xd999b);});});}
\ No newline at end of file
diff --git a/server/api/intZohoAccount/index.js b/server/api/intZohoAccount/index.js
index 9cf5582..98facbc 100644
--- a/server/api/intZohoAccount/index.js
+++ b/server/api/intZohoAccount/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xc6f4=['Router','../../components/auth/service','../../components/interaction/service','isAuthenticated','index','/:id','show','get','/:id/configurations','getConfigurations','/:id/fields','getFields','create','post','addConfiguration','put','update','destroy','exports','multer','util','path','connect-timeout','express'];(function(_0x1eb3cd,_0x4b0d17){var _0x2855dd=function(_0x5f2938){while(--_0x5f2938){_0x1eb3cd['push'](_0x1eb3cd['shift']());}};_0x2855dd(++_0x4b0d17);}(_0xc6f4,0x103));var _0x4c6f=function(_0x9599f2,_0x1647b0){_0x9599f2=_0x9599f2-0x0;var _0x1362c6=_0xc6f4[_0x9599f2];return _0x1362c6;};'use strict';var multer=require(_0x4c6f('0x0'));var util=require(_0x4c6f('0x1'));var path=require(_0x4c6f('0x2'));var timeout=require(_0x4c6f('0x3'));var express=require(_0x4c6f('0x4'));var router=express[_0x4c6f('0x5')]();var auth=require(_0x4c6f('0x6'));var interaction=require(_0x4c6f('0x7'));var config=require('../../config/environment');var controller=require('./intZohoAccount.controller');router['get']('/',auth[_0x4c6f('0x8')](),controller[_0x4c6f('0x9')]);router['get'](_0x4c6f('0xa'),auth[_0x4c6f('0x8')](),controller[_0x4c6f('0xb')]);router[_0x4c6f('0xc')](_0x4c6f('0xd'),auth['isAuthenticated'](),controller[_0x4c6f('0xe')]);router[_0x4c6f('0xc')](_0x4c6f('0xf'),auth[_0x4c6f('0x8')](),controller[_0x4c6f('0x10')]);router['post']('/',auth[_0x4c6f('0x8')](),controller[_0x4c6f('0x11')]);router[_0x4c6f('0x12')](_0x4c6f('0xd'),auth[_0x4c6f('0x8')](),controller[_0x4c6f('0x13')]);router[_0x4c6f('0x14')]('/:id',auth['isAuthenticated'](),controller[_0x4c6f('0x15')]);router['delete'](_0x4c6f('0xa'),auth[_0x4c6f('0x8')](),controller[_0x4c6f('0x16')]);module[_0x4c6f('0x17')]=router;
\ No newline at end of file
+var _0x20b9=['../../components/interaction/service','../../config/environment','isAuthenticated','get','/:id','show','/:id/configurations','getConfigurations','/:id/fields','getFields','create','post','addConfiguration','put','delete','destroy','exports','multer','path','Router'];(function(_0x57ef3b,_0xda18bc){var _0x164722=function(_0x4b66b7){while(--_0x4b66b7){_0x57ef3b['push'](_0x57ef3b['shift']());}};_0x164722(++_0xda18bc);}(_0x20b9,0x1dd));var _0x920b=function(_0x231b94,_0x15d73e){_0x231b94=_0x231b94-0x0;var _0x26f55d=_0x20b9[_0x231b94];return _0x26f55d;};'use strict';var multer=require(_0x920b('0x0'));var util=require('util');var path=require(_0x920b('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x920b('0x2')]();var auth=require('../../components/auth/service');var interaction=require(_0x920b('0x3'));var config=require(_0x920b('0x4'));var controller=require('./intZohoAccount.controller');router['get']('/',auth[_0x920b('0x5')](),controller['index']);router[_0x920b('0x6')](_0x920b('0x7'),auth['isAuthenticated'](),controller[_0x920b('0x8')]);router[_0x920b('0x6')](_0x920b('0x9'),auth[_0x920b('0x5')](),controller[_0x920b('0xa')]);router[_0x920b('0x6')](_0x920b('0xb'),auth['isAuthenticated'](),controller[_0x920b('0xc')]);router['post']('/',auth[_0x920b('0x5')](),controller[_0x920b('0xd')]);router[_0x920b('0xe')](_0x920b('0x9'),auth[_0x920b('0x5')](),controller[_0x920b('0xf')]);router[_0x920b('0x10')](_0x920b('0x7'),auth[_0x920b('0x5')](),controller['update']);router[_0x920b('0x11')](_0x920b('0x7'),auth[_0x920b('0x5')](),controller[_0x920b('0x12')]);module[_0x920b('0x13')]=router;
\ No newline at end of file
diff --git a/server/api/intZohoAccount/intZohoAccount.attributes.js b/server/api/intZohoAccount/intZohoAccount.attributes.js
index 1498c99..135b195 100644
--- a/server/api/intZohoAccount/intZohoAccount.attributes.js
+++ b/server/api/intZohoAccount/intZohoAccount.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x80e6=['STRING','sequelize','exports'];(function(_0x5bcfe3,_0xec17b5){var _0x535d4d=function(_0x19b0bd){while(--_0x19b0bd){_0x5bcfe3['push'](_0x5bcfe3['shift']());}};_0x535d4d(++_0xec17b5);}(_0x80e6,0xdf));var _0x680e=function(_0x1a7ffb,_0x5ebee9){_0x1a7ffb=_0x1a7ffb-0x0;var _0x46b315=_0x80e6[_0x1a7ffb];return _0x46b315;};'use strict';var Sequelize=require(_0x680e('0x0'));module[_0x680e('0x1')]={'name':{'type':Sequelize[_0x680e('0x2')]},'description':{'type':Sequelize[_0x680e('0x2')]},'host':{'type':Sequelize[_0x680e('0x2')]},'zone':{'type':Sequelize[_0x680e('0x2')]},'clientId':{'type':Sequelize[_0x680e('0x2')]},'clientSecret':{'type':Sequelize[_0x680e('0x2')]},'serverUrl':{'type':Sequelize['STRING']},'code':{'type':Sequelize[_0x680e('0x2')]},'refreshToken':{'type':Sequelize[_0x680e('0x2')]}};
\ No newline at end of file
+var _0xacf2=['STRING','exports'];(function(_0x34e2c3,_0x25f042){var _0x5edb4f=function(_0x20fa3e){while(--_0x20fa3e){_0x34e2c3['push'](_0x34e2c3['shift']());}};_0x5edb4f(++_0x25f042);}(_0xacf2,0x1bf));var _0x2acf=function(_0x39e9f4,_0x7da7be){_0x39e9f4=_0x39e9f4-0x0;var _0x16b495=_0xacf2[_0x39e9f4];return _0x16b495;};'use strict';var Sequelize=require('sequelize');module[_0x2acf('0x0')]={'name':{'type':Sequelize[_0x2acf('0x1')]},'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize[_0x2acf('0x1')]},'zone':{'type':Sequelize['STRING']},'clientId':{'type':Sequelize[_0x2acf('0x1')]},'clientSecret':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize[_0x2acf('0x1')]},'code':{'type':Sequelize[_0x2acf('0x1')]},'refreshToken':{'type':Sequelize[_0x2acf('0x1')]}};
\ No newline at end of file
diff --git a/server/api/intZohoAccount/intZohoAccount.controller.js b/server/api/intZohoAccount/intZohoAccount.controller.js
index 39fb716..dd0a759 100644
--- a/server/api/intZohoAccount/intZohoAccount.controller.js
+++ b/server/api/intZohoAccount/intZohoAccount.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x5fc2=['stack','name','map','ZohoAccount','fieldName','type','key','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','count','includeAll','include','findAll','show','rawAttributes','keys','options','find','create','body','params','findOne','ZohoConfiguration','getConfigurations','nolimit','Subjects','getSubjects','channel','Descriptions','getDescriptions','ZohoField','zone','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.eu','https://accounts.zoho.com.cn','POST','/oauth/v2/token','refreshToken','clientId','clientSecret','access_token','getFields','host','serverUrl','zoho.eu','com','slice','substring','lastIndexOf','Refresh\x20Token\x20not\x20available\x20for\x20the\x20account','GET','https://www.zohoapis.%s/crm/v2/settings/fields','Zoho-oauthtoken\x20','response','Owner','Subject','Description','WhoId','Call_Duration','Call_Start_Time','Call_Type','remove','includes','api_name','system_mandatory','push','display_label','data_type','picklist','pick_list_values','statusCode','stringify','send','Wrong\x20credentials','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','../../components/integrations/configuration','jayson/promise','client','http','test','Sequelize','ValidationError','request','ZohoAccount,\x20%s,\x20%s','request\x20sent','debug','ZohoAccount,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','sendStatus','end','status','offset','limit','set','Content-Range','reject','save','then','destroy'];(function(_0x54bbeb,_0x3ad1e0){var _0x54692f=function(_0x3522b2){while(--_0x3522b2){_0x54bbeb['push'](_0x54bbeb['shift']());}};_0x54692f(++_0x3ad1e0);}(_0x5fc2,0x17a));var _0x25fc=function(_0x105e3e,_0x4cb667){_0x105e3e=_0x105e3e-0x0;var _0x5b0125=_0x5fc2[_0x105e3e];return _0x5b0125;};'use strict';var pdf=require(_0x25fc('0x0'));var emlformat=require(_0x25fc('0x1'));var rimraf=require(_0x25fc('0x2'));var zipdir=require(_0x25fc('0x3'));var jsonpatch=require(_0x25fc('0x4'));var rp=require(_0x25fc('0x5'));var moment=require(_0x25fc('0x6'));var BPromise=require(_0x25fc('0x7'));var Mustache=require(_0x25fc('0x8'));var util=require(_0x25fc('0x9'));var path=require('path');var sox=require(_0x25fc('0xa'));var csv=require(_0x25fc('0xb'));var ejs=require(_0x25fc('0xc'));var fs=require('fs');var _=require(_0x25fc('0xd'));var squel=require(_0x25fc('0xe'));var crypto=require(_0x25fc('0xf'));var jsforce=require(_0x25fc('0x10'));var deskjs=require(_0x25fc('0x11'));var toCsv=require('to-csv');var querystring=require(_0x25fc('0x12'));var Papa=require(_0x25fc('0x13'));var Redis=require(_0x25fc('0x14'));var authService=require(_0x25fc('0x15'));var qs=require('../../components/parsers/qs');var as=require(_0x25fc('0x16'));var hardwareService=require(_0x25fc('0x17'));var logger=require(_0x25fc('0x18'))(_0x25fc('0x19'));var utils=require('../../config/utils');var config=require(_0x25fc('0x1a'));var db=require(_0x25fc('0x1b'))['db'];var integrations=require(_0x25fc('0x1c'));var jayson=require(_0x25fc('0x1d'));var client=jayson[_0x25fc('0x1e')][_0x25fc('0x1f')]({'port':0x232a});function checkPasswordPattern(_0x507f89,_0x6b2ee3,_0x5a9463){if(_0x5a9463){var _0x16d940=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x16d940[_0x25fc('0x20')](_0x6b2ee3)){return _0x507f89;}else{throw new db[(_0x25fc('0x21'))][(_0x25fc('0x22'))]('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x507f89;}}function respondWithRpcPromise(_0x2c9dff,_0x3949ad,_0x4d6b3d,_0x236469){return new BPromise(function(_0x3ddc1c,_0x33d1bd){var _0x1a0272=_0x236469||client;return _0x1a0272[_0x25fc('0x23')](_0x2c9dff,_0x4d6b3d)['then'](function(_0x23c9a7){logger['info'](_0x25fc('0x24'),_0x3949ad,_0x25fc('0x25'));logger[_0x25fc('0x26')](_0x25fc('0x27'),_0x3949ad,_0x25fc('0x25'),JSON['stringify'](_0x23c9a7));if(_0x23c9a7['error']){if(_0x23c9a7[_0x25fc('0x28')][_0x25fc('0x29')]===0x1f4){logger[_0x25fc('0x28')](_0x25fc('0x24'),_0x3949ad,_0x23c9a7[_0x25fc('0x28')][_0x25fc('0x2a')]);return _0x33d1bd(_0x23c9a7['error'][_0x25fc('0x2a')]);}logger['error'](_0x25fc('0x24'),_0x3949ad,_0x23c9a7[_0x25fc('0x28')][_0x25fc('0x2a')]);return _0x3ddc1c(_0x23c9a7[_0x25fc('0x28')]['message']);}else{logger[_0x25fc('0x2b')](_0x25fc('0x24'),_0x3949ad,_0x25fc('0x25'));_0x3ddc1c(_0x23c9a7[_0x25fc('0x2c')][_0x25fc('0x2a')]);}})[_0x25fc('0x2d')](function(_0x1e710e){logger[_0x25fc('0x28')]('ZohoAccount,\x20%s,\x20%s',_0x3949ad,_0x1e710e);_0x33d1bd(_0x1e710e);});});}function respondWithStatusCode(_0xfe2647,_0xe011f1){_0xe011f1=_0xe011f1||0xcc;return function(_0xb13ca){if(_0xb13ca){return _0xfe2647[_0x25fc('0x2e')](_0xe011f1);}return _0xfe2647['status'](_0xe011f1)[_0x25fc('0x2f')]();};}function respondWithResult(_0x13992e,_0x51c3f3){_0x51c3f3=_0x51c3f3||0xc8;return function(_0x46b0f4){if(_0x46b0f4){return _0x13992e[_0x25fc('0x30')](_0x51c3f3)['json'](_0x46b0f4);}};}function respondWithFilteredResult(_0x15d8e2,_0x46e3bd){return function(_0x138037){if(_0x138037){var _0x2eb1b8=_0x138037['count'],_0x5d0495=_0x46e3bd['offset'],_0x3147c0=_0x46e3bd[_0x25fc('0x31')]+_0x46e3bd[_0x25fc('0x32')],_0x2d262a;if(_0x3147c0>=_0x2eb1b8){_0x3147c0=_0x2eb1b8;_0x2d262a=0xc8;}else{_0x2d262a=0xce;}_0x15d8e2[_0x25fc('0x30')](_0x2d262a);return _0x15d8e2[_0x25fc('0x33')](_0x25fc('0x34'),_0x5d0495+'-'+_0x3147c0+'/'+_0x2eb1b8)['json'](_0x138037);}return null;};}function patchUpdates(_0x30553a){return function(_0x125457){try{jsonpatch['apply'](_0x125457,_0x30553a,!![]);}catch(_0x4764a5){return BPromise[_0x25fc('0x35')](_0x4764a5);}return _0x125457[_0x25fc('0x36')]();};}function saveUpdates(_0x859233,_0x24d68b){return function(_0x73f024){if(_0x73f024){return _0x73f024['update'](_0x859233)[_0x25fc('0x37')](function(_0x27e179){return _0x27e179;});}return null;};}function removeEntity(_0x414363,_0x5846e6){return function(_0x35f132){if(_0x35f132){return _0x35f132[_0x25fc('0x38')]()[_0x25fc('0x37')](function(){_0x414363['status'](0xcc)[_0x25fc('0x2f')]();});}};}function handleEntityNotFound(_0x5cfb26,_0x33720a){return function(_0x6c6717){if(!_0x6c6717){_0x5cfb26['sendStatus'](0x194);}return _0x6c6717;};}function handleError(_0x423ffb,_0x326872){_0x326872=_0x326872||0x1f4;return function(_0x328e23){logger['error'](_0x328e23[_0x25fc('0x39')]);if(_0x328e23[_0x25fc('0x3a')]){delete _0x328e23['name'];}_0x423ffb[_0x25fc('0x30')](_0x326872)['send'](_0x328e23);};}exports['index']=function(_0x3372f0,_0x201031){var _0x5f3dff={},_0x14f8de={},_0x23004d={'count':0x0,'rows':[]};var _0x31d9e7=_[_0x25fc('0x3b')](db[_0x25fc('0x3c')]['rawAttributes'],function(_0xef3755){return{'name':_0xef3755[_0x25fc('0x3d')],'type':_0xef3755[_0x25fc('0x3e')][_0x25fc('0x3f')]};});_0x14f8de['model']=_[_0x25fc('0x3b')](_0x31d9e7,_0x25fc('0x3a'));_0x14f8de[_0x25fc('0x40')]=_['keys'](_0x3372f0[_0x25fc('0x40')]);_0x14f8de[_0x25fc('0x41')]=_[_0x25fc('0x42')](_0x14f8de[_0x25fc('0x43')],_0x14f8de[_0x25fc('0x40')]);_0x5f3dff[_0x25fc('0x44')]=_[_0x25fc('0x42')](_0x14f8de[_0x25fc('0x43')],qs['fields'](_0x3372f0['query'][_0x25fc('0x45')]));_0x5f3dff['attributes']=_0x5f3dff[_0x25fc('0x44')][_0x25fc('0x46')]?_0x5f3dff[_0x25fc('0x44')]:_0x14f8de[_0x25fc('0x43')];if(!_0x3372f0[_0x25fc('0x40')][_0x25fc('0x47')]('nolimit')){_0x5f3dff['limit']=qs[_0x25fc('0x32')](_0x3372f0['query'][_0x25fc('0x32')]);_0x5f3dff[_0x25fc('0x31')]=qs[_0x25fc('0x31')](_0x3372f0[_0x25fc('0x40')][_0x25fc('0x31')]);}_0x5f3dff[_0x25fc('0x48')]=qs[_0x25fc('0x49')](_0x3372f0[_0x25fc('0x40')][_0x25fc('0x49')]);_0x5f3dff[_0x25fc('0x4a')]=qs[_0x25fc('0x41')](_[_0x25fc('0x4b')](_0x3372f0[_0x25fc('0x40')],_0x14f8de[_0x25fc('0x41')]),_0x31d9e7);if(_0x3372f0['query'][_0x25fc('0x4c')]){_0x5f3dff[_0x25fc('0x4a')]=_[_0x25fc('0x4d')](_0x5f3dff['where'],{'$or':_[_0x25fc('0x3b')](_0x31d9e7,function(_0x4376c1){if(_0x4376c1[_0x25fc('0x3e')]!==_0x25fc('0x4e')){var _0x43bcf9={};_0x43bcf9[_0x4376c1[_0x25fc('0x3a')]]={'$like':'%'+_0x3372f0['query'][_0x25fc('0x4c')]+'%'};return _0x43bcf9;}})});}_0x5f3dff=_[_0x25fc('0x4d')]({},_0x5f3dff,_0x3372f0['options']);var _0x380350={'where':_0x5f3dff[_0x25fc('0x4a')]};return db[_0x25fc('0x3c')][_0x25fc('0x4f')](_0x380350)[_0x25fc('0x37')](function(_0x14c544){_0x23004d[_0x25fc('0x4f')]=_0x14c544;if(_0x3372f0[_0x25fc('0x40')][_0x25fc('0x50')]){_0x5f3dff[_0x25fc('0x51')]=[{'all':!![]}];}return db['ZohoAccount'][_0x25fc('0x52')](_0x5f3dff);})[_0x25fc('0x37')](function(_0x47de7e){_0x23004d['rows']=_0x47de7e;return _0x23004d;})[_0x25fc('0x37')](respondWithFilteredResult(_0x201031,_0x5f3dff))[_0x25fc('0x2d')](handleError(_0x201031,null));};exports[_0x25fc('0x53')]=function(_0x330152,_0x33c5a4){var _0x498529={'raw':![],'where':{'id':_0x330152['params']['id']}},_0xa538b7={};_0xa538b7[_0x25fc('0x43')]=_['keys'](db['ZohoAccount'][_0x25fc('0x54')]);_0xa538b7['query']=_[_0x25fc('0x55')](_0x330152['query']);_0xa538b7[_0x25fc('0x41')]=_[_0x25fc('0x42')](_0xa538b7[_0x25fc('0x43')],_0xa538b7[_0x25fc('0x40')]);_0x498529[_0x25fc('0x44')]=_[_0x25fc('0x42')](_0xa538b7['model'],qs[_0x25fc('0x45')](_0x330152[_0x25fc('0x40')][_0x25fc('0x45')]));_0x498529[_0x25fc('0x44')]=_0x498529[_0x25fc('0x44')][_0x25fc('0x46')]?_0x498529[_0x25fc('0x44')]:_0xa538b7[_0x25fc('0x43')];if(_0x330152[_0x25fc('0x40')][_0x25fc('0x50')]){_0x498529[_0x25fc('0x51')]=[{'all':!![]}];}_0x498529=_[_0x25fc('0x4d')]({},_0x498529,_0x330152[_0x25fc('0x56')]);return db[_0x25fc('0x3c')][_0x25fc('0x57')](_0x498529)[_0x25fc('0x37')](handleEntityNotFound(_0x33c5a4,null))[_0x25fc('0x37')](respondWithResult(_0x33c5a4,null))[_0x25fc('0x2d')](handleError(_0x33c5a4,null));};exports[_0x25fc('0x58')]=function(_0x41f6d5,_0x4de4a5){return db[_0x25fc('0x3c')]['create'](_0x41f6d5[_0x25fc('0x59')],{})[_0x25fc('0x37')](respondWithResult(_0x4de4a5,0xc9))[_0x25fc('0x2d')](handleError(_0x4de4a5,null));};exports['update']=function(_0x24f650,_0x2d15e7){if(_0x24f650[_0x25fc('0x59')]['id']){delete _0x24f650['body']['id'];}return db[_0x25fc('0x3c')][_0x25fc('0x57')]({'where':{'id':_0x24f650['params']['id']}})[_0x25fc('0x37')](handleEntityNotFound(_0x2d15e7,null))[_0x25fc('0x37')](saveUpdates(_0x24f650[_0x25fc('0x59')],null))['then'](respondWithResult(_0x2d15e7,null))[_0x25fc('0x2d')](handleError(_0x2d15e7,null));};exports['destroy']=function(_0x4e985c,_0x4d08b9){return db['ZohoAccount']['find']({'where':{'id':_0x4e985c[_0x25fc('0x5a')]['id']}})[_0x25fc('0x37')](handleEntityNotFound(_0x4d08b9,null))[_0x25fc('0x37')](removeEntity(_0x4d08b9,null))[_0x25fc('0x2d')](handleError(_0x4d08b9,null));};exports['getConfigurations']=function(_0x50be45,_0x4c682b,_0x4ea99e){var _0x52cf66={};var _0x178b3f={};var _0x89db05;var _0x27783a;return db[_0x25fc('0x3c')][_0x25fc('0x5b')]({'where':{'id':_0x50be45[_0x25fc('0x5a')]['id']}})[_0x25fc('0x37')](handleEntityNotFound(_0x4c682b,null))[_0x25fc('0x37')](function(_0x245152){if(_0x245152){_0x89db05=_0x245152;_0x178b3f['model']=_[_0x25fc('0x55')](db[_0x25fc('0x5c')]['rawAttributes']);_0x178b3f[_0x25fc('0x40')]=_['keys'](_0x50be45[_0x25fc('0x40')]);_0x178b3f[_0x25fc('0x41')]=_['intersection'](_0x178b3f[_0x25fc('0x43')],_0x178b3f[_0x25fc('0x40')]);_0x52cf66['attributes']=_[_0x25fc('0x42')](_0x178b3f[_0x25fc('0x43')],qs['fields'](_0x50be45[_0x25fc('0x40')][_0x25fc('0x45')]));_0x52cf66[_0x25fc('0x44')]=_0x52cf66[_0x25fc('0x44')][_0x25fc('0x46')]?_0x52cf66['attributes']:_0x178b3f[_0x25fc('0x43')];_0x52cf66['order']=qs[_0x25fc('0x49')](_0x50be45[_0x25fc('0x40')][_0x25fc('0x49')]);_0x52cf66['where']=qs[_0x25fc('0x41')](_[_0x25fc('0x4b')](_0x50be45['query'],_0x178b3f[_0x25fc('0x41')]));if(_0x50be45['query']['filter']){_0x52cf66[_0x25fc('0x4a')]=_[_0x25fc('0x4d')](_0x52cf66['where'],{'$or':_[_0x25fc('0x3b')](_0x52cf66[_0x25fc('0x44')],function(_0x1caa8f){var _0x6a7838={};_0x6a7838[_0x1caa8f]={'$like':'%'+_0x50be45[_0x25fc('0x40')][_0x25fc('0x4c')]+'%'};return _0x6a7838;})});}_0x52cf66=_[_0x25fc('0x4d')]({},_0x52cf66,_0x50be45[_0x25fc('0x56')]);return _0x89db05[_0x25fc('0x5d')](_0x52cf66);}})[_0x25fc('0x37')](function(_0x3bf3f1){if(_0x3bf3f1){_0x27783a=_0x3bf3f1[_0x25fc('0x46')];if(!_0x50be45['query'][_0x25fc('0x47')](_0x25fc('0x5e'))){_0x52cf66[_0x25fc('0x32')]=qs[_0x25fc('0x32')](_0x50be45[_0x25fc('0x40')][_0x25fc('0x32')]);_0x52cf66['offset']=qs[_0x25fc('0x31')](_0x50be45[_0x25fc('0x40')][_0x25fc('0x31')]);}return _0x89db05['getConfigurations'](_0x52cf66);}})[_0x25fc('0x37')](function(_0x44fcc1){if(_0x44fcc1){return _0x44fcc1?{'count':_0x27783a,'rows':_0x44fcc1}:null;}})[_0x25fc('0x37')](respondWithResult(_0x4c682b,null))[_0x25fc('0x2d')](handleError(_0x4c682b,null));};exports['addConfiguration']=function(_0x153311,_0x27c8e1,_0x45b58f){if(_0x153311['body']['id']){delete _0x153311[_0x25fc('0x59')]['id'];}return db['ZohoAccount']['findOne']({'where':{'id':_0x153311[_0x25fc('0x5a')]['id']}})[_0x25fc('0x37')](handleEntityNotFound(_0x27c8e1,null))[_0x25fc('0x37')](function(_0x278787){if(_0x278787){_0x153311[_0x25fc('0x59')]['AccountId']=_0x278787['id'];_0x153311[_0x25fc('0x59')][_0x25fc('0x5f')]=integrations[_0x25fc('0x60')](_0x153311[_0x25fc('0x59')][_0x25fc('0x61')],_0x153311[_0x25fc('0x59')][_0x25fc('0x3e')]);_0x153311[_0x25fc('0x59')][_0x25fc('0x62')]=integrations[_0x25fc('0x63')](_0x153311[_0x25fc('0x59')][_0x25fc('0x61')],_0x153311[_0x25fc('0x59')][_0x25fc('0x3e')]);return db['ZohoConfiguration']['create'](_0x153311['body'],{'include':[{'model':db[_0x25fc('0x64')],'as':_0x25fc('0x5f')},{'model':db[_0x25fc('0x64')],'as':_0x25fc('0x62')}]});}return null;})[_0x25fc('0x37')](respondWithResult(_0x27c8e1,null))[_0x25fc('0x2d')](handleError(_0x27c8e1,null));};function getAccessToken(_0x32b807){return new Promise(function(_0x4886c9,_0x215f58){var _0x1d5f38;switch(_0x32b807[_0x25fc('0x65')]){case'US':_0x1d5f38=_0x25fc('0x66');break;case'AU':_0x1d5f38=_0x25fc('0x67');break;case'EU':_0x1d5f38=_0x25fc('0x68');break;case'IN':_0x1d5f38='https://accounts.zoho.in';break;case'CN':_0x1d5f38=_0x25fc('0x69');break;default:_0x1d5f38='https://accounts.zoho.eu';break;}var _0x3df2cb={'method':_0x25fc('0x6a'),'uri':_0x1d5f38+_0x25fc('0x6b'),'qs':{'refresh_token':_0x32b807[_0x25fc('0x6c')],'client_id':_0x32b807[_0x25fc('0x6d')],'client_secret':_0x32b807[_0x25fc('0x6e')],'grant_type':'refresh_token'},'json':!![]};return rp(_0x3df2cb)[_0x25fc('0x37')](function(_0x3312f7){if(_0x3312f7[_0x25fc('0x6f')]){_0x4886c9(_0x3312f7[_0x25fc('0x6f')]);}else{_0x215f58('Unable\x20to\x20retrieve\x20the\x20access\x20token');}})[_0x25fc('0x2d')](function(_0x58dbb0){_0x215f58(_0x58dbb0);});});}exports[_0x25fc('0x70')]=function(_0x555808,_0x20d7b5,_0x111f2f){var _0x1e3677,_0x5d49d2,_0x3cf6dd,_0x25b77f,_0x249ce2;return db[_0x25fc('0x3c')][_0x25fc('0x5b')]({'where':{'id':_0x555808[_0x25fc('0x5a')]['id']},'attributes':['id',_0x25fc('0x71'),_0x25fc('0x65'),_0x25fc('0x6d'),_0x25fc('0x6e'),_0x25fc('0x72'),'code',_0x25fc('0x6c')]})[_0x25fc('0x37')](handleEntityNotFound(_0x20d7b5,null))[_0x25fc('0x37')](function(_0x442204){_0x249ce2=_0x442204;_0x1e3677=_0x249ce2[_0x25fc('0x71')];_0x5d49d2=_0x1e3677===_0x25fc('0x73')?'eu':_0x25fc('0x74');_0x3cf6dd=_0x249ce2[_0x25fc('0x72')];var _0x5071f1=_0x3cf6dd[_0x25fc('0x75')](-0x1);if(_0x5071f1==='/'||_0x5071f1==='\x5c'||_0x5071f1===':'){_0x3cf6dd=_0x3cf6dd[_0x25fc('0x76')](0x0,_0x3cf6dd[_0x25fc('0x77')](_0x5071f1));}if(!_0x249ce2[_0x25fc('0x6c')]){throw new Error(_0x25fc('0x78'));}return getAccessToken(_0x249ce2);})['then'](function(_0x548576){if(_0x548576){return rp({'method':_0x25fc('0x79'),'uri':util['format'](_0x25fc('0x7a'),_0x5d49d2),'qs':{'module':'Calls'},'headers':{'Authorization':_0x25fc('0x7b')+_0x548576},'json':!![]});}})[_0x25fc('0x37')](function(_0xb0380){if(_0xb0380){if(_0xb0380[_0x25fc('0x7c')]&&_0xb0380['response'][_0x25fc('0x28')]){throw new Error(_0xb0380[_0x25fc('0x7c')][_0x25fc('0x28')][_0x25fc('0x2a')]);}var _0x59e6ad=[];var _0x4836ef=[];var _0x1a50fb=[_0x25fc('0x7d'),_0x25fc('0x7e'),_0x25fc('0x7f'),_0x25fc('0x80'),_0x25fc('0x81'),'Call_Result',_0x25fc('0x82'),_0x25fc('0x83')];_0x4836ef=_[_0x25fc('0x84')](_0xb0380[_0x25fc('0x45')],function(_0x427d11){return _0x1a50fb[_0x25fc('0x85')](_0x427d11[_0x25fc('0x86')]);});for(var _0x3e1b6c=0x0;_0x3e1b6c<_0x4836ef['length'];_0x3e1b6c++){if(_0x4836ef[_0x3e1b6c][_0x25fc('0x87')]===![]){_0x59e6ad[_0x25fc('0x88')]({'id':_0x4836ef[_0x3e1b6c]['id'],'name':_0x4836ef[_0x3e1b6c][_0x25fc('0x89')],'custom':_0x4836ef[_0x3e1b6c]['custom_field'],'options':_0x4836ef[_0x3e1b6c][_0x25fc('0x8a')]===_0x25fc('0x8b')&&_0x4836ef[_0x3e1b6c][_0x25fc('0x8c')][_0x25fc('0x46')]>-0x1?_[_0x25fc('0x3b')](_0x4836ef[_0x3e1b6c][_0x25fc('0x8c')],function(_0x44f018){return{'name':_0x44f018,'value':_0x44f018};}):[]});}}return{'count':_0x59e6ad[_0x25fc('0x46')],'rows':_0x59e6ad};}else{return{'count':0x0,'rows':[]};}})[_0x25fc('0x37')](respondWithResult(_0x20d7b5,null))[_0x25fc('0x2d')](function(_0x385874){var _0x89d048=_0x555808[_0x25fc('0x40')][_0x25fc('0x20')]?0x1f4:_0x385874[_0x25fc('0x8d')]||0x1f4;logger[_0x25fc('0x28')]('getFields,\x20%s,\x20%s,\x20%s','getFields',_0x89d048,JSON[_0x25fc('0x8e')](_0x385874));delete _0x385874['name'];if(_0x89d048===0x191){_0x89d048=0x190;}_0x20d7b5[_0x25fc('0x30')](_0x89d048)[_0x25fc('0x8f')](_0x555808['query']['test']?{'message':_0x25fc('0x90'),'statusCode':_0x385874[_0x25fc('0x8d')]}:_0x385874);});};
\ No newline at end of file
+var _0x6657=['AccountId','Subjects','getSubjects','getDescriptions','channel','ZohoConfiguration','ZohoField','Descriptions','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.com.cn','https://accounts.zoho.eu','POST','/oauth/v2/token','refreshToken','clientId','clientSecret','refresh_token','access_token','Unable\x20to\x20retrieve\x20the\x20access\x20token','serverUrl','zoho.eu','com','slice','substring','lastIndexOf','Refresh\x20Token\x20not\x20available\x20for\x20the\x20account','GET','format','https://www.zohoapis.%s/crm/v2/settings/fields','Calls','Zoho-oauthtoken\x20','response','Subject','WhoId','Call_Duration','Call_Result','Call_Type','remove','includes','system_mandatory','push','custom_field','data_type','picklist','pick_list_values','statusCode','getFields,\x20%s,\x20%s,\x20%s','getFields','Wrong\x20credentials','eml-format','zip-dir','moment','bluebird','mustache','util','path','ejs','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','jayson/promise','client','http','test','Sequelize','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','ZohoAccount,\x20%s,\x20%s','debug','ZohoAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','sendStatus','status','json','count','offset','set','Content-Range','reject','save','update','destroy','end','stack','name','send','index','map','ZohoAccount','fieldName','type','key','model','query','keys','filters','intersection','attributes','length','limit','order','sort','filter','merge','where','VIRTUAL','options','includeAll','include','findAll','rows','show','params','rawAttributes','fields','find','create','body','getConfigurations','findOne','pick','hasOwnProperty','nolimit','addConfiguration'];(function(_0x12dc7f,_0x4ab039){var _0x23b396=function(_0x3e6e94){while(--_0x3e6e94){_0x12dc7f['push'](_0x12dc7f['shift']());}};_0x23b396(++_0x4ab039);}(_0x6657,0x152));var _0x7665=function(_0x50c9af,_0x414a5b){_0x50c9af=_0x50c9af-0x0;var _0x3c82c2=_0x6657[_0x50c9af];return _0x3c82c2;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x7665('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x7665('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x7665('0x2'));var BPromise=require(_0x7665('0x3'));var Mustache=require(_0x7665('0x4'));var util=require(_0x7665('0x5'));var path=require(_0x7665('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x7665('0x7'));var fs=require('fs');var _=require(_0x7665('0x8'));var squel=require(_0x7665('0x9'));var crypto=require(_0x7665('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x7665('0xb'));var toCsv=require(_0x7665('0xc'));var querystring=require(_0x7665('0xd'));var Papa=require(_0x7665('0xe'));var Redis=require(_0x7665('0xf'));var authService=require(_0x7665('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7665('0x11'));var logger=require(_0x7665('0x12'))('api');var utils=require(_0x7665('0x13'));var config=require(_0x7665('0x14'));var db=require(_0x7665('0x15'))['db'];var integrations=require(_0x7665('0x16'));var jayson=require(_0x7665('0x17'));var client=jayson[_0x7665('0x18')][_0x7665('0x19')]({'port':0x232a});function checkPasswordPattern(_0x362ce9,_0x3d019,_0x5cf406){if(_0x5cf406){var _0x4e31bc=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x4e31bc[_0x7665('0x1a')](_0x3d019)){return _0x362ce9;}else{throw new db[(_0x7665('0x1b'))]['ValidationError'](_0x7665('0x1c'));}}else{return _0x362ce9;}}function respondWithRpcPromise(_0x3111f0,_0x187520,_0x205170,_0x2bdfbc){return new BPromise(function(_0x48a8e7,_0xc69288){var _0x4943ec=_0x2bdfbc||client;return _0x4943ec[_0x7665('0x1d')](_0x3111f0,_0x205170)[_0x7665('0x1e')](function(_0x5c186a){logger[_0x7665('0x1f')](_0x7665('0x20'),_0x187520,'request\x20sent');logger[_0x7665('0x21')](_0x7665('0x22'),_0x187520,_0x7665('0x23'),JSON[_0x7665('0x24')](_0x5c186a));if(_0x5c186a[_0x7665('0x25')]){if(_0x5c186a[_0x7665('0x25')]['code']===0x1f4){logger[_0x7665('0x25')](_0x7665('0x20'),_0x187520,_0x5c186a[_0x7665('0x25')][_0x7665('0x26')]);return _0xc69288(_0x5c186a[_0x7665('0x25')][_0x7665('0x26')]);}logger[_0x7665('0x25')](_0x7665('0x20'),_0x187520,_0x5c186a['error'][_0x7665('0x26')]);return _0x48a8e7(_0x5c186a['error'][_0x7665('0x26')]);}else{logger[_0x7665('0x1f')](_0x7665('0x20'),_0x187520,_0x7665('0x23'));_0x48a8e7(_0x5c186a[_0x7665('0x27')][_0x7665('0x26')]);}})[_0x7665('0x28')](function(_0x5ac275){logger[_0x7665('0x25')](_0x7665('0x20'),_0x187520,_0x5ac275);_0xc69288(_0x5ac275);});});}function respondWithStatusCode(_0x15d0ba,_0x283de3){_0x283de3=_0x283de3||0xcc;return function(_0x534eb3){if(_0x534eb3){return _0x15d0ba[_0x7665('0x29')](_0x283de3);}return _0x15d0ba[_0x7665('0x2a')](_0x283de3)['end']();};}function respondWithResult(_0x4a4bf3,_0x3db534){_0x3db534=_0x3db534||0xc8;return function(_0x4be3a0){if(_0x4be3a0){return _0x4a4bf3['status'](_0x3db534)[_0x7665('0x2b')](_0x4be3a0);}};}function respondWithFilteredResult(_0x4c2eb6,_0x218cad){return function(_0x525674){if(_0x525674){var _0x28cad9=_0x525674[_0x7665('0x2c')],_0x55b396=_0x218cad['offset'],_0x507a98=_0x218cad[_0x7665('0x2d')]+_0x218cad['limit'],_0x419df7;if(_0x507a98>=_0x28cad9){_0x507a98=_0x28cad9;_0x419df7=0xc8;}else{_0x419df7=0xce;}_0x4c2eb6['status'](_0x419df7);return _0x4c2eb6[_0x7665('0x2e')](_0x7665('0x2f'),_0x55b396+'-'+_0x507a98+'/'+_0x28cad9)[_0x7665('0x2b')](_0x525674);}return null;};}function patchUpdates(_0x4c2680){return function(_0x148d6a){try{jsonpatch['apply'](_0x148d6a,_0x4c2680,!![]);}catch(_0x6fa162){return BPromise[_0x7665('0x30')](_0x6fa162);}return _0x148d6a[_0x7665('0x31')]();};}function saveUpdates(_0x324235,_0x341ea3){return function(_0x144271){if(_0x144271){return _0x144271[_0x7665('0x32')](_0x324235)[_0x7665('0x1e')](function(_0x56c5ba){return _0x56c5ba;});}return null;};}function removeEntity(_0x2fc5ae,_0x322bd6){return function(_0x5066b8){if(_0x5066b8){return _0x5066b8[_0x7665('0x33')]()[_0x7665('0x1e')](function(){_0x2fc5ae['status'](0xcc)[_0x7665('0x34')]();});}};}function handleEntityNotFound(_0x4c5bf1,_0x3e95f5){return function(_0x19c214){if(!_0x19c214){_0x4c5bf1[_0x7665('0x29')](0x194);}return _0x19c214;};}function handleError(_0x58e400,_0x5c2376){_0x5c2376=_0x5c2376||0x1f4;return function(_0xd25836){logger[_0x7665('0x25')](_0xd25836[_0x7665('0x35')]);if(_0xd25836[_0x7665('0x36')]){delete _0xd25836[_0x7665('0x36')];}_0x58e400[_0x7665('0x2a')](_0x5c2376)[_0x7665('0x37')](_0xd25836);};}exports[_0x7665('0x38')]=function(_0x1f9253,_0x4de72b){var _0x2f87ad={},_0x18b937={},_0x2d6f3d={'count':0x0,'rows':[]};var _0x3633e4=_[_0x7665('0x39')](db[_0x7665('0x3a')]['rawAttributes'],function(_0xb7a459){return{'name':_0xb7a459[_0x7665('0x3b')],'type':_0xb7a459[_0x7665('0x3c')][_0x7665('0x3d')]};});_0x18b937[_0x7665('0x3e')]=_['map'](_0x3633e4,_0x7665('0x36'));_0x18b937[_0x7665('0x3f')]=_[_0x7665('0x40')](_0x1f9253[_0x7665('0x3f')]);_0x18b937[_0x7665('0x41')]=_[_0x7665('0x42')](_0x18b937[_0x7665('0x3e')],_0x18b937[_0x7665('0x3f')]);_0x2f87ad[_0x7665('0x43')]=_[_0x7665('0x42')](_0x18b937[_0x7665('0x3e')],qs['fields'](_0x1f9253[_0x7665('0x3f')]['fields']));_0x2f87ad[_0x7665('0x43')]=_0x2f87ad[_0x7665('0x43')][_0x7665('0x44')]?_0x2f87ad[_0x7665('0x43')]:_0x18b937['model'];if(!_0x1f9253[_0x7665('0x3f')]['hasOwnProperty']('nolimit')){_0x2f87ad[_0x7665('0x45')]=qs[_0x7665('0x45')](_0x1f9253['query'][_0x7665('0x45')]);_0x2f87ad[_0x7665('0x2d')]=qs['offset'](_0x1f9253[_0x7665('0x3f')][_0x7665('0x2d')]);}_0x2f87ad[_0x7665('0x46')]=qs[_0x7665('0x47')](_0x1f9253[_0x7665('0x3f')][_0x7665('0x47')]);_0x2f87ad['where']=qs['filters'](_['pick'](_0x1f9253['query'],_0x18b937[_0x7665('0x41')]),_0x3633e4);if(_0x1f9253[_0x7665('0x3f')][_0x7665('0x48')]){_0x2f87ad['where']=_[_0x7665('0x49')](_0x2f87ad[_0x7665('0x4a')],{'$or':_['map'](_0x3633e4,function(_0x32f506){if(_0x32f506[_0x7665('0x3c')]!==_0x7665('0x4b')){var _0x4dd3c9={};_0x4dd3c9[_0x32f506[_0x7665('0x36')]]={'$like':'%'+_0x1f9253[_0x7665('0x3f')]['filter']+'%'};return _0x4dd3c9;}})});}_0x2f87ad=_[_0x7665('0x49')]({},_0x2f87ad,_0x1f9253[_0x7665('0x4c')]);var _0x1eac1e={'where':_0x2f87ad[_0x7665('0x4a')]};return db['ZohoAccount'][_0x7665('0x2c')](_0x1eac1e)[_0x7665('0x1e')](function(_0x320162){_0x2d6f3d[_0x7665('0x2c')]=_0x320162;if(_0x1f9253['query'][_0x7665('0x4d')]){_0x2f87ad[_0x7665('0x4e')]=[{'all':!![]}];}return db[_0x7665('0x3a')][_0x7665('0x4f')](_0x2f87ad);})[_0x7665('0x1e')](function(_0x4040e3){_0x2d6f3d[_0x7665('0x50')]=_0x4040e3;return _0x2d6f3d;})[_0x7665('0x1e')](respondWithFilteredResult(_0x4de72b,_0x2f87ad))[_0x7665('0x28')](handleError(_0x4de72b,null));};exports[_0x7665('0x51')]=function(_0x2322ac,_0x3d632c){var _0x245c26={'raw':![],'where':{'id':_0x2322ac[_0x7665('0x52')]['id']}},_0x290da8={};_0x290da8['model']=_[_0x7665('0x40')](db[_0x7665('0x3a')][_0x7665('0x53')]);_0x290da8[_0x7665('0x3f')]=_['keys'](_0x2322ac[_0x7665('0x3f')]);_0x290da8['filters']=_[_0x7665('0x42')](_0x290da8[_0x7665('0x3e')],_0x290da8[_0x7665('0x3f')]);_0x245c26[_0x7665('0x43')]=_[_0x7665('0x42')](_0x290da8[_0x7665('0x3e')],qs[_0x7665('0x54')](_0x2322ac[_0x7665('0x3f')][_0x7665('0x54')]));_0x245c26['attributes']=_0x245c26[_0x7665('0x43')]['length']?_0x245c26[_0x7665('0x43')]:_0x290da8[_0x7665('0x3e')];if(_0x2322ac[_0x7665('0x3f')]['includeAll']){_0x245c26[_0x7665('0x4e')]=[{'all':!![]}];}_0x245c26=_[_0x7665('0x49')]({},_0x245c26,_0x2322ac['options']);return db[_0x7665('0x3a')][_0x7665('0x55')](_0x245c26)[_0x7665('0x1e')](handleEntityNotFound(_0x3d632c,null))['then'](respondWithResult(_0x3d632c,null))[_0x7665('0x28')](handleError(_0x3d632c,null));};exports['create']=function(_0x505976,_0xbc8626){return db[_0x7665('0x3a')][_0x7665('0x56')](_0x505976[_0x7665('0x57')],{})[_0x7665('0x1e')](respondWithResult(_0xbc8626,0xc9))[_0x7665('0x28')](handleError(_0xbc8626,null));};exports['update']=function(_0x5e7357,_0x2c275e){if(_0x5e7357['body']['id']){delete _0x5e7357[_0x7665('0x57')]['id'];}return db[_0x7665('0x3a')]['find']({'where':{'id':_0x5e7357[_0x7665('0x52')]['id']}})[_0x7665('0x1e')](handleEntityNotFound(_0x2c275e,null))[_0x7665('0x1e')](saveUpdates(_0x5e7357['body'],null))[_0x7665('0x1e')](respondWithResult(_0x2c275e,null))[_0x7665('0x28')](handleError(_0x2c275e,null));};exports[_0x7665('0x33')]=function(_0x6974cb,_0x403445){return db[_0x7665('0x3a')][_0x7665('0x55')]({'where':{'id':_0x6974cb[_0x7665('0x52')]['id']}})['then'](handleEntityNotFound(_0x403445,null))[_0x7665('0x1e')](removeEntity(_0x403445,null))['catch'](handleError(_0x403445,null));};exports[_0x7665('0x58')]=function(_0x200377,_0x4bd77c,_0x4f78f6){var _0x5249ca={};var _0x4b9ada={};var _0x195729;var _0x2cacc8;return db[_0x7665('0x3a')][_0x7665('0x59')]({'where':{'id':_0x200377['params']['id']}})[_0x7665('0x1e')](handleEntityNotFound(_0x4bd77c,null))['then'](function(_0x264d68){if(_0x264d68){_0x195729=_0x264d68;_0x4b9ada[_0x7665('0x3e')]=_['keys'](db['ZohoConfiguration'][_0x7665('0x53')]);_0x4b9ada[_0x7665('0x3f')]=_[_0x7665('0x40')](_0x200377['query']);_0x4b9ada[_0x7665('0x41')]=_[_0x7665('0x42')](_0x4b9ada[_0x7665('0x3e')],_0x4b9ada[_0x7665('0x3f')]);_0x5249ca[_0x7665('0x43')]=_[_0x7665('0x42')](_0x4b9ada[_0x7665('0x3e')],qs[_0x7665('0x54')](_0x200377['query']['fields']));_0x5249ca[_0x7665('0x43')]=_0x5249ca[_0x7665('0x43')][_0x7665('0x44')]?_0x5249ca[_0x7665('0x43')]:_0x4b9ada[_0x7665('0x3e')];_0x5249ca['order']=qs['sort'](_0x200377[_0x7665('0x3f')][_0x7665('0x47')]);_0x5249ca[_0x7665('0x4a')]=qs[_0x7665('0x41')](_[_0x7665('0x5a')](_0x200377['query'],_0x4b9ada[_0x7665('0x41')]));if(_0x200377[_0x7665('0x3f')][_0x7665('0x48')]){_0x5249ca[_0x7665('0x4a')]=_[_0x7665('0x49')](_0x5249ca[_0x7665('0x4a')],{'$or':_['map'](_0x5249ca[_0x7665('0x43')],function(_0x5bcf89){var _0x19a968={};_0x19a968[_0x5bcf89]={'$like':'%'+_0x200377[_0x7665('0x3f')][_0x7665('0x48')]+'%'};return _0x19a968;})});}_0x5249ca=_[_0x7665('0x49')]({},_0x5249ca,_0x200377[_0x7665('0x4c')]);return _0x195729[_0x7665('0x58')](_0x5249ca);}})[_0x7665('0x1e')](function(_0x263c88){if(_0x263c88){_0x2cacc8=_0x263c88[_0x7665('0x44')];if(!_0x200377[_0x7665('0x3f')][_0x7665('0x5b')](_0x7665('0x5c'))){_0x5249ca['limit']=qs[_0x7665('0x45')](_0x200377[_0x7665('0x3f')]['limit']);_0x5249ca[_0x7665('0x2d')]=qs[_0x7665('0x2d')](_0x200377[_0x7665('0x3f')][_0x7665('0x2d')]);}return _0x195729[_0x7665('0x58')](_0x5249ca);}})[_0x7665('0x1e')](function(_0x1cc1e3){if(_0x1cc1e3){return _0x1cc1e3?{'count':_0x2cacc8,'rows':_0x1cc1e3}:null;}})[_0x7665('0x1e')](respondWithResult(_0x4bd77c,null))[_0x7665('0x28')](handleError(_0x4bd77c,null));};exports[_0x7665('0x5d')]=function(_0x488fa0,_0x4e09b4,_0x2c7d28){if(_0x488fa0['body']['id']){delete _0x488fa0[_0x7665('0x57')]['id'];}return db[_0x7665('0x3a')][_0x7665('0x59')]({'where':{'id':_0x488fa0['params']['id']}})[_0x7665('0x1e')](handleEntityNotFound(_0x4e09b4,null))['then'](function(_0x5c58b5){if(_0x5c58b5){_0x488fa0[_0x7665('0x57')][_0x7665('0x5e')]=_0x5c58b5['id'];_0x488fa0[_0x7665('0x57')][_0x7665('0x5f')]=integrations[_0x7665('0x60')](_0x488fa0['body']['channel'],_0x488fa0['body'][_0x7665('0x3c')]);_0x488fa0[_0x7665('0x57')]['Descriptions']=integrations[_0x7665('0x61')](_0x488fa0[_0x7665('0x57')][_0x7665('0x62')],_0x488fa0[_0x7665('0x57')][_0x7665('0x3c')]);return db[_0x7665('0x63')]['create'](_0x488fa0[_0x7665('0x57')],{'include':[{'model':db[_0x7665('0x64')],'as':_0x7665('0x5f')},{'model':db['ZohoField'],'as':_0x7665('0x65')}]});}return null;})[_0x7665('0x1e')](respondWithResult(_0x4e09b4,null))[_0x7665('0x28')](handleError(_0x4e09b4,null));};function getAccessToken(_0x4ac22e){return new Promise(function(_0xe71140,_0x267e80){var _0x31fd93;switch(_0x4ac22e['zone']){case'US':_0x31fd93=_0x7665('0x66');break;case'AU':_0x31fd93=_0x7665('0x67');break;case'EU':_0x31fd93='https://accounts.zoho.eu';break;case'IN':_0x31fd93='https://accounts.zoho.in';break;case'CN':_0x31fd93=_0x7665('0x68');break;default:_0x31fd93=_0x7665('0x69');break;}var _0x4f8eda={'method':_0x7665('0x6a'),'uri':_0x31fd93+_0x7665('0x6b'),'qs':{'refresh_token':_0x4ac22e[_0x7665('0x6c')],'client_id':_0x4ac22e[_0x7665('0x6d')],'client_secret':_0x4ac22e[_0x7665('0x6e')],'grant_type':_0x7665('0x6f')},'json':!![]};return rp(_0x4f8eda)[_0x7665('0x1e')](function(_0x4007e9){if(_0x4007e9[_0x7665('0x70')]){_0xe71140(_0x4007e9[_0x7665('0x70')]);}else{_0x267e80(_0x7665('0x71'));}})[_0x7665('0x28')](function(_0x1a1a7d){_0x267e80(_0x1a1a7d);});});}exports['getFields']=function(_0x409a1c,_0x138cec,_0x53c3cd){var _0x1d47b8,_0x566995,_0x57cecc,_0x53978e,_0x8790f5;return db[_0x7665('0x3a')][_0x7665('0x59')]({'where':{'id':_0x409a1c['params']['id']},'attributes':['id','host','zone','clientId',_0x7665('0x6e'),_0x7665('0x72'),'code',_0x7665('0x6c')]})[_0x7665('0x1e')](handleEntityNotFound(_0x138cec,null))[_0x7665('0x1e')](function(_0x5df167){_0x8790f5=_0x5df167;_0x1d47b8=_0x8790f5['host'];_0x566995=_0x1d47b8===_0x7665('0x73')?'eu':_0x7665('0x74');_0x57cecc=_0x8790f5[_0x7665('0x72')];var _0x21473d=_0x57cecc[_0x7665('0x75')](-0x1);if(_0x21473d==='/'||_0x21473d==='\x5c'||_0x21473d===':'){_0x57cecc=_0x57cecc[_0x7665('0x76')](0x0,_0x57cecc[_0x7665('0x77')](_0x21473d));}if(!_0x8790f5['refreshToken']){throw new Error(_0x7665('0x78'));}return getAccessToken(_0x8790f5);})[_0x7665('0x1e')](function(_0x96acd1){if(_0x96acd1){return rp({'method':_0x7665('0x79'),'uri':util[_0x7665('0x7a')](_0x7665('0x7b'),_0x566995),'qs':{'module':_0x7665('0x7c')},'headers':{'Authorization':_0x7665('0x7d')+_0x96acd1},'json':!![]});}})['then'](function(_0x3cb53d){if(_0x3cb53d){if(_0x3cb53d[_0x7665('0x7e')]&&_0x3cb53d[_0x7665('0x7e')]['error']){throw new Error(_0x3cb53d[_0x7665('0x7e')][_0x7665('0x25')][_0x7665('0x26')]);}var _0x5b807b=[];var _0x20ea5b=[];var _0x426e4e=['Owner',_0x7665('0x7f'),'Description',_0x7665('0x80'),_0x7665('0x81'),_0x7665('0x82'),'Call_Start_Time',_0x7665('0x83')];_0x20ea5b=_[_0x7665('0x84')](_0x3cb53d[_0x7665('0x54')],function(_0x227200){return _0x426e4e[_0x7665('0x85')](_0x227200['api_name']);});for(var _0x14b553=0x0;_0x14b553<_0x20ea5b[_0x7665('0x44')];_0x14b553++){if(_0x20ea5b[_0x14b553][_0x7665('0x86')]===![]){_0x5b807b[_0x7665('0x87')]({'id':_0x20ea5b[_0x14b553]['id'],'name':_0x20ea5b[_0x14b553]['display_label'],'custom':_0x20ea5b[_0x14b553][_0x7665('0x88')],'options':_0x20ea5b[_0x14b553][_0x7665('0x89')]===_0x7665('0x8a')&&_0x20ea5b[_0x14b553][_0x7665('0x8b')][_0x7665('0x44')]>-0x1?_[_0x7665('0x39')](_0x20ea5b[_0x14b553][_0x7665('0x8b')],function(_0x8d5344){return{'name':_0x8d5344,'value':_0x8d5344};}):[]});}}return{'count':_0x5b807b[_0x7665('0x44')],'rows':_0x5b807b};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithResult(_0x138cec,null))[_0x7665('0x28')](function(_0x4f500e){var _0x39aa24=_0x409a1c[_0x7665('0x3f')][_0x7665('0x1a')]?0x1f4:_0x4f500e[_0x7665('0x8c')]||0x1f4;logger['error'](_0x7665('0x8d'),_0x7665('0x8e'),_0x39aa24,JSON[_0x7665('0x24')](_0x4f500e));delete _0x4f500e['name'];if(_0x39aa24===0x191){_0x39aa24=0x190;}_0x138cec[_0x7665('0x2a')](_0x39aa24)[_0x7665('0x37')](_0x409a1c[_0x7665('0x3f')][_0x7665('0x1a')]?{'message':_0x7665('0x8f'),'statusCode':_0x4f500e[_0x7665('0x8c')]}:_0x4f500e);});};
\ No newline at end of file
diff --git a/server/api/intZohoAccount/intZohoAccount.model.js b/server/api/intZohoAccount/intZohoAccount.model.js
index ad0721e..c63b121 100644
--- a/server/api/intZohoAccount/intZohoAccount.model.js
+++ b/server/api/intZohoAccount/intZohoAccount.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x76df=['define','ZohoAccount','int_zoho_accounts','changed','zone','clientId','clientSecret','code','substring','lastIndexOf','https://accounts.zoho.com.au','https://accounts.zoho.in','https://accounts.zoho.eu','authorization_code','serverUrl','parse','refresh_token','refreshToken','format','ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d','name','error','ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d','inspect','catch','host','slice','https://accounts.zoho.com','https://accounts.zoho.com.cn','/oauth/v2/token','application/x-www-form-urlencoded','then','info','lodash','api','moment','bluebird','request-promise','path','./intZohoAccount.attributes','exports'];(function(_0x41369d,_0x3dbf85){var _0x592a0d=function(_0x444d09){while(--_0x444d09){_0x41369d['push'](_0x41369d['shift']());}};_0x592a0d(++_0x3dbf85);}(_0x76df,0x73));var _0xf76d=function(_0x7671bc,_0x171145){_0x7671bc=_0x7671bc-0x0;var _0x55229f=_0x76df[_0x7671bc];return _0x55229f;};'use strict';var _=require(_0xf76d('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xf76d('0x1'));var moment=require(_0xf76d('0x2'));var BPromise=require(_0xf76d('0x3'));var rp=require(_0xf76d('0x4'));var fs=require('fs');var path=require(_0xf76d('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xf76d('0x6'));var integrations=require('../../components/integrations/configuration');module[_0xf76d('0x7')]=function(_0x36a70c,_0x25336c){return _0x36a70c[_0xf76d('0x8')](_0xf76d('0x9'),attributes,{'tableName':_0xf76d('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x4023f7,_0x425401,_0x20a1d2){if(_0x4023f7[_0xf76d('0xb')](_0xf76d('0xc'))||_0x4023f7[_0xf76d('0xb')]('serverUrl')||_0x4023f7[_0xf76d('0xb')](_0xf76d('0xd'))||_0x4023f7[_0xf76d('0xb')](_0xf76d('0xe'))||_0x4023f7['changed'](_0xf76d('0xf'))||_0x4023f7[_0xf76d('0xb')]('host')){var _0x1d9a6b,_0x2db8cf;_0x1d9a6b=_0x4023f7['serverUrl'];var _0x2c2557=_0x1d9a6b['slice'](-0x1);if(_0x2c2557==='/'||_0x2c2557==='\x5c'||_0x2c2557===':'){_0x1d9a6b=_0x1d9a6b[_0xf76d('0x10')](0x0,_0x1d9a6b[_0xf76d('0x11')](_0x2c2557));}switch(_0x4023f7[_0xf76d('0xc')]){case'US':_0x2db8cf='https://accounts.zoho.com';break;case'AU':_0x2db8cf=_0xf76d('0x12');break;case'IN':_0x2db8cf=_0xf76d('0x13');break;case'CN':_0x2db8cf='https://accounts.zoho.com.cn';break;default:_0x2db8cf=_0xf76d('0x14');break;}var _0x536ec4={'method':'POST','uri':_0x2db8cf+'/oauth/v2/token','form':{'grant_type':_0xf76d('0x15'),'client_id':_0x4023f7['clientId'],'client_secret':_0x4023f7[_0xf76d('0xe')],'redirect_uri':_0x4023f7[_0xf76d('0x16')],'code':_0x4023f7[_0xf76d('0xf')]},'headers':{'Content-Type':'application/x-www-form-urlencoded'}};return rp(_0x536ec4)['then'](function(_0xaed691){var _0xc191c0=JSON[_0xf76d('0x17')](_0xaed691);if(_0xc191c0[_0xf76d('0x18')]){_0x4023f7[_0xf76d('0x19')]=_0xc191c0[_0xf76d('0x18')];logger['info'](util[_0xf76d('0x1a')](_0xf76d('0x1b'),_0x4023f7[_0xf76d('0x1c')],_0x4023f7['id']));}else{logger[_0xf76d('0x1d')](util[_0xf76d('0x1a')](_0xf76d('0x1e'),_0x4023f7[_0xf76d('0x1c')],_0x4023f7['id']),util[_0xf76d('0x1f')](_0xc191c0,{'showHidden':![],'depth':null}));}return _0x20a1d2(null,_0x425401);})[_0xf76d('0x20')](function(_0x5c0e82){logger[_0xf76d('0x1d')](util[_0xf76d('0x1a')]('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x4023f7[_0xf76d('0x1c')],_0x4023f7['id']),util[_0xf76d('0x1f')](parsedResult,{'showHidden':![],'depth':null}));return _0x20a1d2(_0x5c0e82);});}else{return _0x20a1d2(null,_0x425401);}},'beforeUpdate':function(_0x220f78,_0x5e4915,_0x51cd1a){if(_0x220f78[_0xf76d('0xb')](_0xf76d('0xc'))||_0x220f78[_0xf76d('0xb')]('serverUrl')||_0x220f78['changed'](_0xf76d('0xd'))||_0x220f78[_0xf76d('0xb')](_0xf76d('0xe'))||_0x220f78[_0xf76d('0xb')](_0xf76d('0xf'))||_0x220f78[_0xf76d('0xb')](_0xf76d('0x21'))){var _0x586426,_0x391440;_0x586426=_0x220f78[_0xf76d('0x16')];var _0x8830d0=_0x586426[_0xf76d('0x22')](-0x1);if(_0x8830d0==='/'||_0x8830d0==='\x5c'||_0x8830d0===':'){_0x586426=_0x586426[_0xf76d('0x10')](0x0,_0x586426[_0xf76d('0x11')](_0x8830d0));}switch(_0x220f78[_0xf76d('0xc')]){case'US':_0x391440=_0xf76d('0x23');break;case'AU':_0x391440=_0xf76d('0x12');break;case'IN':_0x391440='https://accounts.zoho.in';break;case'CN':_0x391440=_0xf76d('0x24');break;default:_0x391440=_0xf76d('0x14');break;}var _0x39678b={'method':'POST','uri':_0x391440+_0xf76d('0x25'),'form':{'grant_type':'authorization_code','client_id':_0x220f78[_0xf76d('0xd')],'client_secret':_0x220f78[_0xf76d('0xe')],'redirect_uri':_0x220f78[_0xf76d('0x16')],'code':_0x220f78[_0xf76d('0xf')]},'headers':{'Content-Type':_0xf76d('0x26')}};return rp(_0x39678b)[_0xf76d('0x27')](function(_0x226f62){var _0x515e06=JSON[_0xf76d('0x17')](_0x226f62);if(_0x515e06[_0xf76d('0x18')]){_0x220f78[_0xf76d('0x19')]=_0x515e06[_0xf76d('0x18')];logger[_0xf76d('0x28')](util[_0xf76d('0x1a')](_0xf76d('0x1b'),_0x220f78[_0xf76d('0x1c')],_0x220f78['id']));}else{logger['error'](util[_0xf76d('0x1a')](_0xf76d('0x1e'),_0x220f78[_0xf76d('0x1c')],_0x220f78['id']),util[_0xf76d('0x1f')](_0x515e06,{'showHidden':![],'depth':null}));}return _0x51cd1a(null,_0x5e4915);})[_0xf76d('0x20')](function(_0x266eb1){logger[_0xf76d('0x1d')](util[_0xf76d('0x1a')](_0xf76d('0x1e'),_0x220f78['name'],_0x220f78['id']),util[_0xf76d('0x1f')](parsedResult,{'showHidden':![],'depth':null}));return _0x51cd1a(_0x266eb1);});}else{return _0x51cd1a(null,_0x5e4915);}}}});};
\ No newline at end of file
+var _0xd7ff=['../../components/integrations/configuration','define','int_zoho_accounts','changed','serverUrl','clientId','host','slice','substring','lastIndexOf','zone','https://accounts.zoho.com.au','https://accounts.zoho.in','https://accounts.zoho.com.cn','https://accounts.zoho.eu','POST','/oauth/v2/token','authorization_code','then','parse','refresh_token','refreshToken','info','format','ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d','name','ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d','catch','error','inspect','clientSecret','code','https://accounts.zoho.com','application/x-www-form-urlencoded','lodash','../../config/logger','api','moment','path','rimraf','../../config/environment','./intZohoAccount.attributes'];(function(_0x4f3c2d,_0x4754af){var _0x19d3ee=function(_0x462c74){while(--_0x462c74){_0x4f3c2d['push'](_0x4f3c2d['shift']());}};_0x19d3ee(++_0x4754af);}(_0xd7ff,0xf4));var _0xfd7f=function(_0x2b871b,_0x2ced5d){_0x2b871b=_0x2b871b-0x0;var _0x36918b=_0xd7ff[_0x2b871b];return _0x36918b;};'use strict';var _=require(_0xfd7f('0x0'));var util=require('util');var logger=require(_0xfd7f('0x1'))(_0xfd7f('0x2'));var moment=require(_0xfd7f('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xfd7f('0x4'));var rimraf=require(_0xfd7f('0x5'));var config=require(_0xfd7f('0x6'));var attributes=require(_0xfd7f('0x7'));var integrations=require(_0xfd7f('0x8'));module['exports']=function(_0x39d48b,_0x1f0856){return _0x39d48b[_0xfd7f('0x9')]('ZohoAccount',attributes,{'tableName':_0xfd7f('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x48dded,_0x1f4fdf,_0x186537){if(_0x48dded['changed']('zone')||_0x48dded[_0xfd7f('0xb')](_0xfd7f('0xc'))||_0x48dded[_0xfd7f('0xb')](_0xfd7f('0xd'))||_0x48dded['changed']('clientSecret')||_0x48dded[_0xfd7f('0xb')]('code')||_0x48dded[_0xfd7f('0xb')](_0xfd7f('0xe'))){var _0x55fd92,_0x567569;_0x55fd92=_0x48dded[_0xfd7f('0xc')];var _0x1e5e44=_0x55fd92[_0xfd7f('0xf')](-0x1);if(_0x1e5e44==='/'||_0x1e5e44==='\x5c'||_0x1e5e44===':'){_0x55fd92=_0x55fd92[_0xfd7f('0x10')](0x0,_0x55fd92[_0xfd7f('0x11')](_0x1e5e44));}switch(_0x48dded[_0xfd7f('0x12')]){case'US':_0x567569='https://accounts.zoho.com';break;case'AU':_0x567569=_0xfd7f('0x13');break;case'IN':_0x567569=_0xfd7f('0x14');break;case'CN':_0x567569=_0xfd7f('0x15');break;default:_0x567569=_0xfd7f('0x16');break;}var _0xcbd61d={'method':_0xfd7f('0x17'),'uri':_0x567569+_0xfd7f('0x18'),'form':{'grant_type':_0xfd7f('0x19'),'client_id':_0x48dded[_0xfd7f('0xd')],'client_secret':_0x48dded['clientSecret'],'redirect_uri':_0x48dded[_0xfd7f('0xc')],'code':_0x48dded['code']},'headers':{'Content-Type':'application/x-www-form-urlencoded'}};return rp(_0xcbd61d)[_0xfd7f('0x1a')](function(_0x2cbe7b){var _0x24affd=JSON[_0xfd7f('0x1b')](_0x2cbe7b);if(_0x24affd[_0xfd7f('0x1c')]){_0x48dded[_0xfd7f('0x1d')]=_0x24affd[_0xfd7f('0x1c')];logger[_0xfd7f('0x1e')](util[_0xfd7f('0x1f')](_0xfd7f('0x20'),_0x48dded[_0xfd7f('0x21')],_0x48dded['id']));}else{logger['error'](util['format'](_0xfd7f('0x22'),_0x48dded[_0xfd7f('0x21')],_0x48dded['id']),util['inspect'](_0x24affd,{'showHidden':![],'depth':null}));}return _0x186537(null,_0x1f4fdf);})[_0xfd7f('0x23')](function(_0x142644){logger[_0xfd7f('0x24')](util[_0xfd7f('0x1f')](_0xfd7f('0x22'),_0x48dded[_0xfd7f('0x21')],_0x48dded['id']),util[_0xfd7f('0x25')](parsedResult,{'showHidden':![],'depth':null}));return _0x186537(_0x142644);});}else{return _0x186537(null,_0x1f4fdf);}},'beforeUpdate':function(_0x3c746d,_0x106886,_0x5cd8b4){if(_0x3c746d[_0xfd7f('0xb')](_0xfd7f('0x12'))||_0x3c746d[_0xfd7f('0xb')](_0xfd7f('0xc'))||_0x3c746d['changed'](_0xfd7f('0xd'))||_0x3c746d[_0xfd7f('0xb')](_0xfd7f('0x26'))||_0x3c746d[_0xfd7f('0xb')](_0xfd7f('0x27'))||_0x3c746d[_0xfd7f('0xb')](_0xfd7f('0xe'))){var _0x241e6c,_0xe52a4b;_0x241e6c=_0x3c746d[_0xfd7f('0xc')];var _0x25e949=_0x241e6c[_0xfd7f('0xf')](-0x1);if(_0x25e949==='/'||_0x25e949==='\x5c'||_0x25e949===':'){_0x241e6c=_0x241e6c['substring'](0x0,_0x241e6c['lastIndexOf'](_0x25e949));}switch(_0x3c746d[_0xfd7f('0x12')]){case'US':_0xe52a4b=_0xfd7f('0x28');break;case'AU':_0xe52a4b='https://accounts.zoho.com.au';break;case'IN':_0xe52a4b='https://accounts.zoho.in';break;case'CN':_0xe52a4b=_0xfd7f('0x15');break;default:_0xe52a4b=_0xfd7f('0x16');break;}var _0x31d7fc={'method':'POST','uri':_0xe52a4b+_0xfd7f('0x18'),'form':{'grant_type':_0xfd7f('0x19'),'client_id':_0x3c746d[_0xfd7f('0xd')],'client_secret':_0x3c746d[_0xfd7f('0x26')],'redirect_uri':_0x3c746d[_0xfd7f('0xc')],'code':_0x3c746d[_0xfd7f('0x27')]},'headers':{'Content-Type':_0xfd7f('0x29')}};return rp(_0x31d7fc)[_0xfd7f('0x1a')](function(_0x55a08a){var _0xebfbf8=JSON['parse'](_0x55a08a);if(_0xebfbf8[_0xfd7f('0x1c')]){_0x3c746d['refreshToken']=_0xebfbf8[_0xfd7f('0x1c')];logger[_0xfd7f('0x1e')](util['format'](_0xfd7f('0x20'),_0x3c746d[_0xfd7f('0x21')],_0x3c746d['id']));}else{logger['error'](util[_0xfd7f('0x1f')]('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x3c746d[_0xfd7f('0x21')],_0x3c746d['id']),util[_0xfd7f('0x25')](_0xebfbf8,{'showHidden':![],'depth':null}));}return _0x5cd8b4(null,_0x106886);})[_0xfd7f('0x23')](function(_0x1c01f9){logger[_0xfd7f('0x24')](util[_0xfd7f('0x1f')]('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x3c746d[_0xfd7f('0x21')],_0x3c746d['id']),util[_0xfd7f('0x25')](parsedResult,{'showHidden':![],'depth':null}));return _0x5cd8b4(_0x1c01f9);});}else{return _0x5cd8b4(null,_0x106886);}}}});};
\ No newline at end of file
diff --git a/server/api/intZohoAccount/intZohoAccount.rpc.js b/server/api/intZohoAccount/intZohoAccount.rpc.js
index 5feaa84..aef2f55 100644
--- a/server/api/intZohoAccount/intZohoAccount.rpc.js
+++ b/server/api/intZohoAccount/intZohoAccount.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9470=['stringify','catch','ShowZohoAccount','find','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','ZohoAccount,\x20%s,\x20%s','request\x20sent','debug','ZohoAccount,\x20%s,\x20%s,\x20%s','error','message','result','GetZohoAccount','ZohoAccount','findAll','options','raw','where','attributes','limit','map','model','include'];(function(_0x237f2c,_0xb75485){var _0x20ee85=function(_0x5a2a1b){while(--_0x5a2a1b){_0x237f2c['push'](_0x237f2c['shift']());}};_0x20ee85(++_0xb75485);}(_0x9470,0x98));var _0x0947=function(_0x48b5f9,_0x585cfb){_0x48b5f9=_0x48b5f9-0x0;var _0x55ae7a=_0x9470[_0x48b5f9];return _0x55ae7a;};'use strict';var _=require(_0x0947('0x0'));var util=require(_0x0947('0x1'));var moment=require(_0x0947('0x2'));var BPromise=require('bluebird');var rs=require(_0x0947('0x3'));var fs=require('fs');var Redis=require(_0x0947('0x4'));var db=require(_0x0947('0x5'))['db'];var utils=require(_0x0947('0x6'));var logger=require(_0x0947('0x7'))(_0x0947('0x8'));var config=require('../../config/environment');var jayson=require(_0x0947('0x9'));var client=jayson[_0x0947('0xa')][_0x0947('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4a8937,_0x445934,_0x1f46aa){return new BPromise(function(_0x260a60,_0x126458){return client[_0x0947('0xc')](_0x4a8937,_0x1f46aa)[_0x0947('0xd')](function(_0x3e0129){logger[_0x0947('0xe')](_0x0947('0xf'),_0x445934,_0x0947('0x10'));logger[_0x0947('0x11')](_0x0947('0x12'),_0x445934,'request\x20sent',JSON['stringify'](_0x3e0129));if(_0x3e0129[_0x0947('0x13')]){if(_0x3e0129[_0x0947('0x13')]['code']===0x1f4){logger['error'](_0x0947('0xf'),_0x445934,_0x3e0129[_0x0947('0x13')][_0x0947('0x14')]);return _0x126458(_0x3e0129[_0x0947('0x13')][_0x0947('0x14')]);}logger[_0x0947('0x13')](_0x0947('0xf'),_0x445934,_0x3e0129['error'][_0x0947('0x14')]);return _0x260a60(_0x3e0129['error'][_0x0947('0x14')]);}else{logger['info'](_0x0947('0xf'),_0x445934,_0x0947('0x10'));_0x260a60(_0x3e0129[_0x0947('0x15')]['message']);}})['catch'](function(_0x44ce64){logger[_0x0947('0x13')](_0x0947('0xf'),_0x445934,_0x44ce64);_0x126458(_0x44ce64);});});}exports[_0x0947('0x16')]=function(_0x1c841f){var _0x4d3892=this;return new Promise(function(_0x3ffce1,_0xc39e47){return db[_0x0947('0x17')][_0x0947('0x18')]({'raw':_0x1c841f[_0x0947('0x19')]?_0x1c841f[_0x0947('0x19')][_0x0947('0x1a')]===undefined?!![]:![]:!![],'where':_0x1c841f[_0x0947('0x19')]?_0x1c841f[_0x0947('0x19')][_0x0947('0x1b')]||null:null,'attributes':_0x1c841f['options']?_0x1c841f[_0x0947('0x19')][_0x0947('0x1c')]||null:null,'limit':_0x1c841f['options']?_0x1c841f[_0x0947('0x19')][_0x0947('0x1d')]||null:null,'include':_0x1c841f[_0x0947('0x19')]?_0x1c841f[_0x0947('0x19')]['include']?_[_0x0947('0x1e')](_0x1c841f[_0x0947('0x19')]['include'],function(_0x427448){return{'model':db[_0x427448[_0x0947('0x1f')]],'as':_0x427448['as'],'attributes':_0x427448[_0x0947('0x1c')],'include':_0x427448['include']?_[_0x0947('0x1e')](_0x427448[_0x0947('0x20')],function(_0x3e0882){return{'model':db[_0x3e0882[_0x0947('0x1f')]],'as':_0x3e0882['as'],'attributes':_0x3e0882[_0x0947('0x1c')],'include':_0x3e0882[_0x0947('0x20')]?_['map'](_0x3e0882['include'],function(_0x12b38b){return{'model':db[_0x12b38b['model']],'as':_0x12b38b['as'],'attributes':_0x12b38b[_0x0947('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x0947('0xd')](function(_0x5f555b){logger[_0x0947('0xe')]('GetZohoAccount',_0x1c841f);logger[_0x0947('0x11')]('GetZohoAccount',_0x1c841f,JSON[_0x0947('0x21')](_0x5f555b));_0x3ffce1(_0x5f555b);})[_0x0947('0x22')](function(_0x1f4a24){logger[_0x0947('0x13')](_0x0947('0x16'),_0x1f4a24[_0x0947('0x14')],_0x1c841f);_0xc39e47(_0x4d3892[_0x0947('0x13')](0x1f4,_0x1f4a24[_0x0947('0x14')]));});});};exports[_0x0947('0x23')]=function(_0x26cf5a){var _0x138b09=this;return new Promise(function(_0x30b527,_0x1926f4){return db['ZohoAccount'][_0x0947('0x24')]({'raw':_0x26cf5a[_0x0947('0x19')]?_0x26cf5a[_0x0947('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x26cf5a[_0x0947('0x19')]?_0x26cf5a[_0x0947('0x19')]['where']||null:null,'attributes':_0x26cf5a[_0x0947('0x19')]?_0x26cf5a[_0x0947('0x19')][_0x0947('0x1c')]||null:null,'include':_0x26cf5a[_0x0947('0x19')]?_0x26cf5a[_0x0947('0x19')][_0x0947('0x20')]?_['map'](_0x26cf5a[_0x0947('0x19')][_0x0947('0x20')],function(_0xaa8c91){return{'model':db[_0xaa8c91[_0x0947('0x1f')]],'as':_0xaa8c91['as'],'attributes':_0xaa8c91['attributes'],'include':_0xaa8c91[_0x0947('0x20')]?_['map'](_0xaa8c91[_0x0947('0x20')],function(_0x352c8b){return{'model':db[_0x352c8b['model']],'as':_0x352c8b['as'],'attributes':_0x352c8b['attributes'],'include':_0x352c8b['include']?_[_0x0947('0x1e')](_0x352c8b[_0x0947('0x20')],function(_0x4d3f64){return{'model':db[_0x4d3f64['model']],'as':_0x4d3f64['as'],'attributes':_0x4d3f64['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x2dfb7c){logger[_0x0947('0xe')](_0x0947('0x23'),_0x26cf5a);logger['debug']('ShowZohoAccount',_0x26cf5a,JSON[_0x0947('0x21')](_0x2dfb7c));_0x30b527(_0x2dfb7c);})[_0x0947('0x22')](function(_0x2e5d4c){logger[_0x0947('0x13')](_0x0947('0x23'),_0x2e5d4c[_0x0947('0x14')],_0x26cf5a);_0x1926f4(_0x138b09[_0x0947('0x13')](0x1f4,_0x2e5d4c[_0x0947('0x14')]));});});};
\ No newline at end of file
+var _0xfa24=['jayson/promise','client','info','ZohoAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','GetZohoAccount','options','where','attributes','limit','include','map','model','then','ShowZohoAccount','find','raw','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x786598,_0x2dd56b){var _0x1f7435=function(_0x5a0d5c){while(--_0x5a0d5c){_0x786598['push'](_0x786598['shift']());}};_0x1f7435(++_0x2dd56b);}(_0xfa24,0xff));var _0x4fa2=function(_0x3207aa,_0xe86a72){_0x3207aa=_0x3207aa-0x0;var _0x51758f=_0xfa24[_0x3207aa];return _0x51758f;};'use strict';var _=require(_0x4fa2('0x0'));var util=require('util');var moment=require(_0x4fa2('0x1'));var BPromise=require(_0x4fa2('0x2'));var rs=require(_0x4fa2('0x3'));var fs=require('fs');var Redis=require(_0x4fa2('0x4'));var db=require(_0x4fa2('0x5'))['db'];var utils=require(_0x4fa2('0x6'));var logger=require(_0x4fa2('0x7'))(_0x4fa2('0x8'));var config=require('../../config/environment');var jayson=require(_0x4fa2('0x9'));var client=jayson[_0x4fa2('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0xd04f82,_0x3cc23f,_0x5cdbb4){return new BPromise(function(_0x80df4b,_0x3c9017){return client['request'](_0xd04f82,_0x5cdbb4)['then'](function(_0x59f341){logger[_0x4fa2('0xb')](_0x4fa2('0xc'),_0x3cc23f,_0x4fa2('0xd'));logger[_0x4fa2('0xe')]('ZohoAccount,\x20%s,\x20%s,\x20%s',_0x3cc23f,_0x4fa2('0xd'),JSON[_0x4fa2('0xf')](_0x59f341));if(_0x59f341[_0x4fa2('0x10')]){if(_0x59f341[_0x4fa2('0x10')][_0x4fa2('0x11')]===0x1f4){logger[_0x4fa2('0x10')]('ZohoAccount,\x20%s,\x20%s',_0x3cc23f,_0x59f341[_0x4fa2('0x10')][_0x4fa2('0x12')]);return _0x3c9017(_0x59f341[_0x4fa2('0x10')][_0x4fa2('0x12')]);}logger[_0x4fa2('0x10')](_0x4fa2('0xc'),_0x3cc23f,_0x59f341[_0x4fa2('0x10')][_0x4fa2('0x12')]);return _0x80df4b(_0x59f341['error'][_0x4fa2('0x12')]);}else{logger['info'](_0x4fa2('0xc'),_0x3cc23f,_0x4fa2('0xd'));_0x80df4b(_0x59f341[_0x4fa2('0x13')]['message']);}})[_0x4fa2('0x14')](function(_0x32dfbb){logger[_0x4fa2('0x10')](_0x4fa2('0xc'),_0x3cc23f,_0x32dfbb);_0x3c9017(_0x32dfbb);});});}exports[_0x4fa2('0x15')]=function(_0x5b7c00){var _0x3e8f94=this;return new Promise(function(_0x41ed4e,_0x8f62d2){return db['ZohoAccount']['findAll']({'raw':_0x5b7c00[_0x4fa2('0x16')]?_0x5b7c00[_0x4fa2('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x5b7c00[_0x4fa2('0x16')]?_0x5b7c00[_0x4fa2('0x16')][_0x4fa2('0x17')]||null:null,'attributes':_0x5b7c00['options']?_0x5b7c00[_0x4fa2('0x16')][_0x4fa2('0x18')]||null:null,'limit':_0x5b7c00[_0x4fa2('0x16')]?_0x5b7c00[_0x4fa2('0x16')][_0x4fa2('0x19')]||null:null,'include':_0x5b7c00[_0x4fa2('0x16')]?_0x5b7c00['options'][_0x4fa2('0x1a')]?_[_0x4fa2('0x1b')](_0x5b7c00['options']['include'],function(_0x3554af){return{'model':db[_0x3554af['model']],'as':_0x3554af['as'],'attributes':_0x3554af[_0x4fa2('0x18')],'include':_0x3554af[_0x4fa2('0x1a')]?_['map'](_0x3554af['include'],function(_0x1a3282){return{'model':db[_0x1a3282[_0x4fa2('0x1c')]],'as':_0x1a3282['as'],'attributes':_0x1a3282['attributes'],'include':_0x1a3282['include']?_[_0x4fa2('0x1b')](_0x1a3282[_0x4fa2('0x1a')],function(_0x59ec00){return{'model':db[_0x59ec00[_0x4fa2('0x1c')]],'as':_0x59ec00['as'],'attributes':_0x59ec00['attributes']};}):[]};}):[]};}):[]:[]})[_0x4fa2('0x1d')](function(_0x59a0b0){logger['info'](_0x4fa2('0x15'),_0x5b7c00);logger['debug'](_0x4fa2('0x15'),_0x5b7c00,JSON['stringify'](_0x59a0b0));_0x41ed4e(_0x59a0b0);})[_0x4fa2('0x14')](function(_0x31c4df){logger[_0x4fa2('0x10')](_0x4fa2('0x15'),_0x31c4df[_0x4fa2('0x12')],_0x5b7c00);_0x8f62d2(_0x3e8f94[_0x4fa2('0x10')](0x1f4,_0x31c4df[_0x4fa2('0x12')]));});});};exports[_0x4fa2('0x1e')]=function(_0x1e5d95){var _0x1e5148=this;return new Promise(function(_0x4ab80a,_0x2f4120){return db['ZohoAccount'][_0x4fa2('0x1f')]({'raw':_0x1e5d95['options']?_0x1e5d95[_0x4fa2('0x16')][_0x4fa2('0x20')]===undefined?!![]:![]:!![],'where':_0x1e5d95[_0x4fa2('0x16')]?_0x1e5d95[_0x4fa2('0x16')][_0x4fa2('0x17')]||null:null,'attributes':_0x1e5d95['options']?_0x1e5d95[_0x4fa2('0x16')][_0x4fa2('0x18')]||null:null,'include':_0x1e5d95[_0x4fa2('0x16')]?_0x1e5d95[_0x4fa2('0x16')]['include']?_[_0x4fa2('0x1b')](_0x1e5d95[_0x4fa2('0x16')]['include'],function(_0x5e5f1f){return{'model':db[_0x5e5f1f['model']],'as':_0x5e5f1f['as'],'attributes':_0x5e5f1f[_0x4fa2('0x18')],'include':_0x5e5f1f[_0x4fa2('0x1a')]?_['map'](_0x5e5f1f[_0x4fa2('0x1a')],function(_0x26b1af){return{'model':db[_0x26b1af[_0x4fa2('0x1c')]],'as':_0x26b1af['as'],'attributes':_0x26b1af[_0x4fa2('0x18')],'include':_0x26b1af['include']?_[_0x4fa2('0x1b')](_0x26b1af[_0x4fa2('0x1a')],function(_0x5346b8){return{'model':db[_0x5346b8[_0x4fa2('0x1c')]],'as':_0x5346b8['as'],'attributes':_0x5346b8[_0x4fa2('0x18')]};}):[]};}):[]};}):[]:[]})[_0x4fa2('0x1d')](function(_0x406a7e){logger[_0x4fa2('0xb')](_0x4fa2('0x1e'),_0x1e5d95);logger[_0x4fa2('0xe')](_0x4fa2('0x1e'),_0x1e5d95,JSON[_0x4fa2('0xf')](_0x406a7e));_0x4ab80a(_0x406a7e);})[_0x4fa2('0x14')](function(_0x206678){logger[_0x4fa2('0x10')](_0x4fa2('0x1e'),_0x206678[_0x4fa2('0x12')],_0x1e5d95);_0x2f4120(_0x1e5148[_0x4fa2('0x10')](0x1f4,_0x206678[_0x4fa2('0x12')]));});});};
\ No newline at end of file
diff --git a/server/api/intZohoConfiguration/index.js b/server/api/intZohoConfiguration/index.js
index 6b2e061..ba9873b 100644
--- a/server/api/intZohoConfiguration/index.js
+++ b/server/api/intZohoConfiguration/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xdadd=['../../components/auth/service','../../config/environment','./intZohoConfiguration.controller','get','isAuthenticated','/:id','/:id/fields','getFields','/:id/subjects','getSubjects','getDescriptions','post','create','update','delete','exports','multer','path','express','Router'];(function(_0x37872a,_0xdec874){var _0x5a5300=function(_0x1c2d7a){while(--_0x1c2d7a){_0x37872a['push'](_0x37872a['shift']());}};_0x5a5300(++_0xdec874);}(_0xdadd,0x1c8));var _0xddad=function(_0x341095,_0x4b00e6){_0x341095=_0x341095-0x0;var _0x51e224=_0xdadd[_0x341095];return _0x51e224;};'use strict';var multer=require(_0xddad('0x0'));var util=require('util');var path=require(_0xddad('0x1'));var timeout=require('connect-timeout');var express=require(_0xddad('0x2'));var router=express[_0xddad('0x3')]();var auth=require(_0xddad('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xddad('0x5'));var controller=require(_0xddad('0x6'));router[_0xddad('0x7')]('/',auth[_0xddad('0x8')](),controller['index']);router['get'](_0xddad('0x9'),auth[_0xddad('0x8')](),controller['show']);router[_0xddad('0x7')](_0xddad('0xa'),auth[_0xddad('0x8')](),controller[_0xddad('0xb')]);router[_0xddad('0x7')](_0xddad('0xc'),auth[_0xddad('0x8')](),controller[_0xddad('0xd')]);router[_0xddad('0x7')]('/:id/descriptions',auth[_0xddad('0x8')](),controller[_0xddad('0xe')]);router[_0xddad('0xf')]('/',auth['isAuthenticated'](),controller[_0xddad('0x10')]);router['put'](_0xddad('0x9'),auth[_0xddad('0x8')](),controller[_0xddad('0x11')]);router[_0xddad('0x12')](_0xddad('0x9'),auth[_0xddad('0x8')](),controller['destroy']);module[_0xddad('0x13')]=router;
\ No newline at end of file
+var _0x081e=['getSubjects','post','create','put','/:id','delete','destroy','exports','multer','util','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZohoConfiguration.controller','get','isAuthenticated','/:id/fields','getFields','/:id/subjects'];(function(_0x87cd78,_0x1fa259){var _0x12b1f5=function(_0x3d55bf){while(--_0x3d55bf){_0x87cd78['push'](_0x87cd78['shift']());}};_0x12b1f5(++_0x1fa259);}(_0x081e,0xc5));var _0xe081=function(_0x8343ba,_0x217a01){_0x8343ba=_0x8343ba-0x0;var _0x3b10ff=_0x081e[_0x8343ba];return _0x3b10ff;};'use strict';var multer=require(_0xe081('0x0'));var util=require(_0xe081('0x1'));var path=require('path');var timeout=require(_0xe081('0x2'));var express=require('express');var router=express[_0xe081('0x3')]();var auth=require(_0xe081('0x4'));var interaction=require(_0xe081('0x5'));var config=require(_0xe081('0x6'));var controller=require(_0xe081('0x7'));router[_0xe081('0x8')]('/',auth[_0xe081('0x9')](),controller['index']);router[_0xe081('0x8')]('/:id',auth['isAuthenticated'](),controller['show']);router['get'](_0xe081('0xa'),auth['isAuthenticated'](),controller[_0xe081('0xb')]);router['get'](_0xe081('0xc'),auth[_0xe081('0x9')](),controller[_0xe081('0xd')]);router['get']('/:id/descriptions',auth[_0xe081('0x9')](),controller['getDescriptions']);router[_0xe081('0xe')]('/',auth[_0xe081('0x9')](),controller[_0xe081('0xf')]);router[_0xe081('0x10')](_0xe081('0x11'),auth[_0xe081('0x9')](),controller['update']);router[_0xe081('0x12')](_0xe081('0x11'),auth['isAuthenticated'](),controller[_0xe081('0x13')]);module[_0xe081('0x14')]=router;
\ No newline at end of file
diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.attributes.js b/server/api/intZohoConfiguration/intZohoConfiguration.attributes.js
index 3d0ef8d..ee8b494 100644
--- a/server/api/intZohoConfiguration/intZohoConfiguration.attributes.js
+++ b/server/api/intZohoConfiguration/intZohoConfiguration.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x85f6=['contact','ENUM','contact_lead','sequelize','STRING','lead'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x85f6,0x11d));var _0x685f=function(_0x747415,_0x304ca2){_0x747415=_0x747415-0x0;var _0x2c9dc8=_0x85f6[_0x747415];return _0x2c9dc8;};'use strict';var Sequelize=require(_0x685f('0x0'));module['exports']={'name':{'type':Sequelize[_0x685f('0x1')]},'moduleCreate':{'type':Sequelize['ENUM'](_0x685f('0x2'),_0x685f('0x3'),'nothing'),'defaultValue':_0x685f('0x2')},'moduleSearch':{'type':Sequelize[_0x685f('0x4')]('contact_lead',_0x685f('0x3'),_0x685f('0x2')),'defaultValue':_0x685f('0x5')},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x7ab2=['STRING','exports','lead','ENUM','contact'];(function(_0x5bbbbb,_0x489e84){var _0x5f2146=function(_0x271f9c){while(--_0x271f9c){_0x5bbbbb['push'](_0x5bbbbb['shift']());}};_0x5f2146(++_0x489e84);}(_0x7ab2,0xb5));var _0x27ab=function(_0x9c3f11,_0x349aea){_0x9c3f11=_0x9c3f11-0x0;var _0x2e1c86=_0x7ab2[_0x9c3f11];return _0x2e1c86;};'use strict';var Sequelize=require('sequelize');module[_0x27ab('0x0')]={'name':{'type':Sequelize['STRING']},'moduleCreate':{'type':Sequelize['ENUM'](_0x27ab('0x1'),'contact','nothing'),'defaultValue':'lead'},'moduleSearch':{'type':Sequelize[_0x27ab('0x2')]('contact_lead',_0x27ab('0x3'),'lead'),'defaultValue':'contact_lead'},'description':{'type':Sequelize[_0x27ab('0x4')]}};
\ No newline at end of file
diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.controller.js b/server/api/intZohoConfiguration/intZohoConfiguration.controller.js
index cbd93b7..2776137 100644
--- a/server/api/intZohoConfiguration/intZohoConfiguration.controller.js
+++ b/server/api/intZohoConfiguration/intZohoConfiguration.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xb194=['create','body','update','params','getFields','findOne','ZohoField','rawAttributes','getSubjects','getDescriptions','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','bluebird','util','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','client','http','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','debug','error','ZohoConfiguration,\x20%s,\x20%s','message','request\x20sent','end','status','json','count','offset','set','Content-Range','apply','reject','save','destroy','stack','send','index','map','ZohoConfiguration','fieldName','type','key','model','keys','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','filters','pick','filter','merge','VIRTUAL','name','options','includeAll','findAll','catch','include','find'];(function(_0x55e08b,_0x421620){var _0xd1a7ff=function(_0x58c7ff){while(--_0x58c7ff){_0x55e08b['push'](_0x55e08b['shift']());}};_0xd1a7ff(++_0x421620);}(_0xb194,0x176));var _0x4b19=function(_0x115f04,_0xdcc29){_0x115f04=_0x115f04-0x0;var _0x204445=_0xb194[_0x115f04];return _0x204445;};'use strict';var pdf=require(_0x4b19('0x0'));var emlformat=require(_0x4b19('0x1'));var rimraf=require(_0x4b19('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4b19('0x3'));var rp=require(_0x4b19('0x4'));var moment=require('moment');var BPromise=require(_0x4b19('0x5'));var Mustache=require('mustache');var util=require(_0x4b19('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x4b19('0x7'));var ejs=require(_0x4b19('0x8'));var fs=require('fs');var _=require(_0x4b19('0x9'));var squel=require(_0x4b19('0xa'));var crypto=require(_0x4b19('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x4b19('0xc'));var toCsv=require(_0x4b19('0x7'));var querystring=require(_0x4b19('0xd'));var Papa=require(_0x4b19('0xe'));var Redis=require(_0x4b19('0xf'));var authService=require(_0x4b19('0x10'));var qs=require(_0x4b19('0x11'));var as=require(_0x4b19('0x12'));var hardwareService=require(_0x4b19('0x13'));var logger=require(_0x4b19('0x14'))(_0x4b19('0x15'));var utils=require('../../config/utils');var config=require(_0x4b19('0x16'));var db=require(_0x4b19('0x17'))['db'];var jayson=require('jayson/promise');var client=jayson[_0x4b19('0x18')][_0x4b19('0x19')]({'port':0x232a});function checkPasswordPattern(_0x3ee85f,_0x142120,_0x365d92){if(_0x365d92){var _0x26ece7=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x26ece7['test'](_0x142120)){return _0x3ee85f;}else{throw new db[(_0x4b19('0x1a'))][(_0x4b19('0x1b'))](_0x4b19('0x1c'));}}else{return _0x3ee85f;}}function respondWithRpcPromise(_0x36946f,_0x4093d5,_0x43c506,_0x49e33f){return new BPromise(function(_0x1db620,_0x5a2cb1){var _0x481e3f=_0x49e33f||client;return _0x481e3f[_0x4b19('0x1d')](_0x36946f,_0x43c506)[_0x4b19('0x1e')](function(_0x39e587){logger[_0x4b19('0x1f')]('ZohoConfiguration,\x20%s,\x20%s',_0x4093d5,'request\x20sent');logger[_0x4b19('0x20')]('ZohoConfiguration,\x20%s,\x20%s,\x20%s',_0x4093d5,'request\x20sent',JSON['stringify'](_0x39e587));if(_0x39e587[_0x4b19('0x21')]){if(_0x39e587['error']['code']===0x1f4){logger[_0x4b19('0x21')](_0x4b19('0x22'),_0x4093d5,_0x39e587[_0x4b19('0x21')][_0x4b19('0x23')]);return _0x5a2cb1(_0x39e587[_0x4b19('0x21')][_0x4b19('0x23')]);}logger[_0x4b19('0x21')]('ZohoConfiguration,\x20%s,\x20%s',_0x4093d5,_0x39e587[_0x4b19('0x21')][_0x4b19('0x23')]);return _0x1db620(_0x39e587['error']['message']);}else{logger[_0x4b19('0x1f')]('ZohoConfiguration,\x20%s,\x20%s',_0x4093d5,_0x4b19('0x24'));_0x1db620(_0x39e587['result'][_0x4b19('0x23')]);}})['catch'](function(_0xdc90e7){logger[_0x4b19('0x21')](_0x4b19('0x22'),_0x4093d5,_0xdc90e7);_0x5a2cb1(_0xdc90e7);});});}function respondWithStatusCode(_0x50b1ef,_0x48db35){_0x48db35=_0x48db35||0xcc;return function(_0x354ac0){if(_0x354ac0){return _0x50b1ef['sendStatus'](_0x48db35);}return _0x50b1ef['status'](_0x48db35)[_0x4b19('0x25')]();};}function respondWithResult(_0x366c9c,_0x1beb90){_0x1beb90=_0x1beb90||0xc8;return function(_0x2a175c){if(_0x2a175c){return _0x366c9c[_0x4b19('0x26')](_0x1beb90)[_0x4b19('0x27')](_0x2a175c);}};}function respondWithFilteredResult(_0x4828f8,_0x3c5145){return function(_0x3c4603){if(_0x3c4603){var _0x403dc1=_0x3c4603[_0x4b19('0x28')],_0xe5a0ae=_0x3c5145[_0x4b19('0x29')],_0x206b64=_0x3c5145[_0x4b19('0x29')]+_0x3c5145['limit'],_0x4c06d3;if(_0x206b64>=_0x403dc1){_0x206b64=_0x403dc1;_0x4c06d3=0xc8;}else{_0x4c06d3=0xce;}_0x4828f8[_0x4b19('0x26')](_0x4c06d3);return _0x4828f8[_0x4b19('0x2a')](_0x4b19('0x2b'),_0xe5a0ae+'-'+_0x206b64+'/'+_0x403dc1)[_0x4b19('0x27')](_0x3c4603);}return null;};}function patchUpdates(_0x50840a){return function(_0x51cffc){try{jsonpatch[_0x4b19('0x2c')](_0x51cffc,_0x50840a,!![]);}catch(_0x5a3120){return BPromise[_0x4b19('0x2d')](_0x5a3120);}return _0x51cffc[_0x4b19('0x2e')]();};}function saveUpdates(_0xe9a79f,_0x4ddd62){return function(_0x4be6c9){if(_0x4be6c9){return _0x4be6c9['update'](_0xe9a79f)[_0x4b19('0x1e')](function(_0x58580e){return _0x58580e;});}return null;};}function removeEntity(_0x40ccbb,_0x33a39e){return function(_0x59e458){if(_0x59e458){return _0x59e458[_0x4b19('0x2f')]()['then'](function(){_0x40ccbb[_0x4b19('0x26')](0xcc)['end']();});}};}function handleEntityNotFound(_0x584a3b,_0x91cf5b){return function(_0x26bf2d){if(!_0x26bf2d){_0x584a3b['sendStatus'](0x194);}return _0x26bf2d;};}function handleError(_0x55e894,_0x1653a9){_0x1653a9=_0x1653a9||0x1f4;return function(_0x101b15){logger['error'](_0x101b15[_0x4b19('0x30')]);if(_0x101b15['name']){delete _0x101b15['name'];}_0x55e894[_0x4b19('0x26')](_0x1653a9)[_0x4b19('0x31')](_0x101b15);};}exports[_0x4b19('0x32')]=function(_0x1cbceb,_0x1ca9da){var _0x50d470={},_0x2285d5={},_0x522593={'count':0x0,'rows':[]};var _0x56488f=_[_0x4b19('0x33')](db[_0x4b19('0x34')]['rawAttributes'],function(_0x4649a2){return{'name':_0x4649a2[_0x4b19('0x35')],'type':_0x4649a2[_0x4b19('0x36')][_0x4b19('0x37')]};});_0x2285d5[_0x4b19('0x38')]=_['map'](_0x56488f,'name');_0x2285d5['query']=_[_0x4b19('0x39')](_0x1cbceb['query']);_0x2285d5['filters']=_[_0x4b19('0x3a')](_0x2285d5[_0x4b19('0x38')],_0x2285d5[_0x4b19('0x3b')]);_0x50d470[_0x4b19('0x3c')]=_[_0x4b19('0x3a')](_0x2285d5[_0x4b19('0x38')],qs[_0x4b19('0x3d')](_0x1cbceb['query'][_0x4b19('0x3d')]));_0x50d470[_0x4b19('0x3c')]=_0x50d470[_0x4b19('0x3c')][_0x4b19('0x3e')]?_0x50d470[_0x4b19('0x3c')]:_0x2285d5['model'];if(!_0x1cbceb[_0x4b19('0x3b')][_0x4b19('0x3f')](_0x4b19('0x40'))){_0x50d470['limit']=qs['limit'](_0x1cbceb['query'][_0x4b19('0x41')]);_0x50d470['offset']=qs[_0x4b19('0x29')](_0x1cbceb[_0x4b19('0x3b')]['offset']);}_0x50d470[_0x4b19('0x42')]=qs[_0x4b19('0x43')](_0x1cbceb[_0x4b19('0x3b')][_0x4b19('0x43')]);_0x50d470[_0x4b19('0x44')]=qs[_0x4b19('0x45')](_[_0x4b19('0x46')](_0x1cbceb['query'],_0x2285d5[_0x4b19('0x45')]),_0x56488f);if(_0x1cbceb[_0x4b19('0x3b')][_0x4b19('0x47')]){_0x50d470[_0x4b19('0x44')]=_[_0x4b19('0x48')](_0x50d470[_0x4b19('0x44')],{'$or':_[_0x4b19('0x33')](_0x56488f,function(_0x1436e9){if(_0x1436e9[_0x4b19('0x36')]!==_0x4b19('0x49')){var _0x178f20={};_0x178f20[_0x1436e9[_0x4b19('0x4a')]]={'$like':'%'+_0x1cbceb['query']['filter']+'%'};return _0x178f20;}})});}_0x50d470=_[_0x4b19('0x48')]({},_0x50d470,_0x1cbceb[_0x4b19('0x4b')]);var _0x37b4e4={'where':_0x50d470[_0x4b19('0x44')]};return db[_0x4b19('0x34')][_0x4b19('0x28')](_0x37b4e4)[_0x4b19('0x1e')](function(_0x5eec93){_0x522593[_0x4b19('0x28')]=_0x5eec93;if(_0x1cbceb[_0x4b19('0x3b')][_0x4b19('0x4c')]){_0x50d470['include']=[{'all':!![]}];}return db['ZohoConfiguration'][_0x4b19('0x4d')](_0x50d470);})[_0x4b19('0x1e')](function(_0x5a04ef){_0x522593['rows']=_0x5a04ef;return _0x522593;})[_0x4b19('0x1e')](respondWithFilteredResult(_0x1ca9da,_0x50d470))[_0x4b19('0x4e')](handleError(_0x1ca9da,null));};exports['show']=function(_0x1c50b2,_0x3c70ca){var _0x1c5fc1={'raw':![],'where':{'id':_0x1c50b2['params']['id']}},_0x6da100={};_0x6da100[_0x4b19('0x38')]=_[_0x4b19('0x39')](db[_0x4b19('0x34')]['rawAttributes']);_0x6da100[_0x4b19('0x3b')]=_[_0x4b19('0x39')](_0x1c50b2['query']);_0x6da100[_0x4b19('0x45')]=_[_0x4b19('0x3a')](_0x6da100[_0x4b19('0x38')],_0x6da100[_0x4b19('0x3b')]);_0x1c5fc1[_0x4b19('0x3c')]=_['intersection'](_0x6da100[_0x4b19('0x38')],qs['fields'](_0x1c50b2[_0x4b19('0x3b')][_0x4b19('0x3d')]));_0x1c5fc1[_0x4b19('0x3c')]=_0x1c5fc1['attributes']['length']?_0x1c5fc1[_0x4b19('0x3c')]:_0x6da100[_0x4b19('0x38')];if(_0x1c50b2[_0x4b19('0x3b')][_0x4b19('0x4c')]){_0x1c5fc1[_0x4b19('0x4f')]=[{'all':!![]}];}_0x1c5fc1=_[_0x4b19('0x48')]({},_0x1c5fc1,_0x1c50b2[_0x4b19('0x4b')]);return db[_0x4b19('0x34')][_0x4b19('0x50')](_0x1c5fc1)[_0x4b19('0x1e')](handleEntityNotFound(_0x3c70ca,null))[_0x4b19('0x1e')](respondWithResult(_0x3c70ca,null))['catch'](handleError(_0x3c70ca,null));};exports['create']=function(_0xb978b5,_0x1b8c80){return db['ZohoConfiguration'][_0x4b19('0x51')](_0xb978b5[_0x4b19('0x52')],{})[_0x4b19('0x1e')](respondWithResult(_0x1b8c80,0xc9))[_0x4b19('0x4e')](handleError(_0x1b8c80,null));};exports[_0x4b19('0x53')]=function(_0x24c635,_0x54c45b){if(_0x24c635[_0x4b19('0x52')]['id']){delete _0x24c635['body']['id'];}return db[_0x4b19('0x34')][_0x4b19('0x50')]({'where':{'id':_0x24c635[_0x4b19('0x54')]['id']}})[_0x4b19('0x1e')](handleEntityNotFound(_0x54c45b,null))[_0x4b19('0x1e')](saveUpdates(_0x24c635[_0x4b19('0x52')],null))[_0x4b19('0x1e')](respondWithResult(_0x54c45b,null))['catch'](handleError(_0x54c45b,null));};exports['destroy']=function(_0x3c8ef6,_0x37efd2){return db[_0x4b19('0x34')][_0x4b19('0x50')]({'where':{'id':_0x3c8ef6[_0x4b19('0x54')]['id']}})[_0x4b19('0x1e')](handleEntityNotFound(_0x37efd2,null))[_0x4b19('0x1e')](removeEntity(_0x37efd2,null))[_0x4b19('0x4e')](handleError(_0x37efd2,null));};exports[_0x4b19('0x55')]=function(_0x13ed80,_0x11f40b,_0x1f5a60){var _0x5463c2={};var _0x525b91={};var _0x226316;var _0x55521f;return db[_0x4b19('0x34')][_0x4b19('0x56')]({'where':{'id':_0x13ed80[_0x4b19('0x54')]['id']}})[_0x4b19('0x1e')](handleEntityNotFound(_0x11f40b,null))['then'](function(_0x2d106c){if(_0x2d106c){_0x226316=_0x2d106c;_0x525b91['model']=_[_0x4b19('0x39')](db[_0x4b19('0x57')][_0x4b19('0x58')]);_0x525b91[_0x4b19('0x3b')]=_[_0x4b19('0x39')](_0x13ed80[_0x4b19('0x3b')]);_0x525b91[_0x4b19('0x45')]=_['intersection'](_0x525b91['model'],_0x525b91[_0x4b19('0x3b')]);_0x5463c2['attributes']=_['intersection'](_0x525b91['model'],qs['fields'](_0x13ed80[_0x4b19('0x3b')]['fields']));_0x5463c2[_0x4b19('0x3c')]=_0x5463c2[_0x4b19('0x3c')][_0x4b19('0x3e')]?_0x5463c2[_0x4b19('0x3c')]:_0x525b91['model'];_0x5463c2['order']=qs[_0x4b19('0x43')](_0x13ed80[_0x4b19('0x3b')][_0x4b19('0x43')]);_0x5463c2[_0x4b19('0x44')]=qs[_0x4b19('0x45')](_[_0x4b19('0x46')](_0x13ed80[_0x4b19('0x3b')],_0x525b91[_0x4b19('0x45')]));if(_0x13ed80[_0x4b19('0x3b')][_0x4b19('0x47')]){_0x5463c2['where']=_[_0x4b19('0x48')](_0x5463c2[_0x4b19('0x44')],{'$or':_[_0x4b19('0x33')](_0x5463c2[_0x4b19('0x3c')],function(_0x4a2cae){var _0x4dbbd7={};_0x4dbbd7[_0x4a2cae]={'$like':'%'+_0x13ed80[_0x4b19('0x3b')][_0x4b19('0x47')]+'%'};return _0x4dbbd7;})});}_0x5463c2=_['merge']({},_0x5463c2,_0x13ed80[_0x4b19('0x4b')]);return _0x226316[_0x4b19('0x55')](_0x5463c2);}})[_0x4b19('0x1e')](function(_0x2aba2b){if(_0x2aba2b){_0x55521f=_0x2aba2b[_0x4b19('0x3e')];if(!_0x13ed80[_0x4b19('0x3b')][_0x4b19('0x3f')](_0x4b19('0x40'))){_0x5463c2['limit']=qs[_0x4b19('0x41')](_0x13ed80[_0x4b19('0x3b')][_0x4b19('0x41')]);_0x5463c2[_0x4b19('0x29')]=qs[_0x4b19('0x29')](_0x13ed80[_0x4b19('0x3b')][_0x4b19('0x29')]);}return _0x226316[_0x4b19('0x55')](_0x5463c2);}})[_0x4b19('0x1e')](function(_0x183c09){if(_0x183c09){return _0x183c09?{'count':_0x55521f,'rows':_0x183c09}:null;}})['then'](respondWithResult(_0x11f40b,null))[_0x4b19('0x4e')](handleError(_0x11f40b,null));};exports['getSubjects']=function(_0x28059d,_0x2742d5,_0x5aed11){var _0x2d2917={};var _0x330b55={};var _0x86bb56;var _0x4922a0;return db['ZohoConfiguration']['findOne']({'where':{'id':_0x28059d[_0x4b19('0x54')]['id']}})[_0x4b19('0x1e')](handleEntityNotFound(_0x2742d5,null))[_0x4b19('0x1e')](function(_0x90f157){if(_0x90f157){_0x86bb56=_0x90f157;_0x330b55[_0x4b19('0x38')]=_[_0x4b19('0x39')](db['ZohoField'][_0x4b19('0x58')]);_0x330b55[_0x4b19('0x3b')]=_['keys'](_0x28059d['query']);_0x330b55[_0x4b19('0x45')]=_['intersection'](_0x330b55[_0x4b19('0x38')],_0x330b55[_0x4b19('0x3b')]);_0x2d2917[_0x4b19('0x3c')]=_[_0x4b19('0x3a')](_0x330b55[_0x4b19('0x38')],qs['fields'](_0x28059d[_0x4b19('0x3b')][_0x4b19('0x3d')]));_0x2d2917[_0x4b19('0x3c')]=_0x2d2917['attributes'][_0x4b19('0x3e')]?_0x2d2917[_0x4b19('0x3c')]:_0x330b55[_0x4b19('0x38')];_0x2d2917['order']=qs['sort'](_0x28059d[_0x4b19('0x3b')][_0x4b19('0x43')]);_0x2d2917['where']=qs['filters'](_[_0x4b19('0x46')](_0x28059d[_0x4b19('0x3b')],_0x330b55[_0x4b19('0x45')]));if(_0x28059d[_0x4b19('0x3b')]['filter']){_0x2d2917[_0x4b19('0x44')]=_[_0x4b19('0x48')](_0x2d2917[_0x4b19('0x44')],{'$or':_['map'](_0x2d2917[_0x4b19('0x3c')],function(_0x35d5df){var _0x56b836={};_0x56b836[_0x35d5df]={'$like':'%'+_0x28059d[_0x4b19('0x3b')]['filter']+'%'};return _0x56b836;})});}_0x2d2917=_[_0x4b19('0x48')]({},_0x2d2917,_0x28059d[_0x4b19('0x4b')]);return _0x86bb56[_0x4b19('0x59')](_0x2d2917);}})[_0x4b19('0x1e')](function(_0x5add4e){if(_0x5add4e){_0x4922a0=_0x5add4e[_0x4b19('0x3e')];if(!_0x28059d['query'][_0x4b19('0x3f')](_0x4b19('0x40'))){_0x2d2917[_0x4b19('0x41')]=qs[_0x4b19('0x41')](_0x28059d['query'][_0x4b19('0x41')]);_0x2d2917[_0x4b19('0x29')]=qs[_0x4b19('0x29')](_0x28059d['query'][_0x4b19('0x29')]);}return _0x86bb56[_0x4b19('0x59')](_0x2d2917);}})[_0x4b19('0x1e')](function(_0x29dffa){if(_0x29dffa){return _0x29dffa?{'count':_0x4922a0,'rows':_0x29dffa}:null;}})[_0x4b19('0x1e')](respondWithResult(_0x2742d5,null))[_0x4b19('0x4e')](handleError(_0x2742d5,null));};exports[_0x4b19('0x5a')]=function(_0x5f14c1,_0xe6fe45,_0xb43d47){var _0x402d9d={};var _0x5b8073={};var _0x1399c2;var _0x441329;return db[_0x4b19('0x34')]['findOne']({'where':{'id':_0x5f14c1[_0x4b19('0x54')]['id']}})[_0x4b19('0x1e')](handleEntityNotFound(_0xe6fe45,null))['then'](function(_0x4aa493){if(_0x4aa493){_0x1399c2=_0x4aa493;_0x5b8073[_0x4b19('0x38')]=_[_0x4b19('0x39')](db[_0x4b19('0x57')]['rawAttributes']);_0x5b8073[_0x4b19('0x3b')]=_['keys'](_0x5f14c1[_0x4b19('0x3b')]);_0x5b8073[_0x4b19('0x45')]=_['intersection'](_0x5b8073[_0x4b19('0x38')],_0x5b8073['query']);_0x402d9d['attributes']=_[_0x4b19('0x3a')](_0x5b8073[_0x4b19('0x38')],qs['fields'](_0x5f14c1['query']['fields']));_0x402d9d[_0x4b19('0x3c')]=_0x402d9d[_0x4b19('0x3c')][_0x4b19('0x3e')]?_0x402d9d[_0x4b19('0x3c')]:_0x5b8073[_0x4b19('0x38')];_0x402d9d[_0x4b19('0x42')]=qs[_0x4b19('0x43')](_0x5f14c1['query'][_0x4b19('0x43')]);_0x402d9d['where']=qs[_0x4b19('0x45')](_[_0x4b19('0x46')](_0x5f14c1['query'],_0x5b8073[_0x4b19('0x45')]));if(_0x5f14c1['query']['filter']){_0x402d9d[_0x4b19('0x44')]=_[_0x4b19('0x48')](_0x402d9d[_0x4b19('0x44')],{'$or':_[_0x4b19('0x33')](_0x402d9d[_0x4b19('0x3c')],function(_0x693e2){var _0x32889f={};_0x32889f[_0x693e2]={'$like':'%'+_0x5f14c1[_0x4b19('0x3b')][_0x4b19('0x47')]+'%'};return _0x32889f;})});}_0x402d9d=_[_0x4b19('0x48')]({},_0x402d9d,_0x5f14c1[_0x4b19('0x4b')]);return _0x1399c2[_0x4b19('0x5a')](_0x402d9d);}})[_0x4b19('0x1e')](function(_0x7578cd){if(_0x7578cd){_0x441329=_0x7578cd[_0x4b19('0x3e')];if(!_0x5f14c1[_0x4b19('0x3b')]['hasOwnProperty'](_0x4b19('0x40'))){_0x402d9d[_0x4b19('0x41')]=qs[_0x4b19('0x41')](_0x5f14c1[_0x4b19('0x3b')][_0x4b19('0x41')]);_0x402d9d[_0x4b19('0x29')]=qs['offset'](_0x5f14c1[_0x4b19('0x3b')][_0x4b19('0x29')]);}return _0x1399c2[_0x4b19('0x5a')](_0x402d9d);}})[_0x4b19('0x1e')](function(_0x45ed58){if(_0x45ed58){return _0x45ed58?{'count':_0x441329,'rows':_0x45ed58}:null;}})['then'](respondWithResult(_0xe6fe45,null))[_0x4b19('0x4e')](handleError(_0xe6fe45,null));};
\ No newline at end of file
+var _0x7011=['stringify','error','code','message','catch','sendStatus','status','end','json','offset','limit','set','Content-Range','apply','reject','save','update','destroy','stack','name','send','index','map','ZohoConfiguration','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','sort','where','pick','merge','VIRTUAL','filter','options','count','includeAll','include','rows','show','params','length','find','create','body','getFields','findOne','ZohoField','order','getSubjects','getDescriptions','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','client','http','Sequelize','request','then','info','ZohoConfiguration,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x565c94,_0x2acc12){var _0x49c3bc=function(_0x1ce798){while(--_0x1ce798){_0x565c94['push'](_0x565c94['shift']());}};_0x49c3bc(++_0x2acc12);}(_0x7011,0x97));var _0x1701=function(_0x528404,_0x27a5ba){_0x528404=_0x528404-0x0;var _0xe59e6b=_0x7011[_0x528404];return _0xe59e6b;};'use strict';var pdf=require(_0x1701('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x1701('0x1'));var zipdir=require(_0x1701('0x2'));var jsonpatch=require(_0x1701('0x3'));var rp=require(_0x1701('0x4'));var moment=require(_0x1701('0x5'));var BPromise=require(_0x1701('0x6'));var Mustache=require('mustache');var util=require(_0x1701('0x7'));var path=require(_0x1701('0x8'));var sox=require(_0x1701('0x9'));var csv=require(_0x1701('0xa'));var ejs=require(_0x1701('0xb'));var fs=require('fs');var _=require(_0x1701('0xc'));var squel=require('squel');var crypto=require(_0x1701('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x1701('0xe'));var toCsv=require('to-csv');var querystring=require(_0x1701('0xf'));var Papa=require(_0x1701('0x10'));var Redis=require(_0x1701('0x11'));var authService=require(_0x1701('0x12'));var qs=require(_0x1701('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1701('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0x1701('0x15'));var config=require(_0x1701('0x16'));var db=require(_0x1701('0x17'))['db'];var jayson=require('jayson/promise');var client=jayson[_0x1701('0x18')][_0x1701('0x19')]({'port':0x232a});function checkPasswordPattern(_0x414019,_0xf6b3fd,_0xb72480){if(_0xb72480){var _0x246fdc=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x246fdc['test'](_0xf6b3fd)){return _0x414019;}else{throw new db[(_0x1701('0x1a'))]['ValidationError']('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x414019;}}function respondWithRpcPromise(_0x5e2591,_0x59cbd8,_0x30c977,_0x119b04){return new BPromise(function(_0x500d5e,_0x4b39a2){var _0x55c070=_0x119b04||client;return _0x55c070[_0x1701('0x1b')](_0x5e2591,_0x30c977)[_0x1701('0x1c')](function(_0x2bc887){logger[_0x1701('0x1d')](_0x1701('0x1e'),_0x59cbd8,_0x1701('0x1f'));logger[_0x1701('0x20')]('ZohoConfiguration,\x20%s,\x20%s,\x20%s',_0x59cbd8,'request\x20sent',JSON[_0x1701('0x21')](_0x2bc887));if(_0x2bc887[_0x1701('0x22')]){if(_0x2bc887[_0x1701('0x22')][_0x1701('0x23')]===0x1f4){logger[_0x1701('0x22')](_0x1701('0x1e'),_0x59cbd8,_0x2bc887[_0x1701('0x22')][_0x1701('0x24')]);return _0x4b39a2(_0x2bc887[_0x1701('0x22')]['message']);}logger['error'](_0x1701('0x1e'),_0x59cbd8,_0x2bc887['error']['message']);return _0x500d5e(_0x2bc887[_0x1701('0x22')][_0x1701('0x24')]);}else{logger[_0x1701('0x1d')]('ZohoConfiguration,\x20%s,\x20%s',_0x59cbd8,_0x1701('0x1f'));_0x500d5e(_0x2bc887['result'][_0x1701('0x24')]);}})[_0x1701('0x25')](function(_0x101231){logger[_0x1701('0x22')](_0x1701('0x1e'),_0x59cbd8,_0x101231);_0x4b39a2(_0x101231);});});}function respondWithStatusCode(_0x3041a2,_0x395cc){_0x395cc=_0x395cc||0xcc;return function(_0x3cde4b){if(_0x3cde4b){return _0x3041a2[_0x1701('0x26')](_0x395cc);}return _0x3041a2[_0x1701('0x27')](_0x395cc)[_0x1701('0x28')]();};}function respondWithResult(_0x4754e2,_0x53c1c7){_0x53c1c7=_0x53c1c7||0xc8;return function(_0x158279){if(_0x158279){return _0x4754e2[_0x1701('0x27')](_0x53c1c7)[_0x1701('0x29')](_0x158279);}};}function respondWithFilteredResult(_0x3ee684,_0x585cce){return function(_0x50f00b){if(_0x50f00b){var _0x39cd48=_0x50f00b['count'],_0x1ee11a=_0x585cce[_0x1701('0x2a')],_0x54b821=_0x585cce['offset']+_0x585cce[_0x1701('0x2b')],_0x15bf03;if(_0x54b821>=_0x39cd48){_0x54b821=_0x39cd48;_0x15bf03=0xc8;}else{_0x15bf03=0xce;}_0x3ee684[_0x1701('0x27')](_0x15bf03);return _0x3ee684[_0x1701('0x2c')](_0x1701('0x2d'),_0x1ee11a+'-'+_0x54b821+'/'+_0x39cd48)[_0x1701('0x29')](_0x50f00b);}return null;};}function patchUpdates(_0x4e933c){return function(_0x4b154b){try{jsonpatch[_0x1701('0x2e')](_0x4b154b,_0x4e933c,!![]);}catch(_0x24df30){return BPromise[_0x1701('0x2f')](_0x24df30);}return _0x4b154b[_0x1701('0x30')]();};}function saveUpdates(_0x34f4c7,_0x1786f8){return function(_0x408258){if(_0x408258){return _0x408258[_0x1701('0x31')](_0x34f4c7)[_0x1701('0x1c')](function(_0x9f347){return _0x9f347;});}return null;};}function removeEntity(_0xf7b7f8,_0x4bc81f){return function(_0x33a58a){if(_0x33a58a){return _0x33a58a[_0x1701('0x32')]()[_0x1701('0x1c')](function(){_0xf7b7f8[_0x1701('0x27')](0xcc)[_0x1701('0x28')]();});}};}function handleEntityNotFound(_0x5be20d,_0x441a3c){return function(_0x5f2600){if(!_0x5f2600){_0x5be20d[_0x1701('0x26')](0x194);}return _0x5f2600;};}function handleError(_0xf6a075,_0x5d6835){_0x5d6835=_0x5d6835||0x1f4;return function(_0x505680){logger['error'](_0x505680[_0x1701('0x33')]);if(_0x505680[_0x1701('0x34')]){delete _0x505680['name'];}_0xf6a075['status'](_0x5d6835)[_0x1701('0x35')](_0x505680);};}exports[_0x1701('0x36')]=function(_0x14b6f2,_0xe23676){var _0x4a495c={},_0x32ef4f={},_0x5d5ec6={'count':0x0,'rows':[]};var _0x1eeb97=_[_0x1701('0x37')](db[_0x1701('0x38')][_0x1701('0x39')],function(_0x157962){return{'name':_0x157962[_0x1701('0x3a')],'type':_0x157962[_0x1701('0x3b')][_0x1701('0x3c')]};});_0x32ef4f[_0x1701('0x3d')]=_[_0x1701('0x37')](_0x1eeb97,_0x1701('0x34'));_0x32ef4f[_0x1701('0x3e')]=_[_0x1701('0x3f')](_0x14b6f2['query']);_0x32ef4f[_0x1701('0x40')]=_[_0x1701('0x41')](_0x32ef4f['model'],_0x32ef4f['query']);_0x4a495c[_0x1701('0x42')]=_[_0x1701('0x41')](_0x32ef4f[_0x1701('0x3d')],qs[_0x1701('0x43')](_0x14b6f2[_0x1701('0x3e')]['fields']));_0x4a495c[_0x1701('0x42')]=_0x4a495c['attributes']['length']?_0x4a495c[_0x1701('0x42')]:_0x32ef4f[_0x1701('0x3d')];if(!_0x14b6f2[_0x1701('0x3e')][_0x1701('0x44')]('nolimit')){_0x4a495c[_0x1701('0x2b')]=qs['limit'](_0x14b6f2[_0x1701('0x3e')][_0x1701('0x2b')]);_0x4a495c['offset']=qs[_0x1701('0x2a')](_0x14b6f2[_0x1701('0x3e')]['offset']);}_0x4a495c['order']=qs['sort'](_0x14b6f2[_0x1701('0x3e')][_0x1701('0x45')]);_0x4a495c[_0x1701('0x46')]=qs['filters'](_[_0x1701('0x47')](_0x14b6f2[_0x1701('0x3e')],_0x32ef4f[_0x1701('0x40')]),_0x1eeb97);if(_0x14b6f2[_0x1701('0x3e')]['filter']){_0x4a495c[_0x1701('0x46')]=_[_0x1701('0x48')](_0x4a495c[_0x1701('0x46')],{'$or':_[_0x1701('0x37')](_0x1eeb97,function(_0x44046d){if(_0x44046d[_0x1701('0x3b')]!==_0x1701('0x49')){var _0x5c0323={};_0x5c0323[_0x44046d[_0x1701('0x34')]]={'$like':'%'+_0x14b6f2[_0x1701('0x3e')][_0x1701('0x4a')]+'%'};return _0x5c0323;}})});}_0x4a495c=_[_0x1701('0x48')]({},_0x4a495c,_0x14b6f2[_0x1701('0x4b')]);var _0x4decfe={'where':_0x4a495c[_0x1701('0x46')]};return db[_0x1701('0x38')][_0x1701('0x4c')](_0x4decfe)[_0x1701('0x1c')](function(_0xb08e05){_0x5d5ec6[_0x1701('0x4c')]=_0xb08e05;if(_0x14b6f2[_0x1701('0x3e')][_0x1701('0x4d')]){_0x4a495c[_0x1701('0x4e')]=[{'all':!![]}];}return db[_0x1701('0x38')]['findAll'](_0x4a495c);})[_0x1701('0x1c')](function(_0x17b74d){_0x5d5ec6[_0x1701('0x4f')]=_0x17b74d;return _0x5d5ec6;})[_0x1701('0x1c')](respondWithFilteredResult(_0xe23676,_0x4a495c))[_0x1701('0x25')](handleError(_0xe23676,null));};exports[_0x1701('0x50')]=function(_0x3046d7,_0x4f021a){var _0x55c8bd={'raw':![],'where':{'id':_0x3046d7[_0x1701('0x51')]['id']}},_0x28c78a={};_0x28c78a[_0x1701('0x3d')]=_['keys'](db[_0x1701('0x38')][_0x1701('0x39')]);_0x28c78a[_0x1701('0x3e')]=_['keys'](_0x3046d7[_0x1701('0x3e')]);_0x28c78a['filters']=_[_0x1701('0x41')](_0x28c78a[_0x1701('0x3d')],_0x28c78a[_0x1701('0x3e')]);_0x55c8bd[_0x1701('0x42')]=_[_0x1701('0x41')](_0x28c78a[_0x1701('0x3d')],qs['fields'](_0x3046d7[_0x1701('0x3e')][_0x1701('0x43')]));_0x55c8bd[_0x1701('0x42')]=_0x55c8bd[_0x1701('0x42')][_0x1701('0x52')]?_0x55c8bd[_0x1701('0x42')]:_0x28c78a['model'];if(_0x3046d7[_0x1701('0x3e')][_0x1701('0x4d')]){_0x55c8bd[_0x1701('0x4e')]=[{'all':!![]}];}_0x55c8bd=_['merge']({},_0x55c8bd,_0x3046d7[_0x1701('0x4b')]);return db[_0x1701('0x38')][_0x1701('0x53')](_0x55c8bd)['then'](handleEntityNotFound(_0x4f021a,null))[_0x1701('0x1c')](respondWithResult(_0x4f021a,null))[_0x1701('0x25')](handleError(_0x4f021a,null));};exports[_0x1701('0x54')]=function(_0x1be459,_0x438560){return db['ZohoConfiguration'][_0x1701('0x54')](_0x1be459[_0x1701('0x55')],{})[_0x1701('0x1c')](respondWithResult(_0x438560,0xc9))[_0x1701('0x25')](handleError(_0x438560,null));};exports['update']=function(_0x2471e0,_0x51d7b8){if(_0x2471e0[_0x1701('0x55')]['id']){delete _0x2471e0[_0x1701('0x55')]['id'];}return db[_0x1701('0x38')]['find']({'where':{'id':_0x2471e0[_0x1701('0x51')]['id']}})[_0x1701('0x1c')](handleEntityNotFound(_0x51d7b8,null))[_0x1701('0x1c')](saveUpdates(_0x2471e0['body'],null))[_0x1701('0x1c')](respondWithResult(_0x51d7b8,null))['catch'](handleError(_0x51d7b8,null));};exports[_0x1701('0x32')]=function(_0x320abe,_0x397bf8){return db['ZohoConfiguration'][_0x1701('0x53')]({'where':{'id':_0x320abe['params']['id']}})[_0x1701('0x1c')](handleEntityNotFound(_0x397bf8,null))[_0x1701('0x1c')](removeEntity(_0x397bf8,null))[_0x1701('0x25')](handleError(_0x397bf8,null));};exports[_0x1701('0x56')]=function(_0x203892,_0x13800,_0x59b434){var _0x443f35={};var _0x337903={};var _0x16c546;var _0x2e55d0;return db[_0x1701('0x38')][_0x1701('0x57')]({'where':{'id':_0x203892[_0x1701('0x51')]['id']}})[_0x1701('0x1c')](handleEntityNotFound(_0x13800,null))['then'](function(_0x3df6bf){if(_0x3df6bf){_0x16c546=_0x3df6bf;_0x337903[_0x1701('0x3d')]=_[_0x1701('0x3f')](db[_0x1701('0x58')][_0x1701('0x39')]);_0x337903['query']=_['keys'](_0x203892['query']);_0x337903['filters']=_[_0x1701('0x41')](_0x337903[_0x1701('0x3d')],_0x337903[_0x1701('0x3e')]);_0x443f35[_0x1701('0x42')]=_[_0x1701('0x41')](_0x337903['model'],qs[_0x1701('0x43')](_0x203892[_0x1701('0x3e')]['fields']));_0x443f35[_0x1701('0x42')]=_0x443f35['attributes'][_0x1701('0x52')]?_0x443f35[_0x1701('0x42')]:_0x337903[_0x1701('0x3d')];_0x443f35[_0x1701('0x59')]=qs[_0x1701('0x45')](_0x203892[_0x1701('0x3e')][_0x1701('0x45')]);_0x443f35['where']=qs['filters'](_['pick'](_0x203892[_0x1701('0x3e')],_0x337903[_0x1701('0x40')]));if(_0x203892[_0x1701('0x3e')]['filter']){_0x443f35['where']=_[_0x1701('0x48')](_0x443f35[_0x1701('0x46')],{'$or':_['map'](_0x443f35[_0x1701('0x42')],function(_0x238a61){var _0x480278={};_0x480278[_0x238a61]={'$like':'%'+_0x203892[_0x1701('0x3e')][_0x1701('0x4a')]+'%'};return _0x480278;})});}_0x443f35=_[_0x1701('0x48')]({},_0x443f35,_0x203892[_0x1701('0x4b')]);return _0x16c546[_0x1701('0x56')](_0x443f35);}})['then'](function(_0x3a2abe){if(_0x3a2abe){_0x2e55d0=_0x3a2abe[_0x1701('0x52')];if(!_0x203892[_0x1701('0x3e')][_0x1701('0x44')]('nolimit')){_0x443f35['limit']=qs[_0x1701('0x2b')](_0x203892['query'][_0x1701('0x2b')]);_0x443f35['offset']=qs[_0x1701('0x2a')](_0x203892[_0x1701('0x3e')][_0x1701('0x2a')]);}return _0x16c546['getFields'](_0x443f35);}})[_0x1701('0x1c')](function(_0x43a8cd){if(_0x43a8cd){return _0x43a8cd?{'count':_0x2e55d0,'rows':_0x43a8cd}:null;}})['then'](respondWithResult(_0x13800,null))[_0x1701('0x25')](handleError(_0x13800,null));};exports[_0x1701('0x5a')]=function(_0x1008e4,_0x2415e6,_0x3b802d){var _0x425344={};var _0xa50509={};var _0x2a8b2e;var _0x3083d7;return db[_0x1701('0x38')][_0x1701('0x57')]({'where':{'id':_0x1008e4['params']['id']}})[_0x1701('0x1c')](handleEntityNotFound(_0x2415e6,null))[_0x1701('0x1c')](function(_0x17975f){if(_0x17975f){_0x2a8b2e=_0x17975f;_0xa50509[_0x1701('0x3d')]=_[_0x1701('0x3f')](db[_0x1701('0x58')][_0x1701('0x39')]);_0xa50509[_0x1701('0x3e')]=_[_0x1701('0x3f')](_0x1008e4['query']);_0xa50509['filters']=_[_0x1701('0x41')](_0xa50509[_0x1701('0x3d')],_0xa50509[_0x1701('0x3e')]);_0x425344['attributes']=_['intersection'](_0xa50509['model'],qs[_0x1701('0x43')](_0x1008e4[_0x1701('0x3e')][_0x1701('0x43')]));_0x425344[_0x1701('0x42')]=_0x425344[_0x1701('0x42')][_0x1701('0x52')]?_0x425344['attributes']:_0xa50509['model'];_0x425344[_0x1701('0x59')]=qs[_0x1701('0x45')](_0x1008e4[_0x1701('0x3e')]['sort']);_0x425344['where']=qs[_0x1701('0x40')](_[_0x1701('0x47')](_0x1008e4[_0x1701('0x3e')],_0xa50509[_0x1701('0x40')]));if(_0x1008e4[_0x1701('0x3e')][_0x1701('0x4a')]){_0x425344[_0x1701('0x46')]=_[_0x1701('0x48')](_0x425344[_0x1701('0x46')],{'$or':_[_0x1701('0x37')](_0x425344[_0x1701('0x42')],function(_0x19d057){var _0x123faf={};_0x123faf[_0x19d057]={'$like':'%'+_0x1008e4[_0x1701('0x3e')][_0x1701('0x4a')]+'%'};return _0x123faf;})});}_0x425344=_[_0x1701('0x48')]({},_0x425344,_0x1008e4['options']);return _0x2a8b2e[_0x1701('0x5a')](_0x425344);}})[_0x1701('0x1c')](function(_0xa37bd6){if(_0xa37bd6){_0x3083d7=_0xa37bd6['length'];if(!_0x1008e4[_0x1701('0x3e')][_0x1701('0x44')]('nolimit')){_0x425344[_0x1701('0x2b')]=qs[_0x1701('0x2b')](_0x1008e4[_0x1701('0x3e')]['limit']);_0x425344[_0x1701('0x2a')]=qs[_0x1701('0x2a')](_0x1008e4[_0x1701('0x3e')][_0x1701('0x2a')]);}return _0x2a8b2e[_0x1701('0x5a')](_0x425344);}})[_0x1701('0x1c')](function(_0x1497fd){if(_0x1497fd){return _0x1497fd?{'count':_0x3083d7,'rows':_0x1497fd}:null;}})[_0x1701('0x1c')](respondWithResult(_0x2415e6,null))[_0x1701('0x25')](handleError(_0x2415e6,null));};exports[_0x1701('0x5b')]=function(_0x411824,_0x53cf0f,_0x227d65){var _0x2a9060={};var _0x2bb895={};var _0x47e75d;var _0x40d2c1;return db[_0x1701('0x38')][_0x1701('0x57')]({'where':{'id':_0x411824['params']['id']}})[_0x1701('0x1c')](handleEntityNotFound(_0x53cf0f,null))[_0x1701('0x1c')](function(_0x4af21c){if(_0x4af21c){_0x47e75d=_0x4af21c;_0x2bb895['model']=_['keys'](db['ZohoField'][_0x1701('0x39')]);_0x2bb895[_0x1701('0x3e')]=_[_0x1701('0x3f')](_0x411824['query']);_0x2bb895[_0x1701('0x40')]=_[_0x1701('0x41')](_0x2bb895[_0x1701('0x3d')],_0x2bb895['query']);_0x2a9060['attributes']=_[_0x1701('0x41')](_0x2bb895[_0x1701('0x3d')],qs['fields'](_0x411824[_0x1701('0x3e')]['fields']));_0x2a9060['attributes']=_0x2a9060['attributes'][_0x1701('0x52')]?_0x2a9060[_0x1701('0x42')]:_0x2bb895[_0x1701('0x3d')];_0x2a9060[_0x1701('0x59')]=qs[_0x1701('0x45')](_0x411824[_0x1701('0x3e')]['sort']);_0x2a9060[_0x1701('0x46')]=qs['filters'](_['pick'](_0x411824[_0x1701('0x3e')],_0x2bb895[_0x1701('0x40')]));if(_0x411824[_0x1701('0x3e')][_0x1701('0x4a')]){_0x2a9060[_0x1701('0x46')]=_[_0x1701('0x48')](_0x2a9060[_0x1701('0x46')],{'$or':_[_0x1701('0x37')](_0x2a9060[_0x1701('0x42')],function(_0x5dd0a9){var _0x312f9b={};_0x312f9b[_0x5dd0a9]={'$like':'%'+_0x411824[_0x1701('0x3e')][_0x1701('0x4a')]+'%'};return _0x312f9b;})});}_0x2a9060=_['merge']({},_0x2a9060,_0x411824[_0x1701('0x4b')]);return _0x47e75d[_0x1701('0x5b')](_0x2a9060);}})[_0x1701('0x1c')](function(_0x2f0104){if(_0x2f0104){_0x40d2c1=_0x2f0104[_0x1701('0x52')];if(!_0x411824[_0x1701('0x3e')][_0x1701('0x44')]('nolimit')){_0x2a9060[_0x1701('0x2b')]=qs['limit'](_0x411824[_0x1701('0x3e')]['limit']);_0x2a9060[_0x1701('0x2a')]=qs['offset'](_0x411824[_0x1701('0x3e')][_0x1701('0x2a')]);}return _0x47e75d['getDescriptions'](_0x2a9060);}})['then'](function(_0x49b457){if(_0x49b457){return _0x49b457?{'count':_0x40d2c1,'rows':_0x49b457}:null;}})[_0x1701('0x1c')](respondWithResult(_0x53cf0f,null))[_0x1701('0x25')](handleError(_0x53cf0f,null));};
\ No newline at end of file
diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.model.js b/server/api/intZohoConfiguration/intZohoConfiguration.model.js
index 9c5ccbe..08f3f19 100644
--- a/server/api/intZohoConfiguration/intZohoConfiguration.model.js
+++ b/server/api/intZohoConfiguration/intZohoConfiguration.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xbbf7=['request-promise','rimraf','./intZohoConfiguration.attributes','exports','define','int_zoho_configurations','lodash','moment','bluebird'];(function(_0x426b32,_0x3f777d){var _0x20e3a5=function(_0x357c7f){while(--_0x357c7f){_0x426b32['push'](_0x426b32['shift']());}};_0x20e3a5(++_0x3f777d);}(_0xbbf7,0x189));var _0x7bbf=function(_0xe4e4fe,_0x2526b2){_0xe4e4fe=_0xe4e4fe-0x0;var _0x4dc260=_0xbbf7[_0xe4e4fe];return _0x4dc260;};'use strict';var _=require(_0x7bbf('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x7bbf('0x1'));var BPromise=require(_0x7bbf('0x2'));var rp=require(_0x7bbf('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7bbf('0x4'));var config=require('../../config/environment');var attributes=require(_0x7bbf('0x5'));module[_0x7bbf('0x6')]=function(_0x5f4fb7,_0x42fe24){return _0x5f4fb7[_0x7bbf('0x7')]('ZohoConfiguration',attributes,{'tableName':_0x7bbf('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x680c=['int_zoho_configurations','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','exports','ZohoConfiguration'];(function(_0x2dfffc,_0x2e3e5f){var _0x531c59=function(_0x52f546){while(--_0x52f546){_0x2dfffc['push'](_0x2dfffc['shift']());}};_0x531c59(++_0x2e3e5f);}(_0x680c,0x169));var _0xc680=function(_0x5cd51d,_0x20d4fa){_0x5cd51d=_0x5cd51d-0x0;var _0x444608=_0x680c[_0x5cd51d];return _0x444608;};'use strict';var _=require(_0xc680('0x0'));var util=require(_0xc680('0x1'));var logger=require(_0xc680('0x2'))(_0xc680('0x3'));var moment=require(_0xc680('0x4'));var BPromise=require(_0xc680('0x5'));var rp=require(_0xc680('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xc680('0x7'));var config=require(_0xc680('0x8'));var attributes=require('./intZohoConfiguration.attributes');module[_0xc680('0x9')]=function(_0x5a46a6,_0x3ae3e2){return _0x5a46a6['define'](_0xc680('0xa'),attributes,{'tableName':_0xc680('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.rpc.js b/server/api/intZohoConfiguration/intZohoConfiguration.rpc.js
index 9400eb5..bb34732 100644
--- a/server/api/intZohoConfiguration/intZohoConfiguration.rpc.js
+++ b/server/api/intZohoConfiguration/intZohoConfiguration.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7977=['lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','request','ZohoConfiguration,\x20%s,\x20%s','request\x20sent','debug','ZohoConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch'];(function(_0x1e8350,_0x1cff0a){var _0x5c567e=function(_0x560126){while(--_0x560126){_0x1e8350['push'](_0x1e8350['shift']());}};_0x5c567e(++_0x1cff0a);}(_0x7977,0x1b9));var _0x7797=function(_0x1789bc,_0x1acf84){_0x1789bc=_0x1789bc-0x0;var _0x35efd1=_0x7977[_0x1789bc];return _0x35efd1;};'use strict';var _=require(_0x7797('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x7797('0x1'));var rs=require(_0x7797('0x2'));var fs=require('fs');var Redis=require(_0x7797('0x3'));var db=require(_0x7797('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x7797('0x5'))('rpc');var config=require(_0x7797('0x6'));var jayson=require(_0x7797('0x7'));var client=jayson[_0x7797('0x8')][_0x7797('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2f55cf,_0x12dc9e,_0xa8cb25){return new BPromise(function(_0x3fe6dd,_0x1dab01){return client[_0x7797('0xa')](_0x2f55cf,_0xa8cb25)['then'](function(_0xc5f4c7){logger['info'](_0x7797('0xb'),_0x12dc9e,_0x7797('0xc'));logger[_0x7797('0xd')](_0x7797('0xe'),_0x12dc9e,_0x7797('0xc'),JSON[_0x7797('0xf')](_0xc5f4c7));if(_0xc5f4c7['error']){if(_0xc5f4c7[_0x7797('0x10')][_0x7797('0x11')]===0x1f4){logger[_0x7797('0x10')]('ZohoConfiguration,\x20%s,\x20%s',_0x12dc9e,_0xc5f4c7[_0x7797('0x10')][_0x7797('0x12')]);return _0x1dab01(_0xc5f4c7[_0x7797('0x10')]['message']);}logger[_0x7797('0x10')]('ZohoConfiguration,\x20%s,\x20%s',_0x12dc9e,_0xc5f4c7[_0x7797('0x10')]['message']);return _0x3fe6dd(_0xc5f4c7[_0x7797('0x10')]['message']);}else{logger[_0x7797('0x13')](_0x7797('0xb'),_0x12dc9e,_0x7797('0xc'));_0x3fe6dd(_0xc5f4c7['result'][_0x7797('0x12')]);}})[_0x7797('0x14')](function(_0x3701a8){logger[_0x7797('0x10')](_0x7797('0xb'),_0x12dc9e,_0x3701a8);_0x1dab01(_0x3701a8);});});}
\ No newline at end of file
+var _0x2e9d=['../../config/environment','http','request','then','ZohoConfiguration,\x20%s,\x20%s','request\x20sent','debug','ZohoConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0xa987c1,_0x55e7a9){var _0x362b9c=function(_0x5075b5){while(--_0x5075b5){_0xa987c1['push'](_0xa987c1['shift']());}};_0x362b9c(++_0x55e7a9);}(_0x2e9d,0x99));var _0xd2e9=function(_0x273c39,_0x1052e6){_0x273c39=_0x273c39-0x0;var _0x46d6b5=_0x2e9d[_0x273c39];return _0x46d6b5;};'use strict';var _=require(_0xd2e9('0x0'));var util=require('util');var moment=require(_0xd2e9('0x1'));var BPromise=require(_0xd2e9('0x2'));var rs=require(_0xd2e9('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd2e9('0x4'))['db'];var utils=require(_0xd2e9('0x5'));var logger=require(_0xd2e9('0x6'))(_0xd2e9('0x7'));var config=require(_0xd2e9('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0xd2e9('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x39348a,_0x322168,_0x5b89ae){return new BPromise(function(_0xff9ffb,_0x232eab){return client[_0xd2e9('0xa')](_0x39348a,_0x5b89ae)[_0xd2e9('0xb')](function(_0x269f5d){logger['info'](_0xd2e9('0xc'),_0x322168,_0xd2e9('0xd'));logger[_0xd2e9('0xe')](_0xd2e9('0xf'),_0x322168,'request\x20sent',JSON[_0xd2e9('0x10')](_0x269f5d));if(_0x269f5d[_0xd2e9('0x11')]){if(_0x269f5d[_0xd2e9('0x11')][_0xd2e9('0x12')]===0x1f4){logger['error']('ZohoConfiguration,\x20%s,\x20%s',_0x322168,_0x269f5d[_0xd2e9('0x11')][_0xd2e9('0x13')]);return _0x232eab(_0x269f5d[_0xd2e9('0x11')][_0xd2e9('0x13')]);}logger[_0xd2e9('0x11')](_0xd2e9('0xc'),_0x322168,_0x269f5d[_0xd2e9('0x11')][_0xd2e9('0x13')]);return _0xff9ffb(_0x269f5d[_0xd2e9('0x11')][_0xd2e9('0x13')]);}else{logger[_0xd2e9('0x14')](_0xd2e9('0xc'),_0x322168,'request\x20sent');_0xff9ffb(_0x269f5d[_0xd2e9('0x15')]['message']);}})[_0xd2e9('0x16')](function(_0x1d5dde){logger[_0xd2e9('0x11')](_0xd2e9('0xc'),_0x322168,_0x1d5dde);_0x232eab(_0x1d5dde);});});}
\ No newline at end of file
diff --git a/server/api/intZohoField/index.js b/server/api/intZohoField/index.js
index b430cfc..c797508 100644
--- a/server/api/intZohoField/index.js
+++ b/server/api/intZohoField/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x2a07=['isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZohoField.controller','get'];(function(_0x16a637,_0x5eb627){var _0x25126d=function(_0x54e016){while(--_0x54e016){_0x16a637['push'](_0x16a637['shift']());}};_0x25126d(++_0x5eb627);}(_0x2a07,0x74));var _0x72a0=function(_0x5b7696,_0x3ebd92){_0x5b7696=_0x5b7696-0x0;var _0x42d7b9=_0x2a07[_0x5b7696];return _0x42d7b9;};'use strict';var multer=require(_0x72a0('0x0'));var util=require(_0x72a0('0x1'));var path=require(_0x72a0('0x2'));var timeout=require(_0x72a0('0x3'));var express=require(_0x72a0('0x4'));var router=express['Router']();var auth=require(_0x72a0('0x5'));var interaction=require(_0x72a0('0x6'));var config=require(_0x72a0('0x7'));var controller=require(_0x72a0('0x8'));router[_0x72a0('0x9')]('/',auth[_0x72a0('0xa')](),controller[_0x72a0('0xb')]);router[_0x72a0('0x9')](_0x72a0('0xc'),auth[_0x72a0('0xa')](),controller[_0x72a0('0xd')]);router[_0x72a0('0xe')]('/',auth[_0x72a0('0xa')](),controller[_0x72a0('0xf')]);router[_0x72a0('0x10')](_0x72a0('0xc'),auth['isAuthenticated'](),controller[_0x72a0('0x11')]);router[_0x72a0('0x12')]('/:id',auth[_0x72a0('0xa')](),controller[_0x72a0('0x13')]);module[_0x72a0('0x14')]=router;
\ No newline at end of file
+var _0x3a6d=['delete','destroy','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./intZohoField.controller','get','isAuthenticated','index','/:id','show','post','create','put','update'];(function(_0xa199bb,_0x442bd6){var _0x3b7da6=function(_0x3fa1d9){while(--_0x3fa1d9){_0xa199bb['push'](_0xa199bb['shift']());}};_0x3b7da6(++_0x442bd6);}(_0x3a6d,0x143));var _0xd3a6=function(_0x5f1391,_0x19c132){_0x5f1391=_0x5f1391-0x0;var _0x50ebe3=_0x3a6d[_0x5f1391];return _0x50ebe3;};'use strict';var multer=require(_0xd3a6('0x0'));var util=require(_0xd3a6('0x1'));var path=require('path');var timeout=require(_0xd3a6('0x2'));var express=require(_0xd3a6('0x3'));var router=express[_0xd3a6('0x4')]();var auth=require(_0xd3a6('0x5'));var interaction=require(_0xd3a6('0x6'));var config=require('../../config/environment');var controller=require(_0xd3a6('0x7'));router[_0xd3a6('0x8')]('/',auth[_0xd3a6('0x9')](),controller[_0xd3a6('0xa')]);router[_0xd3a6('0x8')](_0xd3a6('0xb'),auth['isAuthenticated'](),controller[_0xd3a6('0xc')]);router[_0xd3a6('0xd')]('/',auth[_0xd3a6('0x9')](),controller[_0xd3a6('0xe')]);router[_0xd3a6('0xf')](_0xd3a6('0xb'),auth[_0xd3a6('0x9')](),controller[_0xd3a6('0x10')]);router[_0xd3a6('0x11')]('/:id',auth[_0xd3a6('0x9')](),controller[_0xd3a6('0x12')]);module[_0xd3a6('0x13')]=router;
\ No newline at end of file
diff --git a/server/api/intZohoField/intZohoField.attributes.js b/server/api/intZohoField/intZohoField.attributes.js
index 2fdb5f3..1ff9e1d 100644
--- a/server/api/intZohoField/intZohoField.attributes.js
+++ b/server/api/intZohoField/intZohoField.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x2e8a=['string','STRING','BOOLEAN','exports','ENUM','variable','customVariable'];(function(_0xe0e53b,_0x243a2f){var _0x4781bc=function(_0x3c9cf5){while(--_0x3c9cf5){_0xe0e53b['push'](_0xe0e53b['shift']());}};_0x4781bc(++_0x243a2f);}(_0x2e8a,0xc7));var _0xa2e8=function(_0x5bce6d,_0x3d3b72){_0x5bce6d=_0x5bce6d-0x0;var _0x4ee73c=_0x2e8a[_0x5bce6d];return _0x4ee73c;};'use strict';var Sequelize=require('sequelize');module[_0xa2e8('0x0')]={'type':{'type':Sequelize[_0xa2e8('0x1')]('string',_0xa2e8('0x2'),_0xa2e8('0x3'),'keyValue'),'defaultValue':_0xa2e8('0x4')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize['ENUM']('string',_0xa2e8('0x2'),_0xa2e8('0x3'))},'keyContent':{'type':Sequelize[_0xa2e8('0x5')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0xa2e8('0x5')]},'customField':{'type':Sequelize[_0xa2e8('0x6')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xa2e8('0x5')]}};
\ No newline at end of file
+var _0xf61e=['string','STRING','variable','BOOLEAN','sequelize','exports','ENUM','customVariable','keyValue'];(function(_0x102ff9,_0x907658){var _0x24fa97=function(_0x3622ff){while(--_0x3622ff){_0x102ff9['push'](_0x102ff9['shift']());}};_0x24fa97(++_0x907658);}(_0xf61e,0x82));var _0xef61=function(_0x1d4921,_0x5ef98a){_0x1d4921=_0x1d4921-0x0;var _0x45ac85=_0xf61e[_0x1d4921];return _0x45ac85;};'use strict';var Sequelize=require(_0xef61('0x0'));module[_0xef61('0x1')]={'type':{'type':Sequelize[_0xef61('0x2')]('string','variable',_0xef61('0x3'),_0xef61('0x4')),'defaultValue':_0xef61('0x5')},'content':{'type':Sequelize[_0xef61('0x6')]},'key':{'type':Sequelize[_0xef61('0x6')]},'keyType':{'type':Sequelize[_0xef61('0x2')](_0xef61('0x5'),_0xef61('0x7'),_0xef61('0x3'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0xef61('0x6')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0xef61('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xef61('0x6')]}};
\ No newline at end of file
diff --git a/server/api/intZohoField/intZohoField.controller.js b/server/api/intZohoField/intZohoField.controller.js
index 692a110..693083f 100644
--- a/server/api/intZohoField/intZohoField.controller.js
+++ b/server/api/intZohoField/intZohoField.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xa9e0=['sort','where','pick','filter','VIRTUAL','merge','options','include','findAll','catch','params','includeAll','create','body','find','html-pdf','eml-format','rimraf','request-promise','bluebird','mustache','util','path','sox','ejs','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../mysqldb','sendStatus','status','json','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','end','error','name','send','index','map','ZohoField','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','limit'];(function(_0x14b62e,_0x3b8096){var _0x42ad69=function(_0x1d537a){while(--_0x1d537a){_0x14b62e['push'](_0x14b62e['shift']());}};_0x42ad69(++_0x3b8096);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0xa9e0[_0x1facfa];return _0x9ec701;};'use strict';var pdf=require(_0x0a9e('0x0'));var emlformat=require(_0x0a9e('0x1'));var rimraf=require(_0x0a9e('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0a9e('0x3'));var moment=require('moment');var BPromise=require(_0x0a9e('0x4'));var Mustache=require(_0x0a9e('0x5'));var util=require(_0x0a9e('0x6'));var path=require(_0x0a9e('0x7'));var sox=require(_0x0a9e('0x8'));var csv=require('to-csv');var ejs=require(_0x0a9e('0x9'));var fs=require('fs');var _=require(_0x0a9e('0xa'));var squel=require(_0x0a9e('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0a9e('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0a9e('0xd'));var Redis=require(_0x0a9e('0xe'));var authService=require(_0x0a9e('0xf'));var qs=require(_0x0a9e('0x10'));var as=require(_0x0a9e('0x11'));var hardwareService=require(_0x0a9e('0x12'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x0a9e('0x13'))['db'];function respondWithStatusCode(_0x36471c,_0xd5b662){_0xd5b662=_0xd5b662||0xcc;return function(_0x26d672){if(_0x26d672){return _0x36471c[_0x0a9e('0x14')](_0xd5b662);}return _0x36471c[_0x0a9e('0x15')](_0xd5b662)['end']();};}function respondWithResult(_0x4283ce,_0x239b12){_0x239b12=_0x239b12||0xc8;return function(_0x2b4227){if(_0x2b4227){return _0x4283ce[_0x0a9e('0x15')](_0x239b12)[_0x0a9e('0x16')](_0x2b4227);}};}function respondWithFilteredResult(_0x4d5611,_0x52a03d){return function(_0x22dccb){if(_0x22dccb){var _0x5d0880=_0x22dccb[_0x0a9e('0x17')],_0x1985b6=_0x52a03d['offset'],_0x519dfd=_0x52a03d[_0x0a9e('0x18')]+_0x52a03d['limit'],_0x16033c;if(_0x519dfd>=_0x5d0880){_0x519dfd=_0x5d0880;_0x16033c=0xc8;}else{_0x16033c=0xce;}_0x4d5611[_0x0a9e('0x15')](_0x16033c);return _0x4d5611[_0x0a9e('0x19')](_0x0a9e('0x1a'),_0x1985b6+'-'+_0x519dfd+'/'+_0x5d0880)[_0x0a9e('0x16')](_0x22dccb);}return null;};}function patchUpdates(_0x31b1ca){return function(_0x2eb11f){try{jsonpatch[_0x0a9e('0x1b')](_0x2eb11f,_0x31b1ca,!![]);}catch(_0x20559e){return BPromise[_0x0a9e('0x1c')](_0x20559e);}return _0x2eb11f[_0x0a9e('0x1d')]();};}function saveUpdates(_0x1c696a,_0x105080){return function(_0x4bb1e3){if(_0x4bb1e3){return _0x4bb1e3[_0x0a9e('0x1e')](_0x1c696a)[_0x0a9e('0x1f')](function(_0x53682f){return _0x53682f;});}return null;};}function removeEntity(_0x20f109,_0x5a09ef){return function(_0x588269){if(_0x588269){return _0x588269[_0x0a9e('0x20')]()[_0x0a9e('0x1f')](function(){_0x20f109[_0x0a9e('0x15')](0xcc)[_0x0a9e('0x21')]();});}};}function handleEntityNotFound(_0x4abc77,_0xfb6e48){return function(_0x2fb0e4){if(!_0x2fb0e4){_0x4abc77[_0x0a9e('0x14')](0x194);}return _0x2fb0e4;};}function handleError(_0x4d00e6,_0x370d86){_0x370d86=_0x370d86||0x1f4;return function(_0x42ac8f){logger[_0x0a9e('0x22')](_0x42ac8f['stack']);if(_0x42ac8f['name']){delete _0x42ac8f[_0x0a9e('0x23')];}_0x4d00e6[_0x0a9e('0x15')](_0x370d86)[_0x0a9e('0x24')](_0x42ac8f);};}exports[_0x0a9e('0x25')]=function(_0x526cf3,_0x384319){var _0x479bc4={},_0x45a1e7={},_0x5bfb33={'count':0x0,'rows':[]};var _0x1dc186=_[_0x0a9e('0x26')](db[_0x0a9e('0x27')][_0x0a9e('0x28')],function(_0x140511){return{'name':_0x140511[_0x0a9e('0x29')],'type':_0x140511[_0x0a9e('0x2a')][_0x0a9e('0x2b')]};});_0x45a1e7['model']=_[_0x0a9e('0x26')](_0x1dc186,_0x0a9e('0x23'));_0x45a1e7[_0x0a9e('0x2c')]=_[_0x0a9e('0x2d')](_0x526cf3['query']);_0x45a1e7[_0x0a9e('0x2e')]=_[_0x0a9e('0x2f')](_0x45a1e7[_0x0a9e('0x30')],_0x45a1e7[_0x0a9e('0x2c')]);_0x479bc4[_0x0a9e('0x31')]=_[_0x0a9e('0x2f')](_0x45a1e7[_0x0a9e('0x30')],qs[_0x0a9e('0x32')](_0x526cf3[_0x0a9e('0x2c')]['fields']));_0x479bc4[_0x0a9e('0x31')]=_0x479bc4['attributes'][_0x0a9e('0x33')]?_0x479bc4[_0x0a9e('0x31')]:_0x45a1e7[_0x0a9e('0x30')];if(!_0x526cf3[_0x0a9e('0x2c')][_0x0a9e('0x34')]('nolimit')){_0x479bc4[_0x0a9e('0x35')]=qs[_0x0a9e('0x35')](_0x526cf3[_0x0a9e('0x2c')][_0x0a9e('0x35')]);_0x479bc4[_0x0a9e('0x18')]=qs[_0x0a9e('0x18')](_0x526cf3[_0x0a9e('0x2c')][_0x0a9e('0x18')]);}_0x479bc4['order']=qs[_0x0a9e('0x36')](_0x526cf3['query'][_0x0a9e('0x36')]);_0x479bc4[_0x0a9e('0x37')]=qs[_0x0a9e('0x2e')](_[_0x0a9e('0x38')](_0x526cf3['query'],_0x45a1e7[_0x0a9e('0x2e')]),_0x1dc186);if(_0x526cf3[_0x0a9e('0x2c')][_0x0a9e('0x39')]){_0x479bc4[_0x0a9e('0x37')]=_['merge'](_0x479bc4['where'],{'$or':_[_0x0a9e('0x26')](_0x1dc186,function(_0x5640eb){if(_0x5640eb[_0x0a9e('0x2a')]!==_0x0a9e('0x3a')){var _0x381c37={};_0x381c37[_0x5640eb[_0x0a9e('0x23')]]={'$like':'%'+_0x526cf3['query'][_0x0a9e('0x39')]+'%'};return _0x381c37;}})});}_0x479bc4=_[_0x0a9e('0x3b')]({},_0x479bc4,_0x526cf3[_0x0a9e('0x3c')]);var _0x533942={'where':_0x479bc4[_0x0a9e('0x37')]};return db[_0x0a9e('0x27')][_0x0a9e('0x17')](_0x533942)['then'](function(_0x546ef8){_0x5bfb33[_0x0a9e('0x17')]=_0x546ef8;if(_0x526cf3[_0x0a9e('0x2c')]['includeAll']){_0x479bc4[_0x0a9e('0x3d')]=[{'all':!![]}];}return db[_0x0a9e('0x27')][_0x0a9e('0x3e')](_0x479bc4);})[_0x0a9e('0x1f')](function(_0x4b38d9){_0x5bfb33['rows']=_0x4b38d9;return _0x5bfb33;})[_0x0a9e('0x1f')](respondWithFilteredResult(_0x384319,_0x479bc4))[_0x0a9e('0x3f')](handleError(_0x384319,null));};exports['show']=function(_0x183991,_0x1dec2e){var _0x1459bb={'raw':!![],'where':{'id':_0x183991[_0x0a9e('0x40')]['id']}},_0x5b4f5e={};_0x5b4f5e[_0x0a9e('0x30')]=_[_0x0a9e('0x2d')](db[_0x0a9e('0x27')][_0x0a9e('0x28')]);_0x5b4f5e[_0x0a9e('0x2c')]=_[_0x0a9e('0x2d')](_0x183991[_0x0a9e('0x2c')]);_0x5b4f5e[_0x0a9e('0x2e')]=_[_0x0a9e('0x2f')](_0x5b4f5e[_0x0a9e('0x30')],_0x5b4f5e[_0x0a9e('0x2c')]);_0x1459bb[_0x0a9e('0x31')]=_[_0x0a9e('0x2f')](_0x5b4f5e[_0x0a9e('0x30')],qs['fields'](_0x183991['query'][_0x0a9e('0x32')]));_0x1459bb[_0x0a9e('0x31')]=_0x1459bb[_0x0a9e('0x31')][_0x0a9e('0x33')]?_0x1459bb[_0x0a9e('0x31')]:_0x5b4f5e[_0x0a9e('0x30')];if(_0x183991[_0x0a9e('0x2c')][_0x0a9e('0x41')]){_0x1459bb[_0x0a9e('0x3d')]=[{'all':!![]}];}_0x1459bb=_[_0x0a9e('0x3b')]({},_0x1459bb,_0x183991[_0x0a9e('0x3c')]);return db[_0x0a9e('0x27')]['find'](_0x1459bb)[_0x0a9e('0x1f')](handleEntityNotFound(_0x1dec2e,null))[_0x0a9e('0x1f')](respondWithResult(_0x1dec2e,null))[_0x0a9e('0x3f')](handleError(_0x1dec2e,null));};exports[_0x0a9e('0x42')]=function(_0x2e8caf,_0xbe9d19){return db[_0x0a9e('0x27')][_0x0a9e('0x42')](_0x2e8caf['body'],{})[_0x0a9e('0x1f')](respondWithResult(_0xbe9d19,0xc9))['catch'](handleError(_0xbe9d19,null));};exports[_0x0a9e('0x1e')]=function(_0x476688,_0x8d6dd1){if(_0x476688['body']['id']){delete _0x476688[_0x0a9e('0x43')]['id'];}return db[_0x0a9e('0x27')][_0x0a9e('0x44')]({'where':{'id':_0x476688[_0x0a9e('0x40')]['id']}})[_0x0a9e('0x1f')](handleEntityNotFound(_0x8d6dd1,null))[_0x0a9e('0x1f')](saveUpdates(_0x476688[_0x0a9e('0x43')],null))['then'](respondWithResult(_0x8d6dd1,null))[_0x0a9e('0x3f')](handleError(_0x8d6dd1,null));};exports[_0x0a9e('0x20')]=function(_0x1b5e80,_0x16f976){return db[_0x0a9e('0x27')][_0x0a9e('0x44')]({'where':{'id':_0x1b5e80[_0x0a9e('0x40')]['id']}})[_0x0a9e('0x1f')](handleEntityNotFound(_0x16f976,null))[_0x0a9e('0x1f')](removeEntity(_0x16f976,null))['catch'](handleError(_0x16f976,null));};
\ No newline at end of file
+var _0xa9e0=['sort','where','pick','filter','VIRTUAL','merge','options','include','findAll','catch','params','includeAll','create','body','find','html-pdf','eml-format','rimraf','request-promise','bluebird','mustache','util','path','sox','ejs','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../mysqldb','sendStatus','status','json','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','end','error','name','send','index','map','ZohoField','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','limit'];(function(_0x1f1837,_0x4b304e){var _0x25ab57=function(_0x4dec8c){while(--_0x4dec8c){_0x1f1837['push'](_0x1f1837['shift']());}};_0x25ab57(++_0x4b304e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2bf141,_0x31eac7){_0x2bf141=_0x2bf141-0x0;var _0x48277b=_0xa9e0[_0x2bf141];return _0x48277b;};'use strict';var pdf=require(_0x0a9e('0x0'));var emlformat=require(_0x0a9e('0x1'));var rimraf=require(_0x0a9e('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0a9e('0x3'));var moment=require('moment');var BPromise=require(_0x0a9e('0x4'));var Mustache=require(_0x0a9e('0x5'));var util=require(_0x0a9e('0x6'));var path=require(_0x0a9e('0x7'));var sox=require(_0x0a9e('0x8'));var csv=require('to-csv');var ejs=require(_0x0a9e('0x9'));var fs=require('fs');var _=require(_0x0a9e('0xa'));var squel=require(_0x0a9e('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0a9e('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0a9e('0xd'));var Redis=require(_0x0a9e('0xe'));var authService=require(_0x0a9e('0xf'));var qs=require(_0x0a9e('0x10'));var as=require(_0x0a9e('0x11'));var hardwareService=require(_0x0a9e('0x12'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x0a9e('0x13'))['db'];function respondWithStatusCode(_0x36471c,_0xd5b662){_0xd5b662=_0xd5b662||0xcc;return function(_0x26d672){if(_0x26d672){return _0x36471c[_0x0a9e('0x14')](_0xd5b662);}return _0x36471c[_0x0a9e('0x15')](_0xd5b662)['end']();};}function respondWithResult(_0x4283ce,_0x239b12){_0x239b12=_0x239b12||0xc8;return function(_0x2b4227){if(_0x2b4227){return _0x4283ce[_0x0a9e('0x15')](_0x239b12)[_0x0a9e('0x16')](_0x2b4227);}};}function respondWithFilteredResult(_0x4d5611,_0x52a03d){return function(_0x22dccb){if(_0x22dccb){var _0x5d0880=_0x22dccb[_0x0a9e('0x17')],_0x1985b6=_0x52a03d['offset'],_0x519dfd=_0x52a03d[_0x0a9e('0x18')]+_0x52a03d['limit'],_0x16033c;if(_0x519dfd>=_0x5d0880){_0x519dfd=_0x5d0880;_0x16033c=0xc8;}else{_0x16033c=0xce;}_0x4d5611[_0x0a9e('0x15')](_0x16033c);return _0x4d5611[_0x0a9e('0x19')](_0x0a9e('0x1a'),_0x1985b6+'-'+_0x519dfd+'/'+_0x5d0880)[_0x0a9e('0x16')](_0x22dccb);}return null;};}function patchUpdates(_0x31b1ca){return function(_0x2eb11f){try{jsonpatch[_0x0a9e('0x1b')](_0x2eb11f,_0x31b1ca,!![]);}catch(_0x20559e){return BPromise[_0x0a9e('0x1c')](_0x20559e);}return _0x2eb11f[_0x0a9e('0x1d')]();};}function saveUpdates(_0x1c696a,_0x105080){return function(_0x4bb1e3){if(_0x4bb1e3){return _0x4bb1e3[_0x0a9e('0x1e')](_0x1c696a)[_0x0a9e('0x1f')](function(_0x53682f){return _0x53682f;});}return null;};}function removeEntity(_0x20f109,_0x5a09ef){return function(_0x588269){if(_0x588269){return _0x588269[_0x0a9e('0x20')]()[_0x0a9e('0x1f')](function(){_0x20f109[_0x0a9e('0x15')](0xcc)[_0x0a9e('0x21')]();});}};}function handleEntityNotFound(_0x4abc77,_0xfb6e48){return function(_0x2fb0e4){if(!_0x2fb0e4){_0x4abc77[_0x0a9e('0x14')](0x194);}return _0x2fb0e4;};}function handleError(_0x4d00e6,_0x370d86){_0x370d86=_0x370d86||0x1f4;return function(_0x42ac8f){logger[_0x0a9e('0x22')](_0x42ac8f['stack']);if(_0x42ac8f['name']){delete _0x42ac8f[_0x0a9e('0x23')];}_0x4d00e6[_0x0a9e('0x15')](_0x370d86)[_0x0a9e('0x24')](_0x42ac8f);};}exports[_0x0a9e('0x25')]=function(_0x526cf3,_0x384319){var _0x479bc4={},_0x45a1e7={},_0x5bfb33={'count':0x0,'rows':[]};var _0x1dc186=_[_0x0a9e('0x26')](db[_0x0a9e('0x27')][_0x0a9e('0x28')],function(_0x140511){return{'name':_0x140511[_0x0a9e('0x29')],'type':_0x140511[_0x0a9e('0x2a')][_0x0a9e('0x2b')]};});_0x45a1e7['model']=_[_0x0a9e('0x26')](_0x1dc186,_0x0a9e('0x23'));_0x45a1e7[_0x0a9e('0x2c')]=_[_0x0a9e('0x2d')](_0x526cf3['query']);_0x45a1e7[_0x0a9e('0x2e')]=_[_0x0a9e('0x2f')](_0x45a1e7[_0x0a9e('0x30')],_0x45a1e7[_0x0a9e('0x2c')]);_0x479bc4[_0x0a9e('0x31')]=_[_0x0a9e('0x2f')](_0x45a1e7[_0x0a9e('0x30')],qs[_0x0a9e('0x32')](_0x526cf3[_0x0a9e('0x2c')]['fields']));_0x479bc4[_0x0a9e('0x31')]=_0x479bc4['attributes'][_0x0a9e('0x33')]?_0x479bc4[_0x0a9e('0x31')]:_0x45a1e7[_0x0a9e('0x30')];if(!_0x526cf3[_0x0a9e('0x2c')][_0x0a9e('0x34')]('nolimit')){_0x479bc4[_0x0a9e('0x35')]=qs[_0x0a9e('0x35')](_0x526cf3[_0x0a9e('0x2c')][_0x0a9e('0x35')]);_0x479bc4[_0x0a9e('0x18')]=qs[_0x0a9e('0x18')](_0x526cf3[_0x0a9e('0x2c')][_0x0a9e('0x18')]);}_0x479bc4['order']=qs[_0x0a9e('0x36')](_0x526cf3['query'][_0x0a9e('0x36')]);_0x479bc4[_0x0a9e('0x37')]=qs[_0x0a9e('0x2e')](_[_0x0a9e('0x38')](_0x526cf3['query'],_0x45a1e7[_0x0a9e('0x2e')]),_0x1dc186);if(_0x526cf3[_0x0a9e('0x2c')][_0x0a9e('0x39')]){_0x479bc4[_0x0a9e('0x37')]=_['merge'](_0x479bc4['where'],{'$or':_[_0x0a9e('0x26')](_0x1dc186,function(_0x5640eb){if(_0x5640eb[_0x0a9e('0x2a')]!==_0x0a9e('0x3a')){var _0x381c37={};_0x381c37[_0x5640eb[_0x0a9e('0x23')]]={'$like':'%'+_0x526cf3['query'][_0x0a9e('0x39')]+'%'};return _0x381c37;}})});}_0x479bc4=_[_0x0a9e('0x3b')]({},_0x479bc4,_0x526cf3[_0x0a9e('0x3c')]);var _0x533942={'where':_0x479bc4[_0x0a9e('0x37')]};return db[_0x0a9e('0x27')][_0x0a9e('0x17')](_0x533942)['then'](function(_0x546ef8){_0x5bfb33[_0x0a9e('0x17')]=_0x546ef8;if(_0x526cf3[_0x0a9e('0x2c')]['includeAll']){_0x479bc4[_0x0a9e('0x3d')]=[{'all':!![]}];}return db[_0x0a9e('0x27')][_0x0a9e('0x3e')](_0x479bc4);})[_0x0a9e('0x1f')](function(_0x4b38d9){_0x5bfb33['rows']=_0x4b38d9;return _0x5bfb33;})[_0x0a9e('0x1f')](respondWithFilteredResult(_0x384319,_0x479bc4))[_0x0a9e('0x3f')](handleError(_0x384319,null));};exports['show']=function(_0x183991,_0x1dec2e){var _0x1459bb={'raw':!![],'where':{'id':_0x183991[_0x0a9e('0x40')]['id']}},_0x5b4f5e={};_0x5b4f5e[_0x0a9e('0x30')]=_[_0x0a9e('0x2d')](db[_0x0a9e('0x27')][_0x0a9e('0x28')]);_0x5b4f5e[_0x0a9e('0x2c')]=_[_0x0a9e('0x2d')](_0x183991[_0x0a9e('0x2c')]);_0x5b4f5e[_0x0a9e('0x2e')]=_[_0x0a9e('0x2f')](_0x5b4f5e[_0x0a9e('0x30')],_0x5b4f5e[_0x0a9e('0x2c')]);_0x1459bb[_0x0a9e('0x31')]=_[_0x0a9e('0x2f')](_0x5b4f5e[_0x0a9e('0x30')],qs['fields'](_0x183991['query'][_0x0a9e('0x32')]));_0x1459bb[_0x0a9e('0x31')]=_0x1459bb[_0x0a9e('0x31')][_0x0a9e('0x33')]?_0x1459bb[_0x0a9e('0x31')]:_0x5b4f5e[_0x0a9e('0x30')];if(_0x183991[_0x0a9e('0x2c')][_0x0a9e('0x41')]){_0x1459bb[_0x0a9e('0x3d')]=[{'all':!![]}];}_0x1459bb=_[_0x0a9e('0x3b')]({},_0x1459bb,_0x183991[_0x0a9e('0x3c')]);return db[_0x0a9e('0x27')]['find'](_0x1459bb)[_0x0a9e('0x1f')](handleEntityNotFound(_0x1dec2e,null))[_0x0a9e('0x1f')](respondWithResult(_0x1dec2e,null))[_0x0a9e('0x3f')](handleError(_0x1dec2e,null));};exports[_0x0a9e('0x42')]=function(_0x2e8caf,_0xbe9d19){return db[_0x0a9e('0x27')][_0x0a9e('0x42')](_0x2e8caf['body'],{})[_0x0a9e('0x1f')](respondWithResult(_0xbe9d19,0xc9))['catch'](handleError(_0xbe9d19,null));};exports[_0x0a9e('0x1e')]=function(_0x476688,_0x8d6dd1){if(_0x476688['body']['id']){delete _0x476688[_0x0a9e('0x43')]['id'];}return db[_0x0a9e('0x27')][_0x0a9e('0x44')]({'where':{'id':_0x476688[_0x0a9e('0x40')]['id']}})[_0x0a9e('0x1f')](handleEntityNotFound(_0x8d6dd1,null))[_0x0a9e('0x1f')](saveUpdates(_0x476688[_0x0a9e('0x43')],null))['then'](respondWithResult(_0x8d6dd1,null))[_0x0a9e('0x3f')](handleError(_0x8d6dd1,null));};exports[_0x0a9e('0x20')]=function(_0x1b5e80,_0x16f976){return db[_0x0a9e('0x27')][_0x0a9e('0x44')]({'where':{'id':_0x1b5e80[_0x0a9e('0x40')]['id']}})[_0x0a9e('0x1f')](handleEntityNotFound(_0x16f976,null))[_0x0a9e('0x1f')](removeEntity(_0x16f976,null))['catch'](handleError(_0x16f976,null));};
\ No newline at end of file
diff --git a/server/api/intZohoField/intZohoField.model.js b/server/api/intZohoField/intZohoField.model.js
index cf4c1b6..7969c8c 100644
--- a/server/api/intZohoField/intZohoField.model.js
+++ b/server/api/intZohoField/intZohoField.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xa149=['util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./intZohoField.attributes','define','ZohoField','int_zoho_fields','FieldId','lodash'];(function(_0x551fa8,_0x35ee73){var _0xa879cb=function(_0x89b7b2){while(--_0x89b7b2){_0x551fa8['push'](_0x551fa8['shift']());}};_0xa879cb(++_0x35ee73);}(_0xa149,0xb5));var _0x9a14=function(_0x5d91ea,_0x344f69){_0x5d91ea=_0x5d91ea-0x0;var _0x1b9b8f=_0xa149[_0x5d91ea];return _0x1b9b8f;};'use strict';var _=require(_0x9a14('0x0'));var util=require(_0x9a14('0x1'));var logger=require(_0x9a14('0x2'))(_0x9a14('0x3'));var moment=require(_0x9a14('0x4'));var BPromise=require(_0x9a14('0x5'));var rp=require(_0x9a14('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9a14('0x7'));var config=require(_0x9a14('0x8'));var attributes=require(_0x9a14('0x9'));module['exports']=function(_0x37d32f,_0x2fdb28){return _0x37d32f[_0x9a14('0xa')](_0x9a14('0xb'),attributes,{'tableName':_0x9a14('0xc'),'paranoid':![],'indexes':[{'name':'zoho_unique_index','fields':['idField',_0x9a14('0xd')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x3221=['../../config/logger','moment','bluebird','request-promise','path','./intZohoField.attributes','define','ZohoField','FieldId'];(function(_0x2f62aa,_0x108e95){var _0x1a341f=function(_0x3aedcf){while(--_0x3aedcf){_0x2f62aa['push'](_0x2f62aa['shift']());}};_0x1a341f(++_0x108e95);}(_0x3221,0x87));var _0x1322=function(_0x562f57,_0x476a6d){_0x562f57=_0x562f57-0x0;var _0x5e699f=_0x3221[_0x562f57];return _0x5e699f;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x1322('0x0'))('api');var moment=require(_0x1322('0x1'));var BPromise=require(_0x1322('0x2'));var rp=require(_0x1322('0x3'));var fs=require('fs');var path=require(_0x1322('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x1322('0x5'));module['exports']=function(_0x11d100,_0x4bf493){return _0x11d100[_0x1322('0x6')](_0x1322('0x7'),attributes,{'tableName':'int_zoho_fields','paranoid':![],'indexes':[{'name':'zoho_unique_index','fields':['idField',_0x1322('0x8')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/intZohoField/intZohoField.rpc.js b/server/api/intZohoField/intZohoField.rpc.js
index 9eb6668..95a3bab 100644
--- a/server/api/intZohoField/intZohoField.rpc.js
+++ b/server/api/intZohoField/intZohoField.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xa41a=['rpc','../../config/environment','client','http','request','then','info','ZohoField,\x20%s,\x20%s','request\x20sent','debug','ZohoField,\x20%s,\x20%s,\x20%s','error','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x5b8340,_0x51d885){var _0x55abe5=function(_0x2b6068){while(--_0x2b6068){_0x5b8340['push'](_0x5b8340['shift']());}};_0x55abe5(++_0x51d885);}(_0xa41a,0x6b));var _0xaa41=function(_0x48d1bf,_0x60edb9){_0x48d1bf=_0x48d1bf-0x0;var _0x13716a=_0xa41a[_0x48d1bf];return _0x13716a;};'use strict';var _=require(_0xaa41('0x0'));var util=require(_0xaa41('0x1'));var moment=require('moment');var BPromise=require(_0xaa41('0x2'));var rs=require(_0xaa41('0x3'));var fs=require('fs');var Redis=require(_0xaa41('0x4'));var db=require(_0xaa41('0x5'))['db'];var utils=require(_0xaa41('0x6'));var logger=require(_0xaa41('0x7'))(_0xaa41('0x8'));var config=require(_0xaa41('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xaa41('0xa')][_0xaa41('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x54bc5a,_0x5b1fff,_0x179545){return new BPromise(function(_0x202cce,_0x588ab4){return client[_0xaa41('0xc')](_0x54bc5a,_0x179545)[_0xaa41('0xd')](function(_0x409dab){logger[_0xaa41('0xe')](_0xaa41('0xf'),_0x5b1fff,_0xaa41('0x10'));logger[_0xaa41('0x11')](_0xaa41('0x12'),_0x5b1fff,_0xaa41('0x10'),JSON['stringify'](_0x409dab));if(_0x409dab[_0xaa41('0x13')]){if(_0x409dab[_0xaa41('0x13')]['code']===0x1f4){logger['error'](_0xaa41('0xf'),_0x5b1fff,_0x409dab['error'][_0xaa41('0x14')]);return _0x588ab4(_0x409dab[_0xaa41('0x13')][_0xaa41('0x14')]);}logger[_0xaa41('0x13')](_0xaa41('0xf'),_0x5b1fff,_0x409dab['error'][_0xaa41('0x14')]);return _0x202cce(_0x409dab[_0xaa41('0x13')][_0xaa41('0x14')]);}else{logger[_0xaa41('0xe')](_0xaa41('0xf'),_0x5b1fff,_0xaa41('0x10'));_0x202cce(_0x409dab[_0xaa41('0x15')]['message']);}})[_0xaa41('0x16')](function(_0x16b930){logger[_0xaa41('0x13')](_0xaa41('0xf'),_0x5b1fff,_0x16b930);_0x588ab4(_0x16b930);});});}
\ No newline at end of file
+var _0xe5b3=['request\x20sent','debug','ZohoField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','ZohoField,\x20%s,\x20%s'];(function(_0x57411a,_0x59328f){var _0xd487ba=function(_0x2fb456){while(--_0x2fb456){_0x57411a['push'](_0x57411a['shift']());}};_0xd487ba(++_0x59328f);}(_0xe5b3,0x133));var _0x3e5b=function(_0x122031,_0x3c231a){_0x122031=_0x122031-0x0;var _0x26b8e9=_0xe5b3[_0x122031];return _0x26b8e9;};'use strict';var _=require('lodash');var util=require(_0x3e5b('0x0'));var moment=require(_0x3e5b('0x1'));var BPromise=require(_0x3e5b('0x2'));var rs=require(_0x3e5b('0x3'));var fs=require('fs');var Redis=require(_0x3e5b('0x4'));var db=require(_0x3e5b('0x5'))['db'];var utils=require(_0x3e5b('0x6'));var logger=require(_0x3e5b('0x7'))(_0x3e5b('0x8'));var config=require(_0x3e5b('0x9'));var jayson=require(_0x3e5b('0xa'));var client=jayson['client'][_0x3e5b('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5dcf55,_0x534e7d,_0x41d46f){return new BPromise(function(_0x3901c2,_0x3c7c2e){return client[_0x3e5b('0xc')](_0x5dcf55,_0x41d46f)['then'](function(_0x4ed6bc){logger[_0x3e5b('0xd')](_0x3e5b('0xe'),_0x534e7d,_0x3e5b('0xf'));logger[_0x3e5b('0x10')](_0x3e5b('0x11'),_0x534e7d,'request\x20sent',JSON[_0x3e5b('0x12')](_0x4ed6bc));if(_0x4ed6bc['error']){if(_0x4ed6bc[_0x3e5b('0x13')][_0x3e5b('0x14')]===0x1f4){logger[_0x3e5b('0x13')](_0x3e5b('0xe'),_0x534e7d,_0x4ed6bc[_0x3e5b('0x13')][_0x3e5b('0x15')]);return _0x3c7c2e(_0x4ed6bc[_0x3e5b('0x13')]['message']);}logger[_0x3e5b('0x13')]('ZohoField,\x20%s,\x20%s',_0x534e7d,_0x4ed6bc['error']['message']);return _0x3901c2(_0x4ed6bc[_0x3e5b('0x13')][_0x3e5b('0x15')]);}else{logger[_0x3e5b('0xd')]('ZohoField,\x20%s,\x20%s',_0x534e7d,_0x3e5b('0xf'));_0x3901c2(_0x4ed6bc['result']['message']);}})[_0x3e5b('0x16')](function(_0x11b41b){logger['error'](_0x3e5b('0xe'),_0x534e7d,_0x11b41b);_0x3c7c2e(_0x11b41b);});});}
\ No newline at end of file
diff --git a/server/api/integration/index.js b/server/api/integration/index.js
index bc82054..028cbac 100644
--- a/server/api/integration/index.js
+++ b/server/api/integration/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x2f56=['multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','exports'];(function(_0x1b87fb,_0x3e6870){var _0xc7de31=function(_0x4eaded){while(--_0x4eaded){_0x1b87fb['push'](_0x1b87fb['shift']());}};_0xc7de31(++_0x3e6870);}(_0x2f56,0x148));var _0x62f5=function(_0x19b066,_0x46d454){_0x19b066=_0x19b066-0x0;var _0x409772=_0x2f56[_0x19b066];return _0x409772;};'use strict';var multer=require(_0x62f5('0x0'));var util=require(_0x62f5('0x1'));var path=require(_0x62f5('0x2'));var timeout=require('connect-timeout');var express=require(_0x62f5('0x3'));var router=express[_0x62f5('0x4')]();var auth=require(_0x62f5('0x5'));var interaction=require(_0x62f5('0x6'));var config=require('../../config/environment');module[_0x62f5('0x7')]=router;
\ No newline at end of file
+var _0x82a2=['path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','exports','multer','util'];(function(_0x50fe9f,_0xaf05b2){var _0x5dcb37=function(_0x3ffb00){while(--_0x3ffb00){_0x50fe9f['push'](_0x50fe9f['shift']());}};_0x5dcb37(++_0xaf05b2);}(_0x82a2,0x1e8));var _0x282a=function(_0x5c689a,_0x511782){_0x5c689a=_0x5c689a-0x0;var _0xb9bd1b=_0x82a2[_0x5c689a];return _0xb9bd1b;};'use strict';var multer=require(_0x282a('0x0'));var util=require(_0x282a('0x1'));var path=require(_0x282a('0x2'));var timeout=require(_0x282a('0x3'));var express=require(_0x282a('0x4'));var router=express[_0x282a('0x5')]();var auth=require(_0x282a('0x6'));var interaction=require(_0x282a('0x7'));var config=require(_0x282a('0x8'));module[_0x282a('0x9')]=router;
\ No newline at end of file
diff --git a/server/api/integration/integration.attributes.js b/server/api/integration/integration.attributes.js
index baff857..98b7c89 100644
--- a/server/api/integration/integration.attributes.js
+++ b/server/api/integration/integration.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xa52f=['BOOLEAN','sequelize','STRING','unique_name_and_version','app.js','INTEGER'];(function(_0x502ca3,_0x36be36){var _0x27f42c=function(_0x1e3045){while(--_0x1e3045){_0x502ca3['push'](_0x502ca3['shift']());}};_0x27f42c(++_0x36be36);}(_0xa52f,0xd9));var _0xfa52=function(_0x536f26,_0x4739c3){_0x536f26=_0x536f26-0x0;var _0x4356ca=_0xa52f[_0x536f26];return _0x4356ca;};'use strict';var Sequelize=require(_0xfa52('0x0'));module['exports']={'name':{'type':Sequelize[_0xfa52('0x1')],'allowNull':![],'unique':_0xfa52('0x2')},'version':{'type':Sequelize[_0xfa52('0x1')],'allowNull':![],'unique':_0xfa52('0x2')},'main':{'type':Sequelize[_0xfa52('0x1')],'defaultValue':_0xfa52('0x3')},'filename':{'type':Sequelize[_0xfa52('0x1')]},'path':{'type':Sequelize[_0xfa52('0x1')]},'type':{'type':Sequelize[_0xfa52('0x1')]},'size':{'type':Sequelize[_0xfa52('0x4')]},'active':{'type':Sequelize[_0xfa52('0x5')],'defaultValue':![]},'author':{'type':Sequelize[_0xfa52('0x1')]},'logo':{'type':Sequelize['STRING']},'state':{'type':Sequelize[_0xfa52('0x1')],'unique':'state'},'description':{'type':Sequelize[_0xfa52('0x1')]},'title':{'type':Sequelize[_0xfa52('0x1')]},'remoteUri':{'type':Sequelize[_0xfa52('0x1')]},'link':{'type':Sequelize[_0xfa52('0x1')],'defaultValue':'#'}};
\ No newline at end of file
+var _0xb44a=['exports','STRING','unique_name_and_version','app.js','INTEGER','BOOLEAN','state','sequelize'];(function(_0x236485,_0x273657){var _0x1d70e4=function(_0x45556c){while(--_0x45556c){_0x236485['push'](_0x236485['shift']());}};_0x1d70e4(++_0x273657);}(_0xb44a,0xf7));var _0xab44=function(_0x4ef77b,_0x6a3df){_0x4ef77b=_0x4ef77b-0x0;var _0x58d1a6=_0xb44a[_0x4ef77b];return _0x58d1a6;};'use strict';var Sequelize=require(_0xab44('0x0'));module[_0xab44('0x1')]={'name':{'type':Sequelize[_0xab44('0x2')],'allowNull':![],'unique':'unique_name_and_version'},'version':{'type':Sequelize[_0xab44('0x2')],'allowNull':![],'unique':_0xab44('0x3')},'main':{'type':Sequelize['STRING'],'defaultValue':_0xab44('0x4')},'filename':{'type':Sequelize[_0xab44('0x2')]},'path':{'type':Sequelize[_0xab44('0x2')]},'type':{'type':Sequelize['STRING']},'size':{'type':Sequelize[_0xab44('0x5')]},'active':{'type':Sequelize[_0xab44('0x6')],'defaultValue':![]},'author':{'type':Sequelize[_0xab44('0x2')]},'logo':{'type':Sequelize['STRING']},'state':{'type':Sequelize['STRING'],'unique':_0xab44('0x7')},'description':{'type':Sequelize[_0xab44('0x2')]},'title':{'type':Sequelize[_0xab44('0x2')]},'remoteUri':{'type':Sequelize[_0xab44('0x2')]},'link':{'type':Sequelize[_0xab44('0x2')],'defaultValue':'#'}};
\ No newline at end of file
diff --git a/server/api/integration/integration.controller.js b/server/api/integration/integration.controller.js
index b6e95c2..810e5e1 100644
--- a/server/api/integration/integration.controller.js
+++ b/server/api/integration/integration.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x1030=['crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','reject','update','destroy','then','error','stack','name','index','map','Integration','rawAttributes','type','key','query','keys','filters','intersection','attributes','fields','length','model','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','find','create','body','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash'];(function(_0x2ffd05,_0x1840e3){var _0x5038bf=function(_0xe7e075){while(--_0xe7e075){_0x2ffd05['push'](_0x2ffd05['shift']());}};_0x5038bf(++_0x1840e3);}(_0x1030,0x84));var _0x0103=function(_0x208576,_0x595b40){_0x208576=_0x208576-0x0;var _0x777662=_0x1030[_0x208576];return _0x777662;};'use strict';var pdf=require(_0x0103('0x0'));var emlformat=require(_0x0103('0x1'));var rimraf=require(_0x0103('0x2'));var zipdir=require(_0x0103('0x3'));var jsonpatch=require(_0x0103('0x4'));var rp=require(_0x0103('0x5'));var moment=require(_0x0103('0x6'));var BPromise=require(_0x0103('0x7'));var Mustache=require(_0x0103('0x8'));var util=require(_0x0103('0x9'));var path=require('path');var sox=require(_0x0103('0xa'));var csv=require(_0x0103('0xb'));var ejs=require(_0x0103('0xc'));var fs=require('fs');var _=require(_0x0103('0xd'));var squel=require('squel');var crypto=require(_0x0103('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x0103('0xf'));var toCsv=require(_0x0103('0xb'));var querystring=require(_0x0103('0x10'));var Papa=require(_0x0103('0x11'));var Redis=require(_0x0103('0x12'));var authService=require(_0x0103('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0103('0x14'));var logger=require(_0x0103('0x15'))('api');var utils=require(_0x0103('0x16'));var config=require(_0x0103('0x17'));var db=require(_0x0103('0x18'))['db'];function respondWithStatusCode(_0x5f5316,_0x7881dd){_0x7881dd=_0x7881dd||0xcc;return function(_0x3b9206){if(_0x3b9206){return _0x5f5316[_0x0103('0x19')](_0x7881dd);}return _0x5f5316[_0x0103('0x1a')](_0x7881dd)['end']();};}function respondWithResult(_0x4ab43e,_0x34156c){_0x34156c=_0x34156c||0xc8;return function(_0x40f16b){if(_0x40f16b){return _0x4ab43e[_0x0103('0x1a')](_0x34156c)[_0x0103('0x1b')](_0x40f16b);}};}function respondWithFilteredResult(_0x528779,_0x473798){return function(_0xa6023c){if(_0xa6023c){var _0xeeecba=_0xa6023c[_0x0103('0x1c')],_0x38ee9d=_0x473798[_0x0103('0x1d')],_0x206ae4=_0x473798[_0x0103('0x1d')]+_0x473798[_0x0103('0x1e')],_0x482620;if(_0x206ae4>=_0xeeecba){_0x206ae4=_0xeeecba;_0x482620=0xc8;}else{_0x482620=0xce;}_0x528779[_0x0103('0x1a')](_0x482620);return _0x528779[_0x0103('0x1f')](_0x0103('0x20'),_0x38ee9d+'-'+_0x206ae4+'/'+_0xeeecba)[_0x0103('0x1b')](_0xa6023c);}return null;};}function patchUpdates(_0x5ecbe7){return function(_0x101289){try{jsonpatch[_0x0103('0x21')](_0x101289,_0x5ecbe7,!![]);}catch(_0x508027){return BPromise[_0x0103('0x22')](_0x508027);}return _0x101289['save']();};}function saveUpdates(_0xc356fc,_0x2fa993){return function(_0x3de504){if(_0x3de504){return _0x3de504[_0x0103('0x23')](_0xc356fc)['then'](function(_0x1771b1){return _0x1771b1;});}return null;};}function removeEntity(_0x2a7b2a,_0x5b3d67){return function(_0x1daa87){if(_0x1daa87){return _0x1daa87[_0x0103('0x24')]()[_0x0103('0x25')](function(){_0x2a7b2a[_0x0103('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4cc991,_0x2d3ee1){return function(_0x948a47){if(!_0x948a47){_0x4cc991[_0x0103('0x19')](0x194);}return _0x948a47;};}function handleError(_0x23acdf,_0x4ca646){_0x4ca646=_0x4ca646||0x1f4;return function(_0x1123dd){logger[_0x0103('0x26')](_0x1123dd[_0x0103('0x27')]);if(_0x1123dd[_0x0103('0x28')]){delete _0x1123dd['name'];}_0x23acdf[_0x0103('0x1a')](_0x4ca646)['send'](_0x1123dd);};}exports[_0x0103('0x29')]=function(_0x322618,_0x3c40d1){var _0xca2d2f={},_0x4a799d={},_0x52a14a={'count':0x0,'rows':[]};var _0x4c7600=_[_0x0103('0x2a')](db[_0x0103('0x2b')][_0x0103('0x2c')],function(_0x1a7b03){return{'name':_0x1a7b03['fieldName'],'type':_0x1a7b03[_0x0103('0x2d')][_0x0103('0x2e')]};});_0x4a799d['model']=_[_0x0103('0x2a')](_0x4c7600,_0x0103('0x28'));_0x4a799d[_0x0103('0x2f')]=_[_0x0103('0x30')](_0x322618[_0x0103('0x2f')]);_0x4a799d[_0x0103('0x31')]=_[_0x0103('0x32')](_0x4a799d['model'],_0x4a799d[_0x0103('0x2f')]);_0xca2d2f[_0x0103('0x33')]=_[_0x0103('0x32')](_0x4a799d['model'],qs[_0x0103('0x34')](_0x322618[_0x0103('0x2f')][_0x0103('0x34')]));_0xca2d2f['attributes']=_0xca2d2f['attributes'][_0x0103('0x35')]?_0xca2d2f['attributes']:_0x4a799d[_0x0103('0x36')];if(!_0x322618['query'][_0x0103('0x37')](_0x0103('0x38'))){_0xca2d2f['limit']=qs[_0x0103('0x1e')](_0x322618[_0x0103('0x2f')]['limit']);_0xca2d2f['offset']=qs[_0x0103('0x1d')](_0x322618[_0x0103('0x2f')][_0x0103('0x1d')]);}_0xca2d2f[_0x0103('0x39')]=qs[_0x0103('0x3a')](_0x322618[_0x0103('0x2f')]['sort']);_0xca2d2f[_0x0103('0x3b')]=qs[_0x0103('0x31')](_['pick'](_0x322618[_0x0103('0x2f')],_0x4a799d[_0x0103('0x31')]),_0x4c7600);if(_0x322618[_0x0103('0x2f')][_0x0103('0x3c')]){_0xca2d2f['where']=_[_0x0103('0x3d')](_0xca2d2f[_0x0103('0x3b')],{'$or':_[_0x0103('0x2a')](_0x4c7600,function(_0x1b889e){if(_0x1b889e['type']!==_0x0103('0x3e')){var _0x135746={};_0x135746[_0x1b889e['name']]={'$like':'%'+_0x322618['query'][_0x0103('0x3c')]+'%'};return _0x135746;}})});}_0xca2d2f=_[_0x0103('0x3d')]({},_0xca2d2f,_0x322618[_0x0103('0x3f')]);var _0xb9ce21={'where':_0xca2d2f[_0x0103('0x3b')]};return db[_0x0103('0x2b')]['count'](_0xb9ce21)['then'](function(_0x39c6dc){_0x52a14a[_0x0103('0x1c')]=_0x39c6dc;if(_0x322618['query'][_0x0103('0x40')]){_0xca2d2f[_0x0103('0x41')]=[{'all':!![]}];}return db[_0x0103('0x2b')][_0x0103('0x42')](_0xca2d2f);})[_0x0103('0x25')](function(_0x5b6411){_0x52a14a[_0x0103('0x43')]=_0x5b6411;return _0x52a14a;})[_0x0103('0x25')](respondWithFilteredResult(_0x3c40d1,_0xca2d2f))[_0x0103('0x44')](handleError(_0x3c40d1,null));};exports['show']=function(_0x2059d8,_0x170fa4){var _0x4f29a5={'raw':![],'where':{'id':_0x2059d8[_0x0103('0x45')]['id']}},_0x23bcf4={};_0x23bcf4['model']=_['keys'](db[_0x0103('0x2b')][_0x0103('0x2c')]);_0x23bcf4['query']=_[_0x0103('0x30')](_0x2059d8[_0x0103('0x2f')]);_0x23bcf4[_0x0103('0x31')]=_[_0x0103('0x32')](_0x23bcf4[_0x0103('0x36')],_0x23bcf4[_0x0103('0x2f')]);_0x4f29a5['attributes']=_['intersection'](_0x23bcf4[_0x0103('0x36')],qs['fields'](_0x2059d8[_0x0103('0x2f')][_0x0103('0x34')]));_0x4f29a5[_0x0103('0x33')]=_0x4f29a5[_0x0103('0x33')]['length']?_0x4f29a5['attributes']:_0x23bcf4[_0x0103('0x36')];if(_0x2059d8['query'][_0x0103('0x40')]){_0x4f29a5[_0x0103('0x41')]=[{'all':!![]}];}_0x4f29a5=_['merge']({},_0x4f29a5,_0x2059d8['options']);return db[_0x0103('0x2b')][_0x0103('0x46')](_0x4f29a5)[_0x0103('0x25')](handleEntityNotFound(_0x170fa4,null))[_0x0103('0x25')](respondWithResult(_0x170fa4,null))[_0x0103('0x44')](handleError(_0x170fa4,null));};exports[_0x0103('0x47')]=function(_0x4cdb81,_0x17ef28){return db[_0x0103('0x2b')][_0x0103('0x47')](_0x4cdb81[_0x0103('0x48')],{})[_0x0103('0x25')](respondWithResult(_0x17ef28,0xc9))[_0x0103('0x44')](handleError(_0x17ef28,null));};exports[_0x0103('0x23')]=function(_0x11a57d,_0x49ecab){if(_0x11a57d[_0x0103('0x48')]['id']){delete _0x11a57d['body']['id'];}return db[_0x0103('0x2b')]['find']({'where':{'id':_0x11a57d['params']['id']}})['then'](handleEntityNotFound(_0x49ecab,null))[_0x0103('0x25')](saveUpdates(_0x11a57d[_0x0103('0x48')],null))['then'](respondWithResult(_0x49ecab,null))[_0x0103('0x44')](handleError(_0x49ecab,null));};exports['destroy']=function(_0x50bc0c,_0x1506d0){return db[_0x0103('0x2b')][_0x0103('0x46')]({'where':{'id':_0x50bc0c[_0x0103('0x45')]['id']}})['then'](handleEntityNotFound(_0x1506d0,null))[_0x0103('0x25')](removeEntity(_0x1506d0,null))[_0x0103('0x44')](handleError(_0x1506d0,null));};
\ No newline at end of file
+var _0xbf97=['end','sendStatus','stack','name','send','map','rawAttributes','type','key','query','filters','model','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','options','Integration','includeAll','include','findAll','rows','show','params','keys','intersection','find','catch','create','body','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','squel','crypto','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','json','count','offset','limit','apply','reject','update','then','destroy'];(function(_0x2742e1,_0x3ebe50){var _0x4723d7=function(_0x410af7){while(--_0x410af7){_0x2742e1['push'](_0x2742e1['shift']());}};_0x4723d7(++_0x3ebe50);}(_0xbf97,0x69));var _0x7bf9=function(_0x1e3fbe,_0x271ec0){_0x1e3fbe=_0x1e3fbe-0x0;var _0x529c0a=_0xbf97[_0x1e3fbe];return _0x529c0a;};'use strict';var pdf=require(_0x7bf9('0x0'));var emlformat=require(_0x7bf9('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x7bf9('0x2'));var jsonpatch=require(_0x7bf9('0x3'));var rp=require(_0x7bf9('0x4'));var moment=require(_0x7bf9('0x5'));var BPromise=require(_0x7bf9('0x6'));var Mustache=require(_0x7bf9('0x7'));var util=require('util');var path=require(_0x7bf9('0x8'));var sox=require(_0x7bf9('0x9'));var csv=require(_0x7bf9('0xa'));var ejs=require(_0x7bf9('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0x7bf9('0xc'));var crypto=require(_0x7bf9('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x7bf9('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x7bf9('0xf'));var Redis=require('ioredis');var authService=require(_0x7bf9('0x10'));var qs=require(_0x7bf9('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x7bf9('0x12'))(_0x7bf9('0x13'));var utils=require(_0x7bf9('0x14'));var config=require(_0x7bf9('0x15'));var db=require(_0x7bf9('0x16'))['db'];function respondWithStatusCode(_0x195da5,_0x4ab973){_0x4ab973=_0x4ab973||0xcc;return function(_0x3e939e){if(_0x3e939e){return _0x195da5['sendStatus'](_0x4ab973);}return _0x195da5[_0x7bf9('0x17')](_0x4ab973)['end']();};}function respondWithResult(_0x38f547,_0x4ab307){_0x4ab307=_0x4ab307||0xc8;return function(_0x56b547){if(_0x56b547){return _0x38f547[_0x7bf9('0x17')](_0x4ab307)[_0x7bf9('0x18')](_0x56b547);}};}function respondWithFilteredResult(_0x12ca11,_0x2dfeab){return function(_0x3b8e66){if(_0x3b8e66){var _0x1e24c4=_0x3b8e66[_0x7bf9('0x19')],_0x54f4c4=_0x2dfeab[_0x7bf9('0x1a')],_0x298afb=_0x2dfeab[_0x7bf9('0x1a')]+_0x2dfeab[_0x7bf9('0x1b')],_0x2900db;if(_0x298afb>=_0x1e24c4){_0x298afb=_0x1e24c4;_0x2900db=0xc8;}else{_0x2900db=0xce;}_0x12ca11[_0x7bf9('0x17')](_0x2900db);return _0x12ca11['set']('Content-Range',_0x54f4c4+'-'+_0x298afb+'/'+_0x1e24c4)[_0x7bf9('0x18')](_0x3b8e66);}return null;};}function patchUpdates(_0x3763f9){return function(_0x27139f){try{jsonpatch[_0x7bf9('0x1c')](_0x27139f,_0x3763f9,!![]);}catch(_0x3035f5){return BPromise[_0x7bf9('0x1d')](_0x3035f5);}return _0x27139f['save']();};}function saveUpdates(_0x81cdf9,_0x152069){return function(_0x2edeea){if(_0x2edeea){return _0x2edeea[_0x7bf9('0x1e')](_0x81cdf9)[_0x7bf9('0x1f')](function(_0x5beb15){return _0x5beb15;});}return null;};}function removeEntity(_0x4f2c88,_0x1ab834){return function(_0x3c27e2){if(_0x3c27e2){return _0x3c27e2[_0x7bf9('0x20')]()[_0x7bf9('0x1f')](function(){_0x4f2c88[_0x7bf9('0x17')](0xcc)[_0x7bf9('0x21')]();});}};}function handleEntityNotFound(_0x47f5be,_0xb3ab40){return function(_0x137eab){if(!_0x137eab){_0x47f5be[_0x7bf9('0x22')](0x194);}return _0x137eab;};}function handleError(_0x5cfdb1,_0x5d53dc){_0x5d53dc=_0x5d53dc||0x1f4;return function(_0x3aa2c7){logger['error'](_0x3aa2c7[_0x7bf9('0x23')]);if(_0x3aa2c7[_0x7bf9('0x24')]){delete _0x3aa2c7[_0x7bf9('0x24')];}_0x5cfdb1[_0x7bf9('0x17')](_0x5d53dc)[_0x7bf9('0x25')](_0x3aa2c7);};}exports['index']=function(_0x5a7a61,_0x532332){var _0x566d51={},_0x33eb0d={},_0x116546={'count':0x0,'rows':[]};var _0x169f9e=_[_0x7bf9('0x26')](db['Integration'][_0x7bf9('0x27')],function(_0x491c45){return{'name':_0x491c45['fieldName'],'type':_0x491c45[_0x7bf9('0x28')][_0x7bf9('0x29')]};});_0x33eb0d['model']=_[_0x7bf9('0x26')](_0x169f9e,'name');_0x33eb0d[_0x7bf9('0x2a')]=_['keys'](_0x5a7a61[_0x7bf9('0x2a')]);_0x33eb0d[_0x7bf9('0x2b')]=_['intersection'](_0x33eb0d[_0x7bf9('0x2c')],_0x33eb0d['query']);_0x566d51['attributes']=_['intersection'](_0x33eb0d['model'],qs[_0x7bf9('0x2d')](_0x5a7a61[_0x7bf9('0x2a')]['fields']));_0x566d51['attributes']=_0x566d51[_0x7bf9('0x2e')][_0x7bf9('0x2f')]?_0x566d51[_0x7bf9('0x2e')]:_0x33eb0d[_0x7bf9('0x2c')];if(!_0x5a7a61[_0x7bf9('0x2a')][_0x7bf9('0x30')](_0x7bf9('0x31'))){_0x566d51[_0x7bf9('0x1b')]=qs['limit'](_0x5a7a61[_0x7bf9('0x2a')][_0x7bf9('0x1b')]);_0x566d51[_0x7bf9('0x1a')]=qs['offset'](_0x5a7a61[_0x7bf9('0x2a')]['offset']);}_0x566d51['order']=qs[_0x7bf9('0x32')](_0x5a7a61[_0x7bf9('0x2a')][_0x7bf9('0x32')]);_0x566d51[_0x7bf9('0x33')]=qs[_0x7bf9('0x2b')](_[_0x7bf9('0x34')](_0x5a7a61[_0x7bf9('0x2a')],_0x33eb0d[_0x7bf9('0x2b')]),_0x169f9e);if(_0x5a7a61[_0x7bf9('0x2a')][_0x7bf9('0x35')]){_0x566d51[_0x7bf9('0x33')]=_[_0x7bf9('0x36')](_0x566d51[_0x7bf9('0x33')],{'$or':_['map'](_0x169f9e,function(_0xbf2279){if(_0xbf2279[_0x7bf9('0x28')]!=='VIRTUAL'){var _0x2f938d={};_0x2f938d[_0xbf2279[_0x7bf9('0x24')]]={'$like':'%'+_0x5a7a61[_0x7bf9('0x2a')][_0x7bf9('0x35')]+'%'};return _0x2f938d;}})});}_0x566d51=_['merge']({},_0x566d51,_0x5a7a61[_0x7bf9('0x37')]);var _0x3611cd={'where':_0x566d51['where']};return db[_0x7bf9('0x38')][_0x7bf9('0x19')](_0x3611cd)[_0x7bf9('0x1f')](function(_0x3efdec){_0x116546[_0x7bf9('0x19')]=_0x3efdec;if(_0x5a7a61['query'][_0x7bf9('0x39')]){_0x566d51[_0x7bf9('0x3a')]=[{'all':!![]}];}return db[_0x7bf9('0x38')][_0x7bf9('0x3b')](_0x566d51);})[_0x7bf9('0x1f')](function(_0x59e306){_0x116546[_0x7bf9('0x3c')]=_0x59e306;return _0x116546;})[_0x7bf9('0x1f')](respondWithFilteredResult(_0x532332,_0x566d51))['catch'](handleError(_0x532332,null));};exports[_0x7bf9('0x3d')]=function(_0x509a46,_0x307203){var _0x471200={'raw':![],'where':{'id':_0x509a46[_0x7bf9('0x3e')]['id']}},_0x393742={};_0x393742[_0x7bf9('0x2c')]=_[_0x7bf9('0x3f')](db[_0x7bf9('0x38')]['rawAttributes']);_0x393742[_0x7bf9('0x2a')]=_[_0x7bf9('0x3f')](_0x509a46[_0x7bf9('0x2a')]);_0x393742[_0x7bf9('0x2b')]=_['intersection'](_0x393742['model'],_0x393742['query']);_0x471200['attributes']=_[_0x7bf9('0x40')](_0x393742[_0x7bf9('0x2c')],qs[_0x7bf9('0x2d')](_0x509a46[_0x7bf9('0x2a')][_0x7bf9('0x2d')]));_0x471200[_0x7bf9('0x2e')]=_0x471200[_0x7bf9('0x2e')][_0x7bf9('0x2f')]?_0x471200[_0x7bf9('0x2e')]:_0x393742[_0x7bf9('0x2c')];if(_0x509a46[_0x7bf9('0x2a')][_0x7bf9('0x39')]){_0x471200[_0x7bf9('0x3a')]=[{'all':!![]}];}_0x471200=_[_0x7bf9('0x36')]({},_0x471200,_0x509a46[_0x7bf9('0x37')]);return db[_0x7bf9('0x38')][_0x7bf9('0x41')](_0x471200)['then'](handleEntityNotFound(_0x307203,null))[_0x7bf9('0x1f')](respondWithResult(_0x307203,null))[_0x7bf9('0x42')](handleError(_0x307203,null));};exports[_0x7bf9('0x43')]=function(_0x11a90c,_0x39aeb0){return db['Integration']['create'](_0x11a90c[_0x7bf9('0x44')],{})[_0x7bf9('0x1f')](respondWithResult(_0x39aeb0,0xc9))[_0x7bf9('0x42')](handleError(_0x39aeb0,null));};exports['update']=function(_0x5ad1ea,_0x36c7e2){if(_0x5ad1ea[_0x7bf9('0x44')]['id']){delete _0x5ad1ea[_0x7bf9('0x44')]['id'];}return db['Integration'][_0x7bf9('0x41')]({'where':{'id':_0x5ad1ea['params']['id']}})[_0x7bf9('0x1f')](handleEntityNotFound(_0x36c7e2,null))[_0x7bf9('0x1f')](saveUpdates(_0x5ad1ea['body'],null))[_0x7bf9('0x1f')](respondWithResult(_0x36c7e2,null))[_0x7bf9('0x42')](handleError(_0x36c7e2,null));};exports[_0x7bf9('0x20')]=function(_0x3a7ab4,_0x2e38e7){return db[_0x7bf9('0x38')]['find']({'where':{'id':_0x3a7ab4['params']['id']}})[_0x7bf9('0x1f')](handleEntityNotFound(_0x2e38e7,null))[_0x7bf9('0x1f')](removeEntity(_0x2e38e7,null))[_0x7bf9('0x42')](handleError(_0x2e38e7,null));};
\ No newline at end of file
diff --git a/server/api/integration/integration.model.js b/server/api/integration/integration.model.js
index b0b981e..bc70706 100644
--- a/server/api/integration/integration.model.js
+++ b/server/api/integration/integration.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x402e=['path','rimraf','../../config/environment','./integration.attributes','exports','integrations','lodash','util','../../config/logger','moment','bluebird'];(function(_0x576dea,_0x4bc527){var _0x4cd999=function(_0x5c1ead){while(--_0x5c1ead){_0x576dea['push'](_0x576dea['shift']());}};_0x4cd999(++_0x4bc527);}(_0x402e,0x119));var _0xe402=function(_0x5b34c0,_0x3ad403){_0x5b34c0=_0x5b34c0-0x0;var _0x242bd3=_0x402e[_0x5b34c0];return _0x242bd3;};'use strict';var _=require(_0xe402('0x0'));var util=require(_0xe402('0x1'));var logger=require(_0xe402('0x2'))('api');var moment=require(_0xe402('0x3'));var BPromise=require(_0xe402('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xe402('0x5'));var rimraf=require(_0xe402('0x6'));var config=require(_0xe402('0x7'));var attributes=require(_0xe402('0x8'));module[_0xe402('0x9')]=function(_0x4133d6,_0x2edf98){return _0x4133d6['define']('Integration',attributes,{'tableName':_0xe402('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x4ca7=['integrations','lodash','util','../../config/logger','api','bluebird','request-promise','path','./integration.attributes','exports','define'];(function(_0x4bfac3,_0x58324d){var _0x15f0f2=function(_0xf0c511){while(--_0xf0c511){_0x4bfac3['push'](_0x4bfac3['shift']());}};_0x15f0f2(++_0x58324d);}(_0x4ca7,0x14b));var _0x74ca=function(_0x51f9e6,_0x2caddb){_0x51f9e6=_0x51f9e6-0x0;var _0x29905d=_0x4ca7[_0x51f9e6];return _0x29905d;};'use strict';var _=require(_0x74ca('0x0'));var util=require(_0x74ca('0x1'));var logger=require(_0x74ca('0x2'))(_0x74ca('0x3'));var moment=require('moment');var BPromise=require(_0x74ca('0x4'));var rp=require(_0x74ca('0x5'));var fs=require('fs');var path=require(_0x74ca('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x74ca('0x7'));module[_0x74ca('0x8')]=function(_0x79d477,_0x506b7e){return _0x79d477[_0x74ca('0x9')]('Integration',attributes,{'tableName':_0x74ca('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/integration/integration.rpc.js b/server/api/integration/integration.rpc.js
index 93bb883..badbbbf 100644
--- a/server/api/integration/integration.rpc.js
+++ b/server/api/integration/integration.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x4ddd=['../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','Integration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','lodash'];(function(_0x4bd046,_0x1a8a43){var _0x148457=function(_0x263601){while(--_0x263601){_0x4bd046['push'](_0x4bd046['shift']());}};_0x148457(++_0x1a8a43);}(_0x4ddd,0x18b));var _0xd4dd=function(_0x5c351c,_0x2046d8){_0x5c351c=_0x5c351c-0x0;var _0x26f3b3=_0x4ddd[_0x5c351c];return _0x26f3b3;};'use strict';var _=require(_0xd4dd('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xd4dd('0x1'));var logger=require(_0xd4dd('0x2'))(_0xd4dd('0x3'));var config=require('../../config/environment');var jayson=require(_0xd4dd('0x4'));var client=jayson[_0xd4dd('0x5')][_0xd4dd('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x65f5a4,_0x3e8b86,_0x1c3abd){return new BPromise(function(_0xa057d1,_0x55b937){return client[_0xd4dd('0x7')](_0x65f5a4,_0x1c3abd)[_0xd4dd('0x8')](function(_0x490200){logger[_0xd4dd('0x9')](_0xd4dd('0xa'),_0x3e8b86,_0xd4dd('0xb'));logger[_0xd4dd('0xc')]('Integration,\x20%s,\x20%s,\x20%s',_0x3e8b86,'request\x20sent',JSON[_0xd4dd('0xd')](_0x490200));if(_0x490200['error']){if(_0x490200[_0xd4dd('0xe')][_0xd4dd('0xf')]===0x1f4){logger[_0xd4dd('0xe')](_0xd4dd('0xa'),_0x3e8b86,_0x490200[_0xd4dd('0xe')][_0xd4dd('0x10')]);return _0x55b937(_0x490200[_0xd4dd('0xe')]['message']);}logger[_0xd4dd('0xe')](_0xd4dd('0xa'),_0x3e8b86,_0x490200[_0xd4dd('0xe')][_0xd4dd('0x10')]);return _0xa057d1(_0x490200['error'][_0xd4dd('0x10')]);}else{logger[_0xd4dd('0x9')](_0xd4dd('0xa'),_0x3e8b86,_0xd4dd('0xb'));_0xa057d1(_0x490200['result'][_0xd4dd('0x10')]);}})[_0xd4dd('0x11')](function(_0x35b901){logger[_0xd4dd('0xe')](_0xd4dd('0xa'),_0x3e8b86,_0x35b901);_0x55b937(_0x35b901);});});}
\ No newline at end of file
+var _0xd89f=['then','info','Integration,\x20%s,\x20%s','request\x20sent','debug','stringify','code','error','message','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request'];(function(_0xd2da85,_0x40056b){var _0x2fe824=function(_0x6cc195){while(--_0x6cc195){_0xd2da85['push'](_0xd2da85['shift']());}};_0x2fe824(++_0x40056b);}(_0xd89f,0x191));var _0xfd89=function(_0x154b29,_0x387940){_0x154b29=_0x154b29-0x0;var _0x507e8d=_0xd89f[_0x154b29];return _0x507e8d;};'use strict';var _=require(_0xfd89('0x0'));var util=require(_0xfd89('0x1'));var moment=require(_0xfd89('0x2'));var BPromise=require('bluebird');var rs=require(_0xfd89('0x3'));var fs=require('fs');var Redis=require(_0xfd89('0x4'));var db=require(_0xfd89('0x5'))['db'];var utils=require(_0xfd89('0x6'));var logger=require(_0xfd89('0x7'))(_0xfd89('0x8'));var config=require('../../config/environment');var jayson=require(_0xfd89('0x9'));var client=jayson[_0xfd89('0xa')][_0xfd89('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x31322a,_0x3745e2,_0x2c02ed){return new BPromise(function(_0x2cccba,_0x163b36){return client[_0xfd89('0xc')](_0x31322a,_0x2c02ed)[_0xfd89('0xd')](function(_0x3379d3){logger[_0xfd89('0xe')](_0xfd89('0xf'),_0x3745e2,_0xfd89('0x10'));logger[_0xfd89('0x11')]('Integration,\x20%s,\x20%s,\x20%s',_0x3745e2,_0xfd89('0x10'),JSON[_0xfd89('0x12')](_0x3379d3));if(_0x3379d3['error']){if(_0x3379d3['error'][_0xfd89('0x13')]===0x1f4){logger[_0xfd89('0x14')](_0xfd89('0xf'),_0x3745e2,_0x3379d3[_0xfd89('0x14')]['message']);return _0x163b36(_0x3379d3[_0xfd89('0x14')]['message']);}logger[_0xfd89('0x14')](_0xfd89('0xf'),_0x3745e2,_0x3379d3[_0xfd89('0x14')]['message']);return _0x2cccba(_0x3379d3['error']['message']);}else{logger[_0xfd89('0xe')](_0xfd89('0xf'),_0x3745e2,'request\x20sent');_0x2cccba(_0x3379d3['result'][_0xfd89('0x15')]);}})[_0xfd89('0x16')](function(_0x3e0363){logger['error']('Integration,\x20%s,\x20%s',_0x3745e2,_0x3e0363);_0x163b36(_0x3e0363);});});}
\ No newline at end of file
diff --git a/server/api/integrationReport/index.js b/server/api/integrationReport/index.js
index 5af7051..2503c66 100644
--- a/server/api/integrationReport/index.js
+++ b/server/api/integrationReport/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xbe06=['create','put','update','destroy','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','post'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0xbe06,0x144));var _0x6be0=function(_0x19a3b0,_0xda9044){_0x19a3b0=_0x19a3b0-0x0;var _0x47caee=_0xbe06[_0x19a3b0];return _0x47caee;};'use strict';var multer=require(_0x6be0('0x0'));var util=require('util');var path=require(_0x6be0('0x1'));var timeout=require(_0x6be0('0x2'));var express=require(_0x6be0('0x3'));var router=express[_0x6be0('0x4')]();var auth=require(_0x6be0('0x5'));var interaction=require(_0x6be0('0x6'));var config=require(_0x6be0('0x7'));var controller=require('./integrationReport.controller');router[_0x6be0('0x8')]('/',auth[_0x6be0('0x9')](),controller['index']);router['get']('/describe',auth[_0x6be0('0x9')](),controller['describe']);router[_0x6be0('0x8')](_0x6be0('0xa'),auth[_0x6be0('0x9')](),controller['show']);router[_0x6be0('0xb')]('/',auth['isAuthenticated'](),controller[_0x6be0('0xc')]);router[_0x6be0('0xd')]('/:id',auth['isAuthenticated'](),controller[_0x6be0('0xe')]);router['delete'](_0x6be0('0xa'),auth[_0x6be0('0x9')](),controller[_0x6be0('0xf')]);module['exports']=router;
\ No newline at end of file
+var _0xde13=['delete','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/describe','isAuthenticated','/:id','create','put','update'];(function(_0x5681b0,_0x2d2e35){var _0x2b9198=function(_0x382370){while(--_0x382370){_0x5681b0['push'](_0x5681b0['shift']());}};_0x2b9198(++_0x2d2e35);}(_0xde13,0x146));var _0x3de1=function(_0x4e3d67,_0x50a8c9){_0x4e3d67=_0x4e3d67-0x0;var _0x16530d=_0xde13[_0x4e3d67];return _0x16530d;};'use strict';var multer=require(_0x3de1('0x0'));var util=require(_0x3de1('0x1'));var path=require(_0x3de1('0x2'));var timeout=require(_0x3de1('0x3'));var express=require(_0x3de1('0x4'));var router=express['Router']();var auth=require(_0x3de1('0x5'));var interaction=require(_0x3de1('0x6'));var config=require(_0x3de1('0x7'));var controller=require('./integrationReport.controller');router[_0x3de1('0x8')]('/',auth['isAuthenticated'](),controller[_0x3de1('0x9')]);router[_0x3de1('0x8')](_0x3de1('0xa'),auth[_0x3de1('0xb')](),controller['describe']);router[_0x3de1('0x8')](_0x3de1('0xc'),auth[_0x3de1('0xb')](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller[_0x3de1('0xd')]);router[_0x3de1('0xe')](_0x3de1('0xc'),auth['isAuthenticated'](),controller[_0x3de1('0xf')]);router[_0x3de1('0x10')](_0x3de1('0xc'),auth['isAuthenticated'](),controller['destroy']);module[_0x3de1('0x11')]=router;
\ No newline at end of file
diff --git a/server/api/integrationReport/integrationReport.attributes.js b/server/api/integrationReport/integrationReport.attributes.js
index f500c6b..24629d6 100644
--- a/server/api/integrationReport/integrationReport.attributes.js
+++ b/server/api/integrationReport/integrationReport.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xf788=['STRING','INTEGER','DATE','BOOLEAN','TEXT','ENUM','SENDING','RECEIVED','FAILED'];(function(_0x1633b7,_0x581d1a){var _0x4da6ad=function(_0x44536f){while(--_0x44536f){_0x1633b7['push'](_0x1633b7['shift']());}};_0x4da6ad(++_0x581d1a);}(_0xf788,0xa2));var _0x8f78=function(_0x33032e,_0x31411a){_0x33032e=_0x33032e-0x0;var _0x13316b=_0xf788[_0x33032e];return _0x13316b;};'use strict';var Sequelize=require('sequelize');module['exports']={'integration':{'type':Sequelize['STRING']},'eventChannel':{'type':Sequelize['STRING']},'exitStatus':{'type':Sequelize[_0x8f78('0x0')]},'ticketId':{'type':Sequelize[_0x8f78('0x0')]},'integrationId':{'type':Sequelize[_0x8f78('0x1')]},'contacts':{'type':Sequelize[_0x8f78('0x0')]},'uniqueid':{'type':Sequelize[_0x8f78('0x0')]},'calleridnum':{'type':Sequelize[_0x8f78('0x0')]},'calleridname':{'type':Sequelize[_0x8f78('0x0')]},'queue':{'type':Sequelize[_0x8f78('0x0')]},'interface':{'type':Sequelize[_0x8f78('0x0')]},'membername':{'type':Sequelize['STRING']},'agentcalledAt':{'type':Sequelize[_0x8f78('0x2')]},'agentconnectAt':{'type':Sequelize[_0x8f78('0x2')]},'holdtime':{'type':Sequelize[_0x8f78('0x1')]},'agentcomplete':{'type':Sequelize[_0x8f78('0x3')],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize[_0x8f78('0x2')]},'talktime':{'type':Sequelize[_0x8f78('0x1')]},'agentacw':{'type':Sequelize[_0x8f78('0x3')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x8f78('0x1')]},'reason':{'type':Sequelize[_0x8f78('0x0')]},'agentringnoanswer':{'type':Sequelize[_0x8f78('0x3')],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize['DATE']},'agentdump':{'type':Sequelize[_0x8f78('0x3')],'defaultValue':![]},'agentdumpAt':{'type':Sequelize[_0x8f78('0x2')]},'lastevent':{'type':Sequelize['STRING']},'channel':{'type':Sequelize['STRING']},'channelstate':{'type':Sequelize['INTEGER']},'channelstatedesc':{'type':Sequelize[_0x8f78('0x0')]},'connectedlinenum':{'type':Sequelize[_0x8f78('0x0')]},'connectedlinename':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x8f78('0x0')]},'accountcode':{'type':Sequelize[_0x8f78('0x0')]},'context':{'type':Sequelize[_0x8f78('0x0')]},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0x8f78('0x0')]},'destchannel':{'type':Sequelize[_0x8f78('0x0')]},'destchannelstate':{'type':Sequelize[_0x8f78('0x1')]},'destchannelstatedesc':{'type':Sequelize[_0x8f78('0x0')]},'destcalleridnum':{'type':Sequelize[_0x8f78('0x0')]},'destcalleridname':{'type':Sequelize['STRING']},'destconnectedlinenum':{'type':Sequelize['STRING']},'destconnectedlinename':{'type':Sequelize[_0x8f78('0x0')]},'destlanguage':{'type':Sequelize['STRING']},'destaccountcode':{'type':Sequelize[_0x8f78('0x0')]},'destcontext':{'type':Sequelize[_0x8f78('0x0')]},'destexten':{'type':Sequelize[_0x8f78('0x0')]},'destpriority':{'type':Sequelize['STRING']},'destuniqueid':{'type':Sequelize[_0x8f78('0x0')]},'messageId':{'type':Sequelize[_0x8f78('0x0')]},'inReplyTo':{'type':Sequelize[_0x8f78('0x0')]},'subject':{'type':Sequelize[_0x8f78('0x0')]},'from':{'type':Sequelize['STRING']},'to':{'type':Sequelize[_0x8f78('0x0')]},'cc':{'type':Sequelize[_0x8f78('0x0')]},'attachment':{'type':Sequelize[_0x8f78('0x4')]},'html':{'type':Sequelize[_0x8f78('0x4')]},'text':{'type':Sequelize['TEXT']},'status':{'type':Sequelize[_0x8f78('0x5')]('SENT',_0x8f78('0x6'),_0x8f78('0x7'),_0x8f78('0x8'))},'url':{'type':Sequelize['STRING']},'app':{'type':Sequelize[_0x8f78('0x0')]},'appdata':{'type':Sequelize[_0x8f78('0x0')]},'projectId':{'type':Sequelize[_0x8f78('0x1')]}};
\ No newline at end of file
+var _0x8431=['DATE','BOOLEAN','TEXT','SENT','RECEIVED','sequelize','exports','STRING','INTEGER'];(function(_0x386c3e,_0x44a375){var _0x4b8e13=function(_0x583c8f){while(--_0x583c8f){_0x386c3e['push'](_0x386c3e['shift']());}};_0x4b8e13(++_0x44a375);}(_0x8431,0x1c7));var _0x1843=function(_0x270947,_0x560217){_0x270947=_0x270947-0x0;var _0x506a51=_0x8431[_0x270947];return _0x506a51;};'use strict';var Sequelize=require(_0x1843('0x0'));module[_0x1843('0x1')]={'integration':{'type':Sequelize[_0x1843('0x2')]},'eventChannel':{'type':Sequelize[_0x1843('0x2')]},'exitStatus':{'type':Sequelize['STRING']},'ticketId':{'type':Sequelize[_0x1843('0x2')]},'integrationId':{'type':Sequelize[_0x1843('0x3')]},'contacts':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x1843('0x2')]},'calleridnum':{'type':Sequelize[_0x1843('0x2')]},'calleridname':{'type':Sequelize[_0x1843('0x2')]},'queue':{'type':Sequelize[_0x1843('0x2')]},'interface':{'type':Sequelize[_0x1843('0x2')]},'membername':{'type':Sequelize[_0x1843('0x2')]},'agentcalledAt':{'type':Sequelize['DATE']},'agentconnectAt':{'type':Sequelize[_0x1843('0x4')]},'holdtime':{'type':Sequelize[_0x1843('0x3')]},'agentcomplete':{'type':Sequelize[_0x1843('0x5')],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize['DATE']},'talktime':{'type':Sequelize[_0x1843('0x3')]},'agentacw':{'type':Sequelize[_0x1843('0x5')],'defaultValue':![]},'acwtime':{'type':Sequelize['INTEGER']},'reason':{'type':Sequelize[_0x1843('0x2')]},'agentringnoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize[_0x1843('0x4')]},'agentdump':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentdumpAt':{'type':Sequelize[_0x1843('0x4')]},'lastevent':{'type':Sequelize[_0x1843('0x2')]},'channel':{'type':Sequelize[_0x1843('0x2')]},'channelstate':{'type':Sequelize[_0x1843('0x3')]},'channelstatedesc':{'type':Sequelize[_0x1843('0x2')]},'connectedlinenum':{'type':Sequelize[_0x1843('0x2')]},'connectedlinename':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x1843('0x2')]},'accountcode':{'type':Sequelize[_0x1843('0x2')]},'context':{'type':Sequelize[_0x1843('0x2')]},'exten':{'type':Sequelize[_0x1843('0x2')]},'priority':{'type':Sequelize[_0x1843('0x2')]},'destchannel':{'type':Sequelize['STRING']},'destchannelstate':{'type':Sequelize[_0x1843('0x3')]},'destchannelstatedesc':{'type':Sequelize[_0x1843('0x2')]},'destcalleridnum':{'type':Sequelize[_0x1843('0x2')]},'destcalleridname':{'type':Sequelize['STRING']},'destconnectedlinenum':{'type':Sequelize['STRING']},'destconnectedlinename':{'type':Sequelize[_0x1843('0x2')]},'destlanguage':{'type':Sequelize[_0x1843('0x2')]},'destaccountcode':{'type':Sequelize['STRING']},'destcontext':{'type':Sequelize['STRING']},'destexten':{'type':Sequelize[_0x1843('0x2')]},'destpriority':{'type':Sequelize[_0x1843('0x2')]},'destuniqueid':{'type':Sequelize[_0x1843('0x2')]},'messageId':{'type':Sequelize[_0x1843('0x2')]},'inReplyTo':{'type':Sequelize[_0x1843('0x2')]},'subject':{'type':Sequelize[_0x1843('0x2')]},'from':{'type':Sequelize['STRING']},'to':{'type':Sequelize['STRING']},'cc':{'type':Sequelize['STRING']},'attachment':{'type':Sequelize[_0x1843('0x6')]},'html':{'type':Sequelize['TEXT']},'text':{'type':Sequelize['TEXT']},'status':{'type':Sequelize['ENUM'](_0x1843('0x7'),'SENDING',_0x1843('0x8'),'FAILED')},'url':{'type':Sequelize[_0x1843('0x2')]},'app':{'type':Sequelize[_0x1843('0x2')]},'appdata':{'type':Sequelize[_0x1843('0x2')]},'projectId':{'type':Sequelize[_0x1843('0x3')]}};
\ No newline at end of file
diff --git a/server/api/integrationReport/integrationReport.controller.js b/server/api/integrationReport/integrationReport.controller.js
index c342226..32a215f 100644
--- a/server/api/integrationReport/integrationReport.controller.js
+++ b/server/api/integrationReport/integrationReport.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xdf04=['rimraf','fast-json-patch','moment','bluebird','util','path','sox','to-csv','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','count','offset','limit','set','Content-Range','save','then','destroy','sendStatus','name','send','index','map','IntegrationReport','rawAttributes','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','catch','show','options','create','update','body','find','params','describe','html-pdf','eml-format'];(function(_0x35400d,_0x41dd4a){var _0x4e4fee=function(_0x4b9569){while(--_0x4b9569){_0x35400d['push'](_0x35400d['shift']());}};_0x4e4fee(++_0x41dd4a);}(_0xdf04,0x15c));var _0x4df0=function(_0x2cbc09,_0x2793bc){_0x2cbc09=_0x2cbc09-0x0;var _0x54bd64=_0xdf04[_0x2cbc09];return _0x54bd64;};'use strict';var pdf=require(_0x4df0('0x0'));var emlformat=require(_0x4df0('0x1'));var rimraf=require(_0x4df0('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4df0('0x3'));var rp=require('request-promise');var moment=require(_0x4df0('0x4'));var BPromise=require(_0x4df0('0x5'));var Mustache=require('mustache');var util=require(_0x4df0('0x6'));var path=require(_0x4df0('0x7'));var sox=require(_0x4df0('0x8'));var csv=require(_0x4df0('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x4df0('0xa'));var squel=require(_0x4df0('0xb'));var crypto=require(_0x4df0('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x4df0('0xd'));var toCsv=require('to-csv');var querystring=require(_0x4df0('0xe'));var Papa=require(_0x4df0('0xf'));var Redis=require('ioredis');var authService=require(_0x4df0('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x4df0('0x11'));var hardwareService=require(_0x4df0('0x12'));var logger=require(_0x4df0('0x13'))(_0x4df0('0x14'));var utils=require(_0x4df0('0x15'));var config=require(_0x4df0('0x16'));var db=require(_0x4df0('0x17'))['db'];function respondWithStatusCode(_0x3c1e1c,_0x4cb4f5){_0x4cb4f5=_0x4cb4f5||0xcc;return function(_0x3337ec){if(_0x3337ec){return _0x3c1e1c['sendStatus'](_0x4cb4f5);}return _0x3c1e1c[_0x4df0('0x18')](_0x4cb4f5)[_0x4df0('0x19')]();};}function respondWithResult(_0x2dfd3f,_0x53848d){_0x53848d=_0x53848d||0xc8;return function(_0x2dcf04){if(_0x2dcf04){return _0x2dfd3f[_0x4df0('0x18')](_0x53848d)[_0x4df0('0x1a')](_0x2dcf04);}};}function respondWithFilteredResult(_0x15496d,_0x2795bb){return function(_0x47c157){if(_0x47c157){var _0x2b3077=_0x47c157[_0x4df0('0x1b')],_0x5e7f3c=_0x2795bb[_0x4df0('0x1c')],_0xf50bc6=_0x2795bb[_0x4df0('0x1c')]+_0x2795bb[_0x4df0('0x1d')],_0x3cd737;if(_0xf50bc6>=_0x2b3077){_0xf50bc6=_0x2b3077;_0x3cd737=0xc8;}else{_0x3cd737=0xce;}_0x15496d[_0x4df0('0x18')](_0x3cd737);return _0x15496d[_0x4df0('0x1e')](_0x4df0('0x1f'),_0x5e7f3c+'-'+_0xf50bc6+'/'+_0x2b3077)[_0x4df0('0x1a')](_0x47c157);}return null;};}function patchUpdates(_0x2612b7){return function(_0x1c689c){try{jsonpatch['apply'](_0x1c689c,_0x2612b7,!![]);}catch(_0x432e1d){return BPromise['reject'](_0x432e1d);}return _0x1c689c[_0x4df0('0x20')]();};}function saveUpdates(_0x2899ae,_0x5d5b07){return function(_0x15fcc0){if(_0x15fcc0){return _0x15fcc0['update'](_0x2899ae)[_0x4df0('0x21')](function(_0x216686){return _0x216686;});}return null;};}function removeEntity(_0x10d37b,_0x16fee2){return function(_0x8c5219){if(_0x8c5219){return _0x8c5219[_0x4df0('0x22')]()[_0x4df0('0x21')](function(){_0x10d37b[_0x4df0('0x18')](0xcc)[_0x4df0('0x19')]();});}};}function handleEntityNotFound(_0x5b6462,_0x24a086){return function(_0x50101d){if(!_0x50101d){_0x5b6462[_0x4df0('0x23')](0x194);}return _0x50101d;};}function handleError(_0x21d071,_0x5bdc85){_0x5bdc85=_0x5bdc85||0x1f4;return function(_0xdce1ee){logger['error'](_0xdce1ee['stack']);if(_0xdce1ee['name']){delete _0xdce1ee[_0x4df0('0x24')];}_0x21d071[_0x4df0('0x18')](_0x5bdc85)[_0x4df0('0x25')](_0xdce1ee);};}exports[_0x4df0('0x26')]=function(_0x376a0d,_0x40ee75){var _0x873c8e={},_0x1d530d={},_0xc1a362={'count':0x0,'rows':[]};var _0x168a6c=_[_0x4df0('0x27')](db[_0x4df0('0x28')][_0x4df0('0x29')],function(_0x3c0a79){return{'name':_0x3c0a79['fieldName'],'type':_0x3c0a79[_0x4df0('0x2a')][_0x4df0('0x2b')]};});_0x1d530d['model']=_[_0x4df0('0x27')](_0x168a6c,_0x4df0('0x24'));_0x1d530d[_0x4df0('0x2c')]=_[_0x4df0('0x2d')](_0x376a0d['query']);_0x1d530d[_0x4df0('0x2e')]=_[_0x4df0('0x2f')](_0x1d530d[_0x4df0('0x30')],_0x1d530d['query']);_0x873c8e[_0x4df0('0x31')]=_['intersection'](_0x1d530d[_0x4df0('0x30')],qs[_0x4df0('0x32')](_0x376a0d['query'][_0x4df0('0x32')]));_0x873c8e['attributes']=_0x873c8e[_0x4df0('0x31')][_0x4df0('0x33')]?_0x873c8e[_0x4df0('0x31')]:_0x1d530d[_0x4df0('0x30')];if(!_0x376a0d[_0x4df0('0x2c')][_0x4df0('0x34')]('nolimit')){_0x873c8e[_0x4df0('0x1d')]=qs['limit'](_0x376a0d[_0x4df0('0x2c')][_0x4df0('0x1d')]);_0x873c8e[_0x4df0('0x1c')]=qs[_0x4df0('0x1c')](_0x376a0d['query'][_0x4df0('0x1c')]);}_0x873c8e['order']=qs[_0x4df0('0x35')](_0x376a0d[_0x4df0('0x2c')][_0x4df0('0x35')]);_0x873c8e[_0x4df0('0x36')]=qs[_0x4df0('0x2e')](_[_0x4df0('0x37')](_0x376a0d[_0x4df0('0x2c')],_0x1d530d[_0x4df0('0x2e')]),_0x168a6c);if(_0x376a0d[_0x4df0('0x2c')][_0x4df0('0x38')]){_0x873c8e[_0x4df0('0x36')]=_[_0x4df0('0x39')](_0x873c8e['where'],{'$or':_[_0x4df0('0x27')](_0x168a6c,function(_0x3fe689){if(_0x3fe689[_0x4df0('0x2a')]!==_0x4df0('0x3a')){var _0x3a10a1={};_0x3a10a1[_0x3fe689[_0x4df0('0x24')]]={'$like':'%'+_0x376a0d[_0x4df0('0x2c')][_0x4df0('0x38')]+'%'};return _0x3a10a1;}})});}_0x873c8e=_[_0x4df0('0x39')]({},_0x873c8e,_0x376a0d['options']);var _0x2bc932={'where':_0x873c8e[_0x4df0('0x36')]};return db[_0x4df0('0x28')][_0x4df0('0x1b')](_0x2bc932)[_0x4df0('0x21')](function(_0x575663){_0xc1a362[_0x4df0('0x1b')]=_0x575663;if(_0x376a0d[_0x4df0('0x2c')][_0x4df0('0x3b')]){_0x873c8e[_0x4df0('0x3c')]=[{'all':!![]}];}return db[_0x4df0('0x28')]['findAll'](_0x873c8e);})[_0x4df0('0x21')](function(_0x591f3b){_0xc1a362['rows']=_0x591f3b;return _0xc1a362;})[_0x4df0('0x21')](respondWithFilteredResult(_0x40ee75,_0x873c8e))[_0x4df0('0x3d')](handleError(_0x40ee75,null));};exports[_0x4df0('0x3e')]=function(_0x5015f4,_0x1e5944){var _0x3d2846={'raw':![],'where':{'id':_0x5015f4['params']['id']}},_0x26520c={};_0x26520c[_0x4df0('0x30')]=_['keys'](db['IntegrationReport'][_0x4df0('0x29')]);_0x26520c[_0x4df0('0x2c')]=_[_0x4df0('0x2d')](_0x5015f4[_0x4df0('0x2c')]);_0x26520c[_0x4df0('0x2e')]=_['intersection'](_0x26520c[_0x4df0('0x30')],_0x26520c['query']);_0x3d2846[_0x4df0('0x31')]=_[_0x4df0('0x2f')](_0x26520c[_0x4df0('0x30')],qs['fields'](_0x5015f4[_0x4df0('0x2c')][_0x4df0('0x32')]));_0x3d2846[_0x4df0('0x31')]=_0x3d2846[_0x4df0('0x31')][_0x4df0('0x33')]?_0x3d2846[_0x4df0('0x31')]:_0x26520c[_0x4df0('0x30')];if(_0x5015f4[_0x4df0('0x2c')][_0x4df0('0x3b')]){_0x3d2846[_0x4df0('0x3c')]=[{'all':!![]}];}_0x3d2846=_[_0x4df0('0x39')]({},_0x3d2846,_0x5015f4[_0x4df0('0x3f')]);return db[_0x4df0('0x28')]['find'](_0x3d2846)[_0x4df0('0x21')](handleEntityNotFound(_0x1e5944,null))[_0x4df0('0x21')](respondWithResult(_0x1e5944,null))[_0x4df0('0x3d')](handleError(_0x1e5944,null));};exports[_0x4df0('0x40')]=function(_0xd8ef2e,_0x12cdf2){return db['IntegrationReport'][_0x4df0('0x40')](_0xd8ef2e['body'],{})[_0x4df0('0x21')](respondWithResult(_0x12cdf2,0xc9))['catch'](handleError(_0x12cdf2,null));};exports[_0x4df0('0x41')]=function(_0x44b8c5,_0x517430){if(_0x44b8c5[_0x4df0('0x42')]['id']){delete _0x44b8c5[_0x4df0('0x42')]['id'];}return db[_0x4df0('0x28')][_0x4df0('0x43')]({'where':{'id':_0x44b8c5[_0x4df0('0x44')]['id']}})[_0x4df0('0x21')](handleEntityNotFound(_0x517430,null))[_0x4df0('0x21')](saveUpdates(_0x44b8c5[_0x4df0('0x42')],null))[_0x4df0('0x21')](respondWithResult(_0x517430,null))[_0x4df0('0x3d')](handleError(_0x517430,null));};exports[_0x4df0('0x22')]=function(_0x5a98eb,_0x31129d){return db['IntegrationReport'][_0x4df0('0x43')]({'where':{'id':_0x5a98eb['params']['id']}})[_0x4df0('0x21')](handleEntityNotFound(_0x31129d,null))[_0x4df0('0x21')](removeEntity(_0x31129d,null))[_0x4df0('0x3d')](handleError(_0x31129d,null));};exports[_0x4df0('0x45')]=function(_0x16481b,_0x1e035d){return db[_0x4df0('0x28')][_0x4df0('0x45')]()[_0x4df0('0x21')](respondWithResult(_0x1e035d,null))[_0x4df0('0x3d')](handleError(_0x1e035d,null));};
\ No newline at end of file
+var _0xf575=['to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','count','offset','limit','Content-Range','apply','reject','save','error','name','index','map','IntegrationReport','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','VIRTUAL','filter','merge','then','include','findAll','rows','catch','show','rawAttributes','options','find','create','body','params','destroy','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox'];(function(_0x494d1f,_0x3f72ff){var _0x457b6e=function(_0x38cb16){while(--_0x38cb16){_0x494d1f['push'](_0x494d1f['shift']());}};_0x457b6e(++_0x3f72ff);}(_0xf575,0x1b8));var _0x5f57=function(_0x48a32e,_0x42c992){_0x48a32e=_0x48a32e-0x0;var _0x15fbc9=_0xf575[_0x48a32e];return _0x15fbc9;};'use strict';var pdf=require(_0x5f57('0x0'));var emlformat=require(_0x5f57('0x1'));var rimraf=require(_0x5f57('0x2'));var zipdir=require(_0x5f57('0x3'));var jsonpatch=require(_0x5f57('0x4'));var rp=require(_0x5f57('0x5'));var moment=require('moment');var BPromise=require(_0x5f57('0x6'));var Mustache=require(_0x5f57('0x7'));var util=require('util');var path=require(_0x5f57('0x8'));var sox=require(_0x5f57('0x9'));var csv=require(_0x5f57('0xa'));var ejs=require(_0x5f57('0xb'));var fs=require('fs');var _=require(_0x5f57('0xc'));var squel=require(_0x5f57('0xd'));var crypto=require(_0x5f57('0xe'));var jsforce=require(_0x5f57('0xf'));var deskjs=require(_0x5f57('0x10'));var toCsv=require(_0x5f57('0xa'));var querystring=require('querystring');var Papa=require(_0x5f57('0x11'));var Redis=require('ioredis');var authService=require(_0x5f57('0x12'));var qs=require(_0x5f57('0x13'));var as=require(_0x5f57('0x14'));var hardwareService=require(_0x5f57('0x15'));var logger=require(_0x5f57('0x16'))(_0x5f57('0x17'));var utils=require(_0x5f57('0x18'));var config=require('../../config/environment');var db=require(_0x5f57('0x19'))['db'];function respondWithStatusCode(_0x48c13d,_0x3fbc01){_0x3fbc01=_0x3fbc01||0xcc;return function(_0x21af18){if(_0x21af18){return _0x48c13d[_0x5f57('0x1a')](_0x3fbc01);}return _0x48c13d[_0x5f57('0x1b')](_0x3fbc01)[_0x5f57('0x1c')]();};}function respondWithResult(_0x3c5543,_0x1b3a4e){_0x1b3a4e=_0x1b3a4e||0xc8;return function(_0x50ffef){if(_0x50ffef){return _0x3c5543[_0x5f57('0x1b')](_0x1b3a4e)[_0x5f57('0x1d')](_0x50ffef);}};}function respondWithFilteredResult(_0x22b216,_0x1bc86d){return function(_0x55f058){if(_0x55f058){var _0x3fdd2a=_0x55f058[_0x5f57('0x1e')],_0x331556=_0x1bc86d['offset'],_0x57dfe2=_0x1bc86d[_0x5f57('0x1f')]+_0x1bc86d[_0x5f57('0x20')],_0x42e347;if(_0x57dfe2>=_0x3fdd2a){_0x57dfe2=_0x3fdd2a;_0x42e347=0xc8;}else{_0x42e347=0xce;}_0x22b216[_0x5f57('0x1b')](_0x42e347);return _0x22b216['set'](_0x5f57('0x21'),_0x331556+'-'+_0x57dfe2+'/'+_0x3fdd2a)[_0x5f57('0x1d')](_0x55f058);}return null;};}function patchUpdates(_0x280b3f){return function(_0x50835d){try{jsonpatch[_0x5f57('0x22')](_0x50835d,_0x280b3f,!![]);}catch(_0x25c160){return BPromise[_0x5f57('0x23')](_0x25c160);}return _0x50835d[_0x5f57('0x24')]();};}function saveUpdates(_0x4425e9,_0x38b1ca){return function(_0x11e74f){if(_0x11e74f){return _0x11e74f['update'](_0x4425e9)['then'](function(_0x2389d0){return _0x2389d0;});}return null;};}function removeEntity(_0x5318d5,_0x3d5b12){return function(_0x136429){if(_0x136429){return _0x136429['destroy']()['then'](function(){_0x5318d5['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3f22fe,_0x369267){return function(_0x2e34ca){if(!_0x2e34ca){_0x3f22fe[_0x5f57('0x1a')](0x194);}return _0x2e34ca;};}function handleError(_0x5b4d08,_0x593252){_0x593252=_0x593252||0x1f4;return function(_0x3022da){logger[_0x5f57('0x25')](_0x3022da['stack']);if(_0x3022da[_0x5f57('0x26')]){delete _0x3022da[_0x5f57('0x26')];}_0x5b4d08['status'](_0x593252)['send'](_0x3022da);};}exports[_0x5f57('0x27')]=function(_0x2d02ee,_0x36dfcb){var _0x2e3b06={},_0x2be442={},_0x395ec7={'count':0x0,'rows':[]};var _0x151ed1=_[_0x5f57('0x28')](db[_0x5f57('0x29')]['rawAttributes'],function(_0x15970d){return{'name':_0x15970d[_0x5f57('0x2a')],'type':_0x15970d[_0x5f57('0x2b')]['key']};});_0x2be442[_0x5f57('0x2c')]=_[_0x5f57('0x28')](_0x151ed1,'name');_0x2be442[_0x5f57('0x2d')]=_[_0x5f57('0x2e')](_0x2d02ee['query']);_0x2be442[_0x5f57('0x2f')]=_[_0x5f57('0x30')](_0x2be442[_0x5f57('0x2c')],_0x2be442['query']);_0x2e3b06[_0x5f57('0x31')]=_[_0x5f57('0x30')](_0x2be442[_0x5f57('0x2c')],qs[_0x5f57('0x32')](_0x2d02ee['query']['fields']));_0x2e3b06['attributes']=_0x2e3b06[_0x5f57('0x31')][_0x5f57('0x33')]?_0x2e3b06[_0x5f57('0x31')]:_0x2be442[_0x5f57('0x2c')];if(!_0x2d02ee[_0x5f57('0x2d')][_0x5f57('0x34')](_0x5f57('0x35'))){_0x2e3b06[_0x5f57('0x20')]=qs['limit'](_0x2d02ee[_0x5f57('0x2d')][_0x5f57('0x20')]);_0x2e3b06[_0x5f57('0x1f')]=qs[_0x5f57('0x1f')](_0x2d02ee['query'][_0x5f57('0x1f')]);}_0x2e3b06[_0x5f57('0x36')]=qs[_0x5f57('0x37')](_0x2d02ee[_0x5f57('0x2d')][_0x5f57('0x37')]);_0x2e3b06[_0x5f57('0x38')]=qs[_0x5f57('0x2f')](_[_0x5f57('0x39')](_0x2d02ee[_0x5f57('0x2d')],_0x2be442[_0x5f57('0x2f')]),_0x151ed1);if(_0x2d02ee[_0x5f57('0x2d')]['filter']){_0x2e3b06[_0x5f57('0x38')]=_['merge'](_0x2e3b06['where'],{'$or':_[_0x5f57('0x28')](_0x151ed1,function(_0x1eed19){if(_0x1eed19[_0x5f57('0x2b')]!==_0x5f57('0x3a')){var _0xf492f5={};_0xf492f5[_0x1eed19[_0x5f57('0x26')]]={'$like':'%'+_0x2d02ee['query'][_0x5f57('0x3b')]+'%'};return _0xf492f5;}})});}_0x2e3b06=_[_0x5f57('0x3c')]({},_0x2e3b06,_0x2d02ee['options']);var _0x29072b={'where':_0x2e3b06[_0x5f57('0x38')]};return db[_0x5f57('0x29')][_0x5f57('0x1e')](_0x29072b)[_0x5f57('0x3d')](function(_0x17dc82){_0x395ec7[_0x5f57('0x1e')]=_0x17dc82;if(_0x2d02ee[_0x5f57('0x2d')]['includeAll']){_0x2e3b06[_0x5f57('0x3e')]=[{'all':!![]}];}return db['IntegrationReport'][_0x5f57('0x3f')](_0x2e3b06);})[_0x5f57('0x3d')](function(_0x762349){_0x395ec7[_0x5f57('0x40')]=_0x762349;return _0x395ec7;})['then'](respondWithFilteredResult(_0x36dfcb,_0x2e3b06))[_0x5f57('0x41')](handleError(_0x36dfcb,null));};exports[_0x5f57('0x42')]=function(_0x43b224,_0x39c193){var _0x35493e={'raw':![],'where':{'id':_0x43b224['params']['id']}},_0x52aa03={};_0x52aa03[_0x5f57('0x2c')]=_[_0x5f57('0x2e')](db[_0x5f57('0x29')][_0x5f57('0x43')]);_0x52aa03[_0x5f57('0x2d')]=_[_0x5f57('0x2e')](_0x43b224[_0x5f57('0x2d')]);_0x52aa03['filters']=_['intersection'](_0x52aa03[_0x5f57('0x2c')],_0x52aa03['query']);_0x35493e['attributes']=_['intersection'](_0x52aa03[_0x5f57('0x2c')],qs[_0x5f57('0x32')](_0x43b224['query'][_0x5f57('0x32')]));_0x35493e[_0x5f57('0x31')]=_0x35493e[_0x5f57('0x31')][_0x5f57('0x33')]?_0x35493e[_0x5f57('0x31')]:_0x52aa03[_0x5f57('0x2c')];if(_0x43b224[_0x5f57('0x2d')]['includeAll']){_0x35493e[_0x5f57('0x3e')]=[{'all':!![]}];}_0x35493e=_['merge']({},_0x35493e,_0x43b224[_0x5f57('0x44')]);return db['IntegrationReport'][_0x5f57('0x45')](_0x35493e)[_0x5f57('0x3d')](handleEntityNotFound(_0x39c193,null))[_0x5f57('0x3d')](respondWithResult(_0x39c193,null))[_0x5f57('0x41')](handleError(_0x39c193,null));};exports[_0x5f57('0x46')]=function(_0x3ee174,_0x21f2fa){return db[_0x5f57('0x29')][_0x5f57('0x46')](_0x3ee174[_0x5f57('0x47')],{})[_0x5f57('0x3d')](respondWithResult(_0x21f2fa,0xc9))[_0x5f57('0x41')](handleError(_0x21f2fa,null));};exports['update']=function(_0x733ff5,_0x16be9b){if(_0x733ff5['body']['id']){delete _0x733ff5[_0x5f57('0x47')]['id'];}return db[_0x5f57('0x29')]['find']({'where':{'id':_0x733ff5[_0x5f57('0x48')]['id']}})[_0x5f57('0x3d')](handleEntityNotFound(_0x16be9b,null))['then'](saveUpdates(_0x733ff5[_0x5f57('0x47')],null))['then'](respondWithResult(_0x16be9b,null))[_0x5f57('0x41')](handleError(_0x16be9b,null));};exports[_0x5f57('0x49')]=function(_0x2cd8be,_0x38dce8){return db['IntegrationReport']['find']({'where':{'id':_0x2cd8be['params']['id']}})[_0x5f57('0x3d')](handleEntityNotFound(_0x38dce8,null))[_0x5f57('0x3d')](removeEntity(_0x38dce8,null))[_0x5f57('0x41')](handleError(_0x38dce8,null));};exports[_0x5f57('0x4a')]=function(_0xfa769b,_0x148dd7){return db['IntegrationReport'][_0x5f57('0x4a')]()[_0x5f57('0x3d')](respondWithResult(_0x148dd7,null))[_0x5f57('0x41')](handleError(_0x148dd7,null));};
\ No newline at end of file
diff --git a/server/api/integrationReport/integrationReport.model.js b/server/api/integrationReport/integrationReport.model.js
index 7b01d18..753e03a 100644
--- a/server/api/integrationReport/integrationReport.model.js
+++ b/server/api/integrationReport/integrationReport.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x6823=['define','IntegrationReport','report_integration','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./integrationReport.attributes'];(function(_0x1a06f0,_0xc3c5c8){var _0x47f356=function(_0x286d89){while(--_0x286d89){_0x1a06f0['push'](_0x1a06f0['shift']());}};_0x47f356(++_0xc3c5c8);}(_0x6823,0xe7));var _0x3682=function(_0x10d5d5,_0x4b624a){_0x10d5d5=_0x10d5d5-0x0;var _0x81aee2=_0x6823[_0x10d5d5];return _0x81aee2;};'use strict';var _=require(_0x3682('0x0'));var util=require(_0x3682('0x1'));var logger=require(_0x3682('0x2'))(_0x3682('0x3'));var moment=require('moment');var BPromise=require(_0x3682('0x4'));var rp=require(_0x3682('0x5'));var fs=require('fs');var path=require(_0x3682('0x6'));var rimraf=require(_0x3682('0x7'));var config=require('../../config/environment');var attributes=require(_0x3682('0x8'));module['exports']=function(_0x4aed2d,_0x5df142){return _0x4aed2d[_0x3682('0x9')](_0x3682('0xa'),attributes,{'tableName':_0x3682('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xc409=['bluebird','rimraf','exports','define','util','api','moment'];(function(_0x39e84d,_0x11931d){var _0x1991bc=function(_0xc81e32){while(--_0xc81e32){_0x39e84d['push'](_0x39e84d['shift']());}};_0x1991bc(++_0x11931d);}(_0xc409,0x123));var _0x9c40=function(_0x14b10f,_0x1db0f0){_0x14b10f=_0x14b10f-0x0;var _0x2f92bd=_0xc409[_0x14b10f];return _0x2f92bd;};'use strict';var _=require('lodash');var util=require(_0x9c40('0x0'));var logger=require('../../config/logger')(_0x9c40('0x1'));var moment=require(_0x9c40('0x2'));var BPromise=require(_0x9c40('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x9c40('0x4'));var config=require('../../config/environment');var attributes=require('./integrationReport.attributes');module[_0x9c40('0x5')]=function(_0x26e178,_0x46f05d){return _0x26e178[_0x9c40('0x6')]('IntegrationReport',attributes,{'tableName':'report_integration','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/integrationReport/integrationReport.rpc.js b/server/api/integrationReport/integrationReport.rpc.js
index 46487c0..fbbd5bd 100644
--- a/server/api/integrationReport/integrationReport.rpc.js
+++ b/server/api/integrationReport/integrationReport.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x2032=['ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','IntegrationReport,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','result','catch','util','moment','bluebird'];(function(_0x475740,_0x4ab048){var _0x518079=function(_0x5bc8da){while(--_0x5bc8da){_0x475740['push'](_0x475740['shift']());}};_0x518079(++_0x4ab048);}(_0x2032,0xd9));var _0x2203=function(_0x294c94,_0x25748a){_0x294c94=_0x294c94-0x0;var _0x2b519f=_0x2032[_0x294c94];return _0x2b519f;};'use strict';var _=require('lodash');var util=require(_0x2203('0x0'));var moment=require(_0x2203('0x1'));var BPromise=require(_0x2203('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2203('0x3'));var db=require(_0x2203('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x2203('0x5'))(_0x2203('0x6'));var config=require(_0x2203('0x7'));var jayson=require(_0x2203('0x8'));var client=jayson[_0x2203('0x9')][_0x2203('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2e0f63,_0x2676aa,_0x18c4d6){return new BPromise(function(_0x2049ff,_0x2999ed){return client['request'](_0x2e0f63,_0x18c4d6)['then'](function(_0x10f055){logger['info'](_0x2203('0xb'),_0x2676aa,_0x2203('0xc'));logger[_0x2203('0xd')]('IntegrationReport,\x20%s,\x20%s,\x20%s',_0x2676aa,_0x2203('0xc'),JSON['stringify'](_0x10f055));if(_0x10f055[_0x2203('0xe')]){if(_0x10f055['error'][_0x2203('0xf')]===0x1f4){logger[_0x2203('0xe')]('IntegrationReport,\x20%s,\x20%s',_0x2676aa,_0x10f055['error']['message']);return _0x2999ed(_0x10f055['error']['message']);}logger[_0x2203('0xe')]('IntegrationReport,\x20%s,\x20%s',_0x2676aa,_0x10f055['error'][_0x2203('0x10')]);return _0x2049ff(_0x10f055[_0x2203('0xe')][_0x2203('0x10')]);}else{logger[_0x2203('0x11')](_0x2203('0xb'),_0x2676aa,_0x2203('0xc'));_0x2049ff(_0x10f055[_0x2203('0x12')][_0x2203('0x10')]);}})[_0x2203('0x13')](function(_0x3053f3){logger['error'](_0x2203('0xb'),_0x2676aa,_0x3053f3);_0x2999ed(_0x3053f3);});});}
\ No newline at end of file
+var _0x9ffd=['IntegrationReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','IntegrationReport,\x20%s,\x20%s','info','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','then','debug'];(function(_0x59e85e,_0x4e399b){var _0x34e955=function(_0xebbfce){while(--_0xebbfce){_0x59e85e['push'](_0x59e85e['shift']());}};_0x34e955(++_0x4e399b);}(_0x9ffd,0xaa));var _0xd9ff=function(_0x5b1e25,_0x52b896){_0x5b1e25=_0x5b1e25-0x0;var _0x5e117c=_0x9ffd[_0x5b1e25];return _0x5e117c;};'use strict';var _=require(_0xd9ff('0x0'));var util=require(_0xd9ff('0x1'));var moment=require(_0xd9ff('0x2'));var BPromise=require('bluebird');var rs=require(_0xd9ff('0x3'));var fs=require('fs');var Redis=require(_0xd9ff('0x4'));var db=require(_0xd9ff('0x5'))['db'];var utils=require(_0xd9ff('0x6'));var logger=require('../../config/logger')(_0xd9ff('0x7'));var config=require(_0xd9ff('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xd9ff('0x9')][_0xd9ff('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x13ea8c,_0x270eb2,_0x45c60a){return new BPromise(function(_0x66282d,_0x13954e){return client[_0xd9ff('0xb')](_0x13ea8c,_0x45c60a)[_0xd9ff('0xc')](function(_0x58e728){logger['info']('IntegrationReport,\x20%s,\x20%s',_0x270eb2,'request\x20sent');logger[_0xd9ff('0xd')](_0xd9ff('0xe'),_0x270eb2,_0xd9ff('0xf'),JSON[_0xd9ff('0x10')](_0x58e728));if(_0x58e728[_0xd9ff('0x11')]){if(_0x58e728[_0xd9ff('0x11')][_0xd9ff('0x12')]===0x1f4){logger[_0xd9ff('0x11')]('IntegrationReport,\x20%s,\x20%s',_0x270eb2,_0x58e728['error'][_0xd9ff('0x13')]);return _0x13954e(_0x58e728[_0xd9ff('0x11')][_0xd9ff('0x13')]);}logger[_0xd9ff('0x11')](_0xd9ff('0x14'),_0x270eb2,_0x58e728['error'][_0xd9ff('0x13')]);return _0x66282d(_0x58e728[_0xd9ff('0x11')]['message']);}else{logger[_0xd9ff('0x15')]('IntegrationReport,\x20%s,\x20%s',_0x270eb2,'request\x20sent');_0x66282d(_0x58e728['result']['message']);}})[_0xd9ff('0x16')](function(_0x4f9d6d){logger[_0xd9ff('0x11')](_0xd9ff('0x14'),_0x270eb2,_0x4f9d6d);_0x13954e(_0x4f9d6d);});});}
\ No newline at end of file
diff --git a/server/api/interval/index.js b/server/api/interval/index.js
index 97a48be..be088f6 100644
--- a/server/api/interval/index.js
+++ b/server/api/interval/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x008c=['express','../../components/auth/service','../../components/interaction/service','../../config/environment','./interval.controller','get','isAuthenticated','index','/:id','show','/:id/sub_intervals','post','addInterval','/:id/sub_intervals/create_many','addIntervals','put','update','exports','multer','util','path','connect-timeout'];(function(_0x2c71b4,_0x2ebca9){var _0x16025a=function(_0x4a99b9){while(--_0x4a99b9){_0x2c71b4['push'](_0x2c71b4['shift']());}};_0x16025a(++_0x2ebca9);}(_0x008c,0x188));var _0xc008=function(_0x5ef35e,_0x329db7){_0x5ef35e=_0x5ef35e-0x0;var _0x4cdc0c=_0x008c[_0x5ef35e];return _0x4cdc0c;};'use strict';var multer=require(_0xc008('0x0'));var util=require(_0xc008('0x1'));var path=require(_0xc008('0x2'));var timeout=require(_0xc008('0x3'));var express=require(_0xc008('0x4'));var router=express['Router']();var auth=require(_0xc008('0x5'));var interaction=require(_0xc008('0x6'));var config=require(_0xc008('0x7'));var controller=require(_0xc008('0x8'));router[_0xc008('0x9')]('/',auth[_0xc008('0xa')](),controller[_0xc008('0xb')]);router[_0xc008('0x9')](_0xc008('0xc'),auth['isAuthenticated'](),controller[_0xc008('0xd')]);router['get'](_0xc008('0xe'),auth['isAuthenticated'](),controller['getIntervals']);router[_0xc008('0xf')]('/',auth[_0xc008('0xa')](),controller['create']);router['post']('/:id/sub_intervals',auth[_0xc008('0xa')](),controller[_0xc008('0x10')]);router['post'](_0xc008('0x11'),auth[_0xc008('0xa')](),controller[_0xc008('0x12')]);router[_0xc008('0x13')](_0xc008('0xc'),auth[_0xc008('0xa')](),controller[_0xc008('0x14')]);router['delete']('/:id',auth[_0xc008('0xa')](),controller['destroy']);module[_0xc008('0x15')]=router;
\ No newline at end of file
+var _0x008c=['express','../../components/auth/service','../../components/interaction/service','../../config/environment','./interval.controller','get','isAuthenticated','index','/:id','show','/:id/sub_intervals','post','addInterval','/:id/sub_intervals/create_many','addIntervals','put','update','exports','multer','util','path','connect-timeout'];(function(_0x482651,_0x2ec77f){var _0x3ac8cd=function(_0x8d4669){while(--_0x8d4669){_0x482651['push'](_0x482651['shift']());}};_0x3ac8cd(++_0x2ec77f);}(_0x008c,0x188));var _0xc008=function(_0x3537e1,_0xbc7714){_0x3537e1=_0x3537e1-0x0;var _0x164a50=_0x008c[_0x3537e1];return _0x164a50;};'use strict';var multer=require(_0xc008('0x0'));var util=require(_0xc008('0x1'));var path=require(_0xc008('0x2'));var timeout=require(_0xc008('0x3'));var express=require(_0xc008('0x4'));var router=express['Router']();var auth=require(_0xc008('0x5'));var interaction=require(_0xc008('0x6'));var config=require(_0xc008('0x7'));var controller=require(_0xc008('0x8'));router[_0xc008('0x9')]('/',auth[_0xc008('0xa')](),controller[_0xc008('0xb')]);router[_0xc008('0x9')](_0xc008('0xc'),auth['isAuthenticated'](),controller[_0xc008('0xd')]);router['get'](_0xc008('0xe'),auth['isAuthenticated'](),controller['getIntervals']);router[_0xc008('0xf')]('/',auth[_0xc008('0xa')](),controller['create']);router['post']('/:id/sub_intervals',auth[_0xc008('0xa')](),controller[_0xc008('0x10')]);router['post'](_0xc008('0x11'),auth[_0xc008('0xa')](),controller[_0xc008('0x12')]);router[_0xc008('0x13')](_0xc008('0xc'),auth[_0xc008('0xa')](),controller[_0xc008('0x14')]);router['delete']('/:id',auth[_0xc008('0xa')](),controller['destroy']);module[_0xc008('0x15')]=router;
\ No newline at end of file
diff --git a/server/api/interval/interval.attributes.js b/server/api/interval/interval.attributes.js
index edc11ab..3109e62 100644
--- a/server/api/interval/interval.attributes.js
+++ b/server/api/interval/interval.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x6d77=['sequelize','exports','STRING'];(function(_0x19417c,_0x1ed898){var _0x326045=function(_0x2d7caa){while(--_0x2d7caa){_0x19417c['push'](_0x19417c['shift']());}};_0x326045(++_0x1ed898);}(_0x6d77,0x17d));var _0x76d7=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x6d77[_0x42cae2];return _0x5f256f;};'use strict';var Sequelize=require(_0x76d7('0x0'));module[_0x76d7('0x1')]={'name':{'type':Sequelize[_0x76d7('0x2')]},'description':{'type':Sequelize[_0x76d7('0x2')]},'interval':{'type':Sequelize[_0x76d7('0x2')],'allowNull':!![]}};
\ No newline at end of file
+var _0xbd1e=['exports','STRING','sequelize'];(function(_0x1e74bd,_0x202042){var _0x53fc7e=function(_0x22db3b){while(--_0x22db3b){_0x1e74bd['push'](_0x1e74bd['shift']());}};_0x53fc7e(++_0x202042);}(_0xbd1e,0x14c));var _0xebd1=function(_0x46a3ff,_0x470b9a){_0x46a3ff=_0x46a3ff-0x0;var _0x404bc2=_0xbd1e[_0x46a3ff];return _0x404bc2;};'use strict';var Sequelize=require(_0xebd1('0x0'));module[_0xebd1('0x1')]={'name':{'type':Sequelize[_0xebd1('0x2')]},'description':{'type':Sequelize[_0xebd1('0x2')]},'interval':{'type':Sequelize[_0xebd1('0x2')],'allowNull':!![]}};
\ No newline at end of file
diff --git a/server/api/interval/interval.controller.js b/server/api/interval/interval.controller.js
index a6c49ef..07a7177 100644
--- a/server/api/interval/interval.controller.js
+++ b/server/api/interval/interval.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xb816=['UserProfileResource','error','stack','name','send','Interval','rawAttributes','type','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','sort','where','filter','map','merge','include','findAll','rows','catch','params','keys','includeAll','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Intervals','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','addInterval','IntervalId','getIntervals','findOne','transaction','bulkCreate','html-pdf','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','../../components/extensions/rewrite','sendStatus','status','end','count','offset','set','Content-Range','json','reject','save','then','destroy','get'];(function(_0x46c8b5,_0x3036f3){var _0x21eb4d=function(_0x1788ad){while(--_0x1788ad){_0x46c8b5['push'](_0x46c8b5['shift']());}};_0x21eb4d(++_0x3036f3);}(_0xb816,0x89));var _0x6b81=function(_0x17ea95,_0x4a8803){_0x17ea95=_0x17ea95-0x0;var _0x4ecadf=_0xb816[_0x17ea95];return _0x4ecadf;};'use strict';var pdf=require(_0x6b81('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x6b81('0x1'));var zipdir=require(_0x6b81('0x2'));var jsonpatch=require(_0x6b81('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x6b81('0x4'));var Mustache=require(_0x6b81('0x5'));var util=require(_0x6b81('0x6'));var path=require(_0x6b81('0x7'));var sox=require(_0x6b81('0x8'));var csv=require(_0x6b81('0x9'));var ejs=require(_0x6b81('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0x6b81('0xb'));var crypto=require(_0x6b81('0xc'));var jsforce=require(_0x6b81('0xd'));var deskjs=require(_0x6b81('0xe'));var toCsv=require(_0x6b81('0x9'));var querystring=require(_0x6b81('0xf'));var Papa=require(_0x6b81('0x10'));var Redis=require(_0x6b81('0x11'));var authService=require(_0x6b81('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x6b81('0x13'));var hardwareService=require(_0x6b81('0x14'));var logger=require(_0x6b81('0x15'))('api');var utils=require(_0x6b81('0x16'));var config=require(_0x6b81('0x17'));var db=require(_0x6b81('0x18'))['db'];var extensions=require(_0x6b81('0x19'));function respondWithStatusCode(_0xfd7f18,_0x4ffe0d){_0x4ffe0d=_0x4ffe0d||0xcc;return function(_0x326924){if(_0x326924){return _0xfd7f18[_0x6b81('0x1a')](_0x4ffe0d);}return _0xfd7f18[_0x6b81('0x1b')](_0x4ffe0d)[_0x6b81('0x1c')]();};}function respondWithResult(_0xe7ab90,_0x163eec){_0x163eec=_0x163eec||0xc8;return function(_0xa5e6dd){if(_0xa5e6dd){return _0xe7ab90[_0x6b81('0x1b')](_0x163eec)['json'](_0xa5e6dd);}};}function respondWithFilteredResult(_0x5ceb27,_0x23f6cb){return function(_0x4ff563){if(_0x4ff563){var _0x18151a=_0x4ff563[_0x6b81('0x1d')],_0x2a35a4=_0x23f6cb[_0x6b81('0x1e')],_0x5a8546=_0x23f6cb[_0x6b81('0x1e')]+_0x23f6cb['limit'],_0x56d12b;if(_0x5a8546>=_0x18151a){_0x5a8546=_0x18151a;_0x56d12b=0xc8;}else{_0x56d12b=0xce;}_0x5ceb27[_0x6b81('0x1b')](_0x56d12b);return _0x5ceb27[_0x6b81('0x1f')](_0x6b81('0x20'),_0x2a35a4+'-'+_0x5a8546+'/'+_0x18151a)[_0x6b81('0x21')](_0x4ff563);}return null;};}function patchUpdates(_0x4152be){return function(_0x551a34){try{jsonpatch['apply'](_0x551a34,_0x4152be,!![]);}catch(_0x430abf){return BPromise[_0x6b81('0x22')](_0x430abf);}return _0x551a34[_0x6b81('0x23')]();};}function saveUpdates(_0x3cb69d,_0x423b0c){return function(_0x36a4b7){if(_0x36a4b7){return _0x36a4b7['update'](_0x3cb69d)[_0x6b81('0x24')](function(_0x28c384){return _0x28c384;});}return null;};}function removeEntity(_0x2700d4,_0xde4401){return function(_0x5b94ad){if(_0x5b94ad){return _0x5b94ad[_0x6b81('0x25')]()[_0x6b81('0x24')](function(){var _0x4ec775=_0x5b94ad[_0x6b81('0x26')]({'plain':!![]});var _0x51b955='Intervals';return db[_0x6b81('0x27')][_0x6b81('0x25')]({'where':{'type':_0x51b955,'resourceId':_0x4ec775['id']}})[_0x6b81('0x24')](function(){return _0x5b94ad;});})['then'](function(){_0x2700d4[_0x6b81('0x1b')](0xcc)[_0x6b81('0x1c')]();});}};}function handleEntityNotFound(_0xadfec2,_0x1c4515){return function(_0x540982){if(!_0x540982){_0xadfec2[_0x6b81('0x1a')](0x194);}return _0x540982;};}function handleError(_0x29aaa7,_0x4c3d6d){_0x4c3d6d=_0x4c3d6d||0x1f4;return function(_0x1b4ba7){logger[_0x6b81('0x28')](_0x1b4ba7[_0x6b81('0x29')]);if(_0x1b4ba7[_0x6b81('0x2a')]){delete _0x1b4ba7[_0x6b81('0x2a')];}_0x29aaa7[_0x6b81('0x1b')](_0x4c3d6d)[_0x6b81('0x2b')](_0x1b4ba7);};}exports['index']=function(_0x123bbc,_0x31d871){var _0x241add={},_0x42f8a8={},_0x20b525={'count':0x0,'rows':[]};var _0x1c7e99=_['map'](db[_0x6b81('0x2c')][_0x6b81('0x2d')],function(_0x58810){return{'name':_0x58810['fieldName'],'type':_0x58810[_0x6b81('0x2e')][_0x6b81('0x2f')]};});_0x42f8a8[_0x6b81('0x30')]=_['map'](_0x1c7e99,_0x6b81('0x2a'));_0x42f8a8[_0x6b81('0x31')]=_['keys'](_0x123bbc['query']);_0x42f8a8[_0x6b81('0x32')]=_[_0x6b81('0x33')](_0x42f8a8['model'],_0x42f8a8[_0x6b81('0x31')]);_0x241add['attributes']=_[_0x6b81('0x33')](_0x42f8a8[_0x6b81('0x30')],qs[_0x6b81('0x34')](_0x123bbc[_0x6b81('0x31')][_0x6b81('0x34')]));_0x241add[_0x6b81('0x35')]=_0x241add[_0x6b81('0x35')][_0x6b81('0x36')]?_0x241add[_0x6b81('0x35')]:_0x42f8a8[_0x6b81('0x30')];if(!_0x123bbc[_0x6b81('0x31')][_0x6b81('0x37')](_0x6b81('0x38'))){_0x241add[_0x6b81('0x39')]=qs[_0x6b81('0x39')](_0x123bbc['query'][_0x6b81('0x39')]);_0x241add['offset']=qs[_0x6b81('0x1e')](_0x123bbc[_0x6b81('0x31')][_0x6b81('0x1e')]);}_0x241add['order']=qs[_0x6b81('0x3a')](_0x123bbc['query'][_0x6b81('0x3a')]);_0x241add[_0x6b81('0x3b')]=qs[_0x6b81('0x32')](_['pick'](_0x123bbc['query'],_0x42f8a8['filters']),_0x1c7e99);if(_0x123bbc[_0x6b81('0x31')][_0x6b81('0x3c')]){_0x241add['where']=_['merge'](_0x241add[_0x6b81('0x3b')],{'$or':_[_0x6b81('0x3d')](_0x1c7e99,function(_0x5279f3){if(_0x5279f3['type']!=='VIRTUAL'){var _0x8c7467={};_0x8c7467[_0x5279f3[_0x6b81('0x2a')]]={'$like':'%'+_0x123bbc[_0x6b81('0x31')][_0x6b81('0x3c')]+'%'};return _0x8c7467;}})});}_0x241add=_[_0x6b81('0x3e')]({},_0x241add,_0x123bbc['options']);var _0x5b96b4={'where':_0x241add[_0x6b81('0x3b')]};return db['Interval'][_0x6b81('0x1d')](_0x5b96b4)[_0x6b81('0x24')](function(_0x5ab245){_0x20b525[_0x6b81('0x1d')]=_0x5ab245;if(_0x123bbc[_0x6b81('0x31')]['includeAll']){_0x241add[_0x6b81('0x3f')]=[{'all':!![]}];}return db[_0x6b81('0x2c')][_0x6b81('0x40')](_0x241add);})[_0x6b81('0x24')](function(_0x214cc5){_0x20b525[_0x6b81('0x41')]=_0x214cc5;return _0x20b525;})[_0x6b81('0x24')](respondWithFilteredResult(_0x31d871,_0x241add))[_0x6b81('0x42')](handleError(_0x31d871,null));};exports['show']=function(_0x42f49d,_0xfb6ca1){var _0x1c4be3={'raw':!![],'where':{'id':_0x42f49d[_0x6b81('0x43')]['id']}},_0x1dee4a={};_0x1dee4a[_0x6b81('0x30')]=_[_0x6b81('0x44')](db['Interval'][_0x6b81('0x2d')]);_0x1dee4a[_0x6b81('0x31')]=_[_0x6b81('0x44')](_0x42f49d[_0x6b81('0x31')]);_0x1dee4a['filters']=_[_0x6b81('0x33')](_0x1dee4a['model'],_0x1dee4a[_0x6b81('0x31')]);_0x1c4be3[_0x6b81('0x35')]=_[_0x6b81('0x33')](_0x1dee4a[_0x6b81('0x30')],qs[_0x6b81('0x34')](_0x42f49d[_0x6b81('0x31')]['fields']));_0x1c4be3[_0x6b81('0x35')]=_0x1c4be3[_0x6b81('0x35')]['length']?_0x1c4be3['attributes']:_0x1dee4a[_0x6b81('0x30')];if(_0x42f49d[_0x6b81('0x31')][_0x6b81('0x45')]){_0x1c4be3[_0x6b81('0x3f')]=[{'all':!![]}];}_0x1c4be3=_[_0x6b81('0x3e')]({},_0x1c4be3,_0x42f49d[_0x6b81('0x46')]);return db[_0x6b81('0x2c')][_0x6b81('0x47')](_0x1c4be3)[_0x6b81('0x24')](handleEntityNotFound(_0xfb6ca1,null))['then'](respondWithResult(_0xfb6ca1,null))[_0x6b81('0x42')](handleError(_0xfb6ca1,null));};exports[_0x6b81('0x48')]=function(_0x295846,_0x4622e4){return db['Interval'][_0x6b81('0x48')](_0x295846[_0x6b81('0x49')],{})[_0x6b81('0x24')](function(_0x596eed){var _0xaa2df8=_0x295846[_0x6b81('0x4a')]['get']({'plain':!![]});if(!_0xaa2df8)throw new Error(_0x6b81('0x4b'));if(_0xaa2df8[_0x6b81('0x4c')]===_0x6b81('0x4a')){var _0x508a9c=_0x596eed[_0x6b81('0x26')]({'plain':!![]});var _0x3e3907=_0x6b81('0x4d');return db[_0x6b81('0x4e')][_0x6b81('0x47')]({'where':{'name':_0x3e3907,'userProfileId':_0xaa2df8['userProfileId']},'raw':!![]})['then'](function(_0xa19caf){if(_0xa19caf&&_0xa19caf[_0x6b81('0x4f')]===0x0){return db[_0x6b81('0x27')][_0x6b81('0x48')]({'name':_0x508a9c['name'],'resourceId':_0x508a9c['id'],'type':_0xa19caf[_0x6b81('0x2a')],'sectionId':_0xa19caf['id']},{})['then'](function(){return _0x596eed;});}else{return _0x596eed;}})[_0x6b81('0x42')](function(_0x15b37b){logger['error'](_0x6b81('0x50'),_0x15b37b);throw _0x15b37b;});}return _0x596eed;})[_0x6b81('0x24')](respondWithResult(_0x4622e4,0xc9))[_0x6b81('0x42')](handleError(_0x4622e4,null));};exports[_0x6b81('0x51')]=function(_0x1fbe80,_0x24152e){if(_0x1fbe80['body']['id']){delete _0x1fbe80[_0x6b81('0x49')]['id'];}return db[_0x6b81('0x2c')][_0x6b81('0x47')]({'where':{'id':_0x1fbe80[_0x6b81('0x43')]['id']}})[_0x6b81('0x24')](handleEntityNotFound(_0x24152e,null))[_0x6b81('0x24')](saveUpdates(_0x1fbe80['body'],null))[_0x6b81('0x24')](respondWithResult(_0x24152e,null))[_0x6b81('0x42')](handleError(_0x24152e,null));};exports[_0x6b81('0x25')]=function(_0x18f42f,_0x5f5851){return db[_0x6b81('0x2c')][_0x6b81('0x47')]({'where':{'id':_0x18f42f['params']['id']}})[_0x6b81('0x24')](handleEntityNotFound(_0x5f5851,null))[_0x6b81('0x24')](removeEntity(_0x5f5851,null))['catch'](handleError(_0x5f5851,null));};exports[_0x6b81('0x52')]=function(_0x1de564,_0x29c272,_0x147f97){if(_0x1de564[_0x6b81('0x49')]['id']){delete _0x1de564[_0x6b81('0x49')]['id'];}return db[_0x6b81('0x2c')][_0x6b81('0x47')]({'where':{'id':_0x1de564[_0x6b81('0x43')]['id']}})['then'](handleEntityNotFound(_0x29c272,null))[_0x6b81('0x24')](function(_0xc0cd5){if(_0xc0cd5){_0x1de564[_0x6b81('0x49')][_0x6b81('0x53')]=_0xc0cd5['id'];return db[_0x6b81('0x2c')][_0x6b81('0x48')](_0x1de564[_0x6b81('0x49')]);}})[_0x6b81('0x24')](respondWithResult(_0x29c272,null))['catch'](handleError(_0x29c272,null));};exports[_0x6b81('0x54')]=function(_0x17f881,_0x554bc6,_0x4d3c04){var _0x31d5d7={};var _0x9b82f={};var _0x87dddb;var _0x2b794f;return db[_0x6b81('0x2c')][_0x6b81('0x55')]({'where':{'id':_0x17f881['params']['id']}})[_0x6b81('0x24')](handleEntityNotFound(_0x554bc6,null))[_0x6b81('0x24')](function(_0x40a1c8){if(_0x40a1c8){_0x87dddb=_0x40a1c8;_0x9b82f[_0x6b81('0x30')]=_['keys'](db[_0x6b81('0x2c')][_0x6b81('0x2d')]);_0x9b82f[_0x6b81('0x31')]=_[_0x6b81('0x44')](_0x17f881[_0x6b81('0x31')]);_0x9b82f['filters']=_[_0x6b81('0x33')](_0x9b82f[_0x6b81('0x30')],_0x9b82f[_0x6b81('0x31')]);_0x31d5d7[_0x6b81('0x35')]=_[_0x6b81('0x33')](_0x9b82f[_0x6b81('0x30')],qs['fields'](_0x17f881[_0x6b81('0x31')][_0x6b81('0x34')]));_0x31d5d7[_0x6b81('0x35')]=_0x31d5d7[_0x6b81('0x35')][_0x6b81('0x36')]?_0x31d5d7[_0x6b81('0x35')]:_0x9b82f[_0x6b81('0x30')];_0x31d5d7['order']=qs[_0x6b81('0x3a')](_0x17f881['query']['sort']);_0x31d5d7['where']=qs[_0x6b81('0x32')](_['pick'](_0x17f881[_0x6b81('0x31')],_0x9b82f[_0x6b81('0x32')]));if(_0x17f881['query'][_0x6b81('0x3c')]){_0x31d5d7[_0x6b81('0x3b')]=_[_0x6b81('0x3e')](_0x31d5d7[_0x6b81('0x3b')],{'$or':_['map'](_0x31d5d7[_0x6b81('0x35')],function(_0x2ec7d3){var _0x101fd9={};_0x101fd9[_0x2ec7d3]={'$like':'%'+_0x17f881[_0x6b81('0x31')][_0x6b81('0x3c')]+'%'};return _0x101fd9;})});}_0x31d5d7=_['merge']({},_0x31d5d7,_0x17f881[_0x6b81('0x46')]);return _0x87dddb[_0x6b81('0x54')](_0x31d5d7);}})[_0x6b81('0x24')](function(_0x43930b){if(_0x43930b){_0x2b794f=_0x43930b[_0x6b81('0x36')];if(!_0x17f881[_0x6b81('0x31')]['hasOwnProperty'](_0x6b81('0x38'))){_0x31d5d7['limit']=qs['limit'](_0x17f881[_0x6b81('0x31')]['limit']);_0x31d5d7[_0x6b81('0x1e')]=qs[_0x6b81('0x1e')](_0x17f881[_0x6b81('0x31')][_0x6b81('0x1e')]);}return _0x87dddb['getIntervals'](_0x31d5d7);}})[_0x6b81('0x24')](function(_0x1c33e4){if(_0x1c33e4){return _0x1c33e4?{'count':_0x2b794f,'rows':_0x1c33e4}:null;}})[_0x6b81('0x24')](respondWithResult(_0x554bc6,null))['catch'](handleError(_0x554bc6,null));};exports['addIntervals']=function(_0x499829,_0x5a3aea,_0x268287){return db[_0x6b81('0x2c')]['findOne']({'where':{'id':_0x499829[_0x6b81('0x43')]['id']}})[_0x6b81('0x24')](handleEntityNotFound(_0x5a3aea,null))['then'](function(_0x57372c){if(_0x57372c){return db['sequelize'][_0x6b81('0x56')](function(_0x55f28a){return db[_0x6b81('0x2c')]['destroy']({'where':{'IntervalId':_0x499829[_0x6b81('0x43')]['id']},'transaction':_0x55f28a})[_0x6b81('0x24')](function(_0x309118){var _0x1028f3=_['map'](_0x499829['body'],function(_0x370913){delete _0x370913['id'];_0x370913[_0x6b81('0x53')]=_0x499829[_0x6b81('0x43')]['id'];return _0x370913;});return db[_0x6b81('0x2c')][_0x6b81('0x57')](_0x1028f3,{'transaction':_0x55f28a});});})[_0x6b81('0x24')](function(){return db[_0x6b81('0x2c')][_0x6b81('0x40')]({'where':{'IntervalId':_0x499829[_0x6b81('0x43')]['id']}});});}})[_0x6b81('0x24')](respondWithResult(_0x5a3aea,null))[_0x6b81('0x42')](handleError(_0x5a3aea,null));};
\ No newline at end of file
+var _0x6214=['status','end','count','offset','limit','set','Content-Range','json','apply','save','then','Intervals','UserProfileResource','stack','name','send','index','map','Interval','fieldName','type','model','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','rawAttributes','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','get','UserProfileSection','find','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','params','destroy','addInterval','getIntervals','nolimit','findOne','sequelize','transaction','IntervalId','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../mysqldb','../../components/extensions/rewrite','sendStatus'];(function(_0x21d1b2,_0x593e69){var _0x417151=function(_0x12ae05){while(--_0x12ae05){_0x21d1b2['push'](_0x21d1b2['shift']());}};_0x417151(++_0x593e69);}(_0x6214,0xf7));var _0x4621=function(_0x43f881,_0xd6e5a2){_0x43f881=_0x43f881-0x0;var _0x365c14=_0x6214[_0x43f881];return _0x365c14;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x4621('0x0'));var rimraf=require(_0x4621('0x1'));var zipdir=require(_0x4621('0x2'));var jsonpatch=require(_0x4621('0x3'));var rp=require(_0x4621('0x4'));var moment=require('moment');var BPromise=require(_0x4621('0x5'));var Mustache=require(_0x4621('0x6'));var util=require(_0x4621('0x7'));var path=require(_0x4621('0x8'));var sox=require(_0x4621('0x9'));var csv=require(_0x4621('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x4621('0xb'));var squel=require(_0x4621('0xc'));var crypto=require(_0x4621('0xd'));var jsforce=require(_0x4621('0xe'));var deskjs=require(_0x4621('0xf'));var toCsv=require('to-csv');var querystring=require(_0x4621('0x10'));var Papa=require(_0x4621('0x11'));var Redis=require(_0x4621('0x12'));var authService=require(_0x4621('0x13'));var qs=require(_0x4621('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4621('0x15'));var logger=require(_0x4621('0x16'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x4621('0x17'))['db'];var extensions=require(_0x4621('0x18'));function respondWithStatusCode(_0x1feb2d,_0x4d91cf){_0x4d91cf=_0x4d91cf||0xcc;return function(_0x4ef6c9){if(_0x4ef6c9){return _0x1feb2d[_0x4621('0x19')](_0x4d91cf);}return _0x1feb2d[_0x4621('0x1a')](_0x4d91cf)[_0x4621('0x1b')]();};}function respondWithResult(_0xff87d,_0x13628a){_0x13628a=_0x13628a||0xc8;return function(_0x4abb83){if(_0x4abb83){return _0xff87d['status'](_0x13628a)['json'](_0x4abb83);}};}function respondWithFilteredResult(_0x3ae287,_0x6889ce){return function(_0x10e8a7){if(_0x10e8a7){var _0x5c709c=_0x10e8a7[_0x4621('0x1c')],_0x483d4d=_0x6889ce[_0x4621('0x1d')],_0x46edb7=_0x6889ce['offset']+_0x6889ce[_0x4621('0x1e')],_0x20bf69;if(_0x46edb7>=_0x5c709c){_0x46edb7=_0x5c709c;_0x20bf69=0xc8;}else{_0x20bf69=0xce;}_0x3ae287[_0x4621('0x1a')](_0x20bf69);return _0x3ae287[_0x4621('0x1f')](_0x4621('0x20'),_0x483d4d+'-'+_0x46edb7+'/'+_0x5c709c)[_0x4621('0x21')](_0x10e8a7);}return null;};}function patchUpdates(_0x19dbad){return function(_0x337773){try{jsonpatch[_0x4621('0x22')](_0x337773,_0x19dbad,!![]);}catch(_0x433982){return BPromise['reject'](_0x433982);}return _0x337773[_0x4621('0x23')]();};}function saveUpdates(_0x103016,_0x2fdca8){return function(_0x1e320f){if(_0x1e320f){return _0x1e320f['update'](_0x103016)[_0x4621('0x24')](function(_0x2cd290){return _0x2cd290;});}return null;};}function removeEntity(_0x1202e3,_0x5df397){return function(_0x4cd37b){if(_0x4cd37b){return _0x4cd37b['destroy']()['then'](function(){var _0x36a69a=_0x4cd37b['get']({'plain':!![]});var _0x34ed5e=_0x4621('0x25');return db[_0x4621('0x26')]['destroy']({'where':{'type':_0x34ed5e,'resourceId':_0x36a69a['id']}})[_0x4621('0x24')](function(){return _0x4cd37b;});})[_0x4621('0x24')](function(){_0x1202e3[_0x4621('0x1a')](0xcc)[_0x4621('0x1b')]();});}};}function handleEntityNotFound(_0x1caff5,_0x29dc65){return function(_0x3cc0c9){if(!_0x3cc0c9){_0x1caff5[_0x4621('0x19')](0x194);}return _0x3cc0c9;};}function handleError(_0x3b8b65,_0x300c1b){_0x300c1b=_0x300c1b||0x1f4;return function(_0x4b9a3a){logger['error'](_0x4b9a3a[_0x4621('0x27')]);if(_0x4b9a3a[_0x4621('0x28')]){delete _0x4b9a3a['name'];}_0x3b8b65[_0x4621('0x1a')](_0x300c1b)[_0x4621('0x29')](_0x4b9a3a);};}exports[_0x4621('0x2a')]=function(_0x481ffe,_0x393929){var _0x4cef89={},_0x2861ad={},_0x19e4ac={'count':0x0,'rows':[]};var _0x5c9564=_[_0x4621('0x2b')](db[_0x4621('0x2c')]['rawAttributes'],function(_0x4fed48){return{'name':_0x4fed48[_0x4621('0x2d')],'type':_0x4fed48[_0x4621('0x2e')]['key']};});_0x2861ad[_0x4621('0x2f')]=_['map'](_0x5c9564,_0x4621('0x28'));_0x2861ad['query']=_[_0x4621('0x30')](_0x481ffe['query']);_0x2861ad[_0x4621('0x31')]=_[_0x4621('0x32')](_0x2861ad[_0x4621('0x2f')],_0x2861ad[_0x4621('0x33')]);_0x4cef89[_0x4621('0x34')]=_[_0x4621('0x32')](_0x2861ad[_0x4621('0x2f')],qs['fields'](_0x481ffe[_0x4621('0x33')][_0x4621('0x35')]));_0x4cef89[_0x4621('0x34')]=_0x4cef89[_0x4621('0x34')][_0x4621('0x36')]?_0x4cef89['attributes']:_0x2861ad[_0x4621('0x2f')];if(!_0x481ffe[_0x4621('0x33')][_0x4621('0x37')]('nolimit')){_0x4cef89[_0x4621('0x1e')]=qs[_0x4621('0x1e')](_0x481ffe[_0x4621('0x33')]['limit']);_0x4cef89['offset']=qs[_0x4621('0x1d')](_0x481ffe[_0x4621('0x33')][_0x4621('0x1d')]);}_0x4cef89[_0x4621('0x38')]=qs[_0x4621('0x39')](_0x481ffe['query']['sort']);_0x4cef89['where']=qs[_0x4621('0x31')](_[_0x4621('0x3a')](_0x481ffe['query'],_0x2861ad[_0x4621('0x31')]),_0x5c9564);if(_0x481ffe[_0x4621('0x33')][_0x4621('0x3b')]){_0x4cef89[_0x4621('0x3c')]=_[_0x4621('0x3d')](_0x4cef89[_0x4621('0x3c')],{'$or':_[_0x4621('0x2b')](_0x5c9564,function(_0x2dd22b){if(_0x2dd22b[_0x4621('0x2e')]!==_0x4621('0x3e')){var _0x19ad2f={};_0x19ad2f[_0x2dd22b['name']]={'$like':'%'+_0x481ffe[_0x4621('0x33')][_0x4621('0x3b')]+'%'};return _0x19ad2f;}})});}_0x4cef89=_[_0x4621('0x3d')]({},_0x4cef89,_0x481ffe[_0x4621('0x3f')]);var _0x2e40d4={'where':_0x4cef89[_0x4621('0x3c')]};return db[_0x4621('0x2c')][_0x4621('0x1c')](_0x2e40d4)[_0x4621('0x24')](function(_0x5cdd75){_0x19e4ac['count']=_0x5cdd75;if(_0x481ffe[_0x4621('0x33')][_0x4621('0x40')]){_0x4cef89[_0x4621('0x41')]=[{'all':!![]}];}return db[_0x4621('0x2c')][_0x4621('0x42')](_0x4cef89);})[_0x4621('0x24')](function(_0x3dd773){_0x19e4ac['rows']=_0x3dd773;return _0x19e4ac;})[_0x4621('0x24')](respondWithFilteredResult(_0x393929,_0x4cef89))[_0x4621('0x43')](handleError(_0x393929,null));};exports[_0x4621('0x44')]=function(_0x522649,_0x5cbd87){var _0x3f0fee={'raw':!![],'where':{'id':_0x522649['params']['id']}},_0x43a14d={};_0x43a14d[_0x4621('0x2f')]=_[_0x4621('0x30')](db[_0x4621('0x2c')][_0x4621('0x45')]);_0x43a14d['query']=_['keys'](_0x522649[_0x4621('0x33')]);_0x43a14d['filters']=_[_0x4621('0x32')](_0x43a14d[_0x4621('0x2f')],_0x43a14d[_0x4621('0x33')]);_0x3f0fee[_0x4621('0x34')]=_[_0x4621('0x32')](_0x43a14d['model'],qs[_0x4621('0x35')](_0x522649[_0x4621('0x33')][_0x4621('0x35')]));_0x3f0fee[_0x4621('0x34')]=_0x3f0fee[_0x4621('0x34')][_0x4621('0x36')]?_0x3f0fee[_0x4621('0x34')]:_0x43a14d[_0x4621('0x2f')];if(_0x522649['query'][_0x4621('0x40')]){_0x3f0fee[_0x4621('0x41')]=[{'all':!![]}];}_0x3f0fee=_[_0x4621('0x3d')]({},_0x3f0fee,_0x522649[_0x4621('0x3f')]);return db[_0x4621('0x2c')]['find'](_0x3f0fee)['then'](handleEntityNotFound(_0x5cbd87,null))[_0x4621('0x24')](respondWithResult(_0x5cbd87,null))['catch'](handleError(_0x5cbd87,null));};exports[_0x4621('0x46')]=function(_0x3f8896,_0x3a1f62){return db[_0x4621('0x2c')][_0x4621('0x46')](_0x3f8896['body'],{})[_0x4621('0x24')](function(_0x2aef8d){var _0x13f14c=_0x3f8896[_0x4621('0x47')]['get']({'plain':!![]});if(!_0x13f14c)throw new Error(_0x4621('0x48'));if(_0x13f14c['role']===_0x4621('0x47')){var _0x1ad5c0=_0x2aef8d[_0x4621('0x49')]({'plain':!![]});var _0x35ffb7=_0x4621('0x25');return db[_0x4621('0x4a')][_0x4621('0x4b')]({'where':{'name':_0x35ffb7,'userProfileId':_0x13f14c[_0x4621('0x4c')]},'raw':!![]})[_0x4621('0x24')](function(_0x5b7be0){if(_0x5b7be0&&_0x5b7be0[_0x4621('0x4d')]===0x0){return db[_0x4621('0x26')][_0x4621('0x46')]({'name':_0x1ad5c0['name'],'resourceId':_0x1ad5c0['id'],'type':_0x5b7be0[_0x4621('0x28')],'sectionId':_0x5b7be0['id']},{})[_0x4621('0x24')](function(){return _0x2aef8d;});}else{return _0x2aef8d;}})[_0x4621('0x43')](function(_0x5ed828){logger[_0x4621('0x4e')](_0x4621('0x4f'),_0x5ed828);throw _0x5ed828;});}return _0x2aef8d;})[_0x4621('0x24')](respondWithResult(_0x3a1f62,0xc9))[_0x4621('0x43')](handleError(_0x3a1f62,null));};exports[_0x4621('0x50')]=function(_0x3334bf,_0x13a4ad){if(_0x3334bf[_0x4621('0x51')]['id']){delete _0x3334bf['body']['id'];}return db[_0x4621('0x2c')][_0x4621('0x4b')]({'where':{'id':_0x3334bf[_0x4621('0x52')]['id']}})[_0x4621('0x24')](handleEntityNotFound(_0x13a4ad,null))[_0x4621('0x24')](saveUpdates(_0x3334bf[_0x4621('0x51')],null))[_0x4621('0x24')](respondWithResult(_0x13a4ad,null))[_0x4621('0x43')](handleError(_0x13a4ad,null));};exports[_0x4621('0x53')]=function(_0x2c616a,_0xafcae7){return db[_0x4621('0x2c')][_0x4621('0x4b')]({'where':{'id':_0x2c616a[_0x4621('0x52')]['id']}})[_0x4621('0x24')](handleEntityNotFound(_0xafcae7,null))['then'](removeEntity(_0xafcae7,null))[_0x4621('0x43')](handleError(_0xafcae7,null));};exports[_0x4621('0x54')]=function(_0x364498,_0x2fdc56,_0x1e1822){if(_0x364498[_0x4621('0x51')]['id']){delete _0x364498[_0x4621('0x51')]['id'];}return db[_0x4621('0x2c')][_0x4621('0x4b')]({'where':{'id':_0x364498[_0x4621('0x52')]['id']}})['then'](handleEntityNotFound(_0x2fdc56,null))[_0x4621('0x24')](function(_0x3becdc){if(_0x3becdc){_0x364498['body']['IntervalId']=_0x3becdc['id'];return db['Interval']['create'](_0x364498[_0x4621('0x51')]);}})['then'](respondWithResult(_0x2fdc56,null))[_0x4621('0x43')](handleError(_0x2fdc56,null));};exports[_0x4621('0x55')]=function(_0x405976,_0x1326c6,_0x4c5c40){var _0x4648d7={};var _0x2af681={};var _0x39f7e9;var _0x45ba84;return db['Interval']['findOne']({'where':{'id':_0x405976[_0x4621('0x52')]['id']}})['then'](handleEntityNotFound(_0x1326c6,null))[_0x4621('0x24')](function(_0x4827d0){if(_0x4827d0){_0x39f7e9=_0x4827d0;_0x2af681[_0x4621('0x2f')]=_[_0x4621('0x30')](db[_0x4621('0x2c')]['rawAttributes']);_0x2af681[_0x4621('0x33')]=_[_0x4621('0x30')](_0x405976['query']);_0x2af681[_0x4621('0x31')]=_[_0x4621('0x32')](_0x2af681['model'],_0x2af681['query']);_0x4648d7[_0x4621('0x34')]=_[_0x4621('0x32')](_0x2af681['model'],qs[_0x4621('0x35')](_0x405976[_0x4621('0x33')][_0x4621('0x35')]));_0x4648d7['attributes']=_0x4648d7[_0x4621('0x34')][_0x4621('0x36')]?_0x4648d7[_0x4621('0x34')]:_0x2af681[_0x4621('0x2f')];_0x4648d7['order']=qs['sort'](_0x405976[_0x4621('0x33')]['sort']);_0x4648d7[_0x4621('0x3c')]=qs[_0x4621('0x31')](_['pick'](_0x405976['query'],_0x2af681[_0x4621('0x31')]));if(_0x405976[_0x4621('0x33')]['filter']){_0x4648d7[_0x4621('0x3c')]=_[_0x4621('0x3d')](_0x4648d7[_0x4621('0x3c')],{'$or':_[_0x4621('0x2b')](_0x4648d7[_0x4621('0x34')],function(_0x56cbc1){var _0x8b6bed={};_0x8b6bed[_0x56cbc1]={'$like':'%'+_0x405976[_0x4621('0x33')][_0x4621('0x3b')]+'%'};return _0x8b6bed;})});}_0x4648d7=_[_0x4621('0x3d')]({},_0x4648d7,_0x405976[_0x4621('0x3f')]);return _0x39f7e9['getIntervals'](_0x4648d7);}})[_0x4621('0x24')](function(_0x2e4f1f){if(_0x2e4f1f){_0x45ba84=_0x2e4f1f[_0x4621('0x36')];if(!_0x405976[_0x4621('0x33')]['hasOwnProperty'](_0x4621('0x56'))){_0x4648d7[_0x4621('0x1e')]=qs[_0x4621('0x1e')](_0x405976['query'][_0x4621('0x1e')]);_0x4648d7['offset']=qs[_0x4621('0x1d')](_0x405976[_0x4621('0x33')][_0x4621('0x1d')]);}return _0x39f7e9[_0x4621('0x55')](_0x4648d7);}})[_0x4621('0x24')](function(_0x3607aa){if(_0x3607aa){return _0x3607aa?{'count':_0x45ba84,'rows':_0x3607aa}:null;}})[_0x4621('0x24')](respondWithResult(_0x1326c6,null))[_0x4621('0x43')](handleError(_0x1326c6,null));};exports['addIntervals']=function(_0x3d3e55,_0x22b1bf,_0x3791ea){return db[_0x4621('0x2c')][_0x4621('0x57')]({'where':{'id':_0x3d3e55[_0x4621('0x52')]['id']}})['then'](handleEntityNotFound(_0x22b1bf,null))[_0x4621('0x24')](function(_0x5600e8){if(_0x5600e8){return db[_0x4621('0x58')][_0x4621('0x59')](function(_0x4c9c7f){return db[_0x4621('0x2c')][_0x4621('0x53')]({'where':{'IntervalId':_0x3d3e55[_0x4621('0x52')]['id']},'transaction':_0x4c9c7f})[_0x4621('0x24')](function(_0x20a47f){var _0x91f8e4=_[_0x4621('0x2b')](_0x3d3e55[_0x4621('0x51')],function(_0x58e740){delete _0x58e740['id'];_0x58e740[_0x4621('0x5a')]=_0x3d3e55['params']['id'];return _0x58e740;});return db['Interval']['bulkCreate'](_0x91f8e4,{'transaction':_0x4c9c7f});});})[_0x4621('0x24')](function(){return db[_0x4621('0x2c')][_0x4621('0x42')]({'where':{'IntervalId':_0x3d3e55['params']['id']}});});}})[_0x4621('0x24')](respondWithResult(_0x22b1bf,null))[_0x4621('0x43')](handleError(_0x22b1bf,null));};
\ No newline at end of file
diff --git a/server/api/interval/interval.model.js b/server/api/interval/interval.model.js
index 0097cb3..513650d 100644
--- a/server/api/interval/interval.model.js
+++ b/server/api/interval/interval.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xbdeb=['rewrite','util','api','bluebird','request-promise','path','rimraf','../../components/extensions/rewrite','exports','tools_intervals'];(function(_0x3eef50,_0x2e745f){var _0x213722=function(_0x17b013){while(--_0x17b013){_0x3eef50['push'](_0x3eef50['shift']());}};_0x213722(++_0x2e745f);}(_0xbdeb,0x6f));var _0xbbde=function(_0x5aa2f1,_0x39e791){_0x5aa2f1=_0x5aa2f1-0x0;var _0x2ef6f8=_0xbdeb[_0x5aa2f1];return _0x2ef6f8;};'use strict';var _=require('lodash');var util=require(_0xbbde('0x0'));var logger=require('../../config/logger')(_0xbbde('0x1'));var moment=require('moment');var BPromise=require(_0xbbde('0x2'));var rp=require(_0xbbde('0x3'));var fs=require('fs');var path=require(_0xbbde('0x4'));var rimraf=require(_0xbbde('0x5'));var config=require('../../config/environment');var attributes=require('./interval.attributes');var extensions=require(_0xbbde('0x6'));module[_0xbbde('0x7')]=function(_0x278651,_0x1a8482){return _0x278651['define']('Interval',attributes,{'tableName':_0xbbde('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x17df59,_0x51706d){extensions[_0xbbde('0x9')](_0x278651,_0x17df59);},'afterBulkCreate':function(_0xec50fa,_0x3164f7,_0x323dc2){_0x323dc2();extensions[_0xbbde('0x9')](_0x278651,_0xec50fa[0x0]);},'afterUpdate':function(_0xd08f3f,_0x162966){extensions[_0xbbde('0x9')](_0x278651,_0xd08f3f);},'afterDestroy':function(_0x419fbe,_0x357c69){extensions['rewrite'](_0x278651,_0x419fbe);}}});};
\ No newline at end of file
+var _0x0cee=['bluebird','rimraf','../../config/environment','./interval.attributes','../../components/extensions/rewrite','exports','define','tools_intervals','rewrite','lodash','util','../../config/logger','api','moment'];(function(_0x480843,_0x8121e6){var _0x1d5cd9=function(_0x54ca2a){while(--_0x54ca2a){_0x480843['push'](_0x480843['shift']());}};_0x1d5cd9(++_0x8121e6);}(_0x0cee,0x12f));var _0xe0ce=function(_0x3d775a,_0x1658bb){_0x3d775a=_0x3d775a-0x0;var _0xa350a0=_0x0cee[_0x3d775a];return _0xa350a0;};'use strict';var _=require(_0xe0ce('0x0'));var util=require(_0xe0ce('0x1'));var logger=require(_0xe0ce('0x2'))(_0xe0ce('0x3'));var moment=require(_0xe0ce('0x4'));var BPromise=require(_0xe0ce('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xe0ce('0x6'));var config=require(_0xe0ce('0x7'));var attributes=require(_0xe0ce('0x8'));var extensions=require(_0xe0ce('0x9'));module[_0xe0ce('0xa')]=function(_0x1ce646,_0x64f82c){return _0x1ce646[_0xe0ce('0xb')]('Interval',attributes,{'tableName':_0xe0ce('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x2fa936,_0x52f779){extensions[_0xe0ce('0xd')](_0x1ce646,_0x2fa936);},'afterBulkCreate':function(_0x94afeb,_0x4532e3,_0x429a83){_0x429a83();extensions['rewrite'](_0x1ce646,_0x94afeb[0x0]);},'afterUpdate':function(_0x48a0a4,_0x5cf1d8){extensions[_0xe0ce('0xd')](_0x1ce646,_0x48a0a4);},'afterDestroy':function(_0x441e01,_0x31f014){extensions[_0xe0ce('0xd')](_0x1ce646,_0x441e01);}}});};
\ No newline at end of file
diff --git a/server/api/interval/interval.rpc.js b/server/api/interval/interval.rpc.js
index 2a12e74..1b9f4d6 100644
--- a/server/api/interval/interval.rpc.js
+++ b/server/api/interval/interval.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x040e=['client','http','request','Interval,\x20%s,\x20%s','request\x20sent','debug','Interval,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','GetInterval','Interval','options','attributes','include','map','model','then','ShowInterval','find','raw','where','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment'];(function(_0x5466ab,_0x227b13){var _0x40751a=function(_0x477f9e){while(--_0x477f9e){_0x5466ab['push'](_0x5466ab['shift']());}};_0x40751a(++_0x227b13);}(_0x040e,0x129));var _0xe040=function(_0x1d56fa,_0x245f75){_0x1d56fa=_0x1d56fa-0x0;var _0x591df2=_0x040e[_0x1d56fa];return _0x591df2;};'use strict';var _=require('lodash');var util=require(_0xe040('0x0'));var moment=require(_0xe040('0x1'));var BPromise=require(_0xe040('0x2'));var rs=require(_0xe040('0x3'));var fs=require('fs');var Redis=require(_0xe040('0x4'));var db=require(_0xe040('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xe040('0x6'))(_0xe040('0x7'));var config=require(_0xe040('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xe040('0x9')][_0xe040('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x36da31,_0xf504b5,_0x31ef54){return new BPromise(function(_0x31ab05,_0x390b7){return client[_0xe040('0xb')](_0x36da31,_0x31ef54)['then'](function(_0x479699){logger['info'](_0xe040('0xc'),_0xf504b5,_0xe040('0xd'));logger[_0xe040('0xe')](_0xe040('0xf'),_0xf504b5,_0xe040('0xd'),JSON[_0xe040('0x10')](_0x479699));if(_0x479699[_0xe040('0x11')]){if(_0x479699[_0xe040('0x11')][_0xe040('0x12')]===0x1f4){logger['error'](_0xe040('0xc'),_0xf504b5,_0x479699[_0xe040('0x11')]['message']);return _0x390b7(_0x479699[_0xe040('0x11')][_0xe040('0x13')]);}logger[_0xe040('0x11')](_0xe040('0xc'),_0xf504b5,_0x479699[_0xe040('0x11')][_0xe040('0x13')]);return _0x31ab05(_0x479699['error']['message']);}else{logger[_0xe040('0x14')](_0xe040('0xc'),_0xf504b5,_0xe040('0xd'));_0x31ab05(_0x479699['result'][_0xe040('0x13')]);}})[_0xe040('0x15')](function(_0x570cd8){logger['error'](_0xe040('0xc'),_0xf504b5,_0x570cd8);_0x390b7(_0x570cd8);});});}exports[_0xe040('0x16')]=function(_0x3c6d75){var _0x7d66c0=this;return new Promise(function(_0x32b3ac,_0x5650de){return db[_0xe040('0x17')]['findAll']({'raw':_0x3c6d75[_0xe040('0x18')]?_0x3c6d75['options']['raw']===undefined?!![]:![]:!![],'where':_0x3c6d75[_0xe040('0x18')]?_0x3c6d75[_0xe040('0x18')]['where']||null:null,'attributes':_0x3c6d75[_0xe040('0x18')]?_0x3c6d75['options'][_0xe040('0x19')]||null:null,'limit':_0x3c6d75[_0xe040('0x18')]?_0x3c6d75[_0xe040('0x18')]['limit']||null:null,'include':_0x3c6d75['options']?_0x3c6d75[_0xe040('0x18')][_0xe040('0x1a')]?_[_0xe040('0x1b')](_0x3c6d75[_0xe040('0x18')][_0xe040('0x1a')],function(_0x19d37e){return{'model':db[_0x19d37e[_0xe040('0x1c')]],'as':_0x19d37e['as'],'attributes':_0x19d37e[_0xe040('0x19')],'include':_0x19d37e[_0xe040('0x1a')]?_[_0xe040('0x1b')](_0x19d37e['include'],function(_0xac3b2f){return{'model':db[_0xac3b2f[_0xe040('0x1c')]],'as':_0xac3b2f['as'],'attributes':_0xac3b2f[_0xe040('0x19')],'include':_0xac3b2f[_0xe040('0x1a')]?_[_0xe040('0x1b')](_0xac3b2f[_0xe040('0x1a')],function(_0x1d8ccc){return{'model':db[_0x1d8ccc[_0xe040('0x1c')]],'as':_0x1d8ccc['as'],'attributes':_0x1d8ccc[_0xe040('0x19')]};}):[]};}):[]};}):[]:[]})[_0xe040('0x1d')](function(_0x187c9d){logger[_0xe040('0x14')](_0xe040('0x16'),_0x3c6d75);logger[_0xe040('0xe')](_0xe040('0x16'),_0x3c6d75,JSON[_0xe040('0x10')](_0x187c9d));_0x32b3ac(_0x187c9d);})[_0xe040('0x15')](function(_0x142603){logger[_0xe040('0x11')]('GetInterval',_0x142603['message'],_0x3c6d75);_0x5650de(_0x7d66c0[_0xe040('0x11')](0x1f4,_0x142603[_0xe040('0x13')]));});});};exports[_0xe040('0x1e')]=function(_0x4975b8){var _0x4ba873=this;return new Promise(function(_0x18eb5a,_0x2fe926){return db[_0xe040('0x17')][_0xe040('0x1f')]({'raw':_0x4975b8[_0xe040('0x18')]?_0x4975b8['options'][_0xe040('0x20')]===undefined?!![]:![]:!![],'where':_0x4975b8[_0xe040('0x18')]?_0x4975b8[_0xe040('0x18')][_0xe040('0x21')]||null:null,'attributes':_0x4975b8[_0xe040('0x18')]?_0x4975b8[_0xe040('0x18')][_0xe040('0x19')]||null:null,'include':_0x4975b8['options']?_0x4975b8[_0xe040('0x18')][_0xe040('0x1a')]?_['map'](_0x4975b8[_0xe040('0x18')][_0xe040('0x1a')],function(_0x36929b){return{'model':db[_0x36929b['model']],'as':_0x36929b['as'],'attributes':_0x36929b['attributes'],'include':_0x36929b[_0xe040('0x1a')]?_[_0xe040('0x1b')](_0x36929b[_0xe040('0x1a')],function(_0x1c2ef4){return{'model':db[_0x1c2ef4[_0xe040('0x1c')]],'as':_0x1c2ef4['as'],'attributes':_0x1c2ef4[_0xe040('0x19')],'include':_0x1c2ef4['include']?_[_0xe040('0x1b')](_0x1c2ef4['include'],function(_0x9a5cf2){return{'model':db[_0x9a5cf2['model']],'as':_0x9a5cf2['as'],'attributes':_0x9a5cf2[_0xe040('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x301fcf){logger[_0xe040('0x14')](_0xe040('0x1e'),_0x4975b8);logger[_0xe040('0xe')](_0xe040('0x1e'),_0x4975b8,JSON[_0xe040('0x10')](_0x301fcf));_0x18eb5a(_0x301fcf);})[_0xe040('0x15')](function(_0x3b4328){logger['error'](_0xe040('0x1e'),_0x3b4328[_0xe040('0x13')],_0x4975b8);_0x2fe926(_0x4ba873[_0xe040('0x11')](0x1f4,_0x3b4328[_0xe040('0x13')]));});});};
\ No newline at end of file
+var _0xe764=['error','message','info','result','catch','GetInterval','Interval','options','raw','where','attributes','limit','include','map','model','then','debug','ShowInterval','find','stringify','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','Interval,\x20%s,\x20%s','request\x20sent','Interval,\x20%s,\x20%s,\x20%s'];(function(_0x51ea0c,_0x117636){var _0x164262=function(_0x223772){while(--_0x223772){_0x51ea0c['push'](_0x51ea0c['shift']());}};_0x164262(++_0x117636);}(_0xe764,0x14f));var _0x4e76=function(_0x295b1a,_0x1e31a){_0x295b1a=_0x295b1a-0x0;var _0x2bb42b=_0xe764[_0x295b1a];return _0x2bb42b;};'use strict';var _=require(_0x4e76('0x0'));var util=require('util');var moment=require(_0x4e76('0x1'));var BPromise=require('bluebird');var rs=require(_0x4e76('0x2'));var fs=require('fs');var Redis=require(_0x4e76('0x3'));var db=require(_0x4e76('0x4'))['db'];var utils=require(_0x4e76('0x5'));var logger=require(_0x4e76('0x6'))(_0x4e76('0x7'));var config=require(_0x4e76('0x8'));var jayson=require(_0x4e76('0x9'));var client=jayson[_0x4e76('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x192fb8,_0x22824d,_0x3f2813){return new BPromise(function(_0x2f240c,_0x285736){return client[_0x4e76('0xb')](_0x192fb8,_0x3f2813)['then'](function(_0x5f0122){logger['info'](_0x4e76('0xc'),_0x22824d,_0x4e76('0xd'));logger['debug'](_0x4e76('0xe'),_0x22824d,_0x4e76('0xd'),JSON['stringify'](_0x5f0122));if(_0x5f0122[_0x4e76('0xf')]){if(_0x5f0122[_0x4e76('0xf')]['code']===0x1f4){logger[_0x4e76('0xf')](_0x4e76('0xc'),_0x22824d,_0x5f0122[_0x4e76('0xf')][_0x4e76('0x10')]);return _0x285736(_0x5f0122[_0x4e76('0xf')]['message']);}logger[_0x4e76('0xf')]('Interval,\x20%s,\x20%s',_0x22824d,_0x5f0122['error'][_0x4e76('0x10')]);return _0x2f240c(_0x5f0122['error'][_0x4e76('0x10')]);}else{logger[_0x4e76('0x11')](_0x4e76('0xc'),_0x22824d,_0x4e76('0xd'));_0x2f240c(_0x5f0122[_0x4e76('0x12')][_0x4e76('0x10')]);}})[_0x4e76('0x13')](function(_0x442dcd){logger[_0x4e76('0xf')](_0x4e76('0xc'),_0x22824d,_0x442dcd);_0x285736(_0x442dcd);});});}exports[_0x4e76('0x14')]=function(_0x42540b){var _0x3ecb16=this;return new Promise(function(_0x2c6ff0,_0x1e80f7){return db[_0x4e76('0x15')]['findAll']({'raw':_0x42540b['options']?_0x42540b[_0x4e76('0x16')][_0x4e76('0x17')]===undefined?!![]:![]:!![],'where':_0x42540b[_0x4e76('0x16')]?_0x42540b[_0x4e76('0x16')][_0x4e76('0x18')]||null:null,'attributes':_0x42540b[_0x4e76('0x16')]?_0x42540b[_0x4e76('0x16')][_0x4e76('0x19')]||null:null,'limit':_0x42540b[_0x4e76('0x16')]?_0x42540b[_0x4e76('0x16')][_0x4e76('0x1a')]||null:null,'include':_0x42540b[_0x4e76('0x16')]?_0x42540b[_0x4e76('0x16')][_0x4e76('0x1b')]?_[_0x4e76('0x1c')](_0x42540b[_0x4e76('0x16')][_0x4e76('0x1b')],function(_0xf9d053){return{'model':db[_0xf9d053['model']],'as':_0xf9d053['as'],'attributes':_0xf9d053[_0x4e76('0x19')],'include':_0xf9d053[_0x4e76('0x1b')]?_[_0x4e76('0x1c')](_0xf9d053[_0x4e76('0x1b')],function(_0x5bbf65){return{'model':db[_0x5bbf65[_0x4e76('0x1d')]],'as':_0x5bbf65['as'],'attributes':_0x5bbf65['attributes'],'include':_0x5bbf65[_0x4e76('0x1b')]?_[_0x4e76('0x1c')](_0x5bbf65[_0x4e76('0x1b')],function(_0x3a426c){return{'model':db[_0x3a426c['model']],'as':_0x3a426c['as'],'attributes':_0x3a426c[_0x4e76('0x19')]};}):[]};}):[]};}):[]:[]})[_0x4e76('0x1e')](function(_0x9e9e22){logger[_0x4e76('0x11')](_0x4e76('0x14'),_0x42540b);logger[_0x4e76('0x1f')](_0x4e76('0x14'),_0x42540b,JSON['stringify'](_0x9e9e22));_0x2c6ff0(_0x9e9e22);})[_0x4e76('0x13')](function(_0x34a5d0){logger[_0x4e76('0xf')]('GetInterval',_0x34a5d0[_0x4e76('0x10')],_0x42540b);_0x1e80f7(_0x3ecb16['error'](0x1f4,_0x34a5d0['message']));});});};exports[_0x4e76('0x20')]=function(_0xcf722c){var _0x56bbbf=this;return new Promise(function(_0x151420,_0x21703c){return db[_0x4e76('0x15')][_0x4e76('0x21')]({'raw':_0xcf722c[_0x4e76('0x16')]?_0xcf722c[_0x4e76('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0xcf722c[_0x4e76('0x16')]?_0xcf722c['options']['where']||null:null,'attributes':_0xcf722c['options']?_0xcf722c[_0x4e76('0x16')][_0x4e76('0x19')]||null:null,'include':_0xcf722c[_0x4e76('0x16')]?_0xcf722c[_0x4e76('0x16')][_0x4e76('0x1b')]?_[_0x4e76('0x1c')](_0xcf722c[_0x4e76('0x16')][_0x4e76('0x1b')],function(_0x2e9cea){return{'model':db[_0x2e9cea['model']],'as':_0x2e9cea['as'],'attributes':_0x2e9cea[_0x4e76('0x19')],'include':_0x2e9cea['include']?_[_0x4e76('0x1c')](_0x2e9cea['include'],function(_0x561fe6){return{'model':db[_0x561fe6[_0x4e76('0x1d')]],'as':_0x561fe6['as'],'attributes':_0x561fe6[_0x4e76('0x19')],'include':_0x561fe6[_0x4e76('0x1b')]?_[_0x4e76('0x1c')](_0x561fe6[_0x4e76('0x1b')],function(_0x3d1a5a){return{'model':db[_0x3d1a5a[_0x4e76('0x1d')]],'as':_0x3d1a5a['as'],'attributes':_0x3d1a5a[_0x4e76('0x19')]};}):[]};}):[]};}):[]:[]})[_0x4e76('0x1e')](function(_0x326d4d){logger[_0x4e76('0x11')](_0x4e76('0x20'),_0xcf722c);logger[_0x4e76('0x1f')](_0x4e76('0x20'),_0xcf722c,JSON[_0x4e76('0x22')](_0x326d4d));_0x151420(_0x326d4d);})['catch'](function(_0x3f4e0b){logger[_0x4e76('0xf')]('ShowInterval',_0x3f4e0b[_0x4e76('0x10')],_0xcf722c);_0x21703c(_0x56bbbf[_0x4e76('0xf')](0x1f4,_0x3f4e0b[_0x4e76('0x10')]));});});};
\ No newline at end of file
diff --git a/server/api/jira/index.js b/server/api/jira/index.js
index 29ab665..5898127 100644
--- a/server/api/jira/index.js
+++ b/server/api/jira/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x21f2=['exports','Router','../../components/auth/service','./jira.controller','post','isAuthenticated','send'];(function(_0x154f26,_0x228c67){var _0x2a1b3f=function(_0x1a93a3){while(--_0x1a93a3){_0x154f26['push'](_0x154f26['shift']());}};_0x2a1b3f(++_0x228c67);}(_0x21f2,0x158));var _0x221f=function(_0x4f6f05,_0x293eed){_0x4f6f05=_0x4f6f05-0x0;var _0x2255fe=_0x21f2[_0x4f6f05];return _0x2255fe;};'use strict';var express=require('express');var router=express[_0x221f('0x0')]();var auth=require(_0x221f('0x1'));var controller=require(_0x221f('0x2'));router[_0x221f('0x3')]('/',auth[_0x221f('0x4')](),controller[_0x221f('0x5')]);module[_0x221f('0x6')]=router;
\ No newline at end of file
+var _0x3102=['../../components/auth/service','./jira.controller','post','send','exports','Router'];(function(_0x56c2bd,_0x307141){var _0x1edc9c=function(_0x12d5e2){while(--_0x12d5e2){_0x56c2bd['push'](_0x56c2bd['shift']());}};_0x1edc9c(++_0x307141);}(_0x3102,0x119));var _0x2310=function(_0x1d50f2,_0x3c3ec6){_0x1d50f2=_0x1d50f2-0x0;var _0x3769b8=_0x3102[_0x1d50f2];return _0x3769b8;};'use strict';var express=require('express');var router=express[_0x2310('0x0')]();var auth=require(_0x2310('0x1'));var controller=require(_0x2310('0x2'));router[_0x2310('0x3')]('/',auth['isAuthenticated'](),controller[_0x2310('0x4')]);module[_0x2310('0x5')]=router;
\ No newline at end of file
diff --git a/server/api/jira/jira.controller.js b/server/api/jira/jira.controller.js
index ad252fd..6d608b5 100644
--- a/server/api/jira/jira.controller.js
+++ b/server/api/jira/jira.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xd84d=['write','openIssue','send','body','headers','connection','remoteAddress','socket','https','api','support','3eAmWpBVP0','MOTGUI','summary','Report','\x20from\x20','Bug','customfield_11500','email','fields','customfield_11501','oldToken','customfield_11502','newToken','customfield_11503','name','customfield_11504','reason','customfield_10102','track.xcallymotion.com','/rest/api/2/issue','POST','application/json','Basic\x20','toString','base64','stringify','request','setEncoding','utf8','data','status','json','parse','error','Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','api.jira'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xd84d,0x151));var _0xdd84=function(_0x31f442,_0x32c25f){_0x31f442=_0x31f442-0x0;var _0x5215f3=_0xd84d[_0x31f442];return _0x5215f3;};'use strict';var BPromise=require('bluebird');var https=require(_0xdd84('0x0'));var logger=require('../../config/logger')(_0xdd84('0x1'));var USERNAME=_0xdd84('0x2');var PASSWORD=_0xdd84('0x3');function openIssue(_0x3d8d00,_0x4b52d8){var _0x484f4b={'fields':{'project':{'key':_0x3d8d00['key']||_0xdd84('0x4')},'summary':(_0x3d8d00[_0xdd84('0x5')]||_0xdd84('0x6'))+_0xdd84('0x7')+_0x3d8d00['ip'],'description':_0x3d8d00['description']||JSON['stringify'](_0x3d8d00),'issuetype':{'name':_0x3d8d00['issuetype']||_0xdd84('0x8')}}};_0x484f4b['fields'][_0xdd84('0x9')]=_0x3d8d00[_0xdd84('0xa')];_0x484f4b[_0xdd84('0xb')][_0xdd84('0xc')]=_0x3d8d00[_0xdd84('0xd')];_0x484f4b[_0xdd84('0xb')][_0xdd84('0xe')]=_0x3d8d00[_0xdd84('0xf')];_0x484f4b[_0xdd84('0xb')][_0xdd84('0x10')]=_0x3d8d00[_0xdd84('0x11')];_0x484f4b[_0xdd84('0xb')][_0xdd84('0x12')]=_0x3d8d00[_0xdd84('0x13')];_0x484f4b[_0xdd84('0xb')][_0xdd84('0x14')]=_0x3d8d00['ip'];var _0x934418={'host':_0xdd84('0x15'),'port':0x1bb,'path':_0xdd84('0x16'),'method':_0xdd84('0x17'),'timeout':0x4e20,'headers':{'Content-Type':_0xdd84('0x18'),'Authorization':_0xdd84('0x19')+new Buffer(USERNAME+':'+PASSWORD)[_0xdd84('0x1a')](_0xdd84('0x1b'))}};var _0x5388a2=JSON[_0xdd84('0x1c')](_0x484f4b);var _0x463ed6=https[_0xdd84('0x1d')](_0x934418,function(_0x3e2891){_0x3e2891[_0xdd84('0x1e')](_0xdd84('0x1f'));var _0x290b62='';_0x3e2891['on'](_0xdd84('0x20'),function(_0x1f1ffc){_0x290b62+=_0x1f1ffc;});_0x3e2891['on']('end',function(){if(_0x4b52d8){return _0x4b52d8[_0xdd84('0x21')](_0x3e2891['statusCode'])[_0xdd84('0x22')](JSON[_0xdd84('0x23')](_0x290b62));}});});_0x463ed6['on'](_0xdd84('0x24'),function(_0x492226){if(_0x4b52d8){return _0x4b52d8[_0xdd84('0x21')](0x1f4)[_0xdd84('0x22')]({'errors':[{'message':_0xdd84('0x25'),'type':_0xdd84('0x26')}]});}});_0x463ed6[_0xdd84('0x27')](_0x5388a2);_0x463ed6['end']();}exports[_0xdd84('0x28')]=openIssue;exports[_0xdd84('0x29')]=function(_0x29480b,_0x5a383f){_0x29480b[_0xdd84('0x2a')]['ip']=_0x29480b[_0xdd84('0x2b')]['x-forwarded-for']||_0x29480b[_0xdd84('0x2c')][_0xdd84('0x2d')]||_0x29480b[_0xdd84('0x2e')][_0xdd84('0x2d')]||_0x29480b[_0xdd84('0x2c')][_0xdd84('0x2e')][_0xdd84('0x2d')];return openIssue(_0x29480b[_0xdd84('0x2a')],_0x5a383f);};
\ No newline at end of file
+var _0xb4c0=['stringify','request','setEncoding','utf8','end','status','statusCode','json','parse','Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','api.jira','write','openIssue','send','body','headers','x-forwarded-for','remoteAddress','socket','../../config/logger','support','3eAmWpBVP0','MOTGUI','summary','Report','\x20from\x20','description','issuetype','Bug','fields','customfield_11500','email','oldToken','customfield_11502','newToken','name','customfield_11504','reason','customfield_10102','POST','application/json','Basic\x20','toString','base64'];(function(_0x56a4da,_0x4ac978){var _0xf62943=function(_0x270fd8){while(--_0x270fd8){_0x56a4da['push'](_0x56a4da['shift']());}};_0xf62943(++_0x4ac978);}(_0xb4c0,0xef));var _0x0b4c=function(_0x59777c,_0x2dcd9d){_0x59777c=_0x59777c-0x0;var _0x264753=_0xb4c0[_0x59777c];return _0x264753;};'use strict';var BPromise=require('bluebird');var https=require('https');var logger=require(_0x0b4c('0x0'))('api');var USERNAME=_0x0b4c('0x1');var PASSWORD=_0x0b4c('0x2');function openIssue(_0xb3f406,_0x5a5d73){var _0x28f9ec={'fields':{'project':{'key':_0xb3f406['key']||_0x0b4c('0x3')},'summary':(_0xb3f406[_0x0b4c('0x4')]||_0x0b4c('0x5'))+_0x0b4c('0x6')+_0xb3f406['ip'],'description':_0xb3f406[_0x0b4c('0x7')]||JSON['stringify'](_0xb3f406),'issuetype':{'name':_0xb3f406[_0x0b4c('0x8')]||_0x0b4c('0x9')}}};_0x28f9ec[_0x0b4c('0xa')][_0x0b4c('0xb')]=_0xb3f406[_0x0b4c('0xc')];_0x28f9ec['fields']['customfield_11501']=_0xb3f406[_0x0b4c('0xd')];_0x28f9ec[_0x0b4c('0xa')][_0x0b4c('0xe')]=_0xb3f406[_0x0b4c('0xf')];_0x28f9ec[_0x0b4c('0xa')]['customfield_11503']=_0xb3f406[_0x0b4c('0x10')];_0x28f9ec[_0x0b4c('0xa')][_0x0b4c('0x11')]=_0xb3f406[_0x0b4c('0x12')];_0x28f9ec['fields'][_0x0b4c('0x13')]=_0xb3f406['ip'];var _0x59cd80={'host':'track.xcallymotion.com','port':0x1bb,'path':'/rest/api/2/issue','method':_0x0b4c('0x14'),'timeout':0x4e20,'headers':{'Content-Type':_0x0b4c('0x15'),'Authorization':_0x0b4c('0x16')+new Buffer(USERNAME+':'+PASSWORD)[_0x0b4c('0x17')](_0x0b4c('0x18'))}};var _0x2f75de=JSON[_0x0b4c('0x19')](_0x28f9ec);var _0x3f0788=https[_0x0b4c('0x1a')](_0x59cd80,function(_0x457077){_0x457077[_0x0b4c('0x1b')](_0x0b4c('0x1c'));var _0x5dc9b4='';_0x457077['on']('data',function(_0x1c438f){_0x5dc9b4+=_0x1c438f;});_0x457077['on'](_0x0b4c('0x1d'),function(){if(_0x5a5d73){return _0x5a5d73[_0x0b4c('0x1e')](_0x457077[_0x0b4c('0x1f')])[_0x0b4c('0x20')](JSON[_0x0b4c('0x21')](_0x5dc9b4));}});});_0x3f0788['on']('error',function(_0x228991){if(_0x5a5d73){return _0x5a5d73[_0x0b4c('0x1e')](0x1f4)[_0x0b4c('0x20')]({'errors':[{'message':_0x0b4c('0x22'),'type':_0x0b4c('0x23')}]});}});_0x3f0788[_0x0b4c('0x24')](_0x2f75de);_0x3f0788['end']();}exports[_0x0b4c('0x25')]=openIssue;exports[_0x0b4c('0x26')]=function(_0x4c359d,_0x30cecc){_0x4c359d[_0x0b4c('0x27')]['ip']=_0x4c359d[_0x0b4c('0x28')][_0x0b4c('0x29')]||_0x4c359d['connection'][_0x0b4c('0x2a')]||_0x4c359d[_0x0b4c('0x2b')][_0x0b4c('0x2a')]||_0x4c359d['connection'][_0x0b4c('0x2b')][_0x0b4c('0x2a')];return openIssue(_0x4c359d[_0x0b4c('0x27')],_0x30cecc);};
\ No newline at end of file
diff --git a/server/api/jscriptyAnswerReport/index.js b/server/api/jscriptyAnswerReport/index.js
index 02df65b..15d80dd 100644
--- a/server/api/jscriptyAnswerReport/index.js
+++ b/server/api/jscriptyAnswerReport/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x06b1=['../../components/auth/service','../../config/environment','isAuthenticated','index','get','describe','/:id','show','post','create','update','delete','destroy','exports','multer','util','path','connect-timeout','Router'];(function(_0x3bf3c1,_0x51f9d1){var _0x47d3a4=function(_0x3820e3){while(--_0x3820e3){_0x3bf3c1['push'](_0x3bf3c1['shift']());}};_0x47d3a4(++_0x51f9d1);}(_0x06b1,0x177));var _0x106b=function(_0x43aed7,_0x14a55c){_0x43aed7=_0x43aed7-0x0;var _0x573cb7=_0x06b1[_0x43aed7];return _0x573cb7;};'use strict';var multer=require(_0x106b('0x0'));var util=require(_0x106b('0x1'));var path=require(_0x106b('0x2'));var timeout=require(_0x106b('0x3'));var express=require('express');var router=express[_0x106b('0x4')]();var auth=require(_0x106b('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x106b('0x6'));var controller=require('./jscriptyAnswerReport.controller');router['get']('/',auth[_0x106b('0x7')](),controller[_0x106b('0x8')]);router[_0x106b('0x9')]('/describe',auth['isAuthenticated'](),controller[_0x106b('0xa')]);router[_0x106b('0x9')](_0x106b('0xb'),auth[_0x106b('0x7')](),controller[_0x106b('0xc')]);router[_0x106b('0xd')]('/',auth['isAuthenticated'](),controller[_0x106b('0xe')]);router['put'](_0x106b('0xb'),auth['isAuthenticated'](),controller[_0x106b('0xf')]);router[_0x106b('0x10')](_0x106b('0xb'),auth['isAuthenticated'](),controller[_0x106b('0x11')]);module[_0x106b('0x12')]=router;
\ No newline at end of file
+var _0x14ef=['delete','destroy','util','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','post','create','put','update'];(function(_0x2b0a08,_0x351fca){var _0x51aac5=function(_0x2ccd0b){while(--_0x2ccd0b){_0x2b0a08['push'](_0x2b0a08['shift']());}};_0x51aac5(++_0x351fca);}(_0x14ef,0x178));var _0xf14e=function(_0xbd77c1,_0x50b969){_0xbd77c1=_0xbd77c1-0x0;var _0x47fa83=_0x14ef[_0xbd77c1];return _0x47fa83;};'use strict';var multer=require('multer');var util=require(_0xf14e('0x0'));var path=require('path');var timeout=require(_0xf14e('0x1'));var express=require(_0xf14e('0x2'));var router=express['Router']();var auth=require(_0xf14e('0x3'));var interaction=require(_0xf14e('0x4'));var config=require(_0xf14e('0x5'));var controller=require('./jscriptyAnswerReport.controller');router[_0xf14e('0x6')]('/',auth[_0xf14e('0x7')](),controller[_0xf14e('0x8')]);router[_0xf14e('0x6')]('/describe',auth[_0xf14e('0x7')](),controller['describe']);router['get'](_0xf14e('0x9'),auth['isAuthenticated'](),controller[_0xf14e('0xa')]);router[_0xf14e('0xb')]('/',auth[_0xf14e('0x7')](),controller[_0xf14e('0xc')]);router[_0xf14e('0xd')](_0xf14e('0x9'),auth[_0xf14e('0x7')](),controller[_0xf14e('0xe')]);router[_0xf14e('0xf')]('/:id',auth[_0xf14e('0x7')](),controller[_0xf14e('0x10')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js
index 20d73d6..5d16c00 100644
--- a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js
+++ b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x0c9b=['long','exports','STRING','TEXT'];(function(_0x35abf9,_0x43aee9){var _0x3dd06f=function(_0x49644d){while(--_0x49644d){_0x35abf9['push'](_0x35abf9['shift']());}};_0x3dd06f(++_0x43aee9);}(_0x0c9b,0x1b9));var _0xb0c9=function(_0x46bd3a,_0x3532a6){_0x46bd3a=_0x46bd3a-0x0;var _0x413f8b=_0x0c9b[_0x46bd3a];return _0x413f8b;};'use strict';var Sequelize=require('sequelize');module[_0xb0c9('0x0')]={'question':{'type':Sequelize[_0xb0c9('0x1')]},'answer':{'type':Sequelize[_0xb0c9('0x2')](_0xb0c9('0x3'))},'membername':{'type':Sequelize[_0xb0c9('0x1')]},'projectname':{'type':Sequelize[_0xb0c9('0x1')]},'queue':{'type':Sequelize[_0xb0c9('0x1')]},'uniqueid':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0xb0c9('0x1')]},'calleridnum':{'type':Sequelize[_0xb0c9('0x1')]},'questionId':{'type':Sequelize[_0xb0c9('0x1')]}};
\ No newline at end of file
+var _0xb0a7=['TEXT','sequelize','STRING'];(function(_0x19bef1,_0x53c40d){var _0x32de66=function(_0xa75bb9){while(--_0xa75bb9){_0x19bef1['push'](_0x19bef1['shift']());}};_0x32de66(++_0x53c40d);}(_0xb0a7,0x142));var _0x7b0a=function(_0x274584,_0x501942){_0x274584=_0x274584-0x0;var _0x3a068=_0xb0a7[_0x274584];return _0x3a068;};'use strict';var Sequelize=require(_0x7b0a('0x0'));module['exports']={'question':{'type':Sequelize[_0x7b0a('0x1')]},'answer':{'type':Sequelize[_0x7b0a('0x2')]('long')},'membername':{'type':Sequelize[_0x7b0a('0x1')]},'projectname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x7b0a('0x1')]},'calleridname':{'type':Sequelize[_0x7b0a('0x1')]},'calleridnum':{'type':Sequelize[_0x7b0a('0x1')]},'questionId':{'type':Sequelize[_0x7b0a('0x1')]}};
\ No newline at end of file
diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.controller.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.controller.js
index 3f35046..2c817ec 100644
--- a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.controller.js
+++ b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xd197=['body','update','params','destroy','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','json','count','offset','limit','set','Content-Range','reject','then','end','sendStatus','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','query','filters','model','attributes','intersection','length','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','filter','options','JscriptyAnswerReport','includeAll','include','findAll','rows','catch','keys','fields','find'];(function(_0x196e97,_0x4a9704){var _0x20d578=function(_0x9fdec6){while(--_0x9fdec6){_0x196e97['push'](_0x196e97['shift']());}};_0x20d578(++_0x4a9704);}(_0xd197,0x18b));var _0x7d19=function(_0xfd046f,_0x21f3fd){_0xfd046f=_0xfd046f-0x0;var _0x2f52c9=_0xd197[_0xfd046f];return _0x2f52c9;};'use strict';var pdf=require(_0x7d19('0x0'));var emlformat=require(_0x7d19('0x1'));var rimraf=require(_0x7d19('0x2'));var zipdir=require(_0x7d19('0x3'));var jsonpatch=require(_0x7d19('0x4'));var rp=require(_0x7d19('0x5'));var moment=require(_0x7d19('0x6'));var BPromise=require('bluebird');var Mustache=require(_0x7d19('0x7'));var util=require(_0x7d19('0x8'));var path=require(_0x7d19('0x9'));var sox=require(_0x7d19('0xa'));var csv=require(_0x7d19('0xb'));var ejs=require(_0x7d19('0xc'));var fs=require('fs');var _=require(_0x7d19('0xd'));var squel=require('squel');var crypto=require(_0x7d19('0xe'));var jsforce=require(_0x7d19('0xf'));var deskjs=require(_0x7d19('0x10'));var toCsv=require(_0x7d19('0xb'));var querystring=require(_0x7d19('0x11'));var Papa=require('papaparse');var Redis=require(_0x7d19('0x12'));var authService=require(_0x7d19('0x13'));var qs=require(_0x7d19('0x14'));var as=require(_0x7d19('0x15'));var hardwareService=require(_0x7d19('0x16'));var logger=require(_0x7d19('0x17'))(_0x7d19('0x18'));var utils=require(_0x7d19('0x19'));var config=require(_0x7d19('0x1a'));var db=require(_0x7d19('0x1b'))['db'];function respondWithStatusCode(_0x30a7f2,_0x46d263){_0x46d263=_0x46d263||0xcc;return function(_0x17e18c){if(_0x17e18c){return _0x30a7f2['sendStatus'](_0x46d263);}return _0x30a7f2[_0x7d19('0x1c')](_0x46d263)['end']();};}function respondWithResult(_0x39df48,_0x113fa1){_0x113fa1=_0x113fa1||0xc8;return function(_0xe82434){if(_0xe82434){return _0x39df48[_0x7d19('0x1c')](_0x113fa1)[_0x7d19('0x1d')](_0xe82434);}};}function respondWithFilteredResult(_0x537df5,_0x32af1b){return function(_0x91a30a){if(_0x91a30a){var _0x4cd0c9=_0x91a30a[_0x7d19('0x1e')],_0x27409a=_0x32af1b[_0x7d19('0x1f')],_0xc38963=_0x32af1b[_0x7d19('0x1f')]+_0x32af1b[_0x7d19('0x20')],_0x5b2818;if(_0xc38963>=_0x4cd0c9){_0xc38963=_0x4cd0c9;_0x5b2818=0xc8;}else{_0x5b2818=0xce;}_0x537df5[_0x7d19('0x1c')](_0x5b2818);return _0x537df5[_0x7d19('0x21')](_0x7d19('0x22'),_0x27409a+'-'+_0xc38963+'/'+_0x4cd0c9)['json'](_0x91a30a);}return null;};}function patchUpdates(_0x1c16b1){return function(_0x192ef9){try{jsonpatch['apply'](_0x192ef9,_0x1c16b1,!![]);}catch(_0x16422e){return BPromise[_0x7d19('0x23')](_0x16422e);}return _0x192ef9['save']();};}function saveUpdates(_0x24ed4b,_0x3f6ab2){return function(_0xf2e624){if(_0xf2e624){return _0xf2e624['update'](_0x24ed4b)[_0x7d19('0x24')](function(_0x2ad74b){return _0x2ad74b;});}return null;};}function removeEntity(_0x1bef31,_0x4fb016){return function(_0x1d95c5){if(_0x1d95c5){return _0x1d95c5['destroy']()[_0x7d19('0x24')](function(){_0x1bef31[_0x7d19('0x1c')](0xcc)[_0x7d19('0x25')]();});}};}function handleEntityNotFound(_0x18abca,_0x3071b2){return function(_0x1c05b6){if(!_0x1c05b6){_0x18abca[_0x7d19('0x26')](0x194);}return _0x1c05b6;};}function handleError(_0x4dc75e,_0x129680){_0x129680=_0x129680||0x1f4;return function(_0x4b4bf7){logger[_0x7d19('0x27')](_0x4b4bf7[_0x7d19('0x28')]);if(_0x4b4bf7[_0x7d19('0x29')]){delete _0x4b4bf7[_0x7d19('0x29')];}_0x4dc75e[_0x7d19('0x1c')](_0x129680)[_0x7d19('0x2a')](_0x4b4bf7);};}exports[_0x7d19('0x2b')]=function(_0x5cdec9,_0x345b4d){var _0x336e0e={},_0x17a1b8={},_0x214fdf={'count':0x0,'rows':[]};var _0x1a6c1a=_[_0x7d19('0x2c')](db['JscriptyAnswerReport'][_0x7d19('0x2d')],function(_0x4f72d3){return{'name':_0x4f72d3[_0x7d19('0x2e')],'type':_0x4f72d3[_0x7d19('0x2f')][_0x7d19('0x30')]};});_0x17a1b8['model']=_['map'](_0x1a6c1a,_0x7d19('0x29'));_0x17a1b8[_0x7d19('0x31')]=_['keys'](_0x5cdec9['query']);_0x17a1b8[_0x7d19('0x32')]=_['intersection'](_0x17a1b8[_0x7d19('0x33')],_0x17a1b8[_0x7d19('0x31')]);_0x336e0e[_0x7d19('0x34')]=_[_0x7d19('0x35')](_0x17a1b8['model'],qs['fields'](_0x5cdec9[_0x7d19('0x31')]['fields']));_0x336e0e[_0x7d19('0x34')]=_0x336e0e[_0x7d19('0x34')][_0x7d19('0x36')]?_0x336e0e[_0x7d19('0x34')]:_0x17a1b8['model'];if(!_0x5cdec9[_0x7d19('0x31')][_0x7d19('0x37')](_0x7d19('0x38'))){_0x336e0e[_0x7d19('0x20')]=qs[_0x7d19('0x20')](_0x5cdec9['query'][_0x7d19('0x20')]);_0x336e0e[_0x7d19('0x1f')]=qs['offset'](_0x5cdec9['query'][_0x7d19('0x1f')]);}_0x336e0e[_0x7d19('0x39')]=qs[_0x7d19('0x3a')](_0x5cdec9[_0x7d19('0x31')][_0x7d19('0x3a')]);_0x336e0e[_0x7d19('0x3b')]=qs['filters'](_['pick'](_0x5cdec9[_0x7d19('0x31')],_0x17a1b8[_0x7d19('0x32')]),_0x1a6c1a);if(_0x5cdec9[_0x7d19('0x31')]['filter']){_0x336e0e['where']=_[_0x7d19('0x3c')](_0x336e0e[_0x7d19('0x3b')],{'$or':_[_0x7d19('0x2c')](_0x1a6c1a,function(_0x1437e3){if(_0x1437e3['type']!==_0x7d19('0x3d')){var _0x447c44={};_0x447c44[_0x1437e3[_0x7d19('0x29')]]={'$like':'%'+_0x5cdec9[_0x7d19('0x31')][_0x7d19('0x3e')]+'%'};return _0x447c44;}})});}_0x336e0e=_[_0x7d19('0x3c')]({},_0x336e0e,_0x5cdec9[_0x7d19('0x3f')]);var _0x55b499={'where':_0x336e0e[_0x7d19('0x3b')]};return db[_0x7d19('0x40')][_0x7d19('0x1e')](_0x55b499)['then'](function(_0x46aed1){_0x214fdf['count']=_0x46aed1;if(_0x5cdec9['query'][_0x7d19('0x41')]){_0x336e0e[_0x7d19('0x42')]=[{'all':!![]}];}return db[_0x7d19('0x40')][_0x7d19('0x43')](_0x336e0e);})[_0x7d19('0x24')](function(_0x5f2fe3){_0x214fdf[_0x7d19('0x44')]=_0x5f2fe3;return _0x214fdf;})[_0x7d19('0x24')](respondWithFilteredResult(_0x345b4d,_0x336e0e))[_0x7d19('0x45')](handleError(_0x345b4d,null));};exports['show']=function(_0x380b67,_0x30ba05){var _0x24015c={'raw':!![],'where':{'id':_0x380b67['params']['id']}},_0x1db1c7={};_0x1db1c7[_0x7d19('0x33')]=_[_0x7d19('0x46')](db[_0x7d19('0x40')][_0x7d19('0x2d')]);_0x1db1c7['query']=_[_0x7d19('0x46')](_0x380b67[_0x7d19('0x31')]);_0x1db1c7[_0x7d19('0x32')]=_[_0x7d19('0x35')](_0x1db1c7[_0x7d19('0x33')],_0x1db1c7[_0x7d19('0x31')]);_0x24015c['attributes']=_[_0x7d19('0x35')](_0x1db1c7[_0x7d19('0x33')],qs[_0x7d19('0x47')](_0x380b67[_0x7d19('0x31')][_0x7d19('0x47')]));_0x24015c[_0x7d19('0x34')]=_0x24015c[_0x7d19('0x34')][_0x7d19('0x36')]?_0x24015c[_0x7d19('0x34')]:_0x1db1c7[_0x7d19('0x33')];if(_0x380b67['query'][_0x7d19('0x41')]){_0x24015c[_0x7d19('0x42')]=[{'all':!![]}];}_0x24015c=_[_0x7d19('0x3c')]({},_0x24015c,_0x380b67[_0x7d19('0x3f')]);return db[_0x7d19('0x40')][_0x7d19('0x48')](_0x24015c)[_0x7d19('0x24')](handleEntityNotFound(_0x30ba05,null))[_0x7d19('0x24')](respondWithResult(_0x30ba05,null))['catch'](handleError(_0x30ba05,null));};exports['create']=function(_0x42b45d,_0xa00669){return db[_0x7d19('0x40')]['create'](_0x42b45d[_0x7d19('0x49')],{})[_0x7d19('0x24')](respondWithResult(_0xa00669,0xc9))[_0x7d19('0x45')](handleError(_0xa00669,null));};exports[_0x7d19('0x4a')]=function(_0x590ce9,_0x5a431e){if(_0x590ce9[_0x7d19('0x49')]['id']){delete _0x590ce9[_0x7d19('0x49')]['id'];}return db[_0x7d19('0x40')][_0x7d19('0x48')]({'where':{'id':_0x590ce9[_0x7d19('0x4b')]['id']}})[_0x7d19('0x24')](handleEntityNotFound(_0x5a431e,null))[_0x7d19('0x24')](saveUpdates(_0x590ce9[_0x7d19('0x49')],null))[_0x7d19('0x24')](respondWithResult(_0x5a431e,null))[_0x7d19('0x45')](handleError(_0x5a431e,null));};exports[_0x7d19('0x4c')]=function(_0x5ae490,_0x2ec27c){return db['JscriptyAnswerReport'][_0x7d19('0x48')]({'where':{'id':_0x5ae490['params']['id']}})['then'](handleEntityNotFound(_0x2ec27c,null))['then'](removeEntity(_0x2ec27c,null))[_0x7d19('0x45')](handleError(_0x2ec27c,null));};exports[_0x7d19('0x4d')]=function(_0x56a8c0,_0xeca0f1){return db['JscriptyAnswerReport'][_0x7d19('0x4d')]()[_0x7d19('0x24')](respondWithResult(_0xeca0f1,null))['catch'](handleError(_0xeca0f1,null));};
\ No newline at end of file
+var _0x74a8=['length','model','hasOwnProperty','nolimit','limit','sort','where','pick','filter','merge','includeAll','findAll','rows','catch','show','params','rawAttributes','include','options','find','create','body','describe','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','count','offset','apply','reject','save','update','destroy','then','error','stack','name','send','index','JscriptyAnswerReport','type','key','map','query','keys','filters','intersection','attributes','fields'];(function(_0x48aa5b,_0x10f9d3){var _0x44e84f=function(_0x3db468){while(--_0x3db468){_0x48aa5b['push'](_0x48aa5b['shift']());}};_0x44e84f(++_0x10f9d3);}(_0x74a8,0x18e));var _0x874a=function(_0x5ebf86,_0x1a3f74){_0x5ebf86=_0x5ebf86-0x0;var _0x87226c=_0x74a8[_0x5ebf86];return _0x87226c;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x874a('0x0'));var rimraf=require(_0x874a('0x1'));var zipdir=require(_0x874a('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x874a('0x3'));var moment=require('moment');var BPromise=require(_0x874a('0x4'));var Mustache=require(_0x874a('0x5'));var util=require(_0x874a('0x6'));var path=require(_0x874a('0x7'));var sox=require(_0x874a('0x8'));var csv=require(_0x874a('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x874a('0xa'));var squel=require(_0x874a('0xb'));var crypto=require(_0x874a('0xc'));var jsforce=require(_0x874a('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x874a('0x9'));var querystring=require(_0x874a('0xe'));var Papa=require(_0x874a('0xf'));var Redis=require(_0x874a('0x10'));var authService=require(_0x874a('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x874a('0x12'));var hardwareService=require(_0x874a('0x13'));var logger=require(_0x874a('0x14'))(_0x874a('0x15'));var utils=require(_0x874a('0x16'));var config=require(_0x874a('0x17'));var db=require(_0x874a('0x18'))['db'];function respondWithStatusCode(_0x4d83d7,_0x1ff431){_0x1ff431=_0x1ff431||0xcc;return function(_0x304711){if(_0x304711){return _0x4d83d7[_0x874a('0x19')](_0x1ff431);}return _0x4d83d7['status'](_0x1ff431)[_0x874a('0x1a')]();};}function respondWithResult(_0x5c4726,_0x3907ce){_0x3907ce=_0x3907ce||0xc8;return function(_0x4c9313){if(_0x4c9313){return _0x5c4726[_0x874a('0x1b')](_0x3907ce)[_0x874a('0x1c')](_0x4c9313);}};}function respondWithFilteredResult(_0x27085a,_0x34f909){return function(_0x223392){if(_0x223392){var _0x5523c1=_0x223392[_0x874a('0x1d')],_0x54f9a2=_0x34f909['offset'],_0x4fa9b9=_0x34f909[_0x874a('0x1e')]+_0x34f909['limit'],_0x20e0e2;if(_0x4fa9b9>=_0x5523c1){_0x4fa9b9=_0x5523c1;_0x20e0e2=0xc8;}else{_0x20e0e2=0xce;}_0x27085a['status'](_0x20e0e2);return _0x27085a['set']('Content-Range',_0x54f9a2+'-'+_0x4fa9b9+'/'+_0x5523c1)[_0x874a('0x1c')](_0x223392);}return null;};}function patchUpdates(_0x3777d8){return function(_0x3903d9){try{jsonpatch[_0x874a('0x1f')](_0x3903d9,_0x3777d8,!![]);}catch(_0xb278a8){return BPromise[_0x874a('0x20')](_0xb278a8);}return _0x3903d9[_0x874a('0x21')]();};}function saveUpdates(_0x1e841a,_0x5f3beb){return function(_0x2efbaa){if(_0x2efbaa){return _0x2efbaa[_0x874a('0x22')](_0x1e841a)['then'](function(_0x1c5efc){return _0x1c5efc;});}return null;};}function removeEntity(_0x18e0c7,_0x2af359){return function(_0x454024){if(_0x454024){return _0x454024[_0x874a('0x23')]()[_0x874a('0x24')](function(){_0x18e0c7[_0x874a('0x1b')](0xcc)[_0x874a('0x1a')]();});}};}function handleEntityNotFound(_0x4fdaae,_0x10f87b){return function(_0x47bae7){if(!_0x47bae7){_0x4fdaae[_0x874a('0x19')](0x194);}return _0x47bae7;};}function handleError(_0x3b1a10,_0x3337c7){_0x3337c7=_0x3337c7||0x1f4;return function(_0x2c2b9a){logger[_0x874a('0x25')](_0x2c2b9a[_0x874a('0x26')]);if(_0x2c2b9a[_0x874a('0x27')]){delete _0x2c2b9a['name'];}_0x3b1a10[_0x874a('0x1b')](_0x3337c7)[_0x874a('0x28')](_0x2c2b9a);};}exports[_0x874a('0x29')]=function(_0x57e1d5,_0x595ede){var _0x377334={},_0x302232={},_0x4c7863={'count':0x0,'rows':[]};var _0x424ddc=_['map'](db[_0x874a('0x2a')]['rawAttributes'],function(_0x4b7bc7){return{'name':_0x4b7bc7['fieldName'],'type':_0x4b7bc7[_0x874a('0x2b')][_0x874a('0x2c')]};});_0x302232['model']=_[_0x874a('0x2d')](_0x424ddc,_0x874a('0x27'));_0x302232[_0x874a('0x2e')]=_[_0x874a('0x2f')](_0x57e1d5[_0x874a('0x2e')]);_0x302232[_0x874a('0x30')]=_[_0x874a('0x31')](_0x302232['model'],_0x302232['query']);_0x377334[_0x874a('0x32')]=_[_0x874a('0x31')](_0x302232['model'],qs[_0x874a('0x33')](_0x57e1d5[_0x874a('0x2e')][_0x874a('0x33')]));_0x377334[_0x874a('0x32')]=_0x377334[_0x874a('0x32')][_0x874a('0x34')]?_0x377334[_0x874a('0x32')]:_0x302232[_0x874a('0x35')];if(!_0x57e1d5['query'][_0x874a('0x36')](_0x874a('0x37'))){_0x377334['limit']=qs['limit'](_0x57e1d5[_0x874a('0x2e')][_0x874a('0x38')]);_0x377334[_0x874a('0x1e')]=qs[_0x874a('0x1e')](_0x57e1d5[_0x874a('0x2e')]['offset']);}_0x377334['order']=qs[_0x874a('0x39')](_0x57e1d5[_0x874a('0x2e')][_0x874a('0x39')]);_0x377334[_0x874a('0x3a')]=qs['filters'](_[_0x874a('0x3b')](_0x57e1d5[_0x874a('0x2e')],_0x302232[_0x874a('0x30')]),_0x424ddc);if(_0x57e1d5[_0x874a('0x2e')][_0x874a('0x3c')]){_0x377334[_0x874a('0x3a')]=_['merge'](_0x377334[_0x874a('0x3a')],{'$or':_[_0x874a('0x2d')](_0x424ddc,function(_0x7f8c71){if(_0x7f8c71[_0x874a('0x2b')]!=='VIRTUAL'){var _0x19b31b={};_0x19b31b[_0x7f8c71[_0x874a('0x27')]]={'$like':'%'+_0x57e1d5[_0x874a('0x2e')]['filter']+'%'};return _0x19b31b;}})});}_0x377334=_[_0x874a('0x3d')]({},_0x377334,_0x57e1d5['options']);var _0x431856={'where':_0x377334[_0x874a('0x3a')]};return db[_0x874a('0x2a')][_0x874a('0x1d')](_0x431856)[_0x874a('0x24')](function(_0x53a74a){_0x4c7863[_0x874a('0x1d')]=_0x53a74a;if(_0x57e1d5['query'][_0x874a('0x3e')]){_0x377334['include']=[{'all':!![]}];}return db[_0x874a('0x2a')][_0x874a('0x3f')](_0x377334);})[_0x874a('0x24')](function(_0x5bb122){_0x4c7863[_0x874a('0x40')]=_0x5bb122;return _0x4c7863;})[_0x874a('0x24')](respondWithFilteredResult(_0x595ede,_0x377334))[_0x874a('0x41')](handleError(_0x595ede,null));};exports[_0x874a('0x42')]=function(_0x2c3b20,_0x55da45){var _0x59d574={'raw':!![],'where':{'id':_0x2c3b20[_0x874a('0x43')]['id']}},_0x2838b6={};_0x2838b6[_0x874a('0x35')]=_[_0x874a('0x2f')](db['JscriptyAnswerReport'][_0x874a('0x44')]);_0x2838b6[_0x874a('0x2e')]=_[_0x874a('0x2f')](_0x2c3b20['query']);_0x2838b6[_0x874a('0x30')]=_['intersection'](_0x2838b6['model'],_0x2838b6['query']);_0x59d574['attributes']=_[_0x874a('0x31')](_0x2838b6['model'],qs[_0x874a('0x33')](_0x2c3b20[_0x874a('0x2e')][_0x874a('0x33')]));_0x59d574[_0x874a('0x32')]=_0x59d574[_0x874a('0x32')][_0x874a('0x34')]?_0x59d574[_0x874a('0x32')]:_0x2838b6[_0x874a('0x35')];if(_0x2c3b20['query'][_0x874a('0x3e')]){_0x59d574[_0x874a('0x45')]=[{'all':!![]}];}_0x59d574=_[_0x874a('0x3d')]({},_0x59d574,_0x2c3b20[_0x874a('0x46')]);return db[_0x874a('0x2a')][_0x874a('0x47')](_0x59d574)[_0x874a('0x24')](handleEntityNotFound(_0x55da45,null))[_0x874a('0x24')](respondWithResult(_0x55da45,null))[_0x874a('0x41')](handleError(_0x55da45,null));};exports[_0x874a('0x48')]=function(_0x3ce349,_0x211990){return db[_0x874a('0x2a')][_0x874a('0x48')](_0x3ce349[_0x874a('0x49')],{})[_0x874a('0x24')](respondWithResult(_0x211990,0xc9))[_0x874a('0x41')](handleError(_0x211990,null));};exports[_0x874a('0x22')]=function(_0x3ae101,_0x1508b0){if(_0x3ae101[_0x874a('0x49')]['id']){delete _0x3ae101[_0x874a('0x49')]['id'];}return db[_0x874a('0x2a')][_0x874a('0x47')]({'where':{'id':_0x3ae101['params']['id']}})['then'](handleEntityNotFound(_0x1508b0,null))['then'](saveUpdates(_0x3ae101[_0x874a('0x49')],null))[_0x874a('0x24')](respondWithResult(_0x1508b0,null))[_0x874a('0x41')](handleError(_0x1508b0,null));};exports[_0x874a('0x23')]=function(_0xa556cf,_0x52c604){return db[_0x874a('0x2a')]['find']({'where':{'id':_0xa556cf[_0x874a('0x43')]['id']}})[_0x874a('0x24')](handleEntityNotFound(_0x52c604,null))[_0x874a('0x24')](removeEntity(_0x52c604,null))['catch'](handleError(_0x52c604,null));};exports[_0x874a('0x4a')]=function(_0x3b8274,_0x5bf58a){return db['JscriptyAnswerReport'][_0x874a('0x4a')]()[_0x874a('0x24')](respondWithResult(_0x5bf58a,null))[_0x874a('0x41')](handleError(_0x5bf58a,null));};
\ No newline at end of file
diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js
index 2a3b89f..ae37b14 100644
--- a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js
+++ b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x1558=['path','rimraf','./jscriptyAnswerReport.attributes','define','report_jscripty_answers','util','../../config/logger','api','moment','request-promise'];(function(_0x333fc8,_0x2b292c){var _0x432439=function(_0x5501b6){while(--_0x5501b6){_0x333fc8['push'](_0x333fc8['shift']());}};_0x432439(++_0x2b292c);}(_0x1558,0x18b));var _0x8155=function(_0x97c6ea,_0x4cffce){_0x97c6ea=_0x97c6ea-0x0;var _0x2d7f50=_0x1558[_0x97c6ea];return _0x2d7f50;};'use strict';var _=require('lodash');var util=require(_0x8155('0x0'));var logger=require(_0x8155('0x1'))(_0x8155('0x2'));var moment=require(_0x8155('0x3'));var BPromise=require('bluebird');var rp=require(_0x8155('0x4'));var fs=require('fs');var path=require(_0x8155('0x5'));var rimraf=require(_0x8155('0x6'));var config=require('../../config/environment');var attributes=require(_0x8155('0x7'));module['exports']=function(_0xfd3b1b,_0x4896c9){return _0xfd3b1b[_0x8155('0x8')]('JscriptyAnswerReport',attributes,{'tableName':_0x8155('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x4374=['moment','request-promise','path','rimraf','../../config/environment','./jscriptyAnswerReport.attributes','define','report_jscripty_answers','util','../../config/logger','api'];(function(_0x1bdc52,_0x4876a9){var _0xdf3fa3=function(_0x2a3ba4){while(--_0x2a3ba4){_0x1bdc52['push'](_0x1bdc52['shift']());}};_0xdf3fa3(++_0x4876a9);}(_0x4374,0x1aa));var _0x4437=function(_0xa77016,_0x1de579){_0xa77016=_0xa77016-0x0;var _0x30ed8c=_0x4374[_0xa77016];return _0x30ed8c;};'use strict';var _=require('lodash');var util=require(_0x4437('0x0'));var logger=require(_0x4437('0x1'))(_0x4437('0x2'));var moment=require(_0x4437('0x3'));var BPromise=require('bluebird');var rp=require(_0x4437('0x4'));var fs=require('fs');var path=require(_0x4437('0x5'));var rimraf=require(_0x4437('0x6'));var config=require(_0x4437('0x7'));var attributes=require(_0x4437('0x8'));module['exports']=function(_0x328bab,_0x19906d){return _0x328bab[_0x4437('0x9')]('JscriptyAnswerReport',attributes,{'tableName':_0x4437('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.rpc.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.rpc.js
index d85dc29..7520139 100644
--- a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.rpc.js
+++ b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x0ed2=['util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','JscriptyAnswerReport,\x20%s,\x20%s','JscriptyAnswerReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','catch','lodash'];(function(_0x369151,_0x179f72){var _0x4292d5=function(_0x330422){while(--_0x330422){_0x369151['push'](_0x369151['shift']());}};_0x4292d5(++_0x179f72);}(_0x0ed2,0x158));var _0x20ed=function(_0x4363f3,_0x54b5b9){_0x4363f3=_0x4363f3-0x0;var _0x417409=_0x0ed2[_0x4363f3];return _0x417409;};'use strict';var _=require(_0x20ed('0x0'));var util=require(_0x20ed('0x1'));var moment=require(_0x20ed('0x2'));var BPromise=require(_0x20ed('0x3'));var rs=require(_0x20ed('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x20ed('0x5'))['db'];var utils=require(_0x20ed('0x6'));var logger=require(_0x20ed('0x7'))(_0x20ed('0x8'));var config=require(_0x20ed('0x9'));var jayson=require(_0x20ed('0xa'));var client=jayson[_0x20ed('0xb')][_0x20ed('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x22910b,_0x4556c6,_0x44f297){return new BPromise(function(_0x1d2a48,_0x11d0ed){return client[_0x20ed('0xd')](_0x22910b,_0x44f297)[_0x20ed('0xe')](function(_0x3e365b){logger[_0x20ed('0xf')](_0x20ed('0x10'),_0x4556c6,'request\x20sent');logger['debug'](_0x20ed('0x11'),_0x4556c6,_0x20ed('0x12'),JSON['stringify'](_0x3e365b));if(_0x3e365b[_0x20ed('0x13')]){if(_0x3e365b[_0x20ed('0x13')][_0x20ed('0x14')]===0x1f4){logger[_0x20ed('0x13')](_0x20ed('0x10'),_0x4556c6,_0x3e365b[_0x20ed('0x13')][_0x20ed('0x15')]);return _0x11d0ed(_0x3e365b[_0x20ed('0x13')]['message']);}logger[_0x20ed('0x13')](_0x20ed('0x10'),_0x4556c6,_0x3e365b[_0x20ed('0x13')][_0x20ed('0x15')]);return _0x1d2a48(_0x3e365b[_0x20ed('0x13')][_0x20ed('0x15')]);}else{logger[_0x20ed('0xf')](_0x20ed('0x10'),_0x4556c6,_0x20ed('0x12'));_0x1d2a48(_0x3e365b['result'][_0x20ed('0x15')]);}})[_0x20ed('0x16')](function(_0x3c6fe4){logger['error'](_0x20ed('0x10'),_0x4556c6,_0x3c6fe4);_0x11d0ed(_0x3c6fe4);});});}
\ No newline at end of file
+var _0x59ff=['../../config/environment','jayson/promise','http','request','then','info','JscriptyAnswerReport,\x20%s,\x20%s','request\x20sent','JscriptyAnswerReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','ioredis','../../config/utils','rpc'];(function(_0x56f6c0,_0x37c097){var _0x249342=function(_0x4ab8d9){while(--_0x4ab8d9){_0x56f6c0['push'](_0x56f6c0['shift']());}};_0x249342(++_0x37c097);}(_0x59ff,0x8c));var _0xf59f=function(_0x4e8a9c,_0x56f599){_0x4e8a9c=_0x4e8a9c-0x0;var _0x34de7b=_0x59ff[_0x4e8a9c];return _0x34de7b;};'use strict';var _=require(_0xf59f('0x0'));var util=require(_0xf59f('0x1'));var moment=require(_0xf59f('0x2'));var BPromise=require(_0xf59f('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf59f('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xf59f('0x5'));var logger=require('../../config/logger')(_0xf59f('0x6'));var config=require(_0xf59f('0x7'));var jayson=require(_0xf59f('0x8'));var client=jayson['client'][_0xf59f('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x57a3f3,_0x28ff83,_0x14d9ae){return new BPromise(function(_0xfa71fb,_0x1e81d5){return client[_0xf59f('0xa')](_0x57a3f3,_0x14d9ae)[_0xf59f('0xb')](function(_0x8927ba){logger[_0xf59f('0xc')](_0xf59f('0xd'),_0x28ff83,_0xf59f('0xe'));logger['debug'](_0xf59f('0xf'),_0x28ff83,_0xf59f('0xe'),JSON[_0xf59f('0x10')](_0x8927ba));if(_0x8927ba['error']){if(_0x8927ba[_0xf59f('0x11')]['code']===0x1f4){logger[_0xf59f('0x11')](_0xf59f('0xd'),_0x28ff83,_0x8927ba[_0xf59f('0x11')][_0xf59f('0x12')]);return _0x1e81d5(_0x8927ba[_0xf59f('0x11')][_0xf59f('0x12')]);}logger[_0xf59f('0x11')](_0xf59f('0xd'),_0x28ff83,_0x8927ba['error'][_0xf59f('0x12')]);return _0xfa71fb(_0x8927ba['error'][_0xf59f('0x12')]);}else{logger[_0xf59f('0xc')](_0xf59f('0xd'),_0x28ff83,_0xf59f('0xe'));_0xfa71fb(_0x8927ba[_0xf59f('0x13')][_0xf59f('0x12')]);}})[_0xf59f('0x14')](function(_0x439825){logger[_0xf59f('0x11')](_0xf59f('0xd'),_0x28ff83,_0x439825);_0x1e81d5(_0x439825);});});}
\ No newline at end of file
diff --git a/server/api/jscriptyProject/index.js b/server/api/jscriptyProject/index.js
index 8e47843..720d83b 100644
--- a/server/api/jscriptyProject/index.js
+++ b/server/api/jscriptyProject/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x1b1f=['express','Router','../../config/environment','./jscriptyProject.controller','get','isAuthenticated','index','/:id','show','/:id/sessions','getSessions','/:id/answers','getAnswers','/:id/summary','post','clone','put','update','delete','destroy','exports','multer','util','path'];(function(_0xa1a0bf,_0x5efc8e){var _0x3c90dc=function(_0x2c40b4){while(--_0x2c40b4){_0xa1a0bf['push'](_0xa1a0bf['shift']());}};_0x3c90dc(++_0x5efc8e);}(_0x1b1f,0xed));var _0xf1b1=function(_0x543354,_0x576f92){_0x543354=_0x543354-0x0;var _0x11cec2=_0x1b1f[_0x543354];return _0x11cec2;};'use strict';var multer=require(_0xf1b1('0x0'));var util=require(_0xf1b1('0x1'));var path=require(_0xf1b1('0x2'));var timeout=require('connect-timeout');var express=require(_0xf1b1('0x3'));var router=express[_0xf1b1('0x4')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xf1b1('0x5'));var controller=require(_0xf1b1('0x6'));router[_0xf1b1('0x7')]('/',auth[_0xf1b1('0x8')](),controller[_0xf1b1('0x9')]);router[_0xf1b1('0x7')](_0xf1b1('0xa'),auth[_0xf1b1('0x8')](),controller[_0xf1b1('0xb')]);router[_0xf1b1('0x7')](_0xf1b1('0xc'),auth['isAuthenticated'](),controller[_0xf1b1('0xd')]);router[_0xf1b1('0x7')](_0xf1b1('0xe'),auth[_0xf1b1('0x8')](),controller[_0xf1b1('0xf')]);router[_0xf1b1('0x7')](_0xf1b1('0x10'),auth[_0xf1b1('0x8')](),timeout('30s'),controller['getSummary']);router[_0xf1b1('0x11')]('/',auth[_0xf1b1('0x8')](),controller['create']);router[_0xf1b1('0x11')]('/:id/clone',auth[_0xf1b1('0x8')](),controller[_0xf1b1('0x12')]);router[_0xf1b1('0x13')](_0xf1b1('0xa'),auth[_0xf1b1('0x8')](),controller[_0xf1b1('0x14')]);router[_0xf1b1('0x15')]('/:id',auth[_0xf1b1('0x8')](),controller[_0xf1b1('0x16')]);module[_0xf1b1('0x17')]=router;
\ No newline at end of file
+var _0x3c85=['../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','getSessions','30s','getSummary','post','create','/:id/clone','clone','/:id','delete','destroy','exports','multer','util','path','connect-timeout'];(function(_0x5d61fa,_0x5428fe){var _0x271751=function(_0xa87023){while(--_0xa87023){_0x5d61fa['push'](_0x5d61fa['shift']());}};_0x271751(++_0x5428fe);}(_0x3c85,0x1a0));var _0x53c8=function(_0xa61ced,_0x140853){_0xa61ced=_0xa61ced-0x0;var _0x1fd226=_0x3c85[_0xa61ced];return _0x1fd226;};'use strict';var multer=require(_0x53c8('0x0'));var util=require(_0x53c8('0x1'));var path=require(_0x53c8('0x2'));var timeout=require(_0x53c8('0x3'));var express=require('express');var router=express['Router']();var auth=require(_0x53c8('0x4'));var interaction=require(_0x53c8('0x5'));var config=require(_0x53c8('0x6'));var controller=require('./jscriptyProject.controller');router[_0x53c8('0x7')]('/',auth[_0x53c8('0x8')](),controller[_0x53c8('0x9')]);router['get']('/:id',auth['isAuthenticated'](),controller['show']);router[_0x53c8('0x7')]('/:id/sessions',auth['isAuthenticated'](),controller[_0x53c8('0xa')]);router[_0x53c8('0x7')]('/:id/answers',auth['isAuthenticated'](),controller['getAnswers']);router[_0x53c8('0x7')]('/:id/summary',auth['isAuthenticated'](),timeout(_0x53c8('0xb')),controller[_0x53c8('0xc')]);router[_0x53c8('0xd')]('/',auth[_0x53c8('0x8')](),controller[_0x53c8('0xe')]);router['post'](_0x53c8('0xf'),auth[_0x53c8('0x8')](),controller[_0x53c8('0x10')]);router['put'](_0x53c8('0x11'),auth[_0x53c8('0x8')](),controller['update']);router[_0x53c8('0x12')](_0x53c8('0x11'),auth[_0x53c8('0x8')](),controller[_0x53c8('0x13')]);module[_0x53c8('0x14')]=router;
\ No newline at end of file
diff --git a/server/api/jscriptyProject/jscriptyProject.attributes.js b/server/api/jscriptyProject/jscriptyProject.attributes.js
index ae83338..e866d96 100644
--- a/server/api/jscriptyProject/jscriptyProject.attributes.js
+++ b/server/api/jscriptyProject/jscriptyProject.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x3060=['isString','{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}','getDataValue','description','BOOLEAN','lodash','util','exports','name','STRING','TEXT','long','isObjectLike','setDataValue','formData','stringify'];(function(_0x5a9c0c,_0x4ec485){var _0x53c77d=function(_0x1cf384){while(--_0x1cf384){_0x5a9c0c['push'](_0x5a9c0c['shift']());}};_0x53c77d(++_0x4ec485);}(_0x3060,0x1a5));var _0x0306=function(_0xab9f3d,_0xb336fa){_0xab9f3d=_0xab9f3d-0x0;var _0x5283bf=_0x3060[_0xab9f3d];return _0x5283bf;};'use strict';var Sequelize=require('sequelize');var _=require(_0x0306('0x0'));var util=require(_0x0306('0x1'));module[_0x0306('0x2')]={'name':{'type':Sequelize['STRING'],'unique':_0x0306('0x3')},'description':{'type':Sequelize[_0x0306('0x4')]},'formData':{'type':Sequelize[_0x0306('0x5')](_0x0306('0x6')),'set':function(_0x385174){if(_[_0x0306('0x7')](_0x385174)){this[_0x0306('0x8')](_0x0306('0x9'),JSON[_0x0306('0xa')](_0x385174));}else if(_[_0x0306('0xb')](_0x385174)){this[_0x0306('0x8')]('formData',_0x385174);}else{this[_0x0306('0x8')](_0x0306('0x9'),util['format'](_0x0306('0xc'),this[_0x0306('0xd')]('name')||'',this[_0x0306('0xd')](_0x0306('0xe'))||''));}}},'enableUncompleteSave':{'type':Sequelize[_0x0306('0xf')],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}};
\ No newline at end of file
+var _0xcb9a=['isString','{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}','getDataValue','description','BOOLEAN','sequelize','lodash','long','setDataValue','formData'];(function(_0x523a03,_0x586509){var _0x12cac0=function(_0x40384e){while(--_0x40384e){_0x523a03['push'](_0x523a03['shift']());}};_0x12cac0(++_0x586509);}(_0xcb9a,0x1e5));var _0xacb9=function(_0x52b7b9,_0x43ed4b){_0x52b7b9=_0x52b7b9-0x0;var _0x5b5d30=_0xcb9a[_0x52b7b9];return _0x5b5d30;};'use strict';var Sequelize=require(_0xacb9('0x0'));var _=require(_0xacb9('0x1'));var util=require('util');module['exports']={'name':{'type':Sequelize['STRING'],'unique':'name'},'description':{'type':Sequelize['STRING']},'formData':{'type':Sequelize['TEXT'](_0xacb9('0x2')),'set':function(_0x1cd038){if(_['isObjectLike'](_0x1cd038)){this[_0xacb9('0x3')](_0xacb9('0x4'),JSON['stringify'](_0x1cd038));}else if(_[_0xacb9('0x5')](_0x1cd038)){this[_0xacb9('0x3')]('formData',_0x1cd038);}else{this[_0xacb9('0x3')](_0xacb9('0x4'),util['format'](_0xacb9('0x6'),this[_0xacb9('0x7')]('name')||'',this[_0xacb9('0x7')](_0xacb9('0x8'))||''));}}},'enableUncompleteSave':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize[_0xacb9('0x9')],'defaultValue':![]}};
\ No newline at end of file
diff --git a/server/api/jscriptyProject/jscriptyProject.controller.js b/server/api/jscriptyProject/jscriptyProject.controller.js
index 3006999..dea7dc8 100644
--- a/server/api/jscriptyProject/jscriptyProject.controller.js
+++ b/server/api/jscriptyProject/jscriptyProject.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x0918=['SessionId','answer','isEmpty','now','writeFileSync','setHeader','Content-disposition','attachment;\x20filename=','Jscripty_Project_%d_Summary_%s.csv','Content-type','download','/tmp/Jscripty_Project_%d_Summary_%s.csv','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','offset','save','update','then','destroy','Projects','UserProfileResource','error','name','send','index','map','JscriptyProject','rawAttributes','fieldName','type','model','keys','filters','intersection','query','attributes','fields','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','VIRTUAL','count','includeAll','include','findAll','rows','catch','params','length','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','updatedAt','UserProfileSection','getSessions','JscriptySessionReport','ProjectId','getAnswers','findOne','JscriptyAnswerReport','number','fromCharCode','apply','toString','indexOf','replace','starttime','parse','startTime','-createdAt','questionId','question','format'];(function(_0x38d951,_0x41db27){var _0x54d2fb=function(_0x1440d6){while(--_0x1440d6){_0x38d951['push'](_0x38d951['shift']());}};_0x54d2fb(++_0x41db27);}(_0x0918,0x1d4));var _0x8091=function(_0x53c93a,_0x27c349){_0x53c93a=_0x53c93a-0x0;var _0x2ff35e=_0x0918[_0x53c93a];return _0x2ff35e;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x8091('0x0'));var rimraf=require(_0x8091('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x8091('0x2'));var rp=require(_0x8091('0x3'));var moment=require(_0x8091('0x4'));var BPromise=require(_0x8091('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x8091('0x6'));var sox=require(_0x8091('0x7'));var csv=require(_0x8091('0x8'));var ejs=require(_0x8091('0x9'));var fs=require('fs');var _=require(_0x8091('0xa'));var squel=require(_0x8091('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x8091('0xc'));var toCsv=require('to-csv');var querystring=require(_0x8091('0xd'));var Papa=require(_0x8091('0xe'));var Redis=require(_0x8091('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x8091('0x10'));var as=require(_0x8091('0x11'));var hardwareService=require(_0x8091('0x12'));var logger=require(_0x8091('0x13'))(_0x8091('0x14'));var utils=require(_0x8091('0x15'));var config=require(_0x8091('0x16'));var db=require(_0x8091('0x17'))['db'];function respondWithStatusCode(_0x3c286a,_0x44bc03){_0x44bc03=_0x44bc03||0xcc;return function(_0x24cb7b){if(_0x24cb7b){return _0x3c286a[_0x8091('0x18')](_0x44bc03);}return _0x3c286a['status'](_0x44bc03)[_0x8091('0x19')]();};}function respondWithResult(_0x4075e6,_0x5d007f){_0x5d007f=_0x5d007f||0xc8;return function(_0x48bd30){if(_0x48bd30){return _0x4075e6[_0x8091('0x1a')](_0x5d007f)[_0x8091('0x1b')](_0x48bd30);}};}function respondWithFilteredResult(_0x5094fc,_0x250e59){return function(_0x222ec6){if(_0x222ec6){var _0x1989e=_0x222ec6['count'],_0x4b4808=_0x250e59[_0x8091('0x1c')],_0x15ab40=_0x250e59['offset']+_0x250e59['limit'],_0x74101d;if(_0x15ab40>=_0x1989e){_0x15ab40=_0x1989e;_0x74101d=0xc8;}else{_0x74101d=0xce;}_0x5094fc['status'](_0x74101d);return _0x5094fc['set']('Content-Range',_0x4b4808+'-'+_0x15ab40+'/'+_0x1989e)[_0x8091('0x1b')](_0x222ec6);}return null;};}function patchUpdates(_0x47d451){return function(_0x59bb64){try{jsonpatch['apply'](_0x59bb64,_0x47d451,!![]);}catch(_0x3eadec){return BPromise['reject'](_0x3eadec);}return _0x59bb64[_0x8091('0x1d')]();};}function saveUpdates(_0x14c366,_0x35ce90){return function(_0x5dc607){if(_0x5dc607){return _0x5dc607[_0x8091('0x1e')](_0x14c366)[_0x8091('0x1f')](function(_0x2b1536){return _0x2b1536;});}return null;};}function removeEntity(_0x3d7577,_0x5650a0){return function(_0x5a5d47){if(_0x5a5d47){return _0x5a5d47[_0x8091('0x20')]()['then'](function(){var _0x5bcad5=_0x5a5d47['get']({'plain':!![]});var _0x364d42=_0x8091('0x21');return db[_0x8091('0x22')][_0x8091('0x20')]({'where':{'type':_0x364d42,'resourceId':_0x5bcad5['id']}})['then'](function(){return _0x5a5d47;});})[_0x8091('0x1f')](function(){_0x3d7577[_0x8091('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1913b7,_0x473752){return function(_0xa5ef4f){if(!_0xa5ef4f){_0x1913b7['sendStatus'](0x194);}return _0xa5ef4f;};}function handleError(_0x4f9aef,_0x199b8b){_0x199b8b=_0x199b8b||0x1f4;return function(_0xc4e4ec){logger[_0x8091('0x23')](_0xc4e4ec['stack']);if(_0xc4e4ec[_0x8091('0x24')]){delete _0xc4e4ec[_0x8091('0x24')];}_0x4f9aef[_0x8091('0x1a')](_0x199b8b)[_0x8091('0x25')](_0xc4e4ec);};}exports[_0x8091('0x26')]=function(_0x4d65a6,_0x2a0d92){var _0x4be3f1={},_0x1ed8ba={},_0x11d2dd={'count':0x0,'rows':[]};var _0x33d5ac=_[_0x8091('0x27')](db[_0x8091('0x28')][_0x8091('0x29')],function(_0x551e0f){return{'name':_0x551e0f[_0x8091('0x2a')],'type':_0x551e0f[_0x8091('0x2b')]['key']};});_0x1ed8ba[_0x8091('0x2c')]=_[_0x8091('0x27')](_0x33d5ac,_0x8091('0x24'));_0x1ed8ba['query']=_[_0x8091('0x2d')](_0x4d65a6['query']);_0x1ed8ba[_0x8091('0x2e')]=_[_0x8091('0x2f')](_0x1ed8ba[_0x8091('0x2c')],_0x1ed8ba[_0x8091('0x30')]);_0x4be3f1[_0x8091('0x31')]=_[_0x8091('0x2f')](_0x1ed8ba[_0x8091('0x2c')],qs[_0x8091('0x32')](_0x4d65a6[_0x8091('0x30')][_0x8091('0x32')]));_0x4be3f1[_0x8091('0x31')]=_0x4be3f1[_0x8091('0x31')]['length']?_0x4be3f1[_0x8091('0x31')]:_0x1ed8ba[_0x8091('0x2c')];if(!_0x4d65a6['query'][_0x8091('0x33')](_0x8091('0x34'))){_0x4be3f1[_0x8091('0x35')]=qs[_0x8091('0x35')](_0x4d65a6['query']['limit']);_0x4be3f1[_0x8091('0x1c')]=qs[_0x8091('0x1c')](_0x4d65a6[_0x8091('0x30')]['offset']);}_0x4be3f1[_0x8091('0x36')]=qs[_0x8091('0x37')](_0x4d65a6['query'][_0x8091('0x37')]);_0x4be3f1[_0x8091('0x38')]=qs[_0x8091('0x2e')](_[_0x8091('0x39')](_0x4d65a6['query'],_0x1ed8ba[_0x8091('0x2e')]),_0x33d5ac);if(_0x4d65a6[_0x8091('0x30')][_0x8091('0x3a')]){_0x4be3f1['where']=_[_0x8091('0x3b')](_0x4be3f1[_0x8091('0x38')],{'$or':_[_0x8091('0x27')](_0x33d5ac,function(_0x59f0f0){if(_0x59f0f0[_0x8091('0x2b')]!==_0x8091('0x3c')){var _0x21a2c7={};_0x21a2c7[_0x59f0f0[_0x8091('0x24')]]={'$like':'%'+_0x4d65a6[_0x8091('0x30')][_0x8091('0x3a')]+'%'};return _0x21a2c7;}})});}_0x4be3f1=_['merge']({},_0x4be3f1,_0x4d65a6['options']);var _0x327c06={'where':_0x4be3f1[_0x8091('0x38')]};return db[_0x8091('0x28')][_0x8091('0x3d')](_0x327c06)[_0x8091('0x1f')](function(_0x2e0df8){_0x11d2dd[_0x8091('0x3d')]=_0x2e0df8;if(_0x4d65a6[_0x8091('0x30')][_0x8091('0x3e')]){_0x4be3f1[_0x8091('0x3f')]=[{'all':!![]}];}return db[_0x8091('0x28')][_0x8091('0x40')](_0x4be3f1);})[_0x8091('0x1f')](function(_0x1434f1){_0x11d2dd[_0x8091('0x41')]=_0x1434f1;return _0x11d2dd;})[_0x8091('0x1f')](respondWithFilteredResult(_0x2a0d92,_0x4be3f1))[_0x8091('0x42')](handleError(_0x2a0d92,null));};exports['show']=function(_0xa1039a,_0x6e2795){var _0x5415e4={'raw':![],'where':{'id':_0xa1039a[_0x8091('0x43')]['id']}},_0x4a144c={};_0x4a144c[_0x8091('0x2c')]=_[_0x8091('0x2d')](db[_0x8091('0x28')]['rawAttributes']);_0x4a144c[_0x8091('0x30')]=_[_0x8091('0x2d')](_0xa1039a['query']);_0x4a144c['filters']=_[_0x8091('0x2f')](_0x4a144c[_0x8091('0x2c')],_0x4a144c[_0x8091('0x30')]);_0x5415e4['attributes']=_[_0x8091('0x2f')](_0x4a144c[_0x8091('0x2c')],qs['fields'](_0xa1039a['query'][_0x8091('0x32')]));_0x5415e4[_0x8091('0x31')]=_0x5415e4[_0x8091('0x31')][_0x8091('0x44')]?_0x5415e4[_0x8091('0x31')]:_0x4a144c[_0x8091('0x2c')];if(_0xa1039a[_0x8091('0x30')]['includeAll']){_0x5415e4[_0x8091('0x3f')]=[{'all':!![]}];}_0x5415e4=_[_0x8091('0x3b')]({},_0x5415e4,_0xa1039a[_0x8091('0x45')]);return db['JscriptyProject'][_0x8091('0x46')](_0x5415e4)['then'](handleEntityNotFound(_0x6e2795,null))[_0x8091('0x1f')](respondWithResult(_0x6e2795,null))['catch'](handleError(_0x6e2795,null));};exports[_0x8091('0x47')]=function(_0x71fbea,_0x4810e7){return db[_0x8091('0x28')][_0x8091('0x47')](_0x71fbea[_0x8091('0x48')],{})[_0x8091('0x1f')](function(_0x23716f){var _0x6b2026=_0x71fbea[_0x8091('0x49')]['get']({'plain':!![]});if(!_0x6b2026)throw new Error(_0x8091('0x4a'));if(_0x6b2026[_0x8091('0x4b')]==='user'){var _0x530fbd=_0x23716f[_0x8091('0x4c')]({'plain':!![]});var _0x59398f=_0x8091('0x21');return db['UserProfileSection'][_0x8091('0x46')]({'where':{'name':_0x59398f,'userProfileId':_0x6b2026['userProfileId']},'raw':!![]})['then'](function(_0x11366e){if(_0x11366e&&_0x11366e[_0x8091('0x4d')]===0x0){return db['UserProfileResource']['create']({'name':_0x530fbd[_0x8091('0x24')],'resourceId':_0x530fbd['id'],'type':_0x11366e[_0x8091('0x24')],'sectionId':_0x11366e['id']},{})['then'](function(){return _0x23716f;});}else{return _0x23716f;}})['catch'](function(_0x4ebea5){logger[_0x8091('0x23')](_0x8091('0x4e'),_0x4ebea5);throw _0x4ebea5;});}return _0x23716f;})[_0x8091('0x1f')](respondWithResult(_0x4810e7,0xc9))[_0x8091('0x42')](handleError(_0x4810e7,null));};exports[_0x8091('0x4f')]=function(_0x4f8135,_0x49468b){var _0x3a51c8={'where':{'id':_0x4f8135[_0x8091('0x43')]['id']}},_0x48f0fe={};_0x48f0fe[_0x8091('0x2c')]=_[_0x8091('0x2d')](db[_0x8091('0x28')][_0x8091('0x29')]);_0x3a51c8[_0x8091('0x31')]=_[_0x8091('0x2f')](_0x48f0fe['model'],qs['fields'](_0x4f8135[_0x8091('0x30')][_0x8091('0x32')]));_0x3a51c8[_0x8091('0x31')]=_0x3a51c8['attributes'][_0x8091('0x44')]?_0x3a51c8[_0x8091('0x31')]:_0x48f0fe['model'];if(_0x4f8135[_0x8091('0x30')][_0x8091('0x3e')]){_0x3a51c8[_0x8091('0x3f')]=[{'all':!![]}];}_0x3a51c8=_[_0x8091('0x3b')]({},_0x3a51c8,_0x4f8135[_0x8091('0x45')]);return db['JscriptyProject'][_0x8091('0x46')](_0x3a51c8)['then'](handleEntityNotFound(_0x49468b,null))[_0x8091('0x1f')](function(_0x2af4e5){if(_0x2af4e5){var _0xf4026a=_0x2af4e5[_0x8091('0x4c')]({'plain':!![]});_0xf4026a=qs[_0x8091('0x50')](_0xf4026a,['id','createdAt',_0x8091('0x51')]);_0x4f8135[_0x8091('0x48')]=_[_0x8091('0x50')](_0x4f8135[_0x8091('0x48')],['id','createdAt',_0x8091('0x51')]);return db[_0x8091('0x28')][_0x8091('0x47')](_['merge'](_0xf4026a,_0x4f8135[_0x8091('0x48')]),{'include':_0x4f8135['query'][_0x8091('0x3e')]?[{'all':!![]}]:undefined})[_0x8091('0x1f')](function(_0x43f301){var _0x4f5b9c=_0x4f8135['user']['get']({'plain':!![]});if(!_0x4f5b9c)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4f5b9c[_0x8091('0x4b')]===_0x8091('0x49')){var _0xccef4e=_0x43f301[_0x8091('0x4c')]({'plain':!![]});var _0x2b2377='Projects';return db[_0x8091('0x52')]['find']({'where':{'name':_0x2b2377,'userProfileId':_0x4f5b9c['userProfileId']},'raw':!![]})[_0x8091('0x1f')](function(_0x190ae5){if(_0x190ae5&&_0x190ae5[_0x8091('0x4d')]===0x0){return db[_0x8091('0x22')][_0x8091('0x47')]({'name':_0xccef4e['name'],'resourceId':_0xccef4e['id'],'type':_0x190ae5[_0x8091('0x24')],'sectionId':_0x190ae5['id']},{})[_0x8091('0x1f')](function(){return _0x43f301;});}else{return _0x43f301;}})[_0x8091('0x42')](function(_0x245b91){logger['error'](_0x8091('0x4e'),_0x245b91);throw _0x245b91;});}return _0x43f301;});}})[_0x8091('0x1f')](respondWithResult(_0x49468b,0xc9))[_0x8091('0x42')](handleError(_0x49468b,null));};exports[_0x8091('0x1e')]=function(_0x569f89,_0x422806){if(_0x569f89['body']['id']){delete _0x569f89[_0x8091('0x48')]['id'];}return db['JscriptyProject'][_0x8091('0x46')]({'where':{'id':_0x569f89[_0x8091('0x43')]['id']}})[_0x8091('0x1f')](handleEntityNotFound(_0x422806,null))[_0x8091('0x1f')](saveUpdates(_0x569f89[_0x8091('0x48')],null))[_0x8091('0x1f')](respondWithResult(_0x422806,null))['catch'](handleError(_0x422806,null));};exports[_0x8091('0x20')]=function(_0xf34c8,_0x398961){return db[_0x8091('0x28')]['find']({'where':{'id':_0xf34c8[_0x8091('0x43')]['id']}})[_0x8091('0x1f')](handleEntityNotFound(_0x398961,null))[_0x8091('0x1f')](removeEntity(_0x398961,null))[_0x8091('0x42')](handleError(_0x398961,null));};exports[_0x8091('0x53')]=function(_0x31b620,_0x4d06c7,_0xbe3d74){var _0x2077d2={'raw':!![],'where':{}};var _0x57f700={};var _0x133ae={'count':0x0,'rows':[]};return db['JscriptyProject']['findOne']({'where':{'id':_0x31b620[_0x8091('0x43')]['id']}})[_0x8091('0x1f')](handleEntityNotFound(_0x4d06c7,null))['then'](function(_0x297be6){if(_0x297be6){_0x57f700['model']=_['keys'](db[_0x8091('0x54')][_0x8091('0x29')]);_0x57f700['query']=_[_0x8091('0x2d')](_0x31b620['query']);_0x57f700['filters']=_['intersection'](_0x57f700['model'],_0x57f700[_0x8091('0x30')]);_0x2077d2[_0x8091('0x31')]=_[_0x8091('0x2f')](_0x57f700['model'],qs[_0x8091('0x32')](_0x31b620[_0x8091('0x30')][_0x8091('0x32')]));_0x2077d2[_0x8091('0x31')]=_0x2077d2[_0x8091('0x31')][_0x8091('0x44')]?_0x2077d2[_0x8091('0x31')]:_0x57f700[_0x8091('0x2c')];if(!_0x31b620['query'][_0x8091('0x33')](_0x8091('0x34'))){_0x2077d2[_0x8091('0x35')]=qs[_0x8091('0x35')](_0x31b620[_0x8091('0x30')][_0x8091('0x35')]);_0x2077d2[_0x8091('0x1c')]=qs[_0x8091('0x1c')](_0x31b620[_0x8091('0x30')]['offset']);}_0x2077d2[_0x8091('0x36')]=qs[_0x8091('0x37')](_0x31b620[_0x8091('0x30')][_0x8091('0x37')]);_0x2077d2['where']=qs['filters'](_[_0x8091('0x39')](_0x31b620[_0x8091('0x30')],_0x57f700[_0x8091('0x2e')]));_0x2077d2['where'][_0x8091('0x55')]=_0x297be6['id'];if(_0x31b620[_0x8091('0x30')]['filter']){_0x2077d2[_0x8091('0x38')]=_['merge'](_0x2077d2[_0x8091('0x38')],{'$or':_[_0x8091('0x27')](_0x2077d2[_0x8091('0x31')],function(_0x1ad697){var _0x298cd7={};_0x298cd7[_0x1ad697]={'$like':'%'+_0x31b620['query']['filter']+'%'};return _0x298cd7;})});}_0x2077d2=_['merge']({},_0x2077d2,_0x31b620[_0x8091('0x45')]);return db[_0x8091('0x54')][_0x8091('0x3d')]({'where':_0x2077d2['where']})[_0x8091('0x1f')](function(_0x3a0e10){_0x133ae[_0x8091('0x3d')]=_0x3a0e10;if(_0x31b620[_0x8091('0x30')][_0x8091('0x3e')]){_0x2077d2[_0x8091('0x3f')]=[{'all':!![]}];}return db[_0x8091('0x54')][_0x8091('0x40')](_0x2077d2);})[_0x8091('0x1f')](function(_0x3ce277){_0x133ae[_0x8091('0x41')]=_0x3ce277;return _0x133ae;});}})[_0x8091('0x1f')](respondWithFilteredResult(_0x4d06c7,_0x2077d2))[_0x8091('0x42')](handleError(_0x4d06c7,null));};exports[_0x8091('0x56')]=function(_0x52b5be,_0x3ee816,_0xf77996){var _0x395d08={'raw':!![],'where':{}};var _0xb2218a={};var _0x267248={'count':0x0,'rows':[]};return db[_0x8091('0x28')][_0x8091('0x57')]({'where':{'id':_0x52b5be['params']['id']}})[_0x8091('0x1f')](handleEntityNotFound(_0x3ee816,null))[_0x8091('0x1f')](function(_0x4f40a7){if(_0x4f40a7){_0xb2218a['model']=_[_0x8091('0x2d')](db[_0x8091('0x58')][_0x8091('0x29')]);_0xb2218a[_0x8091('0x30')]=_['keys'](_0x52b5be['query']);_0xb2218a[_0x8091('0x2e')]=_[_0x8091('0x2f')](_0xb2218a[_0x8091('0x2c')],_0xb2218a[_0x8091('0x30')]);_0x395d08[_0x8091('0x31')]=_[_0x8091('0x2f')](_0xb2218a[_0x8091('0x2c')],qs[_0x8091('0x32')](_0x52b5be[_0x8091('0x30')][_0x8091('0x32')]));_0x395d08[_0x8091('0x31')]=_0x395d08[_0x8091('0x31')]['length']?_0x395d08[_0x8091('0x31')]:_0xb2218a['model'];if(!_0x52b5be[_0x8091('0x30')][_0x8091('0x33')]('nolimit')){_0x395d08['limit']=qs[_0x8091('0x35')](_0x52b5be[_0x8091('0x30')][_0x8091('0x35')]);_0x395d08[_0x8091('0x1c')]=qs[_0x8091('0x1c')](_0x52b5be[_0x8091('0x30')][_0x8091('0x1c')]);}_0x395d08[_0x8091('0x36')]=qs[_0x8091('0x37')](_0x52b5be['query'][_0x8091('0x37')]);_0x395d08[_0x8091('0x38')]=qs[_0x8091('0x2e')](_[_0x8091('0x39')](_0x52b5be['query'],_0xb2218a[_0x8091('0x2e')]));_0x395d08['where'][_0x8091('0x55')]=_0x4f40a7['id'];if(_0x52b5be[_0x8091('0x30')][_0x8091('0x3a')]){_0x395d08[_0x8091('0x38')]=_[_0x8091('0x3b')](_0x395d08[_0x8091('0x38')],{'$or':_['map'](_0x395d08[_0x8091('0x31')],function(_0x161df4){var _0x22fbf4={};_0x22fbf4[_0x161df4]={'$like':'%'+_0x52b5be[_0x8091('0x30')][_0x8091('0x3a')]+'%'};return _0x22fbf4;})});}_0x395d08=_['merge']({},_0x395d08,_0x52b5be[_0x8091('0x45')]);return db[_0x8091('0x58')]['count']({'where':_0x395d08[_0x8091('0x38')]})[_0x8091('0x1f')](function(_0x4dce36){_0x267248[_0x8091('0x3d')]=_0x4dce36;if(_0x52b5be[_0x8091('0x30')][_0x8091('0x3e')]){_0x395d08[_0x8091('0x3f')]=[{'all':!![]}];}return db[_0x8091('0x58')][_0x8091('0x40')](_0x395d08);})['then'](function(_0x30b8a7){_0x267248[_0x8091('0x41')]=_0x30b8a7;return _0x267248;});}})['then'](respondWithFilteredResult(_0x3ee816,_0x395d08))[_0x8091('0x42')](handleError(_0x3ee816,null));};function char(_0x3b5d2e){return _0x8091('0x59')===typeof _0x3b5d2e?String[_0x8091('0x5a')][_0x8091('0x5b')](null,arguments):_0x3b5d2e;}function needsEncapsulation(_0x496271){return!!_0x496271&&(_0x496271[_0x8091('0x5c')]()[_0x8091('0x5d')](char(0xd))>=0x0||_0x496271['toString']()[_0x8091('0x5d')](char(0xa))>=0x0||_0x496271[_0x8091('0x5c')]()[_0x8091('0x5d')](char(0x2c))>=0x0||_0x496271[_0x8091('0x5c')]()[_0x8091('0x5d')](char(0x22))>=0x0);}function encapsulate(_0x392094){var _0x29a779=char(0x22),_0x162204='\x5c'+char(0x22),_0x433d74=_0x392094['toString']()[_0x8091('0x5e')](new RegExp(_0x29a779,'g'),_0x162204);return _0x29a779+_0x433d74+_0x29a779;}exports['getSummary']=function(_0x15405c,_0x31b1a8,_0x15f3f5){var _0x2ee866,_0x422434;var _0x574d93={'where':{'ProjectId':_0x15405c[_0x8091('0x43')]['id']}};if(_0x15405c[_0x8091('0x30')]['startTime']){_0x574d93[_0x8091('0x38')][_0x8091('0x5f')]=JSON[_0x8091('0x60')](_0x15405c[_0x8091('0x30')][_0x8091('0x61')]);}return db['JscriptySessionReport']['findAll'](_0x574d93)['then'](handleEntityNotFound(_0x31b1a8,null))['then'](function(_0x333ca4){if(_0x333ca4){_0x2ee866=_0x333ca4;return db['JscriptyQuestionReport'][_0x8091('0x40')]({'where':{'SessionId':{'$in':_[_0x8091('0x27')](_0x2ee866,'id')},'ProjectId':_0x15405c[_0x8091('0x43')]['id']},'order':_0x8091('0x62')});}})[_0x8091('0x1f')](handleEntityNotFound(_0x31b1a8,null))['then'](function(_0x1876d){if(_0x1876d){_0x422434=_0x1876d;var _0x1acf5b={};for(var _0x2477f8=0x0,_0x2484e5=_0x422434['length'];_0x2477f8<_0x2484e5;_0x2477f8++){if(!_0x1acf5b[_0x8091('0x33')](_0x422434[_0x2477f8][_0x8091('0x63')])){_0x1acf5b[_0x422434[_0x2477f8][_0x8091('0x63')]]=needsEncapsulation(_0x422434[_0x2477f8]['question'])?encapsulate(_0x422434[_0x2477f8][_0x8091('0x64')]):_0x422434[_0x2477f8]['question'];}}var _0x5efc52=[],_0x4d6e4c={};for(var _0x1e74c2=0x0,_0x5a0578=_0x2ee866[_0x8091('0x44')];_0x1e74c2<_0x5a0578;_0x1e74c2++){_0x4d6e4c={'ProjectId':_0x15405c[_0x8091('0x43')]['id'],'SessionId':_0x2ee866[_0x1e74c2]['id'],'StartTime':moment(_0x2ee866[_0x1e74c2]['starttime'])[_0x8091('0x65')]('YYYY-MM-DD\x20HH:mm:ss')};for(var _0x13659f=0x0,_0x3c74fb=_0x422434[_0x8091('0x44')];_0x13659f<_0x3c74fb;_0x13659f++){if(_0x422434[_0x13659f][_0x8091('0x66')]==_0x2ee866[_0x1e74c2]['id']&&_0x1acf5b[_0x8091('0x33')](_0x422434[_0x13659f]['questionId'])){_0x4d6e4c[_0x1acf5b[_0x422434[_0x13659f][_0x8091('0x63')]]]=_0x422434[_0x13659f][_0x8091('0x67')];}}for(var _0x3a4714 in _0x1acf5b){if(!_0x4d6e4c[_0x8091('0x33')](_0x1acf5b[_0x3a4714])){_0x4d6e4c[_0x1acf5b[_0x3a4714]]=null;}}_0x5efc52['push'](_0x4d6e4c);}return _0x5efc52;}})[_0x8091('0x1f')](function(_0x10f7ef){if(!_[_0x8091('0x68')](_0x10f7ef)){var _0x4aa564=toCsv(_0x10f7ef);var _0x4e9c30=Date[_0x8091('0x69')]();fs[_0x8091('0x6a')](util['format']('/tmp/Jscripty_Project_%d_Summary_%s.csv',_0x15405c[_0x8091('0x43')]['id'],_0x4e9c30),_0x4aa564);_0x31b1a8[_0x8091('0x6b')](_0x8091('0x6c'),_0x8091('0x6d')+util[_0x8091('0x65')](_0x8091('0x6e'),_0x15405c[_0x8091('0x43')]['id'],_0x4e9c30));_0x31b1a8[_0x8091('0x6b')](_0x8091('0x6f'),'text/csv');return _0x31b1a8[_0x8091('0x70')](util['format'](_0x8091('0x71'),_0x15405c[_0x8091('0x43')]['id'],_0x4e9c30));}else{return _0x31b1a8[_0x8091('0x18')](0xcc);}})['catch'](handleError(_0x31b1a8,null));};
\ No newline at end of file
+var _0xc80d=['-createdAt','questionId','question','format','YYYY-MM-DD\x20HH:mm:ss','SessionId','answer','push','isEmpty','now','/tmp/Jscripty_Project_%d_Summary_%s.csv','setHeader','Content-disposition','attachment;\x20filename=','Jscripty_Project_%d_Summary_%s.csv','Content-type','text/csv','download','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','ejs','lodash','squel','crypto','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','count','offset','limit','set','reject','save','update','then','destroy','get','Projects','UserProfileResource','error','stack','name','index','map','JscriptyProject','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','includeAll','findAll','catch','show','params','rawAttributes','include','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','omit','createdAt','updatedAt','role','getSessions','findOne','rows','pick','ProjectId','JscriptyAnswerReport','apply','toString','indexOf','replace','getSummary','starttime','startTime','JscriptySessionReport','JscriptyQuestionReport'];(function(_0x6131cd,_0x4c26a1){var _0x47e916=function(_0x1f2bce){while(--_0x1f2bce){_0x6131cd['push'](_0x6131cd['shift']());}};_0x47e916(++_0x4c26a1);}(_0xc80d,0x174));var _0xdc80=function(_0x344b32,_0x231ace){_0x344b32=_0x344b32-0x0;var _0x515d5f=_0xc80d[_0x344b32];return _0x515d5f;};'use strict';var pdf=require(_0xdc80('0x0'));var emlformat=require(_0xdc80('0x1'));var rimraf=require(_0xdc80('0x2'));var zipdir=require(_0xdc80('0x3'));var jsonpatch=require(_0xdc80('0x4'));var rp=require(_0xdc80('0x5'));var moment=require(_0xdc80('0x6'));var BPromise=require(_0xdc80('0x7'));var Mustache=require('mustache');var util=require(_0xdc80('0x8'));var path=require(_0xdc80('0x9'));var sox=require(_0xdc80('0xa'));var csv=require('to-csv');var ejs=require(_0xdc80('0xb'));var fs=require('fs');var _=require(_0xdc80('0xc'));var squel=require(_0xdc80('0xd'));var crypto=require(_0xdc80('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xdc80('0xf'));var querystring=require('querystring');var Papa=require(_0xdc80('0x10'));var Redis=require(_0xdc80('0x11'));var authService=require(_0xdc80('0x12'));var qs=require(_0xdc80('0x13'));var as=require(_0xdc80('0x14'));var hardwareService=require(_0xdc80('0x15'));var logger=require(_0xdc80('0x16'))(_0xdc80('0x17'));var utils=require(_0xdc80('0x18'));var config=require('../../config/environment');var db=require(_0xdc80('0x19'))['db'];function respondWithStatusCode(_0x1e6aae,_0x713db5){_0x713db5=_0x713db5||0xcc;return function(_0x1898a7){if(_0x1898a7){return _0x1e6aae[_0xdc80('0x1a')](_0x713db5);}return _0x1e6aae[_0xdc80('0x1b')](_0x713db5)[_0xdc80('0x1c')]();};}function respondWithResult(_0x8447b,_0x12b2ce){_0x12b2ce=_0x12b2ce||0xc8;return function(_0xee850e){if(_0xee850e){return _0x8447b[_0xdc80('0x1b')](_0x12b2ce)['json'](_0xee850e);}};}function respondWithFilteredResult(_0x3953e3,_0x303893){return function(_0x257a39){if(_0x257a39){var _0x4eb79c=_0x257a39[_0xdc80('0x1d')],_0x58f2a1=_0x303893['offset'],_0x3e9d28=_0x303893[_0xdc80('0x1e')]+_0x303893[_0xdc80('0x1f')],_0x65c560;if(_0x3e9d28>=_0x4eb79c){_0x3e9d28=_0x4eb79c;_0x65c560=0xc8;}else{_0x65c560=0xce;}_0x3953e3[_0xdc80('0x1b')](_0x65c560);return _0x3953e3[_0xdc80('0x20')]('Content-Range',_0x58f2a1+'-'+_0x3e9d28+'/'+_0x4eb79c)['json'](_0x257a39);}return null;};}function patchUpdates(_0x16d693){return function(_0xdd8610){try{jsonpatch['apply'](_0xdd8610,_0x16d693,!![]);}catch(_0x5ae764){return BPromise[_0xdc80('0x21')](_0x5ae764);}return _0xdd8610[_0xdc80('0x22')]();};}function saveUpdates(_0x318720,_0x27482f){return function(_0x42f1d2){if(_0x42f1d2){return _0x42f1d2[_0xdc80('0x23')](_0x318720)[_0xdc80('0x24')](function(_0x2ba900){return _0x2ba900;});}return null;};}function removeEntity(_0x44ed81,_0x1bb6cd){return function(_0x5e84fc){if(_0x5e84fc){return _0x5e84fc[_0xdc80('0x25')]()[_0xdc80('0x24')](function(){var _0x12e897=_0x5e84fc[_0xdc80('0x26')]({'plain':!![]});var _0x3bb6b3=_0xdc80('0x27');return db[_0xdc80('0x28')][_0xdc80('0x25')]({'where':{'type':_0x3bb6b3,'resourceId':_0x12e897['id']}})['then'](function(){return _0x5e84fc;});})[_0xdc80('0x24')](function(){_0x44ed81['status'](0xcc)[_0xdc80('0x1c')]();});}};}function handleEntityNotFound(_0x14acb2,_0x201c79){return function(_0x2f3d9d){if(!_0x2f3d9d){_0x14acb2['sendStatus'](0x194);}return _0x2f3d9d;};}function handleError(_0x9a7459,_0x14af7a){_0x14af7a=_0x14af7a||0x1f4;return function(_0x3b687b){logger[_0xdc80('0x29')](_0x3b687b[_0xdc80('0x2a')]);if(_0x3b687b['name']){delete _0x3b687b[_0xdc80('0x2b')];}_0x9a7459[_0xdc80('0x1b')](_0x14af7a)['send'](_0x3b687b);};}exports[_0xdc80('0x2c')]=function(_0x149da1,_0x27614f){var _0x36c8a8={},_0x246839={},_0x2f5e5c={'count':0x0,'rows':[]};var _0x2503bb=_[_0xdc80('0x2d')](db[_0xdc80('0x2e')]['rawAttributes'],function(_0x473c43){return{'name':_0x473c43['fieldName'],'type':_0x473c43[_0xdc80('0x2f')][_0xdc80('0x30')]};});_0x246839[_0xdc80('0x31')]=_[_0xdc80('0x2d')](_0x2503bb,_0xdc80('0x2b'));_0x246839[_0xdc80('0x32')]=_[_0xdc80('0x33')](_0x149da1[_0xdc80('0x32')]);_0x246839['filters']=_[_0xdc80('0x34')](_0x246839['model'],_0x246839[_0xdc80('0x32')]);_0x36c8a8[_0xdc80('0x35')]=_[_0xdc80('0x34')](_0x246839[_0xdc80('0x31')],qs['fields'](_0x149da1[_0xdc80('0x32')][_0xdc80('0x36')]));_0x36c8a8['attributes']=_0x36c8a8['attributes'][_0xdc80('0x37')]?_0x36c8a8[_0xdc80('0x35')]:_0x246839[_0xdc80('0x31')];if(!_0x149da1[_0xdc80('0x32')][_0xdc80('0x38')](_0xdc80('0x39'))){_0x36c8a8[_0xdc80('0x1f')]=qs[_0xdc80('0x1f')](_0x149da1[_0xdc80('0x32')][_0xdc80('0x1f')]);_0x36c8a8[_0xdc80('0x1e')]=qs[_0xdc80('0x1e')](_0x149da1[_0xdc80('0x32')]['offset']);}_0x36c8a8[_0xdc80('0x3a')]=qs['sort'](_0x149da1[_0xdc80('0x32')][_0xdc80('0x3b')]);_0x36c8a8[_0xdc80('0x3c')]=qs[_0xdc80('0x3d')](_['pick'](_0x149da1[_0xdc80('0x32')],_0x246839[_0xdc80('0x3d')]),_0x2503bb);if(_0x149da1[_0xdc80('0x32')][_0xdc80('0x3e')]){_0x36c8a8[_0xdc80('0x3c')]=_[_0xdc80('0x3f')](_0x36c8a8[_0xdc80('0x3c')],{'$or':_[_0xdc80('0x2d')](_0x2503bb,function(_0x4c011c){if(_0x4c011c[_0xdc80('0x2f')]!=='VIRTUAL'){var _0x5a2741={};_0x5a2741[_0x4c011c[_0xdc80('0x2b')]]={'$like':'%'+_0x149da1[_0xdc80('0x32')][_0xdc80('0x3e')]+'%'};return _0x5a2741;}})});}_0x36c8a8=_[_0xdc80('0x3f')]({},_0x36c8a8,_0x149da1['options']);var _0x117616={'where':_0x36c8a8[_0xdc80('0x3c')]};return db[_0xdc80('0x2e')]['count'](_0x117616)[_0xdc80('0x24')](function(_0xfcdf85){_0x2f5e5c[_0xdc80('0x1d')]=_0xfcdf85;if(_0x149da1[_0xdc80('0x32')][_0xdc80('0x40')]){_0x36c8a8['include']=[{'all':!![]}];}return db[_0xdc80('0x2e')][_0xdc80('0x41')](_0x36c8a8);})[_0xdc80('0x24')](function(_0x45e8d7){_0x2f5e5c['rows']=_0x45e8d7;return _0x2f5e5c;})[_0xdc80('0x24')](respondWithFilteredResult(_0x27614f,_0x36c8a8))[_0xdc80('0x42')](handleError(_0x27614f,null));};exports[_0xdc80('0x43')]=function(_0x561d83,_0x27d790){var _0x45d3ca={'raw':![],'where':{'id':_0x561d83[_0xdc80('0x44')]['id']}},_0x388e58={};_0x388e58[_0xdc80('0x31')]=_[_0xdc80('0x33')](db['JscriptyProject'][_0xdc80('0x45')]);_0x388e58[_0xdc80('0x32')]=_[_0xdc80('0x33')](_0x561d83[_0xdc80('0x32')]);_0x388e58[_0xdc80('0x3d')]=_['intersection'](_0x388e58[_0xdc80('0x31')],_0x388e58[_0xdc80('0x32')]);_0x45d3ca[_0xdc80('0x35')]=_['intersection'](_0x388e58['model'],qs[_0xdc80('0x36')](_0x561d83[_0xdc80('0x32')][_0xdc80('0x36')]));_0x45d3ca[_0xdc80('0x35')]=_0x45d3ca[_0xdc80('0x35')][_0xdc80('0x37')]?_0x45d3ca['attributes']:_0x388e58['model'];if(_0x561d83['query'][_0xdc80('0x40')]){_0x45d3ca[_0xdc80('0x46')]=[{'all':!![]}];}_0x45d3ca=_['merge']({},_0x45d3ca,_0x561d83[_0xdc80('0x47')]);return db[_0xdc80('0x2e')][_0xdc80('0x48')](_0x45d3ca)['then'](handleEntityNotFound(_0x27d790,null))[_0xdc80('0x24')](respondWithResult(_0x27d790,null))['catch'](handleError(_0x27d790,null));};exports[_0xdc80('0x49')]=function(_0x5c8f83,_0x45bc3e){return db[_0xdc80('0x2e')][_0xdc80('0x49')](_0x5c8f83[_0xdc80('0x4a')],{})[_0xdc80('0x24')](function(_0xf43510){var _0x4f71be=_0x5c8f83[_0xdc80('0x4b')][_0xdc80('0x26')]({'plain':!![]});if(!_0x4f71be)throw new Error(_0xdc80('0x4c'));if(_0x4f71be['role']===_0xdc80('0x4b')){var _0x1b0b51=_0xf43510[_0xdc80('0x26')]({'plain':!![]});var _0x495148='Projects';return db[_0xdc80('0x4d')][_0xdc80('0x48')]({'where':{'name':_0x495148,'userProfileId':_0x4f71be[_0xdc80('0x4e')]},'raw':!![]})[_0xdc80('0x24')](function(_0x8b761f){if(_0x8b761f&&_0x8b761f[_0xdc80('0x4f')]===0x0){return db[_0xdc80('0x28')][_0xdc80('0x49')]({'name':_0x1b0b51['name'],'resourceId':_0x1b0b51['id'],'type':_0x8b761f['name'],'sectionId':_0x8b761f['id']},{})['then'](function(){return _0xf43510;});}else{return _0xf43510;}})[_0xdc80('0x42')](function(_0x268c5f){logger[_0xdc80('0x29')](_0xdc80('0x50'),_0x268c5f);throw _0x268c5f;});}return _0xf43510;})['then'](respondWithResult(_0x45bc3e,0xc9))['catch'](handleError(_0x45bc3e,null));};exports['clone']=function(_0x116b41,_0x4ed8e3){var _0x335b8e={'where':{'id':_0x116b41[_0xdc80('0x44')]['id']}},_0x3eac1a={};_0x3eac1a[_0xdc80('0x31')]=_['keys'](db[_0xdc80('0x2e')][_0xdc80('0x45')]);_0x335b8e[_0xdc80('0x35')]=_[_0xdc80('0x34')](_0x3eac1a[_0xdc80('0x31')],qs['fields'](_0x116b41[_0xdc80('0x32')][_0xdc80('0x36')]));_0x335b8e[_0xdc80('0x35')]=_0x335b8e['attributes'][_0xdc80('0x37')]?_0x335b8e[_0xdc80('0x35')]:_0x3eac1a[_0xdc80('0x31')];if(_0x116b41[_0xdc80('0x32')][_0xdc80('0x40')]){_0x335b8e[_0xdc80('0x46')]=[{'all':!![]}];}_0x335b8e=_[_0xdc80('0x3f')]({},_0x335b8e,_0x116b41[_0xdc80('0x47')]);return db[_0xdc80('0x2e')][_0xdc80('0x48')](_0x335b8e)[_0xdc80('0x24')](handleEntityNotFound(_0x4ed8e3,null))['then'](function(_0x525b98){if(_0x525b98){var _0xd05453=_0x525b98[_0xdc80('0x26')]({'plain':!![]});_0xd05453=qs[_0xdc80('0x51')](_0xd05453,['id',_0xdc80('0x52'),_0xdc80('0x53')]);_0x116b41['body']=_[_0xdc80('0x51')](_0x116b41[_0xdc80('0x4a')],['id',_0xdc80('0x52'),_0xdc80('0x53')]);return db['JscriptyProject'][_0xdc80('0x49')](_['merge'](_0xd05453,_0x116b41[_0xdc80('0x4a')]),{'include':_0x116b41[_0xdc80('0x32')][_0xdc80('0x40')]?[{'all':!![]}]:undefined})['then'](function(_0x593709){var _0x2e99c3=_0x116b41[_0xdc80('0x4b')][_0xdc80('0x26')]({'plain':!![]});if(!_0x2e99c3)throw new Error(_0xdc80('0x4c'));if(_0x2e99c3[_0xdc80('0x54')]===_0xdc80('0x4b')){var _0x295e9d=_0x593709[_0xdc80('0x26')]({'plain':!![]});var _0x5ea49f=_0xdc80('0x27');return db[_0xdc80('0x4d')]['find']({'where':{'name':_0x5ea49f,'userProfileId':_0x2e99c3[_0xdc80('0x4e')]},'raw':!![]})['then'](function(_0x1bf966){if(_0x1bf966&&_0x1bf966[_0xdc80('0x4f')]===0x0){return db[_0xdc80('0x28')][_0xdc80('0x49')]({'name':_0x295e9d[_0xdc80('0x2b')],'resourceId':_0x295e9d['id'],'type':_0x1bf966['name'],'sectionId':_0x1bf966['id']},{})[_0xdc80('0x24')](function(){return _0x593709;});}else{return _0x593709;}})['catch'](function(_0x5d5d01){logger[_0xdc80('0x29')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5d5d01);throw _0x5d5d01;});}return _0x593709;});}})[_0xdc80('0x24')](respondWithResult(_0x4ed8e3,0xc9))['catch'](handleError(_0x4ed8e3,null));};exports[_0xdc80('0x23')]=function(_0x3a82a1,_0x3db105){if(_0x3a82a1['body']['id']){delete _0x3a82a1[_0xdc80('0x4a')]['id'];}return db[_0xdc80('0x2e')][_0xdc80('0x48')]({'where':{'id':_0x3a82a1['params']['id']}})[_0xdc80('0x24')](handleEntityNotFound(_0x3db105,null))[_0xdc80('0x24')](saveUpdates(_0x3a82a1[_0xdc80('0x4a')],null))['then'](respondWithResult(_0x3db105,null))[_0xdc80('0x42')](handleError(_0x3db105,null));};exports[_0xdc80('0x25')]=function(_0x11315e,_0x595d4e){return db['JscriptyProject'][_0xdc80('0x48')]({'where':{'id':_0x11315e[_0xdc80('0x44')]['id']}})[_0xdc80('0x24')](handleEntityNotFound(_0x595d4e,null))['then'](removeEntity(_0x595d4e,null))[_0xdc80('0x42')](handleError(_0x595d4e,null));};exports[_0xdc80('0x55')]=function(_0x2566c2,_0x4d4236,_0x5ab4ca){var _0x22c976={'raw':!![],'where':{}};var _0x3d1707={};var _0x5ef32a={'count':0x0,'rows':[]};return db[_0xdc80('0x2e')][_0xdc80('0x56')]({'where':{'id':_0x2566c2[_0xdc80('0x44')]['id']}})[_0xdc80('0x24')](handleEntityNotFound(_0x4d4236,null))[_0xdc80('0x24')](function(_0x3766a3){if(_0x3766a3){_0x3d1707[_0xdc80('0x31')]=_['keys'](db['JscriptySessionReport'][_0xdc80('0x45')]);_0x3d1707[_0xdc80('0x32')]=_[_0xdc80('0x33')](_0x2566c2[_0xdc80('0x32')]);_0x3d1707['filters']=_[_0xdc80('0x34')](_0x3d1707['model'],_0x3d1707[_0xdc80('0x32')]);_0x22c976['attributes']=_[_0xdc80('0x34')](_0x3d1707[_0xdc80('0x31')],qs['fields'](_0x2566c2[_0xdc80('0x32')][_0xdc80('0x36')]));_0x22c976[_0xdc80('0x35')]=_0x22c976[_0xdc80('0x35')]['length']?_0x22c976['attributes']:_0x3d1707[_0xdc80('0x31')];if(!_0x2566c2['query'][_0xdc80('0x38')](_0xdc80('0x39'))){_0x22c976[_0xdc80('0x1f')]=qs['limit'](_0x2566c2[_0xdc80('0x32')][_0xdc80('0x1f')]);_0x22c976['offset']=qs['offset'](_0x2566c2['query'][_0xdc80('0x1e')]);}_0x22c976[_0xdc80('0x3a')]=qs[_0xdc80('0x3b')](_0x2566c2['query'][_0xdc80('0x3b')]);_0x22c976['where']=qs[_0xdc80('0x3d')](_['pick'](_0x2566c2[_0xdc80('0x32')],_0x3d1707[_0xdc80('0x3d')]));_0x22c976[_0xdc80('0x3c')]['ProjectId']=_0x3766a3['id'];if(_0x2566c2['query'][_0xdc80('0x3e')]){_0x22c976[_0xdc80('0x3c')]=_[_0xdc80('0x3f')](_0x22c976['where'],{'$or':_[_0xdc80('0x2d')](_0x22c976[_0xdc80('0x35')],function(_0x1f9f02){var _0x289116={};_0x289116[_0x1f9f02]={'$like':'%'+_0x2566c2[_0xdc80('0x32')]['filter']+'%'};return _0x289116;})});}_0x22c976=_[_0xdc80('0x3f')]({},_0x22c976,_0x2566c2['options']);return db['JscriptySessionReport']['count']({'where':_0x22c976[_0xdc80('0x3c')]})['then'](function(_0x451db5){_0x5ef32a[_0xdc80('0x1d')]=_0x451db5;if(_0x2566c2[_0xdc80('0x32')]['includeAll']){_0x22c976['include']=[{'all':!![]}];}return db['JscriptySessionReport'][_0xdc80('0x41')](_0x22c976);})[_0xdc80('0x24')](function(_0x56f2e1){_0x5ef32a[_0xdc80('0x57')]=_0x56f2e1;return _0x5ef32a;});}})[_0xdc80('0x24')](respondWithFilteredResult(_0x4d4236,_0x22c976))[_0xdc80('0x42')](handleError(_0x4d4236,null));};exports['getAnswers']=function(_0x34e0e4,_0x377bde,_0x457e43){var _0x255d3e={'raw':!![],'where':{}};var _0x1edf8c={};var _0x2a1db9={'count':0x0,'rows':[]};return db[_0xdc80('0x2e')][_0xdc80('0x56')]({'where':{'id':_0x34e0e4[_0xdc80('0x44')]['id']}})[_0xdc80('0x24')](handleEntityNotFound(_0x377bde,null))[_0xdc80('0x24')](function(_0x37d7f7){if(_0x37d7f7){_0x1edf8c[_0xdc80('0x31')]=_[_0xdc80('0x33')](db['JscriptyAnswerReport']['rawAttributes']);_0x1edf8c['query']=_['keys'](_0x34e0e4[_0xdc80('0x32')]);_0x1edf8c['filters']=_[_0xdc80('0x34')](_0x1edf8c[_0xdc80('0x31')],_0x1edf8c[_0xdc80('0x32')]);_0x255d3e[_0xdc80('0x35')]=_[_0xdc80('0x34')](_0x1edf8c[_0xdc80('0x31')],qs[_0xdc80('0x36')](_0x34e0e4[_0xdc80('0x32')][_0xdc80('0x36')]));_0x255d3e[_0xdc80('0x35')]=_0x255d3e[_0xdc80('0x35')][_0xdc80('0x37')]?_0x255d3e[_0xdc80('0x35')]:_0x1edf8c[_0xdc80('0x31')];if(!_0x34e0e4[_0xdc80('0x32')][_0xdc80('0x38')](_0xdc80('0x39'))){_0x255d3e[_0xdc80('0x1f')]=qs[_0xdc80('0x1f')](_0x34e0e4[_0xdc80('0x32')][_0xdc80('0x1f')]);_0x255d3e[_0xdc80('0x1e')]=qs['offset'](_0x34e0e4[_0xdc80('0x32')][_0xdc80('0x1e')]);}_0x255d3e[_0xdc80('0x3a')]=qs[_0xdc80('0x3b')](_0x34e0e4['query'][_0xdc80('0x3b')]);_0x255d3e[_0xdc80('0x3c')]=qs[_0xdc80('0x3d')](_[_0xdc80('0x58')](_0x34e0e4[_0xdc80('0x32')],_0x1edf8c[_0xdc80('0x3d')]));_0x255d3e['where'][_0xdc80('0x59')]=_0x37d7f7['id'];if(_0x34e0e4[_0xdc80('0x32')][_0xdc80('0x3e')]){_0x255d3e['where']=_[_0xdc80('0x3f')](_0x255d3e[_0xdc80('0x3c')],{'$or':_[_0xdc80('0x2d')](_0x255d3e[_0xdc80('0x35')],function(_0x5ba9e2){var _0x5d596e={};_0x5d596e[_0x5ba9e2]={'$like':'%'+_0x34e0e4[_0xdc80('0x32')]['filter']+'%'};return _0x5d596e;})});}_0x255d3e=_[_0xdc80('0x3f')]({},_0x255d3e,_0x34e0e4['options']);return db[_0xdc80('0x5a')][_0xdc80('0x1d')]({'where':_0x255d3e[_0xdc80('0x3c')]})[_0xdc80('0x24')](function(_0x53e995){_0x2a1db9[_0xdc80('0x1d')]=_0x53e995;if(_0x34e0e4[_0xdc80('0x32')][_0xdc80('0x40')]){_0x255d3e[_0xdc80('0x46')]=[{'all':!![]}];}return db[_0xdc80('0x5a')][_0xdc80('0x41')](_0x255d3e);})[_0xdc80('0x24')](function(_0x2a5151){_0x2a1db9[_0xdc80('0x57')]=_0x2a5151;return _0x2a1db9;});}})['then'](respondWithFilteredResult(_0x377bde,_0x255d3e))[_0xdc80('0x42')](handleError(_0x377bde,null));};function char(_0xb135f1){return'number'===typeof _0xb135f1?String['fromCharCode'][_0xdc80('0x5b')](null,arguments):_0xb135f1;}function needsEncapsulation(_0xdcf26c){return!!_0xdcf26c&&(_0xdcf26c[_0xdc80('0x5c')]()[_0xdc80('0x5d')](char(0xd))>=0x0||_0xdcf26c[_0xdc80('0x5c')]()[_0xdc80('0x5d')](char(0xa))>=0x0||_0xdcf26c[_0xdc80('0x5c')]()[_0xdc80('0x5d')](char(0x2c))>=0x0||_0xdcf26c[_0xdc80('0x5c')]()[_0xdc80('0x5d')](char(0x22))>=0x0);}function encapsulate(_0x52b878){var _0x3f10ab=char(0x22),_0x406f72='\x5c'+char(0x22),_0x5572fe=_0x52b878['toString']()[_0xdc80('0x5e')](new RegExp(_0x3f10ab,'g'),_0x406f72);return _0x3f10ab+_0x5572fe+_0x3f10ab;}exports[_0xdc80('0x5f')]=function(_0x112e98,_0x1d59da,_0x1c2d57){var _0x4fb4f9,_0x363cb4;var _0x7abc25={'where':{'ProjectId':_0x112e98[_0xdc80('0x44')]['id']}};if(_0x112e98['query']['startTime']){_0x7abc25['where'][_0xdc80('0x60')]=JSON['parse'](_0x112e98[_0xdc80('0x32')][_0xdc80('0x61')]);}return db[_0xdc80('0x62')]['findAll'](_0x7abc25)[_0xdc80('0x24')](handleEntityNotFound(_0x1d59da,null))['then'](function(_0x26a5ae){if(_0x26a5ae){_0x4fb4f9=_0x26a5ae;return db[_0xdc80('0x63')][_0xdc80('0x41')]({'where':{'SessionId':{'$in':_[_0xdc80('0x2d')](_0x4fb4f9,'id')},'ProjectId':_0x112e98[_0xdc80('0x44')]['id']},'order':_0xdc80('0x64')});}})[_0xdc80('0x24')](handleEntityNotFound(_0x1d59da,null))[_0xdc80('0x24')](function(_0x282b4e){if(_0x282b4e){_0x363cb4=_0x282b4e;var _0x25cf42={};for(var _0x25c6e0=0x0,_0x521044=_0x363cb4[_0xdc80('0x37')];_0x25c6e0<_0x521044;_0x25c6e0++){if(!_0x25cf42[_0xdc80('0x38')](_0x363cb4[_0x25c6e0][_0xdc80('0x65')])){_0x25cf42[_0x363cb4[_0x25c6e0]['questionId']]=needsEncapsulation(_0x363cb4[_0x25c6e0][_0xdc80('0x66')])?encapsulate(_0x363cb4[_0x25c6e0][_0xdc80('0x66')]):_0x363cb4[_0x25c6e0][_0xdc80('0x66')];}}var _0x3b476b=[],_0x47a533={};for(var _0x4cb20f=0x0,_0x3c22bd=_0x4fb4f9['length'];_0x4cb20f<_0x3c22bd;_0x4cb20f++){_0x47a533={'ProjectId':_0x112e98[_0xdc80('0x44')]['id'],'SessionId':_0x4fb4f9[_0x4cb20f]['id'],'StartTime':moment(_0x4fb4f9[_0x4cb20f][_0xdc80('0x60')])[_0xdc80('0x67')](_0xdc80('0x68'))};for(var _0x29a9f2=0x0,_0x15503d=_0x363cb4[_0xdc80('0x37')];_0x29a9f2<_0x15503d;_0x29a9f2++){if(_0x363cb4[_0x29a9f2][_0xdc80('0x69')]==_0x4fb4f9[_0x4cb20f]['id']&&_0x25cf42['hasOwnProperty'](_0x363cb4[_0x29a9f2][_0xdc80('0x65')])){_0x47a533[_0x25cf42[_0x363cb4[_0x29a9f2][_0xdc80('0x65')]]]=_0x363cb4[_0x29a9f2][_0xdc80('0x6a')];}}for(var _0x5bf95c in _0x25cf42){if(!_0x47a533[_0xdc80('0x38')](_0x25cf42[_0x5bf95c])){_0x47a533[_0x25cf42[_0x5bf95c]]=null;}}_0x3b476b[_0xdc80('0x6b')](_0x47a533);}return _0x3b476b;}})['then'](function(_0x350fb1){if(!_[_0xdc80('0x6c')](_0x350fb1)){var _0x175c26=toCsv(_0x350fb1);var _0x91871d=Date[_0xdc80('0x6d')]();fs['writeFileSync'](util['format'](_0xdc80('0x6e'),_0x112e98[_0xdc80('0x44')]['id'],_0x91871d),_0x175c26);_0x1d59da[_0xdc80('0x6f')](_0xdc80('0x70'),_0xdc80('0x71')+util[_0xdc80('0x67')](_0xdc80('0x72'),_0x112e98[_0xdc80('0x44')]['id'],_0x91871d));_0x1d59da['setHeader'](_0xdc80('0x73'),_0xdc80('0x74'));return _0x1d59da[_0xdc80('0x75')](util[_0xdc80('0x67')](_0xdc80('0x6e'),_0x112e98['params']['id'],_0x91871d));}else{return _0x1d59da['sendStatus'](0xcc);}})[_0xdc80('0x42')](handleError(_0x1d59da,null));};
\ No newline at end of file
diff --git a/server/api/jscriptyProject/jscriptyProject.model.js b/server/api/jscriptyProject/jscriptyProject.model.js
index 6d12c96..fb0ad1e 100644
--- a/server/api/jscriptyProject/jscriptyProject.model.js
+++ b/server/api/jscriptyProject/jscriptyProject.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xe836=['exports','define','JscriptyProject','lodash','util','api','moment','bluebird','request-promise','rimraf','../../config/environment','./jscriptyProject.attributes'];(function(_0xc3e090,_0x1cf44f){var _0x4275ad=function(_0x17fd59){while(--_0x17fd59){_0xc3e090['push'](_0xc3e090['shift']());}};_0x4275ad(++_0x1cf44f);}(_0xe836,0x87));var _0x6e83=function(_0x4a1bba,_0x152487){_0x4a1bba=_0x4a1bba-0x0;var _0x52dc0b=_0xe836[_0x4a1bba];return _0x52dc0b;};'use strict';var _=require(_0x6e83('0x0'));var util=require(_0x6e83('0x1'));var logger=require('../../config/logger')(_0x6e83('0x2'));var moment=require(_0x6e83('0x3'));var BPromise=require(_0x6e83('0x4'));var rp=require(_0x6e83('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x6e83('0x6'));var config=require(_0x6e83('0x7'));var attributes=require(_0x6e83('0x8'));module[_0x6e83('0x9')]=function(_0x40bef9,_0x184a78){return _0x40bef9[_0x6e83('0xa')](_0x6e83('0xb'),attributes,{'tableName':'jscripty_projects','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x2313=['moment','rimraf','../../config/environment','./jscriptyProject.attributes','exports','define','lodash','util','../../config/logger','api'];(function(_0x2cf3fc,_0x250143){var _0x17c4d9=function(_0x5da460){while(--_0x5da460){_0x2cf3fc['push'](_0x2cf3fc['shift']());}};_0x17c4d9(++_0x250143);}(_0x2313,0x146));var _0x3231=function(_0x21f5c6,_0x22b397){_0x21f5c6=_0x21f5c6-0x0;var _0x35a4b2=_0x2313[_0x21f5c6];return _0x35a4b2;};'use strict';var _=require(_0x3231('0x0'));var util=require(_0x3231('0x1'));var logger=require(_0x3231('0x2'))(_0x3231('0x3'));var moment=require(_0x3231('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x3231('0x5'));var config=require(_0x3231('0x6'));var attributes=require(_0x3231('0x7'));module[_0x3231('0x8')]=function(_0x82891d,_0x44a97e){return _0x82891d[_0x3231('0x9')]('JscriptyProject',attributes,{'tableName':'jscripty_projects','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/jscriptyProject/jscriptyProject.rpc.js b/server/api/jscriptyProject/jscriptyProject.rpc.js
index 7769838..9f85eb5 100644
--- a/server/api/jscriptyProject/jscriptyProject.rpc.js
+++ b/server/api/jscriptyProject/jscriptyProject.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xafbf=['JscriptyProject,\x20%s,\x20%s','request\x20sent','debug','JscriptyProject,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','then'];(function(_0x10a718,_0x5f4287){var _0x240a89=function(_0x5c833d){while(--_0x5c833d){_0x10a718['push'](_0x10a718['shift']());}};_0x240a89(++_0x5f4287);}(_0xafbf,0x149));var _0xfafb=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0xafbf[_0x1facfa];return _0x9ec701;};'use strict';var _=require(_0xfafb('0x0'));var util=require('util');var moment=require(_0xfafb('0x1'));var BPromise=require(_0xfafb('0x2'));var rs=require(_0xfafb('0x3'));var fs=require('fs');var Redis=require(_0xfafb('0x4'));var db=require(_0xfafb('0x5'))['db'];var utils=require(_0xfafb('0x6'));var logger=require('../../config/logger')(_0xfafb('0x7'));var config=require(_0xfafb('0x8'));var jayson=require(_0xfafb('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x235892,_0x4fbda8,_0xed648e){return new BPromise(function(_0x44e2a6,_0x23ec8e){return client['request'](_0x235892,_0xed648e)[_0xfafb('0xa')](function(_0x4a3ed3){logger['info'](_0xfafb('0xb'),_0x4fbda8,_0xfafb('0xc'));logger[_0xfafb('0xd')](_0xfafb('0xe'),_0x4fbda8,_0xfafb('0xc'),JSON[_0xfafb('0xf')](_0x4a3ed3));if(_0x4a3ed3['error']){if(_0x4a3ed3[_0xfafb('0x10')][_0xfafb('0x11')]===0x1f4){logger[_0xfafb('0x10')](_0xfafb('0xb'),_0x4fbda8,_0x4a3ed3[_0xfafb('0x10')]['message']);return _0x23ec8e(_0x4a3ed3[_0xfafb('0x10')]['message']);}logger[_0xfafb('0x10')](_0xfafb('0xb'),_0x4fbda8,_0x4a3ed3[_0xfafb('0x10')][_0xfafb('0x12')]);return _0x44e2a6(_0x4a3ed3['error']['message']);}else{logger['info'](_0xfafb('0xb'),_0x4fbda8,_0xfafb('0xc'));_0x44e2a6(_0x4a3ed3['result'][_0xfafb('0x12')]);}})[_0xfafb('0x13')](function(_0x5463f9){logger[_0xfafb('0x10')](_0xfafb('0xb'),_0x4fbda8,_0x5463f9);_0x23ec8e(_0x5463f9);});});}
\ No newline at end of file
+var _0x87c9=['http','info','JscriptyProject,\x20%s,\x20%s','debug','JscriptyProject,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','catch','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client'];(function(_0x3f44b3,_0x6317e6){var _0x3a7ed1=function(_0x32ae91){while(--_0x32ae91){_0x3f44b3['push'](_0x3f44b3['shift']());}};_0x3a7ed1(++_0x6317e6);}(_0x87c9,0x12a));var _0x987c=function(_0x5c0479,_0x5d3a5f){_0x5c0479=_0x5c0479-0x0;var _0x1f5a16=_0x87c9[_0x5c0479];return _0x1f5a16;};'use strict';var _=require(_0x987c('0x0'));var util=require(_0x987c('0x1'));var moment=require('moment');var BPromise=require(_0x987c('0x2'));var rs=require(_0x987c('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x987c('0x4'))['db'];var utils=require(_0x987c('0x5'));var logger=require('../../config/logger')(_0x987c('0x6'));var config=require(_0x987c('0x7'));var jayson=require(_0x987c('0x8'));var client=jayson[_0x987c('0x9')][_0x987c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x829e8c,_0x4b99bb,_0x366b28){return new BPromise(function(_0x4af343,_0x58bf90){return client['request'](_0x829e8c,_0x366b28)['then'](function(_0x3cb301){logger[_0x987c('0xb')](_0x987c('0xc'),_0x4b99bb,'request\x20sent');logger[_0x987c('0xd')](_0x987c('0xe'),_0x4b99bb,'request\x20sent',JSON[_0x987c('0xf')](_0x3cb301));if(_0x3cb301[_0x987c('0x10')]){if(_0x3cb301['error'][_0x987c('0x11')]===0x1f4){logger[_0x987c('0x10')]('JscriptyProject,\x20%s,\x20%s',_0x4b99bb,_0x3cb301['error']['message']);return _0x58bf90(_0x3cb301[_0x987c('0x10')][_0x987c('0x12')]);}logger[_0x987c('0x10')](_0x987c('0xc'),_0x4b99bb,_0x3cb301[_0x987c('0x10')][_0x987c('0x12')]);return _0x4af343(_0x3cb301[_0x987c('0x10')]['message']);}else{logger[_0x987c('0xb')](_0x987c('0xc'),_0x4b99bb,_0x987c('0x13'));_0x4af343(_0x3cb301[_0x987c('0x14')][_0x987c('0x12')]);}})[_0x987c('0x15')](function(_0x55a6b9){logger['error'](_0x987c('0xc'),_0x4b99bb,_0x55a6b9);_0x58bf90(_0x55a6b9);});});}
\ No newline at end of file
diff --git a/server/api/jscriptyQuestionReport/index.js b/server/api/jscriptyQuestionReport/index.js
index 61af9f1..d0d86fd 100644
--- a/server/api/jscriptyQuestionReport/index.js
+++ b/server/api/jscriptyQuestionReport/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x0cf3=['multer','util','path','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptyQuestionReport.controller','isAuthenticated','index','get','/:id','post','create','put','update','delete','destroy','exports'];(function(_0x4823a2,_0x227df4){var _0x311071=function(_0x1b30c6){while(--_0x1b30c6){_0x4823a2['push'](_0x4823a2['shift']());}};_0x311071(++_0x227df4);}(_0x0cf3,0x1b5));var _0x30cf=function(_0x464591,_0x48aefa){_0x464591=_0x464591-0x0;var _0x21ea9b=_0x0cf3[_0x464591];return _0x21ea9b;};'use strict';var multer=require(_0x30cf('0x0'));var util=require(_0x30cf('0x1'));var path=require(_0x30cf('0x2'));var timeout=require(_0x30cf('0x3'));var express=require('express');var router=express['Router']();var auth=require(_0x30cf('0x4'));var interaction=require(_0x30cf('0x5'));var config=require(_0x30cf('0x6'));var controller=require(_0x30cf('0x7'));router['get']('/',auth[_0x30cf('0x8')](),controller[_0x30cf('0x9')]);router[_0x30cf('0xa')]('/describe',auth[_0x30cf('0x8')](),controller['describe']);router[_0x30cf('0xa')](_0x30cf('0xb'),auth[_0x30cf('0x8')](),controller['show']);router[_0x30cf('0xc')]('/',auth['isAuthenticated'](),controller[_0x30cf('0xd')]);router[_0x30cf('0xe')](_0x30cf('0xb'),auth[_0x30cf('0x8')](),controller[_0x30cf('0xf')]);router[_0x30cf('0x10')](_0x30cf('0xb'),auth[_0x30cf('0x8')](),controller[_0x30cf('0x11')]);module[_0x30cf('0x12')]=router;
\ No newline at end of file
+var _0x970e=['put','update','delete','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptyQuestionReport.controller','get','isAuthenticated','index','describe','/:id','show'];(function(_0x41ef64,_0x579e6f){var _0x561e16=function(_0x366a33){while(--_0x366a33){_0x41ef64['push'](_0x41ef64['shift']());}};_0x561e16(++_0x579e6f);}(_0x970e,0x1d0));var _0xe970=function(_0xf5b290,_0x15902a){_0xf5b290=_0xf5b290-0x0;var _0xbd7686=_0x970e[_0xf5b290];return _0xbd7686;};'use strict';var multer=require(_0xe970('0x0'));var util=require(_0xe970('0x1'));var path=require(_0xe970('0x2'));var timeout=require(_0xe970('0x3'));var express=require(_0xe970('0x4'));var router=express[_0xe970('0x5')]();var auth=require(_0xe970('0x6'));var interaction=require(_0xe970('0x7'));var config=require(_0xe970('0x8'));var controller=require(_0xe970('0x9'));router[_0xe970('0xa')]('/',auth[_0xe970('0xb')](),controller[_0xe970('0xc')]);router[_0xe970('0xa')]('/describe',auth[_0xe970('0xb')](),controller[_0xe970('0xd')]);router['get'](_0xe970('0xe'),auth[_0xe970('0xb')](),controller[_0xe970('0xf')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0xe970('0x10')]('/:id',auth[_0xe970('0xb')](),controller[_0xe970('0x11')]);router[_0xe970('0x12')](_0xe970('0xe'),auth[_0xe970('0xb')](),controller['destroy']);module[_0xe970('0x13')]=router;
\ No newline at end of file
diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js
index 3dd8808..47c0d3b 100644
--- a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js
+++ b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xa7bf=['long','sequelize','exports','STRING'];(function(_0x485b5a,_0x2b289b){var _0xd2b34d=function(_0x34dcbd){while(--_0x34dcbd){_0x485b5a['push'](_0x485b5a['shift']());}};_0xd2b34d(++_0x2b289b);}(_0xa7bf,0x131));var _0xfa7b=function(_0x497cc6,_0x2c3c08){_0x497cc6=_0x497cc6-0x0;var _0x1107d3=_0xa7bf[_0x497cc6];return _0x1107d3;};'use strict';var Sequelize=require(_0xfa7b('0x0'));module[_0xfa7b('0x1')]={'question':{'type':Sequelize[_0xfa7b('0x2')]},'answer':{'type':Sequelize['TEXT'](_0xfa7b('0x3'))},'membername':{'type':Sequelize['STRING']},'projectname':{'type':Sequelize[_0xfa7b('0x2')]},'queue':{'type':Sequelize[_0xfa7b('0x2')]},'uniqueid':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0xfa7b('0x2')]},'calleridnum':{'type':Sequelize[_0xfa7b('0x2')]},'questionId':{'type':Sequelize[_0xfa7b('0x2')]}};
\ No newline at end of file
+var _0xf8b5=['long','STRING'];(function(_0x521378,_0x2f8004){var _0x4b2fc4=function(_0x25511e){while(--_0x25511e){_0x521378['push'](_0x521378['shift']());}};_0x4b2fc4(++_0x2f8004);}(_0xf8b5,0x85));var _0x5f8b=function(_0x1242f2,_0x2b9a43){_0x1242f2=_0x1242f2-0x0;var _0x3e1e84=_0xf8b5[_0x1242f2];return _0x3e1e84;};'use strict';var Sequelize=require('sequelize');module['exports']={'question':{'type':Sequelize[_0x5f8b('0x0')]},'answer':{'type':Sequelize['TEXT'](_0x5f8b('0x1'))},'membername':{'type':Sequelize[_0x5f8b('0x0')]},'projectname':{'type':Sequelize[_0x5f8b('0x0')]},'queue':{'type':Sequelize[_0x5f8b('0x0')]},'uniqueid':{'type':Sequelize[_0x5f8b('0x0')]},'calleridname':{'type':Sequelize[_0x5f8b('0x0')]},'calleridnum':{'type':Sequelize[_0x5f8b('0x0')]},'questionId':{'type':Sequelize[_0x5f8b('0x0')]}};
\ No newline at end of file
diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.controller.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.controller.js
index 023ee2c..291f80f 100644
--- a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.controller.js
+++ b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x193a=['util','path','sox','ejs','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','count','offset','limit','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','send','map','JscriptyQuestionReport','rawAttributes','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','catch','show','params','find','create','body','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird'];(function(_0x305b9d,_0x1215c1){var _0x802c35=function(_0x42d262){while(--_0x42d262){_0x305b9d['push'](_0x305b9d['shift']());}};_0x802c35(++_0x1215c1);}(_0x193a,0x11d));var _0xa193=function(_0x1bf3cf,_0x437ed6){_0x1bf3cf=_0x1bf3cf-0x0;var _0x2056b0=_0x193a[_0x1bf3cf];return _0x2056b0;};'use strict';var pdf=require(_0xa193('0x0'));var emlformat=require(_0xa193('0x1'));var rimraf=require(_0xa193('0x2'));var zipdir=require(_0xa193('0x3'));var jsonpatch=require(_0xa193('0x4'));var rp=require('request-promise');var moment=require(_0xa193('0x5'));var BPromise=require(_0xa193('0x6'));var Mustache=require('mustache');var util=require(_0xa193('0x7'));var path=require(_0xa193('0x8'));var sox=require(_0xa193('0x9'));var csv=require('to-csv');var ejs=require(_0xa193('0xa'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0xa193('0xb'));var jsforce=require(_0xa193('0xc'));var deskjs=require(_0xa193('0xd'));var toCsv=require(_0xa193('0xe'));var querystring=require(_0xa193('0xf'));var Papa=require(_0xa193('0x10'));var Redis=require(_0xa193('0x11'));var authService=require(_0xa193('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xa193('0x13'));var hardwareService=require(_0xa193('0x14'));var logger=require(_0xa193('0x15'))(_0xa193('0x16'));var utils=require(_0xa193('0x17'));var config=require(_0xa193('0x18'));var db=require(_0xa193('0x19'))['db'];function respondWithStatusCode(_0x128a94,_0x5ae8ba){_0x5ae8ba=_0x5ae8ba||0xcc;return function(_0x3c3b66){if(_0x3c3b66){return _0x128a94[_0xa193('0x1a')](_0x5ae8ba);}return _0x128a94[_0xa193('0x1b')](_0x5ae8ba)[_0xa193('0x1c')]();};}function respondWithResult(_0x769ea9,_0x1802f9){_0x1802f9=_0x1802f9||0xc8;return function(_0x544856){if(_0x544856){return _0x769ea9['status'](_0x1802f9)['json'](_0x544856);}};}function respondWithFilteredResult(_0x97c6fa,_0x395d40){return function(_0x18e50b){if(_0x18e50b){var _0x5348a3=_0x18e50b[_0xa193('0x1d')],_0x3c1dfc=_0x395d40[_0xa193('0x1e')],_0x10581b=_0x395d40[_0xa193('0x1e')]+_0x395d40[_0xa193('0x1f')],_0x553ce5;if(_0x10581b>=_0x5348a3){_0x10581b=_0x5348a3;_0x553ce5=0xc8;}else{_0x553ce5=0xce;}_0x97c6fa[_0xa193('0x1b')](_0x553ce5);return _0x97c6fa[_0xa193('0x20')](_0xa193('0x21'),_0x3c1dfc+'-'+_0x10581b+'/'+_0x5348a3)['json'](_0x18e50b);}return null;};}function patchUpdates(_0x40298d){return function(_0xda4f3b){try{jsonpatch[_0xa193('0x22')](_0xda4f3b,_0x40298d,!![]);}catch(_0x171775){return BPromise[_0xa193('0x23')](_0x171775);}return _0xda4f3b['save']();};}function saveUpdates(_0x41acec,_0x26993b){return function(_0x3f2999){if(_0x3f2999){return _0x3f2999[_0xa193('0x24')](_0x41acec)[_0xa193('0x25')](function(_0x40abfc){return _0x40abfc;});}return null;};}function removeEntity(_0x8b4fa4,_0x38563a){return function(_0x3af9b0){if(_0x3af9b0){return _0x3af9b0[_0xa193('0x26')]()[_0xa193('0x25')](function(){_0x8b4fa4['status'](0xcc)[_0xa193('0x1c')]();});}};}function handleEntityNotFound(_0x3a1cdf,_0xee03ad){return function(_0x363ea7){if(!_0x363ea7){_0x3a1cdf[_0xa193('0x1a')](0x194);}return _0x363ea7;};}function handleError(_0x109661,_0x4e55a7){_0x4e55a7=_0x4e55a7||0x1f4;return function(_0x4aca52){logger[_0xa193('0x27')](_0x4aca52[_0xa193('0x28')]);if(_0x4aca52['name']){delete _0x4aca52[_0xa193('0x29')];}_0x109661[_0xa193('0x1b')](_0x4e55a7)[_0xa193('0x2a')](_0x4aca52);};}exports['index']=function(_0x585a98,_0x88e67a){var _0x2595be={},_0x5ec7e2={},_0x11ca83={'count':0x0,'rows':[]};var _0x1f7609=_[_0xa193('0x2b')](db[_0xa193('0x2c')][_0xa193('0x2d')],function(_0x489f05){return{'name':_0x489f05['fieldName'],'type':_0x489f05['type'][_0xa193('0x2e')]};});_0x5ec7e2[_0xa193('0x2f')]=_[_0xa193('0x2b')](_0x1f7609,_0xa193('0x29'));_0x5ec7e2[_0xa193('0x30')]=_[_0xa193('0x31')](_0x585a98['query']);_0x5ec7e2[_0xa193('0x32')]=_[_0xa193('0x33')](_0x5ec7e2['model'],_0x5ec7e2[_0xa193('0x30')]);_0x2595be[_0xa193('0x34')]=_['intersection'](_0x5ec7e2[_0xa193('0x2f')],qs['fields'](_0x585a98[_0xa193('0x30')][_0xa193('0x35')]));_0x2595be[_0xa193('0x34')]=_0x2595be['attributes'][_0xa193('0x36')]?_0x2595be[_0xa193('0x34')]:_0x5ec7e2[_0xa193('0x2f')];if(!_0x585a98[_0xa193('0x30')][_0xa193('0x37')](_0xa193('0x38'))){_0x2595be[_0xa193('0x1f')]=qs[_0xa193('0x1f')](_0x585a98[_0xa193('0x30')][_0xa193('0x1f')]);_0x2595be[_0xa193('0x1e')]=qs[_0xa193('0x1e')](_0x585a98[_0xa193('0x30')][_0xa193('0x1e')]);}_0x2595be['order']=qs[_0xa193('0x39')](_0x585a98[_0xa193('0x30')][_0xa193('0x39')]);_0x2595be[_0xa193('0x3a')]=qs[_0xa193('0x32')](_[_0xa193('0x3b')](_0x585a98[_0xa193('0x30')],_0x5ec7e2[_0xa193('0x32')]),_0x1f7609);if(_0x585a98[_0xa193('0x30')][_0xa193('0x3c')]){_0x2595be[_0xa193('0x3a')]=_['merge'](_0x2595be['where'],{'$or':_['map'](_0x1f7609,function(_0x51d981){if(_0x51d981['type']!==_0xa193('0x3d')){var _0x39c7d1={};_0x39c7d1[_0x51d981[_0xa193('0x29')]]={'$like':'%'+_0x585a98['query'][_0xa193('0x3c')]+'%'};return _0x39c7d1;}})});}_0x2595be=_[_0xa193('0x3e')]({},_0x2595be,_0x585a98[_0xa193('0x3f')]);var _0x4b6224={'where':_0x2595be[_0xa193('0x3a')]};return db[_0xa193('0x2c')][_0xa193('0x1d')](_0x4b6224)['then'](function(_0x29397b){_0x11ca83['count']=_0x29397b;if(_0x585a98[_0xa193('0x30')][_0xa193('0x40')]){_0x2595be[_0xa193('0x41')]=[{'all':!![]}];}return db['JscriptyQuestionReport']['findAll'](_0x2595be);})[_0xa193('0x25')](function(_0x4e05b4){_0x11ca83['rows']=_0x4e05b4;return _0x11ca83;})[_0xa193('0x25')](respondWithFilteredResult(_0x88e67a,_0x2595be))[_0xa193('0x42')](handleError(_0x88e67a,null));};exports[_0xa193('0x43')]=function(_0x5b7ed2,_0x4b026a){var _0xdf7e95={'raw':!![],'where':{'id':_0x5b7ed2[_0xa193('0x44')]['id']}},_0x1cd2eb={};_0x1cd2eb[_0xa193('0x2f')]=_['keys'](db[_0xa193('0x2c')][_0xa193('0x2d')]);_0x1cd2eb[_0xa193('0x30')]=_[_0xa193('0x31')](_0x5b7ed2['query']);_0x1cd2eb[_0xa193('0x32')]=_[_0xa193('0x33')](_0x1cd2eb[_0xa193('0x2f')],_0x1cd2eb[_0xa193('0x30')]);_0xdf7e95[_0xa193('0x34')]=_['intersection'](_0x1cd2eb[_0xa193('0x2f')],qs[_0xa193('0x35')](_0x5b7ed2[_0xa193('0x30')][_0xa193('0x35')]));_0xdf7e95[_0xa193('0x34')]=_0xdf7e95[_0xa193('0x34')]['length']?_0xdf7e95[_0xa193('0x34')]:_0x1cd2eb['model'];if(_0x5b7ed2['query'][_0xa193('0x40')]){_0xdf7e95[_0xa193('0x41')]=[{'all':!![]}];}_0xdf7e95=_[_0xa193('0x3e')]({},_0xdf7e95,_0x5b7ed2[_0xa193('0x3f')]);return db['JscriptyQuestionReport'][_0xa193('0x45')](_0xdf7e95)['then'](handleEntityNotFound(_0x4b026a,null))[_0xa193('0x25')](respondWithResult(_0x4b026a,null))[_0xa193('0x42')](handleError(_0x4b026a,null));};exports[_0xa193('0x46')]=function(_0xeceee6,_0x2f3636){return db[_0xa193('0x2c')][_0xa193('0x46')](_0xeceee6[_0xa193('0x47')],{})[_0xa193('0x25')](respondWithResult(_0x2f3636,0xc9))['catch'](handleError(_0x2f3636,null));};exports[_0xa193('0x24')]=function(_0x319bcb,_0x2885dc){if(_0x319bcb[_0xa193('0x47')]['id']){delete _0x319bcb[_0xa193('0x47')]['id'];}return db[_0xa193('0x2c')]['find']({'where':{'id':_0x319bcb[_0xa193('0x44')]['id']}})[_0xa193('0x25')](handleEntityNotFound(_0x2885dc,null))[_0xa193('0x25')](saveUpdates(_0x319bcb[_0xa193('0x47')],null))['then'](respondWithResult(_0x2885dc,null))[_0xa193('0x42')](handleError(_0x2885dc,null));};exports[_0xa193('0x26')]=function(_0x17fbcc,_0x585a5f){return db[_0xa193('0x2c')]['find']({'where':{'id':_0x17fbcc['params']['id']}})['then'](handleEntityNotFound(_0x585a5f,null))[_0xa193('0x25')](removeEntity(_0x585a5f,null))[_0xa193('0x42')](handleError(_0x585a5f,null));};exports['describe']=function(_0x2bb59e,_0x4f33fa){return db[_0xa193('0x2c')][_0xa193('0x48')]()[_0xa193('0x25')](respondWithResult(_0x4f33fa,null))[_0xa193('0x42')](handleError(_0x4f33fa,null));};
\ No newline at end of file
+var _0xb805=['bluebird','mustache','util','path','to-csv','squel','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','set','Content-Range','reject','save','destroy','then','error','stack','name','send','index','JscriptyQuestionReport','rawAttributes','fieldName','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','limit','order','sort','where','filters','pick','filter','merge','map','type','VIRTUAL','options','include','findAll','rows','show','params','includeAll','find','catch','create','body','update','describe','html-pdf','rimraf','fast-json-patch','request-promise','moment'];(function(_0x4eb7aa,_0x1e8a69){var _0x1924f1=function(_0xefec2e){while(--_0xefec2e){_0x4eb7aa['push'](_0x4eb7aa['shift']());}};_0x1924f1(++_0x1e8a69);}(_0xb805,0x8f));var _0x5b80=function(_0x346f4b,_0x2cb020){_0x346f4b=_0x346f4b-0x0;var _0x2d1231=_0xb805[_0x346f4b];return _0x2d1231;};'use strict';var pdf=require(_0x5b80('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x5b80('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5b80('0x2'));var rp=require(_0x5b80('0x3'));var moment=require(_0x5b80('0x4'));var BPromise=require(_0x5b80('0x5'));var Mustache=require(_0x5b80('0x6'));var util=require(_0x5b80('0x7'));var path=require(_0x5b80('0x8'));var sox=require('sox');var csv=require(_0x5b80('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x5b80('0xa'));var crypto=require('crypto');var jsforce=require(_0x5b80('0xb'));var deskjs=require(_0x5b80('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x5b80('0xd'));var Redis=require('ioredis');var authService=require(_0x5b80('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x5b80('0xf'));var hardwareService=require(_0x5b80('0x10'));var logger=require(_0x5b80('0x11'))(_0x5b80('0x12'));var utils=require(_0x5b80('0x13'));var config=require(_0x5b80('0x14'));var db=require(_0x5b80('0x15'))['db'];function respondWithStatusCode(_0x3ffdf8,_0x4ce8b2){_0x4ce8b2=_0x4ce8b2||0xcc;return function(_0x36d09d){if(_0x36d09d){return _0x3ffdf8[_0x5b80('0x16')](_0x4ce8b2);}return _0x3ffdf8[_0x5b80('0x17')](_0x4ce8b2)[_0x5b80('0x18')]();};}function respondWithResult(_0x4a50d6,_0x4401f7){_0x4401f7=_0x4401f7||0xc8;return function(_0x20428f){if(_0x20428f){return _0x4a50d6[_0x5b80('0x17')](_0x4401f7)[_0x5b80('0x19')](_0x20428f);}};}function respondWithFilteredResult(_0x5d1cba,_0x37199b){return function(_0x42f4d2){if(_0x42f4d2){var _0xa6835e=_0x42f4d2[_0x5b80('0x1a')],_0x59fe8e=_0x37199b[_0x5b80('0x1b')],_0x370c8d=_0x37199b['offset']+_0x37199b['limit'],_0x510a7e;if(_0x370c8d>=_0xa6835e){_0x370c8d=_0xa6835e;_0x510a7e=0xc8;}else{_0x510a7e=0xce;}_0x5d1cba[_0x5b80('0x17')](_0x510a7e);return _0x5d1cba[_0x5b80('0x1c')](_0x5b80('0x1d'),_0x59fe8e+'-'+_0x370c8d+'/'+_0xa6835e)[_0x5b80('0x19')](_0x42f4d2);}return null;};}function patchUpdates(_0x1fe8da){return function(_0x23d3b9){try{jsonpatch['apply'](_0x23d3b9,_0x1fe8da,!![]);}catch(_0xfb63e0){return BPromise[_0x5b80('0x1e')](_0xfb63e0);}return _0x23d3b9[_0x5b80('0x1f')]();};}function saveUpdates(_0x313cd3,_0x511427){return function(_0x4d7d3e){if(_0x4d7d3e){return _0x4d7d3e['update'](_0x313cd3)['then'](function(_0x3ed22a){return _0x3ed22a;});}return null;};}function removeEntity(_0x2037be,_0x48ab73){return function(_0x267846){if(_0x267846){return _0x267846[_0x5b80('0x20')]()[_0x5b80('0x21')](function(){_0x2037be[_0x5b80('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0xf806d0,_0x4be51b){return function(_0x14e577){if(!_0x14e577){_0xf806d0[_0x5b80('0x16')](0x194);}return _0x14e577;};}function handleError(_0x30bb9f,_0xb6fa89){_0xb6fa89=_0xb6fa89||0x1f4;return function(_0x4f1463){logger[_0x5b80('0x22')](_0x4f1463[_0x5b80('0x23')]);if(_0x4f1463[_0x5b80('0x24')]){delete _0x4f1463[_0x5b80('0x24')];}_0x30bb9f['status'](_0xb6fa89)[_0x5b80('0x25')](_0x4f1463);};}exports[_0x5b80('0x26')]=function(_0x1fd430,_0x396a17){var _0x4d3214={},_0x17cf0d={},_0x57a0bd={'count':0x0,'rows':[]};var _0x2c279d=_['map'](db[_0x5b80('0x27')][_0x5b80('0x28')],function(_0x1f6753){return{'name':_0x1f6753[_0x5b80('0x29')],'type':_0x1f6753['type']['key']};});_0x17cf0d[_0x5b80('0x2a')]=_['map'](_0x2c279d,'name');_0x17cf0d[_0x5b80('0x2b')]=_[_0x5b80('0x2c')](_0x1fd430[_0x5b80('0x2b')]);_0x17cf0d['filters']=_[_0x5b80('0x2d')](_0x17cf0d[_0x5b80('0x2a')],_0x17cf0d[_0x5b80('0x2b')]);_0x4d3214['attributes']=_[_0x5b80('0x2d')](_0x17cf0d['model'],qs['fields'](_0x1fd430[_0x5b80('0x2b')][_0x5b80('0x2e')]));_0x4d3214[_0x5b80('0x2f')]=_0x4d3214[_0x5b80('0x2f')][_0x5b80('0x30')]?_0x4d3214[_0x5b80('0x2f')]:_0x17cf0d[_0x5b80('0x2a')];if(!_0x1fd430[_0x5b80('0x2b')][_0x5b80('0x31')]('nolimit')){_0x4d3214[_0x5b80('0x32')]=qs[_0x5b80('0x32')](_0x1fd430[_0x5b80('0x2b')][_0x5b80('0x32')]);_0x4d3214[_0x5b80('0x1b')]=qs['offset'](_0x1fd430['query']['offset']);}_0x4d3214[_0x5b80('0x33')]=qs['sort'](_0x1fd430['query'][_0x5b80('0x34')]);_0x4d3214[_0x5b80('0x35')]=qs[_0x5b80('0x36')](_[_0x5b80('0x37')](_0x1fd430[_0x5b80('0x2b')],_0x17cf0d[_0x5b80('0x36')]),_0x2c279d);if(_0x1fd430[_0x5b80('0x2b')][_0x5b80('0x38')]){_0x4d3214['where']=_[_0x5b80('0x39')](_0x4d3214[_0x5b80('0x35')],{'$or':_[_0x5b80('0x3a')](_0x2c279d,function(_0x3b44ab){if(_0x3b44ab[_0x5b80('0x3b')]!==_0x5b80('0x3c')){var _0x70fea={};_0x70fea[_0x3b44ab['name']]={'$like':'%'+_0x1fd430['query'][_0x5b80('0x38')]+'%'};return _0x70fea;}})});}_0x4d3214=_['merge']({},_0x4d3214,_0x1fd430[_0x5b80('0x3d')]);var _0x42a8ea={'where':_0x4d3214['where']};return db['JscriptyQuestionReport'][_0x5b80('0x1a')](_0x42a8ea)[_0x5b80('0x21')](function(_0x112239){_0x57a0bd[_0x5b80('0x1a')]=_0x112239;if(_0x1fd430[_0x5b80('0x2b')]['includeAll']){_0x4d3214[_0x5b80('0x3e')]=[{'all':!![]}];}return db['JscriptyQuestionReport'][_0x5b80('0x3f')](_0x4d3214);})['then'](function(_0x4743d6){_0x57a0bd[_0x5b80('0x40')]=_0x4743d6;return _0x57a0bd;})[_0x5b80('0x21')](respondWithFilteredResult(_0x396a17,_0x4d3214))['catch'](handleError(_0x396a17,null));};exports[_0x5b80('0x41')]=function(_0x82140d,_0x2abadf){var _0x1800ca={'raw':!![],'where':{'id':_0x82140d[_0x5b80('0x42')]['id']}},_0x1cc229={};_0x1cc229[_0x5b80('0x2a')]=_[_0x5b80('0x2c')](db[_0x5b80('0x27')][_0x5b80('0x28')]);_0x1cc229[_0x5b80('0x2b')]=_['keys'](_0x82140d['query']);_0x1cc229['filters']=_['intersection'](_0x1cc229[_0x5b80('0x2a')],_0x1cc229[_0x5b80('0x2b')]);_0x1800ca[_0x5b80('0x2f')]=_[_0x5b80('0x2d')](_0x1cc229['model'],qs['fields'](_0x82140d['query']['fields']));_0x1800ca[_0x5b80('0x2f')]=_0x1800ca[_0x5b80('0x2f')]['length']?_0x1800ca['attributes']:_0x1cc229['model'];if(_0x82140d[_0x5b80('0x2b')][_0x5b80('0x43')]){_0x1800ca['include']=[{'all':!![]}];}_0x1800ca=_['merge']({},_0x1800ca,_0x82140d[_0x5b80('0x3d')]);return db[_0x5b80('0x27')][_0x5b80('0x44')](_0x1800ca)[_0x5b80('0x21')](handleEntityNotFound(_0x2abadf,null))[_0x5b80('0x21')](respondWithResult(_0x2abadf,null))[_0x5b80('0x45')](handleError(_0x2abadf,null));};exports['create']=function(_0x17eb20,_0xe406b8){return db[_0x5b80('0x27')][_0x5b80('0x46')](_0x17eb20[_0x5b80('0x47')],{})[_0x5b80('0x21')](respondWithResult(_0xe406b8,0xc9))[_0x5b80('0x45')](handleError(_0xe406b8,null));};exports[_0x5b80('0x48')]=function(_0x419394,_0x43e410){if(_0x419394[_0x5b80('0x47')]['id']){delete _0x419394[_0x5b80('0x47')]['id'];}return db['JscriptyQuestionReport']['find']({'where':{'id':_0x419394[_0x5b80('0x42')]['id']}})[_0x5b80('0x21')](handleEntityNotFound(_0x43e410,null))[_0x5b80('0x21')](saveUpdates(_0x419394['body'],null))[_0x5b80('0x21')](respondWithResult(_0x43e410,null))['catch'](handleError(_0x43e410,null));};exports[_0x5b80('0x20')]=function(_0x49402f,_0x2a7008){return db[_0x5b80('0x27')][_0x5b80('0x44')]({'where':{'id':_0x49402f['params']['id']}})[_0x5b80('0x21')](handleEntityNotFound(_0x2a7008,null))[_0x5b80('0x21')](removeEntity(_0x2a7008,null))['catch'](handleError(_0x2a7008,null));};exports[_0x5b80('0x49')]=function(_0x5e8ec3,_0x1317a0){return db[_0x5b80('0x27')]['describe']()[_0x5b80('0x21')](respondWithResult(_0x1317a0,null))['catch'](handleError(_0x1317a0,null));};
\ No newline at end of file
diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js
index 64d0532..0e99923 100644
--- a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js
+++ b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xcc1f=['../../config/logger','api','moment','path','./jscriptyQuestionReport.attributes','define','report_jscripty_questions','lodash','util'];(function(_0x3e8270,_0x293590){var _0x1ccde9=function(_0x213490){while(--_0x213490){_0x3e8270['push'](_0x3e8270['shift']());}};_0x1ccde9(++_0x293590);}(_0xcc1f,0x1a5));var _0xfcc1=function(_0x175848,_0x8f2d75){_0x175848=_0x175848-0x0;var _0x845b1=_0xcc1f[_0x175848];return _0x845b1;};'use strict';var _=require(_0xfcc1('0x0'));var util=require(_0xfcc1('0x1'));var logger=require(_0xfcc1('0x2'))(_0xfcc1('0x3'));var moment=require(_0xfcc1('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xfcc1('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xfcc1('0x6'));module['exports']=function(_0x228d0b,_0x3d3186){return _0x228d0b[_0xfcc1('0x7')]('JscriptyQuestionReport',attributes,{'tableName':_0xfcc1('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xc550=['util','api','bluebird','request-promise','path','rimraf','./jscriptyQuestionReport.attributes','exports','define','report_jscripty_questions','lodash'];(function(_0x858c6d,_0x355ff9){var _0x5bf3b0=function(_0x2e3e4b){while(--_0x2e3e4b){_0x858c6d['push'](_0x858c6d['shift']());}};_0x5bf3b0(++_0x355ff9);}(_0xc550,0x78));var _0x0c55=function(_0x22bae4,_0x22474b){_0x22bae4=_0x22bae4-0x0;var _0x2047b6=_0xc550[_0x22bae4];return _0x2047b6;};'use strict';var _=require(_0x0c55('0x0'));var util=require(_0x0c55('0x1'));var logger=require('../../config/logger')(_0x0c55('0x2'));var moment=require('moment');var BPromise=require(_0x0c55('0x3'));var rp=require(_0x0c55('0x4'));var fs=require('fs');var path=require(_0x0c55('0x5'));var rimraf=require(_0x0c55('0x6'));var config=require('../../config/environment');var attributes=require(_0x0c55('0x7'));module[_0x0c55('0x8')]=function(_0x54d286,_0x2e8f61){return _0x54d286[_0x0c55('0x9')]('JscriptyQuestionReport',attributes,{'tableName':_0x0c55('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.rpc.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.rpc.js
index 322e97b..3f264a5 100644
--- a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.rpc.js
+++ b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xc670=['lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','JscriptyQuestionReport,\x20%s,\x20%s','request\x20sent','JscriptyQuestionReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc670,0x1c8));var _0x0c67=function(_0x277ac3,_0x28874c){_0x277ac3=_0x277ac3-0x0;var _0x3d9cf5=_0xc670[_0x277ac3];return _0x3d9cf5;};'use strict';var _=require(_0x0c67('0x0'));var util=require(_0x0c67('0x1'));var moment=require(_0x0c67('0x2'));var BPromise=require(_0x0c67('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0c67('0x4'));var db=require(_0x0c67('0x5'))['db'];var utils=require(_0x0c67('0x6'));var logger=require(_0x0c67('0x7'))('rpc');var config=require(_0x0c67('0x8'));var jayson=require(_0x0c67('0x9'));var client=jayson[_0x0c67('0xa')][_0x0c67('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2395af,_0x10c640,_0x33bdd7){return new BPromise(function(_0x561e8a,_0x585bf1){return client[_0x0c67('0xc')](_0x2395af,_0x33bdd7)[_0x0c67('0xd')](function(_0x1f146c){logger[_0x0c67('0xe')](_0x0c67('0xf'),_0x10c640,_0x0c67('0x10'));logger['debug'](_0x0c67('0x11'),_0x10c640,_0x0c67('0x10'),JSON[_0x0c67('0x12')](_0x1f146c));if(_0x1f146c[_0x0c67('0x13')]){if(_0x1f146c[_0x0c67('0x13')][_0x0c67('0x14')]===0x1f4){logger['error']('JscriptyQuestionReport,\x20%s,\x20%s',_0x10c640,_0x1f146c[_0x0c67('0x13')]['message']);return _0x585bf1(_0x1f146c['error'][_0x0c67('0x15')]);}logger[_0x0c67('0x13')](_0x0c67('0xf'),_0x10c640,_0x1f146c['error'][_0x0c67('0x15')]);return _0x561e8a(_0x1f146c[_0x0c67('0x13')]['message']);}else{logger[_0x0c67('0xe')](_0x0c67('0xf'),_0x10c640,'request\x20sent');_0x561e8a(_0x1f146c[_0x0c67('0x16')][_0x0c67('0x15')]);}})[_0x0c67('0x17')](function(_0xa29eb4){logger[_0x0c67('0x13')](_0x0c67('0xf'),_0x10c640,_0xa29eb4);_0x585bf1(_0xa29eb4);});});}
\ No newline at end of file
+var _0x0628=['rpc','../../config/environment','client','http','request','info','request\x20sent','debug','error','code','JscriptyQuestionReport,\x20%s,\x20%s','message','result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x4d4017,_0x51ad84){var _0x14ecb2=function(_0xdfce47){while(--_0xdfce47){_0x4d4017['push'](_0x4d4017['shift']());}};_0x14ecb2(++_0x51ad84);}(_0x0628,0x11f));var _0x8062=function(_0x3e830c,_0x4cd9b0){_0x3e830c=_0x3e830c-0x0;var _0x448c62=_0x0628[_0x3e830c];return _0x448c62;};'use strict';var _=require(_0x8062('0x0'));var util=require(_0x8062('0x1'));var moment=require(_0x8062('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8062('0x3'));var db=require(_0x8062('0x4'))['db'];var utils=require(_0x8062('0x5'));var logger=require(_0x8062('0x6'))(_0x8062('0x7'));var config=require(_0x8062('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x8062('0x9')][_0x8062('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x45861b,_0x16bc6c,_0x1e90c3){return new BPromise(function(_0x581f19,_0xff6907){return client[_0x8062('0xb')](_0x45861b,_0x1e90c3)['then'](function(_0x303c8b){logger[_0x8062('0xc')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x16bc6c,_0x8062('0xd'));logger[_0x8062('0xe')]('JscriptyQuestionReport,\x20%s,\x20%s,\x20%s',_0x16bc6c,_0x8062('0xd'),JSON['stringify'](_0x303c8b));if(_0x303c8b[_0x8062('0xf')]){if(_0x303c8b[_0x8062('0xf')][_0x8062('0x10')]===0x1f4){logger[_0x8062('0xf')](_0x8062('0x11'),_0x16bc6c,_0x303c8b['error']['message']);return _0xff6907(_0x303c8b[_0x8062('0xf')][_0x8062('0x12')]);}logger[_0x8062('0xf')](_0x8062('0x11'),_0x16bc6c,_0x303c8b[_0x8062('0xf')]['message']);return _0x581f19(_0x303c8b[_0x8062('0xf')][_0x8062('0x12')]);}else{logger[_0x8062('0xc')](_0x8062('0x11'),_0x16bc6c,_0x8062('0xd'));_0x581f19(_0x303c8b[_0x8062('0x13')][_0x8062('0x12')]);}})[_0x8062('0x14')](function(_0x20bbbd){logger[_0x8062('0xf')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x16bc6c,_0x20bbbd);_0xff6907(_0x20bbbd);});});}
\ No newline at end of file
diff --git a/server/api/jscriptySessionReport/index.js b/server/api/jscriptySessionReport/index.js
index 1e9266c..7382754 100644
--- a/server/api/jscriptySessionReport/index.js
+++ b/server/api/jscriptySessionReport/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x3645=['../../components/auth/service','../../components/interaction/service','./jscriptySessionReport.controller','get','isAuthenticated','index','/describe','describe','show','/:id/questions','getQuestions','post','create','put','/:id','update','destroy','exports','util','path','connect-timeout','express','Router'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x3645,0x154));var _0x5364=function(_0x4d0df6,_0x4634f3){_0x4d0df6=_0x4d0df6-0x0;var _0x4e2615=_0x3645[_0x4d0df6];return _0x4e2615;};'use strict';var multer=require('multer');var util=require(_0x5364('0x0'));var path=require(_0x5364('0x1'));var timeout=require(_0x5364('0x2'));var express=require(_0x5364('0x3'));var router=express[_0x5364('0x4')]();var auth=require(_0x5364('0x5'));var interaction=require(_0x5364('0x6'));var config=require('../../config/environment');var controller=require(_0x5364('0x7'));router[_0x5364('0x8')]('/',auth[_0x5364('0x9')](),controller[_0x5364('0xa')]);router[_0x5364('0x8')](_0x5364('0xb'),auth[_0x5364('0x9')](),controller[_0x5364('0xc')]);router[_0x5364('0x8')]('/:id',auth[_0x5364('0x9')](),controller[_0x5364('0xd')]);router[_0x5364('0x8')](_0x5364('0xe'),auth[_0x5364('0x9')](),controller[_0x5364('0xf')]);router[_0x5364('0x10')]('/',auth[_0x5364('0x9')](),controller[_0x5364('0x11')]);router[_0x5364('0x12')](_0x5364('0x13'),auth[_0x5364('0x9')](),controller[_0x5364('0x14')]);router['delete'](_0x5364('0x13'),auth[_0x5364('0x9')](),controller[_0x5364('0x15')]);module[_0x5364('0x16')]=router;
\ No newline at end of file
+var _0xe0c3=['update','delete','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptySessionReport.controller','get','/describe','isAuthenticated','describe','/:id','show','/:id/questions','create','put'];(function(_0x44c80c,_0x309b9d){var _0x175689=function(_0x2e0755){while(--_0x2e0755){_0x44c80c['push'](_0x44c80c['shift']());}};_0x175689(++_0x309b9d);}(_0xe0c3,0xea));var _0x3e0c=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xe0c3[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require(_0x3e0c('0x0'));var util=require('util');var path=require(_0x3e0c('0x1'));var timeout=require(_0x3e0c('0x2'));var express=require(_0x3e0c('0x3'));var router=express[_0x3e0c('0x4')]();var auth=require(_0x3e0c('0x5'));var interaction=require(_0x3e0c('0x6'));var config=require(_0x3e0c('0x7'));var controller=require(_0x3e0c('0x8'));router[_0x3e0c('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x3e0c('0x9')](_0x3e0c('0xa'),auth[_0x3e0c('0xb')](),controller[_0x3e0c('0xc')]);router[_0x3e0c('0x9')](_0x3e0c('0xd'),auth[_0x3e0c('0xb')](),controller[_0x3e0c('0xe')]);router[_0x3e0c('0x9')](_0x3e0c('0xf'),auth[_0x3e0c('0xb')](),controller['getQuestions']);router['post']('/',auth[_0x3e0c('0xb')](),controller[_0x3e0c('0x10')]);router[_0x3e0c('0x11')](_0x3e0c('0xd'),auth[_0x3e0c('0xb')](),controller[_0x3e0c('0x12')]);router[_0x3e0c('0x13')]('/:id',auth[_0x3e0c('0xb')](),controller['destroy']);module[_0x3e0c('0x14')]=router;
\ No newline at end of file
diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.attributes.js b/server/api/jscriptySessionReport/jscriptySessionReport.attributes.js
index debb827..719b6ff 100644
--- a/server/api/jscriptySessionReport/jscriptySessionReport.attributes.js
+++ b/server/api/jscriptySessionReport/jscriptySessionReport.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x49c8=['exports','DATE','setDataValue','endtime','STRING','BOOLEAN','moment','sequelize'];(function(_0x602ca8,_0x568e82){var _0x26e8ab=function(_0x3fb700){while(--_0x3fb700){_0x602ca8['push'](_0x602ca8['shift']());}};_0x26e8ab(++_0x568e82);}(_0x49c8,0x19e));var _0x849c=function(_0x3116ed,_0x5a69fa){_0x3116ed=_0x3116ed-0x0;var _0x4b46c2=_0x49c8[_0x3116ed];return _0x4b46c2;};'use strict';var moment=require(_0x849c('0x0'));var Sequelize=require(_0x849c('0x1'));module[_0x849c('0x2')]={'starttime':{'type':Sequelize[_0x849c('0x3')],'set':function(_0x2da91a){this[_0x849c('0x4')]('starttime',_0x2da91a);this[_0x849c('0x4')](_0x849c('0x5'),moment()['format']('YYYY-MM-DD\x20HH:mm:ss'));}},'endtime':{'type':Sequelize[_0x849c('0x3')]},'membername':{'type':Sequelize[_0x849c('0x6')]},'projectname':{'type':Sequelize[_0x849c('0x6')]},'queue':{'type':Sequelize[_0x849c('0x6')]},'uniqueid':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x849c('0x6')]},'calleridnum':{'type':Sequelize[_0x849c('0x6')]},'completed':{'type':Sequelize[_0x849c('0x7')],'defaultValue':![]}};
\ No newline at end of file
+var _0x963b=['endtime','YYYY-MM-DD\x20HH:mm:ss','STRING','BOOLEAN','moment','sequelize','exports','setDataValue','starttime'];(function(_0x503343,_0x38d48e){var _0x3a4a78=function(_0x50e4e9){while(--_0x50e4e9){_0x503343['push'](_0x503343['shift']());}};_0x3a4a78(++_0x38d48e);}(_0x963b,0x187));var _0xb963=function(_0xfedc72,_0x292f02){_0xfedc72=_0xfedc72-0x0;var _0x2c7c78=_0x963b[_0xfedc72];return _0x2c7c78;};'use strict';var moment=require(_0xb963('0x0'));var Sequelize=require(_0xb963('0x1'));module[_0xb963('0x2')]={'starttime':{'type':Sequelize['DATE'],'set':function(_0x39d434){this[_0xb963('0x3')](_0xb963('0x4'),_0x39d434);this[_0xb963('0x3')](_0xb963('0x5'),moment()['format'](_0xb963('0x6')));}},'endtime':{'type':Sequelize['DATE']},'membername':{'type':Sequelize[_0xb963('0x7')]},'projectname':{'type':Sequelize[_0xb963('0x7')]},'queue':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0xb963('0x7')]},'calleridname':{'type':Sequelize[_0xb963('0x7')]},'calleridnum':{'type':Sequelize[_0xb963('0x7')]},'completed':{'type':Sequelize[_0xb963('0x8')],'defaultValue':![]}};
\ No newline at end of file
diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.controller.js b/server/api/jscriptySessionReport/jscriptySessionReport.controller.js
index 14324df..3a6487b 100644
--- a/server/api/jscriptySessionReport/jscriptySessionReport.controller.js
+++ b/server/api/jscriptySessionReport/jscriptySessionReport.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xcffb=['getQuestions','JscriptyQuestionReport','order','pick','SessionId','zip-dir','fast-json-patch','moment','mustache','util','path','sox','ejs','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','sendStatus','end','status','count','offset','set','Content-Range','json','apply','save','then','destroy','stack','name','index','JscriptySessionReport','fieldName','type','key','model','map','query','keys','attributes','intersection','fields','length','hasOwnProperty','nolimit','limit','sort','filters','filter','merge','where','VIRTUAL','options','includeAll','include','findAll','rows','show','params','rawAttributes','find','create','body','catch','describe'];(function(_0x3018fb,_0x507e28){var _0x557c8c=function(_0x1ede9f){while(--_0x1ede9f){_0x3018fb['push'](_0x3018fb['shift']());}};_0x557c8c(++_0x507e28);}(_0xcffb,0x1c1));var _0xbcff=function(_0x20dd23,_0x1a868e){_0x20dd23=_0x20dd23-0x0;var _0xef649e=_0xcffb[_0x20dd23];return _0xef649e;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xbcff('0x0'));var jsonpatch=require(_0xbcff('0x1'));var rp=require('request-promise');var moment=require(_0xbcff('0x2'));var BPromise=require('bluebird');var Mustache=require(_0xbcff('0x3'));var util=require(_0xbcff('0x4'));var path=require(_0xbcff('0x5'));var sox=require(_0xbcff('0x6'));var csv=require('to-csv');var ejs=require(_0xbcff('0x7'));var fs=require('fs');var _=require(_0xbcff('0x8'));var squel=require('squel');var crypto=require(_0xbcff('0x9'));var jsforce=require(_0xbcff('0xa'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xbcff('0xb'));var Papa=require(_0xbcff('0xc'));var Redis=require(_0xbcff('0xd'));var authService=require(_0xbcff('0xe'));var qs=require(_0xbcff('0xf'));var as=require(_0xbcff('0x10'));var hardwareService=require(_0xbcff('0x11'));var logger=require(_0xbcff('0x12'))('api');var utils=require('../../config/utils');var config=require(_0xbcff('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x53706e,_0x466178){_0x466178=_0x466178||0xcc;return function(_0x4d85b6){if(_0x4d85b6){return _0x53706e[_0xbcff('0x14')](_0x466178);}return _0x53706e['status'](_0x466178)[_0xbcff('0x15')]();};}function respondWithResult(_0x532026,_0x237389){_0x237389=_0x237389||0xc8;return function(_0x5ac636){if(_0x5ac636){return _0x532026[_0xbcff('0x16')](_0x237389)['json'](_0x5ac636);}};}function respondWithFilteredResult(_0x475bbe,_0x517409){return function(_0x32c126){if(_0x32c126){var _0x29a4be=_0x32c126[_0xbcff('0x17')],_0x402e47=_0x517409['offset'],_0x15adc6=_0x517409[_0xbcff('0x18')]+_0x517409['limit'],_0x440cec;if(_0x15adc6>=_0x29a4be){_0x15adc6=_0x29a4be;_0x440cec=0xc8;}else{_0x440cec=0xce;}_0x475bbe['status'](_0x440cec);return _0x475bbe[_0xbcff('0x19')](_0xbcff('0x1a'),_0x402e47+'-'+_0x15adc6+'/'+_0x29a4be)[_0xbcff('0x1b')](_0x32c126);}return null;};}function patchUpdates(_0x15197b){return function(_0x3adb13){try{jsonpatch[_0xbcff('0x1c')](_0x3adb13,_0x15197b,!![]);}catch(_0x1f924a){return BPromise['reject'](_0x1f924a);}return _0x3adb13[_0xbcff('0x1d')]();};}function saveUpdates(_0x2b3c0c,_0x52f551){return function(_0x31ae23){if(_0x31ae23){return _0x31ae23['update'](_0x2b3c0c)[_0xbcff('0x1e')](function(_0x5c5eb1){return _0x5c5eb1;});}return null;};}function removeEntity(_0x124e60,_0x2663ef){return function(_0x468a98){if(_0x468a98){return _0x468a98[_0xbcff('0x1f')]()['then'](function(){_0x124e60[_0xbcff('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x9c4aa6,_0x4f14c4){return function(_0x5f2f9e){if(!_0x5f2f9e){_0x9c4aa6[_0xbcff('0x14')](0x194);}return _0x5f2f9e;};}function handleError(_0x4fc87b,_0x28e193){_0x28e193=_0x28e193||0x1f4;return function(_0x246a2a){logger['error'](_0x246a2a[_0xbcff('0x20')]);if(_0x246a2a[_0xbcff('0x21')]){delete _0x246a2a[_0xbcff('0x21')];}_0x4fc87b[_0xbcff('0x16')](_0x28e193)['send'](_0x246a2a);};}exports[_0xbcff('0x22')]=function(_0x22303a,_0x277636){var _0x546c9b={},_0x5d54cf={},_0xb7e5c0={'count':0x0,'rows':[]};var _0x38a631=_['map'](db[_0xbcff('0x23')]['rawAttributes'],function(_0x2dcac4){return{'name':_0x2dcac4[_0xbcff('0x24')],'type':_0x2dcac4[_0xbcff('0x25')][_0xbcff('0x26')]};});_0x5d54cf[_0xbcff('0x27')]=_[_0xbcff('0x28')](_0x38a631,_0xbcff('0x21'));_0x5d54cf[_0xbcff('0x29')]=_[_0xbcff('0x2a')](_0x22303a[_0xbcff('0x29')]);_0x5d54cf['filters']=_['intersection'](_0x5d54cf[_0xbcff('0x27')],_0x5d54cf[_0xbcff('0x29')]);_0x546c9b[_0xbcff('0x2b')]=_[_0xbcff('0x2c')](_0x5d54cf[_0xbcff('0x27')],qs[_0xbcff('0x2d')](_0x22303a[_0xbcff('0x29')][_0xbcff('0x2d')]));_0x546c9b[_0xbcff('0x2b')]=_0x546c9b[_0xbcff('0x2b')][_0xbcff('0x2e')]?_0x546c9b[_0xbcff('0x2b')]:_0x5d54cf['model'];if(!_0x22303a['query'][_0xbcff('0x2f')](_0xbcff('0x30'))){_0x546c9b[_0xbcff('0x31')]=qs[_0xbcff('0x31')](_0x22303a[_0xbcff('0x29')][_0xbcff('0x31')]);_0x546c9b[_0xbcff('0x18')]=qs[_0xbcff('0x18')](_0x22303a[_0xbcff('0x29')][_0xbcff('0x18')]);}_0x546c9b['order']=qs[_0xbcff('0x32')](_0x22303a['query'][_0xbcff('0x32')]);_0x546c9b['where']=qs[_0xbcff('0x33')](_['pick'](_0x22303a[_0xbcff('0x29')],_0x5d54cf['filters']),_0x38a631);if(_0x22303a[_0xbcff('0x29')][_0xbcff('0x34')]){_0x546c9b['where']=_[_0xbcff('0x35')](_0x546c9b[_0xbcff('0x36')],{'$or':_[_0xbcff('0x28')](_0x38a631,function(_0x520707){if(_0x520707['type']!==_0xbcff('0x37')){var _0x394dca={};_0x394dca[_0x520707[_0xbcff('0x21')]]={'$like':'%'+_0x22303a[_0xbcff('0x29')][_0xbcff('0x34')]+'%'};return _0x394dca;}})});}_0x546c9b=_[_0xbcff('0x35')]({},_0x546c9b,_0x22303a[_0xbcff('0x38')]);var _0x15ca40={'where':_0x546c9b[_0xbcff('0x36')]};return db[_0xbcff('0x23')][_0xbcff('0x17')](_0x15ca40)['then'](function(_0xa5a080){_0xb7e5c0['count']=_0xa5a080;if(_0x22303a[_0xbcff('0x29')][_0xbcff('0x39')]){_0x546c9b[_0xbcff('0x3a')]=[{'all':!![]}];}return db['JscriptySessionReport'][_0xbcff('0x3b')](_0x546c9b);})[_0xbcff('0x1e')](function(_0x651032){_0xb7e5c0[_0xbcff('0x3c')]=_0x651032;return _0xb7e5c0;})[_0xbcff('0x1e')](respondWithFilteredResult(_0x277636,_0x546c9b))['catch'](handleError(_0x277636,null));};exports[_0xbcff('0x3d')]=function(_0x3aa794,_0x207a32){var _0x4369f1={'raw':!![],'where':{'id':_0x3aa794[_0xbcff('0x3e')]['id']}},_0x396647={};_0x396647['model']=_[_0xbcff('0x2a')](db[_0xbcff('0x23')][_0xbcff('0x3f')]);_0x396647[_0xbcff('0x29')]=_[_0xbcff('0x2a')](_0x3aa794[_0xbcff('0x29')]);_0x396647['filters']=_[_0xbcff('0x2c')](_0x396647[_0xbcff('0x27')],_0x396647['query']);_0x4369f1[_0xbcff('0x2b')]=_['intersection'](_0x396647['model'],qs['fields'](_0x3aa794[_0xbcff('0x29')][_0xbcff('0x2d')]));_0x4369f1[_0xbcff('0x2b')]=_0x4369f1[_0xbcff('0x2b')][_0xbcff('0x2e')]?_0x4369f1[_0xbcff('0x2b')]:_0x396647['model'];if(_0x3aa794[_0xbcff('0x29')]['includeAll']){_0x4369f1['include']=[{'all':!![]}];}_0x4369f1=_[_0xbcff('0x35')]({},_0x4369f1,_0x3aa794[_0xbcff('0x38')]);return db['JscriptySessionReport'][_0xbcff('0x40')](_0x4369f1)[_0xbcff('0x1e')](handleEntityNotFound(_0x207a32,null))[_0xbcff('0x1e')](respondWithResult(_0x207a32,null))['catch'](handleError(_0x207a32,null));};exports['create']=function(_0x2e4f2a,_0x548650){return db[_0xbcff('0x23')][_0xbcff('0x41')](_0x2e4f2a[_0xbcff('0x42')],{})[_0xbcff('0x1e')](respondWithResult(_0x548650,0xc9))[_0xbcff('0x43')](handleError(_0x548650,null));};exports['update']=function(_0x230f2d,_0x3964b6){if(_0x230f2d[_0xbcff('0x42')]['id']){delete _0x230f2d[_0xbcff('0x42')]['id'];}return db[_0xbcff('0x23')]['find']({'where':{'id':_0x230f2d[_0xbcff('0x3e')]['id']}})[_0xbcff('0x1e')](handleEntityNotFound(_0x3964b6,null))[_0xbcff('0x1e')](saveUpdates(_0x230f2d[_0xbcff('0x42')],null))[_0xbcff('0x1e')](respondWithResult(_0x3964b6,null))[_0xbcff('0x43')](handleError(_0x3964b6,null));};exports['destroy']=function(_0x112a3b,_0x1b8fbb){return db[_0xbcff('0x23')][_0xbcff('0x40')]({'where':{'id':_0x112a3b[_0xbcff('0x3e')]['id']}})[_0xbcff('0x1e')](handleEntityNotFound(_0x1b8fbb,null))[_0xbcff('0x1e')](removeEntity(_0x1b8fbb,null))['catch'](handleError(_0x1b8fbb,null));};exports[_0xbcff('0x44')]=function(_0x5f0e08,_0x53c12c){return db[_0xbcff('0x23')][_0xbcff('0x44')]()[_0xbcff('0x1e')](respondWithResult(_0x53c12c,null))[_0xbcff('0x43')](handleError(_0x53c12c,null));};exports[_0xbcff('0x45')]=function(_0x104490,_0x4ea88c,_0x2f5fa3){var _0x4f2b5b={'raw':!![],'where':{}};var _0x159041={};var _0x289458={'count':0x0,'rows':[]};return db[_0xbcff('0x23')]['findOne']({'where':{'id':_0x104490[_0xbcff('0x3e')]['id']}})[_0xbcff('0x1e')](handleEntityNotFound(_0x4ea88c,null))['then'](function(_0x4e498c){if(_0x4e498c){_0x159041[_0xbcff('0x27')]=_[_0xbcff('0x2a')](db[_0xbcff('0x46')][_0xbcff('0x3f')]);_0x159041[_0xbcff('0x29')]=_[_0xbcff('0x2a')](_0x104490['query']);_0x159041[_0xbcff('0x33')]=_[_0xbcff('0x2c')](_0x159041[_0xbcff('0x27')],_0x159041[_0xbcff('0x29')]);_0x4f2b5b['attributes']=_[_0xbcff('0x2c')](_0x159041['model'],qs[_0xbcff('0x2d')](_0x104490[_0xbcff('0x29')][_0xbcff('0x2d')]));_0x4f2b5b[_0xbcff('0x2b')]=_0x4f2b5b[_0xbcff('0x2b')]['length']?_0x4f2b5b[_0xbcff('0x2b')]:_0x159041[_0xbcff('0x27')];if(!_0x104490['query'][_0xbcff('0x2f')](_0xbcff('0x30'))){_0x4f2b5b[_0xbcff('0x31')]=qs[_0xbcff('0x31')](_0x104490['query']['limit']);_0x4f2b5b[_0xbcff('0x18')]=qs[_0xbcff('0x18')](_0x104490['query'][_0xbcff('0x18')]);}_0x4f2b5b[_0xbcff('0x47')]=qs['sort'](_0x104490[_0xbcff('0x29')][_0xbcff('0x32')]);_0x4f2b5b[_0xbcff('0x36')]=qs[_0xbcff('0x33')](_[_0xbcff('0x48')](_0x104490[_0xbcff('0x29')],_0x159041[_0xbcff('0x33')]));_0x4f2b5b['where'][_0xbcff('0x49')]=_0x4e498c['id'];if(_0x104490[_0xbcff('0x29')]['filter']){_0x4f2b5b[_0xbcff('0x36')]=_[_0xbcff('0x35')](_0x4f2b5b['where'],{'$or':_[_0xbcff('0x28')](_0x4f2b5b[_0xbcff('0x2b')],function(_0x184bfc){var _0x14d71e={};_0x14d71e[_0x184bfc]={'$like':'%'+_0x104490[_0xbcff('0x29')][_0xbcff('0x34')]+'%'};return _0x14d71e;})});}_0x4f2b5b=_[_0xbcff('0x35')]({},_0x4f2b5b,_0x104490[_0xbcff('0x38')]);return db['JscriptyQuestionReport'][_0xbcff('0x17')]({'where':_0x4f2b5b['where']})[_0xbcff('0x1e')](function(_0x1c4151){_0x289458[_0xbcff('0x17')]=_0x1c4151;if(_0x104490[_0xbcff('0x29')][_0xbcff('0x39')]){_0x4f2b5b[_0xbcff('0x3a')]=[{'all':!![]}];}return db[_0xbcff('0x46')][_0xbcff('0x3b')](_0x4f2b5b);})[_0xbcff('0x1e')](function(_0x538e65){_0x289458[_0xbcff('0x3c')]=_0x538e65;return _0x289458;});}})[_0xbcff('0x1e')](respondWithFilteredResult(_0x4ea88c,_0x4f2b5b))['catch'](handleError(_0x4ea88c,null));};
\ No newline at end of file
+var _0x3958=['ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','sendStatus','status','count','offset','limit','set','json','reject','save','update','then','end','error','name','send','index','JscriptySessionReport','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','show','params','find','create','body','destroy','describe','getQuestions','findOne','JscriptyQuestionReport','nolimit','SessionId','map','findAll','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','lodash','crypto','jsforce','desk.js','querystring'];(function(_0x218bed,_0x5dd957){var _0x182370=function(_0x3a6707){while(--_0x3a6707){_0x218bed['push'](_0x218bed['shift']());}};_0x182370(++_0x5dd957);}(_0x3958,0xda));var _0x8395=function(_0x46a8f0,_0x27b70f){_0x46a8f0=_0x46a8f0-0x0;var _0x158d07=_0x3958[_0x46a8f0];return _0x158d07;};'use strict';var pdf=require(_0x8395('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x8395('0x1'));var zipdir=require(_0x8395('0x2'));var jsonpatch=require(_0x8395('0x3'));var rp=require(_0x8395('0x4'));var moment=require(_0x8395('0x5'));var BPromise=require(_0x8395('0x6'));var Mustache=require(_0x8395('0x7'));var util=require(_0x8395('0x8'));var path=require('path');var sox=require(_0x8395('0x9'));var csv=require(_0x8395('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x8395('0xb'));var squel=require('squel');var crypto=require(_0x8395('0xc'));var jsforce=require(_0x8395('0xd'));var deskjs=require(_0x8395('0xe'));var toCsv=require(_0x8395('0xa'));var querystring=require(_0x8395('0xf'));var Papa=require('papaparse');var Redis=require(_0x8395('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x8395('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8395('0x12'));var logger=require(_0x8395('0x13'))(_0x8395('0x14'));var utils=require('../../config/utils');var config=require(_0x8395('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x554645,_0x1c971e){_0x1c971e=_0x1c971e||0xcc;return function(_0x185aa5){if(_0x185aa5){return _0x554645[_0x8395('0x16')](_0x1c971e);}return _0x554645[_0x8395('0x17')](_0x1c971e)['end']();};}function respondWithResult(_0x314b36,_0x3d2b73){_0x3d2b73=_0x3d2b73||0xc8;return function(_0x135fd6){if(_0x135fd6){return _0x314b36['status'](_0x3d2b73)['json'](_0x135fd6);}};}function respondWithFilteredResult(_0x70e2f,_0x2e0e58){return function(_0x4f7216){if(_0x4f7216){var _0x3c6693=_0x4f7216[_0x8395('0x18')],_0x123890=_0x2e0e58['offset'],_0xe8f630=_0x2e0e58[_0x8395('0x19')]+_0x2e0e58[_0x8395('0x1a')],_0x13a481;if(_0xe8f630>=_0x3c6693){_0xe8f630=_0x3c6693;_0x13a481=0xc8;}else{_0x13a481=0xce;}_0x70e2f[_0x8395('0x17')](_0x13a481);return _0x70e2f[_0x8395('0x1b')]('Content-Range',_0x123890+'-'+_0xe8f630+'/'+_0x3c6693)[_0x8395('0x1c')](_0x4f7216);}return null;};}function patchUpdates(_0x56e6d1){return function(_0x4606aa){try{jsonpatch['apply'](_0x4606aa,_0x56e6d1,!![]);}catch(_0x25ebe1){return BPromise[_0x8395('0x1d')](_0x25ebe1);}return _0x4606aa[_0x8395('0x1e')]();};}function saveUpdates(_0xab4afa,_0x1ad104){return function(_0x3e0960){if(_0x3e0960){return _0x3e0960[_0x8395('0x1f')](_0xab4afa)[_0x8395('0x20')](function(_0x1b5f80){return _0x1b5f80;});}return null;};}function removeEntity(_0x55fd5d,_0x5e28fe){return function(_0x5213d8){if(_0x5213d8){return _0x5213d8['destroy']()[_0x8395('0x20')](function(){_0x55fd5d[_0x8395('0x17')](0xcc)[_0x8395('0x21')]();});}};}function handleEntityNotFound(_0x5bdf84,_0x13d4b6){return function(_0x3cdf93){if(!_0x3cdf93){_0x5bdf84[_0x8395('0x16')](0x194);}return _0x3cdf93;};}function handleError(_0x832e37,_0x1fd1ed){_0x1fd1ed=_0x1fd1ed||0x1f4;return function(_0x1babee){logger[_0x8395('0x22')](_0x1babee['stack']);if(_0x1babee[_0x8395('0x23')]){delete _0x1babee[_0x8395('0x23')];}_0x832e37[_0x8395('0x17')](_0x1fd1ed)[_0x8395('0x24')](_0x1babee);};}exports[_0x8395('0x25')]=function(_0x28a5a1,_0x45cbe4){var _0x235d8b={},_0x28939a={},_0x12abcb={'count':0x0,'rows':[]};var _0x47852c=_['map'](db[_0x8395('0x26')][_0x8395('0x27')],function(_0x5bb8aa){return{'name':_0x5bb8aa[_0x8395('0x28')],'type':_0x5bb8aa[_0x8395('0x29')][_0x8395('0x2a')]};});_0x28939a['model']=_['map'](_0x47852c,_0x8395('0x23'));_0x28939a[_0x8395('0x2b')]=_[_0x8395('0x2c')](_0x28a5a1[_0x8395('0x2b')]);_0x28939a[_0x8395('0x2d')]=_[_0x8395('0x2e')](_0x28939a['model'],_0x28939a[_0x8395('0x2b')]);_0x235d8b['attributes']=_['intersection'](_0x28939a[_0x8395('0x2f')],qs[_0x8395('0x30')](_0x28a5a1['query']['fields']));_0x235d8b[_0x8395('0x31')]=_0x235d8b[_0x8395('0x31')][_0x8395('0x32')]?_0x235d8b['attributes']:_0x28939a[_0x8395('0x2f')];if(!_0x28a5a1[_0x8395('0x2b')][_0x8395('0x33')]('nolimit')){_0x235d8b[_0x8395('0x1a')]=qs[_0x8395('0x1a')](_0x28a5a1[_0x8395('0x2b')][_0x8395('0x1a')]);_0x235d8b[_0x8395('0x19')]=qs['offset'](_0x28a5a1['query'][_0x8395('0x19')]);}_0x235d8b[_0x8395('0x34')]=qs[_0x8395('0x35')](_0x28a5a1[_0x8395('0x2b')][_0x8395('0x35')]);_0x235d8b[_0x8395('0x36')]=qs[_0x8395('0x2d')](_[_0x8395('0x37')](_0x28a5a1[_0x8395('0x2b')],_0x28939a[_0x8395('0x2d')]),_0x47852c);if(_0x28a5a1['query'][_0x8395('0x38')]){_0x235d8b['where']=_[_0x8395('0x39')](_0x235d8b[_0x8395('0x36')],{'$or':_['map'](_0x47852c,function(_0x1451de){if(_0x1451de['type']!==_0x8395('0x3a')){var _0xff53f3={};_0xff53f3[_0x1451de[_0x8395('0x23')]]={'$like':'%'+_0x28a5a1['query'][_0x8395('0x38')]+'%'};return _0xff53f3;}})});}_0x235d8b=_[_0x8395('0x39')]({},_0x235d8b,_0x28a5a1[_0x8395('0x3b')]);var _0x4cf867={'where':_0x235d8b[_0x8395('0x36')]};return db[_0x8395('0x26')]['count'](_0x4cf867)[_0x8395('0x20')](function(_0x387646){_0x12abcb[_0x8395('0x18')]=_0x387646;if(_0x28a5a1[_0x8395('0x2b')][_0x8395('0x3c')]){_0x235d8b[_0x8395('0x3d')]=[{'all':!![]}];}return db[_0x8395('0x26')]['findAll'](_0x235d8b);})[_0x8395('0x20')](function(_0x52764e){_0x12abcb[_0x8395('0x3e')]=_0x52764e;return _0x12abcb;})[_0x8395('0x20')](respondWithFilteredResult(_0x45cbe4,_0x235d8b))[_0x8395('0x3f')](handleError(_0x45cbe4,null));};exports[_0x8395('0x40')]=function(_0x292ba7,_0x502416){var _0x2d015d={'raw':!![],'where':{'id':_0x292ba7[_0x8395('0x41')]['id']}},_0x42485f={};_0x42485f[_0x8395('0x2f')]=_[_0x8395('0x2c')](db[_0x8395('0x26')][_0x8395('0x27')]);_0x42485f[_0x8395('0x2b')]=_[_0x8395('0x2c')](_0x292ba7[_0x8395('0x2b')]);_0x42485f[_0x8395('0x2d')]=_['intersection'](_0x42485f['model'],_0x42485f[_0x8395('0x2b')]);_0x2d015d[_0x8395('0x31')]=_[_0x8395('0x2e')](_0x42485f[_0x8395('0x2f')],qs[_0x8395('0x30')](_0x292ba7[_0x8395('0x2b')][_0x8395('0x30')]));_0x2d015d[_0x8395('0x31')]=_0x2d015d[_0x8395('0x31')][_0x8395('0x32')]?_0x2d015d['attributes']:_0x42485f[_0x8395('0x2f')];if(_0x292ba7['query'][_0x8395('0x3c')]){_0x2d015d['include']=[{'all':!![]}];}_0x2d015d=_['merge']({},_0x2d015d,_0x292ba7['options']);return db[_0x8395('0x26')][_0x8395('0x42')](_0x2d015d)[_0x8395('0x20')](handleEntityNotFound(_0x502416,null))[_0x8395('0x20')](respondWithResult(_0x502416,null))[_0x8395('0x3f')](handleError(_0x502416,null));};exports[_0x8395('0x43')]=function(_0x7b71c7,_0x112db9){return db[_0x8395('0x26')][_0x8395('0x43')](_0x7b71c7['body'],{})[_0x8395('0x20')](respondWithResult(_0x112db9,0xc9))[_0x8395('0x3f')](handleError(_0x112db9,null));};exports[_0x8395('0x1f')]=function(_0x5a1afa,_0x3dc24c){if(_0x5a1afa['body']['id']){delete _0x5a1afa[_0x8395('0x44')]['id'];}return db[_0x8395('0x26')][_0x8395('0x42')]({'where':{'id':_0x5a1afa[_0x8395('0x41')]['id']}})[_0x8395('0x20')](handleEntityNotFound(_0x3dc24c,null))['then'](saveUpdates(_0x5a1afa[_0x8395('0x44')],null))[_0x8395('0x20')](respondWithResult(_0x3dc24c,null))[_0x8395('0x3f')](handleError(_0x3dc24c,null));};exports[_0x8395('0x45')]=function(_0x2d2c20,_0xa132cc){return db['JscriptySessionReport'][_0x8395('0x42')]({'where':{'id':_0x2d2c20[_0x8395('0x41')]['id']}})['then'](handleEntityNotFound(_0xa132cc,null))[_0x8395('0x20')](removeEntity(_0xa132cc,null))[_0x8395('0x3f')](handleError(_0xa132cc,null));};exports[_0x8395('0x46')]=function(_0x1fe437,_0x3b0f32){return db[_0x8395('0x26')][_0x8395('0x46')]()[_0x8395('0x20')](respondWithResult(_0x3b0f32,null))[_0x8395('0x3f')](handleError(_0x3b0f32,null));};exports[_0x8395('0x47')]=function(_0x3697e4,_0x2f5f22,_0x50fcbe){var _0x409a3e={'raw':!![],'where':{}};var _0x722750={};var _0x4166b7={'count':0x0,'rows':[]};return db[_0x8395('0x26')][_0x8395('0x48')]({'where':{'id':_0x3697e4['params']['id']}})[_0x8395('0x20')](handleEntityNotFound(_0x2f5f22,null))['then'](function(_0x57a64d){if(_0x57a64d){_0x722750['model']=_[_0x8395('0x2c')](db[_0x8395('0x49')][_0x8395('0x27')]);_0x722750[_0x8395('0x2b')]=_[_0x8395('0x2c')](_0x3697e4[_0x8395('0x2b')]);_0x722750['filters']=_[_0x8395('0x2e')](_0x722750[_0x8395('0x2f')],_0x722750[_0x8395('0x2b')]);_0x409a3e[_0x8395('0x31')]=_['intersection'](_0x722750['model'],qs[_0x8395('0x30')](_0x3697e4['query'][_0x8395('0x30')]));_0x409a3e['attributes']=_0x409a3e[_0x8395('0x31')][_0x8395('0x32')]?_0x409a3e[_0x8395('0x31')]:_0x722750[_0x8395('0x2f')];if(!_0x3697e4['query'][_0x8395('0x33')](_0x8395('0x4a'))){_0x409a3e[_0x8395('0x1a')]=qs[_0x8395('0x1a')](_0x3697e4[_0x8395('0x2b')][_0x8395('0x1a')]);_0x409a3e[_0x8395('0x19')]=qs[_0x8395('0x19')](_0x3697e4['query'][_0x8395('0x19')]);}_0x409a3e['order']=qs[_0x8395('0x35')](_0x3697e4[_0x8395('0x2b')]['sort']);_0x409a3e[_0x8395('0x36')]=qs[_0x8395('0x2d')](_[_0x8395('0x37')](_0x3697e4['query'],_0x722750[_0x8395('0x2d')]));_0x409a3e['where'][_0x8395('0x4b')]=_0x57a64d['id'];if(_0x3697e4[_0x8395('0x2b')][_0x8395('0x38')]){_0x409a3e['where']=_[_0x8395('0x39')](_0x409a3e['where'],{'$or':_[_0x8395('0x4c')](_0x409a3e[_0x8395('0x31')],function(_0x5e0570){var _0x1d75f3={};_0x1d75f3[_0x5e0570]={'$like':'%'+_0x3697e4[_0x8395('0x2b')][_0x8395('0x38')]+'%'};return _0x1d75f3;})});}_0x409a3e=_[_0x8395('0x39')]({},_0x409a3e,_0x3697e4[_0x8395('0x3b')]);return db[_0x8395('0x49')]['count']({'where':_0x409a3e[_0x8395('0x36')]})[_0x8395('0x20')](function(_0x4bf973){_0x4166b7[_0x8395('0x18')]=_0x4bf973;if(_0x3697e4[_0x8395('0x2b')][_0x8395('0x3c')]){_0x409a3e[_0x8395('0x3d')]=[{'all':!![]}];}return db['JscriptyQuestionReport'][_0x8395('0x4d')](_0x409a3e);})[_0x8395('0x20')](function(_0x45894e){_0x4166b7[_0x8395('0x3e')]=_0x45894e;return _0x4166b7;});}})[_0x8395('0x20')](respondWithFilteredResult(_0x2f5f22,_0x409a3e))[_0x8395('0x3f')](handleError(_0x2f5f22,null));};
\ No newline at end of file
diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.model.js b/server/api/jscriptySessionReport/jscriptySessionReport.model.js
index bb4a2a2..059f45e 100644
--- a/server/api/jscriptySessionReport/jscriptySessionReport.model.js
+++ b/server/api/jscriptySessionReport/jscriptySessionReport.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x6d11=['exports','define','JscriptySessionReport','report_jscripty_sessions','lodash','util','../../config/logger','moment','request-promise','path','./jscriptySessionReport.attributes'];(function(_0x3d8dac,_0x45cb7d){var _0x3688f4=function(_0x31fb4a){while(--_0x31fb4a){_0x3d8dac['push'](_0x3d8dac['shift']());}};_0x3688f4(++_0x45cb7d);}(_0x6d11,0xbf));var _0x16d1=function(_0x7729b1,_0x468322){_0x7729b1=_0x7729b1-0x0;var _0x349504=_0x6d11[_0x7729b1];return _0x349504;};'use strict';var _=require(_0x16d1('0x0'));var util=require(_0x16d1('0x1'));var logger=require(_0x16d1('0x2'))('api');var moment=require(_0x16d1('0x3'));var BPromise=require('bluebird');var rp=require(_0x16d1('0x4'));var fs=require('fs');var path=require(_0x16d1('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x16d1('0x6'));module[_0x16d1('0x7')]=function(_0x3eb9e2,_0x38626d){return _0x3eb9e2[_0x16d1('0x8')](_0x16d1('0x9'),attributes,{'tableName':_0x16d1('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xf562=['moment','bluebird','request-promise','path','rimraf','./jscriptySessionReport.attributes','define','JscriptySessionReport','report_jscripty_sessions','lodash','util','../../config/logger','api'];(function(_0x1ebe3d,_0xe23282){var _0xf228cb=function(_0x377b6b){while(--_0x377b6b){_0x1ebe3d['push'](_0x1ebe3d['shift']());}};_0xf228cb(++_0xe23282);}(_0xf562,0x100));var _0x2f56=function(_0x3e5bfb,_0x331b00){_0x3e5bfb=_0x3e5bfb-0x0;var _0x483390=_0xf562[_0x3e5bfb];return _0x483390;};'use strict';var _=require(_0x2f56('0x0'));var util=require(_0x2f56('0x1'));var logger=require(_0x2f56('0x2'))(_0x2f56('0x3'));var moment=require(_0x2f56('0x4'));var BPromise=require(_0x2f56('0x5'));var rp=require(_0x2f56('0x6'));var fs=require('fs');var path=require(_0x2f56('0x7'));var rimraf=require(_0x2f56('0x8'));var config=require('../../config/environment');var attributes=require(_0x2f56('0x9'));module['exports']=function(_0x14436b,_0x5b3784){return _0x14436b[_0x2f56('0xa')](_0x2f56('0xb'),attributes,{'tableName':_0x2f56('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.rpc.js b/server/api/jscriptySessionReport/jscriptySessionReport.rpc.js
index fc20052..9aafe62 100644
--- a/server/api/jscriptySessionReport/jscriptySessionReport.rpc.js
+++ b/server/api/jscriptySessionReport/jscriptySessionReport.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x0a1a=['../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','JscriptySessionReport,\x20%s,\x20%s','request\x20sent','debug','JscriptySessionReport,\x20%s,\x20%s,\x20%s','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x486a95,_0x18bed7){var _0x1cc0ec=function(_0x53a230){while(--_0x53a230){_0x486a95['push'](_0x486a95['shift']());}};_0x1cc0ec(++_0x18bed7);}(_0x0a1a,0x161));var _0xa0a1=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x0a1a[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0xa0a1('0x0'));var util=require(_0xa0a1('0x1'));var moment=require(_0xa0a1('0x2'));var BPromise=require(_0xa0a1('0x3'));var rs=require(_0xa0a1('0x4'));var fs=require('fs');var Redis=require(_0xa0a1('0x5'));var db=require(_0xa0a1('0x6'))['db'];var utils=require(_0xa0a1('0x7'));var logger=require('../../config/logger')(_0xa0a1('0x8'));var config=require(_0xa0a1('0x9'));var jayson=require(_0xa0a1('0xa'));var client=jayson[_0xa0a1('0xb')][_0xa0a1('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x3e0353,_0x482fd3,_0x2989ff){return new BPromise(function(_0xe8b7b3,_0xf9d4c8){return client[_0xa0a1('0xd')](_0x3e0353,_0x2989ff)[_0xa0a1('0xe')](function(_0x303535){logger[_0xa0a1('0xf')](_0xa0a1('0x10'),_0x482fd3,_0xa0a1('0x11'));logger[_0xa0a1('0x12')](_0xa0a1('0x13'),_0x482fd3,_0xa0a1('0x11'),JSON['stringify'](_0x303535));if(_0x303535[_0xa0a1('0x14')]){if(_0x303535[_0xa0a1('0x14')]['code']===0x1f4){logger[_0xa0a1('0x14')](_0xa0a1('0x10'),_0x482fd3,_0x303535[_0xa0a1('0x14')][_0xa0a1('0x15')]);return _0xf9d4c8(_0x303535[_0xa0a1('0x14')][_0xa0a1('0x15')]);}logger[_0xa0a1('0x14')]('JscriptySessionReport,\x20%s,\x20%s',_0x482fd3,_0x303535[_0xa0a1('0x14')][_0xa0a1('0x15')]);return _0xe8b7b3(_0x303535[_0xa0a1('0x14')][_0xa0a1('0x15')]);}else{logger[_0xa0a1('0xf')](_0xa0a1('0x10'),_0x482fd3,_0xa0a1('0x11'));_0xe8b7b3(_0x303535[_0xa0a1('0x16')][_0xa0a1('0x15')]);}})[_0xa0a1('0x17')](function(_0x58074c){logger[_0xa0a1('0x14')]('JscriptySessionReport,\x20%s,\x20%s',_0x482fd3,_0x58074c);_0xf9d4c8(_0x58074c);});});}
\ No newline at end of file
+var _0x552d=['../../config/environment','jayson/promise','http','then','info','request\x20sent','debug','stringify','error','code','JscriptySessionReport,\x20%s,\x20%s','message','result','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x298ed3,_0x4ab5e1){var _0x5aad28=function(_0x168687){while(--_0x168687){_0x298ed3['push'](_0x298ed3['shift']());}};_0x5aad28(++_0x4ab5e1);}(_0x552d,0xbe));var _0xd552=function(_0x46698a,_0x8de1e4){_0x46698a=_0x46698a-0x0;var _0x356db0=_0x552d[_0x46698a];return _0x356db0;};'use strict';var _=require(_0xd552('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xd552('0x1'));var rs=require(_0xd552('0x2'));var fs=require('fs');var Redis=require(_0xd552('0x3'));var db=require(_0xd552('0x4'))['db'];var utils=require(_0xd552('0x5'));var logger=require(_0xd552('0x6'))(_0xd552('0x7'));var config=require(_0xd552('0x8'));var jayson=require(_0xd552('0x9'));var client=jayson['client'][_0xd552('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x553006,_0x474c4f,_0x44be5d){return new BPromise(function(_0x28f31f,_0x80186d){return client['request'](_0x553006,_0x44be5d)[_0xd552('0xb')](function(_0x19b1ad){logger[_0xd552('0xc')]('JscriptySessionReport,\x20%s,\x20%s',_0x474c4f,_0xd552('0xd'));logger[_0xd552('0xe')]('JscriptySessionReport,\x20%s,\x20%s,\x20%s',_0x474c4f,_0xd552('0xd'),JSON[_0xd552('0xf')](_0x19b1ad));if(_0x19b1ad[_0xd552('0x10')]){if(_0x19b1ad['error'][_0xd552('0x11')]===0x1f4){logger[_0xd552('0x10')](_0xd552('0x12'),_0x474c4f,_0x19b1ad['error'][_0xd552('0x13')]);return _0x80186d(_0x19b1ad[_0xd552('0x10')]['message']);}logger['error'](_0xd552('0x12'),_0x474c4f,_0x19b1ad[_0xd552('0x10')][_0xd552('0x13')]);return _0x28f31f(_0x19b1ad['error'][_0xd552('0x13')]);}else{logger[_0xd552('0xc')]('JscriptySessionReport,\x20%s,\x20%s',_0x474c4f,_0xd552('0xd'));_0x28f31f(_0x19b1ad[_0xd552('0x14')]['message']);}})[_0xd552('0x15')](function(_0x37b509){logger[_0xd552('0x10')](_0xd552('0x12'),_0x474c4f,_0x37b509);_0x80186d(_0x37b509);});});}
\ No newline at end of file
diff --git a/server/api/license/index.js b/server/api/license/index.js
index fa90fe0..5e837f0 100644
--- a/server/api/license/index.js
+++ b/server/api/license/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x4a8a=['isAuthenticated','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./license.controller','put'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x4a8a,0x1a6));var _0xa4a8=function(_0x1911ed,_0x4e8c73){_0x1911ed=_0x1911ed-0x0;var _0x11edaa=_0x4a8a[_0x1911ed];return _0x11edaa;};'use strict';var multer=require('multer');var util=require(_0xa4a8('0x0'));var path=require(_0xa4a8('0x1'));var timeout=require(_0xa4a8('0x2'));var express=require(_0xa4a8('0x3'));var router=express[_0xa4a8('0x4')]();var auth=require(_0xa4a8('0x5'));var interaction=require(_0xa4a8('0x6'));var config=require(_0xa4a8('0x7'));var controller=require(_0xa4a8('0x8'));router['get']('/',controller['index']);router[_0xa4a8('0x9')]('/:id',auth[_0xa4a8('0xa')](),controller['update']);module[_0xa4a8('0xb')]=router;
\ No newline at end of file
+var _0xff09=['connect-timeout','express','../../components/auth/service','../../components/interaction/service','index','put','/:id','isAuthenticated','update','util','path'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xff09,0x1b6));var _0x9ff0=function(_0xe998dd,_0x5ec17b){_0xe998dd=_0xe998dd-0x0;var _0x57bd82=_0xff09[_0xe998dd];return _0x57bd82;};'use strict';var multer=require('multer');var util=require(_0x9ff0('0x0'));var path=require(_0x9ff0('0x1'));var timeout=require(_0x9ff0('0x2'));var express=require(_0x9ff0('0x3'));var router=express['Router']();var auth=require(_0x9ff0('0x4'));var interaction=require(_0x9ff0('0x5'));var config=require('../../config/environment');var controller=require('./license.controller');router['get']('/',controller[_0x9ff0('0x6')]);router[_0x9ff0('0x7')](_0x9ff0('0x8'),auth[_0x9ff0('0x9')](),controller[_0x9ff0('0xa')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/license/license.attributes.js b/server/api/license/license.attributes.js
index 11c7842..2493f3b 100644
--- a/server/api/license/license.attributes.js
+++ b/server/api/license/license.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xdbf5=['exports','STRING','INTEGER'];(function(_0x58c3ff,_0x124777){var _0x4e5a30=function(_0x4052ef){while(--_0x4052ef){_0x58c3ff['push'](_0x58c3ff['shift']());}};_0x4e5a30(++_0x124777);}(_0xdbf5,0x18c));var _0x5dbf=function(_0x5bd792,_0x312a79){_0x5bd792=_0x5bd792-0x0;var _0x421a23=_0xdbf5[_0x5bd792];return _0x421a23;};'use strict';var Sequelize=require('sequelize');module[_0x5dbf('0x0')]={'license':{'type':Sequelize['TEXT']},'data1':{'type':Sequelize['STRING']},'data2':{'type':Sequelize[_0x5dbf('0x1')]},'chatLicenseExceeded':{'type':Sequelize[_0x5dbf('0x2')],'defaultValue':0x0}};
\ No newline at end of file
+var _0xba34=['STRING','sequelize','exports','TEXT'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xba34,0x119));var _0x4ba3=function(_0x4e806b,_0x4b4484){_0x4e806b=_0x4e806b-0x0;var _0x4ccabe=_0xba34[_0x4e806b];return _0x4ccabe;};'use strict';var Sequelize=require(_0x4ba3('0x0'));module[_0x4ba3('0x1')]={'license':{'type':Sequelize[_0x4ba3('0x2')]},'data1':{'type':Sequelize[_0x4ba3('0x3')]},'data2':{'type':Sequelize[_0x4ba3('0x3')]},'chatLicenseExceeded':{'type':Sequelize['INTEGER'],'defaultValue':0x0}};
\ No newline at end of file
diff --git a/server/api/license/license.controller.js b/server/api/license/license.controller.js
index c67c6f1..490c93b 100644
--- a/server/api/license/license.controller.js
+++ b/server/api/license/license.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x696d=['rimraf','request-promise','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../mysqldb','sendStatus','status','end','json','count','offset','limit','Content-Range','apply','reject','update','then','destroy','error','stack','name','../../config/license/util','index','model','keys','query','intersection','attributes','length','merge','options','catch','body','License','find','params','checkLicense','key','html-pdf'];(function(_0x246492,_0x5380c3){var _0x24d41b=function(_0x48decf){while(--_0x48decf){_0x246492['push'](_0x246492['shift']());}};_0x24d41b(++_0x5380c3);}(_0x696d,0xd7));var _0xd696=function(_0x23e7c1,_0x35110c){_0x23e7c1=_0x23e7c1-0x0;var _0x1add43=_0x696d[_0x23e7c1];return _0x1add43;};'use strict';var pdf=require(_0xd696('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xd696('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xd696('0x2'));var moment=require('moment');var BPromise=require(_0xd696('0x3'));var Mustache=require(_0xd696('0x4'));var util=require(_0xd696('0x5'));var path=require(_0xd696('0x6'));var sox=require(_0xd696('0x7'));var csv=require('to-csv');var ejs=require(_0xd696('0x8'));var fs=require('fs');var _=require(_0xd696('0x9'));var squel=require(_0xd696('0xa'));var crypto=require(_0xd696('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xd696('0xc'));var toCsv=require('to-csv');var querystring=require(_0xd696('0xd'));var Papa=require(_0xd696('0xe'));var Redis=require(_0xd696('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xd696('0x10'));var hardwareService=require(_0xd696('0x11'));var logger=require(_0xd696('0x12'))(_0xd696('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0xd696('0x14'))['db'];function respondWithStatusCode(_0x17e479,_0x1725c7){_0x1725c7=_0x1725c7||0xcc;return function(_0x4be19c){if(_0x4be19c){return _0x17e479[_0xd696('0x15')](_0x1725c7);}return _0x17e479[_0xd696('0x16')](_0x1725c7)[_0xd696('0x17')]();};}function respondWithResult(_0x128fde,_0x46a402){_0x46a402=_0x46a402||0xc8;return function(_0xf15a6c){if(_0xf15a6c){return _0x128fde[_0xd696('0x16')](_0x46a402)[_0xd696('0x18')](_0xf15a6c);}};}function respondWithFilteredResult(_0x25a5df,_0x10caca){return function(_0x36427e){if(_0x36427e){var _0x2f28bf=_0x36427e[_0xd696('0x19')],_0x45d589=_0x10caca[_0xd696('0x1a')],_0x1f10ff=_0x10caca[_0xd696('0x1a')]+_0x10caca[_0xd696('0x1b')],_0x9d5a57;if(_0x1f10ff>=_0x2f28bf){_0x1f10ff=_0x2f28bf;_0x9d5a57=0xc8;}else{_0x9d5a57=0xce;}_0x25a5df[_0xd696('0x16')](_0x9d5a57);return _0x25a5df['set'](_0xd696('0x1c'),_0x45d589+'-'+_0x1f10ff+'/'+_0x2f28bf)[_0xd696('0x18')](_0x36427e);}return null;};}function patchUpdates(_0x1d25da){return function(_0x66efa1){try{jsonpatch[_0xd696('0x1d')](_0x66efa1,_0x1d25da,!![]);}catch(_0x1a39b7){return BPromise[_0xd696('0x1e')](_0x1a39b7);}return _0x66efa1['save']();};}function saveUpdates(_0x40d7c7,_0xad89cf){return function(_0x79e84f){if(_0x79e84f){return _0x79e84f[_0xd696('0x1f')](_0x40d7c7)[_0xd696('0x20')](function(_0x22ad7a){return _0x22ad7a;});}return null;};}function removeEntity(_0x5aef27,_0x253d86){return function(_0x5d87e7){if(_0x5d87e7){return _0x5d87e7[_0xd696('0x21')]()[_0xd696('0x20')](function(){_0x5aef27[_0xd696('0x16')](0xcc)[_0xd696('0x17')]();});}};}function handleEntityNotFound(_0x280bb1,_0x3a14de){return function(_0x4fc0d2){if(!_0x4fc0d2){_0x280bb1[_0xd696('0x15')](0x194);}return _0x4fc0d2;};}function handleError(_0x915a91,_0xbbdf13){_0xbbdf13=_0xbbdf13||0x1f4;return function(_0x3bac86){logger[_0xd696('0x22')](_0x3bac86[_0xd696('0x23')]);if(_0x3bac86[_0xd696('0x24')]){delete _0x3bac86['name'];}_0x915a91[_0xd696('0x16')](_0xbbdf13)['send'](_0x3bac86);};}var utilLicense=require(_0xd696('0x25'));exports[_0xd696('0x26')]=function(_0x1eaba0,_0x1c51c8){var _0x3023bd={'raw':!![],'where':{'id':0x1}},_0x533840={};_0x533840[_0xd696('0x27')]=_[_0xd696('0x28')](db['License']['rawAttributes']);_0x533840['query']=_[_0xd696('0x28')](_0x1eaba0[_0xd696('0x29')]);_0x533840['filters']=_[_0xd696('0x2a')](_0x533840[_0xd696('0x27')],_0x533840[_0xd696('0x29')]);_0x3023bd[_0xd696('0x2b')]=_[_0xd696('0x2a')](_0x533840[_0xd696('0x27')],qs['fields'](_0x1eaba0[_0xd696('0x29')]['fields']));_0x3023bd[_0xd696('0x2b')]=_0x3023bd[_0xd696('0x2b')][_0xd696('0x2c')]?_0x3023bd[_0xd696('0x2b')]:_0x533840[_0xd696('0x27')];_0x3023bd=_[_0xd696('0x2d')]({},_0x3023bd,_0x1eaba0[_0xd696('0x2e')]);return utilLicense['getLicense'](_0x3023bd)[_0xd696('0x20')](respondWithResult(_0x1c51c8,null))[_0xd696('0x2f')](handleError(_0x1c51c8,null));};exports['update']=function(_0x3c78c4,_0x560e13){if(_0x3c78c4[_0xd696('0x30')]['id']){delete _0x3c78c4[_0xd696('0x30')]['id'];}return db[_0xd696('0x31')][_0xd696('0x32')]({'where':{'id':_0x3c78c4[_0xd696('0x33')]['id']}})[_0xd696('0x20')](handleEntityNotFound(_0x560e13,null))['then'](function(_0x5716d5){var _0xcee6e=_0x5716d5['get']({'plain':!![]});return utilLicense[_0xd696('0x34')](_0xcee6e,_0x3c78c4['body'][_0xd696('0x35')]);})['then'](function(_0x4adf90){if(!_0x4adf90['demo']){return saveUpdates(_0x3c78c4['body'],null);}return _0x4adf90;})[_0xd696('0x20')](respondWithResult(_0x560e13,null))[_0xd696('0x2f')](handleError(_0x560e13,null));};
\ No newline at end of file
+var _0x5b69=['catch','body','find','params','get','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','status','end','json','count','offset','limit','set','apply','save','then','destroy','sendStatus','stack','name','send','../../config/license/util','index','model','License','rawAttributes','query','filters','intersection','attributes','fields','length','merge','options','getLicense'];(function(_0x146837,_0x2aa6a2){var _0x3d7e60=function(_0x1301ac){while(--_0x1301ac){_0x146837['push'](_0x146837['shift']());}};_0x3d7e60(++_0x2aa6a2);}(_0x5b69,0x7b));var _0x95b6=function(_0x3a47b1,_0x318a5e){_0x3a47b1=_0x3a47b1-0x0;var _0x464796=_0x5b69[_0x3a47b1];return _0x464796;};'use strict';var pdf=require(_0x95b6('0x0'));var emlformat=require(_0x95b6('0x1'));var rimraf=require(_0x95b6('0x2'));var zipdir=require(_0x95b6('0x3'));var jsonpatch=require(_0x95b6('0x4'));var rp=require(_0x95b6('0x5'));var moment=require(_0x95b6('0x6'));var BPromise=require(_0x95b6('0x7'));var Mustache=require('mustache');var util=require(_0x95b6('0x8'));var path=require(_0x95b6('0x9'));var sox=require('sox');var csv=require(_0x95b6('0xa'));var ejs=require(_0x95b6('0xb'));var fs=require('fs');var _=require(_0x95b6('0xc'));var squel=require(_0x95b6('0xd'));var crypto=require(_0x95b6('0xe'));var jsforce=require(_0x95b6('0xf'));var deskjs=require(_0x95b6('0x10'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x95b6('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x95b6('0x12'));var as=require(_0x95b6('0x13'));var hardwareService=require(_0x95b6('0x14'));var logger=require(_0x95b6('0x15'))(_0x95b6('0x16'));var utils=require(_0x95b6('0x17'));var config=require('../../config/environment');var db=require(_0x95b6('0x18'))['db'];function respondWithStatusCode(_0xfcb6bb,_0x49edab){_0x49edab=_0x49edab||0xcc;return function(_0x575522){if(_0x575522){return _0xfcb6bb['sendStatus'](_0x49edab);}return _0xfcb6bb[_0x95b6('0x19')](_0x49edab)[_0x95b6('0x1a')]();};}function respondWithResult(_0x321812,_0x55b639){_0x55b639=_0x55b639||0xc8;return function(_0x164a0a){if(_0x164a0a){return _0x321812[_0x95b6('0x19')](_0x55b639)[_0x95b6('0x1b')](_0x164a0a);}};}function respondWithFilteredResult(_0x42ffa6,_0x4cdd7c){return function(_0x38106a){if(_0x38106a){var _0x173b70=_0x38106a[_0x95b6('0x1c')],_0x44f403=_0x4cdd7c[_0x95b6('0x1d')],_0xe05176=_0x4cdd7c[_0x95b6('0x1d')]+_0x4cdd7c[_0x95b6('0x1e')],_0x5f07f1;if(_0xe05176>=_0x173b70){_0xe05176=_0x173b70;_0x5f07f1=0xc8;}else{_0x5f07f1=0xce;}_0x42ffa6[_0x95b6('0x19')](_0x5f07f1);return _0x42ffa6[_0x95b6('0x1f')]('Content-Range',_0x44f403+'-'+_0xe05176+'/'+_0x173b70)[_0x95b6('0x1b')](_0x38106a);}return null;};}function patchUpdates(_0x13b143){return function(_0x33e1f4){try{jsonpatch[_0x95b6('0x20')](_0x33e1f4,_0x13b143,!![]);}catch(_0x594dcf){return BPromise['reject'](_0x594dcf);}return _0x33e1f4[_0x95b6('0x21')]();};}function saveUpdates(_0x217066,_0x4785c8){return function(_0x3d8425){if(_0x3d8425){return _0x3d8425['update'](_0x217066)[_0x95b6('0x22')](function(_0x14f4f4){return _0x14f4f4;});}return null;};}function removeEntity(_0x24dc45,_0x5025af){return function(_0x5f35b3){if(_0x5f35b3){return _0x5f35b3[_0x95b6('0x23')]()[_0x95b6('0x22')](function(){_0x24dc45[_0x95b6('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5b1a9b,_0x3d4306){return function(_0x20403c){if(!_0x20403c){_0x5b1a9b[_0x95b6('0x24')](0x194);}return _0x20403c;};}function handleError(_0x566b94,_0x108af2){_0x108af2=_0x108af2||0x1f4;return function(_0x2b4408){logger['error'](_0x2b4408[_0x95b6('0x25')]);if(_0x2b4408[_0x95b6('0x26')]){delete _0x2b4408[_0x95b6('0x26')];}_0x566b94['status'](_0x108af2)[_0x95b6('0x27')](_0x2b4408);};}var utilLicense=require(_0x95b6('0x28'));exports[_0x95b6('0x29')]=function(_0x23086a,_0x1c3ff6){var _0xbc0e73={'raw':!![],'where':{'id':0x1}},_0x268825={};_0x268825[_0x95b6('0x2a')]=_['keys'](db[_0x95b6('0x2b')][_0x95b6('0x2c')]);_0x268825[_0x95b6('0x2d')]=_['keys'](_0x23086a['query']);_0x268825[_0x95b6('0x2e')]=_[_0x95b6('0x2f')](_0x268825[_0x95b6('0x2a')],_0x268825[_0x95b6('0x2d')]);_0xbc0e73[_0x95b6('0x30')]=_['intersection'](_0x268825[_0x95b6('0x2a')],qs['fields'](_0x23086a['query'][_0x95b6('0x31')]));_0xbc0e73[_0x95b6('0x30')]=_0xbc0e73['attributes'][_0x95b6('0x32')]?_0xbc0e73[_0x95b6('0x30')]:_0x268825[_0x95b6('0x2a')];_0xbc0e73=_[_0x95b6('0x33')]({},_0xbc0e73,_0x23086a[_0x95b6('0x34')]);return utilLicense[_0x95b6('0x35')](_0xbc0e73)[_0x95b6('0x22')](respondWithResult(_0x1c3ff6,null))[_0x95b6('0x36')](handleError(_0x1c3ff6,null));};exports['update']=function(_0x2ce2cf,_0x176189){if(_0x2ce2cf[_0x95b6('0x37')]['id']){delete _0x2ce2cf[_0x95b6('0x37')]['id'];}return db[_0x95b6('0x2b')][_0x95b6('0x38')]({'where':{'id':_0x2ce2cf[_0x95b6('0x39')]['id']}})[_0x95b6('0x22')](handleEntityNotFound(_0x176189,null))['then'](function(_0x3b3b0a){var _0x366090=_0x3b3b0a[_0x95b6('0x3a')]({'plain':!![]});return utilLicense['checkLicense'](_0x366090,_0x2ce2cf['body']['key']);})['then'](function(_0x54a693){if(!_0x54a693['demo']){return saveUpdates(_0x2ce2cf[_0x95b6('0x37')],null);}return _0x54a693;})[_0x95b6('0x22')](respondWithResult(_0x176189,null))[_0x95b6('0x36')](handleError(_0x176189,null));};
\ No newline at end of file
diff --git a/server/api/license/license.model.js b/server/api/license/license.model.js
index b4f830a..c556c32 100644
--- a/server/api/license/license.model.js
+++ b/server/api/license/license.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xb10b=['api','moment','request-promise','path','rimraf','../../config/environment','./license.attributes','exports','define','license','lodash','../../config/logger'];(function(_0x5a77fb,_0x2d2d59){var _0x6ca4fb=function(_0x428777){while(--_0x428777){_0x5a77fb['push'](_0x5a77fb['shift']());}};_0x6ca4fb(++_0x2d2d59);}(_0xb10b,0x12a));var _0xbb10=function(_0x5d6b41,_0x3d1c8f){_0x5d6b41=_0x5d6b41-0x0;var _0x1c2dd6=_0xb10b[_0x5d6b41];return _0x1c2dd6;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var logger=require(_0xbb10('0x1'))(_0xbb10('0x2'));var moment=require(_0xbb10('0x3'));var BPromise=require('bluebird');var rp=require(_0xbb10('0x4'));var fs=require('fs');var path=require(_0xbb10('0x5'));var rimraf=require(_0xbb10('0x6'));var config=require(_0xbb10('0x7'));var attributes=require(_0xbb10('0x8'));module[_0xbb10('0x9')]=function(_0x481979,_0x328583){return _0x481979[_0xbb10('0xa')]('License',attributes,{'tableName':_0xbb10('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xd8b0=['define','license','lodash','util','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x5929d2,_0x5ae467){var _0x3a30cb=function(_0x5b6107){while(--_0x5b6107){_0x5929d2['push'](_0x5929d2['shift']());}};_0x3a30cb(++_0x5ae467);}(_0xd8b0,0xad));var _0x0d8b=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xd8b0[_0x122ef9];return _0x42fba0;};'use strict';var _=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x0d8b('0x2'));var rp=require(_0x0d8b('0x3'));var fs=require('fs');var path=require(_0x0d8b('0x4'));var rimraf=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var attributes=require('./license.attributes');module['exports']=function(_0x3f8b6f,_0x227c63){return _0x3f8b6f[_0x0d8b('0x7')]('License',attributes,{'tableName':_0x0d8b('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/license/license.rpc.js b/server/api/license/license.rpc.js
index 6f986ed..b38aafa 100644
--- a/server/api/license/license.rpc.js
+++ b/server/api/license/license.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x8aa7=['client','http','request','then','info','License,\x20%s,\x20%s','request\x20sent','debug','License,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise'];(function(_0xe087a4,_0x1eb412){var _0x26980c=function(_0x36ec0b){while(--_0x36ec0b){_0xe087a4['push'](_0xe087a4['shift']());}};_0x26980c(++_0x1eb412);}(_0x8aa7,0xb6));var _0x78aa=function(_0x58dc25,_0x49b9d5){_0x58dc25=_0x58dc25-0x0;var _0x21b0a7=_0x8aa7[_0x58dc25];return _0x21b0a7;};'use strict';var _=require('lodash');var util=require(_0x78aa('0x0'));var moment=require(_0x78aa('0x1'));var BPromise=require(_0x78aa('0x2'));var rs=require(_0x78aa('0x3'));var fs=require('fs');var Redis=require(_0x78aa('0x4'));var db=require(_0x78aa('0x5'))['db'];var utils=require(_0x78aa('0x6'));var logger=require('../../config/logger')(_0x78aa('0x7'));var config=require(_0x78aa('0x8'));var jayson=require(_0x78aa('0x9'));var client=jayson[_0x78aa('0xa')][_0x78aa('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x369ee7,_0x462a9a,_0xa79008){return new BPromise(function(_0x2368ac,_0x460488){return client[_0x78aa('0xc')](_0x369ee7,_0xa79008)[_0x78aa('0xd')](function(_0x45d377){logger[_0x78aa('0xe')](_0x78aa('0xf'),_0x462a9a,_0x78aa('0x10'));logger[_0x78aa('0x11')](_0x78aa('0x12'),_0x462a9a,_0x78aa('0x10'),JSON['stringify'](_0x45d377));if(_0x45d377['error']){if(_0x45d377[_0x78aa('0x13')][_0x78aa('0x14')]===0x1f4){logger['error'](_0x78aa('0xf'),_0x462a9a,_0x45d377[_0x78aa('0x13')][_0x78aa('0x15')]);return _0x460488(_0x45d377[_0x78aa('0x13')][_0x78aa('0x15')]);}logger['error'](_0x78aa('0xf'),_0x462a9a,_0x45d377[_0x78aa('0x13')][_0x78aa('0x15')]);return _0x2368ac(_0x45d377[_0x78aa('0x13')][_0x78aa('0x15')]);}else{logger['info'](_0x78aa('0xf'),_0x462a9a,_0x78aa('0x10'));_0x2368ac(_0x45d377[_0x78aa('0x16')][_0x78aa('0x15')]);}})[_0x78aa('0x17')](function(_0x2897f8){logger['error']('License,\x20%s,\x20%s',_0x462a9a,_0x2897f8);_0x460488(_0x2897f8);});});}
\ No newline at end of file
+var _0xf089=['../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','then','info','request\x20sent','debug','License,\x20%s,\x20%s,\x20%s','error','License,\x20%s,\x20%s','message','util','moment','randomstring','ioredis'];(function(_0x5933fb,_0x9115ad){var _0x44d988=function(_0x295228){while(--_0x295228){_0x5933fb['push'](_0x5933fb['shift']());}};_0x44d988(++_0x9115ad);}(_0xf089,0xba));var _0x9f08=function(_0x571020,_0x49edce){_0x571020=_0x571020-0x0;var _0x1a9ef0=_0xf089[_0x571020];return _0x1a9ef0;};'use strict';var _=require('lodash');var util=require(_0x9f08('0x0'));var moment=require(_0x9f08('0x1'));var BPromise=require('bluebird');var rs=require(_0x9f08('0x2'));var fs=require('fs');var Redis=require(_0x9f08('0x3'));var db=require(_0x9f08('0x4'))['db'];var utils=require(_0x9f08('0x5'));var logger=require('../../config/logger')(_0x9f08('0x6'));var config=require(_0x9f08('0x7'));var jayson=require(_0x9f08('0x8'));var client=jayson[_0x9f08('0x9')][_0x9f08('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x39abe2,_0x5341c9,_0x9cfade){return new BPromise(function(_0x4b37fc,_0x39e238){return client['request'](_0x39abe2,_0x9cfade)[_0x9f08('0xb')](function(_0x286809){logger[_0x9f08('0xc')]('License,\x20%s,\x20%s',_0x5341c9,_0x9f08('0xd'));logger[_0x9f08('0xe')](_0x9f08('0xf'),_0x5341c9,'request\x20sent',JSON['stringify'](_0x286809));if(_0x286809[_0x9f08('0x10')]){if(_0x286809[_0x9f08('0x10')]['code']===0x1f4){logger[_0x9f08('0x10')](_0x9f08('0x11'),_0x5341c9,_0x286809[_0x9f08('0x10')]['message']);return _0x39e238(_0x286809['error'][_0x9f08('0x12')]);}logger[_0x9f08('0x10')](_0x9f08('0x11'),_0x5341c9,_0x286809[_0x9f08('0x10')]['message']);return _0x4b37fc(_0x286809[_0x9f08('0x10')][_0x9f08('0x12')]);}else{logger[_0x9f08('0xc')](_0x9f08('0x11'),_0x5341c9,_0x9f08('0xd'));_0x4b37fc(_0x286809['result'][_0x9f08('0x12')]);}})['catch'](function(_0x5a562c){logger[_0x9f08('0x10')](_0x9f08('0x11'),_0x5341c9,_0x5a562c);_0x39e238(_0x5a562c);});});}
\ No newline at end of file
diff --git a/server/api/mailAccount/index.js b/server/api/mailAccount/index.js
index 3aec8fd..f777377 100644
--- a/server/api/mailAccount/index.js
+++ b/server/api/mailAccount/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xc828=['destroy','removeAgents','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','describe','/:id','show','getDispositions','/:id/canned_answers','/:id/out_servers','/:id/interactions','/:id/applications','/:id/messages','post','/:id/dispositions','addImap','addSmtp','addInteraction','addApplications','/:id/send','/:id/users','addAgents','update','delete','removeImap','removeSmtp'];(function(_0x3a4667,_0x4845e1){var _0x2fbace=function(_0x2cdff7){while(--_0x2cdff7){_0x3a4667['push'](_0x3a4667['shift']());}};_0x2fbace(++_0x4845e1);}(_0xc828,0x146));var _0x8c82=function(_0x31c4da,_0xd6d192){_0x31c4da=_0x31c4da-0x0;var _0x213a88=_0xc828[_0x31c4da];return _0x213a88;};'use strict';var multer=require(_0x8c82('0x0'));var util=require(_0x8c82('0x1'));var path=require(_0x8c82('0x2'));var timeout=require(_0x8c82('0x3'));var express=require(_0x8c82('0x4'));var router=express[_0x8c82('0x5')]();var auth=require(_0x8c82('0x6'));var interaction=require(_0x8c82('0x7'));var config=require(_0x8c82('0x8'));var controller=require('./mailAccount.controller');router[_0x8c82('0x9')]('/',auth[_0x8c82('0xa')](),controller[_0x8c82('0xb')]);router[_0x8c82('0x9')]('/describe',auth['isAuthenticated'](),controller[_0x8c82('0xc')]);router[_0x8c82('0x9')](_0x8c82('0xd'),auth[_0x8c82('0xa')](),controller[_0x8c82('0xe')]);router[_0x8c82('0x9')]('/:id/dispositions',auth[_0x8c82('0xa')](),controller[_0x8c82('0xf')]);router[_0x8c82('0x9')](_0x8c82('0x10'),auth['isAuthenticated'](),controller['getAnswers']);router[_0x8c82('0x9')]('/:id/in_servers',auth[_0x8c82('0xa')](),controller['getImap']);router[_0x8c82('0x9')](_0x8c82('0x11'),auth['isAuthenticated'](),controller['getSmtp']);router[_0x8c82('0x9')](_0x8c82('0x12'),auth['isAuthenticated'](),controller['getInteractions']);router[_0x8c82('0x9')](_0x8c82('0x13'),auth['isAuthenticated'](),controller['getApplications']);router[_0x8c82('0x9')](_0x8c82('0x14'),auth[_0x8c82('0xa')](),controller['getMessages']);router[_0x8c82('0x9')]('/:id/verify',auth[_0x8c82('0xa')](),controller['verifySmtp']);router[_0x8c82('0x9')]('/:id/users',auth[_0x8c82('0xa')](),controller['getAgents']);router[_0x8c82('0x15')](_0x8c82('0x16'),auth[_0x8c82('0xa')](),controller['addDisposition']);router[_0x8c82('0x15')](_0x8c82('0x10'),auth[_0x8c82('0xa')](),controller['addAnswer']);router[_0x8c82('0x15')]('/',auth[_0x8c82('0xa')](),controller['create']);router['post']('/:id/in_servers',auth['isAuthenticated'](),controller[_0x8c82('0x17')]);router[_0x8c82('0x15')](_0x8c82('0x11'),auth[_0x8c82('0xa')](),controller[_0x8c82('0x18')]);router[_0x8c82('0x15')](_0x8c82('0x12'),auth[_0x8c82('0xa')](),controller[_0x8c82('0x19')]);router[_0x8c82('0x15')](_0x8c82('0x13'),auth[_0x8c82('0xa')](),controller[_0x8c82('0x1a')]);router[_0x8c82('0x15')](_0x8c82('0x1b'),auth[_0x8c82('0xa')](),controller['send']);router['post'](_0x8c82('0x1c'),auth[_0x8c82('0xa')](),controller[_0x8c82('0x1d')]);router['put'](_0x8c82('0xd'),auth['isAuthenticated'](),controller[_0x8c82('0x1e')]);router[_0x8c82('0x1f')](_0x8c82('0x16'),auth[_0x8c82('0xa')](),controller['removeDispositions']);router[_0x8c82('0x1f')]('/:id/canned_answers',auth['isAuthenticated'](),controller['removeAnswers']);router[_0x8c82('0x1f')]('/:id/in_servers',auth['isAuthenticated'](),controller[_0x8c82('0x20')]);router[_0x8c82('0x1f')](_0x8c82('0x11'),auth['isAuthenticated'](),controller[_0x8c82('0x21')]);router['delete']('/:id',auth[_0x8c82('0xa')](),controller[_0x8c82('0x22')]);router[_0x8c82('0x1f')](_0x8c82('0x1c'),auth['isAuthenticated'](),controller[_0x8c82('0x23')]);module['exports']=router;
\ No newline at end of file
+var _0x3062=['addApplications','/:id/send','send','addAgents','put','update','delete','removeDispositions','removeImap','removeSmtp','destroy','removeAgents','exports','util','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailAccount.controller','get','isAuthenticated','index','/describe','describe','/:id','/:id/dispositions','getDispositions','/:id/canned_answers','/:id/in_servers','getImap','/:id/applications','getApplications','/:id/messages','getMessages','verifySmtp','/:id/users','post','addDisposition','create','addImap','/:id/out_servers'];(function(_0x34d5b0,_0x14c0e5){var _0x3a2e01=function(_0x44e6f4){while(--_0x44e6f4){_0x34d5b0['push'](_0x34d5b0['shift']());}};_0x3a2e01(++_0x14c0e5);}(_0x3062,0x133));var _0x2306=function(_0x427d3a,_0x23724c){_0x427d3a=_0x427d3a-0x0;var _0xe5c521=_0x3062[_0x427d3a];return _0xe5c521;};'use strict';var multer=require('multer');var util=require(_0x2306('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x2306('0x1'));var router=express[_0x2306('0x2')]();var auth=require(_0x2306('0x3'));var interaction=require(_0x2306('0x4'));var config=require(_0x2306('0x5'));var controller=require(_0x2306('0x6'));router[_0x2306('0x7')]('/',auth[_0x2306('0x8')](),controller[_0x2306('0x9')]);router[_0x2306('0x7')](_0x2306('0xa'),auth[_0x2306('0x8')](),controller[_0x2306('0xb')]);router[_0x2306('0x7')](_0x2306('0xc'),auth['isAuthenticated'](),controller['show']);router[_0x2306('0x7')](_0x2306('0xd'),auth[_0x2306('0x8')](),controller[_0x2306('0xe')]);router[_0x2306('0x7')](_0x2306('0xf'),auth[_0x2306('0x8')](),controller['getAnswers']);router[_0x2306('0x7')](_0x2306('0x10'),auth[_0x2306('0x8')](),controller[_0x2306('0x11')]);router[_0x2306('0x7')]('/:id/out_servers',auth[_0x2306('0x8')](),controller['getSmtp']);router[_0x2306('0x7')]('/:id/interactions',auth[_0x2306('0x8')](),controller['getInteractions']);router[_0x2306('0x7')](_0x2306('0x12'),auth[_0x2306('0x8')](),controller[_0x2306('0x13')]);router[_0x2306('0x7')](_0x2306('0x14'),auth[_0x2306('0x8')](),controller[_0x2306('0x15')]);router[_0x2306('0x7')]('/:id/verify',auth[_0x2306('0x8')](),controller[_0x2306('0x16')]);router[_0x2306('0x7')](_0x2306('0x17'),auth[_0x2306('0x8')](),controller['getAgents']);router[_0x2306('0x18')](_0x2306('0xd'),auth['isAuthenticated'](),controller[_0x2306('0x19')]);router[_0x2306('0x18')](_0x2306('0xf'),auth[_0x2306('0x8')](),controller['addAnswer']);router['post']('/',auth[_0x2306('0x8')](),controller[_0x2306('0x1a')]);router[_0x2306('0x18')](_0x2306('0x10'),auth[_0x2306('0x8')](),controller[_0x2306('0x1b')]);router[_0x2306('0x18')](_0x2306('0x1c'),auth['isAuthenticated'](),controller['addSmtp']);router[_0x2306('0x18')]('/:id/interactions',auth[_0x2306('0x8')](),controller['addInteraction']);router[_0x2306('0x18')](_0x2306('0x12'),auth[_0x2306('0x8')](),controller[_0x2306('0x1d')]);router[_0x2306('0x18')](_0x2306('0x1e'),auth[_0x2306('0x8')](),controller[_0x2306('0x1f')]);router[_0x2306('0x18')](_0x2306('0x17'),auth[_0x2306('0x8')](),controller[_0x2306('0x20')]);router[_0x2306('0x21')](_0x2306('0xc'),auth['isAuthenticated'](),controller[_0x2306('0x22')]);router[_0x2306('0x23')](_0x2306('0xd'),auth[_0x2306('0x8')](),controller[_0x2306('0x24')]);router[_0x2306('0x23')](_0x2306('0xf'),auth[_0x2306('0x8')](),controller['removeAnswers']);router[_0x2306('0x23')](_0x2306('0x10'),auth[_0x2306('0x8')](),controller[_0x2306('0x25')]);router[_0x2306('0x23')](_0x2306('0x1c'),auth[_0x2306('0x8')](),controller[_0x2306('0x26')]);router[_0x2306('0x23')](_0x2306('0xc'),auth[_0x2306('0x8')](),controller[_0x2306('0x27')]);router['delete'](_0x2306('0x17'),auth[_0x2306('0x8')](),controller[_0x2306('0x28')]);module[_0x2306('0x29')]=router;
\ No newline at end of file
diff --git a/server/api/mailAccount/mailAccount.attributes.js b/server/api/mailAccount/mailAccount.attributes.js
index dd008c8..cafdd93 100644
--- a/server/api/mailAccount/mailAccount.attributes.js
+++ b/server/api/mailAccount/mailAccount.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xefc2=['TEXT','Arial,Helvetica,sans-serif','UNSIGNED','Account:\x20{{account.name}} {{#queue}}Queue:\x20{{queue.name}} {{/queue}}From\x20:\x20{{from}} Subject\x20:\x20{{message.subject}}','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','sequelize','exports','STRING','BOOLEAN'];(function(_0x157b09,_0x1104ba){var _0x3b9f75=function(_0x136da2){while(--_0x136da2){_0x157b09['push'](_0x157b09['shift']());}};_0x3b9f75(++_0x1104ba);}(_0xefc2,0x110));var _0x2efc=function(_0x453e5d,_0x35dd7a){_0x453e5d=_0x453e5d-0x0;var _0x509f82=_0xefc2[_0x453e5d];return _0x509f82;};'use strict';var Sequelize=require(_0x2efc('0x0'));module[_0x2efc('0x1')]={'description':{'type':Sequelize[_0x2efc('0x2')]},'name':{'type':Sequelize[_0x2efc('0x2')],'allowNull':![]},'service':{'type':Sequelize[_0x2efc('0x3')],'defaultValue':![]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'key':{'type':Sequelize[_0x2efc('0x2')],'allowNull':![]},'template':{'type':Sequelize[_0x2efc('0x4')]},'markAsUnread':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'fontFamily':{'type':Sequelize[_0x2efc('0x2')],'allowNull':![],'defaultValue':_0x2efc('0x5')},'fontSize':{'type':Sequelize['INTEGER'](0x2)[_0x2efc('0x6')],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize[_0x2efc('0x4')],'defaultValue':function(){return _0x2efc('0x7');}},'notificationSound':{'type':Sequelize[_0x2efc('0x3')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x2efc('0x3')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x2efc('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x2efc('0x3')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x2efc('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x2efc('0x3')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x2efc('0x8')],'allowNull':!![],'defaultValue':null,'comment':_0x2efc('0x9')},'mandatoryDisposition':{'type':Sequelize[_0x2efc('0x3')],'defaultValue':![],'comment':_0x2efc('0xa'),'set':function(_0x1558d7){if(!_0x1558d7)this['setDataValue']('mandatoryDispositionPauseId',null);this[_0x2efc('0xb')]('mandatoryDisposition',_0x1558d7);}}};
\ No newline at end of file
+var _0xf9e6=['Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','sequelize','STRING','BOOLEAN','TEXT','Arial,Helvetica,sans-serif','INTEGER','UNSIGNED','Account:\x20{{account.name}} {{#queue}}Queue:\x20{{queue.name}} {{/queue}}From\x20:\x20{{from}} Subject\x20:\x20{{message.subject}}','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0xf9e6,0x7b));var _0x6f9e=function(_0x32f539,_0x51efdb){_0x32f539=_0x32f539-0x0;var _0x1867ab=_0xf9e6[_0x32f539];return _0x1867ab;};'use strict';var Sequelize=require(_0x6f9e('0x0'));module['exports']={'description':{'type':Sequelize['STRING']},'name':{'type':Sequelize[_0x6f9e('0x1')],'allowNull':![]},'service':{'type':Sequelize[_0x6f9e('0x2')],'defaultValue':![]},'email':{'type':Sequelize[_0x6f9e('0x1')],'validate':{'isEmail':!![]}},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'key':{'type':Sequelize[_0x6f9e('0x1')],'allowNull':![]},'template':{'type':Sequelize[_0x6f9e('0x3')]},'markAsUnread':{'type':Sequelize[_0x6f9e('0x2')],'defaultValue':![]},'fontFamily':{'type':Sequelize[_0x6f9e('0x1')],'allowNull':![],'defaultValue':_0x6f9e('0x4')},'fontSize':{'type':Sequelize[_0x6f9e('0x5')](0x2)[_0x6f9e('0x6')],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize[_0x6f9e('0x3')],'defaultValue':function(){return _0x6f9e('0x7');}},'notificationSound':{'type':Sequelize[_0x6f9e('0x2')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x6f9e('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x6f9e('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x6f9e('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x6f9e('0x5')],'allowNull':!![],'defaultValue':null,'comment':_0x6f9e('0x8')},'mandatoryDisposition':{'type':Sequelize[_0x6f9e('0x2')],'defaultValue':![],'comment':_0x6f9e('0x9'),'set':function(_0x590075){if(!_0x590075)this[_0x6f9e('0xa')]('mandatoryDispositionPauseId',null);this[_0x6f9e('0xa')]('mandatoryDisposition',_0x590075);}}};
\ No newline at end of file
diff --git a/server/api/mailAccount/mailAccount.controller.js b/server/api/mailAccount/mailAccount.controller.js
index 9dac2c1..f79e949 100644
--- a/server/api/mailAccount/mailAccount.controller.js
+++ b/server/api/mailAccount/mailAccount.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xbea8=['rows','params','options','find','update','body','Imap','MailServerOut','describe','addDisposition','MailAccountId','Disposition','create','getDispositions','findOne','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','email','ListId','isNil','active','description','cservice','cauthentication','user','cuser','password','cpassword','authentication','port','host','service','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','MailAccounts','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getImap','addImap','removeImap','setImap','getSmtp','addSmtp','setSmtp','addInteraction','getInteractions','MailInteraction','CmContact','User','Owner','fullname','Tag','Tags','color','tag','addApplications','transaction','MailApplication','priority','getApplications','getMessages','$gte','MailMessage','split','List','Contacts','updatedAt','DESC','from','format','%s\x20<%s>','attachments','join','root','server/files/attachments','pass','secure','auth','SendMail','sendMail','List\x20not\x20found','messageId','attach','YYYY-MM-DD\x20HH:mm:ss','out','Interaction','Messages','verifySmtp','Sequelize','You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account','addAgents','omit','emit','userMailAccount:save','removeAgents','userMailAccount:remove','getAgents','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','defaults','redis','localhost','socket.io-emitter','register','test','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','info','MailAccount,\x20%s,\x20%s','debug','MailAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','status','end','offset','limit','set','json','apply','reject','save','then','get','UserProfileResource','destroy','sendStatus','stack','name','send','index','MailServerIn','Smtp','Pause','mandatoryDispositionPause','map','MailAccount','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','count','includeAll','include','findAll'];(function(_0x372590,_0x1ebb65){var _0x21abe6=function(_0xce83f4){while(--_0xce83f4){_0x372590['push'](_0x372590['shift']());}};_0x21abe6(++_0x1ebb65);}(_0xbea8,0x64));var _0x8bea=function(_0x41582d,_0x291b1c){_0x41582d=_0x41582d-0x0;var _0x59c504=_0xbea8[_0x41582d];return _0x59c504;};'use strict';var pdf=require(_0x8bea('0x0'));var emlformat=require(_0x8bea('0x1'));var rimraf=require(_0x8bea('0x2'));var zipdir=require(_0x8bea('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x8bea('0x4'));var moment=require(_0x8bea('0x5'));var BPromise=require(_0x8bea('0x6'));var Mustache=require(_0x8bea('0x7'));var util=require(_0x8bea('0x8'));var path=require(_0x8bea('0x9'));var sox=require(_0x8bea('0xa'));var csv=require('to-csv');var ejs=require(_0x8bea('0xb'));var fs=require('fs');var _=require(_0x8bea('0xc'));var squel=require(_0x8bea('0xd'));var crypto=require('crypto');var jsforce=require(_0x8bea('0xe'));var deskjs=require(_0x8bea('0xf'));var toCsv=require('to-csv');var querystring=require(_0x8bea('0x10'));var Papa=require(_0x8bea('0x11'));var Redis=require(_0x8bea('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x8bea('0x13'));var as=require(_0x8bea('0x14'));var hardwareService=require(_0x8bea('0x15'));var logger=require(_0x8bea('0x16'))(_0x8bea('0x17'));var utils=require(_0x8bea('0x18'));var config=require(_0x8bea('0x19'));var db=require(_0x8bea('0x1a'))['db'];config['redis']=_[_0x8bea('0x1b')](config[_0x8bea('0x1c')],{'host':_0x8bea('0x1d'),'port':0x18eb});var socket=require(_0x8bea('0x1e'))(new Redis(config[_0x8bea('0x1c')]));require('./mailAccount.socket')[_0x8bea('0x1f')](socket);var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232b});function checkPasswordPattern(_0x2a3186,_0x214b9e,_0xa34a23){if(_0xa34a23){var _0x220bae=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x220bae[_0x8bea('0x20')](_0x214b9e)){return _0x2a3186;}else{throw new db['Sequelize'][(_0x8bea('0x21'))](_0x8bea('0x22'));}}else{return _0x2a3186;}}function respondWithRpcPromise(_0x4880b4,_0x18e99b,_0x59713b,_0x1e99e7){return new BPromise(function(_0x3fed84,_0x3cdfd1){var _0xd9d7a=_0x1e99e7||client;return _0xd9d7a[_0x8bea('0x23')](_0x4880b4,_0x59713b)['then'](function(_0x5e3e16){logger[_0x8bea('0x24')](_0x8bea('0x25'),_0x18e99b,'request\x20sent');logger[_0x8bea('0x26')](_0x8bea('0x27'),_0x18e99b,'request\x20sent',JSON[_0x8bea('0x28')](_0x5e3e16));if(_0x5e3e16[_0x8bea('0x29')]){if(_0x5e3e16[_0x8bea('0x29')][_0x8bea('0x2a')]===0x1f4){logger[_0x8bea('0x29')](_0x8bea('0x25'),_0x18e99b,_0x5e3e16[_0x8bea('0x29')][_0x8bea('0x2b')]);return _0x3cdfd1(_0x5e3e16[_0x8bea('0x29')][_0x8bea('0x2b')]);}logger[_0x8bea('0x29')]('MailAccount,\x20%s,\x20%s',_0x18e99b,_0x5e3e16['error'][_0x8bea('0x2b')]);return _0x3fed84(_0x5e3e16[_0x8bea('0x29')][_0x8bea('0x2b')]);}else{logger['info'](_0x8bea('0x25'),_0x18e99b,'request\x20sent');_0x3fed84(_0x5e3e16[_0x8bea('0x2c')]['message']);}})[_0x8bea('0x2d')](function(_0x6b0c71){logger[_0x8bea('0x29')](_0x8bea('0x25'),_0x18e99b,_0x6b0c71);_0x3cdfd1(_0x6b0c71);});});}function respondWithStatusCode(_0x65495,_0xfa9f2f){_0xfa9f2f=_0xfa9f2f||0xcc;return function(_0x4b6efc){if(_0x4b6efc){return _0x65495['sendStatus'](_0xfa9f2f);}return _0x65495[_0x8bea('0x2e')](_0xfa9f2f)[_0x8bea('0x2f')]();};}function respondWithResult(_0x231dd0,_0x208580){_0x208580=_0x208580||0xc8;return function(_0x2e1d10){if(_0x2e1d10){return _0x231dd0[_0x8bea('0x2e')](_0x208580)['json'](_0x2e1d10);}};}function respondWithFilteredResult(_0x4b9940,_0x1a7a52){return function(_0x5d6f74){if(_0x5d6f74){var _0x386315=_0x5d6f74['count'],_0x4c8113=_0x1a7a52[_0x8bea('0x30')],_0x3af7c5=_0x1a7a52[_0x8bea('0x30')]+_0x1a7a52[_0x8bea('0x31')],_0x187543;if(_0x3af7c5>=_0x386315){_0x3af7c5=_0x386315;_0x187543=0xc8;}else{_0x187543=0xce;}_0x4b9940[_0x8bea('0x2e')](_0x187543);return _0x4b9940[_0x8bea('0x32')]('Content-Range',_0x4c8113+'-'+_0x3af7c5+'/'+_0x386315)[_0x8bea('0x33')](_0x5d6f74);}return null;};}function patchUpdates(_0x107726){return function(_0x4e052e){try{jsonpatch[_0x8bea('0x34')](_0x4e052e,_0x107726,!![]);}catch(_0x1e64ae){return BPromise[_0x8bea('0x35')](_0x1e64ae);}return _0x4e052e[_0x8bea('0x36')]();};}function saveUpdates(_0x44c167,_0x56955a){return function(_0x1dc8f3){if(_0x1dc8f3){return _0x1dc8f3['update'](_0x44c167)[_0x8bea('0x37')](function(_0x590611){return _0x590611;});}return null;};}function removeEntity(_0x519e33,_0x12ad2f){return function(_0x12c41f){if(_0x12c41f){return _0x12c41f['destroy']()[_0x8bea('0x37')](function(){var _0x6afb11=_0x12c41f[_0x8bea('0x38')]({'plain':!![]});var _0x3185eb='MailAccounts';return db[_0x8bea('0x39')][_0x8bea('0x3a')]({'where':{'type':_0x3185eb,'resourceId':_0x6afb11['id']}})['then'](function(){return _0x12c41f;});})[_0x8bea('0x37')](function(){_0x519e33[_0x8bea('0x2e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x43deb9,_0x1a2d53){return function(_0x4670a0){if(!_0x4670a0){_0x43deb9[_0x8bea('0x3b')](0x194);}return _0x4670a0;};}function handleError(_0x36bd86,_0x31b51a){_0x31b51a=_0x31b51a||0x1f4;return function(_0x1b5bf4){logger[_0x8bea('0x29')](_0x1b5bf4[_0x8bea('0x3c')]);if(_0x1b5bf4['name']){delete _0x1b5bf4[_0x8bea('0x3d')];}_0x36bd86[_0x8bea('0x2e')](_0x31b51a)[_0x8bea('0x3e')](_0x1b5bf4);};}exports[_0x8bea('0x3f')]=function(_0x148434,_0x25035f){var _0x5ad54b={'include':[{'model':db[_0x8bea('0x40')],'as':'Imap'},{'model':db['MailServerOut'],'as':_0x8bea('0x41')},{'model':db[_0x8bea('0x42')],'as':_0x8bea('0x43')}]},_0x24f0df={},_0x561342={'count':0x0,'rows':[]};var _0x22872f=_[_0x8bea('0x44')](db[_0x8bea('0x45')][_0x8bea('0x46')],function(_0x180ef4){return{'name':_0x180ef4[_0x8bea('0x47')],'type':_0x180ef4[_0x8bea('0x48')][_0x8bea('0x49')]};});_0x24f0df[_0x8bea('0x4a')]=_['map'](_0x22872f,_0x8bea('0x3d'));_0x24f0df[_0x8bea('0x4b')]=_[_0x8bea('0x4c')](_0x148434[_0x8bea('0x4b')]);_0x24f0df[_0x8bea('0x4d')]=_[_0x8bea('0x4e')](_0x24f0df[_0x8bea('0x4a')],_0x24f0df['query']);_0x5ad54b['attributes']=_[_0x8bea('0x4e')](_0x24f0df[_0x8bea('0x4a')],qs[_0x8bea('0x4f')](_0x148434['query']['fields']));_0x5ad54b[_0x8bea('0x50')]=_0x5ad54b['attributes'][_0x8bea('0x51')]?_0x5ad54b[_0x8bea('0x50')]:_0x24f0df['model'];if(!_0x148434[_0x8bea('0x4b')][_0x8bea('0x52')](_0x8bea('0x53'))){_0x5ad54b[_0x8bea('0x31')]=qs[_0x8bea('0x31')](_0x148434[_0x8bea('0x4b')][_0x8bea('0x31')]);_0x5ad54b['offset']=qs[_0x8bea('0x30')](_0x148434[_0x8bea('0x4b')][_0x8bea('0x30')]);}_0x5ad54b[_0x8bea('0x54')]=qs[_0x8bea('0x55')](_0x148434[_0x8bea('0x4b')][_0x8bea('0x55')]);_0x5ad54b[_0x8bea('0x56')]=qs[_0x8bea('0x4d')](_[_0x8bea('0x57')](_0x148434[_0x8bea('0x4b')],_0x24f0df['filters']),_0x22872f);if(_0x148434[_0x8bea('0x4b')][_0x8bea('0x58')]){_0x5ad54b['where']=_[_0x8bea('0x59')](_0x5ad54b[_0x8bea('0x56')],{'$or':_[_0x8bea('0x44')](_0x22872f,function(_0x388a0d){if(_0x388a0d[_0x8bea('0x48')]!=='VIRTUAL'){var _0x2210fc={};_0x2210fc[_0x388a0d['name']]={'$like':'%'+_0x148434[_0x8bea('0x4b')][_0x8bea('0x58')]+'%'};return _0x2210fc;}})});}_0x5ad54b=_['merge']({},_0x5ad54b,_0x148434['options']);var _0x1a3e4b={'where':_0x5ad54b[_0x8bea('0x56')]};return db[_0x8bea('0x45')][_0x8bea('0x5a')](_0x1a3e4b)['then'](function(_0x352b66){_0x561342[_0x8bea('0x5a')]=_0x352b66;if(_0x148434[_0x8bea('0x4b')][_0x8bea('0x5b')]){_0x5ad54b[_0x8bea('0x5c')]=[{'all':!![]}];}return db[_0x8bea('0x45')][_0x8bea('0x5d')](_0x5ad54b);})[_0x8bea('0x37')](function(_0x3e74f2){_0x561342[_0x8bea('0x5e')]=_0x3e74f2;return _0x561342;})[_0x8bea('0x37')](respondWithFilteredResult(_0x25035f,_0x5ad54b))[_0x8bea('0x2d')](handleError(_0x25035f,null));};exports['show']=function(_0x6b197f,_0x4b5d13){var _0x59d6a5={'raw':![],'where':{'id':_0x6b197f[_0x8bea('0x5f')]['id']},'include':[{'model':db[_0x8bea('0x40')],'as':'Imap'},{'model':db['MailServerOut'],'as':_0x8bea('0x41')},{'model':db['Pause'],'as':_0x8bea('0x43')}]},_0x3e3762={};_0x3e3762['model']=_[_0x8bea('0x4c')](db['MailAccount'][_0x8bea('0x46')]);_0x3e3762[_0x8bea('0x4b')]=_['keys'](_0x6b197f[_0x8bea('0x4b')]);_0x3e3762[_0x8bea('0x4d')]=_[_0x8bea('0x4e')](_0x3e3762[_0x8bea('0x4a')],_0x3e3762[_0x8bea('0x4b')]);_0x59d6a5[_0x8bea('0x50')]=_[_0x8bea('0x4e')](_0x3e3762[_0x8bea('0x4a')],qs[_0x8bea('0x4f')](_0x6b197f['query'][_0x8bea('0x4f')]));_0x59d6a5['attributes']=_0x59d6a5[_0x8bea('0x50')][_0x8bea('0x51')]?_0x59d6a5['attributes']:_0x3e3762[_0x8bea('0x4a')];if(_0x6b197f['query'][_0x8bea('0x5b')]){_0x59d6a5['include']=[{'all':!![]}];}_0x59d6a5=_[_0x8bea('0x59')]({},_0x59d6a5,_0x6b197f[_0x8bea('0x60')]);return db['MailAccount'][_0x8bea('0x61')](_0x59d6a5)['then'](handleEntityNotFound(_0x4b5d13,null))['then'](respondWithResult(_0x4b5d13,null))[_0x8bea('0x2d')](handleError(_0x4b5d13,null));};exports[_0x8bea('0x62')]=function(_0x2e2f52,_0x2336dc){if(_0x2e2f52[_0x8bea('0x63')]['id']){delete _0x2e2f52['body']['id'];}return db['MailAccount'][_0x8bea('0x61')]({'where':{'id':_0x2e2f52[_0x8bea('0x5f')]['id']},'include':[{'model':db[_0x8bea('0x40')],'as':_0x8bea('0x64')},{'model':db[_0x8bea('0x65')],'as':'Smtp'},{'model':db['Pause'],'as':_0x8bea('0x43')}]})[_0x8bea('0x37')](handleEntityNotFound(_0x2336dc,null))['then'](saveUpdates(_0x2e2f52[_0x8bea('0x63')],null))[_0x8bea('0x37')](function(_0x10f65a){if(_0x10f65a&&_0x2e2f52['body'][_0x8bea('0x64')]){return db[_0x8bea('0x40')][_0x8bea('0x62')](_0x2e2f52[_0x8bea('0x63')][_0x8bea('0x64')],{'where':{'MailAccountId':_0x10f65a['id']}})[_0x8bea('0x37')](function(){return _0x10f65a;});}return _0x10f65a;})[_0x8bea('0x37')](function(_0x18f00c){if(_0x18f00c&&_0x2e2f52['body'][_0x8bea('0x41')]){return db[_0x8bea('0x65')]['update'](_0x2e2f52['body'][_0x8bea('0x41')],{'where':{'MailAccountId':_0x18f00c['id']}})[_0x8bea('0x37')](function(){return _0x18f00c;});}return _0x18f00c;})['then'](respondWithResult(_0x2336dc,null))['catch'](handleError(_0x2336dc,null));};exports['describe']=function(_0x50582e,_0x2b2f97){return db[_0x8bea('0x45')][_0x8bea('0x66')]()[_0x8bea('0x37')](respondWithResult(_0x2b2f97,null))['catch'](handleError(_0x2b2f97,null));};exports[_0x8bea('0x67')]=function(_0x3c3dfa,_0x5600d2,_0x4f949c){if(_0x3c3dfa['body']['id']){delete _0x3c3dfa[_0x8bea('0x63')]['id'];}return db[_0x8bea('0x45')][_0x8bea('0x61')]({'where':{'id':_0x3c3dfa['params']['id']}})[_0x8bea('0x37')](handleEntityNotFound(_0x5600d2,null))[_0x8bea('0x37')](function(_0x45e6fc){if(_0x45e6fc){_0x3c3dfa[_0x8bea('0x63')][_0x8bea('0x68')]=_0x45e6fc['id'];return db[_0x8bea('0x69')][_0x8bea('0x6a')](_0x3c3dfa['body']);}})[_0x8bea('0x37')](respondWithResult(_0x5600d2,null))[_0x8bea('0x2d')](handleError(_0x5600d2,null));};exports[_0x8bea('0x6b')]=function(_0x198347,_0x2d46a5,_0x989cbf){var _0x475aa8={'raw':![],'where':{}};var _0x37c78b={};var _0x246b3b={'count':0x0,'rows':[]};return db[_0x8bea('0x45')][_0x8bea('0x6c')]({'where':{'id':_0x198347[_0x8bea('0x5f')]['id']}})[_0x8bea('0x37')](handleEntityNotFound(_0x2d46a5,null))[_0x8bea('0x37')](function(_0x17d207){if(_0x17d207){_0x37c78b[_0x8bea('0x4a')]=_['keys'](db[_0x8bea('0x69')][_0x8bea('0x46')]);_0x37c78b[_0x8bea('0x4b')]=_[_0x8bea('0x4c')](_0x198347[_0x8bea('0x4b')]);_0x37c78b[_0x8bea('0x4d')]=_[_0x8bea('0x4e')](_0x37c78b[_0x8bea('0x4a')],_0x37c78b[_0x8bea('0x4b')]);_0x475aa8[_0x8bea('0x50')]=_['intersection'](_0x37c78b['model'],qs[_0x8bea('0x4f')](_0x198347[_0x8bea('0x4b')]['fields']));_0x475aa8['attributes']=_0x475aa8[_0x8bea('0x50')]['length']?_0x475aa8[_0x8bea('0x50')]:_0x37c78b[_0x8bea('0x4a')];if(!_0x198347['query'][_0x8bea('0x52')](_0x8bea('0x53'))){_0x475aa8['limit']=qs['limit'](_0x198347[_0x8bea('0x4b')]['limit']);_0x475aa8['offset']=qs[_0x8bea('0x30')](_0x198347['query']['offset']);}_0x475aa8[_0x8bea('0x54')]=qs[_0x8bea('0x55')](_0x198347['query']['sort']);_0x475aa8[_0x8bea('0x56')]=qs[_0x8bea('0x4d')](_[_0x8bea('0x57')](_0x198347[_0x8bea('0x4b')],_0x37c78b['filters']));_0x475aa8['where'][_0x8bea('0x68')]=_0x17d207['id'];if(_0x198347[_0x8bea('0x4b')][_0x8bea('0x58')]){_0x475aa8[_0x8bea('0x56')]=_[_0x8bea('0x59')](_0x475aa8[_0x8bea('0x56')],{'$or':_['map'](_0x475aa8[_0x8bea('0x50')],function(_0x2cc730){var _0x2c3fca={};_0x2c3fca[_0x2cc730]={'$like':'%'+_0x198347[_0x8bea('0x4b')][_0x8bea('0x58')]+'%'};return _0x2c3fca;})});}_0x475aa8=_[_0x8bea('0x59')]({},_0x475aa8,_0x198347[_0x8bea('0x60')]);return db[_0x8bea('0x69')]['count']({'where':_0x475aa8['where']})[_0x8bea('0x37')](function(_0x50157b){_0x246b3b[_0x8bea('0x5a')]=_0x50157b;if(_0x198347[_0x8bea('0x4b')][_0x8bea('0x5b')]){_0x475aa8[_0x8bea('0x5c')]=[{'all':!![]}];}return db['Disposition'][_0x8bea('0x5d')](_0x475aa8);})[_0x8bea('0x37')](function(_0x4db508){_0x246b3b[_0x8bea('0x5e')]=_0x4db508;return _0x246b3b;});}})[_0x8bea('0x37')](respondWithFilteredResult(_0x2d46a5,_0x475aa8))['catch'](handleError(_0x2d46a5,null));};exports[_0x8bea('0x6d')]=function(_0x2df84d,_0x43fcc8,_0xbd6f65){return db[_0x8bea('0x45')][_0x8bea('0x61')]({'where':{'id':_0x2df84d[_0x8bea('0x5f')]['id']}})[_0x8bea('0x37')](handleEntityNotFound(_0x43fcc8,null))[_0x8bea('0x37')](function(_0x429504){if(_0x429504){return _0x429504[_0x8bea('0x6d')](_0x2df84d['query'][_0x8bea('0x6e')]);}})[_0x8bea('0x37')](respondWithStatusCode(_0x43fcc8,null))[_0x8bea('0x2d')](handleError(_0x43fcc8,null));};exports[_0x8bea('0x6f')]=function(_0x247e42,_0x291b86,_0x354b36){if(_0x247e42['body']['id']){delete _0x247e42[_0x8bea('0x63')]['id'];}return db[_0x8bea('0x45')][_0x8bea('0x61')]({'where':{'id':_0x247e42['params']['id']}})['then'](handleEntityNotFound(_0x291b86,null))[_0x8bea('0x37')](function(_0x429100){if(_0x429100){_0x247e42[_0x8bea('0x63')]['MailAccountId']=_0x429100['id'];return db[_0x8bea('0x70')]['create'](_0x247e42[_0x8bea('0x63')]);}})[_0x8bea('0x37')](respondWithResult(_0x291b86,null))[_0x8bea('0x2d')](handleError(_0x291b86,null));};exports[_0x8bea('0x71')]=function(_0x3906e8,_0x131535,_0x79698){var _0x5271fa={'raw':![],'where':{}};var _0x4023a1={};var _0x18ff5a={'count':0x0,'rows':[]};return db[_0x8bea('0x45')]['findOne']({'where':{'id':_0x3906e8[_0x8bea('0x5f')]['id']}})[_0x8bea('0x37')](handleEntityNotFound(_0x131535,null))[_0x8bea('0x37')](function(_0x181197){if(_0x181197){_0x4023a1[_0x8bea('0x4a')]=_[_0x8bea('0x4c')](db[_0x8bea('0x70')][_0x8bea('0x46')]);_0x4023a1['query']=_[_0x8bea('0x4c')](_0x3906e8[_0x8bea('0x4b')]);_0x4023a1[_0x8bea('0x4d')]=_[_0x8bea('0x4e')](_0x4023a1['model'],_0x4023a1[_0x8bea('0x4b')]);_0x5271fa[_0x8bea('0x50')]=_[_0x8bea('0x4e')](_0x4023a1[_0x8bea('0x4a')],qs[_0x8bea('0x4f')](_0x3906e8['query'][_0x8bea('0x4f')]));_0x5271fa[_0x8bea('0x50')]=_0x5271fa[_0x8bea('0x50')][_0x8bea('0x51')]?_0x5271fa[_0x8bea('0x50')]:_0x4023a1[_0x8bea('0x4a')];if(!_0x3906e8[_0x8bea('0x4b')]['hasOwnProperty'](_0x8bea('0x53'))){_0x5271fa['limit']=qs[_0x8bea('0x31')](_0x3906e8[_0x8bea('0x4b')][_0x8bea('0x31')]);_0x5271fa[_0x8bea('0x30')]=qs[_0x8bea('0x30')](_0x3906e8[_0x8bea('0x4b')]['offset']);}_0x5271fa['order']=qs[_0x8bea('0x55')](_0x3906e8['query'][_0x8bea('0x55')]);_0x5271fa[_0x8bea('0x56')]=qs[_0x8bea('0x4d')](_[_0x8bea('0x57')](_0x3906e8[_0x8bea('0x4b')],_0x4023a1['filters']));_0x5271fa[_0x8bea('0x56')][_0x8bea('0x68')]=_0x181197['id'];if(_0x3906e8[_0x8bea('0x4b')][_0x8bea('0x58')]){_0x5271fa['where']=_['merge'](_0x5271fa[_0x8bea('0x56')],{'$or':_[_0x8bea('0x44')](_0x5271fa[_0x8bea('0x50')],function(_0x3cf1f4){var _0x3e93a4={};_0x3e93a4[_0x3cf1f4]={'$like':'%'+_0x3906e8[_0x8bea('0x4b')]['filter']+'%'};return _0x3e93a4;})});}_0x5271fa=_['merge']({},_0x5271fa,_0x3906e8[_0x8bea('0x60')]);return db[_0x8bea('0x70')][_0x8bea('0x5a')]({'where':_0x5271fa[_0x8bea('0x56')]})['then'](function(_0x584fd5){_0x18ff5a[_0x8bea('0x5a')]=_0x584fd5;if(_0x3906e8[_0x8bea('0x4b')][_0x8bea('0x5b')]){_0x5271fa['include']=[{'all':!![]}];}return db[_0x8bea('0x70')]['findAll'](_0x5271fa);})['then'](function(_0x19a9ec){_0x18ff5a[_0x8bea('0x5e')]=_0x19a9ec;return _0x18ff5a;});}})['then'](respondWithFilteredResult(_0x131535,_0x5271fa))[_0x8bea('0x2d')](handleError(_0x131535,null));};exports[_0x8bea('0x72')]=function(_0x307fae,_0x60e237,_0x3e115f){return db[_0x8bea('0x45')][_0x8bea('0x61')]({'where':{'id':_0x307fae[_0x8bea('0x5f')]['id']}})['then'](handleEntityNotFound(_0x60e237,null))[_0x8bea('0x37')](function(_0xb9342){if(_0xb9342){return _0xb9342[_0x8bea('0x72')](_0x307fae[_0x8bea('0x4b')]['ids']);}})[_0x8bea('0x37')](respondWithStatusCode(_0x60e237,null))[_0x8bea('0x2d')](handleError(_0x60e237,null));};exports[_0x8bea('0x6a')]=function(_0x382320,_0x427274){var _0x157f30={'name':_0x382320[_0x8bea('0x63')][_0x8bea('0x3d')],'key':_0x382320['body'][_0x8bea('0x49')],'email':_0x382320[_0x8bea('0x63')][_0x8bea('0x73')],'ListId':_0x382320[_0x8bea('0x63')][_0x8bea('0x74')],'active':!_[_0x8bea('0x75')](_0x382320[_0x8bea('0x63')]['active'])?_0x382320[_0x8bea('0x63')][_0x8bea('0x76')]:!![],'description':_0x382320[_0x8bea('0x63')][_0x8bea('0x77')]||null,'Imap':{},'Smtp':{}};if(_[_0x8bea('0x75')](_0x382320[_0x8bea('0x63')][_0x8bea('0x78')])){if(_0x382320['body'][_0x8bea('0x79')]){_0x157f30[_0x8bea('0x64')][_0x8bea('0x7a')]=_0x157f30['Smtp']['user']=_0x382320['body'][_0x8bea('0x7b')];_0x157f30[_0x8bea('0x64')][_0x8bea('0x7c')]=_0x157f30[_0x8bea('0x41')]['pass']=_0x382320[_0x8bea('0x63')][_0x8bea('0x7d')];}else{_0x157f30[_0x8bea('0x64')][_0x8bea('0x7e')]=_0x157f30[_0x8bea('0x41')]['authentication']=![];}_0x157f30[_0x8bea('0x64')]['host']=_0x382320[_0x8bea('0x63')][_0x8bea('0x64')]['host'];_0x157f30[_0x8bea('0x64')]['port']=_0x382320[_0x8bea('0x63')][_0x8bea('0x64')][_0x8bea('0x7f')];_0x157f30[_0x8bea('0x41')][_0x8bea('0x80')]=_0x382320[_0x8bea('0x63')][_0x8bea('0x41')]['host'];_0x157f30[_0x8bea('0x41')][_0x8bea('0x7f')]=_0x382320['body'][_0x8bea('0x41')][_0x8bea('0x7f')];}else{_0x157f30[_0x8bea('0x64')][_0x8bea('0x81')]=_0x157f30[_0x8bea('0x41')][_0x8bea('0x81')]=_0x382320[_0x8bea('0x63')]['cservice'];_0x157f30['Imap']['user']=_0x157f30[_0x8bea('0x41')][_0x8bea('0x7a')]=_0x382320['body']['cuser'];_0x157f30[_0x8bea('0x64')][_0x8bea('0x7c')]=_0x157f30[_0x8bea('0x41')]['pass']=_0x382320[_0x8bea('0x63')][_0x8bea('0x7d')];}return db[_0x8bea('0x45')][_0x8bea('0x6a')](_0x157f30,{'include':[{'model':db[_0x8bea('0x65')],'as':_0x8bea('0x41')},{'model':db['MailServerIn'],'as':_0x8bea('0x64')}]})[_0x8bea('0x37')](function(_0x3c0c7e){var _0x32574e=_0x382320[_0x8bea('0x7a')][_0x8bea('0x38')]({'plain':!![]});if(!_0x32574e)throw new Error(_0x8bea('0x82'));if(_0x32574e['role']==='user'){var _0x6306bf=_0x3c0c7e['get']({'plain':!![]});return db[_0x8bea('0x83')][_0x8bea('0x61')]({'where':{'name':_0x8bea('0x84'),'userProfileId':_0x32574e['userProfileId']},'raw':!![]})[_0x8bea('0x37')](function(_0x2c8408){if(_0x2c8408&&_0x2c8408['autoAssociation']===0x0){return db[_0x8bea('0x39')][_0x8bea('0x6a')]({'name':_0x6306bf[_0x8bea('0x3d')],'resourceId':_0x6306bf['id'],'type':_0x2c8408[_0x8bea('0x3d')],'sectionId':_0x2c8408['id']},{})[_0x8bea('0x37')](function(){return _0x3c0c7e;});}else{return _0x3c0c7e;}})[_0x8bea('0x2d')](function(_0xce8792){logger[_0x8bea('0x29')](_0x8bea('0x85'),_0xce8792);throw _0xce8792;});}return _0x3c0c7e;})[_0x8bea('0x37')](respondWithResult(_0x427274,0xc9))[_0x8bea('0x2d')](handleError(_0x427274,null));};exports['getImap']=function(_0x49f640,_0x520f51,_0x4f2e22){return db[_0x8bea('0x45')]['findOne']({'where':{'id':_0x49f640['params']['id']}})['then'](handleEntityNotFound(_0x520f51,null))[_0x8bea('0x37')](function(_0x22b84){if(_0x22b84){return _0x22b84[_0x8bea('0x86')]();}return null;})[_0x8bea('0x37')](respondWithResult(_0x520f51,null))[_0x8bea('0x2d')](handleError(_0x520f51,null));};exports[_0x8bea('0x87')]=function(_0x52b7fe,_0x3330ac,_0x3c8362){if(_0x52b7fe[_0x8bea('0x63')]['id']){delete _0x52b7fe[_0x8bea('0x63')]['id'];}return db[_0x8bea('0x45')]['find']({'where':{'id':_0x52b7fe[_0x8bea('0x5f')]['id']}})[_0x8bea('0x37')](handleEntityNotFound(_0x3330ac,null))[_0x8bea('0x37')](function(_0x4bf1c7){if(_0x4bf1c7){_0x52b7fe[_0x8bea('0x63')][_0x8bea('0x68')]=_0x4bf1c7['id'];return db[_0x8bea('0x40')][_0x8bea('0x6a')](_0x52b7fe[_0x8bea('0x63')]);}})[_0x8bea('0x37')](respondWithResult(_0x3330ac,null))[_0x8bea('0x2d')](handleError(_0x3330ac,null));};exports[_0x8bea('0x88')]=function(_0x4875e8,_0x22eca2,_0x1a3b76){return db['MailAccount']['findOne']({'where':{'id':_0x4875e8[_0x8bea('0x5f')]['id']}})[_0x8bea('0x37')](handleEntityNotFound(_0x22eca2,null))[_0x8bea('0x37')](function(_0x58cc30){if(_0x58cc30){return _0x58cc30[_0x8bea('0x89')](null);}return null;})[_0x8bea('0x37')](respondWithStatusCode(_0x22eca2,null))['catch'](handleError(_0x22eca2,null));};exports[_0x8bea('0x8a')]=function(_0x160f43,_0x3656bc,_0x665807){return db['MailAccount'][_0x8bea('0x6c')]({'where':{'id':_0x160f43[_0x8bea('0x5f')]['id']}})[_0x8bea('0x37')](handleEntityNotFound(_0x3656bc,null))['then'](function(_0x341d76){if(_0x341d76){return _0x341d76['getSmtp']();}return null;})['then'](respondWithResult(_0x3656bc,null))['catch'](handleError(_0x3656bc,null));};exports[_0x8bea('0x8b')]=function(_0x52efb0,_0xb2be0a,_0x4f172d){if(_0x52efb0[_0x8bea('0x63')]['id']){delete _0x52efb0['body']['id'];}return db[_0x8bea('0x45')][_0x8bea('0x61')]({'where':{'id':_0x52efb0[_0x8bea('0x5f')]['id']}})[_0x8bea('0x37')](handleEntityNotFound(_0xb2be0a,null))[_0x8bea('0x37')](function(_0x4ee972){if(_0x4ee972){_0x52efb0[_0x8bea('0x63')][_0x8bea('0x68')]=_0x4ee972['id'];return db[_0x8bea('0x65')][_0x8bea('0x6a')](_0x52efb0[_0x8bea('0x63')]);}})[_0x8bea('0x37')](respondWithResult(_0xb2be0a,null))[_0x8bea('0x2d')](handleError(_0xb2be0a,null));};exports['removeSmtp']=function(_0x2d230d,_0x536586,_0x4b64b1){return db[_0x8bea('0x45')]['findOne']({'where':{'id':_0x2d230d[_0x8bea('0x5f')]['id']}})[_0x8bea('0x37')](handleEntityNotFound(_0x536586,null))[_0x8bea('0x37')](function(_0x5633a6){if(_0x5633a6){return _0x5633a6[_0x8bea('0x8c')](null);}return null;})[_0x8bea('0x37')](respondWithStatusCode(_0x536586,null))['catch'](handleError(_0x536586,null));};exports[_0x8bea('0x8d')]=function(_0x2cac61,_0x40064c,_0x52ea0c){return db['MailInteraction'][_0x8bea('0x61')]({'where':{'id':_0x2cac61[_0x8bea('0x5f')]['id']}})[_0x8bea('0x37')](handleEntityNotFound(_0x40064c,null))['then'](function(_0x35b9ed){if(_0x35b9ed){return _0x35b9ed['addInteraction'](_0x2cac61[_0x8bea('0x63')][_0x8bea('0x6e')],_['omit'](_0x2cac61[_0x8bea('0x63')],['ids','id'])||{});}})[_0x8bea('0x37')](respondWithResult(_0x40064c,null))[_0x8bea('0x2d')](handleError(_0x40064c,null));};exports[_0x8bea('0x8e')]=function(_0x36ec3e,_0x34e8a1,_0x16969b){var _0x48cc57={'raw':![],'where':{}};var _0x1e319a={};var _0x36fe39={'count':0x0,'rows':[]};return db[_0x8bea('0x45')][_0x8bea('0x6c')]({'where':{'id':_0x36ec3e[_0x8bea('0x5f')]['id']}})[_0x8bea('0x37')](handleEntityNotFound(_0x34e8a1,null))[_0x8bea('0x37')](function(_0xb82c09){if(_0xb82c09){_0x1e319a['model']=_['keys'](db[_0x8bea('0x8f')][_0x8bea('0x46')]);_0x1e319a['query']=_[_0x8bea('0x4c')](_0x36ec3e['query']);_0x1e319a[_0x8bea('0x4d')]=_[_0x8bea('0x4e')](_0x1e319a[_0x8bea('0x4a')],_0x1e319a[_0x8bea('0x4b')]);_0x48cc57['attributes']=_[_0x8bea('0x4e')](_0x1e319a[_0x8bea('0x4a')],qs[_0x8bea('0x4f')](_0x36ec3e[_0x8bea('0x4b')][_0x8bea('0x4f')]));_0x48cc57[_0x8bea('0x50')]=_0x48cc57[_0x8bea('0x50')][_0x8bea('0x51')]?_0x48cc57[_0x8bea('0x50')]:_0x1e319a[_0x8bea('0x4a')];if(!_0x36ec3e[_0x8bea('0x4b')][_0x8bea('0x52')]('nolimit')){_0x48cc57[_0x8bea('0x31')]=qs[_0x8bea('0x31')](_0x36ec3e[_0x8bea('0x4b')][_0x8bea('0x31')]);_0x48cc57[_0x8bea('0x30')]=qs[_0x8bea('0x30')](_0x36ec3e['query'][_0x8bea('0x30')]);}_0x48cc57[_0x8bea('0x54')]=qs[_0x8bea('0x55')](_0x36ec3e[_0x8bea('0x4b')]['sort']);_0x48cc57[_0x8bea('0x56')]=qs[_0x8bea('0x4d')](_[_0x8bea('0x57')](_0x36ec3e[_0x8bea('0x4b')],_0x1e319a[_0x8bea('0x4d')]));_0x48cc57[_0x8bea('0x56')][_0x8bea('0x68')]=_0xb82c09['id'];if(_0x36ec3e[_0x8bea('0x4b')]['filter']){_0x48cc57[_0x8bea('0x56')]=_['merge'](_0x48cc57[_0x8bea('0x56')],{'$or':_[_0x8bea('0x44')](_0x48cc57['attributes'],function(_0x40a669){var _0xc1ee13={};_0xc1ee13[_0x40a669]={'$like':'%'+_0x36ec3e['query'][_0x8bea('0x58')]+'%'};return _0xc1ee13;})});}_0x48cc57=_[_0x8bea('0x59')]({},_0x48cc57,_0x36ec3e['options']);return db['MailInteraction'][_0x8bea('0x5a')]({'where':_0x48cc57[_0x8bea('0x56')]})[_0x8bea('0x37')](function(_0x4b3d03){_0x36fe39[_0x8bea('0x5a')]=_0x4b3d03;if(_0x36ec3e['query'][_0x8bea('0x5b')]){_0x48cc57[_0x8bea('0x5c')]=[{'model':db[_0x8bea('0x90')],'as':'Contact','required':![]},{'model':db[_0x8bea('0x91')],'as':_0x8bea('0x92'),'attributes':['name',_0x8bea('0x93'),'internal'],'required':![]},{'model':db[_0x8bea('0x94')],'as':_0x8bea('0x95'),'attributes':['id','name',_0x8bea('0x96')],'where':_0x36ec3e[_0x8bea('0x4b')]['tag']?{'id':_0x36ec3e[_0x8bea('0x4b')][_0x8bea('0x97')]}:undefined,'required':_0x36ec3e['query'][_0x8bea('0x97')]?!![]:![]}];}return db['MailInteraction'][_0x8bea('0x5d')](_0x48cc57);})[_0x8bea('0x37')](function(_0x30d9ce){_0x36fe39[_0x8bea('0x5e')]=_0x30d9ce;return _0x36fe39;});}})['then'](respondWithFilteredResult(_0x34e8a1,_0x48cc57))[_0x8bea('0x2d')](handleError(_0x34e8a1,null));};exports[_0x8bea('0x98')]=function(_0x4b1847,_0x2abb8f,_0x48e126){return db[_0x8bea('0x45')][_0x8bea('0x6c')]({'where':{'id':_0x4b1847[_0x8bea('0x5f')]['id']}})[_0x8bea('0x37')](handleEntityNotFound(_0x2abb8f,null))['then'](function(_0x517d78){if(_0x517d78){return db['sequelize'][_0x8bea('0x99')](function(_0x5ca376){return db[_0x8bea('0x9a')]['destroy']({'where':{'MailAccountId':_0x4b1847[_0x8bea('0x5f')]['id']},'transaction':_0x5ca376})[_0x8bea('0x37')](function(_0x56dd9b){var _0x30ede2=_[_0x8bea('0x44')](_0x4b1847[_0x8bea('0x63')],function(_0x458e46){_0x458e46['MailAccountId']=_0x4b1847['params']['id'];return _0x458e46;});return db[_0x8bea('0x9a')]['bulkCreate'](_0x30ede2,{'transaction':_0x5ca376});});})[_0x8bea('0x37')](function(){return db['MailApplication']['findAndCountAll']({'where':{'MailAccountId':_0x4b1847[_0x8bea('0x5f')]['id']},'order':_0x8bea('0x9b')});});}})[_0x8bea('0x37')](respondWithResult(_0x2abb8f,null))[_0x8bea('0x2d')](handleError(_0x2abb8f,null));};exports['getApplications']=function(_0x4da8e1,_0x4359a4,_0x47277b){var _0x4f932a={};var _0x4d8172={};var _0x57b757;var _0x88b15f;return db[_0x8bea('0x45')][_0x8bea('0x6c')]({'where':{'id':_0x4da8e1[_0x8bea('0x5f')]['id']}})[_0x8bea('0x37')](handleEntityNotFound(_0x4359a4,null))[_0x8bea('0x37')](function(_0x31d908){if(_0x31d908){_0x57b757=_0x31d908;_0x4d8172[_0x8bea('0x4a')]=_[_0x8bea('0x4c')](db[_0x8bea('0x9a')]['rawAttributes']);_0x4d8172[_0x8bea('0x4b')]=_[_0x8bea('0x4c')](_0x4da8e1['query']);_0x4d8172[_0x8bea('0x4d')]=_[_0x8bea('0x4e')](_0x4d8172[_0x8bea('0x4a')],_0x4d8172[_0x8bea('0x4b')]);_0x4f932a['attributes']=_[_0x8bea('0x4e')](_0x4d8172[_0x8bea('0x4a')],qs[_0x8bea('0x4f')](_0x4da8e1[_0x8bea('0x4b')][_0x8bea('0x4f')]));_0x4f932a['attributes']=_0x4f932a[_0x8bea('0x50')]['length']?_0x4f932a['attributes']:_0x4d8172[_0x8bea('0x4a')];_0x4f932a[_0x8bea('0x54')]=qs[_0x8bea('0x55')](_0x4da8e1[_0x8bea('0x4b')]['sort']);_0x4f932a[_0x8bea('0x56')]=qs[_0x8bea('0x4d')](_['pick'](_0x4da8e1[_0x8bea('0x4b')],_0x4d8172['filters']));if(_0x4da8e1[_0x8bea('0x4b')]['filter']){_0x4f932a[_0x8bea('0x56')]=_[_0x8bea('0x59')](_0x4f932a['where'],{'$or':_[_0x8bea('0x44')](_0x4f932a[_0x8bea('0x50')],function(_0x1c9239){var _0x1f82da={};_0x1f82da[_0x1c9239]={'$like':'%'+_0x4da8e1[_0x8bea('0x4b')][_0x8bea('0x58')]+'%'};return _0x1f82da;})});}_0x4f932a=_[_0x8bea('0x59')]({},_0x4f932a,_0x4da8e1['options']);return _0x57b757[_0x8bea('0x9c')](_0x4f932a);}})[_0x8bea('0x37')](function(_0x2bbe5a){if(_0x2bbe5a){_0x88b15f=_0x2bbe5a[_0x8bea('0x51')];if(!_0x4da8e1['query'][_0x8bea('0x52')]('nolimit')){_0x4f932a[_0x8bea('0x31')]=qs['limit'](_0x4da8e1['query'][_0x8bea('0x31')]);_0x4f932a[_0x8bea('0x30')]=qs['offset'](_0x4da8e1[_0x8bea('0x4b')]['offset']);}return _0x57b757[_0x8bea('0x9c')](_0x4f932a);}})[_0x8bea('0x37')](function(_0x27de99){if(_0x27de99){return _0x27de99?{'count':_0x88b15f,'rows':_0x27de99}:null;}})[_0x8bea('0x37')](respondWithResult(_0x4359a4,null))['catch'](handleError(_0x4359a4,null));};exports[_0x8bea('0x9d')]=function(_0x51a3d7,_0x31b24a,_0x5cf6c8){var _0x551f84={'raw':!![],'where':{}};var _0x359873={};var _0x3d7845={'count':0x0,'rows':[]};return db[_0x8bea('0x45')][_0x8bea('0x6c')]({'where':{'id':_0x51a3d7[_0x8bea('0x5f')]['id']}})[_0x8bea('0x37')](handleEntityNotFound(_0x31b24a,null))[_0x8bea('0x37')](function(_0x3fc27a){if(_0x3fc27a){_0x359873[_0x8bea('0x4a')]=_[_0x8bea('0x4c')](db['MailMessage'][_0x8bea('0x46')]);_0x359873['query']=_['keys'](_0x51a3d7[_0x8bea('0x4b')]);_0x359873[_0x8bea('0x4d')]=_['intersection'](_0x359873[_0x8bea('0x4a')],_0x359873[_0x8bea('0x4b')]);_0x551f84[_0x8bea('0x50')]=_[_0x8bea('0x4e')](_0x359873['model'],qs[_0x8bea('0x4f')](_0x51a3d7['query']['fields']));_0x551f84['attributes']=_0x551f84[_0x8bea('0x50')][_0x8bea('0x51')]?_0x551f84[_0x8bea('0x50')]:_0x359873[_0x8bea('0x4a')];if(!_0x51a3d7[_0x8bea('0x4b')][_0x8bea('0x52')](_0x8bea('0x53'))){_0x551f84[_0x8bea('0x31')]=qs[_0x8bea('0x31')](_0x51a3d7['query'][_0x8bea('0x31')]);_0x551f84[_0x8bea('0x30')]=qs['offset'](_0x51a3d7['query'][_0x8bea('0x30')]);}_0x551f84[_0x8bea('0x54')]=qs[_0x8bea('0x55')](_0x51a3d7['query']['sort']);_0x551f84['where']=qs[_0x8bea('0x4d')](_[_0x8bea('0x57')](_0x51a3d7[_0x8bea('0x4b')],_0x359873[_0x8bea('0x4d')]));_0x551f84[_0x8bea('0x56')][_0x8bea('0x68')]=_0x3fc27a['id'];if(_0x51a3d7[_0x8bea('0x4b')][_0x8bea('0x58')]){_0x551f84[_0x8bea('0x56')]=_[_0x8bea('0x59')](_0x551f84[_0x8bea('0x56')],{'$or':_['map'](_0x551f84[_0x8bea('0x50')],function(_0x7bcd08){var _0x1ce951={};_0x1ce951[_0x7bcd08]={'$like':'%'+_0x51a3d7[_0x8bea('0x4b')][_0x8bea('0x58')]+'%'};return _0x1ce951;})});}if(_0x51a3d7[_0x8bea('0x4b')][_0x8bea('0x9e')]){var _0xd5d74a=_0x51a3d7[_0x8bea('0x4b')][_0x8bea('0x9e')]['split'](',');var _0x32f212={};_0x32f212[_0xd5d74a[0x0]]={'$gte':moment(_0xd5d74a[0x1])['format']('YYYY-MM-DD\x20HH:mm:ss')};_0x551f84[_0x8bea('0x56')]=_[_0x8bea('0x59')](_0x551f84[_0x8bea('0x56')],_0x32f212);}_0x551f84=_[_0x8bea('0x59')]({},_0x551f84,_0x51a3d7['options']);return db[_0x8bea('0x9f')][_0x8bea('0x5a')]({'where':_0x551f84['where']})[_0x8bea('0x37')](function(_0x4dbb27){_0x3d7845[_0x8bea('0x5a')]=_0x4dbb27;if(_0x51a3d7['query']['includeAll']){_0x551f84[_0x8bea('0x5c')]=[{'all':!![]}];}return db['MailMessage']['findAll'](_0x551f84);})[_0x8bea('0x37')](function(_0x1ff2a2){_0x3d7845[_0x8bea('0x5e')]=_0x1ff2a2;return _0x3d7845;});}})['then'](respondWithFilteredResult(_0x31b24a,_0x551f84))[_0x8bea('0x2d')](handleError(_0x31b24a,null));};exports[_0x8bea('0x3e')]=function(_0x13a0d7,_0xcf1db3,_0x2bade9){var _0x173ba4,_0x222b3b={},_0x4a7576;if(_0x13a0d7['body']['to']){_0x4a7576=_0x13a0d7[_0x8bea('0x63')]['to'][_0x8bea('0xa0')](',')[0x0];}return db[_0x8bea('0x45')]['find']({'where':{'id':_0x13a0d7['params']['id']},'include':[{'model':db['CmList'],'as':_0x8bea('0xa1'),'include':[{'model':db[_0x8bea('0x90')],'as':_0x8bea('0xa2'),'where':{'email':_0x4a7576},'limit':0x1,'order':[[_0x8bea('0xa3'),_0x8bea('0xa4')]]}]},{'model':db['MailServerOut'],'as':_0x8bea('0x41'),'raw':!![]}]})[_0x8bea('0x37')](handleEntityNotFound(_0xcf1db3,null))[_0x8bea('0x37')](function(_0x431fee){if(_0x431fee){_0x173ba4=_0x431fee;if(_0x431fee[_0x8bea('0x41')]){if(_[_0x8bea('0x75')](_0x13a0d7['body'][_0x8bea('0xa5')])){_0x13a0d7[_0x8bea('0x63')][_0x8bea('0xa5')]=util[_0x8bea('0xa6')](_0x8bea('0xa7'),_0x431fee[_0x8bea('0x3d')],_0x431fee['email']||_0x431fee['Smtp']['user']);}if(_0x13a0d7[_0x8bea('0x63')][_0x8bea('0xa8')]&&_0x13a0d7[_0x8bea('0x63')][_0x8bea('0xa8')][_0x8bea('0x51')]){for(var _0x54f7ef=0x0;_0x54f7ef<_0x13a0d7[_0x8bea('0x63')][_0x8bea('0xa8')][_0x8bea('0x51')];_0x54f7ef+=0x1){_0x13a0d7[_0x8bea('0x63')][_0x8bea('0xa8')][_0x54f7ef]={'filename':_0x13a0d7[_0x8bea('0x63')][_0x8bea('0xa8')][_0x54f7ef][_0x8bea('0x3d')],'path':path[_0x8bea('0xa9')](config[_0x8bea('0xaa')],_0x8bea('0xab'),_0x13a0d7[_0x8bea('0x63')][_0x8bea('0xa8')][_0x54f7ef]['basename'])};}}var _0x351bd1={'tls':{'rejectUnauthorized':![]}};if(_[_0x8bea('0x75')](_0x431fee['Smtp'][_0x8bea('0x81')])){if(_0x431fee['Smtp'][_0x8bea('0x7e')]){_0x351bd1['auth']={'user':_0x431fee['Smtp'][_0x8bea('0x7a')],'pass':_0x431fee['Smtp'][_0x8bea('0xac')]};}_0x351bd1[_0x8bea('0x80')]=_0x431fee[_0x8bea('0x41')][_0x8bea('0x80')];_0x351bd1[_0x8bea('0x7f')]=_0x431fee[_0x8bea('0x41')][_0x8bea('0x7f')];_0x351bd1[_0x8bea('0xad')]=_0x431fee['Smtp'][_0x8bea('0xad')];}else{_0x351bd1[_0x8bea('0x81')]=_0x431fee[_0x8bea('0x41')][_0x8bea('0x81')];_0x351bd1[_0x8bea('0xae')]={'user':_0x431fee[_0x8bea('0x41')][_0x8bea('0x7a')],'pass':_0x431fee['Smtp'][_0x8bea('0xac')]};}return respondWithRpcPromise(_0x8bea('0xaf'),_0x8bea('0xb0'),{'account':_0x351bd1,'message':_0x13a0d7[_0x8bea('0x63')]});}else{throw new Error(_0x8bea('0xb1'));}}})[_0x8bea('0x37')](function(_0x9857b0){if(_0x9857b0){_0x222b3b=_0x9857b0;if(_0x173ba4['List']){if(_0x173ba4[_0x8bea('0xa1')][_0x8bea('0xa2')][_0x8bea('0x51')]){return _0x173ba4['List'][_0x8bea('0xa2')][0x0];}else{return db[_0x8bea('0x90')]['create'](_[_0x8bea('0x1b')](_0x13a0d7[_0x8bea('0x63')],{'firstName':_0x13a0d7[_0x8bea('0x63')]['to'],'email':_0x13a0d7['body']['to'],'phone':_0x13a0d7[_0x8bea('0x63')]['to'],'ListId':_0x173ba4[_0x8bea('0x74')]}));}}else{throw new Error(_0x8bea('0xb1'));}}})[_0x8bea('0x37')](function(_0x5e98c6){if(_0x5e98c6){var _0x4613c4={'UserId':_0x13a0d7[_0x8bea('0x7a')]['id'],'ContactId':_0x5e98c6['id'],'MailAccountId':_0x173ba4['id'],'inReplyTo':_0x222b3b[_0x8bea('0xb2')],'to':_0x13a0d7['body'][_0x8bea('0xa5')],'cc':_0x13a0d7[_0x8bea('0x63')]['cc'],'subject':_0x13a0d7[_0x8bea('0x63')]['subject'],'attach':_0x13a0d7[_0x8bea('0x63')][_0x8bea('0xb3')],'firstMsgDirection':'out','lastMsgAt':moment()[_0x8bea('0xa6')](_0x8bea('0xb4')),'lastMsgDirection':_0x8bea('0xb5'),'lastMsgBody':_0x13a0d7[_0x8bea('0x63')][_0x8bea('0x63')],'Messages':[_['merge'](_0x13a0d7[_0x8bea('0x63')],{'messageId':_0x222b3b[_0x8bea('0xb2')],'sentAt':moment()[_0x8bea('0xa6')]('YYYY-MM-DD\x20HH:mm:ss'),'read':!![],'MailAccountId':_0x173ba4['id'],'UserId':_0x13a0d7[_0x8bea('0x7a')]['id'],'ContactId':_0x5e98c6['id']})]};if(_0x13a0d7[_0x8bea('0x63')][_0x8bea('0xb6')]){_0x4613c4=_[_0x8bea('0x59')](_0x4613c4,_0x13a0d7[_0x8bea('0x63')]['Interaction']);}return db[_0x8bea('0x8f')]['create'](_0x4613c4,{'include':[{'model':db[_0x8bea('0x9f')],'as':_0x8bea('0xb7')}]});}})['then'](respondWithResult(_0xcf1db3,null))[_0x8bea('0x2d')](handleError(_0xcf1db3,null));};exports[_0x8bea('0xb8')]=function(_0x1bb6c4,_0x8b8e73,_0x48c821){return db[_0x8bea('0x45')][_0x8bea('0x61')]({'where':{'id':_0x1bb6c4[_0x8bea('0x5f')]['id']},'include':[{'model':db[_0x8bea('0x65')],'as':_0x8bea('0x41'),'raw':!![]}]})[_0x8bea('0x37')](handleEntityNotFound(_0x8b8e73,null))[_0x8bea('0x37')](function(_0x460e15){if(_0x460e15&&_0x460e15[_0x8bea('0x41')]){var _0x41bb02={'id':_0x460e15['id'],'tls':{'rejectUnauthorized':![]}};if(_0x460e15[_0x8bea('0x41')][_0x8bea('0x81')]){_0x41bb02[_0x8bea('0x81')]=_0x460e15[_0x8bea('0x41')]['service'];}else{_0x41bb02[_0x8bea('0x80')]=_0x460e15[_0x8bea('0x41')]['host'];_0x41bb02[_0x8bea('0x7f')]=_0x460e15[_0x8bea('0x41')][_0x8bea('0x7f')];_0x41bb02['secure']=_0x460e15[_0x8bea('0x41')][_0x8bea('0xad')];}if(_0x460e15[_0x8bea('0x41')][_0x8bea('0x7e')]){_0x41bb02['auth']={'user':_0x460e15[_0x8bea('0x41')][_0x8bea('0x7a')],'pass':_0x460e15[_0x8bea('0x41')][_0x8bea('0xac')]};}return respondWithRpcPromise('VerifySmtp','verifySmtp',{'account':_0x41bb02});}})[_0x8bea('0x37')](respondWithResult(_0x8b8e73,null))['catch'](handleError(_0x8b8e73,null));};exports[_0x8bea('0x3a')]=function(_0x33bcbd,_0x3ab82a){return db['MailAccount'][_0x8bea('0x61')]({'where':{'id':_0x33bcbd[_0x8bea('0x5f')]['id']}})[_0x8bea('0x37')](handleEntityNotFound(_0x3ab82a,null))[_0x8bea('0x37')](function(_0x422ee7){if(_0x422ee7&&_0x422ee7[_0x8bea('0x81')]){throw new db[(_0x8bea('0xb9'))][(_0x8bea('0x21'))](_0x8bea('0xba'));}return _0x422ee7;})[_0x8bea('0x37')](removeEntity(_0x3ab82a,null))[_0x8bea('0x2d')](handleError(_0x3ab82a,null));};exports['addAgents']=function(_0x8ac781,_0x13c274,_0xea730){return db[_0x8bea('0x45')]['find']({'where':{'id':_0x8ac781[_0x8bea('0x5f')]['id']}})[_0x8bea('0x37')](handleEntityNotFound(_0x13c274,null))[_0x8bea('0x37')](function(_0x2ebdd2){if(_0x2ebdd2){return _0x2ebdd2[_0x8bea('0xbb')](_0x8ac781[_0x8bea('0x63')][_0x8bea('0x6e')],_[_0x8bea('0xbc')](_0x8ac781[_0x8bea('0x63')],[_0x8bea('0x6e'),'id'])||{})['spread'](function(_0x267fa5){for(var _0x2ba7c1=0x0;_0x2ba7c1<_0x8ac781['body'][_0x8bea('0x6e')][_0x8bea('0x51')];_0x2ba7c1+=0x1){socket[_0x8bea('0xbd')](_0x8bea('0xbe'),{'UserId':_0x8ac781['body'][_0x8bea('0x6e')][_0x2ba7c1],'MailAccountId':_0x8ac781[_0x8bea('0x5f')]['id']});}return _0x267fa5;});}})[_0x8bea('0x37')](respondWithResult(_0x13c274,null))[_0x8bea('0x2d')](handleError(_0x13c274,null));};exports[_0x8bea('0xbf')]=function(_0x48c276,_0x1264ea,_0x5879a1){return db[_0x8bea('0x45')]['find']({'where':{'id':_0x48c276[_0x8bea('0x5f')]['id']}})[_0x8bea('0x37')](handleEntityNotFound(_0x1264ea,null))[_0x8bea('0x37')](function(_0x2f0011){if(_0x2f0011){return _0x2f0011['removeAgents'](_0x48c276[_0x8bea('0x4b')]['ids'])[_0x8bea('0x37')](function(){if(_['isArray'](_0x48c276[_0x8bea('0x4b')]['ids'])){for(var _0x246fc7=0x0;_0x246fc7<_0x48c276[_0x8bea('0x4b')][_0x8bea('0x6e')]['length'];_0x246fc7+=0x1){socket[_0x8bea('0xbd')](_0x8bea('0xc0'),{'UserId':Number(_0x48c276[_0x8bea('0x4b')]['ids'][_0x246fc7]),'MailAccountId':Number(_0x48c276[_0x8bea('0x5f')]['id'])});}}else{socket[_0x8bea('0xbd')](_0x8bea('0xc0'),{'UserId':Number(_0x48c276[_0x8bea('0x4b')]['ids']),'MailAccountId':Number(_0x48c276[_0x8bea('0x5f')]['id'])});}});}})[_0x8bea('0x37')](respondWithStatusCode(_0x1264ea,null))[_0x8bea('0x2d')](handleError(_0x1264ea,null));};exports[_0x8bea('0xc1')]=function(_0x34fb94,_0x202b05,_0x3c3cdd){var _0x34c14a={};var _0x5e4a64={};var _0x39c7b5;var _0x3e06e6;return db[_0x8bea('0x45')][_0x8bea('0x6c')]({'where':{'id':_0x34fb94[_0x8bea('0x5f')]['id']}})[_0x8bea('0x37')](handleEntityNotFound(_0x202b05,null))[_0x8bea('0x37')](function(_0x20eaf3){if(_0x20eaf3){_0x39c7b5=_0x20eaf3;_0x5e4a64['model']=_['keys'](db[_0x8bea('0x91')][_0x8bea('0x46')]);_0x5e4a64[_0x8bea('0x4b')]=_['keys'](_0x34fb94[_0x8bea('0x4b')]);_0x5e4a64[_0x8bea('0x4d')]=_[_0x8bea('0x4e')](_0x5e4a64[_0x8bea('0x4a')],_0x5e4a64[_0x8bea('0x4b')]);_0x34c14a[_0x8bea('0x50')]=_[_0x8bea('0x4e')](_0x5e4a64[_0x8bea('0x4a')],qs[_0x8bea('0x4f')](_0x34fb94['query'][_0x8bea('0x4f')]));_0x34c14a['attributes']=_0x34c14a['attributes'][_0x8bea('0x51')]?_0x34c14a[_0x8bea('0x50')]:_0x5e4a64[_0x8bea('0x4a')];_0x34c14a[_0x8bea('0x54')]=qs[_0x8bea('0x55')](_0x34fb94[_0x8bea('0x4b')]['sort']);_0x34c14a[_0x8bea('0x56')]=qs['filters'](_[_0x8bea('0x57')](_0x34fb94[_0x8bea('0x4b')],_0x5e4a64['filters']));if(_0x34fb94[_0x8bea('0x4b')][_0x8bea('0x58')]){_0x34c14a['where']=_[_0x8bea('0x59')](_0x34c14a[_0x8bea('0x56')],{'$or':_[_0x8bea('0x44')](_0x34c14a[_0x8bea('0x50')],function(_0x534b08){var _0x5da980={};_0x5da980[_0x534b08]={'$like':'%'+_0x34fb94[_0x8bea('0x4b')][_0x8bea('0x58')]+'%'};return _0x5da980;})});}_0x34c14a=_[_0x8bea('0x59')]({},_0x34c14a,_0x34fb94[_0x8bea('0x60')]);return _0x39c7b5['getAgents'](_0x34c14a);}})[_0x8bea('0x37')](function(_0x440154){if(_0x440154){_0x3e06e6=_0x440154[_0x8bea('0x51')];if(!_0x34fb94[_0x8bea('0x4b')][_0x8bea('0x52')](_0x8bea('0x53'))){_0x34c14a['limit']=qs[_0x8bea('0x31')](_0x34fb94['query']['limit']);_0x34c14a[_0x8bea('0x30')]=qs[_0x8bea('0x30')](_0x34fb94[_0x8bea('0x4b')][_0x8bea('0x30')]);}return _0x39c7b5[_0x8bea('0xc1')](_0x34c14a);}})[_0x8bea('0x37')](function(_0x3292b2){if(_0x3292b2){return _0x3292b2?{'count':_0x3e06e6,'rows':_0x3292b2}:null;}})[_0x8bea('0x37')](respondWithResult(_0x202b05,null))[_0x8bea('0x2d')](handleError(_0x202b05,null));};
\ No newline at end of file
+var _0xfb51=['getInteractions','Contact','Owner','fullname','internal','Tag','Tags','tag','addApplications','MailApplication','findAndCountAll','priority','getApplications','getMessages','MailMessage','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','List','CmContact','Contacts','updatedAt','DESC','from','%s\x20<%s>','email','attachments','join','server/files/attachments','basename','auth','secure','SendMail','sendMail','List\x20not\x20found','messageId','attach','out','Interaction','Messages','verifySmtp','VerifySmtp','ValidationError','You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account','addAgents','spread','emit','userMailAccount:save','removeAgents','isArray','userMailAccount:remove','getAgents','User','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','to-csv','ejs','lodash','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','register','client','http','test','Sequelize','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','MailAccount,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','sendStatus','status','end','json','count','offset','set','Content-Range','save','update','MailAccounts','destroy','name','send','index','MailServerIn','Pause','map','MailAccount','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','limit','order','sort','where','pick','merge','options','includeAll','include','rows','show','MailServerOut','Smtp','mandatoryDispositionPause','find','body','params','Imap','describe','addDisposition','MailAccountId','Disposition','getDispositions','rawAttributes','length','filter','ids','CannedAnswer','create','getAnswers','findOne','findAll','removeAnswers','isNil','active','description','cservice','cauthentication','user','password','pass','authentication','host','port','service','cuser','cpassword','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getImap','addImap','setImap','getSmtp','removeSmtp','addInteraction','MailInteraction','omit'];(function(_0x270457,_0x5f0a64){var _0xea82bc=function(_0xfb7dfc){while(--_0xfb7dfc){_0x270457['push'](_0x270457['shift']());}};_0xea82bc(++_0x5f0a64);}(_0xfb51,0xf5));var _0x1fb5=function(_0xd73239,_0x488346){_0xd73239=_0xd73239-0x0;var _0x41cee6=_0xfb51[_0xd73239];return _0x41cee6;};'use strict';var pdf=require(_0x1fb5('0x0'));var emlformat=require(_0x1fb5('0x1'));var rimraf=require(_0x1fb5('0x2'));var zipdir=require(_0x1fb5('0x3'));var jsonpatch=require(_0x1fb5('0x4'));var rp=require(_0x1fb5('0x5'));var moment=require(_0x1fb5('0x6'));var BPromise=require(_0x1fb5('0x7'));var Mustache=require(_0x1fb5('0x8'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x1fb5('0x9'));var ejs=require(_0x1fb5('0xa'));var fs=require('fs');var _=require(_0x1fb5('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x1fb5('0xc'));var deskjs=require(_0x1fb5('0xd'));var toCsv=require(_0x1fb5('0x9'));var querystring=require(_0x1fb5('0xe'));var Papa=require(_0x1fb5('0xf'));var Redis=require('ioredis');var authService=require(_0x1fb5('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x1fb5('0x11'));var hardwareService=require(_0x1fb5('0x12'));var logger=require(_0x1fb5('0x13'))(_0x1fb5('0x14'));var utils=require(_0x1fb5('0x15'));var config=require(_0x1fb5('0x16'));var db=require(_0x1fb5('0x17'))['db'];config[_0x1fb5('0x18')]=_[_0x1fb5('0x19')](config['redis'],{'host':_0x1fb5('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x1fb5('0x18')]));require('./mailAccount.socket')[_0x1fb5('0x1b')](socket);var jayson=require('jayson/promise');var client=jayson[_0x1fb5('0x1c')][_0x1fb5('0x1d')]({'port':0x232b});function checkPasswordPattern(_0x1c9cc8,_0x32f236,_0x46357b){if(_0x46357b){var _0x588f8e=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x588f8e[_0x1fb5('0x1e')](_0x32f236)){return _0x1c9cc8;}else{throw new db[(_0x1fb5('0x1f'))]['ValidationError'](_0x1fb5('0x20'));}}else{return _0x1c9cc8;}}function respondWithRpcPromise(_0x261418,_0x5df8e4,_0x349fe1,_0x3d520b){return new BPromise(function(_0x1fea62,_0x4465b7){var _0xf673d1=_0x3d520b||client;return _0xf673d1[_0x1fb5('0x21')](_0x261418,_0x349fe1)[_0x1fb5('0x22')](function(_0x110f49){logger[_0x1fb5('0x23')](_0x1fb5('0x24'),_0x5df8e4,'request\x20sent');logger[_0x1fb5('0x25')]('MailAccount,\x20%s,\x20%s,\x20%s',_0x5df8e4,_0x1fb5('0x26'),JSON[_0x1fb5('0x27')](_0x110f49));if(_0x110f49[_0x1fb5('0x28')]){if(_0x110f49[_0x1fb5('0x28')][_0x1fb5('0x29')]===0x1f4){logger[_0x1fb5('0x28')](_0x1fb5('0x24'),_0x5df8e4,_0x110f49[_0x1fb5('0x28')]['message']);return _0x4465b7(_0x110f49[_0x1fb5('0x28')][_0x1fb5('0x2a')]);}logger[_0x1fb5('0x28')]('MailAccount,\x20%s,\x20%s',_0x5df8e4,_0x110f49['error'][_0x1fb5('0x2a')]);return _0x1fea62(_0x110f49[_0x1fb5('0x28')][_0x1fb5('0x2a')]);}else{logger[_0x1fb5('0x23')](_0x1fb5('0x24'),_0x5df8e4,_0x1fb5('0x26'));_0x1fea62(_0x110f49[_0x1fb5('0x2b')]['message']);}})[_0x1fb5('0x2c')](function(_0x1b8d02){logger[_0x1fb5('0x28')](_0x1fb5('0x24'),_0x5df8e4,_0x1b8d02);_0x4465b7(_0x1b8d02);});});}function respondWithStatusCode(_0x542c06,_0x2fa29e){_0x2fa29e=_0x2fa29e||0xcc;return function(_0x5b1f53){if(_0x5b1f53){return _0x542c06[_0x1fb5('0x2d')](_0x2fa29e);}return _0x542c06[_0x1fb5('0x2e')](_0x2fa29e)[_0x1fb5('0x2f')]();};}function respondWithResult(_0x50f4fe,_0x36ceda){_0x36ceda=_0x36ceda||0xc8;return function(_0x36be0e){if(_0x36be0e){return _0x50f4fe[_0x1fb5('0x2e')](_0x36ceda)[_0x1fb5('0x30')](_0x36be0e);}};}function respondWithFilteredResult(_0x17c7ad,_0x2ba787){return function(_0x1d74d4){if(_0x1d74d4){var _0x362395=_0x1d74d4[_0x1fb5('0x31')],_0x6c9346=_0x2ba787[_0x1fb5('0x32')],_0xfc928f=_0x2ba787[_0x1fb5('0x32')]+_0x2ba787['limit'],_0xdca460;if(_0xfc928f>=_0x362395){_0xfc928f=_0x362395;_0xdca460=0xc8;}else{_0xdca460=0xce;}_0x17c7ad['status'](_0xdca460);return _0x17c7ad[_0x1fb5('0x33')](_0x1fb5('0x34'),_0x6c9346+'-'+_0xfc928f+'/'+_0x362395)[_0x1fb5('0x30')](_0x1d74d4);}return null;};}function patchUpdates(_0x4ca038){return function(_0x381f7b){try{jsonpatch['apply'](_0x381f7b,_0x4ca038,!![]);}catch(_0x2800b7){return BPromise['reject'](_0x2800b7);}return _0x381f7b[_0x1fb5('0x35')]();};}function saveUpdates(_0x307771,_0x4df561){return function(_0x2d09f0){if(_0x2d09f0){return _0x2d09f0[_0x1fb5('0x36')](_0x307771)[_0x1fb5('0x22')](function(_0x53efe7){return _0x53efe7;});}return null;};}function removeEntity(_0x1e067e,_0x34e63d){return function(_0x46636c){if(_0x46636c){return _0x46636c['destroy']()['then'](function(){var _0x16c01e=_0x46636c['get']({'plain':!![]});var _0x37488b=_0x1fb5('0x37');return db['UserProfileResource'][_0x1fb5('0x38')]({'where':{'type':_0x37488b,'resourceId':_0x16c01e['id']}})[_0x1fb5('0x22')](function(){return _0x46636c;});})[_0x1fb5('0x22')](function(){_0x1e067e[_0x1fb5('0x2e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4b777b,_0x1d0ab5){return function(_0xf39653){if(!_0xf39653){_0x4b777b[_0x1fb5('0x2d')](0x194);}return _0xf39653;};}function handleError(_0x2d4e97,_0x37e255){_0x37e255=_0x37e255||0x1f4;return function(_0x26b57e){logger[_0x1fb5('0x28')](_0x26b57e['stack']);if(_0x26b57e['name']){delete _0x26b57e[_0x1fb5('0x39')];}_0x2d4e97[_0x1fb5('0x2e')](_0x37e255)[_0x1fb5('0x3a')](_0x26b57e);};}exports[_0x1fb5('0x3b')]=function(_0x30f71f,_0x54c65e){var _0x42716c={'include':[{'model':db[_0x1fb5('0x3c')],'as':'Imap'},{'model':db['MailServerOut'],'as':'Smtp'},{'model':db[_0x1fb5('0x3d')],'as':'mandatoryDispositionPause'}]},_0x22b44f={},_0x206f94={'count':0x0,'rows':[]};var _0x2a258a=_[_0x1fb5('0x3e')](db[_0x1fb5('0x3f')]['rawAttributes'],function(_0x1fc332){return{'name':_0x1fc332['fieldName'],'type':_0x1fc332[_0x1fb5('0x40')][_0x1fb5('0x41')]};});_0x22b44f[_0x1fb5('0x42')]=_[_0x1fb5('0x3e')](_0x2a258a,_0x1fb5('0x39'));_0x22b44f[_0x1fb5('0x43')]=_[_0x1fb5('0x44')](_0x30f71f[_0x1fb5('0x43')]);_0x22b44f[_0x1fb5('0x45')]=_[_0x1fb5('0x46')](_0x22b44f[_0x1fb5('0x42')],_0x22b44f['query']);_0x42716c[_0x1fb5('0x47')]=_[_0x1fb5('0x46')](_0x22b44f[_0x1fb5('0x42')],qs[_0x1fb5('0x48')](_0x30f71f[_0x1fb5('0x43')]['fields']));_0x42716c[_0x1fb5('0x47')]=_0x42716c[_0x1fb5('0x47')]['length']?_0x42716c[_0x1fb5('0x47')]:_0x22b44f[_0x1fb5('0x42')];if(!_0x30f71f[_0x1fb5('0x43')][_0x1fb5('0x49')](_0x1fb5('0x4a'))){_0x42716c[_0x1fb5('0x4b')]=qs['limit'](_0x30f71f[_0x1fb5('0x43')][_0x1fb5('0x4b')]);_0x42716c[_0x1fb5('0x32')]=qs[_0x1fb5('0x32')](_0x30f71f[_0x1fb5('0x43')][_0x1fb5('0x32')]);}_0x42716c[_0x1fb5('0x4c')]=qs[_0x1fb5('0x4d')](_0x30f71f[_0x1fb5('0x43')][_0x1fb5('0x4d')]);_0x42716c[_0x1fb5('0x4e')]=qs[_0x1fb5('0x45')](_[_0x1fb5('0x4f')](_0x30f71f[_0x1fb5('0x43')],_0x22b44f[_0x1fb5('0x45')]),_0x2a258a);if(_0x30f71f[_0x1fb5('0x43')]['filter']){_0x42716c['where']=_['merge'](_0x42716c[_0x1fb5('0x4e')],{'$or':_[_0x1fb5('0x3e')](_0x2a258a,function(_0x2c95d1){if(_0x2c95d1[_0x1fb5('0x40')]!=='VIRTUAL'){var _0x524bd0={};_0x524bd0[_0x2c95d1[_0x1fb5('0x39')]]={'$like':'%'+_0x30f71f[_0x1fb5('0x43')]['filter']+'%'};return _0x524bd0;}})});}_0x42716c=_[_0x1fb5('0x50')]({},_0x42716c,_0x30f71f[_0x1fb5('0x51')]);var _0x23dff6={'where':_0x42716c[_0x1fb5('0x4e')]};return db['MailAccount'][_0x1fb5('0x31')](_0x23dff6)[_0x1fb5('0x22')](function(_0x46b5c7){_0x206f94[_0x1fb5('0x31')]=_0x46b5c7;if(_0x30f71f[_0x1fb5('0x43')][_0x1fb5('0x52')]){_0x42716c[_0x1fb5('0x53')]=[{'all':!![]}];}return db[_0x1fb5('0x3f')]['findAll'](_0x42716c);})[_0x1fb5('0x22')](function(_0x2a937f){_0x206f94[_0x1fb5('0x54')]=_0x2a937f;return _0x206f94;})[_0x1fb5('0x22')](respondWithFilteredResult(_0x54c65e,_0x42716c))[_0x1fb5('0x2c')](handleError(_0x54c65e,null));};exports[_0x1fb5('0x55')]=function(_0x45f496,_0x4003d9){var _0x74a7f7={'raw':![],'where':{'id':_0x45f496['params']['id']},'include':[{'model':db[_0x1fb5('0x3c')],'as':'Imap'},{'model':db[_0x1fb5('0x56')],'as':_0x1fb5('0x57')},{'model':db[_0x1fb5('0x3d')],'as':_0x1fb5('0x58')}]},_0x2095d8={};_0x2095d8[_0x1fb5('0x42')]=_[_0x1fb5('0x44')](db[_0x1fb5('0x3f')]['rawAttributes']);_0x2095d8[_0x1fb5('0x43')]=_[_0x1fb5('0x44')](_0x45f496[_0x1fb5('0x43')]);_0x2095d8['filters']=_[_0x1fb5('0x46')](_0x2095d8[_0x1fb5('0x42')],_0x2095d8['query']);_0x74a7f7[_0x1fb5('0x47')]=_[_0x1fb5('0x46')](_0x2095d8[_0x1fb5('0x42')],qs[_0x1fb5('0x48')](_0x45f496[_0x1fb5('0x43')]['fields']));_0x74a7f7['attributes']=_0x74a7f7[_0x1fb5('0x47')]['length']?_0x74a7f7['attributes']:_0x2095d8[_0x1fb5('0x42')];if(_0x45f496['query'][_0x1fb5('0x52')]){_0x74a7f7['include']=[{'all':!![]}];}_0x74a7f7=_[_0x1fb5('0x50')]({},_0x74a7f7,_0x45f496[_0x1fb5('0x51')]);return db[_0x1fb5('0x3f')][_0x1fb5('0x59')](_0x74a7f7)[_0x1fb5('0x22')](handleEntityNotFound(_0x4003d9,null))[_0x1fb5('0x22')](respondWithResult(_0x4003d9,null))[_0x1fb5('0x2c')](handleError(_0x4003d9,null));};exports['update']=function(_0x472ff1,_0x32d794){if(_0x472ff1[_0x1fb5('0x5a')]['id']){delete _0x472ff1[_0x1fb5('0x5a')]['id'];}return db[_0x1fb5('0x3f')]['find']({'where':{'id':_0x472ff1[_0x1fb5('0x5b')]['id']},'include':[{'model':db[_0x1fb5('0x3c')],'as':_0x1fb5('0x5c')},{'model':db[_0x1fb5('0x56')],'as':_0x1fb5('0x57')},{'model':db['Pause'],'as':_0x1fb5('0x58')}]})[_0x1fb5('0x22')](handleEntityNotFound(_0x32d794,null))[_0x1fb5('0x22')](saveUpdates(_0x472ff1[_0x1fb5('0x5a')],null))[_0x1fb5('0x22')](function(_0x481629){if(_0x481629&&_0x472ff1[_0x1fb5('0x5a')][_0x1fb5('0x5c')]){return db[_0x1fb5('0x3c')]['update'](_0x472ff1[_0x1fb5('0x5a')][_0x1fb5('0x5c')],{'where':{'MailAccountId':_0x481629['id']}})['then'](function(){return _0x481629;});}return _0x481629;})[_0x1fb5('0x22')](function(_0xd15f5f){if(_0xd15f5f&&_0x472ff1[_0x1fb5('0x5a')][_0x1fb5('0x57')]){return db['MailServerOut'][_0x1fb5('0x36')](_0x472ff1[_0x1fb5('0x5a')][_0x1fb5('0x57')],{'where':{'MailAccountId':_0xd15f5f['id']}})[_0x1fb5('0x22')](function(){return _0xd15f5f;});}return _0xd15f5f;})[_0x1fb5('0x22')](respondWithResult(_0x32d794,null))['catch'](handleError(_0x32d794,null));};exports[_0x1fb5('0x5d')]=function(_0x1f1c9d,_0x2ed426){return db['MailAccount'][_0x1fb5('0x5d')]()['then'](respondWithResult(_0x2ed426,null))[_0x1fb5('0x2c')](handleError(_0x2ed426,null));};exports[_0x1fb5('0x5e')]=function(_0x156ed3,_0x232769,_0x959140){if(_0x156ed3[_0x1fb5('0x5a')]['id']){delete _0x156ed3[_0x1fb5('0x5a')]['id'];}return db['MailAccount'][_0x1fb5('0x59')]({'where':{'id':_0x156ed3['params']['id']}})[_0x1fb5('0x22')](handleEntityNotFound(_0x232769,null))[_0x1fb5('0x22')](function(_0x48ae1f){if(_0x48ae1f){_0x156ed3[_0x1fb5('0x5a')][_0x1fb5('0x5f')]=_0x48ae1f['id'];return db[_0x1fb5('0x60')]['create'](_0x156ed3[_0x1fb5('0x5a')]);}})['then'](respondWithResult(_0x232769,null))[_0x1fb5('0x2c')](handleError(_0x232769,null));};exports[_0x1fb5('0x61')]=function(_0xe791fb,_0x498d37,_0x3dbf07){var _0x19e86d={'raw':![],'where':{}};var _0x567d49={};var _0x2ba4e7={'count':0x0,'rows':[]};return db['MailAccount']['findOne']({'where':{'id':_0xe791fb[_0x1fb5('0x5b')]['id']}})[_0x1fb5('0x22')](handleEntityNotFound(_0x498d37,null))[_0x1fb5('0x22')](function(_0x14d367){if(_0x14d367){_0x567d49[_0x1fb5('0x42')]=_['keys'](db[_0x1fb5('0x60')][_0x1fb5('0x62')]);_0x567d49[_0x1fb5('0x43')]=_['keys'](_0xe791fb['query']);_0x567d49[_0x1fb5('0x45')]=_[_0x1fb5('0x46')](_0x567d49[_0x1fb5('0x42')],_0x567d49[_0x1fb5('0x43')]);_0x19e86d[_0x1fb5('0x47')]=_['intersection'](_0x567d49[_0x1fb5('0x42')],qs[_0x1fb5('0x48')](_0xe791fb[_0x1fb5('0x43')][_0x1fb5('0x48')]));_0x19e86d[_0x1fb5('0x47')]=_0x19e86d[_0x1fb5('0x47')][_0x1fb5('0x63')]?_0x19e86d[_0x1fb5('0x47')]:_0x567d49[_0x1fb5('0x42')];if(!_0xe791fb[_0x1fb5('0x43')][_0x1fb5('0x49')](_0x1fb5('0x4a'))){_0x19e86d[_0x1fb5('0x4b')]=qs[_0x1fb5('0x4b')](_0xe791fb[_0x1fb5('0x43')][_0x1fb5('0x4b')]);_0x19e86d[_0x1fb5('0x32')]=qs[_0x1fb5('0x32')](_0xe791fb[_0x1fb5('0x43')][_0x1fb5('0x32')]);}_0x19e86d[_0x1fb5('0x4c')]=qs[_0x1fb5('0x4d')](_0xe791fb[_0x1fb5('0x43')][_0x1fb5('0x4d')]);_0x19e86d[_0x1fb5('0x4e')]=qs['filters'](_['pick'](_0xe791fb[_0x1fb5('0x43')],_0x567d49[_0x1fb5('0x45')]));_0x19e86d['where'][_0x1fb5('0x5f')]=_0x14d367['id'];if(_0xe791fb[_0x1fb5('0x43')][_0x1fb5('0x64')]){_0x19e86d[_0x1fb5('0x4e')]=_[_0x1fb5('0x50')](_0x19e86d[_0x1fb5('0x4e')],{'$or':_[_0x1fb5('0x3e')](_0x19e86d[_0x1fb5('0x47')],function(_0x143591){var _0x1c58c6={};_0x1c58c6[_0x143591]={'$like':'%'+_0xe791fb['query'][_0x1fb5('0x64')]+'%'};return _0x1c58c6;})});}_0x19e86d=_[_0x1fb5('0x50')]({},_0x19e86d,_0xe791fb[_0x1fb5('0x51')]);return db[_0x1fb5('0x60')][_0x1fb5('0x31')]({'where':_0x19e86d[_0x1fb5('0x4e')]})[_0x1fb5('0x22')](function(_0x11b059){_0x2ba4e7[_0x1fb5('0x31')]=_0x11b059;if(_0xe791fb[_0x1fb5('0x43')][_0x1fb5('0x52')]){_0x19e86d[_0x1fb5('0x53')]=[{'all':!![]}];}return db['Disposition']['findAll'](_0x19e86d);})[_0x1fb5('0x22')](function(_0x4ddc7f){_0x2ba4e7[_0x1fb5('0x54')]=_0x4ddc7f;return _0x2ba4e7;});}})[_0x1fb5('0x22')](respondWithFilteredResult(_0x498d37,_0x19e86d))[_0x1fb5('0x2c')](handleError(_0x498d37,null));};exports['removeDispositions']=function(_0x226d9d,_0x3fac28,_0x5b1e8b){return db[_0x1fb5('0x3f')]['find']({'where':{'id':_0x226d9d[_0x1fb5('0x5b')]['id']}})[_0x1fb5('0x22')](handleEntityNotFound(_0x3fac28,null))[_0x1fb5('0x22')](function(_0x9f7292){if(_0x9f7292){return _0x9f7292['removeDispositions'](_0x226d9d['query'][_0x1fb5('0x65')]);}})[_0x1fb5('0x22')](respondWithStatusCode(_0x3fac28,null))[_0x1fb5('0x2c')](handleError(_0x3fac28,null));};exports['addAnswer']=function(_0xb1cfe5,_0x22adb7,_0x4df97d){if(_0xb1cfe5['body']['id']){delete _0xb1cfe5[_0x1fb5('0x5a')]['id'];}return db[_0x1fb5('0x3f')][_0x1fb5('0x59')]({'where':{'id':_0xb1cfe5[_0x1fb5('0x5b')]['id']}})[_0x1fb5('0x22')](handleEntityNotFound(_0x22adb7,null))[_0x1fb5('0x22')](function(_0xf92fcd){if(_0xf92fcd){_0xb1cfe5['body']['MailAccountId']=_0xf92fcd['id'];return db[_0x1fb5('0x66')][_0x1fb5('0x67')](_0xb1cfe5[_0x1fb5('0x5a')]);}})['then'](respondWithResult(_0x22adb7,null))[_0x1fb5('0x2c')](handleError(_0x22adb7,null));};exports[_0x1fb5('0x68')]=function(_0x4b011c,_0xc4cbd5,_0x248066){var _0x5c320f={'raw':![],'where':{}};var _0x40a416={};var _0x2be7a9={'count':0x0,'rows':[]};return db['MailAccount'][_0x1fb5('0x69')]({'where':{'id':_0x4b011c[_0x1fb5('0x5b')]['id']}})[_0x1fb5('0x22')](handleEntityNotFound(_0xc4cbd5,null))['then'](function(_0x5a2b08){if(_0x5a2b08){_0x40a416[_0x1fb5('0x42')]=_['keys'](db[_0x1fb5('0x66')][_0x1fb5('0x62')]);_0x40a416[_0x1fb5('0x43')]=_[_0x1fb5('0x44')](_0x4b011c[_0x1fb5('0x43')]);_0x40a416['filters']=_[_0x1fb5('0x46')](_0x40a416[_0x1fb5('0x42')],_0x40a416[_0x1fb5('0x43')]);_0x5c320f['attributes']=_[_0x1fb5('0x46')](_0x40a416['model'],qs[_0x1fb5('0x48')](_0x4b011c['query'][_0x1fb5('0x48')]));_0x5c320f[_0x1fb5('0x47')]=_0x5c320f['attributes']['length']?_0x5c320f[_0x1fb5('0x47')]:_0x40a416[_0x1fb5('0x42')];if(!_0x4b011c[_0x1fb5('0x43')]['hasOwnProperty'](_0x1fb5('0x4a'))){_0x5c320f[_0x1fb5('0x4b')]=qs['limit'](_0x4b011c[_0x1fb5('0x43')][_0x1fb5('0x4b')]);_0x5c320f[_0x1fb5('0x32')]=qs[_0x1fb5('0x32')](_0x4b011c['query'][_0x1fb5('0x32')]);}_0x5c320f['order']=qs[_0x1fb5('0x4d')](_0x4b011c[_0x1fb5('0x43')][_0x1fb5('0x4d')]);_0x5c320f[_0x1fb5('0x4e')]=qs['filters'](_[_0x1fb5('0x4f')](_0x4b011c[_0x1fb5('0x43')],_0x40a416[_0x1fb5('0x45')]));_0x5c320f['where']['MailAccountId']=_0x5a2b08['id'];if(_0x4b011c[_0x1fb5('0x43')][_0x1fb5('0x64')]){_0x5c320f['where']=_[_0x1fb5('0x50')](_0x5c320f['where'],{'$or':_[_0x1fb5('0x3e')](_0x5c320f[_0x1fb5('0x47')],function(_0x3e1b3b){var _0x57ffaf={};_0x57ffaf[_0x3e1b3b]={'$like':'%'+_0x4b011c[_0x1fb5('0x43')]['filter']+'%'};return _0x57ffaf;})});}_0x5c320f=_[_0x1fb5('0x50')]({},_0x5c320f,_0x4b011c[_0x1fb5('0x51')]);return db[_0x1fb5('0x66')][_0x1fb5('0x31')]({'where':_0x5c320f[_0x1fb5('0x4e')]})['then'](function(_0xdc4d7){_0x2be7a9[_0x1fb5('0x31')]=_0xdc4d7;if(_0x4b011c[_0x1fb5('0x43')][_0x1fb5('0x52')]){_0x5c320f[_0x1fb5('0x53')]=[{'all':!![]}];}return db['CannedAnswer'][_0x1fb5('0x6a')](_0x5c320f);})['then'](function(_0x13cccc){_0x2be7a9[_0x1fb5('0x54')]=_0x13cccc;return _0x2be7a9;});}})[_0x1fb5('0x22')](respondWithFilteredResult(_0xc4cbd5,_0x5c320f))[_0x1fb5('0x2c')](handleError(_0xc4cbd5,null));};exports[_0x1fb5('0x6b')]=function(_0x25afb3,_0xd93885,_0x25200f){return db[_0x1fb5('0x3f')][_0x1fb5('0x59')]({'where':{'id':_0x25afb3[_0x1fb5('0x5b')]['id']}})['then'](handleEntityNotFound(_0xd93885,null))['then'](function(_0x7a3bb0){if(_0x7a3bb0){return _0x7a3bb0[_0x1fb5('0x6b')](_0x25afb3['query'][_0x1fb5('0x65')]);}})[_0x1fb5('0x22')](respondWithStatusCode(_0xd93885,null))[_0x1fb5('0x2c')](handleError(_0xd93885,null));};exports[_0x1fb5('0x67')]=function(_0x4c3b3a,_0x1f0de3){var _0xeb718c={'name':_0x4c3b3a[_0x1fb5('0x5a')][_0x1fb5('0x39')],'key':_0x4c3b3a[_0x1fb5('0x5a')]['key'],'email':_0x4c3b3a['body']['email'],'ListId':_0x4c3b3a[_0x1fb5('0x5a')]['ListId'],'active':!_[_0x1fb5('0x6c')](_0x4c3b3a[_0x1fb5('0x5a')]['active'])?_0x4c3b3a[_0x1fb5('0x5a')][_0x1fb5('0x6d')]:!![],'description':_0x4c3b3a[_0x1fb5('0x5a')][_0x1fb5('0x6e')]||null,'Imap':{},'Smtp':{}};if(_[_0x1fb5('0x6c')](_0x4c3b3a['body'][_0x1fb5('0x6f')])){if(_0x4c3b3a[_0x1fb5('0x5a')][_0x1fb5('0x70')]){_0xeb718c[_0x1fb5('0x5c')]['user']=_0xeb718c[_0x1fb5('0x57')][_0x1fb5('0x71')]=_0x4c3b3a[_0x1fb5('0x5a')]['cuser'];_0xeb718c[_0x1fb5('0x5c')][_0x1fb5('0x72')]=_0xeb718c[_0x1fb5('0x57')][_0x1fb5('0x73')]=_0x4c3b3a[_0x1fb5('0x5a')]['cpassword'];}else{_0xeb718c[_0x1fb5('0x5c')][_0x1fb5('0x74')]=_0xeb718c[_0x1fb5('0x57')][_0x1fb5('0x74')]=![];}_0xeb718c['Imap'][_0x1fb5('0x75')]=_0x4c3b3a[_0x1fb5('0x5a')]['Imap'][_0x1fb5('0x75')];_0xeb718c[_0x1fb5('0x5c')][_0x1fb5('0x76')]=_0x4c3b3a[_0x1fb5('0x5a')][_0x1fb5('0x5c')][_0x1fb5('0x76')];_0xeb718c[_0x1fb5('0x57')]['host']=_0x4c3b3a[_0x1fb5('0x5a')][_0x1fb5('0x57')]['host'];_0xeb718c[_0x1fb5('0x57')][_0x1fb5('0x76')]=_0x4c3b3a[_0x1fb5('0x5a')][_0x1fb5('0x57')][_0x1fb5('0x76')];}else{_0xeb718c[_0x1fb5('0x5c')][_0x1fb5('0x77')]=_0xeb718c[_0x1fb5('0x57')][_0x1fb5('0x77')]=_0x4c3b3a[_0x1fb5('0x5a')]['cservice'];_0xeb718c[_0x1fb5('0x5c')][_0x1fb5('0x71')]=_0xeb718c[_0x1fb5('0x57')][_0x1fb5('0x71')]=_0x4c3b3a['body'][_0x1fb5('0x78')];_0xeb718c[_0x1fb5('0x5c')]['password']=_0xeb718c[_0x1fb5('0x57')]['pass']=_0x4c3b3a[_0x1fb5('0x5a')][_0x1fb5('0x79')];}return db[_0x1fb5('0x3f')][_0x1fb5('0x67')](_0xeb718c,{'include':[{'model':db[_0x1fb5('0x56')],'as':_0x1fb5('0x57')},{'model':db['MailServerIn'],'as':_0x1fb5('0x5c')}]})['then'](function(_0x457d57){var _0x10d6a5=_0x4c3b3a['user'][_0x1fb5('0x7a')]({'plain':!![]});if(!_0x10d6a5)throw new Error(_0x1fb5('0x7b'));if(_0x10d6a5[_0x1fb5('0x7c')]===_0x1fb5('0x71')){var _0x2d3c9b=_0x457d57[_0x1fb5('0x7a')]({'plain':!![]});return db[_0x1fb5('0x7d')]['find']({'where':{'name':_0x1fb5('0x37'),'userProfileId':_0x10d6a5[_0x1fb5('0x7e')]},'raw':!![]})['then'](function(_0xdffcb7){if(_0xdffcb7&&_0xdffcb7[_0x1fb5('0x7f')]===0x0){return db['UserProfileResource'][_0x1fb5('0x67')]({'name':_0x2d3c9b[_0x1fb5('0x39')],'resourceId':_0x2d3c9b['id'],'type':_0xdffcb7[_0x1fb5('0x39')],'sectionId':_0xdffcb7['id']},{})[_0x1fb5('0x22')](function(){return _0x457d57;});}else{return _0x457d57;}})[_0x1fb5('0x2c')](function(_0x1cce86){logger[_0x1fb5('0x28')](_0x1fb5('0x80'),_0x1cce86);throw _0x1cce86;});}return _0x457d57;})[_0x1fb5('0x22')](respondWithResult(_0x1f0de3,0xc9))[_0x1fb5('0x2c')](handleError(_0x1f0de3,null));};exports[_0x1fb5('0x81')]=function(_0x311cad,_0x16b436,_0x6039ad){return db['MailAccount'][_0x1fb5('0x69')]({'where':{'id':_0x311cad[_0x1fb5('0x5b')]['id']}})[_0x1fb5('0x22')](handleEntityNotFound(_0x16b436,null))[_0x1fb5('0x22')](function(_0x3529ed){if(_0x3529ed){return _0x3529ed[_0x1fb5('0x81')]();}return null;})[_0x1fb5('0x22')](respondWithResult(_0x16b436,null))['catch'](handleError(_0x16b436,null));};exports[_0x1fb5('0x82')]=function(_0x5c5b18,_0x1f21ba,_0x1e659e){if(_0x5c5b18[_0x1fb5('0x5a')]['id']){delete _0x5c5b18['body']['id'];}return db[_0x1fb5('0x3f')][_0x1fb5('0x59')]({'where':{'id':_0x5c5b18[_0x1fb5('0x5b')]['id']}})['then'](handleEntityNotFound(_0x1f21ba,null))[_0x1fb5('0x22')](function(_0xb1b8b9){if(_0xb1b8b9){_0x5c5b18['body'][_0x1fb5('0x5f')]=_0xb1b8b9['id'];return db['MailServerIn'][_0x1fb5('0x67')](_0x5c5b18[_0x1fb5('0x5a')]);}})[_0x1fb5('0x22')](respondWithResult(_0x1f21ba,null))['catch'](handleError(_0x1f21ba,null));};exports['removeImap']=function(_0x309c63,_0x2abc04,_0xc8057f){return db[_0x1fb5('0x3f')]['findOne']({'where':{'id':_0x309c63['params']['id']}})['then'](handleEntityNotFound(_0x2abc04,null))['then'](function(_0x5d7434){if(_0x5d7434){return _0x5d7434[_0x1fb5('0x83')](null);}return null;})['then'](respondWithStatusCode(_0x2abc04,null))[_0x1fb5('0x2c')](handleError(_0x2abc04,null));};exports[_0x1fb5('0x84')]=function(_0x496d67,_0xd3deae,_0xf0e47d){return db[_0x1fb5('0x3f')][_0x1fb5('0x69')]({'where':{'id':_0x496d67[_0x1fb5('0x5b')]['id']}})[_0x1fb5('0x22')](handleEntityNotFound(_0xd3deae,null))[_0x1fb5('0x22')](function(_0x5839d4){if(_0x5839d4){return _0x5839d4[_0x1fb5('0x84')]();}return null;})[_0x1fb5('0x22')](respondWithResult(_0xd3deae,null))[_0x1fb5('0x2c')](handleError(_0xd3deae,null));};exports['addSmtp']=function(_0x42f19a,_0x3e8ad5,_0x3e5870){if(_0x42f19a[_0x1fb5('0x5a')]['id']){delete _0x42f19a['body']['id'];}return db[_0x1fb5('0x3f')]['find']({'where':{'id':_0x42f19a[_0x1fb5('0x5b')]['id']}})['then'](handleEntityNotFound(_0x3e8ad5,null))[_0x1fb5('0x22')](function(_0x20b0cf){if(_0x20b0cf){_0x42f19a[_0x1fb5('0x5a')][_0x1fb5('0x5f')]=_0x20b0cf['id'];return db['MailServerOut'][_0x1fb5('0x67')](_0x42f19a[_0x1fb5('0x5a')]);}})[_0x1fb5('0x22')](respondWithResult(_0x3e8ad5,null))[_0x1fb5('0x2c')](handleError(_0x3e8ad5,null));};exports[_0x1fb5('0x85')]=function(_0x3fdc1d,_0x22132f,_0x417994){return db[_0x1fb5('0x3f')][_0x1fb5('0x69')]({'where':{'id':_0x3fdc1d[_0x1fb5('0x5b')]['id']}})[_0x1fb5('0x22')](handleEntityNotFound(_0x22132f,null))[_0x1fb5('0x22')](function(_0x558f0f){if(_0x558f0f){return _0x558f0f['setSmtp'](null);}return null;})['then'](respondWithStatusCode(_0x22132f,null))['catch'](handleError(_0x22132f,null));};exports[_0x1fb5('0x86')]=function(_0x13b012,_0x12d838,_0x5a86a7){return db[_0x1fb5('0x87')][_0x1fb5('0x59')]({'where':{'id':_0x13b012[_0x1fb5('0x5b')]['id']}})[_0x1fb5('0x22')](handleEntityNotFound(_0x12d838,null))[_0x1fb5('0x22')](function(_0x263c15){if(_0x263c15){return _0x263c15['addInteraction'](_0x13b012[_0x1fb5('0x5a')][_0x1fb5('0x65')],_[_0x1fb5('0x88')](_0x13b012[_0x1fb5('0x5a')],[_0x1fb5('0x65'),'id'])||{});}})[_0x1fb5('0x22')](respondWithResult(_0x12d838,null))['catch'](handleError(_0x12d838,null));};exports[_0x1fb5('0x89')]=function(_0x1da5cd,_0x39d746,_0x27018d){var _0x83957d={'raw':![],'where':{}};var _0x2c373a={};var _0x14b06c={'count':0x0,'rows':[]};return db[_0x1fb5('0x3f')][_0x1fb5('0x69')]({'where':{'id':_0x1da5cd[_0x1fb5('0x5b')]['id']}})[_0x1fb5('0x22')](handleEntityNotFound(_0x39d746,null))[_0x1fb5('0x22')](function(_0x1b467b){if(_0x1b467b){_0x2c373a[_0x1fb5('0x42')]=_[_0x1fb5('0x44')](db[_0x1fb5('0x87')][_0x1fb5('0x62')]);_0x2c373a[_0x1fb5('0x43')]=_[_0x1fb5('0x44')](_0x1da5cd['query']);_0x2c373a[_0x1fb5('0x45')]=_[_0x1fb5('0x46')](_0x2c373a[_0x1fb5('0x42')],_0x2c373a[_0x1fb5('0x43')]);_0x83957d['attributes']=_['intersection'](_0x2c373a[_0x1fb5('0x42')],qs[_0x1fb5('0x48')](_0x1da5cd[_0x1fb5('0x43')][_0x1fb5('0x48')]));_0x83957d[_0x1fb5('0x47')]=_0x83957d[_0x1fb5('0x47')][_0x1fb5('0x63')]?_0x83957d[_0x1fb5('0x47')]:_0x2c373a['model'];if(!_0x1da5cd[_0x1fb5('0x43')][_0x1fb5('0x49')](_0x1fb5('0x4a'))){_0x83957d['limit']=qs[_0x1fb5('0x4b')](_0x1da5cd[_0x1fb5('0x43')][_0x1fb5('0x4b')]);_0x83957d['offset']=qs[_0x1fb5('0x32')](_0x1da5cd[_0x1fb5('0x43')][_0x1fb5('0x32')]);}_0x83957d['order']=qs[_0x1fb5('0x4d')](_0x1da5cd[_0x1fb5('0x43')]['sort']);_0x83957d[_0x1fb5('0x4e')]=qs[_0x1fb5('0x45')](_[_0x1fb5('0x4f')](_0x1da5cd[_0x1fb5('0x43')],_0x2c373a[_0x1fb5('0x45')]));_0x83957d['where'][_0x1fb5('0x5f')]=_0x1b467b['id'];if(_0x1da5cd[_0x1fb5('0x43')][_0x1fb5('0x64')]){_0x83957d[_0x1fb5('0x4e')]=_['merge'](_0x83957d[_0x1fb5('0x4e')],{'$or':_['map'](_0x83957d[_0x1fb5('0x47')],function(_0x1eec84){var _0x3a96f5={};_0x3a96f5[_0x1eec84]={'$like':'%'+_0x1da5cd[_0x1fb5('0x43')][_0x1fb5('0x64')]+'%'};return _0x3a96f5;})});}_0x83957d=_['merge']({},_0x83957d,_0x1da5cd['options']);return db[_0x1fb5('0x87')][_0x1fb5('0x31')]({'where':_0x83957d[_0x1fb5('0x4e')]})[_0x1fb5('0x22')](function(_0x5d2b09){_0x14b06c['count']=_0x5d2b09;if(_0x1da5cd[_0x1fb5('0x43')]['includeAll']){_0x83957d[_0x1fb5('0x53')]=[{'model':db['CmContact'],'as':_0x1fb5('0x8a'),'required':![]},{'model':db['User'],'as':_0x1fb5('0x8b'),'attributes':[_0x1fb5('0x39'),_0x1fb5('0x8c'),_0x1fb5('0x8d')],'required':![]},{'model':db[_0x1fb5('0x8e')],'as':_0x1fb5('0x8f'),'attributes':['id','name','color'],'where':_0x1da5cd['query'][_0x1fb5('0x90')]?{'id':_0x1da5cd[_0x1fb5('0x43')]['tag']}:undefined,'required':_0x1da5cd[_0x1fb5('0x43')][_0x1fb5('0x90')]?!![]:![]}];}return db['MailInteraction']['findAll'](_0x83957d);})[_0x1fb5('0x22')](function(_0x3e5d96){_0x14b06c[_0x1fb5('0x54')]=_0x3e5d96;return _0x14b06c;});}})[_0x1fb5('0x22')](respondWithFilteredResult(_0x39d746,_0x83957d))[_0x1fb5('0x2c')](handleError(_0x39d746,null));};exports[_0x1fb5('0x91')]=function(_0x38c71c,_0x33ac56,_0x5841b9){return db[_0x1fb5('0x3f')][_0x1fb5('0x69')]({'where':{'id':_0x38c71c['params']['id']}})[_0x1fb5('0x22')](handleEntityNotFound(_0x33ac56,null))['then'](function(_0x1ac204){if(_0x1ac204){return db['sequelize']['transaction'](function(_0x5d587e){return db[_0x1fb5('0x92')][_0x1fb5('0x38')]({'where':{'MailAccountId':_0x38c71c[_0x1fb5('0x5b')]['id']},'transaction':_0x5d587e})[_0x1fb5('0x22')](function(_0x3cdeb9){var _0x587e1d=_[_0x1fb5('0x3e')](_0x38c71c[_0x1fb5('0x5a')],function(_0x5ed225){_0x5ed225[_0x1fb5('0x5f')]=_0x38c71c[_0x1fb5('0x5b')]['id'];return _0x5ed225;});return db[_0x1fb5('0x92')]['bulkCreate'](_0x587e1d,{'transaction':_0x5d587e});});})[_0x1fb5('0x22')](function(){return db[_0x1fb5('0x92')][_0x1fb5('0x93')]({'where':{'MailAccountId':_0x38c71c[_0x1fb5('0x5b')]['id']},'order':_0x1fb5('0x94')});});}})[_0x1fb5('0x22')](respondWithResult(_0x33ac56,null))[_0x1fb5('0x2c')](handleError(_0x33ac56,null));};exports['getApplications']=function(_0xb62210,_0x42cb93,_0x2f4253){var _0x1799c0={};var _0x406c81={};var _0x2aa281;var _0x2ec111;return db[_0x1fb5('0x3f')]['findOne']({'where':{'id':_0xb62210['params']['id']}})[_0x1fb5('0x22')](handleEntityNotFound(_0x42cb93,null))[_0x1fb5('0x22')](function(_0x271bbb){if(_0x271bbb){_0x2aa281=_0x271bbb;_0x406c81[_0x1fb5('0x42')]=_['keys'](db[_0x1fb5('0x92')]['rawAttributes']);_0x406c81['query']=_[_0x1fb5('0x44')](_0xb62210['query']);_0x406c81['filters']=_[_0x1fb5('0x46')](_0x406c81['model'],_0x406c81[_0x1fb5('0x43')]);_0x1799c0['attributes']=_[_0x1fb5('0x46')](_0x406c81['model'],qs['fields'](_0xb62210[_0x1fb5('0x43')][_0x1fb5('0x48')]));_0x1799c0['attributes']=_0x1799c0[_0x1fb5('0x47')][_0x1fb5('0x63')]?_0x1799c0[_0x1fb5('0x47')]:_0x406c81[_0x1fb5('0x42')];_0x1799c0[_0x1fb5('0x4c')]=qs[_0x1fb5('0x4d')](_0xb62210[_0x1fb5('0x43')][_0x1fb5('0x4d')]);_0x1799c0[_0x1fb5('0x4e')]=qs[_0x1fb5('0x45')](_[_0x1fb5('0x4f')](_0xb62210[_0x1fb5('0x43')],_0x406c81[_0x1fb5('0x45')]));if(_0xb62210[_0x1fb5('0x43')][_0x1fb5('0x64')]){_0x1799c0['where']=_[_0x1fb5('0x50')](_0x1799c0[_0x1fb5('0x4e')],{'$or':_[_0x1fb5('0x3e')](_0x1799c0[_0x1fb5('0x47')],function(_0x289b55){var _0xea213d={};_0xea213d[_0x289b55]={'$like':'%'+_0xb62210[_0x1fb5('0x43')]['filter']+'%'};return _0xea213d;})});}_0x1799c0=_['merge']({},_0x1799c0,_0xb62210[_0x1fb5('0x51')]);return _0x2aa281[_0x1fb5('0x95')](_0x1799c0);}})['then'](function(_0x43e569){if(_0x43e569){_0x2ec111=_0x43e569['length'];if(!_0xb62210['query']['hasOwnProperty'](_0x1fb5('0x4a'))){_0x1799c0['limit']=qs['limit'](_0xb62210[_0x1fb5('0x43')][_0x1fb5('0x4b')]);_0x1799c0[_0x1fb5('0x32')]=qs[_0x1fb5('0x32')](_0xb62210['query'][_0x1fb5('0x32')]);}return _0x2aa281[_0x1fb5('0x95')](_0x1799c0);}})[_0x1fb5('0x22')](function(_0x4eec21){if(_0x4eec21){return _0x4eec21?{'count':_0x2ec111,'rows':_0x4eec21}:null;}})['then'](respondWithResult(_0x42cb93,null))[_0x1fb5('0x2c')](handleError(_0x42cb93,null));};exports[_0x1fb5('0x96')]=function(_0x269d03,_0x2e27a1,_0x1b90d5){var _0x62c368={'raw':!![],'where':{}};var _0x59e883={};var _0x296eef={'count':0x0,'rows':[]};return db[_0x1fb5('0x3f')][_0x1fb5('0x69')]({'where':{'id':_0x269d03[_0x1fb5('0x5b')]['id']}})[_0x1fb5('0x22')](handleEntityNotFound(_0x2e27a1,null))[_0x1fb5('0x22')](function(_0x3d87db){if(_0x3d87db){_0x59e883[_0x1fb5('0x42')]=_[_0x1fb5('0x44')](db[_0x1fb5('0x97')][_0x1fb5('0x62')]);_0x59e883[_0x1fb5('0x43')]=_[_0x1fb5('0x44')](_0x269d03[_0x1fb5('0x43')]);_0x59e883[_0x1fb5('0x45')]=_[_0x1fb5('0x46')](_0x59e883[_0x1fb5('0x42')],_0x59e883[_0x1fb5('0x43')]);_0x62c368[_0x1fb5('0x47')]=_[_0x1fb5('0x46')](_0x59e883[_0x1fb5('0x42')],qs[_0x1fb5('0x48')](_0x269d03['query'][_0x1fb5('0x48')]));_0x62c368[_0x1fb5('0x47')]=_0x62c368[_0x1fb5('0x47')][_0x1fb5('0x63')]?_0x62c368['attributes']:_0x59e883[_0x1fb5('0x42')];if(!_0x269d03[_0x1fb5('0x43')][_0x1fb5('0x49')](_0x1fb5('0x4a'))){_0x62c368['limit']=qs[_0x1fb5('0x4b')](_0x269d03[_0x1fb5('0x43')][_0x1fb5('0x4b')]);_0x62c368['offset']=qs[_0x1fb5('0x32')](_0x269d03[_0x1fb5('0x43')][_0x1fb5('0x32')]);}_0x62c368['order']=qs[_0x1fb5('0x4d')](_0x269d03[_0x1fb5('0x43')][_0x1fb5('0x4d')]);_0x62c368['where']=qs['filters'](_['pick'](_0x269d03['query'],_0x59e883[_0x1fb5('0x45')]));_0x62c368[_0x1fb5('0x4e')][_0x1fb5('0x5f')]=_0x3d87db['id'];if(_0x269d03[_0x1fb5('0x43')]['filter']){_0x62c368[_0x1fb5('0x4e')]=_['merge'](_0x62c368['where'],{'$or':_['map'](_0x62c368[_0x1fb5('0x47')],function(_0x35d124){var _0x1d6545={};_0x1d6545[_0x35d124]={'$like':'%'+_0x269d03[_0x1fb5('0x43')][_0x1fb5('0x64')]+'%'};return _0x1d6545;})});}if(_0x269d03['query']['$gte']){var _0x7511fe=_0x269d03[_0x1fb5('0x43')][_0x1fb5('0x98')][_0x1fb5('0x99')](',');var _0x1d9fa6={};_0x1d9fa6[_0x7511fe[0x0]]={'$gte':moment(_0x7511fe[0x1])[_0x1fb5('0x9a')](_0x1fb5('0x9b'))};_0x62c368[_0x1fb5('0x4e')]=_[_0x1fb5('0x50')](_0x62c368[_0x1fb5('0x4e')],_0x1d9fa6);}_0x62c368=_[_0x1fb5('0x50')]({},_0x62c368,_0x269d03[_0x1fb5('0x51')]);return db['MailMessage'][_0x1fb5('0x31')]({'where':_0x62c368[_0x1fb5('0x4e')]})[_0x1fb5('0x22')](function(_0x3cb6fa){_0x296eef[_0x1fb5('0x31')]=_0x3cb6fa;if(_0x269d03[_0x1fb5('0x43')][_0x1fb5('0x52')]){_0x62c368['include']=[{'all':!![]}];}return db[_0x1fb5('0x97')][_0x1fb5('0x6a')](_0x62c368);})[_0x1fb5('0x22')](function(_0x24c2b7){_0x296eef[_0x1fb5('0x54')]=_0x24c2b7;return _0x296eef;});}})[_0x1fb5('0x22')](respondWithFilteredResult(_0x2e27a1,_0x62c368))[_0x1fb5('0x2c')](handleError(_0x2e27a1,null));};exports[_0x1fb5('0x3a')]=function(_0x47eb36,_0x1f9ffb,_0x13e3d8){var _0x405a96,_0x3267d8={},_0x358521;if(_0x47eb36[_0x1fb5('0x5a')]['to']){_0x358521=_0x47eb36[_0x1fb5('0x5a')]['to'][_0x1fb5('0x99')](',')[0x0];}return db['MailAccount'][_0x1fb5('0x59')]({'where':{'id':_0x47eb36[_0x1fb5('0x5b')]['id']},'include':[{'model':db['CmList'],'as':_0x1fb5('0x9c'),'include':[{'model':db[_0x1fb5('0x9d')],'as':_0x1fb5('0x9e'),'where':{'email':_0x358521},'limit':0x1,'order':[[_0x1fb5('0x9f'),_0x1fb5('0xa0')]]}]},{'model':db[_0x1fb5('0x56')],'as':_0x1fb5('0x57'),'raw':!![]}]})[_0x1fb5('0x22')](handleEntityNotFound(_0x1f9ffb,null))['then'](function(_0x447233){if(_0x447233){_0x405a96=_0x447233;if(_0x447233['Smtp']){if(_[_0x1fb5('0x6c')](_0x47eb36[_0x1fb5('0x5a')][_0x1fb5('0xa1')])){_0x47eb36[_0x1fb5('0x5a')][_0x1fb5('0xa1')]=util[_0x1fb5('0x9a')](_0x1fb5('0xa2'),_0x447233[_0x1fb5('0x39')],_0x447233[_0x1fb5('0xa3')]||_0x447233[_0x1fb5('0x57')][_0x1fb5('0x71')]);}if(_0x47eb36[_0x1fb5('0x5a')][_0x1fb5('0xa4')]&&_0x47eb36['body'][_0x1fb5('0xa4')][_0x1fb5('0x63')]){for(var _0x466cc1=0x0;_0x466cc1<_0x47eb36['body'][_0x1fb5('0xa4')][_0x1fb5('0x63')];_0x466cc1+=0x1){_0x47eb36[_0x1fb5('0x5a')][_0x1fb5('0xa4')][_0x466cc1]={'filename':_0x47eb36[_0x1fb5('0x5a')]['attachments'][_0x466cc1]['name'],'path':path[_0x1fb5('0xa5')](config['root'],_0x1fb5('0xa6'),_0x47eb36[_0x1fb5('0x5a')][_0x1fb5('0xa4')][_0x466cc1][_0x1fb5('0xa7')])};}}var _0x5be22f={'tls':{'rejectUnauthorized':![]}};if(_['isNil'](_0x447233[_0x1fb5('0x57')][_0x1fb5('0x77')])){if(_0x447233[_0x1fb5('0x57')]['authentication']){_0x5be22f[_0x1fb5('0xa8')]={'user':_0x447233[_0x1fb5('0x57')][_0x1fb5('0x71')],'pass':_0x447233[_0x1fb5('0x57')][_0x1fb5('0x73')]};}_0x5be22f['host']=_0x447233[_0x1fb5('0x57')][_0x1fb5('0x75')];_0x5be22f[_0x1fb5('0x76')]=_0x447233[_0x1fb5('0x57')]['port'];_0x5be22f[_0x1fb5('0xa9')]=_0x447233[_0x1fb5('0x57')][_0x1fb5('0xa9')];}else{_0x5be22f[_0x1fb5('0x77')]=_0x447233[_0x1fb5('0x57')][_0x1fb5('0x77')];_0x5be22f[_0x1fb5('0xa8')]={'user':_0x447233[_0x1fb5('0x57')][_0x1fb5('0x71')],'pass':_0x447233[_0x1fb5('0x57')]['pass']};}return respondWithRpcPromise(_0x1fb5('0xaa'),_0x1fb5('0xab'),{'account':_0x5be22f,'message':_0x47eb36[_0x1fb5('0x5a')]});}else{throw new Error(_0x1fb5('0xac'));}}})[_0x1fb5('0x22')](function(_0x4ff3e0){if(_0x4ff3e0){_0x3267d8=_0x4ff3e0;if(_0x405a96['List']){if(_0x405a96['List'][_0x1fb5('0x9e')][_0x1fb5('0x63')]){return _0x405a96[_0x1fb5('0x9c')][_0x1fb5('0x9e')][0x0];}else{return db[_0x1fb5('0x9d')][_0x1fb5('0x67')](_[_0x1fb5('0x19')](_0x47eb36['body'],{'firstName':_0x47eb36[_0x1fb5('0x5a')]['to'],'email':_0x47eb36['body']['to'],'phone':_0x47eb36[_0x1fb5('0x5a')]['to'],'ListId':_0x405a96['ListId']}));}}else{throw new Error(_0x1fb5('0xac'));}}})[_0x1fb5('0x22')](function(_0x3ae5a1){if(_0x3ae5a1){var _0x2df35c={'UserId':_0x47eb36['user']['id'],'ContactId':_0x3ae5a1['id'],'MailAccountId':_0x405a96['id'],'inReplyTo':_0x3267d8[_0x1fb5('0xad')],'to':_0x47eb36[_0x1fb5('0x5a')][_0x1fb5('0xa1')],'cc':_0x47eb36[_0x1fb5('0x5a')]['cc'],'subject':_0x47eb36[_0x1fb5('0x5a')]['subject'],'attach':_0x47eb36[_0x1fb5('0x5a')][_0x1fb5('0xae')],'firstMsgDirection':_0x1fb5('0xaf'),'lastMsgAt':moment()[_0x1fb5('0x9a')](_0x1fb5('0x9b')),'lastMsgDirection':_0x1fb5('0xaf'),'lastMsgBody':_0x47eb36[_0x1fb5('0x5a')][_0x1fb5('0x5a')],'Messages':[_[_0x1fb5('0x50')](_0x47eb36[_0x1fb5('0x5a')],{'messageId':_0x3267d8[_0x1fb5('0xad')],'sentAt':moment()[_0x1fb5('0x9a')](_0x1fb5('0x9b')),'read':!![],'MailAccountId':_0x405a96['id'],'UserId':_0x47eb36[_0x1fb5('0x71')]['id'],'ContactId':_0x3ae5a1['id']})]};if(_0x47eb36[_0x1fb5('0x5a')][_0x1fb5('0xb0')]){_0x2df35c=_['merge'](_0x2df35c,_0x47eb36[_0x1fb5('0x5a')]['Interaction']);}return db[_0x1fb5('0x87')][_0x1fb5('0x67')](_0x2df35c,{'include':[{'model':db[_0x1fb5('0x97')],'as':_0x1fb5('0xb1')}]});}})[_0x1fb5('0x22')](respondWithResult(_0x1f9ffb,null))[_0x1fb5('0x2c')](handleError(_0x1f9ffb,null));};exports[_0x1fb5('0xb2')]=function(_0x329a6a,_0x4a0154,_0x1ef18f){return db[_0x1fb5('0x3f')]['find']({'where':{'id':_0x329a6a[_0x1fb5('0x5b')]['id']},'include':[{'model':db['MailServerOut'],'as':'Smtp','raw':!![]}]})[_0x1fb5('0x22')](handleEntityNotFound(_0x4a0154,null))['then'](function(_0x1547d3){if(_0x1547d3&&_0x1547d3[_0x1fb5('0x57')]){var _0x3e1c6b={'id':_0x1547d3['id'],'tls':{'rejectUnauthorized':![]}};if(_0x1547d3[_0x1fb5('0x57')][_0x1fb5('0x77')]){_0x3e1c6b[_0x1fb5('0x77')]=_0x1547d3[_0x1fb5('0x57')][_0x1fb5('0x77')];}else{_0x3e1c6b[_0x1fb5('0x75')]=_0x1547d3[_0x1fb5('0x57')][_0x1fb5('0x75')];_0x3e1c6b[_0x1fb5('0x76')]=_0x1547d3[_0x1fb5('0x57')][_0x1fb5('0x76')];_0x3e1c6b[_0x1fb5('0xa9')]=_0x1547d3[_0x1fb5('0x57')][_0x1fb5('0xa9')];}if(_0x1547d3[_0x1fb5('0x57')][_0x1fb5('0x74')]){_0x3e1c6b[_0x1fb5('0xa8')]={'user':_0x1547d3[_0x1fb5('0x57')]['user'],'pass':_0x1547d3['Smtp'][_0x1fb5('0x73')]};}return respondWithRpcPromise(_0x1fb5('0xb3'),_0x1fb5('0xb2'),{'account':_0x3e1c6b});}})[_0x1fb5('0x22')](respondWithResult(_0x4a0154,null))['catch'](handleError(_0x4a0154,null));};exports[_0x1fb5('0x38')]=function(_0x55e6d8,_0x4957d1){return db[_0x1fb5('0x3f')][_0x1fb5('0x59')]({'where':{'id':_0x55e6d8[_0x1fb5('0x5b')]['id']}})[_0x1fb5('0x22')](handleEntityNotFound(_0x4957d1,null))[_0x1fb5('0x22')](function(_0x33670f){if(_0x33670f&&_0x33670f['service']){throw new db[(_0x1fb5('0x1f'))][(_0x1fb5('0xb4'))](_0x1fb5('0xb5'));}return _0x33670f;})['then'](removeEntity(_0x4957d1,null))[_0x1fb5('0x2c')](handleError(_0x4957d1,null));};exports['addAgents']=function(_0x314c4c,_0x2007ba,_0x515aba){return db[_0x1fb5('0x3f')][_0x1fb5('0x59')]({'where':{'id':_0x314c4c[_0x1fb5('0x5b')]['id']}})[_0x1fb5('0x22')](handleEntityNotFound(_0x2007ba,null))[_0x1fb5('0x22')](function(_0x13ebb5){if(_0x13ebb5){return _0x13ebb5[_0x1fb5('0xb6')](_0x314c4c['body'][_0x1fb5('0x65')],_[_0x1fb5('0x88')](_0x314c4c[_0x1fb5('0x5a')],[_0x1fb5('0x65'),'id'])||{})[_0x1fb5('0xb7')](function(_0x5d8693){for(var _0x2f35a9=0x0;_0x2f35a9<_0x314c4c[_0x1fb5('0x5a')][_0x1fb5('0x65')][_0x1fb5('0x63')];_0x2f35a9+=0x1){socket[_0x1fb5('0xb8')](_0x1fb5('0xb9'),{'UserId':_0x314c4c[_0x1fb5('0x5a')][_0x1fb5('0x65')][_0x2f35a9],'MailAccountId':_0x314c4c[_0x1fb5('0x5b')]['id']});}return _0x5d8693;});}})[_0x1fb5('0x22')](respondWithResult(_0x2007ba,null))[_0x1fb5('0x2c')](handleError(_0x2007ba,null));};exports[_0x1fb5('0xba')]=function(_0x30731d,_0x50c4dd,_0x5d6fd3){return db['MailAccount'][_0x1fb5('0x59')]({'where':{'id':_0x30731d[_0x1fb5('0x5b')]['id']}})[_0x1fb5('0x22')](handleEntityNotFound(_0x50c4dd,null))['then'](function(_0x4e6a6a){if(_0x4e6a6a){return _0x4e6a6a[_0x1fb5('0xba')](_0x30731d['query'][_0x1fb5('0x65')])['then'](function(){if(_[_0x1fb5('0xbb')](_0x30731d[_0x1fb5('0x43')][_0x1fb5('0x65')])){for(var _0x53264c=0x0;_0x53264c<_0x30731d[_0x1fb5('0x43')][_0x1fb5('0x65')]['length'];_0x53264c+=0x1){socket[_0x1fb5('0xb8')](_0x1fb5('0xbc'),{'UserId':Number(_0x30731d[_0x1fb5('0x43')][_0x1fb5('0x65')][_0x53264c]),'MailAccountId':Number(_0x30731d['params']['id'])});}}else{socket[_0x1fb5('0xb8')](_0x1fb5('0xbc'),{'UserId':Number(_0x30731d['query'][_0x1fb5('0x65')]),'MailAccountId':Number(_0x30731d[_0x1fb5('0x5b')]['id'])});}});}})[_0x1fb5('0x22')](respondWithStatusCode(_0x50c4dd,null))['catch'](handleError(_0x50c4dd,null));};exports[_0x1fb5('0xbd')]=function(_0x1564f3,_0x125264,_0x1186e1){var _0xc87c0c={};var _0x1e7dcb={};var _0x5d24ef;var _0x24921c;return db[_0x1fb5('0x3f')][_0x1fb5('0x69')]({'where':{'id':_0x1564f3[_0x1fb5('0x5b')]['id']}})[_0x1fb5('0x22')](handleEntityNotFound(_0x125264,null))['then'](function(_0x202eea){if(_0x202eea){_0x5d24ef=_0x202eea;_0x1e7dcb[_0x1fb5('0x42')]=_[_0x1fb5('0x44')](db[_0x1fb5('0xbe')][_0x1fb5('0x62')]);_0x1e7dcb[_0x1fb5('0x43')]=_[_0x1fb5('0x44')](_0x1564f3['query']);_0x1e7dcb['filters']=_[_0x1fb5('0x46')](_0x1e7dcb['model'],_0x1e7dcb['query']);_0xc87c0c[_0x1fb5('0x47')]=_[_0x1fb5('0x46')](_0x1e7dcb['model'],qs[_0x1fb5('0x48')](_0x1564f3[_0x1fb5('0x43')][_0x1fb5('0x48')]));_0xc87c0c['attributes']=_0xc87c0c[_0x1fb5('0x47')]['length']?_0xc87c0c['attributes']:_0x1e7dcb[_0x1fb5('0x42')];_0xc87c0c[_0x1fb5('0x4c')]=qs[_0x1fb5('0x4d')](_0x1564f3['query'][_0x1fb5('0x4d')]);_0xc87c0c[_0x1fb5('0x4e')]=qs['filters'](_[_0x1fb5('0x4f')](_0x1564f3[_0x1fb5('0x43')],_0x1e7dcb[_0x1fb5('0x45')]));if(_0x1564f3[_0x1fb5('0x43')]['filter']){_0xc87c0c[_0x1fb5('0x4e')]=_['merge'](_0xc87c0c[_0x1fb5('0x4e')],{'$or':_[_0x1fb5('0x3e')](_0xc87c0c[_0x1fb5('0x47')],function(_0x512c69){var _0x1bafb7={};_0x1bafb7[_0x512c69]={'$like':'%'+_0x1564f3[_0x1fb5('0x43')][_0x1fb5('0x64')]+'%'};return _0x1bafb7;})});}_0xc87c0c=_[_0x1fb5('0x50')]({},_0xc87c0c,_0x1564f3['options']);return _0x5d24ef[_0x1fb5('0xbd')](_0xc87c0c);}})[_0x1fb5('0x22')](function(_0x5736fa){if(_0x5736fa){_0x24921c=_0x5736fa['length'];if(!_0x1564f3['query']['hasOwnProperty'](_0x1fb5('0x4a'))){_0xc87c0c[_0x1fb5('0x4b')]=qs[_0x1fb5('0x4b')](_0x1564f3['query'][_0x1fb5('0x4b')]);_0xc87c0c[_0x1fb5('0x32')]=qs['offset'](_0x1564f3[_0x1fb5('0x43')]['offset']);}return _0x5d24ef['getAgents'](_0xc87c0c);}})['then'](function(_0xaa6a24){if(_0xaa6a24){return _0xaa6a24?{'count':_0x24921c,'rows':_0xaa6a24}:null;}})[_0x1fb5('0x22')](respondWithResult(_0x125264,null))[_0x1fb5('0x2c')](handleError(_0x125264,null));};
\ No newline at end of file
diff --git a/server/api/mailAccount/mailAccount.events.js b/server/api/mailAccount/mailAccount.events.js
index 06a9f01..647e3a0 100644
--- a/server/api/mailAccount/mailAccount.events.js
+++ b/server/api/mailAccount/mailAccount.events.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x8bb7=['emit','hasOwnProperty','hook','events','../../mysqldb','MailAccount','setMaxListeners'];(function(_0x3c0944,_0x226337){var _0x6312be=function(_0x56bb5a){while(--_0x56bb5a){_0x3c0944['push'](_0x3c0944['shift']());}};_0x6312be(++_0x226337);}(_0x8bb7,0xf1));var _0x78bb=function(_0xf9163d,_0xc2ff7d){_0xf9163d=_0xf9163d-0x0;var _0x53914e=_0x8bb7[_0xf9163d];return _0x53914e;};'use strict';var EventEmitter=require(_0x78bb('0x0'));var MailAccount=require(_0x78bb('0x1'))['db'][_0x78bb('0x2')];var MailAccountEvents=new EventEmitter();MailAccountEvents[_0x78bb('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0xed53e4){return function(_0x221a85,_0x12ce28,_0x35e952){MailAccountEvents['emit'](_0xed53e4+':'+_0x221a85['id'],_0x221a85);MailAccountEvents[_0x78bb('0x4')](_0xed53e4,_0x221a85);_0x35e952(null);};}for(var e in events){if(events[_0x78bb('0x5')](e)){var event=events[e];MailAccount[_0x78bb('0x6')](e,emitEvent(event));}}module['exports']=MailAccountEvents;
\ No newline at end of file
+var _0x86c9=['hook','exports','events','../../mysqldb','MailAccount','setMaxListeners','save','update','emit','hasOwnProperty'];(function(_0x4fb540,_0x4a1559){var _0x4a21e7=function(_0x3bafd8){while(--_0x3bafd8){_0x4fb540['push'](_0x4fb540['shift']());}};_0x4a21e7(++_0x4a1559);}(_0x86c9,0x16a));var _0x986c=function(_0xca5760,_0x15430d){_0xca5760=_0xca5760-0x0;var _0x3b22cd=_0x86c9[_0xca5760];return _0x3b22cd;};'use strict';var EventEmitter=require(_0x986c('0x0'));var MailAccount=require(_0x986c('0x1'))['db'][_0x986c('0x2')];var MailAccountEvents=new EventEmitter();MailAccountEvents[_0x986c('0x3')](0x0);var events={'afterCreate':_0x986c('0x4'),'afterUpdate':_0x986c('0x5'),'afterDestroy':'remove'};function emitEvent(_0x3ab744){return function(_0x21d555,_0x1935d0,_0x50012d){MailAccountEvents[_0x986c('0x6')](_0x3ab744+':'+_0x21d555['id'],_0x21d555);MailAccountEvents[_0x986c('0x6')](_0x3ab744,_0x21d555);_0x50012d(null);};}for(var e in events){if(events[_0x986c('0x7')](e)){var event=events[e];MailAccount[_0x986c('0x8')](e,emitEvent(event));}}module[_0x986c('0x9')]=MailAccountEvents;
\ No newline at end of file
diff --git a/server/api/mailAccount/mailAccount.model.js b/server/api/mailAccount/mailAccount.model.js
index 317185c..1f24c0a 100644
--- a/server/api/mailAccount/mailAccount.model.js
+++ b/server/api/mailAccount/mailAccount.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xb1c5=['request-promise','path','rimraf','../../config/environment','./mailAccount.attributes','define','MailAccount','mail_accounts','util','../../config/logger','api','moment','bluebird'];(function(_0x40220a,_0x22feb1){var _0x3903cc=function(_0x33a296){while(--_0x33a296){_0x40220a['push'](_0x40220a['shift']());}};_0x3903cc(++_0x22feb1);}(_0xb1c5,0x18e));var _0x5b1c=function(_0x4ff09b,_0x53f67d){_0x4ff09b=_0x4ff09b-0x0;var _0x3f5c2e=_0xb1c5[_0x4ff09b];return _0x3f5c2e;};'use strict';var _=require('lodash');var util=require(_0x5b1c('0x0'));var logger=require(_0x5b1c('0x1'))(_0x5b1c('0x2'));var moment=require(_0x5b1c('0x3'));var BPromise=require(_0x5b1c('0x4'));var rp=require(_0x5b1c('0x5'));var fs=require('fs');var path=require(_0x5b1c('0x6'));var rimraf=require(_0x5b1c('0x7'));var config=require(_0x5b1c('0x8'));var attributes=require(_0x5b1c('0x9'));module['exports']=function(_0x37269d,_0x2a9240){return _0x37269d[_0x5b1c('0xa')](_0x5b1c('0xb'),attributes,{'tableName':_0x5b1c('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xb622=['moment','bluebird','rimraf','./mailAccount.attributes','define','lodash','../../config/logger'];(function(_0x3ca045,_0x52f0a5){var _0x28afe7=function(_0x2b17f6){while(--_0x2b17f6){_0x3ca045['push'](_0x3ca045['shift']());}};_0x28afe7(++_0x52f0a5);}(_0xb622,0x116));var _0x2b62=function(_0xef89cd,_0x41e2d5){_0xef89cd=_0xef89cd-0x0;var _0x51dfc5=_0xb622[_0xef89cd];return _0x51dfc5;};'use strict';var _=require(_0x2b62('0x0'));var util=require('util');var logger=require(_0x2b62('0x1'))('api');var moment=require(_0x2b62('0x2'));var BPromise=require(_0x2b62('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x2b62('0x4'));var config=require('../../config/environment');var attributes=require(_0x2b62('0x5'));module['exports']=function(_0x1c4b1c,_0x16e779){return _0x1c4b1c[_0x2b62('0x6')]('MailAccount',attributes,{'tableName':'mail_accounts','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/mailAccount/mailAccount.rpc.js b/server/api/mailAccount/mailAccount.rpc.js
index 6b35b30..143befc 100644
--- a/server/api/mailAccount/mailAccount.rpc.js
+++ b/server/api/mailAccount/mailAccount.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x115a=['includes','account','List','Contacts','DESC','MailApplication','Applications','MailServerOut','Smtp','omit','applications','orderBy','priority','asc','length','close','create','List\x20not\x20found','messageId','generate','attach','format','YYYY-MM-DD\x20HH:mm:ss','MailInteraction','MailMessage','Messages','inReplyTo','Contact\x20not\x20found','spread','update','subject','interaction','get','created','contact','attachments','bcc','Attachment','UserId','User','find','name','agent','waitForTheAssignedAgent','Start','startRouting','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','./mailAccount.socket','register','request','then','info','request\x20sent','debug','MailAccount,\x20%s,\x20%s,\x20%s','stringify','error','MailAccount,\x20%s,\x20%s','message','result','MailAccount','findAll','options','raw','where','attributes','limit','model','include','map','GetMailAccount','ShowMailAccount','catch','NotifyMailAccount','body','mail','CmContact','updatedAt','CompanyId','isNil','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey'];(function(_0x3c1012,_0x2ad51e){var _0x3c32a3=function(_0x3133c0){while(--_0x3133c0){_0x3c1012['push'](_0x3c1012['shift']());}};_0x3c32a3(++_0x2ad51e);}(_0x115a,0x91));var _0xa115=function(_0x2457c7,_0xc6b53a){_0x2457c7=_0x2457c7-0x0;var _0xce1ded=_0x115a[_0x2457c7];return _0xce1ded;};'use strict';var _=require(_0xa115('0x0'));var util=require(_0xa115('0x1'));var moment=require(_0xa115('0x2'));var BPromise=require(_0xa115('0x3'));var rs=require(_0xa115('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa115('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xa115('0x6'))(_0xa115('0x7'));var config=require(_0xa115('0x8'));var jayson=require(_0xa115('0x9'));var client=jayson[_0xa115('0xa')][_0xa115('0xb')]({'port':0x232c});config['redis']=_[_0xa115('0xc')](config[_0xa115('0xd')],{'host':_0xa115('0xe'),'port':0x18eb});var socket=require(_0xa115('0xf'))(new Redis(config[_0xa115('0xd')]));require(_0xa115('0x10'))[_0xa115('0x11')](socket);function respondWithRpcPromise(_0xc66b44,_0x3ba292,_0xa173e8){return new BPromise(function(_0x46b5c0,_0x5683d6){return client[_0xa115('0x12')](_0xc66b44,_0xa173e8)[_0xa115('0x13')](function(_0x35d056){logger[_0xa115('0x14')]('MailAccount,\x20%s,\x20%s',_0x3ba292,_0xa115('0x15'));logger[_0xa115('0x16')](_0xa115('0x17'),_0x3ba292,_0xa115('0x15'),JSON[_0xa115('0x18')](_0x35d056));if(_0x35d056[_0xa115('0x19')]){if(_0x35d056[_0xa115('0x19')]['code']===0x1f4){logger[_0xa115('0x19')](_0xa115('0x1a'),_0x3ba292,_0x35d056[_0xa115('0x19')][_0xa115('0x1b')]);return _0x5683d6(_0x35d056[_0xa115('0x19')][_0xa115('0x1b')]);}logger[_0xa115('0x19')](_0xa115('0x1a'),_0x3ba292,_0x35d056[_0xa115('0x19')][_0xa115('0x1b')]);return _0x46b5c0(_0x35d056[_0xa115('0x19')][_0xa115('0x1b')]);}else{logger[_0xa115('0x14')]('MailAccount,\x20%s,\x20%s',_0x3ba292,_0xa115('0x15'));_0x46b5c0(_0x35d056[_0xa115('0x1c')][_0xa115('0x1b')]);}})['catch'](function(_0x57f366){logger[_0xa115('0x19')](_0xa115('0x1a'),_0x3ba292,_0x57f366);_0x5683d6(_0x57f366);});});}exports['GetMailAccount']=function(_0x2037ad){var _0x856222=this;return new Promise(function(_0x934aee,_0x39a598){return db[_0xa115('0x1d')][_0xa115('0x1e')]({'raw':_0x2037ad[_0xa115('0x1f')]?_0x2037ad[_0xa115('0x1f')][_0xa115('0x20')]===undefined?!![]:![]:!![],'where':_0x2037ad[_0xa115('0x1f')]?_0x2037ad['options'][_0xa115('0x21')]||null:null,'attributes':_0x2037ad[_0xa115('0x1f')]?_0x2037ad[_0xa115('0x1f')][_0xa115('0x22')]||null:null,'limit':_0x2037ad[_0xa115('0x1f')]?_0x2037ad[_0xa115('0x1f')][_0xa115('0x23')]||null:null,'include':_0x2037ad[_0xa115('0x1f')]?_0x2037ad[_0xa115('0x1f')]['include']?_['map'](_0x2037ad[_0xa115('0x1f')]['include'],function(_0x1b1aba){return{'model':db[_0x1b1aba[_0xa115('0x24')]],'as':_0x1b1aba['as'],'attributes':_0x1b1aba[_0xa115('0x22')],'include':_0x1b1aba[_0xa115('0x25')]?_[_0xa115('0x26')](_0x1b1aba['include'],function(_0x27f411){return{'model':db[_0x27f411[_0xa115('0x24')]],'as':_0x27f411['as'],'attributes':_0x27f411[_0xa115('0x22')],'include':_0x27f411['include']?_[_0xa115('0x26')](_0x27f411['include'],function(_0x55ca62){return{'model':db[_0x55ca62[_0xa115('0x24')]],'as':_0x55ca62['as'],'attributes':_0x55ca62[_0xa115('0x22')]};}):[]};}):[]};}):[]:[]})[_0xa115('0x13')](function(_0x47e36d){logger['info']('GetMailAccount',_0x2037ad);logger[_0xa115('0x16')](_0xa115('0x27'),_0x2037ad,JSON['stringify'](_0x47e36d));_0x934aee(_0x47e36d);})['catch'](function(_0x477b35){logger['error'](_0xa115('0x27'),_0x477b35[_0xa115('0x1b')],_0x2037ad);_0x39a598(_0x856222[_0xa115('0x19')](0x1f4,_0x477b35[_0xa115('0x1b')]));});});};exports[_0xa115('0x28')]=function(_0x5412b0){var _0x24b0ac=this;return new Promise(function(_0x368ee2,_0x33baee){return db[_0xa115('0x1d')]['find']({'raw':_0x5412b0['options']?_0x5412b0[_0xa115('0x1f')][_0xa115('0x20')]===undefined?!![]:![]:!![],'where':_0x5412b0[_0xa115('0x1f')]?_0x5412b0['options'][_0xa115('0x21')]||null:null,'attributes':_0x5412b0[_0xa115('0x1f')]?_0x5412b0[_0xa115('0x1f')][_0xa115('0x22')]||null:null,'include':_0x5412b0[_0xa115('0x1f')]?_0x5412b0[_0xa115('0x1f')]['include']?_['map'](_0x5412b0[_0xa115('0x1f')][_0xa115('0x25')],function(_0x308330){return{'model':db[_0x308330[_0xa115('0x24')]],'as':_0x308330['as'],'attributes':_0x308330[_0xa115('0x22')],'include':_0x308330['include']?_['map'](_0x308330['include'],function(_0x2f9d55){return{'model':db[_0x2f9d55[_0xa115('0x24')]],'as':_0x2f9d55['as'],'attributes':_0x2f9d55[_0xa115('0x22')],'include':_0x2f9d55[_0xa115('0x25')]?_[_0xa115('0x26')](_0x2f9d55['include'],function(_0x21981a){return{'model':db[_0x21981a[_0xa115('0x24')]],'as':_0x21981a['as'],'attributes':_0x21981a['attributes']};}):[]};}):[]};}):[]:[]})[_0xa115('0x13')](function(_0x1deb5b){logger[_0xa115('0x14')](_0xa115('0x28'),_0x5412b0);logger[_0xa115('0x16')]('ShowMailAccount',_0x5412b0,JSON[_0xa115('0x18')](_0x1deb5b));_0x368ee2(_0x1deb5b);})[_0xa115('0x29')](function(_0x1ea74d){logger[_0xa115('0x19')](_0xa115('0x28'),_0x1ea74d[_0xa115('0x1b')],_0x5412b0);_0x33baee(_0x24b0ac[_0xa115('0x19')](0x1f4,_0x1ea74d['message']));});});};exports[_0xa115('0x2a')]=function(_0xfe82b1){var _0x41d3b6=this;return new Promise(function(_0x1656dc,_0x28c203){var _0x3c4209={'body':_0xfe82b1[_0xa115('0x2b')],'channel':_0xa115('0x2c')};var _0x344055=_['difference'](_['keys'](db[_0xa115('0x2d')]['rawAttributes']),['createdAt',_0xa115('0x2e'),_0xa115('0x2f'),'ListId']);var _0x10da2b=![];if(_0xfe82b1[_0xa115('0x2b')]['id']){delete _0xfe82b1[_0xa115('0x2b')]['id'];}if(_[_0xa115('0x30')](_0xfe82b1[_0xa115('0x2b')][_0xa115('0x31')])){return _0x28c203(_0x41d3b6[_0xa115('0x19')](0x1f4,_0xa115('0x32')));}if(_[_0xa115('0x30')](_0xfe82b1[_0xa115('0x2b')]['body'])||_0xfe82b1['body'][_0xa115('0x2b')]===''){return _0x28c203(_0x41d3b6[_0xa115('0x19')](0x1f4,_0xa115('0x33')));}if(_[_0xa115('0x30')](_0xfe82b1[_0xa115('0x2b')][_0xa115('0x34')])){return _0x28c203(_0x41d3b6[_0xa115('0x19')](0x1f4,'mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x344055));}if(!_[_0xa115('0x35')](_0x344055,_0xfe82b1[_0xa115('0x2b')][_0xa115('0x34')])){return _0x28c203(_0x41d3b6['error'](0x1f4,'mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x344055));}var _0x404772={};_0x404772[_0xfe82b1['body'][_0xa115('0x34')]]=_0xfe82b1[_0xa115('0x2b')][_0xa115('0x31')];return db['MailAccount']['find']({'where':{'id':_0xfe82b1[_0xa115('0x36')]['id']},'include':[{'model':db['CmList'],'as':_0xa115('0x37'),'include':[{'model':db[_0xa115('0x2d')],'as':_0xa115('0x38'),'where':_0x404772,'limit':0x1,'order':[[_0xa115('0x2e'),_0xa115('0x39')]]}]},{'model':db[_0xa115('0x3a')],'as':_0xa115('0x3b')},{'model':db[_0xa115('0x3c')],'as':_0xa115('0x3d')}]})[_0xa115('0x13')](function(_0x2b0cbf){if(_0x2b0cbf&&_0x2b0cbf[_0xa115('0x37')]){var _0x51704d=_0x2b0cbf['get']({'plain':!![]});_0x3c4209[_0xa115('0x36')]=_[_0xa115('0x3e')](_0x51704d,[_0xa115('0x3b'),'List']);_0x3c4209[_0xa115('0x3f')]=_0x51704d[_0xa115('0x3b')];_0x3c4209['list']=_0x51704d[_0xa115('0x37')];_0x3c4209['applications']=_[_0xa115('0x40')](_0x3c4209[_0xa115('0x3f')],[_0xa115('0x41')],[_0xa115('0x42')]);if(_0x3c4209[_0xa115('0x36')]&&_0x3c4209[_0xa115('0x36')]['autoclose']){_0x3c4209['applications']['push']({'id':0x0,'priority':_0x3c4209[_0xa115('0x3f')][_0xa115('0x43')]+0x1,'app':_0xa115('0x44'),'appdata':'autoclose','interval':'*,*,*,*'});}if(_0x3c4209['account'][_0xa115('0x3b')]){delete _0x3c4209['account'][_0xa115('0x3b')];}if(_0x3c4209['account'][_0xa115('0x37')]){delete _0x3c4209[_0xa115('0x36')]['List'];}if(_0x51704d[_0xa115('0x37')][_0xa115('0x38')]['length']){return _0x51704d[_0xa115('0x37')]['Contacts'][0x0];}var _0x40230d=_['defaults'](_0xfe82b1['body'],{'firstName':_0xfe82b1[_0xa115('0x2b')][_0xa115('0x31')],'ListId':_0x51704d['ListId']});_0x40230d[_0xfe82b1[_0xa115('0x2b')][_0xa115('0x34')]]=_0xfe82b1[_0xa115('0x2b')][_0xa115('0x31')];return db['CmContact'][_0xa115('0x45')](_0x40230d);}else{throw new Error(_0xa115('0x46'));}})[_0xa115('0x13')](function(_0x366f12){_0x3c4209['contact']=_0x366f12;if(_0x366f12){if(!_0xfe82b1['body']['message'][_0xa115('0x47')]){_0xfe82b1[_0xa115('0x2b')][_0xa115('0x1b')]['messageId']=rs[_0xa115('0x48')]()+'\x20'+_0xfe82b1[_0xa115('0x2b')][_0xa115('0x1b')][_0xa115('0x31')];}var _0x2a430a={'ContactId':_0x366f12['id'],'MailAccountId':_0xfe82b1[_0xa115('0x36')]['id'],'inReplyTo':_0xfe82b1[_0xa115('0x2b')][_0xa115('0x1b')][_0xa115('0x47')],'to':_0xfe82b1[_0xa115('0x2b')]['message']['from'],'cc':_0xfe82b1[_0xa115('0x2b')][_0xa115('0x1b')]['cc'],'subject':_0xfe82b1[_0xa115('0x2b')]['message']['subject'],'attach':_0xfe82b1[_0xa115('0x2b')][_0xa115('0x1b')][_0xa115('0x49')],'lastMsgAt':moment()[_0xa115('0x4a')](_0xa115('0x4b')),'lastMsgDirection':'in','lastMsgBody':_0xfe82b1[_0xa115('0x2b')][_0xa115('0x2b')]};return db[_0xa115('0x4c')]['find']({'where':{'closed':![],'MailAccountId':_0xfe82b1['account']['id']},'include':[{'model':db[_0xa115('0x4d')],'as':_0xa115('0x4e'),'attributes':['messageId'],'where':{'messageId':_0xfe82b1[_0xa115('0x2b')][_0xa115('0x1b')][_0xa115('0x4f')]}}]})[_0xa115('0x13')](function(_0x50a38c){if(_0x50a38c){return[_0x50a38c,![]];}return db['MailInteraction'][_0xa115('0x45')](_0x2a430a)[_0xa115('0x13')](function(_0x40e6f4){return[_0x40e6f4,!![]];});});}else{throw new Error(_0xa115('0x50'));}})[_0xa115('0x51')](function(_0xb26a99,_0x5912da){if(_0xb26a99){_0x10da2b=_0x5912da;if(!_0x5912da){return _0xb26a99[_0xa115('0x52')]({'inReplyTo':_0xfe82b1[_0xa115('0x2b')][_0xa115('0x1b')][_0xa115('0x47')],'to':_0xfe82b1[_0xa115('0x2b')][_0xa115('0x1b')][_0xa115('0x31')],'cc':_0xfe82b1[_0xa115('0x2b')]['message']['cc'],'subject':_0xfe82b1[_0xa115('0x2b')][_0xa115('0x1b')][_0xa115('0x53')],'attach':_0xb26a99['attach']?_0xb26a99[_0xa115('0x49')]:_0xfe82b1[_0xa115('0x2b')][_0xa115('0x1b')][_0xa115('0x49')],'substatus':null,'substatusAt':moment()[_0xa115('0x4a')](_0xa115('0x4b')),'lastMsgAt':moment()[_0xa115('0x4a')](_0xa115('0x4b')),'lastMsgDirection':'in','lastMsgBody':_0xfe82b1[_0xa115('0x2b')][_0xa115('0x2b')]});}else{return _0xb26a99;}}})['then'](function(_0x48ef2c){_0x3c4209[_0xa115('0x54')]=_0x48ef2c[_0xa115('0x55')]({'plain':!![]});_0x3c4209[_0xa115('0x54')][_0xa115('0x56')]=_0x10da2b;return db[_0xa115('0x4d')][_0xa115('0x45')]({'body':_0xfe82b1[_0xa115('0x2b')][_0xa115('0x2b')],'MailAccountId':_0xfe82b1['account']['id'],'MailInteractionId':_0x48ef2c['id'],'direction':'in','ContactId':_0x3c4209[_0xa115('0x57')]['id'],'messageId':_0xfe82b1[_0xa115('0x2b')][_0xa115('0x1b')][_0xa115('0x47')],'from':_0xfe82b1['body'][_0xa115('0x1b')][_0xa115('0x31')],'to':_0xfe82b1[_0xa115('0x2b')][_0xa115('0x1b')]['to'],'cc':_0xfe82b1['body']['message']['cc'],'subject':_0xfe82b1[_0xa115('0x2b')][_0xa115('0x1b')][_0xa115('0x53')],'attach':_0xfe82b1[_0xa115('0x2b')]['message'][_0xa115('0x49')],'Attachments':_0xfe82b1[_0xa115('0x2b')][_0xa115('0x1b')][_0xa115('0x58')],'originTo':_0xfe82b1[_0xa115('0x2b')][_0xa115('0x1b')]['originTo'],'originCc':_0xfe82b1[_0xa115('0x2b')][_0xa115('0x1b')]['originCc'],'bcc':_0xfe82b1[_0xa115('0x2b')][_0xa115('0x1b')][_0xa115('0x59')]},{'include':[{'model':db[_0xa115('0x5a')],'as':'Attachments'}]});})[_0xa115('0x13')](function(_0x34239e){_0x3c4209[_0xa115('0x1b')]=_0x34239e;if(_0x3c4209[_0xa115('0x54')][_0xa115('0x5b')]){return db[_0xa115('0x5c')][_0xa115('0x5d')]({'attributes':['id',_0xa115('0x5e')],'where':{'id':_0x3c4209['interaction'][_0xa115('0x5b')]}})[_0xa115('0x13')](function(_0xfdbf6b){if(_0xfdbf6b){_0x3c4209[_0xa115('0x3f')]['unshift']({'id':0x0,'priority':0x0,'app':_0xa115('0x5f'),'appdata':_0xfdbf6b['name']+','+(_0x3c4209['account'][_0xa115('0x60')]||0xa),'interval':'*,*,*,*'});}return respondWithRpcPromise(_0xa115('0x61'),_0xa115('0x62'),_0x3c4209);});}return respondWithRpcPromise(_0xa115('0x61'),_0xa115('0x62'),_0x3c4209);})[_0xa115('0x13')](function(_0x15c39c){_0x1656dc(_0x15c39c);})[_0xa115('0x29')](function(_0x5a9292){_0x28c203(_0x41d3b6[_0xa115('0x19')](0x1f4,_0x5a9292[_0xa115('0x1b')]));});});};
\ No newline at end of file
+var _0x1ca7=['body','difference','keys','CmContact','createdAt','updatedAt','CompanyId','ListId','isNil','from','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','Contacts','DESC','MailApplication','Applications','MailServerOut','Smtp','List','get','account','omit','list','orderBy','priority','autoclose','push','applications','length','close','create','List\x20not\x20found','contact','messageId','generate','subject','attach','YYYY-MM-DD\x20HH:mm:ss','MailInteraction','MailMessage','spread','update','format','interaction','attachments','bcc','Attachment','Attachments','UserId','User','name','agent','waitForTheAssignedAgent','*,*,*,*','Start','startRouting','lodash','util','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','http','redis','defaults','socket.io-emitter','register','request','then','info','request\x20sent','debug','stringify','error','code','MailAccount,\x20%s,\x20%s','message','result','catch','MailAccount','findAll','options','raw','where','limit','include','map','model','attributes','GetMailAccount','ShowMailAccount','find'];(function(_0x179314,_0x32d3a2){var _0x3556f7=function(_0x16244e){while(--_0x16244e){_0x179314['push'](_0x179314['shift']());}};_0x3556f7(++_0x32d3a2);}(_0x1ca7,0x157));var _0x71ca=function(_0x484e36,_0x4482d8){_0x484e36=_0x484e36-0x0;var _0xafc85d=_0x1ca7[_0x484e36];return _0xafc85d;};'use strict';var _=require(_0x71ca('0x0'));var util=require(_0x71ca('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x71ca('0x2'));var db=require(_0x71ca('0x3'))['db'];var utils=require(_0x71ca('0x4'));var logger=require('../../config/logger')(_0x71ca('0x5'));var config=require(_0x71ca('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0x71ca('0x7')]({'port':0x232c});config[_0x71ca('0x8')]=_[_0x71ca('0x9')](config[_0x71ca('0x8')],{'host':'localhost','port':0x18eb});var socket=require(_0x71ca('0xa'))(new Redis(config[_0x71ca('0x8')]));require('./mailAccount.socket')[_0x71ca('0xb')](socket);function respondWithRpcPromise(_0x2aff62,_0x1fcf82,_0x5def7b){return new BPromise(function(_0x25a84b,_0x342d5c){return client[_0x71ca('0xc')](_0x2aff62,_0x5def7b)[_0x71ca('0xd')](function(_0x1a9590){logger[_0x71ca('0xe')]('MailAccount,\x20%s,\x20%s',_0x1fcf82,_0x71ca('0xf'));logger[_0x71ca('0x10')]('MailAccount,\x20%s,\x20%s,\x20%s',_0x1fcf82,_0x71ca('0xf'),JSON[_0x71ca('0x11')](_0x1a9590));if(_0x1a9590[_0x71ca('0x12')]){if(_0x1a9590[_0x71ca('0x12')][_0x71ca('0x13')]===0x1f4){logger[_0x71ca('0x12')](_0x71ca('0x14'),_0x1fcf82,_0x1a9590[_0x71ca('0x12')][_0x71ca('0x15')]);return _0x342d5c(_0x1a9590[_0x71ca('0x12')]['message']);}logger['error'](_0x71ca('0x14'),_0x1fcf82,_0x1a9590['error'][_0x71ca('0x15')]);return _0x25a84b(_0x1a9590[_0x71ca('0x12')]['message']);}else{logger['info'](_0x71ca('0x14'),_0x1fcf82,'request\x20sent');_0x25a84b(_0x1a9590[_0x71ca('0x16')][_0x71ca('0x15')]);}})[_0x71ca('0x17')](function(_0x3750fa){logger['error']('MailAccount,\x20%s,\x20%s',_0x1fcf82,_0x3750fa);_0x342d5c(_0x3750fa);});});}exports['GetMailAccount']=function(_0x13733f){var _0x3bbb35=this;return new Promise(function(_0x46ffec,_0x257ab1){return db[_0x71ca('0x18')][_0x71ca('0x19')]({'raw':_0x13733f[_0x71ca('0x1a')]?_0x13733f[_0x71ca('0x1a')][_0x71ca('0x1b')]===undefined?!![]:![]:!![],'where':_0x13733f[_0x71ca('0x1a')]?_0x13733f['options'][_0x71ca('0x1c')]||null:null,'attributes':_0x13733f['options']?_0x13733f[_0x71ca('0x1a')]['attributes']||null:null,'limit':_0x13733f['options']?_0x13733f[_0x71ca('0x1a')][_0x71ca('0x1d')]||null:null,'include':_0x13733f[_0x71ca('0x1a')]?_0x13733f[_0x71ca('0x1a')][_0x71ca('0x1e')]?_[_0x71ca('0x1f')](_0x13733f[_0x71ca('0x1a')][_0x71ca('0x1e')],function(_0x35f577){return{'model':db[_0x35f577[_0x71ca('0x20')]],'as':_0x35f577['as'],'attributes':_0x35f577[_0x71ca('0x21')],'include':_0x35f577[_0x71ca('0x1e')]?_[_0x71ca('0x1f')](_0x35f577[_0x71ca('0x1e')],function(_0x5e90b0){return{'model':db[_0x5e90b0[_0x71ca('0x20')]],'as':_0x5e90b0['as'],'attributes':_0x5e90b0[_0x71ca('0x21')],'include':_0x5e90b0[_0x71ca('0x1e')]?_[_0x71ca('0x1f')](_0x5e90b0[_0x71ca('0x1e')],function(_0x30deeb){return{'model':db[_0x30deeb[_0x71ca('0x20')]],'as':_0x30deeb['as'],'attributes':_0x30deeb['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0xabe6e7){logger[_0x71ca('0xe')](_0x71ca('0x22'),_0x13733f);logger['debug']('GetMailAccount',_0x13733f,JSON['stringify'](_0xabe6e7));_0x46ffec(_0xabe6e7);})[_0x71ca('0x17')](function(_0x501357){logger['error'](_0x71ca('0x22'),_0x501357['message'],_0x13733f);_0x257ab1(_0x3bbb35[_0x71ca('0x12')](0x1f4,_0x501357[_0x71ca('0x15')]));});});};exports[_0x71ca('0x23')]=function(_0x5e6c23){var _0x15e975=this;return new Promise(function(_0x290eba,_0xc390ff){return db[_0x71ca('0x18')][_0x71ca('0x24')]({'raw':_0x5e6c23['options']?_0x5e6c23[_0x71ca('0x1a')][_0x71ca('0x1b')]===undefined?!![]:![]:!![],'where':_0x5e6c23[_0x71ca('0x1a')]?_0x5e6c23[_0x71ca('0x1a')][_0x71ca('0x1c')]||null:null,'attributes':_0x5e6c23[_0x71ca('0x1a')]?_0x5e6c23[_0x71ca('0x1a')][_0x71ca('0x21')]||null:null,'include':_0x5e6c23['options']?_0x5e6c23['options'][_0x71ca('0x1e')]?_[_0x71ca('0x1f')](_0x5e6c23[_0x71ca('0x1a')][_0x71ca('0x1e')],function(_0x5bdeda){return{'model':db[_0x5bdeda[_0x71ca('0x20')]],'as':_0x5bdeda['as'],'attributes':_0x5bdeda[_0x71ca('0x21')],'include':_0x5bdeda[_0x71ca('0x1e')]?_['map'](_0x5bdeda[_0x71ca('0x1e')],function(_0x53e22a){return{'model':db[_0x53e22a[_0x71ca('0x20')]],'as':_0x53e22a['as'],'attributes':_0x53e22a[_0x71ca('0x21')],'include':_0x53e22a[_0x71ca('0x1e')]?_[_0x71ca('0x1f')](_0x53e22a[_0x71ca('0x1e')],function(_0x16de9e){return{'model':db[_0x16de9e[_0x71ca('0x20')]],'as':_0x16de9e['as'],'attributes':_0x16de9e[_0x71ca('0x21')]};}):[]};}):[]};}):[]:[]})[_0x71ca('0xd')](function(_0x3bc9fd){logger[_0x71ca('0xe')]('ShowMailAccount',_0x5e6c23);logger[_0x71ca('0x10')](_0x71ca('0x23'),_0x5e6c23,JSON[_0x71ca('0x11')](_0x3bc9fd));_0x290eba(_0x3bc9fd);})['catch'](function(_0x45c8f4){logger[_0x71ca('0x12')](_0x71ca('0x23'),_0x45c8f4[_0x71ca('0x15')],_0x5e6c23);_0xc390ff(_0x15e975[_0x71ca('0x12')](0x1f4,_0x45c8f4['message']));});});};exports['NotifyMailAccount']=function(_0x2e2546){var _0x9a7046=this;return new Promise(function(_0x1ed83a,_0x973028){var _0x316212={'body':_0x2e2546[_0x71ca('0x25')],'channel':'mail'};var _0x4b01b4=_[_0x71ca('0x26')](_[_0x71ca('0x27')](db[_0x71ca('0x28')]['rawAttributes']),[_0x71ca('0x29'),_0x71ca('0x2a'),_0x71ca('0x2b'),_0x71ca('0x2c')]);var _0x437e46=![];if(_0x2e2546[_0x71ca('0x25')]['id']){delete _0x2e2546[_0x71ca('0x25')]['id'];}if(_[_0x71ca('0x2d')](_0x2e2546[_0x71ca('0x25')][_0x71ca('0x2e')])){return _0x973028(_0x9a7046['error'](0x1f4,'from\x20is\x20mandatory'));}if(_[_0x71ca('0x2d')](_0x2e2546['body']['body'])||_0x2e2546['body']['body']===''){return _0x973028(_0x9a7046['error'](0x1f4,_0x71ca('0x2f')));}if(_[_0x71ca('0x2d')](_0x2e2546[_0x71ca('0x25')][_0x71ca('0x30')])){return _0x973028(_0x9a7046[_0x71ca('0x12')](0x1f4,'mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x4b01b4));}if(!_['includes'](_0x4b01b4,_0x2e2546[_0x71ca('0x25')][_0x71ca('0x30')])){return _0x973028(_0x9a7046[_0x71ca('0x12')](0x1f4,_0x71ca('0x31')+_0x4b01b4));}var _0x43197a={};_0x43197a[_0x2e2546[_0x71ca('0x25')]['mapKey']]=_0x2e2546[_0x71ca('0x25')][_0x71ca('0x2e')];return db[_0x71ca('0x18')][_0x71ca('0x24')]({'where':{'id':_0x2e2546['account']['id']},'include':[{'model':db[_0x71ca('0x32')],'as':'List','include':[{'model':db[_0x71ca('0x28')],'as':_0x71ca('0x33'),'where':_0x43197a,'limit':0x1,'order':[[_0x71ca('0x2a'),_0x71ca('0x34')]]}]},{'model':db[_0x71ca('0x35')],'as':_0x71ca('0x36')},{'model':db[_0x71ca('0x37')],'as':_0x71ca('0x38')}]})[_0x71ca('0xd')](function(_0x29d170){if(_0x29d170&&_0x29d170[_0x71ca('0x39')]){var _0x264613=_0x29d170[_0x71ca('0x3a')]({'plain':!![]});_0x316212[_0x71ca('0x3b')]=_[_0x71ca('0x3c')](_0x264613,[_0x71ca('0x36'),_0x71ca('0x39')]);_0x316212['applications']=_0x264613[_0x71ca('0x36')];_0x316212[_0x71ca('0x3d')]=_0x264613[_0x71ca('0x39')];_0x316212['applications']=_[_0x71ca('0x3e')](_0x316212['applications'],[_0x71ca('0x3f')],['asc']);if(_0x316212[_0x71ca('0x3b')]&&_0x316212[_0x71ca('0x3b')][_0x71ca('0x40')]){_0x316212['applications'][_0x71ca('0x41')]({'id':0x0,'priority':_0x316212[_0x71ca('0x42')][_0x71ca('0x43')]+0x1,'app':_0x71ca('0x44'),'appdata':'autoclose','interval':'*,*,*,*'});}if(_0x316212[_0x71ca('0x3b')][_0x71ca('0x36')]){delete _0x316212['account'][_0x71ca('0x36')];}if(_0x316212[_0x71ca('0x3b')]['List']){delete _0x316212[_0x71ca('0x3b')]['List'];}if(_0x264613[_0x71ca('0x39')][_0x71ca('0x33')][_0x71ca('0x43')]){return _0x264613[_0x71ca('0x39')][_0x71ca('0x33')][0x0];}var _0x5d0e64=_['defaults'](_0x2e2546[_0x71ca('0x25')],{'firstName':_0x2e2546[_0x71ca('0x25')][_0x71ca('0x2e')],'ListId':_0x264613['ListId']});_0x5d0e64[_0x2e2546[_0x71ca('0x25')][_0x71ca('0x30')]]=_0x2e2546[_0x71ca('0x25')][_0x71ca('0x2e')];return db[_0x71ca('0x28')][_0x71ca('0x45')](_0x5d0e64);}else{throw new Error(_0x71ca('0x46'));}})[_0x71ca('0xd')](function(_0x46a279){_0x316212[_0x71ca('0x47')]=_0x46a279;if(_0x46a279){if(!_0x2e2546['body']['message'][_0x71ca('0x48')]){_0x2e2546[_0x71ca('0x25')]['message'][_0x71ca('0x48')]=rs[_0x71ca('0x49')]()+'\x20'+_0x2e2546['body'][_0x71ca('0x15')]['from'];}var _0x442eed={'ContactId':_0x46a279['id'],'MailAccountId':_0x2e2546[_0x71ca('0x3b')]['id'],'inReplyTo':_0x2e2546[_0x71ca('0x25')][_0x71ca('0x15')][_0x71ca('0x48')],'to':_0x2e2546['body'][_0x71ca('0x15')]['from'],'cc':_0x2e2546['body'][_0x71ca('0x15')]['cc'],'subject':_0x2e2546['body'][_0x71ca('0x15')][_0x71ca('0x4a')],'attach':_0x2e2546[_0x71ca('0x25')][_0x71ca('0x15')][_0x71ca('0x4b')],'lastMsgAt':moment()['format'](_0x71ca('0x4c')),'lastMsgDirection':'in','lastMsgBody':_0x2e2546['body']['body']};return db[_0x71ca('0x4d')][_0x71ca('0x24')]({'where':{'closed':![],'MailAccountId':_0x2e2546['account']['id']},'include':[{'model':db[_0x71ca('0x4e')],'as':'Messages','attributes':['messageId'],'where':{'messageId':_0x2e2546[_0x71ca('0x25')][_0x71ca('0x15')]['inReplyTo']}}]})[_0x71ca('0xd')](function(_0x7a93bb){if(_0x7a93bb){return[_0x7a93bb,![]];}return db[_0x71ca('0x4d')][_0x71ca('0x45')](_0x442eed)['then'](function(_0x1bb39d){return[_0x1bb39d,!![]];});});}else{throw new Error('Contact\x20not\x20found');}})[_0x71ca('0x4f')](function(_0x191cdc,_0x4bb759){if(_0x191cdc){_0x437e46=_0x4bb759;if(!_0x4bb759){return _0x191cdc[_0x71ca('0x50')]({'inReplyTo':_0x2e2546['body']['message'][_0x71ca('0x48')],'to':_0x2e2546[_0x71ca('0x25')]['message'][_0x71ca('0x2e')],'cc':_0x2e2546['body'][_0x71ca('0x15')]['cc'],'subject':_0x2e2546[_0x71ca('0x25')][_0x71ca('0x15')][_0x71ca('0x4a')],'attach':_0x191cdc[_0x71ca('0x4b')]?_0x191cdc['attach']:_0x2e2546[_0x71ca('0x25')][_0x71ca('0x15')]['attach'],'substatus':null,'substatusAt':moment()[_0x71ca('0x51')](_0x71ca('0x4c')),'lastMsgAt':moment()[_0x71ca('0x51')](_0x71ca('0x4c')),'lastMsgDirection':'in','lastMsgBody':_0x2e2546['body']['body']});}else{return _0x191cdc;}}})[_0x71ca('0xd')](function(_0x5e5912){_0x316212[_0x71ca('0x52')]=_0x5e5912[_0x71ca('0x3a')]({'plain':!![]});_0x316212['interaction']['created']=_0x437e46;return db['MailMessage']['create']({'body':_0x2e2546['body']['body'],'MailAccountId':_0x2e2546[_0x71ca('0x3b')]['id'],'MailInteractionId':_0x5e5912['id'],'direction':'in','ContactId':_0x316212[_0x71ca('0x47')]['id'],'messageId':_0x2e2546[_0x71ca('0x25')][_0x71ca('0x15')][_0x71ca('0x48')],'from':_0x2e2546[_0x71ca('0x25')][_0x71ca('0x15')][_0x71ca('0x2e')],'to':_0x2e2546[_0x71ca('0x25')][_0x71ca('0x15')]['to'],'cc':_0x2e2546[_0x71ca('0x25')][_0x71ca('0x15')]['cc'],'subject':_0x2e2546['body'][_0x71ca('0x15')][_0x71ca('0x4a')],'attach':_0x2e2546[_0x71ca('0x25')][_0x71ca('0x15')][_0x71ca('0x4b')],'Attachments':_0x2e2546[_0x71ca('0x25')]['message'][_0x71ca('0x53')],'originTo':_0x2e2546['body'][_0x71ca('0x15')]['originTo'],'originCc':_0x2e2546[_0x71ca('0x25')][_0x71ca('0x15')]['originCc'],'bcc':_0x2e2546[_0x71ca('0x25')][_0x71ca('0x15')][_0x71ca('0x54')]},{'include':[{'model':db[_0x71ca('0x55')],'as':_0x71ca('0x56')}]});})[_0x71ca('0xd')](function(_0x6e5094){_0x316212['message']=_0x6e5094;if(_0x316212[_0x71ca('0x52')][_0x71ca('0x57')]){return db[_0x71ca('0x58')][_0x71ca('0x24')]({'attributes':['id',_0x71ca('0x59')],'where':{'id':_0x316212[_0x71ca('0x52')][_0x71ca('0x57')]}})[_0x71ca('0xd')](function(_0x4aaa73){if(_0x4aaa73){_0x316212[_0x71ca('0x42')]['unshift']({'id':0x0,'priority':0x0,'app':_0x71ca('0x5a'),'appdata':_0x4aaa73[_0x71ca('0x59')]+','+(_0x316212[_0x71ca('0x3b')][_0x71ca('0x5b')]||0xa),'interval':_0x71ca('0x5c')});}return respondWithRpcPromise(_0x71ca('0x5d'),'startRouting',_0x316212);});}return respondWithRpcPromise(_0x71ca('0x5d'),_0x71ca('0x5e'),_0x316212);})[_0x71ca('0xd')](function(_0x8b1c4f){_0x1ed83a(_0x8b1c4f);})[_0x71ca('0x17')](function(_0x2595c5){_0x973028(_0x9a7046[_0x71ca('0x12')](0x1f4,_0x2595c5['message']));});});};
\ No newline at end of file
diff --git a/server/api/mailAccount/mailAccount.socket.js b/server/api/mailAccount/mailAccount.socket.js
index 7fd99a3..a7891f9 100644
--- a/server/api/mailAccount/mailAccount.socket.js
+++ b/server/api/mailAccount/mailAccount.socket.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x0689=['update','emit','removeListener','register','mailAccount:','save'];(function(_0x281e3a,_0x3e9a4f){var _0x3d5cc0=function(_0x10b843){while(--_0x10b843){_0x281e3a['push'](_0x281e3a['shift']());}};_0x3d5cc0(++_0x3e9a4f);}(_0x0689,0x161));var _0x9068=function(_0x2d6db1,_0x9a6781){_0x2d6db1=_0x2d6db1-0x0;var _0x6379dc=_0x0689[_0x2d6db1];return _0x6379dc;};'use strict';var MailAccountEvents=require('./mailAccount.events');var events=[_0x9068('0x0'),'remove',_0x9068('0x1')];function createListener(_0xcea3b,_0x222292){return function(_0x45c9e5){_0x222292[_0x9068('0x2')](_0xcea3b,_0x45c9e5);};}function removeListener(_0x1c35ba,_0x3b12f4){return function(){MailAccountEvents[_0x9068('0x3')](_0x1c35ba,_0x3b12f4);};}exports[_0x9068('0x4')]=function(_0x287846){for(var _0x5ce5a7=0x0,_0x34cb67=events['length'];_0x5ce5a7<_0x34cb67;_0x5ce5a7++){var _0x4bdd1b=events[_0x5ce5a7];var _0x17bc63=createListener(_0x9068('0x5')+_0x4bdd1b,_0x287846);MailAccountEvents['on'](_0x4bdd1b,_0x17bc63);}};
\ No newline at end of file
+var _0x6eed=['emit','removeListener','register','./mailAccount.events','save','remove','update'];(function(_0x107a84,_0x206679){var _0x3c494a=function(_0x14399d){while(--_0x14399d){_0x107a84['push'](_0x107a84['shift']());}};_0x3c494a(++_0x206679);}(_0x6eed,0xff));var _0xd6ee=function(_0x542850,_0x272d61){_0x542850=_0x542850-0x0;var _0x3a56c5=_0x6eed[_0x542850];return _0x3a56c5;};'use strict';var MailAccountEvents=require(_0xd6ee('0x0'));var events=[_0xd6ee('0x1'),_0xd6ee('0x2'),_0xd6ee('0x3')];function createListener(_0x1a734a,_0x4e325a){return function(_0x25a92a){_0x4e325a[_0xd6ee('0x4')](_0x1a734a,_0x25a92a);};}function removeListener(_0x588715,_0x53cce9){return function(){MailAccountEvents[_0xd6ee('0x5')](_0x588715,_0x53cce9);};}exports[_0xd6ee('0x6')]=function(_0x1c4f36){for(var _0x37abca=0x0,_0x10c1d7=events['length'];_0x37abca<_0x10c1d7;_0x37abca++){var _0x514dc3=events[_0x37abca];var _0x2e6369=createListener('mailAccount:'+_0x514dc3,_0x1c4f36);MailAccountEvents['on'](_0x514dc3,_0x2e6369);}};
\ No newline at end of file
diff --git a/server/api/mailApplication/index.js b/server/api/mailApplication/index.js
index dd0f93f..fd2d9f4 100644
--- a/server/api/mailApplication/index.js
+++ b/server/api/mailApplication/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x153f=['isAuthenticated','show','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','get','/:id'];(function(_0x2b7f1b,_0x387f51){var _0x170e50=function(_0x49a024){while(--_0x49a024){_0x2b7f1b['push'](_0x2b7f1b['shift']());}};_0x170e50(++_0x387f51);}(_0x153f,0x15b));var _0xf153=function(_0x31294d,_0x402504){_0x31294d=_0x31294d-0x0;var _0x5ed716=_0x153f[_0x31294d];return _0x5ed716;};'use strict';var multer=require(_0xf153('0x0'));var util=require(_0xf153('0x1'));var path=require(_0xf153('0x2'));var timeout=require(_0xf153('0x3'));var express=require(_0xf153('0x4'));var router=express[_0xf153('0x5')]();var auth=require(_0xf153('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xf153('0x7'));var controller=require('./mailApplication.controller');router[_0xf153('0x8')](_0xf153('0x9'),auth[_0xf153('0xa')](),controller[_0xf153('0xb')]);router[_0xf153('0xc')]('/:id',auth[_0xf153('0xa')](),controller[_0xf153('0xd')]);router[_0xf153('0xe')](_0xf153('0x9'),auth[_0xf153('0xa')](),controller[_0xf153('0xf')]);module[_0xf153('0x10')]=router;
\ No newline at end of file
+var _0x4fc2=['update','delete','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','./mailApplication.controller','get','isAuthenticated','show','/:id'];(function(_0x26393b,_0x449a84){var _0x57230a=function(_0x583888){while(--_0x583888){_0x26393b['push'](_0x26393b['shift']());}};_0x57230a(++_0x449a84);}(_0x4fc2,0x111));var _0x24fc=function(_0xe7aa32,_0x3a7bba){_0xe7aa32=_0xe7aa32-0x0;var _0x3e10d9=_0x4fc2[_0xe7aa32];return _0x3e10d9;};'use strict';var multer=require(_0x24fc('0x0'));var util=require(_0x24fc('0x1'));var path=require(_0x24fc('0x2'));var timeout=require(_0x24fc('0x3'));var express=require('express');var router=express[_0x24fc('0x4')]();var auth=require(_0x24fc('0x5'));var interaction=require(_0x24fc('0x6'));var config=require('../../config/environment');var controller=require(_0x24fc('0x7'));router[_0x24fc('0x8')]('/:id',auth[_0x24fc('0x9')](),controller[_0x24fc('0xa')]);router['put'](_0x24fc('0xb'),auth[_0x24fc('0x9')](),controller[_0x24fc('0xc')]);router[_0x24fc('0xd')](_0x24fc('0xb'),auth[_0x24fc('0x9')](),controller['destroy']);module[_0x24fc('0xe')]=router;
\ No newline at end of file
diff --git a/server/api/mailApplication/mailApplication.attributes.js b/server/api/mailApplication/mailApplication.attributes.js
index 8beefd4..5ee8e82 100644
--- a/server/api/mailApplication/mailApplication.attributes.js
+++ b/server/api/mailApplication/mailApplication.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xa3c6=['TEXT','*,*,*,*','exports','INTEGER','STRING','noop'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0xa3c6,0x1ca));var _0x6a3c=function(_0x39d7f1,_0xf20b2c){_0x39d7f1=_0x39d7f1-0x0;var _0xe92c8d=_0xa3c6[_0x39d7f1];return _0xe92c8d;};'use strict';var Sequelize=require('sequelize');module[_0x6a3c('0x0')]={'priority':{'type':Sequelize[_0x6a3c('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0x6a3c('0x2')],'allowNull':![],'defaultValue':_0x6a3c('0x3')},'appdata':{'type':Sequelize[_0x6a3c('0x4')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x6a3c('0x2')],'defaultValue':_0x6a3c('0x5')}};
\ No newline at end of file
+var _0x27c8=['STRING','*,*,*,*','sequelize','exports','INTEGER','noop','TEXT'];(function(_0x311c35,_0x534915){var _0x5cc50c=function(_0x3ad680){while(--_0x3ad680){_0x311c35['push'](_0x311c35['shift']());}};_0x5cc50c(++_0x534915);}(_0x27c8,0xb8));var _0x827c=function(_0x2f46dd,_0x4c3724){_0x2f46dd=_0x2f46dd-0x0;var _0x2b401e=_0x27c8[_0x2f46dd];return _0x2b401e;};'use strict';var Sequelize=require(_0x827c('0x0'));module[_0x827c('0x1')]={'priority':{'type':Sequelize[_0x827c('0x2')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x827c('0x3')},'appdata':{'type':Sequelize[_0x827c('0x4')]()},'description':{'type':Sequelize[_0x827c('0x5')]},'interval':{'type':Sequelize[_0x827c('0x5')],'defaultValue':_0x827c('0x6')}};
\ No newline at end of file
diff --git a/server/api/mailApplication/mailApplication.controller.js b/server/api/mailApplication/mailApplication.controller.js
index 67a975f..76ec8eb 100644
--- a/server/api/mailApplication/mailApplication.controller.js
+++ b/server/api/mailApplication/mailApplication.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xece2=['error','name','send','show','params','keys','MailApplication','query','filters','intersection','model','fields','attributes','length','includeAll','include','merge','options','find','catch','body','html-pdf','rimraf','fast-json-patch','request-promise','util','sox','to-csv','lodash','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','Content-Range','update','then','destroy'];(function(_0x1f74e2,_0x208f27){var _0x24ace5=function(_0x129d57){while(--_0x129d57){_0x1f74e2['push'](_0x1f74e2['shift']());}};_0x24ace5(++_0x208f27);}(_0xece2,0x1f2));var _0x2ece=function(_0x84b834,_0x204560){_0x84b834=_0x84b834-0x0;var _0x160b64=_0xece2[_0x84b834];return _0x160b64;};'use strict';var pdf=require(_0x2ece('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x2ece('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x2ece('0x2'));var rp=require(_0x2ece('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x2ece('0x4'));var path=require('path');var sox=require(_0x2ece('0x5'));var csv=require(_0x2ece('0x6'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x2ece('0x7'));var squel=require('squel');var crypto=require(_0x2ece('0x8'));var jsforce=require(_0x2ece('0x9'));var deskjs=require(_0x2ece('0xa'));var toCsv=require(_0x2ece('0x6'));var querystring=require('querystring');var Papa=require(_0x2ece('0xb'));var Redis=require('ioredis');var authService=require(_0x2ece('0xc'));var qs=require(_0x2ece('0xd'));var as=require(_0x2ece('0xe'));var hardwareService=require(_0x2ece('0xf'));var logger=require(_0x2ece('0x10'))(_0x2ece('0x11'));var utils=require(_0x2ece('0x12'));var config=require(_0x2ece('0x13'));var db=require(_0x2ece('0x14'))['db'];function respondWithStatusCode(_0x4d3f64,_0x62e45a){_0x62e45a=_0x62e45a||0xcc;return function(_0x3bcce4){if(_0x3bcce4){return _0x4d3f64[_0x2ece('0x15')](_0x62e45a);}return _0x4d3f64[_0x2ece('0x16')](_0x62e45a)[_0x2ece('0x17')]();};}function respondWithResult(_0x3a2c76,_0x2fa45f){_0x2fa45f=_0x2fa45f||0xc8;return function(_0x247a9b){if(_0x247a9b){return _0x3a2c76[_0x2ece('0x16')](_0x2fa45f)[_0x2ece('0x18')](_0x247a9b);}};}function respondWithFilteredResult(_0x1f4638,_0x1191a2){return function(_0x4f9084){if(_0x4f9084){var _0x2aa769=_0x4f9084[_0x2ece('0x19')],_0x4e502f=_0x1191a2[_0x2ece('0x1a')],_0x2d7ade=_0x1191a2[_0x2ece('0x1a')]+_0x1191a2[_0x2ece('0x1b')],_0x5b73c2;if(_0x2d7ade>=_0x2aa769){_0x2d7ade=_0x2aa769;_0x5b73c2=0xc8;}else{_0x5b73c2=0xce;}_0x1f4638['status'](_0x5b73c2);return _0x1f4638['set'](_0x2ece('0x1c'),_0x4e502f+'-'+_0x2d7ade+'/'+_0x2aa769)['json'](_0x4f9084);}return null;};}function patchUpdates(_0x3bd4c5){return function(_0x3b9484){try{jsonpatch['apply'](_0x3b9484,_0x3bd4c5,!![]);}catch(_0x37b0d7){return BPromise['reject'](_0x37b0d7);}return _0x3b9484['save']();};}function saveUpdates(_0x2eddcc,_0x1c69f9){return function(_0xcecf8){if(_0xcecf8){return _0xcecf8[_0x2ece('0x1d')](_0x2eddcc)[_0x2ece('0x1e')](function(_0x34a5a6){return _0x34a5a6;});}return null;};}function removeEntity(_0xc09cfa,_0x16c27e){return function(_0x384352){if(_0x384352){return _0x384352[_0x2ece('0x1f')]()[_0x2ece('0x1e')](function(){_0xc09cfa[_0x2ece('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1e3b70,_0x550f68){return function(_0x1f777e){if(!_0x1f777e){_0x1e3b70[_0x2ece('0x15')](0x194);}return _0x1f777e;};}function handleError(_0x5aeaeb,_0x3a8320){_0x3a8320=_0x3a8320||0x1f4;return function(_0x3abfe0){logger[_0x2ece('0x20')](_0x3abfe0['stack']);if(_0x3abfe0[_0x2ece('0x21')]){delete _0x3abfe0[_0x2ece('0x21')];}_0x5aeaeb[_0x2ece('0x16')](_0x3a8320)[_0x2ece('0x22')](_0x3abfe0);};}exports[_0x2ece('0x23')]=function(_0x1cd31e,_0x2149ac){var _0x3904ee={'raw':!![],'where':{'id':_0x1cd31e[_0x2ece('0x24')]['id']}},_0x15e13f={};_0x15e13f['model']=_[_0x2ece('0x25')](db[_0x2ece('0x26')]['rawAttributes']);_0x15e13f[_0x2ece('0x27')]=_[_0x2ece('0x25')](_0x1cd31e[_0x2ece('0x27')]);_0x15e13f[_0x2ece('0x28')]=_[_0x2ece('0x29')](_0x15e13f[_0x2ece('0x2a')],_0x15e13f[_0x2ece('0x27')]);_0x3904ee['attributes']=_['intersection'](_0x15e13f['model'],qs[_0x2ece('0x2b')](_0x1cd31e[_0x2ece('0x27')]['fields']));_0x3904ee[_0x2ece('0x2c')]=_0x3904ee[_0x2ece('0x2c')][_0x2ece('0x2d')]?_0x3904ee[_0x2ece('0x2c')]:_0x15e13f[_0x2ece('0x2a')];if(_0x1cd31e['query'][_0x2ece('0x2e')]){_0x3904ee[_0x2ece('0x2f')]=[{'all':!![]}];}_0x3904ee=_[_0x2ece('0x30')]({},_0x3904ee,_0x1cd31e[_0x2ece('0x31')]);return db[_0x2ece('0x26')][_0x2ece('0x32')](_0x3904ee)[_0x2ece('0x1e')](handleEntityNotFound(_0x2149ac,null))[_0x2ece('0x1e')](respondWithResult(_0x2149ac,null))[_0x2ece('0x33')](handleError(_0x2149ac,null));};exports['update']=function(_0x42bc1c,_0x2ba602){if(_0x42bc1c['body']['id']){delete _0x42bc1c['body']['id'];}return db['MailApplication'][_0x2ece('0x32')]({'where':{'id':_0x42bc1c[_0x2ece('0x24')]['id']}})[_0x2ece('0x1e')](handleEntityNotFound(_0x2ba602,null))[_0x2ece('0x1e')](saveUpdates(_0x42bc1c[_0x2ece('0x34')],null))['then'](respondWithResult(_0x2ba602,null))[_0x2ece('0x33')](handleError(_0x2ba602,null));};exports[_0x2ece('0x1f')]=function(_0x4b7f04,_0x5668f1){return db['MailApplication'][_0x2ece('0x32')]({'where':{'id':_0x4b7f04['params']['id']}})[_0x2ece('0x1e')](handleEntityNotFound(_0x5668f1,null))[_0x2ece('0x1e')](removeEntity(_0x5668f1,null))[_0x2ece('0x33')](handleError(_0x5668f1,null));};
\ No newline at end of file
+var _0x2df9=['show','params','model','keys','MailApplication','query','filters','intersection','attributes','fields','length','includeAll','find','catch','body','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','json','offset','limit','apply','reject','update','then','destroy','end','error','name','send'];(function(_0x57dc85,_0x3a6d51){var _0x563a2e=function(_0x5713b2){while(--_0x5713b2){_0x57dc85['push'](_0x57dc85['shift']());}};_0x563a2e(++_0x3a6d51);}(_0x2df9,0x14d));var _0x92df=function(_0x3ac064,_0x278b44){_0x3ac064=_0x3ac064-0x0;var _0x57a926=_0x2df9[_0x3ac064];return _0x57a926;};'use strict';var pdf=require(_0x92df('0x0'));var emlformat=require(_0x92df('0x1'));var rimraf=require(_0x92df('0x2'));var zipdir=require(_0x92df('0x3'));var jsonpatch=require(_0x92df('0x4'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x92df('0x5'));var Mustache=require('mustache');var util=require(_0x92df('0x6'));var path=require(_0x92df('0x7'));var sox=require('sox');var csv=require(_0x92df('0x8'));var ejs=require(_0x92df('0x9'));var fs=require('fs');var _=require(_0x92df('0xa'));var squel=require(_0x92df('0xb'));var crypto=require(_0x92df('0xc'));var jsforce=require(_0x92df('0xd'));var deskjs=require(_0x92df('0xe'));var toCsv=require(_0x92df('0x8'));var querystring=require(_0x92df('0xf'));var Papa=require(_0x92df('0x10'));var Redis=require('ioredis');var authService=require(_0x92df('0x11'));var qs=require(_0x92df('0x12'));var as=require(_0x92df('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x92df('0x14'))(_0x92df('0x15'));var utils=require(_0x92df('0x16'));var config=require(_0x92df('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x38116e,_0x3103bc){_0x3103bc=_0x3103bc||0xcc;return function(_0x38ae82){if(_0x38ae82){return _0x38116e[_0x92df('0x18')](_0x3103bc);}return _0x38116e[_0x92df('0x19')](_0x3103bc)['end']();};}function respondWithResult(_0x5f14ec,_0xc7aa2d){_0xc7aa2d=_0xc7aa2d||0xc8;return function(_0x5eeaa1){if(_0x5eeaa1){return _0x5f14ec[_0x92df('0x19')](_0xc7aa2d)[_0x92df('0x1a')](_0x5eeaa1);}};}function respondWithFilteredResult(_0x3a267f,_0x3ca3df){return function(_0xc71f53){if(_0xc71f53){var _0x4020ff=_0xc71f53['count'],_0x36f251=_0x3ca3df[_0x92df('0x1b')],_0x55dab6=_0x3ca3df[_0x92df('0x1b')]+_0x3ca3df[_0x92df('0x1c')],_0x190cdd;if(_0x55dab6>=_0x4020ff){_0x55dab6=_0x4020ff;_0x190cdd=0xc8;}else{_0x190cdd=0xce;}_0x3a267f[_0x92df('0x19')](_0x190cdd);return _0x3a267f['set']('Content-Range',_0x36f251+'-'+_0x55dab6+'/'+_0x4020ff)['json'](_0xc71f53);}return null;};}function patchUpdates(_0x3f86e6){return function(_0x26c6f6){try{jsonpatch[_0x92df('0x1d')](_0x26c6f6,_0x3f86e6,!![]);}catch(_0x21a3a5){return BPromise[_0x92df('0x1e')](_0x21a3a5);}return _0x26c6f6['save']();};}function saveUpdates(_0x591cc2,_0x4ca459){return function(_0x456574){if(_0x456574){return _0x456574[_0x92df('0x1f')](_0x591cc2)[_0x92df('0x20')](function(_0x4dba2f){return _0x4dba2f;});}return null;};}function removeEntity(_0x25f7be,_0x5cca59){return function(_0x473127){if(_0x473127){return _0x473127[_0x92df('0x21')]()[_0x92df('0x20')](function(){_0x25f7be[_0x92df('0x19')](0xcc)[_0x92df('0x22')]();});}};}function handleEntityNotFound(_0x4f77c3,_0x56f04f){return function(_0x508293){if(!_0x508293){_0x4f77c3[_0x92df('0x18')](0x194);}return _0x508293;};}function handleError(_0x272c69,_0x4b87db){_0x4b87db=_0x4b87db||0x1f4;return function(_0x20debb){logger[_0x92df('0x23')](_0x20debb['stack']);if(_0x20debb[_0x92df('0x24')]){delete _0x20debb['name'];}_0x272c69['status'](_0x4b87db)[_0x92df('0x25')](_0x20debb);};}exports[_0x92df('0x26')]=function(_0x42df1a,_0x405472){var _0x58f212={'raw':!![],'where':{'id':_0x42df1a[_0x92df('0x27')]['id']}},_0x34935c={};_0x34935c[_0x92df('0x28')]=_[_0x92df('0x29')](db[_0x92df('0x2a')]['rawAttributes']);_0x34935c[_0x92df('0x2b')]=_[_0x92df('0x29')](_0x42df1a[_0x92df('0x2b')]);_0x34935c[_0x92df('0x2c')]=_[_0x92df('0x2d')](_0x34935c[_0x92df('0x28')],_0x34935c[_0x92df('0x2b')]);_0x58f212[_0x92df('0x2e')]=_[_0x92df('0x2d')](_0x34935c[_0x92df('0x28')],qs['fields'](_0x42df1a[_0x92df('0x2b')][_0x92df('0x2f')]));_0x58f212['attributes']=_0x58f212[_0x92df('0x2e')][_0x92df('0x30')]?_0x58f212[_0x92df('0x2e')]:_0x34935c[_0x92df('0x28')];if(_0x42df1a[_0x92df('0x2b')][_0x92df('0x31')]){_0x58f212['include']=[{'all':!![]}];}_0x58f212=_['merge']({},_0x58f212,_0x42df1a['options']);return db[_0x92df('0x2a')][_0x92df('0x32')](_0x58f212)['then'](handleEntityNotFound(_0x405472,null))[_0x92df('0x20')](respondWithResult(_0x405472,null))[_0x92df('0x33')](handleError(_0x405472,null));};exports[_0x92df('0x1f')]=function(_0x37a6db,_0x3407fb){if(_0x37a6db[_0x92df('0x34')]['id']){delete _0x37a6db['body']['id'];}return db[_0x92df('0x2a')]['find']({'where':{'id':_0x37a6db[_0x92df('0x27')]['id']}})[_0x92df('0x20')](handleEntityNotFound(_0x3407fb,null))[_0x92df('0x20')](saveUpdates(_0x37a6db['body'],null))['then'](respondWithResult(_0x3407fb,null))['catch'](handleError(_0x3407fb,null));};exports[_0x92df('0x21')]=function(_0xd474c2,_0x3170fb){return db[_0x92df('0x2a')][_0x92df('0x32')]({'where':{'id':_0xd474c2[_0x92df('0x27')]['id']}})[_0x92df('0x20')](handleEntityNotFound(_0x3170fb,null))[_0x92df('0x20')](removeEntity(_0x3170fb,null))['catch'](handleError(_0x3170fb,null));};
\ No newline at end of file
diff --git a/server/api/mailApplication/mailApplication.model.js b/server/api/mailApplication/mailApplication.model.js
index 875a0ff..0c40f48 100644
--- a/server/api/mailApplication/mailApplication.model.js
+++ b/server/api/mailApplication/mailApplication.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x3d95=['moment','request-promise','../../config/environment','exports','MailApplication','mail_applications','utf8mb4','utf8mb4_unicode_ci','../../config/logger','api'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3d95,0xb2));var _0x53d9=function(_0x394d45,_0x466805){_0x394d45=_0x394d45-0x0;var _0x3ba7f9=_0x3d95[_0x394d45];return _0x3ba7f9;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x53d9('0x0'))(_0x53d9('0x1'));var moment=require(_0x53d9('0x2'));var BPromise=require('bluebird');var rp=require(_0x53d9('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x53d9('0x4'));var attributes=require('./mailApplication.attributes');module[_0x53d9('0x5')]=function(_0x29ec42,_0x37b9f0){return _0x29ec42['define'](_0x53d9('0x6'),attributes,{'tableName':_0x53d9('0x7'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x53d9('0x8'),'collate':_0x53d9('0x9')});};
\ No newline at end of file
+var _0x2a9d=['api','moment','bluebird','request-promise','rimraf','../../config/environment','./mailApplication.attributes','exports','define','MailApplication','utf8mb4_unicode_ci'];(function(_0x11dc39,_0x491115){var _0x457277=function(_0x1d77cd){while(--_0x1d77cd){_0x11dc39['push'](_0x11dc39['shift']());}};_0x457277(++_0x491115);}(_0x2a9d,0x108));var _0xd2a9=function(_0x543084,_0x4337f5){_0x543084=_0x543084-0x0;var _0x306a57=_0x2a9d[_0x543084];return _0x306a57;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0xd2a9('0x0'));var moment=require(_0xd2a9('0x1'));var BPromise=require(_0xd2a9('0x2'));var rp=require(_0xd2a9('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd2a9('0x4'));var config=require(_0xd2a9('0x5'));var attributes=require(_0xd2a9('0x6'));module[_0xd2a9('0x7')]=function(_0xdf8f57,_0x17b3b8){return _0xdf8f57[_0xd2a9('0x8')](_0xd2a9('0x9'),attributes,{'tableName':'mail_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xd2a9('0xa')});};
\ No newline at end of file
diff --git a/server/api/mailApplication/mailApplication.rpc.js b/server/api/mailApplication/mailApplication.rpc.js
index a1cc5a9..9e2fe6e 100644
--- a/server/api/mailApplication/mailApplication.rpc.js
+++ b/server/api/mailApplication/mailApplication.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x5a3a=['stringify','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','MailApplication,\x20%s,\x20%s','request\x20sent','MailApplication,\x20%s,\x20%s,\x20%s','error','code','message','catch','MailApplication','update','body','options','raw','where','attributes','UpdateMailApplication','debug'];(function(_0x240030,_0x3d5869){var _0x101d91=function(_0x37c19d){while(--_0x37c19d){_0x240030['push'](_0x240030['shift']());}};_0x101d91(++_0x3d5869);}(_0x5a3a,0x1a1));var _0xa5a3=function(_0x262739,_0x4d8e86){_0x262739=_0x262739-0x0;var _0x5b7176=_0x5a3a[_0x262739];return _0x5b7176;};'use strict';var _=require(_0xa5a3('0x0'));var util=require(_0xa5a3('0x1'));var moment=require('moment');var BPromise=require(_0xa5a3('0x2'));var rs=require(_0xa5a3('0x3'));var fs=require('fs');var Redis=require(_0xa5a3('0x4'));var db=require(_0xa5a3('0x5'))['db'];var utils=require(_0xa5a3('0x6'));var logger=require(_0xa5a3('0x7'))('rpc');var config=require(_0xa5a3('0x8'));var jayson=require(_0xa5a3('0x9'));var client=jayson[_0xa5a3('0xa')][_0xa5a3('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5ab5af,_0x16b75d,_0x90a647){return new BPromise(function(_0x40165a,_0x1d71fe){return client[_0xa5a3('0xc')](_0x5ab5af,_0x90a647)[_0xa5a3('0xd')](function(_0x9714d4){logger[_0xa5a3('0xe')](_0xa5a3('0xf'),_0x16b75d,_0xa5a3('0x10'));logger['debug'](_0xa5a3('0x11'),_0x16b75d,_0xa5a3('0x10'),JSON['stringify'](_0x9714d4));if(_0x9714d4['error']){if(_0x9714d4[_0xa5a3('0x12')][_0xa5a3('0x13')]===0x1f4){logger['error'](_0xa5a3('0xf'),_0x16b75d,_0x9714d4[_0xa5a3('0x12')][_0xa5a3('0x14')]);return _0x1d71fe(_0x9714d4[_0xa5a3('0x12')][_0xa5a3('0x14')]);}logger[_0xa5a3('0x12')](_0xa5a3('0xf'),_0x16b75d,_0x9714d4['error']['message']);return _0x40165a(_0x9714d4[_0xa5a3('0x12')]['message']);}else{logger['info'](_0xa5a3('0xf'),_0x16b75d,_0xa5a3('0x10'));_0x40165a(_0x9714d4['result']['message']);}})[_0xa5a3('0x15')](function(_0x2da6eb){logger[_0xa5a3('0x12')]('MailApplication,\x20%s,\x20%s',_0x16b75d,_0x2da6eb);_0x1d71fe(_0x2da6eb);});});}exports['UpdateMailApplication']=function(_0x45684e){var _0x36ca97=this;return new Promise(function(_0x40c9fe,_0xc6a685){return db[_0xa5a3('0x16')][_0xa5a3('0x17')](_0x45684e[_0xa5a3('0x18')],{'raw':_0x45684e['options']?_0x45684e[_0xa5a3('0x19')][_0xa5a3('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x45684e[_0xa5a3('0x19')]?_0x45684e[_0xa5a3('0x19')][_0xa5a3('0x1b')]||null:null,'attributes':_0x45684e['options']?_0x45684e[_0xa5a3('0x19')][_0xa5a3('0x1c')]||null:null,'limit':_0x45684e[_0xa5a3('0x19')]?_0x45684e['options']['limit']||null:null})[_0xa5a3('0xd')](function(_0x12af2d){logger[_0xa5a3('0xe')](_0xa5a3('0x1d'),_0x45684e);logger[_0xa5a3('0x1e')]('UpdateMailApplication',_0x45684e,JSON[_0xa5a3('0x1f')](_0x12af2d));_0x40c9fe(_0x12af2d);})[_0xa5a3('0x15')](function(_0x2a32ae){logger[_0xa5a3('0x12')]('UpdateMailApplication',_0x2a32ae[_0xa5a3('0x14')],_0x45684e);_0xc6a685(_0x36ca97['error'](0x1f4,_0x2a32ae[_0xa5a3('0x14')]));});});};
\ No newline at end of file
+var _0x318d=['code','message','info','result','UpdateMailApplication','MailApplication','body','options','raw','where','attributes','then','stringify','catch','util','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','MailApplication,\x20%s,\x20%s','request\x20sent','debug','error'];(function(_0x224f65,_0x4750bf){var _0x3f921c=function(_0x1b5f64){while(--_0x1b5f64){_0x224f65['push'](_0x224f65['shift']());}};_0x3f921c(++_0x4750bf);}(_0x318d,0x1c1));var _0xd318=function(_0x194fc4,_0x973613){_0x194fc4=_0x194fc4-0x0;var _0x2773ee=_0x318d[_0x194fc4];return _0x2773ee;};'use strict';var _=require('lodash');var util=require(_0xd318('0x0'));var moment=require('moment');var BPromise=require(_0xd318('0x1'));var rs=require(_0xd318('0x2'));var fs=require('fs');var Redis=require(_0xd318('0x3'));var db=require(_0xd318('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xd318('0x5'));var config=require(_0xd318('0x6'));var jayson=require(_0xd318('0x7'));var client=jayson[_0xd318('0x8')][_0xd318('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xf2e0a,_0x2fbd02,_0x15af3d){return new BPromise(function(_0x39658b,_0x42c6b6){return client[_0xd318('0xa')](_0xf2e0a,_0x15af3d)['then'](function(_0x6e5860){logger['info'](_0xd318('0xb'),_0x2fbd02,_0xd318('0xc'));logger[_0xd318('0xd')]('MailApplication,\x20%s,\x20%s,\x20%s',_0x2fbd02,_0xd318('0xc'),JSON['stringify'](_0x6e5860));if(_0x6e5860[_0xd318('0xe')]){if(_0x6e5860[_0xd318('0xe')][_0xd318('0xf')]===0x1f4){logger[_0xd318('0xe')](_0xd318('0xb'),_0x2fbd02,_0x6e5860[_0xd318('0xe')][_0xd318('0x10')]);return _0x42c6b6(_0x6e5860[_0xd318('0xe')][_0xd318('0x10')]);}logger['error'](_0xd318('0xb'),_0x2fbd02,_0x6e5860[_0xd318('0xe')][_0xd318('0x10')]);return _0x39658b(_0x6e5860[_0xd318('0xe')][_0xd318('0x10')]);}else{logger[_0xd318('0x11')](_0xd318('0xb'),_0x2fbd02,'request\x20sent');_0x39658b(_0x6e5860[_0xd318('0x12')][_0xd318('0x10')]);}})['catch'](function(_0x583f6a){logger[_0xd318('0xe')](_0xd318('0xb'),_0x2fbd02,_0x583f6a);_0x42c6b6(_0x583f6a);});});}exports[_0xd318('0x13')]=function(_0x188457){var _0x445bf2=this;return new Promise(function(_0x15d47b,_0x36c88b){return db[_0xd318('0x14')]['update'](_0x188457[_0xd318('0x15')],{'raw':_0x188457[_0xd318('0x16')]?_0x188457[_0xd318('0x16')][_0xd318('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x188457[_0xd318('0x16')]?_0x188457[_0xd318('0x16')][_0xd318('0x18')]||null:null,'attributes':_0x188457[_0xd318('0x16')]?_0x188457[_0xd318('0x16')][_0xd318('0x19')]||null:null,'limit':_0x188457[_0xd318('0x16')]?_0x188457[_0xd318('0x16')]['limit']||null:null})[_0xd318('0x1a')](function(_0x28470f){logger[_0xd318('0x11')](_0xd318('0x13'),_0x188457);logger[_0xd318('0xd')]('UpdateMailApplication',_0x188457,JSON[_0xd318('0x1b')](_0x28470f));_0x15d47b(_0x28470f);})[_0xd318('0x1c')](function(_0x59c064){logger['error'](_0xd318('0x13'),_0x59c064['message'],_0x188457);_0x36c88b(_0x445bf2[_0xd318('0xe')](0x1f4,_0x59c064[_0xd318('0x10')]));});});};
\ No newline at end of file
diff --git a/server/api/mailInteraction/index.js b/server/api/mailInteraction/index.js
index d8c6f92..d7a1869 100644
--- a/server/api/mailInteraction/index.js
+++ b/server/api/mailInteraction/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xb10f=['mail','addTags','put','update','delete','mailinteraction:destroy','destroy','removeTags','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailInteraction.controller','get','index','/describe','isAuthenticated','/:id','show','/:id/messages','getMessages','/:id/download','download','post','create','addMessage','/:id/tags','tracked'];(function(_0x34a714,_0x272a96){var _0x4b8377=function(_0x2178ad){while(--_0x2178ad){_0x34a714['push'](_0x34a714['shift']());}};_0x4b8377(++_0x272a96);}(_0xb10f,0xa3));var _0xfb10=function(_0x209bb2,_0x1cb28d){_0x209bb2=_0x209bb2-0x0;var _0x32ffa1=_0xb10f[_0x209bb2];return _0x32ffa1;};'use strict';var multer=require('multer');var util=require(_0xfb10('0x0'));var path=require(_0xfb10('0x1'));var timeout=require(_0xfb10('0x2'));var express=require('express');var router=express[_0xfb10('0x3')]();var auth=require(_0xfb10('0x4'));var interaction=require(_0xfb10('0x5'));var config=require(_0xfb10('0x6'));var controller=require(_0xfb10('0x7'));router[_0xfb10('0x8')]('/',auth['isAuthenticated'](),controller[_0xfb10('0x9')]);router[_0xfb10('0x8')](_0xfb10('0xa'),auth[_0xfb10('0xb')](),controller['describe']);router[_0xfb10('0x8')](_0xfb10('0xc'),auth['isAuthenticated'](),controller[_0xfb10('0xd')]);router[_0xfb10('0x8')](_0xfb10('0xe'),auth[_0xfb10('0xb')](),controller[_0xfb10('0xf')]);router[_0xfb10('0x8')](_0xfb10('0x10'),auth['isAuthenticated'](),controller[_0xfb10('0x11')]);router[_0xfb10('0x12')]('/',auth[_0xfb10('0xb')](),controller[_0xfb10('0x13')]);router['post'](_0xfb10('0xe'),auth['isAuthenticated'](),controller[_0xfb10('0x14')]);router[_0xfb10('0x12')](_0xfb10('0x15'),auth[_0xfb10('0xb')](),interaction[_0xfb10('0x16')](_0xfb10('0x17'),'mailinteraction:addtags'),controller[_0xfb10('0x18')]);router[_0xfb10('0x19')](_0xfb10('0xc'),auth[_0xfb10('0xb')](),interaction[_0xfb10('0x16')](_0xfb10('0x17'),'mailinteraction:update'),controller[_0xfb10('0x1a')]);router[_0xfb10('0x1b')](_0xfb10('0xc'),auth[_0xfb10('0xb')](),interaction[_0xfb10('0x16')](_0xfb10('0x17'),_0xfb10('0x1c')),controller[_0xfb10('0x1d')]);router[_0xfb10('0x1b')](_0xfb10('0x15'),auth[_0xfb10('0xb')](),controller[_0xfb10('0x1e')]);module['exports']=router;
\ No newline at end of file
+var _0xe604=['get','describe','/:id','/:id/messages','/:id/download','download','post','mailinteraction:addtags','addTags','mail','mailinteraction:update','tracked','mailinteraction:destroy','delete','/:id/tags','removeTags','exports','multer','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index'];(function(_0x59ec6f,_0x36cd83){var _0x18fb74=function(_0x9729fc){while(--_0x9729fc){_0x59ec6f['push'](_0x59ec6f['shift']());}};_0x18fb74(++_0x36cd83);}(_0xe604,0x101));var _0x4e60=function(_0x2e206d,_0x4e9fbb){_0x2e206d=_0x2e206d-0x0;var _0x454239=_0xe604[_0x2e206d];return _0x454239;};'use strict';var multer=require(_0x4e60('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x4e60('0x1')]();var auth=require(_0x4e60('0x2'));var interaction=require(_0x4e60('0x3'));var config=require(_0x4e60('0x4'));var controller=require('./mailInteraction.controller');router['get']('/',auth[_0x4e60('0x5')](),controller[_0x4e60('0x6')]);router[_0x4e60('0x7')]('/describe',auth[_0x4e60('0x5')](),controller[_0x4e60('0x8')]);router[_0x4e60('0x7')](_0x4e60('0x9'),auth[_0x4e60('0x5')](),controller['show']);router[_0x4e60('0x7')](_0x4e60('0xa'),auth['isAuthenticated'](),controller['getMessages']);router[_0x4e60('0x7')](_0x4e60('0xb'),auth[_0x4e60('0x5')](),controller[_0x4e60('0xc')]);router['post']('/',auth[_0x4e60('0x5')](),controller['create']);router[_0x4e60('0xd')]('/:id/messages',auth['isAuthenticated'](),controller['addMessage']);router[_0x4e60('0xd')]('/:id/tags',auth[_0x4e60('0x5')](),interaction['tracked']('mail',_0x4e60('0xe')),controller[_0x4e60('0xf')]);router['put'](_0x4e60('0x9'),auth[_0x4e60('0x5')](),interaction['tracked'](_0x4e60('0x10'),_0x4e60('0x11')),controller['update']);router['delete'](_0x4e60('0x9'),auth[_0x4e60('0x5')](),interaction[_0x4e60('0x12')]('mail',_0x4e60('0x13')),controller['destroy']);router[_0x4e60('0x14')](_0x4e60('0x15'),auth[_0x4e60('0x5')](),controller[_0x4e60('0x16')]);module[_0x4e60('0x17')]=router;
\ No newline at end of file
diff --git a/server/api/mailInteraction/mailInteraction.attributes.js b/server/api/mailInteraction/mailInteraction.attributes.js
index e782d21..8785cf0 100644
--- a/server/api/mailInteraction/mailInteraction.attributes.js
+++ b/server/api/mailInteraction/mailInteraction.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xc139=['out','sequelize','BOOLEAN','DATE','STRING','TEXT','long','ENUM'];(function(_0x3401de,_0x35f46d){var _0x360475=function(_0x3fad4f){while(--_0x3fad4f){_0x3401de['push'](_0x3401de['shift']());}};_0x360475(++_0x35f46d);}(_0xc139,0x1b9));var _0x9c13=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc139[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x9c13('0x0'));var iconv=require('iconv');module['exports']={'closed':{'type':Sequelize[_0x9c13('0x1')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x9c13('0x2')]},'disposition':{'type':Sequelize[_0x9c13('0x3')]},'note':{'type':Sequelize[_0x9c13('0x3')]},'inReplyTo':{'type':Sequelize[_0x9c13('0x3')](0x1fe)},'to':{'type':Sequelize[_0x9c13('0x3')]},'cc':{'type':Sequelize[_0x9c13('0x4')](_0x9c13('0x5'))},'subject':{'type':Sequelize[_0x9c13('0x4')]()},'attach':{'type':Sequelize[_0x9c13('0x1')],'defaultValue':![]},'read1stAt':{'type':Sequelize[_0x9c13('0x2')]},'substatus':{'type':Sequelize[_0x9c13('0x3')](0x3c)},'substatusAt':{'type':Sequelize[_0x9c13('0x2')]},'firstMsgDirection':{'type':Sequelize[_0x9c13('0x6')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x9c13('0x2')]},'lastMsgDirection':{'type':Sequelize[_0x9c13('0x6')]('in',_0x9c13('0x7')),'defaultValue':'in','allowNull':![]},'lastMsgBody':{'type':Sequelize['TEXT'](_0x9c13('0x5'))},'lastMsgText':{'type':Sequelize['TEXT'](_0x9c13('0x5'))}};
\ No newline at end of file
+var _0xf5b4=['STRING','TEXT','long','ENUM','out','sequelize','iconv','exports','BOOLEAN','DATE'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xf5b4,0x109));var _0x4f5b=function(_0x425755,_0x16e311){_0x425755=_0x425755-0x0;var _0x38c60b=_0xf5b4[_0x425755];return _0x38c60b;};'use strict';var Sequelize=require(_0x4f5b('0x0'));var iconv=require(_0x4f5b('0x1'));module[_0x4f5b('0x2')]={'closed':{'type':Sequelize[_0x4f5b('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x4f5b('0x4')]},'disposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize['STRING']},'inReplyTo':{'type':Sequelize['STRING'](0x1fe)},'to':{'type':Sequelize[_0x4f5b('0x5')]},'cc':{'type':Sequelize[_0x4f5b('0x6')](_0x4f5b('0x7'))},'subject':{'type':Sequelize[_0x4f5b('0x6')]()},'attach':{'type':Sequelize[_0x4f5b('0x3')],'defaultValue':![]},'read1stAt':{'type':Sequelize['DATE']},'substatus':{'type':Sequelize[_0x4f5b('0x5')](0x3c)},'substatusAt':{'type':Sequelize[_0x4f5b('0x4')]},'firstMsgDirection':{'type':Sequelize[_0x4f5b('0x8')]('in',_0x4f5b('0x9')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x4f5b('0x4')]},'lastMsgDirection':{'type':Sequelize[_0x4f5b('0x8')]('in',_0x4f5b('0x9')),'defaultValue':'in','allowNull':![]},'lastMsgBody':{'type':Sequelize['TEXT']('long')},'lastMsgText':{'type':Sequelize[_0x4f5b('0x6')](_0x4f5b('0x7'))}};
\ No newline at end of file
diff --git a/server/api/mailInteraction/mailInteraction.controller.js b/server/api/mailInteraction/mailInteraction.controller.js
index e3313be..35113bf 100644
--- a/server/api/mailInteraction/mailInteraction.controller.js
+++ b/server/api/mailInteraction/mailInteraction.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xa9e0=['MailInteractionId','Setting','enableEmailPreview','push','all','rows','show','params','include','merge','options','create','body','describe','addMessage','MailMessage','ids','omit','intersection','format','YYYY-MM-DD\x20HH:mm:ss','includeAll','findAll','addTags','setTags','emit','mailInteractionTags:save','removeTags','unix','root','files','tmp','server','transcript-%d-%s.zip','join','attachments','Attachment','subject','Messages','get','mkdirSync','each','headers','bcc','Attachments','basename','existsSync','readFileSync','build','writeFileSync','download','log','err','unlinkSync','html-pdf','eml-format','rimraf','request-promise','bluebird','mustache','util','path','sox','ejs','lodash','squel','desk.js','papaparse','html-to-text','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/environment','../../mysqldb','redis','defaults','localhost','./mailInteraction.socket','register','status','count','offset','limit','set','Content-Range','update','destroy','then','sendStatus','stack','name','send','Users','fullname','TagIds','Tags','split','forEach','MailInteraction','findOne','lastMsgText','trimStart','fromString','lastMsgBody','catch','index','map','rawAttributes','fieldName','model','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','select','field','color','from','tools_tags','ui.MailInteractionId','left_join','users','u.id\x20=\x20ui.UserId','mail_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','mail_accounts','a.id\x20=\x20i.MailAccountId','me.MailInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','conditions','value','having','Contact','$substring','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','find','ContactId','buildExpression','text','start','end','Tag','operator','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','plainBody','type','some','compact','isEmpty','MailAccountId','i.MailAccountId\x20IN\x20?','concat','createdAt','parse','$gte','$lte','null','\x20IS\x20NULL','\x20=\x20?','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','filter','replace','\x27\x27\x27\x27','isNumeric','i.id\x20LIKE\x20?','isEmail','MATCH\x20(i.to,\x20i.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','MATCH\x20(me.plainBody,\x20me.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','group','i.id','Sequelize','QueryTypes','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages','order','t.id\x20IN\x20?','journey','i.MailAccountId\x20IS\x20NOT\x20NULL','user','getMailAccounts','i.MailAccountId\x20IS\x20NULL','sequelize','toString','keyBy','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','i.createdAt','i.updatedAt','i.closed','i.closedAt','i.attach','i.lastMsgAt','i.subject','i.disposition','i.substatus','i.to','i.ContactId','i.MailAccountId','i.UserId','c.firstName','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','o.fullname','Owner.fullname','o.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.MailInteractionId\x20IN\x20?','groupBy'];(function(_0x64f05,_0x4e1a8c){var _0x2625b4=function(_0x2403d4){while(--_0x2403d4){_0x64f05['push'](_0x64f05['shift']());}};_0x2625b4(++_0x4e1a8c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5b561d,_0x422b7c){_0x5b561d=_0x5b561d-0x0;var _0x431060=_0xa9e0[_0x5b561d];return _0x431060;};'use strict';var pdf=require(_0x0a9e('0x0'));var emlformat=require(_0x0a9e('0x1'));var rimraf=require(_0x0a9e('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0a9e('0x3'));var moment=require('moment');var BPromise=require(_0x0a9e('0x4'));var Mustache=require(_0x0a9e('0x5'));var util=require(_0x0a9e('0x6'));var path=require(_0x0a9e('0x7'));var sox=require(_0x0a9e('0x8'));var csv=require('to-csv');var ejs=require(_0x0a9e('0x9'));var fs=require('fs');var _=require(_0x0a9e('0xa'));var squel=require(_0x0a9e('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0a9e('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0a9e('0xd'));var htmlToText=require(_0x0a9e('0xe'));var Redis=require(_0x0a9e('0xf'));var authService=require(_0x0a9e('0x10'));var qs=require(_0x0a9e('0x11'));var as=require(_0x0a9e('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x0a9e('0x13'));var db=require(_0x0a9e('0x14'))['db'];config[_0x0a9e('0x15')]=_[_0x0a9e('0x16')](config[_0x0a9e('0x15')],{'host':_0x0a9e('0x17'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x0a9e('0x15')]));require(_0x0a9e('0x18'))[_0x0a9e('0x19')](socket);function respondWithStatusCode(_0x281129,_0x44dcfd){_0x44dcfd=_0x44dcfd||0xcc;return function(_0x4d5611){if(_0x4d5611){return _0x281129['sendStatus'](_0x44dcfd);}return _0x281129[_0x0a9e('0x1a')](_0x44dcfd)['end']();};}function respondWithResult(_0x1985b6,_0x519dfd){_0x519dfd=_0x519dfd||0xc8;return function(_0x16033c){if(_0x16033c){return _0x1985b6[_0x0a9e('0x1a')](_0x519dfd)['json'](_0x16033c);}};}function respondWithFilteredResult(_0x225616,_0x5a0a06){return function(_0x459eb1){if(_0x459eb1){var _0x478723=_0x459eb1[_0x0a9e('0x1b')],_0x106033=_0x5a0a06[_0x0a9e('0x1c')],_0x205fd6=_0x5a0a06[_0x0a9e('0x1c')]+_0x5a0a06[_0x0a9e('0x1d')],_0x31b1ca;if(_0x205fd6>=_0x478723){_0x205fd6=_0x478723;_0x31b1ca=0xc8;}else{_0x31b1ca=0xce;}_0x225616[_0x0a9e('0x1a')](_0x31b1ca);return _0x225616[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0x106033+'-'+_0x205fd6+'/'+_0x478723)['json'](_0x459eb1);}return null;};}function patchUpdates(_0x2c3407){return function(_0x155cce){try{jsonpatch['apply'](_0x155cce,_0x2c3407,!![]);}catch(_0x20f109){return BPromise['reject'](_0x20f109);}return _0x155cce['save']();};}function saveUpdates(_0x3a02e1,_0x432e56){return function(_0x38e7c4){if(_0x38e7c4){return _0x38e7c4[_0x0a9e('0x20')](_0x3a02e1)['then'](function(_0xfb6e48){return _0xfb6e48;});}return null;};}function removeEntity(_0x2fb0e4,_0x3b45bc){return function(_0x4d00e6){if(_0x4d00e6){return _0x4d00e6[_0x0a9e('0x21')]()[_0x0a9e('0x22')](function(){_0x2fb0e4[_0x0a9e('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x59181e,_0x197ec0){return function(_0x3a8e58){if(!_0x3a8e58){_0x59181e[_0x0a9e('0x23')](0x194);}return _0x3a8e58;};}function handleError(_0x33161b,_0x526cf3){_0x526cf3=_0x526cf3||0x1f4;return function(_0x384319){logger['error'](_0x384319[_0x0a9e('0x24')]);if(_0x384319['name']){delete _0x384319[_0x0a9e('0x25')];}_0x33161b[_0x0a9e('0x1a')](_0x526cf3)[_0x0a9e('0x26')](_0x384319);};}function getInteractionUsers(_0x14433c,_0x140511){return new BPromise(function(_0x1538a4,_0x11c3b6){try{if(_0x140511[_0x14433c['id']]){_0x14433c[_0x0a9e('0x27')]=_['map'](_0x140511[_0x14433c['id']],function(_0x3652a7){return{'id':_0x3652a7['id'],'fullname':_0x3652a7[_0x0a9e('0x28')]};});}}catch(_0x2b1f27){_0x11c3b6(_0x2b1f27);}_0x1538a4(_0x14433c);});}function getInteractionTags(_0x2ec755,_0x5c877d){return new BPromise(function(_0x15b200,_0x40e7a3){try{if(_0x2ec755[_0x0a9e('0x29')]){_0x2ec755[_0x0a9e('0x2a')]=[];_0x2ec755[_0x0a9e('0x29')][_0x0a9e('0x2b')](',')[_0x0a9e('0x2c')](function(_0x2e8759){_0x2ec755[_0x0a9e('0x2a')]['push'](_0x5c877d[_0x2e8759]);});}delete _0x2ec755[_0x0a9e('0x29')];}catch(_0x5d1e0e){_0x40e7a3(_0x5d1e0e);}_0x15b200(_0x2ec755);});}function getLastMessageText(_0x2407f9){return new BPromise(function(_0x3ae878,_0x1122db){return db[_0x0a9e('0x2d')][_0x0a9e('0x2e')]({'where':{'id':_0x2407f9['id']},'attributes':['lastMsgBody',_0x0a9e('0x2f')],'raw':!![]})[_0x0a9e('0x22')](function(_0x40cb85){if(!_0x40cb85[_0x0a9e('0x2f')]){_0x2407f9[_0x0a9e('0x2f')]=_[_0x0a9e('0x30')](htmlToText[_0x0a9e('0x31')](_0x40cb85[_0x0a9e('0x32')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]}));}else{_0x2407f9['lastMsgText']=_0x40cb85[_0x0a9e('0x2f')];}_0x3ae878(_0x2407f9);})['catch'](function(_0x2cc7a0){_0x1122db(_0x2cc7a0);});});}function updateMailInteraction(_0x14b13f,_0x2b7e7f,_0x3f3d41,_0x567193){return new BPromise(function(_0x191e91,_0xd1836d){return getInteractionUsers(_0x14b13f,_0x3f3d41)[_0x0a9e('0x22')](function(_0x15de0e){return getInteractionTags(_0x15de0e,_0x2b7e7f);})['then'](function(_0x54135e){if(_0x567193){_0x191e91(getLastMessageText(_0x54135e));}else{_0x191e91(_0x54135e);}})[_0x0a9e('0x33')](function(_0x5640eb){_0xd1836d(_0x5640eb);});});}exports[_0x0a9e('0x34')]=function(_0x3d9717,_0x381c37){var _0x1ef87a={},_0x4f41ae={},_0x31916f={'count':0x0,'rows':[]};var _0x3bfce8=_[_0x0a9e('0x35')](db['MailInteraction'][_0x0a9e('0x36')],function(_0x1a180b){return{'name':_0x1a180b[_0x0a9e('0x37')],'type':_0x1a180b['type']['key']};});_0x4f41ae[_0x0a9e('0x38')]=_[_0x0a9e('0x35')](_0x3bfce8,'name');_0x4f41ae[_0x0a9e('0x39')]=_[_0x0a9e('0x3a')](_0x3d9717[_0x0a9e('0x39')]);_0x4f41ae[_0x0a9e('0x3b')]=_['intersection'](_0x4f41ae['model'],_0x4f41ae[_0x0a9e('0x39')]);_0x1ef87a[_0x0a9e('0x3c')]=_['intersection'](_0x4f41ae[_0x0a9e('0x38')],qs[_0x0a9e('0x3d')](_0x3d9717[_0x0a9e('0x39')]['fields']));_0x1ef87a[_0x0a9e('0x3c')]=_0x1ef87a[_0x0a9e('0x3c')][_0x0a9e('0x3e')]?_0x1ef87a[_0x0a9e('0x3c')]:_0x4f41ae[_0x0a9e('0x38')];if(!_0x3d9717[_0x0a9e('0x39')][_0x0a9e('0x3f')](_0x0a9e('0x40'))){_0x1ef87a[_0x0a9e('0x1d')]=qs[_0x0a9e('0x1d')](_0x3d9717[_0x0a9e('0x39')][_0x0a9e('0x1d')]);_0x1ef87a[_0x0a9e('0x1c')]=qs[_0x0a9e('0x1c')](_0x3d9717[_0x0a9e('0x39')]['offset']);}_0x1ef87a['order']=qs[_0x0a9e('0x41')](_0x3d9717[_0x0a9e('0x39')][_0x0a9e('0x41')]);_0x1ef87a[_0x0a9e('0x42')]=qs[_0x0a9e('0x3b')](_[_0x0a9e('0x43')](_0x3d9717[_0x0a9e('0x39')],_0x4f41ae[_0x0a9e('0x3b')]),_0x3bfce8);var _0x432fcc=[];var _0x25c6e6=squel[_0x0a9e('0x44')]()[_0x0a9e('0x45')]('id')['field'](_0x0a9e('0x25'))[_0x0a9e('0x45')](_0x0a9e('0x46'))[_0x0a9e('0x47')](_0x0a9e('0x48'));var _0xbe9d19=squel[_0x0a9e('0x44')]()[_0x0a9e('0x45')]('u.id')[_0x0a9e('0x45')]('u.fullname')[_0x0a9e('0x45')](_0x0a9e('0x49'))[_0x0a9e('0x47')]('user_has_mail_interactions','ui')[_0x0a9e('0x4a')](_0x0a9e('0x4b'),'u',_0x0a9e('0x4c'));var _0x34aa5a=squel[_0x0a9e('0x44')]()[_0x0a9e('0x47')](_0x0a9e('0x4d'),'i')['left_join'](_0x0a9e('0x4e'),'c',_0x0a9e('0x4f'))[_0x0a9e('0x4a')](_0x0a9e('0x4b'),'o',_0x0a9e('0x50'))[_0x0a9e('0x4a')](_0x0a9e('0x51'),'a',_0x0a9e('0x52'))[_0x0a9e('0x4a')]('mail_messages','me',_0x0a9e('0x53'))[_0x0a9e('0x4a')]('mail_interaction_has_tags','it','it.MailInteractionId\x20=\x20i.id')['left_join'](_0x0a9e('0x48'),'t',_0x0a9e('0x54'));var _0x37edaa=squel[_0x0a9e('0x55')]();var _0x61bb17=[];var _0x30decb=squel[_0x0a9e('0x55')]();var _0x375c18;if(_0x3d9717['query']['search']){_0x375c18=as['parseSearch'](_0x3d9717[_0x0a9e('0x39')][_0x0a9e('0x56')]);var _0x14d602=_0x375c18['sqlOperator'];for(var _0x2b69d9=0x0;_0x2b69d9<_0x375c18[_0x0a9e('0x57')]['length'];_0x2b69d9++){var _0x5a88da=_0x375c18[_0x0a9e('0x57')][_0x2b69d9];var _0x59c6ff='i';var _0x443e72=_['find'](_0x3bfce8,[_0x0a9e('0x25'),_0x5a88da[_0x0a9e('0x45')]]);if(!_0x443e72){switch(_0x5a88da[_0x0a9e('0x45')]){case'unreadMessages':if(_0x5a88da[_0x0a9e('0x58')]==0x1){_0x34aa5a[_0x0a9e('0x59')]('`'+_0x5a88da['field']+'`\x20=\x200');}else{_0x34aa5a[_0x0a9e('0x59')]('`'+_0x5a88da[_0x0a9e('0x45')]+'`\x20>\x200');}break;case _0x0a9e('0x5a'):if(_0x5a88da['operator']===_0x0a9e('0x5b')){if(_0x5a88da['value'][_0x0a9e('0x2b')]('\x20')['length']>0x1){_0x37edaa[_0x14d602]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs['getFullTextValue'](_0x5a88da[_0x0a9e('0x58')]),null);}else{var _0x47de4c='%'+_0x5a88da[_0x0a9e('0x58')]+'%';_0x37edaa[_0x14d602](_0x0a9e('0x5c'),_0x47de4c,_0x47de4c,_0x47de4c);}}else{_0x443e72=_[_0x0a9e('0x5d')](_0x3bfce8,[_0x0a9e('0x25'),_0x0a9e('0x5e')]);_0x5a88da[_0x0a9e('0x45')]=_0x0a9e('0x5e');_0x797b45=as[_0x0a9e('0x5f')](_0x59c6ff,_0x443e72['type'],_0x5a88da);_0x37edaa[_0x14d602](_0x797b45[_0x0a9e('0x60')],_0x797b45[_0x0a9e('0x58')][_0x0a9e('0x61')],_0x797b45[_0x0a9e('0x58')][_0x0a9e('0x62')]);}break;case _0x0a9e('0x63'):var _0x5d86e9=_0x5a88da[_0x0a9e('0x58')][_0x0a9e('0x2b')](',')['map'](function(_0x3649cc){return Number(_0x3649cc);});_0x5d86e9['forEach'](function(_0x20c668){_0x30decb['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x20c668+',%');});_0x61bb17=_['union'](_0x61bb17,_0x5d86e9);break;case'User':if(_0x5a88da[_0x0a9e('0x64')]==='$substring'){_0x37edaa[_0x14d602](_0x0a9e('0x65'),'%'+_0x5a88da[_0x0a9e('0x58')]+'%',null);}else{_0x443e72=_[_0x0a9e('0x5d')](_0x3bfce8,[_0x0a9e('0x25'),_0x0a9e('0x66')]);_0x5a88da[_0x0a9e('0x45')]='UserId';_0x797b45=as[_0x0a9e('0x5f')](_0x59c6ff,_0x443e72['type'],_0x5a88da);_0x37edaa[_0x14d602](_0x797b45[_0x0a9e('0x60')],_0x797b45[_0x0a9e('0x58')][_0x0a9e('0x61')],_0x797b45['value'][_0x0a9e('0x62')]);}break;case _0x0a9e('0x67'):_0x797b45=as[_0x0a9e('0x5f')]('me',null,_0x5a88da);_0x37edaa[_0x14d602](_0x797b45[_0x0a9e('0x60')],_0x797b45['value'][_0x0a9e('0x61')],_0x797b45[_0x0a9e('0x58')]['end']);break;}}else{var _0x797b45=as[_0x0a9e('0x5f')](_0x59c6ff,_0x443e72[_0x0a9e('0x68')],_0x5a88da);_0x37edaa[_0x14d602](_0x797b45[_0x0a9e('0x60')],_0x797b45[_0x0a9e('0x58')]['start'],_0x797b45[_0x0a9e('0x58')][_0x0a9e('0x62')]);}}}else{var _0x281c7d=_(_0x3d9717['query'])[_0x0a9e('0x3a')]()['map'](function(_0x5211e3){return _[_0x0a9e('0x69')](_0x3bfce8,[_0x0a9e('0x25'),_0x5211e3])?_0x5211e3:undefined;})[_0x0a9e('0x6a')]()[_0x0a9e('0x58')]();if(!_[_0x0a9e('0x6b')](_0x281c7d)){_0x281c7d[_0x0a9e('0x2c')](function(_0x387489){if(_0x387489===_0x0a9e('0x6c')){_0x34aa5a[_0x0a9e('0x42')](_0x0a9e('0x6d'),[][_0x0a9e('0x6e')](_0x3d9717[_0x0a9e('0x39')][_0x387489]));}else if(_0x387489===_0x0a9e('0x6f')){var _0x2b8192=JSON[_0x0a9e('0x70')](_0x3d9717[_0x0a9e('0x39')][_0x387489])[_0x0a9e('0x71')];var _0x4257c9=JSON['parse'](_0x3d9717[_0x0a9e('0x39')][_0x387489])[_0x0a9e('0x72')];_0x34aa5a[_0x0a9e('0x42')]('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x2b8192,_0x4257c9);}else{if(_0x3d9717[_0x0a9e('0x39')][_0x387489]===_0x0a9e('0x73')){_0x34aa5a['where']('i.'+_0x387489+_0x0a9e('0x74'));}else{_0x34aa5a[_0x0a9e('0x42')]('i.'+_0x387489+_0x0a9e('0x75'),_0x3d9717[_0x0a9e('0x39')][_0x387489]);}}});}if(_0x3d9717[_0x0a9e('0x39')]['read']){if(_0x3d9717['query']['read']==0x1){_0x34aa5a[_0x0a9e('0x59')](_0x0a9e('0x76'));}else{_0x34aa5a[_0x0a9e('0x59')](_0x0a9e('0x77'));}}if(_0x3d9717[_0x0a9e('0x39')][_0x0a9e('0x78')]){_0x61bb17=_[_0x0a9e('0x79')](_0x3d9717[_0x0a9e('0x39')]['tag'])?_0x3d9717[_0x0a9e('0x39')][_0x0a9e('0x78')]:new Array(_0x3d9717[_0x0a9e('0x39')]['tag']);_0x61bb17[_0x0a9e('0x2c')](function(_0x583b2e){_0x30decb['or'](_0x0a9e('0x7a'),'%,'+_0x583b2e+',%');});}if(_0x3d9717[_0x0a9e('0x39')]['filter']){var _0x2ed01e=_0x3d9717[_0x0a9e('0x39')][_0x0a9e('0x7b')][_0x0a9e('0x7c')]('\x5c','\x5c\x5c')['replace']('\x27\x27',_0x0a9e('0x7d'));if(qs[_0x0a9e('0x7e')](_0x2ed01e)){_0x37edaa['or'](_0x0a9e('0x7f'),_0x2ed01e+'%');}else if(qs[_0x0a9e('0x80')](_0x2ed01e)){_0x37edaa['or']('c.email\x20LIKE\x20?',_0x2ed01e+'%');}else{_0x37edaa['or'](_0x0a9e('0x81'),qs[_0x0a9e('0x82')](_0x2ed01e))['or'](_0x0a9e('0x83'),qs[_0x0a9e('0x82')](_0x2ed01e));}}}_0x34aa5a['where'](_0x37edaa);_0x34aa5a[_0x0a9e('0x84')](_0x0a9e('0x85'));var _0x30a4c7={'type':db[_0x0a9e('0x86')][_0x0a9e('0x87')][_0x0a9e('0x88')],'raw':!![]};var _0x40fc56=_0x34aa5a[_0x0a9e('0x89')]();_0x40fc56[_0x0a9e('0x45')](_0x0a9e('0x85'));_0x40fc56[_0x0a9e('0x45')](_0x0a9e('0x8a'),_0x0a9e('0x8b'));if(_0x1ef87a[_0x0a9e('0x8c')]){_0x1ef87a['order'][_0x0a9e('0x2c')](function(_0x11da9c){_0x34aa5a[_0x0a9e('0x8c')]('i.'+_0x11da9c[0x0],_0x11da9c[0x1]==='DESC'?![]:!![]);});}if(!_[_0x0a9e('0x6b')](_0x61bb17)){_0x34aa5a[_0x0a9e('0x59')](_0x30decb);_0x40fc56[_0x0a9e('0x42')](_0x0a9e('0x8d'),_0x61bb17);}BPromise['resolve']()['then'](function(){if(!_0x375c18){if(_0x3d9717[_0x0a9e('0x39')][_0x0a9e('0x6c')]||_0x3d9717['query'][_0x0a9e('0x8e')])return;_0x40fc56['where'](_0x0a9e('0x8f'));_0x34aa5a[_0x0a9e('0x42')]('i.MailAccountId\x20IS\x20NOT\x20NULL');return;}return _0x3d9717[_0x0a9e('0x90')][_0x0a9e('0x91')]({'attributes':['id'],'raw':!![]})[_0x0a9e('0x22')](function(_0x42b959){if(_[_0x0a9e('0x6b')](_0x42b959)){_0x40fc56[_0x0a9e('0x42')](_0x0a9e('0x92'));_0x34aa5a['where'](_0x0a9e('0x92'));}else{_0x40fc56[_0x0a9e('0x42')](_0x0a9e('0x6d'),_[_0x0a9e('0x35')](_0x42b959,'id'));_0x34aa5a['where'](_0x0a9e('0x6d'),_[_0x0a9e('0x35')](_0x42b959,'id'));}});})['then'](function(){db[_0x0a9e('0x93')]['query'](_0x40fc56[_0x0a9e('0x94')](),_0x30a4c7)[_0x0a9e('0x22')](function(_0x3003eb){_0x31916f[_0x0a9e('0x1b')]=_0x3003eb['length'];if(_0x31916f['count']===0x0)return[];return db[_0x0a9e('0x93')][_0x0a9e('0x39')](_0x25c6e6[_0x0a9e('0x94')](),_0x30a4c7)['then'](function(_0x3b4a9f){_0x432fcc=_[_0x0a9e('0x95')](_0x3b4a9f,'id');_0x30a4c7=_['merge'](_0x30a4c7,{'model':db['MailInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x3d9717[_0x0a9e('0x39')]['fields']){_0x1ef87a['attributes']['forEach'](function(_0x81d748){_0x34aa5a[_0x0a9e('0x45')]('i.'+_0x81d748);});}else{_0x34aa5a[_0x0a9e('0x45')](_0x0a9e('0x8a'),_0x0a9e('0x8b'));_0x34aa5a[_0x0a9e('0x45')]('a.key',_0x0a9e('0x96'));_0x34aa5a['field'](_0x0a9e('0x97'),_0x0a9e('0x98'));_0x34aa5a[_0x0a9e('0x45')](_0x0a9e('0x85'));_0x34aa5a['field'](_0x0a9e('0x99'));_0x34aa5a[_0x0a9e('0x45')](_0x0a9e('0x9a'));_0x34aa5a['field'](_0x0a9e('0x9b'));_0x34aa5a[_0x0a9e('0x45')](_0x0a9e('0x9c'));_0x34aa5a[_0x0a9e('0x45')](_0x0a9e('0x9d'));_0x34aa5a[_0x0a9e('0x45')](_0x0a9e('0x9e'));_0x34aa5a[_0x0a9e('0x45')]('i.lastMsgDirection');_0x34aa5a[_0x0a9e('0x45')](_0x0a9e('0x9f'));_0x34aa5a['field'](_0x0a9e('0xa0'));_0x34aa5a[_0x0a9e('0x45')](_0x0a9e('0xa1'));_0x34aa5a['field'](_0x0a9e('0xa2'));_0x34aa5a['field'](_0x0a9e('0xa3'));_0x34aa5a[_0x0a9e('0x45')](_0x0a9e('0xa4'));_0x34aa5a[_0x0a9e('0x45')](_0x0a9e('0xa5'));_0x34aa5a[_0x0a9e('0x45')](_0x0a9e('0xa6'),_0x0a9e('0xa7'));_0x34aa5a['field'](_0x0a9e('0xa8'),_0x0a9e('0xa9'));_0x34aa5a[_0x0a9e('0x45')](_0x0a9e('0xaa'),_0x0a9e('0xab'));_0x34aa5a[_0x0a9e('0x45')](_0x0a9e('0xac'),_0x0a9e('0xad'));_0x34aa5a[_0x0a9e('0x45')](_0x0a9e('0xae'),_0x0a9e('0xaf'));_0x34aa5a[_0x0a9e('0x45')](_0x0a9e('0xb0'),'Contact.fax');_0x34aa5a[_0x0a9e('0x45')](_0x0a9e('0xb1'),_0x0a9e('0xb2'));_0x34aa5a[_0x0a9e('0x45')](_0x0a9e('0xb3'),'Owner.internal');_0x34aa5a[_0x0a9e('0x45')](_0x0a9e('0xb4'),'TagIds');}if(_0x1ef87a[_0x0a9e('0x1d')])_0x34aa5a['limit'](_0x1ef87a[_0x0a9e('0x1d')]);if(_0x1ef87a[_0x0a9e('0x1c')])_0x34aa5a[_0x0a9e('0x1c')](_0x1ef87a[_0x0a9e('0x1c')]);return db['sequelize'][_0x0a9e('0x39')](_0x34aa5a['toString'](),_0x30a4c7);})[_0x0a9e('0x22')](function(_0x3d0a77){_0xbe9d19['where'](_0x0a9e('0xb5'),_[_0x0a9e('0x35')](_0x3d0a77,'id'));return db[_0x0a9e('0x93')]['query'](_0xbe9d19['toString'](),_0x30a4c7)[_0x0a9e('0x22')](function(_0x6ba2be){var _0x1707dc=_[_0x0a9e('0xb6')](_0x6ba2be,_0x0a9e('0xb7'));var _0x2450a8=[];return db[_0x0a9e('0xb8')][_0x0a9e('0x2e')]({'attributes':[_0x0a9e('0xb9')],'raw':!![]})['then'](function(_0x3156c7){var _0x517081=_0x3156c7[_0x0a9e('0xb9')];_0x3d0a77[_0x0a9e('0x2c')](function(_0x34e745){_0x2450a8[_0x0a9e('0xba')](updateMailInteraction(_0x34e745,_0x432fcc,_0x1707dc,_0x517081));});return BPromise[_0x0a9e('0xbb')](_0x2450a8);});});});})['then'](function(_0x436313){_0x31916f[_0x0a9e('0xbc')]=_0x436313;return _0x31916f;})[_0x0a9e('0x22')](respondWithFilteredResult(_0x381c37,_0x1ef87a));})[_0x0a9e('0x33')](handleError(_0x381c37,null));};exports[_0x0a9e('0xbd')]=function(_0x5c66ef,_0x4f074c){var _0x22a3cb={'raw':![],'where':{'id':_0x5c66ef[_0x0a9e('0xbe')]['id']}},_0x583662={};_0x583662[_0x0a9e('0x38')]=_[_0x0a9e('0x3a')](db[_0x0a9e('0x2d')][_0x0a9e('0x36')]);_0x583662[_0x0a9e('0x39')]=_['keys'](_0x5c66ef['query']);_0x583662[_0x0a9e('0x3b')]=_['intersection'](_0x583662[_0x0a9e('0x38')],_0x583662['query']);_0x22a3cb[_0x0a9e('0x3c')]=_['intersection'](_0x583662['model'],qs[_0x0a9e('0x3d')](_0x5c66ef[_0x0a9e('0x39')]['fields']));_0x22a3cb[_0x0a9e('0x3c')]=_0x22a3cb[_0x0a9e('0x3c')][_0x0a9e('0x3e')]?_0x22a3cb[_0x0a9e('0x3c')]:_0x583662[_0x0a9e('0x38')];if(_0x5c66ef['query']['includeAll']){_0x22a3cb[_0x0a9e('0xbf')]=[{'all':!![]}];}_0x22a3cb=_[_0x0a9e('0xc0')]({},_0x22a3cb,_0x5c66ef[_0x0a9e('0xc1')]);return db[_0x0a9e('0x2d')][_0x0a9e('0x5d')](_0x22a3cb)['then'](handleEntityNotFound(_0x4f074c,null))[_0x0a9e('0x22')](respondWithResult(_0x4f074c,null))[_0x0a9e('0x33')](handleError(_0x4f074c,null));};exports['create']=function(_0x3c313d,_0x19fd11){return db[_0x0a9e('0x2d')][_0x0a9e('0xc2')](_0x3c313d[_0x0a9e('0xc3')],{})[_0x0a9e('0x22')](respondWithResult(_0x19fd11,0xc9))[_0x0a9e('0x33')](handleError(_0x19fd11,null));};exports[_0x0a9e('0x20')]=function(_0x40dd2a,_0x16afb3){if(_0x40dd2a['body']['id']){delete _0x40dd2a[_0x0a9e('0xc3')]['id'];}return db[_0x0a9e('0x2d')][_0x0a9e('0x5d')]({'where':{'id':_0x40dd2a[_0x0a9e('0xbe')]['id']}})[_0x0a9e('0x22')](handleEntityNotFound(_0x16afb3,null))['then'](saveUpdates(_0x40dd2a['body'],null))[_0x0a9e('0x22')](respondWithResult(_0x16afb3,null))[_0x0a9e('0x33')](handleError(_0x16afb3,null));};exports[_0x0a9e('0x21')]=function(_0x2fea95,_0x34f7b5){return db['MailInteraction'][_0x0a9e('0x5d')]({'where':{'id':_0x2fea95[_0x0a9e('0xbe')]['id']}})[_0x0a9e('0x22')](handleEntityNotFound(_0x34f7b5,null))['then'](removeEntity(_0x34f7b5,null))[_0x0a9e('0x33')](handleError(_0x34f7b5,null));};exports['describe']=function(_0x2144ca,_0x4799d4){return db[_0x0a9e('0x2d')][_0x0a9e('0xc4')]()[_0x0a9e('0x22')](respondWithResult(_0x4799d4,null))['catch'](handleError(_0x4799d4,null));};exports[_0x0a9e('0xc5')]=function(_0x5ed560,_0x4383da,_0x2b1824){return db[_0x0a9e('0xc6')][_0x0a9e('0x5d')]({'where':{'id':_0x5ed560[_0x0a9e('0xbe')]['id']}})[_0x0a9e('0x22')](handleEntityNotFound(_0x4383da,null))[_0x0a9e('0x22')](function(_0xe89aaa){if(_0xe89aaa){return _0xe89aaa[_0x0a9e('0xc5')](_0x5ed560[_0x0a9e('0xc3')][_0x0a9e('0xc7')],_[_0x0a9e('0xc8')](_0x5ed560[_0x0a9e('0xc3')],[_0x0a9e('0xc7'),'id'])||{});}})[_0x0a9e('0x22')](respondWithResult(_0x4383da,null))[_0x0a9e('0x33')](handleError(_0x4383da,null));};exports['getMessages']=function(_0x556443,_0x6eaaf0,_0x5c4be0){var _0x1d999b={'raw':![],'where':{}};var _0x3428c9={};var _0x5d6b69={'count':0x0,'rows':[]};return db[_0x0a9e('0x2d')][_0x0a9e('0x2e')]({'where':{'id':_0x556443[_0x0a9e('0xbe')]['id']}})[_0x0a9e('0x22')](handleEntityNotFound(_0x6eaaf0,null))['then'](function(_0x148fd9){if(_0x148fd9){_0x3428c9[_0x0a9e('0x38')]=_[_0x0a9e('0x3a')](db[_0x0a9e('0xc6')]['rawAttributes']);_0x3428c9[_0x0a9e('0x39')]=_[_0x0a9e('0x3a')](_0x556443[_0x0a9e('0x39')]);_0x3428c9['filters']=_[_0x0a9e('0xc9')](_0x3428c9[_0x0a9e('0x38')],_0x3428c9[_0x0a9e('0x39')]);_0x1d999b['attributes']=_[_0x0a9e('0xc9')](_0x3428c9[_0x0a9e('0x38')],qs[_0x0a9e('0x3d')](_0x556443[_0x0a9e('0x39')][_0x0a9e('0x3d')]));_0x1d999b['attributes']=_0x1d999b[_0x0a9e('0x3c')][_0x0a9e('0x3e')]?_0x1d999b['attributes']:_0x3428c9[_0x0a9e('0x38')];if(!_0x556443[_0x0a9e('0x39')][_0x0a9e('0x3f')]('nolimit')){_0x1d999b['limit']=qs['limit'](_0x556443[_0x0a9e('0x39')][_0x0a9e('0x1d')]);_0x1d999b['offset']=qs[_0x0a9e('0x1c')](_0x556443[_0x0a9e('0x39')][_0x0a9e('0x1c')]);}_0x1d999b['order']=qs[_0x0a9e('0x41')](_0x556443[_0x0a9e('0x39')][_0x0a9e('0x41')]);_0x1d999b[_0x0a9e('0x42')]=qs[_0x0a9e('0x3b')](_[_0x0a9e('0x43')](_0x556443[_0x0a9e('0x39')],_0x3428c9[_0x0a9e('0x3b')]));_0x1d999b[_0x0a9e('0x42')]['MailInteractionId']=_0x148fd9['id'];if(_0x556443[_0x0a9e('0x39')]['filter']){_0x1d999b[_0x0a9e('0x42')]=_[_0x0a9e('0xc0')](_0x1d999b[_0x0a9e('0x42')],{'$or':_[_0x0a9e('0x35')](_0x1d999b[_0x0a9e('0x3c')],function(_0x344cd4){var _0x53d9fc={};_0x53d9fc[_0x344cd4]={'$like':'%'+_0x556443[_0x0a9e('0x39')][_0x0a9e('0x7b')]+'%'};return _0x53d9fc;})});}if(_0x556443[_0x0a9e('0x39')][_0x0a9e('0x71')]){var _0x51aa2f=_0x556443[_0x0a9e('0x39')][_0x0a9e('0x71')][_0x0a9e('0x2b')](',');var _0x1c9539={};_0x1c9539[_0x51aa2f[0x0]]={'$gte':moment(_0x51aa2f[0x1])[_0x0a9e('0xca')](_0x0a9e('0xcb'))};_0x1d999b[_0x0a9e('0x42')]=_[_0x0a9e('0xc0')](_0x1d999b[_0x0a9e('0x42')],_0x1c9539);}_0x1d999b=_[_0x0a9e('0xc0')]({},_0x1d999b,_0x556443['options']);return db[_0x0a9e('0xc6')][_0x0a9e('0x1b')]({'where':_0x1d999b[_0x0a9e('0x42')]})[_0x0a9e('0x22')](function(_0xea8bd1){_0x5d6b69[_0x0a9e('0x1b')]=_0xea8bd1;if(_0x556443[_0x0a9e('0x39')][_0x0a9e('0xcc')]){_0x1d999b['include']=[{'all':!![]}];}return db[_0x0a9e('0xc6')][_0x0a9e('0xcd')](_0x1d999b);})[_0x0a9e('0x22')](function(_0x5c65fc){_0x5d6b69[_0x0a9e('0xbc')]=_0x5c65fc;return _0x5d6b69;});}})[_0x0a9e('0x22')](respondWithFilteredResult(_0x6eaaf0,_0x1d999b))[_0x0a9e('0x33')](handleError(_0x6eaaf0,null));};exports[_0x0a9e('0xce')]=function(_0x370b5e,_0x1ba457,_0x424f1b){return db[_0x0a9e('0x2d')][_0x0a9e('0x5d')]({'where':{'id':_0x370b5e[_0x0a9e('0xbe')]['id']}})['then'](handleEntityNotFound(_0x1ba457,null))[_0x0a9e('0x22')](function(_0x446e6){if(_0x446e6){return _0x446e6[_0x0a9e('0xcf')](_0x370b5e[_0x0a9e('0xc3')][_0x0a9e('0xc7')],_[_0x0a9e('0xc8')](_0x370b5e['body'],[_0x0a9e('0xc7'),'id'])||{})['spread'](function(){return db['Tag']['findAll']({'attributes':['id',_0x0a9e('0x25'),_0x0a9e('0x46')],'where':{'id':_0x370b5e[_0x0a9e('0xc3')][_0x0a9e('0xc7')]}});})['then'](function(_0x4156a5){socket[_0x0a9e('0xd0')](_0x0a9e('0xd1'),{'id':Number(_0x370b5e[_0x0a9e('0xbe')]['id']),'tags':_0x4156a5||[]});return{'id':Number(_0x370b5e[_0x0a9e('0xbe')]['id']),'tags':_0x4156a5||[]};});}})['then'](respondWithResult(_0x1ba457,null))['catch'](handleError(_0x1ba457,null));};exports[_0x0a9e('0xd2')]=function(_0x33bcb2,_0x2a293f,_0x5e85d0){return db[_0x0a9e('0x2d')][_0x0a9e('0x5d')]({'where':{'id':_0x33bcb2[_0x0a9e('0xbe')]['id']}})['then'](handleEntityNotFound(_0x2a293f,null))[_0x0a9e('0x22')](function(_0x2bf85d){if(_0x2bf85d){return _0x2bf85d[_0x0a9e('0xd2')](_0x33bcb2['query'][_0x0a9e('0xc7')]);}})[_0x0a9e('0x22')](respondWithStatusCode(_0x2a293f,null))[_0x0a9e('0x33')](handleError(_0x2a293f,null));};exports['download']=function(_0x549697,_0x53ef46){var _0x3b04fd=moment()[_0x0a9e('0xd3')]()[_0x0a9e('0x94')]();var _0x26931c=path['join'](config[_0x0a9e('0xd4')],'server',_0x0a9e('0xd5'),_0x0a9e('0xd6'));var _0x242f23=path['join'](config[_0x0a9e('0xd4')],_0x0a9e('0xd7'),_0x0a9e('0xd5'),'attachments');var _0x40eb5d=path['join'](_0x26931c,_0x3b04fd);var _0x1b637c=util['format'](_0x0a9e('0xd8'),_0x549697['params']['id'],_0x3b04fd);var _0xb14971=path[_0x0a9e('0xd9')](_0x26931c,_0x1b637c);var _0xa288e4=[];if(_0x549697[_0x0a9e('0x39')][_0x0a9e('0xda')]){_0xa288e4[_0x0a9e('0xba')]({'model':db[_0x0a9e('0xdb')],'as':'Attachments','raw':!![]});}var _0x35ace3=[{'model':db[_0x0a9e('0xc6')],'as':'Messages','attributes':['id',_0x0a9e('0xc3'),_0x0a9e('0x47'),'to','cc','bcc',_0x0a9e('0xdc'),_0x0a9e('0x6f')],'where':{'secret':![]},'order':qs[_0x0a9e('0x41')]('id'),'include':_0xa288e4}];return db['MailInteraction'][_0x0a9e('0x5d')]({'where':{'id':_0x549697[_0x0a9e('0xbe')]['id']},'include':_0x35ace3})[_0x0a9e('0x22')](handleEntityNotFound(_0x53ef46,null))[_0x0a9e('0x22')](function(_0x2003bc){if(_0x2003bc&&_0x2003bc[_0x0a9e('0xdd')]){var _0x3ba897=_0x2003bc[_0x0a9e('0xde')]({'plain':!![]});fs[_0x0a9e('0xdf')](_0x40eb5d);return BPromise[_0x0a9e('0xe0')](_0x3ba897['Messages'],function(_0x1799d8,_0x53c7de){var _0x3c9854={'from':_0x1799d8[_0x0a9e('0x47')],'to':_0x1799d8['to'],'subject':_0x1799d8[_0x0a9e('0xdc')],'html':_0x1799d8[_0x0a9e('0xc3')],'headers':{'Date':moment(_0x1799d8[_0x0a9e('0x6f')])[_0x0a9e('0xca')]('ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ')},'attachments':[]};if(_0x1799d8['cc']){_0x3c9854[_0x0a9e('0xe1')]['Cc']=_0x1799d8['cc'];}if(_0x1799d8[_0x0a9e('0xe2')]){_0x3c9854[_0x0a9e('0xe1')]['Bcc']=_0x1799d8[_0x0a9e('0xe2')];}return new BPromise(function(_0x402544,_0x4435d2){if(_0x1799d8[_0x0a9e('0xe3')]){for(var _0x31e1e0=0x0;_0x31e1e0<_0x1799d8[_0x0a9e('0xe3')][_0x0a9e('0x3e')];_0x31e1e0++){var _0x5f2c51=_0x1799d8[_0x0a9e('0xe3')][_0x31e1e0];var _0x228c10=path[_0x0a9e('0xd9')](_0x242f23,_0x5f2c51[_0x0a9e('0xe4')]);if(fs[_0x0a9e('0xe5')](_0x228c10)){_0x3c9854[_0x0a9e('0xda')][_0x0a9e('0xba')]({'name':_0x5f2c51['name'],'contentType':_0x5f2c51['type'],'data':fs[_0x0a9e('0xe6')](_0x228c10)});}}}emlformat[_0x0a9e('0xe7')](_0x3c9854,function(_0x1f4929,_0x1bf692){if(_0x1f4929)return _0x4435d2(_0x1f4929);fs[_0x0a9e('0xe8')](path[_0x0a9e('0xd9')](_0x40eb5d,util[_0x0a9e('0xca')]('message%d.eml',_0x53c7de)),_0x1bf692);return _0x402544(_0x1bf692);});});})[_0x0a9e('0x22')](function(){return new BPromise(function(_0x1d7fc4,_0x2d8e91){zipdir(_0x40eb5d,{'saveTo':_0xb14971},function(_0x2675a5,_0x1b1757){if(_0x2675a5)return _0x2d8e91(_0x2675a5);return _0x1d7fc4(_0x1b1757);});})[_0x0a9e('0x22')](function(){return new BPromise(function(_0x16be7e,_0x54f0b8){rimraf(_0x40eb5d,function(_0x311288){if(_0x311288)_0x54f0b8(_0x311288);return _0x16be7e();});});})[_0x0a9e('0x22')](function(){return _0x53ef46[_0x0a9e('0xe9')](_0xb14971,_0x1b637c,function(_0x5885c3){if(_0x5885c3){console[_0x0a9e('0xea')](_0x0a9e('0xeb'),_0x5885c3);}else{fs[_0x0a9e('0xec')](_0xb14971);}});});});}else{return _0x53ef46[_0x0a9e('0x23')](0xc8);}})['catch'](handleError(_0x53ef46,null));};
\ No newline at end of file
+var _0xa9e0=['MailInteractionId','Setting','enableEmailPreview','push','all','rows','show','params','include','merge','options','create','body','describe','addMessage','MailMessage','ids','omit','intersection','format','YYYY-MM-DD\x20HH:mm:ss','includeAll','findAll','addTags','setTags','emit','mailInteractionTags:save','removeTags','unix','root','files','tmp','server','transcript-%d-%s.zip','join','attachments','Attachment','subject','Messages','get','mkdirSync','each','headers','bcc','Attachments','basename','existsSync','readFileSync','build','writeFileSync','download','log','err','unlinkSync','html-pdf','eml-format','rimraf','request-promise','bluebird','mustache','util','path','sox','ejs','lodash','squel','desk.js','papaparse','html-to-text','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/environment','../../mysqldb','redis','defaults','localhost','./mailInteraction.socket','register','status','count','offset','limit','set','Content-Range','update','destroy','then','sendStatus','stack','name','send','Users','fullname','TagIds','Tags','split','forEach','MailInteraction','findOne','lastMsgText','trimStart','fromString','lastMsgBody','catch','index','map','rawAttributes','fieldName','model','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','select','field','color','from','tools_tags','ui.MailInteractionId','left_join','users','u.id\x20=\x20ui.UserId','mail_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','mail_accounts','a.id\x20=\x20i.MailAccountId','me.MailInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','conditions','value','having','Contact','$substring','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','find','ContactId','buildExpression','text','start','end','Tag','operator','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','plainBody','type','some','compact','isEmpty','MailAccountId','i.MailAccountId\x20IN\x20?','concat','createdAt','parse','$gte','$lte','null','\x20IS\x20NULL','\x20=\x20?','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','filter','replace','\x27\x27\x27\x27','isNumeric','i.id\x20LIKE\x20?','isEmail','MATCH\x20(i.to,\x20i.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','MATCH\x20(me.plainBody,\x20me.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','group','i.id','Sequelize','QueryTypes','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages','order','t.id\x20IN\x20?','journey','i.MailAccountId\x20IS\x20NOT\x20NULL','user','getMailAccounts','i.MailAccountId\x20IS\x20NULL','sequelize','toString','keyBy','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','i.createdAt','i.updatedAt','i.closed','i.closedAt','i.attach','i.lastMsgAt','i.subject','i.disposition','i.substatus','i.to','i.ContactId','i.MailAccountId','i.UserId','c.firstName','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','o.fullname','Owner.fullname','o.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.MailInteractionId\x20IN\x20?','groupBy'];(function(_0x2427ff,_0x1320f2){var _0x39a2c1=function(_0x420abc){while(--_0x420abc){_0x2427ff['push'](_0x2427ff['shift']());}};_0x39a2c1(++_0x1320f2);}(_0xa9e0,0x123));var _0x0a9e=function(_0x47a7d0,_0x4e182d){_0x47a7d0=_0x47a7d0-0x0;var _0xb9bd08=_0xa9e0[_0x47a7d0];return _0xb9bd08;};'use strict';var pdf=require(_0x0a9e('0x0'));var emlformat=require(_0x0a9e('0x1'));var rimraf=require(_0x0a9e('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0a9e('0x3'));var moment=require('moment');var BPromise=require(_0x0a9e('0x4'));var Mustache=require(_0x0a9e('0x5'));var util=require(_0x0a9e('0x6'));var path=require(_0x0a9e('0x7'));var sox=require(_0x0a9e('0x8'));var csv=require('to-csv');var ejs=require(_0x0a9e('0x9'));var fs=require('fs');var _=require(_0x0a9e('0xa'));var squel=require(_0x0a9e('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0a9e('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0a9e('0xd'));var htmlToText=require(_0x0a9e('0xe'));var Redis=require(_0x0a9e('0xf'));var authService=require(_0x0a9e('0x10'));var qs=require(_0x0a9e('0x11'));var as=require(_0x0a9e('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x0a9e('0x13'));var db=require(_0x0a9e('0x14'))['db'];config[_0x0a9e('0x15')]=_[_0x0a9e('0x16')](config[_0x0a9e('0x15')],{'host':_0x0a9e('0x17'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x0a9e('0x15')]));require(_0x0a9e('0x18'))[_0x0a9e('0x19')](socket);function respondWithStatusCode(_0x281129,_0x44dcfd){_0x44dcfd=_0x44dcfd||0xcc;return function(_0x4d5611){if(_0x4d5611){return _0x281129['sendStatus'](_0x44dcfd);}return _0x281129[_0x0a9e('0x1a')](_0x44dcfd)['end']();};}function respondWithResult(_0x1985b6,_0x519dfd){_0x519dfd=_0x519dfd||0xc8;return function(_0x16033c){if(_0x16033c){return _0x1985b6[_0x0a9e('0x1a')](_0x519dfd)['json'](_0x16033c);}};}function respondWithFilteredResult(_0x225616,_0x5a0a06){return function(_0x459eb1){if(_0x459eb1){var _0x478723=_0x459eb1[_0x0a9e('0x1b')],_0x106033=_0x5a0a06[_0x0a9e('0x1c')],_0x205fd6=_0x5a0a06[_0x0a9e('0x1c')]+_0x5a0a06[_0x0a9e('0x1d')],_0x31b1ca;if(_0x205fd6>=_0x478723){_0x205fd6=_0x478723;_0x31b1ca=0xc8;}else{_0x31b1ca=0xce;}_0x225616[_0x0a9e('0x1a')](_0x31b1ca);return _0x225616[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0x106033+'-'+_0x205fd6+'/'+_0x478723)['json'](_0x459eb1);}return null;};}function patchUpdates(_0x2c3407){return function(_0x155cce){try{jsonpatch['apply'](_0x155cce,_0x2c3407,!![]);}catch(_0x20f109){return BPromise['reject'](_0x20f109);}return _0x155cce['save']();};}function saveUpdates(_0x3a02e1,_0x432e56){return function(_0x38e7c4){if(_0x38e7c4){return _0x38e7c4[_0x0a9e('0x20')](_0x3a02e1)['then'](function(_0xfb6e48){return _0xfb6e48;});}return null;};}function removeEntity(_0x2fb0e4,_0x3b45bc){return function(_0x4d00e6){if(_0x4d00e6){return _0x4d00e6[_0x0a9e('0x21')]()[_0x0a9e('0x22')](function(){_0x2fb0e4[_0x0a9e('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x59181e,_0x197ec0){return function(_0x3a8e58){if(!_0x3a8e58){_0x59181e[_0x0a9e('0x23')](0x194);}return _0x3a8e58;};}function handleError(_0x33161b,_0x526cf3){_0x526cf3=_0x526cf3||0x1f4;return function(_0x384319){logger['error'](_0x384319[_0x0a9e('0x24')]);if(_0x384319['name']){delete _0x384319[_0x0a9e('0x25')];}_0x33161b[_0x0a9e('0x1a')](_0x526cf3)[_0x0a9e('0x26')](_0x384319);};}function getInteractionUsers(_0x14433c,_0x140511){return new BPromise(function(_0x1538a4,_0x11c3b6){try{if(_0x140511[_0x14433c['id']]){_0x14433c[_0x0a9e('0x27')]=_['map'](_0x140511[_0x14433c['id']],function(_0x3652a7){return{'id':_0x3652a7['id'],'fullname':_0x3652a7[_0x0a9e('0x28')]};});}}catch(_0x2b1f27){_0x11c3b6(_0x2b1f27);}_0x1538a4(_0x14433c);});}function getInteractionTags(_0x2ec755,_0x5c877d){return new BPromise(function(_0x15b200,_0x40e7a3){try{if(_0x2ec755[_0x0a9e('0x29')]){_0x2ec755[_0x0a9e('0x2a')]=[];_0x2ec755[_0x0a9e('0x29')][_0x0a9e('0x2b')](',')[_0x0a9e('0x2c')](function(_0x2e8759){_0x2ec755[_0x0a9e('0x2a')]['push'](_0x5c877d[_0x2e8759]);});}delete _0x2ec755[_0x0a9e('0x29')];}catch(_0x5d1e0e){_0x40e7a3(_0x5d1e0e);}_0x15b200(_0x2ec755);});}function getLastMessageText(_0x2407f9){return new BPromise(function(_0x3ae878,_0x1122db){return db[_0x0a9e('0x2d')][_0x0a9e('0x2e')]({'where':{'id':_0x2407f9['id']},'attributes':['lastMsgBody',_0x0a9e('0x2f')],'raw':!![]})[_0x0a9e('0x22')](function(_0x40cb85){if(!_0x40cb85[_0x0a9e('0x2f')]){_0x2407f9[_0x0a9e('0x2f')]=_[_0x0a9e('0x30')](htmlToText[_0x0a9e('0x31')](_0x40cb85[_0x0a9e('0x32')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]}));}else{_0x2407f9['lastMsgText']=_0x40cb85[_0x0a9e('0x2f')];}_0x3ae878(_0x2407f9);})['catch'](function(_0x2cc7a0){_0x1122db(_0x2cc7a0);});});}function updateMailInteraction(_0x14b13f,_0x2b7e7f,_0x3f3d41,_0x567193){return new BPromise(function(_0x191e91,_0xd1836d){return getInteractionUsers(_0x14b13f,_0x3f3d41)[_0x0a9e('0x22')](function(_0x15de0e){return getInteractionTags(_0x15de0e,_0x2b7e7f);})['then'](function(_0x54135e){if(_0x567193){_0x191e91(getLastMessageText(_0x54135e));}else{_0x191e91(_0x54135e);}})[_0x0a9e('0x33')](function(_0x5640eb){_0xd1836d(_0x5640eb);});});}exports[_0x0a9e('0x34')]=function(_0x3d9717,_0x381c37){var _0x1ef87a={},_0x4f41ae={},_0x31916f={'count':0x0,'rows':[]};var _0x3bfce8=_[_0x0a9e('0x35')](db['MailInteraction'][_0x0a9e('0x36')],function(_0x1a180b){return{'name':_0x1a180b[_0x0a9e('0x37')],'type':_0x1a180b['type']['key']};});_0x4f41ae[_0x0a9e('0x38')]=_[_0x0a9e('0x35')](_0x3bfce8,'name');_0x4f41ae[_0x0a9e('0x39')]=_[_0x0a9e('0x3a')](_0x3d9717[_0x0a9e('0x39')]);_0x4f41ae[_0x0a9e('0x3b')]=_['intersection'](_0x4f41ae['model'],_0x4f41ae[_0x0a9e('0x39')]);_0x1ef87a[_0x0a9e('0x3c')]=_['intersection'](_0x4f41ae[_0x0a9e('0x38')],qs[_0x0a9e('0x3d')](_0x3d9717[_0x0a9e('0x39')]['fields']));_0x1ef87a[_0x0a9e('0x3c')]=_0x1ef87a[_0x0a9e('0x3c')][_0x0a9e('0x3e')]?_0x1ef87a[_0x0a9e('0x3c')]:_0x4f41ae[_0x0a9e('0x38')];if(!_0x3d9717[_0x0a9e('0x39')][_0x0a9e('0x3f')](_0x0a9e('0x40'))){_0x1ef87a[_0x0a9e('0x1d')]=qs[_0x0a9e('0x1d')](_0x3d9717[_0x0a9e('0x39')][_0x0a9e('0x1d')]);_0x1ef87a[_0x0a9e('0x1c')]=qs[_0x0a9e('0x1c')](_0x3d9717[_0x0a9e('0x39')]['offset']);}_0x1ef87a['order']=qs[_0x0a9e('0x41')](_0x3d9717[_0x0a9e('0x39')][_0x0a9e('0x41')]);_0x1ef87a[_0x0a9e('0x42')]=qs[_0x0a9e('0x3b')](_[_0x0a9e('0x43')](_0x3d9717[_0x0a9e('0x39')],_0x4f41ae[_0x0a9e('0x3b')]),_0x3bfce8);var _0x432fcc=[];var _0x25c6e6=squel[_0x0a9e('0x44')]()[_0x0a9e('0x45')]('id')['field'](_0x0a9e('0x25'))[_0x0a9e('0x45')](_0x0a9e('0x46'))[_0x0a9e('0x47')](_0x0a9e('0x48'));var _0xbe9d19=squel[_0x0a9e('0x44')]()[_0x0a9e('0x45')]('u.id')[_0x0a9e('0x45')]('u.fullname')[_0x0a9e('0x45')](_0x0a9e('0x49'))[_0x0a9e('0x47')]('user_has_mail_interactions','ui')[_0x0a9e('0x4a')](_0x0a9e('0x4b'),'u',_0x0a9e('0x4c'));var _0x34aa5a=squel[_0x0a9e('0x44')]()[_0x0a9e('0x47')](_0x0a9e('0x4d'),'i')['left_join'](_0x0a9e('0x4e'),'c',_0x0a9e('0x4f'))[_0x0a9e('0x4a')](_0x0a9e('0x4b'),'o',_0x0a9e('0x50'))[_0x0a9e('0x4a')](_0x0a9e('0x51'),'a',_0x0a9e('0x52'))[_0x0a9e('0x4a')]('mail_messages','me',_0x0a9e('0x53'))[_0x0a9e('0x4a')]('mail_interaction_has_tags','it','it.MailInteractionId\x20=\x20i.id')['left_join'](_0x0a9e('0x48'),'t',_0x0a9e('0x54'));var _0x37edaa=squel[_0x0a9e('0x55')]();var _0x61bb17=[];var _0x30decb=squel[_0x0a9e('0x55')]();var _0x375c18;if(_0x3d9717['query']['search']){_0x375c18=as['parseSearch'](_0x3d9717[_0x0a9e('0x39')][_0x0a9e('0x56')]);var _0x14d602=_0x375c18['sqlOperator'];for(var _0x2b69d9=0x0;_0x2b69d9<_0x375c18[_0x0a9e('0x57')]['length'];_0x2b69d9++){var _0x5a88da=_0x375c18[_0x0a9e('0x57')][_0x2b69d9];var _0x59c6ff='i';var _0x443e72=_['find'](_0x3bfce8,[_0x0a9e('0x25'),_0x5a88da[_0x0a9e('0x45')]]);if(!_0x443e72){switch(_0x5a88da[_0x0a9e('0x45')]){case'unreadMessages':if(_0x5a88da[_0x0a9e('0x58')]==0x1){_0x34aa5a[_0x0a9e('0x59')]('`'+_0x5a88da['field']+'`\x20=\x200');}else{_0x34aa5a[_0x0a9e('0x59')]('`'+_0x5a88da[_0x0a9e('0x45')]+'`\x20>\x200');}break;case _0x0a9e('0x5a'):if(_0x5a88da['operator']===_0x0a9e('0x5b')){if(_0x5a88da['value'][_0x0a9e('0x2b')]('\x20')['length']>0x1){_0x37edaa[_0x14d602]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs['getFullTextValue'](_0x5a88da[_0x0a9e('0x58')]),null);}else{var _0x47de4c='%'+_0x5a88da[_0x0a9e('0x58')]+'%';_0x37edaa[_0x14d602](_0x0a9e('0x5c'),_0x47de4c,_0x47de4c,_0x47de4c);}}else{_0x443e72=_[_0x0a9e('0x5d')](_0x3bfce8,[_0x0a9e('0x25'),_0x0a9e('0x5e')]);_0x5a88da[_0x0a9e('0x45')]=_0x0a9e('0x5e');_0x797b45=as[_0x0a9e('0x5f')](_0x59c6ff,_0x443e72['type'],_0x5a88da);_0x37edaa[_0x14d602](_0x797b45[_0x0a9e('0x60')],_0x797b45[_0x0a9e('0x58')][_0x0a9e('0x61')],_0x797b45[_0x0a9e('0x58')][_0x0a9e('0x62')]);}break;case _0x0a9e('0x63'):var _0x5d86e9=_0x5a88da[_0x0a9e('0x58')][_0x0a9e('0x2b')](',')['map'](function(_0x3649cc){return Number(_0x3649cc);});_0x5d86e9['forEach'](function(_0x20c668){_0x30decb['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x20c668+',%');});_0x61bb17=_['union'](_0x61bb17,_0x5d86e9);break;case'User':if(_0x5a88da[_0x0a9e('0x64')]==='$substring'){_0x37edaa[_0x14d602](_0x0a9e('0x65'),'%'+_0x5a88da[_0x0a9e('0x58')]+'%',null);}else{_0x443e72=_[_0x0a9e('0x5d')](_0x3bfce8,[_0x0a9e('0x25'),_0x0a9e('0x66')]);_0x5a88da[_0x0a9e('0x45')]='UserId';_0x797b45=as[_0x0a9e('0x5f')](_0x59c6ff,_0x443e72['type'],_0x5a88da);_0x37edaa[_0x14d602](_0x797b45[_0x0a9e('0x60')],_0x797b45[_0x0a9e('0x58')][_0x0a9e('0x61')],_0x797b45['value'][_0x0a9e('0x62')]);}break;case _0x0a9e('0x67'):_0x797b45=as[_0x0a9e('0x5f')]('me',null,_0x5a88da);_0x37edaa[_0x14d602](_0x797b45[_0x0a9e('0x60')],_0x797b45['value'][_0x0a9e('0x61')],_0x797b45[_0x0a9e('0x58')]['end']);break;}}else{var _0x797b45=as[_0x0a9e('0x5f')](_0x59c6ff,_0x443e72[_0x0a9e('0x68')],_0x5a88da);_0x37edaa[_0x14d602](_0x797b45[_0x0a9e('0x60')],_0x797b45[_0x0a9e('0x58')]['start'],_0x797b45[_0x0a9e('0x58')][_0x0a9e('0x62')]);}}}else{var _0x281c7d=_(_0x3d9717['query'])[_0x0a9e('0x3a')]()['map'](function(_0x5211e3){return _[_0x0a9e('0x69')](_0x3bfce8,[_0x0a9e('0x25'),_0x5211e3])?_0x5211e3:undefined;})[_0x0a9e('0x6a')]()[_0x0a9e('0x58')]();if(!_[_0x0a9e('0x6b')](_0x281c7d)){_0x281c7d[_0x0a9e('0x2c')](function(_0x387489){if(_0x387489===_0x0a9e('0x6c')){_0x34aa5a[_0x0a9e('0x42')](_0x0a9e('0x6d'),[][_0x0a9e('0x6e')](_0x3d9717[_0x0a9e('0x39')][_0x387489]));}else if(_0x387489===_0x0a9e('0x6f')){var _0x2b8192=JSON[_0x0a9e('0x70')](_0x3d9717[_0x0a9e('0x39')][_0x387489])[_0x0a9e('0x71')];var _0x4257c9=JSON['parse'](_0x3d9717[_0x0a9e('0x39')][_0x387489])[_0x0a9e('0x72')];_0x34aa5a[_0x0a9e('0x42')]('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x2b8192,_0x4257c9);}else{if(_0x3d9717[_0x0a9e('0x39')][_0x387489]===_0x0a9e('0x73')){_0x34aa5a['where']('i.'+_0x387489+_0x0a9e('0x74'));}else{_0x34aa5a[_0x0a9e('0x42')]('i.'+_0x387489+_0x0a9e('0x75'),_0x3d9717[_0x0a9e('0x39')][_0x387489]);}}});}if(_0x3d9717[_0x0a9e('0x39')]['read']){if(_0x3d9717['query']['read']==0x1){_0x34aa5a[_0x0a9e('0x59')](_0x0a9e('0x76'));}else{_0x34aa5a[_0x0a9e('0x59')](_0x0a9e('0x77'));}}if(_0x3d9717[_0x0a9e('0x39')][_0x0a9e('0x78')]){_0x61bb17=_[_0x0a9e('0x79')](_0x3d9717[_0x0a9e('0x39')]['tag'])?_0x3d9717[_0x0a9e('0x39')][_0x0a9e('0x78')]:new Array(_0x3d9717[_0x0a9e('0x39')]['tag']);_0x61bb17[_0x0a9e('0x2c')](function(_0x583b2e){_0x30decb['or'](_0x0a9e('0x7a'),'%,'+_0x583b2e+',%');});}if(_0x3d9717[_0x0a9e('0x39')]['filter']){var _0x2ed01e=_0x3d9717[_0x0a9e('0x39')][_0x0a9e('0x7b')][_0x0a9e('0x7c')]('\x5c','\x5c\x5c')['replace']('\x27\x27',_0x0a9e('0x7d'));if(qs[_0x0a9e('0x7e')](_0x2ed01e)){_0x37edaa['or'](_0x0a9e('0x7f'),_0x2ed01e+'%');}else if(qs[_0x0a9e('0x80')](_0x2ed01e)){_0x37edaa['or']('c.email\x20LIKE\x20?',_0x2ed01e+'%');}else{_0x37edaa['or'](_0x0a9e('0x81'),qs[_0x0a9e('0x82')](_0x2ed01e))['or'](_0x0a9e('0x83'),qs[_0x0a9e('0x82')](_0x2ed01e));}}}_0x34aa5a['where'](_0x37edaa);_0x34aa5a[_0x0a9e('0x84')](_0x0a9e('0x85'));var _0x30a4c7={'type':db[_0x0a9e('0x86')][_0x0a9e('0x87')][_0x0a9e('0x88')],'raw':!![]};var _0x40fc56=_0x34aa5a[_0x0a9e('0x89')]();_0x40fc56[_0x0a9e('0x45')](_0x0a9e('0x85'));_0x40fc56[_0x0a9e('0x45')](_0x0a9e('0x8a'),_0x0a9e('0x8b'));if(_0x1ef87a[_0x0a9e('0x8c')]){_0x1ef87a['order'][_0x0a9e('0x2c')](function(_0x11da9c){_0x34aa5a[_0x0a9e('0x8c')]('i.'+_0x11da9c[0x0],_0x11da9c[0x1]==='DESC'?![]:!![]);});}if(!_[_0x0a9e('0x6b')](_0x61bb17)){_0x34aa5a[_0x0a9e('0x59')](_0x30decb);_0x40fc56[_0x0a9e('0x42')](_0x0a9e('0x8d'),_0x61bb17);}BPromise['resolve']()['then'](function(){if(!_0x375c18){if(_0x3d9717[_0x0a9e('0x39')][_0x0a9e('0x6c')]||_0x3d9717['query'][_0x0a9e('0x8e')])return;_0x40fc56['where'](_0x0a9e('0x8f'));_0x34aa5a[_0x0a9e('0x42')]('i.MailAccountId\x20IS\x20NOT\x20NULL');return;}return _0x3d9717[_0x0a9e('0x90')][_0x0a9e('0x91')]({'attributes':['id'],'raw':!![]})[_0x0a9e('0x22')](function(_0x42b959){if(_[_0x0a9e('0x6b')](_0x42b959)){_0x40fc56[_0x0a9e('0x42')](_0x0a9e('0x92'));_0x34aa5a['where'](_0x0a9e('0x92'));}else{_0x40fc56[_0x0a9e('0x42')](_0x0a9e('0x6d'),_[_0x0a9e('0x35')](_0x42b959,'id'));_0x34aa5a['where'](_0x0a9e('0x6d'),_[_0x0a9e('0x35')](_0x42b959,'id'));}});})['then'](function(){db[_0x0a9e('0x93')]['query'](_0x40fc56[_0x0a9e('0x94')](),_0x30a4c7)[_0x0a9e('0x22')](function(_0x3003eb){_0x31916f[_0x0a9e('0x1b')]=_0x3003eb['length'];if(_0x31916f['count']===0x0)return[];return db[_0x0a9e('0x93')][_0x0a9e('0x39')](_0x25c6e6[_0x0a9e('0x94')](),_0x30a4c7)['then'](function(_0x3b4a9f){_0x432fcc=_[_0x0a9e('0x95')](_0x3b4a9f,'id');_0x30a4c7=_['merge'](_0x30a4c7,{'model':db['MailInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x3d9717[_0x0a9e('0x39')]['fields']){_0x1ef87a['attributes']['forEach'](function(_0x81d748){_0x34aa5a[_0x0a9e('0x45')]('i.'+_0x81d748);});}else{_0x34aa5a[_0x0a9e('0x45')](_0x0a9e('0x8a'),_0x0a9e('0x8b'));_0x34aa5a[_0x0a9e('0x45')]('a.key',_0x0a9e('0x96'));_0x34aa5a['field'](_0x0a9e('0x97'),_0x0a9e('0x98'));_0x34aa5a[_0x0a9e('0x45')](_0x0a9e('0x85'));_0x34aa5a['field'](_0x0a9e('0x99'));_0x34aa5a[_0x0a9e('0x45')](_0x0a9e('0x9a'));_0x34aa5a['field'](_0x0a9e('0x9b'));_0x34aa5a[_0x0a9e('0x45')](_0x0a9e('0x9c'));_0x34aa5a[_0x0a9e('0x45')](_0x0a9e('0x9d'));_0x34aa5a[_0x0a9e('0x45')](_0x0a9e('0x9e'));_0x34aa5a[_0x0a9e('0x45')]('i.lastMsgDirection');_0x34aa5a[_0x0a9e('0x45')](_0x0a9e('0x9f'));_0x34aa5a['field'](_0x0a9e('0xa0'));_0x34aa5a[_0x0a9e('0x45')](_0x0a9e('0xa1'));_0x34aa5a['field'](_0x0a9e('0xa2'));_0x34aa5a['field'](_0x0a9e('0xa3'));_0x34aa5a[_0x0a9e('0x45')](_0x0a9e('0xa4'));_0x34aa5a[_0x0a9e('0x45')](_0x0a9e('0xa5'));_0x34aa5a[_0x0a9e('0x45')](_0x0a9e('0xa6'),_0x0a9e('0xa7'));_0x34aa5a['field'](_0x0a9e('0xa8'),_0x0a9e('0xa9'));_0x34aa5a[_0x0a9e('0x45')](_0x0a9e('0xaa'),_0x0a9e('0xab'));_0x34aa5a[_0x0a9e('0x45')](_0x0a9e('0xac'),_0x0a9e('0xad'));_0x34aa5a[_0x0a9e('0x45')](_0x0a9e('0xae'),_0x0a9e('0xaf'));_0x34aa5a[_0x0a9e('0x45')](_0x0a9e('0xb0'),'Contact.fax');_0x34aa5a[_0x0a9e('0x45')](_0x0a9e('0xb1'),_0x0a9e('0xb2'));_0x34aa5a[_0x0a9e('0x45')](_0x0a9e('0xb3'),'Owner.internal');_0x34aa5a[_0x0a9e('0x45')](_0x0a9e('0xb4'),'TagIds');}if(_0x1ef87a[_0x0a9e('0x1d')])_0x34aa5a['limit'](_0x1ef87a[_0x0a9e('0x1d')]);if(_0x1ef87a[_0x0a9e('0x1c')])_0x34aa5a[_0x0a9e('0x1c')](_0x1ef87a[_0x0a9e('0x1c')]);return db['sequelize'][_0x0a9e('0x39')](_0x34aa5a['toString'](),_0x30a4c7);})[_0x0a9e('0x22')](function(_0x3d0a77){_0xbe9d19['where'](_0x0a9e('0xb5'),_[_0x0a9e('0x35')](_0x3d0a77,'id'));return db[_0x0a9e('0x93')]['query'](_0xbe9d19['toString'](),_0x30a4c7)[_0x0a9e('0x22')](function(_0x6ba2be){var _0x1707dc=_[_0x0a9e('0xb6')](_0x6ba2be,_0x0a9e('0xb7'));var _0x2450a8=[];return db[_0x0a9e('0xb8')][_0x0a9e('0x2e')]({'attributes':[_0x0a9e('0xb9')],'raw':!![]})['then'](function(_0x3156c7){var _0x517081=_0x3156c7[_0x0a9e('0xb9')];_0x3d0a77[_0x0a9e('0x2c')](function(_0x34e745){_0x2450a8[_0x0a9e('0xba')](updateMailInteraction(_0x34e745,_0x432fcc,_0x1707dc,_0x517081));});return BPromise[_0x0a9e('0xbb')](_0x2450a8);});});});})['then'](function(_0x436313){_0x31916f[_0x0a9e('0xbc')]=_0x436313;return _0x31916f;})[_0x0a9e('0x22')](respondWithFilteredResult(_0x381c37,_0x1ef87a));})[_0x0a9e('0x33')](handleError(_0x381c37,null));};exports[_0x0a9e('0xbd')]=function(_0x5c66ef,_0x4f074c){var _0x22a3cb={'raw':![],'where':{'id':_0x5c66ef[_0x0a9e('0xbe')]['id']}},_0x583662={};_0x583662[_0x0a9e('0x38')]=_[_0x0a9e('0x3a')](db[_0x0a9e('0x2d')][_0x0a9e('0x36')]);_0x583662[_0x0a9e('0x39')]=_['keys'](_0x5c66ef['query']);_0x583662[_0x0a9e('0x3b')]=_['intersection'](_0x583662[_0x0a9e('0x38')],_0x583662['query']);_0x22a3cb[_0x0a9e('0x3c')]=_['intersection'](_0x583662['model'],qs[_0x0a9e('0x3d')](_0x5c66ef[_0x0a9e('0x39')]['fields']));_0x22a3cb[_0x0a9e('0x3c')]=_0x22a3cb[_0x0a9e('0x3c')][_0x0a9e('0x3e')]?_0x22a3cb[_0x0a9e('0x3c')]:_0x583662[_0x0a9e('0x38')];if(_0x5c66ef['query']['includeAll']){_0x22a3cb[_0x0a9e('0xbf')]=[{'all':!![]}];}_0x22a3cb=_[_0x0a9e('0xc0')]({},_0x22a3cb,_0x5c66ef[_0x0a9e('0xc1')]);return db[_0x0a9e('0x2d')][_0x0a9e('0x5d')](_0x22a3cb)['then'](handleEntityNotFound(_0x4f074c,null))[_0x0a9e('0x22')](respondWithResult(_0x4f074c,null))[_0x0a9e('0x33')](handleError(_0x4f074c,null));};exports['create']=function(_0x3c313d,_0x19fd11){return db[_0x0a9e('0x2d')][_0x0a9e('0xc2')](_0x3c313d[_0x0a9e('0xc3')],{})[_0x0a9e('0x22')](respondWithResult(_0x19fd11,0xc9))[_0x0a9e('0x33')](handleError(_0x19fd11,null));};exports[_0x0a9e('0x20')]=function(_0x40dd2a,_0x16afb3){if(_0x40dd2a['body']['id']){delete _0x40dd2a[_0x0a9e('0xc3')]['id'];}return db[_0x0a9e('0x2d')][_0x0a9e('0x5d')]({'where':{'id':_0x40dd2a[_0x0a9e('0xbe')]['id']}})[_0x0a9e('0x22')](handleEntityNotFound(_0x16afb3,null))['then'](saveUpdates(_0x40dd2a['body'],null))[_0x0a9e('0x22')](respondWithResult(_0x16afb3,null))[_0x0a9e('0x33')](handleError(_0x16afb3,null));};exports[_0x0a9e('0x21')]=function(_0x2fea95,_0x34f7b5){return db['MailInteraction'][_0x0a9e('0x5d')]({'where':{'id':_0x2fea95[_0x0a9e('0xbe')]['id']}})[_0x0a9e('0x22')](handleEntityNotFound(_0x34f7b5,null))['then'](removeEntity(_0x34f7b5,null))[_0x0a9e('0x33')](handleError(_0x34f7b5,null));};exports['describe']=function(_0x2144ca,_0x4799d4){return db[_0x0a9e('0x2d')][_0x0a9e('0xc4')]()[_0x0a9e('0x22')](respondWithResult(_0x4799d4,null))['catch'](handleError(_0x4799d4,null));};exports[_0x0a9e('0xc5')]=function(_0x5ed560,_0x4383da,_0x2b1824){return db[_0x0a9e('0xc6')][_0x0a9e('0x5d')]({'where':{'id':_0x5ed560[_0x0a9e('0xbe')]['id']}})[_0x0a9e('0x22')](handleEntityNotFound(_0x4383da,null))[_0x0a9e('0x22')](function(_0xe89aaa){if(_0xe89aaa){return _0xe89aaa[_0x0a9e('0xc5')](_0x5ed560[_0x0a9e('0xc3')][_0x0a9e('0xc7')],_[_0x0a9e('0xc8')](_0x5ed560[_0x0a9e('0xc3')],[_0x0a9e('0xc7'),'id'])||{});}})[_0x0a9e('0x22')](respondWithResult(_0x4383da,null))[_0x0a9e('0x33')](handleError(_0x4383da,null));};exports['getMessages']=function(_0x556443,_0x6eaaf0,_0x5c4be0){var _0x1d999b={'raw':![],'where':{}};var _0x3428c9={};var _0x5d6b69={'count':0x0,'rows':[]};return db[_0x0a9e('0x2d')][_0x0a9e('0x2e')]({'where':{'id':_0x556443[_0x0a9e('0xbe')]['id']}})[_0x0a9e('0x22')](handleEntityNotFound(_0x6eaaf0,null))['then'](function(_0x148fd9){if(_0x148fd9){_0x3428c9[_0x0a9e('0x38')]=_[_0x0a9e('0x3a')](db[_0x0a9e('0xc6')]['rawAttributes']);_0x3428c9[_0x0a9e('0x39')]=_[_0x0a9e('0x3a')](_0x556443[_0x0a9e('0x39')]);_0x3428c9['filters']=_[_0x0a9e('0xc9')](_0x3428c9[_0x0a9e('0x38')],_0x3428c9[_0x0a9e('0x39')]);_0x1d999b['attributes']=_[_0x0a9e('0xc9')](_0x3428c9[_0x0a9e('0x38')],qs[_0x0a9e('0x3d')](_0x556443[_0x0a9e('0x39')][_0x0a9e('0x3d')]));_0x1d999b['attributes']=_0x1d999b[_0x0a9e('0x3c')][_0x0a9e('0x3e')]?_0x1d999b['attributes']:_0x3428c9[_0x0a9e('0x38')];if(!_0x556443[_0x0a9e('0x39')][_0x0a9e('0x3f')]('nolimit')){_0x1d999b['limit']=qs['limit'](_0x556443[_0x0a9e('0x39')][_0x0a9e('0x1d')]);_0x1d999b['offset']=qs[_0x0a9e('0x1c')](_0x556443[_0x0a9e('0x39')][_0x0a9e('0x1c')]);}_0x1d999b['order']=qs[_0x0a9e('0x41')](_0x556443[_0x0a9e('0x39')][_0x0a9e('0x41')]);_0x1d999b[_0x0a9e('0x42')]=qs[_0x0a9e('0x3b')](_[_0x0a9e('0x43')](_0x556443[_0x0a9e('0x39')],_0x3428c9[_0x0a9e('0x3b')]));_0x1d999b[_0x0a9e('0x42')]['MailInteractionId']=_0x148fd9['id'];if(_0x556443[_0x0a9e('0x39')]['filter']){_0x1d999b[_0x0a9e('0x42')]=_[_0x0a9e('0xc0')](_0x1d999b[_0x0a9e('0x42')],{'$or':_[_0x0a9e('0x35')](_0x1d999b[_0x0a9e('0x3c')],function(_0x344cd4){var _0x53d9fc={};_0x53d9fc[_0x344cd4]={'$like':'%'+_0x556443[_0x0a9e('0x39')][_0x0a9e('0x7b')]+'%'};return _0x53d9fc;})});}if(_0x556443[_0x0a9e('0x39')][_0x0a9e('0x71')]){var _0x51aa2f=_0x556443[_0x0a9e('0x39')][_0x0a9e('0x71')][_0x0a9e('0x2b')](',');var _0x1c9539={};_0x1c9539[_0x51aa2f[0x0]]={'$gte':moment(_0x51aa2f[0x1])[_0x0a9e('0xca')](_0x0a9e('0xcb'))};_0x1d999b[_0x0a9e('0x42')]=_[_0x0a9e('0xc0')](_0x1d999b[_0x0a9e('0x42')],_0x1c9539);}_0x1d999b=_[_0x0a9e('0xc0')]({},_0x1d999b,_0x556443['options']);return db[_0x0a9e('0xc6')][_0x0a9e('0x1b')]({'where':_0x1d999b[_0x0a9e('0x42')]})[_0x0a9e('0x22')](function(_0xea8bd1){_0x5d6b69[_0x0a9e('0x1b')]=_0xea8bd1;if(_0x556443[_0x0a9e('0x39')][_0x0a9e('0xcc')]){_0x1d999b['include']=[{'all':!![]}];}return db[_0x0a9e('0xc6')][_0x0a9e('0xcd')](_0x1d999b);})[_0x0a9e('0x22')](function(_0x5c65fc){_0x5d6b69[_0x0a9e('0xbc')]=_0x5c65fc;return _0x5d6b69;});}})[_0x0a9e('0x22')](respondWithFilteredResult(_0x6eaaf0,_0x1d999b))[_0x0a9e('0x33')](handleError(_0x6eaaf0,null));};exports[_0x0a9e('0xce')]=function(_0x370b5e,_0x1ba457,_0x424f1b){return db[_0x0a9e('0x2d')][_0x0a9e('0x5d')]({'where':{'id':_0x370b5e[_0x0a9e('0xbe')]['id']}})['then'](handleEntityNotFound(_0x1ba457,null))[_0x0a9e('0x22')](function(_0x446e6){if(_0x446e6){return _0x446e6[_0x0a9e('0xcf')](_0x370b5e[_0x0a9e('0xc3')][_0x0a9e('0xc7')],_[_0x0a9e('0xc8')](_0x370b5e['body'],[_0x0a9e('0xc7'),'id'])||{})['spread'](function(){return db['Tag']['findAll']({'attributes':['id',_0x0a9e('0x25'),_0x0a9e('0x46')],'where':{'id':_0x370b5e[_0x0a9e('0xc3')][_0x0a9e('0xc7')]}});})['then'](function(_0x4156a5){socket[_0x0a9e('0xd0')](_0x0a9e('0xd1'),{'id':Number(_0x370b5e[_0x0a9e('0xbe')]['id']),'tags':_0x4156a5||[]});return{'id':Number(_0x370b5e[_0x0a9e('0xbe')]['id']),'tags':_0x4156a5||[]};});}})['then'](respondWithResult(_0x1ba457,null))['catch'](handleError(_0x1ba457,null));};exports[_0x0a9e('0xd2')]=function(_0x33bcb2,_0x2a293f,_0x5e85d0){return db[_0x0a9e('0x2d')][_0x0a9e('0x5d')]({'where':{'id':_0x33bcb2[_0x0a9e('0xbe')]['id']}})['then'](handleEntityNotFound(_0x2a293f,null))[_0x0a9e('0x22')](function(_0x2bf85d){if(_0x2bf85d){return _0x2bf85d[_0x0a9e('0xd2')](_0x33bcb2['query'][_0x0a9e('0xc7')]);}})[_0x0a9e('0x22')](respondWithStatusCode(_0x2a293f,null))[_0x0a9e('0x33')](handleError(_0x2a293f,null));};exports['download']=function(_0x549697,_0x53ef46){var _0x3b04fd=moment()[_0x0a9e('0xd3')]()[_0x0a9e('0x94')]();var _0x26931c=path['join'](config[_0x0a9e('0xd4')],'server',_0x0a9e('0xd5'),_0x0a9e('0xd6'));var _0x242f23=path['join'](config[_0x0a9e('0xd4')],_0x0a9e('0xd7'),_0x0a9e('0xd5'),'attachments');var _0x40eb5d=path['join'](_0x26931c,_0x3b04fd);var _0x1b637c=util['format'](_0x0a9e('0xd8'),_0x549697['params']['id'],_0x3b04fd);var _0xb14971=path[_0x0a9e('0xd9')](_0x26931c,_0x1b637c);var _0xa288e4=[];if(_0x549697[_0x0a9e('0x39')][_0x0a9e('0xda')]){_0xa288e4[_0x0a9e('0xba')]({'model':db[_0x0a9e('0xdb')],'as':'Attachments','raw':!![]});}var _0x35ace3=[{'model':db[_0x0a9e('0xc6')],'as':'Messages','attributes':['id',_0x0a9e('0xc3'),_0x0a9e('0x47'),'to','cc','bcc',_0x0a9e('0xdc'),_0x0a9e('0x6f')],'where':{'secret':![]},'order':qs[_0x0a9e('0x41')]('id'),'include':_0xa288e4}];return db['MailInteraction'][_0x0a9e('0x5d')]({'where':{'id':_0x549697[_0x0a9e('0xbe')]['id']},'include':_0x35ace3})[_0x0a9e('0x22')](handleEntityNotFound(_0x53ef46,null))[_0x0a9e('0x22')](function(_0x2003bc){if(_0x2003bc&&_0x2003bc[_0x0a9e('0xdd')]){var _0x3ba897=_0x2003bc[_0x0a9e('0xde')]({'plain':!![]});fs[_0x0a9e('0xdf')](_0x40eb5d);return BPromise[_0x0a9e('0xe0')](_0x3ba897['Messages'],function(_0x1799d8,_0x53c7de){var _0x3c9854={'from':_0x1799d8[_0x0a9e('0x47')],'to':_0x1799d8['to'],'subject':_0x1799d8[_0x0a9e('0xdc')],'html':_0x1799d8[_0x0a9e('0xc3')],'headers':{'Date':moment(_0x1799d8[_0x0a9e('0x6f')])[_0x0a9e('0xca')]('ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ')},'attachments':[]};if(_0x1799d8['cc']){_0x3c9854[_0x0a9e('0xe1')]['Cc']=_0x1799d8['cc'];}if(_0x1799d8[_0x0a9e('0xe2')]){_0x3c9854[_0x0a9e('0xe1')]['Bcc']=_0x1799d8[_0x0a9e('0xe2')];}return new BPromise(function(_0x402544,_0x4435d2){if(_0x1799d8[_0x0a9e('0xe3')]){for(var _0x31e1e0=0x0;_0x31e1e0<_0x1799d8[_0x0a9e('0xe3')][_0x0a9e('0x3e')];_0x31e1e0++){var _0x5f2c51=_0x1799d8[_0x0a9e('0xe3')][_0x31e1e0];var _0x228c10=path[_0x0a9e('0xd9')](_0x242f23,_0x5f2c51[_0x0a9e('0xe4')]);if(fs[_0x0a9e('0xe5')](_0x228c10)){_0x3c9854[_0x0a9e('0xda')][_0x0a9e('0xba')]({'name':_0x5f2c51['name'],'contentType':_0x5f2c51['type'],'data':fs[_0x0a9e('0xe6')](_0x228c10)});}}}emlformat[_0x0a9e('0xe7')](_0x3c9854,function(_0x1f4929,_0x1bf692){if(_0x1f4929)return _0x4435d2(_0x1f4929);fs[_0x0a9e('0xe8')](path[_0x0a9e('0xd9')](_0x40eb5d,util[_0x0a9e('0xca')]('message%d.eml',_0x53c7de)),_0x1bf692);return _0x402544(_0x1bf692);});});})[_0x0a9e('0x22')](function(){return new BPromise(function(_0x1d7fc4,_0x2d8e91){zipdir(_0x40eb5d,{'saveTo':_0xb14971},function(_0x2675a5,_0x1b1757){if(_0x2675a5)return _0x2d8e91(_0x2675a5);return _0x1d7fc4(_0x1b1757);});})[_0x0a9e('0x22')](function(){return new BPromise(function(_0x16be7e,_0x54f0b8){rimraf(_0x40eb5d,function(_0x311288){if(_0x311288)_0x54f0b8(_0x311288);return _0x16be7e();});});})[_0x0a9e('0x22')](function(){return _0x53ef46[_0x0a9e('0xe9')](_0xb14971,_0x1b637c,function(_0x5885c3){if(_0x5885c3){console[_0x0a9e('0xea')](_0x0a9e('0xeb'),_0x5885c3);}else{fs[_0x0a9e('0xec')](_0xb14971);}});});});}else{return _0x53ef46[_0x0a9e('0x23')](0xc8);}})['catch'](handleError(_0x53ef46,null));};
\ No newline at end of file
diff --git a/server/api/mailInteraction/mailInteraction.events.js b/server/api/mailInteraction/mailInteraction.events.js
index 61679cf..d94d5b6 100644
--- a/server/api/mailInteraction/mailInteraction.events.js
+++ b/server/api/mailInteraction/mailInteraction.events.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x1975=['save','update','getUsers','then','Users','map','findAll','setDataValue','unreadMessages','emit','catch','hook','exports','events','../../mysqldb','MailInteraction','MailMessage','setMaxListeners'];(function(_0x13e741,_0x5d3c24){var _0x3f8bb3=function(_0x4440a0){while(--_0x4440a0){_0x13e741['push'](_0x13e741['shift']());}};_0x3f8bb3(++_0x5d3c24);}(_0x1975,0xf7));var _0x5197=function(_0x254635,_0x472b4c){_0x254635=_0x254635-0x0;var _0x35293c=_0x1975[_0x254635];return _0x35293c;};'use strict';var EventEmitter=require(_0x5197('0x0'));var MailInteraction=require(_0x5197('0x1'))['db'][_0x5197('0x2')];var MailMessage=require('../../mysqldb')['db'][_0x5197('0x3')];var MailInteractionEvents=new EventEmitter();MailInteractionEvents[_0x5197('0x4')](0x0);var events={'afterCreate':_0x5197('0x5'),'afterUpdate':_0x5197('0x6'),'afterDestroy':'remove'};function emitEvent(_0x31f551){return function(_0x3dd62e,_0x1eb8a7,_0x41a225){_0x3dd62e[_0x5197('0x7')]({'attributes':['id'],'raw':!![]})[_0x5197('0x8')](function(_0x5cf744){_0x3dd62e['setDataValue'](_0x5197('0x9'),_0x5cf744[_0x5197('0xa')](function(_0x19d44e){return{'id':_0x19d44e['id']};}));return MailMessage[_0x5197('0xb')]({'where':{'MailInteractionId':_0x3dd62e['id'],'direction':'in','read':![]},'raw':!![]});})[_0x5197('0x8')](function(_0x3cbe33){_0x3dd62e[_0x5197('0xc')](_0x5197('0xd'),_0x3cbe33['length']);MailInteractionEvents[_0x5197('0xe')](_0x31f551+':'+_0x3dd62e['id'],_0x3dd62e);MailInteractionEvents[_0x5197('0xe')](_0x31f551,_0x3dd62e);_0x41a225(null);})[_0x5197('0xf')](_0x41a225(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailInteraction[_0x5197('0x10')](e,emitEvent(event));}}module[_0x5197('0x11')]=MailInteractionEvents;
\ No newline at end of file
+var _0x5096=['then','setDataValue','Users','map','unreadMessages','length','emit','catch','hook','exports','events','../../mysqldb','MailInteraction','setMaxListeners','save','update','getUsers'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5096,0x1e6));var _0x6509=function(_0x4bf814,_0x431c38){_0x4bf814=_0x4bf814-0x0;var _0xd4452c=_0x5096[_0x4bf814];return _0xd4452c;};'use strict';var EventEmitter=require(_0x6509('0x0'));var MailInteraction=require(_0x6509('0x1'))['db'][_0x6509('0x2')];var MailMessage=require(_0x6509('0x1'))['db']['MailMessage'];var MailInteractionEvents=new EventEmitter();MailInteractionEvents[_0x6509('0x3')](0x0);var events={'afterCreate':_0x6509('0x4'),'afterUpdate':_0x6509('0x5'),'afterDestroy':'remove'};function emitEvent(_0x2d8e94){return function(_0x8fbcf1,_0x47dc2d,_0x54e0d0){_0x8fbcf1[_0x6509('0x6')]({'attributes':['id'],'raw':!![]})[_0x6509('0x7')](function(_0x9347e6){_0x8fbcf1[_0x6509('0x8')](_0x6509('0x9'),_0x9347e6[_0x6509('0xa')](function(_0x3173c6){return{'id':_0x3173c6['id']};}));return MailMessage['findAll']({'where':{'MailInteractionId':_0x8fbcf1['id'],'direction':'in','read':![]},'raw':!![]});})[_0x6509('0x7')](function(_0x5c6f49){_0x8fbcf1[_0x6509('0x8')](_0x6509('0xb'),_0x5c6f49[_0x6509('0xc')]);MailInteractionEvents[_0x6509('0xd')](_0x2d8e94+':'+_0x8fbcf1['id'],_0x8fbcf1);MailInteractionEvents[_0x6509('0xd')](_0x2d8e94,_0x8fbcf1);_0x54e0d0(null);})[_0x6509('0xe')](_0x54e0d0(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailInteraction[_0x6509('0xf')](e,emitEvent(event));}}module[_0x6509('0x10')]=MailInteractionEvents;
\ No newline at end of file
diff --git a/server/api/mailInteraction/mailInteraction.model.js b/server/api/mailInteraction/mailInteraction.model.js
index af72935..8564fc8 100644
--- a/server/api/mailInteraction/mailInteraction.model.js
+++ b/server/api/mailInteraction/mailInteraction.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x008c=['then','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./mailInteraction.attributes','exports','define','mail_interactions','subject','YYYY-MM-DD\x20HH:mm:ss','closed','format','changed','substatus','closedAt','models','update'];(function(_0x4ad354,_0x4982b6){var _0x2a8f86=function(_0x391cd1){while(--_0x391cd1){_0x4ad354['push'](_0x4ad354['shift']());}};_0x2a8f86(++_0x4982b6);}(_0x008c,0x188));var _0xc008=function(_0x552dec,_0x27a96d){_0x552dec=_0x552dec-0x0;var _0xcd5ca6=_0x008c[_0x552dec];return _0xcd5ca6;};'use strict';var _=require(_0xc008('0x0'));var util=require(_0xc008('0x1'));var logger=require(_0xc008('0x2'))(_0xc008('0x3'));var moment=require(_0xc008('0x4'));var BPromise=require('bluebird');var rp=require(_0xc008('0x5'));var fs=require('fs');var path=require(_0xc008('0x6'));var rimraf=require(_0xc008('0x7'));var config=require(_0xc008('0x8'));var attributes=require(_0xc008('0x9'));module[_0xc008('0xa')]=function(_0x13aa7,_0x39bb5e){return _0x13aa7[_0xc008('0xb')]('MailInteraction',attributes,{'tableName':_0xc008('0xc'),'paranoid':![],'indexes':[{'name':'fti_mail_interactions','fields':[_0xc008('0xd'),'to'],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x52041f,_0x27830d,_0x7231b4){if(_0x52041f['substatus']){_0x52041f['substatusAt']=moment()['format'](_0xc008('0xe'));}if(_0x52041f[_0xc008('0xf')]){_0x52041f['closedAt']=moment()[_0xc008('0x10')](_0xc008('0xe'));}_0x7231b4(null,_0x27830d);},'beforeUpdate':function(_0x2ea200,_0x2a5b4e,_0x9ffa93){if(_0x2ea200[_0xc008('0x11')](_0xc008('0x12'))){_0x2ea200['substatusAt']=_0x2ea200['substatus']?moment()[_0xc008('0x10')]('YYYY-MM-DD\x20HH:mm:ss'):null;}if(_0x2ea200[_0xc008('0x11')](_0xc008('0xf'))){_0x2ea200[_0xc008('0x13')]=moment()[_0xc008('0x10')](_0xc008('0xe'));_0x2ea200['substatus']=null;_0x2ea200['substatusAt']=null;}_0x9ffa93(null,_0x2ea200);},'afterUpdate':function(_0x4bd0f4,_0x11ef38,_0x15a6ad){var _0x3cafe3=_0x13aa7[_0xc008('0x14')];var _0x4fe771=_0x4bd0f4['get']({'plain':!![]});if(_0x4fe771['closed']){return _0x3cafe3['MailMessage'][_0xc008('0x15')]({'read':!![]},{'where':{'MailInteractionId':_0x4fe771['id']}})[_0xc008('0x16')](function(){_0x15a6ad();})['catch'](function(_0x813397){_0x15a6ad(_0x813397);});}else{_0x15a6ad();}}},'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0x55ca=['changed','models','get','update','then','catch','utf8mb4','utf8mb4_unicode_ci','lodash','util','bluebird','request-promise','rimraf','../../config/environment','./mailInteraction.attributes','exports','define','mail_interactions','fti_mail_interactions','FULLTEXT','substatus','substatusAt','format','YYYY-MM-DD\x20HH:mm:ss','closed','closedAt'];(function(_0x14b1a3,_0x4adda8){var _0x1e03fe=function(_0x25ca85){while(--_0x25ca85){_0x14b1a3['push'](_0x14b1a3['shift']());}};_0x1e03fe(++_0x4adda8);}(_0x55ca,0x126));var _0xa55c=function(_0xa599e2,_0x3046be){_0xa599e2=_0xa599e2-0x0;var _0x122f49=_0x55ca[_0xa599e2];return _0x122f49;};'use strict';var _=require(_0xa55c('0x0'));var util=require(_0xa55c('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xa55c('0x2'));var rp=require(_0xa55c('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa55c('0x4'));var config=require(_0xa55c('0x5'));var attributes=require(_0xa55c('0x6'));module[_0xa55c('0x7')]=function(_0x3c97c8,_0x279caa){return _0x3c97c8[_0xa55c('0x8')]('MailInteraction',attributes,{'tableName':_0xa55c('0x9'),'paranoid':![],'indexes':[{'name':_0xa55c('0xa'),'fields':['subject','to'],'type':_0xa55c('0xb')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x290d28,_0x52a3bc,_0x5849ad){if(_0x290d28[_0xa55c('0xc')]){_0x290d28[_0xa55c('0xd')]=moment()[_0xa55c('0xe')](_0xa55c('0xf'));}if(_0x290d28[_0xa55c('0x10')]){_0x290d28[_0xa55c('0x11')]=moment()[_0xa55c('0xe')](_0xa55c('0xf'));}_0x5849ad(null,_0x52a3bc);},'beforeUpdate':function(_0x3998f7,_0x15eec8,_0x5d47ff){if(_0x3998f7['changed'](_0xa55c('0xc'))){_0x3998f7['substatusAt']=_0x3998f7['substatus']?moment()['format'](_0xa55c('0xf')):null;}if(_0x3998f7[_0xa55c('0x12')](_0xa55c('0x10'))){_0x3998f7[_0xa55c('0x11')]=moment()[_0xa55c('0xe')](_0xa55c('0xf'));_0x3998f7['substatus']=null;_0x3998f7[_0xa55c('0xd')]=null;}_0x5d47ff(null,_0x3998f7);},'afterUpdate':function(_0x3dcf4f,_0x25934f,_0x31e10d){var _0x1c4cfd=_0x3c97c8[_0xa55c('0x13')];var _0x51590e=_0x3dcf4f[_0xa55c('0x14')]({'plain':!![]});if(_0x51590e[_0xa55c('0x10')]){return _0x1c4cfd['MailMessage'][_0xa55c('0x15')]({'read':!![]},{'where':{'MailInteractionId':_0x51590e['id']}})[_0xa55c('0x16')](function(){_0x31e10d();})[_0xa55c('0x17')](function(_0x358b61){_0x31e10d(_0x358b61);});}else{_0x31e10d();}}},'charset':_0xa55c('0x18'),'collate':_0xa55c('0x19')});};
\ No newline at end of file
diff --git a/server/api/mailInteraction/mailInteraction.rpc.js b/server/api/mailInteraction/mailInteraction.rpc.js
index ddfcc06..b31ce22 100644
--- a/server/api/mailInteraction/mailInteraction.rpc.js
+++ b/server/api/mailInteraction/mailInteraction.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7633=['request\x20sent','debug','stringify','error','code','message','info','result','catch','UpdateMailInteraction','MailInteraction','update','body','options','raw','where','attributes','limit','AddTagsToMailInteraction','find','ids','omit','AddTags','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','http','redis','defaults','./mailInteraction.socket','request','then','MailInteraction,\x20%s,\x20%s'];(function(_0x29d94e,_0xf386d6){var _0x106237=function(_0x327501){while(--_0x327501){_0x29d94e['push'](_0x29d94e['shift']());}};_0x106237(++_0xf386d6);}(_0x7633,0x1c4));var _0x3763=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0x7633[_0x4b369d];return _0x571a98;};'use strict';var _=require(_0x3763('0x0'));var util=require(_0x3763('0x1'));var moment=require(_0x3763('0x2'));var BPromise=require(_0x3763('0x3'));var rs=require(_0x3763('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3763('0x5'))['db'];var utils=require(_0x3763('0x6'));var logger=require('../../config/logger')(_0x3763('0x7'));var config=require(_0x3763('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x3763('0x9')]({'port':0x232a});config[_0x3763('0xa')]=_[_0x3763('0xb')](config[_0x3763('0xa')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x3763('0xa')]));require(_0x3763('0xc'))['register'](socket);function respondWithRpcPromise(_0x5c872d,_0x44dc63,_0x1a83bb){return new BPromise(function(_0x401909,_0x29ec1c){return client[_0x3763('0xd')](_0x5c872d,_0x1a83bb)[_0x3763('0xe')](function(_0x8fc2be){logger['info'](_0x3763('0xf'),_0x44dc63,_0x3763('0x10'));logger[_0x3763('0x11')]('MailInteraction,\x20%s,\x20%s,\x20%s',_0x44dc63,'request\x20sent',JSON[_0x3763('0x12')](_0x8fc2be));if(_0x8fc2be['error']){if(_0x8fc2be[_0x3763('0x13')][_0x3763('0x14')]===0x1f4){logger[_0x3763('0x13')](_0x3763('0xf'),_0x44dc63,_0x8fc2be[_0x3763('0x13')][_0x3763('0x15')]);return _0x29ec1c(_0x8fc2be[_0x3763('0x13')]['message']);}logger[_0x3763('0x13')](_0x3763('0xf'),_0x44dc63,_0x8fc2be[_0x3763('0x13')]['message']);return _0x401909(_0x8fc2be['error']['message']);}else{logger[_0x3763('0x16')](_0x3763('0xf'),_0x44dc63,_0x3763('0x10'));_0x401909(_0x8fc2be[_0x3763('0x17')][_0x3763('0x15')]);}})[_0x3763('0x18')](function(_0x461924){logger['error'](_0x3763('0xf'),_0x44dc63,_0x461924);_0x29ec1c(_0x461924);});});}exports[_0x3763('0x19')]=function(_0x9a8152){var _0x443422=this;return new Promise(function(_0x4aa7b0,_0x485836){return db[_0x3763('0x1a')][_0x3763('0x1b')](_0x9a8152[_0x3763('0x1c')],{'raw':_0x9a8152[_0x3763('0x1d')]?_0x9a8152['options'][_0x3763('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x9a8152['options']?_0x9a8152[_0x3763('0x1d')][_0x3763('0x1f')]||null:null,'attributes':_0x9a8152['options']?_0x9a8152[_0x3763('0x1d')][_0x3763('0x20')]||null:null,'limit':_0x9a8152[_0x3763('0x1d')]?_0x9a8152[_0x3763('0x1d')][_0x3763('0x21')]||null:null})[_0x3763('0xe')](function(_0x6ebb90){logger['info']('UpdateMailInteraction',_0x9a8152);logger['debug'](_0x3763('0x19'),_0x9a8152,JSON[_0x3763('0x12')](_0x6ebb90));_0x4aa7b0(_0x6ebb90);})[_0x3763('0x18')](function(_0xe5beb5){logger[_0x3763('0x13')](_0x3763('0x19'),_0xe5beb5[_0x3763('0x15')],_0x9a8152);_0x485836(_0x443422[_0x3763('0x13')](0x1f4,_0xe5beb5[_0x3763('0x15')]));});});};exports[_0x3763('0x22')]=function(_0x339870){return new Promise(function(_0x136c67,_0x4f9a96){return db[_0x3763('0x1a')][_0x3763('0x23')]({'where':_0x339870[_0x3763('0x1d')]?_0x339870['options'][_0x3763('0x1f')]||null:null})[_0x3763('0xe')](function(_0x18ffb0){if(_0x18ffb0){return _0x18ffb0['addTags'](_0x339870[_0x3763('0x1c')][_0x3763('0x24')],_[_0x3763('0x25')](_0x339870[_0x3763('0x1c')],[_0x3763('0x24'),'id'])||{});}})['spread'](function(_0x482c63){logger[_0x3763('0x16')](_0x3763('0x26'),_0x339870);logger[_0x3763('0x11')](_0x3763('0x26'),_0x339870,JSON[_0x3763('0x12')](_0x482c63));_0x136c67(_0x482c63);})[_0x3763('0x18')](function(_0xf9d6af){logger[_0x3763('0x13')]('AddTags',_0xf9d6af[_0x3763('0x15')],_0x339870);_0x4f9a96(_this[_0x3763('0x13')](0x1f4,_0xf9d6af[_0x3763('0x15')]));});});};
\ No newline at end of file
+var _0xd2ce=['addTags','ids','spread','AddTags','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','redis','defaults','localhost','./mailInteraction.socket','then','info','MailInteraction,\x20%s,\x20%s','request\x20sent','MailInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','UpdateMailInteraction','MailInteraction','body','options','raw','limit','debug','AddTagsToMailInteraction','find','where'];(function(_0x3bfdde,_0x306be4){var _0x3f752a=function(_0x3b6751){while(--_0x3b6751){_0x3bfdde['push'](_0x3bfdde['shift']());}};_0x3f752a(++_0x306be4);}(_0xd2ce,0x13c));var _0xed2c=function(_0x34021d,_0x753aa6){_0x34021d=_0x34021d-0x0;var _0x16597b=_0xd2ce[_0x34021d];return _0x16597b;};'use strict';var _=require('lodash');var util=require(_0xed2c('0x0'));var moment=require('moment');var BPromise=require(_0xed2c('0x1'));var rs=require(_0xed2c('0x2'));var fs=require('fs');var Redis=require(_0xed2c('0x3'));var db=require(_0xed2c('0x4'))['db'];var utils=require(_0xed2c('0x5'));var logger=require(_0xed2c('0x6'))(_0xed2c('0x7'));var config=require('../../config/environment');var jayson=require(_0xed2c('0x8'));var client=jayson['client'][_0xed2c('0x9')]({'port':0x232a});config[_0xed2c('0xa')]=_[_0xed2c('0xb')](config['redis'],{'host':_0xed2c('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xed2c('0xa')]));require(_0xed2c('0xd'))['register'](socket);function respondWithRpcPromise(_0x59dbad,_0x2b027a,_0x1b38df){return new BPromise(function(_0x613d5b,_0x26a384){return client['request'](_0x59dbad,_0x1b38df)[_0xed2c('0xe')](function(_0xd9a8fd){logger[_0xed2c('0xf')](_0xed2c('0x10'),_0x2b027a,_0xed2c('0x11'));logger['debug'](_0xed2c('0x12'),_0x2b027a,_0xed2c('0x11'),JSON[_0xed2c('0x13')](_0xd9a8fd));if(_0xd9a8fd[_0xed2c('0x14')]){if(_0xd9a8fd[_0xed2c('0x14')][_0xed2c('0x15')]===0x1f4){logger['error'](_0xed2c('0x10'),_0x2b027a,_0xd9a8fd['error'][_0xed2c('0x16')]);return _0x26a384(_0xd9a8fd[_0xed2c('0x14')][_0xed2c('0x16')]);}logger[_0xed2c('0x14')](_0xed2c('0x10'),_0x2b027a,_0xd9a8fd[_0xed2c('0x14')][_0xed2c('0x16')]);return _0x613d5b(_0xd9a8fd[_0xed2c('0x14')][_0xed2c('0x16')]);}else{logger[_0xed2c('0xf')](_0xed2c('0x10'),_0x2b027a,_0xed2c('0x11'));_0x613d5b(_0xd9a8fd[_0xed2c('0x17')][_0xed2c('0x16')]);}})[_0xed2c('0x18')](function(_0x358b06){logger[_0xed2c('0x14')]('MailInteraction,\x20%s,\x20%s',_0x2b027a,_0x358b06);_0x26a384(_0x358b06);});});}exports[_0xed2c('0x19')]=function(_0x5e3d03){var _0x38c699=this;return new Promise(function(_0x55dba9,_0x43107c){return db[_0xed2c('0x1a')]['update'](_0x5e3d03[_0xed2c('0x1b')],{'raw':_0x5e3d03[_0xed2c('0x1c')]?_0x5e3d03[_0xed2c('0x1c')][_0xed2c('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5e3d03[_0xed2c('0x1c')]?_0x5e3d03[_0xed2c('0x1c')]['where']||null:null,'attributes':_0x5e3d03[_0xed2c('0x1c')]?_0x5e3d03[_0xed2c('0x1c')]['attributes']||null:null,'limit':_0x5e3d03[_0xed2c('0x1c')]?_0x5e3d03['options'][_0xed2c('0x1e')]||null:null})[_0xed2c('0xe')](function(_0x5db628){logger[_0xed2c('0xf')]('UpdateMailInteraction',_0x5e3d03);logger[_0xed2c('0x1f')](_0xed2c('0x19'),_0x5e3d03,JSON[_0xed2c('0x13')](_0x5db628));_0x55dba9(_0x5db628);})[_0xed2c('0x18')](function(_0x22dc5d){logger[_0xed2c('0x14')](_0xed2c('0x19'),_0x22dc5d['message'],_0x5e3d03);_0x43107c(_0x38c699['error'](0x1f4,_0x22dc5d['message']));});});};exports[_0xed2c('0x20')]=function(_0x263108){return new Promise(function(_0x3ab376,_0x1fdc02){return db[_0xed2c('0x1a')][_0xed2c('0x21')]({'where':_0x263108[_0xed2c('0x1c')]?_0x263108[_0xed2c('0x1c')][_0xed2c('0x22')]||null:null})[_0xed2c('0xe')](function(_0x4748c4){if(_0x4748c4){return _0x4748c4[_0xed2c('0x23')](_0x263108[_0xed2c('0x1b')][_0xed2c('0x24')],_['omit'](_0x263108[_0xed2c('0x1b')],[_0xed2c('0x24'),'id'])||{});}})[_0xed2c('0x25')](function(_0x133479){logger[_0xed2c('0xf')]('AddTags',_0x263108);logger[_0xed2c('0x1f')](_0xed2c('0x26'),_0x263108,JSON['stringify'](_0x133479));_0x3ab376(_0x133479);})['catch'](function(_0x1f0b66){logger[_0xed2c('0x14')](_0xed2c('0x26'),_0x1f0b66[_0xed2c('0x16')],_0x263108);_0x1fdc02(_this[_0xed2c('0x14')](0x1f4,_0x1f0b66[_0xed2c('0x16')]));});});};
\ No newline at end of file
diff --git a/server/api/mailInteraction/mailInteraction.socket.js b/server/api/mailInteraction/mailInteraction.socket.js
index a03f0a4..3c150fb 100644
--- a/server/api/mailInteraction/mailInteraction.socket.js
+++ b/server/api/mailInteraction/mailInteraction.socket.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x3ba0=['mailInteraction:','save','remove','update','emit','removeListener','register','length'];(function(_0xf670f0,_0x353747){var _0x3c21c6=function(_0xa0e0b2){while(--_0xa0e0b2){_0xf670f0['push'](_0xf670f0['shift']());}};_0x3c21c6(++_0x353747);}(_0x3ba0,0x91));var _0x03ba=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x3ba0[_0x501510];return _0x1e6ee5;};'use strict';var MailInteractionEvents=require('./mailInteraction.events');var events=[_0x03ba('0x0'),_0x03ba('0x1'),_0x03ba('0x2')];function createListener(_0x2456c2,_0x14f22d){return function(_0x104a72){_0x14f22d[_0x03ba('0x3')](_0x2456c2,_0x104a72);};}function removeListener(_0x3d849f,_0x280714){return function(){MailInteractionEvents[_0x03ba('0x4')](_0x3d849f,_0x280714);};}exports[_0x03ba('0x5')]=function(_0x35f500){for(var _0x104975=0x0,_0x1a41a4=events[_0x03ba('0x6')];_0x104975<_0x1a41a4;_0x104975++){var _0xd18cae=events[_0x104975];var _0x5aff95=createListener(_0x03ba('0x7')+_0xd18cae,_0x35f500);MailInteractionEvents['on'](_0xd18cae,_0x5aff95);}};
\ No newline at end of file
+var _0x22a3=['mailInteraction:','./mailInteraction.events','remove','update','emit','register','length'];(function(_0x56dbf3,_0x4199c2){var _0x5cbe7c=function(_0x5774e0){while(--_0x5774e0){_0x56dbf3['push'](_0x56dbf3['shift']());}};_0x5cbe7c(++_0x4199c2);}(_0x22a3,0x1c8));var _0x322a=function(_0x1a0620,_0x4f40c3){_0x1a0620=_0x1a0620-0x0;var _0x475abc=_0x22a3[_0x1a0620];return _0x475abc;};'use strict';var MailInteractionEvents=require(_0x322a('0x0'));var events=['save',_0x322a('0x1'),_0x322a('0x2')];function createListener(_0x53192c,_0x14b9eb){return function(_0x4fb7a0){_0x14b9eb[_0x322a('0x3')](_0x53192c,_0x4fb7a0);};}function removeListener(_0x25fafe,_0x23aa37){return function(){MailInteractionEvents['removeListener'](_0x25fafe,_0x23aa37);};}exports[_0x322a('0x4')]=function(_0x2fde6d){for(var _0x4c57a9=0x0,_0x2c45c7=events[_0x322a('0x5')];_0x4c57a9<_0x2c45c7;_0x4c57a9++){var _0x37e421=events[_0x4c57a9];var _0x39b467=createListener(_0x322a('0x6')+_0x37e421,_0x2fde6d);MailInteractionEvents['on'](_0x37e421,_0x39b467);}};
\ No newline at end of file
diff --git a/server/api/mailMessage/index.js b/server/api/mailMessage/index.js
index 1931eae..a1345e5 100644
--- a/server/api/mailMessage/index.js
+++ b/server/api/mailMessage/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x8ef6=['destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./mailMessage.controller','get','isAuthenticated','/describe','describe','/:id','show','/:id/download','download','post','tracked','mail','mailmessage:create','put','update','/:id/accept','accept','/:id/reject','reject','delete'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x8ef6,0xf2));var _0x68ef=function(_0x31b97c,_0x2d2d8b){_0x31b97c=_0x31b97c-0x0;var _0x378b0f=_0x8ef6[_0x31b97c];return _0x378b0f;};'use strict';var multer=require(_0x68ef('0x0'));var util=require(_0x68ef('0x1'));var path=require(_0x68ef('0x2'));var timeout=require(_0x68ef('0x3'));var express=require(_0x68ef('0x4'));var router=express[_0x68ef('0x5')]();var auth=require(_0x68ef('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x68ef('0x7'));var controller=require(_0x68ef('0x8'));router[_0x68ef('0x9')]('/',auth[_0x68ef('0xa')](),controller['index']);router['get'](_0x68ef('0xb'),auth[_0x68ef('0xa')](),controller[_0x68ef('0xc')]);router['get'](_0x68ef('0xd'),auth[_0x68ef('0xa')](),controller[_0x68ef('0xe')]);router[_0x68ef('0x9')](_0x68ef('0xf'),auth[_0x68ef('0xa')](),controller[_0x68ef('0x10')]);router[_0x68ef('0x11')]('/',auth[_0x68ef('0xa')](),interaction[_0x68ef('0x12')](_0x68ef('0x13'),_0x68ef('0x14')),controller['create']);router[_0x68ef('0x15')](_0x68ef('0xd'),auth[_0x68ef('0xa')](),controller[_0x68ef('0x16')]);router[_0x68ef('0x15')](_0x68ef('0x17'),auth['isAuthenticated'](),controller[_0x68ef('0x18')]);router[_0x68ef('0x15')](_0x68ef('0x19'),auth['isAuthenticated'](),controller[_0x68ef('0x1a')]);router[_0x68ef('0x1b')](_0x68ef('0xd'),auth['isAuthenticated'](),controller[_0x68ef('0x1c')]);module[_0x68ef('0x1d')]=router;
\ No newline at end of file
+var _0xd6d6=['mailmessage:create','update','put','/:id/accept','accept','reject','delete','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailMessage.controller','get','isAuthenticated','/describe','describe','/:id','/:id/download','download','post','mail'];(function(_0x63294b,_0x67af04){var _0x5cc535=function(_0x1ee594){while(--_0x1ee594){_0x63294b['push'](_0x63294b['shift']());}};_0x5cc535(++_0x67af04);}(_0xd6d6,0xbe));var _0x6d6d=function(_0x23d1ca,_0x1a5f84){_0x23d1ca=_0x23d1ca-0x0;var _0x2ce344=_0xd6d6[_0x23d1ca];return _0x2ce344;};'use strict';var multer=require(_0x6d6d('0x0'));var util=require(_0x6d6d('0x1'));var path=require(_0x6d6d('0x2'));var timeout=require(_0x6d6d('0x3'));var express=require('express');var router=express[_0x6d6d('0x4')]();var auth=require(_0x6d6d('0x5'));var interaction=require(_0x6d6d('0x6'));var config=require(_0x6d6d('0x7'));var controller=require(_0x6d6d('0x8'));router[_0x6d6d('0x9')]('/',auth[_0x6d6d('0xa')](),controller['index']);router[_0x6d6d('0x9')](_0x6d6d('0xb'),auth[_0x6d6d('0xa')](),controller[_0x6d6d('0xc')]);router[_0x6d6d('0x9')](_0x6d6d('0xd'),auth[_0x6d6d('0xa')](),controller['show']);router['get'](_0x6d6d('0xe'),auth[_0x6d6d('0xa')](),controller[_0x6d6d('0xf')]);router[_0x6d6d('0x10')]('/',auth[_0x6d6d('0xa')](),interaction['tracked'](_0x6d6d('0x11'),_0x6d6d('0x12')),controller['create']);router['put'](_0x6d6d('0xd'),auth[_0x6d6d('0xa')](),controller[_0x6d6d('0x13')]);router[_0x6d6d('0x14')](_0x6d6d('0x15'),auth[_0x6d6d('0xa')](),controller[_0x6d6d('0x16')]);router[_0x6d6d('0x14')]('/:id/reject',auth[_0x6d6d('0xa')](),controller[_0x6d6d('0x17')]);router[_0x6d6d('0x18')](_0x6d6d('0xd'),auth[_0x6d6d('0xa')](),controller['destroy']);module[_0x6d6d('0x19')]=router;
\ No newline at end of file
diff --git a/server/api/mailMessage/mailMessage.attributes.js b/server/api/mailMessage/mailMessage.attributes.js
index 1654601..b797231 100644
--- a/server/api/mailMessage/mailMessage.attributes.js
+++ b/server/api/mailMessage/mailMessage.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x2d0b=['out','STRING','long','DATE','INTEGER','lodash','exports','TEXT','medium','BOOLEAN','ENUM'];(function(_0x37394f,_0x2a0baf){var _0x4dcf2c=function(_0x4466f0){while(--_0x4466f0){_0x37394f['push'](_0x37394f['shift']());}};_0x4dcf2c(++_0x2a0baf);}(_0x2d0b,0x102));var _0xb2d0=function(_0x58e7eb,_0x26a78d){_0x58e7eb=_0x58e7eb-0x0;var _0x1bed29=_0x2d0b[_0x58e7eb];return _0x1bed29;};'use strict';var Sequelize=require('sequelize');var _=require(_0xb2d0('0x0'));module[_0xb2d0('0x1')]={'body':{'type':Sequelize[_0xb2d0('0x2')]('long'),'allowNull':![]},'plainBody':{'type':Sequelize[_0xb2d0('0x2')](_0xb2d0('0x3'))},'read':{'type':Sequelize[_0xb2d0('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0xb2d0('0x5')]('in','out'),'defaultValue':_0xb2d0('0x6'),'allowNull':![]},'messageId':{'type':Sequelize['STRING'](0x1fe)},'from':{'type':Sequelize[_0xb2d0('0x7')]},'to':{'type':Sequelize[_0xb2d0('0x2')](_0xb2d0('0x8'))},'cc':{'type':Sequelize[_0xb2d0('0x2')](_0xb2d0('0x8'))},'bcc':{'type':Sequelize[_0xb2d0('0x2')](_0xb2d0('0x8'))},'subject':{'type':Sequelize[_0xb2d0('0x2')]},'sentAt':{'type':Sequelize[_0xb2d0('0x9')]},'attach':{'type':Sequelize[_0xb2d0('0xa')],'defaultValue':0x0},'secret':{'type':Sequelize[_0xb2d0('0x4')],'defaultValue':![]},'readAt':{'type':Sequelize['DATE']},'originTo':{'type':Sequelize['TEXT']('long')},'originCc':{'type':Sequelize[_0xb2d0('0x2')]('long')}};
\ No newline at end of file
+var _0x5360=['long','DATE','BOOLEAN','sequelize','lodash','exports','TEXT','medium','ENUM','out'];(function(_0x430b31,_0x25d328){var _0x35f74a=function(_0x28bc66){while(--_0x28bc66){_0x430b31['push'](_0x430b31['shift']());}};_0x35f74a(++_0x25d328);}(_0x5360,0x157));var _0x0536=function(_0x14e266,_0x1510ee){_0x14e266=_0x14e266-0x0;var _0x14ee57=_0x5360[_0x14e266];return _0x14ee57;};'use strict';var Sequelize=require(_0x0536('0x0'));var _=require(_0x0536('0x1'));module[_0x0536('0x2')]={'body':{'type':Sequelize[_0x0536('0x3')]('long'),'allowNull':![]},'plainBody':{'type':Sequelize['TEXT'](_0x0536('0x4'))},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0x0536('0x5')]('in',_0x0536('0x6')),'defaultValue':'out','allowNull':![]},'messageId':{'type':Sequelize['STRING'](0x1fe)},'from':{'type':Sequelize['STRING']},'to':{'type':Sequelize[_0x0536('0x3')](_0x0536('0x7'))},'cc':{'type':Sequelize[_0x0536('0x3')](_0x0536('0x7'))},'bcc':{'type':Sequelize['TEXT'](_0x0536('0x7'))},'subject':{'type':Sequelize[_0x0536('0x3')]},'sentAt':{'type':Sequelize[_0x0536('0x8')]},'attach':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'secret':{'type':Sequelize[_0x0536('0x9')],'defaultValue':![]},'readAt':{'type':Sequelize['DATE']},'originTo':{'type':Sequelize['TEXT']('long')},'originCc':{'type':Sequelize['TEXT'](_0x0536('0x7'))}};
\ No newline at end of file
diff --git a/server/api/mailMessage/mailMessage.controller.js b/server/api/mailMessage/mailMessage.controller.js
index f0dd40a..f3a4f85 100644
--- a/server/api/mailMessage/mailMessage.controller.js
+++ b/server/api/mailMessage/mailMessage.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7163=['../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./mailMessage.socket','register','jayson/promise','client','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','request\x20sent','MailMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','MailMessage,\x20%s,\x20%s','message','result','catch','sendStatus','status','end','json','count','offset','set','Content-Range','apply','reject','save','update','stack','name','send','index','map','MailMessage','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','hasOwnProperty','limit','sort','pick','filter','where','VIRTUAL','include','findAll','rows','show','keys','fields','includeAll','merge','options','find','body','params','describe','create','direction','secret','split','MailAccount','MailAccountId','List','CmContact','Contacts','DESC','MailServerOut','Smtp','isNil','service','host','port','authentication','auth','user','pass','secure','attachments','length','server/files/attachments','basename','List\x20not\x20found','sendMail','messageId','format','YYYY-MM-DD\x20HH:mm:ss','mail-interactions','accept','mail','read','readAt','UserId','Contact','get','MailInteraction','MailInteractionId','read1stAt','interaction','role','null','AcceptMessage','manual','interface','SIP/%s','channel','event','EventManager','agent','info','[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','rejectmessage','download','toString','join','root','server','files','tmp','from','bcc','subject','createdAt','Attachment','Attachments','headers','Bcc','existsSync','push','writeFileSync','log','err','unlinkSync','html-pdf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0x55fc3f,_0x4beb3a){var _0x38b6d3=function(_0x2fc8e4){while(--_0x2fc8e4){_0x55fc3f['push'](_0x55fc3f['shift']());}};_0x38b6d3(++_0x4beb3a);}(_0x7163,0x1ef));var _0x3716=function(_0x40822a,_0x582b60){_0x40822a=_0x40822a-0x0;var _0x357420=_0x7163[_0x40822a];return _0x357420;};'use strict';var pdf=require(_0x3716('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x3716('0x1'));var jsonpatch=require(_0x3716('0x2'));var rp=require(_0x3716('0x3'));var moment=require('moment');var BPromise=require(_0x3716('0x4'));var Mustache=require(_0x3716('0x5'));var util=require(_0x3716('0x6'));var path=require(_0x3716('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x3716('0x8'));var fs=require('fs');var _=require(_0x3716('0x9'));var squel=require(_0x3716('0xa'));var crypto=require(_0x3716('0xb'));var jsforce=require(_0x3716('0xc'));var deskjs=require(_0x3716('0xd'));var toCsv=require(_0x3716('0xe'));var querystring=require(_0x3716('0xf'));var Papa=require(_0x3716('0x10'));var Redis=require(_0x3716('0x11'));var authService=require(_0x3716('0x12'));var qs=require(_0x3716('0x13'));var as=require(_0x3716('0x14'));var hardwareService=require(_0x3716('0x15'));var logger=require(_0x3716('0x16'))(_0x3716('0x17'));var utils=require(_0x3716('0x18'));var config=require(_0x3716('0x19'));var db=require(_0x3716('0x1a'))['db'];config[_0x3716('0x1b')]=_[_0x3716('0x1c')](config[_0x3716('0x1b')],{'host':_0x3716('0x1d'),'port':0x18eb});var socket=require(_0x3716('0x1e'))(new Redis(config[_0x3716('0x1b')]));require(_0x3716('0x1f'))[_0x3716('0x20')](socket);var jayson=require(_0x3716('0x21'));var client=jayson['client']['http']({'port':0x232c});var client9003=jayson['client']['http']({'port':0x232b});var client9002=jayson[_0x3716('0x22')]['http']({'port':0x232a});function checkPasswordPattern(_0x166835,_0x3608b6,_0x44680c){if(_0x44680c){var _0x562133=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x562133['test'](_0x3608b6)){return _0x166835;}else{throw new db['Sequelize']['ValidationError'](_0x3716('0x23'));}}else{return _0x166835;}}function respondWithRpcPromise(_0x41cbef,_0x5d16c4,_0x248464,_0x331b57){return new BPromise(function(_0x1fb022,_0xf6c764){var _0x22d1b7=_0x331b57||client;return _0x22d1b7[_0x3716('0x24')](_0x41cbef,_0x248464)[_0x3716('0x25')](function(_0x564d5c){logger['info']('MailMessage,\x20%s,\x20%s',_0x5d16c4,_0x3716('0x26'));logger['debug'](_0x3716('0x27'),_0x5d16c4,_0x3716('0x26'),JSON[_0x3716('0x28')](_0x564d5c));if(_0x564d5c[_0x3716('0x29')]){if(_0x564d5c[_0x3716('0x29')][_0x3716('0x2a')]===0x1f4){logger[_0x3716('0x29')](_0x3716('0x2b'),_0x5d16c4,_0x564d5c[_0x3716('0x29')]['message']);return _0xf6c764(_0x564d5c[_0x3716('0x29')][_0x3716('0x2c')]);}logger[_0x3716('0x29')]('MailMessage,\x20%s,\x20%s',_0x5d16c4,_0x564d5c[_0x3716('0x29')][_0x3716('0x2c')]);return _0x1fb022(_0x564d5c['error'][_0x3716('0x2c')]);}else{logger['info'](_0x3716('0x2b'),_0x5d16c4,_0x3716('0x26'));_0x1fb022(_0x564d5c[_0x3716('0x2d')]['message']);}})[_0x3716('0x2e')](function(_0x5a4476){logger[_0x3716('0x29')](_0x3716('0x2b'),_0x5d16c4,_0x5a4476);_0xf6c764(_0x5a4476);});});}function respondWithStatusCode(_0x4f0f2b,_0x3aec25){_0x3aec25=_0x3aec25||0xcc;return function(_0x3dcf6b){if(_0x3dcf6b){return _0x4f0f2b[_0x3716('0x2f')](_0x3aec25);}return _0x4f0f2b[_0x3716('0x30')](_0x3aec25)[_0x3716('0x31')]();};}function respondWithResult(_0x4f76dc,_0x2fdfa1){_0x2fdfa1=_0x2fdfa1||0xc8;return function(_0x116e40){if(_0x116e40){return _0x4f76dc[_0x3716('0x30')](_0x2fdfa1)[_0x3716('0x32')](_0x116e40);}};}function respondWithFilteredResult(_0x4fee70,_0x3e844f){return function(_0x27553a){if(_0x27553a){var _0x440e7f=_0x27553a[_0x3716('0x33')],_0x3f82c7=_0x3e844f[_0x3716('0x34')],_0x413f6b=_0x3e844f[_0x3716('0x34')]+_0x3e844f['limit'],_0x55956a;if(_0x413f6b>=_0x440e7f){_0x413f6b=_0x440e7f;_0x55956a=0xc8;}else{_0x55956a=0xce;}_0x4fee70['status'](_0x55956a);return _0x4fee70[_0x3716('0x35')](_0x3716('0x36'),_0x3f82c7+'-'+_0x413f6b+'/'+_0x440e7f)[_0x3716('0x32')](_0x27553a);}return null;};}function patchUpdates(_0x357acf){return function(_0x5835d4){try{jsonpatch[_0x3716('0x37')](_0x5835d4,_0x357acf,!![]);}catch(_0x149470){return BPromise[_0x3716('0x38')](_0x149470);}return _0x5835d4[_0x3716('0x39')]();};}function saveUpdates(_0x217bd0,_0x275f04){return function(_0x55fc69){if(_0x55fc69){return _0x55fc69[_0x3716('0x3a')](_0x217bd0)[_0x3716('0x25')](function(_0x2faba3){return _0x2faba3;});}return null;};}function removeEntity(_0x52deab,_0x596f54){return function(_0x3f4702){if(_0x3f4702){return _0x3f4702['destroy']()[_0x3716('0x25')](function(){_0x52deab[_0x3716('0x30')](0xcc)[_0x3716('0x31')]();});}};}function handleEntityNotFound(_0xe32c6f,_0x2e8416){return function(_0x427cbc){if(!_0x427cbc){_0xe32c6f[_0x3716('0x2f')](0x194);}return _0x427cbc;};}function handleError(_0x2fa793,_0x5a33e4){_0x5a33e4=_0x5a33e4||0x1f4;return function(_0x9d03dc){logger[_0x3716('0x29')](_0x9d03dc[_0x3716('0x3b')]);if(_0x9d03dc['name']){delete _0x9d03dc[_0x3716('0x3c')];}_0x2fa793['status'](_0x5a33e4)[_0x3716('0x3d')](_0x9d03dc);};}exports[_0x3716('0x3e')]=function(_0x4781d7,_0x1f14bb){var _0x268f04={},_0x207d5e={},_0x31d495={'count':0x0,'rows':[]};var _0x1b6b6b=_[_0x3716('0x3f')](db[_0x3716('0x40')][_0x3716('0x41')],function(_0x512eea){return{'name':_0x512eea[_0x3716('0x42')],'type':_0x512eea[_0x3716('0x43')][_0x3716('0x44')]};});_0x207d5e[_0x3716('0x45')]=_['map'](_0x1b6b6b,_0x3716('0x3c'));_0x207d5e[_0x3716('0x46')]=_['keys'](_0x4781d7[_0x3716('0x46')]);_0x207d5e[_0x3716('0x47')]=_['intersection'](_0x207d5e[_0x3716('0x45')],_0x207d5e[_0x3716('0x46')]);_0x268f04['attributes']=_[_0x3716('0x48')](_0x207d5e[_0x3716('0x45')],qs['fields'](_0x4781d7[_0x3716('0x46')]['fields']));_0x268f04[_0x3716('0x49')]=_0x268f04[_0x3716('0x49')]['length']?_0x268f04['attributes']:_0x207d5e[_0x3716('0x45')];if(!_0x4781d7[_0x3716('0x46')][_0x3716('0x4a')]('nolimit')){_0x268f04[_0x3716('0x4b')]=qs[_0x3716('0x4b')](_0x4781d7['query'][_0x3716('0x4b')]);_0x268f04['offset']=qs[_0x3716('0x34')](_0x4781d7[_0x3716('0x46')][_0x3716('0x34')]);}_0x268f04['order']=qs['sort'](_0x4781d7[_0x3716('0x46')][_0x3716('0x4c')]);_0x268f04['where']=qs[_0x3716('0x47')](_[_0x3716('0x4d')](_0x4781d7[_0x3716('0x46')],_0x207d5e[_0x3716('0x47')]),_0x1b6b6b);if(_0x4781d7[_0x3716('0x46')][_0x3716('0x4e')]){_0x268f04[_0x3716('0x4f')]=_['merge'](_0x268f04[_0x3716('0x4f')],{'$or':_[_0x3716('0x3f')](_0x1b6b6b,function(_0x30f012){if(_0x30f012[_0x3716('0x43')]!==_0x3716('0x50')){var _0x3015c3={};_0x3015c3[_0x30f012[_0x3716('0x3c')]]={'$like':'%'+_0x4781d7['query']['filter']+'%'};return _0x3015c3;}})});}_0x268f04=_['merge']({},_0x268f04,_0x4781d7['options']);var _0x1ef5da={'where':_0x268f04[_0x3716('0x4f')]};return db[_0x3716('0x40')][_0x3716('0x33')](_0x1ef5da)['then'](function(_0x2aad2a){_0x31d495['count']=_0x2aad2a;if(_0x4781d7[_0x3716('0x46')]['includeAll']){_0x268f04[_0x3716('0x51')]=[{'all':!![]}];}return db['MailMessage'][_0x3716('0x52')](_0x268f04);})[_0x3716('0x25')](function(_0x417ed6){_0x31d495[_0x3716('0x53')]=_0x417ed6;return _0x31d495;})[_0x3716('0x25')](respondWithFilteredResult(_0x1f14bb,_0x268f04))[_0x3716('0x2e')](handleError(_0x1f14bb,null));};exports[_0x3716('0x54')]=function(_0x1ae37c,_0x289a79){var _0xca5eca={'raw':!![],'where':{'id':_0x1ae37c['params']['id']}},_0x3f05de={};_0x3f05de['model']=_[_0x3716('0x55')](db[_0x3716('0x40')]['rawAttributes']);_0x3f05de[_0x3716('0x46')]=_[_0x3716('0x55')](_0x1ae37c[_0x3716('0x46')]);_0x3f05de[_0x3716('0x47')]=_[_0x3716('0x48')](_0x3f05de['model'],_0x3f05de[_0x3716('0x46')]);_0xca5eca[_0x3716('0x49')]=_['intersection'](_0x3f05de[_0x3716('0x45')],qs[_0x3716('0x56')](_0x1ae37c['query'][_0x3716('0x56')]));_0xca5eca[_0x3716('0x49')]=_0xca5eca['attributes']['length']?_0xca5eca[_0x3716('0x49')]:_0x3f05de[_0x3716('0x45')];if(_0x1ae37c[_0x3716('0x46')][_0x3716('0x57')]){_0xca5eca[_0x3716('0x51')]=[{'all':!![]}];}_0xca5eca=_[_0x3716('0x58')]({},_0xca5eca,_0x1ae37c[_0x3716('0x59')]);return db[_0x3716('0x40')][_0x3716('0x5a')](_0xca5eca)['then'](handleEntityNotFound(_0x289a79,null))[_0x3716('0x25')](respondWithResult(_0x289a79,null))[_0x3716('0x2e')](handleError(_0x289a79,null));};exports[_0x3716('0x3a')]=function(_0x50ceee,_0x1e78aa){if(_0x50ceee[_0x3716('0x5b')]['id']){delete _0x50ceee[_0x3716('0x5b')]['id'];}return db[_0x3716('0x40')][_0x3716('0x5a')]({'where':{'id':_0x50ceee[_0x3716('0x5c')]['id']}})[_0x3716('0x25')](handleEntityNotFound(_0x1e78aa,null))[_0x3716('0x25')](saveUpdates(_0x50ceee['body'],null))[_0x3716('0x25')](respondWithResult(_0x1e78aa,null))[_0x3716('0x2e')](handleError(_0x1e78aa,null));};exports['destroy']=function(_0x1a3da5,_0xb16674){return db[_0x3716('0x40')][_0x3716('0x5a')]({'where':{'id':_0x1a3da5[_0x3716('0x5c')]['id']}})['then'](handleEntityNotFound(_0xb16674,null))['then'](removeEntity(_0xb16674,null))[_0x3716('0x2e')](handleError(_0xb16674,null));};exports[_0x3716('0x5d')]=function(_0x4d59bb,_0x1cc549){return db[_0x3716('0x40')][_0x3716('0x5d')]()['then'](respondWithResult(_0x1cc549,null))[_0x3716('0x2e')](handleError(_0x1cc549,null));};exports[_0x3716('0x5e')]=function(_0x5307b9,_0xd25996){return db[_0x3716('0x40')]['create'](_0x5307b9[_0x3716('0x5b')])['then'](function(_0x254d76){if(_0x254d76){if(_0x254d76[_0x3716('0x5f')]==='out'&&!_0x254d76[_0x3716('0x60')]){var _0x503856,_0x241997,_0x72b08d;if(_0x5307b9['body']['to']){_0x241997=_0x5307b9[_0x3716('0x5b')]['to'][_0x3716('0x61')](',')[0x0];}return db[_0x3716('0x62')]['findOne']({'where':{'id':_0x254d76[_0x3716('0x63')]},'include':[{'model':db['CmList'],'as':_0x3716('0x64'),'include':[{'model':db[_0x3716('0x65')],'as':_0x3716('0x66'),'where':{'email':_0x241997},'limit':0x1,'order':[['updatedAt',_0x3716('0x67')]]}]},{'model':db[_0x3716('0x68')],'as':'Smtp','raw':!![]}]})[_0x3716('0x25')](function(_0xf790ad){_0x503856=_0xf790ad;if(_0x503856&&_0x503856[_0x3716('0x69')]){var _0x2ceb1c={'tls':{'rejectUnauthorized':![]}};if(_[_0x3716('0x6a')](_0x503856[_0x3716('0x69')][_0x3716('0x6b')])){_0x2ceb1c[_0x3716('0x6c')]=_0x503856['Smtp'][_0x3716('0x6c')];_0x2ceb1c['port']=_0x503856[_0x3716('0x69')][_0x3716('0x6d')];_0x2ceb1c['secure']=_0x503856[_0x3716('0x69')]['secure'];if(_0x503856[_0x3716('0x69')][_0x3716('0x6e')]){_0x2ceb1c[_0x3716('0x6f')]={'user':_0x503856[_0x3716('0x69')][_0x3716('0x70')],'pass':_0x503856[_0x3716('0x69')]['pass']};}}else{_0x2ceb1c[_0x3716('0x6b')]=_0x503856['Smtp'][_0x3716('0x6b')];_0x2ceb1c['auth']={'user':_0x503856[_0x3716('0x69')][_0x3716('0x70')],'pass':_0x503856['Smtp'][_0x3716('0x71')]};_0x2ceb1c[_0x3716('0x72')]=_0x503856[_0x3716('0x69')][_0x3716('0x72')];}if(_0x5307b9['body'][_0x3716('0x73')]&&_0x5307b9[_0x3716('0x5b')][_0x3716('0x73')][_0x3716('0x74')]){for(var _0x46bd5=0x0;_0x46bd5<_0x5307b9[_0x3716('0x5b')][_0x3716('0x73')]['length'];_0x46bd5+=0x1){_0x5307b9['body'][_0x3716('0x73')][_0x46bd5]={'filename':_0x5307b9['body'][_0x3716('0x73')][_0x46bd5][_0x3716('0x3c')],'path':path['join'](config['root'],_0x3716('0x75'),_0x5307b9['body'][_0x3716('0x73')][_0x46bd5][_0x3716('0x76')])};}}_0x72b08d={'account':_0x2ceb1c,'message':_0x5307b9[_0x3716('0x5b')]};return;}})[_0x3716('0x25')](function(){if(_0x503856[_0x3716('0x64')]){if(_0x503856[_0x3716('0x64')]['Contacts']['length']){return _0x503856[_0x3716('0x64')][_0x3716('0x66')][0x0];}else{return db[_0x3716('0x65')][_0x3716('0x5e')](_[_0x3716('0x1c')](_0x5307b9[_0x3716('0x5b')],{'firstName':_0x5307b9[_0x3716('0x5b')]['to'],'email':_0x5307b9['body']['to'],'phone':_0x5307b9[_0x3716('0x5b')]['to'],'ListId':_0x503856['ListId']}));}}else{throw new Error(_0x3716('0x77'));}})[_0x3716('0x25')](function(){if(_0x72b08d){return respondWithRpcPromise('SendMail',_0x3716('0x78'),_0x72b08d,client9003)[_0x3716('0x25')](function(_0x1b047f){return _0x254d76[_0x3716('0x3a')]({'read':!![],'messageId':_0x1b047f[_0x3716('0x79')],'sentAt':moment()[_0x3716('0x7a')](_0x3716('0x7b'))});})[_0x3716('0x2e')](function(_0x5b61fc){logger['error']('%s',JSON['stringify'](_0x5b61fc));return _0x254d76;});}return _0x254d76;});}return _0x254d76;}})['then'](respondWithResult(_0xd25996,0xc9))[_0x3716('0x2e')](handleError(_0xd25996,null));};var interaction_log=require(_0x3716('0x16'))(_0x3716('0x7c'));exports[_0x3716('0x7d')]=function(_0x2af672,_0x5dcce1,_0x10dc07){var _0xc2a695={'channel':_0x3716('0x7e')};if(_0x2af672[_0x3716('0x5b')]['id']){delete _0x2af672[_0x3716('0x5b')]['id'];}_0x2af672['body'][_0x3716('0x7f')]=!![];_0x2af672[_0x3716('0x5b')][_0x3716('0x80')]=moment()[_0x3716('0x7a')](_0x3716('0x7b'));_0x2af672[_0x3716('0x5b')][_0x3716('0x81')]=_0x2af672[_0x3716('0x5b')][_0x3716('0x81')]||_0x2af672['user']['id'];return db[_0x3716('0x40')]['find']({'where':{'id':_0x2af672[_0x3716('0x5c')]['id'],'UserId':null},'include':[{'model':db[_0x3716('0x65')],'as':_0x3716('0x82')}]})[_0x3716('0x25')](handleEntityNotFound(_0x5dcce1,null))[_0x3716('0x25')](saveUpdates(_0x2af672[_0x3716('0x5b')],null))[_0x3716('0x25')](function(_0x4ceebc){if(_0x4ceebc){_0xc2a695[_0x3716('0x2c')]=_0x4ceebc[_0x3716('0x83')]({'plain':!![]});return db[_0x3716('0x84')][_0x3716('0x5a')]({'where':{'id':_0x4ceebc[_0x3716('0x85')]}});}return null;})[_0x3716('0x25')](handleEntityNotFound(_0x5dcce1,null))[_0x3716('0x25')](function(_0x17d7a9){if(_0x17d7a9){return _0x17d7a9[_0x3716('0x3a')]({'UserId':_0x2af672[_0x3716('0x5b')]['UserId'],'read1stAt':_[_0x3716('0x6a')](_0x17d7a9[_0x3716('0x86')])?moment()[_0x3716('0x7a')](_0x3716('0x7b')):undefined});}return null;})[_0x3716('0x25')](function(_0x1cc4e4){if(_0x1cc4e4){_0xc2a695[_0x3716('0x87')]=_0x1cc4e4[_0x3716('0x83')]({'plain':!![]});interaction_log['info']('[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x2af672[_0x3716('0x70')]['id'],_0x2af672[_0x3716('0x70')][_0x3716('0x3c')],_0x2af672[_0x3716('0x70')][_0x3716('0x88')],_0xc2a695[_0x3716('0x87')]['id'],_0x2af672['body']?JSON[_0x3716('0x28')](_0x2af672[_0x3716('0x5b')]):_0x3716('0x89'));return respondWithRpcPromise(_0x3716('0x8a'),'acceptMessage',_0xc2a695);}return null;})[_0x3716('0x25')](function(_0x227d24){if(_0x227d24){if(_0x2af672[_0x3716('0x5b')][_0x3716('0x8b')]){_0xc2a695[_0x3716('0x2c')][_0x3716('0x8c')]=util[_0x3716('0x7a')](_0x3716('0x8d'),_0x2af672[_0x3716('0x70')][_0x3716('0x3c')]);_0xc2a695[_0x3716('0x2c')]['channel']=_0xc2a695[_0x3716('0x8e')];_0xc2a695['message'][_0x3716('0x8f')]=_0x3716('0x7d');return respondWithRpcPromise(_0x3716('0x90'),'EventManager',{'event':'acceptmessage','message':_0xc2a695[_0x3716('0x2c')]},client9002)[_0x3716('0x25')](function(){return _0xc2a695;});}return _0xc2a695;}return null;})[_0x3716('0x25')](respondWithResult(_0x5dcce1,null))[_0x3716('0x2e')](handleError(_0x5dcce1,null));};var interaction_log=require(_0x3716('0x16'))(_0x3716('0x7c'));exports[_0x3716('0x38')]=function(_0x252966,_0x6a77a8,_0x16511f){var _0x4931f8={'agent':{},'channel':_0x3716('0x7e')};if(_0x252966[_0x3716('0x5b')]['id']){delete _0x252966['body']['id'];}_0x252966[_0x3716('0x5b')]['UserId']=_0x252966[_0x3716('0x5b')]['UserId']||_0x252966[_0x3716('0x70')]['id'];_0x4931f8[_0x3716('0x91')]['id']=_0x252966[_0x3716('0x5b')][_0x3716('0x81')];return db[_0x3716('0x40')]['find']({'where':{'id':_0x252966[_0x3716('0x5c')]['id'],'UserId':null}})[_0x3716('0x25')](handleEntityNotFound(_0x6a77a8,null))['then'](function(_0x265377){if(_0x265377){_0x4931f8[_0x3716('0x2c')]=_0x265377[_0x3716('0x83')]({'plain':!![]});return db[_0x3716('0x84')][_0x3716('0x5a')]({'where':{'id':_0x265377[_0x3716('0x85')]}});}return null;})[_0x3716('0x25')](handleEntityNotFound(_0x6a77a8,null))[_0x3716('0x25')](function(_0x14b660){if(_0x14b660){_0x4931f8[_0x3716('0x87')]=_0x14b660[_0x3716('0x83')]({'plain':!![]});interaction_log[_0x3716('0x92')](_0x3716('0x93'),_0x252966[_0x3716('0x70')]['id'],_0x252966['user']['name'],_0x252966[_0x3716('0x70')][_0x3716('0x88')],_0x4931f8['interaction']['id'],_0x252966[_0x3716('0x5b')]?JSON[_0x3716('0x28')](_0x252966['body']):_0x3716('0x89'));return respondWithRpcPromise(_0x3716('0x94'),_0x3716('0x95'),_0x4931f8);}return null;})[_0x3716('0x25')](function(_0x4f7b77){if(_0x4f7b77){_0x4f7b77[_0x3716('0x2c')][_0x3716('0x8c')]=util[_0x3716('0x7a')](_0x3716('0x8d'),_0x252966[_0x3716('0x70')][_0x3716('0x3c')]);_0x4f7b77['message'][_0x3716('0x8e')]=_0x4931f8[_0x3716('0x8e')];_0x4f7b77[_0x3716('0x2c')]['event']=_0x3716('0x38');respondWithRpcPromise(_0x3716('0x90'),'EventManager',{'event':_0x3716('0x96'),'message':_0x4f7b77['message']},client9002);return _0x4931f8;}return null;})[_0x3716('0x25')](respondWithResult(_0x6a77a8,null))[_0x3716('0x2e')](handleError(_0x6a77a8,null));};exports[_0x3716('0x97')]=function(_0x1c8494,_0xfda4a8){var _0x1149a7=moment()['unix']()[_0x3716('0x98')]();var _0x5e0707=path[_0x3716('0x99')](config[_0x3716('0x9a')],_0x3716('0x9b'),_0x3716('0x9c'),_0x3716('0x9d'));var _0x5d09a5=path['join'](config[_0x3716('0x9a')],_0x3716('0x9b'),'files','attachments');var _0x444448=util[_0x3716('0x7a')]('message-%s.eml',_0x1149a7);return db[_0x3716('0x40')][_0x3716('0x5a')]({'where':{'id':_0x1c8494[_0x3716('0x5c')]['id']},'attributes':['id',_0x3716('0x5b'),_0x3716('0x9e'),'to','cc',_0x3716('0x9f'),_0x3716('0xa0'),_0x3716('0xa1')],'include':_0x1c8494[_0x3716('0x46')][_0x3716('0x73')]?[{'model':db[_0x3716('0xa2')],'as':_0x3716('0xa3')}]:undefined})['then'](handleEntityNotFound(_0xfda4a8,null))[_0x3716('0x25')](function(_0x23f8e1){if(_0x23f8e1){var _0x4a826b=_0x23f8e1;var _0x22c511={'from':_0x4a826b['from'],'to':_0x4a826b['to'],'subject':_0x4a826b[_0x3716('0xa0')],'html':_0x4a826b[_0x3716('0x5b')],'headers':{'Date':moment(_0x4a826b[_0x3716('0xa1')])[_0x3716('0x7a')]('ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ')},'attachments':[]};if(_0x23f8e1['cc']){_0x22c511[_0x3716('0xa4')]['Cc']=_0x23f8e1['cc'];}if(_0x23f8e1['bcc']){_0x22c511[_0x3716('0xa4')][_0x3716('0xa5')]=_0x23f8e1['bcc'];}return new BPromise(function(_0x47ffe7,_0xb76d1e){if(_0x23f8e1[_0x3716('0xa3')]){for(var _0x265151=0x0;_0x265151<_0x23f8e1[_0x3716('0xa3')][_0x3716('0x74')];_0x265151++){var _0x154e3c=_0x23f8e1[_0x3716('0xa3')][_0x265151];var _0x293b0e=path[_0x3716('0x99')](_0x5d09a5,_0x154e3c[_0x3716('0x76')]);if(fs[_0x3716('0xa6')](_0x293b0e)){_0x22c511[_0x3716('0x73')][_0x3716('0xa7')]({'name':_0x154e3c['name'],'contentType':_0x154e3c[_0x3716('0x43')],'data':fs['readFileSync'](_0x293b0e)});}}}emlformat['build'](_0x22c511,function(_0x5e4251,_0x5960e7){if(_0x5e4251)return _0xb76d1e(_0x5e4251);fs[_0x3716('0xa8')](path[_0x3716('0x99')](_0x5e0707,_0x444448),_0x5960e7);return _0x47ffe7(_0x5960e7);});});}})[_0x3716('0x25')](function(_0x32d734){if(_0x32d734){return _0xfda4a8[_0x3716('0x97')](path[_0x3716('0x99')](_0x5e0707,_0x444448),_0x444448,function(_0x1f8d53){if(_0x1f8d53){console[_0x3716('0xa9')](_0x3716('0xaa'),_0x1f8d53);}else{fs[_0x3716('0xab')](path['join'](_0x5e0707,_0x444448));}});}})['catch'](handleError(_0xfda4a8,null));};
\ No newline at end of file
+var _0x63be=['MailInteraction','MailInteractionId','read1stAt','interaction','null','AcceptMessage','acceptMessage','manual','SIP/%s','channel','event','EventManager','acceptmessage','agent','[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','RejectMessage','interface','reject','download','unix','toString','join','server','tmp','files','message-%s.eml','from','bcc','createdAt','Attachment','Attachments','subject','headers','Bcc','existsSync','readFileSync','build','writeFileSync','log','unlinkSync','rimraf','zip-dir','request-promise','moment','bluebird','util','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./mailMessage.socket','register','jayson/promise','client','http','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','info','request\x20sent','debug','stringify','error','code','MailMessage,\x20%s,\x20%s','message','sendStatus','end','status','count','offset','limit','set','Content-Range','json','apply','save','update','destroy','then','stack','name','send','index','map','MailMessage','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','rows','catch','show','params','includeAll','find','body','describe','create','out','secret','split','MailAccount','findOne','CmContact','Contacts','updatedAt','DESC','MailServerOut','Smtp','isNil','service','host','port','secure','authentication','auth','user','pass','attachments','root','server/files/attachments','basename','List','List\x20not\x20found','SendMail','sendMail','messageId','format','mail-interactions','accept','mail','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','Contact','get'];(function(_0x493cea,_0x144c6a){var _0x1c32ba=function(_0x47c0f9){while(--_0x47c0f9){_0x493cea['push'](_0x493cea['shift']());}};_0x1c32ba(++_0x144c6a);}(_0x63be,0xd7));var _0xe63b=function(_0x1117aa,_0x5e6cd6){_0x1117aa=_0x1117aa-0x0;var _0x23756d=_0x63be[_0x1117aa];return _0x23756d;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0xe63b('0x0'));var zipdir=require(_0xe63b('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe63b('0x2'));var moment=require(_0xe63b('0x3'));var BPromise=require(_0xe63b('0x4'));var Mustache=require('mustache');var util=require(_0xe63b('0x5'));var path=require('path');var sox=require(_0xe63b('0x6'));var csv=require(_0xe63b('0x7'));var ejs=require(_0xe63b('0x8'));var fs=require('fs');var _=require('lodash');var squel=require(_0xe63b('0x9'));var crypto=require(_0xe63b('0xa'));var jsforce=require(_0xe63b('0xb'));var deskjs=require(_0xe63b('0xc'));var toCsv=require(_0xe63b('0x7'));var querystring=require(_0xe63b('0xd'));var Papa=require(_0xe63b('0xe'));var Redis=require('ioredis');var authService=require(_0xe63b('0xf'));var qs=require(_0xe63b('0x10'));var as=require(_0xe63b('0x11'));var hardwareService=require(_0xe63b('0x12'));var logger=require(_0xe63b('0x13'))(_0xe63b('0x14'));var utils=require('../../config/utils');var config=require(_0xe63b('0x15'));var db=require(_0xe63b('0x16'))['db'];config[_0xe63b('0x17')]=_[_0xe63b('0x18')](config[_0xe63b('0x17')],{'host':_0xe63b('0x19'),'port':0x18eb});var socket=require(_0xe63b('0x1a'))(new Redis(config[_0xe63b('0x17')]));require(_0xe63b('0x1b'))[_0xe63b('0x1c')](socket);var jayson=require(_0xe63b('0x1d'));var client=jayson[_0xe63b('0x1e')][_0xe63b('0x1f')]({'port':0x232c});var client9003=jayson['client'][_0xe63b('0x1f')]({'port':0x232b});var client9002=jayson[_0xe63b('0x1e')][_0xe63b('0x1f')]({'port':0x232a});function checkPasswordPattern(_0x5a2877,_0xe01c07,_0xae0878){if(_0xae0878){var _0x2aa838=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x2aa838[_0xe63b('0x20')](_0xe01c07)){return _0x5a2877;}else{throw new db[(_0xe63b('0x21'))][(_0xe63b('0x22'))](_0xe63b('0x23'));}}else{return _0x5a2877;}}function respondWithRpcPromise(_0x351346,_0x32040e,_0x128d5e,_0x4975e8){return new BPromise(function(_0x14199a,_0x28cb57){var _0x3c2d5e=_0x4975e8||client;return _0x3c2d5e[_0xe63b('0x24')](_0x351346,_0x128d5e)['then'](function(_0x7a5d18){logger[_0xe63b('0x25')]('MailMessage,\x20%s,\x20%s',_0x32040e,_0xe63b('0x26'));logger[_0xe63b('0x27')]('MailMessage,\x20%s,\x20%s,\x20%s',_0x32040e,'request\x20sent',JSON[_0xe63b('0x28')](_0x7a5d18));if(_0x7a5d18['error']){if(_0x7a5d18[_0xe63b('0x29')][_0xe63b('0x2a')]===0x1f4){logger['error'](_0xe63b('0x2b'),_0x32040e,_0x7a5d18['error']['message']);return _0x28cb57(_0x7a5d18[_0xe63b('0x29')][_0xe63b('0x2c')]);}logger[_0xe63b('0x29')]('MailMessage,\x20%s,\x20%s',_0x32040e,_0x7a5d18[_0xe63b('0x29')][_0xe63b('0x2c')]);return _0x14199a(_0x7a5d18[_0xe63b('0x29')][_0xe63b('0x2c')]);}else{logger['info'](_0xe63b('0x2b'),_0x32040e,_0xe63b('0x26'));_0x14199a(_0x7a5d18['result'][_0xe63b('0x2c')]);}})['catch'](function(_0x4cf98e){logger[_0xe63b('0x29')](_0xe63b('0x2b'),_0x32040e,_0x4cf98e);_0x28cb57(_0x4cf98e);});});}function respondWithStatusCode(_0x3c0bff,_0x57ee22){_0x57ee22=_0x57ee22||0xcc;return function(_0xc9580c){if(_0xc9580c){return _0x3c0bff[_0xe63b('0x2d')](_0x57ee22);}return _0x3c0bff['status'](_0x57ee22)[_0xe63b('0x2e')]();};}function respondWithResult(_0xe98256,_0x5872d2){_0x5872d2=_0x5872d2||0xc8;return function(_0x4e665b){if(_0x4e665b){return _0xe98256[_0xe63b('0x2f')](_0x5872d2)['json'](_0x4e665b);}};}function respondWithFilteredResult(_0x7d4e1,_0x19b7f4){return function(_0x14f349){if(_0x14f349){var _0xf63894=_0x14f349[_0xe63b('0x30')],_0xcc9138=_0x19b7f4[_0xe63b('0x31')],_0x2a6fe3=_0x19b7f4['offset']+_0x19b7f4[_0xe63b('0x32')],_0x5220d6;if(_0x2a6fe3>=_0xf63894){_0x2a6fe3=_0xf63894;_0x5220d6=0xc8;}else{_0x5220d6=0xce;}_0x7d4e1['status'](_0x5220d6);return _0x7d4e1[_0xe63b('0x33')](_0xe63b('0x34'),_0xcc9138+'-'+_0x2a6fe3+'/'+_0xf63894)[_0xe63b('0x35')](_0x14f349);}return null;};}function patchUpdates(_0x463618){return function(_0x4369b5){try{jsonpatch[_0xe63b('0x36')](_0x4369b5,_0x463618,!![]);}catch(_0x33d320){return BPromise['reject'](_0x33d320);}return _0x4369b5[_0xe63b('0x37')]();};}function saveUpdates(_0x4cedd2,_0x2c6763){return function(_0x31a32b){if(_0x31a32b){return _0x31a32b[_0xe63b('0x38')](_0x4cedd2)['then'](function(_0x246aaa){return _0x246aaa;});}return null;};}function removeEntity(_0x3dcc88,_0x4a6ad5){return function(_0x4e2173){if(_0x4e2173){return _0x4e2173[_0xe63b('0x39')]()[_0xe63b('0x3a')](function(){_0x3dcc88[_0xe63b('0x2f')](0xcc)[_0xe63b('0x2e')]();});}};}function handleEntityNotFound(_0x16fac3,_0x27b9c1){return function(_0x2fa56f){if(!_0x2fa56f){_0x16fac3[_0xe63b('0x2d')](0x194);}return _0x2fa56f;};}function handleError(_0x11bd06,_0x36f24e){_0x36f24e=_0x36f24e||0x1f4;return function(_0x116c9c){logger[_0xe63b('0x29')](_0x116c9c[_0xe63b('0x3b')]);if(_0x116c9c[_0xe63b('0x3c')]){delete _0x116c9c[_0xe63b('0x3c')];}_0x11bd06[_0xe63b('0x2f')](_0x36f24e)[_0xe63b('0x3d')](_0x116c9c);};}exports[_0xe63b('0x3e')]=function(_0x44d46d,_0x4db96b){var _0x53961d={},_0x2887a4={},_0x3ebdda={'count':0x0,'rows':[]};var _0x1a49f9=_[_0xe63b('0x3f')](db[_0xe63b('0x40')][_0xe63b('0x41')],function(_0x153f65){return{'name':_0x153f65[_0xe63b('0x42')],'type':_0x153f65[_0xe63b('0x43')][_0xe63b('0x44')]};});_0x2887a4[_0xe63b('0x45')]=_[_0xe63b('0x3f')](_0x1a49f9,_0xe63b('0x3c'));_0x2887a4[_0xe63b('0x46')]=_['keys'](_0x44d46d[_0xe63b('0x46')]);_0x2887a4[_0xe63b('0x47')]=_[_0xe63b('0x48')](_0x2887a4[_0xe63b('0x45')],_0x2887a4['query']);_0x53961d[_0xe63b('0x49')]=_['intersection'](_0x2887a4['model'],qs['fields'](_0x44d46d[_0xe63b('0x46')][_0xe63b('0x4a')]));_0x53961d[_0xe63b('0x49')]=_0x53961d[_0xe63b('0x49')][_0xe63b('0x4b')]?_0x53961d[_0xe63b('0x49')]:_0x2887a4['model'];if(!_0x44d46d[_0xe63b('0x46')]['hasOwnProperty'](_0xe63b('0x4c'))){_0x53961d[_0xe63b('0x32')]=qs[_0xe63b('0x32')](_0x44d46d['query'][_0xe63b('0x32')]);_0x53961d[_0xe63b('0x31')]=qs[_0xe63b('0x31')](_0x44d46d[_0xe63b('0x46')]['offset']);}_0x53961d['order']=qs[_0xe63b('0x4d')](_0x44d46d[_0xe63b('0x46')]['sort']);_0x53961d[_0xe63b('0x4e')]=qs[_0xe63b('0x47')](_[_0xe63b('0x4f')](_0x44d46d[_0xe63b('0x46')],_0x2887a4[_0xe63b('0x47')]),_0x1a49f9);if(_0x44d46d['query'][_0xe63b('0x50')]){_0x53961d[_0xe63b('0x4e')]=_[_0xe63b('0x51')](_0x53961d[_0xe63b('0x4e')],{'$or':_['map'](_0x1a49f9,function(_0x122eb1){if(_0x122eb1[_0xe63b('0x43')]!==_0xe63b('0x52')){var _0x209edd={};_0x209edd[_0x122eb1[_0xe63b('0x3c')]]={'$like':'%'+_0x44d46d[_0xe63b('0x46')][_0xe63b('0x50')]+'%'};return _0x209edd;}})});}_0x53961d=_[_0xe63b('0x51')]({},_0x53961d,_0x44d46d[_0xe63b('0x53')]);var _0x4c3493={'where':_0x53961d[_0xe63b('0x4e')]};return db[_0xe63b('0x40')][_0xe63b('0x30')](_0x4c3493)['then'](function(_0x16c9ba){_0x3ebdda[_0xe63b('0x30')]=_0x16c9ba;if(_0x44d46d['query']['includeAll']){_0x53961d[_0xe63b('0x54')]=[{'all':!![]}];}return db[_0xe63b('0x40')][_0xe63b('0x55')](_0x53961d);})[_0xe63b('0x3a')](function(_0xe1fc9f){_0x3ebdda[_0xe63b('0x56')]=_0xe1fc9f;return _0x3ebdda;})[_0xe63b('0x3a')](respondWithFilteredResult(_0x4db96b,_0x53961d))[_0xe63b('0x57')](handleError(_0x4db96b,null));};exports[_0xe63b('0x58')]=function(_0x1c82b3,_0x18a70c){var _0xcb042f={'raw':!![],'where':{'id':_0x1c82b3[_0xe63b('0x59')]['id']}},_0x15382a={};_0x15382a[_0xe63b('0x45')]=_['keys'](db[_0xe63b('0x40')][_0xe63b('0x41')]);_0x15382a[_0xe63b('0x46')]=_['keys'](_0x1c82b3[_0xe63b('0x46')]);_0x15382a[_0xe63b('0x47')]=_['intersection'](_0x15382a[_0xe63b('0x45')],_0x15382a[_0xe63b('0x46')]);_0xcb042f[_0xe63b('0x49')]=_[_0xe63b('0x48')](_0x15382a['model'],qs[_0xe63b('0x4a')](_0x1c82b3[_0xe63b('0x46')][_0xe63b('0x4a')]));_0xcb042f['attributes']=_0xcb042f['attributes'][_0xe63b('0x4b')]?_0xcb042f[_0xe63b('0x49')]:_0x15382a[_0xe63b('0x45')];if(_0x1c82b3['query'][_0xe63b('0x5a')]){_0xcb042f['include']=[{'all':!![]}];}_0xcb042f=_['merge']({},_0xcb042f,_0x1c82b3['options']);return db[_0xe63b('0x40')]['find'](_0xcb042f)[_0xe63b('0x3a')](handleEntityNotFound(_0x18a70c,null))[_0xe63b('0x3a')](respondWithResult(_0x18a70c,null))[_0xe63b('0x57')](handleError(_0x18a70c,null));};exports[_0xe63b('0x38')]=function(_0x1abc9f,_0x15a510){if(_0x1abc9f['body']['id']){delete _0x1abc9f['body']['id'];}return db[_0xe63b('0x40')][_0xe63b('0x5b')]({'where':{'id':_0x1abc9f[_0xe63b('0x59')]['id']}})[_0xe63b('0x3a')](handleEntityNotFound(_0x15a510,null))[_0xe63b('0x3a')](saveUpdates(_0x1abc9f[_0xe63b('0x5c')],null))['then'](respondWithResult(_0x15a510,null))[_0xe63b('0x57')](handleError(_0x15a510,null));};exports['destroy']=function(_0x56baf3,_0x2e7cb4){return db[_0xe63b('0x40')][_0xe63b('0x5b')]({'where':{'id':_0x56baf3[_0xe63b('0x59')]['id']}})[_0xe63b('0x3a')](handleEntityNotFound(_0x2e7cb4,null))[_0xe63b('0x3a')](removeEntity(_0x2e7cb4,null))[_0xe63b('0x57')](handleError(_0x2e7cb4,null));};exports[_0xe63b('0x5d')]=function(_0x2f031e,_0xa8b64a){return db[_0xe63b('0x40')][_0xe63b('0x5d')]()[_0xe63b('0x3a')](respondWithResult(_0xa8b64a,null))[_0xe63b('0x57')](handleError(_0xa8b64a,null));};exports['create']=function(_0x27e240,_0x2be82f){return db[_0xe63b('0x40')][_0xe63b('0x5e')](_0x27e240[_0xe63b('0x5c')])['then'](function(_0x2c8440){if(_0x2c8440){if(_0x2c8440['direction']===_0xe63b('0x5f')&&!_0x2c8440[_0xe63b('0x60')]){var _0x23e188,_0x44b4bf,_0x31215f;if(_0x27e240['body']['to']){_0x44b4bf=_0x27e240[_0xe63b('0x5c')]['to'][_0xe63b('0x61')](',')[0x0];}return db[_0xe63b('0x62')][_0xe63b('0x63')]({'where':{'id':_0x2c8440['MailAccountId']},'include':[{'model':db['CmList'],'as':'List','include':[{'model':db[_0xe63b('0x64')],'as':_0xe63b('0x65'),'where':{'email':_0x44b4bf},'limit':0x1,'order':[[_0xe63b('0x66'),_0xe63b('0x67')]]}]},{'model':db[_0xe63b('0x68')],'as':_0xe63b('0x69'),'raw':!![]}]})['then'](function(_0x8231c6){_0x23e188=_0x8231c6;if(_0x23e188&&_0x23e188[_0xe63b('0x69')]){var _0x18d5f5={'tls':{'rejectUnauthorized':![]}};if(_[_0xe63b('0x6a')](_0x23e188[_0xe63b('0x69')][_0xe63b('0x6b')])){_0x18d5f5[_0xe63b('0x6c')]=_0x23e188[_0xe63b('0x69')]['host'];_0x18d5f5[_0xe63b('0x6d')]=_0x23e188[_0xe63b('0x69')]['port'];_0x18d5f5[_0xe63b('0x6e')]=_0x23e188['Smtp'][_0xe63b('0x6e')];if(_0x23e188[_0xe63b('0x69')][_0xe63b('0x6f')]){_0x18d5f5[_0xe63b('0x70')]={'user':_0x23e188[_0xe63b('0x69')][_0xe63b('0x71')],'pass':_0x23e188[_0xe63b('0x69')][_0xe63b('0x72')]};}}else{_0x18d5f5[_0xe63b('0x6b')]=_0x23e188['Smtp'][_0xe63b('0x6b')];_0x18d5f5['auth']={'user':_0x23e188[_0xe63b('0x69')][_0xe63b('0x71')],'pass':_0x23e188[_0xe63b('0x69')][_0xe63b('0x72')]};_0x18d5f5[_0xe63b('0x6e')]=_0x23e188[_0xe63b('0x69')][_0xe63b('0x6e')];}if(_0x27e240['body'][_0xe63b('0x73')]&&_0x27e240[_0xe63b('0x5c')][_0xe63b('0x73')][_0xe63b('0x4b')]){for(var _0x31c0da=0x0;_0x31c0da<_0x27e240[_0xe63b('0x5c')][_0xe63b('0x73')][_0xe63b('0x4b')];_0x31c0da+=0x1){_0x27e240[_0xe63b('0x5c')][_0xe63b('0x73')][_0x31c0da]={'filename':_0x27e240[_0xe63b('0x5c')][_0xe63b('0x73')][_0x31c0da][_0xe63b('0x3c')],'path':path['join'](config[_0xe63b('0x74')],_0xe63b('0x75'),_0x27e240[_0xe63b('0x5c')][_0xe63b('0x73')][_0x31c0da][_0xe63b('0x76')])};}}_0x31215f={'account':_0x18d5f5,'message':_0x27e240['body']};return;}})[_0xe63b('0x3a')](function(){if(_0x23e188['List']){if(_0x23e188[_0xe63b('0x77')][_0xe63b('0x65')][_0xe63b('0x4b')]){return _0x23e188['List'][_0xe63b('0x65')][0x0];}else{return db['CmContact'][_0xe63b('0x5e')](_[_0xe63b('0x18')](_0x27e240[_0xe63b('0x5c')],{'firstName':_0x27e240[_0xe63b('0x5c')]['to'],'email':_0x27e240[_0xe63b('0x5c')]['to'],'phone':_0x27e240[_0xe63b('0x5c')]['to'],'ListId':_0x23e188['ListId']}));}}else{throw new Error(_0xe63b('0x78'));}})[_0xe63b('0x3a')](function(){if(_0x31215f){return respondWithRpcPromise(_0xe63b('0x79'),_0xe63b('0x7a'),_0x31215f,client9003)[_0xe63b('0x3a')](function(_0x5a5c9f){return _0x2c8440[_0xe63b('0x38')]({'read':!![],'messageId':_0x5a5c9f[_0xe63b('0x7b')],'sentAt':moment()[_0xe63b('0x7c')]('YYYY-MM-DD\x20HH:mm:ss')});})['catch'](function(_0x3be465){logger[_0xe63b('0x29')]('%s',JSON[_0xe63b('0x28')](_0x3be465));return _0x2c8440;});}return _0x2c8440;});}return _0x2c8440;}})[_0xe63b('0x3a')](respondWithResult(_0x2be82f,0xc9))['catch'](handleError(_0x2be82f,null));};var interaction_log=require(_0xe63b('0x13'))(_0xe63b('0x7d'));exports[_0xe63b('0x7e')]=function(_0xba25ec,_0x15bb43,_0x3e97c8){var _0x4a1d40={'channel':_0xe63b('0x7f')};if(_0xba25ec[_0xe63b('0x5c')]['id']){delete _0xba25ec[_0xe63b('0x5c')]['id'];}_0xba25ec['body']['read']=!![];_0xba25ec[_0xe63b('0x5c')][_0xe63b('0x80')]=moment()['format'](_0xe63b('0x81'));_0xba25ec[_0xe63b('0x5c')][_0xe63b('0x82')]=_0xba25ec[_0xe63b('0x5c')]['UserId']||_0xba25ec[_0xe63b('0x71')]['id'];return db[_0xe63b('0x40')][_0xe63b('0x5b')]({'where':{'id':_0xba25ec[_0xe63b('0x59')]['id'],'UserId':null},'include':[{'model':db[_0xe63b('0x64')],'as':_0xe63b('0x83')}]})[_0xe63b('0x3a')](handleEntityNotFound(_0x15bb43,null))['then'](saveUpdates(_0xba25ec['body'],null))[_0xe63b('0x3a')](function(_0x37d1de){if(_0x37d1de){_0x4a1d40['message']=_0x37d1de[_0xe63b('0x84')]({'plain':!![]});return db[_0xe63b('0x85')][_0xe63b('0x5b')]({'where':{'id':_0x37d1de[_0xe63b('0x86')]}});}return null;})['then'](handleEntityNotFound(_0x15bb43,null))[_0xe63b('0x3a')](function(_0x546945){if(_0x546945){return _0x546945['update']({'UserId':_0xba25ec['body'][_0xe63b('0x82')],'read1stAt':_[_0xe63b('0x6a')](_0x546945[_0xe63b('0x87')])?moment()['format']('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0xe63b('0x3a')](function(_0x4cded5){if(_0x4cded5){_0x4a1d40[_0xe63b('0x88')]=_0x4cded5[_0xe63b('0x84')]({'plain':!![]});interaction_log[_0xe63b('0x25')]('[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0xba25ec[_0xe63b('0x71')]['id'],_0xba25ec['user'][_0xe63b('0x3c')],_0xba25ec[_0xe63b('0x71')]['role'],_0x4a1d40[_0xe63b('0x88')]['id'],_0xba25ec[_0xe63b('0x5c')]?JSON[_0xe63b('0x28')](_0xba25ec[_0xe63b('0x5c')]):_0xe63b('0x89'));return respondWithRpcPromise(_0xe63b('0x8a'),_0xe63b('0x8b'),_0x4a1d40);}return null;})[_0xe63b('0x3a')](function(_0x3d8c88){if(_0x3d8c88){if(_0xba25ec[_0xe63b('0x5c')][_0xe63b('0x8c')]){_0x4a1d40[_0xe63b('0x2c')]['interface']=util['format'](_0xe63b('0x8d'),_0xba25ec[_0xe63b('0x71')][_0xe63b('0x3c')]);_0x4a1d40['message'][_0xe63b('0x8e')]=_0x4a1d40[_0xe63b('0x8e')];_0x4a1d40[_0xe63b('0x2c')][_0xe63b('0x8f')]=_0xe63b('0x7e');return respondWithRpcPromise(_0xe63b('0x90'),_0xe63b('0x90'),{'event':_0xe63b('0x91'),'message':_0x4a1d40[_0xe63b('0x2c')]},client9002)[_0xe63b('0x3a')](function(){return _0x4a1d40;});}return _0x4a1d40;}return null;})['then'](respondWithResult(_0x15bb43,null))[_0xe63b('0x57')](handleError(_0x15bb43,null));};var interaction_log=require('../../config/logger')(_0xe63b('0x7d'));exports['reject']=function(_0x4ee231,_0x59acb8,_0x83e79a){var _0x4f9734={'agent':{},'channel':_0xe63b('0x7f')};if(_0x4ee231[_0xe63b('0x5c')]['id']){delete _0x4ee231['body']['id'];}_0x4ee231[_0xe63b('0x5c')][_0xe63b('0x82')]=_0x4ee231['body']['UserId']||_0x4ee231[_0xe63b('0x71')]['id'];_0x4f9734[_0xe63b('0x92')]['id']=_0x4ee231['body'][_0xe63b('0x82')];return db['MailMessage'][_0xe63b('0x5b')]({'where':{'id':_0x4ee231[_0xe63b('0x59')]['id'],'UserId':null}})[_0xe63b('0x3a')](handleEntityNotFound(_0x59acb8,null))[_0xe63b('0x3a')](function(_0x33b737){if(_0x33b737){_0x4f9734[_0xe63b('0x2c')]=_0x33b737[_0xe63b('0x84')]({'plain':!![]});return db[_0xe63b('0x85')][_0xe63b('0x5b')]({'where':{'id':_0x33b737[_0xe63b('0x86')]}});}return null;})[_0xe63b('0x3a')](handleEntityNotFound(_0x59acb8,null))[_0xe63b('0x3a')](function(_0x1e7d07){if(_0x1e7d07){_0x4f9734[_0xe63b('0x88')]=_0x1e7d07[_0xe63b('0x84')]({'plain':!![]});interaction_log[_0xe63b('0x25')](_0xe63b('0x93'),_0x4ee231[_0xe63b('0x71')]['id'],_0x4ee231[_0xe63b('0x71')][_0xe63b('0x3c')],_0x4ee231['user'][_0xe63b('0x94')],_0x4f9734['interaction']['id'],_0x4ee231[_0xe63b('0x5c')]?JSON[_0xe63b('0x28')](_0x4ee231[_0xe63b('0x5c')]):_0xe63b('0x89'));return respondWithRpcPromise(_0xe63b('0x95'),'rejectMessage',_0x4f9734);}return null;})[_0xe63b('0x3a')](function(_0x3c19b8){if(_0x3c19b8){_0x3c19b8[_0xe63b('0x2c')][_0xe63b('0x96')]=util['format'](_0xe63b('0x8d'),_0x4ee231[_0xe63b('0x71')][_0xe63b('0x3c')]);_0x3c19b8[_0xe63b('0x2c')]['channel']=_0x4f9734['channel'];_0x3c19b8['message'][_0xe63b('0x8f')]=_0xe63b('0x97');respondWithRpcPromise('EventManager',_0xe63b('0x90'),{'event':'rejectmessage','message':_0x3c19b8[_0xe63b('0x2c')]},client9002);return _0x4f9734;}return null;})[_0xe63b('0x3a')](respondWithResult(_0x59acb8,null))[_0xe63b('0x57')](handleError(_0x59acb8,null));};exports[_0xe63b('0x98')]=function(_0x256327,_0x3f5f35){var _0x1b3347=moment()[_0xe63b('0x99')]()[_0xe63b('0x9a')]();var _0x5b2cfe=path[_0xe63b('0x9b')](config[_0xe63b('0x74')],_0xe63b('0x9c'),'files',_0xe63b('0x9d'));var _0x28b91c=path[_0xe63b('0x9b')](config[_0xe63b('0x74')],_0xe63b('0x9c'),_0xe63b('0x9e'),_0xe63b('0x73'));var _0x24bfb7=util[_0xe63b('0x7c')](_0xe63b('0x9f'),_0x1b3347);return db[_0xe63b('0x40')][_0xe63b('0x5b')]({'where':{'id':_0x256327[_0xe63b('0x59')]['id']},'attributes':['id',_0xe63b('0x5c'),_0xe63b('0xa0'),'to','cc',_0xe63b('0xa1'),'subject',_0xe63b('0xa2')],'include':_0x256327['query']['attachments']?[{'model':db[_0xe63b('0xa3')],'as':_0xe63b('0xa4')}]:undefined})[_0xe63b('0x3a')](handleEntityNotFound(_0x3f5f35,null))[_0xe63b('0x3a')](function(_0x17089f){if(_0x17089f){var _0x490f7d=_0x17089f;var _0x1b83e4={'from':_0x490f7d['from'],'to':_0x490f7d['to'],'subject':_0x490f7d[_0xe63b('0xa5')],'html':_0x490f7d[_0xe63b('0x5c')],'headers':{'Date':moment(_0x490f7d[_0xe63b('0xa2')])[_0xe63b('0x7c')]('ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ')},'attachments':[]};if(_0x17089f['cc']){_0x1b83e4['headers']['Cc']=_0x17089f['cc'];}if(_0x17089f[_0xe63b('0xa1')]){_0x1b83e4[_0xe63b('0xa6')][_0xe63b('0xa7')]=_0x17089f[_0xe63b('0xa1')];}return new BPromise(function(_0x1958f7,_0x5bd9dd){if(_0x17089f[_0xe63b('0xa4')]){for(var _0x43badd=0x0;_0x43badd<_0x17089f[_0xe63b('0xa4')][_0xe63b('0x4b')];_0x43badd++){var _0x57c24a=_0x17089f['Attachments'][_0x43badd];var _0x1008af=path[_0xe63b('0x9b')](_0x28b91c,_0x57c24a[_0xe63b('0x76')]);if(fs[_0xe63b('0xa8')](_0x1008af)){_0x1b83e4[_0xe63b('0x73')]['push']({'name':_0x57c24a[_0xe63b('0x3c')],'contentType':_0x57c24a[_0xe63b('0x43')],'data':fs[_0xe63b('0xa9')](_0x1008af)});}}}emlformat[_0xe63b('0xaa')](_0x1b83e4,function(_0x349662,_0x283e77){if(_0x349662)return _0x5bd9dd(_0x349662);fs[_0xe63b('0xab')](path[_0xe63b('0x9b')](_0x5b2cfe,_0x24bfb7),_0x283e77);return _0x1958f7(_0x283e77);});});}})['then'](function(_0x56bfa8){if(_0x56bfa8){return _0x3f5f35[_0xe63b('0x98')](path['join'](_0x5b2cfe,_0x24bfb7),_0x24bfb7,function(_0x574f4a){if(_0x574f4a){console[_0xe63b('0xac')]('err',_0x574f4a);}else{fs[_0xe63b('0xad')](path[_0xe63b('0x9b')](_0x5b2cfe,_0x24bfb7));}});}})[_0xe63b('0x57')](handleError(_0x3f5f35,null));};
\ No newline at end of file
diff --git a/server/api/mailMessage/mailMessage.events.js b/server/api/mailMessage/mailMessage.events.js
index 7769a8a..967d5fd 100644
--- a/server/api/mailMessage/mailMessage.events.js
+++ b/server/api/mailMessage/mailMessage.events.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x1ed7=['remove','hasOwnProperty','MailMessage','setMaxListeners','save'];(function(_0x13e724,_0x296739){var _0x334a44=function(_0x28f54e){while(--_0x28f54e){_0x13e724['push'](_0x13e724['shift']());}};_0x334a44(++_0x296739);}(_0x1ed7,0xb1));var _0x71ed=function(_0x144334,_0x28f756){_0x144334=_0x144334-0x0;var _0x407ac1=_0x1ed7[_0x144334];return _0x407ac1;};'use strict';var EventEmitter=require('events');var MailMessage=require('../../mysqldb')['db'][_0x71ed('0x0')];var MailMessageEvents=new EventEmitter();MailMessageEvents[_0x71ed('0x1')](0x0);var events={'afterCreate':_0x71ed('0x2'),'afterUpdate':'update','afterDestroy':_0x71ed('0x3')};function emitEvent(_0x139793){return function(_0x5a8ff8,_0x58d8e2,_0x413650){MailMessageEvents['emit'](_0x139793+':'+_0x5a8ff8['id'],_0x5a8ff8);MailMessageEvents['emit'](_0x139793,_0x5a8ff8);_0x413650(null);};}for(var e in events){if(events[_0x71ed('0x4')](e)){var event=events[e];MailMessage['hook'](e,emitEvent(event));}}module['exports']=MailMessageEvents;
\ No newline at end of file
+var _0x8f91=['../../mysqldb','MailMessage','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','events'];(function(_0x2c5f49,_0x225b12){var _0x3b68ea=function(_0x15bb7f){while(--_0x15bb7f){_0x2c5f49['push'](_0x2c5f49['shift']());}};_0x3b68ea(++_0x225b12);}(_0x8f91,0x1c1));var _0x18f9=function(_0x17f944,_0x1a9f95){_0x17f944=_0x17f944-0x0;var _0x197393=_0x8f91[_0x17f944];return _0x197393;};'use strict';var EventEmitter=require(_0x18f9('0x0'));var MailMessage=require(_0x18f9('0x1'))['db'][_0x18f9('0x2')];var MailMessageEvents=new EventEmitter();MailMessageEvents[_0x18f9('0x3')](0x0);var events={'afterCreate':_0x18f9('0x4'),'afterUpdate':_0x18f9('0x5'),'afterDestroy':_0x18f9('0x6')};function emitEvent(_0x1ccf7a){return function(_0x8f2f7e,_0x571946,_0x2260a3){MailMessageEvents[_0x18f9('0x7')](_0x1ccf7a+':'+_0x8f2f7e['id'],_0x8f2f7e);MailMessageEvents[_0x18f9('0x7')](_0x1ccf7a,_0x8f2f7e);_0x2260a3(null);};}for(var e in events){if(events[_0x18f9('0x8')](e)){var event=events[e];MailMessage[_0x18f9('0x9')](e,emitEvent(event));}}module['exports']=MailMessageEvents;
\ No newline at end of file
diff --git a/server/api/mailMessage/mailMessage.model.js b/server/api/mailMessage/mailMessage.model.js
index 2327534..7010ea3 100644
--- a/server/api/mailMessage/mailMessage.model.js
+++ b/server/api/mailMessage/mailMessage.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xb73a=['MailInteraction','findOne','then','update','createdAt','catch','error','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','define','mail_messages','messageId','fti_mail_messages','plainBody','subject','FULLTEXT','body','models','direction','toLowerCase','out','secret','isNil','UserId'];(function(_0x49c957,_0x9fe6ef){var _0x3870f7=function(_0x391c6d){while(--_0x391c6d){_0x49c957['push'](_0x49c957['shift']());}};_0x3870f7(++_0x9fe6ef);}(_0xb73a,0x8d));var _0xab73=function(_0x71a175,_0x35e09c){_0x71a175=_0x71a175-0x0;var _0x974718=_0xb73a[_0x71a175];return _0x974718;};'use strict';var _=require('lodash');var util=require(_0xab73('0x0'));var logger=require(_0xab73('0x1'))(_0xab73('0x2'));var moment=require(_0xab73('0x3'));var BPromise=require(_0xab73('0x4'));var rp=require(_0xab73('0x5'));var htmlToText=require('html-to-text');var fs=require('fs');var path=require(_0xab73('0x6'));var rimraf=require(_0xab73('0x7'));var config=require(_0xab73('0x8'));var attributes=require('./mailMessage.attributes');module['exports']=function(_0x38a327,_0x56dff8){return _0x38a327[_0xab73('0x9')]('MailMessage',attributes,{'tableName':_0xab73('0xa'),'paranoid':![],'indexes':[{'name':_0xab73('0xb'),'fields':[_0xab73('0xb')]},{'name':_0xab73('0xc'),'fields':[_0xab73('0xd'),_0xab73('0xe')],'type':_0xab73('0xf')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x5df3e6,_0x1cdcd6,_0x525451){if(_0x5df3e6['body']){_0x5df3e6['plainBody']=htmlToText['fromString'](_0x5df3e6[_0xab73('0x10')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x525451(null,_0x1cdcd6);},'afterCreate':function(_0x3f9dae,_0x30230d,_0xbb11d1){var _0x4bc705=_0x38a327[_0xab73('0x11')];var _0x35c57d=_0x3f9dae['get']({'plain':!![]});if(_0x35c57d[_0xab73('0x12')][_0xab73('0x13')]()==='in'||_0x35c57d[_0xab73('0x12')][_0xab73('0x13')]()===_0xab73('0x14')&&!_0x35c57d[_0xab73('0x15')]&&!_[_0xab73('0x16')](_0x35c57d[_0xab73('0x17')])){_0x4bc705[_0xab73('0x18')][_0xab73('0x19')]({'where':{'id':_0x35c57d['MailInteractionId']}})[_0xab73('0x1a')](function(_0x4d9a7c){if(_0x4d9a7c){_0x4d9a7c[_0xab73('0x1b')]({'lastMsgAt':_0x35c57d[_0xab73('0x1c')],'lastMsgDirection':_0x35c57d[_0xab73('0x12')]['toLowerCase'](),'lastMsgBody':_0x35c57d['body']});}})[_0xab73('0x1d')](function(_0x2fd624){console[_0xab73('0x1e')](_0x2fd624);});}_0xbb11d1();}},'charset':_0xab73('0x1f'),'collate':_0xab73('0x20')});};
\ No newline at end of file
+var _0xd5b7=['../../config/environment','./mailMessage.attributes','exports','define','MailMessage','messageId','fti_mail_messages','plainBody','subject','body','fromString','models','get','direction','out','isNil','MailInteractionId','then','update','createdAt','toLowerCase','catch','error','utf8mb4_unicode_ci','util','../../config/logger','api','bluebird','request-promise','html-to-text','rimraf'];(function(_0x2969c9,_0x4f7e22){var _0x2a3272=function(_0x3e292e){while(--_0x3e292e){_0x2969c9['push'](_0x2969c9['shift']());}};_0x2a3272(++_0x4f7e22);}(_0xd5b7,0x18c));var _0x7d5b=function(_0x5beda8,_0x1e8554){_0x5beda8=_0x5beda8-0x0;var _0x2aa042=_0xd5b7[_0x5beda8];return _0x2aa042;};'use strict';var _=require('lodash');var util=require(_0x7d5b('0x0'));var logger=require(_0x7d5b('0x1'))(_0x7d5b('0x2'));var moment=require('moment');var BPromise=require(_0x7d5b('0x3'));var rp=require(_0x7d5b('0x4'));var htmlToText=require(_0x7d5b('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7d5b('0x6'));var config=require(_0x7d5b('0x7'));var attributes=require(_0x7d5b('0x8'));module[_0x7d5b('0x9')]=function(_0x293046,_0xf63ae8){return _0x293046[_0x7d5b('0xa')](_0x7d5b('0xb'),attributes,{'tableName':'mail_messages','paranoid':![],'indexes':[{'name':'messageId','fields':[_0x7d5b('0xc')]},{'name':_0x7d5b('0xd'),'fields':[_0x7d5b('0xe'),_0x7d5b('0xf')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x2bb8e1,_0x4364bf,_0x33ecc6){if(_0x2bb8e1[_0x7d5b('0x10')]){_0x2bb8e1['plainBody']=htmlToText[_0x7d5b('0x11')](_0x2bb8e1['body'],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x33ecc6(null,_0x4364bf);},'afterCreate':function(_0x3b61dc,_0x8e3906,_0x1b9cd6){var _0x1b9e57=_0x293046[_0x7d5b('0x12')];var _0xed5cbe=_0x3b61dc[_0x7d5b('0x13')]({'plain':!![]});if(_0xed5cbe[_0x7d5b('0x14')]['toLowerCase']()==='in'||_0xed5cbe[_0x7d5b('0x14')]['toLowerCase']()===_0x7d5b('0x15')&&!_0xed5cbe['secret']&&!_[_0x7d5b('0x16')](_0xed5cbe['UserId'])){_0x1b9e57['MailInteraction']['findOne']({'where':{'id':_0xed5cbe[_0x7d5b('0x17')]}})[_0x7d5b('0x18')](function(_0x28c63d){if(_0x28c63d){_0x28c63d[_0x7d5b('0x19')]({'lastMsgAt':_0xed5cbe[_0x7d5b('0x1a')],'lastMsgDirection':_0xed5cbe[_0x7d5b('0x14')][_0x7d5b('0x1b')](),'lastMsgBody':_0xed5cbe[_0x7d5b('0x10')]});}})[_0x7d5b('0x1c')](function(_0x3140da){console[_0x7d5b('0x1d')](_0x3140da);});}_0x1b9cd6();}},'charset':'utf8mb4','collate':_0x7d5b('0x1e')});};
\ No newline at end of file
diff --git a/server/api/mailMessage/mailMessage.rpc.js b/server/api/mailMessage/mailMessage.rpc.js
index 7f7c933..d6d8a4a 100644
--- a/server/api/mailMessage/mailMessage.rpc.js
+++ b/server/api/mailMessage/mailMessage.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x75a2=['util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','redis','defaults','localhost','./mailMessage.socket','register','request','then','info','MailMessage,\x20%s,\x20%s','request\x20sent','debug','MailMessage,\x20%s,\x20%s,\x20%s','error','message','result','catch','CreateMailMessage','options','raw','stringify','lodash'];(function(_0x396e8c,_0x40b46f){var _0x1415c2=function(_0x4e93ee){while(--_0x4e93ee){_0x396e8c['push'](_0x396e8c['shift']());}};_0x1415c2(++_0x40b46f);}(_0x75a2,0x187));var _0x275a=function(_0x18e602,_0x368f9a){_0x18e602=_0x18e602-0x0;var _0x866210=_0x75a2[_0x18e602];return _0x866210;};'use strict';var _=require(_0x275a('0x0'));var util=require(_0x275a('0x1'));var moment=require(_0x275a('0x2'));var BPromise=require('bluebird');var rs=require(_0x275a('0x3'));var fs=require('fs');var Redis=require(_0x275a('0x4'));var db=require(_0x275a('0x5'))['db'];var utils=require(_0x275a('0x6'));var logger=require('../../config/logger')(_0x275a('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});config[_0x275a('0x8')]=_[_0x275a('0x9')](config[_0x275a('0x8')],{'host':_0x275a('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x275a('0xb'))[_0x275a('0xc')](socket);function respondWithRpcPromise(_0x56e1c2,_0x4bb07c,_0x4aaece){return new BPromise(function(_0x2d77df,_0x3961da){return client[_0x275a('0xd')](_0x56e1c2,_0x4aaece)[_0x275a('0xe')](function(_0x59b769){logger[_0x275a('0xf')](_0x275a('0x10'),_0x4bb07c,_0x275a('0x11'));logger[_0x275a('0x12')](_0x275a('0x13'),_0x4bb07c,_0x275a('0x11'),JSON['stringify'](_0x59b769));if(_0x59b769[_0x275a('0x14')]){if(_0x59b769[_0x275a('0x14')]['code']===0x1f4){logger['error'](_0x275a('0x10'),_0x4bb07c,_0x59b769[_0x275a('0x14')][_0x275a('0x15')]);return _0x3961da(_0x59b769[_0x275a('0x14')][_0x275a('0x15')]);}logger[_0x275a('0x14')](_0x275a('0x10'),_0x4bb07c,_0x59b769[_0x275a('0x14')][_0x275a('0x15')]);return _0x2d77df(_0x59b769['error']['message']);}else{logger[_0x275a('0xf')](_0x275a('0x10'),_0x4bb07c,'request\x20sent');_0x2d77df(_0x59b769[_0x275a('0x16')]['message']);}})[_0x275a('0x17')](function(_0x236619){logger['error'](_0x275a('0x10'),_0x4bb07c,_0x236619);_0x3961da(_0x236619);});});}exports[_0x275a('0x18')]=function(_0x4a0ddb){var _0x4fb1ad=this;return new Promise(function(_0x260e41,_0x456c61){return db['MailMessage']['create'](_0x4a0ddb['body'],{'raw':_0x4a0ddb[_0x275a('0x19')]?_0x4a0ddb[_0x275a('0x19')][_0x275a('0x1a')]===undefined?!![]:![]:!![]})[_0x275a('0xe')](function(_0xbb91e7){logger['info'](_0x275a('0x18'),_0x4a0ddb);logger[_0x275a('0x12')](_0x275a('0x18'),_0x4a0ddb,JSON[_0x275a('0x1b')](_0xbb91e7));_0x260e41(_0xbb91e7);})[_0x275a('0x17')](function(_0x579aca){logger[_0x275a('0x14')](_0x275a('0x18'),_0x579aca[_0x275a('0x15')],_0x4a0ddb);_0x456c61(_0x4fb1ad[_0x275a('0x14')](0x1f4,_0x579aca[_0x275a('0x15')]));});});};
\ No newline at end of file
+var _0xd0c9=['client','redis','defaults','localhost','socket.io-emitter','register','request','then','info','request\x20sent','MailMessage,\x20%s,\x20%s,\x20%s','stringify','error','MailMessage,\x20%s,\x20%s','message','result','catch','CreateMailMessage','MailMessage','create','options','raw','debug','lodash','util','ioredis','../../mysqldb','../../config/utils','rpc'];(function(_0x24408b,_0x41d8ff){var _0x5344b7=function(_0x57c9fa){while(--_0x57c9fa){_0x24408b['push'](_0x24408b['shift']());}};_0x5344b7(++_0x41d8ff);}(_0xd0c9,0xe2));var _0x9d0c=function(_0x4792c8,_0x5158a1){_0x4792c8=_0x4792c8-0x0;var _0x35edb1=_0xd0c9[_0x4792c8];return _0x35edb1;};'use strict';var _=require(_0x9d0c('0x0'));var util=require(_0x9d0c('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9d0c('0x2'));var db=require(_0x9d0c('0x3'))['db'];var utils=require(_0x9d0c('0x4'));var logger=require('../../config/logger')(_0x9d0c('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x9d0c('0x6')]['http']({'port':0x232a});config[_0x9d0c('0x7')]=_[_0x9d0c('0x8')](config[_0x9d0c('0x7')],{'host':_0x9d0c('0x9'),'port':0x18eb});var socket=require(_0x9d0c('0xa'))(new Redis(config[_0x9d0c('0x7')]));require('./mailMessage.socket')[_0x9d0c('0xb')](socket);function respondWithRpcPromise(_0x5dbbfa,_0x29d57b,_0x12ab3a){return new BPromise(function(_0x3e3a5e,_0x53f49a){return client[_0x9d0c('0xc')](_0x5dbbfa,_0x12ab3a)[_0x9d0c('0xd')](function(_0x3c5ea3){logger[_0x9d0c('0xe')]('MailMessage,\x20%s,\x20%s',_0x29d57b,_0x9d0c('0xf'));logger['debug'](_0x9d0c('0x10'),_0x29d57b,_0x9d0c('0xf'),JSON[_0x9d0c('0x11')](_0x3c5ea3));if(_0x3c5ea3[_0x9d0c('0x12')]){if(_0x3c5ea3['error']['code']===0x1f4){logger['error'](_0x9d0c('0x13'),_0x29d57b,_0x3c5ea3['error'][_0x9d0c('0x14')]);return _0x53f49a(_0x3c5ea3[_0x9d0c('0x12')][_0x9d0c('0x14')]);}logger[_0x9d0c('0x12')](_0x9d0c('0x13'),_0x29d57b,_0x3c5ea3[_0x9d0c('0x12')][_0x9d0c('0x14')]);return _0x3e3a5e(_0x3c5ea3[_0x9d0c('0x12')]['message']);}else{logger[_0x9d0c('0xe')](_0x9d0c('0x13'),_0x29d57b,'request\x20sent');_0x3e3a5e(_0x3c5ea3[_0x9d0c('0x15')][_0x9d0c('0x14')]);}})[_0x9d0c('0x16')](function(_0x4ccf40){logger['error'](_0x9d0c('0x13'),_0x29d57b,_0x4ccf40);_0x53f49a(_0x4ccf40);});});}exports[_0x9d0c('0x17')]=function(_0x5141ff){var _0x99a070=this;return new Promise(function(_0xc3aedb,_0xf60863){return db[_0x9d0c('0x18')][_0x9d0c('0x19')](_0x5141ff['body'],{'raw':_0x5141ff[_0x9d0c('0x1a')]?_0x5141ff['options'][_0x9d0c('0x1b')]===undefined?!![]:![]:!![]})[_0x9d0c('0xd')](function(_0x52049b){logger[_0x9d0c('0xe')](_0x9d0c('0x17'),_0x5141ff);logger[_0x9d0c('0x1c')]('CreateMailMessage',_0x5141ff,JSON[_0x9d0c('0x11')](_0x52049b));_0xc3aedb(_0x52049b);})[_0x9d0c('0x16')](function(_0x48a5d6){logger[_0x9d0c('0x12')](_0x9d0c('0x17'),_0x48a5d6[_0x9d0c('0x14')],_0x5141ff);_0xf60863(_0x99a070[_0x9d0c('0x12')](0x1f4,_0x48a5d6[_0x9d0c('0x14')]));});});};
\ No newline at end of file
diff --git a/server/api/mailMessage/mailMessage.socket.js b/server/api/mailMessage/mailMessage.socket.js
index 7b67a96..1f10ae3 100644
--- a/server/api/mailMessage/mailMessage.socket.js
+++ b/server/api/mailMessage/mailMessage.socket.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xbc8d=['emit','register','length','mailMessage:','./mailMessage.events','remove','update'];(function(_0x411017,_0x4a8117){var _0x2adeea=function(_0x545222){while(--_0x545222){_0x411017['push'](_0x411017['shift']());}};_0x2adeea(++_0x4a8117);}(_0xbc8d,0x15b));var _0xdbc8=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xbc8d[_0x3dd15e];return _0x231fd0;};'use strict';var MailMessageEvents=require(_0xdbc8('0x0'));var events=['save',_0xdbc8('0x1'),_0xdbc8('0x2')];function createListener(_0x47835e,_0xd1b1fd){return function(_0x547cf2){_0xd1b1fd[_0xdbc8('0x3')](_0x47835e,_0x547cf2);};}function removeListener(_0x172112,_0x2dd539){return function(){MailMessageEvents['removeListener'](_0x172112,_0x2dd539);};}exports[_0xdbc8('0x4')]=function(_0x10ede0){for(var _0x3ee39d=0x0,_0x47f72b=events[_0xdbc8('0x5')];_0x3ee39d<_0x47f72b;_0x3ee39d++){var _0x4e67e5=events[_0x3ee39d];var _0x26da2c=createListener(_0xdbc8('0x6')+_0x4e67e5,_0x10ede0);MailMessageEvents['on'](_0x4e67e5,_0x26da2c);}};
\ No newline at end of file
+var _0x5e39=['remove','removeListener','register','length','mailMessage:','./mailMessage.events','save'];(function(_0x4e6ae6,_0x49dba6){var _0x23c108=function(_0x1bc103){while(--_0x1bc103){_0x4e6ae6['push'](_0x4e6ae6['shift']());}};_0x23c108(++_0x49dba6);}(_0x5e39,0xbb));var _0x95e3=function(_0x3a7f38,_0x111741){_0x3a7f38=_0x3a7f38-0x0;var _0x8fdedf=_0x5e39[_0x3a7f38];return _0x8fdedf;};'use strict';var MailMessageEvents=require(_0x95e3('0x0'));var events=[_0x95e3('0x1'),_0x95e3('0x2'),'update'];function createListener(_0x10937c,_0x19bfb4){return function(_0xedce62){_0x19bfb4['emit'](_0x10937c,_0xedce62);};}function removeListener(_0x3e0153,_0x258f49){return function(){MailMessageEvents[_0x95e3('0x3')](_0x3e0153,_0x258f49);};}exports[_0x95e3('0x4')]=function(_0x4610ec){for(var _0x1c1231=0x0,_0x17eabd=events[_0x95e3('0x5')];_0x1c1231<_0x17eabd;_0x1c1231++){var _0x188355=events[_0x1c1231];var _0x48a7af=createListener(_0x95e3('0x6')+_0x188355,_0x4610ec);MailMessageEvents['on'](_0x188355,_0x48a7af);}};
\ No newline at end of file
diff --git a/server/api/mailQueue/index.js b/server/api/mailQueue/index.js
index fd50eea..d83a0a4 100644
--- a/server/api/mailQueue/index.js
+++ b/server/api/mailQueue/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x0a53=['exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../config/environment','./mailQueue.controller','get','isAuthenticated','index','/describe','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','create','addAgents','put','update','delete','/:id','removeAgents'];(function(_0x186d30,_0x477feb){var _0x3fc43c=function(_0x23c5ca){while(--_0x23c5ca){_0x186d30['push'](_0x186d30['shift']());}};_0x3fc43c(++_0x477feb);}(_0x0a53,0xd9));var _0x30a5=function(_0x3a4f18,_0x1af741){_0x3a4f18=_0x3a4f18-0x0;var _0x4c20fc=_0x0a53[_0x3a4f18];return _0x4c20fc;};'use strict';var multer=require(_0x30a5('0x0'));var util=require(_0x30a5('0x1'));var path=require(_0x30a5('0x2'));var timeout=require(_0x30a5('0x3'));var express=require(_0x30a5('0x4'));var router=express['Router']();var auth=require(_0x30a5('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x30a5('0x6'));var controller=require(_0x30a5('0x7'));router[_0x30a5('0x8')]('/',auth[_0x30a5('0x9')](),controller[_0x30a5('0xa')]);router['get'](_0x30a5('0xb'),auth[_0x30a5('0x9')](),controller['describe']);router[_0x30a5('0x8')]('/:id',auth[_0x30a5('0x9')](),controller['show']);router[_0x30a5('0x8')](_0x30a5('0xc'),auth['isAuthenticated'](),controller[_0x30a5('0xd')]);router[_0x30a5('0x8')](_0x30a5('0xe'),auth[_0x30a5('0x9')](),controller[_0x30a5('0xf')]);router[_0x30a5('0x8')](_0x30a5('0x10'),auth[_0x30a5('0x9')](),controller[_0x30a5('0x11')]);router[_0x30a5('0x12')]('/',auth['isAuthenticated'](),controller[_0x30a5('0x13')]);router['post']('/:id/teams',auth[_0x30a5('0x9')](),controller['addTeams']);router[_0x30a5('0x12')](_0x30a5('0x10'),auth[_0x30a5('0x9')](),controller[_0x30a5('0x14')]);router[_0x30a5('0x15')]('/:id',auth[_0x30a5('0x9')](),controller[_0x30a5('0x16')]);router[_0x30a5('0x17')](_0x30a5('0x18'),auth[_0x30a5('0x9')](),controller['destroy']);router[_0x30a5('0x17')](_0x30a5('0xe'),auth[_0x30a5('0x9')](),controller['removeTeams']);router[_0x30a5('0x17')](_0x30a5('0x10'),auth['isAuthenticated'](),controller[_0x30a5('0x19')]);module[_0x30a5('0x1a')]=router;
\ No newline at end of file
+var _0xa199=['path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','/:id','/:id/members','getMembers','getTeams','/:id/users','getAgents','post','create','/:id/teams','addTeams','addAgents','update','delete','destroy','removeTeams','removeAgents','exports','multer','util'];(function(_0x58607a,_0x8f9287){var _0x49b8d8=function(_0x570cbc){while(--_0x570cbc){_0x58607a['push'](_0x58607a['shift']());}};_0x49b8d8(++_0x8f9287);}(_0xa199,0x148));var _0x9a19=function(_0x16d54e,_0x377143){_0x16d54e=_0x16d54e-0x0;var _0x3a4606=_0xa199[_0x16d54e];return _0x3a4606;};'use strict';var multer=require(_0x9a19('0x0'));var util=require(_0x9a19('0x1'));var path=require(_0x9a19('0x2'));var timeout=require(_0x9a19('0x3'));var express=require(_0x9a19('0x4'));var router=express[_0x9a19('0x5')]();var auth=require(_0x9a19('0x6'));var interaction=require(_0x9a19('0x7'));var config=require(_0x9a19('0x8'));var controller=require('./mailQueue.controller');router[_0x9a19('0x9')]('/',auth[_0x9a19('0xa')](),controller[_0x9a19('0xb')]);router['get'](_0x9a19('0xc'),auth['isAuthenticated'](),controller['describe']);router[_0x9a19('0x9')](_0x9a19('0xd'),auth[_0x9a19('0xa')](),controller['show']);router['get'](_0x9a19('0xe'),auth['isAuthenticated'](),controller[_0x9a19('0xf')]);router['get']('/:id/teams',auth[_0x9a19('0xa')](),controller[_0x9a19('0x10')]);router[_0x9a19('0x9')](_0x9a19('0x11'),auth['isAuthenticated'](),controller[_0x9a19('0x12')]);router[_0x9a19('0x13')]('/',auth['isAuthenticated'](),controller[_0x9a19('0x14')]);router[_0x9a19('0x13')](_0x9a19('0x15'),auth[_0x9a19('0xa')](),controller[_0x9a19('0x16')]);router[_0x9a19('0x13')]('/:id/users',auth[_0x9a19('0xa')](),controller[_0x9a19('0x17')]);router['put'](_0x9a19('0xd'),auth['isAuthenticated'](),controller[_0x9a19('0x18')]);router[_0x9a19('0x19')]('/:id',auth[_0x9a19('0xa')](),controller[_0x9a19('0x1a')]);router[_0x9a19('0x19')](_0x9a19('0x15'),auth['isAuthenticated'](),controller[_0x9a19('0x1b')]);router[_0x9a19('0x19')](_0x9a19('0x11'),auth[_0x9a19('0xa')](),controller[_0x9a19('0x1c')]);module[_0x9a19('0x1d')]=router;
\ No newline at end of file
diff --git a/server/api/mailQueue/mailQueue.attributes.js b/server/api/mailQueue/mailQueue.attributes.js
index 5209634..c1467fc 100644
--- a/server/api/mailQueue/mailQueue.attributes.js
+++ b/server/api/mailQueue/mailQueue.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xbaa3=['ENUM','rrmemory','beepall','roundrobin','sequelize','exports','name','STRING','INTEGER'];(function(_0xda6c27,_0x547dcc){var _0xc2f713=function(_0x581fd6){while(--_0x581fd6){_0xda6c27['push'](_0xda6c27['shift']());}};_0xc2f713(++_0x547dcc);}(_0xbaa3,0x100));var _0x3baa=function(_0x1081a3,_0x2ac784){_0x1081a3=_0x1081a3-0x0;var _0x5696a2=_0xbaa3[_0x1081a3];return _0x5696a2;};'use strict';var Sequelize=require(_0x3baa('0x0'));module[_0x3baa('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x3baa('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x3baa('0x3')]},'timeout':{'type':Sequelize[_0x3baa('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x3baa('0x5')](_0x3baa('0x6'),_0x3baa('0x7'),_0x3baa('0x8'))}};
\ No newline at end of file
+var _0x8084=['sequelize','exports','STRING','name','INTEGER','ENUM','rrmemory','beepall','roundrobin'];(function(_0x4bdda3,_0x25f960){var _0x3f8722=function(_0x341120){while(--_0x341120){_0x4bdda3['push'](_0x4bdda3['shift']());}};_0x3f8722(++_0x25f960);}(_0x8084,0x13b));var _0x4808=function(_0x47c54b,_0x30148f){_0x47c54b=_0x47c54b-0x0;var _0xe79a89=_0x8084[_0x47c54b];return _0xe79a89;};'use strict';var Sequelize=require(_0x4808('0x0'));module[_0x4808('0x1')]={'name':{'type':Sequelize[_0x4808('0x2')],'unique':_0x4808('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x4808('0x2')]},'timeout':{'type':Sequelize[_0x4808('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x4808('0x5')](_0x4808('0x6'),_0x4808('0x7'),_0x4808('0x8'))}};
\ No newline at end of file
diff --git a/server/api/mailQueue/mailQueue.controller.js b/server/api/mailQueue/mailQueue.controller.js
index e161315..a0a1b46 100644
--- a/server/api/mailQueue/mailQueue.controller.js
+++ b/server/api/mailQueue/mailQueue.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x948d=['sendStatus','status','end','json','offset','limit','set','Content-Range','save','update','then','destroy','get','MailQueues','UserProfileResource','stack','name','send','index','map','MailQueue','rawAttributes','fieldName','type','key','keys','query','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','merge','VIRTUAL','count','includeAll','include','findAll','rows','catch','show','params','intersection','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','MailQueueId','UserMailQueue','findAndCountAll','UserId','agent','mailPause','SIP','updatedAt','getTeams','Team','addTeams','ids','User','online','voicePause','sequelize','transaction','each','findOrCreate','forEach','emit','userMailQueue:save','removeTeams','select','from','team_has_mail_queues','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','MailQueueId\x20=\x20?','Agents','clone','ut.UserId\x20=\x20?','toString','QueryTypes','SELECT','every','TeamId','includes','all','compact','value','isEmpty','userMailQueue:remove','addAgents','omit','spread','removeAgents','isArray','getAgents','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./mailQueue.socket'];(function(_0x307d86,_0x9264f2){var _0x361745=function(_0x1b64e1){while(--_0x1b64e1){_0x307d86['push'](_0x307d86['shift']());}};_0x361745(++_0x9264f2);}(_0x948d,0x102));var _0xd948=function(_0x344676,_0x5f3ece){_0x344676=_0x344676-0x0;var _0xe8510b=_0x948d[_0x344676];return _0xe8510b;};'use strict';var pdf=require(_0xd948('0x0'));var emlformat=require(_0xd948('0x1'));var rimraf=require(_0xd948('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd948('0x3'));var rp=require(_0xd948('0x4'));var moment=require('moment');var BPromise=require(_0xd948('0x5'));var Mustache=require(_0xd948('0x6'));var util=require(_0xd948('0x7'));var path=require('path');var sox=require(_0xd948('0x8'));var csv=require(_0xd948('0x9'));var ejs=require(_0xd948('0xa'));var fs=require('fs');var _=require(_0xd948('0xb'));var squel=require(_0xd948('0xc'));var crypto=require(_0xd948('0xd'));var jsforce=require(_0xd948('0xe'));var deskjs=require(_0xd948('0xf'));var toCsv=require(_0xd948('0x9'));var querystring=require(_0xd948('0x10'));var Papa=require(_0xd948('0x11'));var Redis=require(_0xd948('0x12'));var authService=require(_0xd948('0x13'));var qs=require(_0xd948('0x14'));var as=require(_0xd948('0x15'));var hardwareService=require(_0xd948('0x16'));var logger=require(_0xd948('0x17'))(_0xd948('0x18'));var utils=require(_0xd948('0x19'));var config=require('../../config/environment');var db=require(_0xd948('0x1a'))['db'];config['redis']=_[_0xd948('0x1b')](config[_0xd948('0x1c')],{'host':_0xd948('0x1d'),'port':0x18eb});var socket=require(_0xd948('0x1e'))(new Redis(config[_0xd948('0x1c')]));require(_0xd948('0x1f'))['register'](socket);function respondWithStatusCode(_0x5ee985,_0x273966){_0x273966=_0x273966||0xcc;return function(_0x13f6ec){if(_0x13f6ec){return _0x5ee985[_0xd948('0x20')](_0x273966);}return _0x5ee985[_0xd948('0x21')](_0x273966)[_0xd948('0x22')]();};}function respondWithResult(_0x214afc,_0x98f041){_0x98f041=_0x98f041||0xc8;return function(_0x5942f6){if(_0x5942f6){return _0x214afc[_0xd948('0x21')](_0x98f041)[_0xd948('0x23')](_0x5942f6);}};}function respondWithFilteredResult(_0x1c2bf4,_0x2e3e4a){return function(_0x1a8e37){if(_0x1a8e37){var _0x2c3d6e=_0x1a8e37['count'],_0xf9ee9d=_0x2e3e4a[_0xd948('0x24')],_0x9417fb=_0x2e3e4a[_0xd948('0x24')]+_0x2e3e4a[_0xd948('0x25')],_0x230846;if(_0x9417fb>=_0x2c3d6e){_0x9417fb=_0x2c3d6e;_0x230846=0xc8;}else{_0x230846=0xce;}_0x1c2bf4[_0xd948('0x21')](_0x230846);return _0x1c2bf4[_0xd948('0x26')](_0xd948('0x27'),_0xf9ee9d+'-'+_0x9417fb+'/'+_0x2c3d6e)[_0xd948('0x23')](_0x1a8e37);}return null;};}function patchUpdates(_0x248930){return function(_0x3d4b83){try{jsonpatch['apply'](_0x3d4b83,_0x248930,!![]);}catch(_0x15d7da){return BPromise['reject'](_0x15d7da);}return _0x3d4b83[_0xd948('0x28')]();};}function saveUpdates(_0x1f24aa,_0x29a0e4){return function(_0x33b90f){if(_0x33b90f){return _0x33b90f[_0xd948('0x29')](_0x1f24aa)[_0xd948('0x2a')](function(_0x2c0312){return _0x2c0312;});}return null;};}function removeEntity(_0x544c26,_0x511f3e){return function(_0x1bdbf4){if(_0x1bdbf4){return _0x1bdbf4[_0xd948('0x2b')]()[_0xd948('0x2a')](function(){var _0x1245e4=_0x1bdbf4[_0xd948('0x2c')]({'plain':!![]});var _0x53baab=_0xd948('0x2d');return db[_0xd948('0x2e')][_0xd948('0x2b')]({'where':{'type':_0x53baab,'resourceId':_0x1245e4['id']}})[_0xd948('0x2a')](function(){return _0x1bdbf4;});})[_0xd948('0x2a')](function(){_0x544c26['status'](0xcc)[_0xd948('0x22')]();});}};}function handleEntityNotFound(_0x227963,_0x585528){return function(_0x10ad78){if(!_0x10ad78){_0x227963['sendStatus'](0x194);}return _0x10ad78;};}function handleError(_0x5233c9,_0x3e254a){_0x3e254a=_0x3e254a||0x1f4;return function(_0x44befd){logger['error'](_0x44befd[_0xd948('0x2f')]);if(_0x44befd[_0xd948('0x30')]){delete _0x44befd[_0xd948('0x30')];}_0x5233c9[_0xd948('0x21')](_0x3e254a)[_0xd948('0x31')](_0x44befd);};}exports[_0xd948('0x32')]=function(_0x4b82ea,_0x28e3bf){var _0x18e115={},_0x3ab0f4={},_0x596600={'count':0x0,'rows':[]};var _0xe9072f=_[_0xd948('0x33')](db[_0xd948('0x34')][_0xd948('0x35')],function(_0x2e763d){return{'name':_0x2e763d[_0xd948('0x36')],'type':_0x2e763d[_0xd948('0x37')][_0xd948('0x38')]};});_0x3ab0f4['model']=_[_0xd948('0x33')](_0xe9072f,_0xd948('0x30'));_0x3ab0f4['query']=_[_0xd948('0x39')](_0x4b82ea[_0xd948('0x3a')]);_0x3ab0f4['filters']=_['intersection'](_0x3ab0f4[_0xd948('0x3b')],_0x3ab0f4['query']);_0x18e115[_0xd948('0x3c')]=_['intersection'](_0x3ab0f4['model'],qs[_0xd948('0x3d')](_0x4b82ea[_0xd948('0x3a')][_0xd948('0x3d')]));_0x18e115['attributes']=_0x18e115[_0xd948('0x3c')][_0xd948('0x3e')]?_0x18e115[_0xd948('0x3c')]:_0x3ab0f4[_0xd948('0x3b')];if(!_0x4b82ea[_0xd948('0x3a')][_0xd948('0x3f')](_0xd948('0x40'))){_0x18e115['limit']=qs[_0xd948('0x25')](_0x4b82ea[_0xd948('0x3a')][_0xd948('0x25')]);_0x18e115[_0xd948('0x24')]=qs[_0xd948('0x24')](_0x4b82ea[_0xd948('0x3a')][_0xd948('0x24')]);}_0x18e115[_0xd948('0x41')]=qs[_0xd948('0x42')](_0x4b82ea[_0xd948('0x3a')][_0xd948('0x42')]);_0x18e115['where']=qs[_0xd948('0x43')](_[_0xd948('0x44')](_0x4b82ea['query'],_0x3ab0f4[_0xd948('0x43')]),_0xe9072f);if(_0x4b82ea[_0xd948('0x3a')][_0xd948('0x45')]){_0x18e115[_0xd948('0x46')]=_[_0xd948('0x47')](_0x18e115['where'],{'$or':_[_0xd948('0x33')](_0xe9072f,function(_0x2e6a8d){if(_0x2e6a8d['type']!==_0xd948('0x48')){var _0x33ca00={};_0x33ca00[_0x2e6a8d['name']]={'$like':'%'+_0x4b82ea[_0xd948('0x3a')][_0xd948('0x45')]+'%'};return _0x33ca00;}})});}_0x18e115=_[_0xd948('0x47')]({},_0x18e115,_0x4b82ea['options']);var _0x10132a={'where':_0x18e115[_0xd948('0x46')]};return db[_0xd948('0x34')]['count'](_0x10132a)[_0xd948('0x2a')](function(_0x7d0798){_0x596600[_0xd948('0x49')]=_0x7d0798;if(_0x4b82ea[_0xd948('0x3a')][_0xd948('0x4a')]){_0x18e115[_0xd948('0x4b')]=[{'all':!![]}];}return db[_0xd948('0x34')][_0xd948('0x4c')](_0x18e115);})[_0xd948('0x2a')](function(_0x3a5352){_0x596600[_0xd948('0x4d')]=_0x3a5352;return _0x596600;})[_0xd948('0x2a')](respondWithFilteredResult(_0x28e3bf,_0x18e115))[_0xd948('0x4e')](handleError(_0x28e3bf,null));};exports[_0xd948('0x4f')]=function(_0x31161d,_0x36879c){var _0x332941={'raw':!![],'where':{'id':_0x31161d[_0xd948('0x50')]['id']}},_0x5efd38={};_0x5efd38[_0xd948('0x3b')]=_[_0xd948('0x39')](db[_0xd948('0x34')][_0xd948('0x35')]);_0x5efd38[_0xd948('0x3a')]=_[_0xd948('0x39')](_0x31161d['query']);_0x5efd38[_0xd948('0x43')]=_['intersection'](_0x5efd38[_0xd948('0x3b')],_0x5efd38[_0xd948('0x3a')]);_0x332941['attributes']=_[_0xd948('0x51')](_0x5efd38[_0xd948('0x3b')],qs[_0xd948('0x3d')](_0x31161d[_0xd948('0x3a')][_0xd948('0x3d')]));_0x332941[_0xd948('0x3c')]=_0x332941[_0xd948('0x3c')][_0xd948('0x3e')]?_0x332941[_0xd948('0x3c')]:_0x5efd38[_0xd948('0x3b')];if(_0x31161d[_0xd948('0x3a')][_0xd948('0x4a')]){_0x332941['include']=[{'all':!![]}];}_0x332941=_[_0xd948('0x47')]({},_0x332941,_0x31161d[_0xd948('0x52')]);return db['MailQueue'][_0xd948('0x53')](_0x332941)[_0xd948('0x2a')](handleEntityNotFound(_0x36879c,null))[_0xd948('0x2a')](respondWithResult(_0x36879c,null))[_0xd948('0x4e')](handleError(_0x36879c,null));};exports[_0xd948('0x54')]=function(_0x43c646,_0x87906f){return db[_0xd948('0x34')][_0xd948('0x54')](_0x43c646[_0xd948('0x55')],{})['then'](function(_0x5d3eb7){var _0x4045e9=_0x43c646[_0xd948('0x56')][_0xd948('0x2c')]({'plain':!![]});if(!_0x4045e9)throw new Error(_0xd948('0x57'));if(_0x4045e9[_0xd948('0x58')]===_0xd948('0x56')){var _0x337088=_0x5d3eb7['get']({'plain':!![]});var _0x27a2e4=_0xd948('0x2d');return db[_0xd948('0x59')][_0xd948('0x53')]({'where':{'name':_0x27a2e4,'userProfileId':_0x4045e9['userProfileId']},'raw':!![]})[_0xd948('0x2a')](function(_0x46afe2){if(_0x46afe2&&_0x46afe2[_0xd948('0x5a')]===0x0){return db[_0xd948('0x2e')][_0xd948('0x54')]({'name':_0x337088[_0xd948('0x30')],'resourceId':_0x337088['id'],'type':_0x46afe2['name'],'sectionId':_0x46afe2['id']},{})[_0xd948('0x2a')](function(){return _0x5d3eb7;});}else{return _0x5d3eb7;}})[_0xd948('0x4e')](function(_0xe5199f){logger[_0xd948('0x5b')](_0xd948('0x5c'),_0xe5199f);throw _0xe5199f;});}return _0x5d3eb7;})[_0xd948('0x2a')](respondWithResult(_0x87906f,0xc9))[_0xd948('0x4e')](handleError(_0x87906f,null));};exports['update']=function(_0x38e6ce,_0x5bc7d8){if(_0x38e6ce[_0xd948('0x55')]['id']){delete _0x38e6ce[_0xd948('0x55')]['id'];}return db[_0xd948('0x34')][_0xd948('0x53')]({'where':{'id':_0x38e6ce[_0xd948('0x50')]['id']}})['then'](handleEntityNotFound(_0x5bc7d8,null))[_0xd948('0x2a')](saveUpdates(_0x38e6ce[_0xd948('0x55')],null))[_0xd948('0x2a')](respondWithResult(_0x5bc7d8,null))[_0xd948('0x4e')](handleError(_0x5bc7d8,null));};exports[_0xd948('0x2b')]=function(_0x57f58d,_0x550e01){return db['MailQueue'][_0xd948('0x53')]({'where':{'id':_0x57f58d[_0xd948('0x50')]['id']}})['then'](handleEntityNotFound(_0x550e01,null))[_0xd948('0x2a')](removeEntity(_0x550e01,null))[_0xd948('0x4e')](handleError(_0x550e01,null));};exports[_0xd948('0x5d')]=function(_0x337240,_0xa9cdc4){return db[_0xd948('0x34')][_0xd948('0x5d')]()[_0xd948('0x2a')](respondWithResult(_0xa9cdc4,null))[_0xd948('0x4e')](handleError(_0xa9cdc4,null));};exports[_0xd948('0x5e')]=function(_0x36f852,_0x4a8be4,_0x6bd5d1){var _0x404d79={'raw':!![],'where':{}},_0x153044={},_0x259494;return db['MailQueue'][_0xd948('0x5f')]({'where':{'id':_0x36f852['params']['id']}})[_0xd948('0x2a')](handleEntityNotFound(_0x4a8be4,null))['then'](function(_0x5d35e4){if(_0x5d35e4){_0x259494=_0x5d35e4[_0xd948('0x2c')]({'plain':!![]});_0x153044['model']=_['keys'](db['UserMailQueue']['rawAttributes']);_0x153044['query']=_['keys'](_0x36f852[_0xd948('0x3a')]);_0x153044['filters']=_[_0xd948('0x51')](_0x153044[_0xd948('0x3b')],_0x153044[_0xd948('0x3a')]);_0x404d79['attributes']=_[_0xd948('0x51')](_0x153044[_0xd948('0x3b')],qs[_0xd948('0x3d')](_0x36f852[_0xd948('0x3a')][_0xd948('0x3d')]));_0x404d79[_0xd948('0x3c')]=_0x404d79[_0xd948('0x3c')][_0xd948('0x3e')]?_0x404d79[_0xd948('0x3c')]:_0x153044[_0xd948('0x3b')];if(!_0x36f852[_0xd948('0x3a')]['hasOwnProperty'](_0xd948('0x40'))){_0x404d79[_0xd948('0x25')]=qs['limit'](_0x36f852['query'][_0xd948('0x25')]);_0x404d79[_0xd948('0x24')]=qs[_0xd948('0x24')](_0x36f852['query'][_0xd948('0x24')]);}_0x404d79[_0xd948('0x41')]=qs['sort'](_0x36f852[_0xd948('0x3a')][_0xd948('0x42')]);_0x404d79[_0xd948('0x46')]=qs[_0xd948('0x43')](_[_0xd948('0x44')](_0x36f852[_0xd948('0x3a')],_0x153044[_0xd948('0x43')]));_0x404d79[_0xd948('0x46')][_0xd948('0x60')]=_0x5d35e4['id'];if(_0x36f852['query'][_0xd948('0x45')]){_0x404d79[_0xd948('0x46')]=_[_0xd948('0x47')](_0x404d79[_0xd948('0x46')],{'$or':_['map'](_0x404d79[_0xd948('0x3c')],function(_0x31bfd0){var _0x5e8a54={};_0x5e8a54[_0x31bfd0]={'$like':'%'+_0x36f852['query'][_0xd948('0x45')]+'%'};return _0x5e8a54;})});}_0x404d79=_['merge']({},_0x404d79,_0x36f852[_0xd948('0x52')]);return db[_0xd948('0x61')][_0xd948('0x4c')](_0x404d79);}})[_0xd948('0x2a')](function(_0x34fc72){if(_0x34fc72){return db['User'][_0xd948('0x62')]({'where':{'id':_[_0xd948('0x33')](_0x34fc72,_0xd948('0x63')),'role':_0xd948('0x64')},'attributes':['id','name',_0xd948('0x65'),'updatedAt','createdAt']});}})[_0xd948('0x2a')](function(_0xd49391){if(_0xd49391){return{'count':_0xd49391[_0xd948('0x49')],'rows':_[_0xd948('0x33')](_0xd49391['rows'],function(_0x5a4932){return{'membername':_0x5a4932[_0xd948('0x30')],'UserId':_0x5a4932['id'],'queue_name':_0x259494['name'],'MailQueueId':_0x259494['id'],'interface':util['format']('%s/%s',_0xd948('0x66'),_0x5a4932[_0xd948('0x30')]),'penalty':0x0,'paused':_0x5a4932[_0xd948('0x65')],'createdAt':_0x5a4932['createdAt'],'updatedAt':_0x5a4932[_0xd948('0x67')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xd948('0x2a')](respondWithFilteredResult(_0x4a8be4,_0x404d79))['catch'](handleError(_0x4a8be4,null));};exports[_0xd948('0x68')]=function(_0xd9133f,_0x4a77cc,_0x1bdd0a){var _0x333e47={};var _0x12d1ac={};var _0x4af8e9;var _0x3fe249;return db[_0xd948('0x34')]['findOne']({'where':{'id':_0xd9133f[_0xd948('0x50')]['id']}})[_0xd948('0x2a')](handleEntityNotFound(_0x4a77cc,null))['then'](function(_0x1229ce){if(_0x1229ce){_0x4af8e9=_0x1229ce;_0x12d1ac[_0xd948('0x3b')]=_['keys'](db[_0xd948('0x69')][_0xd948('0x35')]);_0x12d1ac[_0xd948('0x3a')]=_[_0xd948('0x39')](_0xd9133f[_0xd948('0x3a')]);_0x12d1ac[_0xd948('0x43')]=_[_0xd948('0x51')](_0x12d1ac[_0xd948('0x3b')],_0x12d1ac[_0xd948('0x3a')]);_0x333e47[_0xd948('0x3c')]=_[_0xd948('0x51')](_0x12d1ac[_0xd948('0x3b')],qs[_0xd948('0x3d')](_0xd9133f[_0xd948('0x3a')][_0xd948('0x3d')]));_0x333e47['attributes']=_0x333e47[_0xd948('0x3c')]['length']?_0x333e47['attributes']:_0x12d1ac[_0xd948('0x3b')];_0x333e47[_0xd948('0x41')]=qs[_0xd948('0x42')](_0xd9133f['query']['sort']);_0x333e47['where']=qs[_0xd948('0x43')](_[_0xd948('0x44')](_0xd9133f['query'],_0x12d1ac[_0xd948('0x43')]));if(_0xd9133f[_0xd948('0x3a')][_0xd948('0x45')]){_0x333e47['where']=_[_0xd948('0x47')](_0x333e47[_0xd948('0x46')],{'$or':_[_0xd948('0x33')](_0x333e47['attributes'],function(_0x516a26){var _0x42d025={};_0x42d025[_0x516a26]={'$like':'%'+_0xd9133f['query'][_0xd948('0x45')]+'%'};return _0x42d025;})});}_0x333e47=_[_0xd948('0x47')]({},_0x333e47,_0xd9133f[_0xd948('0x52')]);return _0x4af8e9[_0xd948('0x68')](_0x333e47);}})[_0xd948('0x2a')](function(_0x23ee4f){if(_0x23ee4f){_0x3fe249=_0x23ee4f['length'];if(!_0xd9133f[_0xd948('0x3a')][_0xd948('0x3f')](_0xd948('0x40'))){_0x333e47['limit']=qs[_0xd948('0x25')](_0xd9133f[_0xd948('0x3a')]['limit']);_0x333e47[_0xd948('0x24')]=qs['offset'](_0xd9133f[_0xd948('0x3a')][_0xd948('0x24')]);}return _0x4af8e9['getTeams'](_0x333e47);}})['then'](function(_0x267e9f){if(_0x267e9f){return _0x267e9f?{'count':_0x3fe249,'rows':_0x267e9f}:null;}})['then'](respondWithResult(_0x4a77cc,null))[_0xd948('0x4e')](handleError(_0x4a77cc,null));};exports[_0xd948('0x6a')]=function(_0x293ab3,_0x5c61ae,_0x2f11c4){var _0x2a0412=_0x293ab3[_0xd948('0x55')][_0xd948('0x6b')];return db[_0xd948('0x69')][_0xd948('0x4c')]({'where':{'id':_0x2a0412},'attributes':['id'],'include':[{'model':db[_0xd948('0x6c')],'as':'Agents','attributes':['id','name',_0xd948('0x6d'),_0xd948('0x6e'),'interface'],'raw':!![]}]})[_0xd948('0x2a')](function(_0x8d90a7){if(_0x8d90a7){var _0x33feca=_['flatMap'](_0x8d90a7,function(_0x415818){var _0x48f5cf=_0x415818['get']({'plain':!![]});return _0x48f5cf['Agents'];});return db[_0xd948('0x34')][_0xd948('0x53')]({'where':{'id':_0x293ab3[_0xd948('0x50')]['id']}})[_0xd948('0x2a')](function(_0x1bacf8){return db[_0xd948('0x6f')][_0xd948('0x70')](function(_0x3f4922){return _0x1bacf8['addTeams'](_0x2a0412,{'transaction':_0x3f4922})[_0xd948('0x2a')](function(){return BPromise[_0xd948('0x71')](_0x33feca,function(_0x3d06a3){return db[_0xd948('0x61')][_0xd948('0x72')]({'where':{'UserId':_0x3d06a3['id'],'MailQueueId':_0x293ab3[_0xd948('0x50')]['id']},'transaction':_0x3f4922});});})['then'](function(){_0x33feca[_0xd948('0x73')](function(_0x1cbc35){socket[_0xd948('0x74')](_0xd948('0x75'),{'UserId':_0x1cbc35['id'],'MailQueueId':_0x1bacf8['id']});});});});});}})[_0xd948('0x2a')](respondWithStatusCode(_0x5c61ae,null))[_0xd948('0x4e')](handleError(_0x5c61ae,null));};exports[_0xd948('0x76')]=function(_0x5502ea,_0x5beb73,_0x3a92d3){return db[_0xd948('0x69')][_0xd948('0x4c')]({'where':{'id':_0x5502ea['query'][_0xd948('0x6b')]},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0xd948('0x2a')](handleEntityNotFound(_0x5beb73,null))[_0xd948('0x2a')](function(_0x545fde){var _0x97d689=_[_0xd948('0x33')](_0x545fde,'id');var _0x5b6813=[];var _0x58e5f3=[];var _0x133fce=squel[_0xd948('0x77')]();_0x133fce['field']('tq.TeamId')[_0xd948('0x78')](_0xd948('0x79'),'tq')['join'](_0xd948('0x7a'),'ut',_0xd948('0x7b'))[_0xd948('0x46')](_0xd948('0x7c'),_0x5502ea[_0xd948('0x50')]['id']);for(var _0xedcf99=0x0;_0xedcf99<_0x545fde[_0xd948('0x3e')];_0xedcf99+=0x1){let _0x46c111=_0x545fde[_0xedcf99];for(var _0x5ec92b=0x0;_0x5ec92b<_0x46c111[_0xd948('0x7d')][_0xd948('0x3e')];_0x5ec92b+=0x1){let _0x8fb580=_0x46c111[_0xd948('0x7d')][_0x5ec92b];var _0xeb78a=_0x133fce[_0xd948('0x7e')]();_0xeb78a[_0xd948('0x46')](_0xd948('0x7f'),_0x8fb580['id']);_0x58e5f3['push'](db[_0xd948('0x6f')]['query'](_0xeb78a[_0xd948('0x80')](),{'type':db[_0xd948('0x6f')][_0xd948('0x81')][_0xd948('0x82')]})[_0xd948('0x2a')](function(_0x21439f){if(_0x21439f[_0xd948('0x3e')]===0x1){return _0x8fb580['id'];}else{var _0x5cebfc=_[_0xd948('0x83')](_[_0xd948('0x33')](_0x21439f,_0xd948('0x84')),function(_0x5587a4){return _[_0xd948('0x85')](_0x97d689,_0x5587a4);});if(_0x5cebfc){return _0x8fb580['id'];}}}));}}return BPromise[_0xd948('0x86')](_0x58e5f3)[_0xd948('0x2a')](function(_0x1116f0){_0x5b6813=_(_0x5b6813)['union'](_0x1116f0)[_0xd948('0x87')]()[_0xd948('0x88')]();return db[_0xd948('0x34')][_0xd948('0x53')]({'where':{'id':_0x5502ea['params']['id']}})[_0xd948('0x2a')](function(_0x250fa0){return db[_0xd948('0x6f')][_0xd948('0x70')](function(_0x23a767){return _0x250fa0['removeTeams'](_0x5502ea[_0xd948('0x3a')]['ids'],{'transaction':_0x23a767})[_0xd948('0x2a')](function(){if(!_[_0xd948('0x89')](_0x5b6813)){return _0x250fa0['removeAgents'](_0x5b6813,{'transaction':_0x23a767});}})['then'](function(){_0x5b6813[_0xd948('0x73')](function(_0x58079a){socket['emit'](_0xd948('0x8a'),{'UserId':_0x58079a,'MailQueueId':_0x250fa0['id']});});});});});});})[_0xd948('0x2a')](respondWithStatusCode(_0x5beb73,null))[_0xd948('0x4e')](handleError(_0x5beb73,null));};exports[_0xd948('0x8b')]=function(_0x5d4467,_0x279d08,_0x38acf4){return db['MailQueue']['find']({'where':{'id':_0x5d4467[_0xd948('0x50')]['id']}})['then'](handleEntityNotFound(_0x279d08,null))['then'](function(_0x5a9ca4){if(_0x5a9ca4){return _0x5a9ca4['addAgents'](_0x5d4467[_0xd948('0x55')][_0xd948('0x6b')],_[_0xd948('0x8c')](_0x5d4467[_0xd948('0x55')],[_0xd948('0x6b'),'id'])||{})[_0xd948('0x8d')](function(_0x4acd3a){for(var _0x54e97f=0x0;_0x54e97f<_0x5d4467[_0xd948('0x55')]['ids']['length'];_0x54e97f+=0x1){socket['emit']('userMailQueue:save',{'UserId':_0x5d4467['body'][_0xd948('0x6b')][_0x54e97f],'MailQueueId':_0x5d4467[_0xd948('0x50')]['id']});}return _0x4acd3a;});}})[_0xd948('0x2a')](respondWithResult(_0x279d08,null))['catch'](handleError(_0x279d08,null));};exports[_0xd948('0x8e')]=function(_0x1a040a,_0x42cf10,_0x1d5ac3){return db[_0xd948('0x34')][_0xd948('0x53')]({'where':{'id':_0x1a040a['params']['id']}})[_0xd948('0x2a')](handleEntityNotFound(_0x42cf10,null))[_0xd948('0x2a')](function(_0x2bcd9e){if(_0x2bcd9e){return _0x2bcd9e[_0xd948('0x8e')](_0x1a040a[_0xd948('0x3a')][_0xd948('0x6b')])[_0xd948('0x2a')](function(){if(_[_0xd948('0x8f')](_0x1a040a[_0xd948('0x3a')][_0xd948('0x6b')])){for(var _0x50e153=0x0;_0x50e153<_0x1a040a[_0xd948('0x3a')][_0xd948('0x6b')][_0xd948('0x3e')];_0x50e153+=0x1){socket[_0xd948('0x74')](_0xd948('0x8a'),{'UserId':Number(_0x1a040a['query'][_0xd948('0x6b')][_0x50e153]),'MailQueueId':Number(_0x1a040a[_0xd948('0x50')]['id'])});}}else{socket[_0xd948('0x74')](_0xd948('0x8a'),{'UserId':Number(_0x1a040a['query'][_0xd948('0x6b')]),'MailQueueId':Number(_0x1a040a[_0xd948('0x50')]['id'])});}});}})['then'](respondWithStatusCode(_0x42cf10,null))['catch'](handleError(_0x42cf10,null));};exports['getAgents']=function(_0x2da985,_0x194bb9,_0x3170a0){var _0x5d6834={};var _0xc0ac74={};var _0x30f52f;var _0x2be957;return db[_0xd948('0x34')][_0xd948('0x5f')]({'where':{'id':_0x2da985['params']['id']}})['then'](handleEntityNotFound(_0x194bb9,null))['then'](function(_0x437dbd){if(_0x437dbd){_0x30f52f=_0x437dbd;_0xc0ac74['model']=_[_0xd948('0x39')](db[_0xd948('0x6c')][_0xd948('0x35')]);_0xc0ac74[_0xd948('0x3a')]=_[_0xd948('0x39')](_0x2da985[_0xd948('0x3a')]);_0xc0ac74['filters']=_['intersection'](_0xc0ac74[_0xd948('0x3b')],_0xc0ac74[_0xd948('0x3a')]);_0x5d6834[_0xd948('0x3c')]=_[_0xd948('0x51')](_0xc0ac74['model'],qs[_0xd948('0x3d')](_0x2da985[_0xd948('0x3a')][_0xd948('0x3d')]));_0x5d6834[_0xd948('0x3c')]=_0x5d6834[_0xd948('0x3c')]['length']?_0x5d6834[_0xd948('0x3c')]:_0xc0ac74[_0xd948('0x3b')];_0x5d6834[_0xd948('0x41')]=qs['sort'](_0x2da985[_0xd948('0x3a')][_0xd948('0x42')]);_0x5d6834[_0xd948('0x46')]=qs['filters'](_[_0xd948('0x44')](_0x2da985['query'],_0xc0ac74[_0xd948('0x43')]));if(_0x2da985[_0xd948('0x3a')][_0xd948('0x45')]){_0x5d6834[_0xd948('0x46')]=_[_0xd948('0x47')](_0x5d6834[_0xd948('0x46')],{'$or':_['map'](_0x5d6834['attributes'],function(_0x556472){var _0xc62d0={};_0xc62d0[_0x556472]={'$like':'%'+_0x2da985[_0xd948('0x3a')][_0xd948('0x45')]+'%'};return _0xc62d0;})});}_0x5d6834=_[_0xd948('0x47')]({},_0x5d6834,_0x2da985[_0xd948('0x52')]);return _0x30f52f[_0xd948('0x90')](_0x5d6834);}})[_0xd948('0x2a')](function(_0x39733d){if(_0x39733d){_0x2be957=_0x39733d[_0xd948('0x3e')];if(!_0x2da985[_0xd948('0x3a')][_0xd948('0x3f')](_0xd948('0x40'))){_0x5d6834[_0xd948('0x25')]=qs[_0xd948('0x25')](_0x2da985['query'][_0xd948('0x25')]);_0x5d6834[_0xd948('0x24')]=qs['offset'](_0x2da985['query'][_0xd948('0x24')]);}return _0x30f52f[_0xd948('0x90')](_0x5d6834);}})[_0xd948('0x2a')](function(_0x23b203){if(_0x23b203){return _0x23b203?{'count':_0x2be957,'rows':_0x23b203}:null;}})[_0xd948('0x2a')](respondWithResult(_0x194bb9,null))[_0xd948('0x4e')](handleError(_0x194bb9,null));};
\ No newline at end of file
+var _0x5abb=['findAll','rows','catch','show','params','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','MailQueueId','UserMailQueue','findAndCountAll','UserId','agent','updatedAt','createdAt','count','format','%s/%s','SIP','mailPause','getTeams','Team','addTeams','User','Agents','online','interface','flatMap','sequelize','transaction','forEach','emit','userMailQueue:save','removeTeams','ids','field','from','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','MailQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','QueryTypes','SELECT','every','TeamId','includes','all','union','isEmpty','removeAgents','userMailQueue:remove','addAgents','spread','isArray','getAgents','findOne','html-pdf','eml-format','rimraf','request-promise','moment','bluebird','util','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/utils','../../config/environment','defaults','redis','localhost','socket.io-emitter','./mailQueue.socket','register','sendStatus','status','end','offset','limit','set','Content-Range','json','apply','reject','save','update','then','get','MailQueues','UserProfileResource','destroy','stack','name','send','index','map','MailQueue','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','include'];(function(_0x414655,_0x79d916){var _0x237884=function(_0x2737d9){while(--_0x2737d9){_0x414655['push'](_0x414655['shift']());}};_0x237884(++_0x79d916);}(_0x5abb,0x1e9));var _0xb5ab=function(_0x5e0bc1,_0x2b41d2){_0x5e0bc1=_0x5e0bc1-0x0;var _0x5c6a9d=_0x5abb[_0x5e0bc1];return _0x5c6a9d;};'use strict';var pdf=require(_0xb5ab('0x0'));var emlformat=require(_0xb5ab('0x1'));var rimraf=require(_0xb5ab('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xb5ab('0x3'));var moment=require(_0xb5ab('0x4'));var BPromise=require(_0xb5ab('0x5'));var Mustache=require('mustache');var util=require(_0xb5ab('0x6'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xb5ab('0x7'));var fs=require('fs');var _=require(_0xb5ab('0x8'));var squel=require(_0xb5ab('0x9'));var crypto=require(_0xb5ab('0xa'));var jsforce=require(_0xb5ab('0xb'));var deskjs=require(_0xb5ab('0xc'));var toCsv=require(_0xb5ab('0xd'));var querystring=require(_0xb5ab('0xe'));var Papa=require(_0xb5ab('0xf'));var Redis=require(_0xb5ab('0x10'));var authService=require(_0xb5ab('0x11'));var qs=require(_0xb5ab('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0xb5ab('0x13'));var config=require(_0xb5ab('0x14'));var db=require('../../mysqldb')['db'];config['redis']=_[_0xb5ab('0x15')](config[_0xb5ab('0x16')],{'host':_0xb5ab('0x17'),'port':0x18eb});var socket=require(_0xb5ab('0x18'))(new Redis(config[_0xb5ab('0x16')]));require(_0xb5ab('0x19'))[_0xb5ab('0x1a')](socket);function respondWithStatusCode(_0xe621cc,_0x1aedc9){_0x1aedc9=_0x1aedc9||0xcc;return function(_0x1ac769){if(_0x1ac769){return _0xe621cc[_0xb5ab('0x1b')](_0x1aedc9);}return _0xe621cc[_0xb5ab('0x1c')](_0x1aedc9)[_0xb5ab('0x1d')]();};}function respondWithResult(_0x2f509d,_0x23e82a){_0x23e82a=_0x23e82a||0xc8;return function(_0x17f7dd){if(_0x17f7dd){return _0x2f509d[_0xb5ab('0x1c')](_0x23e82a)['json'](_0x17f7dd);}};}function respondWithFilteredResult(_0x15de13,_0x190d58){return function(_0x5a9329){if(_0x5a9329){var _0x4b3e2e=_0x5a9329['count'],_0x49f593=_0x190d58[_0xb5ab('0x1e')],_0x30e4a5=_0x190d58[_0xb5ab('0x1e')]+_0x190d58[_0xb5ab('0x1f')],_0xae646d;if(_0x30e4a5>=_0x4b3e2e){_0x30e4a5=_0x4b3e2e;_0xae646d=0xc8;}else{_0xae646d=0xce;}_0x15de13[_0xb5ab('0x1c')](_0xae646d);return _0x15de13[_0xb5ab('0x20')](_0xb5ab('0x21'),_0x49f593+'-'+_0x30e4a5+'/'+_0x4b3e2e)[_0xb5ab('0x22')](_0x5a9329);}return null;};}function patchUpdates(_0x4d2f97){return function(_0x1c683f){try{jsonpatch[_0xb5ab('0x23')](_0x1c683f,_0x4d2f97,!![]);}catch(_0x4ab0c1){return BPromise[_0xb5ab('0x24')](_0x4ab0c1);}return _0x1c683f[_0xb5ab('0x25')]();};}function saveUpdates(_0x1f29c7,_0x3f2d6b){return function(_0x550e98){if(_0x550e98){return _0x550e98[_0xb5ab('0x26')](_0x1f29c7)[_0xb5ab('0x27')](function(_0x279a38){return _0x279a38;});}return null;};}function removeEntity(_0x295dba,_0x362075){return function(_0x303f66){if(_0x303f66){return _0x303f66['destroy']()['then'](function(){var _0x41d499=_0x303f66[_0xb5ab('0x28')]({'plain':!![]});var _0x11ff6e=_0xb5ab('0x29');return db[_0xb5ab('0x2a')][_0xb5ab('0x2b')]({'where':{'type':_0x11ff6e,'resourceId':_0x41d499['id']}})[_0xb5ab('0x27')](function(){return _0x303f66;});})[_0xb5ab('0x27')](function(){_0x295dba[_0xb5ab('0x1c')](0xcc)[_0xb5ab('0x1d')]();});}};}function handleEntityNotFound(_0x5b64af,_0x264c0b){return function(_0x14df46){if(!_0x14df46){_0x5b64af[_0xb5ab('0x1b')](0x194);}return _0x14df46;};}function handleError(_0x408ba7,_0x564392){_0x564392=_0x564392||0x1f4;return function(_0xcba085){logger['error'](_0xcba085[_0xb5ab('0x2c')]);if(_0xcba085[_0xb5ab('0x2d')]){delete _0xcba085[_0xb5ab('0x2d')];}_0x408ba7[_0xb5ab('0x1c')](_0x564392)[_0xb5ab('0x2e')](_0xcba085);};}exports[_0xb5ab('0x2f')]=function(_0x5ba69e,_0x364341){var _0x37c92a={},_0x3e7a8a={},_0x53a78c={'count':0x0,'rows':[]};var _0x49dd25=_[_0xb5ab('0x30')](db[_0xb5ab('0x31')][_0xb5ab('0x32')],function(_0x5de39c){return{'name':_0x5de39c['fieldName'],'type':_0x5de39c[_0xb5ab('0x33')][_0xb5ab('0x34')]};});_0x3e7a8a[_0xb5ab('0x35')]=_['map'](_0x49dd25,'name');_0x3e7a8a[_0xb5ab('0x36')]=_[_0xb5ab('0x37')](_0x5ba69e[_0xb5ab('0x36')]);_0x3e7a8a[_0xb5ab('0x38')]=_[_0xb5ab('0x39')](_0x3e7a8a[_0xb5ab('0x35')],_0x3e7a8a['query']);_0x37c92a[_0xb5ab('0x3a')]=_['intersection'](_0x3e7a8a[_0xb5ab('0x35')],qs[_0xb5ab('0x3b')](_0x5ba69e[_0xb5ab('0x36')]['fields']));_0x37c92a[_0xb5ab('0x3a')]=_0x37c92a['attributes'][_0xb5ab('0x3c')]?_0x37c92a[_0xb5ab('0x3a')]:_0x3e7a8a[_0xb5ab('0x35')];if(!_0x5ba69e[_0xb5ab('0x36')][_0xb5ab('0x3d')](_0xb5ab('0x3e'))){_0x37c92a['limit']=qs['limit'](_0x5ba69e[_0xb5ab('0x36')][_0xb5ab('0x1f')]);_0x37c92a[_0xb5ab('0x1e')]=qs[_0xb5ab('0x1e')](_0x5ba69e['query'][_0xb5ab('0x1e')]);}_0x37c92a[_0xb5ab('0x3f')]=qs[_0xb5ab('0x40')](_0x5ba69e[_0xb5ab('0x36')][_0xb5ab('0x40')]);_0x37c92a['where']=qs[_0xb5ab('0x38')](_[_0xb5ab('0x41')](_0x5ba69e['query'],_0x3e7a8a[_0xb5ab('0x38')]),_0x49dd25);if(_0x5ba69e['query'][_0xb5ab('0x42')]){_0x37c92a[_0xb5ab('0x43')]=_[_0xb5ab('0x44')](_0x37c92a[_0xb5ab('0x43')],{'$or':_[_0xb5ab('0x30')](_0x49dd25,function(_0x170993){if(_0x170993[_0xb5ab('0x33')]!==_0xb5ab('0x45')){var _0x244c0e={};_0x244c0e[_0x170993['name']]={'$like':'%'+_0x5ba69e[_0xb5ab('0x36')][_0xb5ab('0x42')]+'%'};return _0x244c0e;}})});}_0x37c92a=_['merge']({},_0x37c92a,_0x5ba69e['options']);var _0x4d298c={'where':_0x37c92a[_0xb5ab('0x43')]};return db['MailQueue']['count'](_0x4d298c)['then'](function(_0x6845d4){_0x53a78c['count']=_0x6845d4;if(_0x5ba69e[_0xb5ab('0x36')]['includeAll']){_0x37c92a[_0xb5ab('0x46')]=[{'all':!![]}];}return db['MailQueue'][_0xb5ab('0x47')](_0x37c92a);})['then'](function(_0x5ba351){_0x53a78c[_0xb5ab('0x48')]=_0x5ba351;return _0x53a78c;})[_0xb5ab('0x27')](respondWithFilteredResult(_0x364341,_0x37c92a))[_0xb5ab('0x49')](handleError(_0x364341,null));};exports[_0xb5ab('0x4a')]=function(_0x5702ab,_0x5b67dc){var _0x2a2875={'raw':!![],'where':{'id':_0x5702ab[_0xb5ab('0x4b')]['id']}},_0x2e1760={};_0x2e1760[_0xb5ab('0x35')]=_[_0xb5ab('0x37')](db[_0xb5ab('0x31')][_0xb5ab('0x32')]);_0x2e1760['query']=_[_0xb5ab('0x37')](_0x5702ab[_0xb5ab('0x36')]);_0x2e1760['filters']=_['intersection'](_0x2e1760[_0xb5ab('0x35')],_0x2e1760[_0xb5ab('0x36')]);_0x2a2875[_0xb5ab('0x3a')]=_[_0xb5ab('0x39')](_0x2e1760[_0xb5ab('0x35')],qs[_0xb5ab('0x3b')](_0x5702ab[_0xb5ab('0x36')][_0xb5ab('0x3b')]));_0x2a2875[_0xb5ab('0x3a')]=_0x2a2875[_0xb5ab('0x3a')][_0xb5ab('0x3c')]?_0x2a2875['attributes']:_0x2e1760[_0xb5ab('0x35')];if(_0x5702ab[_0xb5ab('0x36')]['includeAll']){_0x2a2875[_0xb5ab('0x46')]=[{'all':!![]}];}_0x2a2875=_[_0xb5ab('0x44')]({},_0x2a2875,_0x5702ab[_0xb5ab('0x4c')]);return db[_0xb5ab('0x31')][_0xb5ab('0x4d')](_0x2a2875)[_0xb5ab('0x27')](handleEntityNotFound(_0x5b67dc,null))[_0xb5ab('0x27')](respondWithResult(_0x5b67dc,null))['catch'](handleError(_0x5b67dc,null));};exports['create']=function(_0x314cc8,_0x4ff733){return db[_0xb5ab('0x31')][_0xb5ab('0x4e')](_0x314cc8[_0xb5ab('0x4f')],{})[_0xb5ab('0x27')](function(_0x3c74a6){var _0x1d1095=_0x314cc8[_0xb5ab('0x50')]['get']({'plain':!![]});if(!_0x1d1095)throw new Error(_0xb5ab('0x51'));if(_0x1d1095[_0xb5ab('0x52')]===_0xb5ab('0x50')){var _0x3ae359=_0x3c74a6[_0xb5ab('0x28')]({'plain':!![]});var _0x37ef97=_0xb5ab('0x29');return db[_0xb5ab('0x53')][_0xb5ab('0x4d')]({'where':{'name':_0x37ef97,'userProfileId':_0x1d1095['userProfileId']},'raw':!![]})[_0xb5ab('0x27')](function(_0x1d668f){if(_0x1d668f&&_0x1d668f[_0xb5ab('0x54')]===0x0){return db[_0xb5ab('0x2a')]['create']({'name':_0x3ae359[_0xb5ab('0x2d')],'resourceId':_0x3ae359['id'],'type':_0x1d668f[_0xb5ab('0x2d')],'sectionId':_0x1d668f['id']},{})['then'](function(){return _0x3c74a6;});}else{return _0x3c74a6;}})[_0xb5ab('0x49')](function(_0x1f3d2d){logger[_0xb5ab('0x55')](_0xb5ab('0x56'),_0x1f3d2d);throw _0x1f3d2d;});}return _0x3c74a6;})['then'](respondWithResult(_0x4ff733,0xc9))[_0xb5ab('0x49')](handleError(_0x4ff733,null));};exports[_0xb5ab('0x26')]=function(_0x4d43f9,_0x2bc27b){if(_0x4d43f9[_0xb5ab('0x4f')]['id']){delete _0x4d43f9[_0xb5ab('0x4f')]['id'];}return db[_0xb5ab('0x31')]['find']({'where':{'id':_0x4d43f9['params']['id']}})[_0xb5ab('0x27')](handleEntityNotFound(_0x2bc27b,null))[_0xb5ab('0x27')](saveUpdates(_0x4d43f9[_0xb5ab('0x4f')],null))['then'](respondWithResult(_0x2bc27b,null))[_0xb5ab('0x49')](handleError(_0x2bc27b,null));};exports['destroy']=function(_0x92e00a,_0x4d2343){return db[_0xb5ab('0x31')][_0xb5ab('0x4d')]({'where':{'id':_0x92e00a[_0xb5ab('0x4b')]['id']}})[_0xb5ab('0x27')](handleEntityNotFound(_0x4d2343,null))[_0xb5ab('0x27')](removeEntity(_0x4d2343,null))[_0xb5ab('0x49')](handleError(_0x4d2343,null));};exports[_0xb5ab('0x57')]=function(_0x18fd9b,_0x45b63c){return db[_0xb5ab('0x31')]['describe']()[_0xb5ab('0x27')](respondWithResult(_0x45b63c,null))[_0xb5ab('0x49')](handleError(_0x45b63c,null));};exports[_0xb5ab('0x58')]=function(_0x2f60d5,_0x1cdec7,_0xa0397b){var _0x3c5271={'raw':!![],'where':{}},_0x5e8367={},_0x4b6684;return db[_0xb5ab('0x31')]['findOne']({'where':{'id':_0x2f60d5['params']['id']}})[_0xb5ab('0x27')](handleEntityNotFound(_0x1cdec7,null))[_0xb5ab('0x27')](function(_0x476386){if(_0x476386){_0x4b6684=_0x476386[_0xb5ab('0x28')]({'plain':!![]});_0x5e8367['model']=_[_0xb5ab('0x37')](db['UserMailQueue'][_0xb5ab('0x32')]);_0x5e8367[_0xb5ab('0x36')]=_[_0xb5ab('0x37')](_0x2f60d5[_0xb5ab('0x36')]);_0x5e8367['filters']=_['intersection'](_0x5e8367[_0xb5ab('0x35')],_0x5e8367[_0xb5ab('0x36')]);_0x3c5271[_0xb5ab('0x3a')]=_[_0xb5ab('0x39')](_0x5e8367[_0xb5ab('0x35')],qs[_0xb5ab('0x3b')](_0x2f60d5[_0xb5ab('0x36')]['fields']));_0x3c5271[_0xb5ab('0x3a')]=_0x3c5271[_0xb5ab('0x3a')]['length']?_0x3c5271[_0xb5ab('0x3a')]:_0x5e8367['model'];if(!_0x2f60d5[_0xb5ab('0x36')][_0xb5ab('0x3d')](_0xb5ab('0x3e'))){_0x3c5271[_0xb5ab('0x1f')]=qs[_0xb5ab('0x1f')](_0x2f60d5[_0xb5ab('0x36')][_0xb5ab('0x1f')]);_0x3c5271['offset']=qs[_0xb5ab('0x1e')](_0x2f60d5[_0xb5ab('0x36')][_0xb5ab('0x1e')]);}_0x3c5271[_0xb5ab('0x3f')]=qs[_0xb5ab('0x40')](_0x2f60d5[_0xb5ab('0x36')]['sort']);_0x3c5271[_0xb5ab('0x43')]=qs[_0xb5ab('0x38')](_[_0xb5ab('0x41')](_0x2f60d5['query'],_0x5e8367[_0xb5ab('0x38')]));_0x3c5271[_0xb5ab('0x43')][_0xb5ab('0x59')]=_0x476386['id'];if(_0x2f60d5[_0xb5ab('0x36')][_0xb5ab('0x42')]){_0x3c5271[_0xb5ab('0x43')]=_['merge'](_0x3c5271[_0xb5ab('0x43')],{'$or':_[_0xb5ab('0x30')](_0x3c5271[_0xb5ab('0x3a')],function(_0x2b2001){var _0x5e85cc={};_0x5e85cc[_0x2b2001]={'$like':'%'+_0x2f60d5[_0xb5ab('0x36')][_0xb5ab('0x42')]+'%'};return _0x5e85cc;})});}_0x3c5271=_[_0xb5ab('0x44')]({},_0x3c5271,_0x2f60d5[_0xb5ab('0x4c')]);return db[_0xb5ab('0x5a')][_0xb5ab('0x47')](_0x3c5271);}})[_0xb5ab('0x27')](function(_0x4a6621){if(_0x4a6621){return db['User'][_0xb5ab('0x5b')]({'where':{'id':_['map'](_0x4a6621,_0xb5ab('0x5c')),'role':_0xb5ab('0x5d')},'attributes':['id',_0xb5ab('0x2d'),'mailPause',_0xb5ab('0x5e'),_0xb5ab('0x5f')]});}})['then'](function(_0x3ecbc5){if(_0x3ecbc5){return{'count':_0x3ecbc5[_0xb5ab('0x60')],'rows':_['map'](_0x3ecbc5['rows'],function(_0x5094e5){return{'membername':_0x5094e5[_0xb5ab('0x2d')],'UserId':_0x5094e5['id'],'queue_name':_0x4b6684[_0xb5ab('0x2d')],'MailQueueId':_0x4b6684['id'],'interface':util[_0xb5ab('0x61')](_0xb5ab('0x62'),_0xb5ab('0x63'),_0x5094e5[_0xb5ab('0x2d')]),'penalty':0x0,'paused':_0x5094e5[_0xb5ab('0x64')],'createdAt':_0x5094e5[_0xb5ab('0x5f')],'updatedAt':_0x5094e5[_0xb5ab('0x5e')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x1cdec7,_0x3c5271))['catch'](handleError(_0x1cdec7,null));};exports[_0xb5ab('0x65')]=function(_0x59d128,_0x46ce73,_0xa1ce29){var _0x129134={};var _0x4b7c7f={};var _0x5f1f99;var _0xdf34d2;return db[_0xb5ab('0x31')]['findOne']({'where':{'id':_0x59d128[_0xb5ab('0x4b')]['id']}})['then'](handleEntityNotFound(_0x46ce73,null))[_0xb5ab('0x27')](function(_0x12351e){if(_0x12351e){_0x5f1f99=_0x12351e;_0x4b7c7f['model']=_[_0xb5ab('0x37')](db[_0xb5ab('0x66')][_0xb5ab('0x32')]);_0x4b7c7f[_0xb5ab('0x36')]=_[_0xb5ab('0x37')](_0x59d128[_0xb5ab('0x36')]);_0x4b7c7f[_0xb5ab('0x38')]=_[_0xb5ab('0x39')](_0x4b7c7f[_0xb5ab('0x35')],_0x4b7c7f['query']);_0x129134[_0xb5ab('0x3a')]=_[_0xb5ab('0x39')](_0x4b7c7f[_0xb5ab('0x35')],qs[_0xb5ab('0x3b')](_0x59d128['query']['fields']));_0x129134[_0xb5ab('0x3a')]=_0x129134[_0xb5ab('0x3a')]['length']?_0x129134[_0xb5ab('0x3a')]:_0x4b7c7f['model'];_0x129134['order']=qs['sort'](_0x59d128['query']['sort']);_0x129134[_0xb5ab('0x43')]=qs[_0xb5ab('0x38')](_[_0xb5ab('0x41')](_0x59d128[_0xb5ab('0x36')],_0x4b7c7f[_0xb5ab('0x38')]));if(_0x59d128[_0xb5ab('0x36')]['filter']){_0x129134[_0xb5ab('0x43')]=_[_0xb5ab('0x44')](_0x129134[_0xb5ab('0x43')],{'$or':_[_0xb5ab('0x30')](_0x129134[_0xb5ab('0x3a')],function(_0xda0c4a){var _0x2dbda6={};_0x2dbda6[_0xda0c4a]={'$like':'%'+_0x59d128['query'][_0xb5ab('0x42')]+'%'};return _0x2dbda6;})});}_0x129134=_[_0xb5ab('0x44')]({},_0x129134,_0x59d128[_0xb5ab('0x4c')]);return _0x5f1f99['getTeams'](_0x129134);}})[_0xb5ab('0x27')](function(_0x2aed50){if(_0x2aed50){_0xdf34d2=_0x2aed50[_0xb5ab('0x3c')];if(!_0x59d128[_0xb5ab('0x36')][_0xb5ab('0x3d')](_0xb5ab('0x3e'))){_0x129134[_0xb5ab('0x1f')]=qs[_0xb5ab('0x1f')](_0x59d128[_0xb5ab('0x36')]['limit']);_0x129134[_0xb5ab('0x1e')]=qs[_0xb5ab('0x1e')](_0x59d128[_0xb5ab('0x36')][_0xb5ab('0x1e')]);}return _0x5f1f99[_0xb5ab('0x65')](_0x129134);}})['then'](function(_0x26c0fd){if(_0x26c0fd){return _0x26c0fd?{'count':_0xdf34d2,'rows':_0x26c0fd}:null;}})['then'](respondWithResult(_0x46ce73,null))[_0xb5ab('0x49')](handleError(_0x46ce73,null));};exports[_0xb5ab('0x67')]=function(_0x2b06e8,_0x29c8f0,_0x4146e4){var _0x33564f=_0x2b06e8['body']['ids'];return db[_0xb5ab('0x66')][_0xb5ab('0x47')]({'where':{'id':_0x33564f},'attributes':['id'],'include':[{'model':db[_0xb5ab('0x68')],'as':_0xb5ab('0x69'),'attributes':['id',_0xb5ab('0x2d'),_0xb5ab('0x6a'),'voicePause',_0xb5ab('0x6b')],'raw':!![]}]})['then'](function(_0x28aec0){if(_0x28aec0){var _0x411ff7=_[_0xb5ab('0x6c')](_0x28aec0,function(_0x66dc1e){var _0x1c9e28=_0x66dc1e[_0xb5ab('0x28')]({'plain':!![]});return _0x1c9e28[_0xb5ab('0x69')];});return db[_0xb5ab('0x31')]['find']({'where':{'id':_0x2b06e8['params']['id']}})['then'](function(_0x258d27){return db[_0xb5ab('0x6d')][_0xb5ab('0x6e')](function(_0x21d34f){return _0x258d27['addTeams'](_0x33564f,{'transaction':_0x21d34f})[_0xb5ab('0x27')](function(){return BPromise['each'](_0x411ff7,function(_0x5bfcb7){return db[_0xb5ab('0x5a')]['findOrCreate']({'where':{'UserId':_0x5bfcb7['id'],'MailQueueId':_0x2b06e8[_0xb5ab('0x4b')]['id']},'transaction':_0x21d34f});});})[_0xb5ab('0x27')](function(){_0x411ff7[_0xb5ab('0x6f')](function(_0x3de1e8){socket[_0xb5ab('0x70')](_0xb5ab('0x71'),{'UserId':_0x3de1e8['id'],'MailQueueId':_0x258d27['id']});});});});});}})['then'](respondWithStatusCode(_0x29c8f0,null))[_0xb5ab('0x49')](handleError(_0x29c8f0,null));};exports[_0xb5ab('0x72')]=function(_0x2774c6,_0x53f900,_0x5d1f54){return db['Team'][_0xb5ab('0x47')]({'where':{'id':_0x2774c6[_0xb5ab('0x36')][_0xb5ab('0x73')]},'attributes':['id'],'include':[{'model':db[_0xb5ab('0x68')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0xb5ab('0x27')](handleEntityNotFound(_0x53f900,null))['then'](function(_0x318890){var _0x1ed38b=_[_0xb5ab('0x30')](_0x318890,'id');var _0x1f3f8f=[];var _0x5775f3=[];var _0x36714d=squel['select']();_0x36714d[_0xb5ab('0x74')]('tq.TeamId')[_0xb5ab('0x75')]('team_has_mail_queues','tq')[_0xb5ab('0x76')](_0xb5ab('0x77'),'ut',_0xb5ab('0x78'))['where'](_0xb5ab('0x79'),_0x2774c6['params']['id']);for(var _0x1a2890=0x0;_0x1a2890<_0x318890[_0xb5ab('0x3c')];_0x1a2890+=0x1){let _0x325bf2=_0x318890[_0x1a2890];for(var _0x3009d8=0x0;_0x3009d8<_0x325bf2[_0xb5ab('0x69')][_0xb5ab('0x3c')];_0x3009d8+=0x1){let _0x29cb8f=_0x325bf2[_0xb5ab('0x69')][_0x3009d8];var _0x5bec17=_0x36714d[_0xb5ab('0x7a')]();_0x5bec17[_0xb5ab('0x43')](_0xb5ab('0x7b'),_0x29cb8f['id']);_0x5775f3[_0xb5ab('0x7c')](db[_0xb5ab('0x6d')][_0xb5ab('0x36')](_0x5bec17['toString'](),{'type':db[_0xb5ab('0x6d')][_0xb5ab('0x7d')][_0xb5ab('0x7e')]})['then'](function(_0x2f954c){if(_0x2f954c[_0xb5ab('0x3c')]===0x1){return _0x29cb8f['id'];}else{var _0x5c734d=_[_0xb5ab('0x7f')](_['map'](_0x2f954c,_0xb5ab('0x80')),function(_0x2d5ad3){return _[_0xb5ab('0x81')](_0x1ed38b,_0x2d5ad3);});if(_0x5c734d){return _0x29cb8f['id'];}}}));}}return BPromise[_0xb5ab('0x82')](_0x5775f3)[_0xb5ab('0x27')](function(_0x598d93){_0x1f3f8f=_(_0x1f3f8f)[_0xb5ab('0x83')](_0x598d93)['compact']()['value']();return db[_0xb5ab('0x31')][_0xb5ab('0x4d')]({'where':{'id':_0x2774c6[_0xb5ab('0x4b')]['id']}})['then'](function(_0xffb9db){return db[_0xb5ab('0x6d')][_0xb5ab('0x6e')](function(_0x2f995a){return _0xffb9db[_0xb5ab('0x72')](_0x2774c6[_0xb5ab('0x36')][_0xb5ab('0x73')],{'transaction':_0x2f995a})['then'](function(){if(!_[_0xb5ab('0x84')](_0x1f3f8f)){return _0xffb9db[_0xb5ab('0x85')](_0x1f3f8f,{'transaction':_0x2f995a});}})[_0xb5ab('0x27')](function(){_0x1f3f8f[_0xb5ab('0x6f')](function(_0x2337f6){socket[_0xb5ab('0x70')](_0xb5ab('0x86'),{'UserId':_0x2337f6,'MailQueueId':_0xffb9db['id']});});});});});});})[_0xb5ab('0x27')](respondWithStatusCode(_0x53f900,null))['catch'](handleError(_0x53f900,null));};exports[_0xb5ab('0x87')]=function(_0x26cf2a,_0x2da65c,_0x4a4a93){return db[_0xb5ab('0x31')][_0xb5ab('0x4d')]({'where':{'id':_0x26cf2a[_0xb5ab('0x4b')]['id']}})[_0xb5ab('0x27')](handleEntityNotFound(_0x2da65c,null))[_0xb5ab('0x27')](function(_0x314cbc){if(_0x314cbc){return _0x314cbc[_0xb5ab('0x87')](_0x26cf2a[_0xb5ab('0x4f')][_0xb5ab('0x73')],_['omit'](_0x26cf2a[_0xb5ab('0x4f')],[_0xb5ab('0x73'),'id'])||{})[_0xb5ab('0x88')](function(_0x45780f){for(var _0x398c56=0x0;_0x398c56<_0x26cf2a[_0xb5ab('0x4f')][_0xb5ab('0x73')][_0xb5ab('0x3c')];_0x398c56+=0x1){socket['emit'](_0xb5ab('0x71'),{'UserId':_0x26cf2a[_0xb5ab('0x4f')][_0xb5ab('0x73')][_0x398c56],'MailQueueId':_0x26cf2a[_0xb5ab('0x4b')]['id']});}return _0x45780f;});}})['then'](respondWithResult(_0x2da65c,null))[_0xb5ab('0x49')](handleError(_0x2da65c,null));};exports[_0xb5ab('0x85')]=function(_0x375ac9,_0xa2c8dd,_0x401fb7){return db[_0xb5ab('0x31')][_0xb5ab('0x4d')]({'where':{'id':_0x375ac9[_0xb5ab('0x4b')]['id']}})['then'](handleEntityNotFound(_0xa2c8dd,null))['then'](function(_0xc043aa){if(_0xc043aa){return _0xc043aa[_0xb5ab('0x85')](_0x375ac9[_0xb5ab('0x36')]['ids'])['then'](function(){if(_[_0xb5ab('0x89')](_0x375ac9[_0xb5ab('0x36')][_0xb5ab('0x73')])){for(var _0x1d74ab=0x0;_0x1d74ab<_0x375ac9[_0xb5ab('0x36')]['ids'][_0xb5ab('0x3c')];_0x1d74ab+=0x1){socket[_0xb5ab('0x70')]('userMailQueue:remove',{'UserId':Number(_0x375ac9[_0xb5ab('0x36')][_0xb5ab('0x73')][_0x1d74ab]),'MailQueueId':Number(_0x375ac9[_0xb5ab('0x4b')]['id'])});}}else{socket[_0xb5ab('0x70')](_0xb5ab('0x86'),{'UserId':Number(_0x375ac9[_0xb5ab('0x36')][_0xb5ab('0x73')]),'MailQueueId':Number(_0x375ac9[_0xb5ab('0x4b')]['id'])});}});}})[_0xb5ab('0x27')](respondWithStatusCode(_0xa2c8dd,null))['catch'](handleError(_0xa2c8dd,null));};exports[_0xb5ab('0x8a')]=function(_0x201732,_0x4b97a5,_0xe5ea46){var _0x225928={};var _0x43467e={};var _0x4fceda;var _0x2072a0;return db[_0xb5ab('0x31')][_0xb5ab('0x8b')]({'where':{'id':_0x201732[_0xb5ab('0x4b')]['id']}})[_0xb5ab('0x27')](handleEntityNotFound(_0x4b97a5,null))[_0xb5ab('0x27')](function(_0x4fff63){if(_0x4fff63){_0x4fceda=_0x4fff63;_0x43467e[_0xb5ab('0x35')]=_['keys'](db[_0xb5ab('0x68')]['rawAttributes']);_0x43467e[_0xb5ab('0x36')]=_[_0xb5ab('0x37')](_0x201732['query']);_0x43467e[_0xb5ab('0x38')]=_[_0xb5ab('0x39')](_0x43467e[_0xb5ab('0x35')],_0x43467e[_0xb5ab('0x36')]);_0x225928['attributes']=_[_0xb5ab('0x39')](_0x43467e[_0xb5ab('0x35')],qs['fields'](_0x201732['query'][_0xb5ab('0x3b')]));_0x225928[_0xb5ab('0x3a')]=_0x225928['attributes'][_0xb5ab('0x3c')]?_0x225928[_0xb5ab('0x3a')]:_0x43467e['model'];_0x225928[_0xb5ab('0x3f')]=qs[_0xb5ab('0x40')](_0x201732[_0xb5ab('0x36')]['sort']);_0x225928[_0xb5ab('0x43')]=qs['filters'](_[_0xb5ab('0x41')](_0x201732['query'],_0x43467e[_0xb5ab('0x38')]));if(_0x201732[_0xb5ab('0x36')][_0xb5ab('0x42')]){_0x225928[_0xb5ab('0x43')]=_[_0xb5ab('0x44')](_0x225928[_0xb5ab('0x43')],{'$or':_[_0xb5ab('0x30')](_0x225928[_0xb5ab('0x3a')],function(_0xebd3a8){var _0x3d2c9e={};_0x3d2c9e[_0xebd3a8]={'$like':'%'+_0x201732['query'][_0xb5ab('0x42')]+'%'};return _0x3d2c9e;})});}_0x225928=_['merge']({},_0x225928,_0x201732[_0xb5ab('0x4c')]);return _0x4fceda[_0xb5ab('0x8a')](_0x225928);}})[_0xb5ab('0x27')](function(_0x29f9e3){if(_0x29f9e3){_0x2072a0=_0x29f9e3[_0xb5ab('0x3c')];if(!_0x201732[_0xb5ab('0x36')][_0xb5ab('0x3d')](_0xb5ab('0x3e'))){_0x225928[_0xb5ab('0x1f')]=qs[_0xb5ab('0x1f')](_0x201732[_0xb5ab('0x36')][_0xb5ab('0x1f')]);_0x225928[_0xb5ab('0x1e')]=qs[_0xb5ab('0x1e')](_0x201732[_0xb5ab('0x36')]['offset']);}return _0x4fceda['getAgents'](_0x225928);}})[_0xb5ab('0x27')](function(_0x49ec9f){if(_0x49ec9f){return _0x49ec9f?{'count':_0x2072a0,'rows':_0x49ec9f}:null;}})['then'](respondWithResult(_0x4b97a5,null))[_0xb5ab('0x49')](handleError(_0x4b97a5,null));};
\ No newline at end of file
diff --git a/server/api/mailQueue/mailQueue.events.js b/server/api/mailQueue/mailQueue.events.js
index d2569fd..f73c986 100644
--- a/server/api/mailQueue/mailQueue.events.js
+++ b/server/api/mailQueue/mailQueue.events.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xe0ea=['events','MailQueue','setMaxListeners','update','emit','hasOwnProperty','hook','exports'];(function(_0x3f2b46,_0x5693e5){var _0x150488=function(_0x35aebf){while(--_0x35aebf){_0x3f2b46['push'](_0x3f2b46['shift']());}};_0x150488(++_0x5693e5);}(_0xe0ea,0x1d8));var _0xae0e=function(_0x86b2a6,_0x1e60ac){_0x86b2a6=_0x86b2a6-0x0;var _0x1c6dca=_0xe0ea[_0x86b2a6];return _0x1c6dca;};'use strict';var EventEmitter=require(_0xae0e('0x0'));var MailQueue=require('../../mysqldb')['db'][_0xae0e('0x1')];var MailQueueEvents=new EventEmitter();MailQueueEvents[_0xae0e('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xae0e('0x3'),'afterDestroy':'remove'};function emitEvent(_0x21f895){return function(_0x42e800,_0x4eb1cc,_0x5138cf){MailQueueEvents[_0xae0e('0x4')](_0x21f895+':'+_0x42e800['id'],_0x42e800);MailQueueEvents[_0xae0e('0x4')](_0x21f895,_0x42e800);_0x5138cf(null);};}for(var e in events){if(events[_0xae0e('0x5')](e)){var event=events[e];MailQueue[_0xae0e('0x6')](e,emitEvent(event));}}module[_0xae0e('0x7')]=MailQueueEvents;
\ No newline at end of file
+var _0x50f8=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','MailQueue','setMaxListeners','save'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x50f8,0x148));var _0x850f=function(_0x2ef0d4,_0x541da8){_0x2ef0d4=_0x2ef0d4-0x0;var _0x1ddf99=_0x50f8[_0x2ef0d4];return _0x1ddf99;};'use strict';var EventEmitter=require(_0x850f('0x0'));var MailQueue=require(_0x850f('0x1'))['db'][_0x850f('0x2')];var MailQueueEvents=new EventEmitter();MailQueueEvents[_0x850f('0x3')](0x0);var events={'afterCreate':_0x850f('0x4'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x31b3a9){return function(_0x5e7ed8,_0x14c76e,_0x34c565){MailQueueEvents['emit'](_0x31b3a9+':'+_0x5e7ed8['id'],_0x5e7ed8);MailQueueEvents[_0x850f('0x5')](_0x31b3a9,_0x5e7ed8);_0x34c565(null);};}for(var e in events){if(events[_0x850f('0x6')](e)){var event=events[e];MailQueue[_0x850f('0x7')](e,emitEvent(event));}}module[_0x850f('0x8')]=MailQueueEvents;
\ No newline at end of file
diff --git a/server/api/mailQueue/mailQueue.model.js b/server/api/mailQueue/mailQueue.model.js
index 687e34c..12e4d5b 100644
--- a/server/api/mailQueue/mailQueue.model.js
+++ b/server/api/mailQueue/mailQueue.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xbc0c=['util','../../config/logger','moment','request-promise','path','rimraf','../../config/environment','./mailQueue.attributes','exports','define','mail_queues','lodash'];(function(_0x17856a,_0x33ff65){var _0x5af2a5=function(_0x3e5f76){while(--_0x3e5f76){_0x17856a['push'](_0x17856a['shift']());}};_0x5af2a5(++_0x33ff65);}(_0xbc0c,0x77));var _0xcbc0=function(_0x2cd0b5,_0x2f6cc4){_0x2cd0b5=_0x2cd0b5-0x0;var _0x482cb3=_0xbc0c[_0x2cd0b5];return _0x482cb3;};'use strict';var _=require(_0xcbc0('0x0'));var util=require(_0xcbc0('0x1'));var logger=require(_0xcbc0('0x2'))('api');var moment=require(_0xcbc0('0x3'));var BPromise=require('bluebird');var rp=require(_0xcbc0('0x4'));var fs=require('fs');var path=require(_0xcbc0('0x5'));var rimraf=require(_0xcbc0('0x6'));var config=require(_0xcbc0('0x7'));var attributes=require(_0xcbc0('0x8'));module[_0xcbc0('0x9')]=function(_0xf15e08,_0x21dd11){return _0xf15e08[_0xcbc0('0xa')]('MailQueue',attributes,{'tableName':_0xcbc0('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x40dd=['util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./mailQueue.attributes','exports','define','MailQueue','mail_queues','lodash'];(function(_0x3b0731,_0xcf9925){var _0x4204d7=function(_0x635ac5){while(--_0x635ac5){_0x3b0731['push'](_0x3b0731['shift']());}};_0x4204d7(++_0xcf9925);}(_0x40dd,0x125));var _0xd40d=function(_0xc6be3a,_0x540e05){_0xc6be3a=_0xc6be3a-0x0;var _0x56a310=_0x40dd[_0xc6be3a];return _0x56a310;};'use strict';var _=require(_0xd40d('0x0'));var util=require(_0xd40d('0x1'));var logger=require(_0xd40d('0x2'))(_0xd40d('0x3'));var moment=require(_0xd40d('0x4'));var BPromise=require(_0xd40d('0x5'));var rp=require(_0xd40d('0x6'));var fs=require('fs');var path=require(_0xd40d('0x7'));var rimraf=require('rimraf');var config=require(_0xd40d('0x8'));var attributes=require(_0xd40d('0x9'));module[_0xd40d('0xa')]=function(_0x41e853,_0x30c2cf){return _0x41e853[_0xd40d('0xb')](_0xd40d('0xc'),attributes,{'tableName':_0xd40d('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/mailQueue/mailQueue.rpc.js b/server/api/mailQueue/mailQueue.rpc.js
index f1c2a28..7378b21 100644
--- a/server/api/mailQueue/mailQueue.rpc.js
+++ b/server/api/mailQueue/mailQueue.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xcddb=['attributes','limit','model','include','map','debug','ShowMailQueue','find','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','localhost','socket.io-emitter','./mailQueue.socket','register','request','then','info','MailQueue,\x20%s,\x20%s','MailQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','GetMailQueue','MailQueue','options','where'];(function(_0x1cb18a,_0x33167a){var _0x22442e=function(_0x46c611){while(--_0x46c611){_0x1cb18a['push'](_0x1cb18a['shift']());}};_0x22442e(++_0x33167a);}(_0xcddb,0xf2));var _0xbcdd=function(_0x42ef15,_0x1f0628){_0x42ef15=_0x42ef15-0x0;var _0x307503=_0xcddb[_0x42ef15];return _0x307503;};'use strict';var _=require(_0xbcdd('0x0'));var util=require(_0xbcdd('0x1'));var moment=require('moment');var BPromise=require(_0xbcdd('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xbcdd('0x3'));var db=require(_0xbcdd('0x4'))['db'];var utils=require(_0xbcdd('0x5'));var logger=require(_0xbcdd('0x6'))(_0xbcdd('0x7'));var config=require('../../config/environment');var jayson=require(_0xbcdd('0x8'));var client=jayson[_0xbcdd('0x9')][_0xbcdd('0xa')]({'port':0x232a});config[_0xbcdd('0xb')]=_['defaults'](config[_0xbcdd('0xb')],{'host':_0xbcdd('0xc'),'port':0x18eb});var socket=require(_0xbcdd('0xd'))(new Redis(config['redis']));require(_0xbcdd('0xe'))[_0xbcdd('0xf')](socket);function respondWithRpcPromise(_0x4e903a,_0x3b23cb,_0x39bbf6){return new BPromise(function(_0x35f219,_0x5c0b5f){return client[_0xbcdd('0x10')](_0x4e903a,_0x39bbf6)[_0xbcdd('0x11')](function(_0x2a5d95){logger[_0xbcdd('0x12')](_0xbcdd('0x13'),_0x3b23cb,'request\x20sent');logger['debug'](_0xbcdd('0x14'),_0x3b23cb,_0xbcdd('0x15'),JSON[_0xbcdd('0x16')](_0x2a5d95));if(_0x2a5d95[_0xbcdd('0x17')]){if(_0x2a5d95['error']['code']===0x1f4){logger[_0xbcdd('0x17')]('MailQueue,\x20%s,\x20%s',_0x3b23cb,_0x2a5d95['error'][_0xbcdd('0x18')]);return _0x5c0b5f(_0x2a5d95[_0xbcdd('0x17')][_0xbcdd('0x18')]);}logger[_0xbcdd('0x17')](_0xbcdd('0x13'),_0x3b23cb,_0x2a5d95[_0xbcdd('0x17')][_0xbcdd('0x18')]);return _0x35f219(_0x2a5d95[_0xbcdd('0x17')]['message']);}else{logger['info'](_0xbcdd('0x13'),_0x3b23cb,_0xbcdd('0x15'));_0x35f219(_0x2a5d95[_0xbcdd('0x19')][_0xbcdd('0x18')]);}})[_0xbcdd('0x1a')](function(_0x41bac8){logger[_0xbcdd('0x17')](_0xbcdd('0x13'),_0x3b23cb,_0x41bac8);_0x5c0b5f(_0x41bac8);});});}exports[_0xbcdd('0x1b')]=function(_0x50cfc0){var _0x312ca4=this;return new Promise(function(_0x5c194a,_0x27e5fa){return db[_0xbcdd('0x1c')]['findAll']({'raw':_0x50cfc0[_0xbcdd('0x1d')]?_0x50cfc0[_0xbcdd('0x1d')]['raw']===undefined?!![]:![]:!![],'where':_0x50cfc0[_0xbcdd('0x1d')]?_0x50cfc0[_0xbcdd('0x1d')][_0xbcdd('0x1e')]||null:null,'attributes':_0x50cfc0[_0xbcdd('0x1d')]?_0x50cfc0[_0xbcdd('0x1d')][_0xbcdd('0x1f')]||null:null,'limit':_0x50cfc0[_0xbcdd('0x1d')]?_0x50cfc0['options'][_0xbcdd('0x20')]||null:null,'include':_0x50cfc0[_0xbcdd('0x1d')]?_0x50cfc0[_0xbcdd('0x1d')]['include']?_['map'](_0x50cfc0['options']['include'],function(_0x52e44b){return{'model':db[_0x52e44b[_0xbcdd('0x21')]],'as':_0x52e44b['as'],'attributes':_0x52e44b[_0xbcdd('0x1f')],'include':_0x52e44b['include']?_['map'](_0x52e44b[_0xbcdd('0x22')],function(_0xffc147){return{'model':db[_0xffc147[_0xbcdd('0x21')]],'as':_0xffc147['as'],'attributes':_0xffc147[_0xbcdd('0x1f')],'include':_0xffc147[_0xbcdd('0x22')]?_[_0xbcdd('0x23')](_0xffc147[_0xbcdd('0x22')],function(_0x2fcad4){return{'model':db[_0x2fcad4[_0xbcdd('0x21')]],'as':_0x2fcad4['as'],'attributes':_0x2fcad4[_0xbcdd('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xbcdd('0x11')](function(_0xa1452e){logger['info'](_0xbcdd('0x1b'),_0x50cfc0);logger[_0xbcdd('0x24')](_0xbcdd('0x1b'),_0x50cfc0,JSON[_0xbcdd('0x16')](_0xa1452e));_0x5c194a(_0xa1452e);})['catch'](function(_0x240162){logger['error'](_0xbcdd('0x1b'),_0x240162[_0xbcdd('0x18')],_0x50cfc0);_0x27e5fa(_0x312ca4[_0xbcdd('0x17')](0x1f4,_0x240162[_0xbcdd('0x18')]));});});};exports[_0xbcdd('0x25')]=function(_0x55d453){var _0x90a442=this;return new Promise(function(_0x3f5133,_0x49bff6){return db[_0xbcdd('0x1c')][_0xbcdd('0x26')]({'raw':_0x55d453[_0xbcdd('0x1d')]?_0x55d453[_0xbcdd('0x1d')]['raw']===undefined?!![]:![]:!![],'where':_0x55d453[_0xbcdd('0x1d')]?_0x55d453[_0xbcdd('0x1d')][_0xbcdd('0x1e')]||null:null,'attributes':_0x55d453[_0xbcdd('0x1d')]?_0x55d453[_0xbcdd('0x1d')][_0xbcdd('0x1f')]||null:null,'include':_0x55d453[_0xbcdd('0x1d')]?_0x55d453[_0xbcdd('0x1d')][_0xbcdd('0x22')]?_[_0xbcdd('0x23')](_0x55d453[_0xbcdd('0x1d')][_0xbcdd('0x22')],function(_0x5a8b54){return{'model':db[_0x5a8b54[_0xbcdd('0x21')]],'as':_0x5a8b54['as'],'attributes':_0x5a8b54[_0xbcdd('0x1f')],'include':_0x5a8b54[_0xbcdd('0x22')]?_[_0xbcdd('0x23')](_0x5a8b54[_0xbcdd('0x22')],function(_0x8e5a7f){return{'model':db[_0x8e5a7f['model']],'as':_0x8e5a7f['as'],'attributes':_0x8e5a7f['attributes'],'include':_0x8e5a7f[_0xbcdd('0x22')]?_['map'](_0x8e5a7f[_0xbcdd('0x22')],function(_0xb04861){return{'model':db[_0xb04861[_0xbcdd('0x21')]],'as':_0xb04861['as'],'attributes':_0xb04861['attributes']};}):[]};}):[]};}):[]:[]})[_0xbcdd('0x11')](function(_0x3adc7c){logger[_0xbcdd('0x12')](_0xbcdd('0x25'),_0x55d453);logger[_0xbcdd('0x24')]('ShowMailQueue',_0x55d453,JSON['stringify'](_0x3adc7c));_0x3f5133(_0x3adc7c);})[_0xbcdd('0x1a')](function(_0x54825b){logger[_0xbcdd('0x17')]('ShowMailQueue',_0x54825b[_0xbcdd('0x18')],_0x55d453);_0x49bff6(_0x90a442['error'](0x1f4,_0x54825b[_0xbcdd('0x18')]));});});};
\ No newline at end of file
+var _0xe514=['raw','where','limit','include','map','attributes','model','debug','stringify','GetMailQueue','ShowMailQueue','find','info','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','./mailQueue.socket','register','then','request\x20sent','MailQueue,\x20%s,\x20%s,\x20%s','error','code','MailQueue,\x20%s,\x20%s','message','result','catch','MailQueue','findAll','options'];(function(_0x2dadb9,_0x42cfe6){var _0x2f0097=function(_0x21163f){while(--_0x21163f){_0x2dadb9['push'](_0x2dadb9['shift']());}};_0x2f0097(++_0x42cfe6);}(_0xe514,0x1bb));var _0x4e51=function(_0x264988,_0xf8c322){_0x264988=_0x264988-0x0;var _0x235bb8=_0xe514[_0x264988];return _0x235bb8;};'use strict';var _=require(_0x4e51('0x0'));var util=require(_0x4e51('0x1'));var moment=require(_0x4e51('0x2'));var BPromise=require(_0x4e51('0x3'));var rs=require(_0x4e51('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4e51('0x5'))['db'];var utils=require(_0x4e51('0x6'));var logger=require(_0x4e51('0x7'))(_0x4e51('0x8'));var config=require(_0x4e51('0x9'));var jayson=require(_0x4e51('0xa'));var client=jayson[_0x4e51('0xb')][_0x4e51('0xc')]({'port':0x232a});config[_0x4e51('0xd')]=_[_0x4e51('0xe')](config[_0x4e51('0xd')],{'host':'localhost','port':0x18eb});var socket=require(_0x4e51('0xf'))(new Redis(config[_0x4e51('0xd')]));require(_0x4e51('0x10'))[_0x4e51('0x11')](socket);function respondWithRpcPromise(_0x38b869,_0x4903c8,_0x294670){return new BPromise(function(_0x3ca812,_0x49c52e){return client['request'](_0x38b869,_0x294670)[_0x4e51('0x12')](function(_0x1deb32){logger['info']('MailQueue,\x20%s,\x20%s',_0x4903c8,_0x4e51('0x13'));logger['debug'](_0x4e51('0x14'),_0x4903c8,_0x4e51('0x13'),JSON['stringify'](_0x1deb32));if(_0x1deb32[_0x4e51('0x15')]){if(_0x1deb32[_0x4e51('0x15')][_0x4e51('0x16')]===0x1f4){logger[_0x4e51('0x15')](_0x4e51('0x17'),_0x4903c8,_0x1deb32['error']['message']);return _0x49c52e(_0x1deb32[_0x4e51('0x15')][_0x4e51('0x18')]);}logger[_0x4e51('0x15')](_0x4e51('0x17'),_0x4903c8,_0x1deb32[_0x4e51('0x15')][_0x4e51('0x18')]);return _0x3ca812(_0x1deb32[_0x4e51('0x15')][_0x4e51('0x18')]);}else{logger['info'](_0x4e51('0x17'),_0x4903c8,_0x4e51('0x13'));_0x3ca812(_0x1deb32[_0x4e51('0x19')][_0x4e51('0x18')]);}})[_0x4e51('0x1a')](function(_0x38c3f7){logger[_0x4e51('0x15')](_0x4e51('0x17'),_0x4903c8,_0x38c3f7);_0x49c52e(_0x38c3f7);});});}exports['GetMailQueue']=function(_0x2ea23c){var _0x1398fc=this;return new Promise(function(_0x2dcd26,_0x56899a){return db[_0x4e51('0x1b')][_0x4e51('0x1c')]({'raw':_0x2ea23c['options']?_0x2ea23c[_0x4e51('0x1d')][_0x4e51('0x1e')]===undefined?!![]:![]:!![],'where':_0x2ea23c['options']?_0x2ea23c[_0x4e51('0x1d')][_0x4e51('0x1f')]||null:null,'attributes':_0x2ea23c[_0x4e51('0x1d')]?_0x2ea23c['options']['attributes']||null:null,'limit':_0x2ea23c['options']?_0x2ea23c[_0x4e51('0x1d')][_0x4e51('0x20')]||null:null,'include':_0x2ea23c[_0x4e51('0x1d')]?_0x2ea23c[_0x4e51('0x1d')][_0x4e51('0x21')]?_[_0x4e51('0x22')](_0x2ea23c[_0x4e51('0x1d')]['include'],function(_0x275afa){return{'model':db[_0x275afa['model']],'as':_0x275afa['as'],'attributes':_0x275afa[_0x4e51('0x23')],'include':_0x275afa[_0x4e51('0x21')]?_[_0x4e51('0x22')](_0x275afa['include'],function(_0x3ae6d8){return{'model':db[_0x3ae6d8[_0x4e51('0x24')]],'as':_0x3ae6d8['as'],'attributes':_0x3ae6d8[_0x4e51('0x23')],'include':_0x3ae6d8[_0x4e51('0x21')]?_[_0x4e51('0x22')](_0x3ae6d8[_0x4e51('0x21')],function(_0x592459){return{'model':db[_0x592459[_0x4e51('0x24')]],'as':_0x592459['as'],'attributes':_0x592459[_0x4e51('0x23')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x397ab9){logger['info']('GetMailQueue',_0x2ea23c);logger[_0x4e51('0x25')]('GetMailQueue',_0x2ea23c,JSON[_0x4e51('0x26')](_0x397ab9));_0x2dcd26(_0x397ab9);})['catch'](function(_0xe575){logger[_0x4e51('0x15')](_0x4e51('0x27'),_0xe575[_0x4e51('0x18')],_0x2ea23c);_0x56899a(_0x1398fc[_0x4e51('0x15')](0x1f4,_0xe575[_0x4e51('0x18')]));});});};exports[_0x4e51('0x28')]=function(_0x4b0d30){var _0x47eae4=this;return new Promise(function(_0x270905,_0x34455f){return db['MailQueue'][_0x4e51('0x29')]({'raw':_0x4b0d30[_0x4e51('0x1d')]?_0x4b0d30[_0x4e51('0x1d')][_0x4e51('0x1e')]===undefined?!![]:![]:!![],'where':_0x4b0d30[_0x4e51('0x1d')]?_0x4b0d30[_0x4e51('0x1d')]['where']||null:null,'attributes':_0x4b0d30['options']?_0x4b0d30[_0x4e51('0x1d')]['attributes']||null:null,'include':_0x4b0d30[_0x4e51('0x1d')]?_0x4b0d30[_0x4e51('0x1d')][_0x4e51('0x21')]?_[_0x4e51('0x22')](_0x4b0d30['options'][_0x4e51('0x21')],function(_0x5a26dc){return{'model':db[_0x5a26dc[_0x4e51('0x24')]],'as':_0x5a26dc['as'],'attributes':_0x5a26dc['attributes'],'include':_0x5a26dc[_0x4e51('0x21')]?_[_0x4e51('0x22')](_0x5a26dc[_0x4e51('0x21')],function(_0x2f8813){return{'model':db[_0x2f8813[_0x4e51('0x24')]],'as':_0x2f8813['as'],'attributes':_0x2f8813['attributes'],'include':_0x2f8813[_0x4e51('0x21')]?_[_0x4e51('0x22')](_0x2f8813[_0x4e51('0x21')],function(_0x16af45){return{'model':db[_0x16af45[_0x4e51('0x24')]],'as':_0x16af45['as'],'attributes':_0x16af45[_0x4e51('0x23')]};}):[]};}):[]};}):[]:[]})[_0x4e51('0x12')](function(_0x2c41ae){logger[_0x4e51('0x2a')](_0x4e51('0x28'),_0x4b0d30);logger[_0x4e51('0x25')](_0x4e51('0x28'),_0x4b0d30,JSON['stringify'](_0x2c41ae));_0x270905(_0x2c41ae);})[_0x4e51('0x1a')](function(_0x12a332){logger[_0x4e51('0x15')](_0x4e51('0x28'),_0x12a332[_0x4e51('0x18')],_0x4b0d30);_0x34455f(_0x47eae4[_0x4e51('0x15')](0x1f4,_0x12a332['message']));});});};
\ No newline at end of file
diff --git a/server/api/mailQueue/mailQueue.socket.js b/server/api/mailQueue/mailQueue.socket.js
index 9b54cb6..aa399b3 100644
--- a/server/api/mailQueue/mailQueue.socket.js
+++ b/server/api/mailQueue/mailQueue.socket.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xbc78=['length','./mailQueue.events','save','remove','update','emit','removeListener'];(function(_0x4bbcc2,_0xa345ce){var _0x1cbc6a=function(_0x44a48e){while(--_0x44a48e){_0x4bbcc2['push'](_0x4bbcc2['shift']());}};_0x1cbc6a(++_0xa345ce);}(_0xbc78,0x78));var _0x8bc7=function(_0xfd1d77,_0x380480){_0xfd1d77=_0xfd1d77-0x0;var _0x3fcae9=_0xbc78[_0xfd1d77];return _0x3fcae9;};'use strict';var MailQueueEvents=require(_0x8bc7('0x0'));var events=[_0x8bc7('0x1'),_0x8bc7('0x2'),_0x8bc7('0x3')];function createListener(_0x303cb5,_0x210140){return function(_0x3aa408){_0x210140[_0x8bc7('0x4')](_0x303cb5,_0x3aa408);};}function removeListener(_0x17eb60,_0x13032a){return function(){MailQueueEvents[_0x8bc7('0x5')](_0x17eb60,_0x13032a);};}exports['register']=function(_0x5ee7f5){for(var _0x3e603c=0x0,_0x2e47a7=events[_0x8bc7('0x6')];_0x3e603c<_0x2e47a7;_0x3e603c++){var _0x3d2e2b=events[_0x3e603c];var _0x4b7681=createListener('mailQueue:'+_0x3d2e2b,_0x5ee7f5);MailQueueEvents['on'](_0x3d2e2b,_0x4b7681);}};
\ No newline at end of file
+var _0x7f03=['save','remove','removeListener','length','./mailQueue.events'];(function(_0x6bff44,_0x3ec9a3){var _0x30cdfb=function(_0x3dc708){while(--_0x3dc708){_0x6bff44['push'](_0x6bff44['shift']());}};_0x30cdfb(++_0x3ec9a3);}(_0x7f03,0x162));var _0x37f0=function(_0x3abe51,_0xacf6f1){_0x3abe51=_0x3abe51-0x0;var _0x1d231b=_0x7f03[_0x3abe51];return _0x1d231b;};'use strict';var MailQueueEvents=require(_0x37f0('0x0'));var events=[_0x37f0('0x1'),_0x37f0('0x2'),'update'];function createListener(_0x400586,_0x490c58){return function(_0x44e0b9){_0x490c58['emit'](_0x400586,_0x44e0b9);};}function removeListener(_0x2a383a,_0x2a850e){return function(){MailQueueEvents[_0x37f0('0x3')](_0x2a383a,_0x2a850e);};}exports['register']=function(_0x4851ed){for(var _0x40fd48=0x0,_0xef3ca3=events[_0x37f0('0x4')];_0x40fd48<_0xef3ca3;_0x40fd48++){var _0x325112=events[_0x40fd48];var _0x700a71=createListener('mailQueue:'+_0x325112,_0x4851ed);MailQueueEvents['on'](_0x325112,_0x700a71);}};
\ No newline at end of file
diff --git a/server/api/mailQueueReport/index.js b/server/api/mailQueueReport/index.js
index 3fffe88..a9cbbff 100644
--- a/server/api/mailQueueReport/index.js
+++ b/server/api/mailQueueReport/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xd8b3=['Router','../../components/auth/service','../../components/interaction/service','./mailQueueReport.controller','get','index','/describe','describe','/:id','isAuthenticated','create','put','destroy','exports','multer','util','path','connect-timeout','express'];(function(_0xfdf2ba,_0x55170f){var _0x4b13df=function(_0x3a202e){while(--_0x3a202e){_0xfdf2ba['push'](_0xfdf2ba['shift']());}};_0x4b13df(++_0x55170f);}(_0xd8b3,0x80));var _0x3d8b=function(_0x326e79,_0x33dc91){_0x326e79=_0x326e79-0x0;var _0x37eb89=_0xd8b3[_0x326e79];return _0x37eb89;};'use strict';var multer=require(_0x3d8b('0x0'));var util=require(_0x3d8b('0x1'));var path=require(_0x3d8b('0x2'));var timeout=require(_0x3d8b('0x3'));var express=require(_0x3d8b('0x4'));var router=express[_0x3d8b('0x5')]();var auth=require(_0x3d8b('0x6'));var interaction=require(_0x3d8b('0x7'));var config=require('../../config/environment');var controller=require(_0x3d8b('0x8'));router[_0x3d8b('0x9')]('/',auth['isAuthenticated'](),controller[_0x3d8b('0xa')]);router[_0x3d8b('0x9')](_0x3d8b('0xb'),auth['isAuthenticated'](),controller[_0x3d8b('0xc')]);router[_0x3d8b('0x9')](_0x3d8b('0xd'),auth[_0x3d8b('0xe')](),controller['show']);router['post']('/',auth[_0x3d8b('0xe')](),controller[_0x3d8b('0xf')]);router[_0x3d8b('0x10')](_0x3d8b('0xd'),auth[_0x3d8b('0xe')](),controller['update']);router['delete'](_0x3d8b('0xd'),auth[_0x3d8b('0xe')](),controller[_0x3d8b('0x11')]);module[_0x3d8b('0x12')]=router;
\ No newline at end of file
+var _0xb756=['../../components/auth/service','../../config/environment','./mailQueueReport.controller','isAuthenticated','index','get','/describe','describe','/:id','show','destroy','exports','multer','util','connect-timeout','Router'];(function(_0x510f3b,_0x2cd215){var _0x3d7ab2=function(_0x2ed6b1){while(--_0x2ed6b1){_0x510f3b['push'](_0x510f3b['shift']());}};_0x3d7ab2(++_0x2cd215);}(_0xb756,0x1ec));var _0x6b75=function(_0x260dc5,_0x1b9973){_0x260dc5=_0x260dc5-0x0;var _0x4f7186=_0xb756[_0x260dc5];return _0x4f7186;};'use strict';var multer=require(_0x6b75('0x0'));var util=require(_0x6b75('0x1'));var path=require('path');var timeout=require(_0x6b75('0x2'));var express=require('express');var router=express[_0x6b75('0x3')]();var auth=require(_0x6b75('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x6b75('0x5'));var controller=require(_0x6b75('0x6'));router['get']('/',auth[_0x6b75('0x7')](),controller[_0x6b75('0x8')]);router[_0x6b75('0x9')](_0x6b75('0xa'),auth[_0x6b75('0x7')](),controller[_0x6b75('0xb')]);router[_0x6b75('0x9')](_0x6b75('0xc'),auth[_0x6b75('0x7')](),controller[_0x6b75('0xd')]);router['post']('/',auth[_0x6b75('0x7')](),controller['create']);router['put'](_0x6b75('0xc'),auth[_0x6b75('0x7')](),controller['update']);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x6b75('0xe')]);module[_0x6b75('0xf')]=router;
\ No newline at end of file
diff --git a/server/api/mailQueueReport/mailQueueReport.attributes.js b/server/api/mailQueueReport/mailQueueReport.attributes.js
index de848ef..5a9235b 100644
--- a/server/api/mailQueueReport/mailQueueReport.attributes.js
+++ b/server/api/mailQueueReport/mailQueueReport.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xef81=['sequelize','STRING','DATE'];(function(_0x5a7fc6,_0x2836c7){var _0x4b97d9=function(_0x1e71e7){while(--_0x1e71e7){_0x5a7fc6['push'](_0x5a7fc6['shift']());}};_0x4b97d9(++_0x2836c7);}(_0xef81,0x1aa));var _0x1ef8=function(_0x136b54,_0x5f157e){_0x136b54=_0x136b54-0x0;var _0x143799=_0xef81[_0x136b54];return _0x143799;};'use strict';var moment=require('moment');var Sequelize=require(_0x1ef8('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0x1ef8('0x1')],'allowNull':![]},'from':{'type':Sequelize[_0x1ef8('0x1')]},'joinAt':{'type':Sequelize[_0x1ef8('0x2')]},'leaveAt':{'type':Sequelize[_0x1ef8('0x2')]},'acceptAt':{'type':Sequelize[_0x1ef8('0x2')]},'exitAt':{'type':Sequelize[_0x1ef8('0x2')]},'reason':{'type':Sequelize[_0x1ef8('0x1')]}};
\ No newline at end of file
+var _0x9ef9=['sequelize','STRING','DATE'];(function(_0x54eb53,_0xad1649){var _0x5793b3=function(_0x5a0ead){while(--_0x5a0ead){_0x54eb53['push'](_0x54eb53['shift']());}};_0x5793b3(++_0xad1649);}(_0x9ef9,0x1da));var _0x99ef=function(_0xd8fb7d,_0x25c1b0){_0xd8fb7d=_0xd8fb7d-0x0;var _0x1f4557=_0x9ef9[_0xd8fb7d];return _0x1f4557;};'use strict';var moment=require('moment');var Sequelize=require(_0x99ef('0x0'));module['exports']={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0x99ef('0x1')]},'joinAt':{'type':Sequelize[_0x99ef('0x2')]},'leaveAt':{'type':Sequelize[_0x99ef('0x2')]},'acceptAt':{'type':Sequelize[_0x99ef('0x2')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0x99ef('0x1')]}};
\ No newline at end of file
diff --git a/server/api/mailQueueReport/mailQueueReport.controller.js b/server/api/mailQueueReport/mailQueueReport.controller.js
index c0ac4c3..7adb1c5 100644
--- a/server/api/mailQueueReport/mailQueueReport.controller.js
+++ b/server/api/mailQueueReport/mailQueueReport.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xa8c4=['filter','merge','VIRTUAL','includeAll','include','catch','show','params','options','find','create','body','describe','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','apply','reject','update','destroy','then','error','stack','name','send','index','MailQueueReport','rawAttributes','type','map','keys','query','filters','intersection','model','attributes','fields','length','nolimit','order','sort','where','pick'];(function(_0x34021d,_0x753aa6){var _0x16597b=function(_0x2d040a){while(--_0x2d040a){_0x34021d['push'](_0x34021d['shift']());}};_0x16597b(++_0x753aa6);}(_0xa8c4,0x12d));var _0x4a8c=function(_0x274e82,_0x2b3e01){_0x274e82=_0x274e82-0x0;var _0x361183=_0xa8c4[_0x274e82];return _0x361183;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x4a8c('0x0'));var rimraf=require(_0x4a8c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4a8c('0x2'));var rp=require(_0x4a8c('0x3'));var moment=require('moment');var BPromise=require(_0x4a8c('0x4'));var Mustache=require(_0x4a8c('0x5'));var util=require(_0x4a8c('0x6'));var path=require(_0x4a8c('0x7'));var sox=require(_0x4a8c('0x8'));var csv=require(_0x4a8c('0x9'));var ejs=require(_0x4a8c('0xa'));var fs=require('fs');var _=require(_0x4a8c('0xb'));var squel=require(_0x4a8c('0xc'));var crypto=require(_0x4a8c('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x4a8c('0xe'));var toCsv=require(_0x4a8c('0x9'));var querystring=require(_0x4a8c('0xf'));var Papa=require(_0x4a8c('0x10'));var Redis=require(_0x4a8c('0x11'));var authService=require(_0x4a8c('0x12'));var qs=require(_0x4a8c('0x13'));var as=require(_0x4a8c('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x4a8c('0x15'))('api');var utils=require('../../config/utils');var config=require(_0x4a8c('0x16'));var db=require(_0x4a8c('0x17'))['db'];function respondWithStatusCode(_0x199127,_0xead7f8){_0xead7f8=_0xead7f8||0xcc;return function(_0x43104d){if(_0x43104d){return _0x199127[_0x4a8c('0x18')](_0xead7f8);}return _0x199127[_0x4a8c('0x19')](_0xead7f8)[_0x4a8c('0x1a')]();};}function respondWithResult(_0x41ddfa,_0x5873c3){_0x5873c3=_0x5873c3||0xc8;return function(_0x3b245e){if(_0x3b245e){return _0x41ddfa[_0x4a8c('0x19')](_0x5873c3)[_0x4a8c('0x1b')](_0x3b245e);}};}function respondWithFilteredResult(_0x809aa1,_0x28b2d1){return function(_0x2b53ab){if(_0x2b53ab){var _0x1b6428=_0x2b53ab[_0x4a8c('0x1c')],_0x6da391=_0x28b2d1['offset'],_0x53d2f6=_0x28b2d1[_0x4a8c('0x1d')]+_0x28b2d1[_0x4a8c('0x1e')],_0x2b84fb;if(_0x53d2f6>=_0x1b6428){_0x53d2f6=_0x1b6428;_0x2b84fb=0xc8;}else{_0x2b84fb=0xce;}_0x809aa1[_0x4a8c('0x19')](_0x2b84fb);return _0x809aa1[_0x4a8c('0x1f')]('Content-Range',_0x6da391+'-'+_0x53d2f6+'/'+_0x1b6428)['json'](_0x2b53ab);}return null;};}function patchUpdates(_0x3d1ccf){return function(_0x436c03){try{jsonpatch[_0x4a8c('0x20')](_0x436c03,_0x3d1ccf,!![]);}catch(_0x255cbb){return BPromise[_0x4a8c('0x21')](_0x255cbb);}return _0x436c03['save']();};}function saveUpdates(_0x11a8d5,_0x558940){return function(_0x24953a){if(_0x24953a){return _0x24953a[_0x4a8c('0x22')](_0x11a8d5)['then'](function(_0x44da5e){return _0x44da5e;});}return null;};}function removeEntity(_0x1cb460,_0x25a54f){return function(_0xfd41a9){if(_0xfd41a9){return _0xfd41a9[_0x4a8c('0x23')]()[_0x4a8c('0x24')](function(){_0x1cb460['status'](0xcc)[_0x4a8c('0x1a')]();});}};}function handleEntityNotFound(_0x29469b,_0x5937dd){return function(_0x31b910){if(!_0x31b910){_0x29469b[_0x4a8c('0x18')](0x194);}return _0x31b910;};}function handleError(_0x34ebc2,_0x3a049f){_0x3a049f=_0x3a049f||0x1f4;return function(_0x53bb24){logger[_0x4a8c('0x25')](_0x53bb24[_0x4a8c('0x26')]);if(_0x53bb24[_0x4a8c('0x27')]){delete _0x53bb24[_0x4a8c('0x27')];}_0x34ebc2[_0x4a8c('0x19')](_0x3a049f)[_0x4a8c('0x28')](_0x53bb24);};}exports[_0x4a8c('0x29')]=function(_0x56c385,_0x191496){var _0x2db997={},_0x486066={},_0x4a66c8={'count':0x0,'rows':[]};var _0x438a12=_['map'](db[_0x4a8c('0x2a')][_0x4a8c('0x2b')],function(_0x98ada4){return{'name':_0x98ada4['fieldName'],'type':_0x98ada4[_0x4a8c('0x2c')]['key']};});_0x486066['model']=_[_0x4a8c('0x2d')](_0x438a12,_0x4a8c('0x27'));_0x486066['query']=_[_0x4a8c('0x2e')](_0x56c385[_0x4a8c('0x2f')]);_0x486066[_0x4a8c('0x30')]=_[_0x4a8c('0x31')](_0x486066[_0x4a8c('0x32')],_0x486066[_0x4a8c('0x2f')]);_0x2db997[_0x4a8c('0x33')]=_[_0x4a8c('0x31')](_0x486066[_0x4a8c('0x32')],qs[_0x4a8c('0x34')](_0x56c385[_0x4a8c('0x2f')]['fields']));_0x2db997[_0x4a8c('0x33')]=_0x2db997['attributes'][_0x4a8c('0x35')]?_0x2db997[_0x4a8c('0x33')]:_0x486066['model'];if(!_0x56c385['query']['hasOwnProperty'](_0x4a8c('0x36'))){_0x2db997[_0x4a8c('0x1e')]=qs[_0x4a8c('0x1e')](_0x56c385['query'][_0x4a8c('0x1e')]);_0x2db997[_0x4a8c('0x1d')]=qs[_0x4a8c('0x1d')](_0x56c385[_0x4a8c('0x2f')][_0x4a8c('0x1d')]);}_0x2db997[_0x4a8c('0x37')]=qs[_0x4a8c('0x38')](_0x56c385[_0x4a8c('0x2f')][_0x4a8c('0x38')]);_0x2db997[_0x4a8c('0x39')]=qs[_0x4a8c('0x30')](_[_0x4a8c('0x3a')](_0x56c385[_0x4a8c('0x2f')],_0x486066['filters']),_0x438a12);if(_0x56c385['query'][_0x4a8c('0x3b')]){_0x2db997[_0x4a8c('0x39')]=_[_0x4a8c('0x3c')](_0x2db997[_0x4a8c('0x39')],{'$or':_[_0x4a8c('0x2d')](_0x438a12,function(_0x3c643){if(_0x3c643[_0x4a8c('0x2c')]!==_0x4a8c('0x3d')){var _0x4d287e={};_0x4d287e[_0x3c643[_0x4a8c('0x27')]]={'$like':'%'+_0x56c385['query']['filter']+'%'};return _0x4d287e;}})});}_0x2db997=_['merge']({},_0x2db997,_0x56c385['options']);var _0x31eb82={'where':_0x2db997['where']};return db[_0x4a8c('0x2a')][_0x4a8c('0x1c')](_0x31eb82)[_0x4a8c('0x24')](function(_0x201d71){_0x4a66c8['count']=_0x201d71;if(_0x56c385['query'][_0x4a8c('0x3e')]){_0x2db997[_0x4a8c('0x3f')]=[{'all':!![]}];}return db[_0x4a8c('0x2a')]['findAll'](_0x2db997);})['then'](function(_0x1dc2cb){_0x4a66c8['rows']=_0x1dc2cb;return _0x4a66c8;})[_0x4a8c('0x24')](respondWithFilteredResult(_0x191496,_0x2db997))[_0x4a8c('0x40')](handleError(_0x191496,null));};exports[_0x4a8c('0x41')]=function(_0x3f8cda,_0x24e80d){var _0x38028a={'raw':!![],'where':{'id':_0x3f8cda[_0x4a8c('0x42')]['id']}},_0xc4f6e2={};_0xc4f6e2[_0x4a8c('0x32')]=_['keys'](db[_0x4a8c('0x2a')]['rawAttributes']);_0xc4f6e2[_0x4a8c('0x2f')]=_[_0x4a8c('0x2e')](_0x3f8cda[_0x4a8c('0x2f')]);_0xc4f6e2[_0x4a8c('0x30')]=_[_0x4a8c('0x31')](_0xc4f6e2[_0x4a8c('0x32')],_0xc4f6e2['query']);_0x38028a['attributes']=_[_0x4a8c('0x31')](_0xc4f6e2[_0x4a8c('0x32')],qs[_0x4a8c('0x34')](_0x3f8cda[_0x4a8c('0x2f')][_0x4a8c('0x34')]));_0x38028a[_0x4a8c('0x33')]=_0x38028a[_0x4a8c('0x33')][_0x4a8c('0x35')]?_0x38028a[_0x4a8c('0x33')]:_0xc4f6e2[_0x4a8c('0x32')];if(_0x3f8cda[_0x4a8c('0x2f')][_0x4a8c('0x3e')]){_0x38028a['include']=[{'all':!![]}];}_0x38028a=_[_0x4a8c('0x3c')]({},_0x38028a,_0x3f8cda[_0x4a8c('0x43')]);return db[_0x4a8c('0x2a')][_0x4a8c('0x44')](_0x38028a)[_0x4a8c('0x24')](handleEntityNotFound(_0x24e80d,null))['then'](respondWithResult(_0x24e80d,null))[_0x4a8c('0x40')](handleError(_0x24e80d,null));};exports[_0x4a8c('0x45')]=function(_0x77fcee,_0x31f80a){return db[_0x4a8c('0x2a')][_0x4a8c('0x45')](_0x77fcee[_0x4a8c('0x46')],{})[_0x4a8c('0x24')](respondWithResult(_0x31f80a,0xc9))['catch'](handleError(_0x31f80a,null));};exports[_0x4a8c('0x22')]=function(_0x49fdb2,_0x3044fb){if(_0x49fdb2[_0x4a8c('0x46')]['id']){delete _0x49fdb2['body']['id'];}return db[_0x4a8c('0x2a')][_0x4a8c('0x44')]({'where':{'id':_0x49fdb2['params']['id']}})[_0x4a8c('0x24')](handleEntityNotFound(_0x3044fb,null))[_0x4a8c('0x24')](saveUpdates(_0x49fdb2[_0x4a8c('0x46')],null))[_0x4a8c('0x24')](respondWithResult(_0x3044fb,null))[_0x4a8c('0x40')](handleError(_0x3044fb,null));};exports['destroy']=function(_0x24bebc,_0x3df53b){return db[_0x4a8c('0x2a')][_0x4a8c('0x44')]({'where':{'id':_0x24bebc[_0x4a8c('0x42')]['id']}})['then'](handleEntityNotFound(_0x3df53b,null))[_0x4a8c('0x24')](removeEntity(_0x3df53b,null))[_0x4a8c('0x40')](handleError(_0x3df53b,null));};exports['describe']=function(_0x3e3a2e,_0x47c675){return db[_0x4a8c('0x2a')][_0x4a8c('0x47')]()[_0x4a8c('0x24')](respondWithResult(_0x47c675,null))[_0x4a8c('0x40')](handleError(_0x47c675,null));};
\ No newline at end of file
+var _0xe526=['../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','save','update','then','destroy','end','error','stack','name','index','map','MailQueueReport','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','nolimit','sort','pick','where','filter','merge','options','includeAll','findAll','rows','catch','show','params','rawAttributes','find','create','body','html-pdf','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','path','ejs','lodash','squel','desk.js','to-csv','querystring','papaparse','../../components/auth/service'];(function(_0x487a0b,_0x33c302){var _0x4cb1ba=function(_0x2a3615){while(--_0x2a3615){_0x487a0b['push'](_0x487a0b['shift']());}};_0x4cb1ba(++_0x33c302);}(_0xe526,0x103));var _0x6e52=function(_0x499a83,_0x14823f){_0x499a83=_0x499a83-0x0;var _0xcd5797=_0xe526[_0x499a83];return _0xcd5797;};'use strict';var pdf=require(_0x6e52('0x0'));var emlformat=require(_0x6e52('0x1'));var rimraf=require(_0x6e52('0x2'));var zipdir=require(_0x6e52('0x3'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x6e52('0x4'));var BPromise=require(_0x6e52('0x5'));var Mustache=require(_0x6e52('0x6'));var util=require(_0x6e52('0x7'));var path=require(_0x6e52('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x6e52('0x9'));var fs=require('fs');var _=require(_0x6e52('0xa'));var squel=require(_0x6e52('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x6e52('0xc'));var toCsv=require(_0x6e52('0xd'));var querystring=require(_0x6e52('0xe'));var Papa=require(_0x6e52('0xf'));var Redis=require('ioredis');var authService=require(_0x6e52('0x10'));var qs=require(_0x6e52('0x11'));var as=require(_0x6e52('0x12'));var hardwareService=require(_0x6e52('0x13'));var logger=require('../../config/logger')(_0x6e52('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x56405a,_0x50bf85){_0x50bf85=_0x50bf85||0xcc;return function(_0x25d9a5){if(_0x25d9a5){return _0x56405a[_0x6e52('0x15')](_0x50bf85);}return _0x56405a[_0x6e52('0x16')](_0x50bf85)['end']();};}function respondWithResult(_0x1037c8,_0x466cda){_0x466cda=_0x466cda||0xc8;return function(_0x226331){if(_0x226331){return _0x1037c8[_0x6e52('0x16')](_0x466cda)[_0x6e52('0x17')](_0x226331);}};}function respondWithFilteredResult(_0x3deec3,_0x4cc4ed){return function(_0x3b26d3){if(_0x3b26d3){var _0xe31a00=_0x3b26d3[_0x6e52('0x18')],_0x325daa=_0x4cc4ed['offset'],_0x3cd299=_0x4cc4ed[_0x6e52('0x19')]+_0x4cc4ed[_0x6e52('0x1a')],_0x103dc4;if(_0x3cd299>=_0xe31a00){_0x3cd299=_0xe31a00;_0x103dc4=0xc8;}else{_0x103dc4=0xce;}_0x3deec3['status'](_0x103dc4);return _0x3deec3[_0x6e52('0x1b')](_0x6e52('0x1c'),_0x325daa+'-'+_0x3cd299+'/'+_0xe31a00)['json'](_0x3b26d3);}return null;};}function patchUpdates(_0x14f98f){return function(_0x38f7aa){try{jsonpatch[_0x6e52('0x1d')](_0x38f7aa,_0x14f98f,!![]);}catch(_0x30b819){return BPromise['reject'](_0x30b819);}return _0x38f7aa[_0x6e52('0x1e')]();};}function saveUpdates(_0x563864,_0x35efd6){return function(_0x3297fa){if(_0x3297fa){return _0x3297fa[_0x6e52('0x1f')](_0x563864)[_0x6e52('0x20')](function(_0x3ac54d){return _0x3ac54d;});}return null;};}function removeEntity(_0x4fd886,_0x3231f7){return function(_0xda17cc){if(_0xda17cc){return _0xda17cc[_0x6e52('0x21')]()[_0x6e52('0x20')](function(){_0x4fd886[_0x6e52('0x16')](0xcc)[_0x6e52('0x22')]();});}};}function handleEntityNotFound(_0x2e6236,_0x267363){return function(_0x37a5bd){if(!_0x37a5bd){_0x2e6236[_0x6e52('0x15')](0x194);}return _0x37a5bd;};}function handleError(_0x5d67e5,_0x11ab23){_0x11ab23=_0x11ab23||0x1f4;return function(_0x9ed94c){logger[_0x6e52('0x23')](_0x9ed94c[_0x6e52('0x24')]);if(_0x9ed94c[_0x6e52('0x25')]){delete _0x9ed94c[_0x6e52('0x25')];}_0x5d67e5[_0x6e52('0x16')](_0x11ab23)['send'](_0x9ed94c);};}exports[_0x6e52('0x26')]=function(_0x2ae4ee,_0x2f3ca4){var _0x16ccbc={},_0x215834={},_0x5ccc47={'count':0x0,'rows':[]};var _0x4f69fb=_[_0x6e52('0x27')](db[_0x6e52('0x28')]['rawAttributes'],function(_0x37d610){return{'name':_0x37d610[_0x6e52('0x29')],'type':_0x37d610[_0x6e52('0x2a')][_0x6e52('0x2b')]};});_0x215834[_0x6e52('0x2c')]=_[_0x6e52('0x27')](_0x4f69fb,_0x6e52('0x25'));_0x215834[_0x6e52('0x2d')]=_[_0x6e52('0x2e')](_0x2ae4ee['query']);_0x215834[_0x6e52('0x2f')]=_['intersection'](_0x215834[_0x6e52('0x2c')],_0x215834['query']);_0x16ccbc[_0x6e52('0x30')]=_[_0x6e52('0x31')](_0x215834['model'],qs[_0x6e52('0x32')](_0x2ae4ee[_0x6e52('0x2d')][_0x6e52('0x32')]));_0x16ccbc[_0x6e52('0x30')]=_0x16ccbc[_0x6e52('0x30')][_0x6e52('0x33')]?_0x16ccbc[_0x6e52('0x30')]:_0x215834['model'];if(!_0x2ae4ee[_0x6e52('0x2d')]['hasOwnProperty'](_0x6e52('0x34'))){_0x16ccbc[_0x6e52('0x1a')]=qs['limit'](_0x2ae4ee['query']['limit']);_0x16ccbc[_0x6e52('0x19')]=qs[_0x6e52('0x19')](_0x2ae4ee[_0x6e52('0x2d')][_0x6e52('0x19')]);}_0x16ccbc['order']=qs[_0x6e52('0x35')](_0x2ae4ee[_0x6e52('0x2d')][_0x6e52('0x35')]);_0x16ccbc['where']=qs[_0x6e52('0x2f')](_[_0x6e52('0x36')](_0x2ae4ee[_0x6e52('0x2d')],_0x215834['filters']),_0x4f69fb);if(_0x2ae4ee[_0x6e52('0x2d')]['filter']){_0x16ccbc[_0x6e52('0x37')]=_['merge'](_0x16ccbc[_0x6e52('0x37')],{'$or':_[_0x6e52('0x27')](_0x4f69fb,function(_0x17365c){if(_0x17365c[_0x6e52('0x2a')]!=='VIRTUAL'){var _0x5e2702={};_0x5e2702[_0x17365c[_0x6e52('0x25')]]={'$like':'%'+_0x2ae4ee['query'][_0x6e52('0x38')]+'%'};return _0x5e2702;}})});}_0x16ccbc=_[_0x6e52('0x39')]({},_0x16ccbc,_0x2ae4ee[_0x6e52('0x3a')]);var _0x38d740={'where':_0x16ccbc[_0x6e52('0x37')]};return db[_0x6e52('0x28')]['count'](_0x38d740)[_0x6e52('0x20')](function(_0x359a78){_0x5ccc47[_0x6e52('0x18')]=_0x359a78;if(_0x2ae4ee['query'][_0x6e52('0x3b')]){_0x16ccbc['include']=[{'all':!![]}];}return db[_0x6e52('0x28')][_0x6e52('0x3c')](_0x16ccbc);})[_0x6e52('0x20')](function(_0x35db07){_0x5ccc47[_0x6e52('0x3d')]=_0x35db07;return _0x5ccc47;})[_0x6e52('0x20')](respondWithFilteredResult(_0x2f3ca4,_0x16ccbc))[_0x6e52('0x3e')](handleError(_0x2f3ca4,null));};exports[_0x6e52('0x3f')]=function(_0x251a98,_0xa40ca9){var _0x3cc574={'raw':!![],'where':{'id':_0x251a98[_0x6e52('0x40')]['id']}},_0x43a7ef={};_0x43a7ef[_0x6e52('0x2c')]=_[_0x6e52('0x2e')](db['MailQueueReport'][_0x6e52('0x41')]);_0x43a7ef[_0x6e52('0x2d')]=_[_0x6e52('0x2e')](_0x251a98[_0x6e52('0x2d')]);_0x43a7ef['filters']=_['intersection'](_0x43a7ef['model'],_0x43a7ef[_0x6e52('0x2d')]);_0x3cc574['attributes']=_[_0x6e52('0x31')](_0x43a7ef['model'],qs[_0x6e52('0x32')](_0x251a98[_0x6e52('0x2d')]['fields']));_0x3cc574[_0x6e52('0x30')]=_0x3cc574[_0x6e52('0x30')][_0x6e52('0x33')]?_0x3cc574['attributes']:_0x43a7ef[_0x6e52('0x2c')];if(_0x251a98[_0x6e52('0x2d')][_0x6e52('0x3b')]){_0x3cc574['include']=[{'all':!![]}];}_0x3cc574=_['merge']({},_0x3cc574,_0x251a98[_0x6e52('0x3a')]);return db[_0x6e52('0x28')][_0x6e52('0x42')](_0x3cc574)['then'](handleEntityNotFound(_0xa40ca9,null))[_0x6e52('0x20')](respondWithResult(_0xa40ca9,null))[_0x6e52('0x3e')](handleError(_0xa40ca9,null));};exports[_0x6e52('0x43')]=function(_0x5adc16,_0x2fe67c){return db[_0x6e52('0x28')][_0x6e52('0x43')](_0x5adc16[_0x6e52('0x44')],{})[_0x6e52('0x20')](respondWithResult(_0x2fe67c,0xc9))['catch'](handleError(_0x2fe67c,null));};exports[_0x6e52('0x1f')]=function(_0x3f050c,_0x5e23d6){if(_0x3f050c[_0x6e52('0x44')]['id']){delete _0x3f050c['body']['id'];}return db[_0x6e52('0x28')][_0x6e52('0x42')]({'where':{'id':_0x3f050c[_0x6e52('0x40')]['id']}})[_0x6e52('0x20')](handleEntityNotFound(_0x5e23d6,null))[_0x6e52('0x20')](saveUpdates(_0x3f050c[_0x6e52('0x44')],null))[_0x6e52('0x20')](respondWithResult(_0x5e23d6,null))[_0x6e52('0x3e')](handleError(_0x5e23d6,null));};exports[_0x6e52('0x21')]=function(_0x2f9520,_0x27412a){return db[_0x6e52('0x28')][_0x6e52('0x42')]({'where':{'id':_0x2f9520[_0x6e52('0x40')]['id']}})[_0x6e52('0x20')](handleEntityNotFound(_0x27412a,null))[_0x6e52('0x20')](removeEntity(_0x27412a,null))[_0x6e52('0x3e')](handleError(_0x27412a,null));};exports['describe']=function(_0xf62b8d,_0x21fd9f){return db[_0x6e52('0x28')]['describe']()[_0x6e52('0x20')](respondWithResult(_0x21fd9f,null))[_0x6e52('0x3e')](handleError(_0x21fd9f,null));};
\ No newline at end of file
diff --git a/server/api/mailQueueReport/mailQueueReport.model.js b/server/api/mailQueueReport/mailQueueReport.model.js
index 076f861..c71ae9f 100644
--- a/server/api/mailQueueReport/mailQueueReport.model.js
+++ b/server/api/mailQueueReport/mailQueueReport.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x8768=['uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./mailQueueReport.attributes','exports','define','MailQueueReport','report_mail_queue'];(function(_0x352e09,_0x37a7da){var _0x1b7094=function(_0x561074){while(--_0x561074){_0x352e09['push'](_0x352e09['shift']());}};_0x1b7094(++_0x37a7da);}(_0x8768,0xa1));var _0x8876=function(_0x516da4,_0x31c037){_0x516da4=_0x516da4-0x0;var _0x2e5e42=_0x8768[_0x516da4];return _0x2e5e42;};'use strict';var _=require(_0x8876('0x0'));var util=require(_0x8876('0x1'));var logger=require(_0x8876('0x2'))(_0x8876('0x3'));var moment=require(_0x8876('0x4'));var BPromise=require(_0x8876('0x5'));var rp=require(_0x8876('0x6'));var fs=require('fs');var path=require(_0x8876('0x7'));var rimraf=require(_0x8876('0x8'));var config=require(_0x8876('0x9'));var attributes=require(_0x8876('0xa'));module[_0x8876('0xb')]=function(_0x159d68,_0x5431cb){return _0x159d68[_0x8876('0xc')](_0x8876('0xd'),attributes,{'tableName':_0x8876('0xe'),'paranoid':![],'indexes':[{'name':_0x8876('0xf'),'fields':[_0x8876('0xf')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x1aab=['define','MailQueueReport','report_mail_queue','uniqueid','lodash','util','../../config/logger','moment','request-promise','path','rimraf','../../config/environment','./mailQueueReport.attributes'];(function(_0x3429f7,_0x4d0c14){var _0x1e3861=function(_0x2c0da7){while(--_0x2c0da7){_0x3429f7['push'](_0x3429f7['shift']());}};_0x1e3861(++_0x4d0c14);}(_0x1aab,0x122));var _0xb1aa=function(_0x27b758,_0x521c93){_0x27b758=_0x27b758-0x0;var _0x5ed825=_0x1aab[_0x27b758];return _0x5ed825;};'use strict';var _=require(_0xb1aa('0x0'));var util=require(_0xb1aa('0x1'));var logger=require(_0xb1aa('0x2'))('api');var moment=require(_0xb1aa('0x3'));var BPromise=require('bluebird');var rp=require(_0xb1aa('0x4'));var fs=require('fs');var path=require(_0xb1aa('0x5'));var rimraf=require(_0xb1aa('0x6'));var config=require(_0xb1aa('0x7'));var attributes=require(_0xb1aa('0x8'));module['exports']=function(_0x5eb27f,_0x34e0f4){return _0x5eb27f[_0xb1aa('0x9')](_0xb1aa('0xa'),attributes,{'tableName':_0xb1aa('0xb'),'paranoid':![],'indexes':[{'name':_0xb1aa('0xc'),'fields':[_0xb1aa('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/mailQueueReport/mailQueueReport.rpc.js b/server/api/mailQueueReport/mailQueueReport.rpc.js
index 4138feb..b5870f9 100644
--- a/server/api/mailQueueReport/mailQueueReport.rpc.js
+++ b/server/api/mailQueueReport/mailQueueReport.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xdb28=['UpdateMailQueueReport','MailQueueReport','update','raw','where','limit','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','MailQueueReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','catch','CreateMailQueueReport','create','body','options'];(function(_0x5c7055,_0x550d42){var _0x20d196=function(_0x47e15e){while(--_0x47e15e){_0x5c7055['push'](_0x5c7055['shift']());}};_0x20d196(++_0x550d42);}(_0xdb28,0x106));var _0x8db2=function(_0x1f68ff,_0x411e06){_0x1f68ff=_0x1f68ff-0x0;var _0xbbddc6=_0xdb28[_0x1f68ff];return _0xbbddc6;};'use strict';var _=require(_0x8db2('0x0'));var util=require(_0x8db2('0x1'));var moment=require(_0x8db2('0x2'));var BPromise=require(_0x8db2('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8db2('0x4'));var db=require(_0x8db2('0x5'))['db'];var utils=require(_0x8db2('0x6'));var logger=require(_0x8db2('0x7'))(_0x8db2('0x8'));var config=require('../../config/environment');var jayson=require(_0x8db2('0x9'));var client=jayson[_0x8db2('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x494b40,_0x477f50,_0x46932f){return new BPromise(function(_0x131537,_0x29f698){return client[_0x8db2('0xb')](_0x494b40,_0x46932f)[_0x8db2('0xc')](function(_0x126c78){logger['info'](_0x8db2('0xd'),_0x477f50,_0x8db2('0xe'));logger[_0x8db2('0xf')]('MailQueueReport,\x20%s,\x20%s,\x20%s',_0x477f50,_0x8db2('0xe'),JSON[_0x8db2('0x10')](_0x126c78));if(_0x126c78['error']){if(_0x126c78[_0x8db2('0x11')][_0x8db2('0x12')]===0x1f4){logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x126c78[_0x8db2('0x11')]['message']);return _0x29f698(_0x126c78['error'][_0x8db2('0x13')]);}logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x126c78[_0x8db2('0x11')][_0x8db2('0x13')]);return _0x131537(_0x126c78[_0x8db2('0x11')][_0x8db2('0x13')]);}else{logger[_0x8db2('0x14')](_0x8db2('0xd'),_0x477f50,_0x8db2('0xe'));_0x131537(_0x126c78['result'][_0x8db2('0x13')]);}})[_0x8db2('0x15')](function(_0x48101e){logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x48101e);_0x29f698(_0x48101e);});});}exports[_0x8db2('0x16')]=function(_0x3fddc2){var _0x2efd06=this;return new Promise(function(_0x46ce14,_0x51d60d){return db['MailQueueReport'][_0x8db2('0x17')](_0x3fddc2[_0x8db2('0x18')],{'raw':_0x3fddc2[_0x8db2('0x19')]?_0x3fddc2[_0x8db2('0x19')]['raw']===undefined?!![]:![]:!![]})[_0x8db2('0xc')](function(_0x36a9ff){logger[_0x8db2('0x14')](_0x8db2('0x16'),_0x3fddc2);logger[_0x8db2('0xf')]('CreateMailQueueReport',_0x3fddc2,JSON[_0x8db2('0x10')](_0x36a9ff));_0x46ce14(_0x36a9ff);})[_0x8db2('0x15')](function(_0x18f69c){logger[_0x8db2('0x11')](_0x8db2('0x16'),_0x18f69c[_0x8db2('0x13')],_0x3fddc2);_0x51d60d(_0x2efd06[_0x8db2('0x11')](0x1f4,_0x18f69c['message']));});});};exports[_0x8db2('0x1a')]=function(_0x4f6516){var _0x5725f0=this;return new Promise(function(_0x52a9ca,_0x4d923c){return db[_0x8db2('0x1b')][_0x8db2('0x1c')](_0x4f6516[_0x8db2('0x18')],{'raw':_0x4f6516[_0x8db2('0x19')]?_0x4f6516[_0x8db2('0x19')][_0x8db2('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4f6516['options']?_0x4f6516[_0x8db2('0x19')][_0x8db2('0x1e')]||null:null,'attributes':_0x4f6516[_0x8db2('0x19')]?_0x4f6516[_0x8db2('0x19')]['attributes']||null:null,'limit':_0x4f6516[_0x8db2('0x19')]?_0x4f6516[_0x8db2('0x19')][_0x8db2('0x1f')]||null:null})[_0x8db2('0xc')](function(_0xbe5ece){logger[_0x8db2('0x14')](_0x8db2('0x1a'),_0x4f6516);logger[_0x8db2('0xf')](_0x8db2('0x1a'),_0x4f6516,JSON['stringify'](_0xbe5ece));_0x52a9ca(_0xbe5ece);})[_0x8db2('0x15')](function(_0x50b28d){logger['error'](_0x8db2('0x1a'),_0x50b28d[_0x8db2('0x13')],_0x4f6516);_0x4d923c(_0x5725f0[_0x8db2('0x11')](0x1f4,_0x50b28d['message']));});});};
\ No newline at end of file
+var _0x1967=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','MailQueueReport,\x20%s,\x20%s','MailQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','CreateMailQueueReport','MailQueueReport','create','body','options','update','where','attributes','debug','UpdateMailQueueReport','util','moment','bluebird'];(function(_0x4eafc3,_0x19f230){var _0xe9b902=function(_0xd6e811){while(--_0xd6e811){_0x4eafc3['push'](_0x4eafc3['shift']());}};_0xe9b902(++_0x19f230);}(_0x1967,0x173));var _0x7196=function(_0x54e04a,_0x165009){_0x54e04a=_0x54e04a-0x0;var _0xfe6d65=_0x1967[_0x54e04a];return _0xfe6d65;};'use strict';var _=require('lodash');var util=require(_0x7196('0x0'));var moment=require(_0x7196('0x1'));var BPromise=require(_0x7196('0x2'));var rs=require(_0x7196('0x3'));var fs=require('fs');var Redis=require(_0x7196('0x4'));var db=require(_0x7196('0x5'))['db'];var utils=require(_0x7196('0x6'));var logger=require(_0x7196('0x7'))(_0x7196('0x8'));var config=require(_0x7196('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x7196('0xa')][_0x7196('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x194746,_0x40e0af,_0x266a6e){return new BPromise(function(_0xad78a,_0x510c72){return client[_0x7196('0xc')](_0x194746,_0x266a6e)[_0x7196('0xd')](function(_0x3f846e){logger[_0x7196('0xe')](_0x7196('0xf'),_0x40e0af,'request\x20sent');logger['debug'](_0x7196('0x10'),_0x40e0af,_0x7196('0x11'),JSON[_0x7196('0x12')](_0x3f846e));if(_0x3f846e[_0x7196('0x13')]){if(_0x3f846e[_0x7196('0x13')][_0x7196('0x14')]===0x1f4){logger[_0x7196('0x13')](_0x7196('0xf'),_0x40e0af,_0x3f846e[_0x7196('0x13')][_0x7196('0x15')]);return _0x510c72(_0x3f846e[_0x7196('0x13')]['message']);}logger[_0x7196('0x13')](_0x7196('0xf'),_0x40e0af,_0x3f846e[_0x7196('0x13')][_0x7196('0x15')]);return _0xad78a(_0x3f846e['error'][_0x7196('0x15')]);}else{logger['info'](_0x7196('0xf'),_0x40e0af,_0x7196('0x11'));_0xad78a(_0x3f846e[_0x7196('0x16')][_0x7196('0x15')]);}})[_0x7196('0x17')](function(_0x2e3e0e){logger[_0x7196('0x13')](_0x7196('0xf'),_0x40e0af,_0x2e3e0e);_0x510c72(_0x2e3e0e);});});}exports[_0x7196('0x18')]=function(_0x32fe2b){var _0x385f2d=this;return new Promise(function(_0x5b716a,_0x4c4f91){return db[_0x7196('0x19')][_0x7196('0x1a')](_0x32fe2b[_0x7196('0x1b')],{'raw':_0x32fe2b['options']?_0x32fe2b[_0x7196('0x1c')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x296e07){logger[_0x7196('0xe')](_0x7196('0x18'),_0x32fe2b);logger['debug']('CreateMailQueueReport',_0x32fe2b,JSON[_0x7196('0x12')](_0x296e07));_0x5b716a(_0x296e07);})[_0x7196('0x17')](function(_0x598a26){logger[_0x7196('0x13')](_0x7196('0x18'),_0x598a26[_0x7196('0x15')],_0x32fe2b);_0x4c4f91(_0x385f2d[_0x7196('0x13')](0x1f4,_0x598a26[_0x7196('0x15')]));});});};exports['UpdateMailQueueReport']=function(_0x3f8178){var _0x520d01=this;return new Promise(function(_0x3ce9a0,_0x1b1f4b){return db[_0x7196('0x19')][_0x7196('0x1d')](_0x3f8178[_0x7196('0x1b')],{'raw':_0x3f8178[_0x7196('0x1c')]?_0x3f8178['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3f8178[_0x7196('0x1c')]?_0x3f8178[_0x7196('0x1c')][_0x7196('0x1e')]||null:null,'attributes':_0x3f8178['options']?_0x3f8178['options'][_0x7196('0x1f')]||null:null,'limit':_0x3f8178[_0x7196('0x1c')]?_0x3f8178[_0x7196('0x1c')]['limit']||null:null})[_0x7196('0xd')](function(_0x4ecea1){logger[_0x7196('0xe')]('UpdateMailQueueReport',_0x3f8178);logger[_0x7196('0x20')](_0x7196('0x21'),_0x3f8178,JSON[_0x7196('0x12')](_0x4ecea1));_0x3ce9a0(_0x4ecea1);})['catch'](function(_0x35116f){logger[_0x7196('0x13')](_0x7196('0x21'),_0x35116f[_0x7196('0x15')],_0x3f8178);_0x1b1f4b(_0x520d01['error'](0x1f4,_0x35116f[_0x7196('0x15')]));});});};
\ No newline at end of file
diff --git a/server/api/mailServerIn/index.js b/server/api/mailServerIn/index.js
index 97ae99c..c601d63 100644
--- a/server/api/mailServerIn/index.js
+++ b/server/api/mailServerIn/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xbd08=['../../components/interaction/service','../../config/environment','exports','multer','path','express','Router','../../components/auth/service'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0xbd08,0xa3));var _0x8bd0=function(_0x4a53d,_0x58a95e){_0x4a53d=_0x4a53d-0x0;var _0x27410e=_0xbd08[_0x4a53d];return _0x27410e;};'use strict';var multer=require(_0x8bd0('0x0'));var util=require('util');var path=require(_0x8bd0('0x1'));var timeout=require('connect-timeout');var express=require(_0x8bd0('0x2'));var router=express[_0x8bd0('0x3')]();var auth=require(_0x8bd0('0x4'));var interaction=require(_0x8bd0('0x5'));var config=require(_0x8bd0('0x6'));module[_0x8bd0('0x7')]=router;
\ No newline at end of file
+var _0x652e=['path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','exports','multer'];(function(_0x5a0d84,_0x47eb35){var _0xbf54e=function(_0x5dcd70){while(--_0x5dcd70){_0x5a0d84['push'](_0x5a0d84['shift']());}};_0xbf54e(++_0x47eb35);}(_0x652e,0x1af));var _0xe652=function(_0x265e3b,_0x37cb8d){_0x265e3b=_0x265e3b-0x0;var _0x3a3b32=_0x652e[_0x265e3b];return _0x3a3b32;};'use strict';var multer=require(_0xe652('0x0'));var util=require('util');var path=require(_0xe652('0x1'));var timeout=require(_0xe652('0x2'));var express=require(_0xe652('0x3'));var router=express[_0xe652('0x4')]();var auth=require(_0xe652('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xe652('0x6'));module[_0xe652('0x7')]=router;
\ No newline at end of file
diff --git a/server/api/mailServerIn/mailServerIn.attributes.js b/server/api/mailServerIn/mailServerIn.attributes.js
index fe55b1e..7e1825f 100644
--- a/server/api/mailServerIn/mailServerIn.attributes.js
+++ b/server/api/mailServerIn/mailServerIn.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x0e53=['STRING','BOOLEAN','username','INTEGER'];(function(_0x567ac9,_0x43b49e){var _0x101959=function(_0x543727){while(--_0x543727){_0x567ac9['push'](_0x567ac9['shift']());}};_0x101959(++_0x43b49e);}(_0x0e53,0x14c));var _0x30e5=function(_0x13d2e9,_0xba214f){_0x13d2e9=_0x13d2e9-0x0;var _0x40b04e=_0x0e53[_0x13d2e9];return _0x40b04e;};'use strict';var Sequelize=require('sequelize');module['exports']={'description':{'type':Sequelize[_0x30e5('0x0')]},'host':{'type':Sequelize[_0x30e5('0x0')]},'authentication':{'type':Sequelize[_0x30e5('0x1')],'defaultValue':!![]},'user':{'type':Sequelize[_0x30e5('0x0')],'unique':_0x30e5('0x2')},'password':{'type':Sequelize[_0x30e5('0x0')]},'port':{'type':Sequelize['INTEGER']},'tls':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'mailbox':{'type':Sequelize[_0x30e5('0x0')],'defaultValue':'INBOX'},'connTimeout':{'type':Sequelize[_0x30e5('0x3')],'defaultValue':0xa},'authTimeout':{'type':Sequelize[_0x30e5('0x3')],'defaultValue':0x5},'service':{'type':Sequelize[_0x30e5('0x0')]}};
\ No newline at end of file
+var _0xd146=['INBOX','sequelize','exports','STRING','INTEGER','BOOLEAN'];(function(_0x4b3bd5,_0x47d005){var _0x5f186a=function(_0x5610f2){while(--_0x5610f2){_0x4b3bd5['push'](_0x4b3bd5['shift']());}};_0x5f186a(++_0x47d005);}(_0xd146,0x7f));var _0x6d14=function(_0x171b45,_0x5ec662){_0x171b45=_0x171b45-0x0;var _0x470742=_0xd146[_0x171b45];return _0x470742;};'use strict';var Sequelize=require(_0x6d14('0x0'));module[_0x6d14('0x1')]={'description':{'type':Sequelize[_0x6d14('0x2')]},'host':{'type':Sequelize[_0x6d14('0x2')]},'authentication':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'user':{'type':Sequelize['STRING'],'unique':'username'},'password':{'type':Sequelize[_0x6d14('0x2')]},'port':{'type':Sequelize[_0x6d14('0x3')]},'tls':{'type':Sequelize[_0x6d14('0x4')],'defaultValue':!![]},'mailbox':{'type':Sequelize[_0x6d14('0x2')],'defaultValue':_0x6d14('0x5')},'connTimeout':{'type':Sequelize[_0x6d14('0x3')],'defaultValue':0xa},'authTimeout':{'type':Sequelize[_0x6d14('0x3')],'defaultValue':0x5},'service':{'type':Sequelize[_0x6d14('0x2')]}};
\ No newline at end of file
diff --git a/server/api/mailServerIn/mailServerIn.model.js b/server/api/mailServerIn/mailServerIn.model.js
index fa5d23f..4c234ca 100644
--- a/server/api/mailServerIn/mailServerIn.model.js
+++ b/server/api/mailServerIn/mailServerIn.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x2eb2=['moment','bluebird','request-promise','rimraf','exports','define','MailServerIn','mail_servers_in','util','../../config/logger','api'];(function(_0x39adc3,_0x5aadc7){var _0x5400dd=function(_0x31c327){while(--_0x31c327){_0x39adc3['push'](_0x39adc3['shift']());}};_0x5400dd(++_0x5aadc7);}(_0x2eb2,0x19f));var _0x22eb=function(_0xea8947,_0x1b573d){_0xea8947=_0xea8947-0x0;var _0x2455e9=_0x2eb2[_0xea8947];return _0x2455e9;};'use strict';var _=require('lodash');var util=require(_0x22eb('0x0'));var logger=require(_0x22eb('0x1'))(_0x22eb('0x2'));var moment=require(_0x22eb('0x3'));var BPromise=require(_0x22eb('0x4'));var rp=require(_0x22eb('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x22eb('0x6'));var config=require('../../config/environment');var attributes=require('./mailServerIn.attributes');module[_0x22eb('0x7')]=function(_0x10e116,_0x35dd5b){return _0x10e116[_0x22eb('0x8')](_0x22eb('0x9'),attributes,{'tableName':_0x22eb('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x872a=['exports','MailServerIn','mail_servers_in','lodash','util','../../config/logger','api','path','rimraf','../../config/environment','./mailServerIn.attributes'];(function(_0x2f5ac5,_0x1ee939){var _0x37c9a8=function(_0x15031f){while(--_0x15031f){_0x2f5ac5['push'](_0x2f5ac5['shift']());}};_0x37c9a8(++_0x1ee939);}(_0x872a,0x100));var _0xa872=function(_0x4880ac,_0x5ee397){_0x4880ac=_0x4880ac-0x0;var _0x4872b6=_0x872a[_0x4880ac];return _0x4872b6;};'use strict';var _=require(_0xa872('0x0'));var util=require(_0xa872('0x1'));var logger=require(_0xa872('0x2'))(_0xa872('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xa872('0x4'));var rimraf=require(_0xa872('0x5'));var config=require(_0xa872('0x6'));var attributes=require(_0xa872('0x7'));module[_0xa872('0x8')]=function(_0x1c8d2f,_0x3e3cd4){return _0x1c8d2f['define'](_0xa872('0x9'),attributes,{'tableName':_0xa872('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/mailServerIn/mailServerIn.rpc.js b/server/api/mailServerIn/mailServerIn.rpc.js
index 08b38c6..d8c3daf 100644
--- a/server/api/mailServerIn/mailServerIn.rpc.js
+++ b/server/api/mailServerIn/mailServerIn.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x0041=['include','map','model','GetMailServerIn','debug','stringify','util','moment','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','MailServerIn,\x20%s,\x20%s','request\x20sent','MailServerIn,\x20%s,\x20%s,\x20%s','error','code','message','info','MailServerIn','findAll','options','attributes'];(function(_0x47fd88,_0x1e134c){var _0x1994e0=function(_0xd9d714){while(--_0xd9d714){_0x47fd88['push'](_0x47fd88['shift']());}};_0x1994e0(++_0x1e134c);}(_0x0041,0xb4));var _0x1004=function(_0x26e6e9,_0x19aefb){_0x26e6e9=_0x26e6e9-0x0;var _0xe28f87=_0x0041[_0x26e6e9];return _0xe28f87;};'use strict';var _=require('lodash');var util=require(_0x1004('0x0'));var moment=require(_0x1004('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1004('0x2'));var db=require(_0x1004('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x1004('0x4'))(_0x1004('0x5'));var config=require(_0x1004('0x6'));var jayson=require(_0x1004('0x7'));var client=jayson[_0x1004('0x8')][_0x1004('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4659e8,_0x35dbcc,_0x178054){return new BPromise(function(_0x3bf59d,_0xca6d22){return client[_0x1004('0xa')](_0x4659e8,_0x178054)[_0x1004('0xb')](function(_0x49339b){logger['info'](_0x1004('0xc'),_0x35dbcc,_0x1004('0xd'));logger['debug'](_0x1004('0xe'),_0x35dbcc,_0x1004('0xd'),JSON['stringify'](_0x49339b));if(_0x49339b[_0x1004('0xf')]){if(_0x49339b[_0x1004('0xf')][_0x1004('0x10')]===0x1f4){logger[_0x1004('0xf')](_0x1004('0xc'),_0x35dbcc,_0x49339b[_0x1004('0xf')][_0x1004('0x11')]);return _0xca6d22(_0x49339b[_0x1004('0xf')][_0x1004('0x11')]);}logger[_0x1004('0xf')]('MailServerIn,\x20%s,\x20%s',_0x35dbcc,_0x49339b['error'][_0x1004('0x11')]);return _0x3bf59d(_0x49339b[_0x1004('0xf')]['message']);}else{logger[_0x1004('0x12')]('MailServerIn,\x20%s,\x20%s',_0x35dbcc,_0x1004('0xd'));_0x3bf59d(_0x49339b['result'][_0x1004('0x11')]);}})['catch'](function(_0x562c0e){logger[_0x1004('0xf')]('MailServerIn,\x20%s,\x20%s',_0x35dbcc,_0x562c0e);_0xca6d22(_0x562c0e);});});}exports['GetMailServerIn']=function(_0x3e24ee){var _0x254480=this;return new Promise(function(_0x44fce4,_0x22525c){return db[_0x1004('0x13')][_0x1004('0x14')]({'raw':_0x3e24ee[_0x1004('0x15')]?_0x3e24ee[_0x1004('0x15')]['raw']===undefined?!![]:![]:!![],'where':_0x3e24ee[_0x1004('0x15')]?_0x3e24ee['options']['where']||null:null,'attributes':_0x3e24ee[_0x1004('0x15')]?_0x3e24ee[_0x1004('0x15')][_0x1004('0x16')]||null:null,'limit':_0x3e24ee[_0x1004('0x15')]?_0x3e24ee['options']['limit']||null:null,'include':_0x3e24ee[_0x1004('0x15')]?_0x3e24ee[_0x1004('0x15')][_0x1004('0x17')]?_[_0x1004('0x18')](_0x3e24ee[_0x1004('0x15')][_0x1004('0x17')],function(_0x1f9300){return{'model':db[_0x1f9300[_0x1004('0x19')]],'as':_0x1f9300['as'],'attributes':_0x1f9300['attributes'],'include':_0x1f9300[_0x1004('0x17')]?_['map'](_0x1f9300['include'],function(_0x8f580c){return{'model':db[_0x8f580c[_0x1004('0x19')]],'as':_0x8f580c['as'],'attributes':_0x8f580c[_0x1004('0x16')],'include':_0x8f580c[_0x1004('0x17')]?_['map'](_0x8f580c[_0x1004('0x17')],function(_0x619977){return{'model':db[_0x619977[_0x1004('0x19')]],'as':_0x619977['as'],'attributes':_0x619977[_0x1004('0x16')]};}):[]};}):[]};}):[]:[]})[_0x1004('0xb')](function(_0x489140){logger['info'](_0x1004('0x1a'),_0x3e24ee);logger[_0x1004('0x1b')]('GetMailServerIn',_0x3e24ee,JSON[_0x1004('0x1c')](_0x489140));_0x44fce4(_0x489140);})['catch'](function(_0x7681bc){logger['error'](_0x1004('0x1a'),_0x7681bc['message'],_0x3e24ee);_0x22525c(_0x254480[_0x1004('0xf')](0x1f4,_0x7681bc['message']));});});};
\ No newline at end of file
+var _0xa09a=['options','where','attributes','include','map','model','lodash','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','MailServerIn,\x20%s,\x20%s','request\x20sent','debug','MailServerIn,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetMailServerIn','MailServerIn','findAll'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0xa09a,0x1e6));var _0xaa09=function(_0x55a7dd,_0x45f2bc){_0x55a7dd=_0x55a7dd-0x0;var _0x3f7df7=_0xa09a[_0x55a7dd];return _0x3f7df7;};'use strict';var _=require(_0xaa09('0x0'));var util=require('util');var moment=require(_0xaa09('0x1'));var BPromise=require(_0xaa09('0x2'));var rs=require(_0xaa09('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xaa09('0x4'));var logger=require(_0xaa09('0x5'))(_0xaa09('0x6'));var config=require(_0xaa09('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xaa09('0x8')][_0xaa09('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x35116f,_0x1b5c9b,_0x201fa9){return new BPromise(function(_0x3453fb,_0x50fd8b){return client[_0xaa09('0xa')](_0x35116f,_0x201fa9)[_0xaa09('0xb')](function(_0xa3f748){logger[_0xaa09('0xc')](_0xaa09('0xd'),_0x1b5c9b,_0xaa09('0xe'));logger[_0xaa09('0xf')](_0xaa09('0x10'),_0x1b5c9b,_0xaa09('0xe'),JSON[_0xaa09('0x11')](_0xa3f748));if(_0xa3f748[_0xaa09('0x12')]){if(_0xa3f748[_0xaa09('0x12')][_0xaa09('0x13')]===0x1f4){logger[_0xaa09('0x12')](_0xaa09('0xd'),_0x1b5c9b,_0xa3f748[_0xaa09('0x12')][_0xaa09('0x14')]);return _0x50fd8b(_0xa3f748[_0xaa09('0x12')][_0xaa09('0x14')]);}logger[_0xaa09('0x12')](_0xaa09('0xd'),_0x1b5c9b,_0xa3f748[_0xaa09('0x12')][_0xaa09('0x14')]);return _0x3453fb(_0xa3f748[_0xaa09('0x12')][_0xaa09('0x14')]);}else{logger[_0xaa09('0xc')](_0xaa09('0xd'),_0x1b5c9b,_0xaa09('0xe'));_0x3453fb(_0xa3f748[_0xaa09('0x15')][_0xaa09('0x14')]);}})[_0xaa09('0x16')](function(_0x451c83){logger['error'](_0xaa09('0xd'),_0x1b5c9b,_0x451c83);_0x50fd8b(_0x451c83);});});}exports[_0xaa09('0x17')]=function(_0x52a3a9){var _0x2cb2b9=this;return new Promise(function(_0x190142,_0x4a0d16){return db[_0xaa09('0x18')][_0xaa09('0x19')]({'raw':_0x52a3a9[_0xaa09('0x1a')]?_0x52a3a9[_0xaa09('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x52a3a9[_0xaa09('0x1a')]?_0x52a3a9['options'][_0xaa09('0x1b')]||null:null,'attributes':_0x52a3a9[_0xaa09('0x1a')]?_0x52a3a9['options'][_0xaa09('0x1c')]||null:null,'limit':_0x52a3a9['options']?_0x52a3a9['options']['limit']||null:null,'include':_0x52a3a9[_0xaa09('0x1a')]?_0x52a3a9[_0xaa09('0x1a')][_0xaa09('0x1d')]?_[_0xaa09('0x1e')](_0x52a3a9['options']['include'],function(_0x272ace){return{'model':db[_0x272ace[_0xaa09('0x1f')]],'as':_0x272ace['as'],'attributes':_0x272ace[_0xaa09('0x1c')],'include':_0x272ace[_0xaa09('0x1d')]?_[_0xaa09('0x1e')](_0x272ace[_0xaa09('0x1d')],function(_0x26d910){return{'model':db[_0x26d910[_0xaa09('0x1f')]],'as':_0x26d910['as'],'attributes':_0x26d910[_0xaa09('0x1c')],'include':_0x26d910[_0xaa09('0x1d')]?_['map'](_0x26d910[_0xaa09('0x1d')],function(_0x24bf88){return{'model':db[_0x24bf88[_0xaa09('0x1f')]],'as':_0x24bf88['as'],'attributes':_0x24bf88[_0xaa09('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xaa09('0xb')](function(_0x5bc2d4){logger[_0xaa09('0xc')](_0xaa09('0x17'),_0x52a3a9);logger[_0xaa09('0xf')](_0xaa09('0x17'),_0x52a3a9,JSON[_0xaa09('0x11')](_0x5bc2d4));_0x190142(_0x5bc2d4);})[_0xaa09('0x16')](function(_0x15fd7d){logger['error'](_0xaa09('0x17'),_0x15fd7d[_0xaa09('0x14')],_0x52a3a9);_0x4a0d16(_0x2cb2b9[_0xaa09('0x12')](0x1f4,_0x15fd7d[_0xaa09('0x14')]));});});};
\ No newline at end of file
diff --git a/server/api/mailServerOut/index.js b/server/api/mailServerOut/index.js
index 5685e75..15b9116 100644
--- a/server/api/mailServerOut/index.js
+++ b/server/api/mailServerOut/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x5609=['update','delete','destroy','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailServerOut.controller','get','isAuthenticated','index','/:id','show','post','create'];(function(_0x3511d3,_0x4107ae){var _0x5d6321=function(_0x1a23da){while(--_0x1a23da){_0x3511d3['push'](_0x3511d3['shift']());}};_0x5d6321(++_0x4107ae);}(_0x5609,0x7c));var _0x9560=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x5609[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require(_0x9560('0x0'));var util=require(_0x9560('0x1'));var path=require(_0x9560('0x2'));var timeout=require(_0x9560('0x3'));var express=require(_0x9560('0x4'));var router=express['Router']();var auth=require(_0x9560('0x5'));var interaction=require(_0x9560('0x6'));var config=require(_0x9560('0x7'));var controller=require(_0x9560('0x8'));router[_0x9560('0x9')]('/',auth[_0x9560('0xa')](),controller[_0x9560('0xb')]);router[_0x9560('0x9')](_0x9560('0xc'),auth[_0x9560('0xa')](),controller[_0x9560('0xd')]);router[_0x9560('0xe')]('/',auth[_0x9560('0xa')](),controller[_0x9560('0xf')]);router['put'](_0x9560('0xc'),auth[_0x9560('0xa')](),controller[_0x9560('0x10')]);router[_0x9560('0x11')](_0x9560('0xc'),auth[_0x9560('0xa')](),controller[_0x9560('0x12')]);module[_0x9560('0x13')]=router;
\ No newline at end of file
+var _0xd647=['isAuthenticated','show','post','create','put','update','destroy','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./mailServerOut.controller','get','index','/:id'];(function(_0x2f7250,_0x388f17){var _0x57af61=function(_0x528f1a){while(--_0x528f1a){_0x2f7250['push'](_0x2f7250['shift']());}};_0x57af61(++_0x388f17);}(_0xd647,0x8c));var _0x7d64=function(_0x5311e8,_0x57c5bb){_0x5311e8=_0x5311e8-0x0;var _0x582ad8=_0xd647[_0x5311e8];return _0x582ad8;};'use strict';var multer=require(_0x7d64('0x0'));var util=require(_0x7d64('0x1'));var path=require(_0x7d64('0x2'));var timeout=require(_0x7d64('0x3'));var express=require(_0x7d64('0x4'));var router=express[_0x7d64('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0x7d64('0x6'));var config=require(_0x7d64('0x7'));var controller=require(_0x7d64('0x8'));router[_0x7d64('0x9')]('/',auth['isAuthenticated'](),controller[_0x7d64('0xa')]);router[_0x7d64('0x9')](_0x7d64('0xb'),auth[_0x7d64('0xc')](),controller[_0x7d64('0xd')]);router[_0x7d64('0xe')]('/',auth[_0x7d64('0xc')](),controller[_0x7d64('0xf')]);router[_0x7d64('0x10')]('/:id',auth[_0x7d64('0xc')](),controller[_0x7d64('0x11')]);router['delete'](_0x7d64('0xb'),auth[_0x7d64('0xc')](),controller[_0x7d64('0x12')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/mailServerOut/mailServerOut.attributes.js b/server/api/mailServerOut/mailServerOut.attributes.js
index eaa5f81..795a5bd 100644
--- a/server/api/mailServerOut/mailServerOut.attributes.js
+++ b/server/api/mailServerOut/mailServerOut.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x4e83=['INTEGER','sequelize','STRING'];(function(_0x5807dd,_0x41bb03){var _0x2516e9=function(_0x526ed4){while(--_0x526ed4){_0x5807dd['push'](_0x5807dd['shift']());}};_0x2516e9(++_0x41bb03);}(_0x4e83,0x1ae));var _0x34e8=function(_0x583829,_0x188b0e){_0x583829=_0x583829-0x0;var _0x34d994=_0x4e83[_0x583829];return _0x34d994;};'use strict';var Sequelize=require(_0x34e8('0x0'));module['exports']={'description':{'type':Sequelize[_0x34e8('0x1')]},'host':{'type':Sequelize[_0x34e8('0x1')]},'user':{'type':Sequelize[_0x34e8('0x1')]},'pass':{'type':Sequelize[_0x34e8('0x1')]},'port':{'type':Sequelize[_0x34e8('0x2')]},'secure':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'service':{'type':Sequelize['STRING']},'authentication':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}};
\ No newline at end of file
+var _0xacf4=['STRING','INTEGER','BOOLEAN'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xacf4,0xe7));var _0x4acf=function(_0x1555f5,_0xb904c0){_0x1555f5=_0x1555f5-0x0;var _0x307306=_0xacf4[_0x1555f5];return _0x307306;};'use strict';var Sequelize=require('sequelize');module['exports']={'description':{'type':Sequelize[_0x4acf('0x0')]},'host':{'type':Sequelize[_0x4acf('0x0')]},'user':{'type':Sequelize[_0x4acf('0x0')]},'pass':{'type':Sequelize[_0x4acf('0x0')]},'port':{'type':Sequelize[_0x4acf('0x1')]},'secure':{'type':Sequelize[_0x4acf('0x2')],'defaultValue':![]},'service':{'type':Sequelize[_0x4acf('0x0')]},'authentication':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}};
\ No newline at end of file
diff --git a/server/api/mailServerOut/mailServerOut.controller.js b/server/api/mailServerOut/mailServerOut.controller.js
index 1edca96..d90dd97 100644
--- a/server/api/mailServerOut/mailServerOut.controller.js
+++ b/server/api/mailServerOut/mailServerOut.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xc737=['../../mysqldb','status','end','json','offset','set','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','MailServerOut','fieldName','type','key','map','query','keys','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','limit','sort','where','filters','pick','merge','VIRTUAL','filter','options','count','includeAll','include','catch','show','rawAttributes','find','create','body','params','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../config/logger','api','../../config/utils','../../config/environment'];(function(_0x53a7c9,_0x3f87ae){var _0x2cead0=function(_0x3af130){while(--_0x3af130){_0x53a7c9['push'](_0x53a7c9['shift']());}};_0x2cead0(++_0x3f87ae);}(_0xc737,0x10d));var _0x7c73=function(_0x3ffc19,_0x207411){_0x3ffc19=_0x3ffc19-0x0;var _0x536398=_0xc737[_0x3ffc19];return _0x536398;};'use strict';var pdf=require(_0x7c73('0x0'));var emlformat=require(_0x7c73('0x1'));var rimraf=require(_0x7c73('0x2'));var zipdir=require(_0x7c73('0x3'));var jsonpatch=require(_0x7c73('0x4'));var rp=require(_0x7c73('0x5'));var moment=require(_0x7c73('0x6'));var BPromise=require('bluebird');var Mustache=require(_0x7c73('0x7'));var util=require(_0x7c73('0x8'));var path=require('path');var sox=require(_0x7c73('0x9'));var csv=require(_0x7c73('0xa'));var ejs=require(_0x7c73('0xb'));var fs=require('fs');var _=require(_0x7c73('0xc'));var squel=require(_0x7c73('0xd'));var crypto=require(_0x7c73('0xe'));var jsforce=require(_0x7c73('0xf'));var deskjs=require(_0x7c73('0x10'));var toCsv=require('to-csv');var querystring=require(_0x7c73('0x11'));var Papa=require('papaparse');var Redis=require(_0x7c73('0x12'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x7c73('0x13'))(_0x7c73('0x14'));var utils=require(_0x7c73('0x15'));var config=require(_0x7c73('0x16'));var db=require(_0x7c73('0x17'))['db'];function respondWithStatusCode(_0x5b6ce1,_0x12713c){_0x12713c=_0x12713c||0xcc;return function(_0x259533){if(_0x259533){return _0x5b6ce1['sendStatus'](_0x12713c);}return _0x5b6ce1[_0x7c73('0x18')](_0x12713c)[_0x7c73('0x19')]();};}function respondWithResult(_0x99e982,_0x91f67e){_0x91f67e=_0x91f67e||0xc8;return function(_0x408a32){if(_0x408a32){return _0x99e982[_0x7c73('0x18')](_0x91f67e)[_0x7c73('0x1a')](_0x408a32);}};}function respondWithFilteredResult(_0x4fce55,_0xe50706){return function(_0x501fc2){if(_0x501fc2){var _0x348ac3=_0x501fc2['count'],_0x36e959=_0xe50706[_0x7c73('0x1b')],_0x19b6d6=_0xe50706['offset']+_0xe50706['limit'],_0x1c3cc3;if(_0x19b6d6>=_0x348ac3){_0x19b6d6=_0x348ac3;_0x1c3cc3=0xc8;}else{_0x1c3cc3=0xce;}_0x4fce55[_0x7c73('0x18')](_0x1c3cc3);return _0x4fce55[_0x7c73('0x1c')]('Content-Range',_0x36e959+'-'+_0x19b6d6+'/'+_0x348ac3)[_0x7c73('0x1a')](_0x501fc2);}return null;};}function patchUpdates(_0x11857d){return function(_0x2af9fa){try{jsonpatch[_0x7c73('0x1d')](_0x2af9fa,_0x11857d,!![]);}catch(_0x274932){return BPromise[_0x7c73('0x1e')](_0x274932);}return _0x2af9fa[_0x7c73('0x1f')]();};}function saveUpdates(_0x8a67ae,_0x10a28d){return function(_0xca84f3){if(_0xca84f3){return _0xca84f3[_0x7c73('0x20')](_0x8a67ae)[_0x7c73('0x21')](function(_0x1753c6){return _0x1753c6;});}return null;};}function removeEntity(_0x2d7dfa,_0x187016){return function(_0x3b2349){if(_0x3b2349){return _0x3b2349[_0x7c73('0x22')]()[_0x7c73('0x21')](function(){_0x2d7dfa[_0x7c73('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x50beb6,_0x42c56c){return function(_0x49c7e1){if(!_0x49c7e1){_0x50beb6[_0x7c73('0x23')](0x194);}return _0x49c7e1;};}function handleError(_0x4854fa,_0x49dfae){_0x49dfae=_0x49dfae||0x1f4;return function(_0x4443b2){logger[_0x7c73('0x24')](_0x4443b2[_0x7c73('0x25')]);if(_0x4443b2[_0x7c73('0x26')]){delete _0x4443b2[_0x7c73('0x26')];}_0x4854fa[_0x7c73('0x18')](_0x49dfae)[_0x7c73('0x27')](_0x4443b2);};}exports['index']=function(_0x48bdc7,_0x33bc4b){var _0x33d830={},_0x2f3d2d={},_0x3e1325={'count':0x0,'rows':[]};var _0x1cb929=_['map'](db[_0x7c73('0x28')]['rawAttributes'],function(_0x5b45d2){return{'name':_0x5b45d2[_0x7c73('0x29')],'type':_0x5b45d2[_0x7c73('0x2a')][_0x7c73('0x2b')]};});_0x2f3d2d['model']=_[_0x7c73('0x2c')](_0x1cb929,_0x7c73('0x26'));_0x2f3d2d[_0x7c73('0x2d')]=_[_0x7c73('0x2e')](_0x48bdc7['query']);_0x2f3d2d['filters']=_[_0x7c73('0x2f')](_0x2f3d2d['model'],_0x2f3d2d[_0x7c73('0x2d')]);_0x33d830['attributes']=_[_0x7c73('0x2f')](_0x2f3d2d[_0x7c73('0x30')],qs[_0x7c73('0x31')](_0x48bdc7['query'][_0x7c73('0x31')]));_0x33d830[_0x7c73('0x32')]=_0x33d830[_0x7c73('0x32')][_0x7c73('0x33')]?_0x33d830['attributes']:_0x2f3d2d[_0x7c73('0x30')];if(!_0x48bdc7['query'][_0x7c73('0x34')](_0x7c73('0x35'))){_0x33d830[_0x7c73('0x36')]=qs[_0x7c73('0x36')](_0x48bdc7['query']['limit']);_0x33d830['offset']=qs[_0x7c73('0x1b')](_0x48bdc7[_0x7c73('0x2d')][_0x7c73('0x1b')]);}_0x33d830['order']=qs[_0x7c73('0x37')](_0x48bdc7['query']['sort']);_0x33d830[_0x7c73('0x38')]=qs[_0x7c73('0x39')](_[_0x7c73('0x3a')](_0x48bdc7[_0x7c73('0x2d')],_0x2f3d2d[_0x7c73('0x39')]),_0x1cb929);if(_0x48bdc7[_0x7c73('0x2d')]['filter']){_0x33d830[_0x7c73('0x38')]=_[_0x7c73('0x3b')](_0x33d830['where'],{'$or':_['map'](_0x1cb929,function(_0x1dd8da){if(_0x1dd8da[_0x7c73('0x2a')]!==_0x7c73('0x3c')){var _0xc1ace0={};_0xc1ace0[_0x1dd8da[_0x7c73('0x26')]]={'$like':'%'+_0x48bdc7['query'][_0x7c73('0x3d')]+'%'};return _0xc1ace0;}})});}_0x33d830=_[_0x7c73('0x3b')]({},_0x33d830,_0x48bdc7[_0x7c73('0x3e')]);var _0xd82bd={'where':_0x33d830[_0x7c73('0x38')]};return db[_0x7c73('0x28')][_0x7c73('0x3f')](_0xd82bd)['then'](function(_0x47ac13){_0x3e1325[_0x7c73('0x3f')]=_0x47ac13;if(_0x48bdc7[_0x7c73('0x2d')][_0x7c73('0x40')]){_0x33d830[_0x7c73('0x41')]=[{'all':!![]}];}return db[_0x7c73('0x28')]['findAll'](_0x33d830);})[_0x7c73('0x21')](function(_0x16429e){_0x3e1325['rows']=_0x16429e;return _0x3e1325;})[_0x7c73('0x21')](respondWithFilteredResult(_0x33bc4b,_0x33d830))[_0x7c73('0x42')](handleError(_0x33bc4b,null));};exports[_0x7c73('0x43')]=function(_0x51953a,_0x117248){var _0x25c8dc={'raw':!![],'where':{'id':_0x51953a['params']['id']}},_0xbcb2bc={};_0xbcb2bc[_0x7c73('0x30')]=_['keys'](db[_0x7c73('0x28')][_0x7c73('0x44')]);_0xbcb2bc[_0x7c73('0x2d')]=_[_0x7c73('0x2e')](_0x51953a['query']);_0xbcb2bc['filters']=_[_0x7c73('0x2f')](_0xbcb2bc['model'],_0xbcb2bc['query']);_0x25c8dc[_0x7c73('0x32')]=_[_0x7c73('0x2f')](_0xbcb2bc['model'],qs['fields'](_0x51953a['query'][_0x7c73('0x31')]));_0x25c8dc[_0x7c73('0x32')]=_0x25c8dc[_0x7c73('0x32')][_0x7c73('0x33')]?_0x25c8dc[_0x7c73('0x32')]:_0xbcb2bc[_0x7c73('0x30')];if(_0x51953a[_0x7c73('0x2d')][_0x7c73('0x40')]){_0x25c8dc['include']=[{'all':!![]}];}_0x25c8dc=_[_0x7c73('0x3b')]({},_0x25c8dc,_0x51953a['options']);return db['MailServerOut'][_0x7c73('0x45')](_0x25c8dc)[_0x7c73('0x21')](handleEntityNotFound(_0x117248,null))[_0x7c73('0x21')](respondWithResult(_0x117248,null))[_0x7c73('0x42')](handleError(_0x117248,null));};exports[_0x7c73('0x46')]=function(_0x4784e3,_0x3c3ae4){return db[_0x7c73('0x28')][_0x7c73('0x46')](_0x4784e3[_0x7c73('0x47')],{})['then'](respondWithResult(_0x3c3ae4,0xc9))[_0x7c73('0x42')](handleError(_0x3c3ae4,null));};exports['update']=function(_0xb6067f,_0x25cd5b){if(_0xb6067f[_0x7c73('0x47')]['id']){delete _0xb6067f[_0x7c73('0x47')]['id'];}return db[_0x7c73('0x28')][_0x7c73('0x45')]({'where':{'id':_0xb6067f[_0x7c73('0x48')]['id']}})['then'](handleEntityNotFound(_0x25cd5b,null))[_0x7c73('0x21')](saveUpdates(_0xb6067f[_0x7c73('0x47')],null))[_0x7c73('0x21')](respondWithResult(_0x25cd5b,null))['catch'](handleError(_0x25cd5b,null));};exports[_0x7c73('0x22')]=function(_0x48f10f,_0x2a9de4){return db[_0x7c73('0x28')][_0x7c73('0x45')]({'where':{'id':_0x48f10f['params']['id']}})[_0x7c73('0x21')](handleEntityNotFound(_0x2a9de4,null))[_0x7c73('0x21')](removeEntity(_0x2a9de4,null))[_0x7c73('0x42')](handleError(_0x2a9de4,null));};
\ No newline at end of file
+var _0x6dd9=['jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','sendStatus','end','status','json','offset','limit','set','apply','then','destroy','error','name','send','index','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','pick','filter','where','merge','VIRTUAL','MailServerOut','count','includeAll','include','findAll','rows','show','options','create','body','catch','update','params','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash'];(function(_0x25d4ee,_0xc95872){var _0x214a35=function(_0x4285a0){while(--_0x4285a0){_0x25d4ee['push'](_0x25d4ee['shift']());}};_0x214a35(++_0xc95872);}(_0x6dd9,0xc5));var _0x96dd=function(_0xc09594,_0x400f5e){_0xc09594=_0xc09594-0x0;var _0x572d70=_0x6dd9[_0xc09594];return _0x572d70;};'use strict';var pdf=require(_0x96dd('0x0'));var emlformat=require(_0x96dd('0x1'));var rimraf=require(_0x96dd('0x2'));var zipdir=require(_0x96dd('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x96dd('0x4'));var moment=require(_0x96dd('0x5'));var BPromise=require(_0x96dd('0x6'));var Mustache=require(_0x96dd('0x7'));var util=require(_0x96dd('0x8'));var path=require(_0x96dd('0x9'));var sox=require(_0x96dd('0xa'));var csv=require(_0x96dd('0xb'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x96dd('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x96dd('0xd'));var deskjs=require(_0x96dd('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x96dd('0xf'));var authService=require(_0x96dd('0x10'));var qs=require(_0x96dd('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x96dd('0x12'));var logger=require(_0x96dd('0x13'))(_0x96dd('0x14'));var utils=require(_0x96dd('0x15'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x44df95,_0x14d1c2){_0x14d1c2=_0x14d1c2||0xcc;return function(_0x27f4ce){if(_0x27f4ce){return _0x44df95[_0x96dd('0x16')](_0x14d1c2);}return _0x44df95['status'](_0x14d1c2)[_0x96dd('0x17')]();};}function respondWithResult(_0x554cb5,_0xb83929){_0xb83929=_0xb83929||0xc8;return function(_0x752273){if(_0x752273){return _0x554cb5[_0x96dd('0x18')](_0xb83929)[_0x96dd('0x19')](_0x752273);}};}function respondWithFilteredResult(_0x3a5761,_0x430b3f){return function(_0xfdc177){if(_0xfdc177){var _0x3a7bb6=_0xfdc177['count'],_0x3024a7=_0x430b3f[_0x96dd('0x1a')],_0x587104=_0x430b3f[_0x96dd('0x1a')]+_0x430b3f[_0x96dd('0x1b')],_0x3dce2d;if(_0x587104>=_0x3a7bb6){_0x587104=_0x3a7bb6;_0x3dce2d=0xc8;}else{_0x3dce2d=0xce;}_0x3a5761[_0x96dd('0x18')](_0x3dce2d);return _0x3a5761[_0x96dd('0x1c')]('Content-Range',_0x3024a7+'-'+_0x587104+'/'+_0x3a7bb6)['json'](_0xfdc177);}return null;};}function patchUpdates(_0x3a15bc){return function(_0x28e61a){try{jsonpatch[_0x96dd('0x1d')](_0x28e61a,_0x3a15bc,!![]);}catch(_0xf99e60){return BPromise['reject'](_0xf99e60);}return _0x28e61a['save']();};}function saveUpdates(_0x2fa15d,_0x118e65){return function(_0x1ddf7c){if(_0x1ddf7c){return _0x1ddf7c['update'](_0x2fa15d)[_0x96dd('0x1e')](function(_0x1379d6){return _0x1379d6;});}return null;};}function removeEntity(_0x36966c,_0x45ad1f){return function(_0x20a5fe){if(_0x20a5fe){return _0x20a5fe[_0x96dd('0x1f')]()['then'](function(){_0x36966c['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x184efc,_0x4b0964){return function(_0x3ab324){if(!_0x3ab324){_0x184efc[_0x96dd('0x16')](0x194);}return _0x3ab324;};}function handleError(_0x278237,_0x70fc8d){_0x70fc8d=_0x70fc8d||0x1f4;return function(_0x344a9a){logger[_0x96dd('0x20')](_0x344a9a['stack']);if(_0x344a9a[_0x96dd('0x21')]){delete _0x344a9a[_0x96dd('0x21')];}_0x278237[_0x96dd('0x18')](_0x70fc8d)[_0x96dd('0x22')](_0x344a9a);};}exports[_0x96dd('0x23')]=function(_0x19cc4a,_0x51ba34){var _0x3b9fab={},_0x913ee8={},_0x1545c3={'count':0x0,'rows':[]};var _0xd05113=_['map'](db['MailServerOut'][_0x96dd('0x24')],function(_0x2252d4){return{'name':_0x2252d4[_0x96dd('0x25')],'type':_0x2252d4[_0x96dd('0x26')][_0x96dd('0x27')]};});_0x913ee8[_0x96dd('0x28')]=_[_0x96dd('0x29')](_0xd05113,_0x96dd('0x21'));_0x913ee8[_0x96dd('0x2a')]=_[_0x96dd('0x2b')](_0x19cc4a[_0x96dd('0x2a')]);_0x913ee8[_0x96dd('0x2c')]=_[_0x96dd('0x2d')](_0x913ee8['model'],_0x913ee8['query']);_0x3b9fab['attributes']=_[_0x96dd('0x2d')](_0x913ee8['model'],qs[_0x96dd('0x2e')](_0x19cc4a[_0x96dd('0x2a')]['fields']));_0x3b9fab[_0x96dd('0x2f')]=_0x3b9fab[_0x96dd('0x2f')][_0x96dd('0x30')]?_0x3b9fab[_0x96dd('0x2f')]:_0x913ee8[_0x96dd('0x28')];if(!_0x19cc4a['query'][_0x96dd('0x31')](_0x96dd('0x32'))){_0x3b9fab[_0x96dd('0x1b')]=qs[_0x96dd('0x1b')](_0x19cc4a[_0x96dd('0x2a')][_0x96dd('0x1b')]);_0x3b9fab['offset']=qs[_0x96dd('0x1a')](_0x19cc4a[_0x96dd('0x2a')]['offset']);}_0x3b9fab['order']=qs[_0x96dd('0x33')](_0x19cc4a['query'][_0x96dd('0x33')]);_0x3b9fab['where']=qs['filters'](_[_0x96dd('0x34')](_0x19cc4a[_0x96dd('0x2a')],_0x913ee8[_0x96dd('0x2c')]),_0xd05113);if(_0x19cc4a[_0x96dd('0x2a')][_0x96dd('0x35')]){_0x3b9fab[_0x96dd('0x36')]=_[_0x96dd('0x37')](_0x3b9fab[_0x96dd('0x36')],{'$or':_[_0x96dd('0x29')](_0xd05113,function(_0x3ae854){if(_0x3ae854[_0x96dd('0x26')]!==_0x96dd('0x38')){var _0x43e33c={};_0x43e33c[_0x3ae854[_0x96dd('0x21')]]={'$like':'%'+_0x19cc4a[_0x96dd('0x2a')][_0x96dd('0x35')]+'%'};return _0x43e33c;}})});}_0x3b9fab=_['merge']({},_0x3b9fab,_0x19cc4a['options']);var _0x46b3f8={'where':_0x3b9fab['where']};return db[_0x96dd('0x39')][_0x96dd('0x3a')](_0x46b3f8)[_0x96dd('0x1e')](function(_0x26e0c3){_0x1545c3[_0x96dd('0x3a')]=_0x26e0c3;if(_0x19cc4a[_0x96dd('0x2a')][_0x96dd('0x3b')]){_0x3b9fab[_0x96dd('0x3c')]=[{'all':!![]}];}return db['MailServerOut'][_0x96dd('0x3d')](_0x3b9fab);})['then'](function(_0x11a3ef){_0x1545c3[_0x96dd('0x3e')]=_0x11a3ef;return _0x1545c3;})[_0x96dd('0x1e')](respondWithFilteredResult(_0x51ba34,_0x3b9fab))['catch'](handleError(_0x51ba34,null));};exports[_0x96dd('0x3f')]=function(_0x2f60c5,_0x24e1d2){var _0x53f1bc={'raw':!![],'where':{'id':_0x2f60c5['params']['id']}},_0x174bb0={};_0x174bb0[_0x96dd('0x28')]=_[_0x96dd('0x2b')](db[_0x96dd('0x39')][_0x96dd('0x24')]);_0x174bb0[_0x96dd('0x2a')]=_[_0x96dd('0x2b')](_0x2f60c5[_0x96dd('0x2a')]);_0x174bb0[_0x96dd('0x2c')]=_['intersection'](_0x174bb0[_0x96dd('0x28')],_0x174bb0[_0x96dd('0x2a')]);_0x53f1bc['attributes']=_[_0x96dd('0x2d')](_0x174bb0[_0x96dd('0x28')],qs[_0x96dd('0x2e')](_0x2f60c5['query'][_0x96dd('0x2e')]));_0x53f1bc[_0x96dd('0x2f')]=_0x53f1bc[_0x96dd('0x2f')][_0x96dd('0x30')]?_0x53f1bc[_0x96dd('0x2f')]:_0x174bb0[_0x96dd('0x28')];if(_0x2f60c5[_0x96dd('0x2a')][_0x96dd('0x3b')]){_0x53f1bc[_0x96dd('0x3c')]=[{'all':!![]}];}_0x53f1bc=_[_0x96dd('0x37')]({},_0x53f1bc,_0x2f60c5[_0x96dd('0x40')]);return db[_0x96dd('0x39')]['find'](_0x53f1bc)[_0x96dd('0x1e')](handleEntityNotFound(_0x24e1d2,null))[_0x96dd('0x1e')](respondWithResult(_0x24e1d2,null))['catch'](handleError(_0x24e1d2,null));};exports[_0x96dd('0x41')]=function(_0x1eff12,_0x8fa8fb){return db[_0x96dd('0x39')]['create'](_0x1eff12[_0x96dd('0x42')],{})[_0x96dd('0x1e')](respondWithResult(_0x8fa8fb,0xc9))[_0x96dd('0x43')](handleError(_0x8fa8fb,null));};exports[_0x96dd('0x44')]=function(_0xada603,_0xaa21c5){if(_0xada603[_0x96dd('0x42')]['id']){delete _0xada603[_0x96dd('0x42')]['id'];}return db['MailServerOut']['find']({'where':{'id':_0xada603[_0x96dd('0x45')]['id']}})['then'](handleEntityNotFound(_0xaa21c5,null))['then'](saveUpdates(_0xada603['body'],null))[_0x96dd('0x1e')](respondWithResult(_0xaa21c5,null))[_0x96dd('0x43')](handleError(_0xaa21c5,null));};exports[_0x96dd('0x1f')]=function(_0x212787,_0x16000d){return db[_0x96dd('0x39')]['find']({'where':{'id':_0x212787[_0x96dd('0x45')]['id']}})[_0x96dd('0x1e')](handleEntityNotFound(_0x16000d,null))[_0x96dd('0x1e')](removeEntity(_0x16000d,null))['catch'](handleError(_0x16000d,null));};
\ No newline at end of file
diff --git a/server/api/mailServerOut/mailServerOut.model.js b/server/api/mailServerOut/mailServerOut.model.js
index 81ff8a9..997a69b 100644
--- a/server/api/mailServerOut/mailServerOut.model.js
+++ b/server/api/mailServerOut/mailServerOut.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xf1ed=['lodash','../../config/logger','moment','bluebird','request-promise','path','../../config/environment','./mailServerOut.attributes','exports','MailServerOut','mail_servers_out'];(function(_0x23783b,_0x1d8ad5){var _0xeed397=function(_0xc9071e){while(--_0xc9071e){_0x23783b['push'](_0x23783b['shift']());}};_0xeed397(++_0x1d8ad5);}(_0xf1ed,0x1d9));var _0xdf1e=function(_0x57b60d,_0x1b7744){_0x57b60d=_0x57b60d-0x0;var _0x50f0b5=_0xf1ed[_0x57b60d];return _0x50f0b5;};'use strict';var _=require(_0xdf1e('0x0'));var util=require('util');var logger=require(_0xdf1e('0x1'))('api');var moment=require(_0xdf1e('0x2'));var BPromise=require(_0xdf1e('0x3'));var rp=require(_0xdf1e('0x4'));var fs=require('fs');var path=require(_0xdf1e('0x5'));var rimraf=require('rimraf');var config=require(_0xdf1e('0x6'));var attributes=require(_0xdf1e('0x7'));module[_0xdf1e('0x8')]=function(_0x46ef94,_0x9efac6){return _0x46ef94['define'](_0xdf1e('0x9'),attributes,{'tableName':_0xdf1e('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xea57=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./mailServerOut.attributes','mail_servers_out'];(function(_0x3e5086,_0x48f4a2){var _0xfeb102=function(_0x5a945f){while(--_0x5a945f){_0x3e5086['push'](_0x3e5086['shift']());}};_0xfeb102(++_0x48f4a2);}(_0xea57,0x84));var _0x7ea5=function(_0x56bb79,_0x358515){_0x56bb79=_0x56bb79-0x0;var _0x3049e4=_0xea57[_0x56bb79];return _0x3049e4;};'use strict';var _=require(_0x7ea5('0x0'));var util=require(_0x7ea5('0x1'));var logger=require(_0x7ea5('0x2'))(_0x7ea5('0x3'));var moment=require(_0x7ea5('0x4'));var BPromise=require(_0x7ea5('0x5'));var rp=require(_0x7ea5('0x6'));var fs=require('fs');var path=require(_0x7ea5('0x7'));var rimraf=require(_0x7ea5('0x8'));var config=require(_0x7ea5('0x9'));var attributes=require(_0x7ea5('0xa'));module['exports']=function(_0x533f7d,_0x1bc0d8){return _0x533f7d['define']('MailServerOut',attributes,{'tableName':_0x7ea5('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/mailServerOut/mailServerOut.rpc.js b/server/api/mailServerOut/mailServerOut.rpc.js
index 4e79699..6704df5 100644
--- a/server/api/mailServerOut/mailServerOut.rpc.js
+++ b/server/api/mailServerOut/mailServerOut.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x1304=['request\x20sent','debug','MailServerOut,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','MailServerOut,\x20%s,\x20%s'];(function(_0x296a79,_0x125ec7){var _0x245e9d=function(_0x4376e2){while(--_0x4376e2){_0x296a79['push'](_0x296a79['shift']());}};_0x245e9d(++_0x125ec7);}(_0x1304,0x171));var _0x4130=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1304[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x4130('0x0'));var moment=require(_0x4130('0x1'));var BPromise=require(_0x4130('0x2'));var rs=require(_0x4130('0x3'));var fs=require('fs');var Redis=require(_0x4130('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x4130('0x5'));var logger=require(_0x4130('0x6'))(_0x4130('0x7'));var config=require(_0x4130('0x8'));var jayson=require(_0x4130('0x9'));var client=jayson['client'][_0x4130('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2b75d4,_0x2f672a,_0x1d1391){return new BPromise(function(_0x3ab341,_0x29f0d0){return client[_0x4130('0xb')](_0x2b75d4,_0x1d1391)[_0x4130('0xc')](function(_0x48dde5){logger[_0x4130('0xd')](_0x4130('0xe'),_0x2f672a,_0x4130('0xf'));logger[_0x4130('0x10')](_0x4130('0x11'),_0x2f672a,_0x4130('0xf'),JSON[_0x4130('0x12')](_0x48dde5));if(_0x48dde5[_0x4130('0x13')]){if(_0x48dde5[_0x4130('0x13')][_0x4130('0x14')]===0x1f4){logger['error'](_0x4130('0xe'),_0x2f672a,_0x48dde5[_0x4130('0x13')][_0x4130('0x15')]);return _0x29f0d0(_0x48dde5[_0x4130('0x13')]['message']);}logger['error']('MailServerOut,\x20%s,\x20%s',_0x2f672a,_0x48dde5['error'][_0x4130('0x15')]);return _0x3ab341(_0x48dde5['error'][_0x4130('0x15')]);}else{logger['info'](_0x4130('0xe'),_0x2f672a,_0x4130('0xf'));_0x3ab341(_0x48dde5[_0x4130('0x16')][_0x4130('0x15')]);}})[_0x4130('0x17')](function(_0x35fa5a){logger[_0x4130('0x13')]('MailServerOut,\x20%s,\x20%s',_0x2f672a,_0x35fa5a);_0x29f0d0(_0x35fa5a);});});}
\ No newline at end of file
+var _0x0237=['info','result','lodash','util','moment','bluebird','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','MailServerOut,\x20%s,\x20%s','request\x20sent','debug','MailServerOut,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x3e8c23,_0x3e1887){var _0x3fa914=function(_0x5e0814){while(--_0x5e0814){_0x3e8c23['push'](_0x3e8c23['shift']());}};_0x3fa914(++_0x3e1887);}(_0x0237,0x152));var _0x7023=function(_0x38173a,_0x2808d9){_0x38173a=_0x38173a-0x0;var _0x46be92=_0x0237[_0x38173a];return _0x46be92;};'use strict';var _=require(_0x7023('0x0'));var util=require(_0x7023('0x1'));var moment=require(_0x7023('0x2'));var BPromise=require(_0x7023('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x7023('0x4'));var logger=require(_0x7023('0x5'))(_0x7023('0x6'));var config=require(_0x7023('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x7023('0x8')][_0x7023('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1e5fd3,_0x48e149,_0x308a19){return new BPromise(function(_0xb43d81,_0x5e0a88){return client[_0x7023('0xa')](_0x1e5fd3,_0x308a19)['then'](function(_0x247d0c){logger['info'](_0x7023('0xb'),_0x48e149,_0x7023('0xc'));logger[_0x7023('0xd')](_0x7023('0xe'),_0x48e149,_0x7023('0xc'),JSON[_0x7023('0xf')](_0x247d0c));if(_0x247d0c[_0x7023('0x10')]){if(_0x247d0c[_0x7023('0x10')][_0x7023('0x11')]===0x1f4){logger[_0x7023('0x10')](_0x7023('0xb'),_0x48e149,_0x247d0c['error'][_0x7023('0x12')]);return _0x5e0a88(_0x247d0c['error'][_0x7023('0x12')]);}logger['error'](_0x7023('0xb'),_0x48e149,_0x247d0c[_0x7023('0x10')]['message']);return _0xb43d81(_0x247d0c[_0x7023('0x10')]['message']);}else{logger[_0x7023('0x13')](_0x7023('0xb'),_0x48e149,_0x7023('0xc'));_0xb43d81(_0x247d0c[_0x7023('0x14')][_0x7023('0x12')]);}})['catch'](function(_0x171191){logger[_0x7023('0x10')](_0x7023('0xb'),_0x48e149,_0x171191);_0x5e0a88(_0x171191);});});}
\ No newline at end of file
diff --git a/server/api/mailSubstatus/index.js b/server/api/mailSubstatus/index.js
index 663b32e..c7fe587 100644
--- a/server/api/mailSubstatus/index.js
+++ b/server/api/mailSubstatus/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xe789=['create','put','update','delete','destroy','exports','multer','util','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailSubstatus.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post'];(function(_0x212b52,_0x1b0637){var _0x589d3a=function(_0x25d442){while(--_0x25d442){_0x212b52['push'](_0x212b52['shift']());}};_0x589d3a(++_0x1b0637);}(_0xe789,0x74));var _0x9e78=function(_0x4c02a6,_0x267982){_0x4c02a6=_0x4c02a6-0x0;var _0x5b158e=_0xe789[_0x4c02a6];return _0x5b158e;};'use strict';var multer=require(_0x9e78('0x0'));var util=require(_0x9e78('0x1'));var path=require('path');var timeout=require(_0x9e78('0x2'));var express=require('express');var router=express[_0x9e78('0x3')]();var auth=require(_0x9e78('0x4'));var interaction=require(_0x9e78('0x5'));var config=require(_0x9e78('0x6'));var controller=require(_0x9e78('0x7'));router[_0x9e78('0x8')]('/',auth[_0x9e78('0x9')](),controller[_0x9e78('0xa')]);router[_0x9e78('0x8')](_0x9e78('0xb'),auth[_0x9e78('0x9')](),controller[_0x9e78('0xc')]);router[_0x9e78('0x8')](_0x9e78('0xd'),auth[_0x9e78('0x9')](),controller[_0x9e78('0xe')]);router[_0x9e78('0xf')]('/',auth['isAuthenticated'](),controller[_0x9e78('0x10')]);router[_0x9e78('0x11')](_0x9e78('0xd'),auth[_0x9e78('0x9')](),controller[_0x9e78('0x12')]);router[_0x9e78('0x13')]('/:id',auth[_0x9e78('0x9')](),controller[_0x9e78('0x14')]);module[_0x9e78('0x15')]=router;
\ No newline at end of file
+var _0x9999=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailSubstatus.controller','get','/describe','isAuthenticated','describe','/:id','post','create','put','update','delete','destroy','exports','multer'];(function(_0x1c3370,_0xf617e8){var _0xa9b358=function(_0x39cb44){while(--_0x39cb44){_0x1c3370['push'](_0x1c3370['shift']());}};_0xa9b358(++_0xf617e8);}(_0x9999,0x1c1));var _0x9999=function(_0x11308d,_0x1805d7){_0x11308d=_0x11308d-0x0;var _0x13c11d=_0x9999[_0x11308d];return _0x13c11d;};'use strict';var multer=require(_0x9999('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x9999('0x1')]();var auth=require(_0x9999('0x2'));var interaction=require(_0x9999('0x3'));var config=require(_0x9999('0x4'));var controller=require(_0x9999('0x5'));router[_0x9999('0x6')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x9999('0x7'),auth[_0x9999('0x8')](),controller[_0x9999('0x9')]);router[_0x9999('0x6')](_0x9999('0xa'),auth[_0x9999('0x8')](),controller['show']);router[_0x9999('0xb')]('/',auth[_0x9999('0x8')](),controller[_0x9999('0xc')]);router[_0x9999('0xd')](_0x9999('0xa'),auth['isAuthenticated'](),controller[_0x9999('0xe')]);router[_0x9999('0xf')]('/:id',auth['isAuthenticated'](),controller[_0x9999('0x10')]);module[_0x9999('0x11')]=router;
\ No newline at end of file
diff --git a/server/api/mailSubstatus/mailSubstatus.attributes.js b/server/api/mailSubstatus/mailSubstatus.attributes.js
index fe4b1f2..775bc3c 100644
--- a/server/api/mailSubstatus/mailSubstatus.attributes.js
+++ b/server/api/mailSubstatus/mailSubstatus.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9c1d=['exports','STRING','sequelize'];(function(_0x47651c,_0x244398){var _0x3f4fff=function(_0x1b89e6){while(--_0x1b89e6){_0x47651c['push'](_0x47651c['shift']());}};_0x3f4fff(++_0x244398);}(_0x9c1d,0x1a9));var _0xd9c1=function(_0x3b0bb5,_0xf889e8){_0x3b0bb5=_0x3b0bb5-0x0;var _0x54f734=_0x9c1d[_0x3b0bb5];return _0x54f734;};'use strict';var Sequelize=require(_0xd9c1('0x0'));module[_0xd9c1('0x1')]={'name':{'type':Sequelize[_0xd9c1('0x2')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xd9c1('0x2')]}};
\ No newline at end of file
+var _0x8c8b=['STRING','sequelize','name'];(function(_0xb1c60b,_0x385134){var _0x4c391d=function(_0x34a8f3){while(--_0x34a8f3){_0xb1c60b['push'](_0xb1c60b['shift']());}};_0x4c391d(++_0x385134);}(_0x8c8b,0x106));var _0xb8c8=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x8c8b[_0x122ef9];return _0x42fba0;};'use strict';var Sequelize=require(_0xb8c8('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0xb8c8('0x1'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xb8c8('0x2')]}};
\ No newline at end of file
diff --git a/server/api/mailSubstatus/mailSubstatus.controller.js b/server/api/mailSubstatus/mailSubstatus.controller.js
index 2beaa93..8a230d8 100644
--- a/server/api/mailSubstatus/mailSubstatus.controller.js
+++ b/server/api/mailSubstatus/mailSubstatus.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x01b7=['find','catch','create','body','describe','html-pdf','eml-format','rimraf','fast-json-patch','moment','bluebird','util','to-csv','ejs','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','end','status','count','offset','limit','set','json','apply','save','update','then','destroy','error','name','send','index','MailSubstatus','rawAttributes','type','key','model','map','query','keys','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','filters','filter','merge','options','includeAll','include','findAll','rows','show','params'];(function(_0x7ceb,_0x1e269e){var _0x132251=function(_0x1b4710){while(--_0x1b4710){_0x7ceb['push'](_0x7ceb['shift']());}};_0x132251(++_0x1e269e);}(_0x01b7,0x1a9));var _0x701b=function(_0x148785,_0x195ee5){_0x148785=_0x148785-0x0;var _0x17a172=_0x01b7[_0x148785];return _0x17a172;};'use strict';var pdf=require(_0x701b('0x0'));var emlformat=require(_0x701b('0x1'));var rimraf=require(_0x701b('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x701b('0x3'));var rp=require('request-promise');var moment=require(_0x701b('0x4'));var BPromise=require(_0x701b('0x5'));var Mustache=require('mustache');var util=require(_0x701b('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x701b('0x7'));var ejs=require(_0x701b('0x8'));var fs=require('fs');var _=require(_0x701b('0x9'));var squel=require(_0x701b('0xa'));var crypto=require(_0x701b('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x701b('0xc'));var toCsv=require(_0x701b('0x7'));var querystring=require('querystring');var Papa=require(_0x701b('0xd'));var Redis=require(_0x701b('0xe'));var authService=require(_0x701b('0xf'));var qs=require(_0x701b('0x10'));var as=require(_0x701b('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x701b('0x12'))(_0x701b('0x13'));var utils=require(_0x701b('0x14'));var config=require(_0x701b('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4e5c6f,_0x16df93){_0x16df93=_0x16df93||0xcc;return function(_0x181424){if(_0x181424){return _0x4e5c6f[_0x701b('0x16')](_0x16df93);}return _0x4e5c6f['status'](_0x16df93)[_0x701b('0x17')]();};}function respondWithResult(_0x27fdb5,_0x500814){_0x500814=_0x500814||0xc8;return function(_0x2a2b23){if(_0x2a2b23){return _0x27fdb5[_0x701b('0x18')](_0x500814)['json'](_0x2a2b23);}};}function respondWithFilteredResult(_0xce0931,_0x25d889){return function(_0x4be758){if(_0x4be758){var _0x7467c1=_0x4be758[_0x701b('0x19')],_0x56f2e5=_0x25d889['offset'],_0x46ea6a=_0x25d889[_0x701b('0x1a')]+_0x25d889[_0x701b('0x1b')],_0x25087b;if(_0x46ea6a>=_0x7467c1){_0x46ea6a=_0x7467c1;_0x25087b=0xc8;}else{_0x25087b=0xce;}_0xce0931[_0x701b('0x18')](_0x25087b);return _0xce0931[_0x701b('0x1c')]('Content-Range',_0x56f2e5+'-'+_0x46ea6a+'/'+_0x7467c1)[_0x701b('0x1d')](_0x4be758);}return null;};}function patchUpdates(_0x49bbe2){return function(_0x4b6a3c){try{jsonpatch[_0x701b('0x1e')](_0x4b6a3c,_0x49bbe2,!![]);}catch(_0x445155){return BPromise['reject'](_0x445155);}return _0x4b6a3c[_0x701b('0x1f')]();};}function saveUpdates(_0x1dbc9f,_0x24266a){return function(_0x45f065){if(_0x45f065){return _0x45f065[_0x701b('0x20')](_0x1dbc9f)[_0x701b('0x21')](function(_0x290dd3){return _0x290dd3;});}return null;};}function removeEntity(_0x34dc87,_0x2e55bd){return function(_0x2ba961){if(_0x2ba961){return _0x2ba961[_0x701b('0x22')]()[_0x701b('0x21')](function(){_0x34dc87[_0x701b('0x18')](0xcc)[_0x701b('0x17')]();});}};}function handleEntityNotFound(_0x173c33,_0x299de4){return function(_0x365287){if(!_0x365287){_0x173c33[_0x701b('0x16')](0x194);}return _0x365287;};}function handleError(_0x4f0527,_0x1c6bc4){_0x1c6bc4=_0x1c6bc4||0x1f4;return function(_0x3c04df){logger[_0x701b('0x23')](_0x3c04df['stack']);if(_0x3c04df[_0x701b('0x24')]){delete _0x3c04df['name'];}_0x4f0527[_0x701b('0x18')](_0x1c6bc4)[_0x701b('0x25')](_0x3c04df);};}exports[_0x701b('0x26')]=function(_0x39631d,_0x59ef4c){var _0x2910b9={},_0x4ffb6a={},_0x4cd143={'count':0x0,'rows':[]};var _0x3679e6=_['map'](db[_0x701b('0x27')][_0x701b('0x28')],function(_0x25d99a){return{'name':_0x25d99a['fieldName'],'type':_0x25d99a[_0x701b('0x29')][_0x701b('0x2a')]};});_0x4ffb6a[_0x701b('0x2b')]=_[_0x701b('0x2c')](_0x3679e6,_0x701b('0x24'));_0x4ffb6a[_0x701b('0x2d')]=_[_0x701b('0x2e')](_0x39631d[_0x701b('0x2d')]);_0x4ffb6a['filters']=_[_0x701b('0x2f')](_0x4ffb6a[_0x701b('0x2b')],_0x4ffb6a[_0x701b('0x2d')]);_0x2910b9['attributes']=_[_0x701b('0x2f')](_0x4ffb6a[_0x701b('0x2b')],qs[_0x701b('0x30')](_0x39631d['query'][_0x701b('0x30')]));_0x2910b9[_0x701b('0x31')]=_0x2910b9[_0x701b('0x31')][_0x701b('0x32')]?_0x2910b9[_0x701b('0x31')]:_0x4ffb6a['model'];if(!_0x39631d[_0x701b('0x2d')][_0x701b('0x33')]('nolimit')){_0x2910b9['limit']=qs['limit'](_0x39631d[_0x701b('0x2d')][_0x701b('0x1b')]);_0x2910b9['offset']=qs[_0x701b('0x1a')](_0x39631d[_0x701b('0x2d')][_0x701b('0x1a')]);}_0x2910b9[_0x701b('0x34')]=qs[_0x701b('0x35')](_0x39631d[_0x701b('0x2d')][_0x701b('0x35')]);_0x2910b9[_0x701b('0x36')]=qs['filters'](_['pick'](_0x39631d['query'],_0x4ffb6a[_0x701b('0x37')]),_0x3679e6);if(_0x39631d[_0x701b('0x2d')][_0x701b('0x38')]){_0x2910b9[_0x701b('0x36')]=_[_0x701b('0x39')](_0x2910b9[_0x701b('0x36')],{'$or':_['map'](_0x3679e6,function(_0x35acbb){if(_0x35acbb[_0x701b('0x29')]!=='VIRTUAL'){var _0xcb54b7={};_0xcb54b7[_0x35acbb[_0x701b('0x24')]]={'$like':'%'+_0x39631d[_0x701b('0x2d')]['filter']+'%'};return _0xcb54b7;}})});}_0x2910b9=_[_0x701b('0x39')]({},_0x2910b9,_0x39631d[_0x701b('0x3a')]);var _0x1d3253={'where':_0x2910b9[_0x701b('0x36')]};return db['MailSubstatus']['count'](_0x1d3253)['then'](function(_0x383061){_0x4cd143[_0x701b('0x19')]=_0x383061;if(_0x39631d[_0x701b('0x2d')][_0x701b('0x3b')]){_0x2910b9[_0x701b('0x3c')]=[{'all':!![]}];}return db[_0x701b('0x27')][_0x701b('0x3d')](_0x2910b9);})[_0x701b('0x21')](function(_0x3735f7){_0x4cd143[_0x701b('0x3e')]=_0x3735f7;return _0x4cd143;})['then'](respondWithFilteredResult(_0x59ef4c,_0x2910b9))['catch'](handleError(_0x59ef4c,null));};exports[_0x701b('0x3f')]=function(_0x10ce80,_0x313027){var _0x56c57c={'raw':!![],'where':{'id':_0x10ce80[_0x701b('0x40')]['id']}},_0x7658d2={};_0x7658d2['model']=_[_0x701b('0x2e')](db['MailSubstatus'][_0x701b('0x28')]);_0x7658d2[_0x701b('0x2d')]=_[_0x701b('0x2e')](_0x10ce80['query']);_0x7658d2[_0x701b('0x37')]=_[_0x701b('0x2f')](_0x7658d2[_0x701b('0x2b')],_0x7658d2[_0x701b('0x2d')]);_0x56c57c[_0x701b('0x31')]=_[_0x701b('0x2f')](_0x7658d2[_0x701b('0x2b')],qs[_0x701b('0x30')](_0x10ce80['query'][_0x701b('0x30')]));_0x56c57c[_0x701b('0x31')]=_0x56c57c[_0x701b('0x31')][_0x701b('0x32')]?_0x56c57c[_0x701b('0x31')]:_0x7658d2['model'];if(_0x10ce80['query'][_0x701b('0x3b')]){_0x56c57c[_0x701b('0x3c')]=[{'all':!![]}];}_0x56c57c=_['merge']({},_0x56c57c,_0x10ce80['options']);return db[_0x701b('0x27')][_0x701b('0x41')](_0x56c57c)['then'](handleEntityNotFound(_0x313027,null))[_0x701b('0x21')](respondWithResult(_0x313027,null))[_0x701b('0x42')](handleError(_0x313027,null));};exports[_0x701b('0x43')]=function(_0x10e386,_0x31b951){return db['MailSubstatus']['create'](_0x10e386['body'],{})['then'](respondWithResult(_0x31b951,0xc9))[_0x701b('0x42')](handleError(_0x31b951,null));};exports[_0x701b('0x20')]=function(_0x32a6e1,_0x270d29){if(_0x32a6e1[_0x701b('0x44')]['id']){delete _0x32a6e1[_0x701b('0x44')]['id'];}return db[_0x701b('0x27')]['find']({'where':{'id':_0x32a6e1['params']['id']}})[_0x701b('0x21')](handleEntityNotFound(_0x270d29,null))[_0x701b('0x21')](saveUpdates(_0x32a6e1[_0x701b('0x44')],null))[_0x701b('0x21')](respondWithResult(_0x270d29,null))[_0x701b('0x42')](handleError(_0x270d29,null));};exports['destroy']=function(_0x5b16c7,_0xf86a50){return db[_0x701b('0x27')]['find']({'where':{'id':_0x5b16c7[_0x701b('0x40')]['id']}})['then'](handleEntityNotFound(_0xf86a50,null))[_0x701b('0x21')](removeEntity(_0xf86a50,null))['catch'](handleError(_0xf86a50,null));};exports[_0x701b('0x45')]=function(_0x11c9aa,_0x3b9c66){return db[_0x701b('0x27')][_0x701b('0x45')]()[_0x701b('0x21')](respondWithResult(_0x3b9c66,null))[_0x701b('0x42')](handleError(_0x3b9c66,null));};
\ No newline at end of file
+var _0x9e37=['../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','MailSubstatus','rawAttributes','fieldName','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','VIRTUAL','options','count','includeAll','include','rows','show','params','find','create','body','catch','describe','html-pdf','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','path','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x9e37,0x152));var _0x79e3=function(_0x3bf9b7,_0x2d9b97){_0x3bf9b7=_0x3bf9b7-0x0;var _0x566013=_0x9e37[_0x3bf9b7];return _0x566013;};'use strict';var pdf=require(_0x79e3('0x0'));var emlformat=require(_0x79e3('0x1'));var rimraf=require(_0x79e3('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x79e3('0x3'));var rp=require('request-promise');var moment=require(_0x79e3('0x4'));var BPromise=require(_0x79e3('0x5'));var Mustache=require(_0x79e3('0x6'));var util=require('util');var path=require(_0x79e3('0x7'));var sox=require('sox');var csv=require(_0x79e3('0x8'));var ejs=require(_0x79e3('0x9'));var fs=require('fs');var _=require('lodash');var squel=require(_0x79e3('0xa'));var crypto=require(_0x79e3('0xb'));var jsforce=require(_0x79e3('0xc'));var deskjs=require(_0x79e3('0xd'));var toCsv=require(_0x79e3('0x8'));var querystring=require(_0x79e3('0xe'));var Papa=require(_0x79e3('0xf'));var Redis=require('ioredis');var authService=require(_0x79e3('0x10'));var qs=require(_0x79e3('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x79e3('0x12'))(_0x79e3('0x13'));var utils=require('../../config/utils');var config=require(_0x79e3('0x14'));var db=require(_0x79e3('0x15'))['db'];function respondWithStatusCode(_0x2084f7,_0x48ba37){_0x48ba37=_0x48ba37||0xcc;return function(_0x5d39d9){if(_0x5d39d9){return _0x2084f7[_0x79e3('0x16')](_0x48ba37);}return _0x2084f7[_0x79e3('0x17')](_0x48ba37)[_0x79e3('0x18')]();};}function respondWithResult(_0x5644a3,_0xfe5b73){_0xfe5b73=_0xfe5b73||0xc8;return function(_0x2acf2a){if(_0x2acf2a){return _0x5644a3[_0x79e3('0x17')](_0xfe5b73)[_0x79e3('0x19')](_0x2acf2a);}};}function respondWithFilteredResult(_0x188f7d,_0x1683d5){return function(_0x43dfba){if(_0x43dfba){var _0x4f552b=_0x43dfba['count'],_0x19a8c5=_0x1683d5[_0x79e3('0x1a')],_0x4c757c=_0x1683d5[_0x79e3('0x1a')]+_0x1683d5[_0x79e3('0x1b')],_0x94212e;if(_0x4c757c>=_0x4f552b){_0x4c757c=_0x4f552b;_0x94212e=0xc8;}else{_0x94212e=0xce;}_0x188f7d[_0x79e3('0x17')](_0x94212e);return _0x188f7d['set'](_0x79e3('0x1c'),_0x19a8c5+'-'+_0x4c757c+'/'+_0x4f552b)[_0x79e3('0x19')](_0x43dfba);}return null;};}function patchUpdates(_0x505754){return function(_0x43f571){try{jsonpatch[_0x79e3('0x1d')](_0x43f571,_0x505754,!![]);}catch(_0xe9e2f7){return BPromise[_0x79e3('0x1e')](_0xe9e2f7);}return _0x43f571[_0x79e3('0x1f')]();};}function saveUpdates(_0x4821cb,_0x45d993){return function(_0x3f6d18){if(_0x3f6d18){return _0x3f6d18[_0x79e3('0x20')](_0x4821cb)[_0x79e3('0x21')](function(_0x380846){return _0x380846;});}return null;};}function removeEntity(_0x279357,_0x5e3153){return function(_0x24f54a){if(_0x24f54a){return _0x24f54a[_0x79e3('0x22')]()[_0x79e3('0x21')](function(){_0x279357[_0x79e3('0x17')](0xcc)[_0x79e3('0x18')]();});}};}function handleEntityNotFound(_0x43f4db,_0x2523ae){return function(_0x42c78c){if(!_0x42c78c){_0x43f4db[_0x79e3('0x16')](0x194);}return _0x42c78c;};}function handleError(_0x196387,_0x1eccf5){_0x1eccf5=_0x1eccf5||0x1f4;return function(_0x4e1965){logger[_0x79e3('0x23')](_0x4e1965[_0x79e3('0x24')]);if(_0x4e1965[_0x79e3('0x25')]){delete _0x4e1965[_0x79e3('0x25')];}_0x196387[_0x79e3('0x17')](_0x1eccf5)[_0x79e3('0x26')](_0x4e1965);};}exports[_0x79e3('0x27')]=function(_0x489b06,_0x45d50d){var _0x197aec={},_0x348ba7={},_0x46538d={'count':0x0,'rows':[]};var _0x4aa548=_[_0x79e3('0x28')](db[_0x79e3('0x29')][_0x79e3('0x2a')],function(_0x491e40){return{'name':_0x491e40[_0x79e3('0x2b')],'type':_0x491e40['type']['key']};});_0x348ba7[_0x79e3('0x2c')]=_[_0x79e3('0x28')](_0x4aa548,_0x79e3('0x25'));_0x348ba7[_0x79e3('0x2d')]=_[_0x79e3('0x2e')](_0x489b06[_0x79e3('0x2d')]);_0x348ba7[_0x79e3('0x2f')]=_[_0x79e3('0x30')](_0x348ba7[_0x79e3('0x2c')],_0x348ba7['query']);_0x197aec[_0x79e3('0x31')]=_['intersection'](_0x348ba7[_0x79e3('0x2c')],qs[_0x79e3('0x32')](_0x489b06[_0x79e3('0x2d')]['fields']));_0x197aec['attributes']=_0x197aec[_0x79e3('0x31')][_0x79e3('0x33')]?_0x197aec[_0x79e3('0x31')]:_0x348ba7[_0x79e3('0x2c')];if(!_0x489b06[_0x79e3('0x2d')][_0x79e3('0x34')]('nolimit')){_0x197aec['limit']=qs['limit'](_0x489b06[_0x79e3('0x2d')][_0x79e3('0x1b')]);_0x197aec['offset']=qs['offset'](_0x489b06['query'][_0x79e3('0x1a')]);}_0x197aec[_0x79e3('0x35')]=qs[_0x79e3('0x36')](_0x489b06[_0x79e3('0x2d')][_0x79e3('0x36')]);_0x197aec[_0x79e3('0x37')]=qs[_0x79e3('0x2f')](_[_0x79e3('0x38')](_0x489b06['query'],_0x348ba7[_0x79e3('0x2f')]),_0x4aa548);if(_0x489b06[_0x79e3('0x2d')][_0x79e3('0x39')]){_0x197aec[_0x79e3('0x37')]=_['merge'](_0x197aec[_0x79e3('0x37')],{'$or':_[_0x79e3('0x28')](_0x4aa548,function(_0x5f53f1){if(_0x5f53f1['type']!==_0x79e3('0x3a')){var _0x253c99={};_0x253c99[_0x5f53f1[_0x79e3('0x25')]]={'$like':'%'+_0x489b06[_0x79e3('0x2d')]['filter']+'%'};return _0x253c99;}})});}_0x197aec=_['merge']({},_0x197aec,_0x489b06[_0x79e3('0x3b')]);var _0x28a970={'where':_0x197aec['where']};return db[_0x79e3('0x29')][_0x79e3('0x3c')](_0x28a970)[_0x79e3('0x21')](function(_0x42cb98){_0x46538d[_0x79e3('0x3c')]=_0x42cb98;if(_0x489b06[_0x79e3('0x2d')][_0x79e3('0x3d')]){_0x197aec[_0x79e3('0x3e')]=[{'all':!![]}];}return db['MailSubstatus']['findAll'](_0x197aec);})[_0x79e3('0x21')](function(_0x230c4b){_0x46538d[_0x79e3('0x3f')]=_0x230c4b;return _0x46538d;})[_0x79e3('0x21')](respondWithFilteredResult(_0x45d50d,_0x197aec))['catch'](handleError(_0x45d50d,null));};exports[_0x79e3('0x40')]=function(_0x5cec37,_0x458da6){var _0x400927={'raw':!![],'where':{'id':_0x5cec37[_0x79e3('0x41')]['id']}},_0x4e2011={};_0x4e2011[_0x79e3('0x2c')]=_[_0x79e3('0x2e')](db[_0x79e3('0x29')][_0x79e3('0x2a')]);_0x4e2011[_0x79e3('0x2d')]=_['keys'](_0x5cec37[_0x79e3('0x2d')]);_0x4e2011[_0x79e3('0x2f')]=_[_0x79e3('0x30')](_0x4e2011[_0x79e3('0x2c')],_0x4e2011[_0x79e3('0x2d')]);_0x400927[_0x79e3('0x31')]=_['intersection'](_0x4e2011[_0x79e3('0x2c')],qs[_0x79e3('0x32')](_0x5cec37[_0x79e3('0x2d')][_0x79e3('0x32')]));_0x400927['attributes']=_0x400927[_0x79e3('0x31')][_0x79e3('0x33')]?_0x400927[_0x79e3('0x31')]:_0x4e2011['model'];if(_0x5cec37[_0x79e3('0x2d')][_0x79e3('0x3d')]){_0x400927[_0x79e3('0x3e')]=[{'all':!![]}];}_0x400927=_['merge']({},_0x400927,_0x5cec37[_0x79e3('0x3b')]);return db[_0x79e3('0x29')][_0x79e3('0x42')](_0x400927)[_0x79e3('0x21')](handleEntityNotFound(_0x458da6,null))['then'](respondWithResult(_0x458da6,null))['catch'](handleError(_0x458da6,null));};exports['create']=function(_0x49d546,_0x285a57){return db['MailSubstatus'][_0x79e3('0x43')](_0x49d546[_0x79e3('0x44')],{})[_0x79e3('0x21')](respondWithResult(_0x285a57,0xc9))[_0x79e3('0x45')](handleError(_0x285a57,null));};exports[_0x79e3('0x20')]=function(_0x3fe51d,_0x50610f){if(_0x3fe51d[_0x79e3('0x44')]['id']){delete _0x3fe51d[_0x79e3('0x44')]['id'];}return db[_0x79e3('0x29')]['find']({'where':{'id':_0x3fe51d[_0x79e3('0x41')]['id']}})['then'](handleEntityNotFound(_0x50610f,null))['then'](saveUpdates(_0x3fe51d[_0x79e3('0x44')],null))[_0x79e3('0x21')](respondWithResult(_0x50610f,null))[_0x79e3('0x45')](handleError(_0x50610f,null));};exports[_0x79e3('0x22')]=function(_0x2659a7,_0x118624){return db['MailSubstatus'][_0x79e3('0x42')]({'where':{'id':_0x2659a7[_0x79e3('0x41')]['id']}})[_0x79e3('0x21')](handleEntityNotFound(_0x118624,null))[_0x79e3('0x21')](removeEntity(_0x118624,null))[_0x79e3('0x45')](handleError(_0x118624,null));};exports[_0x79e3('0x46')]=function(_0x38b84c,_0x32dcf1){return db['MailSubstatus'][_0x79e3('0x46')]()[_0x79e3('0x21')](respondWithResult(_0x32dcf1,null))['catch'](handleError(_0x32dcf1,null));};
\ No newline at end of file
diff --git a/server/api/mailSubstatus/mailSubstatus.model.js b/server/api/mailSubstatus/mailSubstatus.model.js
index 55ecf4b..006421d 100644
--- a/server/api/mailSubstatus/mailSubstatus.model.js
+++ b/server/api/mailSubstatus/mailSubstatus.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x545e=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','define','MailSubstatus','../../config/logger'];(function(_0x3aa9fc,_0x525788){var _0x3f27fd=function(_0x31a5fc){while(--_0x31a5fc){_0x3aa9fc['push'](_0x3aa9fc['shift']());}};_0x3f27fd(++_0x525788);}(_0x545e,0xbd));var _0xe545=function(_0x192dc4,_0x10b4be){_0x192dc4=_0x192dc4-0x0;var _0x109931=_0x545e[_0x192dc4];return _0x109931;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xe545('0x0'))(_0xe545('0x1'));var moment=require(_0xe545('0x2'));var BPromise=require(_0xe545('0x3'));var rp=require(_0xe545('0x4'));var fs=require('fs');var path=require(_0xe545('0x5'));var rimraf=require(_0xe545('0x6'));var config=require(_0xe545('0x7'));var attributes=require('./mailSubstatus.attributes');module['exports']=function(_0x1c376d,_0x164500){return _0x1c376d[_0xe545('0x8')](_0xe545('0x9'),attributes,{'tableName':'mail_substatuses','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xe17b=['moment','bluebird','path','rimraf','../../config/environment','./mailSubstatus.attributes','define','MailSubstatus','lodash','util','../../config/logger','api'];(function(_0xc0a86e,_0x4081b0){var _0x46b304=function(_0x3fa3cb){while(--_0x3fa3cb){_0xc0a86e['push'](_0xc0a86e['shift']());}};_0x46b304(++_0x4081b0);}(_0xe17b,0x1c4));var _0xbe17=function(_0x3f6b1b,_0x58d3d6){_0x3f6b1b=_0x3f6b1b-0x0;var _0x4a3d2b=_0xe17b[_0x3f6b1b];return _0x4a3d2b;};'use strict';var _=require(_0xbe17('0x0'));var util=require(_0xbe17('0x1'));var logger=require(_0xbe17('0x2'))(_0xbe17('0x3'));var moment=require(_0xbe17('0x4'));var BPromise=require(_0xbe17('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xbe17('0x6'));var rimraf=require(_0xbe17('0x7'));var config=require(_0xbe17('0x8'));var attributes=require(_0xbe17('0x9'));module['exports']=function(_0x260d2d,_0x5beb9c){return _0x260d2d[_0xbe17('0xa')](_0xbe17('0xb'),attributes,{'tableName':'mail_substatuses','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/mailSubstatus/mailSubstatus.rpc.js b/server/api/mailSubstatus/mailSubstatus.rpc.js
index 7dfb235..345f1fb 100644
--- a/server/api/mailSubstatus/mailSubstatus.rpc.js
+++ b/server/api/mailSubstatus/mailSubstatus.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xb4e6=['../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','then','info','MailSubstatus,\x20%s,\x20%s','request\x20sent','debug','MailSubstatus,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x2ce286,_0x4104e4){var _0x4c471f=function(_0x43326c){while(--_0x43326c){_0x2ce286['push'](_0x2ce286['shift']());}};_0x4c471f(++_0x4104e4);}(_0xb4e6,0x1f4));var _0x6b4e=function(_0x493a51,_0x45128c){_0x493a51=_0x493a51-0x0;var _0xc85756=_0xb4e6[_0x493a51];return _0xc85756;};'use strict';var _=require(_0x6b4e('0x0'));var util=require('util');var moment=require(_0x6b4e('0x1'));var BPromise=require(_0x6b4e('0x2'));var rs=require(_0x6b4e('0x3'));var fs=require('fs');var Redis=require(_0x6b4e('0x4'));var db=require(_0x6b4e('0x5'))['db'];var utils=require(_0x6b4e('0x6'));var logger=require(_0x6b4e('0x7'))('rpc');var config=require(_0x6b4e('0x8'));var jayson=require(_0x6b4e('0x9'));var client=jayson[_0x6b4e('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0xd3138f,_0x570346,_0x4f00be){return new BPromise(function(_0x2311d9,_0x48c870){return client['request'](_0xd3138f,_0x4f00be)[_0x6b4e('0xb')](function(_0x2bd576){logger[_0x6b4e('0xc')](_0x6b4e('0xd'),_0x570346,_0x6b4e('0xe'));logger[_0x6b4e('0xf')](_0x6b4e('0x10'),_0x570346,'request\x20sent',JSON[_0x6b4e('0x11')](_0x2bd576));if(_0x2bd576[_0x6b4e('0x12')]){if(_0x2bd576['error'][_0x6b4e('0x13')]===0x1f4){logger[_0x6b4e('0x12')](_0x6b4e('0xd'),_0x570346,_0x2bd576[_0x6b4e('0x12')][_0x6b4e('0x14')]);return _0x48c870(_0x2bd576[_0x6b4e('0x12')][_0x6b4e('0x14')]);}logger['error'](_0x6b4e('0xd'),_0x570346,_0x2bd576[_0x6b4e('0x12')]['message']);return _0x2311d9(_0x2bd576[_0x6b4e('0x12')]['message']);}else{logger[_0x6b4e('0xc')](_0x6b4e('0xd'),_0x570346,_0x6b4e('0xe'));_0x2311d9(_0x2bd576[_0x6b4e('0x15')][_0x6b4e('0x14')]);}})[_0x6b4e('0x16')](function(_0x53a934){logger['error'](_0x6b4e('0xd'),_0x570346,_0x53a934);_0x48c870(_0x53a934);});});}
\ No newline at end of file
+var _0xa75b=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','MailSubstatus,\x20%s,\x20%s','request\x20sent','debug','MailSubstatus,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x1bf4f9,_0x5f33bf){var _0x25592c=function(_0x529d29){while(--_0x529d29){_0x1bf4f9['push'](_0x1bf4f9['shift']());}};_0x25592c(++_0x5f33bf);}(_0xa75b,0x170));var _0xba75=function(_0x4bef9e,_0x309963){_0x4bef9e=_0x4bef9e-0x0;var _0x3d0b1f=_0xa75b[_0x4bef9e];return _0x3d0b1f;};'use strict';var _=require(_0xba75('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xba75('0x1'));var rs=require(_0xba75('0x2'));var fs=require('fs');var Redis=require(_0xba75('0x3'));var db=require(_0xba75('0x4'))['db'];var utils=require(_0xba75('0x5'));var logger=require(_0xba75('0x6'))(_0xba75('0x7'));var config=require(_0xba75('0x8'));var jayson=require(_0xba75('0x9'));var client=jayson[_0xba75('0xa')][_0xba75('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x238a33,_0x3ccab5,_0x5c79e3){return new BPromise(function(_0x4b842d,_0x731cae){return client['request'](_0x238a33,_0x5c79e3)['then'](function(_0x218dbd){logger['info'](_0xba75('0xc'),_0x3ccab5,_0xba75('0xd'));logger[_0xba75('0xe')](_0xba75('0xf'),_0x3ccab5,_0xba75('0xd'),JSON[_0xba75('0x10')](_0x218dbd));if(_0x218dbd[_0xba75('0x11')]){if(_0x218dbd[_0xba75('0x11')][_0xba75('0x12')]===0x1f4){logger[_0xba75('0x11')](_0xba75('0xc'),_0x3ccab5,_0x218dbd[_0xba75('0x11')]['message']);return _0x731cae(_0x218dbd['error'][_0xba75('0x13')]);}logger['error'](_0xba75('0xc'),_0x3ccab5,_0x218dbd[_0xba75('0x11')][_0xba75('0x13')]);return _0x4b842d(_0x218dbd[_0xba75('0x11')]['message']);}else{logger[_0xba75('0x14')](_0xba75('0xc'),_0x3ccab5,_0xba75('0xd'));_0x4b842d(_0x218dbd[_0xba75('0x15')][_0xba75('0x13')]);}})['catch'](function(_0x350a9d){logger[_0xba75('0x11')](_0xba75('0xc'),_0x3ccab5,_0x350a9d);_0x731cae(_0x350a9d);});});}
\ No newline at end of file
diff --git a/server/api/mailTransferReport/index.js b/server/api/mailTransferReport/index.js
index f5783f3..8e28bfb 100644
--- a/server/api/mailTransferReport/index.js
+++ b/server/api/mailTransferReport/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xfbf6=['express','Router','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','post','create','put','update','delete','destroy','multer','util','path','connect-timeout'];(function(_0x386277,_0x5828fe){var _0xec69fc=function(_0x136206){while(--_0x136206){_0x386277['push'](_0x386277['shift']());}};_0xec69fc(++_0x5828fe);}(_0xfbf6,0x1c4));var _0x6fbf=function(_0x24b245,_0x1b3508){_0x24b245=_0x24b245-0x0;var _0x56f828=_0xfbf6[_0x24b245];return _0x56f828;};'use strict';var multer=require(_0x6fbf('0x0'));var util=require(_0x6fbf('0x1'));var path=require(_0x6fbf('0x2'));var timeout=require(_0x6fbf('0x3'));var express=require(_0x6fbf('0x4'));var router=express[_0x6fbf('0x5')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x6fbf('0x6'));var controller=require('./mailTransferReport.controller');router[_0x6fbf('0x7')]('/',auth[_0x6fbf('0x8')](),controller[_0x6fbf('0x9')]);router[_0x6fbf('0x7')](_0x6fbf('0xa'),auth[_0x6fbf('0x8')](),controller[_0x6fbf('0xb')]);router[_0x6fbf('0x7')](_0x6fbf('0xc'),auth['isAuthenticated'](),controller['show']);router[_0x6fbf('0xd')]('/',auth['isAuthenticated'](),controller[_0x6fbf('0xe')]);router[_0x6fbf('0xf')](_0x6fbf('0xc'),auth[_0x6fbf('0x8')](),controller[_0x6fbf('0x10')]);router[_0x6fbf('0x11')](_0x6fbf('0xc'),auth[_0x6fbf('0x8')](),controller[_0x6fbf('0x12')]);module['exports']=router;
\ No newline at end of file
+var _0x2122=['show','post','create','put','/:id','update','delete','destroy','exports','path','Router','../../components/auth/service','../../components/interaction/service','./mailTransferReport.controller','get','isAuthenticated','index','/describe'];(function(_0x370021,_0x3453c9){var _0x299767=function(_0x3a1a52){while(--_0x3a1a52){_0x370021['push'](_0x370021['shift']());}};_0x299767(++_0x3453c9);}(_0x2122,0xf3));var _0x2212=function(_0x5a4b5a,_0x16af6e){_0x5a4b5a=_0x5a4b5a-0x0;var _0x2f57bf=_0x2122[_0x5a4b5a];return _0x2f57bf;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x2212('0x0'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x2212('0x1')]();var auth=require(_0x2212('0x2'));var interaction=require(_0x2212('0x3'));var config=require('../../config/environment');var controller=require(_0x2212('0x4'));router[_0x2212('0x5')]('/',auth[_0x2212('0x6')](),controller[_0x2212('0x7')]);router[_0x2212('0x5')](_0x2212('0x8'),auth[_0x2212('0x6')](),controller['describe']);router[_0x2212('0x5')]('/:id',auth[_0x2212('0x6')](),controller[_0x2212('0x9')]);router[_0x2212('0xa')]('/',auth['isAuthenticated'](),controller[_0x2212('0xb')]);router[_0x2212('0xc')](_0x2212('0xd'),auth[_0x2212('0x6')](),controller[_0x2212('0xe')]);router[_0x2212('0xf')](_0x2212('0xd'),auth[_0x2212('0x6')](),controller[_0x2212('0x10')]);module[_0x2212('0x11')]=router;
\ No newline at end of file
diff --git a/server/api/mailTransferReport/mailTransferReport.attributes.js b/server/api/mailTransferReport/mailTransferReport.attributes.js
index 06befa0..daa50e4 100644
--- a/server/api/mailTransferReport/mailTransferReport.attributes.js
+++ b/server/api/mailTransferReport/mailTransferReport.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x22da=['moment','sequelize','STRING','account','agent','DATE'];(function(_0x13f678,_0x2be848){var _0x332514=function(_0xd14016){while(--_0xd14016){_0x13f678['push'](_0x13f678['shift']());}};_0x332514(++_0x2be848);}(_0x22da,0xd8));var _0xa22d=function(_0x5deea2,_0x12d1ce){_0x5deea2=_0x5deea2-0x0;var _0x5c7a61=_0x22da[_0x5deea2];return _0x5c7a61;};'use strict';var moment=require(_0xa22d('0x0'));var Sequelize=require(_0xa22d('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0xa22d('0x2')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xa22d('0x3'),_0xa22d('0x4'),'queue'),'allowNull':![],'defaultValue':'queue'},'transferredAt':{'type':Sequelize[_0xa22d('0x5')],'allowNull':![],'defaultValue':Sequelize['NOW']}};
\ No newline at end of file
+var _0x6870=['queue','DATE','sequelize','exports','STRING','ENUM','account'];(function(_0x37e974,_0x439356){var _0x1f38c2=function(_0x5caedc){while(--_0x5caedc){_0x37e974['push'](_0x37e974['shift']());}};_0x1f38c2(++_0x439356);}(_0x6870,0x1d0));var _0x0687=function(_0x5d72c8,_0x85e2e1){_0x5d72c8=_0x5d72c8-0x0;var _0x3abc9e=_0x6870[_0x5d72c8];return _0x3abc9e;};'use strict';var moment=require('moment');var Sequelize=require(_0x0687('0x0'));module[_0x0687('0x1')]={'uniqueid':{'type':Sequelize[_0x0687('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x0687('0x3')](_0x0687('0x4'),'agent',_0x0687('0x5')),'allowNull':![],'defaultValue':_0x0687('0x5')},'transferredAt':{'type':Sequelize[_0x0687('0x6')],'allowNull':![],'defaultValue':Sequelize['NOW']}};
\ No newline at end of file
diff --git a/server/api/mailTransferReport/mailTransferReport.controller.js b/server/api/mailTransferReport/mailTransferReport.controller.js
index 76cb623..6857451 100644
--- a/server/api/mailTransferReport/mailTransferReport.controller.js
+++ b/server/api/mailTransferReport/mailTransferReport.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x0930=['name','send','index','map','MailTransferReport','rawAttributes','type','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','show','params','keys','length','options','find','catch','create','body','destroy','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','status','end','count','offset','Content-Range','json','apply','reject','save','then','sendStatus','stack'];(function(_0x464cde,_0x383009){var _0x190615=function(_0x12c029){while(--_0x12c029){_0x464cde['push'](_0x464cde['shift']());}};_0x190615(++_0x383009);}(_0x0930,0x111));var _0x0093=function(_0x510c60,_0x50247e){_0x510c60=_0x510c60-0x0;var _0x49c4aa=_0x0930[_0x510c60];return _0x49c4aa;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x0093('0x0'));var zipdir=require(_0x0093('0x1'));var jsonpatch=require(_0x0093('0x2'));var rp=require(_0x0093('0x3'));var moment=require(_0x0093('0x4'));var BPromise=require(_0x0093('0x5'));var Mustache=require(_0x0093('0x6'));var util=require(_0x0093('0x7'));var path=require(_0x0093('0x8'));var sox=require(_0x0093('0x9'));var csv=require(_0x0093('0xa'));var ejs=require(_0x0093('0xb'));var fs=require('fs');var _=require(_0x0093('0xc'));var squel=require(_0x0093('0xd'));var crypto=require(_0x0093('0xe'));var jsforce=require(_0x0093('0xf'));var deskjs=require(_0x0093('0x10'));var toCsv=require('to-csv');var querystring=require(_0x0093('0x11'));var Papa=require(_0x0093('0x12'));var Redis=require(_0x0093('0x13'));var authService=require(_0x0093('0x14'));var qs=require(_0x0093('0x15'));var as=require(_0x0093('0x16'));var hardwareService=require(_0x0093('0x17'));var logger=require(_0x0093('0x18'))(_0x0093('0x19'));var utils=require('../../config/utils');var config=require(_0x0093('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5c5e70,_0x5e9ac5){_0x5e9ac5=_0x5e9ac5||0xcc;return function(_0x348698){if(_0x348698){return _0x5c5e70['sendStatus'](_0x5e9ac5);}return _0x5c5e70[_0x0093('0x1b')](_0x5e9ac5)[_0x0093('0x1c')]();};}function respondWithResult(_0x38dd6d,_0x38e3f8){_0x38e3f8=_0x38e3f8||0xc8;return function(_0x356d8b){if(_0x356d8b){return _0x38dd6d['status'](_0x38e3f8)['json'](_0x356d8b);}};}function respondWithFilteredResult(_0x5c1211,_0xce49e5){return function(_0x10e407){if(_0x10e407){var _0x1c1981=_0x10e407[_0x0093('0x1d')],_0x4921c0=_0xce49e5[_0x0093('0x1e')],_0x433541=_0xce49e5[_0x0093('0x1e')]+_0xce49e5['limit'],_0x2fe87d;if(_0x433541>=_0x1c1981){_0x433541=_0x1c1981;_0x2fe87d=0xc8;}else{_0x2fe87d=0xce;}_0x5c1211[_0x0093('0x1b')](_0x2fe87d);return _0x5c1211['set'](_0x0093('0x1f'),_0x4921c0+'-'+_0x433541+'/'+_0x1c1981)[_0x0093('0x20')](_0x10e407);}return null;};}function patchUpdates(_0x2ab6ff){return function(_0x342a77){try{jsonpatch[_0x0093('0x21')](_0x342a77,_0x2ab6ff,!![]);}catch(_0x4162e3){return BPromise[_0x0093('0x22')](_0x4162e3);}return _0x342a77[_0x0093('0x23')]();};}function saveUpdates(_0x4b911c,_0x6e1d37){return function(_0x4db771){if(_0x4db771){return _0x4db771['update'](_0x4b911c)[_0x0093('0x24')](function(_0x1325c7){return _0x1325c7;});}return null;};}function removeEntity(_0x57b497,_0x3116ca){return function(_0xedbad5){if(_0xedbad5){return _0xedbad5['destroy']()['then'](function(){_0x57b497[_0x0093('0x1b')](0xcc)[_0x0093('0x1c')]();});}};}function handleEntityNotFound(_0x52b295,_0x462c26){return function(_0x56e56c){if(!_0x56e56c){_0x52b295[_0x0093('0x25')](0x194);}return _0x56e56c;};}function handleError(_0x43a245,_0x3312fe){_0x3312fe=_0x3312fe||0x1f4;return function(_0x52119e){logger['error'](_0x52119e[_0x0093('0x26')]);if(_0x52119e[_0x0093('0x27')]){delete _0x52119e['name'];}_0x43a245[_0x0093('0x1b')](_0x3312fe)[_0x0093('0x28')](_0x52119e);};}exports[_0x0093('0x29')]=function(_0x497206,_0x245ce7){var _0x4b4827={},_0x5d47ae={},_0x2cdf6d={'count':0x0,'rows':[]};var _0x3f2fa3=_[_0x0093('0x2a')](db[_0x0093('0x2b')][_0x0093('0x2c')],function(_0x1822b7){return{'name':_0x1822b7['fieldName'],'type':_0x1822b7[_0x0093('0x2d')][_0x0093('0x2e')]};});_0x5d47ae[_0x0093('0x2f')]=_[_0x0093('0x2a')](_0x3f2fa3,'name');_0x5d47ae['query']=_['keys'](_0x497206[_0x0093('0x30')]);_0x5d47ae[_0x0093('0x31')]=_[_0x0093('0x32')](_0x5d47ae[_0x0093('0x2f')],_0x5d47ae[_0x0093('0x30')]);_0x4b4827[_0x0093('0x33')]=_['intersection'](_0x5d47ae[_0x0093('0x2f')],qs['fields'](_0x497206[_0x0093('0x30')][_0x0093('0x34')]));_0x4b4827[_0x0093('0x33')]=_0x4b4827[_0x0093('0x33')]['length']?_0x4b4827[_0x0093('0x33')]:_0x5d47ae[_0x0093('0x2f')];if(!_0x497206[_0x0093('0x30')][_0x0093('0x35')](_0x0093('0x36'))){_0x4b4827[_0x0093('0x37')]=qs[_0x0093('0x37')](_0x497206[_0x0093('0x30')][_0x0093('0x37')]);_0x4b4827[_0x0093('0x1e')]=qs[_0x0093('0x1e')](_0x497206[_0x0093('0x30')]['offset']);}_0x4b4827[_0x0093('0x38')]=qs[_0x0093('0x39')](_0x497206['query'][_0x0093('0x39')]);_0x4b4827[_0x0093('0x3a')]=qs['filters'](_[_0x0093('0x3b')](_0x497206[_0x0093('0x30')],_0x5d47ae[_0x0093('0x31')]),_0x3f2fa3);if(_0x497206[_0x0093('0x30')][_0x0093('0x3c')]){_0x4b4827[_0x0093('0x3a')]=_[_0x0093('0x3d')](_0x4b4827[_0x0093('0x3a')],{'$or':_[_0x0093('0x2a')](_0x3f2fa3,function(_0x454074){if(_0x454074[_0x0093('0x2d')]!==_0x0093('0x3e')){var _0xfd5c6a={};_0xfd5c6a[_0x454074[_0x0093('0x27')]]={'$like':'%'+_0x497206[_0x0093('0x30')][_0x0093('0x3c')]+'%'};return _0xfd5c6a;}})});}_0x4b4827=_['merge']({},_0x4b4827,_0x497206['options']);var _0x5cba4f={'where':_0x4b4827['where']};return db['MailTransferReport']['count'](_0x5cba4f)[_0x0093('0x24')](function(_0x5dd929){_0x2cdf6d[_0x0093('0x1d')]=_0x5dd929;if(_0x497206[_0x0093('0x30')][_0x0093('0x3f')]){_0x4b4827[_0x0093('0x40')]=[{'all':!![]}];}return db[_0x0093('0x2b')][_0x0093('0x41')](_0x4b4827);})[_0x0093('0x24')](function(_0x35b89d){_0x2cdf6d[_0x0093('0x42')]=_0x35b89d;return _0x2cdf6d;})[_0x0093('0x24')](respondWithFilteredResult(_0x245ce7,_0x4b4827))['catch'](handleError(_0x245ce7,null));};exports[_0x0093('0x43')]=function(_0x1d7c23,_0x1d4a69){var _0x6c57d8={'raw':!![],'where':{'id':_0x1d7c23[_0x0093('0x44')]['id']}},_0x4ab76f={};_0x4ab76f[_0x0093('0x2f')]=_[_0x0093('0x45')](db['MailTransferReport'][_0x0093('0x2c')]);_0x4ab76f[_0x0093('0x30')]=_[_0x0093('0x45')](_0x1d7c23[_0x0093('0x30')]);_0x4ab76f[_0x0093('0x31')]=_['intersection'](_0x4ab76f[_0x0093('0x2f')],_0x4ab76f[_0x0093('0x30')]);_0x6c57d8[_0x0093('0x33')]=_[_0x0093('0x32')](_0x4ab76f[_0x0093('0x2f')],qs[_0x0093('0x34')](_0x1d7c23['query'][_0x0093('0x34')]));_0x6c57d8[_0x0093('0x33')]=_0x6c57d8[_0x0093('0x33')][_0x0093('0x46')]?_0x6c57d8[_0x0093('0x33')]:_0x4ab76f[_0x0093('0x2f')];if(_0x1d7c23[_0x0093('0x30')][_0x0093('0x3f')]){_0x6c57d8[_0x0093('0x40')]=[{'all':!![]}];}_0x6c57d8=_[_0x0093('0x3d')]({},_0x6c57d8,_0x1d7c23[_0x0093('0x47')]);return db['MailTransferReport'][_0x0093('0x48')](_0x6c57d8)[_0x0093('0x24')](handleEntityNotFound(_0x1d4a69,null))[_0x0093('0x24')](respondWithResult(_0x1d4a69,null))[_0x0093('0x49')](handleError(_0x1d4a69,null));};exports[_0x0093('0x4a')]=function(_0x194630,_0x4f9a3f){return db[_0x0093('0x2b')][_0x0093('0x4a')](_0x194630[_0x0093('0x4b')],{})[_0x0093('0x24')](respondWithResult(_0x4f9a3f,0xc9))[_0x0093('0x49')](handleError(_0x4f9a3f,null));};exports['update']=function(_0x3dd85e,_0x1d8640){if(_0x3dd85e[_0x0093('0x4b')]['id']){delete _0x3dd85e[_0x0093('0x4b')]['id'];}return db[_0x0093('0x2b')][_0x0093('0x48')]({'where':{'id':_0x3dd85e[_0x0093('0x44')]['id']}})[_0x0093('0x24')](handleEntityNotFound(_0x1d8640,null))[_0x0093('0x24')](saveUpdates(_0x3dd85e[_0x0093('0x4b')],null))['then'](respondWithResult(_0x1d8640,null))[_0x0093('0x49')](handleError(_0x1d8640,null));};exports[_0x0093('0x4c')]=function(_0x83c010,_0x35160f){return db[_0x0093('0x2b')]['find']({'where':{'id':_0x83c010[_0x0093('0x44')]['id']}})[_0x0093('0x24')](handleEntityNotFound(_0x35160f,null))['then'](removeEntity(_0x35160f,null))[_0x0093('0x49')](handleError(_0x35160f,null));};exports[_0x0093('0x4d')]=function(_0x1be99d,_0x159baa){return db[_0x0093('0x2b')]['describe']()[_0x0093('0x24')](respondWithResult(_0x159baa,null))['catch'](handleError(_0x159baa,null));};
\ No newline at end of file
+var _0x67c9=['include','findAll','show','params','keys','length','find','create','body','catch','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','count','offset','limit','set','Content-Range','reject','save','update','then','destroy','error','name','send','index','map','MailTransferReport','rawAttributes','fieldName','type','model','query','filters','attributes','intersection','fields','hasOwnProperty','order','sort','filter','where','merge','VIRTUAL','options'];(function(_0x2d088c,_0x539a1b){var _0x4b9713=function(_0x32b1f6){while(--_0x32b1f6){_0x2d088c['push'](_0x2d088c['shift']());}};_0x4b9713(++_0x539a1b);}(_0x67c9,0xe6));var _0x967c=function(_0x5e6ea3,_0x9addd2){_0x5e6ea3=_0x5e6ea3-0x0;var _0x4048b5=_0x67c9[_0x5e6ea3];return _0x4048b5;};'use strict';var pdf=require(_0x967c('0x0'));var emlformat=require(_0x967c('0x1'));var rimraf=require(_0x967c('0x2'));var zipdir=require(_0x967c('0x3'));var jsonpatch=require(_0x967c('0x4'));var rp=require(_0x967c('0x5'));var moment=require(_0x967c('0x6'));var BPromise=require(_0x967c('0x7'));var Mustache=require(_0x967c('0x8'));var util=require(_0x967c('0x9'));var path=require('path');var sox=require(_0x967c('0xa'));var csv=require('to-csv');var ejs=require(_0x967c('0xb'));var fs=require('fs');var _=require(_0x967c('0xc'));var squel=require(_0x967c('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x967c('0xe'));var toCsv=require('to-csv');var querystring=require(_0x967c('0xf'));var Papa=require(_0x967c('0x10'));var Redis=require(_0x967c('0x11'));var authService=require(_0x967c('0x12'));var qs=require(_0x967c('0x13'));var as=require(_0x967c('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x967c('0x15'));var utils=require(_0x967c('0x16'));var config=require(_0x967c('0x17'));var db=require(_0x967c('0x18'))['db'];function respondWithStatusCode(_0x31ed6a,_0x17c5f6){_0x17c5f6=_0x17c5f6||0xcc;return function(_0xcf025b){if(_0xcf025b){return _0x31ed6a[_0x967c('0x19')](_0x17c5f6);}return _0x31ed6a['status'](_0x17c5f6)[_0x967c('0x1a')]();};}function respondWithResult(_0x5ebd06,_0x406402){_0x406402=_0x406402||0xc8;return function(_0x520b5e){if(_0x520b5e){return _0x5ebd06[_0x967c('0x1b')](_0x406402)[_0x967c('0x1c')](_0x520b5e);}};}function respondWithFilteredResult(_0x397691,_0x5aadcb){return function(_0x4a627a){if(_0x4a627a){var _0x3cb069=_0x4a627a[_0x967c('0x1d')],_0xfc0107=_0x5aadcb[_0x967c('0x1e')],_0x1e8122=_0x5aadcb[_0x967c('0x1e')]+_0x5aadcb[_0x967c('0x1f')],_0x210449;if(_0x1e8122>=_0x3cb069){_0x1e8122=_0x3cb069;_0x210449=0xc8;}else{_0x210449=0xce;}_0x397691[_0x967c('0x1b')](_0x210449);return _0x397691[_0x967c('0x20')](_0x967c('0x21'),_0xfc0107+'-'+_0x1e8122+'/'+_0x3cb069)[_0x967c('0x1c')](_0x4a627a);}return null;};}function patchUpdates(_0x537a42){return function(_0x34873f){try{jsonpatch['apply'](_0x34873f,_0x537a42,!![]);}catch(_0xb553cb){return BPromise[_0x967c('0x22')](_0xb553cb);}return _0x34873f[_0x967c('0x23')]();};}function saveUpdates(_0x371bef,_0x41042e){return function(_0x477d89){if(_0x477d89){return _0x477d89[_0x967c('0x24')](_0x371bef)[_0x967c('0x25')](function(_0x425228){return _0x425228;});}return null;};}function removeEntity(_0x64a791,_0x3b584d){return function(_0x169399){if(_0x169399){return _0x169399[_0x967c('0x26')]()[_0x967c('0x25')](function(){_0x64a791[_0x967c('0x1b')](0xcc)[_0x967c('0x1a')]();});}};}function handleEntityNotFound(_0x1e93e0,_0x5c71ca){return function(_0x44fceb){if(!_0x44fceb){_0x1e93e0[_0x967c('0x19')](0x194);}return _0x44fceb;};}function handleError(_0xd7aa15,_0x4293e8){_0x4293e8=_0x4293e8||0x1f4;return function(_0x12747d){logger[_0x967c('0x27')](_0x12747d['stack']);if(_0x12747d[_0x967c('0x28')]){delete _0x12747d[_0x967c('0x28')];}_0xd7aa15[_0x967c('0x1b')](_0x4293e8)[_0x967c('0x29')](_0x12747d);};}exports[_0x967c('0x2a')]=function(_0x5ab535,_0x4c3486){var _0xc6fa57={},_0xbd5388={},_0x230227={'count':0x0,'rows':[]};var _0x14b046=_[_0x967c('0x2b')](db[_0x967c('0x2c')][_0x967c('0x2d')],function(_0x11f0b9){return{'name':_0x11f0b9[_0x967c('0x2e')],'type':_0x11f0b9[_0x967c('0x2f')]['key']};});_0xbd5388[_0x967c('0x30')]=_['map'](_0x14b046,_0x967c('0x28'));_0xbd5388[_0x967c('0x31')]=_['keys'](_0x5ab535['query']);_0xbd5388[_0x967c('0x32')]=_['intersection'](_0xbd5388[_0x967c('0x30')],_0xbd5388[_0x967c('0x31')]);_0xc6fa57[_0x967c('0x33')]=_[_0x967c('0x34')](_0xbd5388[_0x967c('0x30')],qs[_0x967c('0x35')](_0x5ab535[_0x967c('0x31')]['fields']));_0xc6fa57[_0x967c('0x33')]=_0xc6fa57[_0x967c('0x33')]['length']?_0xc6fa57[_0x967c('0x33')]:_0xbd5388[_0x967c('0x30')];if(!_0x5ab535['query'][_0x967c('0x36')]('nolimit')){_0xc6fa57['limit']=qs[_0x967c('0x1f')](_0x5ab535['query'][_0x967c('0x1f')]);_0xc6fa57[_0x967c('0x1e')]=qs[_0x967c('0x1e')](_0x5ab535['query'][_0x967c('0x1e')]);}_0xc6fa57[_0x967c('0x37')]=qs[_0x967c('0x38')](_0x5ab535[_0x967c('0x31')]['sort']);_0xc6fa57['where']=qs['filters'](_['pick'](_0x5ab535['query'],_0xbd5388[_0x967c('0x32')]),_0x14b046);if(_0x5ab535[_0x967c('0x31')][_0x967c('0x39')]){_0xc6fa57[_0x967c('0x3a')]=_[_0x967c('0x3b')](_0xc6fa57['where'],{'$or':_[_0x967c('0x2b')](_0x14b046,function(_0x329951){if(_0x329951[_0x967c('0x2f')]!==_0x967c('0x3c')){var _0x19bc3b={};_0x19bc3b[_0x329951[_0x967c('0x28')]]={'$like':'%'+_0x5ab535[_0x967c('0x31')][_0x967c('0x39')]+'%'};return _0x19bc3b;}})});}_0xc6fa57=_['merge']({},_0xc6fa57,_0x5ab535[_0x967c('0x3d')]);var _0x3a09ea={'where':_0xc6fa57[_0x967c('0x3a')]};return db[_0x967c('0x2c')][_0x967c('0x1d')](_0x3a09ea)['then'](function(_0x55098e){_0x230227['count']=_0x55098e;if(_0x5ab535[_0x967c('0x31')]['includeAll']){_0xc6fa57[_0x967c('0x3e')]=[{'all':!![]}];}return db[_0x967c('0x2c')][_0x967c('0x3f')](_0xc6fa57);})[_0x967c('0x25')](function(_0x5dd0ad){_0x230227['rows']=_0x5dd0ad;return _0x230227;})[_0x967c('0x25')](respondWithFilteredResult(_0x4c3486,_0xc6fa57))['catch'](handleError(_0x4c3486,null));};exports[_0x967c('0x40')]=function(_0x19de08,_0x1dde22){var _0x2e3904={'raw':!![],'where':{'id':_0x19de08[_0x967c('0x41')]['id']}},_0x420889={};_0x420889[_0x967c('0x30')]=_[_0x967c('0x42')](db[_0x967c('0x2c')]['rawAttributes']);_0x420889[_0x967c('0x31')]=_[_0x967c('0x42')](_0x19de08[_0x967c('0x31')]);_0x420889[_0x967c('0x32')]=_[_0x967c('0x34')](_0x420889[_0x967c('0x30')],_0x420889[_0x967c('0x31')]);_0x2e3904[_0x967c('0x33')]=_[_0x967c('0x34')](_0x420889[_0x967c('0x30')],qs[_0x967c('0x35')](_0x19de08[_0x967c('0x31')][_0x967c('0x35')]));_0x2e3904[_0x967c('0x33')]=_0x2e3904[_0x967c('0x33')][_0x967c('0x43')]?_0x2e3904['attributes']:_0x420889[_0x967c('0x30')];if(_0x19de08[_0x967c('0x31')]['includeAll']){_0x2e3904['include']=[{'all':!![]}];}_0x2e3904=_[_0x967c('0x3b')]({},_0x2e3904,_0x19de08[_0x967c('0x3d')]);return db[_0x967c('0x2c')][_0x967c('0x44')](_0x2e3904)[_0x967c('0x25')](handleEntityNotFound(_0x1dde22,null))[_0x967c('0x25')](respondWithResult(_0x1dde22,null))['catch'](handleError(_0x1dde22,null));};exports[_0x967c('0x45')]=function(_0x19e2df,_0x142d3b){return db['MailTransferReport']['create'](_0x19e2df['body'],{})['then'](respondWithResult(_0x142d3b,0xc9))['catch'](handleError(_0x142d3b,null));};exports[_0x967c('0x24')]=function(_0x3baed0,_0x32ed1c){if(_0x3baed0[_0x967c('0x46')]['id']){delete _0x3baed0['body']['id'];}return db[_0x967c('0x2c')][_0x967c('0x44')]({'where':{'id':_0x3baed0[_0x967c('0x41')]['id']}})[_0x967c('0x25')](handleEntityNotFound(_0x32ed1c,null))[_0x967c('0x25')](saveUpdates(_0x3baed0[_0x967c('0x46')],null))[_0x967c('0x25')](respondWithResult(_0x32ed1c,null))[_0x967c('0x47')](handleError(_0x32ed1c,null));};exports[_0x967c('0x26')]=function(_0x4892c3,_0x38aad5){return db[_0x967c('0x2c')][_0x967c('0x44')]({'where':{'id':_0x4892c3['params']['id']}})['then'](handleEntityNotFound(_0x38aad5,null))[_0x967c('0x25')](removeEntity(_0x38aad5,null))['catch'](handleError(_0x38aad5,null));};exports[_0x967c('0x48')]=function(_0x590b64,_0x4fba70){return db[_0x967c('0x2c')][_0x967c('0x48')]()[_0x967c('0x25')](respondWithResult(_0x4fba70,null))[_0x967c('0x47')](handleError(_0x4fba70,null));};
\ No newline at end of file
diff --git a/server/api/mailTransferReport/mailTransferReport.model.js b/server/api/mailTransferReport/mailTransferReport.model.js
index c2154b5..1af6728 100644
--- a/server/api/mailTransferReport/mailTransferReport.model.js
+++ b/server/api/mailTransferReport/mailTransferReport.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x8dfe=['../../config/environment','./mailTransferReport.attributes','MailTransferReport','report_mail_transfer','uniqueid','util','../../config/logger','bluebird','request-promise','path','rimraf'];(function(_0x148130,_0x3a019d){var _0x2ee42d=function(_0x99aebc){while(--_0x99aebc){_0x148130['push'](_0x148130['shift']());}};_0x2ee42d(++_0x3a019d);}(_0x8dfe,0x10d));var _0xe8df=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0x8dfe[_0x167cc1];return _0x10bc4b;};'use strict';var _=require('lodash');var util=require(_0xe8df('0x0'));var logger=require(_0xe8df('0x1'))('api');var moment=require('moment');var BPromise=require(_0xe8df('0x2'));var rp=require(_0xe8df('0x3'));var fs=require('fs');var path=require(_0xe8df('0x4'));var rimraf=require(_0xe8df('0x5'));var config=require(_0xe8df('0x6'));var attributes=require(_0xe8df('0x7'));module['exports']=function(_0x11b2c9,_0x5a9c24){return _0x11b2c9['define'](_0xe8df('0x8'),attributes,{'tableName':_0xe8df('0x9'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0xe8df('0xa')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x56b5=['exports','MailTransferReport','report_mail_transfer','uniqueid','lodash','api','bluebird','request-promise','path','rimraf','../../config/environment','./mailTransferReport.attributes'];(function(_0xf0792b,_0x4c240e){var _0x484d4b=function(_0x369017){while(--_0x369017){_0xf0792b['push'](_0xf0792b['shift']());}};_0x484d4b(++_0x4c240e);}(_0x56b5,0x16c));var _0x556b=function(_0x23760f,_0x4ac726){_0x23760f=_0x23760f-0x0;var _0x3871ba=_0x56b5[_0x23760f];return _0x3871ba;};'use strict';var _=require(_0x556b('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x556b('0x1'));var moment=require('moment');var BPromise=require(_0x556b('0x2'));var rp=require(_0x556b('0x3'));var fs=require('fs');var path=require(_0x556b('0x4'));var rimraf=require(_0x556b('0x5'));var config=require(_0x556b('0x6'));var attributes=require(_0x556b('0x7'));module[_0x556b('0x8')]=function(_0xf49710,_0x5be528){return _0xf49710['define'](_0x556b('0x9'),attributes,{'tableName':_0x556b('0xa'),'paranoid':![],'indexes':[{'name':_0x556b('0xb'),'fields':[_0x556b('0xb')]}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/mailTransferReport/mailTransferReport.rpc.js b/server/api/mailTransferReport/mailTransferReport.rpc.js
index cabf2ff..0228fed 100644
--- a/server/api/mailTransferReport/mailTransferReport.rpc.js
+++ b/server/api/mailTransferReport/mailTransferReport.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xb288=['../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','MailTransferReport,\x20%s,\x20%s','request\x20sent','debug','MailTransferReport,\x20%s,\x20%s,\x20%s','error','code','message','result','lodash','bluebird','randomstring'];(function(_0x5cb071,_0x221434){var _0x19f64f=function(_0x3edc84){while(--_0x3edc84){_0x5cb071['push'](_0x5cb071['shift']());}};_0x19f64f(++_0x221434);}(_0xb288,0x1b5));var _0x8b28=function(_0x4a02d1,_0x2f05bf){_0x4a02d1=_0x4a02d1-0x0;var _0x3700f8=_0xb288[_0x4a02d1];return _0x3700f8;};'use strict';var _=require(_0x8b28('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x8b28('0x1'));var rs=require(_0x8b28('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8b28('0x3'))['db'];var utils=require(_0x8b28('0x4'));var logger=require(_0x8b28('0x5'))('rpc');var config=require(_0x8b28('0x6'));var jayson=require(_0x8b28('0x7'));var client=jayson[_0x8b28('0x8')][_0x8b28('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x46595c,_0x19813e,_0x1f63d3){return new BPromise(function(_0x455dd3,_0xe2bbc5){return client['request'](_0x46595c,_0x1f63d3)[_0x8b28('0xa')](function(_0x489d31){logger[_0x8b28('0xb')](_0x8b28('0xc'),_0x19813e,_0x8b28('0xd'));logger[_0x8b28('0xe')](_0x8b28('0xf'),_0x19813e,_0x8b28('0xd'),JSON['stringify'](_0x489d31));if(_0x489d31[_0x8b28('0x10')]){if(_0x489d31['error'][_0x8b28('0x11')]===0x1f4){logger[_0x8b28('0x10')](_0x8b28('0xc'),_0x19813e,_0x489d31[_0x8b28('0x10')][_0x8b28('0x12')]);return _0xe2bbc5(_0x489d31[_0x8b28('0x10')][_0x8b28('0x12')]);}logger['error']('MailTransferReport,\x20%s,\x20%s',_0x19813e,_0x489d31[_0x8b28('0x10')][_0x8b28('0x12')]);return _0x455dd3(_0x489d31[_0x8b28('0x10')][_0x8b28('0x12')]);}else{logger[_0x8b28('0xb')]('MailTransferReport,\x20%s,\x20%s',_0x19813e,_0x8b28('0xd'));_0x455dd3(_0x489d31[_0x8b28('0x13')][_0x8b28('0x12')]);}})['catch'](function(_0x3daa65){logger[_0x8b28('0x10')](_0x8b28('0xc'),_0x19813e,_0x3daa65);_0xe2bbc5(_0x3daa65);});});}
\ No newline at end of file
+var _0xf687=['MailTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','jayson/promise','client','http','request','info','MailTransferReport,\x20%s,\x20%s','request\x20sent'];(function(_0x263b0e,_0xc6479f){var _0x113fee=function(_0x803881){while(--_0x803881){_0x263b0e['push'](_0x263b0e['shift']());}};_0x113fee(++_0xc6479f);}(_0xf687,0xd7));var _0x7f68=function(_0xaeb344,_0x290b61){_0xaeb344=_0xaeb344-0x0;var _0x5c0a0a=_0xf687[_0xaeb344];return _0x5c0a0a;};'use strict';var _=require(_0x7f68('0x0'));var util=require(_0x7f68('0x1'));var moment=require('moment');var BPromise=require(_0x7f68('0x2'));var rs=require(_0x7f68('0x3'));var fs=require('fs');var Redis=require(_0x7f68('0x4'));var db=require(_0x7f68('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x7f68('0x6'));var client=jayson[_0x7f68('0x7')][_0x7f68('0x8')]({'port':0x232a});function respondWithRpcPromise(_0xba7d12,_0x5ab1d3,_0x4e6790){return new BPromise(function(_0x188bb5,_0x904c30){return client[_0x7f68('0x9')](_0xba7d12,_0x4e6790)['then'](function(_0x4fb6fd){logger[_0x7f68('0xa')](_0x7f68('0xb'),_0x5ab1d3,_0x7f68('0xc'));logger['debug'](_0x7f68('0xd'),_0x5ab1d3,'request\x20sent',JSON[_0x7f68('0xe')](_0x4fb6fd));if(_0x4fb6fd[_0x7f68('0xf')]){if(_0x4fb6fd[_0x7f68('0xf')]['code']===0x1f4){logger['error'](_0x7f68('0xb'),_0x5ab1d3,_0x4fb6fd[_0x7f68('0xf')][_0x7f68('0x10')]);return _0x904c30(_0x4fb6fd['error'][_0x7f68('0x10')]);}logger[_0x7f68('0xf')](_0x7f68('0xb'),_0x5ab1d3,_0x4fb6fd['error'][_0x7f68('0x10')]);return _0x188bb5(_0x4fb6fd[_0x7f68('0xf')][_0x7f68('0x10')]);}else{logger[_0x7f68('0xa')]('MailTransferReport,\x20%s,\x20%s',_0x5ab1d3,_0x7f68('0xc'));_0x188bb5(_0x4fb6fd[_0x7f68('0x11')]['message']);}})[_0x7f68('0x12')](function(_0xeadc4f){logger[_0x7f68('0xf')](_0x7f68('0xb'),_0x5ab1d3,_0xeadc4f);_0x904c30(_0xeadc4f);});});}
\ No newline at end of file
diff --git a/server/api/memberReport/index.js b/server/api/memberReport/index.js
index eb37181..14195f9 100644
--- a/server/api/memberReport/index.js
+++ b/server/api/memberReport/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x5fd3=['index','/describe','/:id','isAuthenticated','put','destroy','exports','multer','util','connect-timeout','express','Router','../../components/interaction/service','./memberReport.controller','get'];(function(_0x16dc96,_0x5e317b){var _0x1c3551=function(_0x4da139){while(--_0x4da139){_0x16dc96['push'](_0x16dc96['shift']());}};_0x1c3551(++_0x5e317b);}(_0x5fd3,0x1ba));var _0x35fd=function(_0x13fcce,_0x563df3){_0x13fcce=_0x13fcce-0x0;var _0x20d528=_0x5fd3[_0x13fcce];return _0x20d528;};'use strict';var multer=require(_0x35fd('0x0'));var util=require(_0x35fd('0x1'));var path=require('path');var timeout=require(_0x35fd('0x2'));var express=require(_0x35fd('0x3'));var router=express[_0x35fd('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x35fd('0x5'));var config=require('../../config/environment');var controller=require(_0x35fd('0x6'));router[_0x35fd('0x7')]('/',auth['isAuthenticated'](),controller[_0x35fd('0x8')]);router[_0x35fd('0x7')](_0x35fd('0x9'),auth['isAuthenticated'](),controller['describe']);router[_0x35fd('0x7')](_0x35fd('0xa'),auth[_0x35fd('0xb')](),controller['show']);router['post']('/',auth[_0x35fd('0xb')](),controller['create']);router[_0x35fd('0xc')]('/:id',auth[_0x35fd('0xb')](),controller['update']);router['delete'](_0x35fd('0xa'),auth['isAuthenticated'](),controller[_0x35fd('0xd')]);module[_0x35fd('0xe')]=router;
\ No newline at end of file
+var _0x4349=['Router','../../components/auth/service','../../config/environment','./memberReport.controller','get','isAuthenticated','index','/describe','describe','show','post','create','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout'];(function(_0x5dca0c,_0x316205){var _0xe7f040=function(_0x53770c){while(--_0x53770c){_0x5dca0c['push'](_0x5dca0c['shift']());}};_0xe7f040(++_0x316205);}(_0x4349,0x1df));var _0x9434=function(_0x438aa3,_0x477f23){_0x438aa3=_0x438aa3-0x0;var _0x54aef2=_0x4349[_0x438aa3];return _0x54aef2;};'use strict';var multer=require(_0x9434('0x0'));var util=require(_0x9434('0x1'));var path=require(_0x9434('0x2'));var timeout=require(_0x9434('0x3'));var express=require('express');var router=express[_0x9434('0x4')]();var auth=require(_0x9434('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x9434('0x6'));var controller=require(_0x9434('0x7'));router[_0x9434('0x8')]('/',auth[_0x9434('0x9')](),controller[_0x9434('0xa')]);router[_0x9434('0x8')](_0x9434('0xb'),auth[_0x9434('0x9')](),controller[_0x9434('0xc')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0x9434('0xd')]);router[_0x9434('0xe')]('/',auth['isAuthenticated'](),controller[_0x9434('0xf')]);router['put'](_0x9434('0x10'),auth[_0x9434('0x9')](),controller[_0x9434('0x11')]);router[_0x9434('0x12')](_0x9434('0x10'),auth[_0x9434('0x9')](),controller[_0x9434('0x13')]);module[_0x9434('0x14')]=router;
\ No newline at end of file
diff --git a/server/api/memberReport/memberReport.attributes.js b/server/api/memberReport/memberReport.attributes.js
index cedc5ea..d3e9842 100644
--- a/server/api/memberReport/memberReport.attributes.js
+++ b/server/api/memberReport/memberReport.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xebfb=['exitAt','duration','talk:[start]','talk:[destination]','talk:[dial\x20string]','talk:[queue]','INTEGER','sequelize','moment','STRING','DEFAULT\x20PAUSE','DATE','getDataValue','enterAt','seconds','setDataValue'];(function(_0x77301c,_0xe4b6e2){var _0x58afe1=function(_0x35639b){while(--_0x35639b){_0x77301c['push'](_0x77301c['shift']());}};_0x58afe1(++_0xe4b6e2);}(_0xebfb,0x87));var _0xbebf=function(_0x52f5e1,_0x2b485b){_0x52f5e1=_0x52f5e1-0x0;var _0xf2b5ea=_0xebfb[_0x52f5e1];return _0xf2b5ea;};'use strict';var Sequelize=require(_0xbebf('0x0'));var moment=require(_0xbebf('0x1'));module['exports']={'channel':{'type':Sequelize[_0xbebf('0x2')]},'membername':{'type':Sequelize[_0xbebf('0x2')]},'interface':{'type':Sequelize[_0xbebf('0x2')]},'type':{'type':Sequelize['STRING'],'defaultValue':_0xbebf('0x3'),'comment':'LOGIN,\x20PAUSE,\x20TALKING'},'duration':{'type':Sequelize['INTEGER']},'enterAt':{'type':Sequelize[_0xbebf('0x4')]},'exitAt':{'type':Sequelize[_0xbebf('0x4')],'set':function(_0x511f14){var _0x184502=moment(_0x511f14);var _0x399a87=moment(this[_0xbebf('0x5')](_0xbebf('0x6')));var _0x229e47=_0x184502['diff'](_0x399a87,_0xbebf('0x7'));this[_0xbebf('0x8')](_0xbebf('0x9'),_0x511f14);this[_0xbebf('0x8')](_0xbebf('0xa'),_0x229e47||null);}},'data1':{'type':Sequelize['STRING'],'comment':'talk:[inbound,\x20outbound],\x20pause:[reason]'},'data2':{'type':Sequelize[_0xbebf('0x2')],'comment':_0xbebf('0xb')},'data3':{'type':Sequelize['STRING'],'comment':_0xbebf('0xc')},'data4':{'type':Sequelize['STRING'],'comment':_0xbebf('0xd')},'data5':{'type':Sequelize[_0xbebf('0x2')],'comment':_0xbebf('0xe')},'role':{'type':Sequelize[_0xbebf('0x2')]},'internal':{'type':Sequelize[_0xbebf('0xf')]},'uniqueid':{'type':Sequelize[_0xbebf('0x2')]}};
\ No newline at end of file
+var _0x10f8=['seconds','setDataValue','exitAt','duration','talk:[destination]','talk:[dial\x20string]','talk:[queue]','sequelize','moment','STRING','DEFAULT\x20PAUSE','LOGIN,\x20PAUSE,\x20TALKING','INTEGER','DATE','getDataValue','enterAt','diff'];(function(_0xb77d35,_0x291854){var _0x5389a8=function(_0x52b4d2){while(--_0x52b4d2){_0xb77d35['push'](_0xb77d35['shift']());}};_0x5389a8(++_0x291854);}(_0x10f8,0x19f));var _0x810f=function(_0x3ed430,_0x5fafab){_0x3ed430=_0x3ed430-0x0;var _0xae4a10=_0x10f8[_0x3ed430];return _0xae4a10;};'use strict';var Sequelize=require(_0x810f('0x0'));var moment=require(_0x810f('0x1'));module['exports']={'channel':{'type':Sequelize[_0x810f('0x2')]},'membername':{'type':Sequelize[_0x810f('0x2')]},'interface':{'type':Sequelize[_0x810f('0x2')]},'type':{'type':Sequelize[_0x810f('0x2')],'defaultValue':_0x810f('0x3'),'comment':_0x810f('0x4')},'duration':{'type':Sequelize[_0x810f('0x5')]},'enterAt':{'type':Sequelize[_0x810f('0x6')]},'exitAt':{'type':Sequelize[_0x810f('0x6')],'set':function(_0x44b9fa){var _0x54bd5f=moment(_0x44b9fa);var _0x54f231=moment(this[_0x810f('0x7')](_0x810f('0x8')));var _0x1cedfd=_0x54bd5f[_0x810f('0x9')](_0x54f231,_0x810f('0xa'));this[_0x810f('0xb')](_0x810f('0xc'),_0x44b9fa);this['setDataValue'](_0x810f('0xd'),_0x1cedfd||null);}},'data1':{'type':Sequelize[_0x810f('0x2')],'comment':'talk:[inbound,\x20outbound],\x20pause:[reason]'},'data2':{'type':Sequelize[_0x810f('0x2')],'comment':'talk:[start]'},'data3':{'type':Sequelize[_0x810f('0x2')],'comment':_0x810f('0xe')},'data4':{'type':Sequelize[_0x810f('0x2')],'comment':_0x810f('0xf')},'data5':{'type':Sequelize[_0x810f('0x2')],'comment':_0x810f('0x10')},'role':{'type':Sequelize[_0x810f('0x2')]},'internal':{'type':Sequelize[_0x810f('0x5')]},'uniqueid':{'type':Sequelize[_0x810f('0x2')]}};
\ No newline at end of file
diff --git a/server/api/memberReport/memberReport.controller.js b/server/api/memberReport/memberReport.controller.js
index 2ff1274..e579397 100644
--- a/server/api/memberReport/memberReport.controller.js
+++ b/server/api/memberReport/memberReport.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xbd5c=['papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','sendStatus','status','end','json','count','limit','set','Content-Range','save','update','destroy','then','stack','name','send','map','MemberReport','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','offset','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','find','create','body','params','describe','html-pdf','eml-format','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','jsforce','desk.js','querystring'];(function(_0x845505,_0x19e5f3){var _0x2513b9=function(_0x10e7af){while(--_0x10e7af){_0x845505['push'](_0x845505['shift']());}};_0x2513b9(++_0x19e5f3);}(_0xbd5c,0xca));var _0xcbd5=function(_0x5dc7f9,_0x2d5c21){_0x5dc7f9=_0x5dc7f9-0x0;var _0x13c865=_0xbd5c[_0x5dc7f9];return _0x13c865;};'use strict';var pdf=require(_0xcbd5('0x0'));var emlformat=require(_0xcbd5('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xcbd5('0x2'));var jsonpatch=require(_0xcbd5('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xcbd5('0x4'));var Mustache=require(_0xcbd5('0x5'));var util=require(_0xcbd5('0x6'));var path=require(_0xcbd5('0x7'));var sox=require(_0xcbd5('0x8'));var csv=require(_0xcbd5('0x9'));var ejs=require(_0xcbd5('0xa'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xcbd5('0xb'));var deskjs=require(_0xcbd5('0xc'));var toCsv=require(_0xcbd5('0x9'));var querystring=require(_0xcbd5('0xd'));var Papa=require(_0xcbd5('0xe'));var Redis=require(_0xcbd5('0xf'));var authService=require(_0xcbd5('0x10'));var qs=require(_0xcbd5('0x11'));var as=require(_0xcbd5('0x12'));var hardwareService=require(_0xcbd5('0x13'));var logger=require(_0xcbd5('0x14'))('api');var utils=require(_0xcbd5('0x15'));var config=require('../../config/environment');var db=require(_0xcbd5('0x16'))['db'];function respondWithStatusCode(_0x2035ac,_0x4e9f85){_0x4e9f85=_0x4e9f85||0xcc;return function(_0x11997c){if(_0x11997c){return _0x2035ac[_0xcbd5('0x17')](_0x4e9f85);}return _0x2035ac[_0xcbd5('0x18')](_0x4e9f85)[_0xcbd5('0x19')]();};}function respondWithResult(_0x4ad0a0,_0x4b675a){_0x4b675a=_0x4b675a||0xc8;return function(_0x17beb8){if(_0x17beb8){return _0x4ad0a0[_0xcbd5('0x18')](_0x4b675a)[_0xcbd5('0x1a')](_0x17beb8);}};}function respondWithFilteredResult(_0x1e1ddf,_0x5e527e){return function(_0x1dc4bd){if(_0x1dc4bd){var _0x38f91e=_0x1dc4bd[_0xcbd5('0x1b')],_0x1f6330=_0x5e527e['offset'],_0x21fed7=_0x5e527e['offset']+_0x5e527e[_0xcbd5('0x1c')],_0x330873;if(_0x21fed7>=_0x38f91e){_0x21fed7=_0x38f91e;_0x330873=0xc8;}else{_0x330873=0xce;}_0x1e1ddf[_0xcbd5('0x18')](_0x330873);return _0x1e1ddf[_0xcbd5('0x1d')](_0xcbd5('0x1e'),_0x1f6330+'-'+_0x21fed7+'/'+_0x38f91e)[_0xcbd5('0x1a')](_0x1dc4bd);}return null;};}function patchUpdates(_0x56074a){return function(_0x2e9690){try{jsonpatch['apply'](_0x2e9690,_0x56074a,!![]);}catch(_0x22848e){return BPromise['reject'](_0x22848e);}return _0x2e9690[_0xcbd5('0x1f')]();};}function saveUpdates(_0x2324d0,_0x360db7){return function(_0x1e0aa0){if(_0x1e0aa0){return _0x1e0aa0[_0xcbd5('0x20')](_0x2324d0)['then'](function(_0x28e5e4){return _0x28e5e4;});}return null;};}function removeEntity(_0xb1c4f8,_0xbbe36d){return function(_0x10dec4){if(_0x10dec4){return _0x10dec4[_0xcbd5('0x21')]()[_0xcbd5('0x22')](function(){_0xb1c4f8[_0xcbd5('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x9d2770,_0x4a179b){return function(_0x265e68){if(!_0x265e68){_0x9d2770[_0xcbd5('0x17')](0x194);}return _0x265e68;};}function handleError(_0x88fdc1,_0x2fa901){_0x2fa901=_0x2fa901||0x1f4;return function(_0x1db58e){logger['error'](_0x1db58e[_0xcbd5('0x23')]);if(_0x1db58e['name']){delete _0x1db58e[_0xcbd5('0x24')];}_0x88fdc1[_0xcbd5('0x18')](_0x2fa901)[_0xcbd5('0x25')](_0x1db58e);};}exports['index']=function(_0x3de904,_0x922daa){var _0x31f0e2={},_0xe6804a={},_0x17d0a1={'count':0x0,'rows':[]};var _0x23d518=_[_0xcbd5('0x26')](db[_0xcbd5('0x27')][_0xcbd5('0x28')],function(_0x3f098a){return{'name':_0x3f098a['fieldName'],'type':_0x3f098a[_0xcbd5('0x29')][_0xcbd5('0x2a')]};});_0xe6804a[_0xcbd5('0x2b')]=_[_0xcbd5('0x26')](_0x23d518,_0xcbd5('0x24'));_0xe6804a[_0xcbd5('0x2c')]=_[_0xcbd5('0x2d')](_0x3de904[_0xcbd5('0x2c')]);_0xe6804a[_0xcbd5('0x2e')]=_[_0xcbd5('0x2f')](_0xe6804a[_0xcbd5('0x2b')],_0xe6804a['query']);_0x31f0e2[_0xcbd5('0x30')]=_[_0xcbd5('0x2f')](_0xe6804a[_0xcbd5('0x2b')],qs[_0xcbd5('0x31')](_0x3de904[_0xcbd5('0x2c')][_0xcbd5('0x31')]));_0x31f0e2[_0xcbd5('0x30')]=_0x31f0e2['attributes'][_0xcbd5('0x32')]?_0x31f0e2[_0xcbd5('0x30')]:_0xe6804a['model'];if(!_0x3de904[_0xcbd5('0x2c')]['hasOwnProperty'](_0xcbd5('0x33'))){_0x31f0e2[_0xcbd5('0x1c')]=qs[_0xcbd5('0x1c')](_0x3de904[_0xcbd5('0x2c')]['limit']);_0x31f0e2[_0xcbd5('0x34')]=qs[_0xcbd5('0x34')](_0x3de904[_0xcbd5('0x2c')]['offset']);}_0x31f0e2[_0xcbd5('0x35')]=qs[_0xcbd5('0x36')](_0x3de904[_0xcbd5('0x2c')]['sort']);_0x31f0e2['where']=qs[_0xcbd5('0x2e')](_[_0xcbd5('0x37')](_0x3de904[_0xcbd5('0x2c')],_0xe6804a['filters']),_0x23d518);if(_0x3de904[_0xcbd5('0x2c')][_0xcbd5('0x38')]){_0x31f0e2[_0xcbd5('0x39')]=_[_0xcbd5('0x3a')](_0x31f0e2['where'],{'$or':_[_0xcbd5('0x26')](_0x23d518,function(_0x13d91b){if(_0x13d91b[_0xcbd5('0x29')]!==_0xcbd5('0x3b')){var _0x44fed5={};_0x44fed5[_0x13d91b['name']]={'$like':'%'+_0x3de904[_0xcbd5('0x2c')][_0xcbd5('0x38')]+'%'};return _0x44fed5;}})});}_0x31f0e2=_['merge']({},_0x31f0e2,_0x3de904[_0xcbd5('0x3c')]);var _0x43ed56={'where':_0x31f0e2[_0xcbd5('0x39')]};return db[_0xcbd5('0x27')][_0xcbd5('0x1b')](_0x43ed56)[_0xcbd5('0x22')](function(_0x47bbe1){_0x17d0a1[_0xcbd5('0x1b')]=_0x47bbe1;if(_0x3de904['query'][_0xcbd5('0x3d')]){_0x31f0e2[_0xcbd5('0x3e')]=[{'all':!![]}];}return db['MemberReport'][_0xcbd5('0x3f')](_0x31f0e2);})[_0xcbd5('0x22')](function(_0x59c8ef){_0x17d0a1[_0xcbd5('0x40')]=_0x59c8ef;return _0x17d0a1;})[_0xcbd5('0x22')](respondWithFilteredResult(_0x922daa,_0x31f0e2))[_0xcbd5('0x41')](handleError(_0x922daa,null));};exports[_0xcbd5('0x42')]=function(_0x1a86f8,_0x48fa77){var _0x4dd8f2={'raw':!![],'where':{'id':_0x1a86f8['params']['id']}},_0x446b77={};_0x446b77[_0xcbd5('0x2b')]=_[_0xcbd5('0x2d')](db[_0xcbd5('0x27')][_0xcbd5('0x28')]);_0x446b77[_0xcbd5('0x2c')]=_[_0xcbd5('0x2d')](_0x1a86f8[_0xcbd5('0x2c')]);_0x446b77[_0xcbd5('0x2e')]=_[_0xcbd5('0x2f')](_0x446b77[_0xcbd5('0x2b')],_0x446b77['query']);_0x4dd8f2[_0xcbd5('0x30')]=_[_0xcbd5('0x2f')](_0x446b77['model'],qs[_0xcbd5('0x31')](_0x1a86f8[_0xcbd5('0x2c')][_0xcbd5('0x31')]));_0x4dd8f2[_0xcbd5('0x30')]=_0x4dd8f2['attributes'][_0xcbd5('0x32')]?_0x4dd8f2[_0xcbd5('0x30')]:_0x446b77[_0xcbd5('0x2b')];if(_0x1a86f8[_0xcbd5('0x2c')][_0xcbd5('0x3d')]){_0x4dd8f2[_0xcbd5('0x3e')]=[{'all':!![]}];}_0x4dd8f2=_['merge']({},_0x4dd8f2,_0x1a86f8[_0xcbd5('0x3c')]);return db['MemberReport'][_0xcbd5('0x43')](_0x4dd8f2)[_0xcbd5('0x22')](handleEntityNotFound(_0x48fa77,null))[_0xcbd5('0x22')](respondWithResult(_0x48fa77,null))[_0xcbd5('0x41')](handleError(_0x48fa77,null));};exports[_0xcbd5('0x44')]=function(_0x3ab39b,_0x214a43){return db[_0xcbd5('0x27')][_0xcbd5('0x44')](_0x3ab39b['body'],{})['then'](respondWithResult(_0x214a43,0xc9))[_0xcbd5('0x41')](handleError(_0x214a43,null));};exports[_0xcbd5('0x20')]=function(_0x4e0bf0,_0x3a801b){if(_0x4e0bf0[_0xcbd5('0x45')]['id']){delete _0x4e0bf0[_0xcbd5('0x45')]['id'];}return db[_0xcbd5('0x27')][_0xcbd5('0x43')]({'where':{'id':_0x4e0bf0[_0xcbd5('0x46')]['id']}})['then'](handleEntityNotFound(_0x3a801b,null))[_0xcbd5('0x22')](saveUpdates(_0x4e0bf0[_0xcbd5('0x45')],null))[_0xcbd5('0x22')](respondWithResult(_0x3a801b,null))[_0xcbd5('0x41')](handleError(_0x3a801b,null));};exports['destroy']=function(_0x300696,_0x566c98){return db[_0xcbd5('0x27')]['find']({'where':{'id':_0x300696[_0xcbd5('0x46')]['id']}})['then'](handleEntityNotFound(_0x566c98,null))[_0xcbd5('0x22')](removeEntity(_0x566c98,null))[_0xcbd5('0x41')](handleError(_0x566c98,null));};exports[_0xcbd5('0x47')]=function(_0x2c0cea,_0x496803){return db[_0xcbd5('0x27')][_0xcbd5('0x47')]()['then'](respondWithResult(_0x496803,null))[_0xcbd5('0x41')](handleError(_0x496803,null));};
\ No newline at end of file
+var _0xb411=['error','stack','name','send','index','map','MemberReport','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','include','findAll','rows','show','includeAll','options','find','catch','create','body','params','describe','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','update','destroy','then'];(function(_0x66454d,_0x4ddf22){var _0x4eb726=function(_0x24d1f8){while(--_0x24d1f8){_0x66454d['push'](_0x66454d['shift']());}};_0x4eb726(++_0x4ddf22);}(_0xb411,0x19d));var _0x1b41=function(_0x2ff78b,_0x140ea3){_0x2ff78b=_0x2ff78b-0x0;var _0x5bec5b=_0xb411[_0x2ff78b];return _0x5bec5b;};'use strict';var pdf=require(_0x1b41('0x0'));var emlformat=require(_0x1b41('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x1b41('0x2'));var jsonpatch=require(_0x1b41('0x3'));var rp=require(_0x1b41('0x4'));var moment=require(_0x1b41('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x1b41('0x6'));var util=require('util');var path=require(_0x1b41('0x7'));var sox=require(_0x1b41('0x8'));var csv=require(_0x1b41('0x9'));var ejs=require(_0x1b41('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0x1b41('0xb'));var crypto=require(_0x1b41('0xc'));var jsforce=require(_0x1b41('0xd'));var deskjs=require(_0x1b41('0xe'));var toCsv=require(_0x1b41('0x9'));var querystring=require(_0x1b41('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x1b41('0x10'));var qs=require(_0x1b41('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x1b41('0x12'))(_0x1b41('0x13'));var utils=require(_0x1b41('0x14'));var config=require(_0x1b41('0x15'));var db=require(_0x1b41('0x16'))['db'];function respondWithStatusCode(_0x5cdd09,_0xab6289){_0xab6289=_0xab6289||0xcc;return function(_0x31f48d){if(_0x31f48d){return _0x5cdd09[_0x1b41('0x17')](_0xab6289);}return _0x5cdd09[_0x1b41('0x18')](_0xab6289)[_0x1b41('0x19')]();};}function respondWithResult(_0x3fc222,_0x22b6c8){_0x22b6c8=_0x22b6c8||0xc8;return function(_0xbbc29d){if(_0xbbc29d){return _0x3fc222[_0x1b41('0x18')](_0x22b6c8)[_0x1b41('0x1a')](_0xbbc29d);}};}function respondWithFilteredResult(_0x350284,_0x34fa6d){return function(_0xf417d2){if(_0xf417d2){var _0x55685=_0xf417d2[_0x1b41('0x1b')],_0x5dc790=_0x34fa6d['offset'],_0x45ebcd=_0x34fa6d[_0x1b41('0x1c')]+_0x34fa6d[_0x1b41('0x1d')],_0x21cc67;if(_0x45ebcd>=_0x55685){_0x45ebcd=_0x55685;_0x21cc67=0xc8;}else{_0x21cc67=0xce;}_0x350284[_0x1b41('0x18')](_0x21cc67);return _0x350284[_0x1b41('0x1e')](_0x1b41('0x1f'),_0x5dc790+'-'+_0x45ebcd+'/'+_0x55685)[_0x1b41('0x1a')](_0xf417d2);}return null;};}function patchUpdates(_0x23007a){return function(_0x503ec2){try{jsonpatch[_0x1b41('0x20')](_0x503ec2,_0x23007a,!![]);}catch(_0x448fdc){return BPromise[_0x1b41('0x21')](_0x448fdc);}return _0x503ec2['save']();};}function saveUpdates(_0x39157d,_0xbb695c){return function(_0x595118){if(_0x595118){return _0x595118[_0x1b41('0x22')](_0x39157d)['then'](function(_0x152a57){return _0x152a57;});}return null;};}function removeEntity(_0x1b2801,_0x1c3b1a){return function(_0x45230e){if(_0x45230e){return _0x45230e[_0x1b41('0x23')]()[_0x1b41('0x24')](function(){_0x1b2801[_0x1b41('0x18')](0xcc)[_0x1b41('0x19')]();});}};}function handleEntityNotFound(_0x1907b6,_0x1f2fcc){return function(_0x24bf3b){if(!_0x24bf3b){_0x1907b6[_0x1b41('0x17')](0x194);}return _0x24bf3b;};}function handleError(_0x49f502,_0x2e9ba0){_0x2e9ba0=_0x2e9ba0||0x1f4;return function(_0x1c2338){logger[_0x1b41('0x25')](_0x1c2338[_0x1b41('0x26')]);if(_0x1c2338[_0x1b41('0x27')]){delete _0x1c2338[_0x1b41('0x27')];}_0x49f502['status'](_0x2e9ba0)[_0x1b41('0x28')](_0x1c2338);};}exports[_0x1b41('0x29')]=function(_0x16b802,_0x355e12){var _0x287cd2={},_0x4f6754={},_0x25b5f9={'count':0x0,'rows':[]};var _0x512a21=_[_0x1b41('0x2a')](db[_0x1b41('0x2b')][_0x1b41('0x2c')],function(_0x242a30){return{'name':_0x242a30[_0x1b41('0x2d')],'type':_0x242a30[_0x1b41('0x2e')]['key']};});_0x4f6754[_0x1b41('0x2f')]=_[_0x1b41('0x2a')](_0x512a21,_0x1b41('0x27'));_0x4f6754[_0x1b41('0x30')]=_[_0x1b41('0x31')](_0x16b802[_0x1b41('0x30')]);_0x4f6754[_0x1b41('0x32')]=_[_0x1b41('0x33')](_0x4f6754[_0x1b41('0x2f')],_0x4f6754[_0x1b41('0x30')]);_0x287cd2[_0x1b41('0x34')]=_[_0x1b41('0x33')](_0x4f6754[_0x1b41('0x2f')],qs[_0x1b41('0x35')](_0x16b802[_0x1b41('0x30')][_0x1b41('0x35')]));_0x287cd2[_0x1b41('0x34')]=_0x287cd2[_0x1b41('0x34')][_0x1b41('0x36')]?_0x287cd2[_0x1b41('0x34')]:_0x4f6754[_0x1b41('0x2f')];if(!_0x16b802['query'][_0x1b41('0x37')](_0x1b41('0x38'))){_0x287cd2[_0x1b41('0x1d')]=qs[_0x1b41('0x1d')](_0x16b802[_0x1b41('0x30')][_0x1b41('0x1d')]);_0x287cd2[_0x1b41('0x1c')]=qs[_0x1b41('0x1c')](_0x16b802['query'][_0x1b41('0x1c')]);}_0x287cd2[_0x1b41('0x39')]=qs[_0x1b41('0x3a')](_0x16b802[_0x1b41('0x30')][_0x1b41('0x3a')]);_0x287cd2[_0x1b41('0x3b')]=qs[_0x1b41('0x32')](_[_0x1b41('0x3c')](_0x16b802[_0x1b41('0x30')],_0x4f6754[_0x1b41('0x32')]),_0x512a21);if(_0x16b802[_0x1b41('0x30')][_0x1b41('0x3d')]){_0x287cd2[_0x1b41('0x3b')]=_[_0x1b41('0x3e')](_0x287cd2[_0x1b41('0x3b')],{'$or':_[_0x1b41('0x2a')](_0x512a21,function(_0x583b20){if(_0x583b20[_0x1b41('0x2e')]!=='VIRTUAL'){var _0x3436eb={};_0x3436eb[_0x583b20[_0x1b41('0x27')]]={'$like':'%'+_0x16b802[_0x1b41('0x30')][_0x1b41('0x3d')]+'%'};return _0x3436eb;}})});}_0x287cd2=_[_0x1b41('0x3e')]({},_0x287cd2,_0x16b802['options']);var _0x2a7ca0={'where':_0x287cd2[_0x1b41('0x3b')]};return db[_0x1b41('0x2b')][_0x1b41('0x1b')](_0x2a7ca0)['then'](function(_0xefc15d){_0x25b5f9[_0x1b41('0x1b')]=_0xefc15d;if(_0x16b802[_0x1b41('0x30')]['includeAll']){_0x287cd2[_0x1b41('0x3f')]=[{'all':!![]}];}return db['MemberReport'][_0x1b41('0x40')](_0x287cd2);})[_0x1b41('0x24')](function(_0x3870ec){_0x25b5f9[_0x1b41('0x41')]=_0x3870ec;return _0x25b5f9;})[_0x1b41('0x24')](respondWithFilteredResult(_0x355e12,_0x287cd2))['catch'](handleError(_0x355e12,null));};exports[_0x1b41('0x42')]=function(_0x3cfb9d,_0xcdcd6d){var _0x1d52e4={'raw':!![],'where':{'id':_0x3cfb9d['params']['id']}},_0x5e2894={};_0x5e2894[_0x1b41('0x2f')]=_[_0x1b41('0x31')](db[_0x1b41('0x2b')]['rawAttributes']);_0x5e2894[_0x1b41('0x30')]=_['keys'](_0x3cfb9d[_0x1b41('0x30')]);_0x5e2894[_0x1b41('0x32')]=_[_0x1b41('0x33')](_0x5e2894[_0x1b41('0x2f')],_0x5e2894['query']);_0x1d52e4[_0x1b41('0x34')]=_[_0x1b41('0x33')](_0x5e2894['model'],qs[_0x1b41('0x35')](_0x3cfb9d[_0x1b41('0x30')]['fields']));_0x1d52e4['attributes']=_0x1d52e4[_0x1b41('0x34')]['length']?_0x1d52e4[_0x1b41('0x34')]:_0x5e2894[_0x1b41('0x2f')];if(_0x3cfb9d[_0x1b41('0x30')][_0x1b41('0x43')]){_0x1d52e4[_0x1b41('0x3f')]=[{'all':!![]}];}_0x1d52e4=_['merge']({},_0x1d52e4,_0x3cfb9d[_0x1b41('0x44')]);return db['MemberReport'][_0x1b41('0x45')](_0x1d52e4)[_0x1b41('0x24')](handleEntityNotFound(_0xcdcd6d,null))[_0x1b41('0x24')](respondWithResult(_0xcdcd6d,null))[_0x1b41('0x46')](handleError(_0xcdcd6d,null));};exports[_0x1b41('0x47')]=function(_0x2f7f96,_0x32d926){return db[_0x1b41('0x2b')]['create'](_0x2f7f96[_0x1b41('0x48')],{})[_0x1b41('0x24')](respondWithResult(_0x32d926,0xc9))['catch'](handleError(_0x32d926,null));};exports['update']=function(_0x1d4e8c,_0x4aed0e){if(_0x1d4e8c['body']['id']){delete _0x1d4e8c[_0x1b41('0x48')]['id'];}return db[_0x1b41('0x2b')][_0x1b41('0x45')]({'where':{'id':_0x1d4e8c[_0x1b41('0x49')]['id']}})[_0x1b41('0x24')](handleEntityNotFound(_0x4aed0e,null))[_0x1b41('0x24')](saveUpdates(_0x1d4e8c[_0x1b41('0x48')],null))[_0x1b41('0x24')](respondWithResult(_0x4aed0e,null))[_0x1b41('0x46')](handleError(_0x4aed0e,null));};exports[_0x1b41('0x23')]=function(_0x47e21f,_0x6e5b92){return db['MemberReport'][_0x1b41('0x45')]({'where':{'id':_0x47e21f[_0x1b41('0x49')]['id']}})[_0x1b41('0x24')](handleEntityNotFound(_0x6e5b92,null))[_0x1b41('0x24')](removeEntity(_0x6e5b92,null))[_0x1b41('0x46')](handleError(_0x6e5b92,null));};exports[_0x1b41('0x4a')]=function(_0x52de1d,_0x46e2){return db['MemberReport'][_0x1b41('0x4a')]()[_0x1b41('0x24')](respondWithResult(_0x46e2,null))[_0x1b41('0x46')](handleError(_0x46e2,null));};
\ No newline at end of file
diff --git a/server/api/memberReport/memberReport.model.js b/server/api/memberReport/memberReport.model.js
index 76e0f11..a0a2a38 100644
--- a/server/api/memberReport/memberReport.model.js
+++ b/server/api/memberReport/memberReport.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x04de=['../../config/environment','./memberReport.attributes','MemberReport','report_member','membername_interface','membername','interface','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x163aeb,_0x484eba){var _0x404db0=function(_0x51a143){while(--_0x51a143){_0x163aeb['push'](_0x163aeb['shift']());}};_0x404db0(++_0x484eba);}(_0x04de,0x107));var _0xe04d=function(_0x4e0a1a,_0x23c496){_0x4e0a1a=_0x4e0a1a-0x0;var _0x1f5ba3=_0x04de[_0x4e0a1a];return _0x1f5ba3;};'use strict';var _=require(_0xe04d('0x0'));var util=require(_0xe04d('0x1'));var logger=require(_0xe04d('0x2'))(_0xe04d('0x3'));var moment=require(_0xe04d('0x4'));var BPromise=require(_0xe04d('0x5'));var rp=require(_0xe04d('0x6'));var fs=require('fs');var path=require(_0xe04d('0x7'));var rimraf=require(_0xe04d('0x8'));var config=require(_0xe04d('0x9'));var attributes=require(_0xe04d('0xa'));module['exports']=function(_0x4bb925,_0x4f7637){return _0x4bb925['define'](_0xe04d('0xb'),attributes,{'tableName':_0xe04d('0xc'),'paranoid':![],'indexes':[{'name':_0xe04d('0xd'),'fields':[_0xe04d('0xe'),_0xe04d('0xf')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xca9e=['bluebird','request-promise','path','rimraf','../../config/environment','./memberReport.attributes','exports','MemberReport','report_member','interface','lodash','util','../../config/logger','api','moment'];(function(_0x19c4f5,_0x4f33fa){var _0x339f8c=function(_0x4a936f){while(--_0x4a936f){_0x19c4f5['push'](_0x19c4f5['shift']());}};_0x339f8c(++_0x4f33fa);}(_0xca9e,0x136));var _0xeca9=function(_0x138dd3,_0x7356d7){_0x138dd3=_0x138dd3-0x0;var _0x3bfd53=_0xca9e[_0x138dd3];return _0x3bfd53;};'use strict';var _=require(_0xeca9('0x0'));var util=require(_0xeca9('0x1'));var logger=require(_0xeca9('0x2'))(_0xeca9('0x3'));var moment=require(_0xeca9('0x4'));var BPromise=require(_0xeca9('0x5'));var rp=require(_0xeca9('0x6'));var fs=require('fs');var path=require(_0xeca9('0x7'));var rimraf=require(_0xeca9('0x8'));var config=require(_0xeca9('0x9'));var attributes=require(_0xeca9('0xa'));module[_0xeca9('0xb')]=function(_0x186a47,_0x305dc5){return _0x186a47['define'](_0xeca9('0xc'),attributes,{'tableName':_0xeca9('0xd'),'paranoid':![],'indexes':[{'name':'membername_interface','fields':['membername',_0xeca9('0xe')]}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/memberReport/memberReport.rpc.js b/server/api/memberReport/memberReport.rpc.js
index 86edadc..bdbd248 100644
--- a/server/api/memberReport/memberReport.rpc.js
+++ b/server/api/memberReport/memberReport.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9eeb=['CreateMemberReport','create','body','raw','UpdateMemberReport','limit','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','info','MemberReport,\x20%s,\x20%s','debug','MemberReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','GetMemberReport','MemberReport','findAll','options','where','attributes','include','map','model'];(function(_0x5ee18f,_0x5f0488){var _0x519310=function(_0x243dc2){while(--_0x243dc2){_0x5ee18f['push'](_0x5ee18f['shift']());}};_0x519310(++_0x5f0488);}(_0x9eeb,0x1b3));var _0xb9ee=function(_0x3ce889,_0x4072e0){_0x3ce889=_0x3ce889-0x0;var _0x1f05eb=_0x9eeb[_0x3ce889];return _0x1f05eb;};'use strict';var _=require(_0xb9ee('0x0'));var util=require('util');var moment=require(_0xb9ee('0x1'));var BPromise=require(_0xb9ee('0x2'));var rs=require(_0xb9ee('0x3'));var fs=require('fs');var Redis=require(_0xb9ee('0x4'));var db=require(_0xb9ee('0x5'))['db'];var utils=require(_0xb9ee('0x6'));var logger=require(_0xb9ee('0x7'))(_0xb9ee('0x8'));var config=require(_0xb9ee('0x9'));var jayson=require(_0xb9ee('0xa'));var client=jayson[_0xb9ee('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x30b888,_0x5b6fde,_0xf2b2cf){return new BPromise(function(_0x370ce6,_0x4c0b8c){return client[_0xb9ee('0xc')](_0x30b888,_0xf2b2cf)['then'](function(_0x496666){logger[_0xb9ee('0xd')](_0xb9ee('0xe'),_0x5b6fde,'request\x20sent');logger[_0xb9ee('0xf')](_0xb9ee('0x10'),_0x5b6fde,_0xb9ee('0x11'),JSON[_0xb9ee('0x12')](_0x496666));if(_0x496666[_0xb9ee('0x13')]){if(_0x496666['error'][_0xb9ee('0x14')]===0x1f4){logger[_0xb9ee('0x13')](_0xb9ee('0xe'),_0x5b6fde,_0x496666['error'][_0xb9ee('0x15')]);return _0x4c0b8c(_0x496666[_0xb9ee('0x13')][_0xb9ee('0x15')]);}logger[_0xb9ee('0x13')](_0xb9ee('0xe'),_0x5b6fde,_0x496666[_0xb9ee('0x13')][_0xb9ee('0x15')]);return _0x370ce6(_0x496666[_0xb9ee('0x13')][_0xb9ee('0x15')]);}else{logger[_0xb9ee('0xd')](_0xb9ee('0xe'),_0x5b6fde,_0xb9ee('0x11'));_0x370ce6(_0x496666[_0xb9ee('0x16')]['message']);}})[_0xb9ee('0x17')](function(_0x3440fe){logger[_0xb9ee('0x13')](_0xb9ee('0xe'),_0x5b6fde,_0x3440fe);_0x4c0b8c(_0x3440fe);});});}exports[_0xb9ee('0x18')]=function(_0x1c06af){var _0x363aeb=this;return new Promise(function(_0x3b90d0,_0x358331){return db[_0xb9ee('0x19')][_0xb9ee('0x1a')]({'raw':_0x1c06af[_0xb9ee('0x1b')]?_0x1c06af[_0xb9ee('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x1c06af[_0xb9ee('0x1b')]?_0x1c06af['options'][_0xb9ee('0x1c')]||null:null,'attributes':_0x1c06af[_0xb9ee('0x1b')]?_0x1c06af['options'][_0xb9ee('0x1d')]||null:null,'limit':_0x1c06af['options']?_0x1c06af[_0xb9ee('0x1b')]['limit']||null:null,'include':_0x1c06af[_0xb9ee('0x1b')]?_0x1c06af[_0xb9ee('0x1b')][_0xb9ee('0x1e')]?_[_0xb9ee('0x1f')](_0x1c06af['options']['include'],function(_0x275ee1){return{'model':db[_0x275ee1[_0xb9ee('0x20')]],'as':_0x275ee1['as'],'attributes':_0x275ee1[_0xb9ee('0x1d')],'include':_0x275ee1[_0xb9ee('0x1e')]?_[_0xb9ee('0x1f')](_0x275ee1[_0xb9ee('0x1e')],function(_0x59bc0c){return{'model':db[_0x59bc0c[_0xb9ee('0x20')]],'as':_0x59bc0c['as'],'attributes':_0x59bc0c[_0xb9ee('0x1d')],'include':_0x59bc0c[_0xb9ee('0x1e')]?_[_0xb9ee('0x1f')](_0x59bc0c[_0xb9ee('0x1e')],function(_0x138599){return{'model':db[_0x138599[_0xb9ee('0x20')]],'as':_0x138599['as'],'attributes':_0x138599[_0xb9ee('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x5ee03a){logger[_0xb9ee('0xd')](_0xb9ee('0x18'),_0x1c06af);logger[_0xb9ee('0xf')](_0xb9ee('0x18'),_0x1c06af,JSON[_0xb9ee('0x12')](_0x5ee03a));_0x3b90d0(_0x5ee03a);})[_0xb9ee('0x17')](function(_0x5b11ae){logger[_0xb9ee('0x13')](_0xb9ee('0x18'),_0x5b11ae['message'],_0x1c06af);_0x358331(_0x363aeb['error'](0x1f4,_0x5b11ae[_0xb9ee('0x15')]));});});};exports[_0xb9ee('0x21')]=function(_0x358330){var _0x4ccc4f=this;return new Promise(function(_0xb89131,_0x99c716){return db[_0xb9ee('0x19')][_0xb9ee('0x22')](_0x358330[_0xb9ee('0x23')],{'raw':_0x358330['options']?_0x358330[_0xb9ee('0x1b')][_0xb9ee('0x24')]===undefined?!![]:![]:!![]})['then'](function(_0x3739a3){logger[_0xb9ee('0xd')](_0xb9ee('0x21'),_0x358330);logger[_0xb9ee('0xf')](_0xb9ee('0x21'),_0x358330,JSON[_0xb9ee('0x12')](_0x3739a3));_0xb89131(_0x3739a3);})[_0xb9ee('0x17')](function(_0x192dc8){logger[_0xb9ee('0x13')]('CreateMemberReport',_0x192dc8[_0xb9ee('0x15')],_0x358330);_0x99c716(_0x4ccc4f[_0xb9ee('0x13')](0x1f4,_0x192dc8[_0xb9ee('0x15')]));});});};exports[_0xb9ee('0x25')]=function(_0x30bc90){var _0x33e0cd=this;return new Promise(function(_0x2d1e15,_0x1c68fe){return db[_0xb9ee('0x19')]['update'](_0x30bc90[_0xb9ee('0x23')],{'raw':_0x30bc90[_0xb9ee('0x1b')]?_0x30bc90[_0xb9ee('0x1b')][_0xb9ee('0x24')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x30bc90[_0xb9ee('0x1b')]?_0x30bc90['options']['where']||null:null,'attributes':_0x30bc90[_0xb9ee('0x1b')]?_0x30bc90['options'][_0xb9ee('0x1d')]||null:null,'limit':_0x30bc90['options']?_0x30bc90['options'][_0xb9ee('0x26')]||null:null})['then'](function(_0x491263){logger[_0xb9ee('0xd')](_0xb9ee('0x25'),_0x30bc90);logger[_0xb9ee('0xf')](_0xb9ee('0x25'),_0x30bc90,JSON[_0xb9ee('0x12')](_0x491263));_0x2d1e15(_0x491263);})[_0xb9ee('0x17')](function(_0x3c3fe1){logger['error']('UpdateMemberReport',_0x3c3fe1['message'],_0x30bc90);_0x1c68fe(_0x33e0cd[_0xb9ee('0x13')](0x1f4,_0x3c3fe1['message']));});});};
\ No newline at end of file
+var _0x2a4a=['create','body','CreateMemberReport','UpdateMemberReport','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','client','request','then','MemberReport,\x20%s,\x20%s','request\x20sent','MemberReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','GetMemberReport','MemberReport','findAll','raw','options','where','attributes','limit','include','map','model','debug'];(function(_0x140fca,_0x3d4fde){var _0xde632=function(_0x5822c1){while(--_0x5822c1){_0x140fca['push'](_0x140fca['shift']());}};_0xde632(++_0x3d4fde);}(_0x2a4a,0x151));var _0xa2a4=function(_0x1b5e58,_0x541532){_0x1b5e58=_0x1b5e58-0x0;var _0x474c03=_0x2a4a[_0x1b5e58];return _0x474c03;};'use strict';var _=require(_0xa2a4('0x0'));var util=require(_0xa2a4('0x1'));var moment=require(_0xa2a4('0x2'));var BPromise=require(_0xa2a4('0x3'));var rs=require(_0xa2a4('0x4'));var fs=require('fs');var Redis=require(_0xa2a4('0x5'));var db=require(_0xa2a4('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xa2a4('0x7'))(_0xa2a4('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xa2a4('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3e88ff,_0x230c5d,_0xf7f5b9){return new BPromise(function(_0x1fde31,_0x37810a){return client[_0xa2a4('0xa')](_0x3e88ff,_0xf7f5b9)[_0xa2a4('0xb')](function(_0x3deda1){logger['info'](_0xa2a4('0xc'),_0x230c5d,_0xa2a4('0xd'));logger['debug'](_0xa2a4('0xe'),_0x230c5d,_0xa2a4('0xd'),JSON[_0xa2a4('0xf')](_0x3deda1));if(_0x3deda1[_0xa2a4('0x10')]){if(_0x3deda1['error'][_0xa2a4('0x11')]===0x1f4){logger[_0xa2a4('0x10')](_0xa2a4('0xc'),_0x230c5d,_0x3deda1[_0xa2a4('0x10')][_0xa2a4('0x12')]);return _0x37810a(_0x3deda1[_0xa2a4('0x10')]['message']);}logger[_0xa2a4('0x10')](_0xa2a4('0xc'),_0x230c5d,_0x3deda1['error']['message']);return _0x1fde31(_0x3deda1[_0xa2a4('0x10')][_0xa2a4('0x12')]);}else{logger[_0xa2a4('0x13')](_0xa2a4('0xc'),_0x230c5d,'request\x20sent');_0x1fde31(_0x3deda1['result'][_0xa2a4('0x12')]);}})[_0xa2a4('0x14')](function(_0x45f066){logger[_0xa2a4('0x10')]('MemberReport,\x20%s,\x20%s',_0x230c5d,_0x45f066);_0x37810a(_0x45f066);});});}exports[_0xa2a4('0x15')]=function(_0x2c5039){var _0x26dde=this;return new Promise(function(_0x4882fe,_0x1b397d){return db[_0xa2a4('0x16')][_0xa2a4('0x17')]({'raw':_0x2c5039['options']?_0x2c5039['options'][_0xa2a4('0x18')]===undefined?!![]:![]:!![],'where':_0x2c5039[_0xa2a4('0x19')]?_0x2c5039[_0xa2a4('0x19')][_0xa2a4('0x1a')]||null:null,'attributes':_0x2c5039['options']?_0x2c5039[_0xa2a4('0x19')][_0xa2a4('0x1b')]||null:null,'limit':_0x2c5039['options']?_0x2c5039[_0xa2a4('0x19')][_0xa2a4('0x1c')]||null:null,'include':_0x2c5039[_0xa2a4('0x19')]?_0x2c5039[_0xa2a4('0x19')][_0xa2a4('0x1d')]?_[_0xa2a4('0x1e')](_0x2c5039['options'][_0xa2a4('0x1d')],function(_0x4e4860){return{'model':db[_0x4e4860['model']],'as':_0x4e4860['as'],'attributes':_0x4e4860['attributes'],'include':_0x4e4860[_0xa2a4('0x1d')]?_[_0xa2a4('0x1e')](_0x4e4860[_0xa2a4('0x1d')],function(_0x496a4b){return{'model':db[_0x496a4b[_0xa2a4('0x1f')]],'as':_0x496a4b['as'],'attributes':_0x496a4b['attributes'],'include':_0x496a4b[_0xa2a4('0x1d')]?_[_0xa2a4('0x1e')](_0x496a4b[_0xa2a4('0x1d')],function(_0x41e522){return{'model':db[_0x41e522[_0xa2a4('0x1f')]],'as':_0x41e522['as'],'attributes':_0x41e522[_0xa2a4('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xa2a4('0xb')](function(_0x329875){logger[_0xa2a4('0x13')]('GetMemberReport',_0x2c5039);logger[_0xa2a4('0x20')](_0xa2a4('0x15'),_0x2c5039,JSON['stringify'](_0x329875));_0x4882fe(_0x329875);})[_0xa2a4('0x14')](function(_0x46e30e){logger[_0xa2a4('0x10')](_0xa2a4('0x15'),_0x46e30e[_0xa2a4('0x12')],_0x2c5039);_0x1b397d(_0x26dde[_0xa2a4('0x10')](0x1f4,_0x46e30e['message']));});});};exports['CreateMemberReport']=function(_0x56b631){var _0x148405=this;return new Promise(function(_0x157f12,_0xbff2bd){return db['MemberReport'][_0xa2a4('0x21')](_0x56b631[_0xa2a4('0x22')],{'raw':_0x56b631[_0xa2a4('0x19')]?_0x56b631['options']['raw']===undefined?!![]:![]:!![]})['then'](function(_0x203dc2){logger[_0xa2a4('0x13')](_0xa2a4('0x23'),_0x56b631);logger[_0xa2a4('0x20')](_0xa2a4('0x23'),_0x56b631,JSON['stringify'](_0x203dc2));_0x157f12(_0x203dc2);})[_0xa2a4('0x14')](function(_0x4edc2c){logger[_0xa2a4('0x10')](_0xa2a4('0x23'),_0x4edc2c[_0xa2a4('0x12')],_0x56b631);_0xbff2bd(_0x148405[_0xa2a4('0x10')](0x1f4,_0x4edc2c['message']));});});};exports[_0xa2a4('0x24')]=function(_0x2c8692){var _0x3f756d=this;return new Promise(function(_0x1b155f,_0x1d7d91){return db[_0xa2a4('0x16')]['update'](_0x2c8692[_0xa2a4('0x22')],{'raw':_0x2c8692[_0xa2a4('0x19')]?_0x2c8692[_0xa2a4('0x19')][_0xa2a4('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2c8692['options']?_0x2c8692[_0xa2a4('0x19')]['where']||null:null,'attributes':_0x2c8692['options']?_0x2c8692[_0xa2a4('0x19')][_0xa2a4('0x1b')]||null:null,'limit':_0x2c8692['options']?_0x2c8692[_0xa2a4('0x19')][_0xa2a4('0x1c')]||null:null})['then'](function(_0x4ddefb){logger[_0xa2a4('0x13')]('UpdateMemberReport',_0x2c8692);logger[_0xa2a4('0x20')]('UpdateMemberReport',_0x2c8692,JSON['stringify'](_0x4ddefb));_0x1b155f(_0x4ddefb);})['catch'](function(_0x41cb13){logger[_0xa2a4('0x10')](_0xa2a4('0x24'),_0x41cb13[_0xa2a4('0x12')],_0x2c8692);_0x1d7d91(_0x3f756d[_0xa2a4('0x10')](0x1f4,_0x41cb13[_0xa2a4('0x12')]));});});};
\ No newline at end of file
diff --git a/server/api/migration/index.js b/server/api/migration/index.js
index 1c319a4..773cfdc 100644
--- a/server/api/migration/index.js
+++ b/server/api/migration/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xb688=['express','Router','../../components/auth/service','../../config/environment','./migration.controller','get','index','util','path','connect-timeout'];(function(_0x2420fb,_0x183d49){var _0x123a0f=function(_0x5e2e46){while(--_0x5e2e46){_0x2420fb['push'](_0x2420fb['shift']());}};_0x123a0f(++_0x183d49);}(_0xb688,0xcf));var _0x8b68=function(_0x4671c4,_0x33a4c3){_0x4671c4=_0x4671c4-0x0;var _0x1470f3=_0xb688[_0x4671c4];return _0x1470f3;};'use strict';var multer=require('multer');var util=require(_0x8b68('0x0'));var path=require(_0x8b68('0x1'));var timeout=require(_0x8b68('0x2'));var express=require(_0x8b68('0x3'));var router=express[_0x8b68('0x4')]();var auth=require(_0x8b68('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x8b68('0x6'));var controller=require(_0x8b68('0x7'));router[_0x8b68('0x8')]('/',controller[_0x8b68('0x9')]);module['exports']=router;
\ No newline at end of file
+var _0x0713=['index','exports','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./migration.controller','get'];(function(_0x29f80e,_0x9027ff){var _0x5c7eaa=function(_0x48ec7c){while(--_0x48ec7c){_0x29f80e['push'](_0x29f80e['shift']());}};_0x5c7eaa(++_0x9027ff);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3071('0x0'));var timeout=require(_0x3071('0x1'));var express=require(_0x3071('0x2'));var router=express[_0x3071('0x3')]();var auth=require(_0x3071('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x3071('0x5'));var controller=require(_0x3071('0x6'));router[_0x3071('0x7')]('/',controller[_0x3071('0x8')]);module[_0x3071('0x9')]=router;
\ No newline at end of file
diff --git a/server/api/migration/migration.attributes.js b/server/api/migration/migration.attributes.js
index 7fe70a6..9c9c1eb 100644
--- a/server/api/migration/migration.attributes.js
+++ b/server/api/migration/migration.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xe72d=['sequelize','exports','STRING'];(function(_0x591a90,_0x5525b0){var _0x551587=function(_0xd6ad8e){while(--_0xd6ad8e){_0x591a90['push'](_0x591a90['shift']());}};_0x551587(++_0x5525b0);}(_0xe72d,0xba));var _0xde72=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0xe72d[_0x40a045];return _0x1a687c;};'use strict';var Sequelize=require(_0xde72('0x0'));module[_0xde72('0x1')]={'version':{'type':Sequelize[_0xde72('0x2')],'unique':'version'}};
\ No newline at end of file
+var _0x1fc9=['STRING','sequelize','exports'];(function(_0x1f6657,_0x1c65be){var _0x4a388d=function(_0x35824c){while(--_0x35824c){_0x1f6657['push'](_0x1f6657['shift']());}};_0x4a388d(++_0x1c65be);}(_0x1fc9,0x1e4));var _0x91fc=function(_0x24a382,_0x3d3a90){_0x24a382=_0x24a382-0x0;var _0x208440=_0x1fc9[_0x24a382];return _0x208440;};'use strict';var Sequelize=require(_0x91fc('0x0'));module[_0x91fc('0x1')]={'version':{'type':Sequelize[_0x91fc('0x2')],'unique':'version'}};
\ No newline at end of file
diff --git a/server/api/migration/migration.controller.js b/server/api/migration/migration.controller.js
index 171e6c2..beda971 100644
--- a/server/api/migration/migration.controller.js
+++ b/server/api/migration/migration.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x4b84=['../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','end','count','offset','limit','set','Content-Range','reject','save','update','then','status','error','stack','name','index','map','Migration','type','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','html-pdf','eml-format','fast-json-patch','bluebird','mustache','util','ejs','squel','jsforce','querystring','papaparse','ioredis'];(function(_0x58d5ac,_0x11c4bc){var _0x37985c=function(_0x419671){while(--_0x419671){_0x58d5ac['push'](_0x58d5ac['shift']());}};_0x37985c(++_0x11c4bc);}(_0x4b84,0x1cc));var _0x44b8=function(_0x1d83db,_0x89d115){_0x1d83db=_0x1d83db-0x0;var _0x2dc1d1=_0x4b84[_0x1d83db];return _0x2dc1d1;};'use strict';var pdf=require(_0x44b8('0x0'));var emlformat=require(_0x44b8('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x44b8('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x44b8('0x3'));var Mustache=require(_0x44b8('0x4'));var util=require(_0x44b8('0x5'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x44b8('0x6'));var fs=require('fs');var _=require('lodash');var squel=require(_0x44b8('0x7'));var crypto=require('crypto');var jsforce=require(_0x44b8('0x8'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x44b8('0x9'));var Papa=require(_0x44b8('0xa'));var Redis=require(_0x44b8('0xb'));var authService=require('../../components/auth/service');var qs=require(_0x44b8('0xc'));var as=require(_0x44b8('0xd'));var hardwareService=require(_0x44b8('0xe'));var logger=require(_0x44b8('0xf'))(_0x44b8('0x10'));var utils=require(_0x44b8('0x11'));var config=require(_0x44b8('0x12'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x147529,_0x4301a6){_0x4301a6=_0x4301a6||0xcc;return function(_0x4bcc43){if(_0x4bcc43){return _0x147529[_0x44b8('0x13')](_0x4301a6);}return _0x147529['status'](_0x4301a6)[_0x44b8('0x14')]();};}function respondWithResult(_0x18d642,_0x4df670){_0x4df670=_0x4df670||0xc8;return function(_0x63e8f6){if(_0x63e8f6){return _0x18d642['status'](_0x4df670)['json'](_0x63e8f6);}};}function respondWithFilteredResult(_0x2a3e4c,_0x2af0ad){return function(_0x1722da){if(_0x1722da){var _0x41ab46=_0x1722da[_0x44b8('0x15')],_0x5e52f2=_0x2af0ad['offset'],_0x495c74=_0x2af0ad[_0x44b8('0x16')]+_0x2af0ad[_0x44b8('0x17')],_0x5d6349;if(_0x495c74>=_0x41ab46){_0x495c74=_0x41ab46;_0x5d6349=0xc8;}else{_0x5d6349=0xce;}_0x2a3e4c['status'](_0x5d6349);return _0x2a3e4c[_0x44b8('0x18')](_0x44b8('0x19'),_0x5e52f2+'-'+_0x495c74+'/'+_0x41ab46)['json'](_0x1722da);}return null;};}function patchUpdates(_0x89bc30){return function(_0x3f4688){try{jsonpatch['apply'](_0x3f4688,_0x89bc30,!![]);}catch(_0xcce202){return BPromise[_0x44b8('0x1a')](_0xcce202);}return _0x3f4688[_0x44b8('0x1b')]();};}function saveUpdates(_0x235bdc,_0x102ef9){return function(_0x369c09){if(_0x369c09){return _0x369c09[_0x44b8('0x1c')](_0x235bdc)[_0x44b8('0x1d')](function(_0x429461){return _0x429461;});}return null;};}function removeEntity(_0x1e0f2d,_0x1d642b){return function(_0x14996c){if(_0x14996c){return _0x14996c['destroy']()[_0x44b8('0x1d')](function(){_0x1e0f2d[_0x44b8('0x1e')](0xcc)[_0x44b8('0x14')]();});}};}function handleEntityNotFound(_0x1418db,_0x305a5c){return function(_0x51a34a){if(!_0x51a34a){_0x1418db[_0x44b8('0x13')](0x194);}return _0x51a34a;};}function handleError(_0x54677c,_0x41a922){_0x41a922=_0x41a922||0x1f4;return function(_0x228c81){logger[_0x44b8('0x1f')](_0x228c81[_0x44b8('0x20')]);if(_0x228c81[_0x44b8('0x21')]){delete _0x228c81['name'];}_0x54677c[_0x44b8('0x1e')](_0x41a922)['send'](_0x228c81);};}exports[_0x44b8('0x22')]=function(_0x350482,_0x549a26){var _0x17ac44={},_0x470f49={},_0x2656d7={'count':0x0,'rows':[]};var _0x59c1bf=_[_0x44b8('0x23')](db[_0x44b8('0x24')]['rawAttributes'],function(_0x2e0174){return{'name':_0x2e0174['fieldName'],'type':_0x2e0174[_0x44b8('0x25')]['key']};});_0x470f49['model']=_['map'](_0x59c1bf,_0x44b8('0x21'));_0x470f49[_0x44b8('0x26')]=_[_0x44b8('0x27')](_0x350482[_0x44b8('0x26')]);_0x470f49[_0x44b8('0x28')]=_[_0x44b8('0x29')](_0x470f49[_0x44b8('0x2a')],_0x470f49[_0x44b8('0x26')]);_0x17ac44[_0x44b8('0x2b')]=_[_0x44b8('0x29')](_0x470f49[_0x44b8('0x2a')],qs[_0x44b8('0x2c')](_0x350482[_0x44b8('0x26')]['fields']));_0x17ac44[_0x44b8('0x2b')]=_0x17ac44['attributes'][_0x44b8('0x2d')]?_0x17ac44[_0x44b8('0x2b')]:_0x470f49[_0x44b8('0x2a')];if(!_0x350482[_0x44b8('0x26')][_0x44b8('0x2e')]('nolimit')){_0x17ac44[_0x44b8('0x17')]=qs[_0x44b8('0x17')](_0x350482[_0x44b8('0x26')][_0x44b8('0x17')]);_0x17ac44[_0x44b8('0x16')]=qs['offset'](_0x350482[_0x44b8('0x26')][_0x44b8('0x16')]);}_0x17ac44[_0x44b8('0x2f')]=qs[_0x44b8('0x30')](_0x350482[_0x44b8('0x26')][_0x44b8('0x30')]);_0x17ac44[_0x44b8('0x31')]=qs[_0x44b8('0x28')](_[_0x44b8('0x32')](_0x350482[_0x44b8('0x26')],_0x470f49[_0x44b8('0x28')]),_0x59c1bf);if(_0x350482[_0x44b8('0x26')][_0x44b8('0x33')]){_0x17ac44[_0x44b8('0x31')]=_[_0x44b8('0x34')](_0x17ac44[_0x44b8('0x31')],{'$or':_[_0x44b8('0x23')](_0x59c1bf,function(_0xeff999){if(_0xeff999[_0x44b8('0x25')]!==_0x44b8('0x35')){var _0x2c02d6={};_0x2c02d6[_0xeff999[_0x44b8('0x21')]]={'$like':'%'+_0x350482['query'][_0x44b8('0x33')]+'%'};return _0x2c02d6;}})});}_0x17ac44=_[_0x44b8('0x34')]({},_0x17ac44,_0x350482['options']);var _0x25688b={'where':_0x17ac44[_0x44b8('0x31')]};return db[_0x44b8('0x24')][_0x44b8('0x15')](_0x25688b)['then'](function(_0x221543){_0x2656d7[_0x44b8('0x15')]=_0x221543;if(_0x350482[_0x44b8('0x26')][_0x44b8('0x36')]){_0x17ac44[_0x44b8('0x37')]=[{'all':!![]}];}return db[_0x44b8('0x24')][_0x44b8('0x38')](_0x17ac44);})[_0x44b8('0x1d')](function(_0x209039){_0x2656d7[_0x44b8('0x39')]=_0x209039;return _0x2656d7;})[_0x44b8('0x1d')](respondWithFilteredResult(_0x549a26,_0x17ac44))[_0x44b8('0x3a')](handleError(_0x549a26,null));};
\ No newline at end of file
+var _0x9bde=['index','map','Migration','fieldName','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','type','includeAll','include','findAll','rows','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','stack','name'];(function(_0x304f0e,_0x2604c6){var _0x26858c=function(_0x277b8d){while(--_0x277b8d){_0x304f0e['push'](_0x304f0e['shift']());}};_0x26858c(++_0x2604c6);}(_0x9bde,0xe1));var _0xe9bd=function(_0x21175d,_0x402553){_0x21175d=_0x21175d-0x0;var _0x5a1e91=_0x9bde[_0x21175d];return _0x5a1e91;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xe9bd('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xe9bd('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe9bd('0x2'));var moment=require(_0xe9bd('0x3'));var BPromise=require(_0xe9bd('0x4'));var Mustache=require(_0xe9bd('0x5'));var util=require(_0xe9bd('0x6'));var path=require(_0xe9bd('0x7'));var sox=require(_0xe9bd('0x8'));var csv=require('to-csv');var ejs=require(_0xe9bd('0x9'));var fs=require('fs');var _=require(_0xe9bd('0xa'));var squel=require(_0xe9bd('0xb'));var crypto=require(_0xe9bd('0xc'));var jsforce=require(_0xe9bd('0xd'));var deskjs=require(_0xe9bd('0xe'));var toCsv=require(_0xe9bd('0xf'));var querystring=require(_0xe9bd('0x10'));var Papa=require(_0xe9bd('0x11'));var Redis=require(_0xe9bd('0x12'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xe9bd('0x13'));var hardwareService=require(_0xe9bd('0x14'));var logger=require(_0xe9bd('0x15'))('api');var utils=require(_0xe9bd('0x16'));var config=require(_0xe9bd('0x17'));var db=require(_0xe9bd('0x18'))['db'];function respondWithStatusCode(_0x141587,_0x5e022a){_0x5e022a=_0x5e022a||0xcc;return function(_0x2c1d98){if(_0x2c1d98){return _0x141587['sendStatus'](_0x5e022a);}return _0x141587[_0xe9bd('0x19')](_0x5e022a)[_0xe9bd('0x1a')]();};}function respondWithResult(_0x3435b4,_0x51109f){_0x51109f=_0x51109f||0xc8;return function(_0x47ba5e){if(_0x47ba5e){return _0x3435b4[_0xe9bd('0x19')](_0x51109f)[_0xe9bd('0x1b')](_0x47ba5e);}};}function respondWithFilteredResult(_0x3a9e5f,_0x46a59b){return function(_0x3360bd){if(_0x3360bd){var _0x389e7b=_0x3360bd[_0xe9bd('0x1c')],_0x45a9f2=_0x46a59b[_0xe9bd('0x1d')],_0x573350=_0x46a59b['offset']+_0x46a59b[_0xe9bd('0x1e')],_0x1d11a0;if(_0x573350>=_0x389e7b){_0x573350=_0x389e7b;_0x1d11a0=0xc8;}else{_0x1d11a0=0xce;}_0x3a9e5f[_0xe9bd('0x19')](_0x1d11a0);return _0x3a9e5f[_0xe9bd('0x1f')](_0xe9bd('0x20'),_0x45a9f2+'-'+_0x573350+'/'+_0x389e7b)['json'](_0x3360bd);}return null;};}function patchUpdates(_0x20ec32){return function(_0x50a5e8){try{jsonpatch[_0xe9bd('0x21')](_0x50a5e8,_0x20ec32,!![]);}catch(_0x55b869){return BPromise[_0xe9bd('0x22')](_0x55b869);}return _0x50a5e8[_0xe9bd('0x23')]();};}function saveUpdates(_0x134c4e,_0x3dda13){return function(_0x1acb82){if(_0x1acb82){return _0x1acb82[_0xe9bd('0x24')](_0x134c4e)[_0xe9bd('0x25')](function(_0x49165b){return _0x49165b;});}return null;};}function removeEntity(_0x133318,_0x28cd17){return function(_0x4ecaf5){if(_0x4ecaf5){return _0x4ecaf5[_0xe9bd('0x26')]()['then'](function(){_0x133318[_0xe9bd('0x19')](0xcc)[_0xe9bd('0x1a')]();});}};}function handleEntityNotFound(_0x36f8c0,_0xf02209){return function(_0x5bc4bf){if(!_0x5bc4bf){_0x36f8c0[_0xe9bd('0x27')](0x194);}return _0x5bc4bf;};}function handleError(_0x1e3cbb,_0x2c9a57){_0x2c9a57=_0x2c9a57||0x1f4;return function(_0x39b206){logger[_0xe9bd('0x28')](_0x39b206[_0xe9bd('0x29')]);if(_0x39b206[_0xe9bd('0x2a')]){delete _0x39b206[_0xe9bd('0x2a')];}_0x1e3cbb[_0xe9bd('0x19')](_0x2c9a57)['send'](_0x39b206);};}exports[_0xe9bd('0x2b')]=function(_0x38fdfa,_0x5ba1d6){var _0x3b13b7={},_0xc25248={},_0x119672={'count':0x0,'rows':[]};var _0x429055=_[_0xe9bd('0x2c')](db[_0xe9bd('0x2d')]['rawAttributes'],function(_0x5b7f1d){return{'name':_0x5b7f1d[_0xe9bd('0x2e')],'type':_0x5b7f1d['type'][_0xe9bd('0x2f')]};});_0xc25248[_0xe9bd('0x30')]=_[_0xe9bd('0x2c')](_0x429055,_0xe9bd('0x2a'));_0xc25248[_0xe9bd('0x31')]=_['keys'](_0x38fdfa['query']);_0xc25248[_0xe9bd('0x32')]=_[_0xe9bd('0x33')](_0xc25248[_0xe9bd('0x30')],_0xc25248[_0xe9bd('0x31')]);_0x3b13b7[_0xe9bd('0x34')]=_[_0xe9bd('0x33')](_0xc25248[_0xe9bd('0x30')],qs[_0xe9bd('0x35')](_0x38fdfa[_0xe9bd('0x31')]['fields']));_0x3b13b7[_0xe9bd('0x34')]=_0x3b13b7[_0xe9bd('0x34')][_0xe9bd('0x36')]?_0x3b13b7['attributes']:_0xc25248['model'];if(!_0x38fdfa[_0xe9bd('0x31')][_0xe9bd('0x37')](_0xe9bd('0x38'))){_0x3b13b7[_0xe9bd('0x1e')]=qs[_0xe9bd('0x1e')](_0x38fdfa[_0xe9bd('0x31')][_0xe9bd('0x1e')]);_0x3b13b7[_0xe9bd('0x1d')]=qs[_0xe9bd('0x1d')](_0x38fdfa[_0xe9bd('0x31')][_0xe9bd('0x1d')]);}_0x3b13b7[_0xe9bd('0x39')]=qs[_0xe9bd('0x3a')](_0x38fdfa[_0xe9bd('0x31')][_0xe9bd('0x3a')]);_0x3b13b7[_0xe9bd('0x3b')]=qs[_0xe9bd('0x32')](_[_0xe9bd('0x3c')](_0x38fdfa['query'],_0xc25248[_0xe9bd('0x32')]),_0x429055);if(_0x38fdfa[_0xe9bd('0x31')]['filter']){_0x3b13b7[_0xe9bd('0x3b')]=_[_0xe9bd('0x3d')](_0x3b13b7['where'],{'$or':_['map'](_0x429055,function(_0x2785e6){if(_0x2785e6[_0xe9bd('0x3e')]!=='VIRTUAL'){var _0x2d1289={};_0x2d1289[_0x2785e6[_0xe9bd('0x2a')]]={'$like':'%'+_0x38fdfa[_0xe9bd('0x31')]['filter']+'%'};return _0x2d1289;}})});}_0x3b13b7=_[_0xe9bd('0x3d')]({},_0x3b13b7,_0x38fdfa['options']);var _0x3c8f7e={'where':_0x3b13b7[_0xe9bd('0x3b')]};return db[_0xe9bd('0x2d')][_0xe9bd('0x1c')](_0x3c8f7e)['then'](function(_0x41f2d4){_0x119672[_0xe9bd('0x1c')]=_0x41f2d4;if(_0x38fdfa[_0xe9bd('0x31')][_0xe9bd('0x3f')]){_0x3b13b7[_0xe9bd('0x40')]=[{'all':!![]}];}return db[_0xe9bd('0x2d')][_0xe9bd('0x41')](_0x3b13b7);})[_0xe9bd('0x25')](function(_0x2b5a71){_0x119672[_0xe9bd('0x42')]=_0x2b5a71;return _0x119672;})['then'](respondWithFilteredResult(_0x5ba1d6,_0x3b13b7))['catch'](handleError(_0x5ba1d6,null));};
\ No newline at end of file
diff --git a/server/api/migration/migration.model.js b/server/api/migration/migration.model.js
index b246cb0..787a929 100644
--- a/server/api/migration/migration.model.js
+++ b/server/api/migration/migration.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7df1=['../../config/environment','./migration.attributes','define','lodash','util','../../config/logger','moment','bluebird','rimraf'];(function(_0x3861b5,_0x1d7fef){var _0x31e665=function(_0x1f2a43){while(--_0x1f2a43){_0x3861b5['push'](_0x3861b5['shift']());}};_0x31e665(++_0x1d7fef);}(_0x7df1,0xe4));var _0x17df=function(_0x236564,_0xa5063a){_0x236564=_0x236564-0x0;var _0x439ba1=_0x7df1[_0x236564];return _0x439ba1;};'use strict';var _=require(_0x17df('0x0'));var util=require(_0x17df('0x1'));var logger=require(_0x17df('0x2'))('api');var moment=require(_0x17df('0x3'));var BPromise=require(_0x17df('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x17df('0x5'));var config=require(_0x17df('0x6'));var attributes=require(_0x17df('0x7'));module['exports']=function(_0xe829a5,_0x4c0c0e){return _0xe829a5[_0x17df('0x8')]('Migration',attributes,{'tableName':'migrations','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x9d02=['lodash','../../config/logger','moment','request-promise','path','../../config/environment','./migration.attributes','exports','Migration','migrations'];(function(_0x3f3194,_0x307fcd){var _0x588d9c=function(_0x5ef84b){while(--_0x5ef84b){_0x3f3194['push'](_0x3f3194['shift']());}};_0x588d9c(++_0x307fcd);}(_0x9d02,0x118));var _0x29d0=function(_0x4958dc,_0x178210){_0x4958dc=_0x4958dc-0x0;var _0xfc384f=_0x9d02[_0x4958dc];return _0xfc384f;};'use strict';var _=require(_0x29d0('0x0'));var util=require('util');var logger=require(_0x29d0('0x1'))('api');var moment=require(_0x29d0('0x2'));var BPromise=require('bluebird');var rp=require(_0x29d0('0x3'));var fs=require('fs');var path=require(_0x29d0('0x4'));var rimraf=require('rimraf');var config=require(_0x29d0('0x5'));var attributes=require(_0x29d0('0x6'));module[_0x29d0('0x7')]=function(_0x5a9824,_0x5ef279){return _0x5a9824['define'](_0x29d0('0x8'),attributes,{'tableName':_0x29d0('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/migration/migration.rpc.js b/server/api/migration/migration.rpc.js
index f33638a..5135d55 100644
--- a/server/api/migration/migration.rpc.js
+++ b/server/api/migration/migration.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xf750=['info','result','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','request','then','request\x20sent','debug','Migration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','Migration,\x20%s,\x20%s'];(function(_0x4709c0,_0x3396c7){var _0x13348b=function(_0x426235){while(--_0x426235){_0x4709c0['push'](_0x4709c0['shift']());}};_0x13348b(++_0x3396c7);}(_0xf750,0x117));var _0x0f75=function(_0x140d2f,_0x2ad576){_0x140d2f=_0x140d2f-0x0;var _0x1a04c6=_0xf750[_0x140d2f];return _0x1a04c6;};'use strict';var _=require('lodash');var util=require(_0x0f75('0x0'));var moment=require('moment');var BPromise=require(_0x0f75('0x1'));var rs=require(_0x0f75('0x2'));var fs=require('fs');var Redis=require(_0x0f75('0x3'));var db=require(_0x0f75('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x0f75('0x5'))(_0x0f75('0x6'));var config=require('../../config/environment');var jayson=require(_0x0f75('0x7'));var client=jayson[_0x0f75('0x8')][_0x0f75('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x54913e,_0x121f4a,_0x3cafe6){return new BPromise(function(_0x5411e8,_0x1b8be3){return client[_0x0f75('0xa')](_0x54913e,_0x3cafe6)[_0x0f75('0xb')](function(_0x3b1f2c){logger['info']('Migration,\x20%s,\x20%s',_0x121f4a,_0x0f75('0xc'));logger[_0x0f75('0xd')](_0x0f75('0xe'),_0x121f4a,_0x0f75('0xc'),JSON[_0x0f75('0xf')](_0x3b1f2c));if(_0x3b1f2c[_0x0f75('0x10')]){if(_0x3b1f2c[_0x0f75('0x10')][_0x0f75('0x11')]===0x1f4){logger[_0x0f75('0x10')]('Migration,\x20%s,\x20%s',_0x121f4a,_0x3b1f2c[_0x0f75('0x10')][_0x0f75('0x12')]);return _0x1b8be3(_0x3b1f2c[_0x0f75('0x10')][_0x0f75('0x12')]);}logger[_0x0f75('0x10')](_0x0f75('0x13'),_0x121f4a,_0x3b1f2c[_0x0f75('0x10')][_0x0f75('0x12')]);return _0x5411e8(_0x3b1f2c[_0x0f75('0x10')][_0x0f75('0x12')]);}else{logger[_0x0f75('0x14')](_0x0f75('0x13'),_0x121f4a,_0x0f75('0xc'));_0x5411e8(_0x3b1f2c[_0x0f75('0x15')][_0x0f75('0x12')]);}})[_0x0f75('0x16')](function(_0x5cbc30){logger[_0x0f75('0x10')](_0x0f75('0x13'),_0x121f4a,_0x5cbc30);_0x1b8be3(_0x5cbc30);});});}
\ No newline at end of file
+var _0x3174=['info','Migration,\x20%s,\x20%s','request\x20sent','debug','Migration,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then'];(function(_0x2f32c4,_0x35729f){var _0x324f99=function(_0x53afb2){while(--_0x53afb2){_0x2f32c4['push'](_0x2f32c4['shift']());}};_0x324f99(++_0x35729f);}(_0x3174,0x154));var _0x4317=function(_0x229e3f,_0x28cb23){_0x229e3f=_0x229e3f-0x0;var _0x26baec=_0x3174[_0x229e3f];return _0x26baec;};'use strict';var _=require(_0x4317('0x0'));var util=require('util');var moment=require(_0x4317('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4317('0x2'));var db=require(_0x4317('0x3'))['db'];var utils=require(_0x4317('0x4'));var logger=require(_0x4317('0x5'))(_0x4317('0x6'));var config=require('../../config/environment');var jayson=require(_0x4317('0x7'));var client=jayson[_0x4317('0x8')][_0x4317('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x278cbb,_0x90b2b9,_0x390b2b){return new BPromise(function(_0x5440fb,_0x22cd7b){return client[_0x4317('0xa')](_0x278cbb,_0x390b2b)[_0x4317('0xb')](function(_0x5d921f){logger[_0x4317('0xc')](_0x4317('0xd'),_0x90b2b9,_0x4317('0xe'));logger[_0x4317('0xf')](_0x4317('0x10'),_0x90b2b9,_0x4317('0xe'),JSON['stringify'](_0x5d921f));if(_0x5d921f['error']){if(_0x5d921f[_0x4317('0x11')][_0x4317('0x12')]===0x1f4){logger[_0x4317('0x11')](_0x4317('0xd'),_0x90b2b9,_0x5d921f[_0x4317('0x11')][_0x4317('0x13')]);return _0x22cd7b(_0x5d921f[_0x4317('0x11')][_0x4317('0x13')]);}logger[_0x4317('0x11')](_0x4317('0xd'),_0x90b2b9,_0x5d921f[_0x4317('0x11')]['message']);return _0x5440fb(_0x5d921f['error'][_0x4317('0x13')]);}else{logger[_0x4317('0xc')](_0x4317('0xd'),_0x90b2b9,_0x4317('0xe'));_0x5440fb(_0x5d921f[_0x4317('0x14')][_0x4317('0x13')]);}})[_0x4317('0x15')](function(_0x22480e){logger[_0x4317('0x11')](_0x4317('0xd'),_0x90b2b9,_0x22480e);_0x22cd7b(_0x22480e);});});}
\ No newline at end of file
diff --git a/server/api/network/index.js b/server/api/network/index.js
index 4971e77..ec27933 100644
--- a/server/api/network/index.js
+++ b/server/api/network/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x277c=['path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./network.controller','index','/:id','show','post','create','put','isAuthenticated','update','delete','destroy','exports','multer'];(function(_0x52f6e5,_0x338c96){var _0x5a4304=function(_0x7cb80b){while(--_0x7cb80b){_0x52f6e5['push'](_0x52f6e5['shift']());}};_0x5a4304(++_0x338c96);}(_0x277c,0x153));var _0xc277=function(_0x81bbc3,_0x353d30){_0x81bbc3=_0x81bbc3-0x0;var _0x2b1104=_0x277c[_0x81bbc3];return _0x2b1104;};'use strict';var multer=require(_0xc277('0x0'));var util=require('util');var path=require(_0xc277('0x1'));var timeout=require(_0xc277('0x2'));var express=require(_0xc277('0x3'));var router=express[_0xc277('0x4')]();var auth=require(_0xc277('0x5'));var interaction=require(_0xc277('0x6'));var config=require(_0xc277('0x7'));var controller=require(_0xc277('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0xc277('0x9')]);router['get'](_0xc277('0xa'),auth['isAuthenticated'](),controller[_0xc277('0xb')]);router[_0xc277('0xc')]('/',auth['isAuthenticated'](),controller[_0xc277('0xd')]);router[_0xc277('0xe')](_0xc277('0xa'),auth[_0xc277('0xf')](),controller[_0xc277('0x10')]);router[_0xc277('0x11')]('/:id',auth['isAuthenticated'](),controller[_0xc277('0x12')]);module[_0xc277('0x13')]=router;
\ No newline at end of file
+var _0xd298=['isAuthenticated','get','/:id','post','create','update','destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x3511d3,_0x4107ae){var _0x5d6321=function(_0x1a23da){while(--_0x1a23da){_0x3511d3['push'](_0x3511d3['shift']());}};_0x5d6321(++_0x4107ae);}(_0xd298,0xf8));var _0x8d29=function(_0x1cfb37,_0x5c8f3e){_0x1cfb37=_0x1cfb37-0x0;var _0x510f9e=_0xd298[_0x1cfb37];return _0x510f9e;};'use strict';var multer=require(_0x8d29('0x0'));var util=require('util');var path=require(_0x8d29('0x1'));var timeout=require(_0x8d29('0x2'));var express=require(_0x8d29('0x3'));var router=express[_0x8d29('0x4')]();var auth=require(_0x8d29('0x5'));var interaction=require(_0x8d29('0x6'));var config=require('../../config/environment');var controller=require('./network.controller');router['get']('/',auth[_0x8d29('0x7')](),controller['index']);router[_0x8d29('0x8')](_0x8d29('0x9'),auth[_0x8d29('0x7')](),controller['show']);router[_0x8d29('0xa')]('/',auth[_0x8d29('0x7')](),controller[_0x8d29('0xb')]);router['put'](_0x8d29('0x9'),auth[_0x8d29('0x7')](),controller[_0x8d29('0xc')]);router['delete'](_0x8d29('0x9'),auth['isAuthenticated'](),controller[_0x8d29('0xd')]);module[_0x8d29('0xe')]=router;
\ No newline at end of file
diff --git a/server/api/network/network.attributes.js b/server/api/network/network.attributes.js
index aa1cef5..cfdf8a4 100644
--- a/server/api/network/network.attributes.js
+++ b/server/api/network/network.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xa9e0=['STRING','sequelize','exports','ENUM','stun'];(function(_0x204f60,_0x1247cc){var _0x3fb242=function(_0x50e617){while(--_0x50e617){_0x204f60['push'](_0x204f60['shift']());}};_0x3fb242(++_0x1247cc);}(_0xa9e0,0x123));var _0x0a9e=function(_0x47e7cb,_0x4c1b8d){_0x47e7cb=_0x47e7cb-0x0;var _0x2a8874=_0xa9e0[_0x47e7cb];return _0x2a8874;};'use strict';var Sequelize=require(_0x0a9e('0x0'));module[_0x0a9e('0x1')]={'type':{'type':Sequelize[_0x0a9e('0x2')]('localnet','externip',_0x0a9e('0x3'),'turn')},'value':{'type':Sequelize[_0x0a9e('0x4')]},'username':{'type':Sequelize[_0x0a9e('0x4')]},'password':{'type':Sequelize[_0x0a9e('0x4')]}};
\ No newline at end of file
+var _0xa9e0=['STRING','sequelize','exports','ENUM','stun'];(function(_0x22daba,_0x4ee541){var _0x5a6588=function(_0x53ab35){while(--_0x53ab35){_0x22daba['push'](_0x22daba['shift']());}};_0x5a6588(++_0x4ee541);}(_0xa9e0,0x123));var _0x0a9e=function(_0x491a7f,_0x28bb80){_0x491a7f=_0x491a7f-0x0;var _0x3d8f44=_0xa9e0[_0x491a7f];return _0x3d8f44;};'use strict';var Sequelize=require(_0x0a9e('0x0'));module[_0x0a9e('0x1')]={'type':{'type':Sequelize[_0x0a9e('0x2')]('localnet','externip',_0x0a9e('0x3'),'turn')},'value':{'type':Sequelize[_0x0a9e('0x4')]},'username':{'type':Sequelize[_0x0a9e('0x4')]},'password':{'type':Sequelize[_0x0a9e('0x4')]}};
\ No newline at end of file
diff --git a/server/api/network/network.controller.js b/server/api/network/network.controller.js
index 8cf3410..1c8a217 100644
--- a/server/api/network/network.controller.js
+++ b/server/api/network/network.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x525e=['format','chan_sip.so','sequelize','server/files/templates/stun_multiple.ejs','res_stun_monitor.so','/etc/asterisk/sip_xcally_%s.conf','server/files/templates/turn_multiple.ejs','server/files/templates/network.ejs','toLowerCase','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','jayson/promise','client','http','test','Sequelize','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','info','request\x20sent','debug','Network,\x20%s,\x20%s,\x20%s','stringify','error','message','Network,\x20%s,\x20%s','result','sendStatus','status','end','json','count','offset','limit','set','apply','reject','save','update','then','destroy','name','send','index','map','Network','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','sort','pick','filter','where','merge','VIRTUAL','options','include','findAll','rows','catch','show','params','keys','find','transaction','body','toUpperCase','STUN','readFileSync','utf8','writeFileSync','/etc/asterisk/stun_xcally.conf','Reload','create','TURN','join','root','render','/etc/asterisk/turn_xcally.conf'];(function(_0xbe18c1,_0x4c0bb3){var _0xcaaf01=function(_0x27d071){while(--_0x27d071){_0xbe18c1['push'](_0xbe18c1['shift']());}};_0xcaaf01(++_0x4c0bb3);}(_0x525e,0x78));var _0xe525=function(_0x2fceed,_0xd983dc){_0x2fceed=_0x2fceed-0x0;var _0x28f0f3=_0x525e[_0x2fceed];return _0x28f0f3;};'use strict';var pdf=require(_0xe525('0x0'));var emlformat=require(_0xe525('0x1'));var rimraf=require(_0xe525('0x2'));var zipdir=require(_0xe525('0x3'));var jsonpatch=require(_0xe525('0x4'));var rp=require(_0xe525('0x5'));var moment=require(_0xe525('0x6'));var BPromise=require(_0xe525('0x7'));var Mustache=require('mustache');var util=require(_0xe525('0x8'));var path=require(_0xe525('0x9'));var sox=require(_0xe525('0xa'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0xe525('0xb'));var squel=require('squel');var crypto=require(_0xe525('0xc'));var jsforce=require(_0xe525('0xd'));var deskjs=require(_0xe525('0xe'));var toCsv=require(_0xe525('0xf'));var querystring=require(_0xe525('0x10'));var Papa=require(_0xe525('0x11'));var Redis=require(_0xe525('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xe525('0x13'));var as=require(_0xe525('0x14'));var hardwareService=require(_0xe525('0x15'));var logger=require(_0xe525('0x16'))(_0xe525('0x17'));var utils=require('../../config/utils');var config=require(_0xe525('0x18'));var db=require(_0xe525('0x19'))['db'];var jayson=require(_0xe525('0x1a'));var client=jayson[_0xe525('0x1b')][_0xe525('0x1c')]({'port':0x232a});function checkPasswordPattern(_0x1faf27,_0x348915,_0x222d90){if(_0x222d90){var _0xa275c4=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0xa275c4[_0xe525('0x1d')](_0x348915)){return _0x1faf27;}else{throw new db[(_0xe525('0x1e'))]['ValidationError'](_0xe525('0x1f'));}}else{return _0x1faf27;}}function respondWithRpcPromise(_0x31e108,_0x1d7f16,_0x4ef025,_0x2488b7){return new BPromise(function(_0x2ded1c,_0x23d220){var _0x107f40=_0x2488b7||client;return _0x107f40[_0xe525('0x20')](_0x31e108,_0x4ef025)['then'](function(_0x5558d9){logger[_0xe525('0x21')]('Network,\x20%s,\x20%s',_0x1d7f16,_0xe525('0x22'));logger[_0xe525('0x23')](_0xe525('0x24'),_0x1d7f16,_0xe525('0x22'),JSON[_0xe525('0x25')](_0x5558d9));if(_0x5558d9[_0xe525('0x26')]){if(_0x5558d9[_0xe525('0x26')]['code']===0x1f4){logger['error']('Network,\x20%s,\x20%s',_0x1d7f16,_0x5558d9['error'][_0xe525('0x27')]);return _0x23d220(_0x5558d9[_0xe525('0x26')][_0xe525('0x27')]);}logger[_0xe525('0x26')](_0xe525('0x28'),_0x1d7f16,_0x5558d9[_0xe525('0x26')][_0xe525('0x27')]);return _0x2ded1c(_0x5558d9['error'][_0xe525('0x27')]);}else{logger[_0xe525('0x21')]('Network,\x20%s,\x20%s',_0x1d7f16,_0xe525('0x22'));_0x2ded1c(_0x5558d9[_0xe525('0x29')][_0xe525('0x27')]);}})['catch'](function(_0x6fc035){logger[_0xe525('0x26')](_0xe525('0x28'),_0x1d7f16,_0x6fc035);_0x23d220(_0x6fc035);});});}function respondWithStatusCode(_0x121980,_0x42a428){_0x42a428=_0x42a428||0xcc;return function(_0x4d5226){if(_0x4d5226){return _0x121980[_0xe525('0x2a')](_0x42a428);}return _0x121980[_0xe525('0x2b')](_0x42a428)[_0xe525('0x2c')]();};}function respondWithResult(_0x2872b9,_0x44098a){_0x44098a=_0x44098a||0xc8;return function(_0x517849){if(_0x517849){return _0x2872b9[_0xe525('0x2b')](_0x44098a)[_0xe525('0x2d')](_0x517849);}};}function respondWithFilteredResult(_0x3facd4,_0x43a4da){return function(_0x537728){if(_0x537728){var _0x1112a8=_0x537728[_0xe525('0x2e')],_0x2d2623=_0x43a4da['offset'],_0xc75d0f=_0x43a4da[_0xe525('0x2f')]+_0x43a4da[_0xe525('0x30')],_0x4bccb3;if(_0xc75d0f>=_0x1112a8){_0xc75d0f=_0x1112a8;_0x4bccb3=0xc8;}else{_0x4bccb3=0xce;}_0x3facd4['status'](_0x4bccb3);return _0x3facd4[_0xe525('0x31')]('Content-Range',_0x2d2623+'-'+_0xc75d0f+'/'+_0x1112a8)[_0xe525('0x2d')](_0x537728);}return null;};}function patchUpdates(_0x2c4a12){return function(_0x534545){try{jsonpatch[_0xe525('0x32')](_0x534545,_0x2c4a12,!![]);}catch(_0x57dafc){return BPromise[_0xe525('0x33')](_0x57dafc);}return _0x534545[_0xe525('0x34')]();};}function saveUpdates(_0x1af210,_0x263ef4){return function(_0x1ef0ba){if(_0x1ef0ba){return _0x1ef0ba[_0xe525('0x35')](_0x1af210)[_0xe525('0x36')](function(_0x8bdb8){return _0x8bdb8;});}return null;};}function removeEntity(_0xf645,_0x3f3964){return function(_0x1f28a7){if(_0x1f28a7){return _0x1f28a7[_0xe525('0x37')]()[_0xe525('0x36')](function(){_0xf645[_0xe525('0x2b')](0xcc)[_0xe525('0x2c')]();});}};}function handleEntityNotFound(_0x38ac7a,_0x4e386b){return function(_0x37fc67){if(!_0x37fc67){_0x38ac7a[_0xe525('0x2a')](0x194);}return _0x37fc67;};}function handleError(_0x35833e,_0x4e6e5f){_0x4e6e5f=_0x4e6e5f||0x1f4;return function(_0x18f322){logger['error'](_0x18f322['stack']);if(_0x18f322[_0xe525('0x38')]){delete _0x18f322['name'];}_0x35833e['status'](_0x4e6e5f)[_0xe525('0x39')](_0x18f322);};}exports[_0xe525('0x3a')]=function(_0x2e85b6,_0x573191){var _0x27b3af={},_0x5a2c57={},_0x47fea5={'count':0x0,'rows':[]};var _0x27b2a1=_[_0xe525('0x3b')](db[_0xe525('0x3c')][_0xe525('0x3d')],function(_0x332f47){return{'name':_0x332f47[_0xe525('0x3e')],'type':_0x332f47[_0xe525('0x3f')][_0xe525('0x40')]};});_0x5a2c57[_0xe525('0x41')]=_[_0xe525('0x3b')](_0x27b2a1,_0xe525('0x38'));_0x5a2c57[_0xe525('0x42')]=_['keys'](_0x2e85b6[_0xe525('0x42')]);_0x5a2c57[_0xe525('0x43')]=_[_0xe525('0x44')](_0x5a2c57['model'],_0x5a2c57[_0xe525('0x42')]);_0x27b3af[_0xe525('0x45')]=_['intersection'](_0x5a2c57[_0xe525('0x41')],qs['fields'](_0x2e85b6[_0xe525('0x42')][_0xe525('0x46')]));_0x27b3af[_0xe525('0x45')]=_0x27b3af[_0xe525('0x45')][_0xe525('0x47')]?_0x27b3af[_0xe525('0x45')]:_0x5a2c57[_0xe525('0x41')];if(!_0x2e85b6[_0xe525('0x42')]['hasOwnProperty']('nolimit')){_0x27b3af[_0xe525('0x30')]=qs['limit'](_0x2e85b6[_0xe525('0x42')]['limit']);_0x27b3af[_0xe525('0x2f')]=qs['offset'](_0x2e85b6[_0xe525('0x42')][_0xe525('0x2f')]);}_0x27b3af['order']=qs['sort'](_0x2e85b6[_0xe525('0x42')][_0xe525('0x48')]);_0x27b3af['where']=qs[_0xe525('0x43')](_[_0xe525('0x49')](_0x2e85b6[_0xe525('0x42')],_0x5a2c57[_0xe525('0x43')]),_0x27b2a1);if(_0x2e85b6['query'][_0xe525('0x4a')]){_0x27b3af[_0xe525('0x4b')]=_[_0xe525('0x4c')](_0x27b3af[_0xe525('0x4b')],{'$or':_[_0xe525('0x3b')](_0x27b2a1,function(_0x4efddf){if(_0x4efddf[_0xe525('0x3f')]!==_0xe525('0x4d')){var _0x964541={};_0x964541[_0x4efddf[_0xe525('0x38')]]={'$like':'%'+_0x2e85b6[_0xe525('0x42')]['filter']+'%'};return _0x964541;}})});}_0x27b3af=_['merge']({},_0x27b3af,_0x2e85b6[_0xe525('0x4e')]);var _0x3d2c0f={'where':_0x27b3af['where']};return db[_0xe525('0x3c')][_0xe525('0x2e')](_0x3d2c0f)[_0xe525('0x36')](function(_0x12fb48){_0x47fea5[_0xe525('0x2e')]=_0x12fb48;if(_0x2e85b6[_0xe525('0x42')]['includeAll']){_0x27b3af[_0xe525('0x4f')]=[{'all':!![]}];}return db[_0xe525('0x3c')][_0xe525('0x50')](_0x27b3af);})[_0xe525('0x36')](function(_0x2211dd){_0x47fea5[_0xe525('0x51')]=_0x2211dd;return _0x47fea5;})[_0xe525('0x36')](respondWithFilteredResult(_0x573191,_0x27b3af))[_0xe525('0x52')](handleError(_0x573191,null));};exports[_0xe525('0x53')]=function(_0x368fd7,_0x380601){var _0x365194={'raw':!![],'where':{'id':_0x368fd7[_0xe525('0x54')]['id']}},_0x59c6e5={};_0x59c6e5['model']=_[_0xe525('0x55')](db[_0xe525('0x3c')]['rawAttributes']);_0x59c6e5[_0xe525('0x42')]=_[_0xe525('0x55')](_0x368fd7[_0xe525('0x42')]);_0x59c6e5[_0xe525('0x43')]=_[_0xe525('0x44')](_0x59c6e5[_0xe525('0x41')],_0x59c6e5[_0xe525('0x42')]);_0x365194[_0xe525('0x45')]=_[_0xe525('0x44')](_0x59c6e5[_0xe525('0x41')],qs[_0xe525('0x46')](_0x368fd7[_0xe525('0x42')][_0xe525('0x46')]));_0x365194[_0xe525('0x45')]=_0x365194[_0xe525('0x45')][_0xe525('0x47')]?_0x365194[_0xe525('0x45')]:_0x59c6e5[_0xe525('0x41')];if(_0x368fd7[_0xe525('0x42')]['includeAll']){_0x365194[_0xe525('0x4f')]=[{'all':!![]}];}_0x365194=_[_0xe525('0x4c')]({},_0x365194,_0x368fd7[_0xe525('0x4e')]);return db[_0xe525('0x3c')][_0xe525('0x56')](_0x365194)[_0xe525('0x36')](handleEntityNotFound(_0x380601,null))[_0xe525('0x36')](respondWithResult(_0x380601,null))[_0xe525('0x52')](handleError(_0x380601,null));};exports['create']=function(_0x3efdc6,_0x3189c9,_0x5de3b7){var _0x5b046d;return db['sequelize'][_0xe525('0x57')](function(_0x3466c3){return db[_0xe525('0x3c')]['create'](_0x3efdc6[_0xe525('0x58')],{'raw':!![]})[_0xe525('0x36')](function(_0x46aa56){_0x5b046d=_0x46aa56;return db['Network'][_0xe525('0x50')]({'where':{'type':_0x3efdc6['body'][_0xe525('0x3f')]},'raw':!![]});})[_0xe525('0x36')](function(_0x36f0b8){if(_0x5b046d[_0xe525('0x3f')][_0xe525('0x59')]()==_0xe525('0x5a')){var _0x5e150c=fs[_0xe525('0x5b')](path['join'](config['root'],'server/files/templates/stun_multiple.ejs'),_0xe525('0x5c'));var _0x10b71b=ejs['render'](_0x5e150c,{'networks':_0x36f0b8||[]});fs[_0xe525('0x5d')](_0xe525('0x5e'),_0x10b71b);return respondWithRpcPromise(_0xe525('0x5f'),_0xe525('0x60'),{'module':'res_stun_monitor.so'});}else if(_0x5b046d['type'][_0xe525('0x59')]()==_0xe525('0x61')){var _0x157015=fs[_0xe525('0x5b')](path[_0xe525('0x62')](config[_0xe525('0x63')],'server/files/templates/turn_multiple.ejs'),_0xe525('0x5c'));var _0x43815b=ejs[_0xe525('0x64')](_0x157015,{'networks':_0x36f0b8||[]});fs[_0xe525('0x5d')](_0xe525('0x65'),_0x43815b);return respondWithRpcPromise(_0xe525('0x5f'),_0xe525('0x60'),{'module':'res_stun_monitor.so'});}else{var _0x3a04a0=fs[_0xe525('0x5b')](path['join'](config['root'],'server/files/templates/network.ejs'),_0xe525('0x5c'));var _0x311cf7=ejs['render'](_0x3a04a0,{'networks':_0x36f0b8||[]});fs['writeFileSync'](util[_0xe525('0x66')]('/etc/asterisk/sip_xcally_%s.conf',_0x3efdc6['body'][_0xe525('0x3f')]['toLowerCase']()),_0x311cf7);return respondWithRpcPromise(_0xe525('0x5f'),_0xe525('0x60'),{'module':_0xe525('0x67')});}return null;})['then'](function(){return _0x5b046d;});})[_0xe525('0x36')](respondWithResult(_0x3189c9,0xc9))[_0xe525('0x52')](handleError(_0x3189c9,null));};exports[_0xe525('0x35')]=function(_0x42a095,_0x3c5918,_0x4ba1ab){var _0x3dd6d7;return db[_0xe525('0x68')]['transaction'](function(_0x350d97){return db['Network']['find']({'where':{'id':_0x42a095[_0xe525('0x54')]['id']}})[_0xe525('0x36')](handleEntityNotFound(_0x3c5918,null))[_0xe525('0x36')](saveUpdates(_0x42a095['body'],null))[_0xe525('0x36')](function(_0x42a930){if(_0x42a930){_0x3dd6d7=_0x42a930;return db['Network'][_0xe525('0x50')]({'where':{'type':_0x3dd6d7[_0xe525('0x3f')]},'raw':!![]});}return null;})[_0xe525('0x36')](function(_0x5a5269){if(_0x3dd6d7[_0xe525('0x3f')]['toUpperCase']()=='STUN'){var _0x3b8477=fs[_0xe525('0x5b')](path[_0xe525('0x62')](config[_0xe525('0x63')],_0xe525('0x69')),_0xe525('0x5c'));var _0xdb08ac=ejs[_0xe525('0x64')](_0x3b8477,{'networks':_0x5a5269||[]});fs['writeFileSync'](_0xe525('0x5e'),_0xdb08ac);return respondWithRpcPromise(_0xe525('0x5f'),'update',{'module':_0xe525('0x6a')});}else if(_0x3dd6d7[_0xe525('0x3f')][_0xe525('0x59')]()==_0xe525('0x61')){var _0x1706c2=fs['readFileSync'](path[_0xe525('0x62')](config['root'],'server/files/templates/turn_multiple.ejs'),_0xe525('0x5c'));var _0x23bae9=ejs['render'](_0x1706c2,{'networks':_0x5a5269||[]});fs[_0xe525('0x5d')](_0xe525('0x65'),_0x23bae9);return respondWithRpcPromise(_0xe525('0x5f'),_0xe525('0x35'),{'module':_0xe525('0x6a')});}else{var _0x2cf4f8=fs[_0xe525('0x5b')](path[_0xe525('0x62')](config['root'],'server/files/templates/network.ejs'),_0xe525('0x5c'));var _0x57fc0e=ejs[_0xe525('0x64')](_0x2cf4f8,{'networks':_0x5a5269||[]});fs[_0xe525('0x5d')](util[_0xe525('0x66')](_0xe525('0x6b'),_0x42a095[_0xe525('0x58')][_0xe525('0x3f')]['toLowerCase']()),_0x57fc0e);return respondWithRpcPromise(_0xe525('0x5f'),_0xe525('0x35'),{'module':_0xe525('0x67')});}return null;})[_0xe525('0x36')](function(_0x184266){if(_0x184266){return _0x3dd6d7;}return null;});})[_0xe525('0x36')](respondWithResult(_0x3c5918,null))['catch'](handleError(_0x3c5918,null));};exports[_0xe525('0x37')]=function(_0x317100,_0x38e7a4,_0x21ce8c){var _0x20480b;return db[_0xe525('0x3c')][_0xe525('0x56')]({'where':{'id':_0x317100[_0xe525('0x54')]['id']}})[_0xe525('0x36')](function(_0x4e1529){_0x20480b=_0x4e1529;return _0x4e1529;})[_0xe525('0x36')](handleEntityNotFound(_0x38e7a4,null))[_0xe525('0x36')](removeEntity(_0x38e7a4,null))[_0xe525('0x36')](function(){if(_0x20480b){return db['Network'][_0xe525('0x50')]({'where':{'type':_0x20480b[_0xe525('0x3f')]},'raw':!![]});}})[_0xe525('0x36')](function(_0x492438){if(_0x20480b[_0xe525('0x3f')][_0xe525('0x59')]()==_0xe525('0x5a')){var _0x4258bb=fs[_0xe525('0x5b')](path[_0xe525('0x62')](config[_0xe525('0x63')],'server/files/templates/stun_multiple.ejs'),_0xe525('0x5c'));var _0x99a41c=ejs[_0xe525('0x64')](_0x4258bb,{'networks':_0x492438||[]});fs[_0xe525('0x5d')]('/etc/asterisk/stun_xcally.conf',_0x99a41c);return respondWithRpcPromise(_0xe525('0x5f'),'destroy',{'module':_0xe525('0x6a')});}else if(_0x20480b['type'][_0xe525('0x59')]()==_0xe525('0x61')){var _0xedf15c=fs[_0xe525('0x5b')](path[_0xe525('0x62')](config['root'],_0xe525('0x6c')),_0xe525('0x5c'));var _0x163288=ejs[_0xe525('0x64')](_0xedf15c,{'networks':_0x492438||[]});fs[_0xe525('0x5d')](_0xe525('0x65'),_0x163288);return respondWithRpcPromise(_0xe525('0x5f'),_0xe525('0x37'),{'module':'res_stun_monitor.so'});}else{var _0x1ca5c5=fs[_0xe525('0x5b')](path[_0xe525('0x62')](config[_0xe525('0x63')],_0xe525('0x6d')),_0xe525('0x5c'));var _0x21915a=ejs[_0xe525('0x64')](_0x1ca5c5,{'networks':_0x492438||[]});fs[_0xe525('0x5d')](util[_0xe525('0x66')](_0xe525('0x6b'),_0x317100[_0xe525('0x58')][_0xe525('0x3f')][_0xe525('0x6e')]()),_0x21915a);return respondWithRpcPromise(_0xe525('0x5f'),_0xe525('0x37'),{'module':_0xe525('0x67')});}return null;})[_0xe525('0x52')](handleError(_0x38e7a4,null));};
\ No newline at end of file
+var _0x06c0=['lodash','squel','crypto','desk.js','to-csv','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','test','Sequelize','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','request\x20sent','debug','stringify','error','code','Network,\x20%s,\x20%s','message','result','catch','status','end','json','count','offset','limit','Content-Range','apply','save','update','destroy','sendStatus','stack','name','send','index','map','fieldName','key','query','keys','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','type','VIRTUAL','options','Network','includeAll','include','show','params','rawAttributes','find','create','transaction','findAll','body','STUN','readFileSync','join','root','server/files/templates/stun_multiple.ejs','utf8','render','writeFileSync','/etc/asterisk/stun_xcally.conf','Reload','toUpperCase','TURN','server/files/templates/turn_multiple.ejs','server/files/templates/network.ejs','format','toLowerCase','sequelize','res_stun_monitor.so','/etc/asterisk/turn_xcally.conf','/etc/asterisk/sip_xcally_%s.conf','chan_sip.so','html-pdf','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','sox','ejs'];(function(_0x5447fd,_0x52a6b5){var _0x15b28a=function(_0x370d4f){while(--_0x370d4f){_0x5447fd['push'](_0x5447fd['shift']());}};_0x15b28a(++_0x52a6b5);}(_0x06c0,0x1ad));var _0x006c=function(_0x102e37,_0x14a181){_0x102e37=_0x102e37-0x0;var _0x35a07c=_0x06c0[_0x102e37];return _0x35a07c;};'use strict';var pdf=require(_0x006c('0x0'));var emlformat=require(_0x006c('0x1'));var rimraf=require(_0x006c('0x2'));var zipdir=require(_0x006c('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x006c('0x4'));var moment=require('moment');var BPromise=require(_0x006c('0x5'));var Mustache=require(_0x006c('0x6'));var util=require(_0x006c('0x7'));var path=require(_0x006c('0x8'));var sox=require(_0x006c('0x9'));var csv=require('to-csv');var ejs=require(_0x006c('0xa'));var fs=require('fs');var _=require(_0x006c('0xb'));var squel=require(_0x006c('0xc'));var crypto=require(_0x006c('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x006c('0xe'));var toCsv=require(_0x006c('0xf'));var querystring=require('querystring');var Papa=require(_0x006c('0x10'));var Redis=require(_0x006c('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x006c('0x12'));var hardwareService=require(_0x006c('0x13'));var logger=require('../../config/logger')(_0x006c('0x14'));var utils=require(_0x006c('0x15'));var config=require(_0x006c('0x16'));var db=require(_0x006c('0x17'))['db'];var jayson=require(_0x006c('0x18'));var client=jayson['client']['http']({'port':0x232a});function checkPasswordPattern(_0x339887,_0x393ec0,_0x259fc5){if(_0x259fc5){var _0x3ce472=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x3ce472[_0x006c('0x19')](_0x393ec0)){return _0x339887;}else{throw new db[(_0x006c('0x1a'))]['ValidationError'](_0x006c('0x1b'));}}else{return _0x339887;}}function respondWithRpcPromise(_0x58876b,_0x17a628,_0x4ebb1d,_0x190715){return new BPromise(function(_0x90b45a,_0x305d87){var _0x452123=_0x190715||client;return _0x452123[_0x006c('0x1c')](_0x58876b,_0x4ebb1d)[_0x006c('0x1d')](function(_0x474352){logger[_0x006c('0x1e')]('Network,\x20%s,\x20%s',_0x17a628,_0x006c('0x1f'));logger[_0x006c('0x20')]('Network,\x20%s,\x20%s,\x20%s',_0x17a628,_0x006c('0x1f'),JSON[_0x006c('0x21')](_0x474352));if(_0x474352[_0x006c('0x22')]){if(_0x474352['error'][_0x006c('0x23')]===0x1f4){logger[_0x006c('0x22')](_0x006c('0x24'),_0x17a628,_0x474352[_0x006c('0x22')][_0x006c('0x25')]);return _0x305d87(_0x474352[_0x006c('0x22')][_0x006c('0x25')]);}logger[_0x006c('0x22')](_0x006c('0x24'),_0x17a628,_0x474352[_0x006c('0x22')]['message']);return _0x90b45a(_0x474352[_0x006c('0x22')]['message']);}else{logger['info'](_0x006c('0x24'),_0x17a628,_0x006c('0x1f'));_0x90b45a(_0x474352[_0x006c('0x26')]['message']);}})[_0x006c('0x27')](function(_0x24340b){logger[_0x006c('0x22')](_0x006c('0x24'),_0x17a628,_0x24340b);_0x305d87(_0x24340b);});});}function respondWithStatusCode(_0x3d33b7,_0x32bd56){_0x32bd56=_0x32bd56||0xcc;return function(_0x3759c2){if(_0x3759c2){return _0x3d33b7['sendStatus'](_0x32bd56);}return _0x3d33b7[_0x006c('0x28')](_0x32bd56)[_0x006c('0x29')]();};}function respondWithResult(_0x48ba47,_0x333c53){_0x333c53=_0x333c53||0xc8;return function(_0x2fd1d9){if(_0x2fd1d9){return _0x48ba47['status'](_0x333c53)[_0x006c('0x2a')](_0x2fd1d9);}};}function respondWithFilteredResult(_0x1aa433,_0x570dfc){return function(_0xbf397c){if(_0xbf397c){var _0x5caf93=_0xbf397c[_0x006c('0x2b')],_0x5e1567=_0x570dfc[_0x006c('0x2c')],_0x26f6e6=_0x570dfc[_0x006c('0x2c')]+_0x570dfc[_0x006c('0x2d')],_0x22d2e9;if(_0x26f6e6>=_0x5caf93){_0x26f6e6=_0x5caf93;_0x22d2e9=0xc8;}else{_0x22d2e9=0xce;}_0x1aa433['status'](_0x22d2e9);return _0x1aa433['set'](_0x006c('0x2e'),_0x5e1567+'-'+_0x26f6e6+'/'+_0x5caf93)['json'](_0xbf397c);}return null;};}function patchUpdates(_0x33f8a2){return function(_0x31c5b5){try{jsonpatch[_0x006c('0x2f')](_0x31c5b5,_0x33f8a2,!![]);}catch(_0x1471ac){return BPromise['reject'](_0x1471ac);}return _0x31c5b5[_0x006c('0x30')]();};}function saveUpdates(_0x2ee02e,_0x3f969b){return function(_0x10597d){if(_0x10597d){return _0x10597d[_0x006c('0x31')](_0x2ee02e)[_0x006c('0x1d')](function(_0x3191a0){return _0x3191a0;});}return null;};}function removeEntity(_0x12d4a9,_0x3f6241){return function(_0x117213){if(_0x117213){return _0x117213[_0x006c('0x32')]()[_0x006c('0x1d')](function(){_0x12d4a9[_0x006c('0x28')](0xcc)[_0x006c('0x29')]();});}};}function handleEntityNotFound(_0xa03c8,_0x33440f){return function(_0x655697){if(!_0x655697){_0xa03c8[_0x006c('0x33')](0x194);}return _0x655697;};}function handleError(_0x3c5d68,_0x695520){_0x695520=_0x695520||0x1f4;return function(_0x472d6f){logger[_0x006c('0x22')](_0x472d6f[_0x006c('0x34')]);if(_0x472d6f['name']){delete _0x472d6f[_0x006c('0x35')];}_0x3c5d68['status'](_0x695520)[_0x006c('0x36')](_0x472d6f);};}exports[_0x006c('0x37')]=function(_0x55102c,_0x577413){var _0x20c716={},_0x1554ee={},_0x1ce03d={'count':0x0,'rows':[]};var _0x525f50=_[_0x006c('0x38')](db['Network']['rawAttributes'],function(_0x28542f){return{'name':_0x28542f[_0x006c('0x39')],'type':_0x28542f['type'][_0x006c('0x3a')]};});_0x1554ee['model']=_[_0x006c('0x38')](_0x525f50,_0x006c('0x35'));_0x1554ee[_0x006c('0x3b')]=_[_0x006c('0x3c')](_0x55102c[_0x006c('0x3b')]);_0x1554ee['filters']=_[_0x006c('0x3d')](_0x1554ee['model'],_0x1554ee[_0x006c('0x3b')]);_0x20c716[_0x006c('0x3e')]=_['intersection'](_0x1554ee[_0x006c('0x3f')],qs[_0x006c('0x40')](_0x55102c[_0x006c('0x3b')][_0x006c('0x40')]));_0x20c716['attributes']=_0x20c716[_0x006c('0x3e')][_0x006c('0x41')]?_0x20c716[_0x006c('0x3e')]:_0x1554ee[_0x006c('0x3f')];if(!_0x55102c[_0x006c('0x3b')][_0x006c('0x42')](_0x006c('0x43'))){_0x20c716[_0x006c('0x2d')]=qs[_0x006c('0x2d')](_0x55102c[_0x006c('0x3b')][_0x006c('0x2d')]);_0x20c716[_0x006c('0x2c')]=qs[_0x006c('0x2c')](_0x55102c[_0x006c('0x3b')][_0x006c('0x2c')]);}_0x20c716[_0x006c('0x44')]=qs[_0x006c('0x45')](_0x55102c[_0x006c('0x3b')][_0x006c('0x45')]);_0x20c716[_0x006c('0x46')]=qs[_0x006c('0x47')](_[_0x006c('0x48')](_0x55102c['query'],_0x1554ee[_0x006c('0x47')]),_0x525f50);if(_0x55102c['query'][_0x006c('0x49')]){_0x20c716[_0x006c('0x46')]=_[_0x006c('0x4a')](_0x20c716['where'],{'$or':_[_0x006c('0x38')](_0x525f50,function(_0x35ff04){if(_0x35ff04[_0x006c('0x4b')]!==_0x006c('0x4c')){var _0x56ad73={};_0x56ad73[_0x35ff04[_0x006c('0x35')]]={'$like':'%'+_0x55102c[_0x006c('0x3b')]['filter']+'%'};return _0x56ad73;}})});}_0x20c716=_['merge']({},_0x20c716,_0x55102c[_0x006c('0x4d')]);var _0x2b3607={'where':_0x20c716[_0x006c('0x46')]};return db[_0x006c('0x4e')][_0x006c('0x2b')](_0x2b3607)[_0x006c('0x1d')](function(_0x457cbc){_0x1ce03d[_0x006c('0x2b')]=_0x457cbc;if(_0x55102c['query'][_0x006c('0x4f')]){_0x20c716[_0x006c('0x50')]=[{'all':!![]}];}return db[_0x006c('0x4e')]['findAll'](_0x20c716);})[_0x006c('0x1d')](function(_0x236771){_0x1ce03d['rows']=_0x236771;return _0x1ce03d;})[_0x006c('0x1d')](respondWithFilteredResult(_0x577413,_0x20c716))[_0x006c('0x27')](handleError(_0x577413,null));};exports[_0x006c('0x51')]=function(_0xa48484,_0x1c430b){var _0x2a4399={'raw':!![],'where':{'id':_0xa48484[_0x006c('0x52')]['id']}},_0x1378e4={};_0x1378e4[_0x006c('0x3f')]=_['keys'](db['Network'][_0x006c('0x53')]);_0x1378e4[_0x006c('0x3b')]=_[_0x006c('0x3c')](_0xa48484[_0x006c('0x3b')]);_0x1378e4[_0x006c('0x47')]=_[_0x006c('0x3d')](_0x1378e4[_0x006c('0x3f')],_0x1378e4[_0x006c('0x3b')]);_0x2a4399[_0x006c('0x3e')]=_['intersection'](_0x1378e4['model'],qs['fields'](_0xa48484[_0x006c('0x3b')][_0x006c('0x40')]));_0x2a4399[_0x006c('0x3e')]=_0x2a4399[_0x006c('0x3e')][_0x006c('0x41')]?_0x2a4399[_0x006c('0x3e')]:_0x1378e4[_0x006c('0x3f')];if(_0xa48484[_0x006c('0x3b')]['includeAll']){_0x2a4399[_0x006c('0x50')]=[{'all':!![]}];}_0x2a4399=_['merge']({},_0x2a4399,_0xa48484['options']);return db[_0x006c('0x4e')][_0x006c('0x54')](_0x2a4399)[_0x006c('0x1d')](handleEntityNotFound(_0x1c430b,null))['then'](respondWithResult(_0x1c430b,null))['catch'](handleError(_0x1c430b,null));};exports[_0x006c('0x55')]=function(_0x410471,_0x2a9d92,_0xd6adea){var _0x2ea1fa;return db['sequelize'][_0x006c('0x56')](function(_0x500450){return db['Network']['create'](_0x410471['body'],{'raw':!![]})[_0x006c('0x1d')](function(_0x1bf13f){_0x2ea1fa=_0x1bf13f;return db[_0x006c('0x4e')][_0x006c('0x57')]({'where':{'type':_0x410471[_0x006c('0x58')][_0x006c('0x4b')]},'raw':!![]});})[_0x006c('0x1d')](function(_0x5cb41b){if(_0x2ea1fa['type']['toUpperCase']()==_0x006c('0x59')){var _0x5c4d41=fs[_0x006c('0x5a')](path[_0x006c('0x5b')](config[_0x006c('0x5c')],_0x006c('0x5d')),_0x006c('0x5e'));var _0x5a3a36=ejs[_0x006c('0x5f')](_0x5c4d41,{'networks':_0x5cb41b||[]});fs[_0x006c('0x60')](_0x006c('0x61'),_0x5a3a36);return respondWithRpcPromise(_0x006c('0x62'),_0x006c('0x55'),{'module':'res_stun_monitor.so'});}else if(_0x2ea1fa[_0x006c('0x4b')][_0x006c('0x63')]()==_0x006c('0x64')){var _0x3f22c8=fs[_0x006c('0x5a')](path[_0x006c('0x5b')](config[_0x006c('0x5c')],_0x006c('0x65')),_0x006c('0x5e'));var _0x1990fa=ejs['render'](_0x3f22c8,{'networks':_0x5cb41b||[]});fs[_0x006c('0x60')]('/etc/asterisk/turn_xcally.conf',_0x1990fa);return respondWithRpcPromise(_0x006c('0x62'),_0x006c('0x55'),{'module':'res_stun_monitor.so'});}else{var _0x30cf5a=fs[_0x006c('0x5a')](path[_0x006c('0x5b')](config[_0x006c('0x5c')],_0x006c('0x66')),_0x006c('0x5e'));var _0x1c927e=ejs['render'](_0x30cf5a,{'networks':_0x5cb41b||[]});fs[_0x006c('0x60')](util[_0x006c('0x67')]('/etc/asterisk/sip_xcally_%s.conf',_0x410471[_0x006c('0x58')][_0x006c('0x4b')][_0x006c('0x68')]()),_0x1c927e);return respondWithRpcPromise('Reload',_0x006c('0x55'),{'module':'chan_sip.so'});}return null;})[_0x006c('0x1d')](function(){return _0x2ea1fa;});})[_0x006c('0x1d')](respondWithResult(_0x2a9d92,0xc9))[_0x006c('0x27')](handleError(_0x2a9d92,null));};exports[_0x006c('0x31')]=function(_0xe2c478,_0x41fba2,_0x4db626){var _0x2eca2a;return db[_0x006c('0x69')]['transaction'](function(_0xc6314){return db[_0x006c('0x4e')]['find']({'where':{'id':_0xe2c478[_0x006c('0x52')]['id']}})['then'](handleEntityNotFound(_0x41fba2,null))[_0x006c('0x1d')](saveUpdates(_0xe2c478[_0x006c('0x58')],null))['then'](function(_0x5d32e3){if(_0x5d32e3){_0x2eca2a=_0x5d32e3;return db['Network'][_0x006c('0x57')]({'where':{'type':_0x2eca2a[_0x006c('0x4b')]},'raw':!![]});}return null;})[_0x006c('0x1d')](function(_0x32420e){if(_0x2eca2a[_0x006c('0x4b')][_0x006c('0x63')]()==_0x006c('0x59')){var _0x267d2d=fs[_0x006c('0x5a')](path[_0x006c('0x5b')](config[_0x006c('0x5c')],_0x006c('0x5d')),_0x006c('0x5e'));var _0x5e4e56=ejs[_0x006c('0x5f')](_0x267d2d,{'networks':_0x32420e||[]});fs['writeFileSync'](_0x006c('0x61'),_0x5e4e56);return respondWithRpcPromise('Reload','update',{'module':_0x006c('0x6a')});}else if(_0x2eca2a['type'][_0x006c('0x63')]()==_0x006c('0x64')){var _0x45292e=fs[_0x006c('0x5a')](path[_0x006c('0x5b')](config['root'],'server/files/templates/turn_multiple.ejs'),_0x006c('0x5e'));var _0x378cf4=ejs[_0x006c('0x5f')](_0x45292e,{'networks':_0x32420e||[]});fs[_0x006c('0x60')](_0x006c('0x6b'),_0x378cf4);return respondWithRpcPromise('Reload',_0x006c('0x31'),{'module':'res_stun_monitor.so'});}else{var _0x47fb2f=fs[_0x006c('0x5a')](path[_0x006c('0x5b')](config[_0x006c('0x5c')],_0x006c('0x66')),_0x006c('0x5e'));var _0xc3d617=ejs[_0x006c('0x5f')](_0x47fb2f,{'networks':_0x32420e||[]});fs[_0x006c('0x60')](util[_0x006c('0x67')](_0x006c('0x6c'),_0xe2c478[_0x006c('0x58')][_0x006c('0x4b')][_0x006c('0x68')]()),_0xc3d617);return respondWithRpcPromise(_0x006c('0x62'),_0x006c('0x31'),{'module':_0x006c('0x6d')});}return null;})[_0x006c('0x1d')](function(_0x483f95){if(_0x483f95){return _0x2eca2a;}return null;});})[_0x006c('0x1d')](respondWithResult(_0x41fba2,null))[_0x006c('0x27')](handleError(_0x41fba2,null));};exports['destroy']=function(_0x452d27,_0x5e2bf3,_0x114815){var _0x54ec77;return db['Network'][_0x006c('0x54')]({'where':{'id':_0x452d27['params']['id']}})['then'](function(_0x2e5d36){_0x54ec77=_0x2e5d36;return _0x2e5d36;})[_0x006c('0x1d')](handleEntityNotFound(_0x5e2bf3,null))[_0x006c('0x1d')](removeEntity(_0x5e2bf3,null))[_0x006c('0x1d')](function(){if(_0x54ec77){return db[_0x006c('0x4e')][_0x006c('0x57')]({'where':{'type':_0x54ec77[_0x006c('0x4b')]},'raw':!![]});}})[_0x006c('0x1d')](function(_0x50afc0){if(_0x54ec77[_0x006c('0x4b')]['toUpperCase']()==_0x006c('0x59')){var _0x24cb4b=fs[_0x006c('0x5a')](path['join'](config[_0x006c('0x5c')],_0x006c('0x5d')),_0x006c('0x5e'));var _0x531288=ejs[_0x006c('0x5f')](_0x24cb4b,{'networks':_0x50afc0||[]});fs['writeFileSync'](_0x006c('0x61'),_0x531288);return respondWithRpcPromise(_0x006c('0x62'),_0x006c('0x32'),{'module':_0x006c('0x6a')});}else if(_0x54ec77['type'][_0x006c('0x63')]()==_0x006c('0x64')){var _0x68689e=fs['readFileSync'](path[_0x006c('0x5b')](config['root'],'server/files/templates/turn_multiple.ejs'),'utf8');var _0x2ef803=ejs[_0x006c('0x5f')](_0x68689e,{'networks':_0x50afc0||[]});fs[_0x006c('0x60')](_0x006c('0x6b'),_0x2ef803);return respondWithRpcPromise(_0x006c('0x62'),_0x006c('0x32'),{'module':_0x006c('0x6a')});}else{var _0x2b6c18=fs[_0x006c('0x5a')](path[_0x006c('0x5b')](config[_0x006c('0x5c')],_0x006c('0x66')),'utf8');var _0x4ec5fa=ejs[_0x006c('0x5f')](_0x2b6c18,{'networks':_0x50afc0||[]});fs['writeFileSync'](util[_0x006c('0x67')]('/etc/asterisk/sip_xcally_%s.conf',_0x452d27[_0x006c('0x58')]['type'][_0x006c('0x68')]()),_0x4ec5fa);return respondWithRpcPromise(_0x006c('0x62'),_0x006c('0x32'),{'module':'chan_sip.so'});}return null;})['catch'](handleError(_0x5e2bf3,null));};
\ No newline at end of file
diff --git a/server/api/network/network.model.js b/server/api/network/network.model.js
index 13b002b..fbf5ac7 100644
--- a/server/api/network/network.model.js
+++ b/server/api/network/network.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7a2c=['path','rimraf','../../config/environment','exports','network','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x15ce82,_0x582660){var _0x13baa2=function(_0x175ae5){while(--_0x175ae5){_0x15ce82['push'](_0x15ce82['shift']());}};_0x13baa2(++_0x582660);}(_0x7a2c,0x17b));var _0xc7a2=function(_0x447fd3,_0x23c6f3){_0x447fd3=_0x447fd3-0x0;var _0x523d5a=_0x7a2c[_0x447fd3];return _0x523d5a;};'use strict';var _=require(_0xc7a2('0x0'));var util=require('util');var logger=require(_0xc7a2('0x1'))(_0xc7a2('0x2'));var moment=require(_0xc7a2('0x3'));var BPromise=require(_0xc7a2('0x4'));var rp=require(_0xc7a2('0x5'));var fs=require('fs');var path=require(_0xc7a2('0x6'));var rimraf=require(_0xc7a2('0x7'));var config=require(_0xc7a2('0x8'));var attributes=require('./network.attributes');module[_0xc7a2('0x9')]=function(_0x1ddbae,_0x5f334e){return _0x1ddbae['define']('Network',attributes,{'tableName':_0xc7a2('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x6737=['../../config/environment','./network.attributes','util','../../config/logger','moment','bluebird','request-promise','path'];(function(_0x4c2391,_0x3b5e9a){var _0x8dd5f8=function(_0x2fd398){while(--_0x2fd398){_0x4c2391['push'](_0x4c2391['shift']());}};_0x8dd5f8(++_0x3b5e9a);}(_0x6737,0xe2));var _0x7673=function(_0x10cb66,_0x382106){_0x10cb66=_0x10cb66-0x0;var _0x918b4c=_0x6737[_0x10cb66];return _0x918b4c;};'use strict';var _=require('lodash');var util=require(_0x7673('0x0'));var logger=require(_0x7673('0x1'))('api');var moment=require(_0x7673('0x2'));var BPromise=require(_0x7673('0x3'));var rp=require(_0x7673('0x4'));var fs=require('fs');var path=require(_0x7673('0x5'));var rimraf=require('rimraf');var config=require(_0x7673('0x6'));var attributes=require(_0x7673('0x7'));module['exports']=function(_0x2f5edc,_0x15230f){return _0x2f5edc['define']('Network',attributes,{'tableName':'network','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/network/network.rpc.js b/server/api/network/network.rpc.js
index 9fa72f1..a71fdf5 100644
--- a/server/api/network/network.rpc.js
+++ b/server/api/network/network.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x8fc5=['then','info','Network,\x20%s,\x20%s','debug','Network,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','request'];(function(_0x4c4224,_0xbf6a24){var _0x2b7205=function(_0x5b1f7d){while(--_0x5b1f7d){_0x4c4224['push'](_0x4c4224['shift']());}};_0x2b7205(++_0xbf6a24);}(_0x8fc5,0x109));var _0x58fc=function(_0x9e002b,_0x1640ad){_0x9e002b=_0x9e002b-0x0;var _0x377d8b=_0x8fc5[_0x9e002b];return _0x377d8b;};'use strict';var _=require('lodash');var util=require(_0x58fc('0x0'));var moment=require(_0x58fc('0x1'));var BPromise=require(_0x58fc('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x58fc('0x3'));var db=require(_0x58fc('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x58fc('0x5'))(_0x58fc('0x6'));var config=require(_0x58fc('0x7'));var jayson=require(_0x58fc('0x8'));var client=jayson[_0x58fc('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x23f8d2,_0x1d2c6a,_0x4ea268){return new BPromise(function(_0xb8f039,_0x2797a2){return client[_0x58fc('0xa')](_0x23f8d2,_0x4ea268)[_0x58fc('0xb')](function(_0x5d8c53){logger[_0x58fc('0xc')](_0x58fc('0xd'),_0x1d2c6a,'request\x20sent');logger[_0x58fc('0xe')](_0x58fc('0xf'),_0x1d2c6a,_0x58fc('0x10'),JSON[_0x58fc('0x11')](_0x5d8c53));if(_0x5d8c53[_0x58fc('0x12')]){if(_0x5d8c53[_0x58fc('0x12')][_0x58fc('0x13')]===0x1f4){logger[_0x58fc('0x12')](_0x58fc('0xd'),_0x1d2c6a,_0x5d8c53[_0x58fc('0x12')][_0x58fc('0x14')]);return _0x2797a2(_0x5d8c53[_0x58fc('0x12')][_0x58fc('0x14')]);}logger[_0x58fc('0x12')]('Network,\x20%s,\x20%s',_0x1d2c6a,_0x5d8c53[_0x58fc('0x12')]['message']);return _0xb8f039(_0x5d8c53['error'][_0x58fc('0x14')]);}else{logger[_0x58fc('0xc')]('Network,\x20%s,\x20%s',_0x1d2c6a,_0x58fc('0x10'));_0xb8f039(_0x5d8c53[_0x58fc('0x15')]['message']);}})[_0x58fc('0x16')](function(_0x4882a1){logger[_0x58fc('0x12')](_0x58fc('0xd'),_0x1d2c6a,_0x4882a1);_0x2797a2(_0x4882a1);});});}
\ No newline at end of file
+var _0xfdcb=['http','request','info','Network,\x20%s,\x20%s','request\x20sent','debug','Network,\x20%s,\x20%s,\x20%s','error','code','message','util','moment','bluebird','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x1089a8,_0x3925c2){var _0x280a4e=function(_0x4446a6){while(--_0x4446a6){_0x1089a8['push'](_0x1089a8['shift']());}};_0x280a4e(++_0x3925c2);}(_0xfdcb,0x101));var _0xbfdc=function(_0x40be86,_0x68fe5d){_0x40be86=_0x40be86-0x0;var _0xda3c3b=_0xfdcb[_0x40be86];return _0xda3c3b;};'use strict';var _=require('lodash');var util=require(_0xbfdc('0x0'));var moment=require(_0xbfdc('0x1'));var BPromise=require(_0xbfdc('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbfdc('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xbfdc('0x4'))(_0xbfdc('0x5'));var config=require(_0xbfdc('0x6'));var jayson=require(_0xbfdc('0x7'));var client=jayson[_0xbfdc('0x8')][_0xbfdc('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3dec95,_0x58c576,_0x4d0acc){return new BPromise(function(_0x201731,_0x340018){return client[_0xbfdc('0xa')](_0x3dec95,_0x4d0acc)['then'](function(_0xc40554){logger[_0xbfdc('0xb')](_0xbfdc('0xc'),_0x58c576,_0xbfdc('0xd'));logger[_0xbfdc('0xe')](_0xbfdc('0xf'),_0x58c576,_0xbfdc('0xd'),JSON['stringify'](_0xc40554));if(_0xc40554[_0xbfdc('0x10')]){if(_0xc40554['error'][_0xbfdc('0x11')]===0x1f4){logger[_0xbfdc('0x10')](_0xbfdc('0xc'),_0x58c576,_0xc40554['error'][_0xbfdc('0x12')]);return _0x340018(_0xc40554[_0xbfdc('0x10')][_0xbfdc('0x12')]);}logger[_0xbfdc('0x10')]('Network,\x20%s,\x20%s',_0x58c576,_0xc40554['error'][_0xbfdc('0x12')]);return _0x201731(_0xc40554['error'][_0xbfdc('0x12')]);}else{logger[_0xbfdc('0xb')](_0xbfdc('0xc'),_0x58c576,_0xbfdc('0xd'));_0x201731(_0xc40554['result']['message']);}})['catch'](function(_0x368782){logger[_0xbfdc('0x10')]('Network,\x20%s,\x20%s',_0x58c576,_0x368782);_0x340018(_0x368782);});});}
\ No newline at end of file
diff --git a/server/api/notification/index.js b/server/api/notification/index.js
index 058cb51..a9957b8 100644
--- a/server/api/notification/index.js
+++ b/server/api/notification/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x28fe=['util','path','express','Router','../../components/auth/service','../../config/environment','./notification.controller','post','isAuthenticated','sendNotification','exports','multer'];(function(_0x1ac6a0,_0x5783e7){var _0x26de06=function(_0x4f3e6b){while(--_0x4f3e6b){_0x1ac6a0['push'](_0x1ac6a0['shift']());}};_0x26de06(++_0x5783e7);}(_0x28fe,0x8f));var _0xe28f=function(_0x2c7618,_0x26be9c){_0x2c7618=_0x2c7618-0x0;var _0x5ce3f0=_0x28fe[_0x2c7618];return _0x5ce3f0;};'use strict';var multer=require(_0xe28f('0x0'));var util=require(_0xe28f('0x1'));var path=require(_0xe28f('0x2'));var timeout=require('connect-timeout');var express=require(_0xe28f('0x3'));var router=express[_0xe28f('0x4')]();var auth=require(_0xe28f('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xe28f('0x6'));var controller=require(_0xe28f('0x7'));router[_0xe28f('0x8')]('/',auth[_0xe28f('0x9')](),controller[_0xe28f('0xa')]);module[_0xe28f('0xb')]=router;
\ No newline at end of file
+var _0x5992=['../../components/interaction/service','../../config/environment','./notification.controller','isAuthenticated','sendNotification','exports','multer','util','connect-timeout','express','Router','../../components/auth/service'];(function(_0x40415e,_0x5b8da2){var _0x30784f=function(_0x2d753f){while(--_0x2d753f){_0x40415e['push'](_0x40415e['shift']());}};_0x30784f(++_0x5b8da2);}(_0x5992,0x126));var _0x2599=function(_0x13b02f,_0x462a53){_0x13b02f=_0x13b02f-0x0;var _0x12e9a6=_0x5992[_0x13b02f];return _0x12e9a6;};'use strict';var multer=require(_0x2599('0x0'));var util=require(_0x2599('0x1'));var path=require('path');var timeout=require(_0x2599('0x2'));var express=require(_0x2599('0x3'));var router=express[_0x2599('0x4')]();var auth=require(_0x2599('0x5'));var interaction=require(_0x2599('0x6'));var config=require(_0x2599('0x7'));var controller=require(_0x2599('0x8'));router['post']('/',auth[_0x2599('0x9')](),controller[_0x2599('0xa')]);module[_0x2599('0xb')]=router;
\ No newline at end of file
diff --git a/server/api/notification/notification.attributes.js b/server/api/notification/notification.attributes.js
index 82c751b..a44f27d 100644
--- a/server/api/notification/notification.attributes.js
+++ b/server/api/notification/notification.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x4424=['TEXT','STRING','BOOLEAN','sequelize','exports'];(function(_0x27c9cc,_0x5424c7){var _0x38f1fc=function(_0xc2e743){while(--_0xc2e743){_0x27c9cc['push'](_0x27c9cc['shift']());}};_0x38f1fc(++_0x5424c7);}(_0x4424,0x80));var _0x4442=function(_0x300317,_0x4e7c52){_0x300317=_0x300317-0x0;var _0x466e7b=_0x4424[_0x300317];return _0x466e7b;};'use strict';var Sequelize=require(_0x4442('0x0'));module[_0x4442('0x1')]={'body':{'type':Sequelize[_0x4442('0x2')]},'senderName':{'type':Sequelize[_0x4442('0x3')]},'recipientsId':{'type':Sequelize['TEXT']},'recipientsDescription':{'type':Sequelize['STRING']},'beep':{'type':Sequelize[_0x4442('0x4')]}};
\ No newline at end of file
+var _0x2c9e=['sequelize','exports','TEXT','STRING'];(function(_0x576266,_0x4002b0){var _0x18234f=function(_0x4e9ad5){while(--_0x4e9ad5){_0x576266['push'](_0x576266['shift']());}};_0x18234f(++_0x4002b0);}(_0x2c9e,0xf0));var _0xe2c9=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x2c9e[_0x3bf83f];return _0x22c4a9;};'use strict';var Sequelize=require(_0xe2c9('0x0'));module[_0xe2c9('0x1')]={'body':{'type':Sequelize[_0xe2c9('0x2')]},'senderName':{'type':Sequelize['STRING']},'recipientsId':{'type':Sequelize[_0xe2c9('0x2')]},'recipientsDescription':{'type':Sequelize[_0xe2c9('0x3')]},'beep':{'type':Sequelize['BOOLEAN']}};
\ No newline at end of file
diff --git a/server/api/notification/notification.controller.js b/server/api/notification/notification.controller.js
index dc812bd..7674766 100644
--- a/server/api/notification/notification.controller.js
+++ b/server/api/notification/notification.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x3dea=['parse','Invalid\x20\x27recipients\x27\x20object','chatqueue','faxqueue','mailqueue','openchannelqueue','smsqueue','voicequeue','team','user','some','includes','toLowerCase','Invalid\x20model\x20in\x20\x27recipients\x27\x20object','senderName','fullname','recipientsDescription','isEmpty','beep','SenderId','recipientsId','sortBy','join','sequelize','transaction','Notification','create','forEach','recipient','emit','notification:send','catch','Template','html','Invalid\x20\x27TemplateId\x27\x20parameter','render','startCase','model','union','ids','queue','replace','Queue','all','flatten','map','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../mysqldb','redis','defaults','socket.io-emitter','./notification.socket','register','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','send','hasOwnProperty','text','TemplateId','Sequelize','ValidationError','Must\x20specify\x20at\x20least\x20one\x20argument\x20for\x20\x27text\x27\x20or\x20\x27TemplateId\x27','body','view','Missing\x20\x27view\x27\x20parameter','recipients'];(function(_0x597c29,_0x34c7d8){var _0x1cd80f=function(_0x35c92c){while(--_0x35c92c){_0x597c29['push'](_0x597c29['shift']());}};_0x1cd80f(++_0x34c7d8);}(_0x3dea,0x1d2));var _0xa3de=function(_0x22e031,_0x491dce){_0x22e031=_0x22e031-0x0;var _0x4b58db=_0x3dea[_0x22e031];return _0x4b58db;};'use strict';var pdf=require(_0xa3de('0x0'));var emlformat=require(_0xa3de('0x1'));var rimraf=require(_0xa3de('0x2'));var zipdir=require(_0xa3de('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0xa3de('0x4'));var moment=require(_0xa3de('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xa3de('0x6'));var util=require(_0xa3de('0x7'));var path=require(_0xa3de('0x8'));var sox=require(_0xa3de('0x9'));var csv=require(_0xa3de('0xa'));var ejs=require(_0xa3de('0xb'));var fs=require('fs');var _=require(_0xa3de('0xc'));var squel=require(_0xa3de('0xd'));var crypto=require(_0xa3de('0xe'));var jsforce=require(_0xa3de('0xf'));var deskjs=require(_0xa3de('0x10'));var toCsv=require(_0xa3de('0xa'));var querystring=require(_0xa3de('0x11'));var Papa=require(_0xa3de('0x12'));var Redis=require('ioredis');var authService=require(_0xa3de('0x13'));var qs=require(_0xa3de('0x14'));var as=require(_0xa3de('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xa3de('0x16'))(_0xa3de('0x17'));var utils=require(_0xa3de('0x18'));var config=require('../../config/environment');var db=require(_0xa3de('0x19'))['db'];config[_0xa3de('0x1a')]=_[_0xa3de('0x1b')](config[_0xa3de('0x1a')],{'host':'localhost','port':0x18eb});var socket=require(_0xa3de('0x1c'))(new Redis(config['redis']));require(_0xa3de('0x1d'))[_0xa3de('0x1e')](socket);function respondWithStatusCode(_0x3d9a94,_0x112041){_0x112041=_0x112041||0xcc;return function(_0x43f281){if(_0x43f281){return _0x3d9a94[_0xa3de('0x1f')](_0x112041);}return _0x3d9a94[_0xa3de('0x20')](_0x112041)[_0xa3de('0x21')]();};}function respondWithResult(_0x13f37f,_0x23dcf3){_0x23dcf3=_0x23dcf3||0xc8;return function(_0x42f6c4){if(_0x42f6c4){return _0x13f37f[_0xa3de('0x20')](_0x23dcf3)[_0xa3de('0x22')](_0x42f6c4);}};}function respondWithFilteredResult(_0x20e4f9,_0x3d5193){return function(_0x557558){if(_0x557558){var _0x1692bc=_0x557558[_0xa3de('0x23')],_0x4cfef3=_0x3d5193[_0xa3de('0x24')],_0x1aa077=_0x3d5193['offset']+_0x3d5193[_0xa3de('0x25')],_0x31c0c2;if(_0x1aa077>=_0x1692bc){_0x1aa077=_0x1692bc;_0x31c0c2=0xc8;}else{_0x31c0c2=0xce;}_0x20e4f9['status'](_0x31c0c2);return _0x20e4f9[_0xa3de('0x26')](_0xa3de('0x27'),_0x4cfef3+'-'+_0x1aa077+'/'+_0x1692bc)[_0xa3de('0x22')](_0x557558);}return null;};}function patchUpdates(_0x245afa){return function(_0x126ca3){try{jsonpatch[_0xa3de('0x28')](_0x126ca3,_0x245afa,!![]);}catch(_0x50013e){return BPromise[_0xa3de('0x29')](_0x50013e);}return _0x126ca3['save']();};}function saveUpdates(_0x729231,_0x3cdb6d){return function(_0x2fbb0f){if(_0x2fbb0f){return _0x2fbb0f[_0xa3de('0x2a')](_0x729231)[_0xa3de('0x2b')](function(_0x508fab){return _0x508fab;});}return null;};}function removeEntity(_0x3e07e0,_0x2bca2f){return function(_0x19efbc){if(_0x19efbc){return _0x19efbc[_0xa3de('0x2c')]()['then'](function(){_0x3e07e0[_0xa3de('0x20')](0xcc)['end']();});}};}function handleEntityNotFound(_0x123e85,_0x1efe8){return function(_0x2fb750){if(!_0x2fb750){_0x123e85['sendStatus'](0x194);}return _0x2fb750;};}function handleError(_0x838fe3,_0xfe6560){_0xfe6560=_0xfe6560||0x1f4;return function(_0x3d1ce9){logger[_0xa3de('0x2d')](_0x3d1ce9[_0xa3de('0x2e')]);if(_0x3d1ce9[_0xa3de('0x2f')]){delete _0x3d1ce9['name'];}_0x838fe3['status'](_0xfe6560)[_0xa3de('0x30')](_0x3d1ce9);};}exports['sendNotification']=function(_0x4dd0d4,_0x535234,_0x1d8746){if(!_0x4dd0d4['body'][_0xa3de('0x31')](_0xa3de('0x32'))&&!_0x4dd0d4['body'][_0xa3de('0x31')](_0xa3de('0x33'))){throw new db[(_0xa3de('0x34'))][(_0xa3de('0x35'))](_0xa3de('0x36'));}else{if(_0x4dd0d4[_0xa3de('0x37')][_0xa3de('0x31')](_0xa3de('0x33'))&&!_0x4dd0d4['body'][_0xa3de('0x31')](_0xa3de('0x38'))){throw new db[(_0xa3de('0x34'))][(_0xa3de('0x35'))](_0xa3de('0x39'));}if(!_0x4dd0d4['body']['hasOwnProperty'](_0xa3de('0x3a'))){throw new db['Sequelize'][(_0xa3de('0x35'))]('Missing\x20\x27recipients\x27\x20parameter');}else{try{var _0xaade59=JSON[_0xa3de('0x3b')](_0x4dd0d4[_0xa3de('0x37')][_0xa3de('0x3a')]);}catch(_0x1050f6){logger[_0xa3de('0x2d')](_0x1050f6);throw new db['Sequelize'][(_0xa3de('0x35'))](_0xa3de('0x3c'));}var _0x33d749=[_0xa3de('0x3d'),_0xa3de('0x3e'),_0xa3de('0x3f'),_0xa3de('0x40'),_0xa3de('0x41'),_0xa3de('0x42'),'whatsappqueue',_0xa3de('0x43'),_0xa3de('0x44')];if(_[_0xa3de('0x45')](_0xaade59,function(_0x4a15ba){return!_[_0xa3de('0x46')](_0x33d749,_0x4a15ba['model'][_0xa3de('0x47')]());})){throw new db[(_0xa3de('0x34'))][(_0xa3de('0x35'))](_0xa3de('0x48'));}}}var _0x40ccab={};_0x40ccab[_0xa3de('0x49')]=_0x4dd0d4[_0xa3de('0x37')][_0xa3de('0x31')](_0xa3de('0x49'))?_0x4dd0d4[_0xa3de('0x37')][_0xa3de('0x49')]:_0x4dd0d4[_0xa3de('0x44')][_0xa3de('0x4a')];_0x40ccab[_0xa3de('0x4b')]=_[_0xa3de('0x4c')](_0x4dd0d4[_0xa3de('0x37')][_0xa3de('0x4b')])?null:_0x4dd0d4['body'][_0xa3de('0x4b')];_0x40ccab[_0xa3de('0x4d')]=_0x4dd0d4[_0xa3de('0x37')][_0xa3de('0x4d')]||![];_0x40ccab[_0xa3de('0x4e')]=_0x4dd0d4[_0xa3de('0x44')]['id'];return getContent(_0x4dd0d4[_0xa3de('0x37')])[_0xa3de('0x2b')](function(_0x1d0f34){_0x40ccab[_0xa3de('0x37')]=_0x1d0f34;return getRecipients(_0xaade59);})[_0xa3de('0x2b')](function(_0xf5e20){_0x40ccab[_0xa3de('0x4f')]=_[_0xa3de('0x50')](_0xf5e20)[_0xa3de('0x51')](',');return db[_0xa3de('0x52')][_0xa3de('0x53')](function(_0xf2b36f){return db[_0xa3de('0x54')][_0xa3de('0x55')](_0x40ccab,{'raw':!![],'transaction':_0xf2b36f})[_0xa3de('0x2b')](function(_0x16926c){var _0x76ad5c={'sender':_0x40ccab[_0xa3de('0x49')],'description':_0x40ccab[_0xa3de('0x4b')],'content':_0x40ccab[_0xa3de('0x37')],'beep':_0x40ccab[_0xa3de('0x4d')]};_0xf5e20[_0xa3de('0x56')](function(_0x5f1b35){_0x76ad5c[_0xa3de('0x57')]=_0x5f1b35;socket[_0xa3de('0x58')](_0xa3de('0x59'),_0x76ad5c);});return _0x16926c;});});})[_0xa3de('0x2b')](respondWithResult(_0x535234,0xc9))[_0xa3de('0x5a')](handleError(_0x535234,null));};function getContent(_0x5adc42){return new BPromise(function(_0x3b4b8f,_0x29db58){if(_0x5adc42['text']){_0x3b4b8f(_0x5adc42[_0xa3de('0x32')]);return;}return db[_0xa3de('0x5b')]['findOne']({'attributes':[_0xa3de('0x5c')],'where':{'id':_0x5adc42[_0xa3de('0x33')]},'raw':!![]})[_0xa3de('0x2b')](function(_0x2533a2){if(!_0x2533a2)throw new db[(_0xa3de('0x34'))][(_0xa3de('0x35'))](_0xa3de('0x5d'));var _0x17f144=Mustache[_0xa3de('0x5e')](_0x2533a2[_0xa3de('0x5c')],_0x5adc42[_0xa3de('0x38')]);_0x3b4b8f(_0x17f144);})[_0xa3de('0x5a')](function(_0x3f75d5){_0x29db58(_0x3f75d5);});});}function getRecipients(_0x2d1dea){return new BPromise(function(_0x11796f,_0xce543e){var _0x160039=[];var _0x4d6186=[];_0x2d1dea[_0xa3de('0x56')](function(_0x21706c){var _0x33f2e8=_[_0xa3de('0x5f')](_0x21706c[_0xa3de('0x60')][_0xa3de('0x47')]());if(_0x33f2e8==='User'){_0x160039=_[_0xa3de('0x61')](_0x160039,_0x21706c[_0xa3de('0x62')]);}else{if(_[_0xa3de('0x46')](_0x33f2e8,_0xa3de('0x63')))_0x33f2e8=_0x33f2e8[_0xa3de('0x64')](_0xa3de('0x63'),_0xa3de('0x65'));_0x21706c[_0xa3de('0x62')][_0xa3de('0x56')](function(_0x470d21){_0x4d6186['push'](getAgents(_0x33f2e8,_0x470d21));});}});return BPromise[_0xa3de('0x66')](_0x4d6186)[_0xa3de('0x2b')](function(_0x3d4c0e){_0x160039=_[_0xa3de('0x61')](_0x160039,_[_0xa3de('0x67')](_0x3d4c0e));_0x11796f(_0x160039);})[_0xa3de('0x5a')](function(_0x4fc84c){_0xce543e(_0x4fc84c);});});}function getAgents(_0x3714ed,_0x3a76c8){return new BPromise(function(_0x4bda65,_0x47de7e){return db[_0x3714ed]['findOne']({'where':{'id':_0x3a76c8}})[_0xa3de('0x2b')](function(_0x572017){return _0x572017['getAgents']({'attributes':['id'],'raw':!![]})[_0xa3de('0x2b')](function(_0x511be8){var _0x12b6e4=_[_0xa3de('0x68')](_0x511be8,'id');_0x4bda65(_0x12b6e4);});})[_0xa3de('0x5a')](function(_0x294f5e){_0x47de7e(_0x294f5e);});});}
\ No newline at end of file
+var _0x263f=['whatsappqueue','team','some','model','toLowerCase','Invalid\x20model\x20in\x20\x27recipients\x27\x20object','senderName','user','fullname','recipientsDescription','isEmpty','beep','SenderId','recipientsId','sortBy','transaction','Notification','create','forEach','emit','findOne','html','Invalid\x20\x27TemplateId\x27\x20parameter','render','catch','startCase','ids','includes','queue','Queue','push','all','union','flatten','getAgents','map','html-pdf','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./notification.socket','register','sendStatus','status','json','offset','limit','set','then','destroy','end','name','send','sendNotification','body','hasOwnProperty','text','ValidationError','Must\x20specify\x20at\x20least\x20one\x20argument\x20for\x20\x27text\x27\x20or\x20\x27TemplateId\x27','TemplateId','view','Sequelize','Missing\x20\x27view\x27\x20parameter','recipients','parse','Invalid\x20\x27recipients\x27\x20object','chatqueue','faxqueue','openchannelqueue','smsqueue','voicequeue'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x263f,0x1a0));var _0xf263=function(_0x2d4e5d,_0x1e790c){_0x2d4e5d=_0x2d4e5d-0x0;var _0x4f5eec=_0x263f[_0x2d4e5d];return _0x4f5eec;};'use strict';var pdf=require(_0xf263('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xf263('0x1'));var zipdir=require(_0xf263('0x2'));var jsonpatch=require(_0xf263('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xf263('0x4'));var Mustache=require(_0xf263('0x5'));var util=require(_0xf263('0x6'));var path=require(_0xf263('0x7'));var sox=require(_0xf263('0x8'));var csv=require(_0xf263('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0xf263('0xa'));var crypto=require('crypto');var jsforce=require(_0xf263('0xb'));var deskjs=require(_0xf263('0xc'));var toCsv=require(_0xf263('0x9'));var querystring=require(_0xf263('0xd'));var Papa=require(_0xf263('0xe'));var Redis=require(_0xf263('0xf'));var authService=require(_0xf263('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xf263('0x11'));var hardwareService=require(_0xf263('0x12'));var logger=require(_0xf263('0x13'))(_0xf263('0x14'));var utils=require(_0xf263('0x15'));var config=require(_0xf263('0x16'));var db=require(_0xf263('0x17'))['db'];config['redis']=_[_0xf263('0x18')](config[_0xf263('0x19')],{'host':_0xf263('0x1a'),'port':0x18eb});var socket=require(_0xf263('0x1b'))(new Redis(config[_0xf263('0x19')]));require(_0xf263('0x1c'))[_0xf263('0x1d')](socket);function respondWithStatusCode(_0x50697c,_0x3a8ca5){_0x3a8ca5=_0x3a8ca5||0xcc;return function(_0x4f17ea){if(_0x4f17ea){return _0x50697c[_0xf263('0x1e')](_0x3a8ca5);}return _0x50697c[_0xf263('0x1f')](_0x3a8ca5)['end']();};}function respondWithResult(_0x3a6d64,_0x452040){_0x452040=_0x452040||0xc8;return function(_0x58586f){if(_0x58586f){return _0x3a6d64[_0xf263('0x1f')](_0x452040)[_0xf263('0x20')](_0x58586f);}};}function respondWithFilteredResult(_0x2d76f8,_0x39ec20){return function(_0x43896a){if(_0x43896a){var _0x23b313=_0x43896a['count'],_0x4e006b=_0x39ec20[_0xf263('0x21')],_0x241dca=_0x39ec20[_0xf263('0x21')]+_0x39ec20[_0xf263('0x22')],_0x3c3def;if(_0x241dca>=_0x23b313){_0x241dca=_0x23b313;_0x3c3def=0xc8;}else{_0x3c3def=0xce;}_0x2d76f8[_0xf263('0x1f')](_0x3c3def);return _0x2d76f8[_0xf263('0x23')]('Content-Range',_0x4e006b+'-'+_0x241dca+'/'+_0x23b313)[_0xf263('0x20')](_0x43896a);}return null;};}function patchUpdates(_0x11f1c){return function(_0x51a1ba){try{jsonpatch['apply'](_0x51a1ba,_0x11f1c,!![]);}catch(_0x16486e){return BPromise['reject'](_0x16486e);}return _0x51a1ba['save']();};}function saveUpdates(_0x4af574,_0x25efbc){return function(_0x55e3f8){if(_0x55e3f8){return _0x55e3f8['update'](_0x4af574)[_0xf263('0x24')](function(_0x4179aa){return _0x4179aa;});}return null;};}function removeEntity(_0x28d61c,_0x5cae2c){return function(_0x4f36ae){if(_0x4f36ae){return _0x4f36ae[_0xf263('0x25')]()[_0xf263('0x24')](function(){_0x28d61c[_0xf263('0x1f')](0xcc)[_0xf263('0x26')]();});}};}function handleEntityNotFound(_0x58e0ae,_0x40588f){return function(_0x1203f1){if(!_0x1203f1){_0x58e0ae[_0xf263('0x1e')](0x194);}return _0x1203f1;};}function handleError(_0x13cdc1,_0x3ceb31){_0x3ceb31=_0x3ceb31||0x1f4;return function(_0x3c880a){logger['error'](_0x3c880a['stack']);if(_0x3c880a[_0xf263('0x27')]){delete _0x3c880a[_0xf263('0x27')];}_0x13cdc1[_0xf263('0x1f')](_0x3ceb31)[_0xf263('0x28')](_0x3c880a);};}exports[_0xf263('0x29')]=function(_0x111238,_0x4738bd,_0x3f37d9){if(!_0x111238[_0xf263('0x2a')][_0xf263('0x2b')](_0xf263('0x2c'))&&!_0x111238['body']['hasOwnProperty']('TemplateId')){throw new db['Sequelize'][(_0xf263('0x2d'))](_0xf263('0x2e'));}else{if(_0x111238[_0xf263('0x2a')][_0xf263('0x2b')](_0xf263('0x2f'))&&!_0x111238['body']['hasOwnProperty'](_0xf263('0x30'))){throw new db[(_0xf263('0x31'))][(_0xf263('0x2d'))](_0xf263('0x32'));}if(!_0x111238[_0xf263('0x2a')][_0xf263('0x2b')](_0xf263('0x33'))){throw new db[(_0xf263('0x31'))]['ValidationError']('Missing\x20\x27recipients\x27\x20parameter');}else{try{var _0x51c5db=JSON[_0xf263('0x34')](_0x111238[_0xf263('0x2a')][_0xf263('0x33')]);}catch(_0x2724e3){logger['error'](_0x2724e3);throw new db[(_0xf263('0x31'))][(_0xf263('0x2d'))](_0xf263('0x35'));}var _0x133e6d=[_0xf263('0x36'),_0xf263('0x37'),'mailqueue',_0xf263('0x38'),_0xf263('0x39'),_0xf263('0x3a'),_0xf263('0x3b'),_0xf263('0x3c'),'user'];if(_[_0xf263('0x3d')](_0x51c5db,function(_0x1498e5){return!_['includes'](_0x133e6d,_0x1498e5[_0xf263('0x3e')][_0xf263('0x3f')]());})){throw new db[(_0xf263('0x31'))][(_0xf263('0x2d'))](_0xf263('0x40'));}}}var _0x3aa43e={};_0x3aa43e['senderName']=_0x111238[_0xf263('0x2a')]['hasOwnProperty'](_0xf263('0x41'))?_0x111238['body'][_0xf263('0x41')]:_0x111238[_0xf263('0x42')][_0xf263('0x43')];_0x3aa43e[_0xf263('0x44')]=_[_0xf263('0x45')](_0x111238[_0xf263('0x2a')][_0xf263('0x44')])?null:_0x111238['body']['recipientsDescription'];_0x3aa43e[_0xf263('0x46')]=_0x111238[_0xf263('0x2a')][_0xf263('0x46')]||![];_0x3aa43e[_0xf263('0x47')]=_0x111238[_0xf263('0x42')]['id'];return getContent(_0x111238['body'])['then'](function(_0x534a38){_0x3aa43e[_0xf263('0x2a')]=_0x534a38;return getRecipients(_0x51c5db);})[_0xf263('0x24')](function(_0x4394bc){_0x3aa43e[_0xf263('0x48')]=_[_0xf263('0x49')](_0x4394bc)['join'](',');return db['sequelize'][_0xf263('0x4a')](function(_0x3229c1){return db[_0xf263('0x4b')][_0xf263('0x4c')](_0x3aa43e,{'raw':!![],'transaction':_0x3229c1})[_0xf263('0x24')](function(_0x22857e){var _0x536e9e={'sender':_0x3aa43e[_0xf263('0x41')],'description':_0x3aa43e[_0xf263('0x44')],'content':_0x3aa43e['body'],'beep':_0x3aa43e[_0xf263('0x46')]};_0x4394bc[_0xf263('0x4d')](function(_0x1313d5){_0x536e9e['recipient']=_0x1313d5;socket[_0xf263('0x4e')]('notification:send',_0x536e9e);});return _0x22857e;});});})[_0xf263('0x24')](respondWithResult(_0x4738bd,0xc9))['catch'](handleError(_0x4738bd,null));};function getContent(_0x5bda31){return new BPromise(function(_0x51ff12,_0x533d1c){if(_0x5bda31[_0xf263('0x2c')]){_0x51ff12(_0x5bda31[_0xf263('0x2c')]);return;}return db['Template'][_0xf263('0x4f')]({'attributes':[_0xf263('0x50')],'where':{'id':_0x5bda31['TemplateId']},'raw':!![]})[_0xf263('0x24')](function(_0x228b0c){if(!_0x228b0c)throw new db[(_0xf263('0x31'))][(_0xf263('0x2d'))](_0xf263('0x51'));var _0x4eaf84=Mustache[_0xf263('0x52')](_0x228b0c[_0xf263('0x50')],_0x5bda31[_0xf263('0x30')]);_0x51ff12(_0x4eaf84);})[_0xf263('0x53')](function(_0x5b94d1){_0x533d1c(_0x5b94d1);});});}function getRecipients(_0xcdb5d){return new BPromise(function(_0x463ead,_0x172c17){var _0x2c78e8=[];var _0x55822d=[];_0xcdb5d[_0xf263('0x4d')](function(_0x1ab70c){var _0x53aab7=_[_0xf263('0x54')](_0x1ab70c[_0xf263('0x3e')][_0xf263('0x3f')]());if(_0x53aab7==='User'){_0x2c78e8=_['union'](_0x2c78e8,_0x1ab70c[_0xf263('0x55')]);}else{if(_[_0xf263('0x56')](_0x53aab7,_0xf263('0x57')))_0x53aab7=_0x53aab7['replace'](_0xf263('0x57'),_0xf263('0x58'));_0x1ab70c[_0xf263('0x55')][_0xf263('0x4d')](function(_0x56adbc){_0x55822d[_0xf263('0x59')](getAgents(_0x53aab7,_0x56adbc));});}});return BPromise[_0xf263('0x5a')](_0x55822d)['then'](function(_0x30c8d2){_0x2c78e8=_[_0xf263('0x5b')](_0x2c78e8,_[_0xf263('0x5c')](_0x30c8d2));_0x463ead(_0x2c78e8);})[_0xf263('0x53')](function(_0x2a5ab8){_0x172c17(_0x2a5ab8);});});}function getAgents(_0x5ae5d3,_0x1dd5b1){return new BPromise(function(_0x1c6433,_0xc75de8){return db[_0x5ae5d3]['findOne']({'where':{'id':_0x1dd5b1}})[_0xf263('0x24')](function(_0x532a74){return _0x532a74[_0xf263('0x5d')]({'attributes':['id'],'raw':!![]})[_0xf263('0x24')](function(_0x2e1087){var _0x2db73f=_[_0xf263('0x5e')](_0x2e1087,'id');_0x1c6433(_0x2db73f);});})[_0xf263('0x53')](function(_0xf445a3){_0xc75de8(_0xf445a3);});});}
\ No newline at end of file
diff --git a/server/api/notification/notification.events.js b/server/api/notification/notification.events.js
index a934dd8..136d84e 100644
--- a/server/api/notification/notification.events.js
+++ b/server/api/notification/notification.events.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x5f66=['remove','emit','exports','../../mysqldb','setMaxListeners','save','update'];(function(_0x3b85ca,_0x5063a0){var _0x1d623a=function(_0x24f39c){while(--_0x24f39c){_0x3b85ca['push'](_0x3b85ca['shift']());}};_0x1d623a(++_0x5063a0);}(_0x5f66,0x1a0));var _0x65f6=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0x5f66[_0x432682];return _0x463d05;};'use strict';var EventEmitter=require('events');var Notification=require(_0x65f6('0x0'))['db']['Notification'];var NotificationEvents=new EventEmitter();NotificationEvents[_0x65f6('0x1')](0x0);var events={'afterCreate':_0x65f6('0x2'),'afterUpdate':_0x65f6('0x3'),'afterDestroy':_0x65f6('0x4')};function emitEvent(_0x1a330c){return function(_0x5eb9ad,_0x3c5029,_0x5150c8){NotificationEvents[_0x65f6('0x5')](_0x1a330c+':'+_0x5eb9ad['id'],_0x5eb9ad);NotificationEvents[_0x65f6('0x5')](_0x1a330c,_0x5eb9ad);_0x5150c8(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Notification['hook'](e,emitEvent(event));}}module[_0x65f6('0x6')]=NotificationEvents;
\ No newline at end of file
+var _0x757a=['../../mysqldb','Notification','remove','emit','hasOwnProperty','hook'];(function(_0x20c0a7,_0x5162d8){var _0x12e762=function(_0x4e32c5){while(--_0x4e32c5){_0x20c0a7['push'](_0x20c0a7['shift']());}};_0x12e762(++_0x5162d8);}(_0x757a,0xde));var _0xa757=function(_0x425433,_0x19d24c){_0x425433=_0x425433-0x0;var _0x4c0980=_0x757a[_0x425433];return _0x4c0980;};'use strict';var EventEmitter=require('events');var Notification=require(_0xa757('0x0'))['db'][_0xa757('0x1')];var NotificationEvents=new EventEmitter();NotificationEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0xa757('0x2')};function emitEvent(_0x1721c6){return function(_0x1c2932,_0x453d07,_0x32630d){NotificationEvents[_0xa757('0x3')](_0x1721c6+':'+_0x1c2932['id'],_0x1c2932);NotificationEvents['emit'](_0x1721c6,_0x1c2932);_0x32630d(null);};}for(var e in events){if(events[_0xa757('0x4')](e)){var event=events[e];Notification[_0xa757('0x5')](e,emitEvent(event));}}module['exports']=NotificationEvents;
\ No newline at end of file
diff --git a/server/api/notification/notification.model.js b/server/api/notification/notification.model.js
index d4ba216..4fadb98 100644
--- a/server/api/notification/notification.model.js
+++ b/server/api/notification/notification.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x93e9=['request-promise','../../config/environment','./notification.attributes','exports','define','Notification','notifications','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x402731,_0x43c115){var _0x111736=function(_0x5a7044){while(--_0x5a7044){_0x402731['push'](_0x402731['shift']());}};_0x111736(++_0x43c115);}(_0x93e9,0xcc));var _0x993e=function(_0x32ca32,_0x238b2b){_0x32ca32=_0x32ca32-0x0;var _0x5438ff=_0x93e9[_0x32ca32];return _0x5438ff;};'use strict';var _=require(_0x993e('0x0'));var util=require(_0x993e('0x1'));var logger=require(_0x993e('0x2'))(_0x993e('0x3'));var moment=require(_0x993e('0x4'));var BPromise=require(_0x993e('0x5'));var rp=require(_0x993e('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x993e('0x7'));var attributes=require(_0x993e('0x8'));module[_0x993e('0x9')]=function(_0x45f52e,_0x1da414){return _0x45f52e[_0x993e('0xa')](_0x993e('0xb'),attributes,{'tableName':_0x993e('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x993e('0xd')});};
\ No newline at end of file
+var _0xf7b4=['lodash','api','moment','path','rimraf','../../config/environment','./notification.attributes','exports','define','Notification','notifications','utf8mb4','utf8mb4_unicode_ci'];(function(_0x5293a1,_0x351c64){var _0x5085aa=function(_0x3c3bd8){while(--_0x3c3bd8){_0x5293a1['push'](_0x5293a1['shift']());}};_0x5085aa(++_0x351c64);}(_0xf7b4,0x152));var _0x4f7b=function(_0x59ece4,_0xce6de0){_0x59ece4=_0x59ece4-0x0;var _0x56a0ba=_0xf7b4[_0x59ece4];return _0x56a0ba;};'use strict';var _=require(_0x4f7b('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x4f7b('0x1'));var moment=require(_0x4f7b('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x4f7b('0x3'));var rimraf=require(_0x4f7b('0x4'));var config=require(_0x4f7b('0x5'));var attributes=require(_0x4f7b('0x6'));module[_0x4f7b('0x7')]=function(_0x2637f0,_0x427f8b){return _0x2637f0[_0x4f7b('0x8')](_0x4f7b('0x9'),attributes,{'tableName':_0x4f7b('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x4f7b('0xb'),'collate':_0x4f7b('0xc')});};
\ No newline at end of file
diff --git a/server/api/notification/notification.rpc.js b/server/api/notification/notification.rpc.js
index 54f9436..67fbdbf 100644
--- a/server/api/notification/notification.rpc.js
+++ b/server/api/notification/notification.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x2964=['catch','util','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','register','request','then','info','request\x20sent','debug','error','code','Notification,\x20%s,\x20%s','message','result'];(function(_0x4b76ef,_0x292021){var _0xf79a60=function(_0x51e758){while(--_0x51e758){_0x4b76ef['push'](_0x4b76ef['shift']());}};_0xf79a60(++_0x292021);}(_0x2964,0x139));var _0x4296=function(_0x325e37,_0x54507d){_0x325e37=_0x325e37-0x0;var _0x25c034=_0x2964[_0x325e37];return _0x25c034;};'use strict';var _=require('lodash');var util=require(_0x4296('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x4296('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4296('0x2'))['db'];var utils=require(_0x4296('0x3'));var logger=require(_0x4296('0x4'))('rpc');var config=require(_0x4296('0x5'));var jayson=require(_0x4296('0x6'));var client=jayson['client'][_0x4296('0x7')]({'port':0x232a});config[_0x4296('0x8')]=_[_0x4296('0x9')](config[_0x4296('0x8')],{'host':_0x4296('0xa'),'port':0x18eb});var socket=require(_0x4296('0xb'))(new Redis(config[_0x4296('0x8')]));require('./notification.socket')[_0x4296('0xc')](socket);function respondWithRpcPromise(_0x4ac795,_0x36f5a4,_0x42a3ce){return new BPromise(function(_0x9b0b3b,_0x29a327){return client[_0x4296('0xd')](_0x4ac795,_0x42a3ce)[_0x4296('0xe')](function(_0x595d9a){logger[_0x4296('0xf')]('Notification,\x20%s,\x20%s',_0x36f5a4,_0x4296('0x10'));logger[_0x4296('0x11')]('Notification,\x20%s,\x20%s,\x20%s',_0x36f5a4,'request\x20sent',JSON['stringify'](_0x595d9a));if(_0x595d9a[_0x4296('0x12')]){if(_0x595d9a[_0x4296('0x12')][_0x4296('0x13')]===0x1f4){logger[_0x4296('0x12')](_0x4296('0x14'),_0x36f5a4,_0x595d9a[_0x4296('0x12')]['message']);return _0x29a327(_0x595d9a['error'][_0x4296('0x15')]);}logger[_0x4296('0x12')](_0x4296('0x14'),_0x36f5a4,_0x595d9a['error'][_0x4296('0x15')]);return _0x9b0b3b(_0x595d9a['error']['message']);}else{logger[_0x4296('0xf')](_0x4296('0x14'),_0x36f5a4,_0x4296('0x10'));_0x9b0b3b(_0x595d9a[_0x4296('0x16')]['message']);}})[_0x4296('0x17')](function(_0x4e296f){logger['error']('Notification,\x20%s,\x20%s',_0x36f5a4,_0x4e296f);_0x29a327(_0x4e296f);});});}
\ No newline at end of file
+var _0x8461=['stringify','error','code','Notification,\x20%s,\x20%s','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','localhost','socket.io-emitter','./notification.socket','then','info','request\x20sent','debug','Notification,\x20%s,\x20%s,\x20%s'];(function(_0x56f3a3,_0x18477f){var _0x3f9853=function(_0xabb4c3){while(--_0xabb4c3){_0x56f3a3['push'](_0x56f3a3['shift']());}};_0x3f9853(++_0x18477f);}(_0x8461,0x19c));var _0x1846=function(_0xa211d,_0x253018){_0xa211d=_0xa211d-0x0;var _0x441a84=_0x8461[_0xa211d];return _0x441a84;};'use strict';var _=require(_0x1846('0x0'));var util=require('util');var moment=require(_0x1846('0x1'));var BPromise=require(_0x1846('0x2'));var rs=require(_0x1846('0x3'));var fs=require('fs');var Redis=require(_0x1846('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x1846('0x5'));var logger=require(_0x1846('0x6'))(_0x1846('0x7'));var config=require(_0x1846('0x8'));var jayson=require(_0x1846('0x9'));var client=jayson[_0x1846('0xa')][_0x1846('0xb')]({'port':0x232a});config['redis']=_['defaults'](config['redis'],{'host':_0x1846('0xc'),'port':0x18eb});var socket=require(_0x1846('0xd'))(new Redis(config['redis']));require(_0x1846('0xe'))['register'](socket);function respondWithRpcPromise(_0x4fc80d,_0x5f4fa0,_0x1d1130){return new BPromise(function(_0x1ec00e,_0x4dc2c0){return client['request'](_0x4fc80d,_0x1d1130)[_0x1846('0xf')](function(_0xd9651){logger[_0x1846('0x10')]('Notification,\x20%s,\x20%s',_0x5f4fa0,_0x1846('0x11'));logger[_0x1846('0x12')](_0x1846('0x13'),_0x5f4fa0,_0x1846('0x11'),JSON[_0x1846('0x14')](_0xd9651));if(_0xd9651[_0x1846('0x15')]){if(_0xd9651['error'][_0x1846('0x16')]===0x1f4){logger[_0x1846('0x15')](_0x1846('0x17'),_0x5f4fa0,_0xd9651[_0x1846('0x15')][_0x1846('0x18')]);return _0x4dc2c0(_0xd9651[_0x1846('0x15')][_0x1846('0x18')]);}logger['error'](_0x1846('0x17'),_0x5f4fa0,_0xd9651[_0x1846('0x15')][_0x1846('0x18')]);return _0x1ec00e(_0xd9651[_0x1846('0x15')][_0x1846('0x18')]);}else{logger['info'](_0x1846('0x17'),_0x5f4fa0,_0x1846('0x11'));_0x1ec00e(_0xd9651[_0x1846('0x19')]['message']);}})[_0x1846('0x1a')](function(_0x1139cc){logger['error'](_0x1846('0x17'),_0x5f4fa0,_0x1139cc);_0x4dc2c0(_0x1139cc);});});}
\ No newline at end of file
diff --git a/server/api/notification/notification.socket.js b/server/api/notification/notification.socket.js
index 66aec7e..5ad3232 100644
--- a/server/api/notification/notification.socket.js
+++ b/server/api/notification/notification.socket.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x3474=['save','remove','update','register','length','notification:'];(function(_0x4250fe,_0x24633f){var _0x34f212=function(_0x3fcc60){while(--_0x3fcc60){_0x4250fe['push'](_0x4250fe['shift']());}};_0x34f212(++_0x24633f);}(_0x3474,0x1d4));var _0x4347=function(_0x18139a,_0x3348ac){_0x18139a=_0x18139a-0x0;var _0x5e3229=_0x3474[_0x18139a];return _0x5e3229;};'use strict';var NotificationEvents=require('./notification.events');var events=[_0x4347('0x0'),_0x4347('0x1'),_0x4347('0x2')];function createListener(_0x2aff12,_0x2f8bfe){return function(_0x22c35b){_0x2f8bfe['emit'](_0x2aff12,_0x22c35b);};}function removeListener(_0x38aab0,_0xa80f8c){return function(){NotificationEvents['removeListener'](_0x38aab0,_0xa80f8c);};}exports[_0x4347('0x3')]=function(_0x557f8e){for(var _0xd79d6f=0x0,_0x47b1f8=events[_0x4347('0x4')];_0xd79d6f<_0x47b1f8;_0xd79d6f++){var _0x1307cd=events[_0xd79d6f];var _0x55902d=createListener(_0x4347('0x5')+_0x1307cd,_0x557f8e);NotificationEvents['on'](_0x1307cd,_0x55902d);}};
\ No newline at end of file
+var _0x8065=['notification:','./notification.events','save','update','emit','length'];(function(_0x2e913b,_0x4b7071){var _0x173899=function(_0x2a7d22){while(--_0x2a7d22){_0x2e913b['push'](_0x2e913b['shift']());}};_0x173899(++_0x4b7071);}(_0x8065,0x163));var _0x5806=function(_0x1beaad,_0x483187){_0x1beaad=_0x1beaad-0x0;var _0x4e8398=_0x8065[_0x1beaad];return _0x4e8398;};'use strict';var NotificationEvents=require(_0x5806('0x0'));var events=[_0x5806('0x1'),'remove',_0x5806('0x2')];function createListener(_0xcd6026,_0x548910){return function(_0x4dd9f4){_0x548910[_0x5806('0x3')](_0xcd6026,_0x4dd9f4);};}function removeListener(_0x5d3732,_0x434b01){return function(){NotificationEvents['removeListener'](_0x5d3732,_0x434b01);};}exports['register']=function(_0x59bd6f){for(var _0x309f34=0x0,_0xc69e3c=events[_0x5806('0x4')];_0x309f34<_0xc69e3c;_0x309f34++){var _0x4ffdf2=events[_0x309f34];var _0x369f36=createListener(_0x5806('0x5')+_0x4ffdf2,_0x59bd6f);NotificationEvents['on'](_0x4ffdf2,_0x369f36);}};
\ No newline at end of file
diff --git a/server/api/openchannelAccount/index.js b/server/api/openchannelAccount/index.js
index 08a8e03..200c56c 100644
--- a/server/api/openchannelAccount/index.js
+++ b/server/api/openchannelAccount/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x05b8=['get','isAuthenticated','index','/describe','describe','/:id/dispositions','getDispositions','/:id/canned_answers','/:id/applications','getInteractions','/:id/users','getAgents','post','addDisposition','addAnswer','/:id/notify','addAgents','put','/:id','update','delete','removeDispositions','removeAnswers','removeAgents','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelAccount.controller'];(function(_0x2eec1f,_0x1b9987){var _0x543075=function(_0x5792d2){while(--_0x5792d2){_0x2eec1f['push'](_0x2eec1f['shift']());}};_0x543075(++_0x1b9987);}(_0x05b8,0x10e));var _0x805b=function(_0x42e318,_0x430cdc){_0x42e318=_0x42e318-0x0;var _0x24f18f=_0x05b8[_0x42e318];return _0x24f18f;};'use strict';var multer=require(_0x805b('0x0'));var util=require(_0x805b('0x1'));var path=require(_0x805b('0x2'));var timeout=require(_0x805b('0x3'));var express=require(_0x805b('0x4'));var router=express[_0x805b('0x5')]();var auth=require(_0x805b('0x6'));var interaction=require(_0x805b('0x7'));var config=require(_0x805b('0x8'));var controller=require(_0x805b('0x9'));router[_0x805b('0xa')]('/',auth[_0x805b('0xb')](),controller[_0x805b('0xc')]);router[_0x805b('0xa')](_0x805b('0xd'),auth[_0x805b('0xb')](),controller[_0x805b('0xe')]);router[_0x805b('0xa')]('/:id',auth[_0x805b('0xb')](),controller['show']);router[_0x805b('0xa')](_0x805b('0xf'),auth[_0x805b('0xb')](),controller[_0x805b('0x10')]);router[_0x805b('0xa')](_0x805b('0x11'),auth[_0x805b('0xb')](),controller['getAnswers']);router[_0x805b('0xa')](_0x805b('0x12'),auth[_0x805b('0xb')](),controller['getApplications']);router[_0x805b('0xa')]('/:id/interactions',auth[_0x805b('0xb')](),controller[_0x805b('0x13')]);router[_0x805b('0xa')](_0x805b('0x14'),auth['isAuthenticated'](),controller[_0x805b('0x15')]);router['post']('/',auth[_0x805b('0xb')](),controller['create']);router[_0x805b('0x16')]('/:id/dispositions',auth[_0x805b('0xb')](),controller[_0x805b('0x17')]);router[_0x805b('0x16')](_0x805b('0x11'),auth[_0x805b('0xb')](),controller[_0x805b('0x18')]);router[_0x805b('0x16')](_0x805b('0x19'),controller['notify']);router[_0x805b('0x16')](_0x805b('0x12'),auth[_0x805b('0xb')](),controller['addApplications']);router[_0x805b('0x16')](_0x805b('0x14'),auth[_0x805b('0xb')](),controller[_0x805b('0x1a')]);router[_0x805b('0x16')]('/:id/send',auth[_0x805b('0xb')](),controller['send']);router[_0x805b('0x1b')](_0x805b('0x1c'),auth[_0x805b('0xb')](),controller[_0x805b('0x1d')]);router[_0x805b('0x1e')](_0x805b('0x1c'),auth[_0x805b('0xb')](),controller['destroy']);router[_0x805b('0x1e')](_0x805b('0xf'),auth['isAuthenticated'](),controller[_0x805b('0x1f')]);router[_0x805b('0x1e')](_0x805b('0x11'),auth[_0x805b('0xb')](),controller[_0x805b('0x20')]);router[_0x805b('0x1e')](_0x805b('0x14'),auth['isAuthenticated'](),controller[_0x805b('0x21')]);module[_0x805b('0x22')]=router;
\ No newline at end of file
+var _0xef81=['post','addDisposition','/:id/canned_answers','addAnswer','/:id/notify','addApplications','addAgents','/:id/send','send','put','destroy','delete','removeDispositions','removeAnswers','removeAgents','exports','multer','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/dispositions','getDispositions','getAnswers','/:id/applications','/:id/interactions','getInteractions','/:id/users','getAgents'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xef81,0x10c));var _0x1ef8=function(_0x36acca,_0x2dbd0c){_0x36acca=_0x36acca-0x0;var _0x26d704=_0xef81[_0x36acca];return _0x26d704;};'use strict';var multer=require(_0x1ef8('0x0'));var util=require('util');var path=require(_0x1ef8('0x1'));var timeout=require(_0x1ef8('0x2'));var express=require(_0x1ef8('0x3'));var router=express[_0x1ef8('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x1ef8('0x5'));var config=require(_0x1ef8('0x6'));var controller=require('./openchannelAccount.controller');router[_0x1ef8('0x7')]('/',auth[_0x1ef8('0x8')](),controller[_0x1ef8('0x9')]);router[_0x1ef8('0x7')]('/describe',auth[_0x1ef8('0x8')](),controller['describe']);router[_0x1ef8('0x7')](_0x1ef8('0xa'),auth[_0x1ef8('0x8')](),controller[_0x1ef8('0xb')]);router[_0x1ef8('0x7')](_0x1ef8('0xc'),auth[_0x1ef8('0x8')](),controller[_0x1ef8('0xd')]);router[_0x1ef8('0x7')]('/:id/canned_answers',auth[_0x1ef8('0x8')](),controller[_0x1ef8('0xe')]);router[_0x1ef8('0x7')](_0x1ef8('0xf'),auth['isAuthenticated'](),controller['getApplications']);router[_0x1ef8('0x7')](_0x1ef8('0x10'),auth[_0x1ef8('0x8')](),controller[_0x1ef8('0x11')]);router['get'](_0x1ef8('0x12'),auth[_0x1ef8('0x8')](),controller[_0x1ef8('0x13')]);router[_0x1ef8('0x14')]('/',auth[_0x1ef8('0x8')](),controller['create']);router['post'](_0x1ef8('0xc'),auth[_0x1ef8('0x8')](),controller[_0x1ef8('0x15')]);router[_0x1ef8('0x14')](_0x1ef8('0x16'),auth[_0x1ef8('0x8')](),controller[_0x1ef8('0x17')]);router[_0x1ef8('0x14')](_0x1ef8('0x18'),controller['notify']);router['post'](_0x1ef8('0xf'),auth['isAuthenticated'](),controller[_0x1ef8('0x19')]);router['post'](_0x1ef8('0x12'),auth[_0x1ef8('0x8')](),controller[_0x1ef8('0x1a')]);router[_0x1ef8('0x14')](_0x1ef8('0x1b'),auth[_0x1ef8('0x8')](),controller[_0x1ef8('0x1c')]);router[_0x1ef8('0x1d')]('/:id',auth[_0x1ef8('0x8')](),controller['update']);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x1ef8('0x1e')]);router[_0x1ef8('0x1f')](_0x1ef8('0xc'),auth[_0x1ef8('0x8')](),controller[_0x1ef8('0x20')]);router[_0x1ef8('0x1f')](_0x1ef8('0x16'),auth[_0x1ef8('0x8')](),controller[_0x1ef8('0x21')]);router['delete'](_0x1ef8('0x12'),auth[_0x1ef8('0x8')](),controller[_0x1ef8('0x22')]);module[_0x1ef8('0x23')]=router;
\ No newline at end of file
diff --git a/server/api/openchannelAccount/openchannelAccount.attributes.js b/server/api/openchannelAccount/openchannelAccount.attributes.js
index 9fd6b0c..9f410d9 100644
--- a/server/api/openchannelAccount/openchannelAccount.attributes.js
+++ b/server/api/openchannelAccount/openchannelAccount.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xa835=['exports','name','STRING','TEXT','Account:\x20{{account.name}} {{#queue}}Queue:\x20{{queue.name}} {{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','setDataValue','mandatoryDisposition'];(function(_0x5ed304,_0x19f6d3){var _0xfe09fb=function(_0x187e02){while(--_0x187e02){_0x5ed304['push'](_0x5ed304['shift']());}};_0xfe09fb(++_0x19f6d3);}(_0xa835,0x13f));var _0x5a83=function(_0x42c0b5,_0x29ec6d){_0x42c0b5=_0x42c0b5-0x0;var _0x202f69=_0xa835[_0x42c0b5];return _0x202f69;};'use strict';var Sequelize=require('sequelize');var rs=require('randomstring');module[_0x5a83('0x0')]={'name':{'type':Sequelize['STRING'],'unique':_0x5a83('0x1'),'allowNull':![]},'description':{'type':Sequelize[_0x5a83('0x2')]},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs['generate']();}},'replyUri':{'type':Sequelize[_0x5a83('0x2')],'validate':{'isUrl':!![]}},'key':{'type':Sequelize[_0x5a83('0x2')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x5a83('0x3')],'defaultValue':function(){return _0x5a83('0x4');}},'notificationSound':{'type':Sequelize[_0x5a83('0x5')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x5a83('0x5')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize[_0x5a83('0x2')]},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x5a83('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x5a83('0x5')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x5a83('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'defaultValue':null,'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0x5a83('0x5')],'defaultValue':![],'comment':_0x5a83('0x7'),'set':function(_0x30a608){if(!_0x30a608)this['setDataValue'](_0x5a83('0x8'),null);this[_0x5a83('0x9')](_0x5a83('0xa'),_0x30a608);}}};
\ No newline at end of file
+var _0x46a9=['TEXT','Account:\x20{{account.name}} {{#queue}}Queue:\x20{{queue.name}} {{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','randomstring','STRING'];(function(_0x35e31e,_0x2a70a7){var _0x281b37=function(_0x194b8f){while(--_0x194b8f){_0x35e31e['push'](_0x35e31e['shift']());}};_0x281b37(++_0x2a70a7);}(_0x46a9,0x1e9));var _0x946a=function(_0xce923e,_0x4221f2){_0xce923e=_0xce923e-0x0;var _0x4d2d8a=_0x46a9[_0xce923e];return _0x4d2d8a;};'use strict';var Sequelize=require(_0x946a('0x0'));var rs=require(_0x946a('0x1'));module['exports']={'name':{'type':Sequelize[_0x946a('0x2')],'unique':'name','allowNull':![]},'description':{'type':Sequelize['STRING']},'token':{'type':Sequelize[_0x946a('0x2')],'defaultValue':function(){return rs['generate']();}},'replyUri':{'type':Sequelize['STRING'],'validate':{'isUrl':!![]}},'key':{'type':Sequelize[_0x946a('0x2')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x946a('0x3')],'defaultValue':function(){return _0x946a('0x4');}},'notificationSound':{'type':Sequelize[_0x946a('0x5')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x946a('0x5')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize[_0x946a('0x2')]},'queueTransfer':{'type':Sequelize[_0x946a('0x5')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x946a('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x946a('0x5')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x946a('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x946a('0x6')],'allowNull':!![],'defaultValue':null,'comment':_0x946a('0x7')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0x946a('0x8'),'set':function(_0xa4c70f){if(!_0xa4c70f)this[_0x946a('0x9')](_0x946a('0xa'),null);this[_0x946a('0x9')](_0x946a('0xb'),_0xa4c70f);}}};
\ No newline at end of file
diff --git a/server/api/openchannelAccount/openchannelAccount.controller.js b/server/api/openchannelAccount/openchannelAccount.controller.js
index 0d291c9..f5b0fb3 100644
--- a/server/api/openchannelAccount/openchannelAccount.controller.js
+++ b/server/api/openchannelAccount/openchannelAccount.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x0c2f=['sort','pick','filter','where','merge','VIRTUAL','options','OpenchannelAccount','count','includeAll','include','findAll','rows','show','params','rawAttributes','keys','fields','length','find','catch','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','OpenchannelAccounts','UserProfileSection','userProfileId','autoAssociation','body','addDisposition','OpnechannelAccountId','getDispositions','findOne','Disposition','hasOwnProperty','removeDispositions','addAnswer','OpenchannelAccountId','CannedAnswer','getAnswers','removeAnswers','notify','CmContact','describe','no\x20available\x20attributes','difference','createdAt','updatedAt','ListId','isNil','from','ValidationError','from\x20is\x20mandatory','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','CmList','Contacts','DESC','List','account','applications','priority','asc','Applications','defaults','contact','firstName','lastName','OpenchannelInteraction','threadId','spread','messageId','interaction','created','autoclose','close','unmanaged','*,*,*,*','AttachmentId','UserId','User','unshift','agent','waitForTheAssignedAgent','forcedOwnership','startRouting','Start','EventManager','addApplications','sequelize','transaction','OpenchannelApplication','bulkCreate','findAndCountAll','getApplications','Contact','Owner','fullname','internal','Tags','color','tag','addAgents','omit','ids','userOpenchannelAccount:save','removeAgents','isArray','emit','userOpenchannelAccount:remove','getAgents','send','out','OpenchannelMessage','Messages','dataValues','push','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','redis','localhost','socket.io-emitter','./openchannelAccount.socket','register','jayson/promise','client','http','test','Sequelize','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','then','info','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','sendStatus','status','end','json','offset','limit','set','Content-Range','apply','reject','save','update','destroy','get','UserProfileResource','stack','name','Pause','mandatoryDispositionPause','map','type','model','query','filters','intersection','attributes','nolimit','order'];(function(_0x470e3f,_0x3b513d){var _0x4fd22b=function(_0x35d0b2){while(--_0x35d0b2){_0x470e3f['push'](_0x470e3f['shift']());}};_0x4fd22b(++_0x3b513d);}(_0x0c2f,0x1f4));var _0xf0c2=function(_0x3c0b76,_0x170065){_0x3c0b76=_0x3c0b76-0x0;var _0x51906d=_0x0c2f[_0x3c0b76];return _0x51906d;};'use strict';var pdf=require(_0xf0c2('0x0'));var emlformat=require(_0xf0c2('0x1'));var rimraf=require(_0xf0c2('0x2'));var zipdir=require(_0xf0c2('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf0c2('0x4'));var moment=require(_0xf0c2('0x5'));var BPromise=require(_0xf0c2('0x6'));var Mustache=require(_0xf0c2('0x7'));var util=require(_0xf0c2('0x8'));var path=require(_0xf0c2('0x9'));var sox=require(_0xf0c2('0xa'));var csv=require(_0xf0c2('0xb'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0xf0c2('0xc'));var crypto=require(_0xf0c2('0xd'));var jsforce=require(_0xf0c2('0xe'));var deskjs=require(_0xf0c2('0xf'));var toCsv=require(_0xf0c2('0xb'));var querystring=require(_0xf0c2('0x10'));var Papa=require(_0xf0c2('0x11'));var Redis=require(_0xf0c2('0x12'));var authService=require(_0xf0c2('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf0c2('0x14'));var logger=require(_0xf0c2('0x15'))(_0xf0c2('0x16'));var utils=require(_0xf0c2('0x17'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config['redis']=_['defaults'](config[_0xf0c2('0x18')],{'host':_0xf0c2('0x19'),'port':0x18eb});var socket=require(_0xf0c2('0x1a'))(new Redis(config[_0xf0c2('0x18')]));require(_0xf0c2('0x1b'))[_0xf0c2('0x1c')](socket);var jayson=require(_0xf0c2('0x1d'));var client=jayson[_0xf0c2('0x1e')][_0xf0c2('0x1f')]({'port':0x232c});var client9002=jayson['client']['http']({'port':0x232a});function checkPasswordPattern(_0x40031f,_0x3cd8f6,_0x1959c0){if(_0x1959c0){var _0x574944=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x574944[_0xf0c2('0x20')](_0x3cd8f6)){return _0x40031f;}else{throw new db[(_0xf0c2('0x21'))]['ValidationError'](_0xf0c2('0x22'));}}else{return _0x40031f;}}function respondWithRpcPromise(_0x2f72b9,_0x5b588c,_0xe844a0,_0x21b7c5){return new BPromise(function(_0x516c45,_0x4a7991){var _0x26e82d=_0x21b7c5||client;return _0x26e82d['request'](_0x2f72b9,_0xe844a0)[_0xf0c2('0x23')](function(_0x17c292){logger[_0xf0c2('0x24')](_0xf0c2('0x25'),_0x5b588c,_0xf0c2('0x26'));logger[_0xf0c2('0x27')](_0xf0c2('0x28'),_0x5b588c,'request\x20sent',JSON[_0xf0c2('0x29')](_0x17c292));if(_0x17c292[_0xf0c2('0x2a')]){if(_0x17c292[_0xf0c2('0x2a')]['code']===0x1f4){logger[_0xf0c2('0x2a')]('OpenchannelAccount,\x20%s,\x20%s',_0x5b588c,_0x17c292[_0xf0c2('0x2a')]['message']);return _0x4a7991(_0x17c292['error']['message']);}logger[_0xf0c2('0x2a')](_0xf0c2('0x25'),_0x5b588c,_0x17c292['error'][_0xf0c2('0x2b')]);return _0x516c45(_0x17c292[_0xf0c2('0x2a')][_0xf0c2('0x2b')]);}else{logger[_0xf0c2('0x24')](_0xf0c2('0x25'),_0x5b588c,_0xf0c2('0x26'));_0x516c45(_0x17c292[_0xf0c2('0x2c')][_0xf0c2('0x2b')]);}})['catch'](function(_0x57509c){logger[_0xf0c2('0x2a')](_0xf0c2('0x25'),_0x5b588c,_0x57509c);_0x4a7991(_0x57509c);});});}function respondWithStatusCode(_0x479775,_0x4a746d){_0x4a746d=_0x4a746d||0xcc;return function(_0x1cb626){if(_0x1cb626){return _0x479775[_0xf0c2('0x2d')](_0x4a746d);}return _0x479775[_0xf0c2('0x2e')](_0x4a746d)[_0xf0c2('0x2f')]();};}function respondWithResult(_0x435a35,_0x13558e){_0x13558e=_0x13558e||0xc8;return function(_0x4a6714){if(_0x4a6714){return _0x435a35['status'](_0x13558e)[_0xf0c2('0x30')](_0x4a6714);}};}function respondWithFilteredResult(_0x232d1d,_0x4f6d58){return function(_0x31df2c){if(_0x31df2c){var _0x586777=_0x31df2c['count'],_0x805379=_0x4f6d58[_0xf0c2('0x31')],_0xee4c8f=_0x4f6d58[_0xf0c2('0x31')]+_0x4f6d58[_0xf0c2('0x32')],_0x1319f2;if(_0xee4c8f>=_0x586777){_0xee4c8f=_0x586777;_0x1319f2=0xc8;}else{_0x1319f2=0xce;}_0x232d1d[_0xf0c2('0x2e')](_0x1319f2);return _0x232d1d[_0xf0c2('0x33')](_0xf0c2('0x34'),_0x805379+'-'+_0xee4c8f+'/'+_0x586777)[_0xf0c2('0x30')](_0x31df2c);}return null;};}function patchUpdates(_0x4517dd){return function(_0x125be4){try{jsonpatch[_0xf0c2('0x35')](_0x125be4,_0x4517dd,!![]);}catch(_0x40d2e6){return BPromise[_0xf0c2('0x36')](_0x40d2e6);}return _0x125be4[_0xf0c2('0x37')]();};}function saveUpdates(_0x28bc6a,_0x248d40){return function(_0xbc4cc7){if(_0xbc4cc7){return _0xbc4cc7[_0xf0c2('0x38')](_0x28bc6a)['then'](function(_0x50a7e3){return _0x50a7e3;});}return null;};}function removeEntity(_0x42af11,_0x2f0e4e){return function(_0x52a348){if(_0x52a348){return _0x52a348[_0xf0c2('0x39')]()['then'](function(){var _0x2f11c6=_0x52a348[_0xf0c2('0x3a')]({'plain':!![]});var _0x4f5878='OpenchannelAccounts';return db[_0xf0c2('0x3b')][_0xf0c2('0x39')]({'where':{'type':_0x4f5878,'resourceId':_0x2f11c6['id']}})[_0xf0c2('0x23')](function(){return _0x52a348;});})['then'](function(){_0x42af11[_0xf0c2('0x2e')](0xcc)[_0xf0c2('0x2f')]();});}};}function handleEntityNotFound(_0x284c87,_0x3c63ee){return function(_0x53c2b4){if(!_0x53c2b4){_0x284c87[_0xf0c2('0x2d')](0x194);}return _0x53c2b4;};}function handleError(_0xc2445c,_0x1790bf){_0x1790bf=_0x1790bf||0x1f4;return function(_0x2b45bc){logger[_0xf0c2('0x2a')](_0x2b45bc[_0xf0c2('0x3c')]);if(_0x2b45bc[_0xf0c2('0x3d')]){delete _0x2b45bc['name'];}_0xc2445c[_0xf0c2('0x2e')](_0x1790bf)['send'](_0x2b45bc);};}exports['index']=function(_0x445a68,_0x1d3fb7){var _0x5e5cdf={'include':[{'model':db[_0xf0c2('0x3e')],'as':_0xf0c2('0x3f')}]},_0x294086={},_0x2133a7={'count':0x0,'rows':[]};var _0x3eea4e=_[_0xf0c2('0x40')](db['OpenchannelAccount']['rawAttributes'],function(_0x2ea169){return{'name':_0x2ea169['fieldName'],'type':_0x2ea169[_0xf0c2('0x41')]['key']};});_0x294086[_0xf0c2('0x42')]=_[_0xf0c2('0x40')](_0x3eea4e,'name');_0x294086[_0xf0c2('0x43')]=_['keys'](_0x445a68[_0xf0c2('0x43')]);_0x294086[_0xf0c2('0x44')]=_[_0xf0c2('0x45')](_0x294086['model'],_0x294086[_0xf0c2('0x43')]);_0x5e5cdf[_0xf0c2('0x46')]=_[_0xf0c2('0x45')](_0x294086['model'],qs['fields'](_0x445a68[_0xf0c2('0x43')]['fields']));_0x5e5cdf['attributes']=_0x5e5cdf['attributes']['length']?_0x5e5cdf['attributes']:_0x294086[_0xf0c2('0x42')];if(!_0x445a68[_0xf0c2('0x43')]['hasOwnProperty'](_0xf0c2('0x47'))){_0x5e5cdf[_0xf0c2('0x32')]=qs['limit'](_0x445a68[_0xf0c2('0x43')][_0xf0c2('0x32')]);_0x5e5cdf[_0xf0c2('0x31')]=qs[_0xf0c2('0x31')](_0x445a68[_0xf0c2('0x43')][_0xf0c2('0x31')]);}_0x5e5cdf[_0xf0c2('0x48')]=qs['sort'](_0x445a68['query'][_0xf0c2('0x49')]);_0x5e5cdf['where']=qs[_0xf0c2('0x44')](_[_0xf0c2('0x4a')](_0x445a68[_0xf0c2('0x43')],_0x294086['filters']),_0x3eea4e);if(_0x445a68[_0xf0c2('0x43')][_0xf0c2('0x4b')]){_0x5e5cdf[_0xf0c2('0x4c')]=_[_0xf0c2('0x4d')](_0x5e5cdf['where'],{'$or':_['map'](_0x3eea4e,function(_0x452b51){if(_0x452b51['type']!==_0xf0c2('0x4e')){var _0x4be077={};_0x4be077[_0x452b51[_0xf0c2('0x3d')]]={'$like':'%'+_0x445a68[_0xf0c2('0x43')][_0xf0c2('0x4b')]+'%'};return _0x4be077;}})});}_0x5e5cdf=_[_0xf0c2('0x4d')]({},_0x5e5cdf,_0x445a68[_0xf0c2('0x4f')]);var _0x10e0a0={'where':_0x5e5cdf[_0xf0c2('0x4c')]};return db[_0xf0c2('0x50')][_0xf0c2('0x51')](_0x10e0a0)['then'](function(_0x5777c6){_0x2133a7[_0xf0c2('0x51')]=_0x5777c6;if(_0x445a68['query'][_0xf0c2('0x52')]){_0x5e5cdf[_0xf0c2('0x53')]=[{'all':!![]}];}return db[_0xf0c2('0x50')][_0xf0c2('0x54')](_0x5e5cdf);})[_0xf0c2('0x23')](function(_0xe41651){_0x2133a7[_0xf0c2('0x55')]=_0xe41651;return _0x2133a7;})[_0xf0c2('0x23')](respondWithFilteredResult(_0x1d3fb7,_0x5e5cdf))['catch'](handleError(_0x1d3fb7,null));};exports[_0xf0c2('0x56')]=function(_0x28610a,_0x19c660){var _0x314a2d={'raw':![],'where':{'id':_0x28610a[_0xf0c2('0x57')]['id']},'include':[{'model':db[_0xf0c2('0x3e')],'as':'mandatoryDispositionPause'}]},_0x104d72={};_0x104d72[_0xf0c2('0x42')]=_['keys'](db['OpenchannelAccount'][_0xf0c2('0x58')]);_0x104d72[_0xf0c2('0x43')]=_[_0xf0c2('0x59')](_0x28610a[_0xf0c2('0x43')]);_0x104d72[_0xf0c2('0x44')]=_[_0xf0c2('0x45')](_0x104d72[_0xf0c2('0x42')],_0x104d72['query']);_0x314a2d[_0xf0c2('0x46')]=_[_0xf0c2('0x45')](_0x104d72[_0xf0c2('0x42')],qs[_0xf0c2('0x5a')](_0x28610a[_0xf0c2('0x43')][_0xf0c2('0x5a')]));_0x314a2d['attributes']=_0x314a2d['attributes'][_0xf0c2('0x5b')]?_0x314a2d['attributes']:_0x104d72[_0xf0c2('0x42')];if(_0x28610a[_0xf0c2('0x43')]['includeAll']){_0x314a2d[_0xf0c2('0x53')]=[{'all':!![]}];}_0x314a2d=_[_0xf0c2('0x4d')]({},_0x314a2d,_0x28610a[_0xf0c2('0x4f')]);return db[_0xf0c2('0x50')][_0xf0c2('0x5c')](_0x314a2d)[_0xf0c2('0x23')](handleEntityNotFound(_0x19c660,null))[_0xf0c2('0x23')](respondWithResult(_0x19c660,null))[_0xf0c2('0x5d')](handleError(_0x19c660,null));};exports['create']=function(_0x20b91e,_0x2cc527){return db['OpenchannelAccount'][_0xf0c2('0x5e')](_0x20b91e['body'],{})['then'](function(_0x4b13ec){var _0x81d4dd=_0x20b91e[_0xf0c2('0x5f')][_0xf0c2('0x3a')]({'plain':!![]});if(!_0x81d4dd)throw new Error(_0xf0c2('0x60'));if(_0x81d4dd['role']===_0xf0c2('0x5f')){var _0x476635=_0x4b13ec[_0xf0c2('0x3a')]({'plain':!![]});var _0x3f5131=_0xf0c2('0x61');return db[_0xf0c2('0x62')][_0xf0c2('0x5c')]({'where':{'name':_0x3f5131,'userProfileId':_0x81d4dd[_0xf0c2('0x63')]},'raw':!![]})[_0xf0c2('0x23')](function(_0x1b0ebe){if(_0x1b0ebe&&_0x1b0ebe[_0xf0c2('0x64')]===0x0){return db[_0xf0c2('0x3b')][_0xf0c2('0x5e')]({'name':_0x476635[_0xf0c2('0x3d')],'resourceId':_0x476635['id'],'type':_0x1b0ebe[_0xf0c2('0x3d')],'sectionId':_0x1b0ebe['id']},{})[_0xf0c2('0x23')](function(){return _0x4b13ec;});}else{return _0x4b13ec;}})[_0xf0c2('0x5d')](function(_0x2f3895){logger[_0xf0c2('0x2a')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2f3895);throw _0x2f3895;});}return _0x4b13ec;})[_0xf0c2('0x23')](respondWithResult(_0x2cc527,0xc9))[_0xf0c2('0x5d')](handleError(_0x2cc527,null));};exports[_0xf0c2('0x38')]=function(_0xd07c68,_0x223715){if(_0xd07c68[_0xf0c2('0x65')]['id']){delete _0xd07c68[_0xf0c2('0x65')]['id'];}return db['OpenchannelAccount'][_0xf0c2('0x5c')]({'where':{'id':_0xd07c68[_0xf0c2('0x57')]['id']},'include':[{'model':db[_0xf0c2('0x3e')],'as':_0xf0c2('0x3f')}]})['then'](handleEntityNotFound(_0x223715,null))['then'](saveUpdates(_0xd07c68[_0xf0c2('0x65')],null))[_0xf0c2('0x23')](respondWithResult(_0x223715,null))[_0xf0c2('0x5d')](handleError(_0x223715,null));};exports[_0xf0c2('0x39')]=function(_0x169eab,_0x55b273){return db[_0xf0c2('0x50')][_0xf0c2('0x5c')]({'where':{'id':_0x169eab[_0xf0c2('0x57')]['id']}})[_0xf0c2('0x23')](handleEntityNotFound(_0x55b273,null))[_0xf0c2('0x23')](removeEntity(_0x55b273,null))[_0xf0c2('0x5d')](handleError(_0x55b273,null));};exports['describe']=function(_0x3e6779,_0x4beeb0){return db[_0xf0c2('0x50')]['describe']()[_0xf0c2('0x23')](respondWithResult(_0x4beeb0,null))[_0xf0c2('0x5d')](handleError(_0x4beeb0,null));};exports[_0xf0c2('0x66')]=function(_0x131835,_0x325504,_0x4b7101){if(_0x131835[_0xf0c2('0x65')]['id']){delete _0x131835[_0xf0c2('0x65')]['id'];}return db[_0xf0c2('0x50')][_0xf0c2('0x5c')]({'where':{'id':_0x131835['params']['id']}})[_0xf0c2('0x23')](handleEntityNotFound(_0x325504,null))[_0xf0c2('0x23')](function(_0x640337){if(_0x640337){_0x131835[_0xf0c2('0x65')][_0xf0c2('0x67')]=_0x640337['id'];return db['Disposition'][_0xf0c2('0x5e')](_0x131835[_0xf0c2('0x65')]);}})['then'](respondWithResult(_0x325504,null))[_0xf0c2('0x5d')](handleError(_0x325504,null));};exports[_0xf0c2('0x68')]=function(_0x475107,_0x585c0c,_0xb9dc55){var _0x295194={'raw':![],'where':{}};var _0x4db42a={};var _0x50b2fa={'count':0x0,'rows':[]};return db[_0xf0c2('0x50')][_0xf0c2('0x69')]({'where':{'id':_0x475107['params']['id']}})[_0xf0c2('0x23')](handleEntityNotFound(_0x585c0c,null))[_0xf0c2('0x23')](function(_0x1055fd){if(_0x1055fd){_0x4db42a[_0xf0c2('0x42')]=_['keys'](db[_0xf0c2('0x6a')][_0xf0c2('0x58')]);_0x4db42a[_0xf0c2('0x43')]=_[_0xf0c2('0x59')](_0x475107[_0xf0c2('0x43')]);_0x4db42a[_0xf0c2('0x44')]=_[_0xf0c2('0x45')](_0x4db42a[_0xf0c2('0x42')],_0x4db42a['query']);_0x295194[_0xf0c2('0x46')]=_[_0xf0c2('0x45')](_0x4db42a[_0xf0c2('0x42')],qs[_0xf0c2('0x5a')](_0x475107['query'][_0xf0c2('0x5a')]));_0x295194[_0xf0c2('0x46')]=_0x295194['attributes'][_0xf0c2('0x5b')]?_0x295194[_0xf0c2('0x46')]:_0x4db42a[_0xf0c2('0x42')];if(!_0x475107[_0xf0c2('0x43')][_0xf0c2('0x6b')](_0xf0c2('0x47'))){_0x295194['limit']=qs[_0xf0c2('0x32')](_0x475107['query'][_0xf0c2('0x32')]);_0x295194['offset']=qs[_0xf0c2('0x31')](_0x475107[_0xf0c2('0x43')]['offset']);}_0x295194[_0xf0c2('0x48')]=qs['sort'](_0x475107[_0xf0c2('0x43')][_0xf0c2('0x49')]);_0x295194[_0xf0c2('0x4c')]=qs[_0xf0c2('0x44')](_['pick'](_0x475107['query'],_0x4db42a['filters']));_0x295194[_0xf0c2('0x4c')]['OpenchannelAccountId']=_0x1055fd['id'];if(_0x475107[_0xf0c2('0x43')][_0xf0c2('0x4b')]){_0x295194[_0xf0c2('0x4c')]=_[_0xf0c2('0x4d')](_0x295194[_0xf0c2('0x4c')],{'$or':_['map'](_0x295194['attributes'],function(_0x28386a){var _0x5eb198={};_0x5eb198[_0x28386a]={'$like':'%'+_0x475107[_0xf0c2('0x43')][_0xf0c2('0x4b')]+'%'};return _0x5eb198;})});}_0x295194=_[_0xf0c2('0x4d')]({},_0x295194,_0x475107[_0xf0c2('0x4f')]);return db[_0xf0c2('0x6a')][_0xf0c2('0x51')]({'where':_0x295194[_0xf0c2('0x4c')]})['then'](function(_0x41edbe){_0x50b2fa[_0xf0c2('0x51')]=_0x41edbe;if(_0x475107[_0xf0c2('0x43')][_0xf0c2('0x52')]){_0x295194['include']=[{'all':!![]}];}return db[_0xf0c2('0x6a')][_0xf0c2('0x54')](_0x295194);})['then'](function(_0x5997f7){_0x50b2fa['rows']=_0x5997f7;return _0x50b2fa;});}})[_0xf0c2('0x23')](respondWithFilteredResult(_0x585c0c,_0x295194))[_0xf0c2('0x5d')](handleError(_0x585c0c,null));};exports[_0xf0c2('0x6c')]=function(_0x4cc6db,_0x329080,_0x533c11){return db['OpenchannelAccount'][_0xf0c2('0x5c')]({'where':{'id':_0x4cc6db['params']['id']}})['then'](handleEntityNotFound(_0x329080,null))[_0xf0c2('0x23')](function(_0x5d0c1a){if(_0x5d0c1a){return _0x5d0c1a[_0xf0c2('0x6c')](_0x4cc6db[_0xf0c2('0x43')]['ids']);}})[_0xf0c2('0x23')](respondWithStatusCode(_0x329080,null))['catch'](handleError(_0x329080,null));};exports[_0xf0c2('0x6d')]=function(_0x1dcda1,_0x2c61a4,_0x352bd5){if(_0x1dcda1['body']['id']){delete _0x1dcda1[_0xf0c2('0x65')]['id'];}return db['OpenchannelAccount'][_0xf0c2('0x5c')]({'where':{'id':_0x1dcda1['params']['id']}})[_0xf0c2('0x23')](handleEntityNotFound(_0x2c61a4,null))[_0xf0c2('0x23')](function(_0x14c46a){if(_0x14c46a){_0x1dcda1['body'][_0xf0c2('0x6e')]=_0x14c46a['id'];return db[_0xf0c2('0x6f')][_0xf0c2('0x5e')](_0x1dcda1[_0xf0c2('0x65')]);}})[_0xf0c2('0x23')](respondWithResult(_0x2c61a4,null))['catch'](handleError(_0x2c61a4,null));};exports[_0xf0c2('0x70')]=function(_0x2c6628,_0xc24933,_0x5228ec){var _0x32738a={'raw':![],'where':{}};var _0x2488f0={};var _0x476a0b={'count':0x0,'rows':[]};return db['OpenchannelAccount'][_0xf0c2('0x69')]({'where':{'id':_0x2c6628['params']['id']}})['then'](handleEntityNotFound(_0xc24933,null))[_0xf0c2('0x23')](function(_0x1f3746){if(_0x1f3746){_0x2488f0[_0xf0c2('0x42')]=_[_0xf0c2('0x59')](db[_0xf0c2('0x6f')]['rawAttributes']);_0x2488f0['query']=_[_0xf0c2('0x59')](_0x2c6628['query']);_0x2488f0['filters']=_['intersection'](_0x2488f0[_0xf0c2('0x42')],_0x2488f0[_0xf0c2('0x43')]);_0x32738a[_0xf0c2('0x46')]=_[_0xf0c2('0x45')](_0x2488f0[_0xf0c2('0x42')],qs[_0xf0c2('0x5a')](_0x2c6628[_0xf0c2('0x43')][_0xf0c2('0x5a')]));_0x32738a[_0xf0c2('0x46')]=_0x32738a[_0xf0c2('0x46')]['length']?_0x32738a[_0xf0c2('0x46')]:_0x2488f0[_0xf0c2('0x42')];if(!_0x2c6628[_0xf0c2('0x43')]['hasOwnProperty'](_0xf0c2('0x47'))){_0x32738a[_0xf0c2('0x32')]=qs[_0xf0c2('0x32')](_0x2c6628[_0xf0c2('0x43')]['limit']);_0x32738a[_0xf0c2('0x31')]=qs[_0xf0c2('0x31')](_0x2c6628[_0xf0c2('0x43')]['offset']);}_0x32738a[_0xf0c2('0x48')]=qs['sort'](_0x2c6628[_0xf0c2('0x43')]['sort']);_0x32738a['where']=qs[_0xf0c2('0x44')](_[_0xf0c2('0x4a')](_0x2c6628[_0xf0c2('0x43')],_0x2488f0['filters']));_0x32738a[_0xf0c2('0x4c')][_0xf0c2('0x6e')]=_0x1f3746['id'];if(_0x2c6628[_0xf0c2('0x43')][_0xf0c2('0x4b')]){_0x32738a[_0xf0c2('0x4c')]=_['merge'](_0x32738a['where'],{'$or':_[_0xf0c2('0x40')](_0x32738a['attributes'],function(_0x49a8d7){var _0x1ff907={};_0x1ff907[_0x49a8d7]={'$like':'%'+_0x2c6628[_0xf0c2('0x43')][_0xf0c2('0x4b')]+'%'};return _0x1ff907;})});}_0x32738a=_[_0xf0c2('0x4d')]({},_0x32738a,_0x2c6628[_0xf0c2('0x4f')]);return db[_0xf0c2('0x6f')][_0xf0c2('0x51')]({'where':_0x32738a[_0xf0c2('0x4c')]})['then'](function(_0x53d01b){_0x476a0b[_0xf0c2('0x51')]=_0x53d01b;if(_0x2c6628['query'][_0xf0c2('0x52')]){_0x32738a[_0xf0c2('0x53')]=[{'all':!![]}];}return db[_0xf0c2('0x6f')][_0xf0c2('0x54')](_0x32738a);})[_0xf0c2('0x23')](function(_0x42d96a){_0x476a0b[_0xf0c2('0x55')]=_0x42d96a;return _0x476a0b;});}})[_0xf0c2('0x23')](respondWithFilteredResult(_0xc24933,_0x32738a))[_0xf0c2('0x5d')](handleError(_0xc24933,null));};exports[_0xf0c2('0x71')]=function(_0x3fa21f,_0xa6be90,_0x31590f){return db['OpenchannelAccount'][_0xf0c2('0x5c')]({'where':{'id':_0x3fa21f[_0xf0c2('0x57')]['id']}})['then'](handleEntityNotFound(_0xa6be90,null))[_0xf0c2('0x23')](function(_0x17ea4b){if(_0x17ea4b){return _0x17ea4b['removeAnswers'](_0x3fa21f[_0xf0c2('0x43')]['ids']);}})['then'](respondWithStatusCode(_0xa6be90,null))['catch'](handleError(_0xa6be90,null));};exports[_0xf0c2('0x72')]=function(_0x3cb24f,_0x1da90b,_0x3feb82){var _0x220937={'body':_0x3cb24f[_0xf0c2('0x65')],'channel':'openchannel'};var _0x42f347=[];var _0x585422=[];var _0x25550a={};var _0x29ea0c=![];return db[_0xf0c2('0x73')][_0xf0c2('0x74')]()[_0xf0c2('0x23')](function(_0x154417){if(!_0x154417){throw new db[(_0xf0c2('0x21'))]['ValidationError'](_0xf0c2('0x75'));}_0x42f347=_[_0xf0c2('0x76')](_[_0xf0c2('0x59')](_0x154417),[_0xf0c2('0x77'),_0xf0c2('0x78')]);_0x585422=_[_0xf0c2('0x76')](_[_0xf0c2('0x59')](_0x154417),[_0xf0c2('0x77'),_0xf0c2('0x78'),'CompanyId',_0xf0c2('0x79')]);if(_0x3cb24f['body']['id']){delete _0x3cb24f[_0xf0c2('0x65')]['id'];}if(_[_0xf0c2('0x7a')](_0x3cb24f['body'][_0xf0c2('0x7b')])){throw new db[(_0xf0c2('0x21'))][(_0xf0c2('0x7c'))](_0xf0c2('0x7d'));}if(_[_0xf0c2('0x7a')](_0x3cb24f['body']['body'])||_0x3cb24f[_0xf0c2('0x65')][_0xf0c2('0x65')]===''){throw new db[(_0xf0c2('0x21'))][(_0xf0c2('0x7c'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0xf0c2('0x7a')](_0x3cb24f['body'][_0xf0c2('0x7e')])){throw new db[(_0xf0c2('0x21'))][(_0xf0c2('0x7c'))](_0xf0c2('0x7f')+_0x585422);}if(!_[_0xf0c2('0x80')](_0x585422,_0x3cb24f[_0xf0c2('0x65')]['mapKey'])){throw new db['Sequelize']['ValidationError']('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x585422);}_0x25550a[_0x3cb24f[_0xf0c2('0x65')][_0xf0c2('0x7e')]]=_0x3cb24f[_0xf0c2('0x65')][_0xf0c2('0x7b')];})[_0xf0c2('0x23')](function(){return db[_0xf0c2('0x50')][_0xf0c2('0x5c')]({'where':{'id':_0x3cb24f['params']['id']},'include':[{'model':db[_0xf0c2('0x81')],'as':'List','include':[{'model':db[_0xf0c2('0x73')],'as':_0xf0c2('0x82'),'where':_0x25550a,'limit':0x1,'order':[['updatedAt',_0xf0c2('0x83')]]}]},{'model':db['OpenchannelApplication'],'as':'Applications'}]});})[_0xf0c2('0x23')](handleEntityNotFound(_0x1da90b,null))[_0xf0c2('0x23')](function(_0x4a2d07){if(_0x4a2d07&&_0x4a2d07[_0xf0c2('0x84')]){_0x220937[_0xf0c2('0x85')]=_0x4a2d07;_0x220937[_0xf0c2('0x86')]=_0x4a2d07['Applications'];_0x220937['list']=_0x4a2d07['List'];_0x220937[_0xf0c2('0x86')]=_['orderBy'](_0x220937[_0xf0c2('0x86')],[_0xf0c2('0x87')],[_0xf0c2('0x88')]);if(_0x220937[_0xf0c2('0x85')]['Applications']){delete _0x220937[_0xf0c2('0x85')][_0xf0c2('0x89')];}if(_0x220937[_0xf0c2('0x85')][_0xf0c2('0x84')]&&_0x220937[_0xf0c2('0x85')][_0xf0c2('0x84')][_0xf0c2('0x82')][_0xf0c2('0x5b')]){return _0x220937[_0xf0c2('0x85')][_0xf0c2('0x84')]['Contacts'][0x0];}var _0x1ab8ee=_[_0xf0c2('0x8a')](_0x3cb24f[_0xf0c2('0x65')],{'firstName':_0x3cb24f[_0xf0c2('0x65')][_0xf0c2('0x7b')],'ListId':_0x4a2d07[_0xf0c2('0x79')]});_0x1ab8ee[_0x3cb24f[_0xf0c2('0x65')][_0xf0c2('0x7e')]]=_0x3cb24f[_0xf0c2('0x65')]['from'];return db[_0xf0c2('0x73')][_0xf0c2('0x5e')](_0x1ab8ee,{'fields':_0x42f347,'raw':!![]});}})[_0xf0c2('0x23')](handleEntityNotFound(_0x1da90b,null))[_0xf0c2('0x23')](function(_0x532c2e){_0x220937[_0xf0c2('0x8b')]=_0x532c2e;if(_0x532c2e){var _0x28e4f7={'ContactId':_0x532c2e['id'],'OpenchannelAccountId':_0x3cb24f[_0xf0c2('0x57')]['id'],'from':(_0x532c2e[_0xf0c2('0x8c')]||'')+'\x20'+(_0x532c2e[_0xf0c2('0x8d')]||'')};var _0x588fc6={'OpenchannelAccountId':_0x3cb24f[_0xf0c2('0x57')]['id'],'closed':![]};if(_0x3cb24f['body']['threadId']){_0x588fc6['threadId']=_0x3cb24f[_0xf0c2('0x65')]['threadId'];return db[_0xf0c2('0x8e')][_0xf0c2('0x5c')]({'where':_0x588fc6})[_0xf0c2('0x23')](function(_0x542c4d){if(_0x542c4d){return[_0x542c4d,![]];}_0x28e4f7[_0xf0c2('0x8f')]=_0x3cb24f[_0xf0c2('0x65')]['threadId'];_0x28e4f7['externalUrl']=_0x3cb24f[_0xf0c2('0x65')]['externalUrl'];return db[_0xf0c2('0x8e')][_0xf0c2('0x5e')](_0x28e4f7)[_0xf0c2('0x23')](function(_0xd7c132){return[_0xd7c132,!![]];});});}else{_0x588fc6[_0xf0c2('0x8f')]=null;}_0x588fc6['ContactId']=_0x532c2e['id'];return db[_0xf0c2('0x8e')][_0xf0c2('0x5c')]({'where':_0x588fc6})['then'](function(_0x1f1d18){if(_0x1f1d18){return[_0x1f1d18,![]];}return db[_0xf0c2('0x8e')]['create'](_0x28e4f7)[_0xf0c2('0x23')](function(_0x44923e){return[_0x44923e,!![]];});});}})[_0xf0c2('0x90')](function(_0x733b72,_0x5656b2){if(_0x733b72){_0x29ea0c=_0x5656b2;if(!_0x5656b2){var _0x53ec2c={'from':(_0x220937[_0xf0c2('0x8b')][_0xf0c2('0x8c')]||'')+'\x20'+(_0x220937[_0xf0c2('0x8b')][_0xf0c2('0x8d')]||'')};if(_0x3cb24f[_0xf0c2('0x65')][_0xf0c2('0x8f')]&&_0x3cb24f['body'][_0xf0c2('0x91')]&&_0x3cb24f[_0xf0c2('0x65')]['threadId']!=_0x3cb24f[_0xf0c2('0x65')][_0xf0c2('0x91')]){_0x53ec2c[_0xf0c2('0x8f')]=_0x3cb24f[_0xf0c2('0x65')]['messageId'];}return _0x733b72[_0xf0c2('0x38')](_0x53ec2c);}else{return _0x733b72;}}})[_0xf0c2('0x23')](function(_0x311dc8){_0x220937[_0xf0c2('0x92')]=_0x311dc8[_0xf0c2('0x3a')]({'plain':!![]});_0x220937[_0xf0c2('0x92')][_0xf0c2('0x93')]=_0x29ea0c;if(_0x220937[_0xf0c2('0x92')][_0xf0c2('0x93')]){if(_0x220937[_0xf0c2('0x85')][_0xf0c2('0x94')]){_0x220937[_0xf0c2('0x86')]['push']({'id':0x0,'priority':_0x220937['applications'][_0xf0c2('0x5b')]+0x1,'app':_0xf0c2('0x95'),'appdata':_0xf0c2('0x96'),'interval':_0xf0c2('0x97')});}}return db['OpenchannelMessage'][_0xf0c2('0x5e')]({'body':_0x3cb24f[_0xf0c2('0x65')][_0xf0c2('0x65')],'OpenchannelAccountId':_0x3cb24f['params']['id'],'OpenchannelInteractionId':_0x311dc8['id'],'direction':'in','ContactId':_0x220937['contact']['id'],'AttachmentId':_0x3cb24f['body'][_0xf0c2('0x98')]});})[_0xf0c2('0x23')](function(_0x40f6cd){_0x220937['message']=_0x40f6cd;if(_0x220937[_0xf0c2('0x92')][_0xf0c2('0x99')]){return db[_0xf0c2('0x9a')][_0xf0c2('0x5c')]({'attributes':['id',_0xf0c2('0x3d')],'where':{'id':_0x220937['interaction'][_0xf0c2('0x99')]}})[_0xf0c2('0x23')](function(_0xf469d2){if(_0xf469d2){_0x220937[_0xf0c2('0x86')][_0xf0c2('0x9b')]({'id':0x0,'priority':0x0,'app':_0xf0c2('0x9c'),'appdata':_0xf469d2[_0xf0c2('0x3d')]+','+(_0x220937[_0xf0c2('0x85')][_0xf0c2('0x9d')]||0xa),'interval':'*,*,*,*'});_0x220937[_0xf0c2('0x9e')]=![];}return respondWithRpcPromise('Start',_0xf0c2('0x9f'),_0x220937);});}return respondWithRpcPromise(_0xf0c2('0xa0'),_0xf0c2('0x9f'),_0x220937);})[_0xf0c2('0x23')](function(_0x358b0e){respondWithRpcPromise(_0xf0c2('0xa1'),_0xf0c2('0xa1'),{'event':_0xf0c2('0x72'),'message':_0x358b0e},client9002);return _0x358b0e;})[_0xf0c2('0x23')](respondWithResult(_0x1da90b,null))[_0xf0c2('0x5d')](handleError(_0x1da90b,null));};exports[_0xf0c2('0xa2')]=function(_0x1c1ae5,_0x2a9a95,_0xd1acc6){return db[_0xf0c2('0x50')][_0xf0c2('0x69')]({'where':{'id':_0x1c1ae5[_0xf0c2('0x57')]['id']}})[_0xf0c2('0x23')](handleEntityNotFound(_0x2a9a95,null))['then'](function(_0x144328){if(_0x144328){return db[_0xf0c2('0xa3')][_0xf0c2('0xa4')](function(_0x128d07){return db[_0xf0c2('0xa5')][_0xf0c2('0x39')]({'where':{'OpenchannelAccountId':_0x1c1ae5[_0xf0c2('0x57')]['id']},'transaction':_0x128d07})['then'](function(_0x8d6a50){var _0x1c746e=_['map'](_0x1c1ae5[_0xf0c2('0x65')],function(_0x15ab5e){_0x15ab5e['OpenchannelAccountId']=_0x1c1ae5[_0xf0c2('0x57')]['id'];return _0x15ab5e;});return db[_0xf0c2('0xa5')][_0xf0c2('0xa6')](_0x1c746e,{'transaction':_0x128d07});});})[_0xf0c2('0x23')](function(){return db[_0xf0c2('0xa5')][_0xf0c2('0xa7')]({'where':{'OpenchannelAccountId':_0x1c1ae5[_0xf0c2('0x57')]['id']},'order':_0xf0c2('0x87')});});}})[_0xf0c2('0x23')](respondWithResult(_0x2a9a95,null))['catch'](handleError(_0x2a9a95,null));};exports[_0xf0c2('0xa8')]=function(_0xa9ba70,_0x2e5c58,_0x4effce){var _0x58ad30={};var _0x2e52e5={};var _0x5a942c;var _0x18d72b;return db['OpenchannelAccount'][_0xf0c2('0x69')]({'where':{'id':_0xa9ba70[_0xf0c2('0x57')]['id']}})[_0xf0c2('0x23')](handleEntityNotFound(_0x2e5c58,null))[_0xf0c2('0x23')](function(_0x5f2c10){if(_0x5f2c10){_0x5a942c=_0x5f2c10;_0x2e52e5[_0xf0c2('0x42')]=_[_0xf0c2('0x59')](db[_0xf0c2('0xa5')][_0xf0c2('0x58')]);_0x2e52e5[_0xf0c2('0x43')]=_['keys'](_0xa9ba70['query']);_0x2e52e5[_0xf0c2('0x44')]=_[_0xf0c2('0x45')](_0x2e52e5['model'],_0x2e52e5['query']);_0x58ad30[_0xf0c2('0x46')]=_[_0xf0c2('0x45')](_0x2e52e5[_0xf0c2('0x42')],qs[_0xf0c2('0x5a')](_0xa9ba70[_0xf0c2('0x43')][_0xf0c2('0x5a')]));_0x58ad30[_0xf0c2('0x46')]=_0x58ad30[_0xf0c2('0x46')][_0xf0c2('0x5b')]?_0x58ad30[_0xf0c2('0x46')]:_0x2e52e5[_0xf0c2('0x42')];_0x58ad30['order']=qs[_0xf0c2('0x49')](_0xa9ba70[_0xf0c2('0x43')][_0xf0c2('0x49')]);_0x58ad30['where']=qs[_0xf0c2('0x44')](_['pick'](_0xa9ba70[_0xf0c2('0x43')],_0x2e52e5['filters']));if(_0xa9ba70[_0xf0c2('0x43')][_0xf0c2('0x4b')]){_0x58ad30[_0xf0c2('0x4c')]=_['merge'](_0x58ad30[_0xf0c2('0x4c')],{'$or':_[_0xf0c2('0x40')](_0x58ad30[_0xf0c2('0x46')],function(_0xcef377){var _0x3e602d={};_0x3e602d[_0xcef377]={'$like':'%'+_0xa9ba70['query']['filter']+'%'};return _0x3e602d;})});}_0x58ad30=_[_0xf0c2('0x4d')]({},_0x58ad30,_0xa9ba70[_0xf0c2('0x4f')]);return _0x5a942c['getApplications'](_0x58ad30);}})['then'](function(_0x2fc6ab){if(_0x2fc6ab){_0x18d72b=_0x2fc6ab['length'];if(!_0xa9ba70[_0xf0c2('0x43')]['hasOwnProperty'](_0xf0c2('0x47'))){_0x58ad30['limit']=qs['limit'](_0xa9ba70[_0xf0c2('0x43')][_0xf0c2('0x32')]);_0x58ad30['offset']=qs[_0xf0c2('0x31')](_0xa9ba70[_0xf0c2('0x43')][_0xf0c2('0x31')]);}return _0x5a942c[_0xf0c2('0xa8')](_0x58ad30);}})['then'](function(_0x9abdef){if(_0x9abdef){return _0x9abdef?{'count':_0x18d72b,'rows':_0x9abdef}:null;}})['then'](respondWithResult(_0x2e5c58,null))[_0xf0c2('0x5d')](handleError(_0x2e5c58,null));};exports['getInteractions']=function(_0x12f654,_0x143222,_0x489661){var _0x5e32d1={'raw':![],'where':{}};var _0x17b948={};var _0x4b6a7b={'count':0x0,'rows':[]};return db[_0xf0c2('0x50')][_0xf0c2('0x69')]({'where':{'id':_0x12f654[_0xf0c2('0x57')]['id']}})[_0xf0c2('0x23')](handleEntityNotFound(_0x143222,null))['then'](function(_0x5e9a35){if(_0x5e9a35){_0x17b948[_0xf0c2('0x42')]=_['keys'](db[_0xf0c2('0x8e')][_0xf0c2('0x58')]);_0x17b948[_0xf0c2('0x43')]=_[_0xf0c2('0x59')](_0x12f654[_0xf0c2('0x43')]);_0x17b948['filters']=_[_0xf0c2('0x45')](_0x17b948[_0xf0c2('0x42')],_0x17b948['query']);_0x5e32d1[_0xf0c2('0x46')]=_[_0xf0c2('0x45')](_0x17b948[_0xf0c2('0x42')],qs[_0xf0c2('0x5a')](_0x12f654[_0xf0c2('0x43')][_0xf0c2('0x5a')]));_0x5e32d1['attributes']=_0x5e32d1[_0xf0c2('0x46')][_0xf0c2('0x5b')]?_0x5e32d1[_0xf0c2('0x46')]:_0x17b948[_0xf0c2('0x42')];if(!_0x12f654[_0xf0c2('0x43')][_0xf0c2('0x6b')](_0xf0c2('0x47'))){_0x5e32d1[_0xf0c2('0x32')]=qs[_0xf0c2('0x32')](_0x12f654[_0xf0c2('0x43')][_0xf0c2('0x32')]);_0x5e32d1[_0xf0c2('0x31')]=qs[_0xf0c2('0x31')](_0x12f654[_0xf0c2('0x43')][_0xf0c2('0x31')]);}_0x5e32d1[_0xf0c2('0x48')]=qs[_0xf0c2('0x49')](_0x12f654[_0xf0c2('0x43')][_0xf0c2('0x49')]);_0x5e32d1['where']=qs[_0xf0c2('0x44')](_[_0xf0c2('0x4a')](_0x12f654[_0xf0c2('0x43')],_0x17b948[_0xf0c2('0x44')]));_0x5e32d1[_0xf0c2('0x4c')]['OpenchannelAccountId']=_0x5e9a35['id'];if(_0x12f654['query']['filter']){_0x5e32d1[_0xf0c2('0x4c')]=_[_0xf0c2('0x4d')](_0x5e32d1[_0xf0c2('0x4c')],{'$or':_[_0xf0c2('0x40')](_0x5e32d1[_0xf0c2('0x46')],function(_0x5e4922){var _0x1084a1={};_0x1084a1[_0x5e4922]={'$like':'%'+_0x12f654[_0xf0c2('0x43')][_0xf0c2('0x4b')]+'%'};return _0x1084a1;})});}_0x5e32d1=_[_0xf0c2('0x4d')]({},_0x5e32d1,_0x12f654[_0xf0c2('0x4f')]);return db[_0xf0c2('0x8e')]['count']({'where':_0x5e32d1[_0xf0c2('0x4c')]})[_0xf0c2('0x23')](function(_0xd39f67){_0x4b6a7b[_0xf0c2('0x51')]=_0xd39f67;if(_0x12f654['query'][_0xf0c2('0x52')]){_0x5e32d1['include']=[{'model':db[_0xf0c2('0x73')],'as':_0xf0c2('0xa9'),'required':![]},{'model':db[_0xf0c2('0x9a')],'as':_0xf0c2('0xaa'),'attributes':[_0xf0c2('0x3d'),_0xf0c2('0xab'),_0xf0c2('0xac')],'required':![]},{'model':db['Tag'],'as':_0xf0c2('0xad'),'attributes':['id',_0xf0c2('0x3d'),_0xf0c2('0xae')],'where':_0x12f654[_0xf0c2('0x43')][_0xf0c2('0xaf')]?{'id':_0x12f654[_0xf0c2('0x43')][_0xf0c2('0xaf')]}:undefined,'required':_0x12f654['query']['tag']?!![]:![]}];}return db['OpenchannelInteraction'][_0xf0c2('0x54')](_0x5e32d1);})[_0xf0c2('0x23')](function(_0x339aed){_0x4b6a7b['rows']=_0x339aed;return _0x4b6a7b;});}})[_0xf0c2('0x23')](respondWithFilteredResult(_0x143222,_0x5e32d1))['catch'](handleError(_0x143222,null));};exports[_0xf0c2('0xb0')]=function(_0x182d09,_0x5301cf,_0x51c5d4){return db[_0xf0c2('0x50')][_0xf0c2('0x5c')]({'where':{'id':_0x182d09[_0xf0c2('0x57')]['id']}})[_0xf0c2('0x23')](handleEntityNotFound(_0x5301cf,null))['then'](function(_0x172cd0){if(_0x172cd0){return _0x172cd0[_0xf0c2('0xb0')](_0x182d09[_0xf0c2('0x65')]['ids'],_[_0xf0c2('0xb1')](_0x182d09[_0xf0c2('0x65')],[_0xf0c2('0xb2'),'id'])||{})['spread'](function(_0x2f9aa3){for(var _0x3ec782=0x0;_0x3ec782<_0x182d09[_0xf0c2('0x65')][_0xf0c2('0xb2')][_0xf0c2('0x5b')];_0x3ec782+=0x1){socket['emit'](_0xf0c2('0xb3'),{'UserId':_0x182d09[_0xf0c2('0x65')]['ids'][_0x3ec782],'OpenchannelAccountId':_0x182d09[_0xf0c2('0x57')]['id']});}return _0x2f9aa3;});}})[_0xf0c2('0x23')](respondWithResult(_0x5301cf,null))['catch'](handleError(_0x5301cf,null));};exports[_0xf0c2('0xb4')]=function(_0x4d3d82,_0x29051e,_0x1d3bb3){return db['OpenchannelAccount'][_0xf0c2('0x5c')]({'where':{'id':_0x4d3d82[_0xf0c2('0x57')]['id']}})[_0xf0c2('0x23')](handleEntityNotFound(_0x29051e,null))[_0xf0c2('0x23')](function(_0x44418f){if(_0x44418f){return _0x44418f['removeAgents'](_0x4d3d82[_0xf0c2('0x43')][_0xf0c2('0xb2')])[_0xf0c2('0x23')](function(){if(_[_0xf0c2('0xb5')](_0x4d3d82['query']['ids'])){for(var _0x9f1c8=0x0;_0x9f1c8<_0x4d3d82[_0xf0c2('0x43')]['ids'][_0xf0c2('0x5b')];_0x9f1c8+=0x1){socket[_0xf0c2('0xb6')](_0xf0c2('0xb7'),{'UserId':Number(_0x4d3d82[_0xf0c2('0x43')]['ids'][_0x9f1c8]),'OpenchannelAccountId':Number(_0x4d3d82[_0xf0c2('0x57')]['id'])});}}else{socket[_0xf0c2('0xb6')](_0xf0c2('0xb7'),{'UserId':Number(_0x4d3d82[_0xf0c2('0x43')][_0xf0c2('0xb2')]),'OpenchannelAccountId':Number(_0x4d3d82[_0xf0c2('0x57')]['id'])});}});}})[_0xf0c2('0x23')](respondWithStatusCode(_0x29051e,null))[_0xf0c2('0x5d')](handleError(_0x29051e,null));};exports[_0xf0c2('0xb8')]=function(_0x1a008b,_0x35c4b4,_0x338ae2){var _0x1f28ea={};var _0x181b8a={};var _0x149ab9;var _0x3c926c;return db[_0xf0c2('0x50')]['findOne']({'where':{'id':_0x1a008b[_0xf0c2('0x57')]['id']}})[_0xf0c2('0x23')](handleEntityNotFound(_0x35c4b4,null))['then'](function(_0x645618){if(_0x645618){_0x149ab9=_0x645618;_0x181b8a[_0xf0c2('0x42')]=_[_0xf0c2('0x59')](db['User'][_0xf0c2('0x58')]);_0x181b8a['query']=_['keys'](_0x1a008b['query']);_0x181b8a[_0xf0c2('0x44')]=_[_0xf0c2('0x45')](_0x181b8a['model'],_0x181b8a[_0xf0c2('0x43')]);_0x1f28ea[_0xf0c2('0x46')]=_[_0xf0c2('0x45')](_0x181b8a[_0xf0c2('0x42')],qs[_0xf0c2('0x5a')](_0x1a008b[_0xf0c2('0x43')][_0xf0c2('0x5a')]));_0x1f28ea[_0xf0c2('0x46')]=_0x1f28ea[_0xf0c2('0x46')][_0xf0c2('0x5b')]?_0x1f28ea[_0xf0c2('0x46')]:_0x181b8a[_0xf0c2('0x42')];_0x1f28ea[_0xf0c2('0x48')]=qs[_0xf0c2('0x49')](_0x1a008b['query'][_0xf0c2('0x49')]);_0x1f28ea[_0xf0c2('0x4c')]=qs[_0xf0c2('0x44')](_[_0xf0c2('0x4a')](_0x1a008b[_0xf0c2('0x43')],_0x181b8a[_0xf0c2('0x44')]));if(_0x1a008b[_0xf0c2('0x43')][_0xf0c2('0x4b')]){_0x1f28ea['where']=_[_0xf0c2('0x4d')](_0x1f28ea['where'],{'$or':_[_0xf0c2('0x40')](_0x1f28ea[_0xf0c2('0x46')],function(_0x15d4a6){var _0x3629c1={};_0x3629c1[_0x15d4a6]={'$like':'%'+_0x1a008b[_0xf0c2('0x43')][_0xf0c2('0x4b')]+'%'};return _0x3629c1;})});}_0x1f28ea=_[_0xf0c2('0x4d')]({},_0x1f28ea,_0x1a008b[_0xf0c2('0x4f')]);return _0x149ab9[_0xf0c2('0xb8')](_0x1f28ea);}})[_0xf0c2('0x23')](function(_0x1e85eb){if(_0x1e85eb){_0x3c926c=_0x1e85eb[_0xf0c2('0x5b')];if(!_0x1a008b[_0xf0c2('0x43')]['hasOwnProperty'](_0xf0c2('0x47'))){_0x1f28ea[_0xf0c2('0x32')]=qs[_0xf0c2('0x32')](_0x1a008b[_0xf0c2('0x43')][_0xf0c2('0x32')]);_0x1f28ea[_0xf0c2('0x31')]=qs[_0xf0c2('0x31')](_0x1a008b['query'][_0xf0c2('0x31')]);}return _0x149ab9['getAgents'](_0x1f28ea);}})[_0xf0c2('0x23')](function(_0x397b3c){if(_0x397b3c){return _0x397b3c?{'count':_0x3c926c,'rows':_0x397b3c}:null;}})[_0xf0c2('0x23')](respondWithResult(_0x35c4b4,null))[_0xf0c2('0x5d')](handleError(_0x35c4b4,null));};exports[_0xf0c2('0xb9')]=function(_0x4bdf5b,_0x3dbf92,_0xf7f82c){var _0x5a6076,_0x405b91,_0x2596c8;if(_[_0xf0c2('0x7a')](_0x4bdf5b[_0xf0c2('0x65')][_0xf0c2('0x65')])||_0x4bdf5b[_0xf0c2('0x65')][_0xf0c2('0x65')]===''){throw new db[(_0xf0c2('0x21'))][(_0xf0c2('0x7c'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0xf0c2('0x7a')](_0x4bdf5b[_0xf0c2('0x65')]['to'])){}_0x5a6076=_0x4bdf5b[_0xf0c2('0x65')]['to'];return db[_0xf0c2('0x50')][_0xf0c2('0x69')]({'where':{'id':_0x4bdf5b[_0xf0c2('0x57')]['id']}})[_0xf0c2('0x23')](handleEntityNotFound(_0x3dbf92,null))[_0xf0c2('0x23')](function(_0x45d1f7){if(_0x45d1f7){return db[_0xf0c2('0x50')][_0xf0c2('0x5c')]({'where':{'id':_0x45d1f7['id']},'include':[{'model':db[_0xf0c2('0x81')],'as':_0xf0c2('0x84'),'include':[{'model':db[_0xf0c2('0x73')],'as':_0xf0c2('0x82'),'where':{[_0x45d1f7[_0xf0c2('0x7e')]]:_0x5a6076},'limit':0x1,'order':[[_0xf0c2('0x78'),'DESC']]}]}]})['then'](handleEntityNotFound(_0x3dbf92,null))['then'](function(_0x32d234){if(_0x32d234&&_0x32d234[_0xf0c2('0x84')]){_0x405b91=_0x32d234[_0xf0c2('0x3a')]({'plain':!![]});if(_0x405b91['List']&&_0x405b91[_0xf0c2('0x84')][_0xf0c2('0x82')]['length']){return _0x405b91[_0xf0c2('0x84')][_0xf0c2('0x82')][0x0];}return db[_0xf0c2('0x73')][_0xf0c2('0x5e')](_[_0xf0c2('0x8a')](_0x4bdf5b[_0xf0c2('0x65')],{'firstName':_0x5a6076,[_0x32d234[_0xf0c2('0x7e')]]:_0x5a6076,'phone':_0x5a6076,'ListId':_0x405b91['ListId']}));}})[_0xf0c2('0x23')](handleEntityNotFound(_0x3dbf92,null))[_0xf0c2('0x23')](function(_0x255ce0){if(_0x255ce0){_0x2596c8=_0x255ce0;return db[_0xf0c2('0x8e')][_0xf0c2('0x5c')]({'where':{'ContactId':_0x2596c8['id'],'closed':![],'OpenchannelAccountId':_0x405b91['id']}})['then'](function(_0x1be7cf){if(_0x1be7cf){return[_0x1be7cf,![]];}return db['OpenchannelInteraction'][_0xf0c2('0x5e')]({'UserId':_0x4bdf5b[_0xf0c2('0x5f')]['id'],'ContactId':_0x2596c8['id'],'OpenchannelAccountId':_0x405b91['id'],'lastMsgDirection':_0xf0c2('0xba'),'Messages':[_[_0xf0c2('0x4d')](_0x4bdf5b['body'],{'read':![],'body':_0x4bdf5b[_0xf0c2('0x65')][_0xf0c2('0x65')],'OpenchannelAccountId':_0x405b91['id'],'UserId':_0x4bdf5b[_0xf0c2('0x5f')]['id'],'ContactId':_0x2596c8['id']})]},{'include':[{'model':db[_0xf0c2('0xbb')],'as':_0xf0c2('0xbc')}]})[_0xf0c2('0x23')](function(_0x17cf4b){return[_0x17cf4b,!![]];});});}})[_0xf0c2('0x90')](function(_0x2170cd,_0x43626a){if(_0x43626a){return _0x2170cd;}return db[_0xf0c2('0xbb')][_0xf0c2('0x5e')](_[_0xf0c2('0x4d')](_0x4bdf5b[_0xf0c2('0x65')],{'read':![],'body':_0x4bdf5b[_0xf0c2('0x65')][_0xf0c2('0x65')],'OpenchannelAccountId':_0x405b91['id'],'OpenchannelInteractionId':_0x2170cd['id'],'UserId':_0x4bdf5b[_0xf0c2('0x5f')]['id'],'ContactId':_0x2596c8['id']}))['then'](function(_0x58b664){_0x2170cd[_0xf0c2('0xbd')][_0xf0c2('0xbc')]=[];_0x2170cd[_0xf0c2('0xbd')][_0xf0c2('0xbc')][_0xf0c2('0xbe')](_0x58b664['dataValues']);return _0x2170cd;});});}})[_0xf0c2('0x23')](respondWithResult(_0x3dbf92,null))[_0xf0c2('0x5d')](handleError(_0x3dbf92,null));};
\ No newline at end of file
+var _0x1b4f=['List','Contacts','DESC','account','applications','list','orderBy','priority','asc','Applications','defaults','ListId','CmContact','threadId','OpenchannelInteraction','spread','contact','firstName','lastName','messageId','interaction','created','autoclose','push','close','unmanaged','*,*,*,*','OpenchannelMessage','User','UserId','unshift','agent','waitForTheAssignedAgent','forcedOwnership','Start','startRouting','notify','addApplications','sequelize','transaction','OpenchannelApplication','bulkCreate','getApplications','getInteractions','Contact','Owner','internal','Tag','Tags','color','tag','addAgents','omit','removeAgents','isArray','getAgents','send','out','Messages','dataValues','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','client','http','Sequelize','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','OpenchannelAccount,\x20%s,\x20%s','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','status','json','offset','set','apply','reject','save','destroy','get','end','sendStatus','stack','name','index','Pause','mandatoryDispositionPause','OpenchannelAccount','rawAttributes','fieldName','key','map','query','keys','filters','intersection','attributes','model','fields','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','count','includeAll','include','findAll','rows','show','params','length','find','create','body','user','role','OpenchannelAccounts','UserProfileSection','userProfileId','update','describe','addDisposition','OpnechannelAccountId','Disposition','getDispositions','OpenchannelAccountId','removeDispositions','ids','addAnswer','CannedAnswer','findOne','removeAnswers','openchannel','ValidationError','difference','createdAt','CompanyId','from','from\x20is\x20mandatory','isNil','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList'];(function(_0x4ef8f1,_0x30f6e3){var _0x330e8e=function(_0x3fd871){while(--_0x3fd871){_0x4ef8f1['push'](_0x4ef8f1['shift']());}};_0x330e8e(++_0x30f6e3);}(_0x1b4f,0xf5));var _0xf1b4=function(_0x318258,_0x2fdeba){_0x318258=_0x318258-0x0;var _0x191848=_0x1b4f[_0x318258];return _0x191848;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xf1b4('0x0'));var rimraf=require(_0xf1b4('0x1'));var zipdir=require(_0xf1b4('0x2'));var jsonpatch=require(_0xf1b4('0x3'));var rp=require(_0xf1b4('0x4'));var moment=require(_0xf1b4('0x5'));var BPromise=require(_0xf1b4('0x6'));var Mustache=require(_0xf1b4('0x7'));var util=require(_0xf1b4('0x8'));var path=require(_0xf1b4('0x9'));var sox=require(_0xf1b4('0xa'));var csv=require(_0xf1b4('0xb'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xf1b4('0xc'));var squel=require('squel');var crypto=require(_0xf1b4('0xd'));var jsforce=require(_0xf1b4('0xe'));var deskjs=require(_0xf1b4('0xf'));var toCsv=require(_0xf1b4('0xb'));var querystring=require(_0xf1b4('0x10'));var Papa=require('papaparse');var Redis=require(_0xf1b4('0x11'));var authService=require(_0xf1b4('0x12'));var qs=require(_0xf1b4('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xf1b4('0x14'))('api');var utils=require(_0xf1b4('0x15'));var config=require(_0xf1b4('0x16'));var db=require(_0xf1b4('0x17'))['db'];config[_0xf1b4('0x18')]=_['defaults'](config['redis'],{'host':_0xf1b4('0x19'),'port':0x18eb});var socket=require(_0xf1b4('0x1a'))(new Redis(config[_0xf1b4('0x18')]));require('./openchannelAccount.socket')['register'](socket);var jayson=require('jayson/promise');var client=jayson[_0xf1b4('0x1b')][_0xf1b4('0x1c')]({'port':0x232c});var client9002=jayson[_0xf1b4('0x1b')][_0xf1b4('0x1c')]({'port':0x232a});function checkPasswordPattern(_0x335cab,_0x3b1c48,_0x1c5090){if(_0x1c5090){var _0x690242=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x690242['test'](_0x3b1c48)){return _0x335cab;}else{throw new db[(_0xf1b4('0x1d'))]['ValidationError'](_0xf1b4('0x1e'));}}else{return _0x335cab;}}function respondWithRpcPromise(_0x595d27,_0x2a7ded,_0x6e8167,_0x276701){return new BPromise(function(_0x445413,_0x82df69){var _0x9469e3=_0x276701||client;return _0x9469e3[_0xf1b4('0x1f')](_0x595d27,_0x6e8167)[_0xf1b4('0x20')](function(_0x4c2048){logger[_0xf1b4('0x21')](_0xf1b4('0x22'),_0x2a7ded,'request\x20sent');logger[_0xf1b4('0x23')](_0xf1b4('0x24'),_0x2a7ded,_0xf1b4('0x25'),JSON[_0xf1b4('0x26')](_0x4c2048));if(_0x4c2048[_0xf1b4('0x27')]){if(_0x4c2048[_0xf1b4('0x27')][_0xf1b4('0x28')]===0x1f4){logger[_0xf1b4('0x27')](_0xf1b4('0x22'),_0x2a7ded,_0x4c2048[_0xf1b4('0x27')][_0xf1b4('0x29')]);return _0x82df69(_0x4c2048[_0xf1b4('0x27')]['message']);}logger[_0xf1b4('0x27')](_0xf1b4('0x22'),_0x2a7ded,_0x4c2048[_0xf1b4('0x27')][_0xf1b4('0x29')]);return _0x445413(_0x4c2048[_0xf1b4('0x27')][_0xf1b4('0x29')]);}else{logger[_0xf1b4('0x21')](_0xf1b4('0x22'),_0x2a7ded,_0xf1b4('0x25'));_0x445413(_0x4c2048['result'][_0xf1b4('0x29')]);}})[_0xf1b4('0x2a')](function(_0x352fb5){logger[_0xf1b4('0x27')](_0xf1b4('0x22'),_0x2a7ded,_0x352fb5);_0x82df69(_0x352fb5);});});}function respondWithStatusCode(_0x48cf6b,_0x4beab5){_0x4beab5=_0x4beab5||0xcc;return function(_0x22dfa3){if(_0x22dfa3){return _0x48cf6b['sendStatus'](_0x4beab5);}return _0x48cf6b['status'](_0x4beab5)['end']();};}function respondWithResult(_0x5db410,_0x175b12){_0x175b12=_0x175b12||0xc8;return function(_0x50711b){if(_0x50711b){return _0x5db410[_0xf1b4('0x2b')](_0x175b12)[_0xf1b4('0x2c')](_0x50711b);}};}function respondWithFilteredResult(_0x45c1b2,_0xc26a93){return function(_0x593ce7){if(_0x593ce7){var _0x4133af=_0x593ce7['count'],_0x535c54=_0xc26a93[_0xf1b4('0x2d')],_0x2688ac=_0xc26a93[_0xf1b4('0x2d')]+_0xc26a93['limit'],_0x59a5cb;if(_0x2688ac>=_0x4133af){_0x2688ac=_0x4133af;_0x59a5cb=0xc8;}else{_0x59a5cb=0xce;}_0x45c1b2[_0xf1b4('0x2b')](_0x59a5cb);return _0x45c1b2[_0xf1b4('0x2e')]('Content-Range',_0x535c54+'-'+_0x2688ac+'/'+_0x4133af)['json'](_0x593ce7);}return null;};}function patchUpdates(_0x42d1aa){return function(_0x2357fe){try{jsonpatch[_0xf1b4('0x2f')](_0x2357fe,_0x42d1aa,!![]);}catch(_0xdb7329){return BPromise[_0xf1b4('0x30')](_0xdb7329);}return _0x2357fe[_0xf1b4('0x31')]();};}function saveUpdates(_0x831c2c,_0x4582b0){return function(_0x514065){if(_0x514065){return _0x514065['update'](_0x831c2c)[_0xf1b4('0x20')](function(_0x588af0){return _0x588af0;});}return null;};}function removeEntity(_0x194df0,_0x2d9d9c){return function(_0x30041a){if(_0x30041a){return _0x30041a[_0xf1b4('0x32')]()[_0xf1b4('0x20')](function(){var _0x181653=_0x30041a[_0xf1b4('0x33')]({'plain':!![]});var _0xebf9d8='OpenchannelAccounts';return db['UserProfileResource'][_0xf1b4('0x32')]({'where':{'type':_0xebf9d8,'resourceId':_0x181653['id']}})[_0xf1b4('0x20')](function(){return _0x30041a;});})['then'](function(){_0x194df0[_0xf1b4('0x2b')](0xcc)[_0xf1b4('0x34')]();});}};}function handleEntityNotFound(_0x18311d,_0x18effb){return function(_0x3ebd4d){if(!_0x3ebd4d){_0x18311d[_0xf1b4('0x35')](0x194);}return _0x3ebd4d;};}function handleError(_0x2a27db,_0x26ed6c){_0x26ed6c=_0x26ed6c||0x1f4;return function(_0x208062){logger[_0xf1b4('0x27')](_0x208062[_0xf1b4('0x36')]);if(_0x208062[_0xf1b4('0x37')]){delete _0x208062['name'];}_0x2a27db[_0xf1b4('0x2b')](_0x26ed6c)['send'](_0x208062);};}exports[_0xf1b4('0x38')]=function(_0x8dcfb2,_0x3a5e1a){var _0xce4b46={'include':[{'model':db[_0xf1b4('0x39')],'as':_0xf1b4('0x3a')}]},_0x190d9b={},_0x3ca97d={'count':0x0,'rows':[]};var _0x36a0f8=_['map'](db[_0xf1b4('0x3b')][_0xf1b4('0x3c')],function(_0x119a25){return{'name':_0x119a25[_0xf1b4('0x3d')],'type':_0x119a25['type'][_0xf1b4('0x3e')]};});_0x190d9b['model']=_[_0xf1b4('0x3f')](_0x36a0f8,_0xf1b4('0x37'));_0x190d9b[_0xf1b4('0x40')]=_[_0xf1b4('0x41')](_0x8dcfb2[_0xf1b4('0x40')]);_0x190d9b[_0xf1b4('0x42')]=_[_0xf1b4('0x43')](_0x190d9b['model'],_0x190d9b[_0xf1b4('0x40')]);_0xce4b46[_0xf1b4('0x44')]=_['intersection'](_0x190d9b[_0xf1b4('0x45')],qs[_0xf1b4('0x46')](_0x8dcfb2['query']['fields']));_0xce4b46[_0xf1b4('0x44')]=_0xce4b46[_0xf1b4('0x44')]['length']?_0xce4b46['attributes']:_0x190d9b['model'];if(!_0x8dcfb2['query'][_0xf1b4('0x47')](_0xf1b4('0x48'))){_0xce4b46[_0xf1b4('0x49')]=qs[_0xf1b4('0x49')](_0x8dcfb2['query'][_0xf1b4('0x49')]);_0xce4b46[_0xf1b4('0x2d')]=qs[_0xf1b4('0x2d')](_0x8dcfb2['query'][_0xf1b4('0x2d')]);}_0xce4b46[_0xf1b4('0x4a')]=qs[_0xf1b4('0x4b')](_0x8dcfb2['query'][_0xf1b4('0x4b')]);_0xce4b46[_0xf1b4('0x4c')]=qs[_0xf1b4('0x42')](_[_0xf1b4('0x4d')](_0x8dcfb2[_0xf1b4('0x40')],_0x190d9b[_0xf1b4('0x42')]),_0x36a0f8);if(_0x8dcfb2[_0xf1b4('0x40')][_0xf1b4('0x4e')]){_0xce4b46[_0xf1b4('0x4c')]=_[_0xf1b4('0x4f')](_0xce4b46[_0xf1b4('0x4c')],{'$or':_[_0xf1b4('0x3f')](_0x36a0f8,function(_0x310745){if(_0x310745[_0xf1b4('0x50')]!==_0xf1b4('0x51')){var _0x11dd93={};_0x11dd93[_0x310745['name']]={'$like':'%'+_0x8dcfb2['query']['filter']+'%'};return _0x11dd93;}})});}_0xce4b46=_['merge']({},_0xce4b46,_0x8dcfb2[_0xf1b4('0x52')]);var _0x5715e9={'where':_0xce4b46[_0xf1b4('0x4c')]};return db['OpenchannelAccount'][_0xf1b4('0x53')](_0x5715e9)[_0xf1b4('0x20')](function(_0x64ecf0){_0x3ca97d['count']=_0x64ecf0;if(_0x8dcfb2[_0xf1b4('0x40')][_0xf1b4('0x54')]){_0xce4b46[_0xf1b4('0x55')]=[{'all':!![]}];}return db['OpenchannelAccount'][_0xf1b4('0x56')](_0xce4b46);})[_0xf1b4('0x20')](function(_0x137929){_0x3ca97d[_0xf1b4('0x57')]=_0x137929;return _0x3ca97d;})[_0xf1b4('0x20')](respondWithFilteredResult(_0x3a5e1a,_0xce4b46))[_0xf1b4('0x2a')](handleError(_0x3a5e1a,null));};exports[_0xf1b4('0x58')]=function(_0x4f6912,_0x4b4e6c){var _0x34351a={'raw':![],'where':{'id':_0x4f6912[_0xf1b4('0x59')]['id']},'include':[{'model':db['Pause'],'as':_0xf1b4('0x3a')}]},_0x588022={};_0x588022[_0xf1b4('0x45')]=_['keys'](db[_0xf1b4('0x3b')]['rawAttributes']);_0x588022['query']=_[_0xf1b4('0x41')](_0x4f6912['query']);_0x588022[_0xf1b4('0x42')]=_[_0xf1b4('0x43')](_0x588022[_0xf1b4('0x45')],_0x588022[_0xf1b4('0x40')]);_0x34351a[_0xf1b4('0x44')]=_['intersection'](_0x588022['model'],qs[_0xf1b4('0x46')](_0x4f6912[_0xf1b4('0x40')][_0xf1b4('0x46')]));_0x34351a[_0xf1b4('0x44')]=_0x34351a['attributes'][_0xf1b4('0x5a')]?_0x34351a[_0xf1b4('0x44')]:_0x588022[_0xf1b4('0x45')];if(_0x4f6912[_0xf1b4('0x40')][_0xf1b4('0x54')]){_0x34351a['include']=[{'all':!![]}];}_0x34351a=_[_0xf1b4('0x4f')]({},_0x34351a,_0x4f6912[_0xf1b4('0x52')]);return db['OpenchannelAccount'][_0xf1b4('0x5b')](_0x34351a)[_0xf1b4('0x20')](handleEntityNotFound(_0x4b4e6c,null))[_0xf1b4('0x20')](respondWithResult(_0x4b4e6c,null))[_0xf1b4('0x2a')](handleError(_0x4b4e6c,null));};exports['create']=function(_0x24e75d,_0x356cc6){return db[_0xf1b4('0x3b')][_0xf1b4('0x5c')](_0x24e75d[_0xf1b4('0x5d')],{})[_0xf1b4('0x20')](function(_0x54721e){var _0x5ac989=_0x24e75d[_0xf1b4('0x5e')][_0xf1b4('0x33')]({'plain':!![]});if(!_0x5ac989)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5ac989[_0xf1b4('0x5f')]==='user'){var _0x47b720=_0x54721e[_0xf1b4('0x33')]({'plain':!![]});var _0x134aca=_0xf1b4('0x60');return db[_0xf1b4('0x61')][_0xf1b4('0x5b')]({'where':{'name':_0x134aca,'userProfileId':_0x5ac989[_0xf1b4('0x62')]},'raw':!![]})['then'](function(_0x217122){if(_0x217122&&_0x217122['autoAssociation']===0x0){return db['UserProfileResource'][_0xf1b4('0x5c')]({'name':_0x47b720[_0xf1b4('0x37')],'resourceId':_0x47b720['id'],'type':_0x217122[_0xf1b4('0x37')],'sectionId':_0x217122['id']},{})['then'](function(){return _0x54721e;});}else{return _0x54721e;}})['catch'](function(_0x560981){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x560981);throw _0x560981;});}return _0x54721e;})[_0xf1b4('0x20')](respondWithResult(_0x356cc6,0xc9))[_0xf1b4('0x2a')](handleError(_0x356cc6,null));};exports[_0xf1b4('0x63')]=function(_0x424aeb,_0x23614a){if(_0x424aeb['body']['id']){delete _0x424aeb[_0xf1b4('0x5d')]['id'];}return db[_0xf1b4('0x3b')][_0xf1b4('0x5b')]({'where':{'id':_0x424aeb['params']['id']},'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]})['then'](handleEntityNotFound(_0x23614a,null))[_0xf1b4('0x20')](saveUpdates(_0x424aeb[_0xf1b4('0x5d')],null))[_0xf1b4('0x20')](respondWithResult(_0x23614a,null))[_0xf1b4('0x2a')](handleError(_0x23614a,null));};exports['destroy']=function(_0x1bb4e5,_0x1c68a4){return db[_0xf1b4('0x3b')]['find']({'where':{'id':_0x1bb4e5[_0xf1b4('0x59')]['id']}})[_0xf1b4('0x20')](handleEntityNotFound(_0x1c68a4,null))['then'](removeEntity(_0x1c68a4,null))[_0xf1b4('0x2a')](handleError(_0x1c68a4,null));};exports[_0xf1b4('0x64')]=function(_0x391984,_0x18f917){return db[_0xf1b4('0x3b')][_0xf1b4('0x64')]()[_0xf1b4('0x20')](respondWithResult(_0x18f917,null))[_0xf1b4('0x2a')](handleError(_0x18f917,null));};exports[_0xf1b4('0x65')]=function(_0x246856,_0x18ae5b,_0x4ddbc5){if(_0x246856[_0xf1b4('0x5d')]['id']){delete _0x246856['body']['id'];}return db[_0xf1b4('0x3b')]['find']({'where':{'id':_0x246856['params']['id']}})[_0xf1b4('0x20')](handleEntityNotFound(_0x18ae5b,null))[_0xf1b4('0x20')](function(_0x58b9aa){if(_0x58b9aa){_0x246856[_0xf1b4('0x5d')][_0xf1b4('0x66')]=_0x58b9aa['id'];return db[_0xf1b4('0x67')]['create'](_0x246856[_0xf1b4('0x5d')]);}})[_0xf1b4('0x20')](respondWithResult(_0x18ae5b,null))['catch'](handleError(_0x18ae5b,null));};exports[_0xf1b4('0x68')]=function(_0x334d98,_0xfe615a,_0x58d46e){var _0x5764fb={'raw':![],'where':{}};var _0x220e62={};var _0x13c107={'count':0x0,'rows':[]};return db[_0xf1b4('0x3b')]['findOne']({'where':{'id':_0x334d98['params']['id']}})[_0xf1b4('0x20')](handleEntityNotFound(_0xfe615a,null))['then'](function(_0x361456){if(_0x361456){_0x220e62[_0xf1b4('0x45')]=_[_0xf1b4('0x41')](db['Disposition'][_0xf1b4('0x3c')]);_0x220e62[_0xf1b4('0x40')]=_[_0xf1b4('0x41')](_0x334d98[_0xf1b4('0x40')]);_0x220e62[_0xf1b4('0x42')]=_[_0xf1b4('0x43')](_0x220e62['model'],_0x220e62['query']);_0x5764fb[_0xf1b4('0x44')]=_[_0xf1b4('0x43')](_0x220e62[_0xf1b4('0x45')],qs[_0xf1b4('0x46')](_0x334d98[_0xf1b4('0x40')]['fields']));_0x5764fb[_0xf1b4('0x44')]=_0x5764fb[_0xf1b4('0x44')][_0xf1b4('0x5a')]?_0x5764fb[_0xf1b4('0x44')]:_0x220e62[_0xf1b4('0x45')];if(!_0x334d98[_0xf1b4('0x40')]['hasOwnProperty'](_0xf1b4('0x48'))){_0x5764fb[_0xf1b4('0x49')]=qs['limit'](_0x334d98[_0xf1b4('0x40')][_0xf1b4('0x49')]);_0x5764fb[_0xf1b4('0x2d')]=qs[_0xf1b4('0x2d')](_0x334d98[_0xf1b4('0x40')][_0xf1b4('0x2d')]);}_0x5764fb[_0xf1b4('0x4a')]=qs[_0xf1b4('0x4b')](_0x334d98[_0xf1b4('0x40')]['sort']);_0x5764fb[_0xf1b4('0x4c')]=qs[_0xf1b4('0x42')](_[_0xf1b4('0x4d')](_0x334d98[_0xf1b4('0x40')],_0x220e62[_0xf1b4('0x42')]));_0x5764fb[_0xf1b4('0x4c')][_0xf1b4('0x69')]=_0x361456['id'];if(_0x334d98[_0xf1b4('0x40')][_0xf1b4('0x4e')]){_0x5764fb[_0xf1b4('0x4c')]=_[_0xf1b4('0x4f')](_0x5764fb[_0xf1b4('0x4c')],{'$or':_[_0xf1b4('0x3f')](_0x5764fb['attributes'],function(_0x501bca){var _0x3f812f={};_0x3f812f[_0x501bca]={'$like':'%'+_0x334d98['query'][_0xf1b4('0x4e')]+'%'};return _0x3f812f;})});}_0x5764fb=_[_0xf1b4('0x4f')]({},_0x5764fb,_0x334d98[_0xf1b4('0x52')]);return db[_0xf1b4('0x67')][_0xf1b4('0x53')]({'where':_0x5764fb[_0xf1b4('0x4c')]})[_0xf1b4('0x20')](function(_0x24d533){_0x13c107[_0xf1b4('0x53')]=_0x24d533;if(_0x334d98[_0xf1b4('0x40')]['includeAll']){_0x5764fb[_0xf1b4('0x55')]=[{'all':!![]}];}return db[_0xf1b4('0x67')][_0xf1b4('0x56')](_0x5764fb);})[_0xf1b4('0x20')](function(_0x307037){_0x13c107[_0xf1b4('0x57')]=_0x307037;return _0x13c107;});}})['then'](respondWithFilteredResult(_0xfe615a,_0x5764fb))[_0xf1b4('0x2a')](handleError(_0xfe615a,null));};exports[_0xf1b4('0x6a')]=function(_0x2f02d8,_0x17fc3e,_0x5d9f37){return db[_0xf1b4('0x3b')][_0xf1b4('0x5b')]({'where':{'id':_0x2f02d8[_0xf1b4('0x59')]['id']}})[_0xf1b4('0x20')](handleEntityNotFound(_0x17fc3e,null))[_0xf1b4('0x20')](function(_0x2fe21d){if(_0x2fe21d){return _0x2fe21d[_0xf1b4('0x6a')](_0x2f02d8[_0xf1b4('0x40')][_0xf1b4('0x6b')]);}})['then'](respondWithStatusCode(_0x17fc3e,null))[_0xf1b4('0x2a')](handleError(_0x17fc3e,null));};exports[_0xf1b4('0x6c')]=function(_0x276ca1,_0x41ed99,_0x3dc34b){if(_0x276ca1[_0xf1b4('0x5d')]['id']){delete _0x276ca1['body']['id'];}return db[_0xf1b4('0x3b')][_0xf1b4('0x5b')]({'where':{'id':_0x276ca1[_0xf1b4('0x59')]['id']}})[_0xf1b4('0x20')](handleEntityNotFound(_0x41ed99,null))['then'](function(_0x1227ae){if(_0x1227ae){_0x276ca1[_0xf1b4('0x5d')][_0xf1b4('0x69')]=_0x1227ae['id'];return db[_0xf1b4('0x6d')][_0xf1b4('0x5c')](_0x276ca1['body']);}})[_0xf1b4('0x20')](respondWithResult(_0x41ed99,null))['catch'](handleError(_0x41ed99,null));};exports['getAnswers']=function(_0x33051e,_0x5a5869,_0xf01a4d){var _0x28413a={'raw':![],'where':{}};var _0x21ac52={};var _0x428d65={'count':0x0,'rows':[]};return db['OpenchannelAccount'][_0xf1b4('0x6e')]({'where':{'id':_0x33051e[_0xf1b4('0x59')]['id']}})[_0xf1b4('0x20')](handleEntityNotFound(_0x5a5869,null))[_0xf1b4('0x20')](function(_0x526350){if(_0x526350){_0x21ac52[_0xf1b4('0x45')]=_[_0xf1b4('0x41')](db[_0xf1b4('0x6d')][_0xf1b4('0x3c')]);_0x21ac52[_0xf1b4('0x40')]=_['keys'](_0x33051e[_0xf1b4('0x40')]);_0x21ac52[_0xf1b4('0x42')]=_[_0xf1b4('0x43')](_0x21ac52['model'],_0x21ac52[_0xf1b4('0x40')]);_0x28413a[_0xf1b4('0x44')]=_[_0xf1b4('0x43')](_0x21ac52['model'],qs[_0xf1b4('0x46')](_0x33051e[_0xf1b4('0x40')]['fields']));_0x28413a[_0xf1b4('0x44')]=_0x28413a[_0xf1b4('0x44')][_0xf1b4('0x5a')]?_0x28413a[_0xf1b4('0x44')]:_0x21ac52[_0xf1b4('0x45')];if(!_0x33051e[_0xf1b4('0x40')]['hasOwnProperty'](_0xf1b4('0x48'))){_0x28413a[_0xf1b4('0x49')]=qs['limit'](_0x33051e[_0xf1b4('0x40')][_0xf1b4('0x49')]);_0x28413a['offset']=qs[_0xf1b4('0x2d')](_0x33051e['query'][_0xf1b4('0x2d')]);}_0x28413a[_0xf1b4('0x4a')]=qs['sort'](_0x33051e['query'][_0xf1b4('0x4b')]);_0x28413a['where']=qs['filters'](_['pick'](_0x33051e[_0xf1b4('0x40')],_0x21ac52[_0xf1b4('0x42')]));_0x28413a['where'][_0xf1b4('0x69')]=_0x526350['id'];if(_0x33051e[_0xf1b4('0x40')]['filter']){_0x28413a['where']=_[_0xf1b4('0x4f')](_0x28413a['where'],{'$or':_[_0xf1b4('0x3f')](_0x28413a[_0xf1b4('0x44')],function(_0x194929){var _0x2b333c={};_0x2b333c[_0x194929]={'$like':'%'+_0x33051e[_0xf1b4('0x40')][_0xf1b4('0x4e')]+'%'};return _0x2b333c;})});}_0x28413a=_['merge']({},_0x28413a,_0x33051e[_0xf1b4('0x52')]);return db['CannedAnswer']['count']({'where':_0x28413a[_0xf1b4('0x4c')]})[_0xf1b4('0x20')](function(_0x213650){_0x428d65[_0xf1b4('0x53')]=_0x213650;if(_0x33051e['query'][_0xf1b4('0x54')]){_0x28413a[_0xf1b4('0x55')]=[{'all':!![]}];}return db['CannedAnswer']['findAll'](_0x28413a);})[_0xf1b4('0x20')](function(_0x58f059){_0x428d65[_0xf1b4('0x57')]=_0x58f059;return _0x428d65;});}})[_0xf1b4('0x20')](respondWithFilteredResult(_0x5a5869,_0x28413a))[_0xf1b4('0x2a')](handleError(_0x5a5869,null));};exports[_0xf1b4('0x6f')]=function(_0x535c3d,_0x448e74,_0x54322f){return db[_0xf1b4('0x3b')]['find']({'where':{'id':_0x535c3d[_0xf1b4('0x59')]['id']}})[_0xf1b4('0x20')](handleEntityNotFound(_0x448e74,null))[_0xf1b4('0x20')](function(_0x455482){if(_0x455482){return _0x455482[_0xf1b4('0x6f')](_0x535c3d[_0xf1b4('0x40')][_0xf1b4('0x6b')]);}})[_0xf1b4('0x20')](respondWithStatusCode(_0x448e74,null))[_0xf1b4('0x2a')](handleError(_0x448e74,null));};exports['notify']=function(_0x12d0f8,_0x28bef2,_0x3c844b){var _0x46a6f2={'body':_0x12d0f8[_0xf1b4('0x5d')],'channel':_0xf1b4('0x70')};var _0x215738=[];var _0x1cbf86=[];var _0x3a3453={};var _0x205ff0=![];return db['CmContact']['describe']()[_0xf1b4('0x20')](function(_0x3cf785){if(!_0x3cf785){throw new db[(_0xf1b4('0x1d'))][(_0xf1b4('0x71'))]('no\x20available\x20attributes');}_0x215738=_[_0xf1b4('0x72')](_['keys'](_0x3cf785),[_0xf1b4('0x73'),'updatedAt']);_0x1cbf86=_[_0xf1b4('0x72')](_[_0xf1b4('0x41')](_0x3cf785),[_0xf1b4('0x73'),'updatedAt',_0xf1b4('0x74'),'ListId']);if(_0x12d0f8['body']['id']){delete _0x12d0f8[_0xf1b4('0x5d')]['id'];}if(_['isNil'](_0x12d0f8[_0xf1b4('0x5d')][_0xf1b4('0x75')])){throw new db[(_0xf1b4('0x1d'))][(_0xf1b4('0x71'))](_0xf1b4('0x76'));}if(_[_0xf1b4('0x77')](_0x12d0f8[_0xf1b4('0x5d')][_0xf1b4('0x5d')])||_0x12d0f8[_0xf1b4('0x5d')][_0xf1b4('0x5d')]===''){throw new db[(_0xf1b4('0x1d'))][(_0xf1b4('0x71'))](_0xf1b4('0x78'));}if(_[_0xf1b4('0x77')](_0x12d0f8[_0xf1b4('0x5d')][_0xf1b4('0x79')])){throw new db[(_0xf1b4('0x1d'))]['ValidationError']('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x1cbf86);}if(!_[_0xf1b4('0x7a')](_0x1cbf86,_0x12d0f8[_0xf1b4('0x5d')][_0xf1b4('0x79')])){throw new db[(_0xf1b4('0x1d'))][(_0xf1b4('0x71'))](_0xf1b4('0x7b')+_0x1cbf86);}_0x3a3453[_0x12d0f8[_0xf1b4('0x5d')][_0xf1b4('0x79')]]=_0x12d0f8[_0xf1b4('0x5d')][_0xf1b4('0x75')];})['then'](function(){return db['OpenchannelAccount'][_0xf1b4('0x5b')]({'where':{'id':_0x12d0f8[_0xf1b4('0x59')]['id']},'include':[{'model':db[_0xf1b4('0x7c')],'as':_0xf1b4('0x7d'),'include':[{'model':db['CmContact'],'as':_0xf1b4('0x7e'),'where':_0x3a3453,'limit':0x1,'order':[['updatedAt',_0xf1b4('0x7f')]]}]},{'model':db['OpenchannelApplication'],'as':'Applications'}]});})[_0xf1b4('0x20')](handleEntityNotFound(_0x28bef2,null))[_0xf1b4('0x20')](function(_0x5570e1){if(_0x5570e1&&_0x5570e1[_0xf1b4('0x7d')]){_0x46a6f2[_0xf1b4('0x80')]=_0x5570e1;_0x46a6f2[_0xf1b4('0x81')]=_0x5570e1['Applications'];_0x46a6f2[_0xf1b4('0x82')]=_0x5570e1['List'];_0x46a6f2[_0xf1b4('0x81')]=_[_0xf1b4('0x83')](_0x46a6f2[_0xf1b4('0x81')],[_0xf1b4('0x84')],[_0xf1b4('0x85')]);if(_0x46a6f2[_0xf1b4('0x80')][_0xf1b4('0x86')]){delete _0x46a6f2['account'][_0xf1b4('0x86')];}if(_0x46a6f2[_0xf1b4('0x80')][_0xf1b4('0x7d')]&&_0x46a6f2[_0xf1b4('0x80')]['List'][_0xf1b4('0x7e')][_0xf1b4('0x5a')]){return _0x46a6f2[_0xf1b4('0x80')][_0xf1b4('0x7d')]['Contacts'][0x0];}var _0x5f27d0=_[_0xf1b4('0x87')](_0x12d0f8[_0xf1b4('0x5d')],{'firstName':_0x12d0f8[_0xf1b4('0x5d')][_0xf1b4('0x75')],'ListId':_0x5570e1[_0xf1b4('0x88')]});_0x5f27d0[_0x12d0f8[_0xf1b4('0x5d')][_0xf1b4('0x79')]]=_0x12d0f8[_0xf1b4('0x5d')][_0xf1b4('0x75')];return db[_0xf1b4('0x89')][_0xf1b4('0x5c')](_0x5f27d0,{'fields':_0x215738,'raw':!![]});}})['then'](handleEntityNotFound(_0x28bef2,null))[_0xf1b4('0x20')](function(_0x31aeb6){_0x46a6f2['contact']=_0x31aeb6;if(_0x31aeb6){var _0x288cf5={'ContactId':_0x31aeb6['id'],'OpenchannelAccountId':_0x12d0f8[_0xf1b4('0x59')]['id'],'from':(_0x31aeb6['firstName']||'')+'\x20'+(_0x31aeb6['lastName']||'')};var _0x380bde={'OpenchannelAccountId':_0x12d0f8[_0xf1b4('0x59')]['id'],'closed':![]};if(_0x12d0f8['body'][_0xf1b4('0x8a')]){_0x380bde['threadId']=_0x12d0f8['body'][_0xf1b4('0x8a')];return db[_0xf1b4('0x8b')][_0xf1b4('0x5b')]({'where':_0x380bde})[_0xf1b4('0x20')](function(_0x15f56a){if(_0x15f56a){return[_0x15f56a,![]];}_0x288cf5['threadId']=_0x12d0f8['body'][_0xf1b4('0x8a')];_0x288cf5['externalUrl']=_0x12d0f8['body']['externalUrl'];return db['OpenchannelInteraction'][_0xf1b4('0x5c')](_0x288cf5)['then'](function(_0x452ad8){return[_0x452ad8,!![]];});});}else{_0x380bde['threadId']=null;}_0x380bde['ContactId']=_0x31aeb6['id'];return db[_0xf1b4('0x8b')]['find']({'where':_0x380bde})['then'](function(_0x589bb9){if(_0x589bb9){return[_0x589bb9,![]];}return db[_0xf1b4('0x8b')]['create'](_0x288cf5)[_0xf1b4('0x20')](function(_0x53d57b){return[_0x53d57b,!![]];});});}})[_0xf1b4('0x8c')](function(_0x204969,_0x19a1d7){if(_0x204969){_0x205ff0=_0x19a1d7;if(!_0x19a1d7){var _0x5f03c6={'from':(_0x46a6f2[_0xf1b4('0x8d')][_0xf1b4('0x8e')]||'')+'\x20'+(_0x46a6f2[_0xf1b4('0x8d')][_0xf1b4('0x8f')]||'')};if(_0x12d0f8[_0xf1b4('0x5d')][_0xf1b4('0x8a')]&&_0x12d0f8[_0xf1b4('0x5d')][_0xf1b4('0x90')]&&_0x12d0f8['body'][_0xf1b4('0x8a')]!=_0x12d0f8[_0xf1b4('0x5d')][_0xf1b4('0x90')]){_0x5f03c6[_0xf1b4('0x8a')]=_0x12d0f8[_0xf1b4('0x5d')]['messageId'];}return _0x204969[_0xf1b4('0x63')](_0x5f03c6);}else{return _0x204969;}}})[_0xf1b4('0x20')](function(_0xe5d140){_0x46a6f2[_0xf1b4('0x91')]=_0xe5d140[_0xf1b4('0x33')]({'plain':!![]});_0x46a6f2[_0xf1b4('0x91')][_0xf1b4('0x92')]=_0x205ff0;if(_0x46a6f2[_0xf1b4('0x91')]['created']){if(_0x46a6f2['account'][_0xf1b4('0x93')]){_0x46a6f2[_0xf1b4('0x81')][_0xf1b4('0x94')]({'id':0x0,'priority':_0x46a6f2['applications'][_0xf1b4('0x5a')]+0x1,'app':_0xf1b4('0x95'),'appdata':_0xf1b4('0x96'),'interval':_0xf1b4('0x97')});}}return db[_0xf1b4('0x98')][_0xf1b4('0x5c')]({'body':_0x12d0f8[_0xf1b4('0x5d')]['body'],'OpenchannelAccountId':_0x12d0f8[_0xf1b4('0x59')]['id'],'OpenchannelInteractionId':_0xe5d140['id'],'direction':'in','ContactId':_0x46a6f2[_0xf1b4('0x8d')]['id'],'AttachmentId':_0x12d0f8[_0xf1b4('0x5d')]['AttachmentId']});})[_0xf1b4('0x20')](function(_0xdeb709){_0x46a6f2[_0xf1b4('0x29')]=_0xdeb709;if(_0x46a6f2[_0xf1b4('0x91')]['UserId']){return db[_0xf1b4('0x99')][_0xf1b4('0x5b')]({'attributes':['id','name'],'where':{'id':_0x46a6f2[_0xf1b4('0x91')][_0xf1b4('0x9a')]}})['then'](function(_0x49dfcb){if(_0x49dfcb){_0x46a6f2[_0xf1b4('0x81')][_0xf1b4('0x9b')]({'id':0x0,'priority':0x0,'app':_0xf1b4('0x9c'),'appdata':_0x49dfcb[_0xf1b4('0x37')]+','+(_0x46a6f2[_0xf1b4('0x80')][_0xf1b4('0x9d')]||0xa),'interval':_0xf1b4('0x97')});_0x46a6f2[_0xf1b4('0x9e')]=![];}return respondWithRpcPromise('Start','startRouting',_0x46a6f2);});}return respondWithRpcPromise(_0xf1b4('0x9f'),_0xf1b4('0xa0'),_0x46a6f2);})[_0xf1b4('0x20')](function(_0x5cde49){respondWithRpcPromise('EventManager','EventManager',{'event':_0xf1b4('0xa1'),'message':_0x5cde49},client9002);return _0x5cde49;})['then'](respondWithResult(_0x28bef2,null))[_0xf1b4('0x2a')](handleError(_0x28bef2,null));};exports[_0xf1b4('0xa2')]=function(_0x132cdc,_0x4f7585,_0x33888c){return db[_0xf1b4('0x3b')][_0xf1b4('0x6e')]({'where':{'id':_0x132cdc[_0xf1b4('0x59')]['id']}})[_0xf1b4('0x20')](handleEntityNotFound(_0x4f7585,null))[_0xf1b4('0x20')](function(_0x3ca1a8){if(_0x3ca1a8){return db[_0xf1b4('0xa3')][_0xf1b4('0xa4')](function(_0x36cdc1){return db[_0xf1b4('0xa5')][_0xf1b4('0x32')]({'where':{'OpenchannelAccountId':_0x132cdc[_0xf1b4('0x59')]['id']},'transaction':_0x36cdc1})[_0xf1b4('0x20')](function(_0x1c3df4){var _0x356b43=_[_0xf1b4('0x3f')](_0x132cdc['body'],function(_0x259bef){_0x259bef[_0xf1b4('0x69')]=_0x132cdc[_0xf1b4('0x59')]['id'];return _0x259bef;});return db[_0xf1b4('0xa5')][_0xf1b4('0xa6')](_0x356b43,{'transaction':_0x36cdc1});});})[_0xf1b4('0x20')](function(){return db[_0xf1b4('0xa5')]['findAndCountAll']({'where':{'OpenchannelAccountId':_0x132cdc['params']['id']},'order':'priority'});});}})[_0xf1b4('0x20')](respondWithResult(_0x4f7585,null))[_0xf1b4('0x2a')](handleError(_0x4f7585,null));};exports['getApplications']=function(_0x21179b,_0x338ac1,_0x139198){var _0xb6fa3a={};var _0x5363da={};var _0x757a27;var _0xe383cd;return db[_0xf1b4('0x3b')]['findOne']({'where':{'id':_0x21179b[_0xf1b4('0x59')]['id']}})[_0xf1b4('0x20')](handleEntityNotFound(_0x338ac1,null))['then'](function(_0x29e019){if(_0x29e019){_0x757a27=_0x29e019;_0x5363da[_0xf1b4('0x45')]=_[_0xf1b4('0x41')](db[_0xf1b4('0xa5')][_0xf1b4('0x3c')]);_0x5363da[_0xf1b4('0x40')]=_[_0xf1b4('0x41')](_0x21179b[_0xf1b4('0x40')]);_0x5363da[_0xf1b4('0x42')]=_['intersection'](_0x5363da[_0xf1b4('0x45')],_0x5363da[_0xf1b4('0x40')]);_0xb6fa3a[_0xf1b4('0x44')]=_[_0xf1b4('0x43')](_0x5363da[_0xf1b4('0x45')],qs['fields'](_0x21179b[_0xf1b4('0x40')]['fields']));_0xb6fa3a['attributes']=_0xb6fa3a[_0xf1b4('0x44')]['length']?_0xb6fa3a[_0xf1b4('0x44')]:_0x5363da[_0xf1b4('0x45')];_0xb6fa3a[_0xf1b4('0x4a')]=qs[_0xf1b4('0x4b')](_0x21179b[_0xf1b4('0x40')][_0xf1b4('0x4b')]);_0xb6fa3a[_0xf1b4('0x4c')]=qs[_0xf1b4('0x42')](_[_0xf1b4('0x4d')](_0x21179b[_0xf1b4('0x40')],_0x5363da['filters']));if(_0x21179b[_0xf1b4('0x40')][_0xf1b4('0x4e')]){_0xb6fa3a[_0xf1b4('0x4c')]=_[_0xf1b4('0x4f')](_0xb6fa3a[_0xf1b4('0x4c')],{'$or':_[_0xf1b4('0x3f')](_0xb6fa3a['attributes'],function(_0x1a72b4){var _0x5131f1={};_0x5131f1[_0x1a72b4]={'$like':'%'+_0x21179b[_0xf1b4('0x40')][_0xf1b4('0x4e')]+'%'};return _0x5131f1;})});}_0xb6fa3a=_[_0xf1b4('0x4f')]({},_0xb6fa3a,_0x21179b[_0xf1b4('0x52')]);return _0x757a27[_0xf1b4('0xa7')](_0xb6fa3a);}})[_0xf1b4('0x20')](function(_0x12950a){if(_0x12950a){_0xe383cd=_0x12950a[_0xf1b4('0x5a')];if(!_0x21179b[_0xf1b4('0x40')][_0xf1b4('0x47')](_0xf1b4('0x48'))){_0xb6fa3a[_0xf1b4('0x49')]=qs[_0xf1b4('0x49')](_0x21179b[_0xf1b4('0x40')][_0xf1b4('0x49')]);_0xb6fa3a[_0xf1b4('0x2d')]=qs[_0xf1b4('0x2d')](_0x21179b[_0xf1b4('0x40')][_0xf1b4('0x2d')]);}return _0x757a27[_0xf1b4('0xa7')](_0xb6fa3a);}})[_0xf1b4('0x20')](function(_0x440e1b){if(_0x440e1b){return _0x440e1b?{'count':_0xe383cd,'rows':_0x440e1b}:null;}})[_0xf1b4('0x20')](respondWithResult(_0x338ac1,null))[_0xf1b4('0x2a')](handleError(_0x338ac1,null));};exports[_0xf1b4('0xa8')]=function(_0x1bd6d3,_0x3b08ee,_0x65417e){var _0x3267fc={'raw':![],'where':{}};var _0xde697e={};var _0x2691e3={'count':0x0,'rows':[]};return db[_0xf1b4('0x3b')][_0xf1b4('0x6e')]({'where':{'id':_0x1bd6d3[_0xf1b4('0x59')]['id']}})['then'](handleEntityNotFound(_0x3b08ee,null))[_0xf1b4('0x20')](function(_0x1e2fd6){if(_0x1e2fd6){_0xde697e[_0xf1b4('0x45')]=_[_0xf1b4('0x41')](db[_0xf1b4('0x8b')][_0xf1b4('0x3c')]);_0xde697e[_0xf1b4('0x40')]=_[_0xf1b4('0x41')](_0x1bd6d3['query']);_0xde697e[_0xf1b4('0x42')]=_[_0xf1b4('0x43')](_0xde697e[_0xf1b4('0x45')],_0xde697e[_0xf1b4('0x40')]);_0x3267fc[_0xf1b4('0x44')]=_['intersection'](_0xde697e['model'],qs[_0xf1b4('0x46')](_0x1bd6d3[_0xf1b4('0x40')][_0xf1b4('0x46')]));_0x3267fc[_0xf1b4('0x44')]=_0x3267fc[_0xf1b4('0x44')][_0xf1b4('0x5a')]?_0x3267fc[_0xf1b4('0x44')]:_0xde697e[_0xf1b4('0x45')];if(!_0x1bd6d3['query'][_0xf1b4('0x47')](_0xf1b4('0x48'))){_0x3267fc[_0xf1b4('0x49')]=qs[_0xf1b4('0x49')](_0x1bd6d3[_0xf1b4('0x40')]['limit']);_0x3267fc[_0xf1b4('0x2d')]=qs[_0xf1b4('0x2d')](_0x1bd6d3[_0xf1b4('0x40')][_0xf1b4('0x2d')]);}_0x3267fc['order']=qs[_0xf1b4('0x4b')](_0x1bd6d3[_0xf1b4('0x40')][_0xf1b4('0x4b')]);_0x3267fc[_0xf1b4('0x4c')]=qs['filters'](_[_0xf1b4('0x4d')](_0x1bd6d3[_0xf1b4('0x40')],_0xde697e['filters']));_0x3267fc[_0xf1b4('0x4c')][_0xf1b4('0x69')]=_0x1e2fd6['id'];if(_0x1bd6d3[_0xf1b4('0x40')]['filter']){_0x3267fc['where']=_['merge'](_0x3267fc['where'],{'$or':_[_0xf1b4('0x3f')](_0x3267fc['attributes'],function(_0x3827f4){var _0x4313b7={};_0x4313b7[_0x3827f4]={'$like':'%'+_0x1bd6d3[_0xf1b4('0x40')][_0xf1b4('0x4e')]+'%'};return _0x4313b7;})});}_0x3267fc=_[_0xf1b4('0x4f')]({},_0x3267fc,_0x1bd6d3['options']);return db[_0xf1b4('0x8b')][_0xf1b4('0x53')]({'where':_0x3267fc[_0xf1b4('0x4c')]})['then'](function(_0x1af78a){_0x2691e3[_0xf1b4('0x53')]=_0x1af78a;if(_0x1bd6d3[_0xf1b4('0x40')][_0xf1b4('0x54')]){_0x3267fc[_0xf1b4('0x55')]=[{'model':db['CmContact'],'as':_0xf1b4('0xa9'),'required':![]},{'model':db[_0xf1b4('0x99')],'as':_0xf1b4('0xaa'),'attributes':[_0xf1b4('0x37'),'fullname',_0xf1b4('0xab')],'required':![]},{'model':db[_0xf1b4('0xac')],'as':_0xf1b4('0xad'),'attributes':['id',_0xf1b4('0x37'),_0xf1b4('0xae')],'where':_0x1bd6d3[_0xf1b4('0x40')][_0xf1b4('0xaf')]?{'id':_0x1bd6d3[_0xf1b4('0x40')][_0xf1b4('0xaf')]}:undefined,'required':_0x1bd6d3['query'][_0xf1b4('0xaf')]?!![]:![]}];}return db[_0xf1b4('0x8b')][_0xf1b4('0x56')](_0x3267fc);})[_0xf1b4('0x20')](function(_0x53a5fa){_0x2691e3[_0xf1b4('0x57')]=_0x53a5fa;return _0x2691e3;});}})['then'](respondWithFilteredResult(_0x3b08ee,_0x3267fc))[_0xf1b4('0x2a')](handleError(_0x3b08ee,null));};exports[_0xf1b4('0xb0')]=function(_0x5c9901,_0x536989,_0x4651c1){return db[_0xf1b4('0x3b')]['find']({'where':{'id':_0x5c9901[_0xf1b4('0x59')]['id']}})['then'](handleEntityNotFound(_0x536989,null))[_0xf1b4('0x20')](function(_0x57a592){if(_0x57a592){return _0x57a592[_0xf1b4('0xb0')](_0x5c9901['body'][_0xf1b4('0x6b')],_[_0xf1b4('0xb1')](_0x5c9901[_0xf1b4('0x5d')],[_0xf1b4('0x6b'),'id'])||{})[_0xf1b4('0x8c')](function(_0x21fe27){for(var _0x2db8fa=0x0;_0x2db8fa<_0x5c9901[_0xf1b4('0x5d')]['ids'][_0xf1b4('0x5a')];_0x2db8fa+=0x1){socket['emit']('userOpenchannelAccount:save',{'UserId':_0x5c9901['body'][_0xf1b4('0x6b')][_0x2db8fa],'OpenchannelAccountId':_0x5c9901[_0xf1b4('0x59')]['id']});}return _0x21fe27;});}})[_0xf1b4('0x20')](respondWithResult(_0x536989,null))[_0xf1b4('0x2a')](handleError(_0x536989,null));};exports[_0xf1b4('0xb2')]=function(_0x24e6d6,_0x13c9d9,_0x47f117){return db['OpenchannelAccount']['find']({'where':{'id':_0x24e6d6[_0xf1b4('0x59')]['id']}})[_0xf1b4('0x20')](handleEntityNotFound(_0x13c9d9,null))[_0xf1b4('0x20')](function(_0x2d5835){if(_0x2d5835){return _0x2d5835[_0xf1b4('0xb2')](_0x24e6d6[_0xf1b4('0x40')][_0xf1b4('0x6b')])[_0xf1b4('0x20')](function(){if(_[_0xf1b4('0xb3')](_0x24e6d6['query']['ids'])){for(var _0x372c2c=0x0;_0x372c2c<_0x24e6d6['query'][_0xf1b4('0x6b')][_0xf1b4('0x5a')];_0x372c2c+=0x1){socket['emit']('userOpenchannelAccount:remove',{'UserId':Number(_0x24e6d6[_0xf1b4('0x40')][_0xf1b4('0x6b')][_0x372c2c]),'OpenchannelAccountId':Number(_0x24e6d6['params']['id'])});}}else{socket['emit']('userOpenchannelAccount:remove',{'UserId':Number(_0x24e6d6[_0xf1b4('0x40')]['ids']),'OpenchannelAccountId':Number(_0x24e6d6[_0xf1b4('0x59')]['id'])});}});}})[_0xf1b4('0x20')](respondWithStatusCode(_0x13c9d9,null))[_0xf1b4('0x2a')](handleError(_0x13c9d9,null));};exports[_0xf1b4('0xb4')]=function(_0x5affe7,_0x3d3343,_0x453781){var _0x27a3be={};var _0x5a82ba={};var _0x1f9df3;var _0xcac601;return db['OpenchannelAccount'][_0xf1b4('0x6e')]({'where':{'id':_0x5affe7[_0xf1b4('0x59')]['id']}})[_0xf1b4('0x20')](handleEntityNotFound(_0x3d3343,null))[_0xf1b4('0x20')](function(_0x59b955){if(_0x59b955){_0x1f9df3=_0x59b955;_0x5a82ba['model']=_[_0xf1b4('0x41')](db[_0xf1b4('0x99')]['rawAttributes']);_0x5a82ba[_0xf1b4('0x40')]=_[_0xf1b4('0x41')](_0x5affe7[_0xf1b4('0x40')]);_0x5a82ba[_0xf1b4('0x42')]=_['intersection'](_0x5a82ba['model'],_0x5a82ba['query']);_0x27a3be[_0xf1b4('0x44')]=_[_0xf1b4('0x43')](_0x5a82ba[_0xf1b4('0x45')],qs[_0xf1b4('0x46')](_0x5affe7[_0xf1b4('0x40')]['fields']));_0x27a3be[_0xf1b4('0x44')]=_0x27a3be[_0xf1b4('0x44')][_0xf1b4('0x5a')]?_0x27a3be[_0xf1b4('0x44')]:_0x5a82ba[_0xf1b4('0x45')];_0x27a3be[_0xf1b4('0x4a')]=qs['sort'](_0x5affe7[_0xf1b4('0x40')][_0xf1b4('0x4b')]);_0x27a3be[_0xf1b4('0x4c')]=qs[_0xf1b4('0x42')](_[_0xf1b4('0x4d')](_0x5affe7['query'],_0x5a82ba[_0xf1b4('0x42')]));if(_0x5affe7[_0xf1b4('0x40')]['filter']){_0x27a3be[_0xf1b4('0x4c')]=_['merge'](_0x27a3be[_0xf1b4('0x4c')],{'$or':_[_0xf1b4('0x3f')](_0x27a3be[_0xf1b4('0x44')],function(_0x554236){var _0x15fdfc={};_0x15fdfc[_0x554236]={'$like':'%'+_0x5affe7['query'][_0xf1b4('0x4e')]+'%'};return _0x15fdfc;})});}_0x27a3be=_['merge']({},_0x27a3be,_0x5affe7[_0xf1b4('0x52')]);return _0x1f9df3['getAgents'](_0x27a3be);}})[_0xf1b4('0x20')](function(_0x5e66f9){if(_0x5e66f9){_0xcac601=_0x5e66f9[_0xf1b4('0x5a')];if(!_0x5affe7[_0xf1b4('0x40')][_0xf1b4('0x47')](_0xf1b4('0x48'))){_0x27a3be[_0xf1b4('0x49')]=qs[_0xf1b4('0x49')](_0x5affe7[_0xf1b4('0x40')]['limit']);_0x27a3be[_0xf1b4('0x2d')]=qs['offset'](_0x5affe7[_0xf1b4('0x40')][_0xf1b4('0x2d')]);}return _0x1f9df3[_0xf1b4('0xb4')](_0x27a3be);}})[_0xf1b4('0x20')](function(_0x1045e8){if(_0x1045e8){return _0x1045e8?{'count':_0xcac601,'rows':_0x1045e8}:null;}})[_0xf1b4('0x20')](respondWithResult(_0x3d3343,null))[_0xf1b4('0x2a')](handleError(_0x3d3343,null));};exports[_0xf1b4('0xb5')]=function(_0x9f43c3,_0x256f91,_0x4ae317){var _0x473719,_0x178334,_0x265011;if(_[_0xf1b4('0x77')](_0x9f43c3[_0xf1b4('0x5d')][_0xf1b4('0x5d')])||_0x9f43c3[_0xf1b4('0x5d')][_0xf1b4('0x5d')]===''){throw new db[(_0xf1b4('0x1d'))][(_0xf1b4('0x71'))](_0xf1b4('0x78'));}if(_[_0xf1b4('0x77')](_0x9f43c3[_0xf1b4('0x5d')]['to'])){}_0x473719=_0x9f43c3[_0xf1b4('0x5d')]['to'];return db[_0xf1b4('0x3b')][_0xf1b4('0x6e')]({'where':{'id':_0x9f43c3[_0xf1b4('0x59')]['id']}})[_0xf1b4('0x20')](handleEntityNotFound(_0x256f91,null))[_0xf1b4('0x20')](function(_0x500401){if(_0x500401){return db[_0xf1b4('0x3b')]['find']({'where':{'id':_0x500401['id']},'include':[{'model':db[_0xf1b4('0x7c')],'as':_0xf1b4('0x7d'),'include':[{'model':db[_0xf1b4('0x89')],'as':_0xf1b4('0x7e'),'where':{[_0x500401[_0xf1b4('0x79')]]:_0x473719},'limit':0x1,'order':[['updatedAt',_0xf1b4('0x7f')]]}]}]})[_0xf1b4('0x20')](handleEntityNotFound(_0x256f91,null))['then'](function(_0x96dd6a){if(_0x96dd6a&&_0x96dd6a[_0xf1b4('0x7d')]){_0x178334=_0x96dd6a['get']({'plain':!![]});if(_0x178334[_0xf1b4('0x7d')]&&_0x178334[_0xf1b4('0x7d')][_0xf1b4('0x7e')][_0xf1b4('0x5a')]){return _0x178334[_0xf1b4('0x7d')][_0xf1b4('0x7e')][0x0];}return db[_0xf1b4('0x89')][_0xf1b4('0x5c')](_[_0xf1b4('0x87')](_0x9f43c3[_0xf1b4('0x5d')],{'firstName':_0x473719,[_0x96dd6a[_0xf1b4('0x79')]]:_0x473719,'phone':_0x473719,'ListId':_0x178334['ListId']}));}})[_0xf1b4('0x20')](handleEntityNotFound(_0x256f91,null))[_0xf1b4('0x20')](function(_0x510d43){if(_0x510d43){_0x265011=_0x510d43;return db[_0xf1b4('0x8b')][_0xf1b4('0x5b')]({'where':{'ContactId':_0x265011['id'],'closed':![],'OpenchannelAccountId':_0x178334['id']}})[_0xf1b4('0x20')](function(_0x5150e4){if(_0x5150e4){return[_0x5150e4,![]];}return db['OpenchannelInteraction'][_0xf1b4('0x5c')]({'UserId':_0x9f43c3[_0xf1b4('0x5e')]['id'],'ContactId':_0x265011['id'],'OpenchannelAccountId':_0x178334['id'],'lastMsgDirection':_0xf1b4('0xb6'),'Messages':[_['merge'](_0x9f43c3[_0xf1b4('0x5d')],{'read':![],'body':_0x9f43c3[_0xf1b4('0x5d')][_0xf1b4('0x5d')],'OpenchannelAccountId':_0x178334['id'],'UserId':_0x9f43c3[_0xf1b4('0x5e')]['id'],'ContactId':_0x265011['id']})]},{'include':[{'model':db[_0xf1b4('0x98')],'as':_0xf1b4('0xb7')}]})[_0xf1b4('0x20')](function(_0x142166){return[_0x142166,!![]];});});}})['spread'](function(_0x4df0d3,_0x374493){if(_0x374493){return _0x4df0d3;}return db['OpenchannelMessage'][_0xf1b4('0x5c')](_['merge'](_0x9f43c3['body'],{'read':![],'body':_0x9f43c3[_0xf1b4('0x5d')]['body'],'OpenchannelAccountId':_0x178334['id'],'OpenchannelInteractionId':_0x4df0d3['id'],'UserId':_0x9f43c3[_0xf1b4('0x5e')]['id'],'ContactId':_0x265011['id']}))[_0xf1b4('0x20')](function(_0x52556b){_0x4df0d3[_0xf1b4('0xb8')][_0xf1b4('0xb7')]=[];_0x4df0d3[_0xf1b4('0xb8')][_0xf1b4('0xb7')]['push'](_0x52556b[_0xf1b4('0xb8')]);return _0x4df0d3;});});}})[_0xf1b4('0x20')](respondWithResult(_0x256f91,null))['catch'](handleError(_0x256f91,null));};
\ No newline at end of file
diff --git a/server/api/openchannelAccount/openchannelAccount.events.js b/server/api/openchannelAccount/openchannelAccount.events.js
index 882a439..6beedb8 100644
--- a/server/api/openchannelAccount/openchannelAccount.events.js
+++ b/server/api/openchannelAccount/openchannelAccount.events.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xb489=['remove','emit','hasOwnProperty','hook','events','OpenchannelAccount','setMaxListeners','save','update'];(function(_0x559add,_0x153177){var _0x1892af=function(_0xc1f90e){while(--_0xc1f90e){_0x559add['push'](_0x559add['shift']());}};_0x1892af(++_0x153177);}(_0xb489,0x1ab));var _0x9b48=function(_0x2561b7,_0x7ad9c2){_0x2561b7=_0x2561b7-0x0;var _0x4b7f8c=_0xb489[_0x2561b7];return _0x4b7f8c;};'use strict';var EventEmitter=require(_0x9b48('0x0'));var OpenchannelAccount=require('../../mysqldb')['db'][_0x9b48('0x1')];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents[_0x9b48('0x2')](0x0);var events={'afterCreate':_0x9b48('0x3'),'afterUpdate':_0x9b48('0x4'),'afterDestroy':_0x9b48('0x5')};function emitEvent(_0x24aa9e){return function(_0x2e010a,_0x4a89be,_0x4390b4){OpenchannelAccountEvents[_0x9b48('0x6')](_0x24aa9e+':'+_0x2e010a['id'],_0x2e010a);OpenchannelAccountEvents[_0x9b48('0x6')](_0x24aa9e,_0x2e010a);_0x4390b4(null);};}for(var e in events){if(events[_0x9b48('0x7')](e)){var event=events[e];OpenchannelAccount[_0x9b48('0x8')](e,emitEvent(event));}}module['exports']=OpenchannelAccountEvents;
\ No newline at end of file
+var _0x222d=['update','emit','hook','exports','../../mysqldb','OpenchannelAccount','setMaxListeners','save'];(function(_0x4dab14,_0x164ea0){var _0xf41aa=function(_0x305d50){while(--_0x305d50){_0x4dab14['push'](_0x4dab14['shift']());}};_0xf41aa(++_0x164ea0);}(_0x222d,0x194));var _0xd222=function(_0x221886,_0x770a04){_0x221886=_0x221886-0x0;var _0x4b3608=_0x222d[_0x221886];return _0x4b3608;};'use strict';var EventEmitter=require('events');var OpenchannelAccount=require(_0xd222('0x0'))['db'][_0xd222('0x1')];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents[_0xd222('0x2')](0x0);var events={'afterCreate':_0xd222('0x3'),'afterUpdate':_0xd222('0x4'),'afterDestroy':'remove'};function emitEvent(_0x4eb246){return function(_0x350709,_0x4f93af,_0x141884){OpenchannelAccountEvents[_0xd222('0x5')](_0x4eb246+':'+_0x350709['id'],_0x350709);OpenchannelAccountEvents['emit'](_0x4eb246,_0x350709);_0x141884(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelAccount[_0xd222('0x6')](e,emitEvent(event));}}module[_0xd222('0x7')]=OpenchannelAccountEvents;
\ No newline at end of file
diff --git a/server/api/openchannelAccount/openchannelAccount.model.js b/server/api/openchannelAccount/openchannelAccount.model.js
index ecd42fd..d47bf1f 100644
--- a/server/api/openchannelAccount/openchannelAccount.model.js
+++ b/server/api/openchannelAccount/openchannelAccount.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x2fe2=['moment','bluebird','request-promise','path','rimraf','./openchannelAccount.attributes','exports','define','openchannel_accounts','lodash','util','../../config/logger','api'];(function(_0x512c45,_0x36f294){var _0x53de78=function(_0x4382b7){while(--_0x4382b7){_0x512c45['push'](_0x512c45['shift']());}};_0x53de78(++_0x36f294);}(_0x2fe2,0x182));var _0x22fe=function(_0x1b409c,_0x1f91d1){_0x1b409c=_0x1b409c-0x0;var _0x203587=_0x2fe2[_0x1b409c];return _0x203587;};'use strict';var _=require(_0x22fe('0x0'));var util=require(_0x22fe('0x1'));var logger=require(_0x22fe('0x2'))(_0x22fe('0x3'));var moment=require(_0x22fe('0x4'));var BPromise=require(_0x22fe('0x5'));var rp=require(_0x22fe('0x6'));var fs=require('fs');var path=require(_0x22fe('0x7'));var rimraf=require(_0x22fe('0x8'));var config=require('../../config/environment');var attributes=require(_0x22fe('0x9'));module[_0x22fe('0xa')]=function(_0xb63c49,_0x3cae2e){return _0xb63c49[_0x22fe('0xb')]('OpenchannelAccount',attributes,{'tableName':_0x22fe('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xb341=['OpenchannelAccount','openchannel_accounts','lodash','util','../../config/logger','request-promise','path','rimraf','./openchannelAccount.attributes','exports','define'];(function(_0x533f7b,_0x4f832c){var _0x1fecc1=function(_0x2f2845){while(--_0x2f2845){_0x533f7b['push'](_0x533f7b['shift']());}};_0x1fecc1(++_0x4f832c);}(_0xb341,0xbd));var _0x1b34=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xb341[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x1b34('0x0'));var util=require(_0x1b34('0x1'));var logger=require(_0x1b34('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x1b34('0x3'));var fs=require('fs');var path=require(_0x1b34('0x4'));var rimraf=require(_0x1b34('0x5'));var config=require('../../config/environment');var attributes=require(_0x1b34('0x6'));module[_0x1b34('0x7')]=function(_0x43eab3,_0x50df0c){return _0x43eab3[_0x1b34('0x8')](_0x1b34('0x9'),attributes,{'tableName':_0x1b34('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/openchannelAccount/openchannelAccount.rpc.js b/server/api/openchannelAccount/openchannelAccount.rpc.js
index 2ae3700..1135400 100644
--- a/server/api/openchannelAccount/openchannelAccount.rpc.js
+++ b/server/api/openchannelAccount/openchannelAccount.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7319=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','./openchannelAccount.socket','register','then','info','request\x20sent','debug','stringify','error','code','OpenchannelAccount,\x20%s,\x20%s','message','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x22a5b7,_0x30e535){var _0x5f41bb=function(_0x30a656){while(--_0x30a656){_0x22a5b7['push'](_0x22a5b7['shift']());}};_0x5f41bb(++_0x30e535);}(_0x7319,0x12e));var _0x9731=function(_0x2456a0,_0x48d0dc){_0x2456a0=_0x2456a0-0x0;var _0xe0472e=_0x7319[_0x2456a0];return _0xe0472e;};'use strict';var _=require(_0x9731('0x0'));var util=require(_0x9731('0x1'));var moment=require('moment');var BPromise=require(_0x9731('0x2'));var rs=require(_0x9731('0x3'));var fs=require('fs');var Redis=require(_0x9731('0x4'));var db=require(_0x9731('0x5'))['db'];var utils=require(_0x9731('0x6'));var logger=require(_0x9731('0x7'))(_0x9731('0x8'));var config=require(_0x9731('0x9'));var jayson=require(_0x9731('0xa'));var client=jayson[_0x9731('0xb')][_0x9731('0xc')]({'port':0x232a});config[_0x9731('0xd')]=_[_0x9731('0xe')](config[_0x9731('0xd')],{'host':'localhost','port':0x18eb});var socket=require(_0x9731('0xf'))(new Redis(config['redis']));require(_0x9731('0x10'))[_0x9731('0x11')](socket);function respondWithRpcPromise(_0x11c0b0,_0x57c8d9,_0xe5a96b){return new BPromise(function(_0x5ca640,_0x1da6e1){return client['request'](_0x11c0b0,_0xe5a96b)[_0x9731('0x12')](function(_0x49337d){logger[_0x9731('0x13')]('OpenchannelAccount,\x20%s,\x20%s',_0x57c8d9,_0x9731('0x14'));logger[_0x9731('0x15')]('OpenchannelAccount,\x20%s,\x20%s,\x20%s',_0x57c8d9,_0x9731('0x14'),JSON[_0x9731('0x16')](_0x49337d));if(_0x49337d[_0x9731('0x17')]){if(_0x49337d[_0x9731('0x17')][_0x9731('0x18')]===0x1f4){logger[_0x9731('0x17')](_0x9731('0x19'),_0x57c8d9,_0x49337d[_0x9731('0x17')]['message']);return _0x1da6e1(_0x49337d[_0x9731('0x17')][_0x9731('0x1a')]);}logger[_0x9731('0x17')](_0x9731('0x19'),_0x57c8d9,_0x49337d['error'][_0x9731('0x1a')]);return _0x5ca640(_0x49337d[_0x9731('0x17')][_0x9731('0x1a')]);}else{logger['info'](_0x9731('0x19'),_0x57c8d9,_0x9731('0x14'));_0x5ca640(_0x49337d['result']['message']);}})[_0x9731('0x1b')](function(_0xa55b41){logger[_0x9731('0x17')](_0x9731('0x19'),_0x57c8d9,_0xa55b41);_0x1da6e1(_0xa55b41);});});}
\ No newline at end of file
+var _0xdbed=['http','redis','localhost','register','then','info','request\x20sent','stringify','error','code','message','OpenchannelAccount,\x20%s,\x20%s','lodash','util','moment','bluebird','randomstring','../../mysqldb','rpc','../../config/environment','jayson/promise','client'];(function(_0xdca9f6,_0x31447d){var _0x38750c=function(_0x4cddd7){while(--_0x4cddd7){_0xdca9f6['push'](_0xdca9f6['shift']());}};_0x38750c(++_0x31447d);}(_0xdbed,0xbc));var _0xddbe=function(_0x4ecf64,_0x225f73){_0x4ecf64=_0x4ecf64-0x0;var _0x3e8256=_0xdbed[_0x4ecf64];return _0x3e8256;};'use strict';var _=require(_0xddbe('0x0'));var util=require(_0xddbe('0x1'));var moment=require(_0xddbe('0x2'));var BPromise=require(_0xddbe('0x3'));var rs=require(_0xddbe('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xddbe('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xddbe('0x6'));var config=require(_0xddbe('0x7'));var jayson=require(_0xddbe('0x8'));var client=jayson[_0xddbe('0x9')][_0xddbe('0xa')]({'port':0x232a});config[_0xddbe('0xb')]=_['defaults'](config['redis'],{'host':_0xddbe('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./openchannelAccount.socket')[_0xddbe('0xd')](socket);function respondWithRpcPromise(_0xd39689,_0x93ccb5,_0xeee3e5){return new BPromise(function(_0x1063df,_0x3b245f){return client['request'](_0xd39689,_0xeee3e5)[_0xddbe('0xe')](function(_0x5eec60){logger[_0xddbe('0xf')]('OpenchannelAccount,\x20%s,\x20%s',_0x93ccb5,_0xddbe('0x10'));logger['debug']('OpenchannelAccount,\x20%s,\x20%s,\x20%s',_0x93ccb5,_0xddbe('0x10'),JSON[_0xddbe('0x11')](_0x5eec60));if(_0x5eec60[_0xddbe('0x12')]){if(_0x5eec60[_0xddbe('0x12')][_0xddbe('0x13')]===0x1f4){logger[_0xddbe('0x12')]('OpenchannelAccount,\x20%s,\x20%s',_0x93ccb5,_0x5eec60[_0xddbe('0x12')][_0xddbe('0x14')]);return _0x3b245f(_0x5eec60[_0xddbe('0x12')]['message']);}logger['error'](_0xddbe('0x15'),_0x93ccb5,_0x5eec60[_0xddbe('0x12')][_0xddbe('0x14')]);return _0x1063df(_0x5eec60[_0xddbe('0x12')][_0xddbe('0x14')]);}else{logger[_0xddbe('0xf')]('OpenchannelAccount,\x20%s,\x20%s',_0x93ccb5,'request\x20sent');_0x1063df(_0x5eec60['result']['message']);}})['catch'](function(_0x3d7ddb){logger[_0xddbe('0x12')](_0xddbe('0x15'),_0x93ccb5,_0x3d7ddb);_0x3b245f(_0x3d7ddb);});});}
\ No newline at end of file
diff --git a/server/api/openchannelAccount/openchannelAccount.socket.js b/server/api/openchannelAccount/openchannelAccount.socket.js
index 700ec54..261c4d7 100644
--- a/server/api/openchannelAccount/openchannelAccount.socket.js
+++ b/server/api/openchannelAccount/openchannelAccount.socket.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x6768=['remove','update','emit','removeListener','register','length','openchannelAccount:','save'];(function(_0x3ca7a1,_0x5ed7ac){var _0x529e3d=function(_0x4af657){while(--_0x4af657){_0x3ca7a1['push'](_0x3ca7a1['shift']());}};_0x529e3d(++_0x5ed7ac);}(_0x6768,0x1cf));var _0x8676=function(_0x550a61,_0x1c5d8c){_0x550a61=_0x550a61-0x0;var _0x248bfc=_0x6768[_0x550a61];return _0x248bfc;};'use strict';var OpenchannelAccountEvents=require('./openchannelAccount.events');var events=[_0x8676('0x0'),_0x8676('0x1'),_0x8676('0x2')];function createListener(_0x190201,_0x266671){return function(_0x4f5fd2){_0x266671[_0x8676('0x3')](_0x190201,_0x4f5fd2);};}function removeListener(_0x2d802c,_0x4e622f){return function(){OpenchannelAccountEvents[_0x8676('0x4')](_0x2d802c,_0x4e622f);};}exports[_0x8676('0x5')]=function(_0x300f95){for(var _0x5ae44d=0x0,_0x596961=events[_0x8676('0x6')];_0x5ae44d<_0x596961;_0x5ae44d++){var _0x3278c8=events[_0x5ae44d];var _0xf9d2e1=createListener(_0x8676('0x7')+_0x3278c8,_0x300f95);OpenchannelAccountEvents['on'](_0x3278c8,_0xf9d2e1);}};
\ No newline at end of file
+var _0x46d5=['./openchannelAccount.events','save','remove','emit','removeListener','length','openchannelAccount:'];(function(_0x13f6fc,_0x40f9f3){var _0xe8d550=function(_0x4e07ce){while(--_0x4e07ce){_0x13f6fc['push'](_0x13f6fc['shift']());}};_0xe8d550(++_0x40f9f3);}(_0x46d5,0x1c0));var _0x546d=function(_0x53ccf2,_0x13cb67){_0x53ccf2=_0x53ccf2-0x0;var _0x5a2964=_0x46d5[_0x53ccf2];return _0x5a2964;};'use strict';var OpenchannelAccountEvents=require(_0x546d('0x0'));var events=[_0x546d('0x1'),_0x546d('0x2'),'update'];function createListener(_0x266153,_0x7d9ae8){return function(_0x8d736c){_0x7d9ae8[_0x546d('0x3')](_0x266153,_0x8d736c);};}function removeListener(_0x35df41,_0x1cb08d){return function(){OpenchannelAccountEvents[_0x546d('0x4')](_0x35df41,_0x1cb08d);};}exports['register']=function(_0x15dfe7){for(var _0x1ff4ca=0x0,_0x513ca6=events[_0x546d('0x5')];_0x1ff4ca<_0x513ca6;_0x1ff4ca++){var _0x5495e9=events[_0x1ff4ca];var _0x53cbe7=createListener(_0x546d('0x6')+_0x5495e9,_0x15dfe7);OpenchannelAccountEvents['on'](_0x5495e9,_0x53cbe7);}};
\ No newline at end of file
diff --git a/server/api/openchannelApplication/index.js b/server/api/openchannelApplication/index.js
index 2c1abda..8c910de 100644
--- a/server/api/openchannelApplication/index.js
+++ b/server/api/openchannelApplication/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xe792=['index','/:id','show','put','update','delete','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelApplication.controller','isAuthenticated'];(function(_0x2c6a5a,_0x4773bd){var _0x564ef8=function(_0x34fbb3){while(--_0x34fbb3){_0x2c6a5a['push'](_0x2c6a5a['shift']());}};_0x564ef8(++_0x4773bd);}(_0xe792,0x1b0));var _0x2e79=function(_0x6687f,_0x386ee1){_0x6687f=_0x6687f-0x0;var _0x236047=_0xe792[_0x6687f];return _0x236047;};'use strict';var multer=require(_0x2e79('0x0'));var util=require(_0x2e79('0x1'));var path=require(_0x2e79('0x2'));var timeout=require('connect-timeout');var express=require(_0x2e79('0x3'));var router=express[_0x2e79('0x4')]();var auth=require(_0x2e79('0x5'));var interaction=require(_0x2e79('0x6'));var config=require(_0x2e79('0x7'));var controller=require(_0x2e79('0x8'));router['get']('/',auth[_0x2e79('0x9')](),controller[_0x2e79('0xa')]);router['get'](_0x2e79('0xb'),auth[_0x2e79('0x9')](),controller[_0x2e79('0xc')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x2e79('0xd')](_0x2e79('0xb'),auth[_0x2e79('0x9')](),controller[_0x2e79('0xe')]);router[_0x2e79('0xf')]('/:id',auth[_0x2e79('0x9')](),controller['destroy']);module[_0x2e79('0x10')]=router;
\ No newline at end of file
+var _0xe2e1=['connect-timeout','express','Router','./openchannelApplication.controller','get','index','isAuthenticated','show','post','create','put','/:id','update','delete','exports','multer','util','path'];(function(_0x8c43de,_0x90ff31){var _0xa6591b=function(_0x469716){while(--_0x469716){_0x8c43de['push'](_0x8c43de['shift']());}};_0xa6591b(++_0x90ff31);}(_0xe2e1,0xd5));var _0x1e2e=function(_0x2dd969,_0x42c215){_0x2dd969=_0x2dd969-0x0;var _0x5902cb=_0xe2e1[_0x2dd969];return _0x5902cb;};'use strict';var multer=require(_0x1e2e('0x0'));var util=require(_0x1e2e('0x1'));var path=require(_0x1e2e('0x2'));var timeout=require(_0x1e2e('0x3'));var express=require(_0x1e2e('0x4'));var router=express[_0x1e2e('0x5')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x1e2e('0x6'));router[_0x1e2e('0x7')]('/',auth['isAuthenticated'](),controller[_0x1e2e('0x8')]);router[_0x1e2e('0x7')]('/:id',auth[_0x1e2e('0x9')](),controller[_0x1e2e('0xa')]);router[_0x1e2e('0xb')]('/',auth[_0x1e2e('0x9')](),controller[_0x1e2e('0xc')]);router[_0x1e2e('0xd')](_0x1e2e('0xe'),auth['isAuthenticated'](),controller[_0x1e2e('0xf')]);router[_0x1e2e('0x10')](_0x1e2e('0xe'),auth[_0x1e2e('0x9')](),controller['destroy']);module[_0x1e2e('0x11')]=router;
\ No newline at end of file
diff --git a/server/api/openchannelApplication/openchannelApplication.attributes.js b/server/api/openchannelApplication/openchannelApplication.attributes.js
index c4ceb96..66041b0 100644
--- a/server/api/openchannelApplication/openchannelApplication.attributes.js
+++ b/server/api/openchannelApplication/openchannelApplication.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7395=['STRING','*,*,*,*','sequelize','exports','INTEGER','noop','TEXT'];(function(_0xd1c39b,_0x16f0c6){var _0x58f5bc=function(_0x412cf3){while(--_0x412cf3){_0xd1c39b['push'](_0xd1c39b['shift']());}};_0x58f5bc(++_0x16f0c6);}(_0x7395,0x144));var _0x5739=function(_0x3f9de7,_0x46d870){_0x3f9de7=_0x3f9de7-0x0;var _0x1a6630=_0x7395[_0x3f9de7];return _0x1a6630;};'use strict';var Sequelize=require(_0x5739('0x0'));module[_0x5739('0x1')]={'priority':{'type':Sequelize[_0x5739('0x2')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x5739('0x3')},'appdata':{'type':Sequelize[_0x5739('0x4')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x5739('0x5')],'defaultValue':_0x5739('0x6')}};
\ No newline at end of file
+var _0x6313=['INTEGER','STRING','noop','TEXT','*,*,*,*','exports'];(function(_0x1753ae,_0x4bc78f){var _0x10f2e3=function(_0x641eb1){while(--_0x641eb1){_0x1753ae['push'](_0x1753ae['shift']());}};_0x10f2e3(++_0x4bc78f);}(_0x6313,0x167));var _0x3631=function(_0x5cdf85,_0x4f5610){_0x5cdf85=_0x5cdf85-0x0;var _0x109a19=_0x6313[_0x5cdf85];return _0x109a19;};'use strict';var Sequelize=require('sequelize');module[_0x3631('0x0')]={'priority':{'type':Sequelize[_0x3631('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0x3631('0x2')],'allowNull':![],'defaultValue':_0x3631('0x3')},'appdata':{'type':Sequelize[_0x3631('0x4')]()},'description':{'type':Sequelize[_0x3631('0x2')]},'interval':{'type':Sequelize[_0x3631('0x2')],'defaultValue':_0x3631('0x5')}};
\ No newline at end of file
diff --git a/server/api/openchannelApplication/openchannelApplication.controller.js b/server/api/openchannelApplication/openchannelApplication.controller.js
index fc0f9e0..fb31bcd 100644
--- a/server/api/openchannelApplication/openchannelApplication.controller.js
+++ b/server/api/openchannelApplication/openchannelApplication.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xf957=['querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','set','Content-Range','apply','reject','save','then','error','stack','name','map','OpenchannelApplication','rawAttributes','fieldName','type','key','model','query','keys','filters','fields','attributes','nolimit','limit','sort','where','pick','merge','VIRTUAL','filter','includeAll','include','findAll','catch','show','params','intersection','length','options','find','create','body','update','html-pdf','rimraf','zip-dir','request-promise','mustache','path','sox','to-csv','ejs','crypto','jsforce','desk.js'];(function(_0x474ced,_0xb25add){var _0x550265=function(_0x3203e4){while(--_0x3203e4){_0x474ced['push'](_0x474ced['shift']());}};_0x550265(++_0xb25add);}(_0xf957,0xc0));var _0x7f95=function(_0x32a656,_0x36adfd){_0x32a656=_0x32a656-0x0;var _0x1713fd=_0xf957[_0x32a656];return _0x1713fd;};'use strict';var pdf=require(_0x7f95('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x7f95('0x1'));var zipdir=require(_0x7f95('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7f95('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x7f95('0x4'));var util=require('util');var path=require(_0x7f95('0x5'));var sox=require(_0x7f95('0x6'));var csv=require(_0x7f95('0x7'));var ejs=require(_0x7f95('0x8'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x7f95('0x9'));var jsforce=require(_0x7f95('0xa'));var deskjs=require(_0x7f95('0xb'));var toCsv=require(_0x7f95('0x7'));var querystring=require(_0x7f95('0xc'));var Papa=require(_0x7f95('0xd'));var Redis=require('ioredis');var authService=require(_0x7f95('0xe'));var qs=require(_0x7f95('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x7f95('0x10'))(_0x7f95('0x11'));var utils=require('../../config/utils');var config=require(_0x7f95('0x12'));var db=require(_0x7f95('0x13'))['db'];function respondWithStatusCode(_0x5e5ae6,_0x16da68){_0x16da68=_0x16da68||0xcc;return function(_0x504416){if(_0x504416){return _0x5e5ae6[_0x7f95('0x14')](_0x16da68);}return _0x5e5ae6[_0x7f95('0x15')](_0x16da68)[_0x7f95('0x16')]();};}function respondWithResult(_0x29c7d5,_0x527d9c){_0x527d9c=_0x527d9c||0xc8;return function(_0x30091a){if(_0x30091a){return _0x29c7d5[_0x7f95('0x15')](_0x527d9c)[_0x7f95('0x17')](_0x30091a);}};}function respondWithFilteredResult(_0x102c9d,_0x2ffe14){return function(_0x31384e){if(_0x31384e){var _0x22ed5d=_0x31384e[_0x7f95('0x18')],_0x2b1444=_0x2ffe14[_0x7f95('0x19')],_0x279d01=_0x2ffe14[_0x7f95('0x19')]+_0x2ffe14['limit'],_0x110909;if(_0x279d01>=_0x22ed5d){_0x279d01=_0x22ed5d;_0x110909=0xc8;}else{_0x110909=0xce;}_0x102c9d['status'](_0x110909);return _0x102c9d[_0x7f95('0x1a')](_0x7f95('0x1b'),_0x2b1444+'-'+_0x279d01+'/'+_0x22ed5d)[_0x7f95('0x17')](_0x31384e);}return null;};}function patchUpdates(_0x21a617){return function(_0x2ac1fb){try{jsonpatch[_0x7f95('0x1c')](_0x2ac1fb,_0x21a617,!![]);}catch(_0x1b153b){return BPromise[_0x7f95('0x1d')](_0x1b153b);}return _0x2ac1fb[_0x7f95('0x1e')]();};}function saveUpdates(_0x144cfc,_0x53f68f){return function(_0x10fcc0){if(_0x10fcc0){return _0x10fcc0['update'](_0x144cfc)[_0x7f95('0x1f')](function(_0x383784){return _0x383784;});}return null;};}function removeEntity(_0x455867,_0x12f726){return function(_0x3c36fb){if(_0x3c36fb){return _0x3c36fb['destroy']()[_0x7f95('0x1f')](function(){_0x455867[_0x7f95('0x15')](0xcc)[_0x7f95('0x16')]();});}};}function handleEntityNotFound(_0x159b43,_0x430f1c){return function(_0x5004ba){if(!_0x5004ba){_0x159b43[_0x7f95('0x14')](0x194);}return _0x5004ba;};}function handleError(_0x5b4064,_0xd5d193){_0xd5d193=_0xd5d193||0x1f4;return function(_0x474f36){logger[_0x7f95('0x20')](_0x474f36[_0x7f95('0x21')]);if(_0x474f36[_0x7f95('0x22')]){delete _0x474f36[_0x7f95('0x22')];}_0x5b4064[_0x7f95('0x15')](_0xd5d193)['send'](_0x474f36);};}exports['index']=function(_0x185641,_0x2043b7){var _0x59cf45={},_0x1131aa={},_0x87ed3f={'count':0x0,'rows':[]};var _0x425247=_[_0x7f95('0x23')](db[_0x7f95('0x24')][_0x7f95('0x25')],function(_0x151b52){return{'name':_0x151b52[_0x7f95('0x26')],'type':_0x151b52[_0x7f95('0x27')][_0x7f95('0x28')]};});_0x1131aa[_0x7f95('0x29')]=_[_0x7f95('0x23')](_0x425247,'name');_0x1131aa[_0x7f95('0x2a')]=_[_0x7f95('0x2b')](_0x185641[_0x7f95('0x2a')]);_0x1131aa[_0x7f95('0x2c')]=_['intersection'](_0x1131aa[_0x7f95('0x29')],_0x1131aa['query']);_0x59cf45['attributes']=_['intersection'](_0x1131aa[_0x7f95('0x29')],qs[_0x7f95('0x2d')](_0x185641['query'][_0x7f95('0x2d')]));_0x59cf45['attributes']=_0x59cf45[_0x7f95('0x2e')]['length']?_0x59cf45[_0x7f95('0x2e')]:_0x1131aa['model'];if(!_0x185641[_0x7f95('0x2a')]['hasOwnProperty'](_0x7f95('0x2f'))){_0x59cf45[_0x7f95('0x30')]=qs[_0x7f95('0x30')](_0x185641[_0x7f95('0x2a')][_0x7f95('0x30')]);_0x59cf45[_0x7f95('0x19')]=qs[_0x7f95('0x19')](_0x185641[_0x7f95('0x2a')][_0x7f95('0x19')]);}_0x59cf45['order']=qs[_0x7f95('0x31')](_0x185641[_0x7f95('0x2a')][_0x7f95('0x31')]);_0x59cf45[_0x7f95('0x32')]=qs[_0x7f95('0x2c')](_[_0x7f95('0x33')](_0x185641[_0x7f95('0x2a')],_0x1131aa['filters']),_0x425247);if(_0x185641[_0x7f95('0x2a')]['filter']){_0x59cf45[_0x7f95('0x32')]=_[_0x7f95('0x34')](_0x59cf45[_0x7f95('0x32')],{'$or':_[_0x7f95('0x23')](_0x425247,function(_0xee1d1e){if(_0xee1d1e['type']!==_0x7f95('0x35')){var _0x20ac57={};_0x20ac57[_0xee1d1e[_0x7f95('0x22')]]={'$like':'%'+_0x185641[_0x7f95('0x2a')][_0x7f95('0x36')]+'%'};return _0x20ac57;}})});}_0x59cf45=_['merge']({},_0x59cf45,_0x185641['options']);var _0x313902={'where':_0x59cf45[_0x7f95('0x32')]};return db[_0x7f95('0x24')][_0x7f95('0x18')](_0x313902)[_0x7f95('0x1f')](function(_0x4835d5){_0x87ed3f[_0x7f95('0x18')]=_0x4835d5;if(_0x185641['query'][_0x7f95('0x37')]){_0x59cf45[_0x7f95('0x38')]=[{'all':!![]}];}return db[_0x7f95('0x24')][_0x7f95('0x39')](_0x59cf45);})['then'](function(_0x3e63eb){_0x87ed3f['rows']=_0x3e63eb;return _0x87ed3f;})[_0x7f95('0x1f')](respondWithFilteredResult(_0x2043b7,_0x59cf45))[_0x7f95('0x3a')](handleError(_0x2043b7,null));};exports[_0x7f95('0x3b')]=function(_0xbc308d,_0xda5386){var _0x27645e={'raw':!![],'where':{'id':_0xbc308d[_0x7f95('0x3c')]['id']}},_0x12fbde={};_0x12fbde['model']=_[_0x7f95('0x2b')](db[_0x7f95('0x24')][_0x7f95('0x25')]);_0x12fbde[_0x7f95('0x2a')]=_[_0x7f95('0x2b')](_0xbc308d[_0x7f95('0x2a')]);_0x12fbde['filters']=_['intersection'](_0x12fbde[_0x7f95('0x29')],_0x12fbde[_0x7f95('0x2a')]);_0x27645e[_0x7f95('0x2e')]=_[_0x7f95('0x3d')](_0x12fbde[_0x7f95('0x29')],qs[_0x7f95('0x2d')](_0xbc308d[_0x7f95('0x2a')][_0x7f95('0x2d')]));_0x27645e[_0x7f95('0x2e')]=_0x27645e[_0x7f95('0x2e')][_0x7f95('0x3e')]?_0x27645e[_0x7f95('0x2e')]:_0x12fbde[_0x7f95('0x29')];if(_0xbc308d[_0x7f95('0x2a')][_0x7f95('0x37')]){_0x27645e['include']=[{'all':!![]}];}_0x27645e=_[_0x7f95('0x34')]({},_0x27645e,_0xbc308d[_0x7f95('0x3f')]);return db['OpenchannelApplication'][_0x7f95('0x40')](_0x27645e)['then'](handleEntityNotFound(_0xda5386,null))['then'](respondWithResult(_0xda5386,null))[_0x7f95('0x3a')](handleError(_0xda5386,null));};exports[_0x7f95('0x41')]=function(_0x7dc195,_0x1f660d){return db[_0x7f95('0x24')][_0x7f95('0x41')](_0x7dc195[_0x7f95('0x42')],{})['then'](respondWithResult(_0x1f660d,0xc9))['catch'](handleError(_0x1f660d,null));};exports[_0x7f95('0x43')]=function(_0x1c7c91,_0x1e93dd){if(_0x1c7c91[_0x7f95('0x42')]['id']){delete _0x1c7c91[_0x7f95('0x42')]['id'];}return db[_0x7f95('0x24')][_0x7f95('0x40')]({'where':{'id':_0x1c7c91['params']['id']}})[_0x7f95('0x1f')](handleEntityNotFound(_0x1e93dd,null))[_0x7f95('0x1f')](saveUpdates(_0x1c7c91[_0x7f95('0x42')],null))['then'](respondWithResult(_0x1e93dd,null))[_0x7f95('0x3a')](handleError(_0x1e93dd,null));};exports['destroy']=function(_0x1d4d9d,_0x3888c7){return db['OpenchannelApplication']['find']({'where':{'id':_0x1d4d9d[_0x7f95('0x3c')]['id']}})[_0x7f95('0x1f')](handleEntityNotFound(_0x3888c7,null))[_0x7f95('0x1f')](removeEntity(_0x3888c7,null))['catch'](handleError(_0x3888c7,null));};
\ No newline at end of file
+var _0x24c7=['merge','VIRTUAL','options','includeAll','include','findAll','catch','show','find','create','update','body','params','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','ejs','lodash','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','then','destroy','error','stack','name','send','index','map','OpenchannelApplication','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filter'];(function(_0x4c440b,_0x3ea627){var _0x2d48cf=function(_0x56bac7){while(--_0x56bac7){_0x4c440b['push'](_0x4c440b['shift']());}};_0x2d48cf(++_0x3ea627);}(_0x24c7,0x1d5));var _0x724c=function(_0x1b728c,_0x1e77fd){_0x1b728c=_0x1b728c-0x0;var _0x152774=_0x24c7[_0x1b728c];return _0x152774;};'use strict';var pdf=require(_0x724c('0x0'));var emlformat=require(_0x724c('0x1'));var rimraf=require(_0x724c('0x2'));var zipdir=require(_0x724c('0x3'));var jsonpatch=require(_0x724c('0x4'));var rp=require(_0x724c('0x5'));var moment=require('moment');var BPromise=require(_0x724c('0x6'));var Mustache=require(_0x724c('0x7'));var util=require(_0x724c('0x8'));var path=require(_0x724c('0x9'));var sox=require('sox');var csv=require(_0x724c('0xa'));var ejs=require(_0x724c('0xb'));var fs=require('fs');var _=require(_0x724c('0xc'));var squel=require('squel');var crypto=require(_0x724c('0xd'));var jsforce=require(_0x724c('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x724c('0xf'));var Papa=require('papaparse');var Redis=require(_0x724c('0x10'));var authService=require(_0x724c('0x11'));var qs=require(_0x724c('0x12'));var as=require(_0x724c('0x13'));var hardwareService=require(_0x724c('0x14'));var logger=require(_0x724c('0x15'))(_0x724c('0x16'));var utils=require(_0x724c('0x17'));var config=require(_0x724c('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4bcdfb,_0x118193){_0x118193=_0x118193||0xcc;return function(_0x366aa3){if(_0x366aa3){return _0x4bcdfb[_0x724c('0x19')](_0x118193);}return _0x4bcdfb[_0x724c('0x1a')](_0x118193)[_0x724c('0x1b')]();};}function respondWithResult(_0x3e922e,_0x2cf2e7){_0x2cf2e7=_0x2cf2e7||0xc8;return function(_0x3f4375){if(_0x3f4375){return _0x3e922e[_0x724c('0x1a')](_0x2cf2e7)[_0x724c('0x1c')](_0x3f4375);}};}function respondWithFilteredResult(_0x2c5ab8,_0x13442f){return function(_0x133db1){if(_0x133db1){var _0x316b37=_0x133db1[_0x724c('0x1d')],_0x378842=_0x13442f[_0x724c('0x1e')],_0x493746=_0x13442f['offset']+_0x13442f[_0x724c('0x1f')],_0x35d6ae;if(_0x493746>=_0x316b37){_0x493746=_0x316b37;_0x35d6ae=0xc8;}else{_0x35d6ae=0xce;}_0x2c5ab8[_0x724c('0x1a')](_0x35d6ae);return _0x2c5ab8[_0x724c('0x20')](_0x724c('0x21'),_0x378842+'-'+_0x493746+'/'+_0x316b37)[_0x724c('0x1c')](_0x133db1);}return null;};}function patchUpdates(_0x16ae9a){return function(_0x169e1a){try{jsonpatch[_0x724c('0x22')](_0x169e1a,_0x16ae9a,!![]);}catch(_0xc71753){return BPromise[_0x724c('0x23')](_0xc71753);}return _0x169e1a[_0x724c('0x24')]();};}function saveUpdates(_0x2b7592,_0x1b3b9d){return function(_0x50de78){if(_0x50de78){return _0x50de78['update'](_0x2b7592)[_0x724c('0x25')](function(_0x4e185f){return _0x4e185f;});}return null;};}function removeEntity(_0x564e68,_0x2f064e){return function(_0x5e06ca){if(_0x5e06ca){return _0x5e06ca[_0x724c('0x26')]()[_0x724c('0x25')](function(){_0x564e68['status'](0xcc)[_0x724c('0x1b')]();});}};}function handleEntityNotFound(_0x494590,_0x5baedc){return function(_0xf778c6){if(!_0xf778c6){_0x494590[_0x724c('0x19')](0x194);}return _0xf778c6;};}function handleError(_0x22328a,_0x5b75c9){_0x5b75c9=_0x5b75c9||0x1f4;return function(_0x6d85c6){logger[_0x724c('0x27')](_0x6d85c6[_0x724c('0x28')]);if(_0x6d85c6[_0x724c('0x29')]){delete _0x6d85c6[_0x724c('0x29')];}_0x22328a[_0x724c('0x1a')](_0x5b75c9)[_0x724c('0x2a')](_0x6d85c6);};}exports[_0x724c('0x2b')]=function(_0xc3005c,_0x5031a8){var _0x4ef263={},_0x5044e9={},_0x1f9fa6={'count':0x0,'rows':[]};var _0xcb447a=_[_0x724c('0x2c')](db[_0x724c('0x2d')][_0x724c('0x2e')],function(_0x210356){return{'name':_0x210356[_0x724c('0x2f')],'type':_0x210356[_0x724c('0x30')][_0x724c('0x31')]};});_0x5044e9[_0x724c('0x32')]=_[_0x724c('0x2c')](_0xcb447a,'name');_0x5044e9[_0x724c('0x33')]=_[_0x724c('0x34')](_0xc3005c[_0x724c('0x33')]);_0x5044e9[_0x724c('0x35')]=_[_0x724c('0x36')](_0x5044e9[_0x724c('0x32')],_0x5044e9[_0x724c('0x33')]);_0x4ef263[_0x724c('0x37')]=_['intersection'](_0x5044e9[_0x724c('0x32')],qs[_0x724c('0x38')](_0xc3005c[_0x724c('0x33')][_0x724c('0x38')]));_0x4ef263[_0x724c('0x37')]=_0x4ef263[_0x724c('0x37')][_0x724c('0x39')]?_0x4ef263[_0x724c('0x37')]:_0x5044e9[_0x724c('0x32')];if(!_0xc3005c['query'][_0x724c('0x3a')]('nolimit')){_0x4ef263[_0x724c('0x1f')]=qs[_0x724c('0x1f')](_0xc3005c[_0x724c('0x33')]['limit']);_0x4ef263[_0x724c('0x1e')]=qs[_0x724c('0x1e')](_0xc3005c['query'][_0x724c('0x1e')]);}_0x4ef263[_0x724c('0x3b')]=qs[_0x724c('0x3c')](_0xc3005c[_0x724c('0x33')][_0x724c('0x3c')]);_0x4ef263[_0x724c('0x3d')]=qs[_0x724c('0x35')](_['pick'](_0xc3005c[_0x724c('0x33')],_0x5044e9[_0x724c('0x35')]),_0xcb447a);if(_0xc3005c[_0x724c('0x33')][_0x724c('0x3e')]){_0x4ef263[_0x724c('0x3d')]=_[_0x724c('0x3f')](_0x4ef263[_0x724c('0x3d')],{'$or':_[_0x724c('0x2c')](_0xcb447a,function(_0x17db52){if(_0x17db52['type']!==_0x724c('0x40')){var _0xe2696c={};_0xe2696c[_0x17db52['name']]={'$like':'%'+_0xc3005c[_0x724c('0x33')][_0x724c('0x3e')]+'%'};return _0xe2696c;}})});}_0x4ef263=_[_0x724c('0x3f')]({},_0x4ef263,_0xc3005c[_0x724c('0x41')]);var _0x236557={'where':_0x4ef263[_0x724c('0x3d')]};return db['OpenchannelApplication'][_0x724c('0x1d')](_0x236557)['then'](function(_0x568576){_0x1f9fa6['count']=_0x568576;if(_0xc3005c[_0x724c('0x33')][_0x724c('0x42')]){_0x4ef263[_0x724c('0x43')]=[{'all':!![]}];}return db[_0x724c('0x2d')][_0x724c('0x44')](_0x4ef263);})[_0x724c('0x25')](function(_0x387ea4){_0x1f9fa6['rows']=_0x387ea4;return _0x1f9fa6;})[_0x724c('0x25')](respondWithFilteredResult(_0x5031a8,_0x4ef263))[_0x724c('0x45')](handleError(_0x5031a8,null));};exports[_0x724c('0x46')]=function(_0x5b9a07,_0x5a2b1f){var _0x125a30={'raw':!![],'where':{'id':_0x5b9a07['params']['id']}},_0x40587d={};_0x40587d[_0x724c('0x32')]=_[_0x724c('0x34')](db['OpenchannelApplication'][_0x724c('0x2e')]);_0x40587d[_0x724c('0x33')]=_['keys'](_0x5b9a07[_0x724c('0x33')]);_0x40587d['filters']=_[_0x724c('0x36')](_0x40587d['model'],_0x40587d['query']);_0x125a30[_0x724c('0x37')]=_[_0x724c('0x36')](_0x40587d[_0x724c('0x32')],qs['fields'](_0x5b9a07['query'][_0x724c('0x38')]));_0x125a30[_0x724c('0x37')]=_0x125a30[_0x724c('0x37')]['length']?_0x125a30[_0x724c('0x37')]:_0x40587d[_0x724c('0x32')];if(_0x5b9a07[_0x724c('0x33')][_0x724c('0x42')]){_0x125a30['include']=[{'all':!![]}];}_0x125a30=_['merge']({},_0x125a30,_0x5b9a07['options']);return db[_0x724c('0x2d')][_0x724c('0x47')](_0x125a30)[_0x724c('0x25')](handleEntityNotFound(_0x5a2b1f,null))[_0x724c('0x25')](respondWithResult(_0x5a2b1f,null))['catch'](handleError(_0x5a2b1f,null));};exports[_0x724c('0x48')]=function(_0x3ee122,_0x5e4a8b){return db[_0x724c('0x2d')]['create'](_0x3ee122['body'],{})[_0x724c('0x25')](respondWithResult(_0x5e4a8b,0xc9))[_0x724c('0x45')](handleError(_0x5e4a8b,null));};exports[_0x724c('0x49')]=function(_0x4a16b8,_0x40b1b6){if(_0x4a16b8[_0x724c('0x4a')]['id']){delete _0x4a16b8[_0x724c('0x4a')]['id'];}return db[_0x724c('0x2d')][_0x724c('0x47')]({'where':{'id':_0x4a16b8[_0x724c('0x4b')]['id']}})['then'](handleEntityNotFound(_0x40b1b6,null))[_0x724c('0x25')](saveUpdates(_0x4a16b8[_0x724c('0x4a')],null))[_0x724c('0x25')](respondWithResult(_0x40b1b6,null))['catch'](handleError(_0x40b1b6,null));};exports[_0x724c('0x26')]=function(_0xde1ca0,_0x414487){return db[_0x724c('0x2d')]['find']({'where':{'id':_0xde1ca0[_0x724c('0x4b')]['id']}})[_0x724c('0x25')](handleEntityNotFound(_0x414487,null))[_0x724c('0x25')](removeEntity(_0x414487,null))['catch'](handleError(_0x414487,null));};
\ No newline at end of file
diff --git a/server/api/openchannelApplication/openchannelApplication.model.js b/server/api/openchannelApplication/openchannelApplication.model.js
index 15bd085..13435b8 100644
--- a/server/api/openchannelApplication/openchannelApplication.model.js
+++ b/server/api/openchannelApplication/openchannelApplication.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xd4a3=['exports','utf8mb4_unicode_ci','lodash','moment','bluebird','request-promise','path','./openchannelApplication.attributes'];(function(_0x104aa8,_0x56c3c4){var _0xecdb7=function(_0x3df399){while(--_0x3df399){_0x104aa8['push'](_0x104aa8['shift']());}};_0xecdb7(++_0x56c3c4);}(_0xd4a3,0x7a));var _0x3d4a=function(_0x19ef3c,_0x4289a0){_0x19ef3c=_0x19ef3c-0x0;var _0x381da3=_0xd4a3[_0x19ef3c];return _0x381da3;};'use strict';var _=require(_0x3d4a('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x3d4a('0x1'));var BPromise=require(_0x3d4a('0x2'));var rp=require(_0x3d4a('0x3'));var fs=require('fs');var path=require(_0x3d4a('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x3d4a('0x5'));module[_0x3d4a('0x6')]=function(_0x231d6d,_0x58b8b3){return _0x231d6d['define']('OpenchannelApplication',attributes,{'tableName':'openchannel_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x3d4a('0x7')});};
\ No newline at end of file
+var _0x9a70=['exports','define','OpenchannelApplication','openchannel_applications','utf8mb4','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','./openchannelApplication.attributes'];(function(_0x521cd8,_0x501348){var _0x12425d=function(_0x67d3a){while(--_0x67d3a){_0x521cd8['push'](_0x521cd8['shift']());}};_0x12425d(++_0x501348);}(_0x9a70,0x18d));var _0x09a7=function(_0x413feb,_0x10477f){_0x413feb=_0x413feb-0x0;var _0x40ee88=_0x9a70[_0x413feb];return _0x40ee88;};'use strict';var _=require(_0x09a7('0x0'));var util=require(_0x09a7('0x1'));var logger=require(_0x09a7('0x2'))(_0x09a7('0x3'));var moment=require(_0x09a7('0x4'));var BPromise=require(_0x09a7('0x5'));var rp=require(_0x09a7('0x6'));var fs=require('fs');var path=require(_0x09a7('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x09a7('0x8'));module[_0x09a7('0x9')]=function(_0xdeab95,_0x377a75){return _0xdeab95[_0x09a7('0xa')](_0x09a7('0xb'),attributes,{'tableName':_0x09a7('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x09a7('0xd'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
diff --git a/server/api/openchannelApplication/openchannelApplication.rpc.js b/server/api/openchannelApplication/openchannelApplication.rpc.js
index 207de2f..8ea5ba2 100644
--- a/server/api/openchannelApplication/openchannelApplication.rpc.js
+++ b/server/api/openchannelApplication/openchannelApplication.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xd8b0=['OpenchannelApplication','body','options','raw','where','lodash','util','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','then','info','OpenchannelApplication,\x20%s,\x20%s','request\x20sent','debug','OpenchannelApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','UpdateOpenchannelApplication'];(function(_0x4f2c3a,_0x6bde90){var _0x17d91c=function(_0xaaf630){while(--_0xaaf630){_0x4f2c3a['push'](_0x4f2c3a['shift']());}};_0x17d91c(++_0x6bde90);}(_0xd8b0,0xad));var _0x0d8b=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xd8b0[_0x122ef9];return _0x42fba0;};'use strict';var _=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0d8b('0x2'));var db=require(_0x0d8b('0x3'))['db'];var utils=require(_0x0d8b('0x4'));var logger=require(_0x0d8b('0x5'))(_0x0d8b('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x0d8b('0x7')][_0x0d8b('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x39f43a,_0x4a4470,_0x413284){return new BPromise(function(_0x284169,_0x58e4e2){return client[_0x0d8b('0x9')](_0x39f43a,_0x413284)[_0x0d8b('0xa')](function(_0x3b027f){logger[_0x0d8b('0xb')](_0x0d8b('0xc'),_0x4a4470,_0x0d8b('0xd'));logger[_0x0d8b('0xe')](_0x0d8b('0xf'),_0x4a4470,'request\x20sent',JSON[_0x0d8b('0x10')](_0x3b027f));if(_0x3b027f['error']){if(_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x12')]===0x1f4){logger[_0x0d8b('0x11')](_0x0d8b('0xc'),_0x4a4470,_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x13')]);return _0x58e4e2(_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x13')]);}logger[_0x0d8b('0x11')](_0x0d8b('0xc'),_0x4a4470,_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x13')]);return _0x284169(_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x13')]);}else{logger['info'](_0x0d8b('0xc'),_0x4a4470,_0x0d8b('0xd'));_0x284169(_0x3b027f[_0x0d8b('0x14')][_0x0d8b('0x13')]);}})[_0x0d8b('0x15')](function(_0x5cd485){logger[_0x0d8b('0x11')](_0x0d8b('0xc'),_0x4a4470,_0x5cd485);_0x58e4e2(_0x5cd485);});});}exports[_0x0d8b('0x16')]=function(_0x5fecbd){var _0x333674=this;return new Promise(function(_0x18dd2d,_0x264b39){return db[_0x0d8b('0x17')]['update'](_0x5fecbd[_0x0d8b('0x18')],{'raw':_0x5fecbd[_0x0d8b('0x19')]?_0x5fecbd[_0x0d8b('0x19')][_0x0d8b('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5fecbd[_0x0d8b('0x19')]?_0x5fecbd[_0x0d8b('0x19')][_0x0d8b('0x1b')]||null:null,'attributes':_0x5fecbd[_0x0d8b('0x19')]?_0x5fecbd['options']['attributes']||null:null,'limit':_0x5fecbd[_0x0d8b('0x19')]?_0x5fecbd['options']['limit']||null:null})['then'](function(_0x238728){logger[_0x0d8b('0xb')](_0x0d8b('0x16'),_0x5fecbd);logger[_0x0d8b('0xe')](_0x0d8b('0x16'),_0x5fecbd,JSON[_0x0d8b('0x10')](_0x238728));_0x18dd2d(_0x238728);})[_0x0d8b('0x15')](function(_0x4562cb){logger[_0x0d8b('0x11')]('UpdateOpenchannelApplication',_0x4562cb[_0x0d8b('0x13')],_0x5fecbd);_0x264b39(_0x333674[_0x0d8b('0x11')](0x1f4,_0x4562cb['message']));});});};
\ No newline at end of file
+var _0x5f2f=['error','code','message','request\x20sent','result','catch','UpdateOpenchannelApplication','OpenchannelApplication','update','body','options','raw','where','attributes','limit','then','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','info','OpenchannelApplication,\x20%s,\x20%s','debug','stringify'];(function(_0xcde186,_0x1d0e5b){var _0x1d6208=function(_0x2cd3a2){while(--_0x2cd3a2){_0xcde186['push'](_0xcde186['shift']());}};_0x1d6208(++_0x1d0e5b);}(_0x5f2f,0x73));var _0xf5f2=function(_0x11bc0f,_0x373666){_0x11bc0f=_0x11bc0f-0x0;var _0x3ab0d1=_0x5f2f[_0x11bc0f];return _0x3ab0d1;};'use strict';var _=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var moment=require(_0xf5f2('0x2'));var BPromise=require(_0xf5f2('0x3'));var rs=require(_0xf5f2('0x4'));var fs=require('fs');var Redis=require(_0xf5f2('0x5'));var db=require(_0xf5f2('0x6'))['db'];var utils=require(_0xf5f2('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0xf5f2('0x8'));var jayson=require(_0xf5f2('0x9'));var client=jayson[_0xf5f2('0xa')][_0xf5f2('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3133bc,_0x473100,_0x5907aa){return new BPromise(function(_0x466882,_0x46cd9c){return client[_0xf5f2('0xc')](_0x3133bc,_0x5907aa)['then'](function(_0x375da4){logger[_0xf5f2('0xd')](_0xf5f2('0xe'),_0x473100,'request\x20sent');logger[_0xf5f2('0xf')]('OpenchannelApplication,\x20%s,\x20%s,\x20%s',_0x473100,'request\x20sent',JSON[_0xf5f2('0x10')](_0x375da4));if(_0x375da4[_0xf5f2('0x11')]){if(_0x375da4['error'][_0xf5f2('0x12')]===0x1f4){logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0x375da4[_0xf5f2('0x11')][_0xf5f2('0x13')]);return _0x46cd9c(_0x375da4[_0xf5f2('0x11')]['message']);}logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0x375da4[_0xf5f2('0x11')][_0xf5f2('0x13')]);return _0x466882(_0x375da4[_0xf5f2('0x11')]['message']);}else{logger[_0xf5f2('0xd')](_0xf5f2('0xe'),_0x473100,_0xf5f2('0x14'));_0x466882(_0x375da4[_0xf5f2('0x15')][_0xf5f2('0x13')]);}})[_0xf5f2('0x16')](function(_0xdb61b3){logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0xdb61b3);_0x46cd9c(_0xdb61b3);});});}exports[_0xf5f2('0x17')]=function(_0x20fccd){var _0x28e097=this;return new Promise(function(_0x4ff59b,_0x3ee69){return db[_0xf5f2('0x18')][_0xf5f2('0x19')](_0x20fccd[_0xf5f2('0x1a')],{'raw':_0x20fccd['options']?_0x20fccd[_0xf5f2('0x1b')][_0xf5f2('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x20fccd['options']?_0x20fccd['options'][_0xf5f2('0x1d')]||null:null,'attributes':_0x20fccd[_0xf5f2('0x1b')]?_0x20fccd['options'][_0xf5f2('0x1e')]||null:null,'limit':_0x20fccd[_0xf5f2('0x1b')]?_0x20fccd[_0xf5f2('0x1b')][_0xf5f2('0x1f')]||null:null})[_0xf5f2('0x20')](function(_0x4c691a){logger[_0xf5f2('0xd')](_0xf5f2('0x17'),_0x20fccd);logger[_0xf5f2('0xf')](_0xf5f2('0x17'),_0x20fccd,JSON[_0xf5f2('0x10')](_0x4c691a));_0x4ff59b(_0x4c691a);})['catch'](function(_0x529f07){logger[_0xf5f2('0x11')](_0xf5f2('0x17'),_0x529f07[_0xf5f2('0x13')],_0x20fccd);_0x3ee69(_0x28e097[_0xf5f2('0x11')](0x1f4,_0x529f07[_0xf5f2('0x13')]));});});};
\ No newline at end of file
diff --git a/server/api/openchannelInteraction/index.js b/server/api/openchannelInteraction/index.js
index e75513d..c93918a 100644
--- a/server/api/openchannelInteraction/index.js
+++ b/server/api/openchannelInteraction/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x38c2=['addMessage','/:id/tags','openchannel','openchannelinteraction:addtags','put','tracked','openchannelinteraction:update','update','delete','openchannelinteraction:destroy','destroy','removeTags','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./openchannelInteraction.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/messages','getMessages','/:id/download','download','post','create'];(function(_0x680123,_0x36dffe){var _0x3478ea=function(_0x28ef6d){while(--_0x28ef6d){_0x680123['push'](_0x680123['shift']());}};_0x3478ea(++_0x36dffe);}(_0x38c2,0x99));var _0x238c=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x38c2[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require(_0x238c('0x0'));var util=require(_0x238c('0x1'));var path=require(_0x238c('0x2'));var timeout=require(_0x238c('0x3'));var express=require(_0x238c('0x4'));var router=express[_0x238c('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0x238c('0x6'));var config=require(_0x238c('0x7'));var controller=require(_0x238c('0x8'));router[_0x238c('0x9')]('/',auth[_0x238c('0xa')](),controller[_0x238c('0xb')]);router['get'](_0x238c('0xc'),auth[_0x238c('0xa')](),controller[_0x238c('0xd')]);router[_0x238c('0x9')](_0x238c('0xe'),auth[_0x238c('0xa')](),controller[_0x238c('0xf')]);router[_0x238c('0x9')](_0x238c('0x10'),auth['isAuthenticated'](),controller[_0x238c('0x11')]);router[_0x238c('0x9')](_0x238c('0x12'),auth[_0x238c('0xa')](),controller[_0x238c('0x13')]);router[_0x238c('0x14')]('/',auth[_0x238c('0xa')](),controller[_0x238c('0x15')]);router[_0x238c('0x14')]('/:id/messages',auth[_0x238c('0xa')](),controller[_0x238c('0x16')]);router[_0x238c('0x14')](_0x238c('0x17'),auth['isAuthenticated'](),interaction['tracked'](_0x238c('0x18'),_0x238c('0x19')),controller['addTags']);router[_0x238c('0x1a')]('/:id',auth[_0x238c('0xa')](),interaction[_0x238c('0x1b')]('openchannel',_0x238c('0x1c')),controller[_0x238c('0x1d')]);router[_0x238c('0x1e')]('/:id',auth[_0x238c('0xa')](),interaction[_0x238c('0x1b')](_0x238c('0x18'),_0x238c('0x1f')),controller[_0x238c('0x20')]);router[_0x238c('0x1e')](_0x238c('0x17'),auth[_0x238c('0xa')](),controller[_0x238c('0x21')]);module[_0x238c('0x22')]=router;
\ No newline at end of file
+var _0x8905=['put','openchannel','openchannelinteraction:update','update','delete','openchannelinteraction:destroy','destroy','removeTags','util','express','Router','../../components/auth/service','../../config/environment','isAuthenticated','index','describe','get','/:id','show','/:id/messages','getMessages','download','post','create','addMessage','/:id/tags','tracked'];(function(_0x5cf40a,_0x21e31f){var _0x26216d=function(_0x82a779){while(--_0x82a779){_0x5cf40a['push'](_0x5cf40a['shift']());}};_0x26216d(++_0x21e31f);}(_0x8905,0x8f));var _0x5890=function(_0x55a374,_0x35aa72){_0x55a374=_0x55a374-0x0;var _0xa4c10=_0x8905[_0x55a374];return _0xa4c10;};'use strict';var multer=require('multer');var util=require(_0x5890('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x5890('0x1'));var router=express[_0x5890('0x2')]();var auth=require(_0x5890('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x5890('0x4'));var controller=require('./openchannelInteraction.controller');router['get']('/',auth[_0x5890('0x5')](),controller[_0x5890('0x6')]);router['get']('/describe',auth[_0x5890('0x5')](),controller[_0x5890('0x7')]);router[_0x5890('0x8')](_0x5890('0x9'),auth['isAuthenticated'](),controller[_0x5890('0xa')]);router['get'](_0x5890('0xb'),auth[_0x5890('0x5')](),controller[_0x5890('0xc')]);router[_0x5890('0x8')]('/:id/download',auth['isAuthenticated'](),controller[_0x5890('0xd')]);router[_0x5890('0xe')]('/',auth[_0x5890('0x5')](),controller[_0x5890('0xf')]);router[_0x5890('0xe')](_0x5890('0xb'),auth[_0x5890('0x5')](),controller[_0x5890('0x10')]);router['post'](_0x5890('0x11'),auth[_0x5890('0x5')](),interaction[_0x5890('0x12')]('openchannel','openchannelinteraction:addtags'),controller['addTags']);router[_0x5890('0x13')](_0x5890('0x9'),auth[_0x5890('0x5')](),interaction['tracked'](_0x5890('0x14'),_0x5890('0x15')),controller[_0x5890('0x16')]);router[_0x5890('0x17')]('/:id',auth[_0x5890('0x5')](),interaction[_0x5890('0x12')](_0x5890('0x14'),_0x5890('0x18')),controller[_0x5890('0x19')]);router[_0x5890('0x17')](_0x5890('0x11'),auth[_0x5890('0x5')](),controller[_0x5890('0x1a')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/openchannelInteraction/openchannelInteraction.attributes.js b/server/api/openchannelInteraction/openchannelInteraction.attributes.js
index 52c44c2..5a43589 100644
--- a/server/api/openchannelInteraction/openchannelInteraction.attributes.js
+++ b/server/api/openchannelInteraction/openchannelInteraction.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x4233=['out','sequelize','exports','BOOLEAN','DATE','STRING'];(function(_0x4f8d90,_0x25943f){var _0x570bda=function(_0xea97ef){while(--_0xea97ef){_0x4f8d90['push'](_0x4f8d90['shift']());}};_0x570bda(++_0x25943f);}(_0x4233,0x6d));var _0x3423=function(_0x1eda2d,_0x22993f){_0x1eda2d=_0x1eda2d-0x0;var _0x3ec5d7=_0x4233[_0x1eda2d];return _0x3ec5d7;};'use strict';var Sequelize=require(_0x3423('0x0'));module[_0x3423('0x1')]={'closed':{'type':Sequelize[_0x3423('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x3423('0x3')]},'disposition':{'type':Sequelize[_0x3423('0x4')]},'note':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0x3423('0x3')]},'threadId':{'type':Sequelize[_0x3423('0x4')]},'externalUrl':{'type':Sequelize[_0x3423('0x4')]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0x3423('0x5')),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize[_0x3423('0x4')]}};
\ No newline at end of file
+var _0xd202=['STRING','DATE','ENUM','out','sequelize','exports','BOOLEAN'];(function(_0x361026,_0x2375e2){var _0x37028e=function(_0x4f89e0){while(--_0x4f89e0){_0x361026['push'](_0x361026['shift']());}};_0x37028e(++_0x2375e2);}(_0xd202,0x19a));var _0x2d20=function(_0x24f31b,_0x44b8f3){_0x24f31b=_0x24f31b-0x0;var _0x488401=_0xd202[_0x24f31b];return _0x488401;};'use strict';var Sequelize=require(_0x2d20('0x0'));module[_0x2d20('0x1')]={'closed':{'type':Sequelize[_0x2d20('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0x2d20('0x3')]},'note':{'type':Sequelize[_0x2d20('0x3')]},'read1stAt':{'type':Sequelize[_0x2d20('0x4')]},'threadId':{'type':Sequelize['STRING']},'externalUrl':{'type':Sequelize[_0x2d20('0x3')]},'lastMsgAt':{'type':Sequelize[_0x2d20('0x4')]},'lastMsgDirection':{'type':Sequelize[_0x2d20('0x5')]('in',_0x2d20('0x6')),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize[_0x2d20('0x3')]}};
\ No newline at end of file
diff --git a/server/api/openchannelInteraction/openchannelInteraction.controller.js b/server/api/openchannelInteraction/openchannelInteraction.controller.js
index 8970b4c..0518ed9 100644
--- a/server/api/openchannelInteraction/openchannelInteraction.controller.js
+++ b/server/api/openchannelInteraction/openchannelInteraction.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xf924=['request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../mysqldb','defaults','localhost','socket.io-emitter','redis','status','end','json','count','offset','limit','set','Content-Range','apply','reject','update','then','sendStatus','stack','name','send','Users','fullname','TagIds','split','forEach','Tags','catch','index','map','rawAttributes','type','model','query','intersection','fields','attributes','length','hasOwnProperty','order','sort','pick','field','color','from','tools_tags','u.id','u.fullname','users','select','openchannel_interactions','left_join','cm_contacts','o.id\x20=\x20i.UserId','openchannel_accounts','me.OpenchannelInteractionId\x20=\x20i.id','openchannel_interaction_has_tags','it.OpenchannelInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','parseSearch','search','sqlOperator','conditions','unreadMessages','value','`\x20>\x200','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','find','ContactId','buildExpression','text','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','UserId','body','keys','compact','isEmpty','OpenchannelAccountId','concat','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','where','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','having','`unreadMessages`\x20>\x200','tag','filter','replace','\x27\x27\x27\x27','isNumeric','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','i.from\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','Sequelize','QueryTypes','SELECT','clone','t.id\x20IN\x20?','resolve','journey','i.OpenchannelAccountId\x20IS\x20NOT\x20NULL','user','getOpenchannelAccounts','i.OpenchannelAccountId\x20IS\x20NULL','i.OpenchannelAccountId\x20IN\x20?','sequelize','toString','merge','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','a.key','Account.key','Account.mandatoryDisposition','i.*','c.firstName','Contact.lastName','c.email','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','Contact.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.OpenchannelInteractionId\x20IN\x20?','groupBy','OpenchannelInteractionId','push','all','rows','show','params','OpenchannelInteraction','filters','include','options','create','describe','addMessage','ids','omit','findOne','OpenchannelMessage','nolimit','YYYY-MM-DD\x20HH:mm:ss','includeAll','findAll','addTags','setTags','spread','removeTags','download','unix','join','root','server','tmp','files','attachments','User','CmContact','Contact','Attachment','createdAt','secret','OpenchannelAccount','Account','get','10px','40px','\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
Interaction\x20Transcript \x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',' \x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20%s \x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{{page}}/{{pages}} \x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20%s \x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
','format','%s\x20#%d','Openchannel','YYYY-MM-DD','Owner','N.A.','closed','closedAt','disposition','Public','Private','basename','createReadStream','pipe','createWriteStream','direction','out','System','firstName','lastName','renderFile','views','downloadInteraction.html','toFile','log','err','unlinkSync','eml-format'];(function(_0x56794a,_0x182681){var _0x938100=function(_0x4079d1){while(--_0x4079d1){_0x56794a['push'](_0x56794a['shift']());}};_0x938100(++_0x182681);}(_0xf924,0x1db));var _0x4f92=function(_0x8d9399,_0x490955){_0x8d9399=_0x8d9399-0x0;var _0x5a0645=_0xf924[_0x8d9399];return _0x5a0645;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x4f92('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x4f92('0x1'));var moment=require(_0x4f92('0x2'));var BPromise=require(_0x4f92('0x3'));var Mustache=require(_0x4f92('0x4'));var util=require(_0x4f92('0x5'));var path=require(_0x4f92('0x6'));var sox=require(_0x4f92('0x7'));var csv=require(_0x4f92('0x8'));var ejs=require(_0x4f92('0x9'));var fs=require('fs');var _=require(_0x4f92('0xa'));var squel=require(_0x4f92('0xb'));var crypto=require(_0x4f92('0xc'));var jsforce=require(_0x4f92('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x4f92('0x8'));var querystring=require(_0x4f92('0xe'));var Papa=require(_0x4f92('0xf'));var Redis=require(_0x4f92('0x10'));var authService=require(_0x4f92('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x4f92('0x12'));var hardwareService=require(_0x4f92('0x13'));var logger=require(_0x4f92('0x14'))(_0x4f92('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x4f92('0x16'))['db'];config['redis']=_[_0x4f92('0x17')](config['redis'],{'host':_0x4f92('0x18'),'port':0x18eb});var socket=require(_0x4f92('0x19'))(new Redis(config[_0x4f92('0x1a')]));require('./openchannelInteraction.socket')['register'](socket);function respondWithStatusCode(_0x5286f1,_0x8cdc26){_0x8cdc26=_0x8cdc26||0xcc;return function(_0x1b5846){if(_0x1b5846){return _0x5286f1['sendStatus'](_0x8cdc26);}return _0x5286f1[_0x4f92('0x1b')](_0x8cdc26)[_0x4f92('0x1c')]();};}function respondWithResult(_0x3e564b,_0x49c77f){_0x49c77f=_0x49c77f||0xc8;return function(_0x36b4d8){if(_0x36b4d8){return _0x3e564b[_0x4f92('0x1b')](_0x49c77f)[_0x4f92('0x1d')](_0x36b4d8);}};}function respondWithFilteredResult(_0x17f6f6,_0x250cc4){return function(_0x2b3397){if(_0x2b3397){var _0x5a2fc2=_0x2b3397[_0x4f92('0x1e')],_0x3b3758=_0x250cc4['offset'],_0x5baa68=_0x250cc4[_0x4f92('0x1f')]+_0x250cc4[_0x4f92('0x20')],_0x22ffab;if(_0x5baa68>=_0x5a2fc2){_0x5baa68=_0x5a2fc2;_0x22ffab=0xc8;}else{_0x22ffab=0xce;}_0x17f6f6[_0x4f92('0x1b')](_0x22ffab);return _0x17f6f6[_0x4f92('0x21')](_0x4f92('0x22'),_0x3b3758+'-'+_0x5baa68+'/'+_0x5a2fc2)[_0x4f92('0x1d')](_0x2b3397);}return null;};}function patchUpdates(_0x3b9bd2){return function(_0x2aa63f){try{jsonpatch[_0x4f92('0x23')](_0x2aa63f,_0x3b9bd2,!![]);}catch(_0xd0c55b){return BPromise[_0x4f92('0x24')](_0xd0c55b);}return _0x2aa63f['save']();};}function saveUpdates(_0x5e915b,_0x546772){return function(_0x187497){if(_0x187497){return _0x187497[_0x4f92('0x25')](_0x5e915b)[_0x4f92('0x26')](function(_0x522b79){return _0x522b79;});}return null;};}function removeEntity(_0x58250e,_0x2afad8){return function(_0x5be784){if(_0x5be784){return _0x5be784['destroy']()['then'](function(){_0x58250e['status'](0xcc)[_0x4f92('0x1c')]();});}};}function handleEntityNotFound(_0x104ddb,_0x49879c){return function(_0x290351){if(!_0x290351){_0x104ddb[_0x4f92('0x27')](0x194);}return _0x290351;};}function handleError(_0x2dce63,_0x14bcfa){_0x14bcfa=_0x14bcfa||0x1f4;return function(_0x461e89){logger['error'](_0x461e89[_0x4f92('0x28')]);if(_0x461e89[_0x4f92('0x29')]){delete _0x461e89[_0x4f92('0x29')];}_0x2dce63[_0x4f92('0x1b')](_0x14bcfa)[_0x4f92('0x2a')](_0x461e89);};}function getInteractionUsers(_0x1c5e64,_0x534736){return new BPromise(function(_0x545dbe,_0x13f3e0){try{if(_0x534736[_0x1c5e64['id']]){_0x1c5e64[_0x4f92('0x2b')]=_['map'](_0x534736[_0x1c5e64['id']],function(_0x106ed8){return{'id':_0x106ed8['id'],'fullname':_0x106ed8[_0x4f92('0x2c')]};});}}catch(_0x21a257){_0x13f3e0(_0x21a257);}_0x545dbe(_0x1c5e64);});}function getInteractionTags(_0x21c189,_0x516d54){return new BPromise(function(_0x40a5b7,_0x2fd568){try{if(_0x21c189[_0x4f92('0x2d')]){_0x21c189['Tags']=[];_0x21c189[_0x4f92('0x2d')][_0x4f92('0x2e')](',')[_0x4f92('0x2f')](function(_0x2660e0){_0x21c189[_0x4f92('0x30')]['push'](_0x516d54[_0x2660e0]);});}delete _0x21c189[_0x4f92('0x2d')];}catch(_0x10c3f2){_0x2fd568(_0x10c3f2);}_0x40a5b7(_0x21c189);});}function updateOpenchannelInteraction(_0x544784,_0x49dddf,_0x2a3859){return new BPromise(function(_0x1b0657,_0xbb9893){return getInteractionUsers(_0x544784,_0x2a3859)[_0x4f92('0x26')](function(_0x5bcb4c){return getInteractionTags(_0x5bcb4c,_0x49dddf);})[_0x4f92('0x26')](function(_0x642d2f){_0x1b0657(_0x642d2f);})[_0x4f92('0x31')](function(_0x248b14){_0xbb9893(_0x248b14);});});}exports[_0x4f92('0x32')]=function(_0x1e6578,_0x5ea0dc){var _0x63604c={},_0x45fb00={},_0x533747={'count':0x0,'rows':[]};var _0x93dca3=_[_0x4f92('0x33')](db['OpenchannelInteraction'][_0x4f92('0x34')],function(_0x57aa6b){return{'name':_0x57aa6b['fieldName'],'type':_0x57aa6b[_0x4f92('0x35')]['key']};});_0x45fb00[_0x4f92('0x36')]=_[_0x4f92('0x33')](_0x93dca3,_0x4f92('0x29'));_0x45fb00[_0x4f92('0x37')]=_['keys'](_0x1e6578[_0x4f92('0x37')]);_0x45fb00['filters']=_[_0x4f92('0x38')](_0x45fb00['model'],_0x45fb00['query']);_0x63604c['attributes']=_[_0x4f92('0x38')](_0x45fb00[_0x4f92('0x36')],qs[_0x4f92('0x39')](_0x1e6578[_0x4f92('0x37')][_0x4f92('0x39')]));_0x63604c[_0x4f92('0x3a')]=_0x63604c[_0x4f92('0x3a')][_0x4f92('0x3b')]?_0x63604c['attributes']:_0x45fb00['model'];if(!_0x1e6578['query'][_0x4f92('0x3c')]('nolimit')){_0x63604c[_0x4f92('0x20')]=qs[_0x4f92('0x20')](_0x1e6578[_0x4f92('0x37')][_0x4f92('0x20')]);_0x63604c[_0x4f92('0x1f')]=qs[_0x4f92('0x1f')](_0x1e6578[_0x4f92('0x37')][_0x4f92('0x1f')]);}_0x63604c[_0x4f92('0x3d')]=qs[_0x4f92('0x3e')](_0x1e6578['query'][_0x4f92('0x3e')]);_0x63604c['where']=qs['filters'](_[_0x4f92('0x3f')](_0x1e6578[_0x4f92('0x37')],_0x45fb00['filters']),_0x93dca3);var _0x135ec5=[];var _0x43afeb=squel['select']()['field']('id')[_0x4f92('0x40')](_0x4f92('0x29'))['field'](_0x4f92('0x41'))[_0x4f92('0x42')](_0x4f92('0x43'));var _0x1c2352=squel['select']()[_0x4f92('0x40')](_0x4f92('0x44'))['field'](_0x4f92('0x45'))[_0x4f92('0x40')]('ui.OpenchannelInteractionId')[_0x4f92('0x42')]('user_has_openchannel_interactions','ui')['left_join'](_0x4f92('0x46'),'u','u.id\x20=\x20ui.UserId');var _0x11b72d=squel[_0x4f92('0x47')]()[_0x4f92('0x42')](_0x4f92('0x48'),'i')[_0x4f92('0x49')](_0x4f92('0x4a'),'c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')[_0x4f92('0x49')](_0x4f92('0x46'),'o',_0x4f92('0x4b'))[_0x4f92('0x49')](_0x4f92('0x4c'),'a','a.id\x20=\x20i.OpenchannelAccountId')['left_join']('openchannel_messages','me',_0x4f92('0x4d'))[_0x4f92('0x49')](_0x4f92('0x4e'),'it',_0x4f92('0x4f'))[_0x4f92('0x49')](_0x4f92('0x43'),'t',_0x4f92('0x50'));var _0x2aa724=squel[_0x4f92('0x51')]();var _0x49133d=[];var _0x47e5d3=squel[_0x4f92('0x51')]();var _0x40231c;if(_0x1e6578[_0x4f92('0x37')]['search']){_0x40231c=as[_0x4f92('0x52')](_0x1e6578['query'][_0x4f92('0x53')]);var _0x5748f9=_0x40231c[_0x4f92('0x54')];for(var _0x1e58eb=0x0;_0x1e58eb<_0x40231c[_0x4f92('0x55')][_0x4f92('0x3b')];_0x1e58eb++){var _0x3736dd=_0x40231c[_0x4f92('0x55')][_0x1e58eb];var _0x18faed='i';var _0x5d08a6=_['find'](_0x93dca3,[_0x4f92('0x29'),_0x3736dd[_0x4f92('0x40')]]);if(!_0x5d08a6){switch(_0x3736dd[_0x4f92('0x40')]){case _0x4f92('0x56'):if(_0x3736dd[_0x4f92('0x57')]==0x1){_0x11b72d['having']('`'+_0x3736dd[_0x4f92('0x40')]+'`\x20=\x200');}else{_0x11b72d['having']('`'+_0x3736dd[_0x4f92('0x40')]+_0x4f92('0x58'));}break;case'Contact':if(_0x3736dd['operator']===_0x4f92('0x59')){if(_0x3736dd[_0x4f92('0x57')][_0x4f92('0x2e')]('\x20')[_0x4f92('0x3b')]>0x1){_0x2aa724[_0x5748f9](_0x4f92('0x5a'),qs[_0x4f92('0x5b')](_0x3736dd[_0x4f92('0x57')]),null);}else{var _0x5df877='%'+_0x3736dd['value']+'%';_0x2aa724[_0x5748f9](_0x4f92('0x5c'),_0x5df877,_0x5df877,_0x5df877);}}else{_0x5d08a6=_[_0x4f92('0x5d')](_0x93dca3,[_0x4f92('0x29'),_0x4f92('0x5e')]);_0x3736dd['field']=_0x4f92('0x5e');_0x5b9d87=as[_0x4f92('0x5f')](_0x18faed,_0x5d08a6[_0x4f92('0x35')],_0x3736dd);_0x2aa724[_0x5748f9](_0x5b9d87[_0x4f92('0x60')],_0x5b9d87[_0x4f92('0x57')][_0x4f92('0x61')],_0x5b9d87[_0x4f92('0x57')][_0x4f92('0x1c')]);}break;case _0x4f92('0x62'):var _0x3d298e=_0x3736dd[_0x4f92('0x57')][_0x4f92('0x2e')](',')[_0x4f92('0x33')](function(_0x5865c0){return Number(_0x5865c0);});_0x3d298e[_0x4f92('0x2f')](function(_0x470a31){_0x47e5d3['or'](_0x4f92('0x63'),'%,'+_0x470a31+',%');});_0x49133d=_[_0x4f92('0x64')](_0x49133d,_0x3d298e);break;case'User':if(_0x3736dd['operator']===_0x4f92('0x59')){_0x2aa724[_0x5748f9]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0x3736dd[_0x4f92('0x57')]+'%',null);}else{_0x5d08a6=_[_0x4f92('0x5d')](_0x93dca3,[_0x4f92('0x29'),_0x4f92('0x65')]);_0x3736dd[_0x4f92('0x40')]='UserId';_0x5b9d87=as[_0x4f92('0x5f')](_0x18faed,_0x5d08a6[_0x4f92('0x35')],_0x3736dd);_0x2aa724[_0x5748f9](_0x5b9d87[_0x4f92('0x60')],_0x5b9d87['value'][_0x4f92('0x61')],_0x5b9d87['value']['end']);}break;case _0x4f92('0x66'):_0x5b9d87=as[_0x4f92('0x5f')]('me',null,_0x3736dd);_0x2aa724[_0x5748f9](_0x5b9d87[_0x4f92('0x60')],_0x5b9d87[_0x4f92('0x57')]['start'],_0x5b9d87[_0x4f92('0x57')][_0x4f92('0x1c')]);break;}}else{var _0x5b9d87=as[_0x4f92('0x5f')](_0x18faed,_0x5d08a6[_0x4f92('0x35')],_0x3736dd);_0x2aa724[_0x5748f9](_0x5b9d87[_0x4f92('0x60')],_0x5b9d87['value'][_0x4f92('0x61')],_0x5b9d87[_0x4f92('0x57')][_0x4f92('0x1c')]);}}}else{var _0x367f68=_(_0x1e6578['query'])[_0x4f92('0x67')]()[_0x4f92('0x33')](function(_0x328206){return _['some'](_0x93dca3,[_0x4f92('0x29'),_0x328206])?_0x328206:undefined;})[_0x4f92('0x68')]()[_0x4f92('0x57')]();if(!_[_0x4f92('0x69')](_0x367f68)){_0x367f68[_0x4f92('0x2f')](function(_0x1498f7){if(_0x1498f7===_0x4f92('0x6a')){_0x11b72d['where']('i.OpenchannelAccountId\x20IN\x20?',[][_0x4f92('0x6b')](_0x1e6578['query'][_0x1498f7]));}else if(_0x1498f7==='createdAt'){var _0x1630f1=JSON[_0x4f92('0x6c')](_0x1e6578[_0x4f92('0x37')][_0x1498f7])[_0x4f92('0x6d')];var _0x5ee080=JSON[_0x4f92('0x6c')](_0x1e6578[_0x4f92('0x37')][_0x1498f7])[_0x4f92('0x6e')];_0x11b72d['where'](_0x4f92('0x6f'),_0x1630f1,_0x5ee080);}else{if(_0x1e6578['query'][_0x1498f7]==='null'){_0x11b72d[_0x4f92('0x70')]('i.'+_0x1498f7+_0x4f92('0x71'));}else{_0x11b72d[_0x4f92('0x70')]('i.'+_0x1498f7+_0x4f92('0x72'),_0x1e6578[_0x4f92('0x37')][_0x1498f7]);}}});}if(_0x1e6578[_0x4f92('0x37')]['read']){if(_0x1e6578[_0x4f92('0x37')][_0x4f92('0x73')]==0x1){_0x11b72d['having'](_0x4f92('0x74'));}else{_0x11b72d[_0x4f92('0x75')](_0x4f92('0x76'));}}if(_0x1e6578[_0x4f92('0x37')][_0x4f92('0x77')]){_0x49133d=_['isArray'](_0x1e6578[_0x4f92('0x37')][_0x4f92('0x77')])?_0x1e6578[_0x4f92('0x37')][_0x4f92('0x77')]:new Array(_0x1e6578[_0x4f92('0x37')][_0x4f92('0x77')]);_0x49133d[_0x4f92('0x2f')](function(_0x4a02d7){_0x47e5d3['or'](_0x4f92('0x63'),'%,'+_0x4a02d7+',%');});}if(_0x1e6578[_0x4f92('0x37')][_0x4f92('0x78')]){var _0x3604db=_0x1e6578[_0x4f92('0x37')]['filter'][_0x4f92('0x79')]('\x5c','\x5c\x5c')[_0x4f92('0x79')]('\x27\x27',_0x4f92('0x7a'));if(qs[_0x4f92('0x7b')](_0x3604db)){_0x2aa724['or']('i.id\x20LIKE\x20?',_0x3604db+'%');}else{_0x2aa724['or'](_0x4f92('0x7c'),qs[_0x4f92('0x5b')](_0x3604db))['or'](_0x4f92('0x7d'),_0x3604db+'%')['or'](_0x4f92('0x7e'),_0x3604db+'%');}}}_0x11b72d[_0x4f92('0x70')](_0x2aa724);_0x11b72d[_0x4f92('0x7f')](_0x4f92('0x80'));var _0x4f3b48={'type':db[_0x4f92('0x81')][_0x4f92('0x82')][_0x4f92('0x83')],'raw':!![]};var _0x4d9688=_0x11b72d[_0x4f92('0x84')]();_0x4d9688[_0x4f92('0x40')](_0x4f92('0x80'));_0x4d9688['field']('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x4f92('0x56'));if(_0x63604c[_0x4f92('0x3d')]){_0x63604c[_0x4f92('0x3d')][_0x4f92('0x2f')](function(_0x5f03c6){_0x11b72d[_0x4f92('0x3d')]('i.'+_0x5f03c6[0x0],_0x5f03c6[0x1]==='DESC'?![]:!![]);});}if(!_[_0x4f92('0x69')](_0x49133d)){_0x11b72d[_0x4f92('0x75')](_0x47e5d3);_0x4d9688[_0x4f92('0x70')](_0x4f92('0x85'),_0x49133d);}BPromise[_0x4f92('0x86')]()[_0x4f92('0x26')](function(){if(!_0x40231c){if(_0x1e6578[_0x4f92('0x37')][_0x4f92('0x6a')]||_0x1e6578[_0x4f92('0x37')][_0x4f92('0x87')])return;_0x4d9688['where'](_0x4f92('0x88'));_0x11b72d[_0x4f92('0x70')](_0x4f92('0x88'));return;}return _0x1e6578[_0x4f92('0x89')][_0x4f92('0x8a')]({'attributes':['id'],'raw':!![]})['then'](function(_0x101762){if(_['isEmpty'](_0x101762)){_0x4d9688[_0x4f92('0x70')](_0x4f92('0x8b'));_0x11b72d[_0x4f92('0x70')](_0x4f92('0x8b'));}else{_0x4d9688[_0x4f92('0x70')](_0x4f92('0x8c'),_[_0x4f92('0x33')](_0x101762,'id'));_0x11b72d[_0x4f92('0x70')](_0x4f92('0x8c'),_['map'](_0x101762,'id'));}});})['then'](function(){db[_0x4f92('0x8d')][_0x4f92('0x37')](_0x4d9688[_0x4f92('0x8e')](),_0x4f3b48)[_0x4f92('0x26')](function(_0x4ad505){_0x533747[_0x4f92('0x1e')]=_0x4ad505['length'];if(_0x533747[_0x4f92('0x1e')]===0x0)return[];return db[_0x4f92('0x8d')][_0x4f92('0x37')](_0x43afeb[_0x4f92('0x8e')](),_0x4f3b48)[_0x4f92('0x26')](function(_0x36fce2){_0x135ec5=_['keyBy'](_0x36fce2,'id');_0x4f3b48=_[_0x4f92('0x8f')](_0x4f3b48,{'model':db['OpenchannelInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x1e6578['query'][_0x4f92('0x39')]){_0x63604c['attributes'][_0x4f92('0x2f')](function(_0x31b7e3){_0x11b72d[_0x4f92('0x40')]('i.'+_0x31b7e3);});}else{_0x11b72d[_0x4f92('0x40')](_0x4f92('0x90'),_0x4f92('0x56'));_0x11b72d[_0x4f92('0x40')](_0x4f92('0x91'),_0x4f92('0x92'));_0x11b72d['field']('a.mandatoryDisposition',_0x4f92('0x93'));_0x11b72d['field'](_0x4f92('0x94'));_0x11b72d[_0x4f92('0x40')](_0x4f92('0x95'),'Contact.firstName');_0x11b72d[_0x4f92('0x40')]('c.lastName',_0x4f92('0x96'));_0x11b72d[_0x4f92('0x40')](_0x4f92('0x97'),_0x4f92('0x98'));_0x11b72d['field'](_0x4f92('0x99'),_0x4f92('0x9a'));_0x11b72d[_0x4f92('0x40')](_0x4f92('0x9b'),_0x4f92('0x9c'));_0x11b72d['field']('c.fax',_0x4f92('0x9d'));_0x11b72d[_0x4f92('0x40')](_0x4f92('0x9e'),_0x4f92('0x9f'));_0x11b72d[_0x4f92('0x40')](_0x4f92('0xa0'),_0x4f92('0xa1'));_0x11b72d[_0x4f92('0x40')](_0x4f92('0xa2'),_0x4f92('0x2d'));}if(_0x63604c[_0x4f92('0x20')])_0x11b72d[_0x4f92('0x20')](_0x63604c[_0x4f92('0x20')]);if(_0x63604c[_0x4f92('0x1f')])_0x11b72d[_0x4f92('0x1f')](_0x63604c['offset']);return db[_0x4f92('0x8d')][_0x4f92('0x37')](_0x11b72d[_0x4f92('0x8e')](),_0x4f3b48);})[_0x4f92('0x26')](function(_0x196cd1){_0x1c2352[_0x4f92('0x70')](_0x4f92('0xa3'),_['map'](_0x196cd1,'id'));return db[_0x4f92('0x8d')][_0x4f92('0x37')](_0x1c2352[_0x4f92('0x8e')](),_0x4f3b48)['then'](function(_0x5719cd){var _0x118400=_[_0x4f92('0xa4')](_0x5719cd,_0x4f92('0xa5'));var _0x19ef98=[];_0x196cd1[_0x4f92('0x2f')](function(_0x1cc165){_0x19ef98[_0x4f92('0xa6')](updateOpenchannelInteraction(_0x1cc165,_0x135ec5,_0x118400));});return BPromise[_0x4f92('0xa7')](_0x19ef98);});});})['then'](function(_0xcfedff){_0x533747[_0x4f92('0xa8')]=_0xcfedff;return _0x533747;})[_0x4f92('0x26')](respondWithFilteredResult(_0x5ea0dc,_0x63604c));})[_0x4f92('0x31')](handleError(_0x5ea0dc,null));};exports[_0x4f92('0xa9')]=function(_0x1ebe12,_0x585eb0){var _0x3bb34e={'raw':![],'where':{'id':_0x1ebe12[_0x4f92('0xaa')]['id']}},_0x44995f={};_0x44995f[_0x4f92('0x36')]=_[_0x4f92('0x67')](db[_0x4f92('0xab')][_0x4f92('0x34')]);_0x44995f[_0x4f92('0x37')]=_[_0x4f92('0x67')](_0x1ebe12[_0x4f92('0x37')]);_0x44995f[_0x4f92('0xac')]=_[_0x4f92('0x38')](_0x44995f[_0x4f92('0x36')],_0x44995f[_0x4f92('0x37')]);_0x3bb34e[_0x4f92('0x3a')]=_['intersection'](_0x44995f[_0x4f92('0x36')],qs[_0x4f92('0x39')](_0x1ebe12[_0x4f92('0x37')][_0x4f92('0x39')]));_0x3bb34e['attributes']=_0x3bb34e[_0x4f92('0x3a')][_0x4f92('0x3b')]?_0x3bb34e[_0x4f92('0x3a')]:_0x44995f['model'];if(_0x1ebe12[_0x4f92('0x37')]['includeAll']){_0x3bb34e[_0x4f92('0xad')]=[{'all':!![]}];}_0x3bb34e=_[_0x4f92('0x8f')]({},_0x3bb34e,_0x1ebe12[_0x4f92('0xae')]);return db['OpenchannelInteraction'][_0x4f92('0x5d')](_0x3bb34e)['then'](handleEntityNotFound(_0x585eb0,null))[_0x4f92('0x26')](respondWithResult(_0x585eb0,null))[_0x4f92('0x31')](handleError(_0x585eb0,null));};exports[_0x4f92('0xaf')]=function(_0x337d76,_0x444e69){return db['OpenchannelInteraction'][_0x4f92('0xaf')](_0x337d76[_0x4f92('0x66')],{})['then'](respondWithResult(_0x444e69,0xc9))[_0x4f92('0x31')](handleError(_0x444e69,null));};exports[_0x4f92('0x25')]=function(_0x488e8d,_0x13220d){if(_0x488e8d['body']['id']){delete _0x488e8d[_0x4f92('0x66')]['id'];}return db[_0x4f92('0xab')][_0x4f92('0x5d')]({'where':{'id':_0x488e8d[_0x4f92('0xaa')]['id']}})[_0x4f92('0x26')](handleEntityNotFound(_0x13220d,null))[_0x4f92('0x26')](saveUpdates(_0x488e8d['body'],null))[_0x4f92('0x26')](respondWithResult(_0x13220d,null))[_0x4f92('0x31')](handleError(_0x13220d,null));};exports['destroy']=function(_0x4b84e4,_0x15a410){return db['OpenchannelInteraction'][_0x4f92('0x5d')]({'where':{'id':_0x4b84e4[_0x4f92('0xaa')]['id']}})[_0x4f92('0x26')](handleEntityNotFound(_0x15a410,null))[_0x4f92('0x26')](removeEntity(_0x15a410,null))['catch'](handleError(_0x15a410,null));};exports['describe']=function(_0x3598b4,_0x11cf54){return db[_0x4f92('0xab')][_0x4f92('0xb0')]()[_0x4f92('0x26')](respondWithResult(_0x11cf54,null))[_0x4f92('0x31')](handleError(_0x11cf54,null));};exports[_0x4f92('0xb1')]=function(_0x2da242,_0x57ad2e,_0x35cc3c){return db['OpenchannelMessage']['find']({'where':{'id':_0x2da242[_0x4f92('0xaa')]['id']}})[_0x4f92('0x26')](handleEntityNotFound(_0x57ad2e,null))[_0x4f92('0x26')](function(_0x19ae1c){if(_0x19ae1c){return _0x19ae1c[_0x4f92('0xb1')](_0x2da242[_0x4f92('0x66')][_0x4f92('0xb2')],_[_0x4f92('0xb3')](_0x2da242[_0x4f92('0x66')],[_0x4f92('0xb2'),'id'])||{});}})['then'](respondWithResult(_0x57ad2e,null))[_0x4f92('0x31')](handleError(_0x57ad2e,null));};exports['getMessages']=function(_0x159e75,_0x38aa36,_0x4a35ad){var _0x3324f2={'raw':![],'where':{}};var _0x44ae39={};var _0x48ab33={'count':0x0,'rows':[]};return db['OpenchannelInteraction'][_0x4f92('0xb4')]({'where':{'id':_0x159e75['params']['id']}})[_0x4f92('0x26')](handleEntityNotFound(_0x38aa36,null))['then'](function(_0x1e218f){if(_0x1e218f){_0x44ae39[_0x4f92('0x36')]=_[_0x4f92('0x67')](db[_0x4f92('0xb5')]['rawAttributes']);_0x44ae39[_0x4f92('0x37')]=_['keys'](_0x159e75[_0x4f92('0x37')]);_0x44ae39[_0x4f92('0xac')]=_[_0x4f92('0x38')](_0x44ae39[_0x4f92('0x36')],_0x44ae39[_0x4f92('0x37')]);_0x3324f2[_0x4f92('0x3a')]=_['intersection'](_0x44ae39[_0x4f92('0x36')],qs[_0x4f92('0x39')](_0x159e75[_0x4f92('0x37')][_0x4f92('0x39')]));_0x3324f2[_0x4f92('0x3a')]=_0x3324f2[_0x4f92('0x3a')]['length']?_0x3324f2[_0x4f92('0x3a')]:_0x44ae39[_0x4f92('0x36')];if(!_0x159e75[_0x4f92('0x37')][_0x4f92('0x3c')](_0x4f92('0xb6'))){_0x3324f2[_0x4f92('0x20')]=qs[_0x4f92('0x20')](_0x159e75[_0x4f92('0x37')][_0x4f92('0x20')]);_0x3324f2[_0x4f92('0x1f')]=qs[_0x4f92('0x1f')](_0x159e75[_0x4f92('0x37')][_0x4f92('0x1f')]);}_0x3324f2[_0x4f92('0x3d')]=qs[_0x4f92('0x3e')](_0x159e75[_0x4f92('0x37')][_0x4f92('0x3e')]);_0x3324f2[_0x4f92('0x70')]=qs[_0x4f92('0xac')](_[_0x4f92('0x3f')](_0x159e75['query'],_0x44ae39[_0x4f92('0xac')]));_0x3324f2[_0x4f92('0x70')]['OpenchannelInteractionId']=_0x1e218f['id'];if(_0x159e75['query']['filter']){_0x3324f2[_0x4f92('0x70')]=_[_0x4f92('0x8f')](_0x3324f2[_0x4f92('0x70')],{'$or':_[_0x4f92('0x33')](_0x3324f2[_0x4f92('0x3a')],function(_0x2e1589){var _0x439b03={};_0x439b03[_0x2e1589]={'$like':'%'+_0x159e75[_0x4f92('0x37')][_0x4f92('0x78')]+'%'};return _0x439b03;})});}if(_0x159e75[_0x4f92('0x37')][_0x4f92('0x6d')]){var _0x4b95a9=_0x159e75[_0x4f92('0x37')]['$gte'][_0x4f92('0x2e')](',');var _0x26adb5={};_0x26adb5[_0x4b95a9[0x0]]={'$gte':moment(_0x4b95a9[0x1])['format'](_0x4f92('0xb7'))};_0x3324f2['where']=_[_0x4f92('0x8f')](_0x3324f2[_0x4f92('0x70')],_0x26adb5);}_0x3324f2=_[_0x4f92('0x8f')]({},_0x3324f2,_0x159e75['options']);return db['OpenchannelMessage'][_0x4f92('0x1e')]({'where':_0x3324f2[_0x4f92('0x70')]})['then'](function(_0x134865){_0x48ab33['count']=_0x134865;if(_0x159e75[_0x4f92('0x37')][_0x4f92('0xb8')]){_0x3324f2[_0x4f92('0xad')]=[{'all':!![]}];}return db[_0x4f92('0xb5')][_0x4f92('0xb9')](_0x3324f2);})[_0x4f92('0x26')](function(_0x4c14be){_0x48ab33['rows']=_0x4c14be;return _0x48ab33;});}})['then'](respondWithFilteredResult(_0x38aa36,_0x3324f2))[_0x4f92('0x31')](handleError(_0x38aa36,null));};exports[_0x4f92('0xba')]=function(_0x2787fb,_0x7d9fe2,_0x30252c){return db['OpenchannelInteraction'][_0x4f92('0x5d')]({'where':{'id':_0x2787fb[_0x4f92('0xaa')]['id']}})[_0x4f92('0x26')](handleEntityNotFound(_0x7d9fe2,null))[_0x4f92('0x26')](function(_0x5708f4){if(_0x5708f4){return _0x5708f4[_0x4f92('0xbb')](_0x2787fb['body'][_0x4f92('0xb2')],_[_0x4f92('0xb3')](_0x2787fb[_0x4f92('0x66')],['ids','id'])||{})[_0x4f92('0xbc')](function(){return db['Tag'][_0x4f92('0xb9')]({'attributes':['id',_0x4f92('0x29'),_0x4f92('0x41')],'where':{'id':_0x2787fb[_0x4f92('0x66')][_0x4f92('0xb2')]}});})['then'](function(_0x39f25a){socket['emit']('openchannelInteractionTags:save',{'id':Number(_0x2787fb[_0x4f92('0xaa')]['id']),'tags':_0x39f25a||[]});return{'id':Number(_0x2787fb[_0x4f92('0xaa')]['id']),'tags':_0x39f25a||[]};});}})[_0x4f92('0x26')](respondWithResult(_0x7d9fe2,null))[_0x4f92('0x31')](handleError(_0x7d9fe2,null));};exports[_0x4f92('0xbd')]=function(_0x18c5fb,_0x44d639,_0x4125d2){return db[_0x4f92('0xab')]['find']({'where':{'id':_0x18c5fb['params']['id']}})[_0x4f92('0x26')](handleEntityNotFound(_0x44d639,null))['then'](function(_0x111e1b){if(_0x111e1b){return _0x111e1b['removeTags'](_0x18c5fb[_0x4f92('0x37')][_0x4f92('0xb2')]);}})[_0x4f92('0x26')](respondWithStatusCode(_0x44d639,null))[_0x4f92('0x31')](handleError(_0x44d639,null));};exports[_0x4f92('0xbe')]=function(_0x47bd6b,_0x32cd28){var _0x5e2954=moment()[_0x4f92('0xbf')]()[_0x4f92('0x8e')]();var _0x5aedd6=path[_0x4f92('0xc0')](config[_0x4f92('0xc1')],_0x4f92('0xc2'),'files',_0x4f92('0xc3'));var _0xcd335e=path[_0x4f92('0xc0')](config['root'],'server',_0x4f92('0xc4'),_0x4f92('0xc5'));var _0xe6e73c=path[_0x4f92('0xc0')](_0x5aedd6,_0x5e2954);var _0x16d9c8=util['format']('transcript-%d-%s.zip',_0x47bd6b[_0x4f92('0xaa')]['id'],_0x5e2954);var _0x5a33d0=path[_0x4f92('0xc0')](_0x5aedd6,_0x16d9c8);var _0x33929c=[];_0x33929c[_0x4f92('0xa6')]({'model':db[_0x4f92('0xc6')],'as':_0x4f92('0xc6'),'attributes':['id',_0x4f92('0x2c')],'raw':!![]});_0x33929c[_0x4f92('0xa6')]({'model':db[_0x4f92('0xc7')],'as':_0x4f92('0xc8'),'attributes':['id','firstName','lastName'],'raw':!![]});if(_0x47bd6b[_0x4f92('0x37')][_0x4f92('0xc5')]){_0x33929c[_0x4f92('0xa6')]({'model':db[_0x4f92('0xc9')],'as':'Attachment','raw':!![]});}var _0x41e49f=[{'model':db[_0x4f92('0xb5')],'as':'Messages','attributes':['id',_0x4f92('0x66'),_0x4f92('0xca'),'direction',_0x4f92('0xcb'),'read'],'include':_0x33929c}];_0x41e49f[_0x4f92('0xa6')]({'model':db[_0x4f92('0xcc')],'as':_0x4f92('0xcd'),'attributes':['id','name']});_0x41e49f['push']({'model':db['User'],'as':'Owner','attributes':['id','fullname']});return db[_0x4f92('0xab')][_0x4f92('0x5d')]({'where':{'id':_0x47bd6b[_0x4f92('0xaa')]['id']},'include':_0x41e49f})[_0x4f92('0x26')](handleEntityNotFound(_0x32cd28,null))['then'](function(_0x2a1364){if(_0x2a1364){var _0x24393e=_0x2a1364[_0x4f92('0xce')]({'plain':!![]});fs['mkdirSync'](_0xe6e73c);var _0x354ec0={'format':'A4','border':_0x4f92('0xcf'),'header':{'height':_0x4f92('0xd0'),'contents':{'first':_0x4f92('0xd1')}},'footer':{'height':'30px','contents':{'default':util['format'](_0x4f92('0xd2'),util[_0x4f92('0xd3')](_0x4f92('0xd4'),_0x4f92('0xd5'),_0x24393e['id']),moment()[_0x4f92('0xd3')](_0x4f92('0xd6'))[_0x4f92('0x8e')]())}}};var _0x1202ae={'channel':_0x4f92('0xd5'),'account':_0x24393e[_0x4f92('0xcd')][_0x4f92('0x29')],'agent':_0x24393e[_0x4f92('0xd7')]?_0x24393e['Owner'][_0x4f92('0x2c')]:_0x4f92('0xd8'),'createdAt':moment(_0x24393e['createdAt'])[_0x4f92('0xd3')](_0x4f92('0xb7'))[_0x4f92('0x8e')](),'closedAt':_0x24393e[_0x4f92('0xd9')]?moment(_0x24393e[_0x4f92('0xda')])['format'](_0x4f92('0xb7'))[_0x4f92('0x8e')]():'','disposition':_0x24393e[_0x4f92('0xdb')],'visibility':_0x24393e['threadId']?_0x4f92('0xdc'):_0x4f92('0xdd'),'messages':_(_0x24393e['Messages'])[_0x4f92('0x78')]({'secret':![]})[_0x4f92('0x33')](function(_0x51f011){if(_0x51f011[_0x4f92('0xc9')]){var _0x574a57=path[_0x4f92('0xc0')](_0xcd335e,_0x51f011[_0x4f92('0xc9')][_0x4f92('0xde')]);if(fs['existsSync'](_0x574a57)){fs[_0x4f92('0xdf')](_0x574a57)[_0x4f92('0xe0')](fs[_0x4f92('0xe1')](path[_0x4f92('0xc0')](_0xe6e73c,_0x51f011[_0x4f92('0xc9')][_0x4f92('0xde')])));}}return{'date':moment(_0x51f011[_0x4f92('0xca')])[_0x4f92('0xd3')](_0x4f92('0xb7'))[_0x4f92('0x8e')](),'sender':_0x51f011[_0x4f92('0xe2')]===_0x4f92('0xe3')?_0x51f011[_0x4f92('0xc6')]?_0x51f011[_0x4f92('0xc6')][_0x4f92('0x2c')]:_0x4f92('0xe4'):_0x51f011['Contact'][_0x4f92('0xe5')]+(_0x51f011[_0x4f92('0xc8')][_0x4f92('0xe6')]?'\x20'+_0x51f011[_0x4f92('0xc8')][_0x4f92('0xe6')]:''),'body':_0x51f011[_0x4f92('0xc9')]?_0x51f011[_0x4f92('0xc9')][_0x4f92('0xde')]:_0x51f011[_0x4f92('0x66')],'direction':_0x51f011[_0x4f92('0xe2')]===_0x4f92('0xe3')?'A':'C','secret':_0x51f011['secret'],'read':_0x51f011[_0x4f92('0x73')],'attachment':_0x51f011[_0x4f92('0xc9')]};})['value']()};return ejs[_0x4f92('0xe7')](path['join'](config['root'],_0x4f92('0xc2'),_0x4f92('0xe8'),_0x4f92('0xe9')),{'interaction':_0x1202ae})[_0x4f92('0x26')](function(_0x5de7ba){return new BPromise(function(_0x47b18e,_0x417365){pdf[_0x4f92('0xaf')](_0x5de7ba,_0x354ec0)[_0x4f92('0xea')](path[_0x4f92('0xc0')](_0xe6e73c,'transcript-'+_0x24393e['id']+'-'+_0x5e2954+'.pdf'),function(_0x41dc9c,_0x347419){if(_0x41dc9c)return _0x417365(_0x41dc9c);_0x47b18e(_0x347419);});});})[_0x4f92('0x26')](function(){return new BPromise(function(_0x4336eb,_0x322fcf){zipdir(_0xe6e73c,{'saveTo':_0x5a33d0},function(_0x2d7c33,_0x403084){if(_0x2d7c33)return _0x322fcf(_0x2d7c33);return _0x4336eb(_0x403084);});})[_0x4f92('0x26')](function(){return new BPromise(function(_0x85a692,_0x2f61ce){rimraf(_0xe6e73c,function(_0x5e2d4b){if(_0x5e2d4b)_0x2f61ce(_0x5e2d4b);return _0x85a692();});});})['then'](function(){return _0x32cd28[_0x4f92('0xbe')](_0x5a33d0,_0x16d9c8,function(_0x4561db){if(_0x4561db){console[_0x4f92('0xeb')](_0x4f92('0xec'),_0x4561db);}else{fs[_0x4f92('0xed')](_0x5a33d0);}});});});}else{return _0x32cd28[_0x4f92('0x27')](0xc8);}})[_0x4f92('0x31')](handleError(_0x32cd28,null));};
\ No newline at end of file
+var _0x9efb=['i.*','c.firstName','c.lastName','Contact.lastName','c.email','Contact.email','c.phone','Contact.phone','c.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','ui.OpenchannelInteractionId\x20IN\x20?','groupBy','OpenchannelInteractionId','push','all','params','includeAll','include','options','destroy','describe','OpenchannelMessage','addMessage','ids','omit','getMessages','findOne','$gte','format','findAll','rows','setTags','emit','openchannelInteractionTags:save','removeTags','unix','join','root','server','tmp','files','transcript-%d-%s.zip','fullname','CmContact','Contact','firstName','lastName','attachments','Attachment','Messages','direction','secret','OpenchannelAccount','Owner','get','mkdirSync','30px',' \x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20%s \x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{{page}}/{{pages}} \x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20%s \x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
','%s\x20#%d','Openchannel','Account','N.A.','YYYY-MM-DD\x20HH:mm:ss','closed','closedAt','disposition','threadId','Public','basename','existsSync','pipe','createWriteStream','out','System','renderFile','views','downloadInteraction.html','toFile','transcript-','download','log','unlinkSync','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','crypto','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./openchannelInteraction.socket','status','end','count','offset','limit','set','Content-Range','reject','save','update','then','sendStatus','error','stack','name','send','Users','map','TagIds','split','Tags','catch','index','OpenchannelInteraction','rawAttributes','type','model','query','keys','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','filters','pick','select','field','from','u.id','u.fullname','ui.OpenchannelInteractionId','user_has_openchannel_interactions','left_join','u.id\x20=\x20ui.UserId','openchannel_interactions','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','a.id\x20=\x20i.OpenchannelAccountId','openchannel_messages','me.OpenchannelInteractionId\x20=\x20i.id','it.OpenchannelInteractionId\x20=\x20i.id','tools_tags','t.id\x20=\x20it.TagId','expr','search','parseSearch','conditions','length','find','unreadMessages','value','`\x20=\x200','`\x20>\x200','operator','$substring','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','text','start','Tag','forEach','union','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','body','some','compact','OpenchannelAccountId','concat','createdAt','parse','where','\x20IS\x20NULL','\x20=\x20?','read','having','`unreadMessages`\x20=\x200','tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','filter','\x27\x27\x27\x27','isNumeric','i.id\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','i.from\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','i.id','QueryTypes','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','isEmpty','t.id\x20IN\x20?','resolve','journey','i.OpenchannelAccountId\x20IS\x20NOT\x20NULL','user','getOpenchannelAccounts','i.OpenchannelAccountId\x20IS\x20NULL','i.OpenchannelAccountId\x20IN\x20?','sequelize','toString','keyBy','merge','a.key','Account.key','Account.mandatoryDisposition'];(function(_0x1ee0ef,_0x313286){var _0x160235=function(_0x3b2aba){while(--_0x3b2aba){_0x1ee0ef['push'](_0x1ee0ef['shift']());}};_0x160235(++_0x313286);}(_0x9efb,0x143));var _0xb9ef=function(_0x332e4c,_0x5589cc){_0x332e4c=_0x332e4c-0x0;var _0x1ecc62=_0x9efb[_0x332e4c];return _0x1ecc62;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xb9ef('0x0'));var rimraf=require(_0xb9ef('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb9ef('0x2'));var rp=require(_0xb9ef('0x3'));var moment=require('moment');var BPromise=require(_0xb9ef('0x4'));var Mustache=require(_0xb9ef('0x5'));var util=require(_0xb9ef('0x6'));var path=require(_0xb9ef('0x7'));var sox=require(_0xb9ef('0x8'));var csv=require(_0xb9ef('0x9'));var ejs=require(_0xb9ef('0xa'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0xb9ef('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xb9ef('0x9'));var querystring=require(_0xb9ef('0xc'));var Papa=require(_0xb9ef('0xd'));var Redis=require(_0xb9ef('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xb9ef('0xf'));var as=require(_0xb9ef('0x10'));var hardwareService=require(_0xb9ef('0x11'));var logger=require(_0xb9ef('0x12'))('api');var utils=require(_0xb9ef('0x13'));var config=require(_0xb9ef('0x14'));var db=require(_0xb9ef('0x15'))['db'];config[_0xb9ef('0x16')]=_[_0xb9ef('0x17')](config[_0xb9ef('0x16')],{'host':_0xb9ef('0x18'),'port':0x18eb});var socket=require(_0xb9ef('0x19'))(new Redis(config[_0xb9ef('0x16')]));require(_0xb9ef('0x1a'))['register'](socket);function respondWithStatusCode(_0x1580b1,_0x3a01fe){_0x3a01fe=_0x3a01fe||0xcc;return function(_0x512fe8){if(_0x512fe8){return _0x1580b1['sendStatus'](_0x3a01fe);}return _0x1580b1[_0xb9ef('0x1b')](_0x3a01fe)[_0xb9ef('0x1c')]();};}function respondWithResult(_0x185902,_0x11fb09){_0x11fb09=_0x11fb09||0xc8;return function(_0x51c9fa){if(_0x51c9fa){return _0x185902['status'](_0x11fb09)['json'](_0x51c9fa);}};}function respondWithFilteredResult(_0xf155f0,_0x18a58d){return function(_0x51a3e8){if(_0x51a3e8){var _0x386ef3=_0x51a3e8[_0xb9ef('0x1d')],_0x296df6=_0x18a58d[_0xb9ef('0x1e')],_0x4cc517=_0x18a58d[_0xb9ef('0x1e')]+_0x18a58d[_0xb9ef('0x1f')],_0x2387e2;if(_0x4cc517>=_0x386ef3){_0x4cc517=_0x386ef3;_0x2387e2=0xc8;}else{_0x2387e2=0xce;}_0xf155f0[_0xb9ef('0x1b')](_0x2387e2);return _0xf155f0[_0xb9ef('0x20')](_0xb9ef('0x21'),_0x296df6+'-'+_0x4cc517+'/'+_0x386ef3)['json'](_0x51a3e8);}return null;};}function patchUpdates(_0x43b069){return function(_0x45371d){try{jsonpatch['apply'](_0x45371d,_0x43b069,!![]);}catch(_0x42b88f){return BPromise[_0xb9ef('0x22')](_0x42b88f);}return _0x45371d[_0xb9ef('0x23')]();};}function saveUpdates(_0x2f75c1,_0x56162c){return function(_0x9a6690){if(_0x9a6690){return _0x9a6690[_0xb9ef('0x24')](_0x2f75c1)[_0xb9ef('0x25')](function(_0x55143c){return _0x55143c;});}return null;};}function removeEntity(_0x2ad52b,_0x576ac0){return function(_0x5c5622){if(_0x5c5622){return _0x5c5622['destroy']()[_0xb9ef('0x25')](function(){_0x2ad52b[_0xb9ef('0x1b')](0xcc)[_0xb9ef('0x1c')]();});}};}function handleEntityNotFound(_0x267a9a,_0x4d00dc){return function(_0x10991b){if(!_0x10991b){_0x267a9a[_0xb9ef('0x26')](0x194);}return _0x10991b;};}function handleError(_0x596641,_0x43b6d7){_0x43b6d7=_0x43b6d7||0x1f4;return function(_0x11d58f){logger[_0xb9ef('0x27')](_0x11d58f[_0xb9ef('0x28')]);if(_0x11d58f[_0xb9ef('0x29')]){delete _0x11d58f['name'];}_0x596641['status'](_0x43b6d7)[_0xb9ef('0x2a')](_0x11d58f);};}function getInteractionUsers(_0x1fc456,_0x3f36e9){return new BPromise(function(_0x440e78,_0x25a30f){try{if(_0x3f36e9[_0x1fc456['id']]){_0x1fc456[_0xb9ef('0x2b')]=_[_0xb9ef('0x2c')](_0x3f36e9[_0x1fc456['id']],function(_0x124f4f){return{'id':_0x124f4f['id'],'fullname':_0x124f4f['fullname']};});}}catch(_0x2853ae){_0x25a30f(_0x2853ae);}_0x440e78(_0x1fc456);});}function getInteractionTags(_0x43e4eb,_0xd96258){return new BPromise(function(_0x557b0c,_0x580f50){try{if(_0x43e4eb[_0xb9ef('0x2d')]){_0x43e4eb['Tags']=[];_0x43e4eb[_0xb9ef('0x2d')][_0xb9ef('0x2e')](',')['forEach'](function(_0x1f78a1){_0x43e4eb[_0xb9ef('0x2f')]['push'](_0xd96258[_0x1f78a1]);});}delete _0x43e4eb[_0xb9ef('0x2d')];}catch(_0x446853){_0x580f50(_0x446853);}_0x557b0c(_0x43e4eb);});}function updateOpenchannelInteraction(_0xf5648,_0x146fcf,_0x1fbbba){return new BPromise(function(_0x41fce2,_0x1fede3){return getInteractionUsers(_0xf5648,_0x1fbbba)[_0xb9ef('0x25')](function(_0x15f360){return getInteractionTags(_0x15f360,_0x146fcf);})[_0xb9ef('0x25')](function(_0x449929){_0x41fce2(_0x449929);})[_0xb9ef('0x30')](function(_0x5b5584){_0x1fede3(_0x5b5584);});});}exports[_0xb9ef('0x31')]=function(_0x24bf9c,_0x4fd975){var _0xde6866={},_0xb0db0c={},_0x1cc73e={'count':0x0,'rows':[]};var _0x967de5=_[_0xb9ef('0x2c')](db[_0xb9ef('0x32')][_0xb9ef('0x33')],function(_0x588221){return{'name':_0x588221['fieldName'],'type':_0x588221[_0xb9ef('0x34')]['key']};});_0xb0db0c[_0xb9ef('0x35')]=_[_0xb9ef('0x2c')](_0x967de5,_0xb9ef('0x29'));_0xb0db0c[_0xb9ef('0x36')]=_[_0xb9ef('0x37')](_0x24bf9c[_0xb9ef('0x36')]);_0xb0db0c['filters']=_['intersection'](_0xb0db0c[_0xb9ef('0x35')],_0xb0db0c['query']);_0xde6866[_0xb9ef('0x38')]=_[_0xb9ef('0x39')](_0xb0db0c[_0xb9ef('0x35')],qs[_0xb9ef('0x3a')](_0x24bf9c[_0xb9ef('0x36')][_0xb9ef('0x3a')]));_0xde6866[_0xb9ef('0x38')]=_0xde6866[_0xb9ef('0x38')]['length']?_0xde6866[_0xb9ef('0x38')]:_0xb0db0c[_0xb9ef('0x35')];if(!_0x24bf9c[_0xb9ef('0x36')][_0xb9ef('0x3b')](_0xb9ef('0x3c'))){_0xde6866[_0xb9ef('0x1f')]=qs[_0xb9ef('0x1f')](_0x24bf9c[_0xb9ef('0x36')][_0xb9ef('0x1f')]);_0xde6866[_0xb9ef('0x1e')]=qs[_0xb9ef('0x1e')](_0x24bf9c['query']['offset']);}_0xde6866[_0xb9ef('0x3d')]=qs[_0xb9ef('0x3e')](_0x24bf9c[_0xb9ef('0x36')][_0xb9ef('0x3e')]);_0xde6866['where']=qs[_0xb9ef('0x3f')](_[_0xb9ef('0x40')](_0x24bf9c['query'],_0xb0db0c[_0xb9ef('0x3f')]),_0x967de5);var _0x25bdb2=[];var _0x17f898=squel[_0xb9ef('0x41')]()['field']('id')[_0xb9ef('0x42')](_0xb9ef('0x29'))['field']('color')[_0xb9ef('0x43')]('tools_tags');var _0x112c40=squel['select']()[_0xb9ef('0x42')](_0xb9ef('0x44'))[_0xb9ef('0x42')](_0xb9ef('0x45'))[_0xb9ef('0x42')](_0xb9ef('0x46'))['from'](_0xb9ef('0x47'),'ui')[_0xb9ef('0x48')]('users','u',_0xb9ef('0x49'));var _0x2b863f=squel[_0xb9ef('0x41')]()[_0xb9ef('0x43')](_0xb9ef('0x4a'),'i')[_0xb9ef('0x48')]('cm_contacts','c',_0xb9ef('0x4b'))['left_join']('users','o',_0xb9ef('0x4c'))[_0xb9ef('0x48')]('openchannel_accounts','a',_0xb9ef('0x4d'))[_0xb9ef('0x48')](_0xb9ef('0x4e'),'me',_0xb9ef('0x4f'))[_0xb9ef('0x48')]('openchannel_interaction_has_tags','it',_0xb9ef('0x50'))['left_join'](_0xb9ef('0x51'),'t',_0xb9ef('0x52'));var _0x290994=squel[_0xb9ef('0x53')]();var _0x1a71bc=[];var _0x1cbd3f=squel[_0xb9ef('0x53')]();var _0x20f6d5;if(_0x24bf9c['query'][_0xb9ef('0x54')]){_0x20f6d5=as[_0xb9ef('0x55')](_0x24bf9c[_0xb9ef('0x36')][_0xb9ef('0x54')]);var _0x382720=_0x20f6d5['sqlOperator'];for(var _0x218816=0x0;_0x218816<_0x20f6d5[_0xb9ef('0x56')][_0xb9ef('0x57')];_0x218816++){var _0x1f0e25=_0x20f6d5['conditions'][_0x218816];var _0x3da75f='i';var _0x52dab9=_[_0xb9ef('0x58')](_0x967de5,[_0xb9ef('0x29'),_0x1f0e25[_0xb9ef('0x42')]]);if(!_0x52dab9){switch(_0x1f0e25[_0xb9ef('0x42')]){case _0xb9ef('0x59'):if(_0x1f0e25[_0xb9ef('0x5a')]==0x1){_0x2b863f['having']('`'+_0x1f0e25[_0xb9ef('0x42')]+_0xb9ef('0x5b'));}else{_0x2b863f['having']('`'+_0x1f0e25[_0xb9ef('0x42')]+_0xb9ef('0x5c'));}break;case'Contact':if(_0x1f0e25[_0xb9ef('0x5d')]===_0xb9ef('0x5e')){if(_0x1f0e25['value'][_0xb9ef('0x2e')]('\x20')['length']>0x1){_0x290994[_0x382720]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0xb9ef('0x5f')](_0x1f0e25['value']),null);}else{var _0x1e66c9='%'+_0x1f0e25['value']+'%';_0x290994[_0x382720](_0xb9ef('0x60'),_0x1e66c9,_0x1e66c9,_0x1e66c9);}}else{_0x52dab9=_[_0xb9ef('0x58')](_0x967de5,[_0xb9ef('0x29'),_0xb9ef('0x61')]);_0x1f0e25[_0xb9ef('0x42')]=_0xb9ef('0x61');_0x35f135=as[_0xb9ef('0x62')](_0x3da75f,_0x52dab9['type'],_0x1f0e25);_0x290994[_0x382720](_0x35f135[_0xb9ef('0x63')],_0x35f135[_0xb9ef('0x5a')][_0xb9ef('0x64')],_0x35f135[_0xb9ef('0x5a')]['end']);}break;case _0xb9ef('0x65'):var _0x249a04=_0x1f0e25[_0xb9ef('0x5a')]['split'](',')[_0xb9ef('0x2c')](function(_0x1310d4){return Number(_0x1310d4);});_0x249a04[_0xb9ef('0x66')](function(_0xc2e837){_0x1cbd3f['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0xc2e837+',%');});_0x1a71bc=_[_0xb9ef('0x67')](_0x1a71bc,_0x249a04);break;case _0xb9ef('0x68'):if(_0x1f0e25[_0xb9ef('0x5d')]===_0xb9ef('0x5e')){_0x290994[_0x382720](_0xb9ef('0x69'),'%'+_0x1f0e25[_0xb9ef('0x5a')]+'%',null);}else{_0x52dab9=_[_0xb9ef('0x58')](_0x967de5,[_0xb9ef('0x29'),'UserId']);_0x1f0e25['field']=_0xb9ef('0x6a');_0x35f135=as[_0xb9ef('0x62')](_0x3da75f,_0x52dab9['type'],_0x1f0e25);_0x290994[_0x382720](_0x35f135[_0xb9ef('0x63')],_0x35f135['value']['start'],_0x35f135[_0xb9ef('0x5a')][_0xb9ef('0x1c')]);}break;case _0xb9ef('0x6b'):_0x35f135=as[_0xb9ef('0x62')]('me',null,_0x1f0e25);_0x290994[_0x382720](_0x35f135['text'],_0x35f135['value'][_0xb9ef('0x64')],_0x35f135[_0xb9ef('0x5a')][_0xb9ef('0x1c')]);break;}}else{var _0x35f135=as['buildExpression'](_0x3da75f,_0x52dab9['type'],_0x1f0e25);_0x290994[_0x382720](_0x35f135['text'],_0x35f135[_0xb9ef('0x5a')]['start'],_0x35f135['value'][_0xb9ef('0x1c')]);}}}else{var _0x5df8bf=_(_0x24bf9c[_0xb9ef('0x36')])[_0xb9ef('0x37')]()[_0xb9ef('0x2c')](function(_0x4e1aca){return _[_0xb9ef('0x6c')](_0x967de5,[_0xb9ef('0x29'),_0x4e1aca])?_0x4e1aca:undefined;})[_0xb9ef('0x6d')]()['value']();if(!_['isEmpty'](_0x5df8bf)){_0x5df8bf[_0xb9ef('0x66')](function(_0x32a622){if(_0x32a622===_0xb9ef('0x6e')){_0x2b863f['where']('i.OpenchannelAccountId\x20IN\x20?',[][_0xb9ef('0x6f')](_0x24bf9c[_0xb9ef('0x36')][_0x32a622]));}else if(_0x32a622===_0xb9ef('0x70')){var _0x36fad6=JSON[_0xb9ef('0x71')](_0x24bf9c[_0xb9ef('0x36')][_0x32a622])['$gte'];var _0x50fc37=JSON[_0xb9ef('0x71')](_0x24bf9c[_0xb9ef('0x36')][_0x32a622])['$lte'];_0x2b863f[_0xb9ef('0x72')]('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x36fad6,_0x50fc37);}else{if(_0x24bf9c['query'][_0x32a622]==='null'){_0x2b863f[_0xb9ef('0x72')]('i.'+_0x32a622+_0xb9ef('0x73'));}else{_0x2b863f[_0xb9ef('0x72')]('i.'+_0x32a622+_0xb9ef('0x74'),_0x24bf9c[_0xb9ef('0x36')][_0x32a622]);}}});}if(_0x24bf9c[_0xb9ef('0x36')][_0xb9ef('0x75')]){if(_0x24bf9c['query'][_0xb9ef('0x75')]==0x1){_0x2b863f[_0xb9ef('0x76')](_0xb9ef('0x77'));}else{_0x2b863f[_0xb9ef('0x76')]('`unreadMessages`\x20>\x200');}}if(_0x24bf9c['query'][_0xb9ef('0x78')]){_0x1a71bc=_['isArray'](_0x24bf9c[_0xb9ef('0x36')][_0xb9ef('0x78')])?_0x24bf9c[_0xb9ef('0x36')][_0xb9ef('0x78')]:new Array(_0x24bf9c[_0xb9ef('0x36')][_0xb9ef('0x78')]);_0x1a71bc[_0xb9ef('0x66')](function(_0x2b6aef){_0x1cbd3f['or'](_0xb9ef('0x79'),'%,'+_0x2b6aef+',%');});}if(_0x24bf9c[_0xb9ef('0x36')][_0xb9ef('0x7a')]){var _0x96672b=_0x24bf9c[_0xb9ef('0x36')][_0xb9ef('0x7a')]['replace']('\x5c','\x5c\x5c')['replace']('\x27\x27',_0xb9ef('0x7b'));if(qs[_0xb9ef('0x7c')](_0x96672b)){_0x290994['or'](_0xb9ef('0x7d'),_0x96672b+'%');}else{_0x290994['or'](_0xb9ef('0x7e'),qs['getFullTextValue'](_0x96672b))['or'](_0xb9ef('0x7f'),_0x96672b+'%')['or'](_0xb9ef('0x80'),_0x96672b+'%');}}}_0x2b863f[_0xb9ef('0x72')](_0x290994);_0x2b863f['group'](_0xb9ef('0x81'));var _0xc118f8={'type':db['Sequelize'][_0xb9ef('0x82')]['SELECT'],'raw':!![]};var _0x157b9=_0x2b863f[_0xb9ef('0x83')]();_0x157b9[_0xb9ef('0x42')](_0xb9ef('0x81'));_0x157b9[_0xb9ef('0x42')](_0xb9ef('0x84'),_0xb9ef('0x59'));if(_0xde6866[_0xb9ef('0x3d')]){_0xde6866[_0xb9ef('0x3d')][_0xb9ef('0x66')](function(_0x33c5ee){_0x2b863f[_0xb9ef('0x3d')]('i.'+_0x33c5ee[0x0],_0x33c5ee[0x1]==='DESC'?![]:!![]);});}if(!_[_0xb9ef('0x85')](_0x1a71bc)){_0x2b863f[_0xb9ef('0x76')](_0x1cbd3f);_0x157b9[_0xb9ef('0x72')](_0xb9ef('0x86'),_0x1a71bc);}BPromise[_0xb9ef('0x87')]()[_0xb9ef('0x25')](function(){if(!_0x20f6d5){if(_0x24bf9c[_0xb9ef('0x36')][_0xb9ef('0x6e')]||_0x24bf9c[_0xb9ef('0x36')][_0xb9ef('0x88')])return;_0x157b9['where'](_0xb9ef('0x89'));_0x2b863f[_0xb9ef('0x72')]('i.OpenchannelAccountId\x20IS\x20NOT\x20NULL');return;}return _0x24bf9c[_0xb9ef('0x8a')][_0xb9ef('0x8b')]({'attributes':['id'],'raw':!![]})[_0xb9ef('0x25')](function(_0x4a83d5){if(_[_0xb9ef('0x85')](_0x4a83d5)){_0x157b9[_0xb9ef('0x72')]('i.OpenchannelAccountId\x20IS\x20NULL');_0x2b863f[_0xb9ef('0x72')](_0xb9ef('0x8c'));}else{_0x157b9[_0xb9ef('0x72')](_0xb9ef('0x8d'),_[_0xb9ef('0x2c')](_0x4a83d5,'id'));_0x2b863f[_0xb9ef('0x72')](_0xb9ef('0x8d'),_[_0xb9ef('0x2c')](_0x4a83d5,'id'));}});})['then'](function(){db[_0xb9ef('0x8e')][_0xb9ef('0x36')](_0x157b9[_0xb9ef('0x8f')](),_0xc118f8)['then'](function(_0x49dc01){_0x1cc73e[_0xb9ef('0x1d')]=_0x49dc01['length'];if(_0x1cc73e[_0xb9ef('0x1d')]===0x0)return[];return db[_0xb9ef('0x8e')]['query'](_0x17f898['toString'](),_0xc118f8)[_0xb9ef('0x25')](function(_0x3ff877){_0x25bdb2=_[_0xb9ef('0x90')](_0x3ff877,'id');_0xc118f8=_[_0xb9ef('0x91')](_0xc118f8,{'model':db['OpenchannelInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x24bf9c[_0xb9ef('0x36')][_0xb9ef('0x3a')]){_0xde6866[_0xb9ef('0x38')][_0xb9ef('0x66')](function(_0x2f7d94){_0x2b863f[_0xb9ef('0x42')]('i.'+_0x2f7d94);});}else{_0x2b863f[_0xb9ef('0x42')](_0xb9ef('0x84'),_0xb9ef('0x59'));_0x2b863f['field'](_0xb9ef('0x92'),_0xb9ef('0x93'));_0x2b863f[_0xb9ef('0x42')]('a.mandatoryDisposition',_0xb9ef('0x94'));_0x2b863f['field'](_0xb9ef('0x95'));_0x2b863f[_0xb9ef('0x42')](_0xb9ef('0x96'),'Contact.firstName');_0x2b863f[_0xb9ef('0x42')](_0xb9ef('0x97'),_0xb9ef('0x98'));_0x2b863f[_0xb9ef('0x42')](_0xb9ef('0x99'),_0xb9ef('0x9a'));_0x2b863f[_0xb9ef('0x42')](_0xb9ef('0x9b'),_0xb9ef('0x9c'));_0x2b863f['field'](_0xb9ef('0x9d'),'Contact.mobile');_0x2b863f[_0xb9ef('0x42')](_0xb9ef('0x9e'),_0xb9ef('0x9f'));_0x2b863f[_0xb9ef('0x42')](_0xb9ef('0xa0'),_0xb9ef('0xa1'));_0x2b863f[_0xb9ef('0x42')](_0xb9ef('0xa2'),_0xb9ef('0xa3'));_0x2b863f[_0xb9ef('0x42')]('GROUP_CONCAT(DISTINCT\x20t.id)','TagIds');}if(_0xde6866[_0xb9ef('0x1f')])_0x2b863f['limit'](_0xde6866[_0xb9ef('0x1f')]);if(_0xde6866[_0xb9ef('0x1e')])_0x2b863f[_0xb9ef('0x1e')](_0xde6866[_0xb9ef('0x1e')]);return db[_0xb9ef('0x8e')][_0xb9ef('0x36')](_0x2b863f[_0xb9ef('0x8f')](),_0xc118f8);})[_0xb9ef('0x25')](function(_0x5e1c1f){_0x112c40[_0xb9ef('0x72')](_0xb9ef('0xa4'),_['map'](_0x5e1c1f,'id'));return db[_0xb9ef('0x8e')][_0xb9ef('0x36')](_0x112c40[_0xb9ef('0x8f')](),_0xc118f8)[_0xb9ef('0x25')](function(_0x3ef20b){var _0x4440a0=_[_0xb9ef('0xa5')](_0x3ef20b,_0xb9ef('0xa6'));var _0x311501=[];_0x5e1c1f[_0xb9ef('0x66')](function(_0x5de35d){_0x311501[_0xb9ef('0xa7')](updateOpenchannelInteraction(_0x5de35d,_0x25bdb2,_0x4440a0));});return BPromise[_0xb9ef('0xa8')](_0x311501);});});})[_0xb9ef('0x25')](function(_0x2cb917){_0x1cc73e['rows']=_0x2cb917;return _0x1cc73e;})[_0xb9ef('0x25')](respondWithFilteredResult(_0x4fd975,_0xde6866));})[_0xb9ef('0x30')](handleError(_0x4fd975,null));};exports['show']=function(_0x37e0d8,_0x2b1851){var _0x46bbd9={'raw':![],'where':{'id':_0x37e0d8[_0xb9ef('0xa9')]['id']}},_0x52c59e={};_0x52c59e[_0xb9ef('0x35')]=_['keys'](db[_0xb9ef('0x32')]['rawAttributes']);_0x52c59e[_0xb9ef('0x36')]=_['keys'](_0x37e0d8[_0xb9ef('0x36')]);_0x52c59e[_0xb9ef('0x3f')]=_[_0xb9ef('0x39')](_0x52c59e['model'],_0x52c59e[_0xb9ef('0x36')]);_0x46bbd9[_0xb9ef('0x38')]=_['intersection'](_0x52c59e[_0xb9ef('0x35')],qs['fields'](_0x37e0d8['query'][_0xb9ef('0x3a')]));_0x46bbd9[_0xb9ef('0x38')]=_0x46bbd9[_0xb9ef('0x38')][_0xb9ef('0x57')]?_0x46bbd9[_0xb9ef('0x38')]:_0x52c59e['model'];if(_0x37e0d8[_0xb9ef('0x36')][_0xb9ef('0xaa')]){_0x46bbd9[_0xb9ef('0xab')]=[{'all':!![]}];}_0x46bbd9=_['merge']({},_0x46bbd9,_0x37e0d8[_0xb9ef('0xac')]);return db[_0xb9ef('0x32')][_0xb9ef('0x58')](_0x46bbd9)['then'](handleEntityNotFound(_0x2b1851,null))[_0xb9ef('0x25')](respondWithResult(_0x2b1851,null))['catch'](handleError(_0x2b1851,null));};exports['create']=function(_0x55c429,_0x2f878b){return db[_0xb9ef('0x32')]['create'](_0x55c429[_0xb9ef('0x6b')],{})[_0xb9ef('0x25')](respondWithResult(_0x2f878b,0xc9))[_0xb9ef('0x30')](handleError(_0x2f878b,null));};exports[_0xb9ef('0x24')]=function(_0x2d09a1,_0x3b6e9b){if(_0x2d09a1['body']['id']){delete _0x2d09a1[_0xb9ef('0x6b')]['id'];}return db[_0xb9ef('0x32')][_0xb9ef('0x58')]({'where':{'id':_0x2d09a1[_0xb9ef('0xa9')]['id']}})[_0xb9ef('0x25')](handleEntityNotFound(_0x3b6e9b,null))['then'](saveUpdates(_0x2d09a1[_0xb9ef('0x6b')],null))[_0xb9ef('0x25')](respondWithResult(_0x3b6e9b,null))[_0xb9ef('0x30')](handleError(_0x3b6e9b,null));};exports[_0xb9ef('0xad')]=function(_0x441058,_0x3fd783){return db[_0xb9ef('0x32')][_0xb9ef('0x58')]({'where':{'id':_0x441058['params']['id']}})[_0xb9ef('0x25')](handleEntityNotFound(_0x3fd783,null))[_0xb9ef('0x25')](removeEntity(_0x3fd783,null))['catch'](handleError(_0x3fd783,null));};exports[_0xb9ef('0xae')]=function(_0x4ea8f7,_0x502241){return db[_0xb9ef('0x32')][_0xb9ef('0xae')]()[_0xb9ef('0x25')](respondWithResult(_0x502241,null))[_0xb9ef('0x30')](handleError(_0x502241,null));};exports['addMessage']=function(_0x2224ff,_0x23a54f,_0x502446){return db[_0xb9ef('0xaf')][_0xb9ef('0x58')]({'where':{'id':_0x2224ff[_0xb9ef('0xa9')]['id']}})[_0xb9ef('0x25')](handleEntityNotFound(_0x23a54f,null))[_0xb9ef('0x25')](function(_0x2869b3){if(_0x2869b3){return _0x2869b3[_0xb9ef('0xb0')](_0x2224ff[_0xb9ef('0x6b')][_0xb9ef('0xb1')],_[_0xb9ef('0xb2')](_0x2224ff[_0xb9ef('0x6b')],[_0xb9ef('0xb1'),'id'])||{});}})[_0xb9ef('0x25')](respondWithResult(_0x23a54f,null))[_0xb9ef('0x30')](handleError(_0x23a54f,null));};exports[_0xb9ef('0xb3')]=function(_0x51aafc,_0x4d2610,_0x571736){var _0x3545ba={'raw':![],'where':{}};var _0x4b7998={};var _0x526c3c={'count':0x0,'rows':[]};return db[_0xb9ef('0x32')][_0xb9ef('0xb4')]({'where':{'id':_0x51aafc['params']['id']}})['then'](handleEntityNotFound(_0x4d2610,null))[_0xb9ef('0x25')](function(_0x133e2d){if(_0x133e2d){_0x4b7998[_0xb9ef('0x35')]=_[_0xb9ef('0x37')](db[_0xb9ef('0xaf')][_0xb9ef('0x33')]);_0x4b7998[_0xb9ef('0x36')]=_[_0xb9ef('0x37')](_0x51aafc[_0xb9ef('0x36')]);_0x4b7998['filters']=_['intersection'](_0x4b7998[_0xb9ef('0x35')],_0x4b7998['query']);_0x3545ba[_0xb9ef('0x38')]=_[_0xb9ef('0x39')](_0x4b7998['model'],qs[_0xb9ef('0x3a')](_0x51aafc[_0xb9ef('0x36')]['fields']));_0x3545ba[_0xb9ef('0x38')]=_0x3545ba[_0xb9ef('0x38')][_0xb9ef('0x57')]?_0x3545ba['attributes']:_0x4b7998[_0xb9ef('0x35')];if(!_0x51aafc[_0xb9ef('0x36')][_0xb9ef('0x3b')]('nolimit')){_0x3545ba['limit']=qs[_0xb9ef('0x1f')](_0x51aafc['query']['limit']);_0x3545ba[_0xb9ef('0x1e')]=qs[_0xb9ef('0x1e')](_0x51aafc[_0xb9ef('0x36')][_0xb9ef('0x1e')]);}_0x3545ba[_0xb9ef('0x3d')]=qs['sort'](_0x51aafc[_0xb9ef('0x36')][_0xb9ef('0x3e')]);_0x3545ba['where']=qs[_0xb9ef('0x3f')](_['pick'](_0x51aafc[_0xb9ef('0x36')],_0x4b7998[_0xb9ef('0x3f')]));_0x3545ba[_0xb9ef('0x72')][_0xb9ef('0xa6')]=_0x133e2d['id'];if(_0x51aafc[_0xb9ef('0x36')][_0xb9ef('0x7a')]){_0x3545ba[_0xb9ef('0x72')]=_['merge'](_0x3545ba[_0xb9ef('0x72')],{'$or':_['map'](_0x3545ba[_0xb9ef('0x38')],function(_0x2a2f01){var _0x26b8c3={};_0x26b8c3[_0x2a2f01]={'$like':'%'+_0x51aafc[_0xb9ef('0x36')]['filter']+'%'};return _0x26b8c3;})});}if(_0x51aafc[_0xb9ef('0x36')]['$gte']){var _0x2f3e05=_0x51aafc[_0xb9ef('0x36')][_0xb9ef('0xb5')]['split'](',');var _0x1096e6={};_0x1096e6[_0x2f3e05[0x0]]={'$gte':moment(_0x2f3e05[0x1])[_0xb9ef('0xb6')]('YYYY-MM-DD\x20HH:mm:ss')};_0x3545ba[_0xb9ef('0x72')]=_[_0xb9ef('0x91')](_0x3545ba[_0xb9ef('0x72')],_0x1096e6);}_0x3545ba=_[_0xb9ef('0x91')]({},_0x3545ba,_0x51aafc[_0xb9ef('0xac')]);return db['OpenchannelMessage'][_0xb9ef('0x1d')]({'where':_0x3545ba['where']})[_0xb9ef('0x25')](function(_0x5c6434){_0x526c3c[_0xb9ef('0x1d')]=_0x5c6434;if(_0x51aafc[_0xb9ef('0x36')][_0xb9ef('0xaa')]){_0x3545ba['include']=[{'all':!![]}];}return db[_0xb9ef('0xaf')][_0xb9ef('0xb7')](_0x3545ba);})[_0xb9ef('0x25')](function(_0x5054b0){_0x526c3c[_0xb9ef('0xb8')]=_0x5054b0;return _0x526c3c;});}})[_0xb9ef('0x25')](respondWithFilteredResult(_0x4d2610,_0x3545ba))[_0xb9ef('0x30')](handleError(_0x4d2610,null));};exports['addTags']=function(_0x438c40,_0x567efc,_0x1e5a8d){return db[_0xb9ef('0x32')][_0xb9ef('0x58')]({'where':{'id':_0x438c40[_0xb9ef('0xa9')]['id']}})[_0xb9ef('0x25')](handleEntityNotFound(_0x567efc,null))[_0xb9ef('0x25')](function(_0x5526f6){if(_0x5526f6){return _0x5526f6[_0xb9ef('0xb9')](_0x438c40[_0xb9ef('0x6b')][_0xb9ef('0xb1')],_[_0xb9ef('0xb2')](_0x438c40['body'],[_0xb9ef('0xb1'),'id'])||{})['spread'](function(){return db[_0xb9ef('0x65')][_0xb9ef('0xb7')]({'attributes':['id',_0xb9ef('0x29'),'color'],'where':{'id':_0x438c40[_0xb9ef('0x6b')][_0xb9ef('0xb1')]}});})['then'](function(_0x410d51){socket[_0xb9ef('0xba')](_0xb9ef('0xbb'),{'id':Number(_0x438c40[_0xb9ef('0xa9')]['id']),'tags':_0x410d51||[]});return{'id':Number(_0x438c40[_0xb9ef('0xa9')]['id']),'tags':_0x410d51||[]};});}})['then'](respondWithResult(_0x567efc,null))[_0xb9ef('0x30')](handleError(_0x567efc,null));};exports[_0xb9ef('0xbc')]=function(_0x5f59b4,_0x376823,_0x45b2ed){return db['OpenchannelInteraction'][_0xb9ef('0x58')]({'where':{'id':_0x5f59b4[_0xb9ef('0xa9')]['id']}})['then'](handleEntityNotFound(_0x376823,null))['then'](function(_0x394ebe){if(_0x394ebe){return _0x394ebe[_0xb9ef('0xbc')](_0x5f59b4[_0xb9ef('0x36')]['ids']);}})['then'](respondWithStatusCode(_0x376823,null))[_0xb9ef('0x30')](handleError(_0x376823,null));};exports['download']=function(_0x9f4c07,_0x4b6cc6){var _0x2e1900=moment()[_0xb9ef('0xbd')]()[_0xb9ef('0x8f')]();var _0x40a7fe=path[_0xb9ef('0xbe')](config[_0xb9ef('0xbf')],_0xb9ef('0xc0'),'files',_0xb9ef('0xc1'));var _0x38b0ba=path['join'](config['root'],_0xb9ef('0xc0'),_0xb9ef('0xc2'),'attachments');var _0x2a4b88=path[_0xb9ef('0xbe')](_0x40a7fe,_0x2e1900);var _0x49a55f=util[_0xb9ef('0xb6')](_0xb9ef('0xc3'),_0x9f4c07[_0xb9ef('0xa9')]['id'],_0x2e1900);var _0x10a4e4=path[_0xb9ef('0xbe')](_0x40a7fe,_0x49a55f);var _0x58835c=[];_0x58835c[_0xb9ef('0xa7')]({'model':db['User'],'as':'User','attributes':['id',_0xb9ef('0xc4')],'raw':!![]});_0x58835c[_0xb9ef('0xa7')]({'model':db[_0xb9ef('0xc5')],'as':_0xb9ef('0xc6'),'attributes':['id',_0xb9ef('0xc7'),_0xb9ef('0xc8')],'raw':!![]});if(_0x9f4c07['query'][_0xb9ef('0xc9')]){_0x58835c[_0xb9ef('0xa7')]({'model':db[_0xb9ef('0xca')],'as':_0xb9ef('0xca'),'raw':!![]});}var _0x3da1c4=[{'model':db['OpenchannelMessage'],'as':_0xb9ef('0xcb'),'attributes':['id',_0xb9ef('0x6b'),_0xb9ef('0x70'),_0xb9ef('0xcc'),_0xb9ef('0xcd'),_0xb9ef('0x75')],'include':_0x58835c}];_0x3da1c4[_0xb9ef('0xa7')]({'model':db[_0xb9ef('0xce')],'as':'Account','attributes':['id',_0xb9ef('0x29')]});_0x3da1c4['push']({'model':db['User'],'as':_0xb9ef('0xcf'),'attributes':['id',_0xb9ef('0xc4')]});return db[_0xb9ef('0x32')][_0xb9ef('0x58')]({'where':{'id':_0x9f4c07[_0xb9ef('0xa9')]['id']},'include':_0x3da1c4})[_0xb9ef('0x25')](handleEntityNotFound(_0x4b6cc6,null))[_0xb9ef('0x25')](function(_0x43eedd){if(_0x43eedd){var _0x7afd2c=_0x43eedd[_0xb9ef('0xd0')]({'plain':!![]});fs[_0xb9ef('0xd1')](_0x2a4b88);var _0x4990d6={'format':'A4','border':'10px','header':{'height':'40px','contents':{'first':'\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
Interaction\x20Transcript \x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20'}},'footer':{'height':_0xb9ef('0xd2'),'contents':{'default':util['format'](_0xb9ef('0xd3'),util[_0xb9ef('0xb6')](_0xb9ef('0xd4'),'Openchannel',_0x7afd2c['id']),moment()['format']('YYYY-MM-DD')[_0xb9ef('0x8f')]())}}};var _0x400d6e={'channel':_0xb9ef('0xd5'),'account':_0x7afd2c[_0xb9ef('0xd6')][_0xb9ef('0x29')],'agent':_0x7afd2c[_0xb9ef('0xcf')]?_0x7afd2c[_0xb9ef('0xcf')][_0xb9ef('0xc4')]:_0xb9ef('0xd7'),'createdAt':moment(_0x7afd2c[_0xb9ef('0x70')])[_0xb9ef('0xb6')](_0xb9ef('0xd8'))[_0xb9ef('0x8f')](),'closedAt':_0x7afd2c[_0xb9ef('0xd9')]?moment(_0x7afd2c[_0xb9ef('0xda')])[_0xb9ef('0xb6')](_0xb9ef('0xd8'))[_0xb9ef('0x8f')]():'','disposition':_0x7afd2c[_0xb9ef('0xdb')],'visibility':_0x7afd2c[_0xb9ef('0xdc')]?_0xb9ef('0xdd'):'Private','messages':_(_0x7afd2c[_0xb9ef('0xcb')])[_0xb9ef('0x7a')]({'secret':![]})[_0xb9ef('0x2c')](function(_0x20ca47){if(_0x20ca47['Attachment']){var _0x2b87bb=path['join'](_0x38b0ba,_0x20ca47['Attachment'][_0xb9ef('0xde')]);if(fs[_0xb9ef('0xdf')](_0x2b87bb)){fs['createReadStream'](_0x2b87bb)[_0xb9ef('0xe0')](fs[_0xb9ef('0xe1')](path['join'](_0x2a4b88,_0x20ca47[_0xb9ef('0xca')][_0xb9ef('0xde')])));}}return{'date':moment(_0x20ca47[_0xb9ef('0x70')])[_0xb9ef('0xb6')](_0xb9ef('0xd8'))['toString'](),'sender':_0x20ca47[_0xb9ef('0xcc')]===_0xb9ef('0xe2')?_0x20ca47[_0xb9ef('0x68')]?_0x20ca47[_0xb9ef('0x68')][_0xb9ef('0xc4')]:_0xb9ef('0xe3'):_0x20ca47[_0xb9ef('0xc6')][_0xb9ef('0xc7')]+(_0x20ca47[_0xb9ef('0xc6')][_0xb9ef('0xc8')]?'\x20'+_0x20ca47['Contact'][_0xb9ef('0xc8')]:''),'body':_0x20ca47[_0xb9ef('0xca')]?_0x20ca47[_0xb9ef('0xca')][_0xb9ef('0xde')]:_0x20ca47[_0xb9ef('0x6b')],'direction':_0x20ca47[_0xb9ef('0xcc')]===_0xb9ef('0xe2')?'A':'C','secret':_0x20ca47[_0xb9ef('0xcd')],'read':_0x20ca47[_0xb9ef('0x75')],'attachment':_0x20ca47['Attachment']};})[_0xb9ef('0x5a')]()};return ejs[_0xb9ef('0xe4')](path[_0xb9ef('0xbe')](config['root'],_0xb9ef('0xc0'),_0xb9ef('0xe5'),_0xb9ef('0xe6')),{'interaction':_0x400d6e})[_0xb9ef('0x25')](function(_0xa506d){return new BPromise(function(_0x109dbb,_0x45ea95){pdf['create'](_0xa506d,_0x4990d6)[_0xb9ef('0xe7')](path[_0xb9ef('0xbe')](_0x2a4b88,_0xb9ef('0xe8')+_0x7afd2c['id']+'-'+_0x2e1900+'.pdf'),function(_0x154617,_0x146aa2){if(_0x154617)return _0x45ea95(_0x154617);_0x109dbb(_0x146aa2);});});})[_0xb9ef('0x25')](function(){return new BPromise(function(_0x25210a,_0x14ad99){zipdir(_0x2a4b88,{'saveTo':_0x10a4e4},function(_0x38b911,_0x497443){if(_0x38b911)return _0x14ad99(_0x38b911);return _0x25210a(_0x497443);});})['then'](function(){return new BPromise(function(_0x22186f,_0x52a46a){rimraf(_0x2a4b88,function(_0x52adcb){if(_0x52adcb)_0x52a46a(_0x52adcb);return _0x22186f();});});})['then'](function(){return _0x4b6cc6[_0xb9ef('0xe9')](_0x10a4e4,_0x49a55f,function(_0x5dae23){if(_0x5dae23){console[_0xb9ef('0xea')]('err',_0x5dae23);}else{fs[_0xb9ef('0xeb')](_0x10a4e4);}});});});}else{return _0x4b6cc6[_0xb9ef('0x26')](0xc8);}})['catch'](handleError(_0x4b6cc6,null));};
\ No newline at end of file
diff --git a/server/api/openchannelInteraction/openchannelInteraction.events.js b/server/api/openchannelInteraction/openchannelInteraction.events.js
index cb45550..915d408 100644
--- a/server/api/openchannelInteraction/openchannelInteraction.events.js
+++ b/server/api/openchannelInteraction/openchannelInteraction.events.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x23f2=['unreadMessages','length','emit','catch','hasOwnProperty','hook','exports','events','../../mysqldb','OpenchannelInteraction','OpenchannelMessage','setMaxListeners','save','update','then','setDataValue','Users','map','findAll'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x23f2,0x137));var _0x223f=function(_0x1116ef,_0x225946){_0x1116ef=_0x1116ef-0x0;var _0x2af2cc=_0x23f2[_0x1116ef];return _0x2af2cc;};'use strict';var EventEmitter=require(_0x223f('0x0'));var OpenchannelInteraction=require(_0x223f('0x1'))['db'][_0x223f('0x2')];var OpenchannelMessage=require('../../mysqldb')['db'][_0x223f('0x3')];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents[_0x223f('0x4')](0x0);var events={'afterCreate':_0x223f('0x5'),'afterUpdate':_0x223f('0x6'),'afterDestroy':'remove'};function emitEvent(_0x2c0e54){return function(_0x90e5b2,_0x5c1884,_0x386c37){_0x90e5b2['getUsers']({'attributes':['id'],'raw':!![]})[_0x223f('0x7')](function(_0x375f4b){_0x90e5b2[_0x223f('0x8')](_0x223f('0x9'),_0x375f4b[_0x223f('0xa')](function(_0x3a0cb8){return{'id':_0x3a0cb8['id']};}));return OpenchannelMessage[_0x223f('0xb')]({'where':{'OpenchannelInteractionId':_0x90e5b2['id'],'direction':'in','read':![]},'raw':!![]});})[_0x223f('0x7')](function(_0x24229c){_0x90e5b2['setDataValue'](_0x223f('0xc'),_0x24229c[_0x223f('0xd')]);OpenchannelInteractionEvents[_0x223f('0xe')](_0x2c0e54+':'+_0x90e5b2['id'],_0x90e5b2);OpenchannelInteractionEvents[_0x223f('0xe')](_0x2c0e54,_0x90e5b2);_0x386c37(null);})[_0x223f('0xf')](_0x386c37(null));};}for(var e in events){if(events[_0x223f('0x10')](e)){var event=events[e];OpenchannelInteraction[_0x223f('0x11')](e,emitEvent(event));}}module[_0x223f('0x12')]=OpenchannelInteractionEvents;
\ No newline at end of file
+var _0xd19c=['save','remove','getUsers','then','Users','findAll','setDataValue','emit','catch','events','../../mysqldb','OpenchannelInteraction','OpenchannelMessage','setMaxListeners'];(function(_0x580576,_0x2f107d){var _0x3f55a0=function(_0x2e180b){while(--_0x2e180b){_0x580576['push'](_0x580576['shift']());}};_0x3f55a0(++_0x2f107d);}(_0xd19c,0x113));var _0xcd19=function(_0x38e1c3,_0x421148){_0x38e1c3=_0x38e1c3-0x0;var _0x451552=_0xd19c[_0x38e1c3];return _0x451552;};'use strict';var EventEmitter=require(_0xcd19('0x0'));var OpenchannelInteraction=require(_0xcd19('0x1'))['db'][_0xcd19('0x2')];var OpenchannelMessage=require(_0xcd19('0x1'))['db'][_0xcd19('0x3')];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents[_0xcd19('0x4')](0x0);var events={'afterCreate':_0xcd19('0x5'),'afterUpdate':'update','afterDestroy':_0xcd19('0x6')};function emitEvent(_0x46fc77){return function(_0x4bccb2,_0x3131ae,_0x151b6b){_0x4bccb2[_0xcd19('0x7')]({'attributes':['id'],'raw':!![]})[_0xcd19('0x8')](function(_0x450acc){_0x4bccb2['setDataValue'](_0xcd19('0x9'),_0x450acc['map'](function(_0x1ab503){return{'id':_0x1ab503['id']};}));return OpenchannelMessage[_0xcd19('0xa')]({'where':{'OpenchannelInteractionId':_0x4bccb2['id'],'direction':'in','read':![]},'raw':!![]});})[_0xcd19('0x8')](function(_0x256c48){_0x4bccb2[_0xcd19('0xb')]('unreadMessages',_0x256c48['length']);OpenchannelInteractionEvents[_0xcd19('0xc')](_0x46fc77+':'+_0x4bccb2['id'],_0x4bccb2);OpenchannelInteractionEvents[_0xcd19('0xc')](_0x46fc77,_0x4bccb2);_0x151b6b(null);})[_0xcd19('0xd')](_0x151b6b(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelInteraction['hook'](e,emitEvent(event));}}module['exports']=OpenchannelInteractionEvents;
\ No newline at end of file
diff --git a/server/api/openchannelInteraction/openchannelInteraction.model.js b/server/api/openchannelInteraction/openchannelInteraction.model.js
index 47e73f5..b184113 100644
--- a/server/api/openchannelInteraction/openchannelInteraction.model.js
+++ b/server/api/openchannelInteraction/openchannelInteraction.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x31fd=['YYYY-MM-DD\x20HH:mm:ss','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','define','OpenchannelInteraction','openchannel_interactions','closed','closedAt','format'];(function(_0x3e5086,_0x48f4a2){var _0xfeb102=function(_0x5a945f){while(--_0x5a945f){_0x3e5086['push'](_0x3e5086['shift']());}};_0xfeb102(++_0x48f4a2);}(_0x31fd,0x121));var _0xd31f=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x31fd[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0xd31f('0x0'));var util=require(_0xd31f('0x1'));var logger=require('../../config/logger')(_0xd31f('0x2'));var moment=require(_0xd31f('0x3'));var BPromise=require(_0xd31f('0x4'));var rp=require(_0xd31f('0x5'));var fs=require('fs');var path=require(_0xd31f('0x6'));var rimraf=require(_0xd31f('0x7'));var config=require(_0xd31f('0x8'));var attributes=require('./openchannelInteraction.attributes');module['exports']=function(_0x1dd5e2,_0x3b880d){return _0x1dd5e2[_0xd31f('0x9')](_0xd31f('0xa'),attributes,{'tableName':_0xd31f('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x3921b2,_0x53a068,_0x10a80f){if(_0x3921b2['changed'](_0xd31f('0xc'))){_0x3921b2[_0xd31f('0xd')]=moment()[_0xd31f('0xe')](_0xd31f('0xf'));}_0x10a80f(null,_0x3921b2);}}});};
\ No newline at end of file
+var _0xc2f0=['./openchannelInteraction.attributes','exports','define','OpenchannelInteraction','changed','closedAt','lodash','api','moment','request-promise','path','rimraf','../../config/environment'];(function(_0x2247ab,_0x3f4162){var _0x430062=function(_0x591dd7){while(--_0x591dd7){_0x2247ab['push'](_0x2247ab['shift']());}};_0x430062(++_0x3f4162);}(_0xc2f0,0xfd));var _0x0c2f=function(_0x40fe6a,_0x1a4901){_0x40fe6a=_0x40fe6a-0x0;var _0x34dcc3=_0xc2f0[_0x40fe6a];return _0x34dcc3;};'use strict';var _=require(_0x0c2f('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x0c2f('0x1'));var moment=require(_0x0c2f('0x2'));var BPromise=require('bluebird');var rp=require(_0x0c2f('0x3'));var fs=require('fs');var path=require(_0x0c2f('0x4'));var rimraf=require(_0x0c2f('0x5'));var config=require(_0x0c2f('0x6'));var attributes=require(_0x0c2f('0x7'));module[_0x0c2f('0x8')]=function(_0x639e6d,_0x2a331d){return _0x639e6d[_0x0c2f('0x9')](_0x0c2f('0xa'),attributes,{'tableName':'openchannel_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x5d9b1e,_0x10536b,_0x4a9669){if(_0x5d9b1e[_0x0c2f('0xb')]('closed')){_0x5d9b1e[_0x0c2f('0xc')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');}_0x4a9669(null,_0x5d9b1e);}}});};
\ No newline at end of file
diff --git a/server/api/openchannelInteraction/openchannelInteraction.rpc.js b/server/api/openchannelInteraction/openchannelInteraction.rpc.js
index 7082cc3..a34cfc2 100644
--- a/server/api/openchannelInteraction/openchannelInteraction.rpc.js
+++ b/server/api/openchannelInteraction/openchannelInteraction.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xd032=['socket.io-emitter','./openchannelInteraction.socket','register','then','info','OpenchannelInteraction,\x20%s,\x20%s','request\x20sent','debug','OpenchannelInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','UpdateOpenchannelInteraction','update','body','options','where','limit','AddTagsToOpenchannelInteraction','OpenchannelInteraction','find','addTags','ids','AddTags','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults'];(function(_0x5d282e,_0x39dead){var _0x237f0e=function(_0x28447e){while(--_0x28447e){_0x5d282e['push'](_0x5d282e['shift']());}};_0x237f0e(++_0x39dead);}(_0xd032,0x1f4));var _0x2d03=function(_0x220f3f,_0x11c540){_0x220f3f=_0x220f3f-0x0;var _0x1f170e=_0xd032[_0x220f3f];return _0x1f170e;};'use strict';var _=require(_0x2d03('0x0'));var util=require(_0x2d03('0x1'));var moment=require(_0x2d03('0x2'));var BPromise=require(_0x2d03('0x3'));var rs=require(_0x2d03('0x4'));var fs=require('fs');var Redis=require(_0x2d03('0x5'));var db=require(_0x2d03('0x6'))['db'];var utils=require(_0x2d03('0x7'));var logger=require(_0x2d03('0x8'))(_0x2d03('0x9'));var config=require(_0x2d03('0xa'));var jayson=require(_0x2d03('0xb'));var client=jayson[_0x2d03('0xc')][_0x2d03('0xd')]({'port':0x232a});config[_0x2d03('0xe')]=_[_0x2d03('0xf')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x2d03('0x10'))(new Redis(config['redis']));require(_0x2d03('0x11'))[_0x2d03('0x12')](socket);function respondWithRpcPromise(_0x5d2c05,_0x55fca5,_0x1c1f2a){return new BPromise(function(_0x5508fb,_0x3d6c23){return client['request'](_0x5d2c05,_0x1c1f2a)[_0x2d03('0x13')](function(_0x5ab395){logger[_0x2d03('0x14')](_0x2d03('0x15'),_0x55fca5,_0x2d03('0x16'));logger[_0x2d03('0x17')](_0x2d03('0x18'),_0x55fca5,'request\x20sent',JSON[_0x2d03('0x19')](_0x5ab395));if(_0x5ab395[_0x2d03('0x1a')]){if(_0x5ab395[_0x2d03('0x1a')][_0x2d03('0x1b')]===0x1f4){logger[_0x2d03('0x1a')](_0x2d03('0x15'),_0x55fca5,_0x5ab395[_0x2d03('0x1a')][_0x2d03('0x1c')]);return _0x3d6c23(_0x5ab395[_0x2d03('0x1a')][_0x2d03('0x1c')]);}logger[_0x2d03('0x1a')]('OpenchannelInteraction,\x20%s,\x20%s',_0x55fca5,_0x5ab395['error'][_0x2d03('0x1c')]);return _0x5508fb(_0x5ab395[_0x2d03('0x1a')][_0x2d03('0x1c')]);}else{logger[_0x2d03('0x14')](_0x2d03('0x15'),_0x55fca5,_0x2d03('0x16'));_0x5508fb(_0x5ab395[_0x2d03('0x1d')]['message']);}})[_0x2d03('0x1e')](function(_0x2a6dce){logger[_0x2d03('0x1a')](_0x2d03('0x15'),_0x55fca5,_0x2a6dce);_0x3d6c23(_0x2a6dce);});});}exports[_0x2d03('0x1f')]=function(_0x396133){var _0x26805c=this;return new Promise(function(_0x1d911b,_0x3eedb3){return db['OpenchannelInteraction'][_0x2d03('0x20')](_0x396133[_0x2d03('0x21')],{'raw':_0x396133['options']?_0x396133[_0x2d03('0x22')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x396133[_0x2d03('0x22')]?_0x396133[_0x2d03('0x22')][_0x2d03('0x23')]||null:null,'attributes':_0x396133[_0x2d03('0x22')]?_0x396133[_0x2d03('0x22')]['attributes']||null:null,'limit':_0x396133[_0x2d03('0x22')]?_0x396133[_0x2d03('0x22')][_0x2d03('0x24')]||null:null})[_0x2d03('0x13')](function(_0x1754ae){logger[_0x2d03('0x14')](_0x2d03('0x1f'),_0x396133);logger[_0x2d03('0x17')]('UpdateOpenchannelInteraction',_0x396133,JSON['stringify'](_0x1754ae));_0x1d911b(_0x1754ae);})['catch'](function(_0x23a9d3){logger[_0x2d03('0x1a')](_0x2d03('0x1f'),_0x23a9d3[_0x2d03('0x1c')],_0x396133);_0x3eedb3(_0x26805c['error'](0x1f4,_0x23a9d3[_0x2d03('0x1c')]));});});};exports[_0x2d03('0x25')]=function(_0x429bde){return new Promise(function(_0x7b3ec3,_0xcd154d){return db[_0x2d03('0x26')][_0x2d03('0x27')]({'where':_0x429bde['options']?_0x429bde[_0x2d03('0x22')][_0x2d03('0x23')]||null:null})[_0x2d03('0x13')](function(_0x459376){if(_0x459376){return _0x459376[_0x2d03('0x28')](_0x429bde[_0x2d03('0x21')][_0x2d03('0x29')],_['omit'](_0x429bde[_0x2d03('0x21')],[_0x2d03('0x29'),'id'])||{});}})['spread'](function(_0x17128c){logger['info'](_0x2d03('0x2a'),_0x429bde);logger['debug'](_0x2d03('0x2a'),_0x429bde,JSON[_0x2d03('0x19')](_0x17128c));_0x7b3ec3(_0x17128c);})[_0x2d03('0x1e')](function(_0x5d9dd5){logger[_0x2d03('0x1a')]('AddTags',_0x5d9dd5[_0x2d03('0x1c')],_0x429bde);_0xcd154d(_this[_0x2d03('0x1a')](0x1f4,_0x5d9dd5[_0x2d03('0x1c')]));});});};
\ No newline at end of file
+var _0x03ff=['request','then','info','OpenchannelInteraction,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','UpdateOpenchannelInteraction','OpenchannelInteraction','update','body','options','raw','where','limit','AddTagsToOpenchannelInteraction','addTags','ids','omit','spread','AddTags','moment','bluebird','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','register'];(function(_0x4f0937,_0x4a50b5){var _0x46b486=function(_0xa4ee29){while(--_0xa4ee29){_0x4f0937['push'](_0x4f0937['shift']());}};_0x46b486(++_0x4a50b5);}(_0x03ff,0xb2));var _0xf03f=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x03ff[_0x3947c9];return _0x2e7871;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xf03f('0x0'));var BPromise=require(_0xf03f('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf03f('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0xf03f('0x3'));var logger=require('../../config/logger')(_0xf03f('0x4'));var config=require(_0xf03f('0x5'));var jayson=require(_0xf03f('0x6'));var client=jayson[_0xf03f('0x7')][_0xf03f('0x8')]({'port':0x232a});config[_0xf03f('0x9')]=_[_0xf03f('0xa')](config[_0xf03f('0x9')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xf03f('0x9')]));require('./openchannelInteraction.socket')[_0xf03f('0xb')](socket);function respondWithRpcPromise(_0x4e2052,_0x235892,_0x56bd93){return new BPromise(function(_0x5acd66,_0x27b939){return client[_0xf03f('0xc')](_0x4e2052,_0x56bd93)[_0xf03f('0xd')](function(_0x3b318d){logger[_0xf03f('0xe')](_0xf03f('0xf'),_0x235892,_0xf03f('0x10'));logger[_0xf03f('0x11')]('OpenchannelInteraction,\x20%s,\x20%s,\x20%s',_0x235892,_0xf03f('0x10'),JSON[_0xf03f('0x12')](_0x3b318d));if(_0x3b318d[_0xf03f('0x13')]){if(_0x3b318d[_0xf03f('0x13')][_0xf03f('0x14')]===0x1f4){logger[_0xf03f('0x13')](_0xf03f('0xf'),_0x235892,_0x3b318d[_0xf03f('0x13')][_0xf03f('0x15')]);return _0x27b939(_0x3b318d[_0xf03f('0x13')][_0xf03f('0x15')]);}logger[_0xf03f('0x13')](_0xf03f('0xf'),_0x235892,_0x3b318d[_0xf03f('0x13')][_0xf03f('0x15')]);return _0x5acd66(_0x3b318d[_0xf03f('0x13')]['message']);}else{logger[_0xf03f('0xe')](_0xf03f('0xf'),_0x235892,'request\x20sent');_0x5acd66(_0x3b318d[_0xf03f('0x16')][_0xf03f('0x15')]);}})[_0xf03f('0x17')](function(_0x2b5837){logger[_0xf03f('0x13')](_0xf03f('0xf'),_0x235892,_0x2b5837);_0x27b939(_0x2b5837);});});}exports[_0xf03f('0x18')]=function(_0x51e4f5){var _0x2def72=this;return new Promise(function(_0x29efb3,_0x5cfaea){return db[_0xf03f('0x19')][_0xf03f('0x1a')](_0x51e4f5[_0xf03f('0x1b')],{'raw':_0x51e4f5[_0xf03f('0x1c')]?_0x51e4f5[_0xf03f('0x1c')][_0xf03f('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x51e4f5[_0xf03f('0x1c')]?_0x51e4f5[_0xf03f('0x1c')][_0xf03f('0x1e')]||null:null,'attributes':_0x51e4f5['options']?_0x51e4f5['options']['attributes']||null:null,'limit':_0x51e4f5[_0xf03f('0x1c')]?_0x51e4f5[_0xf03f('0x1c')][_0xf03f('0x1f')]||null:null})['then'](function(_0x4d81ba){logger[_0xf03f('0xe')]('UpdateOpenchannelInteraction',_0x51e4f5);logger[_0xf03f('0x11')](_0xf03f('0x18'),_0x51e4f5,JSON[_0xf03f('0x12')](_0x4d81ba));_0x29efb3(_0x4d81ba);})[_0xf03f('0x17')](function(_0x3b507b){logger[_0xf03f('0x13')](_0xf03f('0x18'),_0x3b507b[_0xf03f('0x15')],_0x51e4f5);_0x5cfaea(_0x2def72[_0xf03f('0x13')](0x1f4,_0x3b507b['message']));});});};exports[_0xf03f('0x20')]=function(_0x3c79ba){return new Promise(function(_0x27d9be,_0x2311f2){return db[_0xf03f('0x19')]['find']({'where':_0x3c79ba[_0xf03f('0x1c')]?_0x3c79ba['options'][_0xf03f('0x1e')]||null:null})['then'](function(_0x5f2093){if(_0x5f2093){return _0x5f2093[_0xf03f('0x21')](_0x3c79ba[_0xf03f('0x1b')][_0xf03f('0x22')],_[_0xf03f('0x23')](_0x3c79ba[_0xf03f('0x1b')],[_0xf03f('0x22'),'id'])||{});}})[_0xf03f('0x24')](function(_0x2d7127){logger[_0xf03f('0xe')]('AddTags',_0x3c79ba);logger['debug'](_0xf03f('0x25'),_0x3c79ba,JSON[_0xf03f('0x12')](_0x2d7127));_0x27d9be(_0x2d7127);})['catch'](function(_0x58d994){logger[_0xf03f('0x13')](_0xf03f('0x25'),_0x58d994[_0xf03f('0x15')],_0x3c79ba);_0x2311f2(_this[_0xf03f('0x13')](0x1f4,_0x58d994[_0xf03f('0x15')]));});});};
\ No newline at end of file
diff --git a/server/api/openchannelInteraction/openchannelInteraction.socket.js b/server/api/openchannelInteraction/openchannelInteraction.socket.js
index f369e1c..2ebabd2 100644
--- a/server/api/openchannelInteraction/openchannelInteraction.socket.js
+++ b/server/api/openchannelInteraction/openchannelInteraction.socket.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x2cec=['emit','length','./openchannelInteraction.events','save','remove','update'];(function(_0xf1196,_0x295b06){var _0x4cc7d1=function(_0x6b917b){while(--_0x6b917b){_0xf1196['push'](_0xf1196['shift']());}};_0x4cc7d1(++_0x295b06);}(_0x2cec,0x1dc));var _0xc2ce=function(_0x11e1c8,_0x4d15c6){_0x11e1c8=_0x11e1c8-0x0;var _0x20fa74=_0x2cec[_0x11e1c8];return _0x20fa74;};'use strict';var OpenchannelInteractionEvents=require(_0xc2ce('0x0'));var events=[_0xc2ce('0x1'),_0xc2ce('0x2'),_0xc2ce('0x3')];function createListener(_0x214264,_0x50bc16){return function(_0x1b2b96){_0x50bc16[_0xc2ce('0x4')](_0x214264,_0x1b2b96);};}function removeListener(_0x1a1ac6,_0x10a78a){return function(){OpenchannelInteractionEvents['removeListener'](_0x1a1ac6,_0x10a78a);};}exports['register']=function(_0x259c92){for(var _0x20db04=0x0,_0x931769=events[_0xc2ce('0x5')];_0x20db04<_0x931769;_0x20db04++){var _0x56e77f=events[_0x20db04];var _0x4206c0=createListener('openchannelInteraction:'+_0x56e77f,_0x259c92);OpenchannelInteractionEvents['on'](_0x56e77f,_0x4206c0);}};
\ No newline at end of file
+var _0x915d=['openchannelInteraction:','./openchannelInteraction.events','remove','emit','removeListener','register','length'];(function(_0x173d8f,_0x45db64){var _0x374b6e=function(_0x2af710){while(--_0x2af710){_0x173d8f['push'](_0x173d8f['shift']());}};_0x374b6e(++_0x45db64);}(_0x915d,0x197));var _0xd915=function(_0x17515a,_0x51935e){_0x17515a=_0x17515a-0x0;var _0x18f3b2=_0x915d[_0x17515a];return _0x18f3b2;};'use strict';var OpenchannelInteractionEvents=require(_0xd915('0x0'));var events=['save',_0xd915('0x1'),'update'];function createListener(_0x14a87a,_0x1c532d){return function(_0xd2098c){_0x1c532d[_0xd915('0x2')](_0x14a87a,_0xd2098c);};}function removeListener(_0x415bbf,_0x271f7a){return function(){OpenchannelInteractionEvents[_0xd915('0x3')](_0x415bbf,_0x271f7a);};}exports[_0xd915('0x4')]=function(_0x772aa2){for(var _0xa71413=0x0,_0x59b9f8=events[_0xd915('0x5')];_0xa71413<_0x59b9f8;_0xa71413++){var _0x3ac162=events[_0xa71413];var _0x367f77=createListener(_0xd915('0x6')+_0x3ac162,_0x772aa2);OpenchannelInteractionEvents['on'](_0x3ac162,_0x367f77);}};
\ No newline at end of file
diff --git a/server/api/openchannelMessage/index.js b/server/api/openchannelMessage/index.js
index ed2fe24..a456bb4 100644
--- a/server/api/openchannelMessage/index.js
+++ b/server/api/openchannelMessage/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xf9c7=['reject','destroy','exports','multer','util','path','../../components/auth/service','../../components/interaction/service','./openchannelMessage.controller','get','index','isAuthenticated','describe','show','post','openchannel','create','/:id','update','put','/:id/accept','accept'];(function(_0x5a2436,_0x11375a){var _0x2d8468=function(_0x5b77b9){while(--_0x5b77b9){_0x5a2436['push'](_0x5a2436['shift']());}};_0x2d8468(++_0x11375a);}(_0xf9c7,0x9d));var _0x7f9c=function(_0x4178af,_0x388652){_0x4178af=_0x4178af-0x0;var _0x20f4b1=_0xf9c7[_0x4178af];return _0x20f4b1;};'use strict';var multer=require(_0x7f9c('0x0'));var util=require(_0x7f9c('0x1'));var path=require(_0x7f9c('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var auth=require(_0x7f9c('0x3'));var interaction=require(_0x7f9c('0x4'));var config=require('../../config/environment');var controller=require(_0x7f9c('0x5'));router[_0x7f9c('0x6')]('/',auth['isAuthenticated'](),controller[_0x7f9c('0x7')]);router[_0x7f9c('0x6')]('/describe',auth[_0x7f9c('0x8')](),controller[_0x7f9c('0x9')]);router['get']('/:id',auth[_0x7f9c('0x8')](),controller[_0x7f9c('0xa')]);router[_0x7f9c('0xb')]('/',auth[_0x7f9c('0x8')](),interaction['tracked'](_0x7f9c('0xc'),'openchannelmessage:create'),controller[_0x7f9c('0xd')]);router['put'](_0x7f9c('0xe'),auth['isAuthenticated'](),controller[_0x7f9c('0xf')]);router[_0x7f9c('0x10')](_0x7f9c('0x11'),auth[_0x7f9c('0x8')](),controller[_0x7f9c('0x12')]);router[_0x7f9c('0x10')]('/:id/reject',auth['isAuthenticated'](),controller[_0x7f9c('0x13')]);router['delete'](_0x7f9c('0xe'),auth[_0x7f9c('0x8')](),controller[_0x7f9c('0x14')]);module[_0x7f9c('0x15')]=router;
\ No newline at end of file
+var _0x2b42=['isAuthenticated','index','/describe','describe','/:id','show','post','tracked','openchannel','create','put','update','accept','/:id/reject','reject','delete','destroy','util','path','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelMessage.controller','get'];(function(_0x31ef12,_0x5622fb){var _0x5e7125=function(_0xcd0a36){while(--_0xcd0a36){_0x31ef12['push'](_0x31ef12['shift']());}};_0x5e7125(++_0x5622fb);}(_0x2b42,0xc0));var _0x22b4=function(_0x461c2c,_0x13f720){_0x461c2c=_0x461c2c-0x0;var _0x34ce82=_0x2b42[_0x461c2c];return _0x34ce82;};'use strict';var multer=require('multer');var util=require(_0x22b4('0x0'));var path=require(_0x22b4('0x1'));var timeout=require('connect-timeout');var express=require(_0x22b4('0x2'));var router=express['Router']();var auth=require(_0x22b4('0x3'));var interaction=require(_0x22b4('0x4'));var config=require(_0x22b4('0x5'));var controller=require(_0x22b4('0x6'));router[_0x22b4('0x7')]('/',auth[_0x22b4('0x8')](),controller[_0x22b4('0x9')]);router[_0x22b4('0x7')](_0x22b4('0xa'),auth[_0x22b4('0x8')](),controller[_0x22b4('0xb')]);router[_0x22b4('0x7')](_0x22b4('0xc'),auth[_0x22b4('0x8')](),controller[_0x22b4('0xd')]);router[_0x22b4('0xe')]('/',auth['isAuthenticated'](),interaction[_0x22b4('0xf')](_0x22b4('0x10'),'openchannelmessage:create'),controller[_0x22b4('0x11')]);router[_0x22b4('0x12')](_0x22b4('0xc'),auth[_0x22b4('0x8')](),controller[_0x22b4('0x13')]);router['put']('/:id/accept',auth['isAuthenticated'](),controller[_0x22b4('0x14')]);router['put'](_0x22b4('0x15'),auth[_0x22b4('0x8')](),controller[_0x22b4('0x16')]);router[_0x22b4('0x17')](_0x22b4('0xc'),auth[_0x22b4('0x8')](),controller[_0x22b4('0x18')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/openchannelMessage/openchannelMessage.attributes.js b/server/api/openchannelMessage/openchannelMessage.attributes.js
index cb3c942..76be9b8 100644
--- a/server/api/openchannelMessage/openchannelMessage.attributes.js
+++ b/server/api/openchannelMessage/openchannelMessage.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xcd6f=['ENUM','out','DATE','exports','TEXT','medium','BOOLEAN'];(function(_0x5dbb84,_0x1bbce9){var _0x1d6eae=function(_0xd93967){while(--_0xd93967){_0x5dbb84['push'](_0x5dbb84['shift']());}};_0x1d6eae(++_0x1bbce9);}(_0xcd6f,0x1bc));var _0xfcd6=function(_0x54f57a,_0x4f08fb){_0x54f57a=_0x54f57a-0x0;var _0x175896=_0xcd6f[_0x54f57a];return _0x175896;};'use strict';var Sequelize=require('sequelize');module[_0xfcd6('0x0')]={'body':{'type':Sequelize[_0xfcd6('0x1')](_0xfcd6('0x2')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'secret':{'type':Sequelize[_0xfcd6('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0xfcd6('0x4')]('in',_0xfcd6('0x5')),'defaultValue':_0xfcd6('0x5'),'allowNull':![]},'readAt':{'type':Sequelize[_0xfcd6('0x6')]}};
\ No newline at end of file
+var _0x4a5e=['medium','BOOLEAN','out','DATE','sequelize','TEXT'];(function(_0x126558,_0x143c9a){var _0x1f6d14=function(_0x2b0eea){while(--_0x2b0eea){_0x126558['push'](_0x126558['shift']());}};_0x1f6d14(++_0x143c9a);}(_0x4a5e,0xac));var _0xe4a5=function(_0x2c63a4,_0x18a34f){_0x2c63a4=_0x2c63a4-0x0;var _0x210eb8=_0x4a5e[_0x2c63a4];return _0x210eb8;};'use strict';var Sequelize=require(_0xe4a5('0x0'));module['exports']={'body':{'type':Sequelize[_0xe4a5('0x1')](_0xe4a5('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0xe4a5('0x3')],'defaultValue':![]},'secret':{'type':Sequelize[_0xe4a5('0x3')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in','out'),'defaultValue':_0xe4a5('0x4'),'allowNull':![]},'readAt':{'type':Sequelize[_0xe4a5('0x5')]}};
\ No newline at end of file
diff --git a/server/api/openchannelMessage/openchannelMessage.controller.js b/server/api/openchannelMessage/openchannelMessage.controller.js
index a43a0cd..5f81380 100644
--- a/server/api/openchannelMessage/openchannelMessage.controller.js
+++ b/server/api/openchannelMessage/openchannelMessage.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x19a4=['../../components/auth/service','../../components/parsers/qs','../../config/logger','api','redis','defaults','localhost','./openchannelMessage.socket','jayson/promise','client','http','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','OpenchannelMessage,\x20%s,\x20%s','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','info','request\x20sent','result','catch','sendStatus','status','end','json','count','offset','limit','set','apply','save','update','destroy','stack','name','map','OpenchannelMessage','fieldName','type','key','model','keys','query','filters','intersection','fields','attributes','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','rawAttributes','find','create','body','params','describe','openchannel-interactions','accept','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','CmContact','get','OpenchannelInteraction','OpenchannelInteractionId','read1stAt','interaction','role','null','interface','channel','EventManager','acceptmessage','openchannel','agent','[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','SIP/%s','event','reject','rejectmessage','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','sox','ejs','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis'];(function(_0x32be67,_0x4f0f5d){var _0x242f7d=function(_0xddce4b){while(--_0xddce4b){_0x32be67['push'](_0x32be67['shift']());}};_0x242f7d(++_0x4f0f5d);}(_0x19a4,0x1d2));var _0x419a=function(_0xbc4e59,_0x183f29){_0xbc4e59=_0xbc4e59-0x0;var _0x726d0f=_0x19a4[_0xbc4e59];return _0x726d0f;};'use strict';var pdf=require(_0x419a('0x0'));var emlformat=require(_0x419a('0x1'));var rimraf=require(_0x419a('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x419a('0x3'));var rp=require(_0x419a('0x4'));var moment=require(_0x419a('0x5'));var BPromise=require(_0x419a('0x6'));var Mustache=require('mustache');var util=require(_0x419a('0x7'));var path=require('path');var sox=require(_0x419a('0x8'));var csv=require('to-csv');var ejs=require(_0x419a('0x9'));var fs=require('fs');var _=require(_0x419a('0xa'));var squel=require('squel');var crypto=require(_0x419a('0xb'));var jsforce=require(_0x419a('0xc'));var deskjs=require(_0x419a('0xd'));var toCsv=require(_0x419a('0xe'));var querystring=require(_0x419a('0xf'));var Papa=require(_0x419a('0x10'));var Redis=require(_0x419a('0x11'));var authService=require(_0x419a('0x12'));var qs=require(_0x419a('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x419a('0x14'))(_0x419a('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config[_0x419a('0x16')]=_[_0x419a('0x17')](config[_0x419a('0x16')],{'host':_0x419a('0x18'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x419a('0x19'))['register'](socket);var jayson=require(_0x419a('0x1a'));var client=jayson['client']['http']({'port':0x232c});var client9002=jayson[_0x419a('0x1b')][_0x419a('0x1c')]({'port':0x232a});function checkPasswordPattern(_0x47fb4f,_0x2f84d3,_0x3d8e58){if(_0x3d8e58){var _0x294ffa=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x294ffa[_0x419a('0x1d')](_0x2f84d3)){return _0x47fb4f;}else{throw new db[(_0x419a('0x1e'))][(_0x419a('0x1f'))](_0x419a('0x20'));}}else{return _0x47fb4f;}}function respondWithRpcPromise(_0x281828,_0x430e84,_0x3c0a3c,_0x320a79){return new BPromise(function(_0x4b0685,_0x38080d){var _0x358838=_0x320a79||client;return _0x358838[_0x419a('0x21')](_0x281828,_0x3c0a3c)[_0x419a('0x22')](function(_0x36192e){logger['info'](_0x419a('0x23'),_0x430e84,'request\x20sent');logger[_0x419a('0x24')](_0x419a('0x25'),_0x430e84,'request\x20sent',JSON[_0x419a('0x26')](_0x36192e));if(_0x36192e['error']){if(_0x36192e[_0x419a('0x27')]['code']===0x1f4){logger['error']('OpenchannelMessage,\x20%s,\x20%s',_0x430e84,_0x36192e[_0x419a('0x27')][_0x419a('0x28')]);return _0x38080d(_0x36192e['error']['message']);}logger[_0x419a('0x27')]('OpenchannelMessage,\x20%s,\x20%s',_0x430e84,_0x36192e[_0x419a('0x27')]['message']);return _0x4b0685(_0x36192e['error'][_0x419a('0x28')]);}else{logger[_0x419a('0x29')](_0x419a('0x23'),_0x430e84,_0x419a('0x2a'));_0x4b0685(_0x36192e[_0x419a('0x2b')]['message']);}})[_0x419a('0x2c')](function(_0x12979f){logger[_0x419a('0x27')](_0x419a('0x23'),_0x430e84,_0x12979f);_0x38080d(_0x12979f);});});}function respondWithStatusCode(_0x4d059f,_0x524811){_0x524811=_0x524811||0xcc;return function(_0x21758a){if(_0x21758a){return _0x4d059f[_0x419a('0x2d')](_0x524811);}return _0x4d059f[_0x419a('0x2e')](_0x524811)[_0x419a('0x2f')]();};}function respondWithResult(_0x82cc4d,_0x4d8d6e){_0x4d8d6e=_0x4d8d6e||0xc8;return function(_0x3b3fbf){if(_0x3b3fbf){return _0x82cc4d['status'](_0x4d8d6e)[_0x419a('0x30')](_0x3b3fbf);}};}function respondWithFilteredResult(_0x376ea6,_0x174cd4){return function(_0x1ae140){if(_0x1ae140){var _0x238c67=_0x1ae140[_0x419a('0x31')],_0x118d2d=_0x174cd4[_0x419a('0x32')],_0xb978e7=_0x174cd4[_0x419a('0x32')]+_0x174cd4[_0x419a('0x33')],_0x524b56;if(_0xb978e7>=_0x238c67){_0xb978e7=_0x238c67;_0x524b56=0xc8;}else{_0x524b56=0xce;}_0x376ea6['status'](_0x524b56);return _0x376ea6[_0x419a('0x34')]('Content-Range',_0x118d2d+'-'+_0xb978e7+'/'+_0x238c67)[_0x419a('0x30')](_0x1ae140);}return null;};}function patchUpdates(_0x48f77d){return function(_0xb6bd2a){try{jsonpatch[_0x419a('0x35')](_0xb6bd2a,_0x48f77d,!![]);}catch(_0x36bfa1){return BPromise['reject'](_0x36bfa1);}return _0xb6bd2a[_0x419a('0x36')]();};}function saveUpdates(_0x6936fa,_0x571a45){return function(_0x3c4cd8){if(_0x3c4cd8){return _0x3c4cd8[_0x419a('0x37')](_0x6936fa)[_0x419a('0x22')](function(_0x49d124){return _0x49d124;});}return null;};}function removeEntity(_0x2a397c,_0x310bd9){return function(_0x2be7a3){if(_0x2be7a3){return _0x2be7a3[_0x419a('0x38')]()[_0x419a('0x22')](function(){_0x2a397c[_0x419a('0x2e')](0xcc)[_0x419a('0x2f')]();});}};}function handleEntityNotFound(_0x1ae7f2,_0x2a1d4f){return function(_0x2fb4ad){if(!_0x2fb4ad){_0x1ae7f2['sendStatus'](0x194);}return _0x2fb4ad;};}function handleError(_0x5552fb,_0x203d4f){_0x203d4f=_0x203d4f||0x1f4;return function(_0x571d16){logger[_0x419a('0x27')](_0x571d16[_0x419a('0x39')]);if(_0x571d16[_0x419a('0x3a')]){delete _0x571d16[_0x419a('0x3a')];}_0x5552fb[_0x419a('0x2e')](_0x203d4f)['send'](_0x571d16);};}exports['index']=function(_0x4e650e,_0x148834){var _0x3e91cc={},_0x54b288={},_0x28ca35={'count':0x0,'rows':[]};var _0x1deef9=_[_0x419a('0x3b')](db[_0x419a('0x3c')]['rawAttributes'],function(_0x4c6371){return{'name':_0x4c6371[_0x419a('0x3d')],'type':_0x4c6371[_0x419a('0x3e')][_0x419a('0x3f')]};});_0x54b288[_0x419a('0x40')]=_['map'](_0x1deef9,_0x419a('0x3a'));_0x54b288['query']=_[_0x419a('0x41')](_0x4e650e[_0x419a('0x42')]);_0x54b288[_0x419a('0x43')]=_[_0x419a('0x44')](_0x54b288['model'],_0x54b288['query']);_0x3e91cc['attributes']=_['intersection'](_0x54b288[_0x419a('0x40')],qs[_0x419a('0x45')](_0x4e650e[_0x419a('0x42')][_0x419a('0x45')]));_0x3e91cc[_0x419a('0x46')]=_0x3e91cc[_0x419a('0x46')][_0x419a('0x47')]?_0x3e91cc[_0x419a('0x46')]:_0x54b288[_0x419a('0x40')];if(!_0x4e650e[_0x419a('0x42')]['hasOwnProperty'](_0x419a('0x48'))){_0x3e91cc[_0x419a('0x33')]=qs['limit'](_0x4e650e[_0x419a('0x42')][_0x419a('0x33')]);_0x3e91cc['offset']=qs[_0x419a('0x32')](_0x4e650e[_0x419a('0x42')][_0x419a('0x32')]);}_0x3e91cc[_0x419a('0x49')]=qs[_0x419a('0x4a')](_0x4e650e[_0x419a('0x42')][_0x419a('0x4a')]);_0x3e91cc[_0x419a('0x4b')]=qs[_0x419a('0x43')](_[_0x419a('0x4c')](_0x4e650e[_0x419a('0x42')],_0x54b288['filters']),_0x1deef9);if(_0x4e650e[_0x419a('0x42')][_0x419a('0x4d')]){_0x3e91cc['where']=_[_0x419a('0x4e')](_0x3e91cc[_0x419a('0x4b')],{'$or':_[_0x419a('0x3b')](_0x1deef9,function(_0x2e72ea){if(_0x2e72ea[_0x419a('0x3e')]!==_0x419a('0x4f')){var _0x128d05={};_0x128d05[_0x2e72ea[_0x419a('0x3a')]]={'$like':'%'+_0x4e650e['query'][_0x419a('0x4d')]+'%'};return _0x128d05;}})});}_0x3e91cc=_[_0x419a('0x4e')]({},_0x3e91cc,_0x4e650e[_0x419a('0x50')]);var _0x4c0cdd={'where':_0x3e91cc[_0x419a('0x4b')]};return db[_0x419a('0x3c')][_0x419a('0x31')](_0x4c0cdd)[_0x419a('0x22')](function(_0x12d4be){_0x28ca35[_0x419a('0x31')]=_0x12d4be;if(_0x4e650e[_0x419a('0x42')][_0x419a('0x51')]){_0x3e91cc[_0x419a('0x52')]=[{'all':!![]}];}return db[_0x419a('0x3c')][_0x419a('0x53')](_0x3e91cc);})[_0x419a('0x22')](function(_0x178b4d){_0x28ca35[_0x419a('0x54')]=_0x178b4d;return _0x28ca35;})[_0x419a('0x22')](respondWithFilteredResult(_0x148834,_0x3e91cc))[_0x419a('0x2c')](handleError(_0x148834,null));};exports[_0x419a('0x55')]=function(_0x354392,_0x1afe8d){var _0x2a204c={'raw':!![],'where':{'id':_0x354392['params']['id']}},_0x17e328={};_0x17e328[_0x419a('0x40')]=_[_0x419a('0x41')](db[_0x419a('0x3c')][_0x419a('0x56')]);_0x17e328[_0x419a('0x42')]=_[_0x419a('0x41')](_0x354392[_0x419a('0x42')]);_0x17e328[_0x419a('0x43')]=_['intersection'](_0x17e328[_0x419a('0x40')],_0x17e328['query']);_0x2a204c[_0x419a('0x46')]=_[_0x419a('0x44')](_0x17e328['model'],qs['fields'](_0x354392[_0x419a('0x42')][_0x419a('0x45')]));_0x2a204c[_0x419a('0x46')]=_0x2a204c[_0x419a('0x46')][_0x419a('0x47')]?_0x2a204c[_0x419a('0x46')]:_0x17e328['model'];if(_0x354392[_0x419a('0x42')]['includeAll']){_0x2a204c[_0x419a('0x52')]=[{'all':!![]}];}_0x2a204c=_[_0x419a('0x4e')]({},_0x2a204c,_0x354392[_0x419a('0x50')]);return db['OpenchannelMessage'][_0x419a('0x57')](_0x2a204c)['then'](handleEntityNotFound(_0x1afe8d,null))['then'](respondWithResult(_0x1afe8d,null))[_0x419a('0x2c')](handleError(_0x1afe8d,null));};exports['create']=function(_0x547d82,_0x449015){return db[_0x419a('0x3c')][_0x419a('0x58')](_0x547d82[_0x419a('0x59')],{})[_0x419a('0x22')](respondWithResult(_0x449015,0xc9))['catch'](handleError(_0x449015,null));};exports[_0x419a('0x37')]=function(_0x29003c,_0x380330){if(_0x29003c[_0x419a('0x59')]['id']){delete _0x29003c['body']['id'];}return db[_0x419a('0x3c')][_0x419a('0x57')]({'where':{'id':_0x29003c['params']['id']}})[_0x419a('0x22')](handleEntityNotFound(_0x380330,null))[_0x419a('0x22')](saveUpdates(_0x29003c[_0x419a('0x59')],null))[_0x419a('0x22')](respondWithResult(_0x380330,null))[_0x419a('0x2c')](handleError(_0x380330,null));};exports[_0x419a('0x38')]=function(_0x31de6b,_0x4ab420){return db[_0x419a('0x3c')]['find']({'where':{'id':_0x31de6b[_0x419a('0x5a')]['id']}})[_0x419a('0x22')](handleEntityNotFound(_0x4ab420,null))[_0x419a('0x22')](removeEntity(_0x4ab420,null))[_0x419a('0x2c')](handleError(_0x4ab420,null));};exports[_0x419a('0x5b')]=function(_0x46e1a4,_0x208a5b){return db[_0x419a('0x3c')]['describe']()[_0x419a('0x22')](respondWithResult(_0x208a5b,null))[_0x419a('0x2c')](handleError(_0x208a5b,null));};var interaction_log=require('../../config/logger')(_0x419a('0x5c'));exports[_0x419a('0x5d')]=function(_0x5adfcd,_0x3f5d65,_0x4009a0){var _0x5e7dd8={'channel':'openchannel'};if(_0x5adfcd[_0x419a('0x59')]['id']){delete _0x5adfcd[_0x419a('0x59')]['id'];}_0x5adfcd['body'][_0x419a('0x5e')]=!![];_0x5adfcd[_0x419a('0x59')][_0x419a('0x5f')]=moment()[_0x419a('0x60')](_0x419a('0x61'));_0x5adfcd[_0x419a('0x59')][_0x419a('0x62')]=_0x5adfcd[_0x419a('0x59')][_0x419a('0x62')]||_0x5adfcd[_0x419a('0x63')]['id'];return db[_0x419a('0x3c')][_0x419a('0x57')]({'where':{'id':_0x5adfcd[_0x419a('0x5a')]['id'],'UserId':null},'include':[{'model':db[_0x419a('0x64')],'as':'Contact'}]})[_0x419a('0x22')](handleEntityNotFound(_0x3f5d65,null))['then'](saveUpdates(_0x5adfcd[_0x419a('0x59')],null))['then'](function(_0x7e0071){if(_0x7e0071){_0x5e7dd8[_0x419a('0x28')]=_0x7e0071[_0x419a('0x65')]({'plain':!![]});return db[_0x419a('0x66')]['find']({'where':{'id':_0x7e0071[_0x419a('0x67')]}});}return null;})[_0x419a('0x22')](handleEntityNotFound(_0x3f5d65,null))[_0x419a('0x22')](function(_0x991aad){if(_0x991aad){return _0x991aad[_0x419a('0x37')]({'UserId':_0x5adfcd[_0x419a('0x59')][_0x419a('0x62')],'read1stAt':_['isNil'](_0x991aad[_0x419a('0x68')])?moment()[_0x419a('0x60')](_0x419a('0x61')):undefined});}return null;})[_0x419a('0x22')](function(_0x35c996){if(_0x35c996){_0x5e7dd8[_0x419a('0x69')]=_0x35c996[_0x419a('0x65')]({'plain':!![]});interaction_log[_0x419a('0x29')]('[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x5adfcd[_0x419a('0x63')]['id'],_0x5adfcd['user']['name'],_0x5adfcd[_0x419a('0x63')][_0x419a('0x6a')],_0x5e7dd8[_0x419a('0x69')]['id'],_0x5adfcd['body']?JSON['stringify'](_0x5adfcd[_0x419a('0x59')]):_0x419a('0x6b'));return respondWithRpcPromise('AcceptMessage','acceptMessage',_0x5e7dd8);}return null;})[_0x419a('0x22')](function(_0x8e91f9){if(_0x8e91f9){if(_0x5adfcd[_0x419a('0x59')]['manual']){_0x5e7dd8[_0x419a('0x28')][_0x419a('0x6c')]=util[_0x419a('0x60')]('SIP/%s',_0x5adfcd[_0x419a('0x63')][_0x419a('0x3a')]);_0x5e7dd8[_0x419a('0x28')][_0x419a('0x6d')]=_0x5e7dd8['channel'];_0x5e7dd8[_0x419a('0x28')]['event']='accept';return respondWithRpcPromise(_0x419a('0x6e'),_0x419a('0x6e'),{'event':_0x419a('0x6f'),'message':_0x5e7dd8['message']},client9002)[_0x419a('0x22')](function(){return _0x5e7dd8;});}return _0x5e7dd8;}return null;})[_0x419a('0x22')](respondWithResult(_0x3f5d65,null))[_0x419a('0x2c')](handleError(_0x3f5d65,null));};var interaction_log=require(_0x419a('0x14'))(_0x419a('0x5c'));exports['reject']=function(_0x423373,_0x2cfff6,_0x290141){var _0x1139bc={'agent':{},'channel':_0x419a('0x70')};if(_0x423373[_0x419a('0x59')]['id']){delete _0x423373[_0x419a('0x59')]['id'];}_0x423373[_0x419a('0x59')][_0x419a('0x62')]=_0x423373[_0x419a('0x59')][_0x419a('0x62')]||_0x423373[_0x419a('0x63')]['id'];_0x1139bc[_0x419a('0x71')]['id']=_0x423373[_0x419a('0x59')]['UserId'];return db[_0x419a('0x3c')][_0x419a('0x57')]({'where':{'id':_0x423373['params']['id'],'UserId':null}})[_0x419a('0x22')](handleEntityNotFound(_0x2cfff6,null))[_0x419a('0x22')](function(_0x5d05f2){if(_0x5d05f2){_0x1139bc[_0x419a('0x28')]=_0x5d05f2[_0x419a('0x65')]({'plain':!![]});return db[_0x419a('0x66')][_0x419a('0x57')]({'where':{'id':_0x5d05f2['OpenchannelInteractionId']}});}return null;})[_0x419a('0x22')](handleEntityNotFound(_0x2cfff6,null))[_0x419a('0x22')](function(_0x393be9){if(_0x393be9){_0x1139bc[_0x419a('0x69')]=_0x393be9['get']({'plain':!![]});interaction_log[_0x419a('0x29')](_0x419a('0x72'),_0x423373[_0x419a('0x63')]['id'],_0x423373[_0x419a('0x63')][_0x419a('0x3a')],_0x423373[_0x419a('0x63')][_0x419a('0x6a')],_0x1139bc[_0x419a('0x69')]['id'],_0x423373[_0x419a('0x59')]?JSON[_0x419a('0x26')](_0x423373[_0x419a('0x59')]):'null');return respondWithRpcPromise(_0x419a('0x73'),_0x419a('0x74'),_0x1139bc);}return null;})[_0x419a('0x22')](function(_0x27b599){if(_0x27b599){_0x27b599['message']['interface']=util[_0x419a('0x60')](_0x419a('0x75'),_0x423373[_0x419a('0x63')][_0x419a('0x3a')]);_0x27b599[_0x419a('0x28')]['channel']=_0x1139bc[_0x419a('0x6d')];_0x27b599['message'][_0x419a('0x76')]=_0x419a('0x77');respondWithRpcPromise(_0x419a('0x6e'),_0x419a('0x6e'),{'event':_0x419a('0x78'),'message':_0x27b599['message']},client9002);return _0x1139bc;}return null;})[_0x419a('0x22')](respondWithResult(_0x2cfff6,null))[_0x419a('0x2c')](handleError(_0x2cfff6,null));};
\ No newline at end of file
+var _0x3c20=['include','findAll','rows','show','params','merge','find','create','body','../../config/logger','openchannel-interactions','openchannel','read','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','CmContact','Contact','get','OpenchannelInteraction','OpenchannelInteractionId','read1stAt','role','interaction','null','AcceptMessage','manual','interface','SIP/%s','channel','accept','EventManager','acceptmessage','[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','event','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','redis','defaults','localhost','./openchannelMessage.socket','register','client','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','then','info','OpenchannelMessage,\x20%s,\x20%s','debug','request\x20sent','stringify','error','message','result','catch','sendStatus','status','end','json','count','offset','limit','Content-Range','apply','reject','save','update','destroy','stack','name','send','index','map','OpenchannelMessage','rawAttributes','fieldName','type','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','VIRTUAL','filter','options','includeAll'];(function(_0x2a4c3a,_0x338cb0){var _0x2f41cb=function(_0x55c499){while(--_0x55c499){_0x2a4c3a['push'](_0x2a4c3a['shift']());}};_0x2f41cb(++_0x338cb0);}(_0x3c20,0x118));var _0x03c2=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x3c20[_0x501510];return _0x1e6ee5;};'use strict';var pdf=require(_0x03c2('0x0'));var emlformat=require(_0x03c2('0x1'));var rimraf=require(_0x03c2('0x2'));var zipdir=require(_0x03c2('0x3'));var jsonpatch=require(_0x03c2('0x4'));var rp=require(_0x03c2('0x5'));var moment=require(_0x03c2('0x6'));var BPromise=require(_0x03c2('0x7'));var Mustache=require(_0x03c2('0x8'));var util=require(_0x03c2('0x9'));var path=require('path');var sox=require('sox');var csv=require(_0x03c2('0xa'));var ejs=require(_0x03c2('0xb'));var fs=require('fs');var _=require(_0x03c2('0xc'));var squel=require(_0x03c2('0xd'));var crypto=require(_0x03c2('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x03c2('0xf'));var toCsv=require('to-csv');var querystring=require(_0x03c2('0x10'));var Papa=require(_0x03c2('0x11'));var Redis=require(_0x03c2('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x03c2('0x13'));var as=require(_0x03c2('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x03c2('0x15'));var utils=require(_0x03c2('0x16'));var config=require(_0x03c2('0x17'));var db=require('../../mysqldb')['db'];config[_0x03c2('0x18')]=_[_0x03c2('0x19')](config['redis'],{'host':_0x03c2('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x03c2('0x1b'))[_0x03c2('0x1c')](socket);var jayson=require('jayson/promise');var client=jayson[_0x03c2('0x1d')][_0x03c2('0x1e')]({'port':0x232c});var client9002=jayson[_0x03c2('0x1d')][_0x03c2('0x1e')]({'port':0x232a});function checkPasswordPattern(_0x5d07ef,_0x308ca6,_0x5000b8){if(_0x5000b8){var _0x33f0f5=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x33f0f5[_0x03c2('0x1f')](_0x308ca6)){return _0x5d07ef;}else{throw new db['Sequelize']['ValidationError'](_0x03c2('0x20'));}}else{return _0x5d07ef;}}function respondWithRpcPromise(_0x1cd0d7,_0xe5a1d4,_0x201b51,_0x3b50d3){return new BPromise(function(_0x3fc6c4,_0x28efa3){var _0x24d1fc=_0x3b50d3||client;return _0x24d1fc['request'](_0x1cd0d7,_0x201b51)[_0x03c2('0x21')](function(_0x59de7e){logger[_0x03c2('0x22')](_0x03c2('0x23'),_0xe5a1d4,'request\x20sent');logger[_0x03c2('0x24')]('OpenchannelMessage,\x20%s,\x20%s,\x20%s',_0xe5a1d4,_0x03c2('0x25'),JSON[_0x03c2('0x26')](_0x59de7e));if(_0x59de7e[_0x03c2('0x27')]){if(_0x59de7e[_0x03c2('0x27')]['code']===0x1f4){logger['error']('OpenchannelMessage,\x20%s,\x20%s',_0xe5a1d4,_0x59de7e['error'][_0x03c2('0x28')]);return _0x28efa3(_0x59de7e[_0x03c2('0x27')]['message']);}logger[_0x03c2('0x27')](_0x03c2('0x23'),_0xe5a1d4,_0x59de7e[_0x03c2('0x27')][_0x03c2('0x28')]);return _0x3fc6c4(_0x59de7e[_0x03c2('0x27')][_0x03c2('0x28')]);}else{logger[_0x03c2('0x22')](_0x03c2('0x23'),_0xe5a1d4,_0x03c2('0x25'));_0x3fc6c4(_0x59de7e[_0x03c2('0x29')][_0x03c2('0x28')]);}})[_0x03c2('0x2a')](function(_0x37ed22){logger['error'](_0x03c2('0x23'),_0xe5a1d4,_0x37ed22);_0x28efa3(_0x37ed22);});});}function respondWithStatusCode(_0x3da49c,_0x11f23c){_0x11f23c=_0x11f23c||0xcc;return function(_0x40681a){if(_0x40681a){return _0x3da49c[_0x03c2('0x2b')](_0x11f23c);}return _0x3da49c[_0x03c2('0x2c')](_0x11f23c)[_0x03c2('0x2d')]();};}function respondWithResult(_0x1e7c42,_0x22aad0){_0x22aad0=_0x22aad0||0xc8;return function(_0x2ac331){if(_0x2ac331){return _0x1e7c42[_0x03c2('0x2c')](_0x22aad0)[_0x03c2('0x2e')](_0x2ac331);}};}function respondWithFilteredResult(_0x45f0c8,_0x1927fb){return function(_0x3a112){if(_0x3a112){var _0x5ee38b=_0x3a112[_0x03c2('0x2f')],_0x37611b=_0x1927fb['offset'],_0x58a551=_0x1927fb[_0x03c2('0x30')]+_0x1927fb[_0x03c2('0x31')],_0x1623e9;if(_0x58a551>=_0x5ee38b){_0x58a551=_0x5ee38b;_0x1623e9=0xc8;}else{_0x1623e9=0xce;}_0x45f0c8[_0x03c2('0x2c')](_0x1623e9);return _0x45f0c8['set'](_0x03c2('0x32'),_0x37611b+'-'+_0x58a551+'/'+_0x5ee38b)[_0x03c2('0x2e')](_0x3a112);}return null;};}function patchUpdates(_0x52a245){return function(_0x276c05){try{jsonpatch[_0x03c2('0x33')](_0x276c05,_0x52a245,!![]);}catch(_0x26840c){return BPromise[_0x03c2('0x34')](_0x26840c);}return _0x276c05[_0x03c2('0x35')]();};}function saveUpdates(_0x4308f2,_0x14c318){return function(_0x15948d){if(_0x15948d){return _0x15948d[_0x03c2('0x36')](_0x4308f2)[_0x03c2('0x21')](function(_0x49d3bf){return _0x49d3bf;});}return null;};}function removeEntity(_0x564d10,_0x1c7a78){return function(_0xe6ccc8){if(_0xe6ccc8){return _0xe6ccc8[_0x03c2('0x37')]()['then'](function(){_0x564d10[_0x03c2('0x2c')](0xcc)[_0x03c2('0x2d')]();});}};}function handleEntityNotFound(_0x3f5ad4,_0xc1d5d1){return function(_0x44b33d){if(!_0x44b33d){_0x3f5ad4[_0x03c2('0x2b')](0x194);}return _0x44b33d;};}function handleError(_0x54b150,_0x328cf9){_0x328cf9=_0x328cf9||0x1f4;return function(_0x443633){logger[_0x03c2('0x27')](_0x443633[_0x03c2('0x38')]);if(_0x443633['name']){delete _0x443633[_0x03c2('0x39')];}_0x54b150['status'](_0x328cf9)[_0x03c2('0x3a')](_0x443633);};}exports[_0x03c2('0x3b')]=function(_0x468d59,_0xc44a05){var _0x378abe={},_0x2d568c={},_0x29a296={'count':0x0,'rows':[]};var _0x289511=_[_0x03c2('0x3c')](db[_0x03c2('0x3d')][_0x03c2('0x3e')],function(_0x1f8e98){return{'name':_0x1f8e98[_0x03c2('0x3f')],'type':_0x1f8e98[_0x03c2('0x40')]['key']};});_0x2d568c[_0x03c2('0x41')]=_[_0x03c2('0x3c')](_0x289511,'name');_0x2d568c[_0x03c2('0x42')]=_[_0x03c2('0x43')](_0x468d59[_0x03c2('0x42')]);_0x2d568c[_0x03c2('0x44')]=_['intersection'](_0x2d568c[_0x03c2('0x41')],_0x2d568c[_0x03c2('0x42')]);_0x378abe['attributes']=_[_0x03c2('0x45')](_0x2d568c[_0x03c2('0x41')],qs[_0x03c2('0x46')](_0x468d59['query']['fields']));_0x378abe[_0x03c2('0x47')]=_0x378abe['attributes'][_0x03c2('0x48')]?_0x378abe[_0x03c2('0x47')]:_0x2d568c[_0x03c2('0x41')];if(!_0x468d59['query'][_0x03c2('0x49')](_0x03c2('0x4a'))){_0x378abe[_0x03c2('0x31')]=qs['limit'](_0x468d59[_0x03c2('0x42')][_0x03c2('0x31')]);_0x378abe[_0x03c2('0x30')]=qs[_0x03c2('0x30')](_0x468d59['query'][_0x03c2('0x30')]);}_0x378abe[_0x03c2('0x4b')]=qs[_0x03c2('0x4c')](_0x468d59[_0x03c2('0x42')]['sort']);_0x378abe[_0x03c2('0x4d')]=qs[_0x03c2('0x44')](_[_0x03c2('0x4e')](_0x468d59['query'],_0x2d568c[_0x03c2('0x44')]),_0x289511);if(_0x468d59[_0x03c2('0x42')]['filter']){_0x378abe[_0x03c2('0x4d')]=_['merge'](_0x378abe[_0x03c2('0x4d')],{'$or':_[_0x03c2('0x3c')](_0x289511,function(_0x5a0ca3){if(_0x5a0ca3[_0x03c2('0x40')]!==_0x03c2('0x4f')){var _0x11ad66={};_0x11ad66[_0x5a0ca3[_0x03c2('0x39')]]={'$like':'%'+_0x468d59[_0x03c2('0x42')][_0x03c2('0x50')]+'%'};return _0x11ad66;}})});}_0x378abe=_['merge']({},_0x378abe,_0x468d59[_0x03c2('0x51')]);var _0x3467cb={'where':_0x378abe[_0x03c2('0x4d')]};return db[_0x03c2('0x3d')]['count'](_0x3467cb)[_0x03c2('0x21')](function(_0x376ace){_0x29a296[_0x03c2('0x2f')]=_0x376ace;if(_0x468d59[_0x03c2('0x42')][_0x03c2('0x52')]){_0x378abe[_0x03c2('0x53')]=[{'all':!![]}];}return db[_0x03c2('0x3d')][_0x03c2('0x54')](_0x378abe);})['then'](function(_0x162e46){_0x29a296[_0x03c2('0x55')]=_0x162e46;return _0x29a296;})['then'](respondWithFilteredResult(_0xc44a05,_0x378abe))[_0x03c2('0x2a')](handleError(_0xc44a05,null));};exports[_0x03c2('0x56')]=function(_0x497875,_0x240376){var _0x2fd00f={'raw':!![],'where':{'id':_0x497875[_0x03c2('0x57')]['id']}},_0x47ca88={};_0x47ca88[_0x03c2('0x41')]=_[_0x03c2('0x43')](db['OpenchannelMessage'][_0x03c2('0x3e')]);_0x47ca88[_0x03c2('0x42')]=_[_0x03c2('0x43')](_0x497875[_0x03c2('0x42')]);_0x47ca88['filters']=_['intersection'](_0x47ca88[_0x03c2('0x41')],_0x47ca88[_0x03c2('0x42')]);_0x2fd00f['attributes']=_[_0x03c2('0x45')](_0x47ca88[_0x03c2('0x41')],qs['fields'](_0x497875[_0x03c2('0x42')]['fields']));_0x2fd00f[_0x03c2('0x47')]=_0x2fd00f[_0x03c2('0x47')][_0x03c2('0x48')]?_0x2fd00f[_0x03c2('0x47')]:_0x47ca88[_0x03c2('0x41')];if(_0x497875[_0x03c2('0x42')][_0x03c2('0x52')]){_0x2fd00f[_0x03c2('0x53')]=[{'all':!![]}];}_0x2fd00f=_[_0x03c2('0x58')]({},_0x2fd00f,_0x497875[_0x03c2('0x51')]);return db[_0x03c2('0x3d')][_0x03c2('0x59')](_0x2fd00f)[_0x03c2('0x21')](handleEntityNotFound(_0x240376,null))[_0x03c2('0x21')](respondWithResult(_0x240376,null))['catch'](handleError(_0x240376,null));};exports[_0x03c2('0x5a')]=function(_0x8192e1,_0x2ed7fb){return db['OpenchannelMessage']['create'](_0x8192e1[_0x03c2('0x5b')],{})['then'](respondWithResult(_0x2ed7fb,0xc9))[_0x03c2('0x2a')](handleError(_0x2ed7fb,null));};exports['update']=function(_0x4814d9,_0x36b9e7){if(_0x4814d9[_0x03c2('0x5b')]['id']){delete _0x4814d9[_0x03c2('0x5b')]['id'];}return db[_0x03c2('0x3d')]['find']({'where':{'id':_0x4814d9['params']['id']}})[_0x03c2('0x21')](handleEntityNotFound(_0x36b9e7,null))[_0x03c2('0x21')](saveUpdates(_0x4814d9[_0x03c2('0x5b')],null))['then'](respondWithResult(_0x36b9e7,null))['catch'](handleError(_0x36b9e7,null));};exports['destroy']=function(_0x5489f8,_0x13e4ef){return db['OpenchannelMessage']['find']({'where':{'id':_0x5489f8[_0x03c2('0x57')]['id']}})[_0x03c2('0x21')](handleEntityNotFound(_0x13e4ef,null))[_0x03c2('0x21')](removeEntity(_0x13e4ef,null))[_0x03c2('0x2a')](handleError(_0x13e4ef,null));};exports['describe']=function(_0x25715f,_0x3e3429){return db[_0x03c2('0x3d')]['describe']()[_0x03c2('0x21')](respondWithResult(_0x3e3429,null))[_0x03c2('0x2a')](handleError(_0x3e3429,null));};var interaction_log=require(_0x03c2('0x5c'))(_0x03c2('0x5d'));exports['accept']=function(_0x43f1c8,_0x32ec93,_0x5f30d3){var _0x18b5c5={'channel':_0x03c2('0x5e')};if(_0x43f1c8[_0x03c2('0x5b')]['id']){delete _0x43f1c8[_0x03c2('0x5b')]['id'];}_0x43f1c8[_0x03c2('0x5b')][_0x03c2('0x5f')]=!![];_0x43f1c8['body']['readAt']=moment()[_0x03c2('0x60')](_0x03c2('0x61'));_0x43f1c8[_0x03c2('0x5b')][_0x03c2('0x62')]=_0x43f1c8['body'][_0x03c2('0x62')]||_0x43f1c8[_0x03c2('0x63')]['id'];return db[_0x03c2('0x3d')][_0x03c2('0x59')]({'where':{'id':_0x43f1c8['params']['id'],'UserId':null},'include':[{'model':db[_0x03c2('0x64')],'as':_0x03c2('0x65')}]})[_0x03c2('0x21')](handleEntityNotFound(_0x32ec93,null))['then'](saveUpdates(_0x43f1c8[_0x03c2('0x5b')],null))[_0x03c2('0x21')](function(_0x4a93d8){if(_0x4a93d8){_0x18b5c5[_0x03c2('0x28')]=_0x4a93d8[_0x03c2('0x66')]({'plain':!![]});return db[_0x03c2('0x67')][_0x03c2('0x59')]({'where':{'id':_0x4a93d8[_0x03c2('0x68')]}});}return null;})[_0x03c2('0x21')](handleEntityNotFound(_0x32ec93,null))['then'](function(_0x56f53b){if(_0x56f53b){return _0x56f53b[_0x03c2('0x36')]({'UserId':_0x43f1c8['body']['UserId'],'read1stAt':_['isNil'](_0x56f53b[_0x03c2('0x69')])?moment()[_0x03c2('0x60')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0x03c2('0x21')](function(_0x5325c1){if(_0x5325c1){_0x18b5c5['interaction']=_0x5325c1[_0x03c2('0x66')]({'plain':!![]});interaction_log[_0x03c2('0x22')]('[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x43f1c8[_0x03c2('0x63')]['id'],_0x43f1c8[_0x03c2('0x63')][_0x03c2('0x39')],_0x43f1c8[_0x03c2('0x63')][_0x03c2('0x6a')],_0x18b5c5[_0x03c2('0x6b')]['id'],_0x43f1c8[_0x03c2('0x5b')]?JSON['stringify'](_0x43f1c8[_0x03c2('0x5b')]):_0x03c2('0x6c'));return respondWithRpcPromise(_0x03c2('0x6d'),'acceptMessage',_0x18b5c5);}return null;})[_0x03c2('0x21')](function(_0x563a48){if(_0x563a48){if(_0x43f1c8[_0x03c2('0x5b')][_0x03c2('0x6e')]){_0x18b5c5['message'][_0x03c2('0x6f')]=util[_0x03c2('0x60')](_0x03c2('0x70'),_0x43f1c8[_0x03c2('0x63')]['name']);_0x18b5c5[_0x03c2('0x28')][_0x03c2('0x71')]=_0x18b5c5[_0x03c2('0x71')];_0x18b5c5[_0x03c2('0x28')]['event']=_0x03c2('0x72');return respondWithRpcPromise(_0x03c2('0x73'),_0x03c2('0x73'),{'event':_0x03c2('0x74'),'message':_0x18b5c5[_0x03c2('0x28')]},client9002)[_0x03c2('0x21')](function(){return _0x18b5c5;});}return _0x18b5c5;}return null;})[_0x03c2('0x21')](respondWithResult(_0x32ec93,null))[_0x03c2('0x2a')](handleError(_0x32ec93,null));};var interaction_log=require('../../config/logger')(_0x03c2('0x5d'));exports[_0x03c2('0x34')]=function(_0x1c9bc8,_0xc8cdac,_0x51f57a){var _0x2c68f8={'agent':{},'channel':_0x03c2('0x5e')};if(_0x1c9bc8[_0x03c2('0x5b')]['id']){delete _0x1c9bc8['body']['id'];}_0x1c9bc8[_0x03c2('0x5b')][_0x03c2('0x62')]=_0x1c9bc8[_0x03c2('0x5b')][_0x03c2('0x62')]||_0x1c9bc8['user']['id'];_0x2c68f8['agent']['id']=_0x1c9bc8[_0x03c2('0x5b')][_0x03c2('0x62')];return db[_0x03c2('0x3d')][_0x03c2('0x59')]({'where':{'id':_0x1c9bc8[_0x03c2('0x57')]['id'],'UserId':null}})[_0x03c2('0x21')](handleEntityNotFound(_0xc8cdac,null))[_0x03c2('0x21')](function(_0x461f65){if(_0x461f65){_0x2c68f8[_0x03c2('0x28')]=_0x461f65[_0x03c2('0x66')]({'plain':!![]});return db['OpenchannelInteraction'][_0x03c2('0x59')]({'where':{'id':_0x461f65[_0x03c2('0x68')]}});}return null;})['then'](handleEntityNotFound(_0xc8cdac,null))[_0x03c2('0x21')](function(_0x45b9a9){if(_0x45b9a9){_0x2c68f8[_0x03c2('0x6b')]=_0x45b9a9[_0x03c2('0x66')]({'plain':!![]});interaction_log[_0x03c2('0x22')](_0x03c2('0x75'),_0x1c9bc8[_0x03c2('0x63')]['id'],_0x1c9bc8[_0x03c2('0x63')][_0x03c2('0x39')],_0x1c9bc8['user'][_0x03c2('0x6a')],_0x2c68f8[_0x03c2('0x6b')]['id'],_0x1c9bc8[_0x03c2('0x5b')]?JSON[_0x03c2('0x26')](_0x1c9bc8[_0x03c2('0x5b')]):_0x03c2('0x6c'));return respondWithRpcPromise(_0x03c2('0x76'),_0x03c2('0x77'),_0x2c68f8);}return null;})[_0x03c2('0x21')](function(_0xb130b0){if(_0xb130b0){_0xb130b0[_0x03c2('0x28')][_0x03c2('0x6f')]=util[_0x03c2('0x60')]('SIP/%s',_0x1c9bc8['user']['name']);_0xb130b0[_0x03c2('0x28')]['channel']=_0x2c68f8['channel'];_0xb130b0[_0x03c2('0x28')][_0x03c2('0x78')]='reject';respondWithRpcPromise(_0x03c2('0x73'),'EventManager',{'event':'rejectmessage','message':_0xb130b0[_0x03c2('0x28')]},client9002);return _0x2c68f8;}return null;})[_0x03c2('0x21')](respondWithResult(_0xc8cdac,null))[_0x03c2('0x2a')](handleError(_0xc8cdac,null));};
\ No newline at end of file
diff --git a/server/api/openchannelMessage/openchannelMessage.events.js b/server/api/openchannelMessage/openchannelMessage.events.js
index 95e98d0..f4fa48a 100644
--- a/server/api/openchannelMessage/openchannelMessage.events.js
+++ b/server/api/openchannelMessage/openchannelMessage.events.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x8a11=['emit','hook','exports','events','../../mysqldb','OpenchannelMessage','setMaxListeners','update','remove'];(function(_0x2b42ab,_0x51f236){var _0x3ce62c=function(_0x4e62bf){while(--_0x4e62bf){_0x2b42ab['push'](_0x2b42ab['shift']());}};_0x3ce62c(++_0x51f236);}(_0x8a11,0xff));var _0x18a1=function(_0x21aec3,_0x5c97e9){_0x21aec3=_0x21aec3-0x0;var _0x288bbc=_0x8a11[_0x21aec3];return _0x288bbc;};'use strict';var EventEmitter=require(_0x18a1('0x0'));var OpenchannelMessage=require(_0x18a1('0x1'))['db'][_0x18a1('0x2')];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents[_0x18a1('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x18a1('0x4'),'afterDestroy':_0x18a1('0x5')};function emitEvent(_0x494d5b){return function(_0x4144a3,_0x266be4,_0xa1654a){OpenchannelMessageEvents[_0x18a1('0x6')](_0x494d5b+':'+_0x4144a3['id'],_0x4144a3);OpenchannelMessageEvents[_0x18a1('0x6')](_0x494d5b,_0x4144a3);_0xa1654a(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelMessage[_0x18a1('0x7')](e,emitEvent(event));}}module[_0x18a1('0x8')]=OpenchannelMessageEvents;
\ No newline at end of file
+var _0xd710=['setMaxListeners','update','remove','hasOwnProperty','hook','events','../../mysqldb','OpenchannelMessage'];(function(_0x325f01,_0x9e0a37){var _0x19996a=function(_0x3e31b4){while(--_0x3e31b4){_0x325f01['push'](_0x325f01['shift']());}};_0x19996a(++_0x9e0a37);}(_0xd710,0x11d));var _0x0d71=function(_0x354d36,_0x2927f0){_0x354d36=_0x354d36-0x0;var _0x3d8140=_0xd710[_0x354d36];return _0x3d8140;};'use strict';var EventEmitter=require(_0x0d71('0x0'));var OpenchannelMessage=require(_0x0d71('0x1'))['db'][_0x0d71('0x2')];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents[_0x0d71('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x0d71('0x4'),'afterDestroy':_0x0d71('0x5')};function emitEvent(_0x2f8a41){return function(_0x139790,_0x14989a,_0x4257d5){OpenchannelMessageEvents['emit'](_0x2f8a41+':'+_0x139790['id'],_0x139790);OpenchannelMessageEvents['emit'](_0x2f8a41,_0x139790);_0x4257d5(null);};}for(var e in events){if(events[_0x0d71('0x6')](e)){var event=events[e];OpenchannelMessage[_0x0d71('0x7')](e,emitEvent(event));}}module['exports']=OpenchannelMessageEvents;
\ No newline at end of file
diff --git a/server/api/openchannelMessage/openchannelMessage.model.js b/server/api/openchannelMessage/openchannelMessage.model.js
index 051dcee..70a4d83 100644
--- a/server/api/openchannelMessage/openchannelMessage.model.js
+++ b/server/api/openchannelMessage/openchannelMessage.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xe700=['OpenchannelAccountId','OpenchannelInteraction','Interactions','Contact','keys','replyUri','OpenchannelMessage,\x20%s,\x20%s','afterCreate','format','length','Interaction','omit','method','POST','info','Message\x20%d\x20forwarded\x20to\x20%s','threadId','inspect','finally','lodash','util','../../config/logger','api','moment','request-promise','rimraf','../../config/environment','define','OpenchannelMessage','fti_openchannel_messages','body','FULLTEXT','get','direction','toLowerCase','out','secret','isNil','UserId','findOne','OpenchannelInteractionId','then','update','createdAt','catch','error','CmContact','describe','find'];(function(_0xdafc09,_0x26e1f6){var _0x2f1806=function(_0x543e8c){while(--_0x543e8c){_0xdafc09['push'](_0xdafc09['shift']());}};_0x2f1806(++_0x26e1f6);}(_0xe700,0x16a));var _0x0e70=function(_0x4b3531,_0x1667be){_0x4b3531=_0x4b3531-0x0;var _0x2cde39=_0xe700[_0x4b3531];return _0x2cde39;};'use strict';var _=require(_0x0e70('0x0'));var util=require(_0x0e70('0x1'));var logger=require(_0x0e70('0x2'))(_0x0e70('0x3'));var moment=require(_0x0e70('0x4'));var BPromise=require('bluebird');var rp=require(_0x0e70('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0e70('0x6'));var config=require(_0x0e70('0x7'));var attributes=require('./openchannelMessage.attributes');module['exports']=function(_0xf3ba11,_0xc96045){return _0xf3ba11[_0x0e70('0x8')](_0x0e70('0x9'),attributes,{'tableName':'openchannel_messages','paranoid':![],'indexes':[{'name':_0x0e70('0xa'),'fields':[_0x0e70('0xb')],'type':_0x0e70('0xc')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x175008,_0x151c76,_0x138187){var _0x34cac5=_0xf3ba11['models'];var _0x4364c9=_0x175008[_0x0e70('0xd')]({'plain':!![]});if(_0x4364c9[_0x0e70('0xe')]['toLowerCase']()==='in'||_0x4364c9[_0x0e70('0xe')][_0x0e70('0xf')]()===_0x0e70('0x10')&&!_0x4364c9[_0x0e70('0x11')]&&!_[_0x0e70('0x12')](_0x4364c9[_0x0e70('0x13')])){_0x34cac5['OpenchannelInteraction'][_0x0e70('0x14')]({'where':{'id':_0x4364c9[_0x0e70('0x15')]}})[_0x0e70('0x16')](function(_0x296f48){if(_0x296f48){_0x296f48[_0x0e70('0x17')]({'lastMsgAt':_0x4364c9[_0x0e70('0x18')],'lastMsgDirection':_0x4364c9['direction']['toLowerCase']()});}})[_0x0e70('0x19')](function(_0x17b763){console[_0x0e70('0x1a')](_0x17b763);});}if(_0x4364c9['direction']===_0x0e70('0x10')&&!_0x4364c9[_0x0e70('0x11')]){var _0x3c9545;_0x34cac5[_0x0e70('0x1b')][_0x0e70('0x1c')]()[_0x0e70('0x16')](function(_0x5300d6){return _0x34cac5['OpenchannelAccount'][_0x0e70('0x1d')]({'where':{'id':_0x4364c9[_0x0e70('0x1e')]},'include':[{'model':_0x34cac5[_0x0e70('0x1f')],'as':_0x0e70('0x20'),'where':{'id':_0x4364c9['OpenchannelInteractionId']},'limit':0x1,'include':[{'model':_0x34cac5[_0x0e70('0x1b')],'as':_0x0e70('0x21'),'attributes':_[_0x0e70('0x22')](_0x5300d6)}]}]});})[_0x0e70('0x16')](function(_0x1e51ab){_0x3c9545=_0x1e51ab[_0x0e70('0xd')]({'plain':!![]});if(_0x3c9545&&_0x3c9545[_0x0e70('0x23')]){logger['info'](_0x0e70('0x24'),_0x0e70('0x25'),util[_0x0e70('0x26')]('Forwarding\x20message\x20%d\x20to\x20%s',_0x4364c9['id'],_0x3c9545[_0x0e70('0x23')]));if(_0x3c9545['Interactions']&&_0x3c9545[_0x0e70('0x20')][_0x0e70('0x27')]){_0x4364c9[_0x0e70('0x28')]=_[_0x0e70('0x29')](_0x3c9545['Interactions'][0x0],'Contact');_0x4364c9[_0x0e70('0x21')]=_0x3c9545[_0x0e70('0x20')][0x0][_0x0e70('0x21')];}var _0x151c76={'method':'POST','uri':encodeURI(_0x3c9545[_0x0e70('0x23')]),'json':!![],'resolveWithFullResponse':!![]};switch(_0x151c76[_0x0e70('0x2a')]){case'GET':_0x151c76['qs']=_0x4364c9;break;case _0x0e70('0x2b'):_0x151c76[_0x0e70('0xb')]=_0x4364c9;break;}return rp(_0x151c76)['then'](function(_0x492299){logger[_0x0e70('0x2c')](_0x0e70('0x24'),_0x0e70('0x25'),util[_0x0e70('0x26')](_0x0e70('0x2d'),_0x4364c9['id'],_0x3c9545[_0x0e70('0x23')]));if(_0x492299[_0x0e70('0xb')]['threadId']&&_0x492299[_0x0e70('0xb')]['threadId']!=_0x4364c9['Interaction'][_0x0e70('0x2e')]){return _0x34cac5[_0x0e70('0x1f')][_0x0e70('0x17')]({'threadId':_0x492299[_0x0e70('0xb')]['threadId']},{'logging':!![],'where':{'id':_0x4364c9[_0x0e70('0x28')]['id']}});}else{return;}})['then'](function(){return _0x175008[_0x0e70('0x17')]({'read':!![]});})['catch'](function(_0x34a11a){logger['error'](_0x0e70('0x24'),_0x0e70('0x25'),util[_0x0e70('0x2f')](_0x34a11a,{'showHidden':![],'depth':null}));_0x138187();});}else{_0x138187();}})[_0x0e70('0x30')](function(){_0x138187();});}else{_0x138187();}}},'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0xc9f5=['util','../../config/logger','moment','bluebird','request-promise','../../config/environment','exports','define','OpenchannelMessage','openchannel_messages','fti_openchannel_messages','body','FULLTEXT','models','get','direction','toLowerCase','out','secret','isNil','UserId','OpenchannelInteraction','findOne','then','update','createdAt','catch','error','OpenchannelAccount','Interactions','OpenchannelInteractionId','CmContact','Contact','keys','replyUri','OpenchannelMessage,\x20%s,\x20%s','afterCreate','format','Forwarding\x20message\x20%d\x20to\x20%s','POST','method','GET','info','Message\x20%d\x20forwarded\x20to\x20%s','threadId','Interaction','inspect','finally','utf8mb4'];(function(_0x4f72c4,_0x414764){var _0x41e0a3=function(_0x12a802){while(--_0x12a802){_0x4f72c4['push'](_0x4f72c4['shift']());}};_0x41e0a3(++_0x414764);}(_0xc9f5,0xc4));var _0x5c9f=function(_0x5b8310,_0x77ea6f){_0x5b8310=_0x5b8310-0x0;var _0xd3ebc1=_0xc9f5[_0x5b8310];return _0xd3ebc1;};'use strict';var _=require('lodash');var util=require(_0x5c9f('0x0'));var logger=require(_0x5c9f('0x1'))('api');var moment=require(_0x5c9f('0x2'));var BPromise=require(_0x5c9f('0x3'));var rp=require(_0x5c9f('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x5c9f('0x5'));var attributes=require('./openchannelMessage.attributes');module[_0x5c9f('0x6')]=function(_0x563d0c,_0x3100cf){return _0x563d0c[_0x5c9f('0x7')](_0x5c9f('0x8'),attributes,{'tableName':_0x5c9f('0x9'),'paranoid':![],'indexes':[{'name':_0x5c9f('0xa'),'fields':[_0x5c9f('0xb')],'type':_0x5c9f('0xc')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x258fe5,_0x279b07,_0x3d782a){var _0x397c29=_0x563d0c[_0x5c9f('0xd')];var _0xd735fd=_0x258fe5[_0x5c9f('0xe')]({'plain':!![]});if(_0xd735fd[_0x5c9f('0xf')][_0x5c9f('0x10')]()==='in'||_0xd735fd[_0x5c9f('0xf')]['toLowerCase']()===_0x5c9f('0x11')&&!_0xd735fd[_0x5c9f('0x12')]&&!_[_0x5c9f('0x13')](_0xd735fd[_0x5c9f('0x14')])){_0x397c29[_0x5c9f('0x15')][_0x5c9f('0x16')]({'where':{'id':_0xd735fd['OpenchannelInteractionId']}})[_0x5c9f('0x17')](function(_0xa185ab){if(_0xa185ab){_0xa185ab[_0x5c9f('0x18')]({'lastMsgAt':_0xd735fd[_0x5c9f('0x19')],'lastMsgDirection':_0xd735fd[_0x5c9f('0xf')][_0x5c9f('0x10')]()});}})[_0x5c9f('0x1a')](function(_0x281b49){console[_0x5c9f('0x1b')](_0x281b49);});}if(_0xd735fd['direction']==='out'&&!_0xd735fd['secret']){var _0x48feaf;_0x397c29['CmContact']['describe']()['then'](function(_0x918ad3){return _0x397c29[_0x5c9f('0x1c')]['find']({'where':{'id':_0xd735fd['OpenchannelAccountId']},'include':[{'model':_0x397c29[_0x5c9f('0x15')],'as':_0x5c9f('0x1d'),'where':{'id':_0xd735fd[_0x5c9f('0x1e')]},'limit':0x1,'include':[{'model':_0x397c29[_0x5c9f('0x1f')],'as':_0x5c9f('0x20'),'attributes':_[_0x5c9f('0x21')](_0x918ad3)}]}]});})[_0x5c9f('0x17')](function(_0x2e7ba4){_0x48feaf=_0x2e7ba4[_0x5c9f('0xe')]({'plain':!![]});if(_0x48feaf&&_0x48feaf[_0x5c9f('0x22')]){logger['info'](_0x5c9f('0x23'),_0x5c9f('0x24'),util[_0x5c9f('0x25')](_0x5c9f('0x26'),_0xd735fd['id'],_0x48feaf[_0x5c9f('0x22')]));if(_0x48feaf['Interactions']&&_0x48feaf[_0x5c9f('0x1d')]['length']){_0xd735fd['Interaction']=_['omit'](_0x48feaf['Interactions'][0x0],_0x5c9f('0x20'));_0xd735fd[_0x5c9f('0x20')]=_0x48feaf['Interactions'][0x0][_0x5c9f('0x20')];}var _0x279b07={'method':_0x5c9f('0x27'),'uri':encodeURI(_0x48feaf['replyUri']),'json':!![],'resolveWithFullResponse':!![]};switch(_0x279b07[_0x5c9f('0x28')]){case _0x5c9f('0x29'):_0x279b07['qs']=_0xd735fd;break;case'POST':_0x279b07[_0x5c9f('0xb')]=_0xd735fd;break;}return rp(_0x279b07)['then'](function(_0x16a695){logger[_0x5c9f('0x2a')](_0x5c9f('0x23'),'afterCreate',util[_0x5c9f('0x25')](_0x5c9f('0x2b'),_0xd735fd['id'],_0x48feaf[_0x5c9f('0x22')]));if(_0x16a695[_0x5c9f('0xb')]['threadId']&&_0x16a695[_0x5c9f('0xb')][_0x5c9f('0x2c')]!=_0xd735fd[_0x5c9f('0x2d')][_0x5c9f('0x2c')]){return _0x397c29[_0x5c9f('0x15')]['update']({'threadId':_0x16a695[_0x5c9f('0xb')]['threadId']},{'logging':!![],'where':{'id':_0xd735fd[_0x5c9f('0x2d')]['id']}});}else{return;}})[_0x5c9f('0x17')](function(){return _0x258fe5['update']({'read':!![]});})[_0x5c9f('0x1a')](function(_0x55cec9){logger[_0x5c9f('0x1b')]('OpenchannelMessage,\x20%s,\x20%s',_0x5c9f('0x24'),util[_0x5c9f('0x2e')](_0x55cec9,{'showHidden':![],'depth':null}));_0x3d782a();});}else{_0x3d782a();}})[_0x5c9f('0x2f')](function(){_0x3d782a();});}else{_0x3d782a();}}},'charset':_0x5c9f('0x30'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
diff --git a/server/api/openchannelMessage/openchannelMessage.rpc.js b/server/api/openchannelMessage/openchannelMessage.rpc.js
index 4ce5d38..e1847c8 100644
--- a/server/api/openchannelMessage/openchannelMessage.rpc.js
+++ b/server/api/openchannelMessage/openchannelMessage.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xcac3=['catch','CreateOpenchannelMessage','OpenchannelMessage','create','body','options','raw','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./openchannelMessage.socket','register','request','then','request\x20sent','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','stringify','error','OpenchannelMessage,\x20%s,\x20%s','message','info','result'];(function(_0x5c58b3,_0x5635e5){var _0x46c871=function(_0x326543){while(--_0x326543){_0x5c58b3['push'](_0x5c58b3['shift']());}};_0x46c871(++_0x5635e5);}(_0xcac3,0x193));var _0x3cac=function(_0x919445,_0x5467dc){_0x919445=_0x919445-0x0;var _0x511b3e=_0xcac3[_0x919445];return _0x511b3e;};'use strict';var _=require('lodash');var util=require(_0x3cac('0x0'));var moment=require(_0x3cac('0x1'));var BPromise=require(_0x3cac('0x2'));var rs=require(_0x3cac('0x3'));var fs=require('fs');var Redis=require(_0x3cac('0x4'));var db=require(_0x3cac('0x5'))['db'];var utils=require(_0x3cac('0x6'));var logger=require(_0x3cac('0x7'))(_0x3cac('0x8'));var config=require(_0x3cac('0x9'));var jayson=require(_0x3cac('0xa'));var client=jayson[_0x3cac('0xb')][_0x3cac('0xc')]({'port':0x232a});config[_0x3cac('0xd')]=_[_0x3cac('0xe')](config[_0x3cac('0xd')],{'host':_0x3cac('0xf'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x3cac('0xd')]));require(_0x3cac('0x10'))[_0x3cac('0x11')](socket);function respondWithRpcPromise(_0x306664,_0x131e0d,_0x5a3ece){return new BPromise(function(_0x1e8fef,_0x169e39){return client[_0x3cac('0x12')](_0x306664,_0x5a3ece)[_0x3cac('0x13')](function(_0x1c5c70){logger['info']('OpenchannelMessage,\x20%s,\x20%s',_0x131e0d,_0x3cac('0x14'));logger[_0x3cac('0x15')](_0x3cac('0x16'),_0x131e0d,_0x3cac('0x14'),JSON[_0x3cac('0x17')](_0x1c5c70));if(_0x1c5c70[_0x3cac('0x18')]){if(_0x1c5c70[_0x3cac('0x18')]['code']===0x1f4){logger[_0x3cac('0x18')](_0x3cac('0x19'),_0x131e0d,_0x1c5c70[_0x3cac('0x18')][_0x3cac('0x1a')]);return _0x169e39(_0x1c5c70[_0x3cac('0x18')][_0x3cac('0x1a')]);}logger[_0x3cac('0x18')](_0x3cac('0x19'),_0x131e0d,_0x1c5c70[_0x3cac('0x18')][_0x3cac('0x1a')]);return _0x1e8fef(_0x1c5c70[_0x3cac('0x18')][_0x3cac('0x1a')]);}else{logger[_0x3cac('0x1b')](_0x3cac('0x19'),_0x131e0d,_0x3cac('0x14'));_0x1e8fef(_0x1c5c70[_0x3cac('0x1c')][_0x3cac('0x1a')]);}})[_0x3cac('0x1d')](function(_0x3cb08f){logger[_0x3cac('0x18')](_0x3cac('0x19'),_0x131e0d,_0x3cb08f);_0x169e39(_0x3cb08f);});});}exports[_0x3cac('0x1e')]=function(_0x4fa448){var _0x14d84b=this;return new Promise(function(_0x25ae9c,_0x5af4b9){return db[_0x3cac('0x1f')][_0x3cac('0x20')](_0x4fa448[_0x3cac('0x21')],{'raw':_0x4fa448[_0x3cac('0x22')]?_0x4fa448[_0x3cac('0x22')][_0x3cac('0x23')]===undefined?!![]:![]:!![]})['then'](function(_0x19010f){logger['info']('CreateOpenchannelMessage',_0x4fa448);logger['debug'](_0x3cac('0x1e'),_0x4fa448,JSON[_0x3cac('0x17')](_0x19010f));_0x25ae9c(_0x19010f);})[_0x3cac('0x1d')](function(_0x12640a){logger[_0x3cac('0x18')](_0x3cac('0x1e'),_0x12640a[_0x3cac('0x1a')],_0x4fa448);_0x5af4b9(_0x14d84b[_0x3cac('0x18')](0x1f4,_0x12640a[_0x3cac('0x1a')]));});});};
\ No newline at end of file
+var _0xbd9e=['info','request\x20sent','debug','stringify','error','OpenchannelMessage,\x20%s,\x20%s','message','result','catch','CreateOpenchannelMessage','OpenchannelMessage','create','body','options','raw','then','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','redis','defaults','localhost','./openchannelMessage.socket','register','request'];(function(_0x3bd557,_0x3fe1e2){var _0x4e6cd6=function(_0xd76385){while(--_0xd76385){_0x3bd557['push'](_0x3bd557['shift']());}};_0x4e6cd6(++_0x3fe1e2);}(_0xbd9e,0x108));var _0xebd9=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0xbd9e[_0x1ac595];return _0x455fff;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xebd9('0x0'));var BPromise=require('bluebird');var rs=require(_0xebd9('0x1'));var fs=require('fs');var Redis=require(_0xebd9('0x2'));var db=require(_0xebd9('0x3'))['db'];var utils=require(_0xebd9('0x4'));var logger=require(_0xebd9('0x5'))('rpc');var config=require(_0xebd9('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xebd9('0x7')][_0xebd9('0x8')]({'port':0x232a});config[_0xebd9('0x9')]=_[_0xebd9('0xa')](config[_0xebd9('0x9')],{'host':_0xebd9('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xebd9('0x9')]));require(_0xebd9('0xc'))[_0xebd9('0xd')](socket);function respondWithRpcPromise(_0x406705,_0x16537e,_0x4b1985){return new BPromise(function(_0x35fcfd,_0x5eda85){return client[_0xebd9('0xe')](_0x406705,_0x4b1985)['then'](function(_0x40c787){logger[_0xebd9('0xf')]('OpenchannelMessage,\x20%s,\x20%s',_0x16537e,_0xebd9('0x10'));logger[_0xebd9('0x11')]('OpenchannelMessage,\x20%s,\x20%s,\x20%s',_0x16537e,_0xebd9('0x10'),JSON[_0xebd9('0x12')](_0x40c787));if(_0x40c787[_0xebd9('0x13')]){if(_0x40c787[_0xebd9('0x13')]['code']===0x1f4){logger[_0xebd9('0x13')](_0xebd9('0x14'),_0x16537e,_0x40c787[_0xebd9('0x13')][_0xebd9('0x15')]);return _0x5eda85(_0x40c787[_0xebd9('0x13')][_0xebd9('0x15')]);}logger[_0xebd9('0x13')](_0xebd9('0x14'),_0x16537e,_0x40c787[_0xebd9('0x13')][_0xebd9('0x15')]);return _0x35fcfd(_0x40c787[_0xebd9('0x13')][_0xebd9('0x15')]);}else{logger[_0xebd9('0xf')](_0xebd9('0x14'),_0x16537e,'request\x20sent');_0x35fcfd(_0x40c787[_0xebd9('0x16')][_0xebd9('0x15')]);}})[_0xebd9('0x17')](function(_0x4d793e){logger[_0xebd9('0x13')]('OpenchannelMessage,\x20%s,\x20%s',_0x16537e,_0x4d793e);_0x5eda85(_0x4d793e);});});}exports[_0xebd9('0x18')]=function(_0x474ed8){var _0x5c62d8=this;return new Promise(function(_0x509e81,_0x5701cd){return db[_0xebd9('0x19')][_0xebd9('0x1a')](_0x474ed8[_0xebd9('0x1b')],{'raw':_0x474ed8['options']?_0x474ed8[_0xebd9('0x1c')][_0xebd9('0x1d')]===undefined?!![]:![]:!![]})[_0xebd9('0x1e')](function(_0x2c17c8){logger[_0xebd9('0xf')](_0xebd9('0x18'),_0x474ed8);logger['debug'](_0xebd9('0x18'),_0x474ed8,JSON[_0xebd9('0x12')](_0x2c17c8));_0x509e81(_0x2c17c8);})['catch'](function(_0x556f05){logger[_0xebd9('0x13')](_0xebd9('0x18'),_0x556f05[_0xebd9('0x15')],_0x474ed8);_0x5701cd(_0x5c62d8[_0xebd9('0x13')](0x1f4,_0x556f05['message']));});});};
\ No newline at end of file
diff --git a/server/api/openchannelMessage/openchannelMessage.socket.js b/server/api/openchannelMessage/openchannelMessage.socket.js
index c494ded..e7d59c8 100644
--- a/server/api/openchannelMessage/openchannelMessage.socket.js
+++ b/server/api/openchannelMessage/openchannelMessage.socket.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x54ef=['remove','emit','removeListener','length','./openchannelMessage.events','save'];(function(_0x17042b,_0x595c02){var _0x246bf6=function(_0x2facf1){while(--_0x2facf1){_0x17042b['push'](_0x17042b['shift']());}};_0x246bf6(++_0x595c02);}(_0x54ef,0x112));var _0xf54e=function(_0x318a90,_0x1d5d96){_0x318a90=_0x318a90-0x0;var _0x5ec197=_0x54ef[_0x318a90];return _0x5ec197;};'use strict';var OpenchannelMessageEvents=require(_0xf54e('0x0'));var events=[_0xf54e('0x1'),_0xf54e('0x2'),'update'];function createListener(_0xd936f7,_0x18b7d6){return function(_0x18b1cf){_0x18b7d6[_0xf54e('0x3')](_0xd936f7,_0x18b1cf);};}function removeListener(_0x8b6bb6,_0x431e36){return function(){OpenchannelMessageEvents[_0xf54e('0x4')](_0x8b6bb6,_0x431e36);};}exports['register']=function(_0x55e611){for(var _0x18e84e=0x0,_0x99cf9=events[_0xf54e('0x5')];_0x18e84e<_0x99cf9;_0x18e84e++){var _0x561870=events[_0x18e84e];var _0x27e69b=createListener('openchannelMessage:'+_0x561870,_0x55e611);OpenchannelMessageEvents['on'](_0x561870,_0x27e69b);}};
\ No newline at end of file
+var _0xf4eb=['removeListener','register','./openchannelMessage.events'];(function(_0x3dfe00,_0x1e1cf5){var _0x2dd4f6=function(_0x362ab8){while(--_0x362ab8){_0x3dfe00['push'](_0x3dfe00['shift']());}};_0x2dd4f6(++_0x1e1cf5);}(_0xf4eb,0xec));var _0xbf4e=function(_0x25e67d,_0x50acdb){_0x25e67d=_0x25e67d-0x0;var _0x14e814=_0xf4eb[_0x25e67d];return _0x14e814;};'use strict';var OpenchannelMessageEvents=require(_0xbf4e('0x0'));var events=['save','remove','update'];function createListener(_0x5ed5b9,_0xbbbf01){return function(_0x49d80e){_0xbbbf01['emit'](_0x5ed5b9,_0x49d80e);};}function removeListener(_0x2e3070,_0x1c7606){return function(){OpenchannelMessageEvents[_0xbf4e('0x1')](_0x2e3070,_0x1c7606);};}exports[_0xbf4e('0x2')]=function(_0xa4dcf5){for(var _0x2fcfed=0x0,_0x15b99f=events['length'];_0x2fcfed<_0x15b99f;_0x2fcfed++){var _0x449d55=events[_0x2fcfed];var _0x5013c2=createListener('openchannelMessage:'+_0x449d55,_0xa4dcf5);OpenchannelMessageEvents['on'](_0x449d55,_0x5013c2);}};
\ No newline at end of file
diff --git a/server/api/openchannelQueue/index.js b/server/api/openchannelQueue/index.js
index b7c5465..e02e0f7 100644
--- a/server/api/openchannelQueue/index.js
+++ b/server/api/openchannelQueue/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x5fab=['connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelQueue.controller','get','isAuthenticated','index','describe','show','getMembers','/:id/teams','getTeams','/:id/users','getAgents','create','addTeams','post','addAgents','update','delete','/:id','removeTeams','removeAgents','exports','multer','util'];(function(_0x5f584a,_0x47f064){var _0x3788d9=function(_0x29c10b){while(--_0x29c10b){_0x5f584a['push'](_0x5f584a['shift']());}};_0x3788d9(++_0x47f064);}(_0x5fab,0x177));var _0xb5fa=function(_0x873d48,_0x3cf3c0){_0x873d48=_0x873d48-0x0;var _0x50c8ca=_0x5fab[_0x873d48];return _0x50c8ca;};'use strict';var multer=require(_0xb5fa('0x0'));var util=require(_0xb5fa('0x1'));var path=require('path');var timeout=require(_0xb5fa('0x2'));var express=require(_0xb5fa('0x3'));var router=express[_0xb5fa('0x4')]();var auth=require(_0xb5fa('0x5'));var interaction=require(_0xb5fa('0x6'));var config=require(_0xb5fa('0x7'));var controller=require(_0xb5fa('0x8'));router[_0xb5fa('0x9')]('/',auth[_0xb5fa('0xa')](),controller[_0xb5fa('0xb')]);router['get']('/describe',auth[_0xb5fa('0xa')](),controller[_0xb5fa('0xc')]);router[_0xb5fa('0x9')]('/:id',auth[_0xb5fa('0xa')](),controller[_0xb5fa('0xd')]);router[_0xb5fa('0x9')]('/:id/members',auth['isAuthenticated'](),controller[_0xb5fa('0xe')]);router[_0xb5fa('0x9')](_0xb5fa('0xf'),auth[_0xb5fa('0xa')](),controller[_0xb5fa('0x10')]);router[_0xb5fa('0x9')](_0xb5fa('0x11'),auth[_0xb5fa('0xa')](),controller[_0xb5fa('0x12')]);router['post']('/',auth[_0xb5fa('0xa')](),controller[_0xb5fa('0x13')]);router['post'](_0xb5fa('0xf'),auth['isAuthenticated'](),controller[_0xb5fa('0x14')]);router[_0xb5fa('0x15')](_0xb5fa('0x11'),auth[_0xb5fa('0xa')](),controller[_0xb5fa('0x16')]);router['put']('/:id',auth[_0xb5fa('0xa')](),controller[_0xb5fa('0x17')]);router[_0xb5fa('0x18')](_0xb5fa('0x19'),auth['isAuthenticated'](),controller['destroy']);router[_0xb5fa('0x18')](_0xb5fa('0xf'),auth[_0xb5fa('0xa')](),controller[_0xb5fa('0x1a')]);router[_0xb5fa('0x18')](_0xb5fa('0x11'),auth[_0xb5fa('0xa')](),controller[_0xb5fa('0x1b')]);module[_0xb5fa('0x1c')]=router;
\ No newline at end of file
+var _0x1501=['create','addTeams','update','delete','destroy','exports','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/describe','isAuthenticated','describe','/:id','/:id/members','/:id/teams','getTeams','/:id/users','post'];(function(_0x24c135,_0xdb4450){var _0x290c66=function(_0x537cf8){while(--_0x537cf8){_0x24c135['push'](_0x24c135['shift']());}};_0x290c66(++_0xdb4450);}(_0x1501,0x126));var _0x1150=function(_0x1e1020,_0xd64a27){_0x1e1020=_0x1e1020-0x0;var _0x464719=_0x1501[_0x1e1020];return _0x464719;};'use strict';var multer=require('multer');var util=require(_0x1150('0x0'));var path=require(_0x1150('0x1'));var timeout=require(_0x1150('0x2'));var express=require('express');var router=express[_0x1150('0x3')]();var auth=require(_0x1150('0x4'));var interaction=require(_0x1150('0x5'));var config=require(_0x1150('0x6'));var controller=require('./openchannelQueue.controller');router[_0x1150('0x7')]('/',auth['isAuthenticated'](),controller[_0x1150('0x8')]);router[_0x1150('0x7')](_0x1150('0x9'),auth[_0x1150('0xa')](),controller[_0x1150('0xb')]);router[_0x1150('0x7')](_0x1150('0xc'),auth['isAuthenticated'](),controller['show']);router[_0x1150('0x7')](_0x1150('0xd'),auth['isAuthenticated'](),controller['getMembers']);router[_0x1150('0x7')](_0x1150('0xe'),auth[_0x1150('0xa')](),controller[_0x1150('0xf')]);router['get'](_0x1150('0x10'),auth[_0x1150('0xa')](),controller['getAgents']);router[_0x1150('0x11')]('/',auth['isAuthenticated'](),controller[_0x1150('0x12')]);router[_0x1150('0x11')](_0x1150('0xe'),auth[_0x1150('0xa')](),controller[_0x1150('0x13')]);router[_0x1150('0x11')](_0x1150('0x10'),auth[_0x1150('0xa')](),controller['addAgents']);router['put'](_0x1150('0xc'),auth[_0x1150('0xa')](),controller[_0x1150('0x14')]);router[_0x1150('0x15')](_0x1150('0xc'),auth[_0x1150('0xa')](),controller[_0x1150('0x16')]);router[_0x1150('0x15')](_0x1150('0xe'),auth[_0x1150('0xa')](),controller['removeTeams']);router['delete'](_0x1150('0x10'),auth[_0x1150('0xa')](),controller['removeAgents']);module[_0x1150('0x17')]=router;
\ No newline at end of file
diff --git a/server/api/openchannelQueue/openchannelQueue.attributes.js b/server/api/openchannelQueue/openchannelQueue.attributes.js
index a45d73d..ea27040 100644
--- a/server/api/openchannelQueue/openchannelQueue.attributes.js
+++ b/server/api/openchannelQueue/openchannelQueue.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x6df9=['ENUM','beepall','sequelize','exports','name'];(function(_0x247765,_0x3c6713){var _0x30bd77=function(_0xc8baaa){while(--_0xc8baaa){_0x247765['push'](_0x247765['shift']());}};_0x30bd77(++_0x3c6713);}(_0x6df9,0x84));var _0x96df=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0x6df9[_0x3ab51d];return _0x29a04e;};'use strict';var Sequelize=require(_0x96df('0x0'));module[_0x96df('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x96df('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x96df('0x3')]('rrmemory',_0x96df('0x4'),'roundrobin')}};
\ No newline at end of file
+var _0x1fa9=['INTEGER','ENUM','beepall','roundrobin','sequelize','STRING'];(function(_0x317280,_0x4bbf1b){var _0x3999fd=function(_0x1a6214){while(--_0x1a6214){_0x317280['push'](_0x317280['shift']());}};_0x3999fd(++_0x4bbf1b);}(_0x1fa9,0x136));var _0x91fa=function(_0x482dd4,_0x59c6fe){_0x482dd4=_0x482dd4-0x0;var _0x1e806e=_0x1fa9[_0x482dd4];return _0x1e806e;};'use strict';var Sequelize=require(_0x91fa('0x0'));module['exports']={'name':{'type':Sequelize[_0x91fa('0x1')],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x91fa('0x1')]},'timeout':{'type':Sequelize[_0x91fa('0x2')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x91fa('0x3')]('rrmemory',_0x91fa('0x4'),_0x91fa('0x5'))}};
\ No newline at end of file
diff --git a/server/api/openchannelQueue/openchannelQueue.controller.js b/server/api/openchannelQueue/openchannelQueue.controller.js
index 2f7fc30..e5dc903 100644
--- a/server/api/openchannelQueue/openchannelQueue.controller.js
+++ b/server/api/openchannelQueue/openchannelQueue.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x3d2f=['findAll','rows','show','rawAttributes','includeAll','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','error','params','describe','getMembers','UserOpenchannelQueue','order','OpenchannelQueueId','filter','User','UserId','agent','openchannelPause','updatedAt','createdAt','format','SIP','getTeams','findOne','Team','addTeams','ids','Agents','online','voicePause','interface','transaction','each','findOrCreate','forEach','emit','select','field','from','team_has_openchannel_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','OpenchannelQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','sequelize','toString','every','TeamId','all','union','value','removeTeams','isEmpty','removeAgents','addAgents','omit','isArray','userOpenchannelQueue:remove','getAgents','html-pdf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./openchannelQueue.socket','register','sendStatus','status','end','json','count','offset','set','apply','reject','save','update','then','destroy','get','stack','name','index','map','OpenchannelQueue','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','sort','pick','where','merge','VIRTUAL','options','include'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x3d2f,0x166));var _0xf3d2=function(_0x21c21d,_0x5569f7){_0x21c21d=_0x21c21d-0x0;var _0x4101fb=_0x3d2f[_0x21c21d];return _0x4101fb;};'use strict';var pdf=require(_0xf3d2('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xf3d2('0x1'));var jsonpatch=require(_0xf3d2('0x2'));var rp=require('request-promise');var moment=require(_0xf3d2('0x3'));var BPromise=require(_0xf3d2('0x4'));var Mustache=require(_0xf3d2('0x5'));var util=require(_0xf3d2('0x6'));var path=require(_0xf3d2('0x7'));var sox=require(_0xf3d2('0x8'));var csv=require(_0xf3d2('0x9'));var ejs=require(_0xf3d2('0xa'));var fs=require('fs');var _=require(_0xf3d2('0xb'));var squel=require('squel');var crypto=require(_0xf3d2('0xc'));var jsforce=require(_0xf3d2('0xd'));var deskjs=require(_0xf3d2('0xe'));var toCsv=require(_0xf3d2('0x9'));var querystring=require(_0xf3d2('0xf'));var Papa=require(_0xf3d2('0x10'));var Redis=require(_0xf3d2('0x11'));var authService=require(_0xf3d2('0x12'));var qs=require(_0xf3d2('0x13'));var as=require(_0xf3d2('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xf3d2('0x15'));var utils=require(_0xf3d2('0x16'));var config=require(_0xf3d2('0x17'));var db=require(_0xf3d2('0x18'))['db'];config[_0xf3d2('0x19')]=_[_0xf3d2('0x1a')](config[_0xf3d2('0x19')],{'host':_0xf3d2('0x1b'),'port':0x18eb});var socket=require(_0xf3d2('0x1c'))(new Redis(config[_0xf3d2('0x19')]));require(_0xf3d2('0x1d'))[_0xf3d2('0x1e')](socket);function respondWithStatusCode(_0x33cfed,_0x2fd1ac){_0x2fd1ac=_0x2fd1ac||0xcc;return function(_0x4761bd){if(_0x4761bd){return _0x33cfed[_0xf3d2('0x1f')](_0x2fd1ac);}return _0x33cfed[_0xf3d2('0x20')](_0x2fd1ac)[_0xf3d2('0x21')]();};}function respondWithResult(_0xf14666,_0x4ddca2){_0x4ddca2=_0x4ddca2||0xc8;return function(_0x2246f5){if(_0x2246f5){return _0xf14666[_0xf3d2('0x20')](_0x4ddca2)[_0xf3d2('0x22')](_0x2246f5);}};}function respondWithFilteredResult(_0x586c16,_0x25c2ba){return function(_0x3ad413){if(_0x3ad413){var _0x4a1917=_0x3ad413[_0xf3d2('0x23')],_0x411276=_0x25c2ba[_0xf3d2('0x24')],_0x2bcd21=_0x25c2ba[_0xf3d2('0x24')]+_0x25c2ba['limit'],_0x1ab926;if(_0x2bcd21>=_0x4a1917){_0x2bcd21=_0x4a1917;_0x1ab926=0xc8;}else{_0x1ab926=0xce;}_0x586c16[_0xf3d2('0x20')](_0x1ab926);return _0x586c16[_0xf3d2('0x25')]('Content-Range',_0x411276+'-'+_0x2bcd21+'/'+_0x4a1917)[_0xf3d2('0x22')](_0x3ad413);}return null;};}function patchUpdates(_0xe01782){return function(_0x9d5ed){try{jsonpatch[_0xf3d2('0x26')](_0x9d5ed,_0xe01782,!![]);}catch(_0x607190){return BPromise[_0xf3d2('0x27')](_0x607190);}return _0x9d5ed[_0xf3d2('0x28')]();};}function saveUpdates(_0x4c9efc,_0x5ed9c4){return function(_0xda02e4){if(_0xda02e4){return _0xda02e4[_0xf3d2('0x29')](_0x4c9efc)[_0xf3d2('0x2a')](function(_0x5dffcc){return _0x5dffcc;});}return null;};}function removeEntity(_0x266309,_0x4c2e25){return function(_0x58ff06){if(_0x58ff06){return _0x58ff06[_0xf3d2('0x2b')]()[_0xf3d2('0x2a')](function(){var _0x145379=_0x58ff06[_0xf3d2('0x2c')]({'plain':!![]});var _0x4e5c19='OpenchannelQueues';return db['UserProfileResource'][_0xf3d2('0x2b')]({'where':{'type':_0x4e5c19,'resourceId':_0x145379['id']}})[_0xf3d2('0x2a')](function(){return _0x58ff06;});})[_0xf3d2('0x2a')](function(){_0x266309[_0xf3d2('0x20')](0xcc)[_0xf3d2('0x21')]();});}};}function handleEntityNotFound(_0x2196fb,_0x6cd11a){return function(_0x396eb9){if(!_0x396eb9){_0x2196fb['sendStatus'](0x194);}return _0x396eb9;};}function handleError(_0xbcd8db,_0xd20ad3){_0xd20ad3=_0xd20ad3||0x1f4;return function(_0x4a261c){logger['error'](_0x4a261c[_0xf3d2('0x2d')]);if(_0x4a261c[_0xf3d2('0x2e')]){delete _0x4a261c[_0xf3d2('0x2e')];}_0xbcd8db['status'](_0xd20ad3)['send'](_0x4a261c);};}exports[_0xf3d2('0x2f')]=function(_0x1369d4,_0x1eb713){var _0x2050b7={},_0x38d8ee={},_0x44616b={'count':0x0,'rows':[]};var _0x4d6263=_[_0xf3d2('0x30')](db[_0xf3d2('0x31')]['rawAttributes'],function(_0x371b8c){return{'name':_0x371b8c[_0xf3d2('0x32')],'type':_0x371b8c[_0xf3d2('0x33')][_0xf3d2('0x34')]};});_0x38d8ee[_0xf3d2('0x35')]=_[_0xf3d2('0x30')](_0x4d6263,'name');_0x38d8ee[_0xf3d2('0x36')]=_[_0xf3d2('0x37')](_0x1369d4[_0xf3d2('0x36')]);_0x38d8ee[_0xf3d2('0x38')]=_['intersection'](_0x38d8ee['model'],_0x38d8ee[_0xf3d2('0x36')]);_0x2050b7['attributes']=_[_0xf3d2('0x39')](_0x38d8ee['model'],qs[_0xf3d2('0x3a')](_0x1369d4[_0xf3d2('0x36')][_0xf3d2('0x3a')]));_0x2050b7[_0xf3d2('0x3b')]=_0x2050b7[_0xf3d2('0x3b')][_0xf3d2('0x3c')]?_0x2050b7[_0xf3d2('0x3b')]:_0x38d8ee['model'];if(!_0x1369d4[_0xf3d2('0x36')][_0xf3d2('0x3d')](_0xf3d2('0x3e'))){_0x2050b7['limit']=qs[_0xf3d2('0x3f')](_0x1369d4[_0xf3d2('0x36')][_0xf3d2('0x3f')]);_0x2050b7[_0xf3d2('0x24')]=qs['offset'](_0x1369d4[_0xf3d2('0x36')][_0xf3d2('0x24')]);}_0x2050b7['order']=qs[_0xf3d2('0x40')](_0x1369d4[_0xf3d2('0x36')]['sort']);_0x2050b7['where']=qs[_0xf3d2('0x38')](_[_0xf3d2('0x41')](_0x1369d4[_0xf3d2('0x36')],_0x38d8ee[_0xf3d2('0x38')]),_0x4d6263);if(_0x1369d4[_0xf3d2('0x36')]['filter']){_0x2050b7[_0xf3d2('0x42')]=_[_0xf3d2('0x43')](_0x2050b7[_0xf3d2('0x42')],{'$or':_[_0xf3d2('0x30')](_0x4d6263,function(_0x56cb59){if(_0x56cb59[_0xf3d2('0x33')]!==_0xf3d2('0x44')){var _0x2a52b7={};_0x2a52b7[_0x56cb59[_0xf3d2('0x2e')]]={'$like':'%'+_0x1369d4['query']['filter']+'%'};return _0x2a52b7;}})});}_0x2050b7=_[_0xf3d2('0x43')]({},_0x2050b7,_0x1369d4[_0xf3d2('0x45')]);var _0x541137={'where':_0x2050b7[_0xf3d2('0x42')]};return db[_0xf3d2('0x31')][_0xf3d2('0x23')](_0x541137)[_0xf3d2('0x2a')](function(_0xd661bc){_0x44616b[_0xf3d2('0x23')]=_0xd661bc;if(_0x1369d4['query']['includeAll']){_0x2050b7[_0xf3d2('0x46')]=[{'all':!![]}];}return db[_0xf3d2('0x31')][_0xf3d2('0x47')](_0x2050b7);})['then'](function(_0x9b166f){_0x44616b[_0xf3d2('0x48')]=_0x9b166f;return _0x44616b;})[_0xf3d2('0x2a')](respondWithFilteredResult(_0x1eb713,_0x2050b7))['catch'](handleError(_0x1eb713,null));};exports[_0xf3d2('0x49')]=function(_0x439b28,_0x3fbbf3){var _0x417173={'raw':!![],'where':{'id':_0x439b28['params']['id']}},_0x1dc2f1={};_0x1dc2f1['model']=_['keys'](db['OpenchannelQueue'][_0xf3d2('0x4a')]);_0x1dc2f1[_0xf3d2('0x36')]=_['keys'](_0x439b28[_0xf3d2('0x36')]);_0x1dc2f1[_0xf3d2('0x38')]=_[_0xf3d2('0x39')](_0x1dc2f1[_0xf3d2('0x35')],_0x1dc2f1[_0xf3d2('0x36')]);_0x417173[_0xf3d2('0x3b')]=_[_0xf3d2('0x39')](_0x1dc2f1[_0xf3d2('0x35')],qs[_0xf3d2('0x3a')](_0x439b28[_0xf3d2('0x36')][_0xf3d2('0x3a')]));_0x417173[_0xf3d2('0x3b')]=_0x417173[_0xf3d2('0x3b')]['length']?_0x417173[_0xf3d2('0x3b')]:_0x1dc2f1['model'];if(_0x439b28['query'][_0xf3d2('0x4b')]){_0x417173['include']=[{'all':!![]}];}_0x417173=_['merge']({},_0x417173,_0x439b28['options']);return db[_0xf3d2('0x31')][_0xf3d2('0x4c')](_0x417173)[_0xf3d2('0x2a')](handleEntityNotFound(_0x3fbbf3,null))[_0xf3d2('0x2a')](respondWithResult(_0x3fbbf3,null))[_0xf3d2('0x4d')](handleError(_0x3fbbf3,null));};exports[_0xf3d2('0x4e')]=function(_0xd89002,_0x2da0c3){return db[_0xf3d2('0x31')][_0xf3d2('0x4e')](_0xd89002[_0xf3d2('0x4f')],{})['then'](function(_0x53d0e6){var _0xa823bd=_0xd89002[_0xf3d2('0x50')][_0xf3d2('0x2c')]({'plain':!![]});if(!_0xa823bd)throw new Error(_0xf3d2('0x51'));if(_0xa823bd[_0xf3d2('0x52')]===_0xf3d2('0x50')){var _0x527eed=_0x53d0e6[_0xf3d2('0x2c')]({'plain':!![]});var _0x48986b='OpenchannelQueues';return db[_0xf3d2('0x53')][_0xf3d2('0x4c')]({'where':{'name':_0x48986b,'userProfileId':_0xa823bd[_0xf3d2('0x54')]},'raw':!![]})[_0xf3d2('0x2a')](function(_0x3ddbe8){if(_0x3ddbe8&&_0x3ddbe8[_0xf3d2('0x55')]===0x0){return db[_0xf3d2('0x56')]['create']({'name':_0x527eed['name'],'resourceId':_0x527eed['id'],'type':_0x3ddbe8[_0xf3d2('0x2e')],'sectionId':_0x3ddbe8['id']},{})[_0xf3d2('0x2a')](function(){return _0x53d0e6;});}else{return _0x53d0e6;}})['catch'](function(_0x33eace){logger[_0xf3d2('0x57')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x33eace);throw _0x33eace;});}return _0x53d0e6;})[_0xf3d2('0x2a')](respondWithResult(_0x2da0c3,0xc9))[_0xf3d2('0x4d')](handleError(_0x2da0c3,null));};exports[_0xf3d2('0x29')]=function(_0x5e4b12,_0x5899da){if(_0x5e4b12[_0xf3d2('0x4f')]['id']){delete _0x5e4b12['body']['id'];}return db[_0xf3d2('0x31')][_0xf3d2('0x4c')]({'where':{'id':_0x5e4b12[_0xf3d2('0x58')]['id']}})['then'](handleEntityNotFound(_0x5899da,null))[_0xf3d2('0x2a')](saveUpdates(_0x5e4b12[_0xf3d2('0x4f')],null))[_0xf3d2('0x2a')](respondWithResult(_0x5899da,null))[_0xf3d2('0x4d')](handleError(_0x5899da,null));};exports[_0xf3d2('0x2b')]=function(_0x322d76,_0x50ed74){return db[_0xf3d2('0x31')]['find']({'where':{'id':_0x322d76[_0xf3d2('0x58')]['id']}})['then'](handleEntityNotFound(_0x50ed74,null))['then'](removeEntity(_0x50ed74,null))[_0xf3d2('0x4d')](handleError(_0x50ed74,null));};exports[_0xf3d2('0x59')]=function(_0x148f8e,_0x51287c){return db['OpenchannelQueue'][_0xf3d2('0x59')]()[_0xf3d2('0x2a')](respondWithResult(_0x51287c,null))[_0xf3d2('0x4d')](handleError(_0x51287c,null));};exports[_0xf3d2('0x5a')]=function(_0x15dc19,_0x2a4b4b,_0x43464f){var _0x191ada={'raw':!![],'where':{}},_0x3ada4e={},_0xc8c115;return db[_0xf3d2('0x31')]['findOne']({'where':{'id':_0x15dc19['params']['id']}})['then'](handleEntityNotFound(_0x2a4b4b,null))['then'](function(_0x355d9d){if(_0x355d9d){_0xc8c115=_0x355d9d['get']({'plain':!![]});_0x3ada4e['model']=_['keys'](db[_0xf3d2('0x5b')][_0xf3d2('0x4a')]);_0x3ada4e[_0xf3d2('0x36')]=_[_0xf3d2('0x37')](_0x15dc19['query']);_0x3ada4e[_0xf3d2('0x38')]=_[_0xf3d2('0x39')](_0x3ada4e[_0xf3d2('0x35')],_0x3ada4e[_0xf3d2('0x36')]);_0x191ada[_0xf3d2('0x3b')]=_[_0xf3d2('0x39')](_0x3ada4e[_0xf3d2('0x35')],qs[_0xf3d2('0x3a')](_0x15dc19[_0xf3d2('0x36')]['fields']));_0x191ada[_0xf3d2('0x3b')]=_0x191ada['attributes']['length']?_0x191ada['attributes']:_0x3ada4e['model'];if(!_0x15dc19[_0xf3d2('0x36')][_0xf3d2('0x3d')](_0xf3d2('0x3e'))){_0x191ada[_0xf3d2('0x3f')]=qs['limit'](_0x15dc19[_0xf3d2('0x36')]['limit']);_0x191ada[_0xf3d2('0x24')]=qs['offset'](_0x15dc19['query']['offset']);}_0x191ada[_0xf3d2('0x5c')]=qs[_0xf3d2('0x40')](_0x15dc19[_0xf3d2('0x36')]['sort']);_0x191ada[_0xf3d2('0x42')]=qs[_0xf3d2('0x38')](_['pick'](_0x15dc19[_0xf3d2('0x36')],_0x3ada4e[_0xf3d2('0x38')]));_0x191ada[_0xf3d2('0x42')][_0xf3d2('0x5d')]=_0x355d9d['id'];if(_0x15dc19[_0xf3d2('0x36')][_0xf3d2('0x5e')]){_0x191ada[_0xf3d2('0x42')]=_[_0xf3d2('0x43')](_0x191ada[_0xf3d2('0x42')],{'$or':_['map'](_0x191ada['attributes'],function(_0x430b77){var _0x1a1423={};_0x1a1423[_0x430b77]={'$like':'%'+_0x15dc19[_0xf3d2('0x36')]['filter']+'%'};return _0x1a1423;})});}_0x191ada=_['merge']({},_0x191ada,_0x15dc19['options']);return db[_0xf3d2('0x5b')][_0xf3d2('0x47')](_0x191ada);}})[_0xf3d2('0x2a')](function(_0x380c9f){if(_0x380c9f){return db[_0xf3d2('0x5f')]['findAndCountAll']({'where':{'id':_[_0xf3d2('0x30')](_0x380c9f,_0xf3d2('0x60')),'role':_0xf3d2('0x61')},'attributes':['id','name',_0xf3d2('0x62'),_0xf3d2('0x63'),_0xf3d2('0x64')]});}})[_0xf3d2('0x2a')](function(_0x571c9c){if(_0x571c9c){return{'count':_0x571c9c['count'],'rows':_['map'](_0x571c9c[_0xf3d2('0x48')],function(_0x47bbb5){return{'membername':_0x47bbb5[_0xf3d2('0x2e')],'UserId':_0x47bbb5['id'],'queue_name':_0xc8c115[_0xf3d2('0x2e')],'OpenchannelQueueId':_0xc8c115['id'],'interface':util[_0xf3d2('0x65')]('%s/%s',_0xf3d2('0x66'),_0x47bbb5[_0xf3d2('0x2e')]),'penalty':0x0,'paused':_0x47bbb5['openchannelPause'],'createdAt':_0x47bbb5['createdAt'],'updatedAt':_0x47bbb5[_0xf3d2('0x63')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xf3d2('0x2a')](respondWithFilteredResult(_0x2a4b4b,_0x191ada))[_0xf3d2('0x4d')](handleError(_0x2a4b4b,null));};exports[_0xf3d2('0x67')]=function(_0x4f2670,_0x569b9f,_0x418973){var _0x4559f7={};var _0x264483={};var _0x463cdc;var _0xe2295d;return db[_0xf3d2('0x31')][_0xf3d2('0x68')]({'where':{'id':_0x4f2670[_0xf3d2('0x58')]['id']}})[_0xf3d2('0x2a')](handleEntityNotFound(_0x569b9f,null))[_0xf3d2('0x2a')](function(_0x278e90){if(_0x278e90){_0x463cdc=_0x278e90;_0x264483[_0xf3d2('0x35')]=_[_0xf3d2('0x37')](db[_0xf3d2('0x69')][_0xf3d2('0x4a')]);_0x264483[_0xf3d2('0x36')]=_[_0xf3d2('0x37')](_0x4f2670[_0xf3d2('0x36')]);_0x264483['filters']=_[_0xf3d2('0x39')](_0x264483[_0xf3d2('0x35')],_0x264483[_0xf3d2('0x36')]);_0x4559f7[_0xf3d2('0x3b')]=_[_0xf3d2('0x39')](_0x264483['model'],qs['fields'](_0x4f2670[_0xf3d2('0x36')][_0xf3d2('0x3a')]));_0x4559f7[_0xf3d2('0x3b')]=_0x4559f7[_0xf3d2('0x3b')][_0xf3d2('0x3c')]?_0x4559f7[_0xf3d2('0x3b')]:_0x264483[_0xf3d2('0x35')];_0x4559f7[_0xf3d2('0x5c')]=qs['sort'](_0x4f2670[_0xf3d2('0x36')][_0xf3d2('0x40')]);_0x4559f7[_0xf3d2('0x42')]=qs[_0xf3d2('0x38')](_[_0xf3d2('0x41')](_0x4f2670[_0xf3d2('0x36')],_0x264483[_0xf3d2('0x38')]));if(_0x4f2670[_0xf3d2('0x36')][_0xf3d2('0x5e')]){_0x4559f7['where']=_[_0xf3d2('0x43')](_0x4559f7[_0xf3d2('0x42')],{'$or':_[_0xf3d2('0x30')](_0x4559f7['attributes'],function(_0x1013aa){var _0x4b694c={};_0x4b694c[_0x1013aa]={'$like':'%'+_0x4f2670[_0xf3d2('0x36')]['filter']+'%'};return _0x4b694c;})});}_0x4559f7=_['merge']({},_0x4559f7,_0x4f2670['options']);return _0x463cdc[_0xf3d2('0x67')](_0x4559f7);}})[_0xf3d2('0x2a')](function(_0x598947){if(_0x598947){_0xe2295d=_0x598947[_0xf3d2('0x3c')];if(!_0x4f2670[_0xf3d2('0x36')]['hasOwnProperty'](_0xf3d2('0x3e'))){_0x4559f7['limit']=qs[_0xf3d2('0x3f')](_0x4f2670[_0xf3d2('0x36')]['limit']);_0x4559f7[_0xf3d2('0x24')]=qs[_0xf3d2('0x24')](_0x4f2670['query'][_0xf3d2('0x24')]);}return _0x463cdc[_0xf3d2('0x67')](_0x4559f7);}})['then'](function(_0xe944cb){if(_0xe944cb){return _0xe944cb?{'count':_0xe2295d,'rows':_0xe944cb}:null;}})[_0xf3d2('0x2a')](respondWithResult(_0x569b9f,null))[_0xf3d2('0x4d')](handleError(_0x569b9f,null));};exports[_0xf3d2('0x6a')]=function(_0x5bacf5,_0x27c0c0,_0x2ba9d6){var _0x439952=_0x5bacf5[_0xf3d2('0x4f')][_0xf3d2('0x6b')];return db[_0xf3d2('0x69')][_0xf3d2('0x47')]({'where':{'id':_0x439952},'attributes':['id'],'include':[{'model':db[_0xf3d2('0x5f')],'as':_0xf3d2('0x6c'),'attributes':['id',_0xf3d2('0x2e'),_0xf3d2('0x6d'),_0xf3d2('0x6e'),_0xf3d2('0x6f')],'raw':!![]}]})[_0xf3d2('0x2a')](function(_0x87a8a4){if(_0x87a8a4){var _0x193721=_['flatMap'](_0x87a8a4,function(_0x408c2c){var _0x8bf8f5=_0x408c2c['get']({'plain':!![]});return _0x8bf8f5[_0xf3d2('0x6c')];});return db[_0xf3d2('0x31')][_0xf3d2('0x4c')]({'where':{'id':_0x5bacf5[_0xf3d2('0x58')]['id']}})[_0xf3d2('0x2a')](function(_0x3a1a3c){return db['sequelize'][_0xf3d2('0x70')](function(_0x351822){return _0x3a1a3c['addTeams'](_0x439952,{'transaction':_0x351822})[_0xf3d2('0x2a')](function(){return BPromise[_0xf3d2('0x71')](_0x193721,function(_0x2608a1){return db['UserOpenchannelQueue'][_0xf3d2('0x72')]({'where':{'UserId':_0x2608a1['id'],'OpenchannelQueueId':_0x5bacf5['params']['id']},'transaction':_0x351822});});})[_0xf3d2('0x2a')](function(){_0x193721[_0xf3d2('0x73')](function(_0x1706ef){socket[_0xf3d2('0x74')]('userOpenchannelQueue:save',{'UserId':_0x1706ef['id'],'OpenchannelQueueId':_0x3a1a3c['id']});});});});});}})[_0xf3d2('0x2a')](respondWithStatusCode(_0x27c0c0,null))[_0xf3d2('0x4d')](handleError(_0x27c0c0,null));};exports['removeTeams']=function(_0x2503bf,_0x2da877,_0x1d521e){return db[_0xf3d2('0x69')][_0xf3d2('0x47')]({'where':{'id':_0x2503bf[_0xf3d2('0x36')][_0xf3d2('0x6b')]},'attributes':['id'],'include':[{'model':db[_0xf3d2('0x5f')],'as':_0xf3d2('0x6c'),'attributes':['id'],'raw':!![]}]})[_0xf3d2('0x2a')](handleEntityNotFound(_0x2da877,null))['then'](function(_0x3719ef){var _0x150c22=_[_0xf3d2('0x30')](_0x3719ef,'id');var _0x48ab0f=[];var _0x26da82=[];var _0x3fb038=squel[_0xf3d2('0x75')]();_0x3fb038[_0xf3d2('0x76')]('tq.TeamId')[_0xf3d2('0x77')](_0xf3d2('0x78'),'tq')[_0xf3d2('0x79')](_0xf3d2('0x7a'),'ut',_0xf3d2('0x7b'))[_0xf3d2('0x42')](_0xf3d2('0x7c'),_0x2503bf['params']['id']);for(var _0x1d09af=0x0;_0x1d09af<_0x3719ef[_0xf3d2('0x3c')];_0x1d09af+=0x1){let _0x1f05b1=_0x3719ef[_0x1d09af];for(var _0x190516=0x0;_0x190516<_0x1f05b1[_0xf3d2('0x6c')]['length'];_0x190516+=0x1){let _0x1922e8=_0x1f05b1['Agents'][_0x190516];var _0x39efe6=_0x3fb038[_0xf3d2('0x7d')]();_0x39efe6[_0xf3d2('0x42')](_0xf3d2('0x7e'),_0x1922e8['id']);_0x26da82[_0xf3d2('0x7f')](db[_0xf3d2('0x80')][_0xf3d2('0x36')](_0x39efe6[_0xf3d2('0x81')](),{'type':db[_0xf3d2('0x80')]['QueryTypes']['SELECT']})[_0xf3d2('0x2a')](function(_0x2d002e){if(_0x2d002e[_0xf3d2('0x3c')]===0x1){return _0x1922e8['id'];}else{var _0x4d03c3=_[_0xf3d2('0x82')](_[_0xf3d2('0x30')](_0x2d002e,_0xf3d2('0x83')),function(_0xbde95){return _['includes'](_0x150c22,_0xbde95);});if(_0x4d03c3){return _0x1922e8['id'];}}}));}}return BPromise[_0xf3d2('0x84')](_0x26da82)[_0xf3d2('0x2a')](function(_0x2e0b4a){_0x48ab0f=_(_0x48ab0f)[_0xf3d2('0x85')](_0x2e0b4a)['compact']()[_0xf3d2('0x86')]();return db['OpenchannelQueue'][_0xf3d2('0x4c')]({'where':{'id':_0x2503bf[_0xf3d2('0x58')]['id']}})[_0xf3d2('0x2a')](function(_0x1733bb){return db[_0xf3d2('0x80')][_0xf3d2('0x70')](function(_0x31e23d){return _0x1733bb[_0xf3d2('0x87')](_0x2503bf[_0xf3d2('0x36')][_0xf3d2('0x6b')],{'transaction':_0x31e23d})['then'](function(){if(!_[_0xf3d2('0x88')](_0x48ab0f)){return _0x1733bb[_0xf3d2('0x89')](_0x48ab0f,{'transaction':_0x31e23d});}})[_0xf3d2('0x2a')](function(){_0x48ab0f[_0xf3d2('0x73')](function(_0x25f89c){socket[_0xf3d2('0x74')]('userOpenchannelQueue:remove',{'UserId':_0x25f89c,'OpenchannelQueueId':_0x1733bb['id']});});});});});});})[_0xf3d2('0x2a')](respondWithStatusCode(_0x2da877,null))['catch'](handleError(_0x2da877,null));};exports[_0xf3d2('0x8a')]=function(_0x1de0a3,_0x2fbaef,_0x109aa5){return db[_0xf3d2('0x31')][_0xf3d2('0x4c')]({'where':{'id':_0x1de0a3[_0xf3d2('0x58')]['id']}})['then'](handleEntityNotFound(_0x2fbaef,null))['then'](function(_0x523131){if(_0x523131){return _0x523131[_0xf3d2('0x8a')](_0x1de0a3[_0xf3d2('0x4f')][_0xf3d2('0x6b')],_[_0xf3d2('0x8b')](_0x1de0a3[_0xf3d2('0x4f')],[_0xf3d2('0x6b'),'id'])||{})['spread'](function(_0x43600d){for(var _0x3ddaaf=0x0;_0x3ddaaf<_0x1de0a3[_0xf3d2('0x4f')][_0xf3d2('0x6b')][_0xf3d2('0x3c')];_0x3ddaaf+=0x1){socket[_0xf3d2('0x74')]('userOpenchannelQueue:save',{'UserId':_0x1de0a3['body'][_0xf3d2('0x6b')][_0x3ddaaf],'OpenchannelQueueId':_0x1de0a3[_0xf3d2('0x58')]['id']});}return _0x43600d;});}})['then'](respondWithResult(_0x2fbaef,null))[_0xf3d2('0x4d')](handleError(_0x2fbaef,null));};exports[_0xf3d2('0x89')]=function(_0x48bdcb,_0x992414,_0x32fb9d){return db['OpenchannelQueue'][_0xf3d2('0x4c')]({'where':{'id':_0x48bdcb[_0xf3d2('0x58')]['id']}})['then'](handleEntityNotFound(_0x992414,null))['then'](function(_0x548ecd){if(_0x548ecd){return _0x548ecd['removeAgents'](_0x48bdcb[_0xf3d2('0x36')][_0xf3d2('0x6b')])[_0xf3d2('0x2a')](function(){if(_[_0xf3d2('0x8c')](_0x48bdcb[_0xf3d2('0x36')][_0xf3d2('0x6b')])){for(var _0x58a752=0x0;_0x58a752<_0x48bdcb[_0xf3d2('0x36')]['ids'][_0xf3d2('0x3c')];_0x58a752+=0x1){socket[_0xf3d2('0x74')](_0xf3d2('0x8d'),{'UserId':Number(_0x48bdcb[_0xf3d2('0x36')][_0xf3d2('0x6b')][_0x58a752]),'OpenchannelQueueId':Number(_0x48bdcb[_0xf3d2('0x58')]['id'])});}}else{socket[_0xf3d2('0x74')](_0xf3d2('0x8d'),{'UserId':Number(_0x48bdcb['query'][_0xf3d2('0x6b')]),'OpenchannelQueueId':Number(_0x48bdcb[_0xf3d2('0x58')]['id'])});}});}})[_0xf3d2('0x2a')](respondWithStatusCode(_0x992414,null))[_0xf3d2('0x4d')](handleError(_0x992414,null));};exports[_0xf3d2('0x8e')]=function(_0x33153f,_0x4f350c,_0x3f36e3){var _0x439839={};var _0x5b730b={};var _0x1eb00d;var _0x4b98d8;return db['OpenchannelQueue'][_0xf3d2('0x68')]({'where':{'id':_0x33153f[_0xf3d2('0x58')]['id']}})[_0xf3d2('0x2a')](handleEntityNotFound(_0x4f350c,null))[_0xf3d2('0x2a')](function(_0x548902){if(_0x548902){_0x1eb00d=_0x548902;_0x5b730b[_0xf3d2('0x35')]=_['keys'](db[_0xf3d2('0x5f')]['rawAttributes']);_0x5b730b[_0xf3d2('0x36')]=_['keys'](_0x33153f['query']);_0x5b730b[_0xf3d2('0x38')]=_[_0xf3d2('0x39')](_0x5b730b[_0xf3d2('0x35')],_0x5b730b[_0xf3d2('0x36')]);_0x439839[_0xf3d2('0x3b')]=_[_0xf3d2('0x39')](_0x5b730b[_0xf3d2('0x35')],qs[_0xf3d2('0x3a')](_0x33153f['query'][_0xf3d2('0x3a')]));_0x439839['attributes']=_0x439839[_0xf3d2('0x3b')]['length']?_0x439839[_0xf3d2('0x3b')]:_0x5b730b[_0xf3d2('0x35')];_0x439839[_0xf3d2('0x5c')]=qs[_0xf3d2('0x40')](_0x33153f[_0xf3d2('0x36')][_0xf3d2('0x40')]);_0x439839['where']=qs['filters'](_[_0xf3d2('0x41')](_0x33153f[_0xf3d2('0x36')],_0x5b730b[_0xf3d2('0x38')]));if(_0x33153f[_0xf3d2('0x36')][_0xf3d2('0x5e')]){_0x439839[_0xf3d2('0x42')]=_[_0xf3d2('0x43')](_0x439839[_0xf3d2('0x42')],{'$or':_[_0xf3d2('0x30')](_0x439839['attributes'],function(_0x3b82b5){var _0x51b448={};_0x51b448[_0x3b82b5]={'$like':'%'+_0x33153f[_0xf3d2('0x36')]['filter']+'%'};return _0x51b448;})});}_0x439839=_['merge']({},_0x439839,_0x33153f[_0xf3d2('0x45')]);return _0x1eb00d[_0xf3d2('0x8e')](_0x439839);}})[_0xf3d2('0x2a')](function(_0x2e5960){if(_0x2e5960){_0x4b98d8=_0x2e5960[_0xf3d2('0x3c')];if(!_0x33153f[_0xf3d2('0x36')][_0xf3d2('0x3d')](_0xf3d2('0x3e'))){_0x439839[_0xf3d2('0x3f')]=qs[_0xf3d2('0x3f')](_0x33153f[_0xf3d2('0x36')]['limit']);_0x439839['offset']=qs[_0xf3d2('0x24')](_0x33153f[_0xf3d2('0x36')][_0xf3d2('0x24')]);}return _0x1eb00d[_0xf3d2('0x8e')](_0x439839);}})[_0xf3d2('0x2a')](function(_0x51e23a){if(_0x51e23a){return _0x51e23a?{'count':_0x4b98d8,'rows':_0x51e23a}:null;}})['then'](respondWithResult(_0x4f350c,null))['catch'](handleError(_0x4f350c,null));};
\ No newline at end of file
+var _0x3696=['removeTeams','Team','from','team_has_openchannel_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','OpenchannelQueueId\x20=\x20?','clone','toString','QueryTypes','SELECT','every','includes','all','union','compact','value','isEmpty','addAgents','omit','spread','removeAgents','isArray','userOpenchannelQueue:remove','findOne','nolimit','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','jsforce','desk.js','to-csv','papaparse','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','defaults','redis','localhost','./openchannelQueue.socket','register','sendStatus','status','end','json','count','offset','limit','apply','update','then','destroy','get','OpenchannelQueues','UserProfileResource','stack','name','send','map','OpenchannelQueue','rawAttributes','fieldName','key','model','keys','intersection','query','attributes','fields','length','hasOwnProperty','sort','where','filters','pick','type','VIRTUAL','filter','merge','includeAll','include','rows','catch','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','getMembers','UserOpenchannelQueue','order','OpenchannelQueueId','User','findAndCountAll','UserId','createdAt','%s/%s','SIP','openchannelPause','updatedAt','getTeams','addTeams','ids','findAll','Agents','online','voicePause','interface','flatMap','sequelize','transaction','findOrCreate','forEach','emit','userOpenchannelQueue:save'];(function(_0x3a5e83,_0x598916){var _0x3a3297=function(_0x558bb1){while(--_0x558bb1){_0x3a5e83['push'](_0x3a5e83['shift']());}};_0x3a3297(++_0x598916);}(_0x3696,0x131));var _0x6369=function(_0xaa0309,_0x1c8008){_0xaa0309=_0xaa0309-0x0;var _0x5de7ce=_0x3696[_0xaa0309];return _0x5de7ce;};'use strict';var pdf=require(_0x6369('0x0'));var emlformat=require(_0x6369('0x1'));var rimraf=require(_0x6369('0x2'));var zipdir=require(_0x6369('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6369('0x4'));var moment=require(_0x6369('0x5'));var BPromise=require(_0x6369('0x6'));var Mustache=require(_0x6369('0x7'));var util=require(_0x6369('0x8'));var path=require(_0x6369('0x9'));var sox=require(_0x6369('0xa'));var csv=require('to-csv');var ejs=require(_0x6369('0xb'));var fs=require('fs');var _=require(_0x6369('0xc'));var squel=require(_0x6369('0xd'));var crypto=require('crypto');var jsforce=require(_0x6369('0xe'));var deskjs=require(_0x6369('0xf'));var toCsv=require(_0x6369('0x10'));var querystring=require('querystring');var Papa=require(_0x6369('0x11'));var Redis=require('ioredis');var authService=require(_0x6369('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6369('0x13'));var logger=require(_0x6369('0x14'))(_0x6369('0x15'));var utils=require(_0x6369('0x16'));var config=require(_0x6369('0x17'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x6369('0x18')](config[_0x6369('0x19')],{'host':_0x6369('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x6369('0x19')]));require(_0x6369('0x1b'))[_0x6369('0x1c')](socket);function respondWithStatusCode(_0x231277,_0x32a9ee){_0x32a9ee=_0x32a9ee||0xcc;return function(_0x7b1585){if(_0x7b1585){return _0x231277[_0x6369('0x1d')](_0x32a9ee);}return _0x231277[_0x6369('0x1e')](_0x32a9ee)[_0x6369('0x1f')]();};}function respondWithResult(_0x2ec3a8,_0xbe0cb3){_0xbe0cb3=_0xbe0cb3||0xc8;return function(_0x484d36){if(_0x484d36){return _0x2ec3a8['status'](_0xbe0cb3)[_0x6369('0x20')](_0x484d36);}};}function respondWithFilteredResult(_0xd3b724,_0x5dd49f){return function(_0x2ff5c6){if(_0x2ff5c6){var _0x1ed58f=_0x2ff5c6[_0x6369('0x21')],_0x32c84b=_0x5dd49f[_0x6369('0x22')],_0x8aa4c6=_0x5dd49f[_0x6369('0x22')]+_0x5dd49f[_0x6369('0x23')],_0x287612;if(_0x8aa4c6>=_0x1ed58f){_0x8aa4c6=_0x1ed58f;_0x287612=0xc8;}else{_0x287612=0xce;}_0xd3b724['status'](_0x287612);return _0xd3b724['set']('Content-Range',_0x32c84b+'-'+_0x8aa4c6+'/'+_0x1ed58f)[_0x6369('0x20')](_0x2ff5c6);}return null;};}function patchUpdates(_0xa5108){return function(_0x14e86a){try{jsonpatch[_0x6369('0x24')](_0x14e86a,_0xa5108,!![]);}catch(_0x3d536d){return BPromise['reject'](_0x3d536d);}return _0x14e86a['save']();};}function saveUpdates(_0x4b8240,_0x24c541){return function(_0xb1047f){if(_0xb1047f){return _0xb1047f[_0x6369('0x25')](_0x4b8240)[_0x6369('0x26')](function(_0x5cc1d1){return _0x5cc1d1;});}return null;};}function removeEntity(_0x11103b,_0x5f0c37){return function(_0x104c03){if(_0x104c03){return _0x104c03[_0x6369('0x27')]()['then'](function(){var _0xb85cf0=_0x104c03[_0x6369('0x28')]({'plain':!![]});var _0x540145=_0x6369('0x29');return db[_0x6369('0x2a')][_0x6369('0x27')]({'where':{'type':_0x540145,'resourceId':_0xb85cf0['id']}})[_0x6369('0x26')](function(){return _0x104c03;});})[_0x6369('0x26')](function(){_0x11103b[_0x6369('0x1e')](0xcc)[_0x6369('0x1f')]();});}};}function handleEntityNotFound(_0x7f7522,_0x38f187){return function(_0x444f74){if(!_0x444f74){_0x7f7522['sendStatus'](0x194);}return _0x444f74;};}function handleError(_0x1a75e2,_0x5e303f){_0x5e303f=_0x5e303f||0x1f4;return function(_0x22475a){logger['error'](_0x22475a[_0x6369('0x2b')]);if(_0x22475a['name']){delete _0x22475a[_0x6369('0x2c')];}_0x1a75e2[_0x6369('0x1e')](_0x5e303f)[_0x6369('0x2d')](_0x22475a);};}exports['index']=function(_0x377842,_0x1121b9){var _0x4bed37={},_0x5e0ca9={},_0x3cba7d={'count':0x0,'rows':[]};var _0x278af3=_[_0x6369('0x2e')](db[_0x6369('0x2f')][_0x6369('0x30')],function(_0xfb515e){return{'name':_0xfb515e[_0x6369('0x31')],'type':_0xfb515e['type'][_0x6369('0x32')]};});_0x5e0ca9[_0x6369('0x33')]=_[_0x6369('0x2e')](_0x278af3,'name');_0x5e0ca9['query']=_[_0x6369('0x34')](_0x377842['query']);_0x5e0ca9['filters']=_[_0x6369('0x35')](_0x5e0ca9['model'],_0x5e0ca9[_0x6369('0x36')]);_0x4bed37[_0x6369('0x37')]=_[_0x6369('0x35')](_0x5e0ca9['model'],qs['fields'](_0x377842[_0x6369('0x36')][_0x6369('0x38')]));_0x4bed37[_0x6369('0x37')]=_0x4bed37[_0x6369('0x37')][_0x6369('0x39')]?_0x4bed37['attributes']:_0x5e0ca9['model'];if(!_0x377842[_0x6369('0x36')][_0x6369('0x3a')]('nolimit')){_0x4bed37[_0x6369('0x23')]=qs[_0x6369('0x23')](_0x377842[_0x6369('0x36')][_0x6369('0x23')]);_0x4bed37[_0x6369('0x22')]=qs['offset'](_0x377842[_0x6369('0x36')]['offset']);}_0x4bed37['order']=qs['sort'](_0x377842[_0x6369('0x36')][_0x6369('0x3b')]);_0x4bed37[_0x6369('0x3c')]=qs[_0x6369('0x3d')](_[_0x6369('0x3e')](_0x377842[_0x6369('0x36')],_0x5e0ca9[_0x6369('0x3d')]),_0x278af3);if(_0x377842[_0x6369('0x36')]['filter']){_0x4bed37[_0x6369('0x3c')]=_['merge'](_0x4bed37[_0x6369('0x3c')],{'$or':_['map'](_0x278af3,function(_0xedd551){if(_0xedd551[_0x6369('0x3f')]!==_0x6369('0x40')){var _0x5c6421={};_0x5c6421[_0xedd551['name']]={'$like':'%'+_0x377842[_0x6369('0x36')][_0x6369('0x41')]+'%'};return _0x5c6421;}})});}_0x4bed37=_[_0x6369('0x42')]({},_0x4bed37,_0x377842['options']);var _0x98f777={'where':_0x4bed37[_0x6369('0x3c')]};return db[_0x6369('0x2f')][_0x6369('0x21')](_0x98f777)[_0x6369('0x26')](function(_0x52fd15){_0x3cba7d[_0x6369('0x21')]=_0x52fd15;if(_0x377842[_0x6369('0x36')][_0x6369('0x43')]){_0x4bed37[_0x6369('0x44')]=[{'all':!![]}];}return db[_0x6369('0x2f')]['findAll'](_0x4bed37);})[_0x6369('0x26')](function(_0x1a9b88){_0x3cba7d[_0x6369('0x45')]=_0x1a9b88;return _0x3cba7d;})['then'](respondWithFilteredResult(_0x1121b9,_0x4bed37))[_0x6369('0x46')](handleError(_0x1121b9,null));};exports['show']=function(_0x5339e5,_0x41ba8d){var _0x4fed6c={'raw':!![],'where':{'id':_0x5339e5['params']['id']}},_0x222d35={};_0x222d35[_0x6369('0x33')]=_[_0x6369('0x34')](db[_0x6369('0x2f')][_0x6369('0x30')]);_0x222d35[_0x6369('0x36')]=_['keys'](_0x5339e5['query']);_0x222d35[_0x6369('0x3d')]=_['intersection'](_0x222d35[_0x6369('0x33')],_0x222d35[_0x6369('0x36')]);_0x4fed6c[_0x6369('0x37')]=_[_0x6369('0x35')](_0x222d35[_0x6369('0x33')],qs[_0x6369('0x38')](_0x5339e5[_0x6369('0x36')]['fields']));_0x4fed6c[_0x6369('0x37')]=_0x4fed6c['attributes'][_0x6369('0x39')]?_0x4fed6c[_0x6369('0x37')]:_0x222d35[_0x6369('0x33')];if(_0x5339e5[_0x6369('0x36')][_0x6369('0x43')]){_0x4fed6c[_0x6369('0x44')]=[{'all':!![]}];}_0x4fed6c=_[_0x6369('0x42')]({},_0x4fed6c,_0x5339e5[_0x6369('0x47')]);return db[_0x6369('0x2f')][_0x6369('0x48')](_0x4fed6c)[_0x6369('0x26')](handleEntityNotFound(_0x41ba8d,null))[_0x6369('0x26')](respondWithResult(_0x41ba8d,null))['catch'](handleError(_0x41ba8d,null));};exports[_0x6369('0x49')]=function(_0x24cb45,_0x4e94fd){return db[_0x6369('0x2f')][_0x6369('0x49')](_0x24cb45[_0x6369('0x4a')],{})[_0x6369('0x26')](function(_0x175548){var _0x1539a8=_0x24cb45[_0x6369('0x4b')][_0x6369('0x28')]({'plain':!![]});if(!_0x1539a8)throw new Error(_0x6369('0x4c'));if(_0x1539a8[_0x6369('0x4d')]===_0x6369('0x4b')){var _0x122299=_0x175548[_0x6369('0x28')]({'plain':!![]});var _0x216040='OpenchannelQueues';return db[_0x6369('0x4e')][_0x6369('0x48')]({'where':{'name':_0x216040,'userProfileId':_0x1539a8[_0x6369('0x4f')]},'raw':!![]})[_0x6369('0x26')](function(_0x391169){if(_0x391169&&_0x391169[_0x6369('0x50')]===0x0){return db['UserProfileResource'][_0x6369('0x49')]({'name':_0x122299[_0x6369('0x2c')],'resourceId':_0x122299['id'],'type':_0x391169[_0x6369('0x2c')],'sectionId':_0x391169['id']},{})['then'](function(){return _0x175548;});}else{return _0x175548;}})[_0x6369('0x46')](function(_0x43531d){logger[_0x6369('0x51')](_0x6369('0x52'),_0x43531d);throw _0x43531d;});}return _0x175548;})[_0x6369('0x26')](respondWithResult(_0x4e94fd,0xc9))[_0x6369('0x46')](handleError(_0x4e94fd,null));};exports[_0x6369('0x25')]=function(_0x1145a6,_0x17eb74){if(_0x1145a6[_0x6369('0x4a')]['id']){delete _0x1145a6['body']['id'];}return db[_0x6369('0x2f')][_0x6369('0x48')]({'where':{'id':_0x1145a6[_0x6369('0x53')]['id']}})[_0x6369('0x26')](handleEntityNotFound(_0x17eb74,null))[_0x6369('0x26')](saveUpdates(_0x1145a6[_0x6369('0x4a')],null))['then'](respondWithResult(_0x17eb74,null))[_0x6369('0x46')](handleError(_0x17eb74,null));};exports[_0x6369('0x27')]=function(_0x4c9daa,_0x10bf43){return db[_0x6369('0x2f')][_0x6369('0x48')]({'where':{'id':_0x4c9daa[_0x6369('0x53')]['id']}})['then'](handleEntityNotFound(_0x10bf43,null))[_0x6369('0x26')](removeEntity(_0x10bf43,null))['catch'](handleError(_0x10bf43,null));};exports['describe']=function(_0x14037b,_0x3f32ab){return db['OpenchannelQueue'][_0x6369('0x54')]()['then'](respondWithResult(_0x3f32ab,null))[_0x6369('0x46')](handleError(_0x3f32ab,null));};exports[_0x6369('0x55')]=function(_0x5edc14,_0x36dfd0,_0x183673){var _0x3c9394={'raw':!![],'where':{}},_0xfb07bc={},_0xee4bcc;return db[_0x6369('0x2f')]['findOne']({'where':{'id':_0x5edc14['params']['id']}})[_0x6369('0x26')](handleEntityNotFound(_0x36dfd0,null))[_0x6369('0x26')](function(_0x5c0736){if(_0x5c0736){_0xee4bcc=_0x5c0736['get']({'plain':!![]});_0xfb07bc[_0x6369('0x33')]=_[_0x6369('0x34')](db[_0x6369('0x56')][_0x6369('0x30')]);_0xfb07bc[_0x6369('0x36')]=_[_0x6369('0x34')](_0x5edc14[_0x6369('0x36')]);_0xfb07bc['filters']=_['intersection'](_0xfb07bc[_0x6369('0x33')],_0xfb07bc[_0x6369('0x36')]);_0x3c9394['attributes']=_[_0x6369('0x35')](_0xfb07bc[_0x6369('0x33')],qs['fields'](_0x5edc14[_0x6369('0x36')][_0x6369('0x38')]));_0x3c9394[_0x6369('0x37')]=_0x3c9394[_0x6369('0x37')][_0x6369('0x39')]?_0x3c9394[_0x6369('0x37')]:_0xfb07bc['model'];if(!_0x5edc14['query'][_0x6369('0x3a')]('nolimit')){_0x3c9394[_0x6369('0x23')]=qs[_0x6369('0x23')](_0x5edc14['query'][_0x6369('0x23')]);_0x3c9394[_0x6369('0x22')]=qs[_0x6369('0x22')](_0x5edc14['query'][_0x6369('0x22')]);}_0x3c9394[_0x6369('0x57')]=qs[_0x6369('0x3b')](_0x5edc14[_0x6369('0x36')][_0x6369('0x3b')]);_0x3c9394[_0x6369('0x3c')]=qs['filters'](_['pick'](_0x5edc14['query'],_0xfb07bc[_0x6369('0x3d')]));_0x3c9394[_0x6369('0x3c')][_0x6369('0x58')]=_0x5c0736['id'];if(_0x5edc14[_0x6369('0x36')][_0x6369('0x41')]){_0x3c9394[_0x6369('0x3c')]=_[_0x6369('0x42')](_0x3c9394['where'],{'$or':_[_0x6369('0x2e')](_0x3c9394[_0x6369('0x37')],function(_0x1ecb4f){var _0x2ff3f9={};_0x2ff3f9[_0x1ecb4f]={'$like':'%'+_0x5edc14[_0x6369('0x36')][_0x6369('0x41')]+'%'};return _0x2ff3f9;})});}_0x3c9394=_[_0x6369('0x42')]({},_0x3c9394,_0x5edc14[_0x6369('0x47')]);return db[_0x6369('0x56')]['findAll'](_0x3c9394);}})[_0x6369('0x26')](function(_0x5e6377){if(_0x5e6377){return db[_0x6369('0x59')][_0x6369('0x5a')]({'where':{'id':_[_0x6369('0x2e')](_0x5e6377,_0x6369('0x5b')),'role':'agent'},'attributes':['id','name','openchannelPause','updatedAt',_0x6369('0x5c')]});}})['then'](function(_0x1fc9b7){if(_0x1fc9b7){return{'count':_0x1fc9b7['count'],'rows':_[_0x6369('0x2e')](_0x1fc9b7[_0x6369('0x45')],function(_0x120906){return{'membername':_0x120906[_0x6369('0x2c')],'UserId':_0x120906['id'],'queue_name':_0xee4bcc[_0x6369('0x2c')],'OpenchannelQueueId':_0xee4bcc['id'],'interface':util['format'](_0x6369('0x5d'),_0x6369('0x5e'),_0x120906[_0x6369('0x2c')]),'penalty':0x0,'paused':_0x120906[_0x6369('0x5f')],'createdAt':_0x120906['createdAt'],'updatedAt':_0x120906[_0x6369('0x60')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x6369('0x26')](respondWithFilteredResult(_0x36dfd0,_0x3c9394))[_0x6369('0x46')](handleError(_0x36dfd0,null));};exports[_0x6369('0x61')]=function(_0xfb80d8,_0x34a12e,_0x4a0f1e){var _0x26991b={};var _0x3d165e={};var _0x5687e3;var _0x401d43;return db[_0x6369('0x2f')]['findOne']({'where':{'id':_0xfb80d8[_0x6369('0x53')]['id']}})[_0x6369('0x26')](handleEntityNotFound(_0x34a12e,null))[_0x6369('0x26')](function(_0x1920a2){if(_0x1920a2){_0x5687e3=_0x1920a2;_0x3d165e[_0x6369('0x33')]=_['keys'](db['Team'][_0x6369('0x30')]);_0x3d165e['query']=_[_0x6369('0x34')](_0xfb80d8[_0x6369('0x36')]);_0x3d165e[_0x6369('0x3d')]=_[_0x6369('0x35')](_0x3d165e[_0x6369('0x33')],_0x3d165e['query']);_0x26991b[_0x6369('0x37')]=_['intersection'](_0x3d165e[_0x6369('0x33')],qs[_0x6369('0x38')](_0xfb80d8[_0x6369('0x36')][_0x6369('0x38')]));_0x26991b[_0x6369('0x37')]=_0x26991b['attributes'][_0x6369('0x39')]?_0x26991b[_0x6369('0x37')]:_0x3d165e[_0x6369('0x33')];_0x26991b[_0x6369('0x57')]=qs[_0x6369('0x3b')](_0xfb80d8[_0x6369('0x36')]['sort']);_0x26991b[_0x6369('0x3c')]=qs[_0x6369('0x3d')](_[_0x6369('0x3e')](_0xfb80d8['query'],_0x3d165e[_0x6369('0x3d')]));if(_0xfb80d8[_0x6369('0x36')]['filter']){_0x26991b['where']=_[_0x6369('0x42')](_0x26991b[_0x6369('0x3c')],{'$or':_[_0x6369('0x2e')](_0x26991b[_0x6369('0x37')],function(_0x2d2a42){var _0x24a10c={};_0x24a10c[_0x2d2a42]={'$like':'%'+_0xfb80d8['query'][_0x6369('0x41')]+'%'};return _0x24a10c;})});}_0x26991b=_['merge']({},_0x26991b,_0xfb80d8[_0x6369('0x47')]);return _0x5687e3[_0x6369('0x61')](_0x26991b);}})[_0x6369('0x26')](function(_0x380235){if(_0x380235){_0x401d43=_0x380235[_0x6369('0x39')];if(!_0xfb80d8[_0x6369('0x36')][_0x6369('0x3a')]('nolimit')){_0x26991b[_0x6369('0x23')]=qs['limit'](_0xfb80d8['query'][_0x6369('0x23')]);_0x26991b[_0x6369('0x22')]=qs[_0x6369('0x22')](_0xfb80d8[_0x6369('0x36')][_0x6369('0x22')]);}return _0x5687e3[_0x6369('0x61')](_0x26991b);}})[_0x6369('0x26')](function(_0x12f06e){if(_0x12f06e){return _0x12f06e?{'count':_0x401d43,'rows':_0x12f06e}:null;}})['then'](respondWithResult(_0x34a12e,null))[_0x6369('0x46')](handleError(_0x34a12e,null));};exports[_0x6369('0x62')]=function(_0x38b2d1,_0x72c996,_0x54a49b){var _0x29d66d=_0x38b2d1['body'][_0x6369('0x63')];return db['Team'][_0x6369('0x64')]({'where':{'id':_0x29d66d},'attributes':['id'],'include':[{'model':db[_0x6369('0x59')],'as':_0x6369('0x65'),'attributes':['id',_0x6369('0x2c'),_0x6369('0x66'),_0x6369('0x67'),_0x6369('0x68')],'raw':!![]}]})[_0x6369('0x26')](function(_0x14d3be){if(_0x14d3be){var _0x548987=_[_0x6369('0x69')](_0x14d3be,function(_0x320b63){var _0x2e1978=_0x320b63[_0x6369('0x28')]({'plain':!![]});return _0x2e1978[_0x6369('0x65')];});return db[_0x6369('0x2f')]['find']({'where':{'id':_0x38b2d1[_0x6369('0x53')]['id']}})[_0x6369('0x26')](function(_0x3b9984){return db[_0x6369('0x6a')][_0x6369('0x6b')](function(_0x53993a){return _0x3b9984[_0x6369('0x62')](_0x29d66d,{'transaction':_0x53993a})['then'](function(){return BPromise['each'](_0x548987,function(_0xdaceac){return db[_0x6369('0x56')][_0x6369('0x6c')]({'where':{'UserId':_0xdaceac['id'],'OpenchannelQueueId':_0x38b2d1[_0x6369('0x53')]['id']},'transaction':_0x53993a});});})[_0x6369('0x26')](function(){_0x548987[_0x6369('0x6d')](function(_0x37fd1c){socket[_0x6369('0x6e')](_0x6369('0x6f'),{'UserId':_0x37fd1c['id'],'OpenchannelQueueId':_0x3b9984['id']});});});});});}})['then'](respondWithStatusCode(_0x72c996,null))['catch'](handleError(_0x72c996,null));};exports[_0x6369('0x70')]=function(_0x503444,_0x34570e,_0x3fe17c){return db[_0x6369('0x71')][_0x6369('0x64')]({'where':{'id':_0x503444['query'][_0x6369('0x63')]},'attributes':['id'],'include':[{'model':db[_0x6369('0x59')],'as':_0x6369('0x65'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x34570e,null))[_0x6369('0x26')](function(_0x196181){var _0xe434ab=_[_0x6369('0x2e')](_0x196181,'id');var _0x37ce0c=[];var _0x4bd7b2=[];var _0x52fd4d=squel['select']();_0x52fd4d['field']('tq.TeamId')[_0x6369('0x72')](_0x6369('0x73'),'tq')[_0x6369('0x74')](_0x6369('0x75'),'ut',_0x6369('0x76'))[_0x6369('0x3c')](_0x6369('0x77'),_0x503444[_0x6369('0x53')]['id']);for(var _0x2bcbc8=0x0;_0x2bcbc8<_0x196181[_0x6369('0x39')];_0x2bcbc8+=0x1){let _0xf2b167=_0x196181[_0x2bcbc8];for(var _0x527c7a=0x0;_0x527c7a<_0xf2b167[_0x6369('0x65')][_0x6369('0x39')];_0x527c7a+=0x1){let _0x47daca=_0xf2b167[_0x6369('0x65')][_0x527c7a];var _0x44b417=_0x52fd4d[_0x6369('0x78')]();_0x44b417[_0x6369('0x3c')]('ut.UserId\x20=\x20?',_0x47daca['id']);_0x4bd7b2['push'](db[_0x6369('0x6a')][_0x6369('0x36')](_0x44b417[_0x6369('0x79')](),{'type':db[_0x6369('0x6a')][_0x6369('0x7a')][_0x6369('0x7b')]})['then'](function(_0x2aaf7a){if(_0x2aaf7a[_0x6369('0x39')]===0x1){return _0x47daca['id'];}else{var _0x36769c=_[_0x6369('0x7c')](_[_0x6369('0x2e')](_0x2aaf7a,'TeamId'),function(_0x268aa4){return _[_0x6369('0x7d')](_0xe434ab,_0x268aa4);});if(_0x36769c){return _0x47daca['id'];}}}));}}return BPromise[_0x6369('0x7e')](_0x4bd7b2)[_0x6369('0x26')](function(_0x3cc6d0){_0x37ce0c=_(_0x37ce0c)[_0x6369('0x7f')](_0x3cc6d0)[_0x6369('0x80')]()[_0x6369('0x81')]();return db[_0x6369('0x2f')][_0x6369('0x48')]({'where':{'id':_0x503444[_0x6369('0x53')]['id']}})[_0x6369('0x26')](function(_0x38fa4a){return db[_0x6369('0x6a')][_0x6369('0x6b')](function(_0x3d6fb2){return _0x38fa4a[_0x6369('0x70')](_0x503444['query']['ids'],{'transaction':_0x3d6fb2})['then'](function(){if(!_[_0x6369('0x82')](_0x37ce0c)){return _0x38fa4a['removeAgents'](_0x37ce0c,{'transaction':_0x3d6fb2});}})['then'](function(){_0x37ce0c[_0x6369('0x6d')](function(_0x5e815a){socket[_0x6369('0x6e')]('userOpenchannelQueue:remove',{'UserId':_0x5e815a,'OpenchannelQueueId':_0x38fa4a['id']});});});});});});})[_0x6369('0x26')](respondWithStatusCode(_0x34570e,null))[_0x6369('0x46')](handleError(_0x34570e,null));};exports[_0x6369('0x83')]=function(_0x1cb65b,_0xebf31e,_0x58858e){return db[_0x6369('0x2f')]['find']({'where':{'id':_0x1cb65b['params']['id']}})['then'](handleEntityNotFound(_0xebf31e,null))[_0x6369('0x26')](function(_0x331fad){if(_0x331fad){return _0x331fad[_0x6369('0x83')](_0x1cb65b['body'][_0x6369('0x63')],_[_0x6369('0x84')](_0x1cb65b[_0x6369('0x4a')],[_0x6369('0x63'),'id'])||{})[_0x6369('0x85')](function(_0x6623b3){for(var _0x48ce97=0x0;_0x48ce97<_0x1cb65b['body'][_0x6369('0x63')][_0x6369('0x39')];_0x48ce97+=0x1){socket[_0x6369('0x6e')]('userOpenchannelQueue:save',{'UserId':_0x1cb65b[_0x6369('0x4a')][_0x6369('0x63')][_0x48ce97],'OpenchannelQueueId':_0x1cb65b[_0x6369('0x53')]['id']});}return _0x6623b3;});}})[_0x6369('0x26')](respondWithResult(_0xebf31e,null))[_0x6369('0x46')](handleError(_0xebf31e,null));};exports[_0x6369('0x86')]=function(_0x21c76a,_0x3152fc,_0x48e9fc){return db[_0x6369('0x2f')][_0x6369('0x48')]({'where':{'id':_0x21c76a['params']['id']}})['then'](handleEntityNotFound(_0x3152fc,null))[_0x6369('0x26')](function(_0x3795fa){if(_0x3795fa){return _0x3795fa[_0x6369('0x86')](_0x21c76a['query'][_0x6369('0x63')])[_0x6369('0x26')](function(){if(_[_0x6369('0x87')](_0x21c76a['query']['ids'])){for(var _0x31a59c=0x0;_0x31a59c<_0x21c76a[_0x6369('0x36')][_0x6369('0x63')]['length'];_0x31a59c+=0x1){socket[_0x6369('0x6e')](_0x6369('0x88'),{'UserId':Number(_0x21c76a[_0x6369('0x36')]['ids'][_0x31a59c]),'OpenchannelQueueId':Number(_0x21c76a[_0x6369('0x53')]['id'])});}}else{socket[_0x6369('0x6e')](_0x6369('0x88'),{'UserId':Number(_0x21c76a[_0x6369('0x36')][_0x6369('0x63')]),'OpenchannelQueueId':Number(_0x21c76a[_0x6369('0x53')]['id'])});}});}})[_0x6369('0x26')](respondWithStatusCode(_0x3152fc,null))[_0x6369('0x46')](handleError(_0x3152fc,null));};exports['getAgents']=function(_0x3b582e,_0x7da51e,_0x387383){var _0x5f4912={};var _0x599cce={};var _0x4008bb;var _0x5a334e;return db[_0x6369('0x2f')][_0x6369('0x89')]({'where':{'id':_0x3b582e[_0x6369('0x53')]['id']}})[_0x6369('0x26')](handleEntityNotFound(_0x7da51e,null))[_0x6369('0x26')](function(_0x9ab53e){if(_0x9ab53e){_0x4008bb=_0x9ab53e;_0x599cce['model']=_[_0x6369('0x34')](db[_0x6369('0x59')][_0x6369('0x30')]);_0x599cce[_0x6369('0x36')]=_[_0x6369('0x34')](_0x3b582e[_0x6369('0x36')]);_0x599cce[_0x6369('0x3d')]=_[_0x6369('0x35')](_0x599cce['model'],_0x599cce[_0x6369('0x36')]);_0x5f4912[_0x6369('0x37')]=_['intersection'](_0x599cce[_0x6369('0x33')],qs[_0x6369('0x38')](_0x3b582e[_0x6369('0x36')][_0x6369('0x38')]));_0x5f4912['attributes']=_0x5f4912['attributes'][_0x6369('0x39')]?_0x5f4912[_0x6369('0x37')]:_0x599cce[_0x6369('0x33')];_0x5f4912[_0x6369('0x57')]=qs[_0x6369('0x3b')](_0x3b582e[_0x6369('0x36')][_0x6369('0x3b')]);_0x5f4912['where']=qs[_0x6369('0x3d')](_[_0x6369('0x3e')](_0x3b582e[_0x6369('0x36')],_0x599cce[_0x6369('0x3d')]));if(_0x3b582e[_0x6369('0x36')][_0x6369('0x41')]){_0x5f4912[_0x6369('0x3c')]=_[_0x6369('0x42')](_0x5f4912['where'],{'$or':_['map'](_0x5f4912['attributes'],function(_0x4cc0ab){var _0x50f8f9={};_0x50f8f9[_0x4cc0ab]={'$like':'%'+_0x3b582e[_0x6369('0x36')][_0x6369('0x41')]+'%'};return _0x50f8f9;})});}_0x5f4912=_[_0x6369('0x42')]({},_0x5f4912,_0x3b582e[_0x6369('0x47')]);return _0x4008bb['getAgents'](_0x5f4912);}})[_0x6369('0x26')](function(_0x32a05f){if(_0x32a05f){_0x5a334e=_0x32a05f[_0x6369('0x39')];if(!_0x3b582e[_0x6369('0x36')][_0x6369('0x3a')](_0x6369('0x8a'))){_0x5f4912[_0x6369('0x23')]=qs[_0x6369('0x23')](_0x3b582e[_0x6369('0x36')][_0x6369('0x23')]);_0x5f4912['offset']=qs[_0x6369('0x22')](_0x3b582e[_0x6369('0x36')][_0x6369('0x22')]);}return _0x4008bb['getAgents'](_0x5f4912);}})['then'](function(_0x2d25c1){if(_0x2d25c1){return _0x2d25c1?{'count':_0x5a334e,'rows':_0x2d25c1}:null;}})[_0x6369('0x26')](respondWithResult(_0x7da51e,null))[_0x6369('0x46')](handleError(_0x7da51e,null));};
\ No newline at end of file
diff --git a/server/api/openchannelQueue/openchannelQueue.events.js b/server/api/openchannelQueue/openchannelQueue.events.js
index f1dfa23..d97dbee 100644
--- a/server/api/openchannelQueue/openchannelQueue.events.js
+++ b/server/api/openchannelQueue/openchannelQueue.events.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xf5b0=['setMaxListeners','save','update','emit','hasOwnProperty','hook','exports','events','../../mysqldb','OpenchannelQueue'];(function(_0x137e37,_0x498cf0){var _0x2cda86=function(_0x3c6745){while(--_0x3c6745){_0x137e37['push'](_0x137e37['shift']());}};_0x2cda86(++_0x498cf0);}(_0xf5b0,0x1d3));var _0x0f5b=function(_0x56482c,_0x16118d){_0x56482c=_0x56482c-0x0;var _0x5aae7a=_0xf5b0[_0x56482c];return _0x5aae7a;};'use strict';var EventEmitter=require(_0x0f5b('0x0'));var OpenchannelQueue=require(_0x0f5b('0x1'))['db'][_0x0f5b('0x2')];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents[_0x0f5b('0x3')](0x0);var events={'afterCreate':_0x0f5b('0x4'),'afterUpdate':_0x0f5b('0x5'),'afterDestroy':'remove'};function emitEvent(_0x3bc954){return function(_0x311578,_0x15cd50,_0x4304ff){OpenchannelQueueEvents[_0x0f5b('0x6')](_0x3bc954+':'+_0x311578['id'],_0x311578);OpenchannelQueueEvents[_0x0f5b('0x6')](_0x3bc954,_0x311578);_0x4304ff(null);};}for(var e in events){if(events[_0x0f5b('0x7')](e)){var event=events[e];OpenchannelQueue[_0x0f5b('0x8')](e,emitEvent(event));}}module[_0x0f5b('0x9')]=OpenchannelQueueEvents;
\ No newline at end of file
+var _0x2e04=['remove','emit','hasOwnProperty','events','OpenchannelQueue','setMaxListeners','save','update'];(function(_0x228a4a,_0x23d65e){var _0x3d3937=function(_0x3e9511){while(--_0x3e9511){_0x228a4a['push'](_0x228a4a['shift']());}};_0x3d3937(++_0x23d65e);}(_0x2e04,0x153));var _0x42e0=function(_0x586c71,_0x1755f3){_0x586c71=_0x586c71-0x0;var _0x1eb813=_0x2e04[_0x586c71];return _0x1eb813;};'use strict';var EventEmitter=require(_0x42e0('0x0'));var OpenchannelQueue=require('../../mysqldb')['db'][_0x42e0('0x1')];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents[_0x42e0('0x2')](0x0);var events={'afterCreate':_0x42e0('0x3'),'afterUpdate':_0x42e0('0x4'),'afterDestroy':_0x42e0('0x5')};function emitEvent(_0x12f5fc){return function(_0x76f438,_0x1e2a74,_0xb54b9b){OpenchannelQueueEvents['emit'](_0x12f5fc+':'+_0x76f438['id'],_0x76f438);OpenchannelQueueEvents[_0x42e0('0x6')](_0x12f5fc,_0x76f438);_0xb54b9b(null);};}for(var e in events){if(events[_0x42e0('0x7')](e)){var event=events[e];OpenchannelQueue['hook'](e,emitEvent(event));}}module['exports']=OpenchannelQueueEvents;
\ No newline at end of file
diff --git a/server/api/openchannelQueue/openchannelQueue.model.js b/server/api/openchannelQueue/openchannelQueue.model.js
index 0fd6a87..325d2f6 100644
--- a/server/api/openchannelQueue/openchannelQueue.model.js
+++ b/server/api/openchannelQueue/openchannelQueue.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x8551=['OpenchannelQueue','openchannel_queues','lodash','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','./openchannelQueue.attributes','exports','define'];(function(_0x11a39d,_0xa329d8){var _0x2433a3=function(_0x5e477f){while(--_0x5e477f){_0x11a39d['push'](_0x11a39d['shift']());}};_0x2433a3(++_0xa329d8);}(_0x8551,0x19a));var _0x1855=function(_0x31b57a,_0x3dddf3){_0x31b57a=_0x31b57a-0x0;var _0x2df3dd=_0x8551[_0x31b57a];return _0x2df3dd;};'use strict';var _=require(_0x1855('0x0'));var util=require('util');var logger=require(_0x1855('0x1'))('api');var moment=require(_0x1855('0x2'));var BPromise=require(_0x1855('0x3'));var rp=require(_0x1855('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x1855('0x5'));var config=require(_0x1855('0x6'));var attributes=require(_0x1855('0x7'));module[_0x1855('0x8')]=function(_0x272a55,_0x4e9910){return _0x272a55[_0x1855('0x9')](_0x1855('0xa'),attributes,{'tableName':_0x1855('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x071c=['../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./openchannelQueue.attributes','exports','define','OpenchannelQueue','openchannel_queues','lodash','util'];(function(_0x2e6f27,_0x561af6){var _0x14e04f=function(_0x38f360){while(--_0x38f360){_0x2e6f27['push'](_0x2e6f27['shift']());}};_0x14e04f(++_0x561af6);}(_0x071c,0x6e));var _0xc071=function(_0x28a4bd,_0x5daa31){_0x28a4bd=_0x28a4bd-0x0;var _0x23ee9e=_0x071c[_0x28a4bd];return _0x23ee9e;};'use strict';var _=require(_0xc071('0x0'));var util=require(_0xc071('0x1'));var logger=require(_0xc071('0x2'))(_0xc071('0x3'));var moment=require(_0xc071('0x4'));var BPromise=require('bluebird');var rp=require(_0xc071('0x5'));var fs=require('fs');var path=require(_0xc071('0x6'));var rimraf=require(_0xc071('0x7'));var config=require(_0xc071('0x8'));var attributes=require(_0xc071('0x9'));module[_0xc071('0xa')]=function(_0x523f0f,_0x38b1b6){return _0x523f0f[_0xc071('0xb')](_0xc071('0xc'),attributes,{'tableName':_0xc071('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/openchannelQueue/openchannelQueue.rpc.js b/server/api/openchannelQueue/openchannelQueue.rpc.js
index 34cd14c..d8b2324 100644
--- a/server/api/openchannelQueue/openchannelQueue.rpc.js
+++ b/server/api/openchannelQueue/openchannelQueue.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x57bc=['randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./openchannelQueue.socket','register','request','OpenchannelQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','OpenchannelQueue,\x20%s,\x20%s','message','catch','GetOpenchannelQueue','OpenchannelQueue','findAll','options','raw','attributes','limit','include','map','model','then','info','debug','find','ShowOpenchannelQueue','lodash','util','bluebird'];(function(_0xf10840,_0xad3916){var _0x1fdf7e=function(_0x463be3){while(--_0x463be3){_0xf10840['push'](_0xf10840['shift']());}};_0x1fdf7e(++_0xad3916);}(_0x57bc,0x1e9));var _0xc57b=function(_0x466841,_0x139438){_0x466841=_0x466841-0x0;var _0x1beca2=_0x57bc[_0x466841];return _0x1beca2;};'use strict';var _=require(_0xc57b('0x0'));var util=require(_0xc57b('0x1'));var moment=require('moment');var BPromise=require(_0xc57b('0x2'));var rs=require(_0xc57b('0x3'));var fs=require('fs');var Redis=require(_0xc57b('0x4'));var db=require(_0xc57b('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xc57b('0x6'))(_0xc57b('0x7'));var config=require(_0xc57b('0x8'));var jayson=require(_0xc57b('0x9'));var client=jayson['client'][_0xc57b('0xa')]({'port':0x232a});config[_0xc57b('0xb')]=_[_0xc57b('0xc')](config[_0xc57b('0xb')],{'host':_0xc57b('0xd'),'port':0x18eb});var socket=require(_0xc57b('0xe'))(new Redis(config['redis']));require(_0xc57b('0xf'))[_0xc57b('0x10')](socket);function respondWithRpcPromise(_0x187a97,_0x774d3d,_0x4519d0){return new BPromise(function(_0x594bdb,_0x4d2161){return client[_0xc57b('0x11')](_0x187a97,_0x4519d0)['then'](function(_0x207faa){logger['info']('OpenchannelQueue,\x20%s,\x20%s',_0x774d3d,'request\x20sent');logger['debug'](_0xc57b('0x12'),_0x774d3d,_0xc57b('0x13'),JSON[_0xc57b('0x14')](_0x207faa));if(_0x207faa[_0xc57b('0x15')]){if(_0x207faa[_0xc57b('0x15')][_0xc57b('0x16')]===0x1f4){logger[_0xc57b('0x15')](_0xc57b('0x17'),_0x774d3d,_0x207faa[_0xc57b('0x15')][_0xc57b('0x18')]);return _0x4d2161(_0x207faa[_0xc57b('0x15')]['message']);}logger[_0xc57b('0x15')](_0xc57b('0x17'),_0x774d3d,_0x207faa[_0xc57b('0x15')][_0xc57b('0x18')]);return _0x594bdb(_0x207faa[_0xc57b('0x15')]['message']);}else{logger['info'](_0xc57b('0x17'),_0x774d3d,_0xc57b('0x13'));_0x594bdb(_0x207faa['result']['message']);}})[_0xc57b('0x19')](function(_0x488973){logger[_0xc57b('0x15')](_0xc57b('0x17'),_0x774d3d,_0x488973);_0x4d2161(_0x488973);});});}exports[_0xc57b('0x1a')]=function(_0x144e33){var _0x1c6459=this;return new Promise(function(_0x47b9d2,_0x119714){return db[_0xc57b('0x1b')][_0xc57b('0x1c')]({'raw':_0x144e33['options']?_0x144e33[_0xc57b('0x1d')][_0xc57b('0x1e')]===undefined?!![]:![]:!![],'where':_0x144e33[_0xc57b('0x1d')]?_0x144e33[_0xc57b('0x1d')]['where']||null:null,'attributes':_0x144e33['options']?_0x144e33[_0xc57b('0x1d')][_0xc57b('0x1f')]||null:null,'limit':_0x144e33[_0xc57b('0x1d')]?_0x144e33[_0xc57b('0x1d')][_0xc57b('0x20')]||null:null,'include':_0x144e33[_0xc57b('0x1d')]?_0x144e33['options'][_0xc57b('0x21')]?_[_0xc57b('0x22')](_0x144e33[_0xc57b('0x1d')][_0xc57b('0x21')],function(_0x147fd6){return{'model':db[_0x147fd6[_0xc57b('0x23')]],'as':_0x147fd6['as'],'attributes':_0x147fd6['attributes'],'include':_0x147fd6[_0xc57b('0x21')]?_[_0xc57b('0x22')](_0x147fd6['include'],function(_0x173b81){return{'model':db[_0x173b81[_0xc57b('0x23')]],'as':_0x173b81['as'],'attributes':_0x173b81[_0xc57b('0x1f')],'include':_0x173b81[_0xc57b('0x21')]?_['map'](_0x173b81[_0xc57b('0x21')],function(_0x3cae80){return{'model':db[_0x3cae80['model']],'as':_0x3cae80['as'],'attributes':_0x3cae80[_0xc57b('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xc57b('0x24')](function(_0x561b24){logger[_0xc57b('0x25')]('GetOpenchannelQueue',_0x144e33);logger[_0xc57b('0x26')](_0xc57b('0x1a'),_0x144e33,JSON[_0xc57b('0x14')](_0x561b24));_0x47b9d2(_0x561b24);})[_0xc57b('0x19')](function(_0xf737fd){logger['error'](_0xc57b('0x1a'),_0xf737fd['message'],_0x144e33);_0x119714(_0x1c6459[_0xc57b('0x15')](0x1f4,_0xf737fd['message']));});});};exports['ShowOpenchannelQueue']=function(_0x80997b){var _0x219eb7=this;return new Promise(function(_0x3286f9,_0x2c2d91){return db[_0xc57b('0x1b')][_0xc57b('0x27')]({'raw':_0x80997b[_0xc57b('0x1d')]?_0x80997b['options'][_0xc57b('0x1e')]===undefined?!![]:![]:!![],'where':_0x80997b[_0xc57b('0x1d')]?_0x80997b[_0xc57b('0x1d')]['where']||null:null,'attributes':_0x80997b[_0xc57b('0x1d')]?_0x80997b['options'][_0xc57b('0x1f')]||null:null,'include':_0x80997b[_0xc57b('0x1d')]?_0x80997b[_0xc57b('0x1d')][_0xc57b('0x21')]?_[_0xc57b('0x22')](_0x80997b['options']['include'],function(_0x13eda8){return{'model':db[_0x13eda8['model']],'as':_0x13eda8['as'],'attributes':_0x13eda8[_0xc57b('0x1f')],'include':_0x13eda8[_0xc57b('0x21')]?_[_0xc57b('0x22')](_0x13eda8['include'],function(_0x44d739){return{'model':db[_0x44d739['model']],'as':_0x44d739['as'],'attributes':_0x44d739['attributes'],'include':_0x44d739[_0xc57b('0x21')]?_[_0xc57b('0x22')](_0x44d739[_0xc57b('0x21')],function(_0x1652f3){return{'model':db[_0x1652f3[_0xc57b('0x23')]],'as':_0x1652f3['as'],'attributes':_0x1652f3['attributes']};}):[]};}):[]};}):[]:[]})[_0xc57b('0x24')](function(_0x33d49c){logger['info'](_0xc57b('0x28'),_0x80997b);logger[_0xc57b('0x26')](_0xc57b('0x28'),_0x80997b,JSON['stringify'](_0x33d49c));_0x3286f9(_0x33d49c);})[_0xc57b('0x19')](function(_0x1471b2){logger['error'](_0xc57b('0x28'),_0x1471b2[_0xc57b('0x18')],_0x80997b);_0x2c2d91(_0x219eb7[_0xc57b('0x15')](0x1f4,_0x1471b2[_0xc57b('0x18')]));});});};
\ No newline at end of file
+var _0x70fc=['defaults','localhost','./openchannelQueue.socket','request','then','OpenchannelQueue,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','GetOpenchannelQueue','OpenchannelQueue','findAll','options','where','limit','map','include','model','attributes','debug','ShowOpenchannelQueue','find','raw','info','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','redis'];(function(_0x5ba74f,_0x200bf4){var _0x534d79=function(_0x50521a){while(--_0x50521a){_0x5ba74f['push'](_0x5ba74f['shift']());}};_0x534d79(++_0x200bf4);}(_0x70fc,0xb8));var _0xc70f=function(_0x2ccb54,_0x53a320){_0x2ccb54=_0x2ccb54-0x0;var _0x5df7fb=_0x70fc[_0x2ccb54];return _0x5df7fb;};'use strict';var _=require(_0xc70f('0x0'));var util=require(_0xc70f('0x1'));var moment=require('moment');var BPromise=require(_0xc70f('0x2'));var rs=require(_0xc70f('0x3'));var fs=require('fs');var Redis=require(_0xc70f('0x4'));var db=require(_0xc70f('0x5'))['db'];var utils=require(_0xc70f('0x6'));var logger=require(_0xc70f('0x7'))('rpc');var config=require(_0xc70f('0x8'));var jayson=require(_0xc70f('0x9'));var client=jayson['client']['http']({'port':0x232a});config[_0xc70f('0xa')]=_[_0xc70f('0xb')](config[_0xc70f('0xa')],{'host':_0xc70f('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xc70f('0xd'))['register'](socket);function respondWithRpcPromise(_0x5d95dc,_0x53d74a,_0xda80ea){return new BPromise(function(_0x55f8e2,_0x454961){return client[_0xc70f('0xe')](_0x5d95dc,_0xda80ea)[_0xc70f('0xf')](function(_0x367c64){logger['info'](_0xc70f('0x10'),_0x53d74a,_0xc70f('0x11'));logger['debug']('OpenchannelQueue,\x20%s,\x20%s,\x20%s',_0x53d74a,'request\x20sent',JSON[_0xc70f('0x12')](_0x367c64));if(_0x367c64[_0xc70f('0x13')]){if(_0x367c64[_0xc70f('0x13')][_0xc70f('0x14')]===0x1f4){logger[_0xc70f('0x13')]('OpenchannelQueue,\x20%s,\x20%s',_0x53d74a,_0x367c64[_0xc70f('0x13')][_0xc70f('0x15')]);return _0x454961(_0x367c64[_0xc70f('0x13')][_0xc70f('0x15')]);}logger[_0xc70f('0x13')](_0xc70f('0x10'),_0x53d74a,_0x367c64[_0xc70f('0x13')][_0xc70f('0x15')]);return _0x55f8e2(_0x367c64[_0xc70f('0x13')]['message']);}else{logger['info']('OpenchannelQueue,\x20%s,\x20%s',_0x53d74a,_0xc70f('0x11'));_0x55f8e2(_0x367c64[_0xc70f('0x16')][_0xc70f('0x15')]);}})[_0xc70f('0x17')](function(_0x500b2d){logger[_0xc70f('0x13')]('OpenchannelQueue,\x20%s,\x20%s',_0x53d74a,_0x500b2d);_0x454961(_0x500b2d);});});}exports[_0xc70f('0x18')]=function(_0x1ae225){var _0x48a8ce=this;return new Promise(function(_0x14d5d7,_0x58339a){return db[_0xc70f('0x19')][_0xc70f('0x1a')]({'raw':_0x1ae225['options']?_0x1ae225[_0xc70f('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x1ae225[_0xc70f('0x1b')]?_0x1ae225['options'][_0xc70f('0x1c')]||null:null,'attributes':_0x1ae225['options']?_0x1ae225[_0xc70f('0x1b')]['attributes']||null:null,'limit':_0x1ae225['options']?_0x1ae225[_0xc70f('0x1b')][_0xc70f('0x1d')]||null:null,'include':_0x1ae225[_0xc70f('0x1b')]?_0x1ae225[_0xc70f('0x1b')]['include']?_[_0xc70f('0x1e')](_0x1ae225[_0xc70f('0x1b')][_0xc70f('0x1f')],function(_0x4ef638){return{'model':db[_0x4ef638[_0xc70f('0x20')]],'as':_0x4ef638['as'],'attributes':_0x4ef638[_0xc70f('0x21')],'include':_0x4ef638['include']?_[_0xc70f('0x1e')](_0x4ef638[_0xc70f('0x1f')],function(_0x8f0c36){return{'model':db[_0x8f0c36[_0xc70f('0x20')]],'as':_0x8f0c36['as'],'attributes':_0x8f0c36[_0xc70f('0x21')],'include':_0x8f0c36['include']?_[_0xc70f('0x1e')](_0x8f0c36[_0xc70f('0x1f')],function(_0x167d58){return{'model':db[_0x167d58[_0xc70f('0x20')]],'as':_0x167d58['as'],'attributes':_0x167d58[_0xc70f('0x21')]};}):[]};}):[]};}):[]:[]})[_0xc70f('0xf')](function(_0x139f3a){logger['info'](_0xc70f('0x18'),_0x1ae225);logger[_0xc70f('0x22')](_0xc70f('0x18'),_0x1ae225,JSON[_0xc70f('0x12')](_0x139f3a));_0x14d5d7(_0x139f3a);})[_0xc70f('0x17')](function(_0x161fa3){logger['error'](_0xc70f('0x18'),_0x161fa3[_0xc70f('0x15')],_0x1ae225);_0x58339a(_0x48a8ce[_0xc70f('0x13')](0x1f4,_0x161fa3[_0xc70f('0x15')]));});});};exports[_0xc70f('0x23')]=function(_0x4de977){var _0x578ef1=this;return new Promise(function(_0x2e6e50,_0x335472){return db['OpenchannelQueue'][_0xc70f('0x24')]({'raw':_0x4de977['options']?_0x4de977[_0xc70f('0x1b')][_0xc70f('0x25')]===undefined?!![]:![]:!![],'where':_0x4de977[_0xc70f('0x1b')]?_0x4de977['options'][_0xc70f('0x1c')]||null:null,'attributes':_0x4de977[_0xc70f('0x1b')]?_0x4de977['options']['attributes']||null:null,'include':_0x4de977[_0xc70f('0x1b')]?_0x4de977[_0xc70f('0x1b')][_0xc70f('0x1f')]?_[_0xc70f('0x1e')](_0x4de977[_0xc70f('0x1b')]['include'],function(_0x202618){return{'model':db[_0x202618[_0xc70f('0x20')]],'as':_0x202618['as'],'attributes':_0x202618[_0xc70f('0x21')],'include':_0x202618[_0xc70f('0x1f')]?_[_0xc70f('0x1e')](_0x202618[_0xc70f('0x1f')],function(_0x1e4e32){return{'model':db[_0x1e4e32[_0xc70f('0x20')]],'as':_0x1e4e32['as'],'attributes':_0x1e4e32['attributes'],'include':_0x1e4e32['include']?_[_0xc70f('0x1e')](_0x1e4e32[_0xc70f('0x1f')],function(_0x5dc5e6){return{'model':db[_0x5dc5e6[_0xc70f('0x20')]],'as':_0x5dc5e6['as'],'attributes':_0x5dc5e6[_0xc70f('0x21')]};}):[]};}):[]};}):[]:[]})[_0xc70f('0xf')](function(_0x3b271c){logger[_0xc70f('0x26')](_0xc70f('0x23'),_0x4de977);logger[_0xc70f('0x22')]('ShowOpenchannelQueue',_0x4de977,JSON[_0xc70f('0x12')](_0x3b271c));_0x2e6e50(_0x3b271c);})[_0xc70f('0x17')](function(_0x2731b1){logger['error'](_0xc70f('0x23'),_0x2731b1[_0xc70f('0x15')],_0x4de977);_0x335472(_0x578ef1[_0xc70f('0x13')](0x1f4,_0x2731b1[_0xc70f('0x15')]));});});};
\ No newline at end of file
diff --git a/server/api/openchannelQueue/openchannelQueue.socket.js b/server/api/openchannelQueue/openchannelQueue.socket.js
index 5130d50..eb89a31 100644
--- a/server/api/openchannelQueue/openchannelQueue.socket.js
+++ b/server/api/openchannelQueue/openchannelQueue.socket.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x13fc=['save','remove','update','emit','removeListener','length','openchannelQueue:','./openchannelQueue.events'];(function(_0x5b1003,_0x4bfeb9){var _0x4a3ca8=function(_0x4f5bde){while(--_0x4f5bde){_0x5b1003['push'](_0x5b1003['shift']());}};_0x4a3ca8(++_0x4bfeb9);}(_0x13fc,0x19f));var _0xc13f=function(_0x1b4cbf,_0x5d9af3){_0x1b4cbf=_0x1b4cbf-0x0;var _0x2b0c7a=_0x13fc[_0x1b4cbf];return _0x2b0c7a;};'use strict';var OpenchannelQueueEvents=require(_0xc13f('0x0'));var events=[_0xc13f('0x1'),_0xc13f('0x2'),_0xc13f('0x3')];function createListener(_0x43dd16,_0x3d3f61){return function(_0x482c48){_0x3d3f61[_0xc13f('0x4')](_0x43dd16,_0x482c48);};}function removeListener(_0x53ac65,_0x3cabe5){return function(){OpenchannelQueueEvents[_0xc13f('0x5')](_0x53ac65,_0x3cabe5);};}exports['register']=function(_0x289b30){for(var _0x40b4f9=0x0,_0x371e6b=events[_0xc13f('0x6')];_0x40b4f9<_0x371e6b;_0x40b4f9++){var _0x3e78a4=events[_0x40b4f9];var _0x286e10=createListener(_0xc13f('0x7')+_0x3e78a4,_0x289b30);OpenchannelQueueEvents['on'](_0x3e78a4,_0x286e10);}};
\ No newline at end of file
+var _0xe41f=['emit','removeListener','register','length','./openchannelQueue.events','save','remove','update'];(function(_0x1fa759,_0x4ecdce){var _0x2da9f4=function(_0x463e2a){while(--_0x463e2a){_0x1fa759['push'](_0x1fa759['shift']());}};_0x2da9f4(++_0x4ecdce);}(_0xe41f,0xc4));var _0xfe41=function(_0x48fdc3,_0x5cbccf){_0x48fdc3=_0x48fdc3-0x0;var _0x1c4b24=_0xe41f[_0x48fdc3];return _0x1c4b24;};'use strict';var OpenchannelQueueEvents=require(_0xfe41('0x0'));var events=[_0xfe41('0x1'),_0xfe41('0x2'),_0xfe41('0x3')];function createListener(_0x983909,_0x4adc95){return function(_0x29a79b){_0x4adc95[_0xfe41('0x4')](_0x983909,_0x29a79b);};}function removeListener(_0x220db1,_0x3d211d){return function(){OpenchannelQueueEvents[_0xfe41('0x5')](_0x220db1,_0x3d211d);};}exports[_0xfe41('0x6')]=function(_0x3b21df){for(var _0x5500b5=0x0,_0x10612c=events[_0xfe41('0x7')];_0x5500b5<_0x10612c;_0x5500b5++){var _0x4f12a5=events[_0x5500b5];var _0x3b5cd3=createListener('openchannelQueue:'+_0x4f12a5,_0x3b21df);OpenchannelQueueEvents['on'](_0x4f12a5,_0x3b5cd3);}};
\ No newline at end of file
diff --git a/server/api/openchannelQueueReport/index.js b/server/api/openchannelQueueReport/index.js
index 150a8ee..b6b60c9 100644
--- a/server/api/openchannelQueueReport/index.js
+++ b/server/api/openchannelQueueReport/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xfdfe=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelQueueReport.controller','isAuthenticated','index','/describe','/:id','show','post','create','put','delete','destroy','multer','util','path','connect-timeout'];(function(_0x2ac980,_0x33829d){var _0x53974d=function(_0x4cd40c){while(--_0x4cd40c){_0x2ac980['push'](_0x2ac980['shift']());}};_0x53974d(++_0x33829d);}(_0xfdfe,0xa7));var _0xefdf=function(_0x47856a,_0x1ad7a0){_0x47856a=_0x47856a-0x0;var _0x1edd96=_0xfdfe[_0x47856a];return _0x1edd96;};'use strict';var multer=require(_0xefdf('0x0'));var util=require(_0xefdf('0x1'));var path=require(_0xefdf('0x2'));var timeout=require(_0xefdf('0x3'));var express=require('express');var router=express[_0xefdf('0x4')]();var auth=require(_0xefdf('0x5'));var interaction=require(_0xefdf('0x6'));var config=require(_0xefdf('0x7'));var controller=require(_0xefdf('0x8'));router['get']('/',auth[_0xefdf('0x9')](),controller[_0xefdf('0xa')]);router['get'](_0xefdf('0xb'),auth[_0xefdf('0x9')](),controller['describe']);router['get'](_0xefdf('0xc'),auth[_0xefdf('0x9')](),controller[_0xefdf('0xd')]);router[_0xefdf('0xe')]('/',auth[_0xefdf('0x9')](),controller[_0xefdf('0xf')]);router[_0xefdf('0x10')](_0xefdf('0xc'),auth['isAuthenticated'](),controller['update']);router[_0xefdf('0x11')](_0xefdf('0xc'),auth[_0xefdf('0x9')](),controller[_0xefdf('0x12')]);module['exports']=router;
\ No newline at end of file
+var _0xb874=['show','post','put','update','delete','destroy','exports','multer','util','express','Router','../../components/auth/service','../../config/environment','./openchannelQueueReport.controller','isAuthenticated','get','/describe','describe','/:id'];(function(_0x55e3b3,_0xaf7df0){var _0x2c358d=function(_0x4e3d7){while(--_0x4e3d7){_0x55e3b3['push'](_0x55e3b3['shift']());}};_0x2c358d(++_0xaf7df0);}(_0xb874,0x15d));var _0x4b87=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0xb874[_0x502c7d];return _0x30b7ed;};'use strict';var multer=require(_0x4b87('0x0'));var util=require(_0x4b87('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x4b87('0x2'));var router=express[_0x4b87('0x3')]();var auth=require(_0x4b87('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x4b87('0x5'));var controller=require(_0x4b87('0x6'));router['get']('/',auth[_0x4b87('0x7')](),controller['index']);router[_0x4b87('0x8')](_0x4b87('0x9'),auth['isAuthenticated'](),controller[_0x4b87('0xa')]);router[_0x4b87('0x8')](_0x4b87('0xb'),auth[_0x4b87('0x7')](),controller[_0x4b87('0xc')]);router[_0x4b87('0xd')]('/',auth[_0x4b87('0x7')](),controller['create']);router[_0x4b87('0xe')](_0x4b87('0xb'),auth[_0x4b87('0x7')](),controller[_0x4b87('0xf')]);router[_0x4b87('0x10')](_0x4b87('0xb'),auth[_0x4b87('0x7')](),controller[_0x4b87('0x11')]);module[_0x4b87('0x12')]=router;
\ No newline at end of file
diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.attributes.js b/server/api/openchannelQueueReport/openchannelQueueReport.attributes.js
index e0d839b..388e9a0 100644
--- a/server/api/openchannelQueueReport/openchannelQueueReport.attributes.js
+++ b/server/api/openchannelQueueReport/openchannelQueueReport.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x4cb0=['sequelize','STRING','DATE','moment'];(function(_0x125ff8,_0x41925f){var _0x2d9ef=function(_0x4ef34c){while(--_0x4ef34c){_0x125ff8['push'](_0x125ff8['shift']());}};_0x2d9ef(++_0x41925f);}(_0x4cb0,0x15f));var _0x04cb=function(_0x33d0b5,_0x2e5200){_0x33d0b5=_0x33d0b5-0x0;var _0x3bbe87=_0x4cb0[_0x33d0b5];return _0x3bbe87;};'use strict';var moment=require(_0x04cb('0x0'));var Sequelize=require(_0x04cb('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0x04cb('0x2')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x04cb('0x3')]},'acceptAt':{'type':Sequelize[_0x04cb('0x3')]},'exitAt':{'type':Sequelize[_0x04cb('0x3')]},'reason':{'type':Sequelize[_0x04cb('0x2')]}};
\ No newline at end of file
+var _0xb290=['DATE','moment','exports','STRING'];(function(_0x6708d1,_0x62d6de){var _0xc18ddd=function(_0x143b74){while(--_0x143b74){_0x6708d1['push'](_0x6708d1['shift']());}};_0xc18ddd(++_0x62d6de);}(_0xb290,0x1c1));var _0x0b29=function(_0x13e47d,_0x1e38bd){_0x13e47d=_0x13e47d-0x0;var _0x1042e4=_0xb290[_0x13e47d];return _0x1042e4;};'use strict';var moment=require(_0x0b29('0x0'));var Sequelize=require('sequelize');module[_0x0b29('0x1')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0x0b29('0x2')]},'joinAt':{'type':Sequelize[_0x0b29('0x3')]},'leaveAt':{'type':Sequelize[_0x0b29('0x3')]},'acceptAt':{'type':Sequelize[_0x0b29('0x3')]},'exitAt':{'type':Sequelize[_0x0b29('0x3')]},'reason':{'type':Sequelize['STRING']}};
\ No newline at end of file
diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.controller.js b/server/api/openchannelQueueReport/openchannelQueueReport.controller.js
index 8d8bfe9..40eda6a 100644
--- a/server/api/openchannelQueueReport/openchannelQueueReport.controller.js
+++ b/server/api/openchannelQueueReport/openchannelQueueReport.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xf6e6=['mustache','util','ejs','squel','jsforce','desk.js','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','json','count','offset','limit','status','set','Content-Range','apply','reject','update','then','destroy','end','error','stack','name','send','index','rawAttributes','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','type','VIRTUAL','filter','options','OpenchannelQueueReport','includeAll','include','rows','catch','show','params','find','create','body','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird'];(function(_0x191f56,_0x5678e0){var _0x49010c=function(_0x17ed88){while(--_0x17ed88){_0x191f56['push'](_0x191f56['shift']());}};_0x49010c(++_0x5678e0);}(_0xf6e6,0x1a8));var _0x6f6e=function(_0x22d9cc,_0x16d193){_0x22d9cc=_0x22d9cc-0x0;var _0x379ac9=_0xf6e6[_0x22d9cc];return _0x379ac9;};'use strict';var pdf=require(_0x6f6e('0x0'));var emlformat=require(_0x6f6e('0x1'));var rimraf=require(_0x6f6e('0x2'));var zipdir=require(_0x6f6e('0x3'));var jsonpatch=require(_0x6f6e('0x4'));var rp=require(_0x6f6e('0x5'));var moment=require(_0x6f6e('0x6'));var BPromise=require(_0x6f6e('0x7'));var Mustache=require(_0x6f6e('0x8'));var util=require(_0x6f6e('0x9'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x6f6e('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0x6f6e('0xb'));var crypto=require('crypto');var jsforce=require(_0x6f6e('0xc'));var deskjs=require(_0x6f6e('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x6f6e('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x6f6e('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6f6e('0x10'));var logger=require(_0x6f6e('0x11'))(_0x6f6e('0x12'));var utils=require(_0x6f6e('0x13'));var config=require(_0x6f6e('0x14'));var db=require(_0x6f6e('0x15'))['db'];function respondWithStatusCode(_0x5169ff,_0x4792f3){_0x4792f3=_0x4792f3||0xcc;return function(_0x2f7af0){if(_0x2f7af0){return _0x5169ff['sendStatus'](_0x4792f3);}return _0x5169ff['status'](_0x4792f3)['end']();};}function respondWithResult(_0x5369c5,_0x17eb84){_0x17eb84=_0x17eb84||0xc8;return function(_0x9686fb){if(_0x9686fb){return _0x5369c5['status'](_0x17eb84)[_0x6f6e('0x16')](_0x9686fb);}};}function respondWithFilteredResult(_0x5b21ae,_0x71c1fe){return function(_0x12e293){if(_0x12e293){var _0x1ab0f1=_0x12e293[_0x6f6e('0x17')],_0x15139c=_0x71c1fe['offset'],_0xfac229=_0x71c1fe[_0x6f6e('0x18')]+_0x71c1fe[_0x6f6e('0x19')],_0x1a6ffc;if(_0xfac229>=_0x1ab0f1){_0xfac229=_0x1ab0f1;_0x1a6ffc=0xc8;}else{_0x1a6ffc=0xce;}_0x5b21ae[_0x6f6e('0x1a')](_0x1a6ffc);return _0x5b21ae[_0x6f6e('0x1b')](_0x6f6e('0x1c'),_0x15139c+'-'+_0xfac229+'/'+_0x1ab0f1)[_0x6f6e('0x16')](_0x12e293);}return null;};}function patchUpdates(_0x35f8d0){return function(_0x463da4){try{jsonpatch[_0x6f6e('0x1d')](_0x463da4,_0x35f8d0,!![]);}catch(_0x59e603){return BPromise[_0x6f6e('0x1e')](_0x59e603);}return _0x463da4['save']();};}function saveUpdates(_0x19a0cc,_0xb4d2e5){return function(_0x13dd9e){if(_0x13dd9e){return _0x13dd9e[_0x6f6e('0x1f')](_0x19a0cc)[_0x6f6e('0x20')](function(_0x130970){return _0x130970;});}return null;};}function removeEntity(_0x1b31ec,_0x156ce3){return function(_0xc12e2){if(_0xc12e2){return _0xc12e2[_0x6f6e('0x21')]()['then'](function(){_0x1b31ec[_0x6f6e('0x1a')](0xcc)[_0x6f6e('0x22')]();});}};}function handleEntityNotFound(_0x479feb,_0x3dff1b){return function(_0x4a0565){if(!_0x4a0565){_0x479feb['sendStatus'](0x194);}return _0x4a0565;};}function handleError(_0x49d92c,_0x2f25e0){_0x2f25e0=_0x2f25e0||0x1f4;return function(_0x3b50bd){logger[_0x6f6e('0x23')](_0x3b50bd[_0x6f6e('0x24')]);if(_0x3b50bd[_0x6f6e('0x25')]){delete _0x3b50bd[_0x6f6e('0x25')];}_0x49d92c[_0x6f6e('0x1a')](_0x2f25e0)[_0x6f6e('0x26')](_0x3b50bd);};}exports[_0x6f6e('0x27')]=function(_0x125fa8,_0x21019d){var _0xdb0684={},_0x21d961={},_0x2cdeb8={'count':0x0,'rows':[]};var _0x18852b=_['map'](db['OpenchannelQueueReport'][_0x6f6e('0x28')],function(_0x3172bd){return{'name':_0x3172bd['fieldName'],'type':_0x3172bd['type']['key']};});_0x21d961[_0x6f6e('0x29')]=_[_0x6f6e('0x2a')](_0x18852b,_0x6f6e('0x25'));_0x21d961[_0x6f6e('0x2b')]=_[_0x6f6e('0x2c')](_0x125fa8[_0x6f6e('0x2b')]);_0x21d961[_0x6f6e('0x2d')]=_[_0x6f6e('0x2e')](_0x21d961[_0x6f6e('0x29')],_0x21d961['query']);_0xdb0684[_0x6f6e('0x2f')]=_[_0x6f6e('0x2e')](_0x21d961['model'],qs[_0x6f6e('0x30')](_0x125fa8[_0x6f6e('0x2b')]['fields']));_0xdb0684[_0x6f6e('0x2f')]=_0xdb0684[_0x6f6e('0x2f')][_0x6f6e('0x31')]?_0xdb0684[_0x6f6e('0x2f')]:_0x21d961[_0x6f6e('0x29')];if(!_0x125fa8[_0x6f6e('0x2b')][_0x6f6e('0x32')](_0x6f6e('0x33'))){_0xdb0684[_0x6f6e('0x19')]=qs[_0x6f6e('0x19')](_0x125fa8[_0x6f6e('0x2b')]['limit']);_0xdb0684[_0x6f6e('0x18')]=qs[_0x6f6e('0x18')](_0x125fa8['query']['offset']);}_0xdb0684[_0x6f6e('0x34')]=qs['sort'](_0x125fa8[_0x6f6e('0x2b')][_0x6f6e('0x35')]);_0xdb0684[_0x6f6e('0x36')]=qs[_0x6f6e('0x2d')](_[_0x6f6e('0x37')](_0x125fa8[_0x6f6e('0x2b')],_0x21d961['filters']),_0x18852b);if(_0x125fa8[_0x6f6e('0x2b')]['filter']){_0xdb0684[_0x6f6e('0x36')]=_[_0x6f6e('0x38')](_0xdb0684[_0x6f6e('0x36')],{'$or':_['map'](_0x18852b,function(_0x567c78){if(_0x567c78[_0x6f6e('0x39')]!==_0x6f6e('0x3a')){var _0x2d4db6={};_0x2d4db6[_0x567c78['name']]={'$like':'%'+_0x125fa8[_0x6f6e('0x2b')][_0x6f6e('0x3b')]+'%'};return _0x2d4db6;}})});}_0xdb0684=_[_0x6f6e('0x38')]({},_0xdb0684,_0x125fa8[_0x6f6e('0x3c')]);var _0xc2947c={'where':_0xdb0684[_0x6f6e('0x36')]};return db[_0x6f6e('0x3d')][_0x6f6e('0x17')](_0xc2947c)['then'](function(_0xa183f3){_0x2cdeb8[_0x6f6e('0x17')]=_0xa183f3;if(_0x125fa8[_0x6f6e('0x2b')][_0x6f6e('0x3e')]){_0xdb0684[_0x6f6e('0x3f')]=[{'all':!![]}];}return db[_0x6f6e('0x3d')]['findAll'](_0xdb0684);})[_0x6f6e('0x20')](function(_0x3b0980){_0x2cdeb8[_0x6f6e('0x40')]=_0x3b0980;return _0x2cdeb8;})['then'](respondWithFilteredResult(_0x21019d,_0xdb0684))[_0x6f6e('0x41')](handleError(_0x21019d,null));};exports[_0x6f6e('0x42')]=function(_0x3fdd6e,_0x1d0b3d){var _0xeefa1f={'raw':!![],'where':{'id':_0x3fdd6e[_0x6f6e('0x43')]['id']}},_0x516fc2={};_0x516fc2[_0x6f6e('0x29')]=_['keys'](db[_0x6f6e('0x3d')]['rawAttributes']);_0x516fc2['query']=_[_0x6f6e('0x2c')](_0x3fdd6e[_0x6f6e('0x2b')]);_0x516fc2[_0x6f6e('0x2d')]=_[_0x6f6e('0x2e')](_0x516fc2[_0x6f6e('0x29')],_0x516fc2['query']);_0xeefa1f[_0x6f6e('0x2f')]=_[_0x6f6e('0x2e')](_0x516fc2[_0x6f6e('0x29')],qs[_0x6f6e('0x30')](_0x3fdd6e['query'][_0x6f6e('0x30')]));_0xeefa1f[_0x6f6e('0x2f')]=_0xeefa1f['attributes'][_0x6f6e('0x31')]?_0xeefa1f[_0x6f6e('0x2f')]:_0x516fc2[_0x6f6e('0x29')];if(_0x3fdd6e['query']['includeAll']){_0xeefa1f[_0x6f6e('0x3f')]=[{'all':!![]}];}_0xeefa1f=_[_0x6f6e('0x38')]({},_0xeefa1f,_0x3fdd6e[_0x6f6e('0x3c')]);return db['OpenchannelQueueReport'][_0x6f6e('0x44')](_0xeefa1f)[_0x6f6e('0x20')](handleEntityNotFound(_0x1d0b3d,null))['then'](respondWithResult(_0x1d0b3d,null))[_0x6f6e('0x41')](handleError(_0x1d0b3d,null));};exports['create']=function(_0x37d785,_0x3606e2){return db[_0x6f6e('0x3d')][_0x6f6e('0x45')](_0x37d785['body'],{})[_0x6f6e('0x20')](respondWithResult(_0x3606e2,0xc9))[_0x6f6e('0x41')](handleError(_0x3606e2,null));};exports[_0x6f6e('0x1f')]=function(_0xee9470,_0x4de8d8){if(_0xee9470[_0x6f6e('0x46')]['id']){delete _0xee9470[_0x6f6e('0x46')]['id'];}return db['OpenchannelQueueReport']['find']({'where':{'id':_0xee9470[_0x6f6e('0x43')]['id']}})['then'](handleEntityNotFound(_0x4de8d8,null))[_0x6f6e('0x20')](saveUpdates(_0xee9470['body'],null))['then'](respondWithResult(_0x4de8d8,null))[_0x6f6e('0x41')](handleError(_0x4de8d8,null));};exports[_0x6f6e('0x21')]=function(_0xa484d4,_0x37fd80){return db[_0x6f6e('0x3d')][_0x6f6e('0x44')]({'where':{'id':_0xa484d4[_0x6f6e('0x43')]['id']}})[_0x6f6e('0x20')](handleEntityNotFound(_0x37fd80,null))[_0x6f6e('0x20')](removeEntity(_0x37fd80,null))[_0x6f6e('0x41')](handleError(_0x37fd80,null));};exports[_0x6f6e('0x47')]=function(_0x5b52dd,_0x47a984){return db[_0x6f6e('0x3d')][_0x6f6e('0x47')]()[_0x6f6e('0x20')](respondWithResult(_0x47a984,null))['catch'](handleError(_0x47a984,null));};
\ No newline at end of file
+var _0x0298=['options','find','create','body','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/environment','../../mysqldb','status','end','json','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','error','name','index','map','OpenchannelQueueReport','fieldName','type','model','query','keys','attributes','intersection','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','filters','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','params'];(function(_0x478e09,_0xdbb31d){var _0x12aacc=function(_0x402b83){while(--_0x402b83){_0x478e09['push'](_0x478e09['shift']());}};_0x12aacc(++_0xdbb31d);}(_0x0298,0x1bb));var _0x8029=function(_0x3d92cb,_0x11aa36){_0x3d92cb=_0x3d92cb-0x0;var _0x50026d=_0x0298[_0x3d92cb];return _0x50026d;};'use strict';var pdf=require(_0x8029('0x0'));var emlformat=require(_0x8029('0x1'));var rimraf=require(_0x8029('0x2'));var zipdir=require(_0x8029('0x3'));var jsonpatch=require(_0x8029('0x4'));var rp=require(_0x8029('0x5'));var moment=require(_0x8029('0x6'));var BPromise=require('bluebird');var Mustache=require(_0x8029('0x7'));var util=require(_0x8029('0x8'));var path=require(_0x8029('0x9'));var sox=require(_0x8029('0xa'));var csv=require(_0x8029('0xb'));var ejs=require(_0x8029('0xc'));var fs=require('fs');var _=require(_0x8029('0xd'));var squel=require(_0x8029('0xe'));var crypto=require('crypto');var jsforce=require(_0x8029('0xf'));var deskjs=require(_0x8029('0x10'));var toCsv=require(_0x8029('0xb'));var querystring=require(_0x8029('0x11'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x8029('0x12'));var qs=require(_0x8029('0x13'));var as=require(_0x8029('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8029('0x15'))('api');var utils=require('../../config/utils');var config=require(_0x8029('0x16'));var db=require(_0x8029('0x17'))['db'];function respondWithStatusCode(_0x933712,_0x2e39c4){_0x2e39c4=_0x2e39c4||0xcc;return function(_0x3aeef0){if(_0x3aeef0){return _0x933712['sendStatus'](_0x2e39c4);}return _0x933712[_0x8029('0x18')](_0x2e39c4)[_0x8029('0x19')]();};}function respondWithResult(_0x336bba,_0x14a88c){_0x14a88c=_0x14a88c||0xc8;return function(_0x55b775){if(_0x55b775){return _0x336bba[_0x8029('0x18')](_0x14a88c)[_0x8029('0x1a')](_0x55b775);}};}function respondWithFilteredResult(_0x35ec16,_0x32e632){return function(_0xc23e2f){if(_0xc23e2f){var _0x187c97=_0xc23e2f[_0x8029('0x1b')],_0xf9d011=_0x32e632[_0x8029('0x1c')],_0x4e1c8b=_0x32e632[_0x8029('0x1c')]+_0x32e632['limit'],_0x2fbd70;if(_0x4e1c8b>=_0x187c97){_0x4e1c8b=_0x187c97;_0x2fbd70=0xc8;}else{_0x2fbd70=0xce;}_0x35ec16['status'](_0x2fbd70);return _0x35ec16[_0x8029('0x1d')](_0x8029('0x1e'),_0xf9d011+'-'+_0x4e1c8b+'/'+_0x187c97)[_0x8029('0x1a')](_0xc23e2f);}return null;};}function patchUpdates(_0x5b6983){return function(_0x1fc970){try{jsonpatch[_0x8029('0x1f')](_0x1fc970,_0x5b6983,!![]);}catch(_0x4d3c40){return BPromise[_0x8029('0x20')](_0x4d3c40);}return _0x1fc970[_0x8029('0x21')]();};}function saveUpdates(_0x49cd02,_0x315b8e){return function(_0x4d61c2){if(_0x4d61c2){return _0x4d61c2[_0x8029('0x22')](_0x49cd02)[_0x8029('0x23')](function(_0xe7cd7c){return _0xe7cd7c;});}return null;};}function removeEntity(_0x21eed7,_0x4ea692){return function(_0x45d6ed){if(_0x45d6ed){return _0x45d6ed[_0x8029('0x24')]()[_0x8029('0x23')](function(){_0x21eed7['status'](0xcc)[_0x8029('0x19')]();});}};}function handleEntityNotFound(_0x2ab2ea,_0x2e4637){return function(_0x187ff7){if(!_0x187ff7){_0x2ab2ea['sendStatus'](0x194);}return _0x187ff7;};}function handleError(_0x4481a6,_0x3e21b5){_0x3e21b5=_0x3e21b5||0x1f4;return function(_0x392725){logger[_0x8029('0x25')](_0x392725['stack']);if(_0x392725[_0x8029('0x26')]){delete _0x392725[_0x8029('0x26')];}_0x4481a6[_0x8029('0x18')](_0x3e21b5)['send'](_0x392725);};}exports[_0x8029('0x27')]=function(_0x28d3a3,_0x5acb0b){var _0x3607e0={},_0xc3a6c2={},_0x5e548f={'count':0x0,'rows':[]};var _0x56739c=_[_0x8029('0x28')](db[_0x8029('0x29')]['rawAttributes'],function(_0x49fa2b){return{'name':_0x49fa2b[_0x8029('0x2a')],'type':_0x49fa2b[_0x8029('0x2b')]['key']};});_0xc3a6c2[_0x8029('0x2c')]=_[_0x8029('0x28')](_0x56739c,_0x8029('0x26'));_0xc3a6c2[_0x8029('0x2d')]=_[_0x8029('0x2e')](_0x28d3a3[_0x8029('0x2d')]);_0xc3a6c2['filters']=_['intersection'](_0xc3a6c2['model'],_0xc3a6c2[_0x8029('0x2d')]);_0x3607e0[_0x8029('0x2f')]=_[_0x8029('0x30')](_0xc3a6c2[_0x8029('0x2c')],qs['fields'](_0x28d3a3[_0x8029('0x2d')][_0x8029('0x31')]));_0x3607e0[_0x8029('0x2f')]=_0x3607e0[_0x8029('0x2f')][_0x8029('0x32')]?_0x3607e0['attributes']:_0xc3a6c2[_0x8029('0x2c')];if(!_0x28d3a3[_0x8029('0x2d')][_0x8029('0x33')](_0x8029('0x34'))){_0x3607e0[_0x8029('0x35')]=qs[_0x8029('0x35')](_0x28d3a3[_0x8029('0x2d')][_0x8029('0x35')]);_0x3607e0[_0x8029('0x1c')]=qs['offset'](_0x28d3a3[_0x8029('0x2d')]['offset']);}_0x3607e0[_0x8029('0x36')]=qs[_0x8029('0x37')](_0x28d3a3[_0x8029('0x2d')][_0x8029('0x37')]);_0x3607e0[_0x8029('0x38')]=qs[_0x8029('0x39')](_[_0x8029('0x3a')](_0x28d3a3[_0x8029('0x2d')],_0xc3a6c2[_0x8029('0x39')]),_0x56739c);if(_0x28d3a3[_0x8029('0x2d')][_0x8029('0x3b')]){_0x3607e0[_0x8029('0x38')]=_[_0x8029('0x3c')](_0x3607e0[_0x8029('0x38')],{'$or':_[_0x8029('0x28')](_0x56739c,function(_0x5b7d27){if(_0x5b7d27[_0x8029('0x2b')]!==_0x8029('0x3d')){var _0x24e95b={};_0x24e95b[_0x5b7d27[_0x8029('0x26')]]={'$like':'%'+_0x28d3a3[_0x8029('0x2d')][_0x8029('0x3b')]+'%'};return _0x24e95b;}})});}_0x3607e0=_['merge']({},_0x3607e0,_0x28d3a3['options']);var _0xf1559e={'where':_0x3607e0['where']};return db[_0x8029('0x29')][_0x8029('0x1b')](_0xf1559e)[_0x8029('0x23')](function(_0x4fdd6d){_0x5e548f[_0x8029('0x1b')]=_0x4fdd6d;if(_0x28d3a3['query'][_0x8029('0x3e')]){_0x3607e0[_0x8029('0x3f')]=[{'all':!![]}];}return db[_0x8029('0x29')][_0x8029('0x40')](_0x3607e0);})[_0x8029('0x23')](function(_0x495f9e){_0x5e548f[_0x8029('0x41')]=_0x495f9e;return _0x5e548f;})[_0x8029('0x23')](respondWithFilteredResult(_0x5acb0b,_0x3607e0))[_0x8029('0x42')](handleError(_0x5acb0b,null));};exports['show']=function(_0xbaa2b8,_0x17502d){var _0x1b39aa={'raw':!![],'where':{'id':_0xbaa2b8[_0x8029('0x43')]['id']}},_0x166065={};_0x166065[_0x8029('0x2c')]=_[_0x8029('0x2e')](db[_0x8029('0x29')]['rawAttributes']);_0x166065[_0x8029('0x2d')]=_['keys'](_0xbaa2b8[_0x8029('0x2d')]);_0x166065[_0x8029('0x39')]=_[_0x8029('0x30')](_0x166065[_0x8029('0x2c')],_0x166065[_0x8029('0x2d')]);_0x1b39aa[_0x8029('0x2f')]=_[_0x8029('0x30')](_0x166065[_0x8029('0x2c')],qs[_0x8029('0x31')](_0xbaa2b8[_0x8029('0x2d')]['fields']));_0x1b39aa['attributes']=_0x1b39aa[_0x8029('0x2f')][_0x8029('0x32')]?_0x1b39aa['attributes']:_0x166065[_0x8029('0x2c')];if(_0xbaa2b8['query'][_0x8029('0x3e')]){_0x1b39aa[_0x8029('0x3f')]=[{'all':!![]}];}_0x1b39aa=_['merge']({},_0x1b39aa,_0xbaa2b8[_0x8029('0x44')]);return db['OpenchannelQueueReport'][_0x8029('0x45')](_0x1b39aa)[_0x8029('0x23')](handleEntityNotFound(_0x17502d,null))[_0x8029('0x23')](respondWithResult(_0x17502d,null))[_0x8029('0x42')](handleError(_0x17502d,null));};exports['create']=function(_0x234b78,_0x198627){return db[_0x8029('0x29')][_0x8029('0x46')](_0x234b78[_0x8029('0x47')],{})[_0x8029('0x23')](respondWithResult(_0x198627,0xc9))['catch'](handleError(_0x198627,null));};exports['update']=function(_0xe53800,_0x5dacc6){if(_0xe53800[_0x8029('0x47')]['id']){delete _0xe53800['body']['id'];}return db[_0x8029('0x29')][_0x8029('0x45')]({'where':{'id':_0xe53800['params']['id']}})['then'](handleEntityNotFound(_0x5dacc6,null))[_0x8029('0x23')](saveUpdates(_0xe53800[_0x8029('0x47')],null))[_0x8029('0x23')](respondWithResult(_0x5dacc6,null))['catch'](handleError(_0x5dacc6,null));};exports[_0x8029('0x24')]=function(_0xaef6fb,_0x3e498d){return db[_0x8029('0x29')]['find']({'where':{'id':_0xaef6fb['params']['id']}})['then'](handleEntityNotFound(_0x3e498d,null))[_0x8029('0x23')](removeEntity(_0x3e498d,null))[_0x8029('0x42')](handleError(_0x3e498d,null));};exports[_0x8029('0x48')]=function(_0xda7b2f,_0x511f6b){return db['OpenchannelQueueReport'][_0x8029('0x48')]()['then'](respondWithResult(_0x511f6b,null))[_0x8029('0x42')](handleError(_0x511f6b,null));};
\ No newline at end of file
diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.model.js b/server/api/openchannelQueueReport/openchannelQueueReport.model.js
index 9dde06f..aa07cf1 100644
--- a/server/api/openchannelQueueReport/openchannelQueueReport.model.js
+++ b/server/api/openchannelQueueReport/openchannelQueueReport.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x8239=['OpenchannelQueueReport','report_openchannel_queue','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./openchannelQueueReport.attributes','exports'];(function(_0x434804,_0x415f68){var _0x573fc8=function(_0x3ce265){while(--_0x3ce265){_0x434804['push'](_0x434804['shift']());}};_0x573fc8(++_0x415f68);}(_0x8239,0x1f1));var _0x9823=function(_0x32c6ed,_0x591dcf){_0x32c6ed=_0x32c6ed-0x0;var _0x1fbac2=_0x8239[_0x32c6ed];return _0x1fbac2;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x9823('0x0'))(_0x9823('0x1'));var moment=require(_0x9823('0x2'));var BPromise=require(_0x9823('0x3'));var rp=require(_0x9823('0x4'));var fs=require('fs');var path=require(_0x9823('0x5'));var rimraf=require('rimraf');var config=require(_0x9823('0x6'));var attributes=require(_0x9823('0x7'));module[_0x9823('0x8')]=function(_0x570b63,_0x53d90c){return _0x570b63['define'](_0x9823('0x9'),attributes,{'tableName':_0x9823('0xa'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
+var _0x29d5=['../../config/environment','./openchannelQueueReport.attributes','exports','define','OpenchannelQueueReport','report_openchannel_queue','uniqueid','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf'];(function(_0x215e84,_0x5df0b7){var _0x7f5b9=function(_0x2557c1){while(--_0x2557c1){_0x215e84['push'](_0x215e84['shift']());}};_0x7f5b9(++_0x5df0b7);}(_0x29d5,0x1e7));var _0x529d=function(_0x52ad43,_0x233c74){_0x52ad43=_0x52ad43-0x0;var _0x46d619=_0x29d5[_0x52ad43];return _0x46d619;};'use strict';var _=require(_0x529d('0x0'));var util=require(_0x529d('0x1'));var logger=require(_0x529d('0x2'))('api');var moment=require(_0x529d('0x3'));var BPromise=require(_0x529d('0x4'));var rp=require(_0x529d('0x5'));var fs=require('fs');var path=require(_0x529d('0x6'));var rimraf=require(_0x529d('0x7'));var config=require(_0x529d('0x8'));var attributes=require(_0x529d('0x9'));module[_0x529d('0xa')]=function(_0x8719db,_0xee15eb){return _0x8719db[_0x529d('0xb')](_0x529d('0xc'),attributes,{'tableName':_0x529d('0xd'),'paranoid':![],'indexes':[{'name':_0x529d('0xe'),'fields':[_0x529d('0xe')]}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.rpc.js b/server/api/openchannelQueueReport/openchannelQueueReport.rpc.js
index 0c21c5f..b0c5653 100644
--- a/server/api/openchannelQueueReport/openchannelQueueReport.rpc.js
+++ b/server/api/openchannelQueueReport/openchannelQueueReport.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x5ff9=['body','options','raw','CreateOpenchannelQueueReport','UpdateOpenchannelQueueReport','OpenchannelQueueReport','update','where','attributes','limit','lodash','util','bluebird','randomstring','../../config/utils','../../config/environment','jayson/promise','http','then','OpenchannelQueueReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','catch','create'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x5ff9,0xa0));var _0x95ff=function(_0xed00d9,_0x119c57){_0xed00d9=_0xed00d9-0x0;var _0x205daf=_0x5ff9[_0xed00d9];return _0x205daf;};'use strict';var _=require(_0x95ff('0x0'));var util=require(_0x95ff('0x1'));var moment=require('moment');var BPromise=require(_0x95ff('0x2'));var rs=require(_0x95ff('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x95ff('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0x95ff('0x5'));var jayson=require(_0x95ff('0x6'));var client=jayson['client'][_0x95ff('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x4fd45b,_0x34ace2,_0x384657){return new BPromise(function(_0x491610,_0x2fb3f5){return client['request'](_0x4fd45b,_0x384657)[_0x95ff('0x8')](function(_0x300166){logger['info'](_0x95ff('0x9'),_0x34ace2,_0x95ff('0xa'));logger[_0x95ff('0xb')]('OpenchannelQueueReport,\x20%s,\x20%s,\x20%s',_0x34ace2,_0x95ff('0xa'),JSON[_0x95ff('0xc')](_0x300166));if(_0x300166[_0x95ff('0xd')]){if(_0x300166[_0x95ff('0xd')][_0x95ff('0xe')]===0x1f4){logger[_0x95ff('0xd')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x34ace2,_0x300166['error'][_0x95ff('0xf')]);return _0x2fb3f5(_0x300166[_0x95ff('0xd')][_0x95ff('0xf')]);}logger[_0x95ff('0xd')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x34ace2,_0x300166[_0x95ff('0xd')][_0x95ff('0xf')]);return _0x491610(_0x300166['error'][_0x95ff('0xf')]);}else{logger[_0x95ff('0x10')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x34ace2,'request\x20sent');_0x491610(_0x300166[_0x95ff('0x11')][_0x95ff('0xf')]);}})[_0x95ff('0x12')](function(_0x5d5350){logger[_0x95ff('0xd')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x34ace2,_0x5d5350);_0x2fb3f5(_0x5d5350);});});}exports['CreateOpenchannelQueueReport']=function(_0x1929c4){var _0x2ac86c=this;return new Promise(function(_0x1c67e4,_0x10f660){return db['OpenchannelQueueReport'][_0x95ff('0x13')](_0x1929c4[_0x95ff('0x14')],{'raw':_0x1929c4[_0x95ff('0x15')]?_0x1929c4[_0x95ff('0x15')][_0x95ff('0x16')]===undefined?!![]:![]:!![]})['then'](function(_0x363691){logger[_0x95ff('0x10')](_0x95ff('0x17'),_0x1929c4);logger[_0x95ff('0xb')](_0x95ff('0x17'),_0x1929c4,JSON['stringify'](_0x363691));_0x1c67e4(_0x363691);})['catch'](function(_0x1151d8){logger[_0x95ff('0xd')](_0x95ff('0x17'),_0x1151d8[_0x95ff('0xf')],_0x1929c4);_0x10f660(_0x2ac86c['error'](0x1f4,_0x1151d8[_0x95ff('0xf')]));});});};exports[_0x95ff('0x18')]=function(_0x4fa568){var _0x52b08c=this;return new Promise(function(_0x35fd01,_0x4d1158){return db[_0x95ff('0x19')][_0x95ff('0x1a')](_0x4fa568[_0x95ff('0x14')],{'raw':_0x4fa568[_0x95ff('0x15')]?_0x4fa568[_0x95ff('0x15')][_0x95ff('0x16')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4fa568['options']?_0x4fa568[_0x95ff('0x15')][_0x95ff('0x1b')]||null:null,'attributes':_0x4fa568[_0x95ff('0x15')]?_0x4fa568[_0x95ff('0x15')][_0x95ff('0x1c')]||null:null,'limit':_0x4fa568[_0x95ff('0x15')]?_0x4fa568[_0x95ff('0x15')][_0x95ff('0x1d')]||null:null})[_0x95ff('0x8')](function(_0x3b4919){logger[_0x95ff('0x10')](_0x95ff('0x18'),_0x4fa568);logger[_0x95ff('0xb')](_0x95ff('0x18'),_0x4fa568,JSON[_0x95ff('0xc')](_0x3b4919));_0x35fd01(_0x3b4919);})['catch'](function(_0x37c7ce){logger[_0x95ff('0xd')](_0x95ff('0x18'),_0x37c7ce[_0x95ff('0xf')],_0x4fa568);_0x4d1158(_0x52b08c[_0x95ff('0xd')](0x1f4,_0x37c7ce[_0x95ff('0xf')]));});});};
\ No newline at end of file
+var _0x7382=['error','code','message','result','catch','CreateOpenchannelQueueReport','OpenchannelQueueReport','body','options','raw','stringify','UpdateOpenchannelQueueReport','update','util','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','OpenchannelQueueReport,\x20%s,\x20%s','debug','OpenchannelQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x217440,_0x24230b){var _0x3d0486=function(_0x588d9e){while(--_0x588d9e){_0x217440['push'](_0x217440['shift']());}};_0x3d0486(++_0x24230b);}(_0x7382,0x111));var _0x2738=function(_0x45d876,_0x13843f){_0x45d876=_0x45d876-0x0;var _0x3cb9be=_0x7382[_0x45d876];return _0x3cb9be;};'use strict';var _=require('lodash');var util=require(_0x2738('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x2738('0x1'));var logger=require(_0x2738('0x2'))(_0x2738('0x3'));var config=require(_0x2738('0x4'));var jayson=require(_0x2738('0x5'));var client=jayson['client'][_0x2738('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x2bc38a,_0xd74b07,_0x523aef){return new BPromise(function(_0x4235e7,_0x487d14){return client[_0x2738('0x7')](_0x2bc38a,_0x523aef)['then'](function(_0x476864){logger[_0x2738('0x8')](_0x2738('0x9'),_0xd74b07,'request\x20sent');logger[_0x2738('0xa')](_0x2738('0xb'),_0xd74b07,_0x2738('0xc'),JSON['stringify'](_0x476864));if(_0x476864['error']){if(_0x476864[_0x2738('0xd')][_0x2738('0xe')]===0x1f4){logger[_0x2738('0xd')](_0x2738('0x9'),_0xd74b07,_0x476864[_0x2738('0xd')][_0x2738('0xf')]);return _0x487d14(_0x476864[_0x2738('0xd')][_0x2738('0xf')]);}logger[_0x2738('0xd')](_0x2738('0x9'),_0xd74b07,_0x476864[_0x2738('0xd')]['message']);return _0x4235e7(_0x476864[_0x2738('0xd')][_0x2738('0xf')]);}else{logger['info'](_0x2738('0x9'),_0xd74b07,'request\x20sent');_0x4235e7(_0x476864[_0x2738('0x10')]['message']);}})[_0x2738('0x11')](function(_0x568065){logger[_0x2738('0xd')](_0x2738('0x9'),_0xd74b07,_0x568065);_0x487d14(_0x568065);});});}exports[_0x2738('0x12')]=function(_0x3c6810){var _0x1d0aca=this;return new Promise(function(_0x1e0f57,_0x42685a){return db[_0x2738('0x13')]['create'](_0x3c6810[_0x2738('0x14')],{'raw':_0x3c6810['options']?_0x3c6810[_0x2738('0x15')][_0x2738('0x16')]===undefined?!![]:![]:!![]})['then'](function(_0x5a1d61){logger[_0x2738('0x8')](_0x2738('0x12'),_0x3c6810);logger[_0x2738('0xa')](_0x2738('0x12'),_0x3c6810,JSON[_0x2738('0x17')](_0x5a1d61));_0x1e0f57(_0x5a1d61);})[_0x2738('0x11')](function(_0x18e1d8){logger[_0x2738('0xd')](_0x2738('0x12'),_0x18e1d8[_0x2738('0xf')],_0x3c6810);_0x42685a(_0x1d0aca[_0x2738('0xd')](0x1f4,_0x18e1d8['message']));});});};exports[_0x2738('0x18')]=function(_0x537c5f){var _0x51ee19=this;return new Promise(function(_0x3e3b2d,_0x2d8c5b){return db[_0x2738('0x13')][_0x2738('0x19')](_0x537c5f[_0x2738('0x14')],{'raw':_0x537c5f[_0x2738('0x15')]?_0x537c5f[_0x2738('0x15')][_0x2738('0x16')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x537c5f['options']?_0x537c5f[_0x2738('0x15')]['where']||null:null,'attributes':_0x537c5f[_0x2738('0x15')]?_0x537c5f[_0x2738('0x15')]['attributes']||null:null,'limit':_0x537c5f[_0x2738('0x15')]?_0x537c5f[_0x2738('0x15')]['limit']||null:null})['then'](function(_0x4fad4c){logger['info'](_0x2738('0x18'),_0x537c5f);logger[_0x2738('0xa')](_0x2738('0x18'),_0x537c5f,JSON[_0x2738('0x17')](_0x4fad4c));_0x3e3b2d(_0x4fad4c);})[_0x2738('0x11')](function(_0x2b317c){logger['error'](_0x2738('0x18'),_0x2b317c[_0x2738('0xf')],_0x537c5f);_0x2d8c5b(_0x51ee19[_0x2738('0xd')](0x1f4,_0x2b317c[_0x2738('0xf')]));});});};
\ No newline at end of file
diff --git a/server/api/openchannelTransferReport/index.js b/server/api/openchannelTransferReport/index.js
index 62a31de..53255b6 100644
--- a/server/api/openchannelTransferReport/index.js
+++ b/server/api/openchannelTransferReport/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xa9e0=['put','destroy','exports','multer','util','path','Router','../../components/interaction/service','../../config/environment','./openchannelTransferReport.controller','get','isAuthenticated','/describe','/:id','post','create'];(function(_0x1cec84,_0x101ec2){var _0x12b7d3=function(_0x9679d8){while(--_0x9679d8){_0x1cec84['push'](_0x1cec84['shift']());}};_0x12b7d3(++_0x101ec2);}(_0xa9e0,0x123));var _0x0a9e=function(_0x37bd26,_0x5ad346){_0x37bd26=_0x37bd26-0x0;var _0xe83dc4=_0xa9e0[_0x37bd26];return _0xe83dc4;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x0a9e('0x4'));var config=require(_0x0a9e('0x5'));var controller=require(_0x0a9e('0x6'));router[_0x0a9e('0x7')]('/',auth[_0x0a9e('0x8')](),controller['index']);router[_0x0a9e('0x7')](_0x0a9e('0x9'),auth[_0x0a9e('0x8')](),controller['describe']);router['get'](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0xb')]('/',auth[_0x0a9e('0x8')](),controller[_0x0a9e('0xc')]);router[_0x0a9e('0xd')](_0x0a9e('0xa'),auth[_0x0a9e('0x8')](),controller['update']);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xe')]);module[_0x0a9e('0xf')]=router;
\ No newline at end of file
+var _0xa9e0=['put','destroy','exports','multer','util','path','Router','../../components/interaction/service','../../config/environment','./openchannelTransferReport.controller','get','isAuthenticated','/describe','/:id','post','create'];(function(_0x20cb20,_0x256051){var _0x2fcf4b=function(_0x26200b){while(--_0x26200b){_0x20cb20['push'](_0x20cb20['shift']());}};_0x2fcf4b(++_0x256051);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0xa9e0[_0x3947c9];return _0x2e7871;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x0a9e('0x4'));var config=require(_0x0a9e('0x5'));var controller=require(_0x0a9e('0x6'));router[_0x0a9e('0x7')]('/',auth[_0x0a9e('0x8')](),controller['index']);router[_0x0a9e('0x7')](_0x0a9e('0x9'),auth[_0x0a9e('0x8')](),controller['describe']);router['get'](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0xb')]('/',auth[_0x0a9e('0x8')](),controller[_0x0a9e('0xc')]);router[_0x0a9e('0xd')](_0x0a9e('0xa'),auth[_0x0a9e('0x8')](),controller['update']);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xe')]);module[_0x0a9e('0xf')]=router;
\ No newline at end of file
diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js b/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js
index 61237b7..944cff9 100644
--- a/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js
+++ b/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xe160=['DATE','NOW','moment','sequelize','exports','ENUM','account','agent','queue'];(function(_0x401b64,_0x5cae66){var _0x139aa0=function(_0x4bef1d){while(--_0x4bef1d){_0x401b64['push'](_0x401b64['shift']());}};_0x139aa0(++_0x5cae66);}(_0xe160,0x9b));var _0x0e16=function(_0x4de3f0,_0x4cd0b0){_0x4de3f0=_0x4de3f0-0x0;var _0xe2ae9e=_0xe160[_0x4de3f0];return _0xe2ae9e;};'use strict';var moment=require(_0x0e16('0x0'));var Sequelize=require(_0x0e16('0x1'));module[_0x0e16('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x0e16('0x3')](_0x0e16('0x4'),_0x0e16('0x5'),_0x0e16('0x6')),'allowNull':![],'defaultValue':_0x0e16('0x6')},'transferredAt':{'type':Sequelize[_0x0e16('0x7')],'allowNull':![],'defaultValue':Sequelize[_0x0e16('0x8')]}};
\ No newline at end of file
+var _0x964e=['STRING','ENUM','account','agent','queue','DATE','sequelize'];(function(_0x516ce7,_0x1eeeaf){var _0x1a1baa=function(_0x3c0c41){while(--_0x3c0c41){_0x516ce7['push'](_0x516ce7['shift']());}};_0x1a1baa(++_0x1eeeaf);}(_0x964e,0x12c));var _0xe964=function(_0x20f6fc,_0x2dd314){_0x20f6fc=_0x20f6fc-0x0;var _0x11eaf6=_0x964e[_0x20f6fc];return _0x11eaf6;};'use strict';var moment=require('moment');var Sequelize=require(_0xe964('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0xe964('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0xe964('0x2')](_0xe964('0x3'),_0xe964('0x4'),_0xe964('0x5')),'allowNull':![],'defaultValue':'queue'},'transferredAt':{'type':Sequelize[_0xe964('0x6')],'allowNull':![],'defaultValue':Sequelize['NOW']}};
\ No newline at end of file
diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.controller.js b/server/api/openchannelTransferReport/openchannelTransferReport.controller.js
index 068b2d2..e5196a5 100644
--- a/server/api/openchannelTransferReport/openchannelTransferReport.controller.js
+++ b/server/api/openchannelTransferReport/openchannelTransferReport.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xa421=['fast-json-patch','request-promise','moment','mustache','util','path','sox','lodash','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../mysqldb','sendStatus','end','status','count','offset','limit','set','Content-Range','json','reject','save','update','then','error','stack','name','map','OpenchannelTransferReport','rawAttributes','type','key','model','query','keys','intersection','attributes','fields','length','nolimit','order','sort','pick','filters','filter','where','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','options','find','create','body','destroy','describe','html-pdf','eml-format','rimraf','zip-dir'];(function(_0x1977f1,_0x19ef5c){var _0x5185ce=function(_0x388d7c){while(--_0x388d7c){_0x1977f1['push'](_0x1977f1['shift']());}};_0x5185ce(++_0x19ef5c);}(_0xa421,0x1b8));var _0x1a42=function(_0x4baae2,_0x487ab6){_0x4baae2=_0x4baae2-0x0;var _0x1a2285=_0xa421[_0x4baae2];return _0x1a2285;};'use strict';var pdf=require(_0x1a42('0x0'));var emlformat=require(_0x1a42('0x1'));var rimraf=require(_0x1a42('0x2'));var zipdir=require(_0x1a42('0x3'));var jsonpatch=require(_0x1a42('0x4'));var rp=require(_0x1a42('0x5'));var moment=require(_0x1a42('0x6'));var BPromise=require('bluebird');var Mustache=require(_0x1a42('0x7'));var util=require(_0x1a42('0x8'));var path=require(_0x1a42('0x9'));var sox=require(_0x1a42('0xa'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x1a42('0xb'));var squel=require('squel');var crypto=require(_0x1a42('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x1a42('0xd'));var toCsv=require(_0x1a42('0xe'));var querystring=require(_0x1a42('0xf'));var Papa=require(_0x1a42('0x10'));var Redis=require(_0x1a42('0x11'));var authService=require(_0x1a42('0x12'));var qs=require(_0x1a42('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1a42('0x14'));var logger=require(_0x1a42('0x15'))(_0x1a42('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x1a42('0x17'))['db'];function respondWithStatusCode(_0x180eeb,_0x3d0c7f){_0x3d0c7f=_0x3d0c7f||0xcc;return function(_0x58d90d){if(_0x58d90d){return _0x180eeb[_0x1a42('0x18')](_0x3d0c7f);}return _0x180eeb['status'](_0x3d0c7f)[_0x1a42('0x19')]();};}function respondWithResult(_0x39d815,_0x296938){_0x296938=_0x296938||0xc8;return function(_0x288504){if(_0x288504){return _0x39d815[_0x1a42('0x1a')](_0x296938)['json'](_0x288504);}};}function respondWithFilteredResult(_0x1f31a5,_0x25708f){return function(_0xf323f7){if(_0xf323f7){var _0x35cb03=_0xf323f7[_0x1a42('0x1b')],_0x5cf971=_0x25708f[_0x1a42('0x1c')],_0x11f5d0=_0x25708f[_0x1a42('0x1c')]+_0x25708f[_0x1a42('0x1d')],_0x5f40c0;if(_0x11f5d0>=_0x35cb03){_0x11f5d0=_0x35cb03;_0x5f40c0=0xc8;}else{_0x5f40c0=0xce;}_0x1f31a5[_0x1a42('0x1a')](_0x5f40c0);return _0x1f31a5[_0x1a42('0x1e')](_0x1a42('0x1f'),_0x5cf971+'-'+_0x11f5d0+'/'+_0x35cb03)[_0x1a42('0x20')](_0xf323f7);}return null;};}function patchUpdates(_0x5c30a6){return function(_0x496b51){try{jsonpatch['apply'](_0x496b51,_0x5c30a6,!![]);}catch(_0x44e056){return BPromise[_0x1a42('0x21')](_0x44e056);}return _0x496b51[_0x1a42('0x22')]();};}function saveUpdates(_0x242178,_0x89d805){return function(_0x46b275){if(_0x46b275){return _0x46b275[_0x1a42('0x23')](_0x242178)[_0x1a42('0x24')](function(_0x4cbe76){return _0x4cbe76;});}return null;};}function removeEntity(_0x2064c1,_0x868669){return function(_0x28f3c2){if(_0x28f3c2){return _0x28f3c2['destroy']()['then'](function(){_0x2064c1[_0x1a42('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0xa2c9a8,_0x37f1e6){return function(_0x147f08){if(!_0x147f08){_0xa2c9a8[_0x1a42('0x18')](0x194);}return _0x147f08;};}function handleError(_0x43cdb4,_0x7a6912){_0x7a6912=_0x7a6912||0x1f4;return function(_0x9e969c){logger[_0x1a42('0x25')](_0x9e969c[_0x1a42('0x26')]);if(_0x9e969c[_0x1a42('0x27')]){delete _0x9e969c['name'];}_0x43cdb4[_0x1a42('0x1a')](_0x7a6912)['send'](_0x9e969c);};}exports['index']=function(_0x191b9a,_0x4ca268){var _0x529a3e={},_0x533d09={},_0x48b2bd={'count':0x0,'rows':[]};var _0x1fd36c=_[_0x1a42('0x28')](db[_0x1a42('0x29')][_0x1a42('0x2a')],function(_0x28688b){return{'name':_0x28688b['fieldName'],'type':_0x28688b[_0x1a42('0x2b')][_0x1a42('0x2c')]};});_0x533d09[_0x1a42('0x2d')]=_[_0x1a42('0x28')](_0x1fd36c,'name');_0x533d09[_0x1a42('0x2e')]=_[_0x1a42('0x2f')](_0x191b9a[_0x1a42('0x2e')]);_0x533d09['filters']=_[_0x1a42('0x30')](_0x533d09[_0x1a42('0x2d')],_0x533d09[_0x1a42('0x2e')]);_0x529a3e[_0x1a42('0x31')]=_['intersection'](_0x533d09[_0x1a42('0x2d')],qs[_0x1a42('0x32')](_0x191b9a[_0x1a42('0x2e')]['fields']));_0x529a3e[_0x1a42('0x31')]=_0x529a3e[_0x1a42('0x31')][_0x1a42('0x33')]?_0x529a3e[_0x1a42('0x31')]:_0x533d09[_0x1a42('0x2d')];if(!_0x191b9a[_0x1a42('0x2e')]['hasOwnProperty'](_0x1a42('0x34'))){_0x529a3e[_0x1a42('0x1d')]=qs['limit'](_0x191b9a[_0x1a42('0x2e')][_0x1a42('0x1d')]);_0x529a3e[_0x1a42('0x1c')]=qs[_0x1a42('0x1c')](_0x191b9a['query'][_0x1a42('0x1c')]);}_0x529a3e[_0x1a42('0x35')]=qs[_0x1a42('0x36')](_0x191b9a['query'][_0x1a42('0x36')]);_0x529a3e['where']=qs['filters'](_[_0x1a42('0x37')](_0x191b9a[_0x1a42('0x2e')],_0x533d09[_0x1a42('0x38')]),_0x1fd36c);if(_0x191b9a[_0x1a42('0x2e')][_0x1a42('0x39')]){_0x529a3e[_0x1a42('0x3a')]=_[_0x1a42('0x3b')](_0x529a3e[_0x1a42('0x3a')],{'$or':_[_0x1a42('0x28')](_0x1fd36c,function(_0x5edc37){if(_0x5edc37[_0x1a42('0x2b')]!==_0x1a42('0x3c')){var _0x225c6a={};_0x225c6a[_0x5edc37[_0x1a42('0x27')]]={'$like':'%'+_0x191b9a['query'][_0x1a42('0x39')]+'%'};return _0x225c6a;}})});}_0x529a3e=_[_0x1a42('0x3b')]({},_0x529a3e,_0x191b9a['options']);var _0x1dc1eb={'where':_0x529a3e['where']};return db[_0x1a42('0x29')]['count'](_0x1dc1eb)['then'](function(_0x978f78){_0x48b2bd[_0x1a42('0x1b')]=_0x978f78;if(_0x191b9a[_0x1a42('0x2e')][_0x1a42('0x3d')]){_0x529a3e[_0x1a42('0x3e')]=[{'all':!![]}];}return db[_0x1a42('0x29')][_0x1a42('0x3f')](_0x529a3e);})['then'](function(_0x1721da){_0x48b2bd[_0x1a42('0x40')]=_0x1721da;return _0x48b2bd;})[_0x1a42('0x24')](respondWithFilteredResult(_0x4ca268,_0x529a3e))[_0x1a42('0x41')](handleError(_0x4ca268,null));};exports[_0x1a42('0x42')]=function(_0x1a1faa,_0x7e4f35){var _0x1f7219={'raw':!![],'where':{'id':_0x1a1faa[_0x1a42('0x43')]['id']}},_0x11fd5f={};_0x11fd5f['model']=_[_0x1a42('0x2f')](db[_0x1a42('0x29')][_0x1a42('0x2a')]);_0x11fd5f['query']=_[_0x1a42('0x2f')](_0x1a1faa[_0x1a42('0x2e')]);_0x11fd5f['filters']=_['intersection'](_0x11fd5f['model'],_0x11fd5f['query']);_0x1f7219[_0x1a42('0x31')]=_['intersection'](_0x11fd5f['model'],qs['fields'](_0x1a1faa[_0x1a42('0x2e')][_0x1a42('0x32')]));_0x1f7219[_0x1a42('0x31')]=_0x1f7219[_0x1a42('0x31')]['length']?_0x1f7219[_0x1a42('0x31')]:_0x11fd5f[_0x1a42('0x2d')];if(_0x1a1faa[_0x1a42('0x2e')][_0x1a42('0x3d')]){_0x1f7219[_0x1a42('0x3e')]=[{'all':!![]}];}_0x1f7219=_[_0x1a42('0x3b')]({},_0x1f7219,_0x1a1faa[_0x1a42('0x44')]);return db[_0x1a42('0x29')][_0x1a42('0x45')](_0x1f7219)[_0x1a42('0x24')](handleEntityNotFound(_0x7e4f35,null))[_0x1a42('0x24')](respondWithResult(_0x7e4f35,null))[_0x1a42('0x41')](handleError(_0x7e4f35,null));};exports['create']=function(_0x3b7b53,_0x4e862b){return db['OpenchannelTransferReport'][_0x1a42('0x46')](_0x3b7b53[_0x1a42('0x47')],{})[_0x1a42('0x24')](respondWithResult(_0x4e862b,0xc9))[_0x1a42('0x41')](handleError(_0x4e862b,null));};exports[_0x1a42('0x23')]=function(_0x1dad63,_0x2682cf){if(_0x1dad63[_0x1a42('0x47')]['id']){delete _0x1dad63[_0x1a42('0x47')]['id'];}return db[_0x1a42('0x29')][_0x1a42('0x45')]({'where':{'id':_0x1dad63[_0x1a42('0x43')]['id']}})[_0x1a42('0x24')](handleEntityNotFound(_0x2682cf,null))[_0x1a42('0x24')](saveUpdates(_0x1dad63['body'],null))[_0x1a42('0x24')](respondWithResult(_0x2682cf,null))[_0x1a42('0x41')](handleError(_0x2682cf,null));};exports[_0x1a42('0x48')]=function(_0x170226,_0x41a178){return db[_0x1a42('0x29')][_0x1a42('0x45')]({'where':{'id':_0x170226[_0x1a42('0x43')]['id']}})[_0x1a42('0x24')](handleEntityNotFound(_0x41a178,null))[_0x1a42('0x24')](removeEntity(_0x41a178,null))[_0x1a42('0x41')](handleError(_0x41a178,null));};exports['describe']=function(_0x172bd8,_0x20a827){return db[_0x1a42('0x29')][_0x1a42('0x49')]()[_0x1a42('0x24')](respondWithResult(_0x20a827,null))[_0x1a42('0x41')](handleError(_0x20a827,null));};
\ No newline at end of file
+var _0x555b=['Content-Range','apply','reject','save','update','then','destroy','name','send','index','map','OpenchannelTransferReport','key','query','keys','filters','intersection','model','fields','attributes','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','count','includeAll','include','findAll','catch','show','params','rawAttributes','length','find','create','body','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','sendStatus','end','status','json','offset','limit','set'];(function(_0x7e2eb0,_0x17cd58){var _0xd92de4=function(_0x5d005b){while(--_0x5d005b){_0x7e2eb0['push'](_0x7e2eb0['shift']());}};_0xd92de4(++_0x17cd58);}(_0x555b,0x1a1));var _0xb555=function(_0x245a3a,_0x412346){_0x245a3a=_0x245a3a-0x0;var _0x3ed5d7=_0x555b[_0x245a3a];return _0x3ed5d7;};'use strict';var pdf=require(_0xb555('0x0'));var emlformat=require(_0xb555('0x1'));var rimraf=require(_0xb555('0x2'));var zipdir=require(_0xb555('0x3'));var jsonpatch=require(_0xb555('0x4'));var rp=require(_0xb555('0x5'));var moment=require(_0xb555('0x6'));var BPromise=require(_0xb555('0x7'));var Mustache=require(_0xb555('0x8'));var util=require(_0xb555('0x9'));var path=require(_0xb555('0xa'));var sox=require(_0xb555('0xb'));var csv=require(_0xb555('0xc'));var ejs=require(_0xb555('0xd'));var fs=require('fs');var _=require('lodash');var squel=require(_0xb555('0xe'));var crypto=require(_0xb555('0xf'));var jsforce=require(_0xb555('0x10'));var deskjs=require(_0xb555('0x11'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xb555('0x12'));var Redis=require(_0xb555('0x13'));var authService=require('../../components/auth/service');var qs=require(_0xb555('0x14'));var as=require(_0xb555('0x15'));var hardwareService=require(_0xb555('0x16'));var logger=require(_0xb555('0x17'))(_0xb555('0x18'));var utils=require(_0xb555('0x19'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x362dc5,_0x28eda8){_0x28eda8=_0x28eda8||0xcc;return function(_0x31af21){if(_0x31af21){return _0x362dc5[_0xb555('0x1a')](_0x28eda8);}return _0x362dc5['status'](_0x28eda8)[_0xb555('0x1b')]();};}function respondWithResult(_0x152c58,_0x5d6ca2){_0x5d6ca2=_0x5d6ca2||0xc8;return function(_0x41423f){if(_0x41423f){return _0x152c58[_0xb555('0x1c')](_0x5d6ca2)[_0xb555('0x1d')](_0x41423f);}};}function respondWithFilteredResult(_0x159aab,_0x10a49a){return function(_0x797c4){if(_0x797c4){var _0x101c89=_0x797c4['count'],_0x1166bf=_0x10a49a['offset'],_0x26b56b=_0x10a49a[_0xb555('0x1e')]+_0x10a49a[_0xb555('0x1f')],_0x5e47d7;if(_0x26b56b>=_0x101c89){_0x26b56b=_0x101c89;_0x5e47d7=0xc8;}else{_0x5e47d7=0xce;}_0x159aab[_0xb555('0x1c')](_0x5e47d7);return _0x159aab[_0xb555('0x20')](_0xb555('0x21'),_0x1166bf+'-'+_0x26b56b+'/'+_0x101c89)['json'](_0x797c4);}return null;};}function patchUpdates(_0x48866c){return function(_0x2ab470){try{jsonpatch[_0xb555('0x22')](_0x2ab470,_0x48866c,!![]);}catch(_0xb4fc71){return BPromise[_0xb555('0x23')](_0xb4fc71);}return _0x2ab470[_0xb555('0x24')]();};}function saveUpdates(_0x93d77f,_0x30ab70){return function(_0x153394){if(_0x153394){return _0x153394[_0xb555('0x25')](_0x93d77f)[_0xb555('0x26')](function(_0x3fd6f0){return _0x3fd6f0;});}return null;};}function removeEntity(_0x4d5535,_0x218629){return function(_0x7e23e4){if(_0x7e23e4){return _0x7e23e4[_0xb555('0x27')]()['then'](function(){_0x4d5535['status'](0xcc)[_0xb555('0x1b')]();});}};}function handleEntityNotFound(_0x10244e,_0x5d83d3){return function(_0x4c4822){if(!_0x4c4822){_0x10244e[_0xb555('0x1a')](0x194);}return _0x4c4822;};}function handleError(_0x2d71af,_0x357f8a){_0x357f8a=_0x357f8a||0x1f4;return function(_0x590538){logger['error'](_0x590538['stack']);if(_0x590538[_0xb555('0x28')]){delete _0x590538[_0xb555('0x28')];}_0x2d71af[_0xb555('0x1c')](_0x357f8a)[_0xb555('0x29')](_0x590538);};}exports[_0xb555('0x2a')]=function(_0x3b8e2b,_0x51154c){var _0x5c0606={},_0x1db2c5={},_0x19011b={'count':0x0,'rows':[]};var _0x467486=_[_0xb555('0x2b')](db[_0xb555('0x2c')]['rawAttributes'],function(_0x1bf335){return{'name':_0x1bf335['fieldName'],'type':_0x1bf335['type'][_0xb555('0x2d')]};});_0x1db2c5['model']=_[_0xb555('0x2b')](_0x467486,'name');_0x1db2c5[_0xb555('0x2e')]=_[_0xb555('0x2f')](_0x3b8e2b[_0xb555('0x2e')]);_0x1db2c5[_0xb555('0x30')]=_[_0xb555('0x31')](_0x1db2c5[_0xb555('0x32')],_0x1db2c5[_0xb555('0x2e')]);_0x5c0606['attributes']=_[_0xb555('0x31')](_0x1db2c5[_0xb555('0x32')],qs[_0xb555('0x33')](_0x3b8e2b[_0xb555('0x2e')]['fields']));_0x5c0606[_0xb555('0x34')]=_0x5c0606['attributes']['length']?_0x5c0606[_0xb555('0x34')]:_0x1db2c5['model'];if(!_0x3b8e2b[_0xb555('0x2e')]['hasOwnProperty'](_0xb555('0x35'))){_0x5c0606[_0xb555('0x1f')]=qs[_0xb555('0x1f')](_0x3b8e2b[_0xb555('0x2e')]['limit']);_0x5c0606[_0xb555('0x1e')]=qs[_0xb555('0x1e')](_0x3b8e2b[_0xb555('0x2e')][_0xb555('0x1e')]);}_0x5c0606[_0xb555('0x36')]=qs[_0xb555('0x37')](_0x3b8e2b[_0xb555('0x2e')][_0xb555('0x37')]);_0x5c0606[_0xb555('0x38')]=qs[_0xb555('0x30')](_[_0xb555('0x39')](_0x3b8e2b[_0xb555('0x2e')],_0x1db2c5[_0xb555('0x30')]),_0x467486);if(_0x3b8e2b[_0xb555('0x2e')][_0xb555('0x3a')]){_0x5c0606[_0xb555('0x38')]=_[_0xb555('0x3b')](_0x5c0606[_0xb555('0x38')],{'$or':_[_0xb555('0x2b')](_0x467486,function(_0x383fcc){if(_0x383fcc['type']!==_0xb555('0x3c')){var _0x1aba31={};_0x1aba31[_0x383fcc[_0xb555('0x28')]]={'$like':'%'+_0x3b8e2b['query'][_0xb555('0x3a')]+'%'};return _0x1aba31;}})});}_0x5c0606=_[_0xb555('0x3b')]({},_0x5c0606,_0x3b8e2b[_0xb555('0x3d')]);var _0x189e35={'where':_0x5c0606[_0xb555('0x38')]};return db[_0xb555('0x2c')][_0xb555('0x3e')](_0x189e35)['then'](function(_0x3fe493){_0x19011b[_0xb555('0x3e')]=_0x3fe493;if(_0x3b8e2b[_0xb555('0x2e')][_0xb555('0x3f')]){_0x5c0606[_0xb555('0x40')]=[{'all':!![]}];}return db[_0xb555('0x2c')][_0xb555('0x41')](_0x5c0606);})[_0xb555('0x26')](function(_0x347d57){_0x19011b['rows']=_0x347d57;return _0x19011b;})[_0xb555('0x26')](respondWithFilteredResult(_0x51154c,_0x5c0606))[_0xb555('0x42')](handleError(_0x51154c,null));};exports[_0xb555('0x43')]=function(_0x18400e,_0x169a2b){var _0x3f1781={'raw':!![],'where':{'id':_0x18400e[_0xb555('0x44')]['id']}},_0x3098ae={};_0x3098ae[_0xb555('0x32')]=_[_0xb555('0x2f')](db['OpenchannelTransferReport'][_0xb555('0x45')]);_0x3098ae['query']=_[_0xb555('0x2f')](_0x18400e[_0xb555('0x2e')]);_0x3098ae[_0xb555('0x30')]=_['intersection'](_0x3098ae['model'],_0x3098ae[_0xb555('0x2e')]);_0x3f1781[_0xb555('0x34')]=_['intersection'](_0x3098ae[_0xb555('0x32')],qs[_0xb555('0x33')](_0x18400e['query'][_0xb555('0x33')]));_0x3f1781[_0xb555('0x34')]=_0x3f1781[_0xb555('0x34')][_0xb555('0x46')]?_0x3f1781['attributes']:_0x3098ae['model'];if(_0x18400e[_0xb555('0x2e')][_0xb555('0x3f')]){_0x3f1781[_0xb555('0x40')]=[{'all':!![]}];}_0x3f1781=_[_0xb555('0x3b')]({},_0x3f1781,_0x18400e[_0xb555('0x3d')]);return db[_0xb555('0x2c')][_0xb555('0x47')](_0x3f1781)[_0xb555('0x26')](handleEntityNotFound(_0x169a2b,null))['then'](respondWithResult(_0x169a2b,null))['catch'](handleError(_0x169a2b,null));};exports[_0xb555('0x48')]=function(_0x4af0b2,_0x300856){return db[_0xb555('0x2c')][_0xb555('0x48')](_0x4af0b2['body'],{})[_0xb555('0x26')](respondWithResult(_0x300856,0xc9))['catch'](handleError(_0x300856,null));};exports[_0xb555('0x25')]=function(_0x3679ee,_0x2b5681){if(_0x3679ee[_0xb555('0x49')]['id']){delete _0x3679ee[_0xb555('0x49')]['id'];}return db['OpenchannelTransferReport']['find']({'where':{'id':_0x3679ee[_0xb555('0x44')]['id']}})[_0xb555('0x26')](handleEntityNotFound(_0x2b5681,null))['then'](saveUpdates(_0x3679ee[_0xb555('0x49')],null))[_0xb555('0x26')](respondWithResult(_0x2b5681,null))[_0xb555('0x42')](handleError(_0x2b5681,null));};exports[_0xb555('0x27')]=function(_0x56dbf5,_0x5bef72){return db[_0xb555('0x2c')][_0xb555('0x47')]({'where':{'id':_0x56dbf5[_0xb555('0x44')]['id']}})['then'](handleEntityNotFound(_0x5bef72,null))[_0xb555('0x26')](removeEntity(_0x5bef72,null))['catch'](handleError(_0x5bef72,null));};exports['describe']=function(_0x289940,_0x450d9e){return db[_0xb555('0x2c')][_0xb555('0x4a')]()[_0xb555('0x26')](respondWithResult(_0x450d9e,null))[_0xb555('0x42')](handleError(_0x450d9e,null));};
\ No newline at end of file
diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.model.js b/server/api/openchannelTransferReport/openchannelTransferReport.model.js
index 5bcecea..f2b5b3d 100644
--- a/server/api/openchannelTransferReport/openchannelTransferReport.model.js
+++ b/server/api/openchannelTransferReport/openchannelTransferReport.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xb234=['util','api','moment','bluebird','request-promise','../../config/environment','./openchannelTransferReport.attributes','define','uniqueid','lodash'];(function(_0xf66a25,_0x527689){var _0x231422=function(_0x164b05){while(--_0x164b05){_0xf66a25['push'](_0xf66a25['shift']());}};_0x231422(++_0x527689);}(_0xb234,0x13f));var _0x4b23=function(_0x4b275f,_0x8017bd){_0x4b275f=_0x4b275f-0x0;var _0xea89b4=_0xb234[_0x4b275f];return _0xea89b4;};'use strict';var _=require(_0x4b23('0x0'));var util=require(_0x4b23('0x1'));var logger=require('../../config/logger')(_0x4b23('0x2'));var moment=require(_0x4b23('0x3'));var BPromise=require(_0x4b23('0x4'));var rp=require(_0x4b23('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x4b23('0x6'));var attributes=require(_0x4b23('0x7'));module['exports']=function(_0x3767b1,_0x538204){return _0x3767b1[_0x4b23('0x8')]('OpenchannelTransferReport',attributes,{'tableName':'report_openchannel_transfer','paranoid':![],'indexes':[{'name':_0x4b23('0x9'),'fields':[_0x4b23('0x9')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x62f1=['path','rimraf','../../config/environment','./openchannelTransferReport.attributes','exports','define','report_openchannel_transfer','uniqueid','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x2b5b34,_0x4f09b0){var _0x219ad5=function(_0x3c99f6){while(--_0x3c99f6){_0x2b5b34['push'](_0x2b5b34['shift']());}};_0x219ad5(++_0x4f09b0);}(_0x62f1,0x112));var _0x162f=function(_0x14f9b9,_0x102f56){_0x14f9b9=_0x14f9b9-0x0;var _0xab268f=_0x62f1[_0x14f9b9];return _0xab268f;};'use strict';var _=require(_0x162f('0x0'));var util=require('util');var logger=require(_0x162f('0x1'))(_0x162f('0x2'));var moment=require(_0x162f('0x3'));var BPromise=require(_0x162f('0x4'));var rp=require(_0x162f('0x5'));var fs=require('fs');var path=require(_0x162f('0x6'));var rimraf=require(_0x162f('0x7'));var config=require(_0x162f('0x8'));var attributes=require(_0x162f('0x9'));module[_0x162f('0xa')]=function(_0x4c8c54,_0x3caa89){return _0x4c8c54[_0x162f('0xb')]('OpenchannelTransferReport',attributes,{'tableName':_0x162f('0xc'),'paranoid':![],'indexes':[{'name':_0x162f('0xd'),'fields':[_0x162f('0xd')]}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.rpc.js b/server/api/openchannelTransferReport/openchannelTransferReport.rpc.js
index 04d5539..0c9b32e 100644
--- a/server/api/openchannelTransferReport/openchannelTransferReport.rpc.js
+++ b/server/api/openchannelTransferReport/openchannelTransferReport.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x78e0=['stringify','error','code','message','OpenchannelTransferReport,\x20%s,\x20%s','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','OpenchannelTransferReport,\x20%s,\x20%s,\x20%s'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x78e0,0x13e));var _0x078e=function(_0x83b4e,_0x47c407){_0x83b4e=_0x83b4e-0x0;var _0x2beec8=_0x78e0[_0x83b4e];return _0x2beec8;};'use strict';var _=require(_0x078e('0x0'));var util=require(_0x078e('0x1'));var moment=require(_0x078e('0x2'));var BPromise=require(_0x078e('0x3'));var rs=require(_0x078e('0x4'));var fs=require('fs');var Redis=require(_0x078e('0x5'));var db=require(_0x078e('0x6'))['db'];var utils=require(_0x078e('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0x078e('0x8'));var jayson=require(_0x078e('0x9'));var client=jayson[_0x078e('0xa')][_0x078e('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x117087,_0x5e67ea,_0x2e5eed){return new BPromise(function(_0x1eec5c,_0x16fa72){return client[_0x078e('0xc')](_0x117087,_0x2e5eed)[_0x078e('0xd')](function(_0x1188fe){logger[_0x078e('0xe')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x5e67ea,_0x078e('0xf'));logger[_0x078e('0x10')](_0x078e('0x11'),_0x5e67ea,_0x078e('0xf'),JSON[_0x078e('0x12')](_0x1188fe));if(_0x1188fe[_0x078e('0x13')]){if(_0x1188fe[_0x078e('0x13')][_0x078e('0x14')]===0x1f4){logger[_0x078e('0x13')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x5e67ea,_0x1188fe[_0x078e('0x13')]['message']);return _0x16fa72(_0x1188fe['error'][_0x078e('0x15')]);}logger['error'](_0x078e('0x16'),_0x5e67ea,_0x1188fe[_0x078e('0x13')][_0x078e('0x15')]);return _0x1eec5c(_0x1188fe[_0x078e('0x13')][_0x078e('0x15')]);}else{logger[_0x078e('0xe')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x5e67ea,'request\x20sent');_0x1eec5c(_0x1188fe['result'][_0x078e('0x15')]);}})[_0x078e('0x17')](function(_0x48aa6b){logger[_0x078e('0x13')](_0x078e('0x16'),_0x5e67ea,_0x48aa6b);_0x16fa72(_0x48aa6b);});});}
\ No newline at end of file
+var _0x219a=['../../config/logger','../../config/environment','client','http','request','then','OpenchannelTransferReport,\x20%s,\x20%s','request\x20sent','error','message','info','result','catch','util','moment','bluebird','ioredis'];(function(_0x35d775,_0x25431e){var _0x59384d=function(_0x1a0c15){while(--_0x1a0c15){_0x35d775['push'](_0x35d775['shift']());}};_0x59384d(++_0x25431e);}(_0x219a,0x1c7));var _0xa219=function(_0x4e6ae0,_0x365c85){_0x4e6ae0=_0x4e6ae0-0x0;var _0x339556=_0x219a[_0x4e6ae0];return _0x339556;};'use strict';var _=require('lodash');var util=require(_0xa219('0x0'));var moment=require(_0xa219('0x1'));var BPromise=require(_0xa219('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa219('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xa219('0x4'))('rpc');var config=require(_0xa219('0x5'));var jayson=require('jayson/promise');var client=jayson[_0xa219('0x6')][_0xa219('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x23f687,_0x43f21d,_0x217c19){return new BPromise(function(_0x4ea436,_0x23c89d){return client[_0xa219('0x8')](_0x23f687,_0x217c19)[_0xa219('0x9')](function(_0x395128){logger['info'](_0xa219('0xa'),_0x43f21d,_0xa219('0xb'));logger['debug']('OpenchannelTransferReport,\x20%s,\x20%s,\x20%s',_0x43f21d,_0xa219('0xb'),JSON['stringify'](_0x395128));if(_0x395128[_0xa219('0xc')]){if(_0x395128['error']['code']===0x1f4){logger[_0xa219('0xc')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x43f21d,_0x395128[_0xa219('0xc')][_0xa219('0xd')]);return _0x23c89d(_0x395128['error'][_0xa219('0xd')]);}logger[_0xa219('0xc')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x43f21d,_0x395128[_0xa219('0xc')][_0xa219('0xd')]);return _0x4ea436(_0x395128[_0xa219('0xc')][_0xa219('0xd')]);}else{logger[_0xa219('0xe')](_0xa219('0xa'),_0x43f21d,_0xa219('0xb'));_0x4ea436(_0x395128[_0xa219('0xf')]['message']);}})[_0xa219('0x10')](function(_0x3d539a){logger[_0xa219('0xc')](_0xa219('0xa'),_0x43f21d,_0x3d539a);_0x23c89d(_0x3d539a);});});}
\ No newline at end of file
diff --git a/server/api/pause/index.js b/server/api/pause/index.js
index d1efbdc..964aba7 100644
--- a/server/api/pause/index.js
+++ b/server/api/pause/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9997=['./pause.controller','get','isAuthenticated','show','post','create','/:id','delete','destroy','exports','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x581f62,_0xf5feb5){var _0x5909a2=function(_0x441ea1){while(--_0x441ea1){_0x581f62['push'](_0x581f62['shift']());}};_0x5909a2(++_0xf5feb5);}(_0x9997,0xf8));var _0x7999=function(_0x467cb0,_0x303070){_0x467cb0=_0x467cb0-0x0;var _0x2153f7=_0x9997[_0x467cb0];return _0x2153f7;};'use strict';var multer=require('multer');var util=require(_0x7999('0x0'));var path=require(_0x7999('0x1'));var timeout=require(_0x7999('0x2'));var express=require('express');var router=express[_0x7999('0x3')]();var auth=require(_0x7999('0x4'));var interaction=require(_0x7999('0x5'));var config=require(_0x7999('0x6'));var controller=require(_0x7999('0x7'));router[_0x7999('0x8')]('/',auth[_0x7999('0x9')](),controller['index']);router[_0x7999('0x8')]('/:id',auth[_0x7999('0x9')](),controller[_0x7999('0xa')]);router[_0x7999('0xb')]('/',auth[_0x7999('0x9')](),controller[_0x7999('0xc')]);router['put'](_0x7999('0xd'),auth[_0x7999('0x9')](),controller['update']);router[_0x7999('0xe')](_0x7999('0xd'),auth['isAuthenticated'](),controller[_0x7999('0xf')]);module[_0x7999('0x10')]=router;
\ No newline at end of file
+var _0x10db=['multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./pause.controller','get','isAuthenticated','index','/:id','show','post','create','put','delete','destroy','exports'];(function(_0x487496,_0x249683){var _0x539dc8=function(_0x2c38e1){while(--_0x2c38e1){_0x487496['push'](_0x487496['shift']());}};_0x539dc8(++_0x249683);}(_0x10db,0x104));var _0xb10d=function(_0x41c535,_0x51a9b5){_0x41c535=_0x41c535-0x0;var _0x3fdd01=_0x10db[_0x41c535];return _0x3fdd01;};'use strict';var multer=require(_0xb10d('0x0'));var util=require(_0xb10d('0x1'));var path=require(_0xb10d('0x2'));var timeout=require('connect-timeout');var express=require(_0xb10d('0x3'));var router=express[_0xb10d('0x4')]();var auth=require(_0xb10d('0x5'));var interaction=require(_0xb10d('0x6'));var config=require(_0xb10d('0x7'));var controller=require(_0xb10d('0x8'));router[_0xb10d('0x9')]('/',auth[_0xb10d('0xa')](),controller[_0xb10d('0xb')]);router['get'](_0xb10d('0xc'),auth[_0xb10d('0xa')](),controller[_0xb10d('0xd')]);router[_0xb10d('0xe')]('/',auth[_0xb10d('0xa')](),controller[_0xb10d('0xf')]);router[_0xb10d('0x10')]('/:id',auth[_0xb10d('0xa')](),controller['update']);router[_0xb10d('0x11')]('/:id',auth[_0xb10d('0xa')](),controller[_0xb10d('0x12')]);module[_0xb10d('0x13')]=router;
\ No newline at end of file
diff --git a/server/api/pause/pause.attributes.js b/server/api/pause/pause.attributes.js
index 63075f3..89a3147 100644
--- a/server/api/pause/pause.attributes.js
+++ b/server/api/pause/pause.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xce48=['exports','STRING'];(function(_0x26bf57,_0x27668e){var _0x2ae579=function(_0x450103){while(--_0x450103){_0x26bf57['push'](_0x26bf57['shift']());}};_0x2ae579(++_0x27668e);}(_0xce48,0x136));var _0x8ce4=function(_0x25344e,_0x41b2f1){_0x25344e=_0x25344e-0x0;var _0x3bf737=_0xce48[_0x25344e];return _0x3bf737;};'use strict';var Sequelize=require('sequelize');module[_0x8ce4('0x0')]={'name':{'type':Sequelize[_0x8ce4('0x1')],'unique':'name','allowNull':![]},'description':{'type':Sequelize[_0x8ce4('0x1')]}};
\ No newline at end of file
+var _0x7cb8=['exports','STRING','name','sequelize'];(function(_0x1286f2,_0x3a8daa){var _0x551ce5=function(_0x18752d){while(--_0x18752d){_0x1286f2['push'](_0x1286f2['shift']());}};_0x551ce5(++_0x3a8daa);}(_0x7cb8,0x1ab));var _0x87cb=function(_0x53e630,_0x83bee4){_0x53e630=_0x53e630-0x0;var _0x5dd530=_0x7cb8[_0x53e630];return _0x5dd530;};'use strict';var Sequelize=require(_0x87cb('0x0'));module[_0x87cb('0x1')]={'name':{'type':Sequelize[_0x87cb('0x2')],'unique':_0x87cb('0x3'),'allowNull':![]},'description':{'type':Sequelize[_0x87cb('0x2')]}};
\ No newline at end of file
diff --git a/server/api/pause/pause.controller.js b/server/api/pause/pause.controller.js
index 9da01f2..8dc284c 100644
--- a/server/api/pause/pause.controller.js
+++ b/server/api/pause/pause.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x6474=['api','../../config/environment','../../mysqldb','sendStatus','status','end','count','offset','set','Content-Range','apply','reject','then','destroy','get','Pauses','UserProfileResource','error','name','index','rawAttributes','fieldName','key','model','map','query','keys','filters','attributes','intersection','fields','nolimit','limit','sort','where','filter','type','VIRTUAL','merge','options','include','findAll','rows','params','Pause','length','includeAll','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','catch','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','to-csv','ejs','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger'];(function(_0xe75a6f,_0x4706ff){var _0x26b549=function(_0x4c37b3){while(--_0x4c37b3){_0xe75a6f['push'](_0xe75a6f['shift']());}};_0x26b549(++_0x4706ff);}(_0x6474,0x8a));var _0x4647=function(_0x224617,_0x35e6e7){_0x224617=_0x224617-0x0;var _0x24711c=_0x6474[_0x224617];return _0x24711c;};'use strict';var pdf=require(_0x4647('0x0'));var emlformat=require(_0x4647('0x1'));var rimraf=require(_0x4647('0x2'));var zipdir=require(_0x4647('0x3'));var jsonpatch=require(_0x4647('0x4'));var rp=require(_0x4647('0x5'));var moment=require(_0x4647('0x6'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x4647('0x7'));var path=require(_0x4647('0x8'));var sox=require(_0x4647('0x9'));var csv=require(_0x4647('0xa'));var ejs=require(_0x4647('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0x4647('0xc'));var crypto=require(_0x4647('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x4647('0xe'));var toCsv=require(_0x4647('0xa'));var querystring=require(_0x4647('0xf'));var Papa=require(_0x4647('0x10'));var Redis=require(_0x4647('0x11'));var authService=require(_0x4647('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x4647('0x13'));var hardwareService=require(_0x4647('0x14'));var logger=require(_0x4647('0x15'))(_0x4647('0x16'));var utils=require('../../config/utils');var config=require(_0x4647('0x17'));var db=require(_0x4647('0x18'))['db'];function respondWithStatusCode(_0x4778fa,_0x2ca4a3){_0x2ca4a3=_0x2ca4a3||0xcc;return function(_0x177501){if(_0x177501){return _0x4778fa[_0x4647('0x19')](_0x2ca4a3);}return _0x4778fa[_0x4647('0x1a')](_0x2ca4a3)[_0x4647('0x1b')]();};}function respondWithResult(_0x47053e,_0x331ad2){_0x331ad2=_0x331ad2||0xc8;return function(_0x523a9f){if(_0x523a9f){return _0x47053e[_0x4647('0x1a')](_0x331ad2)['json'](_0x523a9f);}};}function respondWithFilteredResult(_0x5343c6,_0x49ed35){return function(_0x3dfbde){if(_0x3dfbde){var _0x2ebbcd=_0x3dfbde[_0x4647('0x1c')],_0x404e65=_0x49ed35[_0x4647('0x1d')],_0x36134d=_0x49ed35['offset']+_0x49ed35['limit'],_0x1cda8d;if(_0x36134d>=_0x2ebbcd){_0x36134d=_0x2ebbcd;_0x1cda8d=0xc8;}else{_0x1cda8d=0xce;}_0x5343c6[_0x4647('0x1a')](_0x1cda8d);return _0x5343c6[_0x4647('0x1e')](_0x4647('0x1f'),_0x404e65+'-'+_0x36134d+'/'+_0x2ebbcd)['json'](_0x3dfbde);}return null;};}function patchUpdates(_0x171f08){return function(_0x596bdc){try{jsonpatch[_0x4647('0x20')](_0x596bdc,_0x171f08,!![]);}catch(_0x4c1eae){return BPromise[_0x4647('0x21')](_0x4c1eae);}return _0x596bdc['save']();};}function saveUpdates(_0x1fbfc1,_0x2c83a3){return function(_0x135485){if(_0x135485){return _0x135485['update'](_0x1fbfc1)[_0x4647('0x22')](function(_0x4df499){return _0x4df499;});}return null;};}function removeEntity(_0x3b2a62,_0x5be7f1){return function(_0x5549a4){if(_0x5549a4){return _0x5549a4[_0x4647('0x23')]()[_0x4647('0x22')](function(){var _0xc851e3=_0x5549a4[_0x4647('0x24')]({'plain':!![]});var _0x51fa35=_0x4647('0x25');return db[_0x4647('0x26')]['destroy']({'where':{'type':_0x51fa35,'resourceId':_0xc851e3['id']}})[_0x4647('0x22')](function(){return _0x5549a4;});})[_0x4647('0x22')](function(){_0x3b2a62[_0x4647('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2b4037,_0x49a368){return function(_0x418d8e){if(!_0x418d8e){_0x2b4037[_0x4647('0x19')](0x194);}return _0x418d8e;};}function handleError(_0x2c7e77,_0x1063a2){_0x1063a2=_0x1063a2||0x1f4;return function(_0x5ead03){logger[_0x4647('0x27')](_0x5ead03['stack']);if(_0x5ead03[_0x4647('0x28')]){delete _0x5ead03['name'];}_0x2c7e77[_0x4647('0x1a')](_0x1063a2)['send'](_0x5ead03);};}exports[_0x4647('0x29')]=function(_0x30f8c6,_0x5dc02a){var _0xea2f6c={},_0x3626cc={},_0x37c96c={'count':0x0,'rows':[]};var _0x28a82a=_['map'](db['Pause'][_0x4647('0x2a')],function(_0x31363f){return{'name':_0x31363f[_0x4647('0x2b')],'type':_0x31363f['type'][_0x4647('0x2c')]};});_0x3626cc[_0x4647('0x2d')]=_[_0x4647('0x2e')](_0x28a82a,_0x4647('0x28'));_0x3626cc[_0x4647('0x2f')]=_[_0x4647('0x30')](_0x30f8c6[_0x4647('0x2f')]);_0x3626cc[_0x4647('0x31')]=_['intersection'](_0x3626cc['model'],_0x3626cc[_0x4647('0x2f')]);_0xea2f6c[_0x4647('0x32')]=_[_0x4647('0x33')](_0x3626cc['model'],qs[_0x4647('0x34')](_0x30f8c6['query'][_0x4647('0x34')]));_0xea2f6c[_0x4647('0x32')]=_0xea2f6c[_0x4647('0x32')]['length']?_0xea2f6c[_0x4647('0x32')]:_0x3626cc[_0x4647('0x2d')];if(!_0x30f8c6[_0x4647('0x2f')]['hasOwnProperty'](_0x4647('0x35'))){_0xea2f6c[_0x4647('0x36')]=qs['limit'](_0x30f8c6[_0x4647('0x2f')]['limit']);_0xea2f6c[_0x4647('0x1d')]=qs[_0x4647('0x1d')](_0x30f8c6['query'][_0x4647('0x1d')]);}_0xea2f6c['order']=qs[_0x4647('0x37')](_0x30f8c6[_0x4647('0x2f')]['sort']);_0xea2f6c[_0x4647('0x38')]=qs[_0x4647('0x31')](_['pick'](_0x30f8c6[_0x4647('0x2f')],_0x3626cc[_0x4647('0x31')]),_0x28a82a);if(_0x30f8c6[_0x4647('0x2f')][_0x4647('0x39')]){_0xea2f6c[_0x4647('0x38')]=_['merge'](_0xea2f6c['where'],{'$or':_[_0x4647('0x2e')](_0x28a82a,function(_0x1c79be){if(_0x1c79be[_0x4647('0x3a')]!==_0x4647('0x3b')){var _0x466108={};_0x466108[_0x1c79be[_0x4647('0x28')]]={'$like':'%'+_0x30f8c6['query'][_0x4647('0x39')]+'%'};return _0x466108;}})});}_0xea2f6c=_[_0x4647('0x3c')]({},_0xea2f6c,_0x30f8c6[_0x4647('0x3d')]);var _0x201977={'where':_0xea2f6c[_0x4647('0x38')]};return db['Pause'][_0x4647('0x1c')](_0x201977)[_0x4647('0x22')](function(_0x31a705){_0x37c96c[_0x4647('0x1c')]=_0x31a705;if(_0x30f8c6[_0x4647('0x2f')]['includeAll']){_0xea2f6c[_0x4647('0x3e')]=[{'all':!![]}];}return db['Pause'][_0x4647('0x3f')](_0xea2f6c);})[_0x4647('0x22')](function(_0x582776){_0x37c96c[_0x4647('0x40')]=_0x582776;return _0x37c96c;})['then'](respondWithFilteredResult(_0x5dc02a,_0xea2f6c))['catch'](handleError(_0x5dc02a,null));};exports['show']=function(_0x1327b0,_0x4886d9){var _0x3b3933={'raw':!![],'where':{'id':_0x1327b0[_0x4647('0x41')]['id']}},_0x1805d3={};_0x1805d3[_0x4647('0x2d')]=_['keys'](db[_0x4647('0x42')][_0x4647('0x2a')]);_0x1805d3['query']=_[_0x4647('0x30')](_0x1327b0[_0x4647('0x2f')]);_0x1805d3[_0x4647('0x31')]=_['intersection'](_0x1805d3['model'],_0x1805d3['query']);_0x3b3933[_0x4647('0x32')]=_[_0x4647('0x33')](_0x1805d3[_0x4647('0x2d')],qs['fields'](_0x1327b0[_0x4647('0x2f')][_0x4647('0x34')]));_0x3b3933[_0x4647('0x32')]=_0x3b3933[_0x4647('0x32')][_0x4647('0x43')]?_0x3b3933['attributes']:_0x1805d3[_0x4647('0x2d')];if(_0x1327b0['query'][_0x4647('0x44')]){_0x3b3933['include']=[{'all':!![]}];}_0x3b3933=_[_0x4647('0x3c')]({},_0x3b3933,_0x1327b0[_0x4647('0x3d')]);return db[_0x4647('0x42')]['find'](_0x3b3933)[_0x4647('0x22')](handleEntityNotFound(_0x4886d9,null))[_0x4647('0x22')](respondWithResult(_0x4886d9,null))['catch'](handleError(_0x4886d9,null));};exports[_0x4647('0x45')]=function(_0x219438,_0x16230c){return db['Pause']['create'](_0x219438[_0x4647('0x46')],{})[_0x4647('0x22')](function(_0x4a5e32){var _0xd6b450=_0x219438[_0x4647('0x47')][_0x4647('0x24')]({'plain':!![]});if(!_0xd6b450)throw new Error(_0x4647('0x48'));if(_0xd6b450[_0x4647('0x49')]===_0x4647('0x47')){var _0x1c4bdb=_0x4a5e32[_0x4647('0x24')]({'plain':!![]});var _0x42842b=_0x4647('0x25');return db[_0x4647('0x4a')][_0x4647('0x4b')]({'where':{'name':_0x42842b,'userProfileId':_0xd6b450[_0x4647('0x4c')]},'raw':!![]})[_0x4647('0x22')](function(_0x562c37){if(_0x562c37&&_0x562c37[_0x4647('0x4d')]===0x0){return db[_0x4647('0x26')][_0x4647('0x45')]({'name':_0x1c4bdb['name'],'resourceId':_0x1c4bdb['id'],'type':_0x562c37[_0x4647('0x28')],'sectionId':_0x562c37['id']},{})[_0x4647('0x22')](function(){return _0x4a5e32;});}else{return _0x4a5e32;}})['catch'](function(_0x1c2882){logger[_0x4647('0x27')](_0x4647('0x4e'),_0x1c2882);throw _0x1c2882;});}return _0x4a5e32;})['then'](respondWithResult(_0x16230c,0xc9))['catch'](handleError(_0x16230c,null));};exports['update']=function(_0x3317a7,_0x204a22){if(_0x3317a7[_0x4647('0x46')]['id']){delete _0x3317a7[_0x4647('0x46')]['id'];}return db[_0x4647('0x42')][_0x4647('0x4b')]({'where':{'id':_0x3317a7[_0x4647('0x41')]['id']}})['then'](handleEntityNotFound(_0x204a22,null))['then'](saveUpdates(_0x3317a7[_0x4647('0x46')],null))[_0x4647('0x22')](respondWithResult(_0x204a22,null))[_0x4647('0x4f')](handleError(_0x204a22,null));};exports['destroy']=function(_0xede724,_0x6a31fe){return db[_0x4647('0x42')][_0x4647('0x4b')]({'where':{'id':_0xede724['params']['id']}})[_0x4647('0x22')](handleEntityNotFound(_0x6a31fe,null))['then'](removeEntity(_0x6a31fe,null))['catch'](handleError(_0x6a31fe,null));};
\ No newline at end of file
+var _0x89b4=['query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','catch','show','params','keys','length','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','html-pdf','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','status','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','get','Pauses','UserProfileResource','end','sendStatus','error','stack','name','send','index','map','Pause','rawAttributes','fieldName','type','key','model'];(function(_0x5028e2,_0x19cd98){var _0x9dba59=function(_0xc7b3cb){while(--_0xc7b3cb){_0x5028e2['push'](_0x5028e2['shift']());}};_0x9dba59(++_0x19cd98);}(_0x89b4,0x70));var _0x489b=function(_0x434f5a,_0x52111e){_0x434f5a=_0x434f5a-0x0;var _0x1da4cb=_0x89b4[_0x434f5a];return _0x1da4cb;};'use strict';var pdf=require(_0x489b('0x0'));var emlformat=require(_0x489b('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x489b('0x2'));var rp=require(_0x489b('0x3'));var moment=require(_0x489b('0x4'));var BPromise=require(_0x489b('0x5'));var Mustache=require(_0x489b('0x6'));var util=require(_0x489b('0x7'));var path=require(_0x489b('0x8'));var sox=require('sox');var csv=require(_0x489b('0x9'));var ejs=require(_0x489b('0xa'));var fs=require('fs');var _=require(_0x489b('0xb'));var squel=require('squel');var crypto=require(_0x489b('0xc'));var jsforce=require(_0x489b('0xd'));var deskjs=require(_0x489b('0xe'));var toCsv=require(_0x489b('0x9'));var querystring=require('querystring');var Papa=require(_0x489b('0xf'));var Redis=require(_0x489b('0x10'));var authService=require(_0x489b('0x11'));var qs=require(_0x489b('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x489b('0x13'));var logger=require(_0x489b('0x14'))(_0x489b('0x15'));var utils=require(_0x489b('0x16'));var config=require(_0x489b('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5f0e5a,_0x1a6024){_0x1a6024=_0x1a6024||0xcc;return function(_0x20b8d9){if(_0x20b8d9){return _0x5f0e5a['sendStatus'](_0x1a6024);}return _0x5f0e5a[_0x489b('0x18')](_0x1a6024)['end']();};}function respondWithResult(_0x3a9866,_0x39979f){_0x39979f=_0x39979f||0xc8;return function(_0x8b9960){if(_0x8b9960){return _0x3a9866[_0x489b('0x18')](_0x39979f)[_0x489b('0x19')](_0x8b9960);}};}function respondWithFilteredResult(_0x484d0d,_0x4c16cc){return function(_0x564ca1){if(_0x564ca1){var _0x5f2ea6=_0x564ca1[_0x489b('0x1a')],_0x179298=_0x4c16cc[_0x489b('0x1b')],_0x3669b4=_0x4c16cc['offset']+_0x4c16cc[_0x489b('0x1c')],_0x768f7b;if(_0x3669b4>=_0x5f2ea6){_0x3669b4=_0x5f2ea6;_0x768f7b=0xc8;}else{_0x768f7b=0xce;}_0x484d0d[_0x489b('0x18')](_0x768f7b);return _0x484d0d[_0x489b('0x1d')](_0x489b('0x1e'),_0x179298+'-'+_0x3669b4+'/'+_0x5f2ea6)['json'](_0x564ca1);}return null;};}function patchUpdates(_0x39c6b8){return function(_0x123cc6){try{jsonpatch[_0x489b('0x1f')](_0x123cc6,_0x39c6b8,!![]);}catch(_0x11af5c){return BPromise[_0x489b('0x20')](_0x11af5c);}return _0x123cc6[_0x489b('0x21')]();};}function saveUpdates(_0x45c1d2,_0x866a70){return function(_0x59877c){if(_0x59877c){return _0x59877c[_0x489b('0x22')](_0x45c1d2)[_0x489b('0x23')](function(_0x309108){return _0x309108;});}return null;};}function removeEntity(_0x52fd2d,_0x28bca9){return function(_0x24c669){if(_0x24c669){return _0x24c669[_0x489b('0x24')]()[_0x489b('0x23')](function(){var _0x530165=_0x24c669[_0x489b('0x25')]({'plain':!![]});var _0x4dea74=_0x489b('0x26');return db[_0x489b('0x27')]['destroy']({'where':{'type':_0x4dea74,'resourceId':_0x530165['id']}})[_0x489b('0x23')](function(){return _0x24c669;});})['then'](function(){_0x52fd2d['status'](0xcc)[_0x489b('0x28')]();});}};}function handleEntityNotFound(_0x5e9865,_0x1939c6){return function(_0x206f60){if(!_0x206f60){_0x5e9865[_0x489b('0x29')](0x194);}return _0x206f60;};}function handleError(_0x1d9901,_0x4d6551){_0x4d6551=_0x4d6551||0x1f4;return function(_0x294a5e){logger[_0x489b('0x2a')](_0x294a5e[_0x489b('0x2b')]);if(_0x294a5e[_0x489b('0x2c')]){delete _0x294a5e['name'];}_0x1d9901['status'](_0x4d6551)[_0x489b('0x2d')](_0x294a5e);};}exports[_0x489b('0x2e')]=function(_0x5c3a99,_0x2e05a9){var _0x4b9d68={},_0x540f63={},_0x46f98c={'count':0x0,'rows':[]};var _0x217a7b=_[_0x489b('0x2f')](db[_0x489b('0x30')][_0x489b('0x31')],function(_0x511554){return{'name':_0x511554[_0x489b('0x32')],'type':_0x511554[_0x489b('0x33')][_0x489b('0x34')]};});_0x540f63[_0x489b('0x35')]=_[_0x489b('0x2f')](_0x217a7b,_0x489b('0x2c'));_0x540f63[_0x489b('0x36')]=_['keys'](_0x5c3a99[_0x489b('0x36')]);_0x540f63[_0x489b('0x37')]=_['intersection'](_0x540f63[_0x489b('0x35')],_0x540f63[_0x489b('0x36')]);_0x4b9d68['attributes']=_[_0x489b('0x38')](_0x540f63[_0x489b('0x35')],qs['fields'](_0x5c3a99[_0x489b('0x36')][_0x489b('0x39')]));_0x4b9d68[_0x489b('0x3a')]=_0x4b9d68['attributes']['length']?_0x4b9d68[_0x489b('0x3a')]:_0x540f63[_0x489b('0x35')];if(!_0x5c3a99[_0x489b('0x36')][_0x489b('0x3b')](_0x489b('0x3c'))){_0x4b9d68[_0x489b('0x1c')]=qs['limit'](_0x5c3a99[_0x489b('0x36')][_0x489b('0x1c')]);_0x4b9d68[_0x489b('0x1b')]=qs['offset'](_0x5c3a99[_0x489b('0x36')]['offset']);}_0x4b9d68[_0x489b('0x3d')]=qs[_0x489b('0x3e')](_0x5c3a99[_0x489b('0x36')]['sort']);_0x4b9d68[_0x489b('0x3f')]=qs['filters'](_[_0x489b('0x40')](_0x5c3a99[_0x489b('0x36')],_0x540f63[_0x489b('0x37')]),_0x217a7b);if(_0x5c3a99[_0x489b('0x36')][_0x489b('0x41')]){_0x4b9d68[_0x489b('0x3f')]=_['merge'](_0x4b9d68['where'],{'$or':_[_0x489b('0x2f')](_0x217a7b,function(_0x3ede42){if(_0x3ede42[_0x489b('0x33')]!=='VIRTUAL'){var _0x290f73={};_0x290f73[_0x3ede42[_0x489b('0x2c')]]={'$like':'%'+_0x5c3a99[_0x489b('0x36')][_0x489b('0x41')]+'%'};return _0x290f73;}})});}_0x4b9d68=_[_0x489b('0x42')]({},_0x4b9d68,_0x5c3a99[_0x489b('0x43')]);var _0x1811bc={'where':_0x4b9d68[_0x489b('0x3f')]};return db[_0x489b('0x30')][_0x489b('0x1a')](_0x1811bc)['then'](function(_0x5cc165){_0x46f98c[_0x489b('0x1a')]=_0x5cc165;if(_0x5c3a99[_0x489b('0x36')][_0x489b('0x44')]){_0x4b9d68[_0x489b('0x45')]=[{'all':!![]}];}return db[_0x489b('0x30')]['findAll'](_0x4b9d68);})[_0x489b('0x23')](function(_0x1c6bde){_0x46f98c['rows']=_0x1c6bde;return _0x46f98c;})[_0x489b('0x23')](respondWithFilteredResult(_0x2e05a9,_0x4b9d68))[_0x489b('0x46')](handleError(_0x2e05a9,null));};exports[_0x489b('0x47')]=function(_0x3b34f1,_0x37980e){var _0x51b9e0={'raw':!![],'where':{'id':_0x3b34f1[_0x489b('0x48')]['id']}},_0x76d0a8={};_0x76d0a8[_0x489b('0x35')]=_[_0x489b('0x49')](db['Pause'][_0x489b('0x31')]);_0x76d0a8[_0x489b('0x36')]=_['keys'](_0x3b34f1[_0x489b('0x36')]);_0x76d0a8[_0x489b('0x37')]=_[_0x489b('0x38')](_0x76d0a8[_0x489b('0x35')],_0x76d0a8[_0x489b('0x36')]);_0x51b9e0[_0x489b('0x3a')]=_[_0x489b('0x38')](_0x76d0a8['model'],qs['fields'](_0x3b34f1['query'][_0x489b('0x39')]));_0x51b9e0[_0x489b('0x3a')]=_0x51b9e0['attributes'][_0x489b('0x4a')]?_0x51b9e0['attributes']:_0x76d0a8[_0x489b('0x35')];if(_0x3b34f1['query'][_0x489b('0x44')]){_0x51b9e0[_0x489b('0x45')]=[{'all':!![]}];}_0x51b9e0=_[_0x489b('0x42')]({},_0x51b9e0,_0x3b34f1[_0x489b('0x43')]);return db['Pause'][_0x489b('0x4b')](_0x51b9e0)[_0x489b('0x23')](handleEntityNotFound(_0x37980e,null))[_0x489b('0x23')](respondWithResult(_0x37980e,null))['catch'](handleError(_0x37980e,null));};exports[_0x489b('0x4c')]=function(_0x4d63d8,_0x2a2b02){return db[_0x489b('0x30')]['create'](_0x4d63d8[_0x489b('0x4d')],{})[_0x489b('0x23')](function(_0x43a74e){var _0x42aaee=_0x4d63d8['user'][_0x489b('0x25')]({'plain':!![]});if(!_0x42aaee)throw new Error(_0x489b('0x4e'));if(_0x42aaee[_0x489b('0x4f')]===_0x489b('0x50')){var _0x5bbd87=_0x43a74e[_0x489b('0x25')]({'plain':!![]});var _0x5d0c4c=_0x489b('0x26');return db['UserProfileSection'][_0x489b('0x4b')]({'where':{'name':_0x5d0c4c,'userProfileId':_0x42aaee['userProfileId']},'raw':!![]})[_0x489b('0x23')](function(_0x4db775){if(_0x4db775&&_0x4db775[_0x489b('0x51')]===0x0){return db[_0x489b('0x27')][_0x489b('0x4c')]({'name':_0x5bbd87[_0x489b('0x2c')],'resourceId':_0x5bbd87['id'],'type':_0x4db775[_0x489b('0x2c')],'sectionId':_0x4db775['id']},{})[_0x489b('0x23')](function(){return _0x43a74e;});}else{return _0x43a74e;}})[_0x489b('0x46')](function(_0x3f5b2b){logger[_0x489b('0x2a')](_0x489b('0x52'),_0x3f5b2b);throw _0x3f5b2b;});}return _0x43a74e;})[_0x489b('0x23')](respondWithResult(_0x2a2b02,0xc9))[_0x489b('0x46')](handleError(_0x2a2b02,null));};exports[_0x489b('0x22')]=function(_0x278b03,_0x44e8de){if(_0x278b03['body']['id']){delete _0x278b03[_0x489b('0x4d')]['id'];}return db[_0x489b('0x30')]['find']({'where':{'id':_0x278b03[_0x489b('0x48')]['id']}})[_0x489b('0x23')](handleEntityNotFound(_0x44e8de,null))[_0x489b('0x23')](saveUpdates(_0x278b03['body'],null))['then'](respondWithResult(_0x44e8de,null))[_0x489b('0x46')](handleError(_0x44e8de,null));};exports[_0x489b('0x24')]=function(_0x2cc6c2,_0x5e66e9){return db[_0x489b('0x30')][_0x489b('0x4b')]({'where':{'id':_0x2cc6c2[_0x489b('0x48')]['id']}})[_0x489b('0x23')](handleEntityNotFound(_0x5e66e9,null))[_0x489b('0x23')](removeEntity(_0x5e66e9,null))[_0x489b('0x46')](handleError(_0x5e66e9,null));};
\ No newline at end of file
diff --git a/server/api/pause/pause.model.js b/server/api/pause/pause.model.js
index 90a716a..3695661 100644
--- a/server/api/pause/pause.model.js
+++ b/server/api/pause/pause.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xae24=['lodash','../../config/logger','moment','request-promise','../../config/environment','./pause.attributes','define','Pause'];(function(_0x5230ed,_0x2eb03e){var _0x43bb42=function(_0x407331){while(--_0x407331){_0x5230ed['push'](_0x5230ed['shift']());}};_0x43bb42(++_0x2eb03e);}(_0xae24,0x180));var _0x4ae2=function(_0x7a8d19,_0x32dac4){_0x7a8d19=_0x7a8d19-0x0;var _0x33f3a5=_0xae24[_0x7a8d19];return _0x33f3a5;};'use strict';var _=require(_0x4ae2('0x0'));var util=require('util');var logger=require(_0x4ae2('0x1'))('api');var moment=require(_0x4ae2('0x2'));var BPromise=require('bluebird');var rp=require(_0x4ae2('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x4ae2('0x4'));var attributes=require(_0x4ae2('0x5'));module['exports']=function(_0x31e734,_0x448c4b){return _0x31e734[_0x4ae2('0x6')](_0x4ae2('0x7'),attributes,{'tableName':'tools_pauses','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x984b=['util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./pause.attributes','exports','Pause','tools_pauses','lodash'];(function(_0x26bdc6,_0x5d5f6d){var _0x597736=function(_0x100727){while(--_0x100727){_0x26bdc6['push'](_0x26bdc6['shift']());}};_0x597736(++_0x5d5f6d);}(_0x984b,0x137));var _0xb984=function(_0x31b96c,_0x436a1b){_0x31b96c=_0x31b96c-0x0;var _0x5576ae=_0x984b[_0x31b96c];return _0x5576ae;};'use strict';var _=require(_0xb984('0x0'));var util=require(_0xb984('0x1'));var logger=require(_0xb984('0x2'))(_0xb984('0x3'));var moment=require(_0xb984('0x4'));var BPromise=require(_0xb984('0x5'));var rp=require(_0xb984('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xb984('0x7'));var config=require(_0xb984('0x8'));var attributes=require(_0xb984('0x9'));module[_0xb984('0xa')]=function(_0x3fae6a,_0x250515){return _0x3fae6a['define'](_0xb984('0xb'),attributes,{'tableName':_0xb984('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/pause/pause.rpc.js b/server/api/pause/pause.rpc.js
index 9cd3c04..fc6ac15 100644
--- a/server/api/pause/pause.rpc.js
+++ b/server/api/pause/pause.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xd572=['message','info','result','ShowPause','find','options','raw','where','include','map','model','attributes','catch','lodash','util','moment','randomstring','ioredis','../../config/environment','jayson/promise','client','http','request','Pause,\x20%s,\x20%s','request\x20sent','stringify','error','code'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd572,0x1cd));var _0x2d57=function(_0x5c1673,_0x1091b8){_0x5c1673=_0x5c1673-0x0;var _0x34315f=_0xd572[_0x5c1673];return _0x34315f;};'use strict';var _=require(_0x2d57('0x0'));var util=require(_0x2d57('0x1'));var moment=require(_0x2d57('0x2'));var BPromise=require('bluebird');var rs=require(_0x2d57('0x3'));var fs=require('fs');var Redis=require(_0x2d57('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x2d57('0x5'));var jayson=require(_0x2d57('0x6'));var client=jayson[_0x2d57('0x7')][_0x2d57('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5281d6,_0x4edc58,_0x3a5502){return new BPromise(function(_0x1a81e1,_0x182e81){return client[_0x2d57('0x9')](_0x5281d6,_0x3a5502)['then'](function(_0x533c62){logger['info'](_0x2d57('0xa'),_0x4edc58,_0x2d57('0xb'));logger['debug']('Pause,\x20%s,\x20%s,\x20%s',_0x4edc58,_0x2d57('0xb'),JSON[_0x2d57('0xc')](_0x533c62));if(_0x533c62[_0x2d57('0xd')]){if(_0x533c62['error'][_0x2d57('0xe')]===0x1f4){logger['error'](_0x2d57('0xa'),_0x4edc58,_0x533c62[_0x2d57('0xd')][_0x2d57('0xf')]);return _0x182e81(_0x533c62[_0x2d57('0xd')]['message']);}logger[_0x2d57('0xd')](_0x2d57('0xa'),_0x4edc58,_0x533c62['error']['message']);return _0x1a81e1(_0x533c62['error'][_0x2d57('0xf')]);}else{logger[_0x2d57('0x10')]('Pause,\x20%s,\x20%s',_0x4edc58,_0x2d57('0xb'));_0x1a81e1(_0x533c62[_0x2d57('0x11')][_0x2d57('0xf')]);}})['catch'](function(_0x1589a4){logger[_0x2d57('0xd')](_0x2d57('0xa'),_0x4edc58,_0x1589a4);_0x182e81(_0x1589a4);});});}exports[_0x2d57('0x12')]=function(_0x43af65){var _0x544acf=this;return new Promise(function(_0x11810e,_0x170529){return db['Pause'][_0x2d57('0x13')]({'raw':_0x43af65[_0x2d57('0x14')]?_0x43af65[_0x2d57('0x14')][_0x2d57('0x15')]===undefined?!![]:![]:!![],'where':_0x43af65[_0x2d57('0x14')]?_0x43af65[_0x2d57('0x14')][_0x2d57('0x16')]||null:null,'attributes':_0x43af65['options']?_0x43af65[_0x2d57('0x14')]['attributes']||null:null,'include':_0x43af65[_0x2d57('0x14')]?_0x43af65[_0x2d57('0x14')][_0x2d57('0x17')]?_[_0x2d57('0x18')](_0x43af65['options'][_0x2d57('0x17')],function(_0x1af48c){return{'model':db[_0x1af48c[_0x2d57('0x19')]],'as':_0x1af48c['as'],'attributes':_0x1af48c['attributes'],'include':_0x1af48c[_0x2d57('0x17')]?_['map'](_0x1af48c[_0x2d57('0x17')],function(_0x298c4f){return{'model':db[_0x298c4f[_0x2d57('0x19')]],'as':_0x298c4f['as'],'attributes':_0x298c4f[_0x2d57('0x1a')],'include':_0x298c4f['include']?_[_0x2d57('0x18')](_0x298c4f[_0x2d57('0x17')],function(_0xa84576){return{'model':db[_0xa84576[_0x2d57('0x19')]],'as':_0xa84576['as'],'attributes':_0xa84576[_0x2d57('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x21eaad){logger[_0x2d57('0x10')](_0x2d57('0x12'),_0x43af65);logger['debug']('ShowPause',_0x43af65,JSON['stringify'](_0x21eaad));_0x11810e(_0x21eaad);})[_0x2d57('0x1b')](function(_0x1a389b){logger[_0x2d57('0xd')]('ShowPause',_0x1a389b[_0x2d57('0xf')],_0x43af65);_0x170529(_0x544acf[_0x2d57('0xd')](0x1f4,_0x1a389b[_0x2d57('0xf')]));});});};
\ No newline at end of file
+var _0x63ea=['Pause,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','ShowPause','Pause','options','raw','where','attributes','include','map','model','lodash','util','moment','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info'];(function(_0x1b50fc,_0x42fb96){var _0x5934be=function(_0x5168b4){while(--_0x5168b4){_0x1b50fc['push'](_0x1b50fc['shift']());}};_0x5934be(++_0x42fb96);}(_0x63ea,0x15b));var _0xa63e=function(_0x251c02,_0x2eb35d){_0x251c02=_0x251c02-0x0;var _0xc2e862=_0x63ea[_0x251c02];return _0xc2e862;};'use strict';var _=require(_0xa63e('0x0'));var util=require(_0xa63e('0x1'));var moment=require(_0xa63e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa63e('0x3'))['db'];var utils=require(_0xa63e('0x4'));var logger=require(_0xa63e('0x5'))(_0xa63e('0x6'));var config=require(_0xa63e('0x7'));var jayson=require(_0xa63e('0x8'));var client=jayson[_0xa63e('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1f0294,_0x49df26,_0x1c509f){return new BPromise(function(_0x3d91ca,_0x536930){return client[_0xa63e('0xa')](_0x1f0294,_0x1c509f)[_0xa63e('0xb')](function(_0x51f4db){logger[_0xa63e('0xc')](_0xa63e('0xd'),_0x49df26,_0xa63e('0xe'));logger[_0xa63e('0xf')]('Pause,\x20%s,\x20%s,\x20%s',_0x49df26,_0xa63e('0xe'),JSON[_0xa63e('0x10')](_0x51f4db));if(_0x51f4db[_0xa63e('0x11')]){if(_0x51f4db[_0xa63e('0x11')]['code']===0x1f4){logger[_0xa63e('0x11')](_0xa63e('0xd'),_0x49df26,_0x51f4db[_0xa63e('0x11')][_0xa63e('0x12')]);return _0x536930(_0x51f4db[_0xa63e('0x11')][_0xa63e('0x12')]);}logger[_0xa63e('0x11')](_0xa63e('0xd'),_0x49df26,_0x51f4db[_0xa63e('0x11')][_0xa63e('0x12')]);return _0x3d91ca(_0x51f4db[_0xa63e('0x11')][_0xa63e('0x12')]);}else{logger[_0xa63e('0xc')](_0xa63e('0xd'),_0x49df26,_0xa63e('0xe'));_0x3d91ca(_0x51f4db[_0xa63e('0x13')][_0xa63e('0x12')]);}})[_0xa63e('0x14')](function(_0x1aad10){logger['error'](_0xa63e('0xd'),_0x49df26,_0x1aad10);_0x536930(_0x1aad10);});});}exports[_0xa63e('0x15')]=function(_0x2d7e16){var _0x54b93c=this;return new Promise(function(_0x5402d3,_0x3f86ce){return db[_0xa63e('0x16')]['find']({'raw':_0x2d7e16['options']?_0x2d7e16[_0xa63e('0x17')][_0xa63e('0x18')]===undefined?!![]:![]:!![],'where':_0x2d7e16[_0xa63e('0x17')]?_0x2d7e16[_0xa63e('0x17')][_0xa63e('0x19')]||null:null,'attributes':_0x2d7e16[_0xa63e('0x17')]?_0x2d7e16[_0xa63e('0x17')][_0xa63e('0x1a')]||null:null,'include':_0x2d7e16[_0xa63e('0x17')]?_0x2d7e16['options'][_0xa63e('0x1b')]?_[_0xa63e('0x1c')](_0x2d7e16[_0xa63e('0x17')]['include'],function(_0x476cf9){return{'model':db[_0x476cf9[_0xa63e('0x1d')]],'as':_0x476cf9['as'],'attributes':_0x476cf9[_0xa63e('0x1a')],'include':_0x476cf9[_0xa63e('0x1b')]?_[_0xa63e('0x1c')](_0x476cf9[_0xa63e('0x1b')],function(_0x1ef862){return{'model':db[_0x1ef862[_0xa63e('0x1d')]],'as':_0x1ef862['as'],'attributes':_0x1ef862[_0xa63e('0x1a')],'include':_0x1ef862[_0xa63e('0x1b')]?_[_0xa63e('0x1c')](_0x1ef862[_0xa63e('0x1b')],function(_0x169b36){return{'model':db[_0x169b36[_0xa63e('0x1d')]],'as':_0x169b36['as'],'attributes':_0x169b36['attributes']};}):[]};}):[]};}):[]:[]})[_0xa63e('0xb')](function(_0x3dd082){logger[_0xa63e('0xc')](_0xa63e('0x15'),_0x2d7e16);logger[_0xa63e('0xf')](_0xa63e('0x15'),_0x2d7e16,JSON[_0xa63e('0x10')](_0x3dd082));_0x5402d3(_0x3dd082);})['catch'](function(_0x4cdc56){logger[_0xa63e('0x11')]('ShowPause',_0x4cdc56['message'],_0x2d7e16);_0x3f86ce(_0x54b93c[_0xa63e('0x11')](0x1f4,_0x4cdc56[_0xa63e('0x12')]));});});};
\ No newline at end of file
diff --git a/server/api/plugin/index.js b/server/api/plugin/index.js
index 989645c..8e7b456 100644
--- a/server/api/plugin/index.js
+++ b/server/api/plugin/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x333b=['connect-timeout','../../config/environment','./plugin.controller','isAuthenticated','get','/webhook','webhookGet','show','/:id/download','download','join','root','server/files/plugins','originalname','format','%s-%s%s','basename','extname','now','post','single','file','upload','webhookPost','/:id','delete','exports','multer','util','path'];(function(_0x5eb8e8,_0x116210){var _0x5974a5=function(_0x11b6dc){while(--_0x11b6dc){_0x5eb8e8['push'](_0x5eb8e8['shift']());}};_0x5974a5(++_0x116210);}(_0x333b,0x183));var _0xb333=function(_0xbc4560,_0x4020b8){_0xbc4560=_0xbc4560-0x0;var _0x298cfb=_0x333b[_0xbc4560];return _0x298cfb;};'use strict';var multer=require(_0xb333('0x0'));var util=require(_0xb333('0x1'));var path=require(_0xb333('0x2'));var timeout=require(_0xb333('0x3'));var express=require('express');var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xb333('0x4'));var controller=require(_0xb333('0x5'));router['get']('/',auth[_0xb333('0x6')](),controller['index']);router[_0xb333('0x7')](_0xb333('0x8'),controller[_0xb333('0x9')]);router[_0xb333('0x7')]('/:id',auth['isAuthenticated'](),controller[_0xb333('0xa')]);router[_0xb333('0x7')](_0xb333('0xb'),auth[_0xb333('0x6')](),controller[_0xb333('0xc')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0xea978,_0x1fccc0,_0x10448b){_0x10448b(null,path[_0xb333('0xd')](config[_0xb333('0xe')],_0xb333('0xf')));},'filename':function(_0x2f6b2a,_0x24afe9,_0x3f2b38){_0x24afe9[_0xb333('0x10')]=_0x24afe9[_0xb333('0x10')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x3f2b38(null,util[_0xb333('0x11')](_0xb333('0x12'),path[_0xb333('0x13')](_0x24afe9[_0xb333('0x10')],path[_0xb333('0x14')](_0x24afe9[_0xb333('0x10')])),Date[_0xb333('0x15')](),path[_0xb333('0x14')](_0x24afe9['originalname'])));}})});router[_0xb333('0x16')]('/',upload[_0xb333('0x17')](_0xb333('0x18')),controller[_0xb333('0x19')]);router['post']('/webhook',controller[_0xb333('0x1a')]);router['put'](_0xb333('0x1b'),auth['isAuthenticated'](),controller['update']);router[_0xb333('0x1c')](_0xb333('0x1b'),auth['isAuthenticated'](),controller[_0xb333('0x1c')]);module[_0xb333('0x1d')]=router;
\ No newline at end of file
+var _0x9278=['join','root','server/files/plugins','originalname','replace','format','basename','now','extname','post','single','file','upload','webhookPost','update','delete','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./plugin.controller','get','index','/webhook','webhookGet','/:id','show','/:id/download','isAuthenticated','download','diskStorage'];(function(_0xbf727d,_0x49ecf9){var _0x37f1bb=function(_0x3f07a2){while(--_0x3f07a2){_0xbf727d['push'](_0xbf727d['shift']());}};_0x37f1bb(++_0x49ecf9);}(_0x9278,0x155));var _0x8927=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x9278[_0x4565bf];return _0x5610ba;};'use strict';var multer=require('multer');var util=require(_0x8927('0x0'));var path=require(_0x8927('0x1'));var timeout=require(_0x8927('0x2'));var express=require(_0x8927('0x3'));var router=express[_0x8927('0x4')]();var auth=require(_0x8927('0x5'));var interaction=require(_0x8927('0x6'));var config=require(_0x8927('0x7'));var controller=require(_0x8927('0x8'));router[_0x8927('0x9')]('/',auth['isAuthenticated'](),controller[_0x8927('0xa')]);router['get'](_0x8927('0xb'),controller[_0x8927('0xc')]);router['get'](_0x8927('0xd'),auth['isAuthenticated'](),controller[_0x8927('0xe')]);router[_0x8927('0x9')](_0x8927('0xf'),auth[_0x8927('0x10')](),controller[_0x8927('0x11')]);var upload=multer({'storage':multer[_0x8927('0x12')]({'destination':function(_0x535a8a,_0x5c0524,_0x30ac59){_0x30ac59(null,path[_0x8927('0x13')](config[_0x8927('0x14')],_0x8927('0x15')));},'filename':function(_0x1bdbc0,_0x53aad4,_0x414e93){_0x53aad4[_0x8927('0x16')]=_0x53aad4[_0x8927('0x16')][_0x8927('0x17')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x414e93(null,util[_0x8927('0x18')]('%s-%s%s',path[_0x8927('0x19')](_0x53aad4[_0x8927('0x16')],path['extname'](_0x53aad4[_0x8927('0x16')])),Date[_0x8927('0x1a')](),path[_0x8927('0x1b')](_0x53aad4[_0x8927('0x16')])));}})});router[_0x8927('0x1c')]('/',upload[_0x8927('0x1d')](_0x8927('0x1e')),controller[_0x8927('0x1f')]);router['post']('/webhook',controller[_0x8927('0x20')]);router['put'](_0x8927('0xd'),auth['isAuthenticated'](),controller[_0x8927('0x21')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x8927('0x22')]);module[_0x8927('0x23')]=router;
\ No newline at end of file
diff --git a/server/api/plugin/plugin.attributes.js b/server/api/plugin/plugin.attributes.js
index 4d0c970..842bce0 100644
--- a/server/api/plugin/plugin.attributes.js
+++ b/server/api/plugin/plugin.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x3f03=['never','Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.','sequelize','exports','STRING','ENUM','script','TEXT','The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.','BOOLEAN','Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.','adminOnly','agentOnly','always'];(function(_0xd22cdd,_0x57a865){var _0x3a6f7d=function(_0xe51a2d){while(--_0xe51a2d){_0xd22cdd['push'](_0xd22cdd['shift']());}};_0x3a6f7d(++_0x57a865);}(_0x3f03,0xf0));var _0x33f0=function(_0x516069,_0x15e610){_0x516069=_0x516069-0x0;var _0xda0967=_0x3f03[_0x516069];return _0xda0967;};'use strict';var Sequelize=require(_0x33f0('0x0'));module[_0x33f0('0x1')]={'name':{'type':Sequelize[_0x33f0('0x2')]},'type':{'type':Sequelize[_0x33f0('0x3')]('html',_0x33f0('0x4'))},'description':{'type':Sequelize['TEXT']},'version':{'type':Sequelize[_0x33f0('0x5')]},'path':{'type':Sequelize[_0x33f0('0x2')],'comment':_0x33f0('0x6')},'active':{'type':Sequelize[_0x33f0('0x7')],'defaultValue':0x0,'comment':_0x33f0('0x8')},'sidebar':{'type':Sequelize[_0x33f0('0x3')](_0x33f0('0x9'),_0x33f0('0xa'),_0x33f0('0xb'),_0x33f0('0xc')),'defaultValue':_0x33f0('0xb'),'comment':_0x33f0('0xd')},'icon':{'type':Sequelize[_0x33f0('0x2')]},'adminUrl':{'type':Sequelize[_0x33f0('0x2')]},'agentUrl':{'type':Sequelize[_0x33f0('0x2')]},'scriptName':{'type':Sequelize[_0x33f0('0x2')]},'scriptPath':{'type':Sequelize[_0x33f0('0x2')]}};
\ No newline at end of file
+var _0xcfe5=['BOOLEAN','ENUM','agentOnly','never','always','Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.','sequelize','exports','TEXT','STRING','The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.'];(function(_0x57a8e7,_0x1e576d){var _0x4ee93a=function(_0x2d5f8b){while(--_0x2d5f8b){_0x57a8e7['push'](_0x57a8e7['shift']());}};_0x4ee93a(++_0x1e576d);}(_0xcfe5,0x1c9));var _0x5cfe=function(_0x54613d,_0x4b8872){_0x54613d=_0x54613d-0x0;var _0x11c35b=_0xcfe5[_0x54613d];return _0x11c35b;};'use strict';var Sequelize=require(_0x5cfe('0x0'));module[_0x5cfe('0x1')]={'name':{'type':Sequelize['STRING']},'type':{'type':Sequelize['ENUM']('html','script')},'description':{'type':Sequelize[_0x5cfe('0x2')]},'version':{'type':Sequelize['TEXT']},'path':{'type':Sequelize[_0x5cfe('0x3')],'comment':_0x5cfe('0x4')},'active':{'type':Sequelize[_0x5cfe('0x5')],'defaultValue':0x0,'comment':'Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.'},'sidebar':{'type':Sequelize[_0x5cfe('0x6')]('adminOnly',_0x5cfe('0x7'),'always',_0x5cfe('0x8')),'defaultValue':_0x5cfe('0x9'),'comment':_0x5cfe('0xa')},'icon':{'type':Sequelize[_0x5cfe('0x3')]},'adminUrl':{'type':Sequelize[_0x5cfe('0x3')]},'agentUrl':{'type':Sequelize[_0x5cfe('0x3')]},'scriptName':{'type':Sequelize[_0x5cfe('0x3')]},'scriptPath':{'type':Sequelize[_0x5cfe('0x3')]}};
\ No newline at end of file
diff --git a/server/api/plugin/plugin.controller.js b/server/api/plugin/plugin.controller.js
index ff10e20..98d4a2f 100644
--- a/server/api/plugin/plugin.controller.js
+++ b/server/api/plugin/plugin.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xf15b=['filter','VIRTUAL','merge','Plugin','count','includeAll','include','findAll','rows','catch','show','params','keys','length','find','download','root','server/files/plugins','format','basename','createWriteStream','warning','ENOENT','Sequelize','Error','Error\x20while\x20generating\x20the\x20zip\x20archive','pipe','glob','**/*','join','node_modules/**/*','attachments/**/*','finalize','close','existsSync','Plugin\x20not\x20found','%s.zip','Error\x20while\x20downloading\x20the\x20plugin','unlinkSync','info','Download\x20completed','Temporary\x20file\x20removed','upload','file','filename','Plugin\x20upload\x20filepath:\x20%s','Plugin\x20upload\x20destination:\x20%s','chmodSync','0777','Invalid\x20plugin\x20structure','lstatSync','isFile','isDirectory','readdirSync','some','manifest.json','Plugin\x20manifest\x20missing','parse','undefined','Invalid\x20manifest:\x20name\x20missing','version','Invalid\x20manifest:\x20version\x20not\x20specified','parameters','Invalid\x20manifest:\x20parameters\x20missing','html','views','script','scriptName','scriptPath','Invalid\x20manifest:\x20script\x20path\x20missing','Invalid\x20manifest:\x20invalid\x20type','sidebar','icon-apps','admin','test','plugins','Warning:\x20agent\x20view\x20not\x20specified','agent','create','body','role','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','Zip\x20archive\x20removed','Extracted\x20folder\x20removed','delete','dirname','webhookGet','\x27PATH\x27\x20parameter\x20not\x20specified','\x27PORT\x27\x20parameter\x20not\x20specified','hostname','http://localhost:','port','encoding','method','headers','content-length','content-type','endsWith','statusCode','webhookPost','resolve','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','extract-zip','rimraf','archiver','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./plugin.socket','register','sendStatus','status','end','json','offset','limit','set','Content-Range','apply','then','destroy','get','Plugins','error','stack','name','send','index','map','rawAttributes','type','key','model','query','intersection','attributes','fields','hasOwnProperty','where','filters','pick'];(function(_0x424a9a,_0x2dd9af){var _0xa7831c=function(_0x512534){while(--_0x512534){_0x424a9a['push'](_0x424a9a['shift']());}};_0xa7831c(++_0x2dd9af);}(_0xf15b,0x6a));var _0xbf15=function(_0x53b37c,_0x1e3dae){_0x53b37c=_0x53b37c-0x0;var _0x912a5=_0xf15b[_0x53b37c];return _0x912a5;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xbf15('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xbf15('0x1'));var jsonpatch=require(_0xbf15('0x2'));var rp=require(_0xbf15('0x3'));var moment=require('moment');var BPromise=require(_0xbf15('0x4'));var Mustache=require(_0xbf15('0x5'));var util=require(_0xbf15('0x6'));var path=require(_0xbf15('0x7'));var sox=require(_0xbf15('0x8'));var csv=require('to-csv');var ejs=require(_0xbf15('0x9'));var fs=require('fs');var _=require(_0xbf15('0xa'));var squel=require(_0xbf15('0xb'));var crypto=require(_0xbf15('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xbf15('0xd'));var toCsv=require(_0xbf15('0xe'));var querystring=require(_0xbf15('0xf'));var Papa=require(_0xbf15('0x10'));var extract=require(_0xbf15('0x11'));var rimraf=require(_0xbf15('0x12'));var archiver=require(_0xbf15('0x13'));var Redis=require('ioredis');var authService=require(_0xbf15('0x14'));var qs=require(_0xbf15('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xbf15('0x16'));var logger=require(_0xbf15('0x17'))(_0xbf15('0x18'));var utils=require(_0xbf15('0x19'));var config=require(_0xbf15('0x1a'));var db=require(_0xbf15('0x1b'))['db'];config[_0xbf15('0x1c')]=_[_0xbf15('0x1d')](config[_0xbf15('0x1c')],{'host':_0xbf15('0x1e'),'port':0x18eb});var socket=require(_0xbf15('0x1f'))(new Redis(config[_0xbf15('0x1c')]));require(_0xbf15('0x20'))[_0xbf15('0x21')](socket);function respondWithStatusCode(_0x3f0c4e,_0x19a54b){_0x19a54b=_0x19a54b||0xcc;return function(_0x40445b){if(_0x40445b){return _0x3f0c4e[_0xbf15('0x22')](_0x19a54b);}return _0x3f0c4e[_0xbf15('0x23')](_0x19a54b)[_0xbf15('0x24')]();};}function respondWithResult(_0x3f233f,_0x4ecc34){_0x4ecc34=_0x4ecc34||0xc8;return function(_0xd4510a){if(_0xd4510a){return _0x3f233f['status'](_0x4ecc34)[_0xbf15('0x25')](_0xd4510a);}};}function respondWithFilteredResult(_0x19df5c,_0x4e3103){return function(_0x125f17){if(_0x125f17){var _0x4505f0=_0x125f17['count'],_0x82f5f7=_0x4e3103['offset'],_0x449608=_0x4e3103[_0xbf15('0x26')]+_0x4e3103[_0xbf15('0x27')],_0x4093da;if(_0x449608>=_0x4505f0){_0x449608=_0x4505f0;_0x4093da=0xc8;}else{_0x4093da=0xce;}_0x19df5c[_0xbf15('0x23')](_0x4093da);return _0x19df5c[_0xbf15('0x28')](_0xbf15('0x29'),_0x82f5f7+'-'+_0x449608+'/'+_0x4505f0)[_0xbf15('0x25')](_0x125f17);}return null;};}function patchUpdates(_0x581ccb){return function(_0x35e2e1){try{jsonpatch[_0xbf15('0x2a')](_0x35e2e1,_0x581ccb,!![]);}catch(_0x3c510b){return BPromise['reject'](_0x3c510b);}return _0x35e2e1['save']();};}function saveUpdates(_0x3f3fe4,_0x1b9147){return function(_0x504eff){if(_0x504eff){return _0x504eff['update'](_0x3f3fe4)[_0xbf15('0x2b')](function(_0x4df54d){return _0x4df54d;});}return null;};}function removeEntity(_0x268c9e,_0x2bc8db){return function(_0x240be9){if(_0x240be9){return _0x240be9[_0xbf15('0x2c')]()[_0xbf15('0x2b')](function(){var _0xfbb498=_0x240be9[_0xbf15('0x2d')]({'plain':!![]});var _0x151e31=_0xbf15('0x2e');return db['UserProfileResource'][_0xbf15('0x2c')]({'where':{'type':_0x151e31,'resourceId':_0xfbb498['id']}})[_0xbf15('0x2b')](function(){return _0x240be9;});})[_0xbf15('0x2b')](function(){_0x268c9e['status'](0xcc)[_0xbf15('0x24')]();});}};}function handleEntityNotFound(_0x5ca988,_0x66bf7e){return function(_0x45abe6){if(!_0x45abe6){_0x5ca988[_0xbf15('0x22')](0x194);}return _0x45abe6;};}function handleError(_0xac8ce9,_0xfee53b){_0xfee53b=_0xfee53b||0x1f4;return function(_0x1f0508){logger[_0xbf15('0x2f')](_0x1f0508[_0xbf15('0x30')]);if(_0x1f0508[_0xbf15('0x31')]){delete _0x1f0508[_0xbf15('0x31')];}_0xac8ce9[_0xbf15('0x23')](_0xfee53b)[_0xbf15('0x32')](_0x1f0508);};}exports[_0xbf15('0x33')]=function(_0x2b5066,_0x1e2180){var _0xd52cc3={},_0x482392={},_0x5ed504={'count':0x0,'rows':[]};var _0x181a1e=_[_0xbf15('0x34')](db['Plugin'][_0xbf15('0x35')],function(_0xd7c177){return{'name':_0xd7c177['fieldName'],'type':_0xd7c177[_0xbf15('0x36')][_0xbf15('0x37')]};});_0x482392[_0xbf15('0x38')]=_['map'](_0x181a1e,_0xbf15('0x31'));_0x482392[_0xbf15('0x39')]=_['keys'](_0x2b5066[_0xbf15('0x39')]);_0x482392['filters']=_[_0xbf15('0x3a')](_0x482392[_0xbf15('0x38')],_0x482392[_0xbf15('0x39')]);_0xd52cc3[_0xbf15('0x3b')]=_[_0xbf15('0x3a')](_0x482392['model'],qs['fields'](_0x2b5066[_0xbf15('0x39')][_0xbf15('0x3c')]));_0xd52cc3[_0xbf15('0x3b')]=_0xd52cc3[_0xbf15('0x3b')]['length']?_0xd52cc3['attributes']:_0x482392['model'];if(!_0x2b5066[_0xbf15('0x39')][_0xbf15('0x3d')]('nolimit')){_0xd52cc3['limit']=qs[_0xbf15('0x27')](_0x2b5066[_0xbf15('0x39')][_0xbf15('0x27')]);_0xd52cc3[_0xbf15('0x26')]=qs[_0xbf15('0x26')](_0x2b5066['query'][_0xbf15('0x26')]);}_0xd52cc3['order']=qs['sort'](_0x2b5066[_0xbf15('0x39')]['sort']);_0xd52cc3[_0xbf15('0x3e')]=qs[_0xbf15('0x3f')](_[_0xbf15('0x40')](_0x2b5066[_0xbf15('0x39')],_0x482392[_0xbf15('0x3f')]),_0x181a1e);if(_0x2b5066[_0xbf15('0x39')][_0xbf15('0x41')]){_0xd52cc3[_0xbf15('0x3e')]=_['merge'](_0xd52cc3[_0xbf15('0x3e')],{'$or':_['map'](_0x181a1e,function(_0x6aaec7){if(_0x6aaec7['type']!==_0xbf15('0x42')){var _0x9544fc={};_0x9544fc[_0x6aaec7[_0xbf15('0x31')]]={'$like':'%'+_0x2b5066[_0xbf15('0x39')][_0xbf15('0x41')]+'%'};return _0x9544fc;}})});}_0xd52cc3=_[_0xbf15('0x43')]({},_0xd52cc3,_0x2b5066['options']);var _0x321a41={'where':_0xd52cc3[_0xbf15('0x3e')]};return db[_0xbf15('0x44')][_0xbf15('0x45')](_0x321a41)[_0xbf15('0x2b')](function(_0x9399ac){_0x5ed504['count']=_0x9399ac;if(_0x2b5066[_0xbf15('0x39')][_0xbf15('0x46')]){_0xd52cc3[_0xbf15('0x47')]=[{'all':!![]}];}return db[_0xbf15('0x44')][_0xbf15('0x48')](_0xd52cc3);})[_0xbf15('0x2b')](function(_0x1a6ca1){_0x5ed504[_0xbf15('0x49')]=_0x1a6ca1;return _0x5ed504;})[_0xbf15('0x2b')](respondWithFilteredResult(_0x1e2180,_0xd52cc3))[_0xbf15('0x4a')](handleError(_0x1e2180,null));};exports[_0xbf15('0x4b')]=function(_0xd02f38,_0x23b005){var _0x228670={'raw':!![],'where':{'id':_0xd02f38[_0xbf15('0x4c')]['id']}},_0x1320af={};_0x1320af[_0xbf15('0x38')]=_[_0xbf15('0x4d')](db['Plugin'][_0xbf15('0x35')]);_0x1320af[_0xbf15('0x39')]=_['keys'](_0xd02f38['query']);_0x1320af[_0xbf15('0x3f')]=_[_0xbf15('0x3a')](_0x1320af[_0xbf15('0x38')],_0x1320af[_0xbf15('0x39')]);_0x228670[_0xbf15('0x3b')]=_[_0xbf15('0x3a')](_0x1320af[_0xbf15('0x38')],qs['fields'](_0xd02f38[_0xbf15('0x39')][_0xbf15('0x3c')]));_0x228670[_0xbf15('0x3b')]=_0x228670[_0xbf15('0x3b')][_0xbf15('0x4e')]?_0x228670['attributes']:_0x1320af[_0xbf15('0x38')];if(_0xd02f38['query'][_0xbf15('0x46')]){_0x228670['include']=[{'all':!![]}];}_0x228670=_[_0xbf15('0x43')]({},_0x228670,_0xd02f38['options']);return db[_0xbf15('0x44')][_0xbf15('0x4f')](_0x228670)['then'](handleEntityNotFound(_0x23b005,null))[_0xbf15('0x2b')](respondWithResult(_0x23b005,null))[_0xbf15('0x4a')](handleError(_0x23b005,null));};exports[_0xbf15('0x50')]=function(_0x206085,_0x26bd01,_0x3a9b18){return db[_0xbf15('0x44')]['find']({'where':{'id':_0x206085['params']['id']},'attributes':[_0xbf15('0x31'),'path'],'raw':!![]})[_0xbf15('0x2b')](handleEntityNotFound(_0x26bd01,null))[_0xbf15('0x2b')](function(_0x516469){if(_0x516469){var _0x13e873=path['join'](config[_0xbf15('0x51')],_0xbf15('0x52'),util[_0xbf15('0x53')]('%s.zip',path[_0xbf15('0x54')](_0x516469[_0xbf15('0x7')])));var _0x14d3c8=fs[_0xbf15('0x55')](_0x13e873);var _0x4aba27=archiver('zip',{'zlib':{'level':0x9}});_0x4aba27['on'](_0xbf15('0x56'),function(_0x36e6c8){if(_0x36e6c8['code']===_0xbf15('0x57')){logger[_0xbf15('0x2f')](_0x36e6c8);}else{throw new db[(_0xbf15('0x58'))]['Error']('Error\x20while\x20generating\x20the\x20zip\x20archive');}});_0x4aba27['on'](_0xbf15('0x2f'),function(_0xde9c82){throw new db['Sequelize'][(_0xbf15('0x59'))](_0xbf15('0x5a'));});_0x4aba27[_0xbf15('0x5b')](_0x14d3c8);_0x4aba27[_0xbf15('0x5c')](_0xbf15('0x5d'),{'cwd':path['join'](config[_0xbf15('0x51')],_0xbf15('0x52'),path['dirname'](_0x516469[_0xbf15('0x7')])),'ignore':[path[_0xbf15('0x5e')](path['basename'](_0x516469[_0xbf15('0x7')]),_0xbf15('0x5f')),path[_0xbf15('0x5e')](path[_0xbf15('0x54')](_0x516469[_0xbf15('0x7')]),_0xbf15('0x60'))],'nodir':!![]})[_0xbf15('0x61')]();_0x14d3c8['on'](_0xbf15('0x62'),function(){if(!fs[_0xbf15('0x63')](_0x13e873)){throw new db[(_0xbf15('0x58'))][(_0xbf15('0x59'))](_0xbf15('0x64'));}return _0x26bd01[_0xbf15('0x50')](_0x13e873,util[_0xbf15('0x53')](_0xbf15('0x65'),path[_0xbf15('0x54')](_0x516469[_0xbf15('0x7')])),function(_0x282302){if(_0x282302){throw new db[(_0xbf15('0x58'))]['Error'](_0xbf15('0x66'));}fs[_0xbf15('0x67')](_0x13e873);logger[_0xbf15('0x68')](_0xbf15('0x69'));logger[_0xbf15('0x68')](_0xbf15('0x6a'));});});}return null;})[_0xbf15('0x4a')](handleError(_0x26bd01,null));};exports[_0xbf15('0x6b')]=function(_0x3c81ae,_0x33ddd7,_0x38a01d){var _0x1c9023=path[_0xbf15('0x54')](_0x3c81ae[_0xbf15('0x6c')][_0xbf15('0x6d')],path['extname'](_0x3c81ae['file'][_0xbf15('0x6d')]));var _0x1c304e=path[_0xbf15('0x5e')](config[_0xbf15('0x51')],_0xbf15('0x52'),_0x3c81ae[_0xbf15('0x6c')]['filename']);var _0x2ee873=path[_0xbf15('0x5e')](config['root'],_0xbf15('0x52'),_0x1c9023);logger[_0xbf15('0x68')](_0xbf15('0x6e'),_0x1c304e);logger[_0xbf15('0x68')](_0xbf15('0x6f'),_0x2ee873);try{fs[_0xbf15('0x70')](_0x1c304e,parseInt(_0xbf15('0x71'),0x8));extract(_0x1c304e,{'dir':_0x2ee873},function(_0x136d4f){if(_0x136d4f){logger['error'](_0x136d4f);handleError(_0x136d4f,!![]);};var _0x5789b0=fs['readdirSync'](_0x2ee873);if(_0x5789b0[_0xbf15('0x4e')]>0x1){removeReferences(_0x1c304e,_0x2ee873);logger[_0xbf15('0x2f')]('Invalid\x20plugin\x20structure');return _0x38a01d(new Error(_0xbf15('0x72')));}var _0x2ed81f=fs[_0xbf15('0x73')](path['join'](_0x2ee873,_0x5789b0[0x0]));if(_0x2ed81f[_0xbf15('0x74')]()){removeReferences(_0x1c304e,_0x2ee873);logger['error'](_0xbf15('0x72'));return _0x38a01d(new Error(_0xbf15('0x72')));}if(_0x2ed81f[_0xbf15('0x75')]()){var _0x37c8da=fs[_0xbf15('0x76')](path[_0xbf15('0x5e')](_0x2ee873,_0x5789b0[0x0]));if(_0x37c8da[_0xbf15('0x4e')]===0x0){removeReferences(_0x1c304e,_0x2ee873);logger[_0xbf15('0x2f')](_0xbf15('0x72'));return _0x38a01d(new Error(_0xbf15('0x72')));}var _0x9c6955=_0x37c8da[_0xbf15('0x77')](function(_0x252175){return _0x252175===_0xbf15('0x78');});if(!_0x9c6955){return _0x38a01d(new Error(_0xbf15('0x79')));}var _0x4fe81f=fs['readFileSync'](path[_0xbf15('0x5e')](_0x2ee873,_0x5789b0[0x0],'manifest.json'));var _0x16f260=JSON[_0xbf15('0x7a')](_0x4fe81f);if(_0xbf15('0x7b')==typeof _0x16f260[_0xbf15('0x31')]){return _0x38a01d(new Error(_0xbf15('0x7c')));}if(_0xbf15('0x7b')==typeof _0x16f260[_0xbf15('0x36')]){return _0x38a01d(new Error('Invalid\x20manifest:\x20type\x20missing'));}if(_0xbf15('0x7b')==typeof _0x16f260[_0xbf15('0x7d')]){return _0x38a01d(new Error(_0xbf15('0x7e')));}if(_0xbf15('0x7b')==typeof _0x16f260[_0xbf15('0x7f')]){return _0x38a01d(new Error(_0xbf15('0x80')));}if(_0x16f260[_0xbf15('0x36')]===_0xbf15('0x81')){if(_0xbf15('0x7b')==typeof _0x16f260[_0xbf15('0x7f')][_0xbf15('0x82')]){return _0x38a01d(new Error('Invalid\x20manifest:\x20views\x20missing'));}if('undefined'==typeof _0x16f260['parameters'][_0xbf15('0x82')]['admin']&&_0xbf15('0x7b')==typeof _0x16f260[_0xbf15('0x7f')][_0xbf15('0x82')]['agent']){return _0x38a01d(new Error('Invalid\x20manifest:\x20no\x20view\x20specified'));}}else if(_0x16f260[_0xbf15('0x36')]===_0xbf15('0x83')){if(_0xbf15('0x7b')==typeof _0x16f260[_0xbf15('0x7f')][_0xbf15('0x84')]){return _0x38a01d(new Error('Invalid\x20manifest:\x20script\x20name\x20missing'));}if(_0xbf15('0x7b')==typeof _0x16f260[_0xbf15('0x7f')][_0xbf15('0x85')]){return _0x38a01d(new Error(_0xbf15('0x86')));}}else{return _0x38a01d(new Error(_0xbf15('0x87')));}var _0x39624f=_0x16f260[_0xbf15('0x31')];var _0x224d4c=_0x16f260['description'];var _0x527b6e=_0x16f260[_0xbf15('0x36')];var _0xd862d7=_0x16f260[_0xbf15('0x88')]?_0x16f260['sidebar']:'always';var _0x142450=_0x16f260['icon']?_0x16f260['icon']:_0xbf15('0x89');var _0x25e9ea='';var _0x5454bf='';var _0x13e4b5='';var _0x416169='';var _0x4cde49=_0x16f260[_0xbf15('0x7d')];if(_0x527b6e===_0xbf15('0x81')){if(_0xbf15('0x7b')!=typeof _0x16f260[_0xbf15('0x7f')][_0xbf15('0x82')]['admin']){var _0x560823=_0x16f260[_0xbf15('0x7f')]['views'][_0xbf15('0x8a')];if(!/^(f|ht)tps?:\/\//i[_0xbf15('0x8b')](_0x560823)){_0x25e9ea=path[_0xbf15('0x5e')]('plugins',_0x1c9023,_0x5789b0[0x0],_0x560823);}else{_0x25e9ea=_0x560823;}}else{logger[_0xbf15('0x68')]('Warning:\x20admin\x20view\x20not\x20specified');}if('undefined'!=typeof _0x16f260[_0xbf15('0x7f')]['views']['agent']){var _0x56a236=_0x16f260[_0xbf15('0x7f')][_0xbf15('0x82')]['agent'];if(!/^(f|ht)tps?:\/\//i[_0xbf15('0x8b')](_0x56a236)){_0x5454bf=path[_0xbf15('0x5e')](_0xbf15('0x8c'),_0x1c9023,_0x5789b0[0x0],_0x56a236);}else{_0x5454bf=_0x56a236;}}else{logger['info'](_0xbf15('0x8d'));}}else if(_0x527b6e===_0xbf15('0x83')){_0x13e4b5=_0x16f260[_0xbf15('0x7f')][_0xbf15('0x84')];_0x416169=_0x16f260[_0xbf15('0x7f')][_0xbf15('0x85')];if('undefined'!=typeof _0x16f260[_0xbf15('0x7f')][_0xbf15('0x82')]){if(_0xbf15('0x7b')!=typeof _0x16f260['parameters'][_0xbf15('0x82')][_0xbf15('0x8a')]){var _0x560823=_0x16f260[_0xbf15('0x7f')][_0xbf15('0x82')][_0xbf15('0x8a')];if(!/^(f|ht)tps?:\/\//i[_0xbf15('0x8b')](_0x560823)){_0x25e9ea=path['join']('plugins',_0x1c9023,_0x5789b0[0x0],_0x560823);}else{_0x25e9ea=_0x560823;}}if(_0xbf15('0x7b')!=typeof _0x16f260[_0xbf15('0x7f')]['views'][_0xbf15('0x8e')]){var _0x56a236=_0x16f260['parameters'][_0xbf15('0x82')][_0xbf15('0x8e')];if(!/^(f|ht)tps?:\/\//i[_0xbf15('0x8b')](_0x56a236)){_0x5454bf=path[_0xbf15('0x5e')]('plugins',_0x1c9023,_0x5789b0[0x0],_0x56a236);}else{_0x5454bf=_0x56a236;}}}}var _0x1c0350={'name':_0x39624f,'description':_0x224d4c,'path':path[_0xbf15('0x5e')](_0x1c9023,_0x5789b0[0x0]),'type':_0x527b6e,'sidebar':_0xd862d7,'icon':_0x142450,'adminUrl':_0x25e9ea,'agentUrl':_0x5454bf,'scriptName':_0x13e4b5,'scriptPath':_0x416169,'version':_0x4cde49};removeReferences(_0x1c304e,null);return db[_0xbf15('0x44')][_0xbf15('0x8f')](_0x1c0350)[_0xbf15('0x2b')](function(_0x34cb05){var _0x104c29={'role':_0x3c81ae[_0xbf15('0x90')][_0xbf15('0x91')],'userProfileId':_0x3c81ae[_0xbf15('0x90')][_0xbf15('0x92')]};if(!_0x104c29)throw new Error(_0xbf15('0x93'));if(_0x104c29[_0xbf15('0x91')]===_0xbf15('0x94')){var _0x3ae5e6=_0x34cb05['get']({'plain':!![]});return db[_0xbf15('0x95')][_0xbf15('0x4f')]({'where':{'name':_0xbf15('0x2e'),'userProfileId':_0x104c29[_0xbf15('0x92')]},'raw':!![]})[_0xbf15('0x2b')](function(_0x1b003e){if(_0x1b003e&&_0x1b003e[_0xbf15('0x96')]===0x0){return db['UserProfileResource'][_0xbf15('0x8f')]({'name':_0x3ae5e6[_0xbf15('0x31')],'resourceId':_0x3ae5e6['id'],'type':_0x1b003e[_0xbf15('0x31')],'sectionId':_0x1b003e['id']},{})['then'](function(){return _0x34cb05;});}else{return _0x34cb05;}})[_0xbf15('0x4a')](function(_0x4cc6f5){logger[_0xbf15('0x2f')](_0xbf15('0x97'),_0x4cc6f5);throw _0x4cc6f5;});}return _0x34cb05;})[_0xbf15('0x2b')](respondWithResult(_0x33ddd7,null))['catch'](handleError(_0x33ddd7,null));}});}catch(_0x1d55a7){_0x33ddd7[_0xbf15('0x23')](0x1f4)[_0xbf15('0x32')](_0x1d55a7);}};function removeReferences(_0x371ae9,_0x4584ec){try{if(_0x371ae9){fs[_0xbf15('0x67')](_0x371ae9);logger[_0xbf15('0x68')](_0xbf15('0x98'));}if(_0x4584ec){rimraf(_0x4584ec,function(){});logger['info'](_0xbf15('0x99'));}}catch(_0x2d49b6){logger[_0xbf15('0x2f')](_0x2d49b6);}}exports['update']=function(_0xca8eb2,_0x34778d,_0x38c482){return db[_0xbf15('0x44')]['find']({'where':{'id':_0xca8eb2[_0xbf15('0x4c')]['id']}})[_0xbf15('0x2b')](handleEntityNotFound(_0x34778d,null))[_0xbf15('0x2b')](saveUpdates(_0xca8eb2[_0xbf15('0x90')],null))[_0xbf15('0x2b')](respondWithResult(_0x34778d,null))[_0xbf15('0x4a')](handleError(_0x34778d,null));};exports[_0xbf15('0x9a')]=function(_0x1fff0f,_0x53321a,_0x5f452a){return db[_0xbf15('0x44')]['find']({'where':{'id':_0x1fff0f[_0xbf15('0x4c')]['id']}})[_0xbf15('0x2b')](function(_0x3e0bc9){if(_0x3e0bc9){return _0x3e0bc9[_0xbf15('0x2c')]();}})['then'](function(_0x385b32){rimraf(path['join'](config[_0xbf15('0x51')],'server/files/plugins',path[_0xbf15('0x9b')](_0x385b32['path'])),function(){});return _0x385b32;})[_0xbf15('0x2b')](handleEntityNotFound(_0x53321a,null))[_0xbf15('0x2b')](respondWithStatusCode(_0x53321a,null))['catch'](handleError(_0x53321a,null));};exports[_0xbf15('0x9c')]=function(_0x27e928,_0x5a0ef6,_0x32d07a){return BPromise['resolve']()[_0xbf15('0x2b')](function(){if(!_0x27e928[_0xbf15('0x39')][_0xbf15('0x7')]){throw new Error(_0xbf15('0x9d'));}if(!_0x27e928['query']['port']){throw new Error(_0xbf15('0x9e'));}var _0x468369=_0x27e928[_0xbf15('0x39')][_0xbf15('0x9f')]?_0x27e928[_0xbf15('0x39')][_0xbf15('0x9f')]+':'+_0x27e928['query']['port']:_0xbf15('0xa0')+_0x27e928[_0xbf15('0x39')][_0xbf15('0xa1')];var _0x456a43=_0x27e928[_0xbf15('0x39')][_0xbf15('0x25')]?_0x27e928[_0xbf15('0x39')][_0xbf15('0x25')]:!![];var _0x57646c=_0x27e928[_0xbf15('0x39')][_0xbf15('0xa2')]?_0x27e928[_0xbf15('0x39')][_0xbf15('0xa2')]:null;var _0xbf406d={'method':_0x27e928[_0xbf15('0xa3')],'uri':util[_0xbf15('0x53')]('%s%s',_0x468369,_0x27e928[_0xbf15('0x39')][_0xbf15('0x7')]),'json':_0x456a43,'resolveWithFullResponse':!![],'encoding':_0x57646c,'qs':_0x27e928[_0xbf15('0x39')]};if(_0x27e928[_0xbf15('0xa4')]){_0xbf406d[_0xbf15('0xa4')]=_0x27e928['headers'];if(_0xbf406d[_0xbf15('0xa4')][_0xbf15('0xa5')]){delete _0xbf406d[_0xbf15('0xa4')][_0xbf15('0xa5')];}}if(_0xbf406d['headers'][_0xbf15('0xa6')]){delete _0xbf406d[_0xbf15('0xa4')][_0xbf15('0xa6')];}return rp(_0xbf406d);})[_0xbf15('0x2b')](function(_0x549162){if(_0x549162){_0x5a0ef6[_0xbf15('0x28')](_0x549162['headers']);logger[_0xbf15('0x68')](_0x549162[_0xbf15('0x90')]);if(_[_0xbf15('0xa7')](_0x27e928[_0xbf15('0x39')][_0xbf15('0x7')],_0xbf15('0x50'))&&_0x549162['statusCode']==0x1f4){return _0x5a0ef6[_0xbf15('0x22')](_0x549162[_0xbf15('0xa8')]);}else{return _0x5a0ef6[_0xbf15('0x23')](_0x549162['statusCode'])[_0xbf15('0x32')](_0x549162[_0xbf15('0x90')]);}}else{return _0x5a0ef6[_0xbf15('0x22')](0xc8);}})[_0xbf15('0x4a')](handleError(_0x5a0ef6,null));};exports[_0xbf15('0xa9')]=function(_0x1d8f6b,_0xe3ec56,_0x4b4f2a){return BPromise[_0xbf15('0xaa')]()[_0xbf15('0x2b')](function(){if(!_0x1d8f6b[_0xbf15('0x39')][_0xbf15('0x7')]){throw new Error(_0xbf15('0x9d'));}if(!_0x1d8f6b[_0xbf15('0x39')][_0xbf15('0xa1')]){throw new Error(_0xbf15('0x9e'));}var _0x3920c7=_0x1d8f6b[_0xbf15('0x39')][_0xbf15('0x9f')]?_0x1d8f6b['query'][_0xbf15('0x9f')]+':'+_0x1d8f6b['query'][_0xbf15('0xa1')]:_0xbf15('0xa0')+_0x1d8f6b[_0xbf15('0x39')]['port'];var _0x441e7a=_0x1d8f6b['query']['json']?_0x1d8f6b[_0xbf15('0x39')]['json']:!![];var _0x156542=_0x1d8f6b[_0xbf15('0x39')][_0xbf15('0xa2')]?_0x1d8f6b[_0xbf15('0x39')]['encoding']:null;var _0x20fbe3={'method':_0x1d8f6b[_0xbf15('0xa3')],'uri':util[_0xbf15('0x53')]('%s%s',_0x3920c7,_0x1d8f6b[_0xbf15('0x39')]['path']),'json':_0x441e7a,'resolveWithFullResponse':!![],'encoding':_0x156542,'body':_0x1d8f6b['body']};if(_0x1d8f6b['headers']){_0x20fbe3['headers']=_0x1d8f6b[_0xbf15('0xa4')];if(_0x20fbe3[_0xbf15('0xa4')][_0xbf15('0xa5')]){delete _0x20fbe3['headers'][_0xbf15('0xa5')];}}if(_0x20fbe3[_0xbf15('0xa4')][_0xbf15('0xa6')]){delete _0x20fbe3[_0xbf15('0xa4')][_0xbf15('0xa6')];}return rp(_0x20fbe3);})[_0xbf15('0x2b')](function(_0x2a289a){if(_0x2a289a){_0xe3ec56[_0xbf15('0x28')](_0x2a289a[_0xbf15('0xa4')]);logger[_0xbf15('0x68')](_0x2a289a['body']);return _0xe3ec56['status'](_0x2a289a[_0xbf15('0xa8')])[_0xbf15('0x32')](_0x2a289a[_0xbf15('0x90')]);}else{return _0xe3ec56['sendStatus'](0xc8);}})['catch'](handleError(_0xe3ec56,null));};
\ No newline at end of file
+var _0x90c0=['path','join','root','server/files/plugins','format','%s.zip','basename','zip','warning','error','Sequelize','Error','Error\x20while\x20generating\x20the\x20zip\x20archive','pipe','**/*','node_modules/**/*','attachments/**/*','finalize','close','existsSync','Plugin\x20not\x20found','Error\x20while\x20downloading\x20the\x20plugin','unlinkSync','info','Download\x20completed','Temporary\x20file\x20removed','upload','file','extname','filename','chmodSync','readdirSync','Invalid\x20plugin\x20structure','lstatSync','isFile','isDirectory','manifest.json','parse','undefined','Invalid\x20manifest:\x20name\x20missing','Invalid\x20manifest:\x20type\x20missing','Invalid\x20manifest:\x20version\x20not\x20specified','parameters','Invalid\x20manifest:\x20parameters\x20missing','html','views','agent','Invalid\x20manifest:\x20no\x20view\x20specified','Invalid\x20manifest:\x20script\x20name\x20missing','scriptPath','Invalid\x20manifest:\x20script\x20path\x20missing','Invalid\x20manifest:\x20invalid\x20type','description','sidebar','always','icon','icon-apps','version','admin','test','plugins','Warning:\x20admin\x20view\x20not\x20specified','Warning:\x20agent\x20view\x20not\x20specified','script','scriptName','body','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','Extracted\x20folder\x20removed','params','delete','dirname','resolve','\x27PATH\x27\x20parameter\x20not\x20specified','port','\x27PORT\x27\x20parameter\x20not\x20specified','hostname','http://localhost:','encoding','%s%s','headers','content-length','content-type','set','endsWith','statusCode','webhookPost','html-pdf','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','sox','to-csv','lodash','crypto','jsforce','desk.js','querystring','extract-zip','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','defaults','redis','localhost','./plugin.socket','register','sendStatus','status','json','count','offset','Content-Range','apply','reject','save','update','then','destroy','get','Plugins','UserProfileResource','end','stack','name','send','index','map','Plugin','rawAttributes','fieldName','key','model','keys','query','filters','intersection','fields','attributes','length','nolimit','order','pick','filter','merge','where','type','VIRTUAL','options','includeAll','include','rows','catch','show','find','download'];(function(_0x165e91,_0x2cce67){var _0x1dc256=function(_0x1a45cb){while(--_0x1a45cb){_0x165e91['push'](_0x165e91['shift']());}};_0x1dc256(++_0x2cce67);}(_0x90c0,0x1b2));var _0x090c=function(_0x48cb1f,_0x5ca68d){_0x48cb1f=_0x48cb1f-0x0;var _0x172c4d=_0x90c0[_0x48cb1f];return _0x172c4d;};'use strict';var pdf=require(_0x090c('0x0'));var emlformat=require(_0x090c('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x090c('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x090c('0x3'));var moment=require(_0x090c('0x4'));var BPromise=require(_0x090c('0x5'));var Mustache=require(_0x090c('0x6'));var util=require(_0x090c('0x7'));var path=require('path');var sox=require(_0x090c('0x8'));var csv=require(_0x090c('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x090c('0xa'));var squel=require('squel');var crypto=require(_0x090c('0xb'));var jsforce=require(_0x090c('0xc'));var deskjs=require(_0x090c('0xd'));var toCsv=require('to-csv');var querystring=require(_0x090c('0xe'));var Papa=require('papaparse');var extract=require(_0x090c('0xf'));var rimraf=require('rimraf');var archiver=require('archiver');var Redis=require(_0x090c('0x10'));var authService=require(_0x090c('0x11'));var qs=require(_0x090c('0x12'));var as=require(_0x090c('0x13'));var hardwareService=require(_0x090c('0x14'));var logger=require(_0x090c('0x15'))(_0x090c('0x16'));var utils=require(_0x090c('0x17'));var config=require('../../config/environment');var db=require(_0x090c('0x18'))['db'];config['redis']=_[_0x090c('0x19')](config[_0x090c('0x1a')],{'host':_0x090c('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x090c('0x1a')]));require(_0x090c('0x1c'))[_0x090c('0x1d')](socket);function respondWithStatusCode(_0xb647a0,_0x3f0245){_0x3f0245=_0x3f0245||0xcc;return function(_0x216da1){if(_0x216da1){return _0xb647a0[_0x090c('0x1e')](_0x3f0245);}return _0xb647a0[_0x090c('0x1f')](_0x3f0245)['end']();};}function respondWithResult(_0x2978a2,_0x826c63){_0x826c63=_0x826c63||0xc8;return function(_0x162027){if(_0x162027){return _0x2978a2[_0x090c('0x1f')](_0x826c63)[_0x090c('0x20')](_0x162027);}};}function respondWithFilteredResult(_0xd59343,_0x2d0750){return function(_0x43ec3f){if(_0x43ec3f){var _0x1bb6df=_0x43ec3f[_0x090c('0x21')],_0x6ee851=_0x2d0750[_0x090c('0x22')],_0x4c103e=_0x2d0750['offset']+_0x2d0750['limit'],_0x35b850;if(_0x4c103e>=_0x1bb6df){_0x4c103e=_0x1bb6df;_0x35b850=0xc8;}else{_0x35b850=0xce;}_0xd59343[_0x090c('0x1f')](_0x35b850);return _0xd59343['set'](_0x090c('0x23'),_0x6ee851+'-'+_0x4c103e+'/'+_0x1bb6df)[_0x090c('0x20')](_0x43ec3f);}return null;};}function patchUpdates(_0x15d322){return function(_0x36b92b){try{jsonpatch[_0x090c('0x24')](_0x36b92b,_0x15d322,!![]);}catch(_0x4b06ca){return BPromise[_0x090c('0x25')](_0x4b06ca);}return _0x36b92b[_0x090c('0x26')]();};}function saveUpdates(_0x52bfe1,_0x59d743){return function(_0x254fba){if(_0x254fba){return _0x254fba[_0x090c('0x27')](_0x52bfe1)[_0x090c('0x28')](function(_0x1a90a6){return _0x1a90a6;});}return null;};}function removeEntity(_0xe56251,_0x3f42b0){return function(_0x244555){if(_0x244555){return _0x244555[_0x090c('0x29')]()[_0x090c('0x28')](function(){var _0x51c6a7=_0x244555[_0x090c('0x2a')]({'plain':!![]});var _0x3a78cb=_0x090c('0x2b');return db[_0x090c('0x2c')][_0x090c('0x29')]({'where':{'type':_0x3a78cb,'resourceId':_0x51c6a7['id']}})[_0x090c('0x28')](function(){return _0x244555;});})['then'](function(){_0xe56251['status'](0xcc)[_0x090c('0x2d')]();});}};}function handleEntityNotFound(_0x58824e,_0x2fbc10){return function(_0x313d86){if(!_0x313d86){_0x58824e[_0x090c('0x1e')](0x194);}return _0x313d86;};}function handleError(_0x4ba3f4,_0x120015){_0x120015=_0x120015||0x1f4;return function(_0x2a87f5){logger['error'](_0x2a87f5[_0x090c('0x2e')]);if(_0x2a87f5[_0x090c('0x2f')]){delete _0x2a87f5[_0x090c('0x2f')];}_0x4ba3f4[_0x090c('0x1f')](_0x120015)[_0x090c('0x30')](_0x2a87f5);};}exports[_0x090c('0x31')]=function(_0x5e9054,_0x26ac42){var _0x26b8ba={},_0x2c2ad2={},_0x2a5157={'count':0x0,'rows':[]};var _0x3f94f9=_[_0x090c('0x32')](db[_0x090c('0x33')][_0x090c('0x34')],function(_0x506ab3){return{'name':_0x506ab3[_0x090c('0x35')],'type':_0x506ab3['type'][_0x090c('0x36')]};});_0x2c2ad2[_0x090c('0x37')]=_[_0x090c('0x32')](_0x3f94f9,_0x090c('0x2f'));_0x2c2ad2['query']=_[_0x090c('0x38')](_0x5e9054[_0x090c('0x39')]);_0x2c2ad2[_0x090c('0x3a')]=_[_0x090c('0x3b')](_0x2c2ad2['model'],_0x2c2ad2[_0x090c('0x39')]);_0x26b8ba['attributes']=_[_0x090c('0x3b')](_0x2c2ad2[_0x090c('0x37')],qs[_0x090c('0x3c')](_0x5e9054[_0x090c('0x39')][_0x090c('0x3c')]));_0x26b8ba['attributes']=_0x26b8ba[_0x090c('0x3d')][_0x090c('0x3e')]?_0x26b8ba[_0x090c('0x3d')]:_0x2c2ad2[_0x090c('0x37')];if(!_0x5e9054[_0x090c('0x39')]['hasOwnProperty'](_0x090c('0x3f'))){_0x26b8ba['limit']=qs['limit'](_0x5e9054[_0x090c('0x39')]['limit']);_0x26b8ba['offset']=qs[_0x090c('0x22')](_0x5e9054[_0x090c('0x39')][_0x090c('0x22')]);}_0x26b8ba[_0x090c('0x40')]=qs['sort'](_0x5e9054['query']['sort']);_0x26b8ba['where']=qs['filters'](_[_0x090c('0x41')](_0x5e9054['query'],_0x2c2ad2['filters']),_0x3f94f9);if(_0x5e9054[_0x090c('0x39')][_0x090c('0x42')]){_0x26b8ba['where']=_[_0x090c('0x43')](_0x26b8ba[_0x090c('0x44')],{'$or':_[_0x090c('0x32')](_0x3f94f9,function(_0x3bc749){if(_0x3bc749[_0x090c('0x45')]!==_0x090c('0x46')){var _0x13527c={};_0x13527c[_0x3bc749[_0x090c('0x2f')]]={'$like':'%'+_0x5e9054[_0x090c('0x39')]['filter']+'%'};return _0x13527c;}})});}_0x26b8ba=_[_0x090c('0x43')]({},_0x26b8ba,_0x5e9054[_0x090c('0x47')]);var _0x59ad99={'where':_0x26b8ba[_0x090c('0x44')]};return db[_0x090c('0x33')][_0x090c('0x21')](_0x59ad99)[_0x090c('0x28')](function(_0x3f9f78){_0x2a5157[_0x090c('0x21')]=_0x3f9f78;if(_0x5e9054['query'][_0x090c('0x48')]){_0x26b8ba[_0x090c('0x49')]=[{'all':!![]}];}return db['Plugin']['findAll'](_0x26b8ba);})[_0x090c('0x28')](function(_0x5313f6){_0x2a5157[_0x090c('0x4a')]=_0x5313f6;return _0x2a5157;})['then'](respondWithFilteredResult(_0x26ac42,_0x26b8ba))[_0x090c('0x4b')](handleError(_0x26ac42,null));};exports[_0x090c('0x4c')]=function(_0x326124,_0xc79519){var _0x54ce70={'raw':!![],'where':{'id':_0x326124['params']['id']}},_0x1ca838={};_0x1ca838[_0x090c('0x37')]=_[_0x090c('0x38')](db[_0x090c('0x33')][_0x090c('0x34')]);_0x1ca838[_0x090c('0x39')]=_[_0x090c('0x38')](_0x326124[_0x090c('0x39')]);_0x1ca838[_0x090c('0x3a')]=_[_0x090c('0x3b')](_0x1ca838['model'],_0x1ca838[_0x090c('0x39')]);_0x54ce70['attributes']=_[_0x090c('0x3b')](_0x1ca838['model'],qs['fields'](_0x326124[_0x090c('0x39')][_0x090c('0x3c')]));_0x54ce70[_0x090c('0x3d')]=_0x54ce70['attributes']['length']?_0x54ce70['attributes']:_0x1ca838[_0x090c('0x37')];if(_0x326124[_0x090c('0x39')][_0x090c('0x48')]){_0x54ce70['include']=[{'all':!![]}];}_0x54ce70=_['merge']({},_0x54ce70,_0x326124[_0x090c('0x47')]);return db[_0x090c('0x33')][_0x090c('0x4d')](_0x54ce70)['then'](handleEntityNotFound(_0xc79519,null))[_0x090c('0x28')](respondWithResult(_0xc79519,null))[_0x090c('0x4b')](handleError(_0xc79519,null));};exports[_0x090c('0x4e')]=function(_0x55a26d,_0x2a3740,_0x572abb){return db[_0x090c('0x33')][_0x090c('0x4d')]({'where':{'id':_0x55a26d['params']['id']},'attributes':['name',_0x090c('0x4f')],'raw':!![]})['then'](handleEntityNotFound(_0x2a3740,null))['then'](function(_0x3621b3){if(_0x3621b3){var _0x3181e5=path[_0x090c('0x50')](config[_0x090c('0x51')],_0x090c('0x52'),util[_0x090c('0x53')](_0x090c('0x54'),path[_0x090c('0x55')](_0x3621b3['path'])));var _0x3d5ffb=fs['createWriteStream'](_0x3181e5);var _0x274d54=archiver(_0x090c('0x56'),{'zlib':{'level':0x9}});_0x274d54['on'](_0x090c('0x57'),function(_0x3264a9){if(_0x3264a9['code']==='ENOENT'){logger[_0x090c('0x58')](_0x3264a9);}else{throw new db[(_0x090c('0x59'))][(_0x090c('0x5a'))](_0x090c('0x5b'));}});_0x274d54['on'](_0x090c('0x58'),function(_0x187e0f){throw new db[(_0x090c('0x59'))][(_0x090c('0x5a'))](_0x090c('0x5b'));});_0x274d54[_0x090c('0x5c')](_0x3d5ffb);_0x274d54['glob'](_0x090c('0x5d'),{'cwd':path[_0x090c('0x50')](config[_0x090c('0x51')],'server/files/plugins',path['dirname'](_0x3621b3[_0x090c('0x4f')])),'ignore':[path[_0x090c('0x50')](path['basename'](_0x3621b3[_0x090c('0x4f')]),_0x090c('0x5e')),path[_0x090c('0x50')](path['basename'](_0x3621b3[_0x090c('0x4f')]),_0x090c('0x5f'))],'nodir':!![]})[_0x090c('0x60')]();_0x3d5ffb['on'](_0x090c('0x61'),function(){if(!fs[_0x090c('0x62')](_0x3181e5)){throw new db['Sequelize']['Error'](_0x090c('0x63'));}return _0x2a3740['download'](_0x3181e5,util[_0x090c('0x53')](_0x090c('0x54'),path[_0x090c('0x55')](_0x3621b3[_0x090c('0x4f')])),function(_0x33d2ac){if(_0x33d2ac){throw new db[(_0x090c('0x59'))][(_0x090c('0x5a'))](_0x090c('0x64'));}fs[_0x090c('0x65')](_0x3181e5);logger[_0x090c('0x66')](_0x090c('0x67'));logger['info'](_0x090c('0x68'));});});}return null;})['catch'](handleError(_0x2a3740,null));};exports[_0x090c('0x69')]=function(_0x1b058c,_0x5353f1,_0x1d145d){var _0x28bf43=path[_0x090c('0x55')](_0x1b058c[_0x090c('0x6a')]['filename'],path[_0x090c('0x6b')](_0x1b058c[_0x090c('0x6a')][_0x090c('0x6c')]));var _0x3cc710=path['join'](config[_0x090c('0x51')],_0x090c('0x52'),_0x1b058c[_0x090c('0x6a')]['filename']);var _0x5475a8=path[_0x090c('0x50')](config[_0x090c('0x51')],_0x090c('0x52'),_0x28bf43);logger[_0x090c('0x66')]('Plugin\x20upload\x20filepath:\x20%s',_0x3cc710);logger[_0x090c('0x66')]('Plugin\x20upload\x20destination:\x20%s',_0x5475a8);try{fs[_0x090c('0x6d')](_0x3cc710,parseInt('0777',0x8));extract(_0x3cc710,{'dir':_0x5475a8},function(_0x59d999){if(_0x59d999){logger[_0x090c('0x58')](_0x59d999);handleError(_0x59d999,!![]);};var _0x5375be=fs[_0x090c('0x6e')](_0x5475a8);if(_0x5375be[_0x090c('0x3e')]>0x1){removeReferences(_0x3cc710,_0x5475a8);logger[_0x090c('0x58')](_0x090c('0x6f'));return _0x1d145d(new Error(_0x090c('0x6f')));}var _0x4a294c=fs[_0x090c('0x70')](path[_0x090c('0x50')](_0x5475a8,_0x5375be[0x0]));if(_0x4a294c[_0x090c('0x71')]()){removeReferences(_0x3cc710,_0x5475a8);logger['error'](_0x090c('0x6f'));return _0x1d145d(new Error(_0x090c('0x6f')));}if(_0x4a294c[_0x090c('0x72')]()){var _0x1df686=fs['readdirSync'](path[_0x090c('0x50')](_0x5475a8,_0x5375be[0x0]));if(_0x1df686['length']===0x0){removeReferences(_0x3cc710,_0x5475a8);logger[_0x090c('0x58')](_0x090c('0x6f'));return _0x1d145d(new Error('Invalid\x20plugin\x20structure'));}var _0x427de9=_0x1df686['some'](function(_0xf0d78e){return _0xf0d78e===_0x090c('0x73');});if(!_0x427de9){return _0x1d145d(new Error('Plugin\x20manifest\x20missing'));}var _0x12caba=fs['readFileSync'](path[_0x090c('0x50')](_0x5475a8,_0x5375be[0x0],_0x090c('0x73')));var _0x5594e5=JSON[_0x090c('0x74')](_0x12caba);if(_0x090c('0x75')==typeof _0x5594e5[_0x090c('0x2f')]){return _0x1d145d(new Error(_0x090c('0x76')));}if('undefined'==typeof _0x5594e5[_0x090c('0x45')]){return _0x1d145d(new Error(_0x090c('0x77')));}if(_0x090c('0x75')==typeof _0x5594e5['version']){return _0x1d145d(new Error(_0x090c('0x78')));}if(_0x090c('0x75')==typeof _0x5594e5[_0x090c('0x79')]){return _0x1d145d(new Error(_0x090c('0x7a')));}if(_0x5594e5[_0x090c('0x45')]===_0x090c('0x7b')){if(_0x090c('0x75')==typeof _0x5594e5[_0x090c('0x79')][_0x090c('0x7c')]){return _0x1d145d(new Error('Invalid\x20manifest:\x20views\x20missing'));}if(_0x090c('0x75')==typeof _0x5594e5[_0x090c('0x79')][_0x090c('0x7c')]['admin']&&'undefined'==typeof _0x5594e5[_0x090c('0x79')]['views'][_0x090c('0x7d')]){return _0x1d145d(new Error(_0x090c('0x7e')));}}else if(_0x5594e5[_0x090c('0x45')]==='script'){if(_0x090c('0x75')==typeof _0x5594e5['parameters']['scriptName']){return _0x1d145d(new Error(_0x090c('0x7f')));}if(_0x090c('0x75')==typeof _0x5594e5['parameters'][_0x090c('0x80')]){return _0x1d145d(new Error(_0x090c('0x81')));}}else{return _0x1d145d(new Error(_0x090c('0x82')));}var _0x238c0c=_0x5594e5[_0x090c('0x2f')];var _0x230d74=_0x5594e5[_0x090c('0x83')];var _0x464cd5=_0x5594e5[_0x090c('0x45')];var _0x27b9d4=_0x5594e5[_0x090c('0x84')]?_0x5594e5[_0x090c('0x84')]:_0x090c('0x85');var _0x4cd62a=_0x5594e5['icon']?_0x5594e5[_0x090c('0x86')]:_0x090c('0x87');var _0x5c80fd='';var _0x2f9b20='';var _0x127b1d='';var _0x251acc='';var _0x1e5295=_0x5594e5[_0x090c('0x88')];if(_0x464cd5===_0x090c('0x7b')){if('undefined'!=typeof _0x5594e5[_0x090c('0x79')][_0x090c('0x7c')][_0x090c('0x89')]){var _0x4a7c84=_0x5594e5[_0x090c('0x79')][_0x090c('0x7c')][_0x090c('0x89')];if(!/^(f|ht)tps?:\/\//i[_0x090c('0x8a')](_0x4a7c84)){_0x5c80fd=path['join'](_0x090c('0x8b'),_0x28bf43,_0x5375be[0x0],_0x4a7c84);}else{_0x5c80fd=_0x4a7c84;}}else{logger['info'](_0x090c('0x8c'));}if('undefined'!=typeof _0x5594e5[_0x090c('0x79')]['views'][_0x090c('0x7d')]){var _0x213cba=_0x5594e5[_0x090c('0x79')][_0x090c('0x7c')][_0x090c('0x7d')];if(!/^(f|ht)tps?:\/\//i[_0x090c('0x8a')](_0x213cba)){_0x2f9b20=path[_0x090c('0x50')](_0x090c('0x8b'),_0x28bf43,_0x5375be[0x0],_0x213cba);}else{_0x2f9b20=_0x213cba;}}else{logger['info'](_0x090c('0x8d'));}}else if(_0x464cd5===_0x090c('0x8e')){_0x127b1d=_0x5594e5[_0x090c('0x79')][_0x090c('0x8f')];_0x251acc=_0x5594e5[_0x090c('0x79')][_0x090c('0x80')];if(_0x090c('0x75')!=typeof _0x5594e5[_0x090c('0x79')][_0x090c('0x7c')]){if(_0x090c('0x75')!=typeof _0x5594e5[_0x090c('0x79')][_0x090c('0x7c')][_0x090c('0x89')]){var _0x4a7c84=_0x5594e5[_0x090c('0x79')][_0x090c('0x7c')][_0x090c('0x89')];if(!/^(f|ht)tps?:\/\//i[_0x090c('0x8a')](_0x4a7c84)){_0x5c80fd=path[_0x090c('0x50')](_0x090c('0x8b'),_0x28bf43,_0x5375be[0x0],_0x4a7c84);}else{_0x5c80fd=_0x4a7c84;}}if('undefined'!=typeof _0x5594e5[_0x090c('0x79')][_0x090c('0x7c')]['agent']){var _0x213cba=_0x5594e5[_0x090c('0x79')][_0x090c('0x7c')]['agent'];if(!/^(f|ht)tps?:\/\//i[_0x090c('0x8a')](_0x213cba)){_0x2f9b20=path['join'](_0x090c('0x8b'),_0x28bf43,_0x5375be[0x0],_0x213cba);}else{_0x2f9b20=_0x213cba;}}}}var _0x261c90={'name':_0x238c0c,'description':_0x230d74,'path':path[_0x090c('0x50')](_0x28bf43,_0x5375be[0x0]),'type':_0x464cd5,'sidebar':_0x27b9d4,'icon':_0x4cd62a,'adminUrl':_0x5c80fd,'agentUrl':_0x2f9b20,'scriptName':_0x127b1d,'scriptPath':_0x251acc,'version':_0x1e5295};removeReferences(_0x3cc710,null);return db[_0x090c('0x33')]['create'](_0x261c90)[_0x090c('0x28')](function(_0x302d71){var _0x3334e8={'role':_0x1b058c[_0x090c('0x90')]['role'],'userProfileId':_0x1b058c[_0x090c('0x90')][_0x090c('0x91')]};if(!_0x3334e8)throw new Error(_0x090c('0x92'));if(_0x3334e8[_0x090c('0x93')]===_0x090c('0x94')){var _0x5a610d=_0x302d71[_0x090c('0x2a')]({'plain':!![]});return db[_0x090c('0x95')][_0x090c('0x4d')]({'where':{'name':'Plugins','userProfileId':_0x3334e8[_0x090c('0x91')]},'raw':!![]})['then'](function(_0x4e76e9){if(_0x4e76e9&&_0x4e76e9['autoAssociation']===0x0){return db[_0x090c('0x2c')][_0x090c('0x96')]({'name':_0x5a610d[_0x090c('0x2f')],'resourceId':_0x5a610d['id'],'type':_0x4e76e9[_0x090c('0x2f')],'sectionId':_0x4e76e9['id']},{})[_0x090c('0x28')](function(){return _0x302d71;});}else{return _0x302d71;}})[_0x090c('0x4b')](function(_0x3adbf6){logger[_0x090c('0x58')](_0x090c('0x97'),_0x3adbf6);throw _0x3adbf6;});}return _0x302d71;})[_0x090c('0x28')](respondWithResult(_0x5353f1,null))[_0x090c('0x4b')](handleError(_0x5353f1,null));}});}catch(_0xeef062){_0x5353f1[_0x090c('0x1f')](0x1f4)[_0x090c('0x30')](_0xeef062);}};function removeReferences(_0xd5eb25,_0x4f7a72){try{if(_0xd5eb25){fs[_0x090c('0x65')](_0xd5eb25);logger[_0x090c('0x66')]('Zip\x20archive\x20removed');}if(_0x4f7a72){rimraf(_0x4f7a72,function(){});logger[_0x090c('0x66')](_0x090c('0x98'));}}catch(_0x5a4c61){logger[_0x090c('0x58')](_0x5a4c61);}}exports['update']=function(_0x5d06b1,_0x1c7368,_0xa8b62c){return db[_0x090c('0x33')]['find']({'where':{'id':_0x5d06b1[_0x090c('0x99')]['id']}})[_0x090c('0x28')](handleEntityNotFound(_0x1c7368,null))[_0x090c('0x28')](saveUpdates(_0x5d06b1[_0x090c('0x90')],null))[_0x090c('0x28')](respondWithResult(_0x1c7368,null))['catch'](handleError(_0x1c7368,null));};exports[_0x090c('0x9a')]=function(_0x5ef527,_0x3a4bb6,_0xead955){return db[_0x090c('0x33')][_0x090c('0x4d')]({'where':{'id':_0x5ef527[_0x090c('0x99')]['id']}})[_0x090c('0x28')](function(_0x537d40){if(_0x537d40){return _0x537d40[_0x090c('0x29')]();}})[_0x090c('0x28')](function(_0x5e8f8f){rimraf(path[_0x090c('0x50')](config[_0x090c('0x51')],_0x090c('0x52'),path[_0x090c('0x9b')](_0x5e8f8f[_0x090c('0x4f')])),function(){});return _0x5e8f8f;})['then'](handleEntityNotFound(_0x3a4bb6,null))[_0x090c('0x28')](respondWithStatusCode(_0x3a4bb6,null))[_0x090c('0x4b')](handleError(_0x3a4bb6,null));};exports['webhookGet']=function(_0x1e96ce,_0x2d1cd5,_0x433698){return BPromise[_0x090c('0x9c')]()[_0x090c('0x28')](function(){if(!_0x1e96ce[_0x090c('0x39')][_0x090c('0x4f')]){throw new Error(_0x090c('0x9d'));}if(!_0x1e96ce[_0x090c('0x39')][_0x090c('0x9e')]){throw new Error(_0x090c('0x9f'));}var _0x6a4d3e=_0x1e96ce[_0x090c('0x39')]['hostname']?_0x1e96ce['query'][_0x090c('0xa0')]+':'+_0x1e96ce[_0x090c('0x39')][_0x090c('0x9e')]:_0x090c('0xa1')+_0x1e96ce[_0x090c('0x39')][_0x090c('0x9e')];var _0x1200d0=_0x1e96ce['query'][_0x090c('0x20')]?_0x1e96ce[_0x090c('0x39')][_0x090c('0x20')]:!![];var _0xfff95b=_0x1e96ce['query'][_0x090c('0xa2')]?_0x1e96ce[_0x090c('0x39')][_0x090c('0xa2')]:null;var _0x2eed73={'method':_0x1e96ce['method'],'uri':util[_0x090c('0x53')](_0x090c('0xa3'),_0x6a4d3e,_0x1e96ce[_0x090c('0x39')][_0x090c('0x4f')]),'json':_0x1200d0,'resolveWithFullResponse':!![],'encoding':_0xfff95b,'qs':_0x1e96ce[_0x090c('0x39')]};if(_0x1e96ce[_0x090c('0xa4')]){_0x2eed73['headers']=_0x1e96ce['headers'];if(_0x2eed73[_0x090c('0xa4')][_0x090c('0xa5')]){delete _0x2eed73[_0x090c('0xa4')][_0x090c('0xa5')];}}if(_0x2eed73[_0x090c('0xa4')][_0x090c('0xa6')]){delete _0x2eed73[_0x090c('0xa4')]['content-type'];}return rp(_0x2eed73);})[_0x090c('0x28')](function(_0x1fbc99){if(_0x1fbc99){_0x2d1cd5[_0x090c('0xa7')](_0x1fbc99[_0x090c('0xa4')]);logger[_0x090c('0x66')](_0x1fbc99[_0x090c('0x90')]);if(_[_0x090c('0xa8')](_0x1e96ce[_0x090c('0x39')][_0x090c('0x4f')],_0x090c('0x4e'))&&_0x1fbc99[_0x090c('0xa9')]==0x1f4){return _0x2d1cd5['sendStatus'](_0x1fbc99[_0x090c('0xa9')]);}else{return _0x2d1cd5[_0x090c('0x1f')](_0x1fbc99['statusCode'])[_0x090c('0x30')](_0x1fbc99['body']);}}else{return _0x2d1cd5['sendStatus'](0xc8);}})['catch'](handleError(_0x2d1cd5,null));};exports[_0x090c('0xaa')]=function(_0x288460,_0x2e0049,_0x520e9e){return BPromise['resolve']()[_0x090c('0x28')](function(){if(!_0x288460[_0x090c('0x39')][_0x090c('0x4f')]){throw new Error(_0x090c('0x9d'));}if(!_0x288460['query']['port']){throw new Error(_0x090c('0x9f'));}var _0x591f26=_0x288460['query'][_0x090c('0xa0')]?_0x288460[_0x090c('0x39')]['hostname']+':'+_0x288460[_0x090c('0x39')]['port']:'http://localhost:'+_0x288460[_0x090c('0x39')][_0x090c('0x9e')];var _0x28b3ac=_0x288460[_0x090c('0x39')][_0x090c('0x20')]?_0x288460['query'][_0x090c('0x20')]:!![];var _0x2c886c=_0x288460['query'][_0x090c('0xa2')]?_0x288460[_0x090c('0x39')][_0x090c('0xa2')]:null;var _0x3564f8={'method':_0x288460['method'],'uri':util[_0x090c('0x53')](_0x090c('0xa3'),_0x591f26,_0x288460[_0x090c('0x39')]['path']),'json':_0x28b3ac,'resolveWithFullResponse':!![],'encoding':_0x2c886c,'body':_0x288460[_0x090c('0x90')]};if(_0x288460[_0x090c('0xa4')]){_0x3564f8[_0x090c('0xa4')]=_0x288460[_0x090c('0xa4')];if(_0x3564f8[_0x090c('0xa4')][_0x090c('0xa5')]){delete _0x3564f8[_0x090c('0xa4')]['content-length'];}}if(_0x3564f8[_0x090c('0xa4')][_0x090c('0xa6')]){delete _0x3564f8[_0x090c('0xa4')]['content-type'];}return rp(_0x3564f8);})['then'](function(_0x3b8f35){if(_0x3b8f35){_0x2e0049[_0x090c('0xa7')](_0x3b8f35['headers']);logger[_0x090c('0x66')](_0x3b8f35['body']);return _0x2e0049['status'](_0x3b8f35['statusCode'])[_0x090c('0x30')](_0x3b8f35[_0x090c('0x90')]);}else{return _0x2e0049['sendStatus'](0xc8);}})[_0x090c('0x4b')](handleError(_0x2e0049,null));};
\ No newline at end of file
diff --git a/server/api/plugin/plugin.events.js b/server/api/plugin/plugin.events.js
index c71f8d3..c7d485f 100644
--- a/server/api/plugin/plugin.events.js
+++ b/server/api/plugin/plugin.events.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xdb28=['Plugin','setMaxListeners','update','remove','emit','exports','events','../../mysqldb'];(function(_0x3beeea,_0x3f6d7a){var _0x47f053=function(_0x4e824e){while(--_0x4e824e){_0x3beeea['push'](_0x3beeea['shift']());}};_0x47f053(++_0x3f6d7a);}(_0xdb28,0x106));var _0x8db2=function(_0x376e4a,_0x47f626){_0x376e4a=_0x376e4a-0x0;var _0x3f90f0=_0xdb28[_0x376e4a];return _0x3f90f0;};'use strict';var EventEmitter=require(_0x8db2('0x0'));var Plugin=require(_0x8db2('0x1'))['db'][_0x8db2('0x2')];var PluginEvents=new EventEmitter();PluginEvents[_0x8db2('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x8db2('0x4'),'afterDestroy':_0x8db2('0x5')};function emitEvent(_0xfcf49f){return function(_0x4426fe,_0x11109e,_0x52bf99){PluginEvents[_0x8db2('0x6')](_0xfcf49f+':'+_0x4426fe['id'],_0x4426fe);PluginEvents[_0x8db2('0x6')](_0xfcf49f,_0x4426fe);_0x52bf99(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Plugin['hook'](e,emitEvent(event));}}module[_0x8db2('0x7')]=PluginEvents;
\ No newline at end of file
+var _0x32f4=['update','remove','emit','exports','events','../../mysqldb','Plugin','setMaxListeners'];(function(_0x3e4a9d,_0x4f36a1){var _0x507d53=function(_0x38dc7b){while(--_0x38dc7b){_0x3e4a9d['push'](_0x3e4a9d['shift']());}};_0x507d53(++_0x4f36a1);}(_0x32f4,0x154));var _0x432f=function(_0x1942b1,_0x3861ad){_0x1942b1=_0x1942b1-0x0;var _0x3421b5=_0x32f4[_0x1942b1];return _0x3421b5;};'use strict';var EventEmitter=require(_0x432f('0x0'));var Plugin=require(_0x432f('0x1'))['db'][_0x432f('0x2')];var PluginEvents=new EventEmitter();PluginEvents[_0x432f('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x432f('0x4'),'afterDestroy':_0x432f('0x5')};function emitEvent(_0x51a71a){return function(_0x354293,_0x1eabac,_0x344a29){PluginEvents[_0x432f('0x6')](_0x51a71a+':'+_0x354293['id'],_0x354293);PluginEvents[_0x432f('0x6')](_0x51a71a,_0x354293);_0x344a29(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Plugin['hook'](e,emitEvent(event));}}module[_0x432f('0x7')]=PluginEvents;
\ No newline at end of file
diff --git a/server/api/plugin/plugin.model.js b/server/api/plugin/plugin.model.js
index 032158a..5eba3fa 100644
--- a/server/api/plugin/plugin.model.js
+++ b/server/api/plugin/plugin.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xffe8=['define','Plugin','plugins','lodash','../../config/logger','api','moment','bluebird','request-promise','rimraf','./plugin.attributes','exports'];(function(_0x41f6d4,_0x255693){var _0x42a2a9=function(_0x1d0a8){while(--_0x1d0a8){_0x41f6d4['push'](_0x41f6d4['shift']());}};_0x42a2a9(++_0x255693);}(_0xffe8,0x1b3));var _0x8ffe=function(_0x4492a8,_0x37056){_0x4492a8=_0x4492a8-0x0;var _0x103d12=_0xffe8[_0x4492a8];return _0x103d12;};'use strict';var _=require(_0x8ffe('0x0'));var util=require('util');var logger=require(_0x8ffe('0x1'))(_0x8ffe('0x2'));var moment=require(_0x8ffe('0x3'));var BPromise=require(_0x8ffe('0x4'));var rp=require(_0x8ffe('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8ffe('0x6'));var config=require('../../config/environment');var attributes=require(_0x8ffe('0x7'));module[_0x8ffe('0x8')]=function(_0xd32eec,_0x3bd356){return _0xd32eec[_0x8ffe('0x9')](_0x8ffe('0xa'),attributes,{'tableName':_0x8ffe('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xa589=['rimraf','./plugin.attributes','exports','define','plugins','util','api','request-promise'];(function(_0x3635ce,_0x33a6f9){var _0x97ecd0=function(_0x123d98){while(--_0x123d98){_0x3635ce['push'](_0x3635ce['shift']());}};_0x97ecd0(++_0x33a6f9);}(_0xa589,0x19d));var _0x9a58=function(_0x4430a9,_0x5f0b8d){_0x4430a9=_0x4430a9-0x0;var _0x2432da=_0xa589[_0x4430a9];return _0x2432da;};'use strict';var _=require('lodash');var util=require(_0x9a58('0x0'));var logger=require('../../config/logger')(_0x9a58('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x9a58('0x2'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9a58('0x3'));var config=require('../../config/environment');var attributes=require(_0x9a58('0x4'));module[_0x9a58('0x5')]=function(_0x485e28,_0x18b0f1){return _0x485e28[_0x9a58('0x6')]('Plugin',attributes,{'tableName':_0x9a58('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/plugin/plugin.rpc.js b/server/api/plugin/plugin.rpc.js
index c5cf75c..4ef5349 100644
--- a/server/api/plugin/plugin.rpc.js
+++ b/server/api/plugin/plugin.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xd212=['jayson/promise','client','http','redis','defaults','localhost','./plugin.socket','register','request','then','Plugin,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','Plugin','create','body','options','info','CreatePlugin','stringify','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','../../config/environment'];(function(_0x3239f5,_0x50e77c){var _0x3559c8=function(_0x4f9f83){while(--_0x4f9f83){_0x3239f5['push'](_0x3239f5['shift']());}};_0x3559c8(++_0x50e77c);}(_0xd212,0x163));var _0x2d21=function(_0x3f993e,_0x2d5757){_0x3f993e=_0x3f993e-0x0;var _0x39c135=_0xd212[_0x3f993e];return _0x39c135;};'use strict';var _=require(_0x2d21('0x0'));var util=require(_0x2d21('0x1'));var moment=require(_0x2d21('0x2'));var BPromise=require(_0x2d21('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2d21('0x4'))['db'];var utils=require(_0x2d21('0x5'));var logger=require(_0x2d21('0x6'))('rpc');var config=require(_0x2d21('0x7'));var jayson=require(_0x2d21('0x8'));var client=jayson[_0x2d21('0x9')][_0x2d21('0xa')]({'port':0x232a});config[_0x2d21('0xb')]=_[_0x2d21('0xc')](config['redis'],{'host':_0x2d21('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x2d21('0xb')]));require(_0x2d21('0xe'))[_0x2d21('0xf')](socket);function respondWithRpcPromise(_0x1ff909,_0x4ba2c0,_0x4976e){return new BPromise(function(_0x4c378f,_0x4cb605){return client[_0x2d21('0x10')](_0x1ff909,_0x4976e)[_0x2d21('0x11')](function(_0x5d2779){logger['info'](_0x2d21('0x12'),_0x4ba2c0,_0x2d21('0x13'));logger[_0x2d21('0x14')]('Plugin,\x20%s,\x20%s,\x20%s',_0x4ba2c0,'request\x20sent',JSON['stringify'](_0x5d2779));if(_0x5d2779[_0x2d21('0x15')]){if(_0x5d2779['error'][_0x2d21('0x16')]===0x1f4){logger[_0x2d21('0x15')]('Plugin,\x20%s,\x20%s',_0x4ba2c0,_0x5d2779['error'][_0x2d21('0x17')]);return _0x4cb605(_0x5d2779['error']['message']);}logger[_0x2d21('0x15')](_0x2d21('0x12'),_0x4ba2c0,_0x5d2779[_0x2d21('0x15')][_0x2d21('0x17')]);return _0x4c378f(_0x5d2779[_0x2d21('0x15')][_0x2d21('0x17')]);}else{logger['info'](_0x2d21('0x12'),_0x4ba2c0,'request\x20sent');_0x4c378f(_0x5d2779[_0x2d21('0x18')][_0x2d21('0x17')]);}})[_0x2d21('0x19')](function(_0x56a128){logger[_0x2d21('0x15')](_0x2d21('0x12'),_0x4ba2c0,_0x56a128);_0x4cb605(_0x56a128);});});}exports['CreatePlugin']=function(_0x231179){var _0xbf0ae3=this;return new Promise(function(_0x37bfaf,_0x5383e3){return db[_0x2d21('0x1a')][_0x2d21('0x1b')](_0x231179[_0x2d21('0x1c')],{'raw':_0x231179[_0x2d21('0x1d')]?_0x231179[_0x2d21('0x1d')]['raw']===undefined?!![]:![]:!![]})[_0x2d21('0x11')](function(_0x56b137){logger[_0x2d21('0x1e')](_0x2d21('0x1f'),_0x231179);logger[_0x2d21('0x14')](_0x2d21('0x1f'),_0x231179,JSON[_0x2d21('0x20')](_0x56b137));_0x37bfaf(_0x56b137);})[_0x2d21('0x19')](function(_0x4558f6){logger[_0x2d21('0x15')](_0x2d21('0x1f'),_0x4558f6[_0x2d21('0x17')],_0x231179);_0x5383e3(_0xbf0ae3[_0x2d21('0x15')](0x1f4,_0x4558f6[_0x2d21('0x17')]));});});};
\ No newline at end of file
+var _0x167b=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./plugin.socket','register','then','info','Plugin,\x20%s,\x20%s','request\x20sent','debug','Plugin,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreatePlugin','Plugin','create','body','options','raw'];(function(_0x55474e,_0x3dadc5){var _0x4b27b3=function(_0x27f270){while(--_0x27f270){_0x55474e['push'](_0x55474e['shift']());}};_0x4b27b3(++_0x3dadc5);}(_0x167b,0x6c));var _0xb167=function(_0x2b6710,_0x24aa05){_0x2b6710=_0x2b6710-0x0;var _0x5a6fca=_0x167b[_0x2b6710];return _0x5a6fca;};'use strict';var _=require('lodash');var util=require(_0xb167('0x0'));var moment=require(_0xb167('0x1'));var BPromise=require(_0xb167('0x2'));var rs=require(_0xb167('0x3'));var fs=require('fs');var Redis=require(_0xb167('0x4'));var db=require(_0xb167('0x5'))['db'];var utils=require(_0xb167('0x6'));var logger=require(_0xb167('0x7'))(_0xb167('0x8'));var config=require('../../config/environment');var jayson=require(_0xb167('0x9'));var client=jayson[_0xb167('0xa')][_0xb167('0xb')]({'port':0x232a});config[_0xb167('0xc')]=_[_0xb167('0xd')](config[_0xb167('0xc')],{'host':_0xb167('0xe'),'port':0x18eb});var socket=require(_0xb167('0xf'))(new Redis(config[_0xb167('0xc')]));require(_0xb167('0x10'))[_0xb167('0x11')](socket);function respondWithRpcPromise(_0x2ceead,_0x33ee5b,_0xa2c1c8){return new BPromise(function(_0x2432de,_0x9ca04b){return client['request'](_0x2ceead,_0xa2c1c8)[_0xb167('0x12')](function(_0x367883){logger[_0xb167('0x13')](_0xb167('0x14'),_0x33ee5b,_0xb167('0x15'));logger[_0xb167('0x16')](_0xb167('0x17'),_0x33ee5b,'request\x20sent',JSON[_0xb167('0x18')](_0x367883));if(_0x367883[_0xb167('0x19')]){if(_0x367883[_0xb167('0x19')][_0xb167('0x1a')]===0x1f4){logger[_0xb167('0x19')](_0xb167('0x14'),_0x33ee5b,_0x367883[_0xb167('0x19')][_0xb167('0x1b')]);return _0x9ca04b(_0x367883[_0xb167('0x19')][_0xb167('0x1b')]);}logger[_0xb167('0x19')](_0xb167('0x14'),_0x33ee5b,_0x367883[_0xb167('0x19')]['message']);return _0x2432de(_0x367883[_0xb167('0x19')][_0xb167('0x1b')]);}else{logger[_0xb167('0x13')](_0xb167('0x14'),_0x33ee5b,_0xb167('0x15'));_0x2432de(_0x367883[_0xb167('0x1c')][_0xb167('0x1b')]);}})[_0xb167('0x1d')](function(_0x5eaa84){logger[_0xb167('0x19')](_0xb167('0x14'),_0x33ee5b,_0x5eaa84);_0x9ca04b(_0x5eaa84);});});}exports[_0xb167('0x1e')]=function(_0x1d55c5){var _0x527ff0=this;return new Promise(function(_0x571fa4,_0x34d10d){return db[_0xb167('0x1f')][_0xb167('0x20')](_0x1d55c5[_0xb167('0x21')],{'raw':_0x1d55c5[_0xb167('0x22')]?_0x1d55c5[_0xb167('0x22')][_0xb167('0x23')]===undefined?!![]:![]:!![]})[_0xb167('0x12')](function(_0x5cdcf7){logger[_0xb167('0x13')](_0xb167('0x1e'),_0x1d55c5);logger[_0xb167('0x16')]('CreatePlugin',_0x1d55c5,JSON['stringify'](_0x5cdcf7));_0x571fa4(_0x5cdcf7);})['catch'](function(_0x8f1e3d){logger[_0xb167('0x19')]('CreatePlugin',_0x8f1e3d[_0xb167('0x1b')],_0x1d55c5);_0x34d10d(_0x527ff0[_0xb167('0x19')](0x1f4,_0x8f1e3d[_0xb167('0x1b')]));});});};
\ No newline at end of file
diff --git a/server/api/plugin/plugin.socket.js b/server/api/plugin/plugin.socket.js
index 694248b..8726c4c 100644
--- a/server/api/plugin/plugin.socket.js
+++ b/server/api/plugin/plugin.socket.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9bca=['emit','removeListener','register','length','./plugin.events','save','remove','update'];(function(_0x4577ce,_0x58804e){var _0x1c93c2=function(_0xec35a5){while(--_0xec35a5){_0x4577ce['push'](_0x4577ce['shift']());}};_0x1c93c2(++_0x58804e);}(_0x9bca,0x8c));var _0xa9bc=function(_0x3747b3,_0x812602){_0x3747b3=_0x3747b3-0x0;var _0x128bfc=_0x9bca[_0x3747b3];return _0x128bfc;};'use strict';var PluginEvents=require(_0xa9bc('0x0'));var events=[_0xa9bc('0x1'),_0xa9bc('0x2'),_0xa9bc('0x3')];function createListener(_0x1fc145,_0x3e00f3){return function(_0x432c0a){_0x3e00f3[_0xa9bc('0x4')](_0x1fc145,_0x432c0a);};}function removeListener(_0x1c0a94,_0xe85207){return function(){PluginEvents[_0xa9bc('0x5')](_0x1c0a94,_0xe85207);};}exports[_0xa9bc('0x6')]=function(_0x3c846b){for(var _0x528c1d=0x0,_0x40bf7a=events[_0xa9bc('0x7')];_0x528c1d<_0x40bf7a;_0x528c1d++){var _0x4790ce=events[_0x528c1d];var _0x2e2eef=createListener('plugin:'+_0x4790ce,_0x3c846b);PluginEvents['on'](_0x4790ce,_0x2e2eef);}};
\ No newline at end of file
+var _0x745c=['register','./plugin.events','save','remove','update','emit','removeListener'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x745c,0xa2));var _0xc745=function(_0x367afb,_0x5c4271){_0x367afb=_0x367afb-0x0;var _0x135d81=_0x745c[_0x367afb];return _0x135d81;};'use strict';var PluginEvents=require(_0xc745('0x0'));var events=[_0xc745('0x1'),_0xc745('0x2'),_0xc745('0x3')];function createListener(_0x5a4f59,_0x24b5d0){return function(_0x324fef){_0x24b5d0[_0xc745('0x4')](_0x5a4f59,_0x324fef);};}function removeListener(_0x3d1d2f,_0x2cfe0e){return function(){PluginEvents[_0xc745('0x5')](_0x3d1d2f,_0x2cfe0e);};}exports[_0xc745('0x6')]=function(_0x4785ec){for(var _0x15b8f7=0x0,_0x29759f=events['length'];_0x15b8f7<_0x29759f;_0x15b8f7++){var _0x5d85d4=events[_0x15b8f7];var _0x1de1b3=createListener('plugin:'+_0x5d85d4,_0x4785ec);PluginEvents['on'](_0x5d85d4,_0x1de1b3);}};
\ No newline at end of file
diff --git a/server/api/pm2/index.js b/server/api/pm2/index.js
index 4c0e71d..29987d0 100644
--- a/server/api/pm2/index.js
+++ b/server/api/pm2/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x30e6=['update','delete','exports','express','../../components/auth/service','./pm2.controller','get','index','/:id','isAuthenticated','show','post','create'];(function(_0x32d74b,_0x251f81){var _0x507053=function(_0x399d9c){while(--_0x399d9c){_0x32d74b['push'](_0x32d74b['shift']());}};_0x507053(++_0x251f81);}(_0x30e6,0xed));var _0x630e=function(_0x4bf9f4,_0x3c6da1){_0x4bf9f4=_0x4bf9f4-0x0;var _0x1d93cc=_0x30e6[_0x4bf9f4];return _0x1d93cc;};'use strict';var express=require(_0x630e('0x0'));var router=express['Router']();var auth=require(_0x630e('0x1'));var controller=require(_0x630e('0x2'));router[_0x630e('0x3')]('/',auth['isAuthenticated'](),controller[_0x630e('0x4')]);router['get'](_0x630e('0x5'),auth[_0x630e('0x6')](),controller[_0x630e('0x7')]);router[_0x630e('0x8')]('/',auth[_0x630e('0x6')](),controller[_0x630e('0x9')]);router['put'](_0x630e('0x5'),auth[_0x630e('0x6')](),controller[_0x630e('0xa')]);router[_0x630e('0xb')](_0x630e('0x5'),auth[_0x630e('0x6')](),controller['destroy']);module[_0x630e('0xc')]=router;
\ No newline at end of file
+var _0x5449=['destroy','exports','Router','index','isAuthenticated','post','create','put','/:id','update'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x5449,0xd4));var _0x9544=function(_0x2e2681,_0x4089c1){_0x2e2681=_0x2e2681-0x0;var _0x368a64=_0x5449[_0x2e2681];return _0x368a64;};'use strict';var express=require('express');var router=express[_0x9544('0x0')]();var auth=require('../../components/auth/service');var controller=require('./pm2.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x9544('0x1')]);router['get']('/:id',auth[_0x9544('0x2')](),controller['show']);router[_0x9544('0x3')]('/',auth['isAuthenticated'](),controller[_0x9544('0x4')]);router[_0x9544('0x5')](_0x9544('0x6'),auth[_0x9544('0x2')](),controller[_0x9544('0x7')]);router['delete'](_0x9544('0x6'),auth[_0x9544('0x2')](),controller[_0x9544('0x8')]);module[_0x9544('0x9')]=router;
\ No newline at end of file
diff --git a/server/api/pm2/pm2.controller.js b/server/api/pm2/pm2.controller.js
index a569f4f..b3345e9 100644
--- a/server/api/pm2/pm2.controller.js
+++ b/server/api/pm2/pm2.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x0694=['../../config/logger','api','path','child_process','exec','bluebird','json','send','npm\x20install','info','index','list','then','reject','name','express','motion2','catch','params','body','script','join','../../files/plugins','cwd','chdir','dirname','start','status','Missing\x20name\x20and/or\x20path','restart','stop','hasOwnProperty','Unknown\x20status','destroy','delete','dump','Unknown\x20id','lodash','../../config/pm2'];(function(_0x7abd7,_0x1ca3f9){var _0x3a2577=function(_0x18456d){while(--_0x18456d){_0x7abd7['push'](_0x7abd7['shift']());}};_0x3a2577(++_0x1ca3f9);}(_0x0694,0xc1));var _0x4069=function(_0x59162a,_0x10e547){_0x59162a=_0x59162a-0x0;var _0x35e50d=_0x0694[_0x59162a];return _0x35e50d;};'use strict';var _=require(_0x4069('0x0'));var pm2=require(_0x4069('0x1'));var logger=require(_0x4069('0x2'))(_0x4069('0x3'));var path=require(_0x4069('0x4'));var exec=require(_0x4069('0x5'))[_0x4069('0x6')];var BPromise=require(_0x4069('0x7'));function handleEntityNotFound(_0x41d331,_0x52a371){return function(_0x4fbd31){if(!_0x4fbd31){_0x41d331['sendStatus'](0x194);;}return _0x4fbd31;};}function respondWithResult(_0x46905f,_0x50fabc){_0x50fabc=_0x50fabc||0xc8;return function(_0x5308f6){if(_0x5308f6){return _0x46905f['status'](_0x50fabc)[_0x4069('0x8')](_0x5308f6);}return null;};}function handleError(_0x68e068,_0x16aa3f){_0x16aa3f=_0x16aa3f||0x1f4;return function(_0x36a6af){logger['error'](_0x36a6af['stack']);if(_0x36a6af['name']){delete _0x36a6af['name'];}_0x68e068['status'](_0x16aa3f)[_0x4069('0x9')](_0x36a6af);};}function execChildProcess(){return new BPromise(function(_0x2062af,_0xbaa2bc){exec(_0x4069('0xa'),function(_0x121235,_0x1d77b5,_0x2d98c5){logger[_0x4069('0xb')](_0x1d77b5);logger['info'](_0x2d98c5);if(_0x121235){logger['error'](_0x121235);return _0xbaa2bc(_0x121235);}return _0x2062af(_0x1d77b5);});});}exports[_0x4069('0xc')]=function(_0x2e2057,_0x586b74){return pm2[_0x4069('0xd')]()[_0x4069('0xe')](function(_0x5c6425){if(_0x5c6425){var _0x309429=_[_0x4069('0xf')](_0x5c6425,function(_0x1217fe){return _0x1217fe[_0x4069('0x10')]===_0x4069('0x11')||_0x1217fe[_0x4069('0x10')]===_0x4069('0x12');});return{'rows':_0x309429,'count':_0x309429['length']};}return null;})['then'](respondWithResult(_0x586b74,null))[_0x4069('0x13')](handleError(_0x586b74,null));};exports['show']=function(_0x1db859,_0x430d57){return pm2['describe'](_0x1db859[_0x4069('0x14')]['id'])[_0x4069('0xe')](respondWithResult(_0x430d57,null))[_0x4069('0xe')](handleEntityNotFound(_0x430d57,null))[_0x4069('0x13')](handleError(_0x430d57,null));};exports['create']=function(_0x4800e7,_0x41e8f6){if(_0x4800e7[_0x4069('0x15')][_0x4069('0x10')]&&_0x4800e7['body'][_0x4069('0x16')]){var _0x56bbf0=path[_0x4069('0x17')](__dirname,_0x4069('0x18'),_0x4800e7['body'][_0x4069('0x16')]);var _0x501e83=process[_0x4069('0x19')]();process[_0x4069('0x1a')](path[_0x4069('0x1b')](_0x56bbf0));return execChildProcess()['then'](function(_0x577930){process[_0x4069('0x1a')](_0x501e83);return pm2[_0x4069('0x1c')]({'name':_0x4800e7['body']['name'],'script':_0x56bbf0});})[_0x4069('0xe')](function(_0x22af75){pm2['dump']();return _0x22af75[0x0];})['then'](respondWithResult(_0x41e8f6,0xc9))[_0x4069('0x13')](handleError(_0x41e8f6,null));}else{return _0x41e8f6[_0x4069('0x1d')](0x1f4)[_0x4069('0x9')]({'message':_0x4069('0x1e')});}};exports['update']=function(_0x46b6b3,_0x5e2812){if(_0x46b6b3[_0x4069('0x15')]['id']){delete _0x46b6b3[_0x4069('0x15')]['id'];}var _0x4bfba2={'online':_0x4069('0x1f'),'stopped':_0x4069('0x20')};if(_0x4bfba2[_0x4069('0x21')](_0x46b6b3[_0x4069('0x15')][_0x4069('0x1d')])){return pm2[_0x4bfba2[_0x46b6b3['body'][_0x4069('0x1d')]]](_0x46b6b3['params']['id'])[_0x4069('0xe')](respondWithResult(_0x5e2812,0xc8))[_0x4069('0x13')](handleError(_0x5e2812,null));}else{return _0x5e2812['status'](0x1f4)[_0x4069('0x9')]({'message':_0x4069('0x22')});}};exports[_0x4069('0x23')]=function(_0x659c02,_0x7853a0){if(_0x659c02[_0x4069('0x15')]['id']){delete _0x659c02[_0x4069('0x15')]['id'];}if(_0x659c02[_0x4069('0x14')]['id']){return pm2[_0x4069('0x24')](_0x659c02[_0x4069('0x14')]['id'])['then'](function(_0x476d3b){pm2[_0x4069('0x25')]();return _0x476d3b[0x0];})[_0x4069('0xe')](respondWithResult(_0x7853a0,null))[_0x4069('0x13')](handleError(_0x7853a0,null));}else{return _0x7853a0[_0x4069('0x1d')](0x1f4)[_0x4069('0x9')]({'message':_0x4069('0x26')});}};
\ No newline at end of file
+var _0x9098=['list','then','reject','express','motion2','length','catch','show','describe','params','create','body','script','join','../../files/plugins','cwd','chdir','dump','Missing\x20name\x20and/or\x20path','update','stop','hasOwnProperty','Unknown\x20status','Unknown\x20id','../../config/pm2','../../config/logger','api','path','child_process','bluebird','sendStatus','status','json','error','stack','name','send','npm\x20install','info'];(function(_0x484e36,_0x4482d8){var _0xafc85d=function(_0xaba9c8){while(--_0xaba9c8){_0x484e36['push'](_0x484e36['shift']());}};_0xafc85d(++_0x4482d8);}(_0x9098,0x129));var _0x8909=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0x9098[_0x432682];return _0x463d05;};'use strict';var _=require('lodash');var pm2=require(_0x8909('0x0'));var logger=require(_0x8909('0x1'))(_0x8909('0x2'));var path=require(_0x8909('0x3'));var exec=require(_0x8909('0x4'))['exec'];var BPromise=require(_0x8909('0x5'));function handleEntityNotFound(_0x52cc67,_0x201438){return function(_0x2d1873){if(!_0x2d1873){_0x52cc67[_0x8909('0x6')](0x194);;}return _0x2d1873;};}function respondWithResult(_0x375aab,_0x10098f){_0x10098f=_0x10098f||0xc8;return function(_0x1d98a4){if(_0x1d98a4){return _0x375aab[_0x8909('0x7')](_0x10098f)[_0x8909('0x8')](_0x1d98a4);}return null;};}function handleError(_0x40c1f9,_0x5becb5){_0x5becb5=_0x5becb5||0x1f4;return function(_0x9f6bd5){logger[_0x8909('0x9')](_0x9f6bd5[_0x8909('0xa')]);if(_0x9f6bd5['name']){delete _0x9f6bd5[_0x8909('0xb')];}_0x40c1f9[_0x8909('0x7')](_0x5becb5)[_0x8909('0xc')](_0x9f6bd5);};}function execChildProcess(){return new BPromise(function(_0x5401f4,_0x2d4e9a){exec(_0x8909('0xd'),function(_0x57a539,_0x114eec,_0x365459){logger[_0x8909('0xe')](_0x114eec);logger[_0x8909('0xe')](_0x365459);if(_0x57a539){logger[_0x8909('0x9')](_0x57a539);return _0x2d4e9a(_0x57a539);}return _0x5401f4(_0x114eec);});});}exports['index']=function(_0x4bef8a,_0x16db42){return pm2[_0x8909('0xf')]()[_0x8909('0x10')](function(_0x24d3d5){if(_0x24d3d5){var _0x45ff41=_[_0x8909('0x11')](_0x24d3d5,function(_0x3a3b50){return _0x3a3b50[_0x8909('0xb')]===_0x8909('0x12')||_0x3a3b50[_0x8909('0xb')]===_0x8909('0x13');});return{'rows':_0x45ff41,'count':_0x45ff41[_0x8909('0x14')]};}return null;})[_0x8909('0x10')](respondWithResult(_0x16db42,null))[_0x8909('0x15')](handleError(_0x16db42,null));};exports[_0x8909('0x16')]=function(_0x325b33,_0x5d22d0){return pm2[_0x8909('0x17')](_0x325b33[_0x8909('0x18')]['id'])[_0x8909('0x10')](respondWithResult(_0x5d22d0,null))[_0x8909('0x10')](handleEntityNotFound(_0x5d22d0,null))[_0x8909('0x15')](handleError(_0x5d22d0,null));};exports[_0x8909('0x19')]=function(_0x187f1f,_0x1b6b3e){if(_0x187f1f[_0x8909('0x1a')]['name']&&_0x187f1f[_0x8909('0x1a')][_0x8909('0x1b')]){var _0x23b490=path[_0x8909('0x1c')](__dirname,_0x8909('0x1d'),_0x187f1f[_0x8909('0x1a')]['script']);var _0x57a955=process[_0x8909('0x1e')]();process[_0x8909('0x1f')](path['dirname'](_0x23b490));return execChildProcess()[_0x8909('0x10')](function(_0x4c242d){process['chdir'](_0x57a955);return pm2['start']({'name':_0x187f1f[_0x8909('0x1a')][_0x8909('0xb')],'script':_0x23b490});})[_0x8909('0x10')](function(_0x5c0c25){pm2[_0x8909('0x20')]();return _0x5c0c25[0x0];})[_0x8909('0x10')](respondWithResult(_0x1b6b3e,0xc9))[_0x8909('0x15')](handleError(_0x1b6b3e,null));}else{return _0x1b6b3e[_0x8909('0x7')](0x1f4)[_0x8909('0xc')]({'message':_0x8909('0x21')});}};exports[_0x8909('0x22')]=function(_0x5d171f,_0x52f043){if(_0x5d171f[_0x8909('0x1a')]['id']){delete _0x5d171f[_0x8909('0x1a')]['id'];}var _0x5ed36d={'online':'restart','stopped':_0x8909('0x23')};if(_0x5ed36d[_0x8909('0x24')](_0x5d171f[_0x8909('0x1a')][_0x8909('0x7')])){return pm2[_0x5ed36d[_0x5d171f[_0x8909('0x1a')][_0x8909('0x7')]]](_0x5d171f[_0x8909('0x18')]['id'])[_0x8909('0x10')](respondWithResult(_0x52f043,0xc8))[_0x8909('0x15')](handleError(_0x52f043,null));}else{return _0x52f043[_0x8909('0x7')](0x1f4)[_0x8909('0xc')]({'message':_0x8909('0x25')});}};exports['destroy']=function(_0x625b0b,_0x1afa40){if(_0x625b0b[_0x8909('0x1a')]['id']){delete _0x625b0b['body']['id'];}if(_0x625b0b['params']['id']){return pm2['delete'](_0x625b0b[_0x8909('0x18')]['id'])[_0x8909('0x10')](function(_0x32eb9e){pm2[_0x8909('0x20')]();return _0x32eb9e[0x0];})[_0x8909('0x10')](respondWithResult(_0x1afa40,null))[_0x8909('0x15')](handleError(_0x1afa40,null));}else{return _0x1afa40[_0x8909('0x7')](0x1f4)[_0x8909('0xc')]({'message':_0x8909('0x26')});}};
\ No newline at end of file
diff --git a/server/api/reportAgentPreview/index.js b/server/api/reportAgentPreview/index.js
index a9fede1..4ee7f3f 100644
--- a/server/api/reportAgentPreview/index.js
+++ b/server/api/reportAgentPreview/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x233a=['connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','exports','multer','util','path'];(function(_0x12129d,_0x4b00d4){var _0x1c7d80=function(_0x503f6b){while(--_0x503f6b){_0x12129d['push'](_0x12129d['shift']());}};_0x1c7d80(++_0x4b00d4);}(_0x233a,0x16e));var _0xa233=function(_0x4066c7,_0x3f1e0a){_0x4066c7=_0x4066c7-0x0;var _0x1c1a4c=_0x233a[_0x4066c7];return _0x1c1a4c;};'use strict';var multer=require(_0xa233('0x0'));var util=require(_0xa233('0x1'));var path=require(_0xa233('0x2'));var timeout=require(_0xa233('0x3'));var express=require(_0xa233('0x4'));var router=express[_0xa233('0x5')]();var auth=require(_0xa233('0x6'));var interaction=require(_0xa233('0x7'));var config=require('../../config/environment');module[_0xa233('0x8')]=router;
\ No newline at end of file
+var _0x0d9b=['../../components/auth/service','../../config/environment','exports','connect-timeout','express','Router'];(function(_0x2f09f7,_0x461707){var _0x1b266c=function(_0xbff8dc){while(--_0xbff8dc){_0x2f09f7['push'](_0x2f09f7['shift']());}};_0x1b266c(++_0x461707);}(_0x0d9b,0x7b));var _0xb0d9=function(_0x463a85,_0x2f7849){_0x463a85=_0x463a85-0x0;var _0x1aefda=_0x0d9b[_0x463a85];return _0x1aefda;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0xb0d9('0x0'));var express=require(_0xb0d9('0x1'));var router=express[_0xb0d9('0x2')]();var auth=require(_0xb0d9('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0xb0d9('0x4'));module[_0xb0d9('0x5')]=router;
\ No newline at end of file
diff --git a/server/api/reportAgentPreview/reportAgentPreview.attributes.js b/server/api/reportAgentPreview/reportAgentPreview.attributes.js
index 822eec6..ccb7f80 100644
--- a/server/api/reportAgentPreview/reportAgentPreview.attributes.js
+++ b/server/api/reportAgentPreview/reportAgentPreview.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x8597=['exports','INTEGER','STRING','DATE','sequelize'];(function(_0x1d9efa,_0x134ad4){var _0x327876=function(_0x2d1e19){while(--_0x2d1e19){_0x1d9efa['push'](_0x1d9efa['shift']());}};_0x327876(++_0x134ad4);}(_0x8597,0x185));var _0x7859=function(_0x212fcc,_0x1a8867){_0x212fcc=_0x212fcc-0x0;var _0x4d8190=_0x8597[_0x212fcc];return _0x4d8190;};'use strict';var Sequelize=require(_0x7859('0x0'));module[_0x7859('0x1')]={'state':{'type':Sequelize[_0x7859('0x2')](0x2)},'statedesc':{'type':Sequelize[_0x7859('0x3')]},'scheduledat':{'type':Sequelize[_0x7859('0x4')]},'uniqueid':{'type':Sequelize[_0x7859('0x3')]},'starttime':{'type':Sequelize[_0x7859('0x4')]},'responsetime':{'type':Sequelize[_0x7859('0x4')]},'ringtime':{'type':Sequelize[_0x7859('0x2')],'defaultValue':0x0},'campaign':{'type':Sequelize[_0x7859('0x3')]},'campaigntype':{'type':Sequelize[_0x7859('0x3')]},'membername':{'type':Sequelize[_0x7859('0x3')]}};
\ No newline at end of file
+var _0xb884=['exports','STRING','DATE','INTEGER','sequelize'];(function(_0x183a5b,_0x1fe225){var _0x2e057a=function(_0x1e65d1){while(--_0x1e65d1){_0x183a5b['push'](_0x183a5b['shift']());}};_0x2e057a(++_0x1fe225);}(_0xb884,0x130));var _0x4b88=function(_0x406115,_0x19f7a1){_0x406115=_0x406115-0x0;var _0xbbabdb=_0xb884[_0x406115];return _0xbbabdb;};'use strict';var Sequelize=require(_0x4b88('0x0'));module[_0x4b88('0x1')]={'state':{'type':Sequelize['INTEGER'](0x2)},'statedesc':{'type':Sequelize[_0x4b88('0x2')]},'scheduledat':{'type':Sequelize[_0x4b88('0x3')]},'uniqueid':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize[_0x4b88('0x3')]},'responsetime':{'type':Sequelize[_0x4b88('0x3')]},'ringtime':{'type':Sequelize[_0x4b88('0x4')],'defaultValue':0x0},'campaign':{'type':Sequelize[_0x4b88('0x2')]},'campaigntype':{'type':Sequelize[_0x4b88('0x2')]},'membername':{'type':Sequelize[_0x4b88('0x2')]}};
\ No newline at end of file
diff --git a/server/api/reportAgentPreview/reportAgentPreview.model.js b/server/api/reportAgentPreview/reportAgentPreview.model.js
index 265c06e..e429e2d 100644
--- a/server/api/reportAgentPreview/reportAgentPreview.model.js
+++ b/server/api/reportAgentPreview/reportAgentPreview.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xb185=['ReportAgentPreview','report_agent_preview','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./reportAgentPreview.attributes','exports','define'];(function(_0x128ef3,_0x38a577){var _0x5a5477=function(_0x3b9123){while(--_0x3b9123){_0x128ef3['push'](_0x128ef3['shift']());}};_0x5a5477(++_0x38a577);}(_0xb185,0x136));var _0x5b18=function(_0x16b9ed,_0x56517a){_0x16b9ed=_0x16b9ed-0x0;var _0x66b1f8=_0xb185[_0x16b9ed];return _0x66b1f8;};'use strict';var _=require(_0x5b18('0x0'));var util=require(_0x5b18('0x1'));var logger=require(_0x5b18('0x2'))(_0x5b18('0x3'));var moment=require(_0x5b18('0x4'));var BPromise=require('bluebird');var rp=require(_0x5b18('0x5'));var fs=require('fs');var path=require(_0x5b18('0x6'));var rimraf=require(_0x5b18('0x7'));var config=require(_0x5b18('0x8'));var attributes=require(_0x5b18('0x9'));module[_0x5b18('0xa')]=function(_0x53e21f,_0x2d02b8){return _0x53e21f[_0x5b18('0xb')](_0x5b18('0xc'),attributes,{'tableName':_0x5b18('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x250e=['util','../../config/logger','api','moment','bluebird','request-promise','path','./reportAgentPreview.attributes','define','ReportAgentPreview','report_agent_preview'];(function(_0x88fa0c,_0x4b6bae){var _0x94ad1c=function(_0x88cc54){while(--_0x88cc54){_0x88fa0c['push'](_0x88fa0c['shift']());}};_0x94ad1c(++_0x4b6bae);}(_0x250e,0x1b8));var _0xe250=function(_0x550419,_0x621497){_0x550419=_0x550419-0x0;var _0x15c0fd=_0x250e[_0x550419];return _0x15c0fd;};'use strict';var _=require('lodash');var util=require(_0xe250('0x0'));var logger=require(_0xe250('0x1'))(_0xe250('0x2'));var moment=require(_0xe250('0x3'));var BPromise=require(_0xe250('0x4'));var rp=require(_0xe250('0x5'));var fs=require('fs');var path=require(_0xe250('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xe250('0x7'));module['exports']=function(_0x2eec2a,_0x3ef767){return _0x2eec2a[_0xe250('0x8')](_0xe250('0x9'),attributes,{'tableName':_0xe250('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/reportAgentPreview/reportAgentPreview.rpc.js b/server/api/reportAgentPreview/reportAgentPreview.rpc.js
index 9c975a9..2f62830 100644
--- a/server/api/reportAgentPreview/reportAgentPreview.rpc.js
+++ b/server/api/reportAgentPreview/reportAgentPreview.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x4733=['body','options','raw','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','ReportAgentPreview,\x20%s,\x20%s,\x20%s','stringify','error','message','ReportAgentPreview,\x20%s,\x20%s','catch','CreateReportAgentPreview','ReportAgentPreview','create'];(function(_0x6d7d5e,_0xf9a26){var _0x37a895=function(_0x25875c){while(--_0x25875c){_0x6d7d5e['push'](_0x6d7d5e['shift']());}};_0x37a895(++_0xf9a26);}(_0x4733,0x142));var _0x3473=function(_0x511b76,_0x4727fa){_0x511b76=_0x511b76-0x0;var _0x5424ff=_0x4733[_0x511b76];return _0x5424ff;};'use strict';var _=require(_0x3473('0x0'));var util=require(_0x3473('0x1'));var moment=require(_0x3473('0x2'));var BPromise=require(_0x3473('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3473('0x4'));var db=require(_0x3473('0x5'))['db'];var utils=require(_0x3473('0x6'));var logger=require(_0x3473('0x7'))('rpc');var config=require(_0x3473('0x8'));var jayson=require(_0x3473('0x9'));var client=jayson[_0x3473('0xa')][_0x3473('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x290a00,_0x2c5513,_0x681a15){return new BPromise(function(_0x3a638d,_0x166ff6){return client[_0x3473('0xc')](_0x290a00,_0x681a15)[_0x3473('0xd')](function(_0x37cd51){logger[_0x3473('0xe')]('ReportAgentPreview,\x20%s,\x20%s',_0x2c5513,_0x3473('0xf'));logger[_0x3473('0x10')](_0x3473('0x11'),_0x2c5513,'request\x20sent',JSON[_0x3473('0x12')](_0x37cd51));if(_0x37cd51['error']){if(_0x37cd51[_0x3473('0x13')]['code']===0x1f4){logger[_0x3473('0x13')]('ReportAgentPreview,\x20%s,\x20%s',_0x2c5513,_0x37cd51['error'][_0x3473('0x14')]);return _0x166ff6(_0x37cd51[_0x3473('0x13')]['message']);}logger['error']('ReportAgentPreview,\x20%s,\x20%s',_0x2c5513,_0x37cd51[_0x3473('0x13')]['message']);return _0x3a638d(_0x37cd51[_0x3473('0x13')]['message']);}else{logger[_0x3473('0xe')](_0x3473('0x15'),_0x2c5513,_0x3473('0xf'));_0x3a638d(_0x37cd51['result'][_0x3473('0x14')]);}})[_0x3473('0x16')](function(_0x60524){logger[_0x3473('0x13')](_0x3473('0x15'),_0x2c5513,_0x60524);_0x166ff6(_0x60524);});});}exports[_0x3473('0x17')]=function(_0x18426e){var _0x14e939=this;return new Promise(function(_0x52701a,_0x3e30a2){return db[_0x3473('0x18')][_0x3473('0x19')](_0x18426e[_0x3473('0x1a')],{'raw':_0x18426e[_0x3473('0x1b')]?_0x18426e[_0x3473('0x1b')][_0x3473('0x1c')]===undefined?!![]:![]:!![]})[_0x3473('0xd')](function(_0x18d8c1){logger['info'](_0x3473('0x17'),_0x18426e);logger['debug']('CreateReportAgentPreview',_0x18426e,JSON[_0x3473('0x12')](_0x18d8c1));_0x52701a(_0x18d8c1);})[_0x3473('0x16')](function(_0x3ff9e9){logger[_0x3473('0x13')](_0x3473('0x17'),_0x3ff9e9[_0x3473('0x14')],_0x18426e);_0x3e30a2(_0x14e939[_0x3473('0x13')](0x1f4,_0x3ff9e9[_0x3473('0x14')]));});});};
\ No newline at end of file
+var _0xe2e3=['CreateReportAgentPreview','ReportAgentPreview','create','body','raw','catch','lodash','moment','bluebird','randomstring','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','ReportAgentPreview,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result'];(function(_0x1b964a,_0x40fdc2){var _0x2559fa=function(_0x1afe3e){while(--_0x1afe3e){_0x1b964a['push'](_0x1b964a['shift']());}};_0x2559fa(++_0x40fdc2);}(_0xe2e3,0x1b6));var _0x3e2e=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0xe2e3[_0x21a9d9];return _0x46adce;};'use strict';var _=require(_0x3e2e('0x0'));var util=require('util');var moment=require(_0x3e2e('0x1'));var BPromise=require(_0x3e2e('0x2'));var rs=require(_0x3e2e('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x3e2e('0x4'));var logger=require(_0x3e2e('0x5'))('rpc');var config=require(_0x3e2e('0x6'));var jayson=require(_0x3e2e('0x7'));var client=jayson[_0x3e2e('0x8')][_0x3e2e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xede072,_0x50b6c2,_0x38d73c){return new BPromise(function(_0x18efb9,_0x4320b4){return client[_0x3e2e('0xa')](_0xede072,_0x38d73c)[_0x3e2e('0xb')](function(_0x26a6b0){logger[_0x3e2e('0xc')](_0x3e2e('0xd'),_0x50b6c2,'request\x20sent');logger[_0x3e2e('0xe')]('ReportAgentPreview,\x20%s,\x20%s,\x20%s',_0x50b6c2,_0x3e2e('0xf'),JSON[_0x3e2e('0x10')](_0x26a6b0));if(_0x26a6b0[_0x3e2e('0x11')]){if(_0x26a6b0[_0x3e2e('0x11')][_0x3e2e('0x12')]===0x1f4){logger[_0x3e2e('0x11')]('ReportAgentPreview,\x20%s,\x20%s',_0x50b6c2,_0x26a6b0[_0x3e2e('0x11')][_0x3e2e('0x13')]);return _0x4320b4(_0x26a6b0['error'][_0x3e2e('0x13')]);}logger[_0x3e2e('0x11')](_0x3e2e('0xd'),_0x50b6c2,_0x26a6b0['error'][_0x3e2e('0x13')]);return _0x18efb9(_0x26a6b0[_0x3e2e('0x11')][_0x3e2e('0x13')]);}else{logger[_0x3e2e('0xc')](_0x3e2e('0xd'),_0x50b6c2,_0x3e2e('0xf'));_0x18efb9(_0x26a6b0[_0x3e2e('0x14')][_0x3e2e('0x13')]);}})['catch'](function(_0x2f0293){logger[_0x3e2e('0x11')](_0x3e2e('0xd'),_0x50b6c2,_0x2f0293);_0x4320b4(_0x2f0293);});});}exports[_0x3e2e('0x15')]=function(_0x53a141){var _0x12cb3f=this;return new Promise(function(_0x6fe2a5,_0x57f7b2){return db[_0x3e2e('0x16')][_0x3e2e('0x17')](_0x53a141[_0x3e2e('0x18')],{'raw':_0x53a141['options']?_0x53a141['options'][_0x3e2e('0x19')]===undefined?!![]:![]:!![]})[_0x3e2e('0xb')](function(_0x42b7b2){logger[_0x3e2e('0xc')](_0x3e2e('0x15'),_0x53a141);logger['debug']('CreateReportAgentPreview',_0x53a141,JSON[_0x3e2e('0x10')](_0x42b7b2));_0x6fe2a5(_0x42b7b2);})[_0x3e2e('0x1a')](function(_0x2a75fa){logger[_0x3e2e('0x11')](_0x3e2e('0x15'),_0x2a75fa[_0x3e2e('0x13')],_0x53a141);_0x57f7b2(_0x12cb3f[_0x3e2e('0x11')](0x1f4,_0x2a75fa[_0x3e2e('0x13')]));});});};
\ No newline at end of file
diff --git a/server/api/rpc/index.js b/server/api/rpc/index.js
index 60e791a..122e4a6 100644
--- a/server/api/rpc/index.js
+++ b/server/api/rpc/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x530b=['agentNotify','exports','multer','util','Router','./rpc.controller','get','/voice/channels','isAuthenticated','voiceChannels','/voice/channels/:uniqueid/mixmonitor','voiceChannelMixMonitor','/voice/channels/:uniqueid/stopmixmonitor','voiceChannelStopMixMonitor','voiceQueues','/chat/queues','mailQueues','mailAccounts','/openchannel/queues','openchannelQueues','/sms/queues','smsQueues','/whatsapp/queues','whatsappQueues','/fax/queues','faxQueues','voiceQueuesPreview','/voice/queues/channels','voiceQueuesChannels','voiceQueuesChannel','/voice/queues/channels/:uniqueid/hangup','/voice/queues/channels/:uniqueid/redirect/:exten','voiceQueuesChannelRedirect','/voice/queues/:id','showVoiceQueues','/outbound','outbound','/outbound/channels','/agents','agents','put','/agents/:id/capacity','/telephones','telephones','/trunks','/fax/accounts','faxAccounts','/chat/queues/waitinginteractions','chatQueuesWaitingInteractions','/mail/queues/waitinginteractions','mailQueuesWaitingInteractions','/openchannel/queues/waitinginteractions','smsQueuesWaitingInteractions','/whatsapp/queues/waitinginteractions','/fax/queues/waitinginteractions','faxQueuesWaitingInteractions','/mail/queues/:id/notify','queueNotify','mail','/mail/queues/:id','showMailQueues','post','/chat/queues/:id/notify','showChatQueues','showFaxQueues','/openchannel/queues/:id/notify','openchannel','showOpenchannelQueues','/sms/queues/:id/notify','sms','/whatsapp/queues/:id/notify','whatsapp','/sms/queues/:id','showSmsQueues','/whatsapp/queues/:id','showWhatsappQueues','/agents/:id/notify'];(function(_0x4066d1,_0xddaabe){var _0x4d38cd=function(_0x41f589){while(--_0x41f589){_0x4066d1['push'](_0x4066d1['shift']());}};_0x4d38cd(++_0xddaabe);}(_0x530b,0xe9));var _0xb530=function(_0xefd519,_0xc62635){_0xefd519=_0xefd519-0x0;var _0x4bb882=_0x530b[_0xefd519];return _0x4bb882;};'use strict';var multer=require(_0xb530('0x0'));var util=require(_0xb530('0x1'));var path=require('path');var express=require('express');var router=express[_0xb530('0x2')]();var auth=require('../../components/auth/service');var controller=require(_0xb530('0x3'));router[_0xb530('0x4')](_0xb530('0x5'),auth[_0xb530('0x6')](),controller[_0xb530('0x7')]);router[_0xb530('0x4')](_0xb530('0x8'),auth[_0xb530('0x6')](),controller[_0xb530('0x9')]);router[_0xb530('0x4')](_0xb530('0xa'),auth['isAuthenticated'](),controller[_0xb530('0xb')]);router[_0xb530('0x4')]('/voice/queues',auth[_0xb530('0x6')](),controller[_0xb530('0xc')]);router[_0xb530('0x4')](_0xb530('0xd'),auth[_0xb530('0x6')](),controller['chatQueues']);router['get']('/mail/queues',auth[_0xb530('0x6')](),controller[_0xb530('0xe')]);router[_0xb530('0x4')]('/mail/accounts',auth[_0xb530('0x6')](),controller[_0xb530('0xf')]);router['get'](_0xb530('0x10'),auth[_0xb530('0x6')](),controller[_0xb530('0x11')]);router[_0xb530('0x4')](_0xb530('0x12'),auth['isAuthenticated'](),controller[_0xb530('0x13')]);router[_0xb530('0x4')](_0xb530('0x14'),auth[_0xb530('0x6')](),controller[_0xb530('0x15')]);router[_0xb530('0x4')](_0xb530('0x16'),auth[_0xb530('0x6')](),controller[_0xb530('0x17')]);router[_0xb530('0x4')]('/voice/queues/preview/:id',auth[_0xb530('0x6')](),controller[_0xb530('0x18')]);router[_0xb530('0x4')](_0xb530('0x19'),auth['isAuthenticated'](),controller[_0xb530('0x1a')]);router[_0xb530('0x4')]('/voice/queues/channels/:uniqueid',auth[_0xb530('0x6')](),controller[_0xb530('0x1b')]);router[_0xb530('0x4')](_0xb530('0x1c'),auth['isAuthenticated'](),controller['voiceQueuesChannelHangup']);router[_0xb530('0x4')](_0xb530('0x1d'),auth[_0xb530('0x6')](),controller[_0xb530('0x1e')]);router[_0xb530('0x4')](_0xb530('0x1f'),auth['isAuthenticated'](),controller[_0xb530('0x20')]);router[_0xb530('0x4')](_0xb530('0x21'),auth[_0xb530('0x6')](),controller[_0xb530('0x22')]);router[_0xb530('0x4')](_0xb530('0x23'),auth[_0xb530('0x6')](),controller['outboundChannels']);router['get'](_0xb530('0x24'),auth[_0xb530('0x6')](),controller[_0xb530('0x25')]);router[_0xb530('0x26')](_0xb530('0x27'),auth['isAuthenticated'](),controller['agentCapacity']);router[_0xb530('0x4')](_0xb530('0x28'),auth['isAuthenticated'](),controller[_0xb530('0x29')]);router['get'](_0xb530('0x2a'),auth['isAuthenticated'](),controller['trunks']);router[_0xb530('0x4')]('/campaigns',auth[_0xb530('0x6')](),controller['campaigns']);router[_0xb530('0x4')](_0xb530('0x2b'),auth[_0xb530('0x6')](),controller[_0xb530('0x2c')]);router[_0xb530('0x4')](_0xb530('0x2d'),auth[_0xb530('0x6')](),controller[_0xb530('0x2e')]);router[_0xb530('0x4')](_0xb530('0x2f'),auth[_0xb530('0x6')](),controller[_0xb530('0x30')]);router[_0xb530('0x4')](_0xb530('0x31'),auth[_0xb530('0x6')](),controller['openchannelQueuesWaitingInteractions']);router[_0xb530('0x4')]('/sms/queues/waitinginteractions',auth['isAuthenticated'](),controller[_0xb530('0x32')]);router['get'](_0xb530('0x33'),auth['isAuthenticated'](),controller['whatsappQueuesWaitingInteractions']);router['get'](_0xb530('0x34'),auth[_0xb530('0x6')](),controller[_0xb530('0x35')]);router['post'](_0xb530('0x36'),auth[_0xb530('0x6')](),controller[_0xb530('0x37')](_0xb530('0x38')));router[_0xb530('0x4')](_0xb530('0x39'),auth['isAuthenticated'](),controller[_0xb530('0x3a')]);router[_0xb530('0x3b')](_0xb530('0x3c'),auth[_0xb530('0x6')](),controller['queueNotify']('chat'));router[_0xb530('0x4')]('/chat/queues/:id',auth[_0xb530('0x6')](),controller[_0xb530('0x3d')]);router['post']('/fax/queues/:id/notify',auth[_0xb530('0x6')](),controller['queueNotify']('fax'));router['get']('/fax/queues/:id',auth[_0xb530('0x6')](),controller[_0xb530('0x3e')]);router['post'](_0xb530('0x3f'),auth[_0xb530('0x6')](),controller[_0xb530('0x37')](_0xb530('0x40')));router[_0xb530('0x4')]('/openchannel/queues/:id',auth[_0xb530('0x6')](),controller[_0xb530('0x41')]);router[_0xb530('0x3b')](_0xb530('0x42'),auth[_0xb530('0x6')](),controller[_0xb530('0x37')](_0xb530('0x43')));router[_0xb530('0x3b')](_0xb530('0x44'),auth[_0xb530('0x6')](),controller[_0xb530('0x37')](_0xb530('0x45')));router['get'](_0xb530('0x46'),auth[_0xb530('0x6')](),controller[_0xb530('0x47')]);router[_0xb530('0x4')](_0xb530('0x48'),auth[_0xb530('0x6')](),controller[_0xb530('0x49')]);router[_0xb530('0x3b')](_0xb530('0x4a'),auth[_0xb530('0x6')](),controller[_0xb530('0x4b')]);module[_0xb530('0x4c')]=router;
\ No newline at end of file
+var _0x605a=['agentCapacity','/telephones','/trunks','trunks','/campaigns','campaigns','faxAccounts','/chat/queues/waitinginteractions','chatQueuesWaitingInteractions','/mail/queues/waitinginteractions','mailQueuesWaitingInteractions','/openchannel/queues/waitinginteractions','openchannelQueuesWaitingInteractions','/sms/queues/waitinginteractions','smsQueuesWaitingInteractions','/whatsapp/queues/waitinginteractions','whatsappQueuesWaitingInteractions','/fax/queues/waitinginteractions','faxQueuesWaitingInteractions','post','/mail/queues/:id/notify','mail','/mail/queues/:id','/chat/queues/:id/notify','queueNotify','chat','/chat/queues/:id','showChatQueues','/fax/queues/:id/notify','fax','/fax/queues/:id','showFaxQueues','/openchannel/queues/:id/notify','openchannel','/openchannel/queues/:id','/sms/queues/:id/notify','sms','/whatsapp/queues/:id/notify','whatsapp','/sms/queues/:id','showSmsQueues','/whatsapp/queues/:id','showWhatsappQueues','/agents/:id/notify','agentNotify','multer','util','path','express','Router','../../components/auth/service','./rpc.controller','/voice/channels','isAuthenticated','voiceChannels','get','/voice/channels/:uniqueid/mixmonitor','voiceChannelMixMonitor','voiceChannelStopMixMonitor','/voice/queues','/chat/queues','chatQueues','/mail/queues','mailQueues','/mail/accounts','/openchannel/queues','openchannelQueues','/sms/queues','smsQueues','whatsappQueues','/fax/queues','faxQueues','/voice/queues/preview/:id','voiceQueuesPreview','/voice/queues/channels','/voice/queues/channels/:uniqueid','voiceQueuesChannel','/voice/queues/channels/:uniqueid/hangup','/voice/queues/channels/:uniqueid/redirect/:exten','voiceQueuesChannelRedirect','/outbound','put','/agents/:id/capacity'];(function(_0x127c11,_0x410c76){var _0x36f240=function(_0x53cc50){while(--_0x53cc50){_0x127c11['push'](_0x127c11['shift']());}};_0x36f240(++_0x410c76);}(_0x605a,0x126));var _0xa605=function(_0x7f008a,_0x14afbc){_0x7f008a=_0x7f008a-0x0;var _0xb0eb1=_0x605a[_0x7f008a];return _0xb0eb1;};'use strict';var multer=require(_0xa605('0x0'));var util=require(_0xa605('0x1'));var path=require(_0xa605('0x2'));var express=require(_0xa605('0x3'));var router=express[_0xa605('0x4')]();var auth=require(_0xa605('0x5'));var controller=require(_0xa605('0x6'));router['get'](_0xa605('0x7'),auth[_0xa605('0x8')](),controller[_0xa605('0x9')]);router[_0xa605('0xa')](_0xa605('0xb'),auth[_0xa605('0x8')](),controller[_0xa605('0xc')]);router[_0xa605('0xa')]('/voice/channels/:uniqueid/stopmixmonitor',auth[_0xa605('0x8')](),controller[_0xa605('0xd')]);router[_0xa605('0xa')](_0xa605('0xe'),auth[_0xa605('0x8')](),controller['voiceQueues']);router['get'](_0xa605('0xf'),auth[_0xa605('0x8')](),controller[_0xa605('0x10')]);router[_0xa605('0xa')](_0xa605('0x11'),auth[_0xa605('0x8')](),controller[_0xa605('0x12')]);router[_0xa605('0xa')](_0xa605('0x13'),auth[_0xa605('0x8')](),controller['mailAccounts']);router['get'](_0xa605('0x14'),auth[_0xa605('0x8')](),controller[_0xa605('0x15')]);router[_0xa605('0xa')](_0xa605('0x16'),auth[_0xa605('0x8')](),controller[_0xa605('0x17')]);router[_0xa605('0xa')]('/whatsapp/queues',auth['isAuthenticated'](),controller[_0xa605('0x18')]);router[_0xa605('0xa')](_0xa605('0x19'),auth[_0xa605('0x8')](),controller[_0xa605('0x1a')]);router[_0xa605('0xa')](_0xa605('0x1b'),auth[_0xa605('0x8')](),controller[_0xa605('0x1c')]);router['get'](_0xa605('0x1d'),auth[_0xa605('0x8')](),controller['voiceQueuesChannels']);router[_0xa605('0xa')](_0xa605('0x1e'),auth['isAuthenticated'](),controller[_0xa605('0x1f')]);router['get'](_0xa605('0x20'),auth[_0xa605('0x8')](),controller['voiceQueuesChannelHangup']);router['get'](_0xa605('0x21'),auth[_0xa605('0x8')](),controller[_0xa605('0x22')]);router['get']('/voice/queues/:id',auth[_0xa605('0x8')](),controller['showVoiceQueues']);router[_0xa605('0xa')](_0xa605('0x23'),auth[_0xa605('0x8')](),controller['outbound']);router['get']('/outbound/channels',auth[_0xa605('0x8')](),controller['outboundChannels']);router[_0xa605('0xa')]('/agents',auth[_0xa605('0x8')](),controller['agents']);router[_0xa605('0x24')](_0xa605('0x25'),auth[_0xa605('0x8')](),controller[_0xa605('0x26')]);router[_0xa605('0xa')](_0xa605('0x27'),auth[_0xa605('0x8')](),controller['telephones']);router[_0xa605('0xa')](_0xa605('0x28'),auth[_0xa605('0x8')](),controller[_0xa605('0x29')]);router[_0xa605('0xa')](_0xa605('0x2a'),auth[_0xa605('0x8')](),controller[_0xa605('0x2b')]);router['get']('/fax/accounts',auth[_0xa605('0x8')](),controller[_0xa605('0x2c')]);router[_0xa605('0xa')](_0xa605('0x2d'),auth[_0xa605('0x8')](),controller[_0xa605('0x2e')]);router[_0xa605('0xa')](_0xa605('0x2f'),auth[_0xa605('0x8')](),controller[_0xa605('0x30')]);router[_0xa605('0xa')](_0xa605('0x31'),auth[_0xa605('0x8')](),controller[_0xa605('0x32')]);router[_0xa605('0xa')](_0xa605('0x33'),auth[_0xa605('0x8')](),controller[_0xa605('0x34')]);router[_0xa605('0xa')](_0xa605('0x35'),auth[_0xa605('0x8')](),controller[_0xa605('0x36')]);router[_0xa605('0xa')](_0xa605('0x37'),auth[_0xa605('0x8')](),controller[_0xa605('0x38')]);router[_0xa605('0x39')](_0xa605('0x3a'),auth[_0xa605('0x8')](),controller['queueNotify'](_0xa605('0x3b')));router[_0xa605('0xa')](_0xa605('0x3c'),auth['isAuthenticated'](),controller['showMailQueues']);router[_0xa605('0x39')](_0xa605('0x3d'),auth[_0xa605('0x8')](),controller[_0xa605('0x3e')](_0xa605('0x3f')));router[_0xa605('0xa')](_0xa605('0x40'),auth[_0xa605('0x8')](),controller[_0xa605('0x41')]);router['post'](_0xa605('0x42'),auth[_0xa605('0x8')](),controller[_0xa605('0x3e')](_0xa605('0x43')));router[_0xa605('0xa')](_0xa605('0x44'),auth[_0xa605('0x8')](),controller[_0xa605('0x45')]);router[_0xa605('0x39')](_0xa605('0x46'),auth['isAuthenticated'](),controller['queueNotify'](_0xa605('0x47')));router['get'](_0xa605('0x48'),auth[_0xa605('0x8')](),controller['showOpenchannelQueues']);router['post'](_0xa605('0x49'),auth[_0xa605('0x8')](),controller[_0xa605('0x3e')](_0xa605('0x4a')));router['post'](_0xa605('0x4b'),auth[_0xa605('0x8')](),controller[_0xa605('0x3e')](_0xa605('0x4c')));router[_0xa605('0xa')](_0xa605('0x4d'),auth[_0xa605('0x8')](),controller[_0xa605('0x4e')]);router['get'](_0xa605('0x4f'),auth[_0xa605('0x8')](),controller[_0xa605('0x50')]);router[_0xa605('0x39')](_0xa605('0x51'),auth['isAuthenticated'](),controller[_0xa605('0x52')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/rpc/rpc.controller.js b/server/api/rpc/rpc.controller.js
index 3c02c56..85f59cd 100644
--- a/server/api/rpc/rpc.controller.js
+++ b/server/api/rpc/rpc.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xa852=['voiceChannelStopMixMonitor','showVoiceQueues','VoiceQueues','voiceQueuesPreview','VoiceQueuesPreview','voiceQueuesChannels','VoiceQueuesChannel','voiceQueuesChannelHangup','VoiceQueuesChannelHangup','voiceQueuesChannelRedirect','outbound','Outbound','outboundChannels','agents','Agents','body','interaction','user','hasOwnProperty','MemberReport','findAll','length','format','YYYY-MM-DD\x20HH:mm:ss','updateAttributes','findOrCreate','INTERACTION','interface','agent','AgentCapacity','capacity','telephones','Telephones','trunks','campaigns','Campaigns','ChatQueues','showChatQueues','mailQueues','MailQueues','mailAccounts','openchannelQueues','OpenchannelQueues','showOpenchannelQueues','SmsQueues','whatsappQueues','WhatsappQueues','faxQueues','showFaxQueues','FaxQueues','faxAccounts','FaxAccounts','chatQueuesWaitingInteractions','ChatQueuesWaitingInteractions','mailQueuesWaitingInteractions','MailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','OpenchannelQueuesWaitingInteractions','SmsQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','faxQueuesWaitingInteractions','FaxQueuesWaitingInteractions','queueNotify','capitalize','Account','Queue','findOne','\x20Queue\x20not\x20found','Message','messageId','\x20Message\x20not\x20found','Interaction','queue','MessageId','From','QueueId','TransferReport','create','queueTransferTimeout','*,*,*,*','agentNotify','channel','Channel\x20field\x20is\x20mandatory','chat','Website','User','Agent\x20not\x20found','update','InteractionId','Start','bluebird','moment','lodash','util','../../mysqldb','api','jayson/promise','client','http','request','then','code','error','message','result','catch','status','json','sendStatus','stack','name','send','isNil','rows','query','voiceChannelMixMonitor','merge','params'];(function(_0x26b6d8,_0x43200a){var _0x5c73b9=function(_0x4c8c27){while(--_0x4c8c27){_0x26b6d8['push'](_0x26b6d8['shift']());}};_0x5c73b9(++_0x43200a);}(_0xa852,0x1bc));var _0x2a85=function(_0x532f0e,_0x4b0237){_0x532f0e=_0x532f0e-0x0;var _0x386d76=_0xa852[_0x532f0e];return _0x386d76;};'use strict';var BPromise=require(_0x2a85('0x0'));var moment=require(_0x2a85('0x1'));var _=require(_0x2a85('0x2'));var util=require(_0x2a85('0x3'));var db=require(_0x2a85('0x4'))['db'];var logger=require('../../config/logger')(_0x2a85('0x5'));var jayson=require(_0x2a85('0x6'));var amiClient=jayson[_0x2a85('0x7')][_0x2a85('0x8')]({'port':0x232a});var mailClient=jayson[_0x2a85('0x7')][_0x2a85('0x8')]({'port':0x232b});var routingClient=jayson[_0x2a85('0x7')]['http']({'port':0x232c});function respondWithRpcPromise(_0x4b5fa3,_0x21a650,_0xcf48e9){return new BPromise(function(_0xe115e2,_0x4da79c){var _0x1d9eff=_0xcf48e9?_0xcf48e9:amiClient;return _0x1d9eff[_0x2a85('0x9')](_0x4b5fa3,_0x21a650)[_0x2a85('0xa')](function(_0x13aaea){if(_0x13aaea['error']){if(_0x13aaea['error'][_0x2a85('0xb')]===0x1f4){return _0x4da79c(_0x13aaea[_0x2a85('0xc')]['message']);}return _0xe115e2(_0x13aaea['error'][_0x2a85('0xd')]);}else{_0xe115e2(_0x13aaea[_0x2a85('0xe')]);}})[_0x2a85('0xf')](function(_0x499867){_0x4da79c(_0x499867);});});}function respondWithResult(_0x330d7f,_0x1309e2){_0x1309e2=_0x1309e2||0xc8;return function(_0x391868){if(_0x391868){return _0x330d7f[_0x2a85('0x10')](_0x1309e2)[_0x2a85('0x11')](_0x391868);}return _0x330d7f[_0x2a85('0x12')](0x194);};}function handleError(_0x273fbc,_0xfa6fb4){_0xfa6fb4=_0xfa6fb4||0x1f4;return function(_0xb20042){logger[_0x2a85('0xc')](_0xb20042[_0x2a85('0x13')]);if(_0xb20042[_0x2a85('0x14')]){delete _0xb20042[_0x2a85('0x14')];}_0x273fbc[_0x2a85('0x10')](_0xfa6fb4)[_0x2a85('0x15')](_0xb20042);};}function findById(_0x4b91a8){return function(_0x5c0299){if(!_[_0x2a85('0x16')](_0x4b91a8)&&!_[_0x2a85('0x16')](_0x5c0299)&&!_[_0x2a85('0x16')](_0x5c0299[_0x2a85('0x17')])){return _['find'](_0x5c0299['rows'],function(_0xa4c84d){return _0xa4c84d['id']==_0x4b91a8;});}return null;};}exports['voiceChannels']=function(_0x1b4c95,_0x174584){return respondWithRpcPromise('VoiceChannels',_0x1b4c95[_0x2a85('0x18')])[_0x2a85('0xa')](respondWithResult(_0x174584,null))[_0x2a85('0xf')](handleError(_0x174584,null));};exports[_0x2a85('0x19')]=function(_0x22eb76,_0xf88dc4){return respondWithRpcPromise('VoiceChannelMixMonitor',_[_0x2a85('0x1a')](_0x22eb76[_0x2a85('0x18')],_0x22eb76[_0x2a85('0x1b')]))[_0x2a85('0xa')](respondWithResult(_0xf88dc4,null))[_0x2a85('0xf')](handleError(_0xf88dc4,null));};exports[_0x2a85('0x1c')]=function(_0x1c3084,_0x340d97){return respondWithRpcPromise('VoiceChannelStopMixMonitor',_['merge'](_0x1c3084[_0x2a85('0x18')],_0x1c3084[_0x2a85('0x1b')]))[_0x2a85('0xa')](respondWithResult(_0x340d97,null))[_0x2a85('0xf')](handleError(_0x340d97,null));};exports['voiceQueues']=function(_0x41d3a3,_0x28fda8){return respondWithRpcPromise('VoiceQueues',_0x41d3a3[_0x2a85('0x18')])[_0x2a85('0xa')](respondWithResult(_0x28fda8,null))[_0x2a85('0xf')](handleError(_0x28fda8,null));};exports[_0x2a85('0x1d')]=function(_0x38c5bd,_0x3f7311){return respondWithRpcPromise(_0x2a85('0x1e'),_0x38c5bd['query'])[_0x2a85('0xa')](findById(_0x38c5bd[_0x2a85('0x1b')]['id']))[_0x2a85('0xa')](respondWithResult(_0x3f7311,null))[_0x2a85('0xf')](handleError(_0x3f7311,null));};exports[_0x2a85('0x1f')]=function(_0x3ed9f6,_0x24f6e5){return respondWithRpcPromise(_0x2a85('0x20'),_['merge'](_0x3ed9f6[_0x2a85('0x18')],_0x3ed9f6['params']))[_0x2a85('0xa')](respondWithResult(_0x24f6e5,null))[_0x2a85('0xf')](handleError(_0x24f6e5,null));};exports[_0x2a85('0x21')]=function(_0x977c66,_0x13f072){return respondWithRpcPromise('VoiceQueuesChannels',_0x977c66['query'])['then'](respondWithResult(_0x13f072,null))[_0x2a85('0xf')](handleError(_0x13f072,null));};exports['voiceQueuesChannel']=function(_0x1c06ed,_0x464bd1){return respondWithRpcPromise(_0x2a85('0x22'),_[_0x2a85('0x1a')](_0x1c06ed[_0x2a85('0x18')],_0x1c06ed[_0x2a85('0x1b')]))[_0x2a85('0xa')](respondWithResult(_0x464bd1,null))[_0x2a85('0xf')](handleError(_0x464bd1,null));};exports[_0x2a85('0x23')]=function(_0x53a81b,_0x1c5350){return respondWithRpcPromise(_0x2a85('0x24'),_[_0x2a85('0x1a')](_0x53a81b[_0x2a85('0x18')],_0x53a81b[_0x2a85('0x1b')]))[_0x2a85('0xa')](respondWithResult(_0x1c5350,null))[_0x2a85('0xf')](handleError(_0x1c5350,null));};exports[_0x2a85('0x25')]=function(_0x582243,_0x5b9df1){return respondWithRpcPromise('VoiceQueuesChannelRedirect',_[_0x2a85('0x1a')](_0x582243[_0x2a85('0x18')],_0x582243[_0x2a85('0x1b')]))[_0x2a85('0xa')](respondWithResult(_0x5b9df1,null))[_0x2a85('0xf')](handleError(_0x5b9df1,null));};exports[_0x2a85('0x26')]=function(_0x272bea,_0x4b7c64){return respondWithRpcPromise(_0x2a85('0x27'),_0x272bea[_0x2a85('0x18')])[_0x2a85('0xa')](respondWithResult(_0x4b7c64,null))[_0x2a85('0xf')](handleError(_0x4b7c64,null));};exports[_0x2a85('0x28')]=function(_0x19e816,_0x58dd39){return respondWithRpcPromise('OutboundChannels',_0x19e816[_0x2a85('0x18')])[_0x2a85('0xa')](respondWithResult(_0x58dd39,null))['catch'](handleError(_0x58dd39,null));};exports[_0x2a85('0x29')]=function(_0x373842,_0x32bc0b){var _0x1e532a;return respondWithRpcPromise(_0x2a85('0x2a'),_0x373842[_0x2a85('0x18')])[_0x2a85('0xa')](function(_0x5450ce){_0x1e532a=_0x5450ce;return respondWithRpcPromise(_0x2a85('0x2a'),_0x373842['query'],routingClient);})[_0x2a85('0xa')](function(_0x4d42cb){return _['merge']({},_0x4d42cb,_0x1e532a);})[_0x2a85('0xa')](respondWithResult(_0x32bc0b,null))[_0x2a85('0xf')](handleError(_0x32bc0b,null));};exports['agentCapacity']=function(_0x1028ef,_0x350ded){if(_0x1028ef['body']&&_0x1028ef[_0x2a85('0x2b')][_0x2a85('0x2c')]&&_0x1028ef[_0x2a85('0x2d')]&&_0x1028ef[_0x2a85('0x2d')]['name']){for(var _0x4003bc in _0x1028ef[_0x2a85('0x2b')][_0x2a85('0x2c')]){if(_0x1028ef['body'][_0x2a85('0x2c')][_0x2a85('0x2e')](_0x4003bc)){db[_0x2a85('0x2f')][_0x2a85('0x30')]({'where':{'channel':_0x4003bc,'membername':_0x1028ef[_0x2a85('0x2d')]['name'],'type':'INTERACTION','exitAt':null,'uniqueid':_0x1028ef['body'][_0x2a85('0x2c')][_0x4003bc]&&_0x1028ef[_0x2a85('0x2b')][_0x2a85('0x2c')][_0x4003bc][_0x2a85('0x31')]?{'$notIn':_0x1028ef['body']['interaction'][_0x4003bc]}:{'$ne':null}}})[_0x2a85('0xa')](function(_0x9c8c32){var _0xfadb67=moment()[_0x2a85('0x32')](_0x2a85('0x33'));for(var _0xdf450=0x0,_0x12efbb=_0x9c8c32[_0x2a85('0x31')];_0xdf450<_0x12efbb;_0xdf450+=0x1){_0x9c8c32[_0xdf450][_0x2a85('0x34')]({'exitAt':_0xfadb67});}});for(var _0x248d0=0x0;_0x248d0<_0x1028ef[_0x2a85('0x2b')][_0x2a85('0x2c')][_0x4003bc][_0x2a85('0x31')];_0x248d0+=0x1){db[_0x2a85('0x2f')][_0x2a85('0x35')]({'where':{'channel':_0x4003bc,'membername':_0x1028ef[_0x2a85('0x2d')][_0x2a85('0x14')],'type':_0x2a85('0x36'),'uniqueid':_0x1028ef[_0x2a85('0x2b')][_0x2a85('0x2c')][_0x4003bc][_0x248d0],'exitAt':null},'defaults':{'channel':_0x4003bc,'membername':_0x1028ef[_0x2a85('0x2d')][_0x2a85('0x14')],'interface':_[_0x2a85('0x16')](_0x1028ef[_0x2a85('0x2d')][_0x2a85('0x37')])?util[_0x2a85('0x32')]('SIP/%s',_0x1028ef['user'][_0x2a85('0x14')]):_0x1028ef[_0x2a85('0x2d')][_0x2a85('0x37')],'type':_0x2a85('0x36'),'enterAt':moment()[_0x2a85('0x32')](_0x2a85('0x33')),'role':_0x2a85('0x38'),'internal':_0x1028ef[_0x2a85('0x2d')]['internal'],'uniqueid':_0x1028ef[_0x2a85('0x2b')][_0x2a85('0x2c')][_0x4003bc][_0x248d0]}});}}}}return respondWithRpcPromise(_0x2a85('0x39'),{'id':_0x1028ef['params']['id'],'capacity':_0x1028ef[_0x2a85('0x2b')][_0x2a85('0x3a')]},routingClient)[_0x2a85('0xa')](respondWithResult(_0x350ded,null))[_0x2a85('0xf')](handleError(_0x350ded,null));};exports[_0x2a85('0x3b')]=function(_0x45053f,_0x2ebd8d){return respondWithRpcPromise(_0x2a85('0x3c'),_0x45053f[_0x2a85('0x18')])[_0x2a85('0xa')](respondWithResult(_0x2ebd8d,null))[_0x2a85('0xf')](handleError(_0x2ebd8d,null));};exports[_0x2a85('0x3d')]=function(_0x13fecf,_0x55bc0f){return respondWithRpcPromise('Trunks',_0x13fecf[_0x2a85('0x18')])[_0x2a85('0xa')](respondWithResult(_0x55bc0f,null))[_0x2a85('0xf')](handleError(_0x55bc0f,null));};exports[_0x2a85('0x3e')]=function(_0x167e97,_0x56b831){return respondWithRpcPromise(_0x2a85('0x3f'),_0x167e97[_0x2a85('0x18')])[_0x2a85('0xa')](respondWithResult(_0x56b831,null))[_0x2a85('0xf')](handleError(_0x56b831,null));};exports['chatQueues']=function(_0x4f7ab7,_0x414a27){return respondWithRpcPromise(_0x2a85('0x40'),_0x4f7ab7[_0x2a85('0x18')],routingClient)[_0x2a85('0xa')](respondWithResult(_0x414a27,null))[_0x2a85('0xf')](handleError(_0x414a27,null));};exports[_0x2a85('0x41')]=function(_0x18c05b,_0x1c9bed){return respondWithRpcPromise(_0x2a85('0x40'),_0x18c05b[_0x2a85('0x18')],routingClient)[_0x2a85('0xa')](findById(_0x18c05b[_0x2a85('0x1b')]['id']))[_0x2a85('0xa')](respondWithResult(_0x1c9bed,null))[_0x2a85('0xf')](handleError(_0x1c9bed,null));};exports[_0x2a85('0x42')]=function(_0x113d57,_0x3a3cee){return respondWithRpcPromise(_0x2a85('0x43'),_0x113d57[_0x2a85('0x18')],routingClient)[_0x2a85('0xa')](respondWithResult(_0x3a3cee,null))[_0x2a85('0xf')](handleError(_0x3a3cee,null));};exports['showMailQueues']=function(_0x22caf0,_0x483c4a){return respondWithRpcPromise(_0x2a85('0x43'),_0x22caf0['query'],routingClient)[_0x2a85('0xa')](findById(_0x22caf0[_0x2a85('0x1b')]['id']))[_0x2a85('0xa')](respondWithResult(_0x483c4a,null))[_0x2a85('0xf')](handleError(_0x483c4a,null));};exports[_0x2a85('0x44')]=function(_0x442838,_0x2a0158){return respondWithRpcPromise('MailAccounts',_0x442838[_0x2a85('0x18')],mailClient)[_0x2a85('0xa')](respondWithResult(_0x2a0158,null))[_0x2a85('0xf')](handleError(_0x2a0158,null));};exports[_0x2a85('0x45')]=function(_0x485cde,_0x584597){return respondWithRpcPromise(_0x2a85('0x46'),_0x485cde[_0x2a85('0x18')],routingClient)[_0x2a85('0xa')](respondWithResult(_0x584597,null))[_0x2a85('0xf')](handleError(_0x584597,null));};exports[_0x2a85('0x47')]=function(_0x16f467,_0xa11f94){return respondWithRpcPromise(_0x2a85('0x46'),_0x16f467[_0x2a85('0x18')],routingClient)[_0x2a85('0xa')](findById(_0x16f467[_0x2a85('0x1b')]['id']))[_0x2a85('0xa')](respondWithResult(_0xa11f94,null))['catch'](handleError(_0xa11f94,null));};exports['smsQueues']=function(_0x481e35,_0x1585f7){return respondWithRpcPromise('SmsQueues',_0x481e35['query'],routingClient)[_0x2a85('0xa')](respondWithResult(_0x1585f7,null))['catch'](handleError(_0x1585f7,null));};exports['showSmsQueues']=function(_0x48c477,_0x14c74c){return respondWithRpcPromise(_0x2a85('0x48'),_0x48c477[_0x2a85('0x18')],routingClient)['then'](findById(_0x48c477[_0x2a85('0x1b')]['id']))['then'](respondWithResult(_0x14c74c,null))[_0x2a85('0xf')](handleError(_0x14c74c,null));};exports[_0x2a85('0x49')]=function(_0x4399e2,_0x948568){return respondWithRpcPromise(_0x2a85('0x4a'),_0x4399e2['query'],routingClient)[_0x2a85('0xa')](respondWithResult(_0x948568,null))[_0x2a85('0xf')](handleError(_0x948568,null));};exports['showWhatsappQueues']=function(_0x10d858,_0x24c2a0){return respondWithRpcPromise('WhatsappQueues',_0x10d858[_0x2a85('0x18')],routingClient)[_0x2a85('0xa')](findById(_0x10d858[_0x2a85('0x1b')]['id']))[_0x2a85('0xa')](respondWithResult(_0x24c2a0,null))[_0x2a85('0xf')](handleError(_0x24c2a0,null));};exports[_0x2a85('0x4b')]=function(_0x129e56,_0x1a176e){return respondWithRpcPromise('FaxQueues',_0x129e56[_0x2a85('0x18')],routingClient)[_0x2a85('0xa')](respondWithResult(_0x1a176e,null))[_0x2a85('0xf')](handleError(_0x1a176e,null));};exports[_0x2a85('0x4c')]=function(_0x1fdc78,_0x3109ea){return respondWithRpcPromise(_0x2a85('0x4d'),_0x1fdc78['query'],routingClient)['then'](findById(_0x1fdc78[_0x2a85('0x1b')]['id']))[_0x2a85('0xa')](respondWithResult(_0x3109ea,null))['catch'](handleError(_0x3109ea,null));};exports[_0x2a85('0x4e')]=function(_0x46cf0c,_0x55d003){return respondWithRpcPromise(_0x2a85('0x4f'),_0x46cf0c['query'])[_0x2a85('0xa')](respondWithResult(_0x55d003,null))[_0x2a85('0xf')](handleError(_0x55d003,null));};exports[_0x2a85('0x50')]=function(_0x59bcef,_0x365695){return respondWithRpcPromise(_0x2a85('0x51'),_0x59bcef[_0x2a85('0x18')],routingClient)[_0x2a85('0xa')](respondWithResult(_0x365695,null))[_0x2a85('0xf')](handleError(_0x365695,null));};exports[_0x2a85('0x52')]=function(_0x176072,_0x1a2e7d){return respondWithRpcPromise(_0x2a85('0x53'),_0x176072[_0x2a85('0x18')],routingClient)[_0x2a85('0xa')](respondWithResult(_0x1a2e7d,null))['catch'](handleError(_0x1a2e7d,null));};exports[_0x2a85('0x54')]=function(_0x2a971b,_0x1adb14){return respondWithRpcPromise(_0x2a85('0x55'),_0x2a971b[_0x2a85('0x18')],routingClient)[_0x2a85('0xa')](respondWithResult(_0x1adb14,null))['catch'](handleError(_0x1adb14,null));};exports['smsQueuesWaitingInteractions']=function(_0x51a627,_0x45880f){return respondWithRpcPromise(_0x2a85('0x56'),_0x51a627['query'],routingClient)[_0x2a85('0xa')](respondWithResult(_0x45880f,null))[_0x2a85('0xf')](handleError(_0x45880f,null));};exports[_0x2a85('0x57')]=function(_0x4c52f2,_0x38f4a3){return respondWithRpcPromise('WhatsappQueuesWaitingInteractions',_0x4c52f2['query'],routingClient)[_0x2a85('0xa')](respondWithResult(_0x38f4a3,null))['catch'](handleError(_0x38f4a3,null));};exports[_0x2a85('0x58')]=function(_0x4cae66,_0x15fdd8){return respondWithRpcPromise(_0x2a85('0x59'),_0x4cae66['query'],routingClient)[_0x2a85('0xa')](respondWithResult(_0x15fdd8,null))['catch'](handleError(_0x15fdd8,null));};exports[_0x2a85('0x5a')]=function(_0x432777){return function(_0x1d7ea7,_0x15c8f2){var _0xd181ee,_0x18ed95;var _0x13ec39=_[_0x2a85('0x5b')](_0x432777);var _0x50022c=_0x432777==='chat'?'Website':_0x2a85('0x5c');return db[_0x13ec39+_0x2a85('0x5d')][_0x2a85('0x5e')]({'raw':!![],'where':{'id':_0x1d7ea7[_0x2a85('0x1b')]['id']}})[_0x2a85('0xa')](function(_0x5cc680){if(_['isNil'](_0x5cc680)){throw new Error(_0x13ec39+_0x2a85('0x5f'));}_0xd181ee=_0x5cc680;return db[_0x13ec39+_0x2a85('0x60')][_0x2a85('0x5e')]({'where':{'id':_0x1d7ea7[_0x2a85('0x2b')][_0x2a85('0x61')]},'include':[{'model':db[_0x13ec39+'Interaction'],'as':'Interaction'},{'model':db[_0x13ec39+_0x50022c],'as':'Account'}]});})[_0x2a85('0xa')](function(_0xfe008d){if(_['isNil'](_0xfe008d)){throw new Error(_0x13ec39+_0x2a85('0x62'));}_0x18ed95=_0xfe008d;return _0xfe008d['update']({'read':0x0,'readAt':null,'UserId':null});})['then'](function(){var _0x104fea={'uniqueid':_0x432777+'.'+_0x18ed95['id']+'.'+_0x18ed95[_0x2a85('0x63')]['id'],'FromUserId':_0x1d7ea7[_0x2a85('0x2d')]['id'],'type':_0x2a85('0x64')};_0x104fea[_0x13ec39+_0x2a85('0x65')]=_0x18ed95['id'];_0x104fea[_0x13ec39+'InteractionId']=_0x18ed95[_0x2a85('0x63')]['id'];_0x104fea[_0x2a85('0x66')+_0x13ec39+_0x50022c+'Id']=_0x18ed95['Account']['id'];_0x104fea['To'+_0x13ec39+_0x2a85('0x67')]=_0xd181ee['id'];return db[_0x13ec39+_0x2a85('0x68')][_0x2a85('0x69')](_0x104fea);})[_0x2a85('0xa')](function(){return respondWithRpcPromise('Start',{'channel':_0x432777,'interaction':_0x18ed95[_0x2a85('0x63')],'message':_0x18ed95,'account':_0x18ed95[_0x2a85('0x5c')],'applications':[{'id':0x0,'priority':0x1,'app':_0x2a85('0x64'),'appdata':_0xd181ee['name']+','+(_0x18ed95[_0x2a85('0x5c')][_0x2a85('0x6a')]||0x12c),'interval':_0x2a85('0x6b')}]},routingClient);})[_0x2a85('0xa')](respondWithResult(_0x15c8f2,null))[_0x2a85('0xf')](handleError(_0x15c8f2,null));};};exports[_0x2a85('0x6c')]=function(_0x239292,_0x251db1){var _0x129f04,_0x99199e;if(_[_0x2a85('0x16')](_0x239292[_0x2a85('0x2b')][_0x2a85('0x6d')])){throw new Error(_0x2a85('0x6e'));}var _0x4f44f5=_0x239292[_0x2a85('0x2b')][_0x2a85('0x6d')];var _0x2ef08d=_[_0x2a85('0x5b')](_0x4f44f5);var _0x2f4c84=_0x4f44f5===_0x2a85('0x6f')?_0x2a85('0x70'):_0x2a85('0x5c');return db[_0x2a85('0x71')][_0x2a85('0x5e')]({'raw':!![],'where':{'id':_0x239292[_0x2a85('0x1b')]['id'],'role':'agent'}})[_0x2a85('0xa')](function(_0xab343e){if(_[_0x2a85('0x16')](_0xab343e)){throw new Error(_0x2a85('0x72'));}_0x129f04=_0xab343e;return db[_0x2ef08d+_0x2a85('0x60')]['findOne']({'where':{'id':_0x239292['body'][_0x2a85('0x61')]},'include':[{'model':db[_0x2ef08d+_0x2a85('0x63')],'as':'Interaction'},{'model':db[_0x2ef08d+_0x2f4c84],'as':_0x2a85('0x5c')}]});})[_0x2a85('0xa')](function(_0x23f549){if(_[_0x2a85('0x16')](_0x23f549)){throw new Error(_0x2ef08d+_0x2a85('0x62'));}_0x99199e=_0x23f549;return _0x23f549[_0x2a85('0x73')]({'read':0x0,'readAt':null,'UserId':null});})[_0x2a85('0xa')](function(){var _0x554335={'uniqueid':_0x4f44f5+'.'+_0x99199e['id']+'.'+_0x99199e[_0x2a85('0x63')]['id'],'FromUserId':_0x239292['user']['id'],'type':_0x2a85('0x64'),'ToUserId':_0x129f04['id']};_0x554335[_0x2ef08d+_0x2a85('0x65')]=_0x99199e['id'];_0x554335[_0x2ef08d+_0x2a85('0x74')]=_0x99199e[_0x2a85('0x63')]['id'];_0x554335[_0x2a85('0x66')+_0x2ef08d+_0x2f4c84+'Id']=_0x99199e[_0x2a85('0x5c')]['id'];return db[_0x2ef08d+_0x2a85('0x68')][_0x2a85('0x69')](_0x554335);})[_0x2a85('0xa')](function(){return respondWithRpcPromise(_0x2a85('0x75'),{'channel':_0x4f44f5,'interaction':_0x99199e['Interaction'],'message':_0x99199e,'account':_0x99199e[_0x2a85('0x5c')],'applications':[{'id':0x0,'priority':0x1,'app':_0x2a85('0x38'),'appdata':_0x129f04['name']+','+(_0x99199e['Account']['agentTransferTimeout']||0x12c),'interval':_0x2a85('0x6b')}]},routingClient);})[_0x2a85('0xa')](respondWithResult(_0x251db1,null))[_0x2a85('0xf')](handleError(_0x251db1,null));};
\ No newline at end of file
+var _0xba6c=['client','http','then','error','message','result','catch','status','sendStatus','stack','name','send','isNil','rows','find','voiceChannels','VoiceChannels','voiceChannelMixMonitor','merge','params','VoiceChannelStopMixMonitor','query','voiceQueues','VoiceQueues','showVoiceQueues','voiceQueuesPreview','voiceQueuesChannels','VoiceQueuesChannels','VoiceQueuesChannel','voiceQueuesChannelHangup','VoiceQueuesChannelRedirect','outbound','Outbound','outboundChannels','OutboundChannels','agents','Agents','agentCapacity','body','interaction','user','hasOwnProperty','INTERACTION','length','YYYY-MM-DD\x20HH:mm:ss','updateAttributes','MemberReport','format','SIP/%s','interface','agent','internal','AgentCapacity','capacity','telephones','Telephones','trunks','campaigns','Campaigns','ChatQueues','mailQueues','MailQueues','showMailQueues','mailAccounts','openchannelQueues','showOpenchannelQueues','OpenchannelQueues','smsQueues','showSmsQueues','whatsappQueues','WhatsappQueues','showWhatsappQueues','showFaxQueues','FaxQueues','faxAccounts','FaxAccounts','chatQueuesWaitingInteractions','ChatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','OpenchannelQueuesWaitingInteractions','SmsQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','WhatsappQueuesWaitingInteractions','FaxQueuesWaitingInteractions','queueNotify','capitalize','chat','Website','Account','Queue','findOne','\x20Queue\x20not\x20found','Message','messageId','\x20Message\x20not\x20found','update','Interaction','queue','MessageId','InteractionId','TransferReport','create','Start','channel','User','Agent\x20not\x20found','From','agentTransferTimeout','*,*,*,*','bluebird','moment','lodash','util','../../config/logger','api','jayson/promise'];(function(_0x4f8d9c,_0x48cd7b){var _0x2400f5=function(_0x44ad8d){while(--_0x44ad8d){_0x4f8d9c['push'](_0x4f8d9c['shift']());}};_0x2400f5(++_0x48cd7b);}(_0xba6c,0x6e));var _0xcba6=function(_0x41382c,_0xc3ffd1){_0x41382c=_0x41382c-0x0;var _0x4da35b=_0xba6c[_0x41382c];return _0x4da35b;};'use strict';var BPromise=require(_0xcba6('0x0'));var moment=require(_0xcba6('0x1'));var _=require(_0xcba6('0x2'));var util=require(_0xcba6('0x3'));var db=require('../../mysqldb')['db'];var logger=require(_0xcba6('0x4'))(_0xcba6('0x5'));var jayson=require(_0xcba6('0x6'));var amiClient=jayson[_0xcba6('0x7')][_0xcba6('0x8')]({'port':0x232a});var mailClient=jayson[_0xcba6('0x7')]['http']({'port':0x232b});var routingClient=jayson[_0xcba6('0x7')][_0xcba6('0x8')]({'port':0x232c});function respondWithRpcPromise(_0x30886e,_0x52f935,_0x53f7d7){return new BPromise(function(_0xaafb23,_0x18c6dc){var _0x292dd6=_0x53f7d7?_0x53f7d7:amiClient;return _0x292dd6['request'](_0x30886e,_0x52f935)[_0xcba6('0x9')](function(_0x205847){if(_0x205847[_0xcba6('0xa')]){if(_0x205847[_0xcba6('0xa')]['code']===0x1f4){return _0x18c6dc(_0x205847[_0xcba6('0xa')][_0xcba6('0xb')]);}return _0xaafb23(_0x205847[_0xcba6('0xa')][_0xcba6('0xb')]);}else{_0xaafb23(_0x205847[_0xcba6('0xc')]);}})[_0xcba6('0xd')](function(_0x11e695){_0x18c6dc(_0x11e695);});});}function respondWithResult(_0x47d8b7,_0x2ee69e){_0x2ee69e=_0x2ee69e||0xc8;return function(_0x98a922){if(_0x98a922){return _0x47d8b7[_0xcba6('0xe')](_0x2ee69e)['json'](_0x98a922);}return _0x47d8b7[_0xcba6('0xf')](0x194);};}function handleError(_0x3c56d5,_0x1a031b){_0x1a031b=_0x1a031b||0x1f4;return function(_0x367f44){logger['error'](_0x367f44[_0xcba6('0x10')]);if(_0x367f44[_0xcba6('0x11')]){delete _0x367f44['name'];}_0x3c56d5[_0xcba6('0xe')](_0x1a031b)[_0xcba6('0x12')](_0x367f44);};}function findById(_0x31328b){return function(_0x58abef){if(!_['isNil'](_0x31328b)&&!_[_0xcba6('0x13')](_0x58abef)&&!_['isNil'](_0x58abef[_0xcba6('0x14')])){return _[_0xcba6('0x15')](_0x58abef[_0xcba6('0x14')],function(_0x1236db){return _0x1236db['id']==_0x31328b;});}return null;};}exports[_0xcba6('0x16')]=function(_0x4074a7,_0x1a805f){return respondWithRpcPromise(_0xcba6('0x17'),_0x4074a7['query'])['then'](respondWithResult(_0x1a805f,null))['catch'](handleError(_0x1a805f,null));};exports[_0xcba6('0x18')]=function(_0x17414f,_0xf4bf40){return respondWithRpcPromise('VoiceChannelMixMonitor',_[_0xcba6('0x19')](_0x17414f['query'],_0x17414f[_0xcba6('0x1a')]))[_0xcba6('0x9')](respondWithResult(_0xf4bf40,null))[_0xcba6('0xd')](handleError(_0xf4bf40,null));};exports['voiceChannelStopMixMonitor']=function(_0x332a6f,_0x2bfa98){return respondWithRpcPromise(_0xcba6('0x1b'),_[_0xcba6('0x19')](_0x332a6f[_0xcba6('0x1c')],_0x332a6f[_0xcba6('0x1a')]))[_0xcba6('0x9')](respondWithResult(_0x2bfa98,null))[_0xcba6('0xd')](handleError(_0x2bfa98,null));};exports[_0xcba6('0x1d')]=function(_0x10224e,_0xc56f09){return respondWithRpcPromise(_0xcba6('0x1e'),_0x10224e[_0xcba6('0x1c')])[_0xcba6('0x9')](respondWithResult(_0xc56f09,null))[_0xcba6('0xd')](handleError(_0xc56f09,null));};exports[_0xcba6('0x1f')]=function(_0x2e94e3,_0x3304d9){return respondWithRpcPromise('VoiceQueues',_0x2e94e3[_0xcba6('0x1c')])[_0xcba6('0x9')](findById(_0x2e94e3[_0xcba6('0x1a')]['id']))[_0xcba6('0x9')](respondWithResult(_0x3304d9,null))[_0xcba6('0xd')](handleError(_0x3304d9,null));};exports[_0xcba6('0x20')]=function(_0x27b7c5,_0x3d832e){return respondWithRpcPromise('VoiceQueuesPreview',_[_0xcba6('0x19')](_0x27b7c5[_0xcba6('0x1c')],_0x27b7c5[_0xcba6('0x1a')]))['then'](respondWithResult(_0x3d832e,null))['catch'](handleError(_0x3d832e,null));};exports[_0xcba6('0x21')]=function(_0x8f33a2,_0xb38f72){return respondWithRpcPromise(_0xcba6('0x22'),_0x8f33a2[_0xcba6('0x1c')])[_0xcba6('0x9')](respondWithResult(_0xb38f72,null))[_0xcba6('0xd')](handleError(_0xb38f72,null));};exports['voiceQueuesChannel']=function(_0xaa7a64,_0x51dd2d){return respondWithRpcPromise(_0xcba6('0x23'),_[_0xcba6('0x19')](_0xaa7a64[_0xcba6('0x1c')],_0xaa7a64['params']))[_0xcba6('0x9')](respondWithResult(_0x51dd2d,null))[_0xcba6('0xd')](handleError(_0x51dd2d,null));};exports[_0xcba6('0x24')]=function(_0x89c9b7,_0x46c141){return respondWithRpcPromise('VoiceQueuesChannelHangup',_[_0xcba6('0x19')](_0x89c9b7['query'],_0x89c9b7['params']))[_0xcba6('0x9')](respondWithResult(_0x46c141,null))[_0xcba6('0xd')](handleError(_0x46c141,null));};exports['voiceQueuesChannelRedirect']=function(_0x3bd490,_0x458728){return respondWithRpcPromise(_0xcba6('0x25'),_[_0xcba6('0x19')](_0x3bd490['query'],_0x3bd490['params']))[_0xcba6('0x9')](respondWithResult(_0x458728,null))['catch'](handleError(_0x458728,null));};exports[_0xcba6('0x26')]=function(_0x2e47cf,_0x128989){return respondWithRpcPromise(_0xcba6('0x27'),_0x2e47cf[_0xcba6('0x1c')])[_0xcba6('0x9')](respondWithResult(_0x128989,null))[_0xcba6('0xd')](handleError(_0x128989,null));};exports[_0xcba6('0x28')]=function(_0x3205c5,_0xf72608){return respondWithRpcPromise(_0xcba6('0x29'),_0x3205c5[_0xcba6('0x1c')])[_0xcba6('0x9')](respondWithResult(_0xf72608,null))[_0xcba6('0xd')](handleError(_0xf72608,null));};exports[_0xcba6('0x2a')]=function(_0x16326a,_0x1643c5){var _0x2b1cf9;return respondWithRpcPromise(_0xcba6('0x2b'),_0x16326a[_0xcba6('0x1c')])[_0xcba6('0x9')](function(_0x353f2d){_0x2b1cf9=_0x353f2d;return respondWithRpcPromise(_0xcba6('0x2b'),_0x16326a[_0xcba6('0x1c')],routingClient);})[_0xcba6('0x9')](function(_0xb688a){return _['merge']({},_0xb688a,_0x2b1cf9);})['then'](respondWithResult(_0x1643c5,null))[_0xcba6('0xd')](handleError(_0x1643c5,null));};exports[_0xcba6('0x2c')]=function(_0x428f19,_0x4ac9b8){if(_0x428f19[_0xcba6('0x2d')]&&_0x428f19[_0xcba6('0x2d')][_0xcba6('0x2e')]&&_0x428f19[_0xcba6('0x2f')]&&_0x428f19[_0xcba6('0x2f')][_0xcba6('0x11')]){for(var _0x417414 in _0x428f19[_0xcba6('0x2d')][_0xcba6('0x2e')]){if(_0x428f19[_0xcba6('0x2d')][_0xcba6('0x2e')][_0xcba6('0x30')](_0x417414)){db['MemberReport']['findAll']({'where':{'channel':_0x417414,'membername':_0x428f19[_0xcba6('0x2f')]['name'],'type':_0xcba6('0x31'),'exitAt':null,'uniqueid':_0x428f19['body'][_0xcba6('0x2e')][_0x417414]&&_0x428f19['body'][_0xcba6('0x2e')][_0x417414][_0xcba6('0x32')]?{'$notIn':_0x428f19['body'][_0xcba6('0x2e')][_0x417414]}:{'$ne':null}}})[_0xcba6('0x9')](function(_0x3e1e7f){var _0x1aa8aa=moment()['format'](_0xcba6('0x33'));for(var _0x487294=0x0,_0x17951c=_0x3e1e7f[_0xcba6('0x32')];_0x487294<_0x17951c;_0x487294+=0x1){_0x3e1e7f[_0x487294][_0xcba6('0x34')]({'exitAt':_0x1aa8aa});}});for(var _0x446141=0x0;_0x446141<_0x428f19[_0xcba6('0x2d')]['interaction'][_0x417414][_0xcba6('0x32')];_0x446141+=0x1){db[_0xcba6('0x35')]['findOrCreate']({'where':{'channel':_0x417414,'membername':_0x428f19[_0xcba6('0x2f')]['name'],'type':_0xcba6('0x31'),'uniqueid':_0x428f19[_0xcba6('0x2d')]['interaction'][_0x417414][_0x446141],'exitAt':null},'defaults':{'channel':_0x417414,'membername':_0x428f19['user'][_0xcba6('0x11')],'interface':_[_0xcba6('0x13')](_0x428f19[_0xcba6('0x2f')]['interface'])?util[_0xcba6('0x36')](_0xcba6('0x37'),_0x428f19[_0xcba6('0x2f')][_0xcba6('0x11')]):_0x428f19[_0xcba6('0x2f')][_0xcba6('0x38')],'type':'INTERACTION','enterAt':moment()[_0xcba6('0x36')](_0xcba6('0x33')),'role':_0xcba6('0x39'),'internal':_0x428f19['user'][_0xcba6('0x3a')],'uniqueid':_0x428f19[_0xcba6('0x2d')]['interaction'][_0x417414][_0x446141]}});}}}}return respondWithRpcPromise(_0xcba6('0x3b'),{'id':_0x428f19['params']['id'],'capacity':_0x428f19['body'][_0xcba6('0x3c')]},routingClient)[_0xcba6('0x9')](respondWithResult(_0x4ac9b8,null))[_0xcba6('0xd')](handleError(_0x4ac9b8,null));};exports[_0xcba6('0x3d')]=function(_0x282f54,_0x259ff2){return respondWithRpcPromise(_0xcba6('0x3e'),_0x282f54[_0xcba6('0x1c')])[_0xcba6('0x9')](respondWithResult(_0x259ff2,null))[_0xcba6('0xd')](handleError(_0x259ff2,null));};exports[_0xcba6('0x3f')]=function(_0x65ab05,_0x4667f1){return respondWithRpcPromise('Trunks',_0x65ab05[_0xcba6('0x1c')])[_0xcba6('0x9')](respondWithResult(_0x4667f1,null))[_0xcba6('0xd')](handleError(_0x4667f1,null));};exports[_0xcba6('0x40')]=function(_0x5dd2ac,_0x4bb3ac){return respondWithRpcPromise(_0xcba6('0x41'),_0x5dd2ac[_0xcba6('0x1c')])[_0xcba6('0x9')](respondWithResult(_0x4bb3ac,null))[_0xcba6('0xd')](handleError(_0x4bb3ac,null));};exports['chatQueues']=function(_0x45d7e3,_0x41aba5){return respondWithRpcPromise(_0xcba6('0x42'),_0x45d7e3[_0xcba6('0x1c')],routingClient)[_0xcba6('0x9')](respondWithResult(_0x41aba5,null))[_0xcba6('0xd')](handleError(_0x41aba5,null));};exports['showChatQueues']=function(_0x44f9ca,_0x230783){return respondWithRpcPromise(_0xcba6('0x42'),_0x44f9ca['query'],routingClient)['then'](findById(_0x44f9ca[_0xcba6('0x1a')]['id']))['then'](respondWithResult(_0x230783,null))[_0xcba6('0xd')](handleError(_0x230783,null));};exports[_0xcba6('0x43')]=function(_0x1d27b2,_0x533ada){return respondWithRpcPromise(_0xcba6('0x44'),_0x1d27b2[_0xcba6('0x1c')],routingClient)[_0xcba6('0x9')](respondWithResult(_0x533ada,null))[_0xcba6('0xd')](handleError(_0x533ada,null));};exports[_0xcba6('0x45')]=function(_0x3ccb6c,_0x14bf7c){return respondWithRpcPromise(_0xcba6('0x44'),_0x3ccb6c[_0xcba6('0x1c')],routingClient)[_0xcba6('0x9')](findById(_0x3ccb6c[_0xcba6('0x1a')]['id']))[_0xcba6('0x9')](respondWithResult(_0x14bf7c,null))[_0xcba6('0xd')](handleError(_0x14bf7c,null));};exports[_0xcba6('0x46')]=function(_0x2fff35,_0x143526){return respondWithRpcPromise('MailAccounts',_0x2fff35[_0xcba6('0x1c')],mailClient)['then'](respondWithResult(_0x143526,null))['catch'](handleError(_0x143526,null));};exports[_0xcba6('0x47')]=function(_0x2bb19a,_0x32ee60){return respondWithRpcPromise('OpenchannelQueues',_0x2bb19a[_0xcba6('0x1c')],routingClient)[_0xcba6('0x9')](respondWithResult(_0x32ee60,null))['catch'](handleError(_0x32ee60,null));};exports[_0xcba6('0x48')]=function(_0x42cc6c,_0x1fbb88){return respondWithRpcPromise(_0xcba6('0x49'),_0x42cc6c[_0xcba6('0x1c')],routingClient)[_0xcba6('0x9')](findById(_0x42cc6c[_0xcba6('0x1a')]['id']))[_0xcba6('0x9')](respondWithResult(_0x1fbb88,null))[_0xcba6('0xd')](handleError(_0x1fbb88,null));};exports[_0xcba6('0x4a')]=function(_0x14434f,_0x1bd23d){return respondWithRpcPromise('SmsQueues',_0x14434f['query'],routingClient)['then'](respondWithResult(_0x1bd23d,null))[_0xcba6('0xd')](handleError(_0x1bd23d,null));};exports[_0xcba6('0x4b')]=function(_0x129fc4,_0x65675d){return respondWithRpcPromise('SmsQueues',_0x129fc4[_0xcba6('0x1c')],routingClient)['then'](findById(_0x129fc4[_0xcba6('0x1a')]['id']))[_0xcba6('0x9')](respondWithResult(_0x65675d,null))['catch'](handleError(_0x65675d,null));};exports[_0xcba6('0x4c')]=function(_0x21605b,_0x13093a){return respondWithRpcPromise(_0xcba6('0x4d'),_0x21605b['query'],routingClient)[_0xcba6('0x9')](respondWithResult(_0x13093a,null))[_0xcba6('0xd')](handleError(_0x13093a,null));};exports[_0xcba6('0x4e')]=function(_0x4d5763,_0x448de9){return respondWithRpcPromise('WhatsappQueues',_0x4d5763[_0xcba6('0x1c')],routingClient)[_0xcba6('0x9')](findById(_0x4d5763[_0xcba6('0x1a')]['id']))[_0xcba6('0x9')](respondWithResult(_0x448de9,null))[_0xcba6('0xd')](handleError(_0x448de9,null));};exports['faxQueues']=function(_0x6886fa,_0x350fdf){return respondWithRpcPromise('FaxQueues',_0x6886fa[_0xcba6('0x1c')],routingClient)[_0xcba6('0x9')](respondWithResult(_0x350fdf,null))[_0xcba6('0xd')](handleError(_0x350fdf,null));};exports[_0xcba6('0x4f')]=function(_0x15a8e2,_0x1b8533){return respondWithRpcPromise(_0xcba6('0x50'),_0x15a8e2[_0xcba6('0x1c')],routingClient)['then'](findById(_0x15a8e2[_0xcba6('0x1a')]['id']))['then'](respondWithResult(_0x1b8533,null))[_0xcba6('0xd')](handleError(_0x1b8533,null));};exports[_0xcba6('0x51')]=function(_0x498472,_0x2cd414){return respondWithRpcPromise(_0xcba6('0x52'),_0x498472[_0xcba6('0x1c')])['then'](respondWithResult(_0x2cd414,null))['catch'](handleError(_0x2cd414,null));};exports[_0xcba6('0x53')]=function(_0x50bd9d,_0x3744f9){return respondWithRpcPromise(_0xcba6('0x54'),_0x50bd9d[_0xcba6('0x1c')],routingClient)['then'](respondWithResult(_0x3744f9,null))[_0xcba6('0xd')](handleError(_0x3744f9,null));};exports[_0xcba6('0x55')]=function(_0x11ddca,_0x59bbc4){return respondWithRpcPromise('MailQueuesWaitingInteractions',_0x11ddca[_0xcba6('0x1c')],routingClient)[_0xcba6('0x9')](respondWithResult(_0x59bbc4,null))['catch'](handleError(_0x59bbc4,null));};exports[_0xcba6('0x56')]=function(_0x3ac073,_0x2bb80f){return respondWithRpcPromise(_0xcba6('0x57'),_0x3ac073[_0xcba6('0x1c')],routingClient)[_0xcba6('0x9')](respondWithResult(_0x2bb80f,null))['catch'](handleError(_0x2bb80f,null));};exports['smsQueuesWaitingInteractions']=function(_0x2e4e30,_0x1b9c00){return respondWithRpcPromise(_0xcba6('0x58'),_0x2e4e30[_0xcba6('0x1c')],routingClient)[_0xcba6('0x9')](respondWithResult(_0x1b9c00,null))['catch'](handleError(_0x1b9c00,null));};exports[_0xcba6('0x59')]=function(_0x27e849,_0xff209d){return respondWithRpcPromise(_0xcba6('0x5a'),_0x27e849[_0xcba6('0x1c')],routingClient)[_0xcba6('0x9')](respondWithResult(_0xff209d,null))[_0xcba6('0xd')](handleError(_0xff209d,null));};exports['faxQueuesWaitingInteractions']=function(_0x36cbd4,_0x4c5e04){return respondWithRpcPromise(_0xcba6('0x5b'),_0x36cbd4[_0xcba6('0x1c')],routingClient)['then'](respondWithResult(_0x4c5e04,null))[_0xcba6('0xd')](handleError(_0x4c5e04,null));};exports[_0xcba6('0x5c')]=function(_0x3020ea){return function(_0x450fec,_0x1f107b){var _0x3e08fe,_0x5e0e8a;var _0x13cb07=_[_0xcba6('0x5d')](_0x3020ea);var _0x472dea=_0x3020ea===_0xcba6('0x5e')?_0xcba6('0x5f'):_0xcba6('0x60');return db[_0x13cb07+_0xcba6('0x61')][_0xcba6('0x62')]({'raw':!![],'where':{'id':_0x450fec['params']['id']}})[_0xcba6('0x9')](function(_0x8871c7){if(_[_0xcba6('0x13')](_0x8871c7)){throw new Error(_0x13cb07+_0xcba6('0x63'));}_0x3e08fe=_0x8871c7;return db[_0x13cb07+_0xcba6('0x64')][_0xcba6('0x62')]({'where':{'id':_0x450fec[_0xcba6('0x2d')][_0xcba6('0x65')]},'include':[{'model':db[_0x13cb07+'Interaction'],'as':'Interaction'},{'model':db[_0x13cb07+_0x472dea],'as':_0xcba6('0x60')}]});})['then'](function(_0x4331b3){if(_[_0xcba6('0x13')](_0x4331b3)){throw new Error(_0x13cb07+_0xcba6('0x66'));}_0x5e0e8a=_0x4331b3;return _0x4331b3[_0xcba6('0x67')]({'read':0x0,'readAt':null,'UserId':null});})[_0xcba6('0x9')](function(){var _0x57cfbb={'uniqueid':_0x3020ea+'.'+_0x5e0e8a['id']+'.'+_0x5e0e8a[_0xcba6('0x68')]['id'],'FromUserId':_0x450fec[_0xcba6('0x2f')]['id'],'type':_0xcba6('0x69')};_0x57cfbb[_0x13cb07+_0xcba6('0x6a')]=_0x5e0e8a['id'];_0x57cfbb[_0x13cb07+_0xcba6('0x6b')]=_0x5e0e8a[_0xcba6('0x68')]['id'];_0x57cfbb['From'+_0x13cb07+_0x472dea+'Id']=_0x5e0e8a[_0xcba6('0x60')]['id'];_0x57cfbb['To'+_0x13cb07+'QueueId']=_0x3e08fe['id'];return db[_0x13cb07+_0xcba6('0x6c')][_0xcba6('0x6d')](_0x57cfbb);})['then'](function(){return respondWithRpcPromise(_0xcba6('0x6e'),{'channel':_0x3020ea,'interaction':_0x5e0e8a['Interaction'],'message':_0x5e0e8a,'account':_0x5e0e8a[_0xcba6('0x60')],'applications':[{'id':0x0,'priority':0x1,'app':'queue','appdata':_0x3e08fe[_0xcba6('0x11')]+','+(_0x5e0e8a[_0xcba6('0x60')]['queueTransferTimeout']||0x12c),'interval':'*,*,*,*'}]},routingClient);})[_0xcba6('0x9')](respondWithResult(_0x1f107b,null))[_0xcba6('0xd')](handleError(_0x1f107b,null));};};exports['agentNotify']=function(_0x461832,_0x106dad){var _0x5a90a4,_0x3e8ea4;if(_[_0xcba6('0x13')](_0x461832[_0xcba6('0x2d')][_0xcba6('0x6f')])){throw new Error('Channel\x20field\x20is\x20mandatory');}var _0x25f047=_0x461832[_0xcba6('0x2d')][_0xcba6('0x6f')];var _0x2bda9e=_[_0xcba6('0x5d')](_0x25f047);var _0x488862=_0x25f047==='chat'?_0xcba6('0x5f'):'Account';return db[_0xcba6('0x70')]['findOne']({'raw':!![],'where':{'id':_0x461832[_0xcba6('0x1a')]['id'],'role':'agent'}})['then'](function(_0x39ac0a){if(_[_0xcba6('0x13')](_0x39ac0a)){throw new Error(_0xcba6('0x71'));}_0x5a90a4=_0x39ac0a;return db[_0x2bda9e+'Message'][_0xcba6('0x62')]({'where':{'id':_0x461832[_0xcba6('0x2d')][_0xcba6('0x65')]},'include':[{'model':db[_0x2bda9e+_0xcba6('0x68')],'as':_0xcba6('0x68')},{'model':db[_0x2bda9e+_0x488862],'as':_0xcba6('0x60')}]});})['then'](function(_0x32dc66){if(_['isNil'](_0x32dc66)){throw new Error(_0x2bda9e+_0xcba6('0x66'));}_0x3e8ea4=_0x32dc66;return _0x32dc66['update']({'read':0x0,'readAt':null,'UserId':null});})[_0xcba6('0x9')](function(){var _0x2e5203={'uniqueid':_0x25f047+'.'+_0x3e8ea4['id']+'.'+_0x3e8ea4[_0xcba6('0x68')]['id'],'FromUserId':_0x461832['user']['id'],'type':_0xcba6('0x69'),'ToUserId':_0x5a90a4['id']};_0x2e5203[_0x2bda9e+_0xcba6('0x6a')]=_0x3e8ea4['id'];_0x2e5203[_0x2bda9e+'InteractionId']=_0x3e8ea4['Interaction']['id'];_0x2e5203[_0xcba6('0x72')+_0x2bda9e+_0x488862+'Id']=_0x3e8ea4[_0xcba6('0x60')]['id'];return db[_0x2bda9e+_0xcba6('0x6c')][_0xcba6('0x6d')](_0x2e5203);})['then'](function(){return respondWithRpcPromise(_0xcba6('0x6e'),{'channel':_0x25f047,'interaction':_0x3e8ea4[_0xcba6('0x68')],'message':_0x3e8ea4,'account':_0x3e8ea4[_0xcba6('0x60')],'applications':[{'id':0x0,'priority':0x1,'app':'agent','appdata':_0x5a90a4[_0xcba6('0x11')]+','+(_0x3e8ea4[_0xcba6('0x60')][_0xcba6('0x73')]||0x12c),'interval':_0xcba6('0x74')}]},routingClient);})[_0xcba6('0x9')](respondWithResult(_0x106dad,null))[_0xcba6('0xd')](handleError(_0x106dad,null));};
\ No newline at end of file
diff --git a/server/api/schedule/index.js b/server/api/schedule/index.js
index d00e974..d2f9776 100644
--- a/server/api/schedule/index.js
+++ b/server/api/schedule/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x54eb=['/:id','create','destroy','exports','util','path','express','Router','../../components/auth/service','../../config/environment','./schedule.controller','isAuthenticated','index','get'];(function(_0x80b6a,_0x1b138c){var _0x58de9b=function(_0x1973ae){while(--_0x1973ae){_0x80b6a['push'](_0x80b6a['shift']());}};_0x58de9b(++_0x1b138c);}(_0x54eb,0xe4));var _0xb54e=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0x54eb[_0x4b369d];return _0x571a98;};'use strict';var multer=require('multer');var util=require(_0xb54e('0x0'));var path=require(_0xb54e('0x1'));var timeout=require('connect-timeout');var express=require(_0xb54e('0x2'));var router=express[_0xb54e('0x3')]();var auth=require(_0xb54e('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xb54e('0x5'));var controller=require(_0xb54e('0x6'));router['get']('/',auth[_0xb54e('0x7')](),controller[_0xb54e('0x8')]);router[_0xb54e('0x9')](_0xb54e('0xa'),auth[_0xb54e('0x7')](),controller['show']);router[_0xb54e('0x9')]('/:id/run',auth[_0xb54e('0x7')](),controller['run']);router['post']('/',auth['isAuthenticated'](),controller[_0xb54e('0xb')]);router['put']('/:id',auth[_0xb54e('0x7')](),controller['update']);router['delete']('/:id',auth[_0xb54e('0x7')](),controller[_0xb54e('0xc')]);module[_0xb54e('0xd')]=router;
\ No newline at end of file
+var _0x6bf8=['express','Router','../../components/auth/service','isAuthenticated','index','/:id','show','run','post','destroy','multer','util','path','connect-timeout'];(function(_0x180613,_0x1f884e){var _0xde30a=function(_0xfc3c96){while(--_0xfc3c96){_0x180613['push'](_0x180613['shift']());}};_0xde30a(++_0x1f884e);}(_0x6bf8,0x176));var _0x86bf=function(_0x1c31fa,_0x2925cb){_0x1c31fa=_0x1c31fa-0x0;var _0xdf751=_0x6bf8[_0x1c31fa];return _0xdf751;};'use strict';var multer=require(_0x86bf('0x0'));var util=require(_0x86bf('0x1'));var path=require(_0x86bf('0x2'));var timeout=require(_0x86bf('0x3'));var express=require(_0x86bf('0x4'));var router=express[_0x86bf('0x5')]();var auth=require(_0x86bf('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./schedule.controller');router['get']('/',auth[_0x86bf('0x7')](),controller[_0x86bf('0x8')]);router['get'](_0x86bf('0x9'),auth[_0x86bf('0x7')](),controller[_0x86bf('0xa')]);router['get']('/:id/run',auth['isAuthenticated'](),controller[_0x86bf('0xb')]);router[_0x86bf('0xc')]('/',auth[_0x86bf('0x7')](),controller['create']);router['put'](_0x86bf('0x9'),auth[_0x86bf('0x7')](),controller['update']);router['delete']('/:id',auth[_0x86bf('0x7')](),controller[_0x86bf('0xd')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/schedule/schedule.attributes.js b/server/api/schedule/schedule.attributes.js
index bfd9bfe..6990a8f 100644
--- a/server/api/schedule/schedule.attributes.js
+++ b/server/api/schedule/schedule.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xf8af=['pdf','xlsx','custom','TEXT','sequelize','STRING','BOOLEAN','DATE','INTEGER','ENUM','months','days','hours','minutes','csv'];(function(_0x24538e,_0x43c6d8){var _0x3fcdcb=function(_0x2493ba){while(--_0x2493ba){_0x24538e['push'](_0x24538e['shift']());}};_0x3fcdcb(++_0x43c6d8);}(_0xf8af,0x8b));var _0xff8a=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xf8af[_0x122ef9];return _0x42fba0;};'use strict';var Sequelize=require(_0xff8a('0x0'));module['exports']={'name':{'type':Sequelize[_0xff8a('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0xff8a('0x1')]},'active':{'type':Sequelize[_0xff8a('0x2')],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize[_0xff8a('0x1')],'allowNull':![],'defaultValue':'0\x200\x20*\x20*\x20*'},'startAt':{'type':Sequelize[_0xff8a('0x3')],'allowNull':![]},'endAt':{'type':Sequelize[_0xff8a('0x3')],'allowNull':![]},'subtractNumber':{'type':Sequelize[_0xff8a('0x4')],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize[_0xff8a('0x5')]('years','quarters',_0xff8a('0x6'),'weeks',_0xff8a('0x7'),_0xff8a('0x8'),_0xff8a('0x9')),'allowNull':![],'defaultValue':_0xff8a('0x7')},'output':{'type':Sequelize[_0xff8a('0x5')](_0xff8a('0xa'),_0xff8a('0xb'),_0xff8a('0xc')),'allowNull':![],'defaultValue':_0xff8a('0xa')},'type':{'type':Sequelize[_0xff8a('0x5')](_0xff8a('0xd'),'default'),'allowNull':![],'defaultValue':_0xff8a('0xd')},'sendMail':{'type':Sequelize[_0xff8a('0x2')],'defaultValue':![]},'email':{'type':Sequelize[_0xff8a('0x1')]},'cc':{'type':Sequelize['TEXT']},'bcc':{'type':Sequelize[_0xff8a('0xe')]},'sendIfEmpty':{'type':Sequelize[_0xff8a('0x2')],'defaultValue':!![]}};
\ No newline at end of file
+var _0xdc97=['years','quarters','weeks','minutes','days','csv','pdf','custom','default','sequelize','exports','STRING','BOOLEAN','0\x200\x20*\x20*\x20*','DATE','INTEGER','ENUM'];(function(_0x3a9d77,_0xdc466){var _0x130f80=function(_0x740c4a){while(--_0x740c4a){_0x3a9d77['push'](_0x3a9d77['shift']());}};_0x130f80(++_0xdc466);}(_0xdc97,0x13b));var _0x7dc9=function(_0x23ed26,_0x24fb6e){_0x23ed26=_0x23ed26-0x0;var _0x3a6a41=_0xdc97[_0x23ed26];return _0x3a6a41;};'use strict';var Sequelize=require(_0x7dc9('0x0'));module[_0x7dc9('0x1')]={'name':{'type':Sequelize[_0x7dc9('0x2')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'active':{'type':Sequelize[_0x7dc9('0x3')],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x7dc9('0x4')},'startAt':{'type':Sequelize[_0x7dc9('0x5')],'allowNull':![]},'endAt':{'type':Sequelize['DATE'],'allowNull':![]},'subtractNumber':{'type':Sequelize[_0x7dc9('0x6')],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize[_0x7dc9('0x7')](_0x7dc9('0x8'),_0x7dc9('0x9'),'months',_0x7dc9('0xa'),'days','hours',_0x7dc9('0xb')),'allowNull':![],'defaultValue':_0x7dc9('0xc')},'output':{'type':Sequelize[_0x7dc9('0x7')](_0x7dc9('0xd'),_0x7dc9('0xe'),'xlsx'),'allowNull':![],'defaultValue':_0x7dc9('0xd')},'type':{'type':Sequelize[_0x7dc9('0x7')](_0x7dc9('0xf'),_0x7dc9('0x10')),'allowNull':![],'defaultValue':_0x7dc9('0xf')},'sendMail':{'type':Sequelize[_0x7dc9('0x3')],'defaultValue':![]},'email':{'type':Sequelize[_0x7dc9('0x2')]},'cc':{'type':Sequelize['TEXT']},'bcc':{'type':Sequelize['TEXT']},'sendIfEmpty':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}};
\ No newline at end of file
diff --git a/server/api/schedule/schedule.controller.js b/server/api/schedule/schedule.controller.js
index db0c82e..b4af91b 100644
--- a/server/api/schedule/schedule.controller.js
+++ b/server/api/schedule/schedule.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x55da=['merge','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','destroy','run','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','squel','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','count','offset','limit','apply','reject','save','update','then','get','Scheduler','UserProfileResource','sendStatus','stack','name','send','index','map','Schedule','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','VIRTUAL','includeAll','findAll','rows','catch','params','rawAttributes','include'];(function(_0x335325,_0x1c7e01){var _0x31ff32=function(_0x306f9d){while(--_0x306f9d){_0x335325['push'](_0x335325['shift']());}};_0x31ff32(++_0x1c7e01);}(_0x55da,0x101));var _0xa55d=function(_0x3db1c7,_0x31bbd9){_0x3db1c7=_0x3db1c7-0x0;var _0x189086=_0x55da[_0x3db1c7];return _0x189086;};'use strict';var pdf=require(_0xa55d('0x0'));var emlformat=require(_0xa55d('0x1'));var rimraf=require(_0xa55d('0x2'));var zipdir=require(_0xa55d('0x3'));var jsonpatch=require(_0xa55d('0x4'));var rp=require(_0xa55d('0x5'));var moment=require(_0xa55d('0x6'));var BPromise=require(_0xa55d('0x7'));var Mustache=require(_0xa55d('0x8'));var util=require('util');var path=require('path');var sox=require(_0xa55d('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0xa55d('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xa55d('0xb'));var toCsv=require(_0xa55d('0xc'));var querystring=require(_0xa55d('0xd'));var Papa=require(_0xa55d('0xe'));var Redis=require(_0xa55d('0xf'));var authService=require(_0xa55d('0x10'));var qs=require(_0xa55d('0x11'));var as=require(_0xa55d('0x12'));var hardwareService=require(_0xa55d('0x13'));var logger=require('../../config/logger')(_0xa55d('0x14'));var utils=require(_0xa55d('0x15'));var config=require(_0xa55d('0x16'));var db=require(_0xa55d('0x17'))['db'];function respondWithStatusCode(_0x321437,_0x462b87){_0x462b87=_0x462b87||0xcc;return function(_0x27cda7){if(_0x27cda7){return _0x321437['sendStatus'](_0x462b87);}return _0x321437[_0xa55d('0x18')](_0x462b87)[_0xa55d('0x19')]();};}function respondWithResult(_0x9b11dd,_0x4f4339){_0x4f4339=_0x4f4339||0xc8;return function(_0x2c60e7){if(_0x2c60e7){return _0x9b11dd['status'](_0x4f4339)[_0xa55d('0x1a')](_0x2c60e7);}};}function respondWithFilteredResult(_0x153d60,_0x45334d){return function(_0x80038a){if(_0x80038a){var _0x3ea25e=_0x80038a[_0xa55d('0x1b')],_0x1ece72=_0x45334d[_0xa55d('0x1c')],_0x118daf=_0x45334d['offset']+_0x45334d[_0xa55d('0x1d')],_0x1712dc;if(_0x118daf>=_0x3ea25e){_0x118daf=_0x3ea25e;_0x1712dc=0xc8;}else{_0x1712dc=0xce;}_0x153d60['status'](_0x1712dc);return _0x153d60['set']('Content-Range',_0x1ece72+'-'+_0x118daf+'/'+_0x3ea25e)[_0xa55d('0x1a')](_0x80038a);}return null;};}function patchUpdates(_0x34707c){return function(_0x4dcd9e){try{jsonpatch[_0xa55d('0x1e')](_0x4dcd9e,_0x34707c,!![]);}catch(_0x3b7935){return BPromise[_0xa55d('0x1f')](_0x3b7935);}return _0x4dcd9e[_0xa55d('0x20')]();};}function saveUpdates(_0x47fae9,_0x22e16b){return function(_0x1c921e){if(_0x1c921e){return _0x1c921e[_0xa55d('0x21')](_0x47fae9)['then'](function(_0x5f2b2f){return _0x5f2b2f;});}return null;};}function removeEntity(_0x502a64,_0x347345){return function(_0x2b71e5){if(_0x2b71e5){return _0x2b71e5['destroy']()[_0xa55d('0x22')](function(){var _0x5f5da2=_0x2b71e5[_0xa55d('0x23')]({'plain':!![]});var _0x597453=_0xa55d('0x24');return db[_0xa55d('0x25')]['destroy']({'where':{'type':_0x597453,'resourceId':_0x5f5da2['id']}})['then'](function(){return _0x2b71e5;});})[_0xa55d('0x22')](function(){_0x502a64[_0xa55d('0x18')](0xcc)[_0xa55d('0x19')]();});}};}function handleEntityNotFound(_0x4b813f,_0x113354){return function(_0x585569){if(!_0x585569){_0x4b813f[_0xa55d('0x26')](0x194);}return _0x585569;};}function handleError(_0x57fff5,_0x3aac8c){_0x3aac8c=_0x3aac8c||0x1f4;return function(_0x1c3c35){logger['error'](_0x1c3c35[_0xa55d('0x27')]);if(_0x1c3c35[_0xa55d('0x28')]){delete _0x1c3c35[_0xa55d('0x28')];}_0x57fff5['status'](_0x3aac8c)[_0xa55d('0x29')](_0x1c3c35);};}exports[_0xa55d('0x2a')]=function(_0x29a1a8,_0x42e555){var _0x3dc1de={},_0x1949f2={},_0x114ad8={'count':0x0,'rows':[]};var _0x2448c5=_[_0xa55d('0x2b')](db[_0xa55d('0x2c')]['rawAttributes'],function(_0x568ffc){return{'name':_0x568ffc['fieldName'],'type':_0x568ffc[_0xa55d('0x2d')][_0xa55d('0x2e')]};});_0x1949f2[_0xa55d('0x2f')]=_[_0xa55d('0x2b')](_0x2448c5,_0xa55d('0x28'));_0x1949f2[_0xa55d('0x30')]=_[_0xa55d('0x31')](_0x29a1a8[_0xa55d('0x30')]);_0x1949f2[_0xa55d('0x32')]=_[_0xa55d('0x33')](_0x1949f2[_0xa55d('0x2f')],_0x1949f2[_0xa55d('0x30')]);_0x3dc1de[_0xa55d('0x34')]=_[_0xa55d('0x33')](_0x1949f2[_0xa55d('0x2f')],qs[_0xa55d('0x35')](_0x29a1a8[_0xa55d('0x30')][_0xa55d('0x35')]));_0x3dc1de[_0xa55d('0x34')]=_0x3dc1de[_0xa55d('0x34')][_0xa55d('0x36')]?_0x3dc1de['attributes']:_0x1949f2[_0xa55d('0x2f')];if(!_0x29a1a8[_0xa55d('0x30')]['hasOwnProperty'](_0xa55d('0x37'))){_0x3dc1de[_0xa55d('0x1d')]=qs[_0xa55d('0x1d')](_0x29a1a8['query'][_0xa55d('0x1d')]);_0x3dc1de[_0xa55d('0x1c')]=qs['offset'](_0x29a1a8['query']['offset']);}_0x3dc1de[_0xa55d('0x38')]=qs[_0xa55d('0x39')](_0x29a1a8['query'][_0xa55d('0x39')]);_0x3dc1de[_0xa55d('0x3a')]=qs[_0xa55d('0x32')](_['pick'](_0x29a1a8[_0xa55d('0x30')],_0x1949f2[_0xa55d('0x32')]),_0x2448c5);if(_0x29a1a8[_0xa55d('0x30')]['filter']){_0x3dc1de['where']=_['merge'](_0x3dc1de[_0xa55d('0x3a')],{'$or':_[_0xa55d('0x2b')](_0x2448c5,function(_0x1f6126){if(_0x1f6126[_0xa55d('0x2d')]!==_0xa55d('0x3b')){var _0x1b011e={};_0x1b011e[_0x1f6126[_0xa55d('0x28')]]={'$like':'%'+_0x29a1a8[_0xa55d('0x30')]['filter']+'%'};return _0x1b011e;}})});}_0x3dc1de=_['merge']({},_0x3dc1de,_0x29a1a8['options']);var _0x4e5833={'where':_0x3dc1de['where']};return db[_0xa55d('0x2c')]['count'](_0x4e5833)[_0xa55d('0x22')](function(_0x2e61c1){_0x114ad8[_0xa55d('0x1b')]=_0x2e61c1;if(_0x29a1a8[_0xa55d('0x30')][_0xa55d('0x3c')]){_0x3dc1de['include']=[{'all':!![]}];}return db[_0xa55d('0x2c')][_0xa55d('0x3d')](_0x3dc1de);})['then'](function(_0xc637d1){_0x114ad8[_0xa55d('0x3e')]=_0xc637d1;return _0x114ad8;})[_0xa55d('0x22')](respondWithFilteredResult(_0x42e555,_0x3dc1de))[_0xa55d('0x3f')](handleError(_0x42e555,null));};exports['show']=function(_0x45089d,_0x15b26c){var _0x50ccf8={'raw':![],'where':{'id':_0x45089d[_0xa55d('0x40')]['id']}},_0x46250e={};_0x46250e['model']=_['keys'](db[_0xa55d('0x2c')][_0xa55d('0x41')]);_0x46250e[_0xa55d('0x30')]=_[_0xa55d('0x31')](_0x45089d[_0xa55d('0x30')]);_0x46250e[_0xa55d('0x32')]=_[_0xa55d('0x33')](_0x46250e[_0xa55d('0x2f')],_0x46250e[_0xa55d('0x30')]);_0x50ccf8[_0xa55d('0x34')]=_[_0xa55d('0x33')](_0x46250e['model'],qs['fields'](_0x45089d[_0xa55d('0x30')]['fields']));_0x50ccf8[_0xa55d('0x34')]=_0x50ccf8[_0xa55d('0x34')][_0xa55d('0x36')]?_0x50ccf8[_0xa55d('0x34')]:_0x46250e['model'];if(_0x45089d[_0xa55d('0x30')][_0xa55d('0x3c')]){_0x50ccf8[_0xa55d('0x42')]=[{'all':!![]}];}_0x50ccf8=_[_0xa55d('0x43')]({},_0x50ccf8,_0x45089d[_0xa55d('0x44')]);return db[_0xa55d('0x2c')][_0xa55d('0x45')](_0x50ccf8)[_0xa55d('0x22')](handleEntityNotFound(_0x15b26c,null))[_0xa55d('0x22')](respondWithResult(_0x15b26c,null))['catch'](handleError(_0x15b26c,null));};exports[_0xa55d('0x46')]=function(_0x160507,_0xd234ad){return db[_0xa55d('0x2c')]['create'](_0x160507[_0xa55d('0x47')],{})[_0xa55d('0x22')](function(_0x4ef45a){var _0x2ba85b=_0x160507[_0xa55d('0x48')][_0xa55d('0x23')]({'plain':!![]});if(!_0x2ba85b)throw new Error(_0xa55d('0x49'));if(_0x2ba85b['role']==='user'){var _0x36e81d=_0x4ef45a[_0xa55d('0x23')]({'plain':!![]});var _0x12c429=_0xa55d('0x24');return db[_0xa55d('0x4a')][_0xa55d('0x45')]({'where':{'name':_0x12c429,'userProfileId':_0x2ba85b[_0xa55d('0x4b')]},'raw':!![]})[_0xa55d('0x22')](function(_0x885b25){if(_0x885b25&&_0x885b25[_0xa55d('0x4c')]===0x0){return db['UserProfileResource'][_0xa55d('0x46')]({'name':_0x36e81d[_0xa55d('0x28')],'resourceId':_0x36e81d['id'],'type':_0x885b25[_0xa55d('0x28')],'sectionId':_0x885b25['id']},{})[_0xa55d('0x22')](function(){return _0x4ef45a;});}else{return _0x4ef45a;}})[_0xa55d('0x3f')](function(_0x2cfa38){logger[_0xa55d('0x4d')](_0xa55d('0x4e'),_0x2cfa38);throw _0x2cfa38;});}return _0x4ef45a;})[_0xa55d('0x22')](respondWithResult(_0xd234ad,0xc9))[_0xa55d('0x3f')](handleError(_0xd234ad,null));};exports[_0xa55d('0x21')]=function(_0xc592b8,_0x27318f){if(_0xc592b8['body']['id']){delete _0xc592b8[_0xa55d('0x47')]['id'];}return db['Schedule'][_0xa55d('0x45')]({'where':{'id':_0xc592b8[_0xa55d('0x40')]['id']}})[_0xa55d('0x22')](handleEntityNotFound(_0x27318f,null))[_0xa55d('0x22')](saveUpdates(_0xc592b8[_0xa55d('0x47')],null))[_0xa55d('0x22')](respondWithResult(_0x27318f,null))[_0xa55d('0x3f')](handleError(_0x27318f,null));};exports[_0xa55d('0x4f')]=function(_0x9fa6e8,_0x331df0){return db[_0xa55d('0x2c')][_0xa55d('0x45')]({'where':{'id':_0x9fa6e8['params']['id']}})[_0xa55d('0x22')](handleEntityNotFound(_0x331df0,null))['then'](removeEntity(_0x331df0,null))[_0xa55d('0x3f')](handleError(_0x331df0,null));};exports['run']=function(_0x2783be,_0x261a8e,_0x3897ec){var _0x51074b=require('../../config/schedule');return db[_0xa55d('0x2c')][_0xa55d('0x45')]({'where':{'id':_0x2783be[_0xa55d('0x40')]['id']},'raw':!![]})['then'](handleEntityNotFound(_0x261a8e,null))[_0xa55d('0x22')](function(){_0x51074b[_0xa55d('0x50')](_0x2783be[_0xa55d('0x40')]['id']);})['then'](respondWithStatusCode(_0x261a8e,null))[_0xa55d('0x3f')](handleError(_0x261a8e,null));};
\ No newline at end of file
+var _0x615e=['end','json','count','offset','limit','set','reject','save','then','destroy','get','Scheduler','UserProfileResource','error','stack','name','send','index','map','Schedule','rawAttributes','fieldName','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','type','VIRTUAL','merge','options','includeAll','include','findAll','show','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','catch','update','run','../../config/schedule','html-pdf','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','path','to-csv','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status'];(function(_0x21b542,_0x5ba26e){var _0x4b28eb=function(_0x242d03){while(--_0x242d03){_0x21b542['push'](_0x21b542['shift']());}};_0x4b28eb(++_0x5ba26e);}(_0x615e,0x17c));var _0xe615=function(_0x404010,_0x1254b9){_0x404010=_0x404010-0x0;var _0xde2e59=_0x615e[_0x404010];return _0xde2e59;};'use strict';var pdf=require(_0xe615('0x0'));var emlformat=require(_0xe615('0x1'));var rimraf=require(_0xe615('0x2'));var zipdir=require(_0xe615('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe615('0x4'));var moment=require('moment');var BPromise=require(_0xe615('0x5'));var Mustache=require(_0xe615('0x6'));var util=require('util');var path=require(_0xe615('0x7'));var sox=require('sox');var csv=require(_0xe615('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xe615('0x9'));var squel=require(_0xe615('0xa'));var crypto=require(_0xe615('0xb'));var jsforce=require(_0xe615('0xc'));var deskjs=require(_0xe615('0xd'));var toCsv=require(_0xe615('0x8'));var querystring=require('querystring');var Papa=require(_0xe615('0xe'));var Redis=require('ioredis');var authService=require(_0xe615('0xf'));var qs=require(_0xe615('0x10'));var as=require(_0xe615('0x11'));var hardwareService=require(_0xe615('0x12'));var logger=require(_0xe615('0x13'))(_0xe615('0x14'));var utils=require(_0xe615('0x15'));var config=require(_0xe615('0x16'));var db=require(_0xe615('0x17'))['db'];function respondWithStatusCode(_0x52566d,_0x5c7dc1){_0x5c7dc1=_0x5c7dc1||0xcc;return function(_0xc1b617){if(_0xc1b617){return _0x52566d['sendStatus'](_0x5c7dc1);}return _0x52566d[_0xe615('0x18')](_0x5c7dc1)[_0xe615('0x19')]();};}function respondWithResult(_0x75f622,_0x28b0b0){_0x28b0b0=_0x28b0b0||0xc8;return function(_0x31e91b){if(_0x31e91b){return _0x75f622[_0xe615('0x18')](_0x28b0b0)[_0xe615('0x1a')](_0x31e91b);}};}function respondWithFilteredResult(_0x1eab41,_0x4b6767){return function(_0x3b32bd){if(_0x3b32bd){var _0x39f7ee=_0x3b32bd[_0xe615('0x1b')],_0x35523a=_0x4b6767[_0xe615('0x1c')],_0x2e287a=_0x4b6767['offset']+_0x4b6767[_0xe615('0x1d')],_0x50fc10;if(_0x2e287a>=_0x39f7ee){_0x2e287a=_0x39f7ee;_0x50fc10=0xc8;}else{_0x50fc10=0xce;}_0x1eab41[_0xe615('0x18')](_0x50fc10);return _0x1eab41[_0xe615('0x1e')]('Content-Range',_0x35523a+'-'+_0x2e287a+'/'+_0x39f7ee)[_0xe615('0x1a')](_0x3b32bd);}return null;};}function patchUpdates(_0x3a631f){return function(_0x335af7){try{jsonpatch['apply'](_0x335af7,_0x3a631f,!![]);}catch(_0x3d815c){return BPromise[_0xe615('0x1f')](_0x3d815c);}return _0x335af7[_0xe615('0x20')]();};}function saveUpdates(_0x4704d0,_0x11d67c){return function(_0xa084ce){if(_0xa084ce){return _0xa084ce['update'](_0x4704d0)[_0xe615('0x21')](function(_0x58be51){return _0x58be51;});}return null;};}function removeEntity(_0x96b880,_0xf683ed){return function(_0x5b985c){if(_0x5b985c){return _0x5b985c[_0xe615('0x22')]()['then'](function(){var _0x53b465=_0x5b985c[_0xe615('0x23')]({'plain':!![]});var _0x4896c3=_0xe615('0x24');return db[_0xe615('0x25')]['destroy']({'where':{'type':_0x4896c3,'resourceId':_0x53b465['id']}})[_0xe615('0x21')](function(){return _0x5b985c;});})[_0xe615('0x21')](function(){_0x96b880[_0xe615('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39e95a,_0x3ea132){return function(_0x33d894){if(!_0x33d894){_0x39e95a['sendStatus'](0x194);}return _0x33d894;};}function handleError(_0x137d87,_0x1e4388){_0x1e4388=_0x1e4388||0x1f4;return function(_0x1eb25b){logger[_0xe615('0x26')](_0x1eb25b[_0xe615('0x27')]);if(_0x1eb25b['name']){delete _0x1eb25b[_0xe615('0x28')];}_0x137d87[_0xe615('0x18')](_0x1e4388)[_0xe615('0x29')](_0x1eb25b);};}exports[_0xe615('0x2a')]=function(_0x66a1c1,_0x1d10e1){var _0x51fc54={},_0x3a256f={},_0x6ee3d1={'count':0x0,'rows':[]};var _0x14c2ad=_[_0xe615('0x2b')](db[_0xe615('0x2c')][_0xe615('0x2d')],function(_0x472a81){return{'name':_0x472a81[_0xe615('0x2e')],'type':_0x472a81['type'][_0xe615('0x2f')]};});_0x3a256f[_0xe615('0x30')]=_[_0xe615('0x2b')](_0x14c2ad,_0xe615('0x28'));_0x3a256f[_0xe615('0x31')]=_[_0xe615('0x32')](_0x66a1c1[_0xe615('0x31')]);_0x3a256f[_0xe615('0x33')]=_['intersection'](_0x3a256f['model'],_0x3a256f[_0xe615('0x31')]);_0x51fc54[_0xe615('0x34')]=_[_0xe615('0x35')](_0x3a256f[_0xe615('0x30')],qs[_0xe615('0x36')](_0x66a1c1[_0xe615('0x31')][_0xe615('0x36')]));_0x51fc54[_0xe615('0x34')]=_0x51fc54['attributes'][_0xe615('0x37')]?_0x51fc54[_0xe615('0x34')]:_0x3a256f[_0xe615('0x30')];if(!_0x66a1c1[_0xe615('0x31')][_0xe615('0x38')]('nolimit')){_0x51fc54[_0xe615('0x1d')]=qs['limit'](_0x66a1c1['query'][_0xe615('0x1d')]);_0x51fc54[_0xe615('0x1c')]=qs[_0xe615('0x1c')](_0x66a1c1[_0xe615('0x31')][_0xe615('0x1c')]);}_0x51fc54[_0xe615('0x39')]=qs[_0xe615('0x3a')](_0x66a1c1[_0xe615('0x31')][_0xe615('0x3a')]);_0x51fc54[_0xe615('0x3b')]=qs[_0xe615('0x33')](_['pick'](_0x66a1c1[_0xe615('0x31')],_0x3a256f['filters']),_0x14c2ad);if(_0x66a1c1[_0xe615('0x31')]['filter']){_0x51fc54[_0xe615('0x3b')]=_['merge'](_0x51fc54[_0xe615('0x3b')],{'$or':_[_0xe615('0x2b')](_0x14c2ad,function(_0x3a74fe){if(_0x3a74fe[_0xe615('0x3c')]!==_0xe615('0x3d')){var _0x5a0c8a={};_0x5a0c8a[_0x3a74fe[_0xe615('0x28')]]={'$like':'%'+_0x66a1c1[_0xe615('0x31')]['filter']+'%'};return _0x5a0c8a;}})});}_0x51fc54=_[_0xe615('0x3e')]({},_0x51fc54,_0x66a1c1[_0xe615('0x3f')]);var _0x4f66f5={'where':_0x51fc54[_0xe615('0x3b')]};return db[_0xe615('0x2c')]['count'](_0x4f66f5)[_0xe615('0x21')](function(_0x21c137){_0x6ee3d1[_0xe615('0x1b')]=_0x21c137;if(_0x66a1c1[_0xe615('0x31')][_0xe615('0x40')]){_0x51fc54[_0xe615('0x41')]=[{'all':!![]}];}return db[_0xe615('0x2c')][_0xe615('0x42')](_0x51fc54);})['then'](function(_0x3e2788){_0x6ee3d1['rows']=_0x3e2788;return _0x6ee3d1;})[_0xe615('0x21')](respondWithFilteredResult(_0x1d10e1,_0x51fc54))['catch'](handleError(_0x1d10e1,null));};exports[_0xe615('0x43')]=function(_0x47772f,_0x57af39){var _0x1a06a2={'raw':![],'where':{'id':_0x47772f[_0xe615('0x44')]['id']}},_0x246e41={};_0x246e41[_0xe615('0x30')]=_[_0xe615('0x32')](db[_0xe615('0x2c')][_0xe615('0x2d')]);_0x246e41['query']=_[_0xe615('0x32')](_0x47772f['query']);_0x246e41['filters']=_[_0xe615('0x35')](_0x246e41[_0xe615('0x30')],_0x246e41[_0xe615('0x31')]);_0x1a06a2[_0xe615('0x34')]=_[_0xe615('0x35')](_0x246e41['model'],qs[_0xe615('0x36')](_0x47772f['query'][_0xe615('0x36')]));_0x1a06a2[_0xe615('0x34')]=_0x1a06a2[_0xe615('0x34')][_0xe615('0x37')]?_0x1a06a2['attributes']:_0x246e41[_0xe615('0x30')];if(_0x47772f[_0xe615('0x31')][_0xe615('0x40')]){_0x1a06a2[_0xe615('0x41')]=[{'all':!![]}];}_0x1a06a2=_['merge']({},_0x1a06a2,_0x47772f['options']);return db[_0xe615('0x2c')][_0xe615('0x45')](_0x1a06a2)[_0xe615('0x21')](handleEntityNotFound(_0x57af39,null))['then'](respondWithResult(_0x57af39,null))['catch'](handleError(_0x57af39,null));};exports[_0xe615('0x46')]=function(_0x70ce23,_0x2676dd){return db[_0xe615('0x2c')][_0xe615('0x46')](_0x70ce23[_0xe615('0x47')],{})[_0xe615('0x21')](function(_0x57de2e){var _0x340b35=_0x70ce23[_0xe615('0x48')]['get']({'plain':!![]});if(!_0x340b35)throw new Error(_0xe615('0x49'));if(_0x340b35[_0xe615('0x4a')]===_0xe615('0x48')){var _0x39b51f=_0x57de2e[_0xe615('0x23')]({'plain':!![]});var _0x2f7c14=_0xe615('0x24');return db['UserProfileSection'][_0xe615('0x45')]({'where':{'name':_0x2f7c14,'userProfileId':_0x340b35[_0xe615('0x4b')]},'raw':!![]})['then'](function(_0xd22c14){if(_0xd22c14&&_0xd22c14[_0xe615('0x4c')]===0x0){return db[_0xe615('0x25')][_0xe615('0x46')]({'name':_0x39b51f['name'],'resourceId':_0x39b51f['id'],'type':_0xd22c14['name'],'sectionId':_0xd22c14['id']},{})[_0xe615('0x21')](function(){return _0x57de2e;});}else{return _0x57de2e;}})[_0xe615('0x4d')](function(_0x208f95){logger[_0xe615('0x26')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x208f95);throw _0x208f95;});}return _0x57de2e;})[_0xe615('0x21')](respondWithResult(_0x2676dd,0xc9))[_0xe615('0x4d')](handleError(_0x2676dd,null));};exports[_0xe615('0x4e')]=function(_0x2dcf21,_0x33446a){if(_0x2dcf21[_0xe615('0x47')]['id']){delete _0x2dcf21[_0xe615('0x47')]['id'];}return db[_0xe615('0x2c')][_0xe615('0x45')]({'where':{'id':_0x2dcf21[_0xe615('0x44')]['id']}})[_0xe615('0x21')](handleEntityNotFound(_0x33446a,null))[_0xe615('0x21')](saveUpdates(_0x2dcf21['body'],null))[_0xe615('0x21')](respondWithResult(_0x33446a,null))[_0xe615('0x4d')](handleError(_0x33446a,null));};exports[_0xe615('0x22')]=function(_0x3c7fd2,_0xa7d37f){return db[_0xe615('0x2c')][_0xe615('0x45')]({'where':{'id':_0x3c7fd2[_0xe615('0x44')]['id']}})[_0xe615('0x21')](handleEntityNotFound(_0xa7d37f,null))[_0xe615('0x21')](removeEntity(_0xa7d37f,null))[_0xe615('0x4d')](handleError(_0xa7d37f,null));};exports[_0xe615('0x4f')]=function(_0x243ddc,_0x22666c,_0x82af1e){var _0x5dfeed=require(_0xe615('0x50'));return db['Schedule'][_0xe615('0x45')]({'where':{'id':_0x243ddc['params']['id']},'raw':!![]})['then'](handleEntityNotFound(_0x22666c,null))[_0xe615('0x21')](function(){_0x5dfeed['run'](_0x243ddc[_0xe615('0x44')]['id']);})['then'](respondWithStatusCode(_0x22666c,null))['catch'](handleError(_0x22666c,null));};
\ No newline at end of file
diff --git a/server/api/schedule/schedule.model.js b/server/api/schedule/schedule.model.js
index 7ec3982..2b69ddf 100644
--- a/server/api/schedule/schedule.model.js
+++ b/server/api/schedule/schedule.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7e6a=['tools_schedules','util','api','bluebird','path','rimraf','./schedule.attributes','Schedule'];(function(_0x53f46d,_0x418b02){var _0x441fe8=function(_0xe5ae50){while(--_0xe5ae50){_0x53f46d['push'](_0x53f46d['shift']());}};_0x441fe8(++_0x418b02);}(_0x7e6a,0x89));var _0xa7e6=function(_0x39f03b,_0x368ae5){_0x39f03b=_0x39f03b-0x0;var _0xe7fa36=_0x7e6a[_0x39f03b];return _0xe7fa36;};'use strict';var _=require('lodash');var util=require(_0xa7e6('0x0'));var logger=require('../../config/logger')(_0xa7e6('0x1'));var moment=require('moment');var BPromise=require(_0xa7e6('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa7e6('0x3'));var rimraf=require(_0xa7e6('0x4'));var config=require('../../config/environment');var attributes=require(_0xa7e6('0x5'));module['exports']=function(_0x4da55c,_0x1aee56){return _0x4da55c['define'](_0xa7e6('0x6'),attributes,{'tableName':_0xa7e6('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xa57f=['../../config/logger','api','request-promise','path','rimraf','../../config/environment','exports','define','Schedule','util'];(function(_0x618414,_0x1a7a60){var _0x21c19a=function(_0x507b17){while(--_0x507b17){_0x618414['push'](_0x618414['shift']());}};_0x21c19a(++_0x1a7a60);}(_0xa57f,0x77));var _0xfa57=function(_0x406b1,_0xe08dc5){_0x406b1=_0x406b1-0x0;var _0x474b1e=_0xa57f[_0x406b1];return _0x474b1e;};'use strict';var _=require('lodash');var util=require(_0xfa57('0x0'));var logger=require(_0xfa57('0x1'))(_0xfa57('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xfa57('0x3'));var fs=require('fs');var path=require(_0xfa57('0x4'));var rimraf=require(_0xfa57('0x5'));var config=require(_0xfa57('0x6'));var attributes=require('./schedule.attributes');module[_0xfa57('0x7')]=function(_0x54699d,_0x2ea796){return _0x54699d[_0xfa57('0x8')](_0xfa57('0x9'),attributes,{'tableName':'tools_schedules','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/schedule/schedule.rpc.js b/server/api/schedule/schedule.rpc.js
index 25dc655..ee10884 100644
--- a/server/api/schedule/schedule.rpc.js
+++ b/server/api/schedule/schedule.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xb4bd=['request','then','info','debug','Schedule,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','code','error','Schedule,\x20%s,\x20%s','message','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0xb4bd,0xbb));var _0xdb4b=function(_0x59d89e,_0x55edf5){_0x59d89e=_0x59d89e-0x0;var _0x554e93=_0xb4bd[_0x59d89e];return _0x554e93;};'use strict';var _=require('lodash');var util=require(_0xdb4b('0x0'));var moment=require(_0xdb4b('0x1'));var BPromise=require(_0xdb4b('0x2'));var rs=require(_0xdb4b('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xdb4b('0x4'))['db'];var utils=require(_0xdb4b('0x5'));var logger=require(_0xdb4b('0x6'))(_0xdb4b('0x7'));var config=require(_0xdb4b('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xdb4b('0x9')][_0xdb4b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x537f40,_0x3db67e,_0x25848b){return new BPromise(function(_0x57ef94,_0x4c3c77){return client[_0xdb4b('0xb')](_0x537f40,_0x25848b)[_0xdb4b('0xc')](function(_0x2b624d){logger[_0xdb4b('0xd')]('Schedule,\x20%s,\x20%s',_0x3db67e,'request\x20sent');logger[_0xdb4b('0xe')](_0xdb4b('0xf'),_0x3db67e,_0xdb4b('0x10'),JSON[_0xdb4b('0x11')](_0x2b624d));if(_0x2b624d['error']){if(_0x2b624d['error'][_0xdb4b('0x12')]===0x1f4){logger[_0xdb4b('0x13')](_0xdb4b('0x14'),_0x3db67e,_0x2b624d[_0xdb4b('0x13')]['message']);return _0x4c3c77(_0x2b624d[_0xdb4b('0x13')][_0xdb4b('0x15')]);}logger[_0xdb4b('0x13')](_0xdb4b('0x14'),_0x3db67e,_0x2b624d['error'][_0xdb4b('0x15')]);return _0x57ef94(_0x2b624d['error'][_0xdb4b('0x15')]);}else{logger[_0xdb4b('0xd')](_0xdb4b('0x14'),_0x3db67e,'request\x20sent');_0x57ef94(_0x2b624d['result'][_0xdb4b('0x15')]);}})['catch'](function(_0x429a35){logger[_0xdb4b('0x13')](_0xdb4b('0x14'),_0x3db67e,_0x429a35);_0x4c3c77(_0x429a35);});});}
\ No newline at end of file
+var _0xe517=['rpc','jayson/promise','client','http','request','then','info','Schedule,\x20%s,\x20%s','request\x20sent','debug','Schedule,\x20%s,\x20%s,\x20%s','stringify','error','code','message','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils'];(function(_0x4fd6fb,_0x5854c7){var _0x21c0c6=function(_0x318d0b){while(--_0x318d0b){_0x4fd6fb['push'](_0x4fd6fb['shift']());}};_0x21c0c6(++_0x5854c7);}(_0xe517,0x7d));var _0x7e51=function(_0x1b69b6,_0x9eb4ee){_0x1b69b6=_0x1b69b6-0x0;var _0x4aaf36=_0xe517[_0x1b69b6];return _0x4aaf36;};'use strict';var _=require(_0x7e51('0x0'));var util=require(_0x7e51('0x1'));var moment=require(_0x7e51('0x2'));var BPromise=require(_0x7e51('0x3'));var rs=require(_0x7e51('0x4'));var fs=require('fs');var Redis=require(_0x7e51('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x7e51('0x6'));var logger=require('../../config/logger')(_0x7e51('0x7'));var config=require('../../config/environment');var jayson=require(_0x7e51('0x8'));var client=jayson[_0x7e51('0x9')][_0x7e51('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5732a2,_0x40a8d8,_0x154581){return new BPromise(function(_0x324126,_0x575d02){return client[_0x7e51('0xb')](_0x5732a2,_0x154581)[_0x7e51('0xc')](function(_0x3fafff){logger[_0x7e51('0xd')](_0x7e51('0xe'),_0x40a8d8,_0x7e51('0xf'));logger[_0x7e51('0x10')](_0x7e51('0x11'),_0x40a8d8,'request\x20sent',JSON[_0x7e51('0x12')](_0x3fafff));if(_0x3fafff[_0x7e51('0x13')]){if(_0x3fafff[_0x7e51('0x13')][_0x7e51('0x14')]===0x1f4){logger['error'](_0x7e51('0xe'),_0x40a8d8,_0x3fafff[_0x7e51('0x13')][_0x7e51('0x15')]);return _0x575d02(_0x3fafff[_0x7e51('0x13')][_0x7e51('0x15')]);}logger['error'](_0x7e51('0xe'),_0x40a8d8,_0x3fafff[_0x7e51('0x13')][_0x7e51('0x15')]);return _0x324126(_0x3fafff[_0x7e51('0x13')][_0x7e51('0x15')]);}else{logger['info'](_0x7e51('0xe'),_0x40a8d8,_0x7e51('0xf'));_0x324126(_0x3fafff['result'][_0x7e51('0x15')]);}})['catch'](function(_0x23f0ea){logger[_0x7e51('0x13')](_0x7e51('0xe'),_0x40a8d8,_0x23f0ea);_0x575d02(_0x23f0ea);});});}
\ No newline at end of file
diff --git a/server/api/screenRecording/index.js b/server/api/screenRecording/index.js
index 0398964..5e1cad1 100644
--- a/server/api/screenRecording/index.js
+++ b/server/api/screenRecording/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x4fad=['/:id/download','download','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./screenRecording.controller','isAuthenticated','get','/describe','describe','/:id','show'];(function(_0x5e6e8d,_0x37e707){var _0x36d4ce=function(_0x4060b2){while(--_0x4060b2){_0x5e6e8d['push'](_0x5e6e8d['shift']());}};_0x36d4ce(++_0x37e707);}(_0x4fad,0x1e9));var _0xd4fa=function(_0x48ccf7,_0x2c95b6){_0x48ccf7=_0x48ccf7-0x0;var _0x31601c=_0x4fad[_0x48ccf7];return _0x31601c;};'use strict';var multer=require(_0xd4fa('0x0'));var util=require(_0xd4fa('0x1'));var path=require(_0xd4fa('0x2'));var timeout=require(_0xd4fa('0x3'));var express=require(_0xd4fa('0x4'));var router=express[_0xd4fa('0x5')]();var auth=require(_0xd4fa('0x6'));var interaction=require(_0xd4fa('0x7'));var config=require('../../config/environment');var controller=require(_0xd4fa('0x8'));router['get']('/',auth[_0xd4fa('0x9')](),controller['index']);router[_0xd4fa('0xa')](_0xd4fa('0xb'),auth[_0xd4fa('0x9')](),controller[_0xd4fa('0xc')]);router[_0xd4fa('0xa')](_0xd4fa('0xd'),auth[_0xd4fa('0x9')](),controller[_0xd4fa('0xe')]);router[_0xd4fa('0xa')](_0xd4fa('0xf'),auth[_0xd4fa('0x9')](),controller[_0xd4fa('0x10')]);router[_0xd4fa('0x11')]('/',auth[_0xd4fa('0x9')](),controller[_0xd4fa('0x12')]);router[_0xd4fa('0x13')](_0xd4fa('0xd'),auth[_0xd4fa('0x9')](),controller[_0xd4fa('0x14')]);router[_0xd4fa('0x15')](_0xd4fa('0xd'),auth[_0xd4fa('0x9')](),controller[_0xd4fa('0x16')]);module[_0xd4fa('0x17')]=router;
\ No newline at end of file
+var _0x76dd=['/describe','describe','show','/:id/download','download','post','create','put','update','delete','/:id','destroy','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index'];(function(_0x134eb1,_0x30f846){var _0xb46c09=function(_0x225ce1){while(--_0x225ce1){_0x134eb1['push'](_0x134eb1['shift']());}};_0xb46c09(++_0x30f846);}(_0x76dd,0x1d8));var _0xd76d=function(_0xf7cc65,_0x2389c8){_0xf7cc65=_0xf7cc65-0x0;var _0x5d4720=_0x76dd[_0xf7cc65];return _0x5d4720;};'use strict';var multer=require(_0xd76d('0x0'));var util=require(_0xd76d('0x1'));var path=require('path');var timeout=require(_0xd76d('0x2'));var express=require(_0xd76d('0x3'));var router=express[_0xd76d('0x4')]();var auth=require(_0xd76d('0x5'));var interaction=require(_0xd76d('0x6'));var config=require(_0xd76d('0x7'));var controller=require('./screenRecording.controller');router[_0xd76d('0x8')]('/',auth[_0xd76d('0x9')](),controller[_0xd76d('0xa')]);router[_0xd76d('0x8')](_0xd76d('0xb'),auth[_0xd76d('0x9')](),controller[_0xd76d('0xc')]);router[_0xd76d('0x8')]('/:id',auth['isAuthenticated'](),controller[_0xd76d('0xd')]);router['get'](_0xd76d('0xe'),auth[_0xd76d('0x9')](),controller[_0xd76d('0xf')]);router[_0xd76d('0x10')]('/',auth[_0xd76d('0x9')](),controller[_0xd76d('0x11')]);router[_0xd76d('0x12')]('/:id',auth['isAuthenticated'](),controller[_0xd76d('0x13')]);router[_0xd76d('0x14')](_0xd76d('0x15'),auth[_0xd76d('0x9')](),controller[_0xd76d('0x16')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/screenRecording/screenRecording.attributes.js b/server/api/screenRecording/screenRecording.attributes.js
index 7e3832a..afed406 100644
--- a/server/api/screenRecording/screenRecording.attributes.js
+++ b/server/api/screenRecording/screenRecording.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9a19=['VIRTUAL','getDataValue','value','extname','STRING','INTEGER','setDataValue','startedAt','subtract','closedAt','duration','DATE','format','MM-DD-YYYY\x20HH:mm','toString','updatedAt','sequelize','moment','path','exports'];(function(_0x3f2ecf,_0x4ccad6){var _0xa6dd7e=function(_0x5e04c3){while(--_0x5e04c3){_0x3f2ecf['push'](_0x3f2ecf['shift']());}};_0xa6dd7e(++_0x4ccad6);}(_0x9a19,0x114));var _0x99a1=function(_0xdd2bfa,_0x5bd304){_0xdd2bfa=_0xdd2bfa-0x0;var _0x55397e=_0x9a19[_0xdd2bfa];return _0x55397e;};'use strict';var Sequelize=require(_0x99a1('0x0'));var moment=require(_0x99a1('0x1'));var path=require(_0x99a1('0x2'));var config=require('../../config/environment');module[_0x99a1('0x3')]={'format':{'type':Sequelize[_0x99a1('0x4')],'get':function(){return this[_0x99a1('0x5')](_0x99a1('0x6'))?path[_0x99a1('0x7')](this[_0x99a1('0x5')](_0x99a1('0x6'))):undefined;}},'interactionid':{'type':Sequelize[_0x99a1('0x8')]},'channel':{'type':Sequelize[_0x99a1('0x8')]},'value':{'type':Sequelize[_0x99a1('0x8')],'set':function(_0x65045d){var _0x523b9e=_0x65045d['replace'](/\\/g,'/');this['setDataValue'](_0x99a1('0x6'),_0x523b9e);}},'rating':{'type':Sequelize[_0x99a1('0x9')],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize['INTEGER'],'set':function(_0x5874fc){this[_0x99a1('0xa')](_0x99a1('0xb'),moment()[_0x99a1('0xc')](_0x5874fc,'ms'));this[_0x99a1('0xa')](_0x99a1('0xd'),moment());this['setDataValue'](_0x99a1('0xe'),_0x5874fc);}},'startedAt':{'type':Sequelize[_0x99a1('0xf')],'get':function(){return moment(this[_0x99a1('0x5')](_0x99a1('0xb')))[_0x99a1('0x10')](_0x99a1('0x11'))[_0x99a1('0x12')]();}},'closedAt':{'type':Sequelize[_0x99a1('0xf')],'get':function(){return moment(this[_0x99a1('0x5')](_0x99a1('0xd')))[_0x99a1('0x10')](_0x99a1('0x11'))[_0x99a1('0x12')]();}},'createdAt':{'type':Sequelize[_0x99a1('0xf')],'get':function(){return moment(this[_0x99a1('0x5')]('createdAt'))[_0x99a1('0x10')](_0x99a1('0x11'))[_0x99a1('0x12')]();}},'updatedAt':{'type':Sequelize[_0x99a1('0xf')],'get':function(){return moment(this[_0x99a1('0x5')](_0x99a1('0x13')))[_0x99a1('0x10')]('MM-DD-YYYY\x20HH:mm')['toString']();}}};
\ No newline at end of file
+var _0x4c4e=['../../config/environment','exports','getDataValue','value','extname','STRING','replace','setDataValue','INTEGER','startedAt','subtract','closedAt','DATE','format','toString','createdAt','MM-DD-YYYY\x20HH:mm','updatedAt','sequelize','path'];(function(_0x3593b7,_0x120d93){var _0x372547=function(_0x5ef0a1){while(--_0x5ef0a1){_0x3593b7['push'](_0x3593b7['shift']());}};_0x372547(++_0x120d93);}(_0x4c4e,0x152));var _0xe4c4=function(_0x4a6784,_0x45fcfc){_0x4a6784=_0x4a6784-0x0;var _0xd3c225=_0x4c4e[_0x4a6784];return _0xd3c225;};'use strict';var Sequelize=require(_0xe4c4('0x0'));var moment=require('moment');var path=require(_0xe4c4('0x1'));var config=require(_0xe4c4('0x2'));module[_0xe4c4('0x3')]={'format':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0xe4c4('0x4')](_0xe4c4('0x5'))?path[_0xe4c4('0x6')](this['getDataValue'](_0xe4c4('0x5'))):undefined;}},'interactionid':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0xe4c4('0x7')]},'value':{'type':Sequelize[_0xe4c4('0x7')],'set':function(_0x262b64){var _0xad105=_0x262b64[_0xe4c4('0x8')](/\\/g,'/');this[_0xe4c4('0x9')](_0xe4c4('0x5'),_0xad105);}},'rating':{'type':Sequelize[_0xe4c4('0xa')],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize['INTEGER'],'set':function(_0x589b2e){this[_0xe4c4('0x9')](_0xe4c4('0xb'),moment()[_0xe4c4('0xc')](_0x589b2e,'ms'));this[_0xe4c4('0x9')](_0xe4c4('0xd'),moment());this[_0xe4c4('0x9')]('duration',_0x589b2e);}},'startedAt':{'type':Sequelize[_0xe4c4('0xe')],'get':function(){return moment(this[_0xe4c4('0x4')](_0xe4c4('0xb')))[_0xe4c4('0xf')]('MM-DD-YYYY\x20HH:mm')[_0xe4c4('0x10')]();}},'closedAt':{'type':Sequelize[_0xe4c4('0xe')],'get':function(){return moment(this['getDataValue'](_0xe4c4('0xd')))[_0xe4c4('0xf')]('MM-DD-YYYY\x20HH:mm')[_0xe4c4('0x10')]();}},'createdAt':{'type':Sequelize[_0xe4c4('0xe')],'get':function(){return moment(this['getDataValue'](_0xe4c4('0x11')))[_0xe4c4('0xf')](_0xe4c4('0x12'))[_0xe4c4('0x10')]();}},'updatedAt':{'type':Sequelize[_0xe4c4('0xe')],'get':function(){return moment(this[_0xe4c4('0x4')](_0xe4c4('0x13')))[_0xe4c4('0xf')](_0xe4c4('0x12'))[_0xe4c4('0x10')]();}}};
\ No newline at end of file
diff --git a/server/api/screenRecording/screenRecording.controller.js b/server/api/screenRecording/screenRecording.controller.js
index 442fa7e..1827bb6 100644
--- a/server/api/screenRecording/screenRecording.controller.js
+++ b/server/api/screenRecording/screenRecording.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7b83=['reject','save','update','then','destroy','error','name','index','map','ScreenRecording','rawAttributes','fieldName','type','key','model','format','query','keys','attributes','fields','hasOwnProperty','nolimit','limit','sort','filters','where','merge','VIRTUAL','include','findAll','rows','catch','params','intersection','length','includeAll','options','find','create','body','duration','value','describe','download','../../components/encryptor','uniqueid','root','server/files/screen_recordings','%s.cypher','decryptFile','secrets','join','existsSync','ValidationError','ScreenRecording\x20not\x20found','filename','extname','unlink','message','send','Not\x20found','isNil','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','info','html-pdf','eml-format','rimraf','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','sendStatus','status','end','json','count','offset','apply'];(function(_0x122cc1,_0x5c956e){var _0x1e33af=function(_0x949b75){while(--_0x949b75){_0x122cc1['push'](_0x122cc1['shift']());}};_0x1e33af(++_0x5c956e);}(_0x7b83,0xa1));var _0x37b8=function(_0x55625c,_0x134b4f){_0x55625c=_0x55625c-0x0;var _0x4436f4=_0x7b83[_0x55625c];return _0x4436f4;};'use strict';var pdf=require(_0x37b8('0x0'));var emlformat=require(_0x37b8('0x1'));var rimraf=require(_0x37b8('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x37b8('0x3'));var moment=require(_0x37b8('0x4'));var BPromise=require(_0x37b8('0x5'));var Mustache=require('mustache');var util=require(_0x37b8('0x6'));var path=require(_0x37b8('0x7'));var sox=require(_0x37b8('0x8'));var csv=require(_0x37b8('0x9'));var ejs=require(_0x37b8('0xa'));var fs=require('fs');var _=require(_0x37b8('0xb'));var squel=require('squel');var crypto=require(_0x37b8('0xc'));var jsforce=require(_0x37b8('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x37b8('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x37b8('0xe'));var as=require(_0x37b8('0xf'));var hardwareService=require(_0x37b8('0x10'));var logger=require(_0x37b8('0x11'))(_0x37b8('0x12'));var utils=require('../../config/utils');var config=require(_0x37b8('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xb2c6ff,_0x4ee19c){_0x4ee19c=_0x4ee19c||0xcc;return function(_0x2c9dba){if(_0x2c9dba){return _0xb2c6ff[_0x37b8('0x14')](_0x4ee19c);}return _0xb2c6ff[_0x37b8('0x15')](_0x4ee19c)[_0x37b8('0x16')]();};}function respondWithResult(_0x3dc8c5,_0x5bac2a){_0x5bac2a=_0x5bac2a||0xc8;return function(_0x5745be){if(_0x5745be){return _0x3dc8c5[_0x37b8('0x15')](_0x5bac2a)[_0x37b8('0x17')](_0x5745be);}};}function respondWithFilteredResult(_0x915af8,_0x4ab58e){return function(_0x48cfae){if(_0x48cfae){var _0x39b791=_0x48cfae[_0x37b8('0x18')],_0x29b875=_0x4ab58e[_0x37b8('0x19')],_0xd017bd=_0x4ab58e[_0x37b8('0x19')]+_0x4ab58e['limit'],_0x1fd6e6;if(_0xd017bd>=_0x39b791){_0xd017bd=_0x39b791;_0x1fd6e6=0xc8;}else{_0x1fd6e6=0xce;}_0x915af8[_0x37b8('0x15')](_0x1fd6e6);return _0x915af8['set']('Content-Range',_0x29b875+'-'+_0xd017bd+'/'+_0x39b791)[_0x37b8('0x17')](_0x48cfae);}return null;};}function patchUpdates(_0x36367a){return function(_0x39a1c8){try{jsonpatch[_0x37b8('0x1a')](_0x39a1c8,_0x36367a,!![]);}catch(_0x5dbdee){return BPromise[_0x37b8('0x1b')](_0x5dbdee);}return _0x39a1c8[_0x37b8('0x1c')]();};}function saveUpdates(_0x273de4,_0x655575){return function(_0x497623){if(_0x497623){return _0x497623[_0x37b8('0x1d')](_0x273de4)[_0x37b8('0x1e')](function(_0x307195){return _0x307195;});}return null;};}function removeEntity(_0x30ff05,_0x5aa644){return function(_0x10cdf9){if(_0x10cdf9){return _0x10cdf9[_0x37b8('0x1f')]()[_0x37b8('0x1e')](function(){_0x30ff05[_0x37b8('0x15')](0xcc)[_0x37b8('0x16')]();});}};}function handleEntityNotFound(_0x3579da,_0x275c77){return function(_0x4a1044){if(!_0x4a1044){_0x3579da[_0x37b8('0x14')](0x194);}return _0x4a1044;};}function handleError(_0x203bd3,_0x3bfd8d){_0x3bfd8d=_0x3bfd8d||0x1f4;return function(_0x36bb7c){logger[_0x37b8('0x20')](_0x36bb7c['stack']);if(_0x36bb7c['name']){delete _0x36bb7c[_0x37b8('0x21')];}_0x203bd3[_0x37b8('0x15')](_0x3bfd8d)['send'](_0x36bb7c);};}exports[_0x37b8('0x22')]=function(_0x5a988a,_0x14d814){var _0x141d3a={},_0x1adad0={},_0x139435={'count':0x0,'rows':[]};var _0x4d0438=_[_0x37b8('0x23')](db[_0x37b8('0x24')][_0x37b8('0x25')],function(_0x33eea4){return{'name':_0x33eea4[_0x37b8('0x26')],'type':_0x33eea4[_0x37b8('0x27')][_0x37b8('0x28')]};});_0x1adad0[_0x37b8('0x29')]=_['differenceBy'](_[_0x37b8('0x23')](_0x4d0438,'name'),[_0x37b8('0x2a')]);_0x1adad0[_0x37b8('0x2b')]=_[_0x37b8('0x2c')](_0x5a988a['query']);_0x1adad0['filters']=_['intersection'](_0x1adad0['model'],_0x1adad0['query']);_0x141d3a[_0x37b8('0x2d')]=_['intersection'](_0x1adad0[_0x37b8('0x29')],qs['fields'](_0x5a988a[_0x37b8('0x2b')][_0x37b8('0x2e')]));_0x141d3a['attributes']=_0x141d3a[_0x37b8('0x2d')]['length']?_0x141d3a[_0x37b8('0x2d')]:_0x1adad0[_0x37b8('0x29')];if(!_0x5a988a['query'][_0x37b8('0x2f')](_0x37b8('0x30'))){_0x141d3a[_0x37b8('0x31')]=qs[_0x37b8('0x31')](_0x5a988a['query'][_0x37b8('0x31')]);_0x141d3a[_0x37b8('0x19')]=qs['offset'](_0x5a988a[_0x37b8('0x2b')][_0x37b8('0x19')]);}_0x141d3a['order']=qs['sort'](_0x5a988a[_0x37b8('0x2b')][_0x37b8('0x32')]);_0x141d3a['where']=qs[_0x37b8('0x33')](_['pick'](_0x5a988a[_0x37b8('0x2b')],_0x1adad0['filters']),_0x4d0438);if(_0x5a988a['query']['filter']){_0x141d3a[_0x37b8('0x34')]=_[_0x37b8('0x35')](_0x141d3a[_0x37b8('0x34')],{'$or':_[_0x37b8('0x23')](_0x4d0438,function(_0x58db6e){if(_0x58db6e[_0x37b8('0x27')]!==_0x37b8('0x36')){var _0x438b72={};_0x438b72[_0x58db6e[_0x37b8('0x21')]]={'$like':'%'+_0x5a988a['query']['filter']+'%'};return _0x438b72;}})});}_0x141d3a=_[_0x37b8('0x35')]({},_0x141d3a,_0x5a988a['options']);var _0x5d85d7={'where':_0x141d3a[_0x37b8('0x34')]};return db['ScreenRecording'][_0x37b8('0x18')](_0x5d85d7)[_0x37b8('0x1e')](function(_0x392b8c){_0x139435[_0x37b8('0x18')]=_0x392b8c;if(_0x5a988a[_0x37b8('0x2b')]['includeAll']){_0x141d3a[_0x37b8('0x37')]=[{'all':!![]}];}return db['ScreenRecording'][_0x37b8('0x38')](_0x141d3a);})['then'](function(_0x22141c){_0x139435[_0x37b8('0x39')]=_0x22141c;return _0x139435;})[_0x37b8('0x1e')](respondWithFilteredResult(_0x14d814,_0x141d3a))[_0x37b8('0x3a')](handleError(_0x14d814,null));};exports['show']=function(_0x251dd5,_0x28e36a){var _0x328442={'raw':![],'where':{'id':_0x251dd5[_0x37b8('0x3b')]['id']}},_0x2f2bb4={};_0x2f2bb4[_0x37b8('0x29')]=_['keys'](db[_0x37b8('0x24')]['rawAttributes']);_0x2f2bb4[_0x37b8('0x2b')]=_['keys'](_0x251dd5['query']);_0x2f2bb4[_0x37b8('0x33')]=_['intersection'](_0x2f2bb4['model'],_0x2f2bb4[_0x37b8('0x2b')]);_0x328442[_0x37b8('0x2d')]=_[_0x37b8('0x3c')](_0x2f2bb4[_0x37b8('0x29')],qs[_0x37b8('0x2e')](_0x251dd5['query']['fields']));_0x328442[_0x37b8('0x2d')]=_0x328442[_0x37b8('0x2d')][_0x37b8('0x3d')]?_0x328442[_0x37b8('0x2d')]:_0x2f2bb4[_0x37b8('0x29')];if(_0x251dd5[_0x37b8('0x2b')][_0x37b8('0x3e')]){_0x328442[_0x37b8('0x37')]=[{'all':!![]}];}_0x328442=_['merge']({},_0x328442,_0x251dd5[_0x37b8('0x3f')]);return db[_0x37b8('0x24')][_0x37b8('0x40')](_0x328442)[_0x37b8('0x1e')](handleEntityNotFound(_0x28e36a,null))['then'](respondWithResult(_0x28e36a,null))[_0x37b8('0x3a')](handleError(_0x28e36a,null));};exports[_0x37b8('0x41')]=function(_0x2a804f,_0x39595d){return db[_0x37b8('0x24')]['create'](_0x2a804f[_0x37b8('0x42')],{})[_0x37b8('0x1e')](respondWithResult(_0x39595d,0xc9))[_0x37b8('0x3a')](handleError(_0x39595d,null));};exports['update']=function(_0x5ccd70,_0x4bc2cf){if(_0x5ccd70['body']['id']){delete _0x5ccd70['body']['id'];}delete _0x5ccd70['body'][_0x37b8('0x43')];delete _0x5ccd70['body']['createdAt'];delete _0x5ccd70['body']['closedAt'];delete _0x5ccd70[_0x37b8('0x42')][_0x37b8('0x44')];return db[_0x37b8('0x24')]['find']({'where':{'id':_0x5ccd70[_0x37b8('0x3b')]['id']}})[_0x37b8('0x1e')](handleEntityNotFound(_0x4bc2cf,null))['then'](saveUpdates(_0x5ccd70['body'],null))[_0x37b8('0x1e')](respondWithResult(_0x4bc2cf,null))[_0x37b8('0x3a')](handleError(_0x4bc2cf,null));};exports[_0x37b8('0x45')]=function(_0x5e7e0a,_0x694340){return db['ScreenRecording']['describe']()['then'](respondWithResult(_0x694340,null))['catch'](handleError(_0x694340,null));};exports[_0x37b8('0x46')]=function(_0x4a14b7,_0x1d3148,_0x4ee18d){var _0x16edec=require(_0x37b8('0x47'));var _0x4d9ba0=![];var _0x2c24c2={};if(_0x4a14b7[_0x37b8('0x2b')][_0x37b8('0x27')]&&_0x4a14b7['query'][_0x37b8('0x27')]===_0x37b8('0x48')){_0x2c24c2['uniqueid']=_0x4a14b7[_0x37b8('0x3b')]['id'];}else{_0x2c24c2['id']=_0x4a14b7['params']['id'];}return db[_0x37b8('0x24')][_0x37b8('0x40')]({'where':_0x2c24c2,'attributes':['id',_0x37b8('0x44')],'raw':!![]})[_0x37b8('0x1e')](handleEntityNotFound(_0x1d3148,null))['then'](function(_0x44cda7){if(_0x44cda7){var _0x12afd4=path['join'](config[_0x37b8('0x49')],_0x37b8('0x4a'),_0x44cda7['value']);var _0x5e4d3e=util[_0x37b8('0x2a')](_0x37b8('0x4b'),_0x12afd4);if(fs['existsSync'](_0x5e4d3e)){_0x4d9ba0=!![];return _0x16edec[_0x37b8('0x4c')](_0x5e4d3e,_0x12afd4,config[_0x37b8('0x4d')]['recording'])[_0x37b8('0x1e')](function(){return _0x44cda7;});}return _0x44cda7;}})['then'](function(_0x1b23cb){if(_0x1b23cb){var _0x296659=path[_0x37b8('0x4e')](config['root'],_0x37b8('0x4a'),_0x1b23cb[_0x37b8('0x44')]);if(!fs[_0x37b8('0x4f')](_0x296659)){throw new db['Sequelize'][(_0x37b8('0x50'))](_0x37b8('0x51'));}if(_0x1b23cb[_0x37b8('0x52')]){return _0x1d3148['download'](_0x296659,_0x1b23cb['filename']+path[_0x37b8('0x53')](_0x296659),function(){if(_0x4d9ba0){fs[_0x37b8('0x54')](_0x296659);}});}else{return _0x1d3148[_0x37b8('0x46')](_0x296659,function(_0xb55751){if(_0x4d9ba0){fs[_0x37b8('0x54')](_0x296659);}});}}})[_0x37b8('0x3a')](function(_0x424e58){if(_0x424e58[_0x37b8('0x55')]===_0x37b8('0x51')){_0x1d3148[_0x37b8('0x15')](0x194)[_0x37b8('0x56')](_0x37b8('0x57'));}else{return handleError(_0x1d3148,null);}});};exports['destroy']=function(_0x414a0e,_0x36c09b){return db[_0x37b8('0x24')][_0x37b8('0x40')]({'where':{'id':_0x414a0e[_0x37b8('0x3b')]['id']}})['then'](function(_0xaa0620){if(!_0xaa0620)throw new ReferenceError('Entity\x20not\x20found');return _0xaa0620;})[_0x37b8('0x1e')](function(_0xedb9d8){var _0x4e7813=path[_0x37b8('0x4e')](config['root'],_0x37b8('0x4a'),_0xedb9d8[_0x37b8('0x44')]);logger['info']('cancellazione\x20fisica\x20documento\x20%s',_0x4e7813);if(!_[_0x37b8('0x58')](_0xedb9d8[_0x37b8('0x44')])&&fs[_0x37b8('0x4f')](_0x4e7813)){logger['info'](_0x37b8('0x59')+_0x4e7813+_0x37b8('0x5a'));fs[_0x37b8('0x5b')](_0x4e7813);}_0x4e7813=_0x4e7813+_0x37b8('0x5c');if(!_[_0x37b8('0x58')](_0xedb9d8[_0x37b8('0x44')])&&fs[_0x37b8('0x4f')](_0x4e7813)){logger[_0x37b8('0x5d')](_0x37b8('0x59')+_0x4e7813+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs['unlinkSync'](_0x4e7813);}return _0xedb9d8;})['then'](function(_0x25c7dc){if(!_0x25c7dc)throw new InternalError();return _0x25c7dc[_0x37b8('0x1f')]();})['then'](function(){_0x36c09b[_0x37b8('0x15')](0xcc)[_0x37b8('0x16')]();})[_0x37b8('0x3a')](handleError(_0x36c09b,null));};
\ No newline at end of file
+var _0xe946=['request-promise','moment','bluebird','util','sox','to-csv','lodash','squel','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','set','Content-Range','apply','reject','save','update','then','destroy','error','name','send','index','map','ScreenRecording','rawAttributes','fieldName','type','key','model','differenceBy','query','keys','filters','attributes','fields','length','hasOwnProperty','limit','order','sort','where','pick','filter','merge','VIRTUAL','options','count','includeAll','include','findAll','rows','intersection','catch','create','body','duration','createdAt','closedAt','value','params','describe','download','../../components/encryptor','uniqueid','find','join','server/files/screen_recordings','format','existsSync','decryptFile','recording','root','Sequelize','ValidationError','ScreenRecording\x20not\x20found','filename','extname','unlink','message','Not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','isNil','File:\x20\x22','eml-format','rimraf','fast-json-patch'];(function(_0x6287b6,_0x5682e7){var _0x5d6be4=function(_0x3e3975){while(--_0x3e3975){_0x6287b6['push'](_0x6287b6['shift']());}};_0x5d6be4(++_0x5682e7);}(_0xe946,0x18d));var _0x6e94=function(_0x92b9e,_0x242815){_0x92b9e=_0x92b9e-0x0;var _0x542410=_0xe946[_0x92b9e];return _0x542410;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x6e94('0x0'));var rimraf=require(_0x6e94('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x6e94('0x2'));var rp=require(_0x6e94('0x3'));var moment=require(_0x6e94('0x4'));var BPromise=require(_0x6e94('0x5'));var Mustache=require('mustache');var util=require(_0x6e94('0x6'));var path=require('path');var sox=require(_0x6e94('0x7'));var csv=require(_0x6e94('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x6e94('0x9'));var squel=require(_0x6e94('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x6e94('0xb'));var Papa=require(_0x6e94('0xc'));var Redis=require(_0x6e94('0xd'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x6e94('0xe'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x6e94('0xf'))('api');var utils=require(_0x6e94('0x10'));var config=require(_0x6e94('0x11'));var db=require(_0x6e94('0x12'))['db'];function respondWithStatusCode(_0xd75907,_0x16d4c5){_0x16d4c5=_0x16d4c5||0xcc;return function(_0x1286a6){if(_0x1286a6){return _0xd75907[_0x6e94('0x13')](_0x16d4c5);}return _0xd75907[_0x6e94('0x14')](_0x16d4c5)[_0x6e94('0x15')]();};}function respondWithResult(_0x4450fc,_0x3a8bc5){_0x3a8bc5=_0x3a8bc5||0xc8;return function(_0x2155cc){if(_0x2155cc){return _0x4450fc[_0x6e94('0x14')](_0x3a8bc5)[_0x6e94('0x16')](_0x2155cc);}};}function respondWithFilteredResult(_0xcb855d,_0x4e993c){return function(_0x1862f2){if(_0x1862f2){var _0x2b7973=_0x1862f2['count'],_0x3ee6e0=_0x4e993c['offset'],_0x546a1d=_0x4e993c[_0x6e94('0x17')]+_0x4e993c['limit'],_0x4a703a;if(_0x546a1d>=_0x2b7973){_0x546a1d=_0x2b7973;_0x4a703a=0xc8;}else{_0x4a703a=0xce;}_0xcb855d[_0x6e94('0x14')](_0x4a703a);return _0xcb855d[_0x6e94('0x18')](_0x6e94('0x19'),_0x3ee6e0+'-'+_0x546a1d+'/'+_0x2b7973)[_0x6e94('0x16')](_0x1862f2);}return null;};}function patchUpdates(_0x244d7f){return function(_0x1cabd3){try{jsonpatch[_0x6e94('0x1a')](_0x1cabd3,_0x244d7f,!![]);}catch(_0x44faff){return BPromise[_0x6e94('0x1b')](_0x44faff);}return _0x1cabd3[_0x6e94('0x1c')]();};}function saveUpdates(_0x3c2724,_0x2e3f94){return function(_0x3ab1b5){if(_0x3ab1b5){return _0x3ab1b5[_0x6e94('0x1d')](_0x3c2724)[_0x6e94('0x1e')](function(_0x5283ed){return _0x5283ed;});}return null;};}function removeEntity(_0x5f5348,_0x3530e9){return function(_0x5be11a){if(_0x5be11a){return _0x5be11a[_0x6e94('0x1f')]()[_0x6e94('0x1e')](function(){_0x5f5348[_0x6e94('0x14')](0xcc)[_0x6e94('0x15')]();});}};}function handleEntityNotFound(_0x2a399b,_0x406786){return function(_0x218a5d){if(!_0x218a5d){_0x2a399b[_0x6e94('0x13')](0x194);}return _0x218a5d;};}function handleError(_0x1a011e,_0x6ba013){_0x6ba013=_0x6ba013||0x1f4;return function(_0x183f15){logger[_0x6e94('0x20')](_0x183f15['stack']);if(_0x183f15[_0x6e94('0x21')]){delete _0x183f15[_0x6e94('0x21')];}_0x1a011e[_0x6e94('0x14')](_0x6ba013)[_0x6e94('0x22')](_0x183f15);};}exports[_0x6e94('0x23')]=function(_0x4fdc90,_0x69c8a4){var _0x17bf12={},_0x199b35={},_0x17f398={'count':0x0,'rows':[]};var _0x58ece6=_[_0x6e94('0x24')](db[_0x6e94('0x25')][_0x6e94('0x26')],function(_0x1cbde5){return{'name':_0x1cbde5[_0x6e94('0x27')],'type':_0x1cbde5[_0x6e94('0x28')][_0x6e94('0x29')]};});_0x199b35[_0x6e94('0x2a')]=_[_0x6e94('0x2b')](_[_0x6e94('0x24')](_0x58ece6,_0x6e94('0x21')),['format']);_0x199b35[_0x6e94('0x2c')]=_[_0x6e94('0x2d')](_0x4fdc90['query']);_0x199b35[_0x6e94('0x2e')]=_['intersection'](_0x199b35[_0x6e94('0x2a')],_0x199b35[_0x6e94('0x2c')]);_0x17bf12[_0x6e94('0x2f')]=_['intersection'](_0x199b35[_0x6e94('0x2a')],qs[_0x6e94('0x30')](_0x4fdc90['query']['fields']));_0x17bf12[_0x6e94('0x2f')]=_0x17bf12[_0x6e94('0x2f')][_0x6e94('0x31')]?_0x17bf12[_0x6e94('0x2f')]:_0x199b35[_0x6e94('0x2a')];if(!_0x4fdc90[_0x6e94('0x2c')][_0x6e94('0x32')]('nolimit')){_0x17bf12[_0x6e94('0x33')]=qs[_0x6e94('0x33')](_0x4fdc90['query']['limit']);_0x17bf12[_0x6e94('0x17')]=qs[_0x6e94('0x17')](_0x4fdc90[_0x6e94('0x2c')][_0x6e94('0x17')]);}_0x17bf12[_0x6e94('0x34')]=qs[_0x6e94('0x35')](_0x4fdc90[_0x6e94('0x2c')][_0x6e94('0x35')]);_0x17bf12[_0x6e94('0x36')]=qs[_0x6e94('0x2e')](_[_0x6e94('0x37')](_0x4fdc90[_0x6e94('0x2c')],_0x199b35[_0x6e94('0x2e')]),_0x58ece6);if(_0x4fdc90['query'][_0x6e94('0x38')]){_0x17bf12[_0x6e94('0x36')]=_[_0x6e94('0x39')](_0x17bf12[_0x6e94('0x36')],{'$or':_['map'](_0x58ece6,function(_0x5acf05){if(_0x5acf05['type']!==_0x6e94('0x3a')){var _0x140edb={};_0x140edb[_0x5acf05[_0x6e94('0x21')]]={'$like':'%'+_0x4fdc90['query'][_0x6e94('0x38')]+'%'};return _0x140edb;}})});}_0x17bf12=_[_0x6e94('0x39')]({},_0x17bf12,_0x4fdc90[_0x6e94('0x3b')]);var _0x319578={'where':_0x17bf12['where']};return db[_0x6e94('0x25')]['count'](_0x319578)['then'](function(_0x3d4167){_0x17f398[_0x6e94('0x3c')]=_0x3d4167;if(_0x4fdc90[_0x6e94('0x2c')][_0x6e94('0x3d')]){_0x17bf12[_0x6e94('0x3e')]=[{'all':!![]}];}return db[_0x6e94('0x25')][_0x6e94('0x3f')](_0x17bf12);})[_0x6e94('0x1e')](function(_0x429687){_0x17f398[_0x6e94('0x40')]=_0x429687;return _0x17f398;})[_0x6e94('0x1e')](respondWithFilteredResult(_0x69c8a4,_0x17bf12))['catch'](handleError(_0x69c8a4,null));};exports['show']=function(_0x1c1160,_0x132863){var _0x186ee7={'raw':![],'where':{'id':_0x1c1160['params']['id']}},_0x303442={};_0x303442['model']=_[_0x6e94('0x2d')](db['ScreenRecording'][_0x6e94('0x26')]);_0x303442[_0x6e94('0x2c')]=_[_0x6e94('0x2d')](_0x1c1160[_0x6e94('0x2c')]);_0x303442[_0x6e94('0x2e')]=_[_0x6e94('0x41')](_0x303442['model'],_0x303442[_0x6e94('0x2c')]);_0x186ee7[_0x6e94('0x2f')]=_['intersection'](_0x303442['model'],qs['fields'](_0x1c1160['query'][_0x6e94('0x30')]));_0x186ee7[_0x6e94('0x2f')]=_0x186ee7[_0x6e94('0x2f')][_0x6e94('0x31')]?_0x186ee7[_0x6e94('0x2f')]:_0x303442['model'];if(_0x1c1160['query']['includeAll']){_0x186ee7[_0x6e94('0x3e')]=[{'all':!![]}];}_0x186ee7=_['merge']({},_0x186ee7,_0x1c1160[_0x6e94('0x3b')]);return db[_0x6e94('0x25')]['find'](_0x186ee7)['then'](handleEntityNotFound(_0x132863,null))[_0x6e94('0x1e')](respondWithResult(_0x132863,null))[_0x6e94('0x42')](handleError(_0x132863,null));};exports[_0x6e94('0x43')]=function(_0x347deb,_0x5c8a3b){return db['ScreenRecording'][_0x6e94('0x43')](_0x347deb[_0x6e94('0x44')],{})[_0x6e94('0x1e')](respondWithResult(_0x5c8a3b,0xc9))[_0x6e94('0x42')](handleError(_0x5c8a3b,null));};exports[_0x6e94('0x1d')]=function(_0x3a20d0,_0x1a9a30){if(_0x3a20d0[_0x6e94('0x44')]['id']){delete _0x3a20d0['body']['id'];}delete _0x3a20d0[_0x6e94('0x44')][_0x6e94('0x45')];delete _0x3a20d0[_0x6e94('0x44')][_0x6e94('0x46')];delete _0x3a20d0['body'][_0x6e94('0x47')];delete _0x3a20d0[_0x6e94('0x44')][_0x6e94('0x48')];return db[_0x6e94('0x25')]['find']({'where':{'id':_0x3a20d0[_0x6e94('0x49')]['id']}})['then'](handleEntityNotFound(_0x1a9a30,null))[_0x6e94('0x1e')](saveUpdates(_0x3a20d0[_0x6e94('0x44')],null))[_0x6e94('0x1e')](respondWithResult(_0x1a9a30,null))['catch'](handleError(_0x1a9a30,null));};exports[_0x6e94('0x4a')]=function(_0x417fb0,_0x2e44b1){return db[_0x6e94('0x25')][_0x6e94('0x4a')]()[_0x6e94('0x1e')](respondWithResult(_0x2e44b1,null))[_0x6e94('0x42')](handleError(_0x2e44b1,null));};exports[_0x6e94('0x4b')]=function(_0x2717e2,_0xdb0689,_0x22326e){var _0x5497d6=require(_0x6e94('0x4c'));var _0x30de8e=![];var _0x38a7eb={};if(_0x2717e2[_0x6e94('0x2c')][_0x6e94('0x28')]&&_0x2717e2[_0x6e94('0x2c')][_0x6e94('0x28')]==='uniqueid'){_0x38a7eb[_0x6e94('0x4d')]=_0x2717e2[_0x6e94('0x49')]['id'];}else{_0x38a7eb['id']=_0x2717e2[_0x6e94('0x49')]['id'];}return db[_0x6e94('0x25')][_0x6e94('0x4e')]({'where':_0x38a7eb,'attributes':['id',_0x6e94('0x48')],'raw':!![]})[_0x6e94('0x1e')](handleEntityNotFound(_0xdb0689,null))[_0x6e94('0x1e')](function(_0x1b47d5){if(_0x1b47d5){var _0x49df49=path[_0x6e94('0x4f')](config['root'],_0x6e94('0x50'),_0x1b47d5[_0x6e94('0x48')]);var _0x1349a3=util[_0x6e94('0x51')]('%s.cypher',_0x49df49);if(fs[_0x6e94('0x52')](_0x1349a3)){_0x30de8e=!![];return _0x5497d6[_0x6e94('0x53')](_0x1349a3,_0x49df49,config['secrets'][_0x6e94('0x54')])[_0x6e94('0x1e')](function(){return _0x1b47d5;});}return _0x1b47d5;}})[_0x6e94('0x1e')](function(_0x54a5e0){if(_0x54a5e0){var _0x21d1c6=path['join'](config[_0x6e94('0x55')],_0x6e94('0x50'),_0x54a5e0[_0x6e94('0x48')]);if(!fs[_0x6e94('0x52')](_0x21d1c6)){throw new db[(_0x6e94('0x56'))][(_0x6e94('0x57'))](_0x6e94('0x58'));}if(_0x54a5e0[_0x6e94('0x59')]){return _0xdb0689[_0x6e94('0x4b')](_0x21d1c6,_0x54a5e0[_0x6e94('0x59')]+path[_0x6e94('0x5a')](_0x21d1c6),function(){if(_0x30de8e){fs[_0x6e94('0x5b')](_0x21d1c6);}});}else{return _0xdb0689[_0x6e94('0x4b')](_0x21d1c6,function(_0x165ca9){if(_0x30de8e){fs[_0x6e94('0x5b')](_0x21d1c6);}});}}})['catch'](function(_0x220e20){if(_0x220e20[_0x6e94('0x5c')]===_0x6e94('0x58')){_0xdb0689[_0x6e94('0x14')](0x194)[_0x6e94('0x22')](_0x6e94('0x5d'));}else{return handleError(_0xdb0689,null);}});};exports[_0x6e94('0x1f')]=function(_0x31415d,_0x116357){return db[_0x6e94('0x25')][_0x6e94('0x4e')]({'where':{'id':_0x31415d['params']['id']}})[_0x6e94('0x1e')](function(_0x664217){if(!_0x664217)throw new ReferenceError('Entity\x20not\x20found');return _0x664217;})[_0x6e94('0x1e')](function(_0x155619){var _0x35c332=path['join'](config[_0x6e94('0x55')],_0x6e94('0x50'),_0x155619[_0x6e94('0x48')]);logger[_0x6e94('0x5e')](_0x6e94('0x5f'),_0x35c332);if(!_['isNil'](_0x155619['value'])&&fs[_0x6e94('0x52')](_0x35c332)){logger['info']('File:\x20\x22'+_0x35c332+_0x6e94('0x60'));fs[_0x6e94('0x61')](_0x35c332);}_0x35c332=_0x35c332+'.cypher';if(!_[_0x6e94('0x62')](_0x155619[_0x6e94('0x48')])&&fs[_0x6e94('0x52')](_0x35c332)){logger['info'](_0x6e94('0x63')+_0x35c332+_0x6e94('0x60'));fs[_0x6e94('0x61')](_0x35c332);}return _0x155619;})[_0x6e94('0x1e')](function(_0x5ae91a){if(!_0x5ae91a)throw new InternalError();return _0x5ae91a['destroy']();})[_0x6e94('0x1e')](function(){_0x116357[_0x6e94('0x14')](0xcc)[_0x6e94('0x15')]();})[_0x6e94('0x42')](handleError(_0x116357,null));};
\ No newline at end of file
diff --git a/server/api/screenRecording/screenRecording.model.js b/server/api/screenRecording/screenRecording.model.js
index ea8a7e5..2f40ea8 100644
--- a/server/api/screenRecording/screenRecording.model.js
+++ b/server/api/screenRecording/screenRecording.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x5752=['bluebird','request-promise','path','rimraf','../../config/environment','./screenRecording.attributes','exports','screen_recordings','interactionid'];(function(_0x49f30e,_0xf28439){var _0x2cafd5=function(_0x581d4c){while(--_0x581d4c){_0x49f30e['push'](_0x49f30e['shift']());}};_0x2cafd5(++_0xf28439);}(_0x5752,0x144));var _0x2575=function(_0x565c49,_0x54acd0){_0x565c49=_0x565c49-0x0;var _0x20ca34=_0x5752[_0x565c49];return _0x20ca34;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x2575('0x0'));var rp=require(_0x2575('0x1'));var fs=require('fs');var path=require(_0x2575('0x2'));var rimraf=require(_0x2575('0x3'));var config=require(_0x2575('0x4'));var attributes=require(_0x2575('0x5'));module[_0x2575('0x6')]=function(_0x112783,_0x522fad){return _0x112783['define']('ScreenRecording',attributes,{'tableName':_0x2575('0x7'),'paranoid':![],'indexes':[{'name':_0x2575('0x8'),'fields':[_0x2575('0x8')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xfed7=['request-promise','path','rimraf','../../config/environment','exports','ScreenRecording','screen_recordings','interactionid','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x38c0e7,_0x229f2d){var _0x1bcbee=function(_0x3ff5d2){while(--_0x3ff5d2){_0x38c0e7['push'](_0x38c0e7['shift']());}};_0x1bcbee(++_0x229f2d);}(_0xfed7,0x190));var _0x7fed=function(_0xd31621,_0x17b567){_0xd31621=_0xd31621-0x0;var _0x2e7ac0=_0xfed7[_0xd31621];return _0x2e7ac0;};'use strict';var _=require(_0x7fed('0x0'));var util=require(_0x7fed('0x1'));var logger=require(_0x7fed('0x2'))(_0x7fed('0x3'));var moment=require(_0x7fed('0x4'));var BPromise=require(_0x7fed('0x5'));var rp=require(_0x7fed('0x6'));var fs=require('fs');var path=require(_0x7fed('0x7'));var rimraf=require(_0x7fed('0x8'));var config=require(_0x7fed('0x9'));var attributes=require('./screenRecording.attributes');module[_0x7fed('0xa')]=function(_0x3be30c,_0x517ec1){return _0x3be30c['define'](_0x7fed('0xb'),attributes,{'tableName':_0x7fed('0xc'),'paranoid':![],'indexes':[{'name':_0x7fed('0xd'),'fields':[_0x7fed('0xd')]}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/screenRecording/screenRecording.rpc.js b/server/api/screenRecording/screenRecording.rpc.js
index bbfea73..2b79608 100644
--- a/server/api/screenRecording/screenRecording.rpc.js
+++ b/server/api/screenRecording/screenRecording.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xa9e0=['http','info','ScreenRecording,\x20%s,\x20%s','request\x20sent','debug','ScreenRecording,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x239502,_0x4e8178){var _0x13391d=function(_0x4f8fa4){while(--_0x4f8fa4){_0x239502['push'](_0x239502['shift']());}};_0x13391d(++_0x4e8178);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3b5250,_0x7a0b2c){_0x3b5250=_0x3b5250-0x0;var _0xc844a1=_0xa9e0[_0x3b5250];return _0xc844a1;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});}
\ No newline at end of file
+var _0xa9e0=['http','info','ScreenRecording,\x20%s,\x20%s','request\x20sent','debug','ScreenRecording,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x4ea9fd,_0x2e79ee){var _0x9b4d1c=function(_0x3318da){while(--_0x3318da){_0x4ea9fd['push'](_0x4ea9fd['shift']());}};_0x9b4d1c(++_0x2e79ee);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1ddedd,_0x485606){_0x1ddedd=_0x1ddedd-0x0;var _0xa3e1ac=_0xa9e0[_0x1ddedd];return _0xa3e1ac;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});}
\ No newline at end of file
diff --git a/server/api/setting/index.js b/server/api/setting/index.js
index cb49afe..db11ab3 100644
--- a/server/api/setting/index.js
+++ b/server/api/setting/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xe5ca=['post','single','file','addLogo','diskStorage','join','root','server/files/images/logos/','originalname','addLogoLogin','addPreferred','favicon','addFavicon','put','update','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./setting.controller','get','isAuthenticated','index','show','/:id/logo','getLogo','/:id/logo_login','getLogoLogin','/:id/gdpr','gdpr','/:id/preferred','/:id/favicon','getFavicon','format','%s%s','logo','extname'];(function(_0x4fb55a,_0x35b72c){var _0x533821=function(_0x4e20ea){while(--_0x4e20ea){_0x4fb55a['push'](_0x4fb55a['shift']());}};_0x533821(++_0x35b72c);}(_0xe5ca,0x10c));var _0xae5c=function(_0x3305de,_0x16582f){_0x3305de=_0x3305de-0x0;var _0x3b5a84=_0xe5ca[_0x3305de];return _0x3b5a84;};'use strict';var multer=require(_0xae5c('0x0'));var util=require(_0xae5c('0x1'));var path=require(_0xae5c('0x2'));var timeout=require(_0xae5c('0x3'));var express=require(_0xae5c('0x4'));var router=express[_0xae5c('0x5')]();var auth=require(_0xae5c('0x6'));var interaction=require(_0xae5c('0x7'));var config=require('../../config/environment');var controller=require(_0xae5c('0x8'));router[_0xae5c('0x9')]('/',auth[_0xae5c('0xa')](),controller[_0xae5c('0xb')]);router[_0xae5c('0x9')]('/:id',controller[_0xae5c('0xc')]);router[_0xae5c('0x9')](_0xae5c('0xd'),controller[_0xae5c('0xe')]);router[_0xae5c('0x9')](_0xae5c('0xf'),controller[_0xae5c('0x10')]);router[_0xae5c('0x9')](_0xae5c('0x11'),controller[_0xae5c('0x12')]);router['get'](_0xae5c('0x13'),controller['getPreferred']);router[_0xae5c('0x9')](_0xae5c('0x14'),controller[_0xae5c('0x15')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x506ab2,_0x5a5804,_0x5c7094){_0x5c7094(null,path['join'](config['root'],'server/files/images/logos/'));},'filename':function(_0x4027c9,_0x389503,_0x405642){_0x405642(null,util[_0xae5c('0x16')](_0xae5c('0x17'),_0xae5c('0x18'),path[_0xae5c('0x19')](_0x389503['originalname'])));}})});router[_0xae5c('0x1a')](_0xae5c('0xd'),upload[_0xae5c('0x1b')](_0xae5c('0x1c')),controller[_0xae5c('0x1d')]);var upload=multer({'storage':multer[_0xae5c('0x1e')]({'destination':function(_0x57265f,_0x5051df,_0x501a75){_0x501a75(null,path[_0xae5c('0x1f')](config[_0xae5c('0x20')],_0xae5c('0x21')));},'filename':function(_0x43b7be,_0x4b2d18,_0x1179fa){_0x1179fa(null,util[_0xae5c('0x16')](_0xae5c('0x17'),'logologin',path[_0xae5c('0x19')](_0x4b2d18[_0xae5c('0x22')])));}})});router[_0xae5c('0x1a')](_0xae5c('0xf'),upload['single']('file'),controller[_0xae5c('0x23')]);var upload=multer({'storage':multer[_0xae5c('0x1e')]({'destination':function(_0x1c6b33,_0x3b1584,_0x7c605a){_0x7c605a(null,path['join'](config[_0xae5c('0x20')],_0xae5c('0x21')));},'filename':function(_0x1c7431,_0x57373d,_0x365921){_0x365921(null,util[_0xae5c('0x16')](_0xae5c('0x17'),'preferred',path[_0xae5c('0x19')](_0x57373d[_0xae5c('0x22')])));}})});router['post'](_0xae5c('0x13'),upload['single'](_0xae5c('0x1c')),controller[_0xae5c('0x24')]);var upload=multer({'storage':multer[_0xae5c('0x1e')]({'destination':function(_0x38d196,_0xa7e570,_0x10dd3f){_0x10dd3f(null,path[_0xae5c('0x1f')](config[_0xae5c('0x20')],_0xae5c('0x21')));},'filename':function(_0x41448f,_0x1ff85d,_0x254b3e){_0x254b3e(null,util[_0xae5c('0x16')](_0xae5c('0x17'),_0xae5c('0x25'),path['extname'](_0x1ff85d[_0xae5c('0x22')])));}})});router['post'](_0xae5c('0x14'),upload[_0xae5c('0x1b')]('file'),controller[_0xae5c('0x26')]);router[_0xae5c('0x27')]('/:id',auth['isAuthenticated'](),controller[_0xae5c('0x28')]);module[_0xae5c('0x29')]=router;
\ No newline at end of file
+var _0x532b=['post','single','file','join','server/files/images/logos/','logologin','addLogoLogin','root','preferred','/:id/preferred','addPreferred','favicon','put','update','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./setting.controller','get','isAuthenticated','index','/:id','show','/:id/logo','getLogo','/:id/logo_login','getLogoLogin','/:id/gdpr','getPreferred','/:id/favicon','diskStorage','format','%s%s','logo','extname','originalname'];(function(_0x1f9429,_0x4181aa){var _0x589756=function(_0xb8b170){while(--_0xb8b170){_0x1f9429['push'](_0x1f9429['shift']());}};_0x589756(++_0x4181aa);}(_0x532b,0x65));var _0xb532=function(_0x142d3e,_0x353e86){_0x142d3e=_0x142d3e-0x0;var _0x493084=_0x532b[_0x142d3e];return _0x493084;};'use strict';var multer=require(_0xb532('0x0'));var util=require(_0xb532('0x1'));var path=require(_0xb532('0x2'));var timeout=require(_0xb532('0x3'));var express=require(_0xb532('0x4'));var router=express[_0xb532('0x5')]();var auth=require(_0xb532('0x6'));var interaction=require(_0xb532('0x7'));var config=require(_0xb532('0x8'));var controller=require(_0xb532('0x9'));router[_0xb532('0xa')]('/',auth[_0xb532('0xb')](),controller[_0xb532('0xc')]);router['get'](_0xb532('0xd'),controller[_0xb532('0xe')]);router[_0xb532('0xa')](_0xb532('0xf'),controller[_0xb532('0x10')]);router[_0xb532('0xa')](_0xb532('0x11'),controller[_0xb532('0x12')]);router['get'](_0xb532('0x13'),controller['gdpr']);router[_0xb532('0xa')]('/:id/preferred',controller[_0xb532('0x14')]);router['get'](_0xb532('0x15'),controller['getFavicon']);var upload=multer({'storage':multer[_0xb532('0x16')]({'destination':function(_0x34761d,_0x3b412a,_0xb1355a){_0xb1355a(null,path['join'](config['root'],'server/files/images/logos/'));},'filename':function(_0x2e1a1a,_0x11cdfa,_0x2ab768){_0x2ab768(null,util[_0xb532('0x17')](_0xb532('0x18'),_0xb532('0x19'),path[_0xb532('0x1a')](_0x11cdfa[_0xb532('0x1b')])));}})});router[_0xb532('0x1c')](_0xb532('0xf'),upload[_0xb532('0x1d')](_0xb532('0x1e')),controller['addLogo']);var upload=multer({'storage':multer[_0xb532('0x16')]({'destination':function(_0x2ca120,_0x2ab885,_0x55ffa2){_0x55ffa2(null,path[_0xb532('0x1f')](config['root'],_0xb532('0x20')));},'filename':function(_0x39e2c,_0x5c5329,_0x1c8673){_0x1c8673(null,util[_0xb532('0x17')](_0xb532('0x18'),_0xb532('0x21'),path['extname'](_0x5c5329[_0xb532('0x1b')])));}})});router[_0xb532('0x1c')]('/:id/logo_login',upload[_0xb532('0x1d')](_0xb532('0x1e')),controller[_0xb532('0x22')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x26dfd2,_0x175c5e,_0x569d3e){_0x569d3e(null,path[_0xb532('0x1f')](config[_0xb532('0x23')],'server/files/images/logos/'));},'filename':function(_0x39d557,_0x56080c,_0x5c99cd){_0x5c99cd(null,util[_0xb532('0x17')](_0xb532('0x18'),_0xb532('0x24'),path['extname'](_0x56080c['originalname'])));}})});router['post'](_0xb532('0x25'),upload['single'](_0xb532('0x1e')),controller[_0xb532('0x26')]);var upload=multer({'storage':multer[_0xb532('0x16')]({'destination':function(_0xf35f56,_0x340e4a,_0x52edee){_0x52edee(null,path[_0xb532('0x1f')](config[_0xb532('0x23')],_0xb532('0x20')));},'filename':function(_0x3f0468,_0x11aa3f,_0x1eaffa){_0x1eaffa(null,util[_0xb532('0x17')](_0xb532('0x18'),_0xb532('0x27'),path[_0xb532('0x1a')](_0x11aa3f[_0xb532('0x1b')])));}})});router['post'](_0xb532('0x15'),upload[_0xb532('0x1d')](_0xb532('0x1e')),controller['addFavicon']);router[_0xb532('0x28')](_0xb532('0xd'),auth[_0xb532('0xb')](),controller[_0xb532('0x29')]);module[_0xb532('0x2a')]=router;
\ No newline at end of file
diff --git a/server/api/setting/setting.attributes.js b/server/api/setting/setting.attributes.js
index 5d0ab58..daa8d5e 100644
--- a/server/api/setting/setting.attributes.js
+++ b/server/api/setting/setting.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x285c=['sequelize','exports','INTEGER','min_internal','STRING','/var/opt/motion2/server/files/sounds/converted','BOOLEAN','https://www.xcally.com/bar/phonebar/autoupdater.xml','alternate'];(function(_0x22dac7,_0x45d32a){var _0x3e6cfa=function(_0x4c2e9d){while(--_0x4c2e9d){_0x22dac7['push'](_0x22dac7['shift']());}};_0x3e6cfa(++_0x45d32a);}(_0x285c,0x1a7));var _0xc285=function(_0x45723e,_0x39d8af){_0x45723e=_0x45723e-0x0;var _0x3eb56d=_0x285c[_0x45723e];return _0x3eb56d;};'use strict';var Sequelize=require(_0xc285('0x0'));module[_0xc285('0x1')]={'min_internal':{'type':Sequelize[_0xc285('0x2')](0xb),'unique':_0xc285('0x3'),'defaultValue':0x3e8},'min_mailbox':{'type':Sequelize[_0xc285('0x2')](0xb),'unique':'min_mailbox','defaultValue':0x3e8},'agi_port':{'type':Sequelize[_0xc285('0x2')](0xb),'defaultValue':0x11dd},'soundPath':{'type':Sequelize[_0xc285('0x4')],'defaultValue':_0xc285('0x5')},'logo':{'type':Sequelize[_0xc285('0x4')]},'defaultLogo':{'type':Sequelize[_0xc285('0x6')],'defaultValue':!![]},'loginLogo':{'type':Sequelize[_0xc285('0x4')]},'defaultLoginLogo':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'headerWhiteLabel':{'type':Sequelize[_0xc285('0x4')]},'defaultHeaderWhiteLabel':{'type':Sequelize[_0xc285('0x6')],'defaultValue':!![]},'securePassword':{'type':Sequelize[_0xc285('0x6')],'defaultValue':!![]},'firstSetup':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'stunaddr':{'type':Sequelize[_0xc285('0x4')]},'turnaddr':{'type':Sequelize[_0xc285('0x4')]},'turnusername':{'type':Sequelize['STRING']},'turnpassword':{'type':Sequelize[_0xc285('0x4')]},'pageTitle':{'type':Sequelize['STRING']},'defaultPageTitle':{'type':Sequelize[_0xc285('0x6')],'defaultValue':!![]},'callRecordingEncryption':{'type':Sequelize[_0xc285('0x6')],'defaultValue':![]},'passwordExpiresDays':{'type':Sequelize[_0xc285('0x2')](0xb),'defaultValue':0x5a},'phoneBarAutoUpdater':{'type':Sequelize[_0xc285('0x6')],'defaultValue':!![]},'phoneBarAutoUpdaterUrl':{'type':Sequelize[_0xc285('0x4')],'defaultValue':_0xc285('0x7')},'enableEmailPreview':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'split':{'type':Sequelize[_0xc285('0x6')],'defaultValue':!![]},'splitSizeCsv':{'type':Sequelize['INTEGER'],'defaultValue':0x1388},'splitSizePdf':{'type':Sequelize[_0xc285('0x2')],'defaultValue':0x1388},'splitSizeXlsx':{'type':Sequelize[_0xc285('0x2')],'defaultValue':0x1388},'messagesAlignment':{'type':Sequelize[_0xc285('0x4')],'defaultValue':_0xc285('0x8')},'chatTimeout':{'type':Sequelize[_0xc285('0x2')],'defaultValue':0x1e},'phoneBarRememberMeEnabled':{'type':Sequelize[_0xc285('0x6')],'defaultValue':!![]},'preferred':{'type':Sequelize[_0xc285('0x4')]},'defaultPreferred':{'type':Sequelize[_0xc285('0x6')],'defaultValue':!![]},'rtlSupport':{'type':Sequelize[_0xc285('0x6')],'defaultValue':![]},'defaultScreenRecordingPath':{'type':Sequelize[_0xc285('0x4')]},'allowedLoginAttempts':{'type':Sequelize['INTEGER'],'defaultValue':0x5},'blockDuration':{'type':Sequelize[_0xc285('0x2')],'defaultValue':0xa},'favicon':{'type':Sequelize[_0xc285('0x4')]},'defaultFavicon':{'type':Sequelize[_0xc285('0x6')],'defaultValue':!![]},'loginMailFrequency':{'type':Sequelize[_0xc285('0x2')],'defaultValue':0xa,'validate':{'min':0xa}},'transcribe':{'type':Sequelize[_0xc285('0x6')],'defaultValue':![]},'automaticTranscribe':{'type':Sequelize[_0xc285('0x6')],'defaultValue':![]},'transcribeAccountId':{'type':Sequelize[_0xc285('0x2')]},'transcribeRegion':{'type':Sequelize[_0xc285('0x4')]},'sentiment':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'automaticSentiment':{'type':Sequelize[_0xc285('0x6')],'defaultValue':![]},'sentimentAccountId':{'type':Sequelize[_0xc285('0x2')]},'sentimentRegion':{'type':Sequelize['STRING']},'language':{'type':Sequelize['STRING']},'bucket':{'type':Sequelize[_0xc285('0x4')]},'googleSsoEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}};
\ No newline at end of file
+var _0x9c5c=['INTEGER','STRING','/var/opt/motion2/server/files/sounds/converted','BOOLEAN','https://www.xcally.com/bar/phonebar/autoupdater.xml','alternate','sequelize','exports'];(function(_0x425fd7,_0x57a29b){var _0x2edf8a=function(_0x4bb5ea){while(--_0x4bb5ea){_0x425fd7['push'](_0x425fd7['shift']());}};_0x2edf8a(++_0x57a29b);}(_0x9c5c,0x8e));var _0xc9c5=function(_0xefe5f,_0x4c9050){_0xefe5f=_0xefe5f-0x0;var _0x5b2f07=_0x9c5c[_0xefe5f];return _0x5b2f07;};'use strict';var Sequelize=require(_0xc9c5('0x0'));module[_0xc9c5('0x1')]={'min_internal':{'type':Sequelize[_0xc9c5('0x2')](0xb),'unique':'min_internal','defaultValue':0x3e8},'min_mailbox':{'type':Sequelize[_0xc9c5('0x2')](0xb),'unique':'min_mailbox','defaultValue':0x3e8},'agi_port':{'type':Sequelize[_0xc9c5('0x2')](0xb),'defaultValue':0x11dd},'soundPath':{'type':Sequelize[_0xc9c5('0x3')],'defaultValue':_0xc9c5('0x4')},'logo':{'type':Sequelize[_0xc9c5('0x3')]},'defaultLogo':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'loginLogo':{'type':Sequelize[_0xc9c5('0x3')]},'defaultLoginLogo':{'type':Sequelize[_0xc9c5('0x5')],'defaultValue':!![]},'headerWhiteLabel':{'type':Sequelize['STRING']},'defaultHeaderWhiteLabel':{'type':Sequelize[_0xc9c5('0x5')],'defaultValue':!![]},'securePassword':{'type':Sequelize[_0xc9c5('0x5')],'defaultValue':!![]},'firstSetup':{'type':Sequelize[_0xc9c5('0x5')],'defaultValue':!![]},'stunaddr':{'type':Sequelize[_0xc9c5('0x3')]},'turnaddr':{'type':Sequelize[_0xc9c5('0x3')]},'turnusername':{'type':Sequelize['STRING']},'turnpassword':{'type':Sequelize[_0xc9c5('0x3')]},'pageTitle':{'type':Sequelize[_0xc9c5('0x3')]},'defaultPageTitle':{'type':Sequelize[_0xc9c5('0x5')],'defaultValue':!![]},'callRecordingEncryption':{'type':Sequelize[_0xc9c5('0x5')],'defaultValue':![]},'passwordExpiresDays':{'type':Sequelize[_0xc9c5('0x2')](0xb),'defaultValue':0x5a},'phoneBarAutoUpdater':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarAutoUpdaterUrl':{'type':Sequelize[_0xc9c5('0x3')],'defaultValue':_0xc9c5('0x6')},'enableEmailPreview':{'type':Sequelize[_0xc9c5('0x5')],'defaultValue':![]},'split':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'splitSizeCsv':{'type':Sequelize[_0xc9c5('0x2')],'defaultValue':0x1388},'splitSizePdf':{'type':Sequelize[_0xc9c5('0x2')],'defaultValue':0x1388},'splitSizeXlsx':{'type':Sequelize['INTEGER'],'defaultValue':0x1388},'messagesAlignment':{'type':Sequelize[_0xc9c5('0x3')],'defaultValue':_0xc9c5('0x7')},'chatTimeout':{'type':Sequelize[_0xc9c5('0x2')],'defaultValue':0x1e},'phoneBarRememberMeEnabled':{'type':Sequelize[_0xc9c5('0x5')],'defaultValue':!![]},'preferred':{'type':Sequelize[_0xc9c5('0x3')]},'defaultPreferred':{'type':Sequelize[_0xc9c5('0x5')],'defaultValue':!![]},'rtlSupport':{'type':Sequelize[_0xc9c5('0x5')],'defaultValue':![]},'defaultScreenRecordingPath':{'type':Sequelize[_0xc9c5('0x3')]},'allowedLoginAttempts':{'type':Sequelize[_0xc9c5('0x2')],'defaultValue':0x5},'blockDuration':{'type':Sequelize[_0xc9c5('0x2')],'defaultValue':0xa},'favicon':{'type':Sequelize['STRING']},'defaultFavicon':{'type':Sequelize[_0xc9c5('0x5')],'defaultValue':!![]},'loginMailFrequency':{'type':Sequelize[_0xc9c5('0x2')],'defaultValue':0xa,'validate':{'min':0xa}},'transcribe':{'type':Sequelize[_0xc9c5('0x5')],'defaultValue':![]},'automaticTranscribe':{'type':Sequelize[_0xc9c5('0x5')],'defaultValue':![]},'transcribeAccountId':{'type':Sequelize[_0xc9c5('0x2')]},'transcribeRegion':{'type':Sequelize[_0xc9c5('0x3')]},'sentiment':{'type':Sequelize[_0xc9c5('0x5')],'defaultValue':![]},'automaticSentiment':{'type':Sequelize[_0xc9c5('0x5')],'defaultValue':![]},'sentimentAccountId':{'type':Sequelize['INTEGER']},'sentimentRegion':{'type':Sequelize[_0xc9c5('0x3')]},'language':{'type':Sequelize[_0xc9c5('0x3')]},'bucket':{'type':Sequelize[_0xc9c5('0x3')]},'googleSsoEnabled':{'type':Sequelize[_0xc9c5('0x5')],'defaultValue':![]}};
\ No newline at end of file
diff --git a/server/api/setting/setting.controller.js b/server/api/setting/setting.controller.js
index ddefffa..35db0f5 100644
--- a/server/api/setting/setting.controller.js
+++ b/server/api/setting/setting.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xd511=['lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','jayson/promise','client','http','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','Setting,\x20%s,\x20%s','request\x20sent','Setting,\x20%s,\x20%s,\x20%s','stringify','error','code','message','sendStatus','status','json','count','offset','Content-Range','apply','update','destroy','end','name','index','map','rawAttributes','fieldName','type','key','model','keys','query','filters','attributes','intersection','fields','length','nolimit','limit','order','sort','where','pick','filter','merge','VIRTUAL','options','Setting','includeAll','include','findAll','catch','show','params','find','body','addLogo','filename','logo','addLogoLogin','file','loginLogo','../../config/license/util','server/files/images/logos','preferred','defaultLogo','defaultLoginLogo','join','root','toLower','default_logo.svg','default','upperFirst','custom','existsSync','\x20not\x20found','getLogoLogin','getLicense','favicon','defaultPreferred','defaultFavicon','default_loginLogo.svg','gdpr','addPreferred','download','addFavicon','getFavicon','default_favicon.ico','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs'];(function(_0xc0a8e1,_0x2fbd4e){var _0x237baf=function(_0x49cbb6){while(--_0x49cbb6){_0xc0a8e1['push'](_0xc0a8e1['shift']());}};_0x237baf(++_0x2fbd4e);}(_0xd511,0x68));var _0x1d51=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xd511[_0x14add3];return _0x4a174f;};'use strict';var pdf=require(_0x1d51('0x0'));var emlformat=require(_0x1d51('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x1d51('0x2'));var jsonpatch=require(_0x1d51('0x3'));var rp=require(_0x1d51('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x1d51('0x5'));var util=require(_0x1d51('0x6'));var path=require(_0x1d51('0x7'));var sox=require(_0x1d51('0x8'));var csv=require(_0x1d51('0x9'));var ejs=require(_0x1d51('0xa'));var fs=require('fs');var _=require(_0x1d51('0xb'));var squel=require(_0x1d51('0xc'));var crypto=require(_0x1d51('0xd'));var jsforce=require(_0x1d51('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x1d51('0x9'));var querystring=require('querystring');var Papa=require(_0x1d51('0xf'));var Redis=require(_0x1d51('0x10'));var authService=require(_0x1d51('0x11'));var qs=require(_0x1d51('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1d51('0x13'));var logger=require('../../config/logger')(_0x1d51('0x14'));var utils=require(_0x1d51('0x15'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];var jayson=require(_0x1d51('0x16'));var client=jayson[_0x1d51('0x17')][_0x1d51('0x18')]({'port':0x232a});function checkPasswordPattern(_0x462bf1,_0x4dd8c6,_0x3d9942){if(_0x3d9942){var _0x3a7cee=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x3a7cee[_0x1d51('0x19')](_0x4dd8c6)){return _0x462bf1;}else{throw new db[(_0x1d51('0x1a'))][(_0x1d51('0x1b'))](_0x1d51('0x1c'));}}else{return _0x462bf1;}}function respondWithRpcPromise(_0x122a08,_0x219ded,_0x1432e7,_0x47df22){return new BPromise(function(_0x219037,_0x482c3e){var _0x67ee6=_0x47df22||client;return _0x67ee6[_0x1d51('0x1d')](_0x122a08,_0x1432e7)[_0x1d51('0x1e')](function(_0x37e6e0){logger[_0x1d51('0x1f')](_0x1d51('0x20'),_0x219ded,_0x1d51('0x21'));logger['debug'](_0x1d51('0x22'),_0x219ded,_0x1d51('0x21'),JSON[_0x1d51('0x23')](_0x37e6e0));if(_0x37e6e0[_0x1d51('0x24')]){if(_0x37e6e0[_0x1d51('0x24')][_0x1d51('0x25')]===0x1f4){logger[_0x1d51('0x24')](_0x1d51('0x20'),_0x219ded,_0x37e6e0[_0x1d51('0x24')]['message']);return _0x482c3e(_0x37e6e0[_0x1d51('0x24')]['message']);}logger[_0x1d51('0x24')](_0x1d51('0x20'),_0x219ded,_0x37e6e0['error'][_0x1d51('0x26')]);return _0x219037(_0x37e6e0[_0x1d51('0x24')][_0x1d51('0x26')]);}else{logger[_0x1d51('0x1f')](_0x1d51('0x20'),_0x219ded,_0x1d51('0x21'));_0x219037(_0x37e6e0['result']['message']);}})['catch'](function(_0x1552fc){logger[_0x1d51('0x24')]('Setting,\x20%s,\x20%s',_0x219ded,_0x1552fc);_0x482c3e(_0x1552fc);});});}function respondWithStatusCode(_0x5a1409,_0x38576f){_0x38576f=_0x38576f||0xcc;return function(_0x2b1cdd){if(_0x2b1cdd){return _0x5a1409[_0x1d51('0x27')](_0x38576f);}return _0x5a1409[_0x1d51('0x28')](_0x38576f)['end']();};}function respondWithResult(_0x3a11cf,_0x1bdc8f){_0x1bdc8f=_0x1bdc8f||0xc8;return function(_0x3f5750){if(_0x3f5750){return _0x3a11cf[_0x1d51('0x28')](_0x1bdc8f)[_0x1d51('0x29')](_0x3f5750);}};}function respondWithFilteredResult(_0x2b1aa9,_0x21014a){return function(_0x349da7){if(_0x349da7){var _0x57862a=_0x349da7[_0x1d51('0x2a')],_0x1f4de3=_0x21014a[_0x1d51('0x2b')],_0x10c041=_0x21014a[_0x1d51('0x2b')]+_0x21014a['limit'],_0x1b13fa;if(_0x10c041>=_0x57862a){_0x10c041=_0x57862a;_0x1b13fa=0xc8;}else{_0x1b13fa=0xce;}_0x2b1aa9['status'](_0x1b13fa);return _0x2b1aa9['set'](_0x1d51('0x2c'),_0x1f4de3+'-'+_0x10c041+'/'+_0x57862a)[_0x1d51('0x29')](_0x349da7);}return null;};}function patchUpdates(_0x33d537){return function(_0x1625d2){try{jsonpatch[_0x1d51('0x2d')](_0x1625d2,_0x33d537,!![]);}catch(_0x109788){return BPromise['reject'](_0x109788);}return _0x1625d2['save']();};}function saveUpdates(_0x111388,_0x2cc940){return function(_0x40d2ce){if(_0x40d2ce){return _0x40d2ce[_0x1d51('0x2e')](_0x111388)['then'](function(_0x448e81){return _0x448e81;});}return null;};}function removeEntity(_0x2cef76,_0x24b803){return function(_0x20342e){if(_0x20342e){return _0x20342e[_0x1d51('0x2f')]()[_0x1d51('0x1e')](function(){_0x2cef76[_0x1d51('0x28')](0xcc)[_0x1d51('0x30')]();});}};}function handleEntityNotFound(_0x565ac3,_0x55baf8){return function(_0x39d372){if(!_0x39d372){_0x565ac3[_0x1d51('0x27')](0x194);}return _0x39d372;};}function handleError(_0x5539d1,_0x491c2b){_0x491c2b=_0x491c2b||0x1f4;return function(_0x345394){logger[_0x1d51('0x24')](_0x345394['stack']);if(_0x345394[_0x1d51('0x31')]){delete _0x345394[_0x1d51('0x31')];}_0x5539d1[_0x1d51('0x28')](_0x491c2b)['send'](_0x345394);};}exports[_0x1d51('0x32')]=function(_0x12fcf6,_0x2a0086){var _0x40b564={},_0x41a26d={},_0x324d29={'count':0x0,'rows':[]};var _0x401154=_[_0x1d51('0x33')](db['Setting'][_0x1d51('0x34')],function(_0x331053){return{'name':_0x331053[_0x1d51('0x35')],'type':_0x331053[_0x1d51('0x36')][_0x1d51('0x37')]};});_0x41a26d[_0x1d51('0x38')]=_[_0x1d51('0x33')](_0x401154,_0x1d51('0x31'));_0x41a26d['query']=_[_0x1d51('0x39')](_0x12fcf6[_0x1d51('0x3a')]);_0x41a26d[_0x1d51('0x3b')]=_['intersection'](_0x41a26d[_0x1d51('0x38')],_0x41a26d[_0x1d51('0x3a')]);_0x40b564[_0x1d51('0x3c')]=_[_0x1d51('0x3d')](_0x41a26d[_0x1d51('0x38')],qs[_0x1d51('0x3e')](_0x12fcf6[_0x1d51('0x3a')][_0x1d51('0x3e')]));_0x40b564['attributes']=_0x40b564[_0x1d51('0x3c')][_0x1d51('0x3f')]?_0x40b564[_0x1d51('0x3c')]:_0x41a26d[_0x1d51('0x38')];if(!_0x12fcf6[_0x1d51('0x3a')]['hasOwnProperty'](_0x1d51('0x40'))){_0x40b564[_0x1d51('0x41')]=qs[_0x1d51('0x41')](_0x12fcf6['query']['limit']);_0x40b564[_0x1d51('0x2b')]=qs[_0x1d51('0x2b')](_0x12fcf6[_0x1d51('0x3a')][_0x1d51('0x2b')]);}_0x40b564[_0x1d51('0x42')]=qs[_0x1d51('0x43')](_0x12fcf6[_0x1d51('0x3a')][_0x1d51('0x43')]);_0x40b564[_0x1d51('0x44')]=qs[_0x1d51('0x3b')](_[_0x1d51('0x45')](_0x12fcf6[_0x1d51('0x3a')],_0x41a26d[_0x1d51('0x3b')]),_0x401154);if(_0x12fcf6[_0x1d51('0x3a')][_0x1d51('0x46')]){_0x40b564['where']=_[_0x1d51('0x47')](_0x40b564[_0x1d51('0x44')],{'$or':_[_0x1d51('0x33')](_0x401154,function(_0x535b58){if(_0x535b58[_0x1d51('0x36')]!==_0x1d51('0x48')){var _0x1a0b93={};_0x1a0b93[_0x535b58[_0x1d51('0x31')]]={'$like':'%'+_0x12fcf6[_0x1d51('0x3a')][_0x1d51('0x46')]+'%'};return _0x1a0b93;}})});}_0x40b564=_['merge']({},_0x40b564,_0x12fcf6[_0x1d51('0x49')]);var _0x20feb4={'where':_0x40b564['where']};return db[_0x1d51('0x4a')][_0x1d51('0x2a')](_0x20feb4)['then'](function(_0x557f19){_0x324d29[_0x1d51('0x2a')]=_0x557f19;if(_0x12fcf6[_0x1d51('0x3a')][_0x1d51('0x4b')]){_0x40b564[_0x1d51('0x4c')]=[{'all':!![]}];}return db['Setting'][_0x1d51('0x4d')](_0x40b564);})[_0x1d51('0x1e')](function(_0x17f503){_0x324d29['rows']=_0x17f503;return _0x324d29;})['then'](respondWithFilteredResult(_0x2a0086,_0x40b564))[_0x1d51('0x4e')](handleError(_0x2a0086,null));};exports[_0x1d51('0x4f')]=function(_0x589499,_0x1d6f6d){var _0x1f0f8={'raw':![],'where':{'id':_0x589499[_0x1d51('0x50')]['id']}},_0x24186e={};_0x24186e[_0x1d51('0x38')]=_[_0x1d51('0x39')](db['Setting'][_0x1d51('0x34')]);_0x24186e['query']=_[_0x1d51('0x39')](_0x589499[_0x1d51('0x3a')]);_0x24186e[_0x1d51('0x3b')]=_[_0x1d51('0x3d')](_0x24186e[_0x1d51('0x38')],_0x24186e[_0x1d51('0x3a')]);_0x1f0f8[_0x1d51('0x3c')]=_[_0x1d51('0x3d')](_0x24186e[_0x1d51('0x38')],qs['fields'](_0x589499[_0x1d51('0x3a')][_0x1d51('0x3e')]));_0x1f0f8[_0x1d51('0x3c')]=_0x1f0f8[_0x1d51('0x3c')][_0x1d51('0x3f')]?_0x1f0f8[_0x1d51('0x3c')]:_0x24186e[_0x1d51('0x38')];if(_0x589499[_0x1d51('0x3a')][_0x1d51('0x4b')]){_0x1f0f8[_0x1d51('0x4c')]=[{'all':!![]}];}_0x1f0f8=_['merge']({},_0x1f0f8,_0x589499[_0x1d51('0x49')]);return db[_0x1d51('0x4a')][_0x1d51('0x51')](_0x1f0f8)['then'](handleEntityNotFound(_0x1d6f6d,null))[_0x1d51('0x1e')](respondWithResult(_0x1d6f6d,null))[_0x1d51('0x4e')](handleError(_0x1d6f6d,null));};exports[_0x1d51('0x2e')]=function(_0x528d71,_0x27dce2){if(_0x528d71[_0x1d51('0x52')]['id']){delete _0x528d71[_0x1d51('0x52')]['id'];}return db['Setting'][_0x1d51('0x51')]({'where':{'id':_0x528d71[_0x1d51('0x50')]['id']}})[_0x1d51('0x1e')](handleEntityNotFound(_0x27dce2,null))[_0x1d51('0x1e')](saveUpdates(_0x528d71['body'],null))[_0x1d51('0x1e')](respondWithResult(_0x27dce2,null))[_0x1d51('0x4e')](handleError(_0x27dce2,null));};exports[_0x1d51('0x53')]=function(_0x523354,_0x22a70b,_0x313b5e){if(_0x523354['file']&&_0x523354['file'][_0x1d51('0x54')]){_0x523354[_0x1d51('0x52')][_0x1d51('0x55')]=_0x523354['file']['filename'];}return db[_0x1d51('0x4a')][_0x1d51('0x51')]({'where':{'id':_0x523354[_0x1d51('0x50')]['id']}})[_0x1d51('0x1e')](handleEntityNotFound(_0x22a70b,null))['then'](saveUpdates(_0x523354['body'],null))[_0x1d51('0x1e')](respondWithResult(_0x22a70b,null))[_0x1d51('0x4e')](handleError(_0x22a70b,null));};exports[_0x1d51('0x56')]=function(_0x5ec177,_0x16f5da,_0x48eb11){if(_0x5ec177[_0x1d51('0x57')]&&_0x5ec177[_0x1d51('0x57')][_0x1d51('0x54')]){_0x5ec177[_0x1d51('0x52')][_0x1d51('0x58')]=_0x5ec177[_0x1d51('0x57')][_0x1d51('0x54')];}return db[_0x1d51('0x4a')][_0x1d51('0x51')]({'where':{'id':_0x5ec177['params']['id']}})['then'](handleEntityNotFound(_0x16f5da,null))[_0x1d51('0x1e')](saveUpdates(_0x5ec177[_0x1d51('0x52')],null))[_0x1d51('0x1e')](respondWithResult(_0x16f5da,null))[_0x1d51('0x4e')](handleError(_0x16f5da,null));};var utilLicense=require(_0x1d51('0x59'));exports['getLogo']=function(_0x32dfd8,_0x1133f2,_0x2717d4){var _0x39413d=_0x1d51('0x5a');var _0x49fb99={'custom':![]};return utilLicense['getLicense']()[_0x1d51('0x1e')](function(_0x2e7bd8){if(_0x2e7bd8){_0x49fb99=_0x2e7bd8;}return db[_0x1d51('0x4a')][_0x1d51('0x51')]({'where':{'id':_0x32dfd8[_0x1d51('0x50')]['id']},'attributes':[_0x1d51('0x55'),_0x1d51('0x58'),_0x1d51('0x5b'),'favicon',_0x1d51('0x5c'),_0x1d51('0x5d'),'defaultPreferred','defaultFavicon'],'raw':!![]});})[_0x1d51('0x1e')](handleEntityNotFound(_0x1133f2,null))['then'](function(_0x4e8209){if(_0x4e8209){var _0x2e3aaf=_0x4e8209[_0x1d51('0x55')]&&fs['existsSync'](path[_0x1d51('0x5e')](config[_0x1d51('0x5f')],_0x39413d,_[_0x1d51('0x60')](_0x4e8209[_0x1d51('0x55')])))?path['join'](config['root'],_0x39413d,_['toLower'](_0x4e8209[_0x1d51('0x55')])):path[_0x1d51('0x5e')](config[_0x1d51('0x5f')],_0x39413d,_['toLower'](_0x1d51('0x61')));var _0x1312b7=_0x1d51('0x62')+_[_0x1d51('0x63')]('logo');if(_0x4e8209[_0x1312b7]||!_0x49fb99[_0x1d51('0x64')]){_0x2e3aaf=path[_0x1d51('0x5e')](config['root'],_0x39413d,_['toLower'](_0x1d51('0x61')));}if(!fs[_0x1d51('0x65')](_0x2e3aaf)){throw new db[(_0x1d51('0x1a'))][(_0x1d51('0x1b'))](_[_0x1d51('0x63')]('logo')+_0x1d51('0x66'));}return _0x1133f2['download'](_0x2e3aaf);}})[_0x1d51('0x4e')](handleError(_0x1133f2,null));};var utilLicense=require(_0x1d51('0x59'));exports[_0x1d51('0x67')]=function(_0x3d62f2,_0x112868,_0x5f098b){var _0x35bef4='server/files/images/logos';var _0x2ed7b3={'custom':![]};return utilLicense[_0x1d51('0x68')]()['then'](function(_0x252e22){if(_0x252e22){_0x2ed7b3=_0x252e22;}return db[_0x1d51('0x4a')][_0x1d51('0x51')]({'where':{'id':_0x3d62f2['params']['id']},'attributes':['logo','loginLogo','preferred',_0x1d51('0x69'),_0x1d51('0x5c'),'defaultLoginLogo',_0x1d51('0x6a'),_0x1d51('0x6b')],'raw':!![]});})['then'](handleEntityNotFound(_0x112868,null))[_0x1d51('0x1e')](function(_0x58b775){if(_0x58b775){var _0xcd4477=_0x58b775[_0x1d51('0x58')]&&fs['existsSync'](path[_0x1d51('0x5e')](config[_0x1d51('0x5f')],_0x35bef4,_[_0x1d51('0x60')](_0x58b775[_0x1d51('0x58')])))?path['join'](config[_0x1d51('0x5f')],_0x35bef4,_[_0x1d51('0x60')](_0x58b775['loginLogo'])):path[_0x1d51('0x5e')](config[_0x1d51('0x5f')],_0x35bef4,_[_0x1d51('0x60')](_0x1d51('0x6c')));var _0x274cc0=_0x1d51('0x62')+_[_0x1d51('0x63')](_0x1d51('0x58'));if(_0x58b775[_0x274cc0]||!_0x2ed7b3['custom']){_0xcd4477=path[_0x1d51('0x5e')](config[_0x1d51('0x5f')],_0x35bef4,_[_0x1d51('0x60')](_0x1d51('0x6c')));}if(!fs[_0x1d51('0x65')](_0xcd4477)){throw new db[(_0x1d51('0x1a'))]['ValidationError'](_[_0x1d51('0x63')](_0x1d51('0x58'))+'\x20not\x20found');}return _0x112868['download'](_0xcd4477);}})[_0x1d51('0x4e')](handleError(_0x112868,null));};exports[_0x1d51('0x6d')]=function(_0x14ce24,_0x22a3c4){return db[_0x1d51('0x4a')][_0x1d51('0x51')]({'where':{'id':_0x14ce24[_0x1d51('0x50')]['id']},'attributes':['securePassword']})['then'](respondWithResult(_0x22a3c4,null))[_0x1d51('0x4e')](handleError(_0x22a3c4,null));};exports[_0x1d51('0x6e')]=function(_0xb57517,_0x29be5a,_0x582fb9){if(_0xb57517[_0x1d51('0x57')]&&_0xb57517[_0x1d51('0x57')][_0x1d51('0x54')]){_0xb57517[_0x1d51('0x52')][_0x1d51('0x5b')]=_0xb57517[_0x1d51('0x57')][_0x1d51('0x54')];}return db[_0x1d51('0x4a')][_0x1d51('0x51')]({'where':{'id':_0xb57517[_0x1d51('0x50')]['id']}})[_0x1d51('0x1e')](handleEntityNotFound(_0x29be5a,null))[_0x1d51('0x1e')](saveUpdates(_0xb57517[_0x1d51('0x52')],null))['then'](respondWithResult(_0x29be5a,null))[_0x1d51('0x4e')](handleError(_0x29be5a,null));};var utilLicense=require('../../config/license/util');exports['getPreferred']=function(_0x3086cc,_0x559034,_0x3eac89){var _0x4a99ff=_0x1d51('0x5a');var _0x47b76d={'custom':![]};return utilLicense[_0x1d51('0x68')]()[_0x1d51('0x1e')](function(_0x5129e8){if(_0x5129e8){_0x47b76d=_0x5129e8;}return db[_0x1d51('0x4a')][_0x1d51('0x51')]({'where':{'id':_0x3086cc[_0x1d51('0x50')]['id']},'attributes':['logo',_0x1d51('0x58'),_0x1d51('0x5b'),_0x1d51('0x69'),_0x1d51('0x5c'),'defaultLoginLogo',_0x1d51('0x6a'),'defaultFavicon'],'raw':!![]});})[_0x1d51('0x1e')](handleEntityNotFound(_0x559034,null))['then'](function(_0x158895){if(_0x158895){var _0x55b32e=_0x158895['preferred']&&fs[_0x1d51('0x65')](path['join'](config[_0x1d51('0x5f')],_0x4a99ff,_['toLower'](_0x158895['preferred'])))?path[_0x1d51('0x5e')](config[_0x1d51('0x5f')],_0x4a99ff,_[_0x1d51('0x60')](_0x158895[_0x1d51('0x5b')])):path[_0x1d51('0x5e')](config['root'],_0x4a99ff,_['toLower']('default_preferred.png'));var _0xa13c9d=_0x1d51('0x62')+_['upperFirst'](_0x1d51('0x5b'));if(_0x158895[_0xa13c9d]||!_0x47b76d[_0x1d51('0x64')]||!_0x47b76d['preferred']){_0x55b32e=path[_0x1d51('0x5e')](config[_0x1d51('0x5f')],_0x4a99ff,_[_0x1d51('0x60')]('default_preferred.png'));}if(!fs['existsSync'](_0x55b32e)){throw new db[(_0x1d51('0x1a'))][(_0x1d51('0x1b'))](_['upperFirst']('preferred')+'\x20not\x20found');}return _0x559034[_0x1d51('0x6f')](_0x55b32e);}})[_0x1d51('0x4e')](handleError(_0x559034,null));};exports[_0x1d51('0x70')]=function(_0x1d0061,_0x34fce3,_0x479b59){if(_0x1d0061[_0x1d51('0x57')]&&_0x1d0061['file'][_0x1d51('0x54')]){_0x1d0061[_0x1d51('0x52')][_0x1d51('0x69')]=_0x1d0061[_0x1d51('0x57')]['filename'];}return db[_0x1d51('0x4a')][_0x1d51('0x51')]({'where':{'id':_0x1d0061[_0x1d51('0x50')]['id']}})[_0x1d51('0x1e')](handleEntityNotFound(_0x34fce3,null))[_0x1d51('0x1e')](saveUpdates(_0x1d0061[_0x1d51('0x52')],null))[_0x1d51('0x1e')](respondWithResult(_0x34fce3,null))[_0x1d51('0x4e')](handleError(_0x34fce3,null));};var utilLicense=require(_0x1d51('0x59'));exports[_0x1d51('0x71')]=function(_0x5147fa,_0x1a889d,_0x2038f5){var _0x510b5f='server/files/images/logos';var _0x3e977a={'custom':![]};return utilLicense[_0x1d51('0x68')]()['then'](function(_0x2013af){if(_0x2013af){_0x3e977a=_0x2013af;}return db[_0x1d51('0x4a')][_0x1d51('0x51')]({'where':{'id':_0x5147fa['params']['id']},'attributes':[_0x1d51('0x55'),_0x1d51('0x58'),_0x1d51('0x5b'),_0x1d51('0x69'),'defaultLogo',_0x1d51('0x5d'),_0x1d51('0x6a'),_0x1d51('0x6b')],'raw':!![]});})[_0x1d51('0x1e')](handleEntityNotFound(_0x1a889d,null))[_0x1d51('0x1e')](function(_0x1f8a5d){if(_0x1f8a5d){var _0x53a645=_0x1f8a5d[_0x1d51('0x69')]&&fs['existsSync'](path[_0x1d51('0x5e')](config['root'],_0x510b5f,_[_0x1d51('0x60')](_0x1f8a5d['favicon'])))?path[_0x1d51('0x5e')](config['root'],_0x510b5f,_[_0x1d51('0x60')](_0x1f8a5d['favicon'])):path[_0x1d51('0x5e')](config['root'],_0x510b5f,_[_0x1d51('0x60')]('default_favicon.ico'));var _0x3a5a90=_0x1d51('0x62')+_[_0x1d51('0x63')]('favicon');if(_0x1f8a5d[_0x3a5a90]||!_0x3e977a[_0x1d51('0x64')]){_0x53a645=path['join'](config['root'],_0x510b5f,_['toLower'](_0x1d51('0x72')));}if(!fs[_0x1d51('0x65')](_0x53a645)){throw new db[(_0x1d51('0x1a'))][(_0x1d51('0x1b'))](_['upperFirst'](_0x1d51('0x69'))+_0x1d51('0x66'));}return _0x1a889d[_0x1d51('0x6f')](_0x53a645);}})[_0x1d51('0x4e')](handleError(_0x1a889d,null));};
\ No newline at end of file
+var _0x6a33=['papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','client','test','Sequelize','ValidationError','request','then','info','Setting,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','sendStatus','status','end','json','offset','limit','set','Content-Range','apply','reject','destroy','name','send','index','map','rawAttributes','fieldName','type','model','query','keys','attributes','intersection','fields','hasOwnProperty','order','sort','where','filters','filter','VIRTUAL','merge','options','Setting','count','includeAll','findAll','params','length','include','find','update','body','file','filename','logo','loginLogo','../../config/license/util','getLogo','server/files/images/logos','getLicense','favicon','defaultLogo','defaultLoginLogo','defaultPreferred','existsSync','join','root','toLower','default_logo.svg','default','upperFirst','\x20not\x20found','getLogoLogin','default_loginLogo.svg','custom','download','gdpr','securePassword','preferred','getPreferred','defaultFavicon','default_preferred.png','getFavicon','default_favicon.ico','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','squel','jsforce','querystring'];(function(_0x333598,_0x560c90){var _0x2f4acb=function(_0x275a3b){while(--_0x275a3b){_0x333598['push'](_0x333598['shift']());}};_0x2f4acb(++_0x560c90);}(_0x6a33,0x1b6));var _0x36a3=function(_0x1203f,_0x554bbc){_0x1203f=_0x1203f-0x0;var _0x365f0a=_0x6a33[_0x1203f];return _0x365f0a;};'use strict';var pdf=require(_0x36a3('0x0'));var emlformat=require(_0x36a3('0x1'));var rimraf=require(_0x36a3('0x2'));var zipdir=require(_0x36a3('0x3'));var jsonpatch=require(_0x36a3('0x4'));var rp=require(_0x36a3('0x5'));var moment=require('moment');var BPromise=require(_0x36a3('0x6'));var Mustache=require(_0x36a3('0x7'));var util=require('util');var path=require(_0x36a3('0x8'));var sox=require(_0x36a3('0x9'));var csv=require(_0x36a3('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x36a3('0xb'));var crypto=require('crypto');var jsforce=require(_0x36a3('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x36a3('0xa'));var querystring=require(_0x36a3('0xd'));var Papa=require(_0x36a3('0xe'));var Redis=require('ioredis');var authService=require(_0x36a3('0xf'));var qs=require(_0x36a3('0x10'));var as=require(_0x36a3('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x36a3('0x12'))('api');var utils=require(_0x36a3('0x13'));var config=require(_0x36a3('0x14'));var db=require(_0x36a3('0x15'))['db'];var jayson=require(_0x36a3('0x16'));var client=jayson[_0x36a3('0x17')]['http']({'port':0x232a});function checkPasswordPattern(_0x4f6798,_0x268319,_0x546682){if(_0x546682){var _0x23e360=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x23e360[_0x36a3('0x18')](_0x268319)){return _0x4f6798;}else{throw new db[(_0x36a3('0x19'))][(_0x36a3('0x1a'))]('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x4f6798;}}function respondWithRpcPromise(_0x291205,_0x1d5191,_0x312cfb,_0x51eb29){return new BPromise(function(_0x4ba18b,_0x852359){var _0xbb8079=_0x51eb29||client;return _0xbb8079[_0x36a3('0x1b')](_0x291205,_0x312cfb)[_0x36a3('0x1c')](function(_0x5ce4b9){logger[_0x36a3('0x1d')](_0x36a3('0x1e'),_0x1d5191,_0x36a3('0x1f'));logger[_0x36a3('0x20')]('Setting,\x20%s,\x20%s,\x20%s',_0x1d5191,_0x36a3('0x1f'),JSON[_0x36a3('0x21')](_0x5ce4b9));if(_0x5ce4b9[_0x36a3('0x22')]){if(_0x5ce4b9[_0x36a3('0x22')]['code']===0x1f4){logger[_0x36a3('0x22')]('Setting,\x20%s,\x20%s',_0x1d5191,_0x5ce4b9[_0x36a3('0x22')][_0x36a3('0x23')]);return _0x852359(_0x5ce4b9[_0x36a3('0x22')][_0x36a3('0x23')]);}logger[_0x36a3('0x22')](_0x36a3('0x1e'),_0x1d5191,_0x5ce4b9[_0x36a3('0x22')][_0x36a3('0x23')]);return _0x4ba18b(_0x5ce4b9[_0x36a3('0x22')]['message']);}else{logger[_0x36a3('0x1d')](_0x36a3('0x1e'),_0x1d5191,_0x36a3('0x1f'));_0x4ba18b(_0x5ce4b9[_0x36a3('0x24')][_0x36a3('0x23')]);}})[_0x36a3('0x25')](function(_0x1e4404){logger[_0x36a3('0x22')](_0x36a3('0x1e'),_0x1d5191,_0x1e4404);_0x852359(_0x1e4404);});});}function respondWithStatusCode(_0x30741c,_0x326fc4){_0x326fc4=_0x326fc4||0xcc;return function(_0x574d24){if(_0x574d24){return _0x30741c[_0x36a3('0x26')](_0x326fc4);}return _0x30741c[_0x36a3('0x27')](_0x326fc4)[_0x36a3('0x28')]();};}function respondWithResult(_0x3f2a82,_0x2137c6){_0x2137c6=_0x2137c6||0xc8;return function(_0x52d0cc){if(_0x52d0cc){return _0x3f2a82[_0x36a3('0x27')](_0x2137c6)[_0x36a3('0x29')](_0x52d0cc);}};}function respondWithFilteredResult(_0x435a48,_0x12b4fe){return function(_0x588b4e){if(_0x588b4e){var _0x1261d6=_0x588b4e['count'],_0x76eb3b=_0x12b4fe[_0x36a3('0x2a')],_0x33e7d6=_0x12b4fe[_0x36a3('0x2a')]+_0x12b4fe[_0x36a3('0x2b')],_0x10738b;if(_0x33e7d6>=_0x1261d6){_0x33e7d6=_0x1261d6;_0x10738b=0xc8;}else{_0x10738b=0xce;}_0x435a48[_0x36a3('0x27')](_0x10738b);return _0x435a48[_0x36a3('0x2c')](_0x36a3('0x2d'),_0x76eb3b+'-'+_0x33e7d6+'/'+_0x1261d6)[_0x36a3('0x29')](_0x588b4e);}return null;};}function patchUpdates(_0x44ead0){return function(_0x13f331){try{jsonpatch[_0x36a3('0x2e')](_0x13f331,_0x44ead0,!![]);}catch(_0x59b6ed){return BPromise[_0x36a3('0x2f')](_0x59b6ed);}return _0x13f331['save']();};}function saveUpdates(_0x5ee657,_0x2badc8){return function(_0x480106){if(_0x480106){return _0x480106['update'](_0x5ee657)[_0x36a3('0x1c')](function(_0x4bcf83){return _0x4bcf83;});}return null;};}function removeEntity(_0x3e829a,_0x52c0e5){return function(_0x152b5c){if(_0x152b5c){return _0x152b5c[_0x36a3('0x30')]()['then'](function(){_0x3e829a[_0x36a3('0x27')](0xcc)[_0x36a3('0x28')]();});}};}function handleEntityNotFound(_0x50d245,_0x1ca27d){return function(_0x118df6){if(!_0x118df6){_0x50d245[_0x36a3('0x26')](0x194);}return _0x118df6;};}function handleError(_0x21f6f4,_0x467576){_0x467576=_0x467576||0x1f4;return function(_0x449ef2){logger['error'](_0x449ef2['stack']);if(_0x449ef2[_0x36a3('0x31')]){delete _0x449ef2[_0x36a3('0x31')];}_0x21f6f4[_0x36a3('0x27')](_0x467576)[_0x36a3('0x32')](_0x449ef2);};}exports[_0x36a3('0x33')]=function(_0x5a14ae,_0x7a58e2){var _0x527e90={},_0x90ddb7={},_0x381f5c={'count':0x0,'rows':[]};var _0x8ad100=_[_0x36a3('0x34')](db['Setting'][_0x36a3('0x35')],function(_0x44f3b9){return{'name':_0x44f3b9[_0x36a3('0x36')],'type':_0x44f3b9[_0x36a3('0x37')]['key']};});_0x90ddb7[_0x36a3('0x38')]=_[_0x36a3('0x34')](_0x8ad100,_0x36a3('0x31'));_0x90ddb7[_0x36a3('0x39')]=_[_0x36a3('0x3a')](_0x5a14ae[_0x36a3('0x39')]);_0x90ddb7['filters']=_['intersection'](_0x90ddb7[_0x36a3('0x38')],_0x90ddb7[_0x36a3('0x39')]);_0x527e90[_0x36a3('0x3b')]=_[_0x36a3('0x3c')](_0x90ddb7[_0x36a3('0x38')],qs['fields'](_0x5a14ae[_0x36a3('0x39')][_0x36a3('0x3d')]));_0x527e90[_0x36a3('0x3b')]=_0x527e90[_0x36a3('0x3b')]['length']?_0x527e90[_0x36a3('0x3b')]:_0x90ddb7['model'];if(!_0x5a14ae['query'][_0x36a3('0x3e')]('nolimit')){_0x527e90['limit']=qs[_0x36a3('0x2b')](_0x5a14ae[_0x36a3('0x39')][_0x36a3('0x2b')]);_0x527e90[_0x36a3('0x2a')]=qs['offset'](_0x5a14ae[_0x36a3('0x39')][_0x36a3('0x2a')]);}_0x527e90[_0x36a3('0x3f')]=qs[_0x36a3('0x40')](_0x5a14ae[_0x36a3('0x39')][_0x36a3('0x40')]);_0x527e90[_0x36a3('0x41')]=qs['filters'](_['pick'](_0x5a14ae[_0x36a3('0x39')],_0x90ddb7[_0x36a3('0x42')]),_0x8ad100);if(_0x5a14ae[_0x36a3('0x39')][_0x36a3('0x43')]){_0x527e90[_0x36a3('0x41')]=_['merge'](_0x527e90[_0x36a3('0x41')],{'$or':_[_0x36a3('0x34')](_0x8ad100,function(_0x3e9316){if(_0x3e9316[_0x36a3('0x37')]!==_0x36a3('0x44')){var _0x182c1a={};_0x182c1a[_0x3e9316[_0x36a3('0x31')]]={'$like':'%'+_0x5a14ae[_0x36a3('0x39')]['filter']+'%'};return _0x182c1a;}})});}_0x527e90=_[_0x36a3('0x45')]({},_0x527e90,_0x5a14ae[_0x36a3('0x46')]);var _0x5104e7={'where':_0x527e90[_0x36a3('0x41')]};return db[_0x36a3('0x47')][_0x36a3('0x48')](_0x5104e7)[_0x36a3('0x1c')](function(_0x4bef5f){_0x381f5c['count']=_0x4bef5f;if(_0x5a14ae[_0x36a3('0x39')][_0x36a3('0x49')]){_0x527e90['include']=[{'all':!![]}];}return db[_0x36a3('0x47')][_0x36a3('0x4a')](_0x527e90);})[_0x36a3('0x1c')](function(_0x5c1dea){_0x381f5c['rows']=_0x5c1dea;return _0x381f5c;})[_0x36a3('0x1c')](respondWithFilteredResult(_0x7a58e2,_0x527e90))[_0x36a3('0x25')](handleError(_0x7a58e2,null));};exports['show']=function(_0x1cdaa0,_0x490af5){var _0x41fdd0={'raw':![],'where':{'id':_0x1cdaa0[_0x36a3('0x4b')]['id']}},_0x1561a3={};_0x1561a3['model']=_['keys'](db['Setting'][_0x36a3('0x35')]);_0x1561a3[_0x36a3('0x39')]=_[_0x36a3('0x3a')](_0x1cdaa0[_0x36a3('0x39')]);_0x1561a3[_0x36a3('0x42')]=_[_0x36a3('0x3c')](_0x1561a3[_0x36a3('0x38')],_0x1561a3[_0x36a3('0x39')]);_0x41fdd0['attributes']=_[_0x36a3('0x3c')](_0x1561a3[_0x36a3('0x38')],qs[_0x36a3('0x3d')](_0x1cdaa0[_0x36a3('0x39')][_0x36a3('0x3d')]));_0x41fdd0['attributes']=_0x41fdd0[_0x36a3('0x3b')][_0x36a3('0x4c')]?_0x41fdd0[_0x36a3('0x3b')]:_0x1561a3['model'];if(_0x1cdaa0[_0x36a3('0x39')]['includeAll']){_0x41fdd0[_0x36a3('0x4d')]=[{'all':!![]}];}_0x41fdd0=_[_0x36a3('0x45')]({},_0x41fdd0,_0x1cdaa0[_0x36a3('0x46')]);return db[_0x36a3('0x47')][_0x36a3('0x4e')](_0x41fdd0)['then'](handleEntityNotFound(_0x490af5,null))[_0x36a3('0x1c')](respondWithResult(_0x490af5,null))[_0x36a3('0x25')](handleError(_0x490af5,null));};exports[_0x36a3('0x4f')]=function(_0x3ac8a9,_0x357c52){if(_0x3ac8a9['body']['id']){delete _0x3ac8a9[_0x36a3('0x50')]['id'];}return db[_0x36a3('0x47')][_0x36a3('0x4e')]({'where':{'id':_0x3ac8a9[_0x36a3('0x4b')]['id']}})['then'](handleEntityNotFound(_0x357c52,null))[_0x36a3('0x1c')](saveUpdates(_0x3ac8a9['body'],null))['then'](respondWithResult(_0x357c52,null))['catch'](handleError(_0x357c52,null));};exports['addLogo']=function(_0x418215,_0x25cd83,_0xbbc46c){if(_0x418215[_0x36a3('0x51')]&&_0x418215[_0x36a3('0x51')][_0x36a3('0x52')]){_0x418215['body'][_0x36a3('0x53')]=_0x418215[_0x36a3('0x51')][_0x36a3('0x52')];}return db[_0x36a3('0x47')]['find']({'where':{'id':_0x418215['params']['id']}})['then'](handleEntityNotFound(_0x25cd83,null))[_0x36a3('0x1c')](saveUpdates(_0x418215[_0x36a3('0x50')],null))['then'](respondWithResult(_0x25cd83,null))[_0x36a3('0x25')](handleError(_0x25cd83,null));};exports['addLogoLogin']=function(_0xf5a752,_0x27463b,_0x59db1b){if(_0xf5a752[_0x36a3('0x51')]&&_0xf5a752[_0x36a3('0x51')][_0x36a3('0x52')]){_0xf5a752[_0x36a3('0x50')][_0x36a3('0x54')]=_0xf5a752['file'][_0x36a3('0x52')];}return db['Setting'][_0x36a3('0x4e')]({'where':{'id':_0xf5a752[_0x36a3('0x4b')]['id']}})['then'](handleEntityNotFound(_0x27463b,null))['then'](saveUpdates(_0xf5a752[_0x36a3('0x50')],null))[_0x36a3('0x1c')](respondWithResult(_0x27463b,null))['catch'](handleError(_0x27463b,null));};var utilLicense=require(_0x36a3('0x55'));exports[_0x36a3('0x56')]=function(_0x32075a,_0x38253d,_0x57a01d){var _0x6e2d5c=_0x36a3('0x57');var _0x551814={'custom':![]};return utilLicense[_0x36a3('0x58')]()[_0x36a3('0x1c')](function(_0x89288){if(_0x89288){_0x551814=_0x89288;}return db['Setting'][_0x36a3('0x4e')]({'where':{'id':_0x32075a[_0x36a3('0x4b')]['id']},'attributes':['logo',_0x36a3('0x54'),'preferred',_0x36a3('0x59'),_0x36a3('0x5a'),_0x36a3('0x5b'),_0x36a3('0x5c'),'defaultFavicon'],'raw':!![]});})['then'](handleEntityNotFound(_0x38253d,null))[_0x36a3('0x1c')](function(_0x109f51){if(_0x109f51){var _0x41b8ce=_0x109f51[_0x36a3('0x53')]&&fs[_0x36a3('0x5d')](path[_0x36a3('0x5e')](config[_0x36a3('0x5f')],_0x6e2d5c,_[_0x36a3('0x60')](_0x109f51['logo'])))?path[_0x36a3('0x5e')](config[_0x36a3('0x5f')],_0x6e2d5c,_[_0x36a3('0x60')](_0x109f51[_0x36a3('0x53')])):path[_0x36a3('0x5e')](config[_0x36a3('0x5f')],_0x6e2d5c,_['toLower'](_0x36a3('0x61')));var _0x134fb2=_0x36a3('0x62')+_[_0x36a3('0x63')]('logo');if(_0x109f51[_0x134fb2]||!_0x551814['custom']){_0x41b8ce=path[_0x36a3('0x5e')](config[_0x36a3('0x5f')],_0x6e2d5c,_[_0x36a3('0x60')]('default_logo.svg'));}if(!fs[_0x36a3('0x5d')](_0x41b8ce)){throw new db[(_0x36a3('0x19'))][(_0x36a3('0x1a'))](_[_0x36a3('0x63')](_0x36a3('0x53'))+_0x36a3('0x64'));}return _0x38253d['download'](_0x41b8ce);}})['catch'](handleError(_0x38253d,null));};var utilLicense=require('../../config/license/util');exports[_0x36a3('0x65')]=function(_0x596575,_0x595798,_0x45c4a3){var _0x163964=_0x36a3('0x57');var _0x5a1faa={'custom':![]};return utilLicense[_0x36a3('0x58')]()[_0x36a3('0x1c')](function(_0x1c7b6b){if(_0x1c7b6b){_0x5a1faa=_0x1c7b6b;}return db[_0x36a3('0x47')][_0x36a3('0x4e')]({'where':{'id':_0x596575['params']['id']},'attributes':[_0x36a3('0x53'),_0x36a3('0x54'),'preferred',_0x36a3('0x59'),_0x36a3('0x5a'),'defaultLoginLogo',_0x36a3('0x5c'),'defaultFavicon'],'raw':!![]});})['then'](handleEntityNotFound(_0x595798,null))[_0x36a3('0x1c')](function(_0x277d7c){if(_0x277d7c){var _0x5c125a=_0x277d7c[_0x36a3('0x54')]&&fs['existsSync'](path[_0x36a3('0x5e')](config[_0x36a3('0x5f')],_0x163964,_[_0x36a3('0x60')](_0x277d7c[_0x36a3('0x54')])))?path[_0x36a3('0x5e')](config[_0x36a3('0x5f')],_0x163964,_[_0x36a3('0x60')](_0x277d7c['loginLogo'])):path[_0x36a3('0x5e')](config[_0x36a3('0x5f')],_0x163964,_[_0x36a3('0x60')](_0x36a3('0x66')));var _0x1a5215=_0x36a3('0x62')+_[_0x36a3('0x63')](_0x36a3('0x54'));if(_0x277d7c[_0x1a5215]||!_0x5a1faa[_0x36a3('0x67')]){_0x5c125a=path['join'](config['root'],_0x163964,_[_0x36a3('0x60')](_0x36a3('0x66')));}if(!fs[_0x36a3('0x5d')](_0x5c125a)){throw new db[(_0x36a3('0x19'))]['ValidationError'](_[_0x36a3('0x63')](_0x36a3('0x54'))+'\x20not\x20found');}return _0x595798[_0x36a3('0x68')](_0x5c125a);}})[_0x36a3('0x25')](handleError(_0x595798,null));};exports[_0x36a3('0x69')]=function(_0x410011,_0x481013){return db[_0x36a3('0x47')][_0x36a3('0x4e')]({'where':{'id':_0x410011[_0x36a3('0x4b')]['id']},'attributes':[_0x36a3('0x6a')]})[_0x36a3('0x1c')](respondWithResult(_0x481013,null))[_0x36a3('0x25')](handleError(_0x481013,null));};exports['addPreferred']=function(_0x5da72b,_0x2f6349,_0x4a08ce){if(_0x5da72b['file']&&_0x5da72b[_0x36a3('0x51')][_0x36a3('0x52')]){_0x5da72b[_0x36a3('0x50')][_0x36a3('0x6b')]=_0x5da72b['file'][_0x36a3('0x52')];}return db[_0x36a3('0x47')][_0x36a3('0x4e')]({'where':{'id':_0x5da72b[_0x36a3('0x4b')]['id']}})['then'](handleEntityNotFound(_0x2f6349,null))['then'](saveUpdates(_0x5da72b['body'],null))[_0x36a3('0x1c')](respondWithResult(_0x2f6349,null))[_0x36a3('0x25')](handleError(_0x2f6349,null));};var utilLicense=require(_0x36a3('0x55'));exports[_0x36a3('0x6c')]=function(_0x3020fa,_0x1fe74b,_0xa1b62b){var _0x56f7e4='server/files/images/logos';var _0x48f4fe={'custom':![]};return utilLicense['getLicense']()['then'](function(_0x47616c){if(_0x47616c){_0x48f4fe=_0x47616c;}return db['Setting']['find']({'where':{'id':_0x3020fa[_0x36a3('0x4b')]['id']},'attributes':[_0x36a3('0x53'),_0x36a3('0x54'),_0x36a3('0x6b'),_0x36a3('0x59'),_0x36a3('0x5a'),'defaultLoginLogo',_0x36a3('0x5c'),_0x36a3('0x6d')],'raw':!![]});})[_0x36a3('0x1c')](handleEntityNotFound(_0x1fe74b,null))[_0x36a3('0x1c')](function(_0x18bfe2){if(_0x18bfe2){var _0x4fd802=_0x18bfe2[_0x36a3('0x6b')]&&fs[_0x36a3('0x5d')](path[_0x36a3('0x5e')](config[_0x36a3('0x5f')],_0x56f7e4,_[_0x36a3('0x60')](_0x18bfe2[_0x36a3('0x6b')])))?path['join'](config['root'],_0x56f7e4,_[_0x36a3('0x60')](_0x18bfe2[_0x36a3('0x6b')])):path[_0x36a3('0x5e')](config[_0x36a3('0x5f')],_0x56f7e4,_[_0x36a3('0x60')]('default_preferred.png'));var _0x194041=_0x36a3('0x62')+_[_0x36a3('0x63')](_0x36a3('0x6b'));if(_0x18bfe2[_0x194041]||!_0x48f4fe[_0x36a3('0x67')]||!_0x48f4fe[_0x36a3('0x6b')]){_0x4fd802=path[_0x36a3('0x5e')](config[_0x36a3('0x5f')],_0x56f7e4,_['toLower'](_0x36a3('0x6e')));}if(!fs[_0x36a3('0x5d')](_0x4fd802)){throw new db['Sequelize'][(_0x36a3('0x1a'))](_[_0x36a3('0x63')](_0x36a3('0x6b'))+_0x36a3('0x64'));}return _0x1fe74b[_0x36a3('0x68')](_0x4fd802);}})[_0x36a3('0x25')](handleError(_0x1fe74b,null));};exports['addFavicon']=function(_0x24e213,_0x180897,_0x36db36){if(_0x24e213['file']&&_0x24e213[_0x36a3('0x51')][_0x36a3('0x52')]){_0x24e213[_0x36a3('0x50')][_0x36a3('0x59')]=_0x24e213['file'][_0x36a3('0x52')];}return db[_0x36a3('0x47')][_0x36a3('0x4e')]({'where':{'id':_0x24e213[_0x36a3('0x4b')]['id']}})[_0x36a3('0x1c')](handleEntityNotFound(_0x180897,null))['then'](saveUpdates(_0x24e213['body'],null))['then'](respondWithResult(_0x180897,null))[_0x36a3('0x25')](handleError(_0x180897,null));};var utilLicense=require('../../config/license/util');exports[_0x36a3('0x6f')]=function(_0x2dd13c,_0x442f5a,_0x2ad260){var _0x4ccf77=_0x36a3('0x57');var _0x315236={'custom':![]};return utilLicense[_0x36a3('0x58')]()[_0x36a3('0x1c')](function(_0x5f1b54){if(_0x5f1b54){_0x315236=_0x5f1b54;}return db[_0x36a3('0x47')][_0x36a3('0x4e')]({'where':{'id':_0x2dd13c[_0x36a3('0x4b')]['id']},'attributes':[_0x36a3('0x53'),_0x36a3('0x54'),_0x36a3('0x6b'),_0x36a3('0x59'),_0x36a3('0x5a'),'defaultLoginLogo','defaultPreferred',_0x36a3('0x6d')],'raw':!![]});})[_0x36a3('0x1c')](handleEntityNotFound(_0x442f5a,null))['then'](function(_0x516b0e){if(_0x516b0e){var _0x5b0428=_0x516b0e[_0x36a3('0x59')]&&fs['existsSync'](path['join'](config[_0x36a3('0x5f')],_0x4ccf77,_[_0x36a3('0x60')](_0x516b0e[_0x36a3('0x59')])))?path[_0x36a3('0x5e')](config[_0x36a3('0x5f')],_0x4ccf77,_['toLower'](_0x516b0e[_0x36a3('0x59')])):path[_0x36a3('0x5e')](config['root'],_0x4ccf77,_[_0x36a3('0x60')](_0x36a3('0x70')));var _0x3af6ff=_0x36a3('0x62')+_[_0x36a3('0x63')](_0x36a3('0x59'));if(_0x516b0e[_0x3af6ff]||!_0x315236[_0x36a3('0x67')]){_0x5b0428=path[_0x36a3('0x5e')](config[_0x36a3('0x5f')],_0x4ccf77,_['toLower'](_0x36a3('0x70')));}if(!fs[_0x36a3('0x5d')](_0x5b0428)){throw new db[(_0x36a3('0x19'))][(_0x36a3('0x1a'))](_['upperFirst'](_0x36a3('0x59'))+'\x20not\x20found');}return _0x442f5a[_0x36a3('0x68')](_0x5b0428);}})[_0x36a3('0x25')](handleError(_0x442f5a,null));};
\ No newline at end of file
diff --git a/server/api/setting/setting.model.js b/server/api/setting/setting.model.js
index b626c45..cf6300d 100644
--- a/server/api/setting/setting.model.js
+++ b/server/api/setting/setting.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xff24=['util','api','moment','request-promise','path','rimraf','../../config/environment','./setting.attributes','exports','Setting'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xff24,0x17c));var _0x4ff2=function(_0x5c575d,_0x354f54){_0x5c575d=_0x5c575d-0x0;var _0x37c3e5=_0xff24[_0x5c575d];return _0x37c3e5;};'use strict';var _=require('lodash');var util=require(_0x4ff2('0x0'));var logger=require('../../config/logger')(_0x4ff2('0x1'));var moment=require(_0x4ff2('0x2'));var BPromise=require('bluebird');var rp=require(_0x4ff2('0x3'));var fs=require('fs');var path=require(_0x4ff2('0x4'));var rimraf=require(_0x4ff2('0x5'));var config=require(_0x4ff2('0x6'));var attributes=require(_0x4ff2('0x7'));module[_0x4ff2('0x8')]=function(_0x1173c0,_0x2129a1){return _0x1173c0['define'](_0x4ff2('0x9'),attributes,{'tableName':'settings','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x79e2=['moment','bluebird','request-promise','rimraf','../../config/environment','./setting.attributes','exports','define','Setting','settings','lodash','util'];(function(_0x45c764,_0x5f13ef){var _0x82d5b2=function(_0x4a8cae){while(--_0x4a8cae){_0x45c764['push'](_0x45c764['shift']());}};_0x82d5b2(++_0x5f13ef);}(_0x79e2,0xbe));var _0x279e=function(_0x297aa6,_0x2f8f03){_0x297aa6=_0x297aa6-0x0;var _0x45f0ba=_0x79e2[_0x297aa6];return _0x45f0ba;};'use strict';var _=require(_0x279e('0x0'));var util=require(_0x279e('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x279e('0x2'));var BPromise=require(_0x279e('0x3'));var rp=require(_0x279e('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x279e('0x5'));var config=require(_0x279e('0x6'));var attributes=require(_0x279e('0x7'));module[_0x279e('0x8')]=function(_0x549a19,_0x31d315){return _0x549a19[_0x279e('0x9')](_0x279e('0xa'),attributes,{'tableName':_0x279e('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/setting/setting.rpc.js b/server/api/setting/setting.rpc.js
index e96f494..e0c033f 100644
--- a/server/api/setting/setting.rpc.js
+++ b/server/api/setting/setting.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x29ab=['../../config/environment','client','http','then','info','Setting,\x20%s,\x20%s','request\x20sent','debug','Setting,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x3f39da,_0x53cf8b){var _0x56d550=function(_0x15ccda){while(--_0x15ccda){_0x3f39da['push'](_0x3f39da['shift']());}};_0x56d550(++_0x53cf8b);}(_0x29ab,0x189));var _0xb29a=function(_0x436d63,_0x194f8b){_0x436d63=_0x436d63-0x0;var _0x200e83=_0x29ab[_0x436d63];return _0x200e83;};'use strict';var _=require('lodash');var util=require(_0xb29a('0x0'));var moment=require(_0xb29a('0x1'));var BPromise=require(_0xb29a('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb29a('0x3'));var db=require(_0xb29a('0x4'))['db'];var utils=require(_0xb29a('0x5'));var logger=require(_0xb29a('0x6'))('rpc');var config=require(_0xb29a('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xb29a('0x8')][_0xb29a('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x352666,_0x39c1d6,_0xdaf432){return new BPromise(function(_0x31abd3,_0x28c7a0){return client['request'](_0x352666,_0xdaf432)[_0xb29a('0xa')](function(_0x148df6){logger[_0xb29a('0xb')](_0xb29a('0xc'),_0x39c1d6,_0xb29a('0xd'));logger[_0xb29a('0xe')](_0xb29a('0xf'),_0x39c1d6,'request\x20sent',JSON[_0xb29a('0x10')](_0x148df6));if(_0x148df6['error']){if(_0x148df6[_0xb29a('0x11')]['code']===0x1f4){logger[_0xb29a('0x11')](_0xb29a('0xc'),_0x39c1d6,_0x148df6[_0xb29a('0x11')]['message']);return _0x28c7a0(_0x148df6[_0xb29a('0x11')][_0xb29a('0x12')]);}logger[_0xb29a('0x11')](_0xb29a('0xc'),_0x39c1d6,_0x148df6[_0xb29a('0x11')][_0xb29a('0x12')]);return _0x31abd3(_0x148df6[_0xb29a('0x11')][_0xb29a('0x12')]);}else{logger['info'](_0xb29a('0xc'),_0x39c1d6,_0xb29a('0xd'));_0x31abd3(_0x148df6['result'][_0xb29a('0x12')]);}})[_0xb29a('0x13')](function(_0x5940b6){logger[_0xb29a('0x11')](_0xb29a('0xc'),_0x39c1d6,_0x5940b6);_0x28c7a0(_0x5940b6);});});}
\ No newline at end of file
+var _0xb540=['http','then','info','Setting,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x239920,_0x2ad95b){var _0x1b9f06=function(_0x3cdbf1){while(--_0x3cdbf1){_0x239920['push'](_0x239920['shift']());}};_0x1b9f06(++_0x2ad95b);}(_0xb540,0x12b));var _0x0b54=function(_0x26fcb0,_0x4dffec){_0x26fcb0=_0x26fcb0-0x0;var _0x31c797=_0xb540[_0x26fcb0];return _0x31c797;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x0b54('0x0'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0b54('0x1'))['db'];var utils=require(_0x0b54('0x2'));var logger=require(_0x0b54('0x3'))(_0x0b54('0x4'));var config=require(_0x0b54('0x5'));var jayson=require(_0x0b54('0x6'));var client=jayson['client'][_0x0b54('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x2a154e,_0x439166,_0x1faee5){return new BPromise(function(_0x4d3436,_0xa0157f){return client['request'](_0x2a154e,_0x1faee5)[_0x0b54('0x8')](function(_0x2b4e05){logger[_0x0b54('0x9')](_0x0b54('0xa'),_0x439166,_0x0b54('0xb'));logger[_0x0b54('0xc')]('Setting,\x20%s,\x20%s,\x20%s',_0x439166,_0x0b54('0xb'),JSON[_0x0b54('0xd')](_0x2b4e05));if(_0x2b4e05[_0x0b54('0xe')]){if(_0x2b4e05[_0x0b54('0xe')][_0x0b54('0xf')]===0x1f4){logger[_0x0b54('0xe')](_0x0b54('0xa'),_0x439166,_0x2b4e05[_0x0b54('0xe')][_0x0b54('0x10')]);return _0xa0157f(_0x2b4e05[_0x0b54('0xe')][_0x0b54('0x10')]);}logger[_0x0b54('0xe')](_0x0b54('0xa'),_0x439166,_0x2b4e05[_0x0b54('0xe')]['message']);return _0x4d3436(_0x2b4e05[_0x0b54('0xe')][_0x0b54('0x10')]);}else{logger[_0x0b54('0x9')](_0x0b54('0xa'),_0x439166,_0x0b54('0xb'));_0x4d3436(_0x2b4e05['result']['message']);}})[_0x0b54('0x11')](function(_0x588c7d){logger[_0x0b54('0xe')]('Setting,\x20%s,\x20%s',_0x439166,_0x588c7d);_0xa0157f(_0x588c7d);});});}
\ No newline at end of file
diff --git a/server/api/smsAccount/index.js b/server/api/smsAccount/index.js
index 7039e6f..c0d1231 100644
--- a/server/api/smsAccount/index.js
+++ b/server/api/smsAccount/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xe2d2=['getInteractions','/:id/status','statusGet','/:id/users','getAgents','post','create','notify','addApplications','/:id/send','send','status','addAgents','update','delete','destroy','removeDispositions','removeAnswers','removeAgents','exports','multer','util','path','connect-timeout','../../components/auth/service','../../components/interaction/service','./smsAccount.controller','get','isAuthenticated','index','describe','/:id','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/applications','getApplications','/:id/interactions'];(function(_0x49702e,_0x5c6505){var _0x44ef91=function(_0x5c8382){while(--_0x5c8382){_0x49702e['push'](_0x49702e['shift']());}};_0x44ef91(++_0x5c6505);}(_0xe2d2,0x1e8));var _0x2e2d=function(_0x4a4d97,_0x31087f){_0x4a4d97=_0x4a4d97-0x0;var _0x5b8d7f=_0xe2d2[_0x4a4d97];return _0x5b8d7f;};'use strict';var multer=require(_0x2e2d('0x0'));var util=require(_0x2e2d('0x1'));var path=require(_0x2e2d('0x2'));var timeout=require(_0x2e2d('0x3'));var express=require('express');var router=express['Router']();var auth=require(_0x2e2d('0x4'));var interaction=require(_0x2e2d('0x5'));var config=require('../../config/environment');var controller=require(_0x2e2d('0x6'));router[_0x2e2d('0x7')]('/',auth[_0x2e2d('0x8')](),controller[_0x2e2d('0x9')]);router[_0x2e2d('0x7')]('/describe',auth[_0x2e2d('0x8')](),controller[_0x2e2d('0xa')]);router[_0x2e2d('0x7')](_0x2e2d('0xb'),auth[_0x2e2d('0x8')](),controller['show']);router[_0x2e2d('0x7')](_0x2e2d('0xc'),auth[_0x2e2d('0x8')](),controller[_0x2e2d('0xd')]);router[_0x2e2d('0x7')](_0x2e2d('0xe'),auth[_0x2e2d('0x8')](),controller[_0x2e2d('0xf')]);router[_0x2e2d('0x7')](_0x2e2d('0x10'),auth[_0x2e2d('0x8')](),controller[_0x2e2d('0x11')]);router[_0x2e2d('0x7')](_0x2e2d('0x12'),auth[_0x2e2d('0x8')](),controller[_0x2e2d('0x13')]);router[_0x2e2d('0x7')](_0x2e2d('0x14'),controller[_0x2e2d('0x15')]);router[_0x2e2d('0x7')](_0x2e2d('0x16'),auth[_0x2e2d('0x8')](),controller[_0x2e2d('0x17')]);router[_0x2e2d('0x18')]('/',auth[_0x2e2d('0x8')](),controller[_0x2e2d('0x19')]);router[_0x2e2d('0x18')](_0x2e2d('0xc'),auth[_0x2e2d('0x8')](),controller['addDisposition']);router[_0x2e2d('0x18')](_0x2e2d('0xe'),auth[_0x2e2d('0x8')](),controller['addAnswer']);router[_0x2e2d('0x18')]('/:id/notify',controller[_0x2e2d('0x1a')]);router[_0x2e2d('0x18')]('/:id/applications',auth[_0x2e2d('0x8')](),controller[_0x2e2d('0x1b')]);router[_0x2e2d('0x18')](_0x2e2d('0x1c'),auth[_0x2e2d('0x8')](),controller[_0x2e2d('0x1d')]);router[_0x2e2d('0x18')]('/:id/status',controller[_0x2e2d('0x1e')]);router[_0x2e2d('0x18')]('/:id/users',auth['isAuthenticated'](),controller[_0x2e2d('0x1f')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0x2e2d('0x20')]);router[_0x2e2d('0x21')](_0x2e2d('0xb'),auth[_0x2e2d('0x8')](),controller[_0x2e2d('0x22')]);router[_0x2e2d('0x21')](_0x2e2d('0xc'),auth[_0x2e2d('0x8')](),controller[_0x2e2d('0x23')]);router['delete'](_0x2e2d('0xe'),auth['isAuthenticated'](),controller[_0x2e2d('0x24')]);router[_0x2e2d('0x21')](_0x2e2d('0x16'),auth['isAuthenticated'](),controller[_0x2e2d('0x25')]);module[_0x2e2d('0x26')]=router;
\ No newline at end of file
+var _0x200e=['getDispositions','/:id/canned_answers','getAnswers','/:id/applications','/:id/interactions','getInteractions','/:id/status','getAgents','post','create','addDisposition','/:id/notify','notify','addApplications','send','status','/:id/users','addAgents','update','destroy','/:id/dispositions','removeAnswers','delete','removeAgents','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','./smsAccount.controller','isAuthenticated','get','describe','/:id','show'];(function(_0x5c65f8,_0x54bfa0){var _0x76607f=function(_0x57c994){while(--_0x57c994){_0x5c65f8['push'](_0x5c65f8['shift']());}};_0x76607f(++_0x54bfa0);}(_0x200e,0x195));var _0xe200=function(_0x1b5281,_0x2b2506){_0x1b5281=_0x1b5281-0x0;var _0x58b206=_0x200e[_0x1b5281];return _0x58b206;};'use strict';var multer=require(_0xe200('0x0'));var util=require(_0xe200('0x1'));var path=require(_0xe200('0x2'));var timeout=require('connect-timeout');var express=require(_0xe200('0x3'));var router=express[_0xe200('0x4')]();var auth=require(_0xe200('0x5'));var interaction=require(_0xe200('0x6'));var config=require('../../config/environment');var controller=require(_0xe200('0x7'));router['get']('/',auth[_0xe200('0x8')](),controller['index']);router[_0xe200('0x9')]('/describe',auth[_0xe200('0x8')](),controller[_0xe200('0xa')]);router[_0xe200('0x9')](_0xe200('0xb'),auth[_0xe200('0x8')](),controller[_0xe200('0xc')]);router[_0xe200('0x9')]('/:id/dispositions',auth[_0xe200('0x8')](),controller[_0xe200('0xd')]);router['get'](_0xe200('0xe'),auth[_0xe200('0x8')](),controller[_0xe200('0xf')]);router[_0xe200('0x9')](_0xe200('0x10'),auth[_0xe200('0x8')](),controller['getApplications']);router[_0xe200('0x9')](_0xe200('0x11'),auth[_0xe200('0x8')](),controller[_0xe200('0x12')]);router['get'](_0xe200('0x13'),controller['statusGet']);router[_0xe200('0x9')]('/:id/users',auth[_0xe200('0x8')](),controller[_0xe200('0x14')]);router[_0xe200('0x15')]('/',auth[_0xe200('0x8')](),controller[_0xe200('0x16')]);router['post']('/:id/dispositions',auth[_0xe200('0x8')](),controller[_0xe200('0x17')]);router[_0xe200('0x15')](_0xe200('0xe'),auth['isAuthenticated'](),controller['addAnswer']);router[_0xe200('0x15')](_0xe200('0x18'),controller[_0xe200('0x19')]);router['post']('/:id/applications',auth['isAuthenticated'](),controller[_0xe200('0x1a')]);router[_0xe200('0x15')]('/:id/send',auth[_0xe200('0x8')](),controller[_0xe200('0x1b')]);router['post'](_0xe200('0x13'),controller[_0xe200('0x1c')]);router[_0xe200('0x15')](_0xe200('0x1d'),auth[_0xe200('0x8')](),controller[_0xe200('0x1e')]);router['put'](_0xe200('0xb'),auth[_0xe200('0x8')](),controller[_0xe200('0x1f')]);router['delete'](_0xe200('0xb'),auth[_0xe200('0x8')](),controller[_0xe200('0x20')]);router['delete'](_0xe200('0x21'),auth[_0xe200('0x8')](),controller['removeDispositions']);router['delete'](_0xe200('0xe'),auth[_0xe200('0x8')](),controller[_0xe200('0x22')]);router[_0xe200('0x23')](_0xe200('0x1d'),auth[_0xe200('0x8')](),controller[_0xe200('0x24')]);module[_0xe200('0x25')]=router;
\ No newline at end of file
diff --git a/server/api/smsAccount/smsAccount.attributes.js b/server/api/smsAccount/smsAccount.attributes.js
index 6584dec..f9c4c9a 100644
--- a/server/api/smsAccount/smsAccount.attributes.js
+++ b/server/api/smsAccount/smsAccount.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x4cad=['plivo','clickatell','csc','TEXT','Account:\x20{{account.name}} {{#queue}}Queue:\x20{{queue.name}} {{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','setDataValue','sequelize','randomstring','exports','STRING','ENUM','twilio','skebby','connectel','clicksend'];(function(_0x448e49,_0x1fc64c){var _0x33a6b8=function(_0x2a831c){while(--_0x2a831c){_0x448e49['push'](_0x448e49['shift']());}};_0x33a6b8(++_0x1fc64c);}(_0x4cad,0x1b9));var _0xd4ca=function(_0x250154,_0x463253){_0x250154=_0x250154-0x0;var _0x4458c7=_0x4cad[_0x250154];return _0x4458c7;};'use strict';var Sequelize=require(_0xd4ca('0x0'));var rs=require(_0xd4ca('0x1'));module[_0xd4ca('0x2')]={'name':{'type':Sequelize[_0xd4ca('0x3')],'unique':'name','allowNull':![]},'key':{'type':Sequelize[_0xd4ca('0x3')],'allowNull':![]},'remote':{'type':Sequelize[_0xd4ca('0x3')],'allowNull':![]},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs['generate']();}},'phone':{'type':Sequelize[_0xd4ca('0x3')]},'type':{'type':Sequelize[_0xd4ca('0x4')](_0xd4ca('0x5'),_0xd4ca('0x6'),_0xd4ca('0x7'),_0xd4ca('0x8'),_0xd4ca('0x9'),_0xd4ca('0xa'),_0xd4ca('0xb'),'infobip','intelepeer')},'accountSid':{'type':Sequelize[_0xd4ca('0x3')]},'authId':{'type':Sequelize['STRING']},'authToken':{'type':Sequelize[_0xd4ca('0x3')]},'smsMethod':{'type':Sequelize['ENUM']('SI','TI','GP')},'username':{'type':Sequelize[_0xd4ca('0x3')]},'password':{'type':Sequelize[_0xd4ca('0x3')]},'apiKey':{'type':Sequelize[_0xd4ca('0x3')]},'senderString':{'type':Sequelize['STRING']},'deliveryReport':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'description':{'type':Sequelize[_0xd4ca('0x3')]},'notificationTemplate':{'type':Sequelize[_0xd4ca('0xc')],'defaultValue':function(){return _0xd4ca('0xd');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xd4ca('0xe')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xd4ca('0xf')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xd4ca('0xe')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xd4ca('0xf')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xd4ca('0xe')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xd4ca('0xf')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize['STRING']},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'comment':_0xd4ca('0x10')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x5aca2b){if(!_0x5aca2b)this[_0xd4ca('0x11')]('mandatoryDispositionPauseId',null);this[_0xd4ca('0x11')]('mandatoryDisposition',_0x5aca2b);}}};
\ No newline at end of file
+var _0xa34f=['clicksend','plivo','clickatell','csc','infobip','BOOLEAN','TEXT','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','randomstring','exports','STRING','name','ENUM','twilio','skebby','connectel'];(function(_0x330f26,_0x292db5){var _0x1fd06d=function(_0x506376){while(--_0x506376){_0x330f26['push'](_0x330f26['shift']());}};_0x1fd06d(++_0x292db5);}(_0xa34f,0x1c5));var _0xfa34=function(_0x5bd953,_0x307788){_0x5bd953=_0x5bd953-0x0;var _0x4ac021=_0xa34f[_0x5bd953];return _0x4ac021;};'use strict';var Sequelize=require(_0xfa34('0x0'));var rs=require(_0xfa34('0x1'));module[_0xfa34('0x2')]={'name':{'type':Sequelize[_0xfa34('0x3')],'unique':_0xfa34('0x4'),'allowNull':![]},'key':{'type':Sequelize['STRING'],'allowNull':![]},'remote':{'type':Sequelize[_0xfa34('0x3')],'allowNull':![]},'token':{'type':Sequelize[_0xfa34('0x3')],'defaultValue':function(){return rs['generate']();}},'phone':{'type':Sequelize[_0xfa34('0x3')]},'type':{'type':Sequelize[_0xfa34('0x5')](_0xfa34('0x6'),_0xfa34('0x7'),_0xfa34('0x8'),_0xfa34('0x9'),_0xfa34('0xa'),_0xfa34('0xb'),_0xfa34('0xc'),_0xfa34('0xd'),'intelepeer')},'accountSid':{'type':Sequelize[_0xfa34('0x3')]},'authId':{'type':Sequelize[_0xfa34('0x3')]},'authToken':{'type':Sequelize[_0xfa34('0x3')]},'smsMethod':{'type':Sequelize['ENUM']('SI','TI','GP')},'username':{'type':Sequelize[_0xfa34('0x3')]},'password':{'type':Sequelize['STRING']},'apiKey':{'type':Sequelize[_0xfa34('0x3')]},'senderString':{'type':Sequelize[_0xfa34('0x3')]},'deliveryReport':{'type':Sequelize[_0xfa34('0xe')],'defaultValue':![]},'description':{'type':Sequelize[_0xfa34('0x3')]},'notificationTemplate':{'type':Sequelize[_0xfa34('0xf')],'defaultValue':function(){return'Account:\x20{{account.name}} {{#queue}}Queue:\x20{{queue.name}} {{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0xfa34('0xe')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xfa34('0xe')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xfa34('0x10')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xfa34('0xe')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xfa34('0xe')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xfa34('0x10')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize[_0xfa34('0x3')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0xfa34('0x10')],'comment':_0xfa34('0x11')},'mandatoryDisposition':{'type':Sequelize[_0xfa34('0xe')],'defaultValue':![],'comment':_0xfa34('0x12'),'set':function(_0x889f80){if(!_0x889f80)this[_0xfa34('0x13')](_0xfa34('0x14'),null);this[_0xfa34('0x13')](_0xfa34('0x15'),_0x889f80);}}};
\ No newline at end of file
diff --git a/server/api/smsAccount/smsAccount.controller.js b/server/api/smsAccount/smsAccount.controller.js
index f2afe95..2ea0d21 100644
--- a/server/api/smsAccount/smsAccount.controller.js
+++ b/server/api/smsAccount/smsAccount.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7a54=['findAndCountAll','getApplications','getInteractions','Contact','fullname','internal','Tag','color','tag','to\x20is\x20mandatory','DESC','List','out','Messages','spread','dataValues','push','log','skebby_dispatch_id','statusInt','requestid','clicksend','status_code','groupName','DELIVERED','redif','inspect','error_code','DELIVERED_TO_GATEWAY','RECEIVED_BY_RECIPIENT','DELIVRD','ACCEPTD','statusGet','received\x20delivery\x20report\x20from','message-id','state','addAgents','omit','emit','userSmsAccount:save','removeAgents','isArray','userSmsAccount:remove','getAgents','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./smsAccount.socket','register','jayson/promise','client','http','test','Sequelize','ValidationError','request','then','info','SmsAccount,\x20%s,\x20%s','request\x20sent','SmsAccount,\x20%s,\x20%s,\x20%s','error','code','message','sendStatus','status','end','json','offset','limit','reject','update','destroy','get','UserProfileResource','stack','name','send','index','Pause','SmsAccount','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','count','includeAll','include','findAll','rows','catch','show','params','mandatoryDispositionPause','rawAttributes','length','find','create','user','role','SmsAccounts','UserProfileSection','autoAssociation','body','describe','addDisposition','SmsAccountId','Disposition','getDispositions','removeDispositions','ids','addAnswer','CannedAnswer','findOne','removeAnswers','notify','SmsApplication','Applications','account','priority','CmContact','no\x20available\x20attributes','difference','createdAt','updatedAt','ListId','From','Body','messageId','skebby','from','connectel','message_id','plivo','Text','MessageUUID','infobip','results','csc','originatingAddress','segmentedMessage','clickatell','fromNumber','text','replyMessageId','intelepeer','isNil','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','Contacts','contact','SmsInteraction','interaction','applications','close','unmanaged','SmsMessage','ContactId','AttachmentId','User','unshift','agent','waitForTheAssignedAgent','*,*,*,*','Start','startRouting','receiveMessage','entity\x20found','debug','SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s','set','Content-Type','\x0a ','addApplications','sequelize','bulkCreate'];(function(_0xa9f5f5,_0x3c0e1b){var _0x1b5b56=function(_0x4a5144){while(--_0x4a5144){_0xa9f5f5['push'](_0xa9f5f5['shift']());}};_0x1b5b56(++_0x3c0e1b);}(_0x7a54,0x106));var _0x47a5=function(_0x536104,_0x155aca){_0x536104=_0x536104-0x0;var _0x7a0ecc=_0x7a54[_0x536104];return _0x7a0ecc;};'use strict';var pdf=require(_0x47a5('0x0'));var emlformat=require(_0x47a5('0x1'));var rimraf=require(_0x47a5('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x47a5('0x3'));var rp=require(_0x47a5('0x4'));var moment=require('moment');var BPromise=require(_0x47a5('0x5'));var Mustache=require(_0x47a5('0x6'));var util=require(_0x47a5('0x7'));var path=require(_0x47a5('0x8'));var sox=require(_0x47a5('0x9'));var csv=require('to-csv');var ejs=require(_0x47a5('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var db=require(_0x47a5('0x14'))['db'];config[_0x47a5('0x15')]=_[_0x47a5('0x16')](config[_0x47a5('0x15')],{'host':'localhost','port':0x18eb});var socket=require(_0x47a5('0x17'))(new Redis(config[_0x47a5('0x15')]));require(_0x47a5('0x18'))[_0x47a5('0x19')](socket);var jayson=require(_0x47a5('0x1a'));var client=jayson[_0x47a5('0x1b')][_0x47a5('0x1c')]({'port':0x232c});function checkPasswordPattern(_0x190faa,_0x4e99a8,_0x362359){if(_0x362359){var _0x11faf5=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x11faf5[_0x47a5('0x1d')](_0x4e99a8)){return _0x190faa;}else{throw new db[(_0x47a5('0x1e'))][(_0x47a5('0x1f'))]('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x190faa;}}function respondWithRpcPromise(_0x549de3,_0x138bc0,_0x4b966e,_0x5247fd){return new BPromise(function(_0x423a81,_0xaf70a6){var _0x2ce454=_0x5247fd||client;return _0x2ce454[_0x47a5('0x20')](_0x549de3,_0x4b966e)[_0x47a5('0x21')](function(_0x12b98e){logger[_0x47a5('0x22')](_0x47a5('0x23'),_0x138bc0,_0x47a5('0x24'));logger['debug'](_0x47a5('0x25'),_0x138bc0,_0x47a5('0x24'),JSON['stringify'](_0x12b98e));if(_0x12b98e[_0x47a5('0x26')]){if(_0x12b98e[_0x47a5('0x26')][_0x47a5('0x27')]===0x1f4){logger['error'](_0x47a5('0x23'),_0x138bc0,_0x12b98e[_0x47a5('0x26')][_0x47a5('0x28')]);return _0xaf70a6(_0x12b98e[_0x47a5('0x26')]['message']);}logger[_0x47a5('0x26')](_0x47a5('0x23'),_0x138bc0,_0x12b98e['error'][_0x47a5('0x28')]);return _0x423a81(_0x12b98e[_0x47a5('0x26')][_0x47a5('0x28')]);}else{logger[_0x47a5('0x22')](_0x47a5('0x23'),_0x138bc0,'request\x20sent');_0x423a81(_0x12b98e['result'][_0x47a5('0x28')]);}})['catch'](function(_0x1ea9c8){logger['error'](_0x47a5('0x23'),_0x138bc0,_0x1ea9c8);_0xaf70a6(_0x1ea9c8);});});}function respondWithStatusCode(_0x378208,_0x36ad34){_0x36ad34=_0x36ad34||0xcc;return function(_0x1dac65){if(_0x1dac65){return _0x378208[_0x47a5('0x29')](_0x36ad34);}return _0x378208[_0x47a5('0x2a')](_0x36ad34)[_0x47a5('0x2b')]();};}function respondWithResult(_0x136b14,_0x16631f){_0x16631f=_0x16631f||0xc8;return function(_0x361bfa){if(_0x361bfa){return _0x136b14[_0x47a5('0x2a')](_0x16631f)[_0x47a5('0x2c')](_0x361bfa);}};}function respondWithFilteredResult(_0x3ad507,_0x528582){return function(_0x243210){if(_0x243210){var _0x51833b=_0x243210['count'],_0x2ef875=_0x528582[_0x47a5('0x2d')],_0x9ac908=_0x528582[_0x47a5('0x2d')]+_0x528582[_0x47a5('0x2e')],_0x16901f;if(_0x9ac908>=_0x51833b){_0x9ac908=_0x51833b;_0x16901f=0xc8;}else{_0x16901f=0xce;}_0x3ad507[_0x47a5('0x2a')](_0x16901f);return _0x3ad507['set']('Content-Range',_0x2ef875+'-'+_0x9ac908+'/'+_0x51833b)[_0x47a5('0x2c')](_0x243210);}return null;};}function patchUpdates(_0xfb5ddb){return function(_0x5bd7eb){try{jsonpatch['apply'](_0x5bd7eb,_0xfb5ddb,!![]);}catch(_0x836303){return BPromise[_0x47a5('0x2f')](_0x836303);}return _0x5bd7eb['save']();};}function saveUpdates(_0x42f70c,_0x53119b){return function(_0x122ed6){if(_0x122ed6){return _0x122ed6[_0x47a5('0x30')](_0x42f70c)['then'](function(_0x4843c0){return _0x4843c0;});}return null;};}function removeEntity(_0x274e34,_0x5910bb){return function(_0x403028){if(_0x403028){return _0x403028[_0x47a5('0x31')]()[_0x47a5('0x21')](function(){var _0x52749b=_0x403028[_0x47a5('0x32')]({'plain':!![]});var _0x50c086='SmsAccounts';return db[_0x47a5('0x33')]['destroy']({'where':{'type':_0x50c086,'resourceId':_0x52749b['id']}})[_0x47a5('0x21')](function(){return _0x403028;});})['then'](function(){_0x274e34[_0x47a5('0x2a')](0xcc)[_0x47a5('0x2b')]();});}};}function handleEntityNotFound(_0x38c8d4,_0x199698){return function(_0x36add5){if(!_0x36add5){_0x38c8d4[_0x47a5('0x29')](0x194);}return _0x36add5;};}function handleError(_0xee582c,_0x452be5){_0x452be5=_0x452be5||0x1f4;return function(_0x1a0d23){logger['error'](_0x1a0d23[_0x47a5('0x34')]);if(_0x1a0d23[_0x47a5('0x35')]){delete _0x1a0d23['name'];}_0xee582c[_0x47a5('0x2a')](_0x452be5)[_0x47a5('0x36')](_0x1a0d23);};}exports[_0x47a5('0x37')]=function(_0x49c4b5,_0x101f70){var _0x10f660={'include':[{'model':db[_0x47a5('0x38')],'as':'mandatoryDispositionPause'}]},_0x596097={},_0x2ebba0={'count':0x0,'rows':[]};var _0x55c5eb=_['map'](db[_0x47a5('0x39')]['rawAttributes'],function(_0x9b5eaf){return{'name':_0x9b5eaf[_0x47a5('0x3a')],'type':_0x9b5eaf[_0x47a5('0x3b')][_0x47a5('0x3c')]};});_0x596097[_0x47a5('0x3d')]=_[_0x47a5('0x3e')](_0x55c5eb,_0x47a5('0x35'));_0x596097[_0x47a5('0x3f')]=_[_0x47a5('0x40')](_0x49c4b5[_0x47a5('0x3f')]);_0x596097[_0x47a5('0x41')]=_[_0x47a5('0x42')](_0x596097[_0x47a5('0x3d')],_0x596097['query']);_0x10f660[_0x47a5('0x43')]=_[_0x47a5('0x42')](_0x596097[_0x47a5('0x3d')],qs[_0x47a5('0x44')](_0x49c4b5['query'][_0x47a5('0x44')]));_0x10f660['attributes']=_0x10f660['attributes']['length']?_0x10f660['attributes']:_0x596097[_0x47a5('0x3d')];if(!_0x49c4b5['query'][_0x47a5('0x45')](_0x47a5('0x46'))){_0x10f660[_0x47a5('0x2e')]=qs['limit'](_0x49c4b5[_0x47a5('0x3f')][_0x47a5('0x2e')]);_0x10f660['offset']=qs['offset'](_0x49c4b5[_0x47a5('0x3f')]['offset']);}_0x10f660[_0x47a5('0x47')]=qs[_0x47a5('0x48')](_0x49c4b5[_0x47a5('0x3f')][_0x47a5('0x48')]);_0x10f660[_0x47a5('0x49')]=qs[_0x47a5('0x41')](_[_0x47a5('0x4a')](_0x49c4b5[_0x47a5('0x3f')],_0x596097[_0x47a5('0x41')]),_0x55c5eb);if(_0x49c4b5[_0x47a5('0x3f')][_0x47a5('0x4b')]){_0x10f660[_0x47a5('0x49')]=_[_0x47a5('0x4c')](_0x10f660[_0x47a5('0x49')],{'$or':_[_0x47a5('0x3e')](_0x55c5eb,function(_0x3a2b38){if(_0x3a2b38['type']!==_0x47a5('0x4d')){var _0x23bb04={};_0x23bb04[_0x3a2b38['name']]={'$like':'%'+_0x49c4b5['query'][_0x47a5('0x4b')]+'%'};return _0x23bb04;}})});}_0x10f660=_['merge']({},_0x10f660,_0x49c4b5[_0x47a5('0x4e')]);var _0xd93e37={'where':_0x10f660['where']};return db['SmsAccount'][_0x47a5('0x4f')](_0xd93e37)['then'](function(_0x2d147c){_0x2ebba0[_0x47a5('0x4f')]=_0x2d147c;if(_0x49c4b5[_0x47a5('0x3f')][_0x47a5('0x50')]){_0x10f660[_0x47a5('0x51')]=[{'all':!![]}];}return db[_0x47a5('0x39')][_0x47a5('0x52')](_0x10f660);})['then'](function(_0x48a0ef){_0x2ebba0[_0x47a5('0x53')]=_0x48a0ef;return _0x2ebba0;})[_0x47a5('0x21')](respondWithFilteredResult(_0x101f70,_0x10f660))[_0x47a5('0x54')](handleError(_0x101f70,null));};exports[_0x47a5('0x55')]=function(_0x2c7020,_0x2c0c86){var _0x249de5={'raw':![],'where':{'id':_0x2c7020[_0x47a5('0x56')]['id']},'include':[{'model':db[_0x47a5('0x38')],'as':_0x47a5('0x57')}]},_0x492cf7={};_0x492cf7['model']=_[_0x47a5('0x40')](db['SmsAccount'][_0x47a5('0x58')]);_0x492cf7[_0x47a5('0x3f')]=_[_0x47a5('0x40')](_0x2c7020[_0x47a5('0x3f')]);_0x492cf7['filters']=_[_0x47a5('0x42')](_0x492cf7[_0x47a5('0x3d')],_0x492cf7[_0x47a5('0x3f')]);_0x249de5[_0x47a5('0x43')]=_[_0x47a5('0x42')](_0x492cf7[_0x47a5('0x3d')],qs[_0x47a5('0x44')](_0x2c7020['query'][_0x47a5('0x44')]));_0x249de5[_0x47a5('0x43')]=_0x249de5[_0x47a5('0x43')][_0x47a5('0x59')]?_0x249de5[_0x47a5('0x43')]:_0x492cf7[_0x47a5('0x3d')];if(_0x2c7020['query'][_0x47a5('0x50')]){_0x249de5[_0x47a5('0x51')]=[{'all':!![]}];}_0x249de5=_[_0x47a5('0x4c')]({},_0x249de5,_0x2c7020['options']);return db[_0x47a5('0x39')][_0x47a5('0x5a')](_0x249de5)[_0x47a5('0x21')](handleEntityNotFound(_0x2c0c86,null))['then'](respondWithResult(_0x2c0c86,null))['catch'](handleError(_0x2c0c86,null));};exports[_0x47a5('0x5b')]=function(_0x376e1d,_0x4fa1da){return db['SmsAccount'][_0x47a5('0x5b')](_0x376e1d['body'],{})[_0x47a5('0x21')](function(_0x5d383d){var _0x482de6=_0x376e1d[_0x47a5('0x5c')][_0x47a5('0x32')]({'plain':!![]});if(!_0x482de6)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x482de6[_0x47a5('0x5d')]===_0x47a5('0x5c')){var _0x4b706a=_0x5d383d['get']({'plain':!![]});var _0x16b4fd=_0x47a5('0x5e');return db[_0x47a5('0x5f')][_0x47a5('0x5a')]({'where':{'name':_0x16b4fd,'userProfileId':_0x482de6['userProfileId']},'raw':!![]})[_0x47a5('0x21')](function(_0x2b4255){if(_0x2b4255&&_0x2b4255[_0x47a5('0x60')]===0x0){return db['UserProfileResource'][_0x47a5('0x5b')]({'name':_0x4b706a['name'],'resourceId':_0x4b706a['id'],'type':_0x2b4255[_0x47a5('0x35')],'sectionId':_0x2b4255['id']},{})[_0x47a5('0x21')](function(){return _0x5d383d;});}else{return _0x5d383d;}})[_0x47a5('0x54')](function(_0x1c485b){logger[_0x47a5('0x26')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1c485b);throw _0x1c485b;});}return _0x5d383d;})[_0x47a5('0x21')](respondWithResult(_0x4fa1da,0xc9))['catch'](handleError(_0x4fa1da,null));};exports['update']=function(_0x5eb150,_0x4f8564){if(_0x5eb150[_0x47a5('0x61')]['id']){delete _0x5eb150[_0x47a5('0x61')]['id'];}return db[_0x47a5('0x39')]['find']({'where':{'id':_0x5eb150['params']['id']},'include':[{'model':db[_0x47a5('0x38')],'as':_0x47a5('0x57')}]})[_0x47a5('0x21')](handleEntityNotFound(_0x4f8564,null))[_0x47a5('0x21')](saveUpdates(_0x5eb150[_0x47a5('0x61')],null))['then'](respondWithResult(_0x4f8564,null))[_0x47a5('0x54')](handleError(_0x4f8564,null));};exports['destroy']=function(_0x22c886,_0x274d31){return db['SmsAccount'][_0x47a5('0x5a')]({'where':{'id':_0x22c886[_0x47a5('0x56')]['id']}})[_0x47a5('0x21')](handleEntityNotFound(_0x274d31,null))[_0x47a5('0x21')](removeEntity(_0x274d31,null))[_0x47a5('0x54')](handleError(_0x274d31,null));};exports[_0x47a5('0x62')]=function(_0x35cca8,_0x3ac38c){return db['SmsAccount'][_0x47a5('0x62')]()[_0x47a5('0x21')](respondWithResult(_0x3ac38c,null))[_0x47a5('0x54')](handleError(_0x3ac38c,null));};exports[_0x47a5('0x63')]=function(_0x396cb0,_0x4bbe14,_0xbec033){if(_0x396cb0[_0x47a5('0x61')]['id']){delete _0x396cb0[_0x47a5('0x61')]['id'];}return db[_0x47a5('0x39')][_0x47a5('0x5a')]({'where':{'id':_0x396cb0[_0x47a5('0x56')]['id']}})[_0x47a5('0x21')](handleEntityNotFound(_0x4bbe14,null))[_0x47a5('0x21')](function(_0x350af8){if(_0x350af8){_0x396cb0[_0x47a5('0x61')][_0x47a5('0x64')]=_0x350af8['id'];return db[_0x47a5('0x65')][_0x47a5('0x5b')](_0x396cb0[_0x47a5('0x61')]);}})[_0x47a5('0x21')](respondWithResult(_0x4bbe14,null))['catch'](handleError(_0x4bbe14,null));};exports[_0x47a5('0x66')]=function(_0x284fb8,_0x30504e,_0x4b42f3){var _0x37ac59={'raw':![],'where':{}};var _0x2e46af={};var _0x36c67={'count':0x0,'rows':[]};return db[_0x47a5('0x39')]['findOne']({'where':{'id':_0x284fb8[_0x47a5('0x56')]['id']}})['then'](handleEntityNotFound(_0x30504e,null))[_0x47a5('0x21')](function(_0x487e21){if(_0x487e21){_0x2e46af[_0x47a5('0x3d')]=_['keys'](db[_0x47a5('0x65')][_0x47a5('0x58')]);_0x2e46af[_0x47a5('0x3f')]=_['keys'](_0x284fb8['query']);_0x2e46af['filters']=_[_0x47a5('0x42')](_0x2e46af[_0x47a5('0x3d')],_0x2e46af[_0x47a5('0x3f')]);_0x37ac59[_0x47a5('0x43')]=_['intersection'](_0x2e46af[_0x47a5('0x3d')],qs[_0x47a5('0x44')](_0x284fb8[_0x47a5('0x3f')][_0x47a5('0x44')]));_0x37ac59[_0x47a5('0x43')]=_0x37ac59[_0x47a5('0x43')][_0x47a5('0x59')]?_0x37ac59[_0x47a5('0x43')]:_0x2e46af[_0x47a5('0x3d')];if(!_0x284fb8[_0x47a5('0x3f')][_0x47a5('0x45')](_0x47a5('0x46'))){_0x37ac59['limit']=qs[_0x47a5('0x2e')](_0x284fb8['query'][_0x47a5('0x2e')]);_0x37ac59[_0x47a5('0x2d')]=qs[_0x47a5('0x2d')](_0x284fb8[_0x47a5('0x3f')][_0x47a5('0x2d')]);}_0x37ac59[_0x47a5('0x47')]=qs[_0x47a5('0x48')](_0x284fb8[_0x47a5('0x3f')][_0x47a5('0x48')]);_0x37ac59[_0x47a5('0x49')]=qs[_0x47a5('0x41')](_[_0x47a5('0x4a')](_0x284fb8[_0x47a5('0x3f')],_0x2e46af[_0x47a5('0x41')]));_0x37ac59[_0x47a5('0x49')]['SmsAccountId']=_0x487e21['id'];if(_0x284fb8['query']['filter']){_0x37ac59['where']=_[_0x47a5('0x4c')](_0x37ac59[_0x47a5('0x49')],{'$or':_['map'](_0x37ac59[_0x47a5('0x43')],function(_0x44dda2){var _0x1baa5a={};_0x1baa5a[_0x44dda2]={'$like':'%'+_0x284fb8[_0x47a5('0x3f')][_0x47a5('0x4b')]+'%'};return _0x1baa5a;})});}_0x37ac59=_[_0x47a5('0x4c')]({},_0x37ac59,_0x284fb8[_0x47a5('0x4e')]);return db[_0x47a5('0x65')][_0x47a5('0x4f')]({'where':_0x37ac59[_0x47a5('0x49')]})[_0x47a5('0x21')](function(_0x5e5f16){_0x36c67[_0x47a5('0x4f')]=_0x5e5f16;if(_0x284fb8[_0x47a5('0x3f')][_0x47a5('0x50')]){_0x37ac59['include']=[{'all':!![]}];}return db[_0x47a5('0x65')][_0x47a5('0x52')](_0x37ac59);})[_0x47a5('0x21')](function(_0x5d41d8){_0x36c67[_0x47a5('0x53')]=_0x5d41d8;return _0x36c67;});}})['then'](respondWithFilteredResult(_0x30504e,_0x37ac59))['catch'](handleError(_0x30504e,null));};exports[_0x47a5('0x67')]=function(_0x292d9c,_0x277486,_0x27333e){return db[_0x47a5('0x39')][_0x47a5('0x5a')]({'where':{'id':_0x292d9c['params']['id']}})['then'](handleEntityNotFound(_0x277486,null))[_0x47a5('0x21')](function(_0x4f2361){if(_0x4f2361){return _0x4f2361[_0x47a5('0x67')](_0x292d9c[_0x47a5('0x3f')][_0x47a5('0x68')]);}})[_0x47a5('0x21')](respondWithStatusCode(_0x277486,null))['catch'](handleError(_0x277486,null));};exports[_0x47a5('0x69')]=function(_0x550bde,_0x5f3a04,_0x139c79){if(_0x550bde[_0x47a5('0x61')]['id']){delete _0x550bde['body']['id'];}return db[_0x47a5('0x39')][_0x47a5('0x5a')]({'where':{'id':_0x550bde[_0x47a5('0x56')]['id']}})['then'](handleEntityNotFound(_0x5f3a04,null))[_0x47a5('0x21')](function(_0x578e27){if(_0x578e27){_0x550bde[_0x47a5('0x61')][_0x47a5('0x64')]=_0x578e27['id'];return db[_0x47a5('0x6a')]['create'](_0x550bde[_0x47a5('0x61')]);}})[_0x47a5('0x21')](respondWithResult(_0x5f3a04,null))[_0x47a5('0x54')](handleError(_0x5f3a04,null));};exports['getAnswers']=function(_0x3525e7,_0x4f2fbb,_0x3c012b){var _0x491bb4={'raw':![],'where':{}};var _0x135d2e={};var _0x20d8bd={'count':0x0,'rows':[]};return db[_0x47a5('0x39')][_0x47a5('0x6b')]({'where':{'id':_0x3525e7['params']['id']}})[_0x47a5('0x21')](handleEntityNotFound(_0x4f2fbb,null))[_0x47a5('0x21')](function(_0x23c393){if(_0x23c393){_0x135d2e[_0x47a5('0x3d')]=_[_0x47a5('0x40')](db['CannedAnswer']['rawAttributes']);_0x135d2e[_0x47a5('0x3f')]=_['keys'](_0x3525e7[_0x47a5('0x3f')]);_0x135d2e[_0x47a5('0x41')]=_[_0x47a5('0x42')](_0x135d2e['model'],_0x135d2e[_0x47a5('0x3f')]);_0x491bb4[_0x47a5('0x43')]=_['intersection'](_0x135d2e[_0x47a5('0x3d')],qs[_0x47a5('0x44')](_0x3525e7[_0x47a5('0x3f')][_0x47a5('0x44')]));_0x491bb4['attributes']=_0x491bb4['attributes'][_0x47a5('0x59')]?_0x491bb4[_0x47a5('0x43')]:_0x135d2e['model'];if(!_0x3525e7[_0x47a5('0x3f')][_0x47a5('0x45')]('nolimit')){_0x491bb4[_0x47a5('0x2e')]=qs[_0x47a5('0x2e')](_0x3525e7[_0x47a5('0x3f')]['limit']);_0x491bb4[_0x47a5('0x2d')]=qs['offset'](_0x3525e7[_0x47a5('0x3f')]['offset']);}_0x491bb4[_0x47a5('0x47')]=qs[_0x47a5('0x48')](_0x3525e7['query'][_0x47a5('0x48')]);_0x491bb4['where']=qs[_0x47a5('0x41')](_[_0x47a5('0x4a')](_0x3525e7[_0x47a5('0x3f')],_0x135d2e[_0x47a5('0x41')]));_0x491bb4['where'][_0x47a5('0x64')]=_0x23c393['id'];if(_0x3525e7['query']['filter']){_0x491bb4[_0x47a5('0x49')]=_[_0x47a5('0x4c')](_0x491bb4[_0x47a5('0x49')],{'$or':_[_0x47a5('0x3e')](_0x491bb4[_0x47a5('0x43')],function(_0x5b1f5e){var _0x1522a6={};_0x1522a6[_0x5b1f5e]={'$like':'%'+_0x3525e7[_0x47a5('0x3f')][_0x47a5('0x4b')]+'%'};return _0x1522a6;})});}_0x491bb4=_[_0x47a5('0x4c')]({},_0x491bb4,_0x3525e7['options']);return db[_0x47a5('0x6a')]['count']({'where':_0x491bb4[_0x47a5('0x49')]})[_0x47a5('0x21')](function(_0x3f93f0){_0x20d8bd[_0x47a5('0x4f')]=_0x3f93f0;if(_0x3525e7[_0x47a5('0x3f')][_0x47a5('0x50')]){_0x491bb4[_0x47a5('0x51')]=[{'all':!![]}];}return db[_0x47a5('0x6a')][_0x47a5('0x52')](_0x491bb4);})['then'](function(_0x36796e){_0x20d8bd[_0x47a5('0x53')]=_0x36796e;return _0x20d8bd;});}})['then'](respondWithFilteredResult(_0x4f2fbb,_0x491bb4))[_0x47a5('0x54')](handleError(_0x4f2fbb,null));};exports[_0x47a5('0x6c')]=function(_0x6d6a5,_0x5b85cd,_0x4bf1f5){return db[_0x47a5('0x39')][_0x47a5('0x5a')]({'where':{'id':_0x6d6a5['params']['id']}})['then'](handleEntityNotFound(_0x5b85cd,null))[_0x47a5('0x21')](function(_0x17f82d){if(_0x17f82d){return _0x17f82d['removeAnswers'](_0x6d6a5[_0x47a5('0x3f')][_0x47a5('0x68')]);}})['then'](respondWithStatusCode(_0x5b85cd,null))[_0x47a5('0x54')](handleError(_0x5b85cd,null));};exports[_0x47a5('0x6d')]=function(_0x109805,_0x70c8a6,_0x364bb0){var _0x1371e4={'channel':'sms'};var _0x4c9894=[];var _0x5bd86e=[];var _0x133b7a={};return db[_0x47a5('0x39')]['find']({'where':{'id':_0x109805[_0x47a5('0x56')]['id']},'include':[{'model':db[_0x47a5('0x6e')],'as':_0x47a5('0x6f')}]})[_0x47a5('0x21')](handleEntityNotFound(_0x70c8a6,null))[_0x47a5('0x21')](function(_0x5084d6){_0x1371e4[_0x47a5('0x70')]=_0x5084d6;_0x1371e4['applications']=_['orderBy'](_0x5084d6['Applications'],[_0x47a5('0x71')],['asc']);if(_0x1371e4[_0x47a5('0x70')][_0x47a5('0x6f')]){delete _0x1371e4[_0x47a5('0x70')]['Applications'];}return db[_0x47a5('0x72')][_0x47a5('0x62')]();})[_0x47a5('0x21')](function(_0x121750){if(!_0x121750){throw new db[(_0x47a5('0x1e'))]['ValidationError'](_0x47a5('0x73'));}_0x4c9894=_[_0x47a5('0x74')](_['keys'](_0x121750),[_0x47a5('0x75'),_0x47a5('0x76')]);_0x5bd86e=_[_0x47a5('0x74')](_[_0x47a5('0x40')](_0x121750),[_0x47a5('0x75'),_0x47a5('0x76'),'CompanyId',_0x47a5('0x77')]);_0x1371e4[_0x47a5('0x61')]={'mapKey':'mobile'};if(_0x1371e4[_0x47a5('0x70')][_0x47a5('0x3b')]){switch(_0x1371e4[_0x47a5('0x70')][_0x47a5('0x3b')]){case'twilio':_0x1371e4['body']['from']=_0x109805['body'][_0x47a5('0x78')];_0x1371e4[_0x47a5('0x61')][_0x47a5('0x61')]=_0x109805[_0x47a5('0x61')][_0x47a5('0x79')];_0x1371e4[_0x47a5('0x61')][_0x47a5('0x7a')]=_0x109805[_0x47a5('0x61')]['MessageSid'];break;case _0x47a5('0x7b'):_0x1371e4[_0x47a5('0x61')][_0x47a5('0x7c')]='+'+_0x109805[_0x47a5('0x61')]['sender'];_0x1371e4['body'][_0x47a5('0x61')]=_0x109805['body']['text'];break;case _0x47a5('0x7d'):_0x1371e4[_0x47a5('0x61')]['from']=_0x109805[_0x47a5('0x61')][_0x47a5('0x7c')];_0x1371e4[_0x47a5('0x61')]['body']=_0x109805[_0x47a5('0x61')][_0x47a5('0x28')];break;case'clicksend':_0x1371e4[_0x47a5('0x61')][_0x47a5('0x7c')]=_0x109805[_0x47a5('0x61')][_0x47a5('0x7c')];_0x1371e4[_0x47a5('0x61')][_0x47a5('0x61')]=_0x109805['body'][_0x47a5('0x61')];_0x1371e4['body'][_0x47a5('0x7a')]=_0x109805[_0x47a5('0x61')][_0x47a5('0x7e')];break;case _0x47a5('0x7f'):_0x1371e4['body'][_0x47a5('0x7c')]=_0x109805[_0x47a5('0x61')][_0x47a5('0x78')];_0x1371e4[_0x47a5('0x61')][_0x47a5('0x61')]=_0x109805[_0x47a5('0x61')][_0x47a5('0x80')];_0x1371e4[_0x47a5('0x61')][_0x47a5('0x7a')]=_0x109805[_0x47a5('0x61')][_0x47a5('0x81')];break;case _0x47a5('0x82'):_0x1371e4['body'][_0x47a5('0x7c')]='+'+_0x109805[_0x47a5('0x61')]['results'][0x0][_0x47a5('0x7c')];_0x1371e4[_0x47a5('0x61')][_0x47a5('0x61')]=_0x109805[_0x47a5('0x61')][_0x47a5('0x83')][0x0]['text'];_0x1371e4[_0x47a5('0x61')][_0x47a5('0x7a')]=_0x109805[_0x47a5('0x61')][_0x47a5('0x83')][0x0][_0x47a5('0x7a')];break;case _0x47a5('0x84'):_0x1371e4[_0x47a5('0x61')]['from']=_0x109805['body'][_0x47a5('0x85')];_0x1371e4['body'][_0x47a5('0x61')]=_0x109805['body'][_0x47a5('0x86')][_0x47a5('0x28')];break;case _0x47a5('0x87'):_0x1371e4[_0x47a5('0x61')]['from']=_0x109805[_0x47a5('0x61')][_0x47a5('0x88')];_0x1371e4[_0x47a5('0x61')]['body']=_0x109805['body'][_0x47a5('0x89')];_0x1371e4[_0x47a5('0x61')][_0x47a5('0x7a')]=_0x109805[_0x47a5('0x61')][_0x47a5('0x8a')];break;case _0x47a5('0x8b'):_0x1371e4[_0x47a5('0x61')][_0x47a5('0x7c')]=_0x109805['body'][_0x47a5('0x7c')];_0x1371e4['body'][_0x47a5('0x61')]=_0x109805[_0x47a5('0x61')]['message'];_0x1371e4['body'][_0x47a5('0x7a')]=_0x109805[_0x47a5('0x61')]['refid'];break;}}if(_0x1371e4[_0x47a5('0x61')]['id']){delete _0x1371e4[_0x47a5('0x61')]['id'];}if(_[_0x47a5('0x8c')](_0x1371e4[_0x47a5('0x61')]['from'])){throw new db[(_0x47a5('0x1e'))]['ValidationError']('from\x20is\x20mandatory');}if(_['isNil'](_0x1371e4[_0x47a5('0x61')]['body'])||_0x1371e4[_0x47a5('0x61')][_0x47a5('0x61')]===''){throw new db[(_0x47a5('0x1e'))][(_0x47a5('0x1f'))](_0x47a5('0x8d'));}if(_[_0x47a5('0x8c')](_0x1371e4[_0x47a5('0x61')][_0x47a5('0x8e')])){throw new db[(_0x47a5('0x1e'))][(_0x47a5('0x1f'))](_0x47a5('0x8f')+_0x5bd86e);}if(!_[_0x47a5('0x90')](_0x5bd86e,_0x1371e4[_0x47a5('0x61')][_0x47a5('0x8e')])){throw new db[(_0x47a5('0x1e'))]['ValidationError'](_0x47a5('0x91')+_0x5bd86e);}_0x133b7a[_0x1371e4[_0x47a5('0x61')][_0x47a5('0x8e')]]=_0x1371e4[_0x47a5('0x61')]['from'];return db[_0x47a5('0x92')]['find']({'where':{'id':_0x1371e4[_0x47a5('0x70')]['ListId']},'include':[{'model':db[_0x47a5('0x72')],'as':_0x47a5('0x93'),'where':_0x133b7a,'limit':0x1,'order':[[_0x47a5('0x76'),'DESC']]}]});})[_0x47a5('0x21')](handleEntityNotFound(_0x70c8a6,null))[_0x47a5('0x21')](function(_0x14771b){if(_0x14771b){_0x1371e4['list']=_['omit'](_0x14771b,[_0x47a5('0x93')]);if(_0x14771b[_0x47a5('0x93')][_0x47a5('0x59')]){return _0x14771b[_0x47a5('0x93')][0x0];}var _0x204bd6=_['defaults'](_0x1371e4[_0x47a5('0x61')],{'firstName':_0x1371e4['body'][_0x47a5('0x7c')],'ListId':_0x14771b['id']});_0x204bd6[_0x1371e4[_0x47a5('0x61')][_0x47a5('0x8e')]]=_0x1371e4[_0x47a5('0x61')]['from'];return db['CmContact'][_0x47a5('0x5b')](_0x204bd6,{'fields':_0x4c9894,'raw':!![]});}})[_0x47a5('0x21')](handleEntityNotFound(_0x70c8a6,null))[_0x47a5('0x21')](function(_0x4339d4){if(_0x4339d4){_0x1371e4[_0x47a5('0x94')]=_0x4339d4;var _0x36a44c={'ContactId':_0x4339d4['id'],'phone':_0x1371e4[_0x47a5('0x61')][_0x47a5('0x7c')],'SmsAccountId':_0x109805[_0x47a5('0x56')]['id']};var _0x481bc3={'ContactId':_0x4339d4['id'],'SmsAccountId':_0x109805['params']['id'],'closed':![]};return db[_0x47a5('0x95')]['find']({'where':_0x481bc3})[_0x47a5('0x21')](function(_0x2d0b67){if(_0x2d0b67){return[_0x2d0b67,![]];}return db[_0x47a5('0x95')]['create'](_0x36a44c)[_0x47a5('0x21')](function(_0x26d629){return[_0x26d629,!![]];});});}})['spread'](function(_0xcb6714,_0x51f6cf){_0x1371e4[_0x47a5('0x96')]=_0xcb6714[_0x47a5('0x32')]({'plain':!![]});_0x1371e4[_0x47a5('0x96')]['created']=![];if(_0x51f6cf){if(_0x1371e4['account']['autoclose']){_0x1371e4['applications']['push']({'id':0x0,'priority':_0x1371e4[_0x47a5('0x97')]['length']+0x1,'app':_0x47a5('0x98'),'appdata':_0x47a5('0x99'),'interval':'*,*,*,*'});}_0x1371e4['interaction']['created']=!![];}return db[_0x47a5('0x9a')]['create']({'phone':_0x1371e4['body']['from'],'messageId':_0x1371e4[_0x47a5('0x61')][_0x47a5('0x7a')],'body':_0x1371e4[_0x47a5('0x61')][_0x47a5('0x61')],'SmsAccountId':_0x109805['params']['id'],'SmsInteractionId':_0xcb6714['id'],'direction':'in','ContactId':_0xcb6714[_0x47a5('0x9b')],'AttachmentId':_0x1371e4['body'][_0x47a5('0x9c')]});})['then'](function(_0x2de924){_0x1371e4[_0x47a5('0x28')]=_0x2de924;if(_0x1371e4[_0x47a5('0x96')]['UserId']){return db[_0x47a5('0x9d')][_0x47a5('0x5a')]({'attributes':['id',_0x47a5('0x35')],'where':{'id':_0x1371e4[_0x47a5('0x96')]['UserId']}})[_0x47a5('0x21')](function(_0x9a7edc){if(_0x9a7edc){_0x1371e4[_0x47a5('0x97')][_0x47a5('0x9e')]({'id':0x0,'priority':0x0,'app':_0x47a5('0x9f'),'appdata':_0x9a7edc[_0x47a5('0x35')]+','+(_0x1371e4['account'][_0x47a5('0xa0')]||0xa),'interval':_0x47a5('0xa1')});}return respondWithRpcPromise(_0x47a5('0xa2'),_0x47a5('0xa3'),_0x1371e4);});}return respondWithRpcPromise(_0x47a5('0xa2'),_0x47a5('0xa3'),_0x1371e4);})[_0x47a5('0x21')](function(_0x2697df){if(_0x2697df){var _0x408887=0xc8;var _0x34fde3=_0x47a5('0xa4');logger[_0x47a5('0x22')](_0x47a5('0x25'),_0x34fde3,_0x408887,_0x47a5('0xa5'));logger[_0x47a5('0xa6')](_0x47a5('0xa7'),_0x34fde3,_0x408887,_0x47a5('0xa5'),JSON['stringify'](_0x2697df));if(_0x1371e4[_0x47a5('0x70')]['type']==='twilio'){return _0x70c8a6[_0x47a5('0x2a')](_0x408887)[_0x47a5('0xa8')](_0x47a5('0xa9'),'text/xml')[_0x47a5('0x36')](_0x47a5('0xaa'));}else{return _0x70c8a6[_0x47a5('0x2a')](_0x408887)[_0x47a5('0x2c')](_0x2697df);}}})[_0x47a5('0x54')](handleError(_0x70c8a6,null));};exports[_0x47a5('0xab')]=function(_0x1b1f86,_0x46cb3a,_0x176e71){return db[_0x47a5('0x39')][_0x47a5('0x6b')]({'where':{'id':_0x1b1f86[_0x47a5('0x56')]['id']}})[_0x47a5('0x21')](handleEntityNotFound(_0x46cb3a,null))['then'](function(_0x4aad5f){if(_0x4aad5f){return db[_0x47a5('0xac')]['transaction'](function(_0x249339){return db[_0x47a5('0x6e')][_0x47a5('0x31')]({'where':{'SmsAccountId':_0x1b1f86[_0x47a5('0x56')]['id']},'transaction':_0x249339})[_0x47a5('0x21')](function(_0x3708ea){var _0x583b37=_[_0x47a5('0x3e')](_0x1b1f86[_0x47a5('0x61')],function(_0x380eca){_0x380eca['SmsAccountId']=_0x1b1f86[_0x47a5('0x56')]['id'];return _0x380eca;});return db[_0x47a5('0x6e')][_0x47a5('0xad')](_0x583b37,{'transaction':_0x249339});});})[_0x47a5('0x21')](function(){return db[_0x47a5('0x6e')][_0x47a5('0xae')]({'where':{'SmsAccountId':_0x1b1f86[_0x47a5('0x56')]['id']},'order':_0x47a5('0x71')});});}})[_0x47a5('0x21')](respondWithResult(_0x46cb3a,null))[_0x47a5('0x54')](handleError(_0x46cb3a,null));};exports[_0x47a5('0xaf')]=function(_0x40b7a5,_0x28e998,_0x2ac386){var _0x578983={};var _0x3f7fdc={};var _0x272cd0;var _0x150cff;return db[_0x47a5('0x39')][_0x47a5('0x6b')]({'where':{'id':_0x40b7a5[_0x47a5('0x56')]['id']}})[_0x47a5('0x21')](handleEntityNotFound(_0x28e998,null))['then'](function(_0x185104){if(_0x185104){_0x272cd0=_0x185104;_0x3f7fdc['model']=_[_0x47a5('0x40')](db[_0x47a5('0x6e')][_0x47a5('0x58')]);_0x3f7fdc[_0x47a5('0x3f')]=_[_0x47a5('0x40')](_0x40b7a5[_0x47a5('0x3f')]);_0x3f7fdc[_0x47a5('0x41')]=_[_0x47a5('0x42')](_0x3f7fdc['model'],_0x3f7fdc[_0x47a5('0x3f')]);_0x578983[_0x47a5('0x43')]=_[_0x47a5('0x42')](_0x3f7fdc['model'],qs[_0x47a5('0x44')](_0x40b7a5[_0x47a5('0x3f')][_0x47a5('0x44')]));_0x578983[_0x47a5('0x43')]=_0x578983['attributes'][_0x47a5('0x59')]?_0x578983[_0x47a5('0x43')]:_0x3f7fdc[_0x47a5('0x3d')];_0x578983[_0x47a5('0x47')]=qs['sort'](_0x40b7a5[_0x47a5('0x3f')]['sort']);_0x578983['where']=qs[_0x47a5('0x41')](_[_0x47a5('0x4a')](_0x40b7a5[_0x47a5('0x3f')],_0x3f7fdc[_0x47a5('0x41')]));if(_0x40b7a5['query'][_0x47a5('0x4b')]){_0x578983[_0x47a5('0x49')]=_[_0x47a5('0x4c')](_0x578983[_0x47a5('0x49')],{'$or':_[_0x47a5('0x3e')](_0x578983[_0x47a5('0x43')],function(_0x5eae8d){var _0x1da268={};_0x1da268[_0x5eae8d]={'$like':'%'+_0x40b7a5[_0x47a5('0x3f')][_0x47a5('0x4b')]+'%'};return _0x1da268;})});}_0x578983=_[_0x47a5('0x4c')]({},_0x578983,_0x40b7a5[_0x47a5('0x4e')]);return _0x272cd0['getApplications'](_0x578983);}})[_0x47a5('0x21')](function(_0x4c7627){if(_0x4c7627){_0x150cff=_0x4c7627[_0x47a5('0x59')];if(!_0x40b7a5['query'][_0x47a5('0x45')]('nolimit')){_0x578983['limit']=qs[_0x47a5('0x2e')](_0x40b7a5[_0x47a5('0x3f')]['limit']);_0x578983[_0x47a5('0x2d')]=qs[_0x47a5('0x2d')](_0x40b7a5['query'][_0x47a5('0x2d')]);}return _0x272cd0[_0x47a5('0xaf')](_0x578983);}})[_0x47a5('0x21')](function(_0x508622){if(_0x508622){return _0x508622?{'count':_0x150cff,'rows':_0x508622}:null;}})[_0x47a5('0x21')](respondWithResult(_0x28e998,null))[_0x47a5('0x54')](handleError(_0x28e998,null));};exports[_0x47a5('0xb0')]=function(_0x30b0f9,_0x37721c,_0x53cc9e){var _0x5973d4={'raw':![],'where':{}};var _0x2678cb={};var _0x56808d={'count':0x0,'rows':[]};return db[_0x47a5('0x39')][_0x47a5('0x6b')]({'where':{'id':_0x30b0f9['params']['id']}})['then'](handleEntityNotFound(_0x37721c,null))[_0x47a5('0x21')](function(_0x4997bc){if(_0x4997bc){_0x2678cb[_0x47a5('0x3d')]=_[_0x47a5('0x40')](db[_0x47a5('0x95')][_0x47a5('0x58')]);_0x2678cb[_0x47a5('0x3f')]=_[_0x47a5('0x40')](_0x30b0f9[_0x47a5('0x3f')]);_0x2678cb['filters']=_[_0x47a5('0x42')](_0x2678cb['model'],_0x2678cb[_0x47a5('0x3f')]);_0x5973d4[_0x47a5('0x43')]=_[_0x47a5('0x42')](_0x2678cb[_0x47a5('0x3d')],qs[_0x47a5('0x44')](_0x30b0f9[_0x47a5('0x3f')][_0x47a5('0x44')]));_0x5973d4[_0x47a5('0x43')]=_0x5973d4[_0x47a5('0x43')][_0x47a5('0x59')]?_0x5973d4[_0x47a5('0x43')]:_0x2678cb[_0x47a5('0x3d')];if(!_0x30b0f9['query'][_0x47a5('0x45')](_0x47a5('0x46'))){_0x5973d4[_0x47a5('0x2e')]=qs['limit'](_0x30b0f9[_0x47a5('0x3f')][_0x47a5('0x2e')]);_0x5973d4[_0x47a5('0x2d')]=qs[_0x47a5('0x2d')](_0x30b0f9[_0x47a5('0x3f')][_0x47a5('0x2d')]);}_0x5973d4['order']=qs[_0x47a5('0x48')](_0x30b0f9[_0x47a5('0x3f')][_0x47a5('0x48')]);_0x5973d4[_0x47a5('0x49')]=qs[_0x47a5('0x41')](_[_0x47a5('0x4a')](_0x30b0f9[_0x47a5('0x3f')],_0x2678cb[_0x47a5('0x41')]));_0x5973d4[_0x47a5('0x49')][_0x47a5('0x64')]=_0x4997bc['id'];if(_0x30b0f9['query']['filter']){_0x5973d4[_0x47a5('0x49')]=_[_0x47a5('0x4c')](_0x5973d4[_0x47a5('0x49')],{'$or':_['map'](_0x5973d4[_0x47a5('0x43')],function(_0x50b7fc){var _0x522345={};_0x522345[_0x50b7fc]={'$like':'%'+_0x30b0f9[_0x47a5('0x3f')][_0x47a5('0x4b')]+'%'};return _0x522345;})});}_0x5973d4=_[_0x47a5('0x4c')]({},_0x5973d4,_0x30b0f9[_0x47a5('0x4e')]);return db['SmsInteraction'][_0x47a5('0x4f')]({'where':_0x5973d4[_0x47a5('0x49')]})['then'](function(_0x59ba59){_0x56808d['count']=_0x59ba59;if(_0x30b0f9[_0x47a5('0x3f')][_0x47a5('0x50')]){_0x5973d4[_0x47a5('0x51')]=[{'model':db[_0x47a5('0x72')],'as':_0x47a5('0xb1'),'required':![]},{'model':db['User'],'as':'Owner','attributes':[_0x47a5('0x35'),_0x47a5('0xb2'),_0x47a5('0xb3')],'required':![]},{'model':db[_0x47a5('0xb4')],'as':'Tags','attributes':['id',_0x47a5('0x35'),_0x47a5('0xb5')],'where':_0x30b0f9[_0x47a5('0x3f')][_0x47a5('0xb6')]?{'id':_0x30b0f9['query']['tag']}:undefined,'required':_0x30b0f9['query'][_0x47a5('0xb6')]?!![]:![]}];}return db[_0x47a5('0x95')][_0x47a5('0x52')](_0x5973d4);})[_0x47a5('0x21')](function(_0x242006){_0x56808d[_0x47a5('0x53')]=_0x242006;return _0x56808d;});}})[_0x47a5('0x21')](respondWithFilteredResult(_0x37721c,_0x5973d4))[_0x47a5('0x54')](handleError(_0x37721c,null));};exports[_0x47a5('0x36')]=function(_0x5b48d0,_0x40fe75,_0x7b5348){var _0x50b482,_0x34ff37,_0x2bbf95;if(_[_0x47a5('0x8c')](_0x5b48d0[_0x47a5('0x61')]['body'])||_0x5b48d0[_0x47a5('0x61')][_0x47a5('0x61')]===''){throw new db[(_0x47a5('0x1e'))]['ValidationError']('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x47a5('0x8c')](_0x5b48d0['body']['to'])){throw new db[(_0x47a5('0x1e'))]['ValidationError'](_0x47a5('0xb7'));}_0x50b482=_0x5b48d0[_0x47a5('0x61')]['to'];return db[_0x47a5('0x39')][_0x47a5('0x5a')]({'where':{'id':_0x5b48d0[_0x47a5('0x56')]['id']},'include':[{'model':db['CmList'],'as':'List','include':[{'model':db[_0x47a5('0x72')],'as':_0x47a5('0x93'),'where':{'mobile':_0x50b482},'limit':0x1,'order':[[_0x47a5('0x76'),_0x47a5('0xb8')]]}]}]})['then'](handleEntityNotFound(_0x40fe75,null))['then'](function(_0x3222e4){if(_0x3222e4&&_0x3222e4['List']){_0x34ff37=_0x3222e4[_0x47a5('0x32')]({'plain':!![]});if(_0x34ff37['List']&&_0x34ff37[_0x47a5('0xb9')]['Contacts'][_0x47a5('0x59')]){return _0x34ff37[_0x47a5('0xb9')][_0x47a5('0x93')][0x0];}return db[_0x47a5('0x72')][_0x47a5('0x5b')](_[_0x47a5('0x16')](_0x5b48d0[_0x47a5('0x61')],{'firstName':_0x50b482,'mobile':_0x50b482,'phone':_0x50b482,'ListId':_0x34ff37[_0x47a5('0x77')]}));}})['then'](handleEntityNotFound(_0x40fe75,null))[_0x47a5('0x21')](function(_0x4394f0){if(_0x4394f0){_0x2bbf95=_0x4394f0;return db['SmsInteraction'][_0x47a5('0x5a')]({'where':{'ContactId':_0x2bbf95['id'],'closed':![],'SmsAccountId':_0x34ff37['id']}})[_0x47a5('0x21')](function(_0x54f283){if(_0x54f283){return[_0x54f283,![]];}return db['SmsInteraction'][_0x47a5('0x5b')]({'UserId':_0x5b48d0['user']['id'],'ContactId':_0x2bbf95['id'],'SmsAccountId':_0x34ff37['id'],'phone':_0x50b482,'firstMsgDirection':_0x47a5('0xba'),'Messages':[_[_0x47a5('0x4c')](_0x5b48d0[_0x47a5('0x61')],{'read':![],'body':_0x5b48d0['body'][_0x47a5('0x61')],'phone':_0x50b482,'SmsAccountId':_0x34ff37['id'],'UserId':_0x5b48d0[_0x47a5('0x5c')]['id'],'ContactId':_0x2bbf95['id']})]},{'include':[{'model':db[_0x47a5('0x9a')],'as':_0x47a5('0xbb')}]})[_0x47a5('0x21')](function(_0x454609){return[_0x454609,!![]];});});}})[_0x47a5('0xbc')](function(_0x5c4301,_0x2bc0d8){if(_0x2bc0d8){return _0x5c4301;}return db[_0x47a5('0x9a')][_0x47a5('0x5b')](_[_0x47a5('0x4c')](_0x5b48d0[_0x47a5('0x61')],{'read':![],'body':_0x5b48d0[_0x47a5('0x61')][_0x47a5('0x61')],'phone':_0x50b482,'SmsAccountId':_0x34ff37['id'],'SmsInteractionId':_0x5c4301['id'],'UserId':_0x5b48d0['user']['id'],'ContactId':_0x2bbf95['id']}))['then'](function(_0x11d87b){_0x5c4301[_0x47a5('0xbd')][_0x47a5('0xbb')]=[];_0x5c4301['dataValues']['Messages'][_0x47a5('0xbe')](_0x11d87b[_0x47a5('0xbd')]);return _0x5c4301;});})[_0x47a5('0x21')](respondWithResult(_0x40fe75,null))[_0x47a5('0x54')](handleError(_0x40fe75,null));};exports[_0x47a5('0x2a')]=function(_0x4121c1,_0x2e0add,_0x58e85b){if(_0x4121c1[_0x47a5('0x61')]['id']){delete _0x4121c1[_0x47a5('0x61')]['id'];}console[_0x47a5('0xbf')]('endpoint\x20/status\x20POST\x20/',_0x4121c1[_0x47a5('0x61')]);var _0x611b40,_0x144bc9,_0x278b42;return db[_0x47a5('0x39')][_0x47a5('0x5a')]({'where':{'id':_0x4121c1[_0x47a5('0x56')]['id']}})[_0x47a5('0x21')](handleEntityNotFound(_0x2e0add,null))[_0x47a5('0x21')](function(_0x9ced85){if(_0x9ced85){_0x278b42=_0x9ced85;logger[_0x47a5('0xa6')](_0x47a5('0x25'),_0x47a5('0x2a'),'received\x20delivery\x20report\x20from',_0x9ced85[_0x47a5('0x3b')],util['inspect'](_0x4121c1[_0x47a5('0x61')],{'showHidden':![],'depth':null}));switch(_0x9ced85['type']){case _0x47a5('0x7b'):if(_0x4121c1[_0x47a5('0x61')][_0x47a5('0xc0')]&&_0x4121c1['body'][_0x47a5('0x2a')]){_0x144bc9=_0x4121c1['body'][_0x47a5('0x2a')];return db[_0x47a5('0x9a')][_0x47a5('0x5a')]({'where':{'messageId':_0x4121c1[_0x47a5('0x61')]['skebby_dispatch_id']}});}break;case _0x47a5('0x7d'):if(_0x4121c1['body']['requestid']&&_0x4121c1[_0x47a5('0x61')][_0x47a5('0xc1')]){_0x144bc9=_0x4121c1[_0x47a5('0x61')][_0x47a5('0xc1')];return db[_0x47a5('0x9a')][_0x47a5('0x5a')]({'where':{'messageId':_0x4121c1[_0x47a5('0x61')][_0x47a5('0xc2')]}});}break;case _0x47a5('0xc3'):if(_0x4121c1['body']['message_id']&&_0x4121c1[_0x47a5('0x61')][_0x47a5('0xc4')]){_0x144bc9=_0x4121c1[_0x47a5('0x61')][_0x47a5('0xc4')];return db[_0x47a5('0x9a')]['find']({'where':{'messageId':_0x4121c1[_0x47a5('0x61')][_0x47a5('0x7e')]}});}break;case _0x47a5('0x82'):var _0x50ff41=_0x4121c1['body'][_0x47a5('0x83')][0x0];if(_0x50ff41[_0x47a5('0x7a')]&&_0x50ff41['status'][_0x47a5('0xc5')]===_0x47a5('0xc6')){_0x144bc9=_0x50ff41[_0x47a5('0x2a')]['groupName'];return db[_0x47a5('0x9a')][_0x47a5('0x5a')]({'where':{'messageId':_0x50ff41[_0x47a5('0x7a')]}});}break;case _0x47a5('0x87'):if(_0x4121c1[_0x47a5('0x61')]['messageId']&&_0x4121c1[_0x47a5('0x61')][_0x47a5('0x2a')]){_0x144bc9=_0x4121c1[_0x47a5('0x61')][_0x47a5('0x2a')];return db['SmsMessage']['find']({'where':{'messageId':_0x4121c1[_0x47a5('0x61')]['messageId']}});}break;case _0x47a5('0x8b'):if(_0x4121c1[_0x47a5('0x61')][_0x47a5('0xc7')]&&_0x4121c1[_0x47a5('0x61')][_0x47a5('0x2a')]){_0x144bc9=_0x4121c1[_0x47a5('0x61')]['status'];return db[_0x47a5('0x9a')][_0x47a5('0x5a')]({'where':{'messageId':_0x4121c1[_0x47a5('0x61')]['redif']}});}break;}}})['then'](handleEntityNotFound(_0x2e0add,null))[_0x47a5('0x21')](function(_0x4ebe30){if(_0x4ebe30){_0x611b40=_0x4ebe30;switch(_0x278b42[_0x47a5('0x3b')]){case _0x47a5('0x7b'):if(_0x144bc9===_0x47a5('0xc6')){return _0x611b40[_0x47a5('0x30')]({'read':!![]});}else{logger[_0x47a5('0x26')]('SmsAccount,\x20%s,\x20%s,\x20%s','status',_0x47a5('0x7b'),util[_0x47a5('0xc8')](_0x4121c1[_0x47a5('0x61')],{'showHidden':![],'depth':null}));}break;case _0x47a5('0x7d'):if(_0x144bc9==='1'){return _0x611b40[_0x47a5('0x30')]({'read':!![]});}else{logger['error'](_0x47a5('0x25'),_0x47a5('0x2a'),_0x47a5('0x7b'),util[_0x47a5('0xc8')](_0x4121c1[_0x47a5('0x61')],{'showHidden':![],'depth':null}));}break;case'clicksend':if(!_0x4121c1[_0x47a5('0x61')][_0x47a5('0xc9')]&&_0x144bc9>=0xc8&&_0x144bc9<=0xce){return _0x611b40[_0x47a5('0x30')]({'read':!![]});}else{logger[_0x47a5('0x26')](_0x47a5('0x25'),_0x47a5('0x2a'),_0x47a5('0xc3'),util[_0x47a5('0xc8')](_0x4121c1[_0x47a5('0x61')],{'showHidden':![],'depth':null}));}break;case _0x47a5('0x82'):var _0x2cc493=_0x4121c1['body'][_0x47a5('0x83')][0x0];if(_0x2cc493[_0x47a5('0x2a')][_0x47a5('0xc5')]===_0x47a5('0xc6')){return _0x611b40['update']({'read':!![]});}else{logger['error']('SmsAccount,\x20%s,\x20%s,\x20%s',_0x47a5('0x2a'),'infobip',util[_0x47a5('0xc8')](_0x4121c1[_0x47a5('0x61')],{'showHidden':![],'depth':null}));}break;case'clickatell':if(_0x144bc9==_0x47a5('0xca')||_0x144bc9==_0x47a5('0xcb')){return _0x611b40[_0x47a5('0x30')]({'read':!![]});}else{logger['error'](_0x47a5('0x25'),'status',_0x47a5('0x87'),util[_0x47a5('0xc8')](_0x4121c1[_0x47a5('0x61')],{'showHidden':![],'depth':null}));}break;case _0x47a5('0x8b'):if(_0x144bc9===_0x47a5('0xcc')||_0x144bc9===_0x47a5('0xcd')){return _0x611b40['update']({'read':!![]});}else{logger['error']('SmsAccount,\x20%s,\x20%s,\x20%s',_0x47a5('0x2a'),_0x47a5('0x8b'),util[_0x47a5('0xc8')](_0x4121c1[_0x47a5('0x61')],{'showHidden':![],'depth':null}));}break;}return _0x611b40;}})[_0x47a5('0x21')](respondWithResult(_0x2e0add,null))[_0x47a5('0x54')](handleError(_0x2e0add,null));};exports[_0x47a5('0xce')]=function(_0x138b92,_0x232c36,_0x25954e){var _0x277061,_0x3917e0,_0x1c7695;return db[_0x47a5('0x39')][_0x47a5('0x5a')]({'where':{'id':_0x138b92[_0x47a5('0x56')]['id']}})['then'](handleEntityNotFound(_0x232c36,null))[_0x47a5('0x21')](function(_0x46b82a){if(_0x46b82a){_0x1c7695=_0x46b82a;logger[_0x47a5('0xa6')](_0x47a5('0x25'),_0x47a5('0x2a'),_0x47a5('0xcf'),_0x46b82a[_0x47a5('0x3b')],util[_0x47a5('0xc8')](_0x138b92['query'],{'showHidden':![],'depth':null}));switch(_0x46b82a[_0x47a5('0x3b')]){case'csc':if(_0x138b92[_0x47a5('0x3f')][_0x47a5('0xd0')]&&_0x138b92['query'][_0x47a5('0xd1')]){_0x3917e0=_0x138b92['query'][_0x47a5('0xd1')];return db[_0x47a5('0x9a')][_0x47a5('0x5a')]({'where':{'messageId':_0x138b92[_0x47a5('0x3f')][_0x47a5('0xd0')]}});}break;}}})['then'](handleEntityNotFound(_0x232c36,null))[_0x47a5('0x21')](function(_0x9a2f87){if(_0x9a2f87){_0x277061=_0x9a2f87;switch(_0x1c7695[_0x47a5('0x3b')]){case'csc':if(_0x3917e0==='2'||_0x3917e0==='6'){return _0x277061['update']({'read':!![]});}else{logger[_0x47a5('0x26')](_0x47a5('0x25'),_0x47a5('0x2a'),'csc',util[_0x47a5('0xc8')](_0x138b92[_0x47a5('0x3f')],{'showHidden':![],'depth':null}));};break;}return _0x277061;}})[_0x47a5('0x21')](respondWithResult(_0x232c36,null))['catch'](handleError(_0x232c36,null));};exports[_0x47a5('0xd2')]=function(_0x3136f9,_0x3ecc43,_0xf4b1df){return db['SmsAccount'][_0x47a5('0x5a')]({'where':{'id':_0x3136f9['params']['id']}})[_0x47a5('0x21')](handleEntityNotFound(_0x3ecc43,null))[_0x47a5('0x21')](function(_0xdc5eac){if(_0xdc5eac){return _0xdc5eac[_0x47a5('0xd2')](_0x3136f9['body'][_0x47a5('0x68')],_[_0x47a5('0xd3')](_0x3136f9[_0x47a5('0x61')],[_0x47a5('0x68'),'id'])||{})[_0x47a5('0xbc')](function(_0x4c2b0c){for(var _0xbe3a38=0x0;_0xbe3a38<_0x3136f9[_0x47a5('0x61')][_0x47a5('0x68')][_0x47a5('0x59')];_0xbe3a38+=0x1){socket[_0x47a5('0xd4')](_0x47a5('0xd5'),{'UserId':_0x3136f9['body'][_0x47a5('0x68')][_0xbe3a38],'SmsAccountId':_0x3136f9[_0x47a5('0x56')]['id']});}return _0x4c2b0c;});}})['then'](respondWithResult(_0x3ecc43,null))['catch'](handleError(_0x3ecc43,null));};exports[_0x47a5('0xd6')]=function(_0x32d299,_0x20d99b,_0x3964f8){return db[_0x47a5('0x39')][_0x47a5('0x5a')]({'where':{'id':_0x32d299['params']['id']}})['then'](handleEntityNotFound(_0x20d99b,null))[_0x47a5('0x21')](function(_0xa3a516){if(_0xa3a516){return _0xa3a516['removeAgents'](_0x32d299[_0x47a5('0x3f')][_0x47a5('0x68')])['then'](function(){if(_[_0x47a5('0xd7')](_0x32d299['query']['ids'])){for(var _0x4aeaff=0x0;_0x4aeaff<_0x32d299[_0x47a5('0x3f')][_0x47a5('0x68')][_0x47a5('0x59')];_0x4aeaff+=0x1){socket['emit'](_0x47a5('0xd8'),{'UserId':Number(_0x32d299['query'][_0x47a5('0x68')][_0x4aeaff]),'SmsAccountId':Number(_0x32d299['params']['id'])});}}else{socket[_0x47a5('0xd4')](_0x47a5('0xd8'),{'UserId':Number(_0x32d299[_0x47a5('0x3f')][_0x47a5('0x68')]),'SmsAccountId':Number(_0x32d299[_0x47a5('0x56')]['id'])});}});}})[_0x47a5('0x21')](respondWithStatusCode(_0x20d99b,null))[_0x47a5('0x54')](handleError(_0x20d99b,null));};exports[_0x47a5('0xd9')]=function(_0x1396c2,_0x5c9091,_0x4f1e24){var _0x24c88e={};var _0xa859a={};var _0x5270cc;var _0x2a0f45;return db[_0x47a5('0x39')][_0x47a5('0x6b')]({'where':{'id':_0x1396c2[_0x47a5('0x56')]['id']}})[_0x47a5('0x21')](handleEntityNotFound(_0x5c9091,null))[_0x47a5('0x21')](function(_0x969d4b){if(_0x969d4b){_0x5270cc=_0x969d4b;_0xa859a[_0x47a5('0x3d')]=_[_0x47a5('0x40')](db[_0x47a5('0x9d')]['rawAttributes']);_0xa859a['query']=_['keys'](_0x1396c2['query']);_0xa859a[_0x47a5('0x41')]=_['intersection'](_0xa859a[_0x47a5('0x3d')],_0xa859a[_0x47a5('0x3f')]);_0x24c88e['attributes']=_[_0x47a5('0x42')](_0xa859a[_0x47a5('0x3d')],qs[_0x47a5('0x44')](_0x1396c2[_0x47a5('0x3f')][_0x47a5('0x44')]));_0x24c88e[_0x47a5('0x43')]=_0x24c88e['attributes'][_0x47a5('0x59')]?_0x24c88e[_0x47a5('0x43')]:_0xa859a['model'];_0x24c88e[_0x47a5('0x47')]=qs['sort'](_0x1396c2[_0x47a5('0x3f')][_0x47a5('0x48')]);_0x24c88e[_0x47a5('0x49')]=qs[_0x47a5('0x41')](_[_0x47a5('0x4a')](_0x1396c2[_0x47a5('0x3f')],_0xa859a[_0x47a5('0x41')]));if(_0x1396c2['query'][_0x47a5('0x4b')]){_0x24c88e[_0x47a5('0x49')]=_['merge'](_0x24c88e[_0x47a5('0x49')],{'$or':_[_0x47a5('0x3e')](_0x24c88e['attributes'],function(_0x14c968){var _0x5a7920={};_0x5a7920[_0x14c968]={'$like':'%'+_0x1396c2[_0x47a5('0x3f')][_0x47a5('0x4b')]+'%'};return _0x5a7920;})});}_0x24c88e=_[_0x47a5('0x4c')]({},_0x24c88e,_0x1396c2[_0x47a5('0x4e')]);return _0x5270cc[_0x47a5('0xd9')](_0x24c88e);}})['then'](function(_0x4b8b65){if(_0x4b8b65){_0x2a0f45=_0x4b8b65[_0x47a5('0x59')];if(!_0x1396c2['query']['hasOwnProperty']('nolimit')){_0x24c88e[_0x47a5('0x2e')]=qs['limit'](_0x1396c2[_0x47a5('0x3f')][_0x47a5('0x2e')]);_0x24c88e[_0x47a5('0x2d')]=qs['offset'](_0x1396c2['query'][_0x47a5('0x2d')]);}return _0x5270cc['getAgents'](_0x24c88e);}})['then'](function(_0xe87e6e){if(_0xe87e6e){return _0xe87e6e?{'count':_0x2a0f45,'rows':_0xe87e6e}:null;}})['then'](respondWithResult(_0x5c9091,null))['catch'](handleError(_0x5c9091,null));};
\ No newline at end of file
+var _0x7a54=['findAndCountAll','getApplications','getInteractions','Contact','fullname','internal','Tag','color','tag','to\x20is\x20mandatory','DESC','List','out','Messages','spread','dataValues','push','log','skebby_dispatch_id','statusInt','requestid','clicksend','status_code','groupName','DELIVERED','redif','inspect','error_code','DELIVERED_TO_GATEWAY','RECEIVED_BY_RECIPIENT','DELIVRD','ACCEPTD','statusGet','received\x20delivery\x20report\x20from','message-id','state','addAgents','omit','emit','userSmsAccount:save','removeAgents','isArray','userSmsAccount:remove','getAgents','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./smsAccount.socket','register','jayson/promise','client','http','test','Sequelize','ValidationError','request','then','info','SmsAccount,\x20%s,\x20%s','request\x20sent','SmsAccount,\x20%s,\x20%s,\x20%s','error','code','message','sendStatus','status','end','json','offset','limit','reject','update','destroy','get','UserProfileResource','stack','name','send','index','Pause','SmsAccount','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','count','includeAll','include','findAll','rows','catch','show','params','mandatoryDispositionPause','rawAttributes','length','find','create','user','role','SmsAccounts','UserProfileSection','autoAssociation','body','describe','addDisposition','SmsAccountId','Disposition','getDispositions','removeDispositions','ids','addAnswer','CannedAnswer','findOne','removeAnswers','notify','SmsApplication','Applications','account','priority','CmContact','no\x20available\x20attributes','difference','createdAt','updatedAt','ListId','From','Body','messageId','skebby','from','connectel','message_id','plivo','Text','MessageUUID','infobip','results','csc','originatingAddress','segmentedMessage','clickatell','fromNumber','text','replyMessageId','intelepeer','isNil','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','Contacts','contact','SmsInteraction','interaction','applications','close','unmanaged','SmsMessage','ContactId','AttachmentId','User','unshift','agent','waitForTheAssignedAgent','*,*,*,*','Start','startRouting','receiveMessage','entity\x20found','debug','SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s','set','Content-Type','\x0a ','addApplications','sequelize','bulkCreate'];(function(_0x359aa7,_0x4978cc){var _0x28ac7f=function(_0x7daaf1){while(--_0x7daaf1){_0x359aa7['push'](_0x359aa7['shift']());}};_0x28ac7f(++_0x4978cc);}(_0x7a54,0x106));var _0x47a5=function(_0x2057ee,_0x583044){_0x2057ee=_0x2057ee-0x0;var _0x26baa0=_0x7a54[_0x2057ee];return _0x26baa0;};'use strict';var pdf=require(_0x47a5('0x0'));var emlformat=require(_0x47a5('0x1'));var rimraf=require(_0x47a5('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x47a5('0x3'));var rp=require(_0x47a5('0x4'));var moment=require('moment');var BPromise=require(_0x47a5('0x5'));var Mustache=require(_0x47a5('0x6'));var util=require(_0x47a5('0x7'));var path=require(_0x47a5('0x8'));var sox=require(_0x47a5('0x9'));var csv=require('to-csv');var ejs=require(_0x47a5('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var db=require(_0x47a5('0x14'))['db'];config[_0x47a5('0x15')]=_[_0x47a5('0x16')](config[_0x47a5('0x15')],{'host':'localhost','port':0x18eb});var socket=require(_0x47a5('0x17'))(new Redis(config[_0x47a5('0x15')]));require(_0x47a5('0x18'))[_0x47a5('0x19')](socket);var jayson=require(_0x47a5('0x1a'));var client=jayson[_0x47a5('0x1b')][_0x47a5('0x1c')]({'port':0x232c});function checkPasswordPattern(_0x190faa,_0x4e99a8,_0x362359){if(_0x362359){var _0x11faf5=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x11faf5[_0x47a5('0x1d')](_0x4e99a8)){return _0x190faa;}else{throw new db[(_0x47a5('0x1e'))][(_0x47a5('0x1f'))]('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x190faa;}}function respondWithRpcPromise(_0x549de3,_0x138bc0,_0x4b966e,_0x5247fd){return new BPromise(function(_0x423a81,_0xaf70a6){var _0x2ce454=_0x5247fd||client;return _0x2ce454[_0x47a5('0x20')](_0x549de3,_0x4b966e)[_0x47a5('0x21')](function(_0x12b98e){logger[_0x47a5('0x22')](_0x47a5('0x23'),_0x138bc0,_0x47a5('0x24'));logger['debug'](_0x47a5('0x25'),_0x138bc0,_0x47a5('0x24'),JSON['stringify'](_0x12b98e));if(_0x12b98e[_0x47a5('0x26')]){if(_0x12b98e[_0x47a5('0x26')][_0x47a5('0x27')]===0x1f4){logger['error'](_0x47a5('0x23'),_0x138bc0,_0x12b98e[_0x47a5('0x26')][_0x47a5('0x28')]);return _0xaf70a6(_0x12b98e[_0x47a5('0x26')]['message']);}logger[_0x47a5('0x26')](_0x47a5('0x23'),_0x138bc0,_0x12b98e['error'][_0x47a5('0x28')]);return _0x423a81(_0x12b98e[_0x47a5('0x26')][_0x47a5('0x28')]);}else{logger[_0x47a5('0x22')](_0x47a5('0x23'),_0x138bc0,'request\x20sent');_0x423a81(_0x12b98e['result'][_0x47a5('0x28')]);}})['catch'](function(_0x1ea9c8){logger['error'](_0x47a5('0x23'),_0x138bc0,_0x1ea9c8);_0xaf70a6(_0x1ea9c8);});});}function respondWithStatusCode(_0x378208,_0x36ad34){_0x36ad34=_0x36ad34||0xcc;return function(_0x1dac65){if(_0x1dac65){return _0x378208[_0x47a5('0x29')](_0x36ad34);}return _0x378208[_0x47a5('0x2a')](_0x36ad34)[_0x47a5('0x2b')]();};}function respondWithResult(_0x136b14,_0x16631f){_0x16631f=_0x16631f||0xc8;return function(_0x361bfa){if(_0x361bfa){return _0x136b14[_0x47a5('0x2a')](_0x16631f)[_0x47a5('0x2c')](_0x361bfa);}};}function respondWithFilteredResult(_0x3ad507,_0x528582){return function(_0x243210){if(_0x243210){var _0x51833b=_0x243210['count'],_0x2ef875=_0x528582[_0x47a5('0x2d')],_0x9ac908=_0x528582[_0x47a5('0x2d')]+_0x528582[_0x47a5('0x2e')],_0x16901f;if(_0x9ac908>=_0x51833b){_0x9ac908=_0x51833b;_0x16901f=0xc8;}else{_0x16901f=0xce;}_0x3ad507[_0x47a5('0x2a')](_0x16901f);return _0x3ad507['set']('Content-Range',_0x2ef875+'-'+_0x9ac908+'/'+_0x51833b)[_0x47a5('0x2c')](_0x243210);}return null;};}function patchUpdates(_0xfb5ddb){return function(_0x5bd7eb){try{jsonpatch['apply'](_0x5bd7eb,_0xfb5ddb,!![]);}catch(_0x836303){return BPromise[_0x47a5('0x2f')](_0x836303);}return _0x5bd7eb['save']();};}function saveUpdates(_0x42f70c,_0x53119b){return function(_0x122ed6){if(_0x122ed6){return _0x122ed6[_0x47a5('0x30')](_0x42f70c)['then'](function(_0x4843c0){return _0x4843c0;});}return null;};}function removeEntity(_0x274e34,_0x5910bb){return function(_0x403028){if(_0x403028){return _0x403028[_0x47a5('0x31')]()[_0x47a5('0x21')](function(){var _0x52749b=_0x403028[_0x47a5('0x32')]({'plain':!![]});var _0x50c086='SmsAccounts';return db[_0x47a5('0x33')]['destroy']({'where':{'type':_0x50c086,'resourceId':_0x52749b['id']}})[_0x47a5('0x21')](function(){return _0x403028;});})['then'](function(){_0x274e34[_0x47a5('0x2a')](0xcc)[_0x47a5('0x2b')]();});}};}function handleEntityNotFound(_0x38c8d4,_0x199698){return function(_0x36add5){if(!_0x36add5){_0x38c8d4[_0x47a5('0x29')](0x194);}return _0x36add5;};}function handleError(_0xee582c,_0x452be5){_0x452be5=_0x452be5||0x1f4;return function(_0x1a0d23){logger['error'](_0x1a0d23[_0x47a5('0x34')]);if(_0x1a0d23[_0x47a5('0x35')]){delete _0x1a0d23['name'];}_0xee582c[_0x47a5('0x2a')](_0x452be5)[_0x47a5('0x36')](_0x1a0d23);};}exports[_0x47a5('0x37')]=function(_0x49c4b5,_0x101f70){var _0x10f660={'include':[{'model':db[_0x47a5('0x38')],'as':'mandatoryDispositionPause'}]},_0x596097={},_0x2ebba0={'count':0x0,'rows':[]};var _0x55c5eb=_['map'](db[_0x47a5('0x39')]['rawAttributes'],function(_0x9b5eaf){return{'name':_0x9b5eaf[_0x47a5('0x3a')],'type':_0x9b5eaf[_0x47a5('0x3b')][_0x47a5('0x3c')]};});_0x596097[_0x47a5('0x3d')]=_[_0x47a5('0x3e')](_0x55c5eb,_0x47a5('0x35'));_0x596097[_0x47a5('0x3f')]=_[_0x47a5('0x40')](_0x49c4b5[_0x47a5('0x3f')]);_0x596097[_0x47a5('0x41')]=_[_0x47a5('0x42')](_0x596097[_0x47a5('0x3d')],_0x596097['query']);_0x10f660[_0x47a5('0x43')]=_[_0x47a5('0x42')](_0x596097[_0x47a5('0x3d')],qs[_0x47a5('0x44')](_0x49c4b5['query'][_0x47a5('0x44')]));_0x10f660['attributes']=_0x10f660['attributes']['length']?_0x10f660['attributes']:_0x596097[_0x47a5('0x3d')];if(!_0x49c4b5['query'][_0x47a5('0x45')](_0x47a5('0x46'))){_0x10f660[_0x47a5('0x2e')]=qs['limit'](_0x49c4b5[_0x47a5('0x3f')][_0x47a5('0x2e')]);_0x10f660['offset']=qs['offset'](_0x49c4b5[_0x47a5('0x3f')]['offset']);}_0x10f660[_0x47a5('0x47')]=qs[_0x47a5('0x48')](_0x49c4b5[_0x47a5('0x3f')][_0x47a5('0x48')]);_0x10f660[_0x47a5('0x49')]=qs[_0x47a5('0x41')](_[_0x47a5('0x4a')](_0x49c4b5[_0x47a5('0x3f')],_0x596097[_0x47a5('0x41')]),_0x55c5eb);if(_0x49c4b5[_0x47a5('0x3f')][_0x47a5('0x4b')]){_0x10f660[_0x47a5('0x49')]=_[_0x47a5('0x4c')](_0x10f660[_0x47a5('0x49')],{'$or':_[_0x47a5('0x3e')](_0x55c5eb,function(_0x3a2b38){if(_0x3a2b38['type']!==_0x47a5('0x4d')){var _0x23bb04={};_0x23bb04[_0x3a2b38['name']]={'$like':'%'+_0x49c4b5['query'][_0x47a5('0x4b')]+'%'};return _0x23bb04;}})});}_0x10f660=_['merge']({},_0x10f660,_0x49c4b5[_0x47a5('0x4e')]);var _0xd93e37={'where':_0x10f660['where']};return db['SmsAccount'][_0x47a5('0x4f')](_0xd93e37)['then'](function(_0x2d147c){_0x2ebba0[_0x47a5('0x4f')]=_0x2d147c;if(_0x49c4b5[_0x47a5('0x3f')][_0x47a5('0x50')]){_0x10f660[_0x47a5('0x51')]=[{'all':!![]}];}return db[_0x47a5('0x39')][_0x47a5('0x52')](_0x10f660);})['then'](function(_0x48a0ef){_0x2ebba0[_0x47a5('0x53')]=_0x48a0ef;return _0x2ebba0;})[_0x47a5('0x21')](respondWithFilteredResult(_0x101f70,_0x10f660))[_0x47a5('0x54')](handleError(_0x101f70,null));};exports[_0x47a5('0x55')]=function(_0x2c7020,_0x2c0c86){var _0x249de5={'raw':![],'where':{'id':_0x2c7020[_0x47a5('0x56')]['id']},'include':[{'model':db[_0x47a5('0x38')],'as':_0x47a5('0x57')}]},_0x492cf7={};_0x492cf7['model']=_[_0x47a5('0x40')](db['SmsAccount'][_0x47a5('0x58')]);_0x492cf7[_0x47a5('0x3f')]=_[_0x47a5('0x40')](_0x2c7020[_0x47a5('0x3f')]);_0x492cf7['filters']=_[_0x47a5('0x42')](_0x492cf7[_0x47a5('0x3d')],_0x492cf7[_0x47a5('0x3f')]);_0x249de5[_0x47a5('0x43')]=_[_0x47a5('0x42')](_0x492cf7[_0x47a5('0x3d')],qs[_0x47a5('0x44')](_0x2c7020['query'][_0x47a5('0x44')]));_0x249de5[_0x47a5('0x43')]=_0x249de5[_0x47a5('0x43')][_0x47a5('0x59')]?_0x249de5[_0x47a5('0x43')]:_0x492cf7[_0x47a5('0x3d')];if(_0x2c7020['query'][_0x47a5('0x50')]){_0x249de5[_0x47a5('0x51')]=[{'all':!![]}];}_0x249de5=_[_0x47a5('0x4c')]({},_0x249de5,_0x2c7020['options']);return db[_0x47a5('0x39')][_0x47a5('0x5a')](_0x249de5)[_0x47a5('0x21')](handleEntityNotFound(_0x2c0c86,null))['then'](respondWithResult(_0x2c0c86,null))['catch'](handleError(_0x2c0c86,null));};exports[_0x47a5('0x5b')]=function(_0x376e1d,_0x4fa1da){return db['SmsAccount'][_0x47a5('0x5b')](_0x376e1d['body'],{})[_0x47a5('0x21')](function(_0x5d383d){var _0x482de6=_0x376e1d[_0x47a5('0x5c')][_0x47a5('0x32')]({'plain':!![]});if(!_0x482de6)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x482de6[_0x47a5('0x5d')]===_0x47a5('0x5c')){var _0x4b706a=_0x5d383d['get']({'plain':!![]});var _0x16b4fd=_0x47a5('0x5e');return db[_0x47a5('0x5f')][_0x47a5('0x5a')]({'where':{'name':_0x16b4fd,'userProfileId':_0x482de6['userProfileId']},'raw':!![]})[_0x47a5('0x21')](function(_0x2b4255){if(_0x2b4255&&_0x2b4255[_0x47a5('0x60')]===0x0){return db['UserProfileResource'][_0x47a5('0x5b')]({'name':_0x4b706a['name'],'resourceId':_0x4b706a['id'],'type':_0x2b4255[_0x47a5('0x35')],'sectionId':_0x2b4255['id']},{})[_0x47a5('0x21')](function(){return _0x5d383d;});}else{return _0x5d383d;}})[_0x47a5('0x54')](function(_0x1c485b){logger[_0x47a5('0x26')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1c485b);throw _0x1c485b;});}return _0x5d383d;})[_0x47a5('0x21')](respondWithResult(_0x4fa1da,0xc9))['catch'](handleError(_0x4fa1da,null));};exports['update']=function(_0x5eb150,_0x4f8564){if(_0x5eb150[_0x47a5('0x61')]['id']){delete _0x5eb150[_0x47a5('0x61')]['id'];}return db[_0x47a5('0x39')]['find']({'where':{'id':_0x5eb150['params']['id']},'include':[{'model':db[_0x47a5('0x38')],'as':_0x47a5('0x57')}]})[_0x47a5('0x21')](handleEntityNotFound(_0x4f8564,null))[_0x47a5('0x21')](saveUpdates(_0x5eb150[_0x47a5('0x61')],null))['then'](respondWithResult(_0x4f8564,null))[_0x47a5('0x54')](handleError(_0x4f8564,null));};exports['destroy']=function(_0x22c886,_0x274d31){return db['SmsAccount'][_0x47a5('0x5a')]({'where':{'id':_0x22c886[_0x47a5('0x56')]['id']}})[_0x47a5('0x21')](handleEntityNotFound(_0x274d31,null))[_0x47a5('0x21')](removeEntity(_0x274d31,null))[_0x47a5('0x54')](handleError(_0x274d31,null));};exports[_0x47a5('0x62')]=function(_0x35cca8,_0x3ac38c){return db['SmsAccount'][_0x47a5('0x62')]()[_0x47a5('0x21')](respondWithResult(_0x3ac38c,null))[_0x47a5('0x54')](handleError(_0x3ac38c,null));};exports[_0x47a5('0x63')]=function(_0x396cb0,_0x4bbe14,_0xbec033){if(_0x396cb0[_0x47a5('0x61')]['id']){delete _0x396cb0[_0x47a5('0x61')]['id'];}return db[_0x47a5('0x39')][_0x47a5('0x5a')]({'where':{'id':_0x396cb0[_0x47a5('0x56')]['id']}})[_0x47a5('0x21')](handleEntityNotFound(_0x4bbe14,null))[_0x47a5('0x21')](function(_0x350af8){if(_0x350af8){_0x396cb0[_0x47a5('0x61')][_0x47a5('0x64')]=_0x350af8['id'];return db[_0x47a5('0x65')][_0x47a5('0x5b')](_0x396cb0[_0x47a5('0x61')]);}})[_0x47a5('0x21')](respondWithResult(_0x4bbe14,null))['catch'](handleError(_0x4bbe14,null));};exports[_0x47a5('0x66')]=function(_0x284fb8,_0x30504e,_0x4b42f3){var _0x37ac59={'raw':![],'where':{}};var _0x2e46af={};var _0x36c67={'count':0x0,'rows':[]};return db[_0x47a5('0x39')]['findOne']({'where':{'id':_0x284fb8[_0x47a5('0x56')]['id']}})['then'](handleEntityNotFound(_0x30504e,null))[_0x47a5('0x21')](function(_0x487e21){if(_0x487e21){_0x2e46af[_0x47a5('0x3d')]=_['keys'](db[_0x47a5('0x65')][_0x47a5('0x58')]);_0x2e46af[_0x47a5('0x3f')]=_['keys'](_0x284fb8['query']);_0x2e46af['filters']=_[_0x47a5('0x42')](_0x2e46af[_0x47a5('0x3d')],_0x2e46af[_0x47a5('0x3f')]);_0x37ac59[_0x47a5('0x43')]=_['intersection'](_0x2e46af[_0x47a5('0x3d')],qs[_0x47a5('0x44')](_0x284fb8[_0x47a5('0x3f')][_0x47a5('0x44')]));_0x37ac59[_0x47a5('0x43')]=_0x37ac59[_0x47a5('0x43')][_0x47a5('0x59')]?_0x37ac59[_0x47a5('0x43')]:_0x2e46af[_0x47a5('0x3d')];if(!_0x284fb8[_0x47a5('0x3f')][_0x47a5('0x45')](_0x47a5('0x46'))){_0x37ac59['limit']=qs[_0x47a5('0x2e')](_0x284fb8['query'][_0x47a5('0x2e')]);_0x37ac59[_0x47a5('0x2d')]=qs[_0x47a5('0x2d')](_0x284fb8[_0x47a5('0x3f')][_0x47a5('0x2d')]);}_0x37ac59[_0x47a5('0x47')]=qs[_0x47a5('0x48')](_0x284fb8[_0x47a5('0x3f')][_0x47a5('0x48')]);_0x37ac59[_0x47a5('0x49')]=qs[_0x47a5('0x41')](_[_0x47a5('0x4a')](_0x284fb8[_0x47a5('0x3f')],_0x2e46af[_0x47a5('0x41')]));_0x37ac59[_0x47a5('0x49')]['SmsAccountId']=_0x487e21['id'];if(_0x284fb8['query']['filter']){_0x37ac59['where']=_[_0x47a5('0x4c')](_0x37ac59[_0x47a5('0x49')],{'$or':_['map'](_0x37ac59[_0x47a5('0x43')],function(_0x44dda2){var _0x1baa5a={};_0x1baa5a[_0x44dda2]={'$like':'%'+_0x284fb8[_0x47a5('0x3f')][_0x47a5('0x4b')]+'%'};return _0x1baa5a;})});}_0x37ac59=_[_0x47a5('0x4c')]({},_0x37ac59,_0x284fb8[_0x47a5('0x4e')]);return db[_0x47a5('0x65')][_0x47a5('0x4f')]({'where':_0x37ac59[_0x47a5('0x49')]})[_0x47a5('0x21')](function(_0x5e5f16){_0x36c67[_0x47a5('0x4f')]=_0x5e5f16;if(_0x284fb8[_0x47a5('0x3f')][_0x47a5('0x50')]){_0x37ac59['include']=[{'all':!![]}];}return db[_0x47a5('0x65')][_0x47a5('0x52')](_0x37ac59);})[_0x47a5('0x21')](function(_0x5d41d8){_0x36c67[_0x47a5('0x53')]=_0x5d41d8;return _0x36c67;});}})['then'](respondWithFilteredResult(_0x30504e,_0x37ac59))['catch'](handleError(_0x30504e,null));};exports[_0x47a5('0x67')]=function(_0x292d9c,_0x277486,_0x27333e){return db[_0x47a5('0x39')][_0x47a5('0x5a')]({'where':{'id':_0x292d9c['params']['id']}})['then'](handleEntityNotFound(_0x277486,null))[_0x47a5('0x21')](function(_0x4f2361){if(_0x4f2361){return _0x4f2361[_0x47a5('0x67')](_0x292d9c[_0x47a5('0x3f')][_0x47a5('0x68')]);}})[_0x47a5('0x21')](respondWithStatusCode(_0x277486,null))['catch'](handleError(_0x277486,null));};exports[_0x47a5('0x69')]=function(_0x550bde,_0x5f3a04,_0x139c79){if(_0x550bde[_0x47a5('0x61')]['id']){delete _0x550bde['body']['id'];}return db[_0x47a5('0x39')][_0x47a5('0x5a')]({'where':{'id':_0x550bde[_0x47a5('0x56')]['id']}})['then'](handleEntityNotFound(_0x5f3a04,null))[_0x47a5('0x21')](function(_0x578e27){if(_0x578e27){_0x550bde[_0x47a5('0x61')][_0x47a5('0x64')]=_0x578e27['id'];return db[_0x47a5('0x6a')]['create'](_0x550bde[_0x47a5('0x61')]);}})[_0x47a5('0x21')](respondWithResult(_0x5f3a04,null))[_0x47a5('0x54')](handleError(_0x5f3a04,null));};exports['getAnswers']=function(_0x3525e7,_0x4f2fbb,_0x3c012b){var _0x491bb4={'raw':![],'where':{}};var _0x135d2e={};var _0x20d8bd={'count':0x0,'rows':[]};return db[_0x47a5('0x39')][_0x47a5('0x6b')]({'where':{'id':_0x3525e7['params']['id']}})[_0x47a5('0x21')](handleEntityNotFound(_0x4f2fbb,null))[_0x47a5('0x21')](function(_0x23c393){if(_0x23c393){_0x135d2e[_0x47a5('0x3d')]=_[_0x47a5('0x40')](db['CannedAnswer']['rawAttributes']);_0x135d2e[_0x47a5('0x3f')]=_['keys'](_0x3525e7[_0x47a5('0x3f')]);_0x135d2e[_0x47a5('0x41')]=_[_0x47a5('0x42')](_0x135d2e['model'],_0x135d2e[_0x47a5('0x3f')]);_0x491bb4[_0x47a5('0x43')]=_['intersection'](_0x135d2e[_0x47a5('0x3d')],qs[_0x47a5('0x44')](_0x3525e7[_0x47a5('0x3f')][_0x47a5('0x44')]));_0x491bb4['attributes']=_0x491bb4['attributes'][_0x47a5('0x59')]?_0x491bb4[_0x47a5('0x43')]:_0x135d2e['model'];if(!_0x3525e7[_0x47a5('0x3f')][_0x47a5('0x45')]('nolimit')){_0x491bb4[_0x47a5('0x2e')]=qs[_0x47a5('0x2e')](_0x3525e7[_0x47a5('0x3f')]['limit']);_0x491bb4[_0x47a5('0x2d')]=qs['offset'](_0x3525e7[_0x47a5('0x3f')]['offset']);}_0x491bb4[_0x47a5('0x47')]=qs[_0x47a5('0x48')](_0x3525e7['query'][_0x47a5('0x48')]);_0x491bb4['where']=qs[_0x47a5('0x41')](_[_0x47a5('0x4a')](_0x3525e7[_0x47a5('0x3f')],_0x135d2e[_0x47a5('0x41')]));_0x491bb4['where'][_0x47a5('0x64')]=_0x23c393['id'];if(_0x3525e7['query']['filter']){_0x491bb4[_0x47a5('0x49')]=_[_0x47a5('0x4c')](_0x491bb4[_0x47a5('0x49')],{'$or':_[_0x47a5('0x3e')](_0x491bb4[_0x47a5('0x43')],function(_0x5b1f5e){var _0x1522a6={};_0x1522a6[_0x5b1f5e]={'$like':'%'+_0x3525e7[_0x47a5('0x3f')][_0x47a5('0x4b')]+'%'};return _0x1522a6;})});}_0x491bb4=_[_0x47a5('0x4c')]({},_0x491bb4,_0x3525e7['options']);return db[_0x47a5('0x6a')]['count']({'where':_0x491bb4[_0x47a5('0x49')]})[_0x47a5('0x21')](function(_0x3f93f0){_0x20d8bd[_0x47a5('0x4f')]=_0x3f93f0;if(_0x3525e7[_0x47a5('0x3f')][_0x47a5('0x50')]){_0x491bb4[_0x47a5('0x51')]=[{'all':!![]}];}return db[_0x47a5('0x6a')][_0x47a5('0x52')](_0x491bb4);})['then'](function(_0x36796e){_0x20d8bd[_0x47a5('0x53')]=_0x36796e;return _0x20d8bd;});}})['then'](respondWithFilteredResult(_0x4f2fbb,_0x491bb4))[_0x47a5('0x54')](handleError(_0x4f2fbb,null));};exports[_0x47a5('0x6c')]=function(_0x6d6a5,_0x5b85cd,_0x4bf1f5){return db[_0x47a5('0x39')][_0x47a5('0x5a')]({'where':{'id':_0x6d6a5['params']['id']}})['then'](handleEntityNotFound(_0x5b85cd,null))[_0x47a5('0x21')](function(_0x17f82d){if(_0x17f82d){return _0x17f82d['removeAnswers'](_0x6d6a5[_0x47a5('0x3f')][_0x47a5('0x68')]);}})['then'](respondWithStatusCode(_0x5b85cd,null))[_0x47a5('0x54')](handleError(_0x5b85cd,null));};exports[_0x47a5('0x6d')]=function(_0x109805,_0x70c8a6,_0x364bb0){var _0x1371e4={'channel':'sms'};var _0x4c9894=[];var _0x5bd86e=[];var _0x133b7a={};return db[_0x47a5('0x39')]['find']({'where':{'id':_0x109805[_0x47a5('0x56')]['id']},'include':[{'model':db[_0x47a5('0x6e')],'as':_0x47a5('0x6f')}]})[_0x47a5('0x21')](handleEntityNotFound(_0x70c8a6,null))[_0x47a5('0x21')](function(_0x5084d6){_0x1371e4[_0x47a5('0x70')]=_0x5084d6;_0x1371e4['applications']=_['orderBy'](_0x5084d6['Applications'],[_0x47a5('0x71')],['asc']);if(_0x1371e4[_0x47a5('0x70')][_0x47a5('0x6f')]){delete _0x1371e4[_0x47a5('0x70')]['Applications'];}return db[_0x47a5('0x72')][_0x47a5('0x62')]();})[_0x47a5('0x21')](function(_0x121750){if(!_0x121750){throw new db[(_0x47a5('0x1e'))]['ValidationError'](_0x47a5('0x73'));}_0x4c9894=_[_0x47a5('0x74')](_['keys'](_0x121750),[_0x47a5('0x75'),_0x47a5('0x76')]);_0x5bd86e=_[_0x47a5('0x74')](_[_0x47a5('0x40')](_0x121750),[_0x47a5('0x75'),_0x47a5('0x76'),'CompanyId',_0x47a5('0x77')]);_0x1371e4[_0x47a5('0x61')]={'mapKey':'mobile'};if(_0x1371e4[_0x47a5('0x70')][_0x47a5('0x3b')]){switch(_0x1371e4[_0x47a5('0x70')][_0x47a5('0x3b')]){case'twilio':_0x1371e4['body']['from']=_0x109805['body'][_0x47a5('0x78')];_0x1371e4[_0x47a5('0x61')][_0x47a5('0x61')]=_0x109805[_0x47a5('0x61')][_0x47a5('0x79')];_0x1371e4[_0x47a5('0x61')][_0x47a5('0x7a')]=_0x109805[_0x47a5('0x61')]['MessageSid'];break;case _0x47a5('0x7b'):_0x1371e4[_0x47a5('0x61')][_0x47a5('0x7c')]='+'+_0x109805[_0x47a5('0x61')]['sender'];_0x1371e4['body'][_0x47a5('0x61')]=_0x109805['body']['text'];break;case _0x47a5('0x7d'):_0x1371e4[_0x47a5('0x61')]['from']=_0x109805[_0x47a5('0x61')][_0x47a5('0x7c')];_0x1371e4[_0x47a5('0x61')]['body']=_0x109805[_0x47a5('0x61')][_0x47a5('0x28')];break;case'clicksend':_0x1371e4[_0x47a5('0x61')][_0x47a5('0x7c')]=_0x109805[_0x47a5('0x61')][_0x47a5('0x7c')];_0x1371e4[_0x47a5('0x61')][_0x47a5('0x61')]=_0x109805['body'][_0x47a5('0x61')];_0x1371e4['body'][_0x47a5('0x7a')]=_0x109805[_0x47a5('0x61')][_0x47a5('0x7e')];break;case _0x47a5('0x7f'):_0x1371e4['body'][_0x47a5('0x7c')]=_0x109805[_0x47a5('0x61')][_0x47a5('0x78')];_0x1371e4[_0x47a5('0x61')][_0x47a5('0x61')]=_0x109805[_0x47a5('0x61')][_0x47a5('0x80')];_0x1371e4[_0x47a5('0x61')][_0x47a5('0x7a')]=_0x109805[_0x47a5('0x61')][_0x47a5('0x81')];break;case _0x47a5('0x82'):_0x1371e4['body'][_0x47a5('0x7c')]='+'+_0x109805[_0x47a5('0x61')]['results'][0x0][_0x47a5('0x7c')];_0x1371e4[_0x47a5('0x61')][_0x47a5('0x61')]=_0x109805[_0x47a5('0x61')][_0x47a5('0x83')][0x0]['text'];_0x1371e4[_0x47a5('0x61')][_0x47a5('0x7a')]=_0x109805[_0x47a5('0x61')][_0x47a5('0x83')][0x0][_0x47a5('0x7a')];break;case _0x47a5('0x84'):_0x1371e4[_0x47a5('0x61')]['from']=_0x109805['body'][_0x47a5('0x85')];_0x1371e4['body'][_0x47a5('0x61')]=_0x109805['body'][_0x47a5('0x86')][_0x47a5('0x28')];break;case _0x47a5('0x87'):_0x1371e4[_0x47a5('0x61')]['from']=_0x109805[_0x47a5('0x61')][_0x47a5('0x88')];_0x1371e4[_0x47a5('0x61')]['body']=_0x109805['body'][_0x47a5('0x89')];_0x1371e4[_0x47a5('0x61')][_0x47a5('0x7a')]=_0x109805[_0x47a5('0x61')][_0x47a5('0x8a')];break;case _0x47a5('0x8b'):_0x1371e4[_0x47a5('0x61')][_0x47a5('0x7c')]=_0x109805['body'][_0x47a5('0x7c')];_0x1371e4['body'][_0x47a5('0x61')]=_0x109805[_0x47a5('0x61')]['message'];_0x1371e4['body'][_0x47a5('0x7a')]=_0x109805[_0x47a5('0x61')]['refid'];break;}}if(_0x1371e4[_0x47a5('0x61')]['id']){delete _0x1371e4[_0x47a5('0x61')]['id'];}if(_[_0x47a5('0x8c')](_0x1371e4[_0x47a5('0x61')]['from'])){throw new db[(_0x47a5('0x1e'))]['ValidationError']('from\x20is\x20mandatory');}if(_['isNil'](_0x1371e4[_0x47a5('0x61')]['body'])||_0x1371e4[_0x47a5('0x61')][_0x47a5('0x61')]===''){throw new db[(_0x47a5('0x1e'))][(_0x47a5('0x1f'))](_0x47a5('0x8d'));}if(_[_0x47a5('0x8c')](_0x1371e4[_0x47a5('0x61')][_0x47a5('0x8e')])){throw new db[(_0x47a5('0x1e'))][(_0x47a5('0x1f'))](_0x47a5('0x8f')+_0x5bd86e);}if(!_[_0x47a5('0x90')](_0x5bd86e,_0x1371e4[_0x47a5('0x61')][_0x47a5('0x8e')])){throw new db[(_0x47a5('0x1e'))]['ValidationError'](_0x47a5('0x91')+_0x5bd86e);}_0x133b7a[_0x1371e4[_0x47a5('0x61')][_0x47a5('0x8e')]]=_0x1371e4[_0x47a5('0x61')]['from'];return db[_0x47a5('0x92')]['find']({'where':{'id':_0x1371e4[_0x47a5('0x70')]['ListId']},'include':[{'model':db[_0x47a5('0x72')],'as':_0x47a5('0x93'),'where':_0x133b7a,'limit':0x1,'order':[[_0x47a5('0x76'),'DESC']]}]});})[_0x47a5('0x21')](handleEntityNotFound(_0x70c8a6,null))[_0x47a5('0x21')](function(_0x14771b){if(_0x14771b){_0x1371e4['list']=_['omit'](_0x14771b,[_0x47a5('0x93')]);if(_0x14771b[_0x47a5('0x93')][_0x47a5('0x59')]){return _0x14771b[_0x47a5('0x93')][0x0];}var _0x204bd6=_['defaults'](_0x1371e4[_0x47a5('0x61')],{'firstName':_0x1371e4['body'][_0x47a5('0x7c')],'ListId':_0x14771b['id']});_0x204bd6[_0x1371e4[_0x47a5('0x61')][_0x47a5('0x8e')]]=_0x1371e4[_0x47a5('0x61')]['from'];return db['CmContact'][_0x47a5('0x5b')](_0x204bd6,{'fields':_0x4c9894,'raw':!![]});}})[_0x47a5('0x21')](handleEntityNotFound(_0x70c8a6,null))[_0x47a5('0x21')](function(_0x4339d4){if(_0x4339d4){_0x1371e4[_0x47a5('0x94')]=_0x4339d4;var _0x36a44c={'ContactId':_0x4339d4['id'],'phone':_0x1371e4[_0x47a5('0x61')][_0x47a5('0x7c')],'SmsAccountId':_0x109805[_0x47a5('0x56')]['id']};var _0x481bc3={'ContactId':_0x4339d4['id'],'SmsAccountId':_0x109805['params']['id'],'closed':![]};return db[_0x47a5('0x95')]['find']({'where':_0x481bc3})[_0x47a5('0x21')](function(_0x2d0b67){if(_0x2d0b67){return[_0x2d0b67,![]];}return db[_0x47a5('0x95')]['create'](_0x36a44c)[_0x47a5('0x21')](function(_0x26d629){return[_0x26d629,!![]];});});}})['spread'](function(_0xcb6714,_0x51f6cf){_0x1371e4[_0x47a5('0x96')]=_0xcb6714[_0x47a5('0x32')]({'plain':!![]});_0x1371e4[_0x47a5('0x96')]['created']=![];if(_0x51f6cf){if(_0x1371e4['account']['autoclose']){_0x1371e4['applications']['push']({'id':0x0,'priority':_0x1371e4[_0x47a5('0x97')]['length']+0x1,'app':_0x47a5('0x98'),'appdata':_0x47a5('0x99'),'interval':'*,*,*,*'});}_0x1371e4['interaction']['created']=!![];}return db[_0x47a5('0x9a')]['create']({'phone':_0x1371e4['body']['from'],'messageId':_0x1371e4[_0x47a5('0x61')][_0x47a5('0x7a')],'body':_0x1371e4[_0x47a5('0x61')][_0x47a5('0x61')],'SmsAccountId':_0x109805['params']['id'],'SmsInteractionId':_0xcb6714['id'],'direction':'in','ContactId':_0xcb6714[_0x47a5('0x9b')],'AttachmentId':_0x1371e4['body'][_0x47a5('0x9c')]});})['then'](function(_0x2de924){_0x1371e4[_0x47a5('0x28')]=_0x2de924;if(_0x1371e4[_0x47a5('0x96')]['UserId']){return db[_0x47a5('0x9d')][_0x47a5('0x5a')]({'attributes':['id',_0x47a5('0x35')],'where':{'id':_0x1371e4[_0x47a5('0x96')]['UserId']}})[_0x47a5('0x21')](function(_0x9a7edc){if(_0x9a7edc){_0x1371e4[_0x47a5('0x97')][_0x47a5('0x9e')]({'id':0x0,'priority':0x0,'app':_0x47a5('0x9f'),'appdata':_0x9a7edc[_0x47a5('0x35')]+','+(_0x1371e4['account'][_0x47a5('0xa0')]||0xa),'interval':_0x47a5('0xa1')});}return respondWithRpcPromise(_0x47a5('0xa2'),_0x47a5('0xa3'),_0x1371e4);});}return respondWithRpcPromise(_0x47a5('0xa2'),_0x47a5('0xa3'),_0x1371e4);})[_0x47a5('0x21')](function(_0x2697df){if(_0x2697df){var _0x408887=0xc8;var _0x34fde3=_0x47a5('0xa4');logger[_0x47a5('0x22')](_0x47a5('0x25'),_0x34fde3,_0x408887,_0x47a5('0xa5'));logger[_0x47a5('0xa6')](_0x47a5('0xa7'),_0x34fde3,_0x408887,_0x47a5('0xa5'),JSON['stringify'](_0x2697df));if(_0x1371e4[_0x47a5('0x70')]['type']==='twilio'){return _0x70c8a6[_0x47a5('0x2a')](_0x408887)[_0x47a5('0xa8')](_0x47a5('0xa9'),'text/xml')[_0x47a5('0x36')](_0x47a5('0xaa'));}else{return _0x70c8a6[_0x47a5('0x2a')](_0x408887)[_0x47a5('0x2c')](_0x2697df);}}})[_0x47a5('0x54')](handleError(_0x70c8a6,null));};exports[_0x47a5('0xab')]=function(_0x1b1f86,_0x46cb3a,_0x176e71){return db[_0x47a5('0x39')][_0x47a5('0x6b')]({'where':{'id':_0x1b1f86[_0x47a5('0x56')]['id']}})[_0x47a5('0x21')](handleEntityNotFound(_0x46cb3a,null))['then'](function(_0x4aad5f){if(_0x4aad5f){return db[_0x47a5('0xac')]['transaction'](function(_0x249339){return db[_0x47a5('0x6e')][_0x47a5('0x31')]({'where':{'SmsAccountId':_0x1b1f86[_0x47a5('0x56')]['id']},'transaction':_0x249339})[_0x47a5('0x21')](function(_0x3708ea){var _0x583b37=_[_0x47a5('0x3e')](_0x1b1f86[_0x47a5('0x61')],function(_0x380eca){_0x380eca['SmsAccountId']=_0x1b1f86[_0x47a5('0x56')]['id'];return _0x380eca;});return db[_0x47a5('0x6e')][_0x47a5('0xad')](_0x583b37,{'transaction':_0x249339});});})[_0x47a5('0x21')](function(){return db[_0x47a5('0x6e')][_0x47a5('0xae')]({'where':{'SmsAccountId':_0x1b1f86[_0x47a5('0x56')]['id']},'order':_0x47a5('0x71')});});}})[_0x47a5('0x21')](respondWithResult(_0x46cb3a,null))[_0x47a5('0x54')](handleError(_0x46cb3a,null));};exports[_0x47a5('0xaf')]=function(_0x40b7a5,_0x28e998,_0x2ac386){var _0x578983={};var _0x3f7fdc={};var _0x272cd0;var _0x150cff;return db[_0x47a5('0x39')][_0x47a5('0x6b')]({'where':{'id':_0x40b7a5[_0x47a5('0x56')]['id']}})[_0x47a5('0x21')](handleEntityNotFound(_0x28e998,null))['then'](function(_0x185104){if(_0x185104){_0x272cd0=_0x185104;_0x3f7fdc['model']=_[_0x47a5('0x40')](db[_0x47a5('0x6e')][_0x47a5('0x58')]);_0x3f7fdc[_0x47a5('0x3f')]=_[_0x47a5('0x40')](_0x40b7a5[_0x47a5('0x3f')]);_0x3f7fdc[_0x47a5('0x41')]=_[_0x47a5('0x42')](_0x3f7fdc['model'],_0x3f7fdc[_0x47a5('0x3f')]);_0x578983[_0x47a5('0x43')]=_[_0x47a5('0x42')](_0x3f7fdc['model'],qs[_0x47a5('0x44')](_0x40b7a5[_0x47a5('0x3f')][_0x47a5('0x44')]));_0x578983[_0x47a5('0x43')]=_0x578983['attributes'][_0x47a5('0x59')]?_0x578983[_0x47a5('0x43')]:_0x3f7fdc[_0x47a5('0x3d')];_0x578983[_0x47a5('0x47')]=qs['sort'](_0x40b7a5[_0x47a5('0x3f')]['sort']);_0x578983['where']=qs[_0x47a5('0x41')](_[_0x47a5('0x4a')](_0x40b7a5[_0x47a5('0x3f')],_0x3f7fdc[_0x47a5('0x41')]));if(_0x40b7a5['query'][_0x47a5('0x4b')]){_0x578983[_0x47a5('0x49')]=_[_0x47a5('0x4c')](_0x578983[_0x47a5('0x49')],{'$or':_[_0x47a5('0x3e')](_0x578983[_0x47a5('0x43')],function(_0x5eae8d){var _0x1da268={};_0x1da268[_0x5eae8d]={'$like':'%'+_0x40b7a5[_0x47a5('0x3f')][_0x47a5('0x4b')]+'%'};return _0x1da268;})});}_0x578983=_[_0x47a5('0x4c')]({},_0x578983,_0x40b7a5[_0x47a5('0x4e')]);return _0x272cd0['getApplications'](_0x578983);}})[_0x47a5('0x21')](function(_0x4c7627){if(_0x4c7627){_0x150cff=_0x4c7627[_0x47a5('0x59')];if(!_0x40b7a5['query'][_0x47a5('0x45')]('nolimit')){_0x578983['limit']=qs[_0x47a5('0x2e')](_0x40b7a5[_0x47a5('0x3f')]['limit']);_0x578983[_0x47a5('0x2d')]=qs[_0x47a5('0x2d')](_0x40b7a5['query'][_0x47a5('0x2d')]);}return _0x272cd0[_0x47a5('0xaf')](_0x578983);}})[_0x47a5('0x21')](function(_0x508622){if(_0x508622){return _0x508622?{'count':_0x150cff,'rows':_0x508622}:null;}})[_0x47a5('0x21')](respondWithResult(_0x28e998,null))[_0x47a5('0x54')](handleError(_0x28e998,null));};exports[_0x47a5('0xb0')]=function(_0x30b0f9,_0x37721c,_0x53cc9e){var _0x5973d4={'raw':![],'where':{}};var _0x2678cb={};var _0x56808d={'count':0x0,'rows':[]};return db[_0x47a5('0x39')][_0x47a5('0x6b')]({'where':{'id':_0x30b0f9['params']['id']}})['then'](handleEntityNotFound(_0x37721c,null))[_0x47a5('0x21')](function(_0x4997bc){if(_0x4997bc){_0x2678cb[_0x47a5('0x3d')]=_[_0x47a5('0x40')](db[_0x47a5('0x95')][_0x47a5('0x58')]);_0x2678cb[_0x47a5('0x3f')]=_[_0x47a5('0x40')](_0x30b0f9[_0x47a5('0x3f')]);_0x2678cb['filters']=_[_0x47a5('0x42')](_0x2678cb['model'],_0x2678cb[_0x47a5('0x3f')]);_0x5973d4[_0x47a5('0x43')]=_[_0x47a5('0x42')](_0x2678cb[_0x47a5('0x3d')],qs[_0x47a5('0x44')](_0x30b0f9[_0x47a5('0x3f')][_0x47a5('0x44')]));_0x5973d4[_0x47a5('0x43')]=_0x5973d4[_0x47a5('0x43')][_0x47a5('0x59')]?_0x5973d4[_0x47a5('0x43')]:_0x2678cb[_0x47a5('0x3d')];if(!_0x30b0f9['query'][_0x47a5('0x45')](_0x47a5('0x46'))){_0x5973d4[_0x47a5('0x2e')]=qs['limit'](_0x30b0f9[_0x47a5('0x3f')][_0x47a5('0x2e')]);_0x5973d4[_0x47a5('0x2d')]=qs[_0x47a5('0x2d')](_0x30b0f9[_0x47a5('0x3f')][_0x47a5('0x2d')]);}_0x5973d4['order']=qs[_0x47a5('0x48')](_0x30b0f9[_0x47a5('0x3f')][_0x47a5('0x48')]);_0x5973d4[_0x47a5('0x49')]=qs[_0x47a5('0x41')](_[_0x47a5('0x4a')](_0x30b0f9[_0x47a5('0x3f')],_0x2678cb[_0x47a5('0x41')]));_0x5973d4[_0x47a5('0x49')][_0x47a5('0x64')]=_0x4997bc['id'];if(_0x30b0f9['query']['filter']){_0x5973d4[_0x47a5('0x49')]=_[_0x47a5('0x4c')](_0x5973d4[_0x47a5('0x49')],{'$or':_['map'](_0x5973d4[_0x47a5('0x43')],function(_0x50b7fc){var _0x522345={};_0x522345[_0x50b7fc]={'$like':'%'+_0x30b0f9[_0x47a5('0x3f')][_0x47a5('0x4b')]+'%'};return _0x522345;})});}_0x5973d4=_[_0x47a5('0x4c')]({},_0x5973d4,_0x30b0f9[_0x47a5('0x4e')]);return db['SmsInteraction'][_0x47a5('0x4f')]({'where':_0x5973d4[_0x47a5('0x49')]})['then'](function(_0x59ba59){_0x56808d['count']=_0x59ba59;if(_0x30b0f9[_0x47a5('0x3f')][_0x47a5('0x50')]){_0x5973d4[_0x47a5('0x51')]=[{'model':db[_0x47a5('0x72')],'as':_0x47a5('0xb1'),'required':![]},{'model':db['User'],'as':'Owner','attributes':[_0x47a5('0x35'),_0x47a5('0xb2'),_0x47a5('0xb3')],'required':![]},{'model':db[_0x47a5('0xb4')],'as':'Tags','attributes':['id',_0x47a5('0x35'),_0x47a5('0xb5')],'where':_0x30b0f9[_0x47a5('0x3f')][_0x47a5('0xb6')]?{'id':_0x30b0f9['query']['tag']}:undefined,'required':_0x30b0f9['query'][_0x47a5('0xb6')]?!![]:![]}];}return db[_0x47a5('0x95')][_0x47a5('0x52')](_0x5973d4);})[_0x47a5('0x21')](function(_0x242006){_0x56808d[_0x47a5('0x53')]=_0x242006;return _0x56808d;});}})[_0x47a5('0x21')](respondWithFilteredResult(_0x37721c,_0x5973d4))[_0x47a5('0x54')](handleError(_0x37721c,null));};exports[_0x47a5('0x36')]=function(_0x5b48d0,_0x40fe75,_0x7b5348){var _0x50b482,_0x34ff37,_0x2bbf95;if(_[_0x47a5('0x8c')](_0x5b48d0[_0x47a5('0x61')]['body'])||_0x5b48d0[_0x47a5('0x61')][_0x47a5('0x61')]===''){throw new db[(_0x47a5('0x1e'))]['ValidationError']('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x47a5('0x8c')](_0x5b48d0['body']['to'])){throw new db[(_0x47a5('0x1e'))]['ValidationError'](_0x47a5('0xb7'));}_0x50b482=_0x5b48d0[_0x47a5('0x61')]['to'];return db[_0x47a5('0x39')][_0x47a5('0x5a')]({'where':{'id':_0x5b48d0[_0x47a5('0x56')]['id']},'include':[{'model':db['CmList'],'as':'List','include':[{'model':db[_0x47a5('0x72')],'as':_0x47a5('0x93'),'where':{'mobile':_0x50b482},'limit':0x1,'order':[[_0x47a5('0x76'),_0x47a5('0xb8')]]}]}]})['then'](handleEntityNotFound(_0x40fe75,null))['then'](function(_0x3222e4){if(_0x3222e4&&_0x3222e4['List']){_0x34ff37=_0x3222e4[_0x47a5('0x32')]({'plain':!![]});if(_0x34ff37['List']&&_0x34ff37[_0x47a5('0xb9')]['Contacts'][_0x47a5('0x59')]){return _0x34ff37[_0x47a5('0xb9')][_0x47a5('0x93')][0x0];}return db[_0x47a5('0x72')][_0x47a5('0x5b')](_[_0x47a5('0x16')](_0x5b48d0[_0x47a5('0x61')],{'firstName':_0x50b482,'mobile':_0x50b482,'phone':_0x50b482,'ListId':_0x34ff37[_0x47a5('0x77')]}));}})['then'](handleEntityNotFound(_0x40fe75,null))[_0x47a5('0x21')](function(_0x4394f0){if(_0x4394f0){_0x2bbf95=_0x4394f0;return db['SmsInteraction'][_0x47a5('0x5a')]({'where':{'ContactId':_0x2bbf95['id'],'closed':![],'SmsAccountId':_0x34ff37['id']}})[_0x47a5('0x21')](function(_0x54f283){if(_0x54f283){return[_0x54f283,![]];}return db['SmsInteraction'][_0x47a5('0x5b')]({'UserId':_0x5b48d0['user']['id'],'ContactId':_0x2bbf95['id'],'SmsAccountId':_0x34ff37['id'],'phone':_0x50b482,'firstMsgDirection':_0x47a5('0xba'),'Messages':[_[_0x47a5('0x4c')](_0x5b48d0[_0x47a5('0x61')],{'read':![],'body':_0x5b48d0['body'][_0x47a5('0x61')],'phone':_0x50b482,'SmsAccountId':_0x34ff37['id'],'UserId':_0x5b48d0[_0x47a5('0x5c')]['id'],'ContactId':_0x2bbf95['id']})]},{'include':[{'model':db[_0x47a5('0x9a')],'as':_0x47a5('0xbb')}]})[_0x47a5('0x21')](function(_0x454609){return[_0x454609,!![]];});});}})[_0x47a5('0xbc')](function(_0x5c4301,_0x2bc0d8){if(_0x2bc0d8){return _0x5c4301;}return db[_0x47a5('0x9a')][_0x47a5('0x5b')](_[_0x47a5('0x4c')](_0x5b48d0[_0x47a5('0x61')],{'read':![],'body':_0x5b48d0[_0x47a5('0x61')][_0x47a5('0x61')],'phone':_0x50b482,'SmsAccountId':_0x34ff37['id'],'SmsInteractionId':_0x5c4301['id'],'UserId':_0x5b48d0['user']['id'],'ContactId':_0x2bbf95['id']}))['then'](function(_0x11d87b){_0x5c4301[_0x47a5('0xbd')][_0x47a5('0xbb')]=[];_0x5c4301['dataValues']['Messages'][_0x47a5('0xbe')](_0x11d87b[_0x47a5('0xbd')]);return _0x5c4301;});})[_0x47a5('0x21')](respondWithResult(_0x40fe75,null))[_0x47a5('0x54')](handleError(_0x40fe75,null));};exports[_0x47a5('0x2a')]=function(_0x4121c1,_0x2e0add,_0x58e85b){if(_0x4121c1[_0x47a5('0x61')]['id']){delete _0x4121c1[_0x47a5('0x61')]['id'];}console[_0x47a5('0xbf')]('endpoint\x20/status\x20POST\x20/',_0x4121c1[_0x47a5('0x61')]);var _0x611b40,_0x144bc9,_0x278b42;return db[_0x47a5('0x39')][_0x47a5('0x5a')]({'where':{'id':_0x4121c1[_0x47a5('0x56')]['id']}})[_0x47a5('0x21')](handleEntityNotFound(_0x2e0add,null))[_0x47a5('0x21')](function(_0x9ced85){if(_0x9ced85){_0x278b42=_0x9ced85;logger[_0x47a5('0xa6')](_0x47a5('0x25'),_0x47a5('0x2a'),'received\x20delivery\x20report\x20from',_0x9ced85[_0x47a5('0x3b')],util['inspect'](_0x4121c1[_0x47a5('0x61')],{'showHidden':![],'depth':null}));switch(_0x9ced85['type']){case _0x47a5('0x7b'):if(_0x4121c1[_0x47a5('0x61')][_0x47a5('0xc0')]&&_0x4121c1['body'][_0x47a5('0x2a')]){_0x144bc9=_0x4121c1['body'][_0x47a5('0x2a')];return db[_0x47a5('0x9a')][_0x47a5('0x5a')]({'where':{'messageId':_0x4121c1[_0x47a5('0x61')]['skebby_dispatch_id']}});}break;case _0x47a5('0x7d'):if(_0x4121c1['body']['requestid']&&_0x4121c1[_0x47a5('0x61')][_0x47a5('0xc1')]){_0x144bc9=_0x4121c1[_0x47a5('0x61')][_0x47a5('0xc1')];return db[_0x47a5('0x9a')][_0x47a5('0x5a')]({'where':{'messageId':_0x4121c1[_0x47a5('0x61')][_0x47a5('0xc2')]}});}break;case _0x47a5('0xc3'):if(_0x4121c1['body']['message_id']&&_0x4121c1[_0x47a5('0x61')][_0x47a5('0xc4')]){_0x144bc9=_0x4121c1[_0x47a5('0x61')][_0x47a5('0xc4')];return db[_0x47a5('0x9a')]['find']({'where':{'messageId':_0x4121c1[_0x47a5('0x61')][_0x47a5('0x7e')]}});}break;case _0x47a5('0x82'):var _0x50ff41=_0x4121c1['body'][_0x47a5('0x83')][0x0];if(_0x50ff41[_0x47a5('0x7a')]&&_0x50ff41['status'][_0x47a5('0xc5')]===_0x47a5('0xc6')){_0x144bc9=_0x50ff41[_0x47a5('0x2a')]['groupName'];return db[_0x47a5('0x9a')][_0x47a5('0x5a')]({'where':{'messageId':_0x50ff41[_0x47a5('0x7a')]}});}break;case _0x47a5('0x87'):if(_0x4121c1[_0x47a5('0x61')]['messageId']&&_0x4121c1[_0x47a5('0x61')][_0x47a5('0x2a')]){_0x144bc9=_0x4121c1[_0x47a5('0x61')][_0x47a5('0x2a')];return db['SmsMessage']['find']({'where':{'messageId':_0x4121c1[_0x47a5('0x61')]['messageId']}});}break;case _0x47a5('0x8b'):if(_0x4121c1[_0x47a5('0x61')][_0x47a5('0xc7')]&&_0x4121c1[_0x47a5('0x61')][_0x47a5('0x2a')]){_0x144bc9=_0x4121c1[_0x47a5('0x61')]['status'];return db[_0x47a5('0x9a')][_0x47a5('0x5a')]({'where':{'messageId':_0x4121c1[_0x47a5('0x61')]['redif']}});}break;}}})['then'](handleEntityNotFound(_0x2e0add,null))[_0x47a5('0x21')](function(_0x4ebe30){if(_0x4ebe30){_0x611b40=_0x4ebe30;switch(_0x278b42[_0x47a5('0x3b')]){case _0x47a5('0x7b'):if(_0x144bc9===_0x47a5('0xc6')){return _0x611b40[_0x47a5('0x30')]({'read':!![]});}else{logger[_0x47a5('0x26')]('SmsAccount,\x20%s,\x20%s,\x20%s','status',_0x47a5('0x7b'),util[_0x47a5('0xc8')](_0x4121c1[_0x47a5('0x61')],{'showHidden':![],'depth':null}));}break;case _0x47a5('0x7d'):if(_0x144bc9==='1'){return _0x611b40[_0x47a5('0x30')]({'read':!![]});}else{logger['error'](_0x47a5('0x25'),_0x47a5('0x2a'),_0x47a5('0x7b'),util[_0x47a5('0xc8')](_0x4121c1[_0x47a5('0x61')],{'showHidden':![],'depth':null}));}break;case'clicksend':if(!_0x4121c1[_0x47a5('0x61')][_0x47a5('0xc9')]&&_0x144bc9>=0xc8&&_0x144bc9<=0xce){return _0x611b40[_0x47a5('0x30')]({'read':!![]});}else{logger[_0x47a5('0x26')](_0x47a5('0x25'),_0x47a5('0x2a'),_0x47a5('0xc3'),util[_0x47a5('0xc8')](_0x4121c1[_0x47a5('0x61')],{'showHidden':![],'depth':null}));}break;case _0x47a5('0x82'):var _0x2cc493=_0x4121c1['body'][_0x47a5('0x83')][0x0];if(_0x2cc493[_0x47a5('0x2a')][_0x47a5('0xc5')]===_0x47a5('0xc6')){return _0x611b40['update']({'read':!![]});}else{logger['error']('SmsAccount,\x20%s,\x20%s,\x20%s',_0x47a5('0x2a'),'infobip',util[_0x47a5('0xc8')](_0x4121c1[_0x47a5('0x61')],{'showHidden':![],'depth':null}));}break;case'clickatell':if(_0x144bc9==_0x47a5('0xca')||_0x144bc9==_0x47a5('0xcb')){return _0x611b40[_0x47a5('0x30')]({'read':!![]});}else{logger['error'](_0x47a5('0x25'),'status',_0x47a5('0x87'),util[_0x47a5('0xc8')](_0x4121c1[_0x47a5('0x61')],{'showHidden':![],'depth':null}));}break;case _0x47a5('0x8b'):if(_0x144bc9===_0x47a5('0xcc')||_0x144bc9===_0x47a5('0xcd')){return _0x611b40['update']({'read':!![]});}else{logger['error']('SmsAccount,\x20%s,\x20%s,\x20%s',_0x47a5('0x2a'),_0x47a5('0x8b'),util[_0x47a5('0xc8')](_0x4121c1[_0x47a5('0x61')],{'showHidden':![],'depth':null}));}break;}return _0x611b40;}})[_0x47a5('0x21')](respondWithResult(_0x2e0add,null))[_0x47a5('0x54')](handleError(_0x2e0add,null));};exports[_0x47a5('0xce')]=function(_0x138b92,_0x232c36,_0x25954e){var _0x277061,_0x3917e0,_0x1c7695;return db[_0x47a5('0x39')][_0x47a5('0x5a')]({'where':{'id':_0x138b92[_0x47a5('0x56')]['id']}})['then'](handleEntityNotFound(_0x232c36,null))[_0x47a5('0x21')](function(_0x46b82a){if(_0x46b82a){_0x1c7695=_0x46b82a;logger[_0x47a5('0xa6')](_0x47a5('0x25'),_0x47a5('0x2a'),_0x47a5('0xcf'),_0x46b82a[_0x47a5('0x3b')],util[_0x47a5('0xc8')](_0x138b92['query'],{'showHidden':![],'depth':null}));switch(_0x46b82a[_0x47a5('0x3b')]){case'csc':if(_0x138b92[_0x47a5('0x3f')][_0x47a5('0xd0')]&&_0x138b92['query'][_0x47a5('0xd1')]){_0x3917e0=_0x138b92['query'][_0x47a5('0xd1')];return db[_0x47a5('0x9a')][_0x47a5('0x5a')]({'where':{'messageId':_0x138b92[_0x47a5('0x3f')][_0x47a5('0xd0')]}});}break;}}})['then'](handleEntityNotFound(_0x232c36,null))[_0x47a5('0x21')](function(_0x9a2f87){if(_0x9a2f87){_0x277061=_0x9a2f87;switch(_0x1c7695[_0x47a5('0x3b')]){case'csc':if(_0x3917e0==='2'||_0x3917e0==='6'){return _0x277061['update']({'read':!![]});}else{logger[_0x47a5('0x26')](_0x47a5('0x25'),_0x47a5('0x2a'),'csc',util[_0x47a5('0xc8')](_0x138b92[_0x47a5('0x3f')],{'showHidden':![],'depth':null}));};break;}return _0x277061;}})[_0x47a5('0x21')](respondWithResult(_0x232c36,null))['catch'](handleError(_0x232c36,null));};exports[_0x47a5('0xd2')]=function(_0x3136f9,_0x3ecc43,_0xf4b1df){return db['SmsAccount'][_0x47a5('0x5a')]({'where':{'id':_0x3136f9['params']['id']}})[_0x47a5('0x21')](handleEntityNotFound(_0x3ecc43,null))[_0x47a5('0x21')](function(_0xdc5eac){if(_0xdc5eac){return _0xdc5eac[_0x47a5('0xd2')](_0x3136f9['body'][_0x47a5('0x68')],_[_0x47a5('0xd3')](_0x3136f9[_0x47a5('0x61')],[_0x47a5('0x68'),'id'])||{})[_0x47a5('0xbc')](function(_0x4c2b0c){for(var _0xbe3a38=0x0;_0xbe3a38<_0x3136f9[_0x47a5('0x61')][_0x47a5('0x68')][_0x47a5('0x59')];_0xbe3a38+=0x1){socket[_0x47a5('0xd4')](_0x47a5('0xd5'),{'UserId':_0x3136f9['body'][_0x47a5('0x68')][_0xbe3a38],'SmsAccountId':_0x3136f9[_0x47a5('0x56')]['id']});}return _0x4c2b0c;});}})['then'](respondWithResult(_0x3ecc43,null))['catch'](handleError(_0x3ecc43,null));};exports[_0x47a5('0xd6')]=function(_0x32d299,_0x20d99b,_0x3964f8){return db[_0x47a5('0x39')][_0x47a5('0x5a')]({'where':{'id':_0x32d299['params']['id']}})['then'](handleEntityNotFound(_0x20d99b,null))[_0x47a5('0x21')](function(_0xa3a516){if(_0xa3a516){return _0xa3a516['removeAgents'](_0x32d299[_0x47a5('0x3f')][_0x47a5('0x68')])['then'](function(){if(_[_0x47a5('0xd7')](_0x32d299['query']['ids'])){for(var _0x4aeaff=0x0;_0x4aeaff<_0x32d299[_0x47a5('0x3f')][_0x47a5('0x68')][_0x47a5('0x59')];_0x4aeaff+=0x1){socket['emit'](_0x47a5('0xd8'),{'UserId':Number(_0x32d299['query'][_0x47a5('0x68')][_0x4aeaff]),'SmsAccountId':Number(_0x32d299['params']['id'])});}}else{socket[_0x47a5('0xd4')](_0x47a5('0xd8'),{'UserId':Number(_0x32d299[_0x47a5('0x3f')][_0x47a5('0x68')]),'SmsAccountId':Number(_0x32d299[_0x47a5('0x56')]['id'])});}});}})[_0x47a5('0x21')](respondWithStatusCode(_0x20d99b,null))[_0x47a5('0x54')](handleError(_0x20d99b,null));};exports[_0x47a5('0xd9')]=function(_0x1396c2,_0x5c9091,_0x4f1e24){var _0x24c88e={};var _0xa859a={};var _0x5270cc;var _0x2a0f45;return db[_0x47a5('0x39')][_0x47a5('0x6b')]({'where':{'id':_0x1396c2[_0x47a5('0x56')]['id']}})[_0x47a5('0x21')](handleEntityNotFound(_0x5c9091,null))[_0x47a5('0x21')](function(_0x969d4b){if(_0x969d4b){_0x5270cc=_0x969d4b;_0xa859a[_0x47a5('0x3d')]=_[_0x47a5('0x40')](db[_0x47a5('0x9d')]['rawAttributes']);_0xa859a['query']=_['keys'](_0x1396c2['query']);_0xa859a[_0x47a5('0x41')]=_['intersection'](_0xa859a[_0x47a5('0x3d')],_0xa859a[_0x47a5('0x3f')]);_0x24c88e['attributes']=_[_0x47a5('0x42')](_0xa859a[_0x47a5('0x3d')],qs[_0x47a5('0x44')](_0x1396c2[_0x47a5('0x3f')][_0x47a5('0x44')]));_0x24c88e[_0x47a5('0x43')]=_0x24c88e['attributes'][_0x47a5('0x59')]?_0x24c88e[_0x47a5('0x43')]:_0xa859a['model'];_0x24c88e[_0x47a5('0x47')]=qs['sort'](_0x1396c2[_0x47a5('0x3f')][_0x47a5('0x48')]);_0x24c88e[_0x47a5('0x49')]=qs[_0x47a5('0x41')](_[_0x47a5('0x4a')](_0x1396c2[_0x47a5('0x3f')],_0xa859a[_0x47a5('0x41')]));if(_0x1396c2['query'][_0x47a5('0x4b')]){_0x24c88e[_0x47a5('0x49')]=_['merge'](_0x24c88e[_0x47a5('0x49')],{'$or':_[_0x47a5('0x3e')](_0x24c88e['attributes'],function(_0x14c968){var _0x5a7920={};_0x5a7920[_0x14c968]={'$like':'%'+_0x1396c2[_0x47a5('0x3f')][_0x47a5('0x4b')]+'%'};return _0x5a7920;})});}_0x24c88e=_[_0x47a5('0x4c')]({},_0x24c88e,_0x1396c2[_0x47a5('0x4e')]);return _0x5270cc[_0x47a5('0xd9')](_0x24c88e);}})['then'](function(_0x4b8b65){if(_0x4b8b65){_0x2a0f45=_0x4b8b65[_0x47a5('0x59')];if(!_0x1396c2['query']['hasOwnProperty']('nolimit')){_0x24c88e[_0x47a5('0x2e')]=qs['limit'](_0x1396c2[_0x47a5('0x3f')][_0x47a5('0x2e')]);_0x24c88e[_0x47a5('0x2d')]=qs['offset'](_0x1396c2['query'][_0x47a5('0x2d')]);}return _0x5270cc['getAgents'](_0x24c88e);}})['then'](function(_0xe87e6e){if(_0xe87e6e){return _0xe87e6e?{'count':_0x2a0f45,'rows':_0xe87e6e}:null;}})['then'](respondWithResult(_0x5c9091,null))['catch'](handleError(_0x5c9091,null));};
\ No newline at end of file
diff --git a/server/api/smsAccount/smsAccount.events.js b/server/api/smsAccount/smsAccount.events.js
index 216a84b..59db04b 100644
--- a/server/api/smsAccount/smsAccount.events.js
+++ b/server/api/smsAccount/smsAccount.events.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x1234=['exports','events','../../mysqldb','SmsAccount','setMaxListeners','save','update','remove','emit','hook'];(function(_0x1582fe,_0x4fdf8b){var _0x15a7cc=function(_0x184740){while(--_0x184740){_0x1582fe['push'](_0x1582fe['shift']());}};_0x15a7cc(++_0x4fdf8b);}(_0x1234,0x119));var _0x4123=function(_0x3d1db4,_0x59f60d){_0x3d1db4=_0x3d1db4-0x0;var _0x196e69=_0x1234[_0x3d1db4];return _0x196e69;};'use strict';var EventEmitter=require(_0x4123('0x0'));var SmsAccount=require(_0x4123('0x1'))['db'][_0x4123('0x2')];var SmsAccountEvents=new EventEmitter();SmsAccountEvents[_0x4123('0x3')](0x0);var events={'afterCreate':_0x4123('0x4'),'afterUpdate':_0x4123('0x5'),'afterDestroy':_0x4123('0x6')};function emitEvent(_0x47a948){return function(_0x3a5076,_0x59265a,_0x31e71d){SmsAccountEvents[_0x4123('0x7')](_0x47a948+':'+_0x3a5076['id'],_0x3a5076);SmsAccountEvents[_0x4123('0x7')](_0x47a948,_0x3a5076);_0x31e71d(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsAccount[_0x4123('0x8')](e,emitEvent(event));}}module[_0x4123('0x9')]=SmsAccountEvents;
\ No newline at end of file
+var _0x1912=['update','remove','emit','hasOwnProperty','exports','events','../../mysqldb','setMaxListeners','save'];(function(_0x1f3826,_0x57bc83){var _0x46634a=function(_0xbccda1){while(--_0xbccda1){_0x1f3826['push'](_0x1f3826['shift']());}};_0x46634a(++_0x57bc83);}(_0x1912,0x95));var _0x2191=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1912[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require(_0x2191('0x0'));var SmsAccount=require(_0x2191('0x1'))['db']['SmsAccount'];var SmsAccountEvents=new EventEmitter();SmsAccountEvents[_0x2191('0x2')](0x0);var events={'afterCreate':_0x2191('0x3'),'afterUpdate':_0x2191('0x4'),'afterDestroy':_0x2191('0x5')};function emitEvent(_0x240aac){return function(_0x5de091,_0x1e0b9d,_0x133e95){SmsAccountEvents[_0x2191('0x6')](_0x240aac+':'+_0x5de091['id'],_0x5de091);SmsAccountEvents[_0x2191('0x6')](_0x240aac,_0x5de091);_0x133e95(null);};}for(var e in events){if(events[_0x2191('0x7')](e)){var event=events[e];SmsAccount['hook'](e,emitEvent(event));}}module[_0x2191('0x8')]=SmsAccountEvents;
\ No newline at end of file
diff --git a/server/api/smsAccount/smsAccount.model.js b/server/api/smsAccount/smsAccount.model.js
index 4217fd5..4e882f9 100644
--- a/server/api/smsAccount/smsAccount.model.js
+++ b/server/api/smsAccount/smsAccount.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xa9e0=['../../config/environment','./smsAccount.attributes','exports','define','SmsAccount','lodash','util','../../config/logger','bluebird','path','rimraf'];(function(_0x1f15b9,_0x3b4524){var _0x12b5db=function(_0x154be9){while(--_0x154be9){_0x1f15b9['push'](_0x1f15b9['shift']());}};_0x12b5db(++_0x3b4524);}(_0xa9e0,0x123));var _0x0a9e=function(_0x21aec3,_0x5c97e9){_0x21aec3=_0x21aec3-0x0;var _0x288bbc=_0xa9e0[_0x21aec3];return _0x288bbc;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var logger=require(_0x0a9e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x0a9e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0a9e('0x4'));var rimraf=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var attributes=require(_0x0a9e('0x7'));module[_0x0a9e('0x8')]=function(_0x57b080,_0x219af0){return _0x57b080[_0x0a9e('0x9')](_0x0a9e('0xa'),attributes,{'tableName':'sms_accounts','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xa9e0=['../../config/environment','./smsAccount.attributes','exports','define','SmsAccount','lodash','util','../../config/logger','bluebird','path','rimraf'];(function(_0x6c67e,_0x195d4a){var _0x101076=function(_0x2e9c47){while(--_0x2e9c47){_0x6c67e['push'](_0x6c67e['shift']());}};_0x101076(++_0x195d4a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3b5250,_0x7a0b2c){_0x3b5250=_0x3b5250-0x0;var _0xc844a1=_0xa9e0[_0x3b5250];return _0xc844a1;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var logger=require(_0x0a9e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x0a9e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0a9e('0x4'));var rimraf=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var attributes=require(_0x0a9e('0x7'));module[_0x0a9e('0x8')]=function(_0x57b080,_0x219af0){return _0x57b080[_0x0a9e('0x9')](_0x0a9e('0xa'),attributes,{'tableName':'sms_accounts','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/smsAccount/smsAccount.rpc.js b/server/api/smsAccount/smsAccount.rpc.js
index e2edf06..1e06827 100644
--- a/server/api/smsAccount/smsAccount.rpc.js
+++ b/server/api/smsAccount/smsAccount.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x61b3=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','http','redis','socket.io-emitter','./smsAccount.socket','register','request','then','info','SmsAccount,\x20%s,\x20%s','debug','SmsAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','ShowSmsAccount','SmsAccount','raw','options','where','attributes','include','model','map','util','bluebird'];(function(_0x146a85,_0x529b52){var _0x1b59bf=function(_0x4af0fd){while(--_0x4af0fd){_0x146a85['push'](_0x146a85['shift']());}};_0x1b59bf(++_0x529b52);}(_0x61b3,0xd0));var _0x361b=function(_0x461b16,_0x28710e){_0x461b16=_0x461b16-0x0;var _0x327e71=_0x61b3[_0x461b16];return _0x327e71;};'use strict';var _=require('lodash');var util=require(_0x361b('0x0'));var moment=require('moment');var BPromise=require(_0x361b('0x1'));var rs=require(_0x361b('0x2'));var fs=require('fs');var Redis=require(_0x361b('0x3'));var db=require(_0x361b('0x4'))['db'];var utils=require(_0x361b('0x5'));var logger=require(_0x361b('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x361b('0x7'));var client=jayson['client'][_0x361b('0x8')]({'port':0x232a});config[_0x361b('0x9')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x361b('0xa'))(new Redis(config[_0x361b('0x9')]));require(_0x361b('0xb'))[_0x361b('0xc')](socket);function respondWithRpcPromise(_0x1ab05a,_0x8c57e5,_0x393be5){return new BPromise(function(_0x4d4551,_0x4f24e4){return client[_0x361b('0xd')](_0x1ab05a,_0x393be5)[_0x361b('0xe')](function(_0x32ed36){logger[_0x361b('0xf')](_0x361b('0x10'),_0x8c57e5,'request\x20sent');logger[_0x361b('0x11')](_0x361b('0x12'),_0x8c57e5,_0x361b('0x13'),JSON[_0x361b('0x14')](_0x32ed36));if(_0x32ed36[_0x361b('0x15')]){if(_0x32ed36['error'][_0x361b('0x16')]===0x1f4){logger[_0x361b('0x15')](_0x361b('0x10'),_0x8c57e5,_0x32ed36[_0x361b('0x15')]['message']);return _0x4f24e4(_0x32ed36[_0x361b('0x15')]['message']);}logger[_0x361b('0x15')](_0x361b('0x10'),_0x8c57e5,_0x32ed36[_0x361b('0x15')][_0x361b('0x17')]);return _0x4d4551(_0x32ed36['error'][_0x361b('0x17')]);}else{logger[_0x361b('0xf')](_0x361b('0x10'),_0x8c57e5,'request\x20sent');_0x4d4551(_0x32ed36[_0x361b('0x18')][_0x361b('0x17')]);}})[_0x361b('0x19')](function(_0x945a3d){logger[_0x361b('0x15')](_0x361b('0x10'),_0x8c57e5,_0x945a3d);_0x4f24e4(_0x945a3d);});});}exports[_0x361b('0x1a')]=function(_0x9e8716){var _0x157fda=this;return new Promise(function(_0x42fd27,_0x3bce88){return db[_0x361b('0x1b')]['find']({'raw':_0x9e8716['options']?_0x9e8716['options'][_0x361b('0x1c')]===undefined?!![]:![]:!![],'where':_0x9e8716[_0x361b('0x1d')]?_0x9e8716[_0x361b('0x1d')][_0x361b('0x1e')]||null:null,'attributes':_0x9e8716[_0x361b('0x1d')]?_0x9e8716['options'][_0x361b('0x1f')]||null:null,'include':_0x9e8716[_0x361b('0x1d')]?_0x9e8716[_0x361b('0x1d')][_0x361b('0x20')]?_['map'](_0x9e8716[_0x361b('0x1d')][_0x361b('0x20')],function(_0x22470c){return{'model':db[_0x22470c[_0x361b('0x21')]],'as':_0x22470c['as'],'attributes':_0x22470c[_0x361b('0x1f')],'include':_0x22470c[_0x361b('0x20')]?_[_0x361b('0x22')](_0x22470c[_0x361b('0x20')],function(_0x1e0b01){return{'model':db[_0x1e0b01[_0x361b('0x21')]],'as':_0x1e0b01['as'],'attributes':_0x1e0b01[_0x361b('0x1f')],'include':_0x1e0b01[_0x361b('0x20')]?_['map'](_0x1e0b01[_0x361b('0x20')],function(_0x3214c5){return{'model':db[_0x3214c5[_0x361b('0x21')]],'as':_0x3214c5['as'],'attributes':_0x3214c5[_0x361b('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x361b('0xe')](function(_0x30109f){logger[_0x361b('0xf')](_0x361b('0x1a'),_0x9e8716);logger[_0x361b('0x11')](_0x361b('0x1a'),_0x9e8716,JSON['stringify'](_0x30109f));_0x42fd27(_0x30109f);})[_0x361b('0x19')](function(_0x377dfb){logger[_0x361b('0x15')](_0x361b('0x1a'),_0x377dfb['message'],_0x9e8716);_0x3bce88(_0x157fda[_0x361b('0x15')](0x1f4,_0x377dfb[_0x361b('0x17')]));});});};
\ No newline at end of file
+var _0xc576=['request\x20sent','debug','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','SmsAccount,\x20%s,\x20%s','message','result','catch','find','options','raw','where','attributes','include','map','model','ShowSmsAccount','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','./smsAccount.socket','register','then','info'];(function(_0x367a3d,_0x452717){var _0x460539=function(_0x1e8beb){while(--_0x1e8beb){_0x367a3d['push'](_0x367a3d['shift']());}};_0x460539(++_0x452717);}(_0xc576,0x1e7));var _0x6c57=function(_0x1e7ead,_0x7f6227){_0x1e7ead=_0x1e7ead-0x0;var _0x3912b2=_0xc576[_0x1e7ead];return _0x3912b2;};'use strict';var _=require(_0x6c57('0x0'));var util=require(_0x6c57('0x1'));var moment=require('moment');var BPromise=require(_0x6c57('0x2'));var rs=require(_0x6c57('0x3'));var fs=require('fs');var Redis=require(_0x6c57('0x4'));var db=require(_0x6c57('0x5'))['db'];var utils=require(_0x6c57('0x6'));var logger=require(_0x6c57('0x7'))(_0x6c57('0x8'));var config=require(_0x6c57('0x9'));var jayson=require(_0x6c57('0xa'));var client=jayson[_0x6c57('0xb')][_0x6c57('0xc')]({'port':0x232a});config[_0x6c57('0xd')]=_[_0x6c57('0xe')](config[_0x6c57('0xd')],{'host':'localhost','port':0x18eb});var socket=require(_0x6c57('0xf'))(new Redis(config[_0x6c57('0xd')]));require(_0x6c57('0x10'))[_0x6c57('0x11')](socket);function respondWithRpcPromise(_0x1a82a2,_0x275e41,_0x28cd17){return new BPromise(function(_0x22f79b,_0x2dc64f){return client['request'](_0x1a82a2,_0x28cd17)[_0x6c57('0x12')](function(_0x27078c){logger[_0x6c57('0x13')]('SmsAccount,\x20%s,\x20%s',_0x275e41,_0x6c57('0x14'));logger[_0x6c57('0x15')](_0x6c57('0x16'),_0x275e41,'request\x20sent',JSON[_0x6c57('0x17')](_0x27078c));if(_0x27078c[_0x6c57('0x18')]){if(_0x27078c['error'][_0x6c57('0x19')]===0x1f4){logger[_0x6c57('0x18')](_0x6c57('0x1a'),_0x275e41,_0x27078c[_0x6c57('0x18')][_0x6c57('0x1b')]);return _0x2dc64f(_0x27078c['error'][_0x6c57('0x1b')]);}logger['error'](_0x6c57('0x1a'),_0x275e41,_0x27078c[_0x6c57('0x18')][_0x6c57('0x1b')]);return _0x22f79b(_0x27078c[_0x6c57('0x18')]['message']);}else{logger[_0x6c57('0x13')]('SmsAccount,\x20%s,\x20%s',_0x275e41,'request\x20sent');_0x22f79b(_0x27078c[_0x6c57('0x1c')]['message']);}})[_0x6c57('0x1d')](function(_0x492a1f){logger[_0x6c57('0x18')](_0x6c57('0x1a'),_0x275e41,_0x492a1f);_0x2dc64f(_0x492a1f);});});}exports['ShowSmsAccount']=function(_0x5d8440){var _0x8c3748=this;return new Promise(function(_0x33ae3b,_0xe92d5){return db['SmsAccount'][_0x6c57('0x1e')]({'raw':_0x5d8440[_0x6c57('0x1f')]?_0x5d8440[_0x6c57('0x1f')][_0x6c57('0x20')]===undefined?!![]:![]:!![],'where':_0x5d8440[_0x6c57('0x1f')]?_0x5d8440[_0x6c57('0x1f')][_0x6c57('0x21')]||null:null,'attributes':_0x5d8440[_0x6c57('0x1f')]?_0x5d8440[_0x6c57('0x1f')][_0x6c57('0x22')]||null:null,'include':_0x5d8440['options']?_0x5d8440[_0x6c57('0x1f')][_0x6c57('0x23')]?_[_0x6c57('0x24')](_0x5d8440[_0x6c57('0x1f')][_0x6c57('0x23')],function(_0x23e336){return{'model':db[_0x23e336[_0x6c57('0x25')]],'as':_0x23e336['as'],'attributes':_0x23e336[_0x6c57('0x22')],'include':_0x23e336[_0x6c57('0x23')]?_[_0x6c57('0x24')](_0x23e336[_0x6c57('0x23')],function(_0x4373ed){return{'model':db[_0x4373ed['model']],'as':_0x4373ed['as'],'attributes':_0x4373ed[_0x6c57('0x22')],'include':_0x4373ed['include']?_['map'](_0x4373ed[_0x6c57('0x23')],function(_0x32499b){return{'model':db[_0x32499b[_0x6c57('0x25')]],'as':_0x32499b['as'],'attributes':_0x32499b[_0x6c57('0x22')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x36085c){logger[_0x6c57('0x13')]('ShowSmsAccount',_0x5d8440);logger['debug']('ShowSmsAccount',_0x5d8440,JSON[_0x6c57('0x17')](_0x36085c));_0x33ae3b(_0x36085c);})['catch'](function(_0x28d291){logger['error'](_0x6c57('0x26'),_0x28d291[_0x6c57('0x1b')],_0x5d8440);_0xe92d5(_0x8c3748[_0x6c57('0x18')](0x1f4,_0x28d291[_0x6c57('0x1b')]));});});};
\ No newline at end of file
diff --git a/server/api/smsAccount/smsAccount.socket.js b/server/api/smsAccount/smsAccount.socket.js
index 8f1ea65..151102f 100644
--- a/server/api/smsAccount/smsAccount.socket.js
+++ b/server/api/smsAccount/smsAccount.socket.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x932a=['remove','update','removeListener','register','length','smsAccount:','./smsAccount.events','save'];(function(_0x22e714,_0x38d207){var _0x1955ab=function(_0x173287){while(--_0x173287){_0x22e714['push'](_0x22e714['shift']());}};_0x1955ab(++_0x38d207);}(_0x932a,0x96));var _0xa932=function(_0x19fee8,_0x17142b){_0x19fee8=_0x19fee8-0x0;var _0xe6fd96=_0x932a[_0x19fee8];return _0xe6fd96;};'use strict';var SmsAccountEvents=require(_0xa932('0x0'));var events=[_0xa932('0x1'),_0xa932('0x2'),_0xa932('0x3')];function createListener(_0x2a511f,_0x589449){return function(_0x402a1d){_0x589449['emit'](_0x2a511f,_0x402a1d);};}function removeListener(_0x32ba3c,_0x5ea854){return function(){SmsAccountEvents[_0xa932('0x4')](_0x32ba3c,_0x5ea854);};}exports[_0xa932('0x5')]=function(_0x56cdd4){for(var _0x1f4055=0x0,_0x44d79d=events[_0xa932('0x6')];_0x1f4055<_0x44d79d;_0x1f4055++){var _0x434792=events[_0x1f4055];var _0x2f2557=createListener(_0xa932('0x7')+_0x434792,_0x56cdd4);SmsAccountEvents['on'](_0x434792,_0x2f2557);}};
\ No newline at end of file
+var _0xd126=['length','smsAccount:','update','emit','register'];(function(_0x2a0398,_0x440f64){var _0x4ab51a=function(_0x5824a5){while(--_0x5824a5){_0x2a0398['push'](_0x2a0398['shift']());}};_0x4ab51a(++_0x440f64);}(_0xd126,0x6b));var _0x6d12=function(_0x7e2eb0,_0x17cd58){_0x7e2eb0=_0x7e2eb0-0x0;var _0xd92de4=_0xd126[_0x7e2eb0];return _0xd92de4;};'use strict';var SmsAccountEvents=require('./smsAccount.events');var events=['save','remove',_0x6d12('0x0')];function createListener(_0x3d72f3,_0x19f90c){return function(_0x2f67dd){_0x19f90c[_0x6d12('0x1')](_0x3d72f3,_0x2f67dd);};}function removeListener(_0x2d4710,_0x141057){return function(){SmsAccountEvents['removeListener'](_0x2d4710,_0x141057);};}exports[_0x6d12('0x2')]=function(_0x1d571b){for(var _0x407313=0x0,_0x345ede=events[_0x6d12('0x3')];_0x407313<_0x345ede;_0x407313++){var _0x4af87d=events[_0x407313];var _0x5ecda9=createListener(_0x6d12('0x4')+_0x4af87d,_0x1d571b);SmsAccountEvents['on'](_0x4af87d,_0x5ecda9);}};
\ No newline at end of file
diff --git a/server/api/smsApplication/index.js b/server/api/smsApplication/index.js
index 91c53d2..f36273c 100644
--- a/server/api/smsApplication/index.js
+++ b/server/api/smsApplication/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xda36=['put','/:id','update','delete','destroy','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsApplication.controller','get','isAuthenticated','index','show','post','create'];(function(_0x55e08b,_0x421620){var _0xd1a7ff=function(_0x58c7ff){while(--_0x58c7ff){_0x55e08b['push'](_0x55e08b['shift']());}};_0xd1a7ff(++_0x421620);}(_0xda36,0x69));var _0x6da3=function(_0x5760dc,_0x3828c3){_0x5760dc=_0x5760dc-0x0;var _0x446ae0=_0xda36[_0x5760dc];return _0x446ae0;};'use strict';var multer=require('multer');var util=require(_0x6da3('0x0'));var path=require(_0x6da3('0x1'));var timeout=require(_0x6da3('0x2'));var express=require(_0x6da3('0x3'));var router=express[_0x6da3('0x4')]();var auth=require(_0x6da3('0x5'));var interaction=require(_0x6da3('0x6'));var config=require(_0x6da3('0x7'));var controller=require(_0x6da3('0x8'));router[_0x6da3('0x9')]('/',auth[_0x6da3('0xa')](),controller[_0x6da3('0xb')]);router[_0x6da3('0x9')]('/:id',auth[_0x6da3('0xa')](),controller[_0x6da3('0xc')]);router[_0x6da3('0xd')]('/',auth[_0x6da3('0xa')](),controller[_0x6da3('0xe')]);router[_0x6da3('0xf')](_0x6da3('0x10'),auth[_0x6da3('0xa')](),controller[_0x6da3('0x11')]);router[_0x6da3('0x12')](_0x6da3('0x10'),auth[_0x6da3('0xa')](),controller[_0x6da3('0x13')]);module['exports']=router;
\ No newline at end of file
+var _0xd62b=['create','put','delete','destroy','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./smsApplication.controller','get','isAuthenticated','/:id','post'];(function(_0x1eafba,_0xf156ae){var _0x10264e=function(_0x1e55b2){while(--_0x1e55b2){_0x1eafba['push'](_0x1eafba['shift']());}};_0x10264e(++_0xf156ae);}(_0xd62b,0xc7));var _0xbd62=function(_0x90f34f,_0x404021){_0x90f34f=_0x90f34f-0x0;var _0x4b18cf=_0xd62b[_0x90f34f];return _0x4b18cf;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xbd62('0x0'));var timeout=require(_0xbd62('0x1'));var express=require(_0xbd62('0x2'));var router=express[_0xbd62('0x3')]();var auth=require(_0xbd62('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xbd62('0x5'));var controller=require(_0xbd62('0x6'));router[_0xbd62('0x7')]('/',auth[_0xbd62('0x8')](),controller['index']);router['get'](_0xbd62('0x9'),auth[_0xbd62('0x8')](),controller['show']);router[_0xbd62('0xa')]('/',auth[_0xbd62('0x8')](),controller[_0xbd62('0xb')]);router[_0xbd62('0xc')]('/:id',auth[_0xbd62('0x8')](),controller['update']);router[_0xbd62('0xd')]('/:id',auth[_0xbd62('0x8')](),controller[_0xbd62('0xe')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/smsApplication/smsApplication.attributes.js b/server/api/smsApplication/smsApplication.attributes.js
index 92188b6..10a0228 100644
--- a/server/api/smsApplication/smsApplication.attributes.js
+++ b/server/api/smsApplication/smsApplication.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9f4b=['sequelize','exports','STRING','TEXT'];(function(_0x1eb501,_0xa2cf7b){var _0x1f6bfd=function(_0x4b7eeb){while(--_0x4b7eeb){_0x1eb501['push'](_0x1eb501['shift']());}};_0x1f6bfd(++_0xa2cf7b);}(_0x9f4b,0x188));var _0xb9f4=function(_0x4367d9,_0x1bbd18){_0x4367d9=_0x4367d9-0x0;var _0x25d3a2=_0x9f4b[_0x4367d9];return _0x25d3a2;};'use strict';var Sequelize=require(_0xb9f4('0x0'));module[_0xb9f4('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0xb9f4('0x2')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0xb9f4('0x3')]()},'description':{'type':Sequelize[_0xb9f4('0x2')]},'interval':{'type':Sequelize[_0xb9f4('0x2')],'defaultValue':'*,*,*,*'}};
\ No newline at end of file
+var _0xd762=['*,*,*,*','sequelize','INTEGER','TEXT','STRING'];(function(_0xa6df52,_0x1b8584){var _0x5edd57=function(_0x543f11){while(--_0x543f11){_0xa6df52['push'](_0xa6df52['shift']());}};_0x5edd57(++_0x1b8584);}(_0xd762,0xb0));var _0x2d76=function(_0x21dc33,_0x2472be){_0x21dc33=_0x21dc33-0x0;var _0x5c765e=_0xd762[_0x21dc33];return _0x5c765e;};'use strict';var Sequelize=require(_0x2d76('0x0'));module['exports']={'priority':{'type':Sequelize[_0x2d76('0x1')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0x2d76('0x2')]()},'description':{'type':Sequelize[_0x2d76('0x3')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0x2d76('0x4')}};
\ No newline at end of file
diff --git a/server/api/smsApplication/smsApplication.controller.js b/server/api/smsApplication/smsApplication.controller.js
index 270045c..6fdda2d 100644
--- a/server/api/smsApplication/smsApplication.controller.js
+++ b/server/api/smsApplication/smsApplication.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x2272=['zip-dir','fast-json-patch','moment','bluebird','mustache','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','json','offset','limit','set','Content-Range','apply','save','update','then','destroy','error','stack','name','send','index','map','SmsApplication','type','model','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','pick','where','filter','merge','count','include','findAll','rows','catch','params','rawAttributes','includeAll','options','find','create','body','html-pdf','eml-format','rimraf'];(function(_0x5cd30d,_0x1f671b){var _0x21fcbf=function(_0x27b7b4){while(--_0x27b7b4){_0x5cd30d['push'](_0x5cd30d['shift']());}};_0x21fcbf(++_0x1f671b);}(_0x2272,0xd8));var _0x2227=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x2272[_0x14add3];return _0x4a174f;};'use strict';var pdf=require(_0x2227('0x0'));var emlformat=require(_0x2227('0x1'));var rimraf=require(_0x2227('0x2'));var zipdir=require(_0x2227('0x3'));var jsonpatch=require(_0x2227('0x4'));var rp=require('request-promise');var moment=require(_0x2227('0x5'));var BPromise=require(_0x2227('0x6'));var Mustache=require(_0x2227('0x7'));var util=require('util');var path=require('path');var sox=require(_0x2227('0x8'));var csv=require(_0x2227('0x9'));var ejs=require(_0x2227('0xa'));var fs=require('fs');var _=require(_0x2227('0xb'));var squel=require(_0x2227('0xc'));var crypto=require(_0x2227('0xd'));var jsforce=require(_0x2227('0xe'));var deskjs=require(_0x2227('0xf'));var toCsv=require(_0x2227('0x9'));var querystring=require(_0x2227('0x10'));var Papa=require('papaparse');var Redis=require(_0x2227('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x2227('0x12'));var as=require(_0x2227('0x13'));var hardwareService=require(_0x2227('0x14'));var logger=require(_0x2227('0x15'))(_0x2227('0x16'));var utils=require('../../config/utils');var config=require(_0x2227('0x17'));var db=require(_0x2227('0x18'))['db'];function respondWithStatusCode(_0x158d0e,_0x2e19fb){_0x2e19fb=_0x2e19fb||0xcc;return function(_0x125c3b){if(_0x125c3b){return _0x158d0e[_0x2227('0x19')](_0x2e19fb);}return _0x158d0e['status'](_0x2e19fb)['end']();};}function respondWithResult(_0x5152ef,_0x136f6b){_0x136f6b=_0x136f6b||0xc8;return function(_0x571dd1){if(_0x571dd1){return _0x5152ef[_0x2227('0x1a')](_0x136f6b)[_0x2227('0x1b')](_0x571dd1);}};}function respondWithFilteredResult(_0x510b09,_0x3da09c){return function(_0x4fa23d){if(_0x4fa23d){var _0x1df1ef=_0x4fa23d['count'],_0x43e174=_0x3da09c[_0x2227('0x1c')],_0x42a93c=_0x3da09c[_0x2227('0x1c')]+_0x3da09c[_0x2227('0x1d')],_0x1e78a8;if(_0x42a93c>=_0x1df1ef){_0x42a93c=_0x1df1ef;_0x1e78a8=0xc8;}else{_0x1e78a8=0xce;}_0x510b09['status'](_0x1e78a8);return _0x510b09[_0x2227('0x1e')](_0x2227('0x1f'),_0x43e174+'-'+_0x42a93c+'/'+_0x1df1ef)[_0x2227('0x1b')](_0x4fa23d);}return null;};}function patchUpdates(_0x2482ba){return function(_0x416152){try{jsonpatch[_0x2227('0x20')](_0x416152,_0x2482ba,!![]);}catch(_0x2e6c98){return BPromise['reject'](_0x2e6c98);}return _0x416152[_0x2227('0x21')]();};}function saveUpdates(_0x59f988,_0x2b26b7){return function(_0x3aed68){if(_0x3aed68){return _0x3aed68[_0x2227('0x22')](_0x59f988)[_0x2227('0x23')](function(_0x3663ae){return _0x3663ae;});}return null;};}function removeEntity(_0x1592b8,_0x19ab59){return function(_0x10d9ca){if(_0x10d9ca){return _0x10d9ca[_0x2227('0x24')]()[_0x2227('0x23')](function(){_0x1592b8[_0x2227('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x45def5,_0x42d500){return function(_0x5b3a09){if(!_0x5b3a09){_0x45def5[_0x2227('0x19')](0x194);}return _0x5b3a09;};}function handleError(_0xbfdce1,_0x5ea1c3){_0x5ea1c3=_0x5ea1c3||0x1f4;return function(_0x4cc85f){logger[_0x2227('0x25')](_0x4cc85f[_0x2227('0x26')]);if(_0x4cc85f[_0x2227('0x27')]){delete _0x4cc85f[_0x2227('0x27')];}_0xbfdce1['status'](_0x5ea1c3)[_0x2227('0x28')](_0x4cc85f);};}exports[_0x2227('0x29')]=function(_0x2d8ea0,_0x1957ee){var _0x5d852f={},_0x204def={},_0xbe1ffb={'count':0x0,'rows':[]};var _0xedd3d9=_[_0x2227('0x2a')](db[_0x2227('0x2b')]['rawAttributes'],function(_0x55015e){return{'name':_0x55015e['fieldName'],'type':_0x55015e[_0x2227('0x2c')]['key']};});_0x204def[_0x2227('0x2d')]=_[_0x2227('0x2a')](_0xedd3d9,'name');_0x204def['query']=_[_0x2227('0x2e')](_0x2d8ea0[_0x2227('0x2f')]);_0x204def[_0x2227('0x30')]=_['intersection'](_0x204def[_0x2227('0x2d')],_0x204def['query']);_0x5d852f[_0x2227('0x31')]=_[_0x2227('0x32')](_0x204def[_0x2227('0x2d')],qs[_0x2227('0x33')](_0x2d8ea0[_0x2227('0x2f')][_0x2227('0x33')]));_0x5d852f[_0x2227('0x31')]=_0x5d852f[_0x2227('0x31')][_0x2227('0x34')]?_0x5d852f[_0x2227('0x31')]:_0x204def[_0x2227('0x2d')];if(!_0x2d8ea0['query'][_0x2227('0x35')](_0x2227('0x36'))){_0x5d852f[_0x2227('0x1d')]=qs[_0x2227('0x1d')](_0x2d8ea0['query'][_0x2227('0x1d')]);_0x5d852f[_0x2227('0x1c')]=qs[_0x2227('0x1c')](_0x2d8ea0[_0x2227('0x2f')]['offset']);}_0x5d852f[_0x2227('0x37')]=qs[_0x2227('0x38')](_0x2d8ea0[_0x2227('0x2f')]['sort']);_0x5d852f['where']=qs[_0x2227('0x30')](_[_0x2227('0x39')](_0x2d8ea0['query'],_0x204def[_0x2227('0x30')]),_0xedd3d9);if(_0x2d8ea0[_0x2227('0x2f')]['filter']){_0x5d852f[_0x2227('0x3a')]=_['merge'](_0x5d852f[_0x2227('0x3a')],{'$or':_[_0x2227('0x2a')](_0xedd3d9,function(_0x509938){if(_0x509938[_0x2227('0x2c')]!=='VIRTUAL'){var _0x40679d={};_0x40679d[_0x509938['name']]={'$like':'%'+_0x2d8ea0[_0x2227('0x2f')][_0x2227('0x3b')]+'%'};return _0x40679d;}})});}_0x5d852f=_[_0x2227('0x3c')]({},_0x5d852f,_0x2d8ea0['options']);var _0x26a974={'where':_0x5d852f[_0x2227('0x3a')]};return db[_0x2227('0x2b')][_0x2227('0x3d')](_0x26a974)[_0x2227('0x23')](function(_0x4a0441){_0xbe1ffb['count']=_0x4a0441;if(_0x2d8ea0[_0x2227('0x2f')]['includeAll']){_0x5d852f[_0x2227('0x3e')]=[{'all':!![]}];}return db[_0x2227('0x2b')][_0x2227('0x3f')](_0x5d852f);})[_0x2227('0x23')](function(_0x15dd37){_0xbe1ffb[_0x2227('0x40')]=_0x15dd37;return _0xbe1ffb;})[_0x2227('0x23')](respondWithFilteredResult(_0x1957ee,_0x5d852f))[_0x2227('0x41')](handleError(_0x1957ee,null));};exports['show']=function(_0x41436e,_0x5ebe70){var _0x3c67c6={'raw':!![],'where':{'id':_0x41436e[_0x2227('0x42')]['id']}},_0x5bcc1f={};_0x5bcc1f['model']=_[_0x2227('0x2e')](db['SmsApplication'][_0x2227('0x43')]);_0x5bcc1f[_0x2227('0x2f')]=_[_0x2227('0x2e')](_0x41436e[_0x2227('0x2f')]);_0x5bcc1f[_0x2227('0x30')]=_[_0x2227('0x32')](_0x5bcc1f['model'],_0x5bcc1f['query']);_0x3c67c6[_0x2227('0x31')]=_['intersection'](_0x5bcc1f[_0x2227('0x2d')],qs['fields'](_0x41436e[_0x2227('0x2f')][_0x2227('0x33')]));_0x3c67c6[_0x2227('0x31')]=_0x3c67c6[_0x2227('0x31')][_0x2227('0x34')]?_0x3c67c6[_0x2227('0x31')]:_0x5bcc1f['model'];if(_0x41436e[_0x2227('0x2f')][_0x2227('0x44')]){_0x3c67c6[_0x2227('0x3e')]=[{'all':!![]}];}_0x3c67c6=_[_0x2227('0x3c')]({},_0x3c67c6,_0x41436e[_0x2227('0x45')]);return db[_0x2227('0x2b')][_0x2227('0x46')](_0x3c67c6)[_0x2227('0x23')](handleEntityNotFound(_0x5ebe70,null))['then'](respondWithResult(_0x5ebe70,null))[_0x2227('0x41')](handleError(_0x5ebe70,null));};exports[_0x2227('0x47')]=function(_0x30287e,_0x424e67){return db['SmsApplication'][_0x2227('0x47')](_0x30287e[_0x2227('0x48')],{})['then'](respondWithResult(_0x424e67,0xc9))[_0x2227('0x41')](handleError(_0x424e67,null));};exports[_0x2227('0x22')]=function(_0x1e4d8f,_0x3bfe7a){if(_0x1e4d8f[_0x2227('0x48')]['id']){delete _0x1e4d8f[_0x2227('0x48')]['id'];}return db[_0x2227('0x2b')]['find']({'where':{'id':_0x1e4d8f[_0x2227('0x42')]['id']}})[_0x2227('0x23')](handleEntityNotFound(_0x3bfe7a,null))['then'](saveUpdates(_0x1e4d8f[_0x2227('0x48')],null))['then'](respondWithResult(_0x3bfe7a,null))[_0x2227('0x41')](handleError(_0x3bfe7a,null));};exports[_0x2227('0x24')]=function(_0x31a544,_0x2e4b92){return db['SmsApplication']['find']({'where':{'id':_0x31a544['params']['id']}})[_0x2227('0x23')](handleEntityNotFound(_0x2e4b92,null))[_0x2227('0x23')](removeEntity(_0x2e4b92,null))['catch'](handleError(_0x2e4b92,null));};
\ No newline at end of file
+var _0xb03e=['status','end','json','count','offset','limit','set','Content-Range','apply','reject','update','then','error','stack','name','index','SmsApplication','rawAttributes','type','query','keys','attributes','intersection','model','fields','length','hasOwnProperty','nolimit','order','sort','filters','filter','where','map','merge','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus'];(function(_0x585a0f,_0x172cb8){var _0x2d8065=function(_0x3d330f){while(--_0x3d330f){_0x585a0f['push'](_0x585a0f['shift']());}};_0x2d8065(++_0x172cb8);}(_0xb03e,0x1eb));var _0xeb03=function(_0x4ceb82,_0x23969c){_0x4ceb82=_0x4ceb82-0x0;var _0x3e99cd=_0xb03e[_0x4ceb82];return _0x3e99cd;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xeb03('0x0'));var rimraf=require(_0xeb03('0x1'));var zipdir=require(_0xeb03('0x2'));var jsonpatch=require(_0xeb03('0x3'));var rp=require(_0xeb03('0x4'));var moment=require(_0xeb03('0x5'));var BPromise=require(_0xeb03('0x6'));var Mustache=require(_0xeb03('0x7'));var util=require(_0xeb03('0x8'));var path=require(_0xeb03('0x9'));var sox=require(_0xeb03('0xa'));var csv=require(_0xeb03('0xb'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xeb03('0xc'));var squel=require(_0xeb03('0xd'));var crypto=require(_0xeb03('0xe'));var jsforce=require(_0xeb03('0xf'));var deskjs=require(_0xeb03('0x10'));var toCsv=require(_0xeb03('0xb'));var querystring=require('querystring');var Papa=require(_0xeb03('0x11'));var Redis=require(_0xeb03('0x12'));var authService=require(_0xeb03('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xeb03('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xeb03('0x15'))(_0xeb03('0x16'));var utils=require(_0xeb03('0x17'));var config=require(_0xeb03('0x18'));var db=require(_0xeb03('0x19'))['db'];function respondWithStatusCode(_0x45481b,_0x367d36){_0x367d36=_0x367d36||0xcc;return function(_0x384cbe){if(_0x384cbe){return _0x45481b[_0xeb03('0x1a')](_0x367d36);}return _0x45481b[_0xeb03('0x1b')](_0x367d36)[_0xeb03('0x1c')]();};}function respondWithResult(_0x3bebc6,_0x4d9c8e){_0x4d9c8e=_0x4d9c8e||0xc8;return function(_0x212082){if(_0x212082){return _0x3bebc6[_0xeb03('0x1b')](_0x4d9c8e)[_0xeb03('0x1d')](_0x212082);}};}function respondWithFilteredResult(_0x33f9ba,_0x52be5b){return function(_0x15f4fe){if(_0x15f4fe){var _0x36f5d8=_0x15f4fe[_0xeb03('0x1e')],_0x3f26ef=_0x52be5b[_0xeb03('0x1f')],_0x478989=_0x52be5b[_0xeb03('0x1f')]+_0x52be5b[_0xeb03('0x20')],_0x7ce874;if(_0x478989>=_0x36f5d8){_0x478989=_0x36f5d8;_0x7ce874=0xc8;}else{_0x7ce874=0xce;}_0x33f9ba[_0xeb03('0x1b')](_0x7ce874);return _0x33f9ba[_0xeb03('0x21')](_0xeb03('0x22'),_0x3f26ef+'-'+_0x478989+'/'+_0x36f5d8)[_0xeb03('0x1d')](_0x15f4fe);}return null;};}function patchUpdates(_0x469d25){return function(_0x456fb3){try{jsonpatch[_0xeb03('0x23')](_0x456fb3,_0x469d25,!![]);}catch(_0x2443d9){return BPromise[_0xeb03('0x24')](_0x2443d9);}return _0x456fb3['save']();};}function saveUpdates(_0x1bea3f,_0x3855dd){return function(_0x413d3e){if(_0x413d3e){return _0x413d3e[_0xeb03('0x25')](_0x1bea3f)[_0xeb03('0x26')](function(_0x31e406){return _0x31e406;});}return null;};}function removeEntity(_0xb98dc1,_0x2c795b){return function(_0x3c3d09){if(_0x3c3d09){return _0x3c3d09['destroy']()[_0xeb03('0x26')](function(){_0xb98dc1[_0xeb03('0x1b')](0xcc)[_0xeb03('0x1c')]();});}};}function handleEntityNotFound(_0x300dc0,_0x2f99e6){return function(_0x5dcda3){if(!_0x5dcda3){_0x300dc0[_0xeb03('0x1a')](0x194);}return _0x5dcda3;};}function handleError(_0x406864,_0x16cd4){_0x16cd4=_0x16cd4||0x1f4;return function(_0x20efa8){logger[_0xeb03('0x27')](_0x20efa8[_0xeb03('0x28')]);if(_0x20efa8[_0xeb03('0x29')]){delete _0x20efa8[_0xeb03('0x29')];}_0x406864[_0xeb03('0x1b')](_0x16cd4)['send'](_0x20efa8);};}exports[_0xeb03('0x2a')]=function(_0x1b2c7b,_0x2683f9){var _0x1ada2e={},_0x4cdea6={},_0x581685={'count':0x0,'rows':[]};var _0x1064a5=_['map'](db[_0xeb03('0x2b')][_0xeb03('0x2c')],function(_0x160a37){return{'name':_0x160a37['fieldName'],'type':_0x160a37[_0xeb03('0x2d')]['key']};});_0x4cdea6['model']=_['map'](_0x1064a5,'name');_0x4cdea6[_0xeb03('0x2e')]=_[_0xeb03('0x2f')](_0x1b2c7b['query']);_0x4cdea6['filters']=_['intersection'](_0x4cdea6['model'],_0x4cdea6[_0xeb03('0x2e')]);_0x1ada2e[_0xeb03('0x30')]=_[_0xeb03('0x31')](_0x4cdea6[_0xeb03('0x32')],qs[_0xeb03('0x33')](_0x1b2c7b['query'][_0xeb03('0x33')]));_0x1ada2e['attributes']=_0x1ada2e[_0xeb03('0x30')][_0xeb03('0x34')]?_0x1ada2e[_0xeb03('0x30')]:_0x4cdea6[_0xeb03('0x32')];if(!_0x1b2c7b[_0xeb03('0x2e')][_0xeb03('0x35')](_0xeb03('0x36'))){_0x1ada2e[_0xeb03('0x20')]=qs['limit'](_0x1b2c7b[_0xeb03('0x2e')]['limit']);_0x1ada2e[_0xeb03('0x1f')]=qs[_0xeb03('0x1f')](_0x1b2c7b[_0xeb03('0x2e')][_0xeb03('0x1f')]);}_0x1ada2e[_0xeb03('0x37')]=qs[_0xeb03('0x38')](_0x1b2c7b['query'][_0xeb03('0x38')]);_0x1ada2e['where']=qs['filters'](_['pick'](_0x1b2c7b[_0xeb03('0x2e')],_0x4cdea6[_0xeb03('0x39')]),_0x1064a5);if(_0x1b2c7b[_0xeb03('0x2e')][_0xeb03('0x3a')]){_0x1ada2e[_0xeb03('0x3b')]=_['merge'](_0x1ada2e[_0xeb03('0x3b')],{'$or':_[_0xeb03('0x3c')](_0x1064a5,function(_0x1d3ca1){if(_0x1d3ca1['type']!=='VIRTUAL'){var _0xac05c4={};_0xac05c4[_0x1d3ca1[_0xeb03('0x29')]]={'$like':'%'+_0x1b2c7b[_0xeb03('0x2e')]['filter']+'%'};return _0xac05c4;}})});}_0x1ada2e=_[_0xeb03('0x3d')]({},_0x1ada2e,_0x1b2c7b[_0xeb03('0x3e')]);var _0x57b2ab={'where':_0x1ada2e['where']};return db[_0xeb03('0x2b')][_0xeb03('0x1e')](_0x57b2ab)['then'](function(_0x39ebe8){_0x581685[_0xeb03('0x1e')]=_0x39ebe8;if(_0x1b2c7b[_0xeb03('0x2e')][_0xeb03('0x3f')]){_0x1ada2e[_0xeb03('0x40')]=[{'all':!![]}];}return db[_0xeb03('0x2b')][_0xeb03('0x41')](_0x1ada2e);})[_0xeb03('0x26')](function(_0x20ebe8){_0x581685[_0xeb03('0x42')]=_0x20ebe8;return _0x581685;})[_0xeb03('0x26')](respondWithFilteredResult(_0x2683f9,_0x1ada2e))[_0xeb03('0x43')](handleError(_0x2683f9,null));};exports[_0xeb03('0x44')]=function(_0x33414d,_0x28b831){var _0x6b95dd={'raw':!![],'where':{'id':_0x33414d[_0xeb03('0x45')]['id']}},_0x407f0b={};_0x407f0b[_0xeb03('0x32')]=_[_0xeb03('0x2f')](db[_0xeb03('0x2b')][_0xeb03('0x2c')]);_0x407f0b[_0xeb03('0x2e')]=_['keys'](_0x33414d['query']);_0x407f0b[_0xeb03('0x39')]=_[_0xeb03('0x31')](_0x407f0b[_0xeb03('0x32')],_0x407f0b[_0xeb03('0x2e')]);_0x6b95dd[_0xeb03('0x30')]=_[_0xeb03('0x31')](_0x407f0b[_0xeb03('0x32')],qs[_0xeb03('0x33')](_0x33414d['query'][_0xeb03('0x33')]));_0x6b95dd[_0xeb03('0x30')]=_0x6b95dd[_0xeb03('0x30')][_0xeb03('0x34')]?_0x6b95dd[_0xeb03('0x30')]:_0x407f0b['model'];if(_0x33414d['query'][_0xeb03('0x3f')]){_0x6b95dd['include']=[{'all':!![]}];}_0x6b95dd=_['merge']({},_0x6b95dd,_0x33414d['options']);return db[_0xeb03('0x2b')][_0xeb03('0x46')](_0x6b95dd)[_0xeb03('0x26')](handleEntityNotFound(_0x28b831,null))[_0xeb03('0x26')](respondWithResult(_0x28b831,null))[_0xeb03('0x43')](handleError(_0x28b831,null));};exports[_0xeb03('0x47')]=function(_0x481271,_0x35279d){return db['SmsApplication']['create'](_0x481271[_0xeb03('0x48')],{})[_0xeb03('0x26')](respondWithResult(_0x35279d,0xc9))[_0xeb03('0x43')](handleError(_0x35279d,null));};exports['update']=function(_0x404191,_0x9c8073){if(_0x404191[_0xeb03('0x48')]['id']){delete _0x404191[_0xeb03('0x48')]['id'];}return db[_0xeb03('0x2b')]['find']({'where':{'id':_0x404191[_0xeb03('0x45')]['id']}})['then'](handleEntityNotFound(_0x9c8073,null))[_0xeb03('0x26')](saveUpdates(_0x404191[_0xeb03('0x48')],null))[_0xeb03('0x26')](respondWithResult(_0x9c8073,null))[_0xeb03('0x43')](handleError(_0x9c8073,null));};exports[_0xeb03('0x49')]=function(_0x46f4a7,_0x42e73f){return db[_0xeb03('0x2b')][_0xeb03('0x46')]({'where':{'id':_0x46f4a7[_0xeb03('0x45')]['id']}})[_0xeb03('0x26')](handleEntityNotFound(_0x42e73f,null))[_0xeb03('0x26')](removeEntity(_0x42e73f,null))[_0xeb03('0x43')](handleError(_0x42e73f,null));};
\ No newline at end of file
diff --git a/server/api/smsApplication/smsApplication.model.js b/server/api/smsApplication/smsApplication.model.js
index 8ac4756..5271710 100644
--- a/server/api/smsApplication/smsApplication.model.js
+++ b/server/api/smsApplication/smsApplication.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x452a=['./smsApplication.attributes','exports','utf8mb4','util','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment'];(function(_0xbda3d,_0x23a96d){var _0x1600f4=function(_0x52ca63){while(--_0x52ca63){_0xbda3d['push'](_0xbda3d['shift']());}};_0x1600f4(++_0x23a96d);}(_0x452a,0x7b));var _0xa452=function(_0x220dbb,_0x99328d){_0x220dbb=_0x220dbb-0x0;var _0x2b77de=_0x452a[_0x220dbb];return _0x2b77de;};'use strict';var _=require('lodash');var util=require(_0xa452('0x0'));var logger=require(_0xa452('0x1'))(_0xa452('0x2'));var moment=require('moment');var BPromise=require(_0xa452('0x3'));var rp=require(_0xa452('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa452('0x5'));var config=require(_0xa452('0x6'));var attributes=require(_0xa452('0x7'));module[_0xa452('0x8')]=function(_0x326e05,_0x11c18b){return _0x326e05['define']('SmsApplication',attributes,{'tableName':'sms_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xa452('0x9'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0xb284=['api','moment','request-promise','path','rimraf','../../config/environment','./smsApplication.attributes','exports','sms_applications','utf8mb4_unicode_ci','lodash','util','../../config/logger'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xb284,0x1d1));var _0x4b28=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xb284[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x4b28('0x0'));var util=require(_0x4b28('0x1'));var logger=require(_0x4b28('0x2'))(_0x4b28('0x3'));var moment=require(_0x4b28('0x4'));var BPromise=require('bluebird');var rp=require(_0x4b28('0x5'));var fs=require('fs');var path=require(_0x4b28('0x6'));var rimraf=require(_0x4b28('0x7'));var config=require(_0x4b28('0x8'));var attributes=require(_0x4b28('0x9'));module[_0x4b28('0xa')]=function(_0x4af04c,_0x1baa4f){return _0x4af04c['define']('SmsApplication',attributes,{'tableName':_0x4b28('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x4b28('0xc')});};
\ No newline at end of file
diff --git a/server/api/smsApplication/smsApplication.rpc.js b/server/api/smsApplication/smsApplication.rpc.js
index 6bfbf1e..54adc09 100644
--- a/server/api/smsApplication/smsApplication.rpc.js
+++ b/server/api/smsApplication/smsApplication.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x207c=['message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','http','request','info','SmsApplication,\x20%s,\x20%s','request\x20sent','debug','SmsApplication,\x20%s,\x20%s,\x20%s','error'];(function(_0x4bfc64,_0x25976d){var _0x5d8f2a=function(_0x5d184a){while(--_0x5d184a){_0x4bfc64['push'](_0x4bfc64['shift']());}};_0x5d8f2a(++_0x25976d);}(_0x207c,0x1e8));var _0xc207=function(_0x5f0305,_0x4bdfa8){_0x5f0305=_0x5f0305-0x0;var _0x344ecf=_0x207c[_0x5f0305];return _0x344ecf;};'use strict';var _=require('lodash');var util=require(_0xc207('0x0'));var moment=require(_0xc207('0x1'));var BPromise=require(_0xc207('0x2'));var rs=require(_0xc207('0x3'));var fs=require('fs');var Redis=require(_0xc207('0x4'));var db=require(_0xc207('0x5'))['db'];var utils=require(_0xc207('0x6'));var logger=require('../../config/logger')(_0xc207('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0xc207('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x314561,_0x3395e4,_0x59ff6f){return new BPromise(function(_0x25cb97,_0xad159b){return client[_0xc207('0x9')](_0x314561,_0x59ff6f)['then'](function(_0xffae6c){logger[_0xc207('0xa')](_0xc207('0xb'),_0x3395e4,_0xc207('0xc'));logger[_0xc207('0xd')](_0xc207('0xe'),_0x3395e4,'request\x20sent',JSON['stringify'](_0xffae6c));if(_0xffae6c['error']){if(_0xffae6c[_0xc207('0xf')]['code']===0x1f4){logger[_0xc207('0xf')](_0xc207('0xb'),_0x3395e4,_0xffae6c['error'][_0xc207('0x10')]);return _0xad159b(_0xffae6c[_0xc207('0xf')][_0xc207('0x10')]);}logger[_0xc207('0xf')](_0xc207('0xb'),_0x3395e4,_0xffae6c['error'][_0xc207('0x10')]);return _0x25cb97(_0xffae6c[_0xc207('0xf')][_0xc207('0x10')]);}else{logger[_0xc207('0xa')]('SmsApplication,\x20%s,\x20%s',_0x3395e4,'request\x20sent');_0x25cb97(_0xffae6c['result'][_0xc207('0x10')]);}})[_0xc207('0x11')](function(_0x3d9c7b){logger[_0xc207('0xf')]('SmsApplication,\x20%s,\x20%s',_0x3395e4,_0x3d9c7b);_0xad159b(_0x3d9c7b);});});}
\ No newline at end of file
+var _0xea44=['info','request\x20sent','result','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','SmsApplication,\x20%s,\x20%s','SmsApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x289801,_0x3773a8){var _0x6f2b04=function(_0x1e0d2a){while(--_0x1e0d2a){_0x289801['push'](_0x289801['shift']());}};_0x6f2b04(++_0x3773a8);}(_0xea44,0x1a5));var _0x4ea4=function(_0x55a113,_0x17e08d){_0x55a113=_0x55a113-0x0;var _0x4f7655=_0xea44[_0x55a113];return _0x4f7655;};'use strict';var _=require(_0x4ea4('0x0'));var util=require(_0x4ea4('0x1'));var moment=require(_0x4ea4('0x2'));var BPromise=require(_0x4ea4('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4ea4('0x4'));var db=require(_0x4ea4('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x4ea4('0x6'))(_0x4ea4('0x7'));var config=require(_0x4ea4('0x8'));var jayson=require(_0x4ea4('0x9'));var client=jayson['client'][_0x4ea4('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x35a1b5,_0xa0a6ce,_0x3ba1b6){return new BPromise(function(_0x13ecb6,_0xb91515){return client[_0x4ea4('0xb')](_0x35a1b5,_0x3ba1b6)[_0x4ea4('0xc')](function(_0x14d421){logger['info'](_0x4ea4('0xd'),_0xa0a6ce,'request\x20sent');logger['debug'](_0x4ea4('0xe'),_0xa0a6ce,'request\x20sent',JSON[_0x4ea4('0xf')](_0x14d421));if(_0x14d421[_0x4ea4('0x10')]){if(_0x14d421[_0x4ea4('0x10')][_0x4ea4('0x11')]===0x1f4){logger[_0x4ea4('0x10')](_0x4ea4('0xd'),_0xa0a6ce,_0x14d421[_0x4ea4('0x10')][_0x4ea4('0x12')]);return _0xb91515(_0x14d421[_0x4ea4('0x10')][_0x4ea4('0x12')]);}logger[_0x4ea4('0x10')](_0x4ea4('0xd'),_0xa0a6ce,_0x14d421[_0x4ea4('0x10')][_0x4ea4('0x12')]);return _0x13ecb6(_0x14d421['error'][_0x4ea4('0x12')]);}else{logger[_0x4ea4('0x13')](_0x4ea4('0xd'),_0xa0a6ce,_0x4ea4('0x14'));_0x13ecb6(_0x14d421[_0x4ea4('0x15')][_0x4ea4('0x12')]);}})['catch'](function(_0x65199c){logger['error']('SmsApplication,\x20%s,\x20%s',_0xa0a6ce,_0x65199c);_0xb91515(_0x65199c);});});}
\ No newline at end of file
diff --git a/server/api/smsInteraction/index.js b/server/api/smsInteraction/index.js
index 5d3e067..cf05515 100644
--- a/server/api/smsInteraction/index.js
+++ b/server/api/smsInteraction/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x2ef3=['../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe','describe','/:id','show','/:id/messages','/:id/download','download','post','create','addMessage','tracked','smsinteraction:addtags','addTags','put','smsinteraction:update','update','delete','sms','smsinteraction:destroy','/:id/tags','removeTags','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x38c5bb,_0x153bdb){var _0x5cbd09=function(_0xe17565){while(--_0xe17565){_0x38c5bb['push'](_0x38c5bb['shift']());}};_0x5cbd09(++_0x153bdb);}(_0x2ef3,0xba));var _0x32ef=function(_0x234ba6,_0x481f5d){_0x234ba6=_0x234ba6-0x0;var _0x39ce7e=_0x2ef3[_0x234ba6];return _0x39ce7e;};'use strict';var multer=require(_0x32ef('0x0'));var util=require(_0x32ef('0x1'));var path=require(_0x32ef('0x2'));var timeout=require(_0x32ef('0x3'));var express=require(_0x32ef('0x4'));var router=express[_0x32ef('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0x32ef('0x6'));var config=require(_0x32ef('0x7'));var controller=require('./smsInteraction.controller');router[_0x32ef('0x8')]('/',auth[_0x32ef('0x9')](),controller['index']);router['get'](_0x32ef('0xa'),auth[_0x32ef('0x9')](),controller[_0x32ef('0xb')]);router[_0x32ef('0x8')](_0x32ef('0xc'),auth[_0x32ef('0x9')](),controller[_0x32ef('0xd')]);router[_0x32ef('0x8')](_0x32ef('0xe'),auth[_0x32ef('0x9')](),controller['getMessages']);router['get'](_0x32ef('0xf'),auth[_0x32ef('0x9')](),controller[_0x32ef('0x10')]);router[_0x32ef('0x11')]('/',auth['isAuthenticated'](),controller[_0x32ef('0x12')]);router['post'](_0x32ef('0xe'),auth['isAuthenticated'](),controller[_0x32ef('0x13')]);router[_0x32ef('0x11')]('/:id/tags',auth['isAuthenticated'](),interaction[_0x32ef('0x14')]('sms',_0x32ef('0x15')),controller[_0x32ef('0x16')]);router[_0x32ef('0x17')](_0x32ef('0xc'),auth['isAuthenticated'](),interaction['tracked']('sms',_0x32ef('0x18')),controller[_0x32ef('0x19')]);router[_0x32ef('0x1a')]('/:id',auth['isAuthenticated'](),interaction[_0x32ef('0x14')](_0x32ef('0x1b'),_0x32ef('0x1c')),controller['destroy']);router[_0x32ef('0x1a')](_0x32ef('0x1d'),auth['isAuthenticated'](),controller[_0x32ef('0x1e')]);module[_0x32ef('0x1f')]=router;
\ No newline at end of file
+var _0xa456=['destroy','delete','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','./smsInteraction.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/messages','getMessages','/:id/download','post','addMessage','/:id/tags','smsinteraction:addtags','addTags','tracked','sms','smsinteraction:destroy'];(function(_0x36c8e9,_0x2e45f4){var _0x5e600c=function(_0x5cfdcd){while(--_0x5cfdcd){_0x36c8e9['push'](_0x36c8e9['shift']());}};_0x5e600c(++_0x2e45f4);}(_0xa456,0x142));var _0x6a45=function(_0x39c734,_0x2f3e06){_0x39c734=_0x39c734-0x0;var _0xb2a2f9=_0xa456[_0x39c734];return _0xb2a2f9;};'use strict';var multer=require(_0x6a45('0x0'));var util=require(_0x6a45('0x1'));var path=require(_0x6a45('0x2'));var timeout=require(_0x6a45('0x3'));var express=require('express');var router=express[_0x6a45('0x4')]();var auth=require(_0x6a45('0x5'));var interaction=require(_0x6a45('0x6'));var config=require('../../config/environment');var controller=require(_0x6a45('0x7'));router[_0x6a45('0x8')]('/',auth[_0x6a45('0x9')](),controller[_0x6a45('0xa')]);router['get'](_0x6a45('0xb'),auth[_0x6a45('0x9')](),controller[_0x6a45('0xc')]);router[_0x6a45('0x8')](_0x6a45('0xd'),auth['isAuthenticated'](),controller[_0x6a45('0xe')]);router['get'](_0x6a45('0xf'),auth[_0x6a45('0x9')](),controller[_0x6a45('0x10')]);router[_0x6a45('0x8')](_0x6a45('0x11'),auth['isAuthenticated'](),controller['download']);router[_0x6a45('0x12')]('/',auth[_0x6a45('0x9')](),controller['create']);router['post']('/:id/messages',auth[_0x6a45('0x9')](),controller[_0x6a45('0x13')]);router[_0x6a45('0x12')](_0x6a45('0x14'),auth[_0x6a45('0x9')](),interaction['tracked']('sms',_0x6a45('0x15')),controller[_0x6a45('0x16')]);router['put'](_0x6a45('0xd'),auth[_0x6a45('0x9')](),interaction[_0x6a45('0x17')](_0x6a45('0x18'),'smsinteraction:update'),controller['update']);router['delete'](_0x6a45('0xd'),auth[_0x6a45('0x9')](),interaction[_0x6a45('0x17')]('sms',_0x6a45('0x19')),controller[_0x6a45('0x1a')]);router[_0x6a45('0x1b')]('/:id/tags',auth['isAuthenticated'](),controller['removeTags']);module[_0x6a45('0x1c')]=router;
\ No newline at end of file
diff --git a/server/api/smsInteraction/smsInteraction.attributes.js b/server/api/smsInteraction/smsInteraction.attributes.js
index 28fe7cc..bdcca11 100644
--- a/server/api/smsInteraction/smsInteraction.attributes.js
+++ b/server/api/smsInteraction/smsInteraction.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xd8b0=['moment','STRING','DATE','ENUM','out','sequelize'];(function(_0x349a9e,_0x473cb8){var _0x24c207=function(_0x22f148){while(--_0x22f148){_0x349a9e['push'](_0x349a9e['shift']());}};_0x24c207(++_0x473cb8);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var Sequelize=require(_0x0d8b('0x0'));var moment=require(_0x0d8b('0x1'));module['exports']={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0x0d8b('0x2')]},'note':{'type':Sequelize[_0x0d8b('0x2')]},'phone':{'type':Sequelize[_0x0d8b('0x2')]},'read1stAt':{'type':Sequelize[_0x0d8b('0x3')]},'firstMsgDirection':{'type':Sequelize[_0x0d8b('0x4')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0x0d8b('0x4')]('in',_0x0d8b('0x5')),'defaultValue':'in','allowNull':![]}};
\ No newline at end of file
+var _0xcb91=['exports','BOOLEAN','DATE','STRING','out'];(function(_0x52b217,_0x477648){var _0xabe04f=function(_0x2c176d){while(--_0x2c176d){_0x52b217['push'](_0x52b217['shift']());}};_0xabe04f(++_0x477648);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x303064,_0x12f0c2){_0x303064=_0x303064-0x0;var _0x5a1d3d=_0xcb91[_0x303064];return _0x5a1d3d;};'use strict';var Sequelize=require('sequelize');var moment=require('moment');module[_0x1cb9('0x0')]={'closed':{'type':Sequelize[_0x1cb9('0x1')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x1cb9('0x2')]},'disposition':{'type':Sequelize[_0x1cb9('0x3')]},'note':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0x1cb9('0x3')]},'read1stAt':{'type':Sequelize[_0x1cb9('0x2')]},'firstMsgDirection':{'type':Sequelize['ENUM']('in',_0x1cb9('0x4')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x1cb9('0x2')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0x1cb9('0x4')),'defaultValue':'in','allowNull':![]}};
\ No newline at end of file
diff --git a/server/api/smsInteraction/smsInteraction.controller.js b/server/api/smsInteraction/smsInteraction.controller.js
index c825df1..4c3a017 100644
--- a/server/api/smsInteraction/smsInteraction.controller.js
+++ b/server/api/smsInteraction/smsInteraction.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xc368=['isEmpty','SmsAccountId','i.SmsAccountId\x20IN\x20?','concat','createdAt','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','read','having','`unreadMessages`\x20=\x200','tag','isArray','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','filter','replace','isNumeric','i.id\x20LIKE\x20?','i.phone\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','Sequelize','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages','DESC','t.id\x20IN\x20?','resolve','i.SmsAccountId\x20IS\x20NOT\x20NULL','user','getSmsAccounts','i.SmsAccountId\x20IS\x20NULL','sequelize','toString','keyBy','merge','a.key','Account.key','a.mandatoryDisposition','i.*','Contact.firstName','c.lastName','Contact.lastName','c.email','c.phone','Contact.phone','c.mobile','Contact.mobile','Contact.fax','o.fullname','Owner.fullname','GROUP_CONCAT(DISTINCT\x20t.id)','ui.SmsInteractionId\x20IN\x20?','groupBy','params','fields','includeAll','include','options','create','body','describe','addMessage','SmsMessage','omit','ids','getMessages','findOne','rawAttributes','SmsInteractionId','format','findAll','rows','addTags','setTags','spread','emit','smsInteractionTags:save','removeTags','download','join','root','server','files','attachments','transcript-%d-%s.zip','fullname','CmContact','Contact','firstName','lastName','Messages','direction','Account','Owner','get','10px','\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
Interaction\x20Transcript \x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','30px',' \x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20%s \x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{{page}}/{{pages}} \x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20%s \x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
','%s\x20#%d','Sms','YYYY-MM-DD','N.A.','YYYY-MM-DD\x20HH:mm:ss','closed','closedAt','disposition','out','System','secret','renderFile','downloadInteraction.html','toFile','transcript-','.pdf','log','err','unlinkSync','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','squel','crypto','jsforce','desk.js','querystring','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./smsInteraction.socket','register','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','destroy','then','sendStatus','name','Users','map','TagIds','Tags','split','forEach','push','catch','index','SmsInteraction','fieldName','type','key','model','query','keys','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','select','field','color','from','tools_tags','u.id','u.fullname','ui.SmsInteractionId','user_has_sms_interactions','users','u.id\x20=\x20ui.UserId','sms_interactions','left_join','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','a.id\x20=\x20i.SmsAccountId','sms_messages','me.SmsInteractionId\x20=\x20i.id','sms_interaction_has_tags','it.SmsInteractionId\x20=\x20i.id','expr','search','parseSearch','conditions','find','value','`\x20=\x200','`\x20>\x200','operator','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','text','Tag','union','User','$substring','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','start','buildExpression','some','compact'];(function(_0x489d19,_0x2e7a46){var _0x4cef0d=function(_0x14172e){while(--_0x14172e){_0x489d19['push'](_0x489d19['shift']());}};_0x4cef0d(++_0x2e7a46);}(_0xc368,0x7b));var _0x8c36=function(_0x104874,_0x534ec2){_0x104874=_0x104874-0x0;var _0x5afefb=_0xc368[_0x104874];return _0x5afefb;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x8c36('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x8c36('0x1'));var jsonpatch=require(_0x8c36('0x2'));var rp=require(_0x8c36('0x3'));var moment=require(_0x8c36('0x4'));var BPromise=require(_0x8c36('0x5'));var Mustache=require('mustache');var util=require(_0x8c36('0x6'));var path=require(_0x8c36('0x7'));var sox=require(_0x8c36('0x8'));var csv=require(_0x8c36('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x8c36('0xa'));var crypto=require(_0x8c36('0xb'));var jsforce=require(_0x8c36('0xc'));var deskjs=require(_0x8c36('0xd'));var toCsv=require(_0x8c36('0x9'));var querystring=require(_0x8c36('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x8c36('0xf'));var as=require(_0x8c36('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8c36('0x11'))(_0x8c36('0x12'));var utils=require(_0x8c36('0x13'));var config=require(_0x8c36('0x14'));var db=require(_0x8c36('0x15'))['db'];config[_0x8c36('0x16')]=_[_0x8c36('0x17')](config[_0x8c36('0x16')],{'host':_0x8c36('0x18'),'port':0x18eb});var socket=require(_0x8c36('0x19'))(new Redis(config[_0x8c36('0x16')]));require(_0x8c36('0x1a'))[_0x8c36('0x1b')](socket);function respondWithStatusCode(_0x220f18,_0x5dfcd5){_0x5dfcd5=_0x5dfcd5||0xcc;return function(_0x31d8bf){if(_0x31d8bf){return _0x220f18['sendStatus'](_0x5dfcd5);}return _0x220f18[_0x8c36('0x1c')](_0x5dfcd5)[_0x8c36('0x1d')]();};}function respondWithResult(_0x29e791,_0x1fc68e){_0x1fc68e=_0x1fc68e||0xc8;return function(_0xcfdbf7){if(_0xcfdbf7){return _0x29e791[_0x8c36('0x1c')](_0x1fc68e)[_0x8c36('0x1e')](_0xcfdbf7);}};}function respondWithFilteredResult(_0x40cecf,_0x30229e){return function(_0x49cafe){if(_0x49cafe){var _0x2be9b0=_0x49cafe[_0x8c36('0x1f')],_0x46ae6e=_0x30229e['offset'],_0x47832a=_0x30229e[_0x8c36('0x20')]+_0x30229e[_0x8c36('0x21')],_0x2d5e5b;if(_0x47832a>=_0x2be9b0){_0x47832a=_0x2be9b0;_0x2d5e5b=0xc8;}else{_0x2d5e5b=0xce;}_0x40cecf[_0x8c36('0x1c')](_0x2d5e5b);return _0x40cecf[_0x8c36('0x22')](_0x8c36('0x23'),_0x46ae6e+'-'+_0x47832a+'/'+_0x2be9b0)[_0x8c36('0x1e')](_0x49cafe);}return null;};}function patchUpdates(_0xfb9763){return function(_0x399d73){try{jsonpatch[_0x8c36('0x24')](_0x399d73,_0xfb9763,!![]);}catch(_0x474c5d){return BPromise[_0x8c36('0x25')](_0x474c5d);}return _0x399d73[_0x8c36('0x26')]();};}function saveUpdates(_0x46645d,_0x51fd6c){return function(_0x5891ef){if(_0x5891ef){return _0x5891ef['update'](_0x46645d)['then'](function(_0x2269f5){return _0x2269f5;});}return null;};}function removeEntity(_0x7effb8,_0x2088aa){return function(_0x2c9e9a){if(_0x2c9e9a){return _0x2c9e9a[_0x8c36('0x27')]()[_0x8c36('0x28')](function(){_0x7effb8['status'](0xcc)[_0x8c36('0x1d')]();});}};}function handleEntityNotFound(_0x49f6f9,_0x40b66f){return function(_0x52b90c){if(!_0x52b90c){_0x49f6f9[_0x8c36('0x29')](0x194);}return _0x52b90c;};}function handleError(_0x1afee4,_0x271ec4){_0x271ec4=_0x271ec4||0x1f4;return function(_0x1010c8){logger['error'](_0x1010c8['stack']);if(_0x1010c8[_0x8c36('0x2a')]){delete _0x1010c8[_0x8c36('0x2a')];}_0x1afee4['status'](_0x271ec4)['send'](_0x1010c8);};}function getInteractionUsers(_0x418663,_0x2b5a8c){return new BPromise(function(_0x502fa3,_0x1280a1){try{if(_0x2b5a8c[_0x418663['id']]){_0x418663[_0x8c36('0x2b')]=_[_0x8c36('0x2c')](_0x2b5a8c[_0x418663['id']],function(_0x4bc057){return{'id':_0x4bc057['id'],'fullname':_0x4bc057['fullname']};});}}catch(_0x46b72f){_0x1280a1(_0x46b72f);}_0x502fa3(_0x418663);});}function getInteractionTags(_0x1531fc,_0x3d7056){return new BPromise(function(_0x192ce3,_0x3ae970){try{if(_0x1531fc[_0x8c36('0x2d')]){_0x1531fc[_0x8c36('0x2e')]=[];_0x1531fc[_0x8c36('0x2d')][_0x8c36('0x2f')](',')[_0x8c36('0x30')](function(_0x35a349){_0x1531fc[_0x8c36('0x2e')][_0x8c36('0x31')](_0x3d7056[_0x35a349]);});}delete _0x1531fc[_0x8c36('0x2d')];}catch(_0x103d26){_0x3ae970(_0x103d26);}_0x192ce3(_0x1531fc);});}function updateSmsInteraction(_0x239fa3,_0x2e6b95,_0x5eae0a){return new BPromise(function(_0x4e8d12,_0x5c110d){return getInteractionUsers(_0x239fa3,_0x5eae0a)[_0x8c36('0x28')](function(_0x2c9a8c){return getInteractionTags(_0x2c9a8c,_0x2e6b95);})[_0x8c36('0x28')](function(_0x2fedd6){_0x4e8d12(_0x2fedd6);})[_0x8c36('0x32')](function(_0x2de1e8){_0x5c110d(_0x2de1e8);});});}exports[_0x8c36('0x33')]=function(_0x5aaab6,_0x17b5e3){var _0x59a4e6={},_0x3def90={},_0x5c743b={'count':0x0,'rows':[]};var _0x43b465=_[_0x8c36('0x2c')](db[_0x8c36('0x34')]['rawAttributes'],function(_0x1f0f9a){return{'name':_0x1f0f9a[_0x8c36('0x35')],'type':_0x1f0f9a[_0x8c36('0x36')][_0x8c36('0x37')]};});_0x3def90[_0x8c36('0x38')]=_[_0x8c36('0x2c')](_0x43b465,_0x8c36('0x2a'));_0x3def90[_0x8c36('0x39')]=_[_0x8c36('0x3a')](_0x5aaab6[_0x8c36('0x39')]);_0x3def90[_0x8c36('0x3b')]=_[_0x8c36('0x3c')](_0x3def90[_0x8c36('0x38')],_0x3def90[_0x8c36('0x39')]);_0x59a4e6[_0x8c36('0x3d')]=_[_0x8c36('0x3c')](_0x3def90[_0x8c36('0x38')],qs['fields'](_0x5aaab6[_0x8c36('0x39')]['fields']));_0x59a4e6[_0x8c36('0x3d')]=_0x59a4e6[_0x8c36('0x3d')][_0x8c36('0x3e')]?_0x59a4e6[_0x8c36('0x3d')]:_0x3def90['model'];if(!_0x5aaab6['query'][_0x8c36('0x3f')](_0x8c36('0x40'))){_0x59a4e6[_0x8c36('0x21')]=qs['limit'](_0x5aaab6['query'][_0x8c36('0x21')]);_0x59a4e6['offset']=qs['offset'](_0x5aaab6[_0x8c36('0x39')][_0x8c36('0x20')]);}_0x59a4e6[_0x8c36('0x41')]=qs[_0x8c36('0x42')](_0x5aaab6[_0x8c36('0x39')][_0x8c36('0x42')]);_0x59a4e6[_0x8c36('0x43')]=qs[_0x8c36('0x3b')](_[_0x8c36('0x44')](_0x5aaab6[_0x8c36('0x39')],_0x3def90['filters']),_0x43b465);var _0x3543b0=[];var _0x24505c=squel[_0x8c36('0x45')]()[_0x8c36('0x46')]('id')[_0x8c36('0x46')]('name')[_0x8c36('0x46')](_0x8c36('0x47'))[_0x8c36('0x48')](_0x8c36('0x49'));var _0x62a72=squel[_0x8c36('0x45')]()['field'](_0x8c36('0x4a'))[_0x8c36('0x46')](_0x8c36('0x4b'))[_0x8c36('0x46')](_0x8c36('0x4c'))[_0x8c36('0x48')](_0x8c36('0x4d'),'ui')['left_join'](_0x8c36('0x4e'),'u',_0x8c36('0x4f'));var _0x9d2165=squel[_0x8c36('0x45')]()[_0x8c36('0x48')](_0x8c36('0x50'),'i')[_0x8c36('0x51')](_0x8c36('0x52'),'c',_0x8c36('0x53'))[_0x8c36('0x51')](_0x8c36('0x4e'),'o',_0x8c36('0x54'))['left_join']('sms_accounts','a',_0x8c36('0x55'))[_0x8c36('0x51')](_0x8c36('0x56'),'me',_0x8c36('0x57'))['left_join'](_0x8c36('0x58'),'it',_0x8c36('0x59'))['left_join']('tools_tags','t','t.id\x20=\x20it.TagId');var _0xb4ebae=squel[_0x8c36('0x5a')]();var _0x3297f1=[];var _0x197d11=squel[_0x8c36('0x5a')]();var _0x2778b3;if(_0x5aaab6['query'][_0x8c36('0x5b')]){_0x2778b3=as[_0x8c36('0x5c')](_0x5aaab6[_0x8c36('0x39')][_0x8c36('0x5b')]);var _0x579bef=_0x2778b3['sqlOperator'];for(var _0x599116=0x0;_0x599116<_0x2778b3[_0x8c36('0x5d')][_0x8c36('0x3e')];_0x599116++){var _0x2fc48b=_0x2778b3[_0x8c36('0x5d')][_0x599116];var _0x24f3f9='i';var _0x3d5e0d=_[_0x8c36('0x5e')](_0x43b465,[_0x8c36('0x2a'),_0x2fc48b[_0x8c36('0x46')]]);if(!_0x3d5e0d){switch(_0x2fc48b['field']){case'unreadMessages':if(_0x2fc48b[_0x8c36('0x5f')]==0x1){_0x9d2165['having']('`'+_0x2fc48b['field']+_0x8c36('0x60'));}else{_0x9d2165['having']('`'+_0x2fc48b[_0x8c36('0x46')]+_0x8c36('0x61'));}break;case'Contact':if(_0x2fc48b[_0x8c36('0x62')]==='$substring'){if(_0x2fc48b[_0x8c36('0x5f')][_0x8c36('0x2f')]('\x20')[_0x8c36('0x3e')]>0x1){_0xb4ebae[_0x579bef]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x8c36('0x63')](_0x2fc48b[_0x8c36('0x5f')]),null);}else{var _0x2e1e03='%'+_0x2fc48b[_0x8c36('0x5f')]+'%';_0xb4ebae[_0x579bef](_0x8c36('0x64'),_0x2e1e03,_0x2e1e03,_0x2e1e03);}}else{_0x3d5e0d=_[_0x8c36('0x5e')](_0x43b465,[_0x8c36('0x2a'),_0x8c36('0x65')]);_0x2fc48b[_0x8c36('0x46')]='ContactId';_0xe59f9b=as['buildExpression'](_0x24f3f9,_0x3d5e0d['type'],_0x2fc48b);_0xb4ebae[_0x579bef](_0xe59f9b[_0x8c36('0x66')],_0xe59f9b['value']['start'],_0xe59f9b[_0x8c36('0x5f')][_0x8c36('0x1d')]);}break;case _0x8c36('0x67'):var _0x444c36=_0x2fc48b[_0x8c36('0x5f')]['split'](',')['map'](function(_0x54c675){return Number(_0x54c675);});_0x444c36[_0x8c36('0x30')](function(_0x243c1a){_0x197d11['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x243c1a+',%');});_0x3297f1=_[_0x8c36('0x68')](_0x3297f1,_0x444c36);break;case _0x8c36('0x69'):if(_0x2fc48b[_0x8c36('0x62')]===_0x8c36('0x6a')){_0xb4ebae[_0x579bef](_0x8c36('0x6b'),'%'+_0x2fc48b[_0x8c36('0x5f')]+'%',null);}else{_0x3d5e0d=_[_0x8c36('0x5e')](_0x43b465,[_0x8c36('0x2a'),_0x8c36('0x6c')]);_0x2fc48b['field']='UserId';_0xe59f9b=as['buildExpression'](_0x24f3f9,_0x3d5e0d[_0x8c36('0x36')],_0x2fc48b);_0xb4ebae[_0x579bef](_0xe59f9b[_0x8c36('0x66')],_0xe59f9b[_0x8c36('0x5f')][_0x8c36('0x6d')],_0xe59f9b[_0x8c36('0x5f')][_0x8c36('0x1d')]);}break;case'body':_0xe59f9b=as[_0x8c36('0x6e')]('me',null,_0x2fc48b);_0xb4ebae[_0x579bef](_0xe59f9b['text'],_0xe59f9b[_0x8c36('0x5f')][_0x8c36('0x6d')],_0xe59f9b[_0x8c36('0x5f')]['end']);break;}}else{var _0xe59f9b=as['buildExpression'](_0x24f3f9,_0x3d5e0d[_0x8c36('0x36')],_0x2fc48b);_0xb4ebae[_0x579bef](_0xe59f9b[_0x8c36('0x66')],_0xe59f9b[_0x8c36('0x5f')][_0x8c36('0x6d')],_0xe59f9b[_0x8c36('0x5f')]['end']);}}}else{var _0x61b2b7=_(_0x5aaab6['query'])[_0x8c36('0x3a')]()[_0x8c36('0x2c')](function(_0x59cceb){return _[_0x8c36('0x6f')](_0x43b465,[_0x8c36('0x2a'),_0x59cceb])?_0x59cceb:undefined;})[_0x8c36('0x70')]()['value']();if(!_[_0x8c36('0x71')](_0x61b2b7)){_0x61b2b7[_0x8c36('0x30')](function(_0x43d4d3){if(_0x43d4d3===_0x8c36('0x72')){_0x9d2165['where'](_0x8c36('0x73'),[][_0x8c36('0x74')](_0x5aaab6['query'][_0x43d4d3]));}else if(_0x43d4d3===_0x8c36('0x75')){var _0x1bfe8c=JSON[_0x8c36('0x76')](_0x5aaab6['query'][_0x43d4d3])[_0x8c36('0x77')];var _0x115a51=JSON['parse'](_0x5aaab6[_0x8c36('0x39')][_0x43d4d3])[_0x8c36('0x78')];_0x9d2165[_0x8c36('0x43')](_0x8c36('0x79'),_0x1bfe8c,_0x115a51);}else{if(_0x5aaab6['query'][_0x43d4d3]===_0x8c36('0x7a')){_0x9d2165['where']('i.'+_0x43d4d3+_0x8c36('0x7b'));}else{_0x9d2165[_0x8c36('0x43')]('i.'+_0x43d4d3+'\x20=\x20?',_0x5aaab6[_0x8c36('0x39')][_0x43d4d3]);}}});}if(_0x5aaab6[_0x8c36('0x39')][_0x8c36('0x7c')]){if(_0x5aaab6[_0x8c36('0x39')][_0x8c36('0x7c')]==0x1){_0x9d2165[_0x8c36('0x7d')](_0x8c36('0x7e'));}else{_0x9d2165[_0x8c36('0x7d')]('`unreadMessages`\x20>\x200');}}if(_0x5aaab6[_0x8c36('0x39')][_0x8c36('0x7f')]){_0x3297f1=_[_0x8c36('0x80')](_0x5aaab6['query'][_0x8c36('0x7f')])?_0x5aaab6[_0x8c36('0x39')][_0x8c36('0x7f')]:new Array(_0x5aaab6[_0x8c36('0x39')][_0x8c36('0x7f')]);_0x3297f1['forEach'](function(_0x291a1f){_0x197d11['or'](_0x8c36('0x81'),'%,'+_0x291a1f+',%');});}if(_0x5aaab6[_0x8c36('0x39')]['filter']){var _0x29581d=_0x5aaab6[_0x8c36('0x39')][_0x8c36('0x82')][_0x8c36('0x83')]('\x5c','\x5c\x5c')[_0x8c36('0x83')]('\x27\x27','\x27\x27\x27\x27');if(qs[_0x8c36('0x84')](_0x29581d)){_0xb4ebae['or'](_0x8c36('0x85'),_0x29581d+'%')['or'](_0x8c36('0x86'),_0x29581d+'%');}else{_0xb4ebae['or']('MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x8c36('0x63')](_0x29581d))['or'](_0x8c36('0x87'),_0x29581d+'%');}}}_0x9d2165[_0x8c36('0x43')](_0xb4ebae);_0x9d2165[_0x8c36('0x88')](_0x8c36('0x89'));var _0x114dcc={'type':db[_0x8c36('0x8a')]['QueryTypes']['SELECT'],'raw':!![]};var _0x4b193f=_0x9d2165[_0x8c36('0x8b')]();_0x4b193f[_0x8c36('0x46')](_0x8c36('0x89'));_0x4b193f[_0x8c36('0x46')](_0x8c36('0x8c'),_0x8c36('0x8d'));if(_0x59a4e6[_0x8c36('0x41')]){_0x59a4e6[_0x8c36('0x41')][_0x8c36('0x30')](function(_0x26a80a){_0x9d2165[_0x8c36('0x41')]('i.'+_0x26a80a[0x0],_0x26a80a[0x1]===_0x8c36('0x8e')?![]:!![]);});}if(!_[_0x8c36('0x71')](_0x3297f1)){_0x9d2165[_0x8c36('0x7d')](_0x197d11);_0x4b193f[_0x8c36('0x43')](_0x8c36('0x8f'),_0x3297f1);}BPromise[_0x8c36('0x90')]()[_0x8c36('0x28')](function(){if(!_0x2778b3){if(_0x5aaab6['query'][_0x8c36('0x72')]||_0x5aaab6['query']['journey'])return;_0x4b193f[_0x8c36('0x43')]('i.SmsAccountId\x20IS\x20NOT\x20NULL');_0x9d2165[_0x8c36('0x43')](_0x8c36('0x91'));return;}return _0x5aaab6[_0x8c36('0x92')][_0x8c36('0x93')]({'attributes':['id'],'raw':!![]})[_0x8c36('0x28')](function(_0x438224){if(_[_0x8c36('0x71')](_0x438224)){_0x4b193f['where']('i.SmsAccountId\x20IS\x20NULL');_0x9d2165[_0x8c36('0x43')](_0x8c36('0x94'));}else{_0x4b193f['where'](_0x8c36('0x73'),_[_0x8c36('0x2c')](_0x438224,'id'));_0x9d2165[_0x8c36('0x43')](_0x8c36('0x73'),_['map'](_0x438224,'id'));}});})[_0x8c36('0x28')](function(){db[_0x8c36('0x95')][_0x8c36('0x39')](_0x4b193f[_0x8c36('0x96')](),_0x114dcc)[_0x8c36('0x28')](function(_0x431a8e){_0x5c743b['count']=_0x431a8e[_0x8c36('0x3e')];if(_0x5c743b[_0x8c36('0x1f')]===0x0)return[];return db[_0x8c36('0x95')][_0x8c36('0x39')](_0x24505c[_0x8c36('0x96')](),_0x114dcc)[_0x8c36('0x28')](function(_0x257c2a){_0x3543b0=_[_0x8c36('0x97')](_0x257c2a,'id');_0x114dcc=_[_0x8c36('0x98')](_0x114dcc,{'model':db[_0x8c36('0x34')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x5aaab6['query']['fields']){_0x59a4e6[_0x8c36('0x3d')]['forEach'](function(_0x4dbf66){_0x9d2165[_0x8c36('0x46')]('i.'+_0x4dbf66);});}else{_0x9d2165[_0x8c36('0x46')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x8c36('0x8d'));_0x9d2165[_0x8c36('0x46')](_0x8c36('0x99'),_0x8c36('0x9a'));_0x9d2165[_0x8c36('0x46')](_0x8c36('0x9b'),'Account.mandatoryDisposition');_0x9d2165['field'](_0x8c36('0x9c'));_0x9d2165[_0x8c36('0x46')]('c.firstName',_0x8c36('0x9d'));_0x9d2165[_0x8c36('0x46')](_0x8c36('0x9e'),_0x8c36('0x9f'));_0x9d2165[_0x8c36('0x46')](_0x8c36('0xa0'),'Contact.email');_0x9d2165[_0x8c36('0x46')](_0x8c36('0xa1'),_0x8c36('0xa2'));_0x9d2165[_0x8c36('0x46')](_0x8c36('0xa3'),_0x8c36('0xa4'));_0x9d2165['field']('c.fax',_0x8c36('0xa5'));_0x9d2165[_0x8c36('0x46')](_0x8c36('0xa6'),_0x8c36('0xa7'));_0x9d2165[_0x8c36('0x46')]('o.internal','Owner.internal');_0x9d2165[_0x8c36('0x46')](_0x8c36('0xa8'),_0x8c36('0x2d'));}if(_0x59a4e6['limit'])_0x9d2165[_0x8c36('0x21')](_0x59a4e6[_0x8c36('0x21')]);if(_0x59a4e6[_0x8c36('0x20')])_0x9d2165[_0x8c36('0x20')](_0x59a4e6[_0x8c36('0x20')]);return db[_0x8c36('0x95')][_0x8c36('0x39')](_0x9d2165[_0x8c36('0x96')](),_0x114dcc);})[_0x8c36('0x28')](function(_0x440eed){_0x62a72[_0x8c36('0x43')](_0x8c36('0xa9'),_['map'](_0x440eed,'id'));return db[_0x8c36('0x95')][_0x8c36('0x39')](_0x62a72['toString'](),_0x114dcc)['then'](function(_0xe69b4a){var _0x2b9027=_[_0x8c36('0xaa')](_0xe69b4a,'SmsInteractionId');var _0x7d675c=[];_0x440eed[_0x8c36('0x30')](function(_0x1743a4){_0x7d675c[_0x8c36('0x31')](updateSmsInteraction(_0x1743a4,_0x3543b0,_0x2b9027));});return BPromise['all'](_0x7d675c);});});})[_0x8c36('0x28')](function(_0x2a7321){_0x5c743b['rows']=_0x2a7321;return _0x5c743b;})[_0x8c36('0x28')](respondWithFilteredResult(_0x17b5e3,_0x59a4e6));})[_0x8c36('0x32')](handleError(_0x17b5e3,null));};exports['show']=function(_0x413519,_0x35ce4a){var _0x3f1102={'raw':![],'where':{'id':_0x413519[_0x8c36('0xab')]['id']}},_0x42fa00={};_0x42fa00[_0x8c36('0x38')]=_[_0x8c36('0x3a')](db['SmsInteraction']['rawAttributes']);_0x42fa00['query']=_[_0x8c36('0x3a')](_0x413519[_0x8c36('0x39')]);_0x42fa00[_0x8c36('0x3b')]=_[_0x8c36('0x3c')](_0x42fa00[_0x8c36('0x38')],_0x42fa00[_0x8c36('0x39')]);_0x3f1102['attributes']=_[_0x8c36('0x3c')](_0x42fa00[_0x8c36('0x38')],qs[_0x8c36('0xac')](_0x413519[_0x8c36('0x39')]['fields']));_0x3f1102['attributes']=_0x3f1102[_0x8c36('0x3d')][_0x8c36('0x3e')]?_0x3f1102[_0x8c36('0x3d')]:_0x42fa00['model'];if(_0x413519[_0x8c36('0x39')][_0x8c36('0xad')]){_0x3f1102[_0x8c36('0xae')]=[{'all':!![]}];}_0x3f1102=_['merge']({},_0x3f1102,_0x413519[_0x8c36('0xaf')]);return db['SmsInteraction'][_0x8c36('0x5e')](_0x3f1102)[_0x8c36('0x28')](handleEntityNotFound(_0x35ce4a,null))['then'](respondWithResult(_0x35ce4a,null))[_0x8c36('0x32')](handleError(_0x35ce4a,null));};exports[_0x8c36('0xb0')]=function(_0x363065,_0x312b13){return db[_0x8c36('0x34')][_0x8c36('0xb0')](_0x363065[_0x8c36('0xb1')],{})[_0x8c36('0x28')](respondWithResult(_0x312b13,0xc9))['catch'](handleError(_0x312b13,null));};exports['update']=function(_0x105057,_0x3a237b){if(_0x105057[_0x8c36('0xb1')]['id']){delete _0x105057['body']['id'];}return db[_0x8c36('0x34')][_0x8c36('0x5e')]({'where':{'id':_0x105057['params']['id']}})['then'](handleEntityNotFound(_0x3a237b,null))[_0x8c36('0x28')](saveUpdates(_0x105057[_0x8c36('0xb1')],null))['then'](respondWithResult(_0x3a237b,null))[_0x8c36('0x32')](handleError(_0x3a237b,null));};exports[_0x8c36('0x27')]=function(_0x216e87,_0x2e800a){return db['SmsInteraction'][_0x8c36('0x5e')]({'where':{'id':_0x216e87[_0x8c36('0xab')]['id']}})[_0x8c36('0x28')](handleEntityNotFound(_0x2e800a,null))[_0x8c36('0x28')](removeEntity(_0x2e800a,null))['catch'](handleError(_0x2e800a,null));};exports[_0x8c36('0xb2')]=function(_0x14e96b,_0x40a276){return db[_0x8c36('0x34')][_0x8c36('0xb2')]()['then'](respondWithResult(_0x40a276,null))[_0x8c36('0x32')](handleError(_0x40a276,null));};exports[_0x8c36('0xb3')]=function(_0x4423dc,_0x52ea62,_0x253db3){return db[_0x8c36('0xb4')][_0x8c36('0x5e')]({'where':{'id':_0x4423dc['params']['id']}})['then'](handleEntityNotFound(_0x52ea62,null))['then'](function(_0x5ba123){if(_0x5ba123){return _0x5ba123[_0x8c36('0xb3')](_0x4423dc['body']['ids'],_[_0x8c36('0xb5')](_0x4423dc['body'],[_0x8c36('0xb6'),'id'])||{});}})[_0x8c36('0x28')](respondWithResult(_0x52ea62,null))[_0x8c36('0x32')](handleError(_0x52ea62,null));};exports[_0x8c36('0xb7')]=function(_0x5887ec,_0x36b1c9,_0xe60a72){var _0x1d4988={'raw':![],'where':{}};var _0x4a308f={};var _0x397deb={'count':0x0,'rows':[]};return db[_0x8c36('0x34')][_0x8c36('0xb8')]({'where':{'id':_0x5887ec[_0x8c36('0xab')]['id']}})[_0x8c36('0x28')](handleEntityNotFound(_0x36b1c9,null))[_0x8c36('0x28')](function(_0x323618){if(_0x323618){_0x4a308f['model']=_[_0x8c36('0x3a')](db[_0x8c36('0xb4')][_0x8c36('0xb9')]);_0x4a308f[_0x8c36('0x39')]=_[_0x8c36('0x3a')](_0x5887ec[_0x8c36('0x39')]);_0x4a308f[_0x8c36('0x3b')]=_[_0x8c36('0x3c')](_0x4a308f[_0x8c36('0x38')],_0x4a308f[_0x8c36('0x39')]);_0x1d4988[_0x8c36('0x3d')]=_[_0x8c36('0x3c')](_0x4a308f['model'],qs['fields'](_0x5887ec[_0x8c36('0x39')][_0x8c36('0xac')]));_0x1d4988[_0x8c36('0x3d')]=_0x1d4988[_0x8c36('0x3d')][_0x8c36('0x3e')]?_0x1d4988[_0x8c36('0x3d')]:_0x4a308f[_0x8c36('0x38')];if(!_0x5887ec['query']['hasOwnProperty']('nolimit')){_0x1d4988[_0x8c36('0x21')]=qs[_0x8c36('0x21')](_0x5887ec[_0x8c36('0x39')][_0x8c36('0x21')]);_0x1d4988['offset']=qs[_0x8c36('0x20')](_0x5887ec[_0x8c36('0x39')][_0x8c36('0x20')]);}_0x1d4988[_0x8c36('0x41')]=qs[_0x8c36('0x42')](_0x5887ec[_0x8c36('0x39')][_0x8c36('0x42')]);_0x1d4988['where']=qs[_0x8c36('0x3b')](_[_0x8c36('0x44')](_0x5887ec[_0x8c36('0x39')],_0x4a308f[_0x8c36('0x3b')]));_0x1d4988[_0x8c36('0x43')][_0x8c36('0xba')]=_0x323618['id'];if(_0x5887ec[_0x8c36('0x39')][_0x8c36('0x82')]){_0x1d4988['where']=_[_0x8c36('0x98')](_0x1d4988[_0x8c36('0x43')],{'$or':_[_0x8c36('0x2c')](_0x1d4988[_0x8c36('0x3d')],function(_0xe1d9ab){var _0x511b31={};_0x511b31[_0xe1d9ab]={'$like':'%'+_0x5887ec[_0x8c36('0x39')][_0x8c36('0x82')]+'%'};return _0x511b31;})});}if(_0x5887ec[_0x8c36('0x39')][_0x8c36('0x77')]){var _0x416405=_0x5887ec[_0x8c36('0x39')][_0x8c36('0x77')][_0x8c36('0x2f')](',');var _0x56c11f={};_0x56c11f[_0x416405[0x0]]={'$gte':moment(_0x416405[0x1])[_0x8c36('0xbb')]('YYYY-MM-DD\x20HH:mm:ss')};_0x1d4988['where']=_['merge'](_0x1d4988[_0x8c36('0x43')],_0x56c11f);}_0x1d4988=_[_0x8c36('0x98')]({},_0x1d4988,_0x5887ec[_0x8c36('0xaf')]);return db['SmsMessage'][_0x8c36('0x1f')]({'where':_0x1d4988[_0x8c36('0x43')]})[_0x8c36('0x28')](function(_0x53106c){_0x397deb['count']=_0x53106c;if(_0x5887ec[_0x8c36('0x39')]['includeAll']){_0x1d4988[_0x8c36('0xae')]=[{'all':!![]}];}return db[_0x8c36('0xb4')][_0x8c36('0xbc')](_0x1d4988);})['then'](function(_0xcb42e){_0x397deb[_0x8c36('0xbd')]=_0xcb42e;return _0x397deb;});}})[_0x8c36('0x28')](respondWithFilteredResult(_0x36b1c9,_0x1d4988))['catch'](handleError(_0x36b1c9,null));};exports[_0x8c36('0xbe')]=function(_0x6cb232,_0xb38f74,_0x2da99c){return db[_0x8c36('0x34')][_0x8c36('0x5e')]({'where':{'id':_0x6cb232['params']['id']}})[_0x8c36('0x28')](handleEntityNotFound(_0xb38f74,null))[_0x8c36('0x28')](function(_0x3a9951){if(_0x3a9951){return _0x3a9951[_0x8c36('0xbf')](_0x6cb232[_0x8c36('0xb1')]['ids'],_['omit'](_0x6cb232['body'],['ids','id'])||{})[_0x8c36('0xc0')](function(){return db['Tag'][_0x8c36('0xbc')]({'attributes':['id',_0x8c36('0x2a'),_0x8c36('0x47')],'where':{'id':_0x6cb232['body'][_0x8c36('0xb6')]}});})['then'](function(_0x21120c){socket[_0x8c36('0xc1')](_0x8c36('0xc2'),{'id':Number(_0x6cb232[_0x8c36('0xab')]['id']),'tags':_0x21120c||[]});return{'id':Number(_0x6cb232[_0x8c36('0xab')]['id']),'tags':_0x21120c||[]};});}})[_0x8c36('0x28')](respondWithResult(_0xb38f74,null))[_0x8c36('0x32')](handleError(_0xb38f74,null));};exports[_0x8c36('0xc3')]=function(_0x4de9c8,_0x47194d,_0x54967c){return db[_0x8c36('0x34')]['find']({'where':{'id':_0x4de9c8['params']['id']}})['then'](handleEntityNotFound(_0x47194d,null))[_0x8c36('0x28')](function(_0x4d322c){if(_0x4d322c){return _0x4d322c[_0x8c36('0xc3')](_0x4de9c8['query'][_0x8c36('0xb6')]);}})[_0x8c36('0x28')](respondWithStatusCode(_0x47194d,null))[_0x8c36('0x32')](handleError(_0x47194d,null));};exports[_0x8c36('0xc4')]=function(_0x2cc362,_0xd2a10e){var _0x222824=moment()['unix']()['toString']();var _0x376e64=path[_0x8c36('0xc5')](config[_0x8c36('0xc6')],_0x8c36('0xc7'),_0x8c36('0xc8'),'tmp');var _0x5466bc=path[_0x8c36('0xc5')](config['root'],_0x8c36('0xc7'),_0x8c36('0xc8'),_0x8c36('0xc9'));var _0x2c76f8=path['join'](_0x376e64,_0x222824);var _0x76be11=util[_0x8c36('0xbb')](_0x8c36('0xca'),_0x2cc362[_0x8c36('0xab')]['id'],_0x222824);var _0x3fa94a=path['join'](_0x376e64,_0x76be11);var _0x1e41d9=[];_0x1e41d9[_0x8c36('0x31')]({'model':db['User'],'as':_0x8c36('0x69'),'attributes':['id',_0x8c36('0xcb')],'raw':!![]});_0x1e41d9[_0x8c36('0x31')]({'model':db[_0x8c36('0xcc')],'as':_0x8c36('0xcd'),'attributes':['id',_0x8c36('0xce'),_0x8c36('0xcf')],'raw':!![]});var _0x44285d=[{'model':db[_0x8c36('0xb4')],'as':_0x8c36('0xd0'),'attributes':['id',_0x8c36('0xb1'),_0x8c36('0x75'),_0x8c36('0xd1'),'secret','read'],'include':_0x1e41d9}];_0x44285d['push']({'model':db['SmsAccount'],'as':_0x8c36('0xd2'),'attributes':['id',_0x8c36('0x2a')]});_0x44285d[_0x8c36('0x31')]({'model':db['User'],'as':_0x8c36('0xd3'),'attributes':['id',_0x8c36('0xcb')]});return db[_0x8c36('0x34')]['find']({'where':{'id':_0x2cc362[_0x8c36('0xab')]['id']},'include':_0x44285d})[_0x8c36('0x28')](handleEntityNotFound(_0xd2a10e,null))[_0x8c36('0x28')](function(_0x1f8f87){if(_0x1f8f87){var _0x2326d8=_0x1f8f87[_0x8c36('0xd4')]({'plain':!![]});fs['mkdirSync'](_0x2c76f8);var _0x2adf71={'format':'A4','border':_0x8c36('0xd5'),'header':{'height':'40px','contents':{'first':_0x8c36('0xd6')}},'footer':{'height':_0x8c36('0xd7'),'contents':{'default':util[_0x8c36('0xbb')](_0x8c36('0xd8'),util[_0x8c36('0xbb')](_0x8c36('0xd9'),_0x8c36('0xda'),_0x2326d8['id']),moment()['format'](_0x8c36('0xdb'))[_0x8c36('0x96')]())}}};var _0x4b4060={'channel':_0x8c36('0xda'),'account':_0x2326d8['Account'][_0x8c36('0x2a')],'agent':_0x2326d8[_0x8c36('0xd3')]?_0x2326d8[_0x8c36('0xd3')][_0x8c36('0xcb')]:_0x8c36('0xdc'),'createdAt':moment(_0x2326d8[_0x8c36('0x75')])[_0x8c36('0xbb')](_0x8c36('0xdd'))[_0x8c36('0x96')](),'closedAt':_0x2326d8[_0x8c36('0xde')]?moment(_0x2326d8[_0x8c36('0xdf')])['format']('YYYY-MM-DD\x20HH:mm:ss')[_0x8c36('0x96')]():'','disposition':_0x2326d8[_0x8c36('0xe0')],'messages':_(_0x2326d8[_0x8c36('0xd0')])['filter']({'secret':![]})[_0x8c36('0x2c')](function(_0xd3dc5a){return{'date':moment(_0xd3dc5a['createdAt'])[_0x8c36('0xbb')]('YYYY-MM-DD\x20HH:mm:ss')[_0x8c36('0x96')](),'sender':_0xd3dc5a['direction']===_0x8c36('0xe1')?_0xd3dc5a[_0x8c36('0x69')]?_0xd3dc5a['User'][_0x8c36('0xcb')]:_0x8c36('0xe2'):_0xd3dc5a[_0x8c36('0xcd')][_0x8c36('0xce')]+(_0xd3dc5a[_0x8c36('0xcd')][_0x8c36('0xcf')]?'\x20'+_0xd3dc5a['Contact'][_0x8c36('0xcf')]:''),'body':_0xd3dc5a['body'],'direction':_0xd3dc5a[_0x8c36('0xd1')]==='out'?'A':'C','secret':_0xd3dc5a[_0x8c36('0xe3')],'read':_0xd3dc5a[_0x8c36('0x7c')]};})['value']()};return ejs[_0x8c36('0xe4')](path['join'](config[_0x8c36('0xc6')],_0x8c36('0xc7'),'views',_0x8c36('0xe5')),{'interaction':_0x4b4060})[_0x8c36('0x28')](function(_0x242409){return new BPromise(function(_0x101369,_0x31c8f8){pdf[_0x8c36('0xb0')](_0x242409,_0x2adf71)[_0x8c36('0xe6')](path[_0x8c36('0xc5')](_0x2c76f8,_0x8c36('0xe7')+_0x2326d8['id']+'-'+_0x222824+_0x8c36('0xe8')),function(_0x1e729c,_0x5148d9){if(_0x1e729c)return _0x31c8f8(_0x1e729c);_0x101369(_0x5148d9);});});})['then'](function(){return new BPromise(function(_0x3143b2,_0x2d6b7e){zipdir(_0x2c76f8,{'saveTo':_0x3fa94a},function(_0xecf066,_0x15ec96){if(_0xecf066)return _0x2d6b7e(_0xecf066);return _0x3143b2(_0x15ec96);});})['then'](function(){return new BPromise(function(_0x285a25,_0xbe4063){rimraf(_0x2c76f8,function(_0x484829){if(_0x484829)_0xbe4063(_0x484829);return _0x285a25();});});})[_0x8c36('0x28')](function(){return _0xd2a10e['download'](_0x3fa94a,_0x76be11,function(_0x441465){if(_0x441465){console[_0x8c36('0xe9')](_0x8c36('0xea'),_0x441465);}else{fs[_0x8c36('0xeb')](_0x3fa94a);}});});});}else{return _0xd2a10e['sendStatus'](0xc8);}})[_0x8c36('0x32')](handleError(_0xd2a10e,null));};
\ No newline at end of file
+var _0xa75b=['select','field','u.id','u.fullname','ui.SmsInteractionId','left_join','u.id\x20=\x20ui.UserId','from','sms_interactions','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','users','o.id\x20=\x20i.UserId','sms_accounts','a.id\x20=\x20i.SmsAccountId','me.SmsInteractionId\x20=\x20i.id','sms_interaction_has_tags','it.SmsInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','find','unreadMessages','having','`\x20>\x200','Contact','operator','value','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','$substring','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','start','text','some','isEmpty','forEach','SmsAccountId','i.SmsAccountId\x20IN\x20?','concat','createdAt','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','\x20=\x20?','read','`unreadMessages`\x20=\x200','tag','filter','\x27\x27\x27\x27','i.id\x20LIKE\x20?','i.phone\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','SELECT','clone','i.id','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','t.id\x20IN\x20?','i.SmsAccountId\x20IS\x20NOT\x20NULL','user','getSmsAccounts','i.SmsAccountId\x20IS\x20NULL','sequelize','toString','merge','a.key','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','i.*','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.email','Contact.mobile','c.fax','Contact.fax','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.SmsInteractionId\x20IN\x20?','SmsInteractionId','push','rows','catch','show','params','includeAll','options','create','body','destroy','describe','addMessage','SmsMessage','ids','omit','getMessages','findOne','format','YYYY-MM-DD\x20HH:mm:ss','include','findAll','spread','emit','smsInteractionTags:save','removeTags','download','unix','join','root','server','files','transcript-%d-%s.zip','CmContact','firstName','lastName','Messages','secret','SmsAccount','get','10px','\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
Interaction\x20Transcript \x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','30px',' \x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20%s \x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{{page}}/{{pages}} \x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20%s \x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
','%s\x20#%d','Sms','Owner','N.A.','closedAt','disposition','out','System','renderFile','views','toFile','transcript-','log','err','unlinkSync','html-pdf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','register','status','end','json','count','offset','limit','save','update','then','sendStatus','name','send','map','fullname','TagIds','Tags','split','index','SmsInteraction','rawAttributes','type','key','query','keys','filters','attributes','intersection','model','fields','length','hasOwnProperty','nolimit','order','sort','where','pick'];(function(_0x3af21a,_0x41400d){var _0x31334b=function(_0x53b37a){while(--_0x53b37a){_0x3af21a['push'](_0x3af21a['shift']());}};_0x31334b(++_0x41400d);}(_0xa75b,0x170));var _0xba75=function(_0x454ba1,_0x5aa3e5){_0x454ba1=_0x454ba1-0x0;var _0x5487ac=_0xa75b[_0x454ba1];return _0x5487ac;};'use strict';var pdf=require(_0xba75('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xba75('0x1'));var jsonpatch=require(_0xba75('0x2'));var rp=require(_0xba75('0x3'));var moment=require(_0xba75('0x4'));var BPromise=require(_0xba75('0x5'));var Mustache=require(_0xba75('0x6'));var util=require(_0xba75('0x7'));var path=require(_0xba75('0x8'));var sox=require(_0xba75('0x9'));var csv=require(_0xba75('0xa'));var ejs=require(_0xba75('0xb'));var fs=require('fs');var _=require(_0xba75('0xc'));var squel=require(_0xba75('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xba75('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xba75('0xf'));var Redis=require('ioredis');var authService=require(_0xba75('0x10'));var qs=require(_0xba75('0x11'));var as=require(_0xba75('0x12'));var hardwareService=require(_0xba75('0x13'));var logger=require(_0xba75('0x14'))(_0xba75('0x15'));var utils=require(_0xba75('0x16'));var config=require(_0xba75('0x17'));var db=require(_0xba75('0x18'))['db'];config[_0xba75('0x19')]=_[_0xba75('0x1a')](config[_0xba75('0x19')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xba75('0x19')]));require('./smsInteraction.socket')[_0xba75('0x1b')](socket);function respondWithStatusCode(_0x2df615,_0xa27f76){_0xa27f76=_0xa27f76||0xcc;return function(_0x383b1e){if(_0x383b1e){return _0x2df615['sendStatus'](_0xa27f76);}return _0x2df615[_0xba75('0x1c')](_0xa27f76)[_0xba75('0x1d')]();};}function respondWithResult(_0x256678,_0x4028f9){_0x4028f9=_0x4028f9||0xc8;return function(_0x41c9e5){if(_0x41c9e5){return _0x256678['status'](_0x4028f9)[_0xba75('0x1e')](_0x41c9e5);}};}function respondWithFilteredResult(_0x2bf023,_0x14bd83){return function(_0x47be93){if(_0x47be93){var _0x2822af=_0x47be93[_0xba75('0x1f')],_0xd8850f=_0x14bd83[_0xba75('0x20')],_0xc4bf17=_0x14bd83['offset']+_0x14bd83[_0xba75('0x21')],_0x132750;if(_0xc4bf17>=_0x2822af){_0xc4bf17=_0x2822af;_0x132750=0xc8;}else{_0x132750=0xce;}_0x2bf023[_0xba75('0x1c')](_0x132750);return _0x2bf023['set']('Content-Range',_0xd8850f+'-'+_0xc4bf17+'/'+_0x2822af)[_0xba75('0x1e')](_0x47be93);}return null;};}function patchUpdates(_0x31bc33){return function(_0x496cfc){try{jsonpatch['apply'](_0x496cfc,_0x31bc33,!![]);}catch(_0x30f482){return BPromise['reject'](_0x30f482);}return _0x496cfc[_0xba75('0x22')]();};}function saveUpdates(_0x2ece41,_0x19b2d7){return function(_0x4efad7){if(_0x4efad7){return _0x4efad7[_0xba75('0x23')](_0x2ece41)[_0xba75('0x24')](function(_0x139fa4){return _0x139fa4;});}return null;};}function removeEntity(_0x3e9bd9,_0x14c54b){return function(_0x29b14c){if(_0x29b14c){return _0x29b14c['destroy']()[_0xba75('0x24')](function(){_0x3e9bd9[_0xba75('0x1c')](0xcc)[_0xba75('0x1d')]();});}};}function handleEntityNotFound(_0x5ec733,_0x1caa6){return function(_0x44b1d4){if(!_0x44b1d4){_0x5ec733[_0xba75('0x25')](0x194);}return _0x44b1d4;};}function handleError(_0x37f7c8,_0x35c571){_0x35c571=_0x35c571||0x1f4;return function(_0x155c74){logger['error'](_0x155c74['stack']);if(_0x155c74['name']){delete _0x155c74[_0xba75('0x26')];}_0x37f7c8['status'](_0x35c571)[_0xba75('0x27')](_0x155c74);};}function getInteractionUsers(_0x58ea2d,_0x15b5bc){return new BPromise(function(_0x1afc1f,_0x20ac78){try{if(_0x15b5bc[_0x58ea2d['id']]){_0x58ea2d['Users']=_[_0xba75('0x28')](_0x15b5bc[_0x58ea2d['id']],function(_0x62cf49){return{'id':_0x62cf49['id'],'fullname':_0x62cf49[_0xba75('0x29')]};});}}catch(_0x2808f0){_0x20ac78(_0x2808f0);}_0x1afc1f(_0x58ea2d);});}function getInteractionTags(_0x5d9f78,_0x4791a5){return new BPromise(function(_0x200715,_0x481a04){try{if(_0x5d9f78[_0xba75('0x2a')]){_0x5d9f78[_0xba75('0x2b')]=[];_0x5d9f78[_0xba75('0x2a')][_0xba75('0x2c')](',')['forEach'](function(_0x238271){_0x5d9f78[_0xba75('0x2b')]['push'](_0x4791a5[_0x238271]);});}delete _0x5d9f78[_0xba75('0x2a')];}catch(_0x37d6bb){_0x481a04(_0x37d6bb);}_0x200715(_0x5d9f78);});}function updateSmsInteraction(_0x3930,_0x2e6680,_0x4ee68d){return new BPromise(function(_0x75f87a,_0x3a1610){return getInteractionUsers(_0x3930,_0x4ee68d)['then'](function(_0x36d826){return getInteractionTags(_0x36d826,_0x2e6680);})[_0xba75('0x24')](function(_0x5a88a3){_0x75f87a(_0x5a88a3);})['catch'](function(_0x29334a){_0x3a1610(_0x29334a);});});}exports[_0xba75('0x2d')]=function(_0x1114e0,_0x381cb){var _0x5e3c8c={},_0xe5f817={},_0x3d8453={'count':0x0,'rows':[]};var _0x4c9fb2=_['map'](db[_0xba75('0x2e')][_0xba75('0x2f')],function(_0x169e2a){return{'name':_0x169e2a['fieldName'],'type':_0x169e2a[_0xba75('0x30')][_0xba75('0x31')]};});_0xe5f817['model']=_['map'](_0x4c9fb2,_0xba75('0x26'));_0xe5f817[_0xba75('0x32')]=_[_0xba75('0x33')](_0x1114e0[_0xba75('0x32')]);_0xe5f817[_0xba75('0x34')]=_['intersection'](_0xe5f817['model'],_0xe5f817[_0xba75('0x32')]);_0x5e3c8c[_0xba75('0x35')]=_[_0xba75('0x36')](_0xe5f817[_0xba75('0x37')],qs[_0xba75('0x38')](_0x1114e0[_0xba75('0x32')][_0xba75('0x38')]));_0x5e3c8c['attributes']=_0x5e3c8c[_0xba75('0x35')][_0xba75('0x39')]?_0x5e3c8c['attributes']:_0xe5f817[_0xba75('0x37')];if(!_0x1114e0[_0xba75('0x32')][_0xba75('0x3a')](_0xba75('0x3b'))){_0x5e3c8c[_0xba75('0x21')]=qs[_0xba75('0x21')](_0x1114e0[_0xba75('0x32')]['limit']);_0x5e3c8c[_0xba75('0x20')]=qs['offset'](_0x1114e0[_0xba75('0x32')]['offset']);}_0x5e3c8c[_0xba75('0x3c')]=qs[_0xba75('0x3d')](_0x1114e0[_0xba75('0x32')][_0xba75('0x3d')]);_0x5e3c8c[_0xba75('0x3e')]=qs[_0xba75('0x34')](_[_0xba75('0x3f')](_0x1114e0[_0xba75('0x32')],_0xe5f817[_0xba75('0x34')]),_0x4c9fb2);var _0x5c7c7f=[];var _0x30b5f0=squel[_0xba75('0x40')]()['field']('id')[_0xba75('0x41')](_0xba75('0x26'))[_0xba75('0x41')]('color')['from']('tools_tags');var _0x5f008b=squel[_0xba75('0x40')]()['field'](_0xba75('0x42'))[_0xba75('0x41')](_0xba75('0x43'))[_0xba75('0x41')](_0xba75('0x44'))['from']('user_has_sms_interactions','ui')[_0xba75('0x45')]('users','u',_0xba75('0x46'));var _0x4e7c18=squel[_0xba75('0x40')]()[_0xba75('0x47')](_0xba75('0x48'),'i')[_0xba75('0x45')]('cm_contacts','c',_0xba75('0x49'))[_0xba75('0x45')](_0xba75('0x4a'),'o',_0xba75('0x4b'))[_0xba75('0x45')](_0xba75('0x4c'),'a',_0xba75('0x4d'))[_0xba75('0x45')]('sms_messages','me',_0xba75('0x4e'))[_0xba75('0x45')](_0xba75('0x4f'),'it',_0xba75('0x50'))[_0xba75('0x45')]('tools_tags','t',_0xba75('0x51'));var _0x25ae33=squel[_0xba75('0x52')]();var _0x3f844c=[];var _0x174abe=squel[_0xba75('0x52')]();var _0x2c9085;if(_0x1114e0['query'][_0xba75('0x53')]){_0x2c9085=as[_0xba75('0x54')](_0x1114e0[_0xba75('0x32')]['search']);var _0x2c0a59=_0x2c9085[_0xba75('0x55')];for(var _0x559f6f=0x0;_0x559f6f<_0x2c9085['conditions'][_0xba75('0x39')];_0x559f6f++){var _0x5e3785=_0x2c9085['conditions'][_0x559f6f];var _0x40435e='i';var _0x531cd7=_[_0xba75('0x56')](_0x4c9fb2,[_0xba75('0x26'),_0x5e3785[_0xba75('0x41')]]);if(!_0x531cd7){switch(_0x5e3785[_0xba75('0x41')]){case _0xba75('0x57'):if(_0x5e3785['value']==0x1){_0x4e7c18[_0xba75('0x58')]('`'+_0x5e3785[_0xba75('0x41')]+'`\x20=\x200');}else{_0x4e7c18[_0xba75('0x58')]('`'+_0x5e3785[_0xba75('0x41')]+_0xba75('0x59'));}break;case _0xba75('0x5a'):if(_0x5e3785[_0xba75('0x5b')]==='$substring'){if(_0x5e3785[_0xba75('0x5c')][_0xba75('0x2c')]('\x20')['length']>0x1){_0x25ae33[_0x2c0a59](_0xba75('0x5d'),qs[_0xba75('0x5e')](_0x5e3785[_0xba75('0x5c')]),null);}else{var _0x162621='%'+_0x5e3785[_0xba75('0x5c')]+'%';_0x25ae33[_0x2c0a59](_0xba75('0x5f'),_0x162621,_0x162621,_0x162621);}}else{_0x531cd7=_['find'](_0x4c9fb2,[_0xba75('0x26'),_0xba75('0x60')]);_0x5e3785[_0xba75('0x41')]=_0xba75('0x60');_0xf02890=as[_0xba75('0x61')](_0x40435e,_0x531cd7[_0xba75('0x30')],_0x5e3785);_0x25ae33[_0x2c0a59](_0xf02890['text'],_0xf02890['value']['start'],_0xf02890['value'][_0xba75('0x1d')]);}break;case _0xba75('0x62'):var _0x2991e5=_0x5e3785[_0xba75('0x5c')][_0xba75('0x2c')](',')[_0xba75('0x28')](function(_0x3935bd){return Number(_0x3935bd);});_0x2991e5['forEach'](function(_0x1c4707){_0x174abe['or'](_0xba75('0x63'),'%,'+_0x1c4707+',%');});_0x3f844c=_[_0xba75('0x64')](_0x3f844c,_0x2991e5);break;case _0xba75('0x65'):if(_0x5e3785['operator']===_0xba75('0x66')){_0x25ae33[_0x2c0a59](_0xba75('0x67'),'%'+_0x5e3785['value']+'%',null);}else{_0x531cd7=_[_0xba75('0x56')](_0x4c9fb2,['name',_0xba75('0x68')]);_0x5e3785[_0xba75('0x41')]='UserId';_0xf02890=as[_0xba75('0x61')](_0x40435e,_0x531cd7[_0xba75('0x30')],_0x5e3785);_0x25ae33[_0x2c0a59](_0xf02890['text'],_0xf02890['value'][_0xba75('0x69')],_0xf02890['value'][_0xba75('0x1d')]);}break;case'body':_0xf02890=as[_0xba75('0x61')]('me',null,_0x5e3785);_0x25ae33[_0x2c0a59](_0xf02890[_0xba75('0x6a')],_0xf02890[_0xba75('0x5c')][_0xba75('0x69')],_0xf02890[_0xba75('0x5c')]['end']);break;}}else{var _0xf02890=as[_0xba75('0x61')](_0x40435e,_0x531cd7['type'],_0x5e3785);_0x25ae33[_0x2c0a59](_0xf02890[_0xba75('0x6a')],_0xf02890[_0xba75('0x5c')][_0xba75('0x69')],_0xf02890[_0xba75('0x5c')][_0xba75('0x1d')]);}}}else{var _0x1d3331=_(_0x1114e0[_0xba75('0x32')])[_0xba75('0x33')]()[_0xba75('0x28')](function(_0x36bd35){return _[_0xba75('0x6b')](_0x4c9fb2,[_0xba75('0x26'),_0x36bd35])?_0x36bd35:undefined;})['compact']()['value']();if(!_[_0xba75('0x6c')](_0x1d3331)){_0x1d3331[_0xba75('0x6d')](function(_0x46f3ed){if(_0x46f3ed===_0xba75('0x6e')){_0x4e7c18[_0xba75('0x3e')](_0xba75('0x6f'),[][_0xba75('0x70')](_0x1114e0[_0xba75('0x32')][_0x46f3ed]));}else if(_0x46f3ed===_0xba75('0x71')){var _0x259f40=JSON[_0xba75('0x72')](_0x1114e0['query'][_0x46f3ed])[_0xba75('0x73')];var _0x5c1e1d=JSON[_0xba75('0x72')](_0x1114e0[_0xba75('0x32')][_0x46f3ed])[_0xba75('0x74')];_0x4e7c18[_0xba75('0x3e')](_0xba75('0x75'),_0x259f40,_0x5c1e1d);}else{if(_0x1114e0[_0xba75('0x32')][_0x46f3ed]==='null'){_0x4e7c18[_0xba75('0x3e')]('i.'+_0x46f3ed+'\x20IS\x20NULL');}else{_0x4e7c18[_0xba75('0x3e')]('i.'+_0x46f3ed+_0xba75('0x76'),_0x1114e0['query'][_0x46f3ed]);}}});}if(_0x1114e0['query'][_0xba75('0x77')]){if(_0x1114e0[_0xba75('0x32')][_0xba75('0x77')]==0x1){_0x4e7c18[_0xba75('0x58')](_0xba75('0x78'));}else{_0x4e7c18[_0xba75('0x58')]('`unreadMessages`\x20>\x200');}}if(_0x1114e0[_0xba75('0x32')][_0xba75('0x79')]){_0x3f844c=_['isArray'](_0x1114e0[_0xba75('0x32')][_0xba75('0x79')])?_0x1114e0[_0xba75('0x32')][_0xba75('0x79')]:new Array(_0x1114e0[_0xba75('0x32')]['tag']);_0x3f844c[_0xba75('0x6d')](function(_0x541fc0){_0x174abe['or'](_0xba75('0x63'),'%,'+_0x541fc0+',%');});}if(_0x1114e0[_0xba75('0x32')][_0xba75('0x7a')]){var _0x42dcc7=_0x1114e0[_0xba75('0x32')][_0xba75('0x7a')]['replace']('\x5c','\x5c\x5c')['replace']('\x27\x27',_0xba75('0x7b'));if(qs['isNumeric'](_0x42dcc7)){_0x25ae33['or'](_0xba75('0x7c'),_0x42dcc7+'%')['or'](_0xba75('0x7d'),_0x42dcc7+'%');}else{_0x25ae33['or']('MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0xba75('0x5e')](_0x42dcc7))['or'](_0xba75('0x7e'),_0x42dcc7+'%');}}}_0x4e7c18[_0xba75('0x3e')](_0x25ae33);_0x4e7c18['group']('i.id');var _0x5b6a71={'type':db['Sequelize']['QueryTypes'][_0xba75('0x7f')],'raw':!![]};var _0x549f1d=_0x4e7c18[_0xba75('0x80')]();_0x549f1d[_0xba75('0x41')](_0xba75('0x81'));_0x549f1d[_0xba75('0x41')](_0xba75('0x82'),_0xba75('0x57'));if(_0x5e3c8c[_0xba75('0x3c')]){_0x5e3c8c['order']['forEach'](function(_0x2c9dec){_0x4e7c18[_0xba75('0x3c')]('i.'+_0x2c9dec[0x0],_0x2c9dec[0x1]==='DESC'?![]:!![]);});}if(!_[_0xba75('0x6c')](_0x3f844c)){_0x4e7c18['having'](_0x174abe);_0x549f1d[_0xba75('0x3e')](_0xba75('0x83'),_0x3f844c);}BPromise['resolve']()[_0xba75('0x24')](function(){if(!_0x2c9085){if(_0x1114e0['query'][_0xba75('0x6e')]||_0x1114e0[_0xba75('0x32')]['journey'])return;_0x549f1d[_0xba75('0x3e')](_0xba75('0x84'));_0x4e7c18[_0xba75('0x3e')](_0xba75('0x84'));return;}return _0x1114e0[_0xba75('0x85')][_0xba75('0x86')]({'attributes':['id'],'raw':!![]})[_0xba75('0x24')](function(_0xaa4b51){if(_['isEmpty'](_0xaa4b51)){_0x549f1d[_0xba75('0x3e')](_0xba75('0x87'));_0x4e7c18['where']('i.SmsAccountId\x20IS\x20NULL');}else{_0x549f1d['where'](_0xba75('0x6f'),_['map'](_0xaa4b51,'id'));_0x4e7c18[_0xba75('0x3e')]('i.SmsAccountId\x20IN\x20?',_[_0xba75('0x28')](_0xaa4b51,'id'));}});})['then'](function(){db['sequelize'][_0xba75('0x32')](_0x549f1d['toString'](),_0x5b6a71)[_0xba75('0x24')](function(_0x51f79f){_0x3d8453['count']=_0x51f79f[_0xba75('0x39')];if(_0x3d8453['count']===0x0)return[];return db[_0xba75('0x88')]['query'](_0x30b5f0[_0xba75('0x89')](),_0x5b6a71)[_0xba75('0x24')](function(_0x21fa25){_0x5c7c7f=_['keyBy'](_0x21fa25,'id');_0x5b6a71=_[_0xba75('0x8a')](_0x5b6a71,{'model':db[_0xba75('0x2e')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x1114e0['query'][_0xba75('0x38')]){_0x5e3c8c['attributes']['forEach'](function(_0x3791c4){_0x4e7c18['field']('i.'+_0x3791c4);});}else{_0x4e7c18[_0xba75('0x41')](_0xba75('0x82'),_0xba75('0x57'));_0x4e7c18[_0xba75('0x41')](_0xba75('0x8b'),_0xba75('0x8c'));_0x4e7c18[_0xba75('0x41')](_0xba75('0x8d'),_0xba75('0x8e'));_0x4e7c18[_0xba75('0x41')](_0xba75('0x8f'));_0x4e7c18['field']('c.firstName',_0xba75('0x90'));_0x4e7c18['field'](_0xba75('0x91'),_0xba75('0x92'));_0x4e7c18[_0xba75('0x41')](_0xba75('0x93'),_0xba75('0x94'));_0x4e7c18[_0xba75('0x41')]('c.phone','Contact.phone');_0x4e7c18[_0xba75('0x41')]('c.mobile',_0xba75('0x95'));_0x4e7c18[_0xba75('0x41')](_0xba75('0x96'),_0xba75('0x97'));_0x4e7c18[_0xba75('0x41')]('o.fullname',_0xba75('0x98'));_0x4e7c18[_0xba75('0x41')](_0xba75('0x99'),_0xba75('0x9a'));_0x4e7c18[_0xba75('0x41')](_0xba75('0x9b'),_0xba75('0x2a'));}if(_0x5e3c8c[_0xba75('0x21')])_0x4e7c18[_0xba75('0x21')](_0x5e3c8c['limit']);if(_0x5e3c8c[_0xba75('0x20')])_0x4e7c18[_0xba75('0x20')](_0x5e3c8c[_0xba75('0x20')]);return db[_0xba75('0x88')][_0xba75('0x32')](_0x4e7c18[_0xba75('0x89')](),_0x5b6a71);})[_0xba75('0x24')](function(_0x423d44){_0x5f008b['where'](_0xba75('0x9c'),_[_0xba75('0x28')](_0x423d44,'id'));return db[_0xba75('0x88')][_0xba75('0x32')](_0x5f008b[_0xba75('0x89')](),_0x5b6a71)[_0xba75('0x24')](function(_0x4f9f48){var _0xe8ead=_['groupBy'](_0x4f9f48,_0xba75('0x9d'));var _0x5cc43a=[];_0x423d44[_0xba75('0x6d')](function(_0x25eb36){_0x5cc43a[_0xba75('0x9e')](updateSmsInteraction(_0x25eb36,_0x5c7c7f,_0xe8ead));});return BPromise['all'](_0x5cc43a);});});})['then'](function(_0x56a988){_0x3d8453[_0xba75('0x9f')]=_0x56a988;return _0x3d8453;})[_0xba75('0x24')](respondWithFilteredResult(_0x381cb,_0x5e3c8c));})[_0xba75('0xa0')](handleError(_0x381cb,null));};exports[_0xba75('0xa1')]=function(_0x50fd44,_0x43821d){var _0x2c545c={'raw':![],'where':{'id':_0x50fd44[_0xba75('0xa2')]['id']}},_0x377aa8={};_0x377aa8[_0xba75('0x37')]=_[_0xba75('0x33')](db[_0xba75('0x2e')][_0xba75('0x2f')]);_0x377aa8[_0xba75('0x32')]=_[_0xba75('0x33')](_0x50fd44['query']);_0x377aa8[_0xba75('0x34')]=_[_0xba75('0x36')](_0x377aa8[_0xba75('0x37')],_0x377aa8['query']);_0x2c545c[_0xba75('0x35')]=_[_0xba75('0x36')](_0x377aa8[_0xba75('0x37')],qs[_0xba75('0x38')](_0x50fd44['query'][_0xba75('0x38')]));_0x2c545c[_0xba75('0x35')]=_0x2c545c['attributes'][_0xba75('0x39')]?_0x2c545c[_0xba75('0x35')]:_0x377aa8[_0xba75('0x37')];if(_0x50fd44[_0xba75('0x32')][_0xba75('0xa3')]){_0x2c545c['include']=[{'all':!![]}];}_0x2c545c=_['merge']({},_0x2c545c,_0x50fd44[_0xba75('0xa4')]);return db['SmsInteraction'][_0xba75('0x56')](_0x2c545c)[_0xba75('0x24')](handleEntityNotFound(_0x43821d,null))[_0xba75('0x24')](respondWithResult(_0x43821d,null))['catch'](handleError(_0x43821d,null));};exports[_0xba75('0xa5')]=function(_0x1cb703,_0x2c87c7){return db[_0xba75('0x2e')][_0xba75('0xa5')](_0x1cb703['body'],{})['then'](respondWithResult(_0x2c87c7,0xc9))['catch'](handleError(_0x2c87c7,null));};exports[_0xba75('0x23')]=function(_0x596eba,_0x1f39c8){if(_0x596eba['body']['id']){delete _0x596eba[_0xba75('0xa6')]['id'];}return db['SmsInteraction'][_0xba75('0x56')]({'where':{'id':_0x596eba[_0xba75('0xa2')]['id']}})[_0xba75('0x24')](handleEntityNotFound(_0x1f39c8,null))[_0xba75('0x24')](saveUpdates(_0x596eba[_0xba75('0xa6')],null))[_0xba75('0x24')](respondWithResult(_0x1f39c8,null))[_0xba75('0xa0')](handleError(_0x1f39c8,null));};exports[_0xba75('0xa7')]=function(_0x49bcd2,_0x25d9fa){return db[_0xba75('0x2e')][_0xba75('0x56')]({'where':{'id':_0x49bcd2[_0xba75('0xa2')]['id']}})[_0xba75('0x24')](handleEntityNotFound(_0x25d9fa,null))['then'](removeEntity(_0x25d9fa,null))[_0xba75('0xa0')](handleError(_0x25d9fa,null));};exports[_0xba75('0xa8')]=function(_0x321bff,_0x4f5e29){return db[_0xba75('0x2e')]['describe']()['then'](respondWithResult(_0x4f5e29,null))[_0xba75('0xa0')](handleError(_0x4f5e29,null));};exports[_0xba75('0xa9')]=function(_0x197b3d,_0x3ff88c,_0xa8cbb5){return db[_0xba75('0xaa')][_0xba75('0x56')]({'where':{'id':_0x197b3d['params']['id']}})[_0xba75('0x24')](handleEntityNotFound(_0x3ff88c,null))['then'](function(_0x2c6871){if(_0x2c6871){return _0x2c6871[_0xba75('0xa9')](_0x197b3d[_0xba75('0xa6')][_0xba75('0xab')],_[_0xba75('0xac')](_0x197b3d[_0xba75('0xa6')],['ids','id'])||{});}})[_0xba75('0x24')](respondWithResult(_0x3ff88c,null))[_0xba75('0xa0')](handleError(_0x3ff88c,null));};exports[_0xba75('0xad')]=function(_0x5a8271,_0x340bd7,_0x772fce){var _0x43e69b={'raw':![],'where':{}};var _0x2f570d={};var _0x219b24={'count':0x0,'rows':[]};return db[_0xba75('0x2e')][_0xba75('0xae')]({'where':{'id':_0x5a8271[_0xba75('0xa2')]['id']}})[_0xba75('0x24')](handleEntityNotFound(_0x340bd7,null))[_0xba75('0x24')](function(_0x33f6b9){if(_0x33f6b9){_0x2f570d[_0xba75('0x37')]=_[_0xba75('0x33')](db['SmsMessage'][_0xba75('0x2f')]);_0x2f570d[_0xba75('0x32')]=_['keys'](_0x5a8271[_0xba75('0x32')]);_0x2f570d['filters']=_[_0xba75('0x36')](_0x2f570d[_0xba75('0x37')],_0x2f570d['query']);_0x43e69b[_0xba75('0x35')]=_[_0xba75('0x36')](_0x2f570d[_0xba75('0x37')],qs[_0xba75('0x38')](_0x5a8271['query'][_0xba75('0x38')]));_0x43e69b[_0xba75('0x35')]=_0x43e69b['attributes']['length']?_0x43e69b['attributes']:_0x2f570d[_0xba75('0x37')];if(!_0x5a8271[_0xba75('0x32')]['hasOwnProperty'](_0xba75('0x3b'))){_0x43e69b[_0xba75('0x21')]=qs[_0xba75('0x21')](_0x5a8271[_0xba75('0x32')]['limit']);_0x43e69b['offset']=qs[_0xba75('0x20')](_0x5a8271['query'][_0xba75('0x20')]);}_0x43e69b[_0xba75('0x3c')]=qs[_0xba75('0x3d')](_0x5a8271['query'][_0xba75('0x3d')]);_0x43e69b['where']=qs[_0xba75('0x34')](_[_0xba75('0x3f')](_0x5a8271[_0xba75('0x32')],_0x2f570d[_0xba75('0x34')]));_0x43e69b[_0xba75('0x3e')][_0xba75('0x9d')]=_0x33f6b9['id'];if(_0x5a8271[_0xba75('0x32')][_0xba75('0x7a')]){_0x43e69b[_0xba75('0x3e')]=_[_0xba75('0x8a')](_0x43e69b[_0xba75('0x3e')],{'$or':_[_0xba75('0x28')](_0x43e69b[_0xba75('0x35')],function(_0x75707d){var _0x14996e={};_0x14996e[_0x75707d]={'$like':'%'+_0x5a8271[_0xba75('0x32')][_0xba75('0x7a')]+'%'};return _0x14996e;})});}if(_0x5a8271[_0xba75('0x32')][_0xba75('0x73')]){var _0x2b1be2=_0x5a8271['query'][_0xba75('0x73')][_0xba75('0x2c')](',');var _0x8f36af={};_0x8f36af[_0x2b1be2[0x0]]={'$gte':moment(_0x2b1be2[0x1])[_0xba75('0xaf')](_0xba75('0xb0'))};_0x43e69b[_0xba75('0x3e')]=_['merge'](_0x43e69b[_0xba75('0x3e')],_0x8f36af);}_0x43e69b=_[_0xba75('0x8a')]({},_0x43e69b,_0x5a8271[_0xba75('0xa4')]);return db[_0xba75('0xaa')][_0xba75('0x1f')]({'where':_0x43e69b['where']})['then'](function(_0xdc5e5a){_0x219b24[_0xba75('0x1f')]=_0xdc5e5a;if(_0x5a8271[_0xba75('0x32')][_0xba75('0xa3')]){_0x43e69b[_0xba75('0xb1')]=[{'all':!![]}];}return db[_0xba75('0xaa')][_0xba75('0xb2')](_0x43e69b);})[_0xba75('0x24')](function(_0x4496aa){_0x219b24[_0xba75('0x9f')]=_0x4496aa;return _0x219b24;});}})[_0xba75('0x24')](respondWithFilteredResult(_0x340bd7,_0x43e69b))[_0xba75('0xa0')](handleError(_0x340bd7,null));};exports['addTags']=function(_0x33e804,_0x1c1341,_0x52b2af){return db[_0xba75('0x2e')]['find']({'where':{'id':_0x33e804[_0xba75('0xa2')]['id']}})[_0xba75('0x24')](handleEntityNotFound(_0x1c1341,null))[_0xba75('0x24')](function(_0x2e2ff5){if(_0x2e2ff5){return _0x2e2ff5['setTags'](_0x33e804[_0xba75('0xa6')]['ids'],_[_0xba75('0xac')](_0x33e804[_0xba75('0xa6')],['ids','id'])||{})[_0xba75('0xb3')](function(){return db['Tag'][_0xba75('0xb2')]({'attributes':['id',_0xba75('0x26'),'color'],'where':{'id':_0x33e804['body'][_0xba75('0xab')]}});})[_0xba75('0x24')](function(_0x3164f9){socket[_0xba75('0xb4')](_0xba75('0xb5'),{'id':Number(_0x33e804['params']['id']),'tags':_0x3164f9||[]});return{'id':Number(_0x33e804[_0xba75('0xa2')]['id']),'tags':_0x3164f9||[]};});}})[_0xba75('0x24')](respondWithResult(_0x1c1341,null))[_0xba75('0xa0')](handleError(_0x1c1341,null));};exports[_0xba75('0xb6')]=function(_0x215c8f,_0x501bcb,_0x32c248){return db['SmsInteraction'][_0xba75('0x56')]({'where':{'id':_0x215c8f[_0xba75('0xa2')]['id']}})[_0xba75('0x24')](handleEntityNotFound(_0x501bcb,null))[_0xba75('0x24')](function(_0x5c90eb){if(_0x5c90eb){return _0x5c90eb['removeTags'](_0x215c8f['query'][_0xba75('0xab')]);}})['then'](respondWithStatusCode(_0x501bcb,null))[_0xba75('0xa0')](handleError(_0x501bcb,null));};exports[_0xba75('0xb7')]=function(_0x2d5b01,_0xfb8162){var _0x579b90=moment()[_0xba75('0xb8')]()[_0xba75('0x89')]();var _0x48c1b3=path[_0xba75('0xb9')](config[_0xba75('0xba')],_0xba75('0xbb'),_0xba75('0xbc'),'tmp');var _0x24a3ce=path['join'](config[_0xba75('0xba')],_0xba75('0xbb'),'files','attachments');var _0x598854=path['join'](_0x48c1b3,_0x579b90);var _0x3eab52=util['format'](_0xba75('0xbd'),_0x2d5b01[_0xba75('0xa2')]['id'],_0x579b90);var _0x27b101=path[_0xba75('0xb9')](_0x48c1b3,_0x3eab52);var _0x4e7d82=[];_0x4e7d82['push']({'model':db[_0xba75('0x65')],'as':'User','attributes':['id',_0xba75('0x29')],'raw':!![]});_0x4e7d82['push']({'model':db[_0xba75('0xbe')],'as':_0xba75('0x5a'),'attributes':['id',_0xba75('0xbf'),_0xba75('0xc0')],'raw':!![]});var _0x27ac75=[{'model':db[_0xba75('0xaa')],'as':_0xba75('0xc1'),'attributes':['id',_0xba75('0xa6'),_0xba75('0x71'),'direction',_0xba75('0xc2'),_0xba75('0x77')],'include':_0x4e7d82}];_0x27ac75[_0xba75('0x9e')]({'model':db[_0xba75('0xc3')],'as':'Account','attributes':['id',_0xba75('0x26')]});_0x27ac75[_0xba75('0x9e')]({'model':db[_0xba75('0x65')],'as':'Owner','attributes':['id',_0xba75('0x29')]});return db[_0xba75('0x2e')]['find']({'where':{'id':_0x2d5b01[_0xba75('0xa2')]['id']},'include':_0x27ac75})[_0xba75('0x24')](handleEntityNotFound(_0xfb8162,null))['then'](function(_0x4f4510){if(_0x4f4510){var _0x20a51a=_0x4f4510[_0xba75('0xc4')]({'plain':!![]});fs['mkdirSync'](_0x598854);var _0x21f0bb={'format':'A4','border':_0xba75('0xc5'),'header':{'height':'40px','contents':{'first':_0xba75('0xc6')}},'footer':{'height':_0xba75('0xc7'),'contents':{'default':util[_0xba75('0xaf')](_0xba75('0xc8'),util[_0xba75('0xaf')](_0xba75('0xc9'),_0xba75('0xca'),_0x20a51a['id']),moment()[_0xba75('0xaf')]('YYYY-MM-DD')[_0xba75('0x89')]())}}};var _0x200ed8={'channel':'Sms','account':_0x20a51a['Account'][_0xba75('0x26')],'agent':_0x20a51a['Owner']?_0x20a51a[_0xba75('0xcb')]['fullname']:_0xba75('0xcc'),'createdAt':moment(_0x20a51a[_0xba75('0x71')])[_0xba75('0xaf')](_0xba75('0xb0'))[_0xba75('0x89')](),'closedAt':_0x20a51a['closed']?moment(_0x20a51a[_0xba75('0xcd')])[_0xba75('0xaf')](_0xba75('0xb0'))[_0xba75('0x89')]():'','disposition':_0x20a51a[_0xba75('0xce')],'messages':_(_0x20a51a['Messages'])[_0xba75('0x7a')]({'secret':![]})[_0xba75('0x28')](function(_0x6a527b){return{'date':moment(_0x6a527b[_0xba75('0x71')])['format'](_0xba75('0xb0'))['toString'](),'sender':_0x6a527b['direction']===_0xba75('0xcf')?_0x6a527b['User']?_0x6a527b['User'][_0xba75('0x29')]:_0xba75('0xd0'):_0x6a527b[_0xba75('0x5a')]['firstName']+(_0x6a527b[_0xba75('0x5a')]['lastName']?'\x20'+_0x6a527b[_0xba75('0x5a')][_0xba75('0xc0')]:''),'body':_0x6a527b['body'],'direction':_0x6a527b['direction']===_0xba75('0xcf')?'A':'C','secret':_0x6a527b['secret'],'read':_0x6a527b[_0xba75('0x77')]};})[_0xba75('0x5c')]()};return ejs[_0xba75('0xd1')](path['join'](config[_0xba75('0xba')],'server',_0xba75('0xd2'),'downloadInteraction.html'),{'interaction':_0x200ed8})[_0xba75('0x24')](function(_0x4b00a5){return new BPromise(function(_0x4759a3,_0x120b9e){pdf[_0xba75('0xa5')](_0x4b00a5,_0x21f0bb)[_0xba75('0xd3')](path[_0xba75('0xb9')](_0x598854,_0xba75('0xd4')+_0x20a51a['id']+'-'+_0x579b90+'.pdf'),function(_0x5242b0,_0xe47577){if(_0x5242b0)return _0x120b9e(_0x5242b0);_0x4759a3(_0xe47577);});});})[_0xba75('0x24')](function(){return new BPromise(function(_0x1d3e09,_0xd6db0e){zipdir(_0x598854,{'saveTo':_0x27b101},function(_0x20afe4,_0x487ccc){if(_0x20afe4)return _0xd6db0e(_0x20afe4);return _0x1d3e09(_0x487ccc);});})[_0xba75('0x24')](function(){return new BPromise(function(_0x1fdd46,_0x373cca){rimraf(_0x598854,function(_0x2778c0){if(_0x2778c0)_0x373cca(_0x2778c0);return _0x1fdd46();});});})['then'](function(){return _0xfb8162['download'](_0x27b101,_0x3eab52,function(_0x3da04a){if(_0x3da04a){console[_0xba75('0xd5')](_0xba75('0xd6'),_0x3da04a);}else{fs[_0xba75('0xd7')](_0x27b101);}});});});}else{return _0xfb8162[_0xba75('0x25')](0xc8);}})[_0xba75('0xa0')](handleError(_0xfb8162,null));};
\ No newline at end of file
diff --git a/server/api/smsInteraction/smsInteraction.events.js b/server/api/smsInteraction/smsInteraction.events.js
index ca96093..4ea7e88 100644
--- a/server/api/smsInteraction/smsInteraction.events.js
+++ b/server/api/smsInteraction/smsInteraction.events.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x6aa7=['../../mysqldb','SmsMessage','setMaxListeners','update','remove','then','setDataValue','map','findAll','unreadMessages','length','emit','catch','hasOwnProperty','hook','exports','events','SmsInteraction'];(function(_0x15bc81,_0x4d4f77){var _0x59440e=function(_0x1b60f2){while(--_0x1b60f2){_0x15bc81['push'](_0x15bc81['shift']());}};_0x59440e(++_0x4d4f77);}(_0x6aa7,0x178));var _0x76aa=function(_0x28001b,_0x5854cf){_0x28001b=_0x28001b-0x0;var _0x238a36=_0x6aa7[_0x28001b];return _0x238a36;};'use strict';var EventEmitter=require(_0x76aa('0x0'));var SmsInteraction=require('../../mysqldb')['db'][_0x76aa('0x1')];var SmsMessage=require(_0x76aa('0x2'))['db'][_0x76aa('0x3')];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents[_0x76aa('0x4')](0x0);var events={'afterCreate':'save','afterUpdate':_0x76aa('0x5'),'afterDestroy':_0x76aa('0x6')};function emitEvent(_0x1d6e04){return function(_0x511588,_0x588e62,_0x1aceaa){_0x511588['getUsers']({'attributes':['id'],'raw':!![]})[_0x76aa('0x7')](function(_0x36d12b){_0x511588[_0x76aa('0x8')]('Users',_0x36d12b[_0x76aa('0x9')](function(_0x266bd5){return{'id':_0x266bd5['id']};}));return SmsMessage[_0x76aa('0xa')]({'where':{'SmsInteractionId':_0x511588['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0xcd99aa){_0x511588[_0x76aa('0x8')](_0x76aa('0xb'),_0xcd99aa[_0x76aa('0xc')]);SmsInteractionEvents[_0x76aa('0xd')](_0x1d6e04+':'+_0x511588['id'],_0x511588);SmsInteractionEvents[_0x76aa('0xd')](_0x1d6e04,_0x511588);_0x1aceaa(null);})[_0x76aa('0xe')](_0x1aceaa(null));};}for(var e in events){if(events[_0x76aa('0xf')](e)){var event=events[e];SmsInteraction[_0x76aa('0x10')](e,emitEvent(event));}}module[_0x76aa('0x11')]=SmsInteractionEvents;
\ No newline at end of file
+var _0x3c17=['Users','findAll','then','unreadMessages','length','emit','hasOwnProperty','hook','exports','events','SmsInteraction','SmsMessage','setMaxListeners','save','remove','getUsers','setDataValue'];(function(_0x474e07,_0x223d57){var _0x53f32b=function(_0xbcf040){while(--_0xbcf040){_0x474e07['push'](_0x474e07['shift']());}};_0x53f32b(++_0x223d57);}(_0x3c17,0x1a1));var _0x73c1=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x3c17[_0x3bf83f];return _0x22c4a9;};'use strict';var EventEmitter=require(_0x73c1('0x0'));var SmsInteraction=require('../../mysqldb')['db'][_0x73c1('0x1')];var SmsMessage=require('../../mysqldb')['db'][_0x73c1('0x2')];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents[_0x73c1('0x3')](0x0);var events={'afterCreate':_0x73c1('0x4'),'afterUpdate':'update','afterDestroy':_0x73c1('0x5')};function emitEvent(_0xcbe17a){return function(_0x6b289e,_0x64f862,_0x48c943){_0x6b289e[_0x73c1('0x6')]({'attributes':['id'],'raw':!![]})['then'](function(_0x4433e0){_0x6b289e[_0x73c1('0x7')](_0x73c1('0x8'),_0x4433e0['map'](function(_0x4921f0){return{'id':_0x4921f0['id']};}));return SmsMessage[_0x73c1('0x9')]({'where':{'SmsInteractionId':_0x6b289e['id'],'direction':'in','read':![]},'raw':!![]});})[_0x73c1('0xa')](function(_0x400875){_0x6b289e[_0x73c1('0x7')](_0x73c1('0xb'),_0x400875[_0x73c1('0xc')]);SmsInteractionEvents[_0x73c1('0xd')](_0xcbe17a+':'+_0x6b289e['id'],_0x6b289e);SmsInteractionEvents['emit'](_0xcbe17a,_0x6b289e);_0x48c943(null);})['catch'](_0x48c943(null));};}for(var e in events){if(events[_0x73c1('0xe')](e)){var event=events[e];SmsInteraction[_0x73c1('0xf')](e,emitEvent(event));}}module[_0x73c1('0x10')]=SmsInteractionEvents;
\ No newline at end of file
diff --git a/server/api/smsInteraction/smsInteraction.model.js b/server/api/smsInteraction/smsInteraction.model.js
index 589859c..bb73a01 100644
--- a/server/api/smsInteraction/smsInteraction.model.js
+++ b/server/api/smsInteraction/smsInteraction.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x94c4=['lodash','util','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment','./smsInteraction.attributes','define','SmsInteraction','sms_interactions','changed','closed','closedAt','format'];(function(_0x1d63c2,_0x3d133e){var _0x23c756=function(_0x1947c0){while(--_0x1947c0){_0x1d63c2['push'](_0x1d63c2['shift']());}};_0x23c756(++_0x3d133e);}(_0x94c4,0xd0));var _0x494c=function(_0x514d16,_0x52271e){_0x514d16=_0x514d16-0x0;var _0x2cabce=_0x94c4[_0x514d16];return _0x2cabce;};'use strict';var _=require(_0x494c('0x0'));var util=require(_0x494c('0x1'));var logger=require(_0x494c('0x2'))(_0x494c('0x3'));var moment=require('moment');var BPromise=require(_0x494c('0x4'));var rp=require(_0x494c('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x494c('0x6'));var config=require(_0x494c('0x7'));var attributes=require(_0x494c('0x8'));module['exports']=function(_0x3beaa0,_0x4d625a){return _0x3beaa0[_0x494c('0x9')](_0x494c('0xa'),attributes,{'tableName':_0x494c('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x170fa0,_0x1682dd,_0x5bef74){if(_0x170fa0[_0x494c('0xc')](_0x494c('0xd'))){_0x170fa0[_0x494c('0xe')]=moment()[_0x494c('0xf')]('YYYY-MM-DD\x20HH:mm:ss');}_0x5bef74(null,_0x170fa0);}}});};
\ No newline at end of file
+var _0x98dc=['SmsInteraction','changed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','../../config/logger','api','moment','request-promise','path','../../config/environment','./smsInteraction.attributes'];(function(_0x5b21c9,_0x4352ef){var _0x241785=function(_0x407bc2){while(--_0x407bc2){_0x5b21c9['push'](_0x5b21c9['shift']());}};_0x241785(++_0x4352ef);}(_0x98dc,0x19d));var _0xc98d=function(_0x68c802,_0x347f07){_0x68c802=_0x68c802-0x0;var _0x18422a=_0x98dc[_0x68c802];return _0x18422a;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xc98d('0x0'))(_0xc98d('0x1'));var moment=require(_0xc98d('0x2'));var BPromise=require('bluebird');var rp=require(_0xc98d('0x3'));var fs=require('fs');var path=require(_0xc98d('0x4'));var rimraf=require('rimraf');var config=require(_0xc98d('0x5'));var attributes=require(_0xc98d('0x6'));module['exports']=function(_0x2f2bc5,_0x540fac){return _0x2f2bc5['define'](_0xc98d('0x7'),attributes,{'tableName':'sms_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x1902f2,_0x3275de,_0x43a222){if(_0x1902f2[_0xc98d('0x8')]('closed')){_0x1902f2[_0xc98d('0x9')]=moment()[_0xc98d('0xa')](_0xc98d('0xb'));}_0x43a222(null,_0x1902f2);}}});};
\ No newline at end of file
diff --git a/server/api/smsInteraction/smsInteraction.rpc.js b/server/api/smsInteraction/smsInteraction.rpc.js
index 0b74e93..082c918 100644
--- a/server/api/smsInteraction/smsInteraction.rpc.js
+++ b/server/api/smsInteraction/smsInteraction.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x4314=['redis','defaults','localhost','socket.io-emitter','register','request','then','SmsInteraction,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','UpdateSmsInteraction','SmsInteraction','body','options','raw','where','attributes','debug','find','addTags','ids','spread','AddTags','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x3f271a,_0x4c4ab6){var _0x23b61a=function(_0x1cd453){while(--_0x1cd453){_0x3f271a['push'](_0x3f271a['shift']());}};_0x23b61a(++_0x4c4ab6);}(_0x4314,0xe5));var _0x4431=function(_0x6135f4,_0x5d799d){_0x6135f4=_0x6135f4-0x0;var _0x3b57ba=_0x4314[_0x6135f4];return _0x3b57ba;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x4431('0x0'));var BPromise=require(_0x4431('0x1'));var rs=require(_0x4431('0x2'));var fs=require('fs');var Redis=require(_0x4431('0x3'));var db=require(_0x4431('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x4431('0x5'))(_0x4431('0x6'));var config=require(_0x4431('0x7'));var jayson=require(_0x4431('0x8'));var client=jayson[_0x4431('0x9')][_0x4431('0xa')]({'port':0x232a});config[_0x4431('0xb')]=_[_0x4431('0xc')](config[_0x4431('0xb')],{'host':_0x4431('0xd'),'port':0x18eb});var socket=require(_0x4431('0xe'))(new Redis(config[_0x4431('0xb')]));require('./smsInteraction.socket')[_0x4431('0xf')](socket);function respondWithRpcPromise(_0x38bd7f,_0x2b4c1e,_0x4308fe){return new BPromise(function(_0x413b0c,_0x2f9d61){return client[_0x4431('0x10')](_0x38bd7f,_0x4308fe)[_0x4431('0x11')](function(_0x37a771){logger['info'](_0x4431('0x12'),_0x2b4c1e,_0x4431('0x13'));logger['debug']('SmsInteraction,\x20%s,\x20%s,\x20%s',_0x2b4c1e,_0x4431('0x13'),JSON[_0x4431('0x14')](_0x37a771));if(_0x37a771[_0x4431('0x15')]){if(_0x37a771[_0x4431('0x15')][_0x4431('0x16')]===0x1f4){logger[_0x4431('0x15')](_0x4431('0x12'),_0x2b4c1e,_0x37a771['error']['message']);return _0x2f9d61(_0x37a771[_0x4431('0x15')]['message']);}logger[_0x4431('0x15')](_0x4431('0x12'),_0x2b4c1e,_0x37a771[_0x4431('0x15')][_0x4431('0x17')]);return _0x413b0c(_0x37a771[_0x4431('0x15')][_0x4431('0x17')]);}else{logger[_0x4431('0x18')](_0x4431('0x12'),_0x2b4c1e,'request\x20sent');_0x413b0c(_0x37a771[_0x4431('0x19')][_0x4431('0x17')]);}})[_0x4431('0x1a')](function(_0x25bd2c){logger[_0x4431('0x15')]('SmsInteraction,\x20%s,\x20%s',_0x2b4c1e,_0x25bd2c);_0x2f9d61(_0x25bd2c);});});}exports[_0x4431('0x1b')]=function(_0x5f2d63){var _0x3eba80=this;return new Promise(function(_0x30c9fc,_0x131c2b){return db[_0x4431('0x1c')]['update'](_0x5f2d63[_0x4431('0x1d')],{'raw':_0x5f2d63[_0x4431('0x1e')]?_0x5f2d63[_0x4431('0x1e')][_0x4431('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5f2d63[_0x4431('0x1e')]?_0x5f2d63[_0x4431('0x1e')][_0x4431('0x20')]||null:null,'attributes':_0x5f2d63['options']?_0x5f2d63[_0x4431('0x1e')][_0x4431('0x21')]||null:null,'limit':_0x5f2d63[_0x4431('0x1e')]?_0x5f2d63['options']['limit']||null:null})[_0x4431('0x11')](function(_0x51f025){logger['info'](_0x4431('0x1b'),_0x5f2d63);logger[_0x4431('0x22')]('UpdateSmsInteraction',_0x5f2d63,JSON[_0x4431('0x14')](_0x51f025));_0x30c9fc(_0x51f025);})[_0x4431('0x1a')](function(_0x3abd77){logger['error'](_0x4431('0x1b'),_0x3abd77[_0x4431('0x17')],_0x5f2d63);_0x131c2b(_0x3eba80[_0x4431('0x15')](0x1f4,_0x3abd77[_0x4431('0x17')]));});});};exports['AddTagsToSmsInteraction']=function(_0x3aff5b){return new Promise(function(_0x314dd0,_0x5a95f0){return db['SmsInteraction'][_0x4431('0x23')]({'where':_0x3aff5b['options']?_0x3aff5b[_0x4431('0x1e')][_0x4431('0x20')]||null:null})[_0x4431('0x11')](function(_0x42c5f1){if(_0x42c5f1){return _0x42c5f1[_0x4431('0x24')](_0x3aff5b['body'][_0x4431('0x25')],_['omit'](_0x3aff5b[_0x4431('0x1d')],['ids','id'])||{});}})[_0x4431('0x26')](function(_0x1e2311){logger[_0x4431('0x18')](_0x4431('0x27'),_0x3aff5b);logger['debug']('AddTags',_0x3aff5b,JSON[_0x4431('0x14')](_0x1e2311));_0x314dd0(_0x1e2311);})[_0x4431('0x1a')](function(_0x49aa23){logger[_0x4431('0x15')]('AddTags',_0x49aa23[_0x4431('0x17')],_0x3aff5b);_0x5a95f0(_this['error'](0x1f4,_0x49aa23[_0x4431('0x17')]));});});};
\ No newline at end of file
+var _0x0581=['redis','defaults','localhost','socket.io-emitter','./smsInteraction.socket','register','then','request\x20sent','SmsInteraction,\x20%s,\x20%s,\x20%s','stringify','SmsInteraction,\x20%s,\x20%s','message','error','info','catch','UpdateSmsInteraction','SmsInteraction','update','body','options','raw','where','attributes','limit','debug','AddTagsToSmsInteraction','find','ids','omit','spread','AddTags','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0xb42cde,_0x2888c7){var _0xf0ca4f=function(_0x211d7){while(--_0x211d7){_0xb42cde['push'](_0xb42cde['shift']());}};_0xf0ca4f(++_0x2888c7);}(_0x0581,0x1a2));var _0x1058=function(_0x294726,_0x5db9e9){_0x294726=_0x294726-0x0;var _0x39e2e3=_0x0581[_0x294726];return _0x39e2e3;};'use strict';var _=require(_0x1058('0x0'));var util=require(_0x1058('0x1'));var moment=require(_0x1058('0x2'));var BPromise=require(_0x1058('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1058('0x4'))['db'];var utils=require(_0x1058('0x5'));var logger=require(_0x1058('0x6'))(_0x1058('0x7'));var config=require(_0x1058('0x8'));var jayson=require(_0x1058('0x9'));var client=jayson[_0x1058('0xa')][_0x1058('0xb')]({'port':0x232a});config[_0x1058('0xc')]=_[_0x1058('0xd')](config[_0x1058('0xc')],{'host':_0x1058('0xe'),'port':0x18eb});var socket=require(_0x1058('0xf'))(new Redis(config[_0x1058('0xc')]));require(_0x1058('0x10'))[_0x1058('0x11')](socket);function respondWithRpcPromise(_0x5e7ce2,_0x3dd57c,_0x22aeb6){return new BPromise(function(_0x41a607,_0x15b9d2){return client['request'](_0x5e7ce2,_0x22aeb6)[_0x1058('0x12')](function(_0x7535d5){logger['info']('SmsInteraction,\x20%s,\x20%s',_0x3dd57c,_0x1058('0x13'));logger['debug'](_0x1058('0x14'),_0x3dd57c,_0x1058('0x13'),JSON[_0x1058('0x15')](_0x7535d5));if(_0x7535d5['error']){if(_0x7535d5['error']['code']===0x1f4){logger['error'](_0x1058('0x16'),_0x3dd57c,_0x7535d5['error'][_0x1058('0x17')]);return _0x15b9d2(_0x7535d5[_0x1058('0x18')][_0x1058('0x17')]);}logger[_0x1058('0x18')](_0x1058('0x16'),_0x3dd57c,_0x7535d5[_0x1058('0x18')][_0x1058('0x17')]);return _0x41a607(_0x7535d5[_0x1058('0x18')][_0x1058('0x17')]);}else{logger[_0x1058('0x19')](_0x1058('0x16'),_0x3dd57c,_0x1058('0x13'));_0x41a607(_0x7535d5['result'][_0x1058('0x17')]);}})[_0x1058('0x1a')](function(_0x59e204){logger['error'](_0x1058('0x16'),_0x3dd57c,_0x59e204);_0x15b9d2(_0x59e204);});});}exports[_0x1058('0x1b')]=function(_0x458801){var _0x2a480d=this;return new Promise(function(_0x5eb104,_0x1c9bb3){return db[_0x1058('0x1c')][_0x1058('0x1d')](_0x458801[_0x1058('0x1e')],{'raw':_0x458801[_0x1058('0x1f')]?_0x458801[_0x1058('0x1f')][_0x1058('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x458801[_0x1058('0x1f')]?_0x458801['options'][_0x1058('0x21')]||null:null,'attributes':_0x458801[_0x1058('0x1f')]?_0x458801['options'][_0x1058('0x22')]||null:null,'limit':_0x458801[_0x1058('0x1f')]?_0x458801[_0x1058('0x1f')][_0x1058('0x23')]||null:null})[_0x1058('0x12')](function(_0x3109cb){logger[_0x1058('0x19')](_0x1058('0x1b'),_0x458801);logger[_0x1058('0x24')](_0x1058('0x1b'),_0x458801,JSON[_0x1058('0x15')](_0x3109cb));_0x5eb104(_0x3109cb);})[_0x1058('0x1a')](function(_0x59c33c){logger[_0x1058('0x18')](_0x1058('0x1b'),_0x59c33c[_0x1058('0x17')],_0x458801);_0x1c9bb3(_0x2a480d[_0x1058('0x18')](0x1f4,_0x59c33c[_0x1058('0x17')]));});});};exports[_0x1058('0x25')]=function(_0x22b4bf){return new Promise(function(_0x796b4c,_0x35b950){return db[_0x1058('0x1c')][_0x1058('0x26')]({'where':_0x22b4bf[_0x1058('0x1f')]?_0x22b4bf[_0x1058('0x1f')]['where']||null:null})[_0x1058('0x12')](function(_0x40fd63){if(_0x40fd63){return _0x40fd63['addTags'](_0x22b4bf['body'][_0x1058('0x27')],_[_0x1058('0x28')](_0x22b4bf[_0x1058('0x1e')],['ids','id'])||{});}})[_0x1058('0x29')](function(_0x5a0760){logger[_0x1058('0x19')](_0x1058('0x2a'),_0x22b4bf);logger[_0x1058('0x24')](_0x1058('0x2a'),_0x22b4bf,JSON[_0x1058('0x15')](_0x5a0760));_0x796b4c(_0x5a0760);})[_0x1058('0x1a')](function(_0x227c59){logger[_0x1058('0x18')]('AddTags',_0x227c59['message'],_0x22b4bf);_0x35b950(_this['error'](0x1f4,_0x227c59[_0x1058('0x17')]));});});};
\ No newline at end of file
diff --git a/server/api/smsInteraction/smsInteraction.socket.js b/server/api/smsInteraction/smsInteraction.socket.js
index e19bc14..6249a41 100644
--- a/server/api/smsInteraction/smsInteraction.socket.js
+++ b/server/api/smsInteraction/smsInteraction.socket.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x2032=['save','remove','update','removeListener','register','length','smsInteraction:'];(function(_0x401ccd,_0x140815){var _0x5a57ad=function(_0x8ad698){while(--_0x8ad698){_0x401ccd['push'](_0x401ccd['shift']());}};_0x5a57ad(++_0x140815);}(_0x2032,0xd9));var _0x2203=function(_0x4950b4,_0x55289e){_0x4950b4=_0x4950b4-0x0;var _0x463f35=_0x2032[_0x4950b4];return _0x463f35;};'use strict';var SmsInteractionEvents=require('./smsInteraction.events');var events=[_0x2203('0x0'),_0x2203('0x1'),_0x2203('0x2')];function createListener(_0x4c28da,_0x486390){return function(_0x228a29){_0x486390['emit'](_0x4c28da,_0x228a29);};}function removeListener(_0x46c49a,_0x880dcd){return function(){SmsInteractionEvents[_0x2203('0x3')](_0x46c49a,_0x880dcd);};}exports[_0x2203('0x4')]=function(_0x3f7ba1){for(var _0x13367a=0x0,_0x2e0f63=events[_0x2203('0x5')];_0x13367a<_0x2e0f63;_0x13367a++){var _0x18c4d6=events[_0x13367a];var _0x2049ff=createListener(_0x2203('0x6')+_0x18c4d6,_0x3f7ba1);SmsInteractionEvents['on'](_0x18c4d6,_0x2049ff);}};
\ No newline at end of file
+var _0x5f66=['length','smsInteraction:','save','update','emit','register'];(function(_0x3a6ad5,_0x3b84d8){var _0xc08e2a=function(_0x425836){while(--_0x425836){_0x3a6ad5['push'](_0x3a6ad5['shift']());}};_0xc08e2a(++_0x3b84d8);}(_0x5f66,0x1a0));var _0x65f6=function(_0x278e3c,_0x1c9cfd){_0x278e3c=_0x278e3c-0x0;var _0x3e2d9b=_0x5f66[_0x278e3c];return _0x3e2d9b;};'use strict';var SmsInteractionEvents=require('./smsInteraction.events');var events=[_0x65f6('0x0'),'remove',_0x65f6('0x1')];function createListener(_0x2f06ae,_0x3461cd){return function(_0xbce843){_0x3461cd[_0x65f6('0x2')](_0x2f06ae,_0xbce843);};}function removeListener(_0x5eb9ad,_0x3c5029){return function(){SmsInteractionEvents['removeListener'](_0x5eb9ad,_0x3c5029);};}exports[_0x65f6('0x3')]=function(_0x22b017){for(var _0x4ec221=0x0,_0x4ed98f=events[_0x65f6('0x4')];_0x4ec221<_0x4ed98f;_0x4ec221++){var _0x2c6571=events[_0x4ec221];var _0x112079=createListener(_0x65f6('0x5')+_0x2c6571,_0x22b017);SmsInteractionEvents['on'](_0x2c6571,_0x112079);}};
\ No newline at end of file
diff --git a/server/api/smsMessage/index.js b/server/api/smsMessage/index.js
index 3095eb5..26e577e 100644
--- a/server/api/smsMessage/index.js
+++ b/server/api/smsMessage/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x4ed8=['isAuthenticated','index','describe','/:id','show','tracked','smsmessage:create','create','post','/:id/status','status','put','/:id/accept','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get'];(function(_0x1035c1,_0x2d8583){var _0x308d67=function(_0x58ddb6){while(--_0x58ddb6){_0x1035c1['push'](_0x1035c1['shift']());}};_0x308d67(++_0x2d8583);}(_0x4ed8,0x186));var _0x84ed=function(_0x20ac7f,_0x2d35c6){_0x20ac7f=_0x20ac7f-0x0;var _0x1829c4=_0x4ed8[_0x20ac7f];return _0x1829c4;};'use strict';var multer=require(_0x84ed('0x0'));var util=require(_0x84ed('0x1'));var path=require(_0x84ed('0x2'));var timeout=require(_0x84ed('0x3'));var express=require(_0x84ed('0x4'));var router=express[_0x84ed('0x5')]();var auth=require(_0x84ed('0x6'));var interaction=require(_0x84ed('0x7'));var config=require(_0x84ed('0x8'));var controller=require('./smsMessage.controller');router[_0x84ed('0x9')]('/',auth[_0x84ed('0xa')](),controller[_0x84ed('0xb')]);router['get']('/describe',auth['isAuthenticated'](),controller[_0x84ed('0xc')]);router[_0x84ed('0x9')](_0x84ed('0xd'),auth['isAuthenticated'](),controller[_0x84ed('0xe')]);router['post']('/',auth['isAuthenticated'](),interaction[_0x84ed('0xf')]('sms',_0x84ed('0x10')),controller[_0x84ed('0x11')]);router[_0x84ed('0x12')](_0x84ed('0x13'),controller[_0x84ed('0x14')]);router[_0x84ed('0x15')](_0x84ed('0xd'),auth[_0x84ed('0xa')](),controller['update']);router['put'](_0x84ed('0x16'),auth['isAuthenticated'](),controller['accept']);router[_0x84ed('0x15')]('/:id/reject',auth[_0x84ed('0xa')](),controller['reject']);router['delete'](_0x84ed('0xd'),auth['isAuthenticated'](),controller[_0x84ed('0x17')]);module[_0x84ed('0x18')]=router;
\ No newline at end of file
+var _0x8e0f=['../../components/auth/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','smsmessage:create','create','post','/:id/status','status','put','update','/:id/accept','accept','/:id/reject','reject','delete','exports','util','connect-timeout','express','Router'];(function(_0xd803c0,_0x1b569d){var _0x519057=function(_0x67093e){while(--_0x67093e){_0xd803c0['push'](_0xd803c0['shift']());}};_0x519057(++_0x1b569d);}(_0x8e0f,0x98));var _0xf8e0=function(_0x191cdc,_0x6973f6){_0x191cdc=_0x191cdc-0x0;var _0x4422fa=_0x8e0f[_0x191cdc];return _0x4422fa;};'use strict';var multer=require('multer');var util=require(_0xf8e0('0x0'));var path=require('path');var timeout=require(_0xf8e0('0x1'));var express=require(_0xf8e0('0x2'));var router=express[_0xf8e0('0x3')]();var auth=require(_0xf8e0('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xf8e0('0x5'));var controller=require('./smsMessage.controller');router[_0xf8e0('0x6')]('/',auth[_0xf8e0('0x7')](),controller[_0xf8e0('0x8')]);router[_0xf8e0('0x6')](_0xf8e0('0x9'),auth[_0xf8e0('0x7')](),controller[_0xf8e0('0xa')]);router[_0xf8e0('0x6')](_0xf8e0('0xb'),auth[_0xf8e0('0x7')](),controller[_0xf8e0('0xc')]);router['post']('/',auth[_0xf8e0('0x7')](),interaction['tracked']('sms',_0xf8e0('0xd')),controller[_0xf8e0('0xe')]);router[_0xf8e0('0xf')](_0xf8e0('0x10'),controller[_0xf8e0('0x11')]);router[_0xf8e0('0x12')](_0xf8e0('0xb'),auth[_0xf8e0('0x7')](),controller[_0xf8e0('0x13')]);router[_0xf8e0('0x12')](_0xf8e0('0x14'),auth[_0xf8e0('0x7')](),controller[_0xf8e0('0x15')]);router[_0xf8e0('0x12')](_0xf8e0('0x16'),auth['isAuthenticated'](),controller[_0xf8e0('0x17')]);router[_0xf8e0('0x18')](_0xf8e0('0xb'),auth[_0xf8e0('0x7')](),controller['destroy']);module[_0xf8e0('0x19')]=router;
\ No newline at end of file
diff --git a/server/api/smsMessage/smsMessage.attributes.js b/server/api/smsMessage/smsMessage.attributes.js
index ce7bc53..d5b3bbb 100644
--- a/server/api/smsMessage/smsMessage.attributes.js
+++ b/server/api/smsMessage/smsMessage.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x06d8=['DATE','BOOLEAN','sequelize','medium','ENUM','out','STRING'];(function(_0x14ef7f,_0x34af9d){var _0x5f3e9d=function(_0x3da1f3){while(--_0x3da1f3){_0x14ef7f['push'](_0x14ef7f['shift']());}};_0x5f3e9d(++_0x34af9d);}(_0x06d8,0xd4));var _0x806d=function(_0x3ecfba,_0x58ec2f){_0x3ecfba=_0x3ecfba-0x0;var _0x272815=_0x06d8[_0x3ecfba];return _0x272815;};'use strict';var Sequelize=require(_0x806d('0x0'));module['exports']={'body':{'type':Sequelize['TEXT'](_0x806d('0x1')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0x806d('0x2')]('in',_0x806d('0x3')),'defaultValue':_0x806d('0x3'),'allowNull':![]},'messageId':{'type':Sequelize[_0x806d('0x4')](0xbe)},'phone':{'type':Sequelize[_0x806d('0x4')]},'readAt':{'type':Sequelize[_0x806d('0x5')]},'secret':{'type':Sequelize[_0x806d('0x6')],'defaultValue':![]}};
\ No newline at end of file
+var _0x2b2d=['BOOLEAN','ENUM','out','STRING','DATE','sequelize','exports','TEXT'];(function(_0x56c936,_0x4042a9){var _0x45c055=function(_0x958cc5){while(--_0x958cc5){_0x56c936['push'](_0x56c936['shift']());}};_0x45c055(++_0x4042a9);}(_0x2b2d,0x1ad));var _0xd2b2=function(_0x58f555,_0x552ef2){_0x58f555=_0x58f555-0x0;var _0x4eb99b=_0x2b2d[_0x58f555];return _0x4eb99b;};'use strict';var Sequelize=require(_0xd2b2('0x0'));module[_0xd2b2('0x1')]={'body':{'type':Sequelize[_0xd2b2('0x2')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0xd2b2('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0xd2b2('0x4')]('in',_0xd2b2('0x5')),'defaultValue':_0xd2b2('0x5'),'allowNull':![]},'messageId':{'type':Sequelize[_0xd2b2('0x6')](0xbe)},'phone':{'type':Sequelize[_0xd2b2('0x6')]},'readAt':{'type':Sequelize[_0xd2b2('0x7')]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}};
\ No newline at end of file
diff --git a/server/api/smsMessage/smsMessage.controller.js b/server/api/smsMessage/smsMessage.controller.js
index 7aff629..96468c1 100644
--- a/server/api/smsMessage/smsMessage.controller.js
+++ b/server/api/smsMessage/smsMessage.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x4e61=['infobip','results','DELIVERED','html-pdf','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','redis','localhost','socket.io-emitter','register','jayson/promise','client','http','test','ValidationError','then','info','SmsMessage,\x20%s,\x20%s','request\x20sent','debug','SmsMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','sendStatus','status','end','count','offset','limit','set','Content-Range','apply','reject','save','update','destroy','stack','name','send','index','map','SmsMessage','rawAttributes','type','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','rows','catch','show','params','include','create','body','find','describe','sms-interactions','accept','sms','read','readAt','format','UserId','CmContact','Contact','get','SmsInteraction','isNil','YYYY-MM-DD\x20HH:mm:ss','interaction','[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','null','interface','channel','event','EventManager','agent','SmsInteractionId','[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','SIP/%s','rejectmessage','SmsAccount','SmsAccountId','received\x20delivery\x20report\x20from','inspect','twilio','MessageSid','messageId','SmsAccount,\x20%s,\x20%s,\x20%s','plivo','MessageUUID','delivered','Status','plivio'];(function(_0xe1269d,_0x57b7c3){var _0x261ca1=function(_0x13b234){while(--_0x13b234){_0xe1269d['push'](_0xe1269d['shift']());}};_0x261ca1(++_0x57b7c3);}(_0x4e61,0x8c));var _0x14e6=function(_0xaa6a4,_0x64b067){_0xaa6a4=_0xaa6a4-0x0;var _0xdc31a4=_0x4e61[_0xaa6a4];return _0xdc31a4;};'use strict';var pdf=require(_0x14e6('0x0'));var emlformat=require(_0x14e6('0x1'));var rimraf=require(_0x14e6('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x14e6('0x3'));var moment=require(_0x14e6('0x4'));var BPromise=require(_0x14e6('0x5'));var Mustache=require(_0x14e6('0x6'));var util=require(_0x14e6('0x7'));var path=require(_0x14e6('0x8'));var sox=require(_0x14e6('0x9'));var csv=require(_0x14e6('0xa'));var ejs=require(_0x14e6('0xb'));var fs=require('fs');var _=require(_0x14e6('0xc'));var squel=require(_0x14e6('0xd'));var crypto=require(_0x14e6('0xe'));var jsforce=require(_0x14e6('0xf'));var deskjs=require(_0x14e6('0x10'));var toCsv=require(_0x14e6('0xa'));var querystring=require(_0x14e6('0x11'));var Papa=require(_0x14e6('0x12'));var Redis=require(_0x14e6('0x13'));var authService=require('../../components/auth/service');var qs=require(_0x14e6('0x14'));var as=require(_0x14e6('0x15'));var hardwareService=require(_0x14e6('0x16'));var logger=require(_0x14e6('0x17'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config[_0x14e6('0x18')]=_['defaults'](config['redis'],{'host':_0x14e6('0x19'),'port':0x18eb});var socket=require(_0x14e6('0x1a'))(new Redis(config[_0x14e6('0x18')]));require('./smsMessage.socket')[_0x14e6('0x1b')](socket);var jayson=require(_0x14e6('0x1c'));var client=jayson[_0x14e6('0x1d')][_0x14e6('0x1e')]({'port':0x232c});var client9002=jayson[_0x14e6('0x1d')]['http']({'port':0x232a});function checkPasswordPattern(_0x36738d,_0x353910,_0x753064){if(_0x753064){var _0x3e46c0=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x3e46c0[_0x14e6('0x1f')](_0x353910)){return _0x36738d;}else{throw new db['Sequelize'][(_0x14e6('0x20'))]('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x36738d;}}function respondWithRpcPromise(_0x588ffc,_0x4f40b0,_0x12fc87,_0x16b937){return new BPromise(function(_0xbcf29e,_0x3423b3){var _0x5642d4=_0x16b937||client;return _0x5642d4['request'](_0x588ffc,_0x12fc87)[_0x14e6('0x21')](function(_0xaa4597){logger[_0x14e6('0x22')](_0x14e6('0x23'),_0x4f40b0,_0x14e6('0x24'));logger[_0x14e6('0x25')](_0x14e6('0x26'),_0x4f40b0,_0x14e6('0x24'),JSON[_0x14e6('0x27')](_0xaa4597));if(_0xaa4597[_0x14e6('0x28')]){if(_0xaa4597[_0x14e6('0x28')][_0x14e6('0x29')]===0x1f4){logger[_0x14e6('0x28')](_0x14e6('0x23'),_0x4f40b0,_0xaa4597[_0x14e6('0x28')][_0x14e6('0x2a')]);return _0x3423b3(_0xaa4597[_0x14e6('0x28')][_0x14e6('0x2a')]);}logger[_0x14e6('0x28')](_0x14e6('0x23'),_0x4f40b0,_0xaa4597[_0x14e6('0x28')]['message']);return _0xbcf29e(_0xaa4597[_0x14e6('0x28')][_0x14e6('0x2a')]);}else{logger[_0x14e6('0x22')](_0x14e6('0x23'),_0x4f40b0,_0x14e6('0x24'));_0xbcf29e(_0xaa4597[_0x14e6('0x2b')][_0x14e6('0x2a')]);}})['catch'](function(_0x3d9e66){logger['error']('SmsMessage,\x20%s,\x20%s',_0x4f40b0,_0x3d9e66);_0x3423b3(_0x3d9e66);});});}function respondWithStatusCode(_0x57a504,_0x3b5b43){_0x3b5b43=_0x3b5b43||0xcc;return function(_0x52e725){if(_0x52e725){return _0x57a504[_0x14e6('0x2c')](_0x3b5b43);}return _0x57a504[_0x14e6('0x2d')](_0x3b5b43)[_0x14e6('0x2e')]();};}function respondWithResult(_0x5c6a39,_0x3395b1){_0x3395b1=_0x3395b1||0xc8;return function(_0x298a5a){if(_0x298a5a){return _0x5c6a39[_0x14e6('0x2d')](_0x3395b1)['json'](_0x298a5a);}};}function respondWithFilteredResult(_0x1e21a3,_0x1e718a){return function(_0x305105){if(_0x305105){var _0x46863c=_0x305105[_0x14e6('0x2f')],_0x59ae27=_0x1e718a[_0x14e6('0x30')],_0x1290b4=_0x1e718a['offset']+_0x1e718a[_0x14e6('0x31')],_0x4e1ba8;if(_0x1290b4>=_0x46863c){_0x1290b4=_0x46863c;_0x4e1ba8=0xc8;}else{_0x4e1ba8=0xce;}_0x1e21a3[_0x14e6('0x2d')](_0x4e1ba8);return _0x1e21a3[_0x14e6('0x32')](_0x14e6('0x33'),_0x59ae27+'-'+_0x1290b4+'/'+_0x46863c)['json'](_0x305105);}return null;};}function patchUpdates(_0x14b18a){return function(_0x10e715){try{jsonpatch[_0x14e6('0x34')](_0x10e715,_0x14b18a,!![]);}catch(_0x452319){return BPromise[_0x14e6('0x35')](_0x452319);}return _0x10e715[_0x14e6('0x36')]();};}function saveUpdates(_0x2b901f,_0x4b2678){return function(_0x3b0c35){if(_0x3b0c35){return _0x3b0c35[_0x14e6('0x37')](_0x2b901f)[_0x14e6('0x21')](function(_0x1e504e){return _0x1e504e;});}return null;};}function removeEntity(_0x47ecac,_0x26bfee){return function(_0x1e5d37){if(_0x1e5d37){return _0x1e5d37[_0x14e6('0x38')]()[_0x14e6('0x21')](function(){_0x47ecac[_0x14e6('0x2d')](0xcc)[_0x14e6('0x2e')]();});}};}function handleEntityNotFound(_0x263c2f,_0xce0ea7){return function(_0x14d298){if(!_0x14d298){_0x263c2f[_0x14e6('0x2c')](0x194);}return _0x14d298;};}function handleError(_0x19a32c,_0x46a654){_0x46a654=_0x46a654||0x1f4;return function(_0x558f1d){logger[_0x14e6('0x28')](_0x558f1d[_0x14e6('0x39')]);if(_0x558f1d[_0x14e6('0x3a')]){delete _0x558f1d[_0x14e6('0x3a')];}_0x19a32c[_0x14e6('0x2d')](_0x46a654)[_0x14e6('0x3b')](_0x558f1d);};}exports[_0x14e6('0x3c')]=function(_0x3f547f,_0x30289a){var _0x36a581={},_0x25f91c={},_0x190240={'count':0x0,'rows':[]};var _0x2dfd5e=_[_0x14e6('0x3d')](db[_0x14e6('0x3e')][_0x14e6('0x3f')],function(_0x33a1f1){return{'name':_0x33a1f1['fieldName'],'type':_0x33a1f1[_0x14e6('0x40')]['key']};});_0x25f91c[_0x14e6('0x41')]=_[_0x14e6('0x3d')](_0x2dfd5e,_0x14e6('0x3a'));_0x25f91c[_0x14e6('0x42')]=_['keys'](_0x3f547f[_0x14e6('0x42')]);_0x25f91c[_0x14e6('0x43')]=_['intersection'](_0x25f91c[_0x14e6('0x41')],_0x25f91c[_0x14e6('0x42')]);_0x36a581[_0x14e6('0x44')]=_[_0x14e6('0x45')](_0x25f91c[_0x14e6('0x41')],qs['fields'](_0x3f547f[_0x14e6('0x42')][_0x14e6('0x46')]));_0x36a581['attributes']=_0x36a581[_0x14e6('0x44')][_0x14e6('0x47')]?_0x36a581[_0x14e6('0x44')]:_0x25f91c['model'];if(!_0x3f547f['query'][_0x14e6('0x48')](_0x14e6('0x49'))){_0x36a581[_0x14e6('0x31')]=qs[_0x14e6('0x31')](_0x3f547f[_0x14e6('0x42')]['limit']);_0x36a581['offset']=qs['offset'](_0x3f547f[_0x14e6('0x42')][_0x14e6('0x30')]);}_0x36a581[_0x14e6('0x4a')]=qs[_0x14e6('0x4b')](_0x3f547f[_0x14e6('0x42')][_0x14e6('0x4b')]);_0x36a581[_0x14e6('0x4c')]=qs[_0x14e6('0x43')](_[_0x14e6('0x4d')](_0x3f547f[_0x14e6('0x42')],_0x25f91c['filters']),_0x2dfd5e);if(_0x3f547f[_0x14e6('0x42')][_0x14e6('0x4e')]){_0x36a581['where']=_[_0x14e6('0x4f')](_0x36a581[_0x14e6('0x4c')],{'$or':_['map'](_0x2dfd5e,function(_0x15c061){if(_0x15c061[_0x14e6('0x40')]!==_0x14e6('0x50')){var _0x4a7d9f={};_0x4a7d9f[_0x15c061['name']]={'$like':'%'+_0x3f547f[_0x14e6('0x42')][_0x14e6('0x4e')]+'%'};return _0x4a7d9f;}})});}_0x36a581=_[_0x14e6('0x4f')]({},_0x36a581,_0x3f547f[_0x14e6('0x51')]);var _0x4a3b9c={'where':_0x36a581[_0x14e6('0x4c')]};return db[_0x14e6('0x3e')][_0x14e6('0x2f')](_0x4a3b9c)['then'](function(_0x2fc9d5){_0x190240[_0x14e6('0x2f')]=_0x2fc9d5;if(_0x3f547f[_0x14e6('0x42')][_0x14e6('0x52')]){_0x36a581['include']=[{'all':!![]}];}return db[_0x14e6('0x3e')]['findAll'](_0x36a581);})['then'](function(_0x893e8b){_0x190240[_0x14e6('0x53')]=_0x893e8b;return _0x190240;})[_0x14e6('0x21')](respondWithFilteredResult(_0x30289a,_0x36a581))[_0x14e6('0x54')](handleError(_0x30289a,null));};exports[_0x14e6('0x55')]=function(_0xab468d,_0x466bcd){var _0x201ab6={'raw':!![],'where':{'id':_0xab468d[_0x14e6('0x56')]['id']}},_0x1c2627={};_0x1c2627['model']=_['keys'](db['SmsMessage'][_0x14e6('0x3f')]);_0x1c2627[_0x14e6('0x42')]=_['keys'](_0xab468d['query']);_0x1c2627[_0x14e6('0x43')]=_[_0x14e6('0x45')](_0x1c2627[_0x14e6('0x41')],_0x1c2627[_0x14e6('0x42')]);_0x201ab6[_0x14e6('0x44')]=_['intersection'](_0x1c2627[_0x14e6('0x41')],qs[_0x14e6('0x46')](_0xab468d[_0x14e6('0x42')][_0x14e6('0x46')]));_0x201ab6['attributes']=_0x201ab6['attributes'][_0x14e6('0x47')]?_0x201ab6[_0x14e6('0x44')]:_0x1c2627['model'];if(_0xab468d[_0x14e6('0x42')]['includeAll']){_0x201ab6[_0x14e6('0x57')]=[{'all':!![]}];}_0x201ab6=_[_0x14e6('0x4f')]({},_0x201ab6,_0xab468d['options']);return db[_0x14e6('0x3e')]['find'](_0x201ab6)[_0x14e6('0x21')](handleEntityNotFound(_0x466bcd,null))['then'](respondWithResult(_0x466bcd,null))['catch'](handleError(_0x466bcd,null));};exports[_0x14e6('0x58')]=function(_0x345dc2,_0x4317b1){return db['SmsMessage'][_0x14e6('0x58')](_0x345dc2[_0x14e6('0x59')],{})['then'](respondWithResult(_0x4317b1,0xc9))['catch'](handleError(_0x4317b1,null));};exports[_0x14e6('0x37')]=function(_0x517257,_0x3406ce){if(_0x517257[_0x14e6('0x59')]['id']){delete _0x517257[_0x14e6('0x59')]['id'];}return db[_0x14e6('0x3e')][_0x14e6('0x5a')]({'where':{'id':_0x517257[_0x14e6('0x56')]['id']}})['then'](handleEntityNotFound(_0x3406ce,null))[_0x14e6('0x21')](saveUpdates(_0x517257[_0x14e6('0x59')],null))['then'](respondWithResult(_0x3406ce,null))[_0x14e6('0x54')](handleError(_0x3406ce,null));};exports[_0x14e6('0x38')]=function(_0x3b560f,_0x1e6e79){return db[_0x14e6('0x3e')][_0x14e6('0x5a')]({'where':{'id':_0x3b560f['params']['id']}})[_0x14e6('0x21')](handleEntityNotFound(_0x1e6e79,null))[_0x14e6('0x21')](removeEntity(_0x1e6e79,null))[_0x14e6('0x54')](handleError(_0x1e6e79,null));};exports['describe']=function(_0x6a391d,_0x11a465){return db[_0x14e6('0x3e')][_0x14e6('0x5b')]()[_0x14e6('0x21')](respondWithResult(_0x11a465,null))[_0x14e6('0x54')](handleError(_0x11a465,null));};var interaction_log=require(_0x14e6('0x17'))(_0x14e6('0x5c'));exports[_0x14e6('0x5d')]=function(_0x48d9b3,_0x871a5e,_0x2fd492){var _0x771809={'channel':_0x14e6('0x5e')};if(_0x48d9b3['body']['id']){delete _0x48d9b3[_0x14e6('0x59')]['id'];}_0x48d9b3[_0x14e6('0x59')][_0x14e6('0x5f')]=!![];_0x48d9b3[_0x14e6('0x59')][_0x14e6('0x60')]=moment()[_0x14e6('0x61')]('YYYY-MM-DD\x20HH:mm:ss');_0x48d9b3[_0x14e6('0x59')][_0x14e6('0x62')]=_0x48d9b3['body'][_0x14e6('0x62')]||_0x48d9b3['user']['id'];return db['SmsMessage'][_0x14e6('0x5a')]({'where':{'id':_0x48d9b3[_0x14e6('0x56')]['id'],'UserId':null},'include':[{'model':db[_0x14e6('0x63')],'as':_0x14e6('0x64')}]})[_0x14e6('0x21')](handleEntityNotFound(_0x871a5e,null))[_0x14e6('0x21')](saveUpdates(_0x48d9b3[_0x14e6('0x59')],null))[_0x14e6('0x21')](function(_0x1fe26a){if(_0x1fe26a){_0x771809[_0x14e6('0x2a')]=_0x1fe26a[_0x14e6('0x65')]({'plain':!![]});return db[_0x14e6('0x66')][_0x14e6('0x5a')]({'where':{'id':_0x1fe26a['SmsInteractionId']}});}return null;})[_0x14e6('0x21')](handleEntityNotFound(_0x871a5e,null))['then'](function(_0x1fc138){if(_0x1fc138){return _0x1fc138[_0x14e6('0x37')]({'UserId':_0x48d9b3[_0x14e6('0x59')][_0x14e6('0x62')],'read1stAt':_[_0x14e6('0x67')](_0x1fc138['read1stAt'])?moment()[_0x14e6('0x61')](_0x14e6('0x68')):undefined});}return null;})[_0x14e6('0x21')](function(_0x23b09b){if(_0x23b09b){_0x771809[_0x14e6('0x69')]=_0x23b09b[_0x14e6('0x65')]({'plain':!![]});interaction_log[_0x14e6('0x22')](_0x14e6('0x6a'),_0x48d9b3['user']['id'],_0x48d9b3['user'][_0x14e6('0x3a')],_0x48d9b3[_0x14e6('0x6b')][_0x14e6('0x6c')],_0x771809[_0x14e6('0x69')]['id'],_0x48d9b3[_0x14e6('0x59')]?JSON[_0x14e6('0x27')](_0x48d9b3[_0x14e6('0x59')]):_0x14e6('0x6d'));return respondWithRpcPromise('AcceptMessage','acceptMessage',_0x771809);}return null;})[_0x14e6('0x21')](function(_0x93ed06){if(_0x93ed06){if(_0x48d9b3[_0x14e6('0x59')]['manual']){_0x771809[_0x14e6('0x2a')][_0x14e6('0x6e')]=util[_0x14e6('0x61')]('SIP/%s',_0x48d9b3[_0x14e6('0x6b')][_0x14e6('0x3a')]);_0x771809[_0x14e6('0x2a')][_0x14e6('0x6f')]=_0x771809['channel'];_0x771809['message'][_0x14e6('0x70')]='accept';return respondWithRpcPromise(_0x14e6('0x71'),_0x14e6('0x71'),{'event':'acceptmessage','message':_0x771809[_0x14e6('0x2a')]},client9002)['then'](function(){return _0x771809;});}return _0x771809;}return null;})[_0x14e6('0x21')](respondWithResult(_0x871a5e,null))[_0x14e6('0x54')](handleError(_0x871a5e,null));};var interaction_log=require(_0x14e6('0x17'))(_0x14e6('0x5c'));exports[_0x14e6('0x35')]=function(_0x40b7d3,_0x285046,_0x4a88da){var _0x3c5cba={'agent':{},'channel':_0x14e6('0x5e')};if(_0x40b7d3['body']['id']){delete _0x40b7d3[_0x14e6('0x59')]['id'];}_0x40b7d3[_0x14e6('0x59')]['UserId']=_0x40b7d3[_0x14e6('0x59')][_0x14e6('0x62')]||_0x40b7d3['user']['id'];_0x3c5cba[_0x14e6('0x72')]['id']=_0x40b7d3['body'][_0x14e6('0x62')];return db[_0x14e6('0x3e')][_0x14e6('0x5a')]({'where':{'id':_0x40b7d3[_0x14e6('0x56')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x285046,null))[_0x14e6('0x21')](function(_0x4ae5c2){if(_0x4ae5c2){_0x3c5cba[_0x14e6('0x2a')]=_0x4ae5c2[_0x14e6('0x65')]({'plain':!![]});return db[_0x14e6('0x66')][_0x14e6('0x5a')]({'where':{'id':_0x4ae5c2[_0x14e6('0x73')]}});}return null;})[_0x14e6('0x21')](handleEntityNotFound(_0x285046,null))[_0x14e6('0x21')](function(_0x3c50a1){if(_0x3c50a1){_0x3c5cba[_0x14e6('0x69')]=_0x3c50a1['get']({'plain':!![]});interaction_log[_0x14e6('0x22')](_0x14e6('0x74'),_0x40b7d3[_0x14e6('0x6b')]['id'],_0x40b7d3[_0x14e6('0x6b')][_0x14e6('0x3a')],_0x40b7d3[_0x14e6('0x6b')]['role'],_0x3c5cba['interaction']['id'],_0x40b7d3[_0x14e6('0x59')]?JSON[_0x14e6('0x27')](_0x40b7d3[_0x14e6('0x59')]):_0x14e6('0x6d'));return respondWithRpcPromise(_0x14e6('0x75'),_0x14e6('0x76'),_0x3c5cba);}return null;})[_0x14e6('0x21')](function(_0x27c479){if(_0x27c479){_0x27c479['message'][_0x14e6('0x6e')]=util[_0x14e6('0x61')](_0x14e6('0x77'),_0x40b7d3[_0x14e6('0x6b')][_0x14e6('0x3a')]);_0x27c479[_0x14e6('0x2a')]['channel']=_0x3c5cba[_0x14e6('0x6f')];_0x27c479[_0x14e6('0x2a')][_0x14e6('0x70')]=_0x14e6('0x35');respondWithRpcPromise(_0x14e6('0x71'),'EventManager',{'event':_0x14e6('0x78'),'message':_0x27c479[_0x14e6('0x2a')]},client9002);return _0x3c5cba;}return null;})['then'](respondWithResult(_0x285046,null))[_0x14e6('0x54')](handleError(_0x285046,null));};exports[_0x14e6('0x2d')]=function(_0x53b1d8,_0xe8e3a4,_0x396381){if(_0x53b1d8['body']['id']){delete _0x53b1d8[_0x14e6('0x59')]['id'];}var _0x55b430;return db[_0x14e6('0x3e')][_0x14e6('0x5a')]({'where':{'id':_0x53b1d8[_0x14e6('0x56')]['id']}})[_0x14e6('0x21')](handleEntityNotFound(_0xe8e3a4,null))[_0x14e6('0x21')](function(_0x7159c3){if(_0x7159c3){_0x55b430=_0x7159c3;return db[_0x14e6('0x79')]['find']({'where':{'id':_0x7159c3[_0x14e6('0x7a')]}});}})[_0x14e6('0x21')](handleEntityNotFound(_0xe8e3a4,null))['then'](function(_0x282fb0){if(_0x282fb0){logger[_0x14e6('0x25')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x14e6('0x2d'),_0x14e6('0x7b'),_0x282fb0[_0x14e6('0x40')],util[_0x14e6('0x7c')](_0x53b1d8['body'],{'showHidden':![],'depth':null}));switch(_0x282fb0['type']){case _0x14e6('0x7d'):if(_0x53b1d8[_0x14e6('0x59')][_0x14e6('0x7e')]&&_0x53b1d8[_0x14e6('0x59')]['MessageSid']===_0x55b430[_0x14e6('0x7f')]){return _0x55b430[_0x14e6('0x37')]({'read':!![]});}else{logger[_0x14e6('0x28')](_0x14e6('0x80'),_0x14e6('0x2d'),_0x14e6('0x7d'),util[_0x14e6('0x7c')](_0x53b1d8[_0x14e6('0x59')],{'showHidden':![],'depth':null}));}break;case _0x14e6('0x81'):if(_0x53b1d8[_0x14e6('0x59')]['MessageUUID']&&_0x53b1d8[_0x14e6('0x59')][_0x14e6('0x82')]===_0x55b430['messageId']&&_['indexOf'](['sent',_0x14e6('0x83')],_0x53b1d8['body'][_0x14e6('0x84')])>=0x0){return _0x55b430[_0x14e6('0x37')]({'read':!![]});}else{logger[_0x14e6('0x28')](_0x14e6('0x80'),_0x14e6('0x2d'),_0x14e6('0x85'),util['inspect'](_0x53b1d8[_0x14e6('0x59')],{'showHidden':![],'depth':null}));}break;case _0x14e6('0x86'):var _0x285d04=_0x53b1d8[_0x14e6('0x59')][_0x14e6('0x87')][0x0];if(_0x285d04[_0x14e6('0x2d')]['groupName']===_0x14e6('0x88')){return _0x55b430[_0x14e6('0x37')]({'read':!![]});}else{logger[_0x14e6('0x28')](_0x14e6('0x80'),_0x14e6('0x2d'),_0x14e6('0x86'),util[_0x14e6('0x7c')](_0x53b1d8['body'],{'showHidden':![],'depth':null}));}break;}return _0x55b430;}})[_0x14e6('0x21')](respondWithResult(_0xe8e3a4,null))[_0x14e6('0x54')](handleError(_0xe8e3a4,null));};
\ No newline at end of file
+var _0x93ed=['redis','defaults','localhost','socket.io-emitter','client','http','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','info','SmsMessage,\x20%s,\x20%s','request\x20sent','SmsMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','sendStatus','end','offset','limit','status','set','Content-Range','json','save','update','destroy','stack','name','send','index','map','SmsMessage','fieldName','key','model','query','filters','intersection','attributes','hasOwnProperty','nolimit','order','sort','pick','where','merge','type','VIRTUAL','filter','options','then','count','include','findAll','rows','show','keys','rawAttributes','fields','length','find','create','body','params','describe','sms-interactions','accept','sms','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','CmContact','get','SmsInteraction','SmsInteractionId','read1stAt','interaction','[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','acceptMessage','manual','SIP/%s','channel','event','EventManager','acceptmessage','reject','agent','[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','interface','rejectmessage','SmsAccountId','received\x20delivery\x20report\x20from','inspect','MessageSid','messageId','SmsAccount,\x20%s,\x20%s,\x20%s','plivo','MessageUUID','sent','delivered','Status','plivio','infobip','results','groupName','DELIVERED','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','sox','to-csv','ejs','lodash','squel','desk.js','querystring','papaparse','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment'];(function(_0x3e0dc4,_0x13971b){var _0x586111=function(_0x123c53){while(--_0x123c53){_0x3e0dc4['push'](_0x3e0dc4['shift']());}};_0x586111(++_0x13971b);}(_0x93ed,0xfe));var _0xd93e=function(_0x1d0b74,_0x2b9295){_0x1d0b74=_0x1d0b74-0x0;var _0x1c18e7=_0x93ed[_0x1d0b74];return _0x1c18e7;};'use strict';var pdf=require(_0xd93e('0x0'));var emlformat=require(_0xd93e('0x1'));var rimraf=require(_0xd93e('0x2'));var zipdir=require(_0xd93e('0x3'));var jsonpatch=require(_0xd93e('0x4'));var rp=require('request-promise');var moment=require(_0xd93e('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xd93e('0x6'));var util=require(_0xd93e('0x7'));var path=require('path');var sox=require(_0xd93e('0x8'));var csv=require(_0xd93e('0x9'));var ejs=require(_0xd93e('0xa'));var fs=require('fs');var _=require(_0xd93e('0xb'));var squel=require(_0xd93e('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xd93e('0xd'));var toCsv=require(_0xd93e('0x9'));var querystring=require(_0xd93e('0xe'));var Papa=require(_0xd93e('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xd93e('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd93e('0x11'));var logger=require(_0xd93e('0x12'))(_0xd93e('0x13'));var utils=require(_0xd93e('0x14'));var config=require(_0xd93e('0x15'));var db=require('../../mysqldb')['db'];config[_0xd93e('0x16')]=_[_0xd93e('0x17')](config[_0xd93e('0x16')],{'host':_0xd93e('0x18'),'port':0x18eb});var socket=require(_0xd93e('0x19'))(new Redis(config['redis']));require('./smsMessage.socket')['register'](socket);var jayson=require('jayson/promise');var client=jayson[_0xd93e('0x1a')][_0xd93e('0x1b')]({'port':0x232c});var client9002=jayson[_0xd93e('0x1a')]['http']({'port':0x232a});function checkPasswordPattern(_0xc53b90,_0x490bc0,_0x1826b8){if(_0x1826b8){var _0x164238=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x164238[_0xd93e('0x1c')](_0x490bc0)){return _0xc53b90;}else{throw new db[(_0xd93e('0x1d'))][(_0xd93e('0x1e'))](_0xd93e('0x1f'));}}else{return _0xc53b90;}}function respondWithRpcPromise(_0x433ced,_0x54b6a1,_0x50c196,_0x54d919){return new BPromise(function(_0x2e9fff,_0x9896c8){var _0x412cf4=_0x54d919||client;return _0x412cf4['request'](_0x433ced,_0x50c196)['then'](function(_0x332d46){logger[_0xd93e('0x20')](_0xd93e('0x21'),_0x54b6a1,_0xd93e('0x22'));logger['debug'](_0xd93e('0x23'),_0x54b6a1,_0xd93e('0x22'),JSON[_0xd93e('0x24')](_0x332d46));if(_0x332d46[_0xd93e('0x25')]){if(_0x332d46[_0xd93e('0x25')]['code']===0x1f4){logger['error'](_0xd93e('0x21'),_0x54b6a1,_0x332d46[_0xd93e('0x25')][_0xd93e('0x26')]);return _0x9896c8(_0x332d46[_0xd93e('0x25')][_0xd93e('0x26')]);}logger[_0xd93e('0x25')](_0xd93e('0x21'),_0x54b6a1,_0x332d46[_0xd93e('0x25')][_0xd93e('0x26')]);return _0x2e9fff(_0x332d46[_0xd93e('0x25')][_0xd93e('0x26')]);}else{logger['info'](_0xd93e('0x21'),_0x54b6a1,'request\x20sent');_0x2e9fff(_0x332d46['result'][_0xd93e('0x26')]);}})[_0xd93e('0x27')](function(_0x5aaa9a){logger[_0xd93e('0x25')](_0xd93e('0x21'),_0x54b6a1,_0x5aaa9a);_0x9896c8(_0x5aaa9a);});});}function respondWithStatusCode(_0xa21e2d,_0x49ae2c){_0x49ae2c=_0x49ae2c||0xcc;return function(_0x46bbf0){if(_0x46bbf0){return _0xa21e2d[_0xd93e('0x28')](_0x49ae2c);}return _0xa21e2d['status'](_0x49ae2c)[_0xd93e('0x29')]();};}function respondWithResult(_0x131a9c,_0x49dae){_0x49dae=_0x49dae||0xc8;return function(_0x41c479){if(_0x41c479){return _0x131a9c['status'](_0x49dae)['json'](_0x41c479);}};}function respondWithFilteredResult(_0x567f94,_0x149209){return function(_0x3baf51){if(_0x3baf51){var _0x23c1b4=_0x3baf51['count'],_0x23de8e=_0x149209[_0xd93e('0x2a')],_0x374b4b=_0x149209['offset']+_0x149209[_0xd93e('0x2b')],_0x3f2150;if(_0x374b4b>=_0x23c1b4){_0x374b4b=_0x23c1b4;_0x3f2150=0xc8;}else{_0x3f2150=0xce;}_0x567f94[_0xd93e('0x2c')](_0x3f2150);return _0x567f94[_0xd93e('0x2d')](_0xd93e('0x2e'),_0x23de8e+'-'+_0x374b4b+'/'+_0x23c1b4)[_0xd93e('0x2f')](_0x3baf51);}return null;};}function patchUpdates(_0x5976d7){return function(_0x5d0fa1){try{jsonpatch['apply'](_0x5d0fa1,_0x5976d7,!![]);}catch(_0x4dd4c4){return BPromise['reject'](_0x4dd4c4);}return _0x5d0fa1[_0xd93e('0x30')]();};}function saveUpdates(_0x242224,_0x225029){return function(_0x589412){if(_0x589412){return _0x589412[_0xd93e('0x31')](_0x242224)['then'](function(_0x599f40){return _0x599f40;});}return null;};}function removeEntity(_0x136176,_0x45a3b6){return function(_0x1fd176){if(_0x1fd176){return _0x1fd176[_0xd93e('0x32')]()['then'](function(){_0x136176['status'](0xcc)[_0xd93e('0x29')]();});}};}function handleEntityNotFound(_0x18e59e,_0x23a4c7){return function(_0x578c0d){if(!_0x578c0d){_0x18e59e[_0xd93e('0x28')](0x194);}return _0x578c0d;};}function handleError(_0xd74f43,_0x4f79d4){_0x4f79d4=_0x4f79d4||0x1f4;return function(_0x5082cc){logger['error'](_0x5082cc[_0xd93e('0x33')]);if(_0x5082cc[_0xd93e('0x34')]){delete _0x5082cc[_0xd93e('0x34')];}_0xd74f43[_0xd93e('0x2c')](_0x4f79d4)[_0xd93e('0x35')](_0x5082cc);};}exports[_0xd93e('0x36')]=function(_0x9da605,_0x58979c){var _0xe7bf82={},_0x5db929={},_0x3de507={'count':0x0,'rows':[]};var _0x593a35=_[_0xd93e('0x37')](db[_0xd93e('0x38')]['rawAttributes'],function(_0x341010){return{'name':_0x341010[_0xd93e('0x39')],'type':_0x341010['type'][_0xd93e('0x3a')]};});_0x5db929[_0xd93e('0x3b')]=_[_0xd93e('0x37')](_0x593a35,'name');_0x5db929['query']=_['keys'](_0x9da605[_0xd93e('0x3c')]);_0x5db929[_0xd93e('0x3d')]=_[_0xd93e('0x3e')](_0x5db929[_0xd93e('0x3b')],_0x5db929[_0xd93e('0x3c')]);_0xe7bf82[_0xd93e('0x3f')]=_[_0xd93e('0x3e')](_0x5db929[_0xd93e('0x3b')],qs['fields'](_0x9da605[_0xd93e('0x3c')]['fields']));_0xe7bf82[_0xd93e('0x3f')]=_0xe7bf82[_0xd93e('0x3f')]['length']?_0xe7bf82[_0xd93e('0x3f')]:_0x5db929[_0xd93e('0x3b')];if(!_0x9da605[_0xd93e('0x3c')][_0xd93e('0x40')](_0xd93e('0x41'))){_0xe7bf82['limit']=qs[_0xd93e('0x2b')](_0x9da605[_0xd93e('0x3c')][_0xd93e('0x2b')]);_0xe7bf82['offset']=qs[_0xd93e('0x2a')](_0x9da605['query']['offset']);}_0xe7bf82[_0xd93e('0x42')]=qs[_0xd93e('0x43')](_0x9da605[_0xd93e('0x3c')]['sort']);_0xe7bf82['where']=qs[_0xd93e('0x3d')](_[_0xd93e('0x44')](_0x9da605[_0xd93e('0x3c')],_0x5db929[_0xd93e('0x3d')]),_0x593a35);if(_0x9da605['query']['filter']){_0xe7bf82[_0xd93e('0x45')]=_[_0xd93e('0x46')](_0xe7bf82[_0xd93e('0x45')],{'$or':_[_0xd93e('0x37')](_0x593a35,function(_0x319723){if(_0x319723[_0xd93e('0x47')]!==_0xd93e('0x48')){var _0x53d058={};_0x53d058[_0x319723[_0xd93e('0x34')]]={'$like':'%'+_0x9da605[_0xd93e('0x3c')][_0xd93e('0x49')]+'%'};return _0x53d058;}})});}_0xe7bf82=_[_0xd93e('0x46')]({},_0xe7bf82,_0x9da605[_0xd93e('0x4a')]);var _0x47d7d3={'where':_0xe7bf82[_0xd93e('0x45')]};return db[_0xd93e('0x38')]['count'](_0x47d7d3)[_0xd93e('0x4b')](function(_0x437851){_0x3de507[_0xd93e('0x4c')]=_0x437851;if(_0x9da605[_0xd93e('0x3c')]['includeAll']){_0xe7bf82[_0xd93e('0x4d')]=[{'all':!![]}];}return db['SmsMessage'][_0xd93e('0x4e')](_0xe7bf82);})[_0xd93e('0x4b')](function(_0x340f7c){_0x3de507[_0xd93e('0x4f')]=_0x340f7c;return _0x3de507;})[_0xd93e('0x4b')](respondWithFilteredResult(_0x58979c,_0xe7bf82))['catch'](handleError(_0x58979c,null));};exports[_0xd93e('0x50')]=function(_0x419004,_0x3a2fe6){var _0x1cc0cd={'raw':!![],'where':{'id':_0x419004['params']['id']}},_0xddb2ad={};_0xddb2ad[_0xd93e('0x3b')]=_[_0xd93e('0x51')](db[_0xd93e('0x38')][_0xd93e('0x52')]);_0xddb2ad['query']=_['keys'](_0x419004[_0xd93e('0x3c')]);_0xddb2ad[_0xd93e('0x3d')]=_[_0xd93e('0x3e')](_0xddb2ad[_0xd93e('0x3b')],_0xddb2ad[_0xd93e('0x3c')]);_0x1cc0cd[_0xd93e('0x3f')]=_[_0xd93e('0x3e')](_0xddb2ad[_0xd93e('0x3b')],qs['fields'](_0x419004['query'][_0xd93e('0x53')]));_0x1cc0cd['attributes']=_0x1cc0cd[_0xd93e('0x3f')][_0xd93e('0x54')]?_0x1cc0cd[_0xd93e('0x3f')]:_0xddb2ad[_0xd93e('0x3b')];if(_0x419004[_0xd93e('0x3c')]['includeAll']){_0x1cc0cd[_0xd93e('0x4d')]=[{'all':!![]}];}_0x1cc0cd=_['merge']({},_0x1cc0cd,_0x419004[_0xd93e('0x4a')]);return db[_0xd93e('0x38')][_0xd93e('0x55')](_0x1cc0cd)['then'](handleEntityNotFound(_0x3a2fe6,null))[_0xd93e('0x4b')](respondWithResult(_0x3a2fe6,null))['catch'](handleError(_0x3a2fe6,null));};exports['create']=function(_0x180303,_0x4080c9){return db[_0xd93e('0x38')][_0xd93e('0x56')](_0x180303[_0xd93e('0x57')],{})['then'](respondWithResult(_0x4080c9,0xc9))['catch'](handleError(_0x4080c9,null));};exports['update']=function(_0x592fbc,_0x3ff42b){if(_0x592fbc[_0xd93e('0x57')]['id']){delete _0x592fbc['body']['id'];}return db[_0xd93e('0x38')]['find']({'where':{'id':_0x592fbc[_0xd93e('0x58')]['id']}})[_0xd93e('0x4b')](handleEntityNotFound(_0x3ff42b,null))[_0xd93e('0x4b')](saveUpdates(_0x592fbc[_0xd93e('0x57')],null))[_0xd93e('0x4b')](respondWithResult(_0x3ff42b,null))[_0xd93e('0x27')](handleError(_0x3ff42b,null));};exports[_0xd93e('0x32')]=function(_0x2778e0,_0x5404c2){return db[_0xd93e('0x38')][_0xd93e('0x55')]({'where':{'id':_0x2778e0[_0xd93e('0x58')]['id']}})[_0xd93e('0x4b')](handleEntityNotFound(_0x5404c2,null))[_0xd93e('0x4b')](removeEntity(_0x5404c2,null))['catch'](handleError(_0x5404c2,null));};exports[_0xd93e('0x59')]=function(_0x1615eb,_0x38bf73){return db[_0xd93e('0x38')]['describe']()['then'](respondWithResult(_0x38bf73,null))[_0xd93e('0x27')](handleError(_0x38bf73,null));};var interaction_log=require(_0xd93e('0x12'))(_0xd93e('0x5a'));exports[_0xd93e('0x5b')]=function(_0x81d798,_0x45f429,_0x1823f8){var _0x56b2c7={'channel':_0xd93e('0x5c')};if(_0x81d798[_0xd93e('0x57')]['id']){delete _0x81d798['body']['id'];}_0x81d798[_0xd93e('0x57')]['read']=!![];_0x81d798[_0xd93e('0x57')][_0xd93e('0x5d')]=moment()[_0xd93e('0x5e')](_0xd93e('0x5f'));_0x81d798['body'][_0xd93e('0x60')]=_0x81d798[_0xd93e('0x57')]['UserId']||_0x81d798[_0xd93e('0x61')]['id'];return db['SmsMessage'][_0xd93e('0x55')]({'where':{'id':_0x81d798[_0xd93e('0x58')]['id'],'UserId':null},'include':[{'model':db[_0xd93e('0x62')],'as':'Contact'}]})['then'](handleEntityNotFound(_0x45f429,null))[_0xd93e('0x4b')](saveUpdates(_0x81d798['body'],null))[_0xd93e('0x4b')](function(_0x3f415c){if(_0x3f415c){_0x56b2c7['message']=_0x3f415c[_0xd93e('0x63')]({'plain':!![]});return db[_0xd93e('0x64')][_0xd93e('0x55')]({'where':{'id':_0x3f415c[_0xd93e('0x65')]}});}return null;})['then'](handleEntityNotFound(_0x45f429,null))[_0xd93e('0x4b')](function(_0x2c67cb){if(_0x2c67cb){return _0x2c67cb[_0xd93e('0x31')]({'UserId':_0x81d798['body'][_0xd93e('0x60')],'read1stAt':_['isNil'](_0x2c67cb[_0xd93e('0x66')])?moment()[_0xd93e('0x5e')](_0xd93e('0x5f')):undefined});}return null;})['then'](function(_0x216240){if(_0x216240){_0x56b2c7[_0xd93e('0x67')]=_0x216240[_0xd93e('0x63')]({'plain':!![]});interaction_log[_0xd93e('0x20')](_0xd93e('0x68'),_0x81d798[_0xd93e('0x61')]['id'],_0x81d798[_0xd93e('0x61')][_0xd93e('0x34')],_0x81d798[_0xd93e('0x61')][_0xd93e('0x69')],_0x56b2c7[_0xd93e('0x67')]['id'],_0x81d798['body']?JSON[_0xd93e('0x24')](_0x81d798[_0xd93e('0x57')]):_0xd93e('0x6a'));return respondWithRpcPromise(_0xd93e('0x6b'),_0xd93e('0x6c'),_0x56b2c7);}return null;})['then'](function(_0x21d1cb){if(_0x21d1cb){if(_0x81d798[_0xd93e('0x57')][_0xd93e('0x6d')]){_0x56b2c7[_0xd93e('0x26')]['interface']=util[_0xd93e('0x5e')](_0xd93e('0x6e'),_0x81d798[_0xd93e('0x61')]['name']);_0x56b2c7[_0xd93e('0x26')][_0xd93e('0x6f')]=_0x56b2c7[_0xd93e('0x6f')];_0x56b2c7[_0xd93e('0x26')][_0xd93e('0x70')]=_0xd93e('0x5b');return respondWithRpcPromise(_0xd93e('0x71'),_0xd93e('0x71'),{'event':_0xd93e('0x72'),'message':_0x56b2c7['message']},client9002)[_0xd93e('0x4b')](function(){return _0x56b2c7;});}return _0x56b2c7;}return null;})[_0xd93e('0x4b')](respondWithResult(_0x45f429,null))[_0xd93e('0x27')](handleError(_0x45f429,null));};var interaction_log=require(_0xd93e('0x12'))(_0xd93e('0x5a'));exports[_0xd93e('0x73')]=function(_0x93f92c,_0xea582e,_0x2fd011){var _0x1eedd3={'agent':{},'channel':_0xd93e('0x5c')};if(_0x93f92c[_0xd93e('0x57')]['id']){delete _0x93f92c['body']['id'];}_0x93f92c[_0xd93e('0x57')][_0xd93e('0x60')]=_0x93f92c[_0xd93e('0x57')]['UserId']||_0x93f92c[_0xd93e('0x61')]['id'];_0x1eedd3[_0xd93e('0x74')]['id']=_0x93f92c[_0xd93e('0x57')][_0xd93e('0x60')];return db[_0xd93e('0x38')][_0xd93e('0x55')]({'where':{'id':_0x93f92c[_0xd93e('0x58')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0xea582e,null))[_0xd93e('0x4b')](function(_0x3a8874){if(_0x3a8874){_0x1eedd3[_0xd93e('0x26')]=_0x3a8874[_0xd93e('0x63')]({'plain':!![]});return db['SmsInteraction']['find']({'where':{'id':_0x3a8874[_0xd93e('0x65')]}});}return null;})[_0xd93e('0x4b')](handleEntityNotFound(_0xea582e,null))[_0xd93e('0x4b')](function(_0x46d597){if(_0x46d597){_0x1eedd3['interaction']=_0x46d597[_0xd93e('0x63')]({'plain':!![]});interaction_log['info'](_0xd93e('0x75'),_0x93f92c[_0xd93e('0x61')]['id'],_0x93f92c[_0xd93e('0x61')]['name'],_0x93f92c[_0xd93e('0x61')][_0xd93e('0x69')],_0x1eedd3['interaction']['id'],_0x93f92c[_0xd93e('0x57')]?JSON[_0xd93e('0x24')](_0x93f92c[_0xd93e('0x57')]):_0xd93e('0x6a'));return respondWithRpcPromise(_0xd93e('0x76'),_0xd93e('0x77'),_0x1eedd3);}return null;})[_0xd93e('0x4b')](function(_0x35276c){if(_0x35276c){_0x35276c[_0xd93e('0x26')][_0xd93e('0x78')]=util[_0xd93e('0x5e')](_0xd93e('0x6e'),_0x93f92c[_0xd93e('0x61')][_0xd93e('0x34')]);_0x35276c[_0xd93e('0x26')][_0xd93e('0x6f')]=_0x1eedd3[_0xd93e('0x6f')];_0x35276c[_0xd93e('0x26')][_0xd93e('0x70')]=_0xd93e('0x73');respondWithRpcPromise('EventManager','EventManager',{'event':_0xd93e('0x79'),'message':_0x35276c[_0xd93e('0x26')]},client9002);return _0x1eedd3;}return null;})[_0xd93e('0x4b')](respondWithResult(_0xea582e,null))[_0xd93e('0x27')](handleError(_0xea582e,null));};exports[_0xd93e('0x2c')]=function(_0x2fc36c,_0x4a892c,_0x58c56e){if(_0x2fc36c[_0xd93e('0x57')]['id']){delete _0x2fc36c[_0xd93e('0x57')]['id'];}var _0x5d050c;return db['SmsMessage'][_0xd93e('0x55')]({'where':{'id':_0x2fc36c['params']['id']}})[_0xd93e('0x4b')](handleEntityNotFound(_0x4a892c,null))[_0xd93e('0x4b')](function(_0x267099){if(_0x267099){_0x5d050c=_0x267099;return db['SmsAccount']['find']({'where':{'id':_0x267099[_0xd93e('0x7a')]}});}})[_0xd93e('0x4b')](handleEntityNotFound(_0x4a892c,null))['then'](function(_0x31579a){if(_0x31579a){logger['debug']('SmsMessage,\x20%s,\x20%s,\x20%s',_0xd93e('0x2c'),_0xd93e('0x7b'),_0x31579a['type'],util[_0xd93e('0x7c')](_0x2fc36c[_0xd93e('0x57')],{'showHidden':![],'depth':null}));switch(_0x31579a['type']){case'twilio':if(_0x2fc36c[_0xd93e('0x57')][_0xd93e('0x7d')]&&_0x2fc36c[_0xd93e('0x57')]['MessageSid']===_0x5d050c[_0xd93e('0x7e')]){return _0x5d050c[_0xd93e('0x31')]({'read':!![]});}else{logger['error'](_0xd93e('0x7f'),_0xd93e('0x2c'),'twilio',util['inspect'](_0x2fc36c[_0xd93e('0x57')],{'showHidden':![],'depth':null}));}break;case _0xd93e('0x80'):if(_0x2fc36c['body']['MessageUUID']&&_0x2fc36c[_0xd93e('0x57')][_0xd93e('0x81')]===_0x5d050c[_0xd93e('0x7e')]&&_['indexOf']([_0xd93e('0x82'),_0xd93e('0x83')],_0x2fc36c['body'][_0xd93e('0x84')])>=0x0){return _0x5d050c['update']({'read':!![]});}else{logger[_0xd93e('0x25')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0xd93e('0x2c'),_0xd93e('0x85'),util[_0xd93e('0x7c')](_0x2fc36c[_0xd93e('0x57')],{'showHidden':![],'depth':null}));}break;case _0xd93e('0x86'):var _0x58ed04=_0x2fc36c[_0xd93e('0x57')][_0xd93e('0x87')][0x0];if(_0x58ed04[_0xd93e('0x2c')][_0xd93e('0x88')]===_0xd93e('0x89')){return _0x5d050c[_0xd93e('0x31')]({'read':!![]});}else{logger['error'](_0xd93e('0x7f'),_0xd93e('0x2c'),_0xd93e('0x86'),util[_0xd93e('0x7c')](_0x2fc36c[_0xd93e('0x57')],{'showHidden':![],'depth':null}));}break;}return _0x5d050c;}})[_0xd93e('0x4b')](respondWithResult(_0x4a892c,null))[_0xd93e('0x27')](handleError(_0x4a892c,null));};
\ No newline at end of file
diff --git a/server/api/smsMessage/smsMessage.events.js b/server/api/smsMessage/smsMessage.events.js
index ab6198e..0d6b51a 100644
--- a/server/api/smsMessage/smsMessage.events.js
+++ b/server/api/smsMessage/smsMessage.events.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7c83=['SmsMessage','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0x5099d7,_0x58a330){var _0x3b0f0c=function(_0xd09e0a){while(--_0xd09e0a){_0x5099d7['push'](_0x5099d7['shift']());}};_0x3b0f0c(++_0x58a330);}(_0x7c83,0x8b));var _0x37c8=function(_0x407991,_0x59b269){_0x407991=_0x407991-0x0;var _0x106517=_0x7c83[_0x407991];return _0x106517;};'use strict';var EventEmitter=require(_0x37c8('0x0'));var SmsMessage=require('../../mysqldb')['db'][_0x37c8('0x1')];var SmsMessageEvents=new EventEmitter();SmsMessageEvents[_0x37c8('0x2')](0x0);var events={'afterCreate':_0x37c8('0x3'),'afterUpdate':_0x37c8('0x4'),'afterDestroy':_0x37c8('0x5')};function emitEvent(_0x56769e){return function(_0x50818b,_0x29cdf1,_0x3eb41d){SmsMessageEvents[_0x37c8('0x6')](_0x56769e+':'+_0x50818b['id'],_0x50818b);SmsMessageEvents[_0x37c8('0x6')](_0x56769e,_0x50818b);_0x3eb41d(null);};}for(var e in events){if(events[_0x37c8('0x7')](e)){var event=events[e];SmsMessage[_0x37c8('0x8')](e,emitEvent(event));}}module[_0x37c8('0x9')]=SmsMessageEvents;
\ No newline at end of file
+var _0x7b44=['hook','exports','events','../../mysqldb','SmsMessage','save','remove','emit','hasOwnProperty'];(function(_0x1b2ff7,_0x12a034){var _0x31656a=function(_0x1165a5){while(--_0x1165a5){_0x1b2ff7['push'](_0x1b2ff7['shift']());}};_0x31656a(++_0x12a034);}(_0x7b44,0x1a0));var _0x47b4=function(_0x31bd09,_0x2df7a3){_0x31bd09=_0x31bd09-0x0;var _0x3a7059=_0x7b44[_0x31bd09];return _0x3a7059;};'use strict';var EventEmitter=require(_0x47b4('0x0'));var SmsMessage=require(_0x47b4('0x1'))['db'][_0x47b4('0x2')];var SmsMessageEvents=new EventEmitter();SmsMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x47b4('0x3'),'afterUpdate':'update','afterDestroy':_0x47b4('0x4')};function emitEvent(_0x495fcf){return function(_0x3c64ea,_0x4cb93c,_0x1a3ed9){SmsMessageEvents[_0x47b4('0x5')](_0x495fcf+':'+_0x3c64ea['id'],_0x3c64ea);SmsMessageEvents[_0x47b4('0x5')](_0x495fcf,_0x3c64ea);_0x1a3ed9(null);};}for(var e in events){if(events[_0x47b4('0x6')](e)){var event=events[e];SmsMessage[_0x47b4('0x7')](e,emitEvent(event));}}module[_0x47b4('0x8')]=SmsMessageEvents;
\ No newline at end of file
diff --git a/server/api/smsMessage/smsMessage.model.js b/server/api/smsMessage/smsMessage.model.js
index 8a30459..7d40960 100644
--- a/server/api/smsMessage/smsMessage.model.js
+++ b/server/api/smsMessage/smsMessage.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x3f7e=['id_sms','Missing\x20parameters:\x20apiKey','clickatell','https://platform.clickatell.com/messages','apiMessageId','intelepeer','https://api.intelepeer.com/_rest/v4/app/sms/send','Bearer\x20','application/json','message','https://api.intelepeer.com/_rest/v4/app/sms/mdr','status','finally','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','rimraf','../../config/environment','./smsMessage.attributes','exports','define','SmsMessage','sms_messages','messageId','fti_sms_messages','body','FULLTEXT','models','get','direction','toLowerCase','secret','isNil','UserId','SmsInteractionId','update','createdAt','error','out','SmsAccount','find','SmsAccountId','then','type','authToken','phone','accountSid','messages','create','/status?token=','token','catch','SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','twilio','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','skebby','https://api.skebby.it/API/v1.0/REST/','username','password','smsMethod','sender','&password=','GET','split','sms','POST','total_sent','deliveryReport','read','inspect','connectel','senderString','https://smsapi.connectel.se/api/send/','requestid','format','%s:%s','toString','base64','http_code','data','queued_count','head','message_id','clickSend','Missing\x20parameters:\x20username,\x20password','plivo','authId','remote','/api/sms/messages/','https://api.plivo.com/v1/Account/%s/Message/','message_uuid','Missing\x20parameters:\x20authId,\x20authToken','baseUrl','/auth/1/session','/sms/2/text/advanced','IBSSO\x20','infobip','Missing\x20parameters:\x20base_url','csc','crypto','apiKey','login','text','sort','length','createHash','hex','signature=','/external/get/send.php?','keys'];(function(_0xf597b3,_0x503431){var _0x15097c=function(_0x561ef8){while(--_0x561ef8){_0xf597b3['push'](_0xf597b3['shift']());}};_0x15097c(++_0x503431);}(_0x3f7e,0x83));var _0xe3f7=function(_0x1d4e74,_0x353a9d){_0x1d4e74=_0x1d4e74-0x0;var _0x442c5a=_0x3f7e[_0x1d4e74];return _0x442c5a;};'use strict';var _=require(_0xe3f7('0x0'));var util=require(_0xe3f7('0x1'));var logger=require(_0xe3f7('0x2'))(_0xe3f7('0x3'));var moment=require(_0xe3f7('0x4'));var BPromise=require(_0xe3f7('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xe3f7('0x6'));var config=require(_0xe3f7('0x7'));var attributes=require(_0xe3f7('0x8'));module[_0xe3f7('0x9')]=function(_0x43fb23,_0x5b4695){return _0x43fb23[_0xe3f7('0xa')](_0xe3f7('0xb'),attributes,{'tableName':_0xe3f7('0xc'),'paranoid':![],'indexes':[{'name':_0xe3f7('0xd'),'fields':[_0xe3f7('0xd')]},{'name':_0xe3f7('0xe'),'fields':[_0xe3f7('0xf')],'type':_0xe3f7('0x10')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x655931,_0x2c5c5a,_0x198864){var _0xb32044=_0x43fb23[_0xe3f7('0x11')];var _0x525cec=_0x655931[_0xe3f7('0x12')]({'plain':!![]});if(_0x525cec[_0xe3f7('0x13')][_0xe3f7('0x14')]()==='in'||_0x525cec[_0xe3f7('0x13')][_0xe3f7('0x14')]()==='out'&&!_0x525cec[_0xe3f7('0x15')]&&!_[_0xe3f7('0x16')](_0x525cec[_0xe3f7('0x17')])){_0xb32044['SmsInteraction']['findOne']({'where':{'id':_0x525cec[_0xe3f7('0x18')]}})['then'](function(_0x35b2c4){if(_0x35b2c4){_0x35b2c4[_0xe3f7('0x19')]({'lastMsgAt':_0x525cec[_0xe3f7('0x1a')],'lastMsgDirection':_0x525cec[_0xe3f7('0x13')][_0xe3f7('0x14')]()});}})['catch'](function(_0x275edc){console[_0xe3f7('0x1b')](_0x275edc);});}if(_0x525cec[_0xe3f7('0x13')]===_0xe3f7('0x1c')&&!_0x525cec['secret']){var _0x22dacc;_0xb32044[_0xe3f7('0x1d')][_0xe3f7('0x1e')]({'where':{'id':_0x525cec[_0xe3f7('0x1f')]},'raw':!![]})[_0xe3f7('0x20')](function(_0x600e8b){_0x22dacc=_0x600e8b;if(_0x22dacc&&_0x22dacc[_0xe3f7('0x21')]){switch(_0x22dacc[_0xe3f7('0x21')]){case'twilio':var _0x5aaab3=require('twilio');if(_0x22dacc['accountSid']&&_0x22dacc[_0xe3f7('0x22')]&&_0x22dacc[_0xe3f7('0x23')]){var _0x5b6c7a=new _0x5aaab3(_0x22dacc[_0xe3f7('0x24')],_0x22dacc['authToken']);_0x5b6c7a[_0xe3f7('0x25')][_0xe3f7('0x26')]({'body':_0x525cec['body'],'to':_0x525cec['phone'],'from':_0x22dacc[_0xe3f7('0x23')],'statusCallback':_0x22dacc['remote']+'/api/sms/messages/'+_0x525cec['id']+_0xe3f7('0x27')+_0x22dacc[_0xe3f7('0x28')]})[_0xe3f7('0x20')](function(_0x4d85ff){if(_0x4d85ff['sid']){return _0x655931[_0xe3f7('0x19')]({'messageId':_0x4d85ff['sid']});}})[_0xe3f7('0x29')](function(_0x3a3893){logger[_0xe3f7('0x1b')](_0xe3f7('0x2a'),_0xe3f7('0x2b'),_0xe3f7('0x2c'),util['inspect'](_0x3a3893,{'showHidden':![],'depth':null}));});}else{logger[_0xe3f7('0x1b')](_0xe3f7('0x2a'),_0xe3f7('0x2b'),_0xe3f7('0x2c'),_0xe3f7('0x2d'));}break;case _0xe3f7('0x2e'):var _0x34d796=_0xe3f7('0x2f');if(_0x22dacc[_0xe3f7('0x30')]&&_0x22dacc[_0xe3f7('0x31')]){var _0x2b99dd={'recipient':[_0x525cec[_0xe3f7('0x23')]],'message':_0x525cec[_0xe3f7('0xf')],'message_type':_0x22dacc['smsMethod']};if(_0x22dacc['smsMethod']&&_0x22dacc[_0xe3f7('0x32')]!=='SI'){_0x2b99dd[_0xe3f7('0x33')]=_0x22dacc['phone'];}var _0x5d237f={'url':_0x34d796+'login?username='+_0x22dacc[_0xe3f7('0x30')]+_0xe3f7('0x34')+_0x22dacc[_0xe3f7('0x31')],'method':_0xe3f7('0x35')};rp(_0x5d237f)['then'](function(_0x28f463){var _0xfa7360=_0x28f463[_0xe3f7('0x36')](';');var _0x7d6972={'user_key':_0xfa7360[0x0],'session_key':_0xfa7360[0x1]};_0x5d237f={'url':_0x34d796+_0xe3f7('0x37'),'method':_0xe3f7('0x38'),'headers':{'user_key':_0x7d6972['user_key'],'Session_key':_0x7d6972['session_key']},'json':!![],'body':_0x2b99dd};return rp(_0x5d237f);})[_0xe3f7('0x20')](function(_0x412704){if(_0x412704[_0xe3f7('0x39')]>=0x1){var _0x133df6={'messageId':_0x412704['internal_order_id']};if(_0x22dacc['smsMethod']!=='GP'||!_0x22dacc[_0xe3f7('0x3a')]){_0x133df6[_0xe3f7('0x3b')]=!![];}return _0x655931[_0xe3f7('0x19')](_0x133df6);}else{return logger[_0xe3f7('0x1b')](_0xe3f7('0x2a'),_0xe3f7('0x2b'),_0xe3f7('0x2e'),util[_0xe3f7('0x3c')](_0x412704,{'showHidden':![],'depth':null}));}})['catch'](function(_0x79f38f){return logger[_0xe3f7('0x1b')](_0xe3f7('0x2a'),_0xe3f7('0x2b'),_0xe3f7('0x2e'),util[_0xe3f7('0x3c')](_0x79f38f,{'showHidden':![],'depth':null}));});}else{logger[_0xe3f7('0x1b')](_0xe3f7('0x2a'),_0xe3f7('0x2b'),_0xe3f7('0x2e'),'Missing\x20parameters:\x20username,\x20password');}break;case _0xe3f7('0x3d'):if(_0x22dacc[_0xe3f7('0x22')]){var _0x24b40b={'recipient':_0x525cec['phone'],'message':_0x525cec[_0xe3f7('0xf')],'sender':_0x22dacc[_0xe3f7('0x3e')]||_0x22dacc['phone'],'authorization':_0x22dacc['authToken']};var _0x2c5c5a={'method':_0xe3f7('0x38'),'uri':_0xe3f7('0x3f'),'body':_0x24b40b,'json':!![]};rp(_0x2c5c5a)[_0xe3f7('0x20')](function(_0x4e6a31){var _0x1ab383={'messageId':_0x4e6a31[_0xe3f7('0x40')]};if(!_0x22dacc['deliveryReport']){_0x1ab383[_0xe3f7('0x3b')]=!![];}return _0x655931[_0xe3f7('0x19')](_0x1ab383);})[_0xe3f7('0x29')](function(_0x27921d){logger[_0xe3f7('0x1b')](_0xe3f7('0x2a'),_0xe3f7('0x2b'),'connectel',util[_0xe3f7('0x3c')](_0x27921d,{'showHidden':![],'depth':null}));});}else{logger[_0xe3f7('0x1b')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xe3f7('0x2b'),_0xe3f7('0x3d'),'Missing\x20parameters:\x20authToken');}break;case'clicksend':if(_0x22dacc[_0xe3f7('0x30')]&&_0x22dacc['password']){var _0x24b40b={'messages':[{'source':'xCALLY\x20Motion','to':_0x525cec[_0xe3f7('0x23')],'body':_0x525cec[_0xe3f7('0xf')],'from':_0x22dacc[_0xe3f7('0x3e')]||_0x22dacc[_0xe3f7('0x23')]}]};var _0xb989c8=util[_0xe3f7('0x41')](_0xe3f7('0x42'),_0x22dacc[_0xe3f7('0x30')],_0x22dacc['password']);var _0x2c5c5a={'method':'POST','uri':'https://rest.clicksend.com/v3/sms/send','body':_0x24b40b,'headers':{'Authorization':util[_0xe3f7('0x41')]('Basic\x20%s',new Buffer(_0xb989c8)[_0xe3f7('0x43')](_0xe3f7('0x44')))},'json':!![]};rp(_0x2c5c5a)['then'](function(_0x127f0c){if(_0x127f0c[_0xe3f7('0x45')]>=0xc8&&_0x127f0c[_0xe3f7('0x45')]<=0xce){if(_0x127f0c[_0xe3f7('0x46')]&&_0x127f0c[_0xe3f7('0x46')][_0xe3f7('0x47')]>0x0){var _0xb10d11=_[_0xe3f7('0x48')](_0x127f0c[_0xe3f7('0x46')][_0xe3f7('0x25')]);var _0x301d4c={'messageId':_0xb10d11[_0xe3f7('0x49')]};if(!_0x22dacc[_0xe3f7('0x3a')]){_0x301d4c[_0xe3f7('0x3b')]=!![];}return _0x655931[_0xe3f7('0x19')](_0x301d4c);}else{logger[_0xe3f7('0x1b')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0xe3f7('0x4a'),util[_0xe3f7('0x3c')](_0x127f0c,{'showHidden':![],'depth':null}));}}else{logger[_0xe3f7('0x1b')](_0xe3f7('0x2a'),_0xe3f7('0x2b'),_0xe3f7('0x4a'),util[_0xe3f7('0x3c')](_0x127f0c,{'showHidden':![],'depth':null}));}})[_0xe3f7('0x29')](function(_0x4b117c){logger[_0xe3f7('0x1b')](_0xe3f7('0x2a'),'afterCreate',_0xe3f7('0x4a'),util[_0xe3f7('0x3c')](_0x4b117c,{'showHidden':![],'depth':null}));});}else{logger[_0xe3f7('0x1b')](_0xe3f7('0x2a'),'afterCreate','clickSend',_0xe3f7('0x4b'));}break;case _0xe3f7('0x4c'):if(_0x22dacc[_0xe3f7('0x4d')]&&_0x22dacc['authToken']){var _0x24b40b={'dst':_0x525cec['phone'],'text':_0x525cec[_0xe3f7('0xf')],'src':_0x22dacc[_0xe3f7('0x3e')]||_0x22dacc[_0xe3f7('0x23')],'url':_0x22dacc[_0xe3f7('0x4e')]+_0xe3f7('0x4f')+_0x525cec['id']+_0xe3f7('0x27')+_0x22dacc[_0xe3f7('0x28')]};var _0xb989c8=util[_0xe3f7('0x41')](_0xe3f7('0x42'),_0x22dacc[_0xe3f7('0x4d')],_0x22dacc[_0xe3f7('0x22')]);var _0x2c5c5a={'method':_0xe3f7('0x38'),'uri':util[_0xe3f7('0x41')](_0xe3f7('0x50'),_0x22dacc[_0xe3f7('0x4d')]),'body':_0x24b40b,'headers':{'Authorization':util[_0xe3f7('0x41')]('Basic\x20%s',new Buffer(_0xb989c8)[_0xe3f7('0x43')](_0xe3f7('0x44')))},'json':!![]};rp(_0x2c5c5a)[_0xe3f7('0x20')](function(_0x29a63e){var _0x357920={'messageId':_0x29a63e[_0xe3f7('0x51')][0x0]};return _0x655931['update'](_0x357920);})[_0xe3f7('0x29')](function(_0x4e9eba){logger['error'](_0xe3f7('0x2a'),_0xe3f7('0x2b'),_0xe3f7('0x4c'),util['inspect'](_0x4e9eba,{'showHidden':![],'depth':null}));});}else{logger[_0xe3f7('0x1b')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xe3f7('0x2b'),_0xe3f7('0x4c'),_0xe3f7('0x52'));}break;case'infobip':if(_0x22dacc[_0xe3f7('0x30')]&&_0x22dacc[_0xe3f7('0x31')]){if(_0x22dacc[_0xe3f7('0x53')]){var _0x1bce4b={'method':_0xe3f7('0x38'),'uri':_0x22dacc[_0xe3f7('0x53')]+_0xe3f7('0x54'),'body':{'username':_0x22dacc[_0xe3f7('0x30')],'password':_0x22dacc[_0xe3f7('0x31')]},'json':!![]};return rp(_0x1bce4b)[_0xe3f7('0x20')](function(_0x12d5d0){var _0x2af451={'method':_0xe3f7('0x38'),'uri':_0x22dacc[_0xe3f7('0x53')]+_0xe3f7('0x55'),'body':{'messages':[{'from':_0x22dacc['phone'],'destinations':[{'to':_0x525cec[_0xe3f7('0x23')]}],'text':_0x525cec['body'],'notifyUrl':_0x22dacc[_0xe3f7('0x4e')]+_0xe3f7('0x4f')+_0x525cec['id']+'/status?token='+_0x22dacc[_0xe3f7('0x28')],'notifyContentType':'application/json','callbackData':_0x22dacc[_0xe3f7('0x23')]+';'+_0x525cec[_0xe3f7('0xf')]}]},'headers':{'Authorization':_0xe3f7('0x56')+_0x12d5d0[_0xe3f7('0x28')]},'json':!![]};return rp(_0x2af451)['then'](function(_0x5272b8){if(_0x5272b8['messages']){var _0x157a6e={'messageId':_0x5272b8[_0xe3f7('0x25')][0x0][_0xe3f7('0xd')]};if(!_0x22dacc['deliveryReport']){_0x157a6e[_0xe3f7('0x3b')]=!![];}return _0x655931[_0xe3f7('0x19')](_0x157a6e);}else{return logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0xe3f7('0x2b'),_0xe3f7('0x57'),util['inspect'](_0x5272b8,{'showHidden':![],'depth':null}));}});})['catch'](function(_0x25b99e){return logger[_0xe3f7('0x1b')](_0xe3f7('0x2a'),_0xe3f7('0x2b'),_0xe3f7('0x57'),util[_0xe3f7('0x3c')](_0x25b99e,{'showHidden':![],'depth':null}));});}else{logger[_0xe3f7('0x1b')](_0xe3f7('0x2a'),_0xe3f7('0x2b'),_0xe3f7('0x57'),_0xe3f7('0x58'));}}else{logger[_0xe3f7('0x1b')](_0xe3f7('0x2a'),'afterCreate',_0xe3f7('0x57'),_0xe3f7('0x4b'));}break;case _0xe3f7('0x59'):var _0xd86097=require(_0xe3f7('0x5a'));if(_0x22dacc[_0xe3f7('0x5b')]){var _0x4dccf0={};_0x4dccf0[_0xe3f7('0x5c')]=_0x22dacc[_0xe3f7('0x30')];_0x4dccf0['phone']=_0x525cec[_0xe3f7('0x23')];_0x4dccf0[_0xe3f7('0x33')]=_0x22dacc[_0xe3f7('0x23')];_0x4dccf0[_0xe3f7('0x5d')]=_0x525cec[_0xe3f7('0xf')];_0x4dccf0['timestamp']=+new Date();var _0x1b0d86='';var _0x123591='';var _0x47af64=Object['keys'](_0x4dccf0);_0x47af64[_0xe3f7('0x5e')]();for(var _0x198485=0x0;_0x198485<_0x47af64[_0xe3f7('0x5f')];_0x198485++){if(_0x1b0d86!=''){_0x1b0d86+='&';}_0x1b0d86+=_0x47af64[_0x198485]+'='+encodeURIComponent(_0x4dccf0[_0x47af64[_0x198485]]);_0x123591+=_0x4dccf0[_0x47af64[_0x198485]];}_0x123591+=_0x22dacc['apiKey'];_0x123591=_0xd86097[_0xe3f7('0x60')]('md5')[_0xe3f7('0x19')](_0x123591)['digest'](_0xe3f7('0x61'));if(_0x1b0d86!==''){_0x1b0d86+='&';}_0x1b0d86+=_0xe3f7('0x62')+_0x123591;var _0x5d237f={'method':_0xe3f7('0x35'),'uri':_0x22dacc[_0xe3f7('0x53')]+_0xe3f7('0x63')+_0x1b0d86,'json':!![]};return rp(_0x5d237f)['then'](function(_0x10cb4a){var _0x51862e=Object[_0xe3f7('0x64')](_0x10cb4a);if(_0x10cb4a[_0x51862e[0x0]][_0xe3f7('0x1b')]&&parseInt(_0x10cb4a[_0x51862e[0x0]][_0xe3f7('0x1b')])===0x0){var _0x8b27f0={'messageId':_0x10cb4a[_0x51862e[0x0]][_0xe3f7('0x65')]};if(!_0x22dacc[_0xe3f7('0x3a')]){_0x8b27f0[_0xe3f7('0x3b')]=!![];}return _0x655931[_0xe3f7('0x19')](_0x8b27f0);}else{return logger[_0xe3f7('0x1b')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xe3f7('0x2b'),_0xe3f7('0x59'),util['inspect'](_0x10cb4a[_0xe3f7('0x1b')],{'showHidden':![],'depth':null}));}})['catch'](function(_0xa3f0e8){return logger['error'](_0xe3f7('0x2a'),_0xe3f7('0x2b'),_0xe3f7('0x59'),util[_0xe3f7('0x3c')](_0xa3f0e8,{'showHidden':![],'depth':null}));});}else{logger['error'](_0xe3f7('0x2a'),_0xe3f7('0x2b'),_0xe3f7('0x59'),_0xe3f7('0x66'));}break;case _0xe3f7('0x67'):if(_0x22dacc[_0xe3f7('0x5b')]){var _0x33955e={'method':_0xe3f7('0x38'),'uri':_0xe3f7('0x68'),'headers':{'Authorization':_0x22dacc[_0xe3f7('0x5b')]},'body':{'content':_0x525cec[_0xe3f7('0xf')],'to':[_0x525cec[_0xe3f7('0x23')]],'from':_0x22dacc[_0xe3f7('0x23')],'binary':![],'clientMessageId':'uuid','charset':'UTF-8'},'json':!![]};rp(_0x33955e)[_0xe3f7('0x20')](function(_0x1def84){if(!_0x1def84[_0xe3f7('0x1b')]){var _0x49f53e={'messageId':_0x1def84[_0xe3f7('0x25')][0x0][_0xe3f7('0x69')]};if(!_0x22dacc['deliveryReport']){_0x49f53e['read']=!![];}return _0x655931[_0xe3f7('0x19')](_0x49f53e);}else{return logger[_0xe3f7('0x1b')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xe3f7('0x2b'),'clickatell',util[_0xe3f7('0x3c')](_0x1def84['error'],{'showHidden':![],'depth':null}));}})[_0xe3f7('0x29')](function(_0x56a2b2){return logger[_0xe3f7('0x1b')](_0xe3f7('0x2a'),_0xe3f7('0x2b'),_0xe3f7('0x67'),util[_0xe3f7('0x3c')](_0x56a2b2,{'showHidden':![],'depth':null}));});}else{logger['error'](_0xe3f7('0x2a'),_0xe3f7('0x2b'),'clickatell',_0xe3f7('0x66'));}break;case _0xe3f7('0x6a'):if(_0x22dacc[_0xe3f7('0x5b')]){var _0x35ee30={};var _0x5d237f={'method':_0xe3f7('0x38'),'uri':_0xe3f7('0x6b'),'headers':{'Authorization':_0xe3f7('0x6c')+_0x22dacc['apiKey'],'Content-Type':_0xe3f7('0x6d')},'body':{'from':_0x22dacc[_0xe3f7('0x23')],'to':_0x525cec[_0xe3f7('0x23')],'text':_0x525cec[_0xe3f7('0xf')]},'json':!![]};return rp(_0x5d237f)['then'](function(_0x4197a5){if(_0x4197a5['code']==0xca){_0x35ee30[_0xe3f7('0x6e')]=_0x4197a5;var _0x4f5586={'method':_0xe3f7('0x38'),'uri':_0xe3f7('0x6f'),'headers':{'Authorization':'Bearer\x20'+_0x22dacc[_0xe3f7('0x5b')],'Content-Type':_0xe3f7('0x6d')},'body':{'refid':_0x35ee30[_0xe3f7('0x6e')]['refid']},'json':!![]};return rp(_0x4f5586)[_0xe3f7('0x20')](function(_0x34767b){_0x35ee30[_0xe3f7('0x70')]=_0x34767b;var _0x1a516a={'messageId':_0x35ee30[_0xe3f7('0x6e')]['refid'],'read':!![]};return _0x655931['update'](_0x1a516a);});}else{return logger[_0xe3f7('0x1b')](_0xe3f7('0x2a'),_0xe3f7('0x2b'),_0xe3f7('0x6a'),util[_0xe3f7('0x3c')](_0x4197a5,{'showHidden':![],'depth':null}));}})[_0xe3f7('0x29')](function(_0x46bcbf){return logger[_0xe3f7('0x1b')](_0xe3f7('0x2a'),_0xe3f7('0x2b'),_0xe3f7('0x6a'),util[_0xe3f7('0x3c')](_0x46bcbf,{'showHidden':![],'depth':null}));});}else{return logger[_0xe3f7('0x1b')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xe3f7('0x2b'),_0xe3f7('0x6a'),'Token\x20not\x20received');}break;}}})[_0xe3f7('0x71')](function(){_0x198864();});}else{_0x198864();}}},'charset':_0xe3f7('0x72'),'collate':_0xe3f7('0x73')});};
\ No newline at end of file
+var _0x0aae=['find','type','twilio','authToken','accountSid','messages','phone','remote','/api/sms/messages/','/status?token=','token','sid','error','inspect','SmsMessage,\x20%s,\x20%s,\x20%s','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','skebby','https://api.skebby.it/API/v1.0/REST/','password','smsMethod','sender','username','GET','session_key','total_sent','internal_order_id','deliveryReport','afterCreate','connectel','senderString','POST','https://smsapi.connectel.se/api/send/','requestid','read','Missing\x20parameters:\x20authToken','clicksend','xCALLY\x20Motion','format','%s:%s','https://rest.clicksend.com/v3/sms/send','Basic\x20%s','toString','base64','http_code','data','head','message_id','clickSend','Missing\x20parameters:\x20username,\x20password','authId','https://api.plivo.com/v1/Account/%s/Message/','message_uuid','plivo','Missing\x20parameters:\x20authId,\x20authToken','baseUrl','IBSSO\x20','infobip','Missing\x20parameters:\x20base_url','csc','crypto','apiKey','login','timestamp','keys','length','createHash','md5','digest','signature=','/external/get/send.php?','id_sms','clickatell','https://platform.clickatell.com/messages','uuid','apiMessageId','Missing\x20parameters:\x20apiKey','intelepeer','https://api.intelepeer.com/_rest/v4/app/sms/send','Bearer\x20','application/json','message','https://api.intelepeer.com/_rest/v4/app/sms/mdr','refid','status','finally','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','request-promise','rimraf','../../config/environment','./smsMessage.attributes','exports','SmsMessage','sms_messages','messageId','fti_sms_messages','body','FULLTEXT','get','direction','toLowerCase','secret','isNil','UserId','SmsInteraction','findOne','SmsInteractionId','then','update','createdAt','catch','out','SmsAccount'];(function(_0x3c4e4c,_0x36ff70){var _0x144a87=function(_0x5efb4b){while(--_0x5efb4b){_0x3c4e4c['push'](_0x3c4e4c['shift']());}};_0x144a87(++_0x36ff70);}(_0x0aae,0xcd));var _0xe0aa=function(_0x5817cf,_0x52e781){_0x5817cf=_0x5817cf-0x0;var _0x21357f=_0x0aae[_0x5817cf];return _0x21357f;};'use strict';var _=require(_0xe0aa('0x0'));var util=require(_0xe0aa('0x1'));var logger=require(_0xe0aa('0x2'))(_0xe0aa('0x3'));var moment=require(_0xe0aa('0x4'));var BPromise=require('bluebird');var rp=require(_0xe0aa('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xe0aa('0x6'));var config=require(_0xe0aa('0x7'));var attributes=require(_0xe0aa('0x8'));module[_0xe0aa('0x9')]=function(_0x2d4cc0,_0x2c2448){return _0x2d4cc0['define'](_0xe0aa('0xa'),attributes,{'tableName':_0xe0aa('0xb'),'paranoid':![],'indexes':[{'name':_0xe0aa('0xc'),'fields':[_0xe0aa('0xc')]},{'name':_0xe0aa('0xd'),'fields':[_0xe0aa('0xe')],'type':_0xe0aa('0xf')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x5bab98,_0x366896,_0x2e414e){var _0x33f34f=_0x2d4cc0['models'];var _0x5d97e0=_0x5bab98[_0xe0aa('0x10')]({'plain':!![]});if(_0x5d97e0[_0xe0aa('0x11')]['toLowerCase']()==='in'||_0x5d97e0[_0xe0aa('0x11')][_0xe0aa('0x12')]()==='out'&&!_0x5d97e0[_0xe0aa('0x13')]&&!_[_0xe0aa('0x14')](_0x5d97e0[_0xe0aa('0x15')])){_0x33f34f[_0xe0aa('0x16')][_0xe0aa('0x17')]({'where':{'id':_0x5d97e0[_0xe0aa('0x18')]}})[_0xe0aa('0x19')](function(_0x4b5338){if(_0x4b5338){_0x4b5338[_0xe0aa('0x1a')]({'lastMsgAt':_0x5d97e0[_0xe0aa('0x1b')],'lastMsgDirection':_0x5d97e0[_0xe0aa('0x11')][_0xe0aa('0x12')]()});}})[_0xe0aa('0x1c')](function(_0x18d92d){console['error'](_0x18d92d);});}if(_0x5d97e0[_0xe0aa('0x11')]===_0xe0aa('0x1d')&&!_0x5d97e0['secret']){var _0x2afc2c;_0x33f34f[_0xe0aa('0x1e')][_0xe0aa('0x1f')]({'where':{'id':_0x5d97e0['SmsAccountId']},'raw':!![]})[_0xe0aa('0x19')](function(_0x42e868){_0x2afc2c=_0x42e868;if(_0x2afc2c&&_0x2afc2c[_0xe0aa('0x20')]){switch(_0x2afc2c['type']){case _0xe0aa('0x21'):var _0x4b72ce=require(_0xe0aa('0x21'));if(_0x2afc2c['accountSid']&&_0x2afc2c[_0xe0aa('0x22')]&&_0x2afc2c['phone']){var _0x122d5d=new _0x4b72ce(_0x2afc2c[_0xe0aa('0x23')],_0x2afc2c['authToken']);_0x122d5d[_0xe0aa('0x24')]['create']({'body':_0x5d97e0[_0xe0aa('0xe')],'to':_0x5d97e0[_0xe0aa('0x25')],'from':_0x2afc2c[_0xe0aa('0x25')],'statusCallback':_0x2afc2c[_0xe0aa('0x26')]+_0xe0aa('0x27')+_0x5d97e0['id']+_0xe0aa('0x28')+_0x2afc2c[_0xe0aa('0x29')]})['then'](function(_0x3f3476){if(_0x3f3476[_0xe0aa('0x2a')]){return _0x5bab98[_0xe0aa('0x1a')]({'messageId':_0x3f3476[_0xe0aa('0x2a')]});}})[_0xe0aa('0x1c')](function(_0x51d356){logger[_0xe0aa('0x2b')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0xe0aa('0x21'),util[_0xe0aa('0x2c')](_0x51d356,{'showHidden':![],'depth':null}));});}else{logger[_0xe0aa('0x2b')](_0xe0aa('0x2d'),'afterCreate',_0xe0aa('0x21'),_0xe0aa('0x2e'));}break;case _0xe0aa('0x2f'):var _0x37a780=_0xe0aa('0x30');if(_0x2afc2c['username']&&_0x2afc2c[_0xe0aa('0x31')]){var _0x3e6bfa={'recipient':[_0x5d97e0['phone']],'message':_0x5d97e0[_0xe0aa('0xe')],'message_type':_0x2afc2c[_0xe0aa('0x32')]};if(_0x2afc2c[_0xe0aa('0x32')]&&_0x2afc2c[_0xe0aa('0x32')]!=='SI'){_0x3e6bfa[_0xe0aa('0x33')]=_0x2afc2c[_0xe0aa('0x25')];}var _0x7680d1={'url':_0x37a780+'login?username='+_0x2afc2c[_0xe0aa('0x34')]+'&password='+_0x2afc2c['password'],'method':_0xe0aa('0x35')};rp(_0x7680d1)[_0xe0aa('0x19')](function(_0x727037){var _0xfb6b7b=_0x727037['split'](';');var _0x23d635={'user_key':_0xfb6b7b[0x0],'session_key':_0xfb6b7b[0x1]};_0x7680d1={'url':_0x37a780+'sms','method':'POST','headers':{'user_key':_0x23d635['user_key'],'Session_key':_0x23d635[_0xe0aa('0x36')]},'json':!![],'body':_0x3e6bfa};return rp(_0x7680d1);})[_0xe0aa('0x19')](function(_0x24385d){if(_0x24385d[_0xe0aa('0x37')]>=0x1){var _0x46b71e={'messageId':_0x24385d[_0xe0aa('0x38')]};if(_0x2afc2c[_0xe0aa('0x32')]!=='GP'||!_0x2afc2c[_0xe0aa('0x39')]){_0x46b71e['read']=!![];}return _0x5bab98[_0xe0aa('0x1a')](_0x46b71e);}else{return logger['error'](_0xe0aa('0x2d'),'afterCreate',_0xe0aa('0x2f'),util[_0xe0aa('0x2c')](_0x24385d,{'showHidden':![],'depth':null}));}})[_0xe0aa('0x1c')](function(_0x325189){return logger[_0xe0aa('0x2b')](_0xe0aa('0x2d'),'afterCreate',_0xe0aa('0x2f'),util['inspect'](_0x325189,{'showHidden':![],'depth':null}));});}else{logger[_0xe0aa('0x2b')](_0xe0aa('0x2d'),_0xe0aa('0x3a'),_0xe0aa('0x2f'),'Missing\x20parameters:\x20username,\x20password');}break;case _0xe0aa('0x3b'):if(_0x2afc2c[_0xe0aa('0x22')]){var _0x12c158={'recipient':_0x5d97e0[_0xe0aa('0x25')],'message':_0x5d97e0[_0xe0aa('0xe')],'sender':_0x2afc2c[_0xe0aa('0x3c')]||_0x2afc2c[_0xe0aa('0x25')],'authorization':_0x2afc2c['authToken']};var _0x366896={'method':_0xe0aa('0x3d'),'uri':_0xe0aa('0x3e'),'body':_0x12c158,'json':!![]};rp(_0x366896)[_0xe0aa('0x19')](function(_0x16107a){var _0x26e133={'messageId':_0x16107a[_0xe0aa('0x3f')]};if(!_0x2afc2c[_0xe0aa('0x39')]){_0x26e133[_0xe0aa('0x40')]=!![];}return _0x5bab98[_0xe0aa('0x1a')](_0x26e133);})['catch'](function(_0x4b66d5){logger[_0xe0aa('0x2b')](_0xe0aa('0x2d'),_0xe0aa('0x3a'),_0xe0aa('0x3b'),util[_0xe0aa('0x2c')](_0x4b66d5,{'showHidden':![],'depth':null}));});}else{logger[_0xe0aa('0x2b')](_0xe0aa('0x2d'),'afterCreate',_0xe0aa('0x3b'),_0xe0aa('0x41'));}break;case _0xe0aa('0x42'):if(_0x2afc2c['username']&&_0x2afc2c[_0xe0aa('0x31')]){var _0x12c158={'messages':[{'source':_0xe0aa('0x43'),'to':_0x5d97e0[_0xe0aa('0x25')],'body':_0x5d97e0['body'],'from':_0x2afc2c[_0xe0aa('0x3c')]||_0x2afc2c[_0xe0aa('0x25')]}]};var _0x1f9b8b=util[_0xe0aa('0x44')](_0xe0aa('0x45'),_0x2afc2c['username'],_0x2afc2c[_0xe0aa('0x31')]);var _0x366896={'method':_0xe0aa('0x3d'),'uri':_0xe0aa('0x46'),'body':_0x12c158,'headers':{'Authorization':util[_0xe0aa('0x44')](_0xe0aa('0x47'),new Buffer(_0x1f9b8b)[_0xe0aa('0x48')](_0xe0aa('0x49')))},'json':!![]};rp(_0x366896)[_0xe0aa('0x19')](function(_0x30e0a5){if(_0x30e0a5[_0xe0aa('0x4a')]>=0xc8&&_0x30e0a5[_0xe0aa('0x4a')]<=0xce){if(_0x30e0a5[_0xe0aa('0x4b')]&&_0x30e0a5[_0xe0aa('0x4b')]['queued_count']>0x0){var _0x1ae6f3=_[_0xe0aa('0x4c')](_0x30e0a5[_0xe0aa('0x4b')][_0xe0aa('0x24')]);var _0x5c82f5={'messageId':_0x1ae6f3[_0xe0aa('0x4d')]};if(!_0x2afc2c['deliveryReport']){_0x5c82f5[_0xe0aa('0x40')]=!![];}return _0x5bab98[_0xe0aa('0x1a')](_0x5c82f5);}else{logger[_0xe0aa('0x2b')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xe0aa('0x3a'),_0xe0aa('0x4e'),util[_0xe0aa('0x2c')](_0x30e0a5,{'showHidden':![],'depth':null}));}}else{logger['error'](_0xe0aa('0x2d'),_0xe0aa('0x3a'),_0xe0aa('0x4e'),util[_0xe0aa('0x2c')](_0x30e0a5,{'showHidden':![],'depth':null}));}})[_0xe0aa('0x1c')](function(_0x5d512a){logger[_0xe0aa('0x2b')](_0xe0aa('0x2d'),'afterCreate',_0xe0aa('0x4e'),util['inspect'](_0x5d512a,{'showHidden':![],'depth':null}));});}else{logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0xe0aa('0x4e'),_0xe0aa('0x4f'));}break;case'plivo':if(_0x2afc2c[_0xe0aa('0x50')]&&_0x2afc2c[_0xe0aa('0x22')]){var _0x12c158={'dst':_0x5d97e0[_0xe0aa('0x25')],'text':_0x5d97e0[_0xe0aa('0xe')],'src':_0x2afc2c['senderString']||_0x2afc2c[_0xe0aa('0x25')],'url':_0x2afc2c[_0xe0aa('0x26')]+'/api/sms/messages/'+_0x5d97e0['id']+_0xe0aa('0x28')+_0x2afc2c['token']};var _0x1f9b8b=util[_0xe0aa('0x44')]('%s:%s',_0x2afc2c[_0xe0aa('0x50')],_0x2afc2c[_0xe0aa('0x22')]);var _0x366896={'method':_0xe0aa('0x3d'),'uri':util['format'](_0xe0aa('0x51'),_0x2afc2c[_0xe0aa('0x50')]),'body':_0x12c158,'headers':{'Authorization':util[_0xe0aa('0x44')](_0xe0aa('0x47'),new Buffer(_0x1f9b8b)[_0xe0aa('0x48')]('base64'))},'json':!![]};rp(_0x366896)[_0xe0aa('0x19')](function(_0x3447c8){var _0x2a6b82={'messageId':_0x3447c8[_0xe0aa('0x52')][0x0]};return _0x5bab98['update'](_0x2a6b82);})[_0xe0aa('0x1c')](function(_0x481cc5){logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0xe0aa('0x3a'),_0xe0aa('0x53'),util[_0xe0aa('0x2c')](_0x481cc5,{'showHidden':![],'depth':null}));});}else{logger[_0xe0aa('0x2b')](_0xe0aa('0x2d'),'afterCreate',_0xe0aa('0x53'),_0xe0aa('0x54'));}break;case'infobip':if(_0x2afc2c[_0xe0aa('0x34')]&&_0x2afc2c[_0xe0aa('0x31')]){if(_0x2afc2c[_0xe0aa('0x55')]){var _0x142cd3={'method':_0xe0aa('0x3d'),'uri':_0x2afc2c[_0xe0aa('0x55')]+'/auth/1/session','body':{'username':_0x2afc2c[_0xe0aa('0x34')],'password':_0x2afc2c[_0xe0aa('0x31')]},'json':!![]};return rp(_0x142cd3)[_0xe0aa('0x19')](function(_0x2ece10){var _0x455c5f={'method':'POST','uri':_0x2afc2c[_0xe0aa('0x55')]+'/sms/2/text/advanced','body':{'messages':[{'from':_0x2afc2c[_0xe0aa('0x25')],'destinations':[{'to':_0x5d97e0[_0xe0aa('0x25')]}],'text':_0x5d97e0[_0xe0aa('0xe')],'notifyUrl':_0x2afc2c['remote']+_0xe0aa('0x27')+_0x5d97e0['id']+'/status?token='+_0x2afc2c['token'],'notifyContentType':'application/json','callbackData':_0x2afc2c[_0xe0aa('0x25')]+';'+_0x5d97e0[_0xe0aa('0xe')]}]},'headers':{'Authorization':_0xe0aa('0x56')+_0x2ece10[_0xe0aa('0x29')]},'json':!![]};return rp(_0x455c5f)[_0xe0aa('0x19')](function(_0x16572a){if(_0x16572a[_0xe0aa('0x24')]){var _0x32bef2={'messageId':_0x16572a['messages'][0x0][_0xe0aa('0xc')]};if(!_0x2afc2c[_0xe0aa('0x39')]){_0x32bef2[_0xe0aa('0x40')]=!![];}return _0x5bab98[_0xe0aa('0x1a')](_0x32bef2);}else{return logger[_0xe0aa('0x2b')](_0xe0aa('0x2d'),_0xe0aa('0x3a'),'infobip',util[_0xe0aa('0x2c')](_0x16572a,{'showHidden':![],'depth':null}));}});})['catch'](function(_0x71ca9e){return logger[_0xe0aa('0x2b')](_0xe0aa('0x2d'),_0xe0aa('0x3a'),_0xe0aa('0x57'),util[_0xe0aa('0x2c')](_0x71ca9e,{'showHidden':![],'depth':null}));});}else{logger[_0xe0aa('0x2b')](_0xe0aa('0x2d'),_0xe0aa('0x3a'),_0xe0aa('0x57'),_0xe0aa('0x58'));}}else{logger[_0xe0aa('0x2b')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xe0aa('0x3a'),_0xe0aa('0x57'),'Missing\x20parameters:\x20username,\x20password');}break;case _0xe0aa('0x59'):var _0x1dd529=require(_0xe0aa('0x5a'));if(_0x2afc2c[_0xe0aa('0x5b')]){var _0x11105b={};_0x11105b[_0xe0aa('0x5c')]=_0x2afc2c['username'];_0x11105b[_0xe0aa('0x25')]=_0x5d97e0[_0xe0aa('0x25')];_0x11105b[_0xe0aa('0x33')]=_0x2afc2c['phone'];_0x11105b['text']=_0x5d97e0['body'];_0x11105b[_0xe0aa('0x5d')]=+new Date();var _0x3bc302='';var _0x5b93e9='';var _0x132421=Object[_0xe0aa('0x5e')](_0x11105b);_0x132421['sort']();for(var _0x1ad156=0x0;_0x1ad156<_0x132421[_0xe0aa('0x5f')];_0x1ad156++){if(_0x3bc302!=''){_0x3bc302+='&';}_0x3bc302+=_0x132421[_0x1ad156]+'='+encodeURIComponent(_0x11105b[_0x132421[_0x1ad156]]);_0x5b93e9+=_0x11105b[_0x132421[_0x1ad156]];}_0x5b93e9+=_0x2afc2c['apiKey'];_0x5b93e9=_0x1dd529[_0xe0aa('0x60')](_0xe0aa('0x61'))[_0xe0aa('0x1a')](_0x5b93e9)[_0xe0aa('0x62')]('hex');if(_0x3bc302!==''){_0x3bc302+='&';}_0x3bc302+=_0xe0aa('0x63')+_0x5b93e9;var _0x7680d1={'method':_0xe0aa('0x35'),'uri':_0x2afc2c[_0xe0aa('0x55')]+_0xe0aa('0x64')+_0x3bc302,'json':!![]};return rp(_0x7680d1)[_0xe0aa('0x19')](function(_0x3b983e){var _0x2aef17=Object[_0xe0aa('0x5e')](_0x3b983e);if(_0x3b983e[_0x2aef17[0x0]][_0xe0aa('0x2b')]&&parseInt(_0x3b983e[_0x2aef17[0x0]][_0xe0aa('0x2b')])===0x0){var _0x3537bd={'messageId':_0x3b983e[_0x2aef17[0x0]][_0xe0aa('0x65')]};if(!_0x2afc2c[_0xe0aa('0x39')]){_0x3537bd[_0xe0aa('0x40')]=!![];}return _0x5bab98[_0xe0aa('0x1a')](_0x3537bd);}else{return logger[_0xe0aa('0x2b')](_0xe0aa('0x2d'),_0xe0aa('0x3a'),_0xe0aa('0x59'),util['inspect'](_0x3b983e['error'],{'showHidden':![],'depth':null}));}})['catch'](function(_0x4e4d3a){return logger[_0xe0aa('0x2b')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xe0aa('0x3a'),_0xe0aa('0x59'),util[_0xe0aa('0x2c')](_0x4e4d3a,{'showHidden':![],'depth':null}));});}else{logger[_0xe0aa('0x2b')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xe0aa('0x3a'),_0xe0aa('0x59'),'Missing\x20parameters:\x20apiKey');}break;case _0xe0aa('0x66'):if(_0x2afc2c[_0xe0aa('0x5b')]){var _0x485f2b={'method':'POST','uri':_0xe0aa('0x67'),'headers':{'Authorization':_0x2afc2c[_0xe0aa('0x5b')]},'body':{'content':_0x5d97e0[_0xe0aa('0xe')],'to':[_0x5d97e0[_0xe0aa('0x25')]],'from':_0x2afc2c['phone'],'binary':![],'clientMessageId':_0xe0aa('0x68'),'charset':'UTF-8'},'json':!![]};rp(_0x485f2b)['then'](function(_0x47ded9){if(!_0x47ded9['error']){var _0x33209c={'messageId':_0x47ded9['messages'][0x0][_0xe0aa('0x69')]};if(!_0x2afc2c[_0xe0aa('0x39')]){_0x33209c[_0xe0aa('0x40')]=!![];}return _0x5bab98[_0xe0aa('0x1a')](_0x33209c);}else{return logger[_0xe0aa('0x2b')](_0xe0aa('0x2d'),_0xe0aa('0x3a'),'clickatell',util[_0xe0aa('0x2c')](_0x47ded9[_0xe0aa('0x2b')],{'showHidden':![],'depth':null}));}})[_0xe0aa('0x1c')](function(_0x20b058){return logger[_0xe0aa('0x2b')](_0xe0aa('0x2d'),_0xe0aa('0x3a'),_0xe0aa('0x66'),util[_0xe0aa('0x2c')](_0x20b058,{'showHidden':![],'depth':null}));});}else{logger[_0xe0aa('0x2b')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xe0aa('0x3a'),'clickatell',_0xe0aa('0x6a'));}break;case _0xe0aa('0x6b'):if(_0x2afc2c[_0xe0aa('0x5b')]){var _0x21e4b4={};var _0x7680d1={'method':'POST','uri':_0xe0aa('0x6c'),'headers':{'Authorization':_0xe0aa('0x6d')+_0x2afc2c['apiKey'],'Content-Type':_0xe0aa('0x6e')},'body':{'from':_0x2afc2c[_0xe0aa('0x25')],'to':_0x5d97e0['phone'],'text':_0x5d97e0[_0xe0aa('0xe')]},'json':!![]};return rp(_0x7680d1)[_0xe0aa('0x19')](function(_0x30f7e8){if(_0x30f7e8['code']==0xca){_0x21e4b4[_0xe0aa('0x6f')]=_0x30f7e8;var _0x2e5b77={'method':_0xe0aa('0x3d'),'uri':_0xe0aa('0x70'),'headers':{'Authorization':'Bearer\x20'+_0x2afc2c[_0xe0aa('0x5b')],'Content-Type':_0xe0aa('0x6e')},'body':{'refid':_0x21e4b4['message'][_0xe0aa('0x71')]},'json':!![]};return rp(_0x2e5b77)['then'](function(_0x38ac2c){_0x21e4b4[_0xe0aa('0x72')]=_0x38ac2c;var _0xe9e1ac={'messageId':_0x21e4b4[_0xe0aa('0x6f')][_0xe0aa('0x71')],'read':!![]};return _0x5bab98[_0xe0aa('0x1a')](_0xe9e1ac);});}else{return logger['error'](_0xe0aa('0x2d'),_0xe0aa('0x3a'),_0xe0aa('0x6b'),util[_0xe0aa('0x2c')](_0x30f7e8,{'showHidden':![],'depth':null}));}})[_0xe0aa('0x1c')](function(_0x5f1d61){return logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0xe0aa('0x3a'),_0xe0aa('0x6b'),util[_0xe0aa('0x2c')](_0x5f1d61,{'showHidden':![],'depth':null}));});}else{return logger[_0xe0aa('0x2b')](_0xe0aa('0x2d'),_0xe0aa('0x3a'),_0xe0aa('0x6b'),'Token\x20not\x20received');}break;}}})[_0xe0aa('0x73')](function(){_0x2e414e();});}else{_0x2e414e();}}},'charset':_0xe0aa('0x74'),'collate':_0xe0aa('0x75')});};
\ No newline at end of file
diff --git a/server/api/smsMessage/smsMessage.rpc.js b/server/api/smsMessage/smsMessage.rpc.js
index 8528994..43a518a 100644
--- a/server/api/smsMessage/smsMessage.rpc.js
+++ b/server/api/smsMessage/smsMessage.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xb10b=['options','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','localhost','socket.io-emitter','./smsMessage.socket','register','request','then','info','request\x20sent','debug','SmsMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','SmsMessage,\x20%s,\x20%s','message','result','catch','CreateSmsMessage','SmsMessage','body'];(function(_0x8740c3,_0xddd750){var _0x10d404=function(_0x3360a4){while(--_0x3360a4){_0x8740c3['push'](_0x8740c3['shift']());}};_0x10d404(++_0xddd750);}(_0xb10b,0x12a));var _0xbb10=function(_0x21f28f,_0x3be6b8){_0x21f28f=_0x21f28f-0x0;var _0x180f21=_0xb10b[_0x21f28f];return _0x180f21;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var moment=require(_0xbb10('0x1'));var BPromise=require(_0xbb10('0x2'));var rs=require(_0xbb10('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbb10('0x4'))['db'];var utils=require(_0xbb10('0x5'));var logger=require(_0xbb10('0x6'))(_0xbb10('0x7'));var config=require(_0xbb10('0x8'));var jayson=require(_0xbb10('0x9'));var client=jayson['client'][_0xbb10('0xa')]({'port':0x232a});config[_0xbb10('0xb')]=_['defaults'](config[_0xbb10('0xb')],{'host':_0xbb10('0xc'),'port':0x18eb});var socket=require(_0xbb10('0xd'))(new Redis(config[_0xbb10('0xb')]));require(_0xbb10('0xe'))[_0xbb10('0xf')](socket);function respondWithRpcPromise(_0x229887,_0xa3adc8,_0x5ab04a){return new BPromise(function(_0x4e47f8,_0x20bd61){return client[_0xbb10('0x10')](_0x229887,_0x5ab04a)[_0xbb10('0x11')](function(_0x5e136d){logger[_0xbb10('0x12')]('SmsMessage,\x20%s,\x20%s',_0xa3adc8,_0xbb10('0x13'));logger[_0xbb10('0x14')](_0xbb10('0x15'),_0xa3adc8,_0xbb10('0x13'),JSON[_0xbb10('0x16')](_0x5e136d));if(_0x5e136d[_0xbb10('0x17')]){if(_0x5e136d['error'][_0xbb10('0x18')]===0x1f4){logger[_0xbb10('0x17')](_0xbb10('0x19'),_0xa3adc8,_0x5e136d[_0xbb10('0x17')][_0xbb10('0x1a')]);return _0x20bd61(_0x5e136d[_0xbb10('0x17')][_0xbb10('0x1a')]);}logger[_0xbb10('0x17')](_0xbb10('0x19'),_0xa3adc8,_0x5e136d[_0xbb10('0x17')]['message']);return _0x4e47f8(_0x5e136d[_0xbb10('0x17')][_0xbb10('0x1a')]);}else{logger[_0xbb10('0x12')](_0xbb10('0x19'),_0xa3adc8,_0xbb10('0x13'));_0x4e47f8(_0x5e136d[_0xbb10('0x1b')][_0xbb10('0x1a')]);}})[_0xbb10('0x1c')](function(_0xbf2906){logger[_0xbb10('0x17')]('SmsMessage,\x20%s,\x20%s',_0xa3adc8,_0xbf2906);_0x20bd61(_0xbf2906);});});}exports[_0xbb10('0x1d')]=function(_0x19f48d){var _0x388fab=this;return new Promise(function(_0x109908,_0xdf237d){return db[_0xbb10('0x1e')]['create'](_0x19f48d[_0xbb10('0x1f')],{'raw':_0x19f48d[_0xbb10('0x20')]?_0x19f48d['options']['raw']===undefined?!![]:![]:!![]})[_0xbb10('0x11')](function(_0x311abe){logger[_0xbb10('0x12')](_0xbb10('0x1d'),_0x19f48d);logger[_0xbb10('0x14')](_0xbb10('0x1d'),_0x19f48d,JSON[_0xbb10('0x16')](_0x311abe));_0x109908(_0x311abe);})[_0xbb10('0x1c')](function(_0x7f2377){logger[_0xbb10('0x17')](_0xbb10('0x1d'),_0x7f2377[_0xbb10('0x1a')],_0x19f48d);_0xdf237d(_0x388fab['error'](0x1f4,_0x7f2377['message']));});});};
\ No newline at end of file
+var _0x5f2f=['SmsMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','SmsMessage','create','options','raw','CreateSmsMessage','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','then','SmsMessage,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x433c9c,_0x32024f){var _0x47ff2d=function(_0x5c5b6f){while(--_0x5c5b6f){_0x433c9c['push'](_0x433c9c['shift']());}};_0x47ff2d(++_0x32024f);}(_0x5f2f,0x73));var _0xf5f2=function(_0x2afe95,_0x3d01e1){_0x2afe95=_0x2afe95-0x0;var _0x11cd87=_0x5f2f[_0x2afe95];return _0x11cd87;};'use strict';var _=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var moment=require(_0xf5f2('0x2'));var BPromise=require(_0xf5f2('0x3'));var rs=require(_0xf5f2('0x4'));var fs=require('fs');var Redis=require(_0xf5f2('0x5'));var db=require(_0xf5f2('0x6'))['db'];var utils=require(_0xf5f2('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0xf5f2('0x8'));var jayson=require(_0xf5f2('0x9'));var client=jayson[_0xf5f2('0xa')][_0xf5f2('0xb')]({'port':0x232a});config[_0xf5f2('0xc')]=_[_0xf5f2('0xd')](config['redis'],{'host':_0xf5f2('0xe'),'port':0x18eb});var socket=require(_0xf5f2('0xf'))(new Redis(config[_0xf5f2('0xc')]));require('./smsMessage.socket')[_0xf5f2('0x10')](socket);function respondWithRpcPromise(_0x15dd7c,_0x218ae3,_0x4e0e6b){return new BPromise(function(_0x977a59,_0x4ebbbe){return client['request'](_0x15dd7c,_0x4e0e6b)[_0xf5f2('0x11')](function(_0x151aba){logger['info'](_0xf5f2('0x12'),_0x218ae3,_0xf5f2('0x13'));logger[_0xf5f2('0x14')](_0xf5f2('0x15'),_0x218ae3,_0xf5f2('0x13'),JSON[_0xf5f2('0x16')](_0x151aba));if(_0x151aba['error']){if(_0x151aba[_0xf5f2('0x17')][_0xf5f2('0x18')]===0x1f4){logger[_0xf5f2('0x17')](_0xf5f2('0x12'),_0x218ae3,_0x151aba[_0xf5f2('0x17')]['message']);return _0x4ebbbe(_0x151aba[_0xf5f2('0x17')][_0xf5f2('0x19')]);}logger[_0xf5f2('0x17')](_0xf5f2('0x12'),_0x218ae3,_0x151aba[_0xf5f2('0x17')][_0xf5f2('0x19')]);return _0x977a59(_0x151aba[_0xf5f2('0x17')][_0xf5f2('0x19')]);}else{logger[_0xf5f2('0x1a')](_0xf5f2('0x12'),_0x218ae3,_0xf5f2('0x13'));_0x977a59(_0x151aba[_0xf5f2('0x1b')][_0xf5f2('0x19')]);}})[_0xf5f2('0x1c')](function(_0x3cf5ea){logger[_0xf5f2('0x17')](_0xf5f2('0x12'),_0x218ae3,_0x3cf5ea);_0x4ebbbe(_0x3cf5ea);});});}exports['CreateSmsMessage']=function(_0x34706d){var _0x47101e=this;return new Promise(function(_0x49dac2,_0x47acfc){return db[_0xf5f2('0x1d')][_0xf5f2('0x1e')](_0x34706d['body'],{'raw':_0x34706d[_0xf5f2('0x1f')]?_0x34706d[_0xf5f2('0x1f')][_0xf5f2('0x20')]===undefined?!![]:![]:!![]})[_0xf5f2('0x11')](function(_0x36f1cb){logger['info'](_0xf5f2('0x21'),_0x34706d);logger[_0xf5f2('0x14')](_0xf5f2('0x21'),_0x34706d,JSON[_0xf5f2('0x16')](_0x36f1cb));_0x49dac2(_0x36f1cb);})[_0xf5f2('0x1c')](function(_0x5bdf4a){logger['error'](_0xf5f2('0x21'),_0x5bdf4a[_0xf5f2('0x19')],_0x34706d);_0x47acfc(_0x47101e[_0xf5f2('0x17')](0x1f4,_0x5bdf4a[_0xf5f2('0x19')]));});});};
\ No newline at end of file
diff --git a/server/api/smsMessage/smsMessage.socket.js b/server/api/smsMessage/smsMessage.socket.js
index 0b553eb..4919a3e 100644
--- a/server/api/smsMessage/smsMessage.socket.js
+++ b/server/api/smsMessage/smsMessage.socket.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xab57=['./smsMessage.events','remove','update','emit','removeListener','length','smsMessage:'];(function(_0x30099e,_0x1ee4b2){var _0x474f63=function(_0x26f35a){while(--_0x26f35a){_0x30099e['push'](_0x30099e['shift']());}};_0x474f63(++_0x1ee4b2);}(_0xab57,0x85));var _0x7ab5=function(_0x5a1dd1,_0x2c5539){_0x5a1dd1=_0x5a1dd1-0x0;var _0x423002=_0xab57[_0x5a1dd1];return _0x423002;};'use strict';var SmsMessageEvents=require(_0x7ab5('0x0'));var events=['save',_0x7ab5('0x1'),_0x7ab5('0x2')];function createListener(_0x3bf1f2,_0x111061){return function(_0x2fb878){_0x111061[_0x7ab5('0x3')](_0x3bf1f2,_0x2fb878);};}function removeListener(_0xb6ac21,_0x512e2a){return function(){SmsMessageEvents[_0x7ab5('0x4')](_0xb6ac21,_0x512e2a);};}exports['register']=function(_0x3e3129){for(var _0x21d45d=0x0,_0x1021c7=events[_0x7ab5('0x5')];_0x21d45d<_0x1021c7;_0x21d45d++){var _0x5227cf=events[_0x21d45d];var _0x3c0413=createListener(_0x7ab5('0x6')+_0x5227cf,_0x3e3129);SmsMessageEvents['on'](_0x5227cf,_0x3c0413);}};
\ No newline at end of file
+var _0x51ef=['remove','emit','removeListener','smsMessage:','save'];(function(_0x5cce47,_0x4aa021){var _0x45b943=function(_0x3858aa){while(--_0x3858aa){_0x5cce47['push'](_0x5cce47['shift']());}};_0x45b943(++_0x4aa021);}(_0x51ef,0x1d0));var _0xf51e=function(_0xaa2422,_0x1bf447){_0xaa2422=_0xaa2422-0x0;var _0x28bab9=_0x51ef[_0xaa2422];return _0x28bab9;};'use strict';var SmsMessageEvents=require('./smsMessage.events');var events=[_0xf51e('0x0'),_0xf51e('0x1'),'update'];function createListener(_0x2511d1,_0x424652){return function(_0x16acb2){_0x424652[_0xf51e('0x2')](_0x2511d1,_0x16acb2);};}function removeListener(_0x9ad1cb,_0x5c215d){return function(){SmsMessageEvents[_0xf51e('0x3')](_0x9ad1cb,_0x5c215d);};}exports['register']=function(_0x19233e){for(var _0x53d8cc=0x0,_0x56f271=events['length'];_0x53d8cc<_0x56f271;_0x53d8cc++){var _0x4f1057=events[_0x53d8cc];var _0x14fc6b=createListener(_0xf51e('0x4')+_0x4f1057,_0x19233e);SmsMessageEvents['on'](_0x4f1057,_0x14fc6b);}};
\ No newline at end of file
diff --git a/server/api/smsQueue/index.js b/server/api/smsQueue/index.js
index 8448e54..5de18ca 100644
--- a/server/api/smsQueue/index.js
+++ b/server/api/smsQueue/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xe1d3=['getAgents','post','addTeams','addAgents','put','delete','destroy','removeTeams','removeAgents','multer','util','path','connect-timeout','express','../../components/auth/service','../../config/environment','./smsQueue.controller','index','get','/describe','isAuthenticated','describe','/:id','/:id/members','getMembers','/:id/teams','getTeams','/:id/users'];(function(_0x4fdc84,_0x1dee7c){var _0x17c9eb=function(_0x4d80bd){while(--_0x4d80bd){_0x4fdc84['push'](_0x4fdc84['shift']());}};_0x17c9eb(++_0x1dee7c);}(_0xe1d3,0x159));var _0x3e1d=function(_0x3fb184,_0x30eed8){_0x3fb184=_0x3fb184-0x0;var _0xfd64ae=_0xe1d3[_0x3fb184];return _0xfd64ae;};'use strict';var multer=require(_0x3e1d('0x0'));var util=require(_0x3e1d('0x1'));var path=require(_0x3e1d('0x2'));var timeout=require(_0x3e1d('0x3'));var express=require(_0x3e1d('0x4'));var router=express['Router']();var auth=require(_0x3e1d('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x3e1d('0x6'));var controller=require(_0x3e1d('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0x3e1d('0x8')]);router[_0x3e1d('0x9')](_0x3e1d('0xa'),auth[_0x3e1d('0xb')](),controller[_0x3e1d('0xc')]);router['get'](_0x3e1d('0xd'),auth[_0x3e1d('0xb')](),controller['show']);router[_0x3e1d('0x9')](_0x3e1d('0xe'),auth[_0x3e1d('0xb')](),controller[_0x3e1d('0xf')]);router[_0x3e1d('0x9')](_0x3e1d('0x10'),auth[_0x3e1d('0xb')](),controller[_0x3e1d('0x11')]);router[_0x3e1d('0x9')](_0x3e1d('0x12'),auth[_0x3e1d('0xb')](),controller[_0x3e1d('0x13')]);router[_0x3e1d('0x14')]('/',auth[_0x3e1d('0xb')](),controller['create']);router[_0x3e1d('0x14')](_0x3e1d('0x10'),auth['isAuthenticated'](),controller[_0x3e1d('0x15')]);router[_0x3e1d('0x14')]('/:id/users',auth[_0x3e1d('0xb')](),controller[_0x3e1d('0x16')]);router[_0x3e1d('0x17')](_0x3e1d('0xd'),auth[_0x3e1d('0xb')](),controller['update']);router[_0x3e1d('0x18')](_0x3e1d('0xd'),auth['isAuthenticated'](),controller[_0x3e1d('0x19')]);router[_0x3e1d('0x18')]('/:id/teams',auth[_0x3e1d('0xb')](),controller[_0x3e1d('0x1a')]);router[_0x3e1d('0x18')](_0x3e1d('0x12'),auth[_0x3e1d('0xb')](),controller[_0x3e1d('0x1b')]);module['exports']=router;
\ No newline at end of file
+var _0x56b9=['/:id/members','/:id/teams','getTeams','getAgents','post','create','addTeams','/:id/users','addAgents','put','update','delete','destroy','removeTeams','removeAgents','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','./smsQueue.controller','get','isAuthenticated','/describe','describe','/:id','show'];(function(_0x3c2a69,_0x4c8b41){var _0x596bc8=function(_0x1b4b7c){while(--_0x1b4b7c){_0x3c2a69['push'](_0x3c2a69['shift']());}};_0x596bc8(++_0x4c8b41);}(_0x56b9,0x196));var _0x956b=function(_0x5d16ed,_0x211a45){_0x5d16ed=_0x5d16ed-0x0;var _0x107f5d=_0x56b9[_0x5d16ed];return _0x107f5d;};'use strict';var multer=require(_0x956b('0x0'));var util=require(_0x956b('0x1'));var path=require(_0x956b('0x2'));var timeout=require(_0x956b('0x3'));var express=require(_0x956b('0x4'));var router=express[_0x956b('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0x956b('0x6'));var config=require('../../config/environment');var controller=require(_0x956b('0x7'));router[_0x956b('0x8')]('/',auth[_0x956b('0x9')](),controller['index']);router[_0x956b('0x8')](_0x956b('0xa'),auth[_0x956b('0x9')](),controller[_0x956b('0xb')]);router[_0x956b('0x8')](_0x956b('0xc'),auth[_0x956b('0x9')](),controller[_0x956b('0xd')]);router['get'](_0x956b('0xe'),auth[_0x956b('0x9')](),controller['getMembers']);router[_0x956b('0x8')](_0x956b('0xf'),auth[_0x956b('0x9')](),controller[_0x956b('0x10')]);router[_0x956b('0x8')]('/:id/users',auth[_0x956b('0x9')](),controller[_0x956b('0x11')]);router[_0x956b('0x12')]('/',auth[_0x956b('0x9')](),controller[_0x956b('0x13')]);router[_0x956b('0x12')](_0x956b('0xf'),auth[_0x956b('0x9')](),controller[_0x956b('0x14')]);router[_0x956b('0x12')](_0x956b('0x15'),auth['isAuthenticated'](),controller[_0x956b('0x16')]);router[_0x956b('0x17')](_0x956b('0xc'),auth['isAuthenticated'](),controller[_0x956b('0x18')]);router[_0x956b('0x19')](_0x956b('0xc'),auth[_0x956b('0x9')](),controller[_0x956b('0x1a')]);router[_0x956b('0x19')](_0x956b('0xf'),auth['isAuthenticated'](),controller[_0x956b('0x1b')]);router[_0x956b('0x19')](_0x956b('0x15'),auth['isAuthenticated'](),controller[_0x956b('0x1c')]);module[_0x956b('0x1d')]=router;
\ No newline at end of file
diff --git a/server/api/smsQueue/smsQueue.attributes.js b/server/api/smsQueue/smsQueue.attributes.js
index 8a0e0c4..38c91d7 100644
--- a/server/api/smsQueue/smsQueue.attributes.js
+++ b/server/api/smsQueue/smsQueue.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xf0ad=['roundrobin','sequelize','exports','STRING','name','INTEGER','ENUM','rrmemory','beepall'];(function(_0x524bf9,_0x47462b){var _0x550148=function(_0x1589b1){while(--_0x1589b1){_0x524bf9['push'](_0x524bf9['shift']());}};_0x550148(++_0x47462b);}(_0xf0ad,0xfd));var _0xdf0a=function(_0xd1c39b,_0x16f0c6){_0xd1c39b=_0xd1c39b-0x0;var _0x58f5bc=_0xf0ad[_0xd1c39b];return _0x58f5bc;};'use strict';var Sequelize=require(_0xdf0a('0x0'));module[_0xdf0a('0x1')]={'name':{'type':Sequelize[_0xdf0a('0x2')],'unique':_0xdf0a('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xdf0a('0x2')]},'timeout':{'type':Sequelize[_0xdf0a('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xdf0a('0x5')](_0xdf0a('0x6'),_0xdf0a('0x7'),_0xdf0a('0x8'))}};
\ No newline at end of file
+var _0x8dd5=['exports','name','STRING','INTEGER','ENUM','beepall'];(function(_0x326047,_0x528a22){var _0x6aee02=function(_0x4d9052){while(--_0x4d9052){_0x326047['push'](_0x326047['shift']());}};_0x6aee02(++_0x528a22);}(_0x8dd5,0x90));var _0x58dd=function(_0x270a54,_0x307ff6){_0x270a54=_0x270a54-0x0;var _0x4d07d0=_0x8dd5[_0x270a54];return _0x4d07d0;};'use strict';var Sequelize=require('sequelize');module[_0x58dd('0x0')]={'name':{'type':Sequelize['STRING'],'unique':_0x58dd('0x1'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x58dd('0x2')]},'timeout':{'type':Sequelize[_0x58dd('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x58dd('0x4')]('rrmemory',_0x58dd('0x5'),'roundrobin')}};
\ No newline at end of file
diff --git a/server/api/smsQueue/smsQueue.controller.js b/server/api/smsQueue/smsQueue.controller.js
index 558f466..c08cae7 100644
--- a/server/api/smsQueue/smsQueue.controller.js
+++ b/server/api/smsQueue/smsQueue.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x449d=['removeAgents','isArray','getAgents','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','lodash','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','localhost','./smsQueue.socket','sendStatus','status','end','json','offset','set','Content-Range','apply','reject','save','update','then','destroy','get','UserProfileResource','name','send','index','map','SmsQueue','rawAttributes','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','sort','where','filter','merge','options','count','includeAll','findAll','catch','params','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','SmsQueues','UserProfileSection','userProfileId','autoAssociation','error','describe','order','UserSmsQueue','User','findAndCountAll','UserId','agent','smsPause','updatedAt','rows','%s/%s','createdAt','getTeams','findOne','pick','addTeams','ids','Team','Agents','online','voicePause','interface','flatMap','transaction','each','findOrCreate','userSmsQueue:save','removeTeams','tq.TeamId','from','team_has_sms_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','SmsQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','sequelize','toString','QueryTypes','SELECT','TeamId','includes','all','union','compact','value','isEmpty','forEach','emit','userSmsQueue:remove','addAgents','omit'];(function(_0x3511d3,_0x4107ae){var _0x5d6321=function(_0x1a23da){while(--_0x1a23da){_0x3511d3['push'](_0x3511d3['shift']());}};_0x5d6321(++_0x4107ae);}(_0x449d,0x8a));var _0xd449=function(_0x508786,_0x26e090){_0x508786=_0x508786-0x0;var _0x2c9780=_0x449d[_0x508786];return _0x2c9780;};'use strict';var pdf=require(_0xd449('0x0'));var emlformat=require(_0xd449('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xd449('0x2'));var jsonpatch=require(_0xd449('0x3'));var rp=require(_0xd449('0x4'));var moment=require(_0xd449('0x5'));var BPromise=require(_0xd449('0x6'));var Mustache=require(_0xd449('0x7'));var util=require(_0xd449('0x8'));var path=require('path');var sox=require(_0xd449('0x9'));var csv=require(_0xd449('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xd449('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xd449('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xd449('0xa'));var querystring=require('querystring');var Papa=require(_0xd449('0xd'));var Redis=require(_0xd449('0xe'));var authService=require(_0xd449('0xf'));var qs=require(_0xd449('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xd449('0x11'))(_0xd449('0x12'));var utils=require('../../config/utils');var config=require(_0xd449('0x13'));var db=require(_0xd449('0x14'))['db'];config[_0xd449('0x15')]=_['defaults'](config['redis'],{'host':_0xd449('0x16'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xd449('0x15')]));require(_0xd449('0x17'))['register'](socket);function respondWithStatusCode(_0x236b7c,_0x43dc63){_0x43dc63=_0x43dc63||0xcc;return function(_0x13da9e){if(_0x13da9e){return _0x236b7c[_0xd449('0x18')](_0x43dc63);}return _0x236b7c[_0xd449('0x19')](_0x43dc63)[_0xd449('0x1a')]();};}function respondWithResult(_0x393865,_0x11bb55){_0x11bb55=_0x11bb55||0xc8;return function(_0x2efb75){if(_0x2efb75){return _0x393865['status'](_0x11bb55)[_0xd449('0x1b')](_0x2efb75);}};}function respondWithFilteredResult(_0x5646f3,_0x3004e3){return function(_0x493a7a){if(_0x493a7a){var _0x5cdaa0=_0x493a7a['count'],_0x11a71c=_0x3004e3[_0xd449('0x1c')],_0x9f2434=_0x3004e3[_0xd449('0x1c')]+_0x3004e3['limit'],_0x2e3db4;if(_0x9f2434>=_0x5cdaa0){_0x9f2434=_0x5cdaa0;_0x2e3db4=0xc8;}else{_0x2e3db4=0xce;}_0x5646f3[_0xd449('0x19')](_0x2e3db4);return _0x5646f3[_0xd449('0x1d')](_0xd449('0x1e'),_0x11a71c+'-'+_0x9f2434+'/'+_0x5cdaa0)['json'](_0x493a7a);}return null;};}function patchUpdates(_0x4bf286){return function(_0x1733bf){try{jsonpatch[_0xd449('0x1f')](_0x1733bf,_0x4bf286,!![]);}catch(_0x3beb88){return BPromise[_0xd449('0x20')](_0x3beb88);}return _0x1733bf[_0xd449('0x21')]();};}function saveUpdates(_0x7c7db9,_0x53ced5){return function(_0x1bb550){if(_0x1bb550){return _0x1bb550[_0xd449('0x22')](_0x7c7db9)[_0xd449('0x23')](function(_0x3b0c0f){return _0x3b0c0f;});}return null;};}function removeEntity(_0xe3d936,_0x33ec0d){return function(_0x27836d){if(_0x27836d){return _0x27836d[_0xd449('0x24')]()[_0xd449('0x23')](function(){var _0x45b3df=_0x27836d[_0xd449('0x25')]({'plain':!![]});var _0x22ddb2='SmsQueues';return db[_0xd449('0x26')][_0xd449('0x24')]({'where':{'type':_0x22ddb2,'resourceId':_0x45b3df['id']}})['then'](function(){return _0x27836d;});})['then'](function(){_0xe3d936[_0xd449('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3f7fb9,_0x241fdc){return function(_0x28a866){if(!_0x28a866){_0x3f7fb9[_0xd449('0x18')](0x194);}return _0x28a866;};}function handleError(_0x397a94,_0x70fed0){_0x70fed0=_0x70fed0||0x1f4;return function(_0x4bc0c7){logger['error'](_0x4bc0c7['stack']);if(_0x4bc0c7[_0xd449('0x27')]){delete _0x4bc0c7[_0xd449('0x27')];}_0x397a94[_0xd449('0x19')](_0x70fed0)[_0xd449('0x28')](_0x4bc0c7);};}exports[_0xd449('0x29')]=function(_0x121d91,_0x1eb131){var _0x464f9f={},_0x2a0f2f={},_0x2c7dc0={'count':0x0,'rows':[]};var _0x81537e=_[_0xd449('0x2a')](db[_0xd449('0x2b')][_0xd449('0x2c')],function(_0x177184){return{'name':_0x177184['fieldName'],'type':_0x177184[_0xd449('0x2d')][_0xd449('0x2e')]};});_0x2a0f2f[_0xd449('0x2f')]=_[_0xd449('0x2a')](_0x81537e,_0xd449('0x27'));_0x2a0f2f['query']=_[_0xd449('0x30')](_0x121d91[_0xd449('0x31')]);_0x2a0f2f[_0xd449('0x32')]=_[_0xd449('0x33')](_0x2a0f2f[_0xd449('0x2f')],_0x2a0f2f[_0xd449('0x31')]);_0x464f9f[_0xd449('0x34')]=_[_0xd449('0x33')](_0x2a0f2f['model'],qs[_0xd449('0x35')](_0x121d91[_0xd449('0x31')][_0xd449('0x35')]));_0x464f9f[_0xd449('0x34')]=_0x464f9f[_0xd449('0x34')][_0xd449('0x36')]?_0x464f9f[_0xd449('0x34')]:_0x2a0f2f[_0xd449('0x2f')];if(!_0x121d91[_0xd449('0x31')][_0xd449('0x37')](_0xd449('0x38'))){_0x464f9f[_0xd449('0x39')]=qs[_0xd449('0x39')](_0x121d91[_0xd449('0x31')][_0xd449('0x39')]);_0x464f9f[_0xd449('0x1c')]=qs['offset'](_0x121d91[_0xd449('0x31')][_0xd449('0x1c')]);}_0x464f9f['order']=qs[_0xd449('0x3a')](_0x121d91['query'][_0xd449('0x3a')]);_0x464f9f[_0xd449('0x3b')]=qs[_0xd449('0x32')](_['pick'](_0x121d91[_0xd449('0x31')],_0x2a0f2f[_0xd449('0x32')]),_0x81537e);if(_0x121d91[_0xd449('0x31')][_0xd449('0x3c')]){_0x464f9f[_0xd449('0x3b')]=_[_0xd449('0x3d')](_0x464f9f[_0xd449('0x3b')],{'$or':_[_0xd449('0x2a')](_0x81537e,function(_0x538ace){if(_0x538ace[_0xd449('0x2d')]!=='VIRTUAL'){var _0x212d4e={};_0x212d4e[_0x538ace[_0xd449('0x27')]]={'$like':'%'+_0x121d91[_0xd449('0x31')][_0xd449('0x3c')]+'%'};return _0x212d4e;}})});}_0x464f9f=_[_0xd449('0x3d')]({},_0x464f9f,_0x121d91[_0xd449('0x3e')]);var _0x5a8807={'where':_0x464f9f['where']};return db['SmsQueue']['count'](_0x5a8807)[_0xd449('0x23')](function(_0x5d939d){_0x2c7dc0[_0xd449('0x3f')]=_0x5d939d;if(_0x121d91[_0xd449('0x31')][_0xd449('0x40')]){_0x464f9f['include']=[{'all':!![]}];}return db[_0xd449('0x2b')][_0xd449('0x41')](_0x464f9f);})[_0xd449('0x23')](function(_0x33bdc6){_0x2c7dc0['rows']=_0x33bdc6;return _0x2c7dc0;})[_0xd449('0x23')](respondWithFilteredResult(_0x1eb131,_0x464f9f))[_0xd449('0x42')](handleError(_0x1eb131,null));};exports['show']=function(_0x4966bc,_0x201952){var _0xb0d9ae={'raw':!![],'where':{'id':_0x4966bc[_0xd449('0x43')]['id']}},_0x3bc91c={};_0x3bc91c['model']=_['keys'](db['SmsQueue'][_0xd449('0x2c')]);_0x3bc91c[_0xd449('0x31')]=_['keys'](_0x4966bc[_0xd449('0x31')]);_0x3bc91c[_0xd449('0x32')]=_['intersection'](_0x3bc91c[_0xd449('0x2f')],_0x3bc91c[_0xd449('0x31')]);_0xb0d9ae[_0xd449('0x34')]=_[_0xd449('0x33')](_0x3bc91c[_0xd449('0x2f')],qs[_0xd449('0x35')](_0x4966bc[_0xd449('0x31')][_0xd449('0x35')]));_0xb0d9ae[_0xd449('0x34')]=_0xb0d9ae[_0xd449('0x34')][_0xd449('0x36')]?_0xb0d9ae[_0xd449('0x34')]:_0x3bc91c[_0xd449('0x2f')];if(_0x4966bc[_0xd449('0x31')][_0xd449('0x40')]){_0xb0d9ae['include']=[{'all':!![]}];}_0xb0d9ae=_[_0xd449('0x3d')]({},_0xb0d9ae,_0x4966bc['options']);return db['SmsQueue'][_0xd449('0x44')](_0xb0d9ae)['then'](handleEntityNotFound(_0x201952,null))[_0xd449('0x23')](respondWithResult(_0x201952,null))[_0xd449('0x42')](handleError(_0x201952,null));};exports['create']=function(_0x4e5a3f,_0x45b2b8){return db['SmsQueue'][_0xd449('0x45')](_0x4e5a3f[_0xd449('0x46')],{})[_0xd449('0x23')](function(_0x1ce097){var _0x14816e=_0x4e5a3f['user'][_0xd449('0x25')]({'plain':!![]});if(!_0x14816e)throw new Error(_0xd449('0x47'));if(_0x14816e['role']===_0xd449('0x48')){var _0x4d109e=_0x1ce097[_0xd449('0x25')]({'plain':!![]});var _0x434ff4=_0xd449('0x49');return db[_0xd449('0x4a')][_0xd449('0x44')]({'where':{'name':_0x434ff4,'userProfileId':_0x14816e[_0xd449('0x4b')]},'raw':!![]})[_0xd449('0x23')](function(_0x4d41de){if(_0x4d41de&&_0x4d41de[_0xd449('0x4c')]===0x0){return db['UserProfileResource']['create']({'name':_0x4d109e['name'],'resourceId':_0x4d109e['id'],'type':_0x4d41de[_0xd449('0x27')],'sectionId':_0x4d41de['id']},{})[_0xd449('0x23')](function(){return _0x1ce097;});}else{return _0x1ce097;}})['catch'](function(_0xfaa2b6){logger[_0xd449('0x4d')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xfaa2b6);throw _0xfaa2b6;});}return _0x1ce097;})['then'](respondWithResult(_0x45b2b8,0xc9))[_0xd449('0x42')](handleError(_0x45b2b8,null));};exports[_0xd449('0x22')]=function(_0xb9dc45,_0x101cc5){if(_0xb9dc45[_0xd449('0x46')]['id']){delete _0xb9dc45[_0xd449('0x46')]['id'];}return db['SmsQueue'][_0xd449('0x44')]({'where':{'id':_0xb9dc45[_0xd449('0x43')]['id']}})['then'](handleEntityNotFound(_0x101cc5,null))[_0xd449('0x23')](saveUpdates(_0xb9dc45['body'],null))[_0xd449('0x23')](respondWithResult(_0x101cc5,null))[_0xd449('0x42')](handleError(_0x101cc5,null));};exports[_0xd449('0x24')]=function(_0x56ee33,_0x58b6d8){return db[_0xd449('0x2b')][_0xd449('0x44')]({'where':{'id':_0x56ee33[_0xd449('0x43')]['id']}})[_0xd449('0x23')](handleEntityNotFound(_0x58b6d8,null))[_0xd449('0x23')](removeEntity(_0x58b6d8,null))[_0xd449('0x42')](handleError(_0x58b6d8,null));};exports[_0xd449('0x4e')]=function(_0x12958a,_0x21c95f){return db['SmsQueue'][_0xd449('0x4e')]()[_0xd449('0x23')](respondWithResult(_0x21c95f,null))[_0xd449('0x42')](handleError(_0x21c95f,null));};exports['getMembers']=function(_0x47132c,_0x2585bd,_0x55cdea){var _0x34c6f4={'raw':!![],'where':{}},_0x347bf7={},_0x42fee7;return db[_0xd449('0x2b')]['findOne']({'where':{'id':_0x47132c[_0xd449('0x43')]['id']}})[_0xd449('0x23')](handleEntityNotFound(_0x2585bd,null))['then'](function(_0x4fb41e){if(_0x4fb41e){_0x42fee7=_0x4fb41e['get']({'plain':!![]});_0x347bf7[_0xd449('0x2f')]=_[_0xd449('0x30')](db['UserSmsQueue'][_0xd449('0x2c')]);_0x347bf7[_0xd449('0x31')]=_[_0xd449('0x30')](_0x47132c['query']);_0x347bf7[_0xd449('0x32')]=_[_0xd449('0x33')](_0x347bf7['model'],_0x347bf7[_0xd449('0x31')]);_0x34c6f4[_0xd449('0x34')]=_[_0xd449('0x33')](_0x347bf7[_0xd449('0x2f')],qs['fields'](_0x47132c[_0xd449('0x31')][_0xd449('0x35')]));_0x34c6f4['attributes']=_0x34c6f4[_0xd449('0x34')]['length']?_0x34c6f4[_0xd449('0x34')]:_0x347bf7[_0xd449('0x2f')];if(!_0x47132c[_0xd449('0x31')][_0xd449('0x37')](_0xd449('0x38'))){_0x34c6f4['limit']=qs[_0xd449('0x39')](_0x47132c[_0xd449('0x31')][_0xd449('0x39')]);_0x34c6f4[_0xd449('0x1c')]=qs[_0xd449('0x1c')](_0x47132c[_0xd449('0x31')][_0xd449('0x1c')]);}_0x34c6f4[_0xd449('0x4f')]=qs[_0xd449('0x3a')](_0x47132c[_0xd449('0x31')][_0xd449('0x3a')]);_0x34c6f4[_0xd449('0x3b')]=qs[_0xd449('0x32')](_['pick'](_0x47132c[_0xd449('0x31')],_0x347bf7[_0xd449('0x32')]));_0x34c6f4[_0xd449('0x3b')]['SmsQueueId']=_0x4fb41e['id'];if(_0x47132c[_0xd449('0x31')][_0xd449('0x3c')]){_0x34c6f4[_0xd449('0x3b')]=_[_0xd449('0x3d')](_0x34c6f4[_0xd449('0x3b')],{'$or':_['map'](_0x34c6f4['attributes'],function(_0x1a2f6f){var _0x48c7c3={};_0x48c7c3[_0x1a2f6f]={'$like':'%'+_0x47132c['query'][_0xd449('0x3c')]+'%'};return _0x48c7c3;})});}_0x34c6f4=_[_0xd449('0x3d')]({},_0x34c6f4,_0x47132c[_0xd449('0x3e')]);return db[_0xd449('0x50')]['findAll'](_0x34c6f4);}})['then'](function(_0x14d0f3){if(_0x14d0f3){return db[_0xd449('0x51')][_0xd449('0x52')]({'where':{'id':_[_0xd449('0x2a')](_0x14d0f3,_0xd449('0x53')),'role':_0xd449('0x54')},'attributes':['id',_0xd449('0x27'),_0xd449('0x55'),_0xd449('0x56'),'createdAt']});}})['then'](function(_0x5b4604){if(_0x5b4604){return{'count':_0x5b4604['count'],'rows':_[_0xd449('0x2a')](_0x5b4604[_0xd449('0x57')],function(_0x1d8eb1){return{'membername':_0x1d8eb1[_0xd449('0x27')],'UserId':_0x1d8eb1['id'],'queue_name':_0x42fee7[_0xd449('0x27')],'SmsQueueId':_0x42fee7['id'],'interface':util['format'](_0xd449('0x58'),'SIP',_0x1d8eb1[_0xd449('0x27')]),'penalty':0x0,'paused':_0x1d8eb1[_0xd449('0x55')],'createdAt':_0x1d8eb1[_0xd449('0x59')],'updatedAt':_0x1d8eb1['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x2585bd,_0x34c6f4))['catch'](handleError(_0x2585bd,null));};exports[_0xd449('0x5a')]=function(_0x10c7c3,_0x5ded69,_0x40d435){var _0x3a2d76={};var _0x3432c4={};var _0x117b74;var _0x1dba12;return db[_0xd449('0x2b')][_0xd449('0x5b')]({'where':{'id':_0x10c7c3['params']['id']}})[_0xd449('0x23')](handleEntityNotFound(_0x5ded69,null))[_0xd449('0x23')](function(_0x5f1662){if(_0x5f1662){_0x117b74=_0x5f1662;_0x3432c4[_0xd449('0x2f')]=_[_0xd449('0x30')](db['Team'][_0xd449('0x2c')]);_0x3432c4[_0xd449('0x31')]=_[_0xd449('0x30')](_0x10c7c3[_0xd449('0x31')]);_0x3432c4[_0xd449('0x32')]=_[_0xd449('0x33')](_0x3432c4[_0xd449('0x2f')],_0x3432c4[_0xd449('0x31')]);_0x3a2d76[_0xd449('0x34')]=_[_0xd449('0x33')](_0x3432c4['model'],qs[_0xd449('0x35')](_0x10c7c3[_0xd449('0x31')][_0xd449('0x35')]));_0x3a2d76[_0xd449('0x34')]=_0x3a2d76['attributes'][_0xd449('0x36')]?_0x3a2d76['attributes']:_0x3432c4[_0xd449('0x2f')];_0x3a2d76[_0xd449('0x4f')]=qs[_0xd449('0x3a')](_0x10c7c3[_0xd449('0x31')]['sort']);_0x3a2d76[_0xd449('0x3b')]=qs['filters'](_[_0xd449('0x5c')](_0x10c7c3['query'],_0x3432c4[_0xd449('0x32')]));if(_0x10c7c3[_0xd449('0x31')][_0xd449('0x3c')]){_0x3a2d76['where']=_[_0xd449('0x3d')](_0x3a2d76[_0xd449('0x3b')],{'$or':_[_0xd449('0x2a')](_0x3a2d76['attributes'],function(_0x176d38){var _0x563422={};_0x563422[_0x176d38]={'$like':'%'+_0x10c7c3[_0xd449('0x31')]['filter']+'%'};return _0x563422;})});}_0x3a2d76=_[_0xd449('0x3d')]({},_0x3a2d76,_0x10c7c3[_0xd449('0x3e')]);return _0x117b74['getTeams'](_0x3a2d76);}})[_0xd449('0x23')](function(_0x4e1032){if(_0x4e1032){_0x1dba12=_0x4e1032['length'];if(!_0x10c7c3[_0xd449('0x31')][_0xd449('0x37')](_0xd449('0x38'))){_0x3a2d76[_0xd449('0x39')]=qs['limit'](_0x10c7c3[_0xd449('0x31')][_0xd449('0x39')]);_0x3a2d76[_0xd449('0x1c')]=qs[_0xd449('0x1c')](_0x10c7c3[_0xd449('0x31')][_0xd449('0x1c')]);}return _0x117b74[_0xd449('0x5a')](_0x3a2d76);}})[_0xd449('0x23')](function(_0x19ec29){if(_0x19ec29){return _0x19ec29?{'count':_0x1dba12,'rows':_0x19ec29}:null;}})[_0xd449('0x23')](respondWithResult(_0x5ded69,null))['catch'](handleError(_0x5ded69,null));};exports[_0xd449('0x5d')]=function(_0x1b5afd,_0x58e884,_0x43f377){var _0x50da21=_0x1b5afd[_0xd449('0x46')][_0xd449('0x5e')];return db[_0xd449('0x5f')][_0xd449('0x41')]({'where':{'id':_0x50da21},'attributes':['id'],'include':[{'model':db[_0xd449('0x51')],'as':_0xd449('0x60'),'attributes':['id','name',_0xd449('0x61'),_0xd449('0x62'),_0xd449('0x63')],'raw':!![]}]})['then'](function(_0x46752f){if(_0x46752f){var _0x2cbd79=_[_0xd449('0x64')](_0x46752f,function(_0x54830d){var _0x55977a=_0x54830d[_0xd449('0x25')]({'plain':!![]});return _0x55977a['Agents'];});return db[_0xd449('0x2b')][_0xd449('0x44')]({'where':{'id':_0x1b5afd['params']['id']}})['then'](function(_0x238e7d){return db['sequelize'][_0xd449('0x65')](function(_0x340d24){return _0x238e7d['addTeams'](_0x50da21,{'transaction':_0x340d24})['then'](function(){return BPromise[_0xd449('0x66')](_0x2cbd79,function(_0x312501){return db[_0xd449('0x50')][_0xd449('0x67')]({'where':{'UserId':_0x312501['id'],'SmsQueueId':_0x1b5afd['params']['id']},'transaction':_0x340d24});});})[_0xd449('0x23')](function(){_0x2cbd79['forEach'](function(_0x28b04a){socket['emit'](_0xd449('0x68'),{'UserId':_0x28b04a['id'],'SmsQueueId':_0x238e7d['id']});});});});});}})[_0xd449('0x23')](respondWithStatusCode(_0x58e884,null))[_0xd449('0x42')](handleError(_0x58e884,null));};exports[_0xd449('0x69')]=function(_0x5802ce,_0x12f124,_0xe28bba){return db[_0xd449('0x5f')][_0xd449('0x41')]({'where':{'id':_0x5802ce[_0xd449('0x31')][_0xd449('0x5e')]},'attributes':['id'],'include':[{'model':db[_0xd449('0x51')],'as':_0xd449('0x60'),'attributes':['id'],'raw':!![]}]})[_0xd449('0x23')](handleEntityNotFound(_0x12f124,null))[_0xd449('0x23')](function(_0x366da2){var _0x3c0b66=_[_0xd449('0x2a')](_0x366da2,'id');var _0x43579c=[];var _0x42d5f4=[];var _0xf10fc6=squel['select']();_0xf10fc6['field'](_0xd449('0x6a'))[_0xd449('0x6b')](_0xd449('0x6c'),'tq')[_0xd449('0x6d')](_0xd449('0x6e'),'ut',_0xd449('0x6f'))[_0xd449('0x3b')](_0xd449('0x70'),_0x5802ce['params']['id']);for(var _0x55cb7c=0x0;_0x55cb7c<_0x366da2[_0xd449('0x36')];_0x55cb7c+=0x1){let _0x4eb3e0=_0x366da2[_0x55cb7c];for(var _0x1fe610=0x0;_0x1fe610<_0x4eb3e0[_0xd449('0x60')][_0xd449('0x36')];_0x1fe610+=0x1){let _0x2f36c1=_0x4eb3e0['Agents'][_0x1fe610];var _0x447d82=_0xf10fc6[_0xd449('0x71')]();_0x447d82[_0xd449('0x3b')](_0xd449('0x72'),_0x2f36c1['id']);_0x42d5f4[_0xd449('0x73')](db[_0xd449('0x74')]['query'](_0x447d82[_0xd449('0x75')](),{'type':db[_0xd449('0x74')][_0xd449('0x76')][_0xd449('0x77')]})[_0xd449('0x23')](function(_0x3b0558){if(_0x3b0558[_0xd449('0x36')]===0x1){return _0x2f36c1['id'];}else{var _0x1b68b7=_['every'](_['map'](_0x3b0558,_0xd449('0x78')),function(_0x2c9d30){return _[_0xd449('0x79')](_0x3c0b66,_0x2c9d30);});if(_0x1b68b7){return _0x2f36c1['id'];}}}));}}return BPromise[_0xd449('0x7a')](_0x42d5f4)[_0xd449('0x23')](function(_0x24920f){_0x43579c=_(_0x43579c)[_0xd449('0x7b')](_0x24920f)[_0xd449('0x7c')]()[_0xd449('0x7d')]();return db[_0xd449('0x2b')][_0xd449('0x44')]({'where':{'id':_0x5802ce['params']['id']}})['then'](function(_0x44e0f6){return db[_0xd449('0x74')][_0xd449('0x65')](function(_0x39d129){return _0x44e0f6[_0xd449('0x69')](_0x5802ce[_0xd449('0x31')][_0xd449('0x5e')],{'transaction':_0x39d129})[_0xd449('0x23')](function(){if(!_[_0xd449('0x7e')](_0x43579c)){return _0x44e0f6['removeAgents'](_0x43579c,{'transaction':_0x39d129});}})['then'](function(){_0x43579c[_0xd449('0x7f')](function(_0x174fb4){socket[_0xd449('0x80')](_0xd449('0x81'),{'UserId':_0x174fb4,'SmsQueueId':_0x44e0f6['id']});});});});});});})[_0xd449('0x23')](respondWithStatusCode(_0x12f124,null))[_0xd449('0x42')](handleError(_0x12f124,null));};exports[_0xd449('0x82')]=function(_0x361d05,_0x2c68e0,_0x533435){return db[_0xd449('0x2b')][_0xd449('0x44')]({'where':{'id':_0x361d05[_0xd449('0x43')]['id']}})[_0xd449('0x23')](handleEntityNotFound(_0x2c68e0,null))[_0xd449('0x23')](function(_0x491940){if(_0x491940){return _0x491940[_0xd449('0x82')](_0x361d05['body'][_0xd449('0x5e')],_[_0xd449('0x83')](_0x361d05[_0xd449('0x46')],[_0xd449('0x5e'),'id'])||{})['spread'](function(_0x121eb1){for(var _0x5220a2=0x0;_0x5220a2<_0x361d05[_0xd449('0x46')]['ids'][_0xd449('0x36')];_0x5220a2+=0x1){socket['emit'](_0xd449('0x68'),{'UserId':_0x361d05['body']['ids'][_0x5220a2],'SmsQueueId':_0x361d05['params']['id']});}return _0x121eb1;});}})[_0xd449('0x23')](respondWithResult(_0x2c68e0,null))['catch'](handleError(_0x2c68e0,null));};exports[_0xd449('0x84')]=function(_0x2a6772,_0x48cab6,_0x6cf269){return db[_0xd449('0x2b')][_0xd449('0x44')]({'where':{'id':_0x2a6772['params']['id']}})['then'](handleEntityNotFound(_0x48cab6,null))[_0xd449('0x23')](function(_0x465d29){if(_0x465d29){return _0x465d29[_0xd449('0x84')](_0x2a6772['query'][_0xd449('0x5e')])[_0xd449('0x23')](function(){if(_[_0xd449('0x85')](_0x2a6772['query']['ids'])){for(var _0xb45147=0x0;_0xb45147<_0x2a6772[_0xd449('0x31')][_0xd449('0x5e')][_0xd449('0x36')];_0xb45147+=0x1){socket[_0xd449('0x80')](_0xd449('0x81'),{'UserId':Number(_0x2a6772[_0xd449('0x31')][_0xd449('0x5e')][_0xb45147]),'SmsQueueId':Number(_0x2a6772[_0xd449('0x43')]['id'])});}}else{socket['emit'](_0xd449('0x81'),{'UserId':Number(_0x2a6772['query'][_0xd449('0x5e')]),'SmsQueueId':Number(_0x2a6772[_0xd449('0x43')]['id'])});}});}})[_0xd449('0x23')](respondWithStatusCode(_0x48cab6,null))[_0xd449('0x42')](handleError(_0x48cab6,null));};exports[_0xd449('0x86')]=function(_0x43c249,_0x48b946,_0x5a5f6b){var _0x5a5bd0={};var _0x2ec22c={};var _0x30e6da;var _0x1d32de;return db[_0xd449('0x2b')][_0xd449('0x5b')]({'where':{'id':_0x43c249[_0xd449('0x43')]['id']}})[_0xd449('0x23')](handleEntityNotFound(_0x48b946,null))[_0xd449('0x23')](function(_0x4a1322){if(_0x4a1322){_0x30e6da=_0x4a1322;_0x2ec22c[_0xd449('0x2f')]=_[_0xd449('0x30')](db[_0xd449('0x51')][_0xd449('0x2c')]);_0x2ec22c[_0xd449('0x31')]=_['keys'](_0x43c249[_0xd449('0x31')]);_0x2ec22c['filters']=_['intersection'](_0x2ec22c[_0xd449('0x2f')],_0x2ec22c[_0xd449('0x31')]);_0x5a5bd0[_0xd449('0x34')]=_[_0xd449('0x33')](_0x2ec22c[_0xd449('0x2f')],qs[_0xd449('0x35')](_0x43c249[_0xd449('0x31')][_0xd449('0x35')]));_0x5a5bd0[_0xd449('0x34')]=_0x5a5bd0[_0xd449('0x34')][_0xd449('0x36')]?_0x5a5bd0[_0xd449('0x34')]:_0x2ec22c[_0xd449('0x2f')];_0x5a5bd0[_0xd449('0x4f')]=qs[_0xd449('0x3a')](_0x43c249[_0xd449('0x31')]['sort']);_0x5a5bd0[_0xd449('0x3b')]=qs[_0xd449('0x32')](_['pick'](_0x43c249[_0xd449('0x31')],_0x2ec22c[_0xd449('0x32')]));if(_0x43c249[_0xd449('0x31')][_0xd449('0x3c')]){_0x5a5bd0[_0xd449('0x3b')]=_[_0xd449('0x3d')](_0x5a5bd0['where'],{'$or':_['map'](_0x5a5bd0[_0xd449('0x34')],function(_0x2c9e81){var _0x179851={};_0x179851[_0x2c9e81]={'$like':'%'+_0x43c249[_0xd449('0x31')]['filter']+'%'};return _0x179851;})});}_0x5a5bd0=_[_0xd449('0x3d')]({},_0x5a5bd0,_0x43c249['options']);return _0x30e6da['getAgents'](_0x5a5bd0);}})[_0xd449('0x23')](function(_0xaefe57){if(_0xaefe57){_0x1d32de=_0xaefe57[_0xd449('0x36')];if(!_0x43c249['query'][_0xd449('0x37')]('nolimit')){_0x5a5bd0['limit']=qs[_0xd449('0x39')](_0x43c249[_0xd449('0x31')]['limit']);_0x5a5bd0[_0xd449('0x1c')]=qs[_0xd449('0x1c')](_0x43c249['query']['offset']);}return _0x30e6da[_0xd449('0x86')](_0x5a5bd0);}})[_0xd449('0x23')](function(_0x41f724){if(_0x41f724){return _0x41f724?{'count':_0x1d32de,'rows':_0x41f724}:null;}})['then'](respondWithResult(_0x48b946,null))['catch'](handleError(_0x48b946,null));};
\ No newline at end of file
+var _0x361f=['jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./smsQueue.socket','status','count','offset','limit','Content-Range','json','apply','reject','save','update','then','SmsQueues','UserProfileResource','destroy','end','error','stack','name','send','rawAttributes','fieldName','type','key','map','query','keys','filters','attributes','intersection','fields','hasOwnProperty','nolimit','sort','where','pick','filter','VIRTUAL','merge','options','SmsQueue','includeAll','include','findAll','rows','catch','show','model','length','find','create','body','role','user','get','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','findOne','UserSmsQueue','order','SmsQueueId','User','findAndCountAll','UserId','agent','smsPause','updatedAt','%s/%s','SIP','getTeams','addTeams','ids','Team','Agents','voicePause','interface','flatMap','sequelize','transaction','each','forEach','userSmsQueue:save','removeTeams','select','field','tq.TeamId','from','team_has_sms_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','clone','ut.UserId\x20=\x20?','every','TeamId','includes','all','compact','isEmpty','removeAgents','addAgents','omit','spread','emit','userSmsQueue:remove','getAgents','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','path','to-csv','ejs','lodash','squel','crypto'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x361f,0x7c));var _0xf361=function(_0x956b80,_0x58c015){_0x956b80=_0x956b80-0x0;var _0x5c1892=_0x361f[_0x956b80];return _0x5c1892;};'use strict';var pdf=require(_0xf361('0x0'));var emlformat=require(_0xf361('0x1'));var rimraf=require(_0xf361('0x2'));var zipdir=require(_0xf361('0x3'));var jsonpatch=require(_0xf361('0x4'));var rp=require(_0xf361('0x5'));var moment=require('moment');var BPromise=require(_0xf361('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0xf361('0x7'));var sox=require('sox');var csv=require(_0xf361('0x8'));var ejs=require(_0xf361('0x9'));var fs=require('fs');var _=require(_0xf361('0xa'));var squel=require(_0xf361('0xb'));var crypto=require(_0xf361('0xc'));var jsforce=require(_0xf361('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xf361('0xe'));var Papa=require(_0xf361('0xf'));var Redis=require(_0xf361('0x10'));var authService=require(_0xf361('0x11'));var qs=require(_0xf361('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf361('0x13'));var logger=require(_0xf361('0x14'))(_0xf361('0x15'));var utils=require(_0xf361('0x16'));var config=require(_0xf361('0x17'));var db=require(_0xf361('0x18'))['db'];config[_0xf361('0x19')]=_[_0xf361('0x1a')](config[_0xf361('0x19')],{'host':_0xf361('0x1b'),'port':0x18eb});var socket=require(_0xf361('0x1c'))(new Redis(config[_0xf361('0x19')]));require(_0xf361('0x1d'))['register'](socket);function respondWithStatusCode(_0x3b1583,_0x3f03d8){_0x3f03d8=_0x3f03d8||0xcc;return function(_0xe2cc76){if(_0xe2cc76){return _0x3b1583['sendStatus'](_0x3f03d8);}return _0x3b1583[_0xf361('0x1e')](_0x3f03d8)['end']();};}function respondWithResult(_0x107a29,_0x5e564c){_0x5e564c=_0x5e564c||0xc8;return function(_0x113384){if(_0x113384){return _0x107a29[_0xf361('0x1e')](_0x5e564c)['json'](_0x113384);}};}function respondWithFilteredResult(_0xe8fc5d,_0x370f33){return function(_0x411eca){if(_0x411eca){var _0x4f4530=_0x411eca[_0xf361('0x1f')],_0x1b0109=_0x370f33[_0xf361('0x20')],_0x1bb1d7=_0x370f33[_0xf361('0x20')]+_0x370f33[_0xf361('0x21')],_0x569f29;if(_0x1bb1d7>=_0x4f4530){_0x1bb1d7=_0x4f4530;_0x569f29=0xc8;}else{_0x569f29=0xce;}_0xe8fc5d['status'](_0x569f29);return _0xe8fc5d['set'](_0xf361('0x22'),_0x1b0109+'-'+_0x1bb1d7+'/'+_0x4f4530)[_0xf361('0x23')](_0x411eca);}return null;};}function patchUpdates(_0x494a22){return function(_0x5a350b){try{jsonpatch[_0xf361('0x24')](_0x5a350b,_0x494a22,!![]);}catch(_0x4dab39){return BPromise[_0xf361('0x25')](_0x4dab39);}return _0x5a350b[_0xf361('0x26')]();};}function saveUpdates(_0x24ef77,_0x51df81){return function(_0x53d8db){if(_0x53d8db){return _0x53d8db[_0xf361('0x27')](_0x24ef77)[_0xf361('0x28')](function(_0x207d6a){return _0x207d6a;});}return null;};}function removeEntity(_0x8ab291,_0x527fa2){return function(_0x1780b7){if(_0x1780b7){return _0x1780b7['destroy']()[_0xf361('0x28')](function(){var _0x433fcf=_0x1780b7['get']({'plain':!![]});var _0x2ff6ec=_0xf361('0x29');return db[_0xf361('0x2a')][_0xf361('0x2b')]({'where':{'type':_0x2ff6ec,'resourceId':_0x433fcf['id']}})['then'](function(){return _0x1780b7;});})[_0xf361('0x28')](function(){_0x8ab291[_0xf361('0x1e')](0xcc)[_0xf361('0x2c')]();});}};}function handleEntityNotFound(_0x37a078,_0x4ac99a){return function(_0x5894a7){if(!_0x5894a7){_0x37a078['sendStatus'](0x194);}return _0x5894a7;};}function handleError(_0x355fee,_0xe09f77){_0xe09f77=_0xe09f77||0x1f4;return function(_0xa65d48){logger[_0xf361('0x2d')](_0xa65d48[_0xf361('0x2e')]);if(_0xa65d48[_0xf361('0x2f')]){delete _0xa65d48[_0xf361('0x2f')];}_0x355fee[_0xf361('0x1e')](_0xe09f77)[_0xf361('0x30')](_0xa65d48);};}exports['index']=function(_0x48f0c6,_0x148d44){var _0x51999b={},_0x55e26c={},_0x1c647a={'count':0x0,'rows':[]};var _0x448f87=_['map'](db['SmsQueue'][_0xf361('0x31')],function(_0x5b9bc0){return{'name':_0x5b9bc0[_0xf361('0x32')],'type':_0x5b9bc0[_0xf361('0x33')][_0xf361('0x34')]};});_0x55e26c['model']=_[_0xf361('0x35')](_0x448f87,_0xf361('0x2f'));_0x55e26c[_0xf361('0x36')]=_[_0xf361('0x37')](_0x48f0c6[_0xf361('0x36')]);_0x55e26c[_0xf361('0x38')]=_['intersection'](_0x55e26c['model'],_0x55e26c[_0xf361('0x36')]);_0x51999b[_0xf361('0x39')]=_[_0xf361('0x3a')](_0x55e26c['model'],qs[_0xf361('0x3b')](_0x48f0c6[_0xf361('0x36')][_0xf361('0x3b')]));_0x51999b[_0xf361('0x39')]=_0x51999b[_0xf361('0x39')]['length']?_0x51999b[_0xf361('0x39')]:_0x55e26c['model'];if(!_0x48f0c6[_0xf361('0x36')][_0xf361('0x3c')](_0xf361('0x3d'))){_0x51999b[_0xf361('0x21')]=qs[_0xf361('0x21')](_0x48f0c6[_0xf361('0x36')][_0xf361('0x21')]);_0x51999b['offset']=qs['offset'](_0x48f0c6['query'][_0xf361('0x20')]);}_0x51999b['order']=qs['sort'](_0x48f0c6[_0xf361('0x36')][_0xf361('0x3e')]);_0x51999b[_0xf361('0x3f')]=qs['filters'](_[_0xf361('0x40')](_0x48f0c6['query'],_0x55e26c[_0xf361('0x38')]),_0x448f87);if(_0x48f0c6[_0xf361('0x36')][_0xf361('0x41')]){_0x51999b['where']=_['merge'](_0x51999b[_0xf361('0x3f')],{'$or':_[_0xf361('0x35')](_0x448f87,function(_0x2a5c59){if(_0x2a5c59[_0xf361('0x33')]!==_0xf361('0x42')){var _0x484367={};_0x484367[_0x2a5c59[_0xf361('0x2f')]]={'$like':'%'+_0x48f0c6[_0xf361('0x36')]['filter']+'%'};return _0x484367;}})});}_0x51999b=_[_0xf361('0x43')]({},_0x51999b,_0x48f0c6[_0xf361('0x44')]);var _0x39f439={'where':_0x51999b[_0xf361('0x3f')]};return db[_0xf361('0x45')][_0xf361('0x1f')](_0x39f439)[_0xf361('0x28')](function(_0x39f344){_0x1c647a[_0xf361('0x1f')]=_0x39f344;if(_0x48f0c6['query'][_0xf361('0x46')]){_0x51999b[_0xf361('0x47')]=[{'all':!![]}];}return db[_0xf361('0x45')][_0xf361('0x48')](_0x51999b);})[_0xf361('0x28')](function(_0x399994){_0x1c647a[_0xf361('0x49')]=_0x399994;return _0x1c647a;})['then'](respondWithFilteredResult(_0x148d44,_0x51999b))[_0xf361('0x4a')](handleError(_0x148d44,null));};exports[_0xf361('0x4b')]=function(_0x24498,_0x21c3a3){var _0x3617ed={'raw':!![],'where':{'id':_0x24498['params']['id']}},_0x5630e1={};_0x5630e1[_0xf361('0x4c')]=_[_0xf361('0x37')](db[_0xf361('0x45')][_0xf361('0x31')]);_0x5630e1[_0xf361('0x36')]=_['keys'](_0x24498[_0xf361('0x36')]);_0x5630e1[_0xf361('0x38')]=_[_0xf361('0x3a')](_0x5630e1['model'],_0x5630e1[_0xf361('0x36')]);_0x3617ed[_0xf361('0x39')]=_[_0xf361('0x3a')](_0x5630e1[_0xf361('0x4c')],qs[_0xf361('0x3b')](_0x24498[_0xf361('0x36')]['fields']));_0x3617ed['attributes']=_0x3617ed[_0xf361('0x39')][_0xf361('0x4d')]?_0x3617ed[_0xf361('0x39')]:_0x5630e1[_0xf361('0x4c')];if(_0x24498['query']['includeAll']){_0x3617ed[_0xf361('0x47')]=[{'all':!![]}];}_0x3617ed=_[_0xf361('0x43')]({},_0x3617ed,_0x24498['options']);return db[_0xf361('0x45')][_0xf361('0x4e')](_0x3617ed)['then'](handleEntityNotFound(_0x21c3a3,null))[_0xf361('0x28')](respondWithResult(_0x21c3a3,null))[_0xf361('0x4a')](handleError(_0x21c3a3,null));};exports['create']=function(_0x56b365,_0x5132a7){return db['SmsQueue'][_0xf361('0x4f')](_0x56b365[_0xf361('0x50')],{})['then'](function(_0x150714){var _0x372314=_0x56b365['user']['get']({'plain':!![]});if(!_0x372314)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x372314[_0xf361('0x51')]===_0xf361('0x52')){var _0xcd3313=_0x150714[_0xf361('0x53')]({'plain':!![]});var _0x51bdec=_0xf361('0x29');return db['UserProfileSection'][_0xf361('0x4e')]({'where':{'name':_0x51bdec,'userProfileId':_0x372314[_0xf361('0x54')]},'raw':!![]})[_0xf361('0x28')](function(_0x21453c){if(_0x21453c&&_0x21453c['autoAssociation']===0x0){return db[_0xf361('0x2a')][_0xf361('0x4f')]({'name':_0xcd3313['name'],'resourceId':_0xcd3313['id'],'type':_0x21453c[_0xf361('0x2f')],'sectionId':_0x21453c['id']},{})[_0xf361('0x28')](function(){return _0x150714;});}else{return _0x150714;}})['catch'](function(_0x2a7fa0){logger[_0xf361('0x2d')](_0xf361('0x55'),_0x2a7fa0);throw _0x2a7fa0;});}return _0x150714;})[_0xf361('0x28')](respondWithResult(_0x5132a7,0xc9))[_0xf361('0x4a')](handleError(_0x5132a7,null));};exports[_0xf361('0x27')]=function(_0x39608f,_0x36ce10){if(_0x39608f[_0xf361('0x50')]['id']){delete _0x39608f['body']['id'];}return db[_0xf361('0x45')][_0xf361('0x4e')]({'where':{'id':_0x39608f[_0xf361('0x56')]['id']}})[_0xf361('0x28')](handleEntityNotFound(_0x36ce10,null))[_0xf361('0x28')](saveUpdates(_0x39608f[_0xf361('0x50')],null))[_0xf361('0x28')](respondWithResult(_0x36ce10,null))[_0xf361('0x4a')](handleError(_0x36ce10,null));};exports['destroy']=function(_0x550f88,_0x2704d3){return db[_0xf361('0x45')][_0xf361('0x4e')]({'where':{'id':_0x550f88[_0xf361('0x56')]['id']}})[_0xf361('0x28')](handleEntityNotFound(_0x2704d3,null))['then'](removeEntity(_0x2704d3,null))[_0xf361('0x4a')](handleError(_0x2704d3,null));};exports[_0xf361('0x57')]=function(_0x1ff6d6,_0x632ec8){return db['SmsQueue'][_0xf361('0x57')]()[_0xf361('0x28')](respondWithResult(_0x632ec8,null))[_0xf361('0x4a')](handleError(_0x632ec8,null));};exports['getMembers']=function(_0x55a012,_0x3efc35,_0x3ea05c){var _0x53af16={'raw':!![],'where':{}},_0x14a1a1={},_0x2377c0;return db['SmsQueue'][_0xf361('0x58')]({'where':{'id':_0x55a012[_0xf361('0x56')]['id']}})[_0xf361('0x28')](handleEntityNotFound(_0x3efc35,null))[_0xf361('0x28')](function(_0x1a7beb){if(_0x1a7beb){_0x2377c0=_0x1a7beb['get']({'plain':!![]});_0x14a1a1['model']=_[_0xf361('0x37')](db[_0xf361('0x59')][_0xf361('0x31')]);_0x14a1a1['query']=_['keys'](_0x55a012[_0xf361('0x36')]);_0x14a1a1[_0xf361('0x38')]=_[_0xf361('0x3a')](_0x14a1a1[_0xf361('0x4c')],_0x14a1a1[_0xf361('0x36')]);_0x53af16[_0xf361('0x39')]=_[_0xf361('0x3a')](_0x14a1a1[_0xf361('0x4c')],qs[_0xf361('0x3b')](_0x55a012[_0xf361('0x36')]['fields']));_0x53af16[_0xf361('0x39')]=_0x53af16[_0xf361('0x39')][_0xf361('0x4d')]?_0x53af16[_0xf361('0x39')]:_0x14a1a1['model'];if(!_0x55a012['query'][_0xf361('0x3c')]('nolimit')){_0x53af16[_0xf361('0x21')]=qs['limit'](_0x55a012['query']['limit']);_0x53af16[_0xf361('0x20')]=qs[_0xf361('0x20')](_0x55a012['query'][_0xf361('0x20')]);}_0x53af16[_0xf361('0x5a')]=qs[_0xf361('0x3e')](_0x55a012[_0xf361('0x36')][_0xf361('0x3e')]);_0x53af16['where']=qs['filters'](_[_0xf361('0x40')](_0x55a012[_0xf361('0x36')],_0x14a1a1[_0xf361('0x38')]));_0x53af16[_0xf361('0x3f')][_0xf361('0x5b')]=_0x1a7beb['id'];if(_0x55a012[_0xf361('0x36')][_0xf361('0x41')]){_0x53af16[_0xf361('0x3f')]=_['merge'](_0x53af16[_0xf361('0x3f')],{'$or':_[_0xf361('0x35')](_0x53af16[_0xf361('0x39')],function(_0x1a6d5c){var _0x443199={};_0x443199[_0x1a6d5c]={'$like':'%'+_0x55a012[_0xf361('0x36')][_0xf361('0x41')]+'%'};return _0x443199;})});}_0x53af16=_[_0xf361('0x43')]({},_0x53af16,_0x55a012[_0xf361('0x44')]);return db[_0xf361('0x59')][_0xf361('0x48')](_0x53af16);}})[_0xf361('0x28')](function(_0x339013){if(_0x339013){return db[_0xf361('0x5c')][_0xf361('0x5d')]({'where':{'id':_[_0xf361('0x35')](_0x339013,_0xf361('0x5e')),'role':_0xf361('0x5f')},'attributes':['id','name',_0xf361('0x60'),_0xf361('0x61'),'createdAt']});}})[_0xf361('0x28')](function(_0x436fdb){if(_0x436fdb){return{'count':_0x436fdb['count'],'rows':_[_0xf361('0x35')](_0x436fdb[_0xf361('0x49')],function(_0x42a6ea){return{'membername':_0x42a6ea[_0xf361('0x2f')],'UserId':_0x42a6ea['id'],'queue_name':_0x2377c0[_0xf361('0x2f')],'SmsQueueId':_0x2377c0['id'],'interface':util['format'](_0xf361('0x62'),_0xf361('0x63'),_0x42a6ea[_0xf361('0x2f')]),'penalty':0x0,'paused':_0x42a6ea[_0xf361('0x60')],'createdAt':_0x42a6ea['createdAt'],'updatedAt':_0x42a6ea[_0xf361('0x61')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xf361('0x28')](respondWithFilteredResult(_0x3efc35,_0x53af16))[_0xf361('0x4a')](handleError(_0x3efc35,null));};exports[_0xf361('0x64')]=function(_0x3b9d52,_0x59daee,_0x4f2c17){var _0x269f84={};var _0x3d29d1={};var _0x2073e4;var _0x39df15;return db[_0xf361('0x45')][_0xf361('0x58')]({'where':{'id':_0x3b9d52['params']['id']}})['then'](handleEntityNotFound(_0x59daee,null))[_0xf361('0x28')](function(_0x336b77){if(_0x336b77){_0x2073e4=_0x336b77;_0x3d29d1[_0xf361('0x4c')]=_['keys'](db['Team'][_0xf361('0x31')]);_0x3d29d1['query']=_[_0xf361('0x37')](_0x3b9d52[_0xf361('0x36')]);_0x3d29d1[_0xf361('0x38')]=_[_0xf361('0x3a')](_0x3d29d1[_0xf361('0x4c')],_0x3d29d1[_0xf361('0x36')]);_0x269f84[_0xf361('0x39')]=_['intersection'](_0x3d29d1[_0xf361('0x4c')],qs['fields'](_0x3b9d52[_0xf361('0x36')]['fields']));_0x269f84['attributes']=_0x269f84[_0xf361('0x39')][_0xf361('0x4d')]?_0x269f84[_0xf361('0x39')]:_0x3d29d1[_0xf361('0x4c')];_0x269f84['order']=qs['sort'](_0x3b9d52[_0xf361('0x36')][_0xf361('0x3e')]);_0x269f84['where']=qs[_0xf361('0x38')](_[_0xf361('0x40')](_0x3b9d52[_0xf361('0x36')],_0x3d29d1[_0xf361('0x38')]));if(_0x3b9d52[_0xf361('0x36')][_0xf361('0x41')]){_0x269f84['where']=_[_0xf361('0x43')](_0x269f84[_0xf361('0x3f')],{'$or':_[_0xf361('0x35')](_0x269f84['attributes'],function(_0x11a636){var _0xf3aa2d={};_0xf3aa2d[_0x11a636]={'$like':'%'+_0x3b9d52[_0xf361('0x36')][_0xf361('0x41')]+'%'};return _0xf3aa2d;})});}_0x269f84=_[_0xf361('0x43')]({},_0x269f84,_0x3b9d52['options']);return _0x2073e4['getTeams'](_0x269f84);}})[_0xf361('0x28')](function(_0x5d04e0){if(_0x5d04e0){_0x39df15=_0x5d04e0[_0xf361('0x4d')];if(!_0x3b9d52['query'][_0xf361('0x3c')](_0xf361('0x3d'))){_0x269f84[_0xf361('0x21')]=qs[_0xf361('0x21')](_0x3b9d52[_0xf361('0x36')][_0xf361('0x21')]);_0x269f84[_0xf361('0x20')]=qs[_0xf361('0x20')](_0x3b9d52['query'][_0xf361('0x20')]);}return _0x2073e4[_0xf361('0x64')](_0x269f84);}})[_0xf361('0x28')](function(_0x4af025){if(_0x4af025){return _0x4af025?{'count':_0x39df15,'rows':_0x4af025}:null;}})[_0xf361('0x28')](respondWithResult(_0x59daee,null))['catch'](handleError(_0x59daee,null));};exports[_0xf361('0x65')]=function(_0x575c59,_0x15cbf6,_0x1cc235){var _0x4600a4=_0x575c59[_0xf361('0x50')][_0xf361('0x66')];return db[_0xf361('0x67')][_0xf361('0x48')]({'where':{'id':_0x4600a4},'attributes':['id'],'include':[{'model':db[_0xf361('0x5c')],'as':_0xf361('0x68'),'attributes':['id','name','online',_0xf361('0x69'),_0xf361('0x6a')],'raw':!![]}]})['then'](function(_0x4d05f1){if(_0x4d05f1){var _0x23b6d2=_[_0xf361('0x6b')](_0x4d05f1,function(_0x3b6e21){var _0x4ab134=_0x3b6e21[_0xf361('0x53')]({'plain':!![]});return _0x4ab134[_0xf361('0x68')];});return db[_0xf361('0x45')][_0xf361('0x4e')]({'where':{'id':_0x575c59[_0xf361('0x56')]['id']}})['then'](function(_0x1ab7c8){return db[_0xf361('0x6c')][_0xf361('0x6d')](function(_0x34e98a){return _0x1ab7c8[_0xf361('0x65')](_0x4600a4,{'transaction':_0x34e98a})[_0xf361('0x28')](function(){return BPromise[_0xf361('0x6e')](_0x23b6d2,function(_0x4d4e1a){return db[_0xf361('0x59')]['findOrCreate']({'where':{'UserId':_0x4d4e1a['id'],'SmsQueueId':_0x575c59[_0xf361('0x56')]['id']},'transaction':_0x34e98a});});})['then'](function(){_0x23b6d2[_0xf361('0x6f')](function(_0x58fe6e){socket['emit'](_0xf361('0x70'),{'UserId':_0x58fe6e['id'],'SmsQueueId':_0x1ab7c8['id']});});});});});}})[_0xf361('0x28')](respondWithStatusCode(_0x15cbf6,null))[_0xf361('0x4a')](handleError(_0x15cbf6,null));};exports[_0xf361('0x71')]=function(_0x25d8f0,_0x25cc89,_0x2c7fec){return db[_0xf361('0x67')][_0xf361('0x48')]({'where':{'id':_0x25d8f0[_0xf361('0x36')][_0xf361('0x66')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0xf361('0x68'),'attributes':['id'],'raw':!![]}]})[_0xf361('0x28')](handleEntityNotFound(_0x25cc89,null))[_0xf361('0x28')](function(_0x2c24de){var _0x4e659d=_['map'](_0x2c24de,'id');var _0x34a4cf=[];var _0x4101ed=[];var _0xb96c9a=squel[_0xf361('0x72')]();_0xb96c9a[_0xf361('0x73')](_0xf361('0x74'))[_0xf361('0x75')](_0xf361('0x76'),'tq')[_0xf361('0x77')](_0xf361('0x78'),'ut',_0xf361('0x79'))[_0xf361('0x3f')]('SmsQueueId\x20=\x20?',_0x25d8f0['params']['id']);for(var _0x886c44=0x0;_0x886c44<_0x2c24de[_0xf361('0x4d')];_0x886c44+=0x1){let _0x56b9c5=_0x2c24de[_0x886c44];for(var _0x2544fe=0x0;_0x2544fe<_0x56b9c5['Agents'][_0xf361('0x4d')];_0x2544fe+=0x1){let _0x594d12=_0x56b9c5['Agents'][_0x2544fe];var _0x360a86=_0xb96c9a[_0xf361('0x7a')]();_0x360a86[_0xf361('0x3f')](_0xf361('0x7b'),_0x594d12['id']);_0x4101ed['push'](db[_0xf361('0x6c')][_0xf361('0x36')](_0x360a86['toString'](),{'type':db['sequelize']['QueryTypes']['SELECT']})[_0xf361('0x28')](function(_0x28f997){if(_0x28f997[_0xf361('0x4d')]===0x1){return _0x594d12['id'];}else{var _0x4ff634=_[_0xf361('0x7c')](_[_0xf361('0x35')](_0x28f997,_0xf361('0x7d')),function(_0x3e8cd2){return _[_0xf361('0x7e')](_0x4e659d,_0x3e8cd2);});if(_0x4ff634){return _0x594d12['id'];}}}));}}return BPromise[_0xf361('0x7f')](_0x4101ed)[_0xf361('0x28')](function(_0x25a9cc){_0x34a4cf=_(_0x34a4cf)['union'](_0x25a9cc)[_0xf361('0x80')]()['value']();return db[_0xf361('0x45')][_0xf361('0x4e')]({'where':{'id':_0x25d8f0[_0xf361('0x56')]['id']}})[_0xf361('0x28')](function(_0x2193ed){return db[_0xf361('0x6c')][_0xf361('0x6d')](function(_0x4a7179){return _0x2193ed['removeTeams'](_0x25d8f0['query'][_0xf361('0x66')],{'transaction':_0x4a7179})[_0xf361('0x28')](function(){if(!_[_0xf361('0x81')](_0x34a4cf)){return _0x2193ed[_0xf361('0x82')](_0x34a4cf,{'transaction':_0x4a7179});}})[_0xf361('0x28')](function(){_0x34a4cf['forEach'](function(_0x2104e8){socket['emit']('userSmsQueue:remove',{'UserId':_0x2104e8,'SmsQueueId':_0x2193ed['id']});});});});});});})[_0xf361('0x28')](respondWithStatusCode(_0x25cc89,null))[_0xf361('0x4a')](handleError(_0x25cc89,null));};exports[_0xf361('0x83')]=function(_0x119ee8,_0x1718c8,_0x328dd5){return db[_0xf361('0x45')][_0xf361('0x4e')]({'where':{'id':_0x119ee8[_0xf361('0x56')]['id']}})['then'](handleEntityNotFound(_0x1718c8,null))['then'](function(_0x5c9c9f){if(_0x5c9c9f){return _0x5c9c9f[_0xf361('0x83')](_0x119ee8['body'][_0xf361('0x66')],_[_0xf361('0x84')](_0x119ee8[_0xf361('0x50')],[_0xf361('0x66'),'id'])||{})[_0xf361('0x85')](function(_0x32435c){for(var _0x3d509b=0x0;_0x3d509b<_0x119ee8['body']['ids'][_0xf361('0x4d')];_0x3d509b+=0x1){socket[_0xf361('0x86')](_0xf361('0x70'),{'UserId':_0x119ee8[_0xf361('0x50')][_0xf361('0x66')][_0x3d509b],'SmsQueueId':_0x119ee8[_0xf361('0x56')]['id']});}return _0x32435c;});}})[_0xf361('0x28')](respondWithResult(_0x1718c8,null))[_0xf361('0x4a')](handleError(_0x1718c8,null));};exports['removeAgents']=function(_0x1a7444,_0x2ef3ec,_0x227588){return db['SmsQueue'][_0xf361('0x4e')]({'where':{'id':_0x1a7444['params']['id']}})[_0xf361('0x28')](handleEntityNotFound(_0x2ef3ec,null))[_0xf361('0x28')](function(_0xe104e4){if(_0xe104e4){return _0xe104e4[_0xf361('0x82')](_0x1a7444['query'][_0xf361('0x66')])['then'](function(){if(_['isArray'](_0x1a7444[_0xf361('0x36')][_0xf361('0x66')])){for(var _0x16bc79=0x0;_0x16bc79<_0x1a7444[_0xf361('0x36')][_0xf361('0x66')]['length'];_0x16bc79+=0x1){socket['emit'](_0xf361('0x87'),{'UserId':Number(_0x1a7444[_0xf361('0x36')][_0xf361('0x66')][_0x16bc79]),'SmsQueueId':Number(_0x1a7444[_0xf361('0x56')]['id'])});}}else{socket[_0xf361('0x86')](_0xf361('0x87'),{'UserId':Number(_0x1a7444['query'][_0xf361('0x66')]),'SmsQueueId':Number(_0x1a7444[_0xf361('0x56')]['id'])});}});}})[_0xf361('0x28')](respondWithStatusCode(_0x2ef3ec,null))['catch'](handleError(_0x2ef3ec,null));};exports['getAgents']=function(_0x17d476,_0x59fff0,_0x1cc81f){var _0x56dde9={};var _0x366297={};var _0x4a94ae;var _0x5f5033;return db['SmsQueue'][_0xf361('0x58')]({'where':{'id':_0x17d476['params']['id']}})[_0xf361('0x28')](handleEntityNotFound(_0x59fff0,null))['then'](function(_0x203477){if(_0x203477){_0x4a94ae=_0x203477;_0x366297[_0xf361('0x4c')]=_[_0xf361('0x37')](db[_0xf361('0x5c')][_0xf361('0x31')]);_0x366297['query']=_[_0xf361('0x37')](_0x17d476[_0xf361('0x36')]);_0x366297[_0xf361('0x38')]=_['intersection'](_0x366297[_0xf361('0x4c')],_0x366297[_0xf361('0x36')]);_0x56dde9[_0xf361('0x39')]=_[_0xf361('0x3a')](_0x366297['model'],qs['fields'](_0x17d476['query'][_0xf361('0x3b')]));_0x56dde9[_0xf361('0x39')]=_0x56dde9[_0xf361('0x39')][_0xf361('0x4d')]?_0x56dde9[_0xf361('0x39')]:_0x366297['model'];_0x56dde9[_0xf361('0x5a')]=qs[_0xf361('0x3e')](_0x17d476['query'][_0xf361('0x3e')]);_0x56dde9['where']=qs[_0xf361('0x38')](_[_0xf361('0x40')](_0x17d476[_0xf361('0x36')],_0x366297[_0xf361('0x38')]));if(_0x17d476['query']['filter']){_0x56dde9[_0xf361('0x3f')]=_[_0xf361('0x43')](_0x56dde9[_0xf361('0x3f')],{'$or':_['map'](_0x56dde9[_0xf361('0x39')],function(_0x20f08c){var _0x418de6={};_0x418de6[_0x20f08c]={'$like':'%'+_0x17d476[_0xf361('0x36')][_0xf361('0x41')]+'%'};return _0x418de6;})});}_0x56dde9=_['merge']({},_0x56dde9,_0x17d476[_0xf361('0x44')]);return _0x4a94ae[_0xf361('0x88')](_0x56dde9);}})[_0xf361('0x28')](function(_0x4ebcba){if(_0x4ebcba){_0x5f5033=_0x4ebcba[_0xf361('0x4d')];if(!_0x17d476['query']['hasOwnProperty']('nolimit')){_0x56dde9[_0xf361('0x21')]=qs[_0xf361('0x21')](_0x17d476[_0xf361('0x36')][_0xf361('0x21')]);_0x56dde9['offset']=qs[_0xf361('0x20')](_0x17d476[_0xf361('0x36')][_0xf361('0x20')]);}return _0x4a94ae['getAgents'](_0x56dde9);}})[_0xf361('0x28')](function(_0xf4d7d9){if(_0xf4d7d9){return _0xf4d7d9?{'count':_0x5f5033,'rows':_0xf4d7d9}:null;}})[_0xf361('0x28')](respondWithResult(_0x59fff0,null))[_0xf361('0x4a')](handleError(_0x59fff0,null));};
\ No newline at end of file
diff --git a/server/api/smsQueue/smsQueue.events.js b/server/api/smsQueue/smsQueue.events.js
index 9c14ea6..309c061 100644
--- a/server/api/smsQueue/smsQueue.events.js
+++ b/server/api/smsQueue/smsQueue.events.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xa36e=['hasOwnProperty','hook','exports','events','../../mysqldb','SmsQueue','save','emit'];(function(_0x4b7895,_0x3c4f5d){var _0x264180=function(_0xe0e861){while(--_0xe0e861){_0x4b7895['push'](_0x4b7895['shift']());}};_0x264180(++_0x3c4f5d);}(_0xa36e,0x1b3));var _0xea36=function(_0x190f64,_0x2ae3ac){_0x190f64=_0x190f64-0x0;var _0x2470af=_0xa36e[_0x190f64];return _0x2470af;};'use strict';var EventEmitter=require(_0xea36('0x0'));var SmsQueue=require(_0xea36('0x1'))['db'][_0xea36('0x2')];var SmsQueueEvents=new EventEmitter();SmsQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xea36('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x31355b){return function(_0x11b436,_0x3d4091,_0xde8a2){SmsQueueEvents[_0xea36('0x4')](_0x31355b+':'+_0x11b436['id'],_0x11b436);SmsQueueEvents['emit'](_0x31355b,_0x11b436);_0xde8a2(null);};}for(var e in events){if(events[_0xea36('0x5')](e)){var event=events[e];SmsQueue[_0xea36('0x6')](e,emitEvent(event));}}module[_0xea36('0x7')]=SmsQueueEvents;
\ No newline at end of file
+var _0xefd2=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','SmsQueue','setMaxListeners','save','update','remove'];(function(_0xac151d,_0x4ea1d2){var _0x111dba=function(_0x13d7f4){while(--_0x13d7f4){_0xac151d['push'](_0xac151d['shift']());}};_0x111dba(++_0x4ea1d2);}(_0xefd2,0xca));var _0x2efd=function(_0x35da42,_0x5c2610){_0x35da42=_0x35da42-0x0;var _0x370035=_0xefd2[_0x35da42];return _0x370035;};'use strict';var EventEmitter=require(_0x2efd('0x0'));var SmsQueue=require(_0x2efd('0x1'))['db'][_0x2efd('0x2')];var SmsQueueEvents=new EventEmitter();SmsQueueEvents[_0x2efd('0x3')](0x0);var events={'afterCreate':_0x2efd('0x4'),'afterUpdate':_0x2efd('0x5'),'afterDestroy':_0x2efd('0x6')};function emitEvent(_0x773622){return function(_0x173080,_0x4830db,_0x196912){SmsQueueEvents[_0x2efd('0x7')](_0x773622+':'+_0x173080['id'],_0x173080);SmsQueueEvents['emit'](_0x773622,_0x173080);_0x196912(null);};}for(var e in events){if(events[_0x2efd('0x8')](e)){var event=events[e];SmsQueue[_0x2efd('0x9')](e,emitEvent(event));}}module[_0x2efd('0xa')]=SmsQueueEvents;
\ No newline at end of file
diff --git a/server/api/smsQueue/smsQueue.model.js b/server/api/smsQueue/smsQueue.model.js
index 652d5ac..8071613 100644
--- a/server/api/smsQueue/smsQueue.model.js
+++ b/server/api/smsQueue/smsQueue.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xb66c=['sms_queues','lodash','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','./smsQueue.attributes','exports','define','SmsQueue'];(function(_0x3836f6,_0x59d9c2){var _0x5cdb23=function(_0x343945){while(--_0x343945){_0x3836f6['push'](_0x3836f6['shift']());}};_0x5cdb23(++_0x59d9c2);}(_0xb66c,0x175));var _0xcb66=function(_0x209e0a,_0xcb4b2d){_0x209e0a=_0x209e0a-0x0;var _0x35d3c5=_0xb66c[_0x209e0a];return _0x35d3c5;};'use strict';var _=require(_0xcb66('0x0'));var util=require('util');var logger=require(_0xcb66('0x1'))('api');var moment=require(_0xcb66('0x2'));var BPromise=require(_0xcb66('0x3'));var rp=require(_0xcb66('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xcb66('0x5'));var config=require(_0xcb66('0x6'));var attributes=require(_0xcb66('0x7'));module[_0xcb66('0x8')]=function(_0x5d766d,_0x518163){return _0x5d766d[_0xcb66('0x9')](_0xcb66('0xa'),attributes,{'tableName':_0xcb66('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x9b83=['rimraf','../../config/environment','exports','define','SmsQueue','sms_queues','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x56aabf,_0x461d46){var _0x8b2a1e=function(_0x46d8d7){while(--_0x46d8d7){_0x56aabf['push'](_0x56aabf['shift']());}};_0x8b2a1e(++_0x461d46);}(_0x9b83,0x84));var _0x39b8=function(_0x4a3898,_0x4c9853){_0x4a3898=_0x4a3898-0x0;var _0x25ceb0=_0x9b83[_0x4a3898];return _0x25ceb0;};'use strict';var _=require(_0x39b8('0x0'));var util=require(_0x39b8('0x1'));var logger=require(_0x39b8('0x2'))(_0x39b8('0x3'));var moment=require(_0x39b8('0x4'));var BPromise=require(_0x39b8('0x5'));var rp=require(_0x39b8('0x6'));var fs=require('fs');var path=require(_0x39b8('0x7'));var rimraf=require(_0x39b8('0x8'));var config=require(_0x39b8('0x9'));var attributes=require('./smsQueue.attributes');module[_0x39b8('0xa')]=function(_0x4a8ff8,_0x563fe1){return _0x4a8ff8[_0x39b8('0xb')](_0x39b8('0xc'),attributes,{'tableName':_0x39b8('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/smsQueue/smsQueue.rpc.js b/server/api/smsQueue/smsQueue.rpc.js
index f68cdfb..8560d31 100644
--- a/server/api/smsQueue/smsQueue.rpc.js
+++ b/server/api/smsQueue/smsQueue.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xa52c=['jayson/promise','client','http','redis','defaults','localhost','register','request','info','SmsQueue,\x20%s,\x20%s','request\x20sent','debug','SmsQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetSmsQueue','SmsQueue','findAll','options','raw','where','limit','map','include','model','attributes','ShowSmsQueue','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment'];(function(_0x2ed8f3,_0x4aa12f){var _0x525a55=function(_0x4cfb58){while(--_0x4cfb58){_0x2ed8f3['push'](_0x2ed8f3['shift']());}};_0x525a55(++_0x4aa12f);}(_0xa52c,0x1af));var _0xca52=function(_0x2e9b28,_0x543b5e){_0x2e9b28=_0x2e9b28-0x0;var _0x953e17=_0xa52c[_0x2e9b28];return _0x953e17;};'use strict';var _=require(_0xca52('0x0'));var util=require(_0xca52('0x1'));var moment=require(_0xca52('0x2'));var BPromise=require(_0xca52('0x3'));var rs=require(_0xca52('0x4'));var fs=require('fs');var Redis=require(_0xca52('0x5'));var db=require(_0xca52('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xca52('0x7'))('rpc');var config=require(_0xca52('0x8'));var jayson=require(_0xca52('0x9'));var client=jayson[_0xca52('0xa')][_0xca52('0xb')]({'port':0x232a});config[_0xca52('0xc')]=_[_0xca52('0xd')](config['redis'],{'host':_0xca52('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xca52('0xc')]));require('./smsQueue.socket')[_0xca52('0xf')](socket);function respondWithRpcPromise(_0x49e3c0,_0xfb6532,_0x4e9fd8){return new BPromise(function(_0x7c0ed2,_0x2019b4){return client[_0xca52('0x10')](_0x49e3c0,_0x4e9fd8)['then'](function(_0x2bbca8){logger[_0xca52('0x11')](_0xca52('0x12'),_0xfb6532,_0xca52('0x13'));logger[_0xca52('0x14')](_0xca52('0x15'),_0xfb6532,'request\x20sent',JSON[_0xca52('0x16')](_0x2bbca8));if(_0x2bbca8[_0xca52('0x17')]){if(_0x2bbca8[_0xca52('0x17')][_0xca52('0x18')]===0x1f4){logger['error'](_0xca52('0x12'),_0xfb6532,_0x2bbca8[_0xca52('0x17')][_0xca52('0x19')]);return _0x2019b4(_0x2bbca8[_0xca52('0x17')][_0xca52('0x19')]);}logger[_0xca52('0x17')](_0xca52('0x12'),_0xfb6532,_0x2bbca8[_0xca52('0x17')][_0xca52('0x19')]);return _0x7c0ed2(_0x2bbca8['error'][_0xca52('0x19')]);}else{logger[_0xca52('0x11')](_0xca52('0x12'),_0xfb6532,_0xca52('0x13'));_0x7c0ed2(_0x2bbca8[_0xca52('0x1a')]['message']);}})[_0xca52('0x1b')](function(_0x1e5302){logger[_0xca52('0x17')](_0xca52('0x12'),_0xfb6532,_0x1e5302);_0x2019b4(_0x1e5302);});});}exports[_0xca52('0x1c')]=function(_0x1cfb4b){var _0x1cfdc7=this;return new Promise(function(_0xe316f5,_0x3e03e6){return db[_0xca52('0x1d')][_0xca52('0x1e')]({'raw':_0x1cfb4b[_0xca52('0x1f')]?_0x1cfb4b[_0xca52('0x1f')][_0xca52('0x20')]===undefined?!![]:![]:!![],'where':_0x1cfb4b[_0xca52('0x1f')]?_0x1cfb4b['options'][_0xca52('0x21')]||null:null,'attributes':_0x1cfb4b[_0xca52('0x1f')]?_0x1cfb4b[_0xca52('0x1f')]['attributes']||null:null,'limit':_0x1cfb4b[_0xca52('0x1f')]?_0x1cfb4b[_0xca52('0x1f')][_0xca52('0x22')]||null:null,'include':_0x1cfb4b[_0xca52('0x1f')]?_0x1cfb4b['options']['include']?_[_0xca52('0x23')](_0x1cfb4b[_0xca52('0x1f')][_0xca52('0x24')],function(_0x1456df){return{'model':db[_0x1456df[_0xca52('0x25')]],'as':_0x1456df['as'],'attributes':_0x1456df['attributes'],'include':_0x1456df[_0xca52('0x24')]?_[_0xca52('0x23')](_0x1456df[_0xca52('0x24')],function(_0x517bc4){return{'model':db[_0x517bc4[_0xca52('0x25')]],'as':_0x517bc4['as'],'attributes':_0x517bc4[_0xca52('0x26')],'include':_0x517bc4[_0xca52('0x24')]?_[_0xca52('0x23')](_0x517bc4[_0xca52('0x24')],function(_0x3c9c91){return{'model':db[_0x3c9c91['model']],'as':_0x3c9c91['as'],'attributes':_0x3c9c91[_0xca52('0x26')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x392c08){logger[_0xca52('0x11')]('GetSmsQueue',_0x1cfb4b);logger['debug']('GetSmsQueue',_0x1cfb4b,JSON['stringify'](_0x392c08));_0xe316f5(_0x392c08);})['catch'](function(_0x4a5f22){logger['error'](_0xca52('0x1c'),_0x4a5f22['message'],_0x1cfb4b);_0x3e03e6(_0x1cfdc7['error'](0x1f4,_0x4a5f22['message']));});});};exports['ShowSmsQueue']=function(_0x394aaa){var _0x17f82f=this;return new Promise(function(_0x36d712,_0x5a4bbd){return db[_0xca52('0x1d')]['find']({'raw':_0x394aaa[_0xca52('0x1f')]?_0x394aaa[_0xca52('0x1f')][_0xca52('0x20')]===undefined?!![]:![]:!![],'where':_0x394aaa[_0xca52('0x1f')]?_0x394aaa['options']['where']||null:null,'attributes':_0x394aaa[_0xca52('0x1f')]?_0x394aaa['options'][_0xca52('0x26')]||null:null,'include':_0x394aaa[_0xca52('0x1f')]?_0x394aaa['options']['include']?_[_0xca52('0x23')](_0x394aaa[_0xca52('0x1f')][_0xca52('0x24')],function(_0x4589c2){return{'model':db[_0x4589c2[_0xca52('0x25')]],'as':_0x4589c2['as'],'attributes':_0x4589c2[_0xca52('0x26')],'include':_0x4589c2[_0xca52('0x24')]?_[_0xca52('0x23')](_0x4589c2[_0xca52('0x24')],function(_0x3c06b9){return{'model':db[_0x3c06b9[_0xca52('0x25')]],'as':_0x3c06b9['as'],'attributes':_0x3c06b9['attributes'],'include':_0x3c06b9[_0xca52('0x24')]?_[_0xca52('0x23')](_0x3c06b9[_0xca52('0x24')],function(_0x191cac){return{'model':db[_0x191cac[_0xca52('0x25')]],'as':_0x191cac['as'],'attributes':_0x191cac[_0xca52('0x26')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x587660){logger[_0xca52('0x11')]('ShowSmsQueue',_0x394aaa);logger[_0xca52('0x14')](_0xca52('0x27'),_0x394aaa,JSON[_0xca52('0x16')](_0x587660));_0x36d712(_0x587660);})[_0xca52('0x1b')](function(_0x124d33){logger['error'](_0xca52('0x27'),_0x124d33[_0xca52('0x19')],_0x394aaa);_0x5a4bbd(_0x17f82f[_0xca52('0x17')](0x1f4,_0x124d33['message']));});});};
\ No newline at end of file
+var _0xa80f=['info','request\x20sent','SmsQueue,\x20%s,\x20%s,\x20%s','error','code','message','SmsQueue,\x20%s,\x20%s','GetSmsQueue','SmsQueue','findAll','options','where','attributes','limit','include','map','model','debug','stringify','catch','ShowSmsQueue','find','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','redis','defaults','./smsQueue.socket','register','then'];(function(_0x427352,_0x1bce61){var _0x23e0e6=function(_0x2a42a9){while(--_0x2a42a9){_0x427352['push'](_0x427352['shift']());}};_0x23e0e6(++_0x1bce61);}(_0xa80f,0x1ea));var _0xfa80=function(_0x5993de,_0x1e902f){_0x5993de=_0x5993de-0x0;var _0x481faf=_0xa80f[_0x5993de];return _0x481faf;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xfa80('0x0'));var BPromise=require(_0xfa80('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xfa80('0x2'));var db=require(_0xfa80('0x3'))['db'];var utils=require(_0xfa80('0x4'));var logger=require(_0xfa80('0x5'))('rpc');var config=require(_0xfa80('0x6'));var jayson=require(_0xfa80('0x7'));var client=jayson['client'][_0xfa80('0x8')]({'port':0x232a});config[_0xfa80('0x9')]=_[_0xfa80('0xa')](config[_0xfa80('0x9')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xfa80('0x9')]));require(_0xfa80('0xb'))[_0xfa80('0xc')](socket);function respondWithRpcPromise(_0xe4e554,_0x330b99,_0x356e8a){return new BPromise(function(_0x1077e3,_0x5275d4){return client['request'](_0xe4e554,_0x356e8a)[_0xfa80('0xd')](function(_0x1c5572){logger[_0xfa80('0xe')]('SmsQueue,\x20%s,\x20%s',_0x330b99,_0xfa80('0xf'));logger['debug'](_0xfa80('0x10'),_0x330b99,'request\x20sent',JSON['stringify'](_0x1c5572));if(_0x1c5572[_0xfa80('0x11')]){if(_0x1c5572[_0xfa80('0x11')][_0xfa80('0x12')]===0x1f4){logger[_0xfa80('0x11')]('SmsQueue,\x20%s,\x20%s',_0x330b99,_0x1c5572[_0xfa80('0x11')]['message']);return _0x5275d4(_0x1c5572[_0xfa80('0x11')]['message']);}logger[_0xfa80('0x11')]('SmsQueue,\x20%s,\x20%s',_0x330b99,_0x1c5572['error']['message']);return _0x1077e3(_0x1c5572['error'][_0xfa80('0x13')]);}else{logger[_0xfa80('0xe')]('SmsQueue,\x20%s,\x20%s',_0x330b99,_0xfa80('0xf'));_0x1077e3(_0x1c5572['result']['message']);}})['catch'](function(_0x3f1f91){logger[_0xfa80('0x11')](_0xfa80('0x14'),_0x330b99,_0x3f1f91);_0x5275d4(_0x3f1f91);});});}exports[_0xfa80('0x15')]=function(_0x4ac344){var _0x405bc2=this;return new Promise(function(_0x4de98d,_0x2c1953){return db[_0xfa80('0x16')][_0xfa80('0x17')]({'raw':_0x4ac344[_0xfa80('0x18')]?_0x4ac344[_0xfa80('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x4ac344[_0xfa80('0x18')]?_0x4ac344[_0xfa80('0x18')][_0xfa80('0x19')]||null:null,'attributes':_0x4ac344[_0xfa80('0x18')]?_0x4ac344['options'][_0xfa80('0x1a')]||null:null,'limit':_0x4ac344[_0xfa80('0x18')]?_0x4ac344['options'][_0xfa80('0x1b')]||null:null,'include':_0x4ac344[_0xfa80('0x18')]?_0x4ac344[_0xfa80('0x18')][_0xfa80('0x1c')]?_[_0xfa80('0x1d')](_0x4ac344[_0xfa80('0x18')][_0xfa80('0x1c')],function(_0x1a1a18){return{'model':db[_0x1a1a18[_0xfa80('0x1e')]],'as':_0x1a1a18['as'],'attributes':_0x1a1a18[_0xfa80('0x1a')],'include':_0x1a1a18['include']?_[_0xfa80('0x1d')](_0x1a1a18['include'],function(_0x472247){return{'model':db[_0x472247[_0xfa80('0x1e')]],'as':_0x472247['as'],'attributes':_0x472247['attributes'],'include':_0x472247['include']?_['map'](_0x472247[_0xfa80('0x1c')],function(_0x59316a){return{'model':db[_0x59316a[_0xfa80('0x1e')]],'as':_0x59316a['as'],'attributes':_0x59316a[_0xfa80('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xfa80('0xd')](function(_0x59a1fb){logger[_0xfa80('0xe')](_0xfa80('0x15'),_0x4ac344);logger[_0xfa80('0x1f')](_0xfa80('0x15'),_0x4ac344,JSON[_0xfa80('0x20')](_0x59a1fb));_0x4de98d(_0x59a1fb);})[_0xfa80('0x21')](function(_0x467a66){logger[_0xfa80('0x11')](_0xfa80('0x15'),_0x467a66['message'],_0x4ac344);_0x2c1953(_0x405bc2['error'](0x1f4,_0x467a66[_0xfa80('0x13')]));});});};exports[_0xfa80('0x22')]=function(_0x352f8b){var _0x1fd636=this;return new Promise(function(_0x193192,_0x41ae75){return db['SmsQueue'][_0xfa80('0x23')]({'raw':_0x352f8b[_0xfa80('0x18')]?_0x352f8b[_0xfa80('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x352f8b[_0xfa80('0x18')]?_0x352f8b[_0xfa80('0x18')]['where']||null:null,'attributes':_0x352f8b[_0xfa80('0x18')]?_0x352f8b[_0xfa80('0x18')][_0xfa80('0x1a')]||null:null,'include':_0x352f8b[_0xfa80('0x18')]?_0x352f8b['options'][_0xfa80('0x1c')]?_[_0xfa80('0x1d')](_0x352f8b['options'][_0xfa80('0x1c')],function(_0x826e75){return{'model':db[_0x826e75[_0xfa80('0x1e')]],'as':_0x826e75['as'],'attributes':_0x826e75[_0xfa80('0x1a')],'include':_0x826e75[_0xfa80('0x1c')]?_[_0xfa80('0x1d')](_0x826e75[_0xfa80('0x1c')],function(_0x18ccc6){return{'model':db[_0x18ccc6[_0xfa80('0x1e')]],'as':_0x18ccc6['as'],'attributes':_0x18ccc6['attributes'],'include':_0x18ccc6[_0xfa80('0x1c')]?_[_0xfa80('0x1d')](_0x18ccc6['include'],function(_0x2febf2){return{'model':db[_0x2febf2[_0xfa80('0x1e')]],'as':_0x2febf2['as'],'attributes':_0x2febf2['attributes']};}):[]};}):[]};}):[]:[]})[_0xfa80('0xd')](function(_0x5a90e5){logger[_0xfa80('0xe')](_0xfa80('0x22'),_0x352f8b);logger['debug'](_0xfa80('0x22'),_0x352f8b,JSON[_0xfa80('0x20')](_0x5a90e5));_0x193192(_0x5a90e5);})[_0xfa80('0x21')](function(_0x3d361c){logger[_0xfa80('0x11')](_0xfa80('0x22'),_0x3d361c[_0xfa80('0x13')],_0x352f8b);_0x41ae75(_0x1fd636['error'](0x1f4,_0x3d361c[_0xfa80('0x13')]));});});};
\ No newline at end of file
diff --git a/server/api/smsQueue/smsQueue.socket.js b/server/api/smsQueue/smsQueue.socket.js
index ab6e360..eef8110 100644
--- a/server/api/smsQueue/smsQueue.socket.js
+++ b/server/api/smsQueue/smsQueue.socket.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x61a9=['update','emit','length','smsQueue:','./smsQueue.events','save','remove'];(function(_0x1b55d1,_0x52da8b){var _0x398a50=function(_0x10d62c){while(--_0x10d62c){_0x1b55d1['push'](_0x1b55d1['shift']());}};_0x398a50(++_0x52da8b);}(_0x61a9,0x13f));var _0x961a=function(_0x1ef8f2,_0x1dbf15){_0x1ef8f2=_0x1ef8f2-0x0;var _0x4b5946=_0x61a9[_0x1ef8f2];return _0x4b5946;};'use strict';var SmsQueueEvents=require(_0x961a('0x0'));var events=[_0x961a('0x1'),_0x961a('0x2'),_0x961a('0x3')];function createListener(_0x36ac82,_0x20af20){return function(_0x53c347){_0x20af20[_0x961a('0x4')](_0x36ac82,_0x53c347);};}function removeListener(_0x168cec,_0x352e79){return function(){SmsQueueEvents['removeListener'](_0x168cec,_0x352e79);};}exports['register']=function(_0x3898bd){for(var _0x16260c=0x0,_0x4dee25=events[_0x961a('0x5')];_0x16260c<_0x4dee25;_0x16260c++){var _0x5ee5b3=events[_0x16260c];var _0x5f2a74=createListener(_0x961a('0x6')+_0x5ee5b3,_0x3898bd);SmsQueueEvents['on'](_0x5ee5b3,_0x5f2a74);}};
\ No newline at end of file
+var _0xf4c2=['register','length','smsQueue:','./smsQueue.events','save','remove','update','emit'];(function(_0x1bfb0e,_0x5074d2){var _0x5e9906=function(_0x49505a){while(--_0x49505a){_0x1bfb0e['push'](_0x1bfb0e['shift']());}};_0x5e9906(++_0x5074d2);}(_0xf4c2,0x14b));var _0x2f4c=function(_0x5b6eb8,_0x4fd68d){_0x5b6eb8=_0x5b6eb8-0x0;var _0x2b23d4=_0xf4c2[_0x5b6eb8];return _0x2b23d4;};'use strict';var SmsQueueEvents=require(_0x2f4c('0x0'));var events=[_0x2f4c('0x1'),_0x2f4c('0x2'),_0x2f4c('0x3')];function createListener(_0xc3bfb4,_0x6d4468){return function(_0x120038){_0x6d4468[_0x2f4c('0x4')](_0xc3bfb4,_0x120038);};}function removeListener(_0x653e78,_0x513ad0){return function(){SmsQueueEvents['removeListener'](_0x653e78,_0x513ad0);};}exports[_0x2f4c('0x5')]=function(_0x2c53ff){for(var _0x821704=0x0,_0x3b9fb1=events[_0x2f4c('0x6')];_0x821704<_0x3b9fb1;_0x821704++){var _0x2a8396=events[_0x821704];var _0x3bdc4f=createListener(_0x2f4c('0x7')+_0x2a8396,_0x2c53ff);SmsQueueEvents['on'](_0x2a8396,_0x3bdc4f);}};
\ No newline at end of file
diff --git a/server/api/smsQueueReport/index.js b/server/api/smsQueueReport/index.js
index 39217cd..48ce042 100644
--- a/server/api/smsQueueReport/index.js
+++ b/server/api/smsQueueReport/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x4537=['destroy','exports','multer','util','path','connect-timeout','Router','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/describe','describe','/:id','show','create','put','update','delete'];(function(_0x328f61,_0xc7ae7){var _0x177686=function(_0x38ea20){while(--_0x38ea20){_0x328f61['push'](_0x328f61['shift']());}};_0x177686(++_0xc7ae7);}(_0x4537,0x1ce));var _0x7453=function(_0x1cec7a,_0x30ab45){_0x1cec7a=_0x1cec7a-0x0;var _0x5cd440=_0x4537[_0x1cec7a];return _0x5cd440;};'use strict';var multer=require(_0x7453('0x0'));var util=require(_0x7453('0x1'));var path=require(_0x7453('0x2'));var timeout=require(_0x7453('0x3'));var express=require('express');var router=express[_0x7453('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x7453('0x5'));var config=require(_0x7453('0x6'));var controller=require('./smsQueueReport.controller');router['get']('/',auth[_0x7453('0x7')](),controller[_0x7453('0x8')]);router[_0x7453('0x9')](_0x7453('0xa'),auth[_0x7453('0x7')](),controller[_0x7453('0xb')]);router[_0x7453('0x9')](_0x7453('0xc'),auth[_0x7453('0x7')](),controller[_0x7453('0xd')]);router['post']('/',auth[_0x7453('0x7')](),controller[_0x7453('0xe')]);router[_0x7453('0xf')](_0x7453('0xc'),auth['isAuthenticated'](),controller[_0x7453('0x10')]);router[_0x7453('0x11')]('/:id',auth[_0x7453('0x7')](),controller[_0x7453('0x12')]);module[_0x7453('0x13')]=router;
\ No newline at end of file
+var _0x7b65=['index','/describe','describe','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./smsQueueReport.controller','get','isAuthenticated'];(function(_0x309cbc,_0x543e8f){var _0x2ac832=function(_0xfe43bc){while(--_0xfe43bc){_0x309cbc['push'](_0x309cbc['shift']());}};_0x2ac832(++_0x543e8f);}(_0x7b65,0xa6));var _0x57b6=function(_0x1e0c76,_0x360a44){_0x1e0c76=_0x1e0c76-0x0;var _0x2e28f0=_0x7b65[_0x1e0c76];return _0x2e28f0;};'use strict';var multer=require(_0x57b6('0x0'));var util=require(_0x57b6('0x1'));var path=require('path');var timeout=require(_0x57b6('0x2'));var express=require(_0x57b6('0x3'));var router=express[_0x57b6('0x4')]();var auth=require(_0x57b6('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x57b6('0x6'));var controller=require(_0x57b6('0x7'));router[_0x57b6('0x8')]('/',auth[_0x57b6('0x9')](),controller[_0x57b6('0xa')]);router[_0x57b6('0x8')](_0x57b6('0xb'),auth['isAuthenticated'](),controller[_0x57b6('0xc')]);router[_0x57b6('0x8')](_0x57b6('0xd'),auth[_0x57b6('0x9')](),controller[_0x57b6('0xe')]);router[_0x57b6('0xf')]('/',auth['isAuthenticated'](),controller[_0x57b6('0x10')]);router[_0x57b6('0x11')]('/:id',auth['isAuthenticated'](),controller[_0x57b6('0x12')]);router[_0x57b6('0x13')](_0x57b6('0xd'),auth['isAuthenticated'](),controller[_0x57b6('0x14')]);module[_0x57b6('0x15')]=router;
\ No newline at end of file
diff --git a/server/api/smsQueueReport/smsQueueReport.attributes.js b/server/api/smsQueueReport/smsQueueReport.attributes.js
index fb9c596..33ef17f 100644
--- a/server/api/smsQueueReport/smsQueueReport.attributes.js
+++ b/server/api/smsQueueReport/smsQueueReport.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xc73e=['DATE','moment','sequelize','STRING'];(function(_0x302ac9,_0x16401a){var _0x80e1ff=function(_0x129392){while(--_0x129392){_0x302ac9['push'](_0x302ac9['shift']());}};_0x80e1ff(++_0x16401a);}(_0xc73e,0xbd));var _0xec73=function(_0x37242c,_0x30e3e1){_0x37242c=_0x37242c-0x0;var _0x5e64e9=_0xc73e[_0x37242c];return _0x5e64e9;};'use strict';var moment=require(_0xec73('0x0'));var Sequelize=require(_0xec73('0x1'));module['exports']={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0xec73('0x2')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0xec73('0x3')]},'acceptAt':{'type':Sequelize[_0xec73('0x3')]},'exitAt':{'type':Sequelize[_0xec73('0x3')]},'reason':{'type':Sequelize[_0xec73('0x2')]}};
\ No newline at end of file
+var _0x935d=['moment','sequelize','STRING','DATE'];(function(_0x2dadb9,_0x42cfe6){var _0x2f0097=function(_0x21163f){while(--_0x21163f){_0x2dadb9['push'](_0x2dadb9['shift']());}};_0x2f0097(++_0x42cfe6);}(_0x935d,0x144));var _0xd935=function(_0x3816c2,_0xb221e1){_0x3816c2=_0x3816c2-0x0;var _0x144669=_0x935d[_0x3816c2];return _0x144669;};'use strict';var moment=require(_0xd935('0x0'));var Sequelize=require(_0xd935('0x1'));module['exports']={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0xd935('0x2')]},'joinAt':{'type':Sequelize[_0xd935('0x3')]},'leaveAt':{'type':Sequelize[_0xd935('0x3')]},'acceptAt':{'type':Sequelize[_0xd935('0x3')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0xd935('0x2')]}};
\ No newline at end of file
diff --git a/server/api/smsQueueReport/smsQueueReport.controller.js b/server/api/smsQueueReport/smsQueueReport.controller.js
index 9bb978f..86ef9fd 100644
--- a/server/api/smsQueueReport/smsQueueReport.controller.js
+++ b/server/api/smsQueueReport/smsQueueReport.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x814b=['index','map','rawAttributes','fieldName','key','model','keys','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','sort','filters','pick','filter','where','merge','VIRTUAL','include','findAll','rows','catch','show','SmsQueueReport','options','find','create','body','params','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','save','update','destroy','then','error','stack','name','send'];(function(_0x26a815,_0xcde2b9){var _0x539ed1=function(_0x66f759){while(--_0x66f759){_0x26a815['push'](_0x26a815['shift']());}};_0x539ed1(++_0xcde2b9);}(_0x814b,0x1a2));var _0xb814=function(_0x56fb33,_0x37be08){_0x56fb33=_0x56fb33-0x0;var _0x435ee4=_0x814b[_0x56fb33];return _0x435ee4;};'use strict';var pdf=require(_0xb814('0x0'));var emlformat=require(_0xb814('0x1'));var rimraf=require(_0xb814('0x2'));var zipdir=require(_0xb814('0x3'));var jsonpatch=require(_0xb814('0x4'));var rp=require(_0xb814('0x5'));var moment=require('moment');var BPromise=require(_0xb814('0x6'));var Mustache=require(_0xb814('0x7'));var util=require(_0xb814('0x8'));var path=require(_0xb814('0x9'));var sox=require(_0xb814('0xa'));var csv=require(_0xb814('0xb'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xb814('0xc'));var squel=require(_0xb814('0xd'));var crypto=require('crypto');var jsforce=require(_0xb814('0xe'));var deskjs=require(_0xb814('0xf'));var toCsv=require(_0xb814('0xb'));var querystring=require(_0xb814('0x10'));var Papa=require(_0xb814('0x11'));var Redis=require(_0xb814('0x12'));var authService=require(_0xb814('0x13'));var qs=require(_0xb814('0x14'));var as=require(_0xb814('0x15'));var hardwareService=require(_0xb814('0x16'));var logger=require(_0xb814('0x17'))('api');var utils=require(_0xb814('0x18'));var config=require('../../config/environment');var db=require(_0xb814('0x19'))['db'];function respondWithStatusCode(_0x15d6ef,_0x35b10d){_0x35b10d=_0x35b10d||0xcc;return function(_0x2cc46b){if(_0x2cc46b){return _0x15d6ef[_0xb814('0x1a')](_0x35b10d);}return _0x15d6ef[_0xb814('0x1b')](_0x35b10d)[_0xb814('0x1c')]();};}function respondWithResult(_0x41ed7b,_0xa0a2e5){_0xa0a2e5=_0xa0a2e5||0xc8;return function(_0x2ab627){if(_0x2ab627){return _0x41ed7b[_0xb814('0x1b')](_0xa0a2e5)[_0xb814('0x1d')](_0x2ab627);}};}function respondWithFilteredResult(_0x17f5bd,_0x39bfcf){return function(_0x303aca){if(_0x303aca){var _0x3a71d6=_0x303aca[_0xb814('0x1e')],_0x45e0d0=_0x39bfcf[_0xb814('0x1f')],_0x265a83=_0x39bfcf['offset']+_0x39bfcf[_0xb814('0x20')],_0x125ce2;if(_0x265a83>=_0x3a71d6){_0x265a83=_0x3a71d6;_0x125ce2=0xc8;}else{_0x125ce2=0xce;}_0x17f5bd['status'](_0x125ce2);return _0x17f5bd[_0xb814('0x21')](_0xb814('0x22'),_0x45e0d0+'-'+_0x265a83+'/'+_0x3a71d6)['json'](_0x303aca);}return null;};}function patchUpdates(_0x4b55a7){return function(_0x55d63c){try{jsonpatch[_0xb814('0x23')](_0x55d63c,_0x4b55a7,!![]);}catch(_0x4d5276){return BPromise['reject'](_0x4d5276);}return _0x55d63c[_0xb814('0x24')]();};}function saveUpdates(_0x24211d,_0x25b6b6){return function(_0x4e139e){if(_0x4e139e){return _0x4e139e[_0xb814('0x25')](_0x24211d)['then'](function(_0x1e6393){return _0x1e6393;});}return null;};}function removeEntity(_0x1808a3,_0x3b267e){return function(_0x470e81){if(_0x470e81){return _0x470e81[_0xb814('0x26')]()[_0xb814('0x27')](function(){_0x1808a3[_0xb814('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2ead86,_0x52b7a3){return function(_0x3f81d0){if(!_0x3f81d0){_0x2ead86[_0xb814('0x1a')](0x194);}return _0x3f81d0;};}function handleError(_0x31c7ec,_0x208927){_0x208927=_0x208927||0x1f4;return function(_0x1c8a2e){logger[_0xb814('0x28')](_0x1c8a2e[_0xb814('0x29')]);if(_0x1c8a2e['name']){delete _0x1c8a2e[_0xb814('0x2a')];}_0x31c7ec[_0xb814('0x1b')](_0x208927)[_0xb814('0x2b')](_0x1c8a2e);};}exports[_0xb814('0x2c')]=function(_0x32ed56,_0x1d5965){var _0x3f0150={},_0x1e4e89={},_0x5a6291={'count':0x0,'rows':[]};var _0x271aa8=_[_0xb814('0x2d')](db['SmsQueueReport'][_0xb814('0x2e')],function(_0x37d24d){return{'name':_0x37d24d[_0xb814('0x2f')],'type':_0x37d24d['type'][_0xb814('0x30')]};});_0x1e4e89[_0xb814('0x31')]=_['map'](_0x271aa8,_0xb814('0x2a'));_0x1e4e89['query']=_[_0xb814('0x32')](_0x32ed56['query']);_0x1e4e89['filters']=_[_0xb814('0x33')](_0x1e4e89['model'],_0x1e4e89[_0xb814('0x34')]);_0x3f0150[_0xb814('0x35')]=_[_0xb814('0x33')](_0x1e4e89['model'],qs['fields'](_0x32ed56[_0xb814('0x34')][_0xb814('0x36')]));_0x3f0150['attributes']=_0x3f0150[_0xb814('0x35')][_0xb814('0x37')]?_0x3f0150[_0xb814('0x35')]:_0x1e4e89[_0xb814('0x31')];if(!_0x32ed56[_0xb814('0x34')][_0xb814('0x38')](_0xb814('0x39'))){_0x3f0150['limit']=qs[_0xb814('0x20')](_0x32ed56[_0xb814('0x34')][_0xb814('0x20')]);_0x3f0150[_0xb814('0x1f')]=qs[_0xb814('0x1f')](_0x32ed56['query'][_0xb814('0x1f')]);}_0x3f0150['order']=qs[_0xb814('0x3a')](_0x32ed56[_0xb814('0x34')][_0xb814('0x3a')]);_0x3f0150['where']=qs[_0xb814('0x3b')](_[_0xb814('0x3c')](_0x32ed56['query'],_0x1e4e89[_0xb814('0x3b')]),_0x271aa8);if(_0x32ed56[_0xb814('0x34')][_0xb814('0x3d')]){_0x3f0150[_0xb814('0x3e')]=_[_0xb814('0x3f')](_0x3f0150[_0xb814('0x3e')],{'$or':_['map'](_0x271aa8,function(_0xa6ce87){if(_0xa6ce87['type']!==_0xb814('0x40')){var _0x4b5583={};_0x4b5583[_0xa6ce87[_0xb814('0x2a')]]={'$like':'%'+_0x32ed56['query'][_0xb814('0x3d')]+'%'};return _0x4b5583;}})});}_0x3f0150=_[_0xb814('0x3f')]({},_0x3f0150,_0x32ed56['options']);var _0x4d308a={'where':_0x3f0150['where']};return db['SmsQueueReport'][_0xb814('0x1e')](_0x4d308a)[_0xb814('0x27')](function(_0x38cdc2){_0x5a6291[_0xb814('0x1e')]=_0x38cdc2;if(_0x32ed56['query']['includeAll']){_0x3f0150[_0xb814('0x41')]=[{'all':!![]}];}return db['SmsQueueReport'][_0xb814('0x42')](_0x3f0150);})[_0xb814('0x27')](function(_0x178823){_0x5a6291[_0xb814('0x43')]=_0x178823;return _0x5a6291;})[_0xb814('0x27')](respondWithFilteredResult(_0x1d5965,_0x3f0150))[_0xb814('0x44')](handleError(_0x1d5965,null));};exports[_0xb814('0x45')]=function(_0x28b2b4,_0x31989d){var _0x4b6ff8={'raw':!![],'where':{'id':_0x28b2b4['params']['id']}},_0x544d36={};_0x544d36[_0xb814('0x31')]=_['keys'](db[_0xb814('0x46')]['rawAttributes']);_0x544d36[_0xb814('0x34')]=_[_0xb814('0x32')](_0x28b2b4[_0xb814('0x34')]);_0x544d36[_0xb814('0x3b')]=_['intersection'](_0x544d36[_0xb814('0x31')],_0x544d36[_0xb814('0x34')]);_0x4b6ff8[_0xb814('0x35')]=_[_0xb814('0x33')](_0x544d36[_0xb814('0x31')],qs[_0xb814('0x36')](_0x28b2b4['query'][_0xb814('0x36')]));_0x4b6ff8[_0xb814('0x35')]=_0x4b6ff8[_0xb814('0x35')][_0xb814('0x37')]?_0x4b6ff8[_0xb814('0x35')]:_0x544d36[_0xb814('0x31')];if(_0x28b2b4[_0xb814('0x34')]['includeAll']){_0x4b6ff8['include']=[{'all':!![]}];}_0x4b6ff8=_[_0xb814('0x3f')]({},_0x4b6ff8,_0x28b2b4[_0xb814('0x47')]);return db[_0xb814('0x46')][_0xb814('0x48')](_0x4b6ff8)[_0xb814('0x27')](handleEntityNotFound(_0x31989d,null))[_0xb814('0x27')](respondWithResult(_0x31989d,null))[_0xb814('0x44')](handleError(_0x31989d,null));};exports[_0xb814('0x49')]=function(_0x2eb9b6,_0x344198){return db[_0xb814('0x46')]['create'](_0x2eb9b6[_0xb814('0x4a')],{})[_0xb814('0x27')](respondWithResult(_0x344198,0xc9))['catch'](handleError(_0x344198,null));};exports[_0xb814('0x25')]=function(_0x55234d,_0x2fb0f7){if(_0x55234d[_0xb814('0x4a')]['id']){delete _0x55234d[_0xb814('0x4a')]['id'];}return db[_0xb814('0x46')][_0xb814('0x48')]({'where':{'id':_0x55234d[_0xb814('0x4b')]['id']}})[_0xb814('0x27')](handleEntityNotFound(_0x2fb0f7,null))[_0xb814('0x27')](saveUpdates(_0x55234d[_0xb814('0x4a')],null))[_0xb814('0x27')](respondWithResult(_0x2fb0f7,null))['catch'](handleError(_0x2fb0f7,null));};exports['destroy']=function(_0x32eca6,_0x30f07b){return db[_0xb814('0x46')][_0xb814('0x48')]({'where':{'id':_0x32eca6[_0xb814('0x4b')]['id']}})[_0xb814('0x27')](handleEntityNotFound(_0x30f07b,null))[_0xb814('0x27')](removeEntity(_0x30f07b,null))['catch'](handleError(_0x30f07b,null));};exports[_0xb814('0x4c')]=function(_0x388324,_0xf27a6e){return db['SmsQueueReport'][_0xb814('0x4c')]()['then'](respondWithResult(_0xf27a6e,null))[_0xb814('0x44')](handleError(_0xf27a6e,null));};
\ No newline at end of file
+var _0xe14b=['findAll','rows','catch','find','create','body','params','destroy','describe','html-pdf','eml-format','fast-json-patch','request-promise','bluebird','path','sox','to-csv','ejs','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','count','offset','limit','set','json','apply','reject','update','then','error','stack','name','index','SmsQueueReport','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','order','sort','filter','where','merge','VIRTUAL','options','includeAll','include'];(function(_0x2c719d,_0x4459f6){var _0x5f1c5a=function(_0x4f6da8){while(--_0x4f6da8){_0x2c719d['push'](_0x2c719d['shift']());}};_0x5f1c5a(++_0x4459f6);}(_0xe14b,0x93));var _0xbe14=function(_0x38ce60,_0x123fe2){_0x38ce60=_0x38ce60-0x0;var _0x44ab67=_0xe14b[_0x38ce60];return _0x44ab67;};'use strict';var pdf=require(_0xbe14('0x0'));var emlformat=require(_0xbe14('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xbe14('0x2'));var rp=require(_0xbe14('0x3'));var moment=require('moment');var BPromise=require(_0xbe14('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0xbe14('0x5'));var sox=require(_0xbe14('0x6'));var csv=require(_0xbe14('0x7'));var ejs=require(_0xbe14('0x8'));var fs=require('fs');var _=require(_0xbe14('0x9'));var squel=require(_0xbe14('0xa'));var crypto=require(_0xbe14('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xbe14('0xc'));var Papa=require(_0xbe14('0xd'));var Redis=require(_0xbe14('0xe'));var authService=require(_0xbe14('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xbe14('0x10'));var logger=require(_0xbe14('0x11'))('api');var utils=require(_0xbe14('0x12'));var config=require(_0xbe14('0x13'));var db=require(_0xbe14('0x14'))['db'];function respondWithStatusCode(_0x3d38c2,_0x27792f){_0x27792f=_0x27792f||0xcc;return function(_0x3b898d){if(_0x3b898d){return _0x3d38c2[_0xbe14('0x15')](_0x27792f);}return _0x3d38c2[_0xbe14('0x16')](_0x27792f)[_0xbe14('0x17')]();};}function respondWithResult(_0xa2cf72,_0x1e4826){_0x1e4826=_0x1e4826||0xc8;return function(_0x33fd54){if(_0x33fd54){return _0xa2cf72[_0xbe14('0x16')](_0x1e4826)['json'](_0x33fd54);}};}function respondWithFilteredResult(_0x55b3a7,_0x3f58f5){return function(_0x3dc4a9){if(_0x3dc4a9){var _0xf4ac9=_0x3dc4a9[_0xbe14('0x18')],_0x37ce4e=_0x3f58f5[_0xbe14('0x19')],_0x4e8f34=_0x3f58f5[_0xbe14('0x19')]+_0x3f58f5[_0xbe14('0x1a')],_0x21c789;if(_0x4e8f34>=_0xf4ac9){_0x4e8f34=_0xf4ac9;_0x21c789=0xc8;}else{_0x21c789=0xce;}_0x55b3a7[_0xbe14('0x16')](_0x21c789);return _0x55b3a7[_0xbe14('0x1b')]('Content-Range',_0x37ce4e+'-'+_0x4e8f34+'/'+_0xf4ac9)[_0xbe14('0x1c')](_0x3dc4a9);}return null;};}function patchUpdates(_0x456ca8){return function(_0x329588){try{jsonpatch[_0xbe14('0x1d')](_0x329588,_0x456ca8,!![]);}catch(_0x3249da){return BPromise[_0xbe14('0x1e')](_0x3249da);}return _0x329588['save']();};}function saveUpdates(_0x24f820,_0x4a1bbd){return function(_0x417c8d){if(_0x417c8d){return _0x417c8d[_0xbe14('0x1f')](_0x24f820)[_0xbe14('0x20')](function(_0x51dc0b){return _0x51dc0b;});}return null;};}function removeEntity(_0xe60f42,_0x56d845){return function(_0x3c1c85){if(_0x3c1c85){return _0x3c1c85['destroy']()[_0xbe14('0x20')](function(){_0xe60f42['status'](0xcc)[_0xbe14('0x17')]();});}};}function handleEntityNotFound(_0x3d3608,_0x505dbd){return function(_0x2da350){if(!_0x2da350){_0x3d3608['sendStatus'](0x194);}return _0x2da350;};}function handleError(_0x4587a8,_0x4851f8){_0x4851f8=_0x4851f8||0x1f4;return function(_0x36a21e){logger[_0xbe14('0x21')](_0x36a21e[_0xbe14('0x22')]);if(_0x36a21e[_0xbe14('0x23')]){delete _0x36a21e[_0xbe14('0x23')];}_0x4587a8[_0xbe14('0x16')](_0x4851f8)['send'](_0x36a21e);};}exports[_0xbe14('0x24')]=function(_0x1ba46a,_0x391556){var _0x169369={},_0x5dd475={},_0x16f884={'count':0x0,'rows':[]};var _0x29fc64=_['map'](db[_0xbe14('0x25')][_0xbe14('0x26')],function(_0x1c7cc7){return{'name':_0x1c7cc7[_0xbe14('0x27')],'type':_0x1c7cc7[_0xbe14('0x28')][_0xbe14('0x29')]};});_0x5dd475[_0xbe14('0x2a')]=_[_0xbe14('0x2b')](_0x29fc64,_0xbe14('0x23'));_0x5dd475[_0xbe14('0x2c')]=_[_0xbe14('0x2d')](_0x1ba46a[_0xbe14('0x2c')]);_0x5dd475[_0xbe14('0x2e')]=_[_0xbe14('0x2f')](_0x5dd475[_0xbe14('0x2a')],_0x5dd475[_0xbe14('0x2c')]);_0x169369[_0xbe14('0x30')]=_[_0xbe14('0x2f')](_0x5dd475[_0xbe14('0x2a')],qs[_0xbe14('0x31')](_0x1ba46a['query'][_0xbe14('0x31')]));_0x169369['attributes']=_0x169369['attributes'][_0xbe14('0x32')]?_0x169369['attributes']:_0x5dd475[_0xbe14('0x2a')];if(!_0x1ba46a[_0xbe14('0x2c')]['hasOwnProperty']('nolimit')){_0x169369['limit']=qs[_0xbe14('0x1a')](_0x1ba46a[_0xbe14('0x2c')]['limit']);_0x169369[_0xbe14('0x19')]=qs[_0xbe14('0x19')](_0x1ba46a[_0xbe14('0x2c')][_0xbe14('0x19')]);}_0x169369[_0xbe14('0x33')]=qs['sort'](_0x1ba46a['query'][_0xbe14('0x34')]);_0x169369['where']=qs['filters'](_['pick'](_0x1ba46a[_0xbe14('0x2c')],_0x5dd475[_0xbe14('0x2e')]),_0x29fc64);if(_0x1ba46a[_0xbe14('0x2c')][_0xbe14('0x35')]){_0x169369[_0xbe14('0x36')]=_[_0xbe14('0x37')](_0x169369[_0xbe14('0x36')],{'$or':_[_0xbe14('0x2b')](_0x29fc64,function(_0x2d9c12){if(_0x2d9c12[_0xbe14('0x28')]!==_0xbe14('0x38')){var _0x32c59d={};_0x32c59d[_0x2d9c12['name']]={'$like':'%'+_0x1ba46a['query'][_0xbe14('0x35')]+'%'};return _0x32c59d;}})});}_0x169369=_[_0xbe14('0x37')]({},_0x169369,_0x1ba46a[_0xbe14('0x39')]);var _0x520e09={'where':_0x169369[_0xbe14('0x36')]};return db[_0xbe14('0x25')][_0xbe14('0x18')](_0x520e09)[_0xbe14('0x20')](function(_0x3bd454){_0x16f884[_0xbe14('0x18')]=_0x3bd454;if(_0x1ba46a[_0xbe14('0x2c')][_0xbe14('0x3a')]){_0x169369[_0xbe14('0x3b')]=[{'all':!![]}];}return db['SmsQueueReport'][_0xbe14('0x3c')](_0x169369);})[_0xbe14('0x20')](function(_0x3463c4){_0x16f884[_0xbe14('0x3d')]=_0x3463c4;return _0x16f884;})[_0xbe14('0x20')](respondWithFilteredResult(_0x391556,_0x169369))[_0xbe14('0x3e')](handleError(_0x391556,null));};exports['show']=function(_0xb0f143,_0x1974a4){var _0x1220c9={'raw':!![],'where':{'id':_0xb0f143['params']['id']}},_0x36263c={};_0x36263c['model']=_[_0xbe14('0x2d')](db[_0xbe14('0x25')][_0xbe14('0x26')]);_0x36263c['query']=_['keys'](_0xb0f143[_0xbe14('0x2c')]);_0x36263c['filters']=_['intersection'](_0x36263c[_0xbe14('0x2a')],_0x36263c[_0xbe14('0x2c')]);_0x1220c9[_0xbe14('0x30')]=_['intersection'](_0x36263c['model'],qs['fields'](_0xb0f143[_0xbe14('0x2c')][_0xbe14('0x31')]));_0x1220c9[_0xbe14('0x30')]=_0x1220c9['attributes'][_0xbe14('0x32')]?_0x1220c9[_0xbe14('0x30')]:_0x36263c[_0xbe14('0x2a')];if(_0xb0f143[_0xbe14('0x2c')]['includeAll']){_0x1220c9['include']=[{'all':!![]}];}_0x1220c9=_[_0xbe14('0x37')]({},_0x1220c9,_0xb0f143[_0xbe14('0x39')]);return db[_0xbe14('0x25')][_0xbe14('0x3f')](_0x1220c9)[_0xbe14('0x20')](handleEntityNotFound(_0x1974a4,null))['then'](respondWithResult(_0x1974a4,null))['catch'](handleError(_0x1974a4,null));};exports[_0xbe14('0x40')]=function(_0x2a3623,_0x238c60){return db[_0xbe14('0x25')]['create'](_0x2a3623[_0xbe14('0x41')],{})[_0xbe14('0x20')](respondWithResult(_0x238c60,0xc9))['catch'](handleError(_0x238c60,null));};exports[_0xbe14('0x1f')]=function(_0x2a35e5,_0x2d6ee8){if(_0x2a35e5[_0xbe14('0x41')]['id']){delete _0x2a35e5['body']['id'];}return db['SmsQueueReport'][_0xbe14('0x3f')]({'where':{'id':_0x2a35e5[_0xbe14('0x42')]['id']}})['then'](handleEntityNotFound(_0x2d6ee8,null))['then'](saveUpdates(_0x2a35e5[_0xbe14('0x41')],null))[_0xbe14('0x20')](respondWithResult(_0x2d6ee8,null))[_0xbe14('0x3e')](handleError(_0x2d6ee8,null));};exports[_0xbe14('0x43')]=function(_0xdbc6e1,_0xd04fd5){return db[_0xbe14('0x25')]['find']({'where':{'id':_0xdbc6e1[_0xbe14('0x42')]['id']}})[_0xbe14('0x20')](handleEntityNotFound(_0xd04fd5,null))[_0xbe14('0x20')](removeEntity(_0xd04fd5,null))[_0xbe14('0x3e')](handleError(_0xd04fd5,null));};exports[_0xbe14('0x44')]=function(_0x494c32,_0x3a221b){return db[_0xbe14('0x25')][_0xbe14('0x44')]()[_0xbe14('0x20')](respondWithResult(_0x3a221b,null))[_0xbe14('0x3e')](handleError(_0x3a221b,null));};
\ No newline at end of file
diff --git a/server/api/smsQueueReport/smsQueueReport.model.js b/server/api/smsQueueReport/smsQueueReport.model.js
index 1545b14..83171ae 100644
--- a/server/api/smsQueueReport/smsQueueReport.model.js
+++ b/server/api/smsQueueReport/smsQueueReport.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x1c95=['SmsQueueReport','report_sms_queue','uniqueid','lodash','util','api','moment','bluebird','request-promise','rimraf','../../config/environment','./smsQueueReport.attributes'];(function(_0x40d6c3,_0x1ca9d1){var _0x12b825=function(_0x46c8e8){while(--_0x46c8e8){_0x40d6c3['push'](_0x40d6c3['shift']());}};_0x12b825(++_0x1ca9d1);}(_0x1c95,0x1d7));var _0x51c9=function(_0x1fbf07,_0x2d3fc2){_0x1fbf07=_0x1fbf07-0x0;var _0x3c95e6=_0x1c95[_0x1fbf07];return _0x3c95e6;};'use strict';var _=require(_0x51c9('0x0'));var util=require(_0x51c9('0x1'));var logger=require('../../config/logger')(_0x51c9('0x2'));var moment=require(_0x51c9('0x3'));var BPromise=require(_0x51c9('0x4'));var rp=require(_0x51c9('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x51c9('0x6'));var config=require(_0x51c9('0x7'));var attributes=require(_0x51c9('0x8'));module['exports']=function(_0x2ee13d,_0x4722a0){return _0x2ee13d['define'](_0x51c9('0x9'),attributes,{'tableName':_0x51c9('0xa'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x51c9('0xb')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x6962=['bluebird','path','rimraf','./smsQueueReport.attributes','exports','define','SmsQueueReport','report_sms_queue','lodash','util','../../config/logger','api','moment'];(function(_0x53202a,_0x36e812){var _0x4b65a8=function(_0x469f83){while(--_0x469f83){_0x53202a['push'](_0x53202a['shift']());}};_0x4b65a8(++_0x36e812);}(_0x6962,0x1cf));var _0x2696=function(_0x3f5d84,_0x1f8f26){_0x3f5d84=_0x3f5d84-0x0;var _0x584f43=_0x6962[_0x3f5d84];return _0x584f43;};'use strict';var _=require(_0x2696('0x0'));var util=require(_0x2696('0x1'));var logger=require(_0x2696('0x2'))(_0x2696('0x3'));var moment=require(_0x2696('0x4'));var BPromise=require(_0x2696('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x2696('0x6'));var rimraf=require(_0x2696('0x7'));var config=require('../../config/environment');var attributes=require(_0x2696('0x8'));module[_0x2696('0x9')]=function(_0x2f704f,_0x133196){return _0x2f704f[_0x2696('0xa')](_0x2696('0xb'),attributes,{'tableName':_0x2696('0xc'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/smsQueueReport/smsQueueReport.rpc.js b/server/api/smsQueueReport/smsQueueReport.rpc.js
index 44bb27f..6663e6e 100644
--- a/server/api/smsQueueReport/smsQueueReport.rpc.js
+++ b/server/api/smsQueueReport/smsQueueReport.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x0de5=['UpdateSmsQueueReport','SmsQueueReport','update','where','attributes','limit','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','http','request','info','SmsQueueReport,\x20%s,\x20%s','debug','SmsQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','CreateSmsQueueReport','body','options','raw','then','catch'];(function(_0x5f1391,_0x19c132){var _0x50ebe3=function(_0x3d00a3){while(--_0x3d00a3){_0x5f1391['push'](_0x5f1391['shift']());}};_0x50ebe3(++_0x19c132);}(_0x0de5,0x1d4));var _0x50de=function(_0x56a9ac,_0x22dd29){_0x56a9ac=_0x56a9ac-0x0;var _0x2ac185=_0x0de5[_0x56a9ac];return _0x2ac185;};'use strict';var _=require(_0x50de('0x0'));var util=require(_0x50de('0x1'));var moment=require('moment');var BPromise=require(_0x50de('0x2'));var rs=require(_0x50de('0x3'));var fs=require('fs');var Redis=require(_0x50de('0x4'));var db=require(_0x50de('0x5'))['db'];var utils=require(_0x50de('0x6'));var logger=require(_0x50de('0x7'))(_0x50de('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x50de('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x32ca34,_0x21dbe9,_0x15dcbc){return new BPromise(function(_0xb44bee,_0x347f5f){return client[_0x50de('0xa')](_0x32ca34,_0x15dcbc)['then'](function(_0xfc9365){logger[_0x50de('0xb')](_0x50de('0xc'),_0x21dbe9,'request\x20sent');logger[_0x50de('0xd')](_0x50de('0xe'),_0x21dbe9,'request\x20sent',JSON[_0x50de('0xf')](_0xfc9365));if(_0xfc9365[_0x50de('0x10')]){if(_0xfc9365[_0x50de('0x10')][_0x50de('0x11')]===0x1f4){logger['error']('SmsQueueReport,\x20%s,\x20%s',_0x21dbe9,_0xfc9365[_0x50de('0x10')][_0x50de('0x12')]);return _0x347f5f(_0xfc9365[_0x50de('0x10')]['message']);}logger[_0x50de('0x10')]('SmsQueueReport,\x20%s,\x20%s',_0x21dbe9,_0xfc9365[_0x50de('0x10')][_0x50de('0x12')]);return _0xb44bee(_0xfc9365['error'][_0x50de('0x12')]);}else{logger[_0x50de('0xb')](_0x50de('0xc'),_0x21dbe9,_0x50de('0x13'));_0xb44bee(_0xfc9365[_0x50de('0x14')]['message']);}})['catch'](function(_0x7a4ca1){logger[_0x50de('0x10')]('SmsQueueReport,\x20%s,\x20%s',_0x21dbe9,_0x7a4ca1);_0x347f5f(_0x7a4ca1);});});}exports[_0x50de('0x15')]=function(_0x1d450c){var _0x22e8d6=this;return new Promise(function(_0x3d0e2b,_0x494875){return db['SmsQueueReport']['create'](_0x1d450c[_0x50de('0x16')],{'raw':_0x1d450c[_0x50de('0x17')]?_0x1d450c['options'][_0x50de('0x18')]===undefined?!![]:![]:!![]})[_0x50de('0x19')](function(_0x4261b6){logger['info'](_0x50de('0x15'),_0x1d450c);logger[_0x50de('0xd')](_0x50de('0x15'),_0x1d450c,JSON['stringify'](_0x4261b6));_0x3d0e2b(_0x4261b6);})[_0x50de('0x1a')](function(_0x269099){logger[_0x50de('0x10')](_0x50de('0x15'),_0x269099['message'],_0x1d450c);_0x494875(_0x22e8d6[_0x50de('0x10')](0x1f4,_0x269099[_0x50de('0x12')]));});});};exports[_0x50de('0x1b')]=function(_0x5b9198){var _0x303d40=this;return new Promise(function(_0x150ee6,_0x57fd87){return db[_0x50de('0x1c')][_0x50de('0x1d')](_0x5b9198[_0x50de('0x16')],{'raw':_0x5b9198[_0x50de('0x17')]?_0x5b9198[_0x50de('0x17')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5b9198[_0x50de('0x17')]?_0x5b9198[_0x50de('0x17')][_0x50de('0x1e')]||null:null,'attributes':_0x5b9198['options']?_0x5b9198['options'][_0x50de('0x1f')]||null:null,'limit':_0x5b9198[_0x50de('0x17')]?_0x5b9198[_0x50de('0x17')][_0x50de('0x20')]||null:null})[_0x50de('0x19')](function(_0x3c5b28){logger[_0x50de('0xb')](_0x50de('0x1b'),_0x5b9198);logger[_0x50de('0xd')](_0x50de('0x1b'),_0x5b9198,JSON[_0x50de('0xf')](_0x3c5b28));_0x150ee6(_0x3c5b28);})[_0x50de('0x1a')](function(_0x2be9cc){logger[_0x50de('0x10')]('UpdateSmsQueueReport',_0x2be9cc[_0x50de('0x12')],_0x5b9198);_0x57fd87(_0x303d40[_0x50de('0x10')](0x1f4,_0x2be9cc['message']));});});};
\ No newline at end of file
+var _0x6c20=['options','raw','then','UpdateSmsQueueReport','update','where','attributes','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','request\x20sent','debug','SmsQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','SmsQueueReport,\x20%s,\x20%s','result','catch','CreateSmsQueueReport','SmsQueueReport','create','body'];(function(_0x21d650,_0x34649d){var _0x5e50a3=function(_0x590642){while(--_0x590642){_0x21d650['push'](_0x21d650['shift']());}};_0x5e50a3(++_0x34649d);}(_0x6c20,0xfc));var _0x06c2=function(_0x4de1c3,_0xbe77b9){_0x4de1c3=_0x4de1c3-0x0;var _0x26acfe=_0x6c20[_0x4de1c3];return _0x26acfe;};'use strict';var _=require(_0x06c2('0x0'));var util=require(_0x06c2('0x1'));var moment=require('moment');var BPromise=require(_0x06c2('0x2'));var rs=require(_0x06c2('0x3'));var fs=require('fs');var Redis=require(_0x06c2('0x4'));var db=require(_0x06c2('0x5'))['db'];var utils=require(_0x06c2('0x6'));var logger=require(_0x06c2('0x7'))(_0x06c2('0x8'));var config=require(_0x06c2('0x9'));var jayson=require(_0x06c2('0xa'));var client=jayson['client'][_0x06c2('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1509a2,_0x343986,_0x1693c0){return new BPromise(function(_0x5190c1,_0x22aa08){return client[_0x06c2('0xc')](_0x1509a2,_0x1693c0)['then'](function(_0x3e6a79){logger[_0x06c2('0xd')]('SmsQueueReport,\x20%s,\x20%s',_0x343986,_0x06c2('0xe'));logger[_0x06c2('0xf')](_0x06c2('0x10'),_0x343986,'request\x20sent',JSON[_0x06c2('0x11')](_0x3e6a79));if(_0x3e6a79[_0x06c2('0x12')]){if(_0x3e6a79[_0x06c2('0x12')][_0x06c2('0x13')]===0x1f4){logger['error']('SmsQueueReport,\x20%s,\x20%s',_0x343986,_0x3e6a79[_0x06c2('0x12')][_0x06c2('0x14')]);return _0x22aa08(_0x3e6a79[_0x06c2('0x12')]['message']);}logger[_0x06c2('0x12')]('SmsQueueReport,\x20%s,\x20%s',_0x343986,_0x3e6a79[_0x06c2('0x12')][_0x06c2('0x14')]);return _0x5190c1(_0x3e6a79[_0x06c2('0x12')]['message']);}else{logger[_0x06c2('0xd')](_0x06c2('0x15'),_0x343986,'request\x20sent');_0x5190c1(_0x3e6a79[_0x06c2('0x16')][_0x06c2('0x14')]);}})[_0x06c2('0x17')](function(_0x4d6968){logger[_0x06c2('0x12')]('SmsQueueReport,\x20%s,\x20%s',_0x343986,_0x4d6968);_0x22aa08(_0x4d6968);});});}exports[_0x06c2('0x18')]=function(_0x20796c){var _0x2f81a6=this;return new Promise(function(_0x588fe9,_0x35f06b){return db[_0x06c2('0x19')][_0x06c2('0x1a')](_0x20796c[_0x06c2('0x1b')],{'raw':_0x20796c[_0x06c2('0x1c')]?_0x20796c[_0x06c2('0x1c')][_0x06c2('0x1d')]===undefined?!![]:![]:!![]})[_0x06c2('0x1e')](function(_0x298813){logger[_0x06c2('0xd')]('CreateSmsQueueReport',_0x20796c);logger[_0x06c2('0xf')](_0x06c2('0x18'),_0x20796c,JSON[_0x06c2('0x11')](_0x298813));_0x588fe9(_0x298813);})[_0x06c2('0x17')](function(_0x4e4238){logger[_0x06c2('0x12')](_0x06c2('0x18'),_0x4e4238[_0x06c2('0x14')],_0x20796c);_0x35f06b(_0x2f81a6[_0x06c2('0x12')](0x1f4,_0x4e4238[_0x06c2('0x14')]));});});};exports[_0x06c2('0x1f')]=function(_0x18fe84){var _0x2275a5=this;return new Promise(function(_0x354214,_0x22fcbe){return db[_0x06c2('0x19')][_0x06c2('0x20')](_0x18fe84[_0x06c2('0x1b')],{'raw':_0x18fe84['options']?_0x18fe84[_0x06c2('0x1c')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x18fe84[_0x06c2('0x1c')]?_0x18fe84['options'][_0x06c2('0x21')]||null:null,'attributes':_0x18fe84[_0x06c2('0x1c')]?_0x18fe84['options'][_0x06c2('0x22')]||null:null,'limit':_0x18fe84['options']?_0x18fe84[_0x06c2('0x1c')]['limit']||null:null})[_0x06c2('0x1e')](function(_0x34306e){logger[_0x06c2('0xd')](_0x06c2('0x1f'),_0x18fe84);logger[_0x06c2('0xf')]('UpdateSmsQueueReport',_0x18fe84,JSON[_0x06c2('0x11')](_0x34306e));_0x354214(_0x34306e);})['catch'](function(_0x38964e){logger[_0x06c2('0x12')]('UpdateSmsQueueReport',_0x38964e[_0x06c2('0x14')],_0x18fe84);_0x22fcbe(_0x2275a5[_0x06c2('0x12')](0x1f4,_0x38964e[_0x06c2('0x14')]));});});};
\ No newline at end of file
diff --git a/server/api/smsTransferReport/index.js b/server/api/smsTransferReport/index.js
index 04c228c..7f171b9 100644
--- a/server/api/smsTransferReport/index.js
+++ b/server/api/smsTransferReport/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xf7b4=['update','delete','multer','connect-timeout','express','../../components/interaction/service','../../config/environment','./smsTransferReport.controller','get','isAuthenticated','index','/describe','describe','/:id','post','put'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xf7b4,0x152));var _0x4f7b=function(_0x58abac,_0x312d6a){_0x58abac=_0x58abac-0x0;var _0x2b4e36=_0xf7b4[_0x58abac];return _0x2b4e36;};'use strict';var multer=require(_0x4f7b('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x4f7b('0x1'));var express=require(_0x4f7b('0x2'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x4f7b('0x3'));var config=require(_0x4f7b('0x4'));var controller=require(_0x4f7b('0x5'));router[_0x4f7b('0x6')]('/',auth[_0x4f7b('0x7')](),controller[_0x4f7b('0x8')]);router[_0x4f7b('0x6')](_0x4f7b('0x9'),auth[_0x4f7b('0x7')](),controller[_0x4f7b('0xa')]);router[_0x4f7b('0x6')](_0x4f7b('0xb'),auth[_0x4f7b('0x7')](),controller['show']);router[_0x4f7b('0xc')]('/',auth[_0x4f7b('0x7')](),controller['create']);router[_0x4f7b('0xd')](_0x4f7b('0xb'),auth[_0x4f7b('0x7')](),controller[_0x4f7b('0xe')]);router[_0x4f7b('0xf')]('/:id',auth[_0x4f7b('0x7')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
+var _0x8603=['put','update','/:id','exports','util','path','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/describe','isAuthenticated','describe','show','post','create'];(function(_0xa5448e,_0x296a7b){var _0x5032ce=function(_0x585fd7){while(--_0x585fd7){_0xa5448e['push'](_0xa5448e['shift']());}};_0x5032ce(++_0x296a7b);}(_0x8603,0x190));var _0x3860=function(_0x43b548,_0x30ea37){_0x43b548=_0x43b548-0x0;var _0x37f928=_0x8603[_0x43b548];return _0x37f928;};'use strict';var multer=require('multer');var util=require(_0x3860('0x0'));var path=require(_0x3860('0x1'));var timeout=require(_0x3860('0x2'));var express=require('express');var router=express['Router']();var auth=require(_0x3860('0x3'));var interaction=require(_0x3860('0x4'));var config=require(_0x3860('0x5'));var controller=require('./smsTransferReport.controller');router[_0x3860('0x6')]('/',auth['isAuthenticated'](),controller[_0x3860('0x7')]);router[_0x3860('0x6')](_0x3860('0x8'),auth[_0x3860('0x9')](),controller[_0x3860('0xa')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0x3860('0xb')]);router[_0x3860('0xc')]('/',auth['isAuthenticated'](),controller[_0x3860('0xd')]);router[_0x3860('0xe')]('/:id',auth[_0x3860('0x9')](),controller[_0x3860('0xf')]);router['delete'](_0x3860('0x10'),auth[_0x3860('0x9')](),controller['destroy']);module[_0x3860('0x11')]=router;
\ No newline at end of file
diff --git a/server/api/smsTransferReport/smsTransferReport.attributes.js b/server/api/smsTransferReport/smsTransferReport.attributes.js
index 38663a1..b5baab2 100644
--- a/server/api/smsTransferReport/smsTransferReport.attributes.js
+++ b/server/api/smsTransferReport/smsTransferReport.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x2a36=['queue','DATE','NOW','moment','exports','STRING','ENUM','account','agent'];(function(_0x475e55,_0x377709){var _0x245bc7=function(_0x5a370e){while(--_0x5a370e){_0x475e55['push'](_0x475e55['shift']());}};_0x245bc7(++_0x377709);}(_0x2a36,0x198));var _0x62a3=function(_0x668379,_0x32552b){_0x668379=_0x668379-0x0;var _0x571da6=_0x2a36[_0x668379];return _0x571da6;};'use strict';var moment=require(_0x62a3('0x0'));var Sequelize=require('sequelize');module[_0x62a3('0x1')]={'uniqueid':{'type':Sequelize[_0x62a3('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x62a3('0x3')](_0x62a3('0x4'),_0x62a3('0x5'),_0x62a3('0x6')),'allowNull':![],'defaultValue':'queue'},'transferredAt':{'type':Sequelize[_0x62a3('0x7')],'allowNull':![],'defaultValue':Sequelize[_0x62a3('0x8')]}};
\ No newline at end of file
+var _0xcaa4=['agent','queue','DATE','moment','exports','ENUM','account'];(function(_0x5cc4a8,_0x2df236){var _0xe149fd=function(_0x37a958){while(--_0x37a958){_0x5cc4a8['push'](_0x5cc4a8['shift']());}};_0xe149fd(++_0x2df236);}(_0xcaa4,0x184));var _0x4caa=function(_0x4ac5db,_0x45cbaa){_0x4ac5db=_0x4ac5db-0x0;var _0x15ce69=_0xcaa4[_0x4ac5db];return _0x15ce69;};'use strict';var moment=require(_0x4caa('0x0'));var Sequelize=require('sequelize');module[_0x4caa('0x1')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x4caa('0x2')](_0x4caa('0x3'),_0x4caa('0x4'),_0x4caa('0x5')),'allowNull':![],'defaultValue':'queue'},'transferredAt':{'type':Sequelize[_0x4caa('0x6')],'allowNull':![],'defaultValue':Sequelize['NOW']}};
\ No newline at end of file
diff --git a/server/api/smsTransferReport/smsTransferReport.controller.js b/server/api/smsTransferReport/smsTransferReport.controller.js
index ec8c4b6..295d84a 100644
--- a/server/api/smsTransferReport/smsTransferReport.controller.js
+++ b/server/api/smsTransferReport/smsTransferReport.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xa9e0=['merge','options','include','findAll','catch','params','includeAll','create','body','find','describe','html-pdf','eml-format','rimraf','request-promise','bluebird','mustache','util','path','sox','ejs','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../mysqldb','sendStatus','status','json','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','end','error','name','send','index','map','SmsTransferReport','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','limit','sort','where','pick','filter','VIRTUAL'];(function(_0x223b78,_0x429a9a){var _0x1774ef=function(_0x2df976){while(--_0x2df976){_0x223b78['push'](_0x223b78['shift']());}};_0x1774ef(++_0x429a9a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4243a3,_0x447337){_0x4243a3=_0x4243a3-0x0;var _0x1b2a33=_0xa9e0[_0x4243a3];return _0x1b2a33;};'use strict';var pdf=require(_0x0a9e('0x0'));var emlformat=require(_0x0a9e('0x1'));var rimraf=require(_0x0a9e('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0a9e('0x3'));var moment=require('moment');var BPromise=require(_0x0a9e('0x4'));var Mustache=require(_0x0a9e('0x5'));var util=require(_0x0a9e('0x6'));var path=require(_0x0a9e('0x7'));var sox=require(_0x0a9e('0x8'));var csv=require('to-csv');var ejs=require(_0x0a9e('0x9'));var fs=require('fs');var _=require(_0x0a9e('0xa'));var squel=require(_0x0a9e('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0a9e('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0a9e('0xd'));var Redis=require(_0x0a9e('0xe'));var authService=require(_0x0a9e('0xf'));var qs=require(_0x0a9e('0x10'));var as=require(_0x0a9e('0x11'));var hardwareService=require(_0x0a9e('0x12'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x0a9e('0x13'))['db'];function respondWithStatusCode(_0x36471c,_0xd5b662){_0xd5b662=_0xd5b662||0xcc;return function(_0x26d672){if(_0x26d672){return _0x36471c[_0x0a9e('0x14')](_0xd5b662);}return _0x36471c[_0x0a9e('0x15')](_0xd5b662)['end']();};}function respondWithResult(_0x4283ce,_0x239b12){_0x239b12=_0x239b12||0xc8;return function(_0x2b4227){if(_0x2b4227){return _0x4283ce[_0x0a9e('0x15')](_0x239b12)[_0x0a9e('0x16')](_0x2b4227);}};}function respondWithFilteredResult(_0x4d5611,_0x52a03d){return function(_0x22dccb){if(_0x22dccb){var _0x5d0880=_0x22dccb[_0x0a9e('0x17')],_0x1985b6=_0x52a03d['offset'],_0x519dfd=_0x52a03d[_0x0a9e('0x18')]+_0x52a03d['limit'],_0x16033c;if(_0x519dfd>=_0x5d0880){_0x519dfd=_0x5d0880;_0x16033c=0xc8;}else{_0x16033c=0xce;}_0x4d5611[_0x0a9e('0x15')](_0x16033c);return _0x4d5611[_0x0a9e('0x19')](_0x0a9e('0x1a'),_0x1985b6+'-'+_0x519dfd+'/'+_0x5d0880)[_0x0a9e('0x16')](_0x22dccb);}return null;};}function patchUpdates(_0x31b1ca){return function(_0x2eb11f){try{jsonpatch[_0x0a9e('0x1b')](_0x2eb11f,_0x31b1ca,!![]);}catch(_0x20559e){return BPromise[_0x0a9e('0x1c')](_0x20559e);}return _0x2eb11f[_0x0a9e('0x1d')]();};}function saveUpdates(_0x1c696a,_0x105080){return function(_0x4bb1e3){if(_0x4bb1e3){return _0x4bb1e3[_0x0a9e('0x1e')](_0x1c696a)[_0x0a9e('0x1f')](function(_0x53682f){return _0x53682f;});}return null;};}function removeEntity(_0x20f109,_0x5a09ef){return function(_0x588269){if(_0x588269){return _0x588269[_0x0a9e('0x20')]()[_0x0a9e('0x1f')](function(){_0x20f109[_0x0a9e('0x15')](0xcc)[_0x0a9e('0x21')]();});}};}function handleEntityNotFound(_0x4abc77,_0xfb6e48){return function(_0x2fb0e4){if(!_0x2fb0e4){_0x4abc77[_0x0a9e('0x14')](0x194);}return _0x2fb0e4;};}function handleError(_0x4d00e6,_0x370d86){_0x370d86=_0x370d86||0x1f4;return function(_0x42ac8f){logger[_0x0a9e('0x22')](_0x42ac8f['stack']);if(_0x42ac8f['name']){delete _0x42ac8f[_0x0a9e('0x23')];}_0x4d00e6[_0x0a9e('0x15')](_0x370d86)[_0x0a9e('0x24')](_0x42ac8f);};}exports[_0x0a9e('0x25')]=function(_0x526cf3,_0x384319){var _0x479bc4={},_0x45a1e7={},_0x5bfb33={'count':0x0,'rows':[]};var _0x1dc186=_[_0x0a9e('0x26')](db[_0x0a9e('0x27')][_0x0a9e('0x28')],function(_0x140511){return{'name':_0x140511[_0x0a9e('0x29')],'type':_0x140511[_0x0a9e('0x2a')][_0x0a9e('0x2b')]};});_0x45a1e7['model']=_[_0x0a9e('0x26')](_0x1dc186,_0x0a9e('0x23'));_0x45a1e7[_0x0a9e('0x2c')]=_[_0x0a9e('0x2d')](_0x526cf3['query']);_0x45a1e7[_0x0a9e('0x2e')]=_[_0x0a9e('0x2f')](_0x45a1e7[_0x0a9e('0x30')],_0x45a1e7[_0x0a9e('0x2c')]);_0x479bc4[_0x0a9e('0x31')]=_[_0x0a9e('0x2f')](_0x45a1e7[_0x0a9e('0x30')],qs[_0x0a9e('0x32')](_0x526cf3[_0x0a9e('0x2c')]['fields']));_0x479bc4[_0x0a9e('0x31')]=_0x479bc4['attributes'][_0x0a9e('0x33')]?_0x479bc4[_0x0a9e('0x31')]:_0x45a1e7[_0x0a9e('0x30')];if(!_0x526cf3[_0x0a9e('0x2c')][_0x0a9e('0x34')]('nolimit')){_0x479bc4[_0x0a9e('0x35')]=qs[_0x0a9e('0x35')](_0x526cf3[_0x0a9e('0x2c')][_0x0a9e('0x35')]);_0x479bc4[_0x0a9e('0x18')]=qs[_0x0a9e('0x18')](_0x526cf3[_0x0a9e('0x2c')][_0x0a9e('0x18')]);}_0x479bc4['order']=qs[_0x0a9e('0x36')](_0x526cf3['query'][_0x0a9e('0x36')]);_0x479bc4[_0x0a9e('0x37')]=qs[_0x0a9e('0x2e')](_[_0x0a9e('0x38')](_0x526cf3['query'],_0x45a1e7[_0x0a9e('0x2e')]),_0x1dc186);if(_0x526cf3[_0x0a9e('0x2c')][_0x0a9e('0x39')]){_0x479bc4[_0x0a9e('0x37')]=_['merge'](_0x479bc4['where'],{'$or':_[_0x0a9e('0x26')](_0x1dc186,function(_0x5640eb){if(_0x5640eb[_0x0a9e('0x2a')]!==_0x0a9e('0x3a')){var _0x381c37={};_0x381c37[_0x5640eb[_0x0a9e('0x23')]]={'$like':'%'+_0x526cf3['query'][_0x0a9e('0x39')]+'%'};return _0x381c37;}})});}_0x479bc4=_[_0x0a9e('0x3b')]({},_0x479bc4,_0x526cf3[_0x0a9e('0x3c')]);var _0x533942={'where':_0x479bc4[_0x0a9e('0x37')]};return db[_0x0a9e('0x27')][_0x0a9e('0x17')](_0x533942)['then'](function(_0x546ef8){_0x5bfb33[_0x0a9e('0x17')]=_0x546ef8;if(_0x526cf3[_0x0a9e('0x2c')]['includeAll']){_0x479bc4[_0x0a9e('0x3d')]=[{'all':!![]}];}return db[_0x0a9e('0x27')][_0x0a9e('0x3e')](_0x479bc4);})[_0x0a9e('0x1f')](function(_0x4b38d9){_0x5bfb33['rows']=_0x4b38d9;return _0x5bfb33;})[_0x0a9e('0x1f')](respondWithFilteredResult(_0x384319,_0x479bc4))[_0x0a9e('0x3f')](handleError(_0x384319,null));};exports['show']=function(_0x183991,_0x1dec2e){var _0x1459bb={'raw':!![],'where':{'id':_0x183991[_0x0a9e('0x40')]['id']}},_0x5b4f5e={};_0x5b4f5e[_0x0a9e('0x30')]=_[_0x0a9e('0x2d')](db[_0x0a9e('0x27')][_0x0a9e('0x28')]);_0x5b4f5e[_0x0a9e('0x2c')]=_[_0x0a9e('0x2d')](_0x183991[_0x0a9e('0x2c')]);_0x5b4f5e[_0x0a9e('0x2e')]=_[_0x0a9e('0x2f')](_0x5b4f5e[_0x0a9e('0x30')],_0x5b4f5e[_0x0a9e('0x2c')]);_0x1459bb[_0x0a9e('0x31')]=_[_0x0a9e('0x2f')](_0x5b4f5e[_0x0a9e('0x30')],qs['fields'](_0x183991['query'][_0x0a9e('0x32')]));_0x1459bb[_0x0a9e('0x31')]=_0x1459bb[_0x0a9e('0x31')][_0x0a9e('0x33')]?_0x1459bb[_0x0a9e('0x31')]:_0x5b4f5e[_0x0a9e('0x30')];if(_0x183991[_0x0a9e('0x2c')][_0x0a9e('0x41')]){_0x1459bb[_0x0a9e('0x3d')]=[{'all':!![]}];}_0x1459bb=_[_0x0a9e('0x3b')]({},_0x1459bb,_0x183991[_0x0a9e('0x3c')]);return db[_0x0a9e('0x27')]['find'](_0x1459bb)[_0x0a9e('0x1f')](handleEntityNotFound(_0x1dec2e,null))[_0x0a9e('0x1f')](respondWithResult(_0x1dec2e,null))[_0x0a9e('0x3f')](handleError(_0x1dec2e,null));};exports[_0x0a9e('0x42')]=function(_0x2e8caf,_0xbe9d19){return db[_0x0a9e('0x27')][_0x0a9e('0x42')](_0x2e8caf['body'],{})[_0x0a9e('0x1f')](respondWithResult(_0xbe9d19,0xc9))['catch'](handleError(_0xbe9d19,null));};exports[_0x0a9e('0x1e')]=function(_0x476688,_0x8d6dd1){if(_0x476688['body']['id']){delete _0x476688[_0x0a9e('0x43')]['id'];}return db[_0x0a9e('0x27')][_0x0a9e('0x44')]({'where':{'id':_0x476688[_0x0a9e('0x40')]['id']}})[_0x0a9e('0x1f')](handleEntityNotFound(_0x8d6dd1,null))[_0x0a9e('0x1f')](saveUpdates(_0x476688[_0x0a9e('0x43')],null))['then'](respondWithResult(_0x8d6dd1,null))[_0x0a9e('0x3f')](handleError(_0x8d6dd1,null));};exports[_0x0a9e('0x20')]=function(_0x1b5e80,_0x16f976){return db[_0x0a9e('0x27')][_0x0a9e('0x44')]({'where':{'id':_0x1b5e80[_0x0a9e('0x40')]['id']}})[_0x0a9e('0x1f')](handleEntityNotFound(_0x16f976,null))[_0x0a9e('0x1f')](removeEntity(_0x16f976,null))['catch'](handleError(_0x16f976,null));};exports[_0x0a9e('0x45')]=function(_0x3fe430,_0x4f7240){return db['SmsTransferReport']['describe']()[_0x0a9e('0x1f')](respondWithResult(_0x4f7240,null))[_0x0a9e('0x3f')](handleError(_0x4f7240,null));};
\ No newline at end of file
+var _0x70e0=['attributes','intersection','length','hasOwnProperty','nolimit','sort','where','filter','type','VIRTUAL','name','merge','options','count','includeAll','findAll','rows','catch','include','find','create','body','params','describe','html-pdf','eml-format','rimraf','request-promise','moment','bluebird','mustache','path','to-csv','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','json','offset','limit','status','set','Content-Range','apply','reject','update','then','destroy','end','stack','send','index','map','SmsTransferReport','rawAttributes','fieldName','key','model','keys','query','filters'];(function(_0x495961,_0x288bb8){var _0x50f161=function(_0x28f9d1){while(--_0x28f9d1){_0x495961['push'](_0x495961['shift']());}};_0x50f161(++_0x288bb8);}(_0x70e0,0x17b));var _0x070e=function(_0x587dee,_0x18925c){_0x587dee=_0x587dee-0x0;var _0x24374f=_0x70e0[_0x587dee];return _0x24374f;};'use strict';var pdf=require(_0x070e('0x0'));var emlformat=require(_0x070e('0x1'));var rimraf=require(_0x070e('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x070e('0x3'));var moment=require(_0x070e('0x4'));var BPromise=require(_0x070e('0x5'));var Mustache=require(_0x070e('0x6'));var util=require('util');var path=require(_0x070e('0x7'));var sox=require('sox');var csv=require(_0x070e('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x070e('0x9'));var jsforce=require(_0x070e('0xa'));var deskjs=require(_0x070e('0xb'));var toCsv=require(_0x070e('0x8'));var querystring=require(_0x070e('0xc'));var Papa=require(_0x070e('0xd'));var Redis=require(_0x070e('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x070e('0xf'));var hardwareService=require(_0x070e('0x10'));var logger=require(_0x070e('0x11'))(_0x070e('0x12'));var utils=require(_0x070e('0x13'));var config=require(_0x070e('0x14'));var db=require(_0x070e('0x15'))['db'];function respondWithStatusCode(_0x1baa12,_0x39d2b9){_0x39d2b9=_0x39d2b9||0xcc;return function(_0x5bf079){if(_0x5bf079){return _0x1baa12[_0x070e('0x16')](_0x39d2b9);}return _0x1baa12['status'](_0x39d2b9)['end']();};}function respondWithResult(_0x24baba,_0x56c7ba){_0x56c7ba=_0x56c7ba||0xc8;return function(_0x4a33d2){if(_0x4a33d2){return _0x24baba['status'](_0x56c7ba)[_0x070e('0x17')](_0x4a33d2);}};}function respondWithFilteredResult(_0x14c3fd,_0x51d14d){return function(_0x5d3a38){if(_0x5d3a38){var _0x373d86=_0x5d3a38['count'],_0xeae1a5=_0x51d14d['offset'],_0x180897=_0x51d14d[_0x070e('0x18')]+_0x51d14d[_0x070e('0x19')],_0x19d9da;if(_0x180897>=_0x373d86){_0x180897=_0x373d86;_0x19d9da=0xc8;}else{_0x19d9da=0xce;}_0x14c3fd[_0x070e('0x1a')](_0x19d9da);return _0x14c3fd[_0x070e('0x1b')](_0x070e('0x1c'),_0xeae1a5+'-'+_0x180897+'/'+_0x373d86)['json'](_0x5d3a38);}return null;};}function patchUpdates(_0x3938b5){return function(_0x168dc6){try{jsonpatch[_0x070e('0x1d')](_0x168dc6,_0x3938b5,!![]);}catch(_0x3ea105){return BPromise[_0x070e('0x1e')](_0x3ea105);}return _0x168dc6['save']();};}function saveUpdates(_0x5b2f48,_0x4e958f){return function(_0x9907cf){if(_0x9907cf){return _0x9907cf[_0x070e('0x1f')](_0x5b2f48)[_0x070e('0x20')](function(_0x4be0d7){return _0x4be0d7;});}return null;};}function removeEntity(_0x5b184,_0x5dc5d2){return function(_0xf8dd5d){if(_0xf8dd5d){return _0xf8dd5d[_0x070e('0x21')]()[_0x070e('0x20')](function(){_0x5b184[_0x070e('0x1a')](0xcc)[_0x070e('0x22')]();});}};}function handleEntityNotFound(_0xa86797,_0xe405e){return function(_0x164cdf){if(!_0x164cdf){_0xa86797['sendStatus'](0x194);}return _0x164cdf;};}function handleError(_0x2f8055,_0x270061){_0x270061=_0x270061||0x1f4;return function(_0x4790eb){logger['error'](_0x4790eb[_0x070e('0x23')]);if(_0x4790eb['name']){delete _0x4790eb['name'];}_0x2f8055[_0x070e('0x1a')](_0x270061)[_0x070e('0x24')](_0x4790eb);};}exports[_0x070e('0x25')]=function(_0x1743cc,_0x4763c6){var _0x497f58={},_0x374c54={},_0x219e48={'count':0x0,'rows':[]};var _0x1d72d6=_[_0x070e('0x26')](db[_0x070e('0x27')][_0x070e('0x28')],function(_0x1a1892){return{'name':_0x1a1892[_0x070e('0x29')],'type':_0x1a1892['type'][_0x070e('0x2a')]};});_0x374c54[_0x070e('0x2b')]=_[_0x070e('0x26')](_0x1d72d6,'name');_0x374c54['query']=_[_0x070e('0x2c')](_0x1743cc[_0x070e('0x2d')]);_0x374c54[_0x070e('0x2e')]=_['intersection'](_0x374c54[_0x070e('0x2b')],_0x374c54[_0x070e('0x2d')]);_0x497f58[_0x070e('0x2f')]=_[_0x070e('0x30')](_0x374c54['model'],qs['fields'](_0x1743cc['query']['fields']));_0x497f58[_0x070e('0x2f')]=_0x497f58['attributes'][_0x070e('0x31')]?_0x497f58[_0x070e('0x2f')]:_0x374c54['model'];if(!_0x1743cc['query'][_0x070e('0x32')](_0x070e('0x33'))){_0x497f58['limit']=qs['limit'](_0x1743cc[_0x070e('0x2d')][_0x070e('0x19')]);_0x497f58[_0x070e('0x18')]=qs[_0x070e('0x18')](_0x1743cc[_0x070e('0x2d')]['offset']);}_0x497f58['order']=qs[_0x070e('0x34')](_0x1743cc[_0x070e('0x2d')][_0x070e('0x34')]);_0x497f58[_0x070e('0x35')]=qs[_0x070e('0x2e')](_['pick'](_0x1743cc[_0x070e('0x2d')],_0x374c54[_0x070e('0x2e')]),_0x1d72d6);if(_0x1743cc['query'][_0x070e('0x36')]){_0x497f58[_0x070e('0x35')]=_['merge'](_0x497f58['where'],{'$or':_['map'](_0x1d72d6,function(_0x363bff){if(_0x363bff[_0x070e('0x37')]!==_0x070e('0x38')){var _0x334733={};_0x334733[_0x363bff[_0x070e('0x39')]]={'$like':'%'+_0x1743cc['query'][_0x070e('0x36')]+'%'};return _0x334733;}})});}_0x497f58=_[_0x070e('0x3a')]({},_0x497f58,_0x1743cc[_0x070e('0x3b')]);var _0x487276={'where':_0x497f58[_0x070e('0x35')]};return db[_0x070e('0x27')][_0x070e('0x3c')](_0x487276)['then'](function(_0x13982f){_0x219e48[_0x070e('0x3c')]=_0x13982f;if(_0x1743cc['query'][_0x070e('0x3d')]){_0x497f58['include']=[{'all':!![]}];}return db[_0x070e('0x27')][_0x070e('0x3e')](_0x497f58);})[_0x070e('0x20')](function(_0x30319c){_0x219e48[_0x070e('0x3f')]=_0x30319c;return _0x219e48;})['then'](respondWithFilteredResult(_0x4763c6,_0x497f58))[_0x070e('0x40')](handleError(_0x4763c6,null));};exports['show']=function(_0x5bd39a,_0x398168){var _0x42c448={'raw':!![],'where':{'id':_0x5bd39a['params']['id']}},_0x38879f={};_0x38879f[_0x070e('0x2b')]=_[_0x070e('0x2c')](db[_0x070e('0x27')][_0x070e('0x28')]);_0x38879f['query']=_[_0x070e('0x2c')](_0x5bd39a['query']);_0x38879f['filters']=_['intersection'](_0x38879f[_0x070e('0x2b')],_0x38879f[_0x070e('0x2d')]);_0x42c448[_0x070e('0x2f')]=_[_0x070e('0x30')](_0x38879f[_0x070e('0x2b')],qs['fields'](_0x5bd39a[_0x070e('0x2d')]['fields']));_0x42c448[_0x070e('0x2f')]=_0x42c448[_0x070e('0x2f')][_0x070e('0x31')]?_0x42c448['attributes']:_0x38879f['model'];if(_0x5bd39a[_0x070e('0x2d')]['includeAll']){_0x42c448[_0x070e('0x41')]=[{'all':!![]}];}_0x42c448=_[_0x070e('0x3a')]({},_0x42c448,_0x5bd39a[_0x070e('0x3b')]);return db['SmsTransferReport'][_0x070e('0x42')](_0x42c448)[_0x070e('0x20')](handleEntityNotFound(_0x398168,null))['then'](respondWithResult(_0x398168,null))['catch'](handleError(_0x398168,null));};exports[_0x070e('0x43')]=function(_0x945901,_0x2d43ce){return db[_0x070e('0x27')][_0x070e('0x43')](_0x945901['body'],{})[_0x070e('0x20')](respondWithResult(_0x2d43ce,0xc9))[_0x070e('0x40')](handleError(_0x2d43ce,null));};exports[_0x070e('0x1f')]=function(_0x391dee,_0x79eaa0){if(_0x391dee[_0x070e('0x44')]['id']){delete _0x391dee[_0x070e('0x44')]['id'];}return db[_0x070e('0x27')][_0x070e('0x42')]({'where':{'id':_0x391dee[_0x070e('0x45')]['id']}})[_0x070e('0x20')](handleEntityNotFound(_0x79eaa0,null))[_0x070e('0x20')](saveUpdates(_0x391dee[_0x070e('0x44')],null))[_0x070e('0x20')](respondWithResult(_0x79eaa0,null))[_0x070e('0x40')](handleError(_0x79eaa0,null));};exports['destroy']=function(_0x171621,_0xa7a41b){return db[_0x070e('0x27')][_0x070e('0x42')]({'where':{'id':_0x171621[_0x070e('0x45')]['id']}})[_0x070e('0x20')](handleEntityNotFound(_0xa7a41b,null))[_0x070e('0x20')](removeEntity(_0xa7a41b,null))[_0x070e('0x40')](handleError(_0xa7a41b,null));};exports[_0x070e('0x46')]=function(_0x5744c5,_0x251696){return db['SmsTransferReport'][_0x070e('0x46')]()[_0x070e('0x20')](respondWithResult(_0x251696,null))['catch'](handleError(_0x251696,null));};
\ No newline at end of file
diff --git a/server/api/smsTransferReport/smsTransferReport.model.js b/server/api/smsTransferReport/smsTransferReport.model.js
index a150e92..cefabb6 100644
--- a/server/api/smsTransferReport/smsTransferReport.model.js
+++ b/server/api/smsTransferReport/smsTransferReport.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xe216=['util','api','moment','bluebird','path','rimraf','../../config/environment','./smsTransferReport.attributes','exports','define','SmsTransferReport','report_sms_transfer','uniqueid','lodash'];(function(_0x106cc5,_0x383876){var _0x17c990=function(_0x2ed6ea){while(--_0x2ed6ea){_0x106cc5['push'](_0x106cc5['shift']());}};_0x17c990(++_0x383876);}(_0xe216,0x195));var _0x6e21=function(_0x13cab0,_0x14d825){_0x13cab0=_0x13cab0-0x0;var _0x38804f=_0xe216[_0x13cab0];return _0x38804f;};'use strict';var _=require(_0x6e21('0x0'));var util=require(_0x6e21('0x1'));var logger=require('../../config/logger')(_0x6e21('0x2'));var moment=require(_0x6e21('0x3'));var BPromise=require(_0x6e21('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6e21('0x5'));var rimraf=require(_0x6e21('0x6'));var config=require(_0x6e21('0x7'));var attributes=require(_0x6e21('0x8'));module[_0x6e21('0x9')]=function(_0xa8eeb6,_0x4353f7){return _0xa8eeb6[_0x6e21('0xa')](_0x6e21('0xb'),attributes,{'tableName':_0x6e21('0xc'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x6e21('0xd')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xc71e=['SmsTransferReport','uniqueid','lodash','util','../../config/logger','api','moment','path','rimraf','../../config/environment','./smsTransferReport.attributes','define'];(function(_0x384638,_0x57f4ed){var _0x2e1a39=function(_0x4cccaa){while(--_0x4cccaa){_0x384638['push'](_0x384638['shift']());}};_0x2e1a39(++_0x57f4ed);}(_0xc71e,0xfe));var _0xec71=function(_0x5db46f,_0xcaea39){_0x5db46f=_0x5db46f-0x0;var _0x14bbfb=_0xc71e[_0x5db46f];return _0x14bbfb;};'use strict';var _=require(_0xec71('0x0'));var util=require(_0xec71('0x1'));var logger=require(_0xec71('0x2'))(_0xec71('0x3'));var moment=require(_0xec71('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xec71('0x5'));var rimraf=require(_0xec71('0x6'));var config=require(_0xec71('0x7'));var attributes=require(_0xec71('0x8'));module['exports']=function(_0x521904,_0x2ce1b5){return _0x521904[_0xec71('0x9')](_0xec71('0xa'),attributes,{'tableName':'report_sms_transfer','paranoid':![],'indexes':[{'name':_0xec71('0xb'),'fields':[_0xec71('0xb')]}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/smsTransferReport/smsTransferReport.rpc.js b/server/api/smsTransferReport/smsTransferReport.rpc.js
index bb539a0..38e95e8 100644
--- a/server/api/smsTransferReport/smsTransferReport.rpc.js
+++ b/server/api/smsTransferReport/smsTransferReport.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x4f6d=['request','info','request\x20sent','debug','SmsTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','SmsTransferReport,\x20%s,\x20%s','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http'];(function(_0x49217d,_0x5d7e15){var _0x409671=function(_0xfa6cf6){while(--_0xfa6cf6){_0x49217d['push'](_0x49217d['shift']());}};_0x409671(++_0x5d7e15);}(_0x4f6d,0x1a9));var _0xd4f6=function(_0x22ee06,_0x39981f){_0x22ee06=_0x22ee06-0x0;var _0x1d455c=_0x4f6d[_0x22ee06];return _0x1d455c;};'use strict';var _=require('lodash');var util=require(_0xd4f6('0x0'));var moment=require(_0xd4f6('0x1'));var BPromise=require(_0xd4f6('0x2'));var rs=require(_0xd4f6('0x3'));var fs=require('fs');var Redis=require(_0xd4f6('0x4'));var db=require(_0xd4f6('0x5'))['db'];var utils=require(_0xd4f6('0x6'));var logger=require(_0xd4f6('0x7'))(_0xd4f6('0x8'));var config=require(_0xd4f6('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xd4f6('0xa')][_0xd4f6('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2faf25,_0x245a98,_0x1d6742){return new BPromise(function(_0x281baa,_0x57f108){return client[_0xd4f6('0xc')](_0x2faf25,_0x1d6742)['then'](function(_0x149420){logger[_0xd4f6('0xd')]('SmsTransferReport,\x20%s,\x20%s',_0x245a98,_0xd4f6('0xe'));logger[_0xd4f6('0xf')](_0xd4f6('0x10'),_0x245a98,_0xd4f6('0xe'),JSON[_0xd4f6('0x11')](_0x149420));if(_0x149420[_0xd4f6('0x12')]){if(_0x149420[_0xd4f6('0x12')][_0xd4f6('0x13')]===0x1f4){logger[_0xd4f6('0x12')](_0xd4f6('0x14'),_0x245a98,_0x149420[_0xd4f6('0x12')][_0xd4f6('0x15')]);return _0x57f108(_0x149420['error'][_0xd4f6('0x15')]);}logger[_0xd4f6('0x12')]('SmsTransferReport,\x20%s,\x20%s',_0x245a98,_0x149420[_0xd4f6('0x12')]['message']);return _0x281baa(_0x149420[_0xd4f6('0x12')][_0xd4f6('0x15')]);}else{logger[_0xd4f6('0xd')](_0xd4f6('0x14'),_0x245a98,_0xd4f6('0xe'));_0x281baa(_0x149420['result'][_0xd4f6('0x15')]);}})[_0xd4f6('0x16')](function(_0x53b114){logger[_0xd4f6('0x12')]('SmsTransferReport,\x20%s,\x20%s',_0x245a98,_0x53b114);_0x57f108(_0x53b114);});});}
\ No newline at end of file
+var _0xc122=['stringify','error','code','message','info','result','catch','lodash','util','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','then','SmsTransferReport,\x20%s,\x20%s','request\x20sent','debug','SmsTransferReport,\x20%s,\x20%s,\x20%s'];(function(_0x494d1f,_0x3f72ff){var _0x457b6e=function(_0x38cb16){while(--_0x38cb16){_0x494d1f['push'](_0x494d1f['shift']());}};_0x457b6e(++_0x3f72ff);}(_0xc122,0x16c));var _0x2c12=function(_0x54ec06,_0x1d3b4b){_0x54ec06=_0x54ec06-0x0;var _0x244b87=_0xc122[_0x54ec06];return _0x244b87;};'use strict';var _=require(_0x2c12('0x0'));var util=require(_0x2c12('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2c12('0x2'));var db=require(_0x2c12('0x3'))['db'];var utils=require(_0x2c12('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0x2c12('0x5'));var jayson=require(_0x2c12('0x6'));var client=jayson[_0x2c12('0x7')][_0x2c12('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x26dae7,_0x48c5d5,_0x1bad5d){return new BPromise(function(_0x5f4b4d,_0x221ae8){return client['request'](_0x26dae7,_0x1bad5d)[_0x2c12('0x9')](function(_0xb4c2d2){logger['info'](_0x2c12('0xa'),_0x48c5d5,_0x2c12('0xb'));logger[_0x2c12('0xc')](_0x2c12('0xd'),_0x48c5d5,'request\x20sent',JSON[_0x2c12('0xe')](_0xb4c2d2));if(_0xb4c2d2[_0x2c12('0xf')]){if(_0xb4c2d2['error'][_0x2c12('0x10')]===0x1f4){logger[_0x2c12('0xf')](_0x2c12('0xa'),_0x48c5d5,_0xb4c2d2[_0x2c12('0xf')][_0x2c12('0x11')]);return _0x221ae8(_0xb4c2d2[_0x2c12('0xf')][_0x2c12('0x11')]);}logger['error'](_0x2c12('0xa'),_0x48c5d5,_0xb4c2d2['error'][_0x2c12('0x11')]);return _0x5f4b4d(_0xb4c2d2[_0x2c12('0xf')][_0x2c12('0x11')]);}else{logger[_0x2c12('0x12')](_0x2c12('0xa'),_0x48c5d5,_0x2c12('0xb'));_0x5f4b4d(_0xb4c2d2[_0x2c12('0x13')][_0x2c12('0x11')]);}})[_0x2c12('0x14')](function(_0x522908){logger[_0x2c12('0xf')](_0x2c12('0xa'),_0x48c5d5,_0x522908);_0x221ae8(_0x522908);});});}
\ No newline at end of file
diff --git a/server/api/sound/index.js b/server/api/sound/index.js
index 0be2c03..bb57e26 100644
--- a/server/api/sound/index.js
+++ b/server/api/sound/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x02ef=['delete','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./sound.controller','get','index','/:id','isAuthenticated','show','/:id/download','diskStorage','join','root','server/files/sounds/original/','originalname','replace','format','%s-%s%s','basename','extname','post','create','put','update'];(function(_0x46e363,_0x45d7e2){var _0x3fb059=function(_0x5e6274){while(--_0x5e6274){_0x46e363['push'](_0x46e363['shift']());}};_0x3fb059(++_0x45d7e2);}(_0x02ef,0x1c4));var _0xf02e=function(_0x27a45d,_0x14499a){_0x27a45d=_0x27a45d-0x0;var _0x5aee32=_0x02ef[_0x27a45d];return _0x5aee32;};'use strict';var multer=require(_0xf02e('0x0'));var util=require('util');var path=require(_0xf02e('0x1'));var timeout=require(_0xf02e('0x2'));var express=require(_0xf02e('0x3'));var router=express[_0xf02e('0x4')]();var auth=require(_0xf02e('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xf02e('0x6'));var controller=require(_0xf02e('0x7'));router[_0xf02e('0x8')]('/',auth['isAuthenticated'](),controller[_0xf02e('0x9')]);router[_0xf02e('0x8')](_0xf02e('0xa'),auth[_0xf02e('0xb')](),controller[_0xf02e('0xc')]);router[_0xf02e('0x8')](_0xf02e('0xd'),auth[_0xf02e('0xb')](),controller['download']);var upload=multer({'storage':multer[_0xf02e('0xe')]({'destination':function(_0x3c2ba4,_0x2d435a,_0xe500de){_0xe500de(null,path[_0xf02e('0xf')](config[_0xf02e('0x10')],_0xf02e('0x11')));},'filename':function(_0x385ce3,_0x12c489,_0x46d438){_0x12c489[_0xf02e('0x12')]=_0x12c489[_0xf02e('0x12')][_0xf02e('0x13')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x46d438(null,util[_0xf02e('0x14')](_0xf02e('0x15'),path[_0xf02e('0x16')](_0x12c489['originalname'],path['extname'](_0x12c489[_0xf02e('0x12')])),Date['now'](),path[_0xf02e('0x17')](_0x12c489[_0xf02e('0x12')])));}})});router[_0xf02e('0x18')]('/',upload['single']('file'),controller[_0xf02e('0x19')]);router[_0xf02e('0x1a')](_0xf02e('0xa'),auth['isAuthenticated'](),controller[_0xf02e('0x1b')]);router[_0xf02e('0x1c')](_0xf02e('0xa'),auth[_0xf02e('0xb')](),controller[_0xf02e('0x1c')]);module[_0xf02e('0x1d')]=router;
\ No newline at end of file
+var _0x3ff7=['post','single','file','update','delete','exports','multer','util','path','connect-timeout','Router','../../components/interaction/service','../../config/environment','./sound.controller','get','index','/:id','isAuthenticated','show','/:id/download','download','diskStorage','join','root','server/files/sounds/original/','originalname','format','%s-%s%s','extname'];(function(_0x1e4360,_0x930b9b){var _0x31e6b4=function(_0x49dd8e){while(--_0x49dd8e){_0x1e4360['push'](_0x1e4360['shift']());}};_0x31e6b4(++_0x930b9b);}(_0x3ff7,0x7a));var _0x73ff=function(_0x529abc,_0x17b97e){_0x529abc=_0x529abc-0x0;var _0x453afa=_0x3ff7[_0x529abc];return _0x453afa;};'use strict';var multer=require(_0x73ff('0x0'));var util=require(_0x73ff('0x1'));var path=require(_0x73ff('0x2'));var timeout=require(_0x73ff('0x3'));var express=require('express');var router=express[_0x73ff('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x73ff('0x5'));var config=require(_0x73ff('0x6'));var controller=require(_0x73ff('0x7'));router[_0x73ff('0x8')]('/',auth['isAuthenticated'](),controller[_0x73ff('0x9')]);router[_0x73ff('0x8')](_0x73ff('0xa'),auth[_0x73ff('0xb')](),controller[_0x73ff('0xc')]);router[_0x73ff('0x8')](_0x73ff('0xd'),auth[_0x73ff('0xb')](),controller[_0x73ff('0xe')]);var upload=multer({'storage':multer[_0x73ff('0xf')]({'destination':function(_0x42fd44,_0x9750a3,_0x5e6de8){_0x5e6de8(null,path[_0x73ff('0x10')](config[_0x73ff('0x11')],_0x73ff('0x12')));},'filename':function(_0x1f4d08,_0x487ac9,_0x438afe){_0x487ac9[_0x73ff('0x13')]=_0x487ac9[_0x73ff('0x13')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x438afe(null,util[_0x73ff('0x14')](_0x73ff('0x15'),path['basename'](_0x487ac9[_0x73ff('0x13')],path['extname'](_0x487ac9[_0x73ff('0x13')])),Date['now'](),path[_0x73ff('0x16')](_0x487ac9['originalname'])));}})});router[_0x73ff('0x17')]('/',upload[_0x73ff('0x18')](_0x73ff('0x19')),controller['create']);router['put'](_0x73ff('0xa'),auth[_0x73ff('0xb')](),controller[_0x73ff('0x1a')]);router[_0x73ff('0x1b')]('/:id',auth[_0x73ff('0xb')](),controller['delete']);module[_0x73ff('0x1c')]=router;
\ No newline at end of file
diff --git a/server/api/sound/sound.attributes.js b/server/api/sound/sound.attributes.js
index a5a4c13..db03cbe 100644
--- a/server/api/sound/sound.attributes.js
+++ b/server/api/sound/sound.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xf436=['BIGINT','sequelize','exports','STRING','FLOAT','INTEGER'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xf436,0x11b));var _0x6f43=function(_0x3ad134,_0x45369e){_0x3ad134=_0x3ad134-0x0;var _0x31400e=_0xf436[_0x3ad134];return _0x31400e;};'use strict';var Sequelize=require(_0x6f43('0x0'));module[_0x6f43('0x1')]={'name':{'type':Sequelize[_0x6f43('0x2')],'unique':'name','allowNull':![]},'save_name':{'type':Sequelize[_0x6f43('0x2')]},'display_name':{'type':Sequelize['STRING'],'defaultValue':''},'description':{'type':Sequelize[_0x6f43('0x2')]},'original_format':{'type':Sequelize[_0x6f43('0x2')]},'original_duration':{'type':Sequelize[_0x6f43('0x3')]},'original_sampleCount':{'type':Sequelize['BIGINT']},'original_channelCount':{'type':Sequelize[_0x6f43('0x4')]},'original_bitRate':{'type':Sequelize[_0x6f43('0x5')]},'original_sampleRate':{'type':Sequelize[_0x6f43('0x4')]},'converted_format':{'type':Sequelize[_0x6f43('0x2')]},'converted_duration':{'type':Sequelize[_0x6f43('0x3')]},'converted_sampleCount':{'type':Sequelize['BIGINT']},'converted_channelCount':{'type':Sequelize[_0x6f43('0x4')]},'converted_bitRate':{'type':Sequelize[_0x6f43('0x5')]},'converted_sampleRate':{'type':Sequelize[_0x6f43('0x4')]}};
\ No newline at end of file
+var _0x62b5=['INTEGER','BIGINT','sequelize','STRING','FLOAT'];(function(_0x5ee888,_0xaaff15){var _0x43d301=function(_0x3c9242){while(--_0x3c9242){_0x5ee888['push'](_0x5ee888['shift']());}};_0x43d301(++_0xaaff15);}(_0x62b5,0x188));var _0x562b=function(_0x4362a7,_0x11bd2f){_0x4362a7=_0x4362a7-0x0;var _0x1ae7cf=_0x62b5[_0x4362a7];return _0x1ae7cf;};'use strict';var Sequelize=require(_0x562b('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![]},'save_name':{'type':Sequelize['STRING']},'display_name':{'type':Sequelize[_0x562b('0x1')],'defaultValue':''},'description':{'type':Sequelize[_0x562b('0x1')]},'original_format':{'type':Sequelize[_0x562b('0x1')]},'original_duration':{'type':Sequelize[_0x562b('0x2')]},'original_sampleCount':{'type':Sequelize['BIGINT']},'original_channelCount':{'type':Sequelize[_0x562b('0x3')]},'original_bitRate':{'type':Sequelize[_0x562b('0x4')]},'original_sampleRate':{'type':Sequelize[_0x562b('0x3')]},'converted_format':{'type':Sequelize[_0x562b('0x1')]},'converted_duration':{'type':Sequelize['FLOAT']},'converted_sampleCount':{'type':Sequelize['BIGINT']},'converted_channelCount':{'type':Sequelize[_0x562b('0x3')]},'converted_bitRate':{'type':Sequelize[_0x562b('0x4')]},'converted_sampleRate':{'type':Sequelize[_0x562b('0x3')]}};
\ No newline at end of file
diff --git a/server/api/sound/sound.controller.js b/server/api/sound/sound.controller.js
index 3c1a5db..a79996f 100644
--- a/server/api/sound/sound.controller.js
+++ b/server/api/sound/sound.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xde5b=['../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','status','end','json','count','offset','limit','Content-Range','save','update','then','destroy','Sounds','UserProfileResource','sendStatus','error','stack','name','send','Sound','rawAttributes','key','model','query','keys','filters','attributes','intersection','fields','length','nolimit','order','sort','filter','merge','map','type','VIRTUAL','options','where','includeAll','include','findAll','rows','catch','show','params','find','download','save_name','converted_format','existsSync','join','root','server/files/sounds/converted','Sequelize','ValidationError','Sound\x20not\x20found','%s.%s','basename','file','originalname','extname','filename','substring','wav','format','info','Sound\x20upload\x20destination:\x20%s','transcode','src','original_duration','original_sampleCount','sampleCount','original_channelCount','channelCount','original_bitRate','bitRate','original_sampleRate','sampleRate','dest','converted_duration','duration','converted_sampleCount','converted_bitRate','converted_sampleRate','chmodSync','create','role','body','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','get','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','start','pick','description','delete','server/files/sounds/original','original_format','unlinkSync','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xde5b,0x1e8));var _0xbde5=function(_0x1d933c,_0x3263af){_0x1d933c=_0x1d933c-0x0;var _0x3fb831=_0xde5b[_0x1d933c];return _0x3fb831;};'use strict';var pdf=require(_0xbde5('0x0'));var emlformat=require(_0xbde5('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xbde5('0x2'));var jsonpatch=require(_0xbde5('0x3'));var rp=require(_0xbde5('0x4'));var moment=require('moment');var BPromise=require(_0xbde5('0x5'));var Mustache=require(_0xbde5('0x6'));var util=require('util');var path=require(_0xbde5('0x7'));var sox=require(_0xbde5('0x8'));var csv=require(_0xbde5('0x9'));var ejs=require(_0xbde5('0xa'));var fs=require('fs');var _=require(_0xbde5('0xb'));var squel=require('squel');var crypto=require(_0xbde5('0xc'));var jsforce=require(_0xbde5('0xd'));var deskjs=require(_0xbde5('0xe'));var toCsv=require(_0xbde5('0x9'));var querystring=require(_0xbde5('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xbde5('0x10'));var qs=require(_0xbde5('0x11'));var as=require(_0xbde5('0x12'));var hardwareService=require(_0xbde5('0x13'));var logger=require(_0xbde5('0x14'))(_0xbde5('0x15'));var utils=require(_0xbde5('0x16'));var config=require(_0xbde5('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x152230,_0x21fd75){_0x21fd75=_0x21fd75||0xcc;return function(_0x4fa320){if(_0x4fa320){return _0x152230['sendStatus'](_0x21fd75);}return _0x152230[_0xbde5('0x18')](_0x21fd75)[_0xbde5('0x19')]();};}function respondWithResult(_0x3fb070,_0x145120){_0x145120=_0x145120||0xc8;return function(_0x395023){if(_0x395023){return _0x3fb070[_0xbde5('0x18')](_0x145120)[_0xbde5('0x1a')](_0x395023);}};}function respondWithFilteredResult(_0x41dc4d,_0x1b1146){return function(_0x5911b8){if(_0x5911b8){var _0x5a667f=_0x5911b8[_0xbde5('0x1b')],_0x71d9e=_0x1b1146[_0xbde5('0x1c')],_0x45c2d1=_0x1b1146[_0xbde5('0x1c')]+_0x1b1146[_0xbde5('0x1d')],_0xffc01;if(_0x45c2d1>=_0x5a667f){_0x45c2d1=_0x5a667f;_0xffc01=0xc8;}else{_0xffc01=0xce;}_0x41dc4d[_0xbde5('0x18')](_0xffc01);return _0x41dc4d['set'](_0xbde5('0x1e'),_0x71d9e+'-'+_0x45c2d1+'/'+_0x5a667f)[_0xbde5('0x1a')](_0x5911b8);}return null;};}function patchUpdates(_0x554888){return function(_0x2f8397){try{jsonpatch['apply'](_0x2f8397,_0x554888,!![]);}catch(_0x380da4){return BPromise['reject'](_0x380da4);}return _0x2f8397[_0xbde5('0x1f')]();};}function saveUpdates(_0x139846,_0x1812f4){return function(_0x20778a){if(_0x20778a){return _0x20778a[_0xbde5('0x20')](_0x139846)[_0xbde5('0x21')](function(_0x2be70f){return _0x2be70f;});}return null;};}function removeEntity(_0x3511d9,_0x4b4f32){return function(_0x5d4d82){if(_0x5d4d82){return _0x5d4d82[_0xbde5('0x22')]()[_0xbde5('0x21')](function(){var _0x35a584=_0x5d4d82['get']({'plain':!![]});var _0x4643a8=_0xbde5('0x23');return db[_0xbde5('0x24')][_0xbde5('0x22')]({'where':{'type':_0x4643a8,'resourceId':_0x35a584['id']}})['then'](function(){return _0x5d4d82;});})['then'](function(){_0x3511d9[_0xbde5('0x18')](0xcc)[_0xbde5('0x19')]();});}};}function handleEntityNotFound(_0x695016,_0xc8b9f9){return function(_0x402174){if(!_0x402174){_0x695016[_0xbde5('0x25')](0x194);}return _0x402174;};}function handleError(_0x16511c,_0x5bc4d5){_0x5bc4d5=_0x5bc4d5||0x1f4;return function(_0x226e67){logger[_0xbde5('0x26')](_0x226e67[_0xbde5('0x27')]);if(_0x226e67[_0xbde5('0x28')]){delete _0x226e67[_0xbde5('0x28')];}_0x16511c[_0xbde5('0x18')](_0x5bc4d5)[_0xbde5('0x29')](_0x226e67);};}exports['index']=function(_0x31b3d7,_0x3925c3){var _0x343f95={},_0xa65464={},_0x1777ef={'count':0x0,'rows':[]};var _0x4129cc=_['map'](db[_0xbde5('0x2a')][_0xbde5('0x2b')],function(_0x970ee8){return{'name':_0x970ee8['fieldName'],'type':_0x970ee8['type'][_0xbde5('0x2c')]};});_0xa65464[_0xbde5('0x2d')]=_['map'](_0x4129cc,'name');_0xa65464[_0xbde5('0x2e')]=_[_0xbde5('0x2f')](_0x31b3d7[_0xbde5('0x2e')]);_0xa65464[_0xbde5('0x30')]=_['intersection'](_0xa65464[_0xbde5('0x2d')],_0xa65464[_0xbde5('0x2e')]);_0x343f95[_0xbde5('0x31')]=_[_0xbde5('0x32')](_0xa65464[_0xbde5('0x2d')],qs['fields'](_0x31b3d7['query'][_0xbde5('0x33')]));_0x343f95[_0xbde5('0x31')]=_0x343f95[_0xbde5('0x31')][_0xbde5('0x34')]?_0x343f95[_0xbde5('0x31')]:_0xa65464[_0xbde5('0x2d')];if(!_0x31b3d7[_0xbde5('0x2e')]['hasOwnProperty'](_0xbde5('0x35'))){_0x343f95['limit']=qs[_0xbde5('0x1d')](_0x31b3d7[_0xbde5('0x2e')]['limit']);_0x343f95[_0xbde5('0x1c')]=qs['offset'](_0x31b3d7[_0xbde5('0x2e')][_0xbde5('0x1c')]);}_0x343f95[_0xbde5('0x36')]=qs[_0xbde5('0x37')](_0x31b3d7[_0xbde5('0x2e')]['sort']);_0x343f95['where']=qs[_0xbde5('0x30')](_['pick'](_0x31b3d7[_0xbde5('0x2e')],_0xa65464[_0xbde5('0x30')]),_0x4129cc);if(_0x31b3d7['query'][_0xbde5('0x38')]){_0x343f95['where']=_[_0xbde5('0x39')](_0x343f95['where'],{'$or':_[_0xbde5('0x3a')](_0x4129cc,function(_0x568b75){if(_0x568b75[_0xbde5('0x3b')]!==_0xbde5('0x3c')){var _0x1b632c={};_0x1b632c[_0x568b75['name']]={'$like':'%'+_0x31b3d7[_0xbde5('0x2e')][_0xbde5('0x38')]+'%'};return _0x1b632c;}})});}_0x343f95=_[_0xbde5('0x39')]({},_0x343f95,_0x31b3d7[_0xbde5('0x3d')]);var _0xbe81b={'where':_0x343f95[_0xbde5('0x3e')]};return db[_0xbde5('0x2a')][_0xbde5('0x1b')](_0xbe81b)[_0xbde5('0x21')](function(_0x314e2c){_0x1777ef[_0xbde5('0x1b')]=_0x314e2c;if(_0x31b3d7[_0xbde5('0x2e')][_0xbde5('0x3f')]){_0x343f95[_0xbde5('0x40')]=[{'all':!![]}];}return db[_0xbde5('0x2a')][_0xbde5('0x41')](_0x343f95);})['then'](function(_0x21cb62){_0x1777ef[_0xbde5('0x42')]=_0x21cb62;return _0x1777ef;})['then'](respondWithFilteredResult(_0x3925c3,_0x343f95))[_0xbde5('0x43')](handleError(_0x3925c3,null));};exports[_0xbde5('0x44')]=function(_0xd6b7e,_0x5a9b71){var _0x2a2640={'raw':!![],'where':{'id':_0xd6b7e[_0xbde5('0x45')]['id']}},_0x421a7e={};_0x421a7e['model']=_[_0xbde5('0x2f')](db[_0xbde5('0x2a')]['rawAttributes']);_0x421a7e['query']=_['keys'](_0xd6b7e[_0xbde5('0x2e')]);_0x421a7e[_0xbde5('0x30')]=_['intersection'](_0x421a7e[_0xbde5('0x2d')],_0x421a7e[_0xbde5('0x2e')]);_0x2a2640[_0xbde5('0x31')]=_['intersection'](_0x421a7e[_0xbde5('0x2d')],qs[_0xbde5('0x33')](_0xd6b7e[_0xbde5('0x2e')][_0xbde5('0x33')]));_0x2a2640[_0xbde5('0x31')]=_0x2a2640['attributes'][_0xbde5('0x34')]?_0x2a2640[_0xbde5('0x31')]:_0x421a7e[_0xbde5('0x2d')];if(_0xd6b7e[_0xbde5('0x2e')][_0xbde5('0x3f')]){_0x2a2640[_0xbde5('0x40')]=[{'all':!![]}];}_0x2a2640=_[_0xbde5('0x39')]({},_0x2a2640,_0xd6b7e[_0xbde5('0x3d')]);return db[_0xbde5('0x2a')][_0xbde5('0x46')](_0x2a2640)[_0xbde5('0x21')](handleEntityNotFound(_0x5a9b71,null))[_0xbde5('0x21')](respondWithResult(_0x5a9b71,null))[_0xbde5('0x43')](handleError(_0x5a9b71,null));};exports[_0xbde5('0x47')]=function(_0x4a7d7a,_0x43dcaf,_0x1d76a2){return db[_0xbde5('0x2a')][_0xbde5('0x46')]({'where':{'id':_0x4a7d7a[_0xbde5('0x45')]['id']},'attributes':[_0xbde5('0x28'),_0xbde5('0x48'),_0xbde5('0x49')],'raw':!![]})[_0xbde5('0x21')](handleEntityNotFound(_0x43dcaf,null))[_0xbde5('0x21')](function(_0x45ec99){if(_0x45ec99){if(!fs[_0xbde5('0x4a')](path[_0xbde5('0x4b')](config[_0xbde5('0x4c')],_0xbde5('0x4d'),_0x45ec99[_0xbde5('0x48')]+'.'+_0x45ec99[_0xbde5('0x49')]))){throw new db[(_0xbde5('0x4e'))][(_0xbde5('0x4f'))](_0xbde5('0x50'));}return _0x43dcaf['download'](path[_0xbde5('0x4b')](config[_0xbde5('0x4c')],_0xbde5('0x4d'),util['format'](_0xbde5('0x51'),_0x45ec99[_0xbde5('0x48')],_0x45ec99[_0xbde5('0x49')])),util['format']('%s.%s',_0x45ec99[_0xbde5('0x28')],_0x45ec99[_0xbde5('0x49')]));}return null;})[_0xbde5('0x43')](handleError(_0x43dcaf,null));};exports['create']=function(_0x22ff31,_0x3b6f8d,_0x44040b){var _0x42988c={'name':path[_0xbde5('0x52')](_0x22ff31[_0xbde5('0x53')][_0xbde5('0x54')],path[_0xbde5('0x55')](_0x22ff31[_0xbde5('0x53')][_0xbde5('0x54')])),'save_name':path[_0xbde5('0x52')](_0x22ff31[_0xbde5('0x53')]['filename'],path[_0xbde5('0x55')](_0x22ff31[_0xbde5('0x53')][_0xbde5('0x56')])),'original_format':path[_0xbde5('0x55')](_0x22ff31[_0xbde5('0x53')][_0xbde5('0x54')])[_0xbde5('0x57')](0x1),'converted_format':_0xbde5('0x58')};var _0x17f758=path[_0xbde5('0x4b')](config[_0xbde5('0x4c')],'server/files/sounds/original',_0x22ff31[_0xbde5('0x53')][_0xbde5('0x56')]);var _0x4d65b5=path[_0xbde5('0x4b')](config[_0xbde5('0x4c')],_0xbde5('0x4d'),util[_0xbde5('0x59')]('%s.%s',path[_0xbde5('0x52')](_0x22ff31['file'][_0xbde5('0x56')],path[_0xbde5('0x55')](_0x22ff31[_0xbde5('0x53')]['filename'])),_0x42988c['converted_format']));logger[_0xbde5('0x5a')]('Sound\x20upload\x20filepath:\x20%s',_0x17f758);logger[_0xbde5('0x5a')](_0xbde5('0x5b'),_0x4d65b5);try{fs['chmodSync'](_0x17f758,parseInt('0777',0x8));var _0x180fc3=sox[_0xbde5('0x5c')](_0x17f758,_0x4d65b5,{'sampleRate':0x1f40,'format':_0xbde5('0x58'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x180fc3['on']('error',function(_0x4172ac){fs['unlinkSync'](_0x17f758);_0x3b6f8d['status'](0x1f4)[_0xbde5('0x29')](_0x4172ac);});_0x180fc3['on'](_0xbde5('0x5d'),function(_0x22579f){_0x42988c[_0xbde5('0x5e')]=isNaN(_0x22579f['duration'])?null:_0x22579f['duration']*0x3e8;_0x42988c[_0xbde5('0x5f')]=isNaN(_0x22579f['sampleCount'])?null:_0x22579f[_0xbde5('0x60')];_0x42988c[_0xbde5('0x61')]=isNaN(_0x22579f[_0xbde5('0x62')])?null:_0x22579f[_0xbde5('0x62')];_0x42988c[_0xbde5('0x63')]=isNaN(_0x22579f[_0xbde5('0x64')])?null:_0x22579f[_0xbde5('0x64')];_0x42988c[_0xbde5('0x65')]=isNaN(_0x22579f[_0xbde5('0x66')])?null:_0x22579f['sampleRate'];});_0x180fc3['on'](_0xbde5('0x67'),function(_0x167316){_0x42988c[_0xbde5('0x68')]=isNaN(_0x167316[_0xbde5('0x69')])?null:_0x167316[_0xbde5('0x69')]*0x3e8;_0x42988c[_0xbde5('0x6a')]=isNaN(_0x167316['sampleCount'])?null:_0x167316[_0xbde5('0x60')];_0x42988c['converted_channelCount']=isNaN(_0x167316[_0xbde5('0x62')])?null:_0x167316[_0xbde5('0x62')];_0x42988c[_0xbde5('0x6b')]=isNaN(_0x167316[_0xbde5('0x64')])?null:_0x167316[_0xbde5('0x64')];_0x42988c[_0xbde5('0x6c')]=isNaN(_0x167316[_0xbde5('0x66')])?null:_0x167316[_0xbde5('0x66')];});_0x180fc3['on'](_0xbde5('0x19'),function(){fs[_0xbde5('0x6d')](_0x4d65b5,parseInt('0777',0x8));return db[_0xbde5('0x2a')][_0xbde5('0x6e')](_0x42988c)[_0xbde5('0x21')](function(_0x5f42af){var _0x1fccc3={'role':_0x22ff31['body'][_0xbde5('0x6f')],'userProfileId':_0x22ff31[_0xbde5('0x70')][_0xbde5('0x71')]};if(!_0x1fccc3)throw new Error(_0xbde5('0x72'));if(_0x1fccc3[_0xbde5('0x6f')]==='user'){var _0x53cdfd=_0x5f42af[_0xbde5('0x73')]({'plain':!![]});return db[_0xbde5('0x74')][_0xbde5('0x46')]({'where':{'name':'Sounds','userProfileId':_0x1fccc3[_0xbde5('0x71')]},'raw':!![]})['then'](function(_0x23e75d){if(_0x23e75d&&_0x23e75d[_0xbde5('0x75')]===0x0){return db[_0xbde5('0x24')]['create']({'name':_0x53cdfd[_0xbde5('0x28')],'resourceId':_0x53cdfd['id'],'type':_0x23e75d['name'],'sectionId':_0x23e75d['id']},{})[_0xbde5('0x21')](function(){return _0x5f42af;});}else{return _0x5f42af;}})[_0xbde5('0x43')](function(_0x5ca7e8){logger[_0xbde5('0x26')](_0xbde5('0x76'),_0x5ca7e8);throw _0x5ca7e8;});}return _0x5f42af;})[_0xbde5('0x21')](respondWithResult(_0x3b6f8d,null))[_0xbde5('0x43')](handleError(_0x3b6f8d,null));});_0x180fc3[_0xbde5('0x77')]();}catch(_0x3aef25){_0x3b6f8d[_0xbde5('0x18')](0x1f4)[_0xbde5('0x29')](_0x3aef25);}};exports[_0xbde5('0x20')]=function(_0x3b649f,_0x490092,_0x10a340){return db[_0xbde5('0x2a')][_0xbde5('0x46')]({'where':{'id':_0x3b649f[_0xbde5('0x45')]['id']}})[_0xbde5('0x21')](handleEntityNotFound(_0x490092,null))[_0xbde5('0x21')](saveUpdates(_[_0xbde5('0x78')](_0x3b649f[_0xbde5('0x70')],[_0xbde5('0x28'),_0xbde5('0x79')]),null))['then'](respondWithResult(_0x490092,null))['catch'](handleError(_0x490092,null));};exports[_0xbde5('0x7a')]=function(_0x536ecb,_0x1972c7,_0x434bd0){return db['Sound']['find']({'where':{'id':_0x536ecb[_0xbde5('0x45')]['id']}})[_0xbde5('0x21')](function(_0x2f74bb){if(_0x2f74bb){return _0x2f74bb[_0xbde5('0x22')]();}})[_0xbde5('0x21')](function(_0x375a25){var _0xaa71fd=path['join'](config[_0xbde5('0x4c')],_0xbde5('0x7b'),util[_0xbde5('0x59')](_0xbde5('0x51'),_0x375a25[_0xbde5('0x48')],_0x375a25[_0xbde5('0x7c')]));var _0x275d9e=path[_0xbde5('0x4b')](config[_0xbde5('0x4c')],'server/files/sounds/converted',util[_0xbde5('0x59')](_0xbde5('0x51'),_0x375a25[_0xbde5('0x48')],_0x375a25[_0xbde5('0x49')]));fs[_0xbde5('0x7d')](_0xaa71fd);fs[_0xbde5('0x7d')](_0x275d9e);return _0x375a25;})['then'](function(_0x4925c8){if(_0x4925c8){return _0x1972c7['status'](0xcc)[_0xbde5('0x19')]();}})['then'](handleEntityNotFound(_0x1972c7,null))[_0xbde5('0x43')](handleError(_0x1972c7,null));};
\ No newline at end of file
+var _0x7a87=['merge','VIRTUAL','options','where','count','includeAll','Sound','findAll','rows','catch','params','keys','length','find','save_name','converted_format','existsSync','join','root','server/files/sounds/converted','Sequelize','ValidationError','Sound\x20not\x20found','format','%s.%s','create','basename','file','originalname','extname','filename','wav','server/files/sounds/original','info','Sound\x20upload\x20filepath:\x20%s','0777','transcode','unlinkSync','send','duration','original_sampleCount','sampleCount','original_channelCount','channelCount','bitRate','original_sampleRate','sampleRate','dest','converted_duration','converted_sampleCount','converted_bitRate','converted_sampleRate','end','chmodSync','body','role','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','update','description','delete','original_format','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','status','json','offset','limit','set','Content-Range','apply','reject','then','destroy','get','Sounds','UserProfileResource','sendStatus','error','stack','name','index','map','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','attributes','hasOwnProperty','order','sort','pick','filter'];(function(_0x13cab0,_0x14d825){var _0x38804f=function(_0x1bffaf){while(--_0x1bffaf){_0x13cab0['push'](_0x13cab0['shift']());}};_0x38804f(++_0x14d825);}(_0x7a87,0x131));var _0x77a8=function(_0xd564bf,_0x56daf3){_0xd564bf=_0xd564bf-0x0;var _0x5e26b2=_0x7a87[_0xd564bf];return _0x5e26b2;};'use strict';var pdf=require(_0x77a8('0x0'));var emlformat=require(_0x77a8('0x1'));var rimraf=require(_0x77a8('0x2'));var zipdir=require(_0x77a8('0x3'));var jsonpatch=require(_0x77a8('0x4'));var rp=require(_0x77a8('0x5'));var moment=require(_0x77a8('0x6'));var BPromise=require('bluebird');var Mustache=require(_0x77a8('0x7'));var util=require(_0x77a8('0x8'));var path=require(_0x77a8('0x9'));var sox=require(_0x77a8('0xa'));var csv=require(_0x77a8('0xb'));var ejs=require(_0x77a8('0xc'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x77a8('0xd'));var jsforce=require(_0x77a8('0xe'));var deskjs=require(_0x77a8('0xf'));var toCsv=require(_0x77a8('0xb'));var querystring=require(_0x77a8('0x10'));var Papa=require(_0x77a8('0x11'));var Redis=require('ioredis');var authService=require(_0x77a8('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x77a8('0x13'));var hardwareService=require(_0x77a8('0x14'));var logger=require(_0x77a8('0x15'))('api');var utils=require('../../config/utils');var config=require(_0x77a8('0x16'));var db=require(_0x77a8('0x17'))['db'];function respondWithStatusCode(_0x255edf,_0x49573a){_0x49573a=_0x49573a||0xcc;return function(_0x5c8b5d){if(_0x5c8b5d){return _0x255edf['sendStatus'](_0x49573a);}return _0x255edf[_0x77a8('0x18')](_0x49573a)['end']();};}function respondWithResult(_0x214213,_0x2fd087){_0x2fd087=_0x2fd087||0xc8;return function(_0x4f114d){if(_0x4f114d){return _0x214213[_0x77a8('0x18')](_0x2fd087)[_0x77a8('0x19')](_0x4f114d);}};}function respondWithFilteredResult(_0x4483eb,_0x5bd934){return function(_0x2c794a){if(_0x2c794a){var _0x2ca6e1=_0x2c794a['count'],_0x40d8b1=_0x5bd934[_0x77a8('0x1a')],_0x2d768a=_0x5bd934[_0x77a8('0x1a')]+_0x5bd934[_0x77a8('0x1b')],_0x44c621;if(_0x2d768a>=_0x2ca6e1){_0x2d768a=_0x2ca6e1;_0x44c621=0xc8;}else{_0x44c621=0xce;}_0x4483eb['status'](_0x44c621);return _0x4483eb[_0x77a8('0x1c')](_0x77a8('0x1d'),_0x40d8b1+'-'+_0x2d768a+'/'+_0x2ca6e1)['json'](_0x2c794a);}return null;};}function patchUpdates(_0x32ebf2){return function(_0xceca97){try{jsonpatch[_0x77a8('0x1e')](_0xceca97,_0x32ebf2,!![]);}catch(_0xbf6bca){return BPromise[_0x77a8('0x1f')](_0xbf6bca);}return _0xceca97['save']();};}function saveUpdates(_0x4cc0a3,_0x37f268){return function(_0x239919){if(_0x239919){return _0x239919['update'](_0x4cc0a3)[_0x77a8('0x20')](function(_0x3d0b07){return _0x3d0b07;});}return null;};}function removeEntity(_0x4f8d66,_0x510bf0){return function(_0x1b42f6){if(_0x1b42f6){return _0x1b42f6[_0x77a8('0x21')]()[_0x77a8('0x20')](function(){var _0x68768a=_0x1b42f6[_0x77a8('0x22')]({'plain':!![]});var _0x485e8a=_0x77a8('0x23');return db[_0x77a8('0x24')][_0x77a8('0x21')]({'where':{'type':_0x485e8a,'resourceId':_0x68768a['id']}})['then'](function(){return _0x1b42f6;});})[_0x77a8('0x20')](function(){_0x4f8d66[_0x77a8('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x557296,_0x5a90c3){return function(_0x5730f5){if(!_0x5730f5){_0x557296[_0x77a8('0x25')](0x194);}return _0x5730f5;};}function handleError(_0x346312,_0x31a671){_0x31a671=_0x31a671||0x1f4;return function(_0x4899bf){logger[_0x77a8('0x26')](_0x4899bf[_0x77a8('0x27')]);if(_0x4899bf[_0x77a8('0x28')]){delete _0x4899bf[_0x77a8('0x28')];}_0x346312[_0x77a8('0x18')](_0x31a671)['send'](_0x4899bf);};}exports[_0x77a8('0x29')]=function(_0x39203b,_0x1c1da9){var _0x592970={},_0x3f4fe0={},_0x8d4f1e={'count':0x0,'rows':[]};var _0x519ac4=_[_0x77a8('0x2a')](db['Sound'][_0x77a8('0x2b')],function(_0x13f51){return{'name':_0x13f51[_0x77a8('0x2c')],'type':_0x13f51[_0x77a8('0x2d')][_0x77a8('0x2e')]};});_0x3f4fe0[_0x77a8('0x2f')]=_[_0x77a8('0x2a')](_0x519ac4,'name');_0x3f4fe0['query']=_['keys'](_0x39203b[_0x77a8('0x30')]);_0x3f4fe0[_0x77a8('0x31')]=_[_0x77a8('0x32')](_0x3f4fe0['model'],_0x3f4fe0[_0x77a8('0x30')]);_0x592970['attributes']=_[_0x77a8('0x32')](_0x3f4fe0[_0x77a8('0x2f')],qs[_0x77a8('0x33')](_0x39203b[_0x77a8('0x30')][_0x77a8('0x33')]));_0x592970[_0x77a8('0x34')]=_0x592970['attributes']['length']?_0x592970['attributes']:_0x3f4fe0[_0x77a8('0x2f')];if(!_0x39203b['query'][_0x77a8('0x35')]('nolimit')){_0x592970[_0x77a8('0x1b')]=qs[_0x77a8('0x1b')](_0x39203b['query']['limit']);_0x592970[_0x77a8('0x1a')]=qs[_0x77a8('0x1a')](_0x39203b['query'][_0x77a8('0x1a')]);}_0x592970[_0x77a8('0x36')]=qs[_0x77a8('0x37')](_0x39203b['query'][_0x77a8('0x37')]);_0x592970['where']=qs[_0x77a8('0x31')](_[_0x77a8('0x38')](_0x39203b[_0x77a8('0x30')],_0x3f4fe0[_0x77a8('0x31')]),_0x519ac4);if(_0x39203b[_0x77a8('0x30')][_0x77a8('0x39')]){_0x592970['where']=_[_0x77a8('0x3a')](_0x592970['where'],{'$or':_[_0x77a8('0x2a')](_0x519ac4,function(_0x4b84b9){if(_0x4b84b9[_0x77a8('0x2d')]!==_0x77a8('0x3b')){var _0x51ca2e={};_0x51ca2e[_0x4b84b9[_0x77a8('0x28')]]={'$like':'%'+_0x39203b[_0x77a8('0x30')][_0x77a8('0x39')]+'%'};return _0x51ca2e;}})});}_0x592970=_[_0x77a8('0x3a')]({},_0x592970,_0x39203b[_0x77a8('0x3c')]);var _0x2545ae={'where':_0x592970[_0x77a8('0x3d')]};return db['Sound'][_0x77a8('0x3e')](_0x2545ae)[_0x77a8('0x20')](function(_0x21e843){_0x8d4f1e[_0x77a8('0x3e')]=_0x21e843;if(_0x39203b[_0x77a8('0x30')][_0x77a8('0x3f')]){_0x592970['include']=[{'all':!![]}];}return db[_0x77a8('0x40')][_0x77a8('0x41')](_0x592970);})[_0x77a8('0x20')](function(_0x384b5a){_0x8d4f1e[_0x77a8('0x42')]=_0x384b5a;return _0x8d4f1e;})[_0x77a8('0x20')](respondWithFilteredResult(_0x1c1da9,_0x592970))[_0x77a8('0x43')](handleError(_0x1c1da9,null));};exports['show']=function(_0x4fb519,_0x5cd037){var _0x334b9a={'raw':!![],'where':{'id':_0x4fb519[_0x77a8('0x44')]['id']}},_0x2aab7a={};_0x2aab7a[_0x77a8('0x2f')]=_['keys'](db[_0x77a8('0x40')]['rawAttributes']);_0x2aab7a[_0x77a8('0x30')]=_[_0x77a8('0x45')](_0x4fb519['query']);_0x2aab7a[_0x77a8('0x31')]=_[_0x77a8('0x32')](_0x2aab7a[_0x77a8('0x2f')],_0x2aab7a[_0x77a8('0x30')]);_0x334b9a[_0x77a8('0x34')]=_[_0x77a8('0x32')](_0x2aab7a['model'],qs[_0x77a8('0x33')](_0x4fb519[_0x77a8('0x30')][_0x77a8('0x33')]));_0x334b9a[_0x77a8('0x34')]=_0x334b9a['attributes'][_0x77a8('0x46')]?_0x334b9a[_0x77a8('0x34')]:_0x2aab7a[_0x77a8('0x2f')];if(_0x4fb519[_0x77a8('0x30')][_0x77a8('0x3f')]){_0x334b9a['include']=[{'all':!![]}];}_0x334b9a=_['merge']({},_0x334b9a,_0x4fb519[_0x77a8('0x3c')]);return db[_0x77a8('0x40')][_0x77a8('0x47')](_0x334b9a)[_0x77a8('0x20')](handleEntityNotFound(_0x5cd037,null))[_0x77a8('0x20')](respondWithResult(_0x5cd037,null))['catch'](handleError(_0x5cd037,null));};exports['download']=function(_0x21d4c1,_0x1e496f,_0x4f5b5f){return db[_0x77a8('0x40')][_0x77a8('0x47')]({'where':{'id':_0x21d4c1[_0x77a8('0x44')]['id']},'attributes':[_0x77a8('0x28'),_0x77a8('0x48'),_0x77a8('0x49')],'raw':!![]})[_0x77a8('0x20')](handleEntityNotFound(_0x1e496f,null))[_0x77a8('0x20')](function(_0x2b70b1){if(_0x2b70b1){if(!fs[_0x77a8('0x4a')](path[_0x77a8('0x4b')](config[_0x77a8('0x4c')],_0x77a8('0x4d'),_0x2b70b1[_0x77a8('0x48')]+'.'+_0x2b70b1[_0x77a8('0x49')]))){throw new db[(_0x77a8('0x4e'))][(_0x77a8('0x4f'))](_0x77a8('0x50'));}return _0x1e496f['download'](path[_0x77a8('0x4b')](config[_0x77a8('0x4c')],_0x77a8('0x4d'),util[_0x77a8('0x51')](_0x77a8('0x52'),_0x2b70b1[_0x77a8('0x48')],_0x2b70b1[_0x77a8('0x49')])),util[_0x77a8('0x51')](_0x77a8('0x52'),_0x2b70b1[_0x77a8('0x28')],_0x2b70b1['converted_format']));}return null;})[_0x77a8('0x43')](handleError(_0x1e496f,null));};exports[_0x77a8('0x53')]=function(_0x33394e,_0x3ca66f,_0x30d517){var _0x4bb7be={'name':path[_0x77a8('0x54')](_0x33394e[_0x77a8('0x55')][_0x77a8('0x56')],path[_0x77a8('0x57')](_0x33394e['file'][_0x77a8('0x56')])),'save_name':path['basename'](_0x33394e[_0x77a8('0x55')][_0x77a8('0x58')],path[_0x77a8('0x57')](_0x33394e[_0x77a8('0x55')][_0x77a8('0x58')])),'original_format':path[_0x77a8('0x57')](_0x33394e[_0x77a8('0x55')][_0x77a8('0x56')])['substring'](0x1),'converted_format':_0x77a8('0x59')};var _0x4c7e03=path['join'](config[_0x77a8('0x4c')],_0x77a8('0x5a'),_0x33394e['file'][_0x77a8('0x58')]);var _0x2e777a=path[_0x77a8('0x4b')](config[_0x77a8('0x4c')],_0x77a8('0x4d'),util['format'](_0x77a8('0x52'),path['basename'](_0x33394e[_0x77a8('0x55')]['filename'],path[_0x77a8('0x57')](_0x33394e[_0x77a8('0x55')][_0x77a8('0x58')])),_0x4bb7be[_0x77a8('0x49')]));logger[_0x77a8('0x5b')](_0x77a8('0x5c'),_0x4c7e03);logger[_0x77a8('0x5b')]('Sound\x20upload\x20destination:\x20%s',_0x2e777a);try{fs['chmodSync'](_0x4c7e03,parseInt(_0x77a8('0x5d'),0x8));var _0xfaffb1=sox[_0x77a8('0x5e')](_0x4c7e03,_0x2e777a,{'sampleRate':0x1f40,'format':_0x77a8('0x59'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0xfaffb1['on'](_0x77a8('0x26'),function(_0x1d97fc){fs[_0x77a8('0x5f')](_0x4c7e03);_0x3ca66f[_0x77a8('0x18')](0x1f4)[_0x77a8('0x60')](_0x1d97fc);});_0xfaffb1['on']('src',function(_0x21c21d){_0x4bb7be['original_duration']=isNaN(_0x21c21d[_0x77a8('0x61')])?null:_0x21c21d[_0x77a8('0x61')]*0x3e8;_0x4bb7be[_0x77a8('0x62')]=isNaN(_0x21c21d[_0x77a8('0x63')])?null:_0x21c21d[_0x77a8('0x63')];_0x4bb7be[_0x77a8('0x64')]=isNaN(_0x21c21d['channelCount'])?null:_0x21c21d[_0x77a8('0x65')];_0x4bb7be['original_bitRate']=isNaN(_0x21c21d[_0x77a8('0x66')])?null:_0x21c21d[_0x77a8('0x66')];_0x4bb7be[_0x77a8('0x67')]=isNaN(_0x21c21d['sampleRate'])?null:_0x21c21d[_0x77a8('0x68')];});_0xfaffb1['on'](_0x77a8('0x69'),function(_0x3cf0ce){_0x4bb7be[_0x77a8('0x6a')]=isNaN(_0x3cf0ce[_0x77a8('0x61')])?null:_0x3cf0ce[_0x77a8('0x61')]*0x3e8;_0x4bb7be[_0x77a8('0x6b')]=isNaN(_0x3cf0ce['sampleCount'])?null:_0x3cf0ce[_0x77a8('0x63')];_0x4bb7be['converted_channelCount']=isNaN(_0x3cf0ce['channelCount'])?null:_0x3cf0ce[_0x77a8('0x65')];_0x4bb7be[_0x77a8('0x6c')]=isNaN(_0x3cf0ce['bitRate'])?null:_0x3cf0ce[_0x77a8('0x66')];_0x4bb7be[_0x77a8('0x6d')]=isNaN(_0x3cf0ce[_0x77a8('0x68')])?null:_0x3cf0ce[_0x77a8('0x68')];});_0xfaffb1['on'](_0x77a8('0x6e'),function(){fs[_0x77a8('0x6f')](_0x2e777a,parseInt(_0x77a8('0x5d'),0x8));return db[_0x77a8('0x40')][_0x77a8('0x53')](_0x4bb7be)[_0x77a8('0x20')](function(_0x3e9f15){var _0x1078f8={'role':_0x33394e[_0x77a8('0x70')][_0x77a8('0x71')],'userProfileId':_0x33394e['body'][_0x77a8('0x72')]};if(!_0x1078f8)throw new Error(_0x77a8('0x73'));if(_0x1078f8['role']===_0x77a8('0x74')){var _0x49625d=_0x3e9f15[_0x77a8('0x22')]({'plain':!![]});return db['UserProfileSection'][_0x77a8('0x47')]({'where':{'name':_0x77a8('0x23'),'userProfileId':_0x1078f8[_0x77a8('0x72')]},'raw':!![]})[_0x77a8('0x20')](function(_0x5d1048){if(_0x5d1048&&_0x5d1048['autoAssociation']===0x0){return db[_0x77a8('0x24')][_0x77a8('0x53')]({'name':_0x49625d[_0x77a8('0x28')],'resourceId':_0x49625d['id'],'type':_0x5d1048['name'],'sectionId':_0x5d1048['id']},{})['then'](function(){return _0x3e9f15;});}else{return _0x3e9f15;}})['catch'](function(_0x2c94ce){logger[_0x77a8('0x26')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2c94ce);throw _0x2c94ce;});}return _0x3e9f15;})[_0x77a8('0x20')](respondWithResult(_0x3ca66f,null))['catch'](handleError(_0x3ca66f,null));});_0xfaffb1['start']();}catch(_0x49dc47){_0x3ca66f[_0x77a8('0x18')](0x1f4)['send'](_0x49dc47);}};exports[_0x77a8('0x75')]=function(_0x59db2d,_0x33b7e7,_0x4d8bc4){return db[_0x77a8('0x40')]['find']({'where':{'id':_0x59db2d['params']['id']}})[_0x77a8('0x20')](handleEntityNotFound(_0x33b7e7,null))[_0x77a8('0x20')](saveUpdates(_[_0x77a8('0x38')](_0x59db2d[_0x77a8('0x70')],[_0x77a8('0x28'),_0x77a8('0x76')]),null))['then'](respondWithResult(_0x33b7e7,null))[_0x77a8('0x43')](handleError(_0x33b7e7,null));};exports[_0x77a8('0x77')]=function(_0x5a87d2,_0x3c9d1e,_0x122f99){return db[_0x77a8('0x40')][_0x77a8('0x47')]({'where':{'id':_0x5a87d2[_0x77a8('0x44')]['id']}})['then'](function(_0x5c3c34){if(_0x5c3c34){return _0x5c3c34['destroy']();}})[_0x77a8('0x20')](function(_0x4f66c8){var _0x5a1ae3=path['join'](config[_0x77a8('0x4c')],'server/files/sounds/original',util[_0x77a8('0x51')](_0x77a8('0x52'),_0x4f66c8[_0x77a8('0x48')],_0x4f66c8[_0x77a8('0x78')]));var _0x10b0b1=path[_0x77a8('0x4b')](config['root'],'server/files/sounds/converted',util['format']('%s.%s',_0x4f66c8[_0x77a8('0x48')],_0x4f66c8['converted_format']));fs[_0x77a8('0x5f')](_0x5a1ae3);fs[_0x77a8('0x5f')](_0x10b0b1);return _0x4f66c8;})[_0x77a8('0x20')](function(_0x76b4a3){if(_0x76b4a3){return _0x3c9d1e['status'](0xcc)[_0x77a8('0x6e')]();}})['then'](handleEntityNotFound(_0x3c9d1e,null))['catch'](handleError(_0x3c9d1e,null));};
\ No newline at end of file
diff --git a/server/api/sound/sound.model.js b/server/api/sound/sound.model.js
index e0add5b..1027bcf 100644
--- a/server/api/sound/sound.model.js
+++ b/server/api/sound/sound.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xb679=['moment','request-promise','path','../../config/environment','./sound.attributes','exports','define','Sound','lodash','util'];(function(_0x4706af,_0x24b450){var _0x2f75c4=function(_0x415a9a){while(--_0x415a9a){_0x4706af['push'](_0x4706af['shift']());}};_0x2f75c4(++_0x24b450);}(_0xb679,0x1e8));var _0x9b67=function(_0x3ff2b4,_0x4554b6){_0x3ff2b4=_0x3ff2b4-0x0;var _0x2d05b8=_0xb679[_0x3ff2b4];return _0x2d05b8;};'use strict';var _=require(_0x9b67('0x0'));var util=require(_0x9b67('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x9b67('0x2'));var BPromise=require('bluebird');var rp=require(_0x9b67('0x3'));var fs=require('fs');var path=require(_0x9b67('0x4'));var rimraf=require('rimraf');var config=require(_0x9b67('0x5'));var attributes=require(_0x9b67('0x6'));module[_0x9b67('0x7')]=function(_0x457f6c,_0x5b0ec2){return _0x457f6c[_0x9b67('0x8')](_0x9b67('0x9'),attributes,{'tableName':'tools_sounds','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x940e=['moment','bluebird','path','rimraf','../../config/environment','./sound.attributes','define','Sound','lodash','util','../../config/logger'];(function(_0xd746ed,_0x81920c){var _0x5ef2a6=function(_0x3ec97a){while(--_0x3ec97a){_0xd746ed['push'](_0xd746ed['shift']());}};_0x5ef2a6(++_0x81920c);}(_0x940e,0x13c));var _0xe940=function(_0x644560,_0x1783aa){_0x644560=_0x644560-0x0;var _0x41b76b=_0x940e[_0x644560];return _0x41b76b;};'use strict';var _=require(_0xe940('0x0'));var util=require(_0xe940('0x1'));var logger=require(_0xe940('0x2'))('api');var moment=require(_0xe940('0x3'));var BPromise=require(_0xe940('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xe940('0x5'));var rimraf=require(_0xe940('0x6'));var config=require(_0xe940('0x7'));var attributes=require(_0xe940('0x8'));module['exports']=function(_0x193661,_0x49b7f2){return _0x193661[_0xe940('0x9')](_0xe940('0xa'),attributes,{'tableName':'tools_sounds','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/sound/sound.rpc.js b/server/api/sound/sound.rpc.js
index c623849..db69a62 100644
--- a/server/api/sound/sound.rpc.js
+++ b/server/api/sound/sound.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x628f=['request','then','info','request\x20sent','debug','stringify','error','code','Sound,\x20%s,\x20%s','message','result','ShowSound','Sound','find','options','raw','where','attributes','include','map','model','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http'];(function(_0x487524,_0x156859){var _0x37a620=function(_0x13dc0b){while(--_0x13dc0b){_0x487524['push'](_0x487524['shift']());}};_0x37a620(++_0x156859);}(_0x628f,0x104));var _0xf628=function(_0x4a2fde,_0x190c2f){_0x4a2fde=_0x4a2fde-0x0;var _0x52ab47=_0x628f[_0x4a2fde];return _0x52ab47;};'use strict';var _=require(_0xf628('0x0'));var util=require('util');var moment=require(_0xf628('0x1'));var BPromise=require(_0xf628('0x2'));var rs=require(_0xf628('0x3'));var fs=require('fs');var Redis=require(_0xf628('0x4'));var db=require(_0xf628('0x5'))['db'];var utils=require(_0xf628('0x6'));var logger=require(_0xf628('0x7'))(_0xf628('0x8'));var config=require('../../config/environment');var jayson=require(_0xf628('0x9'));var client=jayson[_0xf628('0xa')][_0xf628('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x47f23a,_0x2b2771,_0x17cd48){return new BPromise(function(_0x643280,_0x2e74a2){return client[_0xf628('0xc')](_0x47f23a,_0x17cd48)[_0xf628('0xd')](function(_0x36a197){logger[_0xf628('0xe')]('Sound,\x20%s,\x20%s',_0x2b2771,_0xf628('0xf'));logger[_0xf628('0x10')]('Sound,\x20%s,\x20%s,\x20%s',_0x2b2771,_0xf628('0xf'),JSON[_0xf628('0x11')](_0x36a197));if(_0x36a197['error']){if(_0x36a197[_0xf628('0x12')][_0xf628('0x13')]===0x1f4){logger[_0xf628('0x12')](_0xf628('0x14'),_0x2b2771,_0x36a197['error']['message']);return _0x2e74a2(_0x36a197[_0xf628('0x12')][_0xf628('0x15')]);}logger[_0xf628('0x12')]('Sound,\x20%s,\x20%s',_0x2b2771,_0x36a197[_0xf628('0x12')]['message']);return _0x643280(_0x36a197['error'][_0xf628('0x15')]);}else{logger['info'](_0xf628('0x14'),_0x2b2771,_0xf628('0xf'));_0x643280(_0x36a197[_0xf628('0x16')]['message']);}})['catch'](function(_0x4e0f1c){logger[_0xf628('0x12')](_0xf628('0x14'),_0x2b2771,_0x4e0f1c);_0x2e74a2(_0x4e0f1c);});});}exports[_0xf628('0x17')]=function(_0x489ba1){var _0x25195c=this;return new Promise(function(_0x6f544c,_0x3d565e){return db[_0xf628('0x18')][_0xf628('0x19')]({'raw':_0x489ba1['options']?_0x489ba1[_0xf628('0x1a')][_0xf628('0x1b')]===undefined?!![]:![]:!![],'where':_0x489ba1['options']?_0x489ba1[_0xf628('0x1a')][_0xf628('0x1c')]||null:null,'attributes':_0x489ba1[_0xf628('0x1a')]?_0x489ba1[_0xf628('0x1a')][_0xf628('0x1d')]||null:null,'include':_0x489ba1['options']?_0x489ba1[_0xf628('0x1a')][_0xf628('0x1e')]?_[_0xf628('0x1f')](_0x489ba1['options'][_0xf628('0x1e')],function(_0x18bc3c){return{'model':db[_0x18bc3c[_0xf628('0x20')]],'as':_0x18bc3c['as'],'attributes':_0x18bc3c['attributes'],'include':_0x18bc3c[_0xf628('0x1e')]?_[_0xf628('0x1f')](_0x18bc3c[_0xf628('0x1e')],function(_0x398532){return{'model':db[_0x398532['model']],'as':_0x398532['as'],'attributes':_0x398532[_0xf628('0x1d')],'include':_0x398532['include']?_[_0xf628('0x1f')](_0x398532['include'],function(_0x4b02d7){return{'model':db[_0x4b02d7[_0xf628('0x20')]],'as':_0x4b02d7['as'],'attributes':_0x4b02d7[_0xf628('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xf628('0xd')](function(_0x5dfdde){logger[_0xf628('0xe')]('ShowSound',_0x489ba1);logger[_0xf628('0x10')](_0xf628('0x17'),_0x489ba1,JSON[_0xf628('0x11')](_0x5dfdde));_0x6f544c(_0x5dfdde);})[_0xf628('0x21')](function(_0x12807d){logger[_0xf628('0x12')](_0xf628('0x17'),_0x12807d['message'],_0x489ba1);_0x3d565e(_0x25195c[_0xf628('0x12')](0x1f4,_0x12807d['message']));});});};
\ No newline at end of file
+var _0x3fa0=['http','then','info','debug','request\x20sent','stringify','error','code','Sound,\x20%s,\x20%s','message','catch','Sound','find','options','where','attributes','include','map','model','ShowSound','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x254f9f,_0x5e15f1){var _0x3ecae5=function(_0x1450e5){while(--_0x1450e5){_0x254f9f['push'](_0x254f9f['shift']());}};_0x3ecae5(++_0x5e15f1);}(_0x3fa0,0x1e4));var _0x03fa=function(_0x2b3c1e,_0x5b0e75){_0x2b3c1e=_0x2b3c1e-0x0;var _0x3d333b=_0x3fa0[_0x2b3c1e];return _0x3d333b;};'use strict';var _=require('lodash');var util=require(_0x03fa('0x0'));var moment=require(_0x03fa('0x1'));var BPromise=require(_0x03fa('0x2'));var rs=require(_0x03fa('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x03fa('0x4'))['db'];var utils=require(_0x03fa('0x5'));var logger=require(_0x03fa('0x6'))(_0x03fa('0x7'));var config=require(_0x03fa('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x03fa('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x7288d0,_0x51c25b,_0x1077be){return new BPromise(function(_0x1df5c4,_0x5021c2){return client['request'](_0x7288d0,_0x1077be)[_0x03fa('0xa')](function(_0x354775){logger[_0x03fa('0xb')]('Sound,\x20%s,\x20%s',_0x51c25b,'request\x20sent');logger[_0x03fa('0xc')]('Sound,\x20%s,\x20%s,\x20%s',_0x51c25b,_0x03fa('0xd'),JSON[_0x03fa('0xe')](_0x354775));if(_0x354775[_0x03fa('0xf')]){if(_0x354775[_0x03fa('0xf')][_0x03fa('0x10')]===0x1f4){logger[_0x03fa('0xf')](_0x03fa('0x11'),_0x51c25b,_0x354775[_0x03fa('0xf')][_0x03fa('0x12')]);return _0x5021c2(_0x354775[_0x03fa('0xf')][_0x03fa('0x12')]);}logger['error'](_0x03fa('0x11'),_0x51c25b,_0x354775[_0x03fa('0xf')]['message']);return _0x1df5c4(_0x354775[_0x03fa('0xf')][_0x03fa('0x12')]);}else{logger['info']('Sound,\x20%s,\x20%s',_0x51c25b,_0x03fa('0xd'));_0x1df5c4(_0x354775['result'][_0x03fa('0x12')]);}})[_0x03fa('0x13')](function(_0x58b20b){logger[_0x03fa('0xf')]('Sound,\x20%s,\x20%s',_0x51c25b,_0x58b20b);_0x5021c2(_0x58b20b);});});}exports['ShowSound']=function(_0x1b6d99){var _0x322e7e=this;return new Promise(function(_0x47e83c,_0x2db578){return db[_0x03fa('0x14')][_0x03fa('0x15')]({'raw':_0x1b6d99[_0x03fa('0x16')]?_0x1b6d99[_0x03fa('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x1b6d99[_0x03fa('0x16')]?_0x1b6d99[_0x03fa('0x16')][_0x03fa('0x17')]||null:null,'attributes':_0x1b6d99[_0x03fa('0x16')]?_0x1b6d99[_0x03fa('0x16')][_0x03fa('0x18')]||null:null,'include':_0x1b6d99[_0x03fa('0x16')]?_0x1b6d99[_0x03fa('0x16')][_0x03fa('0x19')]?_[_0x03fa('0x1a')](_0x1b6d99[_0x03fa('0x16')][_0x03fa('0x19')],function(_0x1987b3){return{'model':db[_0x1987b3['model']],'as':_0x1987b3['as'],'attributes':_0x1987b3[_0x03fa('0x18')],'include':_0x1987b3[_0x03fa('0x19')]?_[_0x03fa('0x1a')](_0x1987b3[_0x03fa('0x19')],function(_0x32e362){return{'model':db[_0x32e362['model']],'as':_0x32e362['as'],'attributes':_0x32e362[_0x03fa('0x18')],'include':_0x32e362[_0x03fa('0x19')]?_[_0x03fa('0x1a')](_0x32e362['include'],function(_0xd511e1){return{'model':db[_0xd511e1[_0x03fa('0x1b')]],'as':_0xd511e1['as'],'attributes':_0xd511e1[_0x03fa('0x18')]};}):[]};}):[]};}):[]:[]})[_0x03fa('0xa')](function(_0x5bf18c){logger['info'](_0x03fa('0x1c'),_0x1b6d99);logger[_0x03fa('0xc')](_0x03fa('0x1c'),_0x1b6d99,JSON[_0x03fa('0xe')](_0x5bf18c));_0x47e83c(_0x5bf18c);})[_0x03fa('0x13')](function(_0x930a6e){logger[_0x03fa('0xf')](_0x03fa('0x1c'),_0x930a6e[_0x03fa('0x12')],_0x1b6d99);_0x2db578(_0x322e7e[_0x03fa('0xf')](0x1f4,_0x930a6e[_0x03fa('0x12')]));});});};
\ No newline at end of file
diff --git a/server/api/squareMessage/index.js b/server/api/squareMessage/index.js
index b02e4c9..d8fa714 100644
--- a/server/api/squareMessage/index.js
+++ b/server/api/squareMessage/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x1f8c=['show','create','put','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id'];(function(_0x36fbef,_0x4ffc84){var _0x45e270=function(_0x32dd95){while(--_0x32dd95){_0x36fbef['push'](_0x36fbef['shift']());}};_0x45e270(++_0x4ffc84);}(_0x1f8c,0xc2));var _0xc1f8=function(_0x7b5cdd,_0x8c88d8){_0x7b5cdd=_0x7b5cdd-0x0;var _0x3a29ae=_0x1f8c[_0x7b5cdd];return _0x3a29ae;};'use strict';var multer=require(_0xc1f8('0x0'));var util=require('util');var path=require(_0xc1f8('0x1'));var timeout=require(_0xc1f8('0x2'));var express=require(_0xc1f8('0x3'));var router=express[_0xc1f8('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0xc1f8('0x5'));var config=require(_0xc1f8('0x6'));var controller=require('./squareMessage.controller');router[_0xc1f8('0x7')]('/',auth[_0xc1f8('0x8')](),controller['index']);router[_0xc1f8('0x7')](_0xc1f8('0x9'),auth[_0xc1f8('0x8')](),controller[_0xc1f8('0xa')]);router['post']('/',auth[_0xc1f8('0x8')](),controller[_0xc1f8('0xb')]);router[_0xc1f8('0xc')]('/:id',auth['isAuthenticated'](),controller[_0xc1f8('0xd')]);router[_0xc1f8('0xe')]('/:id',auth[_0xc1f8('0x8')](),controller[_0xc1f8('0xf')]);module[_0xc1f8('0x10')]=router;
\ No newline at end of file
+var _0x97ae=['get','post','put','/:id','update','delete','destroy','multer','util','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x97ae,0x107));var _0xe97a=function(_0x34234f,_0x44eb50){_0x34234f=_0x34234f-0x0;var _0x53d217=_0x97ae[_0x34234f];return _0x53d217;};'use strict';var multer=require(_0xe97a('0x0'));var util=require(_0xe97a('0x1'));var path=require('path');var timeout=require(_0xe97a('0x2'));var express=require(_0xe97a('0x3'));var router=express['Router']();var auth=require(_0xe97a('0x4'));var interaction=require(_0xe97a('0x5'));var config=require(_0xe97a('0x6'));var controller=require('./squareMessage.controller');router['get']('/',auth[_0xe97a('0x7')](),controller[_0xe97a('0x8')]);router[_0xe97a('0x9')]('/:id',auth[_0xe97a('0x7')](),controller['show']);router[_0xe97a('0xa')]('/',auth['isAuthenticated'](),controller['create']);router[_0xe97a('0xb')](_0xe97a('0xc'),auth[_0xe97a('0x7')](),controller[_0xe97a('0xd')]);router[_0xe97a('0xe')](_0xe97a('0xc'),auth[_0xe97a('0x7')](),controller[_0xe97a('0xf')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/squareMessage/squareMessage.attributes.js b/server/api/squareMessage/squareMessage.attributes.js
index 0a7f485..72c9856 100644
--- a/server/api/squareMessage/squareMessage.attributes.js
+++ b/server/api/squareMessage/squareMessage.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xbb6b=['out','sequelize','exports','TEXT','medium','ENUM'];(function(_0x57b2dd,_0x2e900b){var _0x44253c=function(_0x238d60){while(--_0x238d60){_0x57b2dd['push'](_0x57b2dd['shift']());}};_0x44253c(++_0x2e900b);}(_0xbb6b,0x1ed));var _0xbbb6=function(_0xbb799c,_0x36f3fe){_0xbb799c=_0xbb799c-0x0;var _0x2fd8f3=_0xbb6b[_0xbb799c];return _0x2fd8f3;};'use strict';var Sequelize=require(_0xbbb6('0x0'));module[_0xbbb6('0x1')]={'uniqueid':{'type':Sequelize['STRING']},'body':{'type':Sequelize[_0xbbb6('0x2')](_0xbbb6('0x3')),'allowNull':![]},'direction':{'type':Sequelize[_0xbbb6('0x4')]('in','out'),'defaultValue':_0xbbb6('0x5'),'allowNull':![]}};
\ No newline at end of file
+var _0xb712=['medium','ENUM','out','sequelize','exports','STRING','TEXT'];(function(_0x5630f3,_0x40cbdb){var _0x3e6446=function(_0x43748a){while(--_0x43748a){_0x5630f3['push'](_0x5630f3['shift']());}};_0x3e6446(++_0x40cbdb);}(_0xb712,0x176));var _0x2b71=function(_0x54584c,_0x174275){_0x54584c=_0x54584c-0x0;var _0x3360a6=_0xb712[_0x54584c];return _0x3360a6;};'use strict';var Sequelize=require(_0x2b71('0x0'));module[_0x2b71('0x1')]={'uniqueid':{'type':Sequelize[_0x2b71('0x2')]},'body':{'type':Sequelize[_0x2b71('0x3')](_0x2b71('0x4')),'allowNull':![]},'direction':{'type':Sequelize[_0x2b71('0x5')]('in',_0x2b71('0x6')),'defaultValue':'out','allowNull':![]}};
\ No newline at end of file
diff --git a/server/api/squareMessage/squareMessage.controller.js b/server/api/squareMessage/squareMessage.controller.js
index 8784a56..5942a41 100644
--- a/server/api/squareMessage/squareMessage.controller.js
+++ b/server/api/squareMessage/squareMessage.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x826c=['save','then','destroy','end','error','name','send','index','SquareMessage','rawAttributes','fieldName','type','model','keys','query','filters','intersection','attributes','fields','nolimit','sort','pick','filter','where','merge','map','options','count','includeAll','include','findAll','rows','show','params','length','find','create','body','catch','update','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','set','apply','reject'];(function(_0xdc37a1,_0x53ebb9){var _0x99b4fe=function(_0x2811e3){while(--_0x2811e3){_0xdc37a1['push'](_0xdc37a1['shift']());}};_0x99b4fe(++_0x53ebb9);}(_0x826c,0x6f));var _0xc826=function(_0x1d6d2a,_0x24362e){_0x1d6d2a=_0x1d6d2a-0x0;var _0x399eb7=_0x826c[_0x1d6d2a];return _0x399eb7;};'use strict';var pdf=require(_0xc826('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xc826('0x1'));var zipdir=require(_0xc826('0x2'));var jsonpatch=require(_0xc826('0x3'));var rp=require(_0xc826('0x4'));var moment=require(_0xc826('0x5'));var BPromise=require(_0xc826('0x6'));var Mustache=require(_0xc826('0x7'));var util=require(_0xc826('0x8'));var path=require(_0xc826('0x9'));var sox=require(_0xc826('0xa'));var csv=require(_0xc826('0xb'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xc826('0xc'));var squel=require(_0xc826('0xd'));var crypto=require('crypto');var jsforce=require(_0xc826('0xe'));var deskjs=require(_0xc826('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xc826('0x10'));var Redis=require('ioredis');var authService=require(_0xc826('0x11'));var qs=require(_0xc826('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xc826('0x13'))(_0xc826('0x14'));var utils=require(_0xc826('0x15'));var config=require(_0xc826('0x16'));var db=require(_0xc826('0x17'))['db'];function respondWithStatusCode(_0x4497e6,_0x4ee288){_0x4ee288=_0x4ee288||0xcc;return function(_0x16f8dc){if(_0x16f8dc){return _0x4497e6[_0xc826('0x18')](_0x4ee288);}return _0x4497e6[_0xc826('0x19')](_0x4ee288)['end']();};}function respondWithResult(_0x179243,_0x2a3199){_0x2a3199=_0x2a3199||0xc8;return function(_0x3d3432){if(_0x3d3432){return _0x179243['status'](_0x2a3199)[_0xc826('0x1a')](_0x3d3432);}};}function respondWithFilteredResult(_0x55be58,_0x839d19){return function(_0x31b591){if(_0x31b591){var _0x46f1e1=_0x31b591['count'],_0x5084ff=_0x839d19[_0xc826('0x1b')],_0x17a3dc=_0x839d19['offset']+_0x839d19['limit'],_0x217d45;if(_0x17a3dc>=_0x46f1e1){_0x17a3dc=_0x46f1e1;_0x217d45=0xc8;}else{_0x217d45=0xce;}_0x55be58[_0xc826('0x19')](_0x217d45);return _0x55be58[_0xc826('0x1c')]('Content-Range',_0x5084ff+'-'+_0x17a3dc+'/'+_0x46f1e1)[_0xc826('0x1a')](_0x31b591);}return null;};}function patchUpdates(_0x5ebbea){return function(_0x5d6e47){try{jsonpatch[_0xc826('0x1d')](_0x5d6e47,_0x5ebbea,!![]);}catch(_0x379997){return BPromise[_0xc826('0x1e')](_0x379997);}return _0x5d6e47[_0xc826('0x1f')]();};}function saveUpdates(_0xec9126,_0x2bb410){return function(_0x838893){if(_0x838893){return _0x838893['update'](_0xec9126)[_0xc826('0x20')](function(_0x2cc865){return _0x2cc865;});}return null;};}function removeEntity(_0x2e32f0,_0xde40cd){return function(_0x345129){if(_0x345129){return _0x345129[_0xc826('0x21')]()['then'](function(){_0x2e32f0['status'](0xcc)[_0xc826('0x22')]();});}};}function handleEntityNotFound(_0x4e0998,_0x4d51c5){return function(_0x115663){if(!_0x115663){_0x4e0998['sendStatus'](0x194);}return _0x115663;};}function handleError(_0x13dca4,_0x1c80f4){_0x1c80f4=_0x1c80f4||0x1f4;return function(_0x1eed05){logger[_0xc826('0x23')](_0x1eed05['stack']);if(_0x1eed05['name']){delete _0x1eed05[_0xc826('0x24')];}_0x13dca4['status'](_0x1c80f4)[_0xc826('0x25')](_0x1eed05);};}exports[_0xc826('0x26')]=function(_0x379fa4,_0x5d11a3){var _0x1c5e02={},_0x5d969c={},_0x2879d1={'count':0x0,'rows':[]};var _0x5eede0=_['map'](db[_0xc826('0x27')][_0xc826('0x28')],function(_0x54f766){return{'name':_0x54f766[_0xc826('0x29')],'type':_0x54f766[_0xc826('0x2a')]['key']};});_0x5d969c[_0xc826('0x2b')]=_['map'](_0x5eede0,_0xc826('0x24'));_0x5d969c['query']=_[_0xc826('0x2c')](_0x379fa4[_0xc826('0x2d')]);_0x5d969c[_0xc826('0x2e')]=_[_0xc826('0x2f')](_0x5d969c[_0xc826('0x2b')],_0x5d969c[_0xc826('0x2d')]);_0x1c5e02[_0xc826('0x30')]=_[_0xc826('0x2f')](_0x5d969c[_0xc826('0x2b')],qs[_0xc826('0x31')](_0x379fa4[_0xc826('0x2d')][_0xc826('0x31')]));_0x1c5e02[_0xc826('0x30')]=_0x1c5e02['attributes']['length']?_0x1c5e02[_0xc826('0x30')]:_0x5d969c[_0xc826('0x2b')];if(!_0x379fa4['query']['hasOwnProperty'](_0xc826('0x32'))){_0x1c5e02['limit']=qs['limit'](_0x379fa4[_0xc826('0x2d')]['limit']);_0x1c5e02['offset']=qs['offset'](_0x379fa4[_0xc826('0x2d')][_0xc826('0x1b')]);}_0x1c5e02['order']=qs['sort'](_0x379fa4[_0xc826('0x2d')][_0xc826('0x33')]);_0x1c5e02['where']=qs[_0xc826('0x2e')](_[_0xc826('0x34')](_0x379fa4[_0xc826('0x2d')],_0x5d969c[_0xc826('0x2e')]),_0x5eede0);if(_0x379fa4[_0xc826('0x2d')][_0xc826('0x35')]){_0x1c5e02[_0xc826('0x36')]=_[_0xc826('0x37')](_0x1c5e02[_0xc826('0x36')],{'$or':_[_0xc826('0x38')](_0x5eede0,function(_0x516b62){if(_0x516b62[_0xc826('0x2a')]!=='VIRTUAL'){var _0x3f0429={};_0x3f0429[_0x516b62['name']]={'$like':'%'+_0x379fa4[_0xc826('0x2d')][_0xc826('0x35')]+'%'};return _0x3f0429;}})});}_0x1c5e02=_[_0xc826('0x37')]({},_0x1c5e02,_0x379fa4[_0xc826('0x39')]);var _0x53ca7c={'where':_0x1c5e02[_0xc826('0x36')]};return db[_0xc826('0x27')][_0xc826('0x3a')](_0x53ca7c)[_0xc826('0x20')](function(_0x3cffb3){_0x2879d1[_0xc826('0x3a')]=_0x3cffb3;if(_0x379fa4[_0xc826('0x2d')][_0xc826('0x3b')]){_0x1c5e02[_0xc826('0x3c')]=[{'all':!![]}];}return db[_0xc826('0x27')][_0xc826('0x3d')](_0x1c5e02);})[_0xc826('0x20')](function(_0x462889){_0x2879d1[_0xc826('0x3e')]=_0x462889;return _0x2879d1;})[_0xc826('0x20')](respondWithFilteredResult(_0x5d11a3,_0x1c5e02))['catch'](handleError(_0x5d11a3,null));};exports[_0xc826('0x3f')]=function(_0x385ac9,_0x52b129){var _0x5b32a3={'raw':!![],'where':{'id':_0x385ac9[_0xc826('0x40')]['id']}},_0x55ffdf={};_0x55ffdf['model']=_[_0xc826('0x2c')](db[_0xc826('0x27')][_0xc826('0x28')]);_0x55ffdf[_0xc826('0x2d')]=_[_0xc826('0x2c')](_0x385ac9[_0xc826('0x2d')]);_0x55ffdf[_0xc826('0x2e')]=_[_0xc826('0x2f')](_0x55ffdf[_0xc826('0x2b')],_0x55ffdf[_0xc826('0x2d')]);_0x5b32a3[_0xc826('0x30')]=_[_0xc826('0x2f')](_0x55ffdf['model'],qs[_0xc826('0x31')](_0x385ac9[_0xc826('0x2d')]['fields']));_0x5b32a3[_0xc826('0x30')]=_0x5b32a3[_0xc826('0x30')][_0xc826('0x41')]?_0x5b32a3[_0xc826('0x30')]:_0x55ffdf[_0xc826('0x2b')];if(_0x385ac9[_0xc826('0x2d')][_0xc826('0x3b')]){_0x5b32a3[_0xc826('0x3c')]=[{'all':!![]}];}_0x5b32a3=_[_0xc826('0x37')]({},_0x5b32a3,_0x385ac9[_0xc826('0x39')]);return db[_0xc826('0x27')][_0xc826('0x42')](_0x5b32a3)[_0xc826('0x20')](handleEntityNotFound(_0x52b129,null))[_0xc826('0x20')](respondWithResult(_0x52b129,null))['catch'](handleError(_0x52b129,null));};exports[_0xc826('0x43')]=function(_0x23b39f,_0x598f9f){return db[_0xc826('0x27')]['create'](_0x23b39f[_0xc826('0x44')],{})[_0xc826('0x20')](respondWithResult(_0x598f9f,0xc9))[_0xc826('0x45')](handleError(_0x598f9f,null));};exports[_0xc826('0x46')]=function(_0x527ff5,_0x422faf){if(_0x527ff5[_0xc826('0x44')]['id']){delete _0x527ff5[_0xc826('0x44')]['id'];}return db[_0xc826('0x27')][_0xc826('0x42')]({'where':{'id':_0x527ff5[_0xc826('0x40')]['id']}})['then'](handleEntityNotFound(_0x422faf,null))[_0xc826('0x20')](saveUpdates(_0x527ff5['body'],null))[_0xc826('0x20')](respondWithResult(_0x422faf,null))[_0xc826('0x45')](handleError(_0x422faf,null));};exports[_0xc826('0x21')]=function(_0x4044b3,_0x5392a7){return db[_0xc826('0x27')][_0xc826('0x42')]({'where':{'id':_0x4044b3[_0xc826('0x40')]['id']}})[_0xc826('0x20')](handleEntityNotFound(_0x5392a7,null))['then'](removeEntity(_0x5392a7,null))[_0xc826('0x45')](handleError(_0x5392a7,null));};
\ No newline at end of file
+var _0x48a4=['where','VIRTUAL','filter','includeAll','findAll','rows','catch','show','params','include','merge','find','create','body','update','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','../../config/utils','sendStatus','status','end','json','count','offset','set','apply','reject','save','destroy','then','error','stack','name','send','SquareMessage','rawAttributes','type','key','model','map','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','limit','sort','pick'];(function(_0x2e6596,_0x3ea2b4){var _0x2e1a23=function(_0x2f7ef1){while(--_0x2f7ef1){_0x2e6596['push'](_0x2e6596['shift']());}};_0x2e1a23(++_0x3ea2b4);}(_0x48a4,0x12f));var _0x448a=function(_0x5f5bfd,_0x121e9b){_0x5f5bfd=_0x5f5bfd-0x0;var _0x27c9ce=_0x48a4[_0x5f5bfd];return _0x27c9ce;};'use strict';var pdf=require(_0x448a('0x0'));var emlformat=require(_0x448a('0x1'));var rimraf=require(_0x448a('0x2'));var zipdir=require(_0x448a('0x3'));var jsonpatch=require(_0x448a('0x4'));var rp=require(_0x448a('0x5'));var moment=require(_0x448a('0x6'));var BPromise=require(_0x448a('0x7'));var Mustache=require(_0x448a('0x8'));var util=require(_0x448a('0x9'));var path=require(_0x448a('0xa'));var sox=require('sox');var csv=require(_0x448a('0xb'));var ejs=require(_0x448a('0xc'));var fs=require('fs');var _=require(_0x448a('0xd'));var squel=require('squel');var crypto=require(_0x448a('0xe'));var jsforce=require(_0x448a('0xf'));var deskjs=require(_0x448a('0x10'));var toCsv=require(_0x448a('0xb'));var querystring=require(_0x448a('0x11'));var Papa=require(_0x448a('0x12'));var Redis=require(_0x448a('0x13'));var authService=require('../../components/auth/service');var qs=require(_0x448a('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x448a('0x15'))('api');var utils=require(_0x448a('0x16'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2ed72f,_0xe43d33){_0xe43d33=_0xe43d33||0xcc;return function(_0x5521cf){if(_0x5521cf){return _0x2ed72f[_0x448a('0x17')](_0xe43d33);}return _0x2ed72f[_0x448a('0x18')](_0xe43d33)[_0x448a('0x19')]();};}function respondWithResult(_0x5f02b1,_0x2b1121){_0x2b1121=_0x2b1121||0xc8;return function(_0x2d99f5){if(_0x2d99f5){return _0x5f02b1[_0x448a('0x18')](_0x2b1121)[_0x448a('0x1a')](_0x2d99f5);}};}function respondWithFilteredResult(_0x4976db,_0x4e8f3f){return function(_0x1d8655){if(_0x1d8655){var _0x25560c=_0x1d8655[_0x448a('0x1b')],_0x293827=_0x4e8f3f[_0x448a('0x1c')],_0x514ab9=_0x4e8f3f['offset']+_0x4e8f3f['limit'],_0x4de834;if(_0x514ab9>=_0x25560c){_0x514ab9=_0x25560c;_0x4de834=0xc8;}else{_0x4de834=0xce;}_0x4976db[_0x448a('0x18')](_0x4de834);return _0x4976db[_0x448a('0x1d')]('Content-Range',_0x293827+'-'+_0x514ab9+'/'+_0x25560c)[_0x448a('0x1a')](_0x1d8655);}return null;};}function patchUpdates(_0x2acd50){return function(_0x4d1b79){try{jsonpatch[_0x448a('0x1e')](_0x4d1b79,_0x2acd50,!![]);}catch(_0x317241){return BPromise[_0x448a('0x1f')](_0x317241);}return _0x4d1b79[_0x448a('0x20')]();};}function saveUpdates(_0x3016c0,_0x1a2c39){return function(_0x278bca){if(_0x278bca){return _0x278bca['update'](_0x3016c0)['then'](function(_0x1d7090){return _0x1d7090;});}return null;};}function removeEntity(_0xc29080,_0x41b889){return function(_0xed2c45){if(_0xed2c45){return _0xed2c45[_0x448a('0x21')]()[_0x448a('0x22')](function(){_0xc29080[_0x448a('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x576465,_0x4d6f4f){return function(_0x558eef){if(!_0x558eef){_0x576465[_0x448a('0x17')](0x194);}return _0x558eef;};}function handleError(_0x48f602,_0x580ec0){_0x580ec0=_0x580ec0||0x1f4;return function(_0x1cb0fc){logger[_0x448a('0x23')](_0x1cb0fc[_0x448a('0x24')]);if(_0x1cb0fc[_0x448a('0x25')]){delete _0x1cb0fc['name'];}_0x48f602[_0x448a('0x18')](_0x580ec0)[_0x448a('0x26')](_0x1cb0fc);};}exports['index']=function(_0x8d9d29,_0x5530c7){var _0x5a4b42={},_0x2080a8={},_0x3b6781={'count':0x0,'rows':[]};var _0x2118fc=_['map'](db[_0x448a('0x27')][_0x448a('0x28')],function(_0x4ebc0e){return{'name':_0x4ebc0e['fieldName'],'type':_0x4ebc0e[_0x448a('0x29')][_0x448a('0x2a')]};});_0x2080a8[_0x448a('0x2b')]=_[_0x448a('0x2c')](_0x2118fc,_0x448a('0x25'));_0x2080a8[_0x448a('0x2d')]=_[_0x448a('0x2e')](_0x8d9d29[_0x448a('0x2d')]);_0x2080a8[_0x448a('0x2f')]=_['intersection'](_0x2080a8['model'],_0x2080a8[_0x448a('0x2d')]);_0x5a4b42[_0x448a('0x30')]=_[_0x448a('0x31')](_0x2080a8[_0x448a('0x2b')],qs[_0x448a('0x32')](_0x8d9d29['query'][_0x448a('0x32')]));_0x5a4b42[_0x448a('0x30')]=_0x5a4b42[_0x448a('0x30')][_0x448a('0x33')]?_0x5a4b42[_0x448a('0x30')]:_0x2080a8[_0x448a('0x2b')];if(!_0x8d9d29[_0x448a('0x2d')][_0x448a('0x34')](_0x448a('0x35'))){_0x5a4b42[_0x448a('0x36')]=qs[_0x448a('0x36')](_0x8d9d29[_0x448a('0x2d')][_0x448a('0x36')]);_0x5a4b42[_0x448a('0x1c')]=qs[_0x448a('0x1c')](_0x8d9d29['query'][_0x448a('0x1c')]);}_0x5a4b42['order']=qs['sort'](_0x8d9d29[_0x448a('0x2d')][_0x448a('0x37')]);_0x5a4b42['where']=qs['filters'](_[_0x448a('0x38')](_0x8d9d29['query'],_0x2080a8[_0x448a('0x2f')]),_0x2118fc);if(_0x8d9d29[_0x448a('0x2d')]['filter']){_0x5a4b42[_0x448a('0x39')]=_['merge'](_0x5a4b42[_0x448a('0x39')],{'$or':_[_0x448a('0x2c')](_0x2118fc,function(_0x216cd2){if(_0x216cd2[_0x448a('0x29')]!==_0x448a('0x3a')){var _0xe04199={};_0xe04199[_0x216cd2['name']]={'$like':'%'+_0x8d9d29[_0x448a('0x2d')][_0x448a('0x3b')]+'%'};return _0xe04199;}})});}_0x5a4b42=_['merge']({},_0x5a4b42,_0x8d9d29['options']);var _0x25f5d9={'where':_0x5a4b42['where']};return db[_0x448a('0x27')][_0x448a('0x1b')](_0x25f5d9)[_0x448a('0x22')](function(_0x1130dd){_0x3b6781['count']=_0x1130dd;if(_0x8d9d29['query'][_0x448a('0x3c')]){_0x5a4b42['include']=[{'all':!![]}];}return db[_0x448a('0x27')][_0x448a('0x3d')](_0x5a4b42);})[_0x448a('0x22')](function(_0x13f849){_0x3b6781[_0x448a('0x3e')]=_0x13f849;return _0x3b6781;})['then'](respondWithFilteredResult(_0x5530c7,_0x5a4b42))[_0x448a('0x3f')](handleError(_0x5530c7,null));};exports[_0x448a('0x40')]=function(_0x3d12ae,_0x2b6984){var _0x5516ac={'raw':!![],'where':{'id':_0x3d12ae[_0x448a('0x41')]['id']}},_0x1a6e81={};_0x1a6e81['model']=_['keys'](db['SquareMessage'][_0x448a('0x28')]);_0x1a6e81[_0x448a('0x2d')]=_[_0x448a('0x2e')](_0x3d12ae[_0x448a('0x2d')]);_0x1a6e81[_0x448a('0x2f')]=_[_0x448a('0x31')](_0x1a6e81[_0x448a('0x2b')],_0x1a6e81[_0x448a('0x2d')]);_0x5516ac[_0x448a('0x30')]=_[_0x448a('0x31')](_0x1a6e81[_0x448a('0x2b')],qs[_0x448a('0x32')](_0x3d12ae[_0x448a('0x2d')][_0x448a('0x32')]));_0x5516ac[_0x448a('0x30')]=_0x5516ac['attributes'][_0x448a('0x33')]?_0x5516ac[_0x448a('0x30')]:_0x1a6e81[_0x448a('0x2b')];if(_0x3d12ae[_0x448a('0x2d')][_0x448a('0x3c')]){_0x5516ac[_0x448a('0x42')]=[{'all':!![]}];}_0x5516ac=_[_0x448a('0x43')]({},_0x5516ac,_0x3d12ae['options']);return db[_0x448a('0x27')][_0x448a('0x44')](_0x5516ac)['then'](handleEntityNotFound(_0x2b6984,null))[_0x448a('0x22')](respondWithResult(_0x2b6984,null))[_0x448a('0x3f')](handleError(_0x2b6984,null));};exports['create']=function(_0x487da1,_0x3ef615){return db['SquareMessage'][_0x448a('0x45')](_0x487da1[_0x448a('0x46')],{})[_0x448a('0x22')](respondWithResult(_0x3ef615,0xc9))[_0x448a('0x3f')](handleError(_0x3ef615,null));};exports[_0x448a('0x47')]=function(_0x2ae36f,_0x49678d){if(_0x2ae36f[_0x448a('0x46')]['id']){delete _0x2ae36f[_0x448a('0x46')]['id'];}return db[_0x448a('0x27')][_0x448a('0x44')]({'where':{'id':_0x2ae36f[_0x448a('0x41')]['id']}})[_0x448a('0x22')](handleEntityNotFound(_0x49678d,null))[_0x448a('0x22')](saveUpdates(_0x2ae36f['body'],null))[_0x448a('0x22')](respondWithResult(_0x49678d,null))[_0x448a('0x3f')](handleError(_0x49678d,null));};exports['destroy']=function(_0x19191d,_0x47c744){return db[_0x448a('0x27')][_0x448a('0x44')]({'where':{'id':_0x19191d[_0x448a('0x41')]['id']}})['then'](handleEntityNotFound(_0x47c744,null))[_0x448a('0x22')](removeEntity(_0x47c744,null))[_0x448a('0x3f')](handleError(_0x47c744,null));};
\ No newline at end of file
diff --git a/server/api/squareMessage/squareMessage.model.js b/server/api/squareMessage/squareMessage.model.js
index bc2b13a..ceb35cc 100644
--- a/server/api/squareMessage/squareMessage.model.js
+++ b/server/api/squareMessage/squareMessage.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x1261=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./squareMessage.attributes','define','square_messages'];(function(_0xb390f8,_0x3ac4bf){var _0x49fdae=function(_0x13f6e1){while(--_0x13f6e1){_0xb390f8['push'](_0xb390f8['shift']());}};_0x49fdae(++_0x3ac4bf);}(_0x1261,0x144));var _0x1126=function(_0x2b737c,_0x274adf){_0x2b737c=_0x2b737c-0x0;var _0x466ed5=_0x1261[_0x2b737c];return _0x466ed5;};'use strict';var _=require('lodash');var util=require(_0x1126('0x0'));var logger=require(_0x1126('0x1'))(_0x1126('0x2'));var moment=require(_0x1126('0x3'));var BPromise=require(_0x1126('0x4'));var rp=require(_0x1126('0x5'));var fs=require('fs');var path=require(_0x1126('0x6'));var rimraf=require(_0x1126('0x7'));var config=require(_0x1126('0x8'));var attributes=require(_0x1126('0x9'));module['exports']=function(_0x5c68c8,_0x40ba58){return _0x5c68c8[_0x1126('0xa')]('SquareMessage',attributes,{'tableName':_0x1126('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xc4aa=['bluebird','../../config/environment','./squareMessage.attributes','exports','define','SquareMessage','square_messages','lodash','util','../../config/logger','api','moment'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x8c43de,_0x90ff31){_0x8c43de=_0x8c43de-0x0;var _0xa6591b=_0xc4aa[_0x8c43de];return _0xa6591b;};'use strict';var _=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var logger=require(_0xac4a('0x2'))(_0xac4a('0x3'));var moment=require(_0xac4a('0x4'));var BPromise=require(_0xac4a('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xac4a('0x6'));var attributes=require(_0xac4a('0x7'));module[_0xac4a('0x8')]=function(_0x215f39,_0x96be2b){return _0x215f39[_0xac4a('0x9')](_0xac4a('0xa'),attributes,{'tableName':_0xac4a('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/squareMessage/squareMessage.rpc.js b/server/api/squareMessage/squareMessage.rpc.js
index 03f6638..8aeae4e 100644
--- a/server/api/squareMessage/squareMessage.rpc.js
+++ b/server/api/squareMessage/squareMessage.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x80c3=['message','result','catch','body','options','raw','then','CreateSquareMessage','lodash','bluebird','ioredis','../../mysqldb','../../config/utils','jayson/promise','request','info','request\x20sent','debug','SquareMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','SquareMessage,\x20%s,\x20%s'];(function(_0x39af10,_0x5466b7){var _0x56f8c8=function(_0x13d8c0){while(--_0x13d8c0){_0x39af10['push'](_0x39af10['shift']());}};_0x56f8c8(++_0x5466b7);}(_0x80c3,0x18f));var _0x380c=function(_0x27530d,_0x46480a){_0x27530d=_0x27530d-0x0;var _0x59e561=_0x80c3[_0x27530d];return _0x59e561;};'use strict';var _=require(_0x380c('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x380c('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x380c('0x2'));var db=require(_0x380c('0x3'))['db'];var utils=require(_0x380c('0x4'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x380c('0x5'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x332ed3,_0x395efa,_0x1cdbad){return new BPromise(function(_0x59445f,_0x1d853e){return client[_0x380c('0x6')](_0x332ed3,_0x1cdbad)['then'](function(_0xdd635d){logger[_0x380c('0x7')]('SquareMessage,\x20%s,\x20%s',_0x395efa,_0x380c('0x8'));logger[_0x380c('0x9')](_0x380c('0xa'),_0x395efa,'request\x20sent',JSON[_0x380c('0xb')](_0xdd635d));if(_0xdd635d[_0x380c('0xc')]){if(_0xdd635d[_0x380c('0xc')][_0x380c('0xd')]===0x1f4){logger[_0x380c('0xc')](_0x380c('0xe'),_0x395efa,_0xdd635d[_0x380c('0xc')][_0x380c('0xf')]);return _0x1d853e(_0xdd635d[_0x380c('0xc')][_0x380c('0xf')]);}logger['error'](_0x380c('0xe'),_0x395efa,_0xdd635d[_0x380c('0xc')]['message']);return _0x59445f(_0xdd635d[_0x380c('0xc')][_0x380c('0xf')]);}else{logger[_0x380c('0x7')](_0x380c('0xe'),_0x395efa,_0x380c('0x8'));_0x59445f(_0xdd635d[_0x380c('0x10')][_0x380c('0xf')]);}})[_0x380c('0x11')](function(_0x3022e6){logger['error'](_0x380c('0xe'),_0x395efa,_0x3022e6);_0x1d853e(_0x3022e6);});});}exports['CreateSquareMessage']=function(_0x5b2c5c){var _0x1a165e=this;return new Promise(function(_0x4fa7a1,_0x48625c){return db['SquareMessage']['create'](_0x5b2c5c[_0x380c('0x12')],{'raw':_0x5b2c5c[_0x380c('0x13')]?_0x5b2c5c[_0x380c('0x13')][_0x380c('0x14')]===undefined?!![]:![]:!![]})[_0x380c('0x15')](function(_0x4086c2){logger[_0x380c('0x7')](_0x380c('0x16'),_0x5b2c5c);logger[_0x380c('0x9')](_0x380c('0x16'),_0x5b2c5c,JSON[_0x380c('0xb')](_0x4086c2));_0x4fa7a1(_0x4086c2);})[_0x380c('0x11')](function(_0x374e50){logger[_0x380c('0xc')](_0x380c('0x16'),_0x374e50[_0x380c('0xf')],_0x5b2c5c);_0x48625c(_0x1a165e[_0x380c('0xc')](0x1f4,_0x374e50[_0x380c('0xf')]));});});};
\ No newline at end of file
+var _0x7919=['options','raw','then','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','request','info','request\x20sent','debug','SquareMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','SquareMessage,\x20%s,\x20%s','result','catch','CreateSquareMessage','create','body'];(function(_0x596f35,_0x45396c){var _0xa6fe77=function(_0x10c841){while(--_0x10c841){_0x596f35['push'](_0x596f35['shift']());}};_0xa6fe77(++_0x45396c);}(_0x7919,0xeb));var _0x9791=function(_0x4a0d07,_0x4b198a){_0x4a0d07=_0x4a0d07-0x0;var _0xfbce68=_0x7919[_0x4a0d07];return _0xfbce68;};'use strict';var _=require(_0x9791('0x0'));var util=require(_0x9791('0x1'));var moment=require(_0x9791('0x2'));var BPromise=require(_0x9791('0x3'));var rs=require(_0x9791('0x4'));var fs=require('fs');var Redis=require(_0x9791('0x5'));var db=require(_0x9791('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x9791('0x7'))(_0x9791('0x8'));var config=require('../../config/environment');var jayson=require(_0x9791('0x9'));var client=jayson[_0x9791('0xa')][_0x9791('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1214fc,_0x565661,_0x4afec7){return new BPromise(function(_0x222ab5,_0x50088f){return client[_0x9791('0xc')](_0x1214fc,_0x4afec7)['then'](function(_0x48297e){logger[_0x9791('0xd')]('SquareMessage,\x20%s,\x20%s',_0x565661,_0x9791('0xe'));logger[_0x9791('0xf')](_0x9791('0x10'),_0x565661,_0x9791('0xe'),JSON[_0x9791('0x11')](_0x48297e));if(_0x48297e[_0x9791('0x12')]){if(_0x48297e[_0x9791('0x12')]['code']===0x1f4){logger[_0x9791('0x12')]('SquareMessage,\x20%s,\x20%s',_0x565661,_0x48297e[_0x9791('0x12')][_0x9791('0x13')]);return _0x50088f(_0x48297e['error'][_0x9791('0x13')]);}logger['error'](_0x9791('0x14'),_0x565661,_0x48297e[_0x9791('0x12')][_0x9791('0x13')]);return _0x222ab5(_0x48297e[_0x9791('0x12')][_0x9791('0x13')]);}else{logger[_0x9791('0xd')](_0x9791('0x14'),_0x565661,_0x9791('0xe'));_0x222ab5(_0x48297e[_0x9791('0x15')][_0x9791('0x13')]);}})[_0x9791('0x16')](function(_0xfc61ae){logger[_0x9791('0x12')]('SquareMessage,\x20%s,\x20%s',_0x565661,_0xfc61ae);_0x50088f(_0xfc61ae);});});}exports[_0x9791('0x17')]=function(_0x402c83){var _0x22b6fb=this;return new Promise(function(_0x2962ae,_0x526b66){return db['SquareMessage'][_0x9791('0x18')](_0x402c83[_0x9791('0x19')],{'raw':_0x402c83[_0x9791('0x1a')]?_0x402c83[_0x9791('0x1a')][_0x9791('0x1b')]===undefined?!![]:![]:!![]})[_0x9791('0x1c')](function(_0x36e5f7){logger[_0x9791('0xd')](_0x9791('0x17'),_0x402c83);logger[_0x9791('0xf')](_0x9791('0x17'),_0x402c83,JSON['stringify'](_0x36e5f7));_0x2962ae(_0x36e5f7);})[_0x9791('0x16')](function(_0x4ec262){logger['error'](_0x9791('0x17'),_0x4ec262[_0x9791('0x13')],_0x402c83);_0x526b66(_0x22b6fb['error'](0x1f4,_0x4ec262[_0x9791('0x13')]));});});};
\ No newline at end of file
diff --git a/server/api/squareOdbc/index.js b/server/api/squareOdbc/index.js
index d2526e6..bf5b301 100644
--- a/server/api/squareOdbc/index.js
+++ b/server/api/squareOdbc/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x95bf=['../../components/interaction/service','../../config/environment','./squareOdbc.controller','get','index','/:id','isAuthenticated','show','15s','test','post','create','put','delete','destroy','exports','util','path','connect-timeout','../../components/auth/service'];(function(_0x20d6f0,_0x33e54c){var _0x105ceb=function(_0x4927e9){while(--_0x4927e9){_0x20d6f0['push'](_0x20d6f0['shift']());}};_0x105ceb(++_0x33e54c);}(_0x95bf,0x150));var _0xf95b=function(_0x3321c7,_0x143b25){_0x3321c7=_0x3321c7-0x0;var _0x1f31a6=_0x95bf[_0x3321c7];return _0x1f31a6;};'use strict';var multer=require('multer');var util=require(_0xf95b('0x0'));var path=require(_0xf95b('0x1'));var timeout=require(_0xf95b('0x2'));var express=require('express');var router=express['Router']();var auth=require(_0xf95b('0x3'));var interaction=require(_0xf95b('0x4'));var config=require(_0xf95b('0x5'));var controller=require(_0xf95b('0x6'));router[_0xf95b('0x7')]('/',auth['isAuthenticated'](),controller[_0xf95b('0x8')]);router[_0xf95b('0x7')](_0xf95b('0x9'),auth[_0xf95b('0xa')](),controller[_0xf95b('0xb')]);router[_0xf95b('0x7')]('/:id/test',auth[_0xf95b('0xa')](),timeout(_0xf95b('0xc')),controller[_0xf95b('0xd')]);router[_0xf95b('0xe')]('/',auth[_0xf95b('0xa')](),controller[_0xf95b('0xf')]);router[_0xf95b('0x10')](_0xf95b('0x9'),auth[_0xf95b('0xa')](),controller['update']);router[_0xf95b('0x11')](_0xf95b('0x9'),auth['isAuthenticated'](),controller[_0xf95b('0x12')]);module[_0xf95b('0x13')]=router;
\ No newline at end of file
+var _0xb847=['/:id/test','15s','post','create','put','update','delete','destroy','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./squareOdbc.controller','get','isAuthenticated','index','/:id','show'];(function(_0x20b5b7,_0x1d1b36){var _0x184a46=function(_0x5c88cd){while(--_0x5c88cd){_0x20b5b7['push'](_0x20b5b7['shift']());}};_0x184a46(++_0x1d1b36);}(_0xb847,0x168));var _0x7b84=function(_0x2962d5,_0x38deda){_0x2962d5=_0x2962d5-0x0;var _0x273406=_0xb847[_0x2962d5];return _0x273406;};'use strict';var multer=require(_0x7b84('0x0'));var util=require(_0x7b84('0x1'));var path=require(_0x7b84('0x2'));var timeout=require(_0x7b84('0x3'));var express=require(_0x7b84('0x4'));var router=express[_0x7b84('0x5')]();var auth=require(_0x7b84('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x7b84('0x7'));var controller=require(_0x7b84('0x8'));router[_0x7b84('0x9')]('/',auth[_0x7b84('0xa')](),controller[_0x7b84('0xb')]);router['get'](_0x7b84('0xc'),auth[_0x7b84('0xa')](),controller[_0x7b84('0xd')]);router['get'](_0x7b84('0xe'),auth[_0x7b84('0xa')](),timeout(_0x7b84('0xf')),controller['test']);router[_0x7b84('0x10')]('/',auth[_0x7b84('0xa')](),controller[_0x7b84('0x11')]);router[_0x7b84('0x12')](_0x7b84('0xc'),auth[_0x7b84('0xa')](),controller[_0x7b84('0x13')]);router[_0x7b84('0x14')]('/:id',auth[_0x7b84('0xa')](),controller[_0x7b84('0x15')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/squareOdbc/squareOdbc.attributes.js b/server/api/squareOdbc/squareOdbc.attributes.js
index 6c1729a..5cab67f 100644
--- a/server/api/squareOdbc/squareOdbc.attributes.js
+++ b/server/api/squareOdbc/squareOdbc.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9065=['exports','name','STRING','sequelize'];(function(_0x3a276d,_0x58c471){var _0x528d58=function(_0x45d183){while(--_0x45d183){_0x3a276d['push'](_0x3a276d['shift']());}};_0x528d58(++_0x58c471);}(_0x9065,0xab));var _0x5906=function(_0x32c45e,_0x4f445e){_0x32c45e=_0x32c45e-0x0;var _0x4a5548=_0x9065[_0x32c45e];return _0x4a5548;};'use strict';var Sequelize=require(_0x5906('0x0'));module[_0x5906('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x5906('0x2'),'allowNull':![]},'dsn':{'type':Sequelize[_0x5906('0x3')]},'description':{'type':Sequelize[_0x5906('0x3')]}};
\ No newline at end of file
+var _0x1c42=['sequelize','exports','STRING'];(function(_0x1344d6,_0x2181e6){var _0xf45b24=function(_0x2d90c1){while(--_0x2d90c1){_0x1344d6['push'](_0x1344d6['shift']());}};_0xf45b24(++_0x2181e6);}(_0x1c42,0xa8));var _0x21c4=function(_0x1272e5,_0x2b3fa2){_0x1272e5=_0x1272e5-0x0;var _0x240255=_0x1c42[_0x1272e5];return _0x240255;};'use strict';var Sequelize=require(_0x21c4('0x0'));module[_0x21c4('0x1')]={'name':{'type':Sequelize[_0x21c4('0x2')],'unique':'name','allowNull':![]},'dsn':{'type':Sequelize[_0x21c4('0x2')]},'description':{'type':Sequelize[_0x21c4('0x2')]}};
\ No newline at end of file
diff --git a/server/api/squareOdbc/squareOdbc.controller.js b/server/api/squareOdbc/squareOdbc.controller.js
index a517ec9..9a08221 100644
--- a/server/api/squareOdbc/squareOdbc.controller.js
+++ b/server/api/squareOdbc/squareOdbc.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x04c5=['merge','VIRTUAL','filter','options','includeAll','include','SquareOdbc','findAll','rows','show','params','keys','find','catch','create','user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','openSync','dsn','closeSync','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','status','end','count','offset','limit','set','Content-Range','json','apply','update','then','get','ODBC','destroy','sendStatus','error','stack','name','index','map','rawAttributes','fieldName','type','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','order','sort','where','pick'];(function(_0x453763,_0x4fbcfb){var _0x1da339=function(_0x33c78a){while(--_0x33c78a){_0x453763['push'](_0x453763['shift']());}};_0x1da339(++_0x4fbcfb);}(_0x04c5,0xcb));var _0x504c=function(_0x2c7fe3,_0xcb51e0){_0x2c7fe3=_0x2c7fe3-0x0;var _0x22fe18=_0x04c5[_0x2c7fe3];return _0x22fe18;};'use strict';var pdf=require(_0x504c('0x0'));var emlformat=require(_0x504c('0x1'));var rimraf=require(_0x504c('0x2'));var zipdir=require(_0x504c('0x3'));var jsonpatch=require(_0x504c('0x4'));var rp=require('request-promise');var moment=require(_0x504c('0x5'));var BPromise=require(_0x504c('0x6'));var Mustache=require(_0x504c('0x7'));var util=require(_0x504c('0x8'));var path=require(_0x504c('0x9'));var sox=require(_0x504c('0xa'));var csv=require(_0x504c('0xb'));var ejs=require(_0x504c('0xc'));var fs=require('fs');var _=require(_0x504c('0xd'));var squel=require(_0x504c('0xe'));var crypto=require(_0x504c('0xf'));var jsforce=require(_0x504c('0x10'));var deskjs=require(_0x504c('0x11'));var toCsv=require(_0x504c('0xb'));var querystring=require(_0x504c('0x12'));var Papa=require(_0x504c('0x13'));var Redis=require(_0x504c('0x14'));var authService=require(_0x504c('0x15'));var qs=require(_0x504c('0x16'));var as=require(_0x504c('0x17'));var hardwareService=require(_0x504c('0x18'));var logger=require(_0x504c('0x19'))(_0x504c('0x1a'));var utils=require(_0x504c('0x1b'));var config=require('../../config/environment');var db=require(_0x504c('0x1c'))['db'];function respondWithStatusCode(_0x20acae,_0x538464){_0x538464=_0x538464||0xcc;return function(_0x20b93e){if(_0x20b93e){return _0x20acae['sendStatus'](_0x538464);}return _0x20acae[_0x504c('0x1d')](_0x538464)[_0x504c('0x1e')]();};}function respondWithResult(_0x2bee11,_0x171fb8){_0x171fb8=_0x171fb8||0xc8;return function(_0x27382f){if(_0x27382f){return _0x2bee11['status'](_0x171fb8)['json'](_0x27382f);}};}function respondWithFilteredResult(_0x38c699,_0x5162f4){return function(_0x52708b){if(_0x52708b){var _0x4f2d19=_0x52708b[_0x504c('0x1f')],_0x90305c=_0x5162f4[_0x504c('0x20')],_0x2109a5=_0x5162f4[_0x504c('0x20')]+_0x5162f4[_0x504c('0x21')],_0x5632f2;if(_0x2109a5>=_0x4f2d19){_0x2109a5=_0x4f2d19;_0x5632f2=0xc8;}else{_0x5632f2=0xce;}_0x38c699[_0x504c('0x1d')](_0x5632f2);return _0x38c699[_0x504c('0x22')](_0x504c('0x23'),_0x90305c+'-'+_0x2109a5+'/'+_0x4f2d19)[_0x504c('0x24')](_0x52708b);}return null;};}function patchUpdates(_0x97a091){return function(_0xb09397){try{jsonpatch[_0x504c('0x25')](_0xb09397,_0x97a091,!![]);}catch(_0x43b6b5){return BPromise['reject'](_0x43b6b5);}return _0xb09397['save']();};}function saveUpdates(_0x84a9d1,_0x2e5a65){return function(_0x32b309){if(_0x32b309){return _0x32b309[_0x504c('0x26')](_0x84a9d1)[_0x504c('0x27')](function(_0x3c21e5){return _0x3c21e5;});}return null;};}function removeEntity(_0x4138bb,_0x687476){return function(_0x565644){if(_0x565644){return _0x565644['destroy']()[_0x504c('0x27')](function(){var _0x2618b7=_0x565644[_0x504c('0x28')]({'plain':!![]});var _0x4df7be=_0x504c('0x29');return db['UserProfileResource'][_0x504c('0x2a')]({'where':{'type':_0x4df7be,'resourceId':_0x2618b7['id']}})[_0x504c('0x27')](function(){return _0x565644;});})[_0x504c('0x27')](function(){_0x4138bb['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x1f186d,_0x2f9b8a){return function(_0xb16a09){if(!_0xb16a09){_0x1f186d[_0x504c('0x2b')](0x194);}return _0xb16a09;};}function handleError(_0x366dba,_0x1f66e6){_0x1f66e6=_0x1f66e6||0x1f4;return function(_0xa50550){logger[_0x504c('0x2c')](_0xa50550[_0x504c('0x2d')]);if(_0xa50550[_0x504c('0x2e')]){delete _0xa50550['name'];}_0x366dba[_0x504c('0x1d')](_0x1f66e6)['send'](_0xa50550);};}exports[_0x504c('0x2f')]=function(_0x25f527,_0x59d2fa){var _0x1a8a77={},_0x4eb63d={},_0x5d83e4={'count':0x0,'rows':[]};var _0x38e59a=_[_0x504c('0x30')](db['SquareOdbc'][_0x504c('0x31')],function(_0xfa6fce){return{'name':_0xfa6fce[_0x504c('0x32')],'type':_0xfa6fce[_0x504c('0x33')]['key']};});_0x4eb63d['model']=_['map'](_0x38e59a,_0x504c('0x2e'));_0x4eb63d['query']=_['keys'](_0x25f527[_0x504c('0x34')]);_0x4eb63d[_0x504c('0x35')]=_[_0x504c('0x36')](_0x4eb63d['model'],_0x4eb63d['query']);_0x1a8a77['attributes']=_[_0x504c('0x36')](_0x4eb63d[_0x504c('0x37')],qs[_0x504c('0x38')](_0x25f527['query'][_0x504c('0x38')]));_0x1a8a77[_0x504c('0x39')]=_0x1a8a77[_0x504c('0x39')][_0x504c('0x3a')]?_0x1a8a77['attributes']:_0x4eb63d[_0x504c('0x37')];if(!_0x25f527[_0x504c('0x34')][_0x504c('0x3b')]('nolimit')){_0x1a8a77[_0x504c('0x21')]=qs[_0x504c('0x21')](_0x25f527[_0x504c('0x34')][_0x504c('0x21')]);_0x1a8a77[_0x504c('0x20')]=qs[_0x504c('0x20')](_0x25f527[_0x504c('0x34')][_0x504c('0x20')]);}_0x1a8a77[_0x504c('0x3c')]=qs[_0x504c('0x3d')](_0x25f527[_0x504c('0x34')][_0x504c('0x3d')]);_0x1a8a77[_0x504c('0x3e')]=qs[_0x504c('0x35')](_[_0x504c('0x3f')](_0x25f527[_0x504c('0x34')],_0x4eb63d['filters']),_0x38e59a);if(_0x25f527[_0x504c('0x34')]['filter']){_0x1a8a77[_0x504c('0x3e')]=_[_0x504c('0x40')](_0x1a8a77['where'],{'$or':_[_0x504c('0x30')](_0x38e59a,function(_0x539946){if(_0x539946[_0x504c('0x33')]!==_0x504c('0x41')){var _0x34d9d0={};_0x34d9d0[_0x539946[_0x504c('0x2e')]]={'$like':'%'+_0x25f527[_0x504c('0x34')][_0x504c('0x42')]+'%'};return _0x34d9d0;}})});}_0x1a8a77=_[_0x504c('0x40')]({},_0x1a8a77,_0x25f527[_0x504c('0x43')]);var _0x3174b1={'where':_0x1a8a77[_0x504c('0x3e')]};return db['SquareOdbc'][_0x504c('0x1f')](_0x3174b1)[_0x504c('0x27')](function(_0xa4ac87){_0x5d83e4[_0x504c('0x1f')]=_0xa4ac87;if(_0x25f527[_0x504c('0x34')][_0x504c('0x44')]){_0x1a8a77[_0x504c('0x45')]=[{'all':!![]}];}return db[_0x504c('0x46')][_0x504c('0x47')](_0x1a8a77);})[_0x504c('0x27')](function(_0x314769){_0x5d83e4[_0x504c('0x48')]=_0x314769;return _0x5d83e4;})[_0x504c('0x27')](respondWithFilteredResult(_0x59d2fa,_0x1a8a77))['catch'](handleError(_0x59d2fa,null));};exports[_0x504c('0x49')]=function(_0x59bfbe,_0x319ade){var _0x5436a8={'raw':!![],'where':{'id':_0x59bfbe[_0x504c('0x4a')]['id']}},_0x56a5fa={};_0x56a5fa[_0x504c('0x37')]=_[_0x504c('0x4b')](db[_0x504c('0x46')][_0x504c('0x31')]);_0x56a5fa[_0x504c('0x34')]=_[_0x504c('0x4b')](_0x59bfbe['query']);_0x56a5fa[_0x504c('0x35')]=_['intersection'](_0x56a5fa[_0x504c('0x37')],_0x56a5fa[_0x504c('0x34')]);_0x5436a8[_0x504c('0x39')]=_['intersection'](_0x56a5fa[_0x504c('0x37')],qs[_0x504c('0x38')](_0x59bfbe[_0x504c('0x34')][_0x504c('0x38')]));_0x5436a8[_0x504c('0x39')]=_0x5436a8[_0x504c('0x39')][_0x504c('0x3a')]?_0x5436a8[_0x504c('0x39')]:_0x56a5fa['model'];if(_0x59bfbe[_0x504c('0x34')][_0x504c('0x44')]){_0x5436a8['include']=[{'all':!![]}];}_0x5436a8=_[_0x504c('0x40')]({},_0x5436a8,_0x59bfbe['options']);return db[_0x504c('0x46')][_0x504c('0x4c')](_0x5436a8)['then'](handleEntityNotFound(_0x319ade,null))[_0x504c('0x27')](respondWithResult(_0x319ade,null))[_0x504c('0x4d')](handleError(_0x319ade,null));};exports[_0x504c('0x4e')]=function(_0x135240,_0x5198ee){return db[_0x504c('0x46')][_0x504c('0x4e')](_0x135240['body'],{})[_0x504c('0x27')](function(_0x5912b5){var _0x3254ea=_0x135240['user']['get']({'plain':!![]});if(!_0x3254ea)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3254ea['role']===_0x504c('0x4f')){var _0x25da02=_0x5912b5['get']({'plain':!![]});var _0x516af0=_0x504c('0x29');return db[_0x504c('0x50')]['find']({'where':{'name':_0x516af0,'userProfileId':_0x3254ea[_0x504c('0x51')]},'raw':!![]})[_0x504c('0x27')](function(_0x50e58d){if(_0x50e58d&&_0x50e58d[_0x504c('0x52')]===0x0){return db[_0x504c('0x53')][_0x504c('0x4e')]({'name':_0x25da02['name'],'resourceId':_0x25da02['id'],'type':_0x50e58d[_0x504c('0x2e')],'sectionId':_0x50e58d['id']},{})[_0x504c('0x27')](function(){return _0x5912b5;});}else{return _0x5912b5;}})[_0x504c('0x4d')](function(_0x11a4dd){logger['error'](_0x504c('0x54'),_0x11a4dd);throw _0x11a4dd;});}return _0x5912b5;})[_0x504c('0x27')](respondWithResult(_0x5198ee,0xc9))[_0x504c('0x4d')](handleError(_0x5198ee,null));};exports[_0x504c('0x26')]=function(_0xc6a1d9,_0x54e80d){if(_0xc6a1d9[_0x504c('0x55')]['id']){delete _0xc6a1d9[_0x504c('0x55')]['id'];}return db[_0x504c('0x46')][_0x504c('0x4c')]({'where':{'id':_0xc6a1d9['params']['id']}})[_0x504c('0x27')](handleEntityNotFound(_0x54e80d,null))[_0x504c('0x27')](saveUpdates(_0xc6a1d9[_0x504c('0x55')],null))['then'](respondWithResult(_0x54e80d,null))[_0x504c('0x4d')](handleError(_0x54e80d,null));};exports[_0x504c('0x2a')]=function(_0x399aeb,_0x3618c7){return db[_0x504c('0x46')][_0x504c('0x4c')]({'where':{'id':_0x399aeb[_0x504c('0x4a')]['id']}})[_0x504c('0x27')](handleEntityNotFound(_0x3618c7,null))['then'](removeEntity(_0x3618c7,null))[_0x504c('0x4d')](handleError(_0x3618c7,null));};exports['test']=function(_0x16ec5f,_0x4390e7,_0x75fd49){var _0x3d4777;return db['SquareOdbc'][_0x504c('0x4c')]({'where':{'id':_0x16ec5f[_0x504c('0x4a')]['id']},'attributes':['id','dsn']})[_0x504c('0x27')](handleEntityNotFound(_0x4390e7,null))['then'](function(_0x68c9df){if(_0x68c9df){var _0x317454=require('odbc')();_0x317454[_0x504c('0x56')](_0x68c9df[_0x504c('0x57')]);_0x317454[_0x504c('0x58')]();return _0x68c9df;}})[_0x504c('0x27')](respondWithResult(_0x4390e7,null))[_0x504c('0x4d')](handleError(_0x4390e7,null));};
\ No newline at end of file
+var _0xbcc9=['error','stack','name','send','index','map','SquareOdbc','rawAttributes','fieldName','type','key','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','where','filters','pick','merge','VIRTUAL','filter','options','includeAll','include','rows','catch','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','get','UserProfileSection','userProfileId','autoAssociation','params','test','dsn','odbc','closeSync','html-pdf','eml-format','zip-dir','fast-json-patch','moment','bluebird','util','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','ODBC'];(function(_0xc0e2c4,_0xa4c81e){var _0x3e378c=function(_0x18bc29){while(--_0x18bc29){_0xc0e2c4['push'](_0xc0e2c4['shift']());}};_0x3e378c(++_0xa4c81e);}(_0xbcc9,0x172));var _0x9bcc=function(_0x19d728,_0x58a500){_0x19d728=_0x19d728-0x0;var _0xc23d6f=_0xbcc9[_0x19d728];return _0xc23d6f;};'use strict';var pdf=require(_0x9bcc('0x0'));var emlformat=require(_0x9bcc('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x9bcc('0x2'));var jsonpatch=require(_0x9bcc('0x3'));var rp=require('request-promise');var moment=require(_0x9bcc('0x4'));var BPromise=require(_0x9bcc('0x5'));var Mustache=require('mustache');var util=require(_0x9bcc('0x6'));var path=require('path');var sox=require(_0x9bcc('0x7'));var csv=require(_0x9bcc('0x8'));var ejs=require(_0x9bcc('0x9'));var fs=require('fs');var _=require('lodash');var squel=require(_0x9bcc('0xa'));var crypto=require(_0x9bcc('0xb'));var jsforce=require(_0x9bcc('0xc'));var deskjs=require(_0x9bcc('0xd'));var toCsv=require(_0x9bcc('0x8'));var querystring=require(_0x9bcc('0xe'));var Papa=require('papaparse');var Redis=require(_0x9bcc('0xf'));var authService=require(_0x9bcc('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x9bcc('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x9bcc('0x12'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x11f141,_0x4e0d3a){_0x4e0d3a=_0x4e0d3a||0xcc;return function(_0x889cf5){if(_0x889cf5){return _0x11f141[_0x9bcc('0x13')](_0x4e0d3a);}return _0x11f141[_0x9bcc('0x14')](_0x4e0d3a)[_0x9bcc('0x15')]();};}function respondWithResult(_0x4688e5,_0x1438f9){_0x1438f9=_0x1438f9||0xc8;return function(_0x2d152a){if(_0x2d152a){return _0x4688e5['status'](_0x1438f9)[_0x9bcc('0x16')](_0x2d152a);}};}function respondWithFilteredResult(_0x11ae7c,_0x592b69){return function(_0x5b4474){if(_0x5b4474){var _0x4cef3c=_0x5b4474[_0x9bcc('0x17')],_0xba7573=_0x592b69[_0x9bcc('0x18')],_0x2f550e=_0x592b69['offset']+_0x592b69[_0x9bcc('0x19')],_0x7852eb;if(_0x2f550e>=_0x4cef3c){_0x2f550e=_0x4cef3c;_0x7852eb=0xc8;}else{_0x7852eb=0xce;}_0x11ae7c['status'](_0x7852eb);return _0x11ae7c[_0x9bcc('0x1a')](_0x9bcc('0x1b'),_0xba7573+'-'+_0x2f550e+'/'+_0x4cef3c)[_0x9bcc('0x16')](_0x5b4474);}return null;};}function patchUpdates(_0x3c300a){return function(_0x5f3482){try{jsonpatch[_0x9bcc('0x1c')](_0x5f3482,_0x3c300a,!![]);}catch(_0x43b3cf){return BPromise[_0x9bcc('0x1d')](_0x43b3cf);}return _0x5f3482[_0x9bcc('0x1e')]();};}function saveUpdates(_0x56f2bb,_0x3d3424){return function(_0x7bcece){if(_0x7bcece){return _0x7bcece[_0x9bcc('0x1f')](_0x56f2bb)[_0x9bcc('0x20')](function(_0x4eb0b7){return _0x4eb0b7;});}return null;};}function removeEntity(_0x280dd3,_0x478fd7){return function(_0x2ebb8d){if(_0x2ebb8d){return _0x2ebb8d[_0x9bcc('0x21')]()[_0x9bcc('0x20')](function(){var _0x1cb582=_0x2ebb8d['get']({'plain':!![]});var _0xa2cf48=_0x9bcc('0x22');return db['UserProfileResource']['destroy']({'where':{'type':_0xa2cf48,'resourceId':_0x1cb582['id']}})[_0x9bcc('0x20')](function(){return _0x2ebb8d;});})[_0x9bcc('0x20')](function(){_0x280dd3[_0x9bcc('0x14')](0xcc)[_0x9bcc('0x15')]();});}};}function handleEntityNotFound(_0x522da6,_0xdfd6bc){return function(_0x84f611){if(!_0x84f611){_0x522da6[_0x9bcc('0x13')](0x194);}return _0x84f611;};}function handleError(_0x33d48f,_0x2617a7){_0x2617a7=_0x2617a7||0x1f4;return function(_0x2dc3b9){logger[_0x9bcc('0x23')](_0x2dc3b9[_0x9bcc('0x24')]);if(_0x2dc3b9[_0x9bcc('0x25')]){delete _0x2dc3b9[_0x9bcc('0x25')];}_0x33d48f[_0x9bcc('0x14')](_0x2617a7)[_0x9bcc('0x26')](_0x2dc3b9);};}exports[_0x9bcc('0x27')]=function(_0x1bf288,_0x1e104b){var _0x3db4f7={},_0xf0ffe0={},_0x4110a9={'count':0x0,'rows':[]};var _0x42f6af=_[_0x9bcc('0x28')](db[_0x9bcc('0x29')][_0x9bcc('0x2a')],function(_0x988b66){return{'name':_0x988b66[_0x9bcc('0x2b')],'type':_0x988b66[_0x9bcc('0x2c')][_0x9bcc('0x2d')]};});_0xf0ffe0['model']=_['map'](_0x42f6af,'name');_0xf0ffe0[_0x9bcc('0x2e')]=_[_0x9bcc('0x2f')](_0x1bf288['query']);_0xf0ffe0['filters']=_[_0x9bcc('0x30')](_0xf0ffe0[_0x9bcc('0x31')],_0xf0ffe0[_0x9bcc('0x2e')]);_0x3db4f7[_0x9bcc('0x32')]=_['intersection'](_0xf0ffe0['model'],qs[_0x9bcc('0x33')](_0x1bf288['query']['fields']));_0x3db4f7[_0x9bcc('0x32')]=_0x3db4f7['attributes'][_0x9bcc('0x34')]?_0x3db4f7[_0x9bcc('0x32')]:_0xf0ffe0[_0x9bcc('0x31')];if(!_0x1bf288[_0x9bcc('0x2e')][_0x9bcc('0x35')]('nolimit')){_0x3db4f7['limit']=qs[_0x9bcc('0x19')](_0x1bf288[_0x9bcc('0x2e')][_0x9bcc('0x19')]);_0x3db4f7[_0x9bcc('0x18')]=qs[_0x9bcc('0x18')](_0x1bf288['query']['offset']);}_0x3db4f7[_0x9bcc('0x36')]=qs[_0x9bcc('0x37')](_0x1bf288[_0x9bcc('0x2e')]['sort']);_0x3db4f7[_0x9bcc('0x38')]=qs[_0x9bcc('0x39')](_[_0x9bcc('0x3a')](_0x1bf288[_0x9bcc('0x2e')],_0xf0ffe0[_0x9bcc('0x39')]),_0x42f6af);if(_0x1bf288[_0x9bcc('0x2e')]['filter']){_0x3db4f7[_0x9bcc('0x38')]=_[_0x9bcc('0x3b')](_0x3db4f7[_0x9bcc('0x38')],{'$or':_[_0x9bcc('0x28')](_0x42f6af,function(_0x4a1f1a){if(_0x4a1f1a['type']!==_0x9bcc('0x3c')){var _0x521202={};_0x521202[_0x4a1f1a[_0x9bcc('0x25')]]={'$like':'%'+_0x1bf288[_0x9bcc('0x2e')][_0x9bcc('0x3d')]+'%'};return _0x521202;}})});}_0x3db4f7=_['merge']({},_0x3db4f7,_0x1bf288[_0x9bcc('0x3e')]);var _0x2a9345={'where':_0x3db4f7['where']};return db[_0x9bcc('0x29')][_0x9bcc('0x17')](_0x2a9345)[_0x9bcc('0x20')](function(_0x2e1dbc){_0x4110a9[_0x9bcc('0x17')]=_0x2e1dbc;if(_0x1bf288[_0x9bcc('0x2e')][_0x9bcc('0x3f')]){_0x3db4f7[_0x9bcc('0x40')]=[{'all':!![]}];}return db['SquareOdbc']['findAll'](_0x3db4f7);})[_0x9bcc('0x20')](function(_0x29968a){_0x4110a9[_0x9bcc('0x41')]=_0x29968a;return _0x4110a9;})[_0x9bcc('0x20')](respondWithFilteredResult(_0x1e104b,_0x3db4f7))[_0x9bcc('0x42')](handleError(_0x1e104b,null));};exports['show']=function(_0x55875d,_0x1070ed){var _0x2f6e27={'raw':!![],'where':{'id':_0x55875d['params']['id']}},_0x13644e={};_0x13644e[_0x9bcc('0x31')]=_[_0x9bcc('0x2f')](db[_0x9bcc('0x29')]['rawAttributes']);_0x13644e[_0x9bcc('0x2e')]=_[_0x9bcc('0x2f')](_0x55875d[_0x9bcc('0x2e')]);_0x13644e[_0x9bcc('0x39')]=_[_0x9bcc('0x30')](_0x13644e['model'],_0x13644e[_0x9bcc('0x2e')]);_0x2f6e27[_0x9bcc('0x32')]=_[_0x9bcc('0x30')](_0x13644e[_0x9bcc('0x31')],qs[_0x9bcc('0x33')](_0x55875d['query'][_0x9bcc('0x33')]));_0x2f6e27[_0x9bcc('0x32')]=_0x2f6e27[_0x9bcc('0x32')][_0x9bcc('0x34')]?_0x2f6e27['attributes']:_0x13644e[_0x9bcc('0x31')];if(_0x55875d[_0x9bcc('0x2e')][_0x9bcc('0x3f')]){_0x2f6e27[_0x9bcc('0x40')]=[{'all':!![]}];}_0x2f6e27=_[_0x9bcc('0x3b')]({},_0x2f6e27,_0x55875d['options']);return db[_0x9bcc('0x29')][_0x9bcc('0x43')](_0x2f6e27)[_0x9bcc('0x20')](handleEntityNotFound(_0x1070ed,null))[_0x9bcc('0x20')](respondWithResult(_0x1070ed,null))[_0x9bcc('0x42')](handleError(_0x1070ed,null));};exports[_0x9bcc('0x44')]=function(_0x2d4aec,_0x239d53){return db[_0x9bcc('0x29')]['create'](_0x2d4aec[_0x9bcc('0x45')],{})[_0x9bcc('0x20')](function(_0x5b3047){var _0x4d0b4e=_0x2d4aec['user']['get']({'plain':!![]});if(!_0x4d0b4e)throw new Error(_0x9bcc('0x46'));if(_0x4d0b4e['role']===_0x9bcc('0x47')){var _0x25e25c=_0x5b3047[_0x9bcc('0x48')]({'plain':!![]});var _0x14b352=_0x9bcc('0x22');return db[_0x9bcc('0x49')][_0x9bcc('0x43')]({'where':{'name':_0x14b352,'userProfileId':_0x4d0b4e[_0x9bcc('0x4a')]},'raw':!![]})[_0x9bcc('0x20')](function(_0xec8f81){if(_0xec8f81&&_0xec8f81[_0x9bcc('0x4b')]===0x0){return db['UserProfileResource'][_0x9bcc('0x44')]({'name':_0x25e25c['name'],'resourceId':_0x25e25c['id'],'type':_0xec8f81[_0x9bcc('0x25')],'sectionId':_0xec8f81['id']},{})[_0x9bcc('0x20')](function(){return _0x5b3047;});}else{return _0x5b3047;}})[_0x9bcc('0x42')](function(_0x22dc6a){logger[_0x9bcc('0x23')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x22dc6a);throw _0x22dc6a;});}return _0x5b3047;})[_0x9bcc('0x20')](respondWithResult(_0x239d53,0xc9))['catch'](handleError(_0x239d53,null));};exports[_0x9bcc('0x1f')]=function(_0x1523d7,_0x508870){if(_0x1523d7[_0x9bcc('0x45')]['id']){delete _0x1523d7[_0x9bcc('0x45')]['id'];}return db[_0x9bcc('0x29')][_0x9bcc('0x43')]({'where':{'id':_0x1523d7[_0x9bcc('0x4c')]['id']}})[_0x9bcc('0x20')](handleEntityNotFound(_0x508870,null))['then'](saveUpdates(_0x1523d7[_0x9bcc('0x45')],null))[_0x9bcc('0x20')](respondWithResult(_0x508870,null))[_0x9bcc('0x42')](handleError(_0x508870,null));};exports[_0x9bcc('0x21')]=function(_0x1dbc3f,_0x52f4c6){return db['SquareOdbc']['find']({'where':{'id':_0x1dbc3f[_0x9bcc('0x4c')]['id']}})['then'](handleEntityNotFound(_0x52f4c6,null))[_0x9bcc('0x20')](removeEntity(_0x52f4c6,null))['catch'](handleError(_0x52f4c6,null));};exports[_0x9bcc('0x4d')]=function(_0x24b31c,_0x1c5dde,_0x1681ef){var _0x4cd882;return db[_0x9bcc('0x29')][_0x9bcc('0x43')]({'where':{'id':_0x24b31c[_0x9bcc('0x4c')]['id']},'attributes':['id',_0x9bcc('0x4e')]})[_0x9bcc('0x20')](handleEntityNotFound(_0x1c5dde,null))['then'](function(_0x1fe340){if(_0x1fe340){var _0x2bfbaf=require(_0x9bcc('0x4f'))();_0x2bfbaf['openSync'](_0x1fe340[_0x9bcc('0x4e')]);_0x2bfbaf[_0x9bcc('0x50')]();return _0x1fe340;}})[_0x9bcc('0x20')](respondWithResult(_0x1c5dde,null))['catch'](handleError(_0x1c5dde,null));};
\ No newline at end of file
diff --git a/server/api/squareOdbc/squareOdbc.model.js b/server/api/squareOdbc/squareOdbc.model.js
index e05e3e2..be34514 100644
--- a/server/api/squareOdbc/squareOdbc.model.js
+++ b/server/api/squareOdbc/squareOdbc.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x21a9=['lodash','util','api','moment','bluebird','request-promise','rimraf','../../config/environment','./squareOdbc.attributes','SquareOdbc','square_odbc'];(function(_0x119b63,_0xff28c1){var _0x4b60d7=function(_0x1a907b){while(--_0x1a907b){_0x119b63['push'](_0x119b63['shift']());}};_0x4b60d7(++_0xff28c1);}(_0x21a9,0x16b));var _0x921a=function(_0x1cc8fe,_0x105328){_0x1cc8fe=_0x1cc8fe-0x0;var _0x230054=_0x21a9[_0x1cc8fe];return _0x230054;};'use strict';var _=require(_0x921a('0x0'));var util=require(_0x921a('0x1'));var logger=require('../../config/logger')(_0x921a('0x2'));var moment=require(_0x921a('0x3'));var BPromise=require(_0x921a('0x4'));var rp=require(_0x921a('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x921a('0x6'));var config=require(_0x921a('0x7'));var attributes=require(_0x921a('0x8'));module['exports']=function(_0x575fc9,_0x362f07){return _0x575fc9['define'](_0x921a('0x9'),attributes,{'tableName':_0x921a('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x8927=['rimraf','./squareOdbc.attributes','define','square_odbc','lodash','../../config/logger','api','moment','request-promise','path'];(function(_0x180be6,_0x391ec2){var _0x19fa4e=function(_0x1c6b34){while(--_0x1c6b34){_0x180be6['push'](_0x180be6['shift']());}};_0x19fa4e(++_0x391ec2);}(_0x8927,0x1a8));var _0x7892=function(_0x6396b1,_0xdc77d9){_0x6396b1=_0x6396b1-0x0;var _0x2ea616=_0x8927[_0x6396b1];return _0x2ea616;};'use strict';var _=require(_0x7892('0x0'));var util=require('util');var logger=require(_0x7892('0x1'))(_0x7892('0x2'));var moment=require(_0x7892('0x3'));var BPromise=require('bluebird');var rp=require(_0x7892('0x4'));var fs=require('fs');var path=require(_0x7892('0x5'));var rimraf=require(_0x7892('0x6'));var config=require('../../config/environment');var attributes=require(_0x7892('0x7'));module['exports']=function(_0x11fbc8,_0x28b7ea){return _0x11fbc8[_0x7892('0x8')]('SquareOdbc',attributes,{'tableName':_0x7892('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/squareOdbc/squareOdbc.rpc.js b/server/api/squareOdbc/squareOdbc.rpc.js
index d3e8550..15dd789 100644
--- a/server/api/squareOdbc/squareOdbc.rpc.js
+++ b/server/api/squareOdbc/squareOdbc.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x5fc3=['info','request\x20sent','debug','stringify','error','code','message','SquareOdbc,\x20%s,\x20%s','result','catch','ShowSquareOdbc','find','options','where','attributes','include','map','model','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','request','then'];(function(_0x204191,_0x55d566){var _0x526ccf=function(_0x22427d){while(--_0x22427d){_0x204191['push'](_0x204191['shift']());}};_0x526ccf(++_0x55d566);}(_0x5fc3,0xa8));var _0x35fc=function(_0x45bf86,_0x75586e){_0x45bf86=_0x45bf86-0x0;var _0x1f02b7=_0x5fc3[_0x45bf86];return _0x1f02b7;};'use strict';var _=require(_0x35fc('0x0'));var util=require(_0x35fc('0x1'));var moment=require('moment');var BPromise=require(_0x35fc('0x2'));var rs=require(_0x35fc('0x3'));var fs=require('fs');var Redis=require(_0x35fc('0x4'));var db=require(_0x35fc('0x5'))['db'];var utils=require(_0x35fc('0x6'));var logger=require('../../config/logger')(_0x35fc('0x7'));var config=require(_0x35fc('0x8'));var jayson=require(_0x35fc('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x19a0d1,_0x508b32,_0x16e153){return new BPromise(function(_0x27524f,_0xc72d93){return client[_0x35fc('0xa')](_0x19a0d1,_0x16e153)[_0x35fc('0xb')](function(_0xf9d3a6){logger[_0x35fc('0xc')]('SquareOdbc,\x20%s,\x20%s',_0x508b32,_0x35fc('0xd'));logger[_0x35fc('0xe')]('SquareOdbc,\x20%s,\x20%s,\x20%s',_0x508b32,_0x35fc('0xd'),JSON[_0x35fc('0xf')](_0xf9d3a6));if(_0xf9d3a6['error']){if(_0xf9d3a6[_0x35fc('0x10')][_0x35fc('0x11')]===0x1f4){logger['error']('SquareOdbc,\x20%s,\x20%s',_0x508b32,_0xf9d3a6[_0x35fc('0x10')]['message']);return _0xc72d93(_0xf9d3a6[_0x35fc('0x10')][_0x35fc('0x12')]);}logger[_0x35fc('0x10')](_0x35fc('0x13'),_0x508b32,_0xf9d3a6[_0x35fc('0x10')]['message']);return _0x27524f(_0xf9d3a6['error']['message']);}else{logger['info'](_0x35fc('0x13'),_0x508b32,_0x35fc('0xd'));_0x27524f(_0xf9d3a6[_0x35fc('0x14')][_0x35fc('0x12')]);}})[_0x35fc('0x15')](function(_0x1121fa){logger['error'](_0x35fc('0x13'),_0x508b32,_0x1121fa);_0xc72d93(_0x1121fa);});});}exports[_0x35fc('0x16')]=function(_0x553677){var _0x41e165=this;return new Promise(function(_0x363e47,_0x2e513b){return db['SquareOdbc'][_0x35fc('0x17')]({'raw':_0x553677[_0x35fc('0x18')]?_0x553677[_0x35fc('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x553677[_0x35fc('0x18')]?_0x553677[_0x35fc('0x18')][_0x35fc('0x19')]||null:null,'attributes':_0x553677[_0x35fc('0x18')]?_0x553677[_0x35fc('0x18')][_0x35fc('0x1a')]||null:null,'include':_0x553677[_0x35fc('0x18')]?_0x553677[_0x35fc('0x18')][_0x35fc('0x1b')]?_[_0x35fc('0x1c')](_0x553677['options'][_0x35fc('0x1b')],function(_0xd5399f){return{'model':db[_0xd5399f[_0x35fc('0x1d')]],'as':_0xd5399f['as'],'attributes':_0xd5399f[_0x35fc('0x1a')],'include':_0xd5399f[_0x35fc('0x1b')]?_['map'](_0xd5399f[_0x35fc('0x1b')],function(_0x4c587a){return{'model':db[_0x4c587a['model']],'as':_0x4c587a['as'],'attributes':_0x4c587a[_0x35fc('0x1a')],'include':_0x4c587a[_0x35fc('0x1b')]?_[_0x35fc('0x1c')](_0x4c587a['include'],function(_0x4086e9){return{'model':db[_0x4086e9['model']],'as':_0x4086e9['as'],'attributes':_0x4086e9[_0x35fc('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x35fc('0xb')](function(_0x5cb986){logger['info'](_0x35fc('0x16'),_0x553677);logger['debug'](_0x35fc('0x16'),_0x553677,JSON[_0x35fc('0xf')](_0x5cb986));_0x363e47(_0x5cb986);})['catch'](function(_0x26b7cb){logger[_0x35fc('0x10')](_0x35fc('0x16'),_0x26b7cb[_0x35fc('0x12')],_0x553677);_0x2e513b(_0x41e165[_0x35fc('0x10')](0x1f4,_0x26b7cb[_0x35fc('0x12')]));});});};
\ No newline at end of file
+var _0x008c=['stringify','ShowSquareOdbc','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','info','SquareOdbc,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','SquareOdbc,\x20%s,\x20%s','message','catch','find','options','include','map','attributes','model','then'];(function(_0x41f2f5,_0x14f33c){var _0x3d49f1=function(_0x300207){while(--_0x300207){_0x41f2f5['push'](_0x41f2f5['shift']());}};_0x3d49f1(++_0x14f33c);}(_0x008c,0x188));var _0xc008=function(_0x395155,_0x192ffd){_0x395155=_0x395155-0x0;var _0x179767=_0x008c[_0x395155];return _0x179767;};'use strict';var _=require(_0xc008('0x0'));var util=require(_0xc008('0x1'));var moment=require(_0xc008('0x2'));var BPromise=require(_0xc008('0x3'));var rs=require(_0xc008('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc008('0x5'))['db'];var utils=require(_0xc008('0x6'));var logger=require(_0xc008('0x7'))(_0xc008('0x8'));var config=require(_0xc008('0x9'));var jayson=require(_0xc008('0xa'));var client=jayson[_0xc008('0xb')][_0xc008('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x9c8cb2,_0x4af530,_0x428fa9){return new BPromise(function(_0x5aa09b,_0x30be38){return client['request'](_0x9c8cb2,_0x428fa9)['then'](function(_0x27830d){logger[_0xc008('0xd')]('SquareOdbc,\x20%s,\x20%s',_0x4af530,'request\x20sent');logger['debug'](_0xc008('0xe'),_0x4af530,_0xc008('0xf'),JSON['stringify'](_0x27830d));if(_0x27830d[_0xc008('0x10')]){if(_0x27830d[_0xc008('0x10')][_0xc008('0x11')]===0x1f4){logger[_0xc008('0x10')](_0xc008('0x12'),_0x4af530,_0x27830d[_0xc008('0x10')][_0xc008('0x13')]);return _0x30be38(_0x27830d['error']['message']);}logger[_0xc008('0x10')]('SquareOdbc,\x20%s,\x20%s',_0x4af530,_0x27830d[_0xc008('0x10')][_0xc008('0x13')]);return _0x5aa09b(_0x27830d[_0xc008('0x10')][_0xc008('0x13')]);}else{logger[_0xc008('0xd')]('SquareOdbc,\x20%s,\x20%s',_0x4af530,'request\x20sent');_0x5aa09b(_0x27830d['result'][_0xc008('0x13')]);}})[_0xc008('0x14')](function(_0x3cafe3){logger[_0xc008('0x10')]('SquareOdbc,\x20%s,\x20%s',_0x4af530,_0x3cafe3);_0x30be38(_0x3cafe3);});});}exports['ShowSquareOdbc']=function(_0x540e45){var _0x5c2668=this;return new Promise(function(_0x46042b,_0x462af5){return db['SquareOdbc'][_0xc008('0x15')]({'raw':_0x540e45['options']?_0x540e45['options']['raw']===undefined?!![]:![]:!![],'where':_0x540e45['options']?_0x540e45[_0xc008('0x16')]['where']||null:null,'attributes':_0x540e45['options']?_0x540e45['options']['attributes']||null:null,'include':_0x540e45['options']?_0x540e45[_0xc008('0x16')][_0xc008('0x17')]?_[_0xc008('0x18')](_0x540e45[_0xc008('0x16')][_0xc008('0x17')],function(_0x110128){return{'model':db[_0x110128['model']],'as':_0x110128['as'],'attributes':_0x110128[_0xc008('0x19')],'include':_0x110128['include']?_['map'](_0x110128[_0xc008('0x17')],function(_0x36f358){return{'model':db[_0x36f358[_0xc008('0x1a')]],'as':_0x36f358['as'],'attributes':_0x36f358[_0xc008('0x19')],'include':_0x36f358['include']?_['map'](_0x36f358['include'],function(_0x3f7b07){return{'model':db[_0x3f7b07[_0xc008('0x1a')]],'as':_0x3f7b07['as'],'attributes':_0x3f7b07[_0xc008('0x19')]};}):[]};}):[]};}):[]:[]})[_0xc008('0x1b')](function(_0x5bebd9){logger['info']('ShowSquareOdbc',_0x540e45);logger['debug']('ShowSquareOdbc',_0x540e45,JSON[_0xc008('0x1c')](_0x5bebd9));_0x46042b(_0x5bebd9);})[_0xc008('0x14')](function(_0x25eae4){logger['error'](_0xc008('0x1d'),_0x25eae4[_0xc008('0x13')],_0x540e45);_0x462af5(_0x5c2668[_0xc008('0x10')](0x1f4,_0x25eae4[_0xc008('0x13')]));});});};
\ No newline at end of file
diff --git a/server/api/squareProject/index.js b/server/api/squareProject/index.js
index b21bc46..45074b5 100644
--- a/server/api/squareProject/index.js
+++ b/server/api/squareProject/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x4e81=['update','destroy','delete','removeUsers','multer','util','path','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareProject.controller','get','isAuthenticated','/:id','show','/:id/users','getUsers','post','addUsers','put'];(function(_0x12e509,_0x503590){var _0x5eddc9=function(_0xe9dfac){while(--_0xe9dfac){_0x12e509['push'](_0x12e509['shift']());}};_0x5eddc9(++_0x503590);}(_0x4e81,0x1bc));var _0x14e8=function(_0xa2c0a3,_0x5bbac0){_0xa2c0a3=_0xa2c0a3-0x0;var _0x52c618=_0x4e81[_0xa2c0a3];return _0x52c618;};'use strict';var multer=require(_0x14e8('0x0'));var util=require(_0x14e8('0x1'));var path=require(_0x14e8('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var auth=require(_0x14e8('0x3'));var interaction=require(_0x14e8('0x4'));var config=require(_0x14e8('0x5'));var controller=require(_0x14e8('0x6'));router[_0x14e8('0x7')]('/',auth[_0x14e8('0x8')](),controller['index']);router['get'](_0x14e8('0x9'),auth[_0x14e8('0x8')](),controller[_0x14e8('0xa')]);router[_0x14e8('0x7')](_0x14e8('0xb'),auth[_0x14e8('0x8')](),controller[_0x14e8('0xc')]);router[_0x14e8('0xd')]('/',auth[_0x14e8('0x8')](),controller['create']);router[_0x14e8('0xd')](_0x14e8('0xb'),auth[_0x14e8('0x8')](),controller[_0x14e8('0xe')]);router[_0x14e8('0xf')](_0x14e8('0x9'),auth[_0x14e8('0x8')](),controller[_0x14e8('0x10')]);router['delete'](_0x14e8('0x9'),auth['isAuthenticated'](),controller[_0x14e8('0x11')]);router[_0x14e8('0x12')](_0x14e8('0xb'),auth['isAuthenticated'](),controller[_0x14e8('0x13')]);module['exports']=router;
\ No newline at end of file
+var _0x1339=['getUsers','post','create','addUsers','put','/:id','update','removeUsers','exports','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareProject.controller','isAuthenticated','index','get','show','/:id/users'];(function(_0x4edd8c,_0x320d1c){var _0x175e5c=function(_0x59340f){while(--_0x59340f){_0x4edd8c['push'](_0x4edd8c['shift']());}};_0x175e5c(++_0x320d1c);}(_0x1339,0x1ed));var _0x9133=function(_0x236e03,_0x46f525){_0x236e03=_0x236e03-0x0;var _0x20e222=_0x1339[_0x236e03];return _0x20e222;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x9133('0x0'));var timeout=require(_0x9133('0x1'));var express=require(_0x9133('0x2'));var router=express[_0x9133('0x3')]();var auth=require(_0x9133('0x4'));var interaction=require(_0x9133('0x5'));var config=require(_0x9133('0x6'));var controller=require(_0x9133('0x7'));router['get']('/',auth[_0x9133('0x8')](),controller[_0x9133('0x9')]);router[_0x9133('0xa')]('/:id',auth[_0x9133('0x8')](),controller[_0x9133('0xb')]);router[_0x9133('0xa')](_0x9133('0xc'),auth[_0x9133('0x8')](),controller[_0x9133('0xd')]);router[_0x9133('0xe')]('/',auth[_0x9133('0x8')](),controller[_0x9133('0xf')]);router[_0x9133('0xe')]('/:id/users',auth[_0x9133('0x8')](),controller[_0x9133('0x10')]);router[_0x9133('0x11')](_0x9133('0x12'),auth[_0x9133('0x8')](),controller[_0x9133('0x13')]);router['delete'](_0x9133('0x12'),auth[_0x9133('0x8')](),controller['destroy']);router['delete'](_0x9133('0xc'),auth['isAuthenticated'](),controller[_0x9133('0x14')]);module[_0x9133('0x15')]=router;
\ No newline at end of file
diff --git a/server/api/squareProject/squareProject.attributes.js b/server/api/squareProject/squareProject.attributes.js
index fa2e53c..580d76e 100644
--- a/server/api/squareProject/squareProject.attributes.js
+++ b/server/api/squareProject/squareProject.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xc7e9=['getDataValue','preproduction','BLOB','production','toString','utf8','sequelize','exports','STRING','TEXT','long'];(function(_0x26c26c,_0x39f9cf){var _0x153b04=function(_0x57aa87){while(--_0x57aa87){_0x26c26c['push'](_0x26c26c['shift']());}};_0x153b04(++_0x39f9cf);}(_0xc7e9,0x1c9));var _0x9c7e=function(_0x1203f,_0x554bbc){_0x1203f=_0x1203f-0x0;var _0x365f0a=_0xc7e9[_0x1203f];return _0x365f0a;};'use strict';var Sequelize=require(_0x9c7e('0x0'));module[_0x9c7e('0x1')]={'name':{'type':Sequelize[_0x9c7e('0x2')],'unique':'name','allowNull':![]},'description':{'type':Sequelize[_0x9c7e('0x2')]},'notes':{'type':Sequelize[_0x9c7e('0x3')]},'preproduction':{'type':Sequelize['BLOB'](_0x9c7e('0x4')),'get':function(){if(this['getDataValue']('preproduction')){return this[_0x9c7e('0x5')](_0x9c7e('0x6'))['toString']('utf8');}}},'production':{'type':Sequelize[_0x9c7e('0x7')](_0x9c7e('0x4')),'get':function(){if(this[_0x9c7e('0x5')](_0x9c7e('0x8'))){return this[_0x9c7e('0x5')](_0x9c7e('0x8'))[_0x9c7e('0x9')](_0x9c7e('0xa'));}}}};
\ No newline at end of file
+var _0x35a5=['production','toString','sequelize','STRING','name','BLOB','long','getDataValue','preproduction','utf8'];(function(_0x456684,_0x3d71b4){var _0x1c296c=function(_0x1081d4){while(--_0x1081d4){_0x456684['push'](_0x456684['shift']());}};_0x1c296c(++_0x3d71b4);}(_0x35a5,0xe8));var _0x535a=function(_0x23fd5f,_0x18f835){_0x23fd5f=_0x23fd5f-0x0;var _0x5ccab0=_0x35a5[_0x23fd5f];return _0x5ccab0;};'use strict';var Sequelize=require(_0x535a('0x0'));module['exports']={'name':{'type':Sequelize[_0x535a('0x1')],'unique':_0x535a('0x2'),'allowNull':![]},'description':{'type':Sequelize['STRING']},'notes':{'type':Sequelize['TEXT']},'preproduction':{'type':Sequelize[_0x535a('0x3')](_0x535a('0x4')),'get':function(){if(this[_0x535a('0x5')](_0x535a('0x6'))){return this['getDataValue'](_0x535a('0x6'))['toString'](_0x535a('0x7'));}}},'production':{'type':Sequelize[_0x535a('0x3')]('long'),'get':function(){if(this['getDataValue'](_0x535a('0x8'))){return this[_0x535a('0x5')](_0x535a('0x8'))[_0x535a('0x9')]('utf8');}}}};
\ No newline at end of file
diff --git a/server/api/squareProject/squareProject.controller.js b/server/api/squareProject/squareProject.controller.js
index bff75f0..799eb4b 100644
--- a/server/api/squareProject/squareProject.controller.js
+++ b/server/api/squareProject/squareProject.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x01be=['attributes','fields','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rawAttributes','length','options','catch','create','body','user','role','find','userProfileId','autoAssociation','params','addUsers','omit','removeUsers','ids','emit','userSquareProject:remove','getUsers','User','keys','hasOwnProperty','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','jsforce','desk.js','querystring','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./squareProject.socket','status','end','json','count','offset','limit','set','Content-Range','apply','reject','update','then','destroy','get','SquareProjects','UserProfileResource','error','stack','name','send','index','map','SquareProject','key','model','query','filters','intersection'];(function(_0x278e3c,_0x1c9cfd){var _0x3e2d9b=function(_0x34d928){while(--_0x34d928){_0x278e3c['push'](_0x278e3c['shift']());}};_0x3e2d9b(++_0x1c9cfd);}(_0x01be,0x7d));var _0xe01b=function(_0x3de499,_0x448ebe){_0x3de499=_0x3de499-0x0;var _0x3c8089=_0x01be[_0x3de499];return _0x3c8089;};'use strict';var pdf=require(_0xe01b('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xe01b('0x1'));var zipdir=require(_0xe01b('0x2'));var jsonpatch=require(_0xe01b('0x3'));var rp=require(_0xe01b('0x4'));var moment=require(_0xe01b('0x5'));var BPromise=require(_0xe01b('0x6'));var Mustache=require(_0xe01b('0x7'));var util=require(_0xe01b('0x8'));var path=require(_0xe01b('0x9'));var sox=require(_0xe01b('0xa'));var csv=require(_0xe01b('0xb'));var ejs=require(_0xe01b('0xc'));var fs=require('fs');var _=require(_0xe01b('0xd'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xe01b('0xe'));var deskjs=require(_0xe01b('0xf'));var toCsv=require('to-csv');var querystring=require(_0xe01b('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xe01b('0x11'));var hardwareService=require(_0xe01b('0x12'));var logger=require(_0xe01b('0x13'))('api');var utils=require(_0xe01b('0x14'));var config=require(_0xe01b('0x15'));var db=require(_0xe01b('0x16'))['db'];config[_0xe01b('0x17')]=_['defaults'](config[_0xe01b('0x17')],{'host':_0xe01b('0x18'),'port':0x18eb});var socket=require(_0xe01b('0x19'))(new Redis(config[_0xe01b('0x17')]));require(_0xe01b('0x1a'))['register'](socket);function respondWithStatusCode(_0x550a0c,_0x526f86){_0x526f86=_0x526f86||0xcc;return function(_0x54f982){if(_0x54f982){return _0x550a0c['sendStatus'](_0x526f86);}return _0x550a0c[_0xe01b('0x1b')](_0x526f86)[_0xe01b('0x1c')]();};}function respondWithResult(_0x14fac8,_0x21474a){_0x21474a=_0x21474a||0xc8;return function(_0x2bcd4a){if(_0x2bcd4a){return _0x14fac8[_0xe01b('0x1b')](_0x21474a)[_0xe01b('0x1d')](_0x2bcd4a);}};}function respondWithFilteredResult(_0x27918b,_0x489d35){return function(_0x559594){if(_0x559594){var _0x2e105a=_0x559594[_0xe01b('0x1e')],_0x11766=_0x489d35['offset'],_0x4cf4dc=_0x489d35[_0xe01b('0x1f')]+_0x489d35[_0xe01b('0x20')],_0x1e2a95;if(_0x4cf4dc>=_0x2e105a){_0x4cf4dc=_0x2e105a;_0x1e2a95=0xc8;}else{_0x1e2a95=0xce;}_0x27918b['status'](_0x1e2a95);return _0x27918b[_0xe01b('0x21')](_0xe01b('0x22'),_0x11766+'-'+_0x4cf4dc+'/'+_0x2e105a)[_0xe01b('0x1d')](_0x559594);}return null;};}function patchUpdates(_0x4165fa){return function(_0x5e32ba){try{jsonpatch[_0xe01b('0x23')](_0x5e32ba,_0x4165fa,!![]);}catch(_0x5e5e06){return BPromise[_0xe01b('0x24')](_0x5e5e06);}return _0x5e32ba['save']();};}function saveUpdates(_0x58d7e9,_0x5b0dda){return function(_0xdb1d80){if(_0xdb1d80){return _0xdb1d80[_0xe01b('0x25')](_0x58d7e9)[_0xe01b('0x26')](function(_0x2cc0fe){return _0x2cc0fe;});}return null;};}function removeEntity(_0x23fa88,_0x359c2c){return function(_0x12bf8c){if(_0x12bf8c){return _0x12bf8c[_0xe01b('0x27')]()[_0xe01b('0x26')](function(){var _0x1520cb=_0x12bf8c[_0xe01b('0x28')]({'plain':!![]});var _0x2d2250=_0xe01b('0x29');return db[_0xe01b('0x2a')][_0xe01b('0x27')]({'where':{'type':_0x2d2250,'resourceId':_0x1520cb['id']}})[_0xe01b('0x26')](function(){return _0x12bf8c;});})['then'](function(){_0x23fa88[_0xe01b('0x1b')](0xcc)[_0xe01b('0x1c')]();});}};}function handleEntityNotFound(_0x118b50,_0x4cc237){return function(_0x2ed4f5){if(!_0x2ed4f5){_0x118b50['sendStatus'](0x194);}return _0x2ed4f5;};}function handleError(_0x4fbf76,_0x3d0cc1){_0x3d0cc1=_0x3d0cc1||0x1f4;return function(_0x5d9b2d){logger[_0xe01b('0x2b')](_0x5d9b2d[_0xe01b('0x2c')]);if(_0x5d9b2d[_0xe01b('0x2d')]){delete _0x5d9b2d[_0xe01b('0x2d')];}_0x4fbf76[_0xe01b('0x1b')](_0x3d0cc1)[_0xe01b('0x2e')](_0x5d9b2d);};}exports[_0xe01b('0x2f')]=function(_0x272bbf,_0x44f55c){var _0x170336={},_0x59c5d2={},_0x22b961={'count':0x0,'rows':[]};var _0xfd64f0=_[_0xe01b('0x30')](db[_0xe01b('0x31')]['rawAttributes'],function(_0x1726c7){return{'name':_0x1726c7['fieldName'],'type':_0x1726c7['type'][_0xe01b('0x32')]};});_0x59c5d2[_0xe01b('0x33')]=_[_0xe01b('0x30')](_0xfd64f0,_0xe01b('0x2d'));_0x59c5d2[_0xe01b('0x34')]=_['keys'](_0x272bbf[_0xe01b('0x34')]);_0x59c5d2[_0xe01b('0x35')]=_[_0xe01b('0x36')](_0x59c5d2['model'],_0x59c5d2[_0xe01b('0x34')]);_0x170336[_0xe01b('0x37')]=_[_0xe01b('0x36')](_0x59c5d2[_0xe01b('0x33')],qs[_0xe01b('0x38')](_0x272bbf[_0xe01b('0x34')][_0xe01b('0x38')]));_0x170336['attributes']=_0x170336['attributes']['length']?_0x170336['attributes']:_0x59c5d2[_0xe01b('0x33')];if(!_0x272bbf[_0xe01b('0x34')]['hasOwnProperty'](_0xe01b('0x39'))){_0x170336[_0xe01b('0x20')]=qs[_0xe01b('0x20')](_0x272bbf[_0xe01b('0x34')][_0xe01b('0x20')]);_0x170336[_0xe01b('0x1f')]=qs[_0xe01b('0x1f')](_0x272bbf[_0xe01b('0x34')][_0xe01b('0x1f')]);}_0x170336[_0xe01b('0x3a')]=qs['sort'](_0x272bbf['query'][_0xe01b('0x3b')]);_0x170336[_0xe01b('0x3c')]=qs[_0xe01b('0x35')](_[_0xe01b('0x3d')](_0x272bbf['query'],_0x59c5d2[_0xe01b('0x35')]),_0xfd64f0);if(_0x272bbf[_0xe01b('0x34')][_0xe01b('0x3e')]){_0x170336[_0xe01b('0x3c')]=_[_0xe01b('0x3f')](_0x170336[_0xe01b('0x3c')],{'$or':_[_0xe01b('0x30')](_0xfd64f0,function(_0x44d90e){if(_0x44d90e['type']!==_0xe01b('0x40')){var _0x289c95={};_0x289c95[_0x44d90e[_0xe01b('0x2d')]]={'$like':'%'+_0x272bbf[_0xe01b('0x34')]['filter']+'%'};return _0x289c95;}})});}_0x170336=_[_0xe01b('0x3f')]({},_0x170336,_0x272bbf['options']);var _0x83dd89={'where':_0x170336['where']};return db[_0xe01b('0x31')][_0xe01b('0x1e')](_0x83dd89)['then'](function(_0x387f51){_0x22b961[_0xe01b('0x1e')]=_0x387f51;if(_0x272bbf['query'][_0xe01b('0x41')]){_0x170336[_0xe01b('0x42')]=[{'all':!![]}];}return db[_0xe01b('0x31')][_0xe01b('0x43')](_0x170336);})[_0xe01b('0x26')](function(_0x273d97){_0x22b961['rows']=_0x273d97;return _0x22b961;})[_0xe01b('0x26')](respondWithFilteredResult(_0x44f55c,_0x170336))['catch'](handleError(_0x44f55c,null));};exports['show']=function(_0x2b17bc,_0x416a92){var _0x28a2d2={'raw':![],'where':{'id':_0x2b17bc['params']['id']}},_0x4ebd3d={};_0x4ebd3d[_0xe01b('0x33')]=_['keys'](db[_0xe01b('0x31')][_0xe01b('0x44')]);_0x4ebd3d[_0xe01b('0x34')]=_['keys'](_0x2b17bc[_0xe01b('0x34')]);_0x4ebd3d[_0xe01b('0x35')]=_[_0xe01b('0x36')](_0x4ebd3d[_0xe01b('0x33')],_0x4ebd3d[_0xe01b('0x34')]);_0x28a2d2[_0xe01b('0x37')]=_[_0xe01b('0x36')](_0x4ebd3d[_0xe01b('0x33')],qs['fields'](_0x2b17bc['query'][_0xe01b('0x38')]));_0x28a2d2['attributes']=_0x28a2d2[_0xe01b('0x37')][_0xe01b('0x45')]?_0x28a2d2[_0xe01b('0x37')]:_0x4ebd3d['model'];if(_0x2b17bc[_0xe01b('0x34')][_0xe01b('0x41')]){_0x28a2d2['include']=[{'all':!![]}];}_0x28a2d2=_[_0xe01b('0x3f')]({},_0x28a2d2,_0x2b17bc[_0xe01b('0x46')]);return db[_0xe01b('0x31')]['find'](_0x28a2d2)[_0xe01b('0x26')](handleEntityNotFound(_0x416a92,null))[_0xe01b('0x26')](respondWithResult(_0x416a92,null))[_0xe01b('0x47')](handleError(_0x416a92,null));};exports['create']=function(_0x3727c6,_0x5223c8){return db['SquareProject'][_0xe01b('0x48')](_0x3727c6[_0xe01b('0x49')],{})['then'](function(_0x3d233c){var _0x23a3f1=_0x3727c6[_0xe01b('0x4a')][_0xe01b('0x28')]({'plain':!![]});if(!_0x23a3f1)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x23a3f1[_0xe01b('0x4b')]==='user'){var _0x462b19=_0x3d233c[_0xe01b('0x28')]({'plain':!![]});var _0x51dabc=_0xe01b('0x29');return db['UserProfileSection'][_0xe01b('0x4c')]({'where':{'name':_0x51dabc,'userProfileId':_0x23a3f1[_0xe01b('0x4d')]},'raw':!![]})[_0xe01b('0x26')](function(_0x2c46de){if(_0x2c46de&&_0x2c46de[_0xe01b('0x4e')]===0x0){return db[_0xe01b('0x2a')]['create']({'name':_0x462b19[_0xe01b('0x2d')],'resourceId':_0x462b19['id'],'type':_0x2c46de[_0xe01b('0x2d')],'sectionId':_0x2c46de['id']},{})['then'](function(){return _0x3d233c;});}else{return _0x3d233c;}})[_0xe01b('0x47')](function(_0x21cd58){logger[_0xe01b('0x2b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x21cd58);throw _0x21cd58;});}return _0x3d233c;})['then'](respondWithResult(_0x5223c8,0xc9))[_0xe01b('0x47')](handleError(_0x5223c8,null));};exports[_0xe01b('0x25')]=function(_0x5a398d,_0xf33cc4){if(_0x5a398d[_0xe01b('0x49')]['id']){delete _0x5a398d['body']['id'];}return db[_0xe01b('0x31')][_0xe01b('0x4c')]({'where':{'id':_0x5a398d[_0xe01b('0x4f')]['id']}})[_0xe01b('0x26')](handleEntityNotFound(_0xf33cc4,null))[_0xe01b('0x26')](saveUpdates(_0x5a398d[_0xe01b('0x49')],null))[_0xe01b('0x26')](respondWithResult(_0xf33cc4,null))['catch'](handleError(_0xf33cc4,null));};exports[_0xe01b('0x27')]=function(_0x1f4505,_0x1ec7d1){return db['SquareProject'][_0xe01b('0x4c')]({'where':{'id':_0x1f4505[_0xe01b('0x4f')]['id']}})[_0xe01b('0x26')](handleEntityNotFound(_0x1ec7d1,null))[_0xe01b('0x26')](removeEntity(_0x1ec7d1,null))[_0xe01b('0x47')](handleError(_0x1ec7d1,null));};exports['addUsers']=function(_0x4b78b0,_0x567f8d,_0x470d6a){return db['SquareProject'][_0xe01b('0x4c')]({'where':{'id':_0x4b78b0[_0xe01b('0x4f')]['id']}})['then'](handleEntityNotFound(_0x567f8d,null))['then'](function(_0x26fb59){if(_0x26fb59){return _0x26fb59[_0xe01b('0x50')](_0x4b78b0['body']['ids'],_[_0xe01b('0x51')](_0x4b78b0[_0xe01b('0x49')],['ids','id'])||{});}})[_0xe01b('0x26')](respondWithResult(_0x567f8d,null))[_0xe01b('0x47')](handleError(_0x567f8d,null));};exports[_0xe01b('0x52')]=function(_0x5b7774,_0x497807,_0x4560b4){return db[_0xe01b('0x31')][_0xe01b('0x4c')]({'where':{'id':_0x5b7774[_0xe01b('0x4f')]['id']}})[_0xe01b('0x26')](handleEntityNotFound(_0x497807,null))['then'](function(_0x5965cf){if(_0x5965cf){return _0x5965cf['removeUsers'](_0x5b7774[_0xe01b('0x34')]['ids'])[_0xe01b('0x26')](function(){if(_['isArray'](_0x5b7774['query'][_0xe01b('0x53')])){for(var _0x3b3ffd=0x0;_0x3b3ffd<_0x5b7774[_0xe01b('0x34')][_0xe01b('0x53')][_0xe01b('0x45')];_0x3b3ffd+=0x1){socket[_0xe01b('0x54')](_0xe01b('0x55'),{'UserId':Number(_0x5b7774[_0xe01b('0x34')][_0xe01b('0x53')][_0x3b3ffd]),'SquareProjectId':Number(_0x5b7774[_0xe01b('0x4f')]['id'])});}}else{socket[_0xe01b('0x54')]('userSquareProject:remove',{'UserId':Number(_0x5b7774[_0xe01b('0x34')][_0xe01b('0x53')]),'SquareProjectId':Number(_0x5b7774['params']['id'])});}});}})[_0xe01b('0x26')](respondWithStatusCode(_0x497807,null))['catch'](handleError(_0x497807,null));};exports[_0xe01b('0x56')]=function(_0x4044c5,_0x47f899,_0x9eced9){var _0x7375e3={};var _0x1803ea={};var _0x2e2b9f;var _0x220c66;return db['SquareProject']['findOne']({'where':{'id':_0x4044c5[_0xe01b('0x4f')]['id']}})['then'](handleEntityNotFound(_0x47f899,null))[_0xe01b('0x26')](function(_0x11f502){if(_0x11f502){_0x2e2b9f=_0x11f502;_0x1803ea[_0xe01b('0x33')]=_['keys'](db[_0xe01b('0x57')]['rawAttributes']);_0x1803ea[_0xe01b('0x34')]=_[_0xe01b('0x58')](_0x4044c5[_0xe01b('0x34')]);_0x1803ea[_0xe01b('0x35')]=_[_0xe01b('0x36')](_0x1803ea['model'],_0x1803ea[_0xe01b('0x34')]);_0x7375e3[_0xe01b('0x37')]=_[_0xe01b('0x36')](_0x1803ea['model'],qs[_0xe01b('0x38')](_0x4044c5['query'][_0xe01b('0x38')]));_0x7375e3[_0xe01b('0x37')]=_0x7375e3[_0xe01b('0x37')][_0xe01b('0x45')]?_0x7375e3[_0xe01b('0x37')]:_0x1803ea[_0xe01b('0x33')];_0x7375e3[_0xe01b('0x3a')]=qs[_0xe01b('0x3b')](_0x4044c5[_0xe01b('0x34')]['sort']);_0x7375e3[_0xe01b('0x3c')]=qs[_0xe01b('0x35')](_[_0xe01b('0x3d')](_0x4044c5['query'],_0x1803ea[_0xe01b('0x35')]));if(_0x4044c5['query']['filter']){_0x7375e3[_0xe01b('0x3c')]=_[_0xe01b('0x3f')](_0x7375e3[_0xe01b('0x3c')],{'$or':_[_0xe01b('0x30')](_0x7375e3['attributes'],function(_0x3094b6){var _0x5a0098={};_0x5a0098[_0x3094b6]={'$like':'%'+_0x4044c5[_0xe01b('0x34')][_0xe01b('0x3e')]+'%'};return _0x5a0098;})});}_0x7375e3=_['merge']({},_0x7375e3,_0x4044c5[_0xe01b('0x46')]);return _0x2e2b9f['getUsers'](_0x7375e3);}})[_0xe01b('0x26')](function(_0x1e58ae){if(_0x1e58ae){_0x220c66=_0x1e58ae[_0xe01b('0x45')];if(!_0x4044c5['query'][_0xe01b('0x59')](_0xe01b('0x39'))){_0x7375e3['limit']=qs[_0xe01b('0x20')](_0x4044c5[_0xe01b('0x34')][_0xe01b('0x20')]);_0x7375e3[_0xe01b('0x1f')]=qs['offset'](_0x4044c5['query'][_0xe01b('0x1f')]);}return _0x2e2b9f[_0xe01b('0x56')](_0x7375e3);}})[_0xe01b('0x26')](function(_0x26deed){if(_0x26deed){return _0x26deed?{'count':_0x220c66,'rows':_0x26deed}:null;}})[_0xe01b('0x26')](respondWithResult(_0x47f899,null))[_0xe01b('0x47')](handleError(_0x47f899,null));};
\ No newline at end of file
+var _0x28e0=['../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./squareProject.socket','register','status','count','limit','set','Content-Range','json','apply','reject','save','update','then','get','SquareProjects','UserProfileResource','end','sendStatus','stack','name','send','map','SquareProject','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','fields','length','offset','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','findAll','catch','show','params','intersection','find','create','body','user','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','destroy','addUsers','ids','omit','removeUsers','userSquareProject:remove','emit','getUsers','findOne','hasOwnProperty','nolimit','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','lodash','jsforce','desk.js','to-csv','querystring','papaparse'];(function(_0x556d3d,_0x4926ac){var _0x3f311e=function(_0x427981){while(--_0x427981){_0x556d3d['push'](_0x556d3d['shift']());}};_0x3f311e(++_0x4926ac);}(_0x28e0,0x16c));var _0x028e=function(_0x3e9bc8,_0x129a12){_0x3e9bc8=_0x3e9bc8-0x0;var _0x5b40b7=_0x28e0[_0x3e9bc8];return _0x5b40b7;};'use strict';var pdf=require(_0x028e('0x0'));var emlformat=require(_0x028e('0x1'));var rimraf=require(_0x028e('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x028e('0x3'));var rp=require(_0x028e('0x4'));var moment=require(_0x028e('0x5'));var BPromise=require(_0x028e('0x6'));var Mustache=require(_0x028e('0x7'));var util=require('util');var path=require(_0x028e('0x8'));var sox=require(_0x028e('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x028e('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x028e('0xb'));var deskjs=require(_0x028e('0xc'));var toCsv=require(_0x028e('0xd'));var querystring=require(_0x028e('0xe'));var Papa=require(_0x028e('0xf'));var Redis=require('ioredis');var authService=require(_0x028e('0x10'));var qs=require(_0x028e('0x11'));var as=require(_0x028e('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x028e('0x13'))('api');var utils=require(_0x028e('0x14'));var config=require(_0x028e('0x15'));var db=require(_0x028e('0x16'))['db'];config[_0x028e('0x17')]=_['defaults'](config[_0x028e('0x17')],{'host':_0x028e('0x18'),'port':0x18eb});var socket=require(_0x028e('0x19'))(new Redis(config[_0x028e('0x17')]));require(_0x028e('0x1a'))[_0x028e('0x1b')](socket);function respondWithStatusCode(_0x26723a,_0x15ab51){_0x15ab51=_0x15ab51||0xcc;return function(_0x20501e){if(_0x20501e){return _0x26723a['sendStatus'](_0x15ab51);}return _0x26723a[_0x028e('0x1c')](_0x15ab51)['end']();};}function respondWithResult(_0x423836,_0x3dcd93){_0x3dcd93=_0x3dcd93||0xc8;return function(_0x17a3f4){if(_0x17a3f4){return _0x423836[_0x028e('0x1c')](_0x3dcd93)['json'](_0x17a3f4);}};}function respondWithFilteredResult(_0x2db6a1,_0x1f2290){return function(_0x32cd88){if(_0x32cd88){var _0x4ef93c=_0x32cd88[_0x028e('0x1d')],_0x4827f6=_0x1f2290['offset'],_0x1b7c41=_0x1f2290['offset']+_0x1f2290[_0x028e('0x1e')],_0xcfba9a;if(_0x1b7c41>=_0x4ef93c){_0x1b7c41=_0x4ef93c;_0xcfba9a=0xc8;}else{_0xcfba9a=0xce;}_0x2db6a1['status'](_0xcfba9a);return _0x2db6a1[_0x028e('0x1f')](_0x028e('0x20'),_0x4827f6+'-'+_0x1b7c41+'/'+_0x4ef93c)[_0x028e('0x21')](_0x32cd88);}return null;};}function patchUpdates(_0x47d75c){return function(_0x517fcc){try{jsonpatch[_0x028e('0x22')](_0x517fcc,_0x47d75c,!![]);}catch(_0x3a4a6f){return BPromise[_0x028e('0x23')](_0x3a4a6f);}return _0x517fcc[_0x028e('0x24')]();};}function saveUpdates(_0x512be8,_0x558c5d){return function(_0x33e62f){if(_0x33e62f){return _0x33e62f[_0x028e('0x25')](_0x512be8)[_0x028e('0x26')](function(_0x7b5f60){return _0x7b5f60;});}return null;};}function removeEntity(_0x13a1b7,_0x16ffdf){return function(_0x388258){if(_0x388258){return _0x388258['destroy']()[_0x028e('0x26')](function(){var _0x51b734=_0x388258[_0x028e('0x27')]({'plain':!![]});var _0x3b27b2=_0x028e('0x28');return db[_0x028e('0x29')]['destroy']({'where':{'type':_0x3b27b2,'resourceId':_0x51b734['id']}})[_0x028e('0x26')](function(){return _0x388258;});})[_0x028e('0x26')](function(){_0x13a1b7['status'](0xcc)[_0x028e('0x2a')]();});}};}function handleEntityNotFound(_0x534166,_0x423f8d){return function(_0x4fda64){if(!_0x4fda64){_0x534166[_0x028e('0x2b')](0x194);}return _0x4fda64;};}function handleError(_0x595bb9,_0x34f5ec){_0x34f5ec=_0x34f5ec||0x1f4;return function(_0x3f14e9){logger['error'](_0x3f14e9[_0x028e('0x2c')]);if(_0x3f14e9['name']){delete _0x3f14e9[_0x028e('0x2d')];}_0x595bb9[_0x028e('0x1c')](_0x34f5ec)[_0x028e('0x2e')](_0x3f14e9);};}exports['index']=function(_0x33e09c,_0x503c38){var _0x2906f5={},_0x4a945a={},_0x2dc213={'count':0x0,'rows':[]};var _0x3272e0=_[_0x028e('0x2f')](db[_0x028e('0x30')][_0x028e('0x31')],function(_0x2051d8){return{'name':_0x2051d8[_0x028e('0x32')],'type':_0x2051d8[_0x028e('0x33')][_0x028e('0x34')]};});_0x4a945a[_0x028e('0x35')]=_[_0x028e('0x2f')](_0x3272e0,_0x028e('0x2d'));_0x4a945a[_0x028e('0x36')]=_[_0x028e('0x37')](_0x33e09c[_0x028e('0x36')]);_0x4a945a[_0x028e('0x38')]=_['intersection'](_0x4a945a[_0x028e('0x35')],_0x4a945a[_0x028e('0x36')]);_0x2906f5[_0x028e('0x39')]=_['intersection'](_0x4a945a[_0x028e('0x35')],qs[_0x028e('0x3a')](_0x33e09c[_0x028e('0x36')]['fields']));_0x2906f5[_0x028e('0x39')]=_0x2906f5[_0x028e('0x39')][_0x028e('0x3b')]?_0x2906f5[_0x028e('0x39')]:_0x4a945a[_0x028e('0x35')];if(!_0x33e09c[_0x028e('0x36')]['hasOwnProperty']('nolimit')){_0x2906f5[_0x028e('0x1e')]=qs[_0x028e('0x1e')](_0x33e09c[_0x028e('0x36')][_0x028e('0x1e')]);_0x2906f5['offset']=qs[_0x028e('0x3c')](_0x33e09c[_0x028e('0x36')][_0x028e('0x3c')]);}_0x2906f5[_0x028e('0x3d')]=qs[_0x028e('0x3e')](_0x33e09c[_0x028e('0x36')][_0x028e('0x3e')]);_0x2906f5[_0x028e('0x3f')]=qs[_0x028e('0x38')](_[_0x028e('0x40')](_0x33e09c[_0x028e('0x36')],_0x4a945a['filters']),_0x3272e0);if(_0x33e09c[_0x028e('0x36')]['filter']){_0x2906f5[_0x028e('0x3f')]=_[_0x028e('0x41')](_0x2906f5[_0x028e('0x3f')],{'$or':_['map'](_0x3272e0,function(_0x5ae1a8){if(_0x5ae1a8['type']!==_0x028e('0x42')){var _0x266f2f={};_0x266f2f[_0x5ae1a8[_0x028e('0x2d')]]={'$like':'%'+_0x33e09c['query'][_0x028e('0x43')]+'%'};return _0x266f2f;}})});}_0x2906f5=_[_0x028e('0x41')]({},_0x2906f5,_0x33e09c[_0x028e('0x44')]);var _0x4dacef={'where':_0x2906f5[_0x028e('0x3f')]};return db[_0x028e('0x30')][_0x028e('0x1d')](_0x4dacef)['then'](function(_0x384724){_0x2dc213[_0x028e('0x1d')]=_0x384724;if(_0x33e09c[_0x028e('0x36')][_0x028e('0x45')]){_0x2906f5['include']=[{'all':!![]}];}return db[_0x028e('0x30')][_0x028e('0x46')](_0x2906f5);})[_0x028e('0x26')](function(_0x2c16a6){_0x2dc213['rows']=_0x2c16a6;return _0x2dc213;})[_0x028e('0x26')](respondWithFilteredResult(_0x503c38,_0x2906f5))[_0x028e('0x47')](handleError(_0x503c38,null));};exports[_0x028e('0x48')]=function(_0x2050ab,_0x46aa77){var _0x2fdcf7={'raw':![],'where':{'id':_0x2050ab[_0x028e('0x49')]['id']}},_0xe51cb2={};_0xe51cb2[_0x028e('0x35')]=_['keys'](db[_0x028e('0x30')][_0x028e('0x31')]);_0xe51cb2['query']=_[_0x028e('0x37')](_0x2050ab[_0x028e('0x36')]);_0xe51cb2[_0x028e('0x38')]=_['intersection'](_0xe51cb2['model'],_0xe51cb2['query']);_0x2fdcf7[_0x028e('0x39')]=_[_0x028e('0x4a')](_0xe51cb2[_0x028e('0x35')],qs[_0x028e('0x3a')](_0x2050ab[_0x028e('0x36')][_0x028e('0x3a')]));_0x2fdcf7['attributes']=_0x2fdcf7[_0x028e('0x39')][_0x028e('0x3b')]?_0x2fdcf7['attributes']:_0xe51cb2[_0x028e('0x35')];if(_0x2050ab['query'][_0x028e('0x45')]){_0x2fdcf7['include']=[{'all':!![]}];}_0x2fdcf7=_['merge']({},_0x2fdcf7,_0x2050ab[_0x028e('0x44')]);return db[_0x028e('0x30')][_0x028e('0x4b')](_0x2fdcf7)[_0x028e('0x26')](handleEntityNotFound(_0x46aa77,null))['then'](respondWithResult(_0x46aa77,null))[_0x028e('0x47')](handleError(_0x46aa77,null));};exports[_0x028e('0x4c')]=function(_0x501f76,_0x4bf431){return db[_0x028e('0x30')][_0x028e('0x4c')](_0x501f76[_0x028e('0x4d')],{})[_0x028e('0x26')](function(_0x344fe8){var _0x1be858=_0x501f76[_0x028e('0x4e')][_0x028e('0x27')]({'plain':!![]});if(!_0x1be858)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1be858['role']==='user'){var _0x382652=_0x344fe8['get']({'plain':!![]});var _0x1d5e80=_0x028e('0x28');return db[_0x028e('0x4f')][_0x028e('0x4b')]({'where':{'name':_0x1d5e80,'userProfileId':_0x1be858[_0x028e('0x50')]},'raw':!![]})['then'](function(_0xbf350a){if(_0xbf350a&&_0xbf350a[_0x028e('0x51')]===0x0){return db[_0x028e('0x29')][_0x028e('0x4c')]({'name':_0x382652[_0x028e('0x2d')],'resourceId':_0x382652['id'],'type':_0xbf350a['name'],'sectionId':_0xbf350a['id']},{})[_0x028e('0x26')](function(){return _0x344fe8;});}else{return _0x344fe8;}})[_0x028e('0x47')](function(_0x59116f){logger[_0x028e('0x52')](_0x028e('0x53'),_0x59116f);throw _0x59116f;});}return _0x344fe8;})[_0x028e('0x26')](respondWithResult(_0x4bf431,0xc9))['catch'](handleError(_0x4bf431,null));};exports[_0x028e('0x25')]=function(_0x273195,_0x248f34){if(_0x273195[_0x028e('0x4d')]['id']){delete _0x273195[_0x028e('0x4d')]['id'];}return db['SquareProject'][_0x028e('0x4b')]({'where':{'id':_0x273195[_0x028e('0x49')]['id']}})[_0x028e('0x26')](handleEntityNotFound(_0x248f34,null))[_0x028e('0x26')](saveUpdates(_0x273195[_0x028e('0x4d')],null))[_0x028e('0x26')](respondWithResult(_0x248f34,null))['catch'](handleError(_0x248f34,null));};exports[_0x028e('0x54')]=function(_0x3db6f0,_0x93f749){return db[_0x028e('0x30')][_0x028e('0x4b')]({'where':{'id':_0x3db6f0[_0x028e('0x49')]['id']}})[_0x028e('0x26')](handleEntityNotFound(_0x93f749,null))['then'](removeEntity(_0x93f749,null))[_0x028e('0x47')](handleError(_0x93f749,null));};exports[_0x028e('0x55')]=function(_0x501a83,_0xf38493,_0x273f04){return db[_0x028e('0x30')][_0x028e('0x4b')]({'where':{'id':_0x501a83[_0x028e('0x49')]['id']}})[_0x028e('0x26')](handleEntityNotFound(_0xf38493,null))[_0x028e('0x26')](function(_0x6d9434){if(_0x6d9434){return _0x6d9434[_0x028e('0x55')](_0x501a83[_0x028e('0x4d')][_0x028e('0x56')],_[_0x028e('0x57')](_0x501a83[_0x028e('0x4d')],[_0x028e('0x56'),'id'])||{});}})[_0x028e('0x26')](respondWithResult(_0xf38493,null))[_0x028e('0x47')](handleError(_0xf38493,null));};exports[_0x028e('0x58')]=function(_0x492f64,_0x59641c,_0x53921c){return db[_0x028e('0x30')][_0x028e('0x4b')]({'where':{'id':_0x492f64[_0x028e('0x49')]['id']}})['then'](handleEntityNotFound(_0x59641c,null))[_0x028e('0x26')](function(_0x4efe7d){if(_0x4efe7d){return _0x4efe7d[_0x028e('0x58')](_0x492f64['query']['ids'])[_0x028e('0x26')](function(){if(_['isArray'](_0x492f64['query'][_0x028e('0x56')])){for(var _0xe5bdbf=0x0;_0xe5bdbf<_0x492f64['query'][_0x028e('0x56')][_0x028e('0x3b')];_0xe5bdbf+=0x1){socket['emit'](_0x028e('0x59'),{'UserId':Number(_0x492f64[_0x028e('0x36')][_0x028e('0x56')][_0xe5bdbf]),'SquareProjectId':Number(_0x492f64['params']['id'])});}}else{socket[_0x028e('0x5a')]('userSquareProject:remove',{'UserId':Number(_0x492f64[_0x028e('0x36')][_0x028e('0x56')]),'SquareProjectId':Number(_0x492f64[_0x028e('0x49')]['id'])});}});}})['then'](respondWithStatusCode(_0x59641c,null))['catch'](handleError(_0x59641c,null));};exports[_0x028e('0x5b')]=function(_0x29565a,_0x30e8ef,_0x105364){var _0x2cec2e={};var _0x307401={};var _0x5b4f55;var _0x308e53;return db[_0x028e('0x30')][_0x028e('0x5c')]({'where':{'id':_0x29565a['params']['id']}})['then'](handleEntityNotFound(_0x30e8ef,null))[_0x028e('0x26')](function(_0x450bc4){if(_0x450bc4){_0x5b4f55=_0x450bc4;_0x307401['model']=_[_0x028e('0x37')](db['User'][_0x028e('0x31')]);_0x307401['query']=_['keys'](_0x29565a['query']);_0x307401[_0x028e('0x38')]=_[_0x028e('0x4a')](_0x307401[_0x028e('0x35')],_0x307401[_0x028e('0x36')]);_0x2cec2e[_0x028e('0x39')]=_[_0x028e('0x4a')](_0x307401[_0x028e('0x35')],qs['fields'](_0x29565a[_0x028e('0x36')][_0x028e('0x3a')]));_0x2cec2e['attributes']=_0x2cec2e[_0x028e('0x39')][_0x028e('0x3b')]?_0x2cec2e[_0x028e('0x39')]:_0x307401['model'];_0x2cec2e['order']=qs['sort'](_0x29565a['query'][_0x028e('0x3e')]);_0x2cec2e[_0x028e('0x3f')]=qs[_0x028e('0x38')](_[_0x028e('0x40')](_0x29565a['query'],_0x307401['filters']));if(_0x29565a[_0x028e('0x36')][_0x028e('0x43')]){_0x2cec2e['where']=_[_0x028e('0x41')](_0x2cec2e[_0x028e('0x3f')],{'$or':_[_0x028e('0x2f')](_0x2cec2e['attributes'],function(_0x2caa68){var _0x13894c={};_0x13894c[_0x2caa68]={'$like':'%'+_0x29565a[_0x028e('0x36')][_0x028e('0x43')]+'%'};return _0x13894c;})});}_0x2cec2e=_[_0x028e('0x41')]({},_0x2cec2e,_0x29565a['options']);return _0x5b4f55[_0x028e('0x5b')](_0x2cec2e);}})[_0x028e('0x26')](function(_0x4c81c3){if(_0x4c81c3){_0x308e53=_0x4c81c3['length'];if(!_0x29565a[_0x028e('0x36')][_0x028e('0x5d')](_0x028e('0x5e'))){_0x2cec2e[_0x028e('0x1e')]=qs[_0x028e('0x1e')](_0x29565a[_0x028e('0x36')][_0x028e('0x1e')]);_0x2cec2e[_0x028e('0x3c')]=qs[_0x028e('0x3c')](_0x29565a['query'][_0x028e('0x3c')]);}return _0x5b4f55['getUsers'](_0x2cec2e);}})[_0x028e('0x26')](function(_0x46bd87){if(_0x46bd87){return _0x46bd87?{'count':_0x308e53,'rows':_0x46bd87}:null;}})[_0x028e('0x26')](respondWithResult(_0x30e8ef,null))['catch'](handleError(_0x30e8ef,null));};
\ No newline at end of file
diff --git a/server/api/squareProject/squareProject.events.js b/server/api/squareProject/squareProject.events.js
index d35c381..0f775d1 100644
--- a/server/api/squareProject/squareProject.events.js
+++ b/server/api/squareProject/squareProject.events.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x67a7=['hook','events','SquareProject','remove','emit'];(function(_0x599570,_0x460668){var _0x3d743f=function(_0x179db6){while(--_0x179db6){_0x599570['push'](_0x599570['shift']());}};_0x3d743f(++_0x460668);}(_0x67a7,0x19b));var _0x767a=function(_0x40f470,_0x3a5975){_0x40f470=_0x40f470-0x0;var _0x46ce5f=_0x67a7[_0x40f470];return _0x46ce5f;};'use strict';var EventEmitter=require(_0x767a('0x0'));var SquareProject=require('../../mysqldb')['db'][_0x767a('0x1')];var SquareProjectEvents=new EventEmitter();SquareProjectEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x767a('0x2')};function emitEvent(_0x1275e9){return function(_0x21308b,_0x14c394,_0x1121e6){SquareProjectEvents['emit'](_0x1275e9+':'+_0x21308b['id'],_0x21308b);SquareProjectEvents[_0x767a('0x3')](_0x1275e9,_0x21308b);_0x1121e6(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SquareProject[_0x767a('0x4')](e,emitEvent(event));}}module['exports']=SquareProjectEvents;
\ No newline at end of file
+var _0xe81d=['save','update','remove','emit','hook','exports','events','../../mysqldb','SquareProject','setMaxListeners'];(function(_0x3f4315,_0xd6ec89){var _0x5842e3=function(_0x4b12f5){while(--_0x4b12f5){_0x3f4315['push'](_0x3f4315['shift']());}};_0x5842e3(++_0xd6ec89);}(_0xe81d,0xc4));var _0xde81=function(_0x206345,_0x17d238){_0x206345=_0x206345-0x0;var _0x4dcd1e=_0xe81d[_0x206345];return _0x4dcd1e;};'use strict';var EventEmitter=require(_0xde81('0x0'));var SquareProject=require(_0xde81('0x1'))['db'][_0xde81('0x2')];var SquareProjectEvents=new EventEmitter();SquareProjectEvents[_0xde81('0x3')](0x0);var events={'afterCreate':_0xde81('0x4'),'afterUpdate':_0xde81('0x5'),'afterDestroy':_0xde81('0x6')};function emitEvent(_0x29d917){return function(_0x28698c,_0x5a50f7,_0x5e49e8){SquareProjectEvents[_0xde81('0x7')](_0x29d917+':'+_0x28698c['id'],_0x28698c);SquareProjectEvents[_0xde81('0x7')](_0x29d917,_0x28698c);_0x5e49e8(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SquareProject[_0xde81('0x8')](e,emitEvent(event));}}module[_0xde81('0x9')]=SquareProjectEvents;
\ No newline at end of file
diff --git a/server/api/squareProject/squareProject.model.js b/server/api/squareProject/squareProject.model.js
index 217f8be..4de4338 100644
--- a/server/api/squareProject/squareProject.model.js
+++ b/server/api/squareProject/squareProject.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x5f2f=['bluebird','request-promise','path','./squareProject.attributes','exports','define','SquareProject','lodash','util','../../config/logger','api','moment'];(function(_0x19136d,_0x26c252){var _0x18a48c=function(_0x2f6ad0){while(--_0x2f6ad0){_0x19136d['push'](_0x19136d['shift']());}};_0x18a48c(++_0x26c252);}(_0x5f2f,0x73));var _0xf5f2=function(_0x3372a6,_0x505699){_0x3372a6=_0x3372a6-0x0;var _0x77878=_0x5f2f[_0x3372a6];return _0x77878;};'use strict';var _=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var logger=require(_0xf5f2('0x2'))(_0xf5f2('0x3'));var moment=require(_0xf5f2('0x4'));var BPromise=require(_0xf5f2('0x5'));var rp=require(_0xf5f2('0x6'));var fs=require('fs');var path=require(_0xf5f2('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xf5f2('0x8'));module[_0xf5f2('0x9')]=function(_0xad7f65,_0x3eebf6){return _0xad7f65[_0xf5f2('0xa')](_0xf5f2('0xb'),attributes,{'tableName':'square_projects','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x5f66=['request-promise','path','../../config/environment','exports','SquareProject','square_projects','util','api','moment','bluebird'];(function(_0x4e9628,_0x250573){var _0x27bc8c=function(_0xb3b7ae){while(--_0xb3b7ae){_0x4e9628['push'](_0x4e9628['shift']());}};_0x27bc8c(++_0x250573);}(_0x5f66,0x1a0));var _0x65f6=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x5f66[_0x2f5ac5];return _0x37c9a8;};'use strict';var _=require('lodash');var util=require(_0x65f6('0x0'));var logger=require('../../config/logger')(_0x65f6('0x1'));var moment=require(_0x65f6('0x2'));var BPromise=require(_0x65f6('0x3'));var rp=require(_0x65f6('0x4'));var fs=require('fs');var path=require(_0x65f6('0x5'));var rimraf=require('rimraf');var config=require(_0x65f6('0x6'));var attributes=require('./squareProject.attributes');module[_0x65f6('0x7')]=function(_0x22b017,_0x4ec221){return _0x22b017['define'](_0x65f6('0x8'),attributes,{'tableName':_0x65f6('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/squareProject/squareProject.rpc.js b/server/api/squareProject/squareProject.rpc.js
index ebc211b..5066376 100644
--- a/server/api/squareProject/squareProject.rpc.js
+++ b/server/api/squareProject/squareProject.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xbdbd=['map','attributes','lodash','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./squareProject.socket','register','request','then','info','SquareProject,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','ShowSquareProject','find','options','raw','where','include','model'];(function(_0x3730b1,_0x28a04b){var _0x2a75db=function(_0x348b9b){while(--_0x348b9b){_0x3730b1['push'](_0x3730b1['shift']());}};_0x2a75db(++_0x28a04b);}(_0xbdbd,0xda));var _0xdbdb=function(_0x1cba9b,_0x2cfcb4){_0x1cba9b=_0x1cba9b-0x0;var _0xbafdda=_0xbdbd[_0x1cba9b];return _0xbafdda;};'use strict';var _=require(_0xdbdb('0x0'));var util=require('util');var moment=require(_0xdbdb('0x1'));var BPromise=require(_0xdbdb('0x2'));var rs=require(_0xdbdb('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xdbdb('0x4'));var logger=require(_0xdbdb('0x5'))(_0xdbdb('0x6'));var config=require(_0xdbdb('0x7'));var jayson=require(_0xdbdb('0x8'));var client=jayson[_0xdbdb('0x9')][_0xdbdb('0xa')]({'port':0x232a});config[_0xdbdb('0xb')]=_[_0xdbdb('0xc')](config[_0xdbdb('0xb')],{'host':_0xdbdb('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xdbdb('0xb')]));require(_0xdbdb('0xe'))[_0xdbdb('0xf')](socket);function respondWithRpcPromise(_0x437c4a,_0xe31d77,_0x2dcdbd){return new BPromise(function(_0x4b938e,_0x2a2ade){return client[_0xdbdb('0x10')](_0x437c4a,_0x2dcdbd)[_0xdbdb('0x11')](function(_0xdf4c53){logger[_0xdbdb('0x12')](_0xdbdb('0x13'),_0xe31d77,_0xdbdb('0x14'));logger['debug']('SquareProject,\x20%s,\x20%s,\x20%s',_0xe31d77,_0xdbdb('0x14'),JSON[_0xdbdb('0x15')](_0xdf4c53));if(_0xdf4c53[_0xdbdb('0x16')]){if(_0xdf4c53[_0xdbdb('0x16')][_0xdbdb('0x17')]===0x1f4){logger[_0xdbdb('0x16')]('SquareProject,\x20%s,\x20%s',_0xe31d77,_0xdf4c53['error'][_0xdbdb('0x18')]);return _0x2a2ade(_0xdf4c53[_0xdbdb('0x16')][_0xdbdb('0x18')]);}logger[_0xdbdb('0x16')](_0xdbdb('0x13'),_0xe31d77,_0xdf4c53['error'][_0xdbdb('0x18')]);return _0x4b938e(_0xdf4c53[_0xdbdb('0x16')][_0xdbdb('0x18')]);}else{logger[_0xdbdb('0x12')]('SquareProject,\x20%s,\x20%s',_0xe31d77,_0xdbdb('0x14'));_0x4b938e(_0xdf4c53[_0xdbdb('0x19')][_0xdbdb('0x18')]);}})[_0xdbdb('0x1a')](function(_0x9e8ff8){logger[_0xdbdb('0x16')](_0xdbdb('0x13'),_0xe31d77,_0x9e8ff8);_0x2a2ade(_0x9e8ff8);});});}exports[_0xdbdb('0x1b')]=function(_0x7e4b14){var _0xc8cb8f=this;return new Promise(function(_0xc0f741,_0x4fe40a){return db['SquareProject'][_0xdbdb('0x1c')]({'raw':_0x7e4b14['options']?_0x7e4b14[_0xdbdb('0x1d')][_0xdbdb('0x1e')]===undefined?!![]:![]:!![],'where':_0x7e4b14[_0xdbdb('0x1d')]?_0x7e4b14[_0xdbdb('0x1d')][_0xdbdb('0x1f')]||null:null,'attributes':_0x7e4b14[_0xdbdb('0x1d')]?_0x7e4b14[_0xdbdb('0x1d')]['attributes']||null:null,'include':_0x7e4b14[_0xdbdb('0x1d')]?_0x7e4b14[_0xdbdb('0x1d')][_0xdbdb('0x20')]?_['map'](_0x7e4b14[_0xdbdb('0x1d')][_0xdbdb('0x20')],function(_0x5f0186){return{'model':db[_0x5f0186[_0xdbdb('0x21')]],'as':_0x5f0186['as'],'attributes':_0x5f0186['attributes'],'include':_0x5f0186[_0xdbdb('0x20')]?_[_0xdbdb('0x22')](_0x5f0186[_0xdbdb('0x20')],function(_0x267ead){return{'model':db[_0x267ead[_0xdbdb('0x21')]],'as':_0x267ead['as'],'attributes':_0x267ead[_0xdbdb('0x23')],'include':_0x267ead[_0xdbdb('0x20')]?_[_0xdbdb('0x22')](_0x267ead[_0xdbdb('0x20')],function(_0x29b7ee){return{'model':db[_0x29b7ee[_0xdbdb('0x21')]],'as':_0x29b7ee['as'],'attributes':_0x29b7ee[_0xdbdb('0x23')]};}):[]};}):[]};}):[]:[]})[_0xdbdb('0x11')](function(_0x91d8f5){logger[_0xdbdb('0x12')](_0xdbdb('0x1b'),_0x7e4b14);logger['debug'](_0xdbdb('0x1b'),_0x7e4b14,JSON[_0xdbdb('0x15')](_0x91d8f5));_0xc0f741(_0x91d8f5);})[_0xdbdb('0x1a')](function(_0x50a78e){logger[_0xdbdb('0x16')](_0xdbdb('0x1b'),_0x50a78e[_0xdbdb('0x18')],_0x7e4b14);_0x4fe40a(_0xc8cb8f[_0xdbdb('0x16')](0x1f4,_0x50a78e[_0xdbdb('0x18')]));});});};
\ No newline at end of file
+var _0x7b68=['defaults','localhost','socket.io-emitter','redis','register','request','info','SquareProject,\x20%s,\x20%s','request\x20sent','SquareProject,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','ShowSquareProject','SquareProject','find','options','raw','where','include','model','attributes','map','then','debug','lodash','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x5a359a,_0x8af0d0){var _0x117628=function(_0x2d86c0){while(--_0x2d86c0){_0x5a359a['push'](_0x5a359a['shift']());}};_0x117628(++_0x8af0d0);}(_0x7b68,0x1ef));var _0x87b6=function(_0x2da771,_0x588294){_0x2da771=_0x2da771-0x0;var _0x431934=_0x7b68[_0x2da771];return _0x431934;};'use strict';var _=require(_0x87b6('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x87b6('0x1'));var db=require('../../mysqldb')['db'];var utils=require(_0x87b6('0x2'));var logger=require(_0x87b6('0x3'))(_0x87b6('0x4'));var config=require(_0x87b6('0x5'));var jayson=require(_0x87b6('0x6'));var client=jayson[_0x87b6('0x7')][_0x87b6('0x8')]({'port':0x232a});config['redis']=_[_0x87b6('0x9')](config['redis'],{'host':_0x87b6('0xa'),'port':0x18eb});var socket=require(_0x87b6('0xb'))(new Redis(config[_0x87b6('0xc')]));require('./squareProject.socket')[_0x87b6('0xd')](socket);function respondWithRpcPromise(_0x4d36db,_0xd37c84,_0x38c965){return new BPromise(function(_0x4bcef3,_0x5067b3){return client[_0x87b6('0xe')](_0x4d36db,_0x38c965)['then'](function(_0x37e4a7){logger[_0x87b6('0xf')](_0x87b6('0x10'),_0xd37c84,_0x87b6('0x11'));logger['debug'](_0x87b6('0x12'),_0xd37c84,_0x87b6('0x11'),JSON[_0x87b6('0x13')](_0x37e4a7));if(_0x37e4a7['error']){if(_0x37e4a7[_0x87b6('0x14')][_0x87b6('0x15')]===0x1f4){logger[_0x87b6('0x14')]('SquareProject,\x20%s,\x20%s',_0xd37c84,_0x37e4a7[_0x87b6('0x14')]['message']);return _0x5067b3(_0x37e4a7[_0x87b6('0x14')]['message']);}logger[_0x87b6('0x14')]('SquareProject,\x20%s,\x20%s',_0xd37c84,_0x37e4a7['error'][_0x87b6('0x16')]);return _0x4bcef3(_0x37e4a7[_0x87b6('0x14')]['message']);}else{logger['info']('SquareProject,\x20%s,\x20%s',_0xd37c84,'request\x20sent');_0x4bcef3(_0x37e4a7['result']['message']);}})[_0x87b6('0x17')](function(_0xf17cf4){logger['error']('SquareProject,\x20%s,\x20%s',_0xd37c84,_0xf17cf4);_0x5067b3(_0xf17cf4);});});}exports[_0x87b6('0x18')]=function(_0x2f72dd){var _0x1f8edf=this;return new Promise(function(_0x1016d2,_0x4bdd69){return db[_0x87b6('0x19')][_0x87b6('0x1a')]({'raw':_0x2f72dd[_0x87b6('0x1b')]?_0x2f72dd[_0x87b6('0x1b')][_0x87b6('0x1c')]===undefined?!![]:![]:!![],'where':_0x2f72dd[_0x87b6('0x1b')]?_0x2f72dd[_0x87b6('0x1b')][_0x87b6('0x1d')]||null:null,'attributes':_0x2f72dd[_0x87b6('0x1b')]?_0x2f72dd['options']['attributes']||null:null,'include':_0x2f72dd[_0x87b6('0x1b')]?_0x2f72dd[_0x87b6('0x1b')][_0x87b6('0x1e')]?_['map'](_0x2f72dd[_0x87b6('0x1b')][_0x87b6('0x1e')],function(_0x425a8b){return{'model':db[_0x425a8b[_0x87b6('0x1f')]],'as':_0x425a8b['as'],'attributes':_0x425a8b[_0x87b6('0x20')],'include':_0x425a8b[_0x87b6('0x1e')]?_['map'](_0x425a8b[_0x87b6('0x1e')],function(_0x1df602){return{'model':db[_0x1df602[_0x87b6('0x1f')]],'as':_0x1df602['as'],'attributes':_0x1df602[_0x87b6('0x20')],'include':_0x1df602[_0x87b6('0x1e')]?_[_0x87b6('0x21')](_0x1df602[_0x87b6('0x1e')],function(_0x556494){return{'model':db[_0x556494[_0x87b6('0x1f')]],'as':_0x556494['as'],'attributes':_0x556494[_0x87b6('0x20')]};}):[]};}):[]};}):[]:[]})[_0x87b6('0x22')](function(_0x49d665){logger[_0x87b6('0xf')](_0x87b6('0x18'),_0x2f72dd);logger[_0x87b6('0x23')](_0x87b6('0x18'),_0x2f72dd,JSON['stringify'](_0x49d665));_0x1016d2(_0x49d665);})[_0x87b6('0x17')](function(_0x1e3d55){logger[_0x87b6('0x14')](_0x87b6('0x18'),_0x1e3d55['message'],_0x2f72dd);_0x4bdd69(_0x1f8edf['error'](0x1f4,_0x1e3d55[_0x87b6('0x16')]));});});};
\ No newline at end of file
diff --git a/server/api/squareProject/squareProject.socket.js b/server/api/squareProject/squareProject.socket.js
index 9d56a49..b88cdd5 100644
--- a/server/api/squareProject/squareProject.socket.js
+++ b/server/api/squareProject/squareProject.socket.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xd117=['save','remove','update','emit','removeListener','register','length','squareProject:','./squareProject.events'];(function(_0xd1f7b,_0x3e0b8f){var _0x73f284=function(_0x23cde2){while(--_0x23cde2){_0xd1f7b['push'](_0xd1f7b['shift']());}};_0x73f284(++_0x3e0b8f);}(_0xd117,0x182));var _0x7d11=function(_0x496590,_0x3426e9){_0x496590=_0x496590-0x0;var _0x585ebc=_0xd117[_0x496590];return _0x585ebc;};'use strict';var SquareProjectEvents=require(_0x7d11('0x0'));var events=[_0x7d11('0x1'),_0x7d11('0x2'),_0x7d11('0x3')];function createListener(_0x454387,_0x26e0f0){return function(_0x306ae4){_0x26e0f0[_0x7d11('0x4')](_0x454387,_0x306ae4);};}function removeListener(_0x3c07be,_0x31fcb0){return function(){SquareProjectEvents[_0x7d11('0x5')](_0x3c07be,_0x31fcb0);};}exports[_0x7d11('0x6')]=function(_0x27d7e8){for(var _0x40c3c4=0x0,_0x345602=events[_0x7d11('0x7')];_0x40c3c4<_0x345602;_0x40c3c4++){var _0x47b5e6=events[_0x40c3c4];var _0x3803b5=createListener(_0x7d11('0x8')+_0x47b5e6,_0x27d7e8);SquareProjectEvents['on'](_0x47b5e6,_0x3803b5);}};
\ No newline at end of file
+var _0xc6ac=['removeListener','register','length','./squareProject.events','save','remove','update','emit'];(function(_0x57d281,_0x4def7c){var _0xa1e355=function(_0x4e9f52){while(--_0x4e9f52){_0x57d281['push'](_0x57d281['shift']());}};_0xa1e355(++_0x4def7c);}(_0xc6ac,0x15b));var _0xcc6a=function(_0x3fe4d4,_0x378a0c){_0x3fe4d4=_0x3fe4d4-0x0;var _0x301872=_0xc6ac[_0x3fe4d4];return _0x301872;};'use strict';var SquareProjectEvents=require(_0xcc6a('0x0'));var events=[_0xcc6a('0x1'),_0xcc6a('0x2'),_0xcc6a('0x3')];function createListener(_0x276972,_0x279d85){return function(_0x17d786){_0x279d85[_0xcc6a('0x4')](_0x276972,_0x17d786);};}function removeListener(_0x297643,_0x22ee99){return function(){SquareProjectEvents[_0xcc6a('0x5')](_0x297643,_0x22ee99);};}exports[_0xcc6a('0x6')]=function(_0x12330e){for(var _0x197bd7=0x0,_0x5f3887=events[_0xcc6a('0x7')];_0x197bd7<_0x5f3887;_0x197bd7++){var _0x11b919=events[_0x197bd7];var _0xf02261=createListener('squareProject:'+_0x11b919,_0x12330e);SquareProjectEvents['on'](_0x11b919,_0xf02261);}};
\ No newline at end of file
diff --git a/server/api/squareRecording/index.js b/server/api/squareRecording/index.js
index acbf1da..a828c77 100644
--- a/server/api/squareRecording/index.js
+++ b/server/api/squareRecording/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x2dbb=['update','delete','/:id/delete','destroy','exports','multer','util','path','express','Router','../../config/environment','./squareRecording.controller','isAuthenticated','index','/:id','show','download','post','create','put'];(function(_0x122450,_0x3e7b54){var _0x1617bd=function(_0x8b1abf){while(--_0x8b1abf){_0x122450['push'](_0x122450['shift']());}};_0x1617bd(++_0x3e7b54);}(_0x2dbb,0x7d));var _0xb2db=function(_0x4bd24c,_0x482453){_0x4bd24c=_0x4bd24c-0x0;var _0x5d7acc=_0x2dbb[_0x4bd24c];return _0x5d7acc;};'use strict';var multer=require(_0xb2db('0x0'));var util=require(_0xb2db('0x1'));var path=require(_0xb2db('0x2'));var timeout=require('connect-timeout');var express=require(_0xb2db('0x3'));var router=express[_0xb2db('0x4')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xb2db('0x5'));var controller=require(_0xb2db('0x6'));router['get']('/',auth[_0xb2db('0x7')](),controller[_0xb2db('0x8')]);router['get'](_0xb2db('0x9'),auth[_0xb2db('0x7')](),controller[_0xb2db('0xa')]);router['get']('/:id/download',auth[_0xb2db('0x7')](),controller[_0xb2db('0xb')]);router[_0xb2db('0xc')]('/',auth[_0xb2db('0x7')](),controller[_0xb2db('0xd')]);router[_0xb2db('0xe')](_0xb2db('0x9'),auth[_0xb2db('0x7')](),controller[_0xb2db('0xf')]);router[_0xb2db('0x10')](_0xb2db('0x11'),auth[_0xb2db('0x7')](),controller[_0xb2db('0x12')]);module[_0xb2db('0x13')]=router;
\ No newline at end of file
+var _0x9114=['post','create','put','/:id','update','delete','/:id/delete','destroy','exports','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareRecording.controller','get','isAuthenticated','show','download'];(function(_0x4a5bd9,_0x1a2b17){var _0x5f2d05=function(_0xb9cb02){while(--_0xb9cb02){_0x4a5bd9['push'](_0x4a5bd9['shift']());}};_0x5f2d05(++_0x1a2b17);}(_0x9114,0x9c));var _0x4911=function(_0x4f7418,_0x193595){_0x4f7418=_0x4f7418-0x0;var _0x4c2e31=_0x9114[_0x4f7418];return _0x4c2e31;};'use strict';var multer=require('multer');var util=require(_0x4911('0x0'));var path=require(_0x4911('0x1'));var timeout=require(_0x4911('0x2'));var express=require(_0x4911('0x3'));var router=express['Router']();var auth=require(_0x4911('0x4'));var interaction=require(_0x4911('0x5'));var config=require(_0x4911('0x6'));var controller=require(_0x4911('0x7'));router[_0x4911('0x8')]('/',auth[_0x4911('0x9')](),controller['index']);router[_0x4911('0x8')]('/:id',auth[_0x4911('0x9')](),controller[_0x4911('0xa')]);router[_0x4911('0x8')]('/:id/download',auth[_0x4911('0x9')](),controller[_0x4911('0xb')]);router[_0x4911('0xc')]('/',auth[_0x4911('0x9')](),controller[_0x4911('0xd')]);router[_0x4911('0xe')](_0x4911('0xf'),auth[_0x4911('0x9')](),controller[_0x4911('0x10')]);router[_0x4911('0x11')](_0x4911('0x12'),auth[_0x4911('0x9')](),controller[_0x4911('0x13')]);module[_0x4911('0x14')]=router;
\ No newline at end of file
diff --git a/server/api/squareRecording/squareRecording.attributes.js b/server/api/squareRecording/squareRecording.attributes.js
index 3bf1f86..1e2b24d 100644
--- a/server/api/squareRecording/squareRecording.attributes.js
+++ b/server/api/squareRecording/squareRecording.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x51db=['savePath','sequelize','exports','STRING','VIRTUAL','getDataValue'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x51db,0xb5));var _0xb51d=function(_0x3e7e4b,_0x57fbc5){_0x3e7e4b=_0x3e7e4b-0x0;var _0x17adc3=_0x51db[_0x3e7e4b];return _0x17adc3;};'use strict';var Sequelize=require(_0xb51d('0x0'));module[_0xb51d('0x1')]={'uniqueid':{'type':Sequelize[_0xb51d('0x2')]},'callerid':{'type':Sequelize[_0xb51d('0x2')]},'calleridname':{'type':Sequelize[_0xb51d('0x2')]},'context':{'type':Sequelize[_0xb51d('0x2')]},'extension':{'type':Sequelize['STRING']},'priority':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0xb51d('0x2')]},'dnid':{'type':Sequelize[_0xb51d('0x2')]},'projectName':{'type':Sequelize[_0xb51d('0x2')]},'saveName':{'type':Sequelize[_0xb51d('0x2')]},'filename':{'type':Sequelize[_0xb51d('0x2')]},'savePath':{'type':Sequelize[_0xb51d('0x2')]},'format':{'type':Sequelize[_0xb51d('0x3')],'get':function(){var _0x518cab='';var _0x408d5e=this[_0xb51d('0x4')](_0xb51d('0x5'));if(_0x408d5e){_0x518cab=_0x408d5e['substring'](_0x408d5e['lastIndexOf']('.'));}return _0x518cab;}}};
\ No newline at end of file
+var _0x4d28=['sequelize','exports','STRING','substring','lastIndexOf'];(function(_0x466282,_0x4527f0){var _0x12dee9=function(_0x2a7991){while(--_0x2a7991){_0x466282['push'](_0x466282['shift']());}};_0x12dee9(++_0x4527f0);}(_0x4d28,0x69));var _0x84d2=function(_0x45ccd2,_0x4ecb10){_0x45ccd2=_0x45ccd2-0x0;var _0x554dff=_0x4d28[_0x45ccd2];return _0x554dff;};'use strict';var Sequelize=require(_0x84d2('0x0'));module[_0x84d2('0x1')]={'uniqueid':{'type':Sequelize[_0x84d2('0x2')]},'callerid':{'type':Sequelize[_0x84d2('0x2')]},'calleridname':{'type':Sequelize[_0x84d2('0x2')]},'context':{'type':Sequelize[_0x84d2('0x2')]},'extension':{'type':Sequelize[_0x84d2('0x2')]},'priority':{'type':Sequelize[_0x84d2('0x2')]},'accountcode':{'type':Sequelize[_0x84d2('0x2')]},'dnid':{'type':Sequelize['STRING']},'projectName':{'type':Sequelize[_0x84d2('0x2')]},'saveName':{'type':Sequelize[_0x84d2('0x2')]},'filename':{'type':Sequelize[_0x84d2('0x2')]},'savePath':{'type':Sequelize[_0x84d2('0x2')]},'format':{'type':Sequelize['VIRTUAL'],'get':function(){var _0xd343b2='';var _0x2c6c66=this['getDataValue']('savePath');if(_0x2c6c66){_0xd343b2=_0x2c6c66[_0x84d2('0x3')](_0x2c6c66[_0x84d2('0x4')]('.'));}return _0xd343b2;}}};
\ No newline at end of file
diff --git a/server/api/squareRecording/squareRecording.controller.js b/server/api/squareRecording/squareRecording.controller.js
index 0eaaa30..7b52815 100644
--- a/server/api/squareRecording/squareRecording.controller.js
+++ b/server/api/squareRecording/squareRecording.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x0f12=['Entity\x20not\x20found','info','isNil','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','File:\x20\x22','html-pdf','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','count','offset','limit','set','Content-Range','json','apply','reject','update','then','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','query','keys','model','attributes','intersection','fields','length','order','sort','where','filters','filter','VIRTUAL','merge','SquareRecording','includeAll','include','findAll','rows','show','params','options','find','create','body','catch','../../components/encryptor','uniqueid','savePath','%s.cypher','existsSync','decryptFile','secrets','recording','Sequelize','SquareRecording\x20not\x20found','filename','download','extname','unlink','message','destroy'];(function(_0x6719b,_0x468a3a){var _0xffd93e=function(_0x264e60){while(--_0x264e60){_0x6719b['push'](_0x6719b['shift']());}};_0xffd93e(++_0x468a3a);}(_0x0f12,0x127));var _0x20f1=function(_0x158581,_0x41ecca){_0x158581=_0x158581-0x0;var _0x1a774a=_0x0f12[_0x158581];return _0x1a774a;};'use strict';var pdf=require(_0x20f1('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x20f1('0x1'));var zipdir=require(_0x20f1('0x2'));var jsonpatch=require(_0x20f1('0x3'));var rp=require('request-promise');var moment=require(_0x20f1('0x4'));var BPromise=require(_0x20f1('0x5'));var Mustache=require(_0x20f1('0x6'));var util=require('util');var path=require(_0x20f1('0x7'));var sox=require(_0x20f1('0x8'));var csv=require(_0x20f1('0x9'));var ejs=require(_0x20f1('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0x20f1('0xb'));var crypto=require('crypto');var jsforce=require(_0x20f1('0xc'));var deskjs=require(_0x20f1('0xd'));var toCsv=require(_0x20f1('0x9'));var querystring=require(_0x20f1('0xe'));var Papa=require(_0x20f1('0xf'));var Redis=require('ioredis');var authService=require(_0x20f1('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x20f1('0x11'));var hardwareService=require(_0x20f1('0x12'));var logger=require(_0x20f1('0x13'))(_0x20f1('0x14'));var utils=require(_0x20f1('0x15'));var config=require(_0x20f1('0x16'));var db=require(_0x20f1('0x17'))['db'];function respondWithStatusCode(_0x230fcc,_0x3577fd){_0x3577fd=_0x3577fd||0xcc;return function(_0x3ef14c){if(_0x3ef14c){return _0x230fcc[_0x20f1('0x18')](_0x3577fd);}return _0x230fcc[_0x20f1('0x19')](_0x3577fd)[_0x20f1('0x1a')]();};}function respondWithResult(_0x35d191,_0x1ad3c6){_0x1ad3c6=_0x1ad3c6||0xc8;return function(_0x3c2b29){if(_0x3c2b29){return _0x35d191['status'](_0x1ad3c6)['json'](_0x3c2b29);}};}function respondWithFilteredResult(_0x2914ab,_0x2780cf){return function(_0x55c954){if(_0x55c954){var _0x3d89c7=_0x55c954[_0x20f1('0x1b')],_0x22412b=_0x2780cf[_0x20f1('0x1c')],_0x3a1d1e=_0x2780cf[_0x20f1('0x1c')]+_0x2780cf[_0x20f1('0x1d')],_0x578f50;if(_0x3a1d1e>=_0x3d89c7){_0x3a1d1e=_0x3d89c7;_0x578f50=0xc8;}else{_0x578f50=0xce;}_0x2914ab[_0x20f1('0x19')](_0x578f50);return _0x2914ab[_0x20f1('0x1e')](_0x20f1('0x1f'),_0x22412b+'-'+_0x3a1d1e+'/'+_0x3d89c7)[_0x20f1('0x20')](_0x55c954);}return null;};}function patchUpdates(_0xee8019){return function(_0x5dca32){try{jsonpatch[_0x20f1('0x21')](_0x5dca32,_0xee8019,!![]);}catch(_0x2c4b86){return BPromise[_0x20f1('0x22')](_0x2c4b86);}return _0x5dca32['save']();};}function saveUpdates(_0xaf610e,_0xf9ae2b){return function(_0x38e69c){if(_0x38e69c){return _0x38e69c[_0x20f1('0x23')](_0xaf610e)['then'](function(_0x160b96){return _0x160b96;});}return null;};}function removeEntity(_0x88d726,_0x1db8cd){return function(_0x2a0aed){if(_0x2a0aed){return _0x2a0aed['destroy']()[_0x20f1('0x24')](function(){_0x88d726[_0x20f1('0x19')](0xcc)[_0x20f1('0x1a')]();});}};}function handleEntityNotFound(_0x45976e,_0x21895a){return function(_0x41b2a9){if(!_0x41b2a9){_0x45976e[_0x20f1('0x18')](0x194);}return _0x41b2a9;};}function handleError(_0x46966a,_0xeda2ae){_0xeda2ae=_0xeda2ae||0x1f4;return function(_0x32a39c){logger[_0x20f1('0x25')](_0x32a39c[_0x20f1('0x26')]);if(_0x32a39c[_0x20f1('0x27')]){delete _0x32a39c[_0x20f1('0x27')];}_0x46966a[_0x20f1('0x19')](_0xeda2ae)[_0x20f1('0x28')](_0x32a39c);};}exports[_0x20f1('0x29')]=function(_0x2fd32b,_0x13deb7){var _0x323b29={},_0x5ee576={},_0x47ede8={'count':0x0,'rows':[]};var _0x3cc417=_[_0x20f1('0x2a')](db['SquareRecording'][_0x20f1('0x2b')],function(_0x263874){return{'name':_0x263874[_0x20f1('0x2c')],'type':_0x263874[_0x20f1('0x2d')][_0x20f1('0x2e')]};});_0x5ee576['model']=_[_0x20f1('0x2a')](_0x3cc417,'name');_0x5ee576[_0x20f1('0x2f')]=_[_0x20f1('0x30')](_0x2fd32b[_0x20f1('0x2f')]);_0x5ee576['filters']=_['intersection'](_0x5ee576[_0x20f1('0x31')],_0x5ee576[_0x20f1('0x2f')]);_0x323b29[_0x20f1('0x32')]=_[_0x20f1('0x33')](_0x5ee576[_0x20f1('0x31')],qs[_0x20f1('0x34')](_0x2fd32b[_0x20f1('0x2f')][_0x20f1('0x34')]));_0x323b29[_0x20f1('0x32')]=_0x323b29[_0x20f1('0x32')][_0x20f1('0x35')]?_0x323b29['attributes']:_0x5ee576['model'];if(!_0x2fd32b['query']['hasOwnProperty']('nolimit')){_0x323b29[_0x20f1('0x1d')]=qs[_0x20f1('0x1d')](_0x2fd32b[_0x20f1('0x2f')]['limit']);_0x323b29[_0x20f1('0x1c')]=qs[_0x20f1('0x1c')](_0x2fd32b[_0x20f1('0x2f')][_0x20f1('0x1c')]);}_0x323b29[_0x20f1('0x36')]=qs[_0x20f1('0x37')](_0x2fd32b[_0x20f1('0x2f')]['sort']);_0x323b29[_0x20f1('0x38')]=qs['filters'](_['pick'](_0x2fd32b[_0x20f1('0x2f')],_0x5ee576[_0x20f1('0x39')]),_0x3cc417);if(_0x2fd32b[_0x20f1('0x2f')][_0x20f1('0x3a')]){_0x323b29['where']=_['merge'](_0x323b29[_0x20f1('0x38')],{'$or':_[_0x20f1('0x2a')](_0x3cc417,function(_0x130db8){if(_0x130db8[_0x20f1('0x2d')]!==_0x20f1('0x3b')){var _0x12858b={};_0x12858b[_0x130db8[_0x20f1('0x27')]]={'$like':'%'+_0x2fd32b['query']['filter']+'%'};return _0x12858b;}})});}_0x323b29=_[_0x20f1('0x3c')]({},_0x323b29,_0x2fd32b['options']);var _0x70a816={'where':_0x323b29['where']};return db[_0x20f1('0x3d')]['count'](_0x70a816)[_0x20f1('0x24')](function(_0x19278a){_0x47ede8[_0x20f1('0x1b')]=_0x19278a;if(_0x2fd32b[_0x20f1('0x2f')][_0x20f1('0x3e')]){_0x323b29[_0x20f1('0x3f')]=[{'all':!![]}];}return db[_0x20f1('0x3d')][_0x20f1('0x40')](_0x323b29);})[_0x20f1('0x24')](function(_0x6b2648){_0x47ede8[_0x20f1('0x41')]=_0x6b2648;return _0x47ede8;})[_0x20f1('0x24')](respondWithFilteredResult(_0x13deb7,_0x323b29))['catch'](handleError(_0x13deb7,null));};exports[_0x20f1('0x42')]=function(_0x203daf,_0x136a29){var _0x33998a={'raw':!![],'where':{'id':_0x203daf[_0x20f1('0x43')]['id']}},_0x11ed8c={};_0x11ed8c[_0x20f1('0x31')]=_[_0x20f1('0x30')](db[_0x20f1('0x3d')]['rawAttributes']);_0x11ed8c[_0x20f1('0x2f')]=_[_0x20f1('0x30')](_0x203daf['query']);_0x11ed8c[_0x20f1('0x39')]=_[_0x20f1('0x33')](_0x11ed8c[_0x20f1('0x31')],_0x11ed8c[_0x20f1('0x2f')]);_0x33998a[_0x20f1('0x32')]=_[_0x20f1('0x33')](_0x11ed8c[_0x20f1('0x31')],qs['fields'](_0x203daf['query']['fields']));_0x33998a[_0x20f1('0x32')]=_0x33998a[_0x20f1('0x32')]['length']?_0x33998a[_0x20f1('0x32')]:_0x11ed8c[_0x20f1('0x31')];if(_0x203daf['query']['includeAll']){_0x33998a['include']=[{'all':!![]}];}_0x33998a=_[_0x20f1('0x3c')]({},_0x33998a,_0x203daf[_0x20f1('0x44')]);return db[_0x20f1('0x3d')][_0x20f1('0x45')](_0x33998a)[_0x20f1('0x24')](handleEntityNotFound(_0x136a29,null))[_0x20f1('0x24')](respondWithResult(_0x136a29,null))['catch'](handleError(_0x136a29,null));};exports[_0x20f1('0x46')]=function(_0x72d297,_0x34c329){return db[_0x20f1('0x3d')][_0x20f1('0x46')](_0x72d297[_0x20f1('0x47')],{})[_0x20f1('0x24')](respondWithResult(_0x34c329,0xc9))[_0x20f1('0x48')](handleError(_0x34c329,null));};exports['update']=function(_0x248017,_0x13e853){if(_0x248017[_0x20f1('0x47')]['id']){delete _0x248017[_0x20f1('0x47')]['id'];}return db[_0x20f1('0x3d')][_0x20f1('0x45')]({'where':{'id':_0x248017[_0x20f1('0x43')]['id']}})[_0x20f1('0x24')](handleEntityNotFound(_0x13e853,null))[_0x20f1('0x24')](saveUpdates(_0x248017[_0x20f1('0x47')],null))[_0x20f1('0x24')](respondWithResult(_0x13e853,null))[_0x20f1('0x48')](handleError(_0x13e853,null));};exports['download']=function(_0xa8e103,_0x268687,_0x555d09){var _0x471e10=require(_0x20f1('0x49'));var _0x47f646=![];var _0x55c421={};if(_0xa8e103['query'][_0x20f1('0x2d')]&&_0xa8e103[_0x20f1('0x2f')][_0x20f1('0x2d')]===_0x20f1('0x4a')){_0x55c421[_0x20f1('0x4a')]=_0xa8e103[_0x20f1('0x43')]['id'];}else{_0x55c421['id']=_0xa8e103['params']['id'];}return db['SquareRecording'][_0x20f1('0x45')]({'where':_0x55c421,'attributes':['id',_0x20f1('0x4b'),'filename'],'raw':!![]})[_0x20f1('0x24')](handleEntityNotFound(_0x268687,null))[_0x20f1('0x24')](function(_0x1443a4){if(_0x1443a4){var _0x49dde6=_0x1443a4['savePath'];var _0x13645e=util['format'](_0x20f1('0x4c'),_0x49dde6);if(fs[_0x20f1('0x4d')](_0x13645e)){_0x47f646=!![];return _0x471e10[_0x20f1('0x4e')](_0x13645e,_0x49dde6,config[_0x20f1('0x4f')][_0x20f1('0x50')])[_0x20f1('0x24')](function(){return _0x1443a4;});}return _0x1443a4;}})[_0x20f1('0x24')](function(_0x4bc6b2){if(_0x4bc6b2){var _0xd03b14=_0x4bc6b2[_0x20f1('0x4b')];if(!fs['existsSync'](_0xd03b14)){throw new db[(_0x20f1('0x51'))]['ValidationError'](_0x20f1('0x52'));}if(_0x4bc6b2[_0x20f1('0x53')]){return _0x268687[_0x20f1('0x54')](_0xd03b14,_0x4bc6b2[_0x20f1('0x53')]+path[_0x20f1('0x55')](_0xd03b14),function(){if(_0x47f646){fs[_0x20f1('0x56')](_0xd03b14);}});}else{return _0x268687[_0x20f1('0x54')](_0xd03b14,function(_0x20f361){if(_0x47f646){fs[_0x20f1('0x56')](_0xd03b14);}});}}})[_0x20f1('0x48')](function(_0x563d8e){if(_0x563d8e[_0x20f1('0x57')]==='SquareRecording\x20not\x20found'){_0x268687['status'](0x194)[_0x20f1('0x28')]('Not\x20found');}else{return handleError(_0x268687,null);}});};exports[_0x20f1('0x58')]=function(_0x25f518,_0x399b3b){return db['SquareRecording'][_0x20f1('0x45')]({'where':{'id':_0x25f518[_0x20f1('0x43')]['id']}})['then'](function(_0x5471e6){if(!_0x5471e6)throw new ReferenceError(_0x20f1('0x59'));return _0x5471e6;})['then'](function(_0x2a50e5){var _0x25a791=_0x2a50e5[_0x20f1('0x4b')];logger[_0x20f1('0x5a')]('cancellazione\x20fisica\x20documento\x20%s',_0x25a791);if(!_[_0x20f1('0x5b')](_0x2a50e5[_0x20f1('0x4b')])&&fs[_0x20f1('0x4d')](_0x25a791)){logger[_0x20f1('0x5a')]('File:\x20\x22'+_0x25a791+_0x20f1('0x5c'));fs[_0x20f1('0x5d')](_0x25a791);}_0x25a791=_0x25a791+_0x20f1('0x5e');if(!_['isNil'](_0x2a50e5[_0x20f1('0x4b')])&&fs[_0x20f1('0x4d')](_0x25a791)){logger[_0x20f1('0x5a')](_0x20f1('0x5f')+_0x25a791+_0x20f1('0x5c'));fs[_0x20f1('0x5d')](_0x25a791);}return _0x2a50e5;})[_0x20f1('0x24')](function(_0x132ee5){if(!_0x132ee5)throw new InternalError();return _0x132ee5[_0x20f1('0x58')]();})[_0x20f1('0x24')](function(){_0x399b3b['status'](0xcc)['end']();})['catch'](handleError(_0x399b3b,null));};
\ No newline at end of file
+var _0x590c=['sox','lodash','squel','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','status','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','end','name','send','index','map','SquareRecording','rawAttributes','fieldName','key','model','query','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filters','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','catch','params','keys','find','create','body','download','../../components/encryptor','uniqueid','savePath','filename','format','existsSync','decryptFile','secrets','Sequelize','ValidationError','extname','unlink','message','Not\x20found','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','isNil','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path'];(function(_0x3f986e,_0x21006d){var _0xe57da5=function(_0x29162a){while(--_0x29162a){_0x3f986e['push'](_0x3f986e['shift']());}};_0xe57da5(++_0x21006d);}(_0x590c,0x16b));var _0xc590=function(_0x59ab65,_0x410a52){_0x59ab65=_0x59ab65-0x0;var _0x57db9b=_0x590c[_0x59ab65];return _0x57db9b;};'use strict';var pdf=require(_0xc590('0x0'));var emlformat=require(_0xc590('0x1'));var rimraf=require(_0xc590('0x2'));var zipdir=require(_0xc590('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0xc590('0x4'));var moment=require(_0xc590('0x5'));var BPromise=require(_0xc590('0x6'));var Mustache=require(_0xc590('0x7'));var util=require('util');var path=require(_0xc590('0x8'));var sox=require(_0xc590('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0xc590('0xa'));var squel=require(_0xc590('0xb'));var crypto=require('crypto');var jsforce=require(_0xc590('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xc590('0xd'));var querystring=require(_0xc590('0xe'));var Papa=require(_0xc590('0xf'));var Redis=require(_0xc590('0x10'));var authService=require(_0xc590('0x11'));var qs=require(_0xc590('0x12'));var as=require(_0xc590('0x13'));var hardwareService=require(_0xc590('0x14'));var logger=require(_0xc590('0x15'))(_0xc590('0x16'));var utils=require('../../config/utils');var config=require(_0xc590('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1c705a,_0x303cd2){_0x303cd2=_0x303cd2||0xcc;return function(_0x15aa95){if(_0x15aa95){return _0x1c705a['sendStatus'](_0x303cd2);}return _0x1c705a[_0xc590('0x18')](_0x303cd2)['end']();};}function respondWithResult(_0x574ca4,_0x234050){_0x234050=_0x234050||0xc8;return function(_0x1d3643){if(_0x1d3643){return _0x574ca4[_0xc590('0x18')](_0x234050)['json'](_0x1d3643);}};}function respondWithFilteredResult(_0x4cbd0a,_0x31962d){return function(_0x56c288){if(_0x56c288){var _0x49e515=_0x56c288[_0xc590('0x19')],_0x5a5399=_0x31962d[_0xc590('0x1a')],_0x5bd401=_0x31962d[_0xc590('0x1a')]+_0x31962d[_0xc590('0x1b')],_0x7b0091;if(_0x5bd401>=_0x49e515){_0x5bd401=_0x49e515;_0x7b0091=0xc8;}else{_0x7b0091=0xce;}_0x4cbd0a[_0xc590('0x18')](_0x7b0091);return _0x4cbd0a[_0xc590('0x1c')](_0xc590('0x1d'),_0x5a5399+'-'+_0x5bd401+'/'+_0x49e515)['json'](_0x56c288);}return null;};}function patchUpdates(_0x1dda51){return function(_0x455732){try{jsonpatch[_0xc590('0x1e')](_0x455732,_0x1dda51,!![]);}catch(_0x47c3b4){return BPromise[_0xc590('0x1f')](_0x47c3b4);}return _0x455732[_0xc590('0x20')]();};}function saveUpdates(_0x4f7ae6,_0x16b37f){return function(_0x2c6e86){if(_0x2c6e86){return _0x2c6e86[_0xc590('0x21')](_0x4f7ae6)[_0xc590('0x22')](function(_0x5ac0c0){return _0x5ac0c0;});}return null;};}function removeEntity(_0x2caef0,_0x5344ee){return function(_0x8de71d){if(_0x8de71d){return _0x8de71d[_0xc590('0x23')]()[_0xc590('0x22')](function(){_0x2caef0[_0xc590('0x18')](0xcc)[_0xc590('0x24')]();});}};}function handleEntityNotFound(_0x424d5c,_0x4f5a24){return function(_0x3d7c61){if(!_0x3d7c61){_0x424d5c['sendStatus'](0x194);}return _0x3d7c61;};}function handleError(_0xae7b2,_0x248004){_0x248004=_0x248004||0x1f4;return function(_0x4f256a){logger['error'](_0x4f256a['stack']);if(_0x4f256a[_0xc590('0x25')]){delete _0x4f256a[_0xc590('0x25')];}_0xae7b2['status'](_0x248004)[_0xc590('0x26')](_0x4f256a);};}exports[_0xc590('0x27')]=function(_0x475fba,_0x48ee0b){var _0x3a21d1={},_0x54266a={},_0x561b29={'count':0x0,'rows':[]};var _0x2e4c8c=_[_0xc590('0x28')](db[_0xc590('0x29')][_0xc590('0x2a')],function(_0x187769){return{'name':_0x187769[_0xc590('0x2b')],'type':_0x187769['type'][_0xc590('0x2c')]};});_0x54266a[_0xc590('0x2d')]=_['map'](_0x2e4c8c,_0xc590('0x25'));_0x54266a['query']=_['keys'](_0x475fba[_0xc590('0x2e')]);_0x54266a['filters']=_[_0xc590('0x2f')](_0x54266a[_0xc590('0x2d')],_0x54266a[_0xc590('0x2e')]);_0x3a21d1[_0xc590('0x30')]=_['intersection'](_0x54266a['model'],qs[_0xc590('0x31')](_0x475fba[_0xc590('0x2e')][_0xc590('0x31')]));_0x3a21d1[_0xc590('0x30')]=_0x3a21d1[_0xc590('0x30')][_0xc590('0x32')]?_0x3a21d1['attributes']:_0x54266a[_0xc590('0x2d')];if(!_0x475fba['query'][_0xc590('0x33')]('nolimit')){_0x3a21d1['limit']=qs['limit'](_0x475fba[_0xc590('0x2e')]['limit']);_0x3a21d1['offset']=qs['offset'](_0x475fba['query']['offset']);}_0x3a21d1[_0xc590('0x34')]=qs[_0xc590('0x35')](_0x475fba['query'][_0xc590('0x35')]);_0x3a21d1[_0xc590('0x36')]=qs[_0xc590('0x37')](_[_0xc590('0x38')](_0x475fba[_0xc590('0x2e')],_0x54266a['filters']),_0x2e4c8c);if(_0x475fba['query'][_0xc590('0x39')]){_0x3a21d1[_0xc590('0x36')]=_[_0xc590('0x3a')](_0x3a21d1[_0xc590('0x36')],{'$or':_[_0xc590('0x28')](_0x2e4c8c,function(_0x55126a){if(_0x55126a[_0xc590('0x3b')]!==_0xc590('0x3c')){var _0x148590={};_0x148590[_0x55126a[_0xc590('0x25')]]={'$like':'%'+_0x475fba[_0xc590('0x2e')]['filter']+'%'};return _0x148590;}})});}_0x3a21d1=_[_0xc590('0x3a')]({},_0x3a21d1,_0x475fba[_0xc590('0x3d')]);var _0x364b8f={'where':_0x3a21d1[_0xc590('0x36')]};return db[_0xc590('0x29')][_0xc590('0x19')](_0x364b8f)['then'](function(_0x417bb1){_0x561b29[_0xc590('0x19')]=_0x417bb1;if(_0x475fba['query'][_0xc590('0x3e')]){_0x3a21d1[_0xc590('0x3f')]=[{'all':!![]}];}return db[_0xc590('0x29')][_0xc590('0x40')](_0x3a21d1);})[_0xc590('0x22')](function(_0x2eec9e){_0x561b29['rows']=_0x2eec9e;return _0x561b29;})[_0xc590('0x22')](respondWithFilteredResult(_0x48ee0b,_0x3a21d1))[_0xc590('0x41')](handleError(_0x48ee0b,null));};exports['show']=function(_0x1f64ed,_0xcee8d9){var _0x3ddfc7={'raw':!![],'where':{'id':_0x1f64ed[_0xc590('0x42')]['id']}},_0x44a7a6={};_0x44a7a6['model']=_[_0xc590('0x43')](db['SquareRecording']['rawAttributes']);_0x44a7a6[_0xc590('0x2e')]=_[_0xc590('0x43')](_0x1f64ed['query']);_0x44a7a6[_0xc590('0x37')]=_[_0xc590('0x2f')](_0x44a7a6['model'],_0x44a7a6['query']);_0x3ddfc7[_0xc590('0x30')]=_[_0xc590('0x2f')](_0x44a7a6[_0xc590('0x2d')],qs['fields'](_0x1f64ed['query'][_0xc590('0x31')]));_0x3ddfc7['attributes']=_0x3ddfc7[_0xc590('0x30')][_0xc590('0x32')]?_0x3ddfc7['attributes']:_0x44a7a6[_0xc590('0x2d')];if(_0x1f64ed[_0xc590('0x2e')]['includeAll']){_0x3ddfc7['include']=[{'all':!![]}];}_0x3ddfc7=_[_0xc590('0x3a')]({},_0x3ddfc7,_0x1f64ed[_0xc590('0x3d')]);return db[_0xc590('0x29')][_0xc590('0x44')](_0x3ddfc7)[_0xc590('0x22')](handleEntityNotFound(_0xcee8d9,null))['then'](respondWithResult(_0xcee8d9,null))[_0xc590('0x41')](handleError(_0xcee8d9,null));};exports[_0xc590('0x45')]=function(_0x4625b6,_0x17453a){return db[_0xc590('0x29')][_0xc590('0x45')](_0x4625b6[_0xc590('0x46')],{})[_0xc590('0x22')](respondWithResult(_0x17453a,0xc9))[_0xc590('0x41')](handleError(_0x17453a,null));};exports[_0xc590('0x21')]=function(_0x37acf7,_0x577abb){if(_0x37acf7['body']['id']){delete _0x37acf7[_0xc590('0x46')]['id'];}return db['SquareRecording'][_0xc590('0x44')]({'where':{'id':_0x37acf7[_0xc590('0x42')]['id']}})[_0xc590('0x22')](handleEntityNotFound(_0x577abb,null))['then'](saveUpdates(_0x37acf7[_0xc590('0x46')],null))[_0xc590('0x22')](respondWithResult(_0x577abb,null))[_0xc590('0x41')](handleError(_0x577abb,null));};exports[_0xc590('0x47')]=function(_0x3391e5,_0x215fa2,_0x51d4ae){var _0x141991=require(_0xc590('0x48'));var _0x3ca4f6=![];var _0x3d28d2={};if(_0x3391e5['query'][_0xc590('0x3b')]&&_0x3391e5['query'][_0xc590('0x3b')]===_0xc590('0x49')){_0x3d28d2[_0xc590('0x49')]=_0x3391e5['params']['id'];}else{_0x3d28d2['id']=_0x3391e5['params']['id'];}return db[_0xc590('0x29')]['find']({'where':_0x3d28d2,'attributes':['id',_0xc590('0x4a'),_0xc590('0x4b')],'raw':!![]})['then'](handleEntityNotFound(_0x215fa2,null))[_0xc590('0x22')](function(_0x2384b7){if(_0x2384b7){var _0x37aa69=_0x2384b7[_0xc590('0x4a')];var _0x2a4495=util[_0xc590('0x4c')]('%s.cypher',_0x37aa69);if(fs[_0xc590('0x4d')](_0x2a4495)){_0x3ca4f6=!![];return _0x141991[_0xc590('0x4e')](_0x2a4495,_0x37aa69,config[_0xc590('0x4f')]['recording'])['then'](function(){return _0x2384b7;});}return _0x2384b7;}})[_0xc590('0x22')](function(_0x595892){if(_0x595892){var _0x48295b=_0x595892[_0xc590('0x4a')];if(!fs[_0xc590('0x4d')](_0x48295b)){throw new db[(_0xc590('0x50'))][(_0xc590('0x51'))]('SquareRecording\x20not\x20found');}if(_0x595892['filename']){return _0x215fa2[_0xc590('0x47')](_0x48295b,_0x595892[_0xc590('0x4b')]+path[_0xc590('0x52')](_0x48295b),function(){if(_0x3ca4f6){fs[_0xc590('0x53')](_0x48295b);}});}else{return _0x215fa2[_0xc590('0x47')](_0x48295b,function(_0x485d96){if(_0x3ca4f6){fs[_0xc590('0x53')](_0x48295b);}});}}})['catch'](function(_0xbe08bb){if(_0xbe08bb[_0xc590('0x54')]==='SquareRecording\x20not\x20found'){_0x215fa2[_0xc590('0x18')](0x194)[_0xc590('0x26')](_0xc590('0x55'));}else{return handleError(_0x215fa2,null);}});};exports[_0xc590('0x23')]=function(_0x251874,_0x19c107){return db[_0xc590('0x29')][_0xc590('0x44')]({'where':{'id':_0x251874[_0xc590('0x42')]['id']}})[_0xc590('0x22')](function(_0x40bbf6){if(!_0x40bbf6)throw new ReferenceError(_0xc590('0x56'));return _0x40bbf6;})[_0xc590('0x22')](function(_0x5018af){var _0x4bf9b9=_0x5018af[_0xc590('0x4a')];logger[_0xc590('0x57')](_0xc590('0x58'),_0x4bf9b9);if(!_[_0xc590('0x59')](_0x5018af[_0xc590('0x4a')])&&fs[_0xc590('0x4d')](_0x4bf9b9)){logger[_0xc590('0x57')](_0xc590('0x5a')+_0x4bf9b9+_0xc590('0x5b'));fs['unlinkSync'](_0x4bf9b9);}_0x4bf9b9=_0x4bf9b9+'.cypher';if(!_[_0xc590('0x59')](_0x5018af[_0xc590('0x4a')])&&fs[_0xc590('0x4d')](_0x4bf9b9)){logger[_0xc590('0x57')](_0xc590('0x5a')+_0x4bf9b9+_0xc590('0x5b'));fs[_0xc590('0x5c')](_0x4bf9b9);}return _0x5018af;})[_0xc590('0x22')](function(_0x35ca7a){if(!_0x35ca7a)throw new InternalError();return _0x35ca7a[_0xc590('0x23')]();})[_0xc590('0x22')](function(){_0x19c107[_0xc590('0x18')](0xcc)[_0xc590('0x24')]();})[_0xc590('0x41')](handleError(_0x19c107,null));};
\ No newline at end of file
diff --git a/server/api/squareRecording/squareRecording.model.js b/server/api/squareRecording/squareRecording.model.js
index 18f46a8..7af6bb7 100644
--- a/server/api/squareRecording/squareRecording.model.js
+++ b/server/api/squareRecording/squareRecording.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9f4c=['rimraf','../../config/environment','./squareRecording.attributes','define','SquareRecording','square_recordings','lodash','util','../../config/logger','moment','bluebird'];(function(_0x307e24,_0x1a1b78){var _0x2b5b89=function(_0x380c38){while(--_0x380c38){_0x307e24['push'](_0x307e24['shift']());}};_0x2b5b89(++_0x1a1b78);}(_0x9f4c,0x8a));var _0xc9f4=function(_0x5daf5e,_0x4b51f5){_0x5daf5e=_0x5daf5e-0x0;var _0x543ae0=_0x9f4c[_0x5daf5e];return _0x543ae0;};'use strict';var _=require(_0xc9f4('0x0'));var util=require(_0xc9f4('0x1'));var logger=require(_0xc9f4('0x2'))('api');var moment=require(_0xc9f4('0x3'));var BPromise=require(_0xc9f4('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xc9f4('0x5'));var config=require(_0xc9f4('0x6'));var attributes=require(_0xc9f4('0x7'));module['exports']=function(_0x142b2d,_0x386752){return _0x142b2d[_0xc9f4('0x8')](_0xc9f4('0x9'),attributes,{'tableName':_0xc9f4('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xa4ee=['./squareRecording.attributes','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x29cd03,_0x4a8f10){var _0x52bad3=function(_0x1f7208){while(--_0x1f7208){_0x29cd03['push'](_0x29cd03['shift']());}};_0x52bad3(++_0x4a8f10);}(_0xa4ee,0xfb));var _0xea4e=function(_0x5930aa,_0xf07ae){_0x5930aa=_0x5930aa-0x0;var _0x274e6c=_0xa4ee[_0x5930aa];return _0x274e6c;};'use strict';var _=require(_0xea4e('0x0'));var util=require('util');var logger=require(_0xea4e('0x1'))(_0xea4e('0x2'));var moment=require(_0xea4e('0x3'));var BPromise=require(_0xea4e('0x4'));var rp=require(_0xea4e('0x5'));var fs=require('fs');var path=require(_0xea4e('0x6'));var rimraf=require(_0xea4e('0x7'));var config=require(_0xea4e('0x8'));var attributes=require(_0xea4e('0x9'));module['exports']=function(_0x2c38e3,_0x5f4ee6){return _0x2c38e3['define']('SquareRecording',attributes,{'tableName':'square_recordings','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/squareRecording/squareRecording.rpc.js b/server/api/squareRecording/squareRecording.rpc.js
index a569e7c..1503773 100644
--- a/server/api/squareRecording/squareRecording.rpc.js
+++ b/server/api/squareRecording/squareRecording.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x3a90=['jayson/promise','client','http','request','then','SquareRecording,\x20%s,\x20%s','request\x20sent','debug','SquareRecording,\x20%s,\x20%s,\x20%s','stringify','error','message','info','catch','CreateSquareRecording','SquareRecording','body','raw','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc'];(function(_0x51edca,_0x18ad70){var _0x2b77ec=function(_0x55a549){while(--_0x55a549){_0x51edca['push'](_0x51edca['shift']());}};_0x2b77ec(++_0x18ad70);}(_0x3a90,0x1cc));var _0x03a9=function(_0x2584b6,_0x640d3d){_0x2584b6=_0x2584b6-0x0;var _0x201baf=_0x3a90[_0x2584b6];return _0x201baf;};'use strict';var _=require(_0x03a9('0x0'));var util=require(_0x03a9('0x1'));var moment=require(_0x03a9('0x2'));var BPromise=require(_0x03a9('0x3'));var rs=require(_0x03a9('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x03a9('0x5'));var logger=require(_0x03a9('0x6'))(_0x03a9('0x7'));var config=require('../../config/environment');var jayson=require(_0x03a9('0x8'));var client=jayson[_0x03a9('0x9')][_0x03a9('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x117c2a,_0x481d1b,_0x502bc5){return new BPromise(function(_0x37f16f,_0x20ba17){return client[_0x03a9('0xb')](_0x117c2a,_0x502bc5)[_0x03a9('0xc')](function(_0x462119){logger['info'](_0x03a9('0xd'),_0x481d1b,_0x03a9('0xe'));logger[_0x03a9('0xf')](_0x03a9('0x10'),_0x481d1b,_0x03a9('0xe'),JSON[_0x03a9('0x11')](_0x462119));if(_0x462119[_0x03a9('0x12')]){if(_0x462119[_0x03a9('0x12')]['code']===0x1f4){logger[_0x03a9('0x12')](_0x03a9('0xd'),_0x481d1b,_0x462119[_0x03a9('0x12')][_0x03a9('0x13')]);return _0x20ba17(_0x462119[_0x03a9('0x12')]['message']);}logger[_0x03a9('0x12')]('SquareRecording,\x20%s,\x20%s',_0x481d1b,_0x462119['error']['message']);return _0x37f16f(_0x462119[_0x03a9('0x12')][_0x03a9('0x13')]);}else{logger[_0x03a9('0x14')](_0x03a9('0xd'),_0x481d1b,_0x03a9('0xe'));_0x37f16f(_0x462119['result'][_0x03a9('0x13')]);}})[_0x03a9('0x15')](function(_0x2e2a14){logger[_0x03a9('0x12')](_0x03a9('0xd'),_0x481d1b,_0x2e2a14);_0x20ba17(_0x2e2a14);});});}exports[_0x03a9('0x16')]=function(_0x2654ac){var _0x32e64a=this;return new Promise(function(_0x573755,_0x43f6c6){return db[_0x03a9('0x17')]['create'](_0x2654ac[_0x03a9('0x18')],{'raw':_0x2654ac['options']?_0x2654ac['options'][_0x03a9('0x19')]===undefined?!![]:![]:!![]})[_0x03a9('0xc')](function(_0x5484c0){logger[_0x03a9('0x14')](_0x03a9('0x16'),_0x2654ac);logger[_0x03a9('0xf')](_0x03a9('0x16'),_0x2654ac,JSON[_0x03a9('0x11')](_0x5484c0));_0x573755(_0x5484c0);})[_0x03a9('0x15')](function(_0x26fb6d){logger[_0x03a9('0x12')]('CreateSquareRecording',_0x26fb6d[_0x03a9('0x13')],_0x2654ac);_0x43f6c6(_0x32e64a[_0x03a9('0x12')](0x1f4,_0x26fb6d['message']));});});};
\ No newline at end of file
+var _0x4497=['../../config/logger','rpc','../../config/environment','client','http','request','then','info','SquareRecording,\x20%s,\x20%s','request\x20sent','debug','SquareRecording,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateSquareRecording','SquareRecording','create','options','raw','lodash','util','randomstring','../../mysqldb'];(function(_0x5670cb,_0xe6e20d){var _0x11dc29=function(_0x42305b){while(--_0x42305b){_0x5670cb['push'](_0x5670cb['shift']());}};_0x11dc29(++_0xe6e20d);}(_0x4497,0x1e2));var _0x7449=function(_0x27604f,_0x5ae336){_0x27604f=_0x27604f-0x0;var _0x40d189=_0x4497[_0x27604f];return _0x40d189;};'use strict';var _=require(_0x7449('0x0'));var util=require(_0x7449('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x7449('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7449('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x7449('0x4'))(_0x7449('0x5'));var config=require(_0x7449('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x7449('0x7')][_0x7449('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3bdc88,_0x3afe69,_0x1e39c4){return new BPromise(function(_0x5ad335,_0x64d9b8){return client[_0x7449('0x9')](_0x3bdc88,_0x1e39c4)[_0x7449('0xa')](function(_0x1872ff){logger[_0x7449('0xb')](_0x7449('0xc'),_0x3afe69,_0x7449('0xd'));logger[_0x7449('0xe')](_0x7449('0xf'),_0x3afe69,_0x7449('0xd'),JSON[_0x7449('0x10')](_0x1872ff));if(_0x1872ff[_0x7449('0x11')]){if(_0x1872ff[_0x7449('0x11')][_0x7449('0x12')]===0x1f4){logger['error']('SquareRecording,\x20%s,\x20%s',_0x3afe69,_0x1872ff[_0x7449('0x11')][_0x7449('0x13')]);return _0x64d9b8(_0x1872ff[_0x7449('0x11')][_0x7449('0x13')]);}logger[_0x7449('0x11')]('SquareRecording,\x20%s,\x20%s',_0x3afe69,_0x1872ff[_0x7449('0x11')][_0x7449('0x13')]);return _0x5ad335(_0x1872ff[_0x7449('0x11')][_0x7449('0x13')]);}else{logger[_0x7449('0xb')]('SquareRecording,\x20%s,\x20%s',_0x3afe69,_0x7449('0xd'));_0x5ad335(_0x1872ff[_0x7449('0x14')]['message']);}})[_0x7449('0x15')](function(_0x40dbcd){logger[_0x7449('0x11')]('SquareRecording,\x20%s,\x20%s',_0x3afe69,_0x40dbcd);_0x64d9b8(_0x40dbcd);});});}exports[_0x7449('0x16')]=function(_0x1a208f){var _0x3eb53c=this;return new Promise(function(_0x3c9f56,_0x587ff7){return db[_0x7449('0x17')][_0x7449('0x18')](_0x1a208f['body'],{'raw':_0x1a208f[_0x7449('0x19')]?_0x1a208f['options'][_0x7449('0x1a')]===undefined?!![]:![]:!![]})[_0x7449('0xa')](function(_0x2601e6){logger[_0x7449('0xb')]('CreateSquareRecording',_0x1a208f);logger[_0x7449('0xe')](_0x7449('0x16'),_0x1a208f,JSON['stringify'](_0x2601e6));_0x3c9f56(_0x2601e6);})[_0x7449('0x15')](function(_0x21f646){logger[_0x7449('0x11')](_0x7449('0x16'),_0x21f646[_0x7449('0x13')],_0x1a208f);_0x587ff7(_0x3eb53c[_0x7449('0x11')](0x1f4,_0x21f646[_0x7449('0x13')]));});});};
\ No newline at end of file
diff --git a/server/api/squareReport/index.js b/server/api/squareReport/index.js
index fae0a46..0382136 100644
--- a/server/api/squareReport/index.js
+++ b/server/api/squareReport/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xbaea=['exports','multer','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareReport.controller','get','isAuthenticated','index','/describe','describe','/:id','post','create','delete','destroy'];(function(_0x4ec1e0,_0x5b11bd){var _0xb1a743=function(_0x38a559){while(--_0x38a559){_0x4ec1e0['push'](_0x4ec1e0['shift']());}};_0xb1a743(++_0x5b11bd);}(_0xbaea,0x1ef));var _0xabae=function(_0x361475,_0x32ecc5){_0x361475=_0x361475-0x0;var _0x317cf1=_0xbaea[_0x361475];return _0x317cf1;};'use strict';var multer=require(_0xabae('0x0'));var util=require('util');var path=require(_0xabae('0x1'));var timeout=require(_0xabae('0x2'));var express=require('express');var router=express[_0xabae('0x3')]();var auth=require(_0xabae('0x4'));var interaction=require(_0xabae('0x5'));var config=require(_0xabae('0x6'));var controller=require(_0xabae('0x7'));router[_0xabae('0x8')]('/',auth[_0xabae('0x9')](),controller[_0xabae('0xa')]);router[_0xabae('0x8')](_0xabae('0xb'),auth[_0xabae('0x9')](),controller[_0xabae('0xc')]);router['get'](_0xabae('0xd'),auth['isAuthenticated'](),controller['show']);router[_0xabae('0xe')]('/',auth[_0xabae('0x9')](),controller[_0xabae('0xf')]);router['put'](_0xabae('0xd'),auth[_0xabae('0x9')](),controller['update']);router[_0xabae('0x10')]('/:id',auth[_0xabae('0x9')](),controller[_0xabae('0x11')]);module[_0xabae('0x12')]=router;
\ No newline at end of file
+var _0xd7d4=['util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./squareReport.controller','get','index','/describe','isAuthenticated','describe','/:id','post','create','put','update','delete','destroy','exports','multer'];(function(_0x5d2e86,_0x541c1c){var _0x13fb68=function(_0x1cc0ce){while(--_0x1cc0ce){_0x5d2e86['push'](_0x5d2e86['shift']());}};_0x13fb68(++_0x541c1c);}(_0xd7d4,0x175));var _0x4d7d=function(_0x1b3a5c,_0x2f9d5f){_0x1b3a5c=_0x1b3a5c-0x0;var _0x2ae8cb=_0xd7d4[_0x1b3a5c];return _0x2ae8cb;};'use strict';var multer=require(_0x4d7d('0x0'));var util=require(_0x4d7d('0x1'));var path=require(_0x4d7d('0x2'));var timeout=require(_0x4d7d('0x3'));var express=require(_0x4d7d('0x4'));var router=express[_0x4d7d('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0x4d7d('0x6'));var config=require(_0x4d7d('0x7'));var controller=require(_0x4d7d('0x8'));router[_0x4d7d('0x9')]('/',auth['isAuthenticated'](),controller[_0x4d7d('0xa')]);router['get'](_0x4d7d('0xb'),auth[_0x4d7d('0xc')](),controller[_0x4d7d('0xd')]);router[_0x4d7d('0x9')](_0x4d7d('0xe'),auth[_0x4d7d('0xc')](),controller['show']);router[_0x4d7d('0xf')]('/',auth['isAuthenticated'](),controller[_0x4d7d('0x10')]);router[_0x4d7d('0x11')](_0x4d7d('0xe'),auth[_0x4d7d('0xc')](),controller[_0x4d7d('0x12')]);router[_0x4d7d('0x13')]('/:id',auth[_0x4d7d('0xc')](),controller[_0x4d7d('0x14')]);module[_0x4d7d('0x15')]=router;
\ No newline at end of file
diff --git a/server/api/squareReport/squareReport.attributes.js b/server/api/squareReport/squareReport.attributes.js
index fe4a56d..4f5a555 100644
--- a/server/api/squareReport/squareReport.attributes.js
+++ b/server/api/squareReport/squareReport.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7bea=['DATE','sequelize','exports','STRING'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x7bea,0x115));var _0xa7be=function(_0x431ff8,_0x4085dd){_0x431ff8=_0x431ff8-0x0;var _0x84ccd4=_0x7bea[_0x431ff8];return _0x84ccd4;};'use strict';var Sequelize=require(_0xa7be('0x0'));module[_0xa7be('0x1')]={'network':{'type':Sequelize['STRING']},'network_script':{'type':Sequelize['STRING']},'request':{'type':Sequelize[_0xa7be('0x2')]},'channel':{'type':Sequelize[_0xa7be('0x2')]},'language':{'type':Sequelize[_0xa7be('0x2')]},'type':{'type':Sequelize[_0xa7be('0x2')]},'uniqueid':{'type':Sequelize['STRING']},'version':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize[_0xa7be('0x2')]},'calleridname':{'type':Sequelize[_0xa7be('0x2')]},'callingpres':{'type':Sequelize['STRING']},'callingani2':{'type':Sequelize['STRING']},'callington':{'type':Sequelize['STRING']},'callingtns':{'type':Sequelize[_0xa7be('0x2')]},'dnid':{'type':Sequelize['STRING']},'rdnis':{'type':Sequelize[_0xa7be('0x2')]},'context':{'type':Sequelize[_0xa7be('0x2')]},'extension':{'type':Sequelize[_0xa7be('0x2')]},'priority':{'type':Sequelize['STRING']},'enhanced':{'type':Sequelize[_0xa7be('0x2')]},'accountcode':{'type':Sequelize[_0xa7be('0x2')]},'threadid':{'type':Sequelize[_0xa7be('0x2')]},'project_name':{'type':Sequelize[_0xa7be('0x2')]},'joinAt':{'type':Sequelize[_0xa7be('0x3')]},'leaveAt':{'type':Sequelize[_0xa7be('0x3')]},'bot':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}};
\ No newline at end of file
+var _0x6de4=['STRING','DATE','sequelize','exports'];(function(_0x232eb0,_0x2b0ab0){var _0x5b057c=function(_0x13ceea){while(--_0x13ceea){_0x232eb0['push'](_0x232eb0['shift']());}};_0x5b057c(++_0x2b0ab0);}(_0x6de4,0x17a));var _0x46de=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x6de4[_0x122ef9];return _0x42fba0;};'use strict';var Sequelize=require(_0x46de('0x0'));module[_0x46de('0x1')]={'network':{'type':Sequelize['STRING']},'network_script':{'type':Sequelize['STRING']},'request':{'type':Sequelize[_0x46de('0x2')]},'channel':{'type':Sequelize[_0x46de('0x2')]},'language':{'type':Sequelize[_0x46de('0x2')]},'type':{'type':Sequelize[_0x46de('0x2')]},'uniqueid':{'type':Sequelize[_0x46de('0x2')]},'version':{'type':Sequelize[_0x46de('0x2')]},'callerid':{'type':Sequelize[_0x46de('0x2')]},'calleridname':{'type':Sequelize['STRING']},'callingpres':{'type':Sequelize['STRING']},'callingani2':{'type':Sequelize[_0x46de('0x2')]},'callington':{'type':Sequelize['STRING']},'callingtns':{'type':Sequelize[_0x46de('0x2')]},'dnid':{'type':Sequelize[_0x46de('0x2')]},'rdnis':{'type':Sequelize[_0x46de('0x2')]},'context':{'type':Sequelize[_0x46de('0x2')]},'extension':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0x46de('0x2')]},'enhanced':{'type':Sequelize[_0x46de('0x2')]},'accountcode':{'type':Sequelize['STRING']},'threadid':{'type':Sequelize[_0x46de('0x2')]},'project_name':{'type':Sequelize[_0x46de('0x2')]},'joinAt':{'type':Sequelize[_0x46de('0x3')]},'leaveAt':{'type':Sequelize[_0x46de('0x3')]},'bot':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}};
\ No newline at end of file
diff --git a/server/api/squareReport/squareReport.controller.js b/server/api/squareReport/squareReport.controller.js
index 3e0425f..e2c22b3 100644
--- a/server/api/squareReport/squareReport.controller.js
+++ b/server/api/squareReport/squareReport.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x17ef=['options','find','create','body','params','describe','html-pdf','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','error','stack','name','send','index','map','SquareReport','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','filter','where','VIRTUAL','includeAll','rows','catch','include'];(function(_0x51020b,_0x38c2c7){var _0x371e47=function(_0x2a538f){while(--_0x2a538f){_0x51020b['push'](_0x51020b['shift']());}};_0x371e47(++_0x38c2c7);}(_0x17ef,0xe1));var _0xf17e=function(_0x54f973,_0x39e1ed){_0x54f973=_0x54f973-0x0;var _0x32d433=_0x17ef[_0x54f973];return _0x32d433;};'use strict';var pdf=require(_0xf17e('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xf17e('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf17e('0x2'));var rp=require(_0xf17e('0x3'));var moment=require(_0xf17e('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xf17e('0x5'));var util=require(_0xf17e('0x6'));var path=require(_0xf17e('0x7'));var sox=require(_0xf17e('0x8'));var csv=require('to-csv');var ejs=require(_0xf17e('0x9'));var fs=require('fs');var _=require(_0xf17e('0xa'));var squel=require(_0xf17e('0xb'));var crypto=require(_0xf17e('0xc'));var jsforce=require(_0xf17e('0xd'));var deskjs=require(_0xf17e('0xe'));var toCsv=require(_0xf17e('0xf'));var querystring=require('querystring');var Papa=require(_0xf17e('0x10'));var Redis=require(_0xf17e('0x11'));var authService=require(_0xf17e('0x12'));var qs=require(_0xf17e('0x13'));var as=require(_0xf17e('0x14'));var hardwareService=require(_0xf17e('0x15'));var logger=require('../../config/logger')(_0xf17e('0x16'));var utils=require(_0xf17e('0x17'));var config=require(_0xf17e('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x58acca,_0x323d01){_0x323d01=_0x323d01||0xcc;return function(_0x2df543){if(_0x2df543){return _0x58acca[_0xf17e('0x19')](_0x323d01);}return _0x58acca[_0xf17e('0x1a')](_0x323d01)[_0xf17e('0x1b')]();};}function respondWithResult(_0x26db03,_0x2ce1b0){_0x2ce1b0=_0x2ce1b0||0xc8;return function(_0xd29e4){if(_0xd29e4){return _0x26db03[_0xf17e('0x1a')](_0x2ce1b0)[_0xf17e('0x1c')](_0xd29e4);}};}function respondWithFilteredResult(_0x3635bc,_0x42236c){return function(_0x585207){if(_0x585207){var _0x526399=_0x585207[_0xf17e('0x1d')],_0x5b738d=_0x42236c['offset'],_0x59fb47=_0x42236c[_0xf17e('0x1e')]+_0x42236c[_0xf17e('0x1f')],_0x4857eb;if(_0x59fb47>=_0x526399){_0x59fb47=_0x526399;_0x4857eb=0xc8;}else{_0x4857eb=0xce;}_0x3635bc[_0xf17e('0x1a')](_0x4857eb);return _0x3635bc[_0xf17e('0x20')](_0xf17e('0x21'),_0x5b738d+'-'+_0x59fb47+'/'+_0x526399)['json'](_0x585207);}return null;};}function patchUpdates(_0x28d29e){return function(_0x16a985){try{jsonpatch[_0xf17e('0x22')](_0x16a985,_0x28d29e,!![]);}catch(_0x841447){return BPromise[_0xf17e('0x23')](_0x841447);}return _0x16a985[_0xf17e('0x24')]();};}function saveUpdates(_0x30b98c,_0x28606d){return function(_0x52610d){if(_0x52610d){return _0x52610d[_0xf17e('0x25')](_0x30b98c)[_0xf17e('0x26')](function(_0x4b61b7){return _0x4b61b7;});}return null;};}function removeEntity(_0x1a3274,_0x48cdd3){return function(_0x246041){if(_0x246041){return _0x246041['destroy']()['then'](function(){_0x1a3274['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x5e3fa3,_0x5a29b2){return function(_0xbe33c3){if(!_0xbe33c3){_0x5e3fa3['sendStatus'](0x194);}return _0xbe33c3;};}function handleError(_0x4f1dd7,_0x5d808b){_0x5d808b=_0x5d808b||0x1f4;return function(_0x53f2d8){logger[_0xf17e('0x27')](_0x53f2d8[_0xf17e('0x28')]);if(_0x53f2d8[_0xf17e('0x29')]){delete _0x53f2d8[_0xf17e('0x29')];}_0x4f1dd7[_0xf17e('0x1a')](_0x5d808b)[_0xf17e('0x2a')](_0x53f2d8);};}exports[_0xf17e('0x2b')]=function(_0x541427,_0xf1cc27){var _0x3b728a={},_0x32ec0e={},_0x3b09ac={'count':0x0,'rows':[]};var _0x22c4b6=_[_0xf17e('0x2c')](db[_0xf17e('0x2d')][_0xf17e('0x2e')],function(_0x834cfa){return{'name':_0x834cfa['fieldName'],'type':_0x834cfa[_0xf17e('0x2f')][_0xf17e('0x30')]};});_0x32ec0e[_0xf17e('0x31')]=_['map'](_0x22c4b6,_0xf17e('0x29'));_0x32ec0e[_0xf17e('0x32')]=_[_0xf17e('0x33')](_0x541427[_0xf17e('0x32')]);_0x32ec0e[_0xf17e('0x34')]=_[_0xf17e('0x35')](_0x32ec0e['model'],_0x32ec0e[_0xf17e('0x32')]);_0x3b728a[_0xf17e('0x36')]=_[_0xf17e('0x35')](_0x32ec0e[_0xf17e('0x31')],qs['fields'](_0x541427[_0xf17e('0x32')][_0xf17e('0x37')]));_0x3b728a[_0xf17e('0x36')]=_0x3b728a[_0xf17e('0x36')][_0xf17e('0x38')]?_0x3b728a[_0xf17e('0x36')]:_0x32ec0e['model'];if(!_0x541427[_0xf17e('0x32')][_0xf17e('0x39')]('nolimit')){_0x3b728a[_0xf17e('0x1f')]=qs[_0xf17e('0x1f')](_0x541427[_0xf17e('0x32')]['limit']);_0x3b728a[_0xf17e('0x1e')]=qs[_0xf17e('0x1e')](_0x541427[_0xf17e('0x32')]['offset']);}_0x3b728a[_0xf17e('0x3a')]=qs['sort'](_0x541427[_0xf17e('0x32')][_0xf17e('0x3b')]);_0x3b728a['where']=qs[_0xf17e('0x34')](_['pick'](_0x541427[_0xf17e('0x32')],_0x32ec0e[_0xf17e('0x34')]),_0x22c4b6);if(_0x541427['query'][_0xf17e('0x3c')]){_0x3b728a['where']=_['merge'](_0x3b728a[_0xf17e('0x3d')],{'$or':_['map'](_0x22c4b6,function(_0x4e3a37){if(_0x4e3a37[_0xf17e('0x2f')]!==_0xf17e('0x3e')){var _0x40612e={};_0x40612e[_0x4e3a37[_0xf17e('0x29')]]={'$like':'%'+_0x541427['query'][_0xf17e('0x3c')]+'%'};return _0x40612e;}})});}_0x3b728a=_['merge']({},_0x3b728a,_0x541427['options']);var _0x48faa8={'where':_0x3b728a[_0xf17e('0x3d')]};return db[_0xf17e('0x2d')][_0xf17e('0x1d')](_0x48faa8)['then'](function(_0x241086){_0x3b09ac['count']=_0x241086;if(_0x541427[_0xf17e('0x32')][_0xf17e('0x3f')]){_0x3b728a['include']=[{'all':!![]}];}return db[_0xf17e('0x2d')]['findAll'](_0x3b728a);})[_0xf17e('0x26')](function(_0x33bfe5){_0x3b09ac[_0xf17e('0x40')]=_0x33bfe5;return _0x3b09ac;})[_0xf17e('0x26')](respondWithFilteredResult(_0xf1cc27,_0x3b728a))[_0xf17e('0x41')](handleError(_0xf1cc27,null));};exports['show']=function(_0x5e9b82,_0x3847ea){var _0x36f0fd={'raw':!![],'where':{'id':_0x5e9b82['params']['id']}},_0x493340={};_0x493340[_0xf17e('0x31')]=_[_0xf17e('0x33')](db[_0xf17e('0x2d')][_0xf17e('0x2e')]);_0x493340['query']=_[_0xf17e('0x33')](_0x5e9b82['query']);_0x493340['filters']=_[_0xf17e('0x35')](_0x493340[_0xf17e('0x31')],_0x493340[_0xf17e('0x32')]);_0x36f0fd[_0xf17e('0x36')]=_[_0xf17e('0x35')](_0x493340[_0xf17e('0x31')],qs[_0xf17e('0x37')](_0x5e9b82[_0xf17e('0x32')][_0xf17e('0x37')]));_0x36f0fd[_0xf17e('0x36')]=_0x36f0fd['attributes'][_0xf17e('0x38')]?_0x36f0fd[_0xf17e('0x36')]:_0x493340[_0xf17e('0x31')];if(_0x5e9b82['query'][_0xf17e('0x3f')]){_0x36f0fd[_0xf17e('0x42')]=[{'all':!![]}];}_0x36f0fd=_['merge']({},_0x36f0fd,_0x5e9b82[_0xf17e('0x43')]);return db[_0xf17e('0x2d')][_0xf17e('0x44')](_0x36f0fd)[_0xf17e('0x26')](handleEntityNotFound(_0x3847ea,null))['then'](respondWithResult(_0x3847ea,null))[_0xf17e('0x41')](handleError(_0x3847ea,null));};exports[_0xf17e('0x45')]=function(_0x3d0ac5,_0x1ef125){return db[_0xf17e('0x2d')][_0xf17e('0x45')](_0x3d0ac5['body'],{})[_0xf17e('0x26')](respondWithResult(_0x1ef125,0xc9))[_0xf17e('0x41')](handleError(_0x1ef125,null));};exports[_0xf17e('0x25')]=function(_0x149660,_0x191350){if(_0x149660[_0xf17e('0x46')]['id']){delete _0x149660[_0xf17e('0x46')]['id'];}return db['SquareReport'][_0xf17e('0x44')]({'where':{'id':_0x149660[_0xf17e('0x47')]['id']}})['then'](handleEntityNotFound(_0x191350,null))[_0xf17e('0x26')](saveUpdates(_0x149660[_0xf17e('0x46')],null))['then'](respondWithResult(_0x191350,null))[_0xf17e('0x41')](handleError(_0x191350,null));};exports['destroy']=function(_0x4ba332,_0x55c15b){return db[_0xf17e('0x2d')]['find']({'where':{'id':_0x4ba332[_0xf17e('0x47')]['id']}})[_0xf17e('0x26')](handleEntityNotFound(_0x55c15b,null))[_0xf17e('0x26')](removeEntity(_0x55c15b,null))[_0xf17e('0x41')](handleError(_0x55c15b,null));};exports[_0xf17e('0x48')]=function(_0x33cdd9,_0x4997c0){return db[_0xf17e('0x2d')][_0xf17e('0x48')]()[_0xf17e('0x26')](respondWithResult(_0x4997c0,null))[_0xf17e('0x41')](handleError(_0x4997c0,null));};
\ No newline at end of file
+var _0xe7cf=['jsforce','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../mysqldb','sendStatus','end','status','json','count','offset','set','apply','save','update','then','destroy','error','name','send','index','map','SquareReport','rawAttributes','fieldName','type','model','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','limit','order','sort','where','merge','filter','includeAll','include','findAll','catch','show','length','options','find','create','body','params','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto'];(function(_0x579b51,_0x13b2b8){var _0x166c09=function(_0x33741d){while(--_0x33741d){_0x579b51['push'](_0x579b51['shift']());}};_0x166c09(++_0x13b2b8);}(_0xe7cf,0x199));var _0xfe7c=function(_0x48b8ad,_0xe28403){_0x48b8ad=_0x48b8ad-0x0;var _0x4d1bae=_0xe7cf[_0x48b8ad];return _0x4d1bae;};'use strict';var pdf=require(_0xfe7c('0x0'));var emlformat=require(_0xfe7c('0x1'));var rimraf=require(_0xfe7c('0x2'));var zipdir=require(_0xfe7c('0x3'));var jsonpatch=require(_0xfe7c('0x4'));var rp=require(_0xfe7c('0x5'));var moment=require(_0xfe7c('0x6'));var BPromise=require(_0xfe7c('0x7'));var Mustache=require(_0xfe7c('0x8'));var util=require(_0xfe7c('0x9'));var path=require(_0xfe7c('0xa'));var sox=require(_0xfe7c('0xb'));var csv=require(_0xfe7c('0xc'));var ejs=require(_0xfe7c('0xd'));var fs=require('fs');var _=require(_0xfe7c('0xe'));var squel=require(_0xfe7c('0xf'));var crypto=require(_0xfe7c('0x10'));var jsforce=require(_0xfe7c('0x11'));var deskjs=require('desk.js');var toCsv=require(_0xfe7c('0xc'));var querystring=require(_0xfe7c('0x12'));var Papa=require('papaparse');var Redis=require(_0xfe7c('0x13'));var authService=require('../../components/auth/service');var qs=require(_0xfe7c('0x14'));var as=require(_0xfe7c('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xfe7c('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0xfe7c('0x17'))['db'];function respondWithStatusCode(_0x32bc03,_0x11b6a3){_0x11b6a3=_0x11b6a3||0xcc;return function(_0x33d224){if(_0x33d224){return _0x32bc03[_0xfe7c('0x18')](_0x11b6a3);}return _0x32bc03['status'](_0x11b6a3)[_0xfe7c('0x19')]();};}function respondWithResult(_0x258e27,_0x3432dc){_0x3432dc=_0x3432dc||0xc8;return function(_0xb25556){if(_0xb25556){return _0x258e27[_0xfe7c('0x1a')](_0x3432dc)[_0xfe7c('0x1b')](_0xb25556);}};}function respondWithFilteredResult(_0x36ca62,_0x4c63bb){return function(_0x2f7c44){if(_0x2f7c44){var _0x4ee793=_0x2f7c44[_0xfe7c('0x1c')],_0x3650b5=_0x4c63bb['offset'],_0xa7946f=_0x4c63bb[_0xfe7c('0x1d')]+_0x4c63bb['limit'],_0x3e6036;if(_0xa7946f>=_0x4ee793){_0xa7946f=_0x4ee793;_0x3e6036=0xc8;}else{_0x3e6036=0xce;}_0x36ca62[_0xfe7c('0x1a')](_0x3e6036);return _0x36ca62[_0xfe7c('0x1e')]('Content-Range',_0x3650b5+'-'+_0xa7946f+'/'+_0x4ee793)[_0xfe7c('0x1b')](_0x2f7c44);}return null;};}function patchUpdates(_0x36139e){return function(_0xdf4481){try{jsonpatch[_0xfe7c('0x1f')](_0xdf4481,_0x36139e,!![]);}catch(_0x34b87c){return BPromise['reject'](_0x34b87c);}return _0xdf4481[_0xfe7c('0x20')]();};}function saveUpdates(_0x2ea1ce,_0x1f6866){return function(_0x4a1fe8){if(_0x4a1fe8){return _0x4a1fe8[_0xfe7c('0x21')](_0x2ea1ce)[_0xfe7c('0x22')](function(_0x341d86){return _0x341d86;});}return null;};}function removeEntity(_0x3dcaaf,_0x5848fa){return function(_0xa1025b){if(_0xa1025b){return _0xa1025b[_0xfe7c('0x23')]()[_0xfe7c('0x22')](function(){_0x3dcaaf['status'](0xcc)[_0xfe7c('0x19')]();});}};}function handleEntityNotFound(_0x588993,_0x524a8c){return function(_0x3824dc){if(!_0x3824dc){_0x588993['sendStatus'](0x194);}return _0x3824dc;};}function handleError(_0x2b2d16,_0xeb294e){_0xeb294e=_0xeb294e||0x1f4;return function(_0x49ff22){logger[_0xfe7c('0x24')](_0x49ff22['stack']);if(_0x49ff22[_0xfe7c('0x25')]){delete _0x49ff22[_0xfe7c('0x25')];}_0x2b2d16[_0xfe7c('0x1a')](_0xeb294e)[_0xfe7c('0x26')](_0x49ff22);};}exports[_0xfe7c('0x27')]=function(_0x395e64,_0x18f51e){var _0x4fb533={},_0x438fa9={},_0xb40560={'count':0x0,'rows':[]};var _0x100503=_[_0xfe7c('0x28')](db[_0xfe7c('0x29')][_0xfe7c('0x2a')],function(_0x42698a){return{'name':_0x42698a[_0xfe7c('0x2b')],'type':_0x42698a[_0xfe7c('0x2c')]['key']};});_0x438fa9[_0xfe7c('0x2d')]=_[_0xfe7c('0x28')](_0x100503,_0xfe7c('0x25'));_0x438fa9[_0xfe7c('0x2e')]=_['keys'](_0x395e64[_0xfe7c('0x2e')]);_0x438fa9[_0xfe7c('0x2f')]=_[_0xfe7c('0x30')](_0x438fa9[_0xfe7c('0x2d')],_0x438fa9['query']);_0x4fb533['attributes']=_[_0xfe7c('0x30')](_0x438fa9['model'],qs[_0xfe7c('0x31')](_0x395e64[_0xfe7c('0x2e')][_0xfe7c('0x31')]));_0x4fb533[_0xfe7c('0x32')]=_0x4fb533['attributes']['length']?_0x4fb533['attributes']:_0x438fa9[_0xfe7c('0x2d')];if(!_0x395e64[_0xfe7c('0x2e')][_0xfe7c('0x33')](_0xfe7c('0x34'))){_0x4fb533[_0xfe7c('0x35')]=qs[_0xfe7c('0x35')](_0x395e64['query'][_0xfe7c('0x35')]);_0x4fb533['offset']=qs[_0xfe7c('0x1d')](_0x395e64[_0xfe7c('0x2e')][_0xfe7c('0x1d')]);}_0x4fb533[_0xfe7c('0x36')]=qs['sort'](_0x395e64[_0xfe7c('0x2e')][_0xfe7c('0x37')]);_0x4fb533[_0xfe7c('0x38')]=qs[_0xfe7c('0x2f')](_['pick'](_0x395e64[_0xfe7c('0x2e')],_0x438fa9['filters']),_0x100503);if(_0x395e64['query']['filter']){_0x4fb533[_0xfe7c('0x38')]=_[_0xfe7c('0x39')](_0x4fb533[_0xfe7c('0x38')],{'$or':_[_0xfe7c('0x28')](_0x100503,function(_0x28a994){if(_0x28a994['type']!=='VIRTUAL'){var _0x32d437={};_0x32d437[_0x28a994[_0xfe7c('0x25')]]={'$like':'%'+_0x395e64[_0xfe7c('0x2e')][_0xfe7c('0x3a')]+'%'};return _0x32d437;}})});}_0x4fb533=_['merge']({},_0x4fb533,_0x395e64['options']);var _0x4f0a70={'where':_0x4fb533[_0xfe7c('0x38')]};return db[_0xfe7c('0x29')][_0xfe7c('0x1c')](_0x4f0a70)[_0xfe7c('0x22')](function(_0x1fbfd6){_0xb40560[_0xfe7c('0x1c')]=_0x1fbfd6;if(_0x395e64[_0xfe7c('0x2e')][_0xfe7c('0x3b')]){_0x4fb533[_0xfe7c('0x3c')]=[{'all':!![]}];}return db[_0xfe7c('0x29')][_0xfe7c('0x3d')](_0x4fb533);})[_0xfe7c('0x22')](function(_0x10eeb9){_0xb40560['rows']=_0x10eeb9;return _0xb40560;})[_0xfe7c('0x22')](respondWithFilteredResult(_0x18f51e,_0x4fb533))[_0xfe7c('0x3e')](handleError(_0x18f51e,null));};exports[_0xfe7c('0x3f')]=function(_0x25468b,_0x1c605e){var _0x5b5c8e={'raw':!![],'where':{'id':_0x25468b['params']['id']}},_0x11b948={};_0x11b948[_0xfe7c('0x2d')]=_['keys'](db['SquareReport']['rawAttributes']);_0x11b948['query']=_['keys'](_0x25468b[_0xfe7c('0x2e')]);_0x11b948['filters']=_[_0xfe7c('0x30')](_0x11b948[_0xfe7c('0x2d')],_0x11b948[_0xfe7c('0x2e')]);_0x5b5c8e[_0xfe7c('0x32')]=_[_0xfe7c('0x30')](_0x11b948[_0xfe7c('0x2d')],qs['fields'](_0x25468b[_0xfe7c('0x2e')][_0xfe7c('0x31')]));_0x5b5c8e[_0xfe7c('0x32')]=_0x5b5c8e[_0xfe7c('0x32')][_0xfe7c('0x40')]?_0x5b5c8e['attributes']:_0x11b948[_0xfe7c('0x2d')];if(_0x25468b['query'][_0xfe7c('0x3b')]){_0x5b5c8e['include']=[{'all':!![]}];}_0x5b5c8e=_[_0xfe7c('0x39')]({},_0x5b5c8e,_0x25468b[_0xfe7c('0x41')]);return db[_0xfe7c('0x29')][_0xfe7c('0x42')](_0x5b5c8e)[_0xfe7c('0x22')](handleEntityNotFound(_0x1c605e,null))[_0xfe7c('0x22')](respondWithResult(_0x1c605e,null))[_0xfe7c('0x3e')](handleError(_0x1c605e,null));};exports[_0xfe7c('0x43')]=function(_0x36adba,_0x51758a){return db[_0xfe7c('0x29')][_0xfe7c('0x43')](_0x36adba[_0xfe7c('0x44')],{})[_0xfe7c('0x22')](respondWithResult(_0x51758a,0xc9))[_0xfe7c('0x3e')](handleError(_0x51758a,null));};exports[_0xfe7c('0x21')]=function(_0x5d0099,_0x404085){if(_0x5d0099[_0xfe7c('0x44')]['id']){delete _0x5d0099[_0xfe7c('0x44')]['id'];}return db[_0xfe7c('0x29')][_0xfe7c('0x42')]({'where':{'id':_0x5d0099['params']['id']}})['then'](handleEntityNotFound(_0x404085,null))['then'](saveUpdates(_0x5d0099[_0xfe7c('0x44')],null))['then'](respondWithResult(_0x404085,null))[_0xfe7c('0x3e')](handleError(_0x404085,null));};exports[_0xfe7c('0x23')]=function(_0x51352f,_0x187a88){return db[_0xfe7c('0x29')][_0xfe7c('0x42')]({'where':{'id':_0x51352f[_0xfe7c('0x45')]['id']}})[_0xfe7c('0x22')](handleEntityNotFound(_0x187a88,null))[_0xfe7c('0x22')](removeEntity(_0x187a88,null))[_0xfe7c('0x3e')](handleError(_0x187a88,null));};exports[_0xfe7c('0x46')]=function(_0x29fb51,_0x3b7864){return db[_0xfe7c('0x29')]['describe']()['then'](respondWithResult(_0x3b7864,null))['catch'](handleError(_0x3b7864,null));};
\ No newline at end of file
diff --git a/server/api/squareReport/squareReport.model.js b/server/api/squareReport/squareReport.model.js
index 13f71a3..1165e78 100644
--- a/server/api/squareReport/squareReport.model.js
+++ b/server/api/squareReport/squareReport.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xcbc2=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./squareReport.attributes','define','SquareReport','report_square','uniqueid','leaveAt','lodash','../../config/logger','api'];(function(_0xc911b0,_0x4b667a){var _0x8c0c77=function(_0x534140){while(--_0x534140){_0xc911b0['push'](_0xc911b0['shift']());}};_0x8c0c77(++_0x4b667a);}(_0xcbc2,0x1a1));var _0x2cbc=function(_0x30ed7d,_0x238acb){_0x30ed7d=_0x30ed7d-0x0;var _0x50e1fb=_0xcbc2[_0x30ed7d];return _0x50e1fb;};'use strict';var _=require(_0x2cbc('0x0'));var util=require('util');var logger=require(_0x2cbc('0x1'))(_0x2cbc('0x2'));var moment=require(_0x2cbc('0x3'));var BPromise=require(_0x2cbc('0x4'));var rp=require(_0x2cbc('0x5'));var fs=require('fs');var path=require(_0x2cbc('0x6'));var rimraf=require(_0x2cbc('0x7'));var config=require(_0x2cbc('0x8'));var attributes=require(_0x2cbc('0x9'));module['exports']=function(_0x3cd986,_0xa7e98e){return _0x3cd986[_0x2cbc('0xa')](_0x2cbc('0xb'),attributes,{'tableName':_0x2cbc('0xc'),'paranoid':![],'indexes':[{'name':'uid_pname','fields':[_0x2cbc('0xd'),'project_name']},{'name':'leaveAt','fields':[_0x2cbc('0xe')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x8c5d=['define','SquareReport','report_square','uid_pname','uniqueid','leaveAt','lodash','util','../../config/logger','api','request-promise','path','rimraf','../../config/environment','./squareReport.attributes'];(function(_0x30af23,_0x1b9d6a){var _0x5cea96=function(_0x31be06){while(--_0x31be06){_0x30af23['push'](_0x30af23['shift']());}};_0x5cea96(++_0x1b9d6a);}(_0x8c5d,0x123));var _0xd8c5=function(_0x1c9a45,_0x2aa54c){_0x1c9a45=_0x1c9a45-0x0;var _0x20f251=_0x8c5d[_0x1c9a45];return _0x20f251;};'use strict';var _=require(_0xd8c5('0x0'));var util=require(_0xd8c5('0x1'));var logger=require(_0xd8c5('0x2'))(_0xd8c5('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xd8c5('0x4'));var fs=require('fs');var path=require(_0xd8c5('0x5'));var rimraf=require(_0xd8c5('0x6'));var config=require(_0xd8c5('0x7'));var attributes=require(_0xd8c5('0x8'));module['exports']=function(_0x1b0afe,_0x26c52c){return _0x1b0afe[_0xd8c5('0x9')](_0xd8c5('0xa'),attributes,{'tableName':_0xd8c5('0xb'),'paranoid':![],'indexes':[{'name':_0xd8c5('0xc'),'fields':[_0xd8c5('0xd'),'project_name']},{'name':_0xd8c5('0xe'),'fields':[_0xd8c5('0xe')]}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/squareReport/squareReport.rpc.js b/server/api/squareReport/squareReport.rpc.js
index 3b6c79e..813ba62 100644
--- a/server/api/squareReport/squareReport.rpc.js
+++ b/server/api/squareReport/squareReport.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xce60=['request\x20sent','debug','SquareReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','CreateSquareReport','SquareReport','create','body','options','raw','catch','where','attributes','limit','UpdateSquareReport','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','SquareReport,\x20%s,\x20%s'];(function(_0x2a52aa,_0x4e7afc){var _0xb18e58=function(_0x12c95e){while(--_0x12c95e){_0x2a52aa['push'](_0x2a52aa['shift']());}};_0xb18e58(++_0x4e7afc);}(_0xce60,0x171));var _0x0ce6=function(_0x35d3a8,_0x44406a){_0x35d3a8=_0x35d3a8-0x0;var _0x182378=_0xce60[_0x35d3a8];return _0x182378;};'use strict';var _=require(_0x0ce6('0x0'));var util=require(_0x0ce6('0x1'));var moment=require(_0x0ce6('0x2'));var BPromise=require('bluebird');var rs=require(_0x0ce6('0x3'));var fs=require('fs');var Redis=require(_0x0ce6('0x4'));var db=require(_0x0ce6('0x5'))['db'];var utils=require(_0x0ce6('0x6'));var logger=require(_0x0ce6('0x7'))(_0x0ce6('0x8'));var config=require(_0x0ce6('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x0ce6('0xa')][_0x0ce6('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xc395c5,_0x49e692,_0x4cfc7d){return new BPromise(function(_0x590006,_0x9aa658){return client[_0x0ce6('0xc')](_0xc395c5,_0x4cfc7d)[_0x0ce6('0xd')](function(_0x327ab6){logger[_0x0ce6('0xe')](_0x0ce6('0xf'),_0x49e692,_0x0ce6('0x10'));logger[_0x0ce6('0x11')](_0x0ce6('0x12'),_0x49e692,'request\x20sent',JSON[_0x0ce6('0x13')](_0x327ab6));if(_0x327ab6[_0x0ce6('0x14')]){if(_0x327ab6['error'][_0x0ce6('0x15')]===0x1f4){logger[_0x0ce6('0x14')](_0x0ce6('0xf'),_0x49e692,_0x327ab6[_0x0ce6('0x14')][_0x0ce6('0x16')]);return _0x9aa658(_0x327ab6['error'][_0x0ce6('0x16')]);}logger[_0x0ce6('0x14')](_0x0ce6('0xf'),_0x49e692,_0x327ab6[_0x0ce6('0x14')]['message']);return _0x590006(_0x327ab6[_0x0ce6('0x14')][_0x0ce6('0x16')]);}else{logger[_0x0ce6('0xe')](_0x0ce6('0xf'),_0x49e692,'request\x20sent');_0x590006(_0x327ab6[_0x0ce6('0x17')][_0x0ce6('0x16')]);}})['catch'](function(_0x14fe21){logger[_0x0ce6('0x14')](_0x0ce6('0xf'),_0x49e692,_0x14fe21);_0x9aa658(_0x14fe21);});});}exports[_0x0ce6('0x18')]=function(_0x2cf8e6){var _0x2485a7=this;return new Promise(function(_0x1d69bd,_0xdc75af){return db[_0x0ce6('0x19')][_0x0ce6('0x1a')](_0x2cf8e6[_0x0ce6('0x1b')],{'raw':_0x2cf8e6[_0x0ce6('0x1c')]?_0x2cf8e6[_0x0ce6('0x1c')][_0x0ce6('0x1d')]===undefined?!![]:![]:!![]})[_0x0ce6('0xd')](function(_0x1c8ad3){logger[_0x0ce6('0xe')]('CreateSquareReport',_0x2cf8e6);logger['debug']('CreateSquareReport',_0x2cf8e6,JSON[_0x0ce6('0x13')](_0x1c8ad3));_0x1d69bd(_0x1c8ad3);})[_0x0ce6('0x1e')](function(_0x3a8fcc){logger['error'](_0x0ce6('0x18'),_0x3a8fcc[_0x0ce6('0x16')],_0x2cf8e6);_0xdc75af(_0x2485a7[_0x0ce6('0x14')](0x1f4,_0x3a8fcc[_0x0ce6('0x16')]));});});};exports['UpdateSquareReport']=function(_0x1e3f79){var _0x5d5b58=this;return new Promise(function(_0x3f86d8,_0x30e212){return db[_0x0ce6('0x19')]['update'](_0x1e3f79[_0x0ce6('0x1b')],{'raw':_0x1e3f79[_0x0ce6('0x1c')]?_0x1e3f79['options'][_0x0ce6('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1e3f79[_0x0ce6('0x1c')]?_0x1e3f79['options'][_0x0ce6('0x1f')]||null:null,'attributes':_0x1e3f79[_0x0ce6('0x1c')]?_0x1e3f79[_0x0ce6('0x1c')][_0x0ce6('0x20')]||null:null,'limit':_0x1e3f79[_0x0ce6('0x1c')]?_0x1e3f79['options'][_0x0ce6('0x21')]||null:null})[_0x0ce6('0xd')](function(_0x58c46a){logger[_0x0ce6('0xe')](_0x0ce6('0x22'),_0x1e3f79);logger[_0x0ce6('0x11')](_0x0ce6('0x22'),_0x1e3f79,JSON[_0x0ce6('0x13')](_0x58c46a));_0x3f86d8(_0x58c46a);})[_0x0ce6('0x1e')](function(_0x50df11){logger[_0x0ce6('0x14')](_0x0ce6('0x22'),_0x50df11['message'],_0x1e3f79);_0x30e212(_0x5d5b58[_0x0ce6('0x14')](0x1f4,_0x50df11[_0x0ce6('0x16')]));});});};
\ No newline at end of file
+var _0x42f8=['options','raw','UpdateSquareReport','update','body','where','attributes','limit','info','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','jayson/promise','client','http','request','then','SquareReport,\x20%s,\x20%s','request\x20sent','debug','SquareReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateSquareReport','SquareReport','create'];(function(_0x36a2ed,_0x3815d4){var _0x2b7be4=function(_0x19a0e4){while(--_0x19a0e4){_0x36a2ed['push'](_0x36a2ed['shift']());}};_0x2b7be4(++_0x3815d4);}(_0x42f8,0x1d0));var _0x842f=function(_0x5d4765,_0x23cb35){_0x5d4765=_0x5d4765-0x0;var _0x41d345=_0x42f8[_0x5d4765];return _0x41d345;};'use strict';var _=require(_0x842f('0x0'));var util=require(_0x842f('0x1'));var moment=require(_0x842f('0x2'));var BPromise=require(_0x842f('0x3'));var rs=require(_0x842f('0x4'));var fs=require('fs');var Redis=require(_0x842f('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x842f('0x6'));var logger=require('../../config/logger')(_0x842f('0x7'));var config=require('../../config/environment');var jayson=require(_0x842f('0x8'));var client=jayson[_0x842f('0x9')][_0x842f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x527828,_0x3486ea,_0x5cd959){return new BPromise(function(_0x315534,_0x35a1f8){return client[_0x842f('0xb')](_0x527828,_0x5cd959)[_0x842f('0xc')](function(_0x192d95){logger['info'](_0x842f('0xd'),_0x3486ea,_0x842f('0xe'));logger[_0x842f('0xf')](_0x842f('0x10'),_0x3486ea,'request\x20sent',JSON[_0x842f('0x11')](_0x192d95));if(_0x192d95['error']){if(_0x192d95[_0x842f('0x12')][_0x842f('0x13')]===0x1f4){logger[_0x842f('0x12')](_0x842f('0xd'),_0x3486ea,_0x192d95[_0x842f('0x12')][_0x842f('0x14')]);return _0x35a1f8(_0x192d95[_0x842f('0x12')][_0x842f('0x14')]);}logger[_0x842f('0x12')](_0x842f('0xd'),_0x3486ea,_0x192d95['error'][_0x842f('0x14')]);return _0x315534(_0x192d95[_0x842f('0x12')][_0x842f('0x14')]);}else{logger['info'](_0x842f('0xd'),_0x3486ea,_0x842f('0xe'));_0x315534(_0x192d95[_0x842f('0x15')][_0x842f('0x14')]);}})[_0x842f('0x16')](function(_0x1a827a){logger[_0x842f('0x12')](_0x842f('0xd'),_0x3486ea,_0x1a827a);_0x35a1f8(_0x1a827a);});});}exports[_0x842f('0x17')]=function(_0x7b107c){var _0x3da415=this;return new Promise(function(_0x5bfecc,_0x4378d2){return db[_0x842f('0x18')][_0x842f('0x19')](_0x7b107c['body'],{'raw':_0x7b107c[_0x842f('0x1a')]?_0x7b107c[_0x842f('0x1a')][_0x842f('0x1b')]===undefined?!![]:![]:!![]})[_0x842f('0xc')](function(_0x2424ca){logger['info'](_0x842f('0x17'),_0x7b107c);logger[_0x842f('0xf')](_0x842f('0x17'),_0x7b107c,JSON[_0x842f('0x11')](_0x2424ca));_0x5bfecc(_0x2424ca);})[_0x842f('0x16')](function(_0x2c4c8c){logger[_0x842f('0x12')]('CreateSquareReport',_0x2c4c8c['message'],_0x7b107c);_0x4378d2(_0x3da415[_0x842f('0x12')](0x1f4,_0x2c4c8c[_0x842f('0x14')]));});});};exports[_0x842f('0x1c')]=function(_0x134795){var _0x418c1c=this;return new Promise(function(_0xc007da,_0x41d152){return db[_0x842f('0x18')][_0x842f('0x1d')](_0x134795[_0x842f('0x1e')],{'raw':_0x134795['options']?_0x134795[_0x842f('0x1a')][_0x842f('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x134795['options']?_0x134795[_0x842f('0x1a')][_0x842f('0x1f')]||null:null,'attributes':_0x134795[_0x842f('0x1a')]?_0x134795[_0x842f('0x1a')][_0x842f('0x20')]||null:null,'limit':_0x134795[_0x842f('0x1a')]?_0x134795['options'][_0x842f('0x21')]||null:null})['then'](function(_0x4b96c9){logger[_0x842f('0x22')]('UpdateSquareReport',_0x134795);logger['debug'](_0x842f('0x1c'),_0x134795,JSON[_0x842f('0x11')](_0x4b96c9));_0xc007da(_0x4b96c9);})['catch'](function(_0x4ac1a4){logger[_0x842f('0x12')]('UpdateSquareReport',_0x4ac1a4[_0x842f('0x14')],_0x134795);_0x41d152(_0x418c1c[_0x842f('0x12')](0x1f4,_0x4ac1a4[_0x842f('0x14')]));});});};
\ No newline at end of file
diff --git a/server/api/squareReportDetail/index.js b/server/api/squareReportDetail/index.js
index a27d77a..b8d0f17 100644
--- a/server/api/squareReportDetail/index.js
+++ b/server/api/squareReportDetail/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x814b=['path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./squareReportDetail.controller','get','isAuthenticated','index','/describe','/:id','show','post','create','put','update','destroy','exports','multer','util'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x814b,0x1a2));var _0xb814=function(_0x8b0f43,_0x1c57b8){_0x8b0f43=_0x8b0f43-0x0;var _0x3f4425=_0x814b[_0x8b0f43];return _0x3f4425;};'use strict';var multer=require(_0xb814('0x0'));var util=require(_0xb814('0x1'));var path=require(_0xb814('0x2'));var timeout=require(_0xb814('0x3'));var express=require(_0xb814('0x4'));var router=express[_0xb814('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0xb814('0x6'));var config=require(_0xb814('0x7'));var controller=require(_0xb814('0x8'));router[_0xb814('0x9')]('/',auth[_0xb814('0xa')](),controller[_0xb814('0xb')]);router['get'](_0xb814('0xc'),auth[_0xb814('0xa')](),controller['describe']);router[_0xb814('0x9')](_0xb814('0xd'),auth[_0xb814('0xa')](),controller[_0xb814('0xe')]);router[_0xb814('0xf')]('/',auth[_0xb814('0xa')](),controller[_0xb814('0x10')]);router[_0xb814('0x11')](_0xb814('0xd'),auth[_0xb814('0xa')](),controller[_0xb814('0x12')]);router['delete'](_0xb814('0xd'),auth['isAuthenticated'](),controller[_0xb814('0x13')]);module[_0xb814('0x14')]=router;
\ No newline at end of file
+var _0x7a54=['describe','/:id','create','delete','destroy','exports','multer','util','path','express','Router','../../components/interaction/service','../../config/environment','./squareReportDetail.controller','get','isAuthenticated'];(function(_0x3c09b1,_0x5b250f){var _0x5b1322=function(_0x97a49d){while(--_0x97a49d){_0x3c09b1['push'](_0x3c09b1['shift']());}};_0x5b1322(++_0x5b250f);}(_0x7a54,0x106));var _0x47a5=function(_0x59035f,_0x4172b4){_0x59035f=_0x59035f-0x0;var _0x4c1d16=_0x7a54[_0x59035f];return _0x4c1d16;};'use strict';var multer=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var path=require(_0x47a5('0x2'));var timeout=require('connect-timeout');var express=require(_0x47a5('0x3'));var router=express[_0x47a5('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x47a5('0x5'));var config=require(_0x47a5('0x6'));var controller=require(_0x47a5('0x7'));router[_0x47a5('0x8')]('/',auth[_0x47a5('0x9')](),controller['index']);router[_0x47a5('0x8')]('/describe',auth[_0x47a5('0x9')](),controller[_0x47a5('0xa')]);router['get'](_0x47a5('0xb'),auth['isAuthenticated'](),controller['show']);router['post']('/',auth[_0x47a5('0x9')](),controller[_0x47a5('0xc')]);router['put'](_0x47a5('0xb'),auth['isAuthenticated'](),controller['update']);router[_0x47a5('0xd')](_0x47a5('0xb'),auth[_0x47a5('0x9')](),controller[_0x47a5('0xe')]);module[_0x47a5('0xf')]=router;
\ No newline at end of file
diff --git a/server/api/squareReportDetail/squareReportDetail.attributes.js b/server/api/squareReportDetail/squareReportDetail.attributes.js
index 0688a1c..c4023e3 100644
--- a/server/api/squareReportDetail/squareReportDetail.attributes.js
+++ b/server/api/squareReportDetail/squareReportDetail.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xcda3=['TEXT','sequelize','STRING'];(function(_0x1d1f1b,_0x439099){var _0x39b37b=function(_0x38613e){while(--_0x38613e){_0x1d1f1b['push'](_0x1d1f1b['shift']());}};_0x39b37b(++_0x439099);}(_0xcda3,0x70));var _0x3cda=function(_0x422905,_0x3bce3a){_0x422905=_0x422905-0x0;var _0x33dc6c=_0xcda3[_0x422905];return _0x33dc6c;};'use strict';var Sequelize=require(_0x3cda('0x0'));module['exports']={'uniqueid':{'type':Sequelize['STRING']},'node':{'type':Sequelize[_0x3cda('0x1')]},'application':{'type':Sequelize['STRING']},'data':{'type':Sequelize[_0x3cda('0x2')]},'project_name':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0xa7a5=['STRING','sequelize'];(function(_0x3077cc,_0x35a7b6){var _0x478d80=function(_0x504d56){while(--_0x504d56){_0x3077cc['push'](_0x3077cc['shift']());}};_0x478d80(++_0x35a7b6);}(_0xa7a5,0x127));var _0x5a7a=function(_0x5c26e2,_0x219e65){_0x5c26e2=_0x5c26e2-0x0;var _0x458898=_0xa7a5[_0x5c26e2];return _0x458898;};'use strict';var Sequelize=require(_0x5a7a('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0x5a7a('0x1')]},'node':{'type':Sequelize[_0x5a7a('0x1')]},'application':{'type':Sequelize['STRING']},'data':{'type':Sequelize['TEXT']},'project_name':{'type':Sequelize[_0x5a7a('0x1')]},'callerid':{'type':Sequelize[_0x5a7a('0x1')]}};
\ No newline at end of file
diff --git a/server/api/squareReportDetail/squareReportDetail.controller.js b/server/api/squareReportDetail/squareReportDetail.controller.js
index 422a90c..e578455 100644
--- a/server/api/squareReportDetail/squareReportDetail.controller.js
+++ b/server/api/squareReportDetail/squareReportDetail.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xeeab=['rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../mysqldb','sendStatus','status','end','json','count','offset','limit','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','SquareDetailsReport','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','create','body','find','describe','html-pdf','eml-format'];(function(_0x21a7ed,_0x22e4be){var _0x1ce3c2=function(_0x3cccd5){while(--_0x3cccd5){_0x21a7ed['push'](_0x21a7ed['shift']());}};_0x1ce3c2(++_0x22e4be);}(_0xeeab,0x92));var _0xbeea=function(_0x594dc4,_0x407740){_0x594dc4=_0x594dc4-0x0;var _0x2a9880=_0xeeab[_0x594dc4];return _0x2a9880;};'use strict';var pdf=require(_0xbeea('0x0'));var emlformat=require(_0xbeea('0x1'));var rimraf=require(_0xbeea('0x2'));var zipdir=require(_0xbeea('0x3'));var jsonpatch=require(_0xbeea('0x4'));var rp=require(_0xbeea('0x5'));var moment=require('moment');var BPromise=require(_0xbeea('0x6'));var Mustache=require(_0xbeea('0x7'));var util=require(_0xbeea('0x8'));var path=require('path');var sox=require(_0xbeea('0x9'));var csv=require(_0xbeea('0xa'));var ejs=require(_0xbeea('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0xbeea('0xc'));var crypto=require(_0xbeea('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xbeea('0xe'));var toCsv=require(_0xbeea('0xa'));var querystring=require('querystring');var Papa=require(_0xbeea('0xf'));var Redis=require(_0xbeea('0x10'));var authService=require(_0xbeea('0x11'));var qs=require(_0xbeea('0x12'));var as=require(_0xbeea('0x13'));var hardwareService=require(_0xbeea('0x14'));var logger=require(_0xbeea('0x15'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0xbeea('0x16'))['db'];function respondWithStatusCode(_0x222080,_0x29f53f){_0x29f53f=_0x29f53f||0xcc;return function(_0x11288c){if(_0x11288c){return _0x222080[_0xbeea('0x17')](_0x29f53f);}return _0x222080[_0xbeea('0x18')](_0x29f53f)[_0xbeea('0x19')]();};}function respondWithResult(_0x2df8b8,_0x1b1889){_0x1b1889=_0x1b1889||0xc8;return function(_0x5acec5){if(_0x5acec5){return _0x2df8b8[_0xbeea('0x18')](_0x1b1889)[_0xbeea('0x1a')](_0x5acec5);}};}function respondWithFilteredResult(_0x3393df,_0x4bba61){return function(_0x3c2a7d){if(_0x3c2a7d){var _0x50901b=_0x3c2a7d[_0xbeea('0x1b')],_0x37865a=_0x4bba61[_0xbeea('0x1c')],_0x360a6e=_0x4bba61[_0xbeea('0x1c')]+_0x4bba61[_0xbeea('0x1d')],_0x1d269c;if(_0x360a6e>=_0x50901b){_0x360a6e=_0x50901b;_0x1d269c=0xc8;}else{_0x1d269c=0xce;}_0x3393df[_0xbeea('0x18')](_0x1d269c);return _0x3393df['set'](_0xbeea('0x1e'),_0x37865a+'-'+_0x360a6e+'/'+_0x50901b)[_0xbeea('0x1a')](_0x3c2a7d);}return null;};}function patchUpdates(_0x31dc39){return function(_0x55613a){try{jsonpatch[_0xbeea('0x1f')](_0x55613a,_0x31dc39,!![]);}catch(_0x12366e){return BPromise[_0xbeea('0x20')](_0x12366e);}return _0x55613a[_0xbeea('0x21')]();};}function saveUpdates(_0x559650,_0x46095a){return function(_0x2db3ef){if(_0x2db3ef){return _0x2db3ef[_0xbeea('0x22')](_0x559650)[_0xbeea('0x23')](function(_0x586b48){return _0x586b48;});}return null;};}function removeEntity(_0x36eabf,_0x3a5661){return function(_0x4d02f6){if(_0x4d02f6){return _0x4d02f6[_0xbeea('0x24')]()[_0xbeea('0x23')](function(){_0x36eabf['status'](0xcc)[_0xbeea('0x19')]();});}};}function handleEntityNotFound(_0x1f3efe,_0x823015){return function(_0x1087c4){if(!_0x1087c4){_0x1f3efe['sendStatus'](0x194);}return _0x1087c4;};}function handleError(_0xb4f591,_0x3d5fc8){_0x3d5fc8=_0x3d5fc8||0x1f4;return function(_0x13b68d){logger[_0xbeea('0x25')](_0x13b68d[_0xbeea('0x26')]);if(_0x13b68d['name']){delete _0x13b68d[_0xbeea('0x27')];}_0xb4f591[_0xbeea('0x18')](_0x3d5fc8)[_0xbeea('0x28')](_0x13b68d);};}exports[_0xbeea('0x29')]=function(_0x20c789,_0x21aa9f){var _0x12aa24={},_0x586e42={},_0x4fb224={'count':0x0,'rows':[]};var _0xea9fc8=_[_0xbeea('0x2a')](db[_0xbeea('0x2b')][_0xbeea('0x2c')],function(_0x207728){return{'name':_0x207728[_0xbeea('0x2d')],'type':_0x207728['type'][_0xbeea('0x2e')]};});_0x586e42[_0xbeea('0x2f')]=_['map'](_0xea9fc8,'name');_0x586e42[_0xbeea('0x30')]=_[_0xbeea('0x31')](_0x20c789[_0xbeea('0x30')]);_0x586e42[_0xbeea('0x32')]=_[_0xbeea('0x33')](_0x586e42[_0xbeea('0x2f')],_0x586e42[_0xbeea('0x30')]);_0x12aa24[_0xbeea('0x34')]=_['intersection'](_0x586e42[_0xbeea('0x2f')],qs[_0xbeea('0x35')](_0x20c789[_0xbeea('0x30')][_0xbeea('0x35')]));_0x12aa24[_0xbeea('0x34')]=_0x12aa24[_0xbeea('0x34')][_0xbeea('0x36')]?_0x12aa24[_0xbeea('0x34')]:_0x586e42[_0xbeea('0x2f')];if(!_0x20c789[_0xbeea('0x30')]['hasOwnProperty'](_0xbeea('0x37'))){_0x12aa24[_0xbeea('0x1d')]=qs[_0xbeea('0x1d')](_0x20c789['query']['limit']);_0x12aa24['offset']=qs[_0xbeea('0x1c')](_0x20c789['query'][_0xbeea('0x1c')]);}_0x12aa24[_0xbeea('0x38')]=qs[_0xbeea('0x39')](_0x20c789[_0xbeea('0x30')]['sort']);_0x12aa24[_0xbeea('0x3a')]=qs['filters'](_[_0xbeea('0x3b')](_0x20c789[_0xbeea('0x30')],_0x586e42['filters']),_0xea9fc8);if(_0x20c789['query'][_0xbeea('0x3c')]){_0x12aa24[_0xbeea('0x3a')]=_[_0xbeea('0x3d')](_0x12aa24[_0xbeea('0x3a')],{'$or':_[_0xbeea('0x2a')](_0xea9fc8,function(_0x367659){if(_0x367659['type']!=='VIRTUAL'){var _0x15ca57={};_0x15ca57[_0x367659['name']]={'$like':'%'+_0x20c789[_0xbeea('0x30')]['filter']+'%'};return _0x15ca57;}})});}_0x12aa24=_['merge']({},_0x12aa24,_0x20c789[_0xbeea('0x3e')]);var _0x421c7c={'where':_0x12aa24['where']};return db[_0xbeea('0x2b')][_0xbeea('0x1b')](_0x421c7c)['then'](function(_0x3abff6){_0x4fb224['count']=_0x3abff6;if(_0x20c789['query'][_0xbeea('0x3f')]){_0x12aa24[_0xbeea('0x40')]=[{'all':!![]}];}return db[_0xbeea('0x2b')][_0xbeea('0x41')](_0x12aa24);})['then'](function(_0x228f78){_0x4fb224[_0xbeea('0x42')]=_0x228f78;return _0x4fb224;})[_0xbeea('0x23')](respondWithFilteredResult(_0x21aa9f,_0x12aa24))[_0xbeea('0x43')](handleError(_0x21aa9f,null));};exports[_0xbeea('0x44')]=function(_0x162591,_0x17140c){var _0x4ee33c={'raw':!![],'where':{'id':_0x162591[_0xbeea('0x45')]['id']}},_0x130fc7={};_0x130fc7['model']=_[_0xbeea('0x31')](db['SquareDetailsReport']['rawAttributes']);_0x130fc7[_0xbeea('0x30')]=_[_0xbeea('0x31')](_0x162591[_0xbeea('0x30')]);_0x130fc7['filters']=_[_0xbeea('0x33')](_0x130fc7['model'],_0x130fc7['query']);_0x4ee33c[_0xbeea('0x34')]=_['intersection'](_0x130fc7[_0xbeea('0x2f')],qs[_0xbeea('0x35')](_0x162591[_0xbeea('0x30')]['fields']));_0x4ee33c[_0xbeea('0x34')]=_0x4ee33c[_0xbeea('0x34')]['length']?_0x4ee33c[_0xbeea('0x34')]:_0x130fc7[_0xbeea('0x2f')];if(_0x162591[_0xbeea('0x30')]['includeAll']){_0x4ee33c[_0xbeea('0x40')]=[{'all':!![]}];}_0x4ee33c=_[_0xbeea('0x3d')]({},_0x4ee33c,_0x162591[_0xbeea('0x3e')]);return db[_0xbeea('0x2b')]['find'](_0x4ee33c)[_0xbeea('0x23')](handleEntityNotFound(_0x17140c,null))['then'](respondWithResult(_0x17140c,null))[_0xbeea('0x43')](handleError(_0x17140c,null));};exports[_0xbeea('0x46')]=function(_0x16e556,_0x500373){return db[_0xbeea('0x2b')][_0xbeea('0x46')](_0x16e556[_0xbeea('0x47')],{})[_0xbeea('0x23')](respondWithResult(_0x500373,0xc9))[_0xbeea('0x43')](handleError(_0x500373,null));};exports[_0xbeea('0x22')]=function(_0x282923,_0x266856){if(_0x282923[_0xbeea('0x47')]['id']){delete _0x282923[_0xbeea('0x47')]['id'];}return db['SquareDetailsReport'][_0xbeea('0x48')]({'where':{'id':_0x282923[_0xbeea('0x45')]['id']}})['then'](handleEntityNotFound(_0x266856,null))[_0xbeea('0x23')](saveUpdates(_0x282923[_0xbeea('0x47')],null))[_0xbeea('0x23')](respondWithResult(_0x266856,null))[_0xbeea('0x43')](handleError(_0x266856,null));};exports[_0xbeea('0x24')]=function(_0x31642d,_0x16c680){return db[_0xbeea('0x2b')][_0xbeea('0x48')]({'where':{'id':_0x31642d['params']['id']}})[_0xbeea('0x23')](handleEntityNotFound(_0x16c680,null))[_0xbeea('0x23')](removeEntity(_0x16c680,null))[_0xbeea('0x43')](handleError(_0x16c680,null));};exports[_0xbeea('0x49')]=function(_0x40fe7a,_0x39c86d){return db['SquareDetailsReport'][_0xbeea('0x49')]()['then'](respondWithResult(_0x39c86d,null))[_0xbeea('0x43')](handleError(_0x39c86d,null));};
\ No newline at end of file
+var _0xd169=['sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/environment','sendStatus','status','end','json','count','offset','limit','set','Content-Range','reject','save','update','then','error','stack','name','index','fieldName','type','key','map','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','options','SquareDetailsReport','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','create','body','destroy','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path'];(function(_0x59342a,_0x16827b){var _0x17abc9=function(_0x2f7bfc){while(--_0x2f7bfc){_0x59342a['push'](_0x59342a['shift']());}};_0x17abc9(++_0x16827b);}(_0xd169,0x164));var _0x9d16=function(_0x38ced4,_0x24263f){_0x38ced4=_0x38ced4-0x0;var _0x547c07=_0xd169[_0x38ced4];return _0x547c07;};'use strict';var pdf=require(_0x9d16('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x9d16('0x1'));var zipdir=require(_0x9d16('0x2'));var jsonpatch=require(_0x9d16('0x3'));var rp=require(_0x9d16('0x4'));var moment=require(_0x9d16('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x9d16('0x6'));var util=require(_0x9d16('0x7'));var path=require(_0x9d16('0x8'));var sox=require(_0x9d16('0x9'));var csv=require('to-csv');var ejs=require(_0x9d16('0xa'));var fs=require('fs');var _=require(_0x9d16('0xb'));var squel=require(_0x9d16('0xc'));var crypto=require(_0x9d16('0xd'));var jsforce=require(_0x9d16('0xe'));var deskjs=require(_0x9d16('0xf'));var toCsv=require(_0x9d16('0x10'));var querystring=require(_0x9d16('0x11'));var Papa=require(_0x9d16('0x12'));var Redis=require(_0x9d16('0x13'));var authService=require(_0x9d16('0x14'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9d16('0x15'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x9d16('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x342082,_0x2cd914){_0x2cd914=_0x2cd914||0xcc;return function(_0x445377){if(_0x445377){return _0x342082[_0x9d16('0x17')](_0x2cd914);}return _0x342082[_0x9d16('0x18')](_0x2cd914)[_0x9d16('0x19')]();};}function respondWithResult(_0x4982a9,_0x543ac5){_0x543ac5=_0x543ac5||0xc8;return function(_0x14f9f9){if(_0x14f9f9){return _0x4982a9[_0x9d16('0x18')](_0x543ac5)[_0x9d16('0x1a')](_0x14f9f9);}};}function respondWithFilteredResult(_0x27c136,_0x444dd0){return function(_0x3e5ce9){if(_0x3e5ce9){var _0x465b8a=_0x3e5ce9[_0x9d16('0x1b')],_0x497267=_0x444dd0[_0x9d16('0x1c')],_0x2d6d1d=_0x444dd0[_0x9d16('0x1c')]+_0x444dd0[_0x9d16('0x1d')],_0x1b525f;if(_0x2d6d1d>=_0x465b8a){_0x2d6d1d=_0x465b8a;_0x1b525f=0xc8;}else{_0x1b525f=0xce;}_0x27c136[_0x9d16('0x18')](_0x1b525f);return _0x27c136[_0x9d16('0x1e')](_0x9d16('0x1f'),_0x497267+'-'+_0x2d6d1d+'/'+_0x465b8a)[_0x9d16('0x1a')](_0x3e5ce9);}return null;};}function patchUpdates(_0x32cb72){return function(_0x2a9a4e){try{jsonpatch['apply'](_0x2a9a4e,_0x32cb72,!![]);}catch(_0x5e9e49){return BPromise[_0x9d16('0x20')](_0x5e9e49);}return _0x2a9a4e[_0x9d16('0x21')]();};}function saveUpdates(_0x585f5c,_0x4edeab){return function(_0x513097){if(_0x513097){return _0x513097[_0x9d16('0x22')](_0x585f5c)[_0x9d16('0x23')](function(_0x456a03){return _0x456a03;});}return null;};}function removeEntity(_0x3a8b09,_0x4eacbf){return function(_0x48c835){if(_0x48c835){return _0x48c835['destroy']()[_0x9d16('0x23')](function(){_0x3a8b09[_0x9d16('0x18')](0xcc)[_0x9d16('0x19')]();});}};}function handleEntityNotFound(_0x4d8b5d,_0x4de43c){return function(_0x85751e){if(!_0x85751e){_0x4d8b5d[_0x9d16('0x17')](0x194);}return _0x85751e;};}function handleError(_0x4dccf0,_0x4c5ba6){_0x4c5ba6=_0x4c5ba6||0x1f4;return function(_0x3151e3){logger[_0x9d16('0x24')](_0x3151e3[_0x9d16('0x25')]);if(_0x3151e3[_0x9d16('0x26')]){delete _0x3151e3[_0x9d16('0x26')];}_0x4dccf0[_0x9d16('0x18')](_0x4c5ba6)['send'](_0x3151e3);};}exports[_0x9d16('0x27')]=function(_0x78cb57,_0xe9025f){var _0x21bc9c={},_0x453821={},_0x5064b1={'count':0x0,'rows':[]};var _0x67c2d9=_['map'](db['SquareDetailsReport']['rawAttributes'],function(_0x37a310){return{'name':_0x37a310[_0x9d16('0x28')],'type':_0x37a310[_0x9d16('0x29')][_0x9d16('0x2a')]};});_0x453821['model']=_[_0x9d16('0x2b')](_0x67c2d9,_0x9d16('0x26'));_0x453821[_0x9d16('0x2c')]=_[_0x9d16('0x2d')](_0x78cb57[_0x9d16('0x2c')]);_0x453821[_0x9d16('0x2e')]=_[_0x9d16('0x2f')](_0x453821[_0x9d16('0x30')],_0x453821[_0x9d16('0x2c')]);_0x21bc9c['attributes']=_[_0x9d16('0x2f')](_0x453821['model'],qs[_0x9d16('0x31')](_0x78cb57[_0x9d16('0x2c')][_0x9d16('0x31')]));_0x21bc9c[_0x9d16('0x32')]=_0x21bc9c['attributes'][_0x9d16('0x33')]?_0x21bc9c[_0x9d16('0x32')]:_0x453821[_0x9d16('0x30')];if(!_0x78cb57['query'][_0x9d16('0x34')](_0x9d16('0x35'))){_0x21bc9c['limit']=qs['limit'](_0x78cb57[_0x9d16('0x2c')][_0x9d16('0x1d')]);_0x21bc9c[_0x9d16('0x1c')]=qs['offset'](_0x78cb57['query']['offset']);}_0x21bc9c[_0x9d16('0x36')]=qs[_0x9d16('0x37')](_0x78cb57['query'][_0x9d16('0x37')]);_0x21bc9c[_0x9d16('0x38')]=qs[_0x9d16('0x2e')](_['pick'](_0x78cb57['query'],_0x453821['filters']),_0x67c2d9);if(_0x78cb57[_0x9d16('0x2c')][_0x9d16('0x39')]){_0x21bc9c[_0x9d16('0x38')]=_[_0x9d16('0x3a')](_0x21bc9c['where'],{'$or':_[_0x9d16('0x2b')](_0x67c2d9,function(_0x38022e){if(_0x38022e[_0x9d16('0x29')]!=='VIRTUAL'){var _0x479ab8={};_0x479ab8[_0x38022e['name']]={'$like':'%'+_0x78cb57[_0x9d16('0x2c')][_0x9d16('0x39')]+'%'};return _0x479ab8;}})});}_0x21bc9c=_[_0x9d16('0x3a')]({},_0x21bc9c,_0x78cb57[_0x9d16('0x3b')]);var _0x2df555={'where':_0x21bc9c[_0x9d16('0x38')]};return db[_0x9d16('0x3c')][_0x9d16('0x1b')](_0x2df555)[_0x9d16('0x23')](function(_0x2d0ead){_0x5064b1[_0x9d16('0x1b')]=_0x2d0ead;if(_0x78cb57[_0x9d16('0x2c')][_0x9d16('0x3d')]){_0x21bc9c[_0x9d16('0x3e')]=[{'all':!![]}];}return db['SquareDetailsReport'][_0x9d16('0x3f')](_0x21bc9c);})[_0x9d16('0x23')](function(_0x50b563){_0x5064b1[_0x9d16('0x40')]=_0x50b563;return _0x5064b1;})[_0x9d16('0x23')](respondWithFilteredResult(_0xe9025f,_0x21bc9c))[_0x9d16('0x41')](handleError(_0xe9025f,null));};exports[_0x9d16('0x42')]=function(_0x333ac2,_0x49d17f){var _0x2034f0={'raw':!![],'where':{'id':_0x333ac2[_0x9d16('0x43')]['id']}},_0x288f48={};_0x288f48[_0x9d16('0x30')]=_[_0x9d16('0x2d')](db['SquareDetailsReport'][_0x9d16('0x44')]);_0x288f48[_0x9d16('0x2c')]=_[_0x9d16('0x2d')](_0x333ac2['query']);_0x288f48[_0x9d16('0x2e')]=_['intersection'](_0x288f48[_0x9d16('0x30')],_0x288f48[_0x9d16('0x2c')]);_0x2034f0[_0x9d16('0x32')]=_[_0x9d16('0x2f')](_0x288f48[_0x9d16('0x30')],qs[_0x9d16('0x31')](_0x333ac2['query']['fields']));_0x2034f0[_0x9d16('0x32')]=_0x2034f0[_0x9d16('0x32')][_0x9d16('0x33')]?_0x2034f0[_0x9d16('0x32')]:_0x288f48[_0x9d16('0x30')];if(_0x333ac2[_0x9d16('0x2c')][_0x9d16('0x3d')]){_0x2034f0[_0x9d16('0x3e')]=[{'all':!![]}];}_0x2034f0=_['merge']({},_0x2034f0,_0x333ac2[_0x9d16('0x3b')]);return db[_0x9d16('0x3c')][_0x9d16('0x45')](_0x2034f0)[_0x9d16('0x23')](handleEntityNotFound(_0x49d17f,null))['then'](respondWithResult(_0x49d17f,null))[_0x9d16('0x41')](handleError(_0x49d17f,null));};exports[_0x9d16('0x46')]=function(_0x137830,_0x2aaf1a){return db[_0x9d16('0x3c')][_0x9d16('0x46')](_0x137830[_0x9d16('0x47')],{})['then'](respondWithResult(_0x2aaf1a,0xc9))['catch'](handleError(_0x2aaf1a,null));};exports[_0x9d16('0x22')]=function(_0x4fdf64,_0x8eea70){if(_0x4fdf64[_0x9d16('0x47')]['id']){delete _0x4fdf64['body']['id'];}return db['SquareDetailsReport'][_0x9d16('0x45')]({'where':{'id':_0x4fdf64[_0x9d16('0x43')]['id']}})[_0x9d16('0x23')](handleEntityNotFound(_0x8eea70,null))[_0x9d16('0x23')](saveUpdates(_0x4fdf64[_0x9d16('0x47')],null))[_0x9d16('0x23')](respondWithResult(_0x8eea70,null))[_0x9d16('0x41')](handleError(_0x8eea70,null));};exports[_0x9d16('0x48')]=function(_0x4bed1f,_0x2892cf){return db[_0x9d16('0x3c')][_0x9d16('0x45')]({'where':{'id':_0x4bed1f[_0x9d16('0x43')]['id']}})[_0x9d16('0x23')](handleEntityNotFound(_0x2892cf,null))[_0x9d16('0x23')](removeEntity(_0x2892cf,null))[_0x9d16('0x41')](handleError(_0x2892cf,null));};exports['describe']=function(_0x3eb44d,_0x4f141c){return db[_0x9d16('0x3c')]['describe']()[_0x9d16('0x23')](respondWithResult(_0x4f141c,null))[_0x9d16('0x41')](handleError(_0x4f141c,null));};
\ No newline at end of file
diff --git a/server/api/squareReportDetail/squareReportDetail.model.js b/server/api/squareReportDetail/squareReportDetail.model.js
index c201fbd..9bf094a 100644
--- a/server/api/squareReportDetail/squareReportDetail.model.js
+++ b/server/api/squareReportDetail/squareReportDetail.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xb05f=['util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./squareReportDetail.attributes','define','SquareDetailsReport','report_square_details','lodash'];(function(_0x2a08b8,_0xba6d80){var _0x2c3628=function(_0x227942){while(--_0x227942){_0x2a08b8['push'](_0x2a08b8['shift']());}};_0x2c3628(++_0xba6d80);}(_0xb05f,0x185));var _0xfb05=function(_0x473908,_0x3cb043){_0x473908=_0x473908-0x0;var _0x5c1d9f=_0xb05f[_0x473908];return _0x5c1d9f;};'use strict';var _=require(_0xfb05('0x0'));var util=require(_0xfb05('0x1'));var logger=require(_0xfb05('0x2'))('api');var moment=require(_0xfb05('0x3'));var BPromise=require(_0xfb05('0x4'));var rp=require(_0xfb05('0x5'));var fs=require('fs');var path=require(_0xfb05('0x6'));var rimraf=require(_0xfb05('0x7'));var config=require(_0xfb05('0x8'));var attributes=require(_0xfb05('0x9'));module['exports']=function(_0x3d75b6,_0x17c334){return _0x3d75b6[_0xfb05('0xa')](_0xfb05('0xb'),attributes,{'tableName':_0xfb05('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x369c=['define','report_square_details','lodash','util','../../config/logger','api','path','rimraf'];(function(_0x18367d,_0x3790db){var _0x2efbf9=function(_0x3304d5){while(--_0x3304d5){_0x18367d['push'](_0x18367d['shift']());}};_0x2efbf9(++_0x3790db);}(_0x369c,0x12a));var _0xc369=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x369c[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xc369('0x0'));var util=require(_0xc369('0x1'));var logger=require(_0xc369('0x2'))(_0xc369('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xc369('0x4'));var rimraf=require(_0xc369('0x5'));var config=require('../../config/environment');var attributes=require('./squareReportDetail.attributes');module['exports']=function(_0xe41750,_0x10984a){return _0xe41750[_0xc369('0x6')]('SquareDetailsReport',attributes,{'tableName':_0xc369('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/squareReportDetail/squareReportDetail.rpc.js b/server/api/squareReportDetail/squareReportDetail.rpc.js
index 230be12..6b6943f 100644
--- a/server/api/squareReportDetail/squareReportDetail.rpc.js
+++ b/server/api/squareReportDetail/squareReportDetail.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xb5da=['../../config/environment','jayson/promise','client','then','SquareDetailsReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','info','result','catch','CreateSquareDetailsReport','SquareDetailsReport','create','options','raw','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc'];(function(_0x88a93,_0x30b485){var _0x1b2497=function(_0x200478){while(--_0x200478){_0x88a93['push'](_0x88a93['shift']());}};_0x1b2497(++_0x30b485);}(_0xb5da,0xae));var _0xab5d=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0xb5da[_0x17d9e3];return _0x14192d;};'use strict';var _=require('lodash');var util=require(_0xab5d('0x0'));var moment=require(_0xab5d('0x1'));var BPromise=require(_0xab5d('0x2'));var rs=require(_0xab5d('0x3'));var fs=require('fs');var Redis=require(_0xab5d('0x4'));var db=require(_0xab5d('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xab5d('0x6'))(_0xab5d('0x7'));var config=require(_0xab5d('0x8'));var jayson=require(_0xab5d('0x9'));var client=jayson[_0xab5d('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0xf5a8a6,_0x405925,_0x281ede){return new BPromise(function(_0x4d9862,_0x457db8){return client['request'](_0xf5a8a6,_0x281ede)[_0xab5d('0xb')](function(_0x2f2fb4){logger['info'](_0xab5d('0xc'),_0x405925,_0xab5d('0xd'));logger[_0xab5d('0xe')]('SquareDetailsReport,\x20%s,\x20%s,\x20%s',_0x405925,_0xab5d('0xd'),JSON[_0xab5d('0xf')](_0x2f2fb4));if(_0x2f2fb4['error']){if(_0x2f2fb4[_0xab5d('0x10')]['code']===0x1f4){logger[_0xab5d('0x10')](_0xab5d('0xc'),_0x405925,_0x2f2fb4[_0xab5d('0x10')][_0xab5d('0x11')]);return _0x457db8(_0x2f2fb4['error'][_0xab5d('0x11')]);}logger[_0xab5d('0x10')]('SquareDetailsReport,\x20%s,\x20%s',_0x405925,_0x2f2fb4[_0xab5d('0x10')][_0xab5d('0x11')]);return _0x4d9862(_0x2f2fb4[_0xab5d('0x10')][_0xab5d('0x11')]);}else{logger[_0xab5d('0x12')]('SquareDetailsReport,\x20%s,\x20%s',_0x405925,_0xab5d('0xd'));_0x4d9862(_0x2f2fb4[_0xab5d('0x13')][_0xab5d('0x11')]);}})[_0xab5d('0x14')](function(_0x27ec2f){logger[_0xab5d('0x10')](_0xab5d('0xc'),_0x405925,_0x27ec2f);_0x457db8(_0x27ec2f);});});}exports[_0xab5d('0x15')]=function(_0x1a331e){var _0x334b93=this;return new Promise(function(_0xf0ee02,_0x2f925f){return db[_0xab5d('0x16')][_0xab5d('0x17')](_0x1a331e['body'],{'raw':_0x1a331e[_0xab5d('0x18')]?_0x1a331e[_0xab5d('0x18')][_0xab5d('0x19')]===undefined?!![]:![]:!![]})[_0xab5d('0xb')](function(_0x5c4f39){logger[_0xab5d('0x12')](_0xab5d('0x15'),_0x1a331e);logger[_0xab5d('0xe')](_0xab5d('0x15'),_0x1a331e,JSON[_0xab5d('0xf')](_0x5c4f39));_0xf0ee02(_0x5c4f39);})['catch'](function(_0x24d3cc){logger[_0xab5d('0x10')](_0xab5d('0x15'),_0x24d3cc[_0xab5d('0x11')],_0x1a331e);_0x2f925f(_0x334b93['error'](0x1f4,_0x24d3cc[_0xab5d('0x11')]));});});};
\ No newline at end of file
+var _0xf4b6=['jayson/promise','client','http','SquareDetailsReport,\x20%s,\x20%s','request\x20sent','debug','SquareDetailsReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','CreateSquareDetailsReport','SquareDetailsReport','create','body','options','raw','then','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x43789c,_0x155100){var _0x3438ee=function(_0x2bf95c){while(--_0x2bf95c){_0x43789c['push'](_0x43789c['shift']());}};_0x3438ee(++_0x155100);}(_0xf4b6,0x1ef));var _0x6f4b=function(_0xfa9409,_0x4b35b1){_0xfa9409=_0xfa9409-0x0;var _0x50600a=_0xf4b6[_0xfa9409];return _0x50600a;};'use strict';var _=require(_0x6f4b('0x0'));var util=require(_0x6f4b('0x1'));var moment=require(_0x6f4b('0x2'));var BPromise=require(_0x6f4b('0x3'));var rs=require(_0x6f4b('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6f4b('0x5'))['db'];var utils=require(_0x6f4b('0x6'));var logger=require(_0x6f4b('0x7'))(_0x6f4b('0x8'));var config=require('../../config/environment');var jayson=require(_0x6f4b('0x9'));var client=jayson[_0x6f4b('0xa')][_0x6f4b('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2c0450,_0x88b05a,_0x3e4bc3){return new BPromise(function(_0x411aeb,_0x5c4b8d){return client['request'](_0x2c0450,_0x3e4bc3)['then'](function(_0x2a849a){logger['info'](_0x6f4b('0xc'),_0x88b05a,_0x6f4b('0xd'));logger[_0x6f4b('0xe')](_0x6f4b('0xf'),_0x88b05a,'request\x20sent',JSON[_0x6f4b('0x10')](_0x2a849a));if(_0x2a849a[_0x6f4b('0x11')]){if(_0x2a849a['error'][_0x6f4b('0x12')]===0x1f4){logger[_0x6f4b('0x11')](_0x6f4b('0xc'),_0x88b05a,_0x2a849a[_0x6f4b('0x11')][_0x6f4b('0x13')]);return _0x5c4b8d(_0x2a849a[_0x6f4b('0x11')][_0x6f4b('0x13')]);}logger['error'](_0x6f4b('0xc'),_0x88b05a,_0x2a849a[_0x6f4b('0x11')][_0x6f4b('0x13')]);return _0x411aeb(_0x2a849a[_0x6f4b('0x11')][_0x6f4b('0x13')]);}else{logger['info']('SquareDetailsReport,\x20%s,\x20%s',_0x88b05a,_0x6f4b('0xd'));_0x411aeb(_0x2a849a['result'][_0x6f4b('0x13')]);}})[_0x6f4b('0x14')](function(_0x3ee498){logger[_0x6f4b('0x11')]('SquareDetailsReport,\x20%s,\x20%s',_0x88b05a,_0x3ee498);_0x5c4b8d(_0x3ee498);});});}exports[_0x6f4b('0x15')]=function(_0x2bb334){var _0x1df11c=this;return new Promise(function(_0x4791a5,_0x265b20){return db[_0x6f4b('0x16')][_0x6f4b('0x17')](_0x2bb334[_0x6f4b('0x18')],{'raw':_0x2bb334[_0x6f4b('0x19')]?_0x2bb334['options'][_0x6f4b('0x1a')]===undefined?!![]:![]:!![]})[_0x6f4b('0x1b')](function(_0x16c9f3){logger['info'](_0x6f4b('0x15'),_0x2bb334);logger[_0x6f4b('0xe')](_0x6f4b('0x15'),_0x2bb334,JSON[_0x6f4b('0x10')](_0x16c9f3));_0x4791a5(_0x16c9f3);})[_0x6f4b('0x14')](function(_0xb8fa7){logger[_0x6f4b('0x11')](_0x6f4b('0x15'),_0xb8fa7[_0x6f4b('0x13')],_0x2bb334);_0x265b20(_0x1df11c[_0x6f4b('0x11')](0x1f4,_0xb8fa7[_0x6f4b('0x13')]));});});};
\ No newline at end of file
diff --git a/server/api/system/index.js b/server/api/system/index.js
index 348e5c5..5c0d7b3 100644
--- a/server/api/system/index.js
+++ b/server/api/system/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x6043=['./system.controller','isAuthenticated','index','killProcess','exports','Router'];(function(_0x5534fe,_0x43c22e){var _0x3d1dc2=function(_0x9df12){while(--_0x9df12){_0x5534fe['push'](_0x5534fe['shift']());}};_0x3d1dc2(++_0x43c22e);}(_0x6043,0x185));var _0x3604=function(_0x4a60b0,_0x432b5c){_0x4a60b0=_0x4a60b0-0x0;var _0x3d2e72=_0x6043[_0x4a60b0];return _0x3d2e72;};'use strict';var express=require('express');var router=express[_0x3604('0x0')]();var auth=require('../../components/auth/service');var controller=require(_0x3604('0x1'));router['get']('/',auth[_0x3604('0x2')](),controller[_0x3604('0x3')]);router['get']('/process/:pid/kill',auth[_0x3604('0x2')](),controller[_0x3604('0x4')]);module[_0x3604('0x5')]=router;
\ No newline at end of file
+var _0x4859=['Router','isAuthenticated','index','/process/:pid/kill','killProcess','express'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4859,0x131));var _0x9485=function(_0x50f3c8,_0x2d987d){_0x50f3c8=_0x50f3c8-0x0;var _0x3dc055=_0x4859[_0x50f3c8];return _0x3dc055;};'use strict';var express=require(_0x9485('0x0'));var router=express[_0x9485('0x1')]();var auth=require('../../components/auth/service');var controller=require('./system.controller');router['get']('/',auth[_0x9485('0x2')](),controller[_0x9485('0x3')]);router['get'](_0x9485('0x4'),auth[_0x9485('0x2')](),controller[_0x9485('0x5')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/system/system.controller.js b/server/api/system/system.controller.js
index 46e02ef..5b5109f 100644
--- a/server/api/system/system.controller.js
+++ b/server/api/system/system.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xe561=['systeminformation','exec','api','bluebird','error','inspect','name','status','send','index','getAllData','then','json','catch','components/import/cm','format','ps\x20-p\x20%s\x20-ww\x20-o\x20args','params','pid','length','indexOf','Process\x20with\x20pid\x20%s\x20not\x20found!','kill','SIGINT','Process\x20with\x20pid\x20%s\x20killed\x20correctly','killProcess'];(function(_0x200b82,_0x415d58){var _0x232525=function(_0x5bf6f2){while(--_0x5bf6f2){_0x200b82['push'](_0x200b82['shift']());}};_0x232525(++_0x415d58);}(_0xe561,0x104));var _0x1e56=function(_0xb91507,_0x1a4296){_0xb91507=_0xb91507-0x0;var _0x1f1136=_0xe561[_0xb91507];return _0x1f1136;};'use strict';var info=require(_0x1e56('0x0'));var exec=require('child_process')[_0x1e56('0x1')];var logger=require('../../config/logger')(_0x1e56('0x2'));var util=require('util');var BPromise=require(_0x1e56('0x3'));var _=require('lodash');function handleError(_0x7c0f21,_0x3bc0ad,_0x42eb42){_0x3bc0ad=_0x3bc0ad||0x1f4;return function(_0xdb2481){logger[_0x1e56('0x4')]('<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s',_0x42eb42,_0x3bc0ad,util[_0x1e56('0x5')](_0xdb2481,{'showHidden':![],'depth':null}));delete _0xdb2481[_0x1e56('0x6')];_0x7c0f21[_0x1e56('0x7')](_0x3bc0ad)[_0x1e56('0x8')](_0xdb2481);};}exports[_0x1e56('0x9')]=function(_0x3862b9,_0x4e0803){return info[_0x1e56('0xa')]()[_0x1e56('0xb')](function(_0x478a6d){return _0x4e0803[_0x1e56('0x7')](0xc8)[_0x1e56('0xc')](_0x478a6d);})[_0x1e56('0xd')](function(_0x223931){return _0x4e0803[_0x1e56('0x7')](0x1f4)[_0x1e56('0xc')](_0x223931);});};exports['killProcess']=function(_0x2e0f49,_0x27e312){var _0x291007=[_0x1e56('0xe')];return new BPromise(function(_0x2ec813,_0x1d508a){return exec(util[_0x1e56('0xf')](_0x1e56('0x10'),_0x2e0f49[_0x1e56('0x11')][_0x1e56('0x12')]),function(_0x57c351,_0x325f3a,_0x395314){if(_0x57c351){return _0x1d508a(_0x57c351);}return _0x2ec813(_0x325f3a);});})[_0x1e56('0xb')](function(_0x27d6c7){var _0x4d7bf5=![];var _0x3445be=_0x27d6c7['split'](/\n/);for(var _0x6c7c1e=0x0,_0x46c604=_0x291007[_0x1e56('0x13')];_0x6c7c1e<_0x46c604,_0x4d7bf5===![];_0x6c7c1e+=0x1){if(_0x27d6c7[_0x1e56('0x14')](_0x291007[_0x6c7c1e])>=0x0){_0x4d7bf5=!![];}}if(!_0x4d7bf5){throw new Error(util[_0x1e56('0xf')](_0x1e56('0x15'),_0x2e0f49[_0x1e56('0x11')][_0x1e56('0x12')]));}process[_0x1e56('0x16')](_0x2e0f49[_0x1e56('0x11')][_0x1e56('0x12')],_0x1e56('0x17'));return _0x27e312[_0x1e56('0x7')](0xc8)['json']({'message':util[_0x1e56('0xf')](_0x1e56('0x18'),_0x2e0f49[_0x1e56('0x11')]['pid'])});})[_0x1e56('0xd')](handleError(_0x27e312,null,_0x1e56('0x19')));};
\ No newline at end of file
+var _0xb725=['send','index','then','json','catch','killProcess','format','ps\x20-p\x20%s\x20-ww\x20-o\x20args','params','pid','split','length','kill','Process\x20with\x20pid\x20%s\x20killed\x20correctly','child_process','../../config/logger','api','util','bluebird','lodash','error','inspect','name','status'];(function(_0x2f8146,_0x2cc94e){var _0x2415ab=function(_0x37f1aa){while(--_0x37f1aa){_0x2f8146['push'](_0x2f8146['shift']());}};_0x2415ab(++_0x2cc94e);}(_0xb725,0x86));var _0x5b72=function(_0x20c180,_0x115684){_0x20c180=_0x20c180-0x0;var _0x4c8ae9=_0xb725[_0x20c180];return _0x4c8ae9;};'use strict';var info=require('systeminformation');var exec=require(_0x5b72('0x0'))['exec'];var logger=require(_0x5b72('0x1'))(_0x5b72('0x2'));var util=require(_0x5b72('0x3'));var BPromise=require(_0x5b72('0x4'));var _=require(_0x5b72('0x5'));function handleError(_0x3fa8ef,_0x1bf63a,_0x32e4e3){_0x1bf63a=_0x1bf63a||0x1f4;return function(_0x382d19){logger[_0x5b72('0x6')]('<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s',_0x32e4e3,_0x1bf63a,util[_0x5b72('0x7')](_0x382d19,{'showHidden':![],'depth':null}));delete _0x382d19[_0x5b72('0x8')];_0x3fa8ef[_0x5b72('0x9')](_0x1bf63a)[_0x5b72('0xa')](_0x382d19);};}exports[_0x5b72('0xb')]=function(_0x3cce5a,_0x23405f){return info['getAllData']()[_0x5b72('0xc')](function(_0x433377){return _0x23405f[_0x5b72('0x9')](0xc8)[_0x5b72('0xd')](_0x433377);})[_0x5b72('0xe')](function(_0x2bb1a0){return _0x23405f[_0x5b72('0x9')](0x1f4)[_0x5b72('0xd')](_0x2bb1a0);});};exports[_0x5b72('0xf')]=function(_0x553ace,_0x513a68){var _0x4099eb=['components/import/cm'];return new BPromise(function(_0xab125c,_0xd9b16b){return exec(util[_0x5b72('0x10')](_0x5b72('0x11'),_0x553ace[_0x5b72('0x12')][_0x5b72('0x13')]),function(_0x5f5614,_0x1b187f,_0x23765e){if(_0x5f5614){return _0xd9b16b(_0x5f5614);}return _0xab125c(_0x1b187f);});})[_0x5b72('0xc')](function(_0x88362b){var _0x353fb8=![];var _0x1422a8=_0x88362b[_0x5b72('0x14')](/\n/);for(var _0x69bb0=0x0,_0x330562=_0x4099eb[_0x5b72('0x15')];_0x69bb0<_0x330562,_0x353fb8===![];_0x69bb0+=0x1){if(_0x88362b['indexOf'](_0x4099eb[_0x69bb0])>=0x0){_0x353fb8=!![];}}if(!_0x353fb8){throw new Error(util['format']('Process\x20with\x20pid\x20%s\x20not\x20found!',_0x553ace[_0x5b72('0x12')]['pid']));}process[_0x5b72('0x16')](_0x553ace[_0x5b72('0x12')][_0x5b72('0x13')],'SIGINT');return _0x513a68[_0x5b72('0x9')](0xc8)[_0x5b72('0xd')]({'message':util[_0x5b72('0x10')](_0x5b72('0x17'),_0x553ace['params']['pid'])});})[_0x5b72('0xe')](handleError(_0x513a68,null,'killProcess'));};
\ No newline at end of file
diff --git a/server/api/tag/index.js b/server/api/tag/index.js
index db4fd1e..4829033 100644
--- a/server/api/tag/index.js
+++ b/server/api/tag/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xf4eb=['../../config/environment','./tag.controller','get','isAuthenticated','index','/:id','show','create','put','update','delete','exports','multer','Router'];(function(_0x2486f7,_0x2469e9){var _0xad4caa=function(_0x272025){while(--_0x272025){_0x2486f7['push'](_0x2486f7['shift']());}};_0xad4caa(++_0x2469e9);}(_0xf4eb,0xec));var _0xbf4e=function(_0x232df3,_0x37abcb){_0x232df3=_0x232df3-0x0;var _0x26ff90=_0xf4eb[_0x232df3];return _0x26ff90;};'use strict';var multer=require(_0xbf4e('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xbf4e('0x1')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xbf4e('0x2'));var controller=require(_0xbf4e('0x3'));router[_0xbf4e('0x4')]('/',auth[_0xbf4e('0x5')](),controller[_0xbf4e('0x6')]);router[_0xbf4e('0x4')](_0xbf4e('0x7'),auth['isAuthenticated'](),controller[_0xbf4e('0x8')]);router['post']('/',auth['isAuthenticated'](),controller[_0xbf4e('0x9')]);router[_0xbf4e('0xa')](_0xbf4e('0x7'),auth[_0xbf4e('0x5')](),controller[_0xbf4e('0xb')]);router[_0xbf4e('0xc')](_0xbf4e('0x7'),auth['isAuthenticated'](),controller['destroy']);module[_0xbf4e('0xd')]=router;
\ No newline at end of file
+var _0x9c44=['/:id','isAuthenticated','show','create','put','delete','destroy','exports','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','get','index'];(function(_0x1597e2,_0x388d3e){var _0x4c8c0a=function(_0x3d4795){while(--_0x3d4795){_0x1597e2['push'](_0x1597e2['shift']());}};_0x4c8c0a(++_0x388d3e);}(_0x9c44,0x178));var _0x49c4=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x9c44[_0x2641f9];return _0x585741;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var auth=require(_0x49c4('0x4'));var interaction=require(_0x49c4('0x5'));var config=require('../../config/environment');var controller=require('./tag.controller');router[_0x49c4('0x6')]('/',auth['isAuthenticated'](),controller[_0x49c4('0x7')]);router[_0x49c4('0x6')](_0x49c4('0x8'),auth[_0x49c4('0x9')](),controller[_0x49c4('0xa')]);router['post']('/',auth[_0x49c4('0x9')](),controller[_0x49c4('0xb')]);router[_0x49c4('0xc')](_0x49c4('0x8'),auth['isAuthenticated'](),controller['update']);router[_0x49c4('0xd')](_0x49c4('0x8'),auth['isAuthenticated'](),controller[_0x49c4('0xe')]);module[_0x49c4('0xf')]=router;
\ No newline at end of file
diff --git a/server/api/tag/tag.attributes.js b/server/api/tag/tag.attributes.js
index 1a08e98..d680af1 100644
--- a/server/api/tag/tag.attributes.js
+++ b/server/api/tag/tag.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x087b=['sequelize','exports','STRING'];(function(_0x21ccd5,_0x54013c){var _0x3f394e=function(_0x3a4ec0){while(--_0x3a4ec0){_0x21ccd5['push'](_0x21ccd5['shift']());}};_0x3f394e(++_0x54013c);}(_0x087b,0x11a));var _0xb087=function(_0x25e7cb,_0x3579b7){_0x25e7cb=_0x25e7cb-0x0;var _0x375d92=_0x087b[_0x25e7cb];return _0x375d92;};'use strict';var Sequelize=require(_0xb087('0x0'));module[_0xb087('0x1')]={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize[_0xb087('0x2')],'defaultValue':'#0091EA'},'description':{'type':Sequelize[_0xb087('0x2')]}};
\ No newline at end of file
+var _0x36ee=['STRING','#0091EA'];(function(_0x4bf2b9,_0x47c5b0){var _0x38205d=function(_0x1a4edd){while(--_0x1a4edd){_0x4bf2b9['push'](_0x4bf2b9['shift']());}};_0x38205d(++_0x47c5b0);}(_0x36ee,0xe8));var _0xe36e=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x36ee[_0x5b644e];return _0x49c6bf;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xe36e('0x0')],'unique':'name','allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize[_0xe36e('0x0')],'defaultValue':_0xe36e('0x1')},'description':{'type':Sequelize[_0xe36e('0x0')]}};
\ No newline at end of file
diff --git a/server/api/tag/tag.controller.js b/server/api/tag/tag.controller.js
index 8373437..2705d48 100644
--- a/server/api/tag/tag.controller.js
+++ b/server/api/tag/tag.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x3629=['userProfileId','autoAssociation','catch','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','set','Content-Range','apply','save','update','then','destroy','get','Tags','UserProfileResource','error','stack','name','send','index','map','Tag','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','count','include','findAll','show','params','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection'];(function(_0x46e8bb,_0x382eee){var _0x4ef854=function(_0x2b4a22){while(--_0x2b4a22){_0x46e8bb['push'](_0x46e8bb['shift']());}};_0x4ef854(++_0x382eee);}(_0x3629,0xb3));var _0x9362=function(_0x2e0f02,_0x579afe){_0x2e0f02=_0x2e0f02-0x0;var _0x30c4a7=_0x3629[_0x2e0f02];return _0x30c4a7;};'use strict';var pdf=require(_0x9362('0x0'));var emlformat=require(_0x9362('0x1'));var rimraf=require(_0x9362('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x9362('0x3'));var rp=require(_0x9362('0x4'));var moment=require(_0x9362('0x5'));var BPromise=require(_0x9362('0x6'));var Mustache=require(_0x9362('0x7'));var util=require(_0x9362('0x8'));var path=require(_0x9362('0x9'));var sox=require(_0x9362('0xa'));var csv=require(_0x9362('0xb'));var ejs=require(_0x9362('0xc'));var fs=require('fs');var _=require(_0x9362('0xd'));var squel=require(_0x9362('0xe'));var crypto=require(_0x9362('0xf'));var jsforce=require('jsforce');var deskjs=require(_0x9362('0x10'));var toCsv=require(_0x9362('0xb'));var querystring=require(_0x9362('0x11'));var Papa=require(_0x9362('0x12'));var Redis=require(_0x9362('0x13'));var authService=require(_0x9362('0x14'));var qs=require(_0x9362('0x15'));var as=require(_0x9362('0x16'));var hardwareService=require(_0x9362('0x17'));var logger=require('../../config/logger')(_0x9362('0x18'));var utils=require(_0x9362('0x19'));var config=require(_0x9362('0x1a'));var db=require(_0x9362('0x1b'))['db'];function respondWithStatusCode(_0x498949,_0x4721d4){_0x4721d4=_0x4721d4||0xcc;return function(_0x20e2bd){if(_0x20e2bd){return _0x498949[_0x9362('0x1c')](_0x4721d4);}return _0x498949[_0x9362('0x1d')](_0x4721d4)[_0x9362('0x1e')]();};}function respondWithResult(_0x27728d,_0x5b018d){_0x5b018d=_0x5b018d||0xc8;return function(_0x3de5f5){if(_0x3de5f5){return _0x27728d[_0x9362('0x1d')](_0x5b018d)[_0x9362('0x1f')](_0x3de5f5);}};}function respondWithFilteredResult(_0x15aa1e,_0x5c1696){return function(_0x153dc2){if(_0x153dc2){var _0x182e3e=_0x153dc2['count'],_0x514b3c=_0x5c1696[_0x9362('0x20')],_0x4e046c=_0x5c1696['offset']+_0x5c1696[_0x9362('0x21')],_0x275fa0;if(_0x4e046c>=_0x182e3e){_0x4e046c=_0x182e3e;_0x275fa0=0xc8;}else{_0x275fa0=0xce;}_0x15aa1e['status'](_0x275fa0);return _0x15aa1e[_0x9362('0x22')](_0x9362('0x23'),_0x514b3c+'-'+_0x4e046c+'/'+_0x182e3e)[_0x9362('0x1f')](_0x153dc2);}return null;};}function patchUpdates(_0x9eb6de){return function(_0x31cb9a){try{jsonpatch[_0x9362('0x24')](_0x31cb9a,_0x9eb6de,!![]);}catch(_0x12cf33){return BPromise['reject'](_0x12cf33);}return _0x31cb9a[_0x9362('0x25')]();};}function saveUpdates(_0x5c734f,_0x2bc730){return function(_0x316ec4){if(_0x316ec4){return _0x316ec4[_0x9362('0x26')](_0x5c734f)[_0x9362('0x27')](function(_0x217beb){return _0x217beb;});}return null;};}function removeEntity(_0x406e58,_0x17b70d){return function(_0x16cdd4){if(_0x16cdd4){return _0x16cdd4[_0x9362('0x28')]()[_0x9362('0x27')](function(){var _0x5edaab=_0x16cdd4[_0x9362('0x29')]({'plain':!![]});var _0x473509=_0x9362('0x2a');return db[_0x9362('0x2b')]['destroy']({'where':{'type':_0x473509,'resourceId':_0x5edaab['id']}})['then'](function(){return _0x16cdd4;});})[_0x9362('0x27')](function(){_0x406e58[_0x9362('0x1d')](0xcc)[_0x9362('0x1e')]();});}};}function handleEntityNotFound(_0x451a44,_0x134090){return function(_0x1d507e){if(!_0x1d507e){_0x451a44[_0x9362('0x1c')](0x194);}return _0x1d507e;};}function handleError(_0x36b0d3,_0x46ff83){_0x46ff83=_0x46ff83||0x1f4;return function(_0x3a42e5){logger[_0x9362('0x2c')](_0x3a42e5[_0x9362('0x2d')]);if(_0x3a42e5['name']){delete _0x3a42e5[_0x9362('0x2e')];}_0x36b0d3[_0x9362('0x1d')](_0x46ff83)[_0x9362('0x2f')](_0x3a42e5);};}exports[_0x9362('0x30')]=function(_0x4f6df1,_0x4ef796){var _0x3df42e={},_0x5eeed8={},_0x1f48df={'count':0x0,'rows':[]};var _0x4a5b25=_[_0x9362('0x31')](db[_0x9362('0x32')]['rawAttributes'],function(_0x33d3d1){return{'name':_0x33d3d1[_0x9362('0x33')],'type':_0x33d3d1[_0x9362('0x34')][_0x9362('0x35')]};});_0x5eeed8[_0x9362('0x36')]=_['map'](_0x4a5b25,_0x9362('0x2e'));_0x5eeed8[_0x9362('0x37')]=_[_0x9362('0x38')](_0x4f6df1['query']);_0x5eeed8[_0x9362('0x39')]=_[_0x9362('0x3a')](_0x5eeed8[_0x9362('0x36')],_0x5eeed8['query']);_0x3df42e[_0x9362('0x3b')]=_[_0x9362('0x3a')](_0x5eeed8['model'],qs[_0x9362('0x3c')](_0x4f6df1[_0x9362('0x37')][_0x9362('0x3c')]));_0x3df42e[_0x9362('0x3b')]=_0x3df42e[_0x9362('0x3b')][_0x9362('0x3d')]?_0x3df42e['attributes']:_0x5eeed8['model'];if(!_0x4f6df1[_0x9362('0x37')][_0x9362('0x3e')](_0x9362('0x3f'))){_0x3df42e[_0x9362('0x21')]=qs[_0x9362('0x21')](_0x4f6df1[_0x9362('0x37')][_0x9362('0x21')]);_0x3df42e['offset']=qs['offset'](_0x4f6df1[_0x9362('0x37')]['offset']);}_0x3df42e[_0x9362('0x40')]=qs[_0x9362('0x41')](_0x4f6df1[_0x9362('0x37')][_0x9362('0x41')]);_0x3df42e[_0x9362('0x42')]=qs[_0x9362('0x39')](_[_0x9362('0x43')](_0x4f6df1[_0x9362('0x37')],_0x5eeed8[_0x9362('0x39')]),_0x4a5b25);if(_0x4f6df1[_0x9362('0x37')][_0x9362('0x44')]){_0x3df42e[_0x9362('0x42')]=_[_0x9362('0x45')](_0x3df42e[_0x9362('0x42')],{'$or':_[_0x9362('0x31')](_0x4a5b25,function(_0x11d956){if(_0x11d956['type']!==_0x9362('0x46')){var _0x267f06={};_0x267f06[_0x11d956[_0x9362('0x2e')]]={'$like':'%'+_0x4f6df1[_0x9362('0x37')]['filter']+'%'};return _0x267f06;}})});}_0x3df42e=_[_0x9362('0x45')]({},_0x3df42e,_0x4f6df1[_0x9362('0x47')]);var _0x5a4ce3={'where':_0x3df42e['where']};return db[_0x9362('0x32')][_0x9362('0x48')](_0x5a4ce3)[_0x9362('0x27')](function(_0x364cb4){_0x1f48df[_0x9362('0x48')]=_0x364cb4;if(_0x4f6df1[_0x9362('0x37')]['includeAll']){_0x3df42e[_0x9362('0x49')]=[{'all':!![]}];}return db[_0x9362('0x32')][_0x9362('0x4a')](_0x3df42e);})[_0x9362('0x27')](function(_0x5364fb){_0x1f48df['rows']=_0x5364fb;return _0x1f48df;})[_0x9362('0x27')](respondWithFilteredResult(_0x4ef796,_0x3df42e))['catch'](handleError(_0x4ef796,null));};exports[_0x9362('0x4b')]=function(_0x18dece,_0x3bfe9f){var _0xdb007b={'raw':!![],'where':{'id':_0x18dece[_0x9362('0x4c')]['id']}},_0x12ec99={};_0x12ec99[_0x9362('0x36')]=_['keys'](db[_0x9362('0x32')]['rawAttributes']);_0x12ec99['query']=_[_0x9362('0x38')](_0x18dece[_0x9362('0x37')]);_0x12ec99[_0x9362('0x39')]=_[_0x9362('0x3a')](_0x12ec99[_0x9362('0x36')],_0x12ec99[_0x9362('0x37')]);_0xdb007b['attributes']=_[_0x9362('0x3a')](_0x12ec99[_0x9362('0x36')],qs['fields'](_0x18dece[_0x9362('0x37')][_0x9362('0x3c')]));_0xdb007b[_0x9362('0x3b')]=_0xdb007b[_0x9362('0x3b')][_0x9362('0x3d')]?_0xdb007b[_0x9362('0x3b')]:_0x12ec99[_0x9362('0x36')];if(_0x18dece['query'][_0x9362('0x4d')]){_0xdb007b[_0x9362('0x49')]=[{'all':!![]}];}_0xdb007b=_[_0x9362('0x45')]({},_0xdb007b,_0x18dece[_0x9362('0x47')]);return db['Tag'][_0x9362('0x4e')](_0xdb007b)[_0x9362('0x27')](handleEntityNotFound(_0x3bfe9f,null))[_0x9362('0x27')](respondWithResult(_0x3bfe9f,null))['catch'](handleError(_0x3bfe9f,null));};exports[_0x9362('0x4f')]=function(_0x128c66,_0xd8aa52){return db[_0x9362('0x32')][_0x9362('0x4f')](_0x128c66[_0x9362('0x50')],{})[_0x9362('0x27')](function(_0x408a79){var _0x3f6380=_0x128c66[_0x9362('0x51')]['get']({'plain':!![]});if(!_0x3f6380)throw new Error(_0x9362('0x52'));if(_0x3f6380[_0x9362('0x53')]==='user'){var _0x108e32=_0x408a79[_0x9362('0x29')]({'plain':!![]});var _0x2a0c28=_0x9362('0x2a');return db[_0x9362('0x54')][_0x9362('0x4e')]({'where':{'name':_0x2a0c28,'userProfileId':_0x3f6380[_0x9362('0x55')]},'raw':!![]})[_0x9362('0x27')](function(_0x4461ca){if(_0x4461ca&&_0x4461ca[_0x9362('0x56')]===0x0){return db[_0x9362('0x2b')][_0x9362('0x4f')]({'name':_0x108e32[_0x9362('0x2e')],'resourceId':_0x108e32['id'],'type':_0x4461ca[_0x9362('0x2e')],'sectionId':_0x4461ca['id']},{})[_0x9362('0x27')](function(){return _0x408a79;});}else{return _0x408a79;}})[_0x9362('0x57')](function(_0x4407c0){logger[_0x9362('0x2c')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4407c0);throw _0x4407c0;});}return _0x408a79;})['then'](respondWithResult(_0xd8aa52,0xc9))[_0x9362('0x57')](handleError(_0xd8aa52,null));};exports[_0x9362('0x26')]=function(_0x31772b,_0xef4022){if(_0x31772b[_0x9362('0x50')]['id']){delete _0x31772b['body']['id'];}return db[_0x9362('0x32')][_0x9362('0x4e')]({'where':{'id':_0x31772b['params']['id']}})[_0x9362('0x27')](handleEntityNotFound(_0xef4022,null))['then'](saveUpdates(_0x31772b[_0x9362('0x50')],null))[_0x9362('0x27')](respondWithResult(_0xef4022,null))[_0x9362('0x57')](handleError(_0xef4022,null));};exports[_0x9362('0x28')]=function(_0x237a06,_0x25a0f3){return db['Tag']['find']({'where':{'id':_0x237a06[_0x9362('0x4c')]['id']}})[_0x9362('0x27')](handleEntityNotFound(_0x25a0f3,null))['then'](removeEntity(_0x25a0f3,null))[_0x9362('0x57')](handleError(_0x25a0f3,null));};
\ No newline at end of file
+var _0x4460=['error','name','send','index','map','Tag','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','create','body','get','role','user','find','userProfileId','autoAssociation','UserProfileResource','destroy','eml-format','zip-dir','request-promise','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','Tags','end'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x4460,0x80));var _0x0446=function(_0x186a7c,_0x32f5ed){_0x186a7c=_0x186a7c-0x0;var _0x52e0f8=_0x4460[_0x186a7c];return _0x52e0f8;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x0446('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x0446('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x0446('0x2'));var moment=require('moment');var BPromise=require(_0x0446('0x3'));var Mustache=require(_0x0446('0x4'));var util=require(_0x0446('0x5'));var path=require('path');var sox=require(_0x0446('0x6'));var csv=require(_0x0446('0x7'));var ejs=require(_0x0446('0x8'));var fs=require('fs');var _=require(_0x0446('0x9'));var squel=require(_0x0446('0xa'));var crypto=require('crypto');var jsforce=require(_0x0446('0xb'));var deskjs=require(_0x0446('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x0446('0xd'));var authService=require(_0x0446('0xe'));var qs=require(_0x0446('0xf'));var as=require(_0x0446('0x10'));var hardwareService=require(_0x0446('0x11'));var logger=require(_0x0446('0x12'))(_0x0446('0x13'));var utils=require(_0x0446('0x14'));var config=require(_0x0446('0x15'));var db=require(_0x0446('0x16'))['db'];function respondWithStatusCode(_0x20ccd9,_0x3df13e){_0x3df13e=_0x3df13e||0xcc;return function(_0x5c3faf){if(_0x5c3faf){return _0x20ccd9[_0x0446('0x17')](_0x3df13e);}return _0x20ccd9['status'](_0x3df13e)['end']();};}function respondWithResult(_0xce87f9,_0x9c429f){_0x9c429f=_0x9c429f||0xc8;return function(_0x3c7b90){if(_0x3c7b90){return _0xce87f9[_0x0446('0x18')](_0x9c429f)[_0x0446('0x19')](_0x3c7b90);}};}function respondWithFilteredResult(_0x2ba091,_0x2c7d7e){return function(_0x5ce192){if(_0x5ce192){var _0x21a06c=_0x5ce192[_0x0446('0x1a')],_0x5f3f2a=_0x2c7d7e[_0x0446('0x1b')],_0x199925=_0x2c7d7e[_0x0446('0x1b')]+_0x2c7d7e[_0x0446('0x1c')],_0x2b03c2;if(_0x199925>=_0x21a06c){_0x199925=_0x21a06c;_0x2b03c2=0xc8;}else{_0x2b03c2=0xce;}_0x2ba091[_0x0446('0x18')](_0x2b03c2);return _0x2ba091[_0x0446('0x1d')](_0x0446('0x1e'),_0x5f3f2a+'-'+_0x199925+'/'+_0x21a06c)[_0x0446('0x19')](_0x5ce192);}return null;};}function patchUpdates(_0x35ddcb){return function(_0x3c7f32){try{jsonpatch[_0x0446('0x1f')](_0x3c7f32,_0x35ddcb,!![]);}catch(_0x4bc43b){return BPromise[_0x0446('0x20')](_0x4bc43b);}return _0x3c7f32[_0x0446('0x21')]();};}function saveUpdates(_0x3a64d7,_0x922ca1){return function(_0x3290da){if(_0x3290da){return _0x3290da[_0x0446('0x22')](_0x3a64d7)[_0x0446('0x23')](function(_0x5ca117){return _0x5ca117;});}return null;};}function removeEntity(_0x411408,_0x33020c){return function(_0x10cc80){if(_0x10cc80){return _0x10cc80['destroy']()['then'](function(){var _0x295163=_0x10cc80['get']({'plain':!![]});var _0x1f3c30=_0x0446('0x24');return db['UserProfileResource']['destroy']({'where':{'type':_0x1f3c30,'resourceId':_0x295163['id']}})[_0x0446('0x23')](function(){return _0x10cc80;});})[_0x0446('0x23')](function(){_0x411408['status'](0xcc)[_0x0446('0x25')]();});}};}function handleEntityNotFound(_0x5f5d53,_0x356750){return function(_0x301e09){if(!_0x301e09){_0x5f5d53[_0x0446('0x17')](0x194);}return _0x301e09;};}function handleError(_0x51b9e3,_0x51e3e){_0x51e3e=_0x51e3e||0x1f4;return function(_0x23695d){logger[_0x0446('0x26')](_0x23695d['stack']);if(_0x23695d['name']){delete _0x23695d[_0x0446('0x27')];}_0x51b9e3[_0x0446('0x18')](_0x51e3e)[_0x0446('0x28')](_0x23695d);};}exports[_0x0446('0x29')]=function(_0xe1bca,_0x11ade4){var _0x3d6f06={},_0x10dd89={},_0x472d51={'count':0x0,'rows':[]};var _0x264b90=_[_0x0446('0x2a')](db[_0x0446('0x2b')][_0x0446('0x2c')],function(_0x585ad1){return{'name':_0x585ad1[_0x0446('0x2d')],'type':_0x585ad1[_0x0446('0x2e')][_0x0446('0x2f')]};});_0x10dd89[_0x0446('0x30')]=_[_0x0446('0x2a')](_0x264b90,_0x0446('0x27'));_0x10dd89[_0x0446('0x31')]=_[_0x0446('0x32')](_0xe1bca[_0x0446('0x31')]);_0x10dd89[_0x0446('0x33')]=_[_0x0446('0x34')](_0x10dd89[_0x0446('0x30')],_0x10dd89[_0x0446('0x31')]);_0x3d6f06['attributes']=_[_0x0446('0x34')](_0x10dd89[_0x0446('0x30')],qs[_0x0446('0x35')](_0xe1bca[_0x0446('0x31')]['fields']));_0x3d6f06[_0x0446('0x36')]=_0x3d6f06[_0x0446('0x36')][_0x0446('0x37')]?_0x3d6f06[_0x0446('0x36')]:_0x10dd89[_0x0446('0x30')];if(!_0xe1bca[_0x0446('0x31')][_0x0446('0x38')](_0x0446('0x39'))){_0x3d6f06[_0x0446('0x1c')]=qs[_0x0446('0x1c')](_0xe1bca['query'][_0x0446('0x1c')]);_0x3d6f06[_0x0446('0x1b')]=qs[_0x0446('0x1b')](_0xe1bca[_0x0446('0x31')][_0x0446('0x1b')]);}_0x3d6f06[_0x0446('0x3a')]=qs[_0x0446('0x3b')](_0xe1bca[_0x0446('0x31')][_0x0446('0x3b')]);_0x3d6f06[_0x0446('0x3c')]=qs['filters'](_[_0x0446('0x3d')](_0xe1bca[_0x0446('0x31')],_0x10dd89['filters']),_0x264b90);if(_0xe1bca[_0x0446('0x31')][_0x0446('0x3e')]){_0x3d6f06['where']=_[_0x0446('0x3f')](_0x3d6f06[_0x0446('0x3c')],{'$or':_[_0x0446('0x2a')](_0x264b90,function(_0x4be8e6){if(_0x4be8e6[_0x0446('0x2e')]!==_0x0446('0x40')){var _0x5566c7={};_0x5566c7[_0x4be8e6[_0x0446('0x27')]]={'$like':'%'+_0xe1bca['query'][_0x0446('0x3e')]+'%'};return _0x5566c7;}})});}_0x3d6f06=_['merge']({},_0x3d6f06,_0xe1bca[_0x0446('0x41')]);var _0x4237cd={'where':_0x3d6f06['where']};return db[_0x0446('0x2b')][_0x0446('0x1a')](_0x4237cd)[_0x0446('0x23')](function(_0x73a526){_0x472d51[_0x0446('0x1a')]=_0x73a526;if(_0xe1bca['query'][_0x0446('0x42')]){_0x3d6f06[_0x0446('0x43')]=[{'all':!![]}];}return db[_0x0446('0x2b')][_0x0446('0x44')](_0x3d6f06);})[_0x0446('0x23')](function(_0x36dbad){_0x472d51[_0x0446('0x45')]=_0x36dbad;return _0x472d51;})[_0x0446('0x23')](respondWithFilteredResult(_0x11ade4,_0x3d6f06))[_0x0446('0x46')](handleError(_0x11ade4,null));};exports[_0x0446('0x47')]=function(_0xb5c1db,_0x194935){var _0x3afbb5={'raw':!![],'where':{'id':_0xb5c1db[_0x0446('0x48')]['id']}},_0x4d288c={};_0x4d288c['model']=_['keys'](db['Tag'][_0x0446('0x2c')]);_0x4d288c[_0x0446('0x31')]=_[_0x0446('0x32')](_0xb5c1db[_0x0446('0x31')]);_0x4d288c['filters']=_['intersection'](_0x4d288c[_0x0446('0x30')],_0x4d288c['query']);_0x3afbb5[_0x0446('0x36')]=_[_0x0446('0x34')](_0x4d288c[_0x0446('0x30')],qs['fields'](_0xb5c1db[_0x0446('0x31')][_0x0446('0x35')]));_0x3afbb5['attributes']=_0x3afbb5[_0x0446('0x36')]['length']?_0x3afbb5[_0x0446('0x36')]:_0x4d288c[_0x0446('0x30')];if(_0xb5c1db[_0x0446('0x31')][_0x0446('0x42')]){_0x3afbb5[_0x0446('0x43')]=[{'all':!![]}];}_0x3afbb5=_['merge']({},_0x3afbb5,_0xb5c1db[_0x0446('0x41')]);return db['Tag']['find'](_0x3afbb5)[_0x0446('0x23')](handleEntityNotFound(_0x194935,null))[_0x0446('0x23')](respondWithResult(_0x194935,null))[_0x0446('0x46')](handleError(_0x194935,null));};exports['create']=function(_0xd97ad7,_0x374e43){return db['Tag'][_0x0446('0x49')](_0xd97ad7[_0x0446('0x4a')],{})[_0x0446('0x23')](function(_0x5bae29){var _0x4de197=_0xd97ad7['user'][_0x0446('0x4b')]({'plain':!![]});if(!_0x4de197)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4de197[_0x0446('0x4c')]===_0x0446('0x4d')){var _0x27967c=_0x5bae29[_0x0446('0x4b')]({'plain':!![]});var _0x4e5f7a=_0x0446('0x24');return db['UserProfileSection'][_0x0446('0x4e')]({'where':{'name':_0x4e5f7a,'userProfileId':_0x4de197[_0x0446('0x4f')]},'raw':!![]})[_0x0446('0x23')](function(_0x4b9cfd){if(_0x4b9cfd&&_0x4b9cfd[_0x0446('0x50')]===0x0){return db[_0x0446('0x51')][_0x0446('0x49')]({'name':_0x27967c[_0x0446('0x27')],'resourceId':_0x27967c['id'],'type':_0x4b9cfd[_0x0446('0x27')],'sectionId':_0x4b9cfd['id']},{})[_0x0446('0x23')](function(){return _0x5bae29;});}else{return _0x5bae29;}})[_0x0446('0x46')](function(_0x4bc9c9){logger[_0x0446('0x26')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4bc9c9);throw _0x4bc9c9;});}return _0x5bae29;})[_0x0446('0x23')](respondWithResult(_0x374e43,0xc9))[_0x0446('0x46')](handleError(_0x374e43,null));};exports[_0x0446('0x22')]=function(_0x192dd7,_0x579d6f){if(_0x192dd7[_0x0446('0x4a')]['id']){delete _0x192dd7[_0x0446('0x4a')]['id'];}return db[_0x0446('0x2b')][_0x0446('0x4e')]({'where':{'id':_0x192dd7['params']['id']}})[_0x0446('0x23')](handleEntityNotFound(_0x579d6f,null))['then'](saveUpdates(_0x192dd7[_0x0446('0x4a')],null))[_0x0446('0x23')](respondWithResult(_0x579d6f,null))['catch'](handleError(_0x579d6f,null));};exports[_0x0446('0x52')]=function(_0x2b2603,_0x4c804b){return db['Tag'][_0x0446('0x4e')]({'where':{'id':_0x2b2603[_0x0446('0x48')]['id']}})['then'](handleEntityNotFound(_0x4c804b,null))[_0x0446('0x23')](removeEntity(_0x4c804b,null))[_0x0446('0x46')](handleError(_0x4c804b,null));};
\ No newline at end of file
diff --git a/server/api/tag/tag.model.js b/server/api/tag/tag.model.js
index 2cce167..16cbca7 100644
--- a/server/api/tag/tag.model.js
+++ b/server/api/tag/tag.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xc668=['util','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','exports','Tag','tools_tags','lodash'];(function(_0x30fdda,_0x2da721){var _0x1bba7c=function(_0x488f4f){while(--_0x488f4f){_0x30fdda['push'](_0x30fdda['shift']());}};_0x1bba7c(++_0x2da721);}(_0xc668,0x6d));var _0x8c66=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc668[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x8c66('0x0'));var util=require(_0x8c66('0x1'));var logger=require(_0x8c66('0x2'))('api');var moment=require(_0x8c66('0x3'));var BPromise=require(_0x8c66('0x4'));var rp=require(_0x8c66('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8c66('0x6'));var config=require(_0x8c66('0x7'));var attributes=require('./tag.attributes');module[_0x8c66('0x8')]=function(_0xcd1033,_0x3c58b9){return _0xcd1033['define'](_0x8c66('0x9'),attributes,{'tableName':_0x8c66('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xbdf4=['Tag','tools_tags','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','exports'];(function(_0x3828cd,_0x2e4822){var _0x3d4877=function(_0x27024b){while(--_0x27024b){_0x3828cd['push'](_0x3828cd['shift']());}};_0x3d4877(++_0x2e4822);}(_0xbdf4,0x199));var _0x4bdf=function(_0x50a0c2,_0x4befab){_0x50a0c2=_0x50a0c2-0x0;var _0x5ebadd=_0xbdf4[_0x50a0c2];return _0x5ebadd;};'use strict';var _=require(_0x4bdf('0x0'));var util=require(_0x4bdf('0x1'));var logger=require(_0x4bdf('0x2'))(_0x4bdf('0x3'));var moment=require('moment');var BPromise=require(_0x4bdf('0x4'));var rp=require(_0x4bdf('0x5'));var fs=require('fs');var path=require(_0x4bdf('0x6'));var rimraf=require(_0x4bdf('0x7'));var config=require('../../config/environment');var attributes=require('./tag.attributes');module[_0x4bdf('0x8')]=function(_0xfcb4be,_0x4a752e){return _0xfcb4be['define'](_0x4bdf('0x9'),attributes,{'tableName':_0x4bdf('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/tag/tag.rpc.js b/server/api/tag/tag.rpc.js
index 6e96633..e13be5b 100644
--- a/server/api/tag/tag.rpc.js
+++ b/server/api/tag/tag.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x3c81=['Tag,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','bluebird','randomstring','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Tag,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x4a801f,_0x55d3c4){var _0x869b3b=function(_0xff7bd3){while(--_0xff7bd3){_0x4a801f['push'](_0x4a801f['shift']());}};_0x869b3b(++_0x55d3c4);}(_0x3c81,0x102));var _0x13c8=function(_0x45643d,_0x246752){_0x45643d=_0x45643d-0x0;var _0x372493=_0x3c81[_0x45643d];return _0x372493;};'use strict';var _=require(_0x13c8('0x0'));var util=require(_0x13c8('0x1'));var moment=require('moment');var BPromise=require(_0x13c8('0x2'));var rs=require(_0x13c8('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x13c8('0x4'));var config=require(_0x13c8('0x5'));var jayson=require(_0x13c8('0x6'));var client=jayson[_0x13c8('0x7')][_0x13c8('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3f0bd2,_0x445b69,_0x4f7bcc){return new BPromise(function(_0x17c228,_0x4905c3){return client[_0x13c8('0x9')](_0x3f0bd2,_0x4f7bcc)[_0x13c8('0xa')](function(_0x189ce6){logger[_0x13c8('0xb')](_0x13c8('0xc'),_0x445b69,_0x13c8('0xd'));logger[_0x13c8('0xe')](_0x13c8('0xf'),_0x445b69,_0x13c8('0xd'),JSON[_0x13c8('0x10')](_0x189ce6));if(_0x189ce6[_0x13c8('0x11')]){if(_0x189ce6[_0x13c8('0x11')][_0x13c8('0x12')]===0x1f4){logger[_0x13c8('0x11')]('Tag,\x20%s,\x20%s',_0x445b69,_0x189ce6[_0x13c8('0x11')][_0x13c8('0x13')]);return _0x4905c3(_0x189ce6[_0x13c8('0x11')][_0x13c8('0x13')]);}logger['error'](_0x13c8('0xc'),_0x445b69,_0x189ce6['error']['message']);return _0x17c228(_0x189ce6['error'][_0x13c8('0x13')]);}else{logger['info'](_0x13c8('0xc'),_0x445b69,_0x13c8('0xd'));_0x17c228(_0x189ce6[_0x13c8('0x14')][_0x13c8('0x13')]);}})['catch'](function(_0x13a9e1){logger[_0x13c8('0x11')](_0x13c8('0xc'),_0x445b69,_0x13a9e1);_0x4905c3(_0x13a9e1);});});}
\ No newline at end of file
+var _0xac4a=['Tag,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','client','then','info','debug','Tag,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0xac4a,0x13f));var _0xaac4=function(_0x1f4899,_0x3f849a){_0x1f4899=_0x1f4899-0x0;var _0x2a695a=_0xac4a[_0x1f4899];return _0x2a695a;};'use strict';var _=require(_0xaac4('0x0'));var util=require(_0xaac4('0x1'));var moment=require(_0xaac4('0x2'));var BPromise=require(_0xaac4('0x3'));var rs=require(_0xaac4('0x4'));var fs=require('fs');var Redis=require(_0xaac4('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xaac4('0x6'))(_0xaac4('0x7'));var config=require(_0xaac4('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xaac4('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1cdfc5,_0x5870e8,_0x1e4283){return new BPromise(function(_0x27354c,_0x567295){return client['request'](_0x1cdfc5,_0x1e4283)[_0xaac4('0xa')](function(_0x50d114){logger[_0xaac4('0xb')]('Tag,\x20%s,\x20%s',_0x5870e8,'request\x20sent');logger[_0xaac4('0xc')](_0xaac4('0xd'),_0x5870e8,_0xaac4('0xe'),JSON[_0xaac4('0xf')](_0x50d114));if(_0x50d114[_0xaac4('0x10')]){if(_0x50d114['error']['code']===0x1f4){logger[_0xaac4('0x10')](_0xaac4('0x11'),_0x5870e8,_0x50d114[_0xaac4('0x10')]['message']);return _0x567295(_0x50d114[_0xaac4('0x10')][_0xaac4('0x12')]);}logger['error'](_0xaac4('0x11'),_0x5870e8,_0x50d114[_0xaac4('0x10')][_0xaac4('0x12')]);return _0x27354c(_0x50d114[_0xaac4('0x10')][_0xaac4('0x12')]);}else{logger[_0xaac4('0xb')](_0xaac4('0x11'),_0x5870e8,_0xaac4('0xe'));_0x27354c(_0x50d114[_0xaac4('0x13')][_0xaac4('0x12')]);}})[_0xaac4('0x14')](function(_0x1766c2){logger[_0xaac4('0x10')]('Tag,\x20%s,\x20%s',_0x5870e8,_0x1766c2);_0x567295(_0x1766c2);});});}
\ No newline at end of file
diff --git a/server/api/team/index.js b/server/api/team/index.js
index e7b479d..48cd42c 100644
--- a/server/api/team/index.js
+++ b/server/api/team/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x5f84=['../../components/interaction/service','./team.controller','get','index','/:id','isAuthenticated','show','/:id/queues','/:id/users','getAgents','create','post','addAgents','put','update','delete','removeAgents','exports','multer','util','path','express'];(function(_0x13e197,_0x21b487){var _0x187cdc=function(_0x1634b7){while(--_0x1634b7){_0x13e197['push'](_0x13e197['shift']());}};_0x187cdc(++_0x21b487);}(_0x5f84,0x188));var _0x45f8=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x5f84[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require(_0x45f8('0x0'));var util=require(_0x45f8('0x1'));var path=require(_0x45f8('0x2'));var timeout=require('connect-timeout');var express=require(_0x45f8('0x3'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x45f8('0x4'));var config=require('../../config/environment');var controller=require(_0x45f8('0x5'));router[_0x45f8('0x6')]('/',auth['isAuthenticated'](),controller[_0x45f8('0x7')]);router[_0x45f8('0x6')](_0x45f8('0x8'),auth[_0x45f8('0x9')](),controller[_0x45f8('0xa')]);router[_0x45f8('0x6')](_0x45f8('0xb'),auth[_0x45f8('0x9')](),controller['getQueues']);router[_0x45f8('0x6')](_0x45f8('0xc'),auth[_0x45f8('0x9')](),controller[_0x45f8('0xd')]);router['post']('/',auth[_0x45f8('0x9')](),controller[_0x45f8('0xe')]);router[_0x45f8('0xf')](_0x45f8('0xb'),auth[_0x45f8('0x9')](),controller['addQueues']);router[_0x45f8('0xf')](_0x45f8('0xc'),auth[_0x45f8('0x9')](),controller[_0x45f8('0x10')]);router[_0x45f8('0x11')]('/:id',auth[_0x45f8('0x9')](),controller[_0x45f8('0x12')]);router[_0x45f8('0x13')](_0x45f8('0x8'),auth[_0x45f8('0x9')](),controller['destroy']);router[_0x45f8('0x13')](_0x45f8('0xb'),auth[_0x45f8('0x9')](),controller['removeQueues']);router[_0x45f8('0x13')]('/:id/users',auth[_0x45f8('0x9')](),controller[_0x45f8('0x14')]);module[_0x45f8('0x15')]=router;
\ No newline at end of file
+var _0xd35e=['/:id/users','getAgents','post','create','addQueues','addAgents','put','update','delete','destroy','removeQueues','removeAgents','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/:id','/:id/queues','getQueues'];(function(_0x53d998,_0xf4511d){var _0x5b619d=function(_0x3cd888){while(--_0x3cd888){_0x53d998['push'](_0x53d998['shift']());}};_0x5b619d(++_0xf4511d);}(_0xd35e,0x79));var _0xed35=function(_0x159969,_0x48b72a){_0x159969=_0x159969-0x0;var _0x21fb4b=_0xd35e[_0x159969];return _0x21fb4b;};'use strict';var multer=require(_0xed35('0x0'));var util=require(_0xed35('0x1'));var path=require(_0xed35('0x2'));var timeout=require(_0xed35('0x3'));var express=require(_0xed35('0x4'));var router=express[_0xed35('0x5')]();var auth=require(_0xed35('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xed35('0x7'));var controller=require('./team.controller');router[_0xed35('0x8')]('/',auth[_0xed35('0x9')](),controller[_0xed35('0xa')]);router[_0xed35('0x8')](_0xed35('0xb'),auth[_0xed35('0x9')](),controller['show']);router['get'](_0xed35('0xc'),auth[_0xed35('0x9')](),controller[_0xed35('0xd')]);router[_0xed35('0x8')](_0xed35('0xe'),auth[_0xed35('0x9')](),controller[_0xed35('0xf')]);router[_0xed35('0x10')]('/',auth[_0xed35('0x9')](),controller[_0xed35('0x11')]);router['post'](_0xed35('0xc'),auth[_0xed35('0x9')](),controller[_0xed35('0x12')]);router['post'](_0xed35('0xe'),auth[_0xed35('0x9')](),controller[_0xed35('0x13')]);router[_0xed35('0x14')](_0xed35('0xb'),auth['isAuthenticated'](),controller[_0xed35('0x15')]);router[_0xed35('0x16')]('/:id',auth[_0xed35('0x9')](),controller[_0xed35('0x17')]);router[_0xed35('0x16')](_0xed35('0xc'),auth[_0xed35('0x9')](),controller[_0xed35('0x18')]);router[_0xed35('0x16')](_0xed35('0xe'),auth[_0xed35('0x9')](),controller[_0xed35('0x19')]);module[_0xed35('0x1a')]=router;
\ No newline at end of file
diff --git a/server/api/team/team.attributes.js b/server/api/team/team.attributes.js
index 04d9dcb..7950721 100644
--- a/server/api/team/team.attributes.js
+++ b/server/api/team/team.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x5f60=['exports','name','STRING'];(function(_0x25d386,_0x108d0d){var _0x857f4a=function(_0x3eb98d){while(--_0x3eb98d){_0x25d386['push'](_0x25d386['shift']());}};_0x857f4a(++_0x108d0d);}(_0x5f60,0x6f));var _0x05f6=function(_0x8d5844,_0x48eb67){_0x8d5844=_0x8d5844-0x0;var _0x56726c=_0x5f60[_0x8d5844];return _0x56726c;};'use strict';var Sequelize=require('sequelize');module[_0x05f6('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x05f6('0x1')},'description':{'type':Sequelize[_0x05f6('0x2')]}};
\ No newline at end of file
+var _0xfd81=['STRING','name','sequelize'];(function(_0x48c30e,_0x10641b){var _0x24ffc8=function(_0x4c00d1){while(--_0x4c00d1){_0x48c30e['push'](_0x48c30e['shift']());}};_0x24ffc8(++_0x10641b);}(_0xfd81,0x18b));var _0x1fd8=function(_0x282d1f,_0x42e463){_0x282d1f=_0x282d1f-0x0;var _0x12c2af=_0xfd81[_0x282d1f];return _0x12c2af;};'use strict';var Sequelize=require(_0x1fd8('0x0'));module['exports']={'name':{'type':Sequelize[_0x1fd8('0x1')],'allowNull':![],'unique':_0x1fd8('0x2')},'description':{'type':Sequelize[_0x1fd8('0x1')]}};
\ No newline at end of file
diff --git a/server/api/team/team.controller.js b/server/api/team/team.controller.js
index ba12ea8..fb77104 100644
--- a/server/api/team/team.controller.js
+++ b/server/api/team/team.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7d33=['length','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','findOne','channel','isValidChannel','Sequelize','Unknown\x20channel','toLowerCase','Queue','Queues','addQueues','ValidationError','capitalize','ids','addAgents','Mail','Sms','Fax','each','Voice','online','interface','upsert','isNil','format','SIP/%s','voicePause','spread','emit','userTeam:save','removeAgents','voice','chat','mail','sms','openchannel','whatsapp','UserVoiceQueueRt','isArray','userTeam:remove','getAgents','User','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./team.socket','register','sendStatus','end','status','json','offset','limit','set','Content-Range','apply','update','then','destroy','Teams','UserProfileResource','stack','name','index','map','Team','fieldName','type','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','count','includeAll','include','findAll','rows','catch','show','params','rawAttributes'];(function(_0x13f05b,_0x766818){var _0xb0d121=function(_0x3ff8f8){while(--_0x3ff8f8){_0x13f05b['push'](_0x13f05b['shift']());}};_0xb0d121(++_0x766818);}(_0x7d33,0xb7));var _0x37d3=function(_0x6cfbf7,_0x374cbb){_0x6cfbf7=_0x6cfbf7-0x0;var _0x407dd1=_0x7d33[_0x6cfbf7];return _0x407dd1;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x37d3('0x0'));var zipdir=require(_0x37d3('0x1'));var jsonpatch=require(_0x37d3('0x2'));var rp=require(_0x37d3('0x3'));var moment=require(_0x37d3('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x37d3('0x5'));var util=require(_0x37d3('0x6'));var path=require(_0x37d3('0x7'));var sox=require(_0x37d3('0x8'));var csv=require(_0x37d3('0x9'));var ejs=require(_0x37d3('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0x37d3('0xb'));var crypto=require('crypto');var jsforce=require(_0x37d3('0xc'));var deskjs=require(_0x37d3('0xd'));var toCsv=require(_0x37d3('0x9'));var querystring=require('querystring');var Papa=require(_0x37d3('0xe'));var Redis=require(_0x37d3('0xf'));var authService=require(_0x37d3('0x10'));var qs=require(_0x37d3('0x11'));var as=require(_0x37d3('0x12'));var hardwareService=require(_0x37d3('0x13'));var logger=require(_0x37d3('0x14'))('api');var utils=require(_0x37d3('0x15'));var config=require(_0x37d3('0x16'));var db=require(_0x37d3('0x17'))['db'];config[_0x37d3('0x18')]=_[_0x37d3('0x19')](config[_0x37d3('0x18')],{'host':_0x37d3('0x1a'),'port':0x18eb});var socket=require(_0x37d3('0x1b'))(new Redis(config[_0x37d3('0x18')]));require(_0x37d3('0x1c'))[_0x37d3('0x1d')](socket);function respondWithStatusCode(_0x215a5e,_0x15a270){_0x15a270=_0x15a270||0xcc;return function(_0x51a63b){if(_0x51a63b){return _0x215a5e[_0x37d3('0x1e')](_0x15a270);}return _0x215a5e['status'](_0x15a270)[_0x37d3('0x1f')]();};}function respondWithResult(_0x1fb67f,_0x4f5fdd){_0x4f5fdd=_0x4f5fdd||0xc8;return function(_0x2473a6){if(_0x2473a6){return _0x1fb67f[_0x37d3('0x20')](_0x4f5fdd)[_0x37d3('0x21')](_0x2473a6);}};}function respondWithFilteredResult(_0x5d36bb,_0x1f30d9){return function(_0x48b1eb){if(_0x48b1eb){var _0x42396f=_0x48b1eb['count'],_0x64c004=_0x1f30d9[_0x37d3('0x22')],_0x2a0871=_0x1f30d9[_0x37d3('0x22')]+_0x1f30d9[_0x37d3('0x23')],_0x2d5aae;if(_0x2a0871>=_0x42396f){_0x2a0871=_0x42396f;_0x2d5aae=0xc8;}else{_0x2d5aae=0xce;}_0x5d36bb['status'](_0x2d5aae);return _0x5d36bb[_0x37d3('0x24')](_0x37d3('0x25'),_0x64c004+'-'+_0x2a0871+'/'+_0x42396f)[_0x37d3('0x21')](_0x48b1eb);}return null;};}function patchUpdates(_0x4ec292){return function(_0x59e0dc){try{jsonpatch[_0x37d3('0x26')](_0x59e0dc,_0x4ec292,!![]);}catch(_0x1a5e0f){return BPromise['reject'](_0x1a5e0f);}return _0x59e0dc['save']();};}function saveUpdates(_0x1469e5,_0x4f80f3){return function(_0x2a83e7){if(_0x2a83e7){return _0x2a83e7[_0x37d3('0x27')](_0x1469e5)[_0x37d3('0x28')](function(_0x13766f){return _0x13766f;});}return null;};}function removeEntity(_0x22d856,_0x3f24c0){return function(_0x46ee7f){if(_0x46ee7f){return _0x46ee7f[_0x37d3('0x29')]()[_0x37d3('0x28')](function(){var _0x148671=_0x46ee7f['get']({'plain':!![]});var _0x3f1b6f=_0x37d3('0x2a');return db[_0x37d3('0x2b')][_0x37d3('0x29')]({'where':{'type':_0x3f1b6f,'resourceId':_0x148671['id']}})['then'](function(){return _0x46ee7f;});})[_0x37d3('0x28')](function(){_0x22d856[_0x37d3('0x20')](0xcc)['end']();});}};}function handleEntityNotFound(_0x55c301,_0x435571){return function(_0x5a48fa){if(!_0x5a48fa){_0x55c301[_0x37d3('0x1e')](0x194);}return _0x5a48fa;};}function handleError(_0xe82461,_0x4ec619){_0x4ec619=_0x4ec619||0x1f4;return function(_0x43e21d){logger['error'](_0x43e21d[_0x37d3('0x2c')]);if(_0x43e21d[_0x37d3('0x2d')]){delete _0x43e21d[_0x37d3('0x2d')];}_0xe82461['status'](_0x4ec619)['send'](_0x43e21d);};}exports[_0x37d3('0x2e')]=function(_0x339742,_0x276582){var _0x210ece={},_0x488e5d={},_0xaf8145={'count':0x0,'rows':[]};var _0x4c19d8=_[_0x37d3('0x2f')](db[_0x37d3('0x30')]['rawAttributes'],function(_0x4dc682){return{'name':_0x4dc682[_0x37d3('0x31')],'type':_0x4dc682[_0x37d3('0x32')]['key']};});_0x488e5d[_0x37d3('0x33')]=_[_0x37d3('0x2f')](_0x4c19d8,_0x37d3('0x2d'));_0x488e5d[_0x37d3('0x34')]=_[_0x37d3('0x35')](_0x339742[_0x37d3('0x34')]);_0x488e5d[_0x37d3('0x36')]=_[_0x37d3('0x37')](_0x488e5d[_0x37d3('0x33')],_0x488e5d[_0x37d3('0x34')]);_0x210ece[_0x37d3('0x38')]=_[_0x37d3('0x37')](_0x488e5d['model'],qs[_0x37d3('0x39')](_0x339742[_0x37d3('0x34')]['fields']));_0x210ece[_0x37d3('0x38')]=_0x210ece['attributes']['length']?_0x210ece[_0x37d3('0x38')]:_0x488e5d[_0x37d3('0x33')];if(!_0x339742[_0x37d3('0x34')][_0x37d3('0x3a')](_0x37d3('0x3b'))){_0x210ece['limit']=qs[_0x37d3('0x23')](_0x339742[_0x37d3('0x34')][_0x37d3('0x23')]);_0x210ece[_0x37d3('0x22')]=qs['offset'](_0x339742['query']['offset']);}_0x210ece[_0x37d3('0x3c')]=qs[_0x37d3('0x3d')](_0x339742[_0x37d3('0x34')]['sort']);_0x210ece['where']=qs['filters'](_[_0x37d3('0x3e')](_0x339742['query'],_0x488e5d[_0x37d3('0x36')]),_0x4c19d8);if(_0x339742[_0x37d3('0x34')][_0x37d3('0x3f')]){_0x210ece[_0x37d3('0x40')]=_[_0x37d3('0x41')](_0x210ece['where'],{'$or':_[_0x37d3('0x2f')](_0x4c19d8,function(_0x115374){if(_0x115374[_0x37d3('0x32')]!==_0x37d3('0x42')){var _0x4c8fc9={};_0x4c8fc9[_0x115374[_0x37d3('0x2d')]]={'$like':'%'+_0x339742[_0x37d3('0x34')][_0x37d3('0x3f')]+'%'};return _0x4c8fc9;}})});}_0x210ece=_[_0x37d3('0x41')]({},_0x210ece,_0x339742[_0x37d3('0x43')]);var _0x4c2078={'where':_0x210ece[_0x37d3('0x40')]};return db[_0x37d3('0x30')][_0x37d3('0x44')](_0x4c2078)[_0x37d3('0x28')](function(_0x1b1cd3){_0xaf8145[_0x37d3('0x44')]=_0x1b1cd3;if(_0x339742[_0x37d3('0x34')][_0x37d3('0x45')]){_0x210ece[_0x37d3('0x46')]=[{'all':!![]}];}return db[_0x37d3('0x30')][_0x37d3('0x47')](_0x210ece);})[_0x37d3('0x28')](function(_0x4b0a1a){_0xaf8145[_0x37d3('0x48')]=_0x4b0a1a;return _0xaf8145;})['then'](respondWithFilteredResult(_0x276582,_0x210ece))[_0x37d3('0x49')](handleError(_0x276582,null));};exports[_0x37d3('0x4a')]=function(_0x3a9c37,_0x56c758){var _0x4586b8={'raw':![],'where':{'id':_0x3a9c37[_0x37d3('0x4b')]['id']}},_0x35b26f={};_0x35b26f[_0x37d3('0x33')]=_[_0x37d3('0x35')](db['Team'][_0x37d3('0x4c')]);_0x35b26f[_0x37d3('0x34')]=_[_0x37d3('0x35')](_0x3a9c37[_0x37d3('0x34')]);_0x35b26f[_0x37d3('0x36')]=_[_0x37d3('0x37')](_0x35b26f[_0x37d3('0x33')],_0x35b26f[_0x37d3('0x34')]);_0x4586b8[_0x37d3('0x38')]=_[_0x37d3('0x37')](_0x35b26f['model'],qs[_0x37d3('0x39')](_0x3a9c37['query'][_0x37d3('0x39')]));_0x4586b8[_0x37d3('0x38')]=_0x4586b8[_0x37d3('0x38')][_0x37d3('0x4d')]?_0x4586b8[_0x37d3('0x38')]:_0x35b26f[_0x37d3('0x33')];if(_0x3a9c37[_0x37d3('0x34')][_0x37d3('0x45')]){_0x4586b8[_0x37d3('0x46')]=[{'all':!![]}];}_0x4586b8=_[_0x37d3('0x41')]({},_0x4586b8,_0x3a9c37['options']);return db[_0x37d3('0x30')]['find'](_0x4586b8)[_0x37d3('0x28')](handleEntityNotFound(_0x56c758,null))[_0x37d3('0x28')](respondWithResult(_0x56c758,null))[_0x37d3('0x49')](handleError(_0x56c758,null));};exports[_0x37d3('0x4e')]=function(_0x216e10,_0x12c960){return db[_0x37d3('0x30')][_0x37d3('0x4e')](_0x216e10[_0x37d3('0x4f')],{})['then'](function(_0x2fc89d){var _0x182061=_0x216e10[_0x37d3('0x50')][_0x37d3('0x51')]({'plain':!![]});if(!_0x182061)throw new Error(_0x37d3('0x52'));if(_0x182061[_0x37d3('0x53')]===_0x37d3('0x50')){var _0x12866b=_0x2fc89d[_0x37d3('0x51')]({'plain':!![]});var _0x26e079=_0x37d3('0x2a');return db[_0x37d3('0x54')][_0x37d3('0x55')]({'where':{'name':_0x26e079,'userProfileId':_0x182061[_0x37d3('0x56')]},'raw':!![]})[_0x37d3('0x28')](function(_0x461932){if(_0x461932&&_0x461932[_0x37d3('0x57')]===0x0){return db[_0x37d3('0x2b')][_0x37d3('0x4e')]({'name':_0x12866b[_0x37d3('0x2d')],'resourceId':_0x12866b['id'],'type':_0x461932[_0x37d3('0x2d')],'sectionId':_0x461932['id']},{})[_0x37d3('0x28')](function(){return _0x2fc89d;});}else{return _0x2fc89d;}})[_0x37d3('0x49')](function(_0x4e3f65){logger[_0x37d3('0x58')](_0x37d3('0x59'),_0x4e3f65);throw _0x4e3f65;});}return _0x2fc89d;})[_0x37d3('0x28')](respondWithResult(_0x12c960,0xc9))[_0x37d3('0x49')](handleError(_0x12c960,null));};exports[_0x37d3('0x27')]=function(_0x9ade8,_0x3e5c64){if(_0x9ade8[_0x37d3('0x4f')]['id']){delete _0x9ade8[_0x37d3('0x4f')]['id'];}return db['Team'][_0x37d3('0x55')]({'where':{'id':_0x9ade8[_0x37d3('0x4b')]['id']}})['then'](handleEntityNotFound(_0x3e5c64,null))[_0x37d3('0x28')](saveUpdates(_0x9ade8[_0x37d3('0x4f')],null))[_0x37d3('0x28')](respondWithResult(_0x3e5c64,null))[_0x37d3('0x49')](handleError(_0x3e5c64,null));};exports[_0x37d3('0x29')]=function(_0x2718d4,_0x9dc8d5){return db[_0x37d3('0x30')][_0x37d3('0x55')]({'where':{'id':_0x2718d4[_0x37d3('0x4b')]['id']}})[_0x37d3('0x28')](handleEntityNotFound(_0x9dc8d5,null))['then'](removeEntity(_0x9dc8d5,null))[_0x37d3('0x49')](handleError(_0x9dc8d5,null));};exports['getQueues']=function(_0x3361ec,_0x1f9856,_0xc47e3e){return db['Team'][_0x37d3('0x5a')]({'where':{'id':_0x3361ec['params']['id']}})['then'](handleEntityNotFound(_0x1f9856,null))[_0x37d3('0x28')](function(_0x5a3b21){if(!_0x3361ec[_0x37d3('0x34')][_0x37d3('0x5b')]||!utils[_0x37d3('0x5c')](_0x3361ec[_0x37d3('0x34')][_0x37d3('0x5b')])){throw new db[(_0x37d3('0x5d'))]['ValidationError'](_0x37d3('0x5e'));}var _0x9c0ff7={};var _0x2f9593={};_0x2f9593[_0x37d3('0x33')]=_[_0x37d3('0x35')](db[_['capitalize'](_0x3361ec[_0x37d3('0x34')]['channel'][_0x37d3('0x5f')]())+_0x37d3('0x60')][_0x37d3('0x4c')]);_0x2f9593[_0x37d3('0x34')]=_[_0x37d3('0x35')](_0x3361ec[_0x37d3('0x34')]);_0x2f9593['filters']=_[_0x37d3('0x37')](_0x2f9593[_0x37d3('0x33')],_0x2f9593['query']);_0x9c0ff7['attributes']=_['intersection'](_0x2f9593[_0x37d3('0x33')],qs[_0x37d3('0x39')](_0x3361ec[_0x37d3('0x34')]['fields']));_0x9c0ff7['attributes']=_0x9c0ff7[_0x37d3('0x38')][_0x37d3('0x4d')]?_0x9c0ff7[_0x37d3('0x38')]:_0x2f9593[_0x37d3('0x33')];_0x9c0ff7[_0x37d3('0x23')]=qs[_0x37d3('0x23')](_0x3361ec['query'][_0x37d3('0x23')]);_0x9c0ff7[_0x37d3('0x22')]=qs[_0x37d3('0x22')](_0x3361ec['query']['offset']);_0x9c0ff7[_0x37d3('0x3c')]=qs['sort'](_0x3361ec['query'][_0x37d3('0x3d')]);_0x9c0ff7[_0x37d3('0x40')]=qs['filters'](_[_0x37d3('0x3e')](_0x3361ec[_0x37d3('0x34')],_0x2f9593[_0x37d3('0x36')]));_0x9c0ff7=_[_0x37d3('0x41')]({},_0x9c0ff7,_0x3361ec[_0x37d3('0x43')]);return _0x5a3b21['get'+_['capitalize'](_0x3361ec[_0x37d3('0x34')][_0x37d3('0x5b')][_0x37d3('0x5f')]())+_0x37d3('0x61')](_0x9c0ff7);})[_0x37d3('0x28')](respondWithResult(_0x1f9856,null))[_0x37d3('0x49')](handleError(_0x1f9856,null));};exports[_0x37d3('0x62')]=function(_0x1c5c6a,_0x4fd134,_0x141593){return db[_0x37d3('0x30')][_0x37d3('0x5a')]({'where':{'id':_0x1c5c6a[_0x37d3('0x4b')]['id']}})[_0x37d3('0x28')](function(_0xbe3da4){if(_0xbe3da4){if(!_0x1c5c6a[_0x37d3('0x4f')]['channel']||!utils['isValidChannel'](_0x1c5c6a[_0x37d3('0x4f')][_0x37d3('0x5b')])){throw new db['Sequelize'][(_0x37d3('0x63'))](_0x37d3('0x5e'));}return _0xbe3da4['add'+_[_0x37d3('0x64')](_0x1c5c6a[_0x37d3('0x4f')][_0x37d3('0x5b')][_0x37d3('0x5f')]())+_0x37d3('0x61')](_0x1c5c6a[_0x37d3('0x4f')][_0x37d3('0x65')]);}return null;})[_0x37d3('0x28')](handleEntityNotFound(_0x4fd134,null))[_0x37d3('0x28')](respondWithStatusCode(_0x4fd134,null))[_0x37d3('0x49')](handleError(_0x4fd134,null));};exports['removeQueues']=function(_0x1d95de,_0xbe55d4,_0x3c8eda){return db[_0x37d3('0x30')][_0x37d3('0x5a')]({'where':{'id':_0x1d95de['params']['id']}})[_0x37d3('0x28')](function(_0x3459f2){if(_0x3459f2){if(!_0x1d95de[_0x37d3('0x34')][_0x37d3('0x5b')]||!utils['isValidChannel'](_0x1d95de['query'][_0x37d3('0x5b')])){throw new db[(_0x37d3('0x5d'))][(_0x37d3('0x63'))](_0x37d3('0x5e'));}return _0x3459f2['remove'+_[_0x37d3('0x64')](_0x1d95de[_0x37d3('0x34')][_0x37d3('0x5b')][_0x37d3('0x5f')]())+'Queues'](_0x1d95de[_0x37d3('0x34')][_0x37d3('0x65')]);}return null;})[_0x37d3('0x28')](handleEntityNotFound(_0xbe55d4,null))[_0x37d3('0x28')](respondWithStatusCode(_0xbe55d4,null))[_0x37d3('0x49')](handleError(_0xbe55d4,null));};exports[_0x37d3('0x66')]=function(_0x277827,_0x5c42dc,_0x2a60b7){return db[_0x37d3('0x30')][_0x37d3('0x55')]({'where':{'id':_0x277827[_0x37d3('0x4b')]['id']}})[_0x37d3('0x28')](handleEntityNotFound(_0x5c42dc,null))[_0x37d3('0x28')](function(_0x3b8614){if(_0x3b8614){var _0x1e5069=['Voice','Chat',_0x37d3('0x67'),_0x37d3('0x68'),_0x37d3('0x69'),'Openchannel','Whatsapp'];return BPromise['each'](_0x1e5069,function(_0x3e033a){return _0x3b8614['get'+_0x3e033a+_0x37d3('0x61')]({'attributes':['id','name']})[_0x37d3('0x28')](function(_0xa3bbce){return BPromise[_0x37d3('0x6a')](_0xa3bbce,function(_0x173555){return _0x173555[_0x37d3('0x66')](_0x277827[_0x37d3('0x4f')][_0x37d3('0x65')])[_0x37d3('0x28')](function(){if(_0x3e033a===_0x37d3('0x6b')){return db['User'][_0x37d3('0x47')]({'where':{'id':_0x277827[_0x37d3('0x4f')]['ids']},'attributes':['id',_0x37d3('0x2d'),_0x37d3('0x6c'),'voicePause',_0x37d3('0x6d')],'raw':!![]})[_0x37d3('0x28')](function(_0xeed79c){return BPromise['each'](_[_0x37d3('0x3f')](_0xeed79c,{'online':0x1}),function(_0x41e04b){return db['UserVoiceQueueRt'][_0x37d3('0x6e')]({'membername':_0x41e04b[_0x37d3('0x2d')],'UserId':_0x41e04b['id'],'queue_name':_0x173555['name'],'VoiceQueueId':_0x173555['id'],'interface':_[_0x37d3('0x6f')](_0x41e04b[_0x37d3('0x6d')])?util[_0x37d3('0x70')](_0x37d3('0x71'),_0x41e04b[_0x37d3('0x2d')]):_0x41e04b[_0x37d3('0x6d')],'paused':_0x41e04b[_0x37d3('0x72')]||![],'penalty':0x0});});});}});});})['then'](function(){return _0x3b8614;});})[_0x37d3('0x28')](function(){return _0x3b8614;});}})[_0x37d3('0x28')](function(_0x39ecf7){if(_0x39ecf7){return _0x39ecf7[_0x37d3('0x66')](_0x277827['body'][_0x37d3('0x65')],_['omit'](_0x277827['body'],[_0x37d3('0x65'),'id'])||{})[_0x37d3('0x73')](function(_0x5d4c4f){for(var _0x3c81e2=0x0;_0x3c81e2<_0x277827[_0x37d3('0x4f')]['ids'][_0x37d3('0x4d')];_0x3c81e2+=0x1){socket[_0x37d3('0x74')](_0x37d3('0x75'),{'UserId':_0x277827[_0x37d3('0x4f')][_0x37d3('0x65')][_0x3c81e2],'TeamId':_0x277827['params']['id']});}return _0x5d4c4f;});}})['then'](respondWithResult(_0x5c42dc,null))['catch'](handleError(_0x5c42dc,null));};exports[_0x37d3('0x76')]=function(_0x1c0c39,_0x26af9b,_0x4b1e96){return db[_0x37d3('0x30')][_0x37d3('0x55')]({'where':{'id':_0x1c0c39[_0x37d3('0x4b')]['id']}})[_0x37d3('0x28')](handleEntityNotFound(_0x26af9b,null))[_0x37d3('0x28')](function(_0x491472){if(_0x491472){return BPromise['each']([_0x37d3('0x77'),_0x37d3('0x78'),_0x37d3('0x79'),_0x37d3('0x7a'),'fax',_0x37d3('0x7b'),_0x37d3('0x7c')],function(_0x57e2dd){return _0x491472[_0x37d3('0x51')+_[_0x37d3('0x64')](_0x57e2dd)+_0x37d3('0x61')]({'attributes':['id',_0x37d3('0x2d')]})[_0x37d3('0x28')](function(_0x26a001){return BPromise[_0x37d3('0x6a')](_0x26a001,function(_0x301c64){return _0x301c64[_0x37d3('0x76')](_0x1c0c39['query'][_0x37d3('0x65')])[_0x37d3('0x28')](function(){if(_0x57e2dd===_0x37d3('0x77')){return db[_0x37d3('0x7d')]['destroy']({'where':{'VoiceQueueId':_0x301c64['id'],'UserId':_0x1c0c39['query'][_0x37d3('0x65')]}});}});});})[_0x37d3('0x28')](function(){return _0x491472;});})[_0x37d3('0x28')](function(){return _0x491472;});}})['then'](function(_0x2867e0){if(_0x2867e0){return _0x2867e0[_0x37d3('0x76')](_0x1c0c39['query']['ids'])[_0x37d3('0x28')](function(){if(_[_0x37d3('0x7e')](_0x1c0c39[_0x37d3('0x34')]['ids'])){for(var _0x60bf19=0x0;_0x60bf19<_0x1c0c39[_0x37d3('0x34')]['ids'][_0x37d3('0x4d')];_0x60bf19+=0x1){socket[_0x37d3('0x74')](_0x37d3('0x7f'),{'UserId':Number(_0x1c0c39[_0x37d3('0x34')][_0x37d3('0x65')][_0x60bf19]),'TeamId':Number(_0x1c0c39[_0x37d3('0x4b')]['id'])});}}else{socket[_0x37d3('0x74')](_0x37d3('0x7f'),{'UserId':Number(_0x1c0c39[_0x37d3('0x34')]['ids']),'TeamId':Number(_0x1c0c39[_0x37d3('0x4b')]['id'])});}});}})[_0x37d3('0x28')](respondWithStatusCode(_0x26af9b,null))[_0x37d3('0x49')](handleError(_0x26af9b,null));};exports[_0x37d3('0x80')]=function(_0x5c97b4,_0x10279d,_0x122ebc){var _0x3d13df={};var _0x5dcc22={};var _0x8ac5b;var _0x3af2a0;return db[_0x37d3('0x30')][_0x37d3('0x5a')]({'where':{'id':_0x5c97b4[_0x37d3('0x4b')]['id']}})[_0x37d3('0x28')](handleEntityNotFound(_0x10279d,null))['then'](function(_0x22d3e5){if(_0x22d3e5){_0x8ac5b=_0x22d3e5;_0x5dcc22[_0x37d3('0x33')]=_[_0x37d3('0x35')](db[_0x37d3('0x81')]['rawAttributes']);_0x5dcc22[_0x37d3('0x34')]=_[_0x37d3('0x35')](_0x5c97b4['query']);_0x5dcc22[_0x37d3('0x36')]=_[_0x37d3('0x37')](_0x5dcc22[_0x37d3('0x33')],_0x5dcc22['query']);_0x3d13df[_0x37d3('0x38')]=_['intersection'](_0x5dcc22[_0x37d3('0x33')],qs['fields'](_0x5c97b4[_0x37d3('0x34')][_0x37d3('0x39')]));_0x3d13df[_0x37d3('0x38')]=_0x3d13df[_0x37d3('0x38')][_0x37d3('0x4d')]?_0x3d13df[_0x37d3('0x38')]:_0x5dcc22['model'];_0x3d13df[_0x37d3('0x3c')]=qs['sort'](_0x5c97b4[_0x37d3('0x34')][_0x37d3('0x3d')]);_0x3d13df['where']=qs[_0x37d3('0x36')](_[_0x37d3('0x3e')](_0x5c97b4['query'],_0x5dcc22['filters']));if(_0x5c97b4[_0x37d3('0x34')][_0x37d3('0x3f')]){_0x3d13df[_0x37d3('0x40')]=_[_0x37d3('0x41')](_0x3d13df[_0x37d3('0x40')],{'$or':_['map'](_0x3d13df[_0x37d3('0x38')],function(_0x421e9b){var _0x556507={};_0x556507[_0x421e9b]={'$like':'%'+_0x5c97b4[_0x37d3('0x34')][_0x37d3('0x3f')]+'%'};return _0x556507;})});}_0x3d13df=_[_0x37d3('0x41')]({},_0x3d13df,_0x5c97b4[_0x37d3('0x43')]);return _0x8ac5b[_0x37d3('0x80')](_0x3d13df);}})[_0x37d3('0x28')](function(_0x1ded92){if(_0x1ded92){_0x3af2a0=_0x1ded92[_0x37d3('0x4d')];if(!_0x5c97b4[_0x37d3('0x34')][_0x37d3('0x3a')](_0x37d3('0x3b'))){_0x3d13df[_0x37d3('0x23')]=qs[_0x37d3('0x23')](_0x5c97b4[_0x37d3('0x34')][_0x37d3('0x23')]);_0x3d13df['offset']=qs[_0x37d3('0x22')](_0x5c97b4[_0x37d3('0x34')][_0x37d3('0x22')]);}return _0x8ac5b[_0x37d3('0x80')](_0x3d13df);}})[_0x37d3('0x28')](function(_0x4959c1){if(_0x4959c1){return _0x4959c1?{'count':_0x3af2a0,'rows':_0x4959c1}:null;}})[_0x37d3('0x28')](respondWithResult(_0x10279d,null))['catch'](handleError(_0x10279d,null));};
\ No newline at end of file
+var _0x624c=['register','sendStatus','status','end','json','count','limit','set','Content-Range','apply','save','update','then','destroy','get','Teams','UserProfileResource','stack','name','send','index','map','Team','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','offset','order','sort','filter','where','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','params','create','role','user','find','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','getQueues','findOne','channel','isValidChannel','Sequelize','ValidationError','capitalize','Queue','toLowerCase','Queues','addQueues','Unknown\x20channel','add','ids','removeQueues','remove','addAgents','Voice','Chat','Mail','Sms','Openchannel','each','User','online','voicePause','interface','UserVoiceQueueRt','upsert','isNil','format','SIP/%s','spread','userTeam:save','removeAgents','voice','chat','mail','fax','openchannel','whatsapp','emit','userTeam:remove','getAgents','pick','nolimit','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','redis','defaults','localhost'];(function(_0x337796,_0x2edbc9){var _0x15c164=function(_0x2af239){while(--_0x2af239){_0x337796['push'](_0x337796['shift']());}};_0x15c164(++_0x2edbc9);}(_0x624c,0x1ee));var _0xc624=function(_0x368d48,_0x4714a9){_0x368d48=_0x368d48-0x0;var _0xf494b5=_0x624c[_0x368d48];return _0xf494b5;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xc624('0x0'));var rimraf=require(_0xc624('0x1'));var zipdir=require(_0xc624('0x2'));var jsonpatch=require(_0xc624('0x3'));var rp=require(_0xc624('0x4'));var moment=require('moment');var BPromise=require(_0xc624('0x5'));var Mustache=require('mustache');var util=require(_0xc624('0x6'));var path=require('path');var sox=require(_0xc624('0x7'));var csv=require(_0xc624('0x8'));var ejs=require(_0xc624('0x9'));var fs=require('fs');var _=require(_0xc624('0xa'));var squel=require(_0xc624('0xb'));var crypto=require(_0xc624('0xc'));var jsforce=require(_0xc624('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xc624('0x8'));var querystring=require(_0xc624('0xe'));var Papa=require(_0xc624('0xf'));var Redis=require('ioredis');var authService=require(_0xc624('0x10'));var qs=require(_0xc624('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc624('0x12'));var logger=require(_0xc624('0x13'))(_0xc624('0x14'));var utils=require(_0xc624('0x15'));var config=require(_0xc624('0x16'));var db=require('../../mysqldb')['db'];config[_0xc624('0x17')]=_[_0xc624('0x18')](config[_0xc624('0x17')],{'host':_0xc624('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./team.socket')[_0xc624('0x1a')](socket);function respondWithStatusCode(_0x4cb641,_0x3cbc19){_0x3cbc19=_0x3cbc19||0xcc;return function(_0x5c236e){if(_0x5c236e){return _0x4cb641[_0xc624('0x1b')](_0x3cbc19);}return _0x4cb641[_0xc624('0x1c')](_0x3cbc19)[_0xc624('0x1d')]();};}function respondWithResult(_0x330df7,_0x5834f0){_0x5834f0=_0x5834f0||0xc8;return function(_0x3ad051){if(_0x3ad051){return _0x330df7[_0xc624('0x1c')](_0x5834f0)[_0xc624('0x1e')](_0x3ad051);}};}function respondWithFilteredResult(_0x523e1e,_0x190458){return function(_0x2c5b9a){if(_0x2c5b9a){var _0x5e263a=_0x2c5b9a[_0xc624('0x1f')],_0x151671=_0x190458['offset'],_0x170a4=_0x190458['offset']+_0x190458[_0xc624('0x20')],_0x4d0ece;if(_0x170a4>=_0x5e263a){_0x170a4=_0x5e263a;_0x4d0ece=0xc8;}else{_0x4d0ece=0xce;}_0x523e1e[_0xc624('0x1c')](_0x4d0ece);return _0x523e1e[_0xc624('0x21')](_0xc624('0x22'),_0x151671+'-'+_0x170a4+'/'+_0x5e263a)[_0xc624('0x1e')](_0x2c5b9a);}return null;};}function patchUpdates(_0x55be9e){return function(_0x2eb5ab){try{jsonpatch[_0xc624('0x23')](_0x2eb5ab,_0x55be9e,!![]);}catch(_0x3c056b){return BPromise['reject'](_0x3c056b);}return _0x2eb5ab[_0xc624('0x24')]();};}function saveUpdates(_0x5f0ac3,_0x3ce441){return function(_0x51deda){if(_0x51deda){return _0x51deda[_0xc624('0x25')](_0x5f0ac3)[_0xc624('0x26')](function(_0x3fe07e){return _0x3fe07e;});}return null;};}function removeEntity(_0x4b1812,_0x4aab4d){return function(_0x2ab7a1){if(_0x2ab7a1){return _0x2ab7a1[_0xc624('0x27')]()[_0xc624('0x26')](function(){var _0x1f3ca1=_0x2ab7a1[_0xc624('0x28')]({'plain':!![]});var _0x3ed4dd=_0xc624('0x29');return db[_0xc624('0x2a')][_0xc624('0x27')]({'where':{'type':_0x3ed4dd,'resourceId':_0x1f3ca1['id']}})[_0xc624('0x26')](function(){return _0x2ab7a1;});})['then'](function(){_0x4b1812[_0xc624('0x1c')](0xcc)[_0xc624('0x1d')]();});}};}function handleEntityNotFound(_0x281eb5,_0x19e607){return function(_0x5f558b){if(!_0x5f558b){_0x281eb5['sendStatus'](0x194);}return _0x5f558b;};}function handleError(_0x4da11b,_0x52b55c){_0x52b55c=_0x52b55c||0x1f4;return function(_0x362ad7){logger['error'](_0x362ad7[_0xc624('0x2b')]);if(_0x362ad7[_0xc624('0x2c')]){delete _0x362ad7[_0xc624('0x2c')];}_0x4da11b['status'](_0x52b55c)[_0xc624('0x2d')](_0x362ad7);};}exports[_0xc624('0x2e')]=function(_0x1c7b36,_0x3b8eb7){var _0x4482af={},_0x5cfecb={},_0x50448b={'count':0x0,'rows':[]};var _0x4d4a6e=_[_0xc624('0x2f')](db[_0xc624('0x30')][_0xc624('0x31')],function(_0x4052a8){return{'name':_0x4052a8[_0xc624('0x32')],'type':_0x4052a8[_0xc624('0x33')][_0xc624('0x34')]};});_0x5cfecb['model']=_[_0xc624('0x2f')](_0x4d4a6e,_0xc624('0x2c'));_0x5cfecb[_0xc624('0x35')]=_[_0xc624('0x36')](_0x1c7b36[_0xc624('0x35')]);_0x5cfecb[_0xc624('0x37')]=_[_0xc624('0x38')](_0x5cfecb[_0xc624('0x39')],_0x5cfecb[_0xc624('0x35')]);_0x4482af['attributes']=_['intersection'](_0x5cfecb[_0xc624('0x39')],qs[_0xc624('0x3a')](_0x1c7b36[_0xc624('0x35')][_0xc624('0x3a')]));_0x4482af[_0xc624('0x3b')]=_0x4482af[_0xc624('0x3b')][_0xc624('0x3c')]?_0x4482af[_0xc624('0x3b')]:_0x5cfecb[_0xc624('0x39')];if(!_0x1c7b36[_0xc624('0x35')][_0xc624('0x3d')]('nolimit')){_0x4482af[_0xc624('0x20')]=qs['limit'](_0x1c7b36['query'][_0xc624('0x20')]);_0x4482af[_0xc624('0x3e')]=qs[_0xc624('0x3e')](_0x1c7b36['query']['offset']);}_0x4482af[_0xc624('0x3f')]=qs[_0xc624('0x40')](_0x1c7b36[_0xc624('0x35')]['sort']);_0x4482af['where']=qs[_0xc624('0x37')](_['pick'](_0x1c7b36[_0xc624('0x35')],_0x5cfecb[_0xc624('0x37')]),_0x4d4a6e);if(_0x1c7b36['query'][_0xc624('0x41')]){_0x4482af['where']=_['merge'](_0x4482af[_0xc624('0x42')],{'$or':_[_0xc624('0x2f')](_0x4d4a6e,function(_0x24b206){if(_0x24b206[_0xc624('0x33')]!==_0xc624('0x43')){var _0x4a8d42={};_0x4a8d42[_0x24b206[_0xc624('0x2c')]]={'$like':'%'+_0x1c7b36[_0xc624('0x35')][_0xc624('0x41')]+'%'};return _0x4a8d42;}})});}_0x4482af=_[_0xc624('0x44')]({},_0x4482af,_0x1c7b36[_0xc624('0x45')]);var _0x28e7fc={'where':_0x4482af[_0xc624('0x42')]};return db[_0xc624('0x30')][_0xc624('0x1f')](_0x28e7fc)[_0xc624('0x26')](function(_0x4dd658){_0x50448b[_0xc624('0x1f')]=_0x4dd658;if(_0x1c7b36[_0xc624('0x35')][_0xc624('0x46')]){_0x4482af[_0xc624('0x47')]=[{'all':!![]}];}return db[_0xc624('0x30')][_0xc624('0x48')](_0x4482af);})[_0xc624('0x26')](function(_0x29a75a){_0x50448b[_0xc624('0x49')]=_0x29a75a;return _0x50448b;})[_0xc624('0x26')](respondWithFilteredResult(_0x3b8eb7,_0x4482af))[_0xc624('0x4a')](handleError(_0x3b8eb7,null));};exports['show']=function(_0x79ae9d,_0x4abdaf){var _0x4eb12c={'raw':![],'where':{'id':_0x79ae9d[_0xc624('0x4b')]['id']}},_0x111369={};_0x111369['model']=_[_0xc624('0x36')](db[_0xc624('0x30')][_0xc624('0x31')]);_0x111369['query']=_[_0xc624('0x36')](_0x79ae9d[_0xc624('0x35')]);_0x111369['filters']=_['intersection'](_0x111369[_0xc624('0x39')],_0x111369['query']);_0x4eb12c['attributes']=_[_0xc624('0x38')](_0x111369[_0xc624('0x39')],qs[_0xc624('0x3a')](_0x79ae9d[_0xc624('0x35')][_0xc624('0x3a')]));_0x4eb12c[_0xc624('0x3b')]=_0x4eb12c[_0xc624('0x3b')][_0xc624('0x3c')]?_0x4eb12c[_0xc624('0x3b')]:_0x111369[_0xc624('0x39')];if(_0x79ae9d[_0xc624('0x35')][_0xc624('0x46')]){_0x4eb12c[_0xc624('0x47')]=[{'all':!![]}];}_0x4eb12c=_[_0xc624('0x44')]({},_0x4eb12c,_0x79ae9d[_0xc624('0x45')]);return db['Team']['find'](_0x4eb12c)['then'](handleEntityNotFound(_0x4abdaf,null))['then'](respondWithResult(_0x4abdaf,null))[_0xc624('0x4a')](handleError(_0x4abdaf,null));};exports[_0xc624('0x4c')]=function(_0x8e062b,_0x1d3b6d){return db[_0xc624('0x30')][_0xc624('0x4c')](_0x8e062b['body'],{})[_0xc624('0x26')](function(_0x1c3a74){var _0x4ddccc=_0x8e062b['user']['get']({'plain':!![]});if(!_0x4ddccc)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4ddccc[_0xc624('0x4d')]===_0xc624('0x4e')){var _0x13fee1=_0x1c3a74['get']({'plain':!![]});var _0x5d102e='Teams';return db['UserProfileSection'][_0xc624('0x4f')]({'where':{'name':_0x5d102e,'userProfileId':_0x4ddccc['userProfileId']},'raw':!![]})[_0xc624('0x26')](function(_0xa84c6a){if(_0xa84c6a&&_0xa84c6a[_0xc624('0x50')]===0x0){return db[_0xc624('0x2a')][_0xc624('0x4c')]({'name':_0x13fee1[_0xc624('0x2c')],'resourceId':_0x13fee1['id'],'type':_0xa84c6a['name'],'sectionId':_0xa84c6a['id']},{})['then'](function(){return _0x1c3a74;});}else{return _0x1c3a74;}})[_0xc624('0x4a')](function(_0x29f5af){logger[_0xc624('0x51')](_0xc624('0x52'),_0x29f5af);throw _0x29f5af;});}return _0x1c3a74;})['then'](respondWithResult(_0x1d3b6d,0xc9))[_0xc624('0x4a')](handleError(_0x1d3b6d,null));};exports[_0xc624('0x25')]=function(_0x3fa310,_0x25964f){if(_0x3fa310[_0xc624('0x53')]['id']){delete _0x3fa310['body']['id'];}return db[_0xc624('0x30')][_0xc624('0x4f')]({'where':{'id':_0x3fa310[_0xc624('0x4b')]['id']}})[_0xc624('0x26')](handleEntityNotFound(_0x25964f,null))[_0xc624('0x26')](saveUpdates(_0x3fa310['body'],null))[_0xc624('0x26')](respondWithResult(_0x25964f,null))['catch'](handleError(_0x25964f,null));};exports['destroy']=function(_0x17508c,_0x30bf90){return db[_0xc624('0x30')][_0xc624('0x4f')]({'where':{'id':_0x17508c[_0xc624('0x4b')]['id']}})['then'](handleEntityNotFound(_0x30bf90,null))[_0xc624('0x26')](removeEntity(_0x30bf90,null))[_0xc624('0x4a')](handleError(_0x30bf90,null));};exports[_0xc624('0x54')]=function(_0x3e9bbc,_0x16a961,_0x1759f3){return db[_0xc624('0x30')][_0xc624('0x55')]({'where':{'id':_0x3e9bbc['params']['id']}})[_0xc624('0x26')](handleEntityNotFound(_0x16a961,null))[_0xc624('0x26')](function(_0xc043c1){if(!_0x3e9bbc[_0xc624('0x35')][_0xc624('0x56')]||!utils[_0xc624('0x57')](_0x3e9bbc[_0xc624('0x35')][_0xc624('0x56')])){throw new db[(_0xc624('0x58'))][(_0xc624('0x59'))]('Unknown\x20channel');}var _0x256e8e={};var _0x4ddc75={};_0x4ddc75['model']=_[_0xc624('0x36')](db[_[_0xc624('0x5a')](_0x3e9bbc[_0xc624('0x35')][_0xc624('0x56')]['toLowerCase']())+_0xc624('0x5b')]['rawAttributes']);_0x4ddc75['query']=_[_0xc624('0x36')](_0x3e9bbc[_0xc624('0x35')]);_0x4ddc75['filters']=_[_0xc624('0x38')](_0x4ddc75[_0xc624('0x39')],_0x4ddc75[_0xc624('0x35')]);_0x256e8e[_0xc624('0x3b')]=_[_0xc624('0x38')](_0x4ddc75[_0xc624('0x39')],qs[_0xc624('0x3a')](_0x3e9bbc[_0xc624('0x35')][_0xc624('0x3a')]));_0x256e8e[_0xc624('0x3b')]=_0x256e8e[_0xc624('0x3b')][_0xc624('0x3c')]?_0x256e8e[_0xc624('0x3b')]:_0x4ddc75[_0xc624('0x39')];_0x256e8e[_0xc624('0x20')]=qs['limit'](_0x3e9bbc['query'][_0xc624('0x20')]);_0x256e8e['offset']=qs[_0xc624('0x3e')](_0x3e9bbc[_0xc624('0x35')][_0xc624('0x3e')]);_0x256e8e[_0xc624('0x3f')]=qs[_0xc624('0x40')](_0x3e9bbc[_0xc624('0x35')][_0xc624('0x40')]);_0x256e8e[_0xc624('0x42')]=qs[_0xc624('0x37')](_['pick'](_0x3e9bbc[_0xc624('0x35')],_0x4ddc75['filters']));_0x256e8e=_[_0xc624('0x44')]({},_0x256e8e,_0x3e9bbc[_0xc624('0x45')]);return _0xc043c1['get'+_['capitalize'](_0x3e9bbc[_0xc624('0x35')][_0xc624('0x56')][_0xc624('0x5c')]())+_0xc624('0x5d')](_0x256e8e);})[_0xc624('0x26')](respondWithResult(_0x16a961,null))[_0xc624('0x4a')](handleError(_0x16a961,null));};exports[_0xc624('0x5e')]=function(_0xfb4b80,_0x2c9cc7,_0x203c43){return db[_0xc624('0x30')]['findOne']({'where':{'id':_0xfb4b80[_0xc624('0x4b')]['id']}})['then'](function(_0x373e4b){if(_0x373e4b){if(!_0xfb4b80[_0xc624('0x53')][_0xc624('0x56')]||!utils[_0xc624('0x57')](_0xfb4b80[_0xc624('0x53')]['channel'])){throw new db[(_0xc624('0x58'))][(_0xc624('0x59'))](_0xc624('0x5f'));}return _0x373e4b[_0xc624('0x60')+_['capitalize'](_0xfb4b80[_0xc624('0x53')][_0xc624('0x56')][_0xc624('0x5c')]())+'Queues'](_0xfb4b80['body'][_0xc624('0x61')]);}return null;})[_0xc624('0x26')](handleEntityNotFound(_0x2c9cc7,null))[_0xc624('0x26')](respondWithStatusCode(_0x2c9cc7,null))['catch'](handleError(_0x2c9cc7,null));};exports[_0xc624('0x62')]=function(_0x41fd1f,_0x530de1,_0x2be649){return db['Team']['findOne']({'where':{'id':_0x41fd1f[_0xc624('0x4b')]['id']}})[_0xc624('0x26')](function(_0x4ecb50){if(_0x4ecb50){if(!_0x41fd1f[_0xc624('0x35')][_0xc624('0x56')]||!utils['isValidChannel'](_0x41fd1f[_0xc624('0x35')][_0xc624('0x56')])){throw new db[(_0xc624('0x58'))]['ValidationError'](_0xc624('0x5f'));}return _0x4ecb50[_0xc624('0x63')+_[_0xc624('0x5a')](_0x41fd1f[_0xc624('0x35')][_0xc624('0x56')][_0xc624('0x5c')]())+_0xc624('0x5d')](_0x41fd1f[_0xc624('0x35')]['ids']);}return null;})['then'](handleEntityNotFound(_0x530de1,null))[_0xc624('0x26')](respondWithStatusCode(_0x530de1,null))[_0xc624('0x4a')](handleError(_0x530de1,null));};exports[_0xc624('0x64')]=function(_0x2707db,_0x4aca9c,_0x2cadb1){return db[_0xc624('0x30')]['find']({'where':{'id':_0x2707db['params']['id']}})['then'](handleEntityNotFound(_0x4aca9c,null))['then'](function(_0x376e40){if(_0x376e40){var _0x1c9f6a=[_0xc624('0x65'),_0xc624('0x66'),_0xc624('0x67'),_0xc624('0x68'),'Fax',_0xc624('0x69'),'Whatsapp'];return BPromise[_0xc624('0x6a')](_0x1c9f6a,function(_0x47b982){return _0x376e40['get'+_0x47b982+_0xc624('0x5d')]({'attributes':['id',_0xc624('0x2c')]})['then'](function(_0x3c0b81){return BPromise[_0xc624('0x6a')](_0x3c0b81,function(_0x345e52){return _0x345e52['addAgents'](_0x2707db['body'][_0xc624('0x61')])['then'](function(){if(_0x47b982==='Voice'){return db[_0xc624('0x6b')]['findAll']({'where':{'id':_0x2707db['body'][_0xc624('0x61')]},'attributes':['id',_0xc624('0x2c'),_0xc624('0x6c'),_0xc624('0x6d'),_0xc624('0x6e')],'raw':!![]})[_0xc624('0x26')](function(_0x3612bd){return BPromise[_0xc624('0x6a')](_[_0xc624('0x41')](_0x3612bd,{'online':0x1}),function(_0x1cd405){return db[_0xc624('0x6f')][_0xc624('0x70')]({'membername':_0x1cd405[_0xc624('0x2c')],'UserId':_0x1cd405['id'],'queue_name':_0x345e52['name'],'VoiceQueueId':_0x345e52['id'],'interface':_[_0xc624('0x71')](_0x1cd405[_0xc624('0x6e')])?util[_0xc624('0x72')](_0xc624('0x73'),_0x1cd405[_0xc624('0x2c')]):_0x1cd405[_0xc624('0x6e')],'paused':_0x1cd405[_0xc624('0x6d')]||![],'penalty':0x0});});});}});});})[_0xc624('0x26')](function(){return _0x376e40;});})[_0xc624('0x26')](function(){return _0x376e40;});}})[_0xc624('0x26')](function(_0x4d06b4){if(_0x4d06b4){return _0x4d06b4[_0xc624('0x64')](_0x2707db[_0xc624('0x53')][_0xc624('0x61')],_['omit'](_0x2707db['body'],[_0xc624('0x61'),'id'])||{})[_0xc624('0x74')](function(_0x276d4d){for(var _0xedbcd4=0x0;_0xedbcd4<_0x2707db['body']['ids'][_0xc624('0x3c')];_0xedbcd4+=0x1){socket['emit'](_0xc624('0x75'),{'UserId':_0x2707db['body']['ids'][_0xedbcd4],'TeamId':_0x2707db[_0xc624('0x4b')]['id']});}return _0x276d4d;});}})[_0xc624('0x26')](respondWithResult(_0x4aca9c,null))[_0xc624('0x4a')](handleError(_0x4aca9c,null));};exports[_0xc624('0x76')]=function(_0x2521a4,_0x270e20,_0x194ed0){return db[_0xc624('0x30')]['find']({'where':{'id':_0x2521a4['params']['id']}})[_0xc624('0x26')](handleEntityNotFound(_0x270e20,null))['then'](function(_0x3c3a4f){if(_0x3c3a4f){return BPromise[_0xc624('0x6a')]([_0xc624('0x77'),_0xc624('0x78'),_0xc624('0x79'),'sms',_0xc624('0x7a'),_0xc624('0x7b'),_0xc624('0x7c')],function(_0x576685){return _0x3c3a4f[_0xc624('0x28')+_['capitalize'](_0x576685)+_0xc624('0x5d')]({'attributes':['id',_0xc624('0x2c')]})['then'](function(_0x44cd30){return BPromise['each'](_0x44cd30,function(_0xa9544b){return _0xa9544b[_0xc624('0x76')](_0x2521a4[_0xc624('0x35')]['ids'])[_0xc624('0x26')](function(){if(_0x576685===_0xc624('0x77')){return db[_0xc624('0x6f')]['destroy']({'where':{'VoiceQueueId':_0xa9544b['id'],'UserId':_0x2521a4[_0xc624('0x35')]['ids']}});}});});})[_0xc624('0x26')](function(){return _0x3c3a4f;});})[_0xc624('0x26')](function(){return _0x3c3a4f;});}})[_0xc624('0x26')](function(_0x2c0fd4){if(_0x2c0fd4){return _0x2c0fd4[_0xc624('0x76')](_0x2521a4[_0xc624('0x35')][_0xc624('0x61')])[_0xc624('0x26')](function(){if(_['isArray'](_0x2521a4[_0xc624('0x35')]['ids'])){for(var _0xdcfec2=0x0;_0xdcfec2<_0x2521a4['query'][_0xc624('0x61')][_0xc624('0x3c')];_0xdcfec2+=0x1){socket[_0xc624('0x7d')]('userTeam:remove',{'UserId':Number(_0x2521a4[_0xc624('0x35')]['ids'][_0xdcfec2]),'TeamId':Number(_0x2521a4[_0xc624('0x4b')]['id'])});}}else{socket[_0xc624('0x7d')](_0xc624('0x7e'),{'UserId':Number(_0x2521a4[_0xc624('0x35')][_0xc624('0x61')]),'TeamId':Number(_0x2521a4[_0xc624('0x4b')]['id'])});}});}})[_0xc624('0x26')](respondWithStatusCode(_0x270e20,null))[_0xc624('0x4a')](handleError(_0x270e20,null));};exports[_0xc624('0x7f')]=function(_0x1215e2,_0x5929dc,_0x2f375d){var _0x3e8866={};var _0x39a3ac={};var _0x57b37d;var _0x2dd509;return db[_0xc624('0x30')]['findOne']({'where':{'id':_0x1215e2['params']['id']}})[_0xc624('0x26')](handleEntityNotFound(_0x5929dc,null))['then'](function(_0x4629f0){if(_0x4629f0){_0x57b37d=_0x4629f0;_0x39a3ac[_0xc624('0x39')]=_[_0xc624('0x36')](db[_0xc624('0x6b')][_0xc624('0x31')]);_0x39a3ac[_0xc624('0x35')]=_[_0xc624('0x36')](_0x1215e2['query']);_0x39a3ac[_0xc624('0x37')]=_[_0xc624('0x38')](_0x39a3ac[_0xc624('0x39')],_0x39a3ac[_0xc624('0x35')]);_0x3e8866[_0xc624('0x3b')]=_[_0xc624('0x38')](_0x39a3ac['model'],qs['fields'](_0x1215e2[_0xc624('0x35')]['fields']));_0x3e8866[_0xc624('0x3b')]=_0x3e8866['attributes'][_0xc624('0x3c')]?_0x3e8866[_0xc624('0x3b')]:_0x39a3ac[_0xc624('0x39')];_0x3e8866[_0xc624('0x3f')]=qs[_0xc624('0x40')](_0x1215e2[_0xc624('0x35')][_0xc624('0x40')]);_0x3e8866['where']=qs['filters'](_[_0xc624('0x80')](_0x1215e2[_0xc624('0x35')],_0x39a3ac[_0xc624('0x37')]));if(_0x1215e2[_0xc624('0x35')][_0xc624('0x41')]){_0x3e8866[_0xc624('0x42')]=_['merge'](_0x3e8866[_0xc624('0x42')],{'$or':_[_0xc624('0x2f')](_0x3e8866[_0xc624('0x3b')],function(_0x2b972b){var _0x49ea30={};_0x49ea30[_0x2b972b]={'$like':'%'+_0x1215e2[_0xc624('0x35')][_0xc624('0x41')]+'%'};return _0x49ea30;})});}_0x3e8866=_[_0xc624('0x44')]({},_0x3e8866,_0x1215e2[_0xc624('0x45')]);return _0x57b37d['getAgents'](_0x3e8866);}})['then'](function(_0x518a05){if(_0x518a05){_0x2dd509=_0x518a05[_0xc624('0x3c')];if(!_0x1215e2[_0xc624('0x35')][_0xc624('0x3d')](_0xc624('0x81'))){_0x3e8866[_0xc624('0x20')]=qs['limit'](_0x1215e2[_0xc624('0x35')]['limit']);_0x3e8866[_0xc624('0x3e')]=qs[_0xc624('0x3e')](_0x1215e2['query'][_0xc624('0x3e')]);}return _0x57b37d[_0xc624('0x7f')](_0x3e8866);}})[_0xc624('0x26')](function(_0x526762){if(_0x526762){return _0x526762?{'count':_0x2dd509,'rows':_0x526762}:null;}})[_0xc624('0x26')](respondWithResult(_0x5929dc,null))['catch'](handleError(_0x5929dc,null));};
\ No newline at end of file
diff --git a/server/api/team/team.events.js b/server/api/team/team.events.js
index 2c1bdf3..5b6a417 100644
--- a/server/api/team/team.events.js
+++ b/server/api/team/team.events.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xff51=['remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','Team','update'];(function(_0x51737e,_0x311916){var _0x2b249b=function(_0x32234e){while(--_0x32234e){_0x51737e['push'](_0x51737e['shift']());}};_0x2b249b(++_0x311916);}(_0xff51,0x1ac));var _0x1ff5=function(_0x4d579b,_0x2327f3){_0x4d579b=_0x4d579b-0x0;var _0x288145=_0xff51[_0x4d579b];return _0x288145;};'use strict';var EventEmitter=require(_0x1ff5('0x0'));var Team=require(_0x1ff5('0x1'))['db'][_0x1ff5('0x2')];var TeamEvents=new EventEmitter();TeamEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x1ff5('0x3'),'afterDestroy':_0x1ff5('0x4')};function emitEvent(_0x221f0d){return function(_0x47bee5,_0x31f550,_0x353957){TeamEvents[_0x1ff5('0x5')](_0x221f0d+':'+_0x47bee5['id'],_0x47bee5);TeamEvents[_0x1ff5('0x5')](_0x221f0d,_0x47bee5);_0x353957(null);};}for(var e in events){if(events[_0x1ff5('0x6')](e)){var event=events[e];Team[_0x1ff5('0x7')](e,emitEvent(event));}}module[_0x1ff5('0x8')]=TeamEvents;
\ No newline at end of file
+var _0xc2e8=['exports','../../mysqldb','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x2fd56e,_0x168395){var _0x8562e8=function(_0x2aa0e8){while(--_0x2aa0e8){_0x2fd56e['push'](_0x2fd56e['shift']());}};_0x8562e8(++_0x168395);}(_0xc2e8,0xbe));var _0x8c2e=function(_0x11fc8d,_0x4ff7df){_0x11fc8d=_0x11fc8d-0x0;var _0x332ef3=_0xc2e8[_0x11fc8d];return _0x332ef3;};'use strict';var EventEmitter=require('events');var Team=require(_0x8c2e('0x0'))['db']['Team'];var TeamEvents=new EventEmitter();TeamEvents[_0x8c2e('0x1')](0x0);var events={'afterCreate':_0x8c2e('0x2'),'afterUpdate':_0x8c2e('0x3'),'afterDestroy':_0x8c2e('0x4')};function emitEvent(_0x2c176c){return function(_0x4de53f,_0x24742f,_0x1c3675){TeamEvents[_0x8c2e('0x5')](_0x2c176c+':'+_0x4de53f['id'],_0x4de53f);TeamEvents[_0x8c2e('0x5')](_0x2c176c,_0x4de53f);_0x1c3675(null);};}for(var e in events){if(events[_0x8c2e('0x6')](e)){var event=events[e];Team[_0x8c2e('0x7')](e,emitEvent(event));}}module[_0x8c2e('0x8')]=TeamEvents;
\ No newline at end of file
diff --git a/server/api/team/team.model.js b/server/api/team/team.model.js
index e70ec36..456130b 100644
--- a/server/api/team/team.model.js
+++ b/server/api/team/team.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xd80f=['rimraf','../../config/environment','exports','define','Team','teams','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x423f2b,_0x5972c9){var _0x4ee4a3=function(_0x32fcf2){while(--_0x32fcf2){_0x423f2b['push'](_0x423f2b['shift']());}};_0x4ee4a3(++_0x5972c9);}(_0xd80f,0x18e));var _0xfd80=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd80f[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xfd80('0x0'));var util=require(_0xfd80('0x1'));var logger=require(_0xfd80('0x2'))(_0xfd80('0x3'));var moment=require(_0xfd80('0x4'));var BPromise=require(_0xfd80('0x5'));var rp=require(_0xfd80('0x6'));var fs=require('fs');var path=require(_0xfd80('0x7'));var rimraf=require(_0xfd80('0x8'));var config=require(_0xfd80('0x9'));var attributes=require('./team.attributes');module[_0xfd80('0xa')]=function(_0xc5ef3b,_0x5b0488){return _0xc5ef3b[_0xfd80('0xb')](_0xfd80('0xc'),attributes,{'tableName':_0xfd80('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xb52d=['Team','teams','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./team.attributes','exports','define'];(function(_0x5899f1,_0x4a9e9c){var _0x488171=function(_0x148d7f){while(--_0x148d7f){_0x5899f1['push'](_0x5899f1['shift']());}};_0x488171(++_0x4a9e9c);}(_0xb52d,0x9e));var _0xdb52=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xb52d[_0x501510];return _0x1e6ee5;};'use strict';var _=require('lodash');var util=require(_0xdb52('0x0'));var logger=require(_0xdb52('0x1'))(_0xdb52('0x2'));var moment=require(_0xdb52('0x3'));var BPromise=require(_0xdb52('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xdb52('0x5'));var rimraf=require(_0xdb52('0x6'));var config=require(_0xdb52('0x7'));var attributes=require(_0xdb52('0x8'));module[_0xdb52('0x9')]=function(_0x17a0d8,_0x3c55b4){return _0x17a0d8[_0xdb52('0xa')](_0xdb52('0xb'),attributes,{'tableName':_0xdb52('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/team/team.rpc.js b/server/api/team/team.rpc.js
index 6ffc118..7b371b2 100644
--- a/server/api/team/team.rpc.js
+++ b/server/api/team/team.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xe618=['lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','defaults','localhost','socket.io-emitter','redis','./team.socket','register','request','then','Team,\x20%s,\x20%s','request\x20sent','debug','Team,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch'];(function(_0x178895,_0x8e0000){var _0x14573e=function(_0x50f158){while(--_0x50f158){_0x178895['push'](_0x178895['shift']());}};_0x14573e(++_0x8e0000);}(_0xe618,0x17a));var _0x8e61=function(_0x3a2bc6,_0xb3d543){_0x3a2bc6=_0x3a2bc6-0x0;var _0x2781d8=_0xe618[_0x3a2bc6];return _0x2781d8;};'use strict';var _=require(_0x8e61('0x0'));var util=require('util');var moment=require(_0x8e61('0x1'));var BPromise=require(_0x8e61('0x2'));var rs=require(_0x8e61('0x3'));var fs=require('fs');var Redis=require(_0x8e61('0x4'));var db=require(_0x8e61('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x8e61('0x6'))('rpc');var config=require(_0x8e61('0x7'));var jayson=require(_0x8e61('0x8'));var client=jayson[_0x8e61('0x9')]['http']({'port':0x232a});config['redis']=_[_0x8e61('0xa')](config['redis'],{'host':_0x8e61('0xb'),'port':0x18eb});var socket=require(_0x8e61('0xc'))(new Redis(config[_0x8e61('0xd')]));require(_0x8e61('0xe'))[_0x8e61('0xf')](socket);function respondWithRpcPromise(_0x36fc01,_0x504df6,_0x28650c){return new BPromise(function(_0x1e5267,_0x2b7bce){return client[_0x8e61('0x10')](_0x36fc01,_0x28650c)[_0x8e61('0x11')](function(_0x5220ad){logger['info'](_0x8e61('0x12'),_0x504df6,_0x8e61('0x13'));logger[_0x8e61('0x14')](_0x8e61('0x15'),_0x504df6,_0x8e61('0x13'),JSON[_0x8e61('0x16')](_0x5220ad));if(_0x5220ad[_0x8e61('0x17')]){if(_0x5220ad[_0x8e61('0x17')]['code']===0x1f4){logger[_0x8e61('0x17')](_0x8e61('0x12'),_0x504df6,_0x5220ad[_0x8e61('0x17')][_0x8e61('0x18')]);return _0x2b7bce(_0x5220ad[_0x8e61('0x17')][_0x8e61('0x18')]);}logger[_0x8e61('0x17')](_0x8e61('0x12'),_0x504df6,_0x5220ad[_0x8e61('0x17')][_0x8e61('0x18')]);return _0x1e5267(_0x5220ad[_0x8e61('0x17')][_0x8e61('0x18')]);}else{logger['info']('Team,\x20%s,\x20%s',_0x504df6,_0x8e61('0x13'));_0x1e5267(_0x5220ad[_0x8e61('0x19')][_0x8e61('0x18')]);}})[_0x8e61('0x1a')](function(_0x4ab08d){logger[_0x8e61('0x17')](_0x8e61('0x12'),_0x504df6,_0x4ab08d);_0x2b7bce(_0x4ab08d);});});}
\ No newline at end of file
+var _0x298c=['lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','http','defaults','redis','localhost','socket.io-emitter','./team.socket','register','request','Team,\x20%s,\x20%s','request\x20sent','debug','Team,\x20%s,\x20%s,\x20%s','error','message','info'];(function(_0x267680,_0x361bb6){var _0x48c39b=function(_0x159350){while(--_0x159350){_0x267680['push'](_0x267680['shift']());}};_0x48c39b(++_0x361bb6);}(_0x298c,0x1e0));var _0xc298=function(_0x39a34b,_0x3f9ece){_0x39a34b=_0x39a34b-0x0;var _0x1d810f=_0x298c[_0x39a34b];return _0x1d810f;};'use strict';var _=require(_0xc298('0x0'));var util=require(_0xc298('0x1'));var moment=require(_0xc298('0x2'));var BPromise=require(_0xc298('0x3'));var rs=require(_0xc298('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc298('0x5'))['db'];var utils=require(_0xc298('0x6'));var logger=require(_0xc298('0x7'))('rpc');var config=require(_0xc298('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0xc298('0x9')]({'port':0x232a});config['redis']=_[_0xc298('0xa')](config[_0xc298('0xb')],{'host':_0xc298('0xc'),'port':0x18eb});var socket=require(_0xc298('0xd'))(new Redis(config['redis']));require(_0xc298('0xe'))[_0xc298('0xf')](socket);function respondWithRpcPromise(_0x35f4e6,_0x27117e,_0x453dae){return new BPromise(function(_0x5d2a2c,_0x57331e){return client[_0xc298('0x10')](_0x35f4e6,_0x453dae)['then'](function(_0x3c97a0){logger['info'](_0xc298('0x11'),_0x27117e,_0xc298('0x12'));logger[_0xc298('0x13')](_0xc298('0x14'),_0x27117e,_0xc298('0x12'),JSON['stringify'](_0x3c97a0));if(_0x3c97a0[_0xc298('0x15')]){if(_0x3c97a0['error']['code']===0x1f4){logger[_0xc298('0x15')](_0xc298('0x11'),_0x27117e,_0x3c97a0[_0xc298('0x15')]['message']);return _0x57331e(_0x3c97a0[_0xc298('0x15')][_0xc298('0x16')]);}logger[_0xc298('0x15')](_0xc298('0x11'),_0x27117e,_0x3c97a0[_0xc298('0x15')]['message']);return _0x5d2a2c(_0x3c97a0[_0xc298('0x15')]['message']);}else{logger[_0xc298('0x17')]('Team,\x20%s,\x20%s',_0x27117e,_0xc298('0x12'));_0x5d2a2c(_0x3c97a0['result'][_0xc298('0x16')]);}})['catch'](function(_0x71bd23){logger[_0xc298('0x15')](_0xc298('0x11'),_0x27117e,_0x71bd23);_0x57331e(_0x71bd23);});});}
\ No newline at end of file
diff --git a/server/api/team/team.socket.js b/server/api/team/team.socket.js
index fe8d270..326499b 100644
--- a/server/api/team/team.socket.js
+++ b/server/api/team/team.socket.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xefce=['removeListener','register','team:','save','emit'];(function(_0x26ef8e,_0x4de112){var _0x1a2add=function(_0x5378b0){while(--_0x5378b0){_0x26ef8e['push'](_0x26ef8e['shift']());}};_0x1a2add(++_0x4de112);}(_0xefce,0x1e8));var _0xeefc=function(_0x3ee55a,_0x19aeea){_0x3ee55a=_0x3ee55a-0x0;var _0x581800=_0xefce[_0x3ee55a];return _0x581800;};'use strict';var TeamEvents=require('./team.events');var events=[_0xeefc('0x0'),'remove','update'];function createListener(_0x44f0fd,_0x374916){return function(_0x243bdc){_0x374916[_0xeefc('0x1')](_0x44f0fd,_0x243bdc);};}function removeListener(_0x1cb1a5,_0x145a9b){return function(){TeamEvents[_0xeefc('0x2')](_0x1cb1a5,_0x145a9b);};}exports[_0xeefc('0x3')]=function(_0x41ba7c){for(var _0x181dd7=0x0,_0x5a2635=events['length'];_0x181dd7<_0x5a2635;_0x181dd7++){var _0x377309=events[_0x181dd7];var _0xfb5a39=createListener(_0xeefc('0x4')+_0x377309,_0x41ba7c);TeamEvents['on'](_0x377309,_0xfb5a39);}};
\ No newline at end of file
+var _0x59ac=['removeListener','register','length','./team.events','save','remove','update','emit'];(function(_0x4e1d03,_0x786f3a){var _0x362d4b=function(_0x1924d2){while(--_0x1924d2){_0x4e1d03['push'](_0x4e1d03['shift']());}};_0x362d4b(++_0x786f3a);}(_0x59ac,0x73));var _0xc59a=function(_0x499ba1,_0x4d11a9){_0x499ba1=_0x499ba1-0x0;var _0xbf1cd7=_0x59ac[_0x499ba1];return _0xbf1cd7;};'use strict';var TeamEvents=require(_0xc59a('0x0'));var events=[_0xc59a('0x1'),_0xc59a('0x2'),_0xc59a('0x3')];function createListener(_0x385d68,_0x49cc75){return function(_0x43df94){_0x49cc75[_0xc59a('0x4')](_0x385d68,_0x43df94);};}function removeListener(_0x4dfceb,_0x3b7b43){return function(){TeamEvents[_0xc59a('0x5')](_0x4dfceb,_0x3b7b43);};}exports[_0xc59a('0x6')]=function(_0x25cd8e){for(var _0x204832=0x0,_0x5286c6=events[_0xc59a('0x7')];_0x204832<_0x5286c6;_0x204832++){var _0x576a51=events[_0x204832];var _0x12806d=createListener('team:'+_0x576a51,_0x25cd8e);TeamEvents['on'](_0x576a51,_0x12806d);}};
\ No newline at end of file
diff --git a/server/api/template/index.js b/server/api/template/index.js
index 850feef..0ec1f94 100644
--- a/server/api/template/index.js
+++ b/server/api/template/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x15d5=['../../components/auth/service','../../components/interaction/service','../../config/environment','./template.controller','get','isAuthenticated','/:id','show','post','create','update','delete','destroy','exports','multer','util','path'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x15d5,0x85));var _0x515d=function(_0x1d71a0,_0x7d60a3){_0x1d71a0=_0x1d71a0-0x0;var _0x3b2297=_0x15d5[_0x1d71a0];return _0x3b2297;};'use strict';var multer=require(_0x515d('0x0'));var util=require(_0x515d('0x1'));var path=require(_0x515d('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var auth=require(_0x515d('0x3'));var interaction=require(_0x515d('0x4'));var config=require(_0x515d('0x5'));var controller=require(_0x515d('0x6'));router[_0x515d('0x7')]('/',auth[_0x515d('0x8')](),controller['index']);router[_0x515d('0x7')](_0x515d('0x9'),auth['isAuthenticated'](),controller[_0x515d('0xa')]);router[_0x515d('0xb')]('/',auth[_0x515d('0x8')](),controller[_0x515d('0xc')]);router['put'](_0x515d('0x9'),auth[_0x515d('0x8')](),controller[_0x515d('0xd')]);router[_0x515d('0xe')]('/:id',auth[_0x515d('0x8')](),controller[_0x515d('0xf')]);module[_0x515d('0x10')]=router;
\ No newline at end of file
+var _0x9639=['express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./template.controller','get','isAuthenticated','index','/:id','show','post','create','destroy','exports','multer','connect-timeout'];(function(_0x62c958,_0x2bfdbc){var _0x57ec61=function(_0x5c0094){while(--_0x5c0094){_0x62c958['push'](_0x62c958['shift']());}};_0x57ec61(++_0x2bfdbc);}(_0x9639,0x1da));var _0x9963=function(_0x5898c5,_0x55d1a9){_0x5898c5=_0x5898c5-0x0;var _0x551d7b=_0x9639[_0x5898c5];return _0x551d7b;};'use strict';var multer=require(_0x9963('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x9963('0x1'));var express=require(_0x9963('0x2'));var router=express[_0x9963('0x3')]();var auth=require(_0x9963('0x4'));var interaction=require(_0x9963('0x5'));var config=require(_0x9963('0x6'));var controller=require(_0x9963('0x7'));router[_0x9963('0x8')]('/',auth[_0x9963('0x9')](),controller[_0x9963('0xa')]);router[_0x9963('0x8')](_0x9963('0xb'),auth[_0x9963('0x9')](),controller[_0x9963('0xc')]);router[_0x9963('0xd')]('/',auth[_0x9963('0x9')](),controller[_0x9963('0xe')]);router['put']('/:id',auth[_0x9963('0x9')](),controller['update']);router['delete'](_0x9963('0xb'),auth[_0x9963('0x9')](),controller[_0x9963('0xf')]);module[_0x9963('0x10')]=router;
\ No newline at end of file
diff --git a/server/api/template/template.attributes.js b/server/api/template/template.attributes.js
index e42b314..cfaa629 100644
--- a/server/api/template/template.attributes.js
+++ b/server/api/template/template.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x2504=['STRING','TEXT','exports'];(function(_0x5c6b8b,_0x442952){var _0xdd7e46=function(_0x143157){while(--_0x143157){_0x5c6b8b['push'](_0x5c6b8b['shift']());}};_0xdd7e46(++_0x442952);}(_0x2504,0x1f1));var _0x4250=function(_0x3df3ac,_0x1d2b7d){_0x3df3ac=_0x3df3ac-0x0;var _0x454a5a=_0x2504[_0x3df3ac];return _0x454a5a;};'use strict';var Sequelize=require('sequelize');module[_0x4250('0x0')]={'name':{'type':Sequelize[_0x4250('0x1')]},'description':{'type':Sequelize[_0x4250('0x1')]},'html':{'type':Sequelize[_0x4250('0x2')]}};
\ No newline at end of file
+var _0x4dd2=['STRING','exports'];(function(_0x4f61a1,_0x35820b){var _0xae8b64=function(_0x4f784c){while(--_0x4f784c){_0x4f61a1['push'](_0x4f61a1['shift']());}};_0xae8b64(++_0x35820b);}(_0x4dd2,0xf1));var _0x24dd=function(_0x597484,_0x199340){_0x597484=_0x597484-0x0;var _0x218e64=_0x4dd2[_0x597484];return _0x218e64;};'use strict';var Sequelize=require('sequelize');module[_0x24dd('0x0')]={'name':{'type':Sequelize[_0x24dd('0x1')]},'description':{'type':Sequelize[_0x24dd('0x1')]},'html':{'type':Sequelize['TEXT']}};
\ No newline at end of file
diff --git a/server/api/template/template.controller.js b/server/api/template/template.controller.js
index 51d7039..0f52cf6 100644
--- a/server/api/template/template.controller.js
+++ b/server/api/template/template.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x6af3=['type','model','map','query','keys','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filters','pick','filter','VIRTUAL','merge','options','count','includeAll','include','findAll','rows','catch','params','find','create','body','user','UserProfileSection','userProfileId','autoAssociation','error','html-pdf','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','sendStatus','status','end','json','offset','limit','Content-Range','save','then','destroy','get','Templates','UserProfileResource','stack','name','index','Template','rawAttributes'];(function(_0x530be0,_0x1a84c8){var _0x2ee1d3=function(_0x47ebe3){while(--_0x47ebe3){_0x530be0['push'](_0x530be0['shift']());}};_0x2ee1d3(++_0x1a84c8);}(_0x6af3,0x10f));var _0x36af=function(_0x51f01b,_0x28552f){_0x51f01b=_0x51f01b-0x0;var _0x494902=_0x6af3[_0x51f01b];return _0x494902;};'use strict';var pdf=require(_0x36af('0x0'));var emlformat=require(_0x36af('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x36af('0x2'));var jsonpatch=require(_0x36af('0x3'));var rp=require('request-promise');var moment=require(_0x36af('0x4'));var BPromise=require(_0x36af('0x5'));var Mustache=require(_0x36af('0x6'));var util=require(_0x36af('0x7'));var path=require(_0x36af('0x8'));var sox=require(_0x36af('0x9'));var csv=require(_0x36af('0xa'));var ejs=require(_0x36af('0xb'));var fs=require('fs');var _=require(_0x36af('0xc'));var squel=require(_0x36af('0xd'));var crypto=require(_0x36af('0xe'));var jsforce=require(_0x36af('0xf'));var deskjs=require(_0x36af('0x10'));var toCsv=require(_0x36af('0xa'));var querystring=require(_0x36af('0x11'));var Papa=require(_0x36af('0x12'));var Redis=require(_0x36af('0x13'));var authService=require(_0x36af('0x14'));var qs=require(_0x36af('0x15'));var as=require(_0x36af('0x16'));var hardwareService=require(_0x36af('0x17'));var logger=require(_0x36af('0x18'))(_0x36af('0x19'));var utils=require(_0x36af('0x1a'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2b2422,_0x5c6c5b){_0x5c6c5b=_0x5c6c5b||0xcc;return function(_0x4aa399){if(_0x4aa399){return _0x2b2422[_0x36af('0x1b')](_0x5c6c5b);}return _0x2b2422[_0x36af('0x1c')](_0x5c6c5b)[_0x36af('0x1d')]();};}function respondWithResult(_0x4c2b62,_0x2a52cc){_0x2a52cc=_0x2a52cc||0xc8;return function(_0x1fdf84){if(_0x1fdf84){return _0x4c2b62['status'](_0x2a52cc)[_0x36af('0x1e')](_0x1fdf84);}};}function respondWithFilteredResult(_0x5a229f,_0x571a04){return function(_0x592d5d){if(_0x592d5d){var _0x145ef2=_0x592d5d['count'],_0x49fc30=_0x571a04['offset'],_0x31c8b6=_0x571a04[_0x36af('0x1f')]+_0x571a04[_0x36af('0x20')],_0x291756;if(_0x31c8b6>=_0x145ef2){_0x31c8b6=_0x145ef2;_0x291756=0xc8;}else{_0x291756=0xce;}_0x5a229f[_0x36af('0x1c')](_0x291756);return _0x5a229f['set'](_0x36af('0x21'),_0x49fc30+'-'+_0x31c8b6+'/'+_0x145ef2)[_0x36af('0x1e')](_0x592d5d);}return null;};}function patchUpdates(_0x59f3a4){return function(_0x52f507){try{jsonpatch['apply'](_0x52f507,_0x59f3a4,!![]);}catch(_0x309a03){return BPromise['reject'](_0x309a03);}return _0x52f507[_0x36af('0x22')]();};}function saveUpdates(_0xfb7915,_0xe54963){return function(_0x272f27){if(_0x272f27){return _0x272f27['update'](_0xfb7915)[_0x36af('0x23')](function(_0x545aa1){return _0x545aa1;});}return null;};}function removeEntity(_0x555db8,_0x3d93a7){return function(_0x5af2ac){if(_0x5af2ac){return _0x5af2ac[_0x36af('0x24')]()[_0x36af('0x23')](function(){var _0x24b145=_0x5af2ac[_0x36af('0x25')]({'plain':!![]});var _0x164a19=_0x36af('0x26');return db[_0x36af('0x27')][_0x36af('0x24')]({'where':{'type':_0x164a19,'resourceId':_0x24b145['id']}})[_0x36af('0x23')](function(){return _0x5af2ac;});})['then'](function(){_0x555db8[_0x36af('0x1c')](0xcc)[_0x36af('0x1d')]();});}};}function handleEntityNotFound(_0x102b28,_0x2189c6){return function(_0x68062a){if(!_0x68062a){_0x102b28[_0x36af('0x1b')](0x194);}return _0x68062a;};}function handleError(_0x23fc52,_0x387fad){_0x387fad=_0x387fad||0x1f4;return function(_0x85175b){logger['error'](_0x85175b[_0x36af('0x28')]);if(_0x85175b[_0x36af('0x29')]){delete _0x85175b[_0x36af('0x29')];}_0x23fc52['status'](_0x387fad)['send'](_0x85175b);};}exports[_0x36af('0x2a')]=function(_0x2cae08,_0xb8e43a){var _0x55e802={},_0x6c8795={},_0x1918cb={'count':0x0,'rows':[]};var _0x221d54=_['map'](db[_0x36af('0x2b')][_0x36af('0x2c')],function(_0x9d594f){return{'name':_0x9d594f['fieldName'],'type':_0x9d594f[_0x36af('0x2d')]['key']};});_0x6c8795[_0x36af('0x2e')]=_[_0x36af('0x2f')](_0x221d54,_0x36af('0x29'));_0x6c8795[_0x36af('0x30')]=_[_0x36af('0x31')](_0x2cae08['query']);_0x6c8795['filters']=_[_0x36af('0x32')](_0x6c8795['model'],_0x6c8795['query']);_0x55e802[_0x36af('0x33')]=_['intersection'](_0x6c8795['model'],qs[_0x36af('0x34')](_0x2cae08[_0x36af('0x30')][_0x36af('0x34')]));_0x55e802[_0x36af('0x33')]=_0x55e802[_0x36af('0x33')][_0x36af('0x35')]?_0x55e802['attributes']:_0x6c8795[_0x36af('0x2e')];if(!_0x2cae08['query'][_0x36af('0x36')]('nolimit')){_0x55e802[_0x36af('0x20')]=qs[_0x36af('0x20')](_0x2cae08[_0x36af('0x30')][_0x36af('0x20')]);_0x55e802['offset']=qs[_0x36af('0x1f')](_0x2cae08['query'][_0x36af('0x1f')]);}_0x55e802[_0x36af('0x37')]=qs[_0x36af('0x38')](_0x2cae08[_0x36af('0x30')]['sort']);_0x55e802[_0x36af('0x39')]=qs[_0x36af('0x3a')](_[_0x36af('0x3b')](_0x2cae08[_0x36af('0x30')],_0x6c8795['filters']),_0x221d54);if(_0x2cae08['query'][_0x36af('0x3c')]){_0x55e802['where']=_['merge'](_0x55e802['where'],{'$or':_['map'](_0x221d54,function(_0x155b3e){if(_0x155b3e['type']!==_0x36af('0x3d')){var _0x70b44a={};_0x70b44a[_0x155b3e[_0x36af('0x29')]]={'$like':'%'+_0x2cae08[_0x36af('0x30')][_0x36af('0x3c')]+'%'};return _0x70b44a;}})});}_0x55e802=_[_0x36af('0x3e')]({},_0x55e802,_0x2cae08[_0x36af('0x3f')]);var _0x51b031={'where':_0x55e802[_0x36af('0x39')]};return db[_0x36af('0x2b')][_0x36af('0x40')](_0x51b031)[_0x36af('0x23')](function(_0x3b80a0){_0x1918cb[_0x36af('0x40')]=_0x3b80a0;if(_0x2cae08[_0x36af('0x30')][_0x36af('0x41')]){_0x55e802[_0x36af('0x42')]=[{'all':!![]}];}return db[_0x36af('0x2b')][_0x36af('0x43')](_0x55e802);})['then'](function(_0x4d1c09){_0x1918cb[_0x36af('0x44')]=_0x4d1c09;return _0x1918cb;})[_0x36af('0x23')](respondWithFilteredResult(_0xb8e43a,_0x55e802))[_0x36af('0x45')](handleError(_0xb8e43a,null));};exports['show']=function(_0x3aee8d,_0x591aeb){var _0x2cc765={'raw':!![],'where':{'id':_0x3aee8d[_0x36af('0x46')]['id']}},_0x2caff6={};_0x2caff6[_0x36af('0x2e')]=_[_0x36af('0x31')](db[_0x36af('0x2b')]['rawAttributes']);_0x2caff6[_0x36af('0x30')]=_[_0x36af('0x31')](_0x3aee8d[_0x36af('0x30')]);_0x2caff6[_0x36af('0x3a')]=_[_0x36af('0x32')](_0x2caff6[_0x36af('0x2e')],_0x2caff6[_0x36af('0x30')]);_0x2cc765['attributes']=_[_0x36af('0x32')](_0x2caff6[_0x36af('0x2e')],qs[_0x36af('0x34')](_0x3aee8d[_0x36af('0x30')][_0x36af('0x34')]));_0x2cc765[_0x36af('0x33')]=_0x2cc765['attributes'][_0x36af('0x35')]?_0x2cc765[_0x36af('0x33')]:_0x2caff6[_0x36af('0x2e')];if(_0x3aee8d[_0x36af('0x30')]['includeAll']){_0x2cc765[_0x36af('0x42')]=[{'all':!![]}];}_0x2cc765=_['merge']({},_0x2cc765,_0x3aee8d[_0x36af('0x3f')]);return db[_0x36af('0x2b')][_0x36af('0x47')](_0x2cc765)[_0x36af('0x23')](handleEntityNotFound(_0x591aeb,null))[_0x36af('0x23')](respondWithResult(_0x591aeb,null))[_0x36af('0x45')](handleError(_0x591aeb,null));};exports['create']=function(_0x415858,_0x222644){return db[_0x36af('0x2b')][_0x36af('0x48')](_0x415858[_0x36af('0x49')],{})[_0x36af('0x23')](function(_0x37ee6a){var _0x448a9e=_0x415858[_0x36af('0x4a')][_0x36af('0x25')]({'plain':!![]});if(!_0x448a9e)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x448a9e['role']===_0x36af('0x4a')){var _0x3b2339=_0x37ee6a['get']({'plain':!![]});var _0x12be86='Templates';return db[_0x36af('0x4b')]['find']({'where':{'name':_0x12be86,'userProfileId':_0x448a9e[_0x36af('0x4c')]},'raw':!![]})[_0x36af('0x23')](function(_0x169178){if(_0x169178&&_0x169178[_0x36af('0x4d')]===0x0){return db[_0x36af('0x27')][_0x36af('0x48')]({'name':_0x3b2339[_0x36af('0x29')],'resourceId':_0x3b2339['id'],'type':_0x169178[_0x36af('0x29')],'sectionId':_0x169178['id']},{})[_0x36af('0x23')](function(){return _0x37ee6a;});}else{return _0x37ee6a;}})[_0x36af('0x45')](function(_0xb337be){logger[_0x36af('0x4e')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xb337be);throw _0xb337be;});}return _0x37ee6a;})['then'](respondWithResult(_0x222644,0xc9))[_0x36af('0x45')](handleError(_0x222644,null));};exports['update']=function(_0x497723,_0x3b997b){if(_0x497723[_0x36af('0x49')]['id']){delete _0x497723['body']['id'];}return db[_0x36af('0x2b')][_0x36af('0x47')]({'where':{'id':_0x497723['params']['id']}})[_0x36af('0x23')](handleEntityNotFound(_0x3b997b,null))[_0x36af('0x23')](saveUpdates(_0x497723['body'],null))[_0x36af('0x23')](respondWithResult(_0x3b997b,null))['catch'](handleError(_0x3b997b,null));};exports[_0x36af('0x24')]=function(_0x164c89,_0x1e6a87){return db[_0x36af('0x2b')]['find']({'where':{'id':_0x164c89[_0x36af('0x46')]['id']}})[_0x36af('0x23')](handleEntityNotFound(_0x1e6a87,null))[_0x36af('0x23')](removeEntity(_0x1e6a87,null))[_0x36af('0x45')](handleError(_0x1e6a87,null));};
\ No newline at end of file
+var _0x63a5=['querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','json','count','offset','limit','set','Content-Range','apply','reject','update','destroy','then','get','Templates','UserProfileResource','end','sendStatus','error','stack','name','index','map','Template','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','show','rawAttributes','find','create','body','user','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','crypto','desk.js'];(function(_0x3740fe,_0x6c543c){var _0x55492b=function(_0x1f851f){while(--_0x1f851f){_0x3740fe['push'](_0x3740fe['shift']());}};_0x55492b(++_0x6c543c);}(_0x63a5,0x1d7));var _0x563a=function(_0x176329,_0x568c84){_0x176329=_0x176329-0x0;var _0x31997c=_0x63a5[_0x176329];return _0x31997c;};'use strict';var pdf=require(_0x563a('0x0'));var emlformat=require(_0x563a('0x1'));var rimraf=require(_0x563a('0x2'));var zipdir=require(_0x563a('0x3'));var jsonpatch=require(_0x563a('0x4'));var rp=require(_0x563a('0x5'));var moment=require(_0x563a('0x6'));var BPromise=require(_0x563a('0x7'));var Mustache=require(_0x563a('0x8'));var util=require(_0x563a('0x9'));var path=require(_0x563a('0xa'));var sox=require('sox');var csv=require(_0x563a('0xb'));var ejs=require(_0x563a('0xc'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x563a('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x563a('0xe'));var toCsv=require(_0x563a('0xb'));var querystring=require(_0x563a('0xf'));var Papa=require(_0x563a('0x10'));var Redis=require(_0x563a('0x11'));var authService=require(_0x563a('0x12'));var qs=require(_0x563a('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x563a('0x14'));var logger=require(_0x563a('0x15'))(_0x563a('0x16'));var utils=require(_0x563a('0x17'));var config=require(_0x563a('0x18'));var db=require(_0x563a('0x19'))['db'];function respondWithStatusCode(_0x38d7cb,_0xac9945){_0xac9945=_0xac9945||0xcc;return function(_0x18309f){if(_0x18309f){return _0x38d7cb['sendStatus'](_0xac9945);}return _0x38d7cb[_0x563a('0x1a')](_0xac9945)['end']();};}function respondWithResult(_0x1e9239,_0x1ece65){_0x1ece65=_0x1ece65||0xc8;return function(_0x54bbde){if(_0x54bbde){return _0x1e9239['status'](_0x1ece65)[_0x563a('0x1b')](_0x54bbde);}};}function respondWithFilteredResult(_0x54b77d,_0x59a862){return function(_0x5b2ff3){if(_0x5b2ff3){var _0x2b54e4=_0x5b2ff3[_0x563a('0x1c')],_0x3ed436=_0x59a862[_0x563a('0x1d')],_0x5ab01a=_0x59a862[_0x563a('0x1d')]+_0x59a862[_0x563a('0x1e')],_0x3a6a45;if(_0x5ab01a>=_0x2b54e4){_0x5ab01a=_0x2b54e4;_0x3a6a45=0xc8;}else{_0x3a6a45=0xce;}_0x54b77d[_0x563a('0x1a')](_0x3a6a45);return _0x54b77d[_0x563a('0x1f')](_0x563a('0x20'),_0x3ed436+'-'+_0x5ab01a+'/'+_0x2b54e4)[_0x563a('0x1b')](_0x5b2ff3);}return null;};}function patchUpdates(_0x195f5d){return function(_0x3dab49){try{jsonpatch[_0x563a('0x21')](_0x3dab49,_0x195f5d,!![]);}catch(_0x3d8e32){return BPromise[_0x563a('0x22')](_0x3d8e32);}return _0x3dab49['save']();};}function saveUpdates(_0x304883,_0x1021b3){return function(_0x46f4f0){if(_0x46f4f0){return _0x46f4f0[_0x563a('0x23')](_0x304883)['then'](function(_0x5132fd){return _0x5132fd;});}return null;};}function removeEntity(_0x4e7384,_0x2190d1){return function(_0x26ea16){if(_0x26ea16){return _0x26ea16[_0x563a('0x24')]()[_0x563a('0x25')](function(){var _0x4c32d9=_0x26ea16[_0x563a('0x26')]({'plain':!![]});var _0x3b2320=_0x563a('0x27');return db[_0x563a('0x28')]['destroy']({'where':{'type':_0x3b2320,'resourceId':_0x4c32d9['id']}})[_0x563a('0x25')](function(){return _0x26ea16;});})['then'](function(){_0x4e7384[_0x563a('0x1a')](0xcc)[_0x563a('0x29')]();});}};}function handleEntityNotFound(_0x3aa1d5,_0x20fb3a){return function(_0x5d8f8d){if(!_0x5d8f8d){_0x3aa1d5[_0x563a('0x2a')](0x194);}return _0x5d8f8d;};}function handleError(_0x1a6e01,_0x13c718){_0x13c718=_0x13c718||0x1f4;return function(_0x30a980){logger[_0x563a('0x2b')](_0x30a980[_0x563a('0x2c')]);if(_0x30a980[_0x563a('0x2d')]){delete _0x30a980[_0x563a('0x2d')];}_0x1a6e01[_0x563a('0x1a')](_0x13c718)['send'](_0x30a980);};}exports[_0x563a('0x2e')]=function(_0x484417,_0x2c96d9){var _0x54c1b7={},_0x3ee2e1={},_0x39bb6e={'count':0x0,'rows':[]};var _0x44198f=_[_0x563a('0x2f')](db[_0x563a('0x30')]['rawAttributes'],function(_0x154998){return{'name':_0x154998['fieldName'],'type':_0x154998[_0x563a('0x31')][_0x563a('0x32')]};});_0x3ee2e1[_0x563a('0x33')]=_[_0x563a('0x2f')](_0x44198f,_0x563a('0x2d'));_0x3ee2e1[_0x563a('0x34')]=_[_0x563a('0x35')](_0x484417[_0x563a('0x34')]);_0x3ee2e1[_0x563a('0x36')]=_[_0x563a('0x37')](_0x3ee2e1[_0x563a('0x33')],_0x3ee2e1[_0x563a('0x34')]);_0x54c1b7[_0x563a('0x38')]=_[_0x563a('0x37')](_0x3ee2e1[_0x563a('0x33')],qs[_0x563a('0x39')](_0x484417['query'][_0x563a('0x39')]));_0x54c1b7['attributes']=_0x54c1b7[_0x563a('0x38')][_0x563a('0x3a')]?_0x54c1b7[_0x563a('0x38')]:_0x3ee2e1['model'];if(!_0x484417['query']['hasOwnProperty'](_0x563a('0x3b'))){_0x54c1b7[_0x563a('0x1e')]=qs[_0x563a('0x1e')](_0x484417[_0x563a('0x34')][_0x563a('0x1e')]);_0x54c1b7[_0x563a('0x1d')]=qs[_0x563a('0x1d')](_0x484417[_0x563a('0x34')][_0x563a('0x1d')]);}_0x54c1b7[_0x563a('0x3c')]=qs[_0x563a('0x3d')](_0x484417[_0x563a('0x34')][_0x563a('0x3d')]);_0x54c1b7[_0x563a('0x3e')]=qs[_0x563a('0x36')](_['pick'](_0x484417[_0x563a('0x34')],_0x3ee2e1[_0x563a('0x36')]),_0x44198f);if(_0x484417['query'][_0x563a('0x3f')]){_0x54c1b7['where']=_[_0x563a('0x40')](_0x54c1b7[_0x563a('0x3e')],{'$or':_[_0x563a('0x2f')](_0x44198f,function(_0x4101f5){if(_0x4101f5[_0x563a('0x31')]!==_0x563a('0x41')){var _0x3e0b67={};_0x3e0b67[_0x4101f5[_0x563a('0x2d')]]={'$like':'%'+_0x484417[_0x563a('0x34')][_0x563a('0x3f')]+'%'};return _0x3e0b67;}})});}_0x54c1b7=_['merge']({},_0x54c1b7,_0x484417[_0x563a('0x42')]);var _0x2d6978={'where':_0x54c1b7['where']};return db[_0x563a('0x30')][_0x563a('0x1c')](_0x2d6978)[_0x563a('0x25')](function(_0x111e16){_0x39bb6e['count']=_0x111e16;if(_0x484417[_0x563a('0x34')][_0x563a('0x43')]){_0x54c1b7[_0x563a('0x44')]=[{'all':!![]}];}return db[_0x563a('0x30')]['findAll'](_0x54c1b7);})['then'](function(_0x3e1b60){_0x39bb6e[_0x563a('0x45')]=_0x3e1b60;return _0x39bb6e;})[_0x563a('0x25')](respondWithFilteredResult(_0x2c96d9,_0x54c1b7))[_0x563a('0x46')](handleError(_0x2c96d9,null));};exports[_0x563a('0x47')]=function(_0x5a1c8e,_0x33b430){var _0xbb9c7a={'raw':!![],'where':{'id':_0x5a1c8e['params']['id']}},_0x5a38a8={};_0x5a38a8[_0x563a('0x33')]=_[_0x563a('0x35')](db[_0x563a('0x30')][_0x563a('0x48')]);_0x5a38a8[_0x563a('0x34')]=_[_0x563a('0x35')](_0x5a1c8e['query']);_0x5a38a8[_0x563a('0x36')]=_[_0x563a('0x37')](_0x5a38a8[_0x563a('0x33')],_0x5a38a8[_0x563a('0x34')]);_0xbb9c7a[_0x563a('0x38')]=_[_0x563a('0x37')](_0x5a38a8[_0x563a('0x33')],qs[_0x563a('0x39')](_0x5a1c8e[_0x563a('0x34')][_0x563a('0x39')]));_0xbb9c7a[_0x563a('0x38')]=_0xbb9c7a[_0x563a('0x38')][_0x563a('0x3a')]?_0xbb9c7a[_0x563a('0x38')]:_0x5a38a8['model'];if(_0x5a1c8e['query'][_0x563a('0x43')]){_0xbb9c7a[_0x563a('0x44')]=[{'all':!![]}];}_0xbb9c7a=_[_0x563a('0x40')]({},_0xbb9c7a,_0x5a1c8e[_0x563a('0x42')]);return db[_0x563a('0x30')][_0x563a('0x49')](_0xbb9c7a)[_0x563a('0x25')](handleEntityNotFound(_0x33b430,null))[_0x563a('0x25')](respondWithResult(_0x33b430,null))['catch'](handleError(_0x33b430,null));};exports['create']=function(_0x5e3b79,_0xfba3a2){return db['Template'][_0x563a('0x4a')](_0x5e3b79[_0x563a('0x4b')],{})['then'](function(_0x5989a4){var _0x1a2e3e=_0x5e3b79[_0x563a('0x4c')][_0x563a('0x26')]({'plain':!![]});if(!_0x1a2e3e)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1a2e3e['role']===_0x563a('0x4c')){var _0x6bc690=_0x5989a4['get']({'plain':!![]});var _0x5d46e9=_0x563a('0x27');return db['UserProfileSection']['find']({'where':{'name':_0x5d46e9,'userProfileId':_0x1a2e3e[_0x563a('0x4d')]},'raw':!![]})['then'](function(_0x4897d3){if(_0x4897d3&&_0x4897d3[_0x563a('0x4e')]===0x0){return db[_0x563a('0x28')]['create']({'name':_0x6bc690['name'],'resourceId':_0x6bc690['id'],'type':_0x4897d3[_0x563a('0x2d')],'sectionId':_0x4897d3['id']},{})[_0x563a('0x25')](function(){return _0x5989a4;});}else{return _0x5989a4;}})['catch'](function(_0x16d23d){logger['error'](_0x563a('0x4f'),_0x16d23d);throw _0x16d23d;});}return _0x5989a4;})[_0x563a('0x25')](respondWithResult(_0xfba3a2,0xc9))[_0x563a('0x46')](handleError(_0xfba3a2,null));};exports[_0x563a('0x23')]=function(_0x320a78,_0x3929a8){if(_0x320a78[_0x563a('0x4b')]['id']){delete _0x320a78[_0x563a('0x4b')]['id'];}return db[_0x563a('0x30')][_0x563a('0x49')]({'where':{'id':_0x320a78['params']['id']}})[_0x563a('0x25')](handleEntityNotFound(_0x3929a8,null))[_0x563a('0x25')](saveUpdates(_0x320a78[_0x563a('0x4b')],null))[_0x563a('0x25')](respondWithResult(_0x3929a8,null))[_0x563a('0x46')](handleError(_0x3929a8,null));};exports[_0x563a('0x24')]=function(_0x696888,_0x1396eb){return db[_0x563a('0x30')][_0x563a('0x49')]({'where':{'id':_0x696888[_0x563a('0x50')]['id']}})[_0x563a('0x25')](handleEntityNotFound(_0x1396eb,null))[_0x563a('0x25')](removeEntity(_0x1396eb,null))[_0x563a('0x46')](handleError(_0x1396eb,null));};
\ No newline at end of file
diff --git a/server/api/template/template.model.js b/server/api/template/template.model.js
index c40abd3..659273c 100644
--- a/server/api/template/template.model.js
+++ b/server/api/template/template.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x645b=['tools_templates','lodash','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment','exports','define','Template'];(function(_0x45d55e,_0x2fede3){var _0x29812a=function(_0x3c6830){while(--_0x3c6830){_0x45d55e['push'](_0x45d55e['shift']());}};_0x29812a(++_0x2fede3);}(_0x645b,0x6f));var _0xb645=function(_0xd6d4fd,_0x248cc1){_0xd6d4fd=_0xd6d4fd-0x0;var _0x3eaea3=_0x645b[_0xd6d4fd];return _0x3eaea3;};'use strict';var _=require(_0xb645('0x0'));var util=require('util');var logger=require(_0xb645('0x1'))(_0xb645('0x2'));var moment=require('moment');var BPromise=require(_0xb645('0x3'));var rp=require(_0xb645('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xb645('0x5'));var config=require(_0xb645('0x6'));var attributes=require('./template.attributes');module[_0xb645('0x7')]=function(_0x1bab67,_0x2cde36){return _0x1bab67[_0xb645('0x8')](_0xb645('0x9'),attributes,{'tableName':_0xb645('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x7abe=['exports','define','Template','tools_templates','lodash','util','../../config/logger','bluebird','request-promise','path','./template.attributes'];(function(_0x3e543d,_0x4f3548){var _0x51285c=function(_0x4fa37d){while(--_0x4fa37d){_0x3e543d['push'](_0x3e543d['shift']());}};_0x51285c(++_0x4f3548);}(_0x7abe,0x117));var _0xe7ab=function(_0xecc781,_0x272faa){_0xecc781=_0xecc781-0x0;var _0x5344d6=_0x7abe[_0xecc781];return _0x5344d6;};'use strict';var _=require(_0xe7ab('0x0'));var util=require(_0xe7ab('0x1'));var logger=require(_0xe7ab('0x2'))('api');var moment=require('moment');var BPromise=require(_0xe7ab('0x3'));var rp=require(_0xe7ab('0x4'));var fs=require('fs');var path=require(_0xe7ab('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xe7ab('0x6'));module[_0xe7ab('0x7')]=function(_0x264fa1,_0x132497){return _0x264fa1[_0xe7ab('0x8')](_0xe7ab('0x9'),attributes,{'tableName':_0xe7ab('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/template/template.rpc.js b/server/api/template/template.rpc.js
index 6d5f62c..c9afdcb 100644
--- a/server/api/template/template.rpc.js
+++ b/server/api/template/template.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x769f=['info','Template,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','Template,\x20%s,\x20%s','message','result','GetTemplate','Template','findAll','options','raw','where','limit','include','model','attributes','map','then','catch','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request'];(function(_0x204c93,_0x2b756c){var _0x513d8f=function(_0x466c17){while(--_0x466c17){_0x204c93['push'](_0x204c93['shift']());}};_0x513d8f(++_0x2b756c);}(_0x769f,0xdc));var _0xf769=function(_0x5cbc17,_0x32d3ab){_0x5cbc17=_0x5cbc17-0x0;var _0x28068b=_0x769f[_0x5cbc17];return _0x28068b;};'use strict';var _=require(_0xf769('0x0'));var util=require(_0xf769('0x1'));var moment=require('moment');var BPromise=require(_0xf769('0x2'));var rs=require(_0xf769('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf769('0x4'))['db'];var utils=require(_0xf769('0x5'));var logger=require(_0xf769('0x6'))('rpc');var config=require(_0xf769('0x7'));var jayson=require(_0xf769('0x8'));var client=jayson[_0xf769('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3d55b4,_0x19f954,_0x2773d0){return new BPromise(function(_0x3972d9,_0x5b65da){return client[_0xf769('0xa')](_0x3d55b4,_0x2773d0)['then'](function(_0x4896ac){logger[_0xf769('0xb')]('Template,\x20%s,\x20%s',_0x19f954,'request\x20sent');logger['debug'](_0xf769('0xc'),_0x19f954,_0xf769('0xd'),JSON[_0xf769('0xe')](_0x4896ac));if(_0x4896ac[_0xf769('0xf')]){if(_0x4896ac[_0xf769('0xf')][_0xf769('0x10')]===0x1f4){logger[_0xf769('0xf')](_0xf769('0x11'),_0x19f954,_0x4896ac['error'][_0xf769('0x12')]);return _0x5b65da(_0x4896ac[_0xf769('0xf')][_0xf769('0x12')]);}logger['error']('Template,\x20%s,\x20%s',_0x19f954,_0x4896ac[_0xf769('0xf')]['message']);return _0x3972d9(_0x4896ac[_0xf769('0xf')][_0xf769('0x12')]);}else{logger[_0xf769('0xb')]('Template,\x20%s,\x20%s',_0x19f954,'request\x20sent');_0x3972d9(_0x4896ac[_0xf769('0x13')]['message']);}})['catch'](function(_0x594776){logger[_0xf769('0xf')]('Template,\x20%s,\x20%s',_0x19f954,_0x594776);_0x5b65da(_0x594776);});});}exports[_0xf769('0x14')]=function(_0x540032){var _0xaa76ef=this;return new Promise(function(_0x2d43a6,_0x5cd4f4){return db[_0xf769('0x15')][_0xf769('0x16')]({'raw':_0x540032[_0xf769('0x17')]?_0x540032[_0xf769('0x17')][_0xf769('0x18')]===undefined?!![]:![]:!![],'where':_0x540032['options']?_0x540032['options'][_0xf769('0x19')]||null:null,'attributes':_0x540032[_0xf769('0x17')]?_0x540032['options']['attributes']||null:null,'limit':_0x540032[_0xf769('0x17')]?_0x540032['options'][_0xf769('0x1a')]||null:null,'include':_0x540032[_0xf769('0x17')]?_0x540032[_0xf769('0x17')]['include']?_['map'](_0x540032[_0xf769('0x17')][_0xf769('0x1b')],function(_0x573764){return{'model':db[_0x573764[_0xf769('0x1c')]],'as':_0x573764['as'],'attributes':_0x573764[_0xf769('0x1d')],'include':_0x573764['include']?_[_0xf769('0x1e')](_0x573764[_0xf769('0x1b')],function(_0x40294d){return{'model':db[_0x40294d[_0xf769('0x1c')]],'as':_0x40294d['as'],'attributes':_0x40294d[_0xf769('0x1d')],'include':_0x40294d[_0xf769('0x1b')]?_['map'](_0x40294d['include'],function(_0x1295ab){return{'model':db[_0x1295ab[_0xf769('0x1c')]],'as':_0x1295ab['as'],'attributes':_0x1295ab[_0xf769('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xf769('0x1f')](function(_0x1c66df){logger[_0xf769('0xb')]('GetTemplate',_0x540032);logger['debug'](_0xf769('0x14'),_0x540032,JSON[_0xf769('0xe')](_0x1c66df));_0x2d43a6(_0x1c66df);})[_0xf769('0x20')](function(_0x2e0877){logger[_0xf769('0xf')](_0xf769('0x14'),_0x2e0877[_0xf769('0x12')],_0x540032);_0x5cd4f4(_0xaa76ef['error'](0x1f4,_0x2e0877[_0xf769('0x12')]));});});};
\ No newline at end of file
+var _0xf040=['ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','then','Template,\x20%s,\x20%s','request\x20sent','debug','Template,\x20%s,\x20%s,\x20%s','error','code','message','info','result','GetTemplate','findAll','options','raw','where','attributes','limit','include','model','map','catch','lodash','util','moment','bluebird','randomstring'];(function(_0x381188,_0x123b84){var _0x53598d=function(_0x59f3c6){while(--_0x59f3c6){_0x381188['push'](_0x381188['shift']());}};_0x53598d(++_0x123b84);}(_0xf040,0x193));var _0x0f04=function(_0x498219,_0x28eb06){_0x498219=_0x498219-0x0;var _0x1e04c6=_0xf040[_0x498219];return _0x1e04c6;};'use strict';var _=require(_0x0f04('0x0'));var util=require(_0x0f04('0x1'));var moment=require(_0x0f04('0x2'));var BPromise=require(_0x0f04('0x3'));var rs=require(_0x0f04('0x4'));var fs=require('fs');var Redis=require(_0x0f04('0x5'));var db=require(_0x0f04('0x6'))['db'];var utils=require(_0x0f04('0x7'));var logger=require(_0x0f04('0x8'))('rpc');var config=require(_0x0f04('0x9'));var jayson=require(_0x0f04('0xa'));var client=jayson[_0x0f04('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x502142,_0x41adda,_0x2754cf){return new BPromise(function(_0x376ec5,_0x500eb4){return client[_0x0f04('0xc')](_0x502142,_0x2754cf)[_0x0f04('0xd')](function(_0x2c7e97){logger['info'](_0x0f04('0xe'),_0x41adda,_0x0f04('0xf'));logger[_0x0f04('0x10')](_0x0f04('0x11'),_0x41adda,_0x0f04('0xf'),JSON['stringify'](_0x2c7e97));if(_0x2c7e97[_0x0f04('0x12')]){if(_0x2c7e97[_0x0f04('0x12')][_0x0f04('0x13')]===0x1f4){logger[_0x0f04('0x12')](_0x0f04('0xe'),_0x41adda,_0x2c7e97[_0x0f04('0x12')][_0x0f04('0x14')]);return _0x500eb4(_0x2c7e97['error']['message']);}logger[_0x0f04('0x12')](_0x0f04('0xe'),_0x41adda,_0x2c7e97['error'][_0x0f04('0x14')]);return _0x376ec5(_0x2c7e97[_0x0f04('0x12')]['message']);}else{logger[_0x0f04('0x15')](_0x0f04('0xe'),_0x41adda,'request\x20sent');_0x376ec5(_0x2c7e97[_0x0f04('0x16')][_0x0f04('0x14')]);}})['catch'](function(_0x43540e){logger[_0x0f04('0x12')]('Template,\x20%s,\x20%s',_0x41adda,_0x43540e);_0x500eb4(_0x43540e);});});}exports[_0x0f04('0x17')]=function(_0x19bd6d){var _0x1e59b1=this;return new Promise(function(_0x27f0c,_0x34e57a){return db['Template'][_0x0f04('0x18')]({'raw':_0x19bd6d[_0x0f04('0x19')]?_0x19bd6d[_0x0f04('0x19')][_0x0f04('0x1a')]===undefined?!![]:![]:!![],'where':_0x19bd6d['options']?_0x19bd6d[_0x0f04('0x19')][_0x0f04('0x1b')]||null:null,'attributes':_0x19bd6d['options']?_0x19bd6d[_0x0f04('0x19')][_0x0f04('0x1c')]||null:null,'limit':_0x19bd6d[_0x0f04('0x19')]?_0x19bd6d['options'][_0x0f04('0x1d')]||null:null,'include':_0x19bd6d[_0x0f04('0x19')]?_0x19bd6d[_0x0f04('0x19')][_0x0f04('0x1e')]?_['map'](_0x19bd6d[_0x0f04('0x19')][_0x0f04('0x1e')],function(_0x389d07){return{'model':db[_0x389d07[_0x0f04('0x1f')]],'as':_0x389d07['as'],'attributes':_0x389d07[_0x0f04('0x1c')],'include':_0x389d07[_0x0f04('0x1e')]?_[_0x0f04('0x20')](_0x389d07['include'],function(_0x17c7fe){return{'model':db[_0x17c7fe[_0x0f04('0x1f')]],'as':_0x17c7fe['as'],'attributes':_0x17c7fe[_0x0f04('0x1c')],'include':_0x17c7fe[_0x0f04('0x1e')]?_['map'](_0x17c7fe[_0x0f04('0x1e')],function(_0x34f06b){return{'model':db[_0x34f06b[_0x0f04('0x1f')]],'as':_0x34f06b['as'],'attributes':_0x34f06b['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x50c030){logger['info'](_0x0f04('0x17'),_0x19bd6d);logger[_0x0f04('0x10')](_0x0f04('0x17'),_0x19bd6d,JSON['stringify'](_0x50c030));_0x27f0c(_0x50c030);})[_0x0f04('0x21')](function(_0x58e4a2){logger['error'](_0x0f04('0x17'),_0x58e4a2[_0x0f04('0x14')],_0x19bd6d);_0x34e57a(_0x1e59b1['error'](0x1f4,_0x58e4a2[_0x0f04('0x14')]));});});};
\ No newline at end of file
diff --git a/server/api/trigger/index.js b/server/api/trigger/index.js
index 2e9bac5..057fb2a 100644
--- a/server/api/trigger/index.js
+++ b/server/api/trigger/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x6d84=['connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./trigger.controller','get','isAuthenticated','index','/:id','show','getAllConditions','/:id/any_conditions','getAnyConditions','/:id/actions','getActions','post','create','/:id/all_conditions','addAllCondition','addAction','put','update','exports','multer','util','path'];(function(_0xdbb6cb,_0x3b8fda){var _0x476b50=function(_0x470ebb){while(--_0x470ebb){_0xdbb6cb['push'](_0xdbb6cb['shift']());}};_0x476b50(++_0x3b8fda);}(_0x6d84,0xf9));var _0x46d8=function(_0x3c7f7d,_0x1ec2fc){_0x3c7f7d=_0x3c7f7d-0x0;var _0x1e044c=_0x6d84[_0x3c7f7d];return _0x1e044c;};'use strict';var multer=require(_0x46d8('0x0'));var util=require(_0x46d8('0x1'));var path=require(_0x46d8('0x2'));var timeout=require(_0x46d8('0x3'));var express=require(_0x46d8('0x4'));var router=express[_0x46d8('0x5')]();var auth=require(_0x46d8('0x6'));var interaction=require(_0x46d8('0x7'));var config=require(_0x46d8('0x8'));var controller=require(_0x46d8('0x9'));router[_0x46d8('0xa')]('/',auth[_0x46d8('0xb')](),controller[_0x46d8('0xc')]);router[_0x46d8('0xa')](_0x46d8('0xd'),auth[_0x46d8('0xb')](),controller[_0x46d8('0xe')]);router[_0x46d8('0xa')]('/:id/all_conditions',auth[_0x46d8('0xb')](),controller[_0x46d8('0xf')]);router[_0x46d8('0xa')](_0x46d8('0x10'),auth['isAuthenticated'](),controller[_0x46d8('0x11')]);router['get'](_0x46d8('0x12'),auth['isAuthenticated'](),controller[_0x46d8('0x13')]);router[_0x46d8('0x14')]('/',auth[_0x46d8('0xb')](),controller[_0x46d8('0x15')]);router[_0x46d8('0x14')](_0x46d8('0x16'),auth[_0x46d8('0xb')](),controller[_0x46d8('0x17')]);router[_0x46d8('0x14')](_0x46d8('0x10'),auth[_0x46d8('0xb')](),controller['addAnyCondition']);router[_0x46d8('0x14')]('/:id/actions',auth[_0x46d8('0xb')](),controller[_0x46d8('0x18')]);router[_0x46d8('0x19')](_0x46d8('0xd'),auth[_0x46d8('0xb')](),controller[_0x46d8('0x1a')]);router['delete'](_0x46d8('0xd'),auth['isAuthenticated'](),controller['destroy']);module[_0x46d8('0x1b')]=router;
\ No newline at end of file
+var _0xad2a=['update','delete','destroy','exports','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./trigger.controller','get','index','/:id','isAuthenticated','show','getAllConditions','/:id/any_conditions','getAnyConditions','/:id/actions','create','post','addAllCondition','put'];(function(_0x1a170a,_0xcc9fca){var _0x413c33=function(_0xbb6447){while(--_0xbb6447){_0x1a170a['push'](_0x1a170a['shift']());}};_0x413c33(++_0xcc9fca);}(_0xad2a,0x149));var _0xaad2=function(_0xb7a89,_0x516a86){_0xb7a89=_0xb7a89-0x0;var _0x2bafc9=_0xad2a[_0xb7a89];return _0x2bafc9;};'use strict';var multer=require('multer');var util=require(_0xaad2('0x0'));var path=require(_0xaad2('0x1'));var timeout=require(_0xaad2('0x2'));var express=require(_0xaad2('0x3'));var router=express['Router']();var auth=require(_0xaad2('0x4'));var interaction=require(_0xaad2('0x5'));var config=require(_0xaad2('0x6'));var controller=require(_0xaad2('0x7'));router[_0xaad2('0x8')]('/',auth['isAuthenticated'](),controller[_0xaad2('0x9')]);router['get'](_0xaad2('0xa'),auth[_0xaad2('0xb')](),controller[_0xaad2('0xc')]);router[_0xaad2('0x8')]('/:id/all_conditions',auth[_0xaad2('0xb')](),controller[_0xaad2('0xd')]);router[_0xaad2('0x8')](_0xaad2('0xe'),auth[_0xaad2('0xb')](),controller[_0xaad2('0xf')]);router[_0xaad2('0x8')](_0xaad2('0x10'),auth[_0xaad2('0xb')](),controller['getActions']);router['post']('/',auth[_0xaad2('0xb')](),controller[_0xaad2('0x11')]);router[_0xaad2('0x12')]('/:id/all_conditions',auth[_0xaad2('0xb')](),controller[_0xaad2('0x13')]);router[_0xaad2('0x12')](_0xaad2('0xe'),auth[_0xaad2('0xb')](),controller['addAnyCondition']);router[_0xaad2('0x12')](_0xaad2('0x10'),auth[_0xaad2('0xb')](),controller['addAction']);router[_0xaad2('0x14')](_0xaad2('0xa'),auth[_0xaad2('0xb')](),controller[_0xaad2('0x15')]);router[_0xaad2('0x16')](_0xaad2('0xa'),auth[_0xaad2('0xb')](),controller[_0xaad2('0x17')]);module[_0xaad2('0x18')]=router;
\ No newline at end of file
diff --git a/server/api/trigger/trigger.attributes.js b/server/api/trigger/trigger.attributes.js
index e06ef7d..050ae5c 100644
--- a/server/api/trigger/trigger.attributes.js
+++ b/server/api/trigger/trigger.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x38de=['exports','STRING','BOOLEAN'];(function(_0x413feb,_0x10477f){var _0x40ee88=function(_0x32a3f6){while(--_0x32a3f6){_0x413feb['push'](_0x413feb['shift']());}};_0x40ee88(++_0x10477f);}(_0x38de,0x19e));var _0xe38d=function(_0x8145e8,_0x346c81){_0x8145e8=_0x8145e8-0x0;var _0x4eb2a6=_0x38de[_0x8145e8];return _0x4eb2a6;};'use strict';var Sequelize=require('sequelize');module[_0xe38d('0x0')]={'name':{'type':Sequelize[_0xe38d('0x1')]},'channel':{'type':Sequelize[_0xe38d('0x1')]},'description':{'type':Sequelize[_0xe38d('0x1')]},'status':{'type':Sequelize[_0xe38d('0x2')],'defaultValue':![]}};
\ No newline at end of file
+var _0x7800=['sequelize','STRING'];(function(_0x248e8c,_0x51b0a4){var _0x594df5=function(_0x591cdd){while(--_0x591cdd){_0x248e8c['push'](_0x248e8c['shift']());}};_0x594df5(++_0x51b0a4);}(_0x7800,0x80));var _0x0780=function(_0x3b24f6,_0x46bce7){_0x3b24f6=_0x3b24f6-0x0;var _0x555a71=_0x7800[_0x3b24f6];return _0x555a71;};'use strict';var Sequelize=require(_0x0780('0x0'));module['exports']={'name':{'type':Sequelize[_0x0780('0x1')]},'channel':{'type':Sequelize[_0x0780('0x1')]},'description':{'type':Sequelize[_0x0780('0x1')]},'status':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}};
\ No newline at end of file
diff --git a/server/api/trigger/trigger.controller.js b/server/api/trigger/trigger.controller.js
index 443c83c..f649810 100644
--- a/server/api/trigger/trigger.controller.js
+++ b/server/api/trigger/trigger.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x91f6=['Action','getActions','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','offset','Content-Range','apply','reject','then','destroy','get','Triggers','sendStatus','error','stack','name','send','index','Trigger','rawAttributes','fieldName','type','key','map','query','keys','intersection','model','fields','attributes','length','nolimit','sort','where','filters','pick','filter','merge','VIRTUAL','options','count','includeAll','rows','catch','params','include','find','create','body','user','role','UserProfileSection','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','addAllCondition','TriggerAllId','Condition','findOne','order','getAllConditions','hasOwnProperty','limit','getAnyConditions','addAction'];(function(_0x12c2d0,_0x34975f){var _0x5d49b8=function(_0x25e795){while(--_0x25e795){_0x12c2d0['push'](_0x12c2d0['shift']());}};_0x5d49b8(++_0x34975f);}(_0x91f6,0x176));var _0x691f=function(_0x499557,_0x574d95){_0x499557=_0x499557-0x0;var _0x19d0c8=_0x91f6[_0x499557];return _0x19d0c8;};'use strict';var pdf=require(_0x691f('0x0'));var emlformat=require(_0x691f('0x1'));var rimraf=require(_0x691f('0x2'));var zipdir=require(_0x691f('0x3'));var jsonpatch=require(_0x691f('0x4'));var rp=require(_0x691f('0x5'));var moment=require(_0x691f('0x6'));var BPromise=require(_0x691f('0x7'));var Mustache=require(_0x691f('0x8'));var util=require('util');var path=require(_0x691f('0x9'));var sox=require(_0x691f('0xa'));var csv=require(_0x691f('0xb'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x691f('0xc'));var squel=require(_0x691f('0xd'));var crypto=require(_0x691f('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x691f('0xf'));var toCsv=require('to-csv');var querystring=require(_0x691f('0x10'));var Papa=require(_0x691f('0x11'));var Redis=require(_0x691f('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x691f('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x691f('0x14'));var logger=require(_0x691f('0x15'))(_0x691f('0x16'));var utils=require(_0x691f('0x17'));var config=require(_0x691f('0x18'));var db=require(_0x691f('0x19'))['db'];function respondWithStatusCode(_0x172f3a,_0x10aea0){_0x10aea0=_0x10aea0||0xcc;return function(_0x409753){if(_0x409753){return _0x172f3a['sendStatus'](_0x10aea0);}return _0x172f3a[_0x691f('0x1a')](_0x10aea0)[_0x691f('0x1b')]();};}function respondWithResult(_0x165de6,_0x30a33b){_0x30a33b=_0x30a33b||0xc8;return function(_0x156208){if(_0x156208){return _0x165de6[_0x691f('0x1a')](_0x30a33b)[_0x691f('0x1c')](_0x156208);}};}function respondWithFilteredResult(_0x4e9be1,_0x11472b){return function(_0x21d1c8){if(_0x21d1c8){var _0x492ce2=_0x21d1c8['count'],_0x29762b=_0x11472b[_0x691f('0x1d')],_0x22ab15=_0x11472b[_0x691f('0x1d')]+_0x11472b['limit'],_0x41690c;if(_0x22ab15>=_0x492ce2){_0x22ab15=_0x492ce2;_0x41690c=0xc8;}else{_0x41690c=0xce;}_0x4e9be1[_0x691f('0x1a')](_0x41690c);return _0x4e9be1['set'](_0x691f('0x1e'),_0x29762b+'-'+_0x22ab15+'/'+_0x492ce2)[_0x691f('0x1c')](_0x21d1c8);}return null;};}function patchUpdates(_0x22437b){return function(_0x1179a4){try{jsonpatch[_0x691f('0x1f')](_0x1179a4,_0x22437b,!![]);}catch(_0x3a94fb){return BPromise[_0x691f('0x20')](_0x3a94fb);}return _0x1179a4['save']();};}function saveUpdates(_0x15101a,_0x1b723d){return function(_0x5c4b2d){if(_0x5c4b2d){return _0x5c4b2d['update'](_0x15101a)[_0x691f('0x21')](function(_0x3b88ff){return _0x3b88ff;});}return null;};}function removeEntity(_0x1fa10e,_0x143dcb){return function(_0x11785d){if(_0x11785d){return _0x11785d[_0x691f('0x22')]()[_0x691f('0x21')](function(){var _0x429955=_0x11785d[_0x691f('0x23')]({'plain':!![]});var _0x37d6e4=_0x691f('0x24');return db['UserProfileResource'][_0x691f('0x22')]({'where':{'type':_0x37d6e4,'resourceId':_0x429955['id']}})[_0x691f('0x21')](function(){return _0x11785d;});})['then'](function(){_0x1fa10e[_0x691f('0x1a')](0xcc)[_0x691f('0x1b')]();});}};}function handleEntityNotFound(_0x39f339,_0x306b1c){return function(_0x2c74ae){if(!_0x2c74ae){_0x39f339[_0x691f('0x25')](0x194);}return _0x2c74ae;};}function handleError(_0x2afd10,_0x18972c){_0x18972c=_0x18972c||0x1f4;return function(_0x4cbedb){logger[_0x691f('0x26')](_0x4cbedb[_0x691f('0x27')]);if(_0x4cbedb[_0x691f('0x28')]){delete _0x4cbedb['name'];}_0x2afd10[_0x691f('0x1a')](_0x18972c)[_0x691f('0x29')](_0x4cbedb);};}exports[_0x691f('0x2a')]=function(_0x5eaf13,_0x59becf){var _0x161e77={},_0x2a96a5={},_0x4bae9e={'count':0x0,'rows':[]};var _0x174b3c=_['map'](db[_0x691f('0x2b')][_0x691f('0x2c')],function(_0x1f9b6b){return{'name':_0x1f9b6b[_0x691f('0x2d')],'type':_0x1f9b6b[_0x691f('0x2e')][_0x691f('0x2f')]};});_0x2a96a5['model']=_[_0x691f('0x30')](_0x174b3c,_0x691f('0x28'));_0x2a96a5[_0x691f('0x31')]=_[_0x691f('0x32')](_0x5eaf13[_0x691f('0x31')]);_0x2a96a5['filters']=_[_0x691f('0x33')](_0x2a96a5[_0x691f('0x34')],_0x2a96a5[_0x691f('0x31')]);_0x161e77['attributes']=_['intersection'](_0x2a96a5['model'],qs[_0x691f('0x35')](_0x5eaf13['query'][_0x691f('0x35')]));_0x161e77[_0x691f('0x36')]=_0x161e77['attributes'][_0x691f('0x37')]?_0x161e77[_0x691f('0x36')]:_0x2a96a5[_0x691f('0x34')];if(!_0x5eaf13[_0x691f('0x31')]['hasOwnProperty'](_0x691f('0x38'))){_0x161e77['limit']=qs['limit'](_0x5eaf13[_0x691f('0x31')]['limit']);_0x161e77[_0x691f('0x1d')]=qs[_0x691f('0x1d')](_0x5eaf13[_0x691f('0x31')][_0x691f('0x1d')]);}_0x161e77['order']=qs['sort'](_0x5eaf13[_0x691f('0x31')][_0x691f('0x39')]);_0x161e77[_0x691f('0x3a')]=qs[_0x691f('0x3b')](_[_0x691f('0x3c')](_0x5eaf13['query'],_0x2a96a5[_0x691f('0x3b')]),_0x174b3c);if(_0x5eaf13[_0x691f('0x31')][_0x691f('0x3d')]){_0x161e77[_0x691f('0x3a')]=_[_0x691f('0x3e')](_0x161e77[_0x691f('0x3a')],{'$or':_['map'](_0x174b3c,function(_0x167f6c){if(_0x167f6c['type']!==_0x691f('0x3f')){var _0x51e1f3={};_0x51e1f3[_0x167f6c['name']]={'$like':'%'+_0x5eaf13[_0x691f('0x31')][_0x691f('0x3d')]+'%'};return _0x51e1f3;}})});}_0x161e77=_[_0x691f('0x3e')]({},_0x161e77,_0x5eaf13[_0x691f('0x40')]);var _0x1edaaf={'where':_0x161e77['where']};return db[_0x691f('0x2b')][_0x691f('0x41')](_0x1edaaf)[_0x691f('0x21')](function(_0x228da0){_0x4bae9e['count']=_0x228da0;if(_0x5eaf13['query'][_0x691f('0x42')]){_0x161e77['include']=[{'all':!![]}];}return db['Trigger']['findAll'](_0x161e77);})[_0x691f('0x21')](function(_0x5d8d36){_0x4bae9e[_0x691f('0x43')]=_0x5d8d36;return _0x4bae9e;})[_0x691f('0x21')](respondWithFilteredResult(_0x59becf,_0x161e77))[_0x691f('0x44')](handleError(_0x59becf,null));};exports['show']=function(_0x57145f,_0x519647){var _0x398fd1={'raw':![],'where':{'id':_0x57145f[_0x691f('0x45')]['id']}},_0x512d67={};_0x512d67[_0x691f('0x34')]=_[_0x691f('0x32')](db[_0x691f('0x2b')][_0x691f('0x2c')]);_0x512d67[_0x691f('0x31')]=_['keys'](_0x57145f['query']);_0x512d67[_0x691f('0x3b')]=_[_0x691f('0x33')](_0x512d67['model'],_0x512d67[_0x691f('0x31')]);_0x398fd1[_0x691f('0x36')]=_['intersection'](_0x512d67[_0x691f('0x34')],qs[_0x691f('0x35')](_0x57145f['query'][_0x691f('0x35')]));_0x398fd1['attributes']=_0x398fd1[_0x691f('0x36')][_0x691f('0x37')]?_0x398fd1[_0x691f('0x36')]:_0x512d67[_0x691f('0x34')];if(_0x57145f[_0x691f('0x31')]['includeAll']){_0x398fd1[_0x691f('0x46')]=[{'all':!![]}];}_0x398fd1=_[_0x691f('0x3e')]({},_0x398fd1,_0x57145f[_0x691f('0x40')]);return db[_0x691f('0x2b')][_0x691f('0x47')](_0x398fd1)['then'](handleEntityNotFound(_0x519647,null))['then'](respondWithResult(_0x519647,null))[_0x691f('0x44')](handleError(_0x519647,null));};exports['create']=function(_0x10036c,_0x3a363d){return db[_0x691f('0x2b')][_0x691f('0x48')](_0x10036c[_0x691f('0x49')],{})[_0x691f('0x21')](function(_0x5fae2f){var _0x1879b5=_0x10036c[_0x691f('0x4a')][_0x691f('0x23')]({'plain':!![]});if(!_0x1879b5)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1879b5[_0x691f('0x4b')]===_0x691f('0x4a')){var _0xe8327a=_0x5fae2f[_0x691f('0x23')]({'plain':!![]});var _0x21f665='Triggers';return db[_0x691f('0x4c')][_0x691f('0x47')]({'where':{'name':_0x21f665,'userProfileId':_0x1879b5[_0x691f('0x4d')]},'raw':!![]})['then'](function(_0x113a5a){if(_0x113a5a&&_0x113a5a['autoAssociation']===0x0){return db[_0x691f('0x4e')][_0x691f('0x48')]({'name':_0xe8327a[_0x691f('0x28')],'resourceId':_0xe8327a['id'],'type':_0x113a5a[_0x691f('0x28')],'sectionId':_0x113a5a['id']},{})[_0x691f('0x21')](function(){return _0x5fae2f;});}else{return _0x5fae2f;}})[_0x691f('0x44')](function(_0x2df6b8){logger[_0x691f('0x26')](_0x691f('0x4f'),_0x2df6b8);throw _0x2df6b8;});}return _0x5fae2f;})[_0x691f('0x21')](respondWithResult(_0x3a363d,0xc9))[_0x691f('0x44')](handleError(_0x3a363d,null));};exports[_0x691f('0x50')]=function(_0x58791b,_0x16adf5){if(_0x58791b[_0x691f('0x49')]['id']){delete _0x58791b[_0x691f('0x49')]['id'];}return db['Trigger'][_0x691f('0x47')]({'where':{'id':_0x58791b[_0x691f('0x45')]['id']}})['then'](handleEntityNotFound(_0x16adf5,null))['then'](saveUpdates(_0x58791b[_0x691f('0x49')],null))['then'](respondWithResult(_0x16adf5,null))['catch'](handleError(_0x16adf5,null));};exports[_0x691f('0x22')]=function(_0x45c29a,_0x4f536a){return db[_0x691f('0x2b')][_0x691f('0x47')]({'where':{'id':_0x45c29a[_0x691f('0x45')]['id']}})['then'](handleEntityNotFound(_0x4f536a,null))['then'](removeEntity(_0x4f536a,null))[_0x691f('0x44')](handleError(_0x4f536a,null));};exports[_0x691f('0x51')]=function(_0x4572a3,_0x50b923,_0x59f9ec){if(_0x4572a3[_0x691f('0x49')]['id']){delete _0x4572a3[_0x691f('0x49')]['id'];}return db[_0x691f('0x2b')]['find']({'where':{'id':_0x4572a3['params']['id']}})['then'](handleEntityNotFound(_0x50b923,null))[_0x691f('0x21')](function(_0x3c36d6){if(_0x3c36d6){_0x4572a3[_0x691f('0x49')][_0x691f('0x52')]=_0x3c36d6['id'];return db[_0x691f('0x53')]['create'](_0x4572a3[_0x691f('0x49')]);}})[_0x691f('0x21')](respondWithResult(_0x50b923,null))['catch'](handleError(_0x50b923,null));};exports['addAnyCondition']=function(_0x411b9c,_0x243120,_0xaa27b8){if(_0x411b9c['body']['id']){delete _0x411b9c[_0x691f('0x49')]['id'];}return db['Trigger'][_0x691f('0x47')]({'where':{'id':_0x411b9c[_0x691f('0x45')]['id']}})['then'](handleEntityNotFound(_0x243120,null))[_0x691f('0x21')](function(_0xd00228){if(_0xd00228){_0x411b9c['body']['TriggerAnyId']=_0xd00228['id'];return db[_0x691f('0x53')]['create'](_0x411b9c[_0x691f('0x49')]);}})[_0x691f('0x21')](respondWithResult(_0x243120,null))['catch'](handleError(_0x243120,null));};exports['getAllConditions']=function(_0x4eaa84,_0x2a6b4a,_0x28afb1){var _0x3196f0={};var _0x8121d={};var _0x2840f5;var _0x5f1455;return db[_0x691f('0x2b')][_0x691f('0x54')]({'where':{'id':_0x4eaa84[_0x691f('0x45')]['id']}})[_0x691f('0x21')](handleEntityNotFound(_0x2a6b4a,null))[_0x691f('0x21')](function(_0x29baa9){if(_0x29baa9){_0x2840f5=_0x29baa9;_0x8121d['model']=_[_0x691f('0x32')](db[_0x691f('0x53')][_0x691f('0x2c')]);_0x8121d[_0x691f('0x31')]=_[_0x691f('0x32')](_0x4eaa84[_0x691f('0x31')]);_0x8121d[_0x691f('0x3b')]=_[_0x691f('0x33')](_0x8121d['model'],_0x8121d['query']);_0x3196f0[_0x691f('0x36')]=_[_0x691f('0x33')](_0x8121d['model'],qs[_0x691f('0x35')](_0x4eaa84['query'][_0x691f('0x35')]));_0x3196f0[_0x691f('0x36')]=_0x3196f0[_0x691f('0x36')][_0x691f('0x37')]?_0x3196f0['attributes']:_0x8121d[_0x691f('0x34')];_0x3196f0[_0x691f('0x55')]=qs[_0x691f('0x39')](_0x4eaa84[_0x691f('0x31')][_0x691f('0x39')]);_0x3196f0[_0x691f('0x3a')]=qs[_0x691f('0x3b')](_['pick'](_0x4eaa84['query'],_0x8121d[_0x691f('0x3b')]));if(_0x4eaa84[_0x691f('0x31')][_0x691f('0x3d')]){_0x3196f0[_0x691f('0x3a')]=_[_0x691f('0x3e')](_0x3196f0[_0x691f('0x3a')],{'$or':_[_0x691f('0x30')](_0x3196f0[_0x691f('0x36')],function(_0x4ff4f8){var _0x4c3fa1={};_0x4c3fa1[_0x4ff4f8]={'$like':'%'+_0x4eaa84[_0x691f('0x31')][_0x691f('0x3d')]+'%'};return _0x4c3fa1;})});}_0x3196f0=_[_0x691f('0x3e')]({},_0x3196f0,_0x4eaa84[_0x691f('0x40')]);return _0x2840f5[_0x691f('0x56')](_0x3196f0);}})[_0x691f('0x21')](function(_0x84011){if(_0x84011){_0x5f1455=_0x84011[_0x691f('0x37')];if(!_0x4eaa84[_0x691f('0x31')][_0x691f('0x57')](_0x691f('0x38'))){_0x3196f0[_0x691f('0x58')]=qs[_0x691f('0x58')](_0x4eaa84['query'][_0x691f('0x58')]);_0x3196f0[_0x691f('0x1d')]=qs[_0x691f('0x1d')](_0x4eaa84[_0x691f('0x31')][_0x691f('0x1d')]);}return _0x2840f5[_0x691f('0x56')](_0x3196f0);}})[_0x691f('0x21')](function(_0x2bf6ad){if(_0x2bf6ad){return _0x2bf6ad?{'count':_0x5f1455,'rows':_0x2bf6ad}:null;}})['then'](respondWithResult(_0x2a6b4a,null))[_0x691f('0x44')](handleError(_0x2a6b4a,null));};exports['getAnyConditions']=function(_0x46749a,_0x38f76c,_0x50d0b9){var _0x3302f1={};var _0x3c24ea={};var _0x344994;var _0x336425;return db[_0x691f('0x2b')]['findOne']({'where':{'id':_0x46749a['params']['id']}})[_0x691f('0x21')](handleEntityNotFound(_0x38f76c,null))[_0x691f('0x21')](function(_0x57d041){if(_0x57d041){_0x344994=_0x57d041;_0x3c24ea['model']=_[_0x691f('0x32')](db[_0x691f('0x53')][_0x691f('0x2c')]);_0x3c24ea['query']=_[_0x691f('0x32')](_0x46749a['query']);_0x3c24ea[_0x691f('0x3b')]=_[_0x691f('0x33')](_0x3c24ea[_0x691f('0x34')],_0x3c24ea[_0x691f('0x31')]);_0x3302f1[_0x691f('0x36')]=_[_0x691f('0x33')](_0x3c24ea[_0x691f('0x34')],qs[_0x691f('0x35')](_0x46749a[_0x691f('0x31')][_0x691f('0x35')]));_0x3302f1[_0x691f('0x36')]=_0x3302f1[_0x691f('0x36')][_0x691f('0x37')]?_0x3302f1[_0x691f('0x36')]:_0x3c24ea[_0x691f('0x34')];_0x3302f1[_0x691f('0x55')]=qs[_0x691f('0x39')](_0x46749a['query'][_0x691f('0x39')]);_0x3302f1[_0x691f('0x3a')]=qs[_0x691f('0x3b')](_[_0x691f('0x3c')](_0x46749a['query'],_0x3c24ea['filters']));if(_0x46749a[_0x691f('0x31')][_0x691f('0x3d')]){_0x3302f1[_0x691f('0x3a')]=_[_0x691f('0x3e')](_0x3302f1[_0x691f('0x3a')],{'$or':_['map'](_0x3302f1['attributes'],function(_0x389d25){var _0x1d9d8a={};_0x1d9d8a[_0x389d25]={'$like':'%'+_0x46749a[_0x691f('0x31')]['filter']+'%'};return _0x1d9d8a;})});}_0x3302f1=_['merge']({},_0x3302f1,_0x46749a[_0x691f('0x40')]);return _0x344994['getAnyConditions'](_0x3302f1);}})[_0x691f('0x21')](function(_0x3291c6){if(_0x3291c6){_0x336425=_0x3291c6[_0x691f('0x37')];if(!_0x46749a[_0x691f('0x31')][_0x691f('0x57')]('nolimit')){_0x3302f1[_0x691f('0x58')]=qs[_0x691f('0x58')](_0x46749a[_0x691f('0x31')][_0x691f('0x58')]);_0x3302f1[_0x691f('0x1d')]=qs[_0x691f('0x1d')](_0x46749a[_0x691f('0x31')][_0x691f('0x1d')]);}return _0x344994[_0x691f('0x59')](_0x3302f1);}})[_0x691f('0x21')](function(_0x77c86b){if(_0x77c86b){return _0x77c86b?{'count':_0x336425,'rows':_0x77c86b}:null;}})[_0x691f('0x21')](respondWithResult(_0x38f76c,null))['catch'](handleError(_0x38f76c,null));};exports[_0x691f('0x5a')]=function(_0x38cffd,_0x3d0084,_0x47fe85){if(_0x38cffd[_0x691f('0x49')]['id']){delete _0x38cffd[_0x691f('0x49')]['id'];}return db[_0x691f('0x2b')][_0x691f('0x47')]({'where':{'id':_0x38cffd[_0x691f('0x45')]['id']}})[_0x691f('0x21')](handleEntityNotFound(_0x3d0084,null))[_0x691f('0x21')](function(_0x68b6e2){if(_0x68b6e2){_0x38cffd['body']['TriggerId']=_0x68b6e2['id'];return db[_0x691f('0x5b')][_0x691f('0x48')](_0x38cffd['body']);}})['then'](respondWithResult(_0x3d0084,null))[_0x691f('0x44')](handleError(_0x3d0084,null));};exports[_0x691f('0x5c')]=function(_0xc28d5e,_0x10decc,_0x5f6d05){var _0x29df17={};var _0x20999f={};var _0x3ed3f6;var _0x22f2bc;return db[_0x691f('0x2b')][_0x691f('0x54')]({'where':{'id':_0xc28d5e[_0x691f('0x45')]['id']}})[_0x691f('0x21')](handleEntityNotFound(_0x10decc,null))[_0x691f('0x21')](function(_0x5d67e0){if(_0x5d67e0){_0x3ed3f6=_0x5d67e0;_0x20999f[_0x691f('0x34')]=_[_0x691f('0x32')](db['Action'][_0x691f('0x2c')]);_0x20999f[_0x691f('0x31')]=_[_0x691f('0x32')](_0xc28d5e['query']);_0x20999f[_0x691f('0x3b')]=_[_0x691f('0x33')](_0x20999f['model'],_0x20999f[_0x691f('0x31')]);_0x29df17[_0x691f('0x36')]=_[_0x691f('0x33')](_0x20999f[_0x691f('0x34')],qs['fields'](_0xc28d5e[_0x691f('0x31')][_0x691f('0x35')]));_0x29df17['attributes']=_0x29df17['attributes']['length']?_0x29df17[_0x691f('0x36')]:_0x20999f[_0x691f('0x34')];_0x29df17['order']=qs[_0x691f('0x39')](_0xc28d5e[_0x691f('0x31')]['sort']);_0x29df17[_0x691f('0x3a')]=qs['filters'](_[_0x691f('0x3c')](_0xc28d5e[_0x691f('0x31')],_0x20999f[_0x691f('0x3b')]));if(_0xc28d5e[_0x691f('0x31')]['filter']){_0x29df17['where']=_[_0x691f('0x3e')](_0x29df17[_0x691f('0x3a')],{'$or':_[_0x691f('0x30')](_0x29df17[_0x691f('0x36')],function(_0x4c14c3){var _0x564607={};_0x564607[_0x4c14c3]={'$like':'%'+_0xc28d5e['query']['filter']+'%'};return _0x564607;})});}_0x29df17=_[_0x691f('0x3e')]({},_0x29df17,_0xc28d5e['options']);return _0x3ed3f6[_0x691f('0x5c')](_0x29df17);}})[_0x691f('0x21')](function(_0x343acd){if(_0x343acd){_0x22f2bc=_0x343acd[_0x691f('0x37')];if(!_0xc28d5e[_0x691f('0x31')][_0x691f('0x57')]('nolimit')){_0x29df17['limit']=qs['limit'](_0xc28d5e[_0x691f('0x31')]['limit']);_0x29df17[_0x691f('0x1d')]=qs['offset'](_0xc28d5e['query'][_0x691f('0x1d')]);}return _0x3ed3f6[_0x691f('0x5c')](_0x29df17);}})['then'](function(_0x392337){if(_0x392337){return _0x392337?{'count':_0x22f2bc,'rows':_0x392337}:null;}})[_0x691f('0x21')](respondWithResult(_0x10decc,null))[_0x691f('0x44')](handleError(_0x10decc,null));};
\ No newline at end of file
+var _0xb8e4=['role','Triggers','find','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','addAllCondition','addAnyCondition','TriggerAnyId','Condition','getAllConditions','getAnyConditions','findOne','addAction','TriggerId','Action','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','json','count','offset','set','Content-Range','apply','reject','update','then','destroy','get','UserProfileResource','end','stack','name','send','index','map','Trigger','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','limit','order','sort','where','pick','merge','type','filter','includeAll','include','rows','catch','show','rawAttributes','length','options','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user'];(function(_0x29a54d,_0x439404){var _0x34232d=function(_0x1461fd){while(--_0x1461fd){_0x29a54d['push'](_0x29a54d['shift']());}};_0x34232d(++_0x439404);}(_0xb8e4,0xd0));var _0x4b8e=function(_0x390b17,_0x407fea){_0x390b17=_0x390b17-0x0;var _0x599e86=_0xb8e4[_0x390b17];return _0x599e86;};'use strict';var pdf=require(_0x4b8e('0x0'));var emlformat=require(_0x4b8e('0x1'));var rimraf=require(_0x4b8e('0x2'));var zipdir=require(_0x4b8e('0x3'));var jsonpatch=require(_0x4b8e('0x4'));var rp=require(_0x4b8e('0x5'));var moment=require(_0x4b8e('0x6'));var BPromise=require('bluebird');var Mustache=require(_0x4b8e('0x7'));var util=require(_0x4b8e('0x8'));var path=require(_0x4b8e('0x9'));var sox=require(_0x4b8e('0xa'));var csv=require(_0x4b8e('0xb'));var ejs=require(_0x4b8e('0xc'));var fs=require('fs');var _=require('lodash');var squel=require(_0x4b8e('0xd'));var crypto=require(_0x4b8e('0xe'));var jsforce=require(_0x4b8e('0xf'));var deskjs=require(_0x4b8e('0x10'));var toCsv=require('to-csv');var querystring=require(_0x4b8e('0x11'));var Papa=require(_0x4b8e('0x12'));var Redis=require(_0x4b8e('0x13'));var authService=require(_0x4b8e('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0x4b8e('0x15'));var hardwareService=require(_0x4b8e('0x16'));var logger=require(_0x4b8e('0x17'))(_0x4b8e('0x18'));var utils=require(_0x4b8e('0x19'));var config=require('../../config/environment');var db=require(_0x4b8e('0x1a'))['db'];function respondWithStatusCode(_0x358f4e,_0x4af622){_0x4af622=_0x4af622||0xcc;return function(_0x1970e2){if(_0x1970e2){return _0x358f4e[_0x4b8e('0x1b')](_0x4af622);}return _0x358f4e[_0x4b8e('0x1c')](_0x4af622)['end']();};}function respondWithResult(_0x36f542,_0x1846b2){_0x1846b2=_0x1846b2||0xc8;return function(_0xf6d2a7){if(_0xf6d2a7){return _0x36f542['status'](_0x1846b2)[_0x4b8e('0x1d')](_0xf6d2a7);}};}function respondWithFilteredResult(_0xc6c446,_0x293971){return function(_0x2a16bd){if(_0x2a16bd){var _0x4dc910=_0x2a16bd[_0x4b8e('0x1e')],_0x95a50d=_0x293971[_0x4b8e('0x1f')],_0x3f39c1=_0x293971[_0x4b8e('0x1f')]+_0x293971['limit'],_0x4210ef;if(_0x3f39c1>=_0x4dc910){_0x3f39c1=_0x4dc910;_0x4210ef=0xc8;}else{_0x4210ef=0xce;}_0xc6c446[_0x4b8e('0x1c')](_0x4210ef);return _0xc6c446[_0x4b8e('0x20')](_0x4b8e('0x21'),_0x95a50d+'-'+_0x3f39c1+'/'+_0x4dc910)['json'](_0x2a16bd);}return null;};}function patchUpdates(_0x38165d){return function(_0x1ea7ff){try{jsonpatch[_0x4b8e('0x22')](_0x1ea7ff,_0x38165d,!![]);}catch(_0x367da5){return BPromise[_0x4b8e('0x23')](_0x367da5);}return _0x1ea7ff['save']();};}function saveUpdates(_0x2e9298,_0x38c3d4){return function(_0x1bf7e5){if(_0x1bf7e5){return _0x1bf7e5[_0x4b8e('0x24')](_0x2e9298)[_0x4b8e('0x25')](function(_0x2f4e77){return _0x2f4e77;});}return null;};}function removeEntity(_0x1c55e9,_0x2682d8){return function(_0xf5cd0){if(_0xf5cd0){return _0xf5cd0[_0x4b8e('0x26')]()[_0x4b8e('0x25')](function(){var _0xea5c01=_0xf5cd0[_0x4b8e('0x27')]({'plain':!![]});var _0xb53295='Triggers';return db[_0x4b8e('0x28')]['destroy']({'where':{'type':_0xb53295,'resourceId':_0xea5c01['id']}})[_0x4b8e('0x25')](function(){return _0xf5cd0;});})[_0x4b8e('0x25')](function(){_0x1c55e9[_0x4b8e('0x1c')](0xcc)[_0x4b8e('0x29')]();});}};}function handleEntityNotFound(_0x13fcec,_0x15f31b){return function(_0x2f5779){if(!_0x2f5779){_0x13fcec[_0x4b8e('0x1b')](0x194);}return _0x2f5779;};}function handleError(_0x51aa76,_0x2bc09d){_0x2bc09d=_0x2bc09d||0x1f4;return function(_0x50efd5){logger['error'](_0x50efd5[_0x4b8e('0x2a')]);if(_0x50efd5[_0x4b8e('0x2b')]){delete _0x50efd5['name'];}_0x51aa76['status'](_0x2bc09d)[_0x4b8e('0x2c')](_0x50efd5);};}exports[_0x4b8e('0x2d')]=function(_0x2a3775,_0x4f8aa0){var _0x97172={},_0x12e216={},_0x412a90={'count':0x0,'rows':[]};var _0x36de4c=_[_0x4b8e('0x2e')](db[_0x4b8e('0x2f')]['rawAttributes'],function(_0x439b9f){return{'name':_0x439b9f['fieldName'],'type':_0x439b9f['type']['key']};});_0x12e216[_0x4b8e('0x30')]=_['map'](_0x36de4c,_0x4b8e('0x2b'));_0x12e216['query']=_[_0x4b8e('0x31')](_0x2a3775[_0x4b8e('0x32')]);_0x12e216[_0x4b8e('0x33')]=_[_0x4b8e('0x34')](_0x12e216['model'],_0x12e216[_0x4b8e('0x32')]);_0x97172[_0x4b8e('0x35')]=_[_0x4b8e('0x34')](_0x12e216[_0x4b8e('0x30')],qs[_0x4b8e('0x36')](_0x2a3775[_0x4b8e('0x32')]['fields']));_0x97172['attributes']=_0x97172[_0x4b8e('0x35')]['length']?_0x97172['attributes']:_0x12e216[_0x4b8e('0x30')];if(!_0x2a3775[_0x4b8e('0x32')][_0x4b8e('0x37')](_0x4b8e('0x38'))){_0x97172['limit']=qs[_0x4b8e('0x39')](_0x2a3775[_0x4b8e('0x32')][_0x4b8e('0x39')]);_0x97172[_0x4b8e('0x1f')]=qs[_0x4b8e('0x1f')](_0x2a3775[_0x4b8e('0x32')][_0x4b8e('0x1f')]);}_0x97172[_0x4b8e('0x3a')]=qs[_0x4b8e('0x3b')](_0x2a3775['query']['sort']);_0x97172[_0x4b8e('0x3c')]=qs[_0x4b8e('0x33')](_[_0x4b8e('0x3d')](_0x2a3775['query'],_0x12e216[_0x4b8e('0x33')]),_0x36de4c);if(_0x2a3775[_0x4b8e('0x32')]['filter']){_0x97172['where']=_[_0x4b8e('0x3e')](_0x97172[_0x4b8e('0x3c')],{'$or':_['map'](_0x36de4c,function(_0x264ca7){if(_0x264ca7[_0x4b8e('0x3f')]!=='VIRTUAL'){var _0x347ddb={};_0x347ddb[_0x264ca7[_0x4b8e('0x2b')]]={'$like':'%'+_0x2a3775[_0x4b8e('0x32')][_0x4b8e('0x40')]+'%'};return _0x347ddb;}})});}_0x97172=_[_0x4b8e('0x3e')]({},_0x97172,_0x2a3775['options']);var _0x13af3b={'where':_0x97172[_0x4b8e('0x3c')]};return db[_0x4b8e('0x2f')][_0x4b8e('0x1e')](_0x13af3b)[_0x4b8e('0x25')](function(_0x2f85e4){_0x412a90[_0x4b8e('0x1e')]=_0x2f85e4;if(_0x2a3775[_0x4b8e('0x32')][_0x4b8e('0x41')]){_0x97172[_0x4b8e('0x42')]=[{'all':!![]}];}return db[_0x4b8e('0x2f')]['findAll'](_0x97172);})[_0x4b8e('0x25')](function(_0x457b61){_0x412a90[_0x4b8e('0x43')]=_0x457b61;return _0x412a90;})[_0x4b8e('0x25')](respondWithFilteredResult(_0x4f8aa0,_0x97172))[_0x4b8e('0x44')](handleError(_0x4f8aa0,null));};exports[_0x4b8e('0x45')]=function(_0x46f7a6,_0x208737){var _0x513029={'raw':![],'where':{'id':_0x46f7a6['params']['id']}},_0x51ce7c={};_0x51ce7c['model']=_[_0x4b8e('0x31')](db[_0x4b8e('0x2f')][_0x4b8e('0x46')]);_0x51ce7c[_0x4b8e('0x32')]=_['keys'](_0x46f7a6[_0x4b8e('0x32')]);_0x51ce7c[_0x4b8e('0x33')]=_[_0x4b8e('0x34')](_0x51ce7c[_0x4b8e('0x30')],_0x51ce7c[_0x4b8e('0x32')]);_0x513029['attributes']=_['intersection'](_0x51ce7c['model'],qs[_0x4b8e('0x36')](_0x46f7a6[_0x4b8e('0x32')][_0x4b8e('0x36')]));_0x513029[_0x4b8e('0x35')]=_0x513029[_0x4b8e('0x35')][_0x4b8e('0x47')]?_0x513029[_0x4b8e('0x35')]:_0x51ce7c[_0x4b8e('0x30')];if(_0x46f7a6[_0x4b8e('0x32')][_0x4b8e('0x41')]){_0x513029[_0x4b8e('0x42')]=[{'all':!![]}];}_0x513029=_['merge']({},_0x513029,_0x46f7a6[_0x4b8e('0x48')]);return db[_0x4b8e('0x2f')]['find'](_0x513029)[_0x4b8e('0x25')](handleEntityNotFound(_0x208737,null))[_0x4b8e('0x25')](respondWithResult(_0x208737,null))[_0x4b8e('0x44')](handleError(_0x208737,null));};exports[_0x4b8e('0x49')]=function(_0x2721af,_0x943dbe){return db['Trigger'][_0x4b8e('0x49')](_0x2721af[_0x4b8e('0x4a')],{})['then'](function(_0x2d0b26){var _0x4e014b=_0x2721af[_0x4b8e('0x4b')][_0x4b8e('0x27')]({'plain':!![]});if(!_0x4e014b)throw new Error(_0x4b8e('0x4c'));if(_0x4e014b[_0x4b8e('0x4d')]==='user'){var _0x10630a=_0x2d0b26[_0x4b8e('0x27')]({'plain':!![]});var _0x40b1de=_0x4b8e('0x4e');return db['UserProfileSection'][_0x4b8e('0x4f')]({'where':{'name':_0x40b1de,'userProfileId':_0x4e014b[_0x4b8e('0x50')]},'raw':!![]})[_0x4b8e('0x25')](function(_0x120a5d){if(_0x120a5d&&_0x120a5d[_0x4b8e('0x51')]===0x0){return db[_0x4b8e('0x28')][_0x4b8e('0x49')]({'name':_0x10630a['name'],'resourceId':_0x10630a['id'],'type':_0x120a5d[_0x4b8e('0x2b')],'sectionId':_0x120a5d['id']},{})[_0x4b8e('0x25')](function(){return _0x2d0b26;});}else{return _0x2d0b26;}})[_0x4b8e('0x44')](function(_0x53f2ae){logger[_0x4b8e('0x52')](_0x4b8e('0x53'),_0x53f2ae);throw _0x53f2ae;});}return _0x2d0b26;})['then'](respondWithResult(_0x943dbe,0xc9))[_0x4b8e('0x44')](handleError(_0x943dbe,null));};exports[_0x4b8e('0x24')]=function(_0x2d934e,_0x1781ea){if(_0x2d934e[_0x4b8e('0x4a')]['id']){delete _0x2d934e['body']['id'];}return db['Trigger'][_0x4b8e('0x4f')]({'where':{'id':_0x2d934e[_0x4b8e('0x54')]['id']}})[_0x4b8e('0x25')](handleEntityNotFound(_0x1781ea,null))[_0x4b8e('0x25')](saveUpdates(_0x2d934e[_0x4b8e('0x4a')],null))[_0x4b8e('0x25')](respondWithResult(_0x1781ea,null))['catch'](handleError(_0x1781ea,null));};exports['destroy']=function(_0x434479,_0x364364){return db[_0x4b8e('0x2f')][_0x4b8e('0x4f')]({'where':{'id':_0x434479[_0x4b8e('0x54')]['id']}})[_0x4b8e('0x25')](handleEntityNotFound(_0x364364,null))[_0x4b8e('0x25')](removeEntity(_0x364364,null))[_0x4b8e('0x44')](handleError(_0x364364,null));};exports[_0x4b8e('0x55')]=function(_0x28cfb3,_0x2706b0,_0x392374){if(_0x28cfb3['body']['id']){delete _0x28cfb3['body']['id'];}return db[_0x4b8e('0x2f')][_0x4b8e('0x4f')]({'where':{'id':_0x28cfb3[_0x4b8e('0x54')]['id']}})[_0x4b8e('0x25')](handleEntityNotFound(_0x2706b0,null))[_0x4b8e('0x25')](function(_0x55a651){if(_0x55a651){_0x28cfb3[_0x4b8e('0x4a')]['TriggerAllId']=_0x55a651['id'];return db['Condition'][_0x4b8e('0x49')](_0x28cfb3[_0x4b8e('0x4a')]);}})[_0x4b8e('0x25')](respondWithResult(_0x2706b0,null))[_0x4b8e('0x44')](handleError(_0x2706b0,null));};exports[_0x4b8e('0x56')]=function(_0x2cc8ec,_0x355efb,_0x18f170){if(_0x2cc8ec['body']['id']){delete _0x2cc8ec[_0x4b8e('0x4a')]['id'];}return db[_0x4b8e('0x2f')][_0x4b8e('0x4f')]({'where':{'id':_0x2cc8ec[_0x4b8e('0x54')]['id']}})['then'](handleEntityNotFound(_0x355efb,null))[_0x4b8e('0x25')](function(_0x515c9b){if(_0x515c9b){_0x2cc8ec['body'][_0x4b8e('0x57')]=_0x515c9b['id'];return db[_0x4b8e('0x58')][_0x4b8e('0x49')](_0x2cc8ec[_0x4b8e('0x4a')]);}})['then'](respondWithResult(_0x355efb,null))[_0x4b8e('0x44')](handleError(_0x355efb,null));};exports['getAllConditions']=function(_0x491737,_0x29e34f,_0x5770e1){var _0x194436={};var _0x3f29e7={};var _0x2c37d5;var _0x443206;return db[_0x4b8e('0x2f')]['findOne']({'where':{'id':_0x491737[_0x4b8e('0x54')]['id']}})['then'](handleEntityNotFound(_0x29e34f,null))[_0x4b8e('0x25')](function(_0x2d092c){if(_0x2d092c){_0x2c37d5=_0x2d092c;_0x3f29e7[_0x4b8e('0x30')]=_[_0x4b8e('0x31')](db[_0x4b8e('0x58')][_0x4b8e('0x46')]);_0x3f29e7[_0x4b8e('0x32')]=_[_0x4b8e('0x31')](_0x491737[_0x4b8e('0x32')]);_0x3f29e7[_0x4b8e('0x33')]=_[_0x4b8e('0x34')](_0x3f29e7[_0x4b8e('0x30')],_0x3f29e7[_0x4b8e('0x32')]);_0x194436[_0x4b8e('0x35')]=_[_0x4b8e('0x34')](_0x3f29e7[_0x4b8e('0x30')],qs['fields'](_0x491737[_0x4b8e('0x32')][_0x4b8e('0x36')]));_0x194436[_0x4b8e('0x35')]=_0x194436[_0x4b8e('0x35')]['length']?_0x194436[_0x4b8e('0x35')]:_0x3f29e7[_0x4b8e('0x30')];_0x194436[_0x4b8e('0x3a')]=qs[_0x4b8e('0x3b')](_0x491737['query'][_0x4b8e('0x3b')]);_0x194436[_0x4b8e('0x3c')]=qs['filters'](_[_0x4b8e('0x3d')](_0x491737['query'],_0x3f29e7['filters']));if(_0x491737[_0x4b8e('0x32')][_0x4b8e('0x40')]){_0x194436[_0x4b8e('0x3c')]=_[_0x4b8e('0x3e')](_0x194436[_0x4b8e('0x3c')],{'$or':_[_0x4b8e('0x2e')](_0x194436[_0x4b8e('0x35')],function(_0x26b8e0){var _0xd53c35={};_0xd53c35[_0x26b8e0]={'$like':'%'+_0x491737[_0x4b8e('0x32')][_0x4b8e('0x40')]+'%'};return _0xd53c35;})});}_0x194436=_[_0x4b8e('0x3e')]({},_0x194436,_0x491737[_0x4b8e('0x48')]);return _0x2c37d5[_0x4b8e('0x59')](_0x194436);}})['then'](function(_0x4006f2){if(_0x4006f2){_0x443206=_0x4006f2[_0x4b8e('0x47')];if(!_0x491737[_0x4b8e('0x32')][_0x4b8e('0x37')](_0x4b8e('0x38'))){_0x194436['limit']=qs[_0x4b8e('0x39')](_0x491737[_0x4b8e('0x32')]['limit']);_0x194436['offset']=qs[_0x4b8e('0x1f')](_0x491737['query'][_0x4b8e('0x1f')]);}return _0x2c37d5[_0x4b8e('0x59')](_0x194436);}})[_0x4b8e('0x25')](function(_0x97636c){if(_0x97636c){return _0x97636c?{'count':_0x443206,'rows':_0x97636c}:null;}})[_0x4b8e('0x25')](respondWithResult(_0x29e34f,null))[_0x4b8e('0x44')](handleError(_0x29e34f,null));};exports[_0x4b8e('0x5a')]=function(_0xa4cfec,_0x588990,_0x2435a2){var _0x2e3e9b={};var _0x17fc72={};var _0x9cc71c;var _0x178d72;return db[_0x4b8e('0x2f')][_0x4b8e('0x5b')]({'where':{'id':_0xa4cfec[_0x4b8e('0x54')]['id']}})[_0x4b8e('0x25')](handleEntityNotFound(_0x588990,null))['then'](function(_0x533e3d){if(_0x533e3d){_0x9cc71c=_0x533e3d;_0x17fc72[_0x4b8e('0x30')]=_['keys'](db[_0x4b8e('0x58')][_0x4b8e('0x46')]);_0x17fc72['query']=_[_0x4b8e('0x31')](_0xa4cfec[_0x4b8e('0x32')]);_0x17fc72['filters']=_[_0x4b8e('0x34')](_0x17fc72[_0x4b8e('0x30')],_0x17fc72['query']);_0x2e3e9b['attributes']=_['intersection'](_0x17fc72['model'],qs[_0x4b8e('0x36')](_0xa4cfec[_0x4b8e('0x32')][_0x4b8e('0x36')]));_0x2e3e9b[_0x4b8e('0x35')]=_0x2e3e9b[_0x4b8e('0x35')]['length']?_0x2e3e9b[_0x4b8e('0x35')]:_0x17fc72[_0x4b8e('0x30')];_0x2e3e9b[_0x4b8e('0x3a')]=qs['sort'](_0xa4cfec[_0x4b8e('0x32')][_0x4b8e('0x3b')]);_0x2e3e9b[_0x4b8e('0x3c')]=qs['filters'](_['pick'](_0xa4cfec['query'],_0x17fc72[_0x4b8e('0x33')]));if(_0xa4cfec[_0x4b8e('0x32')][_0x4b8e('0x40')]){_0x2e3e9b[_0x4b8e('0x3c')]=_['merge'](_0x2e3e9b['where'],{'$or':_['map'](_0x2e3e9b['attributes'],function(_0x2ecbb3){var _0x45298d={};_0x45298d[_0x2ecbb3]={'$like':'%'+_0xa4cfec['query'][_0x4b8e('0x40')]+'%'};return _0x45298d;})});}_0x2e3e9b=_[_0x4b8e('0x3e')]({},_0x2e3e9b,_0xa4cfec['options']);return _0x9cc71c[_0x4b8e('0x5a')](_0x2e3e9b);}})[_0x4b8e('0x25')](function(_0x3b031f){if(_0x3b031f){_0x178d72=_0x3b031f[_0x4b8e('0x47')];if(!_0xa4cfec[_0x4b8e('0x32')]['hasOwnProperty']('nolimit')){_0x2e3e9b['limit']=qs[_0x4b8e('0x39')](_0xa4cfec[_0x4b8e('0x32')][_0x4b8e('0x39')]);_0x2e3e9b[_0x4b8e('0x1f')]=qs[_0x4b8e('0x1f')](_0xa4cfec[_0x4b8e('0x32')][_0x4b8e('0x1f')]);}return _0x9cc71c[_0x4b8e('0x5a')](_0x2e3e9b);}})['then'](function(_0x4210f3){if(_0x4210f3){return _0x4210f3?{'count':_0x178d72,'rows':_0x4210f3}:null;}})[_0x4b8e('0x25')](respondWithResult(_0x588990,null))[_0x4b8e('0x44')](handleError(_0x588990,null));};exports[_0x4b8e('0x5c')]=function(_0x11471c,_0x1e4dff,_0x159509){if(_0x11471c['body']['id']){delete _0x11471c[_0x4b8e('0x4a')]['id'];}return db[_0x4b8e('0x2f')][_0x4b8e('0x4f')]({'where':{'id':_0x11471c[_0x4b8e('0x54')]['id']}})['then'](handleEntityNotFound(_0x1e4dff,null))['then'](function(_0x32fb73){if(_0x32fb73){_0x11471c[_0x4b8e('0x4a')][_0x4b8e('0x5d')]=_0x32fb73['id'];return db[_0x4b8e('0x5e')][_0x4b8e('0x49')](_0x11471c[_0x4b8e('0x4a')]);}})['then'](respondWithResult(_0x1e4dff,null))[_0x4b8e('0x44')](handleError(_0x1e4dff,null));};exports['getActions']=function(_0x3613b2,_0x411cb4,_0x1ecb74){var _0xf4580b={};var _0x244530={};var _0x3ead35;var _0x3fc5b7;return db[_0x4b8e('0x2f')][_0x4b8e('0x5b')]({'where':{'id':_0x3613b2['params']['id']}})[_0x4b8e('0x25')](handleEntityNotFound(_0x411cb4,null))[_0x4b8e('0x25')](function(_0x2c3ce1){if(_0x2c3ce1){_0x3ead35=_0x2c3ce1;_0x244530[_0x4b8e('0x30')]=_[_0x4b8e('0x31')](db[_0x4b8e('0x5e')][_0x4b8e('0x46')]);_0x244530[_0x4b8e('0x32')]=_[_0x4b8e('0x31')](_0x3613b2[_0x4b8e('0x32')]);_0x244530[_0x4b8e('0x33')]=_['intersection'](_0x244530[_0x4b8e('0x30')],_0x244530[_0x4b8e('0x32')]);_0xf4580b['attributes']=_[_0x4b8e('0x34')](_0x244530[_0x4b8e('0x30')],qs[_0x4b8e('0x36')](_0x3613b2['query']['fields']));_0xf4580b[_0x4b8e('0x35')]=_0xf4580b['attributes']['length']?_0xf4580b['attributes']:_0x244530[_0x4b8e('0x30')];_0xf4580b['order']=qs['sort'](_0x3613b2[_0x4b8e('0x32')][_0x4b8e('0x3b')]);_0xf4580b[_0x4b8e('0x3c')]=qs[_0x4b8e('0x33')](_[_0x4b8e('0x3d')](_0x3613b2[_0x4b8e('0x32')],_0x244530[_0x4b8e('0x33')]));if(_0x3613b2['query'][_0x4b8e('0x40')]){_0xf4580b[_0x4b8e('0x3c')]=_[_0x4b8e('0x3e')](_0xf4580b[_0x4b8e('0x3c')],{'$or':_['map'](_0xf4580b['attributes'],function(_0x317e36){var _0x198686={};_0x198686[_0x317e36]={'$like':'%'+_0x3613b2[_0x4b8e('0x32')][_0x4b8e('0x40')]+'%'};return _0x198686;})});}_0xf4580b=_[_0x4b8e('0x3e')]({},_0xf4580b,_0x3613b2[_0x4b8e('0x48')]);return _0x3ead35['getActions'](_0xf4580b);}})[_0x4b8e('0x25')](function(_0x1ed643){if(_0x1ed643){_0x3fc5b7=_0x1ed643['length'];if(!_0x3613b2[_0x4b8e('0x32')][_0x4b8e('0x37')](_0x4b8e('0x38'))){_0xf4580b['limit']=qs[_0x4b8e('0x39')](_0x3613b2[_0x4b8e('0x32')][_0x4b8e('0x39')]);_0xf4580b[_0x4b8e('0x1f')]=qs[_0x4b8e('0x1f')](_0x3613b2[_0x4b8e('0x32')]['offset']);}return _0x3ead35['getActions'](_0xf4580b);}})[_0x4b8e('0x25')](function(_0x6123cf){if(_0x6123cf){return _0x6123cf?{'count':_0x3fc5b7,'rows':_0x6123cf}:null;}})[_0x4b8e('0x25')](respondWithResult(_0x411cb4,null))[_0x4b8e('0x44')](handleError(_0x411cb4,null));};
\ No newline at end of file
diff --git a/server/api/trigger/trigger.model.js b/server/api/trigger/trigger.model.js
index b6fbafb..2d14ced 100644
--- a/server/api/trigger/trigger.model.js
+++ b/server/api/trigger/trigger.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xdb28=['../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','exports','Trigger','tools_triggers','lodash','util'];(function(_0x2166dd,_0x50bcba){var _0x5046ea=function(_0x650045){while(--_0x650045){_0x2166dd['push'](_0x2166dd['shift']());}};_0x5046ea(++_0x50bcba);}(_0xdb28,0x106));var _0x8db2=function(_0x15d34f,_0xfaf2de){_0x15d34f=_0x15d34f-0x0;var _0x57e6df=_0xdb28[_0x15d34f];return _0x57e6df;};'use strict';var _=require(_0x8db2('0x0'));var util=require(_0x8db2('0x1'));var logger=require(_0x8db2('0x2'))(_0x8db2('0x3'));var moment=require('moment');var BPromise=require(_0x8db2('0x4'));var rp=require(_0x8db2('0x5'));var fs=require('fs');var path=require(_0x8db2('0x6'));var rimraf=require(_0x8db2('0x7'));var config=require(_0x8db2('0x8'));var attributes=require('./trigger.attributes');module[_0x8db2('0x9')]=function(_0x1d2dd3,_0x5f42ee){return _0x1d2dd3['define'](_0x8db2('0xa'),attributes,{'tableName':_0x8db2('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x5f2f=['bluebird','request-promise','path','./trigger.attributes','exports','define','Trigger','lodash','util','../../config/logger','api','moment'];(function(_0x478f7f,_0x2af3b5){var _0x1ad418=function(_0x4d5142){while(--_0x4d5142){_0x478f7f['push'](_0x478f7f['shift']());}};_0x1ad418(++_0x2af3b5);}(_0x5f2f,0x73));var _0xf5f2=function(_0x4c1e26,_0x4afcd1){_0x4c1e26=_0x4c1e26-0x0;var _0x3774cc=_0x5f2f[_0x4c1e26];return _0x3774cc;};'use strict';var _=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var logger=require(_0xf5f2('0x2'))(_0xf5f2('0x3'));var moment=require(_0xf5f2('0x4'));var BPromise=require(_0xf5f2('0x5'));var rp=require(_0xf5f2('0x6'));var fs=require('fs');var path=require(_0xf5f2('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xf5f2('0x8'));module[_0xf5f2('0x9')]=function(_0xad7f65,_0x3eebf6){return _0xad7f65[_0xf5f2('0xa')](_0xf5f2('0xb'),attributes,{'tableName':'tools_triggers','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/trigger/trigger.rpc.js b/server/api/trigger/trigger.rpc.js
index fbc5146..0f33273 100644
--- a/server/api/trigger/trigger.rpc.js
+++ b/server/api/trigger/trigger.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7d25=['raw','where','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','client','request','info','Trigger,\x20%s,\x20%s','debug','Trigger,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','GetTrigger','Trigger','findAll','options','attributes','limit','include','map','model','then','ShowTrigger','find'];(function(_0xd6aad,_0x3fd78e){var _0x1109e6=function(_0x37f59c){while(--_0x37f59c){_0xd6aad['push'](_0xd6aad['shift']());}};_0x1109e6(++_0x3fd78e);}(_0x7d25,0x8a));var _0x57d2=function(_0x172747,_0x1732bd){_0x172747=_0x172747-0x0;var _0x509692=_0x7d25[_0x172747];return _0x509692;};'use strict';var _=require('lodash');var util=require(_0x57d2('0x0'));var moment=require(_0x57d2('0x1'));var BPromise=require(_0x57d2('0x2'));var rs=require(_0x57d2('0x3'));var fs=require('fs');var Redis=require(_0x57d2('0x4'));var db=require(_0x57d2('0x5'))['db'];var utils=require(_0x57d2('0x6'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x57d2('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1f43b2,_0x263d35,_0x147194){return new BPromise(function(_0x59ae87,_0x49e3e5){return client[_0x57d2('0x8')](_0x1f43b2,_0x147194)['then'](function(_0x3a1ec5){logger[_0x57d2('0x9')](_0x57d2('0xa'),_0x263d35,'request\x20sent');logger[_0x57d2('0xb')](_0x57d2('0xc'),_0x263d35,_0x57d2('0xd'),JSON[_0x57d2('0xe')](_0x3a1ec5));if(_0x3a1ec5[_0x57d2('0xf')]){if(_0x3a1ec5[_0x57d2('0xf')][_0x57d2('0x10')]===0x1f4){logger[_0x57d2('0xf')](_0x57d2('0xa'),_0x263d35,_0x3a1ec5[_0x57d2('0xf')][_0x57d2('0x11')]);return _0x49e3e5(_0x3a1ec5[_0x57d2('0xf')][_0x57d2('0x11')]);}logger[_0x57d2('0xf')](_0x57d2('0xa'),_0x263d35,_0x3a1ec5[_0x57d2('0xf')]['message']);return _0x59ae87(_0x3a1ec5['error'][_0x57d2('0x11')]);}else{logger[_0x57d2('0x9')]('Trigger,\x20%s,\x20%s',_0x263d35,_0x57d2('0xd'));_0x59ae87(_0x3a1ec5[_0x57d2('0x12')]['message']);}})[_0x57d2('0x13')](function(_0x4986ad){logger[_0x57d2('0xf')]('Trigger,\x20%s,\x20%s',_0x263d35,_0x4986ad);_0x49e3e5(_0x4986ad);});});}exports[_0x57d2('0x14')]=function(_0x7d4cf1){var _0x2ecfdf=this;return new Promise(function(_0x4a94e3,_0x525cfc){return db[_0x57d2('0x15')][_0x57d2('0x16')]({'raw':_0x7d4cf1[_0x57d2('0x17')]?_0x7d4cf1[_0x57d2('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x7d4cf1[_0x57d2('0x17')]?_0x7d4cf1[_0x57d2('0x17')]['where']||null:null,'attributes':_0x7d4cf1['options']?_0x7d4cf1[_0x57d2('0x17')][_0x57d2('0x18')]||null:null,'limit':_0x7d4cf1[_0x57d2('0x17')]?_0x7d4cf1[_0x57d2('0x17')][_0x57d2('0x19')]||null:null,'include':_0x7d4cf1[_0x57d2('0x17')]?_0x7d4cf1[_0x57d2('0x17')][_0x57d2('0x1a')]?_[_0x57d2('0x1b')](_0x7d4cf1[_0x57d2('0x17')][_0x57d2('0x1a')],function(_0x456fe1){return{'model':db[_0x456fe1[_0x57d2('0x1c')]],'as':_0x456fe1['as'],'attributes':_0x456fe1[_0x57d2('0x18')],'include':_0x456fe1['include']?_[_0x57d2('0x1b')](_0x456fe1[_0x57d2('0x1a')],function(_0x3c7de8){return{'model':db[_0x3c7de8[_0x57d2('0x1c')]],'as':_0x3c7de8['as'],'attributes':_0x3c7de8[_0x57d2('0x18')],'include':_0x3c7de8['include']?_[_0x57d2('0x1b')](_0x3c7de8[_0x57d2('0x1a')],function(_0x995928){return{'model':db[_0x995928[_0x57d2('0x1c')]],'as':_0x995928['as'],'attributes':_0x995928[_0x57d2('0x18')]};}):[]};}):[]};}):[]:[]})[_0x57d2('0x1d')](function(_0x9bdb11){logger['info'](_0x57d2('0x14'),_0x7d4cf1);logger[_0x57d2('0xb')](_0x57d2('0x14'),_0x7d4cf1,JSON[_0x57d2('0xe')](_0x9bdb11));_0x4a94e3(_0x9bdb11);})[_0x57d2('0x13')](function(_0x7c33f3){logger[_0x57d2('0xf')](_0x57d2('0x14'),_0x7c33f3[_0x57d2('0x11')],_0x7d4cf1);_0x525cfc(_0x2ecfdf[_0x57d2('0xf')](0x1f4,_0x7c33f3['message']));});});};exports[_0x57d2('0x1e')]=function(_0x3da926){var _0x26e052=this;return new Promise(function(_0x3e017c,_0x484597){return db[_0x57d2('0x15')][_0x57d2('0x1f')]({'raw':_0x3da926[_0x57d2('0x17')]?_0x3da926[_0x57d2('0x17')][_0x57d2('0x20')]===undefined?!![]:![]:!![],'where':_0x3da926[_0x57d2('0x17')]?_0x3da926[_0x57d2('0x17')][_0x57d2('0x21')]||null:null,'attributes':_0x3da926[_0x57d2('0x17')]?_0x3da926['options'][_0x57d2('0x18')]||null:null,'include':_0x3da926[_0x57d2('0x17')]?_0x3da926['options'][_0x57d2('0x1a')]?_[_0x57d2('0x1b')](_0x3da926['options'][_0x57d2('0x1a')],function(_0x1c4ea5){return{'model':db[_0x1c4ea5[_0x57d2('0x1c')]],'as':_0x1c4ea5['as'],'attributes':_0x1c4ea5[_0x57d2('0x18')],'include':_0x1c4ea5[_0x57d2('0x1a')]?_['map'](_0x1c4ea5['include'],function(_0x581ebc){return{'model':db[_0x581ebc['model']],'as':_0x581ebc['as'],'attributes':_0x581ebc[_0x57d2('0x18')],'include':_0x581ebc[_0x57d2('0x1a')]?_[_0x57d2('0x1b')](_0x581ebc[_0x57d2('0x1a')],function(_0x13beac){return{'model':db[_0x13beac['model']],'as':_0x13beac['as'],'attributes':_0x13beac[_0x57d2('0x18')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3378a6){logger[_0x57d2('0x9')](_0x57d2('0x1e'),_0x3da926);logger['debug'](_0x57d2('0x1e'),_0x3da926,JSON[_0x57d2('0xe')](_0x3378a6));_0x3e017c(_0x3378a6);})['catch'](function(_0xb33455){logger[_0x57d2('0xf')](_0x57d2('0x1e'),_0xb33455[_0x57d2('0x11')],_0x3da926);_0x484597(_0x26e052[_0x57d2('0xf')](0x1f4,_0xb33455[_0x57d2('0x11')]));});});};
\ No newline at end of file
+var _0xd7d1=['code','message','result','catch','GetTrigger','findAll','options','raw','attributes','limit','include','map','model','debug','Trigger','find','ShowTrigger','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','Trigger,\x20%s,\x20%s','request\x20sent','Trigger,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x22228c,_0x593e4d){var _0xf4ba54=function(_0x4c6fdb){while(--_0x4c6fdb){_0x22228c['push'](_0x22228c['shift']());}};_0xf4ba54(++_0x593e4d);}(_0xd7d1,0x1b3));var _0x1d7d=function(_0x5cd35c,_0x5f0b7c){_0x5cd35c=_0x5cd35c-0x0;var _0x41d74d=_0xd7d1[_0x5cd35c];return _0x41d74d;};'use strict';var _=require(_0x1d7d('0x0'));var util=require(_0x1d7d('0x1'));var moment=require(_0x1d7d('0x2'));var BPromise=require(_0x1d7d('0x3'));var rs=require(_0x1d7d('0x4'));var fs=require('fs');var Redis=require(_0x1d7d('0x5'));var db=require(_0x1d7d('0x6'))['db'];var utils=require(_0x1d7d('0x7'));var logger=require(_0x1d7d('0x8'))(_0x1d7d('0x9'));var config=require(_0x1d7d('0xa'));var jayson=require(_0x1d7d('0xb'));var client=jayson[_0x1d7d('0xc')]['http']({'port':0x232a});function respondWithRpcPromise(_0x462ef8,_0x1aa456,_0x14dbf6){return new BPromise(function(_0x3675a2,_0xd6189e){return client[_0x1d7d('0xd')](_0x462ef8,_0x14dbf6)[_0x1d7d('0xe')](function(_0xa44223){logger[_0x1d7d('0xf')](_0x1d7d('0x10'),_0x1aa456,_0x1d7d('0x11'));logger['debug'](_0x1d7d('0x12'),_0x1aa456,'request\x20sent',JSON[_0x1d7d('0x13')](_0xa44223));if(_0xa44223[_0x1d7d('0x14')]){if(_0xa44223[_0x1d7d('0x14')][_0x1d7d('0x15')]===0x1f4){logger['error'](_0x1d7d('0x10'),_0x1aa456,_0xa44223['error']['message']);return _0xd6189e(_0xa44223[_0x1d7d('0x14')][_0x1d7d('0x16')]);}logger['error']('Trigger,\x20%s,\x20%s',_0x1aa456,_0xa44223[_0x1d7d('0x14')][_0x1d7d('0x16')]);return _0x3675a2(_0xa44223[_0x1d7d('0x14')][_0x1d7d('0x16')]);}else{logger[_0x1d7d('0xf')]('Trigger,\x20%s,\x20%s',_0x1aa456,_0x1d7d('0x11'));_0x3675a2(_0xa44223[_0x1d7d('0x17')]['message']);}})[_0x1d7d('0x18')](function(_0x162c3a){logger[_0x1d7d('0x14')](_0x1d7d('0x10'),_0x1aa456,_0x162c3a);_0xd6189e(_0x162c3a);});});}exports[_0x1d7d('0x19')]=function(_0x4db4f2){var _0x664e3f=this;return new Promise(function(_0x191024,_0x5cbb8f){return db['Trigger'][_0x1d7d('0x1a')]({'raw':_0x4db4f2[_0x1d7d('0x1b')]?_0x4db4f2[_0x1d7d('0x1b')][_0x1d7d('0x1c')]===undefined?!![]:![]:!![],'where':_0x4db4f2[_0x1d7d('0x1b')]?_0x4db4f2[_0x1d7d('0x1b')]['where']||null:null,'attributes':_0x4db4f2[_0x1d7d('0x1b')]?_0x4db4f2[_0x1d7d('0x1b')][_0x1d7d('0x1d')]||null:null,'limit':_0x4db4f2['options']?_0x4db4f2[_0x1d7d('0x1b')][_0x1d7d('0x1e')]||null:null,'include':_0x4db4f2['options']?_0x4db4f2['options'][_0x1d7d('0x1f')]?_[_0x1d7d('0x20')](_0x4db4f2[_0x1d7d('0x1b')]['include'],function(_0x377653){return{'model':db[_0x377653[_0x1d7d('0x21')]],'as':_0x377653['as'],'attributes':_0x377653[_0x1d7d('0x1d')],'include':_0x377653[_0x1d7d('0x1f')]?_['map'](_0x377653[_0x1d7d('0x1f')],function(_0x151198){return{'model':db[_0x151198['model']],'as':_0x151198['as'],'attributes':_0x151198['attributes'],'include':_0x151198[_0x1d7d('0x1f')]?_['map'](_0x151198[_0x1d7d('0x1f')],function(_0x2d4de4){return{'model':db[_0x2d4de4[_0x1d7d('0x21')]],'as':_0x2d4de4['as'],'attributes':_0x2d4de4[_0x1d7d('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x1d7d('0xe')](function(_0x59f827){logger[_0x1d7d('0xf')](_0x1d7d('0x19'),_0x4db4f2);logger[_0x1d7d('0x22')]('GetTrigger',_0x4db4f2,JSON[_0x1d7d('0x13')](_0x59f827));_0x191024(_0x59f827);})[_0x1d7d('0x18')](function(_0x23ad85){logger['error']('GetTrigger',_0x23ad85['message'],_0x4db4f2);_0x5cbb8f(_0x664e3f[_0x1d7d('0x14')](0x1f4,_0x23ad85[_0x1d7d('0x16')]));});});};exports['ShowTrigger']=function(_0x1ebcbc){var _0x3e4136=this;return new Promise(function(_0x16a81d,_0x3336ab){return db[_0x1d7d('0x23')][_0x1d7d('0x24')]({'raw':_0x1ebcbc[_0x1d7d('0x1b')]?_0x1ebcbc[_0x1d7d('0x1b')][_0x1d7d('0x1c')]===undefined?!![]:![]:!![],'where':_0x1ebcbc[_0x1d7d('0x1b')]?_0x1ebcbc['options']['where']||null:null,'attributes':_0x1ebcbc[_0x1d7d('0x1b')]?_0x1ebcbc[_0x1d7d('0x1b')][_0x1d7d('0x1d')]||null:null,'include':_0x1ebcbc[_0x1d7d('0x1b')]?_0x1ebcbc[_0x1d7d('0x1b')][_0x1d7d('0x1f')]?_[_0x1d7d('0x20')](_0x1ebcbc[_0x1d7d('0x1b')][_0x1d7d('0x1f')],function(_0x47b6b2){return{'model':db[_0x47b6b2[_0x1d7d('0x21')]],'as':_0x47b6b2['as'],'attributes':_0x47b6b2[_0x1d7d('0x1d')],'include':_0x47b6b2[_0x1d7d('0x1f')]?_[_0x1d7d('0x20')](_0x47b6b2['include'],function(_0x4ee17f){return{'model':db[_0x4ee17f[_0x1d7d('0x21')]],'as':_0x4ee17f['as'],'attributes':_0x4ee17f[_0x1d7d('0x1d')],'include':_0x4ee17f['include']?_[_0x1d7d('0x20')](_0x4ee17f[_0x1d7d('0x1f')],function(_0x568092){return{'model':db[_0x568092['model']],'as':_0x568092['as'],'attributes':_0x568092[_0x1d7d('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x1d7d('0xe')](function(_0x406f57){logger[_0x1d7d('0xf')](_0x1d7d('0x25'),_0x1ebcbc);logger[_0x1d7d('0x22')](_0x1d7d('0x25'),_0x1ebcbc,JSON[_0x1d7d('0x13')](_0x406f57));_0x16a81d(_0x406f57);})[_0x1d7d('0x18')](function(_0x318b9a){logger['error']('ShowTrigger',_0x318b9a['message'],_0x1ebcbc);_0x3336ab(_0x3e4136['error'](0x1f4,_0x318b9a[_0x1d7d('0x16')]));});});};
\ No newline at end of file
diff --git a/server/api/trunk/index.js b/server/api/trunk/index.js
index ca4a6b9..a31fc14 100644
--- a/server/api/trunk/index.js
+++ b/server/api/trunk/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7217=['./trunk.controller','get','isAuthenticated','index','/:id','show','post','/:id/clone','clone','create','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service'];(function(_0x16a1dc,_0x2803a7){var _0x5dbe66=function(_0x29ea6d){while(--_0x29ea6d){_0x16a1dc['push'](_0x16a1dc['shift']());}};_0x5dbe66(++_0x2803a7);}(_0x7217,0x19e));var _0x7721=function(_0x1b828b,_0x344400){_0x1b828b=_0x1b828b-0x0;var _0x98da1a=_0x7217[_0x1b828b];return _0x98da1a;};'use strict';var multer=require(_0x7721('0x0'));var util=require('util');var path=require(_0x7721('0x1'));var timeout=require(_0x7721('0x2'));var express=require(_0x7721('0x3'));var router=express[_0x7721('0x4')]();var auth=require(_0x7721('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x7721('0x6'));router[_0x7721('0x7')]('/',auth[_0x7721('0x8')](),controller[_0x7721('0x9')]);router[_0x7721('0x7')](_0x7721('0xa'),auth[_0x7721('0x8')](),controller[_0x7721('0xb')]);router[_0x7721('0xc')](_0x7721('0xd'),auth[_0x7721('0x8')](),controller[_0x7721('0xe')]);router[_0x7721('0xc')]('/',auth[_0x7721('0x8')](),controller[_0x7721('0xf')]);router['put'](_0x7721('0xa'),auth[_0x7721('0x8')](),controller[_0x7721('0x10')]);router[_0x7721('0x11')](_0x7721('0xa'),auth[_0x7721('0x8')](),controller[_0x7721('0x12')]);module[_0x7721('0x13')]=router;
\ No newline at end of file
+var _0x032e=['post','/:id/clone','clone','create','update','delete','destroy','multer','path','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','./trunk.controller','get','isAuthenticated','index','/:id','show'];(function(_0x5afe96,_0x65407c){var _0x3841d0=function(_0xe0f9e0){while(--_0xe0f9e0){_0x5afe96['push'](_0x5afe96['shift']());}};_0x3841d0(++_0x65407c);}(_0x032e,0x124));var _0xe032=function(_0x56482c,_0x16118d){_0x56482c=_0x56482c-0x0;var _0x5aae7a=_0x032e[_0x56482c];return _0x5aae7a;};'use strict';var multer=require(_0xe032('0x0'));var util=require('util');var path=require(_0xe032('0x1'));var timeout=require(_0xe032('0x2'));var express=require('express');var router=express['Router']();var auth=require(_0xe032('0x3'));var interaction=require(_0xe032('0x4'));var config=require(_0xe032('0x5'));var controller=require(_0xe032('0x6'));router[_0xe032('0x7')]('/',auth[_0xe032('0x8')](),controller[_0xe032('0x9')]);router[_0xe032('0x7')](_0xe032('0xa'),auth[_0xe032('0x8')](),controller[_0xe032('0xb')]);router[_0xe032('0xc')](_0xe032('0xd'),auth[_0xe032('0x8')](),controller[_0xe032('0xe')]);router[_0xe032('0xc')]('/',auth[_0xe032('0x8')](),controller[_0xe032('0xf')]);router['put'](_0xe032('0xa'),auth[_0xe032('0x8')](),controller[_0xe032('0x10')]);router[_0xe032('0x11')](_0xe032('0xa'),auth[_0xe032('0x8')](),controller[_0xe032('0x12')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/trunk/trunk.attributes.js b/server/api/trunk/trunk.attributes.js
index bd9ffe4..b70c52e 100644
--- a/server/api/trunk/trunk.attributes.js
+++ b/server/api/trunk/trunk.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x27fe=['fingerprint','certificate','passive','actpass','dynamic','update,nonat','BOOLEAN','sequelize','STRING','name','from-voip-provider','ENUM','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','PROHIB','setDataValue','transport','join','getDataValue','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','info','shortinfo','inband','auto','yes','nonat','update','force_rport,comedia','nat','ulaw;alaw;gsm','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]','port,invite','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','INTEGER','\x22\x22\x20<>','always','accept','refuse','originate','uac','uas','pai'];(function(_0x110a0a,_0x2a797e){var _0x3f239b=function(_0x51c926){while(--_0x51c926){_0x110a0a['push'](_0x110a0a['shift']());}};_0x3f239b(++_0x2a797e);}(_0x27fe,0x9d));var _0xe27f=function(_0x481bf7,_0x437f69){_0x481bf7=_0x481bf7-0x0;var _0x461787=_0x27fe[_0x481bf7];return _0x461787;};'use strict';var Sequelize=require(_0xe27f('0x0'));module['exports']={'name':{'type':Sequelize[_0xe27f('0x1')],'allowNull':![],'unique':_0xe27f('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize['ENUM']('friend','user','peer'),'allowNull':![],'defaultValue':'friend'},'context':{'type':Sequelize[_0xe27f('0x1')],'allowNull':![],'defaultValue':_0xe27f('0x3')},'callingpres':{'type':Sequelize[_0xe27f('0x4')](_0xe27f('0x5'),_0xe27f('0x6'),_0xe27f('0x7'),_0xe27f('0x8'),_0xe27f('0x9'),_0xe27f('0xa'),_0xe27f('0xb'),_0xe27f('0xc'))},'deny':{'type':Sequelize['STRING']},'permit':{'type':Sequelize[_0xe27f('0x1')]},'secret':{'type':Sequelize[_0xe27f('0x1')]},'md5secret':{'type':Sequelize['STRING']},'remotesecret':{'type':Sequelize[_0xe27f('0x1')]},'transport':{'type':Sequelize[_0xe27f('0x1')],'defaultValue':'udp','set':function(_0x32c066){this[_0xe27f('0xd')](_0xe27f('0xe'),_0x32c066?_0x32c066[_0xe27f('0xf')](','):null);},'get':function(){return this[_0xe27f('0x10')]('transport')?this[_0xe27f('0x10')](_0xe27f('0xe'))[_0xe27f('0x11')](','):null;},'comment':_0xe27f('0x12')},'dtmfmode':{'type':Sequelize[_0xe27f('0x4')]('rfc2833',_0xe27f('0x13'),_0xe27f('0x14'),_0xe27f('0x15'),_0xe27f('0x16')),'defaultValue':'rfc2833'},'directmedia':{'type':Sequelize[_0xe27f('0x4')](_0xe27f('0x17'),'no',_0xe27f('0x18'),_0xe27f('0x19'),'outgoing'),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0xe27f('0x4')]('yes','no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0xe27f('0x1')]},'directmediadeny':{'type':Sequelize[_0xe27f('0x1')]},'nat':{'type':Sequelize[_0xe27f('0x1')],'defaultValue':_0xe27f('0x1a'),'set':function(_0x128638){this[_0xe27f('0xd')](_0xe27f('0x1b'),_0x128638?_0x128638['join'](','):null);},'get':function(){return this[_0xe27f('0x10')]('nat')?this[_0xe27f('0x10')](_0xe27f('0x1b'))[_0xe27f('0x11')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]'},'callgroup':{'type':Sequelize[_0xe27f('0x1')]},'namedcallgroup':{'type':Sequelize[_0xe27f('0x1')]},'pickupgroup':{'type':Sequelize[_0xe27f('0x1')]},'namedpickupgroup':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0xe27f('0x1')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0xe27f('0x1')],'allowNull':!![]},'disallow':{'type':Sequelize['STRING'],'defaultValue':'all'},'allow':{'type':Sequelize[_0xe27f('0x1')],'allowNull':![],'defaultValue':_0xe27f('0x1c'),'set':function(_0x240f59){this['setDataValue'](_0xe27f('0x1d'),_0x240f59?_0x240f59[_0xe27f('0xf')](';'):_0xe27f('0x1c'));},'get':function(){return this[_0xe27f('0x10')](_0xe27f('0x1d'))?this[_0xe27f('0x10')](_0xe27f('0x1d'))[_0xe27f('0x11')](';'):null;},'comment':_0xe27f('0x1e')},'autoframing':{'type':Sequelize['ENUM'](_0xe27f('0x17'),'no')},'insecure':{'type':Sequelize['STRING'],'defaultValue':_0xe27f('0x1f'),'set':function(_0x155881){this[_0xe27f('0xd')]('insecure',_0x155881?_0x155881['join'](','):null);},'get':function(){return this[_0xe27f('0x10')]('insecure')?this[_0xe27f('0x10')](_0xe27f('0x20'))[_0xe27f('0x11')](','):null;},'comment':_0xe27f('0x21')},'trustrpid':{'type':Sequelize[_0xe27f('0x4')](_0xe27f('0x17'),'no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0xe27f('0x4')]('yes','no'),'defaultValue':'no'},'progressinband':{'type':Sequelize[_0xe27f('0x4')]('yes','no','never')},'promiscredir':{'type':Sequelize['ENUM'](_0xe27f('0x17'),'no')},'useclientcode':{'type':Sequelize[_0xe27f('0x4')](_0xe27f('0x17'),'no')},'accountcode':{'type':Sequelize[_0xe27f('0x22')](0xb)},'setvar':{'type':Sequelize[_0xe27f('0x1')]},'callerid':{'type':Sequelize['STRING'],'defaultValue':_0xe27f('0x23')},'amaflags':{'type':Sequelize[_0xe27f('0x1')]},'callcounter':{'type':Sequelize['ENUM'](_0xe27f('0x17'),'no'),'defaultValue':_0xe27f('0x17')},'busylevel':{'type':Sequelize[_0xe27f('0x22')](0xb)},'allowoverlap':{'type':Sequelize['ENUM'](_0xe27f('0x17'),'no')},'allowsubscribe':{'type':Sequelize[_0xe27f('0x4')](_0xe27f('0x17'),'no')},'allowtransfer':{'type':Sequelize['ENUM'](_0xe27f('0x17'),'no')},'ignoresdpversion':{'type':Sequelize[_0xe27f('0x4')]('yes','no')},'subscribecontext':{'type':Sequelize[_0xe27f('0x1')]},'template':{'type':Sequelize[_0xe27f('0x1')]},'videosupport':{'type':Sequelize[_0xe27f('0x4')](_0xe27f('0x17'),'no',_0xe27f('0x24')),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0xe27f('0x22')](0xb)},'rfc2833compensate':{'type':Sequelize['ENUM'](_0xe27f('0x17'),'no')},'mailbox':{'type':Sequelize[_0xe27f('0x1')]},'session_timers':{'type':Sequelize['ENUM'](_0xe27f('0x25'),_0xe27f('0x26'),_0xe27f('0x27'))},'session_expires':{'type':Sequelize[_0xe27f('0x22')](0xb)},'session_minse':{'type':Sequelize['INTEGER'](0xb)},'session_refresher':{'type':Sequelize[_0xe27f('0x4')](_0xe27f('0x28'),_0xe27f('0x29')),'defaultValue':_0xe27f('0x29')},'t38pt_usertpsource':{'type':Sequelize['STRING']},'regexten':{'type':Sequelize['STRING']},'fromdomain':{'type':Sequelize[_0xe27f('0x1')]},'fromuser':{'type':Sequelize['STRING']},'port':{'type':Sequelize[_0xe27f('0x22')](0x5)},'qualify':{'type':Sequelize['ENUM'](_0xe27f('0x17'),'no'),'defaultValue':_0xe27f('0x17')},'keepalive':{'type':Sequelize[_0xe27f('0x22')](0xb)},'defaultip':{'type':Sequelize[_0xe27f('0x1')]},'defaultuser':{'type':Sequelize[_0xe27f('0x1')]},'rtptimeout':{'type':Sequelize[_0xe27f('0x22')](0xb)},'rtpholdtimeout':{'type':Sequelize[_0xe27f('0x22')](0xb)},'rtpkeepalive':{'type':Sequelize[_0xe27f('0x22')](0xb)},'sendrpid':{'type':Sequelize[_0xe27f('0x4')](_0xe27f('0x17'),'no',_0xe27f('0x2a')),'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0xe27f('0x1')]},'callbackextension':{'type':Sequelize[_0xe27f('0x1')]},'timert1':{'type':Sequelize[_0xe27f('0x22')](0xb)},'timerb':{'type':Sequelize[_0xe27f('0x22')](0xb)},'qualifyfreq':{'type':Sequelize[_0xe27f('0x22')](0xb)},'contactpermit':{'type':Sequelize[_0xe27f('0x1')]},'contactdeny':{'type':Sequelize[_0xe27f('0x1')]},'contactacl':{'type':Sequelize[_0xe27f('0x1')]},'unsolicited_mailbox':{'type':Sequelize[_0xe27f('0x1')]},'use_q850_reason':{'type':Sequelize['STRING']},'maxforwards':{'type':Sequelize[_0xe27f('0x22')](0xb)},'encryption':{'type':Sequelize[_0xe27f('0x4')](_0xe27f('0x17'),'no'),'defaultValue':'no'},'avpf':{'type':Sequelize[_0xe27f('0x4')](_0xe27f('0x17'),'no')},'force_avp':{'type':Sequelize[_0xe27f('0x4')](_0xe27f('0x17'),'no')},'icesupport':{'type':Sequelize[_0xe27f('0x4')](_0xe27f('0x17'),'no')},'dtlsenable':{'type':Sequelize['ENUM'](_0xe27f('0x17'),'no')},'dtlsverify':{'type':Sequelize[_0xe27f('0x4')](_0xe27f('0x17'),'no',_0xe27f('0x2b'),_0xe27f('0x2c'))},'dtlsrekey':{'type':Sequelize[_0xe27f('0x22')](0xb)},'dtlscertfile':{'type':Sequelize[_0xe27f('0x1')]},'dtlsprivatekey':{'type':Sequelize[_0xe27f('0x1')]},'dtlscipher':{'type':Sequelize[_0xe27f('0x1')]},'dtlscafile':{'type':Sequelize[_0xe27f('0x1')]},'dtlscapath':{'type':Sequelize[_0xe27f('0x1')]},'dtlssetup':{'type':Sequelize[_0xe27f('0x4')]('active',_0xe27f('0x2d'),_0xe27f('0x2e')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize['STRING']},'usereqphone':{'type':Sequelize['ENUM'](_0xe27f('0x17'),'no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0xe27f('0x1')]},'recordofffeature':{'type':Sequelize[_0xe27f('0x1')]},'call_limit':{'type':Sequelize[_0xe27f('0x22')](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize[_0xe27f('0x4')](_0xe27f('0x17'),'no')},'subscribemwi':{'type':Sequelize['ENUM'](_0xe27f('0x17'),'no')},'vmexten':{'type':Sequelize['STRING']},'mohinterpret':{'type':Sequelize[_0xe27f('0x1')]},'mohsuggest':{'type':Sequelize[_0xe27f('0x1')]},'parkinglot':{'type':Sequelize[_0xe27f('0x1')]},'description':{'type':Sequelize[_0xe27f('0x1')]},'host':{'type':Sequelize[_0xe27f('0x1')],'defaultValue':_0xe27f('0x2f')},'canreinvite':{'type':Sequelize[_0xe27f('0x4')]('yes','no','nonat',_0xe27f('0x19'),_0xe27f('0x30')),'defaultValue':'no'},'registry':{'type':Sequelize[_0xe27f('0x1')]},'otherFields':{'type':Sequelize['STRING']},'active':{'type':Sequelize[_0xe27f('0x31')],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize[_0xe27f('0x1')],'defaultValue':'no'}};
\ No newline at end of file
+var _0xd8c5=['update,nonat','BOOLEAN','sequelize','exports','STRING','friend','user','from-voip-provider','ENUM','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','udp','setDataValue','transport','join','getDataValue','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','info','shortinfo','inband','auto','yes','nonat','update','force_rport,comedia','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','ulaw;alaw;gsm','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]','port,invite','insecure','never','INTEGER','\x22\x22\x20<>','accept','refuse','originate','uac','uas','pai','certificate','active','passive','dynamic'];(function(_0x2f9d3e,_0x29345f){var _0x32d8e6=function(_0x9f63fc){while(--_0x9f63fc){_0x2f9d3e['push'](_0x2f9d3e['shift']());}};_0x32d8e6(++_0x29345f);}(_0xd8c5,0x1c4));var _0x5d8c=function(_0x21649f,_0x25743b){_0x21649f=_0x21649f-0x0;var _0x2f7203=_0xd8c5[_0x21649f];return _0x2f7203;};'use strict';var Sequelize=require(_0x5d8c('0x0'));module[_0x5d8c('0x1')]={'name':{'type':Sequelize[_0x5d8c('0x2')],'allowNull':![],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize['ENUM'](_0x5d8c('0x3'),_0x5d8c('0x4'),'peer'),'allowNull':![],'defaultValue':_0x5d8c('0x3')},'context':{'type':Sequelize[_0x5d8c('0x2')],'allowNull':![],'defaultValue':_0x5d8c('0x5')},'callingpres':{'type':Sequelize[_0x5d8c('0x6')](_0x5d8c('0x7'),_0x5d8c('0x8'),_0x5d8c('0x9'),'ALLOWED','PROHIB_NOT_SCREENED',_0x5d8c('0xa'),_0x5d8c('0xb'),'PROHIB')},'deny':{'type':Sequelize[_0x5d8c('0x2')]},'permit':{'type':Sequelize[_0x5d8c('0x2')]},'secret':{'type':Sequelize[_0x5d8c('0x2')]},'md5secret':{'type':Sequelize[_0x5d8c('0x2')]},'remotesecret':{'type':Sequelize['STRING']},'transport':{'type':Sequelize['STRING'],'defaultValue':_0x5d8c('0xc'),'set':function(_0x505ea1){this[_0x5d8c('0xd')](_0x5d8c('0xe'),_0x505ea1?_0x505ea1[_0x5d8c('0xf')](','):null);},'get':function(){return this[_0x5d8c('0x10')](_0x5d8c('0xe'))?this[_0x5d8c('0x10')]('transport')[_0x5d8c('0x11')](','):null;},'comment':_0x5d8c('0x12')},'dtmfmode':{'type':Sequelize[_0x5d8c('0x6')](_0x5d8c('0x13'),_0x5d8c('0x14'),_0x5d8c('0x15'),_0x5d8c('0x16'),_0x5d8c('0x17')),'defaultValue':'rfc2833'},'directmedia':{'type':Sequelize[_0x5d8c('0x6')](_0x5d8c('0x18'),'no',_0x5d8c('0x19'),_0x5d8c('0x1a'),'outgoing'),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x5d8c('0x6')](_0x5d8c('0x18'),'no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x5d8c('0x2')]},'directmediadeny':{'type':Sequelize['STRING']},'nat':{'type':Sequelize[_0x5d8c('0x2')],'defaultValue':_0x5d8c('0x1b'),'set':function(_0x16385f){this['setDataValue'](_0x5d8c('0x1c'),_0x16385f?_0x16385f[_0x5d8c('0xf')](','):null);},'get':function(){return this[_0x5d8c('0x10')]('nat')?this[_0x5d8c('0x10')](_0x5d8c('0x1c'))[_0x5d8c('0x11')](','):null;},'comment':_0x5d8c('0x1d')},'callgroup':{'type':Sequelize[_0x5d8c('0x2')]},'namedcallgroup':{'type':Sequelize[_0x5d8c('0x2')]},'pickupgroup':{'type':Sequelize['STRING']},'namedpickupgroup':{'type':Sequelize[_0x5d8c('0x2')]},'language':{'type':Sequelize['STRING'],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x5d8c('0x2')],'allowNull':!![]},'disallow':{'type':Sequelize[_0x5d8c('0x2')],'defaultValue':'all'},'allow':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x5d8c('0x1e'),'set':function(_0x39f964){this[_0x5d8c('0xd')](_0x5d8c('0x1f'),_0x39f964?_0x39f964[_0x5d8c('0xf')](';'):_0x5d8c('0x1e'));},'get':function(){return this['getDataValue'](_0x5d8c('0x1f'))?this[_0x5d8c('0x10')](_0x5d8c('0x1f'))[_0x5d8c('0x11')](';'):null;},'comment':_0x5d8c('0x20')},'autoframing':{'type':Sequelize[_0x5d8c('0x6')](_0x5d8c('0x18'),'no')},'insecure':{'type':Sequelize[_0x5d8c('0x2')],'defaultValue':_0x5d8c('0x21'),'set':function(_0x493c65){this[_0x5d8c('0xd')](_0x5d8c('0x22'),_0x493c65?_0x493c65[_0x5d8c('0xf')](','):null);},'get':function(){return this[_0x5d8c('0x10')](_0x5d8c('0x22'))?this['getDataValue'](_0x5d8c('0x22'))['split'](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]'},'trustrpid':{'type':Sequelize[_0x5d8c('0x6')](_0x5d8c('0x18'),'no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x5d8c('0x6')](_0x5d8c('0x18'),'no'),'defaultValue':'no'},'progressinband':{'type':Sequelize['ENUM']('yes','no',_0x5d8c('0x23'))},'promiscredir':{'type':Sequelize[_0x5d8c('0x6')](_0x5d8c('0x18'),'no')},'useclientcode':{'type':Sequelize[_0x5d8c('0x6')](_0x5d8c('0x18'),'no')},'accountcode':{'type':Sequelize[_0x5d8c('0x24')](0xb)},'setvar':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize[_0x5d8c('0x2')],'defaultValue':_0x5d8c('0x25')},'amaflags':{'type':Sequelize['STRING']},'callcounter':{'type':Sequelize[_0x5d8c('0x6')](_0x5d8c('0x18'),'no'),'defaultValue':_0x5d8c('0x18')},'busylevel':{'type':Sequelize['INTEGER'](0xb)},'allowoverlap':{'type':Sequelize['ENUM'](_0x5d8c('0x18'),'no')},'allowsubscribe':{'type':Sequelize[_0x5d8c('0x6')]('yes','no')},'allowtransfer':{'type':Sequelize[_0x5d8c('0x6')](_0x5d8c('0x18'),'no')},'ignoresdpversion':{'type':Sequelize[_0x5d8c('0x6')](_0x5d8c('0x18'),'no')},'subscribecontext':{'type':Sequelize[_0x5d8c('0x2')]},'template':{'type':Sequelize[_0x5d8c('0x2')]},'videosupport':{'type':Sequelize[_0x5d8c('0x6')](_0x5d8c('0x18'),'no','always'),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x5d8c('0x24')](0xb)},'rfc2833compensate':{'type':Sequelize[_0x5d8c('0x6')](_0x5d8c('0x18'),'no')},'mailbox':{'type':Sequelize['STRING']},'session_timers':{'type':Sequelize['ENUM'](_0x5d8c('0x26'),_0x5d8c('0x27'),_0x5d8c('0x28'))},'session_expires':{'type':Sequelize['INTEGER'](0xb)},'session_minse':{'type':Sequelize['INTEGER'](0xb)},'session_refresher':{'type':Sequelize[_0x5d8c('0x6')](_0x5d8c('0x29'),_0x5d8c('0x2a')),'defaultValue':_0x5d8c('0x2a')},'t38pt_usertpsource':{'type':Sequelize[_0x5d8c('0x2')]},'regexten':{'type':Sequelize[_0x5d8c('0x2')]},'fromdomain':{'type':Sequelize[_0x5d8c('0x2')]},'fromuser':{'type':Sequelize['STRING']},'port':{'type':Sequelize['INTEGER'](0x5)},'qualify':{'type':Sequelize[_0x5d8c('0x6')](_0x5d8c('0x18'),'no'),'defaultValue':'yes'},'keepalive':{'type':Sequelize[_0x5d8c('0x24')](0xb)},'defaultip':{'type':Sequelize[_0x5d8c('0x2')]},'defaultuser':{'type':Sequelize[_0x5d8c('0x2')]},'rtptimeout':{'type':Sequelize[_0x5d8c('0x24')](0xb)},'rtpholdtimeout':{'type':Sequelize[_0x5d8c('0x24')](0xb)},'rtpkeepalive':{'type':Sequelize[_0x5d8c('0x24')](0xb)},'sendrpid':{'type':Sequelize[_0x5d8c('0x6')](_0x5d8c('0x18'),'no',_0x5d8c('0x2b')),'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x5d8c('0x2')]},'callbackextension':{'type':Sequelize['STRING']},'timert1':{'type':Sequelize['INTEGER'](0xb)},'timerb':{'type':Sequelize[_0x5d8c('0x24')](0xb)},'qualifyfreq':{'type':Sequelize[_0x5d8c('0x24')](0xb)},'contactpermit':{'type':Sequelize[_0x5d8c('0x2')]},'contactdeny':{'type':Sequelize[_0x5d8c('0x2')]},'contactacl':{'type':Sequelize[_0x5d8c('0x2')]},'unsolicited_mailbox':{'type':Sequelize[_0x5d8c('0x2')]},'use_q850_reason':{'type':Sequelize[_0x5d8c('0x2')]},'maxforwards':{'type':Sequelize['INTEGER'](0xb)},'encryption':{'type':Sequelize['ENUM'](_0x5d8c('0x18'),'no'),'defaultValue':'no'},'avpf':{'type':Sequelize['ENUM'](_0x5d8c('0x18'),'no')},'force_avp':{'type':Sequelize[_0x5d8c('0x6')](_0x5d8c('0x18'),'no')},'icesupport':{'type':Sequelize[_0x5d8c('0x6')]('yes','no')},'dtlsenable':{'type':Sequelize[_0x5d8c('0x6')](_0x5d8c('0x18'),'no')},'dtlsverify':{'type':Sequelize[_0x5d8c('0x6')]('yes','no','fingerprint',_0x5d8c('0x2c'))},'dtlsrekey':{'type':Sequelize[_0x5d8c('0x24')](0xb)},'dtlscertfile':{'type':Sequelize[_0x5d8c('0x2')]},'dtlsprivatekey':{'type':Sequelize[_0x5d8c('0x2')]},'dtlscipher':{'type':Sequelize[_0x5d8c('0x2')]},'dtlscafile':{'type':Sequelize[_0x5d8c('0x2')]},'dtlscapath':{'type':Sequelize[_0x5d8c('0x2')]},'dtlssetup':{'type':Sequelize['ENUM'](_0x5d8c('0x2d'),_0x5d8c('0x2e'),'actpass'),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x5d8c('0x2')]},'usereqphone':{'type':Sequelize[_0x5d8c('0x6')](_0x5d8c('0x18'),'no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x5d8c('0x2')]},'recordofffeature':{'type':Sequelize['STRING']},'call_limit':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize['ENUM'](_0x5d8c('0x18'),'no')},'subscribemwi':{'type':Sequelize['ENUM'](_0x5d8c('0x18'),'no')},'vmexten':{'type':Sequelize['STRING']},'mohinterpret':{'type':Sequelize['STRING']},'mohsuggest':{'type':Sequelize['STRING']},'parkinglot':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x5d8c('0x2')]},'host':{'type':Sequelize[_0x5d8c('0x2')],'defaultValue':_0x5d8c('0x2f')},'canreinvite':{'type':Sequelize['ENUM']('yes','no','nonat','update',_0x5d8c('0x30')),'defaultValue':'no'},'registry':{'type':Sequelize[_0x5d8c('0x2')]},'otherFields':{'type':Sequelize[_0x5d8c('0x2')]},'active':{'type':Sequelize[_0x5d8c('0x31')],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize['STRING'],'defaultValue':'no'}};
\ No newline at end of file
diff --git a/server/api/trunk/trunk.controller.js b/server/api/trunk/trunk.controller.js
index d944721..79cb748 100644
--- a/server/api/trunk/trunk.controller.js
+++ b/server/api/trunk/trunk.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x1eba=['render','/etc/asterisk/sip_xcally_trunks.conf','writeFileSync','/etc/asterisk/sip_xcally_registers.conf','Reload','chan_sip.so','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','server/files/templates/trunk.ejs','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','jayson/promise','client','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','info','Trunk,\x20%s,\x20%s','request\x20sent','Trunk,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','count','offset','limit','set','Content-Range','json','apply','reject','save','update','then','destroy','get','UserProfileResource','stack','name','send','index','map','Trunk','rawAttributes','type','key','model','keys','query','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','show','params','length','find','clone','omit','createdAt','updatedAt','body','user','role','Trunks','autoAssociation','create','readFileSync','join','root','utf8','server/files/templates/registry.ejs'];(function(_0x2a67fe,_0x295c09){var _0x57e726=function(_0x280573){while(--_0x280573){_0x2a67fe['push'](_0x2a67fe['shift']());}};_0x57e726(++_0x295c09);}(_0x1eba,0x1d7));var _0xa1eb=function(_0xccf869,_0x2556a5){_0xccf869=_0xccf869-0x0;var _0x21a9db=_0x1eba[_0xccf869];return _0x21a9db;};'use strict';var pdf=require(_0xa1eb('0x0'));var emlformat=require(_0xa1eb('0x1'));var rimraf=require(_0xa1eb('0x2'));var zipdir=require(_0xa1eb('0x3'));var jsonpatch=require(_0xa1eb('0x4'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xa1eb('0x5'));var Mustache=require(_0xa1eb('0x6'));var util=require(_0xa1eb('0x7'));var path=require(_0xa1eb('0x8'));var sox=require(_0xa1eb('0x9'));var csv=require(_0xa1eb('0xa'));var ejs=require(_0xa1eb('0xb'));var fs=require('fs');var _=require(_0xa1eb('0xc'));var squel=require(_0xa1eb('0xd'));var crypto=require(_0xa1eb('0xe'));var jsforce=require(_0xa1eb('0xf'));var deskjs=require(_0xa1eb('0x10'));var toCsv=require('to-csv');var querystring=require(_0xa1eb('0x11'));var Papa=require('papaparse');var Redis=require(_0xa1eb('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xa1eb('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa1eb('0x14'));var logger=require('../../config/logger')(_0xa1eb('0x15'));var utils=require(_0xa1eb('0x16'));var config=require(_0xa1eb('0x17'));var db=require('../../mysqldb')['db'];var jayson=require(_0xa1eb('0x18'));var client=jayson[_0xa1eb('0x19')]['http']({'port':0x232a});function checkPasswordPattern(_0x16a623,_0x4a3774,_0x4e65dc){if(_0x4e65dc){var _0x35a353=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x35a353['test'](_0x4a3774)){return _0x16a623;}else{throw new db[(_0xa1eb('0x1a'))][(_0xa1eb('0x1b'))](_0xa1eb('0x1c'));}}else{return _0x16a623;}}function respondWithRpcPromise(_0x2877cb,_0x3cd675,_0x44f37d,_0x1c858c){return new BPromise(function(_0x45d6dd,_0x211e42){var _0x4aa527=_0x1c858c||client;return _0x4aa527[_0xa1eb('0x1d')](_0x2877cb,_0x44f37d)['then'](function(_0x1401ef){logger[_0xa1eb('0x1e')](_0xa1eb('0x1f'),_0x3cd675,_0xa1eb('0x20'));logger['debug'](_0xa1eb('0x21'),_0x3cd675,_0xa1eb('0x20'),JSON[_0xa1eb('0x22')](_0x1401ef));if(_0x1401ef[_0xa1eb('0x23')]){if(_0x1401ef[_0xa1eb('0x23')][_0xa1eb('0x24')]===0x1f4){logger[_0xa1eb('0x23')](_0xa1eb('0x1f'),_0x3cd675,_0x1401ef['error'][_0xa1eb('0x25')]);return _0x211e42(_0x1401ef['error'][_0xa1eb('0x25')]);}logger[_0xa1eb('0x23')](_0xa1eb('0x1f'),_0x3cd675,_0x1401ef[_0xa1eb('0x23')]['message']);return _0x45d6dd(_0x1401ef['error'][_0xa1eb('0x25')]);}else{logger[_0xa1eb('0x1e')]('Trunk,\x20%s,\x20%s',_0x3cd675,_0xa1eb('0x20'));_0x45d6dd(_0x1401ef[_0xa1eb('0x26')][_0xa1eb('0x25')]);}})[_0xa1eb('0x27')](function(_0x23b49e){logger[_0xa1eb('0x23')](_0xa1eb('0x1f'),_0x3cd675,_0x23b49e);_0x211e42(_0x23b49e);});});}function respondWithStatusCode(_0x364b1c,_0xd7bb88){_0xd7bb88=_0xd7bb88||0xcc;return function(_0x352796){if(_0x352796){return _0x364b1c[_0xa1eb('0x28')](_0xd7bb88);}return _0x364b1c[_0xa1eb('0x29')](_0xd7bb88)['end']();};}function respondWithResult(_0x7c617e,_0xbd5517){_0xbd5517=_0xbd5517||0xc8;return function(_0x491f37){if(_0x491f37){return _0x7c617e[_0xa1eb('0x29')](_0xbd5517)['json'](_0x491f37);}};}function respondWithFilteredResult(_0x3aae71,_0x2d31d1){return function(_0x53a890){if(_0x53a890){var _0x45ff0d=_0x53a890[_0xa1eb('0x2a')],_0x1581ee=_0x2d31d1[_0xa1eb('0x2b')],_0x136835=_0x2d31d1['offset']+_0x2d31d1[_0xa1eb('0x2c')],_0x4f64bb;if(_0x136835>=_0x45ff0d){_0x136835=_0x45ff0d;_0x4f64bb=0xc8;}else{_0x4f64bb=0xce;}_0x3aae71[_0xa1eb('0x29')](_0x4f64bb);return _0x3aae71[_0xa1eb('0x2d')](_0xa1eb('0x2e'),_0x1581ee+'-'+_0x136835+'/'+_0x45ff0d)[_0xa1eb('0x2f')](_0x53a890);}return null;};}function patchUpdates(_0x52f9c7){return function(_0x9d49d8){try{jsonpatch[_0xa1eb('0x30')](_0x9d49d8,_0x52f9c7,!![]);}catch(_0x198fdb){return BPromise[_0xa1eb('0x31')](_0x198fdb);}return _0x9d49d8[_0xa1eb('0x32')]();};}function saveUpdates(_0xcd9efd,_0x1d5b64){return function(_0xcfda64){if(_0xcfda64){return _0xcfda64[_0xa1eb('0x33')](_0xcd9efd)[_0xa1eb('0x34')](function(_0x4345a3){return _0x4345a3;});}return null;};}function removeEntity(_0x4fdba4,_0x563b11){return function(_0x126d50){if(_0x126d50){return _0x126d50[_0xa1eb('0x35')]()[_0xa1eb('0x34')](function(){var _0x36cc2a=_0x126d50[_0xa1eb('0x36')]({'plain':!![]});var _0x58d336='Trunks';return db[_0xa1eb('0x37')][_0xa1eb('0x35')]({'where':{'type':_0x58d336,'resourceId':_0x36cc2a['id']}})['then'](function(){return _0x126d50;});})['then'](function(){_0x4fdba4[_0xa1eb('0x29')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1f33dc,_0x534fe4){return function(_0x47737d){if(!_0x47737d){_0x1f33dc[_0xa1eb('0x28')](0x194);}return _0x47737d;};}function handleError(_0x229931,_0x57355f){_0x57355f=_0x57355f||0x1f4;return function(_0x355839){logger[_0xa1eb('0x23')](_0x355839[_0xa1eb('0x38')]);if(_0x355839['name']){delete _0x355839[_0xa1eb('0x39')];}_0x229931[_0xa1eb('0x29')](_0x57355f)[_0xa1eb('0x3a')](_0x355839);};}exports[_0xa1eb('0x3b')]=function(_0x3c3982,_0x5912d5){var _0x53bf02={},_0x28cfa3={},_0x46374c={'count':0x0,'rows':[]};var _0x3f9486=_[_0xa1eb('0x3c')](db[_0xa1eb('0x3d')][_0xa1eb('0x3e')],function(_0x3f6b47){return{'name':_0x3f6b47['fieldName'],'type':_0x3f6b47[_0xa1eb('0x3f')][_0xa1eb('0x40')]};});_0x28cfa3[_0xa1eb('0x41')]=_[_0xa1eb('0x3c')](_0x3f9486,_0xa1eb('0x39'));_0x28cfa3['query']=_[_0xa1eb('0x42')](_0x3c3982[_0xa1eb('0x43')]);_0x28cfa3[_0xa1eb('0x44')]=_['intersection'](_0x28cfa3[_0xa1eb('0x41')],_0x28cfa3[_0xa1eb('0x43')]);_0x53bf02[_0xa1eb('0x45')]=_[_0xa1eb('0x46')](_0x28cfa3[_0xa1eb('0x41')],qs[_0xa1eb('0x47')](_0x3c3982[_0xa1eb('0x43')]['fields']));_0x53bf02[_0xa1eb('0x45')]=_0x53bf02[_0xa1eb('0x45')]['length']?_0x53bf02[_0xa1eb('0x45')]:_0x28cfa3['model'];if(!_0x3c3982[_0xa1eb('0x43')][_0xa1eb('0x48')](_0xa1eb('0x49'))){_0x53bf02[_0xa1eb('0x2c')]=qs[_0xa1eb('0x2c')](_0x3c3982[_0xa1eb('0x43')][_0xa1eb('0x2c')]);_0x53bf02[_0xa1eb('0x2b')]=qs[_0xa1eb('0x2b')](_0x3c3982[_0xa1eb('0x43')][_0xa1eb('0x2b')]);}_0x53bf02[_0xa1eb('0x4a')]=qs[_0xa1eb('0x4b')](_0x3c3982[_0xa1eb('0x43')][_0xa1eb('0x4b')]);_0x53bf02[_0xa1eb('0x4c')]=qs['filters'](_[_0xa1eb('0x4d')](_0x3c3982['query'],_0x28cfa3[_0xa1eb('0x44')]),_0x3f9486);if(_0x3c3982[_0xa1eb('0x43')]['filter']){_0x53bf02['where']=_[_0xa1eb('0x4e')](_0x53bf02[_0xa1eb('0x4c')],{'$or':_[_0xa1eb('0x3c')](_0x3f9486,function(_0x55c770){if(_0x55c770[_0xa1eb('0x3f')]!==_0xa1eb('0x4f')){var _0x26862a={};_0x26862a[_0x55c770[_0xa1eb('0x39')]]={'$like':'%'+_0x3c3982[_0xa1eb('0x43')][_0xa1eb('0x50')]+'%'};return _0x26862a;}})});}_0x53bf02=_[_0xa1eb('0x4e')]({},_0x53bf02,_0x3c3982[_0xa1eb('0x51')]);var _0xf6da59={'where':_0x53bf02[_0xa1eb('0x4c')]};return db[_0xa1eb('0x3d')][_0xa1eb('0x2a')](_0xf6da59)[_0xa1eb('0x34')](function(_0x10e15a){_0x46374c['count']=_0x10e15a;if(_0x3c3982[_0xa1eb('0x43')][_0xa1eb('0x52')]){_0x53bf02[_0xa1eb('0x53')]=[{'all':!![]}];}return db[_0xa1eb('0x3d')][_0xa1eb('0x54')](_0x53bf02);})[_0xa1eb('0x34')](function(_0x2374c0){_0x46374c['rows']=_0x2374c0;return _0x46374c;})[_0xa1eb('0x34')](respondWithFilteredResult(_0x5912d5,_0x53bf02))[_0xa1eb('0x27')](handleError(_0x5912d5,null));};exports[_0xa1eb('0x55')]=function(_0x10a6da,_0x8975a1){var _0x1302f6={'raw':![],'where':{'id':_0x10a6da[_0xa1eb('0x56')]['id']}},_0x25e146={};_0x25e146[_0xa1eb('0x41')]=_['keys'](db[_0xa1eb('0x3d')]['rawAttributes']);_0x25e146[_0xa1eb('0x43')]=_['keys'](_0x10a6da[_0xa1eb('0x43')]);_0x25e146[_0xa1eb('0x44')]=_[_0xa1eb('0x46')](_0x25e146['model'],_0x25e146[_0xa1eb('0x43')]);_0x1302f6[_0xa1eb('0x45')]=_['intersection'](_0x25e146[_0xa1eb('0x41')],qs[_0xa1eb('0x47')](_0x10a6da[_0xa1eb('0x43')][_0xa1eb('0x47')]));_0x1302f6[_0xa1eb('0x45')]=_0x1302f6[_0xa1eb('0x45')][_0xa1eb('0x57')]?_0x1302f6[_0xa1eb('0x45')]:_0x25e146[_0xa1eb('0x41')];if(_0x10a6da[_0xa1eb('0x43')][_0xa1eb('0x52')]){_0x1302f6[_0xa1eb('0x53')]=[{'all':!![]}];}_0x1302f6=_[_0xa1eb('0x4e')]({},_0x1302f6,_0x10a6da[_0xa1eb('0x51')]);return db[_0xa1eb('0x3d')][_0xa1eb('0x58')](_0x1302f6)[_0xa1eb('0x34')](handleEntityNotFound(_0x8975a1,null))['then'](respondWithResult(_0x8975a1,null))[_0xa1eb('0x27')](handleError(_0x8975a1,null));};exports[_0xa1eb('0x59')]=function(_0x2161ed,_0x1085ca){var _0x3ad4b3={'where':{'id':_0x2161ed['params']['id']}},_0x1f5da6={};_0x1f5da6[_0xa1eb('0x41')]=_[_0xa1eb('0x42')](db[_0xa1eb('0x3d')][_0xa1eb('0x3e')]);_0x3ad4b3[_0xa1eb('0x45')]=_[_0xa1eb('0x46')](_0x1f5da6[_0xa1eb('0x41')],qs['fields'](_0x2161ed[_0xa1eb('0x43')][_0xa1eb('0x47')]));_0x3ad4b3[_0xa1eb('0x45')]=_0x3ad4b3[_0xa1eb('0x45')]['length']?_0x3ad4b3['attributes']:_0x1f5da6['model'];if(_0x2161ed['query'][_0xa1eb('0x52')]){_0x3ad4b3[_0xa1eb('0x53')]=[{'all':!![]}];}_0x3ad4b3=_['merge']({},_0x3ad4b3,_0x2161ed[_0xa1eb('0x51')]);return db[_0xa1eb('0x3d')][_0xa1eb('0x58')](_0x3ad4b3)[_0xa1eb('0x34')](handleEntityNotFound(_0x1085ca,null))['then'](function(_0x481d19){if(_0x481d19){var _0x201e6a=_0x481d19[_0xa1eb('0x36')]({'plain':!![]});_0x201e6a=qs[_0xa1eb('0x5a')](_0x201e6a,['id',_0xa1eb('0x5b'),_0xa1eb('0x5c')]);_0x2161ed[_0xa1eb('0x5d')]=_['omit'](_0x2161ed['body'],['id',_0xa1eb('0x5b'),'updatedAt']);return db[_0xa1eb('0x3d')]['create'](_[_0xa1eb('0x4e')](_0x201e6a,_0x2161ed[_0xa1eb('0x5d')]),{'include':_0x2161ed['query'][_0xa1eb('0x52')]?[{'all':!![]}]:undefined})[_0xa1eb('0x34')](function(_0x501596){var _0x11e99d=_0x2161ed[_0xa1eb('0x5e')][_0xa1eb('0x36')]({'plain':!![]});if(!_0x11e99d)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x11e99d[_0xa1eb('0x5f')]===_0xa1eb('0x5e')){var _0x4af59a=_0x501596[_0xa1eb('0x36')]({'plain':!![]});var _0x151adf=_0xa1eb('0x60');return db['UserProfileSection'][_0xa1eb('0x58')]({'where':{'name':_0x151adf,'userProfileId':_0x11e99d['userProfileId']},'raw':!![]})[_0xa1eb('0x34')](function(_0x1ea97b){if(_0x1ea97b&&_0x1ea97b[_0xa1eb('0x61')]===0x0){return db[_0xa1eb('0x37')][_0xa1eb('0x62')]({'name':_0x4af59a['name'],'resourceId':_0x4af59a['id'],'type':_0x1ea97b[_0xa1eb('0x39')],'sectionId':_0x1ea97b['id']},{})[_0xa1eb('0x34')](function(){return _0x501596;});}else{return _0x501596;}})[_0xa1eb('0x27')](function(_0x5732e7){logger[_0xa1eb('0x23')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5732e7);throw _0x5732e7;});}return _0x501596;});}})['then'](respondWithResult(_0x1085ca,0xc9))['catch'](handleError(_0x1085ca,null));};exports['create']=function(_0x3b60a7,_0x3e6756,_0x29319e){var _0x4039de;return db[_0xa1eb('0x3d')][_0xa1eb('0x62')](_0x3b60a7[_0xa1eb('0x5d')],{'raw':!![]})[_0xa1eb('0x34')](function(_0x267610){_0x4039de=_0x267610;return db[_0xa1eb('0x3d')]['findAll']({'raw':!![]});})[_0xa1eb('0x34')](function(_0x1d1c91){var _0x46207c=fs[_0xa1eb('0x63')](path[_0xa1eb('0x64')](config[_0xa1eb('0x65')],'server/files/templates/trunk.ejs'),_0xa1eb('0x66'));var _0x2b6996=fs[_0xa1eb('0x63')](path['join'](config[_0xa1eb('0x65')],_0xa1eb('0x67')),_0xa1eb('0x66'));var _0xf39210=ejs[_0xa1eb('0x68')](_0x46207c,{'trunks':_0x1d1c91||[]});fs['writeFileSync'](_0xa1eb('0x69'),_0xf39210);if(_0x4039de['registry']){var _0x2597de=ejs['render'](_0x2b6996,{'trunks':_0x1d1c91||[]});fs[_0xa1eb('0x6a')](_0xa1eb('0x6b'),_0x2597de);}})[_0xa1eb('0x34')](function(){return respondWithRpcPromise(_0xa1eb('0x6c'),'create',{'module':_0xa1eb('0x6d')});})[_0xa1eb('0x34')](function(){var _0x2b8191=_0x3b60a7[_0xa1eb('0x5e')]['get']({'plain':!![]});if(!_0x2b8191)throw new Error(_0xa1eb('0x6e'));if(_0x2b8191[_0xa1eb('0x5f')]===_0xa1eb('0x5e')){var _0x13817e=_0x4039de[_0xa1eb('0x36')]({'plain':!![]});return db[_0xa1eb('0x6f')][_0xa1eb('0x58')]({'where':{'name':_0xa1eb('0x60'),'userProfileId':_0x2b8191[_0xa1eb('0x70')]},'raw':!![]})['then'](function(_0x5591c4){if(_0x5591c4&&_0x5591c4['autoAssociation']===0x0){return db[_0xa1eb('0x37')]['create']({'name':_0x13817e[_0xa1eb('0x39')],'resourceId':_0x13817e['id'],'type':_0x5591c4[_0xa1eb('0x39')],'sectionId':_0x5591c4['id']},{})['then'](function(){return _0x4039de;});}else{return _0x4039de;}})['catch'](function(_0xdcaac3){logger[_0xa1eb('0x23')](_0xa1eb('0x71'),_0xdcaac3);throw _0xdcaac3;});}return _0x4039de;})[_0xa1eb('0x34')](respondWithResult(_0x3e6756,0xc9))[_0xa1eb('0x27')](handleError(_0x3e6756,null));};exports['update']=function(_0x57e4b3,_0x1200de,_0x212e57){var _0x1befa3;return db[_0xa1eb('0x3d')]['find']({'where':{'id':_0x57e4b3[_0xa1eb('0x56')]['id']}})[_0xa1eb('0x34')](handleEntityNotFound(_0x1200de,null))[_0xa1eb('0x34')](saveUpdates(_0x57e4b3[_0xa1eb('0x5d')],null))[_0xa1eb('0x34')](function(_0x37d8c4){if(_0x37d8c4){_0x1befa3=_0x37d8c4;return db[_0xa1eb('0x3d')][_0xa1eb('0x54')]({'raw':!![]});}})[_0xa1eb('0x34')](function(_0x168446){if(_0x168446){var _0x46d326=fs['readFileSync'](path[_0xa1eb('0x64')](config[_0xa1eb('0x65')],_0xa1eb('0x72')),_0xa1eb('0x66'));var _0x3fe7ef=fs[_0xa1eb('0x63')](path['join'](config[_0xa1eb('0x65')],_0xa1eb('0x67')),_0xa1eb('0x66'));var _0x28160e=ejs['render'](_0x46d326,{'trunks':_0x168446||[]});fs['writeFileSync'](_0xa1eb('0x69'),_0x28160e);var _0x5e0cd5=ejs[_0xa1eb('0x68')](_0x3fe7ef,{'trunks':_0x168446||[]});fs[_0xa1eb('0x6a')]('/etc/asterisk/sip_xcally_registers.conf',_0x5e0cd5);return respondWithRpcPromise(_0xa1eb('0x6c'),_0xa1eb('0x33'),{'module':'chan_sip.so'});}return null;})[_0xa1eb('0x34')](function(_0x3a6be1){if(_0x3a6be1){return _0x1befa3;}})[_0xa1eb('0x34')](respondWithResult(_0x1200de,null))[_0xa1eb('0x27')](handleError(_0x1200de,null));};exports[_0xa1eb('0x35')]=function(_0x20cf70,_0x824123,_0x2ce2e1){var _0x3d32da;return db[_0xa1eb('0x3d')][_0xa1eb('0x58')]({'where':{'id':_0x20cf70['params']['id']}})[_0xa1eb('0x34')](handleEntityNotFound(_0x824123,null))[_0xa1eb('0x34')](removeEntity(_0x824123,null))[_0xa1eb('0x34')](function(){return db[_0xa1eb('0x3d')]['findAll']({'raw':!![]});})[_0xa1eb('0x34')](function(_0x2ff08e){var _0x1bbf19=fs['readFileSync'](path[_0xa1eb('0x64')](config[_0xa1eb('0x65')],_0xa1eb('0x72')),'utf8');var _0x1d9e1f=fs['readFileSync'](path[_0xa1eb('0x64')](config[_0xa1eb('0x65')],_0xa1eb('0x67')),_0xa1eb('0x66'));var _0x66d82f=ejs[_0xa1eb('0x68')](_0x1bbf19,{'trunks':_0x2ff08e});var _0x1f9e01=ejs[_0xa1eb('0x68')](_0x1d9e1f,{'trunks':_0x2ff08e});fs['writeFileSync'](_0xa1eb('0x69'),_0x66d82f);fs[_0xa1eb('0x6a')](_0xa1eb('0x6b'),_0x1f9e01);return respondWithRpcPromise(_0xa1eb('0x6c'),_0xa1eb('0x35'),{'module':'chan_sip.so'});})[_0xa1eb('0x27')](handleError(_0x824123,null));};
\ No newline at end of file
+var _0x7d25=['include','findAll','rows','params','find','omit','body','createdAt','updatedAt','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','readFileSync','server/files/templates/trunk.ejs','utf8','join','root','server/files/templates/registry.ejs','render','writeFileSync','/etc/asterisk/sip_xcally_trunks.conf','registry','Reload','chan_sip.so','/etc/asterisk/sip_xcally_registers.conf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','to-csv','lodash','squel','crypto','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','client','http','test','Sequelize','then','info','Trunk,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','destroy','get','Trunks','UserProfileResource','sendStatus','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','filter','merge','options','Trunk','includeAll'];(function(_0xfc4eea,_0x137e6d){var _0x1295e5=function(_0x32d486){while(--_0x32d486){_0xfc4eea['push'](_0xfc4eea['shift']());}};_0x1295e5(++_0x137e6d);}(_0x7d25,0x8a));var _0x57d2=function(_0x45783c,_0x49c56d){_0x45783c=_0x45783c-0x0;var _0x1161da=_0x7d25[_0x45783c];return _0x1161da;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x57d2('0x0'));var rimraf=require(_0x57d2('0x1'));var zipdir=require(_0x57d2('0x2'));var jsonpatch=require(_0x57d2('0x3'));var rp=require(_0x57d2('0x4'));var moment=require(_0x57d2('0x5'));var BPromise=require(_0x57d2('0x6'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x57d2('0x7'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x57d2('0x8'));var squel=require(_0x57d2('0x9'));var crypto=require(_0x57d2('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x57d2('0x7'));var querystring=require('querystring');var Papa=require(_0x57d2('0xb'));var Redis=require(_0x57d2('0xc'));var authService=require(_0x57d2('0xd'));var qs=require('../../components/parsers/qs');var as=require(_0x57d2('0xe'));var hardwareService=require(_0x57d2('0xf'));var logger=require(_0x57d2('0x10'))(_0x57d2('0x11'));var utils=require(_0x57d2('0x12'));var config=require(_0x57d2('0x13'));var db=require(_0x57d2('0x14'))['db'];var jayson=require(_0x57d2('0x15'));var client=jayson[_0x57d2('0x16')][_0x57d2('0x17')]({'port':0x232a});function checkPasswordPattern(_0x28428b,_0x3181ad,_0x6940ef){if(_0x6940ef){var _0x229734=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x229734[_0x57d2('0x18')](_0x3181ad)){return _0x28428b;}else{throw new db[(_0x57d2('0x19'))]['ValidationError']('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x28428b;}}function respondWithRpcPromise(_0x6fad35,_0x148ef3,_0x4ec4b1,_0x8cf637){return new BPromise(function(_0x319489,_0x4bb8f7){var _0x3e12c6=_0x8cf637||client;return _0x3e12c6['request'](_0x6fad35,_0x4ec4b1)[_0x57d2('0x1a')](function(_0x4b4fe0){logger[_0x57d2('0x1b')](_0x57d2('0x1c'),_0x148ef3,_0x57d2('0x1d'));logger['debug']('Trunk,\x20%s,\x20%s,\x20%s',_0x148ef3,_0x57d2('0x1d'),JSON[_0x57d2('0x1e')](_0x4b4fe0));if(_0x4b4fe0[_0x57d2('0x1f')]){if(_0x4b4fe0[_0x57d2('0x1f')]['code']===0x1f4){logger[_0x57d2('0x1f')](_0x57d2('0x1c'),_0x148ef3,_0x4b4fe0['error']['message']);return _0x4bb8f7(_0x4b4fe0[_0x57d2('0x1f')][_0x57d2('0x20')]);}logger[_0x57d2('0x1f')](_0x57d2('0x1c'),_0x148ef3,_0x4b4fe0[_0x57d2('0x1f')][_0x57d2('0x20')]);return _0x319489(_0x4b4fe0[_0x57d2('0x1f')][_0x57d2('0x20')]);}else{logger[_0x57d2('0x1b')](_0x57d2('0x1c'),_0x148ef3,_0x57d2('0x1d'));_0x319489(_0x4b4fe0[_0x57d2('0x21')][_0x57d2('0x20')]);}})[_0x57d2('0x22')](function(_0x5327ea){logger[_0x57d2('0x1f')](_0x57d2('0x1c'),_0x148ef3,_0x5327ea);_0x4bb8f7(_0x5327ea);});});}function respondWithStatusCode(_0x3c7de8,_0x452d5e){_0x452d5e=_0x452d5e||0xcc;return function(_0x4363b3){if(_0x4363b3){return _0x3c7de8['sendStatus'](_0x452d5e);}return _0x3c7de8[_0x57d2('0x23')](_0x452d5e)[_0x57d2('0x24')]();};}function respondWithResult(_0x995928,_0x16ee2f){_0x16ee2f=_0x16ee2f||0xc8;return function(_0x18d500){if(_0x18d500){return _0x995928[_0x57d2('0x23')](_0x16ee2f)[_0x57d2('0x25')](_0x18d500);}};}function respondWithFilteredResult(_0x4fdfbc,_0x1ae5ff){return function(_0x15f1ba){if(_0x15f1ba){var _0x277426=_0x15f1ba[_0x57d2('0x26')],_0x1fe383=_0x1ae5ff[_0x57d2('0x27')],_0x1957a6=_0x1ae5ff[_0x57d2('0x27')]+_0x1ae5ff[_0x57d2('0x28')],_0x7c33f3;if(_0x1957a6>=_0x277426){_0x1957a6=_0x277426;_0x7c33f3=0xc8;}else{_0x7c33f3=0xce;}_0x4fdfbc['status'](_0x7c33f3);return _0x4fdfbc[_0x57d2('0x29')](_0x57d2('0x2a'),_0x1fe383+'-'+_0x1957a6+'/'+_0x277426)[_0x57d2('0x25')](_0x15f1ba);}return null;};}function patchUpdates(_0x3e017c){return function(_0x484597){try{jsonpatch[_0x57d2('0x2b')](_0x484597,_0x3e017c,!![]);}catch(_0x1fa0aa){return BPromise[_0x57d2('0x2c')](_0x1fa0aa);}return _0x484597[_0x57d2('0x2d')]();};}function saveUpdates(_0xb3051c,_0x40f3f2){return function(_0x3cbc4b){if(_0x3cbc4b){return _0x3cbc4b[_0x57d2('0x2e')](_0xb3051c)[_0x57d2('0x1a')](function(_0x581cf7){return _0x581cf7;});}return null;};}function removeEntity(_0xee0c82,_0x213c99){return function(_0x4f5923){if(_0x4f5923){return _0x4f5923[_0x57d2('0x2f')]()[_0x57d2('0x1a')](function(){var _0x47dbfa=_0x4f5923[_0x57d2('0x30')]({'plain':!![]});var _0x1c4ea5=_0x57d2('0x31');return db[_0x57d2('0x32')][_0x57d2('0x2f')]({'where':{'type':_0x1c4ea5,'resourceId':_0x47dbfa['id']}})['then'](function(){return _0x4f5923;});})['then'](function(){_0xee0c82['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x371939,_0x39f54b){return function(_0x39f3b9){if(!_0x39f3b9){_0x371939[_0x57d2('0x33')](0x194);}return _0x39f3b9;};}function handleError(_0x13beac,_0x565ca6){_0x565ca6=_0x565ca6||0x1f4;return function(_0x375a83){logger['error'](_0x375a83[_0x57d2('0x34')]);if(_0x375a83[_0x57d2('0x35')]){delete _0x375a83[_0x57d2('0x35')];}_0x13beac['status'](_0x565ca6)[_0x57d2('0x36')](_0x375a83);};}exports[_0x57d2('0x37')]=function(_0x5d49e9,_0xb33455){var _0x28c52d={},_0x69a1bc={},_0x3a713d={'count':0x0,'rows':[]};var _0x3153fd=_[_0x57d2('0x38')](db['Trunk'][_0x57d2('0x39')],function(_0x53c2e0){return{'name':_0x53c2e0[_0x57d2('0x3a')],'type':_0x53c2e0[_0x57d2('0x3b')][_0x57d2('0x3c')]};});_0x69a1bc[_0x57d2('0x3d')]=_[_0x57d2('0x38')](_0x3153fd,'name');_0x69a1bc[_0x57d2('0x3e')]=_[_0x57d2('0x3f')](_0x5d49e9['query']);_0x69a1bc[_0x57d2('0x40')]=_[_0x57d2('0x41')](_0x69a1bc[_0x57d2('0x3d')],_0x69a1bc['query']);_0x28c52d[_0x57d2('0x42')]=_[_0x57d2('0x41')](_0x69a1bc[_0x57d2('0x3d')],qs[_0x57d2('0x43')](_0x5d49e9['query']['fields']));_0x28c52d[_0x57d2('0x42')]=_0x28c52d[_0x57d2('0x42')][_0x57d2('0x44')]?_0x28c52d['attributes']:_0x69a1bc['model'];if(!_0x5d49e9[_0x57d2('0x3e')]['hasOwnProperty'](_0x57d2('0x45'))){_0x28c52d[_0x57d2('0x28')]=qs[_0x57d2('0x28')](_0x5d49e9[_0x57d2('0x3e')][_0x57d2('0x28')]);_0x28c52d['offset']=qs[_0x57d2('0x27')](_0x5d49e9[_0x57d2('0x3e')]['offset']);}_0x28c52d[_0x57d2('0x46')]=qs['sort'](_0x5d49e9[_0x57d2('0x3e')][_0x57d2('0x47')]);_0x28c52d[_0x57d2('0x48')]=qs[_0x57d2('0x40')](_['pick'](_0x5d49e9['query'],_0x69a1bc[_0x57d2('0x40')]),_0x3153fd);if(_0x5d49e9['query']['filter']){_0x28c52d[_0x57d2('0x48')]=_['merge'](_0x28c52d['where'],{'$or':_[_0x57d2('0x38')](_0x3153fd,function(_0x5180c3){if(_0x5180c3[_0x57d2('0x3b')]!=='VIRTUAL'){var _0x2bf106={};_0x2bf106[_0x5180c3['name']]={'$like':'%'+_0x5d49e9['query'][_0x57d2('0x49')]+'%'};return _0x2bf106;}})});}_0x28c52d=_[_0x57d2('0x4a')]({},_0x28c52d,_0x5d49e9[_0x57d2('0x4b')]);var _0x28566d={'where':_0x28c52d[_0x57d2('0x48')]};return db[_0x57d2('0x4c')]['count'](_0x28566d)[_0x57d2('0x1a')](function(_0xf91b05){_0x3a713d[_0x57d2('0x26')]=_0xf91b05;if(_0x5d49e9[_0x57d2('0x3e')][_0x57d2('0x4d')]){_0x28c52d[_0x57d2('0x4e')]=[{'all':!![]}];}return db[_0x57d2('0x4c')][_0x57d2('0x4f')](_0x28c52d);})['then'](function(_0x9f6f34){_0x3a713d[_0x57d2('0x50')]=_0x9f6f34;return _0x3a713d;})['then'](respondWithFilteredResult(_0xb33455,_0x28c52d))[_0x57d2('0x22')](handleError(_0xb33455,null));};exports['show']=function(_0x59a6eb,_0x1a1dc7){var _0x31f404={'raw':![],'where':{'id':_0x59a6eb[_0x57d2('0x51')]['id']}},_0x17f479={};_0x17f479['model']=_[_0x57d2('0x3f')](db[_0x57d2('0x4c')]['rawAttributes']);_0x17f479['query']=_[_0x57d2('0x3f')](_0x59a6eb[_0x57d2('0x3e')]);_0x17f479[_0x57d2('0x40')]=_[_0x57d2('0x41')](_0x17f479[_0x57d2('0x3d')],_0x17f479[_0x57d2('0x3e')]);_0x31f404['attributes']=_['intersection'](_0x17f479['model'],qs[_0x57d2('0x43')](_0x59a6eb['query'][_0x57d2('0x43')]));_0x31f404[_0x57d2('0x42')]=_0x31f404['attributes'][_0x57d2('0x44')]?_0x31f404[_0x57d2('0x42')]:_0x17f479[_0x57d2('0x3d')];if(_0x59a6eb['query'][_0x57d2('0x4d')]){_0x31f404[_0x57d2('0x4e')]=[{'all':!![]}];}_0x31f404=_[_0x57d2('0x4a')]({},_0x31f404,_0x59a6eb[_0x57d2('0x4b')]);return db[_0x57d2('0x4c')][_0x57d2('0x52')](_0x31f404)[_0x57d2('0x1a')](handleEntityNotFound(_0x1a1dc7,null))[_0x57d2('0x1a')](respondWithResult(_0x1a1dc7,null))[_0x57d2('0x22')](handleError(_0x1a1dc7,null));};exports['clone']=function(_0x67d499,_0x3ad348){var _0x28109b={'where':{'id':_0x67d499[_0x57d2('0x51')]['id']}},_0x5e3289={};_0x5e3289[_0x57d2('0x3d')]=_[_0x57d2('0x3f')](db['Trunk']['rawAttributes']);_0x28109b['attributes']=_[_0x57d2('0x41')](_0x5e3289['model'],qs[_0x57d2('0x43')](_0x67d499['query'][_0x57d2('0x43')]));_0x28109b['attributes']=_0x28109b[_0x57d2('0x42')][_0x57d2('0x44')]?_0x28109b[_0x57d2('0x42')]:_0x5e3289['model'];if(_0x67d499['query'][_0x57d2('0x4d')]){_0x28109b[_0x57d2('0x4e')]=[{'all':!![]}];}_0x28109b=_[_0x57d2('0x4a')]({},_0x28109b,_0x67d499[_0x57d2('0x4b')]);return db[_0x57d2('0x4c')][_0x57d2('0x52')](_0x28109b)['then'](handleEntityNotFound(_0x3ad348,null))['then'](function(_0x2040c0){if(_0x2040c0){var _0x6951d8=_0x2040c0[_0x57d2('0x30')]({'plain':!![]});_0x6951d8=qs[_0x57d2('0x53')](_0x6951d8,['id','createdAt','updatedAt']);_0x67d499[_0x57d2('0x54')]=_[_0x57d2('0x53')](_0x67d499['body'],['id',_0x57d2('0x55'),_0x57d2('0x56')]);return db[_0x57d2('0x4c')][_0x57d2('0x57')](_['merge'](_0x6951d8,_0x67d499['body']),{'include':_0x67d499['query']['includeAll']?[{'all':!![]}]:undefined})[_0x57d2('0x1a')](function(_0x15a15d){var _0x343890=_0x67d499[_0x57d2('0x58')][_0x57d2('0x30')]({'plain':!![]});if(!_0x343890)throw new Error(_0x57d2('0x59'));if(_0x343890[_0x57d2('0x5a')]==='user'){var _0x35808a=_0x15a15d['get']({'plain':!![]});var _0xca2707='Trunks';return db[_0x57d2('0x5b')][_0x57d2('0x52')]({'where':{'name':_0xca2707,'userProfileId':_0x343890[_0x57d2('0x5c')]},'raw':!![]})[_0x57d2('0x1a')](function(_0xcbe523){if(_0xcbe523&&_0xcbe523[_0x57d2('0x5d')]===0x0){return db['UserProfileResource'][_0x57d2('0x57')]({'name':_0x35808a[_0x57d2('0x35')],'resourceId':_0x35808a['id'],'type':_0xcbe523[_0x57d2('0x35')],'sectionId':_0xcbe523['id']},{})[_0x57d2('0x1a')](function(){return _0x15a15d;});}else{return _0x15a15d;}})[_0x57d2('0x22')](function(_0x2af67e){logger[_0x57d2('0x1f')](_0x57d2('0x5e'),_0x2af67e);throw _0x2af67e;});}return _0x15a15d;});}})[_0x57d2('0x1a')](respondWithResult(_0x3ad348,0xc9))['catch'](handleError(_0x3ad348,null));};exports[_0x57d2('0x57')]=function(_0x4bddff,_0x5b73e7,_0x4b41a2){var _0x270de8;return db['Trunk'][_0x57d2('0x57')](_0x4bddff[_0x57d2('0x54')],{'raw':!![]})['then'](function(_0x2792b0){_0x270de8=_0x2792b0;return db[_0x57d2('0x4c')][_0x57d2('0x4f')]({'raw':!![]});})[_0x57d2('0x1a')](function(_0x5eb7a3){var _0x3afeb9=fs[_0x57d2('0x5f')](path['join'](config['root'],_0x57d2('0x60')),_0x57d2('0x61'));var _0x481c6b=fs[_0x57d2('0x5f')](path[_0x57d2('0x62')](config[_0x57d2('0x63')],_0x57d2('0x64')),_0x57d2('0x61'));var _0x3899b8=ejs[_0x57d2('0x65')](_0x3afeb9,{'trunks':_0x5eb7a3||[]});fs[_0x57d2('0x66')](_0x57d2('0x67'),_0x3899b8);if(_0x270de8[_0x57d2('0x68')]){var _0x22f977=ejs[_0x57d2('0x65')](_0x481c6b,{'trunks':_0x5eb7a3||[]});fs[_0x57d2('0x66')]('/etc/asterisk/sip_xcally_registers.conf',_0x22f977);}})[_0x57d2('0x1a')](function(){return respondWithRpcPromise(_0x57d2('0x69'),_0x57d2('0x57'),{'module':_0x57d2('0x6a')});})[_0x57d2('0x1a')](function(){var _0x2583d4=_0x4bddff[_0x57d2('0x58')][_0x57d2('0x30')]({'plain':!![]});if(!_0x2583d4)throw new Error(_0x57d2('0x59'));if(_0x2583d4[_0x57d2('0x5a')]===_0x57d2('0x58')){var _0x2f9a7e=_0x270de8[_0x57d2('0x30')]({'plain':!![]});return db[_0x57d2('0x5b')][_0x57d2('0x52')]({'where':{'name':_0x57d2('0x31'),'userProfileId':_0x2583d4['userProfileId']},'raw':!![]})[_0x57d2('0x1a')](function(_0x37d464){if(_0x37d464&&_0x37d464['autoAssociation']===0x0){return db[_0x57d2('0x32')][_0x57d2('0x57')]({'name':_0x2f9a7e[_0x57d2('0x35')],'resourceId':_0x2f9a7e['id'],'type':_0x37d464[_0x57d2('0x35')],'sectionId':_0x37d464['id']},{})['then'](function(){return _0x270de8;});}else{return _0x270de8;}})[_0x57d2('0x22')](function(_0x5f0870){logger['error'](_0x57d2('0x5e'),_0x5f0870);throw _0x5f0870;});}return _0x270de8;})['then'](respondWithResult(_0x5b73e7,0xc9))[_0x57d2('0x22')](handleError(_0x5b73e7,null));};exports[_0x57d2('0x2e')]=function(_0x199995,_0x31fa1b,_0x4ea1b4){var _0xd0191b;return db[_0x57d2('0x4c')][_0x57d2('0x52')]({'where':{'id':_0x199995[_0x57d2('0x51')]['id']}})[_0x57d2('0x1a')](handleEntityNotFound(_0x31fa1b,null))[_0x57d2('0x1a')](saveUpdates(_0x199995[_0x57d2('0x54')],null))[_0x57d2('0x1a')](function(_0x1d147f){if(_0x1d147f){_0xd0191b=_0x1d147f;return db[_0x57d2('0x4c')]['findAll']({'raw':!![]});}})[_0x57d2('0x1a')](function(_0x28596b){if(_0x28596b){var _0x1bf81c=fs[_0x57d2('0x5f')](path[_0x57d2('0x62')](config[_0x57d2('0x63')],_0x57d2('0x60')),_0x57d2('0x61'));var _0xf0bdb=fs[_0x57d2('0x5f')](path[_0x57d2('0x62')](config[_0x57d2('0x63')],'server/files/templates/registry.ejs'),'utf8');var _0x3e101b=ejs[_0x57d2('0x65')](_0x1bf81c,{'trunks':_0x28596b||[]});fs[_0x57d2('0x66')](_0x57d2('0x67'),_0x3e101b);var _0xe60b2e=ejs['render'](_0xf0bdb,{'trunks':_0x28596b||[]});fs['writeFileSync'](_0x57d2('0x6b'),_0xe60b2e);return respondWithRpcPromise(_0x57d2('0x69'),_0x57d2('0x2e'),{'module':_0x57d2('0x6a')});}return null;})[_0x57d2('0x1a')](function(_0x41376b){if(_0x41376b){return _0xd0191b;}})['then'](respondWithResult(_0x31fa1b,null))[_0x57d2('0x22')](handleError(_0x31fa1b,null));};exports[_0x57d2('0x2f')]=function(_0x5bb7cd,_0x4913c0,_0x5ac6ee){var _0x5b3cc6;return db[_0x57d2('0x4c')]['find']({'where':{'id':_0x5bb7cd[_0x57d2('0x51')]['id']}})['then'](handleEntityNotFound(_0x4913c0,null))[_0x57d2('0x1a')](removeEntity(_0x4913c0,null))[_0x57d2('0x1a')](function(){return db[_0x57d2('0x4c')][_0x57d2('0x4f')]({'raw':!![]});})[_0x57d2('0x1a')](function(_0x57da59){var _0x3f8ab4=fs[_0x57d2('0x5f')](path[_0x57d2('0x62')](config['root'],_0x57d2('0x60')),_0x57d2('0x61'));var _0x7d257c=fs[_0x57d2('0x5f')](path[_0x57d2('0x62')](config[_0x57d2('0x63')],_0x57d2('0x64')),'utf8');var _0x53c2c1=ejs['render'](_0x3f8ab4,{'trunks':_0x57da59});var _0x1a52ec=ejs[_0x57d2('0x65')](_0x7d257c,{'trunks':_0x57da59});fs[_0x57d2('0x66')]('/etc/asterisk/sip_xcally_trunks.conf',_0x53c2c1);fs[_0x57d2('0x66')](_0x57d2('0x6b'),_0x1a52ec);return respondWithRpcPromise(_0x57d2('0x69'),_0x57d2('0x2f'),{'module':_0x57d2('0x6a')});})[_0x57d2('0x22')](handleError(_0x4913c0,null));};
\ No newline at end of file
diff --git a/server/api/trunk/trunk.model.js b/server/api/trunk/trunk.model.js
index a1ba1f5..3b17f93 100644
--- a/server/api/trunk/trunk.model.js
+++ b/server/api/trunk/trunk.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xc6ce=['../../config/environment','./trunk.attributes','tools_trunks','lodash','../../config/logger','api','moment','bluebird','request-promise','rimraf'];(function(_0xa9dbb1,_0xc8425f){var _0x2ebc2a=function(_0x5a5074){while(--_0x5a5074){_0xa9dbb1['push'](_0xa9dbb1['shift']());}};_0x2ebc2a(++_0xc8425f);}(_0xc6ce,0xad));var _0xec6c=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0xc6ce[_0x167cc1];return _0x10bc4b;};'use strict';var _=require(_0xec6c('0x0'));var util=require('util');var logger=require(_0xec6c('0x1'))(_0xec6c('0x2'));var moment=require(_0xec6c('0x3'));var BPromise=require(_0xec6c('0x4'));var rp=require(_0xec6c('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xec6c('0x6'));var config=require(_0xec6c('0x7'));var attributes=require(_0xec6c('0x8'));module['exports']=function(_0x3320ca,_0x72149){return _0x3320ca['define']('Trunk',attributes,{'tableName':_0xec6c('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xa5f6=['tools_trunks','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./trunk.attributes','exports','define','Trunk'];(function(_0x498174,_0x39010b){var _0x2ba1c6=function(_0x4385b2){while(--_0x4385b2){_0x498174['push'](_0x498174['shift']());}};_0x2ba1c6(++_0x39010b);}(_0xa5f6,0x16d));var _0x6a5f=function(_0x5e701b,_0x456e9e){_0x5e701b=_0x5e701b-0x0;var _0x398abf=_0xa5f6[_0x5e701b];return _0x398abf;};'use strict';var _=require('lodash');var util=require(_0x6a5f('0x0'));var logger=require(_0x6a5f('0x1'))(_0x6a5f('0x2'));var moment=require(_0x6a5f('0x3'));var BPromise=require(_0x6a5f('0x4'));var rp=require(_0x6a5f('0x5'));var fs=require('fs');var path=require(_0x6a5f('0x6'));var rimraf=require(_0x6a5f('0x7'));var config=require('../../config/environment');var attributes=require(_0x6a5f('0x8'));module[_0x6a5f('0x9')]=function(_0x193938,_0x7c8525){return _0x193938[_0x6a5f('0xa')](_0x6a5f('0xb'),attributes,{'tableName':_0x6a5f('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/trunk/trunk.rpc.js b/server/api/trunk/trunk.rpc.js
index e2cd3d8..e704993 100644
--- a/server/api/trunk/trunk.rpc.js
+++ b/server/api/trunk/trunk.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xbaf0=['Trunk,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','GetTrunk','Trunk','findAll','options','where','attributes','limit','include','model','map','ShowTrunk','find','raw','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','Trunk,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x193a6e,_0x45dd00){var _0x599a9b=function(_0x37a9e2){while(--_0x37a9e2){_0x193a6e['push'](_0x193a6e['shift']());}};_0x599a9b(++_0x45dd00);}(_0xbaf0,0x12a));var _0x0baf=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0xbaf0[_0x6131cd];return _0x47e916;};'use strict';var _=require('lodash');var util=require(_0x0baf('0x0'));var moment=require(_0x0baf('0x1'));var BPromise=require(_0x0baf('0x2'));var rs=require(_0x0baf('0x3'));var fs=require('fs');var Redis=require(_0x0baf('0x4'));var db=require(_0x0baf('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x0baf('0x6'))(_0x0baf('0x7'));var config=require(_0x0baf('0x8'));var jayson=require(_0x0baf('0x9'));var client=jayson[_0x0baf('0xa')][_0x0baf('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1a10b1,_0x2dcaac,_0x1d0a0d){return new BPromise(function(_0x5f5030,_0x11b947){return client['request'](_0x1a10b1,_0x1d0a0d)[_0x0baf('0xc')](function(_0x2c7442){logger[_0x0baf('0xd')](_0x0baf('0xe'),_0x2dcaac,_0x0baf('0xf'));logger[_0x0baf('0x10')](_0x0baf('0x11'),_0x2dcaac,_0x0baf('0xf'),JSON[_0x0baf('0x12')](_0x2c7442));if(_0x2c7442[_0x0baf('0x13')]){if(_0x2c7442[_0x0baf('0x13')]['code']===0x1f4){logger['error'](_0x0baf('0xe'),_0x2dcaac,_0x2c7442[_0x0baf('0x13')][_0x0baf('0x14')]);return _0x11b947(_0x2c7442[_0x0baf('0x13')]['message']);}logger[_0x0baf('0x13')]('Trunk,\x20%s,\x20%s',_0x2dcaac,_0x2c7442[_0x0baf('0x13')][_0x0baf('0x14')]);return _0x5f5030(_0x2c7442[_0x0baf('0x13')][_0x0baf('0x14')]);}else{logger[_0x0baf('0xd')](_0x0baf('0xe'),_0x2dcaac,'request\x20sent');_0x5f5030(_0x2c7442['result'][_0x0baf('0x14')]);}})[_0x0baf('0x15')](function(_0x283408){logger[_0x0baf('0x13')](_0x0baf('0xe'),_0x2dcaac,_0x283408);_0x11b947(_0x283408);});});}exports[_0x0baf('0x16')]=function(_0x53c338){var _0x63c820=this;return new Promise(function(_0xfbecec,_0x1ef0e5){return db[_0x0baf('0x17')][_0x0baf('0x18')]({'raw':_0x53c338[_0x0baf('0x19')]?_0x53c338['options']['raw']===undefined?!![]:![]:!![],'where':_0x53c338[_0x0baf('0x19')]?_0x53c338[_0x0baf('0x19')][_0x0baf('0x1a')]||null:null,'attributes':_0x53c338[_0x0baf('0x19')]?_0x53c338[_0x0baf('0x19')][_0x0baf('0x1b')]||null:null,'limit':_0x53c338[_0x0baf('0x19')]?_0x53c338[_0x0baf('0x19')][_0x0baf('0x1c')]||null:null,'include':_0x53c338[_0x0baf('0x19')]?_0x53c338['options'][_0x0baf('0x1d')]?_['map'](_0x53c338[_0x0baf('0x19')]['include'],function(_0x4de74c){return{'model':db[_0x4de74c[_0x0baf('0x1e')]],'as':_0x4de74c['as'],'attributes':_0x4de74c['attributes'],'include':_0x4de74c['include']?_[_0x0baf('0x1f')](_0x4de74c[_0x0baf('0x1d')],function(_0x34e264){return{'model':db[_0x34e264[_0x0baf('0x1e')]],'as':_0x34e264['as'],'attributes':_0x34e264[_0x0baf('0x1b')],'include':_0x34e264['include']?_[_0x0baf('0x1f')](_0x34e264[_0x0baf('0x1d')],function(_0x1ca35a){return{'model':db[_0x1ca35a[_0x0baf('0x1e')]],'as':_0x1ca35a['as'],'attributes':_0x1ca35a[_0x0baf('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x0baf('0xc')](function(_0x453525){logger['info'](_0x0baf('0x16'),_0x53c338);logger[_0x0baf('0x10')](_0x0baf('0x16'),_0x53c338,JSON[_0x0baf('0x12')](_0x453525));_0xfbecec(_0x453525);})['catch'](function(_0x29dbdf){logger[_0x0baf('0x13')]('GetTrunk',_0x29dbdf[_0x0baf('0x14')],_0x53c338);_0x1ef0e5(_0x63c820[_0x0baf('0x13')](0x1f4,_0x29dbdf[_0x0baf('0x14')]));});});};exports[_0x0baf('0x20')]=function(_0xd14f0f){var _0x366924=this;return new Promise(function(_0x213a6a,_0x57476f){return db[_0x0baf('0x17')][_0x0baf('0x21')]({'raw':_0xd14f0f[_0x0baf('0x19')]?_0xd14f0f[_0x0baf('0x19')][_0x0baf('0x22')]===undefined?!![]:![]:!![],'where':_0xd14f0f[_0x0baf('0x19')]?_0xd14f0f[_0x0baf('0x19')][_0x0baf('0x1a')]||null:null,'attributes':_0xd14f0f[_0x0baf('0x19')]?_0xd14f0f[_0x0baf('0x19')][_0x0baf('0x1b')]||null:null,'include':_0xd14f0f[_0x0baf('0x19')]?_0xd14f0f[_0x0baf('0x19')][_0x0baf('0x1d')]?_['map'](_0xd14f0f[_0x0baf('0x19')]['include'],function(_0x1aa474){return{'model':db[_0x1aa474[_0x0baf('0x1e')]],'as':_0x1aa474['as'],'attributes':_0x1aa474[_0x0baf('0x1b')],'include':_0x1aa474[_0x0baf('0x1d')]?_['map'](_0x1aa474[_0x0baf('0x1d')],function(_0x1d6575){return{'model':db[_0x1d6575['model']],'as':_0x1d6575['as'],'attributes':_0x1d6575[_0x0baf('0x1b')],'include':_0x1d6575[_0x0baf('0x1d')]?_[_0x0baf('0x1f')](_0x1d6575[_0x0baf('0x1d')],function(_0x1f60bd){return{'model':db[_0x1f60bd[_0x0baf('0x1e')]],'as':_0x1f60bd['as'],'attributes':_0x1f60bd[_0x0baf('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x0baf('0xc')](function(_0x4aa6ed){logger[_0x0baf('0xd')](_0x0baf('0x20'),_0xd14f0f);logger['debug'](_0x0baf('0x20'),_0xd14f0f,JSON['stringify'](_0x4aa6ed));_0x213a6a(_0x4aa6ed);})['catch'](function(_0x11bc49){logger[_0x0baf('0x13')]('ShowTrunk',_0x11bc49['message'],_0xd14f0f);_0x57476f(_0x366924[_0x0baf('0x13')](0x1f4,_0x11bc49[_0x0baf('0x14')]));});});};
\ No newline at end of file
+var _0x0b0e=['model','GetTrunk','Trunk','find','where','include','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Trunk,\x20%s,\x20%s','debug','Trunk,\x20%s,\x20%s,\x20%s','stringify','error','message','request\x20sent','result','catch','findAll','raw','options','attributes','map'];(function(_0x5d487a,_0x103a20){var _0x236757=function(_0xdff32d){while(--_0xdff32d){_0x5d487a['push'](_0x5d487a['shift']());}};_0x236757(++_0x103a20);}(_0x0b0e,0x187));var _0xe0b0=function(_0x1597e2,_0x388d3e){_0x1597e2=_0x1597e2-0x0;var _0x4c8c0a=_0x0b0e[_0x1597e2];return _0x4c8c0a;};'use strict';var _=require(_0xe0b0('0x0'));var util=require('util');var moment=require(_0xe0b0('0x1'));var BPromise=require('bluebird');var rs=require(_0xe0b0('0x2'));var fs=require('fs');var Redis=require(_0xe0b0('0x3'));var db=require(_0xe0b0('0x4'))['db'];var utils=require(_0xe0b0('0x5'));var logger=require(_0xe0b0('0x6'))(_0xe0b0('0x7'));var config=require(_0xe0b0('0x8'));var jayson=require(_0xe0b0('0x9'));var client=jayson[_0xe0b0('0xa')][_0xe0b0('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x219b1c,_0x5cf9cc,_0x50be7f){return new BPromise(function(_0x11effc,_0x435060){return client[_0xe0b0('0xc')](_0x219b1c,_0x50be7f)[_0xe0b0('0xd')](function(_0x4c24f9){logger[_0xe0b0('0xe')](_0xe0b0('0xf'),_0x5cf9cc,'request\x20sent');logger[_0xe0b0('0x10')](_0xe0b0('0x11'),_0x5cf9cc,'request\x20sent',JSON[_0xe0b0('0x12')](_0x4c24f9));if(_0x4c24f9[_0xe0b0('0x13')]){if(_0x4c24f9[_0xe0b0('0x13')]['code']===0x1f4){logger[_0xe0b0('0x13')](_0xe0b0('0xf'),_0x5cf9cc,_0x4c24f9[_0xe0b0('0x13')][_0xe0b0('0x14')]);return _0x435060(_0x4c24f9[_0xe0b0('0x13')]['message']);}logger[_0xe0b0('0x13')](_0xe0b0('0xf'),_0x5cf9cc,_0x4c24f9[_0xe0b0('0x13')][_0xe0b0('0x14')]);return _0x11effc(_0x4c24f9[_0xe0b0('0x13')]['message']);}else{logger[_0xe0b0('0xe')]('Trunk,\x20%s,\x20%s',_0x5cf9cc,_0xe0b0('0x15'));_0x11effc(_0x4c24f9[_0xe0b0('0x16')]['message']);}})[_0xe0b0('0x17')](function(_0x4a4cc0){logger[_0xe0b0('0x13')](_0xe0b0('0xf'),_0x5cf9cc,_0x4a4cc0);_0x435060(_0x4a4cc0);});});}exports['GetTrunk']=function(_0x54a3eb){var _0x46bb44=this;return new Promise(function(_0x50a441,_0x4df8da){return db['Trunk'][_0xe0b0('0x18')]({'raw':_0x54a3eb['options']?_0x54a3eb['options'][_0xe0b0('0x19')]===undefined?!![]:![]:!![],'where':_0x54a3eb['options']?_0x54a3eb[_0xe0b0('0x1a')]['where']||null:null,'attributes':_0x54a3eb[_0xe0b0('0x1a')]?_0x54a3eb[_0xe0b0('0x1a')][_0xe0b0('0x1b')]||null:null,'limit':_0x54a3eb[_0xe0b0('0x1a')]?_0x54a3eb[_0xe0b0('0x1a')]['limit']||null:null,'include':_0x54a3eb['options']?_0x54a3eb[_0xe0b0('0x1a')]['include']?_[_0xe0b0('0x1c')](_0x54a3eb[_0xe0b0('0x1a')]['include'],function(_0x170ad8){return{'model':db[_0x170ad8['model']],'as':_0x170ad8['as'],'attributes':_0x170ad8[_0xe0b0('0x1b')],'include':_0x170ad8['include']?_[_0xe0b0('0x1c')](_0x170ad8['include'],function(_0x3e5c88){return{'model':db[_0x3e5c88['model']],'as':_0x3e5c88['as'],'attributes':_0x3e5c88[_0xe0b0('0x1b')],'include':_0x3e5c88['include']?_[_0xe0b0('0x1c')](_0x3e5c88['include'],function(_0x362aba){return{'model':db[_0x362aba[_0xe0b0('0x1d')]],'as':_0x362aba['as'],'attributes':_0x362aba[_0xe0b0('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xe0b0('0xd')](function(_0x3ec2){logger[_0xe0b0('0xe')]('GetTrunk',_0x54a3eb);logger[_0xe0b0('0x10')](_0xe0b0('0x1e'),_0x54a3eb,JSON['stringify'](_0x3ec2));_0x50a441(_0x3ec2);})[_0xe0b0('0x17')](function(_0x419b1f){logger[_0xe0b0('0x13')](_0xe0b0('0x1e'),_0x419b1f[_0xe0b0('0x14')],_0x54a3eb);_0x4df8da(_0x46bb44[_0xe0b0('0x13')](0x1f4,_0x419b1f[_0xe0b0('0x14')]));});});};exports['ShowTrunk']=function(_0x1854b8){var _0x3c0109=this;return new Promise(function(_0x48a9b5,_0x4fe400){return db[_0xe0b0('0x1f')][_0xe0b0('0x20')]({'raw':_0x1854b8[_0xe0b0('0x1a')]?_0x1854b8[_0xe0b0('0x1a')][_0xe0b0('0x19')]===undefined?!![]:![]:!![],'where':_0x1854b8['options']?_0x1854b8[_0xe0b0('0x1a')][_0xe0b0('0x21')]||null:null,'attributes':_0x1854b8[_0xe0b0('0x1a')]?_0x1854b8[_0xe0b0('0x1a')][_0xe0b0('0x1b')]||null:null,'include':_0x1854b8['options']?_0x1854b8[_0xe0b0('0x1a')][_0xe0b0('0x22')]?_[_0xe0b0('0x1c')](_0x1854b8[_0xe0b0('0x1a')][_0xe0b0('0x22')],function(_0x12eeb8){return{'model':db[_0x12eeb8[_0xe0b0('0x1d')]],'as':_0x12eeb8['as'],'attributes':_0x12eeb8[_0xe0b0('0x1b')],'include':_0x12eeb8[_0xe0b0('0x22')]?_[_0xe0b0('0x1c')](_0x12eeb8[_0xe0b0('0x22')],function(_0x1a0c90){return{'model':db[_0x1a0c90[_0xe0b0('0x1d')]],'as':_0x1a0c90['as'],'attributes':_0x1a0c90[_0xe0b0('0x1b')],'include':_0x1a0c90[_0xe0b0('0x22')]?_['map'](_0x1a0c90[_0xe0b0('0x22')],function(_0x135be5){return{'model':db[_0x135be5[_0xe0b0('0x1d')]],'as':_0x135be5['as'],'attributes':_0x135be5[_0xe0b0('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xe0b0('0xd')](function(_0x2c6e60){logger[_0xe0b0('0xe')]('ShowTrunk',_0x1854b8);logger['debug']('ShowTrunk',_0x1854b8,JSON['stringify'](_0x2c6e60));_0x48a9b5(_0x2c6e60);})[_0xe0b0('0x17')](function(_0xc3d967){logger[_0xe0b0('0x13')]('ShowTrunk',_0xc3d967[_0xe0b0('0x14')],_0x1854b8);_0x4fe400(_0x3c0109[_0xe0b0('0x13')](0x1f4,_0xc3d967[_0xe0b0('0x14')]));});});};
\ No newline at end of file
diff --git a/server/api/user/index.js b/server/api/user/index.js
index 47ded73..63bb769 100644
--- a/server/api/user/index.js
+++ b/server/api/user/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xcb72=['/:id/screen_recordings','getChatInteractions','/:id/openchannel/interactions','/:id/mail/interactions','/:id/sms/interactions','getSmsInteractions','/:id/fax/interactions','getFaxInteractions','/:id/whatsapp/interactions','getWhatsappInteractions','/:id/lists','getLists','/:id/agents','getAgents','/:id/prefixes','getVoicePrefixes','/:id/fax_accounts','getFaxAccounts','/:id/mail_accounts','getMailAccounts','/:id/openchannel_accounts','getOpenchannelAccounts','/:id/sms_accounts','getSmsAccounts','/:id/chat_websites','getChatWebsites','getWhatsappAccounts','/:id/square_projects','/:id/scheduled_calls','getScheduledCalls','/:id/api_key','post','/create_many','bulkCreate','addContacts','create','/:id/queues','addQueues','diskStorage','join','server/files/images/','format','now','originalname','single','file','login','/:id/logout','logout','/:id/pause','pause','/:id/unpause','unpause','addChatInteractions','/:id/fax_interactions','addSmsInteractions','/:id/openchannel_interactions','addOpenchannelInteractions','addFaxAccounts','addOpenchannelAccounts','addSmsAccounts','addChatWebsites','/:id/whatsapp_accounts','addWhatsappAccounts','addSquareProjects','createApiKey','put','/:id','update','/:id/password','changePassword','delete','removeQueues','/:id/teams','removeTeams','destroy','/:id/chat_interactions','/:id/mail_interactions','removeMailInteractions','removeFaxInteractions','removeOpenchannelInteractions','/:id/whatsapp_interactions','removeFaxAccounts','removeSmsAccounts','removeChatWebsites','removeWhatsappAccounts','removeApiKey','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./user.controller','get','index','/describe','isAuthenticated','describe','whoami','/:id/avatar','getAvatar','/:id/contacts','getContacts','getQueues','/:id/queues_rt','getVoiceQueuesRt','/:id/groups'];(function(_0x2bdd09,_0x4af9e9){var _0x35b22a=function(_0x58d54f){while(--_0x58d54f){_0x2bdd09['push'](_0x2bdd09['shift']());}};_0x35b22a(++_0x4af9e9);}(_0xcb72,0xc7));var _0x2cb7=function(_0x3ab304,_0x156e6f){_0x3ab304=_0x3ab304-0x0;var _0x461bca=_0xcb72[_0x3ab304];return _0x461bca;};'use strict';var multer=require(_0x2cb7('0x0'));var util=require(_0x2cb7('0x1'));var path=require(_0x2cb7('0x2'));var timeout=require(_0x2cb7('0x3'));var express=require('express');var router=express[_0x2cb7('0x4')]();var auth=require(_0x2cb7('0x5'));var interaction=require(_0x2cb7('0x6'));var config=require(_0x2cb7('0x7'));var controller=require(_0x2cb7('0x8'));router[_0x2cb7('0x9')]('/',auth['isAuthenticated'](),controller[_0x2cb7('0xa')]);router[_0x2cb7('0x9')](_0x2cb7('0xb'),auth[_0x2cb7('0xc')](),controller[_0x2cb7('0xd')]);router['get']('/whoami',auth[_0x2cb7('0xc')](),controller[_0x2cb7('0xe')]);router[_0x2cb7('0x9')]('/:id',auth[_0x2cb7('0xc')](),controller['show']);router[_0x2cb7('0x9')](_0x2cb7('0xf'),controller[_0x2cb7('0x10')]);router[_0x2cb7('0x9')](_0x2cb7('0x11'),auth[_0x2cb7('0xc')](),controller[_0x2cb7('0x12')]);router[_0x2cb7('0x9')]('/:id/queues',auth[_0x2cb7('0xc')](),controller[_0x2cb7('0x13')]);router[_0x2cb7('0x9')](_0x2cb7('0x14'),auth[_0x2cb7('0xc')](),controller[_0x2cb7('0x15')]);router['get'](_0x2cb7('0x16'),auth[_0x2cb7('0xc')](),controller['getGroups']);router[_0x2cb7('0x9')]('/:id/recordings',auth['isAuthenticated'](),controller['getRecordings']);router[_0x2cb7('0x9')](_0x2cb7('0x17'),auth['isAuthenticated'](),controller['getScreenRecordings']);router[_0x2cb7('0x9')]('/:id/chat/interactions',auth[_0x2cb7('0xc')](),controller[_0x2cb7('0x18')]);router[_0x2cb7('0x9')](_0x2cb7('0x19'),auth[_0x2cb7('0xc')](),controller['getOpenchannelInteractions']);router['get'](_0x2cb7('0x1a'),auth['isAuthenticated'](),controller['getMailInteractions']);router['get'](_0x2cb7('0x1b'),auth['isAuthenticated'](),controller[_0x2cb7('0x1c')]);router[_0x2cb7('0x9')](_0x2cb7('0x1d'),auth[_0x2cb7('0xc')](),controller[_0x2cb7('0x1e')]);router['get'](_0x2cb7('0x1f'),auth[_0x2cb7('0xc')](),controller[_0x2cb7('0x20')]);router[_0x2cb7('0x9')]('/:id/teams',auth[_0x2cb7('0xc')](),controller['getTeams']);router['get'](_0x2cb7('0x21'),auth[_0x2cb7('0xc')](),controller[_0x2cb7('0x22')]);router[_0x2cb7('0x9')](_0x2cb7('0x23'),auth[_0x2cb7('0xc')](),controller[_0x2cb7('0x24')]);router[_0x2cb7('0x9')](_0x2cb7('0x25'),auth[_0x2cb7('0xc')](),controller[_0x2cb7('0x26')]);router['get'](_0x2cb7('0x27'),auth[_0x2cb7('0xc')](),controller[_0x2cb7('0x28')]);router[_0x2cb7('0x9')](_0x2cb7('0x29'),auth[_0x2cb7('0xc')](),controller[_0x2cb7('0x2a')]);router['get'](_0x2cb7('0x2b'),auth[_0x2cb7('0xc')](),controller[_0x2cb7('0x2c')]);router[_0x2cb7('0x9')](_0x2cb7('0x2d'),auth[_0x2cb7('0xc')](),controller[_0x2cb7('0x2e')]);router[_0x2cb7('0x9')](_0x2cb7('0x2f'),auth[_0x2cb7('0xc')](),controller[_0x2cb7('0x30')]);router[_0x2cb7('0x9')]('/:id/whatsapp_accounts',auth[_0x2cb7('0xc')](),controller[_0x2cb7('0x31')]);router['get'](_0x2cb7('0x32'),auth[_0x2cb7('0xc')](),controller['getSquareProjects']);router[_0x2cb7('0x9')](_0x2cb7('0x33'),auth['isAuthenticated'](),controller[_0x2cb7('0x34')]);router[_0x2cb7('0x9')](_0x2cb7('0x35'),auth[_0x2cb7('0xc')](),controller['getApiKey']);router[_0x2cb7('0x36')](_0x2cb7('0x37'),auth[_0x2cb7('0xc')](),controller[_0x2cb7('0x38')]);router[_0x2cb7('0x36')](_0x2cb7('0x11'),auth['isAuthenticated'](),controller[_0x2cb7('0x39')]);router[_0x2cb7('0x36')]('/',auth['isAuthenticated'](),controller[_0x2cb7('0x3a')]);router[_0x2cb7('0x36')](_0x2cb7('0x3b'),auth[_0x2cb7('0xc')](),controller[_0x2cb7('0x3c')]);var upload=multer({'storage':multer[_0x2cb7('0x3d')]({'destination':function(_0x37d38b,_0x4dcc7d,_0x54a5a8){_0x54a5a8(null,path[_0x2cb7('0x3e')](config['root'],_0x2cb7('0x3f')));},'filename':function(_0x2e6bd4,_0x1d6c50,_0x9a212c){_0x9a212c(null,util[_0x2cb7('0x40')]('%s-%s',Date[_0x2cb7('0x41')](),_0x1d6c50[_0x2cb7('0x42')]));}})});router[_0x2cb7('0x36')]('/:id/avatar',upload[_0x2cb7('0x43')](_0x2cb7('0x44')),controller['addAvatar']);router[_0x2cb7('0x36')]('/:id/login',auth[_0x2cb7('0xc')](),controller[_0x2cb7('0x45')]);router['post'](_0x2cb7('0x46'),auth[_0x2cb7('0xc')](),controller[_0x2cb7('0x47')]);router[_0x2cb7('0x36')](_0x2cb7('0x48'),auth[_0x2cb7('0xc')](),controller[_0x2cb7('0x49')]);router[_0x2cb7('0x36')](_0x2cb7('0x4a'),auth[_0x2cb7('0xc')](),controller[_0x2cb7('0x4b')]);router['post']('/:id/teams',auth[_0x2cb7('0xc')](),controller['addTeams']);router[_0x2cb7('0x36')]('/:id/chat_interactions',auth[_0x2cb7('0xc')](),controller[_0x2cb7('0x4c')]);router[_0x2cb7('0x36')]('/:id/mail_interactions',auth['isAuthenticated'](),controller['addMailInteractions']);router[_0x2cb7('0x36')](_0x2cb7('0x4d'),auth['isAuthenticated'](),controller['addFaxInteractions']);router[_0x2cb7('0x36')]('/:id/sms_interactions',auth[_0x2cb7('0xc')](),controller[_0x2cb7('0x4e')]);router[_0x2cb7('0x36')](_0x2cb7('0x4f'),auth[_0x2cb7('0xc')](),controller[_0x2cb7('0x50')]);router[_0x2cb7('0x36')]('/:id/whatsapp_interactions',auth[_0x2cb7('0xc')](),controller['addWhatsappInteractions']);router[_0x2cb7('0x36')](_0x2cb7('0x27'),auth[_0x2cb7('0xc')](),controller[_0x2cb7('0x51')]);router[_0x2cb7('0x36')](_0x2cb7('0x29'),auth[_0x2cb7('0xc')](),controller['addMailAccounts']);router['post'](_0x2cb7('0x2b'),auth[_0x2cb7('0xc')](),controller[_0x2cb7('0x52')]);router['post'](_0x2cb7('0x2d'),auth['isAuthenticated'](),controller[_0x2cb7('0x53')]);router['post'](_0x2cb7('0x2f'),auth['isAuthenticated'](),controller[_0x2cb7('0x54')]);router['post'](_0x2cb7('0x55'),auth[_0x2cb7('0xc')](),controller[_0x2cb7('0x56')]);router[_0x2cb7('0x36')](_0x2cb7('0x32'),auth[_0x2cb7('0xc')](),controller[_0x2cb7('0x57')]);router[_0x2cb7('0x36')](_0x2cb7('0x35'),auth['isAuthenticated'](),controller[_0x2cb7('0x58')]);router[_0x2cb7('0x59')](_0x2cb7('0x5a'),auth[_0x2cb7('0xc')](),controller[_0x2cb7('0x5b')]);router[_0x2cb7('0x59')](_0x2cb7('0x5c'),auth['isAuthenticated'](),controller[_0x2cb7('0x5d')]);router[_0x2cb7('0x5e')]('/:id/queues',auth[_0x2cb7('0xc')](),controller[_0x2cb7('0x5f')]);router[_0x2cb7('0x5e')](_0x2cb7('0x60'),auth[_0x2cb7('0xc')](),controller[_0x2cb7('0x61')]);router[_0x2cb7('0x5e')](_0x2cb7('0x5a'),auth[_0x2cb7('0xc')](),controller[_0x2cb7('0x62')]);router[_0x2cb7('0x5e')](_0x2cb7('0x63'),auth['isAuthenticated'](),controller['removeChatInteractions']);router[_0x2cb7('0x5e')](_0x2cb7('0x64'),auth['isAuthenticated'](),controller[_0x2cb7('0x65')]);router[_0x2cb7('0x5e')](_0x2cb7('0x4d'),auth[_0x2cb7('0xc')](),controller[_0x2cb7('0x66')]);router['delete']('/:id/sms_interactions',auth['isAuthenticated'](),controller['removeSmsInteractions']);router[_0x2cb7('0x5e')](_0x2cb7('0x4f'),auth['isAuthenticated'](),controller[_0x2cb7('0x67')]);router['delete'](_0x2cb7('0x68'),auth['isAuthenticated'](),controller['removeWhatsappInteractions']);router[_0x2cb7('0x5e')](_0x2cb7('0x27'),auth[_0x2cb7('0xc')](),controller[_0x2cb7('0x69')]);router['delete'](_0x2cb7('0x29'),auth[_0x2cb7('0xc')](),controller['removeMailAccounts']);router[_0x2cb7('0x5e')]('/:id/openchannel_accounts',auth[_0x2cb7('0xc')](),controller['removeOpenchannelAccounts']);router[_0x2cb7('0x5e')]('/:id/sms_accounts',auth['isAuthenticated'](),controller[_0x2cb7('0x6a')]);router[_0x2cb7('0x5e')]('/:id/chat_websites',auth[_0x2cb7('0xc')](),controller[_0x2cb7('0x6b')]);router[_0x2cb7('0x5e')](_0x2cb7('0x55'),auth[_0x2cb7('0xc')](),controller[_0x2cb7('0x6c')]);router['delete']('/:id/square_projects',auth['isAuthenticated'](),controller['removeSquareProjects']);router['delete'](_0x2cb7('0x35'),auth[_0x2cb7('0xc')](),controller[_0x2cb7('0x6d')]);module[_0x2cb7('0x6e')]=router;
\ No newline at end of file
+var _0x0519=['getChatInteractions','/:id/openchannel/interactions','getOpenchannelInteractions','getMailInteractions','getSmsInteractions','/:id/fax/interactions','getFaxInteractions','/:id/teams','getLists','/:id/agents','getAgents','/:id/prefixes','getVoicePrefixes','/:id/openchannel_accounts','getOpenchannelAccounts','getSmsAccounts','/:id/chat_websites','getChatWebsites','/:id/whatsapp_accounts','/:id/square_projects','getSquareProjects','getScheduledCalls','/:id/api_key','getApiKey','post','/:id/contacts','addContacts','create','addQueues','root','format','%s-%s','now','single','addAvatar','/:id/login','login','/:id/logout','logout','/:id/pause','/:id/unpause','addChatInteractions','/:id/mail_interactions','addMailInteractions','/:id/fax_interactions','addFaxInteractions','addSmsInteractions','addOpenchannelInteractions','/:id/whatsapp_interactions','addWhatsappInteractions','/:id/fax_accounts','addFaxAccounts','addMailAccounts','/:id/sms_accounts','addSmsAccounts','addChatWebsites','addWhatsappAccounts','addSquareProjects','put','update','/:id/password','changePassword','delete','removeQueues','removeTeams','destroy','removeMailInteractions','removeFaxInteractions','removeSmsInteractions','/:id/openchannel_interactions','removeWhatsappInteractions','removeFaxAccounts','removeMailAccounts','removeOpenchannelAccounts','removeSmsAccounts','removeChatWebsites','removeSquareProjects','removeApiKey','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./user.controller','isAuthenticated','get','whoami','/:id','show','/:id/avatar','getAvatar','getContacts','/:id/queues','getQueues','/:id/queues_rt','/:id/groups','getRecordings','getScreenRecordings','/:id/chat/interactions'];(function(_0x333d97,_0x25fda2){var _0x5545a0=function(_0x46119b){while(--_0x46119b){_0x333d97['push'](_0x333d97['shift']());}};_0x5545a0(++_0x25fda2);}(_0x0519,0x11d));var _0x9051=function(_0x3cb6dc,_0x120dd3){_0x3cb6dc=_0x3cb6dc-0x0;var _0x47ec89=_0x0519[_0x3cb6dc];return _0x47ec89;};'use strict';var multer=require(_0x9051('0x0'));var util=require(_0x9051('0x1'));var path=require(_0x9051('0x2'));var timeout=require(_0x9051('0x3'));var express=require(_0x9051('0x4'));var router=express['Router']();var auth=require(_0x9051('0x5'));var interaction=require(_0x9051('0x6'));var config=require(_0x9051('0x7'));var controller=require(_0x9051('0x8'));router['get']('/',auth[_0x9051('0x9')](),controller['index']);router[_0x9051('0xa')]('/describe',auth['isAuthenticated'](),controller['describe']);router[_0x9051('0xa')]('/whoami',auth[_0x9051('0x9')](),controller[_0x9051('0xb')]);router[_0x9051('0xa')](_0x9051('0xc'),auth[_0x9051('0x9')](),controller[_0x9051('0xd')]);router[_0x9051('0xa')](_0x9051('0xe'),controller[_0x9051('0xf')]);router[_0x9051('0xa')]('/:id/contacts',auth['isAuthenticated'](),controller[_0x9051('0x10')]);router['get'](_0x9051('0x11'),auth[_0x9051('0x9')](),controller[_0x9051('0x12')]);router[_0x9051('0xa')](_0x9051('0x13'),auth[_0x9051('0x9')](),controller['getVoiceQueuesRt']);router['get'](_0x9051('0x14'),auth['isAuthenticated'](),controller['getGroups']);router[_0x9051('0xa')]('/:id/recordings',auth['isAuthenticated'](),controller[_0x9051('0x15')]);router[_0x9051('0xa')]('/:id/screen_recordings',auth[_0x9051('0x9')](),controller[_0x9051('0x16')]);router[_0x9051('0xa')](_0x9051('0x17'),auth[_0x9051('0x9')](),controller[_0x9051('0x18')]);router[_0x9051('0xa')](_0x9051('0x19'),auth[_0x9051('0x9')](),controller[_0x9051('0x1a')]);router['get']('/:id/mail/interactions',auth['isAuthenticated'](),controller[_0x9051('0x1b')]);router[_0x9051('0xa')]('/:id/sms/interactions',auth[_0x9051('0x9')](),controller[_0x9051('0x1c')]);router[_0x9051('0xa')](_0x9051('0x1d'),auth[_0x9051('0x9')](),controller[_0x9051('0x1e')]);router[_0x9051('0xa')]('/:id/whatsapp/interactions',auth[_0x9051('0x9')](),controller['getWhatsappInteractions']);router[_0x9051('0xa')](_0x9051('0x1f'),auth[_0x9051('0x9')](),controller['getTeams']);router[_0x9051('0xa')]('/:id/lists',auth['isAuthenticated'](),controller[_0x9051('0x20')]);router[_0x9051('0xa')](_0x9051('0x21'),auth[_0x9051('0x9')](),controller[_0x9051('0x22')]);router[_0x9051('0xa')](_0x9051('0x23'),auth[_0x9051('0x9')](),controller[_0x9051('0x24')]);router['get']('/:id/fax_accounts',auth['isAuthenticated'](),controller['getFaxAccounts']);router[_0x9051('0xa')]('/:id/mail_accounts',auth[_0x9051('0x9')](),controller['getMailAccounts']);router[_0x9051('0xa')](_0x9051('0x25'),auth[_0x9051('0x9')](),controller[_0x9051('0x26')]);router[_0x9051('0xa')]('/:id/sms_accounts',auth[_0x9051('0x9')](),controller[_0x9051('0x27')]);router['get'](_0x9051('0x28'),auth['isAuthenticated'](),controller[_0x9051('0x29')]);router[_0x9051('0xa')](_0x9051('0x2a'),auth['isAuthenticated'](),controller['getWhatsappAccounts']);router['get'](_0x9051('0x2b'),auth[_0x9051('0x9')](),controller[_0x9051('0x2c')]);router['get']('/:id/scheduled_calls',auth[_0x9051('0x9')](),controller[_0x9051('0x2d')]);router[_0x9051('0xa')](_0x9051('0x2e'),auth['isAuthenticated'](),controller[_0x9051('0x2f')]);router['post']('/create_many',auth[_0x9051('0x9')](),controller['bulkCreate']);router[_0x9051('0x30')](_0x9051('0x31'),auth[_0x9051('0x9')](),controller[_0x9051('0x32')]);router['post']('/',auth[_0x9051('0x9')](),controller[_0x9051('0x33')]);router[_0x9051('0x30')](_0x9051('0x11'),auth[_0x9051('0x9')](),controller[_0x9051('0x34')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x73a4f9,_0x4da4a7,_0x4f0e17){_0x4f0e17(null,path['join'](config[_0x9051('0x35')],'server/files/images/'));},'filename':function(_0x443174,_0x18cdd3,_0x353c23){_0x353c23(null,util[_0x9051('0x36')](_0x9051('0x37'),Date[_0x9051('0x38')](),_0x18cdd3['originalname']));}})});router[_0x9051('0x30')](_0x9051('0xe'),upload[_0x9051('0x39')]('file'),controller[_0x9051('0x3a')]);router[_0x9051('0x30')](_0x9051('0x3b'),auth[_0x9051('0x9')](),controller[_0x9051('0x3c')]);router[_0x9051('0x30')](_0x9051('0x3d'),auth[_0x9051('0x9')](),controller[_0x9051('0x3e')]);router[_0x9051('0x30')](_0x9051('0x3f'),auth['isAuthenticated'](),controller['pause']);router[_0x9051('0x30')](_0x9051('0x40'),auth[_0x9051('0x9')](),controller['unpause']);router[_0x9051('0x30')]('/:id/teams',auth[_0x9051('0x9')](),controller['addTeams']);router[_0x9051('0x30')]('/:id/chat_interactions',auth[_0x9051('0x9')](),controller[_0x9051('0x41')]);router[_0x9051('0x30')](_0x9051('0x42'),auth['isAuthenticated'](),controller[_0x9051('0x43')]);router['post'](_0x9051('0x44'),auth[_0x9051('0x9')](),controller[_0x9051('0x45')]);router[_0x9051('0x30')]('/:id/sms_interactions',auth['isAuthenticated'](),controller[_0x9051('0x46')]);router[_0x9051('0x30')]('/:id/openchannel_interactions',auth[_0x9051('0x9')](),controller[_0x9051('0x47')]);router[_0x9051('0x30')](_0x9051('0x48'),auth[_0x9051('0x9')](),controller[_0x9051('0x49')]);router[_0x9051('0x30')](_0x9051('0x4a'),auth[_0x9051('0x9')](),controller[_0x9051('0x4b')]);router[_0x9051('0x30')]('/:id/mail_accounts',auth[_0x9051('0x9')](),controller[_0x9051('0x4c')]);router[_0x9051('0x30')](_0x9051('0x25'),auth['isAuthenticated'](),controller['addOpenchannelAccounts']);router['post'](_0x9051('0x4d'),auth['isAuthenticated'](),controller[_0x9051('0x4e')]);router[_0x9051('0x30')](_0x9051('0x28'),auth[_0x9051('0x9')](),controller[_0x9051('0x4f')]);router[_0x9051('0x30')](_0x9051('0x2a'),auth[_0x9051('0x9')](),controller[_0x9051('0x50')]);router['post'](_0x9051('0x2b'),auth[_0x9051('0x9')](),controller[_0x9051('0x51')]);router['post'](_0x9051('0x2e'),auth[_0x9051('0x9')](),controller['createApiKey']);router[_0x9051('0x52')](_0x9051('0xc'),auth[_0x9051('0x9')](),controller[_0x9051('0x53')]);router[_0x9051('0x52')](_0x9051('0x54'),auth[_0x9051('0x9')](),controller[_0x9051('0x55')]);router[_0x9051('0x56')](_0x9051('0x11'),auth[_0x9051('0x9')](),controller[_0x9051('0x57')]);router[_0x9051('0x56')]('/:id/teams',auth[_0x9051('0x9')](),controller[_0x9051('0x58')]);router['delete'](_0x9051('0xc'),auth['isAuthenticated'](),controller[_0x9051('0x59')]);router[_0x9051('0x56')]('/:id/chat_interactions',auth[_0x9051('0x9')](),controller['removeChatInteractions']);router['delete']('/:id/mail_interactions',auth[_0x9051('0x9')](),controller[_0x9051('0x5a')]);router[_0x9051('0x56')](_0x9051('0x44'),auth[_0x9051('0x9')](),controller[_0x9051('0x5b')]);router[_0x9051('0x56')]('/:id/sms_interactions',auth[_0x9051('0x9')](),controller[_0x9051('0x5c')]);router['delete'](_0x9051('0x5d'),auth[_0x9051('0x9')](),controller['removeOpenchannelInteractions']);router[_0x9051('0x56')](_0x9051('0x48'),auth['isAuthenticated'](),controller[_0x9051('0x5e')]);router[_0x9051('0x56')](_0x9051('0x4a'),auth['isAuthenticated'](),controller[_0x9051('0x5f')]);router[_0x9051('0x56')]('/:id/mail_accounts',auth[_0x9051('0x9')](),controller[_0x9051('0x60')]);router[_0x9051('0x56')](_0x9051('0x25'),auth[_0x9051('0x9')](),controller[_0x9051('0x61')]);router[_0x9051('0x56')](_0x9051('0x4d'),auth[_0x9051('0x9')](),controller[_0x9051('0x62')]);router[_0x9051('0x56')](_0x9051('0x28'),auth[_0x9051('0x9')](),controller[_0x9051('0x63')]);router['delete'](_0x9051('0x2a'),auth[_0x9051('0x9')](),controller['removeWhatsappAccounts']);router[_0x9051('0x56')](_0x9051('0x2b'),auth[_0x9051('0x9')](),controller[_0x9051('0x64')]);router[_0x9051('0x56')](_0x9051('0x2e'),auth[_0x9051('0x9')](),controller[_0x9051('0x65')]);module[_0x9051('0x66')]=router;
\ No newline at end of file
diff --git a/server/api/user/user.attributes.js b/server/api/user/user.attributes.js
index 77df51a..548361d 100644
--- a/server/api/user/user.attributes.js
+++ b/server/api/user/user.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x2ab9=['avpf','force_avp','icesupport','dtlsenable','dtlsverify','dtlsprivatekey','rtcp_mux','wss','encryption','dtlssetup','dtlscertfile','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','TEXT','permissions','map','VIRTUAL','phoneBarEnableScreenRecordingByAgent','true','false','screenrecording','blocked','blockedAt','loginAttempts','moment','lodash','exports','STRING','name','setDataValue','fullname','callerid','format','\x22%s\x22\x20<%s>','getDataValue','email','toLowerCase','ENUM','admin','user','agent','local','internal','accountcode','BOOLEAN','DATE','DEFAULT\x20PAUSE','INTEGER','dynamic','peer','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_FAILED_SCREEN','join','transport','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','shortinfo','auto','yes','nonat','update','outgoing','force_rport,comedia','nat','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','ulaw;alaw;gsm','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22gsm\x22]','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','always','accept','refuse','originate','uac','uas','fingerprint','certificate','active','actpass','get','isArray','udp'];(function(_0x17f0ef,_0x27f9fd){var _0x81615e=function(_0x5e2ce5){while(--_0x5e2ce5){_0x17f0ef['push'](_0x17f0ef['shift']());}};_0x81615e(++_0x27f9fd);}(_0x2ab9,0x120));var _0x92ab=function(_0x587008,_0x51e2c5){_0x587008=_0x587008-0x0;var _0xc8507=_0x2ab9[_0x587008];return _0xc8507;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x92ab('0x0'));var util=require('util');var _=require(_0x92ab('0x1'));module[_0x92ab('0x2')]={'name':{'type':Sequelize[_0x92ab('0x3')],'allowNull':![],'unique':_0x92ab('0x4'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x5b3f34){this[_0x92ab('0x5')]('name',_0x5b3f34);this['setDataValue']('defaultuser',_0x5b3f34);},'comment':'The\x20name\x20of\x20the\x20user'},'fullname':{'type':Sequelize[_0x92ab('0x3')],'allowNull':![],'set':function(_0x37799d){this[_0x92ab('0x5')](_0x92ab('0x6'),_0x37799d);this[_0x92ab('0x5')](_0x92ab('0x7'),util[_0x92ab('0x8')](_0x92ab('0x9'),_0x37799d,this[_0x92ab('0xa')]('internal')));}},'alias':{'type':Sequelize[_0x92ab('0x3')]},'email':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x92ab('0xb'),'validate':{'isEmail':!![]},'set':function(_0x126f8a){if(_0x126f8a){this[_0x92ab('0x5')](_0x92ab('0xb'),_0x126f8a[_0x92ab('0xc')]());}}},'role':{'type':Sequelize[_0x92ab('0xd')](_0x92ab('0xe'),_0x92ab('0xf'),_0x92ab('0x10'),'telephone'),'allowNull':![]},'password':{'type':Sequelize[_0x92ab('0x3')],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize[_0x92ab('0x3')],'defaultValue':_0x92ab('0x11')},'internal':{'type':Sequelize['INTEGER'](0xb),'allowNull':![],'unique':_0x92ab('0x12'),'set':function(_0x45f779){this['setDataValue'](_0x92ab('0x12'),_0x45f779);this[_0x92ab('0x5')](_0x92ab('0x13'),_0x45f779);this[_0x92ab('0x5')](_0x92ab('0x7'),util[_0x92ab('0x8')](_0x92ab('0x9'),this[_0x92ab('0xa')](_0x92ab('0x6')),_0x45f779));}},'salt':{'type':Sequelize[_0x92ab('0x3')]},'phone':{'type':Sequelize['STRING']},'mobile':{'type':Sequelize[_0x92ab('0x3')]},'address':{'type':Sequelize[_0x92ab('0x3')]},'zipcode':{'type':Sequelize['STRING']},'userpic':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0x92ab('0x3')]},'country':{'type':Sequelize[_0x92ab('0x3')]},'online':{'type':Sequelize[_0x92ab('0x14')],'defaultValue':![]},'lastLoginAt':{'type':Sequelize[_0x92ab('0x15')]},'voicePause':{'type':Sequelize[_0x92ab('0x14')],'defaultValue':![]},'chatPause':{'type':Sequelize[_0x92ab('0x14')],'defaultValue':![]},'mailPause':{'type':Sequelize[_0x92ab('0x14')],'defaultValue':![]},'faxPause':{'type':Sequelize[_0x92ab('0x14')],'defaultValue':![]},'smsPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'whatsappPause':{'type':Sequelize[_0x92ab('0x14')],'defaultValue':![]},'openchannelPause':{'type':Sequelize[_0x92ab('0x14')],'defaultValue':![]},'pauseType':{'type':Sequelize[_0x92ab('0x3')],'defaultValue':_0x92ab('0x16')},'lastPauseAt':{'type':Sequelize[_0x92ab('0x15')]},'chatCapacity':{'type':Sequelize[_0x92ab('0x17')],'defaultValue':0x0},'mailCapacity':{'type':Sequelize[_0x92ab('0x17')],'defaultValue':0x0},'faxCapacity':{'type':Sequelize[_0x92ab('0x17')],'defaultValue':0x0},'smsCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whatsappCapacity':{'type':Sequelize[_0x92ab('0x17')],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize[_0x92ab('0x17')],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize[_0x92ab('0x14')],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize[_0x92ab('0x14')],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize[_0x92ab('0x17')](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize[_0x92ab('0x17')](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize[_0x92ab('0x14')],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize[_0x92ab('0x17')],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize[_0x92ab('0x14')],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize[_0x92ab('0x14')],'defaultValue':![]},'chanspy':{'type':Sequelize[_0x92ab('0x14')],'defaultValue':![]},'description':{'type':Sequelize[_0x92ab('0x3')],'allowNull':!![]},'host':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x92ab('0x18')},'ipaddr':{'type':Sequelize['STRING'],'allowNull':!![]},'port':{'type':Sequelize['INTEGER'](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize['STRING'],'allowNull':!![]},'regserver':{'type':Sequelize[_0x92ab('0x3')],'allowNull':!![]},'useragent':{'type':Sequelize[_0x92ab('0x3')],'allowNull':!![]},'lastms':{'type':Sequelize[_0x92ab('0x17')](0xb),'allowNull':!![]},'type':{'type':Sequelize['ENUM']('friend','user',_0x92ab('0x19')),'allowNull':!![],'defaultValue':'friend'},'context':{'type':Sequelize[_0x92ab('0x3')],'allowNull':!![],'defaultValue':'from-sip'},'callingpres':{'type':Sequelize[_0x92ab('0xd')](_0x92ab('0x1a'),_0x92ab('0x1b'),_0x92ab('0x1c'),_0x92ab('0x1d'),_0x92ab('0x1e'),'PROHIB_PASSED_SCREEN',_0x92ab('0x1f'),'PROHIB'),'allowNull':!![]},'deny':{'type':Sequelize['STRING'],'allowNull':!![]},'permit':{'type':Sequelize[_0x92ab('0x3')],'allowNull':!![]},'secret':{'type':Sequelize[_0x92ab('0x3')],'allowNull':!![]},'md5secret':{'type':Sequelize[_0x92ab('0x3')],'allowNull':!![]},'remotesecret':{'type':Sequelize[_0x92ab('0x3')],'allowNull':!![]},'transport':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':'udp','set':function(_0xc7521e){this[_0x92ab('0x5')]('transport',_0xc7521e?_0xc7521e[_0x92ab('0x20')](','):null);},'get':function(){return this[_0x92ab('0xa')]('transport')?this[_0x92ab('0xa')](_0x92ab('0x21'))['split'](','):null;},'comment':_0x92ab('0x22')},'dtmfmode':{'type':Sequelize[_0x92ab('0xd')](_0x92ab('0x23'),'info',_0x92ab('0x24'),'inband',_0x92ab('0x25')),'allowNull':!![],'defaultValue':_0x92ab('0x23')},'directmedia':{'type':Sequelize[_0x92ab('0xd')](_0x92ab('0x26'),'no',_0x92ab('0x27'),_0x92ab('0x28'),_0x92ab('0x29')),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x92ab('0xd')](_0x92ab('0x26'),'no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x92ab('0x3')],'allowNull':!![]},'directmediadeny':{'type':Sequelize[_0x92ab('0x3')],'allowNull':!![]},'nat':{'type':Sequelize[_0x92ab('0x3')],'allowNull':!![],'defaultValue':_0x92ab('0x2a'),'set':function(_0x2216b2){this[_0x92ab('0x5')](_0x92ab('0x2b'),_0x2216b2?_0x2216b2[_0x92ab('0x20')](','):null);},'get':function(){return this[_0x92ab('0xa')](_0x92ab('0x2b'))?this[_0x92ab('0xa')](_0x92ab('0x2b'))[_0x92ab('0x2c')](','):null;},'comment':_0x92ab('0x2d')},'callgroup':{'type':Sequelize[_0x92ab('0x3')]},'namedcallgroup':{'type':Sequelize[_0x92ab('0x3')]},'pickupgroup':{'type':Sequelize[_0x92ab('0x3')]},'namedpickupgroup':{'type':Sequelize[_0x92ab('0x3')]},'language':{'type':Sequelize[_0x92ab('0x3')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x92ab('0x3')]},'disallow':{'type':Sequelize[_0x92ab('0x3')],'allowNull':![],'defaultValue':'all'},'allow':{'type':Sequelize[_0x92ab('0x3')],'allowNull':![],'defaultValue':_0x92ab('0x2e'),'set':function(_0x3462d5){this['setDataValue'](_0x92ab('0x2f'),_0x3462d5?_0x3462d5[_0x92ab('0x20')](';'):'ulaw;alaw;gsm');},'get':function(){return this['getDataValue'](_0x92ab('0x2f'))?this[_0x92ab('0xa')](_0x92ab('0x2f'))[_0x92ab('0x2c')](';'):null;},'comment':_0x92ab('0x30')},'autoframing':{'type':Sequelize[_0x92ab('0xd')](_0x92ab('0x26'),'no'),'allowNull':!![]},'insecure':{'type':Sequelize[_0x92ab('0x3')],'allowNull':!![],'set':function(_0x4b0392){this[_0x92ab('0x5')](_0x92ab('0x31'),_0x4b0392?_0x4b0392[_0x92ab('0x20')](','):null);},'get':function(){return this[_0x92ab('0xa')](_0x92ab('0x31'))?this[_0x92ab('0xa')](_0x92ab('0x31'))[_0x92ab('0x2c')](','):null;},'comment':_0x92ab('0x32')},'trustrpid':{'type':Sequelize[_0x92ab('0xd')](_0x92ab('0x26'),'no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x92ab('0xd')](_0x92ab('0x26'),'no','never'),'allowNull':!![]},'promiscredir':{'type':Sequelize[_0x92ab('0xd')](_0x92ab('0x26'),'no'),'allowNull':!![]},'useclientcode':{'type':Sequelize['ENUM'](_0x92ab('0x26'),'no'),'allowNull':!![]},'accountcode':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'setvar':{'type':Sequelize[_0x92ab('0x3')],'allowNull':!![]},'callerid':{'type':Sequelize[_0x92ab('0x3')],'allowNull':!![],'defaultValue':'\x22\x22\x20<>'},'amaflags':{'type':Sequelize[_0x92ab('0x3')],'allowNull':!![]},'callcounter':{'type':Sequelize[_0x92ab('0xd')](_0x92ab('0x26'),'no'),'allowNull':!![],'defaultValue':'yes'},'busylevel':{'type':Sequelize[_0x92ab('0x17')](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize['ENUM'](_0x92ab('0x26'),'no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize[_0x92ab('0xd')](_0x92ab('0x26'),'no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize[_0x92ab('0xd')](_0x92ab('0x26'),'no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize[_0x92ab('0xd')]('yes','no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize['STRING'],'allowNull':!![]},'template':{'type':Sequelize[_0x92ab('0x3')],'allowNull':!![]},'videosupport':{'type':Sequelize[_0x92ab('0xd')](_0x92ab('0x26'),'no',_0x92ab('0x33')),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x92ab('0x17')](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![]},'mailbox':{'type':Sequelize[_0x92ab('0x3')],'allowNull':!![]},'session_timers':{'type':Sequelize[_0x92ab('0xd')](_0x92ab('0x34'),_0x92ab('0x35'),_0x92ab('0x36')),'allowNull':!![]},'session_expires':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize[_0x92ab('0x17')](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize['ENUM'](_0x92ab('0x37'),_0x92ab('0x38')),'allowNull':!![],'defaultValue':_0x92ab('0x38')},'t38pt_usertpsource':{'type':Sequelize[_0x92ab('0x3')],'allowNull':!![]},'regexten':{'type':Sequelize[_0x92ab('0x3')],'allowNull':!![]},'fromdomain':{'type':Sequelize[_0x92ab('0x3')],'allowNull':!![]},'fromuser':{'type':Sequelize[_0x92ab('0x3')],'allowNull':!![]},'qualify':{'type':Sequelize['ENUM'](_0x92ab('0x26'),'no'),'allowNull':!![],'defaultValue':_0x92ab('0x26')},'keepalive':{'type':Sequelize[_0x92ab('0x17')](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize[_0x92ab('0x3')],'allowNull':!![]},'defaultuser':{'type':Sequelize[_0x92ab('0x3')],'allowNull':!![]},'rtptimeout':{'type':Sequelize[_0x92ab('0x17')](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize[_0x92ab('0x17')](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize['ENUM'](_0x92ab('0x26'),'no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x92ab('0x3')],'allowNull':!![]},'callbackextension':{'type':Sequelize['STRING'],'allowNull':!![]},'timert1':{'type':Sequelize[_0x92ab('0x17')](0xb),'allowNull':!![]},'timerb':{'type':Sequelize[_0x92ab('0x17')](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize[_0x92ab('0x3')],'allowNull':!![]},'contactdeny':{'type':Sequelize[_0x92ab('0x3')],'allowNull':!![]},'contactacl':{'type':Sequelize['STRING'],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize[_0x92ab('0x3')],'allowNull':!![]},'use_q850_reason':{'type':Sequelize[_0x92ab('0x3')],'allowNull':!![]},'maxforwards':{'type':Sequelize[_0x92ab('0x17')](0xb),'allowNull':!![]},'encryption':{'type':Sequelize[_0x92ab('0xd')](_0x92ab('0x26'),'no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize[_0x92ab('0xd')](_0x92ab('0x26'),'no'),'allowNull':!![]},'force_avp':{'type':Sequelize[_0x92ab('0xd')](_0x92ab('0x26'),'no'),'allowNull':!![]},'icesupport':{'type':Sequelize[_0x92ab('0xd')](_0x92ab('0x26'),'no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize[_0x92ab('0xd')](_0x92ab('0x26'),'no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize['ENUM'](_0x92ab('0x26'),'no',_0x92ab('0x39'),_0x92ab('0x3a')),'allowNull':!![]},'dtlsrekey':{'type':Sequelize[_0x92ab('0x17')](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize[_0x92ab('0x3')],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize[_0x92ab('0x3')],'allowNull':!![]},'dtlscipher':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlscafile':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlscapath':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlssetup':{'type':Sequelize[_0x92ab('0xd')](_0x92ab('0x3b'),'passive',_0x92ab('0x3c')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x92ab('0x3')],'allowNull':!![]},'usereqphone':{'type':Sequelize[_0x92ab('0xd')](_0x92ab('0x26'),'no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize['STRING'],'allowNull':!![]},'recordofffeature':{'type':Sequelize['STRING'],'allowNull':!![]},'call_limit':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize[_0x92ab('0xd')](_0x92ab('0x26'),'no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize[_0x92ab('0xd')]('yes','no'),'allowNull':!![]},'vmexten':{'type':Sequelize[_0x92ab('0x3')],'allowNull':!![]},'mohinterpret':{'type':Sequelize[_0x92ab('0x3')],'allowNull':!![]},'mohsuggest':{'type':Sequelize[_0x92ab('0x3')],'allowNull':!![]},'parkinglot':{'type':Sequelize[_0x92ab('0x3')],'allowNull':!![]},'canreinvite':{'type':Sequelize[_0x92ab('0xd')](_0x92ab('0x26'),'no',_0x92ab('0x27'),'update','update,nonat'),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize[_0x92ab('0x3')]},'resetPasswordExpires':{'type':Sequelize[_0x92ab('0x15')]},'showWebBar':{'type':Sequelize[_0x92ab('0x17')],'defaultValue':0x0,'set':function(_0x25a6d8){this[_0x92ab('0x5')]('showWebBar',_0x25a6d8);var _0x1651fd=this[_0x92ab('0x3d')]({'plain':!![]});switch(_0x25a6d8){case 0x0:case 0x1:var _0x4fb46e=_0x1651fd[_0x92ab('0x21')]?_[_0x92ab('0x3e')](_0x1651fd[_0x92ab('0x21')])?_0x1651fd[_0x92ab('0x21')][_0x92ab('0x20')]():_0x1651fd[_0x92ab('0x21')]:'udp';if(_0x4fb46e==='wss'){_0x4fb46e=_0x92ab('0x3f');}this[_0x92ab('0x5')](_0x92ab('0x21'),_0x4fb46e);this[_0x92ab('0x5')]('encryption','no');this[_0x92ab('0x5')](_0x92ab('0x40'),null);this[_0x92ab('0x5')](_0x92ab('0x41'),null);this[_0x92ab('0x5')](_0x92ab('0x42'),null);this[_0x92ab('0x5')](_0x92ab('0x43'),null);this['setDataValue'](_0x92ab('0x44'),null);this['setDataValue']('dtlssetup',null);this[_0x92ab('0x5')]('dtlscertfile',null);this[_0x92ab('0x5')](_0x92ab('0x45'),null);this['setDataValue'](_0x92ab('0x46'),'no');break;case 0x2:this[_0x92ab('0x5')](_0x92ab('0x21'),_0x92ab('0x47'));this[_0x92ab('0x5')](_0x92ab('0x48'),_0x92ab('0x26'));this['setDataValue'](_0x92ab('0x40'),_0x92ab('0x26'));this[_0x92ab('0x5')]('force_avp',_0x92ab('0x26'));this['setDataValue'](_0x92ab('0x42'),'yes');this[_0x92ab('0x5')](_0x92ab('0x43'),_0x92ab('0x26'));this[_0x92ab('0x5')](_0x92ab('0x44'),'no');this[_0x92ab('0x5')](_0x92ab('0x49'),_0x92ab('0x3c'));this[_0x92ab('0x5')](_0x92ab('0x4a'),_0x1651fd[_0x92ab('0x4a')]||_0x92ab('0x4b'));this[_0x92ab('0x5')]('dtlsprivatekey',_0x1651fd[_0x92ab('0x45')]||_0x92ab('0x4c'));this['setDataValue'](_0x92ab('0x46'),_0x92ab('0x26'));break;default:}}},'permissions':{'type':Sequelize[_0x92ab('0x4d')],'set':function(_0x1ca883){this[_0x92ab('0x5')](_0x92ab('0x4e'),_0x1ca883?_0x1ca883[_0x92ab('0x20')](','):[]);},'get':function(){return this[_0x92ab('0xa')](_0x92ab('0x4e'))?_[_0x92ab('0x4f')](this['getDataValue'](_0x92ab('0x4e'))[_0x92ab('0x2c')](','),function(_0x19b0ca){return parseInt(_0x19b0ca,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize[_0x92ab('0x3')]},'phoneBarNoReplyNumber':{'type':Sequelize[_0x92ab('0x3')]},'phoneBarBusyNumber':{'type':Sequelize[_0x92ab('0x3')]},'phoneBarUnconditional':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize[_0x92ab('0x14')],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize[_0x92ab('0x14')],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize[_0x92ab('0x14')],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize[_0x92ab('0x14')],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize[_0x92ab('0x17')],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize[_0x92ab('0x3')],'defaultValue':''},'crudPermissions':{'type':Sequelize[_0x92ab('0x17')],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize[_0x92ab('0xd')](_0x92ab('0x26'),'no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize[_0x92ab('0x14')],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize['STRING']},'passwordResetAt':{'type':Sequelize[_0x92ab('0x15')],'defaultValue':null},'phoneBarEnableJaws':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize[_0x92ab('0x14')],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize[_0x92ab('0x50')],'get':function(){return this[_0x92ab('0xa')](_0x92ab('0x51'))?this[_0x92ab('0xa')](_0x92ab('0x51')):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'hotdesk':{'type':Sequelize[_0x92ab('0x14')],'defaultValue':![]},'interface':{'type':Sequelize[_0x92ab('0x3')],'defaultValue':null},'privacyEnabled':{'type':Sequelize[_0x92ab('0x14')],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize['STRING'],'allowNull':!![]},'apiKeyIat':{'type':Sequelize[_0x92ab('0x3')],'allowNull':!![]},'screenrecording':{'type':Sequelize[_0x92ab('0x14')],'defaultValue':![],'set':function(_0xb430a1){if(typeof _0xb430a1==='string'){var _0x23f0a0=_0xb430a1==='1'?!![]:_0xb430a1==='0'?![]:_0xb430a1===_0x92ab('0x52')?!![]:_0xb430a1===_0x92ab('0x53')?![]:![];this[_0x92ab('0x5')](_0x92ab('0x54'),_0x23f0a0);}else{this[_0x92ab('0x5')](_0x92ab('0x54'),_0xb430a1);}}},'blocked':{'type':Sequelize[_0x92ab('0x14')],'defaultValue':![],'set':function(_0x5a4899){this[_0x92ab('0x5')](_0x92ab('0x55'),_0x5a4899);if(_0x5a4899===!![]){this[_0x92ab('0x5')](_0x92ab('0x56'),moment());this['setDataValue'](_0x92ab('0x57'),0x0);}else{this['setDataValue']('blockedAt',null);}}},'blockedAt':{'type':Sequelize['DATE'],'defaultValue':null},'loginAttempts':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'disabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}};
\ No newline at end of file
+var _0x8862=['accept','refuse','originate','uas','fingerprint','certificate','active','passive','showWebBar','encryption','avpf','force_avp','icesupport','dtlsenable','dtlsverify','dtlssetup','dtlscertfile','dtlsprivatekey','wss','actpass','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','rtcp_mux','TEXT','permissions','VIRTUAL','phoneBarEnableScreenRecordingByAgent','string','true','screenrecording','blocked','blockedAt','loginAttempts','sequelize','moment','util','lodash','exports','name','setDataValue','defaultuser','The\x20name\x20of\x20the\x20user','fullname','format','\x22%s\x22\x20<%s>','getDataValue','internal','STRING','email','toLowerCase','ENUM','local','INTEGER','accountcode','callerid','BOOLEAN','DEFAULT\x20PAUSE','DATE','dynamic','user','from-sip','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','PROHIB','udp','transport','join','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','info','auto','yes','update','outgoing','force_rport,comedia','nat','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','ulaw;alaw;gsm','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22gsm\x22]','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never','\x22\x22\x20<>','always'];(function(_0x14c3c3,_0x22e939){var _0x5740fd=function(_0x46488c){while(--_0x46488c){_0x14c3c3['push'](_0x14c3c3['shift']());}};_0x5740fd(++_0x22e939);}(_0x8862,0xd5));var _0x2886=function(_0x49c979,_0x5ebdbb){_0x49c979=_0x49c979-0x0;var _0x52b16c=_0x8862[_0x49c979];return _0x52b16c;};'use strict';var Sequelize=require(_0x2886('0x0'));var moment=require(_0x2886('0x1'));var util=require(_0x2886('0x2'));var _=require(_0x2886('0x3'));module[_0x2886('0x4')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x2886('0x5'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x3dd1c2){this[_0x2886('0x6')](_0x2886('0x5'),_0x3dd1c2);this[_0x2886('0x6')](_0x2886('0x7'),_0x3dd1c2);},'comment':_0x2886('0x8')},'fullname':{'type':Sequelize['STRING'],'allowNull':![],'set':function(_0x5720b0){this[_0x2886('0x6')](_0x2886('0x9'),_0x5720b0);this[_0x2886('0x6')]('callerid',util[_0x2886('0xa')](_0x2886('0xb'),_0x5720b0,this[_0x2886('0xc')](_0x2886('0xd'))));}},'alias':{'type':Sequelize[_0x2886('0xe')]},'email':{'type':Sequelize[_0x2886('0xe')],'allowNull':![],'unique':_0x2886('0xf'),'validate':{'isEmail':!![]},'set':function(_0x8a32be){if(_0x8a32be){this[_0x2886('0x6')](_0x2886('0xf'),_0x8a32be[_0x2886('0x10')]());}}},'role':{'type':Sequelize[_0x2886('0x11')]('admin','user','agent','telephone'),'allowNull':![]},'password':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize[_0x2886('0xe')],'defaultValue':_0x2886('0x12')},'internal':{'type':Sequelize[_0x2886('0x13')](0xb),'allowNull':![],'unique':'internal','set':function(_0x2ff659){this[_0x2886('0x6')](_0x2886('0xd'),_0x2ff659);this['setDataValue'](_0x2886('0x14'),_0x2ff659);this['setDataValue'](_0x2886('0x15'),util['format'](_0x2886('0xb'),this[_0x2886('0xc')](_0x2886('0x9')),_0x2ff659));}},'salt':{'type':Sequelize[_0x2886('0xe')]},'phone':{'type':Sequelize['STRING']},'mobile':{'type':Sequelize[_0x2886('0xe')]},'address':{'type':Sequelize[_0x2886('0xe')]},'zipcode':{'type':Sequelize[_0x2886('0xe')]},'userpic':{'type':Sequelize[_0x2886('0xe')]},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize[_0x2886('0xe')]},'online':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'lastLoginAt':{'type':Sequelize['DATE']},'voicePause':{'type':Sequelize[_0x2886('0x16')],'defaultValue':![]},'chatPause':{'type':Sequelize[_0x2886('0x16')],'defaultValue':![]},'mailPause':{'type':Sequelize[_0x2886('0x16')],'defaultValue':![]},'faxPause':{'type':Sequelize[_0x2886('0x16')],'defaultValue':![]},'smsPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'whatsappPause':{'type':Sequelize[_0x2886('0x16')],'defaultValue':![]},'openchannelPause':{'type':Sequelize[_0x2886('0x16')],'defaultValue':![]},'pauseType':{'type':Sequelize[_0x2886('0xe')],'defaultValue':_0x2886('0x17')},'lastPauseAt':{'type':Sequelize[_0x2886('0x18')]},'chatCapacity':{'type':Sequelize[_0x2886('0x13')],'defaultValue':0x0},'mailCapacity':{'type':Sequelize[_0x2886('0x13')],'defaultValue':0x0},'faxCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'smsCapacity':{'type':Sequelize[_0x2886('0x13')],'defaultValue':0x0},'whatsappCapacity':{'type':Sequelize[_0x2886('0x13')],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize[_0x2886('0x13')],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize[_0x2886('0x16')],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize[_0x2886('0x13')](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize[_0x2886('0x13')](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize[_0x2886('0x16')],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize[_0x2886('0x13')],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize[_0x2886('0x16')],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'chanspy':{'type':Sequelize[_0x2886('0x16')],'defaultValue':![]},'description':{'type':Sequelize[_0x2886('0xe')],'allowNull':!![]},'host':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x2886('0x19')},'ipaddr':{'type':Sequelize[_0x2886('0xe')],'allowNull':!![]},'port':{'type':Sequelize[_0x2886('0x13')](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize[_0x2886('0xe')],'allowNull':!![]},'regserver':{'type':Sequelize['STRING'],'allowNull':!![]},'useragent':{'type':Sequelize['STRING'],'allowNull':!![]},'lastms':{'type':Sequelize[_0x2886('0x13')](0xb),'allowNull':!![]},'type':{'type':Sequelize[_0x2886('0x11')]('friend',_0x2886('0x1a'),'peer'),'allowNull':!![],'defaultValue':'friend'},'context':{'type':Sequelize[_0x2886('0xe')],'allowNull':!![],'defaultValue':_0x2886('0x1b')},'callingpres':{'type':Sequelize['ENUM']('ALLOWED_NOT_SCREENED',_0x2886('0x1c'),_0x2886('0x1d'),_0x2886('0x1e'),_0x2886('0x1f'),_0x2886('0x20'),_0x2886('0x21'),_0x2886('0x22')),'allowNull':!![]},'deny':{'type':Sequelize[_0x2886('0xe')],'allowNull':!![]},'permit':{'type':Sequelize['STRING'],'allowNull':!![]},'secret':{'type':Sequelize[_0x2886('0xe')],'allowNull':!![]},'md5secret':{'type':Sequelize[_0x2886('0xe')],'allowNull':!![]},'remotesecret':{'type':Sequelize['STRING'],'allowNull':!![]},'transport':{'type':Sequelize[_0x2886('0xe')],'allowNull':!![],'defaultValue':_0x2886('0x23'),'set':function(_0x17a062){this[_0x2886('0x6')](_0x2886('0x24'),_0x17a062?_0x17a062[_0x2886('0x25')](','):null);},'get':function(){return this['getDataValue'](_0x2886('0x24'))?this['getDataValue'](_0x2886('0x24'))['split'](','):null;},'comment':_0x2886('0x26')},'dtmfmode':{'type':Sequelize['ENUM'](_0x2886('0x27'),_0x2886('0x28'),'shortinfo','inband',_0x2886('0x29')),'allowNull':!![],'defaultValue':_0x2886('0x27')},'directmedia':{'type':Sequelize[_0x2886('0x11')](_0x2886('0x2a'),'no','nonat',_0x2886('0x2b'),_0x2886('0x2c')),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x2886('0x11')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x2886('0xe')],'allowNull':!![]},'directmediadeny':{'type':Sequelize[_0x2886('0xe')],'allowNull':!![]},'nat':{'type':Sequelize[_0x2886('0xe')],'allowNull':!![],'defaultValue':_0x2886('0x2d'),'set':function(_0x2070ba){this[_0x2886('0x6')](_0x2886('0x2e'),_0x2070ba?_0x2070ba['join'](','):null);},'get':function(){return this[_0x2886('0xc')](_0x2886('0x2e'))?this[_0x2886('0xc')](_0x2886('0x2e'))[_0x2886('0x2f')](','):null;},'comment':_0x2886('0x30')},'callgroup':{'type':Sequelize[_0x2886('0xe')]},'namedcallgroup':{'type':Sequelize[_0x2886('0xe')]},'pickupgroup':{'type':Sequelize[_0x2886('0xe')]},'namedpickupgroup':{'type':Sequelize[_0x2886('0xe')]},'language':{'type':Sequelize['STRING'],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x2886('0xe')]},'disallow':{'type':Sequelize[_0x2886('0xe')],'allowNull':![],'defaultValue':'all'},'allow':{'type':Sequelize[_0x2886('0xe')],'allowNull':![],'defaultValue':_0x2886('0x31'),'set':function(_0x13dd7c){this['setDataValue']('allow',_0x13dd7c?_0x13dd7c['join'](';'):_0x2886('0x31'));},'get':function(){return this[_0x2886('0xc')](_0x2886('0x32'))?this[_0x2886('0xc')](_0x2886('0x32'))[_0x2886('0x2f')](';'):null;},'comment':_0x2886('0x33')},'autoframing':{'type':Sequelize[_0x2886('0x11')](_0x2886('0x2a'),'no'),'allowNull':!![]},'insecure':{'type':Sequelize[_0x2886('0xe')],'allowNull':!![],'set':function(_0x5e7e20){this[_0x2886('0x6')](_0x2886('0x34'),_0x5e7e20?_0x5e7e20[_0x2886('0x25')](','):null);},'get':function(){return this[_0x2886('0xc')](_0x2886('0x34'))?this[_0x2886('0xc')](_0x2886('0x34'))[_0x2886('0x2f')](','):null;},'comment':_0x2886('0x35')},'trustrpid':{'type':Sequelize[_0x2886('0x11')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize['ENUM'](_0x2886('0x2a'),'no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x2886('0x11')](_0x2886('0x2a'),'no',_0x2886('0x36')),'allowNull':!![]},'promiscredir':{'type':Sequelize[_0x2886('0x11')](_0x2886('0x2a'),'no'),'allowNull':!![]},'useclientcode':{'type':Sequelize['ENUM'](_0x2886('0x2a'),'no'),'allowNull':!![]},'accountcode':{'type':Sequelize[_0x2886('0x13')](0xb),'allowNull':!![]},'setvar':{'type':Sequelize[_0x2886('0xe')],'allowNull':!![]},'callerid':{'type':Sequelize[_0x2886('0xe')],'allowNull':!![],'defaultValue':_0x2886('0x37')},'amaflags':{'type':Sequelize[_0x2886('0xe')],'allowNull':!![]},'callcounter':{'type':Sequelize['ENUM'](_0x2886('0x2a'),'no'),'allowNull':!![],'defaultValue':_0x2886('0x2a')},'busylevel':{'type':Sequelize[_0x2886('0x13')](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize[_0x2886('0x11')](_0x2886('0x2a'),'no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize[_0x2886('0x11')](_0x2886('0x2a'),'no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize[_0x2886('0x11')](_0x2886('0x2a'),'no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize[_0x2886('0x11')](_0x2886('0x2a'),'no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize[_0x2886('0xe')],'allowNull':!![]},'template':{'type':Sequelize[_0x2886('0xe')],'allowNull':!![]},'videosupport':{'type':Sequelize[_0x2886('0x11')](_0x2886('0x2a'),'no',_0x2886('0x38')),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize['ENUM'](_0x2886('0x2a'),'no'),'allowNull':!![]},'mailbox':{'type':Sequelize[_0x2886('0xe')],'allowNull':!![]},'session_timers':{'type':Sequelize[_0x2886('0x11')](_0x2886('0x39'),_0x2886('0x3a'),_0x2886('0x3b')),'allowNull':!![]},'session_expires':{'type':Sequelize[_0x2886('0x13')](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize['ENUM']('uac',_0x2886('0x3c')),'allowNull':!![],'defaultValue':_0x2886('0x3c')},'t38pt_usertpsource':{'type':Sequelize[_0x2886('0xe')],'allowNull':!![]},'regexten':{'type':Sequelize[_0x2886('0xe')],'allowNull':!![]},'fromdomain':{'type':Sequelize[_0x2886('0xe')],'allowNull':!![]},'fromuser':{'type':Sequelize[_0x2886('0xe')],'allowNull':!![]},'qualify':{'type':Sequelize['ENUM'](_0x2886('0x2a'),'no'),'allowNull':!![],'defaultValue':_0x2886('0x2a')},'keepalive':{'type':Sequelize[_0x2886('0x13')](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize[_0x2886('0xe')],'allowNull':!![]},'defaultuser':{'type':Sequelize['STRING'],'allowNull':!![]},'rtptimeout':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize[_0x2886('0x13')](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize[_0x2886('0x13')](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize[_0x2886('0x11')](_0x2886('0x2a'),'no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x2886('0xe')],'allowNull':!![]},'callbackextension':{'type':Sequelize[_0x2886('0xe')],'allowNull':!![]},'timert1':{'type':Sequelize[_0x2886('0x13')](0xb),'allowNull':!![]},'timerb':{'type':Sequelize[_0x2886('0x13')](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize[_0x2886('0x13')](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize[_0x2886('0xe')],'allowNull':!![]},'contactdeny':{'type':Sequelize[_0x2886('0xe')],'allowNull':!![]},'contactacl':{'type':Sequelize[_0x2886('0xe')],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize['STRING'],'allowNull':!![]},'use_q850_reason':{'type':Sequelize['STRING'],'allowNull':!![]},'maxforwards':{'type':Sequelize[_0x2886('0x13')](0xb),'allowNull':!![]},'encryption':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize[_0x2886('0x11')](_0x2886('0x2a'),'no'),'allowNull':!![]},'force_avp':{'type':Sequelize[_0x2886('0x11')]('yes','no'),'allowNull':!![]},'icesupport':{'type':Sequelize[_0x2886('0x11')]('yes','no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize[_0x2886('0x11')]('yes','no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize[_0x2886('0x11')]('yes','no',_0x2886('0x3d'),_0x2886('0x3e')),'allowNull':!![]},'dtlsrekey':{'type':Sequelize[_0x2886('0x13')](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize[_0x2886('0xe')],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize[_0x2886('0xe')],'allowNull':!![]},'dtlscipher':{'type':Sequelize[_0x2886('0xe')],'allowNull':!![]},'dtlscafile':{'type':Sequelize[_0x2886('0xe')],'allowNull':!![]},'dtlscapath':{'type':Sequelize[_0x2886('0xe')],'allowNull':!![]},'dtlssetup':{'type':Sequelize[_0x2886('0x11')](_0x2886('0x3f'),_0x2886('0x40'),'actpass'),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x2886('0xe')],'allowNull':!![]},'usereqphone':{'type':Sequelize[_0x2886('0x11')](_0x2886('0x2a'),'no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x2886('0xe')],'allowNull':!![]},'recordofffeature':{'type':Sequelize['STRING'],'allowNull':!![]},'call_limit':{'type':Sequelize[_0x2886('0x13')](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize[_0x2886('0x11')](_0x2886('0x2a'),'no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize[_0x2886('0x11')](_0x2886('0x2a'),'no'),'allowNull':!![]},'vmexten':{'type':Sequelize[_0x2886('0xe')],'allowNull':!![]},'mohinterpret':{'type':Sequelize[_0x2886('0xe')],'allowNull':!![]},'mohsuggest':{'type':Sequelize['STRING'],'allowNull':!![]},'parkinglot':{'type':Sequelize['STRING'],'allowNull':!![]},'canreinvite':{'type':Sequelize[_0x2886('0x11')](_0x2886('0x2a'),'no','nonat',_0x2886('0x2b'),'update,nonat'),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize[_0x2886('0xe')]},'resetPasswordExpires':{'type':Sequelize[_0x2886('0x18')]},'showWebBar':{'type':Sequelize[_0x2886('0x13')],'defaultValue':0x0,'set':function(_0x528f0f){this[_0x2886('0x6')](_0x2886('0x41'),_0x528f0f);var _0x50f94c=this['get']({'plain':!![]});switch(_0x528f0f){case 0x0:case 0x1:var _0x93986a=_0x50f94c[_0x2886('0x24')]?_['isArray'](_0x50f94c['transport'])?_0x50f94c['transport'][_0x2886('0x25')]():_0x50f94c[_0x2886('0x24')]:_0x2886('0x23');if(_0x93986a==='wss'){_0x93986a='udp';}this['setDataValue'](_0x2886('0x24'),_0x93986a);this['setDataValue'](_0x2886('0x42'),'no');this[_0x2886('0x6')](_0x2886('0x43'),null);this['setDataValue'](_0x2886('0x44'),null);this['setDataValue'](_0x2886('0x45'),null);this[_0x2886('0x6')](_0x2886('0x46'),null);this['setDataValue'](_0x2886('0x47'),null);this[_0x2886('0x6')](_0x2886('0x48'),null);this[_0x2886('0x6')](_0x2886('0x49'),null);this[_0x2886('0x6')](_0x2886('0x4a'),null);this[_0x2886('0x6')]('rtcp_mux','no');break;case 0x2:this['setDataValue'](_0x2886('0x24'),_0x2886('0x4b'));this['setDataValue'](_0x2886('0x42'),_0x2886('0x2a'));this['setDataValue'](_0x2886('0x43'),_0x2886('0x2a'));this[_0x2886('0x6')](_0x2886('0x44'),'yes');this[_0x2886('0x6')](_0x2886('0x45'),_0x2886('0x2a'));this[_0x2886('0x6')](_0x2886('0x46'),_0x2886('0x2a'));this[_0x2886('0x6')]('dtlsverify','no');this[_0x2886('0x6')]('dtlssetup',_0x2886('0x4c'));this['setDataValue'](_0x2886('0x49'),_0x50f94c[_0x2886('0x49')]||_0x2886('0x4d'));this[_0x2886('0x6')]('dtlsprivatekey',_0x50f94c[_0x2886('0x4a')]||_0x2886('0x4e'));this[_0x2886('0x6')](_0x2886('0x4f'),'yes');break;default:}}},'permissions':{'type':Sequelize[_0x2886('0x50')],'set':function(_0x501176){this[_0x2886('0x6')](_0x2886('0x51'),_0x501176?_0x501176[_0x2886('0x25')](','):[]);},'get':function(){return this[_0x2886('0xc')](_0x2886('0x51'))?_['map'](this['getDataValue'](_0x2886('0x51'))['split'](','),function(_0x1ecc79){return parseInt(_0x1ecc79,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize['STRING']},'phoneBarNoReplyNumber':{'type':Sequelize['STRING']},'phoneBarBusyNumber':{'type':Sequelize['STRING']},'phoneBarUnconditional':{'type':Sequelize[_0x2886('0x16')],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize[_0x2886('0x16')],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize[_0x2886('0x16')],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize[_0x2886('0x16')],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize[_0x2886('0x16')],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize[_0x2886('0x16')],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize[_0x2886('0x13')],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize[_0x2886('0xe')],'defaultValue':''},'crudPermissions':{'type':Sequelize[_0x2886('0x13')],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize[_0x2886('0x11')](_0x2886('0x2a'),'no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize[_0x2886('0x16')],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize['STRING']},'passwordResetAt':{'type':Sequelize['DATE'],'defaultValue':null},'phoneBarEnableJaws':{'type':Sequelize[_0x2886('0x16')],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize[_0x2886('0x16')],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize[_0x2886('0x52')],'get':function(){return this[_0x2886('0xc')](_0x2886('0x53'))?this[_0x2886('0xc')](_0x2886('0x53')):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize[_0x2886('0x16')],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize[_0x2886('0x16')],'defaultValue':![]},'hotdesk':{'type':Sequelize[_0x2886('0x16')],'defaultValue':![]},'interface':{'type':Sequelize['STRING'],'defaultValue':null},'privacyEnabled':{'type':Sequelize[_0x2886('0x16')],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize[_0x2886('0xe')],'allowNull':!![]},'apiKeyIat':{'type':Sequelize['STRING'],'allowNull':!![]},'screenrecording':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'set':function(_0x5a98ba){if(typeof _0x5a98ba===_0x2886('0x54')){var _0x2c9d62=_0x5a98ba==='1'?!![]:_0x5a98ba==='0'?![]:_0x5a98ba===_0x2886('0x55')?!![]:_0x5a98ba==='false'?![]:![];this[_0x2886('0x6')]('screenrecording',_0x2c9d62);}else{this[_0x2886('0x6')](_0x2886('0x56'),_0x5a98ba);}}},'blocked':{'type':Sequelize[_0x2886('0x16')],'defaultValue':![],'set':function(_0x218c86){this['setDataValue'](_0x2886('0x57'),_0x218c86);if(_0x218c86===!![]){this[_0x2886('0x6')](_0x2886('0x58'),moment());this[_0x2886('0x6')](_0x2886('0x59'),0x0);}else{this[_0x2886('0x6')](_0x2886('0x58'),null);}}},'blockedAt':{'type':Sequelize['DATE'],'defaultValue':null},'loginAttempts':{'type':Sequelize[_0x2886('0x13')],'defaultValue':0x0},'disabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}};
\ No newline at end of file
diff --git a/server/api/user/user.controller.js b/server/api/user/user.controller.js
index f6da24e..1553480 100644
--- a/server/api/user/user.controller.js
+++ b/server/api/user/user.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x3b56=['SquareProject','getSquareProjects','addSquareProjects','removeSquareProjects','getScheduledCalls','CmHopper','concat','$and','$or','$gt','$lt','$lte','$eq','$not','$notBetween','$in','$notIn','$like','$notLike','$iLike','$notILike','$overlap','$contains','lastName','phone','dialActive','retrieveApiKey','token','createApiKey','generateApiKey','iat','nonce','You\x20don\x27t\x20have\x20sufficient\x20privileges\x20to\x20access\x20this\x20resource.','removeApiKey','apiKeyNonce','apiKeyIat','API\x20key\x20not\x20available','whoami','html-pdf','eml-format','zip-dir','request-promise','mustache','util','path','sox','to-csv','ejs','squel','crypto','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','./user.socket','client','http','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','User,\x20%s,\x20%s','request\x20sent','User,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','sendStatus','status','end','json','count','offset','Content-Range','apply','save','update','destroy','get','Users','user','Agents','agent','Telephones','telephone','filter','ignore','map','value','includes','find','role','UserProfileResource','stack','name','User','rawAttributes','fieldName','key','differenceBy','query','intersection','model','fields','attributes','length','hasOwnProperty','limit','sort','where','filters','pick','type','VIRTUAL','sequelize','lower','col','merge','includeAll','include','findAll','show','params','keys','password','bulkCreate','body','describe','addContacts','ids','agent\x20role','admin','telephones','users','isNil','format','count\x20%s:\x20%s','create','internal','Setting','findById','securePassword','max','select\x20(select\x20IFNULL(max(internal)+1,1)\x20from\x20users\x20where\x20internal\x20<\x20md.internal)\x20as\x20\x27from\x27,\x20md.internal\x20-\x201\x20as\x20\x27to\x27\x20from\x20users\x20md\x20where\x20md.internal\x20!=\x201\x20and\x20not\x20exists\x20(select\x201\x20from\x20users\x20md2\x20where\x20md2.internal\x20=\x20md.internal\x20-\x201)','QueryTypes','SELECT','from','voicemail','email','permissions','101','102','103','113','110','104','105','106','107','108','109','100','111','114','VoiceMail','Unable\x20to\x20retrieve\x20the\x20current\x20user','autoAssociation','findOne','oldPassword','newPassword','authenticate','New\x20password\x20must\x20be\x20different\x20from\x20old\x20password','Unauthorized','addQueues','online','loginInPause','voicePause','interface','isValidChannel','Unknown\x20channel','add','capitalize','toLowerCase','Queues','penalty','spread','emit','Queue:save','voice','VoiceQueue','push','SIP/%s','each','UserVoiceQueueRt','upsert','removeQueues','channel','QueueId','Queue:remove','addAvatar','userpic','filename','join','root','server/files/images/logos/default_profile.png','download','existsSync','server/files/images/','getContacts','CmContact','options','List','Tag','color','tag','nolimit','getQueues','Queue','order','Unknown\x20role','getVoiceQueuesRt','getGroups','ChatGroup','VoiceRecording','UserId','ScreenRecording','rows','ChatInteraction','getChatInteractions','getOpenchannelInteractions','getMailInteractions','MailInteraction','getSmsInteractions','SmsInteraction','getFaxInteractions','getWhatsappInteractions','WhatsappInteraction','login','mobile','LOCAL/%s@from-sip/n','intrf','user:%s','user:forcelogout','headers','x-forwarded-for','connection','remoteAddress','socket','getVoiceQueues','MemberReport','forEach','YYYY-MM-DD\x20HH:mm:ss','all','getChannels','LOGIN','device','PAUSE','LOGININPAUSE','isMiddleware','logout','pause','updateAttributes','DEFAULT\x20PAUSE','unpause','mailPause','chatPause','faxPause','openchannelPause','smsPause','whatsapppause','pauseType','lastPauseAt','QueuePause','manual','mail','fax','whatsapp','openchannel','set','%s%s','Pause','getTeams','addTeams','Team','Voice','getChatQueues','setDataValue','getMailQueues','getSmsQueues','Sms','Whatsapp','getFaxQueues','Fax','Openchannel','flatten','getDataValue','removeTeams','Chat','getWhatsappQueues','getOpenchannelQueues','getLists','CmList','send','You\x20can\x27t\x20delete\x20yourself','addChatInteractions','omit','user_has_chat_interactions:save','removeChatInteractions','isArray','user_has_chat_interactions:remove','addMailInteractions','user_has_mail_interactions:save','removeMailInteractions','user_has_mail_interactions:remove','addFaxInteractions','removeFaxInteractions','user_has_fax_interactions:remove','addSmsInteractions','user_has_sms_interactions:save','removeSmsInteractions','user_has_sms_interactions:remove','addOpenchannelInteractions','user_has_openchannel_interactions:save','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','addWhatsappInteractions','user_has_whatsapp_interactions:save','removeWhatsappInteractions','VoicePrefix','getVoicePrefixes','getFaxAccounts','FaxAccount','addFaxAccounts','removeFaxAccounts','getMailAccounts','MailAccount','addMailAccounts','removeMailAccounts','getOpenchannelAccounts','OpenchannelAccount','addOpenchannelAccounts','removeOpenchannelAccounts','getSmsAccounts','SmsAccount','addSmsAccounts','ChatWebsite','getChatWebsites','addChatWebsites','removeChatWebsites','getWhatsappAccounts','WhatsappAccount','addWhatsappAccounts','removeWhatsappAccounts'];(function(_0x5db59c,_0x11cc79){var _0x2a1f41=function(_0x35cfa4){while(--_0x35cfa4){_0x5db59c['push'](_0x5db59c['shift']());}};_0x2a1f41(++_0x11cc79);}(_0x3b56,0x194));var _0x63b5=function(_0x50e09b,_0xac88a){_0x50e09b=_0x50e09b-0x0;var _0x17ec5f=_0x3b56[_0x50e09b];return _0x17ec5f;};'use strict';var pdf=require(_0x63b5('0x0'));var emlformat=require(_0x63b5('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x63b5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x63b5('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x63b5('0x4'));var util=require(_0x63b5('0x5'));var path=require(_0x63b5('0x6'));var sox=require(_0x63b5('0x7'));var csv=require(_0x63b5('0x8'));var ejs=require(_0x63b5('0x9'));var fs=require('fs');var _=require('lodash');var squel=require(_0x63b5('0xa'));var crypto=require(_0x63b5('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x63b5('0xc'));var toCsv=require(_0x63b5('0x8'));var querystring=require('querystring');var Papa=require(_0x63b5('0xd'));var Redis=require('ioredis');var authService=require(_0x63b5('0xe'));var qs=require(_0x63b5('0xf'));var as=require(_0x63b5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x63b5('0x11'))('api');var utils=require(_0x63b5('0x12'));var config=require(_0x63b5('0x13'));var db=require(_0x63b5('0x14'))['db'];config[_0x63b5('0x15')]=_[_0x63b5('0x16')](config[_0x63b5('0x15')],{'host':_0x63b5('0x17'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x63b5('0x15')]));require(_0x63b5('0x18'))['register'](socket);var jayson=require('jayson/promise');var client=jayson[_0x63b5('0x19')][_0x63b5('0x1a')]({'port':0x232a});function checkPasswordPattern(_0x32de06,_0x5ac941,_0x1d6e5e){if(_0x1d6e5e){var _0x4ab569=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x4ab569[_0x63b5('0x1b')](_0x5ac941)){return _0x32de06;}else{throw new db[(_0x63b5('0x1c'))][(_0x63b5('0x1d'))](_0x63b5('0x1e'));}}else{return _0x32de06;}}function respondWithRpcPromise(_0x211977,_0x2afde6,_0x112f06,_0xfdc45f){return new BPromise(function(_0x3f2768,_0x3bbaba){var _0x9d4508=_0xfdc45f||client;return _0x9d4508[_0x63b5('0x1f')](_0x211977,_0x112f06)[_0x63b5('0x20')](function(_0x4d9063){logger[_0x63b5('0x21')](_0x63b5('0x22'),_0x2afde6,_0x63b5('0x23'));logger['debug'](_0x63b5('0x24'),_0x2afde6,_0x63b5('0x23'),JSON[_0x63b5('0x25')](_0x4d9063));if(_0x4d9063[_0x63b5('0x26')]){if(_0x4d9063['error'][_0x63b5('0x27')]===0x1f4){logger[_0x63b5('0x26')](_0x63b5('0x22'),_0x2afde6,_0x4d9063['error']['message']);return _0x3bbaba(_0x4d9063[_0x63b5('0x26')][_0x63b5('0x28')]);}logger[_0x63b5('0x26')](_0x63b5('0x22'),_0x2afde6,_0x4d9063[_0x63b5('0x26')][_0x63b5('0x28')]);return _0x3f2768(_0x4d9063['error'][_0x63b5('0x28')]);}else{logger['info'](_0x63b5('0x22'),_0x2afde6,_0x63b5('0x23'));_0x3f2768(_0x4d9063['result']['message']);}})[_0x63b5('0x29')](function(_0x418a38){logger['error'](_0x63b5('0x22'),_0x2afde6,_0x418a38);_0x3bbaba(_0x418a38);});});}function respondWithStatusCode(_0x180c46,_0x1c901f){_0x1c901f=_0x1c901f||0xcc;return function(_0x17fbaf){if(_0x17fbaf){return _0x180c46[_0x63b5('0x2a')](_0x1c901f);}return _0x180c46[_0x63b5('0x2b')](_0x1c901f)[_0x63b5('0x2c')]();};}function respondWithResult(_0x58497c,_0x404326){_0x404326=_0x404326||0xc8;return function(_0x70b67){if(_0x70b67){return _0x58497c[_0x63b5('0x2b')](_0x404326)[_0x63b5('0x2d')](_0x70b67);}};}function respondWithFilteredResult(_0x453e05,_0x3ccc5e){return function(_0x1f2ff3){if(_0x1f2ff3){var _0xd5e80a=_0x1f2ff3[_0x63b5('0x2e')],_0xe6da69=_0x3ccc5e['offset'],_0x2c0f32=_0x3ccc5e[_0x63b5('0x2f')]+_0x3ccc5e['limit'],_0x290171;if(_0x2c0f32>=_0xd5e80a){_0x2c0f32=_0xd5e80a;_0x290171=0xc8;}else{_0x290171=0xce;}_0x453e05[_0x63b5('0x2b')](_0x290171);return _0x453e05['set'](_0x63b5('0x30'),_0xe6da69+'-'+_0x2c0f32+'/'+_0xd5e80a)[_0x63b5('0x2d')](_0x1f2ff3);}return null;};}function patchUpdates(_0x465890){return function(_0x1fd07c){try{jsonpatch[_0x63b5('0x31')](_0x1fd07c,_0x465890,!![]);}catch(_0x434ce7){return BPromise['reject'](_0x434ce7);}return _0x1fd07c[_0x63b5('0x32')]();};}function saveUpdates(_0x2deb47,_0x333a9d){return function(_0x4b638d){if(_0x4b638d){return _0x4b638d[_0x63b5('0x33')](_0x2deb47)[_0x63b5('0x20')](function(_0x3daef2){return _0x3daef2;});}return null;};}function removeEntity(_0x9563b7,_0x3732f2){return function(_0x479396){if(_0x479396){return _0x479396[_0x63b5('0x34')]()[_0x63b5('0x20')](function(){var _0x3c2dbe=_0x479396[_0x63b5('0x35')]({'plain':!![]});var _0x545bb6=[{'name':_0x63b5('0x36'),'value':_0x63b5('0x37'),'ignore':!![]},{'name':_0x63b5('0x38'),'value':_0x63b5('0x39'),'ignore':![]},{'name':_0x63b5('0x3a'),'value':_0x63b5('0x3b'),'ignore':![]}];var _0xda0b56=_(_0x545bb6)[_0x63b5('0x3c')](_0x63b5('0x3d'))[_0x63b5('0x3e')](_0x63b5('0x3f'))['value']();if(_[_0x63b5('0x40')](_0xda0b56,_0x3c2dbe['role'])){return;}var _0xb654d=_[_0x63b5('0x41')](_0x545bb6,[_0x63b5('0x3f'),_0x3c2dbe[_0x63b5('0x42')]])['name'];return db[_0x63b5('0x43')][_0x63b5('0x34')]({'where':{'type':_0xb654d,'resourceId':_0x3c2dbe['id']}})[_0x63b5('0x20')](function(){return _0x479396;});})[_0x63b5('0x20')](function(){_0x9563b7[_0x63b5('0x2b')](0xcc)[_0x63b5('0x2c')]();});}};}function handleEntityNotFound(_0x4a42a2,_0x2efd48){return function(_0x57f555){if(!_0x57f555){_0x4a42a2[_0x63b5('0x2a')](0x194);}return _0x57f555;};}function handleError(_0x9e4df0,_0x5ccdd2){_0x5ccdd2=_0x5ccdd2||0x1f4;return function(_0x2d95fe){logger['error'](_0x2d95fe[_0x63b5('0x44')]);if(_0x2d95fe['name']){delete _0x2d95fe[_0x63b5('0x45')];}_0x9e4df0['status'](_0x5ccdd2)['send'](_0x2d95fe);};}exports['index']=function(_0x4285b9,_0x1962f0){var _0x4352a5={},_0x13e7fd={},_0x5a32bd={'count':0x0,'rows':[]};var _0x165224=_[_0x63b5('0x3e')](db[_0x63b5('0x46')][_0x63b5('0x47')],function(_0x486756){return{'name':_0x486756[_0x63b5('0x48')],'type':_0x486756['type'][_0x63b5('0x49')]};});_0x13e7fd['model']=_[_0x63b5('0x4a')](_['map'](_0x165224,_0x63b5('0x45')),['password','salt']);_0x13e7fd[_0x63b5('0x4b')]=_['keys'](_0x4285b9[_0x63b5('0x4b')]);_0x13e7fd['filters']=_[_0x63b5('0x4c')](_0x13e7fd[_0x63b5('0x4d')],_0x13e7fd[_0x63b5('0x4b')]);_0x4352a5['attributes']=_[_0x63b5('0x4c')](_0x13e7fd['model'],qs[_0x63b5('0x4e')](_0x4285b9[_0x63b5('0x4b')][_0x63b5('0x4e')]));_0x4352a5[_0x63b5('0x4f')]=_0x4352a5[_0x63b5('0x4f')][_0x63b5('0x50')]?_0x4352a5[_0x63b5('0x4f')]:_0x13e7fd[_0x63b5('0x4d')];if(!_0x4285b9['query'][_0x63b5('0x51')]('nolimit')){_0x4352a5['limit']=qs[_0x63b5('0x52')](_0x4285b9[_0x63b5('0x4b')]['limit']);_0x4352a5[_0x63b5('0x2f')]=qs[_0x63b5('0x2f')](_0x4285b9[_0x63b5('0x4b')][_0x63b5('0x2f')]);}_0x4352a5['order']=qs[_0x63b5('0x53')](_0x4285b9['query'][_0x63b5('0x53')]);_0x4352a5[_0x63b5('0x54')]=qs[_0x63b5('0x55')](_[_0x63b5('0x56')](_0x4285b9[_0x63b5('0x4b')],_0x13e7fd[_0x63b5('0x55')]),_0x165224);if(_0x4285b9['query'][_0x63b5('0x3c')]){_0x4352a5[_0x63b5('0x54')]=_['merge'](_0x4352a5[_0x63b5('0x54')],{'$or':_[_0x63b5('0x3e')](_0x165224,function(_0x3c7744){if(_0x3c7744[_0x63b5('0x57')]!==_0x63b5('0x58')){return db[_0x63b5('0x59')][_0x63b5('0x54')](db[_0x63b5('0x59')]['fn'](_0x63b5('0x5a'),db[_0x63b5('0x59')][_0x63b5('0x5b')](_0x3c7744[_0x63b5('0x45')])),{'$like':db['sequelize']['fn']('lower','%'+_0x4285b9[_0x63b5('0x4b')][_0x63b5('0x3c')]+'%')});}})});}_0x4352a5=_[_0x63b5('0x5c')]({},_0x4352a5,_0x4285b9['options']);var _0x318c7d={'where':_0x4352a5[_0x63b5('0x54')]};return db[_0x63b5('0x46')][_0x63b5('0x2e')](_0x318c7d)[_0x63b5('0x20')](function(_0x28ab4e){_0x5a32bd[_0x63b5('0x2e')]=_0x28ab4e;if(_0x4285b9[_0x63b5('0x4b')][_0x63b5('0x5d')]){_0x4352a5[_0x63b5('0x5e')]=[{'all':!![]}];}return db[_0x63b5('0x46')][_0x63b5('0x5f')](_0x4352a5);})[_0x63b5('0x20')](function(_0x37dd20){_0x5a32bd['rows']=_0x37dd20;return _0x5a32bd;})[_0x63b5('0x20')](respondWithFilteredResult(_0x1962f0,_0x4352a5))['catch'](handleError(_0x1962f0,null));};exports[_0x63b5('0x60')]=function(_0x2e70f8,_0x4ad046){var _0x4f5376={'raw':![],'where':{'id':_0x2e70f8[_0x63b5('0x61')]['id']}},_0x45d729={};_0x45d729[_0x63b5('0x4d')]=_[_0x63b5('0x4a')](_[_0x63b5('0x62')](db[_0x63b5('0x46')]['rawAttributes']),[_0x63b5('0x63'),'salt']);_0x45d729[_0x63b5('0x4b')]=_[_0x63b5('0x62')](_0x2e70f8[_0x63b5('0x4b')]);_0x45d729[_0x63b5('0x55')]=_[_0x63b5('0x4c')](_0x45d729[_0x63b5('0x4d')],_0x45d729[_0x63b5('0x4b')]);_0x4f5376[_0x63b5('0x4f')]=_[_0x63b5('0x4c')](_0x45d729[_0x63b5('0x4d')],qs[_0x63b5('0x4e')](_0x2e70f8[_0x63b5('0x4b')][_0x63b5('0x4e')]));_0x4f5376[_0x63b5('0x4f')]=_0x4f5376[_0x63b5('0x4f')][_0x63b5('0x50')]?_0x4f5376[_0x63b5('0x4f')]:_0x45d729['model'];if(_0x2e70f8[_0x63b5('0x4b')][_0x63b5('0x5d')]){_0x4f5376['include']=[{'all':!![]}];}_0x4f5376=_[_0x63b5('0x5c')]({},_0x4f5376,_0x2e70f8['options']);return db[_0x63b5('0x46')]['find'](_0x4f5376)[_0x63b5('0x20')](handleEntityNotFound(_0x4ad046,null))[_0x63b5('0x20')](respondWithResult(_0x4ad046,null))[_0x63b5('0x29')](handleError(_0x4ad046,null));};exports[_0x63b5('0x64')]=function(_0x505ac4,_0x1c4b90){return db[_0x63b5('0x46')][_0x63b5('0x64')](_0x505ac4[_0x63b5('0x65')],{'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x1c4b90,0xc9))[_0x63b5('0x29')](handleError(_0x1c4b90,null));};exports[_0x63b5('0x33')]=function(_0x264f9f,_0x2fe49c){if(_0x264f9f[_0x63b5('0x65')]['id']){delete _0x264f9f[_0x63b5('0x65')]['id'];}delete _0x264f9f[_0x63b5('0x65')][_0x63b5('0x42')];return db[_0x63b5('0x46')][_0x63b5('0x41')]({'where':{'id':_0x264f9f[_0x63b5('0x61')]['id']}})[_0x63b5('0x20')](handleEntityNotFound(_0x2fe49c,null))['then'](saveUpdates(_0x264f9f['body'],null))['then'](respondWithResult(_0x2fe49c,null))[_0x63b5('0x29')](handleError(_0x2fe49c,null));};exports[_0x63b5('0x66')]=function(_0x2afb1b,_0x48245a){return db[_0x63b5('0x46')]['describe']()[_0x63b5('0x20')](respondWithResult(_0x48245a,null))[_0x63b5('0x29')](handleError(_0x48245a,null));};exports[_0x63b5('0x67')]=function(_0x5bbb59,_0x4aa043,_0x121b96){return db[_0x63b5('0x46')][_0x63b5('0x41')]({'where':{'id':_0x5bbb59[_0x63b5('0x61')]['id']}})[_0x63b5('0x20')](handleEntityNotFound(_0x4aa043,null))[_0x63b5('0x20')](function(_0x1a72cf){if(_0x1a72cf){return _0x1a72cf[_0x63b5('0x67')](_0x5bbb59[_0x63b5('0x65')][_0x63b5('0x68')],_['omit'](_0x5bbb59[_0x63b5('0x65')],[_0x63b5('0x68'),'id'])||{});}})[_0x63b5('0x20')](respondWithResult(_0x4aa043,null))[_0x63b5('0x29')](handleError(_0x4aa043,null));};var getLicense=function(_0x1650c7){return new BPromise(function(_0x1732e9,_0x28d892){var _0x28e674=0x0;_0x1650c7[_0x63b5('0x65')][_0x63b5('0x42')]===_0x63b5('0x39')&&_0x1732e9(_0x63b5('0x69'));return db[_0x63b5('0x46')][_0x63b5('0x2e')]({'where':{'$or':[{'role':_0x1650c7[_0x63b5('0x65')][_0x63b5('0x42')]==='telephone'?_0x63b5('0x3b'):[_0x63b5('0x6a'),_0x63b5('0x37')]}]}})[_0x63b5('0x20')](function(_0x4695b9){_0x28e674=_0x4695b9;return require('../../config/license/util')['getLicense']();})[_0x63b5('0x20')](function(_0x1e4c9b){var _0x100f9a=_0x1650c7['body'][_0x63b5('0x42')]===_0x63b5('0x3b')?_0x63b5('0x6b'):_0x63b5('0x6c');if(!_[_0x63b5('0x6d')](_0x1e4c9b[_0x100f9a])&&_0x28e674>=_0x1e4c9b[_0x100f9a]){return _0x28d892({'message':'License\x20limit\x20reached'});}return _0x1732e9(util[_0x63b5('0x6e')](_0x63b5('0x6f'),_0x100f9a,_0x28e674));})['catch'](function(_0x2ae262){return _0x28d892(_0x2ae262);});});};exports[_0x63b5('0x70')]=function(_0x2884f6,_0x3b15b4){return getLicense(_0x2884f6)[_0x63b5('0x20')](function(_0x2c957a){if(!_0x2884f6['body'][_0x63b5('0x71')]){var _0x202fdf;return db[_0x63b5('0x72')][_0x63b5('0x73')](0x1)[_0x63b5('0x20')](function(_0x1e6356){return checkPasswordPattern(_0x1e6356,_0x2884f6['body'][_0x63b5('0x63')],_0x1e6356[_0x63b5('0x74')]);})[_0x63b5('0x20')](function(_0xc633d6){_0x202fdf=_0xc633d6['min_internal'];return db[_0x63b5('0x46')][_0x63b5('0x75')](_0x63b5('0x71'));})[_0x63b5('0x20')](function(_0x17ab99){if(_['isNil'](_0x17ab99)){if(_0x202fdf){_0x2884f6['body'][_0x63b5('0x71')]=_0x202fdf;}else{_0x2884f6[_0x63b5('0x65')]['internal']=0x1;}}else{if(_[_0x63b5('0x6d')](_0x202fdf)||_0x202fdf==_0x17ab99){_0x2884f6['body']['internal']=_0x17ab99+0x1;}else if(_0x202fdf>_0x17ab99){_0x2884f6[_0x63b5('0x65')][_0x63b5('0x71')]=_0x202fdf;}else{return db[_0x63b5('0x59')][_0x63b5('0x4b')](_0x63b5('0x76'),{'type':db[_0x63b5('0x59')][_0x63b5('0x77')][_0x63b5('0x78')]})[_0x63b5('0x20')](function(_0x432e2d){if(_0x432e2d&&_0x432e2d[_0x63b5('0x50')]){for(var _0x136672=0x0,_0x66613f=_0x432e2d[_0x63b5('0x50')];_0x136672<_0x66613f&&_[_0x63b5('0x6d')](_0x2884f6[_0x63b5('0x65')]['internal']);_0x136672++){if(_0x202fdf<=_0x432e2d[_0x136672]['from']){_0x2884f6[_0x63b5('0x65')][_0x63b5('0x71')]=_0x432e2d[_0x136672][_0x63b5('0x79')];}else if(_0x202fdf>_0x432e2d[_0x136672][_0x63b5('0x79')]&&_0x202fdf<=_0x432e2d[_0x136672]['to']){_0x2884f6[_0x63b5('0x65')]['internal']=_0x202fdf;}}}if(_['isNil'](_0x2884f6[_0x63b5('0x65')][_0x63b5('0x71')])){_0x2884f6[_0x63b5('0x65')][_0x63b5('0x71')]=_0x17ab99+0x1;}});}}});}})[_0x63b5('0x20')](function(){if(_0x2884f6['body'][_0x63b5('0x7a')]){_0x2884f6[_0x63b5('0x65')]['mailbox']=_0x2884f6['body'][_0x63b5('0x71')];_0x2884f6[_0x63b5('0x65')]['VoiceMail']={'mailbox':_0x2884f6[_0x63b5('0x65')][_0x63b5('0x71')],'password':_0x2884f6['body'][_0x63b5('0x63')],'fullname':_0x2884f6[_0x63b5('0x65')]['fullname'],'email':_0x2884f6[_0x63b5('0x65')][_0x63b5('0x7b')]};}if(_0x2884f6[_0x63b5('0x65')]&&_0x2884f6[_0x63b5('0x65')]['role']==='agent'){if(!_0x2884f6[_0x63b5('0x65')]['permissions']){_0x2884f6[_0x63b5('0x65')][_0x63b5('0x7c')]=[_0x63b5('0x7d'),_0x63b5('0x7e'),_0x63b5('0x7f'),_0x63b5('0x80'),_0x63b5('0x81'),_0x63b5('0x82'),_0x63b5('0x83'),_0x63b5('0x84'),_0x63b5('0x85'),_0x63b5('0x86'),_0x63b5('0x87'),_0x63b5('0x88'),_0x63b5('0x89'),_0x63b5('0x8a')];}}return db[_0x63b5('0x46')][_0x63b5('0x70')](_0x2884f6['body'],{'include':[{'model':db[_0x63b5('0x8b')],'as':'VoiceMail'}]});})[_0x63b5('0x20')](function(_0x231f8a){if(_0x2884f6[_0x63b5('0x65')]['role']==='user')return _0x231f8a;var _0x3f5a66=_0x2884f6['user'][_0x63b5('0x35')]({'plain':!![]});if(!_0x3f5a66)throw new Error(_0x63b5('0x8c'));if(_0x3f5a66[_0x63b5('0x42')]===_0x63b5('0x37')){var _0x62f600=_0x231f8a[_0x63b5('0x35')]({'plain':!![]});var _0x32af82=[{'name':_0x63b5('0x38'),'value':'agent'},{'name':_0x63b5('0x3a'),'value':'telephone'}];var _0x539c5d=_[_0x63b5('0x41')](_0x32af82,['value',_0x62f600[_0x63b5('0x42')]])[_0x63b5('0x45')];return db['UserProfileSection']['find']({'where':{'name':_0x539c5d,'userProfileId':_0x3f5a66['userProfileId']},'raw':!![]})[_0x63b5('0x20')](function(_0x47da5e){if(_0x47da5e&&_0x47da5e[_0x63b5('0x8d')]===0x0){return db[_0x63b5('0x43')]['create']({'name':_0x62f600[_0x63b5('0x45')],'resourceId':_0x62f600['id'],'type':_0x47da5e[_0x63b5('0x45')],'sectionId':_0x47da5e['id']},{})['then'](function(){return _0x231f8a;});}else{return _0x231f8a;}})[_0x63b5('0x29')](function(_0x20f785){logger[_0x63b5('0x26')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x20f785);throw _0x20f785;});}return _0x231f8a;})[_0x63b5('0x20')](respondWithResult(_0x3b15b4,0xc9))['catch'](handleError(_0x3b15b4,null));};exports['changePassword']=function(_0x301e36,_0x11fce7,_0x2eacbb){var _0x776947=![];if(_0x301e36[_0x63b5('0x65')]['id']){delete _0x301e36[_0x63b5('0x65')]['id'];}return db[_0x63b5('0x72')][_0x63b5('0x8e')]({'attributes':['id',_0x63b5('0x74')]})[_0x63b5('0x20')](function(_0x321a0d){_0x776947=_0x321a0d[_0x63b5('0x74')];return db['User'][_0x63b5('0x41')]({'where':{'id':_0x301e36[_0x63b5('0x61')]['id']}});})['then'](function(_0x58c629){if(_0x58c629){if(_0x58c629['id']==_0x301e36[_0x63b5('0x37')]['id']){if(!_0x301e36[_0x63b5('0x65')][_0x63b5('0x8f')]||!_0x301e36[_0x63b5('0x65')][_0x63b5('0x90')]){throw new db[(_0x63b5('0x1c'))][(_0x63b5('0x1d'))]('Invalid\x20body\x20format.\x20Use\x20oldPassord\x20and\x20newPassword');}if(!_0x58c629[_0x63b5('0x91')](_0x301e36[_0x63b5('0x65')][_0x63b5('0x8f')])){throw new db[(_0x63b5('0x1c'))][(_0x63b5('0x1d'))]('Wrong\x20credentials');}if(_0x301e36['body'][_0x63b5('0x8f')]==_0x301e36[_0x63b5('0x65')][_0x63b5('0x90')]){throw new db[(_0x63b5('0x1c'))][(_0x63b5('0x1d'))](_0x63b5('0x92'));}return _0x58c629;}else if(_0x301e36[_0x63b5('0x37')][_0x63b5('0x42')]==_0x63b5('0x6a')){if(!_0x301e36[_0x63b5('0x65')][_0x63b5('0x90')]){throw new db['Sequelize'][(_0x63b5('0x1d'))]('Invalid\x20body\x20format.\x20Use\x20newPassword');}return _0x58c629;}else if(_0x301e36['user']['role']==_0x63b5('0x37')){if(!_0x301e36['body'][_0x63b5('0x90')]){throw new db[(_0x63b5('0x1c'))][(_0x63b5('0x1d'))]('Invalid\x20body\x20format.\x20Use\x20newPassword');}if(_0x58c629[_0x63b5('0x42')]!=_0x63b5('0x39')){throw new db[(_0x63b5('0x1c'))][(_0x63b5('0x1d'))](_0x63b5('0x93'));}return _0x58c629;}else{throw new db[(_0x63b5('0x1c'))][(_0x63b5('0x1d'))](_0x63b5('0x93'));}}return null;})[_0x63b5('0x20')](handleEntityNotFound(_0x11fce7,null))[_0x63b5('0x20')](function(_0x26ed02){return checkPasswordPattern(_0x26ed02,_0x301e36[_0x63b5('0x65')]['newPassword'],_0x776947);})['then'](saveUpdates({'password':_0x301e36[_0x63b5('0x65')][_0x63b5('0x90')],'passwordResetAt':_0x301e36['user']['id']==_0x301e36[_0x63b5('0x61')]['id']?moment():null},null))['then'](respondWithResult(_0x11fce7,null))[_0x63b5('0x29')](handleError(_0x11fce7,null));};exports[_0x63b5('0x94')]=function(_0x3e7944,_0x2aa642,_0x3cf296){var _0x495160=_0x3e7944[_0x63b5('0x65')]['channel'];return db['User'][_0x63b5('0x41')]({'where':{'id':_0x3e7944[_0x63b5('0x61')]['id']},'attributes':['id',_0x63b5('0x45'),_0x63b5('0x42'),_0x63b5('0x95'),_0x63b5('0x96'),_0x63b5('0x97'),_0x63b5('0x98')]})[_0x63b5('0x20')](handleEntityNotFound(_0x2aa642,null))[_0x63b5('0x20')](function(_0x35eadb){if(_0x35eadb){if(!utils[_0x63b5('0x99')](_0x495160)){throw new db[(_0x63b5('0x1c'))][(_0x63b5('0x1d'))](_0x63b5('0x9a'));}return _0x35eadb[_0x63b5('0x9b')+_[_0x63b5('0x9c')](_0x495160[_0x63b5('0x9d')]())+_0x63b5('0x9e')](_0x3e7944['body'][_0x63b5('0x68')],{'penalty':_0x3e7944[_0x63b5('0x65')][_0x63b5('0x9f')]||0x0})[_0x63b5('0xa0')](function(_0x580bed){for(var _0x274393=0x0;_0x274393<_0x3e7944[_0x63b5('0x65')]['ids'][_0x63b5('0x50')];_0x274393+=0x1){var _0x32c0db={'UserId':_0x3e7944[_0x63b5('0x61')]['id']};_0x32c0db[_[_0x63b5('0x9c')](_0x495160[_0x63b5('0x9d')]())+'QueueId']=_0x3e7944['body'][_0x63b5('0x68')][_0x274393];socket[_0x63b5('0xa1')]('user'+_[_0x63b5('0x9c')](_0x495160['toLowerCase']())+_0x63b5('0xa2'),_0x32c0db);}return _0x580bed;})[_0x63b5('0x20')](function(){if(_0x495160===_0x63b5('0xa3')){return db[_0x63b5('0xa4')][_0x63b5('0x5f')]({'where':{'id':_0x3e7944[_0x63b5('0x65')][_0x63b5('0x68')]||[]},'raw':!![],'attributes':['id','name']});}})[_0x63b5('0x20')](function(_0x802dca){var _0x53b860=_0x35eadb[_0x63b5('0x35')]({'plain':!![]});var _0x3b58b4=[];if(_0x495160==='voice'&&_0x53b860[_0x63b5('0x42')]===_0x63b5('0x39')&&_0x53b860[_0x63b5('0x95')]){for(var _0x187455=0x0;_0x187455<_0x802dca[_0x63b5('0x50')];_0x187455+=0x1){_0x3b58b4[_0x63b5('0xa5')]({'membername':_0x53b860['name'],'UserId':_0x53b860['id'],'queue_name':_0x802dca[_0x187455][_0x63b5('0x45')],'VoiceQueueId':_0x802dca[_0x187455]['id'],'interface':_[_0x63b5('0x6d')](_0x53b860['interface'])?util[_0x63b5('0x6e')](_0x63b5('0xa6'),_0x53b860['name']):_0x53b860[_0x63b5('0x98')],'paused':_0x53b860['voicePause']||![],'penalty':_0x3e7944[_0x63b5('0x65')]['penalty']||0x0});}return BPromise[_0x63b5('0xa7')](_0x3b58b4,function(_0x220dde){return db[_0x63b5('0xa8')][_0x63b5('0xa9')](_0x220dde);});}return _0x35eadb;});}})[_0x63b5('0x20')](respondWithStatusCode(_0x2aa642,null))['catch'](handleError(_0x2aa642,null));};exports[_0x63b5('0xaa')]=function(_0x168798,_0x1cdfd3,_0x4498af){var _0x242424;return db[_0x63b5('0x46')][_0x63b5('0x41')]({'where':{'id':_0x168798['params']['id']},'attributes':['id',_0x63b5('0x45'),_0x63b5('0x42')]})[_0x63b5('0x20')](handleEntityNotFound(_0x1cdfd3,null))[_0x63b5('0x20')](function(_0x4b9557){if(_0x4b9557){_0x242424=_0x4b9557;if(!_0x168798[_0x63b5('0x4b')][_0x63b5('0xab')]||!utils[_0x63b5('0x99')](_0x168798['query']['channel'])){throw new db['Sequelize'][(_0x63b5('0x1d'))](_0x63b5('0x9a'));}return _0x4b9557['remove'+_['capitalize'](_0x168798[_0x63b5('0x4b')][_0x63b5('0xab')][_0x63b5('0x9d')]())+'Queues'](_0x168798[_0x63b5('0x4b')]['ids']);}})['then'](function(_0x116111){for(var _0x436f43=0x0;_0x436f43<_0x168798[_0x63b5('0x4b')][_0x63b5('0x68')][_0x63b5('0x50')];_0x436f43+=0x1){var _0xd74d91={'UserId':_0x168798['params']['id']};_0xd74d91[_[_0x63b5('0x9c')](_0x168798['query'][_0x63b5('0xab')]['toLowerCase']())+_0x63b5('0xac')]=_0x168798[_0x63b5('0x4b')][_0x63b5('0x68')][_0x436f43];socket['emit'](_0x63b5('0x37')+_[_0x63b5('0x9c')](_0x168798[_0x63b5('0x4b')][_0x63b5('0xab')][_0x63b5('0x9d')]())+_0x63b5('0xad'),_0xd74d91);}return _0x116111;})[_0x63b5('0x20')](function(){if(_0x168798[_0x63b5('0x4b')]['channel']===_0x63b5('0xa3')){return db[_0x63b5('0xa8')][_0x63b5('0x34')]({'where':{'UserId':_0x168798['params']['id'],'VoiceQueueId':_0x168798[_0x63b5('0x4b')][_0x63b5('0x68')]},'individualHooks':!![]})[_0x63b5('0x20')](function(){return _0x242424;});}return _0x242424;})[_0x63b5('0x20')](respondWithStatusCode(_0x1cdfd3,null))[_0x63b5('0x29')](handleError(_0x1cdfd3,null));};exports[_0x63b5('0xae')]=function(_0x583202,_0xf89209,_0x55d2a4){_0x583202[_0x63b5('0x65')][_0x63b5('0xaf')]=_0x583202['file'][_0x63b5('0xb0')];return db['User'][_0x63b5('0x41')]({'where':{'id':_0x583202['params']['id']}})['then'](handleEntityNotFound(_0xf89209,null))['then'](saveUpdates(_0x583202[_0x63b5('0x65')],null))[_0x63b5('0x20')](respondWithResult(_0xf89209,null))['catch'](handleError(_0xf89209,null));};exports['getAvatar']=function(_0x4e9f71,_0xa6d403,_0x18ac49){var _0x393b71=path[_0x63b5('0xb1')](config[_0x63b5('0xb2')],_0x63b5('0xb3'));return db[_0x63b5('0x46')][_0x63b5('0x41')]({'where':{'id':_0x4e9f71[_0x63b5('0x61')]['id']},'attributes':['id',_0x63b5('0xaf')],'raw':!![]})[_0x63b5('0x20')](handleEntityNotFound(_0xa6d403,null))[_0x63b5('0x20')](function(_0x5cb7ee){if(_0x5cb7ee){if(_[_0x63b5('0x6d')](_0x5cb7ee[_0x63b5('0xaf')])){return _0xa6d403[_0x63b5('0xb4')](_0x393b71);}else{if(!fs[_0x63b5('0xb5')](path[_0x63b5('0xb1')](config[_0x63b5('0xb2')],'server/files/images/',_0x5cb7ee[_0x63b5('0xaf')]))){return _0xa6d403[_0x63b5('0xb4')](_0x393b71);}return _0xa6d403[_0x63b5('0xb4')](path[_0x63b5('0xb1')](config[_0x63b5('0xb2')],_0x63b5('0xb6'),_0x5cb7ee[_0x63b5('0xaf')]));}}})[_0x63b5('0x29')](handleError(_0xa6d403,null));};exports[_0x63b5('0xb7')]=function(_0x7334ee,_0x444d38,_0x4430dd){var _0x3b9f50={};var _0x1edcf5={};var _0x4622a4;var _0x3bb1e2;return db[_0x63b5('0x46')][_0x63b5('0x8e')]({'where':{'id':_0x7334ee[_0x63b5('0x61')]['id']}})[_0x63b5('0x20')](handleEntityNotFound(_0x444d38,null))['then'](function(_0x359c7a){if(_0x359c7a){_0x4622a4=_0x359c7a;_0x1edcf5['model']=_['keys'](db[_0x63b5('0xb8')][_0x63b5('0x47')]);_0x1edcf5[_0x63b5('0x4b')]=_[_0x63b5('0x62')](_0x7334ee[_0x63b5('0x4b')]);_0x1edcf5['filters']=_[_0x63b5('0x4c')](_0x1edcf5[_0x63b5('0x4d')],_0x1edcf5[_0x63b5('0x4b')]);_0x3b9f50[_0x63b5('0x4f')]=_[_0x63b5('0x4c')](_0x1edcf5[_0x63b5('0x4d')],qs[_0x63b5('0x4e')](_0x7334ee['query'][_0x63b5('0x4e')]));_0x3b9f50['attributes']=_0x3b9f50[_0x63b5('0x4f')]['length']?_0x3b9f50[_0x63b5('0x4f')]:_0x1edcf5['model'];_0x3b9f50['order']=qs[_0x63b5('0x53')](_0x7334ee[_0x63b5('0x4b')][_0x63b5('0x53')]);_0x3b9f50[_0x63b5('0x54')]=qs['filters'](_[_0x63b5('0x56')](_0x7334ee[_0x63b5('0x4b')],_0x1edcf5[_0x63b5('0x55')]));if(_0x7334ee[_0x63b5('0x4b')]['filter']){_0x3b9f50[_0x63b5('0x54')]=_[_0x63b5('0x5c')](_0x3b9f50[_0x63b5('0x54')],{'$or':_['map'](_0x3b9f50['attributes'],function(_0x4a2695){var _0x468a58={};_0x468a58[_0x4a2695]={'$like':'%'+_0x7334ee[_0x63b5('0x4b')][_0x63b5('0x3c')]+'%'};return _0x468a58;})});}_0x3b9f50=_[_0x63b5('0x5c')]({},_0x3b9f50,_0x7334ee[_0x63b5('0xb9')]);return _0x4622a4['getContacts'](_0x3b9f50);}})[_0x63b5('0x20')](function(_0x39e381){if(_0x39e381){_0x3bb1e2=_0x39e381[_0x63b5('0x50')];if(_0x7334ee[_0x63b5('0x4b')]['hasOwnProperty'](_0x63b5('0x5d'))){_0x3b9f50[_0x63b5('0x5e')]=[{'model':db['CmList'],'as':_0x63b5('0xba'),'required':![]},{'model':db[_0x63b5('0xbb')],'as':'Tags','attributes':['id','name',_0x63b5('0xbc')],'where':_0x7334ee[_0x63b5('0x4b')]['tag']?{'id':_0x7334ee[_0x63b5('0x4b')][_0x63b5('0xbd')]}:undefined,'required':_0x7334ee[_0x63b5('0x4b')]['tag']?!![]:![]}];}if(!_0x7334ee['query'][_0x63b5('0x51')](_0x63b5('0xbe'))){_0x3b9f50['limit']=qs['limit'](_0x7334ee[_0x63b5('0x4b')][_0x63b5('0x52')]);_0x3b9f50['offset']=qs[_0x63b5('0x2f')](_0x7334ee[_0x63b5('0x4b')]['offset']);}return _0x4622a4['getContacts'](_0x3b9f50);}})[_0x63b5('0x20')](function(_0x36618c){if(_0x36618c){return _0x36618c?{'count':_0x3bb1e2,'rows':_0x36618c}:null;}})[_0x63b5('0x20')](respondWithResult(_0x444d38,null))[_0x63b5('0x29')](handleError(_0x444d38,null));};exports[_0x63b5('0xbf')]=function(_0x4fcd0c,_0x11cc53,_0x23ac8d){var _0x2ddd75;var _0x358f1e;var _0x49b0d9={};var _0x41900b;return db[_0x63b5('0x46')][_0x63b5('0x8e')]({'where':{'id':_0x4fcd0c['params']['id']},'attributes':['id',_0x63b5('0x45'),_0x63b5('0x42')]})['then'](handleEntityNotFound(_0x11cc53,null))[_0x63b5('0x20')](function(_0x49fa22){if(!utils[_0x63b5('0x99')](_0x4fcd0c[_0x63b5('0x4b')][_0x63b5('0xab')])){throw new db[(_0x63b5('0x1c'))][(_0x63b5('0x1d'))](_0x63b5('0x9a'));}_0x2ddd75=_0x49fa22;var _0x5be713={};_0x5be713[_0x63b5('0x4d')]=_[_0x63b5('0x62')](db[_['capitalize'](_0x4fcd0c[_0x63b5('0x4b')][_0x63b5('0xab')])+_0x63b5('0xc0')][_0x63b5('0x47')]);_0x5be713[_0x63b5('0x4b')]=_[_0x63b5('0x62')](_0x4fcd0c[_0x63b5('0x4b')]);_0x5be713[_0x63b5('0x55')]=_['intersection'](_0x5be713['model'],_0x5be713[_0x63b5('0x4b')]);_0x49b0d9[_0x63b5('0x4f')]=_[_0x63b5('0x4c')](_0x5be713['model'],qs[_0x63b5('0x4e')](_0x4fcd0c['query'][_0x63b5('0x4e')]));_0x49b0d9[_0x63b5('0x4f')]=_0x49b0d9['attributes'][_0x63b5('0x50')]?_0x49b0d9[_0x63b5('0x4f')]:_0x5be713['model'];_0x49b0d9[_0x63b5('0xc1')]=qs['sort'](_0x4fcd0c['query'][_0x63b5('0x53')]);_0x49b0d9[_0x63b5('0x54')]=qs['filters'](_[_0x63b5('0x56')](_0x4fcd0c['query'],_0x5be713['filters']));if(_0x4fcd0c[_0x63b5('0x4b')][_0x63b5('0x3c')]){_0x49b0d9['where']=_['merge'](_0x49b0d9[_0x63b5('0x54')],{'$or':_['map'](_0x49b0d9['attributes'],function(_0x37b037){var _0x567443={};_0x567443[_0x37b037]={'$like':'%'+_0x4fcd0c[_0x63b5('0x4b')][_0x63b5('0x3c')]+'%'};return _0x567443;})});}_0x49b0d9=_[_0x63b5('0x5c')]({},_0x49b0d9,_0x4fcd0c[_0x63b5('0xb9')]);switch(_0x2ddd75[_0x63b5('0x42')]){case _0x63b5('0x6a'):return db[_['capitalize'](_0x4fcd0c['query']['channel'])+_0x63b5('0xc0')][_0x63b5('0x5f')](_0x49b0d9);case _0x63b5('0x37'):case _0x63b5('0x39'):return _0x2ddd75[_0x63b5('0x35')+_[_0x63b5('0x9c')](_0x4fcd0c[_0x63b5('0x4b')][_0x63b5('0xab')])+_0x63b5('0x9e')](_0x49b0d9);default:throw new db[(_0x63b5('0x1c'))][(_0x63b5('0x1d'))](_0x63b5('0xc2'));}})[_0x63b5('0x20')](function(_0x4a09bf){_0x41900b=_0x4a09bf['length'];if(!_0x4fcd0c[_0x63b5('0x4b')][_0x63b5('0x51')](_0x63b5('0xbe'))){_0x49b0d9[_0x63b5('0x52')]=qs[_0x63b5('0x52')](_0x4fcd0c[_0x63b5('0x4b')][_0x63b5('0x52')]);_0x49b0d9[_0x63b5('0x2f')]=qs[_0x63b5('0x2f')](_0x4fcd0c[_0x63b5('0x4b')][_0x63b5('0x2f')]);}switch(_0x2ddd75[_0x63b5('0x42')]){case _0x63b5('0x6a'):return db[_['capitalize'](_0x4fcd0c[_0x63b5('0x4b')]['channel'])+_0x63b5('0xc0')]['findAll'](_0x49b0d9);case _0x63b5('0x37'):case _0x63b5('0x39'):return _0x2ddd75[_0x63b5('0x35')+_[_0x63b5('0x9c')](_0x4fcd0c[_0x63b5('0x4b')][_0x63b5('0xab')])+'Queues'](_0x49b0d9);}})[_0x63b5('0x20')](function(_0x220efb){return{'count':_0x41900b,'rows':_0x220efb};})[_0x63b5('0x20')](respondWithResult(_0x11cc53,null))[_0x63b5('0x29')](handleError(_0x11cc53,null));};exports[_0x63b5('0xc3')]=function(_0x5c8c70,_0x1a5ebb,_0x416ec6){var _0x2564f3={};var _0x3d7077={};var _0xc91886;var _0x59dcd5;return db['User'][_0x63b5('0x8e')]({'where':{'id':_0x5c8c70['params']['id']}})['then'](handleEntityNotFound(_0x1a5ebb,null))[_0x63b5('0x20')](function(_0x4c698b){if(_0x4c698b){_0xc91886=_0x4c698b;_0x3d7077[_0x63b5('0x4d')]=_[_0x63b5('0x62')](db[_0x63b5('0xa8')][_0x63b5('0x47')]);_0x3d7077['query']=_['keys'](_0x5c8c70[_0x63b5('0x4b')]);_0x3d7077[_0x63b5('0x55')]=_['intersection'](_0x3d7077[_0x63b5('0x4d')],_0x3d7077[_0x63b5('0x4b')]);_0x2564f3['attributes']=_[_0x63b5('0x4c')](_0x3d7077[_0x63b5('0x4d')],qs[_0x63b5('0x4e')](_0x5c8c70[_0x63b5('0x4b')]['fields']));_0x2564f3[_0x63b5('0x4f')]=_0x2564f3['attributes'][_0x63b5('0x50')]?_0x2564f3[_0x63b5('0x4f')]:_0x3d7077[_0x63b5('0x4d')];_0x2564f3[_0x63b5('0xc1')]=qs['sort'](_0x5c8c70[_0x63b5('0x4b')]['sort']);_0x2564f3['where']=qs[_0x63b5('0x55')](_[_0x63b5('0x56')](_0x5c8c70[_0x63b5('0x4b')],_0x3d7077[_0x63b5('0x55')]));if(_0x5c8c70[_0x63b5('0x4b')][_0x63b5('0x3c')]){_0x2564f3[_0x63b5('0x54')]=_[_0x63b5('0x5c')](_0x2564f3[_0x63b5('0x54')],{'$or':_[_0x63b5('0x3e')](_0x2564f3[_0x63b5('0x4f')],function(_0xef66fa){var _0x77ef06={};_0x77ef06[_0xef66fa]={'$like':'%'+_0x5c8c70[_0x63b5('0x4b')][_0x63b5('0x3c')]+'%'};return _0x77ef06;})});}_0x2564f3=_[_0x63b5('0x5c')]({},_0x2564f3,_0x5c8c70[_0x63b5('0xb9')]);return _0xc91886[_0x63b5('0xc3')](_0x2564f3);}})[_0x63b5('0x20')](function(_0x5c17c4){if(_0x5c17c4){_0x59dcd5=_0x5c17c4[_0x63b5('0x50')];if(!_0x5c8c70[_0x63b5('0x4b')]['hasOwnProperty'](_0x63b5('0xbe'))){_0x2564f3[_0x63b5('0x52')]=qs[_0x63b5('0x52')](_0x5c8c70[_0x63b5('0x4b')]['limit']);_0x2564f3[_0x63b5('0x2f')]=qs[_0x63b5('0x2f')](_0x5c8c70[_0x63b5('0x4b')]['offset']);}return _0xc91886[_0x63b5('0xc3')](_0x2564f3);}})['then'](function(_0x7a005b){if(_0x7a005b){return _0x7a005b?{'count':_0x59dcd5,'rows':_0x7a005b}:null;}})[_0x63b5('0x20')](respondWithResult(_0x1a5ebb,null))[_0x63b5('0x29')](handleError(_0x1a5ebb,null));};exports[_0x63b5('0xc4')]=function(_0x4c92b2,_0xc2ae26,_0x3a754d){var _0x1ae8a6={};var _0x18ba8c={};var _0x3c86d6;var _0x6d310b;return db[_0x63b5('0x46')][_0x63b5('0x8e')]({'where':{'id':_0x4c92b2['params']['id']}})[_0x63b5('0x20')](handleEntityNotFound(_0xc2ae26,null))[_0x63b5('0x20')](function(_0x1df664){if(_0x1df664){_0x3c86d6=_0x1df664;_0x18ba8c['model']=_[_0x63b5('0x62')](db[_0x63b5('0xc5')][_0x63b5('0x47')]);_0x18ba8c[_0x63b5('0x4b')]=_[_0x63b5('0x62')](_0x4c92b2[_0x63b5('0x4b')]);_0x18ba8c[_0x63b5('0x55')]=_[_0x63b5('0x4c')](_0x18ba8c['model'],_0x18ba8c[_0x63b5('0x4b')]);_0x1ae8a6[_0x63b5('0x4f')]=_['intersection'](_0x18ba8c[_0x63b5('0x4d')],qs[_0x63b5('0x4e')](_0x4c92b2['query']['fields']));_0x1ae8a6[_0x63b5('0x4f')]=_0x1ae8a6[_0x63b5('0x4f')][_0x63b5('0x50')]?_0x1ae8a6[_0x63b5('0x4f')]:_0x18ba8c[_0x63b5('0x4d')];_0x1ae8a6[_0x63b5('0xc1')]=qs[_0x63b5('0x53')](_0x4c92b2[_0x63b5('0x4b')][_0x63b5('0x53')]);_0x1ae8a6[_0x63b5('0x54')]=qs[_0x63b5('0x55')](_[_0x63b5('0x56')](_0x4c92b2[_0x63b5('0x4b')],_0x18ba8c['filters']));if(_0x4c92b2[_0x63b5('0x4b')][_0x63b5('0x3c')]){_0x1ae8a6[_0x63b5('0x54')]=_['merge'](_0x1ae8a6['where'],{'$or':_[_0x63b5('0x3e')](_0x1ae8a6[_0x63b5('0x4f')],function(_0x1f6dce){var _0x19a9a7={};_0x19a9a7[_0x1f6dce]={'$like':'%'+_0x4c92b2[_0x63b5('0x4b')]['filter']+'%'};return _0x19a9a7;})});}_0x1ae8a6=_[_0x63b5('0x5c')]({},_0x1ae8a6,_0x4c92b2[_0x63b5('0xb9')]);return _0x3c86d6[_0x63b5('0xc4')](_0x1ae8a6);}})[_0x63b5('0x20')](function(_0x537fe5){if(_0x537fe5){_0x6d310b=_0x537fe5[_0x63b5('0x50')];if(!_0x4c92b2[_0x63b5('0x4b')][_0x63b5('0x51')]('nolimit')){_0x1ae8a6[_0x63b5('0x52')]=qs[_0x63b5('0x52')](_0x4c92b2[_0x63b5('0x4b')][_0x63b5('0x52')]);_0x1ae8a6[_0x63b5('0x2f')]=qs[_0x63b5('0x2f')](_0x4c92b2[_0x63b5('0x4b')][_0x63b5('0x2f')]);}return _0x3c86d6['getGroups'](_0x1ae8a6);}})['then'](function(_0x8b52d2){if(_0x8b52d2){return _0x8b52d2?{'count':_0x6d310b,'rows':_0x8b52d2}:null;}})[_0x63b5('0x20')](respondWithResult(_0xc2ae26,null))['catch'](handleError(_0xc2ae26,null));};exports['getRecordings']=function(_0x4fe105,_0x4e1b5e,_0x4152a0){var _0x28f9f7={'raw':!![],'where':{}};var _0x5c4ebc={};var _0x1301f5={'count':0x0,'rows':[]};return db['User'][_0x63b5('0x8e')]({'where':{'id':_0x4fe105[_0x63b5('0x61')]['id']}})['then'](handleEntityNotFound(_0x4e1b5e,null))[_0x63b5('0x20')](function(_0x76c642){if(_0x76c642){_0x5c4ebc['model']=_['keys'](db[_0x63b5('0xc6')][_0x63b5('0x47')]);_0x5c4ebc[_0x63b5('0x4b')]=_[_0x63b5('0x62')](_0x4fe105['query']);_0x5c4ebc[_0x63b5('0x55')]=_[_0x63b5('0x4c')](_0x5c4ebc[_0x63b5('0x4d')],_0x5c4ebc[_0x63b5('0x4b')]);_0x28f9f7[_0x63b5('0x4f')]=_[_0x63b5('0x4c')](_0x5c4ebc[_0x63b5('0x4d')],qs['fields'](_0x4fe105[_0x63b5('0x4b')][_0x63b5('0x4e')]));_0x28f9f7['attributes']=_0x28f9f7['attributes'][_0x63b5('0x50')]?_0x28f9f7[_0x63b5('0x4f')]:_0x5c4ebc['model'];if(!_0x4fe105['query'][_0x63b5('0x51')](_0x63b5('0xbe'))){_0x28f9f7[_0x63b5('0x52')]=qs[_0x63b5('0x52')](_0x4fe105[_0x63b5('0x4b')]['limit']);_0x28f9f7[_0x63b5('0x2f')]=qs[_0x63b5('0x2f')](_0x4fe105[_0x63b5('0x4b')]['offset']);}_0x28f9f7[_0x63b5('0xc1')]=qs[_0x63b5('0x53')](_0x4fe105[_0x63b5('0x4b')]['sort']);_0x28f9f7[_0x63b5('0x54')]=qs[_0x63b5('0x55')](_[_0x63b5('0x56')](_0x4fe105[_0x63b5('0x4b')],_0x5c4ebc['filters']));_0x28f9f7['where'][_0x63b5('0xc7')]=_0x76c642['id'];if(_0x4fe105['query'][_0x63b5('0x3c')]){_0x28f9f7[_0x63b5('0x54')]=_[_0x63b5('0x5c')](_0x28f9f7[_0x63b5('0x54')],{'$or':_['map'](_0x28f9f7[_0x63b5('0x4f')],function(_0x47bfff){var _0x2b1e20={};_0x2b1e20[_0x47bfff]={'$like':'%'+_0x4fe105[_0x63b5('0x4b')][_0x63b5('0x3c')]+'%'};return _0x2b1e20;})});}_0x28f9f7=_['merge']({},_0x28f9f7,_0x4fe105[_0x63b5('0xb9')]);return db[_0x63b5('0xc6')][_0x63b5('0x2e')]({'where':_0x28f9f7[_0x63b5('0x54')]})[_0x63b5('0x20')](function(_0x4c1fe8){_0x1301f5[_0x63b5('0x2e')]=_0x4c1fe8;if(_0x4fe105[_0x63b5('0x4b')]['includeAll']){_0x28f9f7[_0x63b5('0x5e')]=[{'all':!![]}];}return db[_0x63b5('0xc6')][_0x63b5('0x5f')](_0x28f9f7);})['then'](function(_0x389e82){_0x1301f5['rows']=_0x389e82;return _0x1301f5;});}})[_0x63b5('0x20')](respondWithFilteredResult(_0x4e1b5e,_0x28f9f7))[_0x63b5('0x29')](handleError(_0x4e1b5e,null));};exports['getScreenRecordings']=function(_0x1f888b,_0x512f55,_0x21db83){var _0x3a0cfa={'raw':!![],'where':{}};var _0x2e9043={};var _0x4a85db={'count':0x0,'rows':[]};return db[_0x63b5('0x46')][_0x63b5('0x8e')]({'where':{'id':_0x1f888b[_0x63b5('0x61')]['id']}})[_0x63b5('0x20')](handleEntityNotFound(_0x512f55,null))[_0x63b5('0x20')](function(_0x48e100){if(_0x48e100){_0x2e9043[_0x63b5('0x4d')]=_[_0x63b5('0x62')](db['ScreenRecording'][_0x63b5('0x47')]);_0x2e9043[_0x63b5('0x4b')]=_[_0x63b5('0x62')](_0x1f888b[_0x63b5('0x4b')]);_0x2e9043[_0x63b5('0x55')]=_[_0x63b5('0x4c')](_0x2e9043[_0x63b5('0x4d')],_0x2e9043[_0x63b5('0x4b')]);_0x3a0cfa[_0x63b5('0x4f')]=_['intersection'](_0x2e9043['model'],qs[_0x63b5('0x4e')](_0x1f888b[_0x63b5('0x4b')][_0x63b5('0x4e')]));_0x3a0cfa[_0x63b5('0x4f')]=_0x3a0cfa[_0x63b5('0x4f')]['length']?_0x3a0cfa[_0x63b5('0x4f')]:_0x2e9043[_0x63b5('0x4d')];if(!_0x1f888b[_0x63b5('0x4b')][_0x63b5('0x51')](_0x63b5('0xbe'))){_0x3a0cfa[_0x63b5('0x52')]=qs[_0x63b5('0x52')](_0x1f888b[_0x63b5('0x4b')]['limit']);_0x3a0cfa[_0x63b5('0x2f')]=qs[_0x63b5('0x2f')](_0x1f888b[_0x63b5('0x4b')][_0x63b5('0x2f')]);}_0x3a0cfa['order']=qs[_0x63b5('0x53')](_0x1f888b[_0x63b5('0x4b')][_0x63b5('0x53')]);_0x3a0cfa['where']=qs['filters'](_[_0x63b5('0x56')](_0x1f888b[_0x63b5('0x4b')],_0x2e9043[_0x63b5('0x55')]));_0x3a0cfa[_0x63b5('0x54')][_0x63b5('0xc7')]=_0x48e100['id'];if(_0x1f888b[_0x63b5('0x4b')][_0x63b5('0x3c')]){_0x3a0cfa[_0x63b5('0x54')]=_[_0x63b5('0x5c')](_0x3a0cfa['where'],{'$or':_[_0x63b5('0x3e')](_0x3a0cfa[_0x63b5('0x4f')],function(_0x277c0f){var _0x42985d={};_0x42985d[_0x277c0f]={'$like':'%'+_0x1f888b['query'][_0x63b5('0x3c')]+'%'};return _0x42985d;})});}_0x3a0cfa=_[_0x63b5('0x5c')]({},_0x3a0cfa,_0x1f888b['options']);return db[_0x63b5('0xc8')][_0x63b5('0x2e')]({'where':_0x3a0cfa[_0x63b5('0x54')]})[_0x63b5('0x20')](function(_0x7d2299){_0x4a85db[_0x63b5('0x2e')]=_0x7d2299;if(_0x1f888b[_0x63b5('0x4b')][_0x63b5('0x5d')]){_0x3a0cfa[_0x63b5('0x5e')]=[{'all':!![]}];}return db[_0x63b5('0xc8')][_0x63b5('0x5f')](_0x3a0cfa);})['then'](function(_0x3f2111){_0x4a85db[_0x63b5('0xc9')]=_0x3f2111;return _0x4a85db;});}})[_0x63b5('0x20')](respondWithFilteredResult(_0x512f55,_0x3a0cfa))[_0x63b5('0x29')](handleError(_0x512f55,null));};exports['getChatInteractions']=function(_0x15ab06,_0xce4f23,_0x37bceb){var _0x121843={};var _0x41640d={};var _0x114805;var _0x1700e8;return db[_0x63b5('0x46')][_0x63b5('0x8e')]({'where':{'id':_0x15ab06[_0x63b5('0x61')]['id']}})[_0x63b5('0x20')](handleEntityNotFound(_0xce4f23,null))[_0x63b5('0x20')](function(_0x1ca944){if(_0x1ca944){_0x114805=_0x1ca944;_0x41640d[_0x63b5('0x4d')]=_[_0x63b5('0x62')](db[_0x63b5('0xca')]['rawAttributes']);_0x41640d[_0x63b5('0x4b')]=_[_0x63b5('0x62')](_0x15ab06[_0x63b5('0x4b')]);_0x41640d[_0x63b5('0x55')]=_[_0x63b5('0x4c')](_0x41640d[_0x63b5('0x4d')],_0x41640d[_0x63b5('0x4b')]);_0x121843['attributes']=_[_0x63b5('0x4c')](_0x41640d[_0x63b5('0x4d')],qs[_0x63b5('0x4e')](_0x15ab06['query']['fields']));_0x121843[_0x63b5('0x4f')]=_0x121843['attributes'][_0x63b5('0x50')]?_0x121843[_0x63b5('0x4f')]:_0x41640d[_0x63b5('0x4d')];_0x121843['order']=qs['sort'](_0x15ab06[_0x63b5('0x4b')][_0x63b5('0x53')]);_0x121843[_0x63b5('0x54')]=qs['filters'](_[_0x63b5('0x56')](_0x15ab06[_0x63b5('0x4b')],_0x41640d[_0x63b5('0x55')]));if(_0x15ab06[_0x63b5('0x4b')][_0x63b5('0x3c')]){_0x121843[_0x63b5('0x54')]=_['merge'](_0x121843[_0x63b5('0x54')],{'$or':_[_0x63b5('0x3e')](_0x121843[_0x63b5('0x4f')],function(_0x35808e){var _0x2956cd={};_0x2956cd[_0x35808e]={'$like':'%'+_0x15ab06['query'][_0x63b5('0x3c')]+'%'};return _0x2956cd;})});}_0x121843=_[_0x63b5('0x5c')]({},_0x121843,_0x15ab06[_0x63b5('0xb9')]);return _0x114805[_0x63b5('0xcb')](_0x121843);}})[_0x63b5('0x20')](function(_0x5a9e52){if(_0x5a9e52){_0x1700e8=_0x5a9e52['length'];if(!_0x15ab06[_0x63b5('0x4b')]['hasOwnProperty'](_0x63b5('0xbe'))){_0x121843[_0x63b5('0x52')]=qs[_0x63b5('0x52')](_0x15ab06[_0x63b5('0x4b')]['limit']);_0x121843[_0x63b5('0x2f')]=qs[_0x63b5('0x2f')](_0x15ab06[_0x63b5('0x4b')]['offset']);}return _0x114805[_0x63b5('0xcb')](_0x121843);}})['then'](function(_0x3875ed){if(_0x3875ed){return _0x3875ed?{'count':_0x1700e8,'rows':_0x3875ed}:null;}})[_0x63b5('0x20')](respondWithResult(_0xce4f23,null))['catch'](handleError(_0xce4f23,null));};exports[_0x63b5('0xcc')]=function(_0x26ca55,_0xd8aeb4,_0x56f73e){var _0x223dc5={};var _0x496f78={};var _0x36928a;var _0x230ad0;return db[_0x63b5('0x46')][_0x63b5('0x8e')]({'where':{'id':_0x26ca55[_0x63b5('0x61')]['id']}})[_0x63b5('0x20')](handleEntityNotFound(_0xd8aeb4,null))[_0x63b5('0x20')](function(_0x5c14c1){if(_0x5c14c1){_0x36928a=_0x5c14c1;_0x496f78[_0x63b5('0x4d')]=_[_0x63b5('0x62')](db['OpenchannelInteraction'][_0x63b5('0x47')]);_0x496f78[_0x63b5('0x4b')]=_[_0x63b5('0x62')](_0x26ca55['query']);_0x496f78[_0x63b5('0x55')]=_[_0x63b5('0x4c')](_0x496f78[_0x63b5('0x4d')],_0x496f78[_0x63b5('0x4b')]);_0x223dc5[_0x63b5('0x4f')]=_[_0x63b5('0x4c')](_0x496f78[_0x63b5('0x4d')],qs[_0x63b5('0x4e')](_0x26ca55[_0x63b5('0x4b')][_0x63b5('0x4e')]));_0x223dc5['attributes']=_0x223dc5[_0x63b5('0x4f')][_0x63b5('0x50')]?_0x223dc5[_0x63b5('0x4f')]:_0x496f78['model'];_0x223dc5[_0x63b5('0xc1')]=qs[_0x63b5('0x53')](_0x26ca55[_0x63b5('0x4b')][_0x63b5('0x53')]);_0x223dc5[_0x63b5('0x54')]=qs['filters'](_[_0x63b5('0x56')](_0x26ca55[_0x63b5('0x4b')],_0x496f78[_0x63b5('0x55')]));if(_0x26ca55[_0x63b5('0x4b')][_0x63b5('0x3c')]){_0x223dc5[_0x63b5('0x54')]=_[_0x63b5('0x5c')](_0x223dc5['where'],{'$or':_[_0x63b5('0x3e')](_0x223dc5[_0x63b5('0x4f')],function(_0x445d62){var _0x2bba5={};_0x2bba5[_0x445d62]={'$like':'%'+_0x26ca55[_0x63b5('0x4b')][_0x63b5('0x3c')]+'%'};return _0x2bba5;})});}_0x223dc5=_[_0x63b5('0x5c')]({},_0x223dc5,_0x26ca55[_0x63b5('0xb9')]);return _0x36928a[_0x63b5('0xcc')](_0x223dc5);}})[_0x63b5('0x20')](function(_0x54136e){if(_0x54136e){_0x230ad0=_0x54136e[_0x63b5('0x50')];if(!_0x26ca55[_0x63b5('0x4b')]['hasOwnProperty'](_0x63b5('0xbe'))){_0x223dc5['limit']=qs[_0x63b5('0x52')](_0x26ca55[_0x63b5('0x4b')][_0x63b5('0x52')]);_0x223dc5[_0x63b5('0x2f')]=qs[_0x63b5('0x2f')](_0x26ca55[_0x63b5('0x4b')][_0x63b5('0x2f')]);}return _0x36928a[_0x63b5('0xcc')](_0x223dc5);}})[_0x63b5('0x20')](function(_0x522650){if(_0x522650){return _0x522650?{'count':_0x230ad0,'rows':_0x522650}:null;}})[_0x63b5('0x20')](respondWithResult(_0xd8aeb4,null))[_0x63b5('0x29')](handleError(_0xd8aeb4,null));};exports[_0x63b5('0xcd')]=function(_0x2331ca,_0x6633bc,_0x1d0811){var _0x2d73de={'raw':!![],'where':{}};var _0x44e5ff={};var _0x300c9d={'count':0x0,'rows':[]};return db[_0x63b5('0x46')][_0x63b5('0x8e')]({'where':{'id':_0x2331ca[_0x63b5('0x61')]['id']}})[_0x63b5('0x20')](handleEntityNotFound(_0x6633bc,null))['then'](function(_0x3d5ab0){if(_0x3d5ab0){_0x44e5ff[_0x63b5('0x4d')]=_[_0x63b5('0x62')](db[_0x63b5('0xce')][_0x63b5('0x47')]);_0x44e5ff['query']=_[_0x63b5('0x62')](_0x2331ca[_0x63b5('0x4b')]);_0x44e5ff['filters']=_[_0x63b5('0x4c')](_0x44e5ff[_0x63b5('0x4d')],_0x44e5ff[_0x63b5('0x4b')]);_0x2d73de[_0x63b5('0x4f')]=_['intersection'](_0x44e5ff[_0x63b5('0x4d')],qs[_0x63b5('0x4e')](_0x2331ca[_0x63b5('0x4b')][_0x63b5('0x4e')]));_0x2d73de[_0x63b5('0x4f')]=_0x2d73de[_0x63b5('0x4f')][_0x63b5('0x50')]?_0x2d73de[_0x63b5('0x4f')]:_0x44e5ff[_0x63b5('0x4d')];if(!_0x2331ca[_0x63b5('0x4b')][_0x63b5('0x51')](_0x63b5('0xbe'))){_0x2d73de[_0x63b5('0x52')]=qs[_0x63b5('0x52')](_0x2331ca[_0x63b5('0x4b')][_0x63b5('0x52')]);_0x2d73de[_0x63b5('0x2f')]=qs['offset'](_0x2331ca[_0x63b5('0x4b')][_0x63b5('0x2f')]);}_0x2d73de[_0x63b5('0xc1')]=qs[_0x63b5('0x53')](_0x2331ca['query']['sort']);_0x2d73de[_0x63b5('0x54')]=qs[_0x63b5('0x55')](_[_0x63b5('0x56')](_0x2331ca[_0x63b5('0x4b')],_0x44e5ff[_0x63b5('0x55')]));_0x2d73de['where']['UserId']=_0x3d5ab0['id'];if(_0x2331ca[_0x63b5('0x4b')]['filter']){_0x2d73de[_0x63b5('0x54')]=_[_0x63b5('0x5c')](_0x2d73de[_0x63b5('0x54')],{'$or':_[_0x63b5('0x3e')](_0x2d73de['attributes'],function(_0x3ec99e){var _0x3a2cec={};_0x3a2cec[_0x3ec99e]={'$like':'%'+_0x2331ca[_0x63b5('0x4b')][_0x63b5('0x3c')]+'%'};return _0x3a2cec;})});}_0x2d73de=_[_0x63b5('0x5c')]({},_0x2d73de,_0x2331ca[_0x63b5('0xb9')]);return db['MailInteraction'][_0x63b5('0x2e')]({'where':_0x2d73de[_0x63b5('0x54')]})['then'](function(_0x4c4455){_0x300c9d['count']=_0x4c4455;if(_0x2331ca[_0x63b5('0x4b')][_0x63b5('0x5d')]){_0x2d73de['include']=[{'all':!![]}];}return db[_0x63b5('0xce')][_0x63b5('0x5f')](_0x2d73de);})[_0x63b5('0x20')](function(_0x302829){_0x300c9d[_0x63b5('0xc9')]=_0x302829;return _0x300c9d;});}})[_0x63b5('0x20')](respondWithFilteredResult(_0x6633bc,_0x2d73de))['catch'](handleError(_0x6633bc,null));};exports[_0x63b5('0xcf')]=function(_0x21fd7f,_0x36c357,_0x52de40){var _0xe1393c={};var _0x5f2d49={};var _0x4f8fb3;var _0x2801f1;return db[_0x63b5('0x46')][_0x63b5('0x8e')]({'where':{'id':_0x21fd7f[_0x63b5('0x61')]['id']}})['then'](handleEntityNotFound(_0x36c357,null))['then'](function(_0x3b8509){if(_0x3b8509){_0x4f8fb3=_0x3b8509;_0x5f2d49[_0x63b5('0x4d')]=_['keys'](db[_0x63b5('0xd0')][_0x63b5('0x47')]);_0x5f2d49[_0x63b5('0x4b')]=_[_0x63b5('0x62')](_0x21fd7f['query']);_0x5f2d49[_0x63b5('0x55')]=_[_0x63b5('0x4c')](_0x5f2d49[_0x63b5('0x4d')],_0x5f2d49[_0x63b5('0x4b')]);_0xe1393c[_0x63b5('0x4f')]=_[_0x63b5('0x4c')](_0x5f2d49[_0x63b5('0x4d')],qs[_0x63b5('0x4e')](_0x21fd7f[_0x63b5('0x4b')][_0x63b5('0x4e')]));_0xe1393c[_0x63b5('0x4f')]=_0xe1393c[_0x63b5('0x4f')][_0x63b5('0x50')]?_0xe1393c[_0x63b5('0x4f')]:_0x5f2d49[_0x63b5('0x4d')];_0xe1393c['order']=qs[_0x63b5('0x53')](_0x21fd7f[_0x63b5('0x4b')][_0x63b5('0x53')]);_0xe1393c[_0x63b5('0x54')]=qs['filters'](_['pick'](_0x21fd7f[_0x63b5('0x4b')],_0x5f2d49[_0x63b5('0x55')]));if(_0x21fd7f[_0x63b5('0x4b')][_0x63b5('0x3c')]){_0xe1393c[_0x63b5('0x54')]=_[_0x63b5('0x5c')](_0xe1393c[_0x63b5('0x54')],{'$or':_['map'](_0xe1393c[_0x63b5('0x4f')],function(_0x5c8616){var _0x3efd8b={};_0x3efd8b[_0x5c8616]={'$like':'%'+_0x21fd7f[_0x63b5('0x4b')][_0x63b5('0x3c')]+'%'};return _0x3efd8b;})});}_0xe1393c=_[_0x63b5('0x5c')]({},_0xe1393c,_0x21fd7f['options']);return _0x4f8fb3[_0x63b5('0xcf')](_0xe1393c);}})[_0x63b5('0x20')](function(_0x37eb5f){if(_0x37eb5f){_0x2801f1=_0x37eb5f[_0x63b5('0x50')];if(!_0x21fd7f[_0x63b5('0x4b')][_0x63b5('0x51')]('nolimit')){_0xe1393c[_0x63b5('0x52')]=qs[_0x63b5('0x52')](_0x21fd7f[_0x63b5('0x4b')][_0x63b5('0x52')]);_0xe1393c[_0x63b5('0x2f')]=qs['offset'](_0x21fd7f[_0x63b5('0x4b')][_0x63b5('0x2f')]);}return _0x4f8fb3['getSmsInteractions'](_0xe1393c);}})[_0x63b5('0x20')](function(_0x24f08b){if(_0x24f08b){return _0x24f08b?{'count':_0x2801f1,'rows':_0x24f08b}:null;}})['then'](respondWithResult(_0x36c357,null))['catch'](handleError(_0x36c357,null));};exports[_0x63b5('0xd1')]=function(_0x568606,_0x177467,_0xfc7d30){var _0x13855d={};var _0x127f35={};var _0xbcf8cb;var _0x11c096;return db[_0x63b5('0x46')][_0x63b5('0x8e')]({'where':{'id':_0x568606[_0x63b5('0x61')]['id']}})[_0x63b5('0x20')](handleEntityNotFound(_0x177467,null))[_0x63b5('0x20')](function(_0xd50d33){if(_0xd50d33){_0xbcf8cb=_0xd50d33;_0x127f35['model']=_[_0x63b5('0x62')](db['FaxInteraction'][_0x63b5('0x47')]);_0x127f35['query']=_['keys'](_0x568606[_0x63b5('0x4b')]);_0x127f35[_0x63b5('0x55')]=_['intersection'](_0x127f35[_0x63b5('0x4d')],_0x127f35[_0x63b5('0x4b')]);_0x13855d['attributes']=_[_0x63b5('0x4c')](_0x127f35[_0x63b5('0x4d')],qs[_0x63b5('0x4e')](_0x568606[_0x63b5('0x4b')][_0x63b5('0x4e')]));_0x13855d['attributes']=_0x13855d[_0x63b5('0x4f')][_0x63b5('0x50')]?_0x13855d[_0x63b5('0x4f')]:_0x127f35[_0x63b5('0x4d')];_0x13855d['order']=qs[_0x63b5('0x53')](_0x568606[_0x63b5('0x4b')][_0x63b5('0x53')]);_0x13855d[_0x63b5('0x54')]=qs[_0x63b5('0x55')](_['pick'](_0x568606[_0x63b5('0x4b')],_0x127f35[_0x63b5('0x55')]));if(_0x568606[_0x63b5('0x4b')]['filter']){_0x13855d[_0x63b5('0x54')]=_[_0x63b5('0x5c')](_0x13855d['where'],{'$or':_[_0x63b5('0x3e')](_0x13855d[_0x63b5('0x4f')],function(_0x59266f){var _0x3a6326={};_0x3a6326[_0x59266f]={'$like':'%'+_0x568606['query'][_0x63b5('0x3c')]+'%'};return _0x3a6326;})});}_0x13855d=_[_0x63b5('0x5c')]({},_0x13855d,_0x568606[_0x63b5('0xb9')]);return _0xbcf8cb[_0x63b5('0xd1')](_0x13855d);}})[_0x63b5('0x20')](function(_0x411134){if(_0x411134){_0x11c096=_0x411134[_0x63b5('0x50')];if(!_0x568606['query'][_0x63b5('0x51')]('nolimit')){_0x13855d[_0x63b5('0x52')]=qs['limit'](_0x568606[_0x63b5('0x4b')]['limit']);_0x13855d['offset']=qs[_0x63b5('0x2f')](_0x568606[_0x63b5('0x4b')]['offset']);}return _0xbcf8cb[_0x63b5('0xd1')](_0x13855d);}})[_0x63b5('0x20')](function(_0x4cb5e8){if(_0x4cb5e8){return _0x4cb5e8?{'count':_0x11c096,'rows':_0x4cb5e8}:null;}})[_0x63b5('0x20')](respondWithResult(_0x177467,null))[_0x63b5('0x29')](handleError(_0x177467,null));};exports[_0x63b5('0xd2')]=function(_0x289df3,_0x2a5daf,_0xa9132c){var _0x36fc3a={};var _0x1c8900={};var _0x1070cf;var _0x5b11d1;return db['User'][_0x63b5('0x8e')]({'where':{'id':_0x289df3[_0x63b5('0x61')]['id']}})[_0x63b5('0x20')](handleEntityNotFound(_0x2a5daf,null))['then'](function(_0x30636a){if(_0x30636a){_0x1070cf=_0x30636a;_0x1c8900['model']=_[_0x63b5('0x62')](db[_0x63b5('0xd3')][_0x63b5('0x47')]);_0x1c8900[_0x63b5('0x4b')]=_['keys'](_0x289df3[_0x63b5('0x4b')]);_0x1c8900[_0x63b5('0x55')]=_[_0x63b5('0x4c')](_0x1c8900[_0x63b5('0x4d')],_0x1c8900['query']);_0x36fc3a[_0x63b5('0x4f')]=_[_0x63b5('0x4c')](_0x1c8900[_0x63b5('0x4d')],qs[_0x63b5('0x4e')](_0x289df3[_0x63b5('0x4b')][_0x63b5('0x4e')]));_0x36fc3a['attributes']=_0x36fc3a[_0x63b5('0x4f')]['length']?_0x36fc3a[_0x63b5('0x4f')]:_0x1c8900[_0x63b5('0x4d')];_0x36fc3a['order']=qs[_0x63b5('0x53')](_0x289df3[_0x63b5('0x4b')][_0x63b5('0x53')]);_0x36fc3a[_0x63b5('0x54')]=qs['filters'](_[_0x63b5('0x56')](_0x289df3[_0x63b5('0x4b')],_0x1c8900['filters']));if(_0x289df3[_0x63b5('0x4b')]['filter']){_0x36fc3a['where']=_[_0x63b5('0x5c')](_0x36fc3a[_0x63b5('0x54')],{'$or':_[_0x63b5('0x3e')](_0x36fc3a[_0x63b5('0x4f')],function(_0x504b66){var _0xd53b74={};_0xd53b74[_0x504b66]={'$like':'%'+_0x289df3['query'][_0x63b5('0x3c')]+'%'};return _0xd53b74;})});}_0x36fc3a=_[_0x63b5('0x5c')]({},_0x36fc3a,_0x289df3[_0x63b5('0xb9')]);return _0x1070cf[_0x63b5('0xd2')](_0x36fc3a);}})[_0x63b5('0x20')](function(_0x564abd){if(_0x564abd){_0x5b11d1=_0x564abd[_0x63b5('0x50')];if(!_0x289df3[_0x63b5('0x4b')][_0x63b5('0x51')](_0x63b5('0xbe'))){_0x36fc3a[_0x63b5('0x52')]=qs['limit'](_0x289df3[_0x63b5('0x4b')]['limit']);_0x36fc3a[_0x63b5('0x2f')]=qs['offset'](_0x289df3['query'][_0x63b5('0x2f')]);}return _0x1070cf[_0x63b5('0xd2')](_0x36fc3a);}})[_0x63b5('0x20')](function(_0x10c172){if(_0x10c172){return _0x10c172?{'count':_0x5b11d1,'rows':_0x10c172}:null;}})[_0x63b5('0x20')](respondWithResult(_0x2a5daf,null))[_0x63b5('0x29')](handleError(_0x2a5daf,null));};exports[_0x63b5('0xd4')]=function(_0x37bf2f,_0x181a8e,_0x155c2e){var _0x58ed2f;var _0x5c64d4;var _0x437289;var _0x2b9e5e=!_[_0x63b5('0x6d')](_0x37bf2f[_0x63b5('0x61')]['id'])?_0x37bf2f[_0x63b5('0x61')]['id']:!_[_0x63b5('0x6d')](_0x37bf2f[_0x63b5('0x37')]['id'])?_0x37bf2f[_0x63b5('0x37')]['id']:null;return db[_0x63b5('0x46')]['find']({'where':{'id':_0x2b9e5e,'role':{'$or':['admin',_0x63b5('0x37'),_0x63b5('0x39')]}},'attributes':['id',_0x63b5('0x45'),'phone',_0x63b5('0xd5'),_0x63b5('0x42'),'internal','loginInPause']})[_0x63b5('0x20')](function(_0x2aa3eb){if(_0x2aa3eb){if(_0x2aa3eb[_0x63b5('0x42')]===_0x63b5('0x39')){_0x58ed2f=_0x2aa3eb;if(_0x37bf2f[_0x63b5('0x65')]['interface']){_0x437289=util[_0x63b5('0x6e')](_0x63b5('0xd6'),_0x58ed2f[_0x37bf2f[_0x63b5('0x65')][_0x63b5('0x98')]]);}else if(_0x37bf2f['body'][_0x63b5('0xd7')]){_0x437289=util[_0x63b5('0x6e')]('SIP/%s',_0x37bf2f[_0x63b5('0x65')]['intrf']);}else{_0x437289=util[_0x63b5('0x6e')]('SIP/%s',_0x58ed2f[_0x63b5('0x45')]);}socket['to'](util[_0x63b5('0x6e')](_0x63b5('0xd8'),_0x58ed2f[_0x63b5('0x45')]))[_0x63b5('0xa1')](_0x63b5('0xd9'),{'ip':_0x37bf2f[_0x63b5('0xda')][_0x63b5('0xdb')]||_0x37bf2f[_0x63b5('0xdc')][_0x63b5('0xdd')]||_0x37bf2f[_0x63b5('0xde')][_0x63b5('0xdd')]||_0x37bf2f['connection'][_0x63b5('0xde')][_0x63b5('0xdd')]});return db[_0x63b5('0xa8')][_0x63b5('0x34')]({'where':{'membername':_0x58ed2f[_0x63b5('0x45')]},'individualHooks':!![]});}}else{throw new db[(_0x63b5('0x1c'))][(_0x63b5('0x1d'))]('User\x20not\x20found\x20or\x20not\x20allowed\x20to\x20perform\x20login\x20method');}})[_0x63b5('0x20')](function(){if(_0x58ed2f){return _0x58ed2f[_0x63b5('0xdf')]({'raw':!![]});}})[_0x63b5('0x20')](function(_0x237778){if(_0x58ed2f){var _0x171f40=[];if(_0x237778){_0x5c64d4=_0x237778;if(_0x5c64d4[_0x63b5('0x50')]){for(var _0x542e72=0x0;_0x542e72<_0x5c64d4[_0x63b5('0x50')];_0x542e72++){_0x171f40[_0x63b5('0xa5')]({'membername':_0x58ed2f[_0x63b5('0x45')],'UserId':_0x58ed2f['id'],'queue_name':_0x5c64d4[_0x542e72][_0x63b5('0x45')],'VoiceQueueId':_0x5c64d4[_0x542e72]['id'],'interface':_0x437289,'paused':_0x58ed2f[_0x63b5('0x96')]||![],'penalty':_0x5c64d4[_0x542e72]['UserVoiceQueue.penalty']||0x0});}return BPromise[_0x63b5('0xa7')](_0x171f40,function(_0x798334){return db[_0x63b5('0xa8')]['upsert'](_0x798334);});}}}})['then'](function(){if(_0x58ed2f){return db[_0x63b5('0xe0')][_0x63b5('0x5f')]({'where':{'membername':_0x58ed2f[_0x63b5('0x45')],'exitAt':null}});}})[_0x63b5('0x20')](function(_0x26fa0f){if(_0x58ed2f){var _0x50c572=[];_0x26fa0f[_0x63b5('0xe1')](function(_0x2d55d0){_0x50c572[_0x63b5('0xa5')](_0x2d55d0['update']({'exitAt':moment()[_0x63b5('0x6e')](_0x63b5('0xe2'))}));});return BPromise[_0x63b5('0xe3')](_0x50c572);}})[_0x63b5('0x20')](function(){if(_0x58ed2f){var _0x50dfb8=[];var _0x43f0bf=[];var _0x4eb4c6=utils[_0x63b5('0xe4')]();var _0x5542b8={'membername':_0x58ed2f[_0x63b5('0x45')],'interface':_0x437289,'enterAt':moment()['format'](_0x63b5('0xe2')),'role':_0x58ed2f[_0x63b5('0x42')],'internal':_0x58ed2f[_0x63b5('0x71')]};_0x4eb4c6[_0x63b5('0xe1')](function(_0x2dd692){_0x50dfb8[_0x63b5('0xa5')](_['merge']({'channel':_0x2dd692,'type':_0x63b5('0xe5'),'data1':_0x37bf2f[_0x63b5('0x65')][_0x63b5('0xe6')],'data2':_0x437289},_0x5542b8));if(_0x58ed2f[_0x63b5('0x96')]){_0x43f0bf[_0x63b5('0xa5')](_[_0x63b5('0x5c')]({'channel':_0x2dd692,'type':_0x63b5('0xe7'),'data1':_0x63b5('0xe8')},_0x5542b8));}});return db[_0x63b5('0xe0')][_0x63b5('0x64')](_0x50dfb8['concat'](_0x43f0bf),{'individualHooks':!![]});}})[_0x63b5('0x20')](function(){if(_0x58ed2f){return _0x58ed2f[_0x63b5('0x33')]({'online':!![],'lastLoginAt':moment()['format'](_0x63b5('0xe2')),'voicePause':_0x58ed2f['loginInPause']||![],'mailPause':_0x58ed2f[_0x63b5('0x96')]||![],'chatPause':_0x58ed2f[_0x63b5('0x96')]||![],'faxPause':_0x58ed2f[_0x63b5('0x96')]||![],'smsPause':_0x58ed2f[_0x63b5('0x96')]||![],'openchannelPause':_0x58ed2f[_0x63b5('0x96')]||![],'whatsappPause':_0x58ed2f[_0x63b5('0x96')]||![],'pauseType':_0x58ed2f[_0x63b5('0x96')]?'LOGININPAUSE':null,'interface':_0x437289,'lastPauseAt':moment()['format'](_0x63b5('0xe2'))});}})[_0x63b5('0x20')](function(_0x6528f2){if(_0x37bf2f[_0x63b5('0xe9')]){return _0x155c2e();}else{return BPromise['resolve'](_0x6528f2)[_0x63b5('0x20')](respondWithResult(_0x181a8e,null));}})[_0x63b5('0x29')](handleError(_0x181a8e,null));};exports[_0x63b5('0xea')]=function(_0x3f9d53,_0x375262,_0x2cc280){var _0x19c317;return db['User']['find']({'where':{'id':_0x3f9d53[_0x63b5('0x61')]['id'],'role':_0x63b5('0x39')},'attributes':['id',_0x63b5('0x45'),_0x63b5('0x42')]})[_0x63b5('0x20')](handleEntityNotFound(_0x375262,null))['then'](function(_0x20b7ed){if(_0x20b7ed){_0x19c317=_0x20b7ed;return db[_0x63b5('0xa8')][_0x63b5('0x34')]({'where':{'membername':_0x19c317[_0x63b5('0x45')]},'individualHooks':!![]});}})['then'](function(){return db[_0x63b5('0xe0')][_0x63b5('0x5f')]({'where':{'membername':_0x19c317[_0x63b5('0x45')],'exitAt':null}});})[_0x63b5('0x20')](function(_0x59ade5){var _0x1931df=[];_0x59ade5['forEach'](function(_0x40e890){_0x1931df[_0x63b5('0xa5')](_0x40e890[_0x63b5('0x33')]({'exitAt':moment()[_0x63b5('0x6e')]('YYYY-MM-DD\x20HH:mm:ss')}));});return BPromise[_0x63b5('0xe3')](_0x1931df);})[_0x63b5('0x20')](function(){return _0x19c317[_0x63b5('0x33')]({'online':![],'lastLoginAt':null,'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![],'interface':null});})['then'](respondWithResult(_0x375262,null))[_0x63b5('0x29')](handleError(_0x375262,null));};exports[_0x63b5('0xeb')]=function(_0x4a17d8,_0x43b3df,_0x53d72e){var _0x216e46;return db['UserVoiceQueueRt'][_0x63b5('0x33')]({'paused':0x1},{'where':{'UserId':_0x4a17d8['params']['id']},'individualHooks':!![]})[_0x63b5('0x20')](function(){return db['User'][_0x63b5('0x41')]({'where':{'id':_0x4a17d8[_0x63b5('0x61')]['id'],'role':_0x63b5('0x39')},'attributes':['id','name',_0x63b5('0x42'),_0x63b5('0x71'),_0x63b5('0x98')]});})[_0x63b5('0x20')](handleEntityNotFound(_0x43b3df,null))[_0x63b5('0x20')](function(_0x3c3f96){if(_0x3c3f96){_0x216e46=_0x3c3f96;return respondWithRpcPromise('QueuePause','pause',{'id':_0x216e46['id'],'name':_0x216e46[_0x63b5('0x45')],'pause':!![]});}})[_0x63b5('0x20')](function(){if(_0x216e46){return db[_0x63b5('0xe0')]['findAll']({'where':{'membername':_0x216e46['name'],'type':'PAUSE','exitAt':null}});}})[_0x63b5('0x20')](function(_0x3fd335){if(_0x3fd335['length']){var _0x327600=moment()[_0x63b5('0x6e')](_0x63b5('0xe2'));for(var _0x114c36=0x0,_0x1c3fa1=_0x3fd335[_0x63b5('0x50')];_0x114c36<_0x1c3fa1;_0x114c36++){_0x3fd335[_0x114c36][_0x63b5('0xec')]({'exitAt':_0x327600});}}})['then'](function(){var _0x55975b=[];var _0x1ec33f=utils[_0x63b5('0xe4')]();_0x1ec33f[_0x63b5('0xe1')](function(_0x36e79d){_0x55975b[_0x63b5('0xa5')]({'channel':_0x36e79d,'membername':_0x216e46[_0x63b5('0x45')],'interface':_[_0x63b5('0x6d')](_0x216e46[_0x63b5('0x98')])?util[_0x63b5('0x6e')](_0x63b5('0xa6'),_0x216e46[_0x63b5('0x45')]):_0x216e46[_0x63b5('0x98')],'type':_0x63b5('0xe7'),'enterAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'data1':_0x4a17d8[_0x63b5('0x65')][_0x63b5('0x57')]||'DEFAULT\x20PAUSE','role':_0x216e46['role'],'internal':_0x216e46[_0x63b5('0x71')]});});return db['MemberReport'][_0x63b5('0x64')](_0x55975b,{'individualHooks':!![]});})['then'](function(){return _0x216e46[_0x63b5('0x33')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'whatsappPause':!![],'openchannelPause':!![],'pauseType':_0x4a17d8['body'][_0x63b5('0x57')]||_0x63b5('0xed'),'lastPauseAt':moment()[_0x63b5('0x6e')](_0x63b5('0xe2'))});})['then'](respondWithResult(_0x43b3df,null))['catch'](handleError(_0x43b3df,null));};exports[_0x63b5('0xee')]=function(_0x23dcc0,_0x22c702,_0x4931a3){var _0x23c038;return db['User'][_0x63b5('0x41')]({'where':{'id':_0x23dcc0[_0x63b5('0x61')]['id']},'attributes':['id',_0x63b5('0x45'),_0x63b5('0x42'),_0x63b5('0x97'),_0x63b5('0xef'),_0x63b5('0xf0'),_0x63b5('0xf1'),_0x63b5('0xf2'),_0x63b5('0xf3'),_0x63b5('0xf4'),_0x63b5('0xf5'),_0x63b5('0xf6')]})['then'](handleEntityNotFound(_0x22c702,null))['then'](function(_0x3fe8e5){if(_0x3fe8e5){_0x23c038=_0x3fe8e5;if(_0x23dcc0[_0x63b5('0x65')][_0x63b5('0xab')]&&!utils[_0x63b5('0x99')](_0x23dcc0[_0x63b5('0x65')][_0x63b5('0xab')])){throw new db['Sequelize'][(_0x63b5('0x1d'))](_0x63b5('0x9a'));}switch(_0x23dcc0[_0x63b5('0x65')][_0x63b5('0xab')]){case _0x63b5('0xa3'):return respondWithRpcPromise(_0x63b5('0xf7'),'unpause',{'id':_0x23c038['id'],'name':_0x23c038['name'],'pause':![]})[_0x63b5('0x20')](function(){return db[_0x63b5('0xa8')][_0x63b5('0x33')]({'paused':0x0},{'where':{'UserId':_0x23c038['id']},'individualHooks':!![]});})['then'](function(){return db[_0x63b5('0xe0')][_0x63b5('0x41')]({'where':{'channel':_0x23dcc0['body'][_0x63b5('0xab')],'membername':_0x23c038['name'],'type':_0x63b5('0xe7'),'exitAt':null}});})['then'](function(_0x189bc1){if(_0x189bc1){return _0x189bc1[_0x63b5('0x33')]({'exitAt':moment()[_0x63b5('0x6e')]('YYYY-MM-DD\x20HH:mm:ss'),'data2':_0x63b5('0xf8')},{'individualHooks':!![]});}return null;})[_0x63b5('0x20')](function(){return _0x23c038[_0x63b5('0x33')]({'voicePause':![]});});case _0x63b5('0xf9'):case'chat':case _0x63b5('0xfa'):case'sms':case _0x63b5('0xfb'):case _0x63b5('0xfc'):return db['MemberReport']['find']({'where':{'channel':_0x23dcc0[_0x63b5('0x65')]['channel'],'membername':_0x23c038[_0x63b5('0x45')],'type':_0x63b5('0xe7'),'exitAt':null}})[_0x63b5('0x20')](function(_0x4191da){if(_0x4191da){return _0x4191da[_0x63b5('0x33')]({'exitAt':moment()[_0x63b5('0x6e')](_0x63b5('0xe2')),'data2':_0x63b5('0xf8')},{'individualHooks':!![]});}return null;})[_0x63b5('0x20')](function(){var _0x249dd4={};_[_0x63b5('0xfd')](_0x249dd4,util[_0x63b5('0x6e')](_0x63b5('0xfe'),_0x23dcc0[_0x63b5('0x65')]['channel'],_0x63b5('0xff')),![]);return _0x23c038[_0x63b5('0x33')](_0x249dd4);});default:return respondWithRpcPromise(_0x63b5('0xf7'),_0x63b5('0xee'),{'id':_0x23c038['id'],'name':_0x23c038[_0x63b5('0x45')],'pause':![]})[_0x63b5('0x20')](function(){return db[_0x63b5('0xa8')][_0x63b5('0x33')]({'paused':0x0},{'where':{'UserId':_0x23c038['id']}});})[_0x63b5('0x20')](function(){return db[_0x63b5('0xe0')][_0x63b5('0x5f')]({'where':{'membername':_0x23c038[_0x63b5('0x45')],'type':_0x63b5('0xe7'),'exitAt':null}});})[_0x63b5('0x20')](function(_0x4ee4d2){var _0x4e3fa1=[];_0x4ee4d2[_0x63b5('0xe1')](function(_0x210a09){_0x4e3fa1[_0x63b5('0xa5')](_0x210a09[_0x63b5('0x33')]({'exitAt':moment()[_0x63b5('0x6e')](_0x63b5('0xe2')),'data2':'manual'}));});return BPromise[_0x63b5('0xe3')](_0x4e3fa1);})[_0x63b5('0x20')](function(){return _0x23c038[_0x63b5('0x33')]({'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'whatsappPause':![],'openchannelPause':![]});});}}})[_0x63b5('0x20')](respondWithResult(_0x22c702,null))[_0x63b5('0x29')](handleError(_0x22c702,null));};exports['getTeams']=function(_0x249ea2,_0x4fb576,_0x260857){var _0x1edf97={};var _0x52bdbd={};var _0x4d3c40;var _0xbead3e;return db[_0x63b5('0x46')]['findOne']({'where':{'id':_0x249ea2[_0x63b5('0x61')]['id']}})['then'](handleEntityNotFound(_0x4fb576,null))[_0x63b5('0x20')](function(_0x3d0915){if(_0x3d0915){_0x4d3c40=_0x3d0915;_0x52bdbd['model']=_['keys'](db['Team'][_0x63b5('0x47')]);_0x52bdbd['query']=_[_0x63b5('0x62')](_0x249ea2['query']);_0x52bdbd[_0x63b5('0x55')]=_[_0x63b5('0x4c')](_0x52bdbd[_0x63b5('0x4d')],_0x52bdbd['query']);_0x1edf97[_0x63b5('0x4f')]=_['intersection'](_0x52bdbd[_0x63b5('0x4d')],qs['fields'](_0x249ea2[_0x63b5('0x4b')][_0x63b5('0x4e')]));_0x1edf97['attributes']=_0x1edf97['attributes'][_0x63b5('0x50')]?_0x1edf97[_0x63b5('0x4f')]:_0x52bdbd['model'];_0x1edf97['order']=qs[_0x63b5('0x53')](_0x249ea2[_0x63b5('0x4b')][_0x63b5('0x53')]);_0x1edf97['where']=qs[_0x63b5('0x55')](_['pick'](_0x249ea2[_0x63b5('0x4b')],_0x52bdbd[_0x63b5('0x55')]));if(_0x249ea2[_0x63b5('0x4b')][_0x63b5('0x3c')]){_0x1edf97[_0x63b5('0x54')]=_[_0x63b5('0x5c')](_0x1edf97['where'],{'$or':_[_0x63b5('0x3e')](_0x1edf97[_0x63b5('0x4f')],function(_0x5b1aa0){var _0x1c8f32={};_0x1c8f32[_0x5b1aa0]={'$like':'%'+_0x249ea2[_0x63b5('0x4b')]['filter']+'%'};return _0x1c8f32;})});}_0x1edf97=_[_0x63b5('0x5c')]({},_0x1edf97,_0x249ea2['options']);return _0x4d3c40['getTeams'](_0x1edf97);}})[_0x63b5('0x20')](function(_0x1d60b1){if(_0x1d60b1){_0xbead3e=_0x1d60b1[_0x63b5('0x50')];if(!_0x249ea2[_0x63b5('0x4b')][_0x63b5('0x51')]('nolimit')){_0x1edf97[_0x63b5('0x52')]=qs[_0x63b5('0x52')](_0x249ea2['query'][_0x63b5('0x52')]);_0x1edf97[_0x63b5('0x2f')]=qs['offset'](_0x249ea2[_0x63b5('0x4b')]['offset']);}return _0x4d3c40[_0x63b5('0x100')](_0x1edf97);}})['then'](function(_0x476f9d){if(_0x476f9d){return _0x476f9d?{'count':_0xbead3e,'rows':_0x476f9d}:null;}})['then'](respondWithResult(_0x4fb576,null))[_0x63b5('0x29')](handleError(_0x4fb576,null));};exports['addTeams']=function(_0x305584,_0x5d4135){return db['User']['find']({'where':{'id':_0x305584[_0x63b5('0x61')]['id']}})[_0x63b5('0x20')](handleEntityNotFound(_0x5d4135,null))[_0x63b5('0x20')](function(_0x57aeca){if(_0x57aeca){var _0x5adc5e=_0x57aeca[_0x63b5('0x35')]({'plain':!![]});return _0x57aeca[_0x63b5('0x101')](_0x305584['body'][_0x63b5('0x68')],_['omit'](_0x305584['body'],[_0x63b5('0x68'),'id'])||{})[_0x63b5('0x20')](function(){for(var _0x5e66b1=0x0;_0x5e66b1<_0x305584[_0x63b5('0x65')][_0x63b5('0x68')][_0x63b5('0x50')];_0x5e66b1++){var _0x61e50f=[];db[_0x63b5('0x102')]['findOne']({'where':{'id':_0x305584[_0x63b5('0x65')][_0x63b5('0x68')][_0x5e66b1]}})[_0x63b5('0x20')](function(_0x2f77cd){_0x61e50f[_0x63b5('0xa5')](_0x2f77cd[_0x63b5('0xdf')]()[_0x63b5('0x20')](function(_0x5a4571){for(var _0x596b61=0x0;_0x596b61<_0x5a4571[_0x63b5('0x50')];_0x596b61++){_0x5a4571[_0x596b61]['setDataValue']('channel',_0x63b5('0x103'));}return _0x5a4571;}));_0x61e50f[_0x63b5('0xa5')](_0x2f77cd[_0x63b5('0x104')]()[_0x63b5('0x20')](function(_0x2f22b9){for(var _0x245c0f=0x0;_0x245c0f<_0x2f22b9[_0x63b5('0x50')];_0x245c0f++){_0x2f22b9[_0x245c0f][_0x63b5('0x105')](_0x63b5('0xab'),'Chat');}return _0x2f22b9;}));_0x61e50f[_0x63b5('0xa5')](_0x2f77cd[_0x63b5('0x106')]()[_0x63b5('0x20')](function(_0x4e8e92){for(var _0x3679c8=0x0;_0x3679c8<_0x4e8e92[_0x63b5('0x50')];_0x3679c8++){_0x4e8e92[_0x3679c8][_0x63b5('0x105')]('channel','Mail');}return _0x4e8e92;}));_0x61e50f['push'](_0x2f77cd[_0x63b5('0x107')]()[_0x63b5('0x20')](function(_0x4f520b){for(var _0x216b4f=0x0;_0x216b4f<_0x4f520b[_0x63b5('0x50')];_0x216b4f++){_0x4f520b[_0x216b4f]['setDataValue']('channel',_0x63b5('0x108'));}return _0x4f520b;}));_0x61e50f[_0x63b5('0xa5')](_0x2f77cd['getWhatsappQueues']()[_0x63b5('0x20')](function(_0x161cd5){for(var _0x4c1f7c=0x0;_0x4c1f7c<_0x161cd5[_0x63b5('0x50')];_0x4c1f7c++){_0x161cd5[_0x4c1f7c]['setDataValue'](_0x63b5('0xab'),_0x63b5('0x109'));}return _0x161cd5;}));_0x61e50f[_0x63b5('0xa5')](_0x2f77cd[_0x63b5('0x10a')]()[_0x63b5('0x20')](function(_0x57b478){for(var _0x4e8de4=0x0;_0x4e8de4<_0x57b478[_0x63b5('0x50')];_0x4e8de4++){_0x57b478[_0x4e8de4][_0x63b5('0x105')](_0x63b5('0xab'),_0x63b5('0x10b'));}return _0x57b478;}));_0x61e50f[_0x63b5('0xa5')](_0x2f77cd['getOpenchannelQueues']()[_0x63b5('0x20')](function(_0x4a3d05){for(var _0x154e0a=0x0;_0x154e0a<_0x4a3d05[_0x63b5('0x50')];_0x154e0a++){_0x4a3d05[_0x154e0a]['setDataValue']('channel',_0x63b5('0x10c'));}return _0x4a3d05;}));return BPromise[_0x63b5('0xe3')](_0x61e50f);})[_0x63b5('0x20')](function(_0x346481){var _0x5d0567=_[_0x63b5('0x10d')](_0x346481);_0x61e50f=[];return db[_0x63b5('0x59')]['transaction'](function(_0x5c36da){for(var _0x290445=0x0;_0x290445<_0x5d0567['length'];_0x290445++){_0x61e50f[_0x63b5('0xa5')](_0x5d0567[_0x290445]['addAgent'](_0x5adc5e['id']),{'transaction':_0x5c36da});}return BPromise['all'](_0x61e50f)[_0x63b5('0x20')](function(){if(_0x5adc5e[_0x63b5('0x95')]){return BPromise['each'](_[_0x63b5('0x3c')](_0x5d0567,function(_0x54d27f){return _0x54d27f[_0x63b5('0x10e')](_0x63b5('0xab'))===_0x63b5('0x103');}),function(_0x4964c9){return db['UserVoiceQueueRt'][_0x63b5('0xa9')]({'membername':_0x5adc5e[_0x63b5('0x45')],'UserId':_0x5adc5e['id'],'queue_name':_0x4964c9[_0x63b5('0x45')],'VoiceQueueId':_0x4964c9['id'],'interface':_[_0x63b5('0x6d')](_0x5adc5e[_0x63b5('0x98')])?util[_0x63b5('0x6e')](_0x63b5('0xa6'),_0x5adc5e[_0x63b5('0x45')]):_0x5adc5e[_0x63b5('0x98')],'paused':_0x5adc5e[_0x63b5('0x97')]||![],'penalty':_0x5adc5e[_0x63b5('0x9f')]},{'transaction':_0x5c36da});});}else{return;}})[_0x63b5('0x20')](function(){for(var _0x1c697d=0x0;_0x1c697d<_0x5d0567['length'];_0x1c697d++){var _0x5f1e68=_0x5d0567[_0x1c697d]['getDataValue'](_0x63b5('0xab'));var _0x484476=_0x5f1e68+_0x63b5('0xac');socket[_0x63b5('0xa1')](_0x63b5('0x37')+_0x5f1e68+_0x63b5('0xa2'),{'UserId':_0x5adc5e['id'],['queueField']:_0x5d0567[_0x1c697d]['id']});}});});});}});}})['then'](respondWithStatusCode(_0x5d4135,null))['catch'](handleError(_0x5d4135,null));};exports['removeTeams']=function(_0x11a67c,_0x5d8c8f){return db[_0x63b5('0x46')][_0x63b5('0x8e')]({'where':{'id':_0x11a67c[_0x63b5('0x61')]['id']}})[_0x63b5('0x20')](handleEntityNotFound(_0x5d8c8f,null))[_0x63b5('0x20')](function(_0x115518){if(_0x115518){var _0x51e339=_0x115518[_0x63b5('0x35')]({'plain':!![]});var _0x4292cf=_0x11a67c[_0x63b5('0x4b')][_0x63b5('0x68')];return _0x115518[_0x63b5('0x10f')](_0x4292cf)[_0x63b5('0x20')](function(){for(var _0x4d7fef=0x0;_0x4d7fef<_0x4292cf['length'];_0x4d7fef++){var _0xfc7bd1=[];db[_0x63b5('0x102')]['findOne']({'where':{'id':_0x4292cf[_0x4d7fef]}})[_0x63b5('0x20')](function(_0x2ae61d){_0xfc7bd1[_0x63b5('0xa5')](_0x2ae61d[_0x63b5('0xdf')]()['then'](function(_0x18e411){for(var _0x2b1ca0=0x0;_0x2b1ca0<_0x18e411['length'];_0x2b1ca0++){_0x18e411[_0x2b1ca0][_0x63b5('0x105')]('channel',_0x63b5('0x103'));}return _0x18e411;}));_0xfc7bd1[_0x63b5('0xa5')](_0x2ae61d[_0x63b5('0x104')]()['then'](function(_0x44aea8){for(var _0x6ac22f=0x0;_0x6ac22f<_0x44aea8[_0x63b5('0x50')];_0x6ac22f++){_0x44aea8[_0x6ac22f]['setDataValue'](_0x63b5('0xab'),_0x63b5('0x110'));}return _0x44aea8;}));_0xfc7bd1['push'](_0x2ae61d[_0x63b5('0x106')]()[_0x63b5('0x20')](function(_0x117333){for(var _0xdc4a70=0x0;_0xdc4a70<_0x117333[_0x63b5('0x50')];_0xdc4a70++){_0x117333[_0xdc4a70][_0x63b5('0x105')](_0x63b5('0xab'),'Mail');}return _0x117333;}));_0xfc7bd1[_0x63b5('0xa5')](_0x2ae61d[_0x63b5('0x107')]()[_0x63b5('0x20')](function(_0x4c75de){for(var _0x1a1b65=0x0;_0x1a1b65<_0x4c75de[_0x63b5('0x50')];_0x1a1b65++){_0x4c75de[_0x1a1b65]['setDataValue'](_0x63b5('0xab'),_0x63b5('0x108'));}return _0x4c75de;}));_0xfc7bd1['push'](_0x2ae61d[_0x63b5('0x111')]()[_0x63b5('0x20')](function(_0x52a1a8){for(var _0x59ccac=0x0;_0x59ccac<_0x52a1a8['length'];_0x59ccac++){_0x52a1a8[_0x59ccac][_0x63b5('0x105')]('channel',_0x63b5('0x109'));}return _0x52a1a8;}));_0xfc7bd1[_0x63b5('0xa5')](_0x2ae61d[_0x63b5('0x10a')]()[_0x63b5('0x20')](function(_0x54d86e){for(var _0x7c2010=0x0;_0x7c2010<_0x54d86e[_0x63b5('0x50')];_0x7c2010++){_0x54d86e[_0x7c2010][_0x63b5('0x105')](_0x63b5('0xab'),_0x63b5('0x10b'));}return _0x54d86e;}));_0xfc7bd1[_0x63b5('0xa5')](_0x2ae61d[_0x63b5('0x112')]()[_0x63b5('0x20')](function(_0x4944e4){for(var _0x36604f=0x0;_0x36604f<_0x4944e4[_0x63b5('0x50')];_0x36604f++){_0x4944e4[_0x36604f][_0x63b5('0x105')](_0x63b5('0xab'),_0x63b5('0x10c'));}return _0x4944e4;}));return BPromise[_0x63b5('0xe3')](_0xfc7bd1);})[_0x63b5('0x20')](function(_0x4bf410){var _0x2fafe8=_['flatten'](_0x4bf410);_0xfc7bd1=[];return db[_0x63b5('0x59')]['transaction'](function(_0x18f413){for(var _0xc2a275=0x0;_0xc2a275<_0x2fafe8[_0x63b5('0x50')];_0xc2a275++){_0xfc7bd1[_0x63b5('0xa5')](_0x2fafe8[_0xc2a275]['removeAgent'](_0x51e339['id']),{'transaction':_0x18f413});}return BPromise['all'](_0xfc7bd1)[_0x63b5('0x20')](function(){if(_0x51e339[_0x63b5('0x95')]){return BPromise[_0x63b5('0xa7')](_[_0x63b5('0x3c')](_0x2fafe8,function(_0x2270f8){return _0x2270f8['getDataValue'](_0x63b5('0xab'))==='Voice';}),function(_0x47f78a){return db[_0x63b5('0xa8')][_0x63b5('0x34')]({'where':{'VoiceQueueId':_0x47f78a['id'],'UserId':_0x51e339['id']},'transaction':_0x18f413});});}else{return;}})[_0x63b5('0x20')](function(){for(var _0x4bad8d=0x0;_0x4bad8d<_0x2fafe8['length'];_0x4bad8d++){var _0x64340f=_0x2fafe8[_0x4bad8d][_0x63b5('0x10e')](_0x63b5('0xab'));var _0x1ca3ac=_0x64340f+_0x63b5('0xac');socket[_0x63b5('0xa1')]('user'+_0x64340f+_0x63b5('0xad'),{'UserId':_0x51e339['id'],['queueField']:_0x2fafe8[_0x4bad8d]['id']});}});});});}});}})[_0x63b5('0x20')](respondWithStatusCode(_0x5d8c8f,null))[_0x63b5('0x29')](handleError(_0x5d8c8f,null));};exports[_0x63b5('0x113')]=function(_0x87364f,_0x50752b,_0x5bfa90){var _0x534638={};var _0x7e8dad={};var _0x2425fd;var _0x40a61c;return db[_0x63b5('0x46')]['findOne']({'where':{'id':_0x87364f[_0x63b5('0x61')]['id']}})[_0x63b5('0x20')](handleEntityNotFound(_0x50752b,null))[_0x63b5('0x20')](function(_0x1e396d){if(_0x1e396d){_0x2425fd=_0x1e396d;_0x7e8dad['model']=_['keys'](db[_0x63b5('0x114')][_0x63b5('0x47')]);_0x7e8dad['query']=_[_0x63b5('0x62')](_0x87364f['query']);_0x7e8dad[_0x63b5('0x55')]=_[_0x63b5('0x4c')](_0x7e8dad['model'],_0x7e8dad[_0x63b5('0x4b')]);_0x534638['attributes']=_[_0x63b5('0x4c')](_0x7e8dad[_0x63b5('0x4d')],qs[_0x63b5('0x4e')](_0x87364f[_0x63b5('0x4b')][_0x63b5('0x4e')]));_0x534638[_0x63b5('0x4f')]=_0x534638[_0x63b5('0x4f')]['length']?_0x534638[_0x63b5('0x4f')]:_0x7e8dad['model'];_0x534638[_0x63b5('0xc1')]=qs[_0x63b5('0x53')](_0x87364f[_0x63b5('0x4b')][_0x63b5('0x53')]);_0x534638[_0x63b5('0x54')]=qs[_0x63b5('0x55')](_[_0x63b5('0x56')](_0x87364f[_0x63b5('0x4b')],_0x7e8dad['filters']));if(_0x87364f[_0x63b5('0x4b')]['filter']){_0x534638[_0x63b5('0x54')]=_['merge'](_0x534638['where'],{'$or':_[_0x63b5('0x3e')](_0x534638[_0x63b5('0x4f')],function(_0x35bbf4){var _0x51c672={};_0x51c672[_0x35bbf4]={'$like':'%'+_0x87364f[_0x63b5('0x4b')]['filter']+'%'};return _0x51c672;})});}_0x534638=_[_0x63b5('0x5c')]({},_0x534638,_0x87364f[_0x63b5('0xb9')]);return _0x2425fd['getLists'](_0x534638);}})[_0x63b5('0x20')](function(_0x4f32c8){if(_0x4f32c8){_0x40a61c=_0x4f32c8[_0x63b5('0x50')];if(!_0x87364f[_0x63b5('0x4b')]['hasOwnProperty'](_0x63b5('0xbe'))){_0x534638[_0x63b5('0x52')]=qs[_0x63b5('0x52')](_0x87364f['query'][_0x63b5('0x52')]);_0x534638[_0x63b5('0x2f')]=qs[_0x63b5('0x2f')](_0x87364f[_0x63b5('0x4b')][_0x63b5('0x2f')]);}return _0x2425fd[_0x63b5('0x113')](_0x534638);}})[_0x63b5('0x20')](function(_0x1968f2){if(_0x1968f2){return _0x1968f2?{'count':_0x40a61c,'rows':_0x1968f2}:null;}})[_0x63b5('0x20')](respondWithResult(_0x50752b,null))[_0x63b5('0x29')](handleError(_0x50752b,null));};exports['getAgents']=function(_0x3953b9,_0x3b6d2a,_0x46adb9){var _0x5842d0={};var _0x2ab83a={};var _0xb01ef2;var _0x4e2e0b;return db[_0x63b5('0x46')][_0x63b5('0x8e')]({'where':{'id':_0x3953b9['params']['id']}})[_0x63b5('0x20')](handleEntityNotFound(_0x3b6d2a,null))[_0x63b5('0x20')](function(_0x50de1d){if(_0x50de1d){_0xb01ef2=_0x50de1d;_0x2ab83a[_0x63b5('0x4d')]=_[_0x63b5('0x62')](db['User'][_0x63b5('0x47')]);_0x2ab83a[_0x63b5('0x4b')]=_[_0x63b5('0x62')](_0x3953b9['query']);_0x2ab83a[_0x63b5('0x55')]=_[_0x63b5('0x4c')](_0x2ab83a[_0x63b5('0x4d')],_0x2ab83a[_0x63b5('0x4b')]);_0x5842d0[_0x63b5('0x4f')]=_[_0x63b5('0x4c')](_0x2ab83a[_0x63b5('0x4d')],qs[_0x63b5('0x4e')](_0x3953b9['query']['fields']));_0x5842d0[_0x63b5('0x4f')]=_0x5842d0[_0x63b5('0x4f')][_0x63b5('0x50')]?_0x5842d0[_0x63b5('0x4f')]:_0x2ab83a[_0x63b5('0x4d')];_0x5842d0[_0x63b5('0xc1')]=qs[_0x63b5('0x53')](_0x3953b9[_0x63b5('0x4b')][_0x63b5('0x53')]);_0x5842d0[_0x63b5('0x54')]=qs[_0x63b5('0x55')](_[_0x63b5('0x56')](_0x3953b9[_0x63b5('0x4b')],_0x2ab83a[_0x63b5('0x55')]));if(_0x3953b9[_0x63b5('0x4b')][_0x63b5('0x3c')]){_0x5842d0[_0x63b5('0x54')]=_[_0x63b5('0x5c')](_0x5842d0['where'],{'$or':_['map'](_0x5842d0[_0x63b5('0x4f')],function(_0x574817){var _0x5eb387={};_0x5eb387[_0x574817]={'$like':'%'+_0x3953b9[_0x63b5('0x4b')][_0x63b5('0x3c')]+'%'};return _0x5eb387;})});}_0x5842d0[_0x63b5('0x4d')]=db[_0x63b5('0x46')];_0x5842d0['as']=_0x63b5('0x38');_0x5842d0=_[_0x63b5('0x5c')]({},_0x5842d0,_0x3953b9[_0x63b5('0xb9')]);return _0xb01ef2[_0x63b5('0xdf')]({'include':[_0x5842d0]});}})[_0x63b5('0x20')](function(_0x1621a0){if(_0x1621a0){var _0x4c2d31={},_0x4e6745=[],_0x42fe18=0x0;for(var _0x310841=0x0;_0x310841<_0x1621a0[_0x63b5('0x50')];_0x310841+=0x1){for(var _0x242711=0x0,_0xda43e2;_0x242711<_0x1621a0[_0x310841][_0x63b5('0x38')][_0x63b5('0x50')];_0x242711+=0x1){_0xda43e2=_0x1621a0[_0x310841][_0x63b5('0x38')][_0x242711]['get']({'plain':!![]});_0x4c2d31[_0xda43e2['id']]=_0xda43e2;}}_0x4c2d31=_['values'](_0x4c2d31);for(var _0x26ce93=qs[_0x63b5('0x2f')](_0x3953b9[_0x63b5('0x4b')][_0x63b5('0x2f')]);_0x26ce93<_0x4c2d31[_0x63b5('0x50')]&&_0x4e6745[_0x63b5('0x50')]=_0x1d78f2){_0x55dc1d=_0x1d78f2;_0x419508=0xc8;}else{_0x419508=0xce;}_0x17906b['status'](_0x419508);return _0x17906b[_0x6f9a('0x31')](_0x6f9a('0x32'),_0x61f683+'-'+_0x55dc1d+'/'+_0x1d78f2)[_0x6f9a('0x2d')](_0x307ca9);}return null;};}function patchUpdates(_0x965b72){return function(_0x4ecfc6){try{jsonpatch[_0x6f9a('0x33')](_0x4ecfc6,_0x965b72,!![]);}catch(_0x39c742){return BPromise[_0x6f9a('0x34')](_0x39c742);}return _0x4ecfc6['save']();};}function saveUpdates(_0x13165d,_0x130c40){return function(_0x52e7d0){if(_0x52e7d0){return _0x52e7d0[_0x6f9a('0x35')](_0x13165d)[_0x6f9a('0x22')](function(_0x47546f){return _0x47546f;});}return null;};}function removeEntity(_0x18dc88,_0x1bf8ec){return function(_0x289fcd){if(_0x289fcd){return _0x289fcd[_0x6f9a('0x36')]()['then'](function(){var _0xf98bb6=_0x289fcd[_0x6f9a('0x37')]({'plain':!![]});var _0x128b60=[{'name':_0x6f9a('0x38'),'value':_0x6f9a('0x39'),'ignore':!![]},{'name':_0x6f9a('0x3a'),'value':_0x6f9a('0x3b'),'ignore':![]},{'name':_0x6f9a('0x3c'),'value':'telephone','ignore':![]}];var _0x5f9390=_(_0x128b60)[_0x6f9a('0x3d')](_0x6f9a('0x3e'))[_0x6f9a('0x3f')](_0x6f9a('0x40'))['value']();if(_[_0x6f9a('0x41')](_0x5f9390,_0xf98bb6['role'])){return;}var _0x1be6f6=_['find'](_0x128b60,[_0x6f9a('0x40'),_0xf98bb6[_0x6f9a('0x42')]])[_0x6f9a('0x43')];return db[_0x6f9a('0x44')][_0x6f9a('0x36')]({'where':{'type':_0x1be6f6,'resourceId':_0xf98bb6['id']}})['then'](function(){return _0x289fcd;});})[_0x6f9a('0x22')](function(){_0x18dc88['status'](0xcc)[_0x6f9a('0x2c')]();});}};}function handleEntityNotFound(_0x197a98,_0x35ae9e){return function(_0x4bd785){if(!_0x4bd785){_0x197a98['sendStatus'](0x194);}return _0x4bd785;};}function handleError(_0x9b95ac,_0x3020d8){_0x3020d8=_0x3020d8||0x1f4;return function(_0x222728){logger[_0x6f9a('0x26')](_0x222728[_0x6f9a('0x45')]);if(_0x222728[_0x6f9a('0x43')]){delete _0x222728['name'];}_0x9b95ac[_0x6f9a('0x2b')](_0x3020d8)[_0x6f9a('0x46')](_0x222728);};}exports[_0x6f9a('0x47')]=function(_0x16b031,_0x172c03){var _0x24ab8c={},_0x48edcb={},_0x519b32={'count':0x0,'rows':[]};var _0x40af33=_['map'](db[_0x6f9a('0x48')]['rawAttributes'],function(_0x123b2a){return{'name':_0x123b2a[_0x6f9a('0x49')],'type':_0x123b2a[_0x6f9a('0x4a')]['key']};});_0x48edcb[_0x6f9a('0x4b')]=_['differenceBy'](_[_0x6f9a('0x3f')](_0x40af33,_0x6f9a('0x43')),['password',_0x6f9a('0x4c')]);_0x48edcb['query']=_[_0x6f9a('0x4d')](_0x16b031[_0x6f9a('0x4e')]);_0x48edcb[_0x6f9a('0x4f')]=_[_0x6f9a('0x50')](_0x48edcb['model'],_0x48edcb[_0x6f9a('0x4e')]);_0x24ab8c[_0x6f9a('0x51')]=_[_0x6f9a('0x50')](_0x48edcb[_0x6f9a('0x4b')],qs['fields'](_0x16b031['query'][_0x6f9a('0x52')]));_0x24ab8c[_0x6f9a('0x51')]=_0x24ab8c[_0x6f9a('0x51')][_0x6f9a('0x53')]?_0x24ab8c[_0x6f9a('0x51')]:_0x48edcb['model'];if(!_0x16b031[_0x6f9a('0x4e')][_0x6f9a('0x54')](_0x6f9a('0x55'))){_0x24ab8c[_0x6f9a('0x30')]=qs['limit'](_0x16b031[_0x6f9a('0x4e')]['limit']);_0x24ab8c['offset']=qs[_0x6f9a('0x2f')](_0x16b031[_0x6f9a('0x4e')][_0x6f9a('0x2f')]);}_0x24ab8c[_0x6f9a('0x56')]=qs[_0x6f9a('0x57')](_0x16b031[_0x6f9a('0x4e')][_0x6f9a('0x57')]);_0x24ab8c[_0x6f9a('0x58')]=qs[_0x6f9a('0x4f')](_[_0x6f9a('0x59')](_0x16b031['query'],_0x48edcb[_0x6f9a('0x4f')]),_0x40af33);if(_0x16b031['query'][_0x6f9a('0x3d')]){_0x24ab8c['where']=_[_0x6f9a('0x5a')](_0x24ab8c[_0x6f9a('0x58')],{'$or':_[_0x6f9a('0x3f')](_0x40af33,function(_0x901816){if(_0x901816[_0x6f9a('0x4a')]!==_0x6f9a('0x5b')){return db[_0x6f9a('0x5c')][_0x6f9a('0x58')](db['sequelize']['fn'](_0x6f9a('0x5d'),db['sequelize'][_0x6f9a('0x5e')](_0x901816[_0x6f9a('0x43')])),{'$like':db[_0x6f9a('0x5c')]['fn']('lower','%'+_0x16b031['query'][_0x6f9a('0x3d')]+'%')});}})});}_0x24ab8c=_[_0x6f9a('0x5a')]({},_0x24ab8c,_0x16b031[_0x6f9a('0x5f')]);var _0x1ed640={'where':_0x24ab8c['where']};return db[_0x6f9a('0x48')][_0x6f9a('0x2e')](_0x1ed640)[_0x6f9a('0x22')](function(_0x3e4041){_0x519b32['count']=_0x3e4041;if(_0x16b031[_0x6f9a('0x4e')][_0x6f9a('0x60')]){_0x24ab8c['include']=[{'all':!![]}];}return db['User']['findAll'](_0x24ab8c);})[_0x6f9a('0x22')](function(_0x5a4b01){_0x519b32['rows']=_0x5a4b01;return _0x519b32;})[_0x6f9a('0x22')](respondWithFilteredResult(_0x172c03,_0x24ab8c))[_0x6f9a('0x61')](handleError(_0x172c03,null));};exports['show']=function(_0x4d6ab0,_0x3a5cba){var _0x2ab35c={'raw':![],'where':{'id':_0x4d6ab0[_0x6f9a('0x62')]['id']}},_0x48eb0c={};_0x48eb0c[_0x6f9a('0x4b')]=_[_0x6f9a('0x63')](_['keys'](db[_0x6f9a('0x48')]['rawAttributes']),[_0x6f9a('0x64'),'salt']);_0x48eb0c[_0x6f9a('0x4e')]=_[_0x6f9a('0x4d')](_0x4d6ab0[_0x6f9a('0x4e')]);_0x48eb0c[_0x6f9a('0x4f')]=_[_0x6f9a('0x50')](_0x48eb0c['model'],_0x48eb0c[_0x6f9a('0x4e')]);_0x2ab35c['attributes']=_[_0x6f9a('0x50')](_0x48eb0c['model'],qs[_0x6f9a('0x52')](_0x4d6ab0[_0x6f9a('0x4e')][_0x6f9a('0x52')]));_0x2ab35c['attributes']=_0x2ab35c[_0x6f9a('0x51')][_0x6f9a('0x53')]?_0x2ab35c['attributes']:_0x48eb0c[_0x6f9a('0x4b')];if(_0x4d6ab0[_0x6f9a('0x4e')]['includeAll']){_0x2ab35c['include']=[{'all':!![]}];}_0x2ab35c=_[_0x6f9a('0x5a')]({},_0x2ab35c,_0x4d6ab0[_0x6f9a('0x5f')]);return db[_0x6f9a('0x48')][_0x6f9a('0x65')](_0x2ab35c)[_0x6f9a('0x22')](handleEntityNotFound(_0x3a5cba,null))[_0x6f9a('0x22')](respondWithResult(_0x3a5cba,null))[_0x6f9a('0x61')](handleError(_0x3a5cba,null));};exports[_0x6f9a('0x66')]=function(_0x14c274,_0x45f6bd){return db[_0x6f9a('0x48')][_0x6f9a('0x66')](_0x14c274['body'],{'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x45f6bd,0xc9))[_0x6f9a('0x61')](handleError(_0x45f6bd,null));};exports[_0x6f9a('0x35')]=function(_0x556f69,_0x1cbd9f){if(_0x556f69[_0x6f9a('0x67')]['id']){delete _0x556f69[_0x6f9a('0x67')]['id'];}delete _0x556f69[_0x6f9a('0x67')][_0x6f9a('0x42')];return db[_0x6f9a('0x48')][_0x6f9a('0x65')]({'where':{'id':_0x556f69[_0x6f9a('0x62')]['id']}})['then'](handleEntityNotFound(_0x1cbd9f,null))[_0x6f9a('0x22')](saveUpdates(_0x556f69[_0x6f9a('0x67')],null))['then'](respondWithResult(_0x1cbd9f,null))[_0x6f9a('0x61')](handleError(_0x1cbd9f,null));};exports[_0x6f9a('0x68')]=function(_0x387c6a,_0x771bba){return db['User'][_0x6f9a('0x68')]()['then'](respondWithResult(_0x771bba,null))[_0x6f9a('0x61')](handleError(_0x771bba,null));};exports[_0x6f9a('0x69')]=function(_0x3b6a74,_0x5ec741,_0x599c5c){return db[_0x6f9a('0x48')][_0x6f9a('0x65')]({'where':{'id':_0x3b6a74[_0x6f9a('0x62')]['id']}})['then'](handleEntityNotFound(_0x5ec741,null))[_0x6f9a('0x22')](function(_0x3c220a){if(_0x3c220a){return _0x3c220a[_0x6f9a('0x69')](_0x3b6a74[_0x6f9a('0x67')][_0x6f9a('0x6a')],_['omit'](_0x3b6a74[_0x6f9a('0x67')],[_0x6f9a('0x6a'),'id'])||{});}})[_0x6f9a('0x22')](respondWithResult(_0x5ec741,null))[_0x6f9a('0x61')](handleError(_0x5ec741,null));};var getLicense=function(_0x2fda){return new BPromise(function(_0x202311,_0x3311db){var _0x4bd25a=0x0;_0x2fda[_0x6f9a('0x67')][_0x6f9a('0x42')]===_0x6f9a('0x3b')&&_0x202311(_0x6f9a('0x6b'));return db['User'][_0x6f9a('0x2e')]({'where':{'$or':[{'role':_0x2fda[_0x6f9a('0x67')][_0x6f9a('0x42')]===_0x6f9a('0x6c')?_0x6f9a('0x6c'):[_0x6f9a('0x6d'),_0x6f9a('0x39')]}]}})['then'](function(_0x52cd07){_0x4bd25a=_0x52cd07;return require(_0x6f9a('0x6e'))[_0x6f9a('0x6f')]();})[_0x6f9a('0x22')](function(_0x51bff1){var _0x12aea7=_0x2fda[_0x6f9a('0x67')]['role']===_0x6f9a('0x6c')?_0x6f9a('0x70'):'users';if(!_[_0x6f9a('0x71')](_0x51bff1[_0x12aea7])&&_0x4bd25a>=_0x51bff1[_0x12aea7]){return _0x3311db({'message':'License\x20limit\x20reached'});}return _0x202311(util['format']('count\x20%s:\x20%s',_0x12aea7,_0x4bd25a));})[_0x6f9a('0x61')](function(_0x15a19e){return _0x3311db(_0x15a19e);});});};exports['create']=function(_0x6a3b9d,_0x3b80dc){return getLicense(_0x6a3b9d)[_0x6f9a('0x22')](function(_0x1d1f0e){if(!_0x6a3b9d[_0x6f9a('0x67')][_0x6f9a('0x72')]){var _0x2da6d0;return db['Setting'][_0x6f9a('0x73')](0x1)[_0x6f9a('0x22')](function(_0x49944d){return checkPasswordPattern(_0x49944d,_0x6a3b9d[_0x6f9a('0x67')][_0x6f9a('0x64')],_0x49944d[_0x6f9a('0x74')]);})['then'](function(_0x16b12a){_0x2da6d0=_0x16b12a[_0x6f9a('0x75')];return db['User']['max']('internal');})[_0x6f9a('0x22')](function(_0x5517b2){if(_[_0x6f9a('0x71')](_0x5517b2)){if(_0x2da6d0){_0x6a3b9d[_0x6f9a('0x67')][_0x6f9a('0x72')]=_0x2da6d0;}else{_0x6a3b9d[_0x6f9a('0x67')][_0x6f9a('0x72')]=0x1;}}else{if(_[_0x6f9a('0x71')](_0x2da6d0)||_0x2da6d0==_0x5517b2){_0x6a3b9d[_0x6f9a('0x67')]['internal']=_0x5517b2+0x1;}else if(_0x2da6d0>_0x5517b2){_0x6a3b9d[_0x6f9a('0x67')][_0x6f9a('0x72')]=_0x2da6d0;}else{return db['sequelize']['query']('select\x20(select\x20IFNULL(max(internal)+1,1)\x20from\x20users\x20where\x20internal\x20<\x20md.internal)\x20as\x20\x27from\x27,\x20md.internal\x20-\x201\x20as\x20\x27to\x27\x20from\x20users\x20md\x20where\x20md.internal\x20!=\x201\x20and\x20not\x20exists\x20(select\x201\x20from\x20users\x20md2\x20where\x20md2.internal\x20=\x20md.internal\x20-\x201)',{'type':db[_0x6f9a('0x5c')][_0x6f9a('0x76')][_0x6f9a('0x77')]})['then'](function(_0xa3fbb0){if(_0xa3fbb0&&_0xa3fbb0[_0x6f9a('0x53')]){for(var _0x39a7df=0x0,_0x3851a0=_0xa3fbb0[_0x6f9a('0x53')];_0x39a7df<_0x3851a0&&_[_0x6f9a('0x71')](_0x6a3b9d[_0x6f9a('0x67')]['internal']);_0x39a7df++){if(_0x2da6d0<=_0xa3fbb0[_0x39a7df][_0x6f9a('0x78')]){_0x6a3b9d['body'][_0x6f9a('0x72')]=_0xa3fbb0[_0x39a7df]['from'];}else if(_0x2da6d0>_0xa3fbb0[_0x39a7df]['from']&&_0x2da6d0<=_0xa3fbb0[_0x39a7df]['to']){_0x6a3b9d[_0x6f9a('0x67')][_0x6f9a('0x72')]=_0x2da6d0;}}}if(_[_0x6f9a('0x71')](_0x6a3b9d[_0x6f9a('0x67')][_0x6f9a('0x72')])){_0x6a3b9d[_0x6f9a('0x67')]['internal']=_0x5517b2+0x1;}});}}});}})[_0x6f9a('0x22')](function(){if(_0x6a3b9d['body']['voicemail']){_0x6a3b9d[_0x6f9a('0x67')][_0x6f9a('0x79')]=_0x6a3b9d['body']['internal'];_0x6a3b9d[_0x6f9a('0x67')][_0x6f9a('0x7a')]={'mailbox':_0x6a3b9d[_0x6f9a('0x67')]['internal'],'password':_0x6a3b9d[_0x6f9a('0x67')][_0x6f9a('0x64')],'fullname':_0x6a3b9d[_0x6f9a('0x67')][_0x6f9a('0x7b')],'email':_0x6a3b9d[_0x6f9a('0x67')][_0x6f9a('0x7c')]};}if(_0x6a3b9d[_0x6f9a('0x67')]&&_0x6a3b9d[_0x6f9a('0x67')][_0x6f9a('0x42')]===_0x6f9a('0x3b')){if(!_0x6a3b9d['body'][_0x6f9a('0x7d')]){_0x6a3b9d['body'][_0x6f9a('0x7d')]=['101',_0x6f9a('0x7e'),_0x6f9a('0x7f'),'113','110',_0x6f9a('0x80'),_0x6f9a('0x81'),_0x6f9a('0x82'),'107',_0x6f9a('0x83'),_0x6f9a('0x84'),_0x6f9a('0x85'),'111',_0x6f9a('0x86')];}}return db[_0x6f9a('0x48')][_0x6f9a('0x87')](_0x6a3b9d['body'],{'include':[{'model':db[_0x6f9a('0x7a')],'as':'VoiceMail'}]});})[_0x6f9a('0x22')](function(_0x420021){if(_0x6a3b9d[_0x6f9a('0x67')][_0x6f9a('0x42')]===_0x6f9a('0x39'))return _0x420021;var _0x2c5d0d=_0x6a3b9d[_0x6f9a('0x39')][_0x6f9a('0x37')]({'plain':!![]});if(!_0x2c5d0d)throw new Error(_0x6f9a('0x88'));if(_0x2c5d0d['role']===_0x6f9a('0x39')){var _0x3bcecb=_0x420021[_0x6f9a('0x37')]({'plain':!![]});var _0x51058f=[{'name':_0x6f9a('0x3a'),'value':_0x6f9a('0x3b')},{'name':_0x6f9a('0x3c'),'value':_0x6f9a('0x6c')}];var _0x3f880f=_['find'](_0x51058f,[_0x6f9a('0x40'),_0x3bcecb[_0x6f9a('0x42')]])[_0x6f9a('0x43')];return db[_0x6f9a('0x89')][_0x6f9a('0x65')]({'where':{'name':_0x3f880f,'userProfileId':_0x2c5d0d['userProfileId']},'raw':!![]})[_0x6f9a('0x22')](function(_0x5284a0){if(_0x5284a0&&_0x5284a0[_0x6f9a('0x8a')]===0x0){return db['UserProfileResource'][_0x6f9a('0x87')]({'name':_0x3bcecb['name'],'resourceId':_0x3bcecb['id'],'type':_0x5284a0[_0x6f9a('0x43')],'sectionId':_0x5284a0['id']},{})['then'](function(){return _0x420021;});}else{return _0x420021;}})['catch'](function(_0x2faed8){logger[_0x6f9a('0x26')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2faed8);throw _0x2faed8;});}return _0x420021;})[_0x6f9a('0x22')](respondWithResult(_0x3b80dc,0xc9))[_0x6f9a('0x61')](handleError(_0x3b80dc,null));};exports[_0x6f9a('0x8b')]=function(_0x295b7a,_0x371af2,_0x1e4c12){var _0x4de686=![];if(_0x295b7a[_0x6f9a('0x67')]['id']){delete _0x295b7a['body']['id'];}return db[_0x6f9a('0x8c')][_0x6f9a('0x8d')]({'attributes':['id',_0x6f9a('0x74')]})[_0x6f9a('0x22')](function(_0x2b0bea){_0x4de686=_0x2b0bea[_0x6f9a('0x74')];return db['User']['find']({'where':{'id':_0x295b7a[_0x6f9a('0x62')]['id']}});})[_0x6f9a('0x22')](function(_0x263fd0){if(_0x263fd0){if(_0x263fd0['id']==_0x295b7a[_0x6f9a('0x39')]['id']){if(!_0x295b7a[_0x6f9a('0x67')][_0x6f9a('0x8e')]||!_0x295b7a['body'][_0x6f9a('0x8f')]){throw new db[(_0x6f9a('0x20'))][(_0x6f9a('0x90'))]('Invalid\x20body\x20format.\x20Use\x20oldPassord\x20and\x20newPassword');}if(!_0x263fd0[_0x6f9a('0x91')](_0x295b7a['body']['oldPassword'])){throw new db['Sequelize'][(_0x6f9a('0x90'))](_0x6f9a('0x92'));}if(_0x295b7a[_0x6f9a('0x67')]['oldPassword']==_0x295b7a[_0x6f9a('0x67')][_0x6f9a('0x8f')]){throw new db['Sequelize'][(_0x6f9a('0x90'))](_0x6f9a('0x93'));}return _0x263fd0;}else if(_0x295b7a['user'][_0x6f9a('0x42')]==_0x6f9a('0x6d')){if(!_0x295b7a[_0x6f9a('0x67')]['newPassword']){throw new db[(_0x6f9a('0x20'))][(_0x6f9a('0x90'))](_0x6f9a('0x94'));}return _0x263fd0;}else if(_0x295b7a[_0x6f9a('0x39')][_0x6f9a('0x42')]==_0x6f9a('0x39')){if(!_0x295b7a[_0x6f9a('0x67')][_0x6f9a('0x8f')]){throw new db[(_0x6f9a('0x20'))]['ValidationError'](_0x6f9a('0x94'));}if(_0x263fd0[_0x6f9a('0x42')]!=_0x6f9a('0x3b')){throw new db['Sequelize'][(_0x6f9a('0x90'))](_0x6f9a('0x95'));}return _0x263fd0;}else{throw new db[(_0x6f9a('0x20'))]['ValidationError'](_0x6f9a('0x95'));}}return null;})[_0x6f9a('0x22')](handleEntityNotFound(_0x371af2,null))[_0x6f9a('0x22')](function(_0x1652e1){return checkPasswordPattern(_0x1652e1,_0x295b7a[_0x6f9a('0x67')][_0x6f9a('0x8f')],_0x4de686);})['then'](saveUpdates({'password':_0x295b7a[_0x6f9a('0x67')]['newPassword'],'passwordResetAt':_0x295b7a[_0x6f9a('0x39')]['id']==_0x295b7a['params']['id']?moment():null},null))['then'](respondWithResult(_0x371af2,null))[_0x6f9a('0x61')](handleError(_0x371af2,null));};exports[_0x6f9a('0x96')]=function(_0x319cd8,_0x25afb0,_0x24a704){var _0x16bee2=_0x319cd8[_0x6f9a('0x67')]['channel'];return db['User'][_0x6f9a('0x65')]({'where':{'id':_0x319cd8['params']['id']},'attributes':['id','name',_0x6f9a('0x42'),_0x6f9a('0x97'),_0x6f9a('0x98'),_0x6f9a('0x99'),_0x6f9a('0x9a')]})[_0x6f9a('0x22')](handleEntityNotFound(_0x25afb0,null))[_0x6f9a('0x22')](function(_0x3d54b2){if(_0x3d54b2){if(!utils[_0x6f9a('0x9b')](_0x16bee2)){throw new db[(_0x6f9a('0x20'))][(_0x6f9a('0x90'))](_0x6f9a('0x9c'));}return _0x3d54b2[_0x6f9a('0x9d')+_[_0x6f9a('0x9e')](_0x16bee2[_0x6f9a('0x9f')]())+_0x6f9a('0xa0')](_0x319cd8[_0x6f9a('0x67')][_0x6f9a('0x6a')],{'penalty':_0x319cd8[_0x6f9a('0x67')]['penalty']||0x0})[_0x6f9a('0xa1')](function(_0x39fcef){for(var _0x50b6aa=0x0;_0x50b6aa<_0x319cd8[_0x6f9a('0x67')][_0x6f9a('0x6a')][_0x6f9a('0x53')];_0x50b6aa+=0x1){var _0x419e57={'UserId':_0x319cd8[_0x6f9a('0x62')]['id']};_0x419e57[_['capitalize'](_0x16bee2[_0x6f9a('0x9f')]())+_0x6f9a('0xa2')]=_0x319cd8['body'][_0x6f9a('0x6a')][_0x50b6aa];socket[_0x6f9a('0xa3')]('user'+_[_0x6f9a('0x9e')](_0x16bee2[_0x6f9a('0x9f')]())+'Queue:save',_0x419e57);}return _0x39fcef;})['then'](function(){if(_0x16bee2===_0x6f9a('0xa4')){return db[_0x6f9a('0xa5')][_0x6f9a('0xa6')]({'where':{'id':_0x319cd8[_0x6f9a('0x67')][_0x6f9a('0x6a')]||[]},'raw':!![],'attributes':['id','name']});}})['then'](function(_0x4be2f4){var _0x1ea8bc=_0x3d54b2[_0x6f9a('0x37')]({'plain':!![]});var _0x20d8b0=[];if(_0x16bee2===_0x6f9a('0xa4')&&_0x1ea8bc[_0x6f9a('0x42')]===_0x6f9a('0x3b')&&_0x1ea8bc[_0x6f9a('0x97')]){for(var _0x525c79=0x0;_0x525c79<_0x4be2f4[_0x6f9a('0x53')];_0x525c79+=0x1){_0x20d8b0[_0x6f9a('0xa7')]({'membername':_0x1ea8bc[_0x6f9a('0x43')],'UserId':_0x1ea8bc['id'],'queue_name':_0x4be2f4[_0x525c79]['name'],'VoiceQueueId':_0x4be2f4[_0x525c79]['id'],'interface':_[_0x6f9a('0x71')](_0x1ea8bc[_0x6f9a('0x9a')])?util[_0x6f9a('0xa8')]('SIP/%s',_0x1ea8bc[_0x6f9a('0x43')]):_0x1ea8bc[_0x6f9a('0x9a')],'paused':_0x1ea8bc[_0x6f9a('0x99')]||![],'penalty':_0x319cd8[_0x6f9a('0x67')]['penalty']||0x0});}return BPromise[_0x6f9a('0xa9')](_0x20d8b0,function(_0x2cf587){return db['UserVoiceQueueRt'][_0x6f9a('0xaa')](_0x2cf587);});}return _0x3d54b2;});}})[_0x6f9a('0x22')](respondWithStatusCode(_0x25afb0,null))[_0x6f9a('0x61')](handleError(_0x25afb0,null));};exports[_0x6f9a('0xab')]=function(_0xf8fd09,_0x6d8dfa,_0x4cf37e){var _0x130aad;return db[_0x6f9a('0x48')]['find']({'where':{'id':_0xf8fd09[_0x6f9a('0x62')]['id']},'attributes':['id','name',_0x6f9a('0x42')]})[_0x6f9a('0x22')](handleEntityNotFound(_0x6d8dfa,null))[_0x6f9a('0x22')](function(_0x5aba2b){if(_0x5aba2b){_0x130aad=_0x5aba2b;if(!_0xf8fd09[_0x6f9a('0x4e')]['channel']||!utils[_0x6f9a('0x9b')](_0xf8fd09['query'][_0x6f9a('0xac')])){throw new db[(_0x6f9a('0x20'))][(_0x6f9a('0x90'))]('Unknown\x20channel');}return _0x5aba2b[_0x6f9a('0xad')+_[_0x6f9a('0x9e')](_0xf8fd09[_0x6f9a('0x4e')][_0x6f9a('0xac')][_0x6f9a('0x9f')]())+_0x6f9a('0xa0')](_0xf8fd09[_0x6f9a('0x4e')]['ids']);}})[_0x6f9a('0x22')](function(_0x280b10){for(var _0x52e0d6=0x0;_0x52e0d6<_0xf8fd09[_0x6f9a('0x4e')][_0x6f9a('0x6a')]['length'];_0x52e0d6+=0x1){var _0x5de5c6={'UserId':_0xf8fd09[_0x6f9a('0x62')]['id']};_0x5de5c6[_[_0x6f9a('0x9e')](_0xf8fd09[_0x6f9a('0x4e')]['channel'][_0x6f9a('0x9f')]())+_0x6f9a('0xa2')]=_0xf8fd09[_0x6f9a('0x4e')][_0x6f9a('0x6a')][_0x52e0d6];socket[_0x6f9a('0xa3')](_0x6f9a('0x39')+_[_0x6f9a('0x9e')](_0xf8fd09[_0x6f9a('0x4e')]['channel'][_0x6f9a('0x9f')]())+_0x6f9a('0xae'),_0x5de5c6);}return _0x280b10;})[_0x6f9a('0x22')](function(){if(_0xf8fd09[_0x6f9a('0x4e')][_0x6f9a('0xac')]===_0x6f9a('0xa4')){return db[_0x6f9a('0xaf')][_0x6f9a('0x36')]({'where':{'UserId':_0xf8fd09[_0x6f9a('0x62')]['id'],'VoiceQueueId':_0xf8fd09[_0x6f9a('0x4e')][_0x6f9a('0x6a')]},'individualHooks':!![]})[_0x6f9a('0x22')](function(){return _0x130aad;});}return _0x130aad;})[_0x6f9a('0x22')](respondWithStatusCode(_0x6d8dfa,null))[_0x6f9a('0x61')](handleError(_0x6d8dfa,null));};exports['addAvatar']=function(_0x485696,_0x4923e7,_0x36801c){_0x485696[_0x6f9a('0x67')][_0x6f9a('0xb0')]=_0x485696[_0x6f9a('0xb1')]['filename'];return db[_0x6f9a('0x48')]['find']({'where':{'id':_0x485696['params']['id']}})['then'](handleEntityNotFound(_0x4923e7,null))['then'](saveUpdates(_0x485696['body'],null))['then'](respondWithResult(_0x4923e7,null))[_0x6f9a('0x61')](handleError(_0x4923e7,null));};exports['getAvatar']=function(_0x5a96f1,_0x2d35a3,_0x4260f3){var _0x12f573=path['join'](config[_0x6f9a('0xb2')],'server/files/images/logos/default_profile.png');return db[_0x6f9a('0x48')]['find']({'where':{'id':_0x5a96f1[_0x6f9a('0x62')]['id']},'attributes':['id',_0x6f9a('0xb0')],'raw':!![]})['then'](handleEntityNotFound(_0x2d35a3,null))[_0x6f9a('0x22')](function(_0x4b7968){if(_0x4b7968){if(_[_0x6f9a('0x71')](_0x4b7968[_0x6f9a('0xb0')])){return _0x2d35a3['download'](_0x12f573);}else{if(!fs[_0x6f9a('0xb3')](path[_0x6f9a('0xb4')](config[_0x6f9a('0xb2')],_0x6f9a('0xb5'),_0x4b7968['userpic']))){return _0x2d35a3[_0x6f9a('0xb6')](_0x12f573);}return _0x2d35a3[_0x6f9a('0xb6')](path[_0x6f9a('0xb4')](config['root'],_0x6f9a('0xb5'),_0x4b7968[_0x6f9a('0xb0')]));}}})[_0x6f9a('0x61')](handleError(_0x2d35a3,null));};exports[_0x6f9a('0xb7')]=function(_0x403ebb,_0x5a5611,_0x3dbe51){var _0x52c2ad={};var _0x1be31b={};var _0x2ad865;var _0x24861c;return db[_0x6f9a('0x48')][_0x6f9a('0x8d')]({'where':{'id':_0x403ebb['params']['id']}})[_0x6f9a('0x22')](handleEntityNotFound(_0x5a5611,null))[_0x6f9a('0x22')](function(_0x524355){if(_0x524355){_0x2ad865=_0x524355;_0x1be31b[_0x6f9a('0x4b')]=_[_0x6f9a('0x4d')](db[_0x6f9a('0xb8')]['rawAttributes']);_0x1be31b[_0x6f9a('0x4e')]=_[_0x6f9a('0x4d')](_0x403ebb[_0x6f9a('0x4e')]);_0x1be31b[_0x6f9a('0x4f')]=_[_0x6f9a('0x50')](_0x1be31b[_0x6f9a('0x4b')],_0x1be31b[_0x6f9a('0x4e')]);_0x52c2ad[_0x6f9a('0x51')]=_[_0x6f9a('0x50')](_0x1be31b[_0x6f9a('0x4b')],qs[_0x6f9a('0x52')](_0x403ebb[_0x6f9a('0x4e')]['fields']));_0x52c2ad[_0x6f9a('0x51')]=_0x52c2ad[_0x6f9a('0x51')]['length']?_0x52c2ad[_0x6f9a('0x51')]:_0x1be31b['model'];_0x52c2ad[_0x6f9a('0x56')]=qs[_0x6f9a('0x57')](_0x403ebb['query']['sort']);_0x52c2ad['where']=qs[_0x6f9a('0x4f')](_[_0x6f9a('0x59')](_0x403ebb[_0x6f9a('0x4e')],_0x1be31b[_0x6f9a('0x4f')]));if(_0x403ebb[_0x6f9a('0x4e')][_0x6f9a('0x3d')]){_0x52c2ad[_0x6f9a('0x58')]=_['merge'](_0x52c2ad[_0x6f9a('0x58')],{'$or':_[_0x6f9a('0x3f')](_0x52c2ad['attributes'],function(_0x2d37b9){var _0xdeab9={};_0xdeab9[_0x2d37b9]={'$like':'%'+_0x403ebb[_0x6f9a('0x4e')][_0x6f9a('0x3d')]+'%'};return _0xdeab9;})});}_0x52c2ad=_[_0x6f9a('0x5a')]({},_0x52c2ad,_0x403ebb[_0x6f9a('0x5f')]);return _0x2ad865[_0x6f9a('0xb7')](_0x52c2ad);}})[_0x6f9a('0x22')](function(_0x14b110){if(_0x14b110){_0x24861c=_0x14b110[_0x6f9a('0x53')];if(_0x403ebb[_0x6f9a('0x4e')][_0x6f9a('0x54')](_0x6f9a('0x60'))){_0x52c2ad[_0x6f9a('0xb9')]=[{'model':db[_0x6f9a('0xba')],'as':'List','required':![]},{'model':db[_0x6f9a('0xbb')],'as':_0x6f9a('0xbc'),'attributes':['id',_0x6f9a('0x43'),_0x6f9a('0xbd')],'where':_0x403ebb['query'][_0x6f9a('0xbe')]?{'id':_0x403ebb[_0x6f9a('0x4e')][_0x6f9a('0xbe')]}:undefined,'required':_0x403ebb[_0x6f9a('0x4e')][_0x6f9a('0xbe')]?!![]:![]}];}if(!_0x403ebb[_0x6f9a('0x4e')][_0x6f9a('0x54')](_0x6f9a('0x55'))){_0x52c2ad[_0x6f9a('0x30')]=qs[_0x6f9a('0x30')](_0x403ebb['query'][_0x6f9a('0x30')]);_0x52c2ad[_0x6f9a('0x2f')]=qs[_0x6f9a('0x2f')](_0x403ebb[_0x6f9a('0x4e')]['offset']);}return _0x2ad865[_0x6f9a('0xb7')](_0x52c2ad);}})[_0x6f9a('0x22')](function(_0x32b6ed){if(_0x32b6ed){return _0x32b6ed?{'count':_0x24861c,'rows':_0x32b6ed}:null;}})['then'](respondWithResult(_0x5a5611,null))[_0x6f9a('0x61')](handleError(_0x5a5611,null));};exports[_0x6f9a('0xbf')]=function(_0x9f96f0,_0x297b12,_0xdb1900){var _0x5d595a;var _0x525354;var _0x453e9f={};var _0x5d529e;return db['User']['findOne']({'where':{'id':_0x9f96f0[_0x6f9a('0x62')]['id']},'attributes':['id',_0x6f9a('0x43'),'role']})['then'](handleEntityNotFound(_0x297b12,null))[_0x6f9a('0x22')](function(_0x9aff8d){if(!utils[_0x6f9a('0x9b')](_0x9f96f0['query'][_0x6f9a('0xac')])){throw new db['Sequelize'][(_0x6f9a('0x90'))](_0x6f9a('0x9c'));}_0x5d595a=_0x9aff8d;var _0x353a04={};_0x353a04['model']=_[_0x6f9a('0x4d')](db[_[_0x6f9a('0x9e')](_0x9f96f0[_0x6f9a('0x4e')][_0x6f9a('0xac')])+_0x6f9a('0xc0')][_0x6f9a('0xc1')]);_0x353a04[_0x6f9a('0x4e')]=_[_0x6f9a('0x4d')](_0x9f96f0[_0x6f9a('0x4e')]);_0x353a04[_0x6f9a('0x4f')]=_[_0x6f9a('0x50')](_0x353a04[_0x6f9a('0x4b')],_0x353a04['query']);_0x453e9f[_0x6f9a('0x51')]=_[_0x6f9a('0x50')](_0x353a04[_0x6f9a('0x4b')],qs[_0x6f9a('0x52')](_0x9f96f0[_0x6f9a('0x4e')][_0x6f9a('0x52')]));_0x453e9f[_0x6f9a('0x51')]=_0x453e9f[_0x6f9a('0x51')][_0x6f9a('0x53')]?_0x453e9f[_0x6f9a('0x51')]:_0x353a04[_0x6f9a('0x4b')];_0x453e9f[_0x6f9a('0x56')]=qs[_0x6f9a('0x57')](_0x9f96f0[_0x6f9a('0x4e')][_0x6f9a('0x57')]);_0x453e9f[_0x6f9a('0x58')]=qs[_0x6f9a('0x4f')](_[_0x6f9a('0x59')](_0x9f96f0[_0x6f9a('0x4e')],_0x353a04['filters']));if(_0x9f96f0['query'][_0x6f9a('0x3d')]){_0x453e9f[_0x6f9a('0x58')]=_['merge'](_0x453e9f[_0x6f9a('0x58')],{'$or':_[_0x6f9a('0x3f')](_0x453e9f[_0x6f9a('0x51')],function(_0x2ef799){var _0x5bbdb1={};_0x5bbdb1[_0x2ef799]={'$like':'%'+_0x9f96f0['query'][_0x6f9a('0x3d')]+'%'};return _0x5bbdb1;})});}_0x453e9f=_[_0x6f9a('0x5a')]({},_0x453e9f,_0x9f96f0['options']);switch(_0x5d595a[_0x6f9a('0x42')]){case'admin':return db[_[_0x6f9a('0x9e')](_0x9f96f0[_0x6f9a('0x4e')][_0x6f9a('0xac')])+'Queue'][_0x6f9a('0xa6')](_0x453e9f);case _0x6f9a('0x39'):case _0x6f9a('0x3b'):return _0x5d595a[_0x6f9a('0x37')+_[_0x6f9a('0x9e')](_0x9f96f0[_0x6f9a('0x4e')][_0x6f9a('0xac')])+'Queues'](_0x453e9f);default:throw new db[(_0x6f9a('0x20'))][(_0x6f9a('0x90'))](_0x6f9a('0xc2'));}})[_0x6f9a('0x22')](function(_0x54bc3b){_0x5d529e=_0x54bc3b[_0x6f9a('0x53')];if(!_0x9f96f0[_0x6f9a('0x4e')][_0x6f9a('0x54')]('nolimit')){_0x453e9f[_0x6f9a('0x30')]=qs[_0x6f9a('0x30')](_0x9f96f0['query'][_0x6f9a('0x30')]);_0x453e9f['offset']=qs[_0x6f9a('0x2f')](_0x9f96f0[_0x6f9a('0x4e')][_0x6f9a('0x2f')]);}switch(_0x5d595a[_0x6f9a('0x42')]){case _0x6f9a('0x6d'):return db[_['capitalize'](_0x9f96f0[_0x6f9a('0x4e')]['channel'])+_0x6f9a('0xc0')][_0x6f9a('0xa6')](_0x453e9f);case _0x6f9a('0x39'):case _0x6f9a('0x3b'):return _0x5d595a[_0x6f9a('0x37')+_[_0x6f9a('0x9e')](_0x9f96f0[_0x6f9a('0x4e')][_0x6f9a('0xac')])+'Queues'](_0x453e9f);}})[_0x6f9a('0x22')](function(_0xc99ddd){return{'count':_0x5d529e,'rows':_0xc99ddd};})['then'](respondWithResult(_0x297b12,null))[_0x6f9a('0x61')](handleError(_0x297b12,null));};exports[_0x6f9a('0xc3')]=function(_0x59389d,_0x15c3fe,_0x199013){var _0x2af1bc={};var _0xd1b071={};var _0x200487;var _0x3c5a37;return db[_0x6f9a('0x48')][_0x6f9a('0x8d')]({'where':{'id':_0x59389d[_0x6f9a('0x62')]['id']}})[_0x6f9a('0x22')](handleEntityNotFound(_0x15c3fe,null))[_0x6f9a('0x22')](function(_0x267580){if(_0x267580){_0x200487=_0x267580;_0xd1b071[_0x6f9a('0x4b')]=_[_0x6f9a('0x4d')](db[_0x6f9a('0xaf')][_0x6f9a('0xc1')]);_0xd1b071[_0x6f9a('0x4e')]=_['keys'](_0x59389d[_0x6f9a('0x4e')]);_0xd1b071[_0x6f9a('0x4f')]=_[_0x6f9a('0x50')](_0xd1b071[_0x6f9a('0x4b')],_0xd1b071['query']);_0x2af1bc['attributes']=_[_0x6f9a('0x50')](_0xd1b071['model'],qs[_0x6f9a('0x52')](_0x59389d[_0x6f9a('0x4e')][_0x6f9a('0x52')]));_0x2af1bc[_0x6f9a('0x51')]=_0x2af1bc[_0x6f9a('0x51')][_0x6f9a('0x53')]?_0x2af1bc[_0x6f9a('0x51')]:_0xd1b071[_0x6f9a('0x4b')];_0x2af1bc[_0x6f9a('0x56')]=qs[_0x6f9a('0x57')](_0x59389d['query'][_0x6f9a('0x57')]);_0x2af1bc[_0x6f9a('0x58')]=qs['filters'](_[_0x6f9a('0x59')](_0x59389d['query'],_0xd1b071[_0x6f9a('0x4f')]));if(_0x59389d[_0x6f9a('0x4e')]['filter']){_0x2af1bc['where']=_[_0x6f9a('0x5a')](_0x2af1bc[_0x6f9a('0x58')],{'$or':_['map'](_0x2af1bc[_0x6f9a('0x51')],function(_0x12d230){var _0x4a992c={};_0x4a992c[_0x12d230]={'$like':'%'+_0x59389d[_0x6f9a('0x4e')]['filter']+'%'};return _0x4a992c;})});}_0x2af1bc=_['merge']({},_0x2af1bc,_0x59389d[_0x6f9a('0x5f')]);return _0x200487[_0x6f9a('0xc3')](_0x2af1bc);}})[_0x6f9a('0x22')](function(_0x1aae0b){if(_0x1aae0b){_0x3c5a37=_0x1aae0b[_0x6f9a('0x53')];if(!_0x59389d[_0x6f9a('0x4e')][_0x6f9a('0x54')](_0x6f9a('0x55'))){_0x2af1bc[_0x6f9a('0x30')]=qs['limit'](_0x59389d[_0x6f9a('0x4e')][_0x6f9a('0x30')]);_0x2af1bc[_0x6f9a('0x2f')]=qs[_0x6f9a('0x2f')](_0x59389d[_0x6f9a('0x4e')][_0x6f9a('0x2f')]);}return _0x200487[_0x6f9a('0xc3')](_0x2af1bc);}})[_0x6f9a('0x22')](function(_0x4617ab){if(_0x4617ab){return _0x4617ab?{'count':_0x3c5a37,'rows':_0x4617ab}:null;}})['then'](respondWithResult(_0x15c3fe,null))[_0x6f9a('0x61')](handleError(_0x15c3fe,null));};exports['getGroups']=function(_0x4de8d4,_0x3c72bd,_0x9d18a4){var _0x2f607a={};var _0x345a01={};var _0xb3767;var _0x3ed56b;return db['User'][_0x6f9a('0x8d')]({'where':{'id':_0x4de8d4['params']['id']}})[_0x6f9a('0x22')](handleEntityNotFound(_0x3c72bd,null))[_0x6f9a('0x22')](function(_0x4514ba){if(_0x4514ba){_0xb3767=_0x4514ba;_0x345a01[_0x6f9a('0x4b')]=_['keys'](db[_0x6f9a('0xc4')][_0x6f9a('0xc1')]);_0x345a01['query']=_['keys'](_0x4de8d4['query']);_0x345a01[_0x6f9a('0x4f')]=_['intersection'](_0x345a01[_0x6f9a('0x4b')],_0x345a01[_0x6f9a('0x4e')]);_0x2f607a['attributes']=_['intersection'](_0x345a01[_0x6f9a('0x4b')],qs['fields'](_0x4de8d4[_0x6f9a('0x4e')][_0x6f9a('0x52')]));_0x2f607a[_0x6f9a('0x51')]=_0x2f607a['attributes']['length']?_0x2f607a[_0x6f9a('0x51')]:_0x345a01[_0x6f9a('0x4b')];_0x2f607a[_0x6f9a('0x56')]=qs[_0x6f9a('0x57')](_0x4de8d4[_0x6f9a('0x4e')]['sort']);_0x2f607a[_0x6f9a('0x58')]=qs[_0x6f9a('0x4f')](_['pick'](_0x4de8d4['query'],_0x345a01['filters']));if(_0x4de8d4['query'][_0x6f9a('0x3d')]){_0x2f607a[_0x6f9a('0x58')]=_[_0x6f9a('0x5a')](_0x2f607a[_0x6f9a('0x58')],{'$or':_[_0x6f9a('0x3f')](_0x2f607a[_0x6f9a('0x51')],function(_0x45873d){var _0x4d2bfa={};_0x4d2bfa[_0x45873d]={'$like':'%'+_0x4de8d4['query'][_0x6f9a('0x3d')]+'%'};return _0x4d2bfa;})});}_0x2f607a=_['merge']({},_0x2f607a,_0x4de8d4[_0x6f9a('0x5f')]);return _0xb3767[_0x6f9a('0xc5')](_0x2f607a);}})[_0x6f9a('0x22')](function(_0x15426d){if(_0x15426d){_0x3ed56b=_0x15426d[_0x6f9a('0x53')];if(!_0x4de8d4['query'][_0x6f9a('0x54')]('nolimit')){_0x2f607a[_0x6f9a('0x30')]=qs['limit'](_0x4de8d4['query'][_0x6f9a('0x30')]);_0x2f607a[_0x6f9a('0x2f')]=qs['offset'](_0x4de8d4[_0x6f9a('0x4e')][_0x6f9a('0x2f')]);}return _0xb3767['getGroups'](_0x2f607a);}})['then'](function(_0x594002){if(_0x594002){return _0x594002?{'count':_0x3ed56b,'rows':_0x594002}:null;}})[_0x6f9a('0x22')](respondWithResult(_0x3c72bd,null))[_0x6f9a('0x61')](handleError(_0x3c72bd,null));};exports[_0x6f9a('0xc6')]=function(_0x5cf4e8,_0xb79da2,_0x4dc5e2){var _0x231af6={'raw':!![],'where':{}};var _0x588f68={};var _0x31ed09={'count':0x0,'rows':[]};return db[_0x6f9a('0x48')]['findOne']({'where':{'id':_0x5cf4e8['params']['id']}})[_0x6f9a('0x22')](handleEntityNotFound(_0xb79da2,null))[_0x6f9a('0x22')](function(_0x293659){if(_0x293659){_0x588f68[_0x6f9a('0x4b')]=_[_0x6f9a('0x4d')](db[_0x6f9a('0xc7')][_0x6f9a('0xc1')]);_0x588f68[_0x6f9a('0x4e')]=_[_0x6f9a('0x4d')](_0x5cf4e8[_0x6f9a('0x4e')]);_0x588f68[_0x6f9a('0x4f')]=_['intersection'](_0x588f68['model'],_0x588f68[_0x6f9a('0x4e')]);_0x231af6['attributes']=_['intersection'](_0x588f68['model'],qs[_0x6f9a('0x52')](_0x5cf4e8[_0x6f9a('0x4e')]['fields']));_0x231af6[_0x6f9a('0x51')]=_0x231af6[_0x6f9a('0x51')]['length']?_0x231af6[_0x6f9a('0x51')]:_0x588f68[_0x6f9a('0x4b')];if(!_0x5cf4e8[_0x6f9a('0x4e')][_0x6f9a('0x54')](_0x6f9a('0x55'))){_0x231af6[_0x6f9a('0x30')]=qs[_0x6f9a('0x30')](_0x5cf4e8[_0x6f9a('0x4e')][_0x6f9a('0x30')]);_0x231af6[_0x6f9a('0x2f')]=qs[_0x6f9a('0x2f')](_0x5cf4e8[_0x6f9a('0x4e')]['offset']);}_0x231af6[_0x6f9a('0x56')]=qs[_0x6f9a('0x57')](_0x5cf4e8[_0x6f9a('0x4e')][_0x6f9a('0x57')]);_0x231af6[_0x6f9a('0x58')]=qs[_0x6f9a('0x4f')](_[_0x6f9a('0x59')](_0x5cf4e8['query'],_0x588f68[_0x6f9a('0x4f')]));_0x231af6[_0x6f9a('0x58')][_0x6f9a('0xc8')]=_0x293659['id'];if(_0x5cf4e8[_0x6f9a('0x4e')]['filter']){_0x231af6[_0x6f9a('0x58')]=_[_0x6f9a('0x5a')](_0x231af6['where'],{'$or':_[_0x6f9a('0x3f')](_0x231af6[_0x6f9a('0x51')],function(_0x557d5d){var _0x57fadd={};_0x57fadd[_0x557d5d]={'$like':'%'+_0x5cf4e8[_0x6f9a('0x4e')][_0x6f9a('0x3d')]+'%'};return _0x57fadd;})});}_0x231af6=_[_0x6f9a('0x5a')]({},_0x231af6,_0x5cf4e8[_0x6f9a('0x5f')]);return db[_0x6f9a('0xc7')][_0x6f9a('0x2e')]({'where':_0x231af6['where']})[_0x6f9a('0x22')](function(_0x4c9ea7){_0x31ed09[_0x6f9a('0x2e')]=_0x4c9ea7;if(_0x5cf4e8[_0x6f9a('0x4e')][_0x6f9a('0x60')]){_0x231af6[_0x6f9a('0xb9')]=[{'all':!![]}];}return db[_0x6f9a('0xc7')]['findAll'](_0x231af6);})[_0x6f9a('0x22')](function(_0xa956aa){_0x31ed09[_0x6f9a('0xc9')]=_0xa956aa;return _0x31ed09;});}})[_0x6f9a('0x22')](respondWithFilteredResult(_0xb79da2,_0x231af6))[_0x6f9a('0x61')](handleError(_0xb79da2,null));};exports[_0x6f9a('0xca')]=function(_0x49e19f,_0x1e02bd,_0x4e4841){var _0x13ec62={'raw':!![],'where':{}};var _0x408319={};var _0x1d2838={'count':0x0,'rows':[]};return db[_0x6f9a('0x48')][_0x6f9a('0x8d')]({'where':{'id':_0x49e19f[_0x6f9a('0x62')]['id']}})[_0x6f9a('0x22')](handleEntityNotFound(_0x1e02bd,null))[_0x6f9a('0x22')](function(_0x20675a){if(_0x20675a){_0x408319[_0x6f9a('0x4b')]=_[_0x6f9a('0x4d')](db[_0x6f9a('0xcb')][_0x6f9a('0xc1')]);_0x408319['query']=_[_0x6f9a('0x4d')](_0x49e19f[_0x6f9a('0x4e')]);_0x408319['filters']=_['intersection'](_0x408319[_0x6f9a('0x4b')],_0x408319[_0x6f9a('0x4e')]);_0x13ec62[_0x6f9a('0x51')]=_[_0x6f9a('0x50')](_0x408319['model'],qs[_0x6f9a('0x52')](_0x49e19f[_0x6f9a('0x4e')][_0x6f9a('0x52')]));_0x13ec62[_0x6f9a('0x51')]=_0x13ec62['attributes'][_0x6f9a('0x53')]?_0x13ec62[_0x6f9a('0x51')]:_0x408319['model'];if(!_0x49e19f[_0x6f9a('0x4e')][_0x6f9a('0x54')](_0x6f9a('0x55'))){_0x13ec62[_0x6f9a('0x30')]=qs[_0x6f9a('0x30')](_0x49e19f['query'][_0x6f9a('0x30')]);_0x13ec62[_0x6f9a('0x2f')]=qs[_0x6f9a('0x2f')](_0x49e19f['query'][_0x6f9a('0x2f')]);}_0x13ec62[_0x6f9a('0x56')]=qs[_0x6f9a('0x57')](_0x49e19f[_0x6f9a('0x4e')][_0x6f9a('0x57')]);_0x13ec62['where']=qs[_0x6f9a('0x4f')](_[_0x6f9a('0x59')](_0x49e19f[_0x6f9a('0x4e')],_0x408319['filters']));_0x13ec62[_0x6f9a('0x58')]['UserId']=_0x20675a['id'];if(_0x49e19f[_0x6f9a('0x4e')][_0x6f9a('0x3d')]){_0x13ec62[_0x6f9a('0x58')]=_['merge'](_0x13ec62[_0x6f9a('0x58')],{'$or':_['map'](_0x13ec62[_0x6f9a('0x51')],function(_0x3cf244){var _0x360c1f={};_0x360c1f[_0x3cf244]={'$like':'%'+_0x49e19f[_0x6f9a('0x4e')][_0x6f9a('0x3d')]+'%'};return _0x360c1f;})});}_0x13ec62=_[_0x6f9a('0x5a')]({},_0x13ec62,_0x49e19f[_0x6f9a('0x5f')]);return db[_0x6f9a('0xcb')]['count']({'where':_0x13ec62[_0x6f9a('0x58')]})[_0x6f9a('0x22')](function(_0x1ddc06){_0x1d2838[_0x6f9a('0x2e')]=_0x1ddc06;if(_0x49e19f['query'][_0x6f9a('0x60')]){_0x13ec62['include']=[{'all':!![]}];}return db[_0x6f9a('0xcb')][_0x6f9a('0xa6')](_0x13ec62);})[_0x6f9a('0x22')](function(_0x464d5b){_0x1d2838[_0x6f9a('0xc9')]=_0x464d5b;return _0x1d2838;});}})[_0x6f9a('0x22')](respondWithFilteredResult(_0x1e02bd,_0x13ec62))[_0x6f9a('0x61')](handleError(_0x1e02bd,null));};exports['getChatInteractions']=function(_0x2a71f8,_0x619116,_0x3eb8eb){var _0x1bc5ea={};var _0x55f99d={};var _0x176736;var _0x5141af;return db[_0x6f9a('0x48')]['findOne']({'where':{'id':_0x2a71f8[_0x6f9a('0x62')]['id']}})[_0x6f9a('0x22')](handleEntityNotFound(_0x619116,null))[_0x6f9a('0x22')](function(_0x30a087){if(_0x30a087){_0x176736=_0x30a087;_0x55f99d[_0x6f9a('0x4b')]=_[_0x6f9a('0x4d')](db[_0x6f9a('0xcc')][_0x6f9a('0xc1')]);_0x55f99d['query']=_['keys'](_0x2a71f8['query']);_0x55f99d['filters']=_[_0x6f9a('0x50')](_0x55f99d['model'],_0x55f99d['query']);_0x1bc5ea[_0x6f9a('0x51')]=_[_0x6f9a('0x50')](_0x55f99d['model'],qs[_0x6f9a('0x52')](_0x2a71f8[_0x6f9a('0x4e')][_0x6f9a('0x52')]));_0x1bc5ea[_0x6f9a('0x51')]=_0x1bc5ea[_0x6f9a('0x51')][_0x6f9a('0x53')]?_0x1bc5ea[_0x6f9a('0x51')]:_0x55f99d[_0x6f9a('0x4b')];_0x1bc5ea['order']=qs[_0x6f9a('0x57')](_0x2a71f8['query'][_0x6f9a('0x57')]);_0x1bc5ea[_0x6f9a('0x58')]=qs[_0x6f9a('0x4f')](_[_0x6f9a('0x59')](_0x2a71f8[_0x6f9a('0x4e')],_0x55f99d[_0x6f9a('0x4f')]));if(_0x2a71f8[_0x6f9a('0x4e')][_0x6f9a('0x3d')]){_0x1bc5ea[_0x6f9a('0x58')]=_[_0x6f9a('0x5a')](_0x1bc5ea[_0x6f9a('0x58')],{'$or':_[_0x6f9a('0x3f')](_0x1bc5ea[_0x6f9a('0x51')],function(_0x3caaf9){var _0x24045f={};_0x24045f[_0x3caaf9]={'$like':'%'+_0x2a71f8[_0x6f9a('0x4e')]['filter']+'%'};return _0x24045f;})});}_0x1bc5ea=_['merge']({},_0x1bc5ea,_0x2a71f8[_0x6f9a('0x5f')]);return _0x176736[_0x6f9a('0xcd')](_0x1bc5ea);}})[_0x6f9a('0x22')](function(_0x40775f){if(_0x40775f){_0x5141af=_0x40775f[_0x6f9a('0x53')];if(!_0x2a71f8[_0x6f9a('0x4e')][_0x6f9a('0x54')](_0x6f9a('0x55'))){_0x1bc5ea[_0x6f9a('0x30')]=qs[_0x6f9a('0x30')](_0x2a71f8[_0x6f9a('0x4e')][_0x6f9a('0x30')]);_0x1bc5ea[_0x6f9a('0x2f')]=qs[_0x6f9a('0x2f')](_0x2a71f8['query'][_0x6f9a('0x2f')]);}return _0x176736[_0x6f9a('0xcd')](_0x1bc5ea);}})[_0x6f9a('0x22')](function(_0x1cd16c){if(_0x1cd16c){return _0x1cd16c?{'count':_0x5141af,'rows':_0x1cd16c}:null;}})[_0x6f9a('0x22')](respondWithResult(_0x619116,null))[_0x6f9a('0x61')](handleError(_0x619116,null));};exports[_0x6f9a('0xce')]=function(_0x3733a7,_0x429dc,_0x254013){var _0x3e0fc6={};var _0x26dffd={};var _0x2f5c92;var _0xd9badb;return db[_0x6f9a('0x48')][_0x6f9a('0x8d')]({'where':{'id':_0x3733a7[_0x6f9a('0x62')]['id']}})[_0x6f9a('0x22')](handleEntityNotFound(_0x429dc,null))[_0x6f9a('0x22')](function(_0x2874df){if(_0x2874df){_0x2f5c92=_0x2874df;_0x26dffd[_0x6f9a('0x4b')]=_[_0x6f9a('0x4d')](db['OpenchannelInteraction'][_0x6f9a('0xc1')]);_0x26dffd[_0x6f9a('0x4e')]=_[_0x6f9a('0x4d')](_0x3733a7[_0x6f9a('0x4e')]);_0x26dffd[_0x6f9a('0x4f')]=_['intersection'](_0x26dffd[_0x6f9a('0x4b')],_0x26dffd[_0x6f9a('0x4e')]);_0x3e0fc6[_0x6f9a('0x51')]=_[_0x6f9a('0x50')](_0x26dffd[_0x6f9a('0x4b')],qs[_0x6f9a('0x52')](_0x3733a7['query'][_0x6f9a('0x52')]));_0x3e0fc6[_0x6f9a('0x51')]=_0x3e0fc6[_0x6f9a('0x51')][_0x6f9a('0x53')]?_0x3e0fc6[_0x6f9a('0x51')]:_0x26dffd[_0x6f9a('0x4b')];_0x3e0fc6['order']=qs[_0x6f9a('0x57')](_0x3733a7[_0x6f9a('0x4e')][_0x6f9a('0x57')]);_0x3e0fc6['where']=qs[_0x6f9a('0x4f')](_[_0x6f9a('0x59')](_0x3733a7[_0x6f9a('0x4e')],_0x26dffd[_0x6f9a('0x4f')]));if(_0x3733a7['query'][_0x6f9a('0x3d')]){_0x3e0fc6[_0x6f9a('0x58')]=_['merge'](_0x3e0fc6[_0x6f9a('0x58')],{'$or':_[_0x6f9a('0x3f')](_0x3e0fc6['attributes'],function(_0x24cfde){var _0x5f2128={};_0x5f2128[_0x24cfde]={'$like':'%'+_0x3733a7[_0x6f9a('0x4e')]['filter']+'%'};return _0x5f2128;})});}_0x3e0fc6=_[_0x6f9a('0x5a')]({},_0x3e0fc6,_0x3733a7[_0x6f9a('0x5f')]);return _0x2f5c92['getOpenchannelInteractions'](_0x3e0fc6);}})['then'](function(_0x3657ed){if(_0x3657ed){_0xd9badb=_0x3657ed[_0x6f9a('0x53')];if(!_0x3733a7[_0x6f9a('0x4e')][_0x6f9a('0x54')](_0x6f9a('0x55'))){_0x3e0fc6[_0x6f9a('0x30')]=qs[_0x6f9a('0x30')](_0x3733a7['query']['limit']);_0x3e0fc6[_0x6f9a('0x2f')]=qs['offset'](_0x3733a7[_0x6f9a('0x4e')][_0x6f9a('0x2f')]);}return _0x2f5c92[_0x6f9a('0xce')](_0x3e0fc6);}})[_0x6f9a('0x22')](function(_0x387f0e){if(_0x387f0e){return _0x387f0e?{'count':_0xd9badb,'rows':_0x387f0e}:null;}})[_0x6f9a('0x22')](respondWithResult(_0x429dc,null))['catch'](handleError(_0x429dc,null));};exports[_0x6f9a('0xcf')]=function(_0x3c275f,_0x4a0d62,_0x424ec8){var _0x307a37={'raw':!![],'where':{}};var _0x22df55={};var _0x32ce04={'count':0x0,'rows':[]};return db[_0x6f9a('0x48')][_0x6f9a('0x8d')]({'where':{'id':_0x3c275f[_0x6f9a('0x62')]['id']}})['then'](handleEntityNotFound(_0x4a0d62,null))[_0x6f9a('0x22')](function(_0x5a9afd){if(_0x5a9afd){_0x22df55[_0x6f9a('0x4b')]=_['keys'](db['MailInteraction'][_0x6f9a('0xc1')]);_0x22df55[_0x6f9a('0x4e')]=_[_0x6f9a('0x4d')](_0x3c275f[_0x6f9a('0x4e')]);_0x22df55[_0x6f9a('0x4f')]=_['intersection'](_0x22df55[_0x6f9a('0x4b')],_0x22df55[_0x6f9a('0x4e')]);_0x307a37['attributes']=_[_0x6f9a('0x50')](_0x22df55[_0x6f9a('0x4b')],qs[_0x6f9a('0x52')](_0x3c275f[_0x6f9a('0x4e')][_0x6f9a('0x52')]));_0x307a37[_0x6f9a('0x51')]=_0x307a37[_0x6f9a('0x51')][_0x6f9a('0x53')]?_0x307a37[_0x6f9a('0x51')]:_0x22df55[_0x6f9a('0x4b')];if(!_0x3c275f[_0x6f9a('0x4e')]['hasOwnProperty'](_0x6f9a('0x55'))){_0x307a37[_0x6f9a('0x30')]=qs['limit'](_0x3c275f['query']['limit']);_0x307a37['offset']=qs[_0x6f9a('0x2f')](_0x3c275f[_0x6f9a('0x4e')][_0x6f9a('0x2f')]);}_0x307a37[_0x6f9a('0x56')]=qs['sort'](_0x3c275f[_0x6f9a('0x4e')][_0x6f9a('0x57')]);_0x307a37['where']=qs[_0x6f9a('0x4f')](_['pick'](_0x3c275f[_0x6f9a('0x4e')],_0x22df55[_0x6f9a('0x4f')]));_0x307a37[_0x6f9a('0x58')][_0x6f9a('0xc8')]=_0x5a9afd['id'];if(_0x3c275f['query']['filter']){_0x307a37[_0x6f9a('0x58')]=_[_0x6f9a('0x5a')](_0x307a37[_0x6f9a('0x58')],{'$or':_['map'](_0x307a37[_0x6f9a('0x51')],function(_0x2963ca){var _0x4c285d={};_0x4c285d[_0x2963ca]={'$like':'%'+_0x3c275f[_0x6f9a('0x4e')][_0x6f9a('0x3d')]+'%'};return _0x4c285d;})});}_0x307a37=_[_0x6f9a('0x5a')]({},_0x307a37,_0x3c275f['options']);return db[_0x6f9a('0xd0')][_0x6f9a('0x2e')]({'where':_0x307a37['where']})[_0x6f9a('0x22')](function(_0x3dd0bb){_0x32ce04[_0x6f9a('0x2e')]=_0x3dd0bb;if(_0x3c275f['query'][_0x6f9a('0x60')]){_0x307a37[_0x6f9a('0xb9')]=[{'all':!![]}];}return db['MailInteraction']['findAll'](_0x307a37);})['then'](function(_0x946570){_0x32ce04[_0x6f9a('0xc9')]=_0x946570;return _0x32ce04;});}})['then'](respondWithFilteredResult(_0x4a0d62,_0x307a37))[_0x6f9a('0x61')](handleError(_0x4a0d62,null));};exports['getSmsInteractions']=function(_0x28f20f,_0x541eec,_0x4ec41e){var _0x57aa73={};var _0x398a17={};var _0x2b1f6e;var _0x434b69;return db[_0x6f9a('0x48')][_0x6f9a('0x8d')]({'where':{'id':_0x28f20f[_0x6f9a('0x62')]['id']}})[_0x6f9a('0x22')](handleEntityNotFound(_0x541eec,null))[_0x6f9a('0x22')](function(_0x2f380e){if(_0x2f380e){_0x2b1f6e=_0x2f380e;_0x398a17[_0x6f9a('0x4b')]=_[_0x6f9a('0x4d')](db[_0x6f9a('0xd1')]['rawAttributes']);_0x398a17[_0x6f9a('0x4e')]=_[_0x6f9a('0x4d')](_0x28f20f[_0x6f9a('0x4e')]);_0x398a17['filters']=_[_0x6f9a('0x50')](_0x398a17[_0x6f9a('0x4b')],_0x398a17[_0x6f9a('0x4e')]);_0x57aa73['attributes']=_[_0x6f9a('0x50')](_0x398a17[_0x6f9a('0x4b')],qs['fields'](_0x28f20f[_0x6f9a('0x4e')][_0x6f9a('0x52')]));_0x57aa73[_0x6f9a('0x51')]=_0x57aa73[_0x6f9a('0x51')][_0x6f9a('0x53')]?_0x57aa73[_0x6f9a('0x51')]:_0x398a17['model'];_0x57aa73[_0x6f9a('0x56')]=qs[_0x6f9a('0x57')](_0x28f20f[_0x6f9a('0x4e')][_0x6f9a('0x57')]);_0x57aa73[_0x6f9a('0x58')]=qs[_0x6f9a('0x4f')](_[_0x6f9a('0x59')](_0x28f20f['query'],_0x398a17[_0x6f9a('0x4f')]));if(_0x28f20f[_0x6f9a('0x4e')]['filter']){_0x57aa73[_0x6f9a('0x58')]=_[_0x6f9a('0x5a')](_0x57aa73[_0x6f9a('0x58')],{'$or':_['map'](_0x57aa73[_0x6f9a('0x51')],function(_0x4756e3){var _0x33159a={};_0x33159a[_0x4756e3]={'$like':'%'+_0x28f20f['query'][_0x6f9a('0x3d')]+'%'};return _0x33159a;})});}_0x57aa73=_['merge']({},_0x57aa73,_0x28f20f[_0x6f9a('0x5f')]);return _0x2b1f6e[_0x6f9a('0xd2')](_0x57aa73);}})[_0x6f9a('0x22')](function(_0x571847){if(_0x571847){_0x434b69=_0x571847[_0x6f9a('0x53')];if(!_0x28f20f['query'][_0x6f9a('0x54')](_0x6f9a('0x55'))){_0x57aa73[_0x6f9a('0x30')]=qs[_0x6f9a('0x30')](_0x28f20f['query'][_0x6f9a('0x30')]);_0x57aa73['offset']=qs[_0x6f9a('0x2f')](_0x28f20f[_0x6f9a('0x4e')][_0x6f9a('0x2f')]);}return _0x2b1f6e[_0x6f9a('0xd2')](_0x57aa73);}})[_0x6f9a('0x22')](function(_0x30dc99){if(_0x30dc99){return _0x30dc99?{'count':_0x434b69,'rows':_0x30dc99}:null;}})[_0x6f9a('0x22')](respondWithResult(_0x541eec,null))[_0x6f9a('0x61')](handleError(_0x541eec,null));};exports[_0x6f9a('0xd3')]=function(_0x20143d,_0x20f134,_0x26f126){var _0x84ef79={};var _0x113af9={};var _0x1a6df2;var _0x7eac31;return db[_0x6f9a('0x48')]['findOne']({'where':{'id':_0x20143d[_0x6f9a('0x62')]['id']}})['then'](handleEntityNotFound(_0x20f134,null))[_0x6f9a('0x22')](function(_0x17d0a9){if(_0x17d0a9){_0x1a6df2=_0x17d0a9;_0x113af9['model']=_['keys'](db['FaxInteraction'][_0x6f9a('0xc1')]);_0x113af9['query']=_['keys'](_0x20143d[_0x6f9a('0x4e')]);_0x113af9[_0x6f9a('0x4f')]=_[_0x6f9a('0x50')](_0x113af9['model'],_0x113af9[_0x6f9a('0x4e')]);_0x84ef79[_0x6f9a('0x51')]=_[_0x6f9a('0x50')](_0x113af9[_0x6f9a('0x4b')],qs['fields'](_0x20143d['query']['fields']));_0x84ef79[_0x6f9a('0x51')]=_0x84ef79[_0x6f9a('0x51')][_0x6f9a('0x53')]?_0x84ef79[_0x6f9a('0x51')]:_0x113af9[_0x6f9a('0x4b')];_0x84ef79[_0x6f9a('0x56')]=qs[_0x6f9a('0x57')](_0x20143d[_0x6f9a('0x4e')][_0x6f9a('0x57')]);_0x84ef79['where']=qs[_0x6f9a('0x4f')](_[_0x6f9a('0x59')](_0x20143d[_0x6f9a('0x4e')],_0x113af9['filters']));if(_0x20143d[_0x6f9a('0x4e')][_0x6f9a('0x3d')]){_0x84ef79['where']=_['merge'](_0x84ef79[_0x6f9a('0x58')],{'$or':_['map'](_0x84ef79['attributes'],function(_0x3d1cb3){var _0x529a7f={};_0x529a7f[_0x3d1cb3]={'$like':'%'+_0x20143d['query']['filter']+'%'};return _0x529a7f;})});}_0x84ef79=_[_0x6f9a('0x5a')]({},_0x84ef79,_0x20143d['options']);return _0x1a6df2[_0x6f9a('0xd3')](_0x84ef79);}})[_0x6f9a('0x22')](function(_0x3a4012){if(_0x3a4012){_0x7eac31=_0x3a4012['length'];if(!_0x20143d[_0x6f9a('0x4e')][_0x6f9a('0x54')](_0x6f9a('0x55'))){_0x84ef79[_0x6f9a('0x30')]=qs['limit'](_0x20143d['query'][_0x6f9a('0x30')]);_0x84ef79['offset']=qs[_0x6f9a('0x2f')](_0x20143d[_0x6f9a('0x4e')][_0x6f9a('0x2f')]);}return _0x1a6df2[_0x6f9a('0xd3')](_0x84ef79);}})['then'](function(_0xc5810f){if(_0xc5810f){return _0xc5810f?{'count':_0x7eac31,'rows':_0xc5810f}:null;}})[_0x6f9a('0x22')](respondWithResult(_0x20f134,null))['catch'](handleError(_0x20f134,null));};exports[_0x6f9a('0xd4')]=function(_0x48be42,_0x48731c,_0x40c9f4){var _0x2ef81f={};var _0x2761e1={};var _0x5397f9;var _0x2b7ee6;return db[_0x6f9a('0x48')][_0x6f9a('0x8d')]({'where':{'id':_0x48be42['params']['id']}})[_0x6f9a('0x22')](handleEntityNotFound(_0x48731c,null))[_0x6f9a('0x22')](function(_0x165e90){if(_0x165e90){_0x5397f9=_0x165e90;_0x2761e1[_0x6f9a('0x4b')]=_['keys'](db[_0x6f9a('0xd5')][_0x6f9a('0xc1')]);_0x2761e1[_0x6f9a('0x4e')]=_[_0x6f9a('0x4d')](_0x48be42[_0x6f9a('0x4e')]);_0x2761e1[_0x6f9a('0x4f')]=_['intersection'](_0x2761e1[_0x6f9a('0x4b')],_0x2761e1[_0x6f9a('0x4e')]);_0x2ef81f['attributes']=_['intersection'](_0x2761e1[_0x6f9a('0x4b')],qs['fields'](_0x48be42[_0x6f9a('0x4e')][_0x6f9a('0x52')]));_0x2ef81f[_0x6f9a('0x51')]=_0x2ef81f[_0x6f9a('0x51')][_0x6f9a('0x53')]?_0x2ef81f[_0x6f9a('0x51')]:_0x2761e1['model'];_0x2ef81f[_0x6f9a('0x56')]=qs[_0x6f9a('0x57')](_0x48be42[_0x6f9a('0x4e')][_0x6f9a('0x57')]);_0x2ef81f[_0x6f9a('0x58')]=qs[_0x6f9a('0x4f')](_[_0x6f9a('0x59')](_0x48be42['query'],_0x2761e1['filters']));if(_0x48be42[_0x6f9a('0x4e')]['filter']){_0x2ef81f[_0x6f9a('0x58')]=_['merge'](_0x2ef81f[_0x6f9a('0x58')],{'$or':_[_0x6f9a('0x3f')](_0x2ef81f['attributes'],function(_0x2e7d3d){var _0x427943={};_0x427943[_0x2e7d3d]={'$like':'%'+_0x48be42[_0x6f9a('0x4e')]['filter']+'%'};return _0x427943;})});}_0x2ef81f=_[_0x6f9a('0x5a')]({},_0x2ef81f,_0x48be42[_0x6f9a('0x5f')]);return _0x5397f9[_0x6f9a('0xd4')](_0x2ef81f);}})[_0x6f9a('0x22')](function(_0x16b518){if(_0x16b518){_0x2b7ee6=_0x16b518[_0x6f9a('0x53')];if(!_0x48be42[_0x6f9a('0x4e')][_0x6f9a('0x54')]('nolimit')){_0x2ef81f[_0x6f9a('0x30')]=qs[_0x6f9a('0x30')](_0x48be42[_0x6f9a('0x4e')][_0x6f9a('0x30')]);_0x2ef81f['offset']=qs[_0x6f9a('0x2f')](_0x48be42[_0x6f9a('0x4e')][_0x6f9a('0x2f')]);}return _0x5397f9[_0x6f9a('0xd4')](_0x2ef81f);}})[_0x6f9a('0x22')](function(_0x48f393){if(_0x48f393){return _0x48f393?{'count':_0x2b7ee6,'rows':_0x48f393}:null;}})[_0x6f9a('0x22')](respondWithResult(_0x48731c,null))[_0x6f9a('0x61')](handleError(_0x48731c,null));};exports['login']=function(_0x3e7e26,_0x25bb82,_0xd49f5c){var _0x4b4e20;var _0x4bf58d;var _0x3585a3;var _0x1a906c=!_[_0x6f9a('0x71')](_0x3e7e26['params']['id'])?_0x3e7e26[_0x6f9a('0x62')]['id']:!_[_0x6f9a('0x71')](_0x3e7e26['user']['id'])?_0x3e7e26['user']['id']:null;return db[_0x6f9a('0x48')][_0x6f9a('0x65')]({'where':{'id':_0x1a906c,'role':{'$or':['admin',_0x6f9a('0x39'),_0x6f9a('0x3b')]}},'attributes':['id',_0x6f9a('0x43'),_0x6f9a('0xd6'),'mobile',_0x6f9a('0x42'),_0x6f9a('0x72'),_0x6f9a('0x98')]})[_0x6f9a('0x22')](function(_0x3378be){if(_0x3378be){if(_0x3378be[_0x6f9a('0x42')]===_0x6f9a('0x3b')){_0x4b4e20=_0x3378be;if(_0x3e7e26[_0x6f9a('0x67')]['interface']){_0x3585a3=util['format'](_0x6f9a('0xd7'),_0x4b4e20[_0x3e7e26[_0x6f9a('0x67')][_0x6f9a('0x9a')]]);}else if(_0x3e7e26[_0x6f9a('0x67')]['intrf']){_0x3585a3=util[_0x6f9a('0xa8')](_0x6f9a('0xd8'),_0x3e7e26[_0x6f9a('0x67')][_0x6f9a('0xd9')]);}else{_0x3585a3=util[_0x6f9a('0xa8')]('SIP/%s',_0x4b4e20[_0x6f9a('0x43')]);}socket['to'](util[_0x6f9a('0xa8')](_0x6f9a('0xda'),_0x4b4e20[_0x6f9a('0x43')]))['emit']('user:forcelogout',{'ip':_0x3e7e26[_0x6f9a('0xdb')][_0x6f9a('0xdc')]||_0x3e7e26[_0x6f9a('0xdd')][_0x6f9a('0xde')]||_0x3e7e26[_0x6f9a('0xdf')][_0x6f9a('0xde')]||_0x3e7e26[_0x6f9a('0xdd')][_0x6f9a('0xdf')][_0x6f9a('0xde')]});return db[_0x6f9a('0xaf')]['destroy']({'where':{'membername':_0x4b4e20[_0x6f9a('0x43')]},'individualHooks':!![]});}}else{throw new db['Sequelize'][(_0x6f9a('0x90'))](_0x6f9a('0xe0'));}})['then'](function(){if(_0x4b4e20){return _0x4b4e20[_0x6f9a('0xe1')]({'raw':!![]});}})[_0x6f9a('0x22')](function(_0x47dc9b){if(_0x4b4e20){var _0x556807=[];if(_0x47dc9b){_0x4bf58d=_0x47dc9b;if(_0x4bf58d[_0x6f9a('0x53')]){for(var _0x4d5e88=0x0;_0x4d5e88<_0x4bf58d['length'];_0x4d5e88++){_0x556807[_0x6f9a('0xa7')]({'membername':_0x4b4e20[_0x6f9a('0x43')],'UserId':_0x4b4e20['id'],'queue_name':_0x4bf58d[_0x4d5e88][_0x6f9a('0x43')],'VoiceQueueId':_0x4bf58d[_0x4d5e88]['id'],'interface':_0x3585a3,'paused':_0x4b4e20[_0x6f9a('0x98')]||![],'penalty':_0x4bf58d[_0x4d5e88][_0x6f9a('0xe2')]||0x0});}return BPromise[_0x6f9a('0xa9')](_0x556807,function(_0x4a13c0){return db['UserVoiceQueueRt']['upsert'](_0x4a13c0);});}}}})['then'](function(){if(_0x4b4e20){return db[_0x6f9a('0xe3')][_0x6f9a('0xa6')]({'where':{'membername':_0x4b4e20[_0x6f9a('0x43')],'exitAt':null}});}})[_0x6f9a('0x22')](function(_0x1047e3){if(_0x4b4e20){var _0x2e2b2c=[];_0x1047e3['forEach'](function(_0x464221){_0x2e2b2c[_0x6f9a('0xa7')](_0x464221[_0x6f9a('0x35')]({'exitAt':moment()[_0x6f9a('0xa8')](_0x6f9a('0xe4'))}));});return BPromise[_0x6f9a('0xe5')](_0x2e2b2c);}})[_0x6f9a('0x22')](function(){if(_0x4b4e20){var _0x350a85=[];var _0x4c3ab1=[];var _0x3e5b49=utils['getChannels']();var _0x282d2={'membername':_0x4b4e20[_0x6f9a('0x43')],'interface':_0x3585a3,'enterAt':moment()[_0x6f9a('0xa8')](_0x6f9a('0xe4')),'role':_0x4b4e20[_0x6f9a('0x42')],'internal':_0x4b4e20[_0x6f9a('0x72')]};_0x3e5b49[_0x6f9a('0xe6')](function(_0xcf1572){_0x350a85[_0x6f9a('0xa7')](_['merge']({'channel':_0xcf1572,'type':'LOGIN','data1':_0x3e7e26[_0x6f9a('0x67')][_0x6f9a('0xe7')],'data2':_0x3585a3},_0x282d2));if(_0x4b4e20[_0x6f9a('0x98')]){_0x4c3ab1[_0x6f9a('0xa7')](_[_0x6f9a('0x5a')]({'channel':_0xcf1572,'type':_0x6f9a('0xe8'),'data1':_0x6f9a('0xe9')},_0x282d2));}});return db['MemberReport'][_0x6f9a('0x66')](_0x350a85['concat'](_0x4c3ab1),{'individualHooks':!![]});}})[_0x6f9a('0x22')](function(){if(_0x4b4e20){return _0x4b4e20[_0x6f9a('0x35')]({'online':!![],'lastLoginAt':moment()[_0x6f9a('0xa8')]('YYYY-MM-DD\x20HH:mm:ss'),'voicePause':_0x4b4e20['loginInPause']||![],'mailPause':_0x4b4e20['loginInPause']||![],'chatPause':_0x4b4e20[_0x6f9a('0x98')]||![],'faxPause':_0x4b4e20[_0x6f9a('0x98')]||![],'smsPause':_0x4b4e20[_0x6f9a('0x98')]||![],'openchannelPause':_0x4b4e20[_0x6f9a('0x98')]||![],'whatsappPause':_0x4b4e20[_0x6f9a('0x98')]||![],'pauseType':_0x4b4e20[_0x6f9a('0x98')]?_0x6f9a('0xe9'):null,'interface':_0x3585a3,'lastPauseAt':moment()['format'](_0x6f9a('0xe4'))});}})[_0x6f9a('0x22')](function(_0x30070e){if(_0x3e7e26[_0x6f9a('0xea')]){return _0xd49f5c();}else{return BPromise[_0x6f9a('0xeb')](_0x30070e)[_0x6f9a('0x22')](respondWithResult(_0x25bb82,null));}})[_0x6f9a('0x61')](handleError(_0x25bb82,null));};exports[_0x6f9a('0xec')]=function(_0x6be316,_0x2ef04d,_0x5046eb){var _0x533299;return db['User'][_0x6f9a('0x65')]({'where':{'id':_0x6be316[_0x6f9a('0x62')]['id'],'role':_0x6f9a('0x3b')},'attributes':['id',_0x6f9a('0x43'),'role']})[_0x6f9a('0x22')](handleEntityNotFound(_0x2ef04d,null))[_0x6f9a('0x22')](function(_0x2723cb){if(_0x2723cb){_0x533299=_0x2723cb;return db[_0x6f9a('0xaf')][_0x6f9a('0x36')]({'where':{'membername':_0x533299[_0x6f9a('0x43')]},'individualHooks':!![]});}})[_0x6f9a('0x22')](function(){return db[_0x6f9a('0xe3')][_0x6f9a('0xa6')]({'where':{'membername':_0x533299[_0x6f9a('0x43')],'exitAt':null}});})['then'](function(_0xaf4c1f){var _0x4ac1fb=[];_0xaf4c1f[_0x6f9a('0xe6')](function(_0x67b044){_0x4ac1fb[_0x6f9a('0xa7')](_0x67b044[_0x6f9a('0x35')]({'exitAt':moment()[_0x6f9a('0xa8')](_0x6f9a('0xe4'))}));});return BPromise[_0x6f9a('0xe5')](_0x4ac1fb);})[_0x6f9a('0x22')](function(){return _0x533299[_0x6f9a('0x35')]({'online':![],'lastLoginAt':null,'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![],'interface':null});})[_0x6f9a('0x22')](respondWithResult(_0x2ef04d,null))['catch'](handleError(_0x2ef04d,null));};exports['pause']=function(_0x39ec7c,_0x22d5f6,_0xc2b18c){var _0x2d8a9e;return db['UserVoiceQueueRt']['update']({'paused':0x1},{'where':{'UserId':_0x39ec7c[_0x6f9a('0x62')]['id']},'individualHooks':!![]})['then'](function(){return db['User'][_0x6f9a('0x65')]({'where':{'id':_0x39ec7c[_0x6f9a('0x62')]['id'],'role':_0x6f9a('0x3b')},'attributes':['id',_0x6f9a('0x43'),_0x6f9a('0x42'),_0x6f9a('0x72'),_0x6f9a('0x9a')]});})[_0x6f9a('0x22')](handleEntityNotFound(_0x22d5f6,null))[_0x6f9a('0x22')](function(_0x25c1ef){if(_0x25c1ef){_0x2d8a9e=_0x25c1ef;return respondWithRpcPromise('QueuePause','pause',{'id':_0x2d8a9e['id'],'name':_0x2d8a9e[_0x6f9a('0x43')],'pause':!![]});}})[_0x6f9a('0x22')](function(){if(_0x2d8a9e){return db[_0x6f9a('0xe3')][_0x6f9a('0xa6')]({'where':{'membername':_0x2d8a9e[_0x6f9a('0x43')],'type':_0x6f9a('0xe8'),'exitAt':null}});}})[_0x6f9a('0x22')](function(_0x5e0ad1){if(_0x5e0ad1[_0x6f9a('0x53')]){var _0x17d138=moment()[_0x6f9a('0xa8')](_0x6f9a('0xe4'));for(var _0x549feb=0x0,_0xba8cf3=_0x5e0ad1[_0x6f9a('0x53')];_0x549feb<_0xba8cf3;_0x549feb++){_0x5e0ad1[_0x549feb][_0x6f9a('0xed')]({'exitAt':_0x17d138});}}})[_0x6f9a('0x22')](function(){var _0x37e257=[];var _0x316b09=utils['getChannels']();_0x316b09[_0x6f9a('0xe6')](function(_0x1196c1){_0x37e257[_0x6f9a('0xa7')]({'channel':_0x1196c1,'membername':_0x2d8a9e[_0x6f9a('0x43')],'interface':_[_0x6f9a('0x71')](_0x2d8a9e['interface'])?util[_0x6f9a('0xa8')](_0x6f9a('0xd8'),_0x2d8a9e[_0x6f9a('0x43')]):_0x2d8a9e['interface'],'type':'PAUSE','enterAt':moment()['format'](_0x6f9a('0xe4')),'data1':_0x39ec7c['body'][_0x6f9a('0x4a')]||_0x6f9a('0xee'),'role':_0x2d8a9e['role'],'internal':_0x2d8a9e['internal']});});return db['MemberReport'][_0x6f9a('0x66')](_0x37e257,{'individualHooks':!![]});})['then'](function(){return _0x2d8a9e['update']({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'whatsappPause':!![],'openchannelPause':!![],'pauseType':_0x39ec7c[_0x6f9a('0x67')]['type']||_0x6f9a('0xee'),'lastPauseAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')});})['then'](respondWithResult(_0x22d5f6,null))[_0x6f9a('0x61')](handleError(_0x22d5f6,null));};exports['unpause']=function(_0x11588f,_0x41eb71,_0x2e8a47){var _0x5cc26c;return db[_0x6f9a('0x48')]['find']({'where':{'id':_0x11588f['params']['id']},'attributes':['id','name',_0x6f9a('0x42'),_0x6f9a('0x99'),_0x6f9a('0xef'),'chatPause','faxPause',_0x6f9a('0xf0'),_0x6f9a('0xf1'),_0x6f9a('0xf2'),_0x6f9a('0xf3'),'lastPauseAt']})[_0x6f9a('0x22')](handleEntityNotFound(_0x41eb71,null))[_0x6f9a('0x22')](function(_0x232e4b){if(_0x232e4b){_0x5cc26c=_0x232e4b;if(_0x11588f[_0x6f9a('0x67')]['channel']&&!utils['isValidChannel'](_0x11588f[_0x6f9a('0x67')][_0x6f9a('0xac')])){throw new db[(_0x6f9a('0x20'))][(_0x6f9a('0x90'))](_0x6f9a('0x9c'));}switch(_0x11588f[_0x6f9a('0x67')][_0x6f9a('0xac')]){case _0x6f9a('0xa4'):return respondWithRpcPromise(_0x6f9a('0xf4'),_0x6f9a('0xf5'),{'id':_0x5cc26c['id'],'name':_0x5cc26c[_0x6f9a('0x43')],'pause':![]})[_0x6f9a('0x22')](function(){return db[_0x6f9a('0xaf')][_0x6f9a('0x35')]({'paused':0x0},{'where':{'UserId':_0x5cc26c['id']},'individualHooks':!![]});})[_0x6f9a('0x22')](function(){return db['MemberReport']['find']({'where':{'channel':_0x11588f['body']['channel'],'membername':_0x5cc26c[_0x6f9a('0x43')],'type':_0x6f9a('0xe8'),'exitAt':null}});})['then'](function(_0x4a04cd){if(_0x4a04cd){return _0x4a04cd[_0x6f9a('0x35')]({'exitAt':moment()['format'](_0x6f9a('0xe4')),'data2':_0x6f9a('0xf6')},{'individualHooks':!![]});}return null;})['then'](function(){return _0x5cc26c['update']({'voicePause':![]});});case _0x6f9a('0xf7'):case _0x6f9a('0xf8'):case _0x6f9a('0xf9'):case _0x6f9a('0xfa'):case _0x6f9a('0xfb'):case'openchannel':return db[_0x6f9a('0xe3')]['find']({'where':{'channel':_0x11588f[_0x6f9a('0x67')][_0x6f9a('0xac')],'membername':_0x5cc26c['name'],'type':'PAUSE','exitAt':null}})[_0x6f9a('0x22')](function(_0x73d7cd){if(_0x73d7cd){return _0x73d7cd[_0x6f9a('0x35')]({'exitAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'data2':_0x6f9a('0xf6')},{'individualHooks':!![]});}return null;})[_0x6f9a('0x22')](function(){var _0x37b11e={};_['set'](_0x37b11e,util[_0x6f9a('0xa8')](_0x6f9a('0xfc'),_0x11588f[_0x6f9a('0x67')]['channel'],_0x6f9a('0xfd')),![]);return _0x5cc26c[_0x6f9a('0x35')](_0x37b11e);});default:return respondWithRpcPromise(_0x6f9a('0xf4'),_0x6f9a('0xf5'),{'id':_0x5cc26c['id'],'name':_0x5cc26c['name'],'pause':![]})[_0x6f9a('0x22')](function(){return db['UserVoiceQueueRt'][_0x6f9a('0x35')]({'paused':0x0},{'where':{'UserId':_0x5cc26c['id']}});})[_0x6f9a('0x22')](function(){return db[_0x6f9a('0xe3')][_0x6f9a('0xa6')]({'where':{'membername':_0x5cc26c[_0x6f9a('0x43')],'type':'PAUSE','exitAt':null}});})['then'](function(_0x28ac07){var _0x1765a2=[];_0x28ac07[_0x6f9a('0xe6')](function(_0x5b7b00){_0x1765a2[_0x6f9a('0xa7')](_0x5b7b00[_0x6f9a('0x35')]({'exitAt':moment()['format'](_0x6f9a('0xe4')),'data2':_0x6f9a('0xf6')}));});return BPromise['all'](_0x1765a2);})[_0x6f9a('0x22')](function(){return _0x5cc26c[_0x6f9a('0x35')]({'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'whatsappPause':![],'openchannelPause':![]});});}}})[_0x6f9a('0x22')](respondWithResult(_0x41eb71,null))[_0x6f9a('0x61')](handleError(_0x41eb71,null));};exports[_0x6f9a('0xfe')]=function(_0x22c5c8,_0x335f9c,_0x42a394){var _0x3d4f04={};var _0x125f61={};var _0x277599;var _0x4690bd;return db[_0x6f9a('0x48')]['findOne']({'where':{'id':_0x22c5c8[_0x6f9a('0x62')]['id']}})[_0x6f9a('0x22')](handleEntityNotFound(_0x335f9c,null))[_0x6f9a('0x22')](function(_0x33b6e1){if(_0x33b6e1){_0x277599=_0x33b6e1;_0x125f61[_0x6f9a('0x4b')]=_[_0x6f9a('0x4d')](db[_0x6f9a('0xff')]['rawAttributes']);_0x125f61[_0x6f9a('0x4e')]=_['keys'](_0x22c5c8[_0x6f9a('0x4e')]);_0x125f61[_0x6f9a('0x4f')]=_[_0x6f9a('0x50')](_0x125f61[_0x6f9a('0x4b')],_0x125f61[_0x6f9a('0x4e')]);_0x3d4f04[_0x6f9a('0x51')]=_[_0x6f9a('0x50')](_0x125f61['model'],qs['fields'](_0x22c5c8[_0x6f9a('0x4e')][_0x6f9a('0x52')]));_0x3d4f04[_0x6f9a('0x51')]=_0x3d4f04[_0x6f9a('0x51')][_0x6f9a('0x53')]?_0x3d4f04[_0x6f9a('0x51')]:_0x125f61[_0x6f9a('0x4b')];_0x3d4f04[_0x6f9a('0x56')]=qs['sort'](_0x22c5c8['query'][_0x6f9a('0x57')]);_0x3d4f04[_0x6f9a('0x58')]=qs[_0x6f9a('0x4f')](_[_0x6f9a('0x59')](_0x22c5c8['query'],_0x125f61[_0x6f9a('0x4f')]));if(_0x22c5c8[_0x6f9a('0x4e')][_0x6f9a('0x3d')]){_0x3d4f04[_0x6f9a('0x58')]=_['merge'](_0x3d4f04['where'],{'$or':_[_0x6f9a('0x3f')](_0x3d4f04[_0x6f9a('0x51')],function(_0x20aa12){var _0x15048c={};_0x15048c[_0x20aa12]={'$like':'%'+_0x22c5c8['query'][_0x6f9a('0x3d')]+'%'};return _0x15048c;})});}_0x3d4f04=_[_0x6f9a('0x5a')]({},_0x3d4f04,_0x22c5c8[_0x6f9a('0x5f')]);return _0x277599[_0x6f9a('0xfe')](_0x3d4f04);}})[_0x6f9a('0x22')](function(_0x385585){if(_0x385585){_0x4690bd=_0x385585[_0x6f9a('0x53')];if(!_0x22c5c8[_0x6f9a('0x4e')][_0x6f9a('0x54')]('nolimit')){_0x3d4f04[_0x6f9a('0x30')]=qs[_0x6f9a('0x30')](_0x22c5c8[_0x6f9a('0x4e')]['limit']);_0x3d4f04[_0x6f9a('0x2f')]=qs[_0x6f9a('0x2f')](_0x22c5c8[_0x6f9a('0x4e')][_0x6f9a('0x2f')]);}return _0x277599['getTeams'](_0x3d4f04);}})[_0x6f9a('0x22')](function(_0x1948fc){if(_0x1948fc){return _0x1948fc?{'count':_0x4690bd,'rows':_0x1948fc}:null;}})[_0x6f9a('0x22')](respondWithResult(_0x335f9c,null))['catch'](handleError(_0x335f9c,null));};exports[_0x6f9a('0x100')]=function(_0x1359aa,_0x575f6a){return db[_0x6f9a('0x48')][_0x6f9a('0x65')]({'where':{'id':_0x1359aa['params']['id']}})[_0x6f9a('0x22')](handleEntityNotFound(_0x575f6a,null))['then'](function(_0x1f730d){if(_0x1f730d){var _0x5c9bc3=_0x1f730d['get']({'plain':!![]});return _0x1f730d[_0x6f9a('0x100')](_0x1359aa[_0x6f9a('0x67')][_0x6f9a('0x6a')],_['omit'](_0x1359aa[_0x6f9a('0x67')],[_0x6f9a('0x6a'),'id'])||{})[_0x6f9a('0x22')](function(){for(var _0xf1a994=0x0;_0xf1a994<_0x1359aa['body'][_0x6f9a('0x6a')][_0x6f9a('0x53')];_0xf1a994++){var _0xe004e1=[];db[_0x6f9a('0xff')]['findOne']({'where':{'id':_0x1359aa[_0x6f9a('0x67')]['ids'][_0xf1a994]}})[_0x6f9a('0x22')](function(_0xd06e7){_0xe004e1[_0x6f9a('0xa7')](_0xd06e7[_0x6f9a('0xe1')]()[_0x6f9a('0x22')](function(_0x5839f0){for(var _0x55f2ce=0x0;_0x55f2ce<_0x5839f0['length'];_0x55f2ce++){_0x5839f0[_0x55f2ce][_0x6f9a('0x101')](_0x6f9a('0xac'),_0x6f9a('0x102'));}return _0x5839f0;}));_0xe004e1[_0x6f9a('0xa7')](_0xd06e7[_0x6f9a('0x103')]()['then'](function(_0x442ff8){for(var _0x3f1a4f=0x0;_0x3f1a4f<_0x442ff8[_0x6f9a('0x53')];_0x3f1a4f++){_0x442ff8[_0x3f1a4f][_0x6f9a('0x101')](_0x6f9a('0xac'),_0x6f9a('0x104'));}return _0x442ff8;}));_0xe004e1[_0x6f9a('0xa7')](_0xd06e7['getMailQueues']()[_0x6f9a('0x22')](function(_0x1cbec6){for(var _0x43af41=0x0;_0x43af41<_0x1cbec6[_0x6f9a('0x53')];_0x43af41++){_0x1cbec6[_0x43af41][_0x6f9a('0x101')](_0x6f9a('0xac'),_0x6f9a('0x105'));}return _0x1cbec6;}));_0xe004e1[_0x6f9a('0xa7')](_0xd06e7[_0x6f9a('0x106')]()['then'](function(_0x571f2a){for(var _0x4ce0b9=0x0;_0x4ce0b9<_0x571f2a[_0x6f9a('0x53')];_0x4ce0b9++){_0x571f2a[_0x4ce0b9][_0x6f9a('0x101')](_0x6f9a('0xac'),_0x6f9a('0x107'));}return _0x571f2a;}));_0xe004e1[_0x6f9a('0xa7')](_0xd06e7[_0x6f9a('0x108')]()['then'](function(_0xe98e0b){for(var _0x1973be=0x0;_0x1973be<_0xe98e0b[_0x6f9a('0x53')];_0x1973be++){_0xe98e0b[_0x1973be][_0x6f9a('0x101')](_0x6f9a('0xac'),_0x6f9a('0x109'));}return _0xe98e0b;}));_0xe004e1[_0x6f9a('0xa7')](_0xd06e7['getFaxQueues']()[_0x6f9a('0x22')](function(_0x4bc200){for(var _0x30981f=0x0;_0x30981f<_0x4bc200[_0x6f9a('0x53')];_0x30981f++){_0x4bc200[_0x30981f]['setDataValue'](_0x6f9a('0xac'),'Fax');}return _0x4bc200;}));_0xe004e1['push'](_0xd06e7[_0x6f9a('0x10a')]()[_0x6f9a('0x22')](function(_0x1441ad){for(var _0x205793=0x0;_0x205793<_0x1441ad[_0x6f9a('0x53')];_0x205793++){_0x1441ad[_0x205793]['setDataValue'](_0x6f9a('0xac'),'Openchannel');}return _0x1441ad;}));return BPromise[_0x6f9a('0xe5')](_0xe004e1);})[_0x6f9a('0x22')](function(_0x5c10bf){var _0xb36eb7=_[_0x6f9a('0x10b')](_0x5c10bf);_0xe004e1=[];return db[_0x6f9a('0x5c')][_0x6f9a('0x10c')](function(_0x1a8f1a){for(var _0x3edf62=0x0;_0x3edf62<_0xb36eb7['length'];_0x3edf62++){_0xe004e1['push'](_0xb36eb7[_0x3edf62][_0x6f9a('0x10d')](_0x5c9bc3['id']),{'transaction':_0x1a8f1a});}return BPromise[_0x6f9a('0xe5')](_0xe004e1)[_0x6f9a('0x22')](function(){if(_0x5c9bc3['online']){return BPromise['each'](_[_0x6f9a('0x3d')](_0xb36eb7,function(_0x5c739f){return _0x5c739f[_0x6f9a('0x10e')](_0x6f9a('0xac'))==='Voice';}),function(_0x4c8ae9){return db[_0x6f9a('0xaf')][_0x6f9a('0xaa')]({'membername':_0x5c9bc3[_0x6f9a('0x43')],'UserId':_0x5c9bc3['id'],'queue_name':_0x4c8ae9[_0x6f9a('0x43')],'VoiceQueueId':_0x4c8ae9['id'],'interface':_[_0x6f9a('0x71')](_0x5c9bc3[_0x6f9a('0x9a')])?util['format']('SIP/%s',_0x5c9bc3[_0x6f9a('0x43')]):_0x5c9bc3['interface'],'paused':_0x5c9bc3['voicePause']||![],'penalty':_0x5c9bc3['penalty']},{'transaction':_0x1a8f1a});});}else{return;}})[_0x6f9a('0x22')](function(){for(var _0x3e2159=0x0;_0x3e2159<_0xb36eb7[_0x6f9a('0x53')];_0x3e2159++){var _0x22c605=_0xb36eb7[_0x3e2159][_0x6f9a('0x10e')](_0x6f9a('0xac'));var _0x444d4d=_0x22c605+_0x6f9a('0xa2');socket['emit'](_0x6f9a('0x39')+_0x22c605+_0x6f9a('0x10f'),{'UserId':_0x5c9bc3['id'],['queueField']:_0xb36eb7[_0x3e2159]['id']});}});});});}});}})[_0x6f9a('0x22')](respondWithStatusCode(_0x575f6a,null))[_0x6f9a('0x61')](handleError(_0x575f6a,null));};exports['removeTeams']=function(_0x4b28d3,_0x4863c6){return db[_0x6f9a('0x48')][_0x6f9a('0x8d')]({'where':{'id':_0x4b28d3[_0x6f9a('0x62')]['id']}})[_0x6f9a('0x22')](handleEntityNotFound(_0x4863c6,null))['then'](function(_0x3e1dba){if(_0x3e1dba){var _0x123040=_0x3e1dba[_0x6f9a('0x37')]({'plain':!![]});var _0x3d8f50=_0x4b28d3[_0x6f9a('0x4e')][_0x6f9a('0x6a')];return _0x3e1dba[_0x6f9a('0x110')](_0x3d8f50)[_0x6f9a('0x22')](function(){for(var _0x176620=0x0;_0x176620<_0x3d8f50['length'];_0x176620++){var _0x5d0915=[];db[_0x6f9a('0xff')][_0x6f9a('0x8d')]({'where':{'id':_0x3d8f50[_0x176620]}})[_0x6f9a('0x22')](function(_0x3433df){_0x5d0915[_0x6f9a('0xa7')](_0x3433df['getVoiceQueues']()['then'](function(_0x54baf2){for(var _0x55f998=0x0;_0x55f998<_0x54baf2[_0x6f9a('0x53')];_0x55f998++){_0x54baf2[_0x55f998]['setDataValue'](_0x6f9a('0xac'),_0x6f9a('0x102'));}return _0x54baf2;}));_0x5d0915[_0x6f9a('0xa7')](_0x3433df['getChatQueues']()['then'](function(_0x400bbb){for(var _0xdf09ce=0x0;_0xdf09ce<_0x400bbb[_0x6f9a('0x53')];_0xdf09ce++){_0x400bbb[_0xdf09ce]['setDataValue'](_0x6f9a('0xac'),_0x6f9a('0x104'));}return _0x400bbb;}));_0x5d0915[_0x6f9a('0xa7')](_0x3433df['getMailQueues']()[_0x6f9a('0x22')](function(_0x4d7027){for(var _0x533636=0x0;_0x533636<_0x4d7027[_0x6f9a('0x53')];_0x533636++){_0x4d7027[_0x533636]['setDataValue']('channel','Mail');}return _0x4d7027;}));_0x5d0915['push'](_0x3433df[_0x6f9a('0x106')]()['then'](function(_0x15a90d){for(var _0x184f2b=0x0;_0x184f2b<_0x15a90d[_0x6f9a('0x53')];_0x184f2b++){_0x15a90d[_0x184f2b]['setDataValue'](_0x6f9a('0xac'),_0x6f9a('0x107'));}return _0x15a90d;}));_0x5d0915[_0x6f9a('0xa7')](_0x3433df[_0x6f9a('0x108')]()[_0x6f9a('0x22')](function(_0x562052){for(var _0x4e2623=0x0;_0x4e2623<_0x562052[_0x6f9a('0x53')];_0x4e2623++){_0x562052[_0x4e2623][_0x6f9a('0x101')](_0x6f9a('0xac'),_0x6f9a('0x109'));}return _0x562052;}));_0x5d0915[_0x6f9a('0xa7')](_0x3433df['getFaxQueues']()[_0x6f9a('0x22')](function(_0x5a0b97){for(var _0x3b5e26=0x0;_0x3b5e26<_0x5a0b97[_0x6f9a('0x53')];_0x3b5e26++){_0x5a0b97[_0x3b5e26][_0x6f9a('0x101')]('channel',_0x6f9a('0x111'));}return _0x5a0b97;}));_0x5d0915['push'](_0x3433df[_0x6f9a('0x10a')]()[_0x6f9a('0x22')](function(_0x4a2010){for(var _0xfec266=0x0;_0xfec266<_0x4a2010[_0x6f9a('0x53')];_0xfec266++){_0x4a2010[_0xfec266][_0x6f9a('0x101')]('channel',_0x6f9a('0x112'));}return _0x4a2010;}));return BPromise[_0x6f9a('0xe5')](_0x5d0915);})[_0x6f9a('0x22')](function(_0xc26ad3){var _0x33dbbc=_[_0x6f9a('0x10b')](_0xc26ad3);_0x5d0915=[];return db[_0x6f9a('0x5c')][_0x6f9a('0x10c')](function(_0x358571){for(var _0x3cbd52=0x0;_0x3cbd52<_0x33dbbc['length'];_0x3cbd52++){_0x5d0915[_0x6f9a('0xa7')](_0x33dbbc[_0x3cbd52][_0x6f9a('0x113')](_0x123040['id']),{'transaction':_0x358571});}return BPromise[_0x6f9a('0xe5')](_0x5d0915)[_0x6f9a('0x22')](function(){if(_0x123040['online']){return BPromise[_0x6f9a('0xa9')](_[_0x6f9a('0x3d')](_0x33dbbc,function(_0xff696f){return _0xff696f[_0x6f9a('0x10e')](_0x6f9a('0xac'))===_0x6f9a('0x102');}),function(_0x405df0){return db[_0x6f9a('0xaf')]['destroy']({'where':{'VoiceQueueId':_0x405df0['id'],'UserId':_0x123040['id']},'transaction':_0x358571});});}else{return;}})['then'](function(){for(var _0x134543=0x0;_0x134543<_0x33dbbc[_0x6f9a('0x53')];_0x134543++){var _0x3be819=_0x33dbbc[_0x134543][_0x6f9a('0x10e')](_0x6f9a('0xac'));var _0x1300ac=_0x3be819+_0x6f9a('0xa2');socket[_0x6f9a('0xa3')](_0x6f9a('0x39')+_0x3be819+_0x6f9a('0xae'),{'UserId':_0x123040['id'],['queueField']:_0x33dbbc[_0x134543]['id']});}});});});}});}})[_0x6f9a('0x22')](respondWithStatusCode(_0x4863c6,null))[_0x6f9a('0x61')](handleError(_0x4863c6,null));};exports[_0x6f9a('0x114')]=function(_0x5425c0,_0x14d9e7,_0x21654f){var _0xb82510={};var _0x2eb39d={};var _0x5b540f;var _0x319478;return db[_0x6f9a('0x48')][_0x6f9a('0x8d')]({'where':{'id':_0x5425c0[_0x6f9a('0x62')]['id']}})[_0x6f9a('0x22')](handleEntityNotFound(_0x14d9e7,null))[_0x6f9a('0x22')](function(_0x2ae2b1){if(_0x2ae2b1){_0x5b540f=_0x2ae2b1;_0x2eb39d[_0x6f9a('0x4b')]=_[_0x6f9a('0x4d')](db['CmList'][_0x6f9a('0xc1')]);_0x2eb39d[_0x6f9a('0x4e')]=_[_0x6f9a('0x4d')](_0x5425c0[_0x6f9a('0x4e')]);_0x2eb39d[_0x6f9a('0x4f')]=_[_0x6f9a('0x50')](_0x2eb39d['model'],_0x2eb39d[_0x6f9a('0x4e')]);_0xb82510[_0x6f9a('0x51')]=_['intersection'](_0x2eb39d['model'],qs['fields'](_0x5425c0['query'][_0x6f9a('0x52')]));_0xb82510['attributes']=_0xb82510[_0x6f9a('0x51')][_0x6f9a('0x53')]?_0xb82510['attributes']:_0x2eb39d[_0x6f9a('0x4b')];_0xb82510[_0x6f9a('0x56')]=qs[_0x6f9a('0x57')](_0x5425c0[_0x6f9a('0x4e')][_0x6f9a('0x57')]);_0xb82510['where']=qs['filters'](_[_0x6f9a('0x59')](_0x5425c0[_0x6f9a('0x4e')],_0x2eb39d[_0x6f9a('0x4f')]));if(_0x5425c0[_0x6f9a('0x4e')]['filter']){_0xb82510[_0x6f9a('0x58')]=_['merge'](_0xb82510['where'],{'$or':_[_0x6f9a('0x3f')](_0xb82510['attributes'],function(_0x52ad85){var _0x43933c={};_0x43933c[_0x52ad85]={'$like':'%'+_0x5425c0[_0x6f9a('0x4e')][_0x6f9a('0x3d')]+'%'};return _0x43933c;})});}_0xb82510=_[_0x6f9a('0x5a')]({},_0xb82510,_0x5425c0[_0x6f9a('0x5f')]);return _0x5b540f['getLists'](_0xb82510);}})[_0x6f9a('0x22')](function(_0x3e2d25){if(_0x3e2d25){_0x319478=_0x3e2d25['length'];if(!_0x5425c0['query'][_0x6f9a('0x54')](_0x6f9a('0x55'))){_0xb82510[_0x6f9a('0x30')]=qs[_0x6f9a('0x30')](_0x5425c0[_0x6f9a('0x4e')][_0x6f9a('0x30')]);_0xb82510['offset']=qs[_0x6f9a('0x2f')](_0x5425c0[_0x6f9a('0x4e')][_0x6f9a('0x2f')]);}return _0x5b540f[_0x6f9a('0x114')](_0xb82510);}})[_0x6f9a('0x22')](function(_0x30661b){if(_0x30661b){return _0x30661b?{'count':_0x319478,'rows':_0x30661b}:null;}})[_0x6f9a('0x22')](respondWithResult(_0x14d9e7,null))[_0x6f9a('0x61')](handleError(_0x14d9e7,null));};exports[_0x6f9a('0x115')]=function(_0x4f74fa,_0x4e3013,_0x55c1c2){var _0x3da1b0={};var _0x553a97={};var _0x446c4c;var _0x1111b9;return db[_0x6f9a('0x48')]['findOne']({'where':{'id':_0x4f74fa[_0x6f9a('0x62')]['id']}})['then'](handleEntityNotFound(_0x4e3013,null))[_0x6f9a('0x22')](function(_0x2eeda4){if(_0x2eeda4){_0x446c4c=_0x2eeda4;_0x553a97[_0x6f9a('0x4b')]=_[_0x6f9a('0x4d')](db[_0x6f9a('0x48')][_0x6f9a('0xc1')]);_0x553a97[_0x6f9a('0x4e')]=_['keys'](_0x4f74fa[_0x6f9a('0x4e')]);_0x553a97[_0x6f9a('0x4f')]=_[_0x6f9a('0x50')](_0x553a97['model'],_0x553a97['query']);_0x3da1b0[_0x6f9a('0x51')]=_[_0x6f9a('0x50')](_0x553a97[_0x6f9a('0x4b')],qs[_0x6f9a('0x52')](_0x4f74fa['query'][_0x6f9a('0x52')]));_0x3da1b0[_0x6f9a('0x51')]=_0x3da1b0['attributes'][_0x6f9a('0x53')]?_0x3da1b0[_0x6f9a('0x51')]:_0x553a97[_0x6f9a('0x4b')];_0x3da1b0[_0x6f9a('0x56')]=qs[_0x6f9a('0x57')](_0x4f74fa[_0x6f9a('0x4e')][_0x6f9a('0x57')]);_0x3da1b0['where']=qs['filters'](_[_0x6f9a('0x59')](_0x4f74fa[_0x6f9a('0x4e')],_0x553a97[_0x6f9a('0x4f')]));if(_0x4f74fa[_0x6f9a('0x4e')][_0x6f9a('0x3d')]){_0x3da1b0[_0x6f9a('0x58')]=_[_0x6f9a('0x5a')](_0x3da1b0['where'],{'$or':_[_0x6f9a('0x3f')](_0x3da1b0[_0x6f9a('0x51')],function(_0x23d384){var _0x4c0b5c={};_0x4c0b5c[_0x23d384]={'$like':'%'+_0x4f74fa[_0x6f9a('0x4e')][_0x6f9a('0x3d')]+'%'};return _0x4c0b5c;})});}_0x3da1b0[_0x6f9a('0x4b')]=db[_0x6f9a('0x48')];_0x3da1b0['as']=_0x6f9a('0x3a');_0x3da1b0=_[_0x6f9a('0x5a')]({},_0x3da1b0,_0x4f74fa[_0x6f9a('0x5f')]);return _0x446c4c[_0x6f9a('0xe1')]({'include':[_0x3da1b0]});}})['then'](function(_0x45b329){if(_0x45b329){var _0x8c4845={},_0x182291=[],_0x16e699=0x0;for(var _0xb02485=0x0;_0xb02485<_0x45b329[_0x6f9a('0x53')];_0xb02485+=0x1){for(var _0x143758=0x0,_0x44cdc2;_0x143758<_0x45b329[_0xb02485][_0x6f9a('0x3a')][_0x6f9a('0x53')];_0x143758+=0x1){_0x44cdc2=_0x45b329[_0xb02485][_0x6f9a('0x3a')][_0x143758]['get']({'plain':!![]});_0x8c4845[_0x44cdc2['id']]=_0x44cdc2;}}_0x8c4845=_[_0x6f9a('0x116')](_0x8c4845);for(var _0x1922de=qs['offset'](_0x4f74fa[_0x6f9a('0x4e')][_0x6f9a('0x2f')]);_0x1922de<_0x8c4845[_0x6f9a('0x53')]&&_0x182291[_0x6f9a('0x53')]=_0x5aaaef[_0xaba8('0x51')]){throw new Error(_0xaba8('0x52'));}})[_0xaba8('0x10')](function(){if(_0x3a3a08){return db[_0xaba8('0x2c')]['destroy']({'where':{'membername':_0x3a3a08[_0xaba8('0x28')]},'individualHooks':!![]});}})[_0xaba8('0x10')](function(){if(_0x3a3a08){return _0x3a3a08['getVoiceQueues']({'raw':!![]});}})[_0xaba8('0x10')](function(_0x166fd1){if(_0x3a3a08){if(_0x166fd1){var _0x3f5548=[];_0x4dd606=_0x166fd1;if(_0x4dd606[_0xaba8('0x30')]){for(var _0x23597d=0x0;_0x23597d<_0x4dd606[_0xaba8('0x30')];_0x23597d++){_0x3f5548[_0xaba8('0x34')](db[_0xaba8('0x2c')][_0xaba8('0x53')]({'membername':_0x3a3a08[_0xaba8('0x28')],'UserId':_0x3a3a08['id'],'queue_name':_0x4dd606[_0x23597d]['name'],'VoiceQueueId':_0x4dd606[_0x23597d]['id'],'interface':_0x2ffa47,'paused':_0x3a3a08['loginInPause']||![],'penalty':_0x4dd606[_0x23597d][_0xaba8('0x54')]||0x0}));}return BPromise[_0xaba8('0x48')](_0x3f5548);}}}})['then'](function(){if(_0x3a3a08){return db[_0xaba8('0x2e')][_0xaba8('0x1c')]({'where':{'membername':_0x3a3a08[_0xaba8('0x28')],'exitAt':null}});}})[_0xaba8('0x10')](function(_0x3c7190){if(_0x3a3a08){if(_0x3c7190&&_0x3c7190['length']){var _0x49ae8f=[];_0x3c7190[_0xaba8('0x33')](function(_0x8f80b3){_0x49ae8f[_0xaba8('0x34')](_0x8f80b3['update']({'exitAt':moment()['format'](_0xaba8('0x36'))}));});return BPromise[_0xaba8('0x48')](_0x49ae8f);}}})[_0xaba8('0x10')](function(_0x263b05){if(_0x3a3a08){var _0x41c298=[];var _0x3bc11f=[];var _0x3da2eb=utils[_0xaba8('0x32')]();var _0x197b47={'membername':_0x3a3a08[_0xaba8('0x28')],'interface':_0x2ffa47,'enterAt':moment()['format'](_0xaba8('0x36')),'role':_0x3a3a08[_0xaba8('0x29')],'internal':_0x3a3a08['internal']};_0x3da2eb[_0xaba8('0x33')](function(_0x35998e){_0x41c298['push'](_[_0xaba8('0x55')]({'channel':_0x35998e,'type':_0xaba8('0x56'),'data1':'callysquare','data2':_0x2ffa47},_0x197b47));if(_0x3a3a08[_0xaba8('0x4c')]){_0x3bc11f[_0xaba8('0x34')](_['merge']({'channel':_0x35998e,'type':_0xaba8('0x2f'),'data1':_0xaba8('0x57')},_0x197b47));}});return db['MemberReport'][_0xaba8('0x58')](_0x41c298[_0xaba8('0x59')](_0x3bc11f),{'individualHooks':!![]});}})[_0xaba8('0x10')](function(){if(_0x3a3a08){return _0x3a3a08['update']({'online':!![],'lastLoginAt':moment()[_0xaba8('0x31')](_0xaba8('0x36')),'voicePause':_0x3a3a08[_0xaba8('0x4c')]||![],'mailPause':_0x3a3a08[_0xaba8('0x4c')]||![],'chatPause':_0x3a3a08[_0xaba8('0x4c')]||![],'faxPause':_0x3a3a08[_0xaba8('0x4c')]||![],'smsPause':_0x3a3a08[_0xaba8('0x4c')]||![],'openchannelPause':_0x3a3a08[_0xaba8('0x4c')]||![],'pauseType':_0x3a3a08['loginInPause']?_0xaba8('0x57'):null,'lastPauseAt':moment()[_0xaba8('0x31')]('YYYY-MM-DD\x20HH:mm:ss'),'interface':_0x2ffa47});}})[_0xaba8('0x10')](function(_0x545569){_0x2ce33d(_0x545569);})[_0xaba8('0x19')](function(_0x1900f9){_0x3b515f(_0x3e9faf['error'](0x1f4,_0x1900f9[_0xaba8('0x17')]));});});};
\ No newline at end of file
+var _0x0f57=['request\x20sent','debug','User,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','findAll','options','raw','attributes','limit','include','map','model','GetUser','ShowUser','User','find','PauseUser','where','name','role','internal','interface','UserVoiceQueueRt','update','MemberReport','PAUSE','length','format','YYYY-MM-DD\x20HH:mm:ss','updateAttributes','forEach','push','isNil','SIP/%s','body','type','uniqueid','bulkCreate','DEFAULT\x20PAUSE','UnpauseUser','findOne','channel','Unknown\x20channel','voice','system','mail','chat','fax','sms','openchannel','set','%s%s','Pause','all','LogoutUser','destroy','LoginUser','mobile','phone','loginInPause','count','agent','getLicense','Maximum\x20login\x20has\x20been\x20reached','upsert','UserVoiceQueue.penalty','getChannels','LOGIN','callysquare','merge','LOGININPAUSE','concat','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./user.socket','register','request','then','info','User,\x20%s,\x20%s'];(function(_0x249b21,_0x311cfb){var _0x692b16=function(_0x368ccb){while(--_0x368ccb){_0x249b21['push'](_0x249b21['shift']());}};_0x692b16(++_0x311cfb);}(_0x0f57,0x1d5));var _0x70f5=function(_0x5d9867,_0x5e9030){_0x5d9867=_0x5d9867-0x0;var _0x7d2118=_0x0f57[_0x5d9867];return _0x7d2118;};'use strict';var _=require('lodash');var util=require(_0x70f5('0x0'));var moment=require('moment');var BPromise=require(_0x70f5('0x1'));var rs=require(_0x70f5('0x2'));var fs=require('fs');var Redis=require(_0x70f5('0x3'));var db=require(_0x70f5('0x4'))['db'];var utils=require(_0x70f5('0x5'));var logger=require(_0x70f5('0x6'))('rpc');var config=require(_0x70f5('0x7'));var jayson=require(_0x70f5('0x8'));var client=jayson[_0x70f5('0x9')][_0x70f5('0xa')]({'port':0x232a});config[_0x70f5('0xb')]=_[_0x70f5('0xc')](config[_0x70f5('0xb')],{'host':_0x70f5('0xd'),'port':0x18eb});var socket=require(_0x70f5('0xe'))(new Redis(config[_0x70f5('0xb')]));require(_0x70f5('0xf'))[_0x70f5('0x10')](socket);function respondWithRpcPromise(_0x3df131,_0x5c125b,_0x267eb8){return new BPromise(function(_0x321c67,_0x286f93){return client[_0x70f5('0x11')](_0x3df131,_0x267eb8)[_0x70f5('0x12')](function(_0x222078){logger[_0x70f5('0x13')](_0x70f5('0x14'),_0x5c125b,_0x70f5('0x15'));logger[_0x70f5('0x16')](_0x70f5('0x17'),_0x5c125b,_0x70f5('0x15'),JSON[_0x70f5('0x18')](_0x222078));if(_0x222078[_0x70f5('0x19')]){if(_0x222078[_0x70f5('0x19')][_0x70f5('0x1a')]===0x1f4){logger['error']('User,\x20%s,\x20%s',_0x5c125b,_0x222078[_0x70f5('0x19')][_0x70f5('0x1b')]);return _0x286f93(_0x222078[_0x70f5('0x19')][_0x70f5('0x1b')]);}logger[_0x70f5('0x19')]('User,\x20%s,\x20%s',_0x5c125b,_0x222078[_0x70f5('0x19')][_0x70f5('0x1b')]);return _0x321c67(_0x222078[_0x70f5('0x19')][_0x70f5('0x1b')]);}else{logger[_0x70f5('0x13')]('User,\x20%s,\x20%s',_0x5c125b,_0x70f5('0x15'));_0x321c67(_0x222078[_0x70f5('0x1c')][_0x70f5('0x1b')]);}})[_0x70f5('0x1d')](function(_0x39a805){logger[_0x70f5('0x19')]('User,\x20%s,\x20%s',_0x5c125b,_0x39a805);_0x286f93(_0x39a805);});});}exports['GetUser']=function(_0x457227){var _0x2288d8=this;return new Promise(function(_0x287bd2,_0x535b72){return db['User'][_0x70f5('0x1e')]({'raw':_0x457227[_0x70f5('0x1f')]?_0x457227[_0x70f5('0x1f')][_0x70f5('0x20')]===undefined?!![]:![]:!![],'where':_0x457227['options']?_0x457227[_0x70f5('0x1f')]['where']||null:null,'attributes':_0x457227[_0x70f5('0x1f')]?_0x457227[_0x70f5('0x1f')][_0x70f5('0x21')]||null:null,'limit':_0x457227[_0x70f5('0x1f')]?_0x457227[_0x70f5('0x1f')][_0x70f5('0x22')]||null:null,'include':_0x457227[_0x70f5('0x1f')]?_0x457227['options'][_0x70f5('0x23')]?_[_0x70f5('0x24')](_0x457227[_0x70f5('0x1f')][_0x70f5('0x23')],function(_0x438e82){return{'model':db[_0x438e82[_0x70f5('0x25')]],'as':_0x438e82['as'],'attributes':_0x438e82['attributes'],'include':_0x438e82[_0x70f5('0x23')]?_[_0x70f5('0x24')](_0x438e82[_0x70f5('0x23')],function(_0x27b23d){return{'model':db[_0x27b23d[_0x70f5('0x25')]],'as':_0x27b23d['as'],'attributes':_0x27b23d['attributes'],'include':_0x27b23d[_0x70f5('0x23')]?_[_0x70f5('0x24')](_0x27b23d[_0x70f5('0x23')],function(_0x3eead7){return{'model':db[_0x3eead7[_0x70f5('0x25')]],'as':_0x3eead7['as'],'attributes':_0x3eead7[_0x70f5('0x21')]};}):[]};}):[]};}):[]:[]})[_0x70f5('0x12')](function(_0x4cb3d2){logger[_0x70f5('0x13')](_0x70f5('0x26'),_0x457227);logger[_0x70f5('0x16')](_0x70f5('0x26'),_0x457227,JSON['stringify'](_0x4cb3d2));_0x287bd2(_0x4cb3d2);})[_0x70f5('0x1d')](function(_0x2bcf55){logger[_0x70f5('0x19')]('GetUser',_0x2bcf55[_0x70f5('0x1b')],_0x457227);_0x535b72(_0x2288d8[_0x70f5('0x19')](0x1f4,_0x2bcf55[_0x70f5('0x1b')]));});});};exports[_0x70f5('0x27')]=function(_0x2598d7){var _0x48c021=this;return new Promise(function(_0x138132,_0x8d0bbb){return db[_0x70f5('0x28')][_0x70f5('0x29')]({'raw':_0x2598d7[_0x70f5('0x1f')]?_0x2598d7[_0x70f5('0x1f')][_0x70f5('0x20')]===undefined?!![]:![]:!![],'where':_0x2598d7[_0x70f5('0x1f')]?_0x2598d7[_0x70f5('0x1f')]['where']||null:null,'attributes':_0x2598d7[_0x70f5('0x1f')]?_0x2598d7[_0x70f5('0x1f')][_0x70f5('0x21')]||null:null,'include':_0x2598d7[_0x70f5('0x1f')]?_0x2598d7['options']['include']?_[_0x70f5('0x24')](_0x2598d7[_0x70f5('0x1f')][_0x70f5('0x23')],function(_0x5f46cb){return{'model':db[_0x5f46cb[_0x70f5('0x25')]],'as':_0x5f46cb['as'],'attributes':_0x5f46cb[_0x70f5('0x21')],'include':_0x5f46cb[_0x70f5('0x23')]?_['map'](_0x5f46cb[_0x70f5('0x23')],function(_0x39702f){return{'model':db[_0x39702f['model']],'as':_0x39702f['as'],'attributes':_0x39702f[_0x70f5('0x21')],'include':_0x39702f[_0x70f5('0x23')]?_[_0x70f5('0x24')](_0x39702f[_0x70f5('0x23')],function(_0x59846b){return{'model':db[_0x59846b[_0x70f5('0x25')]],'as':_0x59846b['as'],'attributes':_0x59846b[_0x70f5('0x21')]};}):[]};}):[]};}):[]:[]})[_0x70f5('0x12')](function(_0x419145){logger[_0x70f5('0x13')](_0x70f5('0x27'),_0x2598d7);logger['debug']('ShowUser',_0x2598d7,JSON[_0x70f5('0x18')](_0x419145));_0x138132(_0x419145);})['catch'](function(_0xcc522b){logger[_0x70f5('0x19')](_0x70f5('0x27'),_0xcc522b['message'],_0x2598d7);_0x8d0bbb(_0x48c021[_0x70f5('0x19')](0x1f4,_0xcc522b[_0x70f5('0x1b')]));});});};exports[_0x70f5('0x2a')]=function(_0x4b59e1){var _0xd614fa=this;return new Promise(function(_0x7082a6,_0x2c1baf){var _0xfddbb2;return db['User']['find']({'where':_0x4b59e1[_0x70f5('0x1f')][_0x70f5('0x2b')]||{},'attributes':['id',_0x70f5('0x2c'),_0x70f5('0x2d'),_0x70f5('0x2e'),_0x70f5('0x2f')]})[_0x70f5('0x12')](function(_0x510a92){if(_0x510a92){_0xfddbb2=_0x510a92;return db[_0x70f5('0x30')][_0x70f5('0x31')]({'paused':0x1},{'where':{'UserId':_0xfddbb2['id']},'individualHooks':!![]});}})[_0x70f5('0x12')](function(){if(_0xfddbb2){return db[_0x70f5('0x32')][_0x70f5('0x1e')]({'where':{'membername':_0xfddbb2[_0x70f5('0x2c')],'type':_0x70f5('0x33'),'exitAt':null}});}})[_0x70f5('0x12')](function(_0x33a3e4){if(_0xfddbb2){if(_0x33a3e4&&_0x33a3e4[_0x70f5('0x34')]){var _0x268ebf=moment()[_0x70f5('0x35')](_0x70f5('0x36'));for(var _0xcd2b3=0x0,_0x14c083=_0x33a3e4[_0x70f5('0x34')];_0xcd2b3<_0x14c083;_0xcd2b3++){_0x33a3e4[_0xcd2b3][_0x70f5('0x37')]({'exitAt':_0x268ebf});}}}})['then'](function(){if(_0xfddbb2){var _0x31de60=[];var _0x435b4c=utils['getChannels']();_0x435b4c[_0x70f5('0x38')](function(_0x13c37e){_0x31de60[_0x70f5('0x39')]({'channel':_0x13c37e,'membername':_0xfddbb2[_0x70f5('0x2c')],'interface':_[_0x70f5('0x3a')](_0xfddbb2['interface'])?util[_0x70f5('0x35')](_0x70f5('0x3b'),_0xfddbb2[_0x70f5('0x2c')]):_0xfddbb2[_0x70f5('0x2f')],'type':_0x70f5('0x33'),'enterAt':moment()[_0x70f5('0x35')](_0x70f5('0x36')),'data1':_0x4b59e1[_0x70f5('0x3c')][_0x70f5('0x3d')]||'DEFAULT\x20PAUSE','role':_0xfddbb2[_0x70f5('0x2d')],'internal':_0xfddbb2[_0x70f5('0x2e')],'uniqueid':_0x4b59e1[_0x70f5('0x3c')][_0x70f5('0x3e')]||null});});return db[_0x70f5('0x32')][_0x70f5('0x3f')](_0x31de60,{'individualHooks':!![]});}})[_0x70f5('0x12')](function(){if(_0xfddbb2){return _0xfddbb2[_0x70f5('0x31')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'openchannelPause':!![],'pauseType':_0x4b59e1[_0x70f5('0x3c')][_0x70f5('0x3d')]||_0x70f5('0x40'),'lastPauseAt':moment()[_0x70f5('0x35')](_0x70f5('0x36'))});}})[_0x70f5('0x12')](function(_0x47216b){_0x7082a6(_0x47216b);})['catch'](function(_0x53b9e2){_0x2c1baf(_0xd614fa[_0x70f5('0x19')](0x1f4,_0x53b9e2[_0x70f5('0x1b')]));});});};exports[_0x70f5('0x41')]=function(_0x215fa4){var _0xf88a9f=this;return new Promise(function(_0x4d58fd,_0x202c2f){var _0x12ab60;return db[_0x70f5('0x28')][_0x70f5('0x42')]({'where':_0x215fa4[_0x70f5('0x1f')][_0x70f5('0x2b')]||{},'attributes':['id',_0x70f5('0x2c')]})[_0x70f5('0x12')](function(_0x55840e){if(_0x55840e){_0x12ab60=_0x55840e;if(_0x215fa4[_0x70f5('0x3c')][_0x70f5('0x43')]&&!utils['isValidChannel'](_0x215fa4['body']['channel'])){throw new Error(_0x70f5('0x44'));}switch(_0x215fa4[_0x70f5('0x3c')][_0x70f5('0x43')]){case _0x70f5('0x45'):return db[_0x70f5('0x30')][_0x70f5('0x31')]({'paused':0x0},{'where':{'UserId':_0x12ab60['id']}})[_0x70f5('0x12')](function(){return db[_0x70f5('0x32')][_0x70f5('0x29')]({'where':{'channel':_0x215fa4['body'][_0x70f5('0x43')],'membername':_0x12ab60[_0x70f5('0x2c')],'type':_0x70f5('0x33'),'exitAt':null}});})[_0x70f5('0x12')](function(_0x379c44){if(_0x379c44){return _0x379c44[_0x70f5('0x31')]({'exitAt':moment()[_0x70f5('0x35')](_0x70f5('0x36')),'data2':_0x70f5('0x46')},{'individualHooks':!![]});}return null;})[_0x70f5('0x12')](function(){return _0x12ab60[_0x70f5('0x31')]({'voicePause':![]});});case _0x70f5('0x47'):case _0x70f5('0x48'):case _0x70f5('0x49'):case _0x70f5('0x4a'):case _0x70f5('0x4b'):return db['MemberReport'][_0x70f5('0x29')]({'where':{'channel':_0x215fa4[_0x70f5('0x3c')][_0x70f5('0x43')],'membername':_0x12ab60[_0x70f5('0x2c')],'type':'PAUSE','exitAt':null}})[_0x70f5('0x12')](function(_0x55bb2a){return _0x55bb2a[_0x70f5('0x31')]({'exitAt':moment()[_0x70f5('0x35')](_0x70f5('0x36')),'data2':_0x70f5('0x46')},{'individualHooks':!![]});})[_0x70f5('0x12')](function(){var _0x2773ec={};_[_0x70f5('0x4c')](_0x2773ec,util[_0x70f5('0x35')](_0x70f5('0x4d'),_0x215fa4['body'][_0x70f5('0x43')],_0x70f5('0x4e')),![]);return _0x12ab60[_0x70f5('0x31')](_0x2773ec);});default:return db['UserVoiceQueueRt'][_0x70f5('0x31')]({'paused':0x0},{'where':{'UserId':_0x12ab60['id']}})['then'](function(){return db['MemberReport']['findAll']({'where':{'membername':_0x12ab60[_0x70f5('0x2c')],'type':_0x70f5('0x33'),'exitAt':null}});})[_0x70f5('0x12')](function(_0xc1e5a8){var _0x2ff258=[];_0xc1e5a8[_0x70f5('0x38')](function(_0x5d03ba){_0x2ff258[_0x70f5('0x39')](_0x5d03ba[_0x70f5('0x31')]({'exitAt':moment()['format'](_0x70f5('0x36')),'data2':_0x70f5('0x46')}));});return BPromise[_0x70f5('0x4f')](_0x2ff258);})[_0x70f5('0x12')](function(){return _0x12ab60[_0x70f5('0x31')]({'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});});}}})[_0x70f5('0x12')](function(_0x395dac){_0x4d58fd(_0x395dac);})[_0x70f5('0x1d')](function(_0x427992){_0x202c2f(_0xf88a9f[_0x70f5('0x19')](0x1f4,_0x427992[_0x70f5('0x1b')]));});});};exports[_0x70f5('0x50')]=function(_0x6dd6dc){var _0x1f12c7=this;return new Promise(function(_0x38838f,_0x484091){var _0x64d2e1;return db[_0x70f5('0x28')][_0x70f5('0x42')]({'where':_0x6dd6dc[_0x70f5('0x1f')][_0x70f5('0x2b')]||{},'attributes':['id','name']})[_0x70f5('0x12')](function(_0x40937d){if(_0x40937d){_0x64d2e1=_0x40937d;return db[_0x70f5('0x30')][_0x70f5('0x51')]({'where':{'membername':_0x64d2e1[_0x70f5('0x2c')]},'individualHooks':!![]});}})[_0x70f5('0x12')](function(){if(_0x64d2e1){return db[_0x70f5('0x32')]['findAll']({'where':{'membername':_0x64d2e1[_0x70f5('0x2c')],'exitAt':null}});}})[_0x70f5('0x12')](function(_0xbcafd4){if(_0x64d2e1){if(_0xbcafd4&&_0xbcafd4['length']){var _0x33ac31=[];_0xbcafd4[_0x70f5('0x38')](function(_0x262af8){_0x33ac31['push'](_0x262af8[_0x70f5('0x31')]({'exitAt':moment()[_0x70f5('0x35')](_0x70f5('0x36'))}));});return BPromise[_0x70f5('0x4f')](_0x33ac31);}}})[_0x70f5('0x12')](function(){if(_0x64d2e1){return _0x64d2e1[_0x70f5('0x31')]({'online':![],'lastLoginAt':null,'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});}})[_0x70f5('0x12')](function(_0x53174b){_0x38838f(_0x53174b);})['catch'](function(_0x3e9b31){_0x484091(_0x1f12c7['error'](0x1f4,_0x3e9b31[_0x70f5('0x1b')]));});});};exports[_0x70f5('0x52')]=function(_0x3e42ce){var _0x3f8fbd=this;return new Promise(function(_0x2a86c1,_0x136ea7){var _0x216b74;var _0xede83d;var _0x58560b;var _0x4f21cd;return db['User'][_0x70f5('0x42')]({'where':_0x3e42ce['options']['where']||{},'attributes':['id',_0x70f5('0x2c'),_0x70f5('0x2d'),_0x70f5('0x53'),_0x70f5('0x54'),'internal',_0x70f5('0x55'),_0x70f5('0x2f')]})['then'](function(_0x85ef02){if(_0x85ef02){_0x216b74=_0x85ef02;_0x4f21cd=_0x3e42ce[_0x70f5('0x3c')][_0x70f5('0x2f')]?_0x3e42ce[_0x70f5('0x3c')][_0x70f5('0x2f')]:util[_0x70f5('0x35')](_0x70f5('0x3b'),_0x216b74[_0x70f5('0x2c')]);return db[_0x70f5('0x28')][_0x70f5('0x56')]({'where':{'role':_0x70f5('0x57'),'online':!![],'id':{'$ne':_0x216b74['id']}}});}})[_0x70f5('0x12')](function(_0x11bdfc){if(_0x11bdfc){_0x58560b=_0x11bdfc;return require('../../config/license/util')[_0x70f5('0x58')]();}})[_0x70f5('0x12')](function(_0x5d3e69){if(_0x5d3e69&&_0x5d3e69['agents']&&_0x58560b>=_0x5d3e69['agents']){throw new Error(_0x70f5('0x59'));}})[_0x70f5('0x12')](function(){if(_0x216b74){return db[_0x70f5('0x30')]['destroy']({'where':{'membername':_0x216b74[_0x70f5('0x2c')]},'individualHooks':!![]});}})['then'](function(){if(_0x216b74){return _0x216b74['getVoiceQueues']({'raw':!![]});}})[_0x70f5('0x12')](function(_0x414b69){if(_0x216b74){if(_0x414b69){var _0x3937dd=[];_0xede83d=_0x414b69;if(_0xede83d[_0x70f5('0x34')]){for(var _0x4a0d28=0x0;_0x4a0d28<_0xede83d[_0x70f5('0x34')];_0x4a0d28++){_0x3937dd['push'](db[_0x70f5('0x30')][_0x70f5('0x5a')]({'membername':_0x216b74[_0x70f5('0x2c')],'UserId':_0x216b74['id'],'queue_name':_0xede83d[_0x4a0d28][_0x70f5('0x2c')],'VoiceQueueId':_0xede83d[_0x4a0d28]['id'],'interface':_0x4f21cd,'paused':_0x216b74[_0x70f5('0x55')]||![],'penalty':_0xede83d[_0x4a0d28][_0x70f5('0x5b')]||0x0}));}return BPromise[_0x70f5('0x4f')](_0x3937dd);}}}})[_0x70f5('0x12')](function(){if(_0x216b74){return db[_0x70f5('0x32')]['findAll']({'where':{'membername':_0x216b74['name'],'exitAt':null}});}})[_0x70f5('0x12')](function(_0x383a41){if(_0x216b74){if(_0x383a41&&_0x383a41[_0x70f5('0x34')]){var _0x31e86a=[];_0x383a41['forEach'](function(_0x275984){_0x31e86a['push'](_0x275984[_0x70f5('0x31')]({'exitAt':moment()[_0x70f5('0x35')](_0x70f5('0x36'))}));});return BPromise[_0x70f5('0x4f')](_0x31e86a);}}})[_0x70f5('0x12')](function(_0x5b0f1d){if(_0x216b74){var _0x2e74c0=[];var _0x26b3f8=[];var _0x485202=utils[_0x70f5('0x5c')]();var _0x232442={'membername':_0x216b74[_0x70f5('0x2c')],'interface':_0x4f21cd,'enterAt':moment()[_0x70f5('0x35')](_0x70f5('0x36')),'role':_0x216b74[_0x70f5('0x2d')],'internal':_0x216b74['internal']};_0x485202[_0x70f5('0x38')](function(_0x4d6922){_0x2e74c0[_0x70f5('0x39')](_['merge']({'channel':_0x4d6922,'type':_0x70f5('0x5d'),'data1':_0x70f5('0x5e'),'data2':_0x4f21cd},_0x232442));if(_0x216b74[_0x70f5('0x55')]){_0x26b3f8[_0x70f5('0x39')](_[_0x70f5('0x5f')]({'channel':_0x4d6922,'type':'PAUSE','data1':_0x70f5('0x60')},_0x232442));}});return db[_0x70f5('0x32')]['bulkCreate'](_0x2e74c0[_0x70f5('0x61')](_0x26b3f8),{'individualHooks':!![]});}})[_0x70f5('0x12')](function(){if(_0x216b74){return _0x216b74[_0x70f5('0x31')]({'online':!![],'lastLoginAt':moment()['format'](_0x70f5('0x36')),'voicePause':_0x216b74[_0x70f5('0x55')]||![],'mailPause':_0x216b74[_0x70f5('0x55')]||![],'chatPause':_0x216b74[_0x70f5('0x55')]||![],'faxPause':_0x216b74[_0x70f5('0x55')]||![],'smsPause':_0x216b74[_0x70f5('0x55')]||![],'openchannelPause':_0x216b74[_0x70f5('0x55')]||![],'pauseType':_0x216b74['loginInPause']?_0x70f5('0x60'):null,'lastPauseAt':moment()[_0x70f5('0x35')]('YYYY-MM-DD\x20HH:mm:ss'),'interface':_0x4f21cd});}})[_0x70f5('0x12')](function(_0x4984c7){_0x2a86c1(_0x4984c7);})[_0x70f5('0x1d')](function(_0x4a2e30){_0x136ea7(_0x3f8fbd[_0x70f5('0x19')](0x1f4,_0x4a2e30[_0x70f5('0x1b')]));});});};
\ No newline at end of file
diff --git a/server/api/user/user.socket.js b/server/api/user/user.socket.js
index 1e53202..791daf3 100644
--- a/server/api/user/user.socket.js
+++ b/server/api/user/user.socket.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x31b0=['emit','removeListener','length','user:','./user.events','save'];(function(_0x656f5c,_0x91ffe7){var _0x2beab5=function(_0x314c9b){while(--_0x314c9b){_0x656f5c['push'](_0x656f5c['shift']());}};_0x2beab5(++_0x91ffe7);}(_0x31b0,0x17e));var _0x031b=function(_0x55f343,_0x3abab8){_0x55f343=_0x55f343-0x0;var _0x56c0ef=_0x31b0[_0x55f343];return _0x56c0ef;};'use strict';var UserEvents=require(_0x031b('0x0'));var events=[_0x031b('0x1'),'remove','update'];function createListener(_0x22503f,_0x4057a0){return function(_0x34643b){_0x4057a0[_0x031b('0x2')](_0x22503f,_0x34643b);};}function removeListener(_0xb34993,_0x1f13c1){return function(){UserEvents[_0x031b('0x3')](_0xb34993,_0x1f13c1);};}exports['register']=function(_0x52c5f9){for(var _0xaa5679=0x0,_0x2e5b59=events[_0x031b('0x4')];_0xaa5679<_0x2e5b59;_0xaa5679++){var _0x1ec052=events[_0xaa5679];var _0x1e884b=createListener(_0x031b('0x5')+_0x1ec052,_0x52c5f9);UserEvents['on'](_0x1ec052,_0x1e884b);}};
\ No newline at end of file
+var _0xe098=['removeListener','user:','./user.events','save','remove','update'];(function(_0x5a8073,_0x1ea2eb){var _0x42985e=function(_0x1d083a){while(--_0x1d083a){_0x5a8073['push'](_0x5a8073['shift']());}};_0x42985e(++_0x1ea2eb);}(_0xe098,0x18e));var _0x8e09=function(_0x514626,_0x5bd445){_0x514626=_0x514626-0x0;var _0x2c0110=_0xe098[_0x514626];return _0x2c0110;};'use strict';var UserEvents=require(_0x8e09('0x0'));var events=[_0x8e09('0x1'),_0x8e09('0x2'),_0x8e09('0x3')];function createListener(_0x479c3c,_0x3c9b6e){return function(_0x75dd3){_0x3c9b6e['emit'](_0x479c3c,_0x75dd3);};}function removeListener(_0x4b8c04,_0x3a833d){return function(){UserEvents[_0x8e09('0x4')](_0x4b8c04,_0x3a833d);};}exports['register']=function(_0x59ad29){for(var _0x1d31bf=0x0,_0x278d72=events['length'];_0x1d31bf<_0x278d72;_0x1d31bf++){var _0x38076e=events[_0x1d31bf];var _0x3b54d9=createListener(_0x8e09('0x5')+_0x38076e,_0x59ad29);UserEvents['on'](_0x38076e,_0x3b54d9);}};
\ No newline at end of file
diff --git a/server/api/userChatQueue/index.js b/server/api/userChatQueue/index.js
index efd3729..5591bc7 100644
--- a/server/api/userChatQueue/index.js
+++ b/server/api/userChatQueue/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x6594=['path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x2d34d6,_0x397ff9){var _0x1d3d12=function(_0x558800){while(--_0x558800){_0x2d34d6['push'](_0x2d34d6['shift']());}};_0x1d3d12(++_0x397ff9);}(_0x6594,0x13e));var _0x4659=function(_0x3cb051,_0x3aac86){_0x3cb051=_0x3cb051-0x0;var _0x21dd99=_0x6594[_0x3cb051];return _0x21dd99;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x4659('0x0'));var timeout=require('connect-timeout');var express=require(_0x4659('0x1'));var router=express[_0x4659('0x2')]();var auth=require(_0x4659('0x3'));var interaction=require(_0x4659('0x4'));var config=require(_0x4659('0x5'));module['exports']=router;
\ No newline at end of file
+var _0x69ff=['Router','../../components/interaction/service','util','connect-timeout','express'];(function(_0x51690d,_0x109a13){var _0x449bdb=function(_0x4d42f2){while(--_0x4d42f2){_0x51690d['push'](_0x51690d['shift']());}};_0x449bdb(++_0x109a13);}(_0x69ff,0x179));var _0xf69f=function(_0x4ed537,_0x9912c2){_0x4ed537=_0x4ed537-0x0;var _0x333790=_0x69ff[_0x4ed537];return _0x333790;};'use strict';var multer=require('multer');var util=require(_0xf69f('0x0'));var path=require('path');var timeout=require(_0xf69f('0x1'));var express=require(_0xf69f('0x2'));var router=express[_0xf69f('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0xf69f('0x4'));var config=require('../../config/environment');module['exports']=router;
\ No newline at end of file
diff --git a/server/api/userChatQueue/userChatQueue.attributes.js b/server/api/userChatQueue/userChatQueue.attributes.js
index ddc7df8..d499567 100644
--- a/server/api/userChatQueue/userChatQueue.attributes.js
+++ b/server/api/userChatQueue/userChatQueue.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xe706=['INTEGER','sequelize','exports'];(function(_0x4d9d70,_0x471108){var _0x13c333=function(_0x13eab8){while(--_0x13eab8){_0x4d9d70['push'](_0x4d9d70['shift']());}};_0x13c333(++_0x471108);}(_0xe706,0xa3));var _0x6e70=function(_0x199b64,_0x5d1120){_0x199b64=_0x199b64-0x0;var _0x42b220=_0xe706[_0x199b64];return _0x42b220;};'use strict';var Sequelize=require(_0x6e70('0x0'));module[_0x6e70('0x1')]={'penalty':{'type':Sequelize[_0x6e70('0x2')],'defaultValue':0x0}};
\ No newline at end of file
+var _0xbaf0=['exports','INTEGER'];(function(_0x3d27a,_0x31311d){var _0x314fd7=function(_0x20ac55){while(--_0x20ac55){_0x3d27a['push'](_0x3d27a['shift']());}};_0x314fd7(++_0x31311d);}(_0xbaf0,0x12a));var _0x0baf=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xbaf0[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require('sequelize');module[_0x0baf('0x0')]={'penalty':{'type':Sequelize[_0x0baf('0x1')],'defaultValue':0x0}};
\ No newline at end of file
diff --git a/server/api/userChatQueue/userChatQueue.model.js b/server/api/userChatQueue/userChatQueue.model.js
index 1a8655b..c6afc95 100644
--- a/server/api/userChatQueue/userChatQueue.model.js
+++ b/server/api/userChatQueue/userChatQueue.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x53d9=['rimraf','../../config/environment','./userChatQueue.attributes','exports','define','UserChatQueue','user_has_chat_queues','util','api','moment','bluebird','path'];(function(_0x4c7f8,_0x2bfb43){var _0x4d9525=function(_0x6a5e4d){while(--_0x6a5e4d){_0x4c7f8['push'](_0x4c7f8['shift']());}};_0x4d9525(++_0x2bfb43);}(_0x53d9,0x97));var _0x953d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x53d9[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x953d('0x0'));var logger=require('../../config/logger')(_0x953d('0x1'));var moment=require(_0x953d('0x2'));var BPromise=require(_0x953d('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x953d('0x4'));var rimraf=require(_0x953d('0x5'));var config=require(_0x953d('0x6'));var attributes=require(_0x953d('0x7'));module[_0x953d('0x8')]=function(_0x171100,_0x2f2ab7){return _0x171100[_0x953d('0x9')](_0x953d('0xa'),attributes,{'tableName':_0x953d('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x9829=['path','rimraf','../../config/environment','./userChatQueue.attributes','exports','define','UserChatQueue','util','../../config/logger','api','moment','request-promise'];(function(_0x22c169,_0x3298a6){var _0x30cc6f=function(_0x2cd339){while(--_0x2cd339){_0x22c169['push'](_0x22c169['shift']());}};_0x30cc6f(++_0x3298a6);}(_0x9829,0x11b));var _0x9982=function(_0xd578cb,_0x2167a3){_0xd578cb=_0xd578cb-0x0;var _0x775533=_0x9829[_0xd578cb];return _0x775533;};'use strict';var _=require('lodash');var util=require(_0x9982('0x0'));var logger=require(_0x9982('0x1'))(_0x9982('0x2'));var moment=require(_0x9982('0x3'));var BPromise=require('bluebird');var rp=require(_0x9982('0x4'));var fs=require('fs');var path=require(_0x9982('0x5'));var rimraf=require(_0x9982('0x6'));var config=require(_0x9982('0x7'));var attributes=require(_0x9982('0x8'));module[_0x9982('0x9')]=function(_0x2c2972,_0x4e56da){return _0x2c2972[_0x9982('0xa')](_0x9982('0xb'),attributes,{'tableName':'user_has_chat_queues','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/userChatQueue/userChatQueue.rpc.js b/server/api/userChatQueue/userChatQueue.rpc.js
index 6805886..534445e 100644
--- a/server/api/userChatQueue/userChatQueue.rpc.js
+++ b/server/api/userChatQueue/userChatQueue.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x87ac=['request\x20sent','stringify','error','code','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','request','info','UserChatQueue,\x20%s,\x20%s','debug'];(function(_0x17a754,_0x5f1052){var _0x545d3e=function(_0x24ec39){while(--_0x24ec39){_0x17a754['push'](_0x17a754['shift']());}};_0x545d3e(++_0x5f1052);}(_0x87ac,0x150));var _0xc87a=function(_0x4e4f0e,_0x1c3892){_0x4e4f0e=_0x4e4f0e-0x0;var _0x1a7219=_0x87ac[_0x4e4f0e];return _0x1a7219;};'use strict';var _=require(_0xc87a('0x0'));var util=require(_0xc87a('0x1'));var moment=require(_0xc87a('0x2'));var BPromise=require(_0xc87a('0x3'));var rs=require(_0xc87a('0x4'));var fs=require('fs');var Redis=require(_0xc87a('0x5'));var db=require(_0xc87a('0x6'))['db'];var utils=require(_0xc87a('0x7'));var logger=require('../../config/logger')(_0xc87a('0x8'));var config=require('../../config/environment');var jayson=require(_0xc87a('0x9'));var client=jayson[_0xc87a('0xa')][_0xc87a('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x19e766,_0x251029,_0x50fa5d){return new BPromise(function(_0x9e7a9b,_0x17ada5){return client[_0xc87a('0xc')](_0x19e766,_0x50fa5d)['then'](function(_0x542260){logger[_0xc87a('0xd')](_0xc87a('0xe'),_0x251029,'request\x20sent');logger[_0xc87a('0xf')]('UserChatQueue,\x20%s,\x20%s,\x20%s',_0x251029,_0xc87a('0x10'),JSON[_0xc87a('0x11')](_0x542260));if(_0x542260[_0xc87a('0x12')]){if(_0x542260['error'][_0xc87a('0x13')]===0x1f4){logger[_0xc87a('0x12')]('UserChatQueue,\x20%s,\x20%s',_0x251029,_0x542260[_0xc87a('0x12')][_0xc87a('0x14')]);return _0x17ada5(_0x542260[_0xc87a('0x12')][_0xc87a('0x14')]);}logger[_0xc87a('0x12')](_0xc87a('0xe'),_0x251029,_0x542260[_0xc87a('0x12')][_0xc87a('0x14')]);return _0x9e7a9b(_0x542260[_0xc87a('0x12')][_0xc87a('0x14')]);}else{logger[_0xc87a('0xd')](_0xc87a('0xe'),_0x251029,_0xc87a('0x10'));_0x9e7a9b(_0x542260[_0xc87a('0x15')]['message']);}})['catch'](function(_0x4742d5){logger[_0xc87a('0x12')](_0xc87a('0xe'),_0x251029,_0x4742d5);_0x17ada5(_0x4742d5);});});}
\ No newline at end of file
+var _0x4690=['then','info','UserChatQueue,\x20%s,\x20%s','request\x20sent','UserChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment'];(function(_0x37d1dd,_0x328b44){var _0x49539d=function(_0x381aa5){while(--_0x381aa5){_0x37d1dd['push'](_0x37d1dd['shift']());}};_0x49539d(++_0x328b44);}(_0x4690,0x19b));var _0x0469=function(_0x3d7793,_0x13f42a){_0x3d7793=_0x3d7793-0x0;var _0x16dc27=_0x4690[_0x3d7793];return _0x16dc27;};'use strict';var _=require(_0x0469('0x0'));var util=require(_0x0469('0x1'));var moment=require(_0x0469('0x2'));var BPromise=require(_0x0469('0x3'));var rs=require(_0x0469('0x4'));var fs=require('fs');var Redis=require(_0x0469('0x5'));var db=require(_0x0469('0x6'))['db'];var utils=require(_0x0469('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0x0469('0x8'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3df7c8,_0x312590,_0x1fed05){return new BPromise(function(_0x4e19b7,_0x222965){return client['request'](_0x3df7c8,_0x1fed05)[_0x0469('0x9')](function(_0x143836){logger[_0x0469('0xa')](_0x0469('0xb'),_0x312590,_0x0469('0xc'));logger['debug'](_0x0469('0xd'),_0x312590,_0x0469('0xc'),JSON[_0x0469('0xe')](_0x143836));if(_0x143836['error']){if(_0x143836[_0x0469('0xf')][_0x0469('0x10')]===0x1f4){logger[_0x0469('0xf')](_0x0469('0xb'),_0x312590,_0x143836['error'][_0x0469('0x11')]);return _0x222965(_0x143836[_0x0469('0xf')][_0x0469('0x11')]);}logger[_0x0469('0xf')](_0x0469('0xb'),_0x312590,_0x143836[_0x0469('0xf')][_0x0469('0x11')]);return _0x4e19b7(_0x143836[_0x0469('0xf')][_0x0469('0x11')]);}else{logger[_0x0469('0xa')]('UserChatQueue,\x20%s,\x20%s',_0x312590,_0x0469('0xc'));_0x4e19b7(_0x143836[_0x0469('0x12')][_0x0469('0x11')]);}})[_0x0469('0x13')](function(_0x5aca74){logger[_0x0469('0xf')](_0x0469('0xb'),_0x312590,_0x5aca74);_0x222965(_0x5aca74);});});}
\ No newline at end of file
diff --git a/server/api/userFaxQueue/index.js b/server/api/userFaxQueue/index.js
index 2080a02..fe507f9 100644
--- a/server/api/userFaxQueue/index.js
+++ b/server/api/userFaxQueue/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xe75f=['path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','exports','multer','util'];(function(_0x34b821,_0x504e55){var _0x5e00a0=function(_0x242892){while(--_0x242892){_0x34b821['push'](_0x34b821['shift']());}};_0x5e00a0(++_0x504e55);}(_0xe75f,0x11e));var _0xfe75=function(_0x363404,_0x862469){_0x363404=_0x363404-0x0;var _0x2d415b=_0xe75f[_0x363404];return _0x2d415b;};'use strict';var multer=require(_0xfe75('0x0'));var util=require(_0xfe75('0x1'));var path=require(_0xfe75('0x2'));var timeout=require(_0xfe75('0x3'));var express=require('express');var router=express[_0xfe75('0x4')]();var auth=require(_0xfe75('0x5'));var interaction=require(_0xfe75('0x6'));var config=require(_0xfe75('0x7'));module[_0xfe75('0x8')]=router;
\ No newline at end of file
+var _0x6e0d=['../../config/environment','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x6e0d,0x19a));var _0xd6e0=function(_0x49be7f,_0x4c95aa){_0x49be7f=_0x49be7f-0x0;var _0x23a2fe=_0x6e0d[_0x49be7f];return _0x23a2fe;};'use strict';var multer=require(_0xd6e0('0x0'));var util=require(_0xd6e0('0x1'));var path=require(_0xd6e0('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xd6e0('0x3')]();var auth=require(_0xd6e0('0x4'));var interaction=require(_0xd6e0('0x5'));var config=require(_0xd6e0('0x6'));module[_0xd6e0('0x7')]=router;
\ No newline at end of file
diff --git a/server/api/userFaxQueue/userFaxQueue.attributes.js b/server/api/userFaxQueue/userFaxQueue.attributes.js
index 521d554..1eb2872 100644
--- a/server/api/userFaxQueue/userFaxQueue.attributes.js
+++ b/server/api/userFaxQueue/userFaxQueue.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x0598=['exports','INTEGER','sequelize'];(function(_0x231dda,_0x5b04cc){var _0x3f88cb=function(_0x16eb77){while(--_0x16eb77){_0x231dda['push'](_0x231dda['shift']());}};_0x3f88cb(++_0x5b04cc);}(_0x0598,0x92));var _0x8059=function(_0x4fa7f1,_0x3b4cd8){_0x4fa7f1=_0x4fa7f1-0x0;var _0x1653fd=_0x0598[_0x4fa7f1];return _0x1653fd;};'use strict';var Sequelize=require(_0x8059('0x0'));module[_0x8059('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x8059('0x2')],'defaultValue':0x0},'queue':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x955f=['exports','INTEGER','STRING','sequelize'];(function(_0x56ad00,_0x3a5228){var _0x220289=function(_0x47b201){while(--_0x47b201){_0x56ad00['push'](_0x56ad00['shift']());}};_0x220289(++_0x3a5228);}(_0x955f,0x1eb));var _0xf955=function(_0x3f643b,_0x4d07f0){_0x3f643b=_0x3f643b-0x0;var _0x3cfb45=_0x955f[_0x3f643b];return _0x3cfb45;};'use strict';var Sequelize=require(_0xf955('0x0'));module[_0xf955('0x1')]={'penalty':{'type':Sequelize[_0xf955('0x2')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0xf955('0x2')],'defaultValue':0x0},'queue':{'type':Sequelize[_0xf955('0x3')]}};
\ No newline at end of file
diff --git a/server/api/userFaxQueue/userFaxQueue.model.js b/server/api/userFaxQueue/userFaxQueue.model.js
index 6818f10..5e0ae4a 100644
--- a/server/api/userFaxQueue/userFaxQueue.model.js
+++ b/server/api/userFaxQueue/userFaxQueue.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x5f2f=['bluebird','request-promise','path','./userFaxQueue.attributes','exports','define','UserFaxQueue','lodash','util','../../config/logger','api','moment'];(function(_0x4e9833,_0x39fc6c){var _0x83856d=function(_0x1965e4){while(--_0x1965e4){_0x4e9833['push'](_0x4e9833['shift']());}};_0x83856d(++_0x39fc6c);}(_0x5f2f,0x73));var _0xf5f2=function(_0x242b15,_0x546fe1){_0x242b15=_0x242b15-0x0;var _0x40443a=_0x5f2f[_0x242b15];return _0x40443a;};'use strict';var _=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var logger=require(_0xf5f2('0x2'))(_0xf5f2('0x3'));var moment=require(_0xf5f2('0x4'));var BPromise=require(_0xf5f2('0x5'));var rp=require(_0xf5f2('0x6'));var fs=require('fs');var path=require(_0xf5f2('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xf5f2('0x8'));module[_0xf5f2('0x9')]=function(_0xad7f65,_0x3eebf6){return _0xad7f65[_0xf5f2('0xa')](_0xf5f2('0xb'),attributes,{'tableName':'user_has_fax_queues','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xb10b=['api','moment','request-promise','path','rimraf','../../config/environment','./userFaxQueue.attributes','exports','define','user_has_fax_queues','lodash','../../config/logger'];(function(_0x3207aa,_0xe86a72){var _0x51758f=function(_0x9ff790){while(--_0x9ff790){_0x3207aa['push'](_0x3207aa['shift']());}};_0x51758f(++_0xe86a72);}(_0xb10b,0x12a));var _0xbb10=function(_0x19aaa9,_0x9d0bb6){_0x19aaa9=_0x19aaa9-0x0;var _0x465463=_0xb10b[_0x19aaa9];return _0x465463;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var logger=require(_0xbb10('0x1'))(_0xbb10('0x2'));var moment=require(_0xbb10('0x3'));var BPromise=require('bluebird');var rp=require(_0xbb10('0x4'));var fs=require('fs');var path=require(_0xbb10('0x5'));var rimraf=require(_0xbb10('0x6'));var config=require(_0xbb10('0x7'));var attributes=require(_0xbb10('0x8'));module[_0xbb10('0x9')]=function(_0x481979,_0x328583){return _0x481979[_0xbb10('0xa')]('UserFaxQueue',attributes,{'tableName':_0xbb10('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/userFaxQueue/userFaxQueue.rpc.js b/server/api/userFaxQueue/userFaxQueue.rpc.js
index 7c9a4c6..a1a30dc 100644
--- a/server/api/userFaxQueue/userFaxQueue.rpc.js
+++ b/server/api/userFaxQueue/userFaxQueue.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x2ab3=['randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','UserFaxQueue,\x20%s,\x20%s','request\x20sent','UserFaxQueue,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','bluebird'];(function(_0x4cf0b7,_0x560029){var _0x545f10=function(_0x993533){while(--_0x993533){_0x4cf0b7['push'](_0x4cf0b7['shift']());}};_0x545f10(++_0x560029);}(_0x2ab3,0x162));var _0x32ab=function(_0x3ab9ee,_0x4a74b8){_0x3ab9ee=_0x3ab9ee-0x0;var _0x82ee88=_0x2ab3[_0x3ab9ee];return _0x82ee88;};'use strict';var _=require(_0x32ab('0x0'));var util=require(_0x32ab('0x1'));var moment=require('moment');var BPromise=require(_0x32ab('0x2'));var rs=require(_0x32ab('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x32ab('0x4'));var logger=require(_0x32ab('0x5'))(_0x32ab('0x6'));var config=require(_0x32ab('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x32ab('0x8')][_0x32ab('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x120976,_0x33f936,_0x195824){return new BPromise(function(_0x23bd19,_0x433caa){return client[_0x32ab('0xa')](_0x120976,_0x195824)[_0x32ab('0xb')](function(_0x238b6b){logger[_0x32ab('0xc')](_0x32ab('0xd'),_0x33f936,_0x32ab('0xe'));logger['debug'](_0x32ab('0xf'),_0x33f936,_0x32ab('0xe'),JSON['stringify'](_0x238b6b));if(_0x238b6b[_0x32ab('0x10')]){if(_0x238b6b[_0x32ab('0x10')][_0x32ab('0x11')]===0x1f4){logger[_0x32ab('0x10')]('UserFaxQueue,\x20%s,\x20%s',_0x33f936,_0x238b6b[_0x32ab('0x10')][_0x32ab('0x12')]);return _0x433caa(_0x238b6b[_0x32ab('0x10')][_0x32ab('0x12')]);}logger[_0x32ab('0x10')](_0x32ab('0xd'),_0x33f936,_0x238b6b['error'][_0x32ab('0x12')]);return _0x23bd19(_0x238b6b[_0x32ab('0x10')][_0x32ab('0x12')]);}else{logger[_0x32ab('0xc')]('UserFaxQueue,\x20%s,\x20%s',_0x33f936,_0x32ab('0xe'));_0x23bd19(_0x238b6b[_0x32ab('0x13')][_0x32ab('0x12')]);}})[_0x32ab('0x14')](function(_0x2d830a){logger['error'](_0x32ab('0xd'),_0x33f936,_0x2d830a);_0x433caa(_0x2d830a);});});}
\ No newline at end of file
+var _0x6157=['bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','request','info','request\x20sent','UserFaxQueue,\x20%s,\x20%s,\x20%s','error','code','UserFaxQueue,\x20%s,\x20%s','message','result','catch','lodash','util'];(function(_0x307b81,_0x2a371b){var _0x4de106=function(_0x2c437c){while(--_0x2c437c){_0x307b81['push'](_0x307b81['shift']());}};_0x4de106(++_0x2a371b);}(_0x6157,0x1a0));var _0x7615=function(_0x3d1200,_0x5188fd){_0x3d1200=_0x3d1200-0x0;var _0x3cbbfc=_0x6157[_0x3d1200];return _0x3cbbfc;};'use strict';var _=require(_0x7615('0x0'));var util=require(_0x7615('0x1'));var moment=require('moment');var BPromise=require(_0x7615('0x2'));var rs=require(_0x7615('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7615('0x4'))['db'];var utils=require(_0x7615('0x5'));var logger=require(_0x7615('0x6'))(_0x7615('0x7'));var config=require(_0x7615('0x8'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x502985,_0x5ed44,_0x407cb4){return new BPromise(function(_0x25ea3c,_0x21241b){return client[_0x7615('0x9')](_0x502985,_0x407cb4)['then'](function(_0x46db8d){logger[_0x7615('0xa')]('UserFaxQueue,\x20%s,\x20%s',_0x5ed44,_0x7615('0xb'));logger['debug'](_0x7615('0xc'),_0x5ed44,'request\x20sent',JSON['stringify'](_0x46db8d));if(_0x46db8d[_0x7615('0xd')]){if(_0x46db8d['error'][_0x7615('0xe')]===0x1f4){logger[_0x7615('0xd')](_0x7615('0xf'),_0x5ed44,_0x46db8d[_0x7615('0xd')][_0x7615('0x10')]);return _0x21241b(_0x46db8d[_0x7615('0xd')][_0x7615('0x10')]);}logger[_0x7615('0xd')]('UserFaxQueue,\x20%s,\x20%s',_0x5ed44,_0x46db8d['error'][_0x7615('0x10')]);return _0x25ea3c(_0x46db8d[_0x7615('0xd')][_0x7615('0x10')]);}else{logger[_0x7615('0xa')](_0x7615('0xf'),_0x5ed44,_0x7615('0xb'));_0x25ea3c(_0x46db8d[_0x7615('0x11')][_0x7615('0x10')]);}})[_0x7615('0x12')](function(_0x44a6bb){logger['error'](_0x7615('0xf'),_0x5ed44,_0x44a6bb);_0x21241b(_0x44a6bb);});});}
\ No newline at end of file
diff --git a/server/api/userMailQueue/index.js b/server/api/userMailQueue/index.js
index 16b0d9a..42d515e 100644
--- a/server/api/userMailQueue/index.js
+++ b/server/api/userMailQueue/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xd49c=['../../components/auth/service','../../config/environment','exports','multer','util','connect-timeout','express'];(function(_0x2f08be,_0x3a01e3){var _0x39bc5e=function(_0x327811){while(--_0x327811){_0x2f08be['push'](_0x2f08be['shift']());}};_0x39bc5e(++_0x3a01e3);}(_0xd49c,0x145));var _0xcd49=function(_0x1e7f98,_0x5b23d9){_0x1e7f98=_0x1e7f98-0x0;var _0x70d2ae=_0xd49c[_0x1e7f98];return _0x70d2ae;};'use strict';var multer=require(_0xcd49('0x0'));var util=require(_0xcd49('0x1'));var path=require('path');var timeout=require(_0xcd49('0x2'));var express=require(_0xcd49('0x3'));var router=express['Router']();var auth=require(_0xcd49('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xcd49('0x5'));module[_0xcd49('0x6')]=router;
\ No newline at end of file
+var _0xa9fa=['../../components/interaction/service','../../config/environment','multer','util','path','express'];(function(_0x38cf13,_0x3580fc){var _0x5e75e0=function(_0x28be91){while(--_0x28be91){_0x38cf13['push'](_0x38cf13['shift']());}};_0x5e75e0(++_0x3580fc);}(_0xa9fa,0x1e2));var _0xaa9f=function(_0x127808,_0x389f63){_0x127808=_0x127808-0x0;var _0x123f60=_0xa9fa[_0x127808];return _0x123f60;};'use strict';var multer=require(_0xaa9f('0x0'));var util=require(_0xaa9f('0x1'));var path=require(_0xaa9f('0x2'));var timeout=require('connect-timeout');var express=require(_0xaa9f('0x3'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0xaa9f('0x4'));var config=require(_0xaa9f('0x5'));module['exports']=router;
\ No newline at end of file
diff --git a/server/api/userMailQueue/userMailQueue.attributes.js b/server/api/userMailQueue/userMailQueue.attributes.js
index 62c71d7..6316f4b 100644
--- a/server/api/userMailQueue/userMailQueue.attributes.js
+++ b/server/api/userMailQueue/userMailQueue.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xe706=['INTEGER','sequelize','exports'];(function(_0x587d3b,_0x2f4c9c){var _0x47ca1a=function(_0x3adc5a){while(--_0x3adc5a){_0x587d3b['push'](_0x587d3b['shift']());}};_0x47ca1a(++_0x2f4c9c);}(_0xe706,0xa3));var _0x6e70=function(_0x2ada99,_0x4ea2aa){_0x2ada99=_0x2ada99-0x0;var _0x5447e5=_0xe706[_0x2ada99];return _0x5447e5;};'use strict';var Sequelize=require(_0x6e70('0x0'));module[_0x6e70('0x1')]={'penalty':{'type':Sequelize[_0x6e70('0x2')],'defaultValue':0x0}};
\ No newline at end of file
+var _0xa9e0=['sequelize','exports','INTEGER'];(function(_0x539564,_0x328309){var _0x5efe2b=function(_0x59ea09){while(--_0x59ea09){_0x539564['push'](_0x539564['shift']());}};_0x5efe2b(++_0x328309);}(_0xa9e0,0x123));var _0x0a9e=function(_0x173d7e,_0x3242fd){_0x173d7e=_0x173d7e-0x0;var _0x2220d6=_0xa9e0[_0x173d7e];return _0x2220d6;};'use strict';var Sequelize=require(_0x0a9e('0x0'));module[_0x0a9e('0x1')]={'penalty':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x0}};
\ No newline at end of file
diff --git a/server/api/userMailQueue/userMailQueue.model.js b/server/api/userMailQueue/userMailQueue.model.js
index 1f7d0b7..7e3f546 100644
--- a/server/api/userMailQueue/userMailQueue.model.js
+++ b/server/api/userMailQueue/userMailQueue.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xa9e0=['../../config/environment','./userMailQueue.attributes','exports','define','UserMailQueue','lodash','util','../../config/logger','bluebird','path','rimraf'];(function(_0x10eace,_0x290e2b){var _0x2a42f8=function(_0x20e344){while(--_0x20e344){_0x10eace['push'](_0x10eace['shift']());}};_0x2a42f8(++_0x290e2b);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4ea69d,_0x290f53){_0x4ea69d=_0x4ea69d-0x0;var _0x5318e0=_0xa9e0[_0x4ea69d];return _0x5318e0;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var logger=require(_0x0a9e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x0a9e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0a9e('0x4'));var rimraf=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var attributes=require(_0x0a9e('0x7'));module[_0x0a9e('0x8')]=function(_0x57b080,_0x219af0){return _0x57b080[_0x0a9e('0x9')](_0x0a9e('0xa'),attributes,{'tableName':'user_has_mail_queues','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xa9e0=['../../config/environment','./userMailQueue.attributes','exports','define','UserMailQueue','lodash','util','../../config/logger','bluebird','path','rimraf'];(function(_0x521e58,_0x5f30c8){var _0x105a23=function(_0x457966){while(--_0x457966){_0x521e58['push'](_0x521e58['shift']());}};_0x105a23(++_0x5f30c8);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3c2a69,_0x4c8b41){_0x3c2a69=_0x3c2a69-0x0;var _0x596bc8=_0xa9e0[_0x3c2a69];return _0x596bc8;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var logger=require(_0x0a9e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x0a9e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0a9e('0x4'));var rimraf=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var attributes=require(_0x0a9e('0x7'));module[_0x0a9e('0x8')]=function(_0x57b080,_0x219af0){return _0x57b080[_0x0a9e('0x9')](_0x0a9e('0xa'),attributes,{'tableName':'user_has_mail_queues','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/userMailQueue/userMailQueue.rpc.js b/server/api/userMailQueue/userMailQueue.rpc.js
index d5ab52f..15d9894 100644
--- a/server/api/userMailQueue/userMailQueue.rpc.js
+++ b/server/api/userMailQueue/userMailQueue.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xcf71=['then','UserMailQueue,\x20%s,\x20%s','UserMailQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request'];(function(_0x4a8bf1,_0x4c15b9){var _0x5cb38e=function(_0xbef27b){while(--_0xbef27b){_0x4a8bf1['push'](_0x4a8bf1['shift']());}};_0x5cb38e(++_0x4c15b9);}(_0xcf71,0xba));var _0x1cf7=function(_0x4441cf,_0x4509a6){_0x4441cf=_0x4441cf-0x0;var _0x3b8877=_0xcf71[_0x4441cf];return _0x3b8877;};'use strict';var _=require(_0x1cf7('0x0'));var util=require(_0x1cf7('0x1'));var moment=require(_0x1cf7('0x2'));var BPromise=require(_0x1cf7('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1cf7('0x4'));var db=require(_0x1cf7('0x5'))['db'];var utils=require(_0x1cf7('0x6'));var logger=require(_0x1cf7('0x7'))(_0x1cf7('0x8'));var config=require(_0x1cf7('0x9'));var jayson=require(_0x1cf7('0xa'));var client=jayson[_0x1cf7('0xb')][_0x1cf7('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x45ee6b,_0x2de84d,_0x19b626){return new BPromise(function(_0x4f908a,_0x52c8c8){return client[_0x1cf7('0xd')](_0x45ee6b,_0x19b626)[_0x1cf7('0xe')](function(_0x406ba0){logger['info'](_0x1cf7('0xf'),_0x2de84d,'request\x20sent');logger['debug'](_0x1cf7('0x10'),_0x2de84d,_0x1cf7('0x11'),JSON[_0x1cf7('0x12')](_0x406ba0));if(_0x406ba0[_0x1cf7('0x13')]){if(_0x406ba0[_0x1cf7('0x13')][_0x1cf7('0x14')]===0x1f4){logger['error'](_0x1cf7('0xf'),_0x2de84d,_0x406ba0['error'][_0x1cf7('0x15')]);return _0x52c8c8(_0x406ba0['error'][_0x1cf7('0x15')]);}logger[_0x1cf7('0x13')]('UserMailQueue,\x20%s,\x20%s',_0x2de84d,_0x406ba0[_0x1cf7('0x13')][_0x1cf7('0x15')]);return _0x4f908a(_0x406ba0[_0x1cf7('0x13')][_0x1cf7('0x15')]);}else{logger[_0x1cf7('0x16')](_0x1cf7('0xf'),_0x2de84d,_0x1cf7('0x11'));_0x4f908a(_0x406ba0[_0x1cf7('0x17')][_0x1cf7('0x15')]);}})[_0x1cf7('0x18')](function(_0x2a3671){logger[_0x1cf7('0x13')](_0x1cf7('0xf'),_0x2de84d,_0x2a3671);_0x52c8c8(_0x2a3671);});});}
\ No newline at end of file
+var _0xf131=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','request','then','UserMailQueue,\x20%s,\x20%s','request\x20sent','debug','UserMailQueue,\x20%s,\x20%s,\x20%s','error','message','info','result','catch','lodash'];(function(_0xda4429,_0x48e328){var _0x4440cb=function(_0x169eab){while(--_0x169eab){_0xda4429['push'](_0xda4429['shift']());}};_0x4440cb(++_0x48e328);}(_0xf131,0x1a1));var _0x1f13=function(_0x575b0a,_0x39fc88){_0x575b0a=_0x575b0a-0x0;var _0x2dc331=_0xf131[_0x575b0a];return _0x2dc331;};'use strict';var _=require(_0x1f13('0x0'));var util=require(_0x1f13('0x1'));var moment=require(_0x1f13('0x2'));var BPromise=require(_0x1f13('0x3'));var rs=require(_0x1f13('0x4'));var fs=require('fs');var Redis=require(_0x1f13('0x5'));var db=require(_0x1f13('0x6'))['db'];var utils=require(_0x1f13('0x7'));var logger=require('../../config/logger')(_0x1f13('0x8'));var config=require('../../config/environment');var jayson=require(_0x1f13('0x9'));var client=jayson[_0x1f13('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3d007e,_0x263848,_0x3ee03a){return new BPromise(function(_0x436521,_0x1126a4){return client[_0x1f13('0xb')](_0x3d007e,_0x3ee03a)[_0x1f13('0xc')](function(_0x11619a){logger['info'](_0x1f13('0xd'),_0x263848,_0x1f13('0xe'));logger[_0x1f13('0xf')](_0x1f13('0x10'),_0x263848,_0x1f13('0xe'),JSON['stringify'](_0x11619a));if(_0x11619a[_0x1f13('0x11')]){if(_0x11619a[_0x1f13('0x11')]['code']===0x1f4){logger[_0x1f13('0x11')](_0x1f13('0xd'),_0x263848,_0x11619a[_0x1f13('0x11')][_0x1f13('0x12')]);return _0x1126a4(_0x11619a[_0x1f13('0x11')][_0x1f13('0x12')]);}logger['error'](_0x1f13('0xd'),_0x263848,_0x11619a[_0x1f13('0x11')]['message']);return _0x436521(_0x11619a[_0x1f13('0x11')][_0x1f13('0x12')]);}else{logger[_0x1f13('0x13')](_0x1f13('0xd'),_0x263848,_0x1f13('0xe'));_0x436521(_0x11619a[_0x1f13('0x14')][_0x1f13('0x12')]);}})[_0x1f13('0x15')](function(_0x448cae){logger[_0x1f13('0x11')](_0x1f13('0xd'),_0x263848,_0x448cae);_0x1126a4(_0x448cae);});});}
\ No newline at end of file
diff --git a/server/api/userOpenchannelQueue/index.js b/server/api/userOpenchannelQueue/index.js
index acccf0f..6706e5d 100644
--- a/server/api/userOpenchannelQueue/index.js
+++ b/server/api/userOpenchannelQueue/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x98f1=['exports','util','path','express','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x1c2558,_0x5753be){var _0x527cfb=function(_0x9c5ba2){while(--_0x9c5ba2){_0x1c2558['push'](_0x1c2558['shift']());}};_0x527cfb(++_0x5753be);}(_0x98f1,0x1dd));var _0x198f=function(_0x10921d,_0x242a14){_0x10921d=_0x10921d-0x0;var _0x163ca1=_0x98f1[_0x10921d];return _0x163ca1;};'use strict';var multer=require('multer');var util=require(_0x198f('0x0'));var path=require(_0x198f('0x1'));var timeout=require('connect-timeout');var express=require(_0x198f('0x2'));var router=express['Router']();var auth=require(_0x198f('0x3'));var interaction=require(_0x198f('0x4'));var config=require(_0x198f('0x5'));module[_0x198f('0x6')]=router;
\ No newline at end of file
+var _0xa31a=['path','Router','../../components/auth/service','exports','multer'];(function(_0x41f0bb,_0x40a59f){var _0x4004ef=function(_0x230a7f){while(--_0x230a7f){_0x41f0bb['push'](_0x41f0bb['shift']());}};_0x4004ef(++_0x40a59f);}(_0xa31a,0x1b2));var _0xaa31=function(_0x5a925f,_0x2bffd5){_0x5a925f=_0x5a925f-0x0;var _0x3006fd=_0xa31a[_0x5a925f];return _0x3006fd;};'use strict';var multer=require(_0xaa31('0x0'));var util=require('util');var path=require(_0xaa31('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xaa31('0x2')]();var auth=require(_0xaa31('0x3'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module[_0xaa31('0x4')]=router;
\ No newline at end of file
diff --git a/server/api/userOpenchannelQueue/userOpenchannelQueue.attributes.js b/server/api/userOpenchannelQueue/userOpenchannelQueue.attributes.js
index 826e2a1..504ba4f 100644
--- a/server/api/userOpenchannelQueue/userOpenchannelQueue.attributes.js
+++ b/server/api/userOpenchannelQueue/userOpenchannelQueue.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xe706=['INTEGER','sequelize','exports'];(function(_0x2bc6e2,_0x421b11){var _0x241f27=function(_0x104432){while(--_0x104432){_0x2bc6e2['push'](_0x2bc6e2['shift']());}};_0x241f27(++_0x421b11);}(_0xe706,0xa3));var _0x6e70=function(_0x1bef07,_0x2a4e64){_0x1bef07=_0x1bef07-0x0;var _0x29edf6=_0xe706[_0x1bef07];return _0x29edf6;};'use strict';var Sequelize=require(_0x6e70('0x0'));module[_0x6e70('0x1')]={'penalty':{'type':Sequelize[_0x6e70('0x2')],'defaultValue':0x0}};
\ No newline at end of file
+var _0xd8b0=['exports','sequelize'];(function(_0x37c981,_0x22a780){var _0x4deca9=function(_0x38cf21){while(--_0x38cf21){_0x37c981['push'](_0x37c981['shift']());}};_0x4deca9(++_0x22a780);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0x0d8b('0x0'));module[_0x0d8b('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}};
\ No newline at end of file
diff --git a/server/api/userOpenchannelQueue/userOpenchannelQueue.model.js b/server/api/userOpenchannelQueue/userOpenchannelQueue.model.js
index e8bd4d3..7062657 100644
--- a/server/api/userOpenchannelQueue/userOpenchannelQueue.model.js
+++ b/server/api/userOpenchannelQueue/userOpenchannelQueue.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xeb53=['../../config/environment','define','UserOpenchannelQueue','lodash','api','bluebird','request-promise','path','rimraf'];(function(_0x249145,_0x124bcd){var _0x4da183=function(_0x4258a6){while(--_0x4258a6){_0x249145['push'](_0x249145['shift']());}};_0x4da183(++_0x124bcd);}(_0xeb53,0x174));var _0x3eb5=function(_0x274010,_0x2aecd1){_0x274010=_0x274010-0x0;var _0x19101e=_0xeb53[_0x274010];return _0x19101e;};'use strict';var _=require(_0x3eb5('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x3eb5('0x1'));var moment=require('moment');var BPromise=require(_0x3eb5('0x2'));var rp=require(_0x3eb5('0x3'));var fs=require('fs');var path=require(_0x3eb5('0x4'));var rimraf=require(_0x3eb5('0x5'));var config=require(_0x3eb5('0x6'));var attributes=require('./userOpenchannelQueue.attributes');module['exports']=function(_0x3e08ff,_0x110dc6){return _0x3e08ff[_0x3eb5('0x7')](_0x3eb5('0x8'),attributes,{'tableName':'user_has_openchannel_queues','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x4cae=['../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./userOpenchannelQueue.attributes','exports','define','user_has_openchannel_queues','util'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x4cae,0x6b));var _0xe4ca=function(_0x31b2ad,_0x496b1e){_0x31b2ad=_0x31b2ad-0x0;var _0x336191=_0x4cae[_0x31b2ad];return _0x336191;};'use strict';var _=require('lodash');var util=require(_0xe4ca('0x0'));var logger=require(_0xe4ca('0x1'))('api');var moment=require(_0xe4ca('0x2'));var BPromise=require(_0xe4ca('0x3'));var rp=require(_0xe4ca('0x4'));var fs=require('fs');var path=require(_0xe4ca('0x5'));var rimraf=require(_0xe4ca('0x6'));var config=require(_0xe4ca('0x7'));var attributes=require(_0xe4ca('0x8'));module[_0xe4ca('0x9')]=function(_0x3737ac,_0x2bd685){return _0x3737ac[_0xe4ca('0xa')]('UserOpenchannelQueue',attributes,{'tableName':_0xe4ca('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/userOpenchannelQueue/userOpenchannelQueue.rpc.js b/server/api/userOpenchannelQueue/userOpenchannelQueue.rpc.js
index fd0b310..17afba5 100644
--- a/server/api/userOpenchannelQueue/userOpenchannelQueue.rpc.js
+++ b/server/api/userOpenchannelQueue/userOpenchannelQueue.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x49fa=['debug','stringify','error','message','result','catch','lodash','util','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','request','then','UserOpenchannelQueue,\x20%s,\x20%s','request\x20sent'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x49fa,0x1f4));var _0xa49f=function(_0x9fb6f8,_0x4277b7){_0x9fb6f8=_0x9fb6f8-0x0;var _0x32089f=_0x49fa[_0x9fb6f8];return _0x32089f;};'use strict';var _=require(_0xa49f('0x0'));var util=require(_0xa49f('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa49f('0x2'));var db=require(_0xa49f('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xa49f('0x4'))(_0xa49f('0x5'));var config=require('../../config/environment');var jayson=require(_0xa49f('0x6'));var client=jayson[_0xa49f('0x7')][_0xa49f('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3f8cf8,_0x59030f,_0xec9a91){return new BPromise(function(_0x3327f7,_0x313419){return client[_0xa49f('0x9')](_0x3f8cf8,_0xec9a91)[_0xa49f('0xa')](function(_0x32ec9a){logger['info'](_0xa49f('0xb'),_0x59030f,_0xa49f('0xc'));logger[_0xa49f('0xd')]('UserOpenchannelQueue,\x20%s,\x20%s,\x20%s',_0x59030f,_0xa49f('0xc'),JSON[_0xa49f('0xe')](_0x32ec9a));if(_0x32ec9a[_0xa49f('0xf')]){if(_0x32ec9a[_0xa49f('0xf')]['code']===0x1f4){logger[_0xa49f('0xf')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x59030f,_0x32ec9a['error'][_0xa49f('0x10')]);return _0x313419(_0x32ec9a[_0xa49f('0xf')]['message']);}logger[_0xa49f('0xf')](_0xa49f('0xb'),_0x59030f,_0x32ec9a[_0xa49f('0xf')][_0xa49f('0x10')]);return _0x3327f7(_0x32ec9a[_0xa49f('0xf')][_0xa49f('0x10')]);}else{logger['info'](_0xa49f('0xb'),_0x59030f,_0xa49f('0xc'));_0x3327f7(_0x32ec9a[_0xa49f('0x11')]['message']);}})[_0xa49f('0x12')](function(_0x2d34e4){logger['error'](_0xa49f('0xb'),_0x59030f,_0x2d34e4);_0x313419(_0x2d34e4);});});}
\ No newline at end of file
+var _0xa25c=['util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','request\x20sent','debug','UserOpenchannelQueue,\x20%s,\x20%s,\x20%s','error','code','UserOpenchannelQueue,\x20%s,\x20%s','message','result','catch','lodash'];(function(_0x56625d,_0x12e6e9){var _0x3bf11b=function(_0x53294d){while(--_0x53294d){_0x56625d['push'](_0x56625d['shift']());}};_0x3bf11b(++_0x12e6e9);}(_0xa25c,0x113));var _0xca25=function(_0x19cbac,_0x4a7597){_0x19cbac=_0x19cbac-0x0;var _0x180da3=_0xa25c[_0x19cbac];return _0x180da3;};'use strict';var _=require(_0xca25('0x0'));var util=require(_0xca25('0x1'));var moment=require(_0xca25('0x2'));var BPromise=require(_0xca25('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xca25('0x4'));var db=require(_0xca25('0x5'))['db'];var utils=require(_0xca25('0x6'));var logger=require(_0xca25('0x7'))(_0xca25('0x8'));var config=require(_0xca25('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xca25('0xa')][_0xca25('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x53cf9a,_0x4d1727,_0x167d50){return new BPromise(function(_0x241d07,_0x38bae2){return client[_0xca25('0xc')](_0x53cf9a,_0x167d50)[_0xca25('0xd')](function(_0x4360a5){logger['info']('UserOpenchannelQueue,\x20%s,\x20%s',_0x4d1727,_0xca25('0xe'));logger[_0xca25('0xf')](_0xca25('0x10'),_0x4d1727,_0xca25('0xe'),JSON['stringify'](_0x4360a5));if(_0x4360a5['error']){if(_0x4360a5[_0xca25('0x11')][_0xca25('0x12')]===0x1f4){logger[_0xca25('0x11')](_0xca25('0x13'),_0x4d1727,_0x4360a5[_0xca25('0x11')][_0xca25('0x14')]);return _0x38bae2(_0x4360a5[_0xca25('0x11')][_0xca25('0x14')]);}logger['error']('UserOpenchannelQueue,\x20%s,\x20%s',_0x4d1727,_0x4360a5[_0xca25('0x11')][_0xca25('0x14')]);return _0x241d07(_0x4360a5[_0xca25('0x11')][_0xca25('0x14')]);}else{logger['info'](_0xca25('0x13'),_0x4d1727,_0xca25('0xe'));_0x241d07(_0x4360a5[_0xca25('0x15')]['message']);}})[_0xca25('0x16')](function(_0x299d37){logger[_0xca25('0x11')](_0xca25('0x13'),_0x4d1727,_0x299d37);_0x38bae2(_0x299d37);});});}
\ No newline at end of file
diff --git a/server/api/userProfile/index.js b/server/api/userProfile/index.js
index c586712..e26c406 100644
--- a/server/api/userProfile/index.js
+++ b/server/api/userProfile/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x5973=['destroy','/:id/sections','removeSections','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./userProfile.controller','get','isAuthenticated','index','/describe','/:id','show','getSections','/:id/resources','getResources','post','create','addSections','addResources','update','delete'];(function(_0x4f77af,_0x5f5793){var _0x254a93=function(_0xff2b57){while(--_0xff2b57){_0x4f77af['push'](_0x4f77af['shift']());}};_0x254a93(++_0x5f5793);}(_0x5973,0x100));var _0x3597=function(_0x51c578,_0x4cb9bb){_0x51c578=_0x51c578-0x0;var _0x59d490=_0x5973[_0x51c578];return _0x59d490;};'use strict';var multer=require(_0x3597('0x0'));var util=require(_0x3597('0x1'));var path=require(_0x3597('0x2'));var timeout=require(_0x3597('0x3'));var express=require(_0x3597('0x4'));var router=express[_0x3597('0x5')]();var auth=require(_0x3597('0x6'));var interaction=require(_0x3597('0x7'));var config=require('../../config/environment');var controller=require(_0x3597('0x8'));router[_0x3597('0x9')]('/',auth[_0x3597('0xa')](),controller[_0x3597('0xb')]);router[_0x3597('0x9')](_0x3597('0xc'),auth[_0x3597('0xa')](),controller['describe']);router[_0x3597('0x9')](_0x3597('0xd'),auth[_0x3597('0xa')](),controller[_0x3597('0xe')]);router[_0x3597('0x9')]('/:id/sections',auth[_0x3597('0xa')](),controller[_0x3597('0xf')]);router[_0x3597('0x9')](_0x3597('0x10'),auth[_0x3597('0xa')](),controller[_0x3597('0x11')]);router[_0x3597('0x12')]('/',auth[_0x3597('0xa')](),controller[_0x3597('0x13')]);router[_0x3597('0x12')]('/:id/clone',auth[_0x3597('0xa')](),controller['clone']);router[_0x3597('0x12')]('/:id/sections',auth[_0x3597('0xa')](),controller[_0x3597('0x14')]);router[_0x3597('0x12')](_0x3597('0x10'),auth[_0x3597('0xa')](),controller[_0x3597('0x15')]);router['put'](_0x3597('0xd'),auth[_0x3597('0xa')](),controller[_0x3597('0x16')]);router[_0x3597('0x17')]('/:id',auth[_0x3597('0xa')](),controller[_0x3597('0x18')]);router[_0x3597('0x17')](_0x3597('0x19'),auth[_0x3597('0xa')](),controller[_0x3597('0x1a')]);router[_0x3597('0x17')](_0x3597('0x10'),auth[_0x3597('0xa')](),controller['removeResources']);module[_0x3597('0x1b')]=router;
\ No newline at end of file
+var _0x081e=['show','/:id/sections','getSections','/:id/resources','getResources','create','post','/:id/clone','clone','addSections','addResources','put','update','destroy','delete','removeSections','removeResources','exports','multer','util','express','Router','../../components/auth/service','get','isAuthenticated','index','describe','/:id'];(function(_0x6cf19c,_0x2f3f02){var _0xce14f3=function(_0x474587){while(--_0x474587){_0x6cf19c['push'](_0x6cf19c['shift']());}};_0xce14f3(++_0x2f3f02);}(_0x081e,0x162));var _0xe081=function(_0x58e504,_0x8ec848){_0x58e504=_0x58e504-0x0;var _0x31917f=_0x081e[_0x58e504];return _0x31917f;};'use strict';var multer=require(_0xe081('0x0'));var util=require(_0xe081('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xe081('0x2'));var router=express[_0xe081('0x3')]();var auth=require(_0xe081('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./userProfile.controller');router[_0xe081('0x5')]('/',auth[_0xe081('0x6')](),controller[_0xe081('0x7')]);router['get']('/describe',auth[_0xe081('0x6')](),controller[_0xe081('0x8')]);router[_0xe081('0x5')](_0xe081('0x9'),auth[_0xe081('0x6')](),controller[_0xe081('0xa')]);router['get'](_0xe081('0xb'),auth[_0xe081('0x6')](),controller[_0xe081('0xc')]);router[_0xe081('0x5')](_0xe081('0xd'),auth[_0xe081('0x6')](),controller[_0xe081('0xe')]);router['post']('/',auth[_0xe081('0x6')](),controller[_0xe081('0xf')]);router[_0xe081('0x10')](_0xe081('0x11'),auth[_0xe081('0x6')](),controller[_0xe081('0x12')]);router[_0xe081('0x10')](_0xe081('0xb'),auth[_0xe081('0x6')](),controller[_0xe081('0x13')]);router[_0xe081('0x10')](_0xe081('0xd'),auth[_0xe081('0x6')](),controller[_0xe081('0x14')]);router[_0xe081('0x15')]('/:id',auth[_0xe081('0x6')](),controller[_0xe081('0x16')]);router['delete'](_0xe081('0x9'),auth[_0xe081('0x6')](),controller[_0xe081('0x17')]);router[_0xe081('0x18')](_0xe081('0xb'),auth[_0xe081('0x6')](),controller[_0xe081('0x19')]);router[_0xe081('0x18')](_0xe081('0xd'),auth[_0xe081('0x6')](),controller[_0xe081('0x1a')]);module[_0xe081('0x1b')]=router;
\ No newline at end of file
diff --git a/server/api/userProfile/userProfile.attributes.js b/server/api/userProfile/userProfile.attributes.js
index 30f45c5..0906bc0 100644
--- a/server/api/userProfile/userProfile.attributes.js
+++ b/server/api/userProfile/userProfile.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xf2b6=['sequelize','exports','STRING','name','setDataValue','getDataValue','crudPermissions','split'];(function(_0x4fcbcc,_0x2bb417){var _0x3c7610=function(_0x37b231){while(--_0x37b231){_0x4fcbcc['push'](_0x4fcbcc['shift']());}};_0x3c7610(++_0x2bb417);}(_0xf2b6,0x178));var _0x6f2b=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0xf2b6[_0x397e5f];return _0x5302b8;};'use strict';var Sequelize=require(_0x6f2b('0x0'));module[_0x6f2b('0x1')]={'name':{'type':Sequelize[_0x6f2b('0x2')],'allowNull':![],'unique':_0x6f2b('0x3')},'crudPermissions':{'type':Sequelize[_0x6f2b('0x2')],'set':function(_0x5164ac){this[_0x6f2b('0x4')]('crudPermissions',_0x5164ac?_0x5164ac['join'](''):[]);},'get':function(){return this[_0x6f2b('0x5')]('crudPermissions')?this[_0x6f2b('0x5')](_0x6f2b('0x6'))[_0x6f2b('0x7')](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize['STRING'],'allowNull':!![]}};
\ No newline at end of file
+var _0x0fda=['getDataValue','crudPermissions','sequelize','exports','STRING','name','setDataValue'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x0fda,0x64));var _0xa0fd=function(_0x95373c,_0x28dab9){_0x95373c=_0x95373c-0x0;var _0x43981b=_0x0fda[_0x95373c];return _0x43981b;};'use strict';var Sequelize=require(_0xa0fd('0x0'));module[_0xa0fd('0x1')]={'name':{'type':Sequelize[_0xa0fd('0x2')],'allowNull':![],'unique':_0xa0fd('0x3')},'crudPermissions':{'type':Sequelize[_0xa0fd('0x2')],'set':function(_0x3fde20){this[_0xa0fd('0x4')]('crudPermissions',_0x3fde20?_0x3fde20['join'](''):[]);},'get':function(){return this[_0xa0fd('0x5')](_0xa0fd('0x6'))?this['getDataValue']('crudPermissions')['split'](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize[_0xa0fd('0x2')],'allowNull':!![]}};
\ No newline at end of file
diff --git a/server/api/userProfile/userProfile.controller.js b/server/api/userProfile/userProfile.controller.js
index b1cb3cc..36952b6 100644
--- a/server/api/userProfile/userProfile.controller.js
+++ b/server/api/userProfile/userProfile.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x14da=['bulkCreate','removeResources','getResources','section','undefined','Sequelize','ValidationError','Unknown\x20section','childModel','Invalid\x20section\x20\x27','parentSections','findOne','all','union','ignore','filters','field','AnalyticExtractedReport','associatedResources','foreignKey','reportType','DefaultReports','custom','reportId','CustomReports','CmContact','Tag','Tags','color','tag','ThroughTags','value','toLowerCase','squareprojects','SquareProject','odbc','SquareOdbc','SquareRecording','projectName','projects','JscriptyProject','contacts','ListId','lists','CmList','companies','CmCompany','CmCustomField','chatqueues','chatwebsites','ChatWebsite','faxqueues','FaxQueue','faxaccounts','FaxAccount','inboundroutes','outboundroutes','VoiceExtension','contexts','voicemails','VoiceMail','membername','User','role','Telephones','VoiceQueues','queue','inbound','QueueCampaigns','VoiceQueue','outbound','musiconholds','VoiceMusicOnHold','chanspies','VoiceChanSpy','voiceprefixes','VoicePrefix','ivrcampaigns','Campaign','mailqueues','mailsubstatuses','openchannelqueues','openchannelaccounts','OpenchannelAccount','smsqueues','SmsQueue','smsaccounts','SmsAccount','whatsappqueues','WhatsappQueue','whatsappaccounts','WhatsappAccount','Team','voicequeues','queuecampaigns','users','agents','Users','admin','user','Agents','zendeskaccounts','ZendeskAccount','salesforceaccounts','SalesforceAccount','freshdeskaccounts','sugarcrmaccounts','SugarcrmAccount','DeskAccount','zohoaccounts','ZohoAccount','vtigeraccounts','CannedAnswer','Disposition','customdashboards','intervals','Interval','pauses','Pause','scheduler','sounds','Sound','tags','Template','triggers','trunks','Trunk','variables','Variable','plugins','extractedreports','Reports','metrics','AnalyticMetric','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','defaults','redis','localhost','socket.io-emitter','register','status','end','json','count','offset','limit','set','Content-Range','apply','save','update','then','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','UserProfile','includeAll','include','findAll','rows','catch','show','create','body','clone','params','find','get','omit','createdAt','updatedAt','crudPermissions','sequelize','transaction','UserProfileSection','each','autoAssociation','UserProfileResource','sectionId','userProfileId','Resources','destroy','describe','addSections','push','removeSections','ids','getSections','enabled','includes','isEmpty','subsections','Dashboard','forEach','resourceId','Plugin','addResources'];(function(_0x2cc9e5,_0x3a797f){var _0x589d4c=function(_0x7adde6){while(--_0x7adde6){_0x2cc9e5['push'](_0x2cc9e5['shift']());}};_0x589d4c(++_0x3a797f);}(_0x14da,0x86));var _0xa14d=function(_0x14f8ef,_0x1b1107){_0x14f8ef=_0x14f8ef-0x0;var _0x3b97f6=_0x14da[_0x14f8ef];return _0x3b97f6;};'use strict';var pdf=require(_0xa14d('0x0'));var emlformat=require(_0xa14d('0x1'));var rimraf=require(_0xa14d('0x2'));var zipdir=require(_0xa14d('0x3'));var jsonpatch=require(_0xa14d('0x4'));var rp=require(_0xa14d('0x5'));var moment=require(_0xa14d('0x6'));var BPromise=require(_0xa14d('0x7'));var Mustache=require(_0xa14d('0x8'));var util=require(_0xa14d('0x9'));var path=require(_0xa14d('0xa'));var sox=require('sox');var csv=require(_0xa14d('0xb'));var ejs=require(_0xa14d('0xc'));var fs=require('fs');var _=require('lodash');var squel=require(_0xa14d('0xd'));var crypto=require(_0xa14d('0xe'));var jsforce=require(_0xa14d('0xf'));var deskjs=require(_0xa14d('0x10'));var toCsv=require(_0xa14d('0xb'));var querystring=require(_0xa14d('0x11'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xa14d('0x12'));var as=require(_0xa14d('0x13'));var hardwareService=require(_0xa14d('0x14'));var logger=require(_0xa14d('0x15'))('api');var utils=require(_0xa14d('0x16'));var config=require(_0xa14d('0x17'));var db=require(_0xa14d('0x18'))['db'];config['redis']=_[_0xa14d('0x19')](config[_0xa14d('0x1a')],{'host':_0xa14d('0x1b'),'port':0x18eb});var socket=require(_0xa14d('0x1c'))(new Redis(config['redis']));require('./userProfile.socket')[_0xa14d('0x1d')](socket);function respondWithStatusCode(_0x1d9ce5,_0x5c5eb8){_0x5c5eb8=_0x5c5eb8||0xcc;return function(_0x120b77){if(_0x120b77){return _0x1d9ce5['sendStatus'](_0x5c5eb8);}return _0x1d9ce5[_0xa14d('0x1e')](_0x5c5eb8)[_0xa14d('0x1f')]();};}function respondWithResult(_0x13403f,_0x182405){_0x182405=_0x182405||0xc8;return function(_0x327254){if(_0x327254){return _0x13403f['status'](_0x182405)[_0xa14d('0x20')](_0x327254);}};}function respondWithFilteredResult(_0x44f0d4,_0x5b277e){return function(_0x1c041c){if(_0x1c041c){var _0x132e68=_0x1c041c[_0xa14d('0x21')],_0x4be14d=_0x5b277e[_0xa14d('0x22')],_0x59bc86=_0x5b277e[_0xa14d('0x22')]+_0x5b277e[_0xa14d('0x23')],_0x357446;if(_0x59bc86>=_0x132e68){_0x59bc86=_0x132e68;_0x357446=0xc8;}else{_0x357446=0xce;}_0x44f0d4[_0xa14d('0x1e')](_0x357446);return _0x44f0d4[_0xa14d('0x24')](_0xa14d('0x25'),_0x4be14d+'-'+_0x59bc86+'/'+_0x132e68)[_0xa14d('0x20')](_0x1c041c);}return null;};}function patchUpdates(_0x282d91){return function(_0x39d4bf){try{jsonpatch[_0xa14d('0x26')](_0x39d4bf,_0x282d91,!![]);}catch(_0x1fe020){return BPromise['reject'](_0x1fe020);}return _0x39d4bf[_0xa14d('0x27')]();};}function saveUpdates(_0x4c0c48,_0x3e5739){return function(_0x47964f){if(_0x47964f){return _0x47964f[_0xa14d('0x28')](_0x4c0c48)[_0xa14d('0x29')](function(_0x4fafef){return _0x4fafef;});}return null;};}function removeEntity(_0x1f4600,_0x162b92){return function(_0x5d826b){if(_0x5d826b){return _0x5d826b['destroy']()[_0xa14d('0x29')](function(){_0x1f4600[_0xa14d('0x1e')](0xcc)[_0xa14d('0x1f')]();});}};}function handleEntityNotFound(_0x50175f,_0x28dbf7){return function(_0x207f92){if(!_0x207f92){_0x50175f['sendStatus'](0x194);}return _0x207f92;};}function handleError(_0x174faa,_0x4a0467){_0x4a0467=_0x4a0467||0x1f4;return function(_0x1cd2f2){logger[_0xa14d('0x2a')](_0x1cd2f2[_0xa14d('0x2b')]);if(_0x1cd2f2['name']){delete _0x1cd2f2[_0xa14d('0x2c')];}_0x174faa['status'](_0x4a0467)[_0xa14d('0x2d')](_0x1cd2f2);};}exports[_0xa14d('0x2e')]=function(_0x55b11a,_0x278651){var _0x3328f7={},_0x286c3e={},_0x709660={'count':0x0,'rows':[]};var _0x19964c=_[_0xa14d('0x2f')](db['UserProfile'][_0xa14d('0x30')],function(_0x123723){return{'name':_0x123723[_0xa14d('0x31')],'type':_0x123723[_0xa14d('0x32')][_0xa14d('0x33')]};});_0x286c3e[_0xa14d('0x34')]=_['map'](_0x19964c,_0xa14d('0x2c'));_0x286c3e[_0xa14d('0x35')]=_[_0xa14d('0x36')](_0x55b11a[_0xa14d('0x35')]);_0x286c3e['filters']=_[_0xa14d('0x37')](_0x286c3e['model'],_0x286c3e[_0xa14d('0x35')]);_0x3328f7['attributes']=_['intersection'](_0x286c3e[_0xa14d('0x34')],qs[_0xa14d('0x38')](_0x55b11a[_0xa14d('0x35')][_0xa14d('0x38')]));_0x3328f7[_0xa14d('0x39')]=_0x3328f7[_0xa14d('0x39')][_0xa14d('0x3a')]?_0x3328f7[_0xa14d('0x39')]:_0x286c3e[_0xa14d('0x34')];if(!_0x55b11a[_0xa14d('0x35')][_0xa14d('0x3b')](_0xa14d('0x3c'))){_0x3328f7[_0xa14d('0x23')]=qs[_0xa14d('0x23')](_0x55b11a[_0xa14d('0x35')]['limit']);_0x3328f7['offset']=qs[_0xa14d('0x22')](_0x55b11a[_0xa14d('0x35')][_0xa14d('0x22')]);}_0x3328f7[_0xa14d('0x3d')]=qs[_0xa14d('0x3e')](_0x55b11a[_0xa14d('0x35')][_0xa14d('0x3e')]);_0x3328f7[_0xa14d('0x3f')]=qs['filters'](_[_0xa14d('0x40')](_0x55b11a['query'],_0x286c3e['filters']),_0x19964c);if(_0x55b11a['query'][_0xa14d('0x41')]){_0x3328f7[_0xa14d('0x3f')]=_[_0xa14d('0x42')](_0x3328f7[_0xa14d('0x3f')],{'$or':_[_0xa14d('0x2f')](_0x19964c,function(_0x203af8){if(_0x203af8[_0xa14d('0x32')]!==_0xa14d('0x43')){var _0x1c50b4={};_0x1c50b4[_0x203af8['name']]={'$like':'%'+_0x55b11a[_0xa14d('0x35')][_0xa14d('0x41')]+'%'};return _0x1c50b4;}})});}_0x3328f7=_[_0xa14d('0x42')]({},_0x3328f7,_0x55b11a[_0xa14d('0x44')]);var _0x3ce833={'where':_0x3328f7['where']};return db[_0xa14d('0x45')][_0xa14d('0x21')](_0x3ce833)[_0xa14d('0x29')](function(_0x32f26c){_0x709660[_0xa14d('0x21')]=_0x32f26c;if(_0x55b11a[_0xa14d('0x35')][_0xa14d('0x46')]){_0x3328f7[_0xa14d('0x47')]=[{'all':!![]}];}return db[_0xa14d('0x45')][_0xa14d('0x48')](_0x3328f7);})[_0xa14d('0x29')](function(_0xc2880){_0x709660[_0xa14d('0x49')]=_0xc2880;return _0x709660;})['then'](respondWithFilteredResult(_0x278651,_0x3328f7))[_0xa14d('0x4a')](handleError(_0x278651,null));};exports[_0xa14d('0x4b')]=function(_0x33bf34,_0xb02050){var _0x3b97be={'raw':![],'where':{'id':_0x33bf34['params']['id']}},_0x3ed14b={};_0x3ed14b['model']=_[_0xa14d('0x36')](db[_0xa14d('0x45')]['rawAttributes']);_0x3ed14b[_0xa14d('0x35')]=_[_0xa14d('0x36')](_0x33bf34[_0xa14d('0x35')]);_0x3ed14b['filters']=_[_0xa14d('0x37')](_0x3ed14b[_0xa14d('0x34')],_0x3ed14b['query']);_0x3b97be[_0xa14d('0x39')]=_['intersection'](_0x3ed14b['model'],qs[_0xa14d('0x38')](_0x33bf34[_0xa14d('0x35')][_0xa14d('0x38')]));_0x3b97be['attributes']=_0x3b97be[_0xa14d('0x39')][_0xa14d('0x3a')]?_0x3b97be[_0xa14d('0x39')]:_0x3ed14b[_0xa14d('0x34')];if(_0x33bf34[_0xa14d('0x35')][_0xa14d('0x46')]){_0x3b97be[_0xa14d('0x47')]=[{'all':!![]}];}_0x3b97be=_[_0xa14d('0x42')]({},_0x3b97be,_0x33bf34[_0xa14d('0x44')]);return db[_0xa14d('0x45')]['find'](_0x3b97be)[_0xa14d('0x29')](handleEntityNotFound(_0xb02050,null))['then'](respondWithResult(_0xb02050,null))[_0xa14d('0x4a')](handleError(_0xb02050,null));};exports[_0xa14d('0x4c')]=function(_0x2f0a8d,_0x50083a){return db[_0xa14d('0x45')][_0xa14d('0x4c')](_0x2f0a8d[_0xa14d('0x4d')],{})[_0xa14d('0x29')](respondWithResult(_0x50083a,0xc9))['catch'](handleError(_0x50083a,null));};exports[_0xa14d('0x4e')]=function(_0x54e9c6,_0x16af76){var _0x20e00a={'where':{'id':_0x54e9c6[_0xa14d('0x4f')]['id']}},_0x248833={};_0x248833[_0xa14d('0x34')]=_['keys'](db[_0xa14d('0x45')]['rawAttributes']);_0x20e00a['attributes']=_[_0xa14d('0x37')](_0x248833[_0xa14d('0x34')],qs[_0xa14d('0x38')](_0x54e9c6[_0xa14d('0x35')]['fields']));_0x20e00a[_0xa14d('0x39')]=_0x20e00a['attributes'][_0xa14d('0x3a')]?_0x20e00a['attributes']:_0x248833[_0xa14d('0x34')];if(_0x54e9c6[_0xa14d('0x35')][_0xa14d('0x46')]){_0x20e00a[_0xa14d('0x47')]=[{'all':!![]}];}_0x20e00a=_[_0xa14d('0x42')]({},_0x20e00a,_0x54e9c6[_0xa14d('0x44')]);return db[_0xa14d('0x45')][_0xa14d('0x50')](_0x20e00a)[_0xa14d('0x29')](handleEntityNotFound(_0x16af76,null))[_0xa14d('0x29')](function(_0x2a9241){if(_0x2a9241){var _0x337c1d=_0x2a9241[_0xa14d('0x51')]({'plain':!![]});_0x337c1d=qs[_0xa14d('0x52')](_0x337c1d,['id',_0xa14d('0x53'),_0xa14d('0x54'),_0xa14d('0x55')]);_0x54e9c6['body']=_[_0xa14d('0x52')](_0x54e9c6[_0xa14d('0x4d')],['id',_0xa14d('0x53'),'updatedAt']);return db[_0xa14d('0x56')][_0xa14d('0x57')](function(_0x3ee463){return db[_0xa14d('0x45')][_0xa14d('0x4c')](_[_0xa14d('0x42')](_0x337c1d,_0x54e9c6['body']),{'include':_0x54e9c6[_0xa14d('0x35')][_0xa14d('0x46')]?[{'all':!![]}]:undefined,'transaction':_0x3ee463})['then'](function(_0x1cd7a5){var _0x45adaf=_0x1cd7a5[_0xa14d('0x51')]({'plain':!![]});return db[_0xa14d('0x58')][_0xa14d('0x48')]({'where':{'userProfileId':_0x54e9c6[_0xa14d('0x4f')]['id']},'raw':!![]})['then'](function(_0x2e1fc3){if(_0x2e1fc3){return BPromise[_0xa14d('0x59')](_0x2e1fc3,function(_0xc72668){return new BPromise(function(_0x277174,_0x14b022){if(_0xc72668[_0xa14d('0x5a')]===null||_0xc72668['autoAssociation']===0x1)_0x277174(null);return db[_0xa14d('0x5b')][_0xa14d('0x48')]({'where':{'sectionId':_0xc72668['id']},'raw':!![]})[_0xa14d('0x29')](function(_0x878c88){var _0x28c274=_['map'](_0x878c88,function(_0x8f787){return qs[_0xa14d('0x52')](_0x8f787,['id',_0xa14d('0x53'),_0xa14d('0x54'),_0xa14d('0x5c')]);});_0x277174(_0x28c274);})[_0xa14d('0x4a')](function(_0x51ffea){_0x14b022(_0x51ffea);});})[_0xa14d('0x29')](function(_0x39adf6){var _0x2e7392=qs[_0xa14d('0x52')](_0xc72668,['id',_0xa14d('0x53'),_0xa14d('0x54')]);_0x2e7392[_0xa14d('0x5d')]=_0x45adaf['id'];if(_0x39adf6)_0x2e7392[_0xa14d('0x5e')]=_0x39adf6;return _0x2e7392;})[_0xa14d('0x29')](function(_0x34fd15){return db[_0xa14d('0x58')][_0xa14d('0x4c')](_0x34fd15,{'include':[{'model':db[_0xa14d('0x5b')],'as':_0xa14d('0x5e')}],'raw':!![],'transaction':_0x3ee463});});})['then'](function(){return _0x45adaf;});}});});});}})[_0xa14d('0x29')](respondWithResult(_0x16af76,0xc9))[_0xa14d('0x4a')](handleError(_0x16af76,null));};exports[_0xa14d('0x28')]=function(_0x49efc9,_0x2d6b32){if(_0x49efc9[_0xa14d('0x4d')]['id']){delete _0x49efc9['body']['id'];}return db[_0xa14d('0x45')][_0xa14d('0x50')]({'where':{'id':_0x49efc9['params']['id']}})[_0xa14d('0x29')](handleEntityNotFound(_0x2d6b32,null))[_0xa14d('0x29')](saveUpdates(_0x49efc9[_0xa14d('0x4d')],null))[_0xa14d('0x29')](respondWithResult(_0x2d6b32,null))[_0xa14d('0x4a')](handleError(_0x2d6b32,null));};exports[_0xa14d('0x5f')]=function(_0x161a47,_0x4be96a){return db['UserProfile']['find']({'where':{'id':_0x161a47[_0xa14d('0x4f')]['id']}})[_0xa14d('0x29')](handleEntityNotFound(_0x4be96a,null))[_0xa14d('0x29')](removeEntity(_0x4be96a,null))[_0xa14d('0x4a')](handleError(_0x4be96a,null));};exports[_0xa14d('0x60')]=function(_0x1507ba,_0xbd1fc0){return db[_0xa14d('0x45')][_0xa14d('0x60')]()[_0xa14d('0x29')](respondWithResult(_0xbd1fc0,null))[_0xa14d('0x4a')](handleError(_0xbd1fc0,null));};exports[_0xa14d('0x61')]=function(_0x5a080e,_0x4b165c){var _0x365f64=_0x5a080e[_0xa14d('0x4d')];return db['UserProfile'][_0xa14d('0x50')]({'where':{'id':_0x5a080e['params']['id']}})[_0xa14d('0x29')](handleEntityNotFound(_0x4b165c,null))['then'](function(_0x3f676c){if(_0x3f676c){return db[_0xa14d('0x56')]['transaction'](function(_0x36c0bb){return db[_0xa14d('0x58')]['destroy']({'where':{'userProfileId':_0x5a080e[_0xa14d('0x4f')]['id'],'sectionId':_[_0xa14d('0x2f')](_0x365f64,function(_0x1c90f0){return _0x1c90f0[_0xa14d('0x5c')];})},'transaction':_0x36c0bb})[_0xa14d('0x29')](function(){var _0x259f10=_[_0xa14d('0x2f')](_0x365f64,function(_0xb32b89){_0xb32b89[_0xa14d('0x5d')]=_0x5a080e[_0xa14d('0x4f')]['id'];return _0xb32b89;});var _0xf5cf03=[];return BPromise[_0xa14d('0x59')](_0x259f10,function(_0xa9fb5e){return db[_0xa14d('0x58')][_0xa14d('0x4c')](_0xa9fb5e,{'include':[{'model':db[_0xa14d('0x5b')],'as':'Resources'}],'raw':!![],'transaction':_0x36c0bb})[_0xa14d('0x29')](function(_0x1729b3){_0xf5cf03[_0xa14d('0x62')](_0x1729b3[_0xa14d('0x51')]({'plain':!![]}));});})[_0xa14d('0x29')](function(){return _0xf5cf03;});});});}})[_0xa14d('0x29')](function(_0x1ba9f0){return _0x1ba9f0;})[_0xa14d('0x29')](respondWithResult(_0x4b165c,null))[_0xa14d('0x4a')](handleError(_0x4b165c,null));};exports[_0xa14d('0x63')]=function(_0x569d31,_0x201317){var _0x264f04;return db[_0xa14d('0x45')][_0xa14d('0x50')]({'where':{'id':_0x569d31['params']['id']},'attributes':['id',_0xa14d('0x2c')]})[_0xa14d('0x29')](handleEntityNotFound(_0x201317,null))[_0xa14d('0x29')](function(_0xb820c8){if(_0xb820c8){_0x264f04=_0xb820c8;return db['UserProfileSection']['destroy']({'where':{'userProfileId':_0x569d31[_0xa14d('0x4f')]['id'],'sectionId':_0x569d31[_0xa14d('0x35')][_0xa14d('0x64')]}});}})[_0xa14d('0x29')](function(){return _0x264f04;})['then'](respondWithStatusCode(_0x201317,null))['catch'](handleError(_0x201317,null));};exports[_0xa14d('0x65')]=function(_0x322f75,_0x42bea6){var _0x2b1cdb=[];var _0x37732d=[];return db[_0xa14d('0x58')]['findAll']({'where':{'userProfileId':_0x322f75[_0xa14d('0x4f')]['id']},'raw':!![]})[_0xa14d('0x29')](function(_0x2a0098){_0x2b1cdb=_['filter'](_0x2a0098,function(_0x349985){return _0x349985[_0xa14d('0x66')]===0x1||_[_0xa14d('0x67')]([0x3eb,0x709],_0x349985[_0xa14d('0x5c')]);});if(!_[_0xa14d('0x68')](_0x2b1cdb)){return _[_0xa14d('0x2f')](_0x2b1cdb,function(_0x3f5746){return _0x3f5746[_0xa14d('0x5c')];});}else{return;}})['then'](function(_0x22052f){if(_0x22052f)_0x37732d=_0x22052f;if(_[_0xa14d('0x67')](_0x37732d,0x64)){var _0x5fd348=_[_0xa14d('0x50')](_0x2b1cdb,{'sectionId':0x64});return hasDefaultDashboard(_0x5fd348)[_0xa14d('0x29')](function(_0x1d9e1e){return _[_0xa14d('0x2f')](_0x2b1cdb,function(_0x2b0315){if(_0x2b0315[_0xa14d('0x5c')]===0x64){_0x2b0315[_0xa14d('0x69')]=_0x1d9e1e;}return _0x2b0315;});});}else{return;}})[_0xa14d('0x29')](function(_0x241eae){if(_0x241eae)_0x2b1cdb=_0x241eae;if(_[_0xa14d('0x67')](_0x37732d,0x3eb)){var _0x1caea8=_[_0xa14d('0x50')](_0x2b1cdb,{'sectionId':0x3eb});return getCustomDashboards(_0x1caea8)[_0xa14d('0x29')](function(_0x270e5a){return _[_0xa14d('0x2f')](_0x2b1cdb,function(_0x5c8e9a){if(_0x1caea8['enabled']){if(_0x5c8e9a[_0xa14d('0x5c')]===0x3eb){_0x5c8e9a['subsections']=_0x270e5a;}}else{if(_0x5c8e9a['sectionId']===0x64){_0x5c8e9a[_0xa14d('0x69')]=_0x270e5a;}}return _0x5c8e9a;});});}else{return;}})[_0xa14d('0x29')](function(_0x8ffa38){if(_0x8ffa38)_0x2b1cdb=_0x8ffa38;if(_[_0xa14d('0x67')](_0x37732d,0x709)){var _0xcece99=_[_0xa14d('0x50')](_0x2b1cdb,{'sectionId':0x709});return getPlugins(_0xcece99)[_0xa14d('0x29')](function(_0x571988){if(_0xcece99['enabled']){return _['map'](_0x2b1cdb,function(_0x3bb030){if(_0x3bb030[_0xa14d('0x5c')]===0x709){_0x3bb030['subsections']=_0x571988;}return _0x3bb030;});}else{var _0x55bbeb={'sectionId':0x76c,'enabled':0x1,'subsections':_0x571988};var _0x51f05d=_[_0xa14d('0x2f')](_0x2b1cdb);_0x51f05d[_0xa14d('0x62')](_0x55bbeb);return _0x51f05d;}});}else{return;}})[_0xa14d('0x29')](function(_0x1644cf){if(_0x1644cf)_0x2b1cdb=_0x1644cf;return _[_0xa14d('0x41')](_0x2b1cdb,['enabled',0x1]);})[_0xa14d('0x29')](respondWithResult(_0x42bea6,null))[_0xa14d('0x4a')](handleError(_0x42bea6,null));};function hasDefaultDashboard(_0x9995a5){var _0x259a37=[0x65];return new BPromise(function(_0x1a786f,_0x5624d5){try{if(_0x9995a5[_0xa14d('0x5a')]){_0x1a786f(_0x259a37);}else{return db[_0xa14d('0x5b')]['findOne']({'where':{'sectionId':_0x9995a5['id']},'raw':!![]})['then'](function(_0xad9b8b){_0xad9b8b?_0x1a786f(_0x259a37):_0x1a786f();});}}catch(_0x5219ad){_0x5624d5(_0x5219ad);}});}function getCustomDashboards(_0x57a91f){var _0x42bfc9=[];return new BPromise(function(_0x7883c7,_0x260ba6){try{if(_0x57a91f[_0xa14d('0x5a')]){return db[_0xa14d('0x6a')]['findAll']({'raw':!![]})[_0xa14d('0x29')](function(_0x299f09){_0x299f09[_0xa14d('0x6b')](function(_0x5e93ca){_0x42bfc9[_0xa14d('0x62')](_0x5e93ca['id']+0x1869f);});_0x7883c7(_0x42bfc9);});}else{return db['UserProfileResource']['findAll']({'where':{'sectionId':_0x57a91f['id']},'raw':!![]})['then'](function(_0x136ade){_0x136ade[_0xa14d('0x6b')](function(_0x544237){_0x42bfc9[_0xa14d('0x62')](_0x544237[_0xa14d('0x6c')]+0x1869f);});_0x7883c7(_0x42bfc9);});}}catch(_0x293c89){_0x260ba6(_0x293c89);}});}function getPlugins(_0x23e4ec){var _0x40fe7f=[];return new BPromise(function(_0x48b516,_0x376a77){try{if(_0x23e4ec[_0xa14d('0x5a')]){return db[_0xa14d('0x6d')]['findAll']({'raw':!![]})[_0xa14d('0x29')](function(_0xf98b11){_0xf98b11[_0xa14d('0x6b')](function(_0x500877){_0x40fe7f[_0xa14d('0x62')](_0x500877['id']+0x15b38);});_0x48b516(_0x40fe7f);});}else{return db[_0xa14d('0x5b')]['findAll']({'where':{'sectionId':_0x23e4ec['id']},'raw':!![]})[_0xa14d('0x29')](function(_0x2a2a75){_0x2a2a75[_0xa14d('0x6b')](function(_0x506f0c){_0x40fe7f['push'](_0x506f0c[_0xa14d('0x6c')]+0x15b38);});_0x48b516(_0x40fe7f);});}}catch(_0x20715e){_0x376a77(_0x20715e);}});}exports[_0xa14d('0x6e')]=function(_0x4dbef3,_0x3f014e){return db[_0xa14d('0x45')][_0xa14d('0x50')]({'where':{'id':_0x4dbef3['params']['id']}})['then'](handleEntityNotFound(_0x3f014e,null))[_0xa14d('0x29')](function(_0x5e37aa){if(_0x5e37aa){return db[_0xa14d('0x56')][_0xa14d('0x57')](function(_0x19271d){return db[_0xa14d('0x58')][_0xa14d('0x48')]({'where':{'userProfileId':_0x4dbef3[_0xa14d('0x4f')]['id']},'attributes':['id'],'raw':!![]})[_0xa14d('0x29')](function(_0x3d4164){if(_0x3d4164){return db[_0xa14d('0x58')]['destroy']({'where':{'userProfileId':_0x4dbef3[_0xa14d('0x4f')]['id'],'id':_[_0xa14d('0x2f')](_0x3d4164,function(_0x5594e5){return _0x5594e5['id'];})},'transaction':_0x19271d});}})['then'](function(_0x170341){var _0x5bb988=_[_0xa14d('0x2f')](_0x4dbef3[_0xa14d('0x4d')],function(_0x49d0e5){_0x49d0e5['userProfileId']=_0x4dbef3[_0xa14d('0x4f')]['id'];return _0x49d0e5;});return db[_0xa14d('0x58')][_0xa14d('0x6f')](_0x5bb988,{'raw':!![],'transaction':_0x19271d});})[_0xa14d('0x29')](function(_0xaf6d57){var _0x2fdd30=_['filter'](_['map'](_0xaf6d57,function(_0x255d7c){return _0x255d7c[_0xa14d('0x51')]({'plain':!![]});}),{'includeAll':![]});if(_0x2fdd30){return db[_0xa14d('0x58')][_0xa14d('0x48')]({'where':{'userProfileId':_0x4dbef3['params']['id'],'sectionId':_[_0xa14d('0x2f')](_0x2fdd30,function(_0x3c0a0f){return _0x3c0a0f[_0xa14d('0x5c')];})},'attributes':['id','sectionId'],'raw':!![]})[_0xa14d('0x29')](function(_0x5da02b){var _0x3600c9=_['map'](_0x4dbef3['body'],function(_0x55e747){_0x55e747[_0xa14d('0x5d')]=_0x4dbef3[_0xa14d('0x4f')]['id'];return _0x55e747;});return db[_0xa14d('0x5b')]['bulkCreate'](_0x3600c9,{'raw':!![],'transaction':_0x19271d});});}})[_0xa14d('0x4a')](handleError(_0x3f014e,null));});}})[_0xa14d('0x29')](function(_0x331db0){var _0x222ae9=_['map'](_0x331db0,function(_0x27615d){return _0x27615d['get']({'plain':!![]});});})[_0xa14d('0x29')](respondWithResult(_0x3f014e,null))[_0xa14d('0x4a')](handleError(_0x3f014e,null));};exports[_0xa14d('0x70')]=function(_0x486dae,_0x233e64,_0x411cd0){return db['UserProfile'][_0xa14d('0x50')]({'where':{'id':_0x486dae[_0xa14d('0x4f')]['id']}})['then'](handleEntityNotFound(_0x233e64,null))[_0xa14d('0x29')](function(_0x252adb){if(_0x252adb){return _0x252adb[_0xa14d('0x70')](_0x486dae[_0xa14d('0x35')][_0xa14d('0x64')]);}})['then'](respondWithStatusCode(_0x233e64,null))[_0xa14d('0x4a')](handleError(_0x233e64,null));};exports[_0xa14d('0x71')]=function(_0x5c35d6,_0x2c82d0){var _0x36dc69={'raw':![],'where':{}};var _0x5ae897={};var _0xdf9129={'count':0x0,'rows':[]};var _0x420189=_0x5c35d6[_0xa14d('0x35')][_0xa14d('0x72')];if(typeof _0x420189===_0xa14d('0x73')){throw new db[(_0xa14d('0x74'))][(_0xa14d('0x75'))](_0xa14d('0x76'));}var _0x191a65=_0x5c35d6[_0xa14d('0x35')]['mergeResources']||![];var _0x169e91=getQueryModels(_0x420189,_0x191a65);if(typeof _0x169e91[_0xa14d('0x77')]===_0xa14d('0x73')){throw new db[(_0xa14d('0x74'))][(_0xa14d('0x75'))](_0xa14d('0x78')+_0x420189+'\x27');}var _0x58d3d4=[];if(!_[_0xa14d('0x68')](_0x169e91[_0xa14d('0x79')])){_0x58d3d4=_0x169e91['parentSections'];}else{_0x58d3d4=[{'name':_0x420189}];}return db[_0xa14d('0x45')][_0xa14d('0x7a')]({'where':{'id':_0x5c35d6[_0xa14d('0x4f')]['id']}})[_0xa14d('0x29')](handleEntityNotFound(_0x2c82d0,null))[_0xa14d('0x29')](function(_0x5c1e2d){if(_0x5c1e2d){var _0x223f12=[];for(var _0x5800be=0x0;_0x5800be<_0x58d3d4[_0xa14d('0x3a')];_0x5800be++){_0x223f12[_0xa14d('0x62')](db[_0xa14d('0x58')][_0xa14d('0x7a')]({'where':{'userProfileId':_0x5c1e2d['id'],'name':_0x58d3d4[_0x5800be][_0xa14d('0x2c')]},'raw':!![]}));}return BPromise[_0xa14d('0x7b')](_0x223f12);}})[_0xa14d('0x29')](function(_0x3b07d0){var _0x6ba3da=_[_0xa14d('0x41')](_0x3b07d0,function(_0x687817){return _0x687817?_0x687817:undefined;});var _0x56fabf=_[_0xa14d('0x41')](_0x58d3d4,['ignore',!![]]);var _0x27ea01=_[_0xa14d('0x68')](_0x6ba3da)&&_[_0xa14d('0x68')](_0x56fabf)?null:_[_0xa14d('0x7c')](_0x56fabf,_0x6ba3da);if(_0x27ea01){var _0x59ce69=[];for(var _0x4699d1=0x0;_0x4699d1<_0x27ea01['length'];_0x4699d1++){var _0x1f498f=_['find'](_0x58d3d4,function(_0x488a79){return _0x27ea01[_0x4699d1]?_0x488a79[_0xa14d('0x2c')]===_0x27ea01[_0x4699d1][_0xa14d('0x2c')]:null;});if(_0x1f498f){if(_0x27ea01[_0x4699d1][_0xa14d('0x7d')]){_0x59ce69[_0xa14d('0x62')](getAllResources(_0x169e91[_0xa14d('0x77')],_0x27ea01[_0x4699d1]));}else{if(!_0x27ea01[_0x4699d1][_0xa14d('0x5a')]){_0x59ce69[_0xa14d('0x62')](getAllowedResources(_0x1f498f,_0x27ea01[_0x4699d1],_0x169e91[_0xa14d('0x77')]));}else{if(_0x1f498f['model']){_0x59ce69[_0xa14d('0x62')](getAllFilteredResources(_0x1f498f,_0x27ea01[_0x4699d1]));}}}}}return BPromise['all'](_0x59ce69);}else{return null;}})[_0xa14d('0x29')](function(_0x191fad){var _0x2ad9e1=_0x191fad;var _0xc2b104=null;if(_0x2ad9e1){_0xc2b104=_0x2ad9e1[_0xa14d('0x3a')]===0x1?_0x2ad9e1[0x0]:null;}if(_0xc2b104||_0x2ad9e1){var _0x32b622=db[_0x169e91[_0xa14d('0x77')]][_0xa14d('0x30')];_0x5ae897[_0xa14d('0x34')]=_['keys'](_0x32b622);_0x5ae897[_0xa14d('0x35')]=_['keys'](_0x5c35d6[_0xa14d('0x35')]);_0x5ae897[_0xa14d('0x7e')]=_['intersection'](_0x5ae897['model'],_0x5ae897[_0xa14d('0x35')]);_0x36dc69[_0xa14d('0x39')]=_[_0xa14d('0x37')](_0x5ae897[_0xa14d('0x34')],qs[_0xa14d('0x38')](_0x5c35d6['query']['fields']));_0x36dc69[_0xa14d('0x39')]=_0x36dc69[_0xa14d('0x39')][_0xa14d('0x3a')]?_0x36dc69['attributes']:_0x5ae897[_0xa14d('0x34')];if(!_0x5c35d6[_0xa14d('0x35')][_0xa14d('0x3b')](_0xa14d('0x3c'))){_0x36dc69[_0xa14d('0x23')]=qs[_0xa14d('0x23')](_0x5c35d6['query'][_0xa14d('0x23')]);_0x36dc69[_0xa14d('0x22')]=qs['offset'](_0x5c35d6[_0xa14d('0x35')][_0xa14d('0x22')]);}_0x36dc69['order']=qs['sort'](_0x5c35d6[_0xa14d('0x35')]['sort']);_0x36dc69['where']=qs[_0xa14d('0x7e')](_[_0xa14d('0x40')](_0x5c35d6[_0xa14d('0x35')],_0x5ae897[_0xa14d('0x7e')]));if(_0x5c35d6[_0xa14d('0x35')]['filter']){_0x36dc69[_0xa14d('0x3f')]=_['merge'](_0x36dc69[_0xa14d('0x3f')],{'$or':_[_0xa14d('0x2f')](_0x32b622,function(_0x2d217c){if(_0x2d217c['type']['key']!==_0xa14d('0x43')){var _0x3aee34={};_0x3aee34[_0x2d217c['field']]={'$like':'%'+_0x5c35d6['query'][_0xa14d('0x41')]+'%'};return _0x3aee34;}})});}var _0x5a6b0c=[];if(_0xc2b104){var _0x90cdbd=_[_0xa14d('0x50')](_0x58d3d4,['name',_0xc2b104[_0xa14d('0x2c')]]);if(_0x90cdbd[_0xa14d('0x7f')]){var _0x1028e6={};if(_0x169e91[_0xa14d('0x77')]===_0xa14d('0x80')){_0x1028e6[_0x90cdbd['foreignKey']]=_['map'](_0xc2b104[_0xa14d('0x81')],'id');}else{_0x1028e6[_0x90cdbd['foreignKey']]=_0xc2b104[_0xa14d('0x81')];}_0x5a6b0c[_0xa14d('0x62')](_0x1028e6);}else{_0x36dc69[_0xa14d('0x3f')]['id']=_0xc2b104[_0xa14d('0x81')];}}else{for(var _0x498e54=0x0;_0x498e54<_0x2ad9e1[_0xa14d('0x3a')];_0x498e54++){var _0x90cdbd=_[_0xa14d('0x50')](_0x58d3d4,[_0xa14d('0x2c'),_0x2ad9e1[_0x498e54][_0xa14d('0x2c')]]);if(_0x90cdbd[_0xa14d('0x7f')]){var _0x1028e6={};_0x1028e6[_0x90cdbd[_0xa14d('0x82')]]=_0x2ad9e1[_0x498e54]['associatedResources'];_0x5a6b0c['push'](_0x1028e6);}else{if(!_0x36dc69[_0xa14d('0x3f')]['id'])_0x36dc69[_0xa14d('0x3f')]['id']=[];_0x2ad9e1[_0x498e54][_0xa14d('0x81')][_0xa14d('0x6b')](function(_0x45e9ad){_0x36dc69[_0xa14d('0x3f')]['id'][_0xa14d('0x62')](_0x45e9ad);});}}}if(!_[_0xa14d('0x68')](_0x5a6b0c)){_0x36dc69[_0xa14d('0x3f')]=_[_0xa14d('0x42')](_0x36dc69['where'],{'$and':{'$or':_0x5a6b0c}});}_0x36dc69=_[_0xa14d('0x42')]({},_0x36dc69,_0x5c35d6[_0xa14d('0x44')]);if(_0xc2b104&&!_0xc2b104[_0xa14d('0x5a')]&&_0x169e91[_0xa14d('0x77')]===_0xa14d('0x80')){if(_0x5c35d6[_0xa14d('0x35')][_0xa14d('0x46')]){_0x36dc69[_0xa14d('0x47')]=[{'all':!![]}];}return db[_0x169e91['childModel']]['findAll'](_0x36dc69)['then'](function(_0x1cdb49){var _0x57bfa4=[];_0x1cdb49[_0xa14d('0x6b')](function(_0x54d7d8){var _0x3412c9;switch(_0x54d7d8[_0xa14d('0x83')]){case'default':_0x3412c9=_[_0xa14d('0x50')](_0xc2b104[_0xa14d('0x81')],function(_0x5a8ae3){return _0x5a8ae3['id']===_0x54d7d8['reportId']&&_0x5a8ae3[_0xa14d('0x32')]===_0xa14d('0x84');});break;case _0xa14d('0x85'):_0x3412c9=_[_0xa14d('0x50')](_0xc2b104[_0xa14d('0x81')],function(_0x3ad2e7){return _0x3ad2e7['id']===_0x54d7d8[_0xa14d('0x86')]&&_0x3ad2e7['type']===_0xa14d('0x87');});break;}if(_0x3412c9)_0x57bfa4['push'](_0x54d7d8);});_0xdf9129[_0xa14d('0x21')]=_0x57bfa4[_0xa14d('0x3a')];_0xdf9129[_0xa14d('0x49')]=_0x57bfa4;return _0xdf9129;});}else{return db[_0x169e91[_0xa14d('0x77')]]['count']({'where':_0x36dc69[_0xa14d('0x3f')]})[_0xa14d('0x29')](function(_0x315061){_0xdf9129[_0xa14d('0x21')]=_0x315061;if(_0x5c35d6[_0xa14d('0x35')][_0xa14d('0x46')]){if(_0x169e91[_0xa14d('0x77')]===_0xa14d('0x88')){_0x36dc69['include']=[{'model':db[_0xa14d('0x89')],'as':_0xa14d('0x8a'),'attributes':['id',_0xa14d('0x2c'),_0xa14d('0x8b')],'required':_0x5c35d6[_0xa14d('0x35')][_0xa14d('0x8c')]?!![]:![]},{'model':db[_0xa14d('0x89')],'as':_0xa14d('0x8d'),'attributes':['id',_0xa14d('0x2c'),_0xa14d('0x8b')],'through':_0x5c35d6[_0xa14d('0x35')][_0xa14d('0x8c')]?{'attributes':[],'where':{'TagId':_0x5c35d6[_0xa14d('0x35')][_0xa14d('0x8c')]||undefined}}:{},'required':_0x5c35d6[_0xa14d('0x35')]['tag']?!![]:![]}];}else{_0x36dc69[_0xa14d('0x47')]=[{'all':!![]}];}}return db[_0x169e91[_0xa14d('0x77')]]['findAll'](_0x36dc69);})[_0xa14d('0x29')](function(_0x50b554){_0xdf9129[_0xa14d('0x49')]=_0x50b554;return _0xdf9129;});}}else{return _0xdf9129;}})[_0xa14d('0x29')](respondWithFilteredResult(_0x2c82d0,_0x36dc69))['catch'](handleError(_0x2c82d0,null));};function getAllResources(_0x309c80,_0x47a213){return new BPromise(function(_0x2a88b6,_0xc11ccf){if(_0x47a213){var _0x461727=_0x47a213['filter']?{[_0x47a213[_0xa14d('0x41')][_0xa14d('0x7f')]]:_0x47a213['filter']['value']}:undefined;return db[_0x309c80]['findAll']({'where':_0x461727,'raw':!![]})[_0xa14d('0x29')](function(_0x9acf0a){_0x47a213[_0xa14d('0x81')]=_[_0xa14d('0x2f')](_0x9acf0a,'id');_0x2a88b6(_0x47a213);})[_0xa14d('0x4a')](function(_0x3411b5){_0xc11ccf(_0x3411b5);});}else{_0x2a88b6(null);}});}function getAllFilteredResources(_0x1be17d,_0x53be88){return new BPromise(function(_0x221583,_0x5e7db8){var _0x17aa52=_0x1be17d['filter']?{[_0x1be17d['filter']['field']]:_0x1be17d['filter'][_0xa14d('0x8e')]}:undefined;return db[_0x1be17d[_0xa14d('0x34')]][_0xa14d('0x48')]({'where':_0x17aa52,'raw':!![]})[_0xa14d('0x29')](function(_0x124ce5){_0x53be88[_0xa14d('0x81')]=_['map'](_0x124ce5,function(_0x1a623e){return _0x1a623e[_0xa14d('0x2c')];});_0x221583(_0x53be88);})['catch'](function(_0x2c7033){_0x5e7db8(_0x2c7033);});});}function getAllowedResources(_0x35ed89,_0x55b43d,_0x31f3cb){return new BPromise(function(_0x2c98a8,_0x3a3d76){if(_0x55b43d){return db[_0xa14d('0x5b')]['findAll']({'where':{'sectionId':_0x55b43d['id']},'raw':!![]})['then'](function(_0x38ce77){if(_0x35ed89['field']&&_0x35ed89[_0xa14d('0x7f')]!=='id'){_0x55b43d[_0xa14d('0x81')]=_['map'](_0x38ce77,function(_0x948c2a){return _0x948c2a[_0x35ed89[_0xa14d('0x7f')]];});}else{if(_0x31f3cb===_0xa14d('0x80')){_0x55b43d[_0xa14d('0x81')]=_[_0xa14d('0x2f')](_0x38ce77,function(_0x42b6e4){return{'id':_0x42b6e4['resourceId'],'type':_0x42b6e4[_0xa14d('0x32')]};});}else{_0x55b43d[_0xa14d('0x81')]=_[_0xa14d('0x2f')](_0x38ce77,function(_0x1c556a){return _0x1c556a[_0xa14d('0x6c')];});}}_0x2c98a8(_0x55b43d);})[_0xa14d('0x4a')](function(_0x3cf21e){_0x3a3d76(_0x3cf21e);});}else{_0x2c98a8(null);}});}function getQueryModels(_0x396c7d,_0x1b0218){var _0x1d02cb=_0x396c7d[_0xa14d('0x8f')]();var _0x356f5c={'childModel':undefined,'parentSections':[]};switch(_0x1d02cb){case _0xa14d('0x90'):_0x356f5c[_0xa14d('0x77')]=_0xa14d('0x91');break;case _0xa14d('0x92'):_0x356f5c[_0xa14d('0x77')]=_0xa14d('0x93');break;case'squarerecordings':_0x356f5c[_0xa14d('0x77')]=_0xa14d('0x94');_0x356f5c[_0xa14d('0x79')]=[{'name':'SquareProjects','field':_0xa14d('0x2c'),'foreignKey':_0xa14d('0x95')}];break;case _0xa14d('0x96'):_0x356f5c['childModel']=_0xa14d('0x97');break;case _0xa14d('0x98'):_0x356f5c['childModel']=_0xa14d('0x88');_0x356f5c[_0xa14d('0x79')]=[{'name':'Lists','field':'id','foreignKey':_0xa14d('0x99')}];break;case _0xa14d('0x9a'):_0x356f5c[_0xa14d('0x77')]=_0xa14d('0x9b');break;case _0xa14d('0x9c'):_0x356f5c[_0xa14d('0x77')]=_0xa14d('0x9d');break;case'globalcustomfields':_0x356f5c['childModel']=_0xa14d('0x9e');break;case _0xa14d('0x9f'):_0x356f5c['childModel']='ChatQueue';break;case _0xa14d('0xa0'):_0x356f5c[_0xa14d('0x77')]=_0xa14d('0xa1');break;case _0xa14d('0xa2'):_0x356f5c[_0xa14d('0x77')]=_0xa14d('0xa3');break;case _0xa14d('0xa4'):_0x356f5c[_0xa14d('0x77')]=_0xa14d('0xa5');break;case _0xa14d('0xa6'):case'internalroutes':case _0xa14d('0xa7'):_0x356f5c[_0xa14d('0x77')]=_0xa14d('0xa8');break;case _0xa14d('0xa9'):_0x356f5c[_0xa14d('0x77')]='VoiceContext';break;case _0xa14d('0xaa'):_0x356f5c[_0xa14d('0x77')]=_0xa14d('0xab');break;case'voicerecordings':_0x356f5c['childModel']='VoiceRecording';_0x356f5c[_0xa14d('0x79')]=[{'name':'Agents','field':_0xa14d('0x2c'),'foreignKey':_0xa14d('0xac'),'model':_0xa14d('0xad'),'filter':{'field':_0xa14d('0xae'),'value':['agent']}},{'name':_0xa14d('0xaf'),'field':'name','foreignKey':'membername','model':_0xa14d('0xad'),'filter':{'field':_0xa14d('0xae'),'value':['telephone']}},{'name':_0xa14d('0xb0'),'field':'name','foreignKey':_0xa14d('0xb1'),'model':'VoiceQueue','filter':{'field':_0xa14d('0x32'),'value':[_0xa14d('0xb2')]}},{'name':_0xa14d('0xb3'),'field':_0xa14d('0x2c'),'foreignKey':'queue','model':_0xa14d('0xb4'),'filter':{'field':_0xa14d('0x32'),'value':[_0xa14d('0xb5')]}}];break;case _0xa14d('0xb6'):_0x356f5c[_0xa14d('0x77')]=_0xa14d('0xb7');break;case _0xa14d('0xb8'):_0x356f5c[_0xa14d('0x77')]=_0xa14d('0xb9');break;case _0xa14d('0xba'):_0x356f5c[_0xa14d('0x77')]=_0xa14d('0xbb');break;case _0xa14d('0xbc'):_0x356f5c['childModel']=_0xa14d('0xbd');break;case _0xa14d('0xbe'):_0x356f5c[_0xa14d('0x77')]='MailQueue';break;case'mailaccounts':_0x356f5c['childModel']='MailAccount';break;case _0xa14d('0xbf'):_0x356f5c[_0xa14d('0x77')]='MailSubstatus';break;case _0xa14d('0xc0'):_0x356f5c[_0xa14d('0x77')]='OpenchannelQueue';break;case _0xa14d('0xc1'):_0x356f5c[_0xa14d('0x77')]=_0xa14d('0xc2');break;case _0xa14d('0xc3'):_0x356f5c[_0xa14d('0x77')]=_0xa14d('0xc4');break;case _0xa14d('0xc5'):_0x356f5c[_0xa14d('0x77')]=_0xa14d('0xc6');break;case _0xa14d('0xc7'):_0x356f5c[_0xa14d('0x77')]=_0xa14d('0xc8');break;case _0xa14d('0xc9'):_0x356f5c[_0xa14d('0x77')]=_0xa14d('0xca');break;case'teams':_0x356f5c[_0xa14d('0x77')]=_0xa14d('0xcb');break;case _0xa14d('0xcc'):case _0xa14d('0xcd'):_0x356f5c['childModel']=_0xa14d('0xb4');if(_0x1b0218){_0x356f5c[_0xa14d('0x79')]=[{'name':_0xa14d('0xb0')},{'name':'QueueCampaigns'}];}break;case _0xa14d('0xce'):case _0xa14d('0xcf'):case'telephones':_0x356f5c['childModel']=_0xa14d('0xad');if(_0x1b0218){_0x356f5c['parentSections']=[{'name':_0xa14d('0xd0'),'filter':{'field':_0xa14d('0xae'),'value':[_0xa14d('0xd1'),_0xa14d('0xd2')]},'ignore':!![]},{'name':_0xa14d('0xd3')},{'name':_0xa14d('0xaf')}];}break;case _0xa14d('0xd4'):_0x356f5c[_0xa14d('0x77')]=_0xa14d('0xd5');break;case _0xa14d('0xd6'):_0x356f5c[_0xa14d('0x77')]=_0xa14d('0xd7');break;case _0xa14d('0xd8'):_0x356f5c[_0xa14d('0x77')]='FreshdeskAccount';break;case _0xa14d('0xd9'):_0x356f5c[_0xa14d('0x77')]=_0xa14d('0xda');break;case'deskaccounts':_0x356f5c['childModel']=_0xa14d('0xdb');break;case _0xa14d('0xdc'):_0x356f5c[_0xa14d('0x77')]=_0xa14d('0xdd');break;case _0xa14d('0xde'):_0x356f5c['childModel']='User';break;case'cannedanswers':_0x356f5c[_0xa14d('0x77')]=_0xa14d('0xdf');break;case'dispositions':_0x356f5c['childModel']=_0xa14d('0xe0');break;case _0xa14d('0xe1'):_0x356f5c[_0xa14d('0x77')]='Dashboard';break;case _0xa14d('0xe2'):_0x356f5c[_0xa14d('0x77')]=_0xa14d('0xe3');break;case _0xa14d('0xe4'):_0x356f5c[_0xa14d('0x77')]=_0xa14d('0xe5');break;case _0xa14d('0xe6'):_0x356f5c['childModel']='Schedule';break;case _0xa14d('0xe7'):_0x356f5c[_0xa14d('0x77')]=_0xa14d('0xe8');break;case _0xa14d('0xe9'):_0x356f5c[_0xa14d('0x77')]=_0xa14d('0x89');break;case'templates':_0x356f5c[_0xa14d('0x77')]=_0xa14d('0xea');break;case _0xa14d('0xeb'):_0x356f5c['childModel']='Trigger';break;case _0xa14d('0xec'):_0x356f5c[_0xa14d('0x77')]=_0xa14d('0xed');break;case _0xa14d('0xee'):_0x356f5c[_0xa14d('0x77')]=_0xa14d('0xef');break;case _0xa14d('0xf0'):_0x356f5c[_0xa14d('0x77')]=_0xa14d('0x6d');break;case _0xa14d('0xf1'):_0x356f5c[_0xa14d('0x77')]=_0xa14d('0x80');_0x356f5c[_0xa14d('0x79')]=[{'name':_0xa14d('0xf2'),'field':'id','foreignKey':'reportId'}];break;case _0xa14d('0xf3'):_0x356f5c['childModel']=_0xa14d('0xf4');break;case _0xa14d('0xc9'):_0x356f5c[_0xa14d('0x77')]='WhatsappAccount';break;default:return _0x356f5c;}return _0x356f5c;}
\ No newline at end of file
+var _0xce79=['findAll','catch','show','params','merge','options','create','body','clone','find','get','createdAt','crudPermissions','omit','updatedAt','transaction','UserProfileSection','each','autoAssociation','sectionId','userProfileId','UserProfileResource','Resources','describe','sequelize','push','removeSections','enabled','includes','isEmpty','findOne','forEach','resourceId','Plugin','bulkCreate','removeResources','ids','getResources','undefined','Sequelize','ValidationError','Unknown\x20section','childModel','Invalid\x20section\x20\x27','parentSections','union','all','VIRTUAL','field','AnalyticExtractedReport','foreignKey','associatedResources','reportType','default','reportId','custom','CustomReports','rows','CmContact','Tags','ThroughTags','tag','value','toLowerCase','odbc','SquareOdbc','squarerecordings','SquareRecording','projectName','JscriptyProject','Lists','ListId','lists','companies','chatqueues','faxqueues','FaxQueue','faxaccounts','inboundroutes','internalroutes','VoiceExtension','contexts','VoiceContext','voicemails','VoiceMail','voicerecordings','VoiceRecording','Agents','User','role','Telephones','membername','VoiceQueues','queue','VoiceQueue','inbound','QueueCampaigns','outbound','VoiceMusicOnHold','voiceprefixes','VoicePrefix','Campaign','mailqueues','MailQueue','MailSubstatus','openchannelqueues','OpenchannelQueue','openchannelaccounts','OpenchannelAccount','SmsQueue','smsaccounts','whatsappqueues','WhatsappQueue','WhatsappAccount','teams','Team','voicequeues','queuecampaigns','users','Users','admin','zendeskaccounts','ZendeskAccount','SalesforceAccount','freshdeskaccounts','FreshdeskAccount','sugarcrmaccounts','SugarcrmAccount','deskaccounts','DeskAccount','zohoaccounts','cannedanswers','CannedAnswer','Disposition','customdashboards','Dashboard','intervals','Interval','pauses','Pause','scheduler','Schedule','sounds','tags','Tag','templates','Template','triggers','trunks','variables','Variable','plugins','extractedreports','metrics','AnalyticMetric','whatsappaccounts','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','lodash','squel','crypto','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','./userProfile.socket','register','status','end','json','count','offset','limit','Content-Range','apply','reject','update','then','destroy','sendStatus','error','name','index','map','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','UserProfile','includeAll','include'];(function(_0x4433d5,_0x43a102){var _0x16384a=function(_0x347d39){while(--_0x347d39){_0x4433d5['push'](_0x4433d5['shift']());}};_0x16384a(++_0x43a102);}(_0xce79,0x9c));var _0x9ce7=function(_0x1ca9e9,_0x1c4391){_0x1ca9e9=_0x1ca9e9-0x0;var _0x309f3c=_0xce79[_0x1ca9e9];return _0x309f3c;};'use strict';var pdf=require(_0x9ce7('0x0'));var emlformat=require(_0x9ce7('0x1'));var rimraf=require(_0x9ce7('0x2'));var zipdir=require(_0x9ce7('0x3'));var jsonpatch=require(_0x9ce7('0x4'));var rp=require('request-promise');var moment=require(_0x9ce7('0x5'));var BPromise=require(_0x9ce7('0x6'));var Mustache=require(_0x9ce7('0x7'));var util=require(_0x9ce7('0x8'));var path=require('path');var sox=require(_0x9ce7('0x9'));var csv=require(_0x9ce7('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x9ce7('0xb'));var squel=require(_0x9ce7('0xc'));var crypto=require(_0x9ce7('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x9ce7('0xe'));var toCsv=require(_0x9ce7('0xa'));var querystring=require('querystring');var Papa=require(_0x9ce7('0xf'));var Redis=require('ioredis');var authService=require(_0x9ce7('0x10'));var qs=require(_0x9ce7('0x11'));var as=require(_0x9ce7('0x12'));var hardwareService=require(_0x9ce7('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0x9ce7('0x14'));var config=require(_0x9ce7('0x15'));var db=require(_0x9ce7('0x16'))['db'];config[_0x9ce7('0x17')]=_[_0x9ce7('0x18')](config[_0x9ce7('0x17')],{'host':_0x9ce7('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x9ce7('0x17')]));require(_0x9ce7('0x1a'))[_0x9ce7('0x1b')](socket);function respondWithStatusCode(_0x39941b,_0x9ea60b){_0x9ea60b=_0x9ea60b||0xcc;return function(_0x994854){if(_0x994854){return _0x39941b['sendStatus'](_0x9ea60b);}return _0x39941b[_0x9ce7('0x1c')](_0x9ea60b)[_0x9ce7('0x1d')]();};}function respondWithResult(_0x40d31c,_0x822f3b){_0x822f3b=_0x822f3b||0xc8;return function(_0x2776be){if(_0x2776be){return _0x40d31c[_0x9ce7('0x1c')](_0x822f3b)[_0x9ce7('0x1e')](_0x2776be);}};}function respondWithFilteredResult(_0x388d5e,_0x584bd2){return function(_0x24392f){if(_0x24392f){var _0x4097a=_0x24392f[_0x9ce7('0x1f')],_0x3d1ac1=_0x584bd2[_0x9ce7('0x20')],_0x96799e=_0x584bd2[_0x9ce7('0x20')]+_0x584bd2[_0x9ce7('0x21')],_0x23be6e;if(_0x96799e>=_0x4097a){_0x96799e=_0x4097a;_0x23be6e=0xc8;}else{_0x23be6e=0xce;}_0x388d5e[_0x9ce7('0x1c')](_0x23be6e);return _0x388d5e['set'](_0x9ce7('0x22'),_0x3d1ac1+'-'+_0x96799e+'/'+_0x4097a)['json'](_0x24392f);}return null;};}function patchUpdates(_0x117165){return function(_0x5a4dec){try{jsonpatch[_0x9ce7('0x23')](_0x5a4dec,_0x117165,!![]);}catch(_0x5ed113){return BPromise[_0x9ce7('0x24')](_0x5ed113);}return _0x5a4dec['save']();};}function saveUpdates(_0x90eded,_0x3a96b3){return function(_0x1d990d){if(_0x1d990d){return _0x1d990d[_0x9ce7('0x25')](_0x90eded)[_0x9ce7('0x26')](function(_0x50eb4e){return _0x50eb4e;});}return null;};}function removeEntity(_0xcdc7a7,_0x12cd88){return function(_0x5859dd){if(_0x5859dd){return _0x5859dd[_0x9ce7('0x27')]()[_0x9ce7('0x26')](function(){_0xcdc7a7['status'](0xcc)[_0x9ce7('0x1d')]();});}};}function handleEntityNotFound(_0x3b352d,_0x44d9dd){return function(_0x33ec8d){if(!_0x33ec8d){_0x3b352d[_0x9ce7('0x28')](0x194);}return _0x33ec8d;};}function handleError(_0x2dd9c4,_0x255e5f){_0x255e5f=_0x255e5f||0x1f4;return function(_0x509107){logger[_0x9ce7('0x29')](_0x509107['stack']);if(_0x509107[_0x9ce7('0x2a')]){delete _0x509107[_0x9ce7('0x2a')];}_0x2dd9c4['status'](_0x255e5f)['send'](_0x509107);};}exports[_0x9ce7('0x2b')]=function(_0x4ec280,_0x5e3aaf){var _0x5a115a={},_0x495829={},_0x492010={'count':0x0,'rows':[]};var _0x1ef367=_[_0x9ce7('0x2c')](db['UserProfile'][_0x9ce7('0x2d')],function(_0x1cf1e5){return{'name':_0x1cf1e5['fieldName'],'type':_0x1cf1e5[_0x9ce7('0x2e')][_0x9ce7('0x2f')]};});_0x495829[_0x9ce7('0x30')]=_[_0x9ce7('0x2c')](_0x1ef367,_0x9ce7('0x2a'));_0x495829[_0x9ce7('0x31')]=_[_0x9ce7('0x32')](_0x4ec280['query']);_0x495829[_0x9ce7('0x33')]=_[_0x9ce7('0x34')](_0x495829[_0x9ce7('0x30')],_0x495829[_0x9ce7('0x31')]);_0x5a115a[_0x9ce7('0x35')]=_[_0x9ce7('0x34')](_0x495829['model'],qs['fields'](_0x4ec280[_0x9ce7('0x31')][_0x9ce7('0x36')]));_0x5a115a[_0x9ce7('0x35')]=_0x5a115a[_0x9ce7('0x35')][_0x9ce7('0x37')]?_0x5a115a['attributes']:_0x495829[_0x9ce7('0x30')];if(!_0x4ec280[_0x9ce7('0x31')][_0x9ce7('0x38')](_0x9ce7('0x39'))){_0x5a115a[_0x9ce7('0x21')]=qs[_0x9ce7('0x21')](_0x4ec280[_0x9ce7('0x31')][_0x9ce7('0x21')]);_0x5a115a['offset']=qs['offset'](_0x4ec280[_0x9ce7('0x31')][_0x9ce7('0x20')]);}_0x5a115a[_0x9ce7('0x3a')]=qs[_0x9ce7('0x3b')](_0x4ec280[_0x9ce7('0x31')][_0x9ce7('0x3b')]);_0x5a115a[_0x9ce7('0x3c')]=qs['filters'](_['pick'](_0x4ec280[_0x9ce7('0x31')],_0x495829[_0x9ce7('0x33')]),_0x1ef367);if(_0x4ec280[_0x9ce7('0x31')]['filter']){_0x5a115a[_0x9ce7('0x3c')]=_['merge'](_0x5a115a['where'],{'$or':_['map'](_0x1ef367,function(_0x4cde56){if(_0x4cde56['type']!=='VIRTUAL'){var _0x40f9f5={};_0x40f9f5[_0x4cde56['name']]={'$like':'%'+_0x4ec280[_0x9ce7('0x31')][_0x9ce7('0x3d')]+'%'};return _0x40f9f5;}})});}_0x5a115a=_['merge']({},_0x5a115a,_0x4ec280['options']);var _0x3efa1b={'where':_0x5a115a[_0x9ce7('0x3c')]};return db[_0x9ce7('0x3e')][_0x9ce7('0x1f')](_0x3efa1b)[_0x9ce7('0x26')](function(_0x4de03e){_0x492010[_0x9ce7('0x1f')]=_0x4de03e;if(_0x4ec280['query'][_0x9ce7('0x3f')]){_0x5a115a[_0x9ce7('0x40')]=[{'all':!![]}];}return db[_0x9ce7('0x3e')][_0x9ce7('0x41')](_0x5a115a);})[_0x9ce7('0x26')](function(_0x225b04){_0x492010['rows']=_0x225b04;return _0x492010;})['then'](respondWithFilteredResult(_0x5e3aaf,_0x5a115a))[_0x9ce7('0x42')](handleError(_0x5e3aaf,null));};exports[_0x9ce7('0x43')]=function(_0x2007bf,_0x4a4922){var _0x501658={'raw':![],'where':{'id':_0x2007bf[_0x9ce7('0x44')]['id']}},_0x5211bf={};_0x5211bf[_0x9ce7('0x30')]=_[_0x9ce7('0x32')](db[_0x9ce7('0x3e')][_0x9ce7('0x2d')]);_0x5211bf[_0x9ce7('0x31')]=_['keys'](_0x2007bf['query']);_0x5211bf[_0x9ce7('0x33')]=_['intersection'](_0x5211bf[_0x9ce7('0x30')],_0x5211bf[_0x9ce7('0x31')]);_0x501658[_0x9ce7('0x35')]=_[_0x9ce7('0x34')](_0x5211bf[_0x9ce7('0x30')],qs['fields'](_0x2007bf[_0x9ce7('0x31')]['fields']));_0x501658[_0x9ce7('0x35')]=_0x501658[_0x9ce7('0x35')]['length']?_0x501658[_0x9ce7('0x35')]:_0x5211bf['model'];if(_0x2007bf['query'][_0x9ce7('0x3f')]){_0x501658[_0x9ce7('0x40')]=[{'all':!![]}];}_0x501658=_[_0x9ce7('0x45')]({},_0x501658,_0x2007bf[_0x9ce7('0x46')]);return db[_0x9ce7('0x3e')]['find'](_0x501658)[_0x9ce7('0x26')](handleEntityNotFound(_0x4a4922,null))[_0x9ce7('0x26')](respondWithResult(_0x4a4922,null))[_0x9ce7('0x42')](handleError(_0x4a4922,null));};exports[_0x9ce7('0x47')]=function(_0xc5ecc4,_0x2dcaac){return db[_0x9ce7('0x3e')]['create'](_0xc5ecc4[_0x9ce7('0x48')],{})['then'](respondWithResult(_0x2dcaac,0xc9))[_0x9ce7('0x42')](handleError(_0x2dcaac,null));};exports[_0x9ce7('0x49')]=function(_0x39c40d,_0x30ce57){var _0x40444a={'where':{'id':_0x39c40d[_0x9ce7('0x44')]['id']}},_0x26f1f3={};_0x26f1f3[_0x9ce7('0x30')]=_[_0x9ce7('0x32')](db['UserProfile']['rawAttributes']);_0x40444a[_0x9ce7('0x35')]=_[_0x9ce7('0x34')](_0x26f1f3['model'],qs[_0x9ce7('0x36')](_0x39c40d['query'][_0x9ce7('0x36')]));_0x40444a[_0x9ce7('0x35')]=_0x40444a[_0x9ce7('0x35')][_0x9ce7('0x37')]?_0x40444a[_0x9ce7('0x35')]:_0x26f1f3[_0x9ce7('0x30')];if(_0x39c40d[_0x9ce7('0x31')][_0x9ce7('0x3f')]){_0x40444a[_0x9ce7('0x40')]=[{'all':!![]}];}_0x40444a=_[_0x9ce7('0x45')]({},_0x40444a,_0x39c40d[_0x9ce7('0x46')]);return db[_0x9ce7('0x3e')][_0x9ce7('0x4a')](_0x40444a)[_0x9ce7('0x26')](handleEntityNotFound(_0x30ce57,null))[_0x9ce7('0x26')](function(_0x491f65){if(_0x491f65){var _0xd05659=_0x491f65[_0x9ce7('0x4b')]({'plain':!![]});_0xd05659=qs['omit'](_0xd05659,['id',_0x9ce7('0x4c'),'updatedAt',_0x9ce7('0x4d')]);_0x39c40d[_0x9ce7('0x48')]=_[_0x9ce7('0x4e')](_0x39c40d[_0x9ce7('0x48')],['id','createdAt',_0x9ce7('0x4f')]);return db['sequelize'][_0x9ce7('0x50')](function(_0x3c19fa){return db[_0x9ce7('0x3e')][_0x9ce7('0x47')](_[_0x9ce7('0x45')](_0xd05659,_0x39c40d[_0x9ce7('0x48')]),{'include':_0x39c40d[_0x9ce7('0x31')][_0x9ce7('0x3f')]?[{'all':!![]}]:undefined,'transaction':_0x3c19fa})['then'](function(_0x34f1d0){var _0x2545cc=_0x34f1d0['get']({'plain':!![]});return db[_0x9ce7('0x51')][_0x9ce7('0x41')]({'where':{'userProfileId':_0x39c40d[_0x9ce7('0x44')]['id']},'raw':!![]})['then'](function(_0x5b4a1c){if(_0x5b4a1c){return BPromise[_0x9ce7('0x52')](_0x5b4a1c,function(_0x19c515){return new BPromise(function(_0x1d99fe,_0x5c2b2a){if(_0x19c515[_0x9ce7('0x53')]===null||_0x19c515['autoAssociation']===0x1)_0x1d99fe(null);return db['UserProfileResource'][_0x9ce7('0x41')]({'where':{'sectionId':_0x19c515['id']},'raw':!![]})['then'](function(_0x246363){var _0x552d46=_['map'](_0x246363,function(_0x18061a){return qs['omit'](_0x18061a,['id',_0x9ce7('0x4c'),_0x9ce7('0x4f'),_0x9ce7('0x54')]);});_0x1d99fe(_0x552d46);})[_0x9ce7('0x42')](function(_0x25f094){_0x5c2b2a(_0x25f094);});})[_0x9ce7('0x26')](function(_0x1d12a9){var _0x336a2d=qs[_0x9ce7('0x4e')](_0x19c515,['id',_0x9ce7('0x4c'),_0x9ce7('0x4f')]);_0x336a2d[_0x9ce7('0x55')]=_0x2545cc['id'];if(_0x1d12a9)_0x336a2d['Resources']=_0x1d12a9;return _0x336a2d;})['then'](function(_0x325f5c){return db[_0x9ce7('0x51')][_0x9ce7('0x47')](_0x325f5c,{'include':[{'model':db[_0x9ce7('0x56')],'as':_0x9ce7('0x57')}],'raw':!![],'transaction':_0x3c19fa});});})[_0x9ce7('0x26')](function(){return _0x2545cc;});}});});});}})[_0x9ce7('0x26')](respondWithResult(_0x30ce57,0xc9))[_0x9ce7('0x42')](handleError(_0x30ce57,null));};exports[_0x9ce7('0x25')]=function(_0x3b3efc,_0x28c4b0){if(_0x3b3efc[_0x9ce7('0x48')]['id']){delete _0x3b3efc['body']['id'];}return db['UserProfile'][_0x9ce7('0x4a')]({'where':{'id':_0x3b3efc[_0x9ce7('0x44')]['id']}})[_0x9ce7('0x26')](handleEntityNotFound(_0x28c4b0,null))[_0x9ce7('0x26')](saveUpdates(_0x3b3efc[_0x9ce7('0x48')],null))[_0x9ce7('0x26')](respondWithResult(_0x28c4b0,null))[_0x9ce7('0x42')](handleError(_0x28c4b0,null));};exports[_0x9ce7('0x27')]=function(_0x5111a2,_0x109b84){return db['UserProfile']['find']({'where':{'id':_0x5111a2[_0x9ce7('0x44')]['id']}})[_0x9ce7('0x26')](handleEntityNotFound(_0x109b84,null))['then'](removeEntity(_0x109b84,null))[_0x9ce7('0x42')](handleError(_0x109b84,null));};exports[_0x9ce7('0x58')]=function(_0x4445e0,_0x335356){return db[_0x9ce7('0x3e')][_0x9ce7('0x58')]()[_0x9ce7('0x26')](respondWithResult(_0x335356,null))[_0x9ce7('0x42')](handleError(_0x335356,null));};exports['addSections']=function(_0xee4ae1,_0x566a87){var _0x2aa712=_0xee4ae1[_0x9ce7('0x48')];return db[_0x9ce7('0x3e')]['find']({'where':{'id':_0xee4ae1[_0x9ce7('0x44')]['id']}})[_0x9ce7('0x26')](handleEntityNotFound(_0x566a87,null))[_0x9ce7('0x26')](function(_0x35959f){if(_0x35959f){return db[_0x9ce7('0x59')][_0x9ce7('0x50')](function(_0x54d793){return db[_0x9ce7('0x51')][_0x9ce7('0x27')]({'where':{'userProfileId':_0xee4ae1[_0x9ce7('0x44')]['id'],'sectionId':_['map'](_0x2aa712,function(_0x43f531){return _0x43f531[_0x9ce7('0x54')];})},'transaction':_0x54d793})['then'](function(){var _0x26cad8=_[_0x9ce7('0x2c')](_0x2aa712,function(_0x463d50){_0x463d50[_0x9ce7('0x55')]=_0xee4ae1[_0x9ce7('0x44')]['id'];return _0x463d50;});var _0x511a5b=[];return BPromise['each'](_0x26cad8,function(_0x2228c2){return db[_0x9ce7('0x51')][_0x9ce7('0x47')](_0x2228c2,{'include':[{'model':db[_0x9ce7('0x56')],'as':_0x9ce7('0x57')}],'raw':!![],'transaction':_0x54d793})[_0x9ce7('0x26')](function(_0x3a17f3){_0x511a5b[_0x9ce7('0x5a')](_0x3a17f3['get']({'plain':!![]}));});})['then'](function(){return _0x511a5b;});});});}})['then'](function(_0x55db78){return _0x55db78;})['then'](respondWithResult(_0x566a87,null))[_0x9ce7('0x42')](handleError(_0x566a87,null));};exports[_0x9ce7('0x5b')]=function(_0x5c935d,_0x5cdefd){var _0x23f338;return db['UserProfile'][_0x9ce7('0x4a')]({'where':{'id':_0x5c935d[_0x9ce7('0x44')]['id']},'attributes':['id',_0x9ce7('0x2a')]})['then'](handleEntityNotFound(_0x5cdefd,null))['then'](function(_0x3f37f3){if(_0x3f37f3){_0x23f338=_0x3f37f3;return db[_0x9ce7('0x51')][_0x9ce7('0x27')]({'where':{'userProfileId':_0x5c935d[_0x9ce7('0x44')]['id'],'sectionId':_0x5c935d[_0x9ce7('0x31')]['ids']}});}})[_0x9ce7('0x26')](function(){return _0x23f338;})[_0x9ce7('0x26')](respondWithStatusCode(_0x5cdefd,null))[_0x9ce7('0x42')](handleError(_0x5cdefd,null));};exports['getSections']=function(_0x2b9bfd,_0x5983a5){var _0x269edd=[];var _0x1ef6aa=[];return db[_0x9ce7('0x51')][_0x9ce7('0x41')]({'where':{'userProfileId':_0x2b9bfd[_0x9ce7('0x44')]['id']},'raw':!![]})[_0x9ce7('0x26')](function(_0xce1b2){_0x269edd=_[_0x9ce7('0x3d')](_0xce1b2,function(_0x4a1675){return _0x4a1675[_0x9ce7('0x5c')]===0x1||_[_0x9ce7('0x5d')]([0x3eb,0x709],_0x4a1675['sectionId']);});if(!_[_0x9ce7('0x5e')](_0x269edd)){return _[_0x9ce7('0x2c')](_0x269edd,function(_0x58fd00){return _0x58fd00[_0x9ce7('0x54')];});}else{return;}})[_0x9ce7('0x26')](function(_0x1aa419){if(_0x1aa419)_0x1ef6aa=_0x1aa419;if(_[_0x9ce7('0x5d')](_0x1ef6aa,0x64)){var _0x363f4a=_[_0x9ce7('0x4a')](_0x269edd,{'sectionId':0x64});return hasDefaultDashboard(_0x363f4a)[_0x9ce7('0x26')](function(_0xd0cc4f){return _[_0x9ce7('0x2c')](_0x269edd,function(_0x24c588){if(_0x24c588[_0x9ce7('0x54')]===0x64){_0x24c588['subsections']=_0xd0cc4f;}return _0x24c588;});});}else{return;}})[_0x9ce7('0x26')](function(_0x308967){if(_0x308967)_0x269edd=_0x308967;if(_[_0x9ce7('0x5d')](_0x1ef6aa,0x3eb)){var _0xd1d22b=_['find'](_0x269edd,{'sectionId':0x3eb});return getCustomDashboards(_0xd1d22b)[_0x9ce7('0x26')](function(_0x305cac){return _[_0x9ce7('0x2c')](_0x269edd,function(_0x39b03d){if(_0xd1d22b[_0x9ce7('0x5c')]){if(_0x39b03d[_0x9ce7('0x54')]===0x3eb){_0x39b03d['subsections']=_0x305cac;}}else{if(_0x39b03d[_0x9ce7('0x54')]===0x64){_0x39b03d['subsections']=_0x305cac;}}return _0x39b03d;});});}else{return;}})[_0x9ce7('0x26')](function(_0x2f6748){if(_0x2f6748)_0x269edd=_0x2f6748;if(_[_0x9ce7('0x5d')](_0x1ef6aa,0x709)){var _0x298ceb=_[_0x9ce7('0x4a')](_0x269edd,{'sectionId':0x709});return getPlugins(_0x298ceb)[_0x9ce7('0x26')](function(_0x14970c){if(_0x298ceb[_0x9ce7('0x5c')]){return _[_0x9ce7('0x2c')](_0x269edd,function(_0x5f36df){if(_0x5f36df[_0x9ce7('0x54')]===0x709){_0x5f36df['subsections']=_0x14970c;}return _0x5f36df;});}else{var _0x270fd8={'sectionId':0x76c,'enabled':0x1,'subsections':_0x14970c};var _0x8442c8=_[_0x9ce7('0x2c')](_0x269edd);_0x8442c8[_0x9ce7('0x5a')](_0x270fd8);return _0x8442c8;}});}else{return;}})[_0x9ce7('0x26')](function(_0x2ce39d){if(_0x2ce39d)_0x269edd=_0x2ce39d;return _['filter'](_0x269edd,['enabled',0x1]);})[_0x9ce7('0x26')](respondWithResult(_0x5983a5,null))[_0x9ce7('0x42')](handleError(_0x5983a5,null));};function hasDefaultDashboard(_0x4ac0ad){var _0x4d0ad3=[0x65];return new BPromise(function(_0x395d6a,_0x4549b5){try{if(_0x4ac0ad['autoAssociation']){_0x395d6a(_0x4d0ad3);}else{return db[_0x9ce7('0x56')][_0x9ce7('0x5f')]({'where':{'sectionId':_0x4ac0ad['id']},'raw':!![]})[_0x9ce7('0x26')](function(_0x423dba){_0x423dba?_0x395d6a(_0x4d0ad3):_0x395d6a();});}}catch(_0x117bd6){_0x4549b5(_0x117bd6);}});}function getCustomDashboards(_0x548bf4){var _0x5d8005=[];return new BPromise(function(_0x1fd9c1,_0x4676a7){try{if(_0x548bf4['autoAssociation']){return db['Dashboard'][_0x9ce7('0x41')]({'raw':!![]})[_0x9ce7('0x26')](function(_0x44d473){_0x44d473[_0x9ce7('0x60')](function(_0x918df6){_0x5d8005['push'](_0x918df6['id']+0x1869f);});_0x1fd9c1(_0x5d8005);});}else{return db[_0x9ce7('0x56')][_0x9ce7('0x41')]({'where':{'sectionId':_0x548bf4['id']},'raw':!![]})[_0x9ce7('0x26')](function(_0x128394){_0x128394[_0x9ce7('0x60')](function(_0x358178){_0x5d8005[_0x9ce7('0x5a')](_0x358178[_0x9ce7('0x61')]+0x1869f);});_0x1fd9c1(_0x5d8005);});}}catch(_0x4cd17d){_0x4676a7(_0x4cd17d);}});}function getPlugins(_0x5dabb7){var _0x3e0e9c=[];return new BPromise(function(_0x33324b,_0xd3ae60){try{if(_0x5dabb7[_0x9ce7('0x53')]){return db[_0x9ce7('0x62')][_0x9ce7('0x41')]({'raw':!![]})[_0x9ce7('0x26')](function(_0x3c6131){_0x3c6131[_0x9ce7('0x60')](function(_0x4b9db2){_0x3e0e9c[_0x9ce7('0x5a')](_0x4b9db2['id']+0x15b38);});_0x33324b(_0x3e0e9c);});}else{return db[_0x9ce7('0x56')][_0x9ce7('0x41')]({'where':{'sectionId':_0x5dabb7['id']},'raw':!![]})[_0x9ce7('0x26')](function(_0x271050){_0x271050[_0x9ce7('0x60')](function(_0x489c87){_0x3e0e9c[_0x9ce7('0x5a')](_0x489c87['resourceId']+0x15b38);});_0x33324b(_0x3e0e9c);});}}catch(_0x32ea52){_0xd3ae60(_0x32ea52);}});}exports['addResources']=function(_0x4ddd00,_0x2f0101){return db[_0x9ce7('0x3e')][_0x9ce7('0x4a')]({'where':{'id':_0x4ddd00['params']['id']}})['then'](handleEntityNotFound(_0x2f0101,null))[_0x9ce7('0x26')](function(_0x30bb53){if(_0x30bb53){return db['sequelize'][_0x9ce7('0x50')](function(_0x4d764b){return db[_0x9ce7('0x51')]['findAll']({'where':{'userProfileId':_0x4ddd00['params']['id']},'attributes':['id'],'raw':!![]})[_0x9ce7('0x26')](function(_0xcc0c6e){if(_0xcc0c6e){return db[_0x9ce7('0x51')]['destroy']({'where':{'userProfileId':_0x4ddd00['params']['id'],'id':_[_0x9ce7('0x2c')](_0xcc0c6e,function(_0x20fe49){return _0x20fe49['id'];})},'transaction':_0x4d764b});}})[_0x9ce7('0x26')](function(_0x3a9a00){var _0x3ee564=_[_0x9ce7('0x2c')](_0x4ddd00['body'],function(_0x408573){_0x408573[_0x9ce7('0x55')]=_0x4ddd00[_0x9ce7('0x44')]['id'];return _0x408573;});return db['UserProfileSection'][_0x9ce7('0x63')](_0x3ee564,{'raw':!![],'transaction':_0x4d764b});})[_0x9ce7('0x26')](function(_0x465080){var _0x511f06=_[_0x9ce7('0x3d')](_[_0x9ce7('0x2c')](_0x465080,function(_0xd316ee){return _0xd316ee[_0x9ce7('0x4b')]({'plain':!![]});}),{'includeAll':![]});if(_0x511f06){return db[_0x9ce7('0x51')]['findAll']({'where':{'userProfileId':_0x4ddd00[_0x9ce7('0x44')]['id'],'sectionId':_['map'](_0x511f06,function(_0x437c77){return _0x437c77[_0x9ce7('0x54')];})},'attributes':['id','sectionId'],'raw':!![]})[_0x9ce7('0x26')](function(_0x32c17e){var _0x4ba344=_['map'](_0x4ddd00[_0x9ce7('0x48')],function(_0x4e3e8e){_0x4e3e8e[_0x9ce7('0x55')]=_0x4ddd00['params']['id'];return _0x4e3e8e;});return db[_0x9ce7('0x56')]['bulkCreate'](_0x4ba344,{'raw':!![],'transaction':_0x4d764b});});}})[_0x9ce7('0x42')](handleError(_0x2f0101,null));});}})[_0x9ce7('0x26')](function(_0x87fbe3){var _0x4ba312=_[_0x9ce7('0x2c')](_0x87fbe3,function(_0x3b2b86){return _0x3b2b86[_0x9ce7('0x4b')]({'plain':!![]});});})[_0x9ce7('0x26')](respondWithResult(_0x2f0101,null))['catch'](handleError(_0x2f0101,null));};exports[_0x9ce7('0x64')]=function(_0x533ce6,_0x178e6c,_0x40d57d){return db['UserProfile']['find']({'where':{'id':_0x533ce6[_0x9ce7('0x44')]['id']}})['then'](handleEntityNotFound(_0x178e6c,null))[_0x9ce7('0x26')](function(_0x521f1b){if(_0x521f1b){return _0x521f1b[_0x9ce7('0x64')](_0x533ce6['query'][_0x9ce7('0x65')]);}})[_0x9ce7('0x26')](respondWithStatusCode(_0x178e6c,null))[_0x9ce7('0x42')](handleError(_0x178e6c,null));};exports[_0x9ce7('0x66')]=function(_0xc70727,_0x517d71){var _0x54605f={'raw':![],'where':{}};var _0x23de83={};var _0xb2571b={'count':0x0,'rows':[]};var _0x241c4d=_0xc70727['query']['section'];if(typeof _0x241c4d===_0x9ce7('0x67')){throw new db[(_0x9ce7('0x68'))][(_0x9ce7('0x69'))](_0x9ce7('0x6a'));}var _0x4ffac5=_0xc70727[_0x9ce7('0x31')]['mergeResources']||![];var _0x2f62aa=getQueryModels(_0x241c4d,_0x4ffac5);if(typeof _0x2f62aa[_0x9ce7('0x6b')]===_0x9ce7('0x67')){throw new db[(_0x9ce7('0x68'))][(_0x9ce7('0x69'))](_0x9ce7('0x6c')+_0x241c4d+'\x27');}var _0x10f2f9=[];if(!_[_0x9ce7('0x5e')](_0x2f62aa[_0x9ce7('0x6d')])){_0x10f2f9=_0x2f62aa[_0x9ce7('0x6d')];}else{_0x10f2f9=[{'name':_0x241c4d}];}return db[_0x9ce7('0x3e')][_0x9ce7('0x5f')]({'where':{'id':_0xc70727[_0x9ce7('0x44')]['id']}})[_0x9ce7('0x26')](handleEntityNotFound(_0x517d71,null))[_0x9ce7('0x26')](function(_0x383734){if(_0x383734){var _0x4adad0=[];for(var _0xa71f66=0x0;_0xa71f66<_0x10f2f9[_0x9ce7('0x37')];_0xa71f66++){_0x4adad0[_0x9ce7('0x5a')](db[_0x9ce7('0x51')][_0x9ce7('0x5f')]({'where':{'userProfileId':_0x383734['id'],'name':_0x10f2f9[_0xa71f66]['name']},'raw':!![]}));}return BPromise['all'](_0x4adad0);}})[_0x9ce7('0x26')](function(_0x24a27c){var _0x26550d=_[_0x9ce7('0x3d')](_0x24a27c,function(_0x1f007f){return _0x1f007f?_0x1f007f:undefined;});var _0x1d9009=_[_0x9ce7('0x3d')](_0x10f2f9,['ignore',!![]]);var _0x49fac6=_['isEmpty'](_0x26550d)&&_[_0x9ce7('0x5e')](_0x1d9009)?null:_[_0x9ce7('0x6e')](_0x1d9009,_0x26550d);if(_0x49fac6){var _0x4bceb4=[];for(var _0x47d5f4=0x0;_0x47d5f4<_0x49fac6[_0x9ce7('0x37')];_0x47d5f4++){var _0x3c3eea=_[_0x9ce7('0x4a')](_0x10f2f9,function(_0x456431){return _0x49fac6[_0x47d5f4]?_0x456431['name']===_0x49fac6[_0x47d5f4][_0x9ce7('0x2a')]:null;});if(_0x3c3eea){if(_0x49fac6[_0x47d5f4]['ignore']){_0x4bceb4[_0x9ce7('0x5a')](getAllResources(_0x2f62aa['childModel'],_0x49fac6[_0x47d5f4]));}else{if(!_0x49fac6[_0x47d5f4][_0x9ce7('0x53')]){_0x4bceb4[_0x9ce7('0x5a')](getAllowedResources(_0x3c3eea,_0x49fac6[_0x47d5f4],_0x2f62aa[_0x9ce7('0x6b')]));}else{if(_0x3c3eea[_0x9ce7('0x30')]){_0x4bceb4['push'](getAllFilteredResources(_0x3c3eea,_0x49fac6[_0x47d5f4]));}}}}}return BPromise[_0x9ce7('0x6f')](_0x4bceb4);}else{return null;}})[_0x9ce7('0x26')](function(_0x23e866){var _0x2ad4ee=_0x23e866;var _0x5e95a5=null;if(_0x2ad4ee){_0x5e95a5=_0x2ad4ee[_0x9ce7('0x37')]===0x1?_0x2ad4ee[0x0]:null;}if(_0x5e95a5||_0x2ad4ee){var _0x2a67c8=db[_0x2f62aa[_0x9ce7('0x6b')]]['rawAttributes'];_0x23de83['model']=_[_0x9ce7('0x32')](_0x2a67c8);_0x23de83[_0x9ce7('0x31')]=_[_0x9ce7('0x32')](_0xc70727[_0x9ce7('0x31')]);_0x23de83[_0x9ce7('0x33')]=_['intersection'](_0x23de83['model'],_0x23de83[_0x9ce7('0x31')]);_0x54605f[_0x9ce7('0x35')]=_[_0x9ce7('0x34')](_0x23de83[_0x9ce7('0x30')],qs['fields'](_0xc70727[_0x9ce7('0x31')][_0x9ce7('0x36')]));_0x54605f[_0x9ce7('0x35')]=_0x54605f[_0x9ce7('0x35')][_0x9ce7('0x37')]?_0x54605f[_0x9ce7('0x35')]:_0x23de83[_0x9ce7('0x30')];if(!_0xc70727['query']['hasOwnProperty'](_0x9ce7('0x39'))){_0x54605f[_0x9ce7('0x21')]=qs[_0x9ce7('0x21')](_0xc70727['query'][_0x9ce7('0x21')]);_0x54605f[_0x9ce7('0x20')]=qs[_0x9ce7('0x20')](_0xc70727[_0x9ce7('0x31')][_0x9ce7('0x20')]);}_0x54605f[_0x9ce7('0x3a')]=qs[_0x9ce7('0x3b')](_0xc70727[_0x9ce7('0x31')][_0x9ce7('0x3b')]);_0x54605f[_0x9ce7('0x3c')]=qs[_0x9ce7('0x33')](_['pick'](_0xc70727[_0x9ce7('0x31')],_0x23de83[_0x9ce7('0x33')]));if(_0xc70727[_0x9ce7('0x31')][_0x9ce7('0x3d')]){_0x54605f[_0x9ce7('0x3c')]=_[_0x9ce7('0x45')](_0x54605f[_0x9ce7('0x3c')],{'$or':_[_0x9ce7('0x2c')](_0x2a67c8,function(_0x450415){if(_0x450415['type'][_0x9ce7('0x2f')]!==_0x9ce7('0x70')){var _0x1b4829={};_0x1b4829[_0x450415[_0x9ce7('0x71')]]={'$like':'%'+_0xc70727['query'][_0x9ce7('0x3d')]+'%'};return _0x1b4829;}})});}var _0x6e4648=[];if(_0x5e95a5){var _0x386d87=_[_0x9ce7('0x4a')](_0x10f2f9,[_0x9ce7('0x2a'),_0x5e95a5[_0x9ce7('0x2a')]]);if(_0x386d87[_0x9ce7('0x71')]){var _0x1a56e9={};if(_0x2f62aa[_0x9ce7('0x6b')]===_0x9ce7('0x72')){_0x1a56e9[_0x386d87[_0x9ce7('0x73')]]=_[_0x9ce7('0x2c')](_0x5e95a5[_0x9ce7('0x74')],'id');}else{_0x1a56e9[_0x386d87[_0x9ce7('0x73')]]=_0x5e95a5[_0x9ce7('0x74')];}_0x6e4648[_0x9ce7('0x5a')](_0x1a56e9);}else{_0x54605f[_0x9ce7('0x3c')]['id']=_0x5e95a5[_0x9ce7('0x74')];}}else{for(var _0x31b1d0=0x0;_0x31b1d0<_0x2ad4ee[_0x9ce7('0x37')];_0x31b1d0++){var _0x386d87=_[_0x9ce7('0x4a')](_0x10f2f9,[_0x9ce7('0x2a'),_0x2ad4ee[_0x31b1d0]['name']]);if(_0x386d87['field']){var _0x1a56e9={};_0x1a56e9[_0x386d87[_0x9ce7('0x73')]]=_0x2ad4ee[_0x31b1d0]['associatedResources'];_0x6e4648[_0x9ce7('0x5a')](_0x1a56e9);}else{if(!_0x54605f[_0x9ce7('0x3c')]['id'])_0x54605f[_0x9ce7('0x3c')]['id']=[];_0x2ad4ee[_0x31b1d0][_0x9ce7('0x74')][_0x9ce7('0x60')](function(_0x1661d7){_0x54605f[_0x9ce7('0x3c')]['id'][_0x9ce7('0x5a')](_0x1661d7);});}}}if(!_['isEmpty'](_0x6e4648)){_0x54605f[_0x9ce7('0x3c')]=_[_0x9ce7('0x45')](_0x54605f['where'],{'$and':{'$or':_0x6e4648}});}_0x54605f=_['merge']({},_0x54605f,_0xc70727['options']);if(_0x5e95a5&&!_0x5e95a5[_0x9ce7('0x53')]&&_0x2f62aa[_0x9ce7('0x6b')]===_0x9ce7('0x72')){if(_0xc70727[_0x9ce7('0x31')][_0x9ce7('0x3f')]){_0x54605f['include']=[{'all':!![]}];}return db[_0x2f62aa[_0x9ce7('0x6b')]]['findAll'](_0x54605f)[_0x9ce7('0x26')](function(_0xd22a7b){var _0x368b74=[];_0xd22a7b['forEach'](function(_0x14859c){var _0x2284ba;switch(_0x14859c[_0x9ce7('0x75')]){case _0x9ce7('0x76'):_0x2284ba=_[_0x9ce7('0x4a')](_0x5e95a5[_0x9ce7('0x74')],function(_0x35a76d){return _0x35a76d['id']===_0x14859c[_0x9ce7('0x77')]&&_0x35a76d[_0x9ce7('0x2e')]==='DefaultReports';});break;case _0x9ce7('0x78'):_0x2284ba=_[_0x9ce7('0x4a')](_0x5e95a5[_0x9ce7('0x74')],function(_0x51ab0c){return _0x51ab0c['id']===_0x14859c['reportId']&&_0x51ab0c[_0x9ce7('0x2e')]===_0x9ce7('0x79');});break;}if(_0x2284ba)_0x368b74['push'](_0x14859c);});_0xb2571b['count']=_0x368b74[_0x9ce7('0x37')];_0xb2571b[_0x9ce7('0x7a')]=_0x368b74;return _0xb2571b;});}else{return db[_0x2f62aa[_0x9ce7('0x6b')]][_0x9ce7('0x1f')]({'where':_0x54605f[_0x9ce7('0x3c')]})[_0x9ce7('0x26')](function(_0x5ba631){_0xb2571b['count']=_0x5ba631;if(_0xc70727['query'][_0x9ce7('0x3f')]){if(_0x2f62aa[_0x9ce7('0x6b')]===_0x9ce7('0x7b')){_0x54605f[_0x9ce7('0x40')]=[{'model':db['Tag'],'as':_0x9ce7('0x7c'),'attributes':['id',_0x9ce7('0x2a'),'color'],'required':_0xc70727[_0x9ce7('0x31')]['tag']?!![]:![]},{'model':db['Tag'],'as':_0x9ce7('0x7d'),'attributes':['id',_0x9ce7('0x2a'),'color'],'through':_0xc70727[_0x9ce7('0x31')][_0x9ce7('0x7e')]?{'attributes':[],'where':{'TagId':_0xc70727[_0x9ce7('0x31')][_0x9ce7('0x7e')]||undefined}}:{},'required':_0xc70727[_0x9ce7('0x31')][_0x9ce7('0x7e')]?!![]:![]}];}else{_0x54605f[_0x9ce7('0x40')]=[{'all':!![]}];}}return db[_0x2f62aa[_0x9ce7('0x6b')]]['findAll'](_0x54605f);})[_0x9ce7('0x26')](function(_0x49c7e6){_0xb2571b[_0x9ce7('0x7a')]=_0x49c7e6;return _0xb2571b;});}}else{return _0xb2571b;}})[_0x9ce7('0x26')](respondWithFilteredResult(_0x517d71,_0x54605f))[_0x9ce7('0x42')](handleError(_0x517d71,null));};function getAllResources(_0x2bc32d,_0x2a358b){return new BPromise(function(_0x23c543,_0x451ee4){if(_0x2a358b){var _0x4fb8fc=_0x2a358b['filter']?{[_0x2a358b[_0x9ce7('0x3d')]['field']]:_0x2a358b[_0x9ce7('0x3d')][_0x9ce7('0x7f')]}:undefined;return db[_0x2bc32d]['findAll']({'where':_0x4fb8fc,'raw':!![]})['then'](function(_0x4aa57b){_0x2a358b[_0x9ce7('0x74')]=_[_0x9ce7('0x2c')](_0x4aa57b,'id');_0x23c543(_0x2a358b);})['catch'](function(_0x500ebe){_0x451ee4(_0x500ebe);});}else{_0x23c543(null);}});}function getAllFilteredResources(_0x41e469,_0x1be8d8){return new BPromise(function(_0x1ea4e7,_0x2936d3){var _0x6131f7=_0x41e469['filter']?{[_0x41e469[_0x9ce7('0x3d')][_0x9ce7('0x71')]]:_0x41e469[_0x9ce7('0x3d')][_0x9ce7('0x7f')]}:undefined;return db[_0x41e469[_0x9ce7('0x30')]]['findAll']({'where':_0x6131f7,'raw':!![]})['then'](function(_0x2299c1){_0x1be8d8[_0x9ce7('0x74')]=_['map'](_0x2299c1,function(_0x2d2ec5){return _0x2d2ec5['name'];});_0x1ea4e7(_0x1be8d8);})[_0x9ce7('0x42')](function(_0x3d149d){_0x2936d3(_0x3d149d);});});}function getAllowedResources(_0x135c21,_0x5ec887,_0x3255ce){return new BPromise(function(_0x13a3f8,_0xcd09fe){if(_0x5ec887){return db[_0x9ce7('0x56')][_0x9ce7('0x41')]({'where':{'sectionId':_0x5ec887['id']},'raw':!![]})[_0x9ce7('0x26')](function(_0x1cae66){if(_0x135c21[_0x9ce7('0x71')]&&_0x135c21[_0x9ce7('0x71')]!=='id'){_0x5ec887[_0x9ce7('0x74')]=_[_0x9ce7('0x2c')](_0x1cae66,function(_0x17d21c){return _0x17d21c[_0x135c21[_0x9ce7('0x71')]];});}else{if(_0x3255ce===_0x9ce7('0x72')){_0x5ec887['associatedResources']=_[_0x9ce7('0x2c')](_0x1cae66,function(_0x452ce6){return{'id':_0x452ce6[_0x9ce7('0x61')],'type':_0x452ce6[_0x9ce7('0x2e')]};});}else{_0x5ec887['associatedResources']=_['map'](_0x1cae66,function(_0x2f1913){return _0x2f1913[_0x9ce7('0x61')];});}}_0x13a3f8(_0x5ec887);})[_0x9ce7('0x42')](function(_0x19722){_0xcd09fe(_0x19722);});}else{_0x13a3f8(null);}});}function getQueryModels(_0x370410,_0xf4428){var _0x1f7230=_0x370410[_0x9ce7('0x80')]();var _0x3267ab={'childModel':undefined,'parentSections':[]};switch(_0x1f7230){case'squareprojects':_0x3267ab[_0x9ce7('0x6b')]='SquareProject';break;case _0x9ce7('0x81'):_0x3267ab[_0x9ce7('0x6b')]=_0x9ce7('0x82');break;case _0x9ce7('0x83'):_0x3267ab[_0x9ce7('0x6b')]=_0x9ce7('0x84');_0x3267ab[_0x9ce7('0x6d')]=[{'name':'SquareProjects','field':_0x9ce7('0x2a'),'foreignKey':_0x9ce7('0x85')}];break;case'projects':_0x3267ab['childModel']=_0x9ce7('0x86');break;case'contacts':_0x3267ab[_0x9ce7('0x6b')]=_0x9ce7('0x7b');_0x3267ab[_0x9ce7('0x6d')]=[{'name':_0x9ce7('0x87'),'field':'id','foreignKey':_0x9ce7('0x88')}];break;case _0x9ce7('0x89'):_0x3267ab[_0x9ce7('0x6b')]='CmList';break;case _0x9ce7('0x8a'):_0x3267ab[_0x9ce7('0x6b')]='CmCompany';break;case'globalcustomfields':_0x3267ab[_0x9ce7('0x6b')]='CmCustomField';break;case _0x9ce7('0x8b'):_0x3267ab[_0x9ce7('0x6b')]='ChatQueue';break;case'chatwebsites':_0x3267ab['childModel']='ChatWebsite';break;case _0x9ce7('0x8c'):_0x3267ab[_0x9ce7('0x6b')]=_0x9ce7('0x8d');break;case _0x9ce7('0x8e'):_0x3267ab[_0x9ce7('0x6b')]='FaxAccount';break;case _0x9ce7('0x8f'):case _0x9ce7('0x90'):case'outboundroutes':_0x3267ab[_0x9ce7('0x6b')]=_0x9ce7('0x91');break;case _0x9ce7('0x92'):_0x3267ab[_0x9ce7('0x6b')]=_0x9ce7('0x93');break;case _0x9ce7('0x94'):_0x3267ab[_0x9ce7('0x6b')]=_0x9ce7('0x95');break;case _0x9ce7('0x96'):_0x3267ab[_0x9ce7('0x6b')]=_0x9ce7('0x97');_0x3267ab['parentSections']=[{'name':_0x9ce7('0x98'),'field':_0x9ce7('0x2a'),'foreignKey':'membername','model':_0x9ce7('0x99'),'filter':{'field':_0x9ce7('0x9a'),'value':['agent']}},{'name':_0x9ce7('0x9b'),'field':_0x9ce7('0x2a'),'foreignKey':_0x9ce7('0x9c'),'model':_0x9ce7('0x99'),'filter':{'field':_0x9ce7('0x9a'),'value':['telephone']}},{'name':_0x9ce7('0x9d'),'field':_0x9ce7('0x2a'),'foreignKey':_0x9ce7('0x9e'),'model':_0x9ce7('0x9f'),'filter':{'field':_0x9ce7('0x2e'),'value':[_0x9ce7('0xa0')]}},{'name':_0x9ce7('0xa1'),'field':_0x9ce7('0x2a'),'foreignKey':_0x9ce7('0x9e'),'model':'VoiceQueue','filter':{'field':_0x9ce7('0x2e'),'value':[_0x9ce7('0xa2')]}}];break;case'musiconholds':_0x3267ab[_0x9ce7('0x6b')]=_0x9ce7('0xa3');break;case'chanspies':_0x3267ab['childModel']='VoiceChanSpy';break;case _0x9ce7('0xa4'):_0x3267ab[_0x9ce7('0x6b')]=_0x9ce7('0xa5');break;case'ivrcampaigns':_0x3267ab[_0x9ce7('0x6b')]=_0x9ce7('0xa6');break;case _0x9ce7('0xa7'):_0x3267ab['childModel']=_0x9ce7('0xa8');break;case'mailaccounts':_0x3267ab[_0x9ce7('0x6b')]='MailAccount';break;case'mailsubstatuses':_0x3267ab[_0x9ce7('0x6b')]=_0x9ce7('0xa9');break;case _0x9ce7('0xaa'):_0x3267ab[_0x9ce7('0x6b')]=_0x9ce7('0xab');break;case _0x9ce7('0xac'):_0x3267ab[_0x9ce7('0x6b')]=_0x9ce7('0xad');break;case'smsqueues':_0x3267ab[_0x9ce7('0x6b')]=_0x9ce7('0xae');break;case _0x9ce7('0xaf'):_0x3267ab[_0x9ce7('0x6b')]='SmsAccount';break;case _0x9ce7('0xb0'):_0x3267ab[_0x9ce7('0x6b')]=_0x9ce7('0xb1');break;case'whatsappaccounts':_0x3267ab[_0x9ce7('0x6b')]=_0x9ce7('0xb2');break;case _0x9ce7('0xb3'):_0x3267ab[_0x9ce7('0x6b')]=_0x9ce7('0xb4');break;case _0x9ce7('0xb5'):case _0x9ce7('0xb6'):_0x3267ab[_0x9ce7('0x6b')]='VoiceQueue';if(_0xf4428){_0x3267ab['parentSections']=[{'name':_0x9ce7('0x9d')},{'name':_0x9ce7('0xa1')}];}break;case _0x9ce7('0xb7'):case'agents':case'telephones':_0x3267ab['childModel']=_0x9ce7('0x99');if(_0xf4428){_0x3267ab[_0x9ce7('0x6d')]=[{'name':_0x9ce7('0xb8'),'filter':{'field':_0x9ce7('0x9a'),'value':[_0x9ce7('0xb9'),'user']},'ignore':!![]},{'name':_0x9ce7('0x98')},{'name':_0x9ce7('0x9b')}];}break;case _0x9ce7('0xba'):_0x3267ab[_0x9ce7('0x6b')]=_0x9ce7('0xbb');break;case'salesforceaccounts':_0x3267ab[_0x9ce7('0x6b')]=_0x9ce7('0xbc');break;case _0x9ce7('0xbd'):_0x3267ab[_0x9ce7('0x6b')]=_0x9ce7('0xbe');break;case _0x9ce7('0xbf'):_0x3267ab['childModel']=_0x9ce7('0xc0');break;case _0x9ce7('0xc1'):_0x3267ab[_0x9ce7('0x6b')]=_0x9ce7('0xc2');break;case _0x9ce7('0xc3'):_0x3267ab['childModel']='ZohoAccount';break;case'vtigeraccounts':_0x3267ab[_0x9ce7('0x6b')]=_0x9ce7('0x99');break;case _0x9ce7('0xc4'):_0x3267ab[_0x9ce7('0x6b')]=_0x9ce7('0xc5');break;case'dispositions':_0x3267ab['childModel']=_0x9ce7('0xc6');break;case _0x9ce7('0xc7'):_0x3267ab[_0x9ce7('0x6b')]=_0x9ce7('0xc8');break;case _0x9ce7('0xc9'):_0x3267ab[_0x9ce7('0x6b')]=_0x9ce7('0xca');break;case _0x9ce7('0xcb'):_0x3267ab[_0x9ce7('0x6b')]=_0x9ce7('0xcc');break;case _0x9ce7('0xcd'):_0x3267ab[_0x9ce7('0x6b')]=_0x9ce7('0xce');break;case _0x9ce7('0xcf'):_0x3267ab[_0x9ce7('0x6b')]='Sound';break;case _0x9ce7('0xd0'):_0x3267ab[_0x9ce7('0x6b')]=_0x9ce7('0xd1');break;case _0x9ce7('0xd2'):_0x3267ab['childModel']=_0x9ce7('0xd3');break;case _0x9ce7('0xd4'):_0x3267ab[_0x9ce7('0x6b')]='Trigger';break;case _0x9ce7('0xd5'):_0x3267ab[_0x9ce7('0x6b')]='Trunk';break;case _0x9ce7('0xd6'):_0x3267ab['childModel']=_0x9ce7('0xd7');break;case _0x9ce7('0xd8'):_0x3267ab['childModel']=_0x9ce7('0x62');break;case _0x9ce7('0xd9'):_0x3267ab[_0x9ce7('0x6b')]=_0x9ce7('0x72');_0x3267ab[_0x9ce7('0x6d')]=[{'name':'Reports','field':'id','foreignKey':'reportId'}];break;case _0x9ce7('0xda'):_0x3267ab[_0x9ce7('0x6b')]=_0x9ce7('0xdb');break;case _0x9ce7('0xdc'):_0x3267ab[_0x9ce7('0x6b')]=_0x9ce7('0xb2');break;default:return _0x3267ab;}return _0x3267ab;}
\ No newline at end of file
diff --git a/server/api/userProfile/userProfile.events.js b/server/api/userProfile/userProfile.events.js
index bde08de..6687bf5 100644
--- a/server/api/userProfile/userProfile.events.js
+++ b/server/api/userProfile/userProfile.events.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xb906=['update','remove','emit','hasOwnProperty','hook','exports','events','setMaxListeners','save'];(function(_0x82e645,_0x16f7af){var _0x523d0d=function(_0x2b606f){while(--_0x2b606f){_0x82e645['push'](_0x82e645['shift']());}};_0x523d0d(++_0x16f7af);}(_0xb906,0x1b6));var _0x6b90=function(_0x463d21,_0x1143cd){_0x463d21=_0x463d21-0x0;var _0x4e139b=_0xb906[_0x463d21];return _0x4e139b;};'use strict';var EventEmitter=require(_0x6b90('0x0'));var UserProfile=require('../../mysqldb')['db']['UserProfile'];var UserProfileEvents=new EventEmitter();UserProfileEvents[_0x6b90('0x1')](0x0);var events={'afterCreate':_0x6b90('0x2'),'afterUpdate':_0x6b90('0x3'),'afterDestroy':_0x6b90('0x4')};function emitEvent(_0x37d8bd){return function(_0x3e95f3,_0x28f50a,_0x55345d){UserProfileEvents['emit'](_0x37d8bd+':'+_0x3e95f3['id'],_0x3e95f3);UserProfileEvents[_0x6b90('0x5')](_0x37d8bd,_0x3e95f3);_0x55345d(null);};}for(var e in events){if(events[_0x6b90('0x6')](e)){var event=events[e];UserProfile[_0x6b90('0x7')](e,emitEvent(event));}}module[_0x6b90('0x8')]=UserProfileEvents;
\ No newline at end of file
+var _0x09e6=['emit','hasOwnProperty','hook','exports','events','UserProfile','save','update','remove'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x09e6,0x1c6));var _0x609e=function(_0x49ba2b,_0x1783e0){_0x49ba2b=_0x49ba2b-0x0;var _0x168432=_0x09e6[_0x49ba2b];return _0x168432;};'use strict';var EventEmitter=require(_0x609e('0x0'));var UserProfile=require('../../mysqldb')['db'][_0x609e('0x1')];var UserProfileEvents=new EventEmitter();UserProfileEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x609e('0x2'),'afterUpdate':_0x609e('0x3'),'afterDestroy':_0x609e('0x4')};function emitEvent(_0x472374){return function(_0x13c99e,_0x5ea7ec,_0x36d103){UserProfileEvents[_0x609e('0x5')](_0x472374+':'+_0x13c99e['id'],_0x13c99e);UserProfileEvents[_0x609e('0x5')](_0x472374,_0x13c99e);_0x36d103(null);};}for(var e in events){if(events[_0x609e('0x6')](e)){var event=events[e];UserProfile[_0x609e('0x7')](e,emitEvent(event));}}module[_0x609e('0x8')]=UserProfileEvents;
\ No newline at end of file
diff --git a/server/api/userProfile/userProfile.model.js b/server/api/userProfile/userProfile.model.js
index b609125..cfb85ca 100644
--- a/server/api/userProfile/userProfile.model.js
+++ b/server/api/userProfile/userProfile.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xa2d2=['bluebird','request-promise','path','rimraf','../../config/environment','./userProfile.attributes','exports','define','UserProfile','lodash','util','../../config/logger','api','moment'];(function(_0xe1150a,_0x199580){var _0xf98e7c=function(_0x524855){while(--_0x524855){_0xe1150a['push'](_0xe1150a['shift']());}};_0xf98e7c(++_0x199580);}(_0xa2d2,0xe9));var _0x2a2d=function(_0x1e6b10,_0x4c284d){_0x1e6b10=_0x1e6b10-0x0;var _0x3c6396=_0xa2d2[_0x1e6b10];return _0x3c6396;};'use strict';var _=require(_0x2a2d('0x0'));var util=require(_0x2a2d('0x1'));var logger=require(_0x2a2d('0x2'))(_0x2a2d('0x3'));var moment=require(_0x2a2d('0x4'));var BPromise=require(_0x2a2d('0x5'));var rp=require(_0x2a2d('0x6'));var fs=require('fs');var path=require(_0x2a2d('0x7'));var rimraf=require(_0x2a2d('0x8'));var config=require(_0x2a2d('0x9'));var attributes=require(_0x2a2d('0xa'));module[_0x2a2d('0xb')]=function(_0x14842f,_0x21e804){return _0x14842f[_0x2a2d('0xc')](_0x2a2d('0xd'),attributes,{'tableName':'user_profiles','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xcb44=['user_profiles','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./userProfile.attributes','exports','define','UserProfile'];(function(_0x3bee55,_0x4e25c8){var _0x5649d2=function(_0x13d730){while(--_0x13d730){_0x3bee55['push'](_0x3bee55['shift']());}};_0x5649d2(++_0x4e25c8);}(_0xcb44,0x119));var _0x4cb4=function(_0x1a87b3,_0x45ba68){_0x1a87b3=_0x1a87b3-0x0;var _0x37e84d=_0xcb44[_0x1a87b3];return _0x37e84d;};'use strict';var _=require(_0x4cb4('0x0'));var util=require(_0x4cb4('0x1'));var logger=require(_0x4cb4('0x2'))(_0x4cb4('0x3'));var moment=require(_0x4cb4('0x4'));var BPromise=require(_0x4cb4('0x5'));var rp=require(_0x4cb4('0x6'));var fs=require('fs');var path=require(_0x4cb4('0x7'));var rimraf=require(_0x4cb4('0x8'));var config=require('../../config/environment');var attributes=require(_0x4cb4('0x9'));module[_0x4cb4('0xa')]=function(_0x4a33fe,_0x1ffd37){return _0x4a33fe[_0x4cb4('0xb')](_0x4cb4('0xc'),attributes,{'tableName':_0x4cb4('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/userProfile/userProfile.rpc.js b/server/api/userProfile/userProfile.rpc.js
index f0b62c1..63cfa6e 100644
--- a/server/api/userProfile/userProfile.rpc.js
+++ b/server/api/userProfile/userProfile.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7da7=['error','code','message','result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','redis','localhost','socket.io-emitter','./userProfile.socket','request','then','UserProfile,\x20%s,\x20%s','request\x20sent','debug','stringify'];(function(_0x2dcccd,_0x51a24f){var _0xbc84bf=function(_0x5c29bc){while(--_0x5c29bc){_0x2dcccd['push'](_0x2dcccd['shift']());}};_0xbc84bf(++_0x51a24f);}(_0x7da7,0x10d));var _0x77da=function(_0x58fc2f,_0x111399){_0x58fc2f=_0x58fc2f-0x0;var _0x3a1312=_0x7da7[_0x58fc2f];return _0x3a1312;};'use strict';var _=require(_0x77da('0x0'));var util=require(_0x77da('0x1'));var moment=require(_0x77da('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x77da('0x3'));var db=require(_0x77da('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x77da('0x5'))(_0x77da('0x6'));var config=require('../../config/environment');var jayson=require(_0x77da('0x7'));var client=jayson[_0x77da('0x8')]['http']({'port':0x232a});config[_0x77da('0x9')]=_['defaults'](config[_0x77da('0x9')],{'host':_0x77da('0xa'),'port':0x18eb});var socket=require(_0x77da('0xb'))(new Redis(config[_0x77da('0x9')]));require(_0x77da('0xc'))['register'](socket);function respondWithRpcPromise(_0x40c86e,_0xb55827,_0x172d7f){return new BPromise(function(_0x5ea12f,_0x35d06e){return client[_0x77da('0xd')](_0x40c86e,_0x172d7f)[_0x77da('0xe')](function(_0x2a675a){logger['info'](_0x77da('0xf'),_0xb55827,_0x77da('0x10'));logger[_0x77da('0x11')]('UserProfile,\x20%s,\x20%s,\x20%s',_0xb55827,'request\x20sent',JSON[_0x77da('0x12')](_0x2a675a));if(_0x2a675a[_0x77da('0x13')]){if(_0x2a675a['error'][_0x77da('0x14')]===0x1f4){logger[_0x77da('0x13')](_0x77da('0xf'),_0xb55827,_0x2a675a[_0x77da('0x13')]['message']);return _0x35d06e(_0x2a675a[_0x77da('0x13')]['message']);}logger[_0x77da('0x13')](_0x77da('0xf'),_0xb55827,_0x2a675a[_0x77da('0x13')][_0x77da('0x15')]);return _0x5ea12f(_0x2a675a['error']['message']);}else{logger['info']('UserProfile,\x20%s,\x20%s',_0xb55827,_0x77da('0x10'));_0x5ea12f(_0x2a675a[_0x77da('0x16')][_0x77da('0x15')]);}})[_0x77da('0x17')](function(_0x19a00c){logger[_0x77da('0x13')](_0x77da('0xf'),_0xb55827,_0x19a00c);_0x35d06e(_0x19a00c);});});}
\ No newline at end of file
+var _0x7da7=['error','code','message','result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','redis','localhost','socket.io-emitter','./userProfile.socket','request','then','UserProfile,\x20%s,\x20%s','request\x20sent','debug','stringify'];(function(_0x223ed4,_0x2b5917){var _0x45e28b=function(_0x55d157){while(--_0x55d157){_0x223ed4['push'](_0x223ed4['shift']());}};_0x45e28b(++_0x2b5917);}(_0x7da7,0x10d));var _0x77da=function(_0x3e478c,_0x152670){_0x3e478c=_0x3e478c-0x0;var _0x29ef89=_0x7da7[_0x3e478c];return _0x29ef89;};'use strict';var _=require(_0x77da('0x0'));var util=require(_0x77da('0x1'));var moment=require(_0x77da('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x77da('0x3'));var db=require(_0x77da('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x77da('0x5'))(_0x77da('0x6'));var config=require('../../config/environment');var jayson=require(_0x77da('0x7'));var client=jayson[_0x77da('0x8')]['http']({'port':0x232a});config[_0x77da('0x9')]=_['defaults'](config[_0x77da('0x9')],{'host':_0x77da('0xa'),'port':0x18eb});var socket=require(_0x77da('0xb'))(new Redis(config[_0x77da('0x9')]));require(_0x77da('0xc'))['register'](socket);function respondWithRpcPromise(_0x40c86e,_0xb55827,_0x172d7f){return new BPromise(function(_0x5ea12f,_0x35d06e){return client[_0x77da('0xd')](_0x40c86e,_0x172d7f)[_0x77da('0xe')](function(_0x2a675a){logger['info'](_0x77da('0xf'),_0xb55827,_0x77da('0x10'));logger[_0x77da('0x11')]('UserProfile,\x20%s,\x20%s,\x20%s',_0xb55827,'request\x20sent',JSON[_0x77da('0x12')](_0x2a675a));if(_0x2a675a[_0x77da('0x13')]){if(_0x2a675a['error'][_0x77da('0x14')]===0x1f4){logger[_0x77da('0x13')](_0x77da('0xf'),_0xb55827,_0x2a675a[_0x77da('0x13')]['message']);return _0x35d06e(_0x2a675a[_0x77da('0x13')]['message']);}logger[_0x77da('0x13')](_0x77da('0xf'),_0xb55827,_0x2a675a[_0x77da('0x13')][_0x77da('0x15')]);return _0x5ea12f(_0x2a675a['error']['message']);}else{logger['info']('UserProfile,\x20%s,\x20%s',_0xb55827,_0x77da('0x10'));_0x5ea12f(_0x2a675a[_0x77da('0x16')][_0x77da('0x15')]);}})[_0x77da('0x17')](function(_0x19a00c){logger[_0x77da('0x13')](_0x77da('0xf'),_0xb55827,_0x19a00c);_0x35d06e(_0x19a00c);});});}
\ No newline at end of file
diff --git a/server/api/userProfile/userProfile.socket.js b/server/api/userProfile/userProfile.socket.js
index 24ec888..6ae67b7 100644
--- a/server/api/userProfile/userProfile.socket.js
+++ b/server/api/userProfile/userProfile.socket.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xafb3=['remove','removeListener','./userProfile.events','save'];(function(_0x580f8b,_0x19bc1c){var _0x5259b4=function(_0x19bd5c){while(--_0x19bd5c){_0x580f8b['push'](_0x580f8b['shift']());}};_0x5259b4(++_0x19bc1c);}(_0xafb3,0x10a));var _0x3afb=function(_0x1672b4,_0x58df4c){_0x1672b4=_0x1672b4-0x0;var _0x670cc7=_0xafb3[_0x1672b4];return _0x670cc7;};'use strict';var UserProfileEvents=require(_0x3afb('0x0'));var events=[_0x3afb('0x1'),_0x3afb('0x2'),'update'];function createListener(_0x38bf48,_0x32414b){return function(_0x2838cf){_0x32414b['emit'](_0x38bf48,_0x2838cf);};}function removeListener(_0x1d93c2,_0x43b190){return function(){UserProfileEvents[_0x3afb('0x3')](_0x1d93c2,_0x43b190);};}exports['register']=function(_0x672132){for(var _0x6479a0=0x0,_0x531b00=events['length'];_0x6479a0<_0x531b00;_0x6479a0++){var _0x29ba37=events[_0x6479a0];var _0x15f9cd=createListener('userProfile:'+_0x29ba37,_0x672132);UserProfileEvents['on'](_0x29ba37,_0x15f9cd);}};
\ No newline at end of file
+var _0x38d4=['update','emit','removeListener','register','length','./userProfile.events','remove'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x38d4,0x1cc));var _0x438d=function(_0xcb813d,_0x204798){_0xcb813d=_0xcb813d-0x0;var _0x259ee8=_0x38d4[_0xcb813d];return _0x259ee8;};'use strict';var UserProfileEvents=require(_0x438d('0x0'));var events=['save',_0x438d('0x1'),_0x438d('0x2')];function createListener(_0x283813,_0x4eca06){return function(_0xc1615){_0x4eca06[_0x438d('0x3')](_0x283813,_0xc1615);};}function removeListener(_0x1e24a6,_0x1f5869){return function(){UserProfileEvents[_0x438d('0x4')](_0x1e24a6,_0x1f5869);};}exports[_0x438d('0x5')]=function(_0x26bf3a){for(var _0x39a768=0x0,_0xdd9846=events[_0x438d('0x6')];_0x39a768<_0xdd9846;_0x39a768++){var _0x261e16=events[_0x39a768];var _0x4b1afd=createListener('userProfile:'+_0x261e16,_0x26bf3a);UserProfileEvents['on'](_0x261e16,_0x4b1afd);}};
\ No newline at end of file
diff --git a/server/api/userProfileResource/index.js b/server/api/userProfileResource/index.js
index 65bb9bf..560d4ad 100644
--- a/server/api/userProfileResource/index.js
+++ b/server/api/userProfileResource/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x6100=['path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./userProfileResource.controller','get','isAuthenticated','index','/describe','describe','/:id','post','create','put','update','delete','destroy','multer','util'];(function(_0x5c2925,_0x4ba252){var _0x50b830=function(_0x43afdd){while(--_0x43afdd){_0x5c2925['push'](_0x5c2925['shift']());}};_0x50b830(++_0x4ba252);}(_0x6100,0x1e1));var _0x0610=function(_0x5bb803,_0x1d8b26){_0x5bb803=_0x5bb803-0x0;var _0x5bd35d=_0x6100[_0x5bb803];return _0x5bd35d;};'use strict';var multer=require(_0x0610('0x0'));var util=require(_0x0610('0x1'));var path=require(_0x0610('0x2'));var timeout=require(_0x0610('0x3'));var express=require(_0x0610('0x4'));var router=express['Router']();var auth=require(_0x0610('0x5'));var interaction=require(_0x0610('0x6'));var config=require(_0x0610('0x7'));var controller=require(_0x0610('0x8'));router[_0x0610('0x9')]('/',auth[_0x0610('0xa')](),controller[_0x0610('0xb')]);router['get'](_0x0610('0xc'),auth['isAuthenticated'](),controller[_0x0610('0xd')]);router[_0x0610('0x9')](_0x0610('0xe'),auth[_0x0610('0xa')](),controller['show']);router[_0x0610('0xf')]('/',auth['isAuthenticated'](),controller[_0x0610('0x10')]);router[_0x0610('0x11')](_0x0610('0xe'),auth[_0x0610('0xa')](),controller[_0x0610('0x12')]);router[_0x0610('0x13')](_0x0610('0xe'),auth[_0x0610('0xa')](),controller[_0x0610('0x14')]);module['exports']=router;
\ No newline at end of file
+var _0x7e88=['delete','destroy','exports','multer','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','show','post','create','put','/:id','update'];(function(_0x23e12b,_0x23ef2f){var _0x1a1866=function(_0x364bbd){while(--_0x364bbd){_0x23e12b['push'](_0x23e12b['shift']());}};_0x1a1866(++_0x23ef2f);}(_0x7e88,0x81));var _0x87e8=function(_0x4cb524,_0x4d928b){_0x4cb524=_0x4cb524-0x0;var _0x15b076=_0x7e88[_0x4cb524];return _0x15b076;};'use strict';var multer=require(_0x87e8('0x0'));var util=require('util');var path=require(_0x87e8('0x1'));var timeout=require(_0x87e8('0x2'));var express=require(_0x87e8('0x3'));var router=express['Router']();var auth=require(_0x87e8('0x4'));var interaction=require(_0x87e8('0x5'));var config=require(_0x87e8('0x6'));var controller=require('./userProfileResource.controller');router[_0x87e8('0x7')]('/',auth[_0x87e8('0x8')](),controller[_0x87e8('0x9')]);router[_0x87e8('0x7')](_0x87e8('0xa'),auth[_0x87e8('0x8')](),controller[_0x87e8('0xb')]);router[_0x87e8('0x7')]('/:id',auth[_0x87e8('0x8')](),controller[_0x87e8('0xc')]);router[_0x87e8('0xd')]('/',auth['isAuthenticated'](),controller[_0x87e8('0xe')]);router[_0x87e8('0xf')](_0x87e8('0x10'),auth[_0x87e8('0x8')](),controller[_0x87e8('0x11')]);router[_0x87e8('0x12')](_0x87e8('0x10'),auth['isAuthenticated'](),controller[_0x87e8('0x13')]);module[_0x87e8('0x14')]=router;
\ No newline at end of file
diff --git a/server/api/userProfileResource/userProfileResource.attributes.js b/server/api/userProfileResource/userProfileResource.attributes.js
index 293a483..30c4aca 100644
--- a/server/api/userProfileResource/userProfileResource.attributes.js
+++ b/server/api/userProfileResource/userProfileResource.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x93e0=['STRING','INTEGER','sequelize','exports'];(function(_0x215124,_0xf4bfd7){var _0x22b149=function(_0x2b53b3){while(--_0x2b53b3){_0x215124['push'](_0x215124['shift']());}};_0x22b149(++_0xf4bfd7);}(_0x93e0,0xf2));var _0x093e=function(_0x4759ab,_0x354f6d){_0x4759ab=_0x4759ab-0x0;var _0x4cdbf8=_0x93e0[_0x4759ab];return _0x4cdbf8;};'use strict';var Sequelize=require(_0x093e('0x0'));module[_0x093e('0x1')]={'name':{'type':Sequelize[_0x093e('0x2')],'allowNull':![]},'resourceId':{'type':Sequelize[_0x093e('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0x093e('0x2')],'allowNull':![]}};
\ No newline at end of file
+var _0x7021=['INTEGER','exports','STRING'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7021,0x109));var _0x1702=function(_0x1fdff9,_0x4c4bf4){_0x1fdff9=_0x1fdff9-0x0;var _0x3d1b6e=_0x7021[_0x1fdff9];return _0x3d1b6e;};'use strict';var Sequelize=require('sequelize');module[_0x1702('0x0')]={'name':{'type':Sequelize[_0x1702('0x1')],'allowNull':![]},'resourceId':{'type':Sequelize[_0x1702('0x2')],'allowNull':![]},'type':{'type':Sequelize['STRING'],'allowNull':![]}};
\ No newline at end of file
diff --git a/server/api/userProfileResource/userProfileResource.controller.js b/server/api/userProfileResource/userProfileResource.controller.js
index 1bbbfed..9bcbae1 100644
--- a/server/api/userProfileResource/userProfileResource.controller.js
+++ b/server/api/userProfileResource/userProfileResource.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x2123=['VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','intersection','find','create','body','params','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','jsforce','to-csv','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','apply','reject','save','then','destroy','error','stack','name','send','map','UserProfileResource','rawAttributes','fieldName','type','model','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter'];(function(_0x3ac8e9,_0x3b1b6e){var _0x28616b=function(_0x13b3dd){while(--_0x13b3dd){_0x3ac8e9['push'](_0x3ac8e9['shift']());}};_0x28616b(++_0x3b1b6e);}(_0x2123,0x190));var _0x3212=function(_0xcab838,_0x599624){_0xcab838=_0xcab838-0x0;var _0xba7068=_0x2123[_0xcab838];return _0xba7068;};'use strict';var pdf=require(_0x3212('0x0'));var emlformat=require(_0x3212('0x1'));var rimraf=require(_0x3212('0x2'));var zipdir=require(_0x3212('0x3'));var jsonpatch=require(_0x3212('0x4'));var rp=require(_0x3212('0x5'));var moment=require(_0x3212('0x6'));var BPromise=require(_0x3212('0x7'));var Mustache=require(_0x3212('0x8'));var util=require(_0x3212('0x9'));var path=require(_0x3212('0xa'));var sox=require(_0x3212('0xb'));var csv=require('to-csv');var ejs=require(_0x3212('0xc'));var fs=require('fs');var _=require(_0x3212('0xd'));var squel=require(_0x3212('0xe'));var crypto=require('crypto');var jsforce=require(_0x3212('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x3212('0x10'));var querystring=require(_0x3212('0x11'));var Papa=require(_0x3212('0x12'));var Redis=require(_0x3212('0x13'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x3212('0x14'));var hardwareService=require(_0x3212('0x15'));var logger=require(_0x3212('0x16'))(_0x3212('0x17'));var utils=require(_0x3212('0x18'));var config=require(_0x3212('0x19'));var db=require(_0x3212('0x1a'))['db'];function respondWithStatusCode(_0x359cef,_0x26c1c8){_0x26c1c8=_0x26c1c8||0xcc;return function(_0x2d5fce){if(_0x2d5fce){return _0x359cef[_0x3212('0x1b')](_0x26c1c8);}return _0x359cef[_0x3212('0x1c')](_0x26c1c8)[_0x3212('0x1d')]();};}function respondWithResult(_0x3c8cce,_0x271593){_0x271593=_0x271593||0xc8;return function(_0x3d1fda){if(_0x3d1fda){return _0x3c8cce[_0x3212('0x1c')](_0x271593)[_0x3212('0x1e')](_0x3d1fda);}};}function respondWithFilteredResult(_0x19edfb,_0x46c5f5){return function(_0x42069c){if(_0x42069c){var _0x1ef2f7=_0x42069c[_0x3212('0x1f')],_0x5b2ab8=_0x46c5f5[_0x3212('0x20')],_0x43a642=_0x46c5f5[_0x3212('0x20')]+_0x46c5f5[_0x3212('0x21')],_0x1719a5;if(_0x43a642>=_0x1ef2f7){_0x43a642=_0x1ef2f7;_0x1719a5=0xc8;}else{_0x1719a5=0xce;}_0x19edfb[_0x3212('0x1c')](_0x1719a5);return _0x19edfb['set']('Content-Range',_0x5b2ab8+'-'+_0x43a642+'/'+_0x1ef2f7)[_0x3212('0x1e')](_0x42069c);}return null;};}function patchUpdates(_0x49f5c2){return function(_0x2380e8){try{jsonpatch[_0x3212('0x22')](_0x2380e8,_0x49f5c2,!![]);}catch(_0xb0b717){return BPromise[_0x3212('0x23')](_0xb0b717);}return _0x2380e8[_0x3212('0x24')]();};}function saveUpdates(_0x4aa12a,_0x41e61e){return function(_0x462094){if(_0x462094){return _0x462094['update'](_0x4aa12a)[_0x3212('0x25')](function(_0x3fa445){return _0x3fa445;});}return null;};}function removeEntity(_0x293b96,_0x4e3eda){return function(_0x5d27d5){if(_0x5d27d5){return _0x5d27d5[_0x3212('0x26')]()[_0x3212('0x25')](function(){_0x293b96[_0x3212('0x1c')](0xcc)[_0x3212('0x1d')]();});}};}function handleEntityNotFound(_0x3ceb3c,_0x436ecd){return function(_0x47d941){if(!_0x47d941){_0x3ceb3c['sendStatus'](0x194);}return _0x47d941;};}function handleError(_0x2e8518,_0x47cfdc){_0x47cfdc=_0x47cfdc||0x1f4;return function(_0x24cdf3){logger[_0x3212('0x27')](_0x24cdf3[_0x3212('0x28')]);if(_0x24cdf3['name']){delete _0x24cdf3[_0x3212('0x29')];}_0x2e8518[_0x3212('0x1c')](_0x47cfdc)[_0x3212('0x2a')](_0x24cdf3);};}exports['index']=function(_0x206980,_0x35b4eb){var _0x108eee={},_0x443a5={},_0x21f003={'count':0x0,'rows':[]};var _0x1638c5=_[_0x3212('0x2b')](db[_0x3212('0x2c')][_0x3212('0x2d')],function(_0x225bf0){return{'name':_0x225bf0[_0x3212('0x2e')],'type':_0x225bf0[_0x3212('0x2f')]['key']};});_0x443a5[_0x3212('0x30')]=_[_0x3212('0x2b')](_0x1638c5,_0x3212('0x29'));_0x443a5[_0x3212('0x31')]=_[_0x3212('0x32')](_0x206980[_0x3212('0x31')]);_0x443a5[_0x3212('0x33')]=_['intersection'](_0x443a5[_0x3212('0x30')],_0x443a5['query']);_0x108eee[_0x3212('0x34')]=_['intersection'](_0x443a5[_0x3212('0x30')],qs['fields'](_0x206980['query'][_0x3212('0x35')]));_0x108eee['attributes']=_0x108eee[_0x3212('0x34')][_0x3212('0x36')]?_0x108eee[_0x3212('0x34')]:_0x443a5['model'];if(!_0x206980[_0x3212('0x31')][_0x3212('0x37')](_0x3212('0x38'))){_0x108eee['limit']=qs[_0x3212('0x21')](_0x206980[_0x3212('0x31')][_0x3212('0x21')]);_0x108eee[_0x3212('0x20')]=qs[_0x3212('0x20')](_0x206980['query'][_0x3212('0x20')]);}_0x108eee[_0x3212('0x39')]=qs[_0x3212('0x3a')](_0x206980['query'][_0x3212('0x3a')]);_0x108eee[_0x3212('0x3b')]=qs[_0x3212('0x33')](_[_0x3212('0x3c')](_0x206980['query'],_0x443a5[_0x3212('0x33')]),_0x1638c5);if(_0x206980[_0x3212('0x31')][_0x3212('0x3d')]){_0x108eee[_0x3212('0x3b')]=_['merge'](_0x108eee['where'],{'$or':_['map'](_0x1638c5,function(_0x540dfc){if(_0x540dfc[_0x3212('0x2f')]!==_0x3212('0x3e')){var _0x3f8018={};_0x3f8018[_0x540dfc[_0x3212('0x29')]]={'$like':'%'+_0x206980['query'][_0x3212('0x3d')]+'%'};return _0x3f8018;}})});}_0x108eee=_[_0x3212('0x3f')]({},_0x108eee,_0x206980[_0x3212('0x40')]);var _0x2e8605={'where':_0x108eee['where']};return db['UserProfileResource'][_0x3212('0x1f')](_0x2e8605)[_0x3212('0x25')](function(_0x3bb054){_0x21f003[_0x3212('0x1f')]=_0x3bb054;if(_0x206980[_0x3212('0x31')][_0x3212('0x41')]){_0x108eee[_0x3212('0x42')]=[{'all':!![]}];}return db['UserProfileResource'][_0x3212('0x43')](_0x108eee);})[_0x3212('0x25')](function(_0x3e1e84){_0x21f003[_0x3212('0x44')]=_0x3e1e84;return _0x21f003;})['then'](respondWithFilteredResult(_0x35b4eb,_0x108eee))[_0x3212('0x45')](handleError(_0x35b4eb,null));};exports[_0x3212('0x46')]=function(_0x1c71f7,_0x262564){var _0x572429={'raw':![],'where':{'id':_0x1c71f7['params']['id']}},_0xb365f7={};_0xb365f7[_0x3212('0x30')]=_[_0x3212('0x32')](db[_0x3212('0x2c')][_0x3212('0x2d')]);_0xb365f7[_0x3212('0x31')]=_[_0x3212('0x32')](_0x1c71f7[_0x3212('0x31')]);_0xb365f7[_0x3212('0x33')]=_['intersection'](_0xb365f7[_0x3212('0x30')],_0xb365f7[_0x3212('0x31')]);_0x572429[_0x3212('0x34')]=_[_0x3212('0x47')](_0xb365f7[_0x3212('0x30')],qs[_0x3212('0x35')](_0x1c71f7[_0x3212('0x31')]['fields']));_0x572429[_0x3212('0x34')]=_0x572429[_0x3212('0x34')][_0x3212('0x36')]?_0x572429[_0x3212('0x34')]:_0xb365f7['model'];if(_0x1c71f7['query']['includeAll']){_0x572429['include']=[{'all':!![]}];}_0x572429=_[_0x3212('0x3f')]({},_0x572429,_0x1c71f7['options']);return db[_0x3212('0x2c')][_0x3212('0x48')](_0x572429)[_0x3212('0x25')](handleEntityNotFound(_0x262564,null))[_0x3212('0x25')](respondWithResult(_0x262564,null))['catch'](handleError(_0x262564,null));};exports[_0x3212('0x49')]=function(_0xb7124f,_0x75286f){return db['UserProfileResource'][_0x3212('0x49')](_0xb7124f[_0x3212('0x4a')],{})[_0x3212('0x25')](respondWithResult(_0x75286f,0xc9))[_0x3212('0x45')](handleError(_0x75286f,null));};exports['update']=function(_0x3ede8c,_0x13a42d){if(_0x3ede8c['body']['id']){delete _0x3ede8c[_0x3212('0x4a')]['id'];}return db[_0x3212('0x2c')][_0x3212('0x48')]({'where':{'id':_0x3ede8c['params']['id']}})['then'](handleEntityNotFound(_0x13a42d,null))[_0x3212('0x25')](saveUpdates(_0x3ede8c[_0x3212('0x4a')],null))[_0x3212('0x25')](respondWithResult(_0x13a42d,null))['catch'](handleError(_0x13a42d,null));};exports[_0x3212('0x26')]=function(_0x3ef982,_0x4ee235){return db[_0x3212('0x2c')][_0x3212('0x48')]({'where':{'id':_0x3ef982[_0x3212('0x4b')]['id']}})['then'](handleEntityNotFound(_0x4ee235,null))['then'](removeEntity(_0x4ee235,null))[_0x3212('0x45')](handleError(_0x4ee235,null));};exports[_0x3212('0x4c')]=function(_0x3faaa1,_0x2de137){return db['UserProfileResource'][_0x3212('0x4c')]()[_0x3212('0x25')](respondWithResult(_0x2de137,null))[_0x3212('0x45')](handleError(_0x2de137,null));};
\ No newline at end of file
+var _0xcd59=['show','params','options','find','create','body','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','UserProfileResource','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','VIRTUAL','filter','merge','includeAll','include','findAll','rows','catch'];(function(_0x3bb201,_0x55a6d0){var _0x35e5bc=function(_0xcf92f8){while(--_0xcf92f8){_0x3bb201['push'](_0x3bb201['shift']());}};_0x35e5bc(++_0x55a6d0);}(_0xcd59,0x14b));var _0x9cd5=function(_0x1fcc1e,_0x39efee){_0x1fcc1e=_0x1fcc1e-0x0;var _0x13497a=_0xcd59[_0x1fcc1e];return _0x13497a;};'use strict';var pdf=require(_0x9cd5('0x0'));var emlformat=require(_0x9cd5('0x1'));var rimraf=require(_0x9cd5('0x2'));var zipdir=require(_0x9cd5('0x3'));var jsonpatch=require(_0x9cd5('0x4'));var rp=require(_0x9cd5('0x5'));var moment=require('moment');var BPromise=require(_0x9cd5('0x6'));var Mustache=require(_0x9cd5('0x7'));var util=require(_0x9cd5('0x8'));var path=require(_0x9cd5('0x9'));var sox=require(_0x9cd5('0xa'));var csv=require(_0x9cd5('0xb'));var ejs=require(_0x9cd5('0xc'));var fs=require('fs');var _=require(_0x9cd5('0xd'));var squel=require(_0x9cd5('0xe'));var crypto=require(_0x9cd5('0xf'));var jsforce=require('jsforce');var deskjs=require(_0x9cd5('0x10'));var toCsv=require(_0x9cd5('0xb'));var querystring=require(_0x9cd5('0x11'));var Papa=require(_0x9cd5('0x12'));var Redis=require(_0x9cd5('0x13'));var authService=require(_0x9cd5('0x14'));var qs=require(_0x9cd5('0x15'));var as=require(_0x9cd5('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x9cd5('0x17'))(_0x9cd5('0x18'));var utils=require(_0x9cd5('0x19'));var config=require(_0x9cd5('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x58d6de,_0x2c9cf1){_0x2c9cf1=_0x2c9cf1||0xcc;return function(_0x172e29){if(_0x172e29){return _0x58d6de[_0x9cd5('0x1b')](_0x2c9cf1);}return _0x58d6de[_0x9cd5('0x1c')](_0x2c9cf1)[_0x9cd5('0x1d')]();};}function respondWithResult(_0x2a1606,_0x52698b){_0x52698b=_0x52698b||0xc8;return function(_0x15b639){if(_0x15b639){return _0x2a1606[_0x9cd5('0x1c')](_0x52698b)[_0x9cd5('0x1e')](_0x15b639);}};}function respondWithFilteredResult(_0x4b9ac8,_0x541cb8){return function(_0x5c4f3d){if(_0x5c4f3d){var _0x258305=_0x5c4f3d[_0x9cd5('0x1f')],_0x1ea3f7=_0x541cb8[_0x9cd5('0x20')],_0x565db7=_0x541cb8['offset']+_0x541cb8[_0x9cd5('0x21')],_0x24c233;if(_0x565db7>=_0x258305){_0x565db7=_0x258305;_0x24c233=0xc8;}else{_0x24c233=0xce;}_0x4b9ac8[_0x9cd5('0x1c')](_0x24c233);return _0x4b9ac8[_0x9cd5('0x22')](_0x9cd5('0x23'),_0x1ea3f7+'-'+_0x565db7+'/'+_0x258305)[_0x9cd5('0x1e')](_0x5c4f3d);}return null;};}function patchUpdates(_0x1ff788){return function(_0x5c1622){try{jsonpatch[_0x9cd5('0x24')](_0x5c1622,_0x1ff788,!![]);}catch(_0x18346f){return BPromise[_0x9cd5('0x25')](_0x18346f);}return _0x5c1622[_0x9cd5('0x26')]();};}function saveUpdates(_0x2e2b47,_0x4ed8b9){return function(_0x16c4e9){if(_0x16c4e9){return _0x16c4e9[_0x9cd5('0x27')](_0x2e2b47)[_0x9cd5('0x28')](function(_0x12e402){return _0x12e402;});}return null;};}function removeEntity(_0x2ce1ae,_0x1185d7){return function(_0x1cf603){if(_0x1cf603){return _0x1cf603[_0x9cd5('0x29')]()[_0x9cd5('0x28')](function(){_0x2ce1ae['status'](0xcc)[_0x9cd5('0x1d')]();});}};}function handleEntityNotFound(_0xba8ee9,_0x1a88e3){return function(_0x43f47d){if(!_0x43f47d){_0xba8ee9['sendStatus'](0x194);}return _0x43f47d;};}function handleError(_0x24ae67,_0x990c25){_0x990c25=_0x990c25||0x1f4;return function(_0x211576){logger[_0x9cd5('0x2a')](_0x211576[_0x9cd5('0x2b')]);if(_0x211576[_0x9cd5('0x2c')]){delete _0x211576[_0x9cd5('0x2c')];}_0x24ae67['status'](_0x990c25)[_0x9cd5('0x2d')](_0x211576);};}exports[_0x9cd5('0x2e')]=function(_0x2f1e4b,_0x4af6c8){var _0x5c33e9={},_0x2e45a3={},_0x502257={'count':0x0,'rows':[]};var _0x52ef5d=_[_0x9cd5('0x2f')](db[_0x9cd5('0x30')][_0x9cd5('0x31')],function(_0x5184b9){return{'name':_0x5184b9[_0x9cd5('0x32')],'type':_0x5184b9[_0x9cd5('0x33')][_0x9cd5('0x34')]};});_0x2e45a3[_0x9cd5('0x35')]=_[_0x9cd5('0x2f')](_0x52ef5d,_0x9cd5('0x2c'));_0x2e45a3[_0x9cd5('0x36')]=_[_0x9cd5('0x37')](_0x2f1e4b[_0x9cd5('0x36')]);_0x2e45a3[_0x9cd5('0x38')]=_[_0x9cd5('0x39')](_0x2e45a3[_0x9cd5('0x35')],_0x2e45a3[_0x9cd5('0x36')]);_0x5c33e9[_0x9cd5('0x3a')]=_['intersection'](_0x2e45a3[_0x9cd5('0x35')],qs[_0x9cd5('0x3b')](_0x2f1e4b['query']['fields']));_0x5c33e9[_0x9cd5('0x3a')]=_0x5c33e9[_0x9cd5('0x3a')]['length']?_0x5c33e9[_0x9cd5('0x3a')]:_0x2e45a3['model'];if(!_0x2f1e4b['query'][_0x9cd5('0x3c')](_0x9cd5('0x3d'))){_0x5c33e9[_0x9cd5('0x21')]=qs[_0x9cd5('0x21')](_0x2f1e4b['query'][_0x9cd5('0x21')]);_0x5c33e9[_0x9cd5('0x20')]=qs[_0x9cd5('0x20')](_0x2f1e4b['query'][_0x9cd5('0x20')]);}_0x5c33e9[_0x9cd5('0x3e')]=qs[_0x9cd5('0x3f')](_0x2f1e4b[_0x9cd5('0x36')][_0x9cd5('0x3f')]);_0x5c33e9[_0x9cd5('0x40')]=qs[_0x9cd5('0x38')](_[_0x9cd5('0x41')](_0x2f1e4b[_0x9cd5('0x36')],_0x2e45a3[_0x9cd5('0x38')]),_0x52ef5d);if(_0x2f1e4b[_0x9cd5('0x36')]['filter']){_0x5c33e9[_0x9cd5('0x40')]=_['merge'](_0x5c33e9['where'],{'$or':_[_0x9cd5('0x2f')](_0x52ef5d,function(_0x3cf5e9){if(_0x3cf5e9[_0x9cd5('0x33')]!==_0x9cd5('0x42')){var _0x54bc49={};_0x54bc49[_0x3cf5e9[_0x9cd5('0x2c')]]={'$like':'%'+_0x2f1e4b[_0x9cd5('0x36')][_0x9cd5('0x43')]+'%'};return _0x54bc49;}})});}_0x5c33e9=_[_0x9cd5('0x44')]({},_0x5c33e9,_0x2f1e4b['options']);var _0x36e22c={'where':_0x5c33e9[_0x9cd5('0x40')]};return db[_0x9cd5('0x30')][_0x9cd5('0x1f')](_0x36e22c)[_0x9cd5('0x28')](function(_0x16e6b3){_0x502257['count']=_0x16e6b3;if(_0x2f1e4b[_0x9cd5('0x36')][_0x9cd5('0x45')]){_0x5c33e9[_0x9cd5('0x46')]=[{'all':!![]}];}return db[_0x9cd5('0x30')][_0x9cd5('0x47')](_0x5c33e9);})[_0x9cd5('0x28')](function(_0x12d604){_0x502257[_0x9cd5('0x48')]=_0x12d604;return _0x502257;})[_0x9cd5('0x28')](respondWithFilteredResult(_0x4af6c8,_0x5c33e9))[_0x9cd5('0x49')](handleError(_0x4af6c8,null));};exports[_0x9cd5('0x4a')]=function(_0x3ed405,_0x7ad8ec){var _0xa12319={'raw':![],'where':{'id':_0x3ed405[_0x9cd5('0x4b')]['id']}},_0x3b316b={};_0x3b316b[_0x9cd5('0x35')]=_[_0x9cd5('0x37')](db['UserProfileResource'][_0x9cd5('0x31')]);_0x3b316b['query']=_[_0x9cd5('0x37')](_0x3ed405[_0x9cd5('0x36')]);_0x3b316b[_0x9cd5('0x38')]=_[_0x9cd5('0x39')](_0x3b316b[_0x9cd5('0x35')],_0x3b316b['query']);_0xa12319[_0x9cd5('0x3a')]=_[_0x9cd5('0x39')](_0x3b316b[_0x9cd5('0x35')],qs['fields'](_0x3ed405[_0x9cd5('0x36')][_0x9cd5('0x3b')]));_0xa12319[_0x9cd5('0x3a')]=_0xa12319[_0x9cd5('0x3a')]['length']?_0xa12319[_0x9cd5('0x3a')]:_0x3b316b[_0x9cd5('0x35')];if(_0x3ed405[_0x9cd5('0x36')][_0x9cd5('0x45')]){_0xa12319[_0x9cd5('0x46')]=[{'all':!![]}];}_0xa12319=_[_0x9cd5('0x44')]({},_0xa12319,_0x3ed405[_0x9cd5('0x4c')]);return db[_0x9cd5('0x30')][_0x9cd5('0x4d')](_0xa12319)[_0x9cd5('0x28')](handleEntityNotFound(_0x7ad8ec,null))[_0x9cd5('0x28')](respondWithResult(_0x7ad8ec,null))[_0x9cd5('0x49')](handleError(_0x7ad8ec,null));};exports[_0x9cd5('0x4e')]=function(_0x1e1ba0,_0x245f9e){return db[_0x9cd5('0x30')][_0x9cd5('0x4e')](_0x1e1ba0[_0x9cd5('0x4f')],{})['then'](respondWithResult(_0x245f9e,0xc9))[_0x9cd5('0x49')](handleError(_0x245f9e,null));};exports[_0x9cd5('0x27')]=function(_0x3fead7,_0x2058a6){if(_0x3fead7['body']['id']){delete _0x3fead7[_0x9cd5('0x4f')]['id'];}return db[_0x9cd5('0x30')]['find']({'where':{'id':_0x3fead7[_0x9cd5('0x4b')]['id']}})[_0x9cd5('0x28')](handleEntityNotFound(_0x2058a6,null))[_0x9cd5('0x28')](saveUpdates(_0x3fead7[_0x9cd5('0x4f')],null))[_0x9cd5('0x28')](respondWithResult(_0x2058a6,null))[_0x9cd5('0x49')](handleError(_0x2058a6,null));};exports[_0x9cd5('0x29')]=function(_0x14c585,_0x5b6c7d){return db['UserProfileResource'][_0x9cd5('0x4d')]({'where':{'id':_0x14c585[_0x9cd5('0x4b')]['id']}})[_0x9cd5('0x28')](handleEntityNotFound(_0x5b6c7d,null))[_0x9cd5('0x28')](removeEntity(_0x5b6c7d,null))['catch'](handleError(_0x5b6c7d,null));};exports[_0x9cd5('0x50')]=function(_0x55ac13,_0x5d4463){return db[_0x9cd5('0x30')][_0x9cd5('0x50')]()[_0x9cd5('0x28')](respondWithResult(_0x5d4463,null))['catch'](handleError(_0x5d4463,null));};
\ No newline at end of file
diff --git a/server/api/userProfileResource/userProfileResource.model.js b/server/api/userProfileResource/userProfileResource.model.js
index 1657515..444d172 100644
--- a/server/api/userProfileResource/userProfileResource.model.js
+++ b/server/api/userProfileResource/userProfileResource.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xa571=['user_profile_has_resources','resourceId','sectionId','lodash','util','../../config/logger','api','bluebird','request-promise','../../config/environment','exports','define','UserProfileResource'];(function(_0x5de1bc,_0x434be1){var _0x19f4b8=function(_0x35f764){while(--_0x35f764){_0x5de1bc['push'](_0x5de1bc['shift']());}};_0x19f4b8(++_0x434be1);}(_0xa571,0x107));var _0x1a57=function(_0x330cc5,_0x147150){_0x330cc5=_0x330cc5-0x0;var _0x5b3ad9=_0xa571[_0x330cc5];return _0x5b3ad9;};'use strict';var _=require(_0x1a57('0x0'));var util=require(_0x1a57('0x1'));var logger=require(_0x1a57('0x2'))(_0x1a57('0x3'));var moment=require('moment');var BPromise=require(_0x1a57('0x4'));var rp=require(_0x1a57('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x1a57('0x6'));var attributes=require('./userProfileResource.attributes');module[_0x1a57('0x7')]=function(_0xd97a33,_0x22ca20){return _0xd97a33[_0x1a57('0x8')](_0x1a57('0x9'),attributes,{'tableName':_0x1a57('0xa'),'paranoid':![],'indexes':[{'name':'compositeIndex','fields':[_0x1a57('0xb'),_0x1a57('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xf4eb=['user_profile_has_resources','sectionId','lodash','bluebird','rimraf','../../config/environment','./userProfileResource.attributes','exports','define'];(function(_0x2acbce,_0x2b48d3){var _0x1de0e0=function(_0x36ae0e){while(--_0x36ae0e){_0x2acbce['push'](_0x2acbce['shift']());}};_0x1de0e0(++_0x2b48d3);}(_0xf4eb,0xec));var _0xbf4e=function(_0x5f417c,_0x202f90){_0x5f417c=_0x5f417c-0x0;var _0x484c88=_0xf4eb[_0x5f417c];return _0x484c88;};'use strict';var _=require(_0xbf4e('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xbf4e('0x1'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xbf4e('0x2'));var config=require(_0xbf4e('0x3'));var attributes=require(_0xbf4e('0x4'));module[_0xbf4e('0x5')]=function(_0xa4dcf5,_0x2fcfed){return _0xa4dcf5[_0xbf4e('0x6')]('UserProfileResource',attributes,{'tableName':_0xbf4e('0x7'),'paranoid':![],'indexes':[{'name':'compositeIndex','fields':['resourceId',_0xbf4e('0x8')]}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/userProfileResource/userProfileResource.rpc.js b/server/api/userProfileResource/userProfileResource.rpc.js
index d017ed7..415d77f 100644
--- a/server/api/userProfileResource/userProfileResource.rpc.js
+++ b/server/api/userProfileResource/userProfileResource.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x839a=['rpc','../../config/environment','jayson/promise','http','request','then','info','UserProfileResource,\x20%s,\x20%s','debug','UserProfileResource,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x8d2eef,_0xbf1eab){var _0xf14450=function(_0x45103e){while(--_0x45103e){_0x8d2eef['push'](_0x8d2eef['shift']());}};_0xf14450(++_0xbf1eab);}(_0x839a,0x1f1));var _0xa839=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0x839a[_0x432682];return _0x463d05;};'use strict';var _=require('lodash');var util=require(_0xa839('0x0'));var moment=require(_0xa839('0x1'));var BPromise=require(_0xa839('0x2'));var rs=require(_0xa839('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa839('0x4'))['db'];var utils=require(_0xa839('0x5'));var logger=require(_0xa839('0x6'))(_0xa839('0x7'));var config=require(_0xa839('0x8'));var jayson=require(_0xa839('0x9'));var client=jayson['client'][_0xa839('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3fa4e1,_0x31b517,_0x388aa9){return new BPromise(function(_0x3fd59b,_0x53608f){return client[_0xa839('0xb')](_0x3fa4e1,_0x388aa9)[_0xa839('0xc')](function(_0x5037af){logger[_0xa839('0xd')](_0xa839('0xe'),_0x31b517,'request\x20sent');logger[_0xa839('0xf')](_0xa839('0x10'),_0x31b517,_0xa839('0x11'),JSON[_0xa839('0x12')](_0x5037af));if(_0x5037af[_0xa839('0x13')]){if(_0x5037af[_0xa839('0x13')][_0xa839('0x14')]===0x1f4){logger['error']('UserProfileResource,\x20%s,\x20%s',_0x31b517,_0x5037af[_0xa839('0x13')][_0xa839('0x15')]);return _0x53608f(_0x5037af['error'][_0xa839('0x15')]);}logger['error'](_0xa839('0xe'),_0x31b517,_0x5037af[_0xa839('0x13')]['message']);return _0x3fd59b(_0x5037af['error'][_0xa839('0x15')]);}else{logger['info'](_0xa839('0xe'),_0x31b517,_0xa839('0x11'));_0x3fd59b(_0x5037af[_0xa839('0x16')][_0xa839('0x15')]);}})[_0xa839('0x17')](function(_0x42a14b){logger[_0xa839('0x13')](_0xa839('0xe'),_0x31b517,_0x42a14b);_0x53608f(_0x42a14b);});});}
\ No newline at end of file
+var _0x7d19=['info','request\x20sent','debug','stringify','error','code','UserProfileResource,\x20%s,\x20%s','message','catch','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','request'];(function(_0x239786,_0x471f27){var _0x3f15e2=function(_0x1c3781){while(--_0x1c3781){_0x239786['push'](_0x239786['shift']());}};_0x3f15e2(++_0x471f27);}(_0x7d19,0x139));var _0x97d1=function(_0x45cd35,_0x41147c){_0x45cd35=_0x45cd35-0x0;var _0x16db84=_0x7d19[_0x45cd35];return _0x16db84;};'use strict';var _=require(_0x97d1('0x0'));var util=require(_0x97d1('0x1'));var moment=require('moment');var BPromise=require(_0x97d1('0x2'));var rs=require(_0x97d1('0x3'));var fs=require('fs');var Redis=require(_0x97d1('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x97d1('0x5'));var logger=require(_0x97d1('0x6'))(_0x97d1('0x7'));var config=require('../../config/environment');var jayson=require(_0x97d1('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x505f60,_0xed545b,_0x24b6e0){return new BPromise(function(_0x734c84,_0x23fa16){return client[_0x97d1('0x9')](_0x505f60,_0x24b6e0)['then'](function(_0x42a545){logger[_0x97d1('0xa')]('UserProfileResource,\x20%s,\x20%s',_0xed545b,_0x97d1('0xb'));logger[_0x97d1('0xc')]('UserProfileResource,\x20%s,\x20%s,\x20%s',_0xed545b,'request\x20sent',JSON[_0x97d1('0xd')](_0x42a545));if(_0x42a545[_0x97d1('0xe')]){if(_0x42a545[_0x97d1('0xe')][_0x97d1('0xf')]===0x1f4){logger['error'](_0x97d1('0x10'),_0xed545b,_0x42a545['error'][_0x97d1('0x11')]);return _0x23fa16(_0x42a545[_0x97d1('0xe')]['message']);}logger['error'](_0x97d1('0x10'),_0xed545b,_0x42a545[_0x97d1('0xe')]['message']);return _0x734c84(_0x42a545[_0x97d1('0xe')][_0x97d1('0x11')]);}else{logger[_0x97d1('0xa')](_0x97d1('0x10'),_0xed545b,'request\x20sent');_0x734c84(_0x42a545['result']['message']);}})[_0x97d1('0x12')](function(_0x218444){logger[_0x97d1('0xe')](_0x97d1('0x10'),_0xed545b,_0x218444);_0x23fa16(_0x218444);});});}
\ No newline at end of file
diff --git a/server/api/userProfileSection/index.js b/server/api/userProfileSection/index.js
index f87202b..ba3dcfd 100644
--- a/server/api/userProfileSection/index.js
+++ b/server/api/userProfileSection/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xa573=['index','/describe','describe','/:id','show','post','create','put','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./userProfileSection.controller','get','isAuthenticated'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xa573,0x95));var _0x3a57=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa573[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x3a57('0x0'));var util=require(_0x3a57('0x1'));var path=require(_0x3a57('0x2'));var timeout=require(_0x3a57('0x3'));var express=require(_0x3a57('0x4'));var router=express[_0x3a57('0x5')]();var auth=require(_0x3a57('0x6'));var interaction=require(_0x3a57('0x7'));var config=require(_0x3a57('0x8'));var controller=require(_0x3a57('0x9'));router[_0x3a57('0xa')]('/',auth[_0x3a57('0xb')](),controller[_0x3a57('0xc')]);router[_0x3a57('0xa')](_0x3a57('0xd'),auth[_0x3a57('0xb')](),controller[_0x3a57('0xe')]);router['get'](_0x3a57('0xf'),auth['isAuthenticated'](),controller[_0x3a57('0x10')]);router[_0x3a57('0x11')]('/',auth['isAuthenticated'](),controller[_0x3a57('0x12')]);router[_0x3a57('0x13')](_0x3a57('0xf'),auth[_0x3a57('0xb')](),controller['update']);router[_0x3a57('0x14')]('/:id',auth['isAuthenticated'](),controller[_0x3a57('0x15')]);module[_0x3a57('0x16')]=router;
\ No newline at end of file
+var _0x1c73=['isAuthenticated','index','/describe','/:id','post','create','put','delete','destroy','exports','util','path','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./userProfileSection.controller','get'];(function(_0x441c12,_0x491e5a){var _0x312edf=function(_0x40605b){while(--_0x40605b){_0x441c12['push'](_0x441c12['shift']());}};_0x312edf(++_0x491e5a);}(_0x1c73,0x76));var _0x31c7=function(_0xdeb0b8,_0x4b9186){_0xdeb0b8=_0xdeb0b8-0x0;var _0x335714=_0x1c73[_0xdeb0b8];return _0x335714;};'use strict';var multer=require('multer');var util=require(_0x31c7('0x0'));var path=require(_0x31c7('0x1'));var timeout=require('connect-timeout');var express=require(_0x31c7('0x2'));var router=express['Router']();var auth=require(_0x31c7('0x3'));var interaction=require(_0x31c7('0x4'));var config=require(_0x31c7('0x5'));var controller=require(_0x31c7('0x6'));router[_0x31c7('0x7')]('/',auth[_0x31c7('0x8')](),controller[_0x31c7('0x9')]);router[_0x31c7('0x7')](_0x31c7('0xa'),auth[_0x31c7('0x8')](),controller['describe']);router[_0x31c7('0x7')](_0x31c7('0xb'),auth[_0x31c7('0x8')](),controller['show']);router[_0x31c7('0xc')]('/',auth['isAuthenticated'](),controller[_0x31c7('0xd')]);router[_0x31c7('0xe')](_0x31c7('0xb'),auth[_0x31c7('0x8')](),controller['update']);router[_0x31c7('0xf')]('/:id',auth[_0x31c7('0x8')](),controller[_0x31c7('0x10')]);module[_0x31c7('0x11')]=router;
\ No newline at end of file
diff --git a/server/api/userProfileSection/userProfileSection.attributes.js b/server/api/userProfileSection/userProfileSection.attributes.js
index 310210f..2bfa654 100644
--- a/server/api/userProfileSection/userProfileSection.attributes.js
+++ b/server/api/userProfileSection/userProfileSection.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x668b=['BOOLEAN','setDataValue','crudPermissions','getDataValue','split','sequelize','exports','STRING','INTEGER'];(function(_0x1619c1,_0x21b9fd){var _0x424d3f=function(_0x388463){while(--_0x388463){_0x1619c1['push'](_0x1619c1['shift']());}};_0x424d3f(++_0x21b9fd);}(_0x668b,0x140));var _0xb668=function(_0x2b49bc,_0x47b636){_0x2b49bc=_0x2b49bc-0x0;var _0x43cc65=_0x668b[_0x2b49bc];return _0x43cc65;};'use strict';var Sequelize=require(_0xb668('0x0'));module[_0xb668('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'category':{'type':Sequelize[_0xb668('0x2')],'allowNull':![]},'sectionId':{'type':Sequelize[_0xb668('0x3')],'allowNull':![]},'enabled':{'type':Sequelize['BOOLEAN'],'defaultValue':null},'autoAssociation':{'type':Sequelize[_0xb668('0x4')],'defaultValue':null},'crudPermissions':{'type':Sequelize['STRING'],'set':function(_0x2fab11){this[_0xb668('0x5')](_0xb668('0x6'),_0x2fab11?_0x2fab11['join'](''):[]);},'get':function(){return this[_0xb668('0x7')](_0xb668('0x6'))?this[_0xb668('0x7')](_0xb668('0x6'))[_0xb668('0x8')](''):[];}}};
\ No newline at end of file
+var _0x0ab2=['getDataValue','split','STRING','INTEGER','BOOLEAN','crudPermissions'];(function(_0x832664,_0x484287){var _0xd26ed7=function(_0x1fe8b7){while(--_0x1fe8b7){_0x832664['push'](_0x832664['shift']());}};_0xd26ed7(++_0x484287);}(_0x0ab2,0x92));var _0x20ab=function(_0x221628,_0x1c3672){_0x221628=_0x221628-0x0;var _0x7b67e=_0x0ab2[_0x221628];return _0x7b67e;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x20ab('0x0')],'allowNull':![]},'category':{'type':Sequelize['STRING'],'allowNull':![]},'sectionId':{'type':Sequelize[_0x20ab('0x1')],'allowNull':![]},'enabled':{'type':Sequelize[_0x20ab('0x2')],'defaultValue':null},'autoAssociation':{'type':Sequelize['BOOLEAN'],'defaultValue':null},'crudPermissions':{'type':Sequelize['STRING'],'set':function(_0x2aa2b9){this['setDataValue'](_0x20ab('0x3'),_0x2aa2b9?_0x2aa2b9['join'](''):[]);},'get':function(){return this[_0x20ab('0x4')](_0x20ab('0x3'))?this[_0x20ab('0x4')](_0x20ab('0x3'))[_0x20ab('0x5')](''):[];}}};
\ No newline at end of file
diff --git a/server/api/userProfileSection/userProfileSection.controller.js b/server/api/userProfileSection/userProfileSection.controller.js
index 23c710a..4fe86c2 100644
--- a/server/api/userProfileSection/userProfileSection.controller.js
+++ b/server/api/userProfileSection/userProfileSection.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x342b=['../../mysqldb','status','json','offset','limit','set','Content-Range','reject','update','then','end','error','stack','name','send','index','map','UserProfileSection','rawAttributes','key','query','keys','filters','intersection','attributes','fields','length','model','order','sort','pick','filter','merge','where','options','count','includeAll','findAll','rows','catch','show','params','include','find','create','body','destroy','describe','html-pdf','rimraf','zip-dir','fast-json-patch','util','path','sox','to-csv','ejs','lodash','squel','crypto','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment'];(function(_0x17f235,_0x3785a6){var _0x5b61dd=function(_0x7b4cae){while(--_0x7b4cae){_0x17f235['push'](_0x17f235['shift']());}};_0x5b61dd(++_0x3785a6);}(_0x342b,0xbc));var _0xb342=function(_0x2478d6,_0x1b5b3d){_0x2478d6=_0x2478d6-0x0;var _0x5bb23a=_0x342b[_0x2478d6];return _0x5bb23a;};'use strict';var pdf=require(_0xb342('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xb342('0x1'));var zipdir=require(_0xb342('0x2'));var jsonpatch=require(_0xb342('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xb342('0x4'));var path=require(_0xb342('0x5'));var sox=require(_0xb342('0x6'));var csv=require(_0xb342('0x7'));var ejs=require(_0xb342('0x8'));var fs=require('fs');var _=require(_0xb342('0x9'));var squel=require(_0xb342('0xa'));var crypto=require(_0xb342('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xb342('0x7'));var querystring=require(_0xb342('0xc'));var Papa=require('papaparse');var Redis=require(_0xb342('0xd'));var authService=require(_0xb342('0xe'));var qs=require(_0xb342('0xf'));var as=require(_0xb342('0x10'));var hardwareService=require(_0xb342('0x11'));var logger=require(_0xb342('0x12'))(_0xb342('0x13'));var utils=require(_0xb342('0x14'));var config=require(_0xb342('0x15'));var db=require(_0xb342('0x16'))['db'];function respondWithStatusCode(_0x1362b8,_0x54d945){_0x54d945=_0x54d945||0xcc;return function(_0x879722){if(_0x879722){return _0x1362b8['sendStatus'](_0x54d945);}return _0x1362b8['status'](_0x54d945)['end']();};}function respondWithResult(_0x486d98,_0xcddbb4){_0xcddbb4=_0xcddbb4||0xc8;return function(_0x249257){if(_0x249257){return _0x486d98[_0xb342('0x17')](_0xcddbb4)[_0xb342('0x18')](_0x249257);}};}function respondWithFilteredResult(_0x9494b0,_0x28cfde){return function(_0x17f16a){if(_0x17f16a){var _0x49a7e6=_0x17f16a['count'],_0x435b8c=_0x28cfde['offset'],_0x1057f9=_0x28cfde[_0xb342('0x19')]+_0x28cfde[_0xb342('0x1a')],_0x4ab953;if(_0x1057f9>=_0x49a7e6){_0x1057f9=_0x49a7e6;_0x4ab953=0xc8;}else{_0x4ab953=0xce;}_0x9494b0['status'](_0x4ab953);return _0x9494b0[_0xb342('0x1b')](_0xb342('0x1c'),_0x435b8c+'-'+_0x1057f9+'/'+_0x49a7e6)[_0xb342('0x18')](_0x17f16a);}return null;};}function patchUpdates(_0x95c8d7){return function(_0x15906f){try{jsonpatch['apply'](_0x15906f,_0x95c8d7,!![]);}catch(_0x53542c){return BPromise[_0xb342('0x1d')](_0x53542c);}return _0x15906f['save']();};}function saveUpdates(_0x341a3c,_0x362af8){return function(_0x41f499){if(_0x41f499){return _0x41f499[_0xb342('0x1e')](_0x341a3c)[_0xb342('0x1f')](function(_0x553fd3){return _0x553fd3;});}return null;};}function removeEntity(_0xd3f9be,_0x4dfca1){return function(_0x99593d){if(_0x99593d){return _0x99593d['destroy']()[_0xb342('0x1f')](function(){_0xd3f9be[_0xb342('0x17')](0xcc)[_0xb342('0x20')]();});}};}function handleEntityNotFound(_0x3198b5,_0x4eda3a){return function(_0x388fed){if(!_0x388fed){_0x3198b5['sendStatus'](0x194);}return _0x388fed;};}function handleError(_0x5df27b,_0x2b1a8e){_0x2b1a8e=_0x2b1a8e||0x1f4;return function(_0x5cc8d7){logger[_0xb342('0x21')](_0x5cc8d7[_0xb342('0x22')]);if(_0x5cc8d7[_0xb342('0x23')]){delete _0x5cc8d7[_0xb342('0x23')];}_0x5df27b['status'](_0x2b1a8e)[_0xb342('0x24')](_0x5cc8d7);};}exports[_0xb342('0x25')]=function(_0x1a7b76,_0xe36c4b){var _0x4696ac={},_0x27005b={},_0x127dbc={'count':0x0,'rows':[]};var _0x59f5b4=_[_0xb342('0x26')](db[_0xb342('0x27')][_0xb342('0x28')],function(_0x542ce4){return{'name':_0x542ce4['fieldName'],'type':_0x542ce4['type'][_0xb342('0x29')]};});_0x27005b['model']=_[_0xb342('0x26')](_0x59f5b4,'name');_0x27005b[_0xb342('0x2a')]=_[_0xb342('0x2b')](_0x1a7b76[_0xb342('0x2a')]);_0x27005b[_0xb342('0x2c')]=_[_0xb342('0x2d')](_0x27005b['model'],_0x27005b[_0xb342('0x2a')]);_0x4696ac[_0xb342('0x2e')]=_[_0xb342('0x2d')](_0x27005b['model'],qs[_0xb342('0x2f')](_0x1a7b76['query'][_0xb342('0x2f')]));_0x4696ac[_0xb342('0x2e')]=_0x4696ac[_0xb342('0x2e')][_0xb342('0x30')]?_0x4696ac[_0xb342('0x2e')]:_0x27005b[_0xb342('0x31')];if(!_0x1a7b76[_0xb342('0x2a')]['hasOwnProperty']('nolimit')){_0x4696ac['limit']=qs[_0xb342('0x1a')](_0x1a7b76[_0xb342('0x2a')]['limit']);_0x4696ac['offset']=qs[_0xb342('0x19')](_0x1a7b76[_0xb342('0x2a')][_0xb342('0x19')]);}_0x4696ac[_0xb342('0x32')]=qs[_0xb342('0x33')](_0x1a7b76[_0xb342('0x2a')][_0xb342('0x33')]);_0x4696ac['where']=qs[_0xb342('0x2c')](_[_0xb342('0x34')](_0x1a7b76[_0xb342('0x2a')],_0x27005b[_0xb342('0x2c')]),_0x59f5b4);if(_0x1a7b76[_0xb342('0x2a')][_0xb342('0x35')]){_0x4696ac['where']=_[_0xb342('0x36')](_0x4696ac[_0xb342('0x37')],{'$or':_[_0xb342('0x26')](_0x59f5b4,function(_0x3bd06c){if(_0x3bd06c['type']!=='VIRTUAL'){var _0x481b8e={};_0x481b8e[_0x3bd06c[_0xb342('0x23')]]={'$like':'%'+_0x1a7b76[_0xb342('0x2a')][_0xb342('0x35')]+'%'};return _0x481b8e;}})});}_0x4696ac=_['merge']({},_0x4696ac,_0x1a7b76[_0xb342('0x38')]);var _0x194d08={'where':_0x4696ac['where']};return db[_0xb342('0x27')][_0xb342('0x39')](_0x194d08)[_0xb342('0x1f')](function(_0x3f358a){_0x127dbc[_0xb342('0x39')]=_0x3f358a;if(_0x1a7b76[_0xb342('0x2a')][_0xb342('0x3a')]){_0x4696ac['include']=[{'all':!![]}];}return db['UserProfileSection'][_0xb342('0x3b')](_0x4696ac);})[_0xb342('0x1f')](function(_0x2388eb){_0x127dbc[_0xb342('0x3c')]=_0x2388eb;return _0x127dbc;})[_0xb342('0x1f')](respondWithFilteredResult(_0xe36c4b,_0x4696ac))[_0xb342('0x3d')](handleError(_0xe36c4b,null));};exports[_0xb342('0x3e')]=function(_0x28e053,_0x3de6a9){var _0x299e20={'raw':![],'where':{'id':_0x28e053[_0xb342('0x3f')]['id']}},_0x263633={};_0x263633[_0xb342('0x31')]=_[_0xb342('0x2b')](db[_0xb342('0x27')][_0xb342('0x28')]);_0x263633['query']=_['keys'](_0x28e053['query']);_0x263633[_0xb342('0x2c')]=_[_0xb342('0x2d')](_0x263633[_0xb342('0x31')],_0x263633[_0xb342('0x2a')]);_0x299e20[_0xb342('0x2e')]=_['intersection'](_0x263633['model'],qs[_0xb342('0x2f')](_0x28e053['query'][_0xb342('0x2f')]));_0x299e20[_0xb342('0x2e')]=_0x299e20[_0xb342('0x2e')][_0xb342('0x30')]?_0x299e20[_0xb342('0x2e')]:_0x263633[_0xb342('0x31')];if(_0x28e053['query'][_0xb342('0x3a')]){_0x299e20[_0xb342('0x40')]=[{'all':!![]}];}_0x299e20=_[_0xb342('0x36')]({},_0x299e20,_0x28e053['options']);return db[_0xb342('0x27')][_0xb342('0x41')](_0x299e20)['then'](handleEntityNotFound(_0x3de6a9,null))[_0xb342('0x1f')](respondWithResult(_0x3de6a9,null))['catch'](handleError(_0x3de6a9,null));};exports[_0xb342('0x42')]=function(_0x53326c,_0x1d6700){return db['UserProfileSection']['create'](_0x53326c[_0xb342('0x43')],{})[_0xb342('0x1f')](respondWithResult(_0x1d6700,0xc9))[_0xb342('0x3d')](handleError(_0x1d6700,null));};exports[_0xb342('0x1e')]=function(_0x4dff08,_0x11b5f2){if(_0x4dff08[_0xb342('0x43')]['id']){delete _0x4dff08[_0xb342('0x43')]['id'];}return db[_0xb342('0x27')][_0xb342('0x41')]({'where':{'id':_0x4dff08[_0xb342('0x3f')]['id']}})['then'](handleEntityNotFound(_0x11b5f2,null))[_0xb342('0x1f')](saveUpdates(_0x4dff08[_0xb342('0x43')],null))['then'](respondWithResult(_0x11b5f2,null))[_0xb342('0x3d')](handleError(_0x11b5f2,null));};exports[_0xb342('0x44')]=function(_0x5122c4,_0x8f915c){return db[_0xb342('0x27')][_0xb342('0x41')]({'where':{'id':_0x5122c4[_0xb342('0x3f')]['id']}})[_0xb342('0x1f')](handleEntityNotFound(_0x8f915c,null))[_0xb342('0x1f')](removeEntity(_0x8f915c,null))[_0xb342('0x3d')](handleError(_0x8f915c,null));};exports[_0xb342('0x45')]=function(_0x348ff7,_0x204fde){return db[_0xb342('0x27')][_0xb342('0x45')]()['then'](respondWithResult(_0x204fde,null))[_0xb342('0x3d')](handleError(_0x204fde,null));};
\ No newline at end of file
+var _0xd6d9=['includeAll','include','options','find','create','body','describe','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/environment','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','index','map','rawAttributes','fieldName','type','model','query','keys','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','merge','VIRTUAL','filter','UserProfileSection','findAll','rows','catch','show','params','filters','intersection'];(function(_0x2fc8be,_0x2be401){var _0x24dc73=function(_0x108a15){while(--_0x108a15){_0x2fc8be['push'](_0x2fc8be['shift']());}};_0x24dc73(++_0x2be401);}(_0xd6d9,0x16a));var _0x9d6d=function(_0x14363e,_0x4f0e0d){_0x14363e=_0x14363e-0x0;var _0x17c56d=_0xd6d9[_0x14363e];return _0x17c56d;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x9d6d('0x0'));var rimraf=require(_0x9d6d('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x9d6d('0x2'));var rp=require('request-promise');var moment=require(_0x9d6d('0x3'));var BPromise=require(_0x9d6d('0x4'));var Mustache=require(_0x9d6d('0x5'));var util=require(_0x9d6d('0x6'));var path=require('path');var sox=require(_0x9d6d('0x7'));var csv=require(_0x9d6d('0x8'));var ejs=require(_0x9d6d('0x9'));var fs=require('fs');var _=require(_0x9d6d('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x9d6d('0xb'));var deskjs=require(_0x9d6d('0xc'));var toCsv=require(_0x9d6d('0x8'));var querystring=require(_0x9d6d('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x9d6d('0xe'));var qs=require(_0x9d6d('0xf'));var as=require(_0x9d6d('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x9d6d('0x11'))('api');var utils=require('../../config/utils');var config=require(_0x9d6d('0x12'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2c23ad,_0xce3e4){_0xce3e4=_0xce3e4||0xcc;return function(_0x575f97){if(_0x575f97){return _0x2c23ad[_0x9d6d('0x13')](_0xce3e4);}return _0x2c23ad[_0x9d6d('0x14')](_0xce3e4)[_0x9d6d('0x15')]();};}function respondWithResult(_0x288047,_0x61b81e){_0x61b81e=_0x61b81e||0xc8;return function(_0x3714cb){if(_0x3714cb){return _0x288047['status'](_0x61b81e)[_0x9d6d('0x16')](_0x3714cb);}};}function respondWithFilteredResult(_0x2a082e,_0x55a4d1){return function(_0x3c472d){if(_0x3c472d){var _0xd94a86=_0x3c472d[_0x9d6d('0x17')],_0x5202c6=_0x55a4d1[_0x9d6d('0x18')],_0x5c727b=_0x55a4d1[_0x9d6d('0x18')]+_0x55a4d1[_0x9d6d('0x19')],_0x3847cd;if(_0x5c727b>=_0xd94a86){_0x5c727b=_0xd94a86;_0x3847cd=0xc8;}else{_0x3847cd=0xce;}_0x2a082e[_0x9d6d('0x14')](_0x3847cd);return _0x2a082e[_0x9d6d('0x1a')](_0x9d6d('0x1b'),_0x5202c6+'-'+_0x5c727b+'/'+_0xd94a86)[_0x9d6d('0x16')](_0x3c472d);}return null;};}function patchUpdates(_0x3f1765){return function(_0x25091e){try{jsonpatch[_0x9d6d('0x1c')](_0x25091e,_0x3f1765,!![]);}catch(_0x10a0e7){return BPromise[_0x9d6d('0x1d')](_0x10a0e7);}return _0x25091e[_0x9d6d('0x1e')]();};}function saveUpdates(_0x4ad943,_0x25d555){return function(_0x5f82bb){if(_0x5f82bb){return _0x5f82bb[_0x9d6d('0x1f')](_0x4ad943)[_0x9d6d('0x20')](function(_0x4dac46){return _0x4dac46;});}return null;};}function removeEntity(_0x359384,_0x49f12f){return function(_0x2626f8){if(_0x2626f8){return _0x2626f8[_0x9d6d('0x21')]()[_0x9d6d('0x20')](function(){_0x359384[_0x9d6d('0x14')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3d1548,_0x28461c){return function(_0x5e6cc3){if(!_0x5e6cc3){_0x3d1548[_0x9d6d('0x13')](0x194);}return _0x5e6cc3;};}function handleError(_0x247815,_0x1b010a){_0x1b010a=_0x1b010a||0x1f4;return function(_0x45d8e8){logger[_0x9d6d('0x22')](_0x45d8e8[_0x9d6d('0x23')]);if(_0x45d8e8[_0x9d6d('0x24')]){delete _0x45d8e8['name'];}_0x247815[_0x9d6d('0x14')](_0x1b010a)['send'](_0x45d8e8);};}exports[_0x9d6d('0x25')]=function(_0x47d723,_0x4054d3){var _0x206e0={},_0x259467={},_0x189934={'count':0x0,'rows':[]};var _0x2c76f2=_[_0x9d6d('0x26')](db['UserProfileSection'][_0x9d6d('0x27')],function(_0x52e0e3){return{'name':_0x52e0e3[_0x9d6d('0x28')],'type':_0x52e0e3[_0x9d6d('0x29')]['key']};});_0x259467[_0x9d6d('0x2a')]=_[_0x9d6d('0x26')](_0x2c76f2,_0x9d6d('0x24'));_0x259467[_0x9d6d('0x2b')]=_[_0x9d6d('0x2c')](_0x47d723[_0x9d6d('0x2b')]);_0x259467['filters']=_['intersection'](_0x259467[_0x9d6d('0x2a')],_0x259467[_0x9d6d('0x2b')]);_0x206e0[_0x9d6d('0x2d')]=_['intersection'](_0x259467[_0x9d6d('0x2a')],qs[_0x9d6d('0x2e')](_0x47d723[_0x9d6d('0x2b')][_0x9d6d('0x2e')]));_0x206e0['attributes']=_0x206e0[_0x9d6d('0x2d')][_0x9d6d('0x2f')]?_0x206e0[_0x9d6d('0x2d')]:_0x259467['model'];if(!_0x47d723['query'][_0x9d6d('0x30')](_0x9d6d('0x31'))){_0x206e0[_0x9d6d('0x19')]=qs[_0x9d6d('0x19')](_0x47d723[_0x9d6d('0x2b')][_0x9d6d('0x19')]);_0x206e0[_0x9d6d('0x18')]=qs[_0x9d6d('0x18')](_0x47d723[_0x9d6d('0x2b')][_0x9d6d('0x18')]);}_0x206e0['order']=qs['sort'](_0x47d723[_0x9d6d('0x2b')][_0x9d6d('0x32')]);_0x206e0[_0x9d6d('0x33')]=qs['filters'](_[_0x9d6d('0x34')](_0x47d723['query'],_0x259467['filters']),_0x2c76f2);if(_0x47d723['query']['filter']){_0x206e0['where']=_[_0x9d6d('0x35')](_0x206e0['where'],{'$or':_[_0x9d6d('0x26')](_0x2c76f2,function(_0xe47952){if(_0xe47952[_0x9d6d('0x29')]!==_0x9d6d('0x36')){var _0x39653={};_0x39653[_0xe47952['name']]={'$like':'%'+_0x47d723[_0x9d6d('0x2b')][_0x9d6d('0x37')]+'%'};return _0x39653;}})});}_0x206e0=_[_0x9d6d('0x35')]({},_0x206e0,_0x47d723['options']);var _0x45223c={'where':_0x206e0[_0x9d6d('0x33')]};return db['UserProfileSection']['count'](_0x45223c)[_0x9d6d('0x20')](function(_0x31f880){_0x189934[_0x9d6d('0x17')]=_0x31f880;if(_0x47d723[_0x9d6d('0x2b')]['includeAll']){_0x206e0['include']=[{'all':!![]}];}return db[_0x9d6d('0x38')][_0x9d6d('0x39')](_0x206e0);})['then'](function(_0x8490d2){_0x189934[_0x9d6d('0x3a')]=_0x8490d2;return _0x189934;})[_0x9d6d('0x20')](respondWithFilteredResult(_0x4054d3,_0x206e0))[_0x9d6d('0x3b')](handleError(_0x4054d3,null));};exports[_0x9d6d('0x3c')]=function(_0x91dddb,_0x1dbfd7){var _0x8268eb={'raw':![],'where':{'id':_0x91dddb[_0x9d6d('0x3d')]['id']}},_0x451419={};_0x451419[_0x9d6d('0x2a')]=_[_0x9d6d('0x2c')](db[_0x9d6d('0x38')]['rawAttributes']);_0x451419['query']=_[_0x9d6d('0x2c')](_0x91dddb[_0x9d6d('0x2b')]);_0x451419[_0x9d6d('0x3e')]=_['intersection'](_0x451419['model'],_0x451419[_0x9d6d('0x2b')]);_0x8268eb[_0x9d6d('0x2d')]=_[_0x9d6d('0x3f')](_0x451419[_0x9d6d('0x2a')],qs[_0x9d6d('0x2e')](_0x91dddb[_0x9d6d('0x2b')][_0x9d6d('0x2e')]));_0x8268eb[_0x9d6d('0x2d')]=_0x8268eb[_0x9d6d('0x2d')][_0x9d6d('0x2f')]?_0x8268eb[_0x9d6d('0x2d')]:_0x451419[_0x9d6d('0x2a')];if(_0x91dddb[_0x9d6d('0x2b')][_0x9d6d('0x40')]){_0x8268eb[_0x9d6d('0x41')]=[{'all':!![]}];}_0x8268eb=_[_0x9d6d('0x35')]({},_0x8268eb,_0x91dddb[_0x9d6d('0x42')]);return db[_0x9d6d('0x38')][_0x9d6d('0x43')](_0x8268eb)[_0x9d6d('0x20')](handleEntityNotFound(_0x1dbfd7,null))[_0x9d6d('0x20')](respondWithResult(_0x1dbfd7,null))['catch'](handleError(_0x1dbfd7,null));};exports[_0x9d6d('0x44')]=function(_0x3f6c65,_0x1a71de){return db['UserProfileSection']['create'](_0x3f6c65[_0x9d6d('0x45')],{})[_0x9d6d('0x20')](respondWithResult(_0x1a71de,0xc9))['catch'](handleError(_0x1a71de,null));};exports['update']=function(_0x15714e,_0x1cad4a){if(_0x15714e[_0x9d6d('0x45')]['id']){delete _0x15714e[_0x9d6d('0x45')]['id'];}return db[_0x9d6d('0x38')]['find']({'where':{'id':_0x15714e['params']['id']}})[_0x9d6d('0x20')](handleEntityNotFound(_0x1cad4a,null))[_0x9d6d('0x20')](saveUpdates(_0x15714e['body'],null))[_0x9d6d('0x20')](respondWithResult(_0x1cad4a,null))[_0x9d6d('0x3b')](handleError(_0x1cad4a,null));};exports[_0x9d6d('0x21')]=function(_0x15d4e1,_0x3055a9){return db[_0x9d6d('0x38')][_0x9d6d('0x43')]({'where':{'id':_0x15d4e1['params']['id']}})['then'](handleEntityNotFound(_0x3055a9,null))[_0x9d6d('0x20')](removeEntity(_0x3055a9,null))[_0x9d6d('0x3b')](handleError(_0x3055a9,null));};exports[_0x9d6d('0x46')]=function(_0x332733,_0x289376){return db[_0x9d6d('0x38')][_0x9d6d('0x46')]()[_0x9d6d('0x20')](respondWithResult(_0x289376,null))[_0x9d6d('0x3b')](handleError(_0x289376,null));};
\ No newline at end of file
diff --git a/server/api/userProfileSection/userProfileSection.model.js b/server/api/userProfileSection/userProfileSection.model.js
index c2fa468..0b3bc5d 100644
--- a/server/api/userProfileSection/userProfileSection.model.js
+++ b/server/api/userProfileSection/userProfileSection.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9fb9=['../../config/logger','api','moment','request-promise','rimraf','../../config/environment','./userProfileSection.attributes','define','UserProfileSection','user_profile_has_sections','compositeIndex','sectionId','lodash'];(function(_0x54fdc3,_0x3ad032){var _0x1e89cc=function(_0x1ec301){while(--_0x1ec301){_0x54fdc3['push'](_0x54fdc3['shift']());}};_0x1e89cc(++_0x3ad032);}(_0x9fb9,0x1ac));var _0x99fb=function(_0x4e0e57,_0x1bc647){_0x4e0e57=_0x4e0e57-0x0;var _0x5a5e03=_0x9fb9[_0x4e0e57];return _0x5a5e03;};'use strict';var _=require(_0x99fb('0x0'));var util=require('util');var logger=require(_0x99fb('0x1'))(_0x99fb('0x2'));var moment=require(_0x99fb('0x3'));var BPromise=require('bluebird');var rp=require(_0x99fb('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x99fb('0x5'));var config=require(_0x99fb('0x6'));var attributes=require(_0x99fb('0x7'));module['exports']=function(_0x408940,_0x193978){return _0x408940[_0x99fb('0x8')](_0x99fb('0x9'),attributes,{'tableName':_0x99fb('0xa'),'paranoid':![],'indexes':[{'name':_0x99fb('0xb'),'fields':[_0x99fb('0xc'),'userProfileId']}],'timestamps':!![]});};
\ No newline at end of file
+var _0xec4f=['compositeIndex','userProfileId','lodash','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./userProfileSection.attributes','define','UserProfileSection','user_profile_has_sections'];(function(_0x27af45,_0x1b57aa){var _0x18df21=function(_0x4b7679){while(--_0x4b7679){_0x27af45['push'](_0x27af45['shift']());}};_0x18df21(++_0x1b57aa);}(_0xec4f,0x18a));var _0xfec4=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xec4f[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xfec4('0x0'));var util=require('util');var logger=require(_0xfec4('0x1'))(_0xfec4('0x2'));var moment=require(_0xfec4('0x3'));var BPromise=require(_0xfec4('0x4'));var rp=require(_0xfec4('0x5'));var fs=require('fs');var path=require(_0xfec4('0x6'));var rimraf=require('rimraf');var config=require(_0xfec4('0x7'));var attributes=require(_0xfec4('0x8'));module['exports']=function(_0x429347,_0x553521){return _0x429347[_0xfec4('0x9')](_0xfec4('0xa'),attributes,{'tableName':_0xfec4('0xb'),'paranoid':![],'indexes':[{'name':_0xfec4('0xc'),'fields':['sectionId',_0xfec4('0xd')]}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/userProfileSection/userProfileSection.rpc.js b/server/api/userProfileSection/userProfileSection.rpc.js
index 6b691c9..456ff70 100644
--- a/server/api/userProfileSection/userProfileSection.rpc.js
+++ b/server/api/userProfileSection/userProfileSection.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x28b9=['http','request','then','info','request\x20sent','UserProfileSection,\x20%s,\x20%s,\x20%s','stringify','error','code','UserProfileSection,\x20%s,\x20%s','message','result','catch','lodash','moment','../../config/utils','../../config/logger','rpc','../../config/environment','client'];(function(_0x1ec197,_0x4a8c29){var _0x53a0ad=function(_0xd1aba4){while(--_0xd1aba4){_0x1ec197['push'](_0x1ec197['shift']());}};_0x53a0ad(++_0x4a8c29);}(_0x28b9,0xad));var _0x928b=function(_0x591e11,_0x363e09){_0x591e11=_0x591e11-0x0;var _0x23a0a=_0x28b9[_0x591e11];return _0x23a0a;};'use strict';var _=require(_0x928b('0x0'));var util=require('util');var moment=require(_0x928b('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x928b('0x2'));var logger=require(_0x928b('0x3'))(_0x928b('0x4'));var config=require(_0x928b('0x5'));var jayson=require('jayson/promise');var client=jayson[_0x928b('0x6')][_0x928b('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x3f7908,_0x34d188,_0x3331a2){return new BPromise(function(_0x3bab20,_0x51ff1c){return client[_0x928b('0x8')](_0x3f7908,_0x3331a2)[_0x928b('0x9')](function(_0x216441){logger[_0x928b('0xa')]('UserProfileSection,\x20%s,\x20%s',_0x34d188,_0x928b('0xb'));logger['debug'](_0x928b('0xc'),_0x34d188,'request\x20sent',JSON[_0x928b('0xd')](_0x216441));if(_0x216441['error']){if(_0x216441[_0x928b('0xe')][_0x928b('0xf')]===0x1f4){logger[_0x928b('0xe')](_0x928b('0x10'),_0x34d188,_0x216441[_0x928b('0xe')][_0x928b('0x11')]);return _0x51ff1c(_0x216441[_0x928b('0xe')][_0x928b('0x11')]);}logger[_0x928b('0xe')](_0x928b('0x10'),_0x34d188,_0x216441[_0x928b('0xe')][_0x928b('0x11')]);return _0x3bab20(_0x216441[_0x928b('0xe')][_0x928b('0x11')]);}else{logger[_0x928b('0xa')](_0x928b('0x10'),_0x34d188,_0x928b('0xb'));_0x3bab20(_0x216441[_0x928b('0x12')][_0x928b('0x11')]);}})[_0x928b('0x13')](function(_0x266383){logger[_0x928b('0xe')](_0x928b('0x10'),_0x34d188,_0x266383);_0x51ff1c(_0x266383);});});}
\ No newline at end of file
+var _0x5c24=['jayson/promise','http','request','then','info','UserProfileSection,\x20%s,\x20%s','request\x20sent','UserProfileSection,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment'];(function(_0x5aa373,_0x54c7f4){var _0x590e8e=function(_0x505e62){while(--_0x505e62){_0x5aa373['push'](_0x5aa373['shift']());}};_0x590e8e(++_0x54c7f4);}(_0x5c24,0x184));var _0x45c2=function(_0x26b622,_0x237e9e){_0x26b622=_0x26b622-0x0;var _0x58a028=_0x5c24[_0x26b622];return _0x58a028;};'use strict';var _=require(_0x45c2('0x0'));var util=require(_0x45c2('0x1'));var moment=require('moment');var BPromise=require(_0x45c2('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x45c2('0x3'));var db=require(_0x45c2('0x4'))['db'];var utils=require(_0x45c2('0x5'));var logger=require('../../config/logger')(_0x45c2('0x6'));var config=require(_0x45c2('0x7'));var jayson=require(_0x45c2('0x8'));var client=jayson['client'][_0x45c2('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x18ace1,_0x318b24,_0x5bdf4c){return new BPromise(function(_0x391703,_0x2e7576){return client[_0x45c2('0xa')](_0x18ace1,_0x5bdf4c)[_0x45c2('0xb')](function(_0x287de8){logger[_0x45c2('0xc')](_0x45c2('0xd'),_0x318b24,_0x45c2('0xe'));logger['debug'](_0x45c2('0xf'),_0x318b24,'request\x20sent',JSON[_0x45c2('0x10')](_0x287de8));if(_0x287de8[_0x45c2('0x11')]){if(_0x287de8[_0x45c2('0x11')][_0x45c2('0x12')]===0x1f4){logger[_0x45c2('0x11')](_0x45c2('0xd'),_0x318b24,_0x287de8[_0x45c2('0x11')][_0x45c2('0x13')]);return _0x2e7576(_0x287de8[_0x45c2('0x11')]['message']);}logger[_0x45c2('0x11')](_0x45c2('0xd'),_0x318b24,_0x287de8['error'][_0x45c2('0x13')]);return _0x391703(_0x287de8[_0x45c2('0x11')]['message']);}else{logger[_0x45c2('0xc')](_0x45c2('0xd'),_0x318b24,'request\x20sent');_0x391703(_0x287de8[_0x45c2('0x14')]['message']);}})[_0x45c2('0x15')](function(_0x18cd2c){logger[_0x45c2('0x11')](_0x45c2('0xd'),_0x318b24,_0x18cd2c);_0x2e7576(_0x18cd2c);});});}
\ No newline at end of file
diff --git a/server/api/userSmsQueue/index.js b/server/api/userSmsQueue/index.js
index 6375d1c..e90ffee 100644
--- a/server/api/userSmsQueue/index.js
+++ b/server/api/userSmsQueue/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x5f0c=['../../components/auth/service','../../components/interaction/service','../../config/environment','exports','util','express','Router'];(function(_0x2d7712,_0x39aba4){var _0x2efa08=function(_0xfbe847){while(--_0xfbe847){_0x2d7712['push'](_0x2d7712['shift']());}};_0x2efa08(++_0x39aba4);}(_0x5f0c,0x1cb));var _0xc5f0=function(_0x59d577,_0x4d90d0){_0x59d577=_0x59d577-0x0;var _0x64cedd=_0x5f0c[_0x59d577];return _0x64cedd;};'use strict';var multer=require('multer');var util=require(_0xc5f0('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xc5f0('0x1'));var router=express[_0xc5f0('0x2')]();var auth=require(_0xc5f0('0x3'));var interaction=require(_0xc5f0('0x4'));var config=require(_0xc5f0('0x5'));module[_0xc5f0('0x6')]=router;
\ No newline at end of file
+var _0xf102=['path','express','../../components/interaction/service','exports','multer','util'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0xf102,0x6a));var _0x2f10=function(_0x4074d5,_0xa57194){_0x4074d5=_0x4074d5-0x0;var _0x502cfe=_0xf102[_0x4074d5];return _0x502cfe;};'use strict';var multer=require(_0x2f10('0x0'));var util=require(_0x2f10('0x1'));var path=require(_0x2f10('0x2'));var timeout=require('connect-timeout');var express=require(_0x2f10('0x3'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x2f10('0x4'));var config=require('../../config/environment');module[_0x2f10('0x5')]=router;
\ No newline at end of file
diff --git a/server/api/userSmsQueue/userSmsQueue.attributes.js b/server/api/userSmsQueue/userSmsQueue.attributes.js
index 44a0cef..b7bbc02 100644
--- a/server/api/userSmsQueue/userSmsQueue.attributes.js
+++ b/server/api/userSmsQueue/userSmsQueue.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xd8b0=['exports','sequelize'];(function(_0x2c921c,_0x3c6a85){var _0x440bf2=function(_0x4db0df){while(--_0x4db0df){_0x2c921c['push'](_0x2c921c['shift']());}};_0x440bf2(++_0x3c6a85);}(_0xd8b0,0xad));var _0x0d8b=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xd8b0[_0x122ef9];return _0x42fba0;};'use strict';var Sequelize=require(_0x0d8b('0x0'));module[_0x0d8b('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}};
\ No newline at end of file
+var _0xe706=['INTEGER','sequelize','exports'];(function(_0x253bea,_0x23b31c){var _0x10cef0=function(_0x4631fa){while(--_0x4631fa){_0x253bea['push'](_0x253bea['shift']());}};_0x10cef0(++_0x23b31c);}(_0xe706,0xa3));var _0x6e70=function(_0x1e2aae,_0x2349e3){_0x1e2aae=_0x1e2aae-0x0;var _0x4d8a43=_0xe706[_0x1e2aae];return _0x4d8a43;};'use strict';var Sequelize=require(_0x6e70('0x0'));module[_0x6e70('0x1')]={'penalty':{'type':Sequelize[_0x6e70('0x2')],'defaultValue':0x0}};
\ No newline at end of file
diff --git a/server/api/userSmsQueue/userSmsQueue.model.js b/server/api/userSmsQueue/userSmsQueue.model.js
index 634ec07..b78d121 100644
--- a/server/api/userSmsQueue/userSmsQueue.model.js
+++ b/server/api/userSmsQueue/userSmsQueue.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x81d5=['request-promise','path','./userSmsQueue.attributes','exports','define','UserSmsQueue','user_has_sms_queues','lodash','util','api','moment','bluebird'];(function(_0x1c87e2,_0x308b29){var _0x21a77f=function(_0x3024e3){while(--_0x3024e3){_0x1c87e2['push'](_0x1c87e2['shift']());}};_0x21a77f(++_0x308b29);}(_0x81d5,0x1ab));var _0x581d=function(_0x5d6a35,_0x2070fa){_0x5d6a35=_0x5d6a35-0x0;var _0x30ece2=_0x81d5[_0x5d6a35];return _0x30ece2;};'use strict';var _=require(_0x581d('0x0'));var util=require(_0x581d('0x1'));var logger=require('../../config/logger')(_0x581d('0x2'));var moment=require(_0x581d('0x3'));var BPromise=require(_0x581d('0x4'));var rp=require(_0x581d('0x5'));var fs=require('fs');var path=require(_0x581d('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x581d('0x7'));module[_0x581d('0x8')]=function(_0x1895d2,_0x4bb545){return _0x1895d2[_0x581d('0x9')](_0x581d('0xa'),attributes,{'tableName':_0x581d('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xa571=['util','../../config/logger','api','bluebird','request-promise','../../config/environment','exports','define','UserSmsQueue','user_has_sms_queues','lodash'];(function(_0x37cccf,_0x4699ff){var _0x23e7a3=function(_0x518fff){while(--_0x518fff){_0x37cccf['push'](_0x37cccf['shift']());}};_0x23e7a3(++_0x4699ff);}(_0xa571,0x107));var _0x1a57=function(_0x32ae42,_0x26a247){_0x32ae42=_0x32ae42-0x0;var _0xf3d8fd=_0xa571[_0x32ae42];return _0xf3d8fd;};'use strict';var _=require(_0x1a57('0x0'));var util=require(_0x1a57('0x1'));var logger=require(_0x1a57('0x2'))(_0x1a57('0x3'));var moment=require('moment');var BPromise=require(_0x1a57('0x4'));var rp=require(_0x1a57('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x1a57('0x6'));var attributes=require('./userSmsQueue.attributes');module[_0x1a57('0x7')]=function(_0xd97a33,_0x22ca20){return _0xd97a33[_0x1a57('0x8')](_0x1a57('0x9'),attributes,{'tableName':_0x1a57('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/userSmsQueue/userSmsQueue.rpc.js b/server/api/userSmsQueue/userSmsQueue.rpc.js
index 33ed63e..9160b63 100644
--- a/server/api/userSmsQueue/userSmsQueue.rpc.js
+++ b/server/api/userSmsQueue/userSmsQueue.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x3366=['../../config/environment','jayson/promise','client','then','info','request\x20sent','UserSmsQueue,\x20%s,\x20%s,\x20%s','error','code','message','UserSmsQueue,\x20%s,\x20%s','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x5d6e84,_0x541fa5){var _0x8b54=function(_0x7cf06f){while(--_0x7cf06f){_0x5d6e84['push'](_0x5d6e84['shift']());}};_0x8b54(++_0x541fa5);}(_0x3366,0xd3));var _0x6336=function(_0x2f6541,_0x363cba){_0x2f6541=_0x2f6541-0x0;var _0x4d76d8=_0x3366[_0x2f6541];return _0x4d76d8;};'use strict';var _=require(_0x6336('0x0'));var util=require(_0x6336('0x1'));var moment=require(_0x6336('0x2'));var BPromise=require('bluebird');var rs=require(_0x6336('0x3'));var fs=require('fs');var Redis=require(_0x6336('0x4'));var db=require(_0x6336('0x5'))['db'];var utils=require(_0x6336('0x6'));var logger=require(_0x6336('0x7'))(_0x6336('0x8'));var config=require(_0x6336('0x9'));var jayson=require(_0x6336('0xa'));var client=jayson[_0x6336('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1a3038,_0x570e0c,_0x4fc419){return new BPromise(function(_0xdbc821,_0x5405f3){return client['request'](_0x1a3038,_0x4fc419)[_0x6336('0xc')](function(_0x29862a){logger[_0x6336('0xd')]('UserSmsQueue,\x20%s,\x20%s',_0x570e0c,_0x6336('0xe'));logger['debug'](_0x6336('0xf'),_0x570e0c,_0x6336('0xe'),JSON['stringify'](_0x29862a));if(_0x29862a['error']){if(_0x29862a[_0x6336('0x10')][_0x6336('0x11')]===0x1f4){logger[_0x6336('0x10')]('UserSmsQueue,\x20%s,\x20%s',_0x570e0c,_0x29862a[_0x6336('0x10')][_0x6336('0x12')]);return _0x5405f3(_0x29862a[_0x6336('0x10')]['message']);}logger[_0x6336('0x10')]('UserSmsQueue,\x20%s,\x20%s',_0x570e0c,_0x29862a[_0x6336('0x10')][_0x6336('0x12')]);return _0xdbc821(_0x29862a[_0x6336('0x10')][_0x6336('0x12')]);}else{logger[_0x6336('0xd')](_0x6336('0x13'),_0x570e0c,_0x6336('0xe'));_0xdbc821(_0x29862a[_0x6336('0x14')][_0x6336('0x12')]);}})[_0x6336('0x15')](function(_0x3fa0b6){logger[_0x6336('0x10')](_0x6336('0x13'),_0x570e0c,_0x3fa0b6);_0x5405f3(_0x3fa0b6);});});}
\ No newline at end of file
+var _0x40c4=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','UserSmsQueue,\x20%s,\x20%s','request\x20sent','stringify','error','message','catch','lodash','moment','bluebird','randomstring','ioredis'];(function(_0x1e520c,_0x56e4a5){var _0x23e44f=function(_0x198fdd){while(--_0x198fdd){_0x1e520c['push'](_0x1e520c['shift']());}};_0x23e44f(++_0x56e4a5);}(_0x40c4,0x160));var _0x440c=function(_0xe10646,_0x47dfb7){_0xe10646=_0xe10646-0x0;var _0x1ff4eb=_0x40c4[_0xe10646];return _0x1ff4eb;};'use strict';var _=require(_0x440c('0x0'));var util=require('util');var moment=require(_0x440c('0x1'));var BPromise=require(_0x440c('0x2'));var rs=require(_0x440c('0x3'));var fs=require('fs');var Redis=require(_0x440c('0x4'));var db=require(_0x440c('0x5'))['db'];var utils=require(_0x440c('0x6'));var logger=require(_0x440c('0x7'))(_0x440c('0x8'));var config=require(_0x440c('0x9'));var jayson=require(_0x440c('0xa'));var client=jayson['client'][_0x440c('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5c566a,_0x57e783,_0x5b33d4){return new BPromise(function(_0x196e38,_0x148cdd){return client[_0x440c('0xc')](_0x5c566a,_0x5b33d4)[_0x440c('0xd')](function(_0x1e61ae){logger[_0x440c('0xe')](_0x440c('0xf'),_0x57e783,_0x440c('0x10'));logger['debug']('UserSmsQueue,\x20%s,\x20%s,\x20%s',_0x57e783,_0x440c('0x10'),JSON[_0x440c('0x11')](_0x1e61ae));if(_0x1e61ae[_0x440c('0x12')]){if(_0x1e61ae[_0x440c('0x12')]['code']===0x1f4){logger[_0x440c('0x12')](_0x440c('0xf'),_0x57e783,_0x1e61ae[_0x440c('0x12')][_0x440c('0x13')]);return _0x148cdd(_0x1e61ae[_0x440c('0x12')][_0x440c('0x13')]);}logger['error'](_0x440c('0xf'),_0x57e783,_0x1e61ae['error']['message']);return _0x196e38(_0x1e61ae[_0x440c('0x12')]['message']);}else{logger[_0x440c('0xe')](_0x440c('0xf'),_0x57e783,'request\x20sent');_0x196e38(_0x1e61ae['result']['message']);}})[_0x440c('0x14')](function(_0x2fd718){logger[_0x440c('0x12')](_0x440c('0xf'),_0x57e783,_0x2fd718);_0x148cdd(_0x2fd718);});});}
\ No newline at end of file
diff --git a/server/api/userVoiceQueue/index.js b/server/api/userVoiceQueue/index.js
index 5dd6746..f483d30 100644
--- a/server/api/userVoiceQueue/index.js
+++ b/server/api/userVoiceQueue/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xfb6f=['../../components/interaction/service','../../config/environment','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service'];(function(_0x4c2adc,_0x3741a1){var _0x13e846=function(_0x1a1501){while(--_0x1a1501){_0x4c2adc['push'](_0x4c2adc['shift']());}};_0x13e846(++_0x3741a1);}(_0xfb6f,0x189));var _0xffb6=function(_0x1fbaeb,_0x1273eb){_0x1fbaeb=_0x1fbaeb-0x0;var _0x2c907b=_0xfb6f[_0x1fbaeb];return _0x2c907b;};'use strict';var multer=require(_0xffb6('0x0'));var util=require(_0xffb6('0x1'));var path=require(_0xffb6('0x2'));var timeout=require(_0xffb6('0x3'));var express=require(_0xffb6('0x4'));var router=express[_0xffb6('0x5')]();var auth=require(_0xffb6('0x6'));var interaction=require(_0xffb6('0x7'));var config=require(_0xffb6('0x8'));module[_0xffb6('0x9')]=router;
\ No newline at end of file
+var _0x6cad=['connect-timeout','express','../../components/interaction/service','../../config/environment','exports','multer','util','path'];(function(_0x1b53a4,_0x3c46b9){var _0x2c4ca7=function(_0x1425af){while(--_0x1425af){_0x1b53a4['push'](_0x1b53a4['shift']());}};_0x2c4ca7(++_0x3c46b9);}(_0x6cad,0x1c5));var _0xd6ca=function(_0x4836e1,_0x4211de){_0x4836e1=_0x4836e1-0x0;var _0x4b6d2e=_0x6cad[_0x4836e1];return _0x4b6d2e;};'use strict';var multer=require(_0xd6ca('0x0'));var util=require(_0xd6ca('0x1'));var path=require(_0xd6ca('0x2'));var timeout=require(_0xd6ca('0x3'));var express=require(_0xd6ca('0x4'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0xd6ca('0x5'));var config=require(_0xd6ca('0x6'));module[_0xd6ca('0x7')]=router;
\ No newline at end of file
diff --git a/server/api/userVoiceQueue/userVoiceQueue.attributes.js b/server/api/userVoiceQueue/userVoiceQueue.attributes.js
index 1af5e54..2dd8188 100644
--- a/server/api/userVoiceQueue/userVoiceQueue.attributes.js
+++ b/server/api/userVoiceQueue/userVoiceQueue.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xb10b=['sequelize','INTEGER'];(function(_0x574537,_0x1654a3){var _0x46e65e=function(_0x48be85){while(--_0x48be85){_0x574537['push'](_0x574537['shift']());}};_0x46e65e(++_0x1654a3);}(_0xb10b,0x12a));var _0xbb10=function(_0x1f504c,_0x319b4f){_0x1f504c=_0x1f504c-0x0;var _0x50d2e6=_0xb10b[_0x1f504c];return _0x50d2e6;};'use strict';var Sequelize=require(_0xbb10('0x0'));module['exports']={'penalty':{'type':Sequelize[_0xbb10('0x1')],'defaultValue':0x0}};
\ No newline at end of file
+var _0xd8b0=['exports','sequelize'];(function(_0x255093,_0x4fe4fa){var _0x440166=function(_0x366f54){while(--_0x366f54){_0x255093['push'](_0x255093['shift']());}};_0x440166(++_0x4fe4fa);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var Sequelize=require(_0x0d8b('0x0'));module[_0x0d8b('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}};
\ No newline at end of file
diff --git a/server/api/userVoiceQueue/userVoiceQueue.model.js b/server/api/userVoiceQueue/userVoiceQueue.model.js
index 9400a9f..97c81dc 100644
--- a/server/api/userVoiceQueue/userVoiceQueue.model.js
+++ b/server/api/userVoiceQueue/userVoiceQueue.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xf188=['./userVoiceQueue.attributes','exports','define','user_has_voice_queues','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x4c8fb8,_0x58db4e){var _0x96a6f3=function(_0x1a93dc){while(--_0x1a93dc){_0x4c8fb8['push'](_0x4c8fb8['shift']());}};_0x96a6f3(++_0x58db4e);}(_0xf188,0xee));var _0x8f18=function(_0xcbde3d,_0x24577f){_0xcbde3d=_0xcbde3d-0x0;var _0x29153e=_0xf188[_0xcbde3d];return _0x29153e;};'use strict';var _=require(_0x8f18('0x0'));var util=require(_0x8f18('0x1'));var logger=require(_0x8f18('0x2'))(_0x8f18('0x3'));var moment=require('moment');var BPromise=require(_0x8f18('0x4'));var rp=require(_0x8f18('0x5'));var fs=require('fs');var path=require(_0x8f18('0x6'));var rimraf=require(_0x8f18('0x7'));var config=require(_0x8f18('0x8'));var attributes=require(_0x8f18('0x9'));module[_0x8f18('0xa')]=function(_0x1160c0,_0xafc0c7){return _0x1160c0[_0x8f18('0xb')]('UserVoiceQueue',attributes,{'tableName':_0x8f18('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x9026=['user_has_voice_queues','lodash','util','../../config/logger','moment','bluebird','request-promise','path','../../config/environment','exports','define','UserVoiceQueue'];(function(_0x593e8e,_0xf4ae5c){var _0x311631=function(_0x12f9b2){while(--_0x12f9b2){_0x593e8e['push'](_0x593e8e['shift']());}};_0x311631(++_0xf4ae5c);}(_0x9026,0xd9));var _0x6902=function(_0x36ed48,_0x1ee0d4){_0x36ed48=_0x36ed48-0x0;var _0x51c63a=_0x9026[_0x36ed48];return _0x51c63a;};'use strict';var _=require(_0x6902('0x0'));var util=require(_0x6902('0x1'));var logger=require(_0x6902('0x2'))('api');var moment=require(_0x6902('0x3'));var BPromise=require(_0x6902('0x4'));var rp=require(_0x6902('0x5'));var fs=require('fs');var path=require(_0x6902('0x6'));var rimraf=require('rimraf');var config=require(_0x6902('0x7'));var attributes=require('./userVoiceQueue.attributes');module[_0x6902('0x8')]=function(_0x51512b,_0x15763e){return _0x51512b[_0x6902('0x9')](_0x6902('0xa'),attributes,{'tableName':_0x6902('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/userVoiceQueue/userVoiceQueue.rpc.js b/server/api/userVoiceQueue/userVoiceQueue.rpc.js
index 68098c5..11b8f96 100644
--- a/server/api/userVoiceQueue/userVoiceQueue.rpc.js
+++ b/server/api/userVoiceQueue/userVoiceQueue.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xe166=['../../config/environment','jayson/promise','client','http','UserVoiceQueue,\x20%s,\x20%s','request\x20sent','debug','UserVoiceQueue,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','lodash','util','moment','bluebird','ioredis'];(function(_0x536150,_0x31aa61){var _0x554666=function(_0x32d290){while(--_0x32d290){_0x536150['push'](_0x536150['shift']());}};_0x554666(++_0x31aa61);}(_0xe166,0x12b));var _0x6e16=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0xe166[_0x5ddb1c];return _0x354adc;};'use strict';var _=require(_0x6e16('0x0'));var util=require(_0x6e16('0x1'));var moment=require(_0x6e16('0x2'));var BPromise=require(_0x6e16('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6e16('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x6e16('0x5'));var jayson=require(_0x6e16('0x6'));var client=jayson[_0x6e16('0x7')][_0x6e16('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3e7b10,_0x2f02e5,_0x50b530){return new BPromise(function(_0x5c3cbf,_0x4ade3b){return client['request'](_0x3e7b10,_0x50b530)['then'](function(_0x3bb339){logger['info'](_0x6e16('0x9'),_0x2f02e5,_0x6e16('0xa'));logger[_0x6e16('0xb')](_0x6e16('0xc'),_0x2f02e5,'request\x20sent',JSON['stringify'](_0x3bb339));if(_0x3bb339['error']){if(_0x3bb339[_0x6e16('0xd')][_0x6e16('0xe')]===0x1f4){logger['error']('UserVoiceQueue,\x20%s,\x20%s',_0x2f02e5,_0x3bb339[_0x6e16('0xd')][_0x6e16('0xf')]);return _0x4ade3b(_0x3bb339[_0x6e16('0xd')][_0x6e16('0xf')]);}logger[_0x6e16('0xd')]('UserVoiceQueue,\x20%s,\x20%s',_0x2f02e5,_0x3bb339['error'][_0x6e16('0xf')]);return _0x5c3cbf(_0x3bb339[_0x6e16('0xd')][_0x6e16('0xf')]);}else{logger[_0x6e16('0x10')](_0x6e16('0x9'),_0x2f02e5,'request\x20sent');_0x5c3cbf(_0x3bb339[_0x6e16('0x11')][_0x6e16('0xf')]);}})[_0x6e16('0x12')](function(_0x23794c){logger['error'](_0x6e16('0x9'),_0x2f02e5,_0x23794c);_0x4ade3b(_0x23794c);});});}
\ No newline at end of file
+var _0xca99=['then','request\x20sent','UserVoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','UserVoiceQueue,\x20%s,\x20%s','info','result','catch','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','client','request'];(function(_0x15ff04,_0x4cda55){var _0x361c4e=function(_0x1990e8){while(--_0x1990e8){_0x15ff04['push'](_0x15ff04['shift']());}};_0x361c4e(++_0x4cda55);}(_0xca99,0x14d));var _0x9ca9=function(_0x4c67b6,_0x57c66d){_0x4c67b6=_0x4c67b6-0x0;var _0xbec69f=_0xca99[_0x4c67b6];return _0xbec69f;};'use strict';var _=require('lodash');var util=require(_0x9ca9('0x0'));var moment=require(_0x9ca9('0x1'));var BPromise=require(_0x9ca9('0x2'));var rs=require(_0x9ca9('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x9ca9('0x4'));var logger=require(_0x9ca9('0x5'))(_0x9ca9('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x9ca9('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x10124a,_0x2e58f7,_0x38eca5){return new BPromise(function(_0x134c5b,_0x48349e){return client[_0x9ca9('0x8')](_0x10124a,_0x38eca5)[_0x9ca9('0x9')](function(_0x16ff15){logger['info']('UserVoiceQueue,\x20%s,\x20%s',_0x2e58f7,_0x9ca9('0xa'));logger['debug'](_0x9ca9('0xb'),_0x2e58f7,_0x9ca9('0xa'),JSON[_0x9ca9('0xc')](_0x16ff15));if(_0x16ff15[_0x9ca9('0xd')]){if(_0x16ff15['error']['code']===0x1f4){logger['error']('UserVoiceQueue,\x20%s,\x20%s',_0x2e58f7,_0x16ff15['error'][_0x9ca9('0xe')]);return _0x48349e(_0x16ff15['error']['message']);}logger['error'](_0x9ca9('0xf'),_0x2e58f7,_0x16ff15[_0x9ca9('0xd')]['message']);return _0x134c5b(_0x16ff15[_0x9ca9('0xd')][_0x9ca9('0xe')]);}else{logger[_0x9ca9('0x10')](_0x9ca9('0xf'),_0x2e58f7,'request\x20sent');_0x134c5b(_0x16ff15[_0x9ca9('0x11')][_0x9ca9('0xe')]);}})[_0x9ca9('0x12')](function(_0x522bb9){logger[_0x9ca9('0xd')]('UserVoiceQueue,\x20%s,\x20%s',_0x2e58f7,_0x522bb9);_0x48349e(_0x522bb9);});});}
\ No newline at end of file
diff --git a/server/api/userVoiceQueueRt/index.js b/server/api/userVoiceQueueRt/index.js
index f512a2c..9552eb0 100644
--- a/server/api/userVoiceQueueRt/index.js
+++ b/server/api/userVoiceQueueRt/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xdcc0=['exports','multer','path','connect-timeout','Router','../../config/environment'];(function(_0x12995e,_0x573c6d){var _0x321a35=function(_0x535901){while(--_0x535901){_0x12995e['push'](_0x12995e['shift']());}};_0x321a35(++_0x573c6d);}(_0xdcc0,0x79));var _0x0dcc=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xdcc0[_0x501510];return _0x1e6ee5;};'use strict';var multer=require(_0x0dcc('0x0'));var util=require('util');var path=require(_0x0dcc('0x1'));var timeout=require(_0x0dcc('0x2'));var express=require('express');var router=express[_0x0dcc('0x3')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x0dcc('0x4'));module[_0x0dcc('0x5')]=router;
\ No newline at end of file
+var _0x1bce=['express','Router','../../components/interaction/service','../../config/environment','multer','util','path','connect-timeout'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1bce,0x194));var _0xe1bc=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x1bce[_0x2641f9];return _0x585741;};'use strict';var multer=require(_0xe1bc('0x0'));var util=require(_0xe1bc('0x1'));var path=require(_0xe1bc('0x2'));var timeout=require(_0xe1bc('0x3'));var express=require(_0xe1bc('0x4'));var router=express[_0xe1bc('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0xe1bc('0x6'));var config=require(_0xe1bc('0x7'));module['exports']=router;
\ No newline at end of file
diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.attributes.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.attributes.js
index 5aede25..6512f50 100644
--- a/server/api/userVoiceQueueRt/userVoiceQueueRt.attributes.js
+++ b/server/api/userVoiceQueueRt/userVoiceQueueRt.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x0634=['STRING','queue_interface','Required\x20by\x20Asterisk','sequelize','exports','INTEGER'];(function(_0x5b9692,_0x1e4e4c){var _0x4a32f0=function(_0x234655){while(--_0x234655){_0x5b9692['push'](_0x5b9692['shift']());}};_0x4a32f0(++_0x1e4e4c);}(_0x0634,0xd5));var _0x4063=function(_0x453355,_0x1cf91f){_0x453355=_0x453355-0x0;var _0x2737c5=_0x0634[_0x453355];return _0x2737c5;};'use strict';var Sequelize=require(_0x4063('0x0'));module[_0x4063('0x1')]={'uniqueid':{'type':Sequelize[_0x4063('0x2')],'primaryKey':!![],'autoIncrement':!![],'comment':'Required\x20by\x20Asterisk'},'membername':{'type':Sequelize['STRING'],'allowNull':![],'comment':'Required\x20by\x20Asterisk'},'UserId':{'type':Sequelize[_0x4063('0x2')],'allowNull':![]},'queue_name':{'type':Sequelize[_0x4063('0x3')],'allowNull':![],'unique':_0x4063('0x4'),'comment':_0x4063('0x5')},'VoiceQueueId':{'type':Sequelize[_0x4063('0x2')],'allowNull':![]},'interface':{'type':Sequelize[_0x4063('0x3')],'allowNull':![],'unique':_0x4063('0x4'),'comment':_0x4063('0x5')},'penalty':{'type':Sequelize[_0x4063('0x2')](0xb),'defaultValue':0x0,'comment':'Required\x20by\x20Asterisk'},'paused':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0,'comment':_0x4063('0x5')}};
\ No newline at end of file
+var _0x7be0=['sequelize','exports','INTEGER','Required\x20by\x20Asterisk','STRING','queue_interface'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7be0,0x6c));var _0x07be=function(_0x51ad78,_0x193436){_0x51ad78=_0x51ad78-0x0;var _0x31a9ec=_0x7be0[_0x51ad78];return _0x31a9ec;};'use strict';var Sequelize=require(_0x07be('0x0'));module[_0x07be('0x1')]={'uniqueid':{'type':Sequelize[_0x07be('0x2')],'primaryKey':!![],'autoIncrement':!![],'comment':_0x07be('0x3')},'membername':{'type':Sequelize['STRING'],'allowNull':![],'comment':_0x07be('0x3')},'UserId':{'type':Sequelize[_0x07be('0x2')],'allowNull':![]},'queue_name':{'type':Sequelize[_0x07be('0x4')],'allowNull':![],'unique':_0x07be('0x5'),'comment':_0x07be('0x3')},'VoiceQueueId':{'type':Sequelize[_0x07be('0x2')],'allowNull':![]},'interface':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x07be('0x5'),'comment':_0x07be('0x3')},'penalty':{'type':Sequelize[_0x07be('0x2')](0xb),'defaultValue':0x0,'comment':_0x07be('0x3')},'paused':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0,'comment':_0x07be('0x3')}};
\ No newline at end of file
diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js
index 3a08174..dce3c9c 100644
--- a/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js
+++ b/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xa6b3=['events','../../mysqldb','UserVoiceQueueRt','setMaxListeners','update','remove','hasOwnProperty','hook','exports'];(function(_0x3346ff,_0x417a52){var _0x466585=function(_0x3eaf5f){while(--_0x3eaf5f){_0x3346ff['push'](_0x3346ff['shift']());}};_0x466585(++_0x417a52);}(_0xa6b3,0x171));var _0x3a6b=function(_0x258af5,_0x28e04f){_0x258af5=_0x258af5-0x0;var _0x51b196=_0xa6b3[_0x258af5];return _0x51b196;};'use strict';var EventEmitter=require(_0x3a6b('0x0'));var UserVoiceQueueRt=require(_0x3a6b('0x1'))['db'][_0x3a6b('0x2')];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents[_0x3a6b('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x3a6b('0x4'),'afterDestroy':_0x3a6b('0x5')};function emitEvent(_0x37060a){return function(_0x2ec878,_0x2a6584,_0x400a6e){UserVoiceQueueRtEvents['emit'](_0x37060a+':'+_0x2ec878['id'],_0x2ec878);UserVoiceQueueRtEvents['emit'](_0x37060a,_0x2ec878);_0x400a6e(null);};}for(var e in events){if(events[_0x3a6b('0x6')](e)){var event=events[e];UserVoiceQueueRt[_0x3a6b('0x7')](e,emitEvent(event));}}module[_0x3a6b('0x8')]=UserVoiceQueueRtEvents;
\ No newline at end of file
+var _0xa8c0=['exports','../../mysqldb','UserVoiceQueueRt','update','remove','emit','hasOwnProperty','hook'];(function(_0x228fdd,_0x547c8c){var _0x4d7b78=function(_0x3ac7e2){while(--_0x3ac7e2){_0x228fdd['push'](_0x228fdd['shift']());}};_0x4d7b78(++_0x547c8c);}(_0xa8c0,0x129));var _0x0a8c=function(_0x2f37e0,_0x393ef9){_0x2f37e0=_0x2f37e0-0x0;var _0x43ccce=_0xa8c0[_0x2f37e0];return _0x43ccce;};'use strict';var EventEmitter=require('events');var UserVoiceQueueRt=require(_0x0a8c('0x0'))['db'][_0x0a8c('0x1')];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x0a8c('0x2'),'afterDestroy':_0x0a8c('0x3')};function emitEvent(_0x2b3649){return function(_0x383ece,_0x6d0dcf,_0x42b304){UserVoiceQueueRtEvents[_0x0a8c('0x4')](_0x2b3649+':'+_0x383ece['id'],_0x383ece);UserVoiceQueueRtEvents[_0x0a8c('0x4')](_0x2b3649,_0x383ece);_0x42b304(null);};}for(var e in events){if(events[_0x0a8c('0x5')](e)){var event=events[e];UserVoiceQueueRt[_0x0a8c('0x6')](e,emitEvent(event));}}module[_0x0a8c('0x7')]=UserVoiceQueueRtEvents;
\ No newline at end of file
diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.model.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.model.js
index 57b7bde..c216c22 100644
--- a/server/api/userVoiceQueueRt/userVoiceQueueRt.model.js
+++ b/server/api/userVoiceQueueRt/userVoiceQueueRt.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x3717=['UserVoiceQueueRt','user_has_voice_queues_rt','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./userVoiceQueueRt.attributes','exports','define'];(function(_0x8c7160,_0x3eb34d){var _0x4fddba=function(_0x5bd61c){while(--_0x5bd61c){_0x8c7160['push'](_0x8c7160['shift']());}};_0x4fddba(++_0x3eb34d);}(_0x3717,0xaa));var _0x7371=function(_0x1e003b,_0x3e4ded){_0x1e003b=_0x1e003b-0x0;var _0x268789=_0x3717[_0x1e003b];return _0x268789;};'use strict';var _=require(_0x7371('0x0'));var util=require('util');var logger=require(_0x7371('0x1'))(_0x7371('0x2'));var moment=require(_0x7371('0x3'));var BPromise=require(_0x7371('0x4'));var rp=require(_0x7371('0x5'));var fs=require('fs');var path=require(_0x7371('0x6'));var rimraf=require(_0x7371('0x7'));var config=require(_0x7371('0x8'));var attributes=require(_0x7371('0x9'));module[_0x7371('0xa')]=function(_0x59a0eb,_0x2986cf){return _0x59a0eb[_0x7371('0xb')](_0x7371('0xc'),attributes,{'tableName':_0x7371('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x2443=['user_has_voice_queues_rt','util','api','bluebird','path','rimraf','../../config/environment','UserVoiceQueueRt'];(function(_0x4ea69d,_0x290f53){var _0x5318e0=function(_0x18e081){while(--_0x18e081){_0x4ea69d['push'](_0x4ea69d['shift']());}};_0x5318e0(++_0x290f53);}(_0x2443,0x129));var _0x3244=function(_0x526c72,_0x4866f5){_0x526c72=_0x526c72-0x0;var _0x12d01e=_0x2443[_0x526c72];return _0x12d01e;};'use strict';var _=require('lodash');var util=require(_0x3244('0x0'));var logger=require('../../config/logger')(_0x3244('0x1'));var moment=require('moment');var BPromise=require(_0x3244('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x3244('0x3'));var rimraf=require(_0x3244('0x4'));var config=require(_0x3244('0x5'));var attributes=require('./userVoiceQueueRt.attributes');module['exports']=function(_0x182684,_0x344465){return _0x182684['define'](_0x3244('0x6'),attributes,{'tableName':_0x3244('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.rpc.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.rpc.js
index fdb1d9c..1412e95 100644
--- a/server/api/userVoiceQueueRt/userVoiceQueueRt.rpc.js
+++ b/server/api/userVoiceQueueRt/userVoiceQueueRt.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x07b8=['options','raw','where','sequelize','COUNT','literal','`paused`\x20=\x201,\x201,\x20null','outboundQueuePauses','debug','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','redis','defaults','socket.io-emitter','register','then','info','UserVoiceQueueRt,\x20%s,\x20%s','request\x20sent','UserVoiceQueueRt,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','GetVoiceQueueRtPauses','UserVoiceQueueRt'];(function(_0xdf1781,_0x1b9c28){var _0x8d9809=function(_0x19c34f){while(--_0x19c34f){_0xdf1781['push'](_0xdf1781['shift']());}};_0x8d9809(++_0x1b9c28);}(_0x07b8,0x17c));var _0x807b=function(_0x15440c,_0x2a904f){_0x15440c=_0x15440c-0x0;var _0x370a29=_0x07b8[_0x15440c];return _0x370a29;};'use strict';var _=require('lodash');var util=require(_0x807b('0x0'));var moment=require(_0x807b('0x1'));var BPromise=require(_0x807b('0x2'));var rs=require(_0x807b('0x3'));var fs=require('fs');var Redis=require(_0x807b('0x4'));var db=require(_0x807b('0x5'))['db'];var utils=require(_0x807b('0x6'));var logger=require(_0x807b('0x7'))(_0x807b('0x8'));var config=require(_0x807b('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x807b('0xa')]({'port':0x232a});config[_0x807b('0xb')]=_[_0x807b('0xc')](config[_0x807b('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x807b('0xd'))(new Redis(config[_0x807b('0xb')]));require('./userVoiceQueueRt.socket')[_0x807b('0xe')](socket);function respondWithRpcPromise(_0x25d9fb,_0x3bc730,_0x4f5db0){return new BPromise(function(_0x1ab23d,_0x21bf8f){return client['request'](_0x25d9fb,_0x4f5db0)[_0x807b('0xf')](function(_0x2ea8fa){logger[_0x807b('0x10')](_0x807b('0x11'),_0x3bc730,_0x807b('0x12'));logger['debug'](_0x807b('0x13'),_0x3bc730,'request\x20sent',JSON[_0x807b('0x14')](_0x2ea8fa));if(_0x2ea8fa[_0x807b('0x15')]){if(_0x2ea8fa[_0x807b('0x15')][_0x807b('0x16')]===0x1f4){logger[_0x807b('0x15')](_0x807b('0x11'),_0x3bc730,_0x2ea8fa['error'][_0x807b('0x17')]);return _0x21bf8f(_0x2ea8fa['error']['message']);}logger[_0x807b('0x15')](_0x807b('0x11'),_0x3bc730,_0x2ea8fa[_0x807b('0x15')]['message']);return _0x1ab23d(_0x2ea8fa[_0x807b('0x15')][_0x807b('0x17')]);}else{logger[_0x807b('0x10')](_0x807b('0x11'),_0x3bc730,_0x807b('0x12'));_0x1ab23d(_0x2ea8fa[_0x807b('0x18')][_0x807b('0x17')]);}})['catch'](function(_0x861e96){logger[_0x807b('0x15')](_0x807b('0x11'),_0x3bc730,_0x861e96);_0x21bf8f(_0x861e96);});});}exports[_0x807b('0x19')]=function(_0x52a429){var _0x2872e0=this;return new Promise(function(_0x5d6cbd,_0x136cc7){return db[_0x807b('0x1a')]['findAll']({'raw':_0x52a429[_0x807b('0x1b')]?_0x52a429[_0x807b('0x1b')][_0x807b('0x1c')]===undefined?!![]:![]:!![],'where':_0x52a429[_0x807b('0x1b')]?_0x52a429[_0x807b('0x1b')][_0x807b('0x1d')]||null:null,'attributes':[[db[_0x807b('0x1e')]['fn'](_0x807b('0x1f'),db['sequelize']['fn']('IF',db[_0x807b('0x1e')][_0x807b('0x20')](_0x807b('0x21')))),_0x807b('0x22')]]})[_0x807b('0xf')](function(_0x176241){logger[_0x807b('0x10')](_0x807b('0x19'),_0x52a429);logger[_0x807b('0x23')](_0x807b('0x19'),_0x52a429,JSON['stringify'](_0x176241));_0x5d6cbd(_0x176241);})[_0x807b('0x24')](function(_0x5e50ec){logger[_0x807b('0x15')](_0x807b('0x19'),_0x5e50ec[_0x807b('0x17')],_0x52a429);_0x136cc7(_0x2872e0['error'](0x1f4,_0x5e50ec[_0x807b('0x17')]));});});};
\ No newline at end of file
+var _0x293a=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','./userVoiceQueueRt.socket','register','request','info','request\x20sent','UserVoiceQueueRt,\x20%s,\x20%s,\x20%s','stringify','error','code','message','UserVoiceQueueRt,\x20%s,\x20%s','GetVoiceQueueRtPauses','UserVoiceQueueRt','findAll','options','where','sequelize','literal','`paused`\x20=\x201,\x201,\x20null','outboundQueuePauses','then','catch','util','bluebird','ioredis'];(function(_0x1f109c,_0xd9952e){var _0x3984e8=function(_0x40b60b){while(--_0x40b60b){_0x1f109c['push'](_0x1f109c['shift']());}};_0x3984e8(++_0xd9952e);}(_0x293a,0x141));var _0xa293=function(_0x5795ee,_0x3896ca){_0x5795ee=_0x5795ee-0x0;var _0x5aad7c=_0x293a[_0x5795ee];return _0x5aad7c;};'use strict';var _=require('lodash');var util=require(_0xa293('0x0'));var moment=require('moment');var BPromise=require(_0xa293('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa293('0x2'));var db=require(_0xa293('0x3'))['db'];var utils=require(_0xa293('0x4'));var logger=require(_0xa293('0x5'))(_0xa293('0x6'));var config=require(_0xa293('0x7'));var jayson=require(_0xa293('0x8'));var client=jayson[_0xa293('0x9')][_0xa293('0xa')]({'port':0x232a});config['redis']=_[_0xa293('0xb')](config[_0xa293('0xc')],{'host':_0xa293('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xa293('0xc')]));require(_0xa293('0xe'))[_0xa293('0xf')](socket);function respondWithRpcPromise(_0x1ed176,_0x24fa17,_0x271a9e){return new BPromise(function(_0x3bce41,_0x573778){return client[_0xa293('0x10')](_0x1ed176,_0x271a9e)['then'](function(_0x217623){logger[_0xa293('0x11')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x24fa17,_0xa293('0x12'));logger['debug'](_0xa293('0x13'),_0x24fa17,_0xa293('0x12'),JSON[_0xa293('0x14')](_0x217623));if(_0x217623[_0xa293('0x15')]){if(_0x217623[_0xa293('0x15')][_0xa293('0x16')]===0x1f4){logger['error']('UserVoiceQueueRt,\x20%s,\x20%s',_0x24fa17,_0x217623[_0xa293('0x15')]['message']);return _0x573778(_0x217623[_0xa293('0x15')][_0xa293('0x17')]);}logger[_0xa293('0x15')](_0xa293('0x18'),_0x24fa17,_0x217623[_0xa293('0x15')][_0xa293('0x17')]);return _0x3bce41(_0x217623['error'][_0xa293('0x17')]);}else{logger[_0xa293('0x11')](_0xa293('0x18'),_0x24fa17,_0xa293('0x12'));_0x3bce41(_0x217623['result'][_0xa293('0x17')]);}})['catch'](function(_0x4e822a){logger[_0xa293('0x15')](_0xa293('0x18'),_0x24fa17,_0x4e822a);_0x573778(_0x4e822a);});});}exports[_0xa293('0x19')]=function(_0x406d37){var _0x711738=this;return new Promise(function(_0x43953d,_0x424f59){return db[_0xa293('0x1a')][_0xa293('0x1b')]({'raw':_0x406d37[_0xa293('0x1c')]?_0x406d37[_0xa293('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x406d37[_0xa293('0x1c')]?_0x406d37['options'][_0xa293('0x1d')]||null:null,'attributes':[[db[_0xa293('0x1e')]['fn']('COUNT',db[_0xa293('0x1e')]['fn']('IF',db['sequelize'][_0xa293('0x1f')](_0xa293('0x20')))),_0xa293('0x21')]]})[_0xa293('0x22')](function(_0x85eabb){logger[_0xa293('0x11')](_0xa293('0x19'),_0x406d37);logger['debug'](_0xa293('0x19'),_0x406d37,JSON[_0xa293('0x14')](_0x85eabb));_0x43953d(_0x85eabb);})[_0xa293('0x23')](function(_0x575e42){logger[_0xa293('0x15')](_0xa293('0x19'),_0x575e42[_0xa293('0x17')],_0x406d37);_0x424f59(_0x711738['error'](0x1f4,_0x575e42[_0xa293('0x17')]));});});};
\ No newline at end of file
diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js
index b027dff..8208f3d 100644
--- a/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js
+++ b/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x75fd=['register','length','userVoiceQueueRt:','./userVoiceQueueRt.events','remove','update','emit','removeListener'];(function(_0x2d13b4,_0x30682a){var _0x1ea02e=function(_0x11b6ab){while(--_0x11b6ab){_0x2d13b4['push'](_0x2d13b4['shift']());}};_0x1ea02e(++_0x30682a);}(_0x75fd,0x1db));var _0xd75f=function(_0x2589a4,_0x2335d1){_0x2589a4=_0x2589a4-0x0;var _0x338903=_0x75fd[_0x2589a4];return _0x338903;};'use strict';var UserVoiceQueueRtEvents=require(_0xd75f('0x0'));var events=['save',_0xd75f('0x1'),_0xd75f('0x2')];function createListener(_0x272786,_0x13670a){return function(_0x2c5571){_0x13670a[_0xd75f('0x3')](_0x272786,_0x2c5571);};}function removeListener(_0xdaed94,_0x3b980d){return function(){UserVoiceQueueRtEvents[_0xd75f('0x4')](_0xdaed94,_0x3b980d);};}exports[_0xd75f('0x5')]=function(_0x5c33f1){for(var _0xc28fe3=0x0,_0x578f3d=events[_0xd75f('0x6')];_0xc28fe3<_0x578f3d;_0xc28fe3++){var _0x35b346=events[_0xc28fe3];var _0x22c612=createListener(_0xd75f('0x7')+_0x35b346,_0x5c33f1);UserVoiceQueueRtEvents['on'](_0x35b346,_0x22c612);}};
\ No newline at end of file
+var _0xb522=['userVoiceQueueRt:','./userVoiceQueueRt.events','save','remove','update','register','length'];(function(_0x1553f7,_0x428ff2){var _0x35a1f3=function(_0x4d762b){while(--_0x4d762b){_0x1553f7['push'](_0x1553f7['shift']());}};_0x35a1f3(++_0x428ff2);}(_0xb522,0x119));var _0x2b52=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb522[_0x3dd15e];return _0x231fd0;};'use strict';var UserVoiceQueueRtEvents=require(_0x2b52('0x0'));var events=[_0x2b52('0x1'),_0x2b52('0x2'),_0x2b52('0x3')];function createListener(_0x47a8ae,_0x88c813){return function(_0x5061d4){_0x88c813['emit'](_0x47a8ae,_0x5061d4);};}function removeListener(_0x46b14a,_0x59fc72){return function(){UserVoiceQueueRtEvents['removeListener'](_0x46b14a,_0x59fc72);};}exports[_0x2b52('0x4')]=function(_0x2e77c2){for(var _0x1f30b6=0x0,_0x225bac=events[_0x2b52('0x5')];_0x1f30b6<_0x225bac;_0x1f30b6++){var _0x4ae435=events[_0x1f30b6];var _0x2bd672=createListener(_0x2b52('0x6')+_0x4ae435,_0x2e77c2);UserVoiceQueueRtEvents['on'](_0x4ae435,_0x2bd672);}};
\ No newline at end of file
diff --git a/server/api/userWhatsappQueue/index.js b/server/api/userWhatsappQueue/index.js
index 7877f3f..faf076c 100644
--- a/server/api/userWhatsappQueue/index.js
+++ b/server/api/userWhatsappQueue/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xbac0=['../../components/auth/service','../../config/environment','exports','multer','path','connect-timeout','express','Router'];(function(_0x2678e8,_0x140b0e){var _0x746b71=function(_0x44755f){while(--_0x44755f){_0x2678e8['push'](_0x2678e8['shift']());}};_0x746b71(++_0x140b0e);}(_0xbac0,0x12b));var _0x0bac=function(_0x339d45,_0x5b91d4){_0x339d45=_0x339d45-0x0;var _0x5e4a60=_0xbac0[_0x339d45];return _0x5e4a60;};'use strict';var multer=require(_0x0bac('0x0'));var util=require('util');var path=require(_0x0bac('0x1'));var timeout=require(_0x0bac('0x2'));var express=require(_0x0bac('0x3'));var router=express[_0x0bac('0x4')]();var auth=require(_0x0bac('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x0bac('0x6'));module[_0x0bac('0x7')]=router;
\ No newline at end of file
+var _0x2553=['util','path','connect-timeout','../../components/interaction/service','exports','multer'];(function(_0x5b19c5,_0x3665ff){var _0x50ec0a=function(_0x6687d2){while(--_0x6687d2){_0x5b19c5['push'](_0x5b19c5['shift']());}};_0x50ec0a(++_0x3665ff);}(_0x2553,0x89));var _0x3255=function(_0x376de5,_0x1b44a9){_0x376de5=_0x376de5-0x0;var _0x58d8f7=_0x2553[_0x376de5];return _0x58d8f7;};'use strict';var multer=require(_0x3255('0x0'));var util=require(_0x3255('0x1'));var path=require(_0x3255('0x2'));var timeout=require(_0x3255('0x3'));var express=require('express');var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x3255('0x4'));var config=require('../../config/environment');module[_0x3255('0x5')]=router;
\ No newline at end of file
diff --git a/server/api/userWhatsappQueue/userWhatsappQueue.attributes.js b/server/api/userWhatsappQueue/userWhatsappQueue.attributes.js
index aef1b71..0c9401e 100644
--- a/server/api/userWhatsappQueue/userWhatsappQueue.attributes.js
+++ b/server/api/userWhatsappQueue/userWhatsappQueue.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xb10b=['sequelize','INTEGER'];(function(_0x1b8321,_0x5f5b91){var _0x16d8f6=function(_0x10787b){while(--_0x10787b){_0x1b8321['push'](_0x1b8321['shift']());}};_0x16d8f6(++_0x5f5b91);}(_0xb10b,0x12a));var _0xbb10=function(_0x28e919,_0x145939){_0x28e919=_0x28e919-0x0;var _0x692b7e=_0xb10b[_0x28e919];return _0x692b7e;};'use strict';var Sequelize=require(_0xbb10('0x0'));module['exports']={'penalty':{'type':Sequelize[_0xbb10('0x1')],'defaultValue':0x0}};
\ No newline at end of file
+var _0xd8b0=['exports','sequelize'];(function(_0x34559b,_0x42b8ed){var _0x517ca8=function(_0x4b92a7){while(--_0x4b92a7){_0x34559b['push'](_0x34559b['shift']());}};_0x517ca8(++_0x42b8ed);}(_0xd8b0,0xad));var _0x0d8b=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xd8b0[_0x122ef9];return _0x42fba0;};'use strict';var Sequelize=require(_0x0d8b('0x0'));module[_0x0d8b('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}};
\ No newline at end of file
diff --git a/server/api/userWhatsappQueue/userWhatsappQueue.model.js b/server/api/userWhatsappQueue/userWhatsappQueue.model.js
index fc33e0d..fbc26a4 100644
--- a/server/api/userWhatsappQueue/userWhatsappQueue.model.js
+++ b/server/api/userWhatsappQueue/userWhatsappQueue.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xe2ce=['define','UserWhatsappQueue','user_has_whatsapp_queues','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./userWhatsappQueue.attributes','exports'];(function(_0x93a23e,_0xa070c0){var _0x449575=function(_0x5f455b){while(--_0x5f455b){_0x93a23e['push'](_0x93a23e['shift']());}};_0x449575(++_0xa070c0);}(_0xe2ce,0x99));var _0xee2c=function(_0x2b8077,_0x453634){_0x2b8077=_0x2b8077-0x0;var _0x308091=_0xe2ce[_0x2b8077];return _0x308091;};'use strict';var _=require(_0xee2c('0x0'));var util=require(_0xee2c('0x1'));var logger=require(_0xee2c('0x2'))(_0xee2c('0x3'));var moment=require(_0xee2c('0x4'));var BPromise=require(_0xee2c('0x5'));var rp=require(_0xee2c('0x6'));var fs=require('fs');var path=require(_0xee2c('0x7'));var rimraf=require(_0xee2c('0x8'));var config=require(_0xee2c('0x9'));var attributes=require(_0xee2c('0xa'));module[_0xee2c('0xb')]=function(_0x1f6810,_0x4800dd){return _0x1f6810[_0xee2c('0xc')](_0xee2c('0xd'),attributes,{'tableName':_0xee2c('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x2d6f=['moment','bluebird','request-promise','path','../../config/environment','./userWhatsappQueue.attributes','define','UserWhatsappQueue','user_has_whatsapp_queues','lodash','util','../../config/logger','api'];(function(_0x2e4cbf,_0x8763d3){var _0x52840f=function(_0x31b93f){while(--_0x31b93f){_0x2e4cbf['push'](_0x2e4cbf['shift']());}};_0x52840f(++_0x8763d3);}(_0x2d6f,0x19c));var _0xf2d6=function(_0x4e1759,_0x1362c7){_0x4e1759=_0x4e1759-0x0;var _0xafdbdd=_0x2d6f[_0x4e1759];return _0xafdbdd;};'use strict';var _=require(_0xf2d6('0x0'));var util=require(_0xf2d6('0x1'));var logger=require(_0xf2d6('0x2'))(_0xf2d6('0x3'));var moment=require(_0xf2d6('0x4'));var BPromise=require(_0xf2d6('0x5'));var rp=require(_0xf2d6('0x6'));var fs=require('fs');var path=require(_0xf2d6('0x7'));var rimraf=require('rimraf');var config=require(_0xf2d6('0x8'));var attributes=require(_0xf2d6('0x9'));module['exports']=function(_0x574dcf,_0x4e4578){return _0x574dcf[_0xf2d6('0xa')](_0xf2d6('0xb'),attributes,{'tableName':_0xf2d6('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/userWhatsappQueue/userWhatsappQueue.rpc.js b/server/api/userWhatsappQueue/userWhatsappQueue.rpc.js
index 4160d73..4d83bd5 100644
--- a/server/api/userWhatsappQueue/userWhatsappQueue.rpc.js
+++ b/server/api/userWhatsappQueue/userWhatsappQueue.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xa9e0=['http','info','UserWhatsappQueue,\x20%s,\x20%s','request\x20sent','debug','UserWhatsappQueue,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0xd65ed5,_0x2cb41b){var _0x4b776d=function(_0x3198af){while(--_0x3198af){_0xd65ed5['push'](_0xd65ed5['shift']());}};_0x4b776d(++_0x2cb41b);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4fc9e6,_0xc51915){_0x4fc9e6=_0x4fc9e6-0x0;var _0x551d28=_0xa9e0[_0x4fc9e6];return _0x551d28;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});}
\ No newline at end of file
+var _0xa9e0=['http','info','UserWhatsappQueue,\x20%s,\x20%s','request\x20sent','debug','UserWhatsappQueue,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x1e8134,_0x1cefb8){var _0x3c65b3=function(_0x3369e1){while(--_0x3369e1){_0x1e8134['push'](_0x1e8134['shift']());}};_0x3c65b3(++_0x1cefb8);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3635ce,_0x33a6f9){_0x3635ce=_0x3635ce-0x0;var _0x97ecd0=_0xa9e0[_0x3635ce];return _0x97ecd0;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});}
\ No newline at end of file
diff --git a/server/api/variable/index.js b/server/api/variable/index.js
index 41302dc..273f8a8 100644
--- a/server/api/variable/index.js
+++ b/server/api/variable/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xa060=['express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','post','create','update','destroy','exports','multer','util','path','connect-timeout'];(function(_0x3e5086,_0x48f4a2){var _0xfeb102=function(_0x5a945f){while(--_0x5a945f){_0x3e5086['push'](_0x3e5086['shift']());}};_0xfeb102(++_0x48f4a2);}(_0xa060,0x12c));var _0x0a06=function(_0x434b95,_0x5c6fbf){_0x434b95=_0x434b95-0x0;var _0x18924c=_0xa060[_0x434b95];return _0x18924c;};'use strict';var multer=require(_0x0a06('0x0'));var util=require(_0x0a06('0x1'));var path=require(_0x0a06('0x2'));var timeout=require(_0x0a06('0x3'));var express=require(_0x0a06('0x4'));var router=express[_0x0a06('0x5')]();var auth=require(_0x0a06('0x6'));var interaction=require(_0x0a06('0x7'));var config=require(_0x0a06('0x8'));var controller=require('./variable.controller');router[_0x0a06('0x9')]('/',auth[_0x0a06('0xa')](),controller[_0x0a06('0xb')]);router['get'](_0x0a06('0xc'),auth[_0x0a06('0xa')](),controller[_0x0a06('0xd')]);router[_0x0a06('0xe')]('/',auth[_0x0a06('0xa')](),controller[_0x0a06('0xf')]);router['put']('/:id',auth[_0x0a06('0xa')](),controller[_0x0a06('0x10')]);router['delete'](_0x0a06('0xc'),auth[_0x0a06('0xa')](),controller[_0x0a06('0x11')]);module[_0x0a06('0x12')]=router;
\ No newline at end of file
+var _0x3c44=['index','show','create','put','/:id','isAuthenticated','update','delete','exports','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','get'];(function(_0xa6fefc,_0x24a434){var _0x2c65a7=function(_0x58c1d1){while(--_0x58c1d1){_0xa6fefc['push'](_0xa6fefc['shift']());}};_0x2c65a7(++_0x24a434);}(_0x3c44,0x129));var _0x43c4=function(_0x1768ee,_0x476865){_0x1768ee=_0x1768ee-0x0;var _0x5aa692=_0x3c44[_0x1768ee];return _0x5aa692;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x43c4('0x0'));var timeout=require(_0x43c4('0x1'));var express=require(_0x43c4('0x2'));var router=express['Router']();var auth=require(_0x43c4('0x3'));var interaction=require(_0x43c4('0x4'));var config=require(_0x43c4('0x5'));var controller=require('./variable.controller');router[_0x43c4('0x6')]('/',auth['isAuthenticated'](),controller[_0x43c4('0x7')]);router[_0x43c4('0x6')]('/:id',auth['isAuthenticated'](),controller[_0x43c4('0x8')]);router['post']('/',auth['isAuthenticated'](),controller[_0x43c4('0x9')]);router[_0x43c4('0xa')](_0x43c4('0xb'),auth[_0x43c4('0xc')](),controller[_0x43c4('0xd')]);router[_0x43c4('0xe')](_0x43c4('0xb'),auth[_0x43c4('0xc')](),controller['destroy']);module[_0x43c4('0xf')]=router;
\ No newline at end of file
diff --git a/server/api/variable/variable.attributes.js b/server/api/variable/variable.attributes.js
index 1f7952e..58108d2 100644
--- a/server/api/variable/variable.attributes.js
+++ b/server/api/variable/variable.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x2b7b=['exports','STRING','name','sequelize'];(function(_0x1eefcd,_0x4b742b){var _0x4f5f25=function(_0x3d0935){while(--_0x3d0935){_0x1eefcd['push'](_0x1eefcd['shift']());}};_0x4f5f25(++_0x4b742b);}(_0x2b7b,0xcf));var _0xb2b7=function(_0x160c73,_0x2ee678){_0x160c73=_0x160c73-0x0;var _0xd9302=_0x2b7b[_0x160c73];return _0xd9302;};'use strict';var Sequelize=require(_0xb2b7('0x0'));module[_0xb2b7('0x1')]={'name':{'type':Sequelize[_0xb2b7('0x2')],'unique':_0xb2b7('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xb2b7('0x2')]}};
\ No newline at end of file
+var _0xedd4=['sequelize','exports','name','STRING'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xedd4,0xf8));var _0x4edd=function(_0x5561e3,_0x3eb93a){_0x5561e3=_0x5561e3-0x0;var _0x331c5a=_0xedd4[_0x5561e3];return _0x331c5a;};'use strict';var Sequelize=require(_0x4edd('0x0'));module[_0x4edd('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x4edd('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x4edd('0x3')]}};
\ No newline at end of file
diff --git a/server/api/variable/variable.controller.js b/server/api/variable/variable.controller.js
index 6e1f86c..4a9d239 100644
--- a/server/api/variable/variable.controller.js
+++ b/server/api/variable/variable.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xc815=['html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','limit','set','Content-Range','reject','save','update','then','destroy','get','Variables','UserProfileResource','error','stack','name','send','index','fieldName','type','key','model','map','query','filters','intersection','attributes','fields','length','offset','order','sort','where','merge','VIRTUAL','filter','options','Variable','count','includeAll','findAll','rows','catch','show','params','keys','rawAttributes','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s'];(function(_0x411add,_0x1aed38){var _0x238242=function(_0x4a1cd5){while(--_0x4a1cd5){_0x411add['push'](_0x411add['shift']());}};_0x238242(++_0x1aed38);}(_0xc815,0xaa));var _0x5c81=function(_0x46698a,_0x8de1e4){_0x46698a=_0x46698a-0x0;var _0x356db0=_0xc815[_0x46698a];return _0x356db0;};'use strict';var pdf=require(_0x5c81('0x0'));var emlformat=require(_0x5c81('0x1'));var rimraf=require(_0x5c81('0x2'));var zipdir=require(_0x5c81('0x3'));var jsonpatch=require(_0x5c81('0x4'));var rp=require(_0x5c81('0x5'));var moment=require(_0x5c81('0x6'));var BPromise=require(_0x5c81('0x7'));var Mustache=require(_0x5c81('0x8'));var util=require(_0x5c81('0x9'));var path=require(_0x5c81('0xa'));var sox=require(_0x5c81('0xb'));var csv=require(_0x5c81('0xc'));var ejs=require(_0x5c81('0xd'));var fs=require('fs');var _=require(_0x5c81('0xe'));var squel=require(_0x5c81('0xf'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x5c81('0x10'));var toCsv=require(_0x5c81('0xc'));var querystring=require(_0x5c81('0x11'));var Papa=require('papaparse');var Redis=require(_0x5c81('0x12'));var authService=require(_0x5c81('0x13'));var qs=require(_0x5c81('0x14'));var as=require(_0x5c81('0x15'));var hardwareService=require(_0x5c81('0x16'));var logger=require(_0x5c81('0x17'))(_0x5c81('0x18'));var utils=require(_0x5c81('0x19'));var config=require('../../config/environment');var db=require(_0x5c81('0x1a'))['db'];function respondWithStatusCode(_0x301353,_0x52c27b){_0x52c27b=_0x52c27b||0xcc;return function(_0x5e1541){if(_0x5e1541){return _0x301353[_0x5c81('0x1b')](_0x52c27b);}return _0x301353[_0x5c81('0x1c')](_0x52c27b)[_0x5c81('0x1d')]();};}function respondWithResult(_0xc87f7e,_0x14d42d){_0x14d42d=_0x14d42d||0xc8;return function(_0x42107e){if(_0x42107e){return _0xc87f7e['status'](_0x14d42d)[_0x5c81('0x1e')](_0x42107e);}};}function respondWithFilteredResult(_0x53c6b4,_0x4b89d5){return function(_0x4e77e9){if(_0x4e77e9){var _0x2f15d4=_0x4e77e9['count'],_0x18471b=_0x4b89d5['offset'],_0x34f65a=_0x4b89d5['offset']+_0x4b89d5[_0x5c81('0x1f')],_0x857bc;if(_0x34f65a>=_0x2f15d4){_0x34f65a=_0x2f15d4;_0x857bc=0xc8;}else{_0x857bc=0xce;}_0x53c6b4[_0x5c81('0x1c')](_0x857bc);return _0x53c6b4[_0x5c81('0x20')](_0x5c81('0x21'),_0x18471b+'-'+_0x34f65a+'/'+_0x2f15d4)[_0x5c81('0x1e')](_0x4e77e9);}return null;};}function patchUpdates(_0x41bcd4){return function(_0xfaa427){try{jsonpatch['apply'](_0xfaa427,_0x41bcd4,!![]);}catch(_0x4753f8){return BPromise[_0x5c81('0x22')](_0x4753f8);}return _0xfaa427[_0x5c81('0x23')]();};}function saveUpdates(_0x183780,_0x18889a){return function(_0x11dfaf){if(_0x11dfaf){return _0x11dfaf[_0x5c81('0x24')](_0x183780)[_0x5c81('0x25')](function(_0x452601){return _0x452601;});}return null;};}function removeEntity(_0x423418,_0x571e86){return function(_0x35d7ed){if(_0x35d7ed){return _0x35d7ed[_0x5c81('0x26')]()[_0x5c81('0x25')](function(){var _0x34b56b=_0x35d7ed[_0x5c81('0x27')]({'plain':!![]});var _0x4a3c3e=_0x5c81('0x28');return db[_0x5c81('0x29')][_0x5c81('0x26')]({'where':{'type':_0x4a3c3e,'resourceId':_0x34b56b['id']}})[_0x5c81('0x25')](function(){return _0x35d7ed;});})['then'](function(){_0x423418[_0x5c81('0x1c')](0xcc)[_0x5c81('0x1d')]();});}};}function handleEntityNotFound(_0x5aad99,_0x3beac2){return function(_0x183335){if(!_0x183335){_0x5aad99[_0x5c81('0x1b')](0x194);}return _0x183335;};}function handleError(_0x2e1da0,_0x3be961){_0x3be961=_0x3be961||0x1f4;return function(_0x22d5d7){logger[_0x5c81('0x2a')](_0x22d5d7[_0x5c81('0x2b')]);if(_0x22d5d7['name']){delete _0x22d5d7[_0x5c81('0x2c')];}_0x2e1da0[_0x5c81('0x1c')](_0x3be961)[_0x5c81('0x2d')](_0x22d5d7);};}exports[_0x5c81('0x2e')]=function(_0x22eb74,_0x23ed7e){var _0x2528b5={},_0x589f98={},_0x1b91ff={'count':0x0,'rows':[]};var _0x343668=_['map'](db['Variable']['rawAttributes'],function(_0x1b0fe5){return{'name':_0x1b0fe5[_0x5c81('0x2f')],'type':_0x1b0fe5[_0x5c81('0x30')][_0x5c81('0x31')]};});_0x589f98[_0x5c81('0x32')]=_[_0x5c81('0x33')](_0x343668,_0x5c81('0x2c'));_0x589f98[_0x5c81('0x34')]=_['keys'](_0x22eb74[_0x5c81('0x34')]);_0x589f98[_0x5c81('0x35')]=_[_0x5c81('0x36')](_0x589f98['model'],_0x589f98[_0x5c81('0x34')]);_0x2528b5[_0x5c81('0x37')]=_[_0x5c81('0x36')](_0x589f98[_0x5c81('0x32')],qs[_0x5c81('0x38')](_0x22eb74[_0x5c81('0x34')]['fields']));_0x2528b5[_0x5c81('0x37')]=_0x2528b5[_0x5c81('0x37')][_0x5c81('0x39')]?_0x2528b5['attributes']:_0x589f98[_0x5c81('0x32')];if(!_0x22eb74[_0x5c81('0x34')]['hasOwnProperty']('nolimit')){_0x2528b5[_0x5c81('0x1f')]=qs['limit'](_0x22eb74[_0x5c81('0x34')][_0x5c81('0x1f')]);_0x2528b5[_0x5c81('0x3a')]=qs[_0x5c81('0x3a')](_0x22eb74['query']['offset']);}_0x2528b5[_0x5c81('0x3b')]=qs[_0x5c81('0x3c')](_0x22eb74[_0x5c81('0x34')]['sort']);_0x2528b5[_0x5c81('0x3d')]=qs[_0x5c81('0x35')](_['pick'](_0x22eb74[_0x5c81('0x34')],_0x589f98[_0x5c81('0x35')]),_0x343668);if(_0x22eb74[_0x5c81('0x34')]['filter']){_0x2528b5[_0x5c81('0x3d')]=_[_0x5c81('0x3e')](_0x2528b5[_0x5c81('0x3d')],{'$or':_[_0x5c81('0x33')](_0x343668,function(_0x3fc584){if(_0x3fc584['type']!==_0x5c81('0x3f')){var _0x5b7bda={};_0x5b7bda[_0x3fc584[_0x5c81('0x2c')]]={'$like':'%'+_0x22eb74[_0x5c81('0x34')][_0x5c81('0x40')]+'%'};return _0x5b7bda;}})});}_0x2528b5=_['merge']({},_0x2528b5,_0x22eb74[_0x5c81('0x41')]);var _0x1e455c={'where':_0x2528b5[_0x5c81('0x3d')]};return db[_0x5c81('0x42')][_0x5c81('0x43')](_0x1e455c)[_0x5c81('0x25')](function(_0xe1802e){_0x1b91ff[_0x5c81('0x43')]=_0xe1802e;if(_0x22eb74['query'][_0x5c81('0x44')]){_0x2528b5['include']=[{'all':!![]}];}return db['Variable'][_0x5c81('0x45')](_0x2528b5);})[_0x5c81('0x25')](function(_0x1d5cd3){_0x1b91ff[_0x5c81('0x46')]=_0x1d5cd3;return _0x1b91ff;})[_0x5c81('0x25')](respondWithFilteredResult(_0x23ed7e,_0x2528b5))[_0x5c81('0x47')](handleError(_0x23ed7e,null));};exports[_0x5c81('0x48')]=function(_0x511374,_0x429e1f){var _0xc1b323={'raw':!![],'where':{'id':_0x511374[_0x5c81('0x49')]['id']}},_0x4c2e49={};_0x4c2e49[_0x5c81('0x32')]=_[_0x5c81('0x4a')](db[_0x5c81('0x42')][_0x5c81('0x4b')]);_0x4c2e49[_0x5c81('0x34')]=_[_0x5c81('0x4a')](_0x511374[_0x5c81('0x34')]);_0x4c2e49[_0x5c81('0x35')]=_['intersection'](_0x4c2e49[_0x5c81('0x32')],_0x4c2e49[_0x5c81('0x34')]);_0xc1b323[_0x5c81('0x37')]=_[_0x5c81('0x36')](_0x4c2e49['model'],qs[_0x5c81('0x38')](_0x511374[_0x5c81('0x34')][_0x5c81('0x38')]));_0xc1b323[_0x5c81('0x37')]=_0xc1b323['attributes']['length']?_0xc1b323['attributes']:_0x4c2e49[_0x5c81('0x32')];if(_0x511374[_0x5c81('0x34')][_0x5c81('0x44')]){_0xc1b323[_0x5c81('0x4c')]=[{'all':!![]}];}_0xc1b323=_[_0x5c81('0x3e')]({},_0xc1b323,_0x511374[_0x5c81('0x41')]);return db[_0x5c81('0x42')][_0x5c81('0x4d')](_0xc1b323)[_0x5c81('0x25')](handleEntityNotFound(_0x429e1f,null))[_0x5c81('0x25')](respondWithResult(_0x429e1f,null))['catch'](handleError(_0x429e1f,null));};exports['create']=function(_0x27140c,_0x4bbfe2){return db['Variable'][_0x5c81('0x4e')](_0x27140c[_0x5c81('0x4f')],{})['then'](function(_0x38fac3){var _0x46f9e0=_0x27140c[_0x5c81('0x50')][_0x5c81('0x27')]({'plain':!![]});if(!_0x46f9e0)throw new Error(_0x5c81('0x51'));if(_0x46f9e0['role']===_0x5c81('0x50')){var _0x1dce65=_0x38fac3['get']({'plain':!![]});var _0x143bff=_0x5c81('0x28');return db[_0x5c81('0x52')]['find']({'where':{'name':_0x143bff,'userProfileId':_0x46f9e0[_0x5c81('0x53')]},'raw':!![]})[_0x5c81('0x25')](function(_0x42269f){if(_0x42269f&&_0x42269f['autoAssociation']===0x0){return db['UserProfileResource'][_0x5c81('0x4e')]({'name':_0x1dce65[_0x5c81('0x2c')],'resourceId':_0x1dce65['id'],'type':_0x42269f[_0x5c81('0x2c')],'sectionId':_0x42269f['id']},{})[_0x5c81('0x25')](function(){return _0x38fac3;});}else{return _0x38fac3;}})['catch'](function(_0x420c45){logger['error'](_0x5c81('0x54'),_0x420c45);throw _0x420c45;});}return _0x38fac3;})[_0x5c81('0x25')](respondWithResult(_0x4bbfe2,0xc9))[_0x5c81('0x47')](handleError(_0x4bbfe2,null));};exports[_0x5c81('0x24')]=function(_0x1c1d18,_0x1644de){if(_0x1c1d18[_0x5c81('0x4f')]['id']){delete _0x1c1d18['body']['id'];}return db[_0x5c81('0x42')]['find']({'where':{'id':_0x1c1d18[_0x5c81('0x49')]['id']}})[_0x5c81('0x25')](handleEntityNotFound(_0x1644de,null))[_0x5c81('0x25')](saveUpdates(_0x1c1d18['body'],null))[_0x5c81('0x25')](respondWithResult(_0x1644de,null))[_0x5c81('0x47')](handleError(_0x1644de,null));};exports[_0x5c81('0x26')]=function(_0x49b430,_0x6ea24e){return db['Variable'][_0x5c81('0x4d')]({'where':{'id':_0x49b430[_0x5c81('0x49')]['id']}})[_0x5c81('0x25')](handleEntityNotFound(_0x6ea24e,null))[_0x5c81('0x25')](removeEntity(_0x6ea24e,null))['catch'](handleError(_0x6ea24e,null));};
\ No newline at end of file
+var _0xdb10=['../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../mysqldb','sendStatus','status','end','json','offset','limit','set','Content-Range','reject','then','destroy','get','Variables','stack','name','send','index','Variable','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','VIRTUAL','count','includeAll','findAll','rows','catch','show','merge','options','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','UserProfileResource','error','update','find','params','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis'];(function(_0x52c60c,_0x58c2b8){var _0x9d771=function(_0x499dce){while(--_0x499dce){_0x52c60c['push'](_0x52c60c['shift']());}};_0x9d771(++_0x58c2b8);}(_0xdb10,0x18f));var _0x0db1=function(_0x39872b,_0x343e6b){_0x39872b=_0x39872b-0x0;var _0x55fa18=_0xdb10[_0x39872b];return _0x55fa18;};'use strict';var pdf=require(_0x0db1('0x0'));var emlformat=require(_0x0db1('0x1'));var rimraf=require(_0x0db1('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x0db1('0x3'));var rp=require(_0x0db1('0x4'));var moment=require(_0x0db1('0x5'));var BPromise=require(_0x0db1('0x6'));var Mustache=require(_0x0db1('0x7'));var util=require(_0x0db1('0x8'));var path=require(_0x0db1('0x9'));var sox=require(_0x0db1('0xa'));var csv=require(_0x0db1('0xb'));var ejs=require(_0x0db1('0xc'));var fs=require('fs');var _=require(_0x0db1('0xd'));var squel=require(_0x0db1('0xe'));var crypto=require(_0x0db1('0xf'));var jsforce=require(_0x0db1('0x10'));var deskjs=require(_0x0db1('0x11'));var toCsv=require(_0x0db1('0xb'));var querystring=require(_0x0db1('0x12'));var Papa=require(_0x0db1('0x13'));var Redis=require(_0x0db1('0x14'));var authService=require('../../components/auth/service');var qs=require(_0x0db1('0x15'));var as=require(_0x0db1('0x16'));var hardwareService=require(_0x0db1('0x17'));var logger=require(_0x0db1('0x18'))(_0x0db1('0x19'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x0db1('0x1a'))['db'];function respondWithStatusCode(_0x2bacc6,_0x211fda){_0x211fda=_0x211fda||0xcc;return function(_0x1f6522){if(_0x1f6522){return _0x2bacc6[_0x0db1('0x1b')](_0x211fda);}return _0x2bacc6[_0x0db1('0x1c')](_0x211fda)[_0x0db1('0x1d')]();};}function respondWithResult(_0x3654b8,_0x40bb35){_0x40bb35=_0x40bb35||0xc8;return function(_0x439a9c){if(_0x439a9c){return _0x3654b8[_0x0db1('0x1c')](_0x40bb35)[_0x0db1('0x1e')](_0x439a9c);}};}function respondWithFilteredResult(_0x1f4894,_0x1f9c45){return function(_0x397659){if(_0x397659){var _0x5224ac=_0x397659['count'],_0x3f151e=_0x1f9c45[_0x0db1('0x1f')],_0x260236=_0x1f9c45['offset']+_0x1f9c45[_0x0db1('0x20')],_0x52842e;if(_0x260236>=_0x5224ac){_0x260236=_0x5224ac;_0x52842e=0xc8;}else{_0x52842e=0xce;}_0x1f4894[_0x0db1('0x1c')](_0x52842e);return _0x1f4894[_0x0db1('0x21')](_0x0db1('0x22'),_0x3f151e+'-'+_0x260236+'/'+_0x5224ac)[_0x0db1('0x1e')](_0x397659);}return null;};}function patchUpdates(_0x449d57){return function(_0x6c7649){try{jsonpatch['apply'](_0x6c7649,_0x449d57,!![]);}catch(_0x4bc231){return BPromise[_0x0db1('0x23')](_0x4bc231);}return _0x6c7649['save']();};}function saveUpdates(_0x487351,_0x7e38ef){return function(_0x3e8f74){if(_0x3e8f74){return _0x3e8f74['update'](_0x487351)[_0x0db1('0x24')](function(_0x5acf91){return _0x5acf91;});}return null;};}function removeEntity(_0x4c666f,_0x31ee00){return function(_0x3f04cd){if(_0x3f04cd){return _0x3f04cd[_0x0db1('0x25')]()[_0x0db1('0x24')](function(){var _0x15d68f=_0x3f04cd[_0x0db1('0x26')]({'plain':!![]});var _0x32ee6e=_0x0db1('0x27');return db['UserProfileResource']['destroy']({'where':{'type':_0x32ee6e,'resourceId':_0x15d68f['id']}})[_0x0db1('0x24')](function(){return _0x3f04cd;});})[_0x0db1('0x24')](function(){_0x4c666f['status'](0xcc)[_0x0db1('0x1d')]();});}};}function handleEntityNotFound(_0x1c5506,_0x5456f6){return function(_0x457ad2){if(!_0x457ad2){_0x1c5506[_0x0db1('0x1b')](0x194);}return _0x457ad2;};}function handleError(_0x5b2996,_0x3b7677){_0x3b7677=_0x3b7677||0x1f4;return function(_0x45787b){logger['error'](_0x45787b[_0x0db1('0x28')]);if(_0x45787b['name']){delete _0x45787b[_0x0db1('0x29')];}_0x5b2996['status'](_0x3b7677)[_0x0db1('0x2a')](_0x45787b);};}exports[_0x0db1('0x2b')]=function(_0x2c4f0e,_0x518f58){var _0xdf59e6={},_0x3c6feb={},_0x2cab33={'count':0x0,'rows':[]};var _0x29270d=_['map'](db[_0x0db1('0x2c')][_0x0db1('0x2d')],function(_0x32a078){return{'name':_0x32a078[_0x0db1('0x2e')],'type':_0x32a078[_0x0db1('0x2f')][_0x0db1('0x30')]};});_0x3c6feb[_0x0db1('0x31')]=_[_0x0db1('0x32')](_0x29270d,_0x0db1('0x29'));_0x3c6feb[_0x0db1('0x33')]=_[_0x0db1('0x34')](_0x2c4f0e['query']);_0x3c6feb[_0x0db1('0x35')]=_[_0x0db1('0x36')](_0x3c6feb[_0x0db1('0x31')],_0x3c6feb[_0x0db1('0x33')]);_0xdf59e6[_0x0db1('0x37')]=_[_0x0db1('0x36')](_0x3c6feb[_0x0db1('0x31')],qs[_0x0db1('0x38')](_0x2c4f0e[_0x0db1('0x33')][_0x0db1('0x38')]));_0xdf59e6['attributes']=_0xdf59e6[_0x0db1('0x37')][_0x0db1('0x39')]?_0xdf59e6[_0x0db1('0x37')]:_0x3c6feb[_0x0db1('0x31')];if(!_0x2c4f0e[_0x0db1('0x33')][_0x0db1('0x3a')](_0x0db1('0x3b'))){_0xdf59e6[_0x0db1('0x20')]=qs[_0x0db1('0x20')](_0x2c4f0e[_0x0db1('0x33')]['limit']);_0xdf59e6[_0x0db1('0x1f')]=qs[_0x0db1('0x1f')](_0x2c4f0e[_0x0db1('0x33')][_0x0db1('0x1f')]);}_0xdf59e6[_0x0db1('0x3c')]=qs[_0x0db1('0x3d')](_0x2c4f0e[_0x0db1('0x33')][_0x0db1('0x3d')]);_0xdf59e6[_0x0db1('0x3e')]=qs[_0x0db1('0x35')](_['pick'](_0x2c4f0e['query'],_0x3c6feb['filters']),_0x29270d);if(_0x2c4f0e[_0x0db1('0x33')][_0x0db1('0x3f')]){_0xdf59e6['where']=_['merge'](_0xdf59e6['where'],{'$or':_[_0x0db1('0x32')](_0x29270d,function(_0x5413fc){if(_0x5413fc['type']!==_0x0db1('0x40')){var _0x20958c={};_0x20958c[_0x5413fc[_0x0db1('0x29')]]={'$like':'%'+_0x2c4f0e[_0x0db1('0x33')][_0x0db1('0x3f')]+'%'};return _0x20958c;}})});}_0xdf59e6=_['merge']({},_0xdf59e6,_0x2c4f0e['options']);var _0x369a2e={'where':_0xdf59e6[_0x0db1('0x3e')]};return db[_0x0db1('0x2c')][_0x0db1('0x41')](_0x369a2e)[_0x0db1('0x24')](function(_0x5c30b6){_0x2cab33['count']=_0x5c30b6;if(_0x2c4f0e[_0x0db1('0x33')][_0x0db1('0x42')]){_0xdf59e6['include']=[{'all':!![]}];}return db[_0x0db1('0x2c')][_0x0db1('0x43')](_0xdf59e6);})[_0x0db1('0x24')](function(_0x559d23){_0x2cab33[_0x0db1('0x44')]=_0x559d23;return _0x2cab33;})['then'](respondWithFilteredResult(_0x518f58,_0xdf59e6))[_0x0db1('0x45')](handleError(_0x518f58,null));};exports[_0x0db1('0x46')]=function(_0x1e7845,_0x14dffb){var _0xa2f721={'raw':!![],'where':{'id':_0x1e7845['params']['id']}},_0x53f2a8={};_0x53f2a8[_0x0db1('0x31')]=_[_0x0db1('0x34')](db['Variable'][_0x0db1('0x2d')]);_0x53f2a8['query']=_['keys'](_0x1e7845[_0x0db1('0x33')]);_0x53f2a8[_0x0db1('0x35')]=_[_0x0db1('0x36')](_0x53f2a8[_0x0db1('0x31')],_0x53f2a8[_0x0db1('0x33')]);_0xa2f721[_0x0db1('0x37')]=_[_0x0db1('0x36')](_0x53f2a8['model'],qs[_0x0db1('0x38')](_0x1e7845[_0x0db1('0x33')][_0x0db1('0x38')]));_0xa2f721['attributes']=_0xa2f721[_0x0db1('0x37')][_0x0db1('0x39')]?_0xa2f721[_0x0db1('0x37')]:_0x53f2a8[_0x0db1('0x31')];if(_0x1e7845['query'][_0x0db1('0x42')]){_0xa2f721['include']=[{'all':!![]}];}_0xa2f721=_[_0x0db1('0x47')]({},_0xa2f721,_0x1e7845[_0x0db1('0x48')]);return db[_0x0db1('0x2c')]['find'](_0xa2f721)[_0x0db1('0x24')](handleEntityNotFound(_0x14dffb,null))[_0x0db1('0x24')](respondWithResult(_0x14dffb,null))[_0x0db1('0x45')](handleError(_0x14dffb,null));};exports[_0x0db1('0x49')]=function(_0x51c33c,_0x843013){return db[_0x0db1('0x2c')][_0x0db1('0x49')](_0x51c33c[_0x0db1('0x4a')],{})[_0x0db1('0x24')](function(_0x18b956){var _0x59d192=_0x51c33c[_0x0db1('0x4b')][_0x0db1('0x26')]({'plain':!![]});if(!_0x59d192)throw new Error(_0x0db1('0x4c'));if(_0x59d192[_0x0db1('0x4d')]==='user'){var _0x37d623=_0x18b956[_0x0db1('0x26')]({'plain':!![]});var _0x291a4e=_0x0db1('0x27');return db['UserProfileSection']['find']({'where':{'name':_0x291a4e,'userProfileId':_0x59d192[_0x0db1('0x4e')]},'raw':!![]})[_0x0db1('0x24')](function(_0x374c6d){if(_0x374c6d&&_0x374c6d['autoAssociation']===0x0){return db[_0x0db1('0x4f')][_0x0db1('0x49')]({'name':_0x37d623[_0x0db1('0x29')],'resourceId':_0x37d623['id'],'type':_0x374c6d[_0x0db1('0x29')],'sectionId':_0x374c6d['id']},{})[_0x0db1('0x24')](function(){return _0x18b956;});}else{return _0x18b956;}})['catch'](function(_0x285674){logger[_0x0db1('0x50')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x285674);throw _0x285674;});}return _0x18b956;})[_0x0db1('0x24')](respondWithResult(_0x843013,0xc9))[_0x0db1('0x45')](handleError(_0x843013,null));};exports[_0x0db1('0x51')]=function(_0x44312d,_0x434cb9){if(_0x44312d[_0x0db1('0x4a')]['id']){delete _0x44312d[_0x0db1('0x4a')]['id'];}return db[_0x0db1('0x2c')][_0x0db1('0x52')]({'where':{'id':_0x44312d[_0x0db1('0x53')]['id']}})[_0x0db1('0x24')](handleEntityNotFound(_0x434cb9,null))[_0x0db1('0x24')](saveUpdates(_0x44312d[_0x0db1('0x4a')],null))['then'](respondWithResult(_0x434cb9,null))[_0x0db1('0x45')](handleError(_0x434cb9,null));};exports[_0x0db1('0x25')]=function(_0x2d43fa,_0x68f38e){return db[_0x0db1('0x2c')]['find']({'where':{'id':_0x2d43fa[_0x0db1('0x53')]['id']}})[_0x0db1('0x24')](handleEntityNotFound(_0x68f38e,null))[_0x0db1('0x24')](removeEntity(_0x68f38e,null))[_0x0db1('0x45')](handleError(_0x68f38e,null));};
\ No newline at end of file
diff --git a/server/api/variable/variable.model.js b/server/api/variable/variable.model.js
index a1928f6..c94ab66 100644
--- a/server/api/variable/variable.model.js
+++ b/server/api/variable/variable.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x6be6=['Variable','tools_variables','util','../../config/logger','api','moment','request-promise','rimraf','../../config/environment','./variable.attributes','exports','define'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x6be6,0x1a6));var _0x66be=function(_0x2925b3,_0x56b8fc){_0x2925b3=_0x2925b3-0x0;var _0x2d71c9=_0x6be6[_0x2925b3];return _0x2d71c9;};'use strict';var _=require('lodash');var util=require(_0x66be('0x0'));var logger=require(_0x66be('0x1'))(_0x66be('0x2'));var moment=require(_0x66be('0x3'));var BPromise=require('bluebird');var rp=require(_0x66be('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x66be('0x5'));var config=require(_0x66be('0x6'));var attributes=require(_0x66be('0x7'));module[_0x66be('0x8')]=function(_0x5b6bd4,_0x3fa576){return _0x5b6bd4[_0x66be('0x9')](_0x66be('0xa'),attributes,{'tableName':_0x66be('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xbcea=['Variable','tools_variables','util','../../config/logger','moment','bluebird','request-promise','path','exports','define'];(function(_0x21108d,_0x233a7c){var _0x2d2fa8=function(_0x11f9e5){while(--_0x11f9e5){_0x21108d['push'](_0x21108d['shift']());}};_0x2d2fa8(++_0x233a7c);}(_0xbcea,0xa2));var _0xabce=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0xbcea[_0x42cae2];return _0x5f256f;};'use strict';var _=require('lodash');var util=require(_0xabce('0x0'));var logger=require(_0xabce('0x1'))('api');var moment=require(_0xabce('0x2'));var BPromise=require(_0xabce('0x3'));var rp=require(_0xabce('0x4'));var fs=require('fs');var path=require(_0xabce('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./variable.attributes');module[_0xabce('0x6')]=function(_0x50ed02,_0x349edb){return _0x50ed02[_0xabce('0x7')](_0xabce('0x8'),attributes,{'tableName':_0xabce('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/variable/variable.rpc.js b/server/api/variable/variable.rpc.js
index 4da1aa2..ec16b26 100644
--- a/server/api/variable/variable.rpc.js
+++ b/server/api/variable/variable.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xbc35=['options','raw','where','map','attributes','include','ShowVariable','lodash','moment','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','request\x20sent','debug','Variable,\x20%s,\x20%s,\x20%s','stringify','error','code','message','Variable,\x20%s,\x20%s','result','catch','Variable'];(function(_0x3e0b8f,_0x1cddeb){var _0x22f742=function(_0xacb1bc){while(--_0xacb1bc){_0x3e0b8f['push'](_0x3e0b8f['shift']());}};_0x22f742(++_0x1cddeb);}(_0xbc35,0xd9));var _0x5bc3=function(_0x2c9dad,_0x51ed87){_0x2c9dad=_0x2c9dad-0x0;var _0x572a16=_0xbc35[_0x2c9dad];return _0x572a16;};'use strict';var _=require(_0x5bc3('0x0'));var util=require('util');var moment=require(_0x5bc3('0x1'));var BPromise=require('bluebird');var rs=require(_0x5bc3('0x2'));var fs=require('fs');var Redis=require(_0x5bc3('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x5bc3('0x4'))(_0x5bc3('0x5'));var config=require(_0x5bc3('0x6'));var jayson=require(_0x5bc3('0x7'));var client=jayson['client'][_0x5bc3('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x410c91,_0x5bb70a,_0x25b234){return new BPromise(function(_0x4c0536,_0x39a3b2){return client[_0x5bc3('0x9')](_0x410c91,_0x25b234)[_0x5bc3('0xa')](function(_0x12152b){logger[_0x5bc3('0xb')]('Variable,\x20%s,\x20%s',_0x5bb70a,_0x5bc3('0xc'));logger[_0x5bc3('0xd')](_0x5bc3('0xe'),_0x5bb70a,_0x5bc3('0xc'),JSON[_0x5bc3('0xf')](_0x12152b));if(_0x12152b[_0x5bc3('0x10')]){if(_0x12152b['error'][_0x5bc3('0x11')]===0x1f4){logger[_0x5bc3('0x10')]('Variable,\x20%s,\x20%s',_0x5bb70a,_0x12152b['error'][_0x5bc3('0x12')]);return _0x39a3b2(_0x12152b[_0x5bc3('0x10')]['message']);}logger[_0x5bc3('0x10')](_0x5bc3('0x13'),_0x5bb70a,_0x12152b['error']['message']);return _0x4c0536(_0x12152b[_0x5bc3('0x10')]['message']);}else{logger[_0x5bc3('0xb')](_0x5bc3('0x13'),_0x5bb70a,'request\x20sent');_0x4c0536(_0x12152b[_0x5bc3('0x14')][_0x5bc3('0x12')]);}})[_0x5bc3('0x15')](function(_0x2ee45d){logger[_0x5bc3('0x10')](_0x5bc3('0x13'),_0x5bb70a,_0x2ee45d);_0x39a3b2(_0x2ee45d);});});}exports['ShowVariable']=function(_0x107c56){var _0x299d80=this;return new Promise(function(_0x2236c6,_0x427416){return db[_0x5bc3('0x16')]['find']({'raw':_0x107c56[_0x5bc3('0x17')]?_0x107c56[_0x5bc3('0x17')][_0x5bc3('0x18')]===undefined?!![]:![]:!![],'where':_0x107c56[_0x5bc3('0x17')]?_0x107c56[_0x5bc3('0x17')][_0x5bc3('0x19')]||null:null,'attributes':_0x107c56[_0x5bc3('0x17')]?_0x107c56['options']['attributes']||null:null,'include':_0x107c56[_0x5bc3('0x17')]?_0x107c56[_0x5bc3('0x17')]['include']?_[_0x5bc3('0x1a')](_0x107c56[_0x5bc3('0x17')]['include'],function(_0x4d2b99){return{'model':db[_0x4d2b99['model']],'as':_0x4d2b99['as'],'attributes':_0x4d2b99[_0x5bc3('0x1b')],'include':_0x4d2b99[_0x5bc3('0x1c')]?_[_0x5bc3('0x1a')](_0x4d2b99['include'],function(_0x1d776e){return{'model':db[_0x1d776e['model']],'as':_0x1d776e['as'],'attributes':_0x1d776e[_0x5bc3('0x1b')],'include':_0x1d776e[_0x5bc3('0x1c')]?_[_0x5bc3('0x1a')](_0x1d776e[_0x5bc3('0x1c')],function(_0x4a4d8a){return{'model':db[_0x4a4d8a['model']],'as':_0x4a4d8a['as'],'attributes':_0x4a4d8a[_0x5bc3('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x18adbc){logger[_0x5bc3('0xb')](_0x5bc3('0x1d'),_0x107c56);logger[_0x5bc3('0xd')]('ShowVariable',_0x107c56,JSON[_0x5bc3('0xf')](_0x18adbc));_0x2236c6(_0x18adbc);})[_0x5bc3('0x15')](function(_0x4b4016){logger[_0x5bc3('0x10')](_0x5bc3('0x1d'),_0x4b4016[_0x5bc3('0x12')],_0x107c56);_0x427416(_0x299d80['error'](0x1f4,_0x4b4016[_0x5bc3('0x12')]));});});};
\ No newline at end of file
+var _0xd051=['include','map','model','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','then','info','Variable,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','ShowVariable','Variable','find','options','raw','where','attributes'];(function(_0x5013bd,_0x4d4b8d){var _0x5d3e13=function(_0x3dd8a0){while(--_0x3dd8a0){_0x5013bd['push'](_0x5013bd['shift']());}};_0x5d3e13(++_0x4d4b8d);}(_0xd051,0x1e3));var _0x1d05=function(_0x476016,_0x5ec9d7){_0x476016=_0x476016-0x0;var _0x33b1dd=_0xd051[_0x476016];return _0x33b1dd;};'use strict';var _=require('lodash');var util=require(_0x1d05('0x0'));var moment=require(_0x1d05('0x1'));var BPromise=require(_0x1d05('0x2'));var rs=require(_0x1d05('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1d05('0x4'))['db'];var utils=require(_0x1d05('0x5'));var logger=require(_0x1d05('0x6'))(_0x1d05('0x7'));var config=require('../../config/environment');var jayson=require(_0x1d05('0x8'));var client=jayson['client'][_0x1d05('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1507e0,_0x53b00d,_0x370fd5){return new BPromise(function(_0x85c8e8,_0x39eecf){return client['request'](_0x1507e0,_0x370fd5)[_0x1d05('0xa')](function(_0x560abd){logger[_0x1d05('0xb')](_0x1d05('0xc'),_0x53b00d,'request\x20sent');logger[_0x1d05('0xd')]('Variable,\x20%s,\x20%s,\x20%s',_0x53b00d,_0x1d05('0xe'),JSON[_0x1d05('0xf')](_0x560abd));if(_0x560abd['error']){if(_0x560abd[_0x1d05('0x10')][_0x1d05('0x11')]===0x1f4){logger[_0x1d05('0x10')](_0x1d05('0xc'),_0x53b00d,_0x560abd[_0x1d05('0x10')][_0x1d05('0x12')]);return _0x39eecf(_0x560abd[_0x1d05('0x10')][_0x1d05('0x12')]);}logger[_0x1d05('0x10')]('Variable,\x20%s,\x20%s',_0x53b00d,_0x560abd[_0x1d05('0x10')][_0x1d05('0x12')]);return _0x85c8e8(_0x560abd[_0x1d05('0x10')][_0x1d05('0x12')]);}else{logger['info']('Variable,\x20%s,\x20%s',_0x53b00d,_0x1d05('0xe'));_0x85c8e8(_0x560abd[_0x1d05('0x13')][_0x1d05('0x12')]);}})['catch'](function(_0x245153){logger[_0x1d05('0x10')](_0x1d05('0xc'),_0x53b00d,_0x245153);_0x39eecf(_0x245153);});});}exports[_0x1d05('0x14')]=function(_0x4e15c9){var _0x3e3363=this;return new Promise(function(_0x2e4a32,_0x3d3299){return db[_0x1d05('0x15')][_0x1d05('0x16')]({'raw':_0x4e15c9['options']?_0x4e15c9[_0x1d05('0x17')][_0x1d05('0x18')]===undefined?!![]:![]:!![],'where':_0x4e15c9[_0x1d05('0x17')]?_0x4e15c9[_0x1d05('0x17')][_0x1d05('0x19')]||null:null,'attributes':_0x4e15c9['options']?_0x4e15c9[_0x1d05('0x17')][_0x1d05('0x1a')]||null:null,'include':_0x4e15c9[_0x1d05('0x17')]?_0x4e15c9[_0x1d05('0x17')][_0x1d05('0x1b')]?_[_0x1d05('0x1c')](_0x4e15c9['options'][_0x1d05('0x1b')],function(_0x289d9f){return{'model':db[_0x289d9f['model']],'as':_0x289d9f['as'],'attributes':_0x289d9f['attributes'],'include':_0x289d9f[_0x1d05('0x1b')]?_[_0x1d05('0x1c')](_0x289d9f[_0x1d05('0x1b')],function(_0x3db478){return{'model':db[_0x3db478[_0x1d05('0x1d')]],'as':_0x3db478['as'],'attributes':_0x3db478['attributes'],'include':_0x3db478[_0x1d05('0x1b')]?_[_0x1d05('0x1c')](_0x3db478[_0x1d05('0x1b')],function(_0x150d16){return{'model':db[_0x150d16[_0x1d05('0x1d')]],'as':_0x150d16['as'],'attributes':_0x150d16[_0x1d05('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x1d05('0xa')](function(_0x149dee){logger[_0x1d05('0xb')]('ShowVariable',_0x4e15c9);logger['debug'](_0x1d05('0x14'),_0x4e15c9,JSON[_0x1d05('0xf')](_0x149dee));_0x2e4a32(_0x149dee);})['catch'](function(_0x4ac858){logger['error'](_0x1d05('0x14'),_0x4ac858['message'],_0x4e15c9);_0x3d3299(_0x3e3363[_0x1d05('0x10')](0x1f4,_0x4ac858[_0x1d05('0x12')]));});});};
\ No newline at end of file
diff --git a/server/api/version/index.js b/server/api/version/index.js
index 179e494..99e324c 100644
--- a/server/api/version/index.js
+++ b/server/api/version/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x2dfd=['/restart','migrations','exports','express','Router','../../components/auth/service','get','index','/fetch','isAuthenticated','canUpdate','fetch','/reset','/pull','pull'];(function(_0x3a0c83,_0x36d1e8){var _0x3c5d1f=function(_0x1c9d17){while(--_0x1c9d17){_0x3a0c83['push'](_0x3a0c83['shift']());}};_0x3c5d1f(++_0x36d1e8);}(_0x2dfd,0x12f));var _0xd2df=function(_0x25605f,_0x1d19b0){_0x25605f=_0x25605f-0x0;var _0xc74459=_0x2dfd[_0x25605f];return _0xc74459;};'use strict';var express=require(_0xd2df('0x0'));var router=express[_0xd2df('0x1')]();var auth=require(_0xd2df('0x2'));var controller=require('./version.controller');router[_0xd2df('0x3')]('/',controller[_0xd2df('0x4')]);router[_0xd2df('0x3')](_0xd2df('0x5'),auth[_0xd2df('0x6')](),auth[_0xd2df('0x7')](),controller[_0xd2df('0x8')]);router[_0xd2df('0x3')](_0xd2df('0x9'),auth['isAuthenticated'](),auth[_0xd2df('0x7')](),controller['reset']);router[_0xd2df('0x3')](_0xd2df('0xa'),auth[_0xd2df('0x6')](),auth[_0xd2df('0x7')](),controller[_0xd2df('0xb')]);router[_0xd2df('0x3')](_0xd2df('0xc'),auth[_0xd2df('0x6')](),controller['restart']);router[_0xd2df('0x3')]('/migrations',controller[_0xd2df('0xd')]);module[_0xd2df('0xe')]=router;
\ No newline at end of file
+var _0x2351=['exports','express','Router','get','index','/fetch','isAuthenticated','canUpdate','fetch','/reset','reset','/pull','pull','/restart','restart','migrations'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x2351,0x91));var _0x1235=function(_0x557e64,_0x10fd04){_0x557e64=_0x557e64-0x0;var _0x52b81e=_0x2351[_0x557e64];return _0x52b81e;};'use strict';var express=require(_0x1235('0x0'));var router=express[_0x1235('0x1')]();var auth=require('../../components/auth/service');var controller=require('./version.controller');router[_0x1235('0x2')]('/',controller[_0x1235('0x3')]);router['get'](_0x1235('0x4'),auth[_0x1235('0x5')](),auth[_0x1235('0x6')](),controller[_0x1235('0x7')]);router[_0x1235('0x2')](_0x1235('0x8'),auth[_0x1235('0x5')](),auth[_0x1235('0x6')](),controller[_0x1235('0x9')]);router[_0x1235('0x2')](_0x1235('0xa'),auth['isAuthenticated'](),auth[_0x1235('0x6')](),controller[_0x1235('0xb')]);router[_0x1235('0x2')](_0x1235('0xc'),auth[_0x1235('0x5')](),controller[_0x1235('0xd')]);router[_0x1235('0x2')]('/migrations',controller[_0x1235('0xe')]);module[_0x1235('0xf')]=router;
\ No newline at end of file
diff --git a/server/api/version/version.controller.js b/server/api/version/version.controller.js
index 14a6df7..37a8b3b 100644
--- a/server/api/version/version.controller.js
+++ b/server/api/version/version.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x09d2=['git\x20reset\x20--hard\x20FETCH_HEAD','git\x20reset\x20--hard','pull','npm\x20install\x20--production','restart','then','pm2\x20restart\x20motion\x20%s','Your\x20system\x20has\x20been\x20restart\x20successfully','catch','migrations','readdirSync','join','replace','push','length','sequelize','getQueryInterface','constructor','Migration\x20tried\x20to\x20use\x20old\x20style\x20\x22done\x22\x20callback.\x20Please\x20upgrade\x20to\x20\x22umzug\x22\x20and\x20return\x20a\x20promise\x20instead.','server','map','.js','Database\x20migrated\x20successfully\x20from\x20version\x20','\x20to\x20','last','Database\x20already\x20up-to-date','umzug','path','lodash','pkginfo','version','compare-versions','child_process','exec','../../mysqldb','../../config/environment','../../config/logger','update','simple-git','root','index','exports','query','fetch','tags','latest','2.0.0','status','json','master','info','git\x20fetch\x20origin\x20master','reset','--hard','error'];(function(_0x39cb13,_0xf7308){var _0x154715=function(_0x184a17){while(--_0x184a17){_0x39cb13['push'](_0x39cb13['shift']());}};_0x154715(++_0xf7308);}(_0x09d2,0x1d2));var _0x209d=function(_0x15afe3,_0x46789c){_0x15afe3=_0x15afe3-0x0;var _0x3088db=_0x09d2[_0x15afe3];return _0x3088db;};'use strict';var Umzug=require(_0x209d('0x0'));var path=require(_0x209d('0x1'));var fs=require('fs');var _=require(_0x209d('0x2'));var pkginfo=require(_0x209d('0x3'))(module,_0x209d('0x4'));var compareVersions=require(_0x209d('0x5'));var exec=require(_0x209d('0x6'))[_0x209d('0x7')];var db=require(_0x209d('0x8'))['db'];var config=require(_0x209d('0x9'));var pm2=require('../../config/pm2');var logger=require(_0x209d('0xa'))(_0x209d('0xb'));var git=require(_0x209d('0xc'))(config[_0x209d('0xd')]);exports[_0x209d('0xe')]=function(_0x5b460d,_0x49cd7a){var _0x306753={'current':module[_0x209d('0xf')][_0x209d('0x4')],'phonebar':0x2};if(_0x5b460d['query']&&_0x5b460d[_0x209d('0x10')]['latest']){return git[_0x209d('0x11')]()[_0x209d('0x12')](function(_0x3ee1eb,_0x35f411){_0x306753[_0x209d('0x13')]=(_0x3ee1eb?module[_0x209d('0xf')][_0x209d('0x4')]:_0x35f411[_0x209d('0x13')])||_0x209d('0x14');return _0x49cd7a[_0x209d('0x15')](0xc8)[_0x209d('0x16')](_0x306753);});}else{return _0x49cd7a[_0x209d('0x15')](0xc8)['json'](_0x306753);}};exports[_0x209d('0x11')]=function(_0x10b2ce,_0x1d6484){return git['fetch'](['origin',_0x209d('0x17')],function(_0x5267d3){if(_0x5267d3){logger['error'](_0x5267d3);return _0x1d6484[_0x209d('0x15')](0x1f4)[_0x209d('0x16')](_0x5267d3);}logger[_0x209d('0x18')]('git\x20fetch');return _0x1d6484[_0x209d('0x15')](0xc8)[_0x209d('0x16')]({'output':_0x209d('0x19')});});};exports[_0x209d('0x1a')]=function(_0x59d750,_0x2cdf73){return git[_0x209d('0x1a')]([_0x209d('0x1b'),'FETCH_HEAD'],function(_0x47daf8){if(_0x47daf8){logger[_0x209d('0x1c')](_0x47daf8);return _0x2cdf73['status'](0x1f4)[_0x209d('0x16')](_0x47daf8);}logger[_0x209d('0x18')](_0x209d('0x1d'));return _0x2cdf73[_0x209d('0x15')](0xc8)[_0x209d('0x16')]({'output':_0x209d('0x1e')});});};exports[_0x209d('0x1f')]=function(_0x1a1226,_0x178584){exec(_0x209d('0x20'),function(_0x35ae52,_0x30fe74,_0x61a720){logger[_0x209d('0x18')](_0x30fe74);logger[_0x209d('0x18')](_0x61a720);if(_0x35ae52){logger[_0x209d('0x1c')](_0x35ae52);return _0x178584[_0x209d('0x15')](0x1f4)[_0x209d('0x16')](_0x35ae52);}return _0x178584[_0x209d('0x15')](0xc8)[_0x209d('0x16')]({'output':_0x30fe74});});};exports[_0x209d('0x21')]=function(_0x4d1579,_0x67382e){return pm2[_0x209d('0x21')]('motion2')[_0x209d('0x22')](function(_0x561ad6){logger[_0x209d('0x18')](_0x209d('0x23'),_0x561ad6);return _0x67382e[_0x209d('0x15')](0xc8)[_0x209d('0x16')]({'output':_0x209d('0x24')});})[_0x209d('0x25')](function(_0x5399e3){logger[_0x209d('0x1c')](_0x5399e3);return _0x67382e[_0x209d('0x15')](0x1f4)['json'](_0x5399e3);});};exports[_0x209d('0x26')]=function(_0x14dc18,_0x21899a){var _0x28750e=fs[_0x209d('0x27')](path[_0x209d('0x28')](config['root'],'server',_0x209d('0x26')));var _0x57d9ad=[];for(var _0x3a69da=0x0;_0x3a69da<_0x28750e['length'];_0x3a69da++){var _0x1fbdba=_0x28750e[_0x3a69da][_0x209d('0x29')]('.js','');if(compareVersions(module['exports'][_0x209d('0x4')],_0x1fbdba)===-0x1){_0x57d9ad[_0x209d('0x2a')](_0x1fbdba);}}if(_0x57d9ad[_0x209d('0x2b')]){var _0x19c3fc=_0x57d9ad['sort'](compareVersions);var _0x182525=new Umzug({'storage':_0x209d('0x2c'),'storageOptions':{'model':db['Migration'],'modelName':'Migration','columnName':_0x209d('0x4')},'migrations':{'params':[db['sequelize'][_0x209d('0x2d')](),db[_0x209d('0x2c')][_0x209d('0x2e')],function(){throw new Error(_0x209d('0x2f'));}],'path':path[_0x209d('0x28')](config[_0x209d('0xd')],_0x209d('0x30'),'migrations'),'pattern':/\.js$/}});_0x182525['up']({'migrations':_[_0x209d('0x31')](_0x19c3fc,function(_0x115b8d){return _0x115b8d+_0x209d('0x32');})})[_0x209d('0x22')](function(){return _0x21899a[_0x209d('0x15')](0xc8)[_0x209d('0x16')]({'output':_0x209d('0x33')+module[_0x209d('0xf')][_0x209d('0x4')]+_0x209d('0x34')+_[_0x209d('0x35')](_0x19c3fc),'migrations':_[_0x209d('0x28')](_0x19c3fc)});})[_0x209d('0x25')](function(_0x56d736){if(_0x56d736 instanceof db[_0x209d('0x2c')]['UniqueConstraintError']){return _0x21899a[_0x209d('0x15')](0xc8)[_0x209d('0x16')]({'output':_0x209d('0x36')});}else{return _0x21899a['status'](0x1f4)['json'](_0x56d736);}});}else{return _0x21899a[_0x209d('0x15')](0xc8)[_0x209d('0x16')]({'output':_0x209d('0x36')});}};
\ No newline at end of file
+var _0x3cae=['sequelize','Migration','getQueryInterface','constructor','Migration\x20tried\x20to\x20use\x20old\x20style\x20\x22done\x22\x20callback.\x20Please\x20upgrade\x20to\x20\x22umzug\x22\x20and\x20return\x20a\x20promise\x20instead.','join','server','map','Database\x20migrated\x20successfully\x20from\x20version\x20','\x20to\x20','last','catch','UniqueConstraintError','Database\x20already\x20up-to-date','umzug','path','lodash','pkginfo','version','compare-versions','child_process','../../mysqldb','../../config/environment','../../config/logger','simple-git','root','index','exports','query','latest','tags','json','fetch','origin','master','error','status','git\x20fetch\x20origin\x20master','reset','--hard','FETCH_HEAD','info','git\x20reset\x20--hard','pull','restart','then','pm2\x20restart\x20motion\x20%s','migrations','length','replace','.js','push','sort'];(function(_0x139936,_0x474067){var _0x314c51=function(_0x480510){while(--_0x480510){_0x139936['push'](_0x139936['shift']());}};_0x314c51(++_0x474067);}(_0x3cae,0x117));var _0xe3ca=function(_0x5c4f6b,_0x2cdfce){_0x5c4f6b=_0x5c4f6b-0x0;var _0x104c4e=_0x3cae[_0x5c4f6b];return _0x104c4e;};'use strict';var Umzug=require(_0xe3ca('0x0'));var path=require(_0xe3ca('0x1'));var fs=require('fs');var _=require(_0xe3ca('0x2'));var pkginfo=require(_0xe3ca('0x3'))(module,_0xe3ca('0x4'));var compareVersions=require(_0xe3ca('0x5'));var exec=require(_0xe3ca('0x6'))['exec'];var db=require(_0xe3ca('0x7'))['db'];var config=require(_0xe3ca('0x8'));var pm2=require('../../config/pm2');var logger=require(_0xe3ca('0x9'))('update');var git=require(_0xe3ca('0xa'))(config[_0xe3ca('0xb')]);exports[_0xe3ca('0xc')]=function(_0x578178,_0x2c4863){var _0x100c20={'current':module[_0xe3ca('0xd')][_0xe3ca('0x4')],'phonebar':0x2};if(_0x578178[_0xe3ca('0xe')]&&_0x578178[_0xe3ca('0xe')][_0xe3ca('0xf')]){return git['fetch']()[_0xe3ca('0x10')](function(_0x59394d,_0x1d47e2){_0x100c20[_0xe3ca('0xf')]=(_0x59394d?module[_0xe3ca('0xd')][_0xe3ca('0x4')]:_0x1d47e2[_0xe3ca('0xf')])||'2.0.0';return _0x2c4863['status'](0xc8)[_0xe3ca('0x11')](_0x100c20);});}else{return _0x2c4863['status'](0xc8)[_0xe3ca('0x11')](_0x100c20);}};exports[_0xe3ca('0x12')]=function(_0x4857f0,_0x3d62e2){return git[_0xe3ca('0x12')]([_0xe3ca('0x13'),_0xe3ca('0x14')],function(_0x9ef773){if(_0x9ef773){logger[_0xe3ca('0x15')](_0x9ef773);return _0x3d62e2[_0xe3ca('0x16')](0x1f4)[_0xe3ca('0x11')](_0x9ef773);}logger['info']('git\x20fetch');return _0x3d62e2[_0xe3ca('0x16')](0xc8)[_0xe3ca('0x11')]({'output':_0xe3ca('0x17')});});};exports[_0xe3ca('0x18')]=function(_0x1dd153,_0x2d73d9){return git['reset']([_0xe3ca('0x19'),_0xe3ca('0x1a')],function(_0x180699){if(_0x180699){logger['error'](_0x180699);return _0x2d73d9['status'](0x1f4)['json'](_0x180699);}logger[_0xe3ca('0x1b')]('git\x20reset\x20--hard\x20FETCH_HEAD');return _0x2d73d9['status'](0xc8)[_0xe3ca('0x11')]({'output':_0xe3ca('0x1c')});});};exports[_0xe3ca('0x1d')]=function(_0x149291,_0x2e26aa){exec('npm\x20install\x20--production',function(_0x3b1a75,_0x3ab26e,_0x5bc481){logger[_0xe3ca('0x1b')](_0x3ab26e);logger[_0xe3ca('0x1b')](_0x5bc481);if(_0x3b1a75){logger[_0xe3ca('0x15')](_0x3b1a75);return _0x2e26aa[_0xe3ca('0x16')](0x1f4)[_0xe3ca('0x11')](_0x3b1a75);}return _0x2e26aa[_0xe3ca('0x16')](0xc8)[_0xe3ca('0x11')]({'output':_0x3ab26e});});};exports[_0xe3ca('0x1e')]=function(_0x477ec7,_0x2fafd9){return pm2[_0xe3ca('0x1e')]('motion2')[_0xe3ca('0x1f')](function(_0x5740af){logger[_0xe3ca('0x1b')](_0xe3ca('0x20'),_0x5740af);return _0x2fafd9[_0xe3ca('0x16')](0xc8)[_0xe3ca('0x11')]({'output':'Your\x20system\x20has\x20been\x20restart\x20successfully'});})['catch'](function(_0x2e1636){logger[_0xe3ca('0x15')](_0x2e1636);return _0x2fafd9[_0xe3ca('0x16')](0x1f4)['json'](_0x2e1636);});};exports[_0xe3ca('0x21')]=function(_0x39dd6e,_0x1d28a2){var _0x17d3c7=fs['readdirSync'](path['join'](config[_0xe3ca('0xb')],'server',_0xe3ca('0x21')));var _0x5cf384=[];for(var _0x5576b4=0x0;_0x5576b4<_0x17d3c7[_0xe3ca('0x22')];_0x5576b4++){var _0x1517ac=_0x17d3c7[_0x5576b4][_0xe3ca('0x23')](_0xe3ca('0x24'),'');if(compareVersions(module[_0xe3ca('0xd')]['version'],_0x1517ac)===-0x1){_0x5cf384[_0xe3ca('0x25')](_0x1517ac);}}if(_0x5cf384['length']){var _0x5b2e69=_0x5cf384[_0xe3ca('0x26')](compareVersions);var _0x1acc28=new Umzug({'storage':_0xe3ca('0x27'),'storageOptions':{'model':db[_0xe3ca('0x28')],'modelName':_0xe3ca('0x28'),'columnName':_0xe3ca('0x4')},'migrations':{'params':[db[_0xe3ca('0x27')][_0xe3ca('0x29')](),db[_0xe3ca('0x27')][_0xe3ca('0x2a')],function(){throw new Error(_0xe3ca('0x2b'));}],'path':path[_0xe3ca('0x2c')](config['root'],_0xe3ca('0x2d'),_0xe3ca('0x21')),'pattern':/\.js$/}});_0x1acc28['up']({'migrations':_[_0xe3ca('0x2e')](_0x5b2e69,function(_0xf3a1d2){return _0xf3a1d2+_0xe3ca('0x24');})})[_0xe3ca('0x1f')](function(){return _0x1d28a2['status'](0xc8)[_0xe3ca('0x11')]({'output':_0xe3ca('0x2f')+module[_0xe3ca('0xd')][_0xe3ca('0x4')]+_0xe3ca('0x30')+_[_0xe3ca('0x31')](_0x5b2e69),'migrations':_[_0xe3ca('0x2c')](_0x5b2e69)});})[_0xe3ca('0x32')](function(_0x12714c){if(_0x12714c instanceof db['sequelize'][_0xe3ca('0x33')]){return _0x1d28a2[_0xe3ca('0x16')](0xc8)['json']({'output':_0xe3ca('0x34')});}else{return _0x1d28a2[_0xe3ca('0x16')](0x1f4)[_0xe3ca('0x11')](_0x12714c);}});}else{return _0x1d28a2['status'](0xc8)[_0xe3ca('0x11')]({'output':_0xe3ca('0x34')});}};
\ No newline at end of file
diff --git a/server/api/voiceAgentReport/index.js b/server/api/voiceAgentReport/index.js
index 4856850..7e55253 100644
--- a/server/api/voiceAgentReport/index.js
+++ b/server/api/voiceAgentReport/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xd551=['isAuthenticated','describe','/:id','show','post','create','put','update','destroy','exports','multer','util','connect-timeout','express','../../components/auth/service','../../config/environment','./voiceAgentReport.controller','get','index','/describe'];(function(_0x1d5bbe,_0x2026b0){var _0x25cae1=function(_0xa9a2c4){while(--_0xa9a2c4){_0x1d5bbe['push'](_0x1d5bbe['shift']());}};_0x25cae1(++_0x2026b0);}(_0xd551,0x122));var _0x1d55=function(_0x48808f,_0x204731){_0x48808f=_0x48808f-0x0;var _0x148654=_0xd551[_0x48808f];return _0x148654;};'use strict';var multer=require(_0x1d55('0x0'));var util=require(_0x1d55('0x1'));var path=require('path');var timeout=require(_0x1d55('0x2'));var express=require(_0x1d55('0x3'));var router=express['Router']();var auth=require(_0x1d55('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x1d55('0x5'));var controller=require(_0x1d55('0x6'));router[_0x1d55('0x7')]('/',auth['isAuthenticated'](),controller[_0x1d55('0x8')]);router[_0x1d55('0x7')](_0x1d55('0x9'),auth[_0x1d55('0xa')](),controller[_0x1d55('0xb')]);router[_0x1d55('0x7')](_0x1d55('0xc'),auth[_0x1d55('0xa')](),controller[_0x1d55('0xd')]);router[_0x1d55('0xe')]('/',auth[_0x1d55('0xa')](),controller[_0x1d55('0xf')]);router[_0x1d55('0x10')]('/:id',auth[_0x1d55('0xa')](),controller[_0x1d55('0x11')]);router['delete'](_0x1d55('0xc'),auth[_0x1d55('0xa')](),controller[_0x1d55('0x12')]);module[_0x1d55('0x13')]=router;
\ No newline at end of file
+var _0x6f58=['multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceAgentReport.controller','get','isAuthenticated','index','/describe','describe','show','post','create','put','delete','/:id','destroy','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6f58,0x160));var _0x86f5=function(_0x5e8840,_0x2fb916){_0x5e8840=_0x5e8840-0x0;var _0xdc6344=_0x6f58[_0x5e8840];return _0xdc6344;};'use strict';var multer=require(_0x86f5('0x0'));var util=require(_0x86f5('0x1'));var path=require(_0x86f5('0x2'));var timeout=require(_0x86f5('0x3'));var express=require(_0x86f5('0x4'));var router=express['Router']();var auth=require(_0x86f5('0x5'));var interaction=require(_0x86f5('0x6'));var config=require(_0x86f5('0x7'));var controller=require(_0x86f5('0x8'));router[_0x86f5('0x9')]('/',auth[_0x86f5('0xa')](),controller[_0x86f5('0xb')]);router[_0x86f5('0x9')](_0x86f5('0xc'),auth[_0x86f5('0xa')](),controller[_0x86f5('0xd')]);router['get']('/:id',auth[_0x86f5('0xa')](),controller[_0x86f5('0xe')]);router[_0x86f5('0xf')]('/',auth[_0x86f5('0xa')](),controller[_0x86f5('0x10')]);router[_0x86f5('0x11')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0x86f5('0x12')](_0x86f5('0x13'),auth[_0x86f5('0xa')](),controller[_0x86f5('0x14')]);module[_0x86f5('0x15')]=router;
\ No newline at end of file
diff --git a/server/api/voiceAgentReport/voiceAgentReport.attributes.js b/server/api/voiceAgentReport/voiceAgentReport.attributes.js
index bab2e0b..d321b3a 100644
--- a/server/api/voiceAgentReport/voiceAgentReport.attributes.js
+++ b/server/api/voiceAgentReport/voiceAgentReport.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xc4aa=['STRING','DATE','INTEGER','BOOLEAN','FORWARD,\x20BLIND,\x20ATTENDED','sequelize','exports'];(function(_0x1be871,_0x19b9e9){var _0x440d08=function(_0x20f88b){while(--_0x20f88b){_0x1be871['push'](_0x1be871['shift']());}};_0x440d08(++_0x19b9e9);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x255d5b,_0x4f6f35){_0x255d5b=_0x255d5b-0x0;var _0x3e141a=_0xc4aa[_0x255d5b];return _0x3e141a;};'use strict';var Sequelize=require(_0xac4a('0x0'));module[_0xac4a('0x1')]={'type':{'type':Sequelize[_0xac4a('0x2')]},'uniqueid':{'type':Sequelize[_0xac4a('0x2')]},'calleridnum':{'type':Sequelize[_0xac4a('0x2')]},'calleridname':{'type':Sequelize[_0xac4a('0x2')]},'queue':{'type':Sequelize['STRING']},'interface':{'type':Sequelize['STRING']},'membername':{'type':Sequelize['STRING']},'agentcalledAt':{'type':Sequelize[_0xac4a('0x3')]},'agentconnectAt':{'type':Sequelize[_0xac4a('0x3')]},'agentcompleteAt':{'type':Sequelize[_0xac4a('0x3')]},'agentringnoanswerAt':{'type':Sequelize[_0xac4a('0x3')]},'agentdumpAt':{'type':Sequelize[_0xac4a('0x3')]},'holdtime':{'type':Sequelize[_0xac4a('0x4')]},'agentcomplete':{'type':Sequelize[_0xac4a('0x5')],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize[_0xac4a('0x5')],'defaultValue':![]},'agentdump':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'talktime':{'type':Sequelize['INTEGER']},'agentacw':{'type':Sequelize[_0xac4a('0x5')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0xac4a('0x4')]},'reason':{'type':Sequelize[_0xac4a('0x2')]},'lastevent':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0xac4a('0x2')]},'channelstate':{'type':Sequelize[_0xac4a('0x4')]},'channelstatedesc':{'type':Sequelize[_0xac4a('0x2')]},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize[_0xac4a('0x2')]},'language':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0xac4a('0x2')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize[_0xac4a('0x2')]},'priority':{'type':Sequelize[_0xac4a('0x2')]},'destchannel':{'type':Sequelize[_0xac4a('0x2')]},'destchannelstate':{'type':Sequelize['INTEGER']},'destchannelstatedesc':{'type':Sequelize[_0xac4a('0x2')]},'destcalleridnum':{'type':Sequelize[_0xac4a('0x2')]},'destcalleridname':{'type':Sequelize[_0xac4a('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0xac4a('0x2')]},'destconnectedlinename':{'type':Sequelize[_0xac4a('0x2')]},'destlanguage':{'type':Sequelize[_0xac4a('0x2')]},'destaccountcode':{'type':Sequelize[_0xac4a('0x2')]},'destcontext':{'type':Sequelize[_0xac4a('0x2')]},'destexten':{'type':Sequelize[_0xac4a('0x2')]},'destpriority':{'type':Sequelize[_0xac4a('0x2')]},'destuniqueid':{'type':Sequelize[_0xac4a('0x2')]},'answeredelsewheredestinationuniqueid':{'type':Sequelize[_0xac4a('0x2')]},'answeredelsewheremembername':{'type':Sequelize['STRING']},'transfer':{'type':Sequelize[_0xac4a('0x5')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0xac4a('0x2')],'comment':_0xac4a('0x6')},'transferexten':{'type':Sequelize[_0xac4a('0x2')]},'transferuniqueid':{'type':Sequelize[_0xac4a('0x2')]},'agententerreason':{'type':Sequelize[_0xac4a('0x4')],'defaultValue':0x0}};
\ No newline at end of file
+var _0x814b=['STRING','DATE','INTEGER','BOOLEAN','FORWARD,\x20BLIND,\x20ATTENDED','sequelize','exports'];(function(_0x5a6fd4,_0x38de2d){var _0x25e584=function(_0xb1c72a){while(--_0xb1c72a){_0x5a6fd4['push'](_0x5a6fd4['shift']());}};_0x25e584(++_0x38de2d);}(_0x814b,0x1a2));var _0xb814=function(_0x154192,_0x2d360f){_0x154192=_0x154192-0x0;var _0x3c2792=_0x814b[_0x154192];return _0x3c2792;};'use strict';var Sequelize=require(_0xb814('0x0'));module[_0xb814('0x1')]={'type':{'type':Sequelize[_0xb814('0x2')]},'uniqueid':{'type':Sequelize[_0xb814('0x2')]},'calleridnum':{'type':Sequelize[_0xb814('0x2')]},'calleridname':{'type':Sequelize[_0xb814('0x2')]},'queue':{'type':Sequelize['STRING']},'interface':{'type':Sequelize[_0xb814('0x2')]},'membername':{'type':Sequelize[_0xb814('0x2')]},'agentcalledAt':{'type':Sequelize[_0xb814('0x3')]},'agentconnectAt':{'type':Sequelize[_0xb814('0x3')]},'agentcompleteAt':{'type':Sequelize[_0xb814('0x3')]},'agentringnoanswerAt':{'type':Sequelize[_0xb814('0x3')]},'agentdumpAt':{'type':Sequelize['DATE']},'holdtime':{'type':Sequelize[_0xb814('0x4')]},'agentcomplete':{'type':Sequelize[_0xb814('0x5')],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentdump':{'type':Sequelize[_0xb814('0x5')],'defaultValue':![]},'talktime':{'type':Sequelize[_0xb814('0x4')]},'agentacw':{'type':Sequelize[_0xb814('0x5')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0xb814('0x4')]},'reason':{'type':Sequelize[_0xb814('0x2')]},'lastevent':{'type':Sequelize[_0xb814('0x2')]},'channel':{'type':Sequelize[_0xb814('0x2')]},'channelstate':{'type':Sequelize[_0xb814('0x4')]},'channelstatedesc':{'type':Sequelize[_0xb814('0x2')]},'connectedlinenum':{'type':Sequelize[_0xb814('0x2')]},'connectedlinename':{'type':Sequelize[_0xb814('0x2')]},'language':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0xb814('0x2')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize[_0xb814('0x2')]},'priority':{'type':Sequelize[_0xb814('0x2')]},'destchannel':{'type':Sequelize[_0xb814('0x2')]},'destchannelstate':{'type':Sequelize[_0xb814('0x4')]},'destchannelstatedesc':{'type':Sequelize[_0xb814('0x2')]},'destcalleridnum':{'type':Sequelize[_0xb814('0x2')]},'destcalleridname':{'type':Sequelize[_0xb814('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0xb814('0x2')]},'destconnectedlinename':{'type':Sequelize[_0xb814('0x2')]},'destlanguage':{'type':Sequelize[_0xb814('0x2')]},'destaccountcode':{'type':Sequelize[_0xb814('0x2')]},'destcontext':{'type':Sequelize[_0xb814('0x2')]},'destexten':{'type':Sequelize[_0xb814('0x2')]},'destpriority':{'type':Sequelize[_0xb814('0x2')]},'destuniqueid':{'type':Sequelize[_0xb814('0x2')]},'answeredelsewheredestinationuniqueid':{'type':Sequelize[_0xb814('0x2')]},'answeredelsewheremembername':{'type':Sequelize[_0xb814('0x2')]},'transfer':{'type':Sequelize[_0xb814('0x5')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0xb814('0x2')],'comment':_0xb814('0x6')},'transferexten':{'type':Sequelize[_0xb814('0x2')]},'transferuniqueid':{'type':Sequelize['STRING']},'agententerreason':{'type':Sequelize[_0xb814('0x4')],'defaultValue':0x0}};
\ No newline at end of file
diff --git a/server/api/voiceAgentReport/voiceAgentReport.controller.js b/server/api/voiceAgentReport/voiceAgentReport.controller.js
index 82fa7af..dd144f1 100644
--- a/server/api/voiceAgentReport/voiceAgentReport.controller.js
+++ b/server/api/voiceAgentReport/voiceAgentReport.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9994=['moment','bluebird','mustache','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','count','offset','limit','set','Content-Range','apply','save','update','then','destroy','error','stack','name','send','map','VoiceAgentReport','rawAttributes','key','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','where','pick','filter','merge','type','options','includeAll','include','rows','catch','show','params','keys','body','find','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise'];(function(_0x3e6729,_0x16d4af){var _0x535bcd=function(_0x5e6c5f){while(--_0x5e6c5f){_0x3e6729['push'](_0x3e6729['shift']());}};_0x535bcd(++_0x16d4af);}(_0x9994,0x11a));var _0x4999=function(_0x51b1a5,_0x285a4f){_0x51b1a5=_0x51b1a5-0x0;var _0x15c738=_0x9994[_0x51b1a5];return _0x15c738;};'use strict';var pdf=require(_0x4999('0x0'));var emlformat=require(_0x4999('0x1'));var rimraf=require(_0x4999('0x2'));var zipdir=require(_0x4999('0x3'));var jsonpatch=require(_0x4999('0x4'));var rp=require(_0x4999('0x5'));var moment=require(_0x4999('0x6'));var BPromise=require(_0x4999('0x7'));var Mustache=require(_0x4999('0x8'));var util=require('util');var path=require('path');var sox=require(_0x4999('0x9'));var csv=require(_0x4999('0xa'));var ejs=require(_0x4999('0xb'));var fs=require('fs');var _=require(_0x4999('0xc'));var squel=require('squel');var crypto=require(_0x4999('0xd'));var jsforce=require(_0x4999('0xe'));var deskjs=require(_0x4999('0xf'));var toCsv=require(_0x4999('0xa'));var querystring=require(_0x4999('0x10'));var Papa=require(_0x4999('0x11'));var Redis=require(_0x4999('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x4999('0x13'));var as=require(_0x4999('0x14'));var hardwareService=require(_0x4999('0x15'));var logger=require('../../config/logger')(_0x4999('0x16'));var utils=require(_0x4999('0x17'));var config=require(_0x4999('0x18'));var db=require(_0x4999('0x19'))['db'];function respondWithStatusCode(_0x46152c,_0x4f8767){_0x4f8767=_0x4f8767||0xcc;return function(_0x9dd751){if(_0x9dd751){return _0x46152c[_0x4999('0x1a')](_0x4f8767);}return _0x46152c['status'](_0x4f8767)[_0x4999('0x1b')]();};}function respondWithResult(_0x4ab8b7,_0x173e07){_0x173e07=_0x173e07||0xc8;return function(_0x58bbc1){if(_0x58bbc1){return _0x4ab8b7[_0x4999('0x1c')](_0x173e07)[_0x4999('0x1d')](_0x58bbc1);}};}function respondWithFilteredResult(_0x31c105,_0x39822e){return function(_0x3117a3){if(_0x3117a3){var _0x3b6975=_0x3117a3[_0x4999('0x1e')],_0x550b54=_0x39822e[_0x4999('0x1f')],_0x4acb4c=_0x39822e[_0x4999('0x1f')]+_0x39822e[_0x4999('0x20')],_0x42c7b9;if(_0x4acb4c>=_0x3b6975){_0x4acb4c=_0x3b6975;_0x42c7b9=0xc8;}else{_0x42c7b9=0xce;}_0x31c105['status'](_0x42c7b9);return _0x31c105[_0x4999('0x21')](_0x4999('0x22'),_0x550b54+'-'+_0x4acb4c+'/'+_0x3b6975)['json'](_0x3117a3);}return null;};}function patchUpdates(_0x2f1e20){return function(_0x3cd70d){try{jsonpatch[_0x4999('0x23')](_0x3cd70d,_0x2f1e20,!![]);}catch(_0x25e921){return BPromise['reject'](_0x25e921);}return _0x3cd70d[_0x4999('0x24')]();};}function saveUpdates(_0x1f0ea6,_0x2f9b98){return function(_0x291619){if(_0x291619){return _0x291619[_0x4999('0x25')](_0x1f0ea6)[_0x4999('0x26')](function(_0x181de5){return _0x181de5;});}return null;};}function removeEntity(_0x296702,_0x35a5a7){return function(_0x3ee725){if(_0x3ee725){return _0x3ee725[_0x4999('0x27')]()[_0x4999('0x26')](function(){_0x296702[_0x4999('0x1c')](0xcc)[_0x4999('0x1b')]();});}};}function handleEntityNotFound(_0x2482ff,_0x986061){return function(_0x46f01e){if(!_0x46f01e){_0x2482ff[_0x4999('0x1a')](0x194);}return _0x46f01e;};}function handleError(_0x2515cc,_0x4e0748){_0x4e0748=_0x4e0748||0x1f4;return function(_0x42a242){logger[_0x4999('0x28')](_0x42a242[_0x4999('0x29')]);if(_0x42a242[_0x4999('0x2a')]){delete _0x42a242['name'];}_0x2515cc[_0x4999('0x1c')](_0x4e0748)[_0x4999('0x2b')](_0x42a242);};}exports['index']=function(_0x15c105,_0x503e24){var _0x22c703={},_0x4d1fc1={},_0x54887d={'count':0x0,'rows':[]};var _0x36d4ee=_[_0x4999('0x2c')](db[_0x4999('0x2d')][_0x4999('0x2e')],function(_0x8f221b){return{'name':_0x8f221b['fieldName'],'type':_0x8f221b['type'][_0x4999('0x2f')]};});_0x4d1fc1[_0x4999('0x30')]=_[_0x4999('0x2c')](_0x36d4ee,_0x4999('0x2a'));_0x4d1fc1[_0x4999('0x31')]=_['keys'](_0x15c105[_0x4999('0x31')]);_0x4d1fc1['filters']=_[_0x4999('0x32')](_0x4d1fc1[_0x4999('0x30')],_0x4d1fc1['query']);_0x22c703[_0x4999('0x33')]=_[_0x4999('0x32')](_0x4d1fc1[_0x4999('0x30')],qs[_0x4999('0x34')](_0x15c105[_0x4999('0x31')][_0x4999('0x34')]));_0x22c703['attributes']=_0x22c703[_0x4999('0x33')][_0x4999('0x35')]?_0x22c703[_0x4999('0x33')]:_0x4d1fc1['model'];if(!_0x15c105[_0x4999('0x31')][_0x4999('0x36')](_0x4999('0x37'))){_0x22c703[_0x4999('0x20')]=qs[_0x4999('0x20')](_0x15c105[_0x4999('0x31')]['limit']);_0x22c703[_0x4999('0x1f')]=qs[_0x4999('0x1f')](_0x15c105[_0x4999('0x31')][_0x4999('0x1f')]);}_0x22c703['order']=qs['sort'](_0x15c105[_0x4999('0x31')]['sort']);_0x22c703[_0x4999('0x38')]=qs['filters'](_[_0x4999('0x39')](_0x15c105[_0x4999('0x31')],_0x4d1fc1['filters']),_0x36d4ee);if(_0x15c105[_0x4999('0x31')][_0x4999('0x3a')]){_0x22c703[_0x4999('0x38')]=_[_0x4999('0x3b')](_0x22c703['where'],{'$or':_[_0x4999('0x2c')](_0x36d4ee,function(_0x410406){if(_0x410406[_0x4999('0x3c')]!=='VIRTUAL'){var _0x16082a={};_0x16082a[_0x410406[_0x4999('0x2a')]]={'$like':'%'+_0x15c105['query'][_0x4999('0x3a')]+'%'};return _0x16082a;}})});}_0x22c703=_[_0x4999('0x3b')]({},_0x22c703,_0x15c105[_0x4999('0x3d')]);var _0x5df89c={'where':_0x22c703['where']};return db[_0x4999('0x2d')][_0x4999('0x1e')](_0x5df89c)[_0x4999('0x26')](function(_0xf65eda){_0x54887d['count']=_0xf65eda;if(_0x15c105[_0x4999('0x31')][_0x4999('0x3e')]){_0x22c703[_0x4999('0x3f')]=[{'all':!![]}];}return db[_0x4999('0x2d')]['findAll'](_0x22c703);})[_0x4999('0x26')](function(_0x1f75e0){_0x54887d[_0x4999('0x40')]=_0x1f75e0;return _0x54887d;})[_0x4999('0x26')](respondWithFilteredResult(_0x503e24,_0x22c703))[_0x4999('0x41')](handleError(_0x503e24,null));};exports[_0x4999('0x42')]=function(_0x210d43,_0x160508){var _0x57746b={'raw':![],'where':{'id':_0x210d43[_0x4999('0x43')]['id']}},_0x33d54e={};_0x33d54e[_0x4999('0x30')]=_[_0x4999('0x44')](db[_0x4999('0x2d')]['rawAttributes']);_0x33d54e[_0x4999('0x31')]=_[_0x4999('0x44')](_0x210d43['query']);_0x33d54e['filters']=_[_0x4999('0x32')](_0x33d54e[_0x4999('0x30')],_0x33d54e['query']);_0x57746b[_0x4999('0x33')]=_[_0x4999('0x32')](_0x33d54e['model'],qs[_0x4999('0x34')](_0x210d43[_0x4999('0x31')][_0x4999('0x34')]));_0x57746b[_0x4999('0x33')]=_0x57746b[_0x4999('0x33')][_0x4999('0x35')]?_0x57746b[_0x4999('0x33')]:_0x33d54e[_0x4999('0x30')];if(_0x210d43[_0x4999('0x31')][_0x4999('0x3e')]){_0x57746b[_0x4999('0x3f')]=[{'all':!![]}];}_0x57746b=_[_0x4999('0x3b')]({},_0x57746b,_0x210d43[_0x4999('0x3d')]);return db[_0x4999('0x2d')]['find'](_0x57746b)[_0x4999('0x26')](handleEntityNotFound(_0x160508,null))[_0x4999('0x26')](respondWithResult(_0x160508,null))['catch'](handleError(_0x160508,null));};exports['create']=function(_0x431f55,_0x5e1799){return db['VoiceAgentReport']['create'](_0x431f55[_0x4999('0x45')],{})['then'](respondWithResult(_0x5e1799,0xc9))[_0x4999('0x41')](handleError(_0x5e1799,null));};exports[_0x4999('0x25')]=function(_0x54cd63,_0x1de930){if(_0x54cd63['body']['id']){delete _0x54cd63[_0x4999('0x45')]['id'];}return db[_0x4999('0x2d')][_0x4999('0x46')]({'where':{'id':_0x54cd63[_0x4999('0x43')]['id']}})[_0x4999('0x26')](handleEntityNotFound(_0x1de930,null))[_0x4999('0x26')](saveUpdates(_0x54cd63['body'],null))['then'](respondWithResult(_0x1de930,null))['catch'](handleError(_0x1de930,null));};exports[_0x4999('0x27')]=function(_0x595ed4,_0x4605bf){return db[_0x4999('0x2d')][_0x4999('0x46')]({'where':{'id':_0x595ed4[_0x4999('0x43')]['id']}})[_0x4999('0x26')](handleEntityNotFound(_0x4605bf,null))[_0x4999('0x26')](removeEntity(_0x4605bf,null))[_0x4999('0x41')](handleError(_0x4605bf,null));};exports[_0x4999('0x47')]=function(_0x244811,_0x4e6cab){return db[_0x4999('0x2d')]['describe']()[_0x4999('0x26')](respondWithResult(_0x4e6cab,null))[_0x4999('0x41')](handleError(_0x4e6cab,null));};
\ No newline at end of file
+var _0x5df8=['limit','set','reject','save','update','then','destroy','sendStatus','error','stack','name','send','index','VoiceAgentReport','fieldName','model','map','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','type','merge','includeAll','include','findAll','catch','show','params','keys','options','find','create','body','describe','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','status','end','count','offset'];(function(_0x407e38,_0x30e1cb){var _0x996a91=function(_0x58a6cc){while(--_0x58a6cc){_0x407e38['push'](_0x407e38['shift']());}};_0x996a91(++_0x30e1cb);}(_0x5df8,0xbc));var _0x85df=function(_0x3bd2d9,_0x493140){_0x3bd2d9=_0x3bd2d9-0x0;var _0x15f37b=_0x5df8[_0x3bd2d9];return _0x15f37b;};'use strict';var pdf=require(_0x85df('0x0'));var emlformat=require(_0x85df('0x1'));var rimraf=require(_0x85df('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x85df('0x3'));var rp=require(_0x85df('0x4'));var moment=require(_0x85df('0x5'));var BPromise=require(_0x85df('0x6'));var Mustache=require(_0x85df('0x7'));var util=require(_0x85df('0x8'));var path=require(_0x85df('0x9'));var sox=require(_0x85df('0xa'));var csv=require(_0x85df('0xb'));var ejs=require(_0x85df('0xc'));var fs=require('fs');var _=require(_0x85df('0xd'));var squel=require(_0x85df('0xe'));var crypto=require(_0x85df('0xf'));var jsforce=require(_0x85df('0x10'));var deskjs=require(_0x85df('0x11'));var toCsv=require(_0x85df('0xb'));var querystring=require('querystring');var Papa=require(_0x85df('0x12'));var Redis=require(_0x85df('0x13'));var authService=require(_0x85df('0x14'));var qs=require(_0x85df('0x15'));var as=require(_0x85df('0x16'));var hardwareService=require(_0x85df('0x17'));var logger=require(_0x85df('0x18'))(_0x85df('0x19'));var utils=require('../../config/utils');var config=require(_0x85df('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x50bde1,_0x1f79fb){_0x1f79fb=_0x1f79fb||0xcc;return function(_0x1e1b6a){if(_0x1e1b6a){return _0x50bde1['sendStatus'](_0x1f79fb);}return _0x50bde1[_0x85df('0x1b')](_0x1f79fb)[_0x85df('0x1c')]();};}function respondWithResult(_0x7bb112,_0xcb4b2f){_0xcb4b2f=_0xcb4b2f||0xc8;return function(_0x403f20){if(_0x403f20){return _0x7bb112[_0x85df('0x1b')](_0xcb4b2f)['json'](_0x403f20);}};}function respondWithFilteredResult(_0x2fc3eb,_0x220911){return function(_0x3c48dc){if(_0x3c48dc){var _0x22b839=_0x3c48dc[_0x85df('0x1d')],_0x48a026=_0x220911[_0x85df('0x1e')],_0x3274ff=_0x220911[_0x85df('0x1e')]+_0x220911[_0x85df('0x1f')],_0x10423f;if(_0x3274ff>=_0x22b839){_0x3274ff=_0x22b839;_0x10423f=0xc8;}else{_0x10423f=0xce;}_0x2fc3eb[_0x85df('0x1b')](_0x10423f);return _0x2fc3eb[_0x85df('0x20')]('Content-Range',_0x48a026+'-'+_0x3274ff+'/'+_0x22b839)['json'](_0x3c48dc);}return null;};}function patchUpdates(_0x21b037){return function(_0x2f7172){try{jsonpatch['apply'](_0x2f7172,_0x21b037,!![]);}catch(_0x31b597){return BPromise[_0x85df('0x21')](_0x31b597);}return _0x2f7172[_0x85df('0x22')]();};}function saveUpdates(_0x54e25c,_0x16461e){return function(_0x24970d){if(_0x24970d){return _0x24970d[_0x85df('0x23')](_0x54e25c)[_0x85df('0x24')](function(_0x3be303){return _0x3be303;});}return null;};}function removeEntity(_0x28a490,_0xdb9886){return function(_0x4d110b){if(_0x4d110b){return _0x4d110b[_0x85df('0x25')]()['then'](function(){_0x28a490[_0x85df('0x1b')](0xcc)[_0x85df('0x1c')]();});}};}function handleEntityNotFound(_0x510f22,_0x3ec76a){return function(_0x2c5d70){if(!_0x2c5d70){_0x510f22[_0x85df('0x26')](0x194);}return _0x2c5d70;};}function handleError(_0x49abdb,_0x584d4c){_0x584d4c=_0x584d4c||0x1f4;return function(_0x2d10f4){logger[_0x85df('0x27')](_0x2d10f4[_0x85df('0x28')]);if(_0x2d10f4['name']){delete _0x2d10f4[_0x85df('0x29')];}_0x49abdb[_0x85df('0x1b')](_0x584d4c)[_0x85df('0x2a')](_0x2d10f4);};}exports[_0x85df('0x2b')]=function(_0x130442,_0x45949e){var _0x4d806f={},_0x44fab4={},_0x1215e9={'count':0x0,'rows':[]};var _0x1316f2=_['map'](db[_0x85df('0x2c')]['rawAttributes'],function(_0x19f687){return{'name':_0x19f687[_0x85df('0x2d')],'type':_0x19f687['type']['key']};});_0x44fab4[_0x85df('0x2e')]=_[_0x85df('0x2f')](_0x1316f2,_0x85df('0x29'));_0x44fab4[_0x85df('0x30')]=_['keys'](_0x130442[_0x85df('0x30')]);_0x44fab4[_0x85df('0x31')]=_[_0x85df('0x32')](_0x44fab4[_0x85df('0x2e')],_0x44fab4[_0x85df('0x30')]);_0x4d806f[_0x85df('0x33')]=_['intersection'](_0x44fab4['model'],qs[_0x85df('0x34')](_0x130442[_0x85df('0x30')][_0x85df('0x34')]));_0x4d806f['attributes']=_0x4d806f[_0x85df('0x33')][_0x85df('0x35')]?_0x4d806f[_0x85df('0x33')]:_0x44fab4[_0x85df('0x2e')];if(!_0x130442[_0x85df('0x30')]['hasOwnProperty'](_0x85df('0x36'))){_0x4d806f[_0x85df('0x1f')]=qs['limit'](_0x130442[_0x85df('0x30')]['limit']);_0x4d806f[_0x85df('0x1e')]=qs[_0x85df('0x1e')](_0x130442[_0x85df('0x30')]['offset']);}_0x4d806f[_0x85df('0x37')]=qs['sort'](_0x130442[_0x85df('0x30')][_0x85df('0x38')]);_0x4d806f[_0x85df('0x39')]=qs['filters'](_[_0x85df('0x3a')](_0x130442[_0x85df('0x30')],_0x44fab4['filters']),_0x1316f2);if(_0x130442['query']['filter']){_0x4d806f[_0x85df('0x39')]=_['merge'](_0x4d806f[_0x85df('0x39')],{'$or':_[_0x85df('0x2f')](_0x1316f2,function(_0x3d090d){if(_0x3d090d[_0x85df('0x3b')]!=='VIRTUAL'){var _0xebcbb9={};_0xebcbb9[_0x3d090d[_0x85df('0x29')]]={'$like':'%'+_0x130442[_0x85df('0x30')]['filter']+'%'};return _0xebcbb9;}})});}_0x4d806f=_[_0x85df('0x3c')]({},_0x4d806f,_0x130442['options']);var _0x3f2ad9={'where':_0x4d806f[_0x85df('0x39')]};return db[_0x85df('0x2c')]['count'](_0x3f2ad9)[_0x85df('0x24')](function(_0x47110e){_0x1215e9[_0x85df('0x1d')]=_0x47110e;if(_0x130442[_0x85df('0x30')][_0x85df('0x3d')]){_0x4d806f[_0x85df('0x3e')]=[{'all':!![]}];}return db[_0x85df('0x2c')][_0x85df('0x3f')](_0x4d806f);})[_0x85df('0x24')](function(_0x3b2c41){_0x1215e9['rows']=_0x3b2c41;return _0x1215e9;})[_0x85df('0x24')](respondWithFilteredResult(_0x45949e,_0x4d806f))[_0x85df('0x40')](handleError(_0x45949e,null));};exports[_0x85df('0x41')]=function(_0x357b68,_0x326eae){var _0x129e3b={'raw':![],'where':{'id':_0x357b68[_0x85df('0x42')]['id']}},_0x523ab6={};_0x523ab6[_0x85df('0x2e')]=_[_0x85df('0x43')](db[_0x85df('0x2c')]['rawAttributes']);_0x523ab6[_0x85df('0x30')]=_[_0x85df('0x43')](_0x357b68[_0x85df('0x30')]);_0x523ab6['filters']=_[_0x85df('0x32')](_0x523ab6[_0x85df('0x2e')],_0x523ab6[_0x85df('0x30')]);_0x129e3b[_0x85df('0x33')]=_[_0x85df('0x32')](_0x523ab6[_0x85df('0x2e')],qs[_0x85df('0x34')](_0x357b68[_0x85df('0x30')]['fields']));_0x129e3b['attributes']=_0x129e3b[_0x85df('0x33')][_0x85df('0x35')]?_0x129e3b[_0x85df('0x33')]:_0x523ab6[_0x85df('0x2e')];if(_0x357b68[_0x85df('0x30')]['includeAll']){_0x129e3b[_0x85df('0x3e')]=[{'all':!![]}];}_0x129e3b=_[_0x85df('0x3c')]({},_0x129e3b,_0x357b68[_0x85df('0x44')]);return db[_0x85df('0x2c')][_0x85df('0x45')](_0x129e3b)[_0x85df('0x24')](handleEntityNotFound(_0x326eae,null))[_0x85df('0x24')](respondWithResult(_0x326eae,null))[_0x85df('0x40')](handleError(_0x326eae,null));};exports[_0x85df('0x46')]=function(_0xe40969,_0xe4a805){return db['VoiceAgentReport'][_0x85df('0x46')](_0xe40969[_0x85df('0x47')],{})[_0x85df('0x24')](respondWithResult(_0xe4a805,0xc9))[_0x85df('0x40')](handleError(_0xe4a805,null));};exports[_0x85df('0x23')]=function(_0x3c1326,_0x13123b){if(_0x3c1326[_0x85df('0x47')]['id']){delete _0x3c1326['body']['id'];}return db[_0x85df('0x2c')][_0x85df('0x45')]({'where':{'id':_0x3c1326[_0x85df('0x42')]['id']}})[_0x85df('0x24')](handleEntityNotFound(_0x13123b,null))[_0x85df('0x24')](saveUpdates(_0x3c1326[_0x85df('0x47')],null))[_0x85df('0x24')](respondWithResult(_0x13123b,null))[_0x85df('0x40')](handleError(_0x13123b,null));};exports['destroy']=function(_0x2026f0,_0x21324b){return db[_0x85df('0x2c')]['find']({'where':{'id':_0x2026f0[_0x85df('0x42')]['id']}})[_0x85df('0x24')](handleEntityNotFound(_0x21324b,null))[_0x85df('0x24')](removeEntity(_0x21324b,null))[_0x85df('0x40')](handleError(_0x21324b,null));};exports['describe']=function(_0xdf263b,_0x148a96){return db['VoiceAgentReport'][_0x85df('0x48')]()[_0x85df('0x24')](respondWithResult(_0x148a96,null))['catch'](handleError(_0x148a96,null));};
\ No newline at end of file
diff --git a/server/api/voiceAgentReport/voiceAgentReport.model.js b/server/api/voiceAgentReport/voiceAgentReport.model.js
index b53752a..f6df98b 100644
--- a/server/api/voiceAgentReport/voiceAgentReport.model.js
+++ b/server/api/voiceAgentReport/voiceAgentReport.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x0713=['../../config/environment','./voiceAgentReport.attributes','exports','define','VoiceAgentReport','report_agent','uniqueid','destuniqueid','../../config/logger','api','moment','bluebird','request-promise','rimraf'];(function(_0x378720,_0xa711f1){var _0x47920a=function(_0xc5056){while(--_0xc5056){_0x378720['push'](_0x378720['shift']());}};_0x47920a(++_0xa711f1);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x3071('0x0'))(_0x3071('0x1'));var moment=require(_0x3071('0x2'));var BPromise=require(_0x3071('0x3'));var rp=require(_0x3071('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));var attributes=require(_0x3071('0x7'));module[_0x3071('0x8')]=function(_0xabd7b6,_0x41cf76){return _0xabd7b6[_0x3071('0x9')](_0x3071('0xa'),attributes,{'tableName':_0x3071('0xb'),'paranoid':![],'indexes':[{'fields':[_0x3071('0xc'),_0x3071('0xd')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x70e0=['rimraf','./voiceAgentReport.attributes','report_agent','uniqueid','destuniqueid','lodash','util','../../config/logger','bluebird','request-promise','path'];(function(_0x4ac46a,_0x14750c){var _0x580697=function(_0x1800c9){while(--_0x1800c9){_0x4ac46a['push'](_0x4ac46a['shift']());}};_0x580697(++_0x14750c);}(_0x70e0,0x17b));var _0x070e=function(_0x8806d2,_0x5756c1){_0x8806d2=_0x8806d2-0x0;var _0x5f0c8e=_0x70e0[_0x8806d2];return _0x5f0c8e;};'use strict';var _=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var logger=require(_0x070e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x070e('0x3'));var rp=require(_0x070e('0x4'));var fs=require('fs');var path=require(_0x070e('0x5'));var rimraf=require(_0x070e('0x6'));var config=require('../../config/environment');var attributes=require(_0x070e('0x7'));module['exports']=function(_0x46fe68,_0x4b041d){return _0x46fe68['define']('VoiceAgentReport',attributes,{'tableName':_0x070e('0x8'),'paranoid':![],'indexes':[{'fields':[_0x070e('0x9'),_0x070e('0xa')]}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/voiceAgentReport/voiceAgentReport.rpc.js b/server/api/voiceAgentReport/voiceAgentReport.rpc.js
index 3e412cc..3d30898 100644
--- a/server/api/voiceAgentReport/voiceAgentReport.rpc.js
+++ b/server/api/voiceAgentReport/voiceAgentReport.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9a60=['attributes','limit','moment','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','VoiceAgentReport,\x20%s,\x20%s','request\x20sent','debug','VoiceAgentReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','VoiceAgentReport','create','body','options','raw','CreateVoiceAgentReport','UpdateVoiceAgentReport','update','where'];(function(_0x34b821,_0x504e55){var _0x5e00a0=function(_0x242892){while(--_0x242892){_0x34b821['push'](_0x34b821['shift']());}};_0x5e00a0(++_0x504e55);}(_0x9a60,0x182));var _0x09a6=function(_0x1dd6d4,_0x18403a){_0x1dd6d4=_0x1dd6d4-0x0;var _0x1dc5ad=_0x9a60[_0x1dd6d4];return _0x1dc5ad;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x09a6('0x0'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x09a6('0x1'))['db'];var utils=require(_0x09a6('0x2'));var logger=require(_0x09a6('0x3'))(_0x09a6('0x4'));var config=require(_0x09a6('0x5'));var jayson=require(_0x09a6('0x6'));var client=jayson[_0x09a6('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x52c9b8,_0x455009,_0x28789d){return new BPromise(function(_0x444f01,_0x592f46){return client[_0x09a6('0x8')](_0x52c9b8,_0x28789d)[_0x09a6('0x9')](function(_0x39a412){logger[_0x09a6('0xa')](_0x09a6('0xb'),_0x455009,_0x09a6('0xc'));logger[_0x09a6('0xd')](_0x09a6('0xe'),_0x455009,_0x09a6('0xc'),JSON[_0x09a6('0xf')](_0x39a412));if(_0x39a412[_0x09a6('0x10')]){if(_0x39a412[_0x09a6('0x10')][_0x09a6('0x11')]===0x1f4){logger['error']('VoiceAgentReport,\x20%s,\x20%s',_0x455009,_0x39a412[_0x09a6('0x10')][_0x09a6('0x12')]);return _0x592f46(_0x39a412[_0x09a6('0x10')][_0x09a6('0x12')]);}logger['error'](_0x09a6('0xb'),_0x455009,_0x39a412[_0x09a6('0x10')][_0x09a6('0x12')]);return _0x444f01(_0x39a412['error']['message']);}else{logger[_0x09a6('0xa')](_0x09a6('0xb'),_0x455009,_0x09a6('0xc'));_0x444f01(_0x39a412[_0x09a6('0x13')][_0x09a6('0x12')]);}})[_0x09a6('0x14')](function(_0x483c53){logger['error']('VoiceAgentReport,\x20%s,\x20%s',_0x455009,_0x483c53);_0x592f46(_0x483c53);});});}exports['CreateVoiceAgentReport']=function(_0xfe9a48){var _0x3bec01=this;return new Promise(function(_0x2c24e3,_0x5d3eae){return db[_0x09a6('0x15')][_0x09a6('0x16')](_0xfe9a48[_0x09a6('0x17')],{'raw':_0xfe9a48[_0x09a6('0x18')]?_0xfe9a48[_0x09a6('0x18')][_0x09a6('0x19')]===undefined?!![]:![]:!![]})[_0x09a6('0x9')](function(_0x191323){logger[_0x09a6('0xa')](_0x09a6('0x1a'),_0xfe9a48);logger[_0x09a6('0xd')](_0x09a6('0x1a'),_0xfe9a48,JSON[_0x09a6('0xf')](_0x191323));_0x2c24e3(_0x191323);})['catch'](function(_0x5ca1ca){logger[_0x09a6('0x10')](_0x09a6('0x1a'),_0x5ca1ca[_0x09a6('0x12')],_0xfe9a48);_0x5d3eae(_0x3bec01[_0x09a6('0x10')](0x1f4,_0x5ca1ca[_0x09a6('0x12')]));});});};exports[_0x09a6('0x1b')]=function(_0x38c4a0){var _0x1da7fe=this;return new Promise(function(_0x35fc4a,_0x24f97e){return db[_0x09a6('0x15')][_0x09a6('0x1c')](_0x38c4a0[_0x09a6('0x17')],{'raw':_0x38c4a0['options']?_0x38c4a0['options'][_0x09a6('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x38c4a0['options']?_0x38c4a0[_0x09a6('0x18')][_0x09a6('0x1d')]||null:null,'attributes':_0x38c4a0['options']?_0x38c4a0[_0x09a6('0x18')][_0x09a6('0x1e')]||null:null,'limit':_0x38c4a0['options']?_0x38c4a0[_0x09a6('0x18')][_0x09a6('0x1f')]||null:null})['then'](function(_0x28b762){logger[_0x09a6('0xa')]('UpdateVoiceAgentReport',_0x38c4a0);logger[_0x09a6('0xd')](_0x09a6('0x1b'),_0x38c4a0,JSON['stringify'](_0x28b762));_0x35fc4a(_0x28b762);})['catch'](function(_0x4e5f22){logger[_0x09a6('0x10')](_0x09a6('0x1b'),_0x4e5f22[_0x09a6('0x12')],_0x38c4a0);_0x24f97e(_0x1da7fe['error'](0x1f4,_0x4e5f22[_0x09a6('0x12')]));});});};
\ No newline at end of file
+var _0x9570=['http','request','info','debug','VoiceAgentReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','VoiceAgentReport,\x20%s,\x20%s','message','catch','CreateVoiceAgentReport','create','body','options','raw','then','UpdateVoiceAgentReport','update','attributes','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client'];(function(_0xdd82b4,_0x5cd8b8){var _0x549bb2=function(_0x426fd9){while(--_0x426fd9){_0xdd82b4['push'](_0xdd82b4['shift']());}};_0x549bb2(++_0x5cd8b8);}(_0x9570,0x1a8));var _0x0957=function(_0x359bbe,_0x5b7fcc){_0x359bbe=_0x359bbe-0x0;var _0x1b3353=_0x9570[_0x359bbe];return _0x1b3353;};'use strict';var _=require(_0x0957('0x0'));var util=require('util');var moment=require(_0x0957('0x1'));var BPromise=require(_0x0957('0x2'));var rs=require(_0x0957('0x3'));var fs=require('fs');var Redis=require(_0x0957('0x4'));var db=require(_0x0957('0x5'))['db'];var utils=require(_0x0957('0x6'));var logger=require(_0x0957('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x0957('0x8'));var client=jayson[_0x0957('0x9')][_0x0957('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x438d32,_0x17d066,_0x23bd9d){return new BPromise(function(_0xf40d6b,_0x219fe3){return client[_0x0957('0xb')](_0x438d32,_0x23bd9d)['then'](function(_0x14ae7b){logger[_0x0957('0xc')]('VoiceAgentReport,\x20%s,\x20%s',_0x17d066,'request\x20sent');logger[_0x0957('0xd')](_0x0957('0xe'),_0x17d066,_0x0957('0xf'),JSON[_0x0957('0x10')](_0x14ae7b));if(_0x14ae7b[_0x0957('0x11')]){if(_0x14ae7b[_0x0957('0x11')][_0x0957('0x12')]===0x1f4){logger[_0x0957('0x11')](_0x0957('0x13'),_0x17d066,_0x14ae7b[_0x0957('0x11')]['message']);return _0x219fe3(_0x14ae7b[_0x0957('0x11')][_0x0957('0x14')]);}logger[_0x0957('0x11')](_0x0957('0x13'),_0x17d066,_0x14ae7b[_0x0957('0x11')]['message']);return _0xf40d6b(_0x14ae7b[_0x0957('0x11')][_0x0957('0x14')]);}else{logger[_0x0957('0xc')]('VoiceAgentReport,\x20%s,\x20%s',_0x17d066,_0x0957('0xf'));_0xf40d6b(_0x14ae7b['result'][_0x0957('0x14')]);}})[_0x0957('0x15')](function(_0x4da72c){logger[_0x0957('0x11')](_0x0957('0x13'),_0x17d066,_0x4da72c);_0x219fe3(_0x4da72c);});});}exports[_0x0957('0x16')]=function(_0x155020){var _0x1a4717=this;return new Promise(function(_0x3e9d3f,_0x17cf8d){return db['VoiceAgentReport'][_0x0957('0x17')](_0x155020[_0x0957('0x18')],{'raw':_0x155020['options']?_0x155020[_0x0957('0x19')][_0x0957('0x1a')]===undefined?!![]:![]:!![]})[_0x0957('0x1b')](function(_0x4c19fb){logger[_0x0957('0xc')](_0x0957('0x16'),_0x155020);logger['debug'](_0x0957('0x16'),_0x155020,JSON['stringify'](_0x4c19fb));_0x3e9d3f(_0x4c19fb);})[_0x0957('0x15')](function(_0x138d75){logger[_0x0957('0x11')](_0x0957('0x16'),_0x138d75[_0x0957('0x14')],_0x155020);_0x17cf8d(_0x1a4717[_0x0957('0x11')](0x1f4,_0x138d75['message']));});});};exports[_0x0957('0x1c')]=function(_0x1c1a33){var _0x58539f=this;return new Promise(function(_0x1f315b,_0x4adb06){return db['VoiceAgentReport'][_0x0957('0x1d')](_0x1c1a33[_0x0957('0x18')],{'raw':_0x1c1a33[_0x0957('0x19')]?_0x1c1a33[_0x0957('0x19')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1c1a33[_0x0957('0x19')]?_0x1c1a33[_0x0957('0x19')]['where']||null:null,'attributes':_0x1c1a33['options']?_0x1c1a33[_0x0957('0x19')][_0x0957('0x1e')]||null:null,'limit':_0x1c1a33[_0x0957('0x19')]?_0x1c1a33['options']['limit']||null:null})[_0x0957('0x1b')](function(_0x429903){logger[_0x0957('0xc')](_0x0957('0x1c'),_0x1c1a33);logger[_0x0957('0xd')]('UpdateVoiceAgentReport',_0x1c1a33,JSON['stringify'](_0x429903));_0x1f315b(_0x429903);})[_0x0957('0x15')](function(_0x4a8ef1){logger[_0x0957('0x11')]('UpdateVoiceAgentReport',_0x4a8ef1[_0x0957('0x14')],_0x1c1a33);_0x4adb06(_0x58539f[_0x0957('0x11')](0x1f4,_0x4a8ef1['message']));});});};
\ No newline at end of file
diff --git a/server/api/voiceCallReport/index.js b/server/api/voiceCallReport/index.js
index 617f520..676be87 100644
--- a/server/api/voiceCallReport/index.js
+++ b/server/api/voiceCallReport/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x842e=['express','Router','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','update','delete','destroy','exports','path'];(function(_0x19cc92,_0x4df512){var _0x4c88d4=function(_0x40bf46){while(--_0x40bf46){_0x19cc92['push'](_0x19cc92['shift']());}};_0x4c88d4(++_0x4df512);}(_0x842e,0x1af));var _0xe842=function(_0x28578d,_0xcf5cf0){_0x28578d=_0x28578d-0x0;var _0x524826=_0x842e[_0x28578d];return _0x524826;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xe842('0x0'));var timeout=require('connect-timeout');var express=require(_0xe842('0x1'));var router=express[_0xe842('0x2')]();var auth=require('../../components/auth/service');var interaction=require(_0xe842('0x3'));var config=require(_0xe842('0x4'));var controller=require('./voiceCallReport.controller');router[_0xe842('0x5')]('/',auth[_0xe842('0x6')](),controller[_0xe842('0x7')]);router[_0xe842('0x5')](_0xe842('0x8'),auth[_0xe842('0x6')](),controller[_0xe842('0x9')]);router[_0xe842('0x5')](_0xe842('0xa'),auth[_0xe842('0x6')](),controller[_0xe842('0xb')]);router[_0xe842('0xc')]('/',auth[_0xe842('0x6')](),controller[_0xe842('0xd')]);router['put']('/:id',auth[_0xe842('0x6')](),controller[_0xe842('0xe')]);router[_0xe842('0xf')]('/:id',auth[_0xe842('0x6')](),controller[_0xe842('0x10')]);module[_0xe842('0x11')]=router;
\ No newline at end of file
+var _0xf7a1=['multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceCallReport.controller','get','isAuthenticated','index','/describe','describe','/:id','post','put','update','delete','destroy','exports'];(function(_0x82c04c,_0x4e795a){var _0x178b18=function(_0x1dee73){while(--_0x1dee73){_0x82c04c['push'](_0x82c04c['shift']());}};_0x178b18(++_0x4e795a);}(_0xf7a1,0xd2));var _0x1f7a=function(_0x364797,_0x2e97de){_0x364797=_0x364797-0x0;var _0x4ebd83=_0xf7a1[_0x364797];return _0x4ebd83;};'use strict';var multer=require(_0x1f7a('0x0'));var util=require(_0x1f7a('0x1'));var path=require('path');var timeout=require(_0x1f7a('0x2'));var express=require(_0x1f7a('0x3'));var router=express[_0x1f7a('0x4')]();var auth=require(_0x1f7a('0x5'));var interaction=require(_0x1f7a('0x6'));var config=require(_0x1f7a('0x7'));var controller=require(_0x1f7a('0x8'));router[_0x1f7a('0x9')]('/',auth[_0x1f7a('0xa')](),controller[_0x1f7a('0xb')]);router[_0x1f7a('0x9')](_0x1f7a('0xc'),auth['isAuthenticated'](),controller[_0x1f7a('0xd')]);router['get'](_0x1f7a('0xe'),auth[_0x1f7a('0xa')](),controller['show']);router[_0x1f7a('0xf')]('/',auth['isAuthenticated'](),controller['create']);router[_0x1f7a('0x10')](_0x1f7a('0xe'),auth[_0x1f7a('0xa')](),controller[_0x1f7a('0x11')]);router[_0x1f7a('0x12')](_0x1f7a('0xe'),auth['isAuthenticated'](),controller[_0x1f7a('0x13')]);module[_0x1f7a('0x14')]=router;
\ No newline at end of file
diff --git a/server/api/voiceCallReport/voiceCallReport.attributes.js b/server/api/voiceCallReport/voiceCallReport.attributes.js
index 382886b..acf7035 100644
--- a/server/api/voiceCallReport/voiceCallReport.attributes.js
+++ b/server/api/voiceCallReport/voiceCallReport.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9957=['ENUM','internal','outbound','inbound-fax','outbound-fax','DATE','INTEGER','sequelize','exports','STRING'];(function(_0x472402,_0x244d69){var _0x5dedcf=function(_0x498516){while(--_0x498516){_0x472402['push'](_0x472402['shift']());}};_0x5dedcf(++_0x244d69);}(_0x9957,0x93));var _0x7995=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x9957[_0x3b380d];return _0x54502b;};'use strict';var Sequelize=require(_0x7995('0x0'));module[_0x7995('0x1')]={'uniqueid':{'type':Sequelize[_0x7995('0x2')]},'type':{'type':Sequelize[_0x7995('0x3')]('inbound',_0x7995('0x4'),_0x7995('0x5'),_0x7995('0x6'),_0x7995('0x7'),'dialer')},'tag':{'type':Sequelize[_0x7995('0x2')]},'accountcode':{'type':Sequelize[_0x7995('0x2')]},'source':{'type':Sequelize[_0x7995('0x2')]},'destination':{'type':Sequelize[_0x7995('0x2')]},'destinationcontext':{'type':Sequelize[_0x7995('0x2')]},'callerid':{'type':Sequelize[_0x7995('0x2')]},'channel':{'type':Sequelize['STRING']},'destinationchannel':{'type':Sequelize[_0x7995('0x2')]},'lastapplication':{'type':Sequelize[_0x7995('0x2')]},'lastdata':{'type':Sequelize['TEXT']},'starttime':{'type':Sequelize[_0x7995('0x8')]},'systemanswertime':{'type':Sequelize[_0x7995('0x8')]},'answertime':{'type':Sequelize[_0x7995('0x8')]},'endtime':{'type':Sequelize[_0x7995('0x8')]},'duration':{'type':Sequelize[_0x7995('0x9')]},'billableseconds':{'type':Sequelize[_0x7995('0x9')]},'mohtime':{'type':Sequelize[_0x7995('0x9')],'defaultValue':0x0},'disposition':{'type':Sequelize['STRING']},'amaflags':{'type':Sequelize[_0x7995('0x2')]},'userfield':{'type':Sequelize[_0x7995('0x2')]},'userDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x7995('0x2')]},'prefix':{'type':Sequelize[_0x7995('0x2')]},'routeid':{'type':Sequelize[_0x7995('0x9')]},'sipcallid':{'type':Sequelize[_0x7995('0x2')]}};
\ No newline at end of file
+var _0x9957=['ENUM','internal','outbound','inbound-fax','outbound-fax','DATE','INTEGER','sequelize','exports','STRING'];(function(_0x280678,_0x14347a){var _0x3501fd=function(_0x3760c5){while(--_0x3760c5){_0x280678['push'](_0x280678['shift']());}};_0x3501fd(++_0x14347a);}(_0x9957,0x93));var _0x7995=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x9957[_0x5b644e];return _0x49c6bf;};'use strict';var Sequelize=require(_0x7995('0x0'));module[_0x7995('0x1')]={'uniqueid':{'type':Sequelize[_0x7995('0x2')]},'type':{'type':Sequelize[_0x7995('0x3')]('inbound',_0x7995('0x4'),_0x7995('0x5'),_0x7995('0x6'),_0x7995('0x7'),'dialer')},'tag':{'type':Sequelize[_0x7995('0x2')]},'accountcode':{'type':Sequelize[_0x7995('0x2')]},'source':{'type':Sequelize[_0x7995('0x2')]},'destination':{'type':Sequelize[_0x7995('0x2')]},'destinationcontext':{'type':Sequelize[_0x7995('0x2')]},'callerid':{'type':Sequelize[_0x7995('0x2')]},'channel':{'type':Sequelize['STRING']},'destinationchannel':{'type':Sequelize[_0x7995('0x2')]},'lastapplication':{'type':Sequelize[_0x7995('0x2')]},'lastdata':{'type':Sequelize['TEXT']},'starttime':{'type':Sequelize[_0x7995('0x8')]},'systemanswertime':{'type':Sequelize[_0x7995('0x8')]},'answertime':{'type':Sequelize[_0x7995('0x8')]},'endtime':{'type':Sequelize[_0x7995('0x8')]},'duration':{'type':Sequelize[_0x7995('0x9')]},'billableseconds':{'type':Sequelize[_0x7995('0x9')]},'mohtime':{'type':Sequelize[_0x7995('0x9')],'defaultValue':0x0},'disposition':{'type':Sequelize['STRING']},'amaflags':{'type':Sequelize[_0x7995('0x2')]},'userfield':{'type':Sequelize[_0x7995('0x2')]},'userDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x7995('0x2')]},'prefix':{'type':Sequelize[_0x7995('0x2')]},'routeid':{'type':Sequelize[_0x7995('0x9')]},'sipcallid':{'type':Sequelize[_0x7995('0x2')]}};
\ No newline at end of file
diff --git a/server/api/voiceCallReport/voiceCallReport.controller.js b/server/api/voiceCallReport/voiceCallReport.controller.js
index 2568810..31edb81 100644
--- a/server/api/voiceCallReport/voiceCallReport.controller.js
+++ b/server/api/voiceCallReport/voiceCallReport.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x3072=['user','html-pdf','eml-format','zip-dir','request-promise','moment','mustache','util','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','json','offset','limit','set','Content-Range','apply','then','destroy','error','stack','name','send','map','VoiceCallReport','rawAttributes','fieldName','type','key','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','filter','merge','VIRTUAL','options','count','includeAll','include','fullname','alias','User','findAll','rows','catch','show','params','create','describe','update','body','find'];(function(_0x4193e2,_0x8ac4bb){var _0x1cd6c3=function(_0x56f634){while(--_0x56f634){_0x4193e2['push'](_0x4193e2['shift']());}};_0x1cd6c3(++_0x8ac4bb);}(_0x3072,0x1d5));var _0x2307=function(_0x19c4a4,_0x345a60){_0x19c4a4=_0x19c4a4-0x0;var _0x22c39d=_0x3072[_0x19c4a4];return _0x22c39d;};'use strict';var pdf=require(_0x2307('0x0'));var emlformat=require(_0x2307('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x2307('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x2307('0x3'));var moment=require(_0x2307('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x2307('0x5'));var util=require(_0x2307('0x6'));var path=require('path');var sox=require(_0x2307('0x7'));var csv=require(_0x2307('0x8'));var ejs=require(_0x2307('0x9'));var fs=require('fs');var _=require(_0x2307('0xa'));var squel=require('squel');var crypto=require(_0x2307('0xb'));var jsforce=require(_0x2307('0xc'));var deskjs=require(_0x2307('0xd'));var toCsv=require('to-csv');var querystring=require(_0x2307('0xe'));var Papa=require(_0x2307('0xf'));var Redis=require(_0x2307('0x10'));var authService=require(_0x2307('0x11'));var qs=require(_0x2307('0x12'));var as=require(_0x2307('0x13'));var hardwareService=require(_0x2307('0x14'));var logger=require(_0x2307('0x15'))(_0x2307('0x16'));var utils=require('../../config/utils');var config=require(_0x2307('0x17'));var db=require(_0x2307('0x18'))['db'];function respondWithStatusCode(_0x102fd8,_0x350bc0){_0x350bc0=_0x350bc0||0xcc;return function(_0x5c8761){if(_0x5c8761){return _0x102fd8[_0x2307('0x19')](_0x350bc0);}return _0x102fd8[_0x2307('0x1a')](_0x350bc0)['end']();};}function respondWithResult(_0x38f0fe,_0xb91473){_0xb91473=_0xb91473||0xc8;return function(_0x4221c1){if(_0x4221c1){return _0x38f0fe[_0x2307('0x1a')](_0xb91473)[_0x2307('0x1b')](_0x4221c1);}};}function respondWithFilteredResult(_0x2a373e,_0x108e34){return function(_0x220e48){if(_0x220e48){var _0x3d247e=_0x220e48['count'],_0x7e5ea7=_0x108e34[_0x2307('0x1c')],_0x170f96=_0x108e34[_0x2307('0x1c')]+_0x108e34[_0x2307('0x1d')],_0x52cbd1;if(_0x170f96>=_0x3d247e){_0x170f96=_0x3d247e;_0x52cbd1=0xc8;}else{_0x52cbd1=0xce;}_0x2a373e['status'](_0x52cbd1);return _0x2a373e[_0x2307('0x1e')](_0x2307('0x1f'),_0x7e5ea7+'-'+_0x170f96+'/'+_0x3d247e)[_0x2307('0x1b')](_0x220e48);}return null;};}function patchUpdates(_0x5a7c3d){return function(_0x3f48ae){try{jsonpatch[_0x2307('0x20')](_0x3f48ae,_0x5a7c3d,!![]);}catch(_0x131ab5){return BPromise['reject'](_0x131ab5);}return _0x3f48ae['save']();};}function saveUpdates(_0x45979b,_0xb90595){return function(_0x4d024f){if(_0x4d024f){return _0x4d024f['update'](_0x45979b)[_0x2307('0x21')](function(_0x2ec027){return _0x2ec027;});}return null;};}function removeEntity(_0x4c9e06,_0x17b87a){return function(_0x5beb17){if(_0x5beb17){return _0x5beb17[_0x2307('0x22')]()[_0x2307('0x21')](function(){_0x4c9e06[_0x2307('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x108528,_0x30aef1){return function(_0x1ff176){if(!_0x1ff176){_0x108528[_0x2307('0x19')](0x194);}return _0x1ff176;};}function handleError(_0x492a1b,_0x55a780){_0x55a780=_0x55a780||0x1f4;return function(_0x1b28b8){logger[_0x2307('0x23')](_0x1b28b8[_0x2307('0x24')]);if(_0x1b28b8[_0x2307('0x25')]){delete _0x1b28b8[_0x2307('0x25')];}_0x492a1b[_0x2307('0x1a')](_0x55a780)[_0x2307('0x26')](_0x1b28b8);};}exports['index']=function(_0x406707,_0x38b657){var _0x243bd1={},_0x178f4f={},_0x34d379={'count':0x0,'rows':[]};var _0x33a98f=_[_0x2307('0x27')](db[_0x2307('0x28')][_0x2307('0x29')],function(_0x244dd8){return{'name':_0x244dd8[_0x2307('0x2a')],'type':_0x244dd8[_0x2307('0x2b')][_0x2307('0x2c')]};});_0x178f4f[_0x2307('0x2d')]=_[_0x2307('0x27')](_0x33a98f,_0x2307('0x25'));_0x178f4f['query']=_[_0x2307('0x2e')](_0x406707[_0x2307('0x2f')]);_0x178f4f['filters']=_[_0x2307('0x30')](_0x178f4f[_0x2307('0x2d')],_0x178f4f[_0x2307('0x2f')]);_0x243bd1[_0x2307('0x31')]=_[_0x2307('0x30')](_0x178f4f[_0x2307('0x2d')],qs[_0x2307('0x32')](_0x406707[_0x2307('0x2f')][_0x2307('0x32')]));_0x243bd1['attributes']=_0x243bd1['attributes'][_0x2307('0x33')]?_0x243bd1['attributes']:_0x178f4f[_0x2307('0x2d')];if(!_0x406707['query'][_0x2307('0x34')](_0x2307('0x35'))){_0x243bd1[_0x2307('0x1d')]=qs['limit'](_0x406707[_0x2307('0x2f')][_0x2307('0x1d')]);_0x243bd1[_0x2307('0x1c')]=qs['offset'](_0x406707[_0x2307('0x2f')][_0x2307('0x1c')]);}_0x243bd1['order']=qs[_0x2307('0x36')](_0x406707['query'][_0x2307('0x36')]);_0x243bd1[_0x2307('0x37')]=qs[_0x2307('0x38')](_['pick'](_0x406707[_0x2307('0x2f')],_0x178f4f[_0x2307('0x38')]),_0x33a98f);if(_0x406707[_0x2307('0x2f')][_0x2307('0x39')]){_0x243bd1[_0x2307('0x37')]=_[_0x2307('0x3a')](_0x243bd1[_0x2307('0x37')],{'$or':_['map'](_0x33a98f,function(_0x3a618e){if(_0x3a618e[_0x2307('0x2b')]!==_0x2307('0x3b')){var _0x51ff11={};_0x51ff11[_0x3a618e[_0x2307('0x25')]]={'$like':'%'+_0x406707[_0x2307('0x2f')]['filter']+'%'};return _0x51ff11;}})});}_0x243bd1=_[_0x2307('0x3a')]({},_0x243bd1,_0x406707[_0x2307('0x3c')]);var _0x5e38ba={'where':_0x243bd1['where']};return db[_0x2307('0x28')][_0x2307('0x3d')](_0x5e38ba)[_0x2307('0x21')](function(_0x115a48){_0x34d379[_0x2307('0x3d')]=_0x115a48;if(_0x406707[_0x2307('0x2f')][_0x2307('0x3e')]){_0x243bd1[_0x2307('0x3f')]=[{'attributes':['id','name',_0x2307('0x40'),_0x2307('0x41')],'model':db[_0x2307('0x42')],'as':_0x2307('0x42')}];}return db['VoiceCallReport'][_0x2307('0x43')](_0x243bd1);})[_0x2307('0x21')](function(_0x3b7816){_0x34d379[_0x2307('0x44')]=_0x3b7816;return _0x34d379;})[_0x2307('0x21')](respondWithFilteredResult(_0x38b657,_0x243bd1))[_0x2307('0x45')](handleError(_0x38b657,null));};exports[_0x2307('0x46')]=function(_0x50a557,_0x5b83f7){var _0x6aa8ca={'raw':!![],'where':{'id':_0x50a557[_0x2307('0x47')]['id']}},_0x86ddd4={};_0x86ddd4[_0x2307('0x2d')]=_['keys'](db['VoiceCallReport'][_0x2307('0x29')]);_0x86ddd4[_0x2307('0x2f')]=_[_0x2307('0x2e')](_0x50a557[_0x2307('0x2f')]);_0x86ddd4[_0x2307('0x38')]=_[_0x2307('0x30')](_0x86ddd4[_0x2307('0x2d')],_0x86ddd4[_0x2307('0x2f')]);_0x6aa8ca[_0x2307('0x31')]=_[_0x2307('0x30')](_0x86ddd4[_0x2307('0x2d')],qs['fields'](_0x50a557['query'][_0x2307('0x32')]));_0x6aa8ca[_0x2307('0x31')]=_0x6aa8ca[_0x2307('0x31')][_0x2307('0x33')]?_0x6aa8ca[_0x2307('0x31')]:_0x86ddd4[_0x2307('0x2d')];if(_0x50a557['query'][_0x2307('0x3e')]){_0x6aa8ca[_0x2307('0x3f')]=[{'all':!![]}];}_0x6aa8ca=_[_0x2307('0x3a')]({},_0x6aa8ca,_0x50a557[_0x2307('0x3c')]);return db[_0x2307('0x28')]['find'](_0x6aa8ca)[_0x2307('0x21')](handleEntityNotFound(_0x5b83f7,null))[_0x2307('0x21')](respondWithResult(_0x5b83f7,null))[_0x2307('0x45')](handleError(_0x5b83f7,null));};exports[_0x2307('0x48')]=function(_0x5a4bc5,_0x6684b9){return db[_0x2307('0x28')][_0x2307('0x48')](_0x5a4bc5['body'],{})[_0x2307('0x21')](respondWithResult(_0x6684b9,0xc9))[_0x2307('0x45')](handleError(_0x6684b9,null));};exports[_0x2307('0x22')]=function(_0x25707c,_0x1ec7d2){return db[_0x2307('0x28')]['find']({'where':{'id':_0x25707c['params']['id']}})[_0x2307('0x21')](handleEntityNotFound(_0x1ec7d2,null))[_0x2307('0x21')](removeEntity(_0x1ec7d2,null))[_0x2307('0x45')](handleError(_0x1ec7d2,null));};exports[_0x2307('0x49')]=function(_0x1a6fd7,_0x117948){return db[_0x2307('0x28')][_0x2307('0x49')]()[_0x2307('0x21')](respondWithResult(_0x117948,null))[_0x2307('0x45')](handleError(_0x117948,null));};exports[_0x2307('0x4a')]=function(_0x24ae1a,_0xf3dff){if(_0x24ae1a[_0x2307('0x4b')]['uniqueid']){delete _0x24ae1a[_0x2307('0x4b')]['uniqueid'];}return db[_0x2307('0x28')][_0x2307('0x4c')]({'where':{'uniqueid':_0x24ae1a['params']['id'],'UserId':{'$or':[null,_0x24ae1a[_0x2307('0x4d')]['id']]}}})[_0x2307('0x21')](handleEntityNotFound(_0xf3dff,null))[_0x2307('0x21')](saveUpdates(_0x24ae1a['body'],null))['then'](respondWithResult(_0xf3dff,null))[_0x2307('0x45')](handleError(_0xf3dff,null));};
\ No newline at end of file
+var _0x2bcd=['util','path','to-csv','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','status','end','count','offset','limit','set','Content-Range','json','apply','reject','save','update','then','destroy','name','index','map','rawAttributes','fieldName','type','key','query','keys','filters','model','fields','attributes','length','hasOwnProperty','order','sort','where','pick','filter','VoiceCallReport','includeAll','include','fullname','alias','User','findAll','rows','catch','show','params','intersection','merge','options','create','body','find','describe','uniqueid','user','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache'];(function(_0x55c2b5,_0x1dd3f9){var _0x145481=function(_0x4c3306){while(--_0x4c3306){_0x55c2b5['push'](_0x55c2b5['shift']());}};_0x145481(++_0x1dd3f9);}(_0x2bcd,0x96));var _0xd2bc=function(_0x38a449,_0x45d044){_0x38a449=_0x38a449-0x0;var _0x3efabb=_0x2bcd[_0x38a449];return _0x3efabb;};'use strict';var pdf=require(_0xd2bc('0x0'));var emlformat=require(_0xd2bc('0x1'));var rimraf=require(_0xd2bc('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd2bc('0x3'));var rp=require(_0xd2bc('0x4'));var moment=require(_0xd2bc('0x5'));var BPromise=require(_0xd2bc('0x6'));var Mustache=require(_0xd2bc('0x7'));var util=require(_0xd2bc('0x8'));var path=require(_0xd2bc('0x9'));var sox=require('sox');var csv=require(_0xd2bc('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xd2bc('0xb'));var squel=require(_0xd2bc('0xc'));var crypto=require(_0xd2bc('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xd2bc('0xe'));var toCsv=require(_0xd2bc('0xa'));var querystring=require('querystring');var Papa=require(_0xd2bc('0xf'));var Redis=require(_0xd2bc('0x10'));var authService=require(_0xd2bc('0x11'));var qs=require(_0xd2bc('0x12'));var as=require(_0xd2bc('0x13'));var hardwareService=require(_0xd2bc('0x14'));var logger=require(_0xd2bc('0x15'))(_0xd2bc('0x16'));var utils=require('../../config/utils');var config=require(_0xd2bc('0x17'));var db=require(_0xd2bc('0x18'))['db'];function respondWithStatusCode(_0x45429c,_0x195f3d){_0x195f3d=_0x195f3d||0xcc;return function(_0x142a15){if(_0x142a15){return _0x45429c['sendStatus'](_0x195f3d);}return _0x45429c[_0xd2bc('0x19')](_0x195f3d)[_0xd2bc('0x1a')]();};}function respondWithResult(_0x38d9f5,_0x564a4d){_0x564a4d=_0x564a4d||0xc8;return function(_0x3622ec){if(_0x3622ec){return _0x38d9f5[_0xd2bc('0x19')](_0x564a4d)['json'](_0x3622ec);}};}function respondWithFilteredResult(_0x5897f1,_0x4672af){return function(_0x19f649){if(_0x19f649){var _0x4671a4=_0x19f649[_0xd2bc('0x1b')],_0xbf0214=_0x4672af[_0xd2bc('0x1c')],_0x174de2=_0x4672af[_0xd2bc('0x1c')]+_0x4672af[_0xd2bc('0x1d')],_0x191fa1;if(_0x174de2>=_0x4671a4){_0x174de2=_0x4671a4;_0x191fa1=0xc8;}else{_0x191fa1=0xce;}_0x5897f1[_0xd2bc('0x19')](_0x191fa1);return _0x5897f1[_0xd2bc('0x1e')](_0xd2bc('0x1f'),_0xbf0214+'-'+_0x174de2+'/'+_0x4671a4)[_0xd2bc('0x20')](_0x19f649);}return null;};}function patchUpdates(_0x29efbf){return function(_0x10315e){try{jsonpatch[_0xd2bc('0x21')](_0x10315e,_0x29efbf,!![]);}catch(_0x1e3662){return BPromise[_0xd2bc('0x22')](_0x1e3662);}return _0x10315e[_0xd2bc('0x23')]();};}function saveUpdates(_0x193abc,_0x53276e){return function(_0x2997e3){if(_0x2997e3){return _0x2997e3[_0xd2bc('0x24')](_0x193abc)[_0xd2bc('0x25')](function(_0x2e752a){return _0x2e752a;});}return null;};}function removeEntity(_0x3c8ef9,_0x4c5dea){return function(_0x2378bc){if(_0x2378bc){return _0x2378bc[_0xd2bc('0x26')]()['then'](function(){_0x3c8ef9[_0xd2bc('0x19')](0xcc)[_0xd2bc('0x1a')]();});}};}function handleEntityNotFound(_0x186fe9,_0x2f5075){return function(_0x550a05){if(!_0x550a05){_0x186fe9['sendStatus'](0x194);}return _0x550a05;};}function handleError(_0x6b1295,_0x520b81){_0x520b81=_0x520b81||0x1f4;return function(_0xbd64aa){logger['error'](_0xbd64aa['stack']);if(_0xbd64aa[_0xd2bc('0x27')]){delete _0xbd64aa['name'];}_0x6b1295[_0xd2bc('0x19')](_0x520b81)['send'](_0xbd64aa);};}exports[_0xd2bc('0x28')]=function(_0x4f3d41,_0x4f8630){var _0x442d79={},_0x4ab372={},_0xd27e21={'count':0x0,'rows':[]};var _0x43978f=_[_0xd2bc('0x29')](db['VoiceCallReport'][_0xd2bc('0x2a')],function(_0x1692c6){return{'name':_0x1692c6[_0xd2bc('0x2b')],'type':_0x1692c6[_0xd2bc('0x2c')][_0xd2bc('0x2d')]};});_0x4ab372['model']=_[_0xd2bc('0x29')](_0x43978f,_0xd2bc('0x27'));_0x4ab372[_0xd2bc('0x2e')]=_[_0xd2bc('0x2f')](_0x4f3d41[_0xd2bc('0x2e')]);_0x4ab372[_0xd2bc('0x30')]=_['intersection'](_0x4ab372[_0xd2bc('0x31')],_0x4ab372[_0xd2bc('0x2e')]);_0x442d79['attributes']=_['intersection'](_0x4ab372[_0xd2bc('0x31')],qs['fields'](_0x4f3d41['query'][_0xd2bc('0x32')]));_0x442d79[_0xd2bc('0x33')]=_0x442d79[_0xd2bc('0x33')][_0xd2bc('0x34')]?_0x442d79[_0xd2bc('0x33')]:_0x4ab372[_0xd2bc('0x31')];if(!_0x4f3d41[_0xd2bc('0x2e')][_0xd2bc('0x35')]('nolimit')){_0x442d79['limit']=qs[_0xd2bc('0x1d')](_0x4f3d41[_0xd2bc('0x2e')]['limit']);_0x442d79[_0xd2bc('0x1c')]=qs[_0xd2bc('0x1c')](_0x4f3d41[_0xd2bc('0x2e')][_0xd2bc('0x1c')]);}_0x442d79[_0xd2bc('0x36')]=qs['sort'](_0x4f3d41[_0xd2bc('0x2e')][_0xd2bc('0x37')]);_0x442d79[_0xd2bc('0x38')]=qs[_0xd2bc('0x30')](_[_0xd2bc('0x39')](_0x4f3d41[_0xd2bc('0x2e')],_0x4ab372[_0xd2bc('0x30')]),_0x43978f);if(_0x4f3d41[_0xd2bc('0x2e')][_0xd2bc('0x3a')]){_0x442d79[_0xd2bc('0x38')]=_['merge'](_0x442d79[_0xd2bc('0x38')],{'$or':_[_0xd2bc('0x29')](_0x43978f,function(_0x5369f5){if(_0x5369f5['type']!=='VIRTUAL'){var _0x4e5eeb={};_0x4e5eeb[_0x5369f5[_0xd2bc('0x27')]]={'$like':'%'+_0x4f3d41[_0xd2bc('0x2e')]['filter']+'%'};return _0x4e5eeb;}})});}_0x442d79=_['merge']({},_0x442d79,_0x4f3d41['options']);var _0x4c5408={'where':_0x442d79['where']};return db[_0xd2bc('0x3b')][_0xd2bc('0x1b')](_0x4c5408)[_0xd2bc('0x25')](function(_0x3d8c5a){_0xd27e21[_0xd2bc('0x1b')]=_0x3d8c5a;if(_0x4f3d41[_0xd2bc('0x2e')][_0xd2bc('0x3c')]){_0x442d79[_0xd2bc('0x3d')]=[{'attributes':['id',_0xd2bc('0x27'),_0xd2bc('0x3e'),_0xd2bc('0x3f')],'model':db[_0xd2bc('0x40')],'as':_0xd2bc('0x40')}];}return db[_0xd2bc('0x3b')][_0xd2bc('0x41')](_0x442d79);})[_0xd2bc('0x25')](function(_0x43db2d){_0xd27e21[_0xd2bc('0x42')]=_0x43db2d;return _0xd27e21;})[_0xd2bc('0x25')](respondWithFilteredResult(_0x4f8630,_0x442d79))[_0xd2bc('0x43')](handleError(_0x4f8630,null));};exports[_0xd2bc('0x44')]=function(_0x4f1599,_0x4eaa3f){var _0x2d5250={'raw':!![],'where':{'id':_0x4f1599[_0xd2bc('0x45')]['id']}},_0x372f86={};_0x372f86[_0xd2bc('0x31')]=_[_0xd2bc('0x2f')](db['VoiceCallReport'][_0xd2bc('0x2a')]);_0x372f86[_0xd2bc('0x2e')]=_[_0xd2bc('0x2f')](_0x4f1599[_0xd2bc('0x2e')]);_0x372f86[_0xd2bc('0x30')]=_[_0xd2bc('0x46')](_0x372f86['model'],_0x372f86[_0xd2bc('0x2e')]);_0x2d5250['attributes']=_[_0xd2bc('0x46')](_0x372f86['model'],qs['fields'](_0x4f1599[_0xd2bc('0x2e')]['fields']));_0x2d5250[_0xd2bc('0x33')]=_0x2d5250[_0xd2bc('0x33')][_0xd2bc('0x34')]?_0x2d5250[_0xd2bc('0x33')]:_0x372f86[_0xd2bc('0x31')];if(_0x4f1599[_0xd2bc('0x2e')][_0xd2bc('0x3c')]){_0x2d5250[_0xd2bc('0x3d')]=[{'all':!![]}];}_0x2d5250=_[_0xd2bc('0x47')]({},_0x2d5250,_0x4f1599[_0xd2bc('0x48')]);return db['VoiceCallReport']['find'](_0x2d5250)['then'](handleEntityNotFound(_0x4eaa3f,null))[_0xd2bc('0x25')](respondWithResult(_0x4eaa3f,null))['catch'](handleError(_0x4eaa3f,null));};exports['create']=function(_0x1e0601,_0x56235b){return db[_0xd2bc('0x3b')][_0xd2bc('0x49')](_0x1e0601[_0xd2bc('0x4a')],{})['then'](respondWithResult(_0x56235b,0xc9))[_0xd2bc('0x43')](handleError(_0x56235b,null));};exports[_0xd2bc('0x26')]=function(_0x2fcade,_0x1bbe10){return db[_0xd2bc('0x3b')][_0xd2bc('0x4b')]({'where':{'id':_0x2fcade[_0xd2bc('0x45')]['id']}})[_0xd2bc('0x25')](handleEntityNotFound(_0x1bbe10,null))[_0xd2bc('0x25')](removeEntity(_0x1bbe10,null))[_0xd2bc('0x43')](handleError(_0x1bbe10,null));};exports[_0xd2bc('0x4c')]=function(_0x5b0616,_0x569f03){return db[_0xd2bc('0x3b')]['describe']()[_0xd2bc('0x25')](respondWithResult(_0x569f03,null))['catch'](handleError(_0x569f03,null));};exports['update']=function(_0x2c06fc,_0x5bbaf9){if(_0x2c06fc[_0xd2bc('0x4a')][_0xd2bc('0x4d')]){delete _0x2c06fc['body']['uniqueid'];}return db[_0xd2bc('0x3b')][_0xd2bc('0x4b')]({'where':{'uniqueid':_0x2c06fc['params']['id'],'UserId':{'$or':[null,_0x2c06fc[_0xd2bc('0x4e')]['id']]}}})[_0xd2bc('0x25')](handleEntityNotFound(_0x5bbaf9,null))['then'](saveUpdates(_0x2c06fc['body'],null))['then'](respondWithResult(_0x5bbaf9,null))[_0xd2bc('0x43')](handleError(_0x5bbaf9,null));};
\ No newline at end of file
diff --git a/server/api/voiceCallReport/voiceCallReport.model.js b/server/api/voiceCallReport/voiceCallReport.model.js
index 9a5db77..d6018ff 100644
--- a/server/api/voiceCallReport/voiceCallReport.model.js
+++ b/server/api/voiceCallReport/voiceCallReport.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x8c07=['lodash','../../config/logger','api','path','./voiceCallReport.attributes','exports','define','VoiceCallReport','report_call','uniqueid'];(function(_0x380a31,_0x832a39){var _0x386380=function(_0x37d141){while(--_0x37d141){_0x380a31['push'](_0x380a31['shift']());}};_0x386380(++_0x832a39);}(_0x8c07,0x10e));var _0x78c0=function(_0x141272,_0x217abe){_0x141272=_0x141272-0x0;var _0x28e8a4=_0x8c07[_0x141272];return _0x28e8a4;};'use strict';var _=require(_0x78c0('0x0'));var util=require('util');var logger=require(_0x78c0('0x1'))(_0x78c0('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x78c0('0x3'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x78c0('0x4'));module[_0x78c0('0x5')]=function(_0xbe0d68,_0x169f2a){return _0xbe0d68[_0x78c0('0x6')](_0x78c0('0x7'),attributes,{'tableName':_0x78c0('0x8'),'paranoid':![],'indexes':[{'fields':[_0x78c0('0x9')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x319e=['../../config/environment','exports','define','report_call','uniqueid','api','moment','request-promise','path','rimraf'];(function(_0x3df138,_0x327e3a){var _0x4c1709=function(_0xe9d5f6){while(--_0xe9d5f6){_0x3df138['push'](_0x3df138['shift']());}};_0x4c1709(++_0x327e3a);}(_0x319e,0xaf));var _0xe319=function(_0xf10a7f,_0x3e4cd3){_0xf10a7f=_0xf10a7f-0x0;var _0x57a0fc=_0x319e[_0xf10a7f];return _0x57a0fc;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0xe319('0x0'));var moment=require(_0xe319('0x1'));var BPromise=require('bluebird');var rp=require(_0xe319('0x2'));var fs=require('fs');var path=require(_0xe319('0x3'));var rimraf=require(_0xe319('0x4'));var config=require(_0xe319('0x5'));var attributes=require('./voiceCallReport.attributes');module[_0xe319('0x6')]=function(_0x1fbeec,_0x1b2d42){return _0x1fbeec[_0xe319('0x7')]('VoiceCallReport',attributes,{'tableName':_0xe319('0x8'),'paranoid':![],'indexes':[{'fields':[_0xe319('0x9')]}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/voiceCallReport/voiceCallReport.rpc.js b/server/api/voiceCallReport/voiceCallReport.rpc.js
index c067a02..c01fbd9 100644
--- a/server/api/voiceCallReport/voiceCallReport.rpc.js
+++ b/server/api/voiceCallReport/voiceCallReport.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x3c4a=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','VoiceCallReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','VoiceCallReport','findAll','options','attributes','include','model','map','GetVoiceCallReport','CreateVoiceCallReport','create','debug','update','where','limit','UpdateVoiceCallReport','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0xae7c2f,_0xf31e04){var _0x5d7001=function(_0x4eeadb){while(--_0x4eeadb){_0xae7c2f['push'](_0xae7c2f['shift']());}};_0x5d7001(++_0xf31e04);}(_0x3c4a,0x1f4));var _0xa3c4=function(_0x137d80,_0x4ca815){_0x137d80=_0x137d80-0x0;var _0x406c15=_0x3c4a[_0x137d80];return _0x406c15;};'use strict';var _=require(_0xa3c4('0x0'));var util=require(_0xa3c4('0x1'));var moment=require('moment');var BPromise=require(_0xa3c4('0x2'));var rs=require(_0xa3c4('0x3'));var fs=require('fs');var Redis=require(_0xa3c4('0x4'));var db=require(_0xa3c4('0x5'))['db'];var utils=require(_0xa3c4('0x6'));var logger=require(_0xa3c4('0x7'))(_0xa3c4('0x8'));var config=require(_0xa3c4('0x9'));var jayson=require(_0xa3c4('0xa'));var client=jayson[_0xa3c4('0xb')][_0xa3c4('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x58f021,_0x54f83e,_0xa696e8){return new BPromise(function(_0x321abf,_0x99af7b){return client[_0xa3c4('0xd')](_0x58f021,_0xa696e8)[_0xa3c4('0xe')](function(_0x38dd22){logger[_0xa3c4('0xf')]('VoiceCallReport,\x20%s,\x20%s',_0x54f83e,'request\x20sent');logger['debug'](_0xa3c4('0x10'),_0x54f83e,_0xa3c4('0x11'),JSON[_0xa3c4('0x12')](_0x38dd22));if(_0x38dd22[_0xa3c4('0x13')]){if(_0x38dd22[_0xa3c4('0x13')][_0xa3c4('0x14')]===0x1f4){logger['error']('VoiceCallReport,\x20%s,\x20%s',_0x54f83e,_0x38dd22[_0xa3c4('0x13')][_0xa3c4('0x15')]);return _0x99af7b(_0x38dd22[_0xa3c4('0x13')]['message']);}logger[_0xa3c4('0x13')]('VoiceCallReport,\x20%s,\x20%s',_0x54f83e,_0x38dd22['error'][_0xa3c4('0x15')]);return _0x321abf(_0x38dd22['error'][_0xa3c4('0x15')]);}else{logger[_0xa3c4('0xf')]('VoiceCallReport,\x20%s,\x20%s',_0x54f83e,_0xa3c4('0x11'));_0x321abf(_0x38dd22[_0xa3c4('0x16')][_0xa3c4('0x15')]);}})[_0xa3c4('0x17')](function(_0x2c9341){logger['error']('VoiceCallReport,\x20%s,\x20%s',_0x54f83e,_0x2c9341);_0x99af7b(_0x2c9341);});});}exports['GetVoiceCallReport']=function(_0x37c305){var _0x19566a=this;return new Promise(function(_0x5c30d0,_0x505cad){return db[_0xa3c4('0x18')][_0xa3c4('0x19')]({'raw':_0x37c305['options']?_0x37c305[_0xa3c4('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x37c305[_0xa3c4('0x1a')]?_0x37c305[_0xa3c4('0x1a')]['where']||null:null,'attributes':_0x37c305[_0xa3c4('0x1a')]?_0x37c305['options'][_0xa3c4('0x1b')]||null:null,'limit':_0x37c305['options']?_0x37c305[_0xa3c4('0x1a')]['limit']||null:null,'include':_0x37c305['options']?_0x37c305[_0xa3c4('0x1a')]['include']?_['map'](_0x37c305[_0xa3c4('0x1a')][_0xa3c4('0x1c')],function(_0x568f8f){return{'model':db[_0x568f8f[_0xa3c4('0x1d')]],'as':_0x568f8f['as'],'attributes':_0x568f8f[_0xa3c4('0x1b')],'include':_0x568f8f[_0xa3c4('0x1c')]?_[_0xa3c4('0x1e')](_0x568f8f[_0xa3c4('0x1c')],function(_0x3a4ce3){return{'model':db[_0x3a4ce3['model']],'as':_0x3a4ce3['as'],'attributes':_0x3a4ce3[_0xa3c4('0x1b')],'include':_0x3a4ce3[_0xa3c4('0x1c')]?_[_0xa3c4('0x1e')](_0x3a4ce3['include'],function(_0x386c87){return{'model':db[_0x386c87['model']],'as':_0x386c87['as'],'attributes':_0x386c87[_0xa3c4('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xa3c4('0xe')](function(_0x5903ae){logger[_0xa3c4('0xf')](_0xa3c4('0x1f'),_0x37c305);logger['debug'](_0xa3c4('0x1f'),_0x37c305,JSON[_0xa3c4('0x12')](_0x5903ae));_0x5c30d0(_0x5903ae);})['catch'](function(_0x3a4090){logger['error'](_0xa3c4('0x1f'),_0x3a4090[_0xa3c4('0x15')],_0x37c305);_0x505cad(_0x19566a[_0xa3c4('0x13')](0x1f4,_0x3a4090[_0xa3c4('0x15')]));});});};exports[_0xa3c4('0x20')]=function(_0x48c272){var _0x45d4c2=this;return new Promise(function(_0xf79084,_0x36a5fa){return db[_0xa3c4('0x18')][_0xa3c4('0x21')](_0x48c272['body'],{'raw':_0x48c272[_0xa3c4('0x1a')]?_0x48c272[_0xa3c4('0x1a')]['raw']===undefined?!![]:![]:!![]})[_0xa3c4('0xe')](function(_0x12c00b){logger[_0xa3c4('0xf')](_0xa3c4('0x20'),_0x48c272);logger[_0xa3c4('0x22')](_0xa3c4('0x20'),_0x48c272,JSON[_0xa3c4('0x12')](_0x12c00b));_0xf79084(_0x12c00b);})[_0xa3c4('0x17')](function(_0x2abdee){logger[_0xa3c4('0x13')](_0xa3c4('0x20'),_0x2abdee[_0xa3c4('0x15')],_0x48c272);_0x36a5fa(_0x45d4c2[_0xa3c4('0x13')](0x1f4,_0x2abdee[_0xa3c4('0x15')]));});});};exports['UpdateVoiceCallReport']=function(_0x500531){var _0x4ae47d=this;return new Promise(function(_0x4e3b36,_0x37bfad){return db[_0xa3c4('0x18')][_0xa3c4('0x23')](_0x500531['body'],{'raw':_0x500531['options']?_0x500531[_0xa3c4('0x1a')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x500531['options']?_0x500531[_0xa3c4('0x1a')][_0xa3c4('0x24')]||null:null,'attributes':_0x500531['options']?_0x500531['options'][_0xa3c4('0x1b')]||null:null,'limit':_0x500531['options']?_0x500531['options'][_0xa3c4('0x25')]||null:null})[_0xa3c4('0xe')](function(_0x3c7087){logger[_0xa3c4('0xf')](_0xa3c4('0x26'),_0x500531);logger[_0xa3c4('0x22')](_0xa3c4('0x26'),_0x500531,JSON['stringify'](_0x3c7087));_0x4e3b36(_0x3c7087);})['catch'](function(_0x16cee3){logger[_0xa3c4('0x13')](_0xa3c4('0x26'),_0x16cee3[_0xa3c4('0x15')],_0x500531);_0x37bfad(_0x4ae47d[_0xa3c4('0x13')](0x1f4,_0x16cee3['message']));});});};
\ No newline at end of file
+var _0xacb0=['catch','VoiceCallReport','findAll','options','raw','where','attributes','limit','include','map','model','GetVoiceCallReport','CreateVoiceCallReport','create','body','UpdateVoiceCallReport','update','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','VoiceCallReport,\x20%s,\x20%s,\x20%s','stringify','error','code','VoiceCallReport,\x20%s,\x20%s','message','result'];(function(_0x309253,_0x248503){var _0x364e71=function(_0x346fc4){while(--_0x346fc4){_0x309253['push'](_0x309253['shift']());}};_0x364e71(++_0x248503);}(_0xacb0,0xb5));var _0x0acb=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xacb0[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x0acb('0x0'));var util=require(_0x0acb('0x1'));var moment=require(_0x0acb('0x2'));var BPromise=require('bluebird');var rs=require(_0x0acb('0x3'));var fs=require('fs');var Redis=require(_0x0acb('0x4'));var db=require(_0x0acb('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x0acb('0x6'))(_0x0acb('0x7'));var config=require(_0x0acb('0x8'));var jayson=require(_0x0acb('0x9'));var client=jayson[_0x0acb('0xa')][_0x0acb('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x22fb69,_0x118814,_0x4bb0ee){return new BPromise(function(_0x3104c4,_0xb4f785){return client[_0x0acb('0xc')](_0x22fb69,_0x4bb0ee)[_0x0acb('0xd')](function(_0x1dabe4){logger[_0x0acb('0xe')]('VoiceCallReport,\x20%s,\x20%s',_0x118814,_0x0acb('0xf'));logger[_0x0acb('0x10')](_0x0acb('0x11'),_0x118814,_0x0acb('0xf'),JSON[_0x0acb('0x12')](_0x1dabe4));if(_0x1dabe4[_0x0acb('0x13')]){if(_0x1dabe4[_0x0acb('0x13')][_0x0acb('0x14')]===0x1f4){logger[_0x0acb('0x13')](_0x0acb('0x15'),_0x118814,_0x1dabe4[_0x0acb('0x13')][_0x0acb('0x16')]);return _0xb4f785(_0x1dabe4['error']['message']);}logger['error'](_0x0acb('0x15'),_0x118814,_0x1dabe4[_0x0acb('0x13')]['message']);return _0x3104c4(_0x1dabe4['error'][_0x0acb('0x16')]);}else{logger['info']('VoiceCallReport,\x20%s,\x20%s',_0x118814,_0x0acb('0xf'));_0x3104c4(_0x1dabe4[_0x0acb('0x17')]['message']);}})[_0x0acb('0x18')](function(_0x2e1ddb){logger[_0x0acb('0x13')](_0x0acb('0x15'),_0x118814,_0x2e1ddb);_0xb4f785(_0x2e1ddb);});});}exports['GetVoiceCallReport']=function(_0x468645){var _0x5ecb4d=this;return new Promise(function(_0x10230f,_0x55a50b){return db[_0x0acb('0x19')][_0x0acb('0x1a')]({'raw':_0x468645[_0x0acb('0x1b')]?_0x468645['options'][_0x0acb('0x1c')]===undefined?!![]:![]:!![],'where':_0x468645[_0x0acb('0x1b')]?_0x468645[_0x0acb('0x1b')][_0x0acb('0x1d')]||null:null,'attributes':_0x468645[_0x0acb('0x1b')]?_0x468645[_0x0acb('0x1b')][_0x0acb('0x1e')]||null:null,'limit':_0x468645[_0x0acb('0x1b')]?_0x468645[_0x0acb('0x1b')][_0x0acb('0x1f')]||null:null,'include':_0x468645[_0x0acb('0x1b')]?_0x468645[_0x0acb('0x1b')][_0x0acb('0x20')]?_[_0x0acb('0x21')](_0x468645['options'][_0x0acb('0x20')],function(_0x294af1){return{'model':db[_0x294af1[_0x0acb('0x22')]],'as':_0x294af1['as'],'attributes':_0x294af1[_0x0acb('0x1e')],'include':_0x294af1[_0x0acb('0x20')]?_[_0x0acb('0x21')](_0x294af1['include'],function(_0x5a1419){return{'model':db[_0x5a1419['model']],'as':_0x5a1419['as'],'attributes':_0x5a1419['attributes'],'include':_0x5a1419[_0x0acb('0x20')]?_[_0x0acb('0x21')](_0x5a1419[_0x0acb('0x20')],function(_0x14e303){return{'model':db[_0x14e303[_0x0acb('0x22')]],'as':_0x14e303['as'],'attributes':_0x14e303['attributes']};}):[]};}):[]};}):[]:[]})[_0x0acb('0xd')](function(_0x12fd8c){logger[_0x0acb('0xe')](_0x0acb('0x23'),_0x468645);logger[_0x0acb('0x10')](_0x0acb('0x23'),_0x468645,JSON['stringify'](_0x12fd8c));_0x10230f(_0x12fd8c);})[_0x0acb('0x18')](function(_0x4d9329){logger[_0x0acb('0x13')](_0x0acb('0x23'),_0x4d9329['message'],_0x468645);_0x55a50b(_0x5ecb4d[_0x0acb('0x13')](0x1f4,_0x4d9329['message']));});});};exports[_0x0acb('0x24')]=function(_0x4648e1){var _0x28c044=this;return new Promise(function(_0x5342a1,_0x5e5233){return db[_0x0acb('0x19')][_0x0acb('0x25')](_0x4648e1[_0x0acb('0x26')],{'raw':_0x4648e1[_0x0acb('0x1b')]?_0x4648e1[_0x0acb('0x1b')][_0x0acb('0x1c')]===undefined?!![]:![]:!![]})['then'](function(_0x7ea512){logger[_0x0acb('0xe')]('CreateVoiceCallReport',_0x4648e1);logger[_0x0acb('0x10')](_0x0acb('0x24'),_0x4648e1,JSON[_0x0acb('0x12')](_0x7ea512));_0x5342a1(_0x7ea512);})[_0x0acb('0x18')](function(_0x20954d){logger[_0x0acb('0x13')](_0x0acb('0x24'),_0x20954d[_0x0acb('0x16')],_0x4648e1);_0x5e5233(_0x28c044[_0x0acb('0x13')](0x1f4,_0x20954d[_0x0acb('0x16')]));});});};exports[_0x0acb('0x27')]=function(_0x5358b2){var _0xf4ca6=this;return new Promise(function(_0x279c33,_0x14b574){return db[_0x0acb('0x19')][_0x0acb('0x28')](_0x5358b2[_0x0acb('0x26')],{'raw':_0x5358b2['options']?_0x5358b2[_0x0acb('0x1b')][_0x0acb('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5358b2[_0x0acb('0x1b')]?_0x5358b2['options'][_0x0acb('0x1d')]||null:null,'attributes':_0x5358b2[_0x0acb('0x1b')]?_0x5358b2[_0x0acb('0x1b')][_0x0acb('0x1e')]||null:null,'limit':_0x5358b2['options']?_0x5358b2[_0x0acb('0x1b')]['limit']||null:null})[_0x0acb('0xd')](function(_0x9dcd9){logger['info'](_0x0acb('0x27'),_0x5358b2);logger[_0x0acb('0x10')]('UpdateVoiceCallReport',_0x5358b2,JSON[_0x0acb('0x12')](_0x9dcd9));_0x279c33(_0x9dcd9);})[_0x0acb('0x18')](function(_0xbb1625){logger['error']('UpdateVoiceCallReport',_0xbb1625['message'],_0x5358b2);_0x14b574(_0xf4ca6[_0x0acb('0x13')](0x1f4,_0xbb1625[_0x0acb('0x16')]));});});};
\ No newline at end of file
diff --git a/server/api/voiceChanSpy/index.js b/server/api/voiceChanSpy/index.js
index a9b60ac..35c132b 100644
--- a/server/api/voiceChanSpy/index.js
+++ b/server/api/voiceChanSpy/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xd90b=['destroy','exports','multer','connect-timeout','../../components/auth/service','../../config/environment','./voiceChanSpy.controller','get','isAuthenticated','index','show','post','create','put','/:id','update','delete'];(function(_0x4166bd,_0x2e3d96){var _0x307655=function(_0x30b9d6){while(--_0x30b9d6){_0x4166bd['push'](_0x4166bd['shift']());}};_0x307655(++_0x2e3d96);}(_0xd90b,0xbd));var _0xbd90=function(_0x2640ee,_0x287559){_0x2640ee=_0x2640ee-0x0;var _0x5cb9b1=_0xd90b[_0x2640ee];return _0x5cb9b1;};'use strict';var multer=require(_0xbd90('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xbd90('0x1'));var express=require('express');var router=express['Router']();var auth=require(_0xbd90('0x2'));var interaction=require('../../components/interaction/service');var config=require(_0xbd90('0x3'));var controller=require(_0xbd90('0x4'));router[_0xbd90('0x5')]('/',auth[_0xbd90('0x6')](),controller[_0xbd90('0x7')]);router[_0xbd90('0x5')]('/:id',auth[_0xbd90('0x6')](),controller[_0xbd90('0x8')]);router[_0xbd90('0x9')]('/',auth[_0xbd90('0x6')](),controller[_0xbd90('0xa')]);router[_0xbd90('0xb')](_0xbd90('0xc'),auth[_0xbd90('0x6')](),controller[_0xbd90('0xd')]);router[_0xbd90('0xe')](_0xbd90('0xc'),auth['isAuthenticated'](),controller[_0xbd90('0xf')]);module[_0xbd90('0x10')]=router;
\ No newline at end of file
+var _0x63b6=['/:id','show','post','isAuthenticated','create','put','update','delete','destroy','exports','multer','util','path','express','../../components/auth/service','../../config/environment','./voiceChanSpy.controller','get','index'];(function(_0x10eb38,_0x2086bd){var _0x5af9b5=function(_0x2075c7){while(--_0x2075c7){_0x10eb38['push'](_0x10eb38['shift']());}};_0x5af9b5(++_0x2086bd);}(_0x63b6,0x127));var _0x663b=function(_0x2fb4f7,_0x3c72e1){_0x2fb4f7=_0x2fb4f7-0x0;var _0x383080=_0x63b6[_0x2fb4f7];return _0x383080;};'use strict';var multer=require(_0x663b('0x0'));var util=require(_0x663b('0x1'));var path=require(_0x663b('0x2'));var timeout=require('connect-timeout');var express=require(_0x663b('0x3'));var router=express['Router']();var auth=require(_0x663b('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x663b('0x5'));var controller=require(_0x663b('0x6'));router[_0x663b('0x7')]('/',auth['isAuthenticated'](),controller[_0x663b('0x8')]);router['get'](_0x663b('0x9'),auth['isAuthenticated'](),controller[_0x663b('0xa')]);router[_0x663b('0xb')]('/',auth[_0x663b('0xc')](),controller[_0x663b('0xd')]);router[_0x663b('0xe')](_0x663b('0x9'),auth['isAuthenticated'](),controller[_0x663b('0xf')]);router[_0x663b('0x10')](_0x663b('0x9'),auth[_0x663b('0xc')](),controller[_0x663b('0x11')]);module[_0x663b('0x12')]=router;
\ No newline at end of file
diff --git a/server/api/voiceChanSpy/voiceChanSpy.attributes.js b/server/api/voiceChanSpy/voiceChanSpy.attributes.js
index 772e34b..a009e1a 100644
--- a/server/api/voiceChanSpy/voiceChanSpy.attributes.js
+++ b/server/api/voiceChanSpy/voiceChanSpy.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x6bde=['options','join','getDataValue','split','BOOLEAN','sequelize','exports','STRING','name','setDataValue'];(function(_0x4db4a0,_0x1311a8){var _0x32126c=function(_0x138080){while(--_0x138080){_0x4db4a0['push'](_0x4db4a0['shift']());}};_0x32126c(++_0x1311a8);}(_0x6bde,0x91));var _0xe6bd=function(_0x17fef5,_0x422059){_0x17fef5=_0x17fef5-0x0;var _0x5338f2=_0x6bde[_0x17fef5];return _0x5338f2;};'use strict';var Sequelize=require(_0xe6bd('0x0'));module[_0xe6bd('0x1')]={'name':{'type':Sequelize[_0xe6bd('0x2')]},'prefix':{'type':Sequelize['STRING'],'unique':_0xe6bd('0x3'),'allowNull':![]},'options':{'type':Sequelize[_0xe6bd('0x2')],'set':function(_0x27e1a2){this[_0xe6bd('0x4')](_0xe6bd('0x5'),_0x27e1a2?_0x27e1a2[_0xe6bd('0x6')](''):[]);},'get':function(){return this[_0xe6bd('0x7')](_0xe6bd('0x5'))?this[_0xe6bd('0x7')](_0xe6bd('0x5'))[_0xe6bd('0x8')](''):[];}},'auth':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'password':{'type':Sequelize[_0xe6bd('0x2')]},'record':{'type':Sequelize[_0xe6bd('0x9')],'defaultValue':![]},'recordingFormat':{'type':Sequelize[_0xe6bd('0x2')]},'description':{'type':Sequelize[_0xe6bd('0x2')]}};
\ No newline at end of file
+var _0x2957=['sequelize','exports','name','setDataValue','options','join','getDataValue','split','BOOLEAN','STRING'];(function(_0x1950ee,_0x3d2fba){var _0x5b5eae=function(_0x3f4330){while(--_0x3f4330){_0x1950ee['push'](_0x1950ee['shift']());}};_0x5b5eae(++_0x3d2fba);}(_0x2957,0x19a));var _0x7295=function(_0x994f,_0x2e366c){_0x994f=_0x994f-0x0;var _0xb14018=_0x2957[_0x994f];return _0xb14018;};'use strict';var Sequelize=require(_0x7295('0x0'));module[_0x7295('0x1')]={'name':{'type':Sequelize['STRING']},'prefix':{'type':Sequelize['STRING'],'unique':_0x7295('0x2'),'allowNull':![]},'options':{'type':Sequelize['STRING'],'set':function(_0x1054e3){this[_0x7295('0x3')](_0x7295('0x4'),_0x1054e3?_0x1054e3[_0x7295('0x5')](''):[]);},'get':function(){return this['getDataValue'](_0x7295('0x4'))?this[_0x7295('0x6')]('options')[_0x7295('0x7')](''):[];}},'auth':{'type':Sequelize[_0x7295('0x8')],'defaultValue':![]},'password':{'type':Sequelize[_0x7295('0x9')]},'record':{'type':Sequelize[_0x7295('0x8')],'defaultValue':![]},'recordingFormat':{'type':Sequelize[_0x7295('0x9')]},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
diff --git a/server/api/voiceChanSpy/voiceChanSpy.controller.js b/server/api/voiceChanSpy/voiceChanSpy.controller.js
index b4e9f1b..b9ec546 100644
--- a/server/api/voiceChanSpy/voiceChanSpy.controller.js
+++ b/server/api/voiceChanSpy/voiceChanSpy.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9857=['UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','count','offset','Content-Range','json','apply','reject','save','update','then','destroy','get','ChanSpies','UserProfileResource','error','name','send','VoiceChanSpy','type','key','model','map','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','sort','where','filters','pick','filter','merge','VIRTUAL','options','findAll','rows','catch','show','rawAttributes','includeAll','include','find','create','body','user','role'];(function(_0x35c630,_0x2b7b65){var _0xae9371=function(_0x3ed448){while(--_0x3ed448){_0x35c630['push'](_0x35c630['shift']());}};_0xae9371(++_0x2b7b65);}(_0x9857,0xb1));var _0x7985=function(_0x348a3a,_0x147d3d){_0x348a3a=_0x348a3a-0x0;var _0x40e259=_0x9857[_0x348a3a];return _0x40e259;};'use strict';var pdf=require(_0x7985('0x0'));var emlformat=require(_0x7985('0x1'));var rimraf=require(_0x7985('0x2'));var zipdir=require(_0x7985('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7985('0x4'));var moment=require(_0x7985('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x7985('0x6'));var path=require(_0x7985('0x7'));var sox=require(_0x7985('0x8'));var csv=require(_0x7985('0x9'));var ejs=require(_0x7985('0xa'));var fs=require('fs');var _=require(_0x7985('0xb'));var squel=require(_0x7985('0xc'));var crypto=require(_0x7985('0xd'));var jsforce=require(_0x7985('0xe'));var deskjs=require(_0x7985('0xf'));var toCsv=require(_0x7985('0x9'));var querystring=require(_0x7985('0x10'));var Papa=require(_0x7985('0x11'));var Redis=require(_0x7985('0x12'));var authService=require(_0x7985('0x13'));var qs=require(_0x7985('0x14'));var as=require(_0x7985('0x15'));var hardwareService=require(_0x7985('0x16'));var logger=require(_0x7985('0x17'))(_0x7985('0x18'));var utils=require(_0x7985('0x19'));var config=require(_0x7985('0x1a'));var db=require(_0x7985('0x1b'))['db'];function respondWithStatusCode(_0x6a017a,_0x1ce629){_0x1ce629=_0x1ce629||0xcc;return function(_0x493185){if(_0x493185){return _0x6a017a[_0x7985('0x1c')](_0x1ce629);}return _0x6a017a[_0x7985('0x1d')](_0x1ce629)[_0x7985('0x1e')]();};}function respondWithResult(_0x3c2f49,_0x599c9a){_0x599c9a=_0x599c9a||0xc8;return function(_0xe14518){if(_0xe14518){return _0x3c2f49[_0x7985('0x1d')](_0x599c9a)['json'](_0xe14518);}};}function respondWithFilteredResult(_0x127a84,_0x8da42a){return function(_0x823992){if(_0x823992){var _0x28b4ff=_0x823992[_0x7985('0x1f')],_0x41a832=_0x8da42a[_0x7985('0x20')],_0x2ee200=_0x8da42a[_0x7985('0x20')]+_0x8da42a['limit'],_0x27152c;if(_0x2ee200>=_0x28b4ff){_0x2ee200=_0x28b4ff;_0x27152c=0xc8;}else{_0x27152c=0xce;}_0x127a84['status'](_0x27152c);return _0x127a84['set'](_0x7985('0x21'),_0x41a832+'-'+_0x2ee200+'/'+_0x28b4ff)[_0x7985('0x22')](_0x823992);}return null;};}function patchUpdates(_0x3a5188){return function(_0x2bda03){try{jsonpatch[_0x7985('0x23')](_0x2bda03,_0x3a5188,!![]);}catch(_0x2905fe){return BPromise[_0x7985('0x24')](_0x2905fe);}return _0x2bda03[_0x7985('0x25')]();};}function saveUpdates(_0x2afbff,_0x58f59a){return function(_0x5ded77){if(_0x5ded77){return _0x5ded77[_0x7985('0x26')](_0x2afbff)[_0x7985('0x27')](function(_0x52fe99){return _0x52fe99;});}return null;};}function removeEntity(_0x642744,_0x53c0b9){return function(_0x9db966){if(_0x9db966){return _0x9db966[_0x7985('0x28')]()['then'](function(){var _0x3c8d39=_0x9db966[_0x7985('0x29')]({'plain':!![]});var _0xda2470=_0x7985('0x2a');return db[_0x7985('0x2b')][_0x7985('0x28')]({'where':{'type':_0xda2470,'resourceId':_0x3c8d39['id']}})[_0x7985('0x27')](function(){return _0x9db966;});})[_0x7985('0x27')](function(){_0x642744[_0x7985('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x32eee4,_0x7286fa){return function(_0x26fb0e){if(!_0x26fb0e){_0x32eee4[_0x7985('0x1c')](0x194);}return _0x26fb0e;};}function handleError(_0x58fd61,_0x58ad84){_0x58ad84=_0x58ad84||0x1f4;return function(_0x282636){logger[_0x7985('0x2c')](_0x282636['stack']);if(_0x282636['name']){delete _0x282636[_0x7985('0x2d')];}_0x58fd61[_0x7985('0x1d')](_0x58ad84)[_0x7985('0x2e')](_0x282636);};}exports['index']=function(_0x51f218,_0xe323ca){var _0x54fc8f={},_0x12dc3b={},_0x4cf4ce={'count':0x0,'rows':[]};var _0x524c6a=_['map'](db[_0x7985('0x2f')]['rawAttributes'],function(_0x53c5ce){return{'name':_0x53c5ce['fieldName'],'type':_0x53c5ce[_0x7985('0x30')][_0x7985('0x31')]};});_0x12dc3b[_0x7985('0x32')]=_[_0x7985('0x33')](_0x524c6a,_0x7985('0x2d'));_0x12dc3b[_0x7985('0x34')]=_[_0x7985('0x35')](_0x51f218['query']);_0x12dc3b['filters']=_[_0x7985('0x36')](_0x12dc3b[_0x7985('0x32')],_0x12dc3b[_0x7985('0x34')]);_0x54fc8f['attributes']=_[_0x7985('0x36')](_0x12dc3b[_0x7985('0x32')],qs[_0x7985('0x37')](_0x51f218[_0x7985('0x34')][_0x7985('0x37')]));_0x54fc8f[_0x7985('0x38')]=_0x54fc8f[_0x7985('0x38')][_0x7985('0x39')]?_0x54fc8f['attributes']:_0x12dc3b[_0x7985('0x32')];if(!_0x51f218[_0x7985('0x34')][_0x7985('0x3a')](_0x7985('0x3b'))){_0x54fc8f[_0x7985('0x3c')]=qs['limit'](_0x51f218['query'][_0x7985('0x3c')]);_0x54fc8f[_0x7985('0x20')]=qs[_0x7985('0x20')](_0x51f218[_0x7985('0x34')][_0x7985('0x20')]);}_0x54fc8f['order']=qs[_0x7985('0x3d')](_0x51f218[_0x7985('0x34')]['sort']);_0x54fc8f[_0x7985('0x3e')]=qs[_0x7985('0x3f')](_[_0x7985('0x40')](_0x51f218[_0x7985('0x34')],_0x12dc3b[_0x7985('0x3f')]),_0x524c6a);if(_0x51f218[_0x7985('0x34')][_0x7985('0x41')]){_0x54fc8f[_0x7985('0x3e')]=_[_0x7985('0x42')](_0x54fc8f[_0x7985('0x3e')],{'$or':_['map'](_0x524c6a,function(_0x61c472){if(_0x61c472[_0x7985('0x30')]!==_0x7985('0x43')){var _0x5c9f31={};_0x5c9f31[_0x61c472[_0x7985('0x2d')]]={'$like':'%'+_0x51f218[_0x7985('0x34')]['filter']+'%'};return _0x5c9f31;}})});}_0x54fc8f=_[_0x7985('0x42')]({},_0x54fc8f,_0x51f218[_0x7985('0x44')]);var _0x3e8c88={'where':_0x54fc8f[_0x7985('0x3e')]};return db['VoiceChanSpy']['count'](_0x3e8c88)[_0x7985('0x27')](function(_0x1a1c2b){_0x4cf4ce['count']=_0x1a1c2b;if(_0x51f218['query']['includeAll']){_0x54fc8f['include']=[{'all':!![]}];}return db[_0x7985('0x2f')][_0x7985('0x45')](_0x54fc8f);})[_0x7985('0x27')](function(_0x526101){_0x4cf4ce[_0x7985('0x46')]=_0x526101;return _0x4cf4ce;})[_0x7985('0x27')](respondWithFilteredResult(_0xe323ca,_0x54fc8f))[_0x7985('0x47')](handleError(_0xe323ca,null));};exports[_0x7985('0x48')]=function(_0x45cfc2,_0x16b77c){var _0x2d2145={'raw':![],'where':{'id':_0x45cfc2['params']['id']}},_0x22c773={};_0x22c773[_0x7985('0x32')]=_[_0x7985('0x35')](db['VoiceChanSpy'][_0x7985('0x49')]);_0x22c773['query']=_[_0x7985('0x35')](_0x45cfc2[_0x7985('0x34')]);_0x22c773[_0x7985('0x3f')]=_[_0x7985('0x36')](_0x22c773[_0x7985('0x32')],_0x22c773[_0x7985('0x34')]);_0x2d2145['attributes']=_[_0x7985('0x36')](_0x22c773[_0x7985('0x32')],qs[_0x7985('0x37')](_0x45cfc2[_0x7985('0x34')]['fields']));_0x2d2145[_0x7985('0x38')]=_0x2d2145['attributes'][_0x7985('0x39')]?_0x2d2145[_0x7985('0x38')]:_0x22c773[_0x7985('0x32')];if(_0x45cfc2[_0x7985('0x34')][_0x7985('0x4a')]){_0x2d2145[_0x7985('0x4b')]=[{'all':!![]}];}_0x2d2145=_[_0x7985('0x42')]({},_0x2d2145,_0x45cfc2[_0x7985('0x44')]);return db[_0x7985('0x2f')][_0x7985('0x4c')](_0x2d2145)[_0x7985('0x27')](handleEntityNotFound(_0x16b77c,null))['then'](respondWithResult(_0x16b77c,null))['catch'](handleError(_0x16b77c,null));};exports[_0x7985('0x4d')]=function(_0x21a8fb,_0xb0df02){return db[_0x7985('0x2f')][_0x7985('0x4d')](_0x21a8fb[_0x7985('0x4e')],{})[_0x7985('0x27')](function(_0x7d54f){var _0x4eb5b4=_0x21a8fb[_0x7985('0x4f')]['get']({'plain':!![]});if(!_0x4eb5b4)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4eb5b4[_0x7985('0x50')]===_0x7985('0x4f')){var _0x4669f5=_0x7d54f[_0x7985('0x29')]({'plain':!![]});var _0x6b6a19=_0x7985('0x2a');return db[_0x7985('0x51')]['find']({'where':{'name':_0x6b6a19,'userProfileId':_0x4eb5b4[_0x7985('0x52')]},'raw':!![]})[_0x7985('0x27')](function(_0x3d90cf){if(_0x3d90cf&&_0x3d90cf[_0x7985('0x53')]===0x0){return db[_0x7985('0x2b')][_0x7985('0x4d')]({'name':_0x4669f5[_0x7985('0x2d')],'resourceId':_0x4669f5['id'],'type':_0x3d90cf[_0x7985('0x2d')],'sectionId':_0x3d90cf['id']},{})[_0x7985('0x27')](function(){return _0x7d54f;});}else{return _0x7d54f;}})[_0x7985('0x47')](function(_0x51b712){logger[_0x7985('0x2c')](_0x7985('0x54'),_0x51b712);throw _0x51b712;});}return _0x7d54f;})[_0x7985('0x27')](respondWithResult(_0xb0df02,0xc9))[_0x7985('0x47')](handleError(_0xb0df02,null));};exports[_0x7985('0x26')]=function(_0x4f9f05,_0x2f973e){if(_0x4f9f05[_0x7985('0x4e')]['id']){delete _0x4f9f05[_0x7985('0x4e')]['id'];}return db[_0x7985('0x2f')][_0x7985('0x4c')]({'where':{'id':_0x4f9f05[_0x7985('0x55')]['id']}})[_0x7985('0x27')](handleEntityNotFound(_0x2f973e,null))[_0x7985('0x27')](saveUpdates(_0x4f9f05['body'],null))['then'](respondWithResult(_0x2f973e,null))[_0x7985('0x47')](handleError(_0x2f973e,null));};exports['destroy']=function(_0x3becaa,_0x9a580a){return db['VoiceChanSpy'][_0x7985('0x4c')]({'where':{'id':_0x3becaa[_0x7985('0x55')]['id']}})[_0x7985('0x27')](handleEntityNotFound(_0x9a580a,null))[_0x7985('0x27')](removeEntity(_0x9a580a,null))[_0x7985('0x47')](handleError(_0x9a580a,null));};
\ No newline at end of file
+var _0x7e10=['autoAssociation','error','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','count','offset','set','Content-Range','reject','update','then','destroy','get','ChanSpies','UserProfileResource','name','send','index','map','VoiceChanSpy','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','includeAll','include','findAll','rows','catch','show','params','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId'];(function(_0x5e1e25,_0xdc1421){var _0x548e5f=function(_0x576360){while(--_0x576360){_0x5e1e25['push'](_0x5e1e25['shift']());}};_0x548e5f(++_0xdc1421);}(_0x7e10,0x14e));var _0x07e1=function(_0x570c30,_0x5b9b5f){_0x570c30=_0x570c30-0x0;var _0x38b3e2=_0x7e10[_0x570c30];return _0x38b3e2;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x07e1('0x0'));var rimraf=require(_0x07e1('0x1'));var zipdir=require(_0x07e1('0x2'));var jsonpatch=require(_0x07e1('0x3'));var rp=require(_0x07e1('0x4'));var moment=require('moment');var BPromise=require(_0x07e1('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x07e1('0x6'));var sox=require(_0x07e1('0x7'));var csv=require('to-csv');var ejs=require(_0x07e1('0x8'));var fs=require('fs');var _=require(_0x07e1('0x9'));var squel=require(_0x07e1('0xa'));var crypto=require(_0x07e1('0xb'));var jsforce=require(_0x07e1('0xc'));var deskjs=require(_0x07e1('0xd'));var toCsv=require('to-csv');var querystring=require(_0x07e1('0xe'));var Papa=require(_0x07e1('0xf'));var Redis=require(_0x07e1('0x10'));var authService=require(_0x07e1('0x11'));var qs=require(_0x07e1('0x12'));var as=require(_0x07e1('0x13'));var hardwareService=require(_0x07e1('0x14'));var logger=require(_0x07e1('0x15'))(_0x07e1('0x16'));var utils=require(_0x07e1('0x17'));var config=require(_0x07e1('0x18'));var db=require(_0x07e1('0x19'))['db'];function respondWithStatusCode(_0x3a3eb1,_0x49b6c5){_0x49b6c5=_0x49b6c5||0xcc;return function(_0x549137){if(_0x549137){return _0x3a3eb1[_0x07e1('0x1a')](_0x49b6c5);}return _0x3a3eb1['status'](_0x49b6c5)[_0x07e1('0x1b')]();};}function respondWithResult(_0x45aac9,_0x1e8d6d){_0x1e8d6d=_0x1e8d6d||0xc8;return function(_0x491b26){if(_0x491b26){return _0x45aac9[_0x07e1('0x1c')](_0x1e8d6d)[_0x07e1('0x1d')](_0x491b26);}};}function respondWithFilteredResult(_0x4282b0,_0x1db8c7){return function(_0xc16d14){if(_0xc16d14){var _0x56a2bf=_0xc16d14[_0x07e1('0x1e')],_0x11ae34=_0x1db8c7[_0x07e1('0x1f')],_0x586d37=_0x1db8c7[_0x07e1('0x1f')]+_0x1db8c7['limit'],_0x35e17;if(_0x586d37>=_0x56a2bf){_0x586d37=_0x56a2bf;_0x35e17=0xc8;}else{_0x35e17=0xce;}_0x4282b0[_0x07e1('0x1c')](_0x35e17);return _0x4282b0[_0x07e1('0x20')](_0x07e1('0x21'),_0x11ae34+'-'+_0x586d37+'/'+_0x56a2bf)[_0x07e1('0x1d')](_0xc16d14);}return null;};}function patchUpdates(_0x2b0a17){return function(_0x18f0c3){try{jsonpatch['apply'](_0x18f0c3,_0x2b0a17,!![]);}catch(_0x219c98){return BPromise[_0x07e1('0x22')](_0x219c98);}return _0x18f0c3['save']();};}function saveUpdates(_0x384530,_0xbc4782){return function(_0x23e969){if(_0x23e969){return _0x23e969[_0x07e1('0x23')](_0x384530)[_0x07e1('0x24')](function(_0x579ecc){return _0x579ecc;});}return null;};}function removeEntity(_0x39b314,_0x52e511){return function(_0x25b033){if(_0x25b033){return _0x25b033[_0x07e1('0x25')]()[_0x07e1('0x24')](function(){var _0x4cd197=_0x25b033[_0x07e1('0x26')]({'plain':!![]});var _0x35c4fe=_0x07e1('0x27');return db[_0x07e1('0x28')]['destroy']({'where':{'type':_0x35c4fe,'resourceId':_0x4cd197['id']}})[_0x07e1('0x24')](function(){return _0x25b033;});})[_0x07e1('0x24')](function(){_0x39b314[_0x07e1('0x1c')](0xcc)[_0x07e1('0x1b')]();});}};}function handleEntityNotFound(_0x2b1279,_0x17d6c0){return function(_0x2fc75d){if(!_0x2fc75d){_0x2b1279[_0x07e1('0x1a')](0x194);}return _0x2fc75d;};}function handleError(_0x2c1436,_0x4ca54c){_0x4ca54c=_0x4ca54c||0x1f4;return function(_0x28d795){logger['error'](_0x28d795['stack']);if(_0x28d795['name']){delete _0x28d795[_0x07e1('0x29')];}_0x2c1436[_0x07e1('0x1c')](_0x4ca54c)[_0x07e1('0x2a')](_0x28d795);};}exports[_0x07e1('0x2b')]=function(_0x40aeeb,_0x26c6dd){var _0x3b6674={},_0x9ddcec={},_0x5e120={'count':0x0,'rows':[]};var _0x56346f=_[_0x07e1('0x2c')](db[_0x07e1('0x2d')][_0x07e1('0x2e')],function(_0x36418c){return{'name':_0x36418c[_0x07e1('0x2f')],'type':_0x36418c['type'][_0x07e1('0x30')]};});_0x9ddcec[_0x07e1('0x31')]=_[_0x07e1('0x2c')](_0x56346f,_0x07e1('0x29'));_0x9ddcec[_0x07e1('0x32')]=_[_0x07e1('0x33')](_0x40aeeb[_0x07e1('0x32')]);_0x9ddcec[_0x07e1('0x34')]=_[_0x07e1('0x35')](_0x9ddcec['model'],_0x9ddcec[_0x07e1('0x32')]);_0x3b6674[_0x07e1('0x36')]=_['intersection'](_0x9ddcec[_0x07e1('0x31')],qs[_0x07e1('0x37')](_0x40aeeb[_0x07e1('0x32')]['fields']));_0x3b6674[_0x07e1('0x36')]=_0x3b6674[_0x07e1('0x36')][_0x07e1('0x38')]?_0x3b6674[_0x07e1('0x36')]:_0x9ddcec[_0x07e1('0x31')];if(!_0x40aeeb[_0x07e1('0x32')][_0x07e1('0x39')](_0x07e1('0x3a'))){_0x3b6674[_0x07e1('0x3b')]=qs[_0x07e1('0x3b')](_0x40aeeb['query']['limit']);_0x3b6674[_0x07e1('0x1f')]=qs[_0x07e1('0x1f')](_0x40aeeb[_0x07e1('0x32')][_0x07e1('0x1f')]);}_0x3b6674[_0x07e1('0x3c')]=qs[_0x07e1('0x3d')](_0x40aeeb['query'][_0x07e1('0x3d')]);_0x3b6674[_0x07e1('0x3e')]=qs[_0x07e1('0x34')](_[_0x07e1('0x3f')](_0x40aeeb[_0x07e1('0x32')],_0x9ddcec[_0x07e1('0x34')]),_0x56346f);if(_0x40aeeb[_0x07e1('0x32')][_0x07e1('0x40')]){_0x3b6674[_0x07e1('0x3e')]=_[_0x07e1('0x41')](_0x3b6674[_0x07e1('0x3e')],{'$or':_[_0x07e1('0x2c')](_0x56346f,function(_0x55b8c8){if(_0x55b8c8['type']!=='VIRTUAL'){var _0x1694fc={};_0x1694fc[_0x55b8c8['name']]={'$like':'%'+_0x40aeeb[_0x07e1('0x32')][_0x07e1('0x40')]+'%'};return _0x1694fc;}})});}_0x3b6674=_[_0x07e1('0x41')]({},_0x3b6674,_0x40aeeb['options']);var _0x183fad={'where':_0x3b6674[_0x07e1('0x3e')]};return db['VoiceChanSpy'][_0x07e1('0x1e')](_0x183fad)[_0x07e1('0x24')](function(_0x3ed14e){_0x5e120[_0x07e1('0x1e')]=_0x3ed14e;if(_0x40aeeb[_0x07e1('0x32')][_0x07e1('0x42')]){_0x3b6674[_0x07e1('0x43')]=[{'all':!![]}];}return db[_0x07e1('0x2d')][_0x07e1('0x44')](_0x3b6674);})[_0x07e1('0x24')](function(_0xf2142a){_0x5e120[_0x07e1('0x45')]=_0xf2142a;return _0x5e120;})[_0x07e1('0x24')](respondWithFilteredResult(_0x26c6dd,_0x3b6674))[_0x07e1('0x46')](handleError(_0x26c6dd,null));};exports[_0x07e1('0x47')]=function(_0x5a915c,_0x247433){var _0x52fa32={'raw':![],'where':{'id':_0x5a915c[_0x07e1('0x48')]['id']}},_0x23b474={};_0x23b474[_0x07e1('0x31')]=_[_0x07e1('0x33')](db[_0x07e1('0x2d')][_0x07e1('0x2e')]);_0x23b474['query']=_['keys'](_0x5a915c[_0x07e1('0x32')]);_0x23b474[_0x07e1('0x34')]=_[_0x07e1('0x35')](_0x23b474['model'],_0x23b474[_0x07e1('0x32')]);_0x52fa32[_0x07e1('0x36')]=_[_0x07e1('0x35')](_0x23b474['model'],qs['fields'](_0x5a915c[_0x07e1('0x32')][_0x07e1('0x37')]));_0x52fa32[_0x07e1('0x36')]=_0x52fa32['attributes'][_0x07e1('0x38')]?_0x52fa32['attributes']:_0x23b474[_0x07e1('0x31')];if(_0x5a915c[_0x07e1('0x32')]['includeAll']){_0x52fa32[_0x07e1('0x43')]=[{'all':!![]}];}_0x52fa32=_[_0x07e1('0x41')]({},_0x52fa32,_0x5a915c[_0x07e1('0x49')]);return db['VoiceChanSpy'][_0x07e1('0x4a')](_0x52fa32)[_0x07e1('0x24')](handleEntityNotFound(_0x247433,null))[_0x07e1('0x24')](respondWithResult(_0x247433,null))[_0x07e1('0x46')](handleError(_0x247433,null));};exports[_0x07e1('0x4b')]=function(_0xce4eb1,_0x511024){return db['VoiceChanSpy'][_0x07e1('0x4b')](_0xce4eb1[_0x07e1('0x4c')],{})[_0x07e1('0x24')](function(_0x54598b){var _0x4b687c=_0xce4eb1[_0x07e1('0x4d')][_0x07e1('0x26')]({'plain':!![]});if(!_0x4b687c)throw new Error(_0x07e1('0x4e'));if(_0x4b687c[_0x07e1('0x4f')]===_0x07e1('0x4d')){var _0x40ba2e=_0x54598b[_0x07e1('0x26')]({'plain':!![]});var _0x2349ea='ChanSpies';return db['UserProfileSection'][_0x07e1('0x4a')]({'where':{'name':_0x2349ea,'userProfileId':_0x4b687c[_0x07e1('0x50')]},'raw':!![]})['then'](function(_0x554ba0){if(_0x554ba0&&_0x554ba0[_0x07e1('0x51')]===0x0){return db[_0x07e1('0x28')][_0x07e1('0x4b')]({'name':_0x40ba2e[_0x07e1('0x29')],'resourceId':_0x40ba2e['id'],'type':_0x554ba0[_0x07e1('0x29')],'sectionId':_0x554ba0['id']},{})['then'](function(){return _0x54598b;});}else{return _0x54598b;}})[_0x07e1('0x46')](function(_0x5da238){logger[_0x07e1('0x52')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5da238);throw _0x5da238;});}return _0x54598b;})[_0x07e1('0x24')](respondWithResult(_0x511024,0xc9))[_0x07e1('0x46')](handleError(_0x511024,null));};exports[_0x07e1('0x23')]=function(_0x539367,_0x3c8d22){if(_0x539367['body']['id']){delete _0x539367['body']['id'];}return db[_0x07e1('0x2d')]['find']({'where':{'id':_0x539367[_0x07e1('0x48')]['id']}})['then'](handleEntityNotFound(_0x3c8d22,null))[_0x07e1('0x24')](saveUpdates(_0x539367[_0x07e1('0x4c')],null))[_0x07e1('0x24')](respondWithResult(_0x3c8d22,null))[_0x07e1('0x46')](handleError(_0x3c8d22,null));};exports[_0x07e1('0x25')]=function(_0x28ba51,_0x1ec855){return db['VoiceChanSpy']['find']({'where':{'id':_0x28ba51['params']['id']}})[_0x07e1('0x24')](handleEntityNotFound(_0x1ec855,null))[_0x07e1('0x24')](removeEntity(_0x1ec855,null))[_0x07e1('0x46')](handleError(_0x1ec855,null));};
\ No newline at end of file
diff --git a/server/api/voiceChanSpy/voiceChanSpy.model.js b/server/api/voiceChanSpy/voiceChanSpy.model.js
index 40236c3..0d024b8 100644
--- a/server/api/voiceChanSpy/voiceChanSpy.model.js
+++ b/server/api/voiceChanSpy/voiceChanSpy.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x4c48=['system','merge','CDR(type)=%s','chanspy','record','push','${UNIQUEID}.%s,a','recordingFormat','Authenticate','password','SIP/%s,%s','options','StopMixMonitor','concat','internal','name','User','findAll','agent','then','catch','exports','define','VoiceChanSpy','voice_chanspy','length','VoiceExtension','bulkCreate','destroy','bluebird','./voiceChanSpy.attributes','context','from-sip','format','prefix'];(function(_0x4036d4,_0x5994ab){var _0x3bc2a4=function(_0x4303f7){while(--_0x4303f7){_0x4036d4['push'](_0x4036d4['shift']());}};_0x3bc2a4(++_0x5994ab);}(_0x4c48,0x1e4));var _0x84c4=function(_0xda6ad1,_0x5f09e3){_0xda6ad1=_0xda6ad1-0x0;var _0xedc3a5=_0x4c48[_0xda6ad1];return _0xedc3a5;};'use strict';var _=require('lodash');var util=require('util');var BPromise=require(_0x84c4('0x0'));var attributes=require(_0x84c4('0x1'));var getUserApplications=function(_0x35de8a,_0x1cb172,_0x4279a6){var _0x5524db=0x1;var _0x5302e8=[];var _0x14b669={'context':_0x1cb172[_0x84c4('0x2')]||_0x84c4('0x3'),'exten':util[_0x84c4('0x4')]('%s%s',_0x35de8a[_0x84c4('0x5')],_0x4279a6),'type':_0x84c4('0x6'),'isApp':![],'ChanSpyId':_0x35de8a['id'],'UserId':_0x1cb172['id']};_0x5302e8['push'](_[_0x84c4('0x7')]({'app':'Set','appdata':util['format'](_0x84c4('0x8'),_0x84c4('0x9')),'priority':_0x5524db++},_0x14b669));if(_0x35de8a[_0x84c4('0xa')]){_0x5302e8[_0x84c4('0xb')](_[_0x84c4('0x7')]({'app':'MixMonitor','appdata':util[_0x84c4('0x4')](_0x84c4('0xc'),_0x35de8a[_0x84c4('0xd')]),'priority':_0x5524db++},_0x14b669));}if(_0x35de8a['auth']){_0x5302e8[_0x84c4('0xb')](_[_0x84c4('0x7')]({'app':_0x84c4('0xe'),'appdata':_0x35de8a[_0x84c4('0xf')],'priority':_0x5524db++},_0x14b669));}_0x5302e8['push'](_[_0x84c4('0x7')]({'app':'ChanSpy','appdata':util[_0x84c4('0x4')](_0x84c4('0x10'),_0x1cb172['name'],_0x35de8a['options']?_0x35de8a[_0x84c4('0x11')]['join'](''):''),'priority':_0x5524db++},_0x14b669));if(_0x35de8a[_0x84c4('0xa')]){_0x5302e8[_0x84c4('0xb')](_['merge']({'app':_0x84c4('0x12'),'priority':_0x5524db++},_0x14b669));}return _0x5302e8;};var getChanSpyApplications=function(_0x3eb625,_0x27a4ef){var _0x430562=[];for(var _0x2e388a=0x0,_0xc94428=0x1;_0x2e388a<_0x27a4ef['length'];_0x2e388a++,_0xc94428=0x1){_0x430562=_0x430562[_0x84c4('0x13')](getUserApplications(_0x3eb625,_0x27a4ef[_0x2e388a],_0x27a4ef[_0x2e388a][_0x84c4('0x14')]));if(_0x27a4ef[_0x2e388a]['internal']!=_0x27a4ef[_0x2e388a]['name']){_0x430562=_0x430562[_0x84c4('0x13')](getUserApplications(_0x3eb625,_0x27a4ef[_0x2e388a],_0x27a4ef[_0x2e388a][_0x84c4('0x15')]));}}return _0x430562;};var getChanSpyPromise=function(_0x3de380,_0x27716d){return new BPromise(function(_0x20e3ef,_0x167ae){return _0x3de380[_0x84c4('0x16')][_0x84c4('0x17')]({'attributes':['id',_0x84c4('0x15'),_0x84c4('0x14')],'where':{'role':_0x84c4('0x18'),'chanspy':!![]},'raw':!![]})[_0x84c4('0x19')](function(_0x370ea9){if(_0x370ea9){return _0x20e3ef(getChanSpyApplications(_0x27716d,_0x370ea9));}return _0x20e3ef([]);})[_0x84c4('0x1a')](function(_0x5f1804){_0x167ae(_0x5f1804);});});};module[_0x84c4('0x1b')]=function(_0x2681e8,_0x2f8864){var _0x325780=_0x2681e8['models'];return _0x2681e8[_0x84c4('0x1c')](_0x84c4('0x1d'),attributes,{'tableName':_0x84c4('0x1e'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x5a8153,_0x16cf4b,_0x3cb8c6){return getChanSpyPromise(_0x325780,_0x5a8153)[_0x84c4('0x19')](function(_0x46c126){if(_0x46c126&&_0x46c126[_0x84c4('0x1f')]){return _0x325780[_0x84c4('0x20')][_0x84c4('0x21')](_0x46c126);}})[_0x84c4('0x19')](function(){_0x3cb8c6();})['catch'](function(_0x196d4d){_0x3cb8c6(_0x196d4d);});},'afterUpdate':function(_0x2e4911,_0x4091a6,_0x342309){return _0x325780[_0x84c4('0x20')][_0x84c4('0x22')]({'where':{'ChanSpyId':_0x2e4911['id']}})[_0x84c4('0x19')](function(){return getChanSpyPromise(_0x325780,_0x2e4911);})[_0x84c4('0x19')](function(_0x5c1b13){if(_0x5c1b13&&_0x5c1b13['length']){return _0x325780['VoiceExtension'][_0x84c4('0x21')](_0x5c1b13);}})[_0x84c4('0x19')](function(){_0x342309();})[_0x84c4('0x1a')](function(_0x39135c){_0x342309(_0x39135c);});},'afterDestroy':function(_0x454f3e,_0x2dccad,_0x14a96a){return _0x325780[_0x84c4('0x20')]['destroy']({'where':{'ChanSpyId':_0x454f3e['id']}})[_0x84c4('0x19')](function(){_0x14a96a();})['catch'](function(_0x1a750d){_0x14a96a(_0x1a750d);});}}});};
\ No newline at end of file
+var _0x63eb=['context','from-sip','format','%s%s','prefix','system','push','merge','Set','CDR(type)=%s','record','MixMonitor','recordingFormat','auth','password','SIP/%s,%s','name','options','join','StopMixMonitor','length','concat','internal','findAll','then','catch','exports','define','VoiceChanSpy','voice_chanspy','bulkCreate','VoiceExtension','destroy','lodash','util','bluebird','./voiceChanSpy.attributes'];(function(_0x226ad1,_0x2858e2){var _0x16b625=function(_0x4dc555){while(--_0x4dc555){_0x226ad1['push'](_0x226ad1['shift']());}};_0x16b625(++_0x2858e2);}(_0x63eb,0x90));var _0xb63e=function(_0x2b0973,_0xc46bce){_0x2b0973=_0x2b0973-0x0;var _0x45dac4=_0x63eb[_0x2b0973];return _0x45dac4;};'use strict';var _=require(_0xb63e('0x0'));var util=require(_0xb63e('0x1'));var BPromise=require(_0xb63e('0x2'));var attributes=require(_0xb63e('0x3'));var getUserApplications=function(_0x3aa2dc,_0x2968ac,_0x4e6d10){var _0x1b68cc=0x1;var _0x341ff1=[];var _0x3a40f6={'context':_0x2968ac[_0xb63e('0x4')]||_0xb63e('0x5'),'exten':util[_0xb63e('0x6')](_0xb63e('0x7'),_0x3aa2dc[_0xb63e('0x8')],_0x4e6d10),'type':_0xb63e('0x9'),'isApp':![],'ChanSpyId':_0x3aa2dc['id'],'UserId':_0x2968ac['id']};_0x341ff1[_0xb63e('0xa')](_[_0xb63e('0xb')]({'app':_0xb63e('0xc'),'appdata':util[_0xb63e('0x6')](_0xb63e('0xd'),'chanspy'),'priority':_0x1b68cc++},_0x3a40f6));if(_0x3aa2dc[_0xb63e('0xe')]){_0x341ff1['push'](_[_0xb63e('0xb')]({'app':_0xb63e('0xf'),'appdata':util[_0xb63e('0x6')]('${UNIQUEID}.%s,a',_0x3aa2dc[_0xb63e('0x10')]),'priority':_0x1b68cc++},_0x3a40f6));}if(_0x3aa2dc[_0xb63e('0x11')]){_0x341ff1[_0xb63e('0xa')](_[_0xb63e('0xb')]({'app':'Authenticate','appdata':_0x3aa2dc[_0xb63e('0x12')],'priority':_0x1b68cc++},_0x3a40f6));}_0x341ff1[_0xb63e('0xa')](_[_0xb63e('0xb')]({'app':'ChanSpy','appdata':util[_0xb63e('0x6')](_0xb63e('0x13'),_0x2968ac[_0xb63e('0x14')],_0x3aa2dc[_0xb63e('0x15')]?_0x3aa2dc['options'][_0xb63e('0x16')](''):''),'priority':_0x1b68cc++},_0x3a40f6));if(_0x3aa2dc[_0xb63e('0xe')]){_0x341ff1[_0xb63e('0xa')](_[_0xb63e('0xb')]({'app':_0xb63e('0x17'),'priority':_0x1b68cc++},_0x3a40f6));}return _0x341ff1;};var getChanSpyApplications=function(_0x52c5c7,_0xcfe001){var _0x45d6de=[];for(var _0x2221d9=0x0,_0x398544=0x1;_0x2221d9<_0xcfe001[_0xb63e('0x18')];_0x2221d9++,_0x398544=0x1){_0x45d6de=_0x45d6de[_0xb63e('0x19')](getUserApplications(_0x52c5c7,_0xcfe001[_0x2221d9],_0xcfe001[_0x2221d9]['internal']));if(_0xcfe001[_0x2221d9][_0xb63e('0x1a')]!=_0xcfe001[_0x2221d9][_0xb63e('0x14')]){_0x45d6de=_0x45d6de[_0xb63e('0x19')](getUserApplications(_0x52c5c7,_0xcfe001[_0x2221d9],_0xcfe001[_0x2221d9]['name']));}}return _0x45d6de;};var getChanSpyPromise=function(_0x43580e,_0x5bbcc3){return new BPromise(function(_0x5ac51e,_0x3210f2){return _0x43580e['User'][_0xb63e('0x1b')]({'attributes':['id',_0xb63e('0x14'),_0xb63e('0x1a')],'where':{'role':'agent','chanspy':!![]},'raw':!![]})[_0xb63e('0x1c')](function(_0x2d5ce6){if(_0x2d5ce6){return _0x5ac51e(getChanSpyApplications(_0x5bbcc3,_0x2d5ce6));}return _0x5ac51e([]);})[_0xb63e('0x1d')](function(_0x193d21){_0x3210f2(_0x193d21);});});};module[_0xb63e('0x1e')]=function(_0x580e8a,_0xc6cf48){var _0x4f4907=_0x580e8a['models'];return _0x580e8a[_0xb63e('0x1f')](_0xb63e('0x20'),attributes,{'tableName':_0xb63e('0x21'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x210ef4,_0x4eae0e,_0x261dbb){return getChanSpyPromise(_0x4f4907,_0x210ef4)['then'](function(_0x5abd5a){if(_0x5abd5a&&_0x5abd5a[_0xb63e('0x18')]){return _0x4f4907['VoiceExtension'][_0xb63e('0x22')](_0x5abd5a);}})[_0xb63e('0x1c')](function(){_0x261dbb();})['catch'](function(_0x2df49d){_0x261dbb(_0x2df49d);});},'afterUpdate':function(_0x3fd788,_0x5c82aa,_0x27b0ea){return _0x4f4907[_0xb63e('0x23')]['destroy']({'where':{'ChanSpyId':_0x3fd788['id']}})[_0xb63e('0x1c')](function(){return getChanSpyPromise(_0x4f4907,_0x3fd788);})['then'](function(_0x1f4171){if(_0x1f4171&&_0x1f4171[_0xb63e('0x18')]){return _0x4f4907['VoiceExtension'][_0xb63e('0x22')](_0x1f4171);}})[_0xb63e('0x1c')](function(){_0x27b0ea();})['catch'](function(_0x57fa8b){_0x27b0ea(_0x57fa8b);});},'afterDestroy':function(_0x293faf,_0x24452d,_0x250588){return _0x4f4907[_0xb63e('0x23')][_0xb63e('0x24')]({'where':{'ChanSpyId':_0x293faf['id']}})[_0xb63e('0x1c')](function(){_0x250588();})[_0xb63e('0x1d')](function(_0x507564){_0x250588(_0x507564);});}}});};
\ No newline at end of file
diff --git a/server/api/voiceChanSpy/voiceChanSpy.rpc.js b/server/api/voiceChanSpy/voiceChanSpy.rpc.js
index 8de752b..599fd10 100644
--- a/server/api/voiceChanSpy/voiceChanSpy.rpc.js
+++ b/server/api/voiceChanSpy/voiceChanSpy.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x6bee=['info','request\x20sent','debug','VoiceChanSpy,\x20%s,\x20%s,\x20%s','stringify','error','code','VoiceChanSpy,\x20%s,\x20%s','message','result','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then'];(function(_0x3edb26,_0x9613b4){var _0x4ad9f5=function(_0x5cb828){while(--_0x5cb828){_0x3edb26['push'](_0x3edb26['shift']());}};_0x4ad9f5(++_0x9613b4);}(_0x6bee,0x163));var _0xe6be=function(_0x77a862,_0x8e62be){_0x77a862=_0x77a862-0x0;var _0x3ecaf1=_0x6bee[_0x77a862];return _0x3ecaf1;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xe6be('0x0'));var BPromise=require(_0xe6be('0x1'));var rs=require(_0xe6be('0x2'));var fs=require('fs');var Redis=require(_0xe6be('0x3'));var db=require(_0xe6be('0x4'))['db'];var utils=require(_0xe6be('0x5'));var logger=require(_0xe6be('0x6'))(_0xe6be('0x7'));var config=require(_0xe6be('0x8'));var jayson=require(_0xe6be('0x9'));var client=jayson['client'][_0xe6be('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5d20c2,_0x4367cc,_0x159fc5){return new BPromise(function(_0x1a1085,_0x4f73a3){return client[_0xe6be('0xb')](_0x5d20c2,_0x159fc5)[_0xe6be('0xc')](function(_0x45df8f){logger[_0xe6be('0xd')]('VoiceChanSpy,\x20%s,\x20%s',_0x4367cc,_0xe6be('0xe'));logger[_0xe6be('0xf')](_0xe6be('0x10'),_0x4367cc,_0xe6be('0xe'),JSON[_0xe6be('0x11')](_0x45df8f));if(_0x45df8f[_0xe6be('0x12')]){if(_0x45df8f[_0xe6be('0x12')][_0xe6be('0x13')]===0x1f4){logger['error'](_0xe6be('0x14'),_0x4367cc,_0x45df8f[_0xe6be('0x12')][_0xe6be('0x15')]);return _0x4f73a3(_0x45df8f['error'][_0xe6be('0x15')]);}logger[_0xe6be('0x12')](_0xe6be('0x14'),_0x4367cc,_0x45df8f[_0xe6be('0x12')]['message']);return _0x1a1085(_0x45df8f['error']['message']);}else{logger['info']('VoiceChanSpy,\x20%s,\x20%s',_0x4367cc,_0xe6be('0xe'));_0x1a1085(_0x45df8f[_0xe6be('0x16')]['message']);}})['catch'](function(_0x4a3390){logger['error']('VoiceChanSpy,\x20%s,\x20%s',_0x4367cc,_0x4a3390);_0x4f73a3(_0x4a3390);});});}
\ No newline at end of file
+var _0x984e=['http','request','then','info','VoiceChanSpy,\x20%s,\x20%s','request\x20sent','debug','VoiceChanSpy,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc'];(function(_0x3e4791,_0x477c42){var _0x1a19c0=function(_0x4d05de){while(--_0x4d05de){_0x3e4791['push'](_0x3e4791['shift']());}};_0x1a19c0(++_0x477c42);}(_0x984e,0x1f0));var _0xe984=function(_0x4cb72c,_0x2ec371){_0x4cb72c=_0x4cb72c-0x0;var _0x203965=_0x984e[_0x4cb72c];return _0x203965;};'use strict';var _=require(_0xe984('0x0'));var util=require(_0xe984('0x1'));var moment=require(_0xe984('0x2'));var BPromise=require(_0xe984('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe984('0x4'));var db=require(_0xe984('0x5'))['db'];var utils=require(_0xe984('0x6'));var logger=require('../../config/logger')(_0xe984('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0xe984('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1097aa,_0x17e640,_0x4725a2){return new BPromise(function(_0x395f30,_0x1c0630){return client[_0xe984('0x9')](_0x1097aa,_0x4725a2)[_0xe984('0xa')](function(_0x1b8d5b){logger[_0xe984('0xb')](_0xe984('0xc'),_0x17e640,_0xe984('0xd'));logger[_0xe984('0xe')](_0xe984('0xf'),_0x17e640,'request\x20sent',JSON[_0xe984('0x10')](_0x1b8d5b));if(_0x1b8d5b[_0xe984('0x11')]){if(_0x1b8d5b['error'][_0xe984('0x12')]===0x1f4){logger[_0xe984('0x11')]('VoiceChanSpy,\x20%s,\x20%s',_0x17e640,_0x1b8d5b[_0xe984('0x11')][_0xe984('0x13')]);return _0x1c0630(_0x1b8d5b[_0xe984('0x11')]['message']);}logger[_0xe984('0x11')](_0xe984('0xc'),_0x17e640,_0x1b8d5b['error'][_0xe984('0x13')]);return _0x395f30(_0x1b8d5b[_0xe984('0x11')][_0xe984('0x13')]);}else{logger[_0xe984('0xb')](_0xe984('0xc'),_0x17e640,_0xe984('0xd'));_0x395f30(_0x1b8d5b[_0xe984('0x14')][_0xe984('0x13')]);}})['catch'](function(_0x131292){logger['error'](_0xe984('0xc'),_0x17e640,_0x131292);_0x1c0630(_0x131292);});});}
\ No newline at end of file
diff --git a/server/api/voiceContext/index.js b/server/api/voiceContext/index.js
index 251b84f..c601411 100644
--- a/server/api/voiceContext/index.js
+++ b/server/api/voiceContext/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x1550=['put','update','delete','destroy','exports','util','path','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceContext.controller','get','index','/:id','isAuthenticated','show','post'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1550,0x1a3));var _0x0155=function(_0x184c7d,_0x38513e){_0x184c7d=_0x184c7d-0x0;var _0x57564d=_0x1550[_0x184c7d];return _0x57564d;};'use strict';var multer=require('multer');var util=require(_0x0155('0x0'));var path=require(_0x0155('0x1'));var timeout=require(_0x0155('0x2'));var express=require('express');var router=express['Router']();var auth=require(_0x0155('0x3'));var interaction=require(_0x0155('0x4'));var config=require(_0x0155('0x5'));var controller=require(_0x0155('0x6'));router[_0x0155('0x7')]('/',auth['isAuthenticated'](),controller[_0x0155('0x8')]);router[_0x0155('0x7')](_0x0155('0x9'),auth[_0x0155('0xa')](),controller[_0x0155('0xb')]);router[_0x0155('0xc')]('/',auth[_0x0155('0xa')](),controller['create']);router[_0x0155('0xd')](_0x0155('0x9'),auth[_0x0155('0xa')](),controller[_0x0155('0xe')]);router[_0x0155('0xf')](_0x0155('0x9'),auth[_0x0155('0xa')](),controller[_0x0155('0x10')]);module[_0x0155('0x11')]=router;
\ No newline at end of file
+var _0xb020=['../../components/interaction/service','../../config/environment','./voiceContext.controller','get','isAuthenticated','index','show','put','/:id','update','delete','destroy','exports','util','path','connect-timeout','express','Router','../../components/auth/service'];(function(_0x301b43,_0x4f2a0c){var _0x50d165=function(_0x388c88){while(--_0x388c88){_0x301b43['push'](_0x301b43['shift']());}};_0x50d165(++_0x4f2a0c);}(_0xb020,0x1d5));var _0x0b02=function(_0x1a809b,_0x4c15e3){_0x1a809b=_0x1a809b-0x0;var _0x5d90e6=_0xb020[_0x1a809b];return _0x5d90e6;};'use strict';var multer=require('multer');var util=require(_0x0b02('0x0'));var path=require(_0x0b02('0x1'));var timeout=require(_0x0b02('0x2'));var express=require(_0x0b02('0x3'));var router=express[_0x0b02('0x4')]();var auth=require(_0x0b02('0x5'));var interaction=require(_0x0b02('0x6'));var config=require(_0x0b02('0x7'));var controller=require(_0x0b02('0x8'));router[_0x0b02('0x9')]('/',auth[_0x0b02('0xa')](),controller[_0x0b02('0xb')]);router['get']('/:id',auth[_0x0b02('0xa')](),controller[_0x0b02('0xc')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x0b02('0xd')](_0x0b02('0xe'),auth[_0x0b02('0xa')](),controller[_0x0b02('0xf')]);router[_0x0b02('0x10')](_0x0b02('0xe'),auth[_0x0b02('0xa')](),controller[_0x0b02('0x11')]);module[_0x0b02('0x12')]=router;
\ No newline at end of file
diff --git a/server/api/voiceContext/voiceContext.attributes.js b/server/api/voiceContext/voiceContext.attributes.js
index 8bb84ad..fcccf1b 100644
--- a/server/api/voiceContext/voiceContext.attributes.js
+++ b/server/api/voiceContext/voiceContext.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9c44=['BOOLEAN','STRING','name'];(function(_0x24d242,_0x1a0f09){var _0x18ae14=function(_0x94d79a){while(--_0x94d79a){_0x24d242['push'](_0x24d242['shift']());}};_0x18ae14(++_0x1a0f09);}(_0x9c44,0x178));var _0x49c4=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9c44[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x49c4('0x0')],'unique':_0x49c4('0x1')},'description':{'type':Sequelize[_0x49c4('0x0')],'allowNull':!![]},'defaultEntry':{'type':Sequelize[_0x49c4('0x2')],'defaultValue':0x0}};
\ No newline at end of file
+var _0x3e74=['name','sequelize','STRING'];(function(_0x30552e,_0x183bd0){var _0x473d3a=function(_0x254143){while(--_0x254143){_0x30552e['push'](_0x30552e['shift']());}};_0x473d3a(++_0x183bd0);}(_0x3e74,0x175));var _0x43e7=function(_0x11fffb,_0x170699){_0x11fffb=_0x11fffb-0x0;var _0x380ed4=_0x3e74[_0x11fffb];return _0x380ed4;};'use strict';var Sequelize=require(_0x43e7('0x0'));module['exports']={'name':{'type':Sequelize[_0x43e7('0x1')],'unique':_0x43e7('0x2')},'description':{'type':Sequelize[_0x43e7('0x1')],'allowNull':!![]},'defaultEntry':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0}};
\ No newline at end of file
diff --git a/server/api/voiceContext/voiceContext.controller.js b/server/api/voiceContext/voiceContext.controller.js
index 4f151eb..607bfbd 100644
--- a/server/api/voiceContext/voiceContext.controller.js
+++ b/server/api/voiceContext/voiceContext.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x55ca=['ejs','lodash','crypto','jsforce','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','VoiceContext,\x20%s,\x20%s','debug','VoiceContext,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','sendStatus','status','end','count','offset','limit','set','json','apply','reject','save','update','get','Contexts','UserProfileResource','destroy','name','index','map','VoiceContext','fieldName','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','order','where','filter','merge','type','VIRTUAL','options','includeAll','rows','catch','show','params','keys','rawAttributes','find','create','body','readFileSync','join','root','server/files/templates/context.ejs','utf8','writeFileSync','/etc/asterisk/extensions_xcally_contexts.conf','Reload','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','findAll','render','chan_sip.so','html-pdf','eml-format','request-promise','moment','mustache','util','path','sox','to-csv'];(function(_0x23ddcd,_0x1cdbad){var _0x58e43a=function(_0x458540){while(--_0x458540){_0x23ddcd['push'](_0x23ddcd['shift']());}};_0x58e43a(++_0x1cdbad);}(_0x55ca,0x126));var _0xa55c=function(_0x3358ba,_0x24c5fc){_0x3358ba=_0x3358ba-0x0;var _0x296e73=_0x55ca[_0x3358ba];return _0x296e73;};'use strict';var pdf=require(_0xa55c('0x0'));var emlformat=require(_0xa55c('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xa55c('0x2'));var moment=require(_0xa55c('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xa55c('0x4'));var util=require(_0xa55c('0x5'));var path=require(_0xa55c('0x6'));var sox=require(_0xa55c('0x7'));var csv=require(_0xa55c('0x8'));var ejs=require(_0xa55c('0x9'));var fs=require('fs');var _=require(_0xa55c('0xa'));var squel=require('squel');var crypto=require(_0xa55c('0xb'));var jsforce=require(_0xa55c('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xa55c('0x8'));var querystring=require(_0xa55c('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xa55c('0xe'));var qs=require(_0xa55c('0xf'));var as=require(_0xa55c('0x10'));var hardwareService=require(_0xa55c('0x11'));var logger=require(_0xa55c('0x12'))(_0xa55c('0x13'));var utils=require(_0xa55c('0x14'));var config=require(_0xa55c('0x15'));var db=require(_0xa55c('0x16'))['db'];var jayson=require(_0xa55c('0x17'));var client=jayson['client']['http']({'port':0x232a});function checkPasswordPattern(_0x2a35be,_0x576044,_0x5a3672){if(_0x5a3672){var _0x59ea8d=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x59ea8d[_0xa55c('0x18')](_0x576044)){return _0x2a35be;}else{throw new db[(_0xa55c('0x19'))][(_0xa55c('0x1a'))](_0xa55c('0x1b'));}}else{return _0x2a35be;}}function respondWithRpcPromise(_0x458480,_0x247e77,_0x4e0b2f,_0x3ccf65){return new BPromise(function(_0x3dcf4f,_0x25934f){var _0x31e10d=_0x3ccf65||client;return _0x31e10d[_0xa55c('0x1c')](_0x458480,_0x4e0b2f)[_0xa55c('0x1d')](function(_0x51590e){logger[_0xa55c('0x1e')](_0xa55c('0x1f'),_0x247e77,'request\x20sent');logger[_0xa55c('0x20')](_0xa55c('0x21'),_0x247e77,_0xa55c('0x22'),JSON[_0xa55c('0x23')](_0x51590e));if(_0x51590e[_0xa55c('0x24')]){if(_0x51590e[_0xa55c('0x24')]['code']===0x1f4){logger['error'](_0xa55c('0x1f'),_0x247e77,_0x51590e[_0xa55c('0x24')][_0xa55c('0x25')]);return _0x25934f(_0x51590e['error'][_0xa55c('0x25')]);}logger[_0xa55c('0x24')]('VoiceContext,\x20%s,\x20%s',_0x247e77,_0x51590e[_0xa55c('0x24')][_0xa55c('0x25')]);return _0x3dcf4f(_0x51590e[_0xa55c('0x24')][_0xa55c('0x25')]);}else{logger[_0xa55c('0x1e')]('VoiceContext,\x20%s,\x20%s',_0x247e77,_0xa55c('0x22'));_0x3dcf4f(_0x51590e['result']['message']);}})['catch'](function(_0x19ae88){logger['error'](_0xa55c('0x1f'),_0x247e77,_0x19ae88);_0x25934f(_0x19ae88);});});}function respondWithStatusCode(_0x190757,_0x3f64de){_0x3f64de=_0x3f64de||0xcc;return function(_0xf0e574){if(_0xf0e574){return _0x190757[_0xa55c('0x26')](_0x3f64de);}return _0x190757[_0xa55c('0x27')](_0x3f64de)[_0xa55c('0x28')]();};}function respondWithResult(_0x11e7f7,_0x192df2){_0x192df2=_0x192df2||0xc8;return function(_0x3cd152){if(_0x3cd152){return _0x11e7f7[_0xa55c('0x27')](_0x192df2)['json'](_0x3cd152);}};}function respondWithFilteredResult(_0x430d55,_0x28814f){return function(_0x1c9f6b){if(_0x1c9f6b){var _0x906caa=_0x1c9f6b[_0xa55c('0x29')],_0x5d940d=_0x28814f[_0xa55c('0x2a')],_0x1377b0=_0x28814f[_0xa55c('0x2a')]+_0x28814f[_0xa55c('0x2b')],_0x22f6b6;if(_0x1377b0>=_0x906caa){_0x1377b0=_0x906caa;_0x22f6b6=0xc8;}else{_0x22f6b6=0xce;}_0x430d55['status'](_0x22f6b6);return _0x430d55[_0xa55c('0x2c')]('Content-Range',_0x5d940d+'-'+_0x1377b0+'/'+_0x906caa)[_0xa55c('0x2d')](_0x1c9f6b);}return null;};}function patchUpdates(_0x1d730b){return function(_0x1cc53e){try{jsonpatch[_0xa55c('0x2e')](_0x1cc53e,_0x1d730b,!![]);}catch(_0x4d8416){return BPromise[_0xa55c('0x2f')](_0x4d8416);}return _0x1cc53e[_0xa55c('0x30')]();};}function saveUpdates(_0x331e58,_0x20da31){return function(_0x10f4b7){if(_0x10f4b7){return _0x10f4b7[_0xa55c('0x31')](_0x331e58)[_0xa55c('0x1d')](function(_0x24d44d){return _0x24d44d;});}return null;};}function removeEntity(_0x2808e9,_0xcbaf2e){return function(_0x197099){if(_0x197099){return _0x197099['destroy']()['then'](function(){var _0x4146f3=_0x197099[_0xa55c('0x32')]({'plain':!![]});var _0x4932d0=_0xa55c('0x33');return db[_0xa55c('0x34')][_0xa55c('0x35')]({'where':{'type':_0x4932d0,'resourceId':_0x4146f3['id']}})[_0xa55c('0x1d')](function(){return _0x197099;});})[_0xa55c('0x1d')](function(){_0x2808e9[_0xa55c('0x27')](0xcc)[_0xa55c('0x28')]();});}};}function handleEntityNotFound(_0x222d4b,_0x3959e3){return function(_0x53590c){if(!_0x53590c){_0x222d4b['sendStatus'](0x194);}return _0x53590c;};}function handleError(_0x4b23d3,_0x3fd75f){_0x3fd75f=_0x3fd75f||0x1f4;return function(_0x18e00e){logger[_0xa55c('0x24')](_0x18e00e['stack']);if(_0x18e00e[_0xa55c('0x36')]){delete _0x18e00e['name'];}_0x4b23d3[_0xa55c('0x27')](_0x3fd75f)['send'](_0x18e00e);};}exports[_0xa55c('0x37')]=function(_0x39267c,_0x3c0ec1){var _0x4d3eb5={},_0x7c4a47={},_0x30f23b={'count':0x0,'rows':[]};var _0x47e93c=_[_0xa55c('0x38')](db[_0xa55c('0x39')]['rawAttributes'],function(_0x529ff8){return{'name':_0x529ff8[_0xa55c('0x3a')],'type':_0x529ff8['type'][_0xa55c('0x3b')]};});_0x7c4a47[_0xa55c('0x3c')]=_['map'](_0x47e93c,'name');_0x7c4a47['query']=_['keys'](_0x39267c[_0xa55c('0x3d')]);_0x7c4a47[_0xa55c('0x3e')]=_[_0xa55c('0x3f')](_0x7c4a47[_0xa55c('0x3c')],_0x7c4a47[_0xa55c('0x3d')]);_0x4d3eb5['attributes']=_[_0xa55c('0x3f')](_0x7c4a47[_0xa55c('0x3c')],qs[_0xa55c('0x40')](_0x39267c[_0xa55c('0x3d')][_0xa55c('0x40')]));_0x4d3eb5[_0xa55c('0x41')]=_0x4d3eb5['attributes'][_0xa55c('0x42')]?_0x4d3eb5['attributes']:_0x7c4a47['model'];if(!_0x39267c[_0xa55c('0x3d')][_0xa55c('0x43')]('nolimit')){_0x4d3eb5[_0xa55c('0x2b')]=qs['limit'](_0x39267c['query'][_0xa55c('0x2b')]);_0x4d3eb5[_0xa55c('0x2a')]=qs[_0xa55c('0x2a')](_0x39267c['query'][_0xa55c('0x2a')]);}_0x4d3eb5[_0xa55c('0x44')]=qs['sort'](_0x39267c[_0xa55c('0x3d')]['sort']);_0x4d3eb5[_0xa55c('0x45')]=qs[_0xa55c('0x3e')](_['pick'](_0x39267c[_0xa55c('0x3d')],_0x7c4a47[_0xa55c('0x3e')]),_0x47e93c);if(_0x39267c['query'][_0xa55c('0x46')]){_0x4d3eb5[_0xa55c('0x45')]=_[_0xa55c('0x47')](_0x4d3eb5['where'],{'$or':_[_0xa55c('0x38')](_0x47e93c,function(_0x582901){if(_0x582901[_0xa55c('0x48')]!==_0xa55c('0x49')){var _0x451269={};_0x451269[_0x582901['name']]={'$like':'%'+_0x39267c[_0xa55c('0x3d')][_0xa55c('0x46')]+'%'};return _0x451269;}})});}_0x4d3eb5=_['merge']({},_0x4d3eb5,_0x39267c[_0xa55c('0x4a')]);var _0x931907={'where':_0x4d3eb5['where']};return db[_0xa55c('0x39')][_0xa55c('0x29')](_0x931907)['then'](function(_0x46f839){_0x30f23b[_0xa55c('0x29')]=_0x46f839;if(_0x39267c[_0xa55c('0x3d')][_0xa55c('0x4b')]){_0x4d3eb5['include']=[{'all':!![]}];}return db[_0xa55c('0x39')]['findAll'](_0x4d3eb5);})[_0xa55c('0x1d')](function(_0x213100){_0x30f23b[_0xa55c('0x4c')]=_0x213100;return _0x30f23b;})['then'](respondWithFilteredResult(_0x3c0ec1,_0x4d3eb5))[_0xa55c('0x4d')](handleError(_0x3c0ec1,null));};exports[_0xa55c('0x4e')]=function(_0x574fe9,_0x5be06){var _0x34de95={'raw':![],'where':{'id':_0x574fe9[_0xa55c('0x4f')]['id']}},_0x3822b7={};_0x3822b7[_0xa55c('0x3c')]=_[_0xa55c('0x50')](db[_0xa55c('0x39')][_0xa55c('0x51')]);_0x3822b7[_0xa55c('0x3d')]=_[_0xa55c('0x50')](_0x574fe9['query']);_0x3822b7[_0xa55c('0x3e')]=_[_0xa55c('0x3f')](_0x3822b7[_0xa55c('0x3c')],_0x3822b7['query']);_0x34de95[_0xa55c('0x41')]=_[_0xa55c('0x3f')](_0x3822b7['model'],qs[_0xa55c('0x40')](_0x574fe9['query'][_0xa55c('0x40')]));_0x34de95[_0xa55c('0x41')]=_0x34de95[_0xa55c('0x41')][_0xa55c('0x42')]?_0x34de95[_0xa55c('0x41')]:_0x3822b7['model'];if(_0x574fe9[_0xa55c('0x3d')][_0xa55c('0x4b')]){_0x34de95['include']=[{'all':!![]}];}_0x34de95=_[_0xa55c('0x47')]({},_0x34de95,_0x574fe9[_0xa55c('0x4a')]);return db[_0xa55c('0x39')][_0xa55c('0x52')](_0x34de95)['then'](handleEntityNotFound(_0x5be06,null))['then'](respondWithResult(_0x5be06,null))[_0xa55c('0x4d')](handleError(_0x5be06,null));};exports[_0xa55c('0x53')]=function(_0x3ca5b8,_0x44ac57,_0x54cbde){var _0x30c0c9;return db['VoiceContext'][_0xa55c('0x53')](_0x3ca5b8[_0xa55c('0x54')],{'raw':!![]})[_0xa55c('0x1d')](function(_0x2ccfb1){_0x30c0c9=_0x2ccfb1;return db[_0xa55c('0x39')]['findAll']({'raw':!![]});})[_0xa55c('0x1d')](function(_0x54f776){var _0x23f67f=fs[_0xa55c('0x55')](path[_0xa55c('0x56')](config[_0xa55c('0x57')],_0xa55c('0x58')),_0xa55c('0x59'));var _0x5d14e0=ejs['render'](_0x23f67f,{'contexts':_0x54f776||[]});fs[_0xa55c('0x5a')](_0xa55c('0x5b'),_0x5d14e0);})[_0xa55c('0x1d')](function(){return respondWithRpcPromise(_0xa55c('0x5c'),_0xa55c('0x53'),{'module':'chan_sip.so'});})[_0xa55c('0x1d')](function(){var _0x3cd40d=_0x3ca5b8[_0xa55c('0x5d')][_0xa55c('0x32')]({'plain':!![]});if(!_0x3cd40d)throw new Error(_0xa55c('0x5e'));if(_0x3cd40d['role']===_0xa55c('0x5d')){var _0x21725b=_0x30c0c9[_0xa55c('0x32')]({'plain':!![]});return db[_0xa55c('0x5f')][_0xa55c('0x52')]({'where':{'name':'Contexts','userProfileId':_0x3cd40d[_0xa55c('0x60')]},'raw':!![]})['then'](function(_0x2e482a){if(_0x2e482a&&_0x2e482a['autoAssociation']===0x0){return db[_0xa55c('0x34')]['create']({'name':_0x21725b[_0xa55c('0x36')],'resourceId':_0x21725b['id'],'type':_0x2e482a[_0xa55c('0x36')],'sectionId':_0x2e482a['id']},{})[_0xa55c('0x1d')](function(){return _0x30c0c9;});}else{return _0x30c0c9;}})[_0xa55c('0x4d')](function(_0x4cb38c){logger[_0xa55c('0x24')](_0xa55c('0x61'),_0x4cb38c);throw _0x4cb38c;});}return _0x30c0c9;})[_0xa55c('0x1d')](respondWithResult(_0x44ac57,0xc9))[_0xa55c('0x4d')](handleError(_0x44ac57,null));};exports[_0xa55c('0x31')]=function(_0x51c736,_0x150a07,_0x311bb9){var _0x4ef914;return db[_0xa55c('0x39')][_0xa55c('0x52')]({'where':{'id':_0x51c736[_0xa55c('0x4f')]['id']}})[_0xa55c('0x1d')](handleEntityNotFound(_0x150a07,null))[_0xa55c('0x1d')](saveUpdates(_0x51c736[_0xa55c('0x54')],null))[_0xa55c('0x1d')](function(_0x202191){if(_0x202191){_0x4ef914=_0x202191;return db['VoiceContext'][_0xa55c('0x62')]({'raw':!![]});}})[_0xa55c('0x1d')](function(_0x39861f){var _0xd309a9=fs[_0xa55c('0x55')](path[_0xa55c('0x56')](config[_0xa55c('0x57')],_0xa55c('0x58')),_0xa55c('0x59'));var _0x4a08ca=ejs[_0xa55c('0x63')](_0xd309a9,{'contexts':_0x39861f||[]});fs[_0xa55c('0x5a')](_0xa55c('0x5b'),_0x4a08ca);})[_0xa55c('0x1d')](function(){return respondWithRpcPromise(_0xa55c('0x5c'),_0xa55c('0x31'),{'module':_0xa55c('0x64')});})[_0xa55c('0x1d')](function(){return _0x4ef914;})[_0xa55c('0x1d')](respondWithResult(_0x150a07,null))[_0xa55c('0x4d')](handleError(_0x150a07,null));};exports[_0xa55c('0x35')]=function(_0x5c598a,_0xe42233,_0x531eee){var _0x1228a4;return db[_0xa55c('0x39')][_0xa55c('0x52')]({'where':{'id':_0x5c598a['params']['id']}})['then'](handleEntityNotFound(_0xe42233,null))[_0xa55c('0x1d')](removeEntity(_0xe42233,null))[_0xa55c('0x1d')](function(){return db[_0xa55c('0x39')][_0xa55c('0x62')]({'raw':!![]});})['then'](function(_0x149cb9){var _0xd02251=fs[_0xa55c('0x55')](path[_0xa55c('0x56')](config[_0xa55c('0x57')],'server/files/templates/context.ejs'),'utf8');var _0x3f7fca=ejs[_0xa55c('0x63')](_0xd02251,{'contexts':_0x149cb9});fs[_0xa55c('0x5a')](_0xa55c('0x5b'),_0x3f7fca);return respondWithRpcPromise(_0xa55c('0x5c'),'destroy',{'module':_0xa55c('0x64')});})[_0xa55c('0x4d')](handleError(_0xe42233,null));};
\ No newline at end of file
+var _0x9957=['attributes','fields','hasOwnProperty','limit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','length','find','create','body','readFileSync','join','root','render','writeFileSync','/etc/asterisk/extensions_xcally_contexts.conf','Reload','chan_sip.so','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','Contexts','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','destroy','server/files/templates/context.ejs','utf8','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../mysqldb','jayson/promise','client','http','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','then','info','VoiceContext,\x20%s,\x20%s','request\x20sent','debug','stringify','code','error','message','result','catch','sendStatus','status','end','json','count','offset','set','Content-Range','apply','save','update','get','UserProfileResource','stack','name','index','map','VoiceContext','rawAttributes','type','key','model','query','keys','filters','intersection'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x9957,0x93));var _0x7995=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0x9957[_0x618414];return _0x21c19a;};'use strict';var pdf=require(_0x7995('0x0'));var emlformat=require(_0x7995('0x1'));var rimraf=require(_0x7995('0x2'));var zipdir=require(_0x7995('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7995('0x4'));var moment=require(_0x7995('0x5'));var BPromise=require(_0x7995('0x6'));var Mustache=require(_0x7995('0x7'));var util=require('util');var path=require(_0x7995('0x8'));var sox=require(_0x7995('0x9'));var csv=require(_0x7995('0xa'));var ejs=require(_0x7995('0xb'));var fs=require('fs');var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var db=require(_0x7995('0x19'))['db'];var jayson=require(_0x7995('0x1a'));var client=jayson[_0x7995('0x1b')][_0x7995('0x1c')]({'port':0x232a});function checkPasswordPattern(_0x281576,_0x23999f,_0x2bbe7a){if(_0x2bbe7a){var _0x4cc004=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x4cc004['test'](_0x23999f)){return _0x281576;}else{throw new db[(_0x7995('0x1d'))][(_0x7995('0x1e'))](_0x7995('0x1f'));}}else{return _0x281576;}}function respondWithRpcPromise(_0x321ae8,_0x3f1d3e,_0x1a5310,_0x2202ce){return new BPromise(function(_0x41cbf0,_0x5377e5){var _0x2eeacc=_0x2202ce||client;return _0x2eeacc['request'](_0x321ae8,_0x1a5310)[_0x7995('0x20')](function(_0x37f297){logger[_0x7995('0x21')](_0x7995('0x22'),_0x3f1d3e,_0x7995('0x23'));logger[_0x7995('0x24')]('VoiceContext,\x20%s,\x20%s,\x20%s',_0x3f1d3e,'request\x20sent',JSON[_0x7995('0x25')](_0x37f297));if(_0x37f297['error']){if(_0x37f297['error'][_0x7995('0x26')]===0x1f4){logger[_0x7995('0x27')]('VoiceContext,\x20%s,\x20%s',_0x3f1d3e,_0x37f297[_0x7995('0x27')]['message']);return _0x5377e5(_0x37f297['error'][_0x7995('0x28')]);}logger[_0x7995('0x27')](_0x7995('0x22'),_0x3f1d3e,_0x37f297[_0x7995('0x27')][_0x7995('0x28')]);return _0x41cbf0(_0x37f297[_0x7995('0x27')]['message']);}else{logger[_0x7995('0x21')](_0x7995('0x22'),_0x3f1d3e,_0x7995('0x23'));_0x41cbf0(_0x37f297[_0x7995('0x29')][_0x7995('0x28')]);}})[_0x7995('0x2a')](function(_0x475351){logger[_0x7995('0x27')]('VoiceContext,\x20%s,\x20%s',_0x3f1d3e,_0x475351);_0x5377e5(_0x475351);});});}function respondWithStatusCode(_0x39df42,_0x34e70c){_0x34e70c=_0x34e70c||0xcc;return function(_0x401dc3){if(_0x401dc3){return _0x39df42[_0x7995('0x2b')](_0x34e70c);}return _0x39df42[_0x7995('0x2c')](_0x34e70c)[_0x7995('0x2d')]();};}function respondWithResult(_0x56691a,_0x47625f){_0x47625f=_0x47625f||0xc8;return function(_0x5911c3){if(_0x5911c3){return _0x56691a[_0x7995('0x2c')](_0x47625f)[_0x7995('0x2e')](_0x5911c3);}};}function respondWithFilteredResult(_0xf16cc2,_0x132a42){return function(_0x11c1eb){if(_0x11c1eb){var _0x4b6f99=_0x11c1eb[_0x7995('0x2f')],_0x9b2a15=_0x132a42[_0x7995('0x30')],_0x514445=_0x132a42['offset']+_0x132a42['limit'],_0x456a28;if(_0x514445>=_0x4b6f99){_0x514445=_0x4b6f99;_0x456a28=0xc8;}else{_0x456a28=0xce;}_0xf16cc2['status'](_0x456a28);return _0xf16cc2[_0x7995('0x31')](_0x7995('0x32'),_0x9b2a15+'-'+_0x514445+'/'+_0x4b6f99)[_0x7995('0x2e')](_0x11c1eb);}return null;};}function patchUpdates(_0x2b874d){return function(_0x2e3493){try{jsonpatch[_0x7995('0x33')](_0x2e3493,_0x2b874d,!![]);}catch(_0x538841){return BPromise['reject'](_0x538841);}return _0x2e3493[_0x7995('0x34')]();};}function saveUpdates(_0x5524af,_0x553671){return function(_0x3eb566){if(_0x3eb566){return _0x3eb566[_0x7995('0x35')](_0x5524af)[_0x7995('0x20')](function(_0x1f7d27){return _0x1f7d27;});}return null;};}function removeEntity(_0x510841,_0x44309d){return function(_0x33e24e){if(_0x33e24e){return _0x33e24e['destroy']()['then'](function(){var _0x577412=_0x33e24e[_0x7995('0x36')]({'plain':!![]});var _0x3acfc3='Contexts';return db[_0x7995('0x37')]['destroy']({'where':{'type':_0x3acfc3,'resourceId':_0x577412['id']}})[_0x7995('0x20')](function(){return _0x33e24e;});})[_0x7995('0x20')](function(){_0x510841[_0x7995('0x2c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x52d76d,_0x36d057){return function(_0x5e67fe){if(!_0x5e67fe){_0x52d76d['sendStatus'](0x194);}return _0x5e67fe;};}function handleError(_0x3e99cd,_0xe328b1){_0xe328b1=_0xe328b1||0x1f4;return function(_0x5212ff){logger[_0x7995('0x27')](_0x5212ff[_0x7995('0x38')]);if(_0x5212ff[_0x7995('0x39')]){delete _0x5212ff[_0x7995('0x39')];}_0x3e99cd[_0x7995('0x2c')](_0xe328b1)['send'](_0x5212ff);};}exports[_0x7995('0x3a')]=function(_0x242713,_0xf612e6){var _0x1d60b8={},_0x4b1541={},_0x2be2c0={'count':0x0,'rows':[]};var _0x235df7=_[_0x7995('0x3b')](db[_0x7995('0x3c')][_0x7995('0x3d')],function(_0x1035dc){return{'name':_0x1035dc['fieldName'],'type':_0x1035dc[_0x7995('0x3e')][_0x7995('0x3f')]};});_0x4b1541[_0x7995('0x40')]=_[_0x7995('0x3b')](_0x235df7,_0x7995('0x39'));_0x4b1541[_0x7995('0x41')]=_[_0x7995('0x42')](_0x242713[_0x7995('0x41')]);_0x4b1541[_0x7995('0x43')]=_[_0x7995('0x44')](_0x4b1541[_0x7995('0x40')],_0x4b1541[_0x7995('0x41')]);_0x1d60b8[_0x7995('0x45')]=_['intersection'](_0x4b1541['model'],qs[_0x7995('0x46')](_0x242713[_0x7995('0x41')]['fields']));_0x1d60b8['attributes']=_0x1d60b8[_0x7995('0x45')]['length']?_0x1d60b8['attributes']:_0x4b1541[_0x7995('0x40')];if(!_0x242713[_0x7995('0x41')][_0x7995('0x47')]('nolimit')){_0x1d60b8[_0x7995('0x48')]=qs['limit'](_0x242713[_0x7995('0x41')]['limit']);_0x1d60b8['offset']=qs[_0x7995('0x30')](_0x242713[_0x7995('0x41')][_0x7995('0x30')]);}_0x1d60b8[_0x7995('0x49')]=qs['sort'](_0x242713[_0x7995('0x41')][_0x7995('0x4a')]);_0x1d60b8[_0x7995('0x4b')]=qs[_0x7995('0x43')](_['pick'](_0x242713['query'],_0x4b1541[_0x7995('0x43')]),_0x235df7);if(_0x242713['query'][_0x7995('0x4c')]){_0x1d60b8['where']=_[_0x7995('0x4d')](_0x1d60b8['where'],{'$or':_[_0x7995('0x3b')](_0x235df7,function(_0x1b0373){if(_0x1b0373['type']!==_0x7995('0x4e')){var _0x336ff2={};_0x336ff2[_0x1b0373[_0x7995('0x39')]]={'$like':'%'+_0x242713[_0x7995('0x41')]['filter']+'%'};return _0x336ff2;}})});}_0x1d60b8=_[_0x7995('0x4d')]({},_0x1d60b8,_0x242713[_0x7995('0x4f')]);var _0x237270={'where':_0x1d60b8['where']};return db[_0x7995('0x3c')][_0x7995('0x2f')](_0x237270)[_0x7995('0x20')](function(_0x3d8ae3){_0x2be2c0[_0x7995('0x2f')]=_0x3d8ae3;if(_0x242713['query'][_0x7995('0x50')]){_0x1d60b8[_0x7995('0x51')]=[{'all':!![]}];}return db['VoiceContext'][_0x7995('0x52')](_0x1d60b8);})['then'](function(_0x1d87f9){_0x2be2c0[_0x7995('0x53')]=_0x1d87f9;return _0x2be2c0;})[_0x7995('0x20')](respondWithFilteredResult(_0xf612e6,_0x1d60b8))[_0x7995('0x2a')](handleError(_0xf612e6,null));};exports[_0x7995('0x54')]=function(_0x14b537,_0x1579b9){var _0x4d46bc={'raw':![],'where':{'id':_0x14b537[_0x7995('0x55')]['id']}},_0x427dcf={};_0x427dcf[_0x7995('0x40')]=_['keys'](db[_0x7995('0x3c')][_0x7995('0x3d')]);_0x427dcf[_0x7995('0x41')]=_['keys'](_0x14b537['query']);_0x427dcf['filters']=_[_0x7995('0x44')](_0x427dcf[_0x7995('0x40')],_0x427dcf['query']);_0x4d46bc[_0x7995('0x45')]=_[_0x7995('0x44')](_0x427dcf[_0x7995('0x40')],qs[_0x7995('0x46')](_0x14b537[_0x7995('0x41')]['fields']));_0x4d46bc[_0x7995('0x45')]=_0x4d46bc['attributes'][_0x7995('0x56')]?_0x4d46bc[_0x7995('0x45')]:_0x427dcf[_0x7995('0x40')];if(_0x14b537['query']['includeAll']){_0x4d46bc['include']=[{'all':!![]}];}_0x4d46bc=_['merge']({},_0x4d46bc,_0x14b537[_0x7995('0x4f')]);return db[_0x7995('0x3c')][_0x7995('0x57')](_0x4d46bc)[_0x7995('0x20')](handleEntityNotFound(_0x1579b9,null))[_0x7995('0x20')](respondWithResult(_0x1579b9,null))[_0x7995('0x2a')](handleError(_0x1579b9,null));};exports[_0x7995('0x58')]=function(_0xda6ce8,_0x328671,_0x17ecd3){var _0xa7af8c;return db[_0x7995('0x3c')][_0x7995('0x58')](_0xda6ce8[_0x7995('0x59')],{'raw':!![]})[_0x7995('0x20')](function(_0x416133){_0xa7af8c=_0x416133;return db[_0x7995('0x3c')][_0x7995('0x52')]({'raw':!![]});})[_0x7995('0x20')](function(_0x50b7c2){var _0x56a374=fs[_0x7995('0x5a')](path[_0x7995('0x5b')](config[_0x7995('0x5c')],'server/files/templates/context.ejs'),'utf8');var _0x402fa0=ejs[_0x7995('0x5d')](_0x56a374,{'contexts':_0x50b7c2||[]});fs[_0x7995('0x5e')](_0x7995('0x5f'),_0x402fa0);})['then'](function(){return respondWithRpcPromise(_0x7995('0x60'),_0x7995('0x58'),{'module':_0x7995('0x61')});})[_0x7995('0x20')](function(){var _0x502d43=_0xda6ce8['user'][_0x7995('0x36')]({'plain':!![]});if(!_0x502d43)throw new Error(_0x7995('0x62'));if(_0x502d43[_0x7995('0x63')]===_0x7995('0x64')){var _0x37072=_0xa7af8c[_0x7995('0x36')]({'plain':!![]});return db[_0x7995('0x65')][_0x7995('0x57')]({'where':{'name':_0x7995('0x66'),'userProfileId':_0x502d43['userProfileId']},'raw':!![]})[_0x7995('0x20')](function(_0x3ec5a8){if(_0x3ec5a8&&_0x3ec5a8[_0x7995('0x67')]===0x0){return db[_0x7995('0x37')]['create']({'name':_0x37072['name'],'resourceId':_0x37072['id'],'type':_0x3ec5a8[_0x7995('0x39')],'sectionId':_0x3ec5a8['id']},{})[_0x7995('0x20')](function(){return _0xa7af8c;});}else{return _0xa7af8c;}})['catch'](function(_0x971a23){logger[_0x7995('0x27')](_0x7995('0x68'),_0x971a23);throw _0x971a23;});}return _0xa7af8c;})[_0x7995('0x20')](respondWithResult(_0x328671,0xc9))[_0x7995('0x2a')](handleError(_0x328671,null));};exports['update']=function(_0x457d09,_0x564fca,_0x3e0a46){var _0xe31dcb;return db[_0x7995('0x3c')][_0x7995('0x57')]({'where':{'id':_0x457d09[_0x7995('0x55')]['id']}})[_0x7995('0x20')](handleEntityNotFound(_0x564fca,null))[_0x7995('0x20')](saveUpdates(_0x457d09[_0x7995('0x59')],null))[_0x7995('0x20')](function(_0x3f2bde){if(_0x3f2bde){_0xe31dcb=_0x3f2bde;return db[_0x7995('0x3c')][_0x7995('0x52')]({'raw':!![]});}})['then'](function(_0x45351d){var _0x23bbc1=fs[_0x7995('0x5a')](path[_0x7995('0x5b')](config[_0x7995('0x5c')],'server/files/templates/context.ejs'),'utf8');var _0x268fde=ejs[_0x7995('0x5d')](_0x23bbc1,{'contexts':_0x45351d||[]});fs[_0x7995('0x5e')](_0x7995('0x5f'),_0x268fde);})['then'](function(){return respondWithRpcPromise(_0x7995('0x60'),'update',{'module':'chan_sip.so'});})[_0x7995('0x20')](function(){return _0xe31dcb;})[_0x7995('0x20')](respondWithResult(_0x564fca,null))[_0x7995('0x2a')](handleError(_0x564fca,null));};exports[_0x7995('0x69')]=function(_0x290eae,_0x25d9a4,_0x32a52f){var _0x13dc73;return db[_0x7995('0x3c')][_0x7995('0x57')]({'where':{'id':_0x290eae['params']['id']}})[_0x7995('0x20')](handleEntityNotFound(_0x25d9a4,null))[_0x7995('0x20')](removeEntity(_0x25d9a4,null))[_0x7995('0x20')](function(){return db['VoiceContext'][_0x7995('0x52')]({'raw':!![]});})[_0x7995('0x20')](function(_0x705f0){var _0x3a7d9d=fs[_0x7995('0x5a')](path[_0x7995('0x5b')](config[_0x7995('0x5c')],_0x7995('0x6a')),_0x7995('0x6b'));var _0x1fdff6=ejs[_0x7995('0x5d')](_0x3a7d9d,{'contexts':_0x705f0});fs['writeFileSync']('/etc/asterisk/extensions_xcally_contexts.conf',_0x1fdff6);return respondWithRpcPromise(_0x7995('0x60'),_0x7995('0x69'),{'module':_0x7995('0x61')});})[_0x7995('0x2a')](handleError(_0x25d9a4,null));};
\ No newline at end of file
diff --git a/server/api/voiceContext/voiceContext.model.js b/server/api/voiceContext/voiceContext.model.js
index db1c206..42999b3 100644
--- a/server/api/voiceContext/voiceContext.model.js
+++ b/server/api/voiceContext/voiceContext.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9957=['exports','define','VoiceContext','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./voiceContext.attributes'];(function(_0xda464c,_0x26e47d){var _0x19e222=function(_0x1ec605){while(--_0x1ec605){_0xda464c['push'](_0xda464c['shift']());}};_0x19e222(++_0x26e47d);}(_0x9957,0x93));var _0x7995=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x9957[_0x2f5ac5];return _0x37c9a8;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'voice_contexts','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xa9e0=['../../config/environment','./voiceContext.attributes','exports','define','VoiceContext','lodash','util','../../config/logger','bluebird','path','rimraf'];(function(_0xe7a974,_0x3a61e5){var _0x13573a=function(_0x59e4cf){while(--_0x59e4cf){_0xe7a974['push'](_0xe7a974['shift']());}};_0x13573a(++_0x3a61e5);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2f3848,_0x48564d){_0x2f3848=_0x2f3848-0x0;var _0x102668=_0xa9e0[_0x2f3848];return _0x102668;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var logger=require(_0x0a9e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x0a9e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0a9e('0x4'));var rimraf=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var attributes=require(_0x0a9e('0x7'));module[_0x0a9e('0x8')]=function(_0x57b080,_0x219af0){return _0x57b080[_0x0a9e('0x9')](_0x0a9e('0xa'),attributes,{'tableName':'voice_contexts','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/voiceContext/voiceContext.rpc.js b/server/api/voiceContext/voiceContext.rpc.js
index c1ee0c2..3b2dd50 100644
--- a/server/api/voiceContext/voiceContext.rpc.js
+++ b/server/api/voiceContext/voiceContext.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x361a=['then','request\x20sent','debug','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error','VoiceContext,\x20%s,\x20%s','message','info','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request'];(function(_0x2f1d50,_0x4dfc3a){var _0x4471ca=function(_0x231ad4){while(--_0x231ad4){_0x2f1d50['push'](_0x2f1d50['shift']());}};_0x4471ca(++_0x4dfc3a);}(_0x361a,0x8e));var _0xa361=function(_0x20960c,_0x7df974){_0x20960c=_0x20960c-0x0;var _0x2de4e7=_0x361a[_0x20960c];return _0x2de4e7;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0xa361('0x0'));var rs=require(_0xa361('0x1'));var fs=require('fs');var Redis=require(_0xa361('0x2'));var db=require(_0xa361('0x3'))['db'];var utils=require(_0xa361('0x4'));var logger=require(_0xa361('0x5'))(_0xa361('0x6'));var config=require(_0xa361('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0xa361('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x497bff,_0xb522ea,_0x5813a5){return new BPromise(function(_0x2f9520,_0x555065){return client[_0xa361('0x9')](_0x497bff,_0x5813a5)[_0xa361('0xa')](function(_0x94daa2){logger['info']('VoiceContext,\x20%s,\x20%s',_0xb522ea,_0xa361('0xb'));logger[_0xa361('0xc')](_0xa361('0xd'),_0xb522ea,'request\x20sent',JSON[_0xa361('0xe')](_0x94daa2));if(_0x94daa2[_0xa361('0xf')]){if(_0x94daa2[_0xa361('0xf')]['code']===0x1f4){logger[_0xa361('0xf')](_0xa361('0x10'),_0xb522ea,_0x94daa2[_0xa361('0xf')][_0xa361('0x11')]);return _0x555065(_0x94daa2[_0xa361('0xf')][_0xa361('0x11')]);}logger[_0xa361('0xf')]('VoiceContext,\x20%s,\x20%s',_0xb522ea,_0x94daa2[_0xa361('0xf')][_0xa361('0x11')]);return _0x2f9520(_0x94daa2['error'][_0xa361('0x11')]);}else{logger[_0xa361('0x12')](_0xa361('0x10'),_0xb522ea,_0xa361('0xb'));_0x2f9520(_0x94daa2['result'][_0xa361('0x11')]);}})['catch'](function(_0x227747){logger[_0xa361('0xf')](_0xa361('0x10'),_0xb522ea,_0x227747);_0x555065(_0x227747);});});}
\ No newline at end of file
+var _0xfdda=['error','code','message','info','VoiceContext,\x20%s,\x20%s','lodash','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','request\x20sent','debug','VoiceContext,\x20%s,\x20%s,\x20%s'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xfdda,0xc2));var _0xafdd=function(_0x2dbac1,_0x44db3b){_0x2dbac1=_0x2dbac1-0x0;var _0x8c4e86=_0xfdda[_0x2dbac1];return _0x8c4e86;};'use strict';var _=require(_0xafdd('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xafdd('0x1'));var fs=require('fs');var Redis=require(_0xafdd('0x2'));var db=require(_0xafdd('0x3'))['db'];var utils=require(_0xafdd('0x4'));var logger=require(_0xafdd('0x5'))(_0xafdd('0x6'));var config=require(_0xafdd('0x7'));var jayson=require(_0xafdd('0x8'));var client=jayson[_0xafdd('0x9')][_0xafdd('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3b0321,_0x3d98a7,_0x8b05a2){return new BPromise(function(_0x3036be,_0x3b0d23){return client[_0xafdd('0xb')](_0x3b0321,_0x8b05a2)[_0xafdd('0xc')](function(_0x9bcb31){logger['info']('VoiceContext,\x20%s,\x20%s',_0x3d98a7,_0xafdd('0xd'));logger[_0xafdd('0xe')](_0xafdd('0xf'),_0x3d98a7,'request\x20sent',JSON['stringify'](_0x9bcb31));if(_0x9bcb31[_0xafdd('0x10')]){if(_0x9bcb31['error'][_0xafdd('0x11')]===0x1f4){logger[_0xafdd('0x10')]('VoiceContext,\x20%s,\x20%s',_0x3d98a7,_0x9bcb31['error']['message']);return _0x3b0d23(_0x9bcb31['error'][_0xafdd('0x12')]);}logger[_0xafdd('0x10')]('VoiceContext,\x20%s,\x20%s',_0x3d98a7,_0x9bcb31[_0xafdd('0x10')][_0xafdd('0x12')]);return _0x3036be(_0x9bcb31[_0xafdd('0x10')][_0xafdd('0x12')]);}else{logger[_0xafdd('0x13')](_0xafdd('0x14'),_0x3d98a7,_0xafdd('0xd'));_0x3036be(_0x9bcb31['result']['message']);}})['catch'](function(_0x522579){logger[_0xafdd('0x10')]('VoiceContext,\x20%s,\x20%s',_0x3d98a7,_0x522579);_0x3b0d23(_0x522579);});});}
\ No newline at end of file
diff --git a/server/api/voiceDialReport/index.js b/server/api/voiceDialReport/index.js
index ca73d2e..86785ab 100644
--- a/server/api/voiceDialReport/index.js
+++ b/server/api/voiceDialReport/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x831e=['update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceDialReport.controller','get','/describe','isAuthenticated','/:id','show','put'];(function(_0x35cc40,_0x4b7677){var _0x5ae78e=function(_0x81c890){while(--_0x81c890){_0x35cc40['push'](_0x35cc40['shift']());}};_0x5ae78e(++_0x4b7677);}(_0x831e,0x108));var _0xe831=function(_0x1901ec,_0x55328d){_0x1901ec=_0x1901ec-0x0;var _0x41243b=_0x831e[_0x1901ec];return _0x41243b;};'use strict';var multer=require(_0xe831('0x0'));var util=require(_0xe831('0x1'));var path=require(_0xe831('0x2'));var timeout=require(_0xe831('0x3'));var express=require(_0xe831('0x4'));var router=express[_0xe831('0x5')]();var auth=require(_0xe831('0x6'));var interaction=require(_0xe831('0x7'));var config=require(_0xe831('0x8'));var controller=require(_0xe831('0x9'));router[_0xe831('0xa')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0xe831('0xb'),auth[_0xe831('0xc')](),controller['describe']);router[_0xe831('0xa')](_0xe831('0xd'),auth['isAuthenticated'](),controller[_0xe831('0xe')]);router['post']('/',auth[_0xe831('0xc')](),controller['create']);router[_0xe831('0xf')]('/:id',auth['isAuthenticated'](),controller[_0xe831('0x10')]);router[_0xe831('0x11')](_0xe831('0xd'),auth['isAuthenticated'](),controller[_0xe831('0x12')]);module[_0xe831('0x13')]=router;
\ No newline at end of file
+var _0xf466=['./voiceDialReport.controller','get','index','/describe','isAuthenticated','describe','/:id','show','create','put','update','destroy','exports','multer','util','path','connect-timeout','express','../../config/environment'];(function(_0x15e0d2,_0x8333c){var _0x45bb73=function(_0x52cb41){while(--_0x52cb41){_0x15e0d2['push'](_0x15e0d2['shift']());}};_0x45bb73(++_0x8333c);}(_0xf466,0x19c));var _0x6f46=function(_0x6eff5b,_0x3976fa){_0x6eff5b=_0x6eff5b-0x0;var _0x40af9f=_0xf466[_0x6eff5b];return _0x40af9f;};'use strict';var multer=require(_0x6f46('0x0'));var util=require(_0x6f46('0x1'));var path=require(_0x6f46('0x2'));var timeout=require(_0x6f46('0x3'));var express=require(_0x6f46('0x4'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x6f46('0x5'));var controller=require(_0x6f46('0x6'));router[_0x6f46('0x7')]('/',auth['isAuthenticated'](),controller[_0x6f46('0x8')]);router[_0x6f46('0x7')](_0x6f46('0x9'),auth[_0x6f46('0xa')](),controller[_0x6f46('0xb')]);router[_0x6f46('0x7')](_0x6f46('0xc'),auth['isAuthenticated'](),controller[_0x6f46('0xd')]);router['post']('/',auth[_0x6f46('0xa')](),controller[_0x6f46('0xe')]);router[_0x6f46('0xf')](_0x6f46('0xc'),auth['isAuthenticated'](),controller[_0x6f46('0x10')]);router['delete'](_0x6f46('0xc'),auth[_0x6f46('0xa')](),controller[_0x6f46('0x11')]);module[_0x6f46('0x12')]=router;
\ No newline at end of file
diff --git a/server/api/voiceDialReport/voiceDialReport.attributes.js b/server/api/voiceDialReport/voiceDialReport.attributes.js
index 16c4268..5e0137a 100644
--- a/server/api/voiceDialReport/voiceDialReport.attributes.js
+++ b/server/api/voiceDialReport/voiceDialReport.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x364c=['INTEGER','DATE','called,connect,complete','STRING'];(function(_0x212e2f,_0x18fd85){var _0x212595=function(_0x2201cb){while(--_0x2201cb){_0x212e2f['push'](_0x212e2f['shift']());}};_0x212595(++_0x18fd85);}(_0x364c,0xcf));var _0xc364=function(_0x1c41c0,_0x57f2fb){_0x1c41c0=_0x1c41c0-0x0;var _0x5d8b8d=_0x364c[_0x1c41c0];return _0x5d8b8d;};'use strict';var Sequelize=require('sequelize');module['exports']={'privilege':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0xc364('0x0')]},'channelstate':{'type':Sequelize['INTEGER']},'channelstatedesc':{'type':Sequelize[_0xc364('0x0')]},'calleridnum':{'type':Sequelize[_0xc364('0x0')]},'calleridname':{'type':Sequelize[_0xc364('0x0')]},'connectedlinenum':{'type':Sequelize[_0xc364('0x0')]},'connectedlinename':{'type':Sequelize[_0xc364('0x0')]},'language':{'type':Sequelize[_0xc364('0x0')]},'accountcode':{'type':Sequelize[_0xc364('0x0')]},'context':{'type':Sequelize[_0xc364('0x0')]},'exten':{'type':Sequelize[_0xc364('0x0')]},'priority':{'type':Sequelize['INTEGER']},'uniqueid':{'type':Sequelize[_0xc364('0x0')]},'linkedid':{'type':Sequelize[_0xc364('0x0')]},'destchannel':{'type':Sequelize[_0xc364('0x0')]},'destchannelstate':{'type':Sequelize['INTEGER']},'destchannelstatedesc':{'type':Sequelize[_0xc364('0x0')]},'destcalleridnum':{'type':Sequelize[_0xc364('0x0')]},'destcalleridname':{'type':Sequelize[_0xc364('0x0')]},'destconnectedlinenum':{'type':Sequelize[_0xc364('0x0')]},'destconnectedlinename':{'type':Sequelize[_0xc364('0x0')]},'destlanguage':{'type':Sequelize[_0xc364('0x0')]},'destaccountcode':{'type':Sequelize[_0xc364('0x0')]},'destcontext':{'type':Sequelize[_0xc364('0x0')]},'destexten':{'type':Sequelize['STRING']},'destpriority':{'type':Sequelize[_0xc364('0x1')]},'destuniqueid':{'type':Sequelize[_0xc364('0x0')]},'destlinkedid':{'type':Sequelize[_0xc364('0x0')]},'dialstring':{'type':Sequelize[_0xc364('0x0')]},'dialstatus':{'type':Sequelize[_0xc364('0x0')]},'starttime':{'type':Sequelize[_0xc364('0x2')]},'answertime':{'type':Sequelize[_0xc364('0x2')]},'endtime':{'type':Sequelize[_0xc364('0x2')]},'lastevent':{'type':Sequelize[_0xc364('0x0')],'comment':_0xc364('0x3')},'routeId':{'type':Sequelize['INTEGER']},'duration':{'type':Sequelize['INTEGER']},'holdtime':{'type':Sequelize[_0xc364('0x1')]},'billableseconds':{'type':Sequelize[_0xc364('0x1')]}};
\ No newline at end of file
+var _0xef74=['called,connect,complete','sequelize','exports','STRING','INTEGER','DATE'];(function(_0x35e25c,_0x301f23){var _0x5266c6=function(_0x2d4330){while(--_0x2d4330){_0x35e25c['push'](_0x35e25c['shift']());}};_0x5266c6(++_0x301f23);}(_0xef74,0x1ab));var _0x4ef7=function(_0x1ccdf7,_0x215d5a){_0x1ccdf7=_0x1ccdf7-0x0;var _0x52a0ae=_0xef74[_0x1ccdf7];return _0x52a0ae;};'use strict';var Sequelize=require(_0x4ef7('0x0'));module[_0x4ef7('0x1')]={'privilege':{'type':Sequelize[_0x4ef7('0x2')]},'channel':{'type':Sequelize['STRING']},'channelstate':{'type':Sequelize['INTEGER']},'channelstatedesc':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0x4ef7('0x2')]},'calleridname':{'type':Sequelize[_0x4ef7('0x2')]},'connectedlinenum':{'type':Sequelize[_0x4ef7('0x2')]},'connectedlinename':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x4ef7('0x2')]},'accountcode':{'type':Sequelize[_0x4ef7('0x2')]},'context':{'type':Sequelize[_0x4ef7('0x2')]},'exten':{'type':Sequelize[_0x4ef7('0x2')]},'priority':{'type':Sequelize[_0x4ef7('0x3')]},'uniqueid':{'type':Sequelize[_0x4ef7('0x2')]},'linkedid':{'type':Sequelize[_0x4ef7('0x2')]},'destchannel':{'type':Sequelize[_0x4ef7('0x2')]},'destchannelstate':{'type':Sequelize['INTEGER']},'destchannelstatedesc':{'type':Sequelize[_0x4ef7('0x2')]},'destcalleridnum':{'type':Sequelize[_0x4ef7('0x2')]},'destcalleridname':{'type':Sequelize[_0x4ef7('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0x4ef7('0x2')]},'destconnectedlinename':{'type':Sequelize[_0x4ef7('0x2')]},'destlanguage':{'type':Sequelize[_0x4ef7('0x2')]},'destaccountcode':{'type':Sequelize['STRING']},'destcontext':{'type':Sequelize[_0x4ef7('0x2')]},'destexten':{'type':Sequelize[_0x4ef7('0x2')]},'destpriority':{'type':Sequelize[_0x4ef7('0x3')]},'destuniqueid':{'type':Sequelize['STRING']},'destlinkedid':{'type':Sequelize[_0x4ef7('0x2')]},'dialstring':{'type':Sequelize[_0x4ef7('0x2')]},'dialstatus':{'type':Sequelize[_0x4ef7('0x2')]},'starttime':{'type':Sequelize[_0x4ef7('0x4')]},'answertime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize[_0x4ef7('0x4')]},'lastevent':{'type':Sequelize[_0x4ef7('0x2')],'comment':_0x4ef7('0x5')},'routeId':{'type':Sequelize['INTEGER']},'duration':{'type':Sequelize['INTEGER']},'holdtime':{'type':Sequelize['INTEGER']},'billableseconds':{'type':Sequelize[_0x4ef7('0x3')]}};
\ No newline at end of file
diff --git a/server/api/voiceDialReport/voiceDialReport.controller.js b/server/api/voiceDialReport/voiceDialReport.controller.js
index fbc372e..35097a2 100644
--- a/server/api/voiceDialReport/voiceDialReport.controller.js
+++ b/server/api/voiceDialReport/voiceDialReport.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x4812=['then','error','stack','name','send','index','map','VoiceDialReport','fieldName','key','model','query','filters','intersection','fields','attributes','hasOwnProperty','limit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','show','params','keys','length','find','create','body','describe','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','path','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','set','Content-Range','apply','reject','save','update','destroy'];(function(_0x40a333,_0x5e15f4){var _0xd0bb9=function(_0x5ad565){while(--_0x5ad565){_0x40a333['push'](_0x40a333['shift']());}};_0xd0bb9(++_0x5e15f4);}(_0x4812,0x10a));var _0x2481=function(_0x19f871,_0x5e059a){_0x19f871=_0x19f871-0x0;var _0x3428e1=_0x4812[_0x19f871];return _0x3428e1;};'use strict';var pdf=require(_0x2481('0x0'));var emlformat=require(_0x2481('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x2481('0x2'));var jsonpatch=require(_0x2481('0x3'));var rp=require(_0x2481('0x4'));var moment=require(_0x2481('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x2481('0x6'));var util=require('util');var path=require(_0x2481('0x7'));var sox=require('sox');var csv=require(_0x2481('0x8'));var ejs=require(_0x2481('0x9'));var fs=require('fs');var _=require(_0x2481('0xa'));var squel=require(_0x2481('0xb'));var crypto=require(_0x2481('0xc'));var jsforce=require(_0x2481('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x2481('0xe'));var Papa=require(_0x2481('0xf'));var Redis=require(_0x2481('0x10'));var authService=require(_0x2481('0x11'));var qs=require(_0x2481('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x2481('0x13'));var logger=require(_0x2481('0x14'))(_0x2481('0x15'));var utils=require(_0x2481('0x16'));var config=require(_0x2481('0x17'));var db=require(_0x2481('0x18'))['db'];function respondWithStatusCode(_0x4d01e8,_0x160c41){_0x160c41=_0x160c41||0xcc;return function(_0x16d1c3){if(_0x16d1c3){return _0x4d01e8[_0x2481('0x19')](_0x160c41);}return _0x4d01e8[_0x2481('0x1a')](_0x160c41)[_0x2481('0x1b')]();};}function respondWithResult(_0x2e0392,_0x3039e3){_0x3039e3=_0x3039e3||0xc8;return function(_0x1f6499){if(_0x1f6499){return _0x2e0392['status'](_0x3039e3)[_0x2481('0x1c')](_0x1f6499);}};}function respondWithFilteredResult(_0x4550dc,_0x109732){return function(_0x29db67){if(_0x29db67){var _0x121ccb=_0x29db67[_0x2481('0x1d')],_0x49e4fc=_0x109732['offset'],_0x16273a=_0x109732[_0x2481('0x1e')]+_0x109732['limit'],_0x13b862;if(_0x16273a>=_0x121ccb){_0x16273a=_0x121ccb;_0x13b862=0xc8;}else{_0x13b862=0xce;}_0x4550dc[_0x2481('0x1a')](_0x13b862);return _0x4550dc[_0x2481('0x1f')](_0x2481('0x20'),_0x49e4fc+'-'+_0x16273a+'/'+_0x121ccb)[_0x2481('0x1c')](_0x29db67);}return null;};}function patchUpdates(_0x186abb){return function(_0x2ce5f9){try{jsonpatch[_0x2481('0x21')](_0x2ce5f9,_0x186abb,!![]);}catch(_0x55b86d){return BPromise[_0x2481('0x22')](_0x55b86d);}return _0x2ce5f9[_0x2481('0x23')]();};}function saveUpdates(_0x4b965a,_0xee5e9e){return function(_0x1fe3a1){if(_0x1fe3a1){return _0x1fe3a1[_0x2481('0x24')](_0x4b965a)['then'](function(_0xf086b2){return _0xf086b2;});}return null;};}function removeEntity(_0x1412c4,_0x1fabb8){return function(_0x103806){if(_0x103806){return _0x103806[_0x2481('0x25')]()[_0x2481('0x26')](function(){_0x1412c4[_0x2481('0x1a')](0xcc)[_0x2481('0x1b')]();});}};}function handleEntityNotFound(_0x589603,_0x19aff5){return function(_0x646000){if(!_0x646000){_0x589603[_0x2481('0x19')](0x194);}return _0x646000;};}function handleError(_0x3fac1f,_0x58cc2f){_0x58cc2f=_0x58cc2f||0x1f4;return function(_0x32f88c){logger[_0x2481('0x27')](_0x32f88c[_0x2481('0x28')]);if(_0x32f88c[_0x2481('0x29')]){delete _0x32f88c[_0x2481('0x29')];}_0x3fac1f[_0x2481('0x1a')](_0x58cc2f)[_0x2481('0x2a')](_0x32f88c);};}exports[_0x2481('0x2b')]=function(_0x5dde90,_0x5126c9){var _0x3f2b79={},_0x315e4f={},_0x1288f8={'count':0x0,'rows':[]};var _0x54fd93=_[_0x2481('0x2c')](db[_0x2481('0x2d')]['rawAttributes'],function(_0x26a651){return{'name':_0x26a651[_0x2481('0x2e')],'type':_0x26a651['type'][_0x2481('0x2f')]};});_0x315e4f[_0x2481('0x30')]=_['map'](_0x54fd93,_0x2481('0x29'));_0x315e4f[_0x2481('0x31')]=_['keys'](_0x5dde90[_0x2481('0x31')]);_0x315e4f[_0x2481('0x32')]=_[_0x2481('0x33')](_0x315e4f[_0x2481('0x30')],_0x315e4f[_0x2481('0x31')]);_0x3f2b79['attributes']=_[_0x2481('0x33')](_0x315e4f[_0x2481('0x30')],qs['fields'](_0x5dde90['query'][_0x2481('0x34')]));_0x3f2b79[_0x2481('0x35')]=_0x3f2b79[_0x2481('0x35')]['length']?_0x3f2b79[_0x2481('0x35')]:_0x315e4f[_0x2481('0x30')];if(!_0x5dde90[_0x2481('0x31')][_0x2481('0x36')]('nolimit')){_0x3f2b79[_0x2481('0x37')]=qs[_0x2481('0x37')](_0x5dde90[_0x2481('0x31')][_0x2481('0x37')]);_0x3f2b79[_0x2481('0x1e')]=qs[_0x2481('0x1e')](_0x5dde90[_0x2481('0x31')][_0x2481('0x1e')]);}_0x3f2b79[_0x2481('0x38')]=qs[_0x2481('0x39')](_0x5dde90[_0x2481('0x31')][_0x2481('0x39')]);_0x3f2b79[_0x2481('0x3a')]=qs[_0x2481('0x32')](_[_0x2481('0x3b')](_0x5dde90['query'],_0x315e4f[_0x2481('0x32')]),_0x54fd93);if(_0x5dde90[_0x2481('0x31')][_0x2481('0x3c')]){_0x3f2b79[_0x2481('0x3a')]=_[_0x2481('0x3d')](_0x3f2b79[_0x2481('0x3a')],{'$or':_[_0x2481('0x2c')](_0x54fd93,function(_0x21ec13){if(_0x21ec13['type']!==_0x2481('0x3e')){var _0x28fe26={};_0x28fe26[_0x21ec13[_0x2481('0x29')]]={'$like':'%'+_0x5dde90[_0x2481('0x31')][_0x2481('0x3c')]+'%'};return _0x28fe26;}})});}_0x3f2b79=_['merge']({},_0x3f2b79,_0x5dde90[_0x2481('0x3f')]);var _0x3953af={'where':_0x3f2b79['where']};return db[_0x2481('0x2d')]['count'](_0x3953af)[_0x2481('0x26')](function(_0x1e5678){_0x1288f8[_0x2481('0x1d')]=_0x1e5678;if(_0x5dde90[_0x2481('0x31')][_0x2481('0x40')]){_0x3f2b79[_0x2481('0x41')]=[{'all':!![]}];}return db[_0x2481('0x2d')]['findAll'](_0x3f2b79);})[_0x2481('0x26')](function(_0x53117a){_0x1288f8[_0x2481('0x42')]=_0x53117a;return _0x1288f8;})[_0x2481('0x26')](respondWithFilteredResult(_0x5126c9,_0x3f2b79))[_0x2481('0x43')](handleError(_0x5126c9,null));};exports[_0x2481('0x44')]=function(_0x3952df,_0x1902b4){var _0x5e2acc={'raw':!![],'where':{'id':_0x3952df[_0x2481('0x45')]['id']}},_0x1bb4d9={};_0x1bb4d9['model']=_[_0x2481('0x46')](db[_0x2481('0x2d')]['rawAttributes']);_0x1bb4d9['query']=_[_0x2481('0x46')](_0x3952df[_0x2481('0x31')]);_0x1bb4d9['filters']=_[_0x2481('0x33')](_0x1bb4d9[_0x2481('0x30')],_0x1bb4d9[_0x2481('0x31')]);_0x5e2acc[_0x2481('0x35')]=_[_0x2481('0x33')](_0x1bb4d9[_0x2481('0x30')],qs[_0x2481('0x34')](_0x3952df[_0x2481('0x31')]['fields']));_0x5e2acc['attributes']=_0x5e2acc[_0x2481('0x35')][_0x2481('0x47')]?_0x5e2acc[_0x2481('0x35')]:_0x1bb4d9[_0x2481('0x30')];if(_0x3952df[_0x2481('0x31')]['includeAll']){_0x5e2acc[_0x2481('0x41')]=[{'all':!![]}];}_0x5e2acc=_[_0x2481('0x3d')]({},_0x5e2acc,_0x3952df[_0x2481('0x3f')]);return db[_0x2481('0x2d')][_0x2481('0x48')](_0x5e2acc)[_0x2481('0x26')](handleEntityNotFound(_0x1902b4,null))[_0x2481('0x26')](respondWithResult(_0x1902b4,null))[_0x2481('0x43')](handleError(_0x1902b4,null));};exports[_0x2481('0x49')]=function(_0xf0f32c,_0x54c08c){return db[_0x2481('0x2d')][_0x2481('0x49')](_0xf0f32c[_0x2481('0x4a')],{})['then'](respondWithResult(_0x54c08c,0xc9))[_0x2481('0x43')](handleError(_0x54c08c,null));};exports[_0x2481('0x24')]=function(_0xc18c9e,_0x47a46c){if(_0xc18c9e[_0x2481('0x4a')]['id']){delete _0xc18c9e[_0x2481('0x4a')]['id'];}return db[_0x2481('0x2d')][_0x2481('0x48')]({'where':{'id':_0xc18c9e[_0x2481('0x45')]['id']}})['then'](handleEntityNotFound(_0x47a46c,null))[_0x2481('0x26')](saveUpdates(_0xc18c9e[_0x2481('0x4a')],null))[_0x2481('0x26')](respondWithResult(_0x47a46c,null))[_0x2481('0x43')](handleError(_0x47a46c,null));};exports[_0x2481('0x25')]=function(_0x2b37e8,_0x480d94){return db[_0x2481('0x2d')]['find']({'where':{'id':_0x2b37e8[_0x2481('0x45')]['id']}})[_0x2481('0x26')](handleEntityNotFound(_0x480d94,null))['then'](removeEntity(_0x480d94,null))[_0x2481('0x43')](handleError(_0x480d94,null));};exports[_0x2481('0x4b')]=function(_0x4bdb45,_0x236910){return db['VoiceDialReport'][_0x2481('0x4b')]()['then'](respondWithResult(_0x236910,null))['catch'](handleError(_0x236910,null));};
\ No newline at end of file
+var _0xa906=['params','rawAttributes','includeAll','find','create','body','describe','html-pdf','rimraf','request-promise','moment','util','path','to-csv','ejs','lodash','jsforce','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','end','status','json','count','offset','limit','apply','reject','save','update','then','destroy','error','name','send','map','VoiceDialReport','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','rows','catch','show'];(function(_0x5cb1af,_0x4bdc8c){var _0x8d7940=function(_0x3db70a){while(--_0x3db70a){_0x5cb1af['push'](_0x5cb1af['shift']());}};_0x8d7940(++_0x4bdc8c);}(_0xa906,0x1e3));var _0x6a90=function(_0x2584a0,_0x128160){_0x2584a0=_0x2584a0-0x0;var _0x4b07c8=_0xa906[_0x2584a0];return _0x4b07c8;};'use strict';var pdf=require(_0x6a90('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x6a90('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x6a90('0x2'));var moment=require(_0x6a90('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x6a90('0x4'));var path=require(_0x6a90('0x5'));var sox=require('sox');var csv=require(_0x6a90('0x6'));var ejs=require(_0x6a90('0x7'));var fs=require('fs');var _=require(_0x6a90('0x8'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x6a90('0x9'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x6a90('0xa'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x6a90('0xb'));var qs=require(_0x6a90('0xc'));var as=require(_0x6a90('0xd'));var hardwareService=require(_0x6a90('0xe'));var logger=require(_0x6a90('0xf'))(_0x6a90('0x10'));var utils=require('../../config/utils');var config=require(_0x6a90('0x11'));var db=require(_0x6a90('0x12'))['db'];function respondWithStatusCode(_0x4ddfdb,_0x3ac580){_0x3ac580=_0x3ac580||0xcc;return function(_0x366a42){if(_0x366a42){return _0x4ddfdb[_0x6a90('0x13')](_0x3ac580);}return _0x4ddfdb['status'](_0x3ac580)[_0x6a90('0x14')]();};}function respondWithResult(_0x328b57,_0x39aec7){_0x39aec7=_0x39aec7||0xc8;return function(_0xa054b7){if(_0xa054b7){return _0x328b57[_0x6a90('0x15')](_0x39aec7)[_0x6a90('0x16')](_0xa054b7);}};}function respondWithFilteredResult(_0x1d5d77,_0x434c76){return function(_0x94a82c){if(_0x94a82c){var _0x5f433a=_0x94a82c[_0x6a90('0x17')],_0xf0c0ac=_0x434c76[_0x6a90('0x18')],_0x850e32=_0x434c76[_0x6a90('0x18')]+_0x434c76[_0x6a90('0x19')],_0x16b5da;if(_0x850e32>=_0x5f433a){_0x850e32=_0x5f433a;_0x16b5da=0xc8;}else{_0x16b5da=0xce;}_0x1d5d77[_0x6a90('0x15')](_0x16b5da);return _0x1d5d77['set']('Content-Range',_0xf0c0ac+'-'+_0x850e32+'/'+_0x5f433a)[_0x6a90('0x16')](_0x94a82c);}return null;};}function patchUpdates(_0x5b1da8){return function(_0x1ca66e){try{jsonpatch[_0x6a90('0x1a')](_0x1ca66e,_0x5b1da8,!![]);}catch(_0x554b16){return BPromise[_0x6a90('0x1b')](_0x554b16);}return _0x1ca66e[_0x6a90('0x1c')]();};}function saveUpdates(_0x5f1b2b,_0x3afcb9){return function(_0x27b489){if(_0x27b489){return _0x27b489[_0x6a90('0x1d')](_0x5f1b2b)[_0x6a90('0x1e')](function(_0x3b950c){return _0x3b950c;});}return null;};}function removeEntity(_0x2c471e,_0x186878){return function(_0x3236fe){if(_0x3236fe){return _0x3236fe[_0x6a90('0x1f')]()[_0x6a90('0x1e')](function(){_0x2c471e[_0x6a90('0x15')](0xcc)[_0x6a90('0x14')]();});}};}function handleEntityNotFound(_0x2339cd,_0x1bfdbc){return function(_0x16a86f){if(!_0x16a86f){_0x2339cd[_0x6a90('0x13')](0x194);}return _0x16a86f;};}function handleError(_0x2feda0,_0x1023ae){_0x1023ae=_0x1023ae||0x1f4;return function(_0x4cf74e){logger[_0x6a90('0x20')](_0x4cf74e['stack']);if(_0x4cf74e['name']){delete _0x4cf74e[_0x6a90('0x21')];}_0x2feda0[_0x6a90('0x15')](_0x1023ae)[_0x6a90('0x22')](_0x4cf74e);};}exports['index']=function(_0xedde7b,_0xa6679b){var _0x22c4da={},_0x54fbf5={},_0x4f120a={'count':0x0,'rows':[]};var _0x1a7318=_[_0x6a90('0x23')](db[_0x6a90('0x24')]['rawAttributes'],function(_0x3e908f){return{'name':_0x3e908f[_0x6a90('0x25')],'type':_0x3e908f[_0x6a90('0x26')][_0x6a90('0x27')]};});_0x54fbf5[_0x6a90('0x28')]=_['map'](_0x1a7318,'name');_0x54fbf5[_0x6a90('0x29')]=_[_0x6a90('0x2a')](_0xedde7b[_0x6a90('0x29')]);_0x54fbf5[_0x6a90('0x2b')]=_[_0x6a90('0x2c')](_0x54fbf5['model'],_0x54fbf5[_0x6a90('0x29')]);_0x22c4da[_0x6a90('0x2d')]=_[_0x6a90('0x2c')](_0x54fbf5['model'],qs[_0x6a90('0x2e')](_0xedde7b[_0x6a90('0x29')][_0x6a90('0x2e')]));_0x22c4da[_0x6a90('0x2d')]=_0x22c4da[_0x6a90('0x2d')][_0x6a90('0x2f')]?_0x22c4da[_0x6a90('0x2d')]:_0x54fbf5['model'];if(!_0xedde7b[_0x6a90('0x29')][_0x6a90('0x30')]('nolimit')){_0x22c4da['limit']=qs[_0x6a90('0x19')](_0xedde7b['query']['limit']);_0x22c4da['offset']=qs[_0x6a90('0x18')](_0xedde7b[_0x6a90('0x29')]['offset']);}_0x22c4da['order']=qs[_0x6a90('0x31')](_0xedde7b[_0x6a90('0x29')][_0x6a90('0x31')]);_0x22c4da[_0x6a90('0x32')]=qs['filters'](_[_0x6a90('0x33')](_0xedde7b[_0x6a90('0x29')],_0x54fbf5[_0x6a90('0x2b')]),_0x1a7318);if(_0xedde7b[_0x6a90('0x29')][_0x6a90('0x34')]){_0x22c4da['where']=_[_0x6a90('0x35')](_0x22c4da[_0x6a90('0x32')],{'$or':_[_0x6a90('0x23')](_0x1a7318,function(_0x47da67){if(_0x47da67[_0x6a90('0x26')]!==_0x6a90('0x36')){var _0x4bbcad={};_0x4bbcad[_0x47da67[_0x6a90('0x21')]]={'$like':'%'+_0xedde7b[_0x6a90('0x29')][_0x6a90('0x34')]+'%'};return _0x4bbcad;}})});}_0x22c4da=_[_0x6a90('0x35')]({},_0x22c4da,_0xedde7b[_0x6a90('0x37')]);var _0x2aa8ed={'where':_0x22c4da[_0x6a90('0x32')]};return db[_0x6a90('0x24')][_0x6a90('0x17')](_0x2aa8ed)[_0x6a90('0x1e')](function(_0x30c884){_0x4f120a[_0x6a90('0x17')]=_0x30c884;if(_0xedde7b[_0x6a90('0x29')]['includeAll']){_0x22c4da[_0x6a90('0x38')]=[{'all':!![]}];}return db['VoiceDialReport'][_0x6a90('0x39')](_0x22c4da);})[_0x6a90('0x1e')](function(_0x5d6bbc){_0x4f120a[_0x6a90('0x3a')]=_0x5d6bbc;return _0x4f120a;})['then'](respondWithFilteredResult(_0xa6679b,_0x22c4da))[_0x6a90('0x3b')](handleError(_0xa6679b,null));};exports[_0x6a90('0x3c')]=function(_0x3865c3,_0x3b255e){var _0x53424e={'raw':!![],'where':{'id':_0x3865c3[_0x6a90('0x3d')]['id']}},_0x4a5e5e={};_0x4a5e5e['model']=_['keys'](db[_0x6a90('0x24')][_0x6a90('0x3e')]);_0x4a5e5e[_0x6a90('0x29')]=_[_0x6a90('0x2a')](_0x3865c3[_0x6a90('0x29')]);_0x4a5e5e[_0x6a90('0x2b')]=_[_0x6a90('0x2c')](_0x4a5e5e[_0x6a90('0x28')],_0x4a5e5e[_0x6a90('0x29')]);_0x53424e[_0x6a90('0x2d')]=_[_0x6a90('0x2c')](_0x4a5e5e[_0x6a90('0x28')],qs[_0x6a90('0x2e')](_0x3865c3['query']['fields']));_0x53424e[_0x6a90('0x2d')]=_0x53424e[_0x6a90('0x2d')][_0x6a90('0x2f')]?_0x53424e['attributes']:_0x4a5e5e[_0x6a90('0x28')];if(_0x3865c3[_0x6a90('0x29')][_0x6a90('0x3f')]){_0x53424e[_0x6a90('0x38')]=[{'all':!![]}];}_0x53424e=_[_0x6a90('0x35')]({},_0x53424e,_0x3865c3['options']);return db[_0x6a90('0x24')][_0x6a90('0x40')](_0x53424e)[_0x6a90('0x1e')](handleEntityNotFound(_0x3b255e,null))[_0x6a90('0x1e')](respondWithResult(_0x3b255e,null))[_0x6a90('0x3b')](handleError(_0x3b255e,null));};exports[_0x6a90('0x41')]=function(_0x1b9079,_0x4f8f02){return db['VoiceDialReport']['create'](_0x1b9079[_0x6a90('0x42')],{})[_0x6a90('0x1e')](respondWithResult(_0x4f8f02,0xc9))[_0x6a90('0x3b')](handleError(_0x4f8f02,null));};exports[_0x6a90('0x1d')]=function(_0x585a44,_0x173b43){if(_0x585a44[_0x6a90('0x42')]['id']){delete _0x585a44[_0x6a90('0x42')]['id'];}return db['VoiceDialReport'][_0x6a90('0x40')]({'where':{'id':_0x585a44[_0x6a90('0x3d')]['id']}})['then'](handleEntityNotFound(_0x173b43,null))[_0x6a90('0x1e')](saveUpdates(_0x585a44[_0x6a90('0x42')],null))[_0x6a90('0x1e')](respondWithResult(_0x173b43,null))['catch'](handleError(_0x173b43,null));};exports[_0x6a90('0x1f')]=function(_0x362e74,_0x28c430){return db[_0x6a90('0x24')][_0x6a90('0x40')]({'where':{'id':_0x362e74[_0x6a90('0x3d')]['id']}})[_0x6a90('0x1e')](handleEntityNotFound(_0x28c430,null))[_0x6a90('0x1e')](removeEntity(_0x28c430,null))['catch'](handleError(_0x28c430,null));};exports[_0x6a90('0x43')]=function(_0x31a4e7,_0x3a4300){return db[_0x6a90('0x24')][_0x6a90('0x43')]()['then'](respondWithResult(_0x3a4300,null))['catch'](handleError(_0x3a4300,null));};
\ No newline at end of file
diff --git a/server/api/voiceDialReport/voiceDialReport.model.js b/server/api/voiceDialReport/voiceDialReport.model.js
index b096e9c..7c69fdd 100644
--- a/server/api/voiceDialReport/voiceDialReport.model.js
+++ b/server/api/voiceDialReport/voiceDialReport.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x68ae=['define','report_dial','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports'];(function(_0x50ccf2,_0x27068c){var _0x233920=function(_0x50a166){while(--_0x50a166){_0x50ccf2['push'](_0x50ccf2['shift']());}};_0x233920(++_0x27068c);}(_0x68ae,0xdf));var _0xe68a=function(_0x136e37,_0xcb0f92){_0x136e37=_0x136e37-0x0;var _0x27a9ac=_0x68ae[_0x136e37];return _0x27a9ac;};'use strict';var _=require(_0xe68a('0x0'));var util=require(_0xe68a('0x1'));var logger=require(_0xe68a('0x2'))(_0xe68a('0x3'));var moment=require(_0xe68a('0x4'));var BPromise=require(_0xe68a('0x5'));var rp=require(_0xe68a('0x6'));var fs=require('fs');var path=require(_0xe68a('0x7'));var rimraf=require(_0xe68a('0x8'));var config=require(_0xe68a('0x9'));var attributes=require('./voiceDialReport.attributes');module[_0xe68a('0xa')]=function(_0x5eec14,_0x1048a3){return _0x5eec14[_0xe68a('0xb')]('VoiceDialReport',attributes,{'tableName':_0xe68a('0xc'),'paranoid':![],'indexes':[{'fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
+var _0x08bb=['uniqueid','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceDialReport.attributes','exports','define','VoiceDialReport','report_dial'];(function(_0x36ee8b,_0x471b03){var _0x53cced=function(_0x5c93b8){while(--_0x5c93b8){_0x36ee8b['push'](_0x36ee8b['shift']());}};_0x53cced(++_0x471b03);}(_0x08bb,0x1f0));var _0xb08b=function(_0xaa1b3e,_0x47d976){_0xaa1b3e=_0xaa1b3e-0x0;var _0x454d7d=_0x08bb[_0xaa1b3e];return _0x454d7d;};'use strict';var _=require(_0xb08b('0x0'));var util=require(_0xb08b('0x1'));var logger=require(_0xb08b('0x2'))('api');var moment=require(_0xb08b('0x3'));var BPromise=require(_0xb08b('0x4'));var rp=require(_0xb08b('0x5'));var fs=require('fs');var path=require(_0xb08b('0x6'));var rimraf=require(_0xb08b('0x7'));var config=require(_0xb08b('0x8'));var attributes=require(_0xb08b('0x9'));module[_0xb08b('0xa')]=function(_0x5530bd,_0x5a05f9){return _0x5530bd[_0xb08b('0xb')](_0xb08b('0xc'),attributes,{'tableName':_0xb08b('0xd'),'paranoid':![],'indexes':[{'fields':[_0xb08b('0xe')]}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/voiceDialReport/voiceDialReport.rpc.js b/server/api/voiceDialReport/voiceDialReport.rpc.js
index 40e40c2..46a52c8 100644
--- a/server/api/voiceDialReport/voiceDialReport.rpc.js
+++ b/server/api/voiceDialReport/voiceDialReport.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xe80c=['limit','catch','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','then','request\x20sent','debug','VoiceDialReport,\x20%s,\x20%s,\x20%s','stringify','error','code','VoiceDialReport,\x20%s,\x20%s','message','result','CreateVoiceDialReport','VoiceDialReport','create','raw','info','UpdateVoiceDialReport','options','where','attributes'];(function(_0x541423,_0x12c464){var _0x2e644c=function(_0x86dfa){while(--_0x86dfa){_0x541423['push'](_0x541423['shift']());}};_0x2e644c(++_0x12c464);}(_0xe80c,0x1c2));var _0xce80=function(_0x4f394c,_0x281949){_0x4f394c=_0x4f394c-0x0;var _0x442544=_0xe80c[_0x4f394c];return _0x442544;};'use strict';var _=require('lodash');var util=require(_0xce80('0x0'));var moment=require(_0xce80('0x1'));var BPromise=require(_0xce80('0x2'));var rs=require(_0xce80('0x3'));var fs=require('fs');var Redis=require(_0xce80('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xce80('0x5'));var logger=require(_0xce80('0x6'))(_0xce80('0x7'));var config=require(_0xce80('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xce80('0x9')][_0xce80('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xd8b88e,_0x53574f,_0x2e1dc6){return new BPromise(function(_0x4c2e58,_0x40ee29){return client['request'](_0xd8b88e,_0x2e1dc6)[_0xce80('0xb')](function(_0x3331d6){logger['info']('VoiceDialReport,\x20%s,\x20%s',_0x53574f,_0xce80('0xc'));logger[_0xce80('0xd')](_0xce80('0xe'),_0x53574f,_0xce80('0xc'),JSON[_0xce80('0xf')](_0x3331d6));if(_0x3331d6[_0xce80('0x10')]){if(_0x3331d6[_0xce80('0x10')][_0xce80('0x11')]===0x1f4){logger['error'](_0xce80('0x12'),_0x53574f,_0x3331d6[_0xce80('0x10')][_0xce80('0x13')]);return _0x40ee29(_0x3331d6['error']['message']);}logger[_0xce80('0x10')](_0xce80('0x12'),_0x53574f,_0x3331d6[_0xce80('0x10')][_0xce80('0x13')]);return _0x4c2e58(_0x3331d6['error'][_0xce80('0x13')]);}else{logger['info'](_0xce80('0x12'),_0x53574f,'request\x20sent');_0x4c2e58(_0x3331d6[_0xce80('0x14')][_0xce80('0x13')]);}})['catch'](function(_0x58c0ab){logger['error'](_0xce80('0x12'),_0x53574f,_0x58c0ab);_0x40ee29(_0x58c0ab);});});}exports[_0xce80('0x15')]=function(_0x148d57){var _0x27b646=this;return new Promise(function(_0x4375b7,_0x5ebf73){return db[_0xce80('0x16')][_0xce80('0x17')](_0x148d57['body'],{'raw':_0x148d57['options']?_0x148d57['options'][_0xce80('0x18')]===undefined?!![]:![]:!![]})[_0xce80('0xb')](function(_0x468b61){logger[_0xce80('0x19')]('CreateVoiceDialReport',_0x148d57);logger[_0xce80('0xd')](_0xce80('0x15'),_0x148d57,JSON[_0xce80('0xf')](_0x468b61));_0x4375b7(_0x468b61);})['catch'](function(_0x4df9bb){logger[_0xce80('0x10')]('CreateVoiceDialReport',_0x4df9bb[_0xce80('0x13')],_0x148d57);_0x5ebf73(_0x27b646[_0xce80('0x10')](0x1f4,_0x4df9bb[_0xce80('0x13')]));});});};exports[_0xce80('0x1a')]=function(_0x4fc91c){var _0x199d17=this;return new Promise(function(_0x4982a9,_0x42a1dd){return db[_0xce80('0x16')]['update'](_0x4fc91c['body'],{'raw':_0x4fc91c[_0xce80('0x1b')]?_0x4fc91c['options'][_0xce80('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4fc91c[_0xce80('0x1b')]?_0x4fc91c[_0xce80('0x1b')][_0xce80('0x1c')]||null:null,'attributes':_0x4fc91c['options']?_0x4fc91c[_0xce80('0x1b')][_0xce80('0x1d')]||null:null,'limit':_0x4fc91c[_0xce80('0x1b')]?_0x4fc91c[_0xce80('0x1b')][_0xce80('0x1e')]||null:null})[_0xce80('0xb')](function(_0x4d8796){logger[_0xce80('0x19')]('UpdateVoiceDialReport',_0x4fc91c);logger[_0xce80('0xd')](_0xce80('0x1a'),_0x4fc91c,JSON[_0xce80('0xf')](_0x4d8796));_0x4982a9(_0x4d8796);})[_0xce80('0x1f')](function(_0x279931){logger[_0xce80('0x10')](_0xce80('0x1a'),_0x279931['message'],_0x4fc91c);_0x42a1dd(_0x199d17[_0xce80('0x10')](0x1f4,_0x279931['message']));});});};
\ No newline at end of file
+var _0xec56=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','VoiceDialReport,\x20%s,\x20%s','request\x20sent','debug','VoiceDialReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','CreateVoiceDialReport','VoiceDialReport','create','body','options','raw','update','UpdateVoiceDialReport','lodash','bluebird','randomstring'];(function(_0x1038c3,_0xc50eed){var _0x51b261=function(_0x165517){while(--_0x165517){_0x1038c3['push'](_0x1038c3['shift']());}};_0x51b261(++_0xc50eed);}(_0xec56,0x1bd));var _0x6ec5=function(_0x481297,_0x455503){_0x481297=_0x481297-0x0;var _0x47b80e=_0xec56[_0x481297];return _0x47b80e;};'use strict';var _=require(_0x6ec5('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x6ec5('0x1'));var rs=require(_0x6ec5('0x2'));var fs=require('fs');var Redis=require(_0x6ec5('0x3'));var db=require(_0x6ec5('0x4'))['db'];var utils=require(_0x6ec5('0x5'));var logger=require(_0x6ec5('0x6'))(_0x6ec5('0x7'));var config=require(_0x6ec5('0x8'));var jayson=require(_0x6ec5('0x9'));var client=jayson[_0x6ec5('0xa')][_0x6ec5('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3bb683,_0x35be4e,_0x1f59cd){return new BPromise(function(_0x3dd891,_0x225d2f){return client[_0x6ec5('0xc')](_0x3bb683,_0x1f59cd)[_0x6ec5('0xd')](function(_0x3ff17c){logger['info'](_0x6ec5('0xe'),_0x35be4e,_0x6ec5('0xf'));logger[_0x6ec5('0x10')](_0x6ec5('0x11'),_0x35be4e,_0x6ec5('0xf'),JSON[_0x6ec5('0x12')](_0x3ff17c));if(_0x3ff17c[_0x6ec5('0x13')]){if(_0x3ff17c['error'][_0x6ec5('0x14')]===0x1f4){logger[_0x6ec5('0x13')](_0x6ec5('0xe'),_0x35be4e,_0x3ff17c[_0x6ec5('0x13')][_0x6ec5('0x15')]);return _0x225d2f(_0x3ff17c[_0x6ec5('0x13')][_0x6ec5('0x15')]);}logger[_0x6ec5('0x13')]('VoiceDialReport,\x20%s,\x20%s',_0x35be4e,_0x3ff17c[_0x6ec5('0x13')]['message']);return _0x3dd891(_0x3ff17c[_0x6ec5('0x13')][_0x6ec5('0x15')]);}else{logger[_0x6ec5('0x16')](_0x6ec5('0xe'),_0x35be4e,_0x6ec5('0xf'));_0x3dd891(_0x3ff17c['result'][_0x6ec5('0x15')]);}})[_0x6ec5('0x17')](function(_0x125ae6){logger[_0x6ec5('0x13')](_0x6ec5('0xe'),_0x35be4e,_0x125ae6);_0x225d2f(_0x125ae6);});});}exports[_0x6ec5('0x18')]=function(_0x1dbee9){var _0x4237bc=this;return new Promise(function(_0x2608c0,_0x3d5d45){return db[_0x6ec5('0x19')][_0x6ec5('0x1a')](_0x1dbee9[_0x6ec5('0x1b')],{'raw':_0x1dbee9[_0x6ec5('0x1c')]?_0x1dbee9[_0x6ec5('0x1c')][_0x6ec5('0x1d')]===undefined?!![]:![]:!![]})[_0x6ec5('0xd')](function(_0x4abd5d){logger[_0x6ec5('0x16')](_0x6ec5('0x18'),_0x1dbee9);logger[_0x6ec5('0x10')](_0x6ec5('0x18'),_0x1dbee9,JSON[_0x6ec5('0x12')](_0x4abd5d));_0x2608c0(_0x4abd5d);})[_0x6ec5('0x17')](function(_0x18243f){logger['error'](_0x6ec5('0x18'),_0x18243f[_0x6ec5('0x15')],_0x1dbee9);_0x3d5d45(_0x4237bc[_0x6ec5('0x13')](0x1f4,_0x18243f[_0x6ec5('0x15')]));});});};exports['UpdateVoiceDialReport']=function(_0x27f631){var _0x280748=this;return new Promise(function(_0x5be80f,_0x2dc0a7){return db[_0x6ec5('0x19')][_0x6ec5('0x1e')](_0x27f631['body'],{'raw':_0x27f631[_0x6ec5('0x1c')]?_0x27f631[_0x6ec5('0x1c')][_0x6ec5('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x27f631[_0x6ec5('0x1c')]?_0x27f631[_0x6ec5('0x1c')]['where']||null:null,'attributes':_0x27f631[_0x6ec5('0x1c')]?_0x27f631[_0x6ec5('0x1c')]['attributes']||null:null,'limit':_0x27f631[_0x6ec5('0x1c')]?_0x27f631[_0x6ec5('0x1c')]['limit']||null:null})[_0x6ec5('0xd')](function(_0x3229db){logger[_0x6ec5('0x16')](_0x6ec5('0x1f'),_0x27f631);logger[_0x6ec5('0x10')]('UpdateVoiceDialReport',_0x27f631,JSON[_0x6ec5('0x12')](_0x3229db));_0x5be80f(_0x3229db);})[_0x6ec5('0x17')](function(_0x24aff9){logger[_0x6ec5('0x13')](_0x6ec5('0x1f'),_0x24aff9[_0x6ec5('0x15')],_0x27f631);_0x2dc0a7(_0x280748[_0x6ec5('0x13')](0x1f4,_0x24aff9['message']));});});};
\ No newline at end of file
diff --git a/server/api/voiceExtension/index.js b/server/api/voiceExtension/index.js
index 8fac33a..cb016c1 100644
--- a/server/api/voiceExtension/index.js
+++ b/server/api/voiceExtension/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x4301=['util','connect-timeout','Router','../../components/interaction/service','../../config/environment','./voiceExtension.controller','get','isAuthenticated','index','/:id','show','post','create','/:id/applications','addApplications','put','delete','destroy','exports','multer'];(function(_0x41ca44,_0x26dba4){var _0x42e3a7=function(_0x36845b){while(--_0x36845b){_0x41ca44['push'](_0x41ca44['shift']());}};_0x42e3a7(++_0x26dba4);}(_0x4301,0x103));var _0x1430=function(_0x1c8ee9,_0x4d3e93){_0x1c8ee9=_0x1c8ee9-0x0;var _0x51a54a=_0x4301[_0x1c8ee9];return _0x51a54a;};'use strict';var multer=require(_0x1430('0x0'));var util=require(_0x1430('0x1'));var path=require('path');var timeout=require(_0x1430('0x2'));var express=require('express');var router=express[_0x1430('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x1430('0x4'));var config=require(_0x1430('0x5'));var controller=require(_0x1430('0x6'));router[_0x1430('0x7')]('/',auth[_0x1430('0x8')](),controller[_0x1430('0x9')]);router[_0x1430('0x7')](_0x1430('0xa'),auth[_0x1430('0x8')](),controller[_0x1430('0xb')]);router[_0x1430('0xc')]('/',auth[_0x1430('0x8')](),controller[_0x1430('0xd')]);router['post'](_0x1430('0xe'),auth[_0x1430('0x8')](),controller[_0x1430('0xf')]);router[_0x1430('0x10')](_0x1430('0xa'),auth[_0x1430('0x8')](),controller['update']);router[_0x1430('0x11')]('/:id',auth[_0x1430('0x8')](),controller[_0x1430('0x12')]);module[_0x1430('0x13')]=router;
\ No newline at end of file
+var _0xb419=['/:id','show','post','/:id/applications','put','update','delete','destroy','util','path','express','Router','../../components/interaction/service','../../config/environment','get','isAuthenticated','index'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0xb419,0x6e));var _0x9b41=function(_0x16b27f,_0x40db62){_0x16b27f=_0x16b27f-0x0;var _0x1177e1=_0xb419[_0x16b27f];return _0x1177e1;};'use strict';var multer=require('multer');var util=require(_0x9b41('0x0'));var path=require(_0x9b41('0x1'));var timeout=require('connect-timeout');var express=require(_0x9b41('0x2'));var router=express[_0x9b41('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x9b41('0x4'));var config=require(_0x9b41('0x5'));var controller=require('./voiceExtension.controller');router[_0x9b41('0x6')]('/',auth[_0x9b41('0x7')](),controller[_0x9b41('0x8')]);router['get'](_0x9b41('0x9'),auth[_0x9b41('0x7')](),controller[_0x9b41('0xa')]);router[_0x9b41('0xb')]('/',auth[_0x9b41('0x7')](),controller['create']);router[_0x9b41('0xb')](_0x9b41('0xc'),auth['isAuthenticated'](),controller['addApplications']);router[_0x9b41('0xd')]('/:id',auth[_0x9b41('0x7')](),controller[_0x9b41('0xe')]);router[_0x9b41('0xf')](_0x9b41('0x9'),auth[_0x9b41('0x7')](),controller[_0x9b41('0x10')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/voiceExtension/voiceExtension.attributes.js b/server/api/voiceExtension/voiceExtension.attributes.js
index 8262871..5de3a28 100644
--- a/server/api/voiceExtension/voiceExtension.attributes.js
+++ b/server/api/voiceExtension/voiceExtension.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xa9e0=['*,*,*,*','INTEGER','BOOLEAN','VIRTUAL','getDataValue','exten','sequelize','exports','STRING','compositeIndex','NoOp','inbound','outbound','internal','system'];(function(_0x42bbc5,_0x4b6111){var _0xc4a454=function(_0x3da3a5){while(--_0x3da3a5){_0x42bbc5['push'](_0x42bbc5['shift']());}};_0xc4a454(++_0x4b6111);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4baae2,_0x487ab6){_0x4baae2=_0x4baae2-0x0;var _0x1a2285=_0xa9e0[_0x4baae2];return _0x1a2285;};'use strict';var Sequelize=require(_0x0a9e('0x0'));module[_0x0a9e('0x1')]={'context':{'type':Sequelize[_0x0a9e('0x2')],'allowNull':![],'unique':'compositeIndex','validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x0a9e('0x3')},'priority':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'1','unique':_0x0a9e('0x3')},'tag':{'type':Sequelize[_0x0a9e('0x2')],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize[_0x0a9e('0x2')],'allowNull':![],'defaultValue':_0x0a9e('0x4')},'appdata':{'type':Sequelize[_0x0a9e('0x2')](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize['ENUM'](_0x0a9e('0x5'),_0x0a9e('0x6'),_0x0a9e('0x7'),'inbound-fax','outbound-fax',_0x0a9e('0x8'),'any'),'allowNull':![]},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x0a9e('0x2')],'allowNull':![],'defaultValue':_0x0a9e('0x9')},'IntervalId':{'type':Sequelize[_0x0a9e('0xa')]},'isApp':{'type':Sequelize[_0x0a9e('0xb')],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':null},'callerID':{'type':Sequelize[_0x0a9e('0x2')],'allowNull':!![]},'record':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'cutdigits':{'type':Sequelize['INTEGER']},'recordingFormat':{'type':Sequelize['STRING'],'defaultValue':'wav'},'answer':{'type':Sequelize[_0x0a9e('0xb')],'defaultValue':!![]},'name':{'type':Sequelize[_0x0a9e('0xc')],'get':function(_0xd5b662){return this[_0x0a9e('0xd')](_0x0a9e('0xe'));}}};
\ No newline at end of file
+var _0xa9e0=['*,*,*,*','INTEGER','BOOLEAN','VIRTUAL','getDataValue','exten','sequelize','exports','STRING','compositeIndex','NoOp','inbound','outbound','internal','system'];(function(_0x5aa7dc,_0xac2340){var _0x5c8cfa=function(_0x1161b8){while(--_0x1161b8){_0x5aa7dc['push'](_0x5aa7dc['shift']());}};_0x5c8cfa(++_0xac2340);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1c546c,_0x5c57cb){_0x1c546c=_0x1c546c-0x0;var _0x2cc384=_0xa9e0[_0x1c546c];return _0x2cc384;};'use strict';var Sequelize=require(_0x0a9e('0x0'));module[_0x0a9e('0x1')]={'context':{'type':Sequelize[_0x0a9e('0x2')],'allowNull':![],'unique':'compositeIndex','validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x0a9e('0x3')},'priority':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'1','unique':_0x0a9e('0x3')},'tag':{'type':Sequelize[_0x0a9e('0x2')],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize[_0x0a9e('0x2')],'allowNull':![],'defaultValue':_0x0a9e('0x4')},'appdata':{'type':Sequelize[_0x0a9e('0x2')](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize['ENUM'](_0x0a9e('0x5'),_0x0a9e('0x6'),_0x0a9e('0x7'),'inbound-fax','outbound-fax',_0x0a9e('0x8'),'any'),'allowNull':![]},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x0a9e('0x2')],'allowNull':![],'defaultValue':_0x0a9e('0x9')},'IntervalId':{'type':Sequelize[_0x0a9e('0xa')]},'isApp':{'type':Sequelize[_0x0a9e('0xb')],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':null},'callerID':{'type':Sequelize[_0x0a9e('0x2')],'allowNull':!![]},'record':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'cutdigits':{'type':Sequelize['INTEGER']},'recordingFormat':{'type':Sequelize['STRING'],'defaultValue':'wav'},'answer':{'type':Sequelize[_0x0a9e('0xb')],'defaultValue':!![]},'name':{'type':Sequelize[_0x0a9e('0xc')],'get':function(_0xd5b662){return this[_0x0a9e('0xd')](_0x0a9e('0xe'));}}};
\ No newline at end of file
diff --git a/server/api/voiceExtension/voiceExtension.controller.js b/server/api/voiceExtension/voiceExtension.controller.js
index 9484d90..cf421df 100644
--- a/server/api/voiceExtension/voiceExtension.controller.js
+++ b/server/api/voiceExtension/voiceExtension.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x2ef3=['api','../../config/utils','../../mysqldb','defaults','localhost','socket.io-emitter','register','sendStatus','status','json','count','offset','limit','set','Content-Range','reject','then','InboundRoutes','inbound','OutboundRoutes','outbound','InternalRoutes','internal','filter','ignore','map','value','includes','type','find','name','destroy','end','stack','send','VoiceExtension','rawAttributes','key','model','keys','query','filters','attributes','intersection','fields','nolimit','order','sort','where','pick','options','includeAll','rows','catch','show','params','length','include','merge','create','body','exten','concat','user','get','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','context','recordingFormat','cutdigits','addApplications','findOne','sequelize','VoiceExtensionId','bulkCreate','findAndCountAll','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger'];(function(_0x934d6d,_0x26be85){var _0x3eec2e=function(_0x21f304){while(--_0x21f304){_0x934d6d['push'](_0x934d6d['shift']());}};_0x3eec2e(++_0x26be85);}(_0x2ef3,0xba));var _0x32ef=function(_0x422603,_0x4808e5){_0x422603=_0x422603-0x0;var _0x1d4b1b=_0x2ef3[_0x422603];return _0x1d4b1b;};'use strict';var pdf=require(_0x32ef('0x0'));var emlformat=require(_0x32ef('0x1'));var rimraf=require(_0x32ef('0x2'));var zipdir=require(_0x32ef('0x3'));var jsonpatch=require(_0x32ef('0x4'));var rp=require(_0x32ef('0x5'));var moment=require('moment');var BPromise=require(_0x32ef('0x6'));var Mustache=require(_0x32ef('0x7'));var util=require('util');var path=require(_0x32ef('0x8'));var sox=require(_0x32ef('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x32ef('0xa'));var squel=require(_0x32ef('0xb'));var crypto=require(_0x32ef('0xc'));var jsforce=require(_0x32ef('0xd'));var deskjs=require(_0x32ef('0xe'));var toCsv=require(_0x32ef('0xf'));var querystring=require(_0x32ef('0x10'));var Papa=require(_0x32ef('0x11'));var Redis=require(_0x32ef('0x12'));var authService=require(_0x32ef('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x32ef('0x14'));var logger=require(_0x32ef('0x15'))(_0x32ef('0x16'));var utils=require(_0x32ef('0x17'));var config=require('../../config/environment');var db=require(_0x32ef('0x18'))['db'];config['redis']=_[_0x32ef('0x19')](config['redis'],{'host':_0x32ef('0x1a'),'port':0x18eb});var socket=require(_0x32ef('0x1b'))(new Redis(config['redis']));require('./voiceExtension.socket')[_0x32ef('0x1c')](socket);function respondWithStatusCode(_0x4d8009,_0x326fce){_0x326fce=_0x326fce||0xcc;return function(_0x40a6e6){if(_0x40a6e6){return _0x4d8009[_0x32ef('0x1d')](_0x326fce);}return _0x4d8009[_0x32ef('0x1e')](_0x326fce)['end']();};}function respondWithResult(_0x55bf0b,_0x531e30){_0x531e30=_0x531e30||0xc8;return function(_0x13db1a){if(_0x13db1a){return _0x55bf0b[_0x32ef('0x1e')](_0x531e30)[_0x32ef('0x1f')](_0x13db1a);}};}function respondWithFilteredResult(_0x53a5ca,_0x5d559b){return function(_0x1eb468){if(_0x1eb468){var _0x1a9476=_0x1eb468[_0x32ef('0x20')],_0x286bfb=_0x5d559b['offset'],_0x57863c=_0x5d559b[_0x32ef('0x21')]+_0x5d559b[_0x32ef('0x22')],_0xbe37f6;if(_0x57863c>=_0x1a9476){_0x57863c=_0x1a9476;_0xbe37f6=0xc8;}else{_0xbe37f6=0xce;}_0x53a5ca[_0x32ef('0x1e')](_0xbe37f6);return _0x53a5ca[_0x32ef('0x23')](_0x32ef('0x24'),_0x286bfb+'-'+_0x57863c+'/'+_0x1a9476)[_0x32ef('0x1f')](_0x1eb468);}return null;};}function patchUpdates(_0x4de441){return function(_0x3c5b78){try{jsonpatch['apply'](_0x3c5b78,_0x4de441,!![]);}catch(_0x309866){return BPromise[_0x32ef('0x25')](_0x309866);}return _0x3c5b78['save']();};}function saveUpdates(_0x1af371,_0x97780){return function(_0x5e8898){if(_0x5e8898){return _0x5e8898['update'](_0x1af371)['then'](function(_0x22f2d7){return _0x22f2d7;});}return null;};}function removeEntity(_0xb30fab,_0x225feb){return function(_0x478bef){if(_0x478bef){return _0x478bef['destroy']()[_0x32ef('0x26')](function(){var _0x4d584b=_0x478bef['get']({'plain':!![]});var _0x278495=[{'name':_0x32ef('0x27'),'value':_0x32ef('0x28'),'ignore':![]},{'name':_0x32ef('0x29'),'value':_0x32ef('0x2a'),'ignore':![]},{'name':_0x32ef('0x2b'),'value':_0x32ef('0x2c'),'ignore':![]}];var _0x38aed5=_(_0x278495)[_0x32ef('0x2d')](_0x32ef('0x2e'))[_0x32ef('0x2f')](_0x32ef('0x30'))['value']();if(_[_0x32ef('0x31')](_0x38aed5,_0x4d584b[_0x32ef('0x32')])){return;}var _0x5a04cd=_[_0x32ef('0x33')](_0x278495,[_0x32ef('0x30'),_0x4d584b[_0x32ef('0x32')]])[_0x32ef('0x34')];return db['UserProfileResource'][_0x32ef('0x35')]({'where':{'type':_0x5a04cd,'resourceId':_0x4d584b['id']}})[_0x32ef('0x26')](function(){return _0x478bef;});})[_0x32ef('0x26')](function(){_0xb30fab[_0x32ef('0x1e')](0xcc)[_0x32ef('0x36')]();});}};}function handleEntityNotFound(_0x1a6ed2,_0x1a122d){return function(_0x575f3e){if(!_0x575f3e){_0x1a6ed2[_0x32ef('0x1d')](0x194);}return _0x575f3e;};}function handleError(_0x537214,_0x38bf73){_0x38bf73=_0x38bf73||0x1f4;return function(_0x2b6c6a){logger['error'](_0x2b6c6a[_0x32ef('0x37')]);if(_0x2b6c6a[_0x32ef('0x34')]){delete _0x2b6c6a[_0x32ef('0x34')];}_0x537214[_0x32ef('0x1e')](_0x38bf73)[_0x32ef('0x38')](_0x2b6c6a);};}exports['index']=function(_0x50ecd6,_0x2a5eb5){var _0x5dadf7={},_0x643dc4={},_0x15b873={'count':0x0,'rows':[]};var _0x2f1349=_[_0x32ef('0x2f')](db[_0x32ef('0x39')][_0x32ef('0x3a')],function(_0x566b56){return{'name':_0x566b56['fieldName'],'type':_0x566b56['type'][_0x32ef('0x3b')]};});_0x643dc4[_0x32ef('0x3c')]=_[_0x32ef('0x2f')](_0x2f1349,'name');_0x643dc4['query']=_[_0x32ef('0x3d')](_0x50ecd6[_0x32ef('0x3e')]);_0x643dc4[_0x32ef('0x3f')]=_['intersection'](_0x643dc4['model'],_0x643dc4[_0x32ef('0x3e')]);_0x5dadf7[_0x32ef('0x40')]=_[_0x32ef('0x41')](_0x643dc4[_0x32ef('0x3c')],qs[_0x32ef('0x42')](_0x50ecd6[_0x32ef('0x3e')][_0x32ef('0x42')]));_0x5dadf7[_0x32ef('0x40')]=_0x5dadf7[_0x32ef('0x40')]['length']?_0x5dadf7[_0x32ef('0x40')]:_0x643dc4[_0x32ef('0x3c')];if(!_0x50ecd6[_0x32ef('0x3e')]['hasOwnProperty'](_0x32ef('0x43'))){_0x5dadf7[_0x32ef('0x22')]=qs[_0x32ef('0x22')](_0x50ecd6[_0x32ef('0x3e')][_0x32ef('0x22')]);_0x5dadf7[_0x32ef('0x21')]=qs[_0x32ef('0x21')](_0x50ecd6[_0x32ef('0x3e')][_0x32ef('0x21')]);}_0x5dadf7[_0x32ef('0x44')]=qs[_0x32ef('0x45')](_0x50ecd6[_0x32ef('0x3e')]['sort']);_0x5dadf7[_0x32ef('0x46')]=qs[_0x32ef('0x3f')](_[_0x32ef('0x47')](_0x50ecd6[_0x32ef('0x3e')],_0x643dc4[_0x32ef('0x3f')]),_0x2f1349);if(_0x50ecd6[_0x32ef('0x3e')][_0x32ef('0x2d')]){_0x5dadf7['where']=_['merge'](_0x5dadf7[_0x32ef('0x46')],{'$or':_[_0x32ef('0x2f')](_0x2f1349,function(_0x2a33dd){if(_0x2a33dd[_0x32ef('0x32')]!=='VIRTUAL'){var _0x2901a1={};_0x2901a1[_0x2a33dd[_0x32ef('0x34')]]={'$like':'%'+_0x50ecd6['query'][_0x32ef('0x2d')]+'%'};return _0x2901a1;}})});}_0x5dadf7=_['merge']({},_0x5dadf7,_0x50ecd6[_0x32ef('0x48')]);var _0x100ec7={'where':_0x5dadf7[_0x32ef('0x46')]};return db[_0x32ef('0x39')][_0x32ef('0x20')](_0x100ec7)[_0x32ef('0x26')](function(_0x321ef7){_0x15b873[_0x32ef('0x20')]=_0x321ef7;if(_0x50ecd6[_0x32ef('0x3e')][_0x32ef('0x49')]){_0x5dadf7['include']=[{'all':!![]}];}return db[_0x32ef('0x39')]['findAll'](_0x5dadf7);})[_0x32ef('0x26')](function(_0x33c25b){_0x15b873[_0x32ef('0x4a')]=_0x33c25b;return _0x15b873;})['then'](respondWithFilteredResult(_0x2a5eb5,_0x5dadf7))[_0x32ef('0x4b')](handleError(_0x2a5eb5,null));};exports[_0x32ef('0x4c')]=function(_0x37b954,_0x241f82){var _0x35b4e0={'raw':![],'where':{'id':_0x37b954[_0x32ef('0x4d')]['id']}},_0x40bf12={};_0x40bf12['model']=_['keys'](db[_0x32ef('0x39')][_0x32ef('0x3a')]);_0x40bf12[_0x32ef('0x3e')]=_[_0x32ef('0x3d')](_0x37b954[_0x32ef('0x3e')]);_0x40bf12[_0x32ef('0x3f')]=_[_0x32ef('0x41')](_0x40bf12[_0x32ef('0x3c')],_0x40bf12[_0x32ef('0x3e')]);_0x35b4e0[_0x32ef('0x40')]=_[_0x32ef('0x41')](_0x40bf12[_0x32ef('0x3c')],qs[_0x32ef('0x42')](_0x37b954['query'][_0x32ef('0x42')]));_0x35b4e0[_0x32ef('0x40')]=_0x35b4e0[_0x32ef('0x40')][_0x32ef('0x4e')]?_0x35b4e0[_0x32ef('0x40')]:_0x40bf12[_0x32ef('0x3c')];if(_0x37b954[_0x32ef('0x3e')][_0x32ef('0x49')]){_0x35b4e0[_0x32ef('0x4f')]=[{'all':!![]}];}_0x35b4e0=_[_0x32ef('0x50')]({},_0x35b4e0,_0x37b954[_0x32ef('0x48')]);return db[_0x32ef('0x39')][_0x32ef('0x33')](_0x35b4e0)[_0x32ef('0x26')](handleEntityNotFound(_0x241f82,null))[_0x32ef('0x26')](respondWithResult(_0x241f82,null))[_0x32ef('0x4b')](handleError(_0x241f82,null));};exports[_0x32ef('0x35')]=function(_0x2c1b44,_0x4e0d6b){return db['VoiceExtension'][_0x32ef('0x33')]({'where':{'id':_0x2c1b44[_0x32ef('0x4d')]['id']}})[_0x32ef('0x26')](handleEntityNotFound(_0x4e0d6b,null))[_0x32ef('0x26')](removeEntity(_0x4e0d6b,null))[_0x32ef('0x4b')](handleError(_0x4e0d6b,null));};exports[_0x32ef('0x51')]=function(_0x1572d9,_0x1f105a){if(_0x1572d9[_0x32ef('0x52')][_0x32ef('0x32')]===_0x32ef('0x2a')&&!_['startsWith'](_0x1572d9[_0x32ef('0x52')][_0x32ef('0x53')],'_')){_0x1572d9[_0x32ef('0x52')][_0x32ef('0x53')]='_'[_0x32ef('0x54')](_0x1572d9[_0x32ef('0x52')]['exten']);}return db[_0x32ef('0x39')][_0x32ef('0x51')](_0x1572d9[_0x32ef('0x52')],{'raw':![]})['then'](function(_0x1b0faa){var _0x52692a=_0x1572d9[_0x32ef('0x55')][_0x32ef('0x56')]({'plain':!![]});if(!_0x52692a)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x52692a[_0x32ef('0x57')]==='user'){var _0x13f5db=_0x1b0faa[_0x32ef('0x56')]({'plain':!![]});var _0x2bff39=[{'name':_0x32ef('0x27'),'value':_0x32ef('0x28')},{'name':_0x32ef('0x29'),'value':_0x32ef('0x2a')},{'name':'InternalRoutes','value':'internal'}];var _0xdfa103=_['find'](_0x2bff39,['value',_0x13f5db[_0x32ef('0x32')]])[_0x32ef('0x34')];return db[_0x32ef('0x58')][_0x32ef('0x33')]({'where':{'name':_0xdfa103,'userProfileId':_0x52692a[_0x32ef('0x59')]},'raw':!![]})[_0x32ef('0x26')](function(_0x316547){if(_0x316547&&_0x316547[_0x32ef('0x5a')]===0x0){return db[_0x32ef('0x5b')][_0x32ef('0x51')]({'name':_0x13f5db['name'],'resourceId':_0x13f5db['id'],'type':_0x316547['name'],'sectionId':_0x316547['id']},{})[_0x32ef('0x26')](function(){return _0x1b0faa;});}else{return _0x1b0faa;}})[_0x32ef('0x4b')](function(_0x5549b4){logger[_0x32ef('0x5c')](_0x32ef('0x5d'),_0x5549b4);throw _0x5549b4;});}return _0x1b0faa;})[_0x32ef('0x26')](respondWithResult(_0x1f105a,0xc9))['catch'](handleError(_0x1f105a,null));};exports[_0x32ef('0x5e')]=function(_0x3c31d0,_0x20dcc5){if(_0x3c31d0['body']['id']){delete _0x3c31d0['body']['id'];}return db[_0x32ef('0x39')]['find']({'where':{'id':_0x3c31d0[_0x32ef('0x4d')]['id']}})['then'](handleEntityNotFound(_0x20dcc5,null))['then'](function(_0x24cf09){if(_0x24cf09){return db[_0x32ef('0x39')][_0x32ef('0x5e')](_['pick'](_0x3c31d0[_0x32ef('0x52')],[_0x32ef('0x53'),_0x32ef('0x5f'),'description',_0x32ef('0x60'),_0x32ef('0x61'),'mandatoryDisposition']),{'where':{'context':_0x24cf09['context'],'exten':_0x24cf09[_0x32ef('0x53')]},'individualHooks':!![]})[_0x32ef('0x26')](function(_0x2518a0){return _0x2518a0;});}return null;})[_0x32ef('0x26')](respondWithStatusCode(_0x20dcc5,null))[_0x32ef('0x4b')](handleError(_0x20dcc5,null));};exports[_0x32ef('0x62')]=function(_0x4c89e8,_0x285330,_0x63b65){return db[_0x32ef('0x39')][_0x32ef('0x63')]({'where':{'id':_0x4c89e8[_0x32ef('0x4d')]['id']}})[_0x32ef('0x26')](handleEntityNotFound(_0x285330,null))[_0x32ef('0x26')](function(_0x3ff282){if(_0x3ff282){return db[_0x32ef('0x64')]['transaction'](function(_0x1d7898){return db[_0x32ef('0x39')][_0x32ef('0x35')]({'where':{'VoiceExtensionId':_0x4c89e8[_0x32ef('0x4d')]['id']},'transaction':_0x1d7898})[_0x32ef('0x26')](function(_0x5ad75c){var _0x47c0ed=_[_0x32ef('0x2f')](_0x4c89e8[_0x32ef('0x52')],function(_0x366903){_0x366903[_0x32ef('0x65')]=_0x4c89e8[_0x32ef('0x4d')]['id'];return _0x366903;});return db['VoiceExtension'][_0x32ef('0x66')](_0x47c0ed,{'transaction':_0x1d7898});});})['then'](function(){return db[_0x32ef('0x39')][_0x32ef('0x67')]({'where':{'isApp':!![],'VoiceExtensionId':_0x4c89e8['params']['id']},'order':'cast(priority\x20as\x20unsigned)'});});}})[_0x32ef('0x26')](respondWithResult(_0x285330,null))[_0x32ef('0x4b')](handleError(_0x285330,null));};
\ No newline at end of file
+var _0x1a85=['../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','sendStatus','end','status','json','count','offset','limit','set','Content-Range','save','then','destroy','get','InboundRoutes','inbound','OutboundRoutes','InternalRoutes','internal','filter','ignore','map','value','includes','type','find','UserProfileResource','stack','name','send','VoiceExtension','rawAttributes','fieldName','keys','filters','intersection','model','query','attributes','length','hasOwnProperty','nolimit','sort','where','pick','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','fields','params','create','body','outbound','startsWith','exten','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','mandatoryDisposition','addApplications','VoiceExtensionId','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','sox','ejs','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0x5cf964,_0x3f16fd){var _0x34bcb7=function(_0x3a1c78){while(--_0x3a1c78){_0x5cf964['push'](_0x5cf964['shift']());}};_0x34bcb7(++_0x3f16fd);}(_0x1a85,0x178));var _0x51a8=function(_0x5b964b,_0xe2062a){_0x5b964b=_0x5b964b-0x0;var _0x2f187d=_0x1a85[_0x5b964b];return _0x2f187d;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x51a8('0x0'));var zipdir=require(_0x51a8('0x1'));var jsonpatch=require(_0x51a8('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x51a8('0x3'));var Mustache=require(_0x51a8('0x4'));var util=require(_0x51a8('0x5'));var path=require('path');var sox=require(_0x51a8('0x6'));var csv=require('to-csv');var ejs=require(_0x51a8('0x7'));var fs=require('fs');var _=require('lodash');var squel=require(_0x51a8('0x8'));var crypto=require(_0x51a8('0x9'));var jsforce=require('jsforce');var deskjs=require(_0x51a8('0xa'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x51a8('0xb'));var Redis=require(_0x51a8('0xc'));var authService=require(_0x51a8('0xd'));var qs=require(_0x51a8('0xe'));var as=require(_0x51a8('0xf'));var hardwareService=require(_0x51a8('0x10'));var logger=require(_0x51a8('0x11'))(_0x51a8('0x12'));var utils=require(_0x51a8('0x13'));var config=require(_0x51a8('0x14'));var db=require(_0x51a8('0x15'))['db'];config[_0x51a8('0x16')]=_[_0x51a8('0x17')](config[_0x51a8('0x16')],{'host':_0x51a8('0x18'),'port':0x18eb});var socket=require(_0x51a8('0x19'))(new Redis(config[_0x51a8('0x16')]));require('./voiceExtension.socket')[_0x51a8('0x1a')](socket);function respondWithStatusCode(_0x7a4c36,_0xaec066){_0xaec066=_0xaec066||0xcc;return function(_0x50d992){if(_0x50d992){return _0x7a4c36[_0x51a8('0x1b')](_0xaec066);}return _0x7a4c36['status'](_0xaec066)[_0x51a8('0x1c')]();};}function respondWithResult(_0x2b8d37,_0x39cd45){_0x39cd45=_0x39cd45||0xc8;return function(_0x2b0521){if(_0x2b0521){return _0x2b8d37[_0x51a8('0x1d')](_0x39cd45)[_0x51a8('0x1e')](_0x2b0521);}};}function respondWithFilteredResult(_0x1f49ee,_0x516abc){return function(_0x1c2f25){if(_0x1c2f25){var _0x45a433=_0x1c2f25[_0x51a8('0x1f')],_0xd52230=_0x516abc['offset'],_0x23539e=_0x516abc[_0x51a8('0x20')]+_0x516abc[_0x51a8('0x21')],_0x3bc1a2;if(_0x23539e>=_0x45a433){_0x23539e=_0x45a433;_0x3bc1a2=0xc8;}else{_0x3bc1a2=0xce;}_0x1f49ee[_0x51a8('0x1d')](_0x3bc1a2);return _0x1f49ee[_0x51a8('0x22')](_0x51a8('0x23'),_0xd52230+'-'+_0x23539e+'/'+_0x45a433)[_0x51a8('0x1e')](_0x1c2f25);}return null;};}function patchUpdates(_0x28aea0){return function(_0x3bf5b6){try{jsonpatch['apply'](_0x3bf5b6,_0x28aea0,!![]);}catch(_0xf80fa9){return BPromise['reject'](_0xf80fa9);}return _0x3bf5b6[_0x51a8('0x24')]();};}function saveUpdates(_0x12c029,_0x8bda40){return function(_0x3759d6){if(_0x3759d6){return _0x3759d6['update'](_0x12c029)[_0x51a8('0x25')](function(_0x4b9cdd){return _0x4b9cdd;});}return null;};}function removeEntity(_0x47f063,_0x23d26a){return function(_0x52e503){if(_0x52e503){return _0x52e503[_0x51a8('0x26')]()[_0x51a8('0x25')](function(){var _0x20ef8b=_0x52e503[_0x51a8('0x27')]({'plain':!![]});var _0x157554=[{'name':_0x51a8('0x28'),'value':_0x51a8('0x29'),'ignore':![]},{'name':_0x51a8('0x2a'),'value':'outbound','ignore':![]},{'name':_0x51a8('0x2b'),'value':_0x51a8('0x2c'),'ignore':![]}];var _0xca5746=_(_0x157554)[_0x51a8('0x2d')](_0x51a8('0x2e'))[_0x51a8('0x2f')](_0x51a8('0x30'))[_0x51a8('0x30')]();if(_[_0x51a8('0x31')](_0xca5746,_0x20ef8b[_0x51a8('0x32')])){return;}var _0x20c6b5=_[_0x51a8('0x33')](_0x157554,['value',_0x20ef8b[_0x51a8('0x32')]])['name'];return db[_0x51a8('0x34')][_0x51a8('0x26')]({'where':{'type':_0x20c6b5,'resourceId':_0x20ef8b['id']}})[_0x51a8('0x25')](function(){return _0x52e503;});})[_0x51a8('0x25')](function(){_0x47f063[_0x51a8('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x10c19b,_0x4c67ff){return function(_0x41c4de){if(!_0x41c4de){_0x10c19b[_0x51a8('0x1b')](0x194);}return _0x41c4de;};}function handleError(_0x253a59,_0x4b19c8){_0x4b19c8=_0x4b19c8||0x1f4;return function(_0x2080a1){logger['error'](_0x2080a1[_0x51a8('0x35')]);if(_0x2080a1[_0x51a8('0x36')]){delete _0x2080a1[_0x51a8('0x36')];}_0x253a59[_0x51a8('0x1d')](_0x4b19c8)[_0x51a8('0x37')](_0x2080a1);};}exports['index']=function(_0x1167b8,_0x53b3b6){var _0x9f0e6={},_0x2d977b={},_0x41561a={'count':0x0,'rows':[]};var _0x578fc6=_[_0x51a8('0x2f')](db[_0x51a8('0x38')][_0x51a8('0x39')],function(_0x2429f8){return{'name':_0x2429f8[_0x51a8('0x3a')],'type':_0x2429f8['type']['key']};});_0x2d977b['model']=_[_0x51a8('0x2f')](_0x578fc6,_0x51a8('0x36'));_0x2d977b['query']=_[_0x51a8('0x3b')](_0x1167b8['query']);_0x2d977b[_0x51a8('0x3c')]=_[_0x51a8('0x3d')](_0x2d977b[_0x51a8('0x3e')],_0x2d977b[_0x51a8('0x3f')]);_0x9f0e6[_0x51a8('0x40')]=_[_0x51a8('0x3d')](_0x2d977b['model'],qs['fields'](_0x1167b8[_0x51a8('0x3f')]['fields']));_0x9f0e6['attributes']=_0x9f0e6['attributes'][_0x51a8('0x41')]?_0x9f0e6[_0x51a8('0x40')]:_0x2d977b[_0x51a8('0x3e')];if(!_0x1167b8['query'][_0x51a8('0x42')](_0x51a8('0x43'))){_0x9f0e6[_0x51a8('0x21')]=qs[_0x51a8('0x21')](_0x1167b8['query'][_0x51a8('0x21')]);_0x9f0e6[_0x51a8('0x20')]=qs[_0x51a8('0x20')](_0x1167b8['query'][_0x51a8('0x20')]);}_0x9f0e6['order']=qs[_0x51a8('0x44')](_0x1167b8[_0x51a8('0x3f')][_0x51a8('0x44')]);_0x9f0e6[_0x51a8('0x45')]=qs['filters'](_[_0x51a8('0x46')](_0x1167b8[_0x51a8('0x3f')],_0x2d977b[_0x51a8('0x3c')]),_0x578fc6);if(_0x1167b8[_0x51a8('0x3f')][_0x51a8('0x2d')]){_0x9f0e6[_0x51a8('0x45')]=_[_0x51a8('0x47')](_0x9f0e6[_0x51a8('0x45')],{'$or':_[_0x51a8('0x2f')](_0x578fc6,function(_0x4b8467){if(_0x4b8467[_0x51a8('0x32')]!==_0x51a8('0x48')){var _0x4c7c67={};_0x4c7c67[_0x4b8467['name']]={'$like':'%'+_0x1167b8[_0x51a8('0x3f')][_0x51a8('0x2d')]+'%'};return _0x4c7c67;}})});}_0x9f0e6=_[_0x51a8('0x47')]({},_0x9f0e6,_0x1167b8[_0x51a8('0x49')]);var _0x311574={'where':_0x9f0e6[_0x51a8('0x45')]};return db[_0x51a8('0x38')][_0x51a8('0x1f')](_0x311574)[_0x51a8('0x25')](function(_0x2e80ed){_0x41561a['count']=_0x2e80ed;if(_0x1167b8[_0x51a8('0x3f')][_0x51a8('0x4a')]){_0x9f0e6[_0x51a8('0x4b')]=[{'all':!![]}];}return db[_0x51a8('0x38')][_0x51a8('0x4c')](_0x9f0e6);})[_0x51a8('0x25')](function(_0x579411){_0x41561a[_0x51a8('0x4d')]=_0x579411;return _0x41561a;})['then'](respondWithFilteredResult(_0x53b3b6,_0x9f0e6))[_0x51a8('0x4e')](handleError(_0x53b3b6,null));};exports[_0x51a8('0x4f')]=function(_0xa5d597,_0xc856d1){var _0x246b72={'raw':![],'where':{'id':_0xa5d597['params']['id']}},_0x56d002={};_0x56d002[_0x51a8('0x3e')]=_[_0x51a8('0x3b')](db[_0x51a8('0x38')][_0x51a8('0x39')]);_0x56d002[_0x51a8('0x3f')]=_['keys'](_0xa5d597['query']);_0x56d002[_0x51a8('0x3c')]=_[_0x51a8('0x3d')](_0x56d002[_0x51a8('0x3e')],_0x56d002[_0x51a8('0x3f')]);_0x246b72[_0x51a8('0x40')]=_[_0x51a8('0x3d')](_0x56d002[_0x51a8('0x3e')],qs[_0x51a8('0x50')](_0xa5d597[_0x51a8('0x3f')]['fields']));_0x246b72['attributes']=_0x246b72['attributes'][_0x51a8('0x41')]?_0x246b72[_0x51a8('0x40')]:_0x56d002[_0x51a8('0x3e')];if(_0xa5d597['query'][_0x51a8('0x4a')]){_0x246b72[_0x51a8('0x4b')]=[{'all':!![]}];}_0x246b72=_['merge']({},_0x246b72,_0xa5d597[_0x51a8('0x49')]);return db['VoiceExtension']['find'](_0x246b72)[_0x51a8('0x25')](handleEntityNotFound(_0xc856d1,null))[_0x51a8('0x25')](respondWithResult(_0xc856d1,null))[_0x51a8('0x4e')](handleError(_0xc856d1,null));};exports['destroy']=function(_0x5b5aa5,_0x3a8f1e){return db['VoiceExtension'][_0x51a8('0x33')]({'where':{'id':_0x5b5aa5[_0x51a8('0x51')]['id']}})[_0x51a8('0x25')](handleEntityNotFound(_0x3a8f1e,null))[_0x51a8('0x25')](removeEntity(_0x3a8f1e,null))[_0x51a8('0x4e')](handleError(_0x3a8f1e,null));};exports[_0x51a8('0x52')]=function(_0x2a87e2,_0x406a87){if(_0x2a87e2[_0x51a8('0x53')]['type']===_0x51a8('0x54')&&!_[_0x51a8('0x55')](_0x2a87e2[_0x51a8('0x53')][_0x51a8('0x56')],'_')){_0x2a87e2['body'][_0x51a8('0x56')]='_'['concat'](_0x2a87e2[_0x51a8('0x53')][_0x51a8('0x56')]);}return db['VoiceExtension']['create'](_0x2a87e2[_0x51a8('0x53')],{'raw':![]})[_0x51a8('0x25')](function(_0x165366){var _0x1aaeaf=_0x2a87e2[_0x51a8('0x57')]['get']({'plain':!![]});if(!_0x1aaeaf)throw new Error(_0x51a8('0x58'));if(_0x1aaeaf[_0x51a8('0x59')]===_0x51a8('0x57')){var _0x308d40=_0x165366[_0x51a8('0x27')]({'plain':!![]});var _0x5d44fe=[{'name':_0x51a8('0x28'),'value':_0x51a8('0x29')},{'name':_0x51a8('0x2a'),'value':_0x51a8('0x54')},{'name':_0x51a8('0x2b'),'value':_0x51a8('0x2c')}];var _0x4d2699=_['find'](_0x5d44fe,['value',_0x308d40['type']])[_0x51a8('0x36')];return db[_0x51a8('0x5a')]['find']({'where':{'name':_0x4d2699,'userProfileId':_0x1aaeaf[_0x51a8('0x5b')]},'raw':!![]})['then'](function(_0x41cc00){if(_0x41cc00&&_0x41cc00['autoAssociation']===0x0){return db[_0x51a8('0x34')][_0x51a8('0x52')]({'name':_0x308d40['name'],'resourceId':_0x308d40['id'],'type':_0x41cc00['name'],'sectionId':_0x41cc00['id']},{})['then'](function(){return _0x165366;});}else{return _0x165366;}})[_0x51a8('0x4e')](function(_0x1ead77){logger[_0x51a8('0x5c')](_0x51a8('0x5d'),_0x1ead77);throw _0x1ead77;});}return _0x165366;})[_0x51a8('0x25')](respondWithResult(_0x406a87,0xc9))[_0x51a8('0x4e')](handleError(_0x406a87,null));};exports[_0x51a8('0x5e')]=function(_0x259153,_0x494e11){if(_0x259153[_0x51a8('0x53')]['id']){delete _0x259153[_0x51a8('0x53')]['id'];}return db['VoiceExtension'][_0x51a8('0x33')]({'where':{'id':_0x259153[_0x51a8('0x51')]['id']}})[_0x51a8('0x25')](handleEntityNotFound(_0x494e11,null))[_0x51a8('0x25')](function(_0x2e1250){if(_0x2e1250){return db[_0x51a8('0x38')]['update'](_['pick'](_0x259153[_0x51a8('0x53')],['exten','context','description','recordingFormat','cutdigits',_0x51a8('0x5f')]),{'where':{'context':_0x2e1250['context'],'exten':_0x2e1250[_0x51a8('0x56')]},'individualHooks':!![]})[_0x51a8('0x25')](function(_0x1e7135){return _0x1e7135;});}return null;})[_0x51a8('0x25')](respondWithStatusCode(_0x494e11,null))[_0x51a8('0x4e')](handleError(_0x494e11,null));};exports[_0x51a8('0x60')]=function(_0x28c539,_0xdafa01,_0x4b4740){return db[_0x51a8('0x38')]['findOne']({'where':{'id':_0x28c539[_0x51a8('0x51')]['id']}})[_0x51a8('0x25')](handleEntityNotFound(_0xdafa01,null))[_0x51a8('0x25')](function(_0x522677){if(_0x522677){return db['sequelize']['transaction'](function(_0x10c22e){return db[_0x51a8('0x38')][_0x51a8('0x26')]({'where':{'VoiceExtensionId':_0x28c539[_0x51a8('0x51')]['id']},'transaction':_0x10c22e})[_0x51a8('0x25')](function(_0x1462b4){var _0x351c22=_[_0x51a8('0x2f')](_0x28c539[_0x51a8('0x53')],function(_0x462555){_0x462555[_0x51a8('0x61')]=_0x28c539[_0x51a8('0x51')]['id'];return _0x462555;});return db[_0x51a8('0x38')]['bulkCreate'](_0x351c22,{'transaction':_0x10c22e});});})[_0x51a8('0x25')](function(){return db[_0x51a8('0x38')]['findAndCountAll']({'where':{'isApp':!![],'VoiceExtensionId':_0x28c539[_0x51a8('0x51')]['id']},'order':'cast(priority\x20as\x20unsigned)'});});}})['then'](respondWithResult(_0xdafa01,null))['catch'](handleError(_0xdafa01,null));};
\ No newline at end of file
diff --git a/server/api/voiceExtension/voiceExtension.events.js b/server/api/voiceExtension/voiceExtension.events.js
index ac81e69..845aceb 100644
--- a/server/api/voiceExtension/voiceExtension.events.js
+++ b/server/api/voiceExtension/voiceExtension.events.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x92af=['VoiceExtension','setMaxListeners','save','update','emit','hook','events','../../mysqldb'];(function(_0x2d2ccc,_0x30f2fe){var _0x54dc55=function(_0x378643){while(--_0x378643){_0x2d2ccc['push'](_0x2d2ccc['shift']());}};_0x54dc55(++_0x30f2fe);}(_0x92af,0xee));var _0xf92a=function(_0x38314c,_0xc7487f){_0x38314c=_0x38314c-0x0;var _0x4d0d62=_0x92af[_0x38314c];return _0x4d0d62;};'use strict';var EventEmitter=require(_0xf92a('0x0'));var VoiceExtension=require(_0xf92a('0x1'))['db'][_0xf92a('0x2')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents[_0xf92a('0x3')](0x0);var events={'afterCreate':_0xf92a('0x4'),'afterUpdate':_0xf92a('0x5'),'afterDestroy':'remove'};function emitEvent(_0xacb462){return function(_0x4240e1,_0x2b4c41,_0x9a9e43){VoiceExtensionEvents[_0xf92a('0x6')](_0xacb462+':'+_0x4240e1['id'],_0x4240e1);VoiceExtensionEvents[_0xf92a('0x6')](_0xacb462,_0x4240e1);_0x9a9e43(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceExtension[_0xf92a('0x7')](e,emitEvent(event));}}module['exports']=VoiceExtensionEvents;
\ No newline at end of file
+var _0xfcfe=['update','remove','hook','events','VoiceExtension','save'];(function(_0x59fc49,_0xbc130a){var _0x48debe=function(_0x16a963){while(--_0x16a963){_0x59fc49['push'](_0x59fc49['shift']());}};_0x48debe(++_0xbc130a);}(_0xfcfe,0xff));var _0xefcf=function(_0x209fbf,_0x375c5d){_0x209fbf=_0x209fbf-0x0;var _0x2cf14b=_0xfcfe[_0x209fbf];return _0x2cf14b;};'use strict';var EventEmitter=require(_0xefcf('0x0'));var VoiceExtension=require('../../mysqldb')['db'][_0xefcf('0x1')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xefcf('0x2'),'afterUpdate':_0xefcf('0x3'),'afterDestroy':_0xefcf('0x4')};function emitEvent(_0x25c81e){return function(_0x45aaf2,_0x335184,_0x3785ce){VoiceExtensionEvents['emit'](_0x25c81e+':'+_0x45aaf2['id'],_0x45aaf2);VoiceExtensionEvents['emit'](_0x25c81e,_0x45aaf2);_0x3785ce(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceExtension[_0xefcf('0x5')](e,emitEvent(event));}}module['exports']=VoiceExtensionEvents;
\ No newline at end of file
diff --git a/server/api/voiceExtension/voiceExtension.model.js b/server/api/voiceExtension/voiceExtension.model.js
index a994180..5a54691 100644
--- a/server/api/voiceExtension/voiceExtension.model.js
+++ b/server/api/voiceExtension/voiceExtension.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xdb28=['../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','exports','VoiceExtension','voice_extensions','lodash','util'];(function(_0x455cad,_0x14897e){var _0x56ab87=function(_0x12cbbc){while(--_0x12cbbc){_0x455cad['push'](_0x455cad['shift']());}};_0x56ab87(++_0x14897e);}(_0xdb28,0x106));var _0x8db2=function(_0x2f2c10,_0x4e5134){_0x2f2c10=_0x2f2c10-0x0;var _0x4ed542=_0xdb28[_0x2f2c10];return _0x4ed542;};'use strict';var _=require(_0x8db2('0x0'));var util=require(_0x8db2('0x1'));var logger=require(_0x8db2('0x2'))(_0x8db2('0x3'));var moment=require('moment');var BPromise=require(_0x8db2('0x4'));var rp=require(_0x8db2('0x5'));var fs=require('fs');var path=require(_0x8db2('0x6'));var rimraf=require(_0x8db2('0x7'));var config=require(_0x8db2('0x8'));var attributes=require('./voiceExtension.attributes');module[_0x8db2('0x9')]=function(_0x1d2dd3,_0x5f42ee){return _0x1d2dd3['define'](_0x8db2('0xa'),attributes,{'tableName':_0x8db2('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x5f2f=['bluebird','request-promise','path','./voiceExtension.attributes','exports','define','VoiceExtension','lodash','util','../../config/logger','api','moment'];(function(_0x1b64a7,_0x36b3e5){var _0x556458=function(_0x5d2b85){while(--_0x5d2b85){_0x1b64a7['push'](_0x1b64a7['shift']());}};_0x556458(++_0x36b3e5);}(_0x5f2f,0x73));var _0xf5f2=function(_0x56823a,_0x4d5ff9){_0x56823a=_0x56823a-0x0;var _0x368711=_0x5f2f[_0x56823a];return _0x368711;};'use strict';var _=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var logger=require(_0xf5f2('0x2'))(_0xf5f2('0x3'));var moment=require(_0xf5f2('0x4'));var BPromise=require(_0xf5f2('0x5'));var rp=require(_0xf5f2('0x6'));var fs=require('fs');var path=require(_0xf5f2('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xf5f2('0x8'));module[_0xf5f2('0x9')]=function(_0xad7f65,_0x3eebf6){return _0xad7f65[_0xf5f2('0xa')](_0xf5f2('0xb'),attributes,{'tableName':'voice_extensions','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/voiceExtension/voiceExtension.rpc.js b/server/api/voiceExtension/voiceExtension.rpc.js
index 2b751c1..580dcc5 100644
--- a/server/api/voiceExtension/voiceExtension.rpc.js
+++ b/server/api/voiceExtension/voiceExtension.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x0f6f=['redis','defaults','socket.io-emitter','./voiceExtension.socket','register','request','then','info','VoiceExtension,\x20%s,\x20%s','request\x20sent','debug','VoiceExtension,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetVoiceExtension','VoiceExtension','findAll','raw','options','where','attributes','limit','include','map','model','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x597c3c,_0x4271a6){var _0xd77240=function(_0x4ddc10){while(--_0x4ddc10){_0x597c3c['push'](_0x597c3c['shift']());}};_0xd77240(++_0x4271a6);}(_0x0f6f,0x6d));var _0xf0f6=function(_0x4cfc1d,_0x2c0927){_0x4cfc1d=_0x4cfc1d-0x0;var _0x1c01a0=_0x0f6f[_0x4cfc1d];return _0x1c01a0;};'use strict';var _=require('lodash');var util=require(_0xf0f6('0x0'));var moment=require(_0xf0f6('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf0f6('0x2'));var db=require(_0xf0f6('0x3'))['db'];var utils=require(_0xf0f6('0x4'));var logger=require(_0xf0f6('0x5'))(_0xf0f6('0x6'));var config=require(_0xf0f6('0x7'));var jayson=require(_0xf0f6('0x8'));var client=jayson[_0xf0f6('0x9')][_0xf0f6('0xa')]({'port':0x232a});config[_0xf0f6('0xb')]=_[_0xf0f6('0xc')](config[_0xf0f6('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0xf0f6('0xd'))(new Redis(config[_0xf0f6('0xb')]));require(_0xf0f6('0xe'))[_0xf0f6('0xf')](socket);function respondWithRpcPromise(_0x46c398,_0x128827,_0x11aa29){return new BPromise(function(_0x5ac279,_0x213f70){return client[_0xf0f6('0x10')](_0x46c398,_0x11aa29)[_0xf0f6('0x11')](function(_0x43466f){logger[_0xf0f6('0x12')](_0xf0f6('0x13'),_0x128827,_0xf0f6('0x14'));logger[_0xf0f6('0x15')](_0xf0f6('0x16'),_0x128827,_0xf0f6('0x14'),JSON[_0xf0f6('0x17')](_0x43466f));if(_0x43466f['error']){if(_0x43466f[_0xf0f6('0x18')][_0xf0f6('0x19')]===0x1f4){logger[_0xf0f6('0x18')](_0xf0f6('0x13'),_0x128827,_0x43466f[_0xf0f6('0x18')][_0xf0f6('0x1a')]);return _0x213f70(_0x43466f[_0xf0f6('0x18')][_0xf0f6('0x1a')]);}logger['error'](_0xf0f6('0x13'),_0x128827,_0x43466f[_0xf0f6('0x18')][_0xf0f6('0x1a')]);return _0x5ac279(_0x43466f['error'][_0xf0f6('0x1a')]);}else{logger[_0xf0f6('0x12')](_0xf0f6('0x13'),_0x128827,'request\x20sent');_0x5ac279(_0x43466f[_0xf0f6('0x1b')][_0xf0f6('0x1a')]);}})[_0xf0f6('0x1c')](function(_0xf14b1b){logger[_0xf0f6('0x18')](_0xf0f6('0x13'),_0x128827,_0xf14b1b);_0x213f70(_0xf14b1b);});});}exports[_0xf0f6('0x1d')]=function(_0x38137b){var _0x189e99=this;return new Promise(function(_0x5602de,_0x57ff5b){return db[_0xf0f6('0x1e')][_0xf0f6('0x1f')]({'raw':_0x38137b['options']?_0x38137b['options'][_0xf0f6('0x20')]===undefined?!![]:![]:!![],'where':_0x38137b['options']?_0x38137b[_0xf0f6('0x21')][_0xf0f6('0x22')]||null:null,'attributes':_0x38137b[_0xf0f6('0x21')]?_0x38137b[_0xf0f6('0x21')][_0xf0f6('0x23')]||null:null,'limit':_0x38137b[_0xf0f6('0x21')]?_0x38137b[_0xf0f6('0x21')][_0xf0f6('0x24')]||null:null,'include':_0x38137b[_0xf0f6('0x21')]?_0x38137b[_0xf0f6('0x21')][_0xf0f6('0x25')]?_[_0xf0f6('0x26')](_0x38137b[_0xf0f6('0x21')][_0xf0f6('0x25')],function(_0x5d92c4){return{'model':db[_0x5d92c4[_0xf0f6('0x27')]],'as':_0x5d92c4['as'],'attributes':_0x5d92c4['attributes'],'include':_0x5d92c4[_0xf0f6('0x25')]?_['map'](_0x5d92c4['include'],function(_0x4da4c6){return{'model':db[_0x4da4c6[_0xf0f6('0x27')]],'as':_0x4da4c6['as'],'attributes':_0x4da4c6['attributes'],'include':_0x4da4c6[_0xf0f6('0x25')]?_[_0xf0f6('0x26')](_0x4da4c6[_0xf0f6('0x25')],function(_0xae928d){return{'model':db[_0xae928d['model']],'as':_0xae928d['as'],'attributes':_0xae928d[_0xf0f6('0x23')]};}):[]};}):[]};}):[]:[]})[_0xf0f6('0x11')](function(_0x51038b){logger[_0xf0f6('0x12')](_0xf0f6('0x1d'),_0x38137b);logger[_0xf0f6('0x15')](_0xf0f6('0x1d'),_0x38137b,JSON[_0xf0f6('0x17')](_0x51038b));_0x5602de(_0x51038b);})[_0xf0f6('0x1c')](function(_0x4af713){logger[_0xf0f6('0x18')]('GetVoiceExtension',_0x4af713[_0xf0f6('0x1a')],_0x38137b);_0x57ff5b(_0x189e99[_0xf0f6('0x18')](0x1f4,_0x4af713[_0xf0f6('0x1a')]));});});};
\ No newline at end of file
+var _0xec68=['bluebird','../../mysqldb','rpc','jayson/promise','client','redis','defaults','localhost','./voiceExtension.socket','register','info','VoiceExtension,\x20%s,\x20%s','request\x20sent','debug','VoiceExtension,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','VoiceExtension','findAll','options','raw','where','attributes','limit','include','model','map','GetVoiceExtension'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xec68,0xf0));var _0x8ec6=function(_0x10436a,_0x23a56c){_0x10436a=_0x10436a-0x0;var _0x22f888=_0xec68[_0x10436a];return _0x22f888;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x8ec6('0x0'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8ec6('0x1'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x8ec6('0x2'));var config=require('../../config/environment');var jayson=require(_0x8ec6('0x3'));var client=jayson[_0x8ec6('0x4')]['http']({'port':0x232a});config[_0x8ec6('0x5')]=_[_0x8ec6('0x6')](config[_0x8ec6('0x5')],{'host':_0x8ec6('0x7'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x8ec6('0x5')]));require(_0x8ec6('0x8'))[_0x8ec6('0x9')](socket);function respondWithRpcPromise(_0x42ee87,_0x14ef9c,_0xef9a1b){return new BPromise(function(_0xcfbfca,_0xc6f97){return client['request'](_0x42ee87,_0xef9a1b)['then'](function(_0x8e4cd7){logger[_0x8ec6('0xa')](_0x8ec6('0xb'),_0x14ef9c,_0x8ec6('0xc'));logger[_0x8ec6('0xd')](_0x8ec6('0xe'),_0x14ef9c,'request\x20sent',JSON[_0x8ec6('0xf')](_0x8e4cd7));if(_0x8e4cd7[_0x8ec6('0x10')]){if(_0x8e4cd7[_0x8ec6('0x10')]['code']===0x1f4){logger[_0x8ec6('0x10')](_0x8ec6('0xb'),_0x14ef9c,_0x8e4cd7[_0x8ec6('0x10')][_0x8ec6('0x11')]);return _0xc6f97(_0x8e4cd7[_0x8ec6('0x10')]['message']);}logger[_0x8ec6('0x10')](_0x8ec6('0xb'),_0x14ef9c,_0x8e4cd7[_0x8ec6('0x10')][_0x8ec6('0x11')]);return _0xcfbfca(_0x8e4cd7['error'][_0x8ec6('0x11')]);}else{logger[_0x8ec6('0xa')](_0x8ec6('0xb'),_0x14ef9c,_0x8ec6('0xc'));_0xcfbfca(_0x8e4cd7['result'][_0x8ec6('0x11')]);}})[_0x8ec6('0x12')](function(_0x152459){logger[_0x8ec6('0x10')](_0x8ec6('0xb'),_0x14ef9c,_0x152459);_0xc6f97(_0x152459);});});}exports['GetVoiceExtension']=function(_0x22f18c){var _0x2696af=this;return new Promise(function(_0x1a0002,_0x4d5f97){return db[_0x8ec6('0x13')][_0x8ec6('0x14')]({'raw':_0x22f18c[_0x8ec6('0x15')]?_0x22f18c[_0x8ec6('0x15')][_0x8ec6('0x16')]===undefined?!![]:![]:!![],'where':_0x22f18c['options']?_0x22f18c[_0x8ec6('0x15')][_0x8ec6('0x17')]||null:null,'attributes':_0x22f18c[_0x8ec6('0x15')]?_0x22f18c[_0x8ec6('0x15')][_0x8ec6('0x18')]||null:null,'limit':_0x22f18c[_0x8ec6('0x15')]?_0x22f18c[_0x8ec6('0x15')][_0x8ec6('0x19')]||null:null,'include':_0x22f18c['options']?_0x22f18c[_0x8ec6('0x15')][_0x8ec6('0x1a')]?_['map'](_0x22f18c[_0x8ec6('0x15')][_0x8ec6('0x1a')],function(_0x1e4c26){return{'model':db[_0x1e4c26[_0x8ec6('0x1b')]],'as':_0x1e4c26['as'],'attributes':_0x1e4c26[_0x8ec6('0x18')],'include':_0x1e4c26[_0x8ec6('0x1a')]?_[_0x8ec6('0x1c')](_0x1e4c26[_0x8ec6('0x1a')],function(_0x506142){return{'model':db[_0x506142[_0x8ec6('0x1b')]],'as':_0x506142['as'],'attributes':_0x506142[_0x8ec6('0x18')],'include':_0x506142[_0x8ec6('0x1a')]?_['map'](_0x506142['include'],function(_0xb106b0){return{'model':db[_0xb106b0[_0x8ec6('0x1b')]],'as':_0xb106b0['as'],'attributes':_0xb106b0[_0x8ec6('0x18')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x585135){logger[_0x8ec6('0xa')]('GetVoiceExtension',_0x22f18c);logger[_0x8ec6('0xd')](_0x8ec6('0x1d'),_0x22f18c,JSON[_0x8ec6('0xf')](_0x585135));_0x1a0002(_0x585135);})[_0x8ec6('0x12')](function(_0x40035b){logger['error'](_0x8ec6('0x1d'),_0x40035b[_0x8ec6('0x11')],_0x22f18c);_0x4d5f97(_0x2696af[_0x8ec6('0x10')](0x1f4,_0x40035b[_0x8ec6('0x11')]));});});};
\ No newline at end of file
diff --git a/server/api/voiceExtension/voiceExtension.socket.js b/server/api/voiceExtension/voiceExtension.socket.js
index e6c768e..b46d626 100644
--- a/server/api/voiceExtension/voiceExtension.socket.js
+++ b/server/api/voiceExtension/voiceExtension.socket.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xc93f=['save','remove','update','emit','register','length','voiceExtension:'];(function(_0x2e812d,_0x5c69fa){var _0x173ec0=function(_0x16808d){while(--_0x16808d){_0x2e812d['push'](_0x2e812d['shift']());}};_0x173ec0(++_0x5c69fa);}(_0xc93f,0xfc));var _0xfc93=function(_0xafa965,_0x14309a){_0xafa965=_0xafa965-0x0;var _0x4858da=_0xc93f[_0xafa965];return _0x4858da;};'use strict';var VoiceExtensionEvents=require('./voiceExtension.events');var events=[_0xfc93('0x0'),_0xfc93('0x1'),_0xfc93('0x2')];function createListener(_0x3e96b1,_0x526c39){return function(_0xbaf18b){_0x526c39[_0xfc93('0x3')](_0x3e96b1,_0xbaf18b);};}function removeListener(_0x59387b,_0x472415){return function(){VoiceExtensionEvents['removeListener'](_0x59387b,_0x472415);};}exports[_0xfc93('0x4')]=function(_0x4844c0){for(var _0x37594c=0x0,_0x191218=events[_0xfc93('0x5')];_0x37594c<_0x191218;_0x37594c++){var _0x23f541=events[_0x37594c];var _0x223517=createListener(_0xfc93('0x6')+_0x23f541,_0x4844c0);VoiceExtensionEvents['on'](_0x23f541,_0x223517);}};
\ No newline at end of file
+var _0xbfea=['save','remove','update','emit','register','length','voiceExtension:','./voiceExtension.events'];(function(_0x23bd26,_0x1bdca5){var _0x1902b1=function(_0x5a4298){while(--_0x5a4298){_0x23bd26['push'](_0x23bd26['shift']());}};_0x1902b1(++_0x1bdca5);}(_0xbfea,0x187));var _0xabfe=function(_0x123ea4,_0x18a836){_0x123ea4=_0x123ea4-0x0;var _0x268e9f=_0xbfea[_0x123ea4];return _0x268e9f;};'use strict';var VoiceExtensionEvents=require(_0xabfe('0x0'));var events=[_0xabfe('0x1'),_0xabfe('0x2'),_0xabfe('0x3')];function createListener(_0x469ce9,_0x7989){return function(_0x3dbd76){_0x7989[_0xabfe('0x4')](_0x469ce9,_0x3dbd76);};}function removeListener(_0x9f003b,_0x296250){return function(){VoiceExtensionEvents['removeListener'](_0x9f003b,_0x296250);};}exports[_0xabfe('0x5')]=function(_0x425535){for(var _0x2ea59d=0x0,_0x11b842=events[_0xabfe('0x6')];_0x2ea59d<_0x11b842;_0x2ea59d++){var _0x3eedb2=events[_0x2ea59d];var _0x3cdb6d=createListener(_0xabfe('0x7')+_0x3eedb2,_0x425535);VoiceExtensionEvents['on'](_0x3eedb2,_0x3cdb6d);}};
\ No newline at end of file
diff --git a/server/api/voiceMail/index.js b/server/api/voiceMail/index.js
index 315a8c5..39ae3c4 100644
--- a/server/api/voiceMail/index.js
+++ b/server/api/voiceMail/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x5f37=['get','isAuthenticated','index','/:id','/:id/messages','getMessages','post','create','put','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x6c993a,_0x5ea3ab){var _0x27f547=function(_0x22df20){while(--_0x22df20){_0x6c993a['push'](_0x6c993a['shift']());}};_0x27f547(++_0x5ea3ab);}(_0x5f37,0x12b));var _0x75f3=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x5f37[_0x2641f9];return _0x585741;};'use strict';var multer=require(_0x75f3('0x0'));var util=require(_0x75f3('0x1'));var path=require(_0x75f3('0x2'));var timeout=require('connect-timeout');var express=require(_0x75f3('0x3'));var router=express[_0x75f3('0x4')]();var auth=require(_0x75f3('0x5'));var interaction=require(_0x75f3('0x6'));var config=require('../../config/environment');var controller=require('./voiceMail.controller');router[_0x75f3('0x7')]('/',auth[_0x75f3('0x8')](),controller[_0x75f3('0x9')]);router['get'](_0x75f3('0xa'),auth[_0x75f3('0x8')](),controller['show']);router[_0x75f3('0x7')](_0x75f3('0xb'),auth[_0x75f3('0x8')](),controller[_0x75f3('0xc')]);router[_0x75f3('0xd')]('/',auth['isAuthenticated'](),controller[_0x75f3('0xe')]);router[_0x75f3('0xf')](_0x75f3('0xa'),auth[_0x75f3('0x8')](),controller['update']);router['delete'](_0x75f3('0xa'),auth[_0x75f3('0x8')](),controller['destroy']);module[_0x75f3('0x10')]=router;
\ No newline at end of file
+var _0x51b0=['put','update','delete','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./voiceMail.controller','isAuthenticated','index','get','/:id','show','/:id/messages','post','create'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x51b0,0xac));var _0x051b=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x51b0[_0x3b380d];return _0x54502b;};'use strict';var multer=require(_0x051b('0x0'));var util=require(_0x051b('0x1'));var path=require(_0x051b('0x2'));var timeout=require(_0x051b('0x3'));var express=require(_0x051b('0x4'));var router=express[_0x051b('0x5')]();var auth=require(_0x051b('0x6'));var interaction=require(_0x051b('0x7'));var config=require('../../config/environment');var controller=require(_0x051b('0x8'));router['get']('/',auth[_0x051b('0x9')](),controller[_0x051b('0xa')]);router[_0x051b('0xb')](_0x051b('0xc'),auth[_0x051b('0x9')](),controller[_0x051b('0xd')]);router[_0x051b('0xb')](_0x051b('0xe'),auth[_0x051b('0x9')](),controller['getMessages']);router[_0x051b('0xf')]('/',auth[_0x051b('0x9')](),controller[_0x051b('0x10')]);router[_0x051b('0x11')]('/:id',auth[_0x051b('0x9')](),controller[_0x051b('0x12')]);router[_0x051b('0x13')](_0x051b('0xc'),auth[_0x051b('0x9')](),controller['destroy']);module[_0x051b('0x14')]=router;
\ No newline at end of file
diff --git a/server/api/voiceMail/voiceMail.attributes.js b/server/api/voiceMail/voiceMail.attributes.js
index 2ec90f9..c0593df 100644
--- a/server/api/voiceMail/voiceMail.attributes.js
+++ b/server/api/voiceMail/voiceMail.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xac4a=['contest_mailbox','setDataValue','string','trim','ENUM','yes','TINYINT(4)','TIMESTAMP','INTEGER','getDataValue','fullname','\x20-\x20','mailbox','sequelize','exports','STRING','from-voicemail'];(function(_0x27edba,_0x49741b){var _0x22ab78=function(_0x3cc42){while(--_0x3cc42){_0x27edba['push'](_0x27edba['shift']());}};_0x22ab78(++_0x49741b);}(_0xac4a,0x13f));var _0xaac4=function(_0x3d5a0a,_0x4a985e){_0x3d5a0a=_0x3d5a0a-0x0;var _0x5569de=_0xac4a[_0x3d5a0a];return _0x5569de;};'use strict';var Sequelize=require(_0xaac4('0x0'));module[_0xaac4('0x1')]={'customer_id':{'type':Sequelize[_0xaac4('0x2')]},'context':{'type':Sequelize[_0xaac4('0x2')],'defaultValue':_0xaac4('0x3'),'unique':_0xaac4('0x4')},'mailbox':{'type':Sequelize['STRING'],'defaultValue':'','allowNull':![],'unique':'contest_mailbox'},'password':{'type':Sequelize[_0xaac4('0x2')]},'fullname':{'type':Sequelize[_0xaac4('0x2')]},'email':{'type':Sequelize[_0xaac4('0x2')],'validate':{'isEmail':!![]},'set':function(_0x58ae95){this[_0xaac4('0x5')]('email',typeof _0x58ae95===_0xaac4('0x6')&&_0x58ae95['trim']()?_0x58ae95[_0xaac4('0x7')]():null);}},'pager':{'type':Sequelize[_0xaac4('0x2')]},'tz':{'type':Sequelize['STRING'],'defaultValue':'central'},'attach':{'type':Sequelize[_0xaac4('0x8')]('yes','no'),'defaultValue':_0xaac4('0x9'),'allowNull':![]},'saycid':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':_0xaac4('0x9'),'allowNull':![]},'dialout':{'type':Sequelize[_0xaac4('0x2')]},'callback':{'type':Sequelize[_0xaac4('0x2')]},'review':{'type':Sequelize[_0xaac4('0x8')](_0xaac4('0x9'),'no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize[_0xaac4('0x8')](_0xaac4('0x9'),'no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize[_0xaac4('0x8')]('yes','no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':_0xaac4('0xa'),'defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize[_0xaac4('0x8')]('yes','no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize[_0xaac4('0x8')](_0xaac4('0x9'),'no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize[_0xaac4('0x8')](_0xaac4('0x9'),'no'),'defaultValue':_0xaac4('0x9'),'allowNull':![]},'forcename':{'type':Sequelize[_0xaac4('0x8')](_0xaac4('0x9'),'no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize[_0xaac4('0x8')](_0xaac4('0x9'),'no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize[_0xaac4('0x8')](_0xaac4('0x9'),'no'),'defaultValue':_0xaac4('0x9'),'allowNull':![]},'stamp':{'type':_0xaac4('0xb')},'emailsubject':{'type':Sequelize['STRING']},'emailbody':{'type':Sequelize[_0xaac4('0x2')]},'maxsecs':{'type':Sequelize['INTEGER'](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize[_0xaac4('0xc')](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0xaac4('0xd')](_0xaac4('0xe'))+_0xaac4('0xf')+this[_0xaac4('0xd')](_0xaac4('0x10'));}}};
\ No newline at end of file
+var _0x5eb8=['email','trim','central','yes','ENUM','TIMESTAMP','INTEGER','VIRTUAL','getDataValue','fullname','\x20-\x20','STRING','from-voicemail','contest_mailbox','setDataValue'];(function(_0x40d73d,_0x107d1a){var _0x1e7882=function(_0xcfe745){while(--_0xcfe745){_0x40d73d['push'](_0x40d73d['shift']());}};_0x1e7882(++_0x107d1a);}(_0x5eb8,0xb0));var _0x85eb=function(_0x50148e,_0x4c99c7){_0x50148e=_0x50148e-0x0;var _0x446e9d=_0x5eb8[_0x50148e];return _0x446e9d;};'use strict';var Sequelize=require('sequelize');module['exports']={'customer_id':{'type':Sequelize[_0x85eb('0x0')]},'context':{'type':Sequelize[_0x85eb('0x0')],'defaultValue':_0x85eb('0x1'),'unique':_0x85eb('0x2')},'mailbox':{'type':Sequelize[_0x85eb('0x0')],'defaultValue':'','allowNull':![],'unique':_0x85eb('0x2')},'password':{'type':Sequelize[_0x85eb('0x0')]},'fullname':{'type':Sequelize[_0x85eb('0x0')]},'email':{'type':Sequelize[_0x85eb('0x0')],'validate':{'isEmail':!![]},'set':function(_0x1fde1a){this[_0x85eb('0x3')](_0x85eb('0x4'),typeof _0x1fde1a==='string'&&_0x1fde1a[_0x85eb('0x5')]()?_0x1fde1a[_0x85eb('0x5')]():null);}},'pager':{'type':Sequelize[_0x85eb('0x0')]},'tz':{'type':Sequelize['STRING'],'defaultValue':_0x85eb('0x6')},'attach':{'type':Sequelize['ENUM'](_0x85eb('0x7'),'no'),'defaultValue':_0x85eb('0x7'),'allowNull':![]},'saycid':{'type':Sequelize[_0x85eb('0x8')](_0x85eb('0x7'),'no'),'defaultValue':_0x85eb('0x7'),'allowNull':![]},'dialout':{'type':Sequelize[_0x85eb('0x0')]},'callback':{'type':Sequelize[_0x85eb('0x0')]},'review':{'type':Sequelize['ENUM'](_0x85eb('0x7'),'no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize[_0x85eb('0x8')]('yes','no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize[_0x85eb('0x8')](_0x85eb('0x7'),'no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize[_0x85eb('0x8')](_0x85eb('0x7'),'no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':'TINYINT(4)','defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize['ENUM'](_0x85eb('0x7'),'no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize['ENUM'](_0x85eb('0x7'),'no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize[_0x85eb('0x8')](_0x85eb('0x7'),'no'),'defaultValue':_0x85eb('0x7'),'allowNull':![]},'forcename':{'type':Sequelize[_0x85eb('0x8')]('yes','no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize[_0x85eb('0x8')]('yes','no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize[_0x85eb('0x8')](_0x85eb('0x7'),'no'),'defaultValue':_0x85eb('0x7'),'allowNull':![]},'stamp':{'type':_0x85eb('0x9')},'emailsubject':{'type':Sequelize['STRING']},'emailbody':{'type':Sequelize['STRING']},'maxsecs':{'type':Sequelize['INTEGER'](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize[_0x85eb('0xa')](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize[_0x85eb('0xb')],'get':function(){return this[_0x85eb('0xc')](_0x85eb('0xd'))+_0x85eb('0xe')+this[_0x85eb('0xc')]('mailbox');}}};
\ No newline at end of file
diff --git a/server/api/voiceMail/voiceMail.controller.js b/server/api/voiceMail/voiceMail.controller.js
index d86a3be..650d0db 100644
--- a/server/api/voiceMail/voiceMail.controller.js
+++ b/server/api/voiceMail/voiceMail.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x4dd0=['filter','VIRTUAL','merge','options','count','includeAll','include','findAll','rows','show','params','find','catch','create','body','user','get','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','findOne','VoiceMailMessage','hasOwnProperty','mailbox','findAndCountAll','html-pdf','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','status','json','offset','limit','set','Content-Range','apply','reject','update','destroy','then','UserProfileResource','end','sendStatus','error','stack','name','index','map','VoiceMail','type','model','query','keys','filters','intersection','fields','attributes','length','nolimit','order','sort','where'];(function(_0x20427d,_0x45b9b8){var _0x4ee19c=function(_0x229551){while(--_0x229551){_0x20427d['push'](_0x20427d['shift']());}};_0x4ee19c(++_0x45b9b8);}(_0x4dd0,0x6b));var _0x04dd=function(_0x5447c9,_0x32dea5){_0x5447c9=_0x5447c9-0x0;var _0x4165d0=_0x4dd0[_0x5447c9];return _0x4165d0;};'use strict';var pdf=require(_0x04dd('0x0'));var emlformat=require(_0x04dd('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x04dd('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x04dd('0x3'));var moment=require(_0x04dd('0x4'));var BPromise=require(_0x04dd('0x5'));var Mustache=require(_0x04dd('0x6'));var util=require(_0x04dd('0x7'));var path=require('path');var sox=require(_0x04dd('0x8'));var csv=require(_0x04dd('0x9'));var ejs=require(_0x04dd('0xa'));var fs=require('fs');var _=require(_0x04dd('0xb'));var squel=require(_0x04dd('0xc'));var crypto=require(_0x04dd('0xd'));var jsforce=require(_0x04dd('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x04dd('0x9'));var querystring=require('querystring');var Papa=require(_0x04dd('0xf'));var Redis=require(_0x04dd('0x10'));var authService=require(_0x04dd('0x11'));var qs=require(_0x04dd('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x04dd('0x13'));var logger=require(_0x04dd('0x14'))(_0x04dd('0x15'));var utils=require(_0x04dd('0x16'));var config=require('../../config/environment');var db=require(_0x04dd('0x17'))['db'];function respondWithStatusCode(_0x120bb5,_0x367c78){_0x367c78=_0x367c78||0xcc;return function(_0x3bafae){if(_0x3bafae){return _0x120bb5['sendStatus'](_0x367c78);}return _0x120bb5[_0x04dd('0x18')](_0x367c78)['end']();};}function respondWithResult(_0x527e10,_0x3f51e5){_0x3f51e5=_0x3f51e5||0xc8;return function(_0x5ecefc){if(_0x5ecefc){return _0x527e10[_0x04dd('0x18')](_0x3f51e5)[_0x04dd('0x19')](_0x5ecefc);}};}function respondWithFilteredResult(_0x2873c7,_0x13bcda){return function(_0x1b9831){if(_0x1b9831){var _0x4c9628=_0x1b9831['count'],_0x44a6ab=_0x13bcda[_0x04dd('0x1a')],_0x30821b=_0x13bcda[_0x04dd('0x1a')]+_0x13bcda[_0x04dd('0x1b')],_0x3da187;if(_0x30821b>=_0x4c9628){_0x30821b=_0x4c9628;_0x3da187=0xc8;}else{_0x3da187=0xce;}_0x2873c7[_0x04dd('0x18')](_0x3da187);return _0x2873c7[_0x04dd('0x1c')](_0x04dd('0x1d'),_0x44a6ab+'-'+_0x30821b+'/'+_0x4c9628)['json'](_0x1b9831);}return null;};}function patchUpdates(_0xaecb8f){return function(_0xf4fd57){try{jsonpatch[_0x04dd('0x1e')](_0xf4fd57,_0xaecb8f,!![]);}catch(_0x4ad602){return BPromise[_0x04dd('0x1f')](_0x4ad602);}return _0xf4fd57['save']();};}function saveUpdates(_0x3068c9,_0x4d0bbe){return function(_0x19237b){if(_0x19237b){return _0x19237b[_0x04dd('0x20')](_0x3068c9)['then'](function(_0x2bad51){return _0x2bad51;});}return null;};}function removeEntity(_0x21df97,_0x5045c3){return function(_0x34a952){if(_0x34a952){return _0x34a952[_0x04dd('0x21')]()[_0x04dd('0x22')](function(){var _0x2b736a=_0x34a952['get']({'plain':!![]});var _0x457550='Voicemails';return db[_0x04dd('0x23')][_0x04dd('0x21')]({'where':{'type':_0x457550,'resourceId':_0x2b736a['id']}})[_0x04dd('0x22')](function(){return _0x34a952;});})['then'](function(){_0x21df97[_0x04dd('0x18')](0xcc)[_0x04dd('0x24')]();});}};}function handleEntityNotFound(_0x3ec4cd,_0x35867b){return function(_0x5818cd){if(!_0x5818cd){_0x3ec4cd[_0x04dd('0x25')](0x194);}return _0x5818cd;};}function handleError(_0x16af90,_0x28e485){_0x28e485=_0x28e485||0x1f4;return function(_0x18ba04){logger[_0x04dd('0x26')](_0x18ba04[_0x04dd('0x27')]);if(_0x18ba04[_0x04dd('0x28')]){delete _0x18ba04[_0x04dd('0x28')];}_0x16af90['status'](_0x28e485)['send'](_0x18ba04);};}exports[_0x04dd('0x29')]=function(_0x309b74,_0x4dbcd1){var _0x34cb83={},_0xcad59e={},_0x499647={'count':0x0,'rows':[]};var _0x533f24=_[_0x04dd('0x2a')](db[_0x04dd('0x2b')]['rawAttributes'],function(_0x362e6b){return{'name':_0x362e6b['fieldName'],'type':_0x362e6b[_0x04dd('0x2c')]['key']};});_0xcad59e[_0x04dd('0x2d')]=_[_0x04dd('0x2a')](_0x533f24,_0x04dd('0x28'));_0xcad59e[_0x04dd('0x2e')]=_[_0x04dd('0x2f')](_0x309b74[_0x04dd('0x2e')]);_0xcad59e[_0x04dd('0x30')]=_[_0x04dd('0x31')](_0xcad59e[_0x04dd('0x2d')],_0xcad59e[_0x04dd('0x2e')]);_0x34cb83['attributes']=_[_0x04dd('0x31')](_0xcad59e[_0x04dd('0x2d')],qs['fields'](_0x309b74['query'][_0x04dd('0x32')]));_0x34cb83[_0x04dd('0x33')]=_0x34cb83['attributes'][_0x04dd('0x34')]?_0x34cb83[_0x04dd('0x33')]:_0xcad59e[_0x04dd('0x2d')];if(!_0x309b74[_0x04dd('0x2e')]['hasOwnProperty'](_0x04dd('0x35'))){_0x34cb83[_0x04dd('0x1b')]=qs[_0x04dd('0x1b')](_0x309b74[_0x04dd('0x2e')]['limit']);_0x34cb83['offset']=qs[_0x04dd('0x1a')](_0x309b74[_0x04dd('0x2e')][_0x04dd('0x1a')]);}_0x34cb83[_0x04dd('0x36')]=qs[_0x04dd('0x37')](_0x309b74['query'][_0x04dd('0x37')]);_0x34cb83[_0x04dd('0x38')]=qs[_0x04dd('0x30')](_['pick'](_0x309b74[_0x04dd('0x2e')],_0xcad59e['filters']),_0x533f24);if(_0x309b74[_0x04dd('0x2e')][_0x04dd('0x39')]){_0x34cb83[_0x04dd('0x38')]=_['merge'](_0x34cb83['where'],{'$or':_[_0x04dd('0x2a')](_0x533f24,function(_0x30ab83){if(_0x30ab83['type']!==_0x04dd('0x3a')){var _0x30962e={};_0x30962e[_0x30ab83['name']]={'$like':'%'+_0x309b74[_0x04dd('0x2e')][_0x04dd('0x39')]+'%'};return _0x30962e;}})});}_0x34cb83=_[_0x04dd('0x3b')]({},_0x34cb83,_0x309b74[_0x04dd('0x3c')]);var _0x395a4d={'where':_0x34cb83[_0x04dd('0x38')]};return db[_0x04dd('0x2b')][_0x04dd('0x3d')](_0x395a4d)['then'](function(_0x2dfc54){_0x499647[_0x04dd('0x3d')]=_0x2dfc54;if(_0x309b74[_0x04dd('0x2e')][_0x04dd('0x3e')]){_0x34cb83[_0x04dd('0x3f')]=[{'all':!![]}];}return db[_0x04dd('0x2b')][_0x04dd('0x40')](_0x34cb83);})[_0x04dd('0x22')](function(_0x4a9a59){_0x499647[_0x04dd('0x41')]=_0x4a9a59;return _0x499647;})[_0x04dd('0x22')](respondWithFilteredResult(_0x4dbcd1,_0x34cb83))['catch'](handleError(_0x4dbcd1,null));};exports[_0x04dd('0x42')]=function(_0x1ae07d,_0x1c04bf){var _0x326d72={'raw':!![],'where':{'id':_0x1ae07d[_0x04dd('0x43')]['id']}},_0x29a590={};_0x29a590[_0x04dd('0x2d')]=_['keys'](db[_0x04dd('0x2b')]['rawAttributes']);_0x29a590[_0x04dd('0x2e')]=_[_0x04dd('0x2f')](_0x1ae07d[_0x04dd('0x2e')]);_0x29a590[_0x04dd('0x30')]=_[_0x04dd('0x31')](_0x29a590[_0x04dd('0x2d')],_0x29a590[_0x04dd('0x2e')]);_0x326d72[_0x04dd('0x33')]=_[_0x04dd('0x31')](_0x29a590[_0x04dd('0x2d')],qs['fields'](_0x1ae07d['query'][_0x04dd('0x32')]));_0x326d72['attributes']=_0x326d72['attributes'][_0x04dd('0x34')]?_0x326d72[_0x04dd('0x33')]:_0x29a590['model'];if(_0x1ae07d[_0x04dd('0x2e')][_0x04dd('0x3e')]){_0x326d72['include']=[{'all':!![]}];}_0x326d72=_[_0x04dd('0x3b')]({},_0x326d72,_0x1ae07d['options']);return db[_0x04dd('0x2b')][_0x04dd('0x44')](_0x326d72)[_0x04dd('0x22')](handleEntityNotFound(_0x1c04bf,null))[_0x04dd('0x22')](respondWithResult(_0x1c04bf,null))[_0x04dd('0x45')](handleError(_0x1c04bf,null));};exports[_0x04dd('0x46')]=function(_0x176cd6,_0x22ed79){return db['VoiceMail']['create'](_0x176cd6[_0x04dd('0x47')],{})[_0x04dd('0x22')](function(_0x220959){var _0x2cabf9=_0x176cd6[_0x04dd('0x48')][_0x04dd('0x49')]({'plain':!![]});if(!_0x2cabf9)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2cabf9['role']===_0x04dd('0x48')){var _0x5d1ec1=_0x220959[_0x04dd('0x49')]({'plain':!![]});var _0x3c55ea='Voicemails';return db['UserProfileSection'][_0x04dd('0x44')]({'where':{'name':_0x3c55ea,'userProfileId':_0x2cabf9[_0x04dd('0x4a')]},'raw':!![]})['then'](function(_0x215691){if(_0x215691&&_0x215691[_0x04dd('0x4b')]===0x0){return db[_0x04dd('0x23')]['create']({'name':_0x5d1ec1[_0x04dd('0x28')],'resourceId':_0x5d1ec1['id'],'type':_0x215691[_0x04dd('0x28')],'sectionId':_0x215691['id']},{})[_0x04dd('0x22')](function(){return _0x220959;});}else{return _0x220959;}})['catch'](function(_0x53803e){logger[_0x04dd('0x26')](_0x04dd('0x4c'),_0x53803e);throw _0x53803e;});}return _0x220959;})[_0x04dd('0x22')](respondWithResult(_0x22ed79,0xc9))['catch'](handleError(_0x22ed79,null));};exports[_0x04dd('0x20')]=function(_0x4770e8,_0x1ced17){if(_0x4770e8[_0x04dd('0x47')]['id']){delete _0x4770e8[_0x04dd('0x47')]['id'];}return db['VoiceMail'][_0x04dd('0x44')]({'where':{'id':_0x4770e8[_0x04dd('0x43')]['id']}})['then'](handleEntityNotFound(_0x1ced17,null))[_0x04dd('0x22')](saveUpdates(_0x4770e8[_0x04dd('0x47')],null))['then'](respondWithResult(_0x1ced17,null))['catch'](handleError(_0x1ced17,null));};exports[_0x04dd('0x21')]=function(_0x5be524,_0x14cc07){return db[_0x04dd('0x2b')]['find']({'where':{'id':_0x5be524['params']['id']}})[_0x04dd('0x22')](handleEntityNotFound(_0x14cc07,null))[_0x04dd('0x22')](removeEntity(_0x14cc07,null))[_0x04dd('0x45')](handleError(_0x14cc07,null));};exports['getMessages']=function(_0x52ba63,_0x160043,_0x348c60){return db[_0x04dd('0x2b')][_0x04dd('0x4d')]({'where':{'id':_0x52ba63['params']['id']}})[_0x04dd('0x22')](handleEntityNotFound(_0x160043,null))['then'](function(_0xc95897){var _0x12cb6b;var _0x2febdb={},_0x131370={};_0x131370[_0x04dd('0x2d')]=_['keys'](db[_0x04dd('0x4e')]['rawAttributes']);_0x131370[_0x04dd('0x2e')]=_[_0x04dd('0x2f')](_0x52ba63[_0x04dd('0x2e')]);_0x131370[_0x04dd('0x30')]=_[_0x04dd('0x31')](_0x131370[_0x04dd('0x2d')],_0x131370[_0x04dd('0x2e')]);_0x2febdb[_0x04dd('0x33')]=_[_0x04dd('0x31')](_0x131370[_0x04dd('0x2d')],qs[_0x04dd('0x32')](_0x52ba63[_0x04dd('0x2e')][_0x04dd('0x32')]));_0x2febdb[_0x04dd('0x33')]=_0x2febdb[_0x04dd('0x33')][_0x04dd('0x34')]?_0x2febdb[_0x04dd('0x33')]:_0x131370[_0x04dd('0x2d')];if(!_0x52ba63['query'][_0x04dd('0x4f')](_0x04dd('0x35'))){_0x2febdb['limit']=qs[_0x04dd('0x1b')](_0x52ba63[_0x04dd('0x2e')][_0x04dd('0x1b')]);_0x2febdb[_0x04dd('0x1a')]=qs[_0x04dd('0x1a')](_0x52ba63[_0x04dd('0x2e')][_0x04dd('0x1a')]);}_0x2febdb[_0x04dd('0x36')]=qs[_0x04dd('0x37')](_0x52ba63[_0x04dd('0x2e')][_0x04dd('0x37')]);_0x2febdb[_0x04dd('0x38')]=qs[_0x04dd('0x30')](_['pick'](_0x52ba63[_0x04dd('0x2e')],_0x131370[_0x04dd('0x30')]));if(_0x52ba63[_0x04dd('0x2e')][_0x04dd('0x39')]){_0x2febdb[_0x04dd('0x38')]=_[_0x04dd('0x3b')](_0x2febdb[_0x04dd('0x38')],{'$or':_['map'](_0x2febdb[_0x04dd('0x33')],function(_0x4e03dc){var _0x2b2297={};_0x2b2297[_0x4e03dc]={'$like':'%'+_0x52ba63[_0x04dd('0x2e')]['filter']+'%'};return _0x2b2297;})});}_0x2febdb[_0x04dd('0x38')]=_['merge'](_0x2febdb['where'],{'mailboxuser':_0xc95897[_0x04dd('0x50')]});_0x2febdb=_[_0x04dd('0x3b')]({},_0x2febdb,_0x52ba63['options']);return db[_0x04dd('0x4e')][_0x04dd('0x51')](_0x2febdb)['then'](respondWithFilteredResult(_0x160043,_0x2febdb));})[_0x04dd('0x45')](handleError(_0x160043,null));};
\ No newline at end of file
+var _0x5428=['json','count','offset','limit','Content-Range','apply','reject','save','update','destroy','then','get','Voicemails','end','error','map','VoiceMail','key','model','name','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','type','VIRTUAL','filter','merge','options','include','findAll','rows','catch','show','params','rawAttributes','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getMessages','findOne','VoiceMailMessage','nolimit','findAndCountAll','eml-format','rimraf','fast-json-patch','request-promise','moment','path','sox','to-csv','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','status'];(function(_0x230e39,_0x5341){var _0xa804e=function(_0xe14796){while(--_0xe14796){_0x230e39['push'](_0x230e39['shift']());}};_0xa804e(++_0x5341);}(_0x5428,0xd5));var _0x8542=function(_0x2cae82,_0x3a2e21){_0x2cae82=_0x2cae82-0x0;var _0x59baa4=_0x5428[_0x2cae82];return _0x59baa4;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x8542('0x0'));var rimraf=require(_0x8542('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x8542('0x2'));var rp=require(_0x8542('0x3'));var moment=require(_0x8542('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x8542('0x5'));var sox=require(_0x8542('0x6'));var csv=require(_0x8542('0x7'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x8542('0x8'));var squel=require('squel');var crypto=require(_0x8542('0x9'));var jsforce=require(_0x8542('0xa'));var deskjs=require(_0x8542('0xb'));var toCsv=require(_0x8542('0x7'));var querystring=require(_0x8542('0xc'));var Papa=require('papaparse');var Redis=require(_0x8542('0xd'));var authService=require(_0x8542('0xe'));var qs=require(_0x8542('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8542('0x10'));var logger=require(_0x8542('0x11'))(_0x8542('0x12'));var utils=require(_0x8542('0x13'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x52936d,_0x13e2d7){_0x13e2d7=_0x13e2d7||0xcc;return function(_0x5d2f9d){if(_0x5d2f9d){return _0x52936d['sendStatus'](_0x13e2d7);}return _0x52936d[_0x8542('0x14')](_0x13e2d7)['end']();};}function respondWithResult(_0x35725e,_0x4bd4ef){_0x4bd4ef=_0x4bd4ef||0xc8;return function(_0x5645e4){if(_0x5645e4){return _0x35725e[_0x8542('0x14')](_0x4bd4ef)[_0x8542('0x15')](_0x5645e4);}};}function respondWithFilteredResult(_0x857a82,_0x39a828){return function(_0x56048a){if(_0x56048a){var _0x5a9f7c=_0x56048a[_0x8542('0x16')],_0x33784d=_0x39a828[_0x8542('0x17')],_0x1b6d56=_0x39a828[_0x8542('0x17')]+_0x39a828[_0x8542('0x18')],_0x390057;if(_0x1b6d56>=_0x5a9f7c){_0x1b6d56=_0x5a9f7c;_0x390057=0xc8;}else{_0x390057=0xce;}_0x857a82[_0x8542('0x14')](_0x390057);return _0x857a82['set'](_0x8542('0x19'),_0x33784d+'-'+_0x1b6d56+'/'+_0x5a9f7c)['json'](_0x56048a);}return null;};}function patchUpdates(_0x245d7f){return function(_0x3e2b5c){try{jsonpatch[_0x8542('0x1a')](_0x3e2b5c,_0x245d7f,!![]);}catch(_0x48ff09){return BPromise[_0x8542('0x1b')](_0x48ff09);}return _0x3e2b5c[_0x8542('0x1c')]();};}function saveUpdates(_0x18f1a5,_0x1a177d){return function(_0x4fa5f4){if(_0x4fa5f4){return _0x4fa5f4[_0x8542('0x1d')](_0x18f1a5)['then'](function(_0x1e4903){return _0x1e4903;});}return null;};}function removeEntity(_0x13067a,_0x1c18e1){return function(_0x27a6ff){if(_0x27a6ff){return _0x27a6ff[_0x8542('0x1e')]()[_0x8542('0x1f')](function(){var _0x1f8afd=_0x27a6ff[_0x8542('0x20')]({'plain':!![]});var _0x379a19=_0x8542('0x21');return db['UserProfileResource'][_0x8542('0x1e')]({'where':{'type':_0x379a19,'resourceId':_0x1f8afd['id']}})[_0x8542('0x1f')](function(){return _0x27a6ff;});})['then'](function(){_0x13067a[_0x8542('0x14')](0xcc)[_0x8542('0x22')]();});}};}function handleEntityNotFound(_0x266f2a,_0x54d714){return function(_0x436d2c){if(!_0x436d2c){_0x266f2a['sendStatus'](0x194);}return _0x436d2c;};}function handleError(_0x2f89ea,_0x173bb3){_0x173bb3=_0x173bb3||0x1f4;return function(_0x6be796){logger[_0x8542('0x23')](_0x6be796['stack']);if(_0x6be796['name']){delete _0x6be796['name'];}_0x2f89ea['status'](_0x173bb3)['send'](_0x6be796);};}exports['index']=function(_0x160aad,_0x27bcd0){var _0x283fb4={},_0x556671={},_0x35e783={'count':0x0,'rows':[]};var _0x576fdd=_[_0x8542('0x24')](db[_0x8542('0x25')]['rawAttributes'],function(_0x415871){return{'name':_0x415871['fieldName'],'type':_0x415871['type'][_0x8542('0x26')]};});_0x556671[_0x8542('0x27')]=_[_0x8542('0x24')](_0x576fdd,_0x8542('0x28'));_0x556671[_0x8542('0x29')]=_[_0x8542('0x2a')](_0x160aad[_0x8542('0x29')]);_0x556671[_0x8542('0x2b')]=_[_0x8542('0x2c')](_0x556671[_0x8542('0x27')],_0x556671[_0x8542('0x29')]);_0x283fb4[_0x8542('0x2d')]=_[_0x8542('0x2c')](_0x556671[_0x8542('0x27')],qs[_0x8542('0x2e')](_0x160aad[_0x8542('0x29')][_0x8542('0x2e')]));_0x283fb4['attributes']=_0x283fb4[_0x8542('0x2d')][_0x8542('0x2f')]?_0x283fb4[_0x8542('0x2d')]:_0x556671[_0x8542('0x27')];if(!_0x160aad['query'][_0x8542('0x30')]('nolimit')){_0x283fb4[_0x8542('0x18')]=qs[_0x8542('0x18')](_0x160aad[_0x8542('0x29')][_0x8542('0x18')]);_0x283fb4[_0x8542('0x17')]=qs[_0x8542('0x17')](_0x160aad[_0x8542('0x29')][_0x8542('0x17')]);}_0x283fb4[_0x8542('0x31')]=qs[_0x8542('0x32')](_0x160aad[_0x8542('0x29')][_0x8542('0x32')]);_0x283fb4[_0x8542('0x33')]=qs[_0x8542('0x2b')](_[_0x8542('0x34')](_0x160aad[_0x8542('0x29')],_0x556671[_0x8542('0x2b')]),_0x576fdd);if(_0x160aad[_0x8542('0x29')]['filter']){_0x283fb4[_0x8542('0x33')]=_['merge'](_0x283fb4[_0x8542('0x33')],{'$or':_[_0x8542('0x24')](_0x576fdd,function(_0x1cb264){if(_0x1cb264[_0x8542('0x35')]!==_0x8542('0x36')){var _0x4337a1={};_0x4337a1[_0x1cb264['name']]={'$like':'%'+_0x160aad[_0x8542('0x29')][_0x8542('0x37')]+'%'};return _0x4337a1;}})});}_0x283fb4=_[_0x8542('0x38')]({},_0x283fb4,_0x160aad[_0x8542('0x39')]);var _0x44d87b={'where':_0x283fb4[_0x8542('0x33')]};return db['VoiceMail']['count'](_0x44d87b)[_0x8542('0x1f')](function(_0x230ea8){_0x35e783[_0x8542('0x16')]=_0x230ea8;if(_0x160aad[_0x8542('0x29')]['includeAll']){_0x283fb4[_0x8542('0x3a')]=[{'all':!![]}];}return db[_0x8542('0x25')][_0x8542('0x3b')](_0x283fb4);})[_0x8542('0x1f')](function(_0x32b6b1){_0x35e783[_0x8542('0x3c')]=_0x32b6b1;return _0x35e783;})['then'](respondWithFilteredResult(_0x27bcd0,_0x283fb4))[_0x8542('0x3d')](handleError(_0x27bcd0,null));};exports[_0x8542('0x3e')]=function(_0x48d492,_0x2192c0){var _0x13907b={'raw':!![],'where':{'id':_0x48d492[_0x8542('0x3f')]['id']}},_0x35c415={};_0x35c415[_0x8542('0x27')]=_[_0x8542('0x2a')](db[_0x8542('0x25')][_0x8542('0x40')]);_0x35c415[_0x8542('0x29')]=_['keys'](_0x48d492[_0x8542('0x29')]);_0x35c415['filters']=_[_0x8542('0x2c')](_0x35c415['model'],_0x35c415[_0x8542('0x29')]);_0x13907b[_0x8542('0x2d')]=_[_0x8542('0x2c')](_0x35c415[_0x8542('0x27')],qs[_0x8542('0x2e')](_0x48d492[_0x8542('0x29')][_0x8542('0x2e')]));_0x13907b[_0x8542('0x2d')]=_0x13907b[_0x8542('0x2d')]['length']?_0x13907b[_0x8542('0x2d')]:_0x35c415[_0x8542('0x27')];if(_0x48d492[_0x8542('0x29')]['includeAll']){_0x13907b[_0x8542('0x3a')]=[{'all':!![]}];}_0x13907b=_[_0x8542('0x38')]({},_0x13907b,_0x48d492[_0x8542('0x39')]);return db[_0x8542('0x25')][_0x8542('0x41')](_0x13907b)[_0x8542('0x1f')](handleEntityNotFound(_0x2192c0,null))[_0x8542('0x1f')](respondWithResult(_0x2192c0,null))[_0x8542('0x3d')](handleError(_0x2192c0,null));};exports[_0x8542('0x42')]=function(_0x25108d,_0x3bc160){return db[_0x8542('0x25')][_0x8542('0x42')](_0x25108d[_0x8542('0x43')],{})[_0x8542('0x1f')](function(_0x2ffad5){var _0xe356ff=_0x25108d['user'][_0x8542('0x20')]({'plain':!![]});if(!_0xe356ff)throw new Error(_0x8542('0x44'));if(_0xe356ff['role']==='user'){var _0x40652d=_0x2ffad5[_0x8542('0x20')]({'plain':!![]});var _0x48158a='Voicemails';return db['UserProfileSection'][_0x8542('0x41')]({'where':{'name':_0x48158a,'userProfileId':_0xe356ff[_0x8542('0x45')]},'raw':!![]})[_0x8542('0x1f')](function(_0x15c580){if(_0x15c580&&_0x15c580[_0x8542('0x46')]===0x0){return db[_0x8542('0x47')]['create']({'name':_0x40652d[_0x8542('0x28')],'resourceId':_0x40652d['id'],'type':_0x15c580[_0x8542('0x28')],'sectionId':_0x15c580['id']},{})[_0x8542('0x1f')](function(){return _0x2ffad5;});}else{return _0x2ffad5;}})[_0x8542('0x3d')](function(_0x209aa3){logger[_0x8542('0x23')](_0x8542('0x48'),_0x209aa3);throw _0x209aa3;});}return _0x2ffad5;})[_0x8542('0x1f')](respondWithResult(_0x3bc160,0xc9))[_0x8542('0x3d')](handleError(_0x3bc160,null));};exports[_0x8542('0x1d')]=function(_0x1bc28e,_0x3e5745){if(_0x1bc28e[_0x8542('0x43')]['id']){delete _0x1bc28e[_0x8542('0x43')]['id'];}return db['VoiceMail'][_0x8542('0x41')]({'where':{'id':_0x1bc28e['params']['id']}})[_0x8542('0x1f')](handleEntityNotFound(_0x3e5745,null))[_0x8542('0x1f')](saveUpdates(_0x1bc28e['body'],null))[_0x8542('0x1f')](respondWithResult(_0x3e5745,null))[_0x8542('0x3d')](handleError(_0x3e5745,null));};exports[_0x8542('0x1e')]=function(_0x2589ec,_0x20e0d0){return db[_0x8542('0x25')][_0x8542('0x41')]({'where':{'id':_0x2589ec[_0x8542('0x3f')]['id']}})[_0x8542('0x1f')](handleEntityNotFound(_0x20e0d0,null))['then'](removeEntity(_0x20e0d0,null))[_0x8542('0x3d')](handleError(_0x20e0d0,null));};exports[_0x8542('0x49')]=function(_0x164477,_0x4c6d90,_0x12adfb){return db[_0x8542('0x25')][_0x8542('0x4a')]({'where':{'id':_0x164477['params']['id']}})[_0x8542('0x1f')](handleEntityNotFound(_0x4c6d90,null))[_0x8542('0x1f')](function(_0x425660){var _0x49560a;var _0x4b56ff={},_0x14ad06={};_0x14ad06[_0x8542('0x27')]=_[_0x8542('0x2a')](db[_0x8542('0x4b')][_0x8542('0x40')]);_0x14ad06[_0x8542('0x29')]=_['keys'](_0x164477[_0x8542('0x29')]);_0x14ad06[_0x8542('0x2b')]=_[_0x8542('0x2c')](_0x14ad06[_0x8542('0x27')],_0x14ad06['query']);_0x4b56ff['attributes']=_[_0x8542('0x2c')](_0x14ad06[_0x8542('0x27')],qs[_0x8542('0x2e')](_0x164477[_0x8542('0x29')]['fields']));_0x4b56ff[_0x8542('0x2d')]=_0x4b56ff[_0x8542('0x2d')][_0x8542('0x2f')]?_0x4b56ff['attributes']:_0x14ad06[_0x8542('0x27')];if(!_0x164477[_0x8542('0x29')][_0x8542('0x30')](_0x8542('0x4c'))){_0x4b56ff[_0x8542('0x18')]=qs['limit'](_0x164477['query'][_0x8542('0x18')]);_0x4b56ff[_0x8542('0x17')]=qs[_0x8542('0x17')](_0x164477[_0x8542('0x29')]['offset']);}_0x4b56ff[_0x8542('0x31')]=qs[_0x8542('0x32')](_0x164477['query'][_0x8542('0x32')]);_0x4b56ff[_0x8542('0x33')]=qs[_0x8542('0x2b')](_[_0x8542('0x34')](_0x164477[_0x8542('0x29')],_0x14ad06['filters']));if(_0x164477[_0x8542('0x29')]['filter']){_0x4b56ff[_0x8542('0x33')]=_['merge'](_0x4b56ff[_0x8542('0x33')],{'$or':_[_0x8542('0x24')](_0x4b56ff[_0x8542('0x2d')],function(_0x520f86){var _0xf4de63={};_0xf4de63[_0x520f86]={'$like':'%'+_0x164477[_0x8542('0x29')][_0x8542('0x37')]+'%'};return _0xf4de63;})});}_0x4b56ff[_0x8542('0x33')]=_[_0x8542('0x38')](_0x4b56ff[_0x8542('0x33')],{'mailboxuser':_0x425660['mailbox']});_0x4b56ff=_['merge']({},_0x4b56ff,_0x164477[_0x8542('0x39')]);return db[_0x8542('0x4b')][_0x8542('0x4d')](_0x4b56ff)[_0x8542('0x1f')](respondWithFilteredResult(_0x4c6d90,_0x4b56ff));})[_0x8542('0x3d')](handleError(_0x4c6d90,null));};
\ No newline at end of file
diff --git a/server/api/voiceMail/voiceMail.model.js b/server/api/voiceMail/voiceMail.model.js
index 7ace224..e2eacef 100644
--- a/server/api/voiceMail/voiceMail.model.js
+++ b/server/api/voiceMail/voiceMail.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x0ad5=['mailbox','context','lodash','util','../../config/logger','api','rimraf','../../config/environment','./voiceMail.attributes','exports','define','voice_voicemail','mailbox_context'];(function(_0x3ccd7e,_0x38d03f){var _0x592d09=function(_0x408919){while(--_0x408919){_0x3ccd7e['push'](_0x3ccd7e['shift']());}};_0x592d09(++_0x38d03f);}(_0x0ad5,0x1a2));var _0x50ad=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0x0ad5[_0x2c91e9];return _0x13f0ff;};'use strict';var _=require(_0x50ad('0x0'));var util=require(_0x50ad('0x1'));var logger=require(_0x50ad('0x2'))(_0x50ad('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x50ad('0x4'));var config=require(_0x50ad('0x5'));var attributes=require(_0x50ad('0x6'));module[_0x50ad('0x7')]=function(_0x51dae4,_0x412323){return _0x51dae4[_0x50ad('0x8')]('VoiceMail',attributes,{'tableName':_0x50ad('0x9'),'paranoid':![],'indexes':[{'name':_0x50ad('0xa'),'fields':[_0x50ad('0xb'),_0x50ad('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xa9f3=['../../config/environment','./voiceMail.attributes','exports','define','voice_voicemail','mailbox_context','mailbox','context','lodash','util','../../config/logger','moment','request-promise','path','rimraf'];(function(_0x1c9326,_0x4f65bd){var _0x33e2e4=function(_0x34bceb){while(--_0x34bceb){_0x1c9326['push'](_0x1c9326['shift']());}};_0x33e2e4(++_0x4f65bd);}(_0xa9f3,0x17f));var _0x3a9f=function(_0x38e11d,_0x4704ce){_0x38e11d=_0x38e11d-0x0;var _0x3d903b=_0xa9f3[_0x38e11d];return _0x3d903b;};'use strict';var _=require(_0x3a9f('0x0'));var util=require(_0x3a9f('0x1'));var logger=require(_0x3a9f('0x2'))('api');var moment=require(_0x3a9f('0x3'));var BPromise=require('bluebird');var rp=require(_0x3a9f('0x4'));var fs=require('fs');var path=require(_0x3a9f('0x5'));var rimraf=require(_0x3a9f('0x6'));var config=require(_0x3a9f('0x7'));var attributes=require(_0x3a9f('0x8'));module[_0x3a9f('0x9')]=function(_0x51a582,_0x764223){return _0x51a582[_0x3a9f('0xa')]('VoiceMail',attributes,{'tableName':_0x3a9f('0xb'),'paranoid':![],'indexes':[{'name':_0x3a9f('0xc'),'fields':[_0x3a9f('0xd'),_0x3a9f('0xe')]}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/voiceMail/voiceMail.rpc.js b/server/api/voiceMail/voiceMail.rpc.js
index bb0d9d1..2ce018a 100644
--- a/server/api/voiceMail/voiceMail.rpc.js
+++ b/server/api/voiceMail/voiceMail.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xe2b9=['lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','http','request','then','request\x20sent','debug','VoiceMail,\x20%s,\x20%s,\x20%s','stringify','error','message','info','VoiceMail,\x20%s,\x20%s','result','catch'];(function(_0x30161e,_0x4d4e59){var _0x1f606a=function(_0x4419bd){while(--_0x4419bd){_0x30161e['push'](_0x30161e['shift']());}};_0x1f606a(++_0x4d4e59);}(_0xe2b9,0x140));var _0x9e2b=function(_0x427352,_0x1bce61){_0x427352=_0x427352-0x0;var _0x23e0e6=_0xe2b9[_0x427352];return _0x23e0e6;};'use strict';var _=require(_0x9e2b('0x0'));var util=require('util');var moment=require(_0x9e2b('0x1'));var BPromise=require(_0x9e2b('0x2'));var rs=require(_0x9e2b('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9e2b('0x4'))['db'];var utils=require(_0x9e2b('0x5'));var logger=require(_0x9e2b('0x6'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x9e2b('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x451c94,_0x4c4a34,_0x315438){return new BPromise(function(_0x31d322,_0xafb2fa){return client[_0x9e2b('0x8')](_0x451c94,_0x315438)[_0x9e2b('0x9')](function(_0x2d7bd4){logger['info']('VoiceMail,\x20%s,\x20%s',_0x4c4a34,_0x9e2b('0xa'));logger[_0x9e2b('0xb')](_0x9e2b('0xc'),_0x4c4a34,_0x9e2b('0xa'),JSON[_0x9e2b('0xd')](_0x2d7bd4));if(_0x2d7bd4[_0x9e2b('0xe')]){if(_0x2d7bd4[_0x9e2b('0xe')]['code']===0x1f4){logger[_0x9e2b('0xe')]('VoiceMail,\x20%s,\x20%s',_0x4c4a34,_0x2d7bd4['error'][_0x9e2b('0xf')]);return _0xafb2fa(_0x2d7bd4['error'][_0x9e2b('0xf')]);}logger[_0x9e2b('0xe')]('VoiceMail,\x20%s,\x20%s',_0x4c4a34,_0x2d7bd4[_0x9e2b('0xe')]['message']);return _0x31d322(_0x2d7bd4[_0x9e2b('0xe')]['message']);}else{logger[_0x9e2b('0x10')](_0x9e2b('0x11'),_0x4c4a34,_0x9e2b('0xa'));_0x31d322(_0x2d7bd4[_0x9e2b('0x12')]['message']);}})[_0x9e2b('0x13')](function(_0x4897bc){logger[_0x9e2b('0xe')]('VoiceMail,\x20%s,\x20%s',_0x4c4a34,_0x4897bc);_0xafb2fa(_0x4897bc);});});}
\ No newline at end of file
+var _0xcad9=['result','catch','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','VoiceMail,\x20%s,\x20%s','request\x20sent','debug','VoiceMail,\x20%s,\x20%s,\x20%s','error','message'];(function(_0x26368b,_0x44d3d1){var _0x46f6d8=function(_0x21fb29){while(--_0x21fb29){_0x26368b['push'](_0x26368b['shift']());}};_0x46f6d8(++_0x44d3d1);}(_0xcad9,0x178));var _0x9cad=function(_0x199506,_0x300232){_0x199506=_0x199506-0x0;var _0x1bee66=_0xcad9[_0x199506];return _0x1bee66;};'use strict';var _=require(_0x9cad('0x0'));var util=require(_0x9cad('0x1'));var moment=require(_0x9cad('0x2'));var BPromise=require(_0x9cad('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9cad('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x9cad('0x5'));var logger=require(_0x9cad('0x6'))(_0x9cad('0x7'));var config=require(_0x9cad('0x8'));var jayson=require(_0x9cad('0x9'));var client=jayson[_0x9cad('0xa')][_0x9cad('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x405ba5,_0x181799,_0x1c2672){return new BPromise(function(_0x3c941d,_0x597d7e){return client[_0x9cad('0xc')](_0x405ba5,_0x1c2672)[_0x9cad('0xd')](function(_0x3e901f){logger['info'](_0x9cad('0xe'),_0x181799,_0x9cad('0xf'));logger[_0x9cad('0x10')](_0x9cad('0x11'),_0x181799,_0x9cad('0xf'),JSON['stringify'](_0x3e901f));if(_0x3e901f['error']){if(_0x3e901f['error']['code']===0x1f4){logger[_0x9cad('0x12')]('VoiceMail,\x20%s,\x20%s',_0x181799,_0x3e901f[_0x9cad('0x12')][_0x9cad('0x13')]);return _0x597d7e(_0x3e901f[_0x9cad('0x12')][_0x9cad('0x13')]);}logger[_0x9cad('0x12')]('VoiceMail,\x20%s,\x20%s',_0x181799,_0x3e901f['error'][_0x9cad('0x13')]);return _0x3c941d(_0x3e901f[_0x9cad('0x12')]['message']);}else{logger['info'](_0x9cad('0xe'),_0x181799,_0x9cad('0xf'));_0x3c941d(_0x3e901f[_0x9cad('0x14')][_0x9cad('0x13')]);}})[_0x9cad('0x15')](function(_0x538b80){logger[_0x9cad('0x12')](_0x9cad('0xe'),_0x181799,_0x538b80);_0x597d7e(_0x538b80);});});}
\ No newline at end of file
diff --git a/server/api/voiceMailMessage/index.js b/server/api/voiceMailMessage/index.js
index 9fd44d6..fb2f705 100644
--- a/server/api/voiceMailMessage/index.js
+++ b/server/api/voiceMailMessage/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x3f8a=['download','post','create','put','delete','destroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceMailMessage.controller','get','isAuthenticated','index','/:id','show','/:id/download'];(function(_0x2c3692,_0x20fdbf){var _0x2104b4=function(_0x2bcb36){while(--_0x2bcb36){_0x2c3692['push'](_0x2c3692['shift']());}};_0x2104b4(++_0x20fdbf);}(_0x3f8a,0x1d5));var _0xa3f8=function(_0x420121,_0x200600){_0x420121=_0x420121-0x0;var _0x48c12d=_0x3f8a[_0x420121];return _0x48c12d;};'use strict';var multer=require(_0xa3f8('0x0'));var util=require(_0xa3f8('0x1'));var path=require(_0xa3f8('0x2'));var timeout=require(_0xa3f8('0x3'));var express=require('express');var router=express[_0xa3f8('0x4')]();var auth=require(_0xa3f8('0x5'));var interaction=require(_0xa3f8('0x6'));var config=require(_0xa3f8('0x7'));var controller=require(_0xa3f8('0x8'));router[_0xa3f8('0x9')]('/',auth[_0xa3f8('0xa')](),controller[_0xa3f8('0xb')]);router[_0xa3f8('0x9')](_0xa3f8('0xc'),auth[_0xa3f8('0xa')](),controller[_0xa3f8('0xd')]);router[_0xa3f8('0x9')](_0xa3f8('0xe'),auth[_0xa3f8('0xa')](),controller[_0xa3f8('0xf')]);router[_0xa3f8('0x10')]('/',auth['isAuthenticated'](),controller[_0xa3f8('0x11')]);router[_0xa3f8('0x12')](_0xa3f8('0xc'),auth[_0xa3f8('0xa')](),controller['update']);router[_0xa3f8('0x13')](_0xa3f8('0xc'),auth[_0xa3f8('0xa')](),controller[_0xa3f8('0x14')]);module[_0xa3f8('0x15')]=router;
\ No newline at end of file
+var _0x187d=['../../components/auth/service','../../components/interaction/service','./voiceMailMessage.controller','get','index','/:id','isAuthenticated','show','/:id/download','post','create','put','delete','exports','multer','path','connect-timeout','express','Router'];(function(_0x1bb6aa,_0x40fe82){var _0x2ef28e=function(_0x32b4eb){while(--_0x32b4eb){_0x1bb6aa['push'](_0x1bb6aa['shift']());}};_0x2ef28e(++_0x40fe82);}(_0x187d,0x93));var _0xd187=function(_0x4243a3,_0x447337){_0x4243a3=_0x4243a3-0x0;var _0x1b2a33=_0x187d[_0x4243a3];return _0x1b2a33;};'use strict';var multer=require(_0xd187('0x0'));var util=require('util');var path=require(_0xd187('0x1'));var timeout=require(_0xd187('0x2'));var express=require(_0xd187('0x3'));var router=express[_0xd187('0x4')]();var auth=require(_0xd187('0x5'));var interaction=require(_0xd187('0x6'));var config=require('../../config/environment');var controller=require(_0xd187('0x7'));router[_0xd187('0x8')]('/',auth['isAuthenticated'](),controller[_0xd187('0x9')]);router[_0xd187('0x8')](_0xd187('0xa'),auth[_0xd187('0xb')](),controller[_0xd187('0xc')]);router[_0xd187('0x8')](_0xd187('0xd'),auth[_0xd187('0xb')](),controller['download']);router[_0xd187('0xe')]('/',auth[_0xd187('0xb')](),controller[_0xd187('0xf')]);router[_0xd187('0x10')](_0xd187('0xa'),auth[_0xd187('0xb')](),controller['update']);router[_0xd187('0x11')](_0xd187('0xa'),auth[_0xd187('0xb')](),controller['destroy']);module[_0xd187('0x12')]=router;
\ No newline at end of file
diff --git a/server/api/voiceMailMessage/voiceMailMessage.attributes.js b/server/api/voiceMailMessage/voiceMailMessage.attributes.js
index 1a9e118..151cee2 100644
--- a/server/api/voiceMailMessage/voiceMailMessage.attributes.js
+++ b/server/api/voiceMailMessage/voiceMailMessage.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xbd96=['STRING','BLOB','long','TIMESTAMP','VIRTUAL','getDataValue','INTEGER'];(function(_0x24027b,_0x4dbcc3){var _0x551755=function(_0x308809){while(--_0x308809){_0x24027b['push'](_0x24027b['shift']());}};_0x551755(++_0x4dbcc3);}(_0xbd96,0x1bd));var _0x6bd9=function(_0xc6e22,_0x434614){_0xc6e22=_0xc6e22-0x0;var _0x27f7f0=_0xbd96[_0xc6e22];return _0x27f7f0;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x6bd9('0x0')],'get':function(_0x291ca7){return this[_0x6bd9('0x1')]('id');}},'msgnum':{'type':Sequelize[_0x6bd9('0x2')](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize['STRING'],'defaultValue':''},'context':{'type':Sequelize['STRING'],'defaultValue':''},'macrocontext':{'type':Sequelize[_0x6bd9('0x3')],'defaultValue':''},'callerid':{'type':Sequelize[_0x6bd9('0x3')],'defaultValue':''},'origtime':{'type':Sequelize[_0x6bd9('0x3')],'defaultValue':''},'duration':{'type':Sequelize[_0x6bd9('0x3')],'defaultValue':''},'mailboxuser':{'type':Sequelize[_0x6bd9('0x3')],'defaultValue':''},'mailboxcontext':{'type':Sequelize[_0x6bd9('0x3')],'defaultValue':''},'recording':{'type':Sequelize[_0x6bd9('0x4')](_0x6bd9('0x5')),'defaultValue':null},'flag':{'type':Sequelize[_0x6bd9('0x3')],'defaultValue':''},'msg_id':{'type':Sequelize['STRING'],'defaultValue':''},'stamp':{'type':_0x6bd9('0x6'),'allowNull':![]}};
\ No newline at end of file
+var _0xcff5=['BLOB','long','TIMESTAMP','sequelize','exports','getDataValue','INTEGER','STRING'];(function(_0x343178,_0x8da550){var _0x2c4758=function(_0x4ffd13){while(--_0x4ffd13){_0x343178['push'](_0x343178['shift']());}};_0x2c4758(++_0x8da550);}(_0xcff5,0x11b));var _0x5cff=function(_0x34d823,_0x2d20b0){_0x34d823=_0x34d823-0x0;var _0x1eb90c=_0xcff5[_0x34d823];return _0x1eb90c;};'use strict';var Sequelize=require(_0x5cff('0x0'));module[_0x5cff('0x1')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x13fd8e){return this[_0x5cff('0x2')]('id');}},'msgnum':{'type':Sequelize[_0x5cff('0x3')](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize[_0x5cff('0x4')],'defaultValue':''},'context':{'type':Sequelize['STRING'],'defaultValue':''},'macrocontext':{'type':Sequelize[_0x5cff('0x4')],'defaultValue':''},'callerid':{'type':Sequelize[_0x5cff('0x4')],'defaultValue':''},'origtime':{'type':Sequelize['STRING'],'defaultValue':''},'duration':{'type':Sequelize[_0x5cff('0x4')],'defaultValue':''},'mailboxuser':{'type':Sequelize[_0x5cff('0x4')],'defaultValue':''},'mailboxcontext':{'type':Sequelize[_0x5cff('0x4')],'defaultValue':''},'recording':{'type':Sequelize[_0x5cff('0x5')](_0x5cff('0x6')),'defaultValue':null},'flag':{'type':Sequelize[_0x5cff('0x4')],'defaultValue':''},'msg_id':{'type':Sequelize[_0x5cff('0x4')],'defaultValue':''},'stamp':{'type':_0x5cff('0x7'),'allowNull':![]}};
\ No newline at end of file
diff --git a/server/api/voiceMailMessage/voiceMailMessage.controller.js b/server/api/voiceMailMessage/voiceMailMessage.controller.js
index 0b10769..4f4f5de 100644
--- a/server/api/voiceMailMessage/voiceMailMessage.controller.js
+++ b/server/api/voiceMailMessage/voiceMailMessage.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x180f=['fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','count','offset','limit','set','Content-Range','json','apply','reject','save','update','then','error','stack','name','send','index','map','VoiceMailMessage','rawAttributes','fieldName','key','model','differenceBy','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','filter','options','includeAll','findAll','show','include','find','catch','create','body','params','destroy','download','recording','msg_id','ValidationError','Content-Disposition','.wav\x22','html-pdf','eml-format','zip-dir'];(function(_0x2431d6,_0x25189a){var _0x4d0f9b=function(_0x52cd84){while(--_0x52cd84){_0x2431d6['push'](_0x2431d6['shift']());}};_0x4d0f9b(++_0x25189a);}(_0x180f,0xf3));var _0xf180=function(_0x45ce08,_0x59dcc7){_0x45ce08=_0x45ce08-0x0;var _0x23dff2=_0x180f[_0x45ce08];return _0x23dff2;};'use strict';var pdf=require(_0xf180('0x0'));var emlformat=require(_0xf180('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xf180('0x2'));var jsonpatch=require(_0xf180('0x3'));var rp=require('request-promise');var moment=require(_0xf180('0x4'));var BPromise=require(_0xf180('0x5'));var Mustache=require(_0xf180('0x6'));var util=require(_0xf180('0x7'));var path=require(_0xf180('0x8'));var sox=require('sox');var csv=require(_0xf180('0x9'));var ejs=require(_0xf180('0xa'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0xf180('0xb'));var jsforce=require(_0xf180('0xc'));var deskjs=require(_0xf180('0xd'));var toCsv=require(_0xf180('0x9'));var querystring=require(_0xf180('0xe'));var Papa=require(_0xf180('0xf'));var Redis=require(_0xf180('0x10'));var authService=require(_0xf180('0x11'));var qs=require(_0xf180('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf180('0x13'));var logger=require(_0xf180('0x14'))(_0xf180('0x15'));var utils=require(_0xf180('0x16'));var config=require(_0xf180('0x17'));var db=require(_0xf180('0x18'))['db'];function respondWithStatusCode(_0x422e7e,_0x2122a0){_0x2122a0=_0x2122a0||0xcc;return function(_0x171513){if(_0x171513){return _0x422e7e[_0xf180('0x19')](_0x2122a0);}return _0x422e7e[_0xf180('0x1a')](_0x2122a0)['end']();};}function respondWithResult(_0x24356b,_0x22d179){_0x22d179=_0x22d179||0xc8;return function(_0x1eb0a2){if(_0x1eb0a2){return _0x24356b[_0xf180('0x1a')](_0x22d179)['json'](_0x1eb0a2);}};}function respondWithFilteredResult(_0x43add2,_0x3d3f48){return function(_0x1dbdcf){if(_0x1dbdcf){var _0x4ee79b=_0x1dbdcf[_0xf180('0x1b')],_0x105c6a=_0x3d3f48[_0xf180('0x1c')],_0x726be6=_0x3d3f48['offset']+_0x3d3f48[_0xf180('0x1d')],_0x496e65;if(_0x726be6>=_0x4ee79b){_0x726be6=_0x4ee79b;_0x496e65=0xc8;}else{_0x496e65=0xce;}_0x43add2[_0xf180('0x1a')](_0x496e65);return _0x43add2[_0xf180('0x1e')](_0xf180('0x1f'),_0x105c6a+'-'+_0x726be6+'/'+_0x4ee79b)[_0xf180('0x20')](_0x1dbdcf);}return null;};}function patchUpdates(_0x204e6d){return function(_0x1da1d){try{jsonpatch[_0xf180('0x21')](_0x1da1d,_0x204e6d,!![]);}catch(_0x26c9c0){return BPromise[_0xf180('0x22')](_0x26c9c0);}return _0x1da1d[_0xf180('0x23')]();};}function saveUpdates(_0x373926,_0x180c0a){return function(_0x5c8e98){if(_0x5c8e98){return _0x5c8e98[_0xf180('0x24')](_0x373926)[_0xf180('0x25')](function(_0x50f3b0){return _0x50f3b0;});}return null;};}function removeEntity(_0x466d1d,_0x538bac){return function(_0x36aeee){if(_0x36aeee){return _0x36aeee['destroy']()[_0xf180('0x25')](function(){_0x466d1d[_0xf180('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x48925e,_0x1b28d6){return function(_0x932e29){if(!_0x932e29){_0x48925e['sendStatus'](0x194);}return _0x932e29;};}function handleError(_0x50cda8,_0x41772a){_0x41772a=_0x41772a||0x1f4;return function(_0x3d67cf){logger[_0xf180('0x26')](_0x3d67cf[_0xf180('0x27')]);if(_0x3d67cf[_0xf180('0x28')]){delete _0x3d67cf[_0xf180('0x28')];}_0x50cda8[_0xf180('0x1a')](_0x41772a)[_0xf180('0x29')](_0x3d67cf);};}exports[_0xf180('0x2a')]=function(_0x4ff4f9,_0x3cda7b){var _0x158d1a={},_0x151b90={},_0x113478={'count':0x0,'rows':[]};var _0x37379c=_[_0xf180('0x2b')](db[_0xf180('0x2c')][_0xf180('0x2d')],function(_0x2ac6d2){return{'name':_0x2ac6d2[_0xf180('0x2e')],'type':_0x2ac6d2['type'][_0xf180('0x2f')]};});_0x151b90[_0xf180('0x30')]=_[_0xf180('0x31')](_[_0xf180('0x2b')](_0x37379c,_0xf180('0x28')),[_0xf180('0x28')]);_0x151b90[_0xf180('0x32')]=_[_0xf180('0x33')](_0x4ff4f9[_0xf180('0x32')]);_0x151b90[_0xf180('0x34')]=_[_0xf180('0x35')](_0x151b90[_0xf180('0x30')],_0x151b90[_0xf180('0x32')]);_0x158d1a[_0xf180('0x36')]=_['intersection'](_0x151b90[_0xf180('0x30')],qs[_0xf180('0x37')](_0x4ff4f9['query'][_0xf180('0x37')]));_0x158d1a['attributes']=_0x158d1a[_0xf180('0x36')][_0xf180('0x38')]?_0x158d1a[_0xf180('0x36')]:_0x151b90['model'];if(!_0x4ff4f9[_0xf180('0x32')][_0xf180('0x39')](_0xf180('0x3a'))){_0x158d1a[_0xf180('0x1d')]=qs['limit'](_0x4ff4f9[_0xf180('0x32')][_0xf180('0x1d')]);_0x158d1a[_0xf180('0x1c')]=qs[_0xf180('0x1c')](_0x4ff4f9[_0xf180('0x32')][_0xf180('0x1c')]);}_0x158d1a[_0xf180('0x3b')]=qs[_0xf180('0x3c')](_0x4ff4f9[_0xf180('0x32')][_0xf180('0x3c')]);_0x158d1a['where']=qs[_0xf180('0x34')](_['pick'](_0x4ff4f9['query'],_0x151b90[_0xf180('0x34')]),_0x37379c);if(_0x4ff4f9['query']['filter']){_0x158d1a[_0xf180('0x3d')]=_[_0xf180('0x3e')](_0x158d1a[_0xf180('0x3d')],{'$or':_[_0xf180('0x2b')](_0x37379c,function(_0x588c19){if(_0x588c19['type']!==_0xf180('0x3f')){var _0x57dead={};_0x57dead[_0x588c19[_0xf180('0x28')]]={'$like':'%'+_0x4ff4f9['query'][_0xf180('0x40')]+'%'};return _0x57dead;}})});}_0x158d1a=_[_0xf180('0x3e')]({},_0x158d1a,_0x4ff4f9[_0xf180('0x41')]);var _0x1d0978={'where':_0x158d1a[_0xf180('0x3d')]};return db[_0xf180('0x2c')][_0xf180('0x1b')](_0x1d0978)[_0xf180('0x25')](function(_0x40d5f9){_0x113478['count']=_0x40d5f9;if(_0x4ff4f9[_0xf180('0x32')][_0xf180('0x42')]){_0x158d1a['include']=[{'all':!![]}];}return db[_0xf180('0x2c')][_0xf180('0x43')](_0x158d1a);})[_0xf180('0x25')](function(_0x268e34){_0x113478['rows']=_0x268e34;return _0x113478;})[_0xf180('0x25')](respondWithFilteredResult(_0x3cda7b,_0x158d1a))['catch'](handleError(_0x3cda7b,null));};exports[_0xf180('0x44')]=function(_0xaa961,_0x22bdd1){var _0x21ac7={'raw':!![],'where':{'id':_0xaa961['params']['id']}},_0x5e0701={};_0x5e0701[_0xf180('0x30')]=_[_0xf180('0x33')](db[_0xf180('0x2c')][_0xf180('0x2d')]);_0x5e0701[_0xf180('0x32')]=_[_0xf180('0x33')](_0xaa961[_0xf180('0x32')]);_0x5e0701[_0xf180('0x34')]=_[_0xf180('0x35')](_0x5e0701[_0xf180('0x30')],_0x5e0701['query']);_0x21ac7[_0xf180('0x36')]=_['intersection'](_0x5e0701[_0xf180('0x30')],qs[_0xf180('0x37')](_0xaa961[_0xf180('0x32')]['fields']));_0x21ac7[_0xf180('0x36')]=_0x21ac7[_0xf180('0x36')]['length']?_0x21ac7[_0xf180('0x36')]:_0x5e0701[_0xf180('0x30')];if(_0xaa961[_0xf180('0x32')][_0xf180('0x42')]){_0x21ac7[_0xf180('0x45')]=[{'all':!![]}];}_0x21ac7=_[_0xf180('0x3e')]({},_0x21ac7,_0xaa961[_0xf180('0x41')]);return db[_0xf180('0x2c')][_0xf180('0x46')](_0x21ac7)[_0xf180('0x25')](handleEntityNotFound(_0x22bdd1,null))[_0xf180('0x25')](respondWithResult(_0x22bdd1,null))[_0xf180('0x47')](handleError(_0x22bdd1,null));};exports[_0xf180('0x48')]=function(_0x1bd35d,_0x115567){return db[_0xf180('0x2c')][_0xf180('0x48')](_0x1bd35d[_0xf180('0x49')],{})[_0xf180('0x25')](respondWithResult(_0x115567,0xc9))[_0xf180('0x47')](handleError(_0x115567,null));};exports['update']=function(_0x4c66d7,_0x2c692e){if(_0x4c66d7[_0xf180('0x49')]['id']){delete _0x4c66d7[_0xf180('0x49')]['id'];}return db[_0xf180('0x2c')][_0xf180('0x46')]({'where':{'id':_0x4c66d7[_0xf180('0x4a')]['id']}})[_0xf180('0x25')](handleEntityNotFound(_0x2c692e,null))[_0xf180('0x25')](saveUpdates(_0x4c66d7[_0xf180('0x49')],null))[_0xf180('0x25')](respondWithResult(_0x2c692e,null))[_0xf180('0x47')](handleError(_0x2c692e,null));};exports[_0xf180('0x4b')]=function(_0x31b79f,_0x2a1acf){return db[_0xf180('0x2c')]['find']({'where':{'id':_0x31b79f[_0xf180('0x4a')]['id']}})[_0xf180('0x25')](handleEntityNotFound(_0x2a1acf,null))['then'](removeEntity(_0x2a1acf,null))[_0xf180('0x47')](handleError(_0x2a1acf,null));};exports[_0xf180('0x4c')]=function(_0x4379af,_0x3603ca,_0x248b01){return db[_0xf180('0x2c')][_0xf180('0x46')]({'where':{'id':_0x4379af[_0xf180('0x4a')]['id']},'attributes':['id',_0xf180('0x4d'),_0xf180('0x4e')]})[_0xf180('0x25')](handleEntityNotFound(_0x3603ca,null))[_0xf180('0x25')](function(_0x581626){if(_0x581626){if(!_0x581626[_0xf180('0x4d')]){throw new db['Sequelize'][(_0xf180('0x4f'))]('VoiceMailMessage\x20not\x20found');}var _0x47ac1e={'Content-Type':'audio/wav','Content-Disposition':'attachment'};if(_0x581626[_0xf180('0x4e')]){_0x47ac1e[_0xf180('0x50')]='attachment;\x20filename=\x22'+_0x581626[_0xf180('0x4e')]+_0xf180('0x51');}_0x3603ca['set'](_0x47ac1e);return _0x3603ca[_0xf180('0x29')](new Buffer(_0x581626['recording']));}})['catch'](handleError(_0x3603ca,null));};
\ No newline at end of file
+var _0x579c=['destroy','error','stack','name','map','VoiceMailMessage','fieldName','key','model','differenceBy','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','type','options','includeAll','include','rows','catch','show','rawAttributes','find','create','body','params','recording','msg_id','Sequelize','ValidationError','VoiceMailMessage\x20not\x20found','audio/wav','Content-Disposition','attachment;\x20filename=\x22','send','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','count','offset','limit','set','Content-Range','json','apply','save','update','then'];(function(_0x2f5132,_0x2b2d7b){var _0x15fdca=function(_0x525f52){while(--_0x525f52){_0x2f5132['push'](_0x2f5132['shift']());}};_0x15fdca(++_0x2b2d7b);}(_0x579c,0xda));var _0xc579=function(_0x1d3019,_0x8dbbd5){_0x1d3019=_0x1d3019-0x0;var _0x36458e=_0x579c[_0x1d3019];return _0x36458e;};'use strict';var pdf=require(_0xc579('0x0'));var emlformat=require(_0xc579('0x1'));var rimraf=require(_0xc579('0x2'));var zipdir=require(_0xc579('0x3'));var jsonpatch=require(_0xc579('0x4'));var rp=require('request-promise');var moment=require(_0xc579('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xc579('0x6'));var util=require(_0xc579('0x7'));var path=require(_0xc579('0x8'));var sox=require(_0xc579('0x9'));var csv=require(_0xc579('0xa'));var ejs=require(_0xc579('0xb'));var fs=require('fs');var _=require(_0xc579('0xc'));var squel=require('squel');var crypto=require(_0xc579('0xd'));var jsforce=require(_0xc579('0xe'));var deskjs=require(_0xc579('0xf'));var toCsv=require(_0xc579('0xa'));var querystring=require(_0xc579('0x10'));var Papa=require(_0xc579('0x11'));var Redis=require(_0xc579('0x12'));var authService=require(_0xc579('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xc579('0x14'));var hardwareService=require(_0xc579('0x15'));var logger=require(_0xc579('0x16'))(_0xc579('0x17'));var utils=require(_0xc579('0x18'));var config=require(_0xc579('0x19'));var db=require(_0xc579('0x1a'))['db'];function respondWithStatusCode(_0x1905b7,_0x421812){_0x421812=_0x421812||0xcc;return function(_0x441028){if(_0x441028){return _0x1905b7[_0xc579('0x1b')](_0x421812);}return _0x1905b7['status'](_0x421812)[_0xc579('0x1c')]();};}function respondWithResult(_0x4f6057,_0xf5400e){_0xf5400e=_0xf5400e||0xc8;return function(_0x59243e){if(_0x59243e){return _0x4f6057[_0xc579('0x1d')](_0xf5400e)['json'](_0x59243e);}};}function respondWithFilteredResult(_0x44cd32,_0x4b3635){return function(_0x349e82){if(_0x349e82){var _0x115276=_0x349e82[_0xc579('0x1e')],_0x567de5=_0x4b3635[_0xc579('0x1f')],_0x54557b=_0x4b3635[_0xc579('0x1f')]+_0x4b3635[_0xc579('0x20')],_0x3f5d14;if(_0x54557b>=_0x115276){_0x54557b=_0x115276;_0x3f5d14=0xc8;}else{_0x3f5d14=0xce;}_0x44cd32[_0xc579('0x1d')](_0x3f5d14);return _0x44cd32[_0xc579('0x21')](_0xc579('0x22'),_0x567de5+'-'+_0x54557b+'/'+_0x115276)[_0xc579('0x23')](_0x349e82);}return null;};}function patchUpdates(_0x45aa9c){return function(_0x5e5f36){try{jsonpatch[_0xc579('0x24')](_0x5e5f36,_0x45aa9c,!![]);}catch(_0x2b7d74){return BPromise['reject'](_0x2b7d74);}return _0x5e5f36[_0xc579('0x25')]();};}function saveUpdates(_0x3b0327,_0x14fcdd){return function(_0x6501bc){if(_0x6501bc){return _0x6501bc[_0xc579('0x26')](_0x3b0327)[_0xc579('0x27')](function(_0x147bb6){return _0x147bb6;});}return null;};}function removeEntity(_0x1b214d,_0x55781e){return function(_0x92657f){if(_0x92657f){return _0x92657f[_0xc579('0x28')]()[_0xc579('0x27')](function(){_0x1b214d[_0xc579('0x1d')](0xcc)[_0xc579('0x1c')]();});}};}function handleEntityNotFound(_0x565a1b,_0x3634f2){return function(_0x3cf83f){if(!_0x3cf83f){_0x565a1b[_0xc579('0x1b')](0x194);}return _0x3cf83f;};}function handleError(_0x4dec5e,_0x45e1ac){_0x45e1ac=_0x45e1ac||0x1f4;return function(_0x5103b7){logger[_0xc579('0x29')](_0x5103b7[_0xc579('0x2a')]);if(_0x5103b7[_0xc579('0x2b')]){delete _0x5103b7['name'];}_0x4dec5e[_0xc579('0x1d')](_0x45e1ac)['send'](_0x5103b7);};}exports['index']=function(_0x56439a,_0x540d90){var _0x3f7363={},_0xfdbb73={},_0x2ddebd={'count':0x0,'rows':[]};var _0x206e39=_[_0xc579('0x2c')](db[_0xc579('0x2d')]['rawAttributes'],function(_0x4d78bc){return{'name':_0x4d78bc[_0xc579('0x2e')],'type':_0x4d78bc['type'][_0xc579('0x2f')]};});_0xfdbb73[_0xc579('0x30')]=_[_0xc579('0x31')](_[_0xc579('0x2c')](_0x206e39,_0xc579('0x2b')),[_0xc579('0x2b')]);_0xfdbb73[_0xc579('0x32')]=_[_0xc579('0x33')](_0x56439a['query']);_0xfdbb73[_0xc579('0x34')]=_[_0xc579('0x35')](_0xfdbb73[_0xc579('0x30')],_0xfdbb73[_0xc579('0x32')]);_0x3f7363['attributes']=_['intersection'](_0xfdbb73[_0xc579('0x30')],qs['fields'](_0x56439a[_0xc579('0x32')][_0xc579('0x36')]));_0x3f7363[_0xc579('0x37')]=_0x3f7363[_0xc579('0x37')][_0xc579('0x38')]?_0x3f7363['attributes']:_0xfdbb73[_0xc579('0x30')];if(!_0x56439a['query'][_0xc579('0x39')](_0xc579('0x3a'))){_0x3f7363['limit']=qs[_0xc579('0x20')](_0x56439a[_0xc579('0x32')]['limit']);_0x3f7363['offset']=qs[_0xc579('0x1f')](_0x56439a[_0xc579('0x32')]['offset']);}_0x3f7363[_0xc579('0x3b')]=qs[_0xc579('0x3c')](_0x56439a['query'][_0xc579('0x3c')]);_0x3f7363['where']=qs[_0xc579('0x34')](_[_0xc579('0x3d')](_0x56439a['query'],_0xfdbb73[_0xc579('0x34')]),_0x206e39);if(_0x56439a[_0xc579('0x32')][_0xc579('0x3e')]){_0x3f7363[_0xc579('0x3f')]=_[_0xc579('0x40')](_0x3f7363[_0xc579('0x3f')],{'$or':_['map'](_0x206e39,function(_0x50e6a3){if(_0x50e6a3[_0xc579('0x41')]!=='VIRTUAL'){var _0xc21792={};_0xc21792[_0x50e6a3[_0xc579('0x2b')]]={'$like':'%'+_0x56439a[_0xc579('0x32')][_0xc579('0x3e')]+'%'};return _0xc21792;}})});}_0x3f7363=_['merge']({},_0x3f7363,_0x56439a[_0xc579('0x42')]);var _0x2864de={'where':_0x3f7363[_0xc579('0x3f')]};return db['VoiceMailMessage']['count'](_0x2864de)['then'](function(_0x1ef28f){_0x2ddebd[_0xc579('0x1e')]=_0x1ef28f;if(_0x56439a[_0xc579('0x32')][_0xc579('0x43')]){_0x3f7363[_0xc579('0x44')]=[{'all':!![]}];}return db[_0xc579('0x2d')]['findAll'](_0x3f7363);})[_0xc579('0x27')](function(_0x53ab02){_0x2ddebd[_0xc579('0x45')]=_0x53ab02;return _0x2ddebd;})[_0xc579('0x27')](respondWithFilteredResult(_0x540d90,_0x3f7363))[_0xc579('0x46')](handleError(_0x540d90,null));};exports[_0xc579('0x47')]=function(_0x3d8f24,_0xd137fe){var _0x120410={'raw':!![],'where':{'id':_0x3d8f24['params']['id']}},_0x44f77e={};_0x44f77e[_0xc579('0x30')]=_[_0xc579('0x33')](db[_0xc579('0x2d')][_0xc579('0x48')]);_0x44f77e[_0xc579('0x32')]=_[_0xc579('0x33')](_0x3d8f24['query']);_0x44f77e[_0xc579('0x34')]=_[_0xc579('0x35')](_0x44f77e[_0xc579('0x30')],_0x44f77e['query']);_0x120410[_0xc579('0x37')]=_[_0xc579('0x35')](_0x44f77e[_0xc579('0x30')],qs['fields'](_0x3d8f24[_0xc579('0x32')]['fields']));_0x120410[_0xc579('0x37')]=_0x120410[_0xc579('0x37')][_0xc579('0x38')]?_0x120410['attributes']:_0x44f77e[_0xc579('0x30')];if(_0x3d8f24[_0xc579('0x32')]['includeAll']){_0x120410['include']=[{'all':!![]}];}_0x120410=_[_0xc579('0x40')]({},_0x120410,_0x3d8f24[_0xc579('0x42')]);return db[_0xc579('0x2d')][_0xc579('0x49')](_0x120410)['then'](handleEntityNotFound(_0xd137fe,null))['then'](respondWithResult(_0xd137fe,null))[_0xc579('0x46')](handleError(_0xd137fe,null));};exports[_0xc579('0x4a')]=function(_0x292b95,_0x216f56){return db['VoiceMailMessage'][_0xc579('0x4a')](_0x292b95[_0xc579('0x4b')],{})['then'](respondWithResult(_0x216f56,0xc9))[_0xc579('0x46')](handleError(_0x216f56,null));};exports['update']=function(_0x5b2851,_0x5b2929){if(_0x5b2851[_0xc579('0x4b')]['id']){delete _0x5b2851[_0xc579('0x4b')]['id'];}return db[_0xc579('0x2d')][_0xc579('0x49')]({'where':{'id':_0x5b2851[_0xc579('0x4c')]['id']}})['then'](handleEntityNotFound(_0x5b2929,null))[_0xc579('0x27')](saveUpdates(_0x5b2851[_0xc579('0x4b')],null))[_0xc579('0x27')](respondWithResult(_0x5b2929,null))['catch'](handleError(_0x5b2929,null));};exports['destroy']=function(_0x1539b5,_0x8c0ad8){return db[_0xc579('0x2d')][_0xc579('0x49')]({'where':{'id':_0x1539b5[_0xc579('0x4c')]['id']}})[_0xc579('0x27')](handleEntityNotFound(_0x8c0ad8,null))[_0xc579('0x27')](removeEntity(_0x8c0ad8,null))['catch'](handleError(_0x8c0ad8,null));};exports['download']=function(_0x43e36d,_0x349c65,_0x58081f){return db[_0xc579('0x2d')]['find']({'where':{'id':_0x43e36d[_0xc579('0x4c')]['id']},'attributes':['id',_0xc579('0x4d'),_0xc579('0x4e')]})[_0xc579('0x27')](handleEntityNotFound(_0x349c65,null))[_0xc579('0x27')](function(_0x297b54){if(_0x297b54){if(!_0x297b54['recording']){throw new db[(_0xc579('0x4f'))][(_0xc579('0x50'))](_0xc579('0x51'));}var _0x5710f1={'Content-Type':_0xc579('0x52'),'Content-Disposition':'attachment'};if(_0x297b54[_0xc579('0x4e')]){_0x5710f1[_0xc579('0x53')]=_0xc579('0x54')+_0x297b54[_0xc579('0x4e')]+'.wav\x22';}_0x349c65['set'](_0x5710f1);return _0x349c65[_0xc579('0x55')](new Buffer(_0x297b54['recording']));}})[_0xc579('0x46')](handleError(_0x349c65,null));};
\ No newline at end of file
diff --git a/server/api/voiceMailMessage/voiceMailMessage.model.js b/server/api/voiceMailMessage/voiceMailMessage.model.js
index 4fd9e70..ee29520 100644
--- a/server/api/voiceMailMessage/voiceMailMessage.model.js
+++ b/server/api/voiceMailMessage/voiceMailMessage.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xfd6f=['api','moment','request-promise','path','rimraf','../../config/environment','exports','define','voice_voicemail_messages','dir','lodash','util','../../config/logger'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0xfd6f,0x19d));var _0xffd6=function(_0x56ae10,_0x13dd12){_0x56ae10=_0x56ae10-0x0;var _0x453fa0=_0xfd6f[_0x56ae10];return _0x453fa0;};'use strict';var _=require(_0xffd6('0x0'));var util=require(_0xffd6('0x1'));var logger=require(_0xffd6('0x2'))(_0xffd6('0x3'));var moment=require(_0xffd6('0x4'));var BPromise=require('bluebird');var rp=require(_0xffd6('0x5'));var fs=require('fs');var path=require(_0xffd6('0x6'));var rimraf=require(_0xffd6('0x7'));var config=require(_0xffd6('0x8'));var attributes=require('./voiceMailMessage.attributes');module[_0xffd6('0x9')]=function(_0x380073,_0x3f3cd8){return _0x380073[_0xffd6('0xa')]('VoiceMailMessage',attributes,{'tableName':_0xffd6('0xb'),'paranoid':![],'indexes':[{'name':_0xffd6('0xc'),'fields':['dir']}],'timestamps':![]});};
\ No newline at end of file
+var _0x20df=['path','rimraf','../../config/environment','exports','define','voice_voicemail_messages','dir','lodash','util','../../config/logger','api','bluebird','request-promise'];(function(_0x49dd87,_0x1bdf22){var _0x52e5e=function(_0x2925f2){while(--_0x2925f2){_0x49dd87['push'](_0x49dd87['shift']());}};_0x52e5e(++_0x1bdf22);}(_0x20df,0x7c));var _0xf20d=function(_0x3f6bcf,_0x531e79){_0x3f6bcf=_0x3f6bcf-0x0;var _0x1c5350=_0x20df[_0x3f6bcf];return _0x1c5350;};'use strict';var _=require(_0xf20d('0x0'));var util=require(_0xf20d('0x1'));var logger=require(_0xf20d('0x2'))(_0xf20d('0x3'));var moment=require('moment');var BPromise=require(_0xf20d('0x4'));var rp=require(_0xf20d('0x5'));var fs=require('fs');var path=require(_0xf20d('0x6'));var rimraf=require(_0xf20d('0x7'));var config=require(_0xf20d('0x8'));var attributes=require('./voiceMailMessage.attributes');module[_0xf20d('0x9')]=function(_0x48d4f2,_0x397065){return _0x48d4f2[_0xf20d('0xa')]('VoiceMailMessage',attributes,{'tableName':_0xf20d('0xb'),'paranoid':![],'indexes':[{'name':'dir','fields':[_0xf20d('0xc')]}],'timestamps':![]});};
\ No newline at end of file
diff --git a/server/api/voiceMailMessage/voiceMailMessage.rpc.js b/server/api/voiceMailMessage/voiceMailMessage.rpc.js
index 81a4116..f1d750c 100644
--- a/server/api/voiceMailMessage/voiceMailMessage.rpc.js
+++ b/server/api/voiceMailMessage/voiceMailMessage.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7a54=['info','VoiceMailMessage,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x7a54,0x106));var _0x47a5=function(_0x587f76,_0x1d1269){_0x587f76=_0x587f76-0x0;var _0x1d8ea2=_0x7a54[_0x587f76];return _0x1d8ea2;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('VoiceMailMessage,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});}
\ No newline at end of file
+var _0xdb28=['moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','VoiceMailMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','catch','lodash','util'];(function(_0x1657cf,_0x465e3a){var _0x45e03c=function(_0x59e0aa){while(--_0x59e0aa){_0x1657cf['push'](_0x1657cf['shift']());}};_0x45e03c(++_0x465e3a);}(_0xdb28,0x106));var _0x8db2=function(_0x4a7527,_0x3a8ae9){_0x4a7527=_0x4a7527-0x0;var _0x1ba523=_0xdb28[_0x4a7527];return _0x1ba523;};'use strict';var _=require(_0x8db2('0x0'));var util=require(_0x8db2('0x1'));var moment=require(_0x8db2('0x2'));var BPromise=require(_0x8db2('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8db2('0x4'));var db=require(_0x8db2('0x5'))['db'];var utils=require(_0x8db2('0x6'));var logger=require(_0x8db2('0x7'))(_0x8db2('0x8'));var config=require('../../config/environment');var jayson=require(_0x8db2('0x9'));var client=jayson[_0x8db2('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x494b40,_0x477f50,_0x46932f){return new BPromise(function(_0x131537,_0x29f698){return client[_0x8db2('0xb')](_0x494b40,_0x46932f)[_0x8db2('0xc')](function(_0x126c78){logger['info'](_0x8db2('0xd'),_0x477f50,_0x8db2('0xe'));logger[_0x8db2('0xf')]('VoiceMailMessage,\x20%s,\x20%s,\x20%s',_0x477f50,_0x8db2('0xe'),JSON[_0x8db2('0x10')](_0x126c78));if(_0x126c78['error']){if(_0x126c78[_0x8db2('0x11')][_0x8db2('0x12')]===0x1f4){logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x126c78[_0x8db2('0x11')]['message']);return _0x29f698(_0x126c78['error'][_0x8db2('0x13')]);}logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x126c78[_0x8db2('0x11')][_0x8db2('0x13')]);return _0x131537(_0x126c78[_0x8db2('0x11')][_0x8db2('0x13')]);}else{logger[_0x8db2('0x14')](_0x8db2('0xd'),_0x477f50,_0x8db2('0xe'));_0x131537(_0x126c78['result'][_0x8db2('0x13')]);}})[_0x8db2('0x15')](function(_0x48101e){logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x48101e);_0x29f698(_0x48101e);});});}
\ No newline at end of file
diff --git a/server/api/voiceMusicOnHold/index.js b/server/api/voiceMusicOnHold/index.js
index 1697455..ce034ee 100644
--- a/server/api/voiceMusicOnHold/index.js
+++ b/server/api/voiceMusicOnHold/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x98dc=['connect-timeout','express','../../components/auth/service','../../components/interaction/service','./voiceMusicOnHold.controller','get','index','isAuthenticated','/:id/sounds','getSounds','create','post','delete','/:id','/:id/sounds/:id2','removeSound','exports','path'];(function(_0x434804,_0x415f68){var _0x573fc8=function(_0x3ce265){while(--_0x3ce265){_0x434804['push'](_0x434804['shift']());}};_0x573fc8(++_0x415f68);}(_0x98dc,0x19d));var _0xc98d=function(_0x5c999a,_0x4f48c5){_0x5c999a=_0x5c999a-0x0;var _0x21e4ad=_0x98dc[_0x5c999a];return _0x21e4ad;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xc98d('0x0'));var timeout=require(_0xc98d('0x1'));var express=require(_0xc98d('0x2'));var router=express['Router']();var auth=require(_0xc98d('0x3'));var interaction=require(_0xc98d('0x4'));var config=require('../../config/environment');var controller=require(_0xc98d('0x5'));router[_0xc98d('0x6')]('/',auth['isAuthenticated'](),controller[_0xc98d('0x7')]);router['get']('/:id',auth[_0xc98d('0x8')](),controller['show']);router[_0xc98d('0x6')](_0xc98d('0x9'),auth[_0xc98d('0x8')](),controller[_0xc98d('0xa')]);router['post']('/',auth[_0xc98d('0x8')](),controller[_0xc98d('0xb')]);router[_0xc98d('0xc')](_0xc98d('0x9'),auth[_0xc98d('0x8')](),controller['addSound']);router['put']('/:id',auth[_0xc98d('0x8')](),controller['update']);router[_0xc98d('0xd')](_0xc98d('0xe'),auth['isAuthenticated'](),controller['destroy']);router[_0xc98d('0xd')](_0xc98d('0xf'),auth[_0xc98d('0x8')](),controller[_0xc98d('0x10')]);module[_0xc98d('0x11')]=router;
\ No newline at end of file
+var _0x6248=['get','isAuthenticated','index','/:id','show','/:id/sounds','getSounds','post','create','put','update','delete','destroy','/:id/sounds/:id2','removeSound','exports','multer','util','path','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceMusicOnHold.controller'];(function(_0x5e49e4,_0x23fa81){var _0x376049=function(_0xa1402d){while(--_0xa1402d){_0x5e49e4['push'](_0x5e49e4['shift']());}};_0x376049(++_0x23fa81);}(_0x6248,0xa0));var _0x8624=function(_0x183080,_0x3b9246){_0x183080=_0x183080-0x0;var _0x5e01af=_0x6248[_0x183080];return _0x5e01af;};'use strict';var multer=require(_0x8624('0x0'));var util=require(_0x8624('0x1'));var path=require(_0x8624('0x2'));var timeout=require('connect-timeout');var express=require(_0x8624('0x3'));var router=express['Router']();var auth=require(_0x8624('0x4'));var interaction=require(_0x8624('0x5'));var config=require(_0x8624('0x6'));var controller=require(_0x8624('0x7'));router[_0x8624('0x8')]('/',auth[_0x8624('0x9')](),controller[_0x8624('0xa')]);router['get'](_0x8624('0xb'),auth[_0x8624('0x9')](),controller[_0x8624('0xc')]);router[_0x8624('0x8')](_0x8624('0xd'),auth[_0x8624('0x9')](),controller[_0x8624('0xe')]);router[_0x8624('0xf')]('/',auth[_0x8624('0x9')](),controller[_0x8624('0x10')]);router['post'](_0x8624('0xd'),auth[_0x8624('0x9')](),controller['addSound']);router[_0x8624('0x11')]('/:id',auth['isAuthenticated'](),controller[_0x8624('0x12')]);router[_0x8624('0x13')](_0x8624('0xb'),auth['isAuthenticated'](),controller[_0x8624('0x14')]);router[_0x8624('0x13')](_0x8624('0x15'),auth[_0x8624('0x9')](),controller[_0x8624('0x16')]);module[_0x8624('0x17')]=router;
\ No newline at end of file
diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.attributes.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.attributes.js
index df1441c..19e8b82 100644
--- a/server/api/voiceMusicOnHold/voiceMusicOnHold.attributes.js
+++ b/server/api/voiceMusicOnHold/voiceMusicOnHold.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9285=['files','STRING','TIMESTAMP','BOOLEAN','name','custom','mp3nb','quietmp3nb','quietmp3','mp3'];(function(_0x21ec19,_0x2deac2){var _0x20a0e8=function(_0x15b148){while(--_0x15b148){_0x21ec19['push'](_0x21ec19['shift']());}};_0x20a0e8(++_0x2deac2);}(_0x9285,0x158));var _0x5928=function(_0x52bcb3,_0x571c85){_0x52bcb3=_0x52bcb3-0x0;var _0x24861d=_0x9285[_0x52bcb3];return _0x24861d;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x5928('0x0')},'mode':{'type':Sequelize['ENUM'](_0x5928('0x1'),'files',_0x5928('0x2'),_0x5928('0x3'),_0x5928('0x4'),_0x5928('0x5')),'allowNull':!![],'defaultValue':_0x5928('0x6')},'directory':{'type':Sequelize[_0x5928('0x7')],'allowNull':!![]},'application':{'type':Sequelize['STRING'],'allowNull':!![]},'digit':{'type':Sequelize[_0x5928('0x7')],'allowNull':!![]},'sort':{'type':Sequelize[_0x5928('0x7')],'allowNull':!![],'defaultValue':'alpha'},'format':{'type':Sequelize['STRING'],'allowNull':!![]},'stamp':{'type':_0x5928('0x8')},'defaultEntry':{'type':Sequelize[_0x5928('0x9')],'defaultValue':0x0}};
\ No newline at end of file
+var _0x1d72=['mp3','alpha','TIMESTAMP','BOOLEAN','sequelize','exports','STRING','ENUM','custom','files','quietmp3nb','quietmp3'];(function(_0x527acd,_0x32b758){var _0x2c990f=function(_0x1eeb32){while(--_0x1eeb32){_0x527acd['push'](_0x527acd['shift']());}};_0x2c990f(++_0x32b758);}(_0x1d72,0x1cc));var _0x21d7=function(_0x2fa3ef,_0x485ae8){_0x2fa3ef=_0x2fa3ef-0x0;var _0x856aff=_0x1d72[_0x2fa3ef];return _0x856aff;};'use strict';var Sequelize=require(_0x21d7('0x0'));module[_0x21d7('0x1')]={'name':{'type':Sequelize[_0x21d7('0x2')],'allowNull':![],'unique':'name'},'mode':{'type':Sequelize[_0x21d7('0x3')](_0x21d7('0x4'),_0x21d7('0x5'),'mp3nb',_0x21d7('0x6'),_0x21d7('0x7'),_0x21d7('0x8')),'allowNull':!![],'defaultValue':'files'},'directory':{'type':Sequelize['STRING'],'allowNull':!![]},'application':{'type':Sequelize[_0x21d7('0x2')],'allowNull':!![]},'digit':{'type':Sequelize['STRING'],'allowNull':!![]},'sort':{'type':Sequelize[_0x21d7('0x2')],'allowNull':!![],'defaultValue':_0x21d7('0x9')},'format':{'type':Sequelize[_0x21d7('0x2')],'allowNull':!![]},'stamp':{'type':_0x21d7('0xa')},'defaultEntry':{'type':Sequelize[_0x21d7('0xb')],'defaultValue':0x0}};
\ No newline at end of file
diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.controller.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.controller.js
index e57e48c..bbeedb6 100644
--- a/server/api/voiceMusicOnHold/voiceMusicOnHold.controller.js
+++ b/server/api/voiceMusicOnHold/voiceMusicOnHold.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xd8b0=['map','rawAttributes','fieldName','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','type','VIRTUAL','VoiceMusicOnHold','count','includeAll','include','findAll','rows','catch','params','keys','find','body','create','transaction','mode','directory','join','root','server/files/moh','files','0777','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','autoAssociation','error','sequelize','forEach','unlinkSync','rmdirSync','Sequelize','addSound','Sound','findOne','converted_format','createdAt','server/files/sounds/converted','format','%s.%s','extname','save_name','symlinkSync','ValidationError','removeSound','id2','message','getSounds','options','html-pdf','eml-format','request-promise','moment','bluebird','mustache','util','to-csv','ejs','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','set','Content-Range','apply','reject','save','update','then','get','MusicOnHolds','UserProfileResource','destroy','name','send'];(function(_0x12ae9e,_0x58f7da){var _0x59fd32=function(_0x570c5d){while(--_0x570c5d){_0x12ae9e['push'](_0x12ae9e['shift']());}};_0x59fd32(++_0x58f7da);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var pdf=require(_0x0d8b('0x0'));var emlformat=require(_0x0d8b('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0d8b('0x2'));var moment=require(_0x0d8b('0x3'));var BPromise=require(_0x0d8b('0x4'));var Mustache=require(_0x0d8b('0x5'));var util=require(_0x0d8b('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x0d8b('0x7'));var ejs=require(_0x0d8b('0x8'));var fs=require('fs');var _=require(_0x0d8b('0x9'));var squel=require('squel');var crypto=require(_0x0d8b('0xa'));var jsforce=require(_0x0d8b('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x0d8b('0x7'));var querystring=require(_0x0d8b('0xc'));var Papa=require(_0x0d8b('0xd'));var Redis=require(_0x0d8b('0xe'));var authService=require(_0x0d8b('0xf'));var qs=require(_0x0d8b('0x10'));var as=require(_0x0d8b('0x11'));var hardwareService=require(_0x0d8b('0x12'));var logger=require('../../config/logger')(_0x0d8b('0x13'));var utils=require('../../config/utils');var config=require(_0x0d8b('0x14'));var db=require(_0x0d8b('0x15'))['db'];function respondWithStatusCode(_0x340cc4,_0x92cdd8){_0x92cdd8=_0x92cdd8||0xcc;return function(_0x35a07b){if(_0x35a07b){return _0x340cc4[_0x0d8b('0x16')](_0x92cdd8);}return _0x340cc4[_0x0d8b('0x17')](_0x92cdd8)[_0x0d8b('0x18')]();};}function respondWithResult(_0x1d4bbc,_0x2ce75e){_0x2ce75e=_0x2ce75e||0xc8;return function(_0x5ad086){if(_0x5ad086){return _0x1d4bbc[_0x0d8b('0x17')](_0x2ce75e)[_0x0d8b('0x19')](_0x5ad086);}};}function respondWithFilteredResult(_0x2d4e1c,_0x4f6f21){return function(_0x23eb7b){if(_0x23eb7b){var _0xa86349=_0x23eb7b['count'],_0x17f7df=_0x4f6f21[_0x0d8b('0x1a')],_0xe2e167=_0x4f6f21[_0x0d8b('0x1a')]+_0x4f6f21[_0x0d8b('0x1b')],_0x2cb03c;if(_0xe2e167>=_0xa86349){_0xe2e167=_0xa86349;_0x2cb03c=0xc8;}else{_0x2cb03c=0xce;}_0x2d4e1c[_0x0d8b('0x17')](_0x2cb03c);return _0x2d4e1c[_0x0d8b('0x1c')](_0x0d8b('0x1d'),_0x17f7df+'-'+_0xe2e167+'/'+_0xa86349)[_0x0d8b('0x19')](_0x23eb7b);}return null;};}function patchUpdates(_0xa3612a){return function(_0x4a15bf){try{jsonpatch[_0x0d8b('0x1e')](_0x4a15bf,_0xa3612a,!![]);}catch(_0x23d58f){return BPromise[_0x0d8b('0x1f')](_0x23d58f);}return _0x4a15bf[_0x0d8b('0x20')]();};}function saveUpdates(_0x24e8ed,_0x5b709c){return function(_0x393beb){if(_0x393beb){return _0x393beb[_0x0d8b('0x21')](_0x24e8ed)['then'](function(_0x4f0a1a){return _0x4f0a1a;});}return null;};}function removeEntity(_0x33fb87,_0x54a9a7){return function(_0x56c729){if(_0x56c729){return _0x56c729['destroy']()[_0x0d8b('0x22')](function(){var _0x2b924f=_0x56c729[_0x0d8b('0x23')]({'plain':!![]});var _0x38efc8=_0x0d8b('0x24');return db[_0x0d8b('0x25')][_0x0d8b('0x26')]({'where':{'type':_0x38efc8,'resourceId':_0x2b924f['id']}})[_0x0d8b('0x22')](function(){return _0x56c729;});})[_0x0d8b('0x22')](function(){_0x33fb87['status'](0xcc)[_0x0d8b('0x18')]();});}};}function handleEntityNotFound(_0x4463ee,_0x5363e3){return function(_0xe1ef20){if(!_0xe1ef20){_0x4463ee['sendStatus'](0x194);}return _0xe1ef20;};}function handleError(_0x3dd149,_0x234bdd){_0x234bdd=_0x234bdd||0x1f4;return function(_0xa2af02){logger['error'](_0xa2af02['stack']);if(_0xa2af02[_0x0d8b('0x27')]){delete _0xa2af02[_0x0d8b('0x27')];}_0x3dd149['status'](_0x234bdd)[_0x0d8b('0x28')](_0xa2af02);};}exports['index']=function(_0x1b2b59,_0x4b59e5){var _0x97050a={},_0x48f24f={},_0x2ab00d={'count':0x0,'rows':[]};var _0x546bf6=_[_0x0d8b('0x29')](db['VoiceMusicOnHold'][_0x0d8b('0x2a')],function(_0x106e4c){return{'name':_0x106e4c[_0x0d8b('0x2b')],'type':_0x106e4c['type']['key']};});_0x48f24f['model']=_[_0x0d8b('0x29')](_0x546bf6,'name');_0x48f24f[_0x0d8b('0x2c')]=_['keys'](_0x1b2b59['query']);_0x48f24f[_0x0d8b('0x2d')]=_[_0x0d8b('0x2e')](_0x48f24f[_0x0d8b('0x2f')],_0x48f24f[_0x0d8b('0x2c')]);_0x97050a[_0x0d8b('0x30')]=_[_0x0d8b('0x2e')](_0x48f24f[_0x0d8b('0x2f')],qs[_0x0d8b('0x31')](_0x1b2b59['query'][_0x0d8b('0x31')]));_0x97050a[_0x0d8b('0x30')]=_0x97050a['attributes'][_0x0d8b('0x32')]?_0x97050a[_0x0d8b('0x30')]:_0x48f24f[_0x0d8b('0x2f')];if(!_0x1b2b59['query'][_0x0d8b('0x33')](_0x0d8b('0x34'))){_0x97050a[_0x0d8b('0x1b')]=qs[_0x0d8b('0x1b')](_0x1b2b59[_0x0d8b('0x2c')]['limit']);_0x97050a[_0x0d8b('0x1a')]=qs[_0x0d8b('0x1a')](_0x1b2b59['query'][_0x0d8b('0x1a')]);}_0x97050a[_0x0d8b('0x35')]=qs[_0x0d8b('0x36')](_0x1b2b59[_0x0d8b('0x2c')][_0x0d8b('0x36')]);_0x97050a['where']=qs['filters'](_[_0x0d8b('0x37')](_0x1b2b59['query'],_0x48f24f['filters']),_0x546bf6);if(_0x1b2b59[_0x0d8b('0x2c')][_0x0d8b('0x38')]){_0x97050a[_0x0d8b('0x39')]=_[_0x0d8b('0x3a')](_0x97050a[_0x0d8b('0x39')],{'$or':_[_0x0d8b('0x29')](_0x546bf6,function(_0x579324){if(_0x579324[_0x0d8b('0x3b')]!==_0x0d8b('0x3c')){var _0x28fd82={};_0x28fd82[_0x579324[_0x0d8b('0x27')]]={'$like':'%'+_0x1b2b59[_0x0d8b('0x2c')][_0x0d8b('0x38')]+'%'};return _0x28fd82;}})});}_0x97050a=_[_0x0d8b('0x3a')]({},_0x97050a,_0x1b2b59['options']);var _0x1d06b6={'where':_0x97050a[_0x0d8b('0x39')]};return db[_0x0d8b('0x3d')][_0x0d8b('0x3e')](_0x1d06b6)['then'](function(_0xe0bf42){_0x2ab00d['count']=_0xe0bf42;if(_0x1b2b59[_0x0d8b('0x2c')][_0x0d8b('0x3f')]){_0x97050a[_0x0d8b('0x40')]=[{'all':!![]}];}return db[_0x0d8b('0x3d')][_0x0d8b('0x41')](_0x97050a);})[_0x0d8b('0x22')](function(_0x1ff17d){_0x2ab00d[_0x0d8b('0x42')]=_0x1ff17d;return _0x2ab00d;})[_0x0d8b('0x22')](respondWithFilteredResult(_0x4b59e5,_0x97050a))[_0x0d8b('0x43')](handleError(_0x4b59e5,null));};exports['show']=function(_0x571acf,_0x576050){var _0x4d0811={'raw':![],'where':{'id':_0x571acf[_0x0d8b('0x44')]['id']}},_0x524d79={};_0x524d79[_0x0d8b('0x2f')]=_[_0x0d8b('0x45')](db['VoiceMusicOnHold']['rawAttributes']);_0x524d79[_0x0d8b('0x2c')]=_[_0x0d8b('0x45')](_0x571acf[_0x0d8b('0x2c')]);_0x524d79['filters']=_[_0x0d8b('0x2e')](_0x524d79[_0x0d8b('0x2f')],_0x524d79['query']);_0x4d0811['attributes']=_[_0x0d8b('0x2e')](_0x524d79['model'],qs[_0x0d8b('0x31')](_0x571acf['query']['fields']));_0x4d0811[_0x0d8b('0x30')]=_0x4d0811[_0x0d8b('0x30')]['length']?_0x4d0811['attributes']:_0x524d79['model'];if(_0x571acf['query'][_0x0d8b('0x3f')]){_0x4d0811[_0x0d8b('0x40')]=[{'all':!![]}];}_0x4d0811=_[_0x0d8b('0x3a')]({},_0x4d0811,_0x571acf['options']);return db[_0x0d8b('0x3d')][_0x0d8b('0x46')](_0x4d0811)[_0x0d8b('0x22')](handleEntityNotFound(_0x576050,null))[_0x0d8b('0x22')](respondWithResult(_0x576050,null))[_0x0d8b('0x43')](handleError(_0x576050,null));};exports[_0x0d8b('0x21')]=function(_0x11d22b,_0x1d5067){if(_0x11d22b[_0x0d8b('0x47')]['id']){delete _0x11d22b[_0x0d8b('0x47')]['id'];}return db[_0x0d8b('0x3d')][_0x0d8b('0x46')]({'where':{'id':_0x11d22b[_0x0d8b('0x44')]['id']}})[_0x0d8b('0x22')](handleEntityNotFound(_0x1d5067,null))[_0x0d8b('0x22')](saveUpdates(_0x11d22b[_0x0d8b('0x47')],null))[_0x0d8b('0x22')](respondWithResult(_0x1d5067,null))[_0x0d8b('0x43')](handleError(_0x1d5067,null));};exports[_0x0d8b('0x48')]=function(_0x574b90,_0x371fa0,_0x4d8850){return db['sequelize'][_0x0d8b('0x49')](function(_0x113fb7){if(_0x574b90[_0x0d8b('0x47')][_0x0d8b('0x4a')]==='files'){_0x574b90[_0x0d8b('0x47')][_0x0d8b('0x4b')]=path[_0x0d8b('0x4c')](config[_0x0d8b('0x4d')],_0x0d8b('0x4e'),_0x574b90['body']['name']);}return db['VoiceMusicOnHold']['create'](_0x574b90[_0x0d8b('0x47')],{'transaction':_0x113fb7})[_0x0d8b('0x22')](function(_0x5e3bb4){if(_0x574b90['body'][_0x0d8b('0x4a')]===_0x0d8b('0x4f')){fs['mkdirSync'](_0x5e3bb4['directory'],parseInt(_0x0d8b('0x50'),0x8));}var _0xeeefd4=_0x574b90[_0x0d8b('0x51')][_0x0d8b('0x23')]({'plain':!![]});if(!_0xeeefd4)throw new Error(_0x0d8b('0x52'));if(_0xeeefd4['role']===_0x0d8b('0x51')){var _0x2afe34=_0x5e3bb4['get']({'plain':!![]});return db['UserProfileSection'][_0x0d8b('0x46')]({'where':{'name':_0x0d8b('0x24'),'userProfileId':_0xeeefd4['userProfileId']},'raw':!![]})['then'](function(_0xb8be3b){if(_0xb8be3b&&_0xb8be3b[_0x0d8b('0x53')]===0x0){return db[_0x0d8b('0x25')][_0x0d8b('0x48')]({'name':_0x2afe34['name'],'resourceId':_0x2afe34['id'],'type':_0xb8be3b[_0x0d8b('0x27')],'sectionId':_0xb8be3b['id']},{})['then'](function(){return _0x5e3bb4;});}else{return _0x5e3bb4;}})['catch'](function(_0x38c24e){logger[_0x0d8b('0x54')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x38c24e);});}return _0x5e3bb4;});})['then'](respondWithResult(_0x371fa0,0xc9))[_0x0d8b('0x43')](handleError(_0x371fa0,null));};exports[_0x0d8b('0x26')]=function(_0xccc2a9,_0x2c1eb0,_0x3afc3a){var _0xb66e76;return db[_0x0d8b('0x3d')][_0x0d8b('0x46')]({'where':{'id':_0xccc2a9['params']['id']}})[_0x0d8b('0x22')](function(_0x37dc9f){if(_0x37dc9f){return db[_0x0d8b('0x55')][_0x0d8b('0x49')](function(_0x3fb9ea){return _0x37dc9f[_0x0d8b('0x26')]({'transaction':_0x3fb9ea,'raw':!![]})[_0x0d8b('0x22')](function(_0x1c78b6){if(_0x1c78b6[_0x0d8b('0x4b')]){fs['readdirSync'](_0x1c78b6[_0x0d8b('0x4b')])[_0x0d8b('0x56')](function(_0x180b7b){fs[_0x0d8b('0x57')](path[_0x0d8b('0x4c')](_0x1c78b6['directory'],_0x180b7b));});fs[_0x0d8b('0x58')](_0x1c78b6[_0x0d8b('0x4b')]);}return _0x1c78b6;});})[_0x0d8b('0x43')](function(_0x17a87f){throw new db[(_0x0d8b('0x59'))]['ValidationError'](_0x17a87f['message']);});}})[_0x0d8b('0x22')](handleEntityNotFound(_0x2c1eb0,null))[_0x0d8b('0x22')](removeEntity(_0x2c1eb0,null))[_0x0d8b('0x43')](handleError(_0x2c1eb0,null));};exports[_0x0d8b('0x5a')]=function(_0x5a70bd,_0x199122,_0x12aef7){return db[_0x0d8b('0x55')]['transaction'](function(_0x2f19f4){var _0x532a85;return db[_0x0d8b('0x3d')][_0x0d8b('0x46')]({'where':{'id':_0x5a70bd[_0x0d8b('0x44')]['id']}})[_0x0d8b('0x22')](function(_0x2b6eb6){if(_0x2b6eb6){_0x532a85=_0x2b6eb6;return _0x2b6eb6[_0x0d8b('0x5a')](_0x5a70bd['body']['id'],{'transaction':_0x2f19f4});}})[_0x0d8b('0x22')](function(_0x4c074d){if(_0x4c074d){return db[_0x0d8b('0x5b')][_0x0d8b('0x5c')]({'where':{'id':_0x5a70bd[_0x0d8b('0x47')]['id']},'attributes':['id',_0x0d8b('0x27'),'save_name',_0x0d8b('0x5d'),_0x0d8b('0x5e')],'raw':!![]});}})[_0x0d8b('0x22')](function(_0x2332fc){if(_0x2332fc){var _0x2ccdae=path[_0x0d8b('0x4c')](config[_0x0d8b('0x4d')],_0x0d8b('0x5f'),util[_0x0d8b('0x60')](_0x0d8b('0x61'),path['basename'](_0x2332fc['save_name'],path[_0x0d8b('0x62')](_0x2332fc[_0x0d8b('0x63')])),_0x2332fc['converted_format']));var _0xb1aa96=path['join'](config['root'],_0x0d8b('0x4e'),_0x532a85[_0x0d8b('0x27')],util['format']('%s.%s',_0x2332fc[_0x0d8b('0x27')],_0x2332fc[_0x0d8b('0x5d')]));fs[_0x0d8b('0x64')](_0x2ccdae,_0xb1aa96);return _0x2332fc;}})[_0x0d8b('0x43')](function(_0x2ab72b){throw new db[(_0x0d8b('0x59'))][(_0x0d8b('0x65'))](_0x2ab72b['message']);});})[_0x0d8b('0x22')](handleEntityNotFound(_0x199122,null))['then'](respondWithResult(_0x199122,0xc9))[_0x0d8b('0x43')](handleError(_0x199122,null));};exports[_0x0d8b('0x66')]=function(_0x2bb690,_0x14a34b,_0x49f610){return db[_0x0d8b('0x55')]['transaction'](function(_0x3a356b){var _0x2c6c5f;return db[_0x0d8b('0x3d')][_0x0d8b('0x5c')]({'where':{'id':_0x2bb690[_0x0d8b('0x44')]['id']}})[_0x0d8b('0x22')](handleEntityNotFound(_0x14a34b,null))[_0x0d8b('0x22')](function(_0x91aa89){if(_0x91aa89){_0x2c6c5f=_0x91aa89;return _0x91aa89[_0x0d8b('0x66')](_0x2bb690[_0x0d8b('0x44')]['id2']);}})[_0x0d8b('0x22')](function(_0x54c28b){if(_0x54c28b){return db[_0x0d8b('0x5b')][_0x0d8b('0x5c')]({'where':{'id':_0x2bb690['params'][_0x0d8b('0x67')]},'attributes':['id','name',_0x0d8b('0x63'),_0x0d8b('0x5d'),_0x0d8b('0x5e')],'raw':!![]});}})[_0x0d8b('0x22')](function(_0x2242cd){if(_0x2242cd){fs[_0x0d8b('0x57')](path[_0x0d8b('0x4c')](_0x2c6c5f[_0x0d8b('0x4b')],util['format'](_0x0d8b('0x61'),_0x2242cd[_0x0d8b('0x27')],_0x2242cd['converted_format'])));return _0x2242cd;}})[_0x0d8b('0x43')](function(_0x105df9){throw new db[(_0x0d8b('0x59'))][(_0x0d8b('0x65'))](_0x105df9[_0x0d8b('0x68')]);});})[_0x0d8b('0x22')](handleEntityNotFound(_0x14a34b,null))[_0x0d8b('0x22')](respondWithStatusCode(_0x14a34b,0xcc))[_0x0d8b('0x43')](handleError(_0x14a34b,null));};exports[_0x0d8b('0x69')]=function(_0x5007c0,_0xe35028,_0x16df83){var _0x50c0ff={};var _0x1ece98={};var _0x93fc55;var _0x3acffa;return db['VoiceMusicOnHold']['findOne']({'where':{'id':_0x5007c0[_0x0d8b('0x44')]['id']}})[_0x0d8b('0x22')](handleEntityNotFound(_0xe35028,null))[_0x0d8b('0x22')](function(_0x5b76af){if(_0x5b76af){_0x93fc55=_0x5b76af;_0x1ece98['model']=_[_0x0d8b('0x45')](db[_0x0d8b('0x5b')][_0x0d8b('0x2a')]);_0x1ece98[_0x0d8b('0x2c')]=_[_0x0d8b('0x45')](_0x5007c0[_0x0d8b('0x2c')]);_0x1ece98[_0x0d8b('0x2d')]=_[_0x0d8b('0x2e')](_0x1ece98[_0x0d8b('0x2f')],_0x1ece98[_0x0d8b('0x2c')]);_0x50c0ff[_0x0d8b('0x30')]=_[_0x0d8b('0x2e')](_0x1ece98[_0x0d8b('0x2f')],qs['fields'](_0x5007c0[_0x0d8b('0x2c')][_0x0d8b('0x31')]));_0x50c0ff['attributes']=_0x50c0ff['attributes'][_0x0d8b('0x32')]?_0x50c0ff[_0x0d8b('0x30')]:_0x1ece98[_0x0d8b('0x2f')];_0x50c0ff[_0x0d8b('0x35')]=qs[_0x0d8b('0x36')](_0x5007c0[_0x0d8b('0x2c')]['sort']);_0x50c0ff['where']=qs['filters'](_[_0x0d8b('0x37')](_0x5007c0[_0x0d8b('0x2c')],_0x1ece98[_0x0d8b('0x2d')]));if(_0x5007c0[_0x0d8b('0x2c')][_0x0d8b('0x38')]){_0x50c0ff[_0x0d8b('0x39')]=_['merge'](_0x50c0ff[_0x0d8b('0x39')],{'$or':_[_0x0d8b('0x29')](_0x50c0ff['attributes'],function(_0x30a69d){var _0x57e3c2={};_0x57e3c2[_0x30a69d]={'$like':'%'+_0x5007c0[_0x0d8b('0x2c')][_0x0d8b('0x38')]+'%'};return _0x57e3c2;})});}_0x50c0ff=_[_0x0d8b('0x3a')]({},_0x50c0ff,_0x5007c0[_0x0d8b('0x6a')]);return _0x93fc55[_0x0d8b('0x69')](_0x50c0ff);}})[_0x0d8b('0x22')](function(_0x424f9d){if(_0x424f9d){_0x3acffa=_0x424f9d[_0x0d8b('0x32')];if(!_0x5007c0[_0x0d8b('0x2c')][_0x0d8b('0x33')](_0x0d8b('0x34'))){_0x50c0ff[_0x0d8b('0x1b')]=qs['limit'](_0x5007c0['query'][_0x0d8b('0x1b')]);_0x50c0ff[_0x0d8b('0x1a')]=qs[_0x0d8b('0x1a')](_0x5007c0[_0x0d8b('0x2c')][_0x0d8b('0x1a')]);}return _0x93fc55[_0x0d8b('0x69')](_0x50c0ff);}})[_0x0d8b('0x22')](function(_0x54674f){if(_0x54674f){return _0x54674f?{'count':_0x3acffa,'rows':_0x54674f}:null;}})[_0x0d8b('0x22')](respondWithResult(_0xe35028,null))['catch'](handleError(_0xe35028,null));};
\ No newline at end of file
+var _0xb10b=['stack','name','send','VoiceMusicOnHold','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','merge','map','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','params','find','update','body','create','sequelize','transaction','mode','files','directory','join','root','server/files/moh','0777','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','readdirSync','forEach','unlinkSync','rmdirSync','ValidationError','message','findOne','converted_format','createdAt','server/files/sounds/converted','format','basename','save_name','extname','%s.%s','Sequelize','removeSound','Sound','getSounds','rawAttributes','pick','nolimit','html-pdf','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','ejs','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/environment','sendStatus','status','end','json','count','offset','limit','set','Content-Range','reject','save','then','destroy','get','MusicOnHolds','UserProfileResource','error'];(function(_0x50d890,_0x24c9b9){var _0x3407cf=function(_0x2ed4f2){while(--_0x2ed4f2){_0x50d890['push'](_0x50d890['shift']());}};_0x3407cf(++_0x24c9b9);}(_0xb10b,0x12a));var _0xbb10=function(_0x1cdbc5,_0x219ca6){_0x1cdbc5=_0x1cdbc5-0x0;var _0x213288=_0xb10b[_0x1cdbc5];return _0x213288;};'use strict';var pdf=require(_0xbb10('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xbb10('0x1'));var zipdir=require(_0xbb10('0x2'));var jsonpatch=require(_0xbb10('0x3'));var rp=require('request-promise');var moment=require(_0xbb10('0x4'));var BPromise=require(_0xbb10('0x5'));var Mustache=require(_0xbb10('0x6'));var util=require(_0xbb10('0x7'));var path=require(_0xbb10('0x8'));var sox=require(_0xbb10('0x9'));var csv=require('to-csv');var ejs=require(_0xbb10('0xa'));var fs=require('fs');var _=require(_0xbb10('0xb'));var squel=require('squel');var crypto=require(_0xbb10('0xc'));var jsforce=require(_0xbb10('0xd'));var deskjs=require(_0xbb10('0xe'));var toCsv=require(_0xbb10('0xf'));var querystring=require(_0xbb10('0x10'));var Papa=require(_0xbb10('0x11'));var Redis=require(_0xbb10('0x12'));var authService=require(_0xbb10('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xbb10('0x14'));var logger=require(_0xbb10('0x15'))(_0xbb10('0x16'));var utils=require('../../config/utils');var config=require(_0xbb10('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x44fb19,_0x916a32){_0x916a32=_0x916a32||0xcc;return function(_0x285009){if(_0x285009){return _0x44fb19[_0xbb10('0x18')](_0x916a32);}return _0x44fb19[_0xbb10('0x19')](_0x916a32)[_0xbb10('0x1a')]();};}function respondWithResult(_0x58a612,_0x26e021){_0x26e021=_0x26e021||0xc8;return function(_0x42d7e4){if(_0x42d7e4){return _0x58a612[_0xbb10('0x19')](_0x26e021)[_0xbb10('0x1b')](_0x42d7e4);}};}function respondWithFilteredResult(_0x3df17b,_0x2f2ebf){return function(_0x24a57b){if(_0x24a57b){var _0x36b5e8=_0x24a57b[_0xbb10('0x1c')],_0x3e26f4=_0x2f2ebf[_0xbb10('0x1d')],_0x2b184e=_0x2f2ebf[_0xbb10('0x1d')]+_0x2f2ebf[_0xbb10('0x1e')],_0x4a2bfc;if(_0x2b184e>=_0x36b5e8){_0x2b184e=_0x36b5e8;_0x4a2bfc=0xc8;}else{_0x4a2bfc=0xce;}_0x3df17b[_0xbb10('0x19')](_0x4a2bfc);return _0x3df17b[_0xbb10('0x1f')](_0xbb10('0x20'),_0x3e26f4+'-'+_0x2b184e+'/'+_0x36b5e8)[_0xbb10('0x1b')](_0x24a57b);}return null;};}function patchUpdates(_0xbf2906){return function(_0xe1c665){try{jsonpatch['apply'](_0xe1c665,_0xbf2906,!![]);}catch(_0x5ff0cf){return BPromise[_0xbb10('0x21')](_0x5ff0cf);}return _0xe1c665[_0xbb10('0x22')]();};}function saveUpdates(_0x109908,_0xdf237d){return function(_0x44e563){if(_0x44e563){return _0x44e563['update'](_0x109908)[_0xbb10('0x23')](function(_0x12ef77){return _0x12ef77;});}return null;};}function removeEntity(_0x50aea1,_0x4c4b0d){return function(_0x8e2b97){if(_0x8e2b97){return _0x8e2b97[_0xbb10('0x24')]()[_0xbb10('0x23')](function(){var _0x317da4=_0x8e2b97[_0xbb10('0x25')]({'plain':!![]});var _0x1824b7=_0xbb10('0x26');return db[_0xbb10('0x27')][_0xbb10('0x24')]({'where':{'type':_0x1824b7,'resourceId':_0x317da4['id']}})[_0xbb10('0x23')](function(){return _0x8e2b97;});})[_0xbb10('0x23')](function(){_0x50aea1[_0xbb10('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4fedac,_0x4fb5e0){return function(_0xc93a04){if(!_0xc93a04){_0x4fedac[_0xbb10('0x18')](0x194);}return _0xc93a04;};}function handleError(_0x2c89b9,_0x4e25ff){_0x4e25ff=_0x4e25ff||0x1f4;return function(_0x2fdde9){logger[_0xbb10('0x28')](_0x2fdde9[_0xbb10('0x29')]);if(_0x2fdde9[_0xbb10('0x2a')]){delete _0x2fdde9[_0xbb10('0x2a')];}_0x2c89b9[_0xbb10('0x19')](_0x4e25ff)[_0xbb10('0x2b')](_0x2fdde9);};}exports['index']=function(_0x3796c7,_0x21ac54){var _0xfc3595={},_0x2e0249={},_0x1d30aa={'count':0x0,'rows':[]};var _0x2ff4c1=_['map'](db[_0xbb10('0x2c')]['rawAttributes'],function(_0x448d5c){return{'name':_0x448d5c['fieldName'],'type':_0x448d5c[_0xbb10('0x2d')][_0xbb10('0x2e')]};});_0x2e0249[_0xbb10('0x2f')]=_['map'](_0x2ff4c1,'name');_0x2e0249[_0xbb10('0x30')]=_[_0xbb10('0x31')](_0x3796c7['query']);_0x2e0249[_0xbb10('0x32')]=_[_0xbb10('0x33')](_0x2e0249[_0xbb10('0x2f')],_0x2e0249[_0xbb10('0x30')]);_0xfc3595[_0xbb10('0x34')]=_[_0xbb10('0x33')](_0x2e0249[_0xbb10('0x2f')],qs['fields'](_0x3796c7[_0xbb10('0x30')][_0xbb10('0x35')]));_0xfc3595[_0xbb10('0x34')]=_0xfc3595[_0xbb10('0x34')][_0xbb10('0x36')]?_0xfc3595[_0xbb10('0x34')]:_0x2e0249[_0xbb10('0x2f')];if(!_0x3796c7[_0xbb10('0x30')][_0xbb10('0x37')]('nolimit')){_0xfc3595[_0xbb10('0x1e')]=qs[_0xbb10('0x1e')](_0x3796c7[_0xbb10('0x30')][_0xbb10('0x1e')]);_0xfc3595['offset']=qs[_0xbb10('0x1d')](_0x3796c7['query']['offset']);}_0xfc3595[_0xbb10('0x38')]=qs[_0xbb10('0x39')](_0x3796c7[_0xbb10('0x30')][_0xbb10('0x39')]);_0xfc3595[_0xbb10('0x3a')]=qs[_0xbb10('0x32')](_['pick'](_0x3796c7[_0xbb10('0x30')],_0x2e0249[_0xbb10('0x32')]),_0x2ff4c1);if(_0x3796c7['query']['filter']){_0xfc3595['where']=_[_0xbb10('0x3b')](_0xfc3595[_0xbb10('0x3a')],{'$or':_[_0xbb10('0x3c')](_0x2ff4c1,function(_0x4d5a9b){if(_0x4d5a9b[_0xbb10('0x2d')]!==_0xbb10('0x3d')){var _0x4345f3={};_0x4345f3[_0x4d5a9b['name']]={'$like':'%'+_0x3796c7[_0xbb10('0x30')][_0xbb10('0x3e')]+'%'};return _0x4345f3;}})});}_0xfc3595=_[_0xbb10('0x3b')]({},_0xfc3595,_0x3796c7[_0xbb10('0x3f')]);var _0x4f1cdd={'where':_0xfc3595[_0xbb10('0x3a')]};return db[_0xbb10('0x2c')]['count'](_0x4f1cdd)[_0xbb10('0x23')](function(_0x2e3214){_0x1d30aa[_0xbb10('0x1c')]=_0x2e3214;if(_0x3796c7[_0xbb10('0x30')][_0xbb10('0x40')]){_0xfc3595[_0xbb10('0x41')]=[{'all':!![]}];}return db['VoiceMusicOnHold'][_0xbb10('0x42')](_0xfc3595);})[_0xbb10('0x23')](function(_0x3e7b4c){_0x1d30aa[_0xbb10('0x43')]=_0x3e7b4c;return _0x1d30aa;})['then'](respondWithFilteredResult(_0x21ac54,_0xfc3595))[_0xbb10('0x44')](handleError(_0x21ac54,null));};exports[_0xbb10('0x45')]=function(_0x23dc18,_0x403beb){var _0x5e2cfa={'raw':![],'where':{'id':_0x23dc18[_0xbb10('0x46')]['id']}},_0x351484={};_0x351484['model']=_['keys'](db[_0xbb10('0x2c')]['rawAttributes']);_0x351484[_0xbb10('0x30')]=_[_0xbb10('0x31')](_0x23dc18['query']);_0x351484[_0xbb10('0x32')]=_[_0xbb10('0x33')](_0x351484[_0xbb10('0x2f')],_0x351484['query']);_0x5e2cfa[_0xbb10('0x34')]=_[_0xbb10('0x33')](_0x351484[_0xbb10('0x2f')],qs[_0xbb10('0x35')](_0x23dc18[_0xbb10('0x30')][_0xbb10('0x35')]));_0x5e2cfa[_0xbb10('0x34')]=_0x5e2cfa[_0xbb10('0x34')][_0xbb10('0x36')]?_0x5e2cfa[_0xbb10('0x34')]:_0x351484[_0xbb10('0x2f')];if(_0x23dc18[_0xbb10('0x30')]['includeAll']){_0x5e2cfa[_0xbb10('0x41')]=[{'all':!![]}];}_0x5e2cfa=_[_0xbb10('0x3b')]({},_0x5e2cfa,_0x23dc18['options']);return db[_0xbb10('0x2c')][_0xbb10('0x47')](_0x5e2cfa)[_0xbb10('0x23')](handleEntityNotFound(_0x403beb,null))[_0xbb10('0x23')](respondWithResult(_0x403beb,null))[_0xbb10('0x44')](handleError(_0x403beb,null));};exports[_0xbb10('0x48')]=function(_0x3e06b0,_0x5be85e){if(_0x3e06b0['body']['id']){delete _0x3e06b0[_0xbb10('0x49')]['id'];}return db[_0xbb10('0x2c')][_0xbb10('0x47')]({'where':{'id':_0x3e06b0['params']['id']}})['then'](handleEntityNotFound(_0x5be85e,null))[_0xbb10('0x23')](saveUpdates(_0x3e06b0[_0xbb10('0x49')],null))[_0xbb10('0x23')](respondWithResult(_0x5be85e,null))[_0xbb10('0x44')](handleError(_0x5be85e,null));};exports[_0xbb10('0x4a')]=function(_0x22b315,_0x2f2552,_0x460788){return db[_0xbb10('0x4b')][_0xbb10('0x4c')](function(_0x550111){if(_0x22b315['body'][_0xbb10('0x4d')]===_0xbb10('0x4e')){_0x22b315[_0xbb10('0x49')][_0xbb10('0x4f')]=path[_0xbb10('0x50')](config[_0xbb10('0x51')],_0xbb10('0x52'),_0x22b315[_0xbb10('0x49')][_0xbb10('0x2a')]);}return db[_0xbb10('0x2c')][_0xbb10('0x4a')](_0x22b315[_0xbb10('0x49')],{'transaction':_0x550111})[_0xbb10('0x23')](function(_0x2e6fd9){if(_0x22b315[_0xbb10('0x49')]['mode']===_0xbb10('0x4e')){fs['mkdirSync'](_0x2e6fd9[_0xbb10('0x4f')],parseInt(_0xbb10('0x53'),0x8));}var _0x1ffe20=_0x22b315[_0xbb10('0x54')][_0xbb10('0x25')]({'plain':!![]});if(!_0x1ffe20)throw new Error(_0xbb10('0x55'));if(_0x1ffe20[_0xbb10('0x56')]===_0xbb10('0x54')){var _0x180400=_0x2e6fd9[_0xbb10('0x25')]({'plain':!![]});return db[_0xbb10('0x57')][_0xbb10('0x47')]({'where':{'name':_0xbb10('0x26'),'userProfileId':_0x1ffe20[_0xbb10('0x58')]},'raw':!![]})[_0xbb10('0x23')](function(_0x5de0cc){if(_0x5de0cc&&_0x5de0cc[_0xbb10('0x59')]===0x0){return db[_0xbb10('0x27')][_0xbb10('0x4a')]({'name':_0x180400[_0xbb10('0x2a')],'resourceId':_0x180400['id'],'type':_0x5de0cc[_0xbb10('0x2a')],'sectionId':_0x5de0cc['id']},{})[_0xbb10('0x23')](function(){return _0x2e6fd9;});}else{return _0x2e6fd9;}})['catch'](function(_0x120bda){logger[_0xbb10('0x28')](_0xbb10('0x5a'),_0x120bda);});}return _0x2e6fd9;});})[_0xbb10('0x23')](respondWithResult(_0x2f2552,0xc9))[_0xbb10('0x44')](handleError(_0x2f2552,null));};exports[_0xbb10('0x24')]=function(_0x175872,_0x12ec18,_0x205e01){var _0x40c4fb;return db[_0xbb10('0x2c')][_0xbb10('0x47')]({'where':{'id':_0x175872[_0xbb10('0x46')]['id']}})['then'](function(_0x4ea1a6){if(_0x4ea1a6){return db[_0xbb10('0x4b')][_0xbb10('0x4c')](function(_0x3d0cb7){return _0x4ea1a6[_0xbb10('0x24')]({'transaction':_0x3d0cb7,'raw':!![]})['then'](function(_0x506498){if(_0x506498[_0xbb10('0x4f')]){fs[_0xbb10('0x5b')](_0x506498[_0xbb10('0x4f')])[_0xbb10('0x5c')](function(_0x412f13){fs[_0xbb10('0x5d')](path[_0xbb10('0x50')](_0x506498['directory'],_0x412f13));});fs[_0xbb10('0x5e')](_0x506498[_0xbb10('0x4f')]);}return _0x506498;});})['catch'](function(_0x5e03cb){throw new db['Sequelize'][(_0xbb10('0x5f'))](_0x5e03cb[_0xbb10('0x60')]);});}})[_0xbb10('0x23')](handleEntityNotFound(_0x12ec18,null))['then'](removeEntity(_0x12ec18,null))['catch'](handleError(_0x12ec18,null));};exports['addSound']=function(_0x3ebc5f,_0x249b33,_0x45167a){return db['sequelize'][_0xbb10('0x4c')](function(_0x13131c){var _0x5a6538;return db['VoiceMusicOnHold'][_0xbb10('0x47')]({'where':{'id':_0x3ebc5f[_0xbb10('0x46')]['id']}})[_0xbb10('0x23')](function(_0x237246){if(_0x237246){_0x5a6538=_0x237246;return _0x237246['addSound'](_0x3ebc5f[_0xbb10('0x49')]['id'],{'transaction':_0x13131c});}})[_0xbb10('0x23')](function(_0xa7179d){if(_0xa7179d){return db['Sound'][_0xbb10('0x61')]({'where':{'id':_0x3ebc5f[_0xbb10('0x49')]['id']},'attributes':['id',_0xbb10('0x2a'),'save_name',_0xbb10('0x62'),_0xbb10('0x63')],'raw':!![]});}})[_0xbb10('0x23')](function(_0x37b65f){if(_0x37b65f){var _0x5e4a6e=path[_0xbb10('0x50')](config[_0xbb10('0x51')],_0xbb10('0x64'),util[_0xbb10('0x65')]('%s.%s',path[_0xbb10('0x66')](_0x37b65f[_0xbb10('0x67')],path[_0xbb10('0x68')](_0x37b65f[_0xbb10('0x67')])),_0x37b65f[_0xbb10('0x62')]));var _0x17807e=path[_0xbb10('0x50')](config['root'],'server/files/moh',_0x5a6538['name'],util[_0xbb10('0x65')](_0xbb10('0x69'),_0x37b65f[_0xbb10('0x2a')],_0x37b65f['converted_format']));fs['symlinkSync'](_0x5e4a6e,_0x17807e);return _0x37b65f;}})[_0xbb10('0x44')](function(_0x1b11c0){throw new db[(_0xbb10('0x6a'))][(_0xbb10('0x5f'))](_0x1b11c0[_0xbb10('0x60')]);});})[_0xbb10('0x23')](handleEntityNotFound(_0x249b33,null))['then'](respondWithResult(_0x249b33,0xc9))[_0xbb10('0x44')](handleError(_0x249b33,null));};exports[_0xbb10('0x6b')]=function(_0x270fdb,_0x14f16b,_0x2aaaa6){return db['sequelize']['transaction'](function(_0x5ad6ad){var _0x329da7;return db[_0xbb10('0x2c')][_0xbb10('0x61')]({'where':{'id':_0x270fdb[_0xbb10('0x46')]['id']}})[_0xbb10('0x23')](handleEntityNotFound(_0x14f16b,null))[_0xbb10('0x23')](function(_0x5d942d){if(_0x5d942d){_0x329da7=_0x5d942d;return _0x5d942d[_0xbb10('0x6b')](_0x270fdb['params']['id2']);}})['then'](function(_0xdf634f){if(_0xdf634f){return db[_0xbb10('0x6c')][_0xbb10('0x61')]({'where':{'id':_0x270fdb[_0xbb10('0x46')]['id2']},'attributes':['id',_0xbb10('0x2a'),'save_name','converted_format',_0xbb10('0x63')],'raw':!![]});}})[_0xbb10('0x23')](function(_0x29529c){if(_0x29529c){fs[_0xbb10('0x5d')](path[_0xbb10('0x50')](_0x329da7['directory'],util[_0xbb10('0x65')](_0xbb10('0x69'),_0x29529c[_0xbb10('0x2a')],_0x29529c[_0xbb10('0x62')])));return _0x29529c;}})[_0xbb10('0x44')](function(_0x27f42f){throw new db[(_0xbb10('0x6a'))]['ValidationError'](_0x27f42f[_0xbb10('0x60')]);});})[_0xbb10('0x23')](handleEntityNotFound(_0x14f16b,null))[_0xbb10('0x23')](respondWithStatusCode(_0x14f16b,0xcc))[_0xbb10('0x44')](handleError(_0x14f16b,null));};exports[_0xbb10('0x6d')]=function(_0x172be3,_0xa3b23,_0x312a08){var _0x5a4429={};var _0x428146={};var _0x218690;var _0x145baf;return db['VoiceMusicOnHold']['findOne']({'where':{'id':_0x172be3['params']['id']}})[_0xbb10('0x23')](handleEntityNotFound(_0xa3b23,null))['then'](function(_0x4e3d6a){if(_0x4e3d6a){_0x218690=_0x4e3d6a;_0x428146[_0xbb10('0x2f')]=_[_0xbb10('0x31')](db[_0xbb10('0x6c')][_0xbb10('0x6e')]);_0x428146[_0xbb10('0x30')]=_[_0xbb10('0x31')](_0x172be3[_0xbb10('0x30')]);_0x428146[_0xbb10('0x32')]=_[_0xbb10('0x33')](_0x428146['model'],_0x428146[_0xbb10('0x30')]);_0x5a4429[_0xbb10('0x34')]=_[_0xbb10('0x33')](_0x428146[_0xbb10('0x2f')],qs['fields'](_0x172be3['query'][_0xbb10('0x35')]));_0x5a4429[_0xbb10('0x34')]=_0x5a4429[_0xbb10('0x34')][_0xbb10('0x36')]?_0x5a4429['attributes']:_0x428146[_0xbb10('0x2f')];_0x5a4429[_0xbb10('0x38')]=qs[_0xbb10('0x39')](_0x172be3[_0xbb10('0x30')][_0xbb10('0x39')]);_0x5a4429['where']=qs['filters'](_[_0xbb10('0x6f')](_0x172be3[_0xbb10('0x30')],_0x428146[_0xbb10('0x32')]));if(_0x172be3['query'][_0xbb10('0x3e')]){_0x5a4429[_0xbb10('0x3a')]=_['merge'](_0x5a4429['where'],{'$or':_[_0xbb10('0x3c')](_0x5a4429[_0xbb10('0x34')],function(_0x177f77){var _0x4d64ff={};_0x4d64ff[_0x177f77]={'$like':'%'+_0x172be3[_0xbb10('0x30')][_0xbb10('0x3e')]+'%'};return _0x4d64ff;})});}_0x5a4429=_[_0xbb10('0x3b')]({},_0x5a4429,_0x172be3[_0xbb10('0x3f')]);return _0x218690[_0xbb10('0x6d')](_0x5a4429);}})[_0xbb10('0x23')](function(_0x45bd4e){if(_0x45bd4e){_0x145baf=_0x45bd4e[_0xbb10('0x36')];if(!_0x172be3[_0xbb10('0x30')]['hasOwnProperty'](_0xbb10('0x70'))){_0x5a4429[_0xbb10('0x1e')]=qs[_0xbb10('0x1e')](_0x172be3[_0xbb10('0x30')][_0xbb10('0x1e')]);_0x5a4429[_0xbb10('0x1d')]=qs[_0xbb10('0x1d')](_0x172be3[_0xbb10('0x30')][_0xbb10('0x1d')]);}return _0x218690[_0xbb10('0x6d')](_0x5a4429);}})[_0xbb10('0x23')](function(_0x2a4278){if(_0x2a4278){return _0x2a4278?{'count':_0x145baf,'rows':_0x2a4278}:null;}})['then'](respondWithResult(_0xa3b23,null))['catch'](handleError(_0xa3b23,null));};
\ No newline at end of file
diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js
index 8354f1e..7070178 100644
--- a/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js
+++ b/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x6145=['bluebird','request-promise','path','../../config/environment','./voiceMusicOnHold.attributes','exports','define','VoiceMusicOnHold','voice_musiconhold','lodash','moment'];(function(_0x353847,_0x5c84de){var _0x40d8a6=function(_0x221958){while(--_0x221958){_0x353847['push'](_0x353847['shift']());}};_0x40d8a6(++_0x5c84de);}(_0x6145,0x77));var _0x5614=function(_0x258a7c,_0x55f3c8){_0x258a7c=_0x258a7c-0x0;var _0x573070=_0x6145[_0x258a7c];return _0x573070;};'use strict';var _=require(_0x5614('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x5614('0x1'));var BPromise=require(_0x5614('0x2'));var rp=require(_0x5614('0x3'));var fs=require('fs');var path=require(_0x5614('0x4'));var rimraf=require('rimraf');var config=require(_0x5614('0x5'));var attributes=require(_0x5614('0x6'));module[_0x5614('0x7')]=function(_0x3706df,_0x30dd60){return _0x3706df[_0x5614('0x8')](_0x5614('0x9'),attributes,{'tableName':_0x5614('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x9727=['path','./voiceMusicOnHold.attributes','define','VoiceMusicOnHold','voice_musiconhold','lodash','util','api','moment','bluebird','request-promise'];(function(_0x2bd0a8,_0x2f9fdc){var _0x130317=function(_0x2f3982){while(--_0x2f3982){_0x2bd0a8['push'](_0x2bd0a8['shift']());}};_0x130317(++_0x2f9fdc);}(_0x9727,0x94));var _0x7972=function(_0x2d9c6a,_0x59393d){_0x2d9c6a=_0x2d9c6a-0x0;var _0xf3c918=_0x9727[_0x2d9c6a];return _0xf3c918;};'use strict';var _=require(_0x7972('0x0'));var util=require(_0x7972('0x1'));var logger=require('../../config/logger')(_0x7972('0x2'));var moment=require(_0x7972('0x3'));var BPromise=require(_0x7972('0x4'));var rp=require(_0x7972('0x5'));var fs=require('fs');var path=require(_0x7972('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x7972('0x7'));module['exports']=function(_0x264c47,_0x54b353){return _0x264c47[_0x7972('0x8')](_0x7972('0x9'),attributes,{'tableName':_0x7972('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.rpc.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.rpc.js
index 57e9dac..86da62c 100644
--- a/server/api/voiceMusicOnHold/voiceMusicOnHold.rpc.js
+++ b/server/api/voiceMusicOnHold/voiceMusicOnHold.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x3fc8=['stringify','error','message','catch','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','VoiceMusicOnHold,\x20%s,\x20%s','request\x20sent','debug','VoiceMusicOnHold,\x20%s,\x20%s,\x20%s'];(function(_0x1ab785,_0xabbd47){var _0x2403ad=function(_0x204099){while(--_0x204099){_0x1ab785['push'](_0x1ab785['shift']());}};_0x2403ad(++_0xabbd47);}(_0x3fc8,0x10c));var _0x83fc=function(_0x2b10c6,_0x185590){_0x2b10c6=_0x2b10c6-0x0;var _0x3789d2=_0x3fc8[_0x2b10c6];return _0x3789d2;};'use strict';var _=require(_0x83fc('0x0'));var util=require('util');var moment=require(_0x83fc('0x1'));var BPromise=require(_0x83fc('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x83fc('0x3'));var db=require(_0x83fc('0x4'))['db'];var utils=require(_0x83fc('0x5'));var logger=require('../../config/logger')(_0x83fc('0x6'));var config=require(_0x83fc('0x7'));var jayson=require(_0x83fc('0x8'));var client=jayson[_0x83fc('0x9')][_0x83fc('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x8eb4fc,_0x251f11,_0x42da4e){return new BPromise(function(_0x400ce0,_0x175e62){return client[_0x83fc('0xb')](_0x8eb4fc,_0x42da4e)[_0x83fc('0xc')](function(_0x51c699){logger[_0x83fc('0xd')](_0x83fc('0xe'),_0x251f11,_0x83fc('0xf'));logger[_0x83fc('0x10')](_0x83fc('0x11'),_0x251f11,_0x83fc('0xf'),JSON[_0x83fc('0x12')](_0x51c699));if(_0x51c699[_0x83fc('0x13')]){if(_0x51c699['error']['code']===0x1f4){logger[_0x83fc('0x13')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x251f11,_0x51c699[_0x83fc('0x13')][_0x83fc('0x14')]);return _0x175e62(_0x51c699['error'][_0x83fc('0x14')]);}logger[_0x83fc('0x13')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x251f11,_0x51c699['error']['message']);return _0x400ce0(_0x51c699['error'][_0x83fc('0x14')]);}else{logger[_0x83fc('0xd')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x251f11,_0x83fc('0xf'));_0x400ce0(_0x51c699['result'][_0x83fc('0x14')]);}})[_0x83fc('0x15')](function(_0x4c1c27){logger[_0x83fc('0x13')](_0x83fc('0xe'),_0x251f11,_0x4c1c27);_0x175e62(_0x4c1c27);});});}
\ No newline at end of file
+var _0x483e=['message','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','VoiceMusicOnHold,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code'];(function(_0xc6146f,_0x2437f3){var _0x31d1a2=function(_0x44f03e){while(--_0x44f03e){_0xc6146f['push'](_0xc6146f['shift']());}};_0x31d1a2(++_0x2437f3);}(_0x483e,0xa9));var _0xe483=function(_0x1b2ff7,_0x12a034){_0x1b2ff7=_0x1b2ff7-0x0;var _0x31656a=_0x483e[_0x1b2ff7];return _0x31656a;};'use strict';var _=require('lodash');var util=require(_0xe483('0x0'));var moment=require(_0xe483('0x1'));var BPromise=require(_0xe483('0x2'));var rs=require(_0xe483('0x3'));var fs=require('fs');var Redis=require(_0xe483('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xe483('0x5'));var logger=require(_0xe483('0x6'))('rpc');var config=require(_0xe483('0x7'));var jayson=require(_0xe483('0x8'));var client=jayson[_0xe483('0x9')][_0xe483('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x29b863,_0x2a32ed,_0x263100){return new BPromise(function(_0x4d8fea,_0x286a29){return client[_0xe483('0xb')](_0x29b863,_0x263100)[_0xe483('0xc')](function(_0x3ceacf){logger[_0xe483('0xd')](_0xe483('0xe'),_0x2a32ed,'request\x20sent');logger[_0xe483('0xf')]('VoiceMusicOnHold,\x20%s,\x20%s,\x20%s',_0x2a32ed,_0xe483('0x10'),JSON[_0xe483('0x11')](_0x3ceacf));if(_0x3ceacf[_0xe483('0x12')]){if(_0x3ceacf[_0xe483('0x12')][_0xe483('0x13')]===0x1f4){logger['error']('VoiceMusicOnHold,\x20%s,\x20%s',_0x2a32ed,_0x3ceacf[_0xe483('0x12')][_0xe483('0x14')]);return _0x286a29(_0x3ceacf[_0xe483('0x12')][_0xe483('0x14')]);}logger[_0xe483('0x12')](_0xe483('0xe'),_0x2a32ed,_0x3ceacf['error'][_0xe483('0x14')]);return _0x4d8fea(_0x3ceacf[_0xe483('0x12')]['message']);}else{logger[_0xe483('0xd')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x2a32ed,'request\x20sent');_0x4d8fea(_0x3ceacf['result'][_0xe483('0x14')]);}})['catch'](function(_0xe44382){logger[_0xe483('0x12')](_0xe483('0xe'),_0x2a32ed,_0xe44382);_0x286a29(_0xe44382);});});}
\ No newline at end of file
diff --git a/server/api/voicePrefix/index.js b/server/api/voicePrefix/index.js
index d819a05..37bc62c 100644
--- a/server/api/voicePrefix/index.js
+++ b/server/api/voicePrefix/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x0e2a=['destroy','delete','removeAgents','exports','util','path','connect-timeout','express','Router','../../components/auth/service','./voicePrefix.controller','get','isAuthenticated','index','/describe','/:id','show','/:id/users','getAgents','post','create','addAgents','put','update'];(function(_0x5a3074,_0x4760f0){var _0x24b468=function(_0x306444){while(--_0x306444){_0x5a3074['push'](_0x5a3074['shift']());}};_0x24b468(++_0x4760f0);}(_0x0e2a,0x7c));var _0xa0e2=function(_0x308374,_0x550e85){_0x308374=_0x308374-0x0;var _0x1f71e0=_0x0e2a[_0x308374];return _0x1f71e0;};'use strict';var multer=require('multer');var util=require(_0xa0e2('0x0'));var path=require(_0xa0e2('0x1'));var timeout=require(_0xa0e2('0x2'));var express=require(_0xa0e2('0x3'));var router=express[_0xa0e2('0x4')]();var auth=require(_0xa0e2('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xa0e2('0x6'));router[_0xa0e2('0x7')]('/',auth[_0xa0e2('0x8')](),controller[_0xa0e2('0x9')]);router[_0xa0e2('0x7')](_0xa0e2('0xa'),auth[_0xa0e2('0x8')](),controller['describe']);router['get'](_0xa0e2('0xb'),auth[_0xa0e2('0x8')](),controller[_0xa0e2('0xc')]);router[_0xa0e2('0x7')](_0xa0e2('0xd'),auth[_0xa0e2('0x8')](),controller[_0xa0e2('0xe')]);router[_0xa0e2('0xf')]('/',auth['isAuthenticated'](),controller[_0xa0e2('0x10')]);router['post'](_0xa0e2('0xd'),auth[_0xa0e2('0x8')](),controller[_0xa0e2('0x11')]);router[_0xa0e2('0x12')]('/:id',auth[_0xa0e2('0x8')](),controller[_0xa0e2('0x13')]);router['delete'](_0xa0e2('0xb'),auth[_0xa0e2('0x8')](),controller[_0xa0e2('0x14')]);router[_0xa0e2('0x15')]('/:id/users',auth[_0xa0e2('0x8')](),controller[_0xa0e2('0x16')]);module[_0xa0e2('0x17')]=router;
\ No newline at end of file
+var _0xfd76=['delete','destroy','removeAgents','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../config/environment','get','/describe','isAuthenticated','describe','/:id','show','getAgents','post','create','/:id/users','put','update'];(function(_0x3fda7a,_0x53aed4){var _0x37e4de=function(_0x1a6b33){while(--_0x1a6b33){_0x3fda7a['push'](_0x3fda7a['shift']());}};_0x37e4de(++_0x53aed4);}(_0xfd76,0x101));var _0x6fd7=function(_0x40cf59,_0x23895c){_0x40cf59=_0x40cf59-0x0;var _0x134ced=_0xfd76[_0x40cf59];return _0x134ced;};'use strict';var multer=require(_0x6fd7('0x0'));var util=require(_0x6fd7('0x1'));var path=require(_0x6fd7('0x2'));var timeout=require(_0x6fd7('0x3'));var express=require(_0x6fd7('0x4'));var router=express['Router']();var auth=require(_0x6fd7('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x6fd7('0x6'));var controller=require('./voicePrefix.controller');router[_0x6fd7('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0x6fd7('0x7')](_0x6fd7('0x8'),auth[_0x6fd7('0x9')](),controller[_0x6fd7('0xa')]);router[_0x6fd7('0x7')](_0x6fd7('0xb'),auth[_0x6fd7('0x9')](),controller[_0x6fd7('0xc')]);router['get']('/:id/users',auth[_0x6fd7('0x9')](),controller[_0x6fd7('0xd')]);router[_0x6fd7('0xe')]('/',auth[_0x6fd7('0x9')](),controller[_0x6fd7('0xf')]);router[_0x6fd7('0xe')](_0x6fd7('0x10'),auth[_0x6fd7('0x9')](),controller['addAgents']);router[_0x6fd7('0x11')](_0x6fd7('0xb'),auth[_0x6fd7('0x9')](),controller[_0x6fd7('0x12')]);router[_0x6fd7('0x13')](_0x6fd7('0xb'),auth[_0x6fd7('0x9')](),controller[_0x6fd7('0x14')]);router[_0x6fd7('0x13')](_0x6fd7('0x10'),auth[_0x6fd7('0x9')](),controller[_0x6fd7('0x15')]);module[_0x6fd7('0x16')]=router;
\ No newline at end of file
diff --git a/server/api/voicePrefix/voicePrefix.attributes.js b/server/api/voicePrefix/voicePrefix.attributes.js
index c08ca2d..ad539d7 100644
--- a/server/api/voicePrefix/voicePrefix.attributes.js
+++ b/server/api/voicePrefix/voicePrefix.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x69e6=['exports','STRING','name','VIRTUAL','getDataValue','INTEGER'];(function(_0xd6ca50,_0x428697){var _0x579b2d=function(_0x305f4b){while(--_0x305f4b){_0xd6ca50['push'](_0xd6ca50['shift']());}};_0x579b2d(++_0x428697);}(_0x69e6,0x1e0));var _0x669e=function(_0x4ff784,_0x31f2e3){_0x4ff784=_0x4ff784-0x0;var _0x5231ec=_0x69e6[_0x4ff784];return _0x5231ec;};'use strict';var Sequelize=require('sequelize');module[_0x669e('0x0')]={'name':{'type':Sequelize[_0x669e('0x1')],'allowNull':![],'unique':_0x669e('0x2')},'prefix':{'type':Sequelize[_0x669e('0x3')],'get':function(_0x75b8aa){return'system-'+this[_0x669e('0x4')](_0x669e('0x2'))+'-';}},'description':{'type':Sequelize[_0x669e('0x1')]},'callerIdAll':{'type':Sequelize[_0x669e('0x1')]},'VoiceExtensionId':{'type':Sequelize[_0x669e('0x5')]}};
\ No newline at end of file
+var _0x73b6=['getDataValue','INTEGER','sequelize','STRING','name','VIRTUAL'];(function(_0x330c71,_0x290139){var _0x1f5916=function(_0x3c2b8d){while(--_0x3c2b8d){_0x330c71['push'](_0x330c71['shift']());}};_0x1f5916(++_0x290139);}(_0x73b6,0xce));var _0x673b=function(_0x54d4fe,_0x55e869){_0x54d4fe=_0x54d4fe-0x0;var _0x1ab5bb=_0x73b6[_0x54d4fe];return _0x1ab5bb;};'use strict';var Sequelize=require(_0x673b('0x0'));module['exports']={'name':{'type':Sequelize[_0x673b('0x1')],'allowNull':![],'unique':_0x673b('0x2')},'prefix':{'type':Sequelize[_0x673b('0x3')],'get':function(_0x5b1131){return'system-'+this[_0x673b('0x4')](_0x673b('0x2'))+'-';}},'description':{'type':Sequelize[_0x673b('0x1')]},'callerIdAll':{'type':Sequelize[_0x673b('0x1')]},'VoiceExtensionId':{'type':Sequelize[_0x673b('0x5')]}};
\ No newline at end of file
diff --git a/server/api/voicePrefix/voicePrefix.controller.js b/server/api/voicePrefix/voicePrefix.controller.js
index 31e0c2b..29ac01f 100644
--- a/server/api/voicePrefix/voicePrefix.controller.js
+++ b/server/api/voicePrefix/voicePrefix.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xcbd8=['No\x20callerid\x20available','goto','context','${EXTEN:','charAt','system-','findById','addAgents','ids','omit','spread','emit','removeAgents','isArray','userVoicePrefix:remove','getAgents','findOne','User','hasOwnProperty','nolimit','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','mustache','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','defaults','localhost','socket.io-emitter','redis','./voicePrefix.socket','register','sendStatus','status','end','json','count','offset','set','Content-Range','update','then','destroy','get','VoicePrefixes','UserProfileResource','error','stack','name','send','index','map','VoicePrefix','rawAttributes','fieldName','key','query','intersection','attributes','model','fields','length','limit','order','sort','where','filters','pick','filter','merge','type','VIRTUAL','includeAll','findAll','rows','show','params','keys','include','find','catch','create','sequelize','transaction','body','VoiceExtension','VoiceExtensionId','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','exten','system','Voice\x20Prefix\x20Extension','priority','NoOp','Voice\x20Prefix','VoicePrefixId','bulkCreate','Extensions\x20creation\x20failed','prefix','Set','CDR(prefix)=','callerIdAll','push','PREFIX-CALLERIDALL='];(function(_0x4690e5,_0x3e670c){var _0x333cec=function(_0x2707f2){while(--_0x2707f2){_0x4690e5['push'](_0x4690e5['shift']());}};_0x333cec(++_0x3e670c);}(_0xcbd8,0x10e));var _0x8cbd=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xcbd8[_0x2dafbe];return _0x58a45a;};'use strict';var pdf=require(_0x8cbd('0x0'));var emlformat=require(_0x8cbd('0x1'));var rimraf=require(_0x8cbd('0x2'));var zipdir=require(_0x8cbd('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x8cbd('0x4'));var moment=require(_0x8cbd('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x8cbd('0x6'));var util=require('util');var path=require(_0x8cbd('0x7'));var sox=require(_0x8cbd('0x8'));var csv=require(_0x8cbd('0x9'));var ejs=require(_0x8cbd('0xa'));var fs=require('fs');var _=require(_0x8cbd('0xb'));var squel=require(_0x8cbd('0xc'));var crypto=require('crypto');var jsforce=require(_0x8cbd('0xd'));var deskjs=require(_0x8cbd('0xe'));var toCsv=require('to-csv');var querystring=require(_0x8cbd('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x8cbd('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8cbd('0x11'));var logger=require(_0x8cbd('0x12'))(_0x8cbd('0x13'));var utils=require('../../config/utils');var config=require(_0x8cbd('0x14'));var db=require(_0x8cbd('0x15'))['db'];config['redis']=_[_0x8cbd('0x16')](config['redis'],{'host':_0x8cbd('0x17'),'port':0x18eb});var socket=require(_0x8cbd('0x18'))(new Redis(config[_0x8cbd('0x19')]));require(_0x8cbd('0x1a'))[_0x8cbd('0x1b')](socket);function respondWithStatusCode(_0x10ff8e,_0x5ec91a){_0x5ec91a=_0x5ec91a||0xcc;return function(_0x587b0c){if(_0x587b0c){return _0x10ff8e[_0x8cbd('0x1c')](_0x5ec91a);}return _0x10ff8e[_0x8cbd('0x1d')](_0x5ec91a)[_0x8cbd('0x1e')]();};}function respondWithResult(_0x46bcb7,_0x514d3a){_0x514d3a=_0x514d3a||0xc8;return function(_0x29ea5c){if(_0x29ea5c){return _0x46bcb7['status'](_0x514d3a)[_0x8cbd('0x1f')](_0x29ea5c);}};}function respondWithFilteredResult(_0x1c4754,_0x59b0fa){return function(_0x4e16c4){if(_0x4e16c4){var _0x19db4a=_0x4e16c4[_0x8cbd('0x20')],_0x394f45=_0x59b0fa[_0x8cbd('0x21')],_0x19c3f6=_0x59b0fa[_0x8cbd('0x21')]+_0x59b0fa['limit'],_0xdd3c6e;if(_0x19c3f6>=_0x19db4a){_0x19c3f6=_0x19db4a;_0xdd3c6e=0xc8;}else{_0xdd3c6e=0xce;}_0x1c4754[_0x8cbd('0x1d')](_0xdd3c6e);return _0x1c4754[_0x8cbd('0x22')](_0x8cbd('0x23'),_0x394f45+'-'+_0x19c3f6+'/'+_0x19db4a)[_0x8cbd('0x1f')](_0x4e16c4);}return null;};}function patchUpdates(_0x22e6a3){return function(_0x2a604f){try{jsonpatch['apply'](_0x2a604f,_0x22e6a3,!![]);}catch(_0x1983d7){return BPromise['reject'](_0x1983d7);}return _0x2a604f['save']();};}function saveUpdates(_0x26bf3c,_0x5302f0){return function(_0x5d864d){if(_0x5d864d){return _0x5d864d[_0x8cbd('0x24')](_0x26bf3c)[_0x8cbd('0x25')](function(_0x30aad9){return _0x30aad9;});}return null;};}function removeEntity(_0x5f0f02,_0x5b67ff){return function(_0x877b3f){if(_0x877b3f){return _0x877b3f[_0x8cbd('0x26')]()[_0x8cbd('0x25')](function(){var _0x184548=_0x877b3f[_0x8cbd('0x27')]({'plain':!![]});var _0x3aa60c=_0x8cbd('0x28');return db[_0x8cbd('0x29')][_0x8cbd('0x26')]({'where':{'type':_0x3aa60c,'resourceId':_0x184548['id']}})[_0x8cbd('0x25')](function(){return _0x877b3f;});})[_0x8cbd('0x25')](function(){_0x5f0f02[_0x8cbd('0x1d')](0xcc)[_0x8cbd('0x1e')]();});}};}function handleEntityNotFound(_0x3eea7d,_0x3e7dfc){return function(_0x6ef4db){if(!_0x6ef4db){_0x3eea7d['sendStatus'](0x194);}return _0x6ef4db;};}function handleError(_0x3889cd,_0x5a80fc){_0x5a80fc=_0x5a80fc||0x1f4;return function(_0x598f93){logger[_0x8cbd('0x2a')](_0x598f93[_0x8cbd('0x2b')]);if(_0x598f93[_0x8cbd('0x2c')]){delete _0x598f93[_0x8cbd('0x2c')];}_0x3889cd[_0x8cbd('0x1d')](_0x5a80fc)[_0x8cbd('0x2d')](_0x598f93);};}exports[_0x8cbd('0x2e')]=function(_0x3c385a,_0x5923d1){var _0x13538c={},_0x3d9a31={},_0x48ee5d={'count':0x0,'rows':[]};var _0x39aede=_[_0x8cbd('0x2f')](db[_0x8cbd('0x30')][_0x8cbd('0x31')],function(_0x1ae7d9){return{'name':_0x1ae7d9[_0x8cbd('0x32')],'type':_0x1ae7d9['type'][_0x8cbd('0x33')]};});_0x3d9a31['model']=_[_0x8cbd('0x2f')](_0x39aede,_0x8cbd('0x2c'));_0x3d9a31[_0x8cbd('0x34')]=_['keys'](_0x3c385a[_0x8cbd('0x34')]);_0x3d9a31['filters']=_[_0x8cbd('0x35')](_0x3d9a31['model'],_0x3d9a31['query']);_0x13538c[_0x8cbd('0x36')]=_[_0x8cbd('0x35')](_0x3d9a31[_0x8cbd('0x37')],qs[_0x8cbd('0x38')](_0x3c385a[_0x8cbd('0x34')]['fields']));_0x13538c['attributes']=_0x13538c[_0x8cbd('0x36')][_0x8cbd('0x39')]?_0x13538c['attributes']:_0x3d9a31[_0x8cbd('0x37')];if(!_0x3c385a[_0x8cbd('0x34')]['hasOwnProperty']('nolimit')){_0x13538c[_0x8cbd('0x3a')]=qs[_0x8cbd('0x3a')](_0x3c385a['query'][_0x8cbd('0x3a')]);_0x13538c['offset']=qs[_0x8cbd('0x21')](_0x3c385a['query'][_0x8cbd('0x21')]);}_0x13538c[_0x8cbd('0x3b')]=qs[_0x8cbd('0x3c')](_0x3c385a[_0x8cbd('0x34')][_0x8cbd('0x3c')]);_0x13538c[_0x8cbd('0x3d')]=qs[_0x8cbd('0x3e')](_[_0x8cbd('0x3f')](_0x3c385a[_0x8cbd('0x34')],_0x3d9a31['filters']),_0x39aede);if(_0x3c385a[_0x8cbd('0x34')][_0x8cbd('0x40')]){_0x13538c[_0x8cbd('0x3d')]=_[_0x8cbd('0x41')](_0x13538c['where'],{'$or':_[_0x8cbd('0x2f')](_0x39aede,function(_0xf0721e){if(_0xf0721e[_0x8cbd('0x42')]!==_0x8cbd('0x43')){var _0x46e29a={};_0x46e29a[_0xf0721e[_0x8cbd('0x2c')]]={'$like':'%'+_0x3c385a[_0x8cbd('0x34')][_0x8cbd('0x40')]+'%'};return _0x46e29a;}})});}_0x13538c=_[_0x8cbd('0x41')]({},_0x13538c,_0x3c385a['options']);var _0x5c322c={'where':_0x13538c[_0x8cbd('0x3d')]};return db[_0x8cbd('0x30')][_0x8cbd('0x20')](_0x5c322c)[_0x8cbd('0x25')](function(_0x29037f){_0x48ee5d[_0x8cbd('0x20')]=_0x29037f;if(_0x3c385a[_0x8cbd('0x34')][_0x8cbd('0x44')]){_0x13538c['include']=[{'all':!![]}];}return db[_0x8cbd('0x30')][_0x8cbd('0x45')](_0x13538c);})[_0x8cbd('0x25')](function(_0x1af9ef){_0x48ee5d[_0x8cbd('0x46')]=_0x1af9ef;return _0x48ee5d;})[_0x8cbd('0x25')](respondWithFilteredResult(_0x5923d1,_0x13538c))['catch'](handleError(_0x5923d1,null));};exports[_0x8cbd('0x47')]=function(_0x153cfd,_0x4b725f){var _0x390c89={'raw':![],'where':{'id':_0x153cfd[_0x8cbd('0x48')]['id']}},_0xc9eb81={};_0xc9eb81[_0x8cbd('0x37')]=_[_0x8cbd('0x49')](db['VoicePrefix'][_0x8cbd('0x31')]);_0xc9eb81[_0x8cbd('0x34')]=_[_0x8cbd('0x49')](_0x153cfd[_0x8cbd('0x34')]);_0xc9eb81['filters']=_['intersection'](_0xc9eb81[_0x8cbd('0x37')],_0xc9eb81[_0x8cbd('0x34')]);_0x390c89['attributes']=_[_0x8cbd('0x35')](_0xc9eb81[_0x8cbd('0x37')],qs['fields'](_0x153cfd['query'][_0x8cbd('0x38')]));_0x390c89[_0x8cbd('0x36')]=_0x390c89['attributes'][_0x8cbd('0x39')]?_0x390c89[_0x8cbd('0x36')]:_0xc9eb81[_0x8cbd('0x37')];if(_0x153cfd['query'][_0x8cbd('0x44')]){_0x390c89[_0x8cbd('0x4a')]=[{'all':!![]}];}_0x390c89=_['merge']({},_0x390c89,_0x153cfd['options']);return db['VoicePrefix'][_0x8cbd('0x4b')](_0x390c89)[_0x8cbd('0x25')](handleEntityNotFound(_0x4b725f,null))[_0x8cbd('0x25')](respondWithResult(_0x4b725f,null))[_0x8cbd('0x4c')](handleError(_0x4b725f,null));};exports[_0x8cbd('0x26')]=function(_0x1ce43d,_0x1a1f3e){return db[_0x8cbd('0x30')][_0x8cbd('0x4b')]({'where':{'id':_0x1ce43d[_0x8cbd('0x48')]['id']}})[_0x8cbd('0x25')](handleEntityNotFound(_0x1a1f3e,null))[_0x8cbd('0x25')](removeEntity(_0x1a1f3e,null))[_0x8cbd('0x4c')](handleError(_0x1a1f3e,null));};exports['describe']=function(_0x53fa0e,_0x41f85c){return db[_0x8cbd('0x30')]['describe']()[_0x8cbd('0x25')](respondWithResult(_0x41f85c,null))[_0x8cbd('0x4c')](handleError(_0x41f85c,null));};exports[_0x8cbd('0x4d')]=function(_0x4dff37,_0x6ca496){var _0x583c8b;return db[_0x8cbd('0x4e')][_0x8cbd('0x4f')](function(_0x56637f){return db[_0x8cbd('0x30')][_0x8cbd('0x4d')](_0x4dff37[_0x8cbd('0x50')],{'transaction':_0x56637f})['then'](function(_0x4f90b3){_0x583c8b=_0x4f90b3['get']({'plain':!![]});return db[_0x8cbd('0x51')][_0x8cbd('0x4b')]({'where':{'id':_0x583c8b[_0x8cbd('0x52')]},'raw':!![]})[_0x8cbd('0x25')](function(_0x4b72e2){return createVoicePrefixExtensions(_0x583c8b,_0x4b72e2,_0x56637f);});});})['then'](function(){var _0x160ef8=_0x4dff37[_0x8cbd('0x53')][_0x8cbd('0x27')]({'plain':!![]});if(!_0x160ef8)throw new Error(_0x8cbd('0x54'));if(_0x160ef8[_0x8cbd('0x55')]===_0x8cbd('0x53')){var _0x1c1e73=_0x583c8b;return db[_0x8cbd('0x56')]['find']({'where':{'name':_0x8cbd('0x28'),'userProfileId':_0x160ef8[_0x8cbd('0x57')]},'raw':!![]})[_0x8cbd('0x25')](function(_0x2e842a){if(_0x2e842a&&_0x2e842a[_0x8cbd('0x58')]===0x0){return db['UserProfileResource']['create']({'name':_0x1c1e73[_0x8cbd('0x2c')],'resourceId':_0x1c1e73['id'],'type':_0x2e842a['name'],'sectionId':_0x2e842a['id']},{})[_0x8cbd('0x25')](function(){return _0x583c8b;});}else{return _0x583c8b;}})[_0x8cbd('0x4c')](function(_0x3383fd){logger[_0x8cbd('0x2a')](_0x8cbd('0x59'),_0x3383fd);throw _0x3383fd;});}return _0x583c8b;})['then'](respondWithResult(_0x6ca496,null))[_0x8cbd('0x4c')](handleError(_0x6ca496,null));};function Extension(_0x231ee0,_0x5d29b6,_0xafc387,_0x2d3e75){this['context']='from-sip';this[_0x8cbd('0x5a')]=_0x231ee0;this['app']=_0xafc387;this[_0x8cbd('0x42')]=_0x8cbd('0x5b');this['description']=_0x8cbd('0x5c');this[_0x8cbd('0x5d')]=_0x5d29b6;this['appdata']=_0x2d3e75;}function createVoicePrefixExtensions(_0x3ae518,_0x41fc12,_0xa681db){return new BPromise(function(_0xab910a,_0x56e48e){var _0x1f2981=new Extension(formatPrefixName(_0x3ae518['prefix']),0x1,_0x8cbd('0x5e'),_0x8cbd('0x5f'));_0x1f2981[_0x8cbd('0x60')]=_0x3ae518['id'];return db[_0x8cbd('0x51')][_0x8cbd('0x4d')](_0x1f2981,{'transaction':_0xa681db})[_0x8cbd('0x25')](function(_0x1007e3){var _0x408a6d=_0x1007e3[_0x8cbd('0x27')]({'plain':!![]});var _0x25b6bf=_['map'](addVoicePrefixExtensions(_0x3ae518,_0x41fc12),function(_0x457666){_0x457666[_0x8cbd('0x52')]=_0x408a6d['id'];_0x457666['VoicePrefixId']=_0x3ae518['id'];return _0x457666;});return db[_0x8cbd('0x51')][_0x8cbd('0x61')](_0x25b6bf,{'transaction':_0xa681db})[_0x8cbd('0x25')](function(_0x32b7ce){if(!_0x32b7ce){return _0x56e48e(_0x8cbd('0x62'));}else{return _0xab910a(_0x32b7ce);}})['catch'](function(_0x3c34ce){return _0x56e48e(_0x3c34ce);});});;});};function addVoicePrefixExtensions(_0x4c1c57,_0x281788){var _0x777805=[];var _0x35f3c4=formatPrefixName(_0x4c1c57[_0x8cbd('0x63')]);_0x777805['push'](new Extension(_0x35f3c4,0x2,_0x8cbd('0x64'),_0x8cbd('0x65')+_0x4c1c57['name']));if(_0x4c1c57[_0x8cbd('0x66')]){_0x777805[_0x8cbd('0x67')](new Extension(_0x35f3c4,0x3,'Set',_0x8cbd('0x68')+_0x4c1c57['callerIdAll']));}else{_0x777805['push'](new Extension(_0x35f3c4,0x3,'NoOp',_0x8cbd('0x69')));}_0x777805[_0x8cbd('0x67')](new Extension(_0x35f3c4,0x4,_0x8cbd('0x6a'),_0x281788[_0x8cbd('0x6b')]+','+_0x8cbd('0x6c')+(0x8+_0x4c1c57['name']['length'])+'}'+','+0x1));return _0x777805;}function formatPrefixName(_0x502fe7){var _0x451a58='_';for(var _0x897885=0x0;_0x897885<_0x502fe7[_0x8cbd('0x39')];_0x897885++){if(_0x502fe7['charAt'](_0x897885)=='-'){_0x451a58+=_0x502fe7[_0x8cbd('0x6d')](_0x897885);}else{_0x451a58+='['+_0x502fe7[_0x8cbd('0x6d')](_0x897885)+']';}}_0x451a58+='.';return _0x451a58;}exports[_0x8cbd('0x24')]=function(_0x2f0377,_0x13f3eb,_0x4a2b37){var _0x3d12f1=_0x2f0377[_0x8cbd('0x50')];_0x3d12f1['prefix']=_0x8cbd('0x6e')+_0x3d12f1['name']+'-';return db[_0x8cbd('0x4e')][_0x8cbd('0x4f')](function(_0x29d0ac){return db[_0x8cbd('0x30')][_0x8cbd('0x24')](_0x3d12f1,{'where':{'id':_0x3d12f1['id']},'transaction':_0x29d0ac})[_0x8cbd('0x25')](function(){return db[_0x8cbd('0x51')]['destroy']({'where':{'VoicePrefixId':_0x3d12f1['id']},'transaction':_0x29d0ac})[_0x8cbd('0x25')](function(){return db[_0x8cbd('0x51')][_0x8cbd('0x4b')]({'where':{'id':_0x3d12f1['VoiceExtensionId']},'raw':!![]})['then'](function(_0x1edba4){return createVoicePrefixExtensions(_0x3d12f1,_0x1edba4,_0x29d0ac);});});});})[_0x8cbd('0x25')](function(){return db['VoicePrefix'][_0x8cbd('0x6f')](_0x3d12f1['id']);})['then'](respondWithResult(_0x13f3eb,null))[_0x8cbd('0x4c')](handleError(_0x13f3eb,null));};exports[_0x8cbd('0x70')]=function(_0x2b41b8,_0x73f8f,_0x4ee4db){return db[_0x8cbd('0x30')][_0x8cbd('0x4b')]({'where':{'id':_0x2b41b8['params']['id']}})[_0x8cbd('0x25')](handleEntityNotFound(_0x73f8f,null))[_0x8cbd('0x25')](function(_0x5aadb8){if(_0x5aadb8){return _0x5aadb8['addAgents'](_0x2b41b8[_0x8cbd('0x50')][_0x8cbd('0x71')],_[_0x8cbd('0x72')](_0x2b41b8[_0x8cbd('0x50')],[_0x8cbd('0x71'),'id'])||{})[_0x8cbd('0x73')](function(_0x3c1c6e){for(var _0x449e6b=0x0;_0x449e6b<_0x2b41b8[_0x8cbd('0x50')][_0x8cbd('0x71')][_0x8cbd('0x39')];_0x449e6b+=0x1){socket[_0x8cbd('0x74')]('userVoicePrefix:save',{'UserId':_0x2b41b8[_0x8cbd('0x50')]['ids'][_0x449e6b],'VoicePrefixId':_0x2b41b8['params']['id']});}return _0x3c1c6e;});}})[_0x8cbd('0x25')](respondWithResult(_0x73f8f,null))['catch'](handleError(_0x73f8f,null));};exports['removeAgents']=function(_0x2b482d,_0x39d455,_0x364f77){return db['VoicePrefix'][_0x8cbd('0x4b')]({'where':{'id':_0x2b482d[_0x8cbd('0x48')]['id']}})['then'](handleEntityNotFound(_0x39d455,null))[_0x8cbd('0x25')](function(_0x180f63){if(_0x180f63){return _0x180f63[_0x8cbd('0x75')](_0x2b482d['query'][_0x8cbd('0x71')])[_0x8cbd('0x25')](function(){if(_[_0x8cbd('0x76')](_0x2b482d[_0x8cbd('0x34')][_0x8cbd('0x71')])){for(var _0x47b7e1=0x0;_0x47b7e1<_0x2b482d[_0x8cbd('0x34')]['ids'][_0x8cbd('0x39')];_0x47b7e1+=0x1){socket[_0x8cbd('0x74')](_0x8cbd('0x77'),{'UserId':Number(_0x2b482d['query'][_0x8cbd('0x71')][_0x47b7e1]),'VoicePrefixId':Number(_0x2b482d[_0x8cbd('0x48')]['id'])});}}else{socket['emit'](_0x8cbd('0x77'),{'UserId':Number(_0x2b482d[_0x8cbd('0x34')][_0x8cbd('0x71')]),'VoicePrefixId':Number(_0x2b482d[_0x8cbd('0x48')]['id'])});}});}})[_0x8cbd('0x25')](respondWithStatusCode(_0x39d455,null))['catch'](handleError(_0x39d455,null));};exports[_0x8cbd('0x78')]=function(_0x212e63,_0x46e3d4,_0x452585){var _0x8764de={};var _0x5e32a9={};var _0x4827fc;var _0x3ff7b1;return db['VoicePrefix'][_0x8cbd('0x79')]({'where':{'id':_0x212e63['params']['id']}})[_0x8cbd('0x25')](handleEntityNotFound(_0x46e3d4,null))[_0x8cbd('0x25')](function(_0xcd82b9){if(_0xcd82b9){_0x4827fc=_0xcd82b9;_0x5e32a9[_0x8cbd('0x37')]=_['keys'](db[_0x8cbd('0x7a')][_0x8cbd('0x31')]);_0x5e32a9[_0x8cbd('0x34')]=_[_0x8cbd('0x49')](_0x212e63[_0x8cbd('0x34')]);_0x5e32a9['filters']=_[_0x8cbd('0x35')](_0x5e32a9['model'],_0x5e32a9[_0x8cbd('0x34')]);_0x8764de[_0x8cbd('0x36')]=_[_0x8cbd('0x35')](_0x5e32a9[_0x8cbd('0x37')],qs[_0x8cbd('0x38')](_0x212e63[_0x8cbd('0x34')][_0x8cbd('0x38')]));_0x8764de['attributes']=_0x8764de[_0x8cbd('0x36')][_0x8cbd('0x39')]?_0x8764de[_0x8cbd('0x36')]:_0x5e32a9[_0x8cbd('0x37')];_0x8764de[_0x8cbd('0x3b')]=qs[_0x8cbd('0x3c')](_0x212e63[_0x8cbd('0x34')][_0x8cbd('0x3c')]);_0x8764de[_0x8cbd('0x3d')]=qs[_0x8cbd('0x3e')](_[_0x8cbd('0x3f')](_0x212e63[_0x8cbd('0x34')],_0x5e32a9[_0x8cbd('0x3e')]));if(_0x212e63[_0x8cbd('0x34')][_0x8cbd('0x40')]){_0x8764de[_0x8cbd('0x3d')]=_[_0x8cbd('0x41')](_0x8764de[_0x8cbd('0x3d')],{'$or':_[_0x8cbd('0x2f')](_0x8764de['attributes'],function(_0x2b6564){var _0x40e693={};_0x40e693[_0x2b6564]={'$like':'%'+_0x212e63[_0x8cbd('0x34')][_0x8cbd('0x40')]+'%'};return _0x40e693;})});}_0x8764de=_[_0x8cbd('0x41')]({},_0x8764de,_0x212e63['options']);return _0x4827fc[_0x8cbd('0x78')](_0x8764de);}})[_0x8cbd('0x25')](function(_0xee2a37){if(_0xee2a37){_0x3ff7b1=_0xee2a37[_0x8cbd('0x39')];if(!_0x212e63[_0x8cbd('0x34')][_0x8cbd('0x7b')](_0x8cbd('0x7c'))){_0x8764de[_0x8cbd('0x3a')]=qs[_0x8cbd('0x3a')](_0x212e63[_0x8cbd('0x34')][_0x8cbd('0x3a')]);_0x8764de[_0x8cbd('0x21')]=qs['offset'](_0x212e63[_0x8cbd('0x34')]['offset']);}return _0x4827fc[_0x8cbd('0x78')](_0x8764de);}})[_0x8cbd('0x25')](function(_0x307465){if(_0x307465){return _0x307465?{'count':_0x3ff7b1,'rows':_0x307465}:null;}})[_0x8cbd('0x25')](respondWithResult(_0x46e3d4,null))[_0x8cbd('0x4c')](handleError(_0x46e3d4,null));};
\ No newline at end of file
+var _0xc06b=['NoOp','VoicePrefixId','VoiceExtension','bulkCreate','Extensions\x20creation\x20failed','push','callerIdAll','PREFIX-CALLERIDALL=','No\x20callerid\x20available','goto','charAt','system-','addAgents','body','ids','omit','spread','emit','userVoicePrefix:save','removeAgents','isArray','userVoicePrefix:remove','getAgents','User','order','zip-dir','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./voicePrefix.socket','register','sendStatus','end','status','json','offset','limit','set','Content-Range','apply','update','then','get','VoicePrefixes','UserProfileResource','destroy','error','stack','name','send','map','VoicePrefix','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','filter','where','merge','VIRTUAL','count','includeAll','include','rows','show','params','options','find','catch','describe','sequelize','transaction','create','VoiceExtensionId','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','context','from-sip','exten','app','system','description','Voice\x20Prefix\x20Extension','priority','appdata','prefix'];(function(_0x1fa380,_0xd0917f){var _0x219838=function(_0x4e7e4e){while(--_0x4e7e4e){_0x1fa380['push'](_0x1fa380['shift']());}};_0x219838(++_0xd0917f);}(_0xc06b,0x18d));var _0xbc06=function(_0x3ccea2,_0x624323){_0x3ccea2=_0x3ccea2-0x0;var _0xeb988=_0xc06b[_0x3ccea2];return _0xeb988;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xbc06('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0xbc06('0x1'));var moment=require(_0xbc06('0x2'));var BPromise=require(_0xbc06('0x3'));var Mustache=require(_0xbc06('0x4'));var util=require(_0xbc06('0x5'));var path=require('path');var sox=require(_0xbc06('0x6'));var csv=require(_0xbc06('0x7'));var ejs=require(_0xbc06('0x8'));var fs=require('fs');var _=require(_0xbc06('0x9'));var squel=require(_0xbc06('0xa'));var crypto=require(_0xbc06('0xb'));var jsforce=require(_0xbc06('0xc'));var deskjs=require(_0xbc06('0xd'));var toCsv=require(_0xbc06('0x7'));var querystring=require(_0xbc06('0xe'));var Papa=require(_0xbc06('0xf'));var Redis=require(_0xbc06('0x10'));var authService=require(_0xbc06('0x11'));var qs=require(_0xbc06('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xbc06('0x13'))(_0xbc06('0x14'));var utils=require(_0xbc06('0x15'));var config=require(_0xbc06('0x16'));var db=require(_0xbc06('0x17'))['db'];config[_0xbc06('0x18')]=_[_0xbc06('0x19')](config[_0xbc06('0x18')],{'host':'localhost','port':0x18eb});var socket=require(_0xbc06('0x1a'))(new Redis(config[_0xbc06('0x18')]));require(_0xbc06('0x1b'))[_0xbc06('0x1c')](socket);function respondWithStatusCode(_0x2a5748,_0x4fdf0e){_0x4fdf0e=_0x4fdf0e||0xcc;return function(_0x27a0b9){if(_0x27a0b9){return _0x2a5748[_0xbc06('0x1d')](_0x4fdf0e);}return _0x2a5748['status'](_0x4fdf0e)[_0xbc06('0x1e')]();};}function respondWithResult(_0x10451c,_0x30feef){_0x30feef=_0x30feef||0xc8;return function(_0x2c6840){if(_0x2c6840){return _0x10451c[_0xbc06('0x1f')](_0x30feef)[_0xbc06('0x20')](_0x2c6840);}};}function respondWithFilteredResult(_0x34a8a6,_0x20e46c){return function(_0x3933e7){if(_0x3933e7){var _0x4f7cc4=_0x3933e7['count'],_0x2c8d1e=_0x20e46c['offset'],_0x578367=_0x20e46c[_0xbc06('0x21')]+_0x20e46c[_0xbc06('0x22')],_0x3bf645;if(_0x578367>=_0x4f7cc4){_0x578367=_0x4f7cc4;_0x3bf645=0xc8;}else{_0x3bf645=0xce;}_0x34a8a6['status'](_0x3bf645);return _0x34a8a6[_0xbc06('0x23')](_0xbc06('0x24'),_0x2c8d1e+'-'+_0x578367+'/'+_0x4f7cc4)[_0xbc06('0x20')](_0x3933e7);}return null;};}function patchUpdates(_0x4d79f7){return function(_0xfe7fe8){try{jsonpatch[_0xbc06('0x25')](_0xfe7fe8,_0x4d79f7,!![]);}catch(_0x5da25a){return BPromise['reject'](_0x5da25a);}return _0xfe7fe8['save']();};}function saveUpdates(_0x3a9ead,_0x300f6e){return function(_0x97ce96){if(_0x97ce96){return _0x97ce96[_0xbc06('0x26')](_0x3a9ead)[_0xbc06('0x27')](function(_0x24e4e1){return _0x24e4e1;});}return null;};}function removeEntity(_0x574eeb,_0x14495){return function(_0xfd6dd1){if(_0xfd6dd1){return _0xfd6dd1['destroy']()[_0xbc06('0x27')](function(){var _0x274d5f=_0xfd6dd1[_0xbc06('0x28')]({'plain':!![]});var _0x3b167b=_0xbc06('0x29');return db[_0xbc06('0x2a')][_0xbc06('0x2b')]({'where':{'type':_0x3b167b,'resourceId':_0x274d5f['id']}})[_0xbc06('0x27')](function(){return _0xfd6dd1;});})[_0xbc06('0x27')](function(){_0x574eeb[_0xbc06('0x1f')](0xcc)[_0xbc06('0x1e')]();});}};}function handleEntityNotFound(_0xe4a62a,_0x6fa194){return function(_0x2780b4){if(!_0x2780b4){_0xe4a62a['sendStatus'](0x194);}return _0x2780b4;};}function handleError(_0x72f390,_0x363b8d){_0x363b8d=_0x363b8d||0x1f4;return function(_0x203f2f){logger[_0xbc06('0x2c')](_0x203f2f[_0xbc06('0x2d')]);if(_0x203f2f[_0xbc06('0x2e')]){delete _0x203f2f[_0xbc06('0x2e')];}_0x72f390[_0xbc06('0x1f')](_0x363b8d)[_0xbc06('0x2f')](_0x203f2f);};}exports['index']=function(_0x996a5c,_0x3b2c36){var _0x22a742={},_0x17b6e1={},_0x2bea15={'count':0x0,'rows':[]};var _0x1ee57e=_[_0xbc06('0x30')](db[_0xbc06('0x31')]['rawAttributes'],function(_0x4654d1){return{'name':_0x4654d1[_0xbc06('0x32')],'type':_0x4654d1[_0xbc06('0x33')][_0xbc06('0x34')]};});_0x17b6e1[_0xbc06('0x35')]=_[_0xbc06('0x30')](_0x1ee57e,_0xbc06('0x2e'));_0x17b6e1[_0xbc06('0x36')]=_[_0xbc06('0x37')](_0x996a5c[_0xbc06('0x36')]);_0x17b6e1[_0xbc06('0x38')]=_[_0xbc06('0x39')](_0x17b6e1[_0xbc06('0x35')],_0x17b6e1[_0xbc06('0x36')]);_0x22a742[_0xbc06('0x3a')]=_[_0xbc06('0x39')](_0x17b6e1['model'],qs[_0xbc06('0x3b')](_0x996a5c['query']['fields']));_0x22a742[_0xbc06('0x3a')]=_0x22a742['attributes'][_0xbc06('0x3c')]?_0x22a742[_0xbc06('0x3a')]:_0x17b6e1[_0xbc06('0x35')];if(!_0x996a5c[_0xbc06('0x36')][_0xbc06('0x3d')](_0xbc06('0x3e'))){_0x22a742[_0xbc06('0x22')]=qs[_0xbc06('0x22')](_0x996a5c[_0xbc06('0x36')][_0xbc06('0x22')]);_0x22a742[_0xbc06('0x21')]=qs['offset'](_0x996a5c['query'][_0xbc06('0x21')]);}_0x22a742['order']=qs[_0xbc06('0x3f')](_0x996a5c[_0xbc06('0x36')][_0xbc06('0x3f')]);_0x22a742['where']=qs['filters'](_[_0xbc06('0x40')](_0x996a5c[_0xbc06('0x36')],_0x17b6e1[_0xbc06('0x38')]),_0x1ee57e);if(_0x996a5c[_0xbc06('0x36')][_0xbc06('0x41')]){_0x22a742[_0xbc06('0x42')]=_[_0xbc06('0x43')](_0x22a742[_0xbc06('0x42')],{'$or':_[_0xbc06('0x30')](_0x1ee57e,function(_0x277bf5){if(_0x277bf5[_0xbc06('0x33')]!==_0xbc06('0x44')){var _0x5e45d3={};_0x5e45d3[_0x277bf5[_0xbc06('0x2e')]]={'$like':'%'+_0x996a5c[_0xbc06('0x36')][_0xbc06('0x41')]+'%'};return _0x5e45d3;}})});}_0x22a742=_[_0xbc06('0x43')]({},_0x22a742,_0x996a5c['options']);var _0x3f7c6a={'where':_0x22a742[_0xbc06('0x42')]};return db[_0xbc06('0x31')][_0xbc06('0x45')](_0x3f7c6a)[_0xbc06('0x27')](function(_0x25a9c0){_0x2bea15[_0xbc06('0x45')]=_0x25a9c0;if(_0x996a5c[_0xbc06('0x36')][_0xbc06('0x46')]){_0x22a742[_0xbc06('0x47')]=[{'all':!![]}];}return db[_0xbc06('0x31')]['findAll'](_0x22a742);})['then'](function(_0x51fc68){_0x2bea15[_0xbc06('0x48')]=_0x51fc68;return _0x2bea15;})[_0xbc06('0x27')](respondWithFilteredResult(_0x3b2c36,_0x22a742))['catch'](handleError(_0x3b2c36,null));};exports[_0xbc06('0x49')]=function(_0x59eac8,_0x1e39e8){var _0x90cd09={'raw':![],'where':{'id':_0x59eac8[_0xbc06('0x4a')]['id']}},_0x38151c={};_0x38151c[_0xbc06('0x35')]=_[_0xbc06('0x37')](db[_0xbc06('0x31')]['rawAttributes']);_0x38151c[_0xbc06('0x36')]=_[_0xbc06('0x37')](_0x59eac8[_0xbc06('0x36')]);_0x38151c[_0xbc06('0x38')]=_['intersection'](_0x38151c['model'],_0x38151c[_0xbc06('0x36')]);_0x90cd09[_0xbc06('0x3a')]=_['intersection'](_0x38151c[_0xbc06('0x35')],qs[_0xbc06('0x3b')](_0x59eac8['query'][_0xbc06('0x3b')]));_0x90cd09[_0xbc06('0x3a')]=_0x90cd09['attributes'][_0xbc06('0x3c')]?_0x90cd09['attributes']:_0x38151c['model'];if(_0x59eac8[_0xbc06('0x36')]['includeAll']){_0x90cd09['include']=[{'all':!![]}];}_0x90cd09=_['merge']({},_0x90cd09,_0x59eac8[_0xbc06('0x4b')]);return db[_0xbc06('0x31')][_0xbc06('0x4c')](_0x90cd09)[_0xbc06('0x27')](handleEntityNotFound(_0x1e39e8,null))[_0xbc06('0x27')](respondWithResult(_0x1e39e8,null))[_0xbc06('0x4d')](handleError(_0x1e39e8,null));};exports[_0xbc06('0x2b')]=function(_0x690e56,_0x120586){return db[_0xbc06('0x31')][_0xbc06('0x4c')]({'where':{'id':_0x690e56[_0xbc06('0x4a')]['id']}})[_0xbc06('0x27')](handleEntityNotFound(_0x120586,null))['then'](removeEntity(_0x120586,null))[_0xbc06('0x4d')](handleError(_0x120586,null));};exports[_0xbc06('0x4e')]=function(_0x26761a,_0x273431){return db[_0xbc06('0x31')]['describe']()[_0xbc06('0x27')](respondWithResult(_0x273431,null))[_0xbc06('0x4d')](handleError(_0x273431,null));};exports['create']=function(_0xcd6c30,_0x1cd55a){var _0x25c6c3;return db[_0xbc06('0x4f')][_0xbc06('0x50')](function(_0x3ca252){return db['VoicePrefix'][_0xbc06('0x51')](_0xcd6c30['body'],{'transaction':_0x3ca252})['then'](function(_0x30635e){_0x25c6c3=_0x30635e[_0xbc06('0x28')]({'plain':!![]});return db['VoiceExtension'][_0xbc06('0x4c')]({'where':{'id':_0x25c6c3[_0xbc06('0x52')]},'raw':!![]})['then'](function(_0xb05c9a){return createVoicePrefixExtensions(_0x25c6c3,_0xb05c9a,_0x3ca252);});});})['then'](function(){var _0xc8ba6f=_0xcd6c30[_0xbc06('0x53')][_0xbc06('0x28')]({'plain':!![]});if(!_0xc8ba6f)throw new Error(_0xbc06('0x54'));if(_0xc8ba6f[_0xbc06('0x55')]===_0xbc06('0x53')){var _0x502d12=_0x25c6c3;return db[_0xbc06('0x56')][_0xbc06('0x4c')]({'where':{'name':_0xbc06('0x29'),'userProfileId':_0xc8ba6f[_0xbc06('0x57')]},'raw':!![]})[_0xbc06('0x27')](function(_0x42c96d){if(_0x42c96d&&_0x42c96d[_0xbc06('0x58')]===0x0){return db['UserProfileResource']['create']({'name':_0x502d12[_0xbc06('0x2e')],'resourceId':_0x502d12['id'],'type':_0x42c96d['name'],'sectionId':_0x42c96d['id']},{})[_0xbc06('0x27')](function(){return _0x25c6c3;});}else{return _0x25c6c3;}})[_0xbc06('0x4d')](function(_0x5ce1d4){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5ce1d4);throw _0x5ce1d4;});}return _0x25c6c3;})[_0xbc06('0x27')](respondWithResult(_0x1cd55a,null))[_0xbc06('0x4d')](handleError(_0x1cd55a,null));};function Extension(_0x2360e4,_0x27b91c,_0x438d05,_0x3c440a){this[_0xbc06('0x59')]=_0xbc06('0x5a');this[_0xbc06('0x5b')]=_0x2360e4;this[_0xbc06('0x5c')]=_0x438d05;this[_0xbc06('0x33')]=_0xbc06('0x5d');this[_0xbc06('0x5e')]=_0xbc06('0x5f');this[_0xbc06('0x60')]=_0x27b91c;this[_0xbc06('0x61')]=_0x3c440a;}function createVoicePrefixExtensions(_0x344ff7,_0x26f8c5,_0x2e378e){return new BPromise(function(_0x30280d,_0x29239b){var _0x3f4e6d=new Extension(formatPrefixName(_0x344ff7[_0xbc06('0x62')]),0x1,_0xbc06('0x63'),'Voice\x20Prefix');_0x3f4e6d[_0xbc06('0x64')]=_0x344ff7['id'];return db[_0xbc06('0x65')]['create'](_0x3f4e6d,{'transaction':_0x2e378e})[_0xbc06('0x27')](function(_0x5a42d8){var _0x235479=_0x5a42d8[_0xbc06('0x28')]({'plain':!![]});var _0x38c620=_['map'](addVoicePrefixExtensions(_0x344ff7,_0x26f8c5),function(_0x5ae753){_0x5ae753[_0xbc06('0x52')]=_0x235479['id'];_0x5ae753[_0xbc06('0x64')]=_0x344ff7['id'];return _0x5ae753;});return db[_0xbc06('0x65')][_0xbc06('0x66')](_0x38c620,{'transaction':_0x2e378e})[_0xbc06('0x27')](function(_0x242966){if(!_0x242966){return _0x29239b(_0xbc06('0x67'));}else{return _0x30280d(_0x242966);}})[_0xbc06('0x4d')](function(_0x30325c){return _0x29239b(_0x30325c);});});;});};function addVoicePrefixExtensions(_0x949f06,_0x5cd9d4){var _0x5cab8c=[];var _0x555977=formatPrefixName(_0x949f06[_0xbc06('0x62')]);_0x5cab8c[_0xbc06('0x68')](new Extension(_0x555977,0x2,'Set','CDR(prefix)='+_0x949f06[_0xbc06('0x2e')]));if(_0x949f06[_0xbc06('0x69')]){_0x5cab8c[_0xbc06('0x68')](new Extension(_0x555977,0x3,'Set',_0xbc06('0x6a')+_0x949f06['callerIdAll']));}else{_0x5cab8c[_0xbc06('0x68')](new Extension(_0x555977,0x3,_0xbc06('0x63'),_0xbc06('0x6b')));}_0x5cab8c[_0xbc06('0x68')](new Extension(_0x555977,0x4,_0xbc06('0x6c'),_0x5cd9d4[_0xbc06('0x59')]+','+'${EXTEN:'+(0x8+_0x949f06[_0xbc06('0x2e')][_0xbc06('0x3c')])+'}'+','+0x1));return _0x5cab8c;}function formatPrefixName(_0x387848){var _0xec34f3='_';for(var _0x5175e0=0x0;_0x5175e0<_0x387848[_0xbc06('0x3c')];_0x5175e0++){if(_0x387848[_0xbc06('0x6d')](_0x5175e0)=='-'){_0xec34f3+=_0x387848[_0xbc06('0x6d')](_0x5175e0);}else{_0xec34f3+='['+_0x387848[_0xbc06('0x6d')](_0x5175e0)+']';}}_0xec34f3+='.';return _0xec34f3;}exports[_0xbc06('0x26')]=function(_0xf447f3,_0x124a88,_0xb2bc0a){var _0x2c99e1=_0xf447f3['body'];_0x2c99e1[_0xbc06('0x62')]=_0xbc06('0x6e')+_0x2c99e1[_0xbc06('0x2e')]+'-';return db[_0xbc06('0x4f')]['transaction'](function(_0x556a6c){return db[_0xbc06('0x31')][_0xbc06('0x26')](_0x2c99e1,{'where':{'id':_0x2c99e1['id']},'transaction':_0x556a6c})[_0xbc06('0x27')](function(){return db[_0xbc06('0x65')][_0xbc06('0x2b')]({'where':{'VoicePrefixId':_0x2c99e1['id']},'transaction':_0x556a6c})['then'](function(){return db['VoiceExtension'][_0xbc06('0x4c')]({'where':{'id':_0x2c99e1[_0xbc06('0x52')]},'raw':!![]})['then'](function(_0x19bd0e){return createVoicePrefixExtensions(_0x2c99e1,_0x19bd0e,_0x556a6c);});});});})['then'](function(){return db[_0xbc06('0x31')]['findById'](_0x2c99e1['id']);})[_0xbc06('0x27')](respondWithResult(_0x124a88,null))[_0xbc06('0x4d')](handleError(_0x124a88,null));};exports[_0xbc06('0x6f')]=function(_0x2df05a,_0x424191,_0x164f12){return db['VoicePrefix']['find']({'where':{'id':_0x2df05a[_0xbc06('0x4a')]['id']}})['then'](handleEntityNotFound(_0x424191,null))[_0xbc06('0x27')](function(_0x5b8b1d){if(_0x5b8b1d){return _0x5b8b1d['addAgents'](_0x2df05a[_0xbc06('0x70')][_0xbc06('0x71')],_[_0xbc06('0x72')](_0x2df05a[_0xbc06('0x70')],['ids','id'])||{})[_0xbc06('0x73')](function(_0x1976fb){for(var _0x5f3204=0x0;_0x5f3204<_0x2df05a[_0xbc06('0x70')][_0xbc06('0x71')][_0xbc06('0x3c')];_0x5f3204+=0x1){socket[_0xbc06('0x74')](_0xbc06('0x75'),{'UserId':_0x2df05a[_0xbc06('0x70')]['ids'][_0x5f3204],'VoicePrefixId':_0x2df05a[_0xbc06('0x4a')]['id']});}return _0x1976fb;});}})[_0xbc06('0x27')](respondWithResult(_0x424191,null))[_0xbc06('0x4d')](handleError(_0x424191,null));};exports[_0xbc06('0x76')]=function(_0x434dad,_0x3e9199,_0xce4f7f){return db[_0xbc06('0x31')][_0xbc06('0x4c')]({'where':{'id':_0x434dad[_0xbc06('0x4a')]['id']}})[_0xbc06('0x27')](handleEntityNotFound(_0x3e9199,null))['then'](function(_0x365665){if(_0x365665){return _0x365665[_0xbc06('0x76')](_0x434dad[_0xbc06('0x36')]['ids'])['then'](function(){if(_[_0xbc06('0x77')](_0x434dad[_0xbc06('0x36')][_0xbc06('0x71')])){for(var _0x375227=0x0;_0x375227<_0x434dad['query']['ids'][_0xbc06('0x3c')];_0x375227+=0x1){socket[_0xbc06('0x74')](_0xbc06('0x78'),{'UserId':Number(_0x434dad['query']['ids'][_0x375227]),'VoicePrefixId':Number(_0x434dad[_0xbc06('0x4a')]['id'])});}}else{socket[_0xbc06('0x74')](_0xbc06('0x78'),{'UserId':Number(_0x434dad['query'][_0xbc06('0x71')]),'VoicePrefixId':Number(_0x434dad[_0xbc06('0x4a')]['id'])});}});}})[_0xbc06('0x27')](respondWithStatusCode(_0x3e9199,null))[_0xbc06('0x4d')](handleError(_0x3e9199,null));};exports[_0xbc06('0x79')]=function(_0x10c1a7,_0x401115,_0x530480){var _0x3bb083={};var _0x5deef4={};var _0x4ac7a3;var _0xb30295;return db[_0xbc06('0x31')]['findOne']({'where':{'id':_0x10c1a7[_0xbc06('0x4a')]['id']}})[_0xbc06('0x27')](handleEntityNotFound(_0x401115,null))['then'](function(_0x4cf496){if(_0x4cf496){_0x4ac7a3=_0x4cf496;_0x5deef4['model']=_[_0xbc06('0x37')](db[_0xbc06('0x7a')]['rawAttributes']);_0x5deef4[_0xbc06('0x36')]=_[_0xbc06('0x37')](_0x10c1a7[_0xbc06('0x36')]);_0x5deef4[_0xbc06('0x38')]=_[_0xbc06('0x39')](_0x5deef4[_0xbc06('0x35')],_0x5deef4[_0xbc06('0x36')]);_0x3bb083[_0xbc06('0x3a')]=_['intersection'](_0x5deef4[_0xbc06('0x35')],qs[_0xbc06('0x3b')](_0x10c1a7['query'][_0xbc06('0x3b')]));_0x3bb083[_0xbc06('0x3a')]=_0x3bb083[_0xbc06('0x3a')][_0xbc06('0x3c')]?_0x3bb083[_0xbc06('0x3a')]:_0x5deef4['model'];_0x3bb083[_0xbc06('0x7b')]=qs[_0xbc06('0x3f')](_0x10c1a7[_0xbc06('0x36')][_0xbc06('0x3f')]);_0x3bb083[_0xbc06('0x42')]=qs['filters'](_[_0xbc06('0x40')](_0x10c1a7[_0xbc06('0x36')],_0x5deef4['filters']));if(_0x10c1a7[_0xbc06('0x36')][_0xbc06('0x41')]){_0x3bb083[_0xbc06('0x42')]=_[_0xbc06('0x43')](_0x3bb083[_0xbc06('0x42')],{'$or':_[_0xbc06('0x30')](_0x3bb083[_0xbc06('0x3a')],function(_0x50cd18){var _0x5d846d={};_0x5d846d[_0x50cd18]={'$like':'%'+_0x10c1a7['query'][_0xbc06('0x41')]+'%'};return _0x5d846d;})});}_0x3bb083=_[_0xbc06('0x43')]({},_0x3bb083,_0x10c1a7[_0xbc06('0x4b')]);return _0x4ac7a3[_0xbc06('0x79')](_0x3bb083);}})[_0xbc06('0x27')](function(_0x4b783e){if(_0x4b783e){_0xb30295=_0x4b783e[_0xbc06('0x3c')];if(!_0x10c1a7[_0xbc06('0x36')][_0xbc06('0x3d')]('nolimit')){_0x3bb083[_0xbc06('0x22')]=qs[_0xbc06('0x22')](_0x10c1a7['query'][_0xbc06('0x22')]);_0x3bb083['offset']=qs[_0xbc06('0x21')](_0x10c1a7[_0xbc06('0x36')]['offset']);}return _0x4ac7a3[_0xbc06('0x79')](_0x3bb083);}})[_0xbc06('0x27')](function(_0x51a36f){if(_0x51a36f){return _0x51a36f?{'count':_0xb30295,'rows':_0x51a36f}:null;}})[_0xbc06('0x27')](respondWithResult(_0x401115,null))[_0xbc06('0x4d')](handleError(_0x401115,null));};
\ No newline at end of file
diff --git a/server/api/voicePrefix/voicePrefix.events.js b/server/api/voicePrefix/voicePrefix.events.js
index 53ca92e..77eae06 100644
--- a/server/api/voicePrefix/voicePrefix.events.js
+++ b/server/api/voicePrefix/voicePrefix.events.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x70e0=['emit','events','../../mysqldb','VoicePrefix','update','remove'];(function(_0x257544,_0x524c55){var _0x589d7d=function(_0x120396){while(--_0x120396){_0x257544['push'](_0x257544['shift']());}};_0x589d7d(++_0x524c55);}(_0x70e0,0x17b));var _0x070e=function(_0x2b4030,_0x3d69e3){_0x2b4030=_0x2b4030-0x0;var _0x218e34=_0x70e0[_0x2b4030];return _0x218e34;};'use strict';var EventEmitter=require(_0x070e('0x0'));var VoicePrefix=require(_0x070e('0x1'))['db'][_0x070e('0x2')];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x070e('0x3'),'afterDestroy':_0x070e('0x4')};function emitEvent(_0x277d32){return function(_0x2593e5,_0x5c90fc,_0x7bce9b){VoicePrefixEvents['emit'](_0x277d32+':'+_0x2593e5['id'],_0x2593e5);VoicePrefixEvents[_0x070e('0x5')](_0x277d32,_0x2593e5);_0x7bce9b(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoicePrefix['hook'](e,emitEvent(event));}}module['exports']=VoicePrefixEvents;
\ No newline at end of file
+var _0x9c44=['save','update','remove','emit','hasOwnProperty','hook','exports','VoicePrefix','setMaxListeners'];(function(_0x462dca,_0x5d50bf){var _0x2b994c=function(_0x2d6def){while(--_0x2d6def){_0x462dca['push'](_0x462dca['shift']());}};_0x2b994c(++_0x5d50bf);}(_0x9c44,0x178));var _0x49c4=function(_0x45d55e,_0x2fede3){_0x45d55e=_0x45d55e-0x0;var _0x29812a=_0x9c44[_0x45d55e];return _0x29812a;};'use strict';var EventEmitter=require('events');var VoicePrefix=require('../../mysqldb')['db'][_0x49c4('0x0')];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents[_0x49c4('0x1')](0x0);var events={'afterCreate':_0x49c4('0x2'),'afterUpdate':_0x49c4('0x3'),'afterDestroy':_0x49c4('0x4')};function emitEvent(_0x2ad237){return function(_0x4e0313,_0x4941f1,_0x41a183){VoicePrefixEvents['emit'](_0x2ad237+':'+_0x4e0313['id'],_0x4e0313);VoicePrefixEvents[_0x49c4('0x5')](_0x2ad237,_0x4e0313);_0x41a183(null);};}for(var e in events){if(events[_0x49c4('0x6')](e)){var event=events[e];VoicePrefix[_0x49c4('0x7')](e,emitEvent(event));}}module[_0x49c4('0x8')]=VoicePrefixEvents;
\ No newline at end of file
diff --git a/server/api/voicePrefix/voicePrefix.model.js b/server/api/voicePrefix/voicePrefix.model.js
index aaedbce..7b4b3f5 100644
--- a/server/api/voicePrefix/voicePrefix.model.js
+++ b/server/api/voicePrefix/voicePrefix.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x1eb3=['request-promise','path','rimraf','./voicePrefix.attributes','exports','VoicePrefix','voice_prefixes','lodash','util','../../config/logger','moment'];(function(_0x497b1e,_0x586379){var _0x3f72e1=function(_0x4c227d){while(--_0x4c227d){_0x497b1e['push'](_0x497b1e['shift']());}};_0x3f72e1(++_0x586379);}(_0x1eb3,0x1ca));var _0x31eb=function(_0x30b915,_0x50dc22){_0x30b915=_0x30b915-0x0;var _0x2cd1c9=_0x1eb3[_0x30b915];return _0x2cd1c9;};'use strict';var _=require(_0x31eb('0x0'));var util=require(_0x31eb('0x1'));var logger=require(_0x31eb('0x2'))('api');var moment=require(_0x31eb('0x3'));var BPromise=require('bluebird');var rp=require(_0x31eb('0x4'));var fs=require('fs');var path=require(_0x31eb('0x5'));var rimraf=require(_0x31eb('0x6'));var config=require('../../config/environment');var attributes=require(_0x31eb('0x7'));module[_0x31eb('0x8')]=function(_0x3db4c7,_0x1d462e){return _0x3db4c7['define'](_0x31eb('0x9'),attributes,{'tableName':_0x31eb('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x9460=['voice_prefixes','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./voicePrefix.attributes','exports','VoicePrefix'];(function(_0x465278,_0x234e8b){var _0x30525d=function(_0x4fc244){while(--_0x4fc244){_0x465278['push'](_0x465278['shift']());}};_0x30525d(++_0x234e8b);}(_0x9460,0x12c));var _0x0946=function(_0x2f13da,_0x220e35){_0x2f13da=_0x2f13da-0x0;var _0x1e1a01=_0x9460[_0x2f13da];return _0x1e1a01;};'use strict';var _=require('lodash');var util=require(_0x0946('0x0'));var logger=require(_0x0946('0x1'))(_0x0946('0x2'));var moment=require(_0x0946('0x3'));var BPromise=require(_0x0946('0x4'));var rp=require(_0x0946('0x5'));var fs=require('fs');var path=require(_0x0946('0x6'));var rimraf=require(_0x0946('0x7'));var config=require(_0x0946('0x8'));var attributes=require(_0x0946('0x9'));module[_0x0946('0xa')]=function(_0x523d62,_0x476a1b){return _0x523d62['define'](_0x0946('0xb'),attributes,{'tableName':_0x0946('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/voicePrefix/voicePrefix.rpc.js b/server/api/voicePrefix/voicePrefix.rpc.js
index 7aa7d35..bf3b6f6 100644
--- a/server/api/voicePrefix/voicePrefix.rpc.js
+++ b/server/api/voicePrefix/voicePrefix.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x16c1=['catch','lodash','util','bluebird','randomstring','../../mysqldb','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','request','then','VoicePrefix,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result'];(function(_0x185e11,_0x115fd9){var _0x49ea27=function(_0x58aa58){while(--_0x58aa58){_0x185e11['push'](_0x185e11['shift']());}};_0x49ea27(++_0x115fd9);}(_0x16c1,0x109));var _0x116c=function(_0x184901,_0x5a5dba){_0x184901=_0x184901-0x0;var _0x45f8a2=_0x16c1[_0x184901];return _0x45f8a2;};'use strict';var _=require(_0x116c('0x0'));var util=require(_0x116c('0x1'));var moment=require('moment');var BPromise=require(_0x116c('0x2'));var rs=require(_0x116c('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x116c('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x116c('0x5'));var jayson=require(_0x116c('0x6'));var client=jayson[_0x116c('0x7')][_0x116c('0x8')]({'port':0x232a});config[_0x116c('0x9')]=_[_0x116c('0xa')](config[_0x116c('0x9')],{'host':_0x116c('0xb'),'port':0x18eb});var socket=require(_0x116c('0xc'))(new Redis(config['redis']));require('./voicePrefix.socket')[_0x116c('0xd')](socket);function respondWithRpcPromise(_0x42d1ae,_0x59fa72,_0x4cf34c){return new BPromise(function(_0x510eb4,_0x5bd34d){return client[_0x116c('0xe')](_0x42d1ae,_0x4cf34c)[_0x116c('0xf')](function(_0x25a367){logger['info'](_0x116c('0x10'),_0x59fa72,_0x116c('0x11'));logger[_0x116c('0x12')]('VoicePrefix,\x20%s,\x20%s,\x20%s',_0x59fa72,_0x116c('0x11'),JSON[_0x116c('0x13')](_0x25a367));if(_0x25a367[_0x116c('0x14')]){if(_0x25a367[_0x116c('0x14')]['code']===0x1f4){logger[_0x116c('0x14')](_0x116c('0x10'),_0x59fa72,_0x25a367[_0x116c('0x14')][_0x116c('0x15')]);return _0x5bd34d(_0x25a367[_0x116c('0x14')][_0x116c('0x15')]);}logger['error'](_0x116c('0x10'),_0x59fa72,_0x25a367[_0x116c('0x14')]['message']);return _0x510eb4(_0x25a367[_0x116c('0x14')][_0x116c('0x15')]);}else{logger['info'](_0x116c('0x10'),_0x59fa72,_0x116c('0x11'));_0x510eb4(_0x25a367[_0x116c('0x16')][_0x116c('0x15')]);}})[_0x116c('0x17')](function(_0x4acb10){logger[_0x116c('0x14')]('VoicePrefix,\x20%s,\x20%s',_0x59fa72,_0x4acb10);_0x5bd34d(_0x4acb10);});});}
\ No newline at end of file
+var _0x1805=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./voicePrefix.socket','register','request','then','info','VoicePrefix,\x20%s,\x20%s','request\x20sent','debug','VoicePrefix,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','bluebird'];(function(_0x477a4f,_0x4ccf31){var _0xeb2557=function(_0x525899){while(--_0x525899){_0x477a4f['push'](_0x477a4f['shift']());}};_0xeb2557(++_0x4ccf31);}(_0x1805,0x1bf));var _0x5180=function(_0x15c3c9,_0x25a4ae){_0x15c3c9=_0x15c3c9-0x0;var _0x5b792e=_0x1805[_0x15c3c9];return _0x5b792e;};'use strict';var _=require('lodash');var util=require(_0x5180('0x0'));var moment=require(_0x5180('0x1'));var BPromise=require(_0x5180('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5180('0x3'));var db=require(_0x5180('0x4'))['db'];var utils=require(_0x5180('0x5'));var logger=require(_0x5180('0x6'))(_0x5180('0x7'));var config=require(_0x5180('0x8'));var jayson=require(_0x5180('0x9'));var client=jayson[_0x5180('0xa')][_0x5180('0xb')]({'port':0x232a});config[_0x5180('0xc')]=_[_0x5180('0xd')](config[_0x5180('0xc')],{'host':_0x5180('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x5180('0xc')]));require(_0x5180('0xf'))[_0x5180('0x10')](socket);function respondWithRpcPromise(_0x314759,_0x4c3127,_0x71c567){return new BPromise(function(_0x5544a9,_0x43eab5){return client[_0x5180('0x11')](_0x314759,_0x71c567)[_0x5180('0x12')](function(_0x5c9cf0){logger[_0x5180('0x13')](_0x5180('0x14'),_0x4c3127,_0x5180('0x15'));logger[_0x5180('0x16')](_0x5180('0x17'),_0x4c3127,_0x5180('0x15'),JSON[_0x5180('0x18')](_0x5c9cf0));if(_0x5c9cf0['error']){if(_0x5c9cf0[_0x5180('0x19')][_0x5180('0x1a')]===0x1f4){logger['error']('VoicePrefix,\x20%s,\x20%s',_0x4c3127,_0x5c9cf0[_0x5180('0x19')][_0x5180('0x1b')]);return _0x43eab5(_0x5c9cf0[_0x5180('0x19')][_0x5180('0x1b')]);}logger[_0x5180('0x19')](_0x5180('0x14'),_0x4c3127,_0x5c9cf0[_0x5180('0x19')]['message']);return _0x5544a9(_0x5c9cf0['error'][_0x5180('0x1b')]);}else{logger['info'](_0x5180('0x14'),_0x4c3127,_0x5180('0x15'));_0x5544a9(_0x5c9cf0[_0x5180('0x1c')]['message']);}})[_0x5180('0x1d')](function(_0x1e54e3){logger[_0x5180('0x19')]('VoicePrefix,\x20%s,\x20%s',_0x4c3127,_0x1e54e3);_0x43eab5(_0x1e54e3);});});}
\ No newline at end of file
diff --git a/server/api/voicePrefix/voicePrefix.socket.js b/server/api/voicePrefix/voicePrefix.socket.js
index 9abc9bc..59ab155 100644
--- a/server/api/voicePrefix/voicePrefix.socket.js
+++ b/server/api/voicePrefix/voicePrefix.socket.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xca3f=['removeListener','register','length','voicePrefix:','./voicePrefix.events','update','emit'];(function(_0xded0ea,_0x50b8f3){var _0xe85630=function(_0x4da760){while(--_0x4da760){_0xded0ea['push'](_0xded0ea['shift']());}};_0xe85630(++_0x50b8f3);}(_0xca3f,0x123));var _0xfca3=function(_0x458837,_0x5ca8af){_0x458837=_0x458837-0x0;var _0x2d4c57=_0xca3f[_0x458837];return _0x2d4c57;};'use strict';var VoicePrefixEvents=require(_0xfca3('0x0'));var events=['save','remove',_0xfca3('0x1')];function createListener(_0x4856b5,_0x5536b3){return function(_0x278cb6){_0x5536b3[_0xfca3('0x2')](_0x4856b5,_0x278cb6);};}function removeListener(_0x318663,_0x2d4cdc){return function(){VoicePrefixEvents[_0xfca3('0x3')](_0x318663,_0x2d4cdc);};}exports[_0xfca3('0x4')]=function(_0x10ae94){for(var _0x3cd495=0x0,_0x486f30=events[_0xfca3('0x5')];_0x3cd495<_0x486f30;_0x3cd495++){var _0x322f3e=events[_0x3cd495];var _0x4d99c1=createListener(_0xfca3('0x6')+_0x322f3e,_0x10ae94);VoicePrefixEvents['on'](_0x322f3e,_0x4d99c1);}};
\ No newline at end of file
+var _0xaa95=['removeListener','register','length','save','update','emit'];(function(_0x16d10b,_0x5182fc){var _0xf9ab16=function(_0x1e9307){while(--_0x1e9307){_0x16d10b['push'](_0x16d10b['shift']());}};_0xf9ab16(++_0x5182fc);}(_0xaa95,0x135));var _0x5aa9=function(_0x202712,_0x74544a){_0x202712=_0x202712-0x0;var _0x5340aa=_0xaa95[_0x202712];return _0x5340aa;};'use strict';var VoicePrefixEvents=require('./voicePrefix.events');var events=[_0x5aa9('0x0'),'remove',_0x5aa9('0x1')];function createListener(_0x17c45e,_0x277f09){return function(_0x3a1b20){_0x277f09[_0x5aa9('0x2')](_0x17c45e,_0x3a1b20);};}function removeListener(_0x31565e,_0x2bfb67){return function(){VoicePrefixEvents[_0x5aa9('0x3')](_0x31565e,_0x2bfb67);};}exports[_0x5aa9('0x4')]=function(_0x38a466){for(var _0x5dac28=0x0,_0x28052f=events[_0x5aa9('0x5')];_0x5dac28<_0x28052f;_0x5dac28++){var _0x562071=events[_0x5dac28];var _0x5aaa20=createListener('voicePrefix:'+_0x562071,_0x38a466);VoicePrefixEvents['on'](_0x562071,_0x5aaa20);}};
\ No newline at end of file
diff --git a/server/api/voiceQueue/index.js b/server/api/voiceQueue/index.js
index 6662db7..913518e 100644
--- a/server/api/voiceQueue/index.js
+++ b/server/api/voiceQueue/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x3ef0=['../../config/environment','./voiceQueue.controller','get','isAuthenticated','index','show','/:id/hoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','getHopperFinals','/:id/hopper_black','getHopperBlacks','/:id/teams','getTeams','getAgents','/:id/blacklists','getBlackLists','post','create','/:id/clone','clone','addTeams','/:id/users','/:id/lists','addLists','addBlackLists','put','update','delete','/:id','destroy','removeTeams','removeLists','removeBlackLists','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x38302e,_0x312a11){var _0x17a195=function(_0x1a5f1d){while(--_0x1a5f1d){_0x38302e['push'](_0x38302e['shift']());}};_0x17a195(++_0x312a11);}(_0x3ef0,0x1d2));var _0x03ef=function(_0x53f06a,_0x5eebe8){_0x53f06a=_0x53f06a-0x0;var _0x33d4eb=_0x3ef0[_0x53f06a];return _0x33d4eb;};'use strict';var multer=require(_0x03ef('0x0'));var util=require(_0x03ef('0x1'));var path=require(_0x03ef('0x2'));var timeout=require(_0x03ef('0x3'));var express=require('express');var router=express[_0x03ef('0x4')]();var auth=require(_0x03ef('0x5'));var interaction=require(_0x03ef('0x6'));var config=require(_0x03ef('0x7'));var controller=require(_0x03ef('0x8'));router[_0x03ef('0x9')]('/',auth[_0x03ef('0xa')](),controller[_0x03ef('0xb')]);router[_0x03ef('0x9')]('/:id',auth[_0x03ef('0xa')](),controller[_0x03ef('0xc')]);router[_0x03ef('0x9')](_0x03ef('0xd'),auth[_0x03ef('0xa')](),controller['getHoppers']);router[_0x03ef('0x9')](_0x03ef('0xe'),auth[_0x03ef('0xa')](),controller[_0x03ef('0xf')]);router['get'](_0x03ef('0x10'),auth[_0x03ef('0xa')](),controller[_0x03ef('0x11')]);router[_0x03ef('0x9')](_0x03ef('0x12'),auth['isAuthenticated'](),controller[_0x03ef('0x13')]);router[_0x03ef('0x9')](_0x03ef('0x14'),auth[_0x03ef('0xa')](),controller[_0x03ef('0x15')]);router[_0x03ef('0x9')]('/:id/users',auth[_0x03ef('0xa')](),controller[_0x03ef('0x16')]);router[_0x03ef('0x9')]('/:id/members',auth[_0x03ef('0xa')](),controller['getMembers']);router['get']('/:id/lists',auth['isAuthenticated'](),controller['getLists']);router[_0x03ef('0x9')](_0x03ef('0x17'),auth['isAuthenticated'](),controller[_0x03ef('0x18')]);router[_0x03ef('0x19')]('/',auth[_0x03ef('0xa')](),controller[_0x03ef('0x1a')]);router[_0x03ef('0x19')](_0x03ef('0x1b'),auth['isAuthenticated'](),controller[_0x03ef('0x1c')]);router[_0x03ef('0x19')](_0x03ef('0x14'),auth[_0x03ef('0xa')](),controller[_0x03ef('0x1d')]);router[_0x03ef('0x19')](_0x03ef('0x1e'),auth[_0x03ef('0xa')](),controller['addAgents']);router[_0x03ef('0x19')](_0x03ef('0x1f'),auth[_0x03ef('0xa')](),controller[_0x03ef('0x20')]);router[_0x03ef('0x19')](_0x03ef('0x17'),auth[_0x03ef('0xa')](),controller[_0x03ef('0x21')]);router[_0x03ef('0x22')]('/:id',auth[_0x03ef('0xa')](),controller[_0x03ef('0x23')]);router[_0x03ef('0x24')](_0x03ef('0x25'),auth[_0x03ef('0xa')](),controller[_0x03ef('0x26')]);router['delete'](_0x03ef('0x14'),auth['isAuthenticated'](),controller[_0x03ef('0x27')]);router[_0x03ef('0x24')](_0x03ef('0x1e'),auth['isAuthenticated'](),controller['removeAgents']);router[_0x03ef('0x24')](_0x03ef('0x1f'),auth[_0x03ef('0xa')](),controller[_0x03ef('0x28')]);router[_0x03ef('0x24')](_0x03ef('0x17'),auth[_0x03ef('0xa')](),controller[_0x03ef('0x29')]);module[_0x03ef('0x2a')]=router;
\ No newline at end of file
+var _0x3076=['./voiceQueue.controller','get','isAuthenticated','/:id','show','getHoppers','getHopperHistories','getHopperFinals','getHopperBlacks','/:id/teams','getTeams','/:id/users','getAgents','/:id/members','getMembers','/:id/lists','getLists','/:id/blacklists','getBlackLists','post','create','/:id/clone','addAgents','put','delete','destroy','removeTeams','removeAgents','removeBlackLists','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x4c113d,_0x1ab597){var _0x258bc4=function(_0x16c818){while(--_0x16c818){_0x4c113d['push'](_0x4c113d['shift']());}};_0x258bc4(++_0x1ab597);}(_0x3076,0x119));var _0x6307=function(_0x13fef4,_0x5b5610){_0x13fef4=_0x13fef4-0x0;var _0x518aef=_0x3076[_0x13fef4];return _0x518aef;};'use strict';var multer=require(_0x6307('0x0'));var util=require(_0x6307('0x1'));var path=require('path');var timeout=require(_0x6307('0x2'));var express=require(_0x6307('0x3'));var router=express[_0x6307('0x4')]();var auth=require(_0x6307('0x5'));var interaction=require(_0x6307('0x6'));var config=require('../../config/environment');var controller=require(_0x6307('0x7'));router[_0x6307('0x8')]('/',auth[_0x6307('0x9')](),controller['index']);router['get'](_0x6307('0xa'),auth[_0x6307('0x9')](),controller[_0x6307('0xb')]);router[_0x6307('0x8')]('/:id/hoppers',auth[_0x6307('0x9')](),controller[_0x6307('0xc')]);router[_0x6307('0x8')]('/:id/hopper_histories',auth[_0x6307('0x9')](),controller[_0x6307('0xd')]);router[_0x6307('0x8')]('/:id/hopper_finals',auth['isAuthenticated'](),controller[_0x6307('0xe')]);router[_0x6307('0x8')]('/:id/hopper_black',auth[_0x6307('0x9')](),controller[_0x6307('0xf')]);router[_0x6307('0x8')](_0x6307('0x10'),auth[_0x6307('0x9')](),controller[_0x6307('0x11')]);router[_0x6307('0x8')](_0x6307('0x12'),auth[_0x6307('0x9')](),controller[_0x6307('0x13')]);router['get'](_0x6307('0x14'),auth[_0x6307('0x9')](),controller[_0x6307('0x15')]);router[_0x6307('0x8')](_0x6307('0x16'),auth[_0x6307('0x9')](),controller[_0x6307('0x17')]);router['get'](_0x6307('0x18'),auth[_0x6307('0x9')](),controller[_0x6307('0x19')]);router[_0x6307('0x1a')]('/',auth['isAuthenticated'](),controller[_0x6307('0x1b')]);router[_0x6307('0x1a')](_0x6307('0x1c'),auth['isAuthenticated'](),controller['clone']);router['post']('/:id/teams',auth[_0x6307('0x9')](),controller['addTeams']);router[_0x6307('0x1a')]('/:id/users',auth[_0x6307('0x9')](),controller[_0x6307('0x1d')]);router[_0x6307('0x1a')](_0x6307('0x16'),auth[_0x6307('0x9')](),controller['addLists']);router[_0x6307('0x1a')]('/:id/blacklists',auth[_0x6307('0x9')](),controller['addBlackLists']);router[_0x6307('0x1e')](_0x6307('0xa'),auth[_0x6307('0x9')](),controller['update']);router[_0x6307('0x1f')](_0x6307('0xa'),auth[_0x6307('0x9')](),controller[_0x6307('0x20')]);router[_0x6307('0x1f')](_0x6307('0x10'),auth[_0x6307('0x9')](),controller[_0x6307('0x21')]);router[_0x6307('0x1f')]('/:id/users',auth[_0x6307('0x9')](),controller[_0x6307('0x22')]);router[_0x6307('0x1f')](_0x6307('0x16'),auth[_0x6307('0x9')](),controller['removeLists']);router[_0x6307('0x1f')]('/:id/blacklists',auth['isAuthenticated'](),controller[_0x6307('0x23')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/voiceQueue/voiceQueue.attributes.js b/server/api/voiceQueue/voiceQueue.attributes.js
index 46eca05..f9ea7ca 100644
--- a/server/api/voiceQueue/voiceQueue.attributes.js
+++ b/server/api/voiceQueue/voiceQueue.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xa9e0=['getDataValue','booked','roundrobin','progressive','predictive','power','INTEGER','yes','all','once','TEXT','periodic_announce','join','split','joinempty','leavewhenempty','acw','wrapuptime','BOOLEAN','Active/Disactive\x20Campaign','preview','Dial\x20Method.','UNSIGNED','Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.','Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).','agentBusyFactor','Only\x20for\x20predictive\x20method.','FLOAT','Predictive\x20Optimization\x20Percentage\x20(min:\x201,\x20max:\x2095)','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','tTxX','https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Application_Queue','Queue\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','onlyIfOpen','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','#RecallMe\x20Timeout\x20(min:1)','ASC','DESC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDisposition','sequelize','exports','STRING','inbound','default','ENUM','leastrecent','fewestcalls','random','wrandom','setDataValue','strategy','rrmemory'];(function(_0xf10ab2,_0x4139fa){var _0x4c6629=function(_0x1be701){while(--_0x1be701){_0xf10ab2['push'](_0xf10ab2['shift']());}};_0x4c6629(++_0x4139fa);}(_0xa9e0,0x123));var _0x0a9e=function(_0x92c450,_0x41f1e3){_0x92c450=_0x92c450-0x0;var _0x2a9599=_0xa9e0[_0x92c450];return _0x2a9599;};'use strict';var Sequelize=require(_0x0a9e('0x0'));module[_0x0a9e('0x1')]={'name':{'type':Sequelize[_0x0a9e('0x2')],'allowNull':![],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize['ENUM'](_0x0a9e('0x3'),'outbound'),'allowNull':![],'defaultValue':_0x0a9e('0x3')},'musiconhold':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':_0x0a9e('0x4')},'announce':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':''},'strategy':{'type':Sequelize[_0x0a9e('0x5')]('rr','ringall',_0x0a9e('0x6'),_0x0a9e('0x7'),_0x0a9e('0x8'),'rrmemory','linear',_0x0a9e('0x9'),'rrordered'),'allowNull':![],'defaultValue':'ringall','set':function(_0x39753a){this[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x39753a?_0x39753a:_0x0a9e('0xc'));},'get':function(){var _0xfeb75b=this[_0x0a9e('0xd')]('type');var _0x50dfb2=this['getDataValue']('dialMethod');var _0x273d4d=this[_0x0a9e('0xd')](_0x0a9e('0xb'));if(_0xfeb75b===_0x0a9e('0x3')){return _0x273d4d;}if(_0x50dfb2===_0x0a9e('0xe')&&_0x273d4d===_0x0a9e('0xc')||_0x50dfb2==='booked'&&_0x273d4d===_0x0a9e('0xf')){return _0x273d4d;}if(_0x50dfb2===_0x0a9e('0x10')||_0x50dfb2===_0x0a9e('0x11')||_0x50dfb2===_0x0a9e('0x12')){return _0x273d4d;}return null;}},'servicelevel':{'type':Sequelize[_0x0a9e('0x13')](0xb),'defaultValue':0x0},'context':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize['INTEGER'](0xb)},'timeout':{'type':Sequelize[_0x0a9e('0x13')](0xb),'defaultValue':0xf},'retry':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize[_0x0a9e('0x2')]},'weight':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize[_0x0a9e('0x13')](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize[_0x0a9e('0x5')]('yes','no'),'defaultValue':_0x0a9e('0x14')},'autopause':{'type':Sequelize['ENUM'](_0x0a9e('0x14'),'no',_0x0a9e('0x15')),'defaultValue':'no'},'autopausedelay':{'type':Sequelize[_0x0a9e('0x13')](0xb)},'autopausebusy':{'type':Sequelize[_0x0a9e('0x5')](_0x0a9e('0x14'),'no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize[_0x0a9e('0x5')](_0x0a9e('0x14'),'no'),'defaultValue':'no'},'maxlen':{'type':Sequelize[_0x0a9e('0x13')](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize[_0x0a9e('0x5')](_0x0a9e('0x14'),'no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize[_0x0a9e('0x5')](_0x0a9e('0x14'),'no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize['ENUM'](_0x0a9e('0x14'),'no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize[_0x0a9e('0x5')]('yes','no'),'defaultValue':'no'},'membermacro':{'type':Sequelize[_0x0a9e('0x2')],'allowNull':!![]},'membergosub':{'type':Sequelize['STRING'],'allowNull':!![]},'announce_frequency':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize[_0x0a9e('0x13')](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize[_0x0a9e('0x13')](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize[_0x0a9e('0x5')](_0x0a9e('0x14'),'no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize['ENUM'](_0x0a9e('0x14'),'no'),'defaultValue':_0x0a9e('0x14')},'announce_holdtime':{'type':Sequelize[_0x0a9e('0x5')](_0x0a9e('0x14'),'no',_0x0a9e('0x16')),'defaultValue':'no'},'announce_position':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize[_0x0a9e('0x5')]('yes','no')},'announce_position_limit':{'type':Sequelize['INTEGER'](0xb)},'announce_round_seconds':{'type':Sequelize[_0x0a9e('0x5')]('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':''},'monitor_type':{'type':Sequelize[_0x0a9e('0x2')]},'queue_youarenext':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':null},'queue_thereare':{'type':Sequelize['STRING'],'defaultValue':null},'queue_callswaiting':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':null},'queue_holdtime':{'type':Sequelize['STRING'],'defaultValue':null},'queue_minute':{'type':Sequelize[_0x0a9e('0x2')],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize['STRING'],'defaultValue':null},'queue_seconds':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':null},'queue_thankyou':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':null},'queue_reporthold':{'type':Sequelize[_0x0a9e('0x2')]},'queue_quantity1':{'type':Sequelize[_0x0a9e('0x2')]},'queue_quantity2':{'type':Sequelize[_0x0a9e('0x2')]},'queue_periodic_announce':{'type':Sequelize[_0x0a9e('0x2')]},'queue_less_than':{'type':Sequelize[_0x0a9e('0x2')]},'periodic_announce':{'type':Sequelize[_0x0a9e('0x17')],'set':function(_0x5a101a){this[_0x0a9e('0xa')](_0x0a9e('0x18'),_0x5a101a?_0x5a101a[_0x0a9e('0x19')](','):[]);},'get':function(){return this[_0x0a9e('0xd')]('periodic_announce')?this[_0x0a9e('0xd')](_0x0a9e('0x18'))[_0x0a9e('0x1a')](','):[];}},'joinempty':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':_0x0a9e('0x14'),'set':function(_0x563b45){this[_0x0a9e('0xa')](_0x0a9e('0x1b'),_0x563b45?_0x563b45[_0x0a9e('0x19')](','):undefined);},'get':function(){return this['getDataValue'](_0x0a9e('0x1b'))?this['getDataValue'](_0x0a9e('0x1b'))[_0x0a9e('0x1a')](','):undefined;}},'leavewhenempty':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':'no','set':function(_0x33bdb7){this[_0x0a9e('0xa')]('leavewhenempty',_0x33bdb7?_0x33bdb7[_0x0a9e('0x19')](','):undefined);},'get':function(){return this[_0x0a9e('0xd')](_0x0a9e('0x1c'))?this[_0x0a9e('0xd')](_0x0a9e('0x1c'))[_0x0a9e('0x1a')](','):undefined;}},'reportholdtime':{'type':Sequelize[_0x0a9e('0x5')](_0x0a9e('0x14'),'no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize['ENUM'](_0x0a9e('0x14'),'no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize[_0x0a9e('0x5')](_0x0a9e('0x14'),'no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize[_0x0a9e('0x2')]},'description':{'type':Sequelize[_0x0a9e('0x2')]},'acw':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'set':function(_0x191e91){this[_0x0a9e('0xa')](_0x0a9e('0x1d'),_0x191e91);if(_0x191e91){if(this[_0x0a9e('0xd')]('wrapuptime')<0x2){this['setDataValue'](_0x0a9e('0x1e'),0x2);}}}},'acwTimeout':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize[_0x0a9e('0x1f')],'defaultValue':0x0,'comment':_0x0a9e('0x20')},'dialMethod':{'type':Sequelize[_0x0a9e('0x5')](_0x0a9e('0x21'),'progressive',_0x0a9e('0x12'),_0x0a9e('0x11'),_0x0a9e('0xe')),'defaultValue':'progressive','comment':_0x0a9e('0x22')},'dialLimitChannel':{'type':Sequelize[_0x0a9e('0x13')](0x4)[_0x0a9e('0x23')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':'Max\x209999\x20channels,\x200\x20means\x20unlimited.'},'dialLimitQueue':{'type':Sequelize['INTEGER'](0x4)[_0x0a9e('0x23')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x0a9e('0x24')},'dialPowerLevel':{'type':Sequelize['FLOAT'](0x2)[_0x0a9e('0x23')],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':_0x0a9e('0x25')},'dialPredictiveOptimization':{'type':Sequelize[_0x0a9e('0x5')](_0x0a9e('0x26'),'dropRate'),'defaultValue':'dropRate','comment':_0x0a9e('0x27')},'dialPredictiveOptimizationPercentage':{'type':Sequelize[_0x0a9e('0x28')](0x2)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':_0x0a9e('0x29')},'dialPredictiveInterval':{'type':Sequelize[_0x0a9e('0x13')](0x3)[_0x0a9e('0x23')],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':'Interval\x20Predictive\x20Minutes\x20(min:5\x20max:30)'},'dialOriginateCallerIdName':{'type':Sequelize[_0x0a9e('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x0a9e('0x2')]},'dialOriginateTimeout':{'type':Sequelize[_0x0a9e('0x13')](0x3)[_0x0a9e('0x23')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0a9e('0x2a')},'dialQueueOptions':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':_0x0a9e('0x2b'),'comment':_0x0a9e('0x2c')},'dialQueueTimeout':{'type':Sequelize[_0x0a9e('0x13')](0x3)[_0x0a9e('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0a9e('0x2d')},'dialQueueProject':{'type':Sequelize[_0x0a9e('0x2')],'comment':_0x0a9e('0x2e')},'dialCongestionMaxRetry':{'type':Sequelize[_0x0a9e('0x13')](0x3)[_0x0a9e('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Congestion\x20Retry\x20(min:1,\x20max:999)'},'dialCongestionRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x0a9e('0x23')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0a9e('0x2f')},'dialBusyMaxRetry':{'type':Sequelize[_0x0a9e('0x13')](0x3)[_0x0a9e('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0a9e('0x30')},'dialBusyRetryFrequency':{'type':Sequelize[_0x0a9e('0x13')](0x5)[_0x0a9e('0x23')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0a9e('0x31')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x0a9e('0x13')](0x3)[_0x0a9e('0x23')],'defaultValue':0x3,'comment':_0x0a9e('0x32')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x0a9e('0x13')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0a9e('0x33')},'dialGlobalMaxRetry':{'type':Sequelize[_0x0a9e('0x13')](0x3)[_0x0a9e('0x23')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x0a9e('0x34')},'dialTimezone':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':_0x0a9e('0x35')},'dialPrefix':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize['ENUM'](_0x0a9e('0x36'),'never',_0x0a9e('0x37')),'defaultValue':_0x0a9e('0x36')},'dialAMDActive':{'type':Sequelize[_0x0a9e('0x1f')],'defaultValue':0x0,'comment':'Active/Disactive\x20AMD'},'dialAMDInitialSilence':{'type':Sequelize[_0x0a9e('0x13')](0x9)[_0x0a9e('0x23')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x0a9e('0x38')},'dialAMDGreeting':{'type':Sequelize[_0x0a9e('0x13')](0x9)[_0x0a9e('0x23')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x0a9e('0x39')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x0a9e('0x13')](0x9)['UNSIGNED'],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x0a9e('0x3a')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x0a9e('0x13')](0x9)[_0x0a9e('0x23')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x0a9e('0x3b')},'dialAMDMinWordLength':{'type':Sequelize[_0x0a9e('0x13')](0x9)[_0x0a9e('0x23')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x0a9e('0x3c')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x0a9e('0x13')](0x9)[_0x0a9e('0x23')],'defaultValue':0x32,'validate':{'min':0x0},'comment':'#AMD\x20Between\x20Words\x20Silence'},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x0a9e('0x13')](0x9)[_0x0a9e('0x23')],'defaultValue':0x3,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Number\x20Of\x20Words'},'dialAMDSilenceThreshold':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x0a9e('0x3d')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x0a9e('0x13')](0x9)[_0x0a9e('0x23')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x0a9e('0x3e')},'dialRecallMeTimeout':{'type':Sequelize[_0x0a9e('0x13')](0x5)[_0x0a9e('0x23')],'validate':{'min':0x1},'defaultValue':0x1e,'comment':_0x0a9e('0x3f')},'dialRecallInQueue':{'type':Sequelize[_0x0a9e('0x1f')],'defaultValue':0x0,'comment':'Active/Disactive\x20Recall\x20In\x20Queue'},'dialOrderByScheduledAt':{'type':Sequelize['ENUM']('DESC',_0x0a9e('0x40')),'defaultValue':_0x0a9e('0x41')},'dialQueueProject2':{'type':Sequelize[_0x0a9e('0x2')],'comment':'AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)'},'dialAgiAfterHangupClient':{'type':Sequelize[_0x0a9e('0x1f')],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize[_0x0a9e('0x1f')],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x0a9e('0x42')},'dialCutDigit':{'type':Sequelize['INTEGER'](0x3)[_0x0a9e('0x23')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Cut\x20Digit\x20(min:1,\x20max:15)'},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x0a9e('0x13')](0x3)[_0x0a9e('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0a9e('0x43')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x0a9e('0x23')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0a9e('0x44')},'dialDropMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0a9e('0x45')},'dialDropRetryFrequency':{'type':Sequelize[_0x0a9e('0x13')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0a9e('0x46')},'dialAbandonedMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x0a9e('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Abandoned\x20Retry\x20(min:1,\x20max:999)'},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x0a9e('0x13')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialMachineMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x0a9e('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Machine\x20Retry\x20(min:1,\x20max:999)'},'dialMachineRetryFrequency':{'type':Sequelize[_0x0a9e('0x13')](0x5)[_0x0a9e('0x23')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0a9e('0x47')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x0a9e('0x13')](0x3)[_0x0a9e('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0a9e('0x48')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x0a9e('0x13')](0x5)[_0x0a9e('0x23')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'mandatoryDispositionPauseId':{'type':Sequelize[_0x0a9e('0x13')],'allowNull':!![],'comment':_0x0a9e('0x49')},'mandatoryDisposition':{'type':Sequelize[_0x0a9e('0x1f')],'defaultValue':![],'comment':_0x0a9e('0x4a'),'set':function(_0xb83dfd){if(!_0xb83dfd)this[_0x0a9e('0xa')]('mandatoryDispositionPauseId',null);this[_0x0a9e('0xa')](_0x0a9e('0x4b'),_0xb83dfd);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize['INTEGER'](0x3)[_0x0a9e('0x23')],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize['INTEGER'](0x3)[_0x0a9e('0x23')],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}}};
\ No newline at end of file
+var _0xa9e0=['getDataValue','booked','roundrobin','progressive','predictive','power','INTEGER','yes','all','once','TEXT','periodic_announce','join','split','joinempty','leavewhenempty','acw','wrapuptime','BOOLEAN','Active/Disactive\x20Campaign','preview','Dial\x20Method.','UNSIGNED','Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.','Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).','agentBusyFactor','Only\x20for\x20predictive\x20method.','FLOAT','Predictive\x20Optimization\x20Percentage\x20(min:\x201,\x20max:\x2095)','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','tTxX','https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Application_Queue','Queue\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','onlyIfOpen','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','#RecallMe\x20Timeout\x20(min:1)','ASC','DESC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDisposition','sequelize','exports','STRING','inbound','default','ENUM','leastrecent','fewestcalls','random','wrandom','setDataValue','strategy','rrmemory'];(function(_0x177307,_0x1a1e9a){var _0x254c24=function(_0x5aa40a){while(--_0x5aa40a){_0x177307['push'](_0x177307['shift']());}};_0x254c24(++_0x1a1e9a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4b7b62,_0x4920a9){_0x4b7b62=_0x4b7b62-0x0;var _0x2280df=_0xa9e0[_0x4b7b62];return _0x2280df;};'use strict';var Sequelize=require(_0x0a9e('0x0'));module[_0x0a9e('0x1')]={'name':{'type':Sequelize[_0x0a9e('0x2')],'allowNull':![],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize['ENUM'](_0x0a9e('0x3'),'outbound'),'allowNull':![],'defaultValue':_0x0a9e('0x3')},'musiconhold':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':_0x0a9e('0x4')},'announce':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':''},'strategy':{'type':Sequelize[_0x0a9e('0x5')]('rr','ringall',_0x0a9e('0x6'),_0x0a9e('0x7'),_0x0a9e('0x8'),'rrmemory','linear',_0x0a9e('0x9'),'rrordered'),'allowNull':![],'defaultValue':'ringall','set':function(_0x39753a){this[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x39753a?_0x39753a:_0x0a9e('0xc'));},'get':function(){var _0xfeb75b=this[_0x0a9e('0xd')]('type');var _0x50dfb2=this['getDataValue']('dialMethod');var _0x273d4d=this[_0x0a9e('0xd')](_0x0a9e('0xb'));if(_0xfeb75b===_0x0a9e('0x3')){return _0x273d4d;}if(_0x50dfb2===_0x0a9e('0xe')&&_0x273d4d===_0x0a9e('0xc')||_0x50dfb2==='booked'&&_0x273d4d===_0x0a9e('0xf')){return _0x273d4d;}if(_0x50dfb2===_0x0a9e('0x10')||_0x50dfb2===_0x0a9e('0x11')||_0x50dfb2===_0x0a9e('0x12')){return _0x273d4d;}return null;}},'servicelevel':{'type':Sequelize[_0x0a9e('0x13')](0xb),'defaultValue':0x0},'context':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize['INTEGER'](0xb)},'timeout':{'type':Sequelize[_0x0a9e('0x13')](0xb),'defaultValue':0xf},'retry':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize[_0x0a9e('0x2')]},'weight':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize[_0x0a9e('0x13')](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize[_0x0a9e('0x5')]('yes','no'),'defaultValue':_0x0a9e('0x14')},'autopause':{'type':Sequelize['ENUM'](_0x0a9e('0x14'),'no',_0x0a9e('0x15')),'defaultValue':'no'},'autopausedelay':{'type':Sequelize[_0x0a9e('0x13')](0xb)},'autopausebusy':{'type':Sequelize[_0x0a9e('0x5')](_0x0a9e('0x14'),'no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize[_0x0a9e('0x5')](_0x0a9e('0x14'),'no'),'defaultValue':'no'},'maxlen':{'type':Sequelize[_0x0a9e('0x13')](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize[_0x0a9e('0x5')](_0x0a9e('0x14'),'no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize[_0x0a9e('0x5')](_0x0a9e('0x14'),'no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize['ENUM'](_0x0a9e('0x14'),'no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize[_0x0a9e('0x5')]('yes','no'),'defaultValue':'no'},'membermacro':{'type':Sequelize[_0x0a9e('0x2')],'allowNull':!![]},'membergosub':{'type':Sequelize['STRING'],'allowNull':!![]},'announce_frequency':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize[_0x0a9e('0x13')](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize[_0x0a9e('0x13')](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize[_0x0a9e('0x5')](_0x0a9e('0x14'),'no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize['ENUM'](_0x0a9e('0x14'),'no'),'defaultValue':_0x0a9e('0x14')},'announce_holdtime':{'type':Sequelize[_0x0a9e('0x5')](_0x0a9e('0x14'),'no',_0x0a9e('0x16')),'defaultValue':'no'},'announce_position':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize[_0x0a9e('0x5')]('yes','no')},'announce_position_limit':{'type':Sequelize['INTEGER'](0xb)},'announce_round_seconds':{'type':Sequelize[_0x0a9e('0x5')]('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':''},'monitor_type':{'type':Sequelize[_0x0a9e('0x2')]},'queue_youarenext':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':null},'queue_thereare':{'type':Sequelize['STRING'],'defaultValue':null},'queue_callswaiting':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':null},'queue_holdtime':{'type':Sequelize['STRING'],'defaultValue':null},'queue_minute':{'type':Sequelize[_0x0a9e('0x2')],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize['STRING'],'defaultValue':null},'queue_seconds':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':null},'queue_thankyou':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':null},'queue_reporthold':{'type':Sequelize[_0x0a9e('0x2')]},'queue_quantity1':{'type':Sequelize[_0x0a9e('0x2')]},'queue_quantity2':{'type':Sequelize[_0x0a9e('0x2')]},'queue_periodic_announce':{'type':Sequelize[_0x0a9e('0x2')]},'queue_less_than':{'type':Sequelize[_0x0a9e('0x2')]},'periodic_announce':{'type':Sequelize[_0x0a9e('0x17')],'set':function(_0x5a101a){this[_0x0a9e('0xa')](_0x0a9e('0x18'),_0x5a101a?_0x5a101a[_0x0a9e('0x19')](','):[]);},'get':function(){return this[_0x0a9e('0xd')]('periodic_announce')?this[_0x0a9e('0xd')](_0x0a9e('0x18'))[_0x0a9e('0x1a')](','):[];}},'joinempty':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':_0x0a9e('0x14'),'set':function(_0x563b45){this[_0x0a9e('0xa')](_0x0a9e('0x1b'),_0x563b45?_0x563b45[_0x0a9e('0x19')](','):undefined);},'get':function(){return this['getDataValue'](_0x0a9e('0x1b'))?this['getDataValue'](_0x0a9e('0x1b'))[_0x0a9e('0x1a')](','):undefined;}},'leavewhenempty':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':'no','set':function(_0x33bdb7){this[_0x0a9e('0xa')]('leavewhenempty',_0x33bdb7?_0x33bdb7[_0x0a9e('0x19')](','):undefined);},'get':function(){return this[_0x0a9e('0xd')](_0x0a9e('0x1c'))?this[_0x0a9e('0xd')](_0x0a9e('0x1c'))[_0x0a9e('0x1a')](','):undefined;}},'reportholdtime':{'type':Sequelize[_0x0a9e('0x5')](_0x0a9e('0x14'),'no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize['ENUM'](_0x0a9e('0x14'),'no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize[_0x0a9e('0x5')](_0x0a9e('0x14'),'no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize[_0x0a9e('0x2')]},'description':{'type':Sequelize[_0x0a9e('0x2')]},'acw':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'set':function(_0x191e91){this[_0x0a9e('0xa')](_0x0a9e('0x1d'),_0x191e91);if(_0x191e91){if(this[_0x0a9e('0xd')]('wrapuptime')<0x2){this['setDataValue'](_0x0a9e('0x1e'),0x2);}}}},'acwTimeout':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize[_0x0a9e('0x1f')],'defaultValue':0x0,'comment':_0x0a9e('0x20')},'dialMethod':{'type':Sequelize[_0x0a9e('0x5')](_0x0a9e('0x21'),'progressive',_0x0a9e('0x12'),_0x0a9e('0x11'),_0x0a9e('0xe')),'defaultValue':'progressive','comment':_0x0a9e('0x22')},'dialLimitChannel':{'type':Sequelize[_0x0a9e('0x13')](0x4)[_0x0a9e('0x23')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':'Max\x209999\x20channels,\x200\x20means\x20unlimited.'},'dialLimitQueue':{'type':Sequelize['INTEGER'](0x4)[_0x0a9e('0x23')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x0a9e('0x24')},'dialPowerLevel':{'type':Sequelize['FLOAT'](0x2)[_0x0a9e('0x23')],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':_0x0a9e('0x25')},'dialPredictiveOptimization':{'type':Sequelize[_0x0a9e('0x5')](_0x0a9e('0x26'),'dropRate'),'defaultValue':'dropRate','comment':_0x0a9e('0x27')},'dialPredictiveOptimizationPercentage':{'type':Sequelize[_0x0a9e('0x28')](0x2)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':_0x0a9e('0x29')},'dialPredictiveInterval':{'type':Sequelize[_0x0a9e('0x13')](0x3)[_0x0a9e('0x23')],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':'Interval\x20Predictive\x20Minutes\x20(min:5\x20max:30)'},'dialOriginateCallerIdName':{'type':Sequelize[_0x0a9e('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x0a9e('0x2')]},'dialOriginateTimeout':{'type':Sequelize[_0x0a9e('0x13')](0x3)[_0x0a9e('0x23')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0a9e('0x2a')},'dialQueueOptions':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':_0x0a9e('0x2b'),'comment':_0x0a9e('0x2c')},'dialQueueTimeout':{'type':Sequelize[_0x0a9e('0x13')](0x3)[_0x0a9e('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0a9e('0x2d')},'dialQueueProject':{'type':Sequelize[_0x0a9e('0x2')],'comment':_0x0a9e('0x2e')},'dialCongestionMaxRetry':{'type':Sequelize[_0x0a9e('0x13')](0x3)[_0x0a9e('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Congestion\x20Retry\x20(min:1,\x20max:999)'},'dialCongestionRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x0a9e('0x23')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0a9e('0x2f')},'dialBusyMaxRetry':{'type':Sequelize[_0x0a9e('0x13')](0x3)[_0x0a9e('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0a9e('0x30')},'dialBusyRetryFrequency':{'type':Sequelize[_0x0a9e('0x13')](0x5)[_0x0a9e('0x23')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0a9e('0x31')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x0a9e('0x13')](0x3)[_0x0a9e('0x23')],'defaultValue':0x3,'comment':_0x0a9e('0x32')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x0a9e('0x13')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0a9e('0x33')},'dialGlobalMaxRetry':{'type':Sequelize[_0x0a9e('0x13')](0x3)[_0x0a9e('0x23')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x0a9e('0x34')},'dialTimezone':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':_0x0a9e('0x35')},'dialPrefix':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize['ENUM'](_0x0a9e('0x36'),'never',_0x0a9e('0x37')),'defaultValue':_0x0a9e('0x36')},'dialAMDActive':{'type':Sequelize[_0x0a9e('0x1f')],'defaultValue':0x0,'comment':'Active/Disactive\x20AMD'},'dialAMDInitialSilence':{'type':Sequelize[_0x0a9e('0x13')](0x9)[_0x0a9e('0x23')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x0a9e('0x38')},'dialAMDGreeting':{'type':Sequelize[_0x0a9e('0x13')](0x9)[_0x0a9e('0x23')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x0a9e('0x39')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x0a9e('0x13')](0x9)['UNSIGNED'],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x0a9e('0x3a')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x0a9e('0x13')](0x9)[_0x0a9e('0x23')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x0a9e('0x3b')},'dialAMDMinWordLength':{'type':Sequelize[_0x0a9e('0x13')](0x9)[_0x0a9e('0x23')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x0a9e('0x3c')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x0a9e('0x13')](0x9)[_0x0a9e('0x23')],'defaultValue':0x32,'validate':{'min':0x0},'comment':'#AMD\x20Between\x20Words\x20Silence'},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x0a9e('0x13')](0x9)[_0x0a9e('0x23')],'defaultValue':0x3,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Number\x20Of\x20Words'},'dialAMDSilenceThreshold':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x0a9e('0x3d')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x0a9e('0x13')](0x9)[_0x0a9e('0x23')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x0a9e('0x3e')},'dialRecallMeTimeout':{'type':Sequelize[_0x0a9e('0x13')](0x5)[_0x0a9e('0x23')],'validate':{'min':0x1},'defaultValue':0x1e,'comment':_0x0a9e('0x3f')},'dialRecallInQueue':{'type':Sequelize[_0x0a9e('0x1f')],'defaultValue':0x0,'comment':'Active/Disactive\x20Recall\x20In\x20Queue'},'dialOrderByScheduledAt':{'type':Sequelize['ENUM']('DESC',_0x0a9e('0x40')),'defaultValue':_0x0a9e('0x41')},'dialQueueProject2':{'type':Sequelize[_0x0a9e('0x2')],'comment':'AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)'},'dialAgiAfterHangupClient':{'type':Sequelize[_0x0a9e('0x1f')],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize[_0x0a9e('0x1f')],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x0a9e('0x42')},'dialCutDigit':{'type':Sequelize['INTEGER'](0x3)[_0x0a9e('0x23')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Cut\x20Digit\x20(min:1,\x20max:15)'},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x0a9e('0x13')](0x3)[_0x0a9e('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0a9e('0x43')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x0a9e('0x23')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0a9e('0x44')},'dialDropMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0a9e('0x45')},'dialDropRetryFrequency':{'type':Sequelize[_0x0a9e('0x13')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0a9e('0x46')},'dialAbandonedMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x0a9e('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Abandoned\x20Retry\x20(min:1,\x20max:999)'},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x0a9e('0x13')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialMachineMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x0a9e('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Machine\x20Retry\x20(min:1,\x20max:999)'},'dialMachineRetryFrequency':{'type':Sequelize[_0x0a9e('0x13')](0x5)[_0x0a9e('0x23')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0a9e('0x47')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x0a9e('0x13')](0x3)[_0x0a9e('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0a9e('0x48')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x0a9e('0x13')](0x5)[_0x0a9e('0x23')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'mandatoryDispositionPauseId':{'type':Sequelize[_0x0a9e('0x13')],'allowNull':!![],'comment':_0x0a9e('0x49')},'mandatoryDisposition':{'type':Sequelize[_0x0a9e('0x1f')],'defaultValue':![],'comment':_0x0a9e('0x4a'),'set':function(_0xb83dfd){if(!_0xb83dfd)this[_0x0a9e('0xa')]('mandatoryDispositionPauseId',null);this[_0x0a9e('0xa')](_0x0a9e('0x4b'),_0xb83dfd);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize['INTEGER'](0x3)[_0x0a9e('0x23')],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize['INTEGER'](0x3)[_0x0a9e('0x23')],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}}};
\ No newline at end of file
diff --git a/server/api/voiceQueue/voiceQueue.controller.js b/server/api/voiceQueue/voiceQueue.controller.js
index c5da39e..6b783f4 100644
--- a/server/api/voiceQueue/voiceQueue.controller.js
+++ b/server/api/voiceQueue/voiceQueue.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x8d8e=['role','UserProfileSection','destroy','getHoppers','findOne','CmHopper','nolimit','VoiceQueueId','getHopperHistories','CmHopperHistory','hasOwnProperty','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','Team','getTeams','addTeams','Agents','interface','flatMap','forEach','penalty','sequelize','transaction','each','UserVoiceQueue','findOrCreate','UserVoiceQueueRt','upsert','format','voicePause','emit','userVoiceQueue:save','ids','User','select','join','ut.TeamId\x20=\x20tq.TeamId','VoiceQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','every','all','union','compact','removeTeams','isEmpty','userVoiceQueue:remove','addAgents','spread','online','isNil','removeAgents','getAgents','getMembers','getLists','addLists','dialCheckDuplicateType','insert','into','cm_hopper','fromQuery','phone','scheduledAt','ContactId','ListId','field','NOW()','CmListId','from','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','COALESCE(phone,\x27\x27)','onlyIfOpen','removeLists','CmList','getBlackLists','addBlackLists','cm_hopper_black','removeBlackLists','html-pdf','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./voiceQueue.socket','register','status','json','count','offset','limit','set','apply','save','update','then','VoiceQueues','inbound','QueueCampaigns','filter','map','value','includes','type','find','name','UserProfileResource','end','sendStatus','error','stack','send','index','VoiceQueue','fieldName','key','model','query','filters','intersection','attributes','fields','length','order','sort','pick','where','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','keys','rawAttributes','include','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','outbound','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','omit','createdAt','updatedAt'];(function(_0x24dbad,_0x38302c){var _0x8624ac=function(_0x532198){while(--_0x532198){_0x24dbad['push'](_0x24dbad['shift']());}};_0x8624ac(++_0x38302c);}(_0x8d8e,0x112));var _0xe8d8=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x8d8e[_0x397e5f];return _0x5302b8;};'use strict';var pdf=require(_0xe8d8('0x0'));var emlformat=require(_0xe8d8('0x1'));var rimraf=require(_0xe8d8('0x2'));var zipdir=require(_0xe8d8('0x3'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xe8d8('0x4'));var BPromise=require(_0xe8d8('0x5'));var Mustache=require(_0xe8d8('0x6'));var util=require(_0xe8d8('0x7'));var path=require(_0xe8d8('0x8'));var sox=require(_0xe8d8('0x9'));var csv=require(_0xe8d8('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xe8d8('0xb'));var squel=require(_0xe8d8('0xc'));var crypto=require(_0xe8d8('0xd'));var jsforce=require(_0xe8d8('0xe'));var deskjs=require(_0xe8d8('0xf'));var toCsv=require(_0xe8d8('0xa'));var querystring=require(_0xe8d8('0x10'));var Papa=require(_0xe8d8('0x11'));var Redis=require(_0xe8d8('0x12'));var authService=require(_0xe8d8('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xe8d8('0x14'));var hardwareService=require(_0xe8d8('0x15'));var logger=require(_0xe8d8('0x16'))(_0xe8d8('0x17'));var utils=require('../../config/utils');var config=require(_0xe8d8('0x18'));var db=require(_0xe8d8('0x19'))['db'];config[_0xe8d8('0x1a')]=_['defaults'](config[_0xe8d8('0x1a')],{'host':_0xe8d8('0x1b'),'port':0x18eb});var socket=require(_0xe8d8('0x1c'))(new Redis(config[_0xe8d8('0x1a')]));require(_0xe8d8('0x1d'))[_0xe8d8('0x1e')](socket);function respondWithStatusCode(_0x572595,_0x581a00){_0x581a00=_0x581a00||0xcc;return function(_0x2e3b64){if(_0x2e3b64){return _0x572595['sendStatus'](_0x581a00);}return _0x572595[_0xe8d8('0x1f')](_0x581a00)['end']();};}function respondWithResult(_0x5d7881,_0x522e5e){_0x522e5e=_0x522e5e||0xc8;return function(_0x1b6f62){if(_0x1b6f62){return _0x5d7881['status'](_0x522e5e)[_0xe8d8('0x20')](_0x1b6f62);}};}function respondWithFilteredResult(_0x2a5195,_0x23b4ce){return function(_0x5a6cf2){if(_0x5a6cf2){var _0x3a372b=_0x5a6cf2[_0xe8d8('0x21')],_0x4f9408=_0x23b4ce['offset'],_0x249e5c=_0x23b4ce[_0xe8d8('0x22')]+_0x23b4ce[_0xe8d8('0x23')],_0x520507;if(_0x249e5c>=_0x3a372b){_0x249e5c=_0x3a372b;_0x520507=0xc8;}else{_0x520507=0xce;}_0x2a5195['status'](_0x520507);return _0x2a5195[_0xe8d8('0x24')]('Content-Range',_0x4f9408+'-'+_0x249e5c+'/'+_0x3a372b)['json'](_0x5a6cf2);}return null;};}function patchUpdates(_0x2e805a){return function(_0xdc24c8){try{jsonpatch[_0xe8d8('0x25')](_0xdc24c8,_0x2e805a,!![]);}catch(_0x550bd9){return BPromise['reject'](_0x550bd9);}return _0xdc24c8[_0xe8d8('0x26')]();};}function saveUpdates(_0x362042,_0x554a7f){return function(_0x57e3ec){if(_0x57e3ec){return _0x57e3ec[_0xe8d8('0x27')](_0x362042)[_0xe8d8('0x28')](function(_0x883feb){return _0x883feb;});}return null;};}function removeEntity(_0x43cdf7,_0x576144){return function(_0x1b213f){if(_0x1b213f){return _0x1b213f['destroy']()[_0xe8d8('0x28')](function(){var _0x2453cb=_0x1b213f['get']({'plain':!![]});var _0x1a54c6=[{'name':_0xe8d8('0x29'),'value':_0xe8d8('0x2a'),'ignore':![]},{'name':_0xe8d8('0x2b'),'value':'outbound','ignore':![]}];var _0x1c4388=_(_0x1a54c6)[_0xe8d8('0x2c')]('ignore')[_0xe8d8('0x2d')](_0xe8d8('0x2e'))[_0xe8d8('0x2e')]();if(_[_0xe8d8('0x2f')](_0x1c4388,_0x2453cb[_0xe8d8('0x30')])){return;}var _0x47a276=_[_0xe8d8('0x31')](_0x1a54c6,[_0xe8d8('0x2e'),_0x2453cb[_0xe8d8('0x30')]])[_0xe8d8('0x32')];return db[_0xe8d8('0x33')]['destroy']({'where':{'type':_0x47a276,'resourceId':_0x2453cb['id']}})['then'](function(){return _0x1b213f;});})['then'](function(){_0x43cdf7[_0xe8d8('0x1f')](0xcc)[_0xe8d8('0x34')]();});}};}function handleEntityNotFound(_0x51322d,_0x4796e5){return function(_0x2cefd3){if(!_0x2cefd3){_0x51322d[_0xe8d8('0x35')](0x194);}return _0x2cefd3;};}function handleError(_0x37a235,_0x43eff0){_0x43eff0=_0x43eff0||0x1f4;return function(_0x4e456f){logger[_0xe8d8('0x36')](_0x4e456f[_0xe8d8('0x37')]);if(_0x4e456f['name']){delete _0x4e456f[_0xe8d8('0x32')];}_0x37a235[_0xe8d8('0x1f')](_0x43eff0)[_0xe8d8('0x38')](_0x4e456f);};}exports[_0xe8d8('0x39')]=function(_0x17f829,_0x5a3a5b){var _0x30e951={},_0x11892a={},_0x371084={'count':0x0,'rows':[]};var _0x25fa3a=_[_0xe8d8('0x2d')](db[_0xe8d8('0x3a')]['rawAttributes'],function(_0x30d69a){return{'name':_0x30d69a[_0xe8d8('0x3b')],'type':_0x30d69a[_0xe8d8('0x30')][_0xe8d8('0x3c')]};});_0x11892a[_0xe8d8('0x3d')]=_[_0xe8d8('0x2d')](_0x25fa3a,_0xe8d8('0x32'));_0x11892a[_0xe8d8('0x3e')]=_['keys'](_0x17f829[_0xe8d8('0x3e')]);_0x11892a[_0xe8d8('0x3f')]=_[_0xe8d8('0x40')](_0x11892a[_0xe8d8('0x3d')],_0x11892a[_0xe8d8('0x3e')]);_0x30e951[_0xe8d8('0x41')]=_[_0xe8d8('0x40')](_0x11892a[_0xe8d8('0x3d')],qs[_0xe8d8('0x42')](_0x17f829[_0xe8d8('0x3e')][_0xe8d8('0x42')]));_0x30e951[_0xe8d8('0x41')]=_0x30e951[_0xe8d8('0x41')][_0xe8d8('0x43')]?_0x30e951[_0xe8d8('0x41')]:_0x11892a[_0xe8d8('0x3d')];if(!_0x17f829['query']['hasOwnProperty']('nolimit')){_0x30e951['limit']=qs['limit'](_0x17f829[_0xe8d8('0x3e')][_0xe8d8('0x23')]);_0x30e951[_0xe8d8('0x22')]=qs['offset'](_0x17f829[_0xe8d8('0x3e')][_0xe8d8('0x22')]);}_0x30e951[_0xe8d8('0x44')]=qs[_0xe8d8('0x45')](_0x17f829[_0xe8d8('0x3e')][_0xe8d8('0x45')]);_0x30e951['where']=qs[_0xe8d8('0x3f')](_[_0xe8d8('0x46')](_0x17f829[_0xe8d8('0x3e')],_0x11892a[_0xe8d8('0x3f')]),_0x25fa3a);if(_0x17f829['query'][_0xe8d8('0x2c')]){_0x30e951[_0xe8d8('0x47')]=_[_0xe8d8('0x48')](_0x30e951['where'],{'$or':_[_0xe8d8('0x2d')](_0x25fa3a,function(_0x1b2c8b){if(_0x1b2c8b['type']!==_0xe8d8('0x49')){var _0x22db5e={};_0x22db5e[_0x1b2c8b[_0xe8d8('0x32')]]={'$like':'%'+_0x17f829[_0xe8d8('0x3e')][_0xe8d8('0x2c')]+'%'};return _0x22db5e;}})});}_0x30e951=_[_0xe8d8('0x48')]({},_0x30e951,_0x17f829[_0xe8d8('0x4a')]);var _0x1079d8={'where':_0x30e951['where']};return db[_0xe8d8('0x3a')]['count'](_0x1079d8)[_0xe8d8('0x28')](function(_0x14d88b){_0x371084[_0xe8d8('0x21')]=_0x14d88b;if(_0x17f829[_0xe8d8('0x3e')][_0xe8d8('0x4b')]){_0x30e951['include']=[{'all':!![]}];}return db['VoiceQueue'][_0xe8d8('0x4c')](_0x30e951);})[_0xe8d8('0x28')](function(_0x2caa68){_0x371084[_0xe8d8('0x4d')]=_0x2caa68;return _0x371084;})[_0xe8d8('0x28')](respondWithFilteredResult(_0x5a3a5b,_0x30e951))[_0xe8d8('0x4e')](handleError(_0x5a3a5b,null));};exports[_0xe8d8('0x4f')]=function(_0x32e1b9,_0x245688){var _0xd17162={'raw':![],'where':{'id':_0x32e1b9[_0xe8d8('0x50')]['id']}},_0x226d8a={};_0x226d8a[_0xe8d8('0x3d')]=_[_0xe8d8('0x51')](db['VoiceQueue'][_0xe8d8('0x52')]);_0x226d8a[_0xe8d8('0x3e')]=_[_0xe8d8('0x51')](_0x32e1b9[_0xe8d8('0x3e')]);_0x226d8a['filters']=_[_0xe8d8('0x40')](_0x226d8a[_0xe8d8('0x3d')],_0x226d8a[_0xe8d8('0x3e')]);_0xd17162[_0xe8d8('0x41')]=_[_0xe8d8('0x40')](_0x226d8a[_0xe8d8('0x3d')],qs[_0xe8d8('0x42')](_0x32e1b9['query'][_0xe8d8('0x42')]));_0xd17162[_0xe8d8('0x41')]=_0xd17162[_0xe8d8('0x41')][_0xe8d8('0x43')]?_0xd17162[_0xe8d8('0x41')]:_0x226d8a[_0xe8d8('0x3d')];if(_0x32e1b9['query'][_0xe8d8('0x4b')]){_0xd17162[_0xe8d8('0x53')]=[{'all':!![]}];}_0xd17162=_[_0xe8d8('0x48')]({},_0xd17162,_0x32e1b9[_0xe8d8('0x4a')]);return db[_0xe8d8('0x3a')][_0xe8d8('0x31')](_0xd17162)['then'](handleEntityNotFound(_0x245688,null))[_0xe8d8('0x28')](respondWithResult(_0x245688,null))[_0xe8d8('0x4e')](handleError(_0x245688,null));};exports[_0xe8d8('0x54')]=function(_0x44508d,_0x584120){return db[_0xe8d8('0x3a')][_0xe8d8('0x54')](_0x44508d[_0xe8d8('0x55')],{})[_0xe8d8('0x28')](function(_0x50d723){var _0x513055=_0x44508d['user'][_0xe8d8('0x56')]({'plain':!![]});if(!_0x513055)throw new Error(_0xe8d8('0x57'));if(_0x513055['role']===_0xe8d8('0x58')){var _0x119969=_0x50d723[_0xe8d8('0x56')]({'plain':!![]});var _0xb3073f=[{'name':_0xe8d8('0x29'),'value':'inbound'},{'name':_0xe8d8('0x2b'),'value':_0xe8d8('0x59')}];var _0x32c68c=_[_0xe8d8('0x31')](_0xb3073f,[_0xe8d8('0x2e'),_0x119969['type']])[_0xe8d8('0x32')];return db['UserProfileSection']['find']({'where':{'name':_0x32c68c,'userProfileId':_0x513055[_0xe8d8('0x5a')]},'raw':!![]})[_0xe8d8('0x28')](function(_0x70c1ce){if(_0x70c1ce&&_0x70c1ce[_0xe8d8('0x5b')]===0x0){return db[_0xe8d8('0x33')][_0xe8d8('0x54')]({'name':_0x119969['name'],'resourceId':_0x119969['id'],'type':_0x70c1ce[_0xe8d8('0x32')],'sectionId':_0x70c1ce['id']},{})[_0xe8d8('0x28')](function(){return _0x50d723;});}else{return _0x50d723;}})[_0xe8d8('0x4e')](function(_0x34fe0c){logger['error'](_0xe8d8('0x5c'),_0x34fe0c);throw _0x34fe0c;});}return _0x50d723;})['then'](respondWithResult(_0x584120,0xc9))[_0xe8d8('0x4e')](handleError(_0x584120,null));};exports['clone']=function(_0x40e884,_0x1faa46){var _0x22af19={'where':{'id':_0x40e884['params']['id']}},_0xbdface={};_0xbdface[_0xe8d8('0x3d')]=_[_0xe8d8('0x51')](db['VoiceQueue'][_0xe8d8('0x52')]);_0x22af19['attributes']=_['intersection'](_0xbdface[_0xe8d8('0x3d')],qs[_0xe8d8('0x42')](_0x40e884['query'][_0xe8d8('0x42')]));_0x22af19[_0xe8d8('0x41')]=_0x22af19[_0xe8d8('0x41')][_0xe8d8('0x43')]?_0x22af19[_0xe8d8('0x41')]:_0xbdface[_0xe8d8('0x3d')];if(_0x40e884[_0xe8d8('0x3e')][_0xe8d8('0x4b')]){_0x22af19[_0xe8d8('0x53')]=[{'all':!![]}];}_0x22af19=_[_0xe8d8('0x48')]({},_0x22af19,_0x40e884[_0xe8d8('0x4a')]);return db[_0xe8d8('0x3a')][_0xe8d8('0x31')](_0x22af19)[_0xe8d8('0x28')](handleEntityNotFound(_0x1faa46,null))['then'](function(_0x2ee2c2){if(_0x2ee2c2){var _0x577ef5=_0x2ee2c2[_0xe8d8('0x56')]({'plain':!![]});_0x577ef5=qs[_0xe8d8('0x5d')](_0x577ef5,['id',_0xe8d8('0x5e'),_0xe8d8('0x5f')]);_0x40e884['body']=_['omit'](_0x40e884[_0xe8d8('0x55')],['id',_0xe8d8('0x5e'),_0xe8d8('0x5f')]);return db[_0xe8d8('0x3a')][_0xe8d8('0x54')](_[_0xe8d8('0x48')](_0x577ef5,_0x40e884[_0xe8d8('0x55')]),{'include':_0x40e884[_0xe8d8('0x3e')][_0xe8d8('0x4b')]?[{'all':!![]}]:undefined})[_0xe8d8('0x28')](function(_0x22c4a2){var _0x262623=_0x40e884[_0xe8d8('0x58')][_0xe8d8('0x56')]({'plain':!![]});if(!_0x262623)throw new Error(_0xe8d8('0x57'));if(_0x262623[_0xe8d8('0x60')]===_0xe8d8('0x58')){var _0x2843ca=_0x22c4a2['get']({'plain':!![]});var _0x1227f4=[{'name':_0xe8d8('0x29'),'value':_0xe8d8('0x2a')},{'name':_0xe8d8('0x2b'),'value':_0xe8d8('0x59')}];var _0x41c8c7=_[_0xe8d8('0x31')](_0x1227f4,[_0xe8d8('0x2e'),_0x2843ca[_0xe8d8('0x30')]])['name'];return db[_0xe8d8('0x61')][_0xe8d8('0x31')]({'where':{'name':_0x41c8c7,'userProfileId':_0x262623[_0xe8d8('0x5a')]},'raw':!![]})[_0xe8d8('0x28')](function(_0x37e246){if(_0x37e246&&_0x37e246[_0xe8d8('0x5b')]===0x0){return db['UserProfileResource'][_0xe8d8('0x54')]({'name':_0x2843ca[_0xe8d8('0x32')],'resourceId':_0x2843ca['id'],'type':_0x37e246[_0xe8d8('0x32')],'sectionId':_0x37e246['id']},{})[_0xe8d8('0x28')](function(){return _0x22c4a2;});}else{return _0x22c4a2;}})[_0xe8d8('0x4e')](function(_0xc07a17){logger[_0xe8d8('0x36')](_0xe8d8('0x5c'),_0xc07a17);throw _0xc07a17;});}return _0x22c4a2;});}})['then'](respondWithResult(_0x1faa46,0xc9))['catch'](handleError(_0x1faa46,null));};exports[_0xe8d8('0x27')]=function(_0x3be4c5,_0x10970c){if(_0x3be4c5['body']['id']){delete _0x3be4c5['body']['id'];}return db['VoiceQueue']['find']({'where':{'id':_0x3be4c5['params']['id']}})[_0xe8d8('0x28')](handleEntityNotFound(_0x10970c,null))[_0xe8d8('0x28')](saveUpdates(_0x3be4c5[_0xe8d8('0x55')],null))[_0xe8d8('0x28')](respondWithResult(_0x10970c,null))['catch'](handleError(_0x10970c,null));};exports[_0xe8d8('0x62')]=function(_0x3821a6,_0x465f68){return db[_0xe8d8('0x3a')][_0xe8d8('0x31')]({'where':{'id':_0x3821a6[_0xe8d8('0x50')]['id']}})['then'](handleEntityNotFound(_0x465f68,null))['then'](removeEntity(_0x465f68,null))[_0xe8d8('0x4e')](handleError(_0x465f68,null));};exports[_0xe8d8('0x63')]=function(_0x3c6223,_0x345454,_0xc875d0){var _0x59ab1a={'raw':![],'where':{}};var _0x5ccb71={};var _0x4a7c07={'count':0x0,'rows':[]};return db[_0xe8d8('0x3a')][_0xe8d8('0x64')]({'where':{'id':_0x3c6223[_0xe8d8('0x50')]['id']}})[_0xe8d8('0x28')](handleEntityNotFound(_0x345454,null))[_0xe8d8('0x28')](function(_0x53d5d1){if(_0x53d5d1){_0x5ccb71[_0xe8d8('0x3d')]=_[_0xe8d8('0x51')](db[_0xe8d8('0x65')][_0xe8d8('0x52')]);_0x5ccb71[_0xe8d8('0x3e')]=_[_0xe8d8('0x51')](_0x3c6223[_0xe8d8('0x3e')]);_0x5ccb71[_0xe8d8('0x3f')]=_['intersection'](_0x5ccb71[_0xe8d8('0x3d')],_0x5ccb71[_0xe8d8('0x3e')]);_0x59ab1a[_0xe8d8('0x41')]=_['intersection'](_0x5ccb71[_0xe8d8('0x3d')],qs[_0xe8d8('0x42')](_0x3c6223['query'][_0xe8d8('0x42')]));_0x59ab1a[_0xe8d8('0x41')]=_0x59ab1a[_0xe8d8('0x41')][_0xe8d8('0x43')]?_0x59ab1a[_0xe8d8('0x41')]:_0x5ccb71[_0xe8d8('0x3d')];if(!_0x3c6223[_0xe8d8('0x3e')]['hasOwnProperty'](_0xe8d8('0x66'))){_0x59ab1a[_0xe8d8('0x23')]=qs['limit'](_0x3c6223[_0xe8d8('0x3e')][_0xe8d8('0x23')]);_0x59ab1a[_0xe8d8('0x22')]=qs[_0xe8d8('0x22')](_0x3c6223[_0xe8d8('0x3e')][_0xe8d8('0x22')]);}_0x59ab1a[_0xe8d8('0x44')]=qs[_0xe8d8('0x45')](_0x3c6223[_0xe8d8('0x3e')][_0xe8d8('0x45')]);_0x59ab1a[_0xe8d8('0x47')]=qs['filters'](_[_0xe8d8('0x46')](_0x3c6223[_0xe8d8('0x3e')],_0x5ccb71['filters']));_0x59ab1a[_0xe8d8('0x47')][_0xe8d8('0x67')]=_0x53d5d1['id'];if(_0x3c6223['query']['filter']){_0x59ab1a[_0xe8d8('0x47')]=_[_0xe8d8('0x48')](_0x59ab1a['where'],{'$or':_[_0xe8d8('0x2d')](_0x59ab1a['attributes'],function(_0x1cbf5c){var _0x4bb974={};_0x4bb974[_0x1cbf5c]={'$like':'%'+_0x3c6223[_0xe8d8('0x3e')][_0xe8d8('0x2c')]+'%'};return _0x4bb974;})});}_0x59ab1a=_[_0xe8d8('0x48')]({},_0x59ab1a,_0x3c6223['options']);return db['CmHopper'][_0xe8d8('0x21')]({'where':_0x59ab1a['where']})['then'](function(_0x44cbc3){_0x4a7c07[_0xe8d8('0x21')]=_0x44cbc3;if(_0x3c6223[_0xe8d8('0x3e')][_0xe8d8('0x4b')]){_0x59ab1a[_0xe8d8('0x53')]=[{'all':!![]}];}return db[_0xe8d8('0x65')][_0xe8d8('0x4c')](_0x59ab1a);})[_0xe8d8('0x28')](function(_0x160768){_0x4a7c07['rows']=_0x160768;return _0x4a7c07;});}})['then'](respondWithFilteredResult(_0x345454,_0x59ab1a))[_0xe8d8('0x4e')](handleError(_0x345454,null));};exports[_0xe8d8('0x68')]=function(_0x2d59b1,_0x42edc4,_0x4f9367){var _0x29b63f={'raw':!![],'where':{}};var _0x28a1d3={};var _0x4915c6={'count':0x0,'rows':[]};return db['VoiceQueue'][_0xe8d8('0x64')]({'where':{'id':_0x2d59b1['params']['id']}})[_0xe8d8('0x28')](handleEntityNotFound(_0x42edc4,null))['then'](function(_0x2e901a){if(_0x2e901a){_0x28a1d3['model']=_[_0xe8d8('0x51')](db[_0xe8d8('0x69')][_0xe8d8('0x52')]);_0x28a1d3[_0xe8d8('0x3e')]=_[_0xe8d8('0x51')](_0x2d59b1[_0xe8d8('0x3e')]);_0x28a1d3['filters']=_['intersection'](_0x28a1d3[_0xe8d8('0x3d')],_0x28a1d3['query']);_0x29b63f['attributes']=_[_0xe8d8('0x40')](_0x28a1d3['model'],qs['fields'](_0x2d59b1[_0xe8d8('0x3e')]['fields']));_0x29b63f[_0xe8d8('0x41')]=_0x29b63f['attributes'][_0xe8d8('0x43')]?_0x29b63f[_0xe8d8('0x41')]:_0x28a1d3[_0xe8d8('0x3d')];if(!_0x2d59b1[_0xe8d8('0x3e')][_0xe8d8('0x6a')](_0xe8d8('0x66'))){_0x29b63f[_0xe8d8('0x23')]=qs['limit'](_0x2d59b1[_0xe8d8('0x3e')][_0xe8d8('0x23')]);_0x29b63f[_0xe8d8('0x22')]=qs[_0xe8d8('0x22')](_0x2d59b1[_0xe8d8('0x3e')][_0xe8d8('0x22')]);}_0x29b63f[_0xe8d8('0x44')]=qs[_0xe8d8('0x45')](_0x2d59b1['query'][_0xe8d8('0x45')]);_0x29b63f[_0xe8d8('0x47')]=qs[_0xe8d8('0x3f')](_[_0xe8d8('0x46')](_0x2d59b1[_0xe8d8('0x3e')],_0x28a1d3[_0xe8d8('0x3f')]));_0x29b63f[_0xe8d8('0x47')][_0xe8d8('0x67')]=_0x2e901a['id'];if(_0x2d59b1[_0xe8d8('0x3e')]['filter']){_0x29b63f['where']=_[_0xe8d8('0x48')](_0x29b63f[_0xe8d8('0x47')],{'$or':_[_0xe8d8('0x2d')](_0x29b63f[_0xe8d8('0x41')],function(_0x4d4e99){var _0xa89dc5={};_0xa89dc5[_0x4d4e99]={'$like':'%'+_0x2d59b1[_0xe8d8('0x3e')][_0xe8d8('0x2c')]+'%'};return _0xa89dc5;})});}_0x29b63f=_[_0xe8d8('0x48')]({},_0x29b63f,_0x2d59b1[_0xe8d8('0x4a')]);return db[_0xe8d8('0x69')][_0xe8d8('0x21')]({'where':_0x29b63f[_0xe8d8('0x47')]})[_0xe8d8('0x28')](function(_0x522e45){_0x4915c6[_0xe8d8('0x21')]=_0x522e45;if(_0x2d59b1[_0xe8d8('0x3e')]['includeAll']){_0x29b63f[_0xe8d8('0x53')]=[{'all':!![]}];}return db[_0xe8d8('0x69')][_0xe8d8('0x4c')](_0x29b63f);})[_0xe8d8('0x28')](function(_0x4b431b){_0x4915c6[_0xe8d8('0x4d')]=_0x4b431b;return _0x4915c6;});}})[_0xe8d8('0x28')](respondWithFilteredResult(_0x42edc4,_0x29b63f))[_0xe8d8('0x4e')](handleError(_0x42edc4,null));};exports[_0xe8d8('0x6b')]=function(_0x801700,_0x4ea801,_0x55fa45){var _0x3b4284={'raw':!![],'where':{}};var _0x57224a={};var _0xacd01b={'count':0x0,'rows':[]};return db[_0xe8d8('0x3a')][_0xe8d8('0x64')]({'where':{'id':_0x801700[_0xe8d8('0x50')]['id']}})['then'](handleEntityNotFound(_0x4ea801,null))[_0xe8d8('0x28')](function(_0x1130da){if(_0x1130da){_0x57224a[_0xe8d8('0x3d')]=_['keys'](db['CmHopperFinal'][_0xe8d8('0x52')]);_0x57224a[_0xe8d8('0x3e')]=_[_0xe8d8('0x51')](_0x801700[_0xe8d8('0x3e')]);_0x57224a[_0xe8d8('0x3f')]=_[_0xe8d8('0x40')](_0x57224a['model'],_0x57224a[_0xe8d8('0x3e')]);_0x3b4284[_0xe8d8('0x41')]=_['intersection'](_0x57224a[_0xe8d8('0x3d')],qs['fields'](_0x801700[_0xe8d8('0x3e')][_0xe8d8('0x42')]));_0x3b4284['attributes']=_0x3b4284[_0xe8d8('0x41')]['length']?_0x3b4284['attributes']:_0x57224a[_0xe8d8('0x3d')];if(!_0x801700['query'][_0xe8d8('0x6a')](_0xe8d8('0x66'))){_0x3b4284[_0xe8d8('0x23')]=qs[_0xe8d8('0x23')](_0x801700[_0xe8d8('0x3e')][_0xe8d8('0x23')]);_0x3b4284[_0xe8d8('0x22')]=qs[_0xe8d8('0x22')](_0x801700['query'][_0xe8d8('0x22')]);}_0x3b4284[_0xe8d8('0x44')]=qs[_0xe8d8('0x45')](_0x801700[_0xe8d8('0x3e')]['sort']);_0x3b4284[_0xe8d8('0x47')]=qs['filters'](_[_0xe8d8('0x46')](_0x801700[_0xe8d8('0x3e')],_0x57224a['filters']));_0x3b4284['where']['VoiceQueueId']=_0x1130da['id'];if(_0x801700[_0xe8d8('0x3e')][_0xe8d8('0x2c')]){_0x3b4284[_0xe8d8('0x47')]=_[_0xe8d8('0x48')](_0x3b4284[_0xe8d8('0x47')],{'$or':_[_0xe8d8('0x2d')](_0x3b4284[_0xe8d8('0x41')],function(_0x349760){var _0x26d259={};_0x26d259[_0x349760]={'$like':'%'+_0x801700[_0xe8d8('0x3e')][_0xe8d8('0x2c')]+'%'};return _0x26d259;})});}_0x3b4284=_[_0xe8d8('0x48')]({},_0x3b4284,_0x801700['options']);return db[_0xe8d8('0x6c')][_0xe8d8('0x21')]({'where':_0x3b4284[_0xe8d8('0x47')]})[_0xe8d8('0x28')](function(_0x594e3a){_0xacd01b['count']=_0x594e3a;if(_0x801700[_0xe8d8('0x3e')]['includeAll']){_0x3b4284[_0xe8d8('0x53')]=[{'all':!![]}];}return db[_0xe8d8('0x6c')][_0xe8d8('0x4c')](_0x3b4284);})[_0xe8d8('0x28')](function(_0x42db20){_0xacd01b[_0xe8d8('0x4d')]=_0x42db20;return _0xacd01b;});}})[_0xe8d8('0x28')](respondWithFilteredResult(_0x4ea801,_0x3b4284))[_0xe8d8('0x4e')](handleError(_0x4ea801,null));};exports[_0xe8d8('0x6d')]=function(_0x403dea,_0x123ff1,_0x263e77){var _0x34d616={'raw':!![],'where':{}};var _0x4e4628={};var _0x11e70e={'count':0x0,'rows':[]};return db['VoiceQueue'][_0xe8d8('0x64')]({'where':{'id':_0x403dea[_0xe8d8('0x50')]['id']}})[_0xe8d8('0x28')](handleEntityNotFound(_0x123ff1,null))['then'](function(_0x12081c){if(_0x12081c){_0x4e4628[_0xe8d8('0x3d')]=_[_0xe8d8('0x51')](db['CmHopperBlack'][_0xe8d8('0x52')]);_0x4e4628['query']=_[_0xe8d8('0x51')](_0x403dea[_0xe8d8('0x3e')]);_0x4e4628[_0xe8d8('0x3f')]=_[_0xe8d8('0x40')](_0x4e4628[_0xe8d8('0x3d')],_0x4e4628['query']);_0x34d616['attributes']=_[_0xe8d8('0x40')](_0x4e4628[_0xe8d8('0x3d')],qs[_0xe8d8('0x42')](_0x403dea['query']['fields']));_0x34d616[_0xe8d8('0x41')]=_0x34d616[_0xe8d8('0x41')][_0xe8d8('0x43')]?_0x34d616['attributes']:_0x4e4628[_0xe8d8('0x3d')];if(!_0x403dea['query'][_0xe8d8('0x6a')](_0xe8d8('0x66'))){_0x34d616[_0xe8d8('0x23')]=qs[_0xe8d8('0x23')](_0x403dea[_0xe8d8('0x3e')][_0xe8d8('0x23')]);_0x34d616[_0xe8d8('0x22')]=qs[_0xe8d8('0x22')](_0x403dea[_0xe8d8('0x3e')][_0xe8d8('0x22')]);}_0x34d616[_0xe8d8('0x44')]=qs[_0xe8d8('0x45')](_0x403dea[_0xe8d8('0x3e')]['sort']);_0x34d616[_0xe8d8('0x47')]=qs[_0xe8d8('0x3f')](_[_0xe8d8('0x46')](_0x403dea[_0xe8d8('0x3e')],_0x4e4628['filters']));_0x34d616['where'][_0xe8d8('0x67')]=_0x12081c['id'];if(_0x403dea['query'][_0xe8d8('0x2c')]){_0x34d616[_0xe8d8('0x47')]=_[_0xe8d8('0x48')](_0x34d616[_0xe8d8('0x47')],{'$or':_[_0xe8d8('0x2d')](_0x34d616['attributes'],function(_0x27bf6){var _0x435995={};_0x435995[_0x27bf6]={'$like':'%'+_0x403dea[_0xe8d8('0x3e')]['filter']+'%'};return _0x435995;})});}_0x34d616=_[_0xe8d8('0x48')]({},_0x34d616,_0x403dea[_0xe8d8('0x4a')]);return db[_0xe8d8('0x6e')]['count']({'where':_0x34d616[_0xe8d8('0x47')]})[_0xe8d8('0x28')](function(_0x43bcbb){_0x11e70e[_0xe8d8('0x21')]=_0x43bcbb;if(_0x403dea['query'][_0xe8d8('0x4b')]){_0x34d616[_0xe8d8('0x53')]=[{'all':!![]}];}return db[_0xe8d8('0x6e')]['findAll'](_0x34d616);})[_0xe8d8('0x28')](function(_0x221ee7){_0x11e70e[_0xe8d8('0x4d')]=_0x221ee7;return _0x11e70e;});}})[_0xe8d8('0x28')](respondWithFilteredResult(_0x123ff1,_0x34d616))['catch'](handleError(_0x123ff1,null));};exports['getTeams']=function(_0x4f4326,_0x84a425,_0x5b7557){var _0x233446={};var _0x18a4ef={};var _0x49a308;var _0x3a737c;return db['VoiceQueue']['findOne']({'where':{'id':_0x4f4326['params']['id']}})[_0xe8d8('0x28')](handleEntityNotFound(_0x84a425,null))[_0xe8d8('0x28')](function(_0x4c9469){if(_0x4c9469){_0x49a308=_0x4c9469;_0x18a4ef[_0xe8d8('0x3d')]=_[_0xe8d8('0x51')](db[_0xe8d8('0x6f')]['rawAttributes']);_0x18a4ef['query']=_[_0xe8d8('0x51')](_0x4f4326[_0xe8d8('0x3e')]);_0x18a4ef[_0xe8d8('0x3f')]=_[_0xe8d8('0x40')](_0x18a4ef['model'],_0x18a4ef['query']);_0x233446[_0xe8d8('0x41')]=_[_0xe8d8('0x40')](_0x18a4ef[_0xe8d8('0x3d')],qs[_0xe8d8('0x42')](_0x4f4326['query']['fields']));_0x233446['attributes']=_0x233446[_0xe8d8('0x41')][_0xe8d8('0x43')]?_0x233446[_0xe8d8('0x41')]:_0x18a4ef[_0xe8d8('0x3d')];_0x233446[_0xe8d8('0x44')]=qs[_0xe8d8('0x45')](_0x4f4326['query'][_0xe8d8('0x45')]);_0x233446[_0xe8d8('0x47')]=qs[_0xe8d8('0x3f')](_['pick'](_0x4f4326[_0xe8d8('0x3e')],_0x18a4ef[_0xe8d8('0x3f')]));if(_0x4f4326['query'][_0xe8d8('0x2c')]){_0x233446[_0xe8d8('0x47')]=_[_0xe8d8('0x48')](_0x233446[_0xe8d8('0x47')],{'$or':_[_0xe8d8('0x2d')](_0x233446[_0xe8d8('0x41')],function(_0x577191){var _0x15db25={};_0x15db25[_0x577191]={'$like':'%'+_0x4f4326[_0xe8d8('0x3e')][_0xe8d8('0x2c')]+'%'};return _0x15db25;})});}_0x233446=_[_0xe8d8('0x48')]({},_0x233446,_0x4f4326[_0xe8d8('0x4a')]);return _0x49a308[_0xe8d8('0x70')](_0x233446);}})[_0xe8d8('0x28')](function(_0x44a823){if(_0x44a823){_0x3a737c=_0x44a823[_0xe8d8('0x43')];if(!_0x4f4326[_0xe8d8('0x3e')][_0xe8d8('0x6a')](_0xe8d8('0x66'))){_0x233446[_0xe8d8('0x23')]=qs['limit'](_0x4f4326[_0xe8d8('0x3e')]['limit']);_0x233446[_0xe8d8('0x22')]=qs['offset'](_0x4f4326[_0xe8d8('0x3e')][_0xe8d8('0x22')]);}return _0x49a308['getTeams'](_0x233446);}})['then'](function(_0x173dbd){if(_0x173dbd){return _0x173dbd?{'count':_0x3a737c,'rows':_0x173dbd}:null;}})[_0xe8d8('0x28')](respondWithResult(_0x84a425,null))[_0xe8d8('0x4e')](handleError(_0x84a425,null));};exports[_0xe8d8('0x71')]=function(_0x12de28,_0x13e156,_0x348f04){var _0x121a46=_0x12de28[_0xe8d8('0x55')]['teams'];var _0x1fb6a5=_[_0xe8d8('0x2d')](_0x121a46,'id');return db[_0xe8d8('0x6f')][_0xe8d8('0x4c')]({'where':{'id':_0x1fb6a5},'attributes':['id'],'include':[{'model':db['User'],'as':_0xe8d8('0x72'),'attributes':['id',_0xe8d8('0x32'),'online','voicePause',_0xe8d8('0x73')],'raw':!![]}]})['then'](function(_0x149b3b){if(_0x149b3b){var _0x1efa65=_[_0xe8d8('0x74')](_0x149b3b,function(_0x587f12){var _0x2b6e28=_0x587f12[_0xe8d8('0x56')]({'plain':!![]});_0x2b6e28[_0xe8d8('0x72')][_0xe8d8('0x75')](function(_0x504ad9){_0x504ad9[_0xe8d8('0x76')]=_[_0xe8d8('0x31')](_0x121a46,{'id':_0x2b6e28['id']})[_0xe8d8('0x76')];});return _0x2b6e28[_0xe8d8('0x72')];});return db[_0xe8d8('0x3a')]['find']({'where':{'id':_0x12de28[_0xe8d8('0x50')]['id']}})[_0xe8d8('0x28')](function(_0x49beae){return db[_0xe8d8('0x77')][_0xe8d8('0x78')](function(_0x485937){return _0x49beae[_0xe8d8('0x71')](_0x1fb6a5,{'transaction':_0x485937})[_0xe8d8('0x28')](function(){return BPromise[_0xe8d8('0x79')](_0x1efa65,function(_0x101064){return db[_0xe8d8('0x7a')][_0xe8d8('0x7b')]({'where':{'UserId':_0x101064['id'],'VoiceQueueId':_0x12de28[_0xe8d8('0x50')]['id']},'defaults':{'penalty':_0x101064['penalty']},'transaction':_0x485937});});})[_0xe8d8('0x28')](function(){return BPromise[_0xe8d8('0x79')](_[_0xe8d8('0x2c')](_0x1efa65,{'online':!![]}),function(_0x28f289){return db[_0xe8d8('0x7c')][_0xe8d8('0x7d')]({'membername':_0x28f289['name'],'UserId':_0x28f289['id'],'queue_name':_0x49beae['name'],'VoiceQueueId':_0x49beae['id'],'interface':_['isNil'](_0x28f289[_0xe8d8('0x73')])?util[_0xe8d8('0x7e')]('SIP/%s',_0x28f289[_0xe8d8('0x32')]):_0x28f289[_0xe8d8('0x73')],'paused':_0x28f289[_0xe8d8('0x7f')]||![],'penalty':_0x28f289['penalty']},{'transaction':_0x485937});});})[_0xe8d8('0x28')](function(){_0x1efa65[_0xe8d8('0x75')](function(_0x13adf7){socket[_0xe8d8('0x80')](_0xe8d8('0x81'),{'UserId':_0x13adf7['id'],'VoiceQueueId':_0x49beae['id']});});});});});}})[_0xe8d8('0x28')](respondWithStatusCode(_0x13e156,null))['catch'](handleError(_0x13e156,null));};exports['removeTeams']=function(_0x143768,_0x4e3e3d,_0x4b8af5){return db[_0xe8d8('0x6f')][_0xe8d8('0x4c')]({'where':{'id':_0x143768[_0xe8d8('0x3e')][_0xe8d8('0x82')]},'attributes':['id'],'include':[{'model':db[_0xe8d8('0x83')],'as':_0xe8d8('0x72'),'attributes':['id'],'raw':!![]}]})[_0xe8d8('0x28')](handleEntityNotFound(_0x4e3e3d,null))[_0xe8d8('0x28')](function(_0x32373f){var _0x392d25=_[_0xe8d8('0x2d')](_0x32373f,'id');var _0x15ecd6=[];var _0x96aff8=[];var _0x2a43d9=squel[_0xe8d8('0x84')]();_0x2a43d9['field']('tq.TeamId')['from']('team_has_voice_queues','tq')[_0xe8d8('0x85')]('user_has_teams','ut',_0xe8d8('0x86'))[_0xe8d8('0x47')](_0xe8d8('0x87'),_0x143768['params']['id']);for(var _0x1beb7d=0x0;_0x1beb7d<_0x32373f[_0xe8d8('0x43')];_0x1beb7d+=0x1){let _0x101e81=_0x32373f[_0x1beb7d];for(var _0x2c84d8=0x0;_0x2c84d8<_0x101e81[_0xe8d8('0x72')]['length'];_0x2c84d8+=0x1){let _0x109830=_0x101e81[_0xe8d8('0x72')][_0x2c84d8];var _0x455b9a=_0x2a43d9[_0xe8d8('0x88')]();_0x455b9a[_0xe8d8('0x47')](_0xe8d8('0x89'),_0x109830['id']);_0x96aff8[_0xe8d8('0x8a')](db[_0xe8d8('0x77')][_0xe8d8('0x3e')](_0x455b9a[_0xe8d8('0x8b')](),{'type':db[_0xe8d8('0x77')][_0xe8d8('0x8c')]['SELECT']})[_0xe8d8('0x28')](function(_0x49300a){if(_0x49300a['length']===0x1){return _0x109830['id'];}else{var _0x1862fd=_[_0xe8d8('0x8d')](_[_0xe8d8('0x2d')](_0x49300a,'TeamId'),function(_0x101561){return _['includes'](_0x392d25,_0x101561);});if(_0x1862fd){return _0x109830['id'];}}}));}}return BPromise[_0xe8d8('0x8e')](_0x96aff8)[_0xe8d8('0x28')](function(_0x304d03){_0x15ecd6=_(_0x15ecd6)[_0xe8d8('0x8f')](_0x304d03)[_0xe8d8('0x90')]()['value']();return db[_0xe8d8('0x3a')][_0xe8d8('0x31')]({'where':{'id':_0x143768[_0xe8d8('0x50')]['id']}})[_0xe8d8('0x28')](function(_0x5b3e6f){return db[_0xe8d8('0x77')][_0xe8d8('0x78')](function(_0x23bc19){return _0x5b3e6f[_0xe8d8('0x91')](_0x143768['query'][_0xe8d8('0x82')],{'transaction':_0x23bc19})[_0xe8d8('0x28')](function(){if(!_[_0xe8d8('0x92')](_0x15ecd6)){return _0x5b3e6f['removeAgents'](_0x15ecd6,{'transaction':_0x23bc19})['then'](function(){return db[_0xe8d8('0x7c')][_0xe8d8('0x62')]({'where':{'VoiceQueueId':_0x143768[_0xe8d8('0x50')]['id'],'UserId':_0x15ecd6},'transaction':_0x23bc19});});}})[_0xe8d8('0x28')](function(){_0x15ecd6[_0xe8d8('0x75')](function(_0x22ab5e){socket['emit'](_0xe8d8('0x93'),{'UserId':_0x22ab5e,'VoiceQueueId':_0x5b3e6f['id']});});});});});});})[_0xe8d8('0x28')](respondWithStatusCode(_0x4e3e3d,null))[_0xe8d8('0x4e')](handleError(_0x4e3e3d,null));};exports[_0xe8d8('0x94')]=function(_0x3ca0f2,_0x33e8b1,_0xd70626){var _0x3bd347,_0x856bbc;return db['VoiceQueue'][_0xe8d8('0x31')]({'where':{'id':_0x3ca0f2[_0xe8d8('0x50')]['id']}})[_0xe8d8('0x28')](handleEntityNotFound(_0x33e8b1,null))[_0xe8d8('0x28')](function(_0x442e1d){if(_0x442e1d){_0x856bbc=_0x442e1d;return _0x442e1d[_0xe8d8('0x94')](_0x3ca0f2[_0xe8d8('0x55')][_0xe8d8('0x82')],_[_0xe8d8('0x5d')](_0x3ca0f2[_0xe8d8('0x55')],[_0xe8d8('0x82'),'id'])||{})[_0xe8d8('0x95')](function(_0x1ed1ff){for(var _0x3cb9d5=0x0;_0x3cb9d5<_0x3ca0f2[_0xe8d8('0x55')]['ids'][_0xe8d8('0x43')];_0x3cb9d5+=0x1){socket['emit'](_0xe8d8('0x81'),{'UserId':_0x3ca0f2['body'][_0xe8d8('0x82')][_0x3cb9d5],'VoiceQueueId':_0x3ca0f2[_0xe8d8('0x50')]['id']});}return _0x1ed1ff;});}})[_0xe8d8('0x28')](function(_0x355212){_0x3bd347=_0x355212||[];if(_0x856bbc){return db[_0xe8d8('0x83')][_0xe8d8('0x4c')]({'where':{'id':_0x3ca0f2[_0xe8d8('0x55')][_0xe8d8('0x82')]},'attributes':['id',_0xe8d8('0x32'),_0xe8d8('0x96'),_0xe8d8('0x7f'),_0xe8d8('0x73')],'raw':!![]});}})[_0xe8d8('0x28')](function(_0x16d616){if(!_[_0xe8d8('0x92')](_0x16d616)){var _0x13545c=[];for(var _0x2969bb=0x0;_0x2969bb<_0x16d616['length'];_0x2969bb++){if(_0x16d616[_0x2969bb][_0xe8d8('0x96')]){_0x13545c[_0xe8d8('0x8a')](db[_0xe8d8('0x7c')]['upsert']({'membername':_0x16d616[_0x2969bb]['name'],'UserId':_0x16d616[_0x2969bb]['id'],'queue_name':_0x856bbc[_0xe8d8('0x32')],'VoiceQueueId':_0x856bbc['id'],'interface':_[_0xe8d8('0x97')](_0x16d616[_0x2969bb][_0xe8d8('0x73')])?util[_0xe8d8('0x7e')]('SIP/%s',_0x16d616[_0x2969bb]['name']):_0x16d616[_0x2969bb][_0xe8d8('0x73')],'paused':_0x16d616[_0x2969bb][_0xe8d8('0x7f')]||![],'penalty':_0x3ca0f2['body'][_0xe8d8('0x76')]||0x0}));}}return BPromise[_0xe8d8('0x8e')](_0x13545c);}})[_0xe8d8('0x28')](function(){return _0x3bd347;})[_0xe8d8('0x28')](respondWithResult(_0x33e8b1,null))[_0xe8d8('0x4e')](handleError(_0x33e8b1,null));};exports[_0xe8d8('0x98')]=function(_0x2d5e7f,_0x188d4b,_0x5173ff){return db[_0xe8d8('0x3a')][_0xe8d8('0x31')]({'where':{'id':_0x2d5e7f['params']['id']}})[_0xe8d8('0x28')](handleEntityNotFound(_0x188d4b,null))['then'](function(_0x1523fb){if(_0x1523fb){return _0x1523fb[_0xe8d8('0x98')](_0x2d5e7f[_0xe8d8('0x3e')][_0xe8d8('0x82')])[_0xe8d8('0x28')](function(){if(_['isArray'](_0x2d5e7f[_0xe8d8('0x3e')][_0xe8d8('0x82')])){for(var _0x2f73cc=0x0;_0x2f73cc<_0x2d5e7f[_0xe8d8('0x3e')][_0xe8d8('0x82')][_0xe8d8('0x43')];_0x2f73cc+=0x1){socket[_0xe8d8('0x80')](_0xe8d8('0x93'),{'UserId':Number(_0x2d5e7f[_0xe8d8('0x3e')][_0xe8d8('0x82')][_0x2f73cc]),'VoiceQueueId':Number(_0x2d5e7f['params']['id'])});}}else{socket['emit'](_0xe8d8('0x93'),{'UserId':Number(_0x2d5e7f['query'][_0xe8d8('0x82')]),'VoiceQueueId':Number(_0x2d5e7f[_0xe8d8('0x50')]['id'])});}});}})[_0xe8d8('0x28')](function(_0x26e10d){return db[_0xe8d8('0x7c')]['destroy']({'where':{'VoiceQueueId':_0x2d5e7f[_0xe8d8('0x50')]['id'],'UserId':_0x2d5e7f[_0xe8d8('0x3e')]['ids']}})[_0xe8d8('0x28')](function(){return _0x26e10d;});})[_0xe8d8('0x28')](respondWithStatusCode(_0x188d4b,null))['catch'](handleError(_0x188d4b,null));};exports[_0xe8d8('0x99')]=function(_0x10c3f2,_0x48fec5,_0x4ac5e8){var _0x540650={};var _0x144326={};var _0x3973cf;var _0x41743e;return db[_0xe8d8('0x3a')][_0xe8d8('0x64')]({'where':{'id':_0x10c3f2[_0xe8d8('0x50')]['id']}})['then'](handleEntityNotFound(_0x48fec5,null))[_0xe8d8('0x28')](function(_0x592f59){if(_0x592f59){_0x3973cf=_0x592f59;_0x144326['model']=_[_0xe8d8('0x51')](db[_0xe8d8('0x83')]['rawAttributes']);_0x144326['query']=_[_0xe8d8('0x51')](_0x10c3f2['query']);_0x144326[_0xe8d8('0x3f')]=_[_0xe8d8('0x40')](_0x144326['model'],_0x144326[_0xe8d8('0x3e')]);_0x540650['attributes']=_[_0xe8d8('0x40')](_0x144326[_0xe8d8('0x3d')],qs[_0xe8d8('0x42')](_0x10c3f2[_0xe8d8('0x3e')][_0xe8d8('0x42')]));_0x540650['attributes']=_0x540650[_0xe8d8('0x41')][_0xe8d8('0x43')]?_0x540650[_0xe8d8('0x41')]:_0x144326['model'];_0x540650[_0xe8d8('0x44')]=qs[_0xe8d8('0x45')](_0x10c3f2[_0xe8d8('0x3e')][_0xe8d8('0x45')]);_0x540650[_0xe8d8('0x47')]=qs[_0xe8d8('0x3f')](_['pick'](_0x10c3f2[_0xe8d8('0x3e')],_0x144326[_0xe8d8('0x3f')]));if(_0x10c3f2[_0xe8d8('0x3e')]['filter']){_0x540650[_0xe8d8('0x47')]=_[_0xe8d8('0x48')](_0x540650['where'],{'$or':_['map'](_0x540650[_0xe8d8('0x41')],function(_0x4a9629){var _0x2bebd1={};_0x2bebd1[_0x4a9629]={'$like':'%'+_0x10c3f2[_0xe8d8('0x3e')][_0xe8d8('0x2c')]+'%'};return _0x2bebd1;})});}_0x540650=_['merge']({},_0x540650,_0x10c3f2['options']);return _0x3973cf[_0xe8d8('0x99')](_0x540650);}})[_0xe8d8('0x28')](function(_0x2d3e7e){if(_0x2d3e7e){_0x41743e=_0x2d3e7e[_0xe8d8('0x43')];if(!_0x10c3f2['query'][_0xe8d8('0x6a')]('nolimit')){_0x540650[_0xe8d8('0x23')]=qs[_0xe8d8('0x23')](_0x10c3f2[_0xe8d8('0x3e')][_0xe8d8('0x23')]);_0x540650[_0xe8d8('0x22')]=qs[_0xe8d8('0x22')](_0x10c3f2['query']['offset']);}return _0x3973cf[_0xe8d8('0x99')](_0x540650);}})['then'](function(_0x43a136){if(_0x43a136){return _0x43a136?{'count':_0x41743e,'rows':_0x43a136}:null;}})[_0xe8d8('0x28')](respondWithResult(_0x48fec5,null))[_0xe8d8('0x4e')](handleError(_0x48fec5,null));};exports[_0xe8d8('0x9a')]=function(_0x431929,_0x423e0f,_0x111c09){var _0x1e45be={};var _0xa7da80={};var _0x3f81b4;var _0x15b2d5;return db[_0xe8d8('0x3a')][_0xe8d8('0x64')]({'where':{'id':_0x431929[_0xe8d8('0x50')]['id']}})[_0xe8d8('0x28')](handleEntityNotFound(_0x423e0f,null))['then'](function(_0x1cb60d){if(_0x1cb60d){_0x3f81b4=_0x1cb60d;_0xa7da80['model']=_['keys'](db[_0xe8d8('0x7c')][_0xe8d8('0x52')]);_0xa7da80[_0xe8d8('0x3e')]=_[_0xe8d8('0x51')](_0x431929['query']);_0xa7da80[_0xe8d8('0x3f')]=_[_0xe8d8('0x40')](_0xa7da80[_0xe8d8('0x3d')],_0xa7da80[_0xe8d8('0x3e')]);_0x1e45be[_0xe8d8('0x41')]=_[_0xe8d8('0x40')](_0xa7da80[_0xe8d8('0x3d')],qs[_0xe8d8('0x42')](_0x431929['query'][_0xe8d8('0x42')]));_0x1e45be[_0xe8d8('0x41')]=_0x1e45be[_0xe8d8('0x41')][_0xe8d8('0x43')]?_0x1e45be[_0xe8d8('0x41')]:_0xa7da80[_0xe8d8('0x3d')];_0x1e45be[_0xe8d8('0x44')]=qs['sort'](_0x431929[_0xe8d8('0x3e')][_0xe8d8('0x45')]);_0x1e45be[_0xe8d8('0x47')]=qs[_0xe8d8('0x3f')](_[_0xe8d8('0x46')](_0x431929[_0xe8d8('0x3e')],_0xa7da80['filters']));if(_0x431929[_0xe8d8('0x3e')][_0xe8d8('0x2c')]){_0x1e45be[_0xe8d8('0x47')]=_['merge'](_0x1e45be['where'],{'$or':_[_0xe8d8('0x2d')](_0x1e45be[_0xe8d8('0x41')],function(_0x54c5a1){var _0x53af61={};_0x53af61[_0x54c5a1]={'$like':'%'+_0x431929[_0xe8d8('0x3e')][_0xe8d8('0x2c')]+'%'};return _0x53af61;})});}_0x1e45be=_['merge']({},_0x1e45be,_0x431929[_0xe8d8('0x4a')]);return _0x3f81b4[_0xe8d8('0x9a')](_0x1e45be);}})[_0xe8d8('0x28')](function(_0x37eb67){if(_0x37eb67){_0x15b2d5=_0x37eb67['length'];if(!_0x431929[_0xe8d8('0x3e')][_0xe8d8('0x6a')](_0xe8d8('0x66'))){_0x1e45be['limit']=qs[_0xe8d8('0x23')](_0x431929[_0xe8d8('0x3e')][_0xe8d8('0x23')]);_0x1e45be[_0xe8d8('0x22')]=qs[_0xe8d8('0x22')](_0x431929[_0xe8d8('0x3e')][_0xe8d8('0x22')]);}return _0x3f81b4[_0xe8d8('0x9a')](_0x1e45be);}})[_0xe8d8('0x28')](function(_0xa1c867){return _0xa1c867?{'count':_0x15b2d5,'rows':_0xa1c867}:null;})[_0xe8d8('0x28')](respondWithResult(_0x423e0f,null))[_0xe8d8('0x4e')](handleError(_0x423e0f,null));};exports[_0xe8d8('0x9b')]=function(_0x6d9254,_0xacf33a,_0x3a0687){var _0x64d90c={};var _0x571360={};var _0x3fa25e;var _0x33e26b;return db[_0xe8d8('0x3a')]['findOne']({'where':{'id':_0x6d9254['params']['id']}})[_0xe8d8('0x28')](handleEntityNotFound(_0xacf33a,null))['then'](function(_0x36d5cc){if(_0x36d5cc){_0x3fa25e=_0x36d5cc;_0x571360[_0xe8d8('0x3d')]=_['keys'](db['CmList']['rawAttributes']);_0x571360[_0xe8d8('0x3e')]=_[_0xe8d8('0x51')](_0x6d9254['query']);_0x571360[_0xe8d8('0x3f')]=_[_0xe8d8('0x40')](_0x571360[_0xe8d8('0x3d')],_0x571360['query']);_0x64d90c['attributes']=_[_0xe8d8('0x40')](_0x571360['model'],qs[_0xe8d8('0x42')](_0x6d9254[_0xe8d8('0x3e')][_0xe8d8('0x42')]));_0x64d90c[_0xe8d8('0x41')]=_0x64d90c[_0xe8d8('0x41')][_0xe8d8('0x43')]?_0x64d90c['attributes']:_0x571360['model'];_0x64d90c[_0xe8d8('0x44')]=qs[_0xe8d8('0x45')](_0x6d9254[_0xe8d8('0x3e')][_0xe8d8('0x45')]);_0x64d90c['where']=qs['filters'](_['pick'](_0x6d9254[_0xe8d8('0x3e')],_0x571360[_0xe8d8('0x3f')]));if(_0x6d9254['query'][_0xe8d8('0x2c')]){_0x64d90c[_0xe8d8('0x47')]=_[_0xe8d8('0x48')](_0x64d90c['where'],{'$or':_[_0xe8d8('0x2d')](_0x64d90c[_0xe8d8('0x41')],function(_0x3e376c){var _0x43e6f5={};_0x43e6f5[_0x3e376c]={'$like':'%'+_0x6d9254[_0xe8d8('0x3e')][_0xe8d8('0x2c')]+'%'};return _0x43e6f5;})});}_0x64d90c=_[_0xe8d8('0x48')]({},_0x64d90c,_0x6d9254[_0xe8d8('0x4a')]);return _0x3fa25e[_0xe8d8('0x9b')](_0x64d90c);}})[_0xe8d8('0x28')](function(_0x172551){if(_0x172551){_0x33e26b=_0x172551[_0xe8d8('0x43')];if(!_0x6d9254[_0xe8d8('0x3e')][_0xe8d8('0x6a')](_0xe8d8('0x66'))){_0x64d90c[_0xe8d8('0x23')]=qs[_0xe8d8('0x23')](_0x6d9254[_0xe8d8('0x3e')]['limit']);_0x64d90c['offset']=qs[_0xe8d8('0x22')](_0x6d9254[_0xe8d8('0x3e')]['offset']);}return _0x3fa25e['getLists'](_0x64d90c);}})[_0xe8d8('0x28')](function(_0x3d45b9){if(_0x3d45b9){return _0x3d45b9?{'count':_0x33e26b,'rows':_0x3d45b9}:null;}})[_0xe8d8('0x28')](respondWithResult(_0xacf33a,null))['catch'](handleError(_0xacf33a,null));};exports[_0xe8d8('0x9c')]=function(_0x1b034a,_0x3651d7,_0x388324){var _0x3b7926,_0x79a74b;return db[_0xe8d8('0x3a')]['find']({'where':{'id':_0x1b034a[_0xe8d8('0x50')]['id']}})[_0xe8d8('0x28')](handleEntityNotFound(_0x3651d7,null))[_0xe8d8('0x28')](function(_0x59ebba){if(_0x59ebba){_0x79a74b=_0x59ebba;return _0x59ebba['addLists'](_0x1b034a[_0xe8d8('0x55')][_0xe8d8('0x82')],_[_0xe8d8('0x5d')](_0x1b034a['body'],[_0xe8d8('0x82'),'id'])||{});}return null;})[_0xe8d8('0x95')](function(_0x530ded){var _0x1daff3;_0x3b7926=_0x530ded||[];var _0x1a827e=[];if(_0x530ded){for(var _0xcf535c=0x0;_0xcf535c<_0x530ded['length'];_0xcf535c+=0x1){var _0x535e52=_0x530ded[_0xcf535c][_0xe8d8('0x56')]({'plain':!![]});_0x79a74b[_0xe8d8('0x9d')]=_0x1b034a[_0xe8d8('0x55')][_0xe8d8('0x9d')]?_0x1b034a[_0xe8d8('0x55')]['dialCheckDuplicateType']:_0x79a74b['dialCheckDuplicateType'];switch(_0x79a74b[_0xe8d8('0x9d')]){case'always':_0x1daff3=squel[_0xe8d8('0x9e')]()[_0xe8d8('0x9f')](_0xe8d8('0xa0'))[_0xe8d8('0xa1')]([_0xe8d8('0xa2'),_0xe8d8('0xa3'),_0xe8d8('0xa4'),_0xe8d8('0xa5'),_0xe8d8('0x67'),'createdAt','updatedAt'],squel[_0xe8d8('0x84')]()[_0xe8d8('0xa6')](_0xe8d8('0xa2'),_0xe8d8('0xa2'))[_0xe8d8('0xa6')](_0xe8d8('0xa7'),_0xe8d8('0xa3'))[_0xe8d8('0xa6')]('id',_0xe8d8('0xa4'))[_0xe8d8('0xa6')](_0x535e52[_0xe8d8('0xa8')][_0xe8d8('0x8b')](),_0xe8d8('0xa5'))[_0xe8d8('0xa6')](_0x1b034a[_0xe8d8('0x50')]['id'][_0xe8d8('0x8b')](),_0xe8d8('0x67'))['field'](_0xe8d8('0xa7'),_0xe8d8('0x5e'))[_0xe8d8('0xa6')](_0xe8d8('0xa7'),_0xe8d8('0x5f'))[_0xe8d8('0xa9')](_0xe8d8('0xaa'))['where'](_0xe8d8('0xab'))['where'](_0xe8d8('0xac'),_0x535e52[_0xe8d8('0xa8')]['toString']())['where'](_0xe8d8('0xad'))[_0xe8d8('0x47')](_0xe8d8('0xae'),squel[_0xe8d8('0x84')]()['field'](_0xe8d8('0xaf'))[_0xe8d8('0xa9')](_0xe8d8('0xb0'))['where']('VoiceQueueId\x20=\x20?',_0x1b034a['params']['id']['toString']()))['where'](_0xe8d8('0xae'),squel[_0xe8d8('0x84')]()[_0xe8d8('0xa6')](_0xe8d8('0xb1'))[_0xe8d8('0xa9')](_0xe8d8('0xa0'))[_0xe8d8('0x47')](_0xe8d8('0x87'),_0x1b034a[_0xe8d8('0x50')]['id'][_0xe8d8('0x8b')]())))[_0xe8d8('0x8b')]();break;case _0xe8d8('0xb2'):_0x1daff3=squel[_0xe8d8('0x9e')]()[_0xe8d8('0x9f')](_0xe8d8('0xa0'))[_0xe8d8('0xa1')](['phone',_0xe8d8('0xa3'),'ContactId',_0xe8d8('0xa5'),_0xe8d8('0x67'),'createdAt',_0xe8d8('0x5f')],squel[_0xe8d8('0x84')]()[_0xe8d8('0xa6')](_0xe8d8('0xa2'),'phone')[_0xe8d8('0xa6')]('NOW()',_0xe8d8('0xa3'))[_0xe8d8('0xa6')]('id',_0xe8d8('0xa4'))[_0xe8d8('0xa6')](_0x535e52[_0xe8d8('0xa8')][_0xe8d8('0x8b')](),_0xe8d8('0xa5'))[_0xe8d8('0xa6')](_0x1b034a[_0xe8d8('0x50')]['id'][_0xe8d8('0x8b')](),'VoiceQueueId')[_0xe8d8('0xa6')](_0xe8d8('0xa7'),_0xe8d8('0x5e'))[_0xe8d8('0xa6')](_0xe8d8('0xa7'),'updatedAt')[_0xe8d8('0xa9')](_0xe8d8('0xaa'))[_0xe8d8('0x47')](_0xe8d8('0xab'))[_0xe8d8('0x47')](_0xe8d8('0xac'),_0x535e52[_0xe8d8('0xa8')]['toString']())['where']('phone\x20IS\x20NOT\x20NULL')[_0xe8d8('0x47')](_0xe8d8('0xae'),squel['select']()[_0xe8d8('0xa6')](_0xe8d8('0xb1'))['from']('cm_hopper')[_0xe8d8('0x47')](_0xe8d8('0x87'),_0x1b034a[_0xe8d8('0x50')]['id']['toString']())))[_0xe8d8('0x8b')]();break;default:_0x1daff3=squel['insert']()[_0xe8d8('0x9f')]('cm_hopper')[_0xe8d8('0xa1')]([_0xe8d8('0xa2'),_0xe8d8('0xa3'),_0xe8d8('0xa4'),_0xe8d8('0xa5'),_0xe8d8('0x67'),_0xe8d8('0x5e'),_0xe8d8('0x5f')],squel[_0xe8d8('0x84')]()[_0xe8d8('0xa6')](_0xe8d8('0xa2'),_0xe8d8('0xa2'))[_0xe8d8('0xa6')](_0xe8d8('0xa7'),'scheduledAt')[_0xe8d8('0xa6')]('id',_0xe8d8('0xa4'))[_0xe8d8('0xa6')](_0x535e52[_0xe8d8('0xa8')][_0xe8d8('0x8b')](),_0xe8d8('0xa5'))['field'](_0x1b034a['params']['id']['toString'](),_0xe8d8('0x67'))['field']('NOW()',_0xe8d8('0x5e'))['field']('NOW()',_0xe8d8('0x5f'))['from'](_0xe8d8('0xaa'))[_0xe8d8('0x47')](_0xe8d8('0xab'))['where'](_0xe8d8('0xac'),_0x535e52['CmListId'][_0xe8d8('0x8b')]())[_0xe8d8('0x47')](_0xe8d8('0xad')))[_0xe8d8('0x8b')]();}_0x1a827e['push'](db[_0xe8d8('0x77')]['query'](_0x1daff3));}return BPromise[_0xe8d8('0x8e')](_0x1a827e);}})['then'](function(){return _0x3b7926;})[_0xe8d8('0x28')](respondWithResult(_0x3651d7,null))[_0xe8d8('0x4e')](handleError(_0x3651d7,null));};exports['removeLists']=function(_0x14be64,_0xbcaf58,_0x23c330){return db['VoiceQueue']['find']({'where':{'id':_0x14be64[_0xe8d8('0x50')]['id']}})[_0xe8d8('0x28')](handleEntityNotFound(_0xbcaf58,null))[_0xe8d8('0x28')](function(_0x509aef){if(_0x509aef){return _0x509aef[_0xe8d8('0xb3')](_0x14be64[_0xe8d8('0x3e')]['ids']);}})[_0xe8d8('0x28')](function(_0x98ca32){if(_0x98ca32){return db[_0xe8d8('0x65')][_0xe8d8('0x62')]({'where':{'ListId':_0x14be64['query'][_0xe8d8('0x82')],'VoiceQueueId':_0x14be64[_0xe8d8('0x50')]['id']}})['then'](function(){return _0x98ca32;});}})[_0xe8d8('0x28')](respondWithStatusCode(_0xbcaf58,null))[_0xe8d8('0x4e')](handleError(_0xbcaf58,null));};exports['getBlackLists']=function(_0x897df7,_0xd9febf,_0x4633f1){var _0x367c60={};var _0x2b9142={};var _0x2adc6d;var _0x232379;return db[_0xe8d8('0x3a')][_0xe8d8('0x64')]({'where':{'id':_0x897df7[_0xe8d8('0x50')]['id']}})[_0xe8d8('0x28')](handleEntityNotFound(_0xd9febf,null))['then'](function(_0x19ddf2){if(_0x19ddf2){_0x2adc6d=_0x19ddf2;_0x2b9142[_0xe8d8('0x3d')]=_[_0xe8d8('0x51')](db[_0xe8d8('0xb4')][_0xe8d8('0x52')]);_0x2b9142[_0xe8d8('0x3e')]=_[_0xe8d8('0x51')](_0x897df7[_0xe8d8('0x3e')]);_0x2b9142['filters']=_[_0xe8d8('0x40')](_0x2b9142[_0xe8d8('0x3d')],_0x2b9142[_0xe8d8('0x3e')]);_0x367c60[_0xe8d8('0x41')]=_[_0xe8d8('0x40')](_0x2b9142['model'],qs[_0xe8d8('0x42')](_0x897df7[_0xe8d8('0x3e')][_0xe8d8('0x42')]));_0x367c60[_0xe8d8('0x41')]=_0x367c60[_0xe8d8('0x41')][_0xe8d8('0x43')]?_0x367c60[_0xe8d8('0x41')]:_0x2b9142[_0xe8d8('0x3d')];_0x367c60[_0xe8d8('0x44')]=qs['sort'](_0x897df7[_0xe8d8('0x3e')][_0xe8d8('0x45')]);_0x367c60['where']=qs[_0xe8d8('0x3f')](_[_0xe8d8('0x46')](_0x897df7['query'],_0x2b9142['filters']));if(_0x897df7[_0xe8d8('0x3e')][_0xe8d8('0x2c')]){_0x367c60[_0xe8d8('0x47')]=_[_0xe8d8('0x48')](_0x367c60[_0xe8d8('0x47')],{'$or':_[_0xe8d8('0x2d')](_0x367c60[_0xe8d8('0x41')],function(_0x5046ed){var _0x39af00={};_0x39af00[_0x5046ed]={'$like':'%'+_0x897df7[_0xe8d8('0x3e')][_0xe8d8('0x2c')]+'%'};return _0x39af00;})});}_0x367c60=_[_0xe8d8('0x48')]({},_0x367c60,_0x897df7[_0xe8d8('0x4a')]);return _0x2adc6d[_0xe8d8('0xb5')](_0x367c60);}})['then'](function(_0x51afea){if(_0x51afea){_0x232379=_0x51afea[_0xe8d8('0x43')];if(!_0x897df7[_0xe8d8('0x3e')]['hasOwnProperty'](_0xe8d8('0x66'))){_0x367c60['limit']=qs[_0xe8d8('0x23')](_0x897df7[_0xe8d8('0x3e')][_0xe8d8('0x23')]);_0x367c60[_0xe8d8('0x22')]=qs[_0xe8d8('0x22')](_0x897df7[_0xe8d8('0x3e')][_0xe8d8('0x22')]);}return _0x2adc6d['getBlackLists'](_0x367c60);}})[_0xe8d8('0x28')](function(_0x3d53b3){if(_0x3d53b3){return _0x3d53b3?{'count':_0x232379,'rows':_0x3d53b3}:null;}})[_0xe8d8('0x28')](respondWithResult(_0xd9febf,null))[_0xe8d8('0x4e')](handleError(_0xd9febf,null));};exports[_0xe8d8('0xb6')]=function(_0x1ad650,_0x51c948,_0x31dc30){var _0x2f3ef9,_0x5c60c0;return db[_0xe8d8('0x3a')][_0xe8d8('0x31')]({'where':{'id':_0x1ad650[_0xe8d8('0x50')]['id']}})['then'](handleEntityNotFound(_0x51c948,null))['then'](function(_0x45aa59){if(_0x45aa59){_0x5c60c0=_0x45aa59;return _0x45aa59[_0xe8d8('0xb6')](_0x1ad650[_0xe8d8('0x55')][_0xe8d8('0x82')],_[_0xe8d8('0x5d')](_0x1ad650['body'],[_0xe8d8('0x82'),'id'])||{});}return null;})[_0xe8d8('0x95')](function(_0x2b9039){var _0x3dd67b;_0x2f3ef9=_0x2b9039||[];var _0xf1654b=[];if(_0x2b9039){for(var _0x387b81=0x0;_0x387b81<_0x2b9039[_0xe8d8('0x43')];_0x387b81+=0x1){var _0x475017=_0x2b9039[_0x387b81]['get']({'plain':!![]});_0x3dd67b=squel[_0xe8d8('0x9e')]()['into'](_0xe8d8('0xb7'))[_0xe8d8('0xa1')]([_0xe8d8('0xa2'),_0xe8d8('0xa4'),'ListId',_0xe8d8('0x67'),_0xe8d8('0x5e'),_0xe8d8('0x5f')],squel[_0xe8d8('0x84')]()['field'](_0xe8d8('0xa2'),_0xe8d8('0xa2'))[_0xe8d8('0xa6')]('id',_0xe8d8('0xa4'))['field'](_0x475017[_0xe8d8('0xa8')][_0xe8d8('0x8b')](),_0xe8d8('0xa5'))['field'](_0x1ad650[_0xe8d8('0x50')]['id'][_0xe8d8('0x8b')](),_0xe8d8('0x67'))[_0xe8d8('0xa6')](_0xe8d8('0xa7'),'createdAt')[_0xe8d8('0xa6')]('NOW()','updatedAt')[_0xe8d8('0xa9')](_0xe8d8('0xaa'))[_0xe8d8('0x47')]('deletedAt\x20IS\x20NULL')[_0xe8d8('0x47')](_0xe8d8('0xac'),_0x475017[_0xe8d8('0xa8')][_0xe8d8('0x8b')]())[_0xe8d8('0x47')](_0xe8d8('0xad')))[_0xe8d8('0x8b')]();_0xf1654b[_0xe8d8('0x8a')](db['sequelize'][_0xe8d8('0x3e')](_0x3dd67b));}return BPromise[_0xe8d8('0x8e')](_0xf1654b);}})[_0xe8d8('0x28')](function(){return _0x2f3ef9;})['then'](respondWithResult(_0x51c948,null))[_0xe8d8('0x4e')](handleError(_0x51c948,null));};exports[_0xe8d8('0xb8')]=function(_0x546a46,_0x272174,_0x68e359){return db['VoiceQueue'][_0xe8d8('0x31')]({'where':{'id':_0x546a46['params']['id']}})[_0xe8d8('0x28')](handleEntityNotFound(_0x272174,null))['then'](function(_0xda94a7){if(_0xda94a7){return _0xda94a7[_0xe8d8('0xb8')](_0x546a46[_0xe8d8('0x3e')][_0xe8d8('0x82')]);}})[_0xe8d8('0x28')](function(_0xf86f62){if(_0xf86f62){return db[_0xe8d8('0x6e')][_0xe8d8('0x62')]({'where':{'ListId':_0x546a46[_0xe8d8('0x3e')]['ids'],'VoiceQueueId':_0x546a46[_0xe8d8('0x50')]['id']}})[_0xe8d8('0x28')](function(){return _0xf86f62;});}})[_0xe8d8('0x28')](respondWithStatusCode(_0x272174,null))[_0xe8d8('0x4e')](handleError(_0x272174,null));};
\ No newline at end of file
+var _0x6564=['isArray','getAgents','getMembers','getLists','CmList','addLists','dialCheckDuplicateType','always','insert','into','cm_hopper','fromQuery','phone','scheduledAt','ContactId','ListId','field','CmListId','NOW()','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20NOT\x20IN\x20(?)','select','cm_hopper_final','COALESCE(phone,\x27\x27)','onlyIfOpen','phone\x20IS\x20NOT\x20NULL','removeLists','getBlackLists','addBlackLists','cm_hopper_black','removeBlackLists','html-pdf','eml-format','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','ejs','lodash','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./voiceQueue.socket','register','sendStatus','status','end','json','count','offset','limit','Content-Range','apply','reject','save','update','destroy','get','inbound','QueueCampaigns','outbound','ignore','map','value','find','type','name','UserProfileResource','then','index','VoiceQueue','rawAttributes','fieldName','key','model','query','filters','intersection','fields','attributes','nolimit','sort','pick','where','VIRTUAL','filter','merge','options','includeAll','include','findAll','rows','show','params','keys','length','catch','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','VoiceQueues','UserProfileSection','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','createdAt','updatedAt','userProfileId','getHoppers','hasOwnProperty','VoiceQueueId','CmHopper','getHopperHistories','findOne','CmHopperHistory','getHopperFinals','CmHopperFinal','order','getHopperBlacks','CmHopperBlack','getTeams','Team','addTeams','teams','User','Agents','online','interface','flatMap','forEach','penalty','sequelize','transaction','each','UserVoiceQueue','findOrCreate','UserVoiceQueueRt','upsert','SIP/%s','voicePause','emit','removeTeams','from','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','VoiceQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','toString','every','includes','all','union','compact','isEmpty','userVoiceQueue:remove','addAgents','omit','ids','spread','userVoiceQueue:save','isNil','format','removeAgents'];(function(_0x38122e,_0xa01a06){var _0xc5ceb0=function(_0x5c1e4f){while(--_0x5c1e4f){_0x38122e['push'](_0x38122e['shift']());}};_0xc5ceb0(++_0xa01a06);}(_0x6564,0xda));var _0x4656=function(_0x52f13e,_0x4071bb){_0x52f13e=_0x52f13e-0x0;var _0x413c8b=_0x6564[_0x52f13e];return _0x413c8b;};'use strict';var pdf=require(_0x4656('0x0'));var emlformat=require(_0x4656('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x4656('0x2'));var jsonpatch=require(_0x4656('0x3'));var rp=require('request-promise');var moment=require(_0x4656('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x4656('0x5'));var util=require(_0x4656('0x6'));var path=require(_0x4656('0x7'));var sox=require(_0x4656('0x8'));var csv=require(_0x4656('0x9'));var ejs=require(_0x4656('0xa'));var fs=require('fs');var _=require(_0x4656('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x4656('0xc'));var toCsv=require('to-csv');var querystring=require(_0x4656('0xd'));var Papa=require(_0x4656('0xe'));var Redis=require(_0x4656('0xf'));var authService=require(_0x4656('0x10'));var qs=require(_0x4656('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4656('0x12'));var logger=require(_0x4656('0x13'))(_0x4656('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x4656('0x15'))['db'];config[_0x4656('0x16')]=_[_0x4656('0x17')](config[_0x4656('0x16')],{'host':_0x4656('0x18'),'port':0x18eb});var socket=require(_0x4656('0x19'))(new Redis(config[_0x4656('0x16')]));require(_0x4656('0x1a'))[_0x4656('0x1b')](socket);function respondWithStatusCode(_0x2168b3,_0x4b9249){_0x4b9249=_0x4b9249||0xcc;return function(_0x53cb44){if(_0x53cb44){return _0x2168b3[_0x4656('0x1c')](_0x4b9249);}return _0x2168b3[_0x4656('0x1d')](_0x4b9249)[_0x4656('0x1e')]();};}function respondWithResult(_0xee9793,_0x64a4df){_0x64a4df=_0x64a4df||0xc8;return function(_0x36c7ed){if(_0x36c7ed){return _0xee9793[_0x4656('0x1d')](_0x64a4df)[_0x4656('0x1f')](_0x36c7ed);}};}function respondWithFilteredResult(_0x4d1b9a,_0x582197){return function(_0x297415){if(_0x297415){var _0x34e58e=_0x297415[_0x4656('0x20')],_0x25be55=_0x582197['offset'],_0x2f3bd0=_0x582197[_0x4656('0x21')]+_0x582197[_0x4656('0x22')],_0x54985c;if(_0x2f3bd0>=_0x34e58e){_0x2f3bd0=_0x34e58e;_0x54985c=0xc8;}else{_0x54985c=0xce;}_0x4d1b9a[_0x4656('0x1d')](_0x54985c);return _0x4d1b9a['set'](_0x4656('0x23'),_0x25be55+'-'+_0x2f3bd0+'/'+_0x34e58e)['json'](_0x297415);}return null;};}function patchUpdates(_0x44df1f){return function(_0x5a6452){try{jsonpatch[_0x4656('0x24')](_0x5a6452,_0x44df1f,!![]);}catch(_0x3b6c4a){return BPromise[_0x4656('0x25')](_0x3b6c4a);}return _0x5a6452[_0x4656('0x26')]();};}function saveUpdates(_0x38130a,_0x26b2e3){return function(_0x3138ad){if(_0x3138ad){return _0x3138ad[_0x4656('0x27')](_0x38130a)['then'](function(_0x20fe23){return _0x20fe23;});}return null;};}function removeEntity(_0x42ae8a,_0x25c0d4){return function(_0x53b01d){if(_0x53b01d){return _0x53b01d[_0x4656('0x28')]()['then'](function(){var _0x34b3e1=_0x53b01d[_0x4656('0x29')]({'plain':!![]});var _0x3bf36a=[{'name':'VoiceQueues','value':_0x4656('0x2a'),'ignore':![]},{'name':_0x4656('0x2b'),'value':_0x4656('0x2c'),'ignore':![]}];var _0x2fb764=_(_0x3bf36a)['filter'](_0x4656('0x2d'))[_0x4656('0x2e')](_0x4656('0x2f'))[_0x4656('0x2f')]();if(_['includes'](_0x2fb764,_0x34b3e1['type'])){return;}var _0x46f4b5=_[_0x4656('0x30')](_0x3bf36a,[_0x4656('0x2f'),_0x34b3e1[_0x4656('0x31')]])[_0x4656('0x32')];return db[_0x4656('0x33')]['destroy']({'where':{'type':_0x46f4b5,'resourceId':_0x34b3e1['id']}})[_0x4656('0x34')](function(){return _0x53b01d;});})[_0x4656('0x34')](function(){_0x42ae8a[_0x4656('0x1d')](0xcc)[_0x4656('0x1e')]();});}};}function handleEntityNotFound(_0x491ba7,_0xa63ca4){return function(_0x57b1ab){if(!_0x57b1ab){_0x491ba7[_0x4656('0x1c')](0x194);}return _0x57b1ab;};}function handleError(_0x4f5f56,_0xee17aa){_0xee17aa=_0xee17aa||0x1f4;return function(_0x33afee){logger['error'](_0x33afee['stack']);if(_0x33afee['name']){delete _0x33afee[_0x4656('0x32')];}_0x4f5f56['status'](_0xee17aa)['send'](_0x33afee);};}exports[_0x4656('0x35')]=function(_0x119e0e,_0x238411){var _0xa8b17a={},_0x290149={},_0x5829e1={'count':0x0,'rows':[]};var _0x2b6fdb=_[_0x4656('0x2e')](db[_0x4656('0x36')][_0x4656('0x37')],function(_0x5ad3e5){return{'name':_0x5ad3e5[_0x4656('0x38')],'type':_0x5ad3e5[_0x4656('0x31')][_0x4656('0x39')]};});_0x290149[_0x4656('0x3a')]=_[_0x4656('0x2e')](_0x2b6fdb,_0x4656('0x32'));_0x290149[_0x4656('0x3b')]=_['keys'](_0x119e0e['query']);_0x290149[_0x4656('0x3c')]=_[_0x4656('0x3d')](_0x290149[_0x4656('0x3a')],_0x290149[_0x4656('0x3b')]);_0xa8b17a['attributes']=_['intersection'](_0x290149[_0x4656('0x3a')],qs[_0x4656('0x3e')](_0x119e0e['query'][_0x4656('0x3e')]));_0xa8b17a[_0x4656('0x3f')]=_0xa8b17a[_0x4656('0x3f')]['length']?_0xa8b17a[_0x4656('0x3f')]:_0x290149['model'];if(!_0x119e0e[_0x4656('0x3b')]['hasOwnProperty'](_0x4656('0x40'))){_0xa8b17a['limit']=qs[_0x4656('0x22')](_0x119e0e[_0x4656('0x3b')][_0x4656('0x22')]);_0xa8b17a[_0x4656('0x21')]=qs[_0x4656('0x21')](_0x119e0e[_0x4656('0x3b')][_0x4656('0x21')]);}_0xa8b17a['order']=qs[_0x4656('0x41')](_0x119e0e[_0x4656('0x3b')]['sort']);_0xa8b17a['where']=qs[_0x4656('0x3c')](_[_0x4656('0x42')](_0x119e0e[_0x4656('0x3b')],_0x290149[_0x4656('0x3c')]),_0x2b6fdb);if(_0x119e0e[_0x4656('0x3b')]['filter']){_0xa8b17a[_0x4656('0x43')]=_['merge'](_0xa8b17a['where'],{'$or':_['map'](_0x2b6fdb,function(_0x5d0c5b){if(_0x5d0c5b[_0x4656('0x31')]!==_0x4656('0x44')){var _0x45b0e1={};_0x45b0e1[_0x5d0c5b['name']]={'$like':'%'+_0x119e0e['query'][_0x4656('0x45')]+'%'};return _0x45b0e1;}})});}_0xa8b17a=_[_0x4656('0x46')]({},_0xa8b17a,_0x119e0e[_0x4656('0x47')]);var _0x5bc397={'where':_0xa8b17a[_0x4656('0x43')]};return db[_0x4656('0x36')]['count'](_0x5bc397)[_0x4656('0x34')](function(_0x595a48){_0x5829e1['count']=_0x595a48;if(_0x119e0e[_0x4656('0x3b')][_0x4656('0x48')]){_0xa8b17a[_0x4656('0x49')]=[{'all':!![]}];}return db[_0x4656('0x36')][_0x4656('0x4a')](_0xa8b17a);})['then'](function(_0x22e84f){_0x5829e1[_0x4656('0x4b')]=_0x22e84f;return _0x5829e1;})['then'](respondWithFilteredResult(_0x238411,_0xa8b17a))['catch'](handleError(_0x238411,null));};exports[_0x4656('0x4c')]=function(_0x2ecfd1,_0x3f1367){var _0x106708={'raw':![],'where':{'id':_0x2ecfd1[_0x4656('0x4d')]['id']}},_0x3c3fae={};_0x3c3fae['model']=_['keys'](db[_0x4656('0x36')][_0x4656('0x37')]);_0x3c3fae['query']=_[_0x4656('0x4e')](_0x2ecfd1['query']);_0x3c3fae[_0x4656('0x3c')]=_[_0x4656('0x3d')](_0x3c3fae[_0x4656('0x3a')],_0x3c3fae[_0x4656('0x3b')]);_0x106708[_0x4656('0x3f')]=_[_0x4656('0x3d')](_0x3c3fae['model'],qs[_0x4656('0x3e')](_0x2ecfd1[_0x4656('0x3b')]['fields']));_0x106708[_0x4656('0x3f')]=_0x106708['attributes'][_0x4656('0x4f')]?_0x106708[_0x4656('0x3f')]:_0x3c3fae[_0x4656('0x3a')];if(_0x2ecfd1[_0x4656('0x3b')][_0x4656('0x48')]){_0x106708['include']=[{'all':!![]}];}_0x106708=_[_0x4656('0x46')]({},_0x106708,_0x2ecfd1[_0x4656('0x47')]);return db[_0x4656('0x36')]['find'](_0x106708)[_0x4656('0x34')](handleEntityNotFound(_0x3f1367,null))[_0x4656('0x34')](respondWithResult(_0x3f1367,null))[_0x4656('0x50')](handleError(_0x3f1367,null));};exports[_0x4656('0x51')]=function(_0x4426e3,_0x13cc3f){return db['VoiceQueue'][_0x4656('0x51')](_0x4426e3[_0x4656('0x52')],{})['then'](function(_0x391988){var _0x7a6cf2=_0x4426e3['user'][_0x4656('0x29')]({'plain':!![]});if(!_0x7a6cf2)throw new Error(_0x4656('0x53'));if(_0x7a6cf2[_0x4656('0x54')]===_0x4656('0x55')){var _0x4c8ec=_0x391988[_0x4656('0x29')]({'plain':!![]});var _0x24c691=[{'name':_0x4656('0x56'),'value':'inbound'},{'name':_0x4656('0x2b'),'value':'outbound'}];var _0x7653d0=_[_0x4656('0x30')](_0x24c691,[_0x4656('0x2f'),_0x4c8ec['type']])[_0x4656('0x32')];return db[_0x4656('0x57')][_0x4656('0x30')]({'where':{'name':_0x7653d0,'userProfileId':_0x7a6cf2['userProfileId']},'raw':!![]})[_0x4656('0x34')](function(_0x2b93a1){if(_0x2b93a1&&_0x2b93a1[_0x4656('0x58')]===0x0){return db[_0x4656('0x33')]['create']({'name':_0x4c8ec['name'],'resourceId':_0x4c8ec['id'],'type':_0x2b93a1['name'],'sectionId':_0x2b93a1['id']},{})[_0x4656('0x34')](function(){return _0x391988;});}else{return _0x391988;}})['catch'](function(_0x467190){logger[_0x4656('0x59')](_0x4656('0x5a'),_0x467190);throw _0x467190;});}return _0x391988;})[_0x4656('0x34')](respondWithResult(_0x13cc3f,0xc9))['catch'](handleError(_0x13cc3f,null));};exports[_0x4656('0x5b')]=function(_0x25f3cc,_0x2160f6){var _0x554bcb={'where':{'id':_0x25f3cc['params']['id']}},_0x1d55f8={};_0x1d55f8['model']=_[_0x4656('0x4e')](db[_0x4656('0x36')][_0x4656('0x37')]);_0x554bcb[_0x4656('0x3f')]=_[_0x4656('0x3d')](_0x1d55f8[_0x4656('0x3a')],qs[_0x4656('0x3e')](_0x25f3cc[_0x4656('0x3b')][_0x4656('0x3e')]));_0x554bcb[_0x4656('0x3f')]=_0x554bcb[_0x4656('0x3f')]['length']?_0x554bcb[_0x4656('0x3f')]:_0x1d55f8[_0x4656('0x3a')];if(_0x25f3cc['query']['includeAll']){_0x554bcb['include']=[{'all':!![]}];}_0x554bcb=_[_0x4656('0x46')]({},_0x554bcb,_0x25f3cc[_0x4656('0x47')]);return db[_0x4656('0x36')][_0x4656('0x30')](_0x554bcb)[_0x4656('0x34')](handleEntityNotFound(_0x2160f6,null))[_0x4656('0x34')](function(_0x560aba){if(_0x560aba){var _0x477fe2=_0x560aba[_0x4656('0x29')]({'plain':!![]});_0x477fe2=qs['omit'](_0x477fe2,['id',_0x4656('0x5c'),_0x4656('0x5d')]);_0x25f3cc[_0x4656('0x52')]=_['omit'](_0x25f3cc['body'],['id',_0x4656('0x5c'),'updatedAt']);return db[_0x4656('0x36')][_0x4656('0x51')](_['merge'](_0x477fe2,_0x25f3cc[_0x4656('0x52')]),{'include':_0x25f3cc[_0x4656('0x3b')][_0x4656('0x48')]?[{'all':!![]}]:undefined})[_0x4656('0x34')](function(_0x5a4879){var _0x482860=_0x25f3cc[_0x4656('0x55')][_0x4656('0x29')]({'plain':!![]});if(!_0x482860)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x482860['role']==='user'){var _0x5256ae=_0x5a4879[_0x4656('0x29')]({'plain':!![]});var _0x3e1cfe=[{'name':'VoiceQueues','value':_0x4656('0x2a')},{'name':_0x4656('0x2b'),'value':'outbound'}];var _0x338ce8=_[_0x4656('0x30')](_0x3e1cfe,[_0x4656('0x2f'),_0x5256ae[_0x4656('0x31')]])[_0x4656('0x32')];return db['UserProfileSection'][_0x4656('0x30')]({'where':{'name':_0x338ce8,'userProfileId':_0x482860[_0x4656('0x5e')]},'raw':!![]})[_0x4656('0x34')](function(_0x44d7a3){if(_0x44d7a3&&_0x44d7a3[_0x4656('0x58')]===0x0){return db[_0x4656('0x33')][_0x4656('0x51')]({'name':_0x5256ae[_0x4656('0x32')],'resourceId':_0x5256ae['id'],'type':_0x44d7a3[_0x4656('0x32')],'sectionId':_0x44d7a3['id']},{})[_0x4656('0x34')](function(){return _0x5a4879;});}else{return _0x5a4879;}})[_0x4656('0x50')](function(_0x30eafc){logger[_0x4656('0x59')](_0x4656('0x5a'),_0x30eafc);throw _0x30eafc;});}return _0x5a4879;});}})[_0x4656('0x34')](respondWithResult(_0x2160f6,0xc9))['catch'](handleError(_0x2160f6,null));};exports[_0x4656('0x27')]=function(_0x1efd0c,_0x1343b7){if(_0x1efd0c['body']['id']){delete _0x1efd0c[_0x4656('0x52')]['id'];}return db['VoiceQueue']['find']({'where':{'id':_0x1efd0c[_0x4656('0x4d')]['id']}})[_0x4656('0x34')](handleEntityNotFound(_0x1343b7,null))['then'](saveUpdates(_0x1efd0c[_0x4656('0x52')],null))[_0x4656('0x34')](respondWithResult(_0x1343b7,null))['catch'](handleError(_0x1343b7,null));};exports[_0x4656('0x28')]=function(_0x561f50,_0x542734){return db[_0x4656('0x36')][_0x4656('0x30')]({'where':{'id':_0x561f50[_0x4656('0x4d')]['id']}})[_0x4656('0x34')](handleEntityNotFound(_0x542734,null))[_0x4656('0x34')](removeEntity(_0x542734,null))['catch'](handleError(_0x542734,null));};exports[_0x4656('0x5f')]=function(_0x124ee4,_0x23b6e4,_0x19258e){var _0x25a8c4={'raw':![],'where':{}};var _0x49b859={};var _0x49d526={'count':0x0,'rows':[]};return db[_0x4656('0x36')]['findOne']({'where':{'id':_0x124ee4['params']['id']}})['then'](handleEntityNotFound(_0x23b6e4,null))['then'](function(_0x195d21){if(_0x195d21){_0x49b859[_0x4656('0x3a')]=_[_0x4656('0x4e')](db['CmHopper'][_0x4656('0x37')]);_0x49b859['query']=_['keys'](_0x124ee4[_0x4656('0x3b')]);_0x49b859['filters']=_['intersection'](_0x49b859[_0x4656('0x3a')],_0x49b859[_0x4656('0x3b')]);_0x25a8c4[_0x4656('0x3f')]=_['intersection'](_0x49b859[_0x4656('0x3a')],qs[_0x4656('0x3e')](_0x124ee4['query'][_0x4656('0x3e')]));_0x25a8c4['attributes']=_0x25a8c4[_0x4656('0x3f')][_0x4656('0x4f')]?_0x25a8c4['attributes']:_0x49b859[_0x4656('0x3a')];if(!_0x124ee4['query'][_0x4656('0x60')](_0x4656('0x40'))){_0x25a8c4[_0x4656('0x22')]=qs['limit'](_0x124ee4[_0x4656('0x3b')][_0x4656('0x22')]);_0x25a8c4['offset']=qs['offset'](_0x124ee4[_0x4656('0x3b')][_0x4656('0x21')]);}_0x25a8c4['order']=qs['sort'](_0x124ee4['query'][_0x4656('0x41')]);_0x25a8c4['where']=qs[_0x4656('0x3c')](_[_0x4656('0x42')](_0x124ee4['query'],_0x49b859[_0x4656('0x3c')]));_0x25a8c4[_0x4656('0x43')][_0x4656('0x61')]=_0x195d21['id'];if(_0x124ee4[_0x4656('0x3b')][_0x4656('0x45')]){_0x25a8c4[_0x4656('0x43')]=_['merge'](_0x25a8c4['where'],{'$or':_[_0x4656('0x2e')](_0x25a8c4['attributes'],function(_0x24626b){var _0x30a50f={};_0x30a50f[_0x24626b]={'$like':'%'+_0x124ee4['query'][_0x4656('0x45')]+'%'};return _0x30a50f;})});}_0x25a8c4=_[_0x4656('0x46')]({},_0x25a8c4,_0x124ee4[_0x4656('0x47')]);return db[_0x4656('0x62')][_0x4656('0x20')]({'where':_0x25a8c4['where']})[_0x4656('0x34')](function(_0x484b9c){_0x49d526[_0x4656('0x20')]=_0x484b9c;if(_0x124ee4[_0x4656('0x3b')]['includeAll']){_0x25a8c4[_0x4656('0x49')]=[{'all':!![]}];}return db['CmHopper'][_0x4656('0x4a')](_0x25a8c4);})[_0x4656('0x34')](function(_0x3b6a91){_0x49d526['rows']=_0x3b6a91;return _0x49d526;});}})[_0x4656('0x34')](respondWithFilteredResult(_0x23b6e4,_0x25a8c4))['catch'](handleError(_0x23b6e4,null));};exports[_0x4656('0x63')]=function(_0x29fc9f,_0x527f50,_0x2a6ffb){var _0x418285={'raw':!![],'where':{}};var _0xbfa552={};var _0x2712c4={'count':0x0,'rows':[]};return db[_0x4656('0x36')][_0x4656('0x64')]({'where':{'id':_0x29fc9f[_0x4656('0x4d')]['id']}})[_0x4656('0x34')](handleEntityNotFound(_0x527f50,null))[_0x4656('0x34')](function(_0x4c9a1b){if(_0x4c9a1b){_0xbfa552[_0x4656('0x3a')]=_[_0x4656('0x4e')](db[_0x4656('0x65')]['rawAttributes']);_0xbfa552[_0x4656('0x3b')]=_[_0x4656('0x4e')](_0x29fc9f['query']);_0xbfa552['filters']=_[_0x4656('0x3d')](_0xbfa552[_0x4656('0x3a')],_0xbfa552[_0x4656('0x3b')]);_0x418285[_0x4656('0x3f')]=_[_0x4656('0x3d')](_0xbfa552['model'],qs[_0x4656('0x3e')](_0x29fc9f['query'][_0x4656('0x3e')]));_0x418285[_0x4656('0x3f')]=_0x418285[_0x4656('0x3f')][_0x4656('0x4f')]?_0x418285[_0x4656('0x3f')]:_0xbfa552[_0x4656('0x3a')];if(!_0x29fc9f['query'][_0x4656('0x60')]('nolimit')){_0x418285[_0x4656('0x22')]=qs['limit'](_0x29fc9f[_0x4656('0x3b')][_0x4656('0x22')]);_0x418285[_0x4656('0x21')]=qs[_0x4656('0x21')](_0x29fc9f[_0x4656('0x3b')][_0x4656('0x21')]);}_0x418285['order']=qs[_0x4656('0x41')](_0x29fc9f['query'][_0x4656('0x41')]);_0x418285[_0x4656('0x43')]=qs[_0x4656('0x3c')](_[_0x4656('0x42')](_0x29fc9f['query'],_0xbfa552['filters']));_0x418285['where'][_0x4656('0x61')]=_0x4c9a1b['id'];if(_0x29fc9f[_0x4656('0x3b')][_0x4656('0x45')]){_0x418285['where']=_[_0x4656('0x46')](_0x418285[_0x4656('0x43')],{'$or':_['map'](_0x418285['attributes'],function(_0x5077dc){var _0x5ed623={};_0x5ed623[_0x5077dc]={'$like':'%'+_0x29fc9f[_0x4656('0x3b')][_0x4656('0x45')]+'%'};return _0x5ed623;})});}_0x418285=_[_0x4656('0x46')]({},_0x418285,_0x29fc9f[_0x4656('0x47')]);return db['CmHopperHistory'][_0x4656('0x20')]({'where':_0x418285[_0x4656('0x43')]})['then'](function(_0x453bfc){_0x2712c4[_0x4656('0x20')]=_0x453bfc;if(_0x29fc9f['query']['includeAll']){_0x418285[_0x4656('0x49')]=[{'all':!![]}];}return db[_0x4656('0x65')][_0x4656('0x4a')](_0x418285);})[_0x4656('0x34')](function(_0x13a7b2){_0x2712c4[_0x4656('0x4b')]=_0x13a7b2;return _0x2712c4;});}})[_0x4656('0x34')](respondWithFilteredResult(_0x527f50,_0x418285))[_0x4656('0x50')](handleError(_0x527f50,null));};exports[_0x4656('0x66')]=function(_0x5db370,_0x2f742b,_0x99b71c){var _0x35a5fc={'raw':!![],'where':{}};var _0x29f5bc={};var _0x275eec={'count':0x0,'rows':[]};return db['VoiceQueue'][_0x4656('0x64')]({'where':{'id':_0x5db370[_0x4656('0x4d')]['id']}})['then'](handleEntityNotFound(_0x2f742b,null))[_0x4656('0x34')](function(_0xdcf24f){if(_0xdcf24f){_0x29f5bc[_0x4656('0x3a')]=_[_0x4656('0x4e')](db[_0x4656('0x67')][_0x4656('0x37')]);_0x29f5bc[_0x4656('0x3b')]=_[_0x4656('0x4e')](_0x5db370[_0x4656('0x3b')]);_0x29f5bc[_0x4656('0x3c')]=_[_0x4656('0x3d')](_0x29f5bc[_0x4656('0x3a')],_0x29f5bc['query']);_0x35a5fc[_0x4656('0x3f')]=_['intersection'](_0x29f5bc[_0x4656('0x3a')],qs['fields'](_0x5db370[_0x4656('0x3b')][_0x4656('0x3e')]));_0x35a5fc[_0x4656('0x3f')]=_0x35a5fc[_0x4656('0x3f')][_0x4656('0x4f')]?_0x35a5fc[_0x4656('0x3f')]:_0x29f5bc['model'];if(!_0x5db370['query'][_0x4656('0x60')](_0x4656('0x40'))){_0x35a5fc['limit']=qs[_0x4656('0x22')](_0x5db370[_0x4656('0x3b')]['limit']);_0x35a5fc[_0x4656('0x21')]=qs[_0x4656('0x21')](_0x5db370['query'][_0x4656('0x21')]);}_0x35a5fc[_0x4656('0x68')]=qs[_0x4656('0x41')](_0x5db370[_0x4656('0x3b')][_0x4656('0x41')]);_0x35a5fc[_0x4656('0x43')]=qs['filters'](_[_0x4656('0x42')](_0x5db370['query'],_0x29f5bc['filters']));_0x35a5fc['where']['VoiceQueueId']=_0xdcf24f['id'];if(_0x5db370[_0x4656('0x3b')][_0x4656('0x45')]){_0x35a5fc[_0x4656('0x43')]=_[_0x4656('0x46')](_0x35a5fc['where'],{'$or':_[_0x4656('0x2e')](_0x35a5fc[_0x4656('0x3f')],function(_0x3131eb){var _0x192619={};_0x192619[_0x3131eb]={'$like':'%'+_0x5db370[_0x4656('0x3b')][_0x4656('0x45')]+'%'};return _0x192619;})});}_0x35a5fc=_['merge']({},_0x35a5fc,_0x5db370[_0x4656('0x47')]);return db[_0x4656('0x67')][_0x4656('0x20')]({'where':_0x35a5fc[_0x4656('0x43')]})['then'](function(_0x463279){_0x275eec[_0x4656('0x20')]=_0x463279;if(_0x5db370[_0x4656('0x3b')][_0x4656('0x48')]){_0x35a5fc[_0x4656('0x49')]=[{'all':!![]}];}return db['CmHopperFinal'][_0x4656('0x4a')](_0x35a5fc);})[_0x4656('0x34')](function(_0x1b5cb1){_0x275eec[_0x4656('0x4b')]=_0x1b5cb1;return _0x275eec;});}})[_0x4656('0x34')](respondWithFilteredResult(_0x2f742b,_0x35a5fc))[_0x4656('0x50')](handleError(_0x2f742b,null));};exports[_0x4656('0x69')]=function(_0x4f7685,_0x4a4cf5,_0x44408a){var _0x1aecce={'raw':!![],'where':{}};var _0x158161={};var _0x353113={'count':0x0,'rows':[]};return db[_0x4656('0x36')][_0x4656('0x64')]({'where':{'id':_0x4f7685[_0x4656('0x4d')]['id']}})[_0x4656('0x34')](handleEntityNotFound(_0x4a4cf5,null))[_0x4656('0x34')](function(_0x4375ac){if(_0x4375ac){_0x158161[_0x4656('0x3a')]=_[_0x4656('0x4e')](db['CmHopperBlack'][_0x4656('0x37')]);_0x158161[_0x4656('0x3b')]=_['keys'](_0x4f7685[_0x4656('0x3b')]);_0x158161[_0x4656('0x3c')]=_[_0x4656('0x3d')](_0x158161[_0x4656('0x3a')],_0x158161[_0x4656('0x3b')]);_0x1aecce[_0x4656('0x3f')]=_[_0x4656('0x3d')](_0x158161[_0x4656('0x3a')],qs['fields'](_0x4f7685[_0x4656('0x3b')][_0x4656('0x3e')]));_0x1aecce['attributes']=_0x1aecce[_0x4656('0x3f')][_0x4656('0x4f')]?_0x1aecce['attributes']:_0x158161['model'];if(!_0x4f7685[_0x4656('0x3b')]['hasOwnProperty'](_0x4656('0x40'))){_0x1aecce['limit']=qs[_0x4656('0x22')](_0x4f7685[_0x4656('0x3b')][_0x4656('0x22')]);_0x1aecce[_0x4656('0x21')]=qs[_0x4656('0x21')](_0x4f7685[_0x4656('0x3b')]['offset']);}_0x1aecce[_0x4656('0x68')]=qs['sort'](_0x4f7685['query'][_0x4656('0x41')]);_0x1aecce[_0x4656('0x43')]=qs['filters'](_[_0x4656('0x42')](_0x4f7685[_0x4656('0x3b')],_0x158161[_0x4656('0x3c')]));_0x1aecce[_0x4656('0x43')][_0x4656('0x61')]=_0x4375ac['id'];if(_0x4f7685[_0x4656('0x3b')][_0x4656('0x45')]){_0x1aecce[_0x4656('0x43')]=_['merge'](_0x1aecce[_0x4656('0x43')],{'$or':_[_0x4656('0x2e')](_0x1aecce[_0x4656('0x3f')],function(_0x26b033){var _0x142d51={};_0x142d51[_0x26b033]={'$like':'%'+_0x4f7685[_0x4656('0x3b')][_0x4656('0x45')]+'%'};return _0x142d51;})});}_0x1aecce=_[_0x4656('0x46')]({},_0x1aecce,_0x4f7685['options']);return db[_0x4656('0x6a')][_0x4656('0x20')]({'where':_0x1aecce[_0x4656('0x43')]})[_0x4656('0x34')](function(_0xadfc89){_0x353113[_0x4656('0x20')]=_0xadfc89;if(_0x4f7685[_0x4656('0x3b')][_0x4656('0x48')]){_0x1aecce['include']=[{'all':!![]}];}return db[_0x4656('0x6a')]['findAll'](_0x1aecce);})['then'](function(_0xa4908c){_0x353113[_0x4656('0x4b')]=_0xa4908c;return _0x353113;});}})[_0x4656('0x34')](respondWithFilteredResult(_0x4a4cf5,_0x1aecce))[_0x4656('0x50')](handleError(_0x4a4cf5,null));};exports[_0x4656('0x6b')]=function(_0xb3af70,_0xfac355,_0x5d6262){var _0x228125={};var _0x51fef4={};var _0x3e2970;var _0x24ddf1;return db[_0x4656('0x36')][_0x4656('0x64')]({'where':{'id':_0xb3af70['params']['id']}})['then'](handleEntityNotFound(_0xfac355,null))[_0x4656('0x34')](function(_0x2b5f53){if(_0x2b5f53){_0x3e2970=_0x2b5f53;_0x51fef4[_0x4656('0x3a')]=_['keys'](db[_0x4656('0x6c')][_0x4656('0x37')]);_0x51fef4[_0x4656('0x3b')]=_[_0x4656('0x4e')](_0xb3af70[_0x4656('0x3b')]);_0x51fef4[_0x4656('0x3c')]=_['intersection'](_0x51fef4[_0x4656('0x3a')],_0x51fef4[_0x4656('0x3b')]);_0x228125[_0x4656('0x3f')]=_[_0x4656('0x3d')](_0x51fef4[_0x4656('0x3a')],qs[_0x4656('0x3e')](_0xb3af70[_0x4656('0x3b')][_0x4656('0x3e')]));_0x228125[_0x4656('0x3f')]=_0x228125['attributes']['length']?_0x228125['attributes']:_0x51fef4[_0x4656('0x3a')];_0x228125[_0x4656('0x68')]=qs['sort'](_0xb3af70[_0x4656('0x3b')][_0x4656('0x41')]);_0x228125[_0x4656('0x43')]=qs[_0x4656('0x3c')](_[_0x4656('0x42')](_0xb3af70[_0x4656('0x3b')],_0x51fef4[_0x4656('0x3c')]));if(_0xb3af70[_0x4656('0x3b')][_0x4656('0x45')]){_0x228125[_0x4656('0x43')]=_['merge'](_0x228125[_0x4656('0x43')],{'$or':_[_0x4656('0x2e')](_0x228125[_0x4656('0x3f')],function(_0x8a47fd){var _0x47b6fe={};_0x47b6fe[_0x8a47fd]={'$like':'%'+_0xb3af70[_0x4656('0x3b')][_0x4656('0x45')]+'%'};return _0x47b6fe;})});}_0x228125=_['merge']({},_0x228125,_0xb3af70[_0x4656('0x47')]);return _0x3e2970[_0x4656('0x6b')](_0x228125);}})['then'](function(_0x2466bb){if(_0x2466bb){_0x24ddf1=_0x2466bb[_0x4656('0x4f')];if(!_0xb3af70[_0x4656('0x3b')]['hasOwnProperty']('nolimit')){_0x228125[_0x4656('0x22')]=qs['limit'](_0xb3af70[_0x4656('0x3b')][_0x4656('0x22')]);_0x228125[_0x4656('0x21')]=qs[_0x4656('0x21')](_0xb3af70['query'][_0x4656('0x21')]);}return _0x3e2970['getTeams'](_0x228125);}})[_0x4656('0x34')](function(_0x310c8e){if(_0x310c8e){return _0x310c8e?{'count':_0x24ddf1,'rows':_0x310c8e}:null;}})[_0x4656('0x34')](respondWithResult(_0xfac355,null))[_0x4656('0x50')](handleError(_0xfac355,null));};exports[_0x4656('0x6d')]=function(_0x47262d,_0x1fcad7,_0x32269f){var _0x1e5b16=_0x47262d['body'][_0x4656('0x6e')];var _0x2db829=_[_0x4656('0x2e')](_0x1e5b16,'id');return db[_0x4656('0x6c')][_0x4656('0x4a')]({'where':{'id':_0x2db829},'attributes':['id'],'include':[{'model':db[_0x4656('0x6f')],'as':_0x4656('0x70'),'attributes':['id',_0x4656('0x32'),_0x4656('0x71'),'voicePause',_0x4656('0x72')],'raw':!![]}]})['then'](function(_0x564264){if(_0x564264){var _0x52ff60=_[_0x4656('0x73')](_0x564264,function(_0x4da400){var _0x59daa6=_0x4da400['get']({'plain':!![]});_0x59daa6[_0x4656('0x70')][_0x4656('0x74')](function(_0x179ebc){_0x179ebc[_0x4656('0x75')]=_['find'](_0x1e5b16,{'id':_0x59daa6['id']})[_0x4656('0x75')];});return _0x59daa6[_0x4656('0x70')];});return db[_0x4656('0x36')][_0x4656('0x30')]({'where':{'id':_0x47262d[_0x4656('0x4d')]['id']}})[_0x4656('0x34')](function(_0x563c6a){return db[_0x4656('0x76')][_0x4656('0x77')](function(_0x2f603f){return _0x563c6a[_0x4656('0x6d')](_0x2db829,{'transaction':_0x2f603f})[_0x4656('0x34')](function(){return BPromise[_0x4656('0x78')](_0x52ff60,function(_0x435ba6){return db[_0x4656('0x79')][_0x4656('0x7a')]({'where':{'UserId':_0x435ba6['id'],'VoiceQueueId':_0x47262d[_0x4656('0x4d')]['id']},'defaults':{'penalty':_0x435ba6['penalty']},'transaction':_0x2f603f});});})[_0x4656('0x34')](function(){return BPromise['each'](_['filter'](_0x52ff60,{'online':!![]}),function(_0x5c6c72){return db[_0x4656('0x7b')][_0x4656('0x7c')]({'membername':_0x5c6c72[_0x4656('0x32')],'UserId':_0x5c6c72['id'],'queue_name':_0x563c6a[_0x4656('0x32')],'VoiceQueueId':_0x563c6a['id'],'interface':_['isNil'](_0x5c6c72[_0x4656('0x72')])?util['format'](_0x4656('0x7d'),_0x5c6c72[_0x4656('0x32')]):_0x5c6c72[_0x4656('0x72')],'paused':_0x5c6c72[_0x4656('0x7e')]||![],'penalty':_0x5c6c72['penalty']},{'transaction':_0x2f603f});});})[_0x4656('0x34')](function(){_0x52ff60[_0x4656('0x74')](function(_0x25b91d){socket[_0x4656('0x7f')]('userVoiceQueue:save',{'UserId':_0x25b91d['id'],'VoiceQueueId':_0x563c6a['id']});});});});});}})[_0x4656('0x34')](respondWithStatusCode(_0x1fcad7,null))['catch'](handleError(_0x1fcad7,null));};exports[_0x4656('0x80')]=function(_0x56d21c,_0x394adc,_0x4b8468){return db[_0x4656('0x6c')][_0x4656('0x4a')]({'where':{'id':_0x56d21c[_0x4656('0x3b')]['ids']},'attributes':['id'],'include':[{'model':db[_0x4656('0x6f')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x4656('0x34')](handleEntityNotFound(_0x394adc,null))['then'](function(_0x778577){var _0x180275=_['map'](_0x778577,'id');var _0x51e2d7=[];var _0x37d99a=[];var _0x1abfe7=squel['select']();_0x1abfe7['field']('tq.TeamId')[_0x4656('0x81')]('team_has_voice_queues','tq')[_0x4656('0x82')](_0x4656('0x83'),'ut',_0x4656('0x84'))[_0x4656('0x43')](_0x4656('0x85'),_0x56d21c[_0x4656('0x4d')]['id']);for(var _0x4e8494=0x0;_0x4e8494<_0x778577[_0x4656('0x4f')];_0x4e8494+=0x1){let _0x5df44d=_0x778577[_0x4e8494];for(var _0x38266d=0x0;_0x38266d<_0x5df44d[_0x4656('0x70')][_0x4656('0x4f')];_0x38266d+=0x1){let _0x1a6e22=_0x5df44d['Agents'][_0x38266d];var _0x1165af=_0x1abfe7[_0x4656('0x5b')]();_0x1165af['where'](_0x4656('0x86'),_0x1a6e22['id']);_0x37d99a[_0x4656('0x87')](db[_0x4656('0x76')][_0x4656('0x3b')](_0x1165af[_0x4656('0x88')](),{'type':db[_0x4656('0x76')]['QueryTypes']['SELECT']})[_0x4656('0x34')](function(_0x2060ad){if(_0x2060ad[_0x4656('0x4f')]===0x1){return _0x1a6e22['id'];}else{var _0x602e05=_[_0x4656('0x89')](_[_0x4656('0x2e')](_0x2060ad,'TeamId'),function(_0x2041b1){return _[_0x4656('0x8a')](_0x180275,_0x2041b1);});if(_0x602e05){return _0x1a6e22['id'];}}}));}}return BPromise[_0x4656('0x8b')](_0x37d99a)[_0x4656('0x34')](function(_0x49fe62){_0x51e2d7=_(_0x51e2d7)[_0x4656('0x8c')](_0x49fe62)[_0x4656('0x8d')]()[_0x4656('0x2f')]();return db[_0x4656('0x36')][_0x4656('0x30')]({'where':{'id':_0x56d21c[_0x4656('0x4d')]['id']}})[_0x4656('0x34')](function(_0x28e35f){return db['sequelize']['transaction'](function(_0x17da2b){return _0x28e35f[_0x4656('0x80')](_0x56d21c[_0x4656('0x3b')]['ids'],{'transaction':_0x17da2b})['then'](function(){if(!_[_0x4656('0x8e')](_0x51e2d7)){return _0x28e35f['removeAgents'](_0x51e2d7,{'transaction':_0x17da2b})[_0x4656('0x34')](function(){return db[_0x4656('0x7b')][_0x4656('0x28')]({'where':{'VoiceQueueId':_0x56d21c[_0x4656('0x4d')]['id'],'UserId':_0x51e2d7},'transaction':_0x17da2b});});}})[_0x4656('0x34')](function(){_0x51e2d7['forEach'](function(_0x15adc5){socket['emit'](_0x4656('0x8f'),{'UserId':_0x15adc5,'VoiceQueueId':_0x28e35f['id']});});});});});});})[_0x4656('0x34')](respondWithStatusCode(_0x394adc,null))['catch'](handleError(_0x394adc,null));};exports[_0x4656('0x90')]=function(_0x54ef07,_0x5b090c,_0x1001ce){var _0x3cdc10,_0x1c479;return db['VoiceQueue'][_0x4656('0x30')]({'where':{'id':_0x54ef07[_0x4656('0x4d')]['id']}})[_0x4656('0x34')](handleEntityNotFound(_0x5b090c,null))['then'](function(_0x50ebba){if(_0x50ebba){_0x1c479=_0x50ebba;return _0x50ebba[_0x4656('0x90')](_0x54ef07[_0x4656('0x52')]['ids'],_[_0x4656('0x91')](_0x54ef07[_0x4656('0x52')],[_0x4656('0x92'),'id'])||{})[_0x4656('0x93')](function(_0x44b1a0){for(var _0x50b1eb=0x0;_0x50b1eb<_0x54ef07[_0x4656('0x52')][_0x4656('0x92')]['length'];_0x50b1eb+=0x1){socket[_0x4656('0x7f')](_0x4656('0x94'),{'UserId':_0x54ef07[_0x4656('0x52')][_0x4656('0x92')][_0x50b1eb],'VoiceQueueId':_0x54ef07[_0x4656('0x4d')]['id']});}return _0x44b1a0;});}})[_0x4656('0x34')](function(_0x186257){_0x3cdc10=_0x186257||[];if(_0x1c479){return db[_0x4656('0x6f')][_0x4656('0x4a')]({'where':{'id':_0x54ef07[_0x4656('0x52')][_0x4656('0x92')]},'attributes':['id',_0x4656('0x32'),'online',_0x4656('0x7e'),_0x4656('0x72')],'raw':!![]});}})['then'](function(_0x337d7f){if(!_[_0x4656('0x8e')](_0x337d7f)){var _0x18a380=[];for(var _0x1c6558=0x0;_0x1c6558<_0x337d7f[_0x4656('0x4f')];_0x1c6558++){if(_0x337d7f[_0x1c6558][_0x4656('0x71')]){_0x18a380[_0x4656('0x87')](db[_0x4656('0x7b')][_0x4656('0x7c')]({'membername':_0x337d7f[_0x1c6558]['name'],'UserId':_0x337d7f[_0x1c6558]['id'],'queue_name':_0x1c479['name'],'VoiceQueueId':_0x1c479['id'],'interface':_[_0x4656('0x95')](_0x337d7f[_0x1c6558][_0x4656('0x72')])?util[_0x4656('0x96')]('SIP/%s',_0x337d7f[_0x1c6558]['name']):_0x337d7f[_0x1c6558]['interface'],'paused':_0x337d7f[_0x1c6558][_0x4656('0x7e')]||![],'penalty':_0x54ef07['body'][_0x4656('0x75')]||0x0}));}}return BPromise[_0x4656('0x8b')](_0x18a380);}})[_0x4656('0x34')](function(){return _0x3cdc10;})[_0x4656('0x34')](respondWithResult(_0x5b090c,null))['catch'](handleError(_0x5b090c,null));};exports[_0x4656('0x97')]=function(_0x2608e0,_0x2fcaa6,_0x4007b4){return db[_0x4656('0x36')]['find']({'where':{'id':_0x2608e0['params']['id']}})[_0x4656('0x34')](handleEntityNotFound(_0x2fcaa6,null))['then'](function(_0x2ee236){if(_0x2ee236){return _0x2ee236[_0x4656('0x97')](_0x2608e0[_0x4656('0x3b')]['ids'])['then'](function(){if(_[_0x4656('0x98')](_0x2608e0[_0x4656('0x3b')][_0x4656('0x92')])){for(var _0x4adb22=0x0;_0x4adb22<_0x2608e0['query'][_0x4656('0x92')][_0x4656('0x4f')];_0x4adb22+=0x1){socket[_0x4656('0x7f')](_0x4656('0x8f'),{'UserId':Number(_0x2608e0[_0x4656('0x3b')][_0x4656('0x92')][_0x4adb22]),'VoiceQueueId':Number(_0x2608e0[_0x4656('0x4d')]['id'])});}}else{socket[_0x4656('0x7f')](_0x4656('0x8f'),{'UserId':Number(_0x2608e0[_0x4656('0x3b')]['ids']),'VoiceQueueId':Number(_0x2608e0[_0x4656('0x4d')]['id'])});}});}})[_0x4656('0x34')](function(_0x4cf60c){return db[_0x4656('0x7b')][_0x4656('0x28')]({'where':{'VoiceQueueId':_0x2608e0[_0x4656('0x4d')]['id'],'UserId':_0x2608e0[_0x4656('0x3b')][_0x4656('0x92')]}})[_0x4656('0x34')](function(){return _0x4cf60c;});})['then'](respondWithStatusCode(_0x2fcaa6,null))[_0x4656('0x50')](handleError(_0x2fcaa6,null));};exports[_0x4656('0x99')]=function(_0xc6eac3,_0x4544c6,_0x4f40a8){var _0x5470d9={};var _0x3f4b84={};var _0x13779d;var _0x17ef7d;return db[_0x4656('0x36')]['findOne']({'where':{'id':_0xc6eac3[_0x4656('0x4d')]['id']}})['then'](handleEntityNotFound(_0x4544c6,null))['then'](function(_0x2084f6){if(_0x2084f6){_0x13779d=_0x2084f6;_0x3f4b84[_0x4656('0x3a')]=_[_0x4656('0x4e')](db[_0x4656('0x6f')]['rawAttributes']);_0x3f4b84['query']=_[_0x4656('0x4e')](_0xc6eac3[_0x4656('0x3b')]);_0x3f4b84[_0x4656('0x3c')]=_[_0x4656('0x3d')](_0x3f4b84['model'],_0x3f4b84[_0x4656('0x3b')]);_0x5470d9['attributes']=_[_0x4656('0x3d')](_0x3f4b84[_0x4656('0x3a')],qs[_0x4656('0x3e')](_0xc6eac3['query'][_0x4656('0x3e')]));_0x5470d9[_0x4656('0x3f')]=_0x5470d9[_0x4656('0x3f')][_0x4656('0x4f')]?_0x5470d9[_0x4656('0x3f')]:_0x3f4b84['model'];_0x5470d9[_0x4656('0x68')]=qs[_0x4656('0x41')](_0xc6eac3[_0x4656('0x3b')][_0x4656('0x41')]);_0x5470d9[_0x4656('0x43')]=qs[_0x4656('0x3c')](_[_0x4656('0x42')](_0xc6eac3[_0x4656('0x3b')],_0x3f4b84['filters']));if(_0xc6eac3['query'][_0x4656('0x45')]){_0x5470d9[_0x4656('0x43')]=_[_0x4656('0x46')](_0x5470d9[_0x4656('0x43')],{'$or':_[_0x4656('0x2e')](_0x5470d9[_0x4656('0x3f')],function(_0x3be65c){var _0x4c39b0={};_0x4c39b0[_0x3be65c]={'$like':'%'+_0xc6eac3[_0x4656('0x3b')][_0x4656('0x45')]+'%'};return _0x4c39b0;})});}_0x5470d9=_[_0x4656('0x46')]({},_0x5470d9,_0xc6eac3[_0x4656('0x47')]);return _0x13779d[_0x4656('0x99')](_0x5470d9);}})[_0x4656('0x34')](function(_0x167917){if(_0x167917){_0x17ef7d=_0x167917['length'];if(!_0xc6eac3[_0x4656('0x3b')][_0x4656('0x60')](_0x4656('0x40'))){_0x5470d9[_0x4656('0x22')]=qs['limit'](_0xc6eac3[_0x4656('0x3b')][_0x4656('0x22')]);_0x5470d9[_0x4656('0x21')]=qs[_0x4656('0x21')](_0xc6eac3['query']['offset']);}return _0x13779d[_0x4656('0x99')](_0x5470d9);}})['then'](function(_0x5d4147){if(_0x5d4147){return _0x5d4147?{'count':_0x17ef7d,'rows':_0x5d4147}:null;}})['then'](respondWithResult(_0x4544c6,null))['catch'](handleError(_0x4544c6,null));};exports[_0x4656('0x9a')]=function(_0x1c3c63,_0x467a98,_0x1c3847){var _0x39d708={};var _0x17ab55={};var _0x4ca0f3;var _0xb5001f;return db[_0x4656('0x36')]['findOne']({'where':{'id':_0x1c3c63[_0x4656('0x4d')]['id']}})['then'](handleEntityNotFound(_0x467a98,null))[_0x4656('0x34')](function(_0x288a4c){if(_0x288a4c){_0x4ca0f3=_0x288a4c;_0x17ab55['model']=_[_0x4656('0x4e')](db[_0x4656('0x7b')][_0x4656('0x37')]);_0x17ab55[_0x4656('0x3b')]=_[_0x4656('0x4e')](_0x1c3c63[_0x4656('0x3b')]);_0x17ab55['filters']=_[_0x4656('0x3d')](_0x17ab55['model'],_0x17ab55['query']);_0x39d708[_0x4656('0x3f')]=_['intersection'](_0x17ab55['model'],qs[_0x4656('0x3e')](_0x1c3c63['query']['fields']));_0x39d708[_0x4656('0x3f')]=_0x39d708[_0x4656('0x3f')][_0x4656('0x4f')]?_0x39d708[_0x4656('0x3f')]:_0x17ab55[_0x4656('0x3a')];_0x39d708['order']=qs[_0x4656('0x41')](_0x1c3c63[_0x4656('0x3b')][_0x4656('0x41')]);_0x39d708[_0x4656('0x43')]=qs['filters'](_[_0x4656('0x42')](_0x1c3c63['query'],_0x17ab55['filters']));if(_0x1c3c63['query']['filter']){_0x39d708['where']=_[_0x4656('0x46')](_0x39d708[_0x4656('0x43')],{'$or':_['map'](_0x39d708[_0x4656('0x3f')],function(_0x3c9009){var _0x56dfdb={};_0x56dfdb[_0x3c9009]={'$like':'%'+_0x1c3c63[_0x4656('0x3b')]['filter']+'%'};return _0x56dfdb;})});}_0x39d708=_[_0x4656('0x46')]({},_0x39d708,_0x1c3c63[_0x4656('0x47')]);return _0x4ca0f3[_0x4656('0x9a')](_0x39d708);}})[_0x4656('0x34')](function(_0x191001){if(_0x191001){_0xb5001f=_0x191001[_0x4656('0x4f')];if(!_0x1c3c63[_0x4656('0x3b')][_0x4656('0x60')](_0x4656('0x40'))){_0x39d708['limit']=qs[_0x4656('0x22')](_0x1c3c63[_0x4656('0x3b')][_0x4656('0x22')]);_0x39d708[_0x4656('0x21')]=qs[_0x4656('0x21')](_0x1c3c63[_0x4656('0x3b')]['offset']);}return _0x4ca0f3[_0x4656('0x9a')](_0x39d708);}})[_0x4656('0x34')](function(_0x4fbace){return _0x4fbace?{'count':_0xb5001f,'rows':_0x4fbace}:null;})[_0x4656('0x34')](respondWithResult(_0x467a98,null))[_0x4656('0x50')](handleError(_0x467a98,null));};exports[_0x4656('0x9b')]=function(_0x4ae1bb,_0x525a05,_0x426c19){var _0x570840={};var _0x58a645={};var _0x36cbad;var _0x289eff;return db['VoiceQueue'][_0x4656('0x64')]({'where':{'id':_0x4ae1bb['params']['id']}})[_0x4656('0x34')](handleEntityNotFound(_0x525a05,null))['then'](function(_0x49b841){if(_0x49b841){_0x36cbad=_0x49b841;_0x58a645[_0x4656('0x3a')]=_[_0x4656('0x4e')](db[_0x4656('0x9c')][_0x4656('0x37')]);_0x58a645[_0x4656('0x3b')]=_[_0x4656('0x4e')](_0x4ae1bb['query']);_0x58a645[_0x4656('0x3c')]=_['intersection'](_0x58a645['model'],_0x58a645['query']);_0x570840['attributes']=_[_0x4656('0x3d')](_0x58a645['model'],qs[_0x4656('0x3e')](_0x4ae1bb[_0x4656('0x3b')][_0x4656('0x3e')]));_0x570840[_0x4656('0x3f')]=_0x570840[_0x4656('0x3f')][_0x4656('0x4f')]?_0x570840['attributes']:_0x58a645[_0x4656('0x3a')];_0x570840[_0x4656('0x68')]=qs[_0x4656('0x41')](_0x4ae1bb[_0x4656('0x3b')][_0x4656('0x41')]);_0x570840['where']=qs[_0x4656('0x3c')](_[_0x4656('0x42')](_0x4ae1bb[_0x4656('0x3b')],_0x58a645['filters']));if(_0x4ae1bb[_0x4656('0x3b')]['filter']){_0x570840[_0x4656('0x43')]=_[_0x4656('0x46')](_0x570840[_0x4656('0x43')],{'$or':_['map'](_0x570840[_0x4656('0x3f')],function(_0x59d7e3){var _0x3512c2={};_0x3512c2[_0x59d7e3]={'$like':'%'+_0x4ae1bb[_0x4656('0x3b')][_0x4656('0x45')]+'%'};return _0x3512c2;})});}_0x570840=_[_0x4656('0x46')]({},_0x570840,_0x4ae1bb['options']);return _0x36cbad['getLists'](_0x570840);}})[_0x4656('0x34')](function(_0x2d3595){if(_0x2d3595){_0x289eff=_0x2d3595[_0x4656('0x4f')];if(!_0x4ae1bb[_0x4656('0x3b')][_0x4656('0x60')](_0x4656('0x40'))){_0x570840[_0x4656('0x22')]=qs['limit'](_0x4ae1bb['query'][_0x4656('0x22')]);_0x570840[_0x4656('0x21')]=qs[_0x4656('0x21')](_0x4ae1bb[_0x4656('0x3b')][_0x4656('0x21')]);}return _0x36cbad[_0x4656('0x9b')](_0x570840);}})['then'](function(_0x3d2008){if(_0x3d2008){return _0x3d2008?{'count':_0x289eff,'rows':_0x3d2008}:null;}})[_0x4656('0x34')](respondWithResult(_0x525a05,null))[_0x4656('0x50')](handleError(_0x525a05,null));};exports[_0x4656('0x9d')]=function(_0x1fc8cb,_0x2c2c3b,_0x400412){var _0x5d43b1,_0x1bfedf;return db[_0x4656('0x36')][_0x4656('0x30')]({'where':{'id':_0x1fc8cb[_0x4656('0x4d')]['id']}})[_0x4656('0x34')](handleEntityNotFound(_0x2c2c3b,null))['then'](function(_0x5dcd1e){if(_0x5dcd1e){_0x1bfedf=_0x5dcd1e;return _0x5dcd1e[_0x4656('0x9d')](_0x1fc8cb['body'][_0x4656('0x92')],_[_0x4656('0x91')](_0x1fc8cb[_0x4656('0x52')],[_0x4656('0x92'),'id'])||{});}return null;})[_0x4656('0x93')](function(_0x2f3604){var _0x2a1e2a;_0x5d43b1=_0x2f3604||[];var _0x3f5d6a=[];if(_0x2f3604){for(var _0x338dc4=0x0;_0x338dc4<_0x2f3604[_0x4656('0x4f')];_0x338dc4+=0x1){var _0x189c7a=_0x2f3604[_0x338dc4][_0x4656('0x29')]({'plain':!![]});_0x1bfedf[_0x4656('0x9e')]=_0x1fc8cb[_0x4656('0x52')][_0x4656('0x9e')]?_0x1fc8cb['body'][_0x4656('0x9e')]:_0x1bfedf[_0x4656('0x9e')];switch(_0x1bfedf[_0x4656('0x9e')]){case _0x4656('0x9f'):_0x2a1e2a=squel[_0x4656('0xa0')]()[_0x4656('0xa1')](_0x4656('0xa2'))[_0x4656('0xa3')]([_0x4656('0xa4'),_0x4656('0xa5'),_0x4656('0xa6'),_0x4656('0xa7'),_0x4656('0x61'),_0x4656('0x5c'),_0x4656('0x5d')],squel['select']()[_0x4656('0xa8')]('phone','phone')[_0x4656('0xa8')]('NOW()',_0x4656('0xa5'))[_0x4656('0xa8')]('id',_0x4656('0xa6'))['field'](_0x189c7a[_0x4656('0xa9')][_0x4656('0x88')](),_0x4656('0xa7'))['field'](_0x1fc8cb[_0x4656('0x4d')]['id']['toString'](),'VoiceQueueId')[_0x4656('0xa8')]('NOW()',_0x4656('0x5c'))[_0x4656('0xa8')](_0x4656('0xaa'),'updatedAt')[_0x4656('0x81')](_0x4656('0xab'))[_0x4656('0x43')](_0x4656('0xac'))[_0x4656('0x43')](_0x4656('0xad'),_0x189c7a[_0x4656('0xa9')]['toString']())[_0x4656('0x43')]('phone\x20IS\x20NOT\x20NULL')[_0x4656('0x43')](_0x4656('0xae'),squel[_0x4656('0xaf')]()['field']('COALESCE(calleridnum,\x27\x27)')[_0x4656('0x81')](_0x4656('0xb0'))[_0x4656('0x43')](_0x4656('0x85'),_0x1fc8cb[_0x4656('0x4d')]['id']['toString']()))[_0x4656('0x43')](_0x4656('0xae'),squel[_0x4656('0xaf')]()[_0x4656('0xa8')](_0x4656('0xb1'))[_0x4656('0x81')](_0x4656('0xa2'))[_0x4656('0x43')]('VoiceQueueId\x20=\x20?',_0x1fc8cb[_0x4656('0x4d')]['id']['toString']())))[_0x4656('0x88')]();break;case _0x4656('0xb2'):_0x2a1e2a=squel[_0x4656('0xa0')]()[_0x4656('0xa1')](_0x4656('0xa2'))['fromQuery']([_0x4656('0xa4'),_0x4656('0xa5'),_0x4656('0xa6'),_0x4656('0xa7'),_0x4656('0x61'),'createdAt',_0x4656('0x5d')],squel['select']()[_0x4656('0xa8')](_0x4656('0xa4'),_0x4656('0xa4'))[_0x4656('0xa8')](_0x4656('0xaa'),_0x4656('0xa5'))[_0x4656('0xa8')]('id','ContactId')[_0x4656('0xa8')](_0x189c7a[_0x4656('0xa9')][_0x4656('0x88')](),_0x4656('0xa7'))[_0x4656('0xa8')](_0x1fc8cb[_0x4656('0x4d')]['id'][_0x4656('0x88')](),'VoiceQueueId')[_0x4656('0xa8')](_0x4656('0xaa'),_0x4656('0x5c'))[_0x4656('0xa8')](_0x4656('0xaa'),_0x4656('0x5d'))['from']('cm_contacts')[_0x4656('0x43')]('deletedAt\x20IS\x20NULL')[_0x4656('0x43')](_0x4656('0xad'),_0x189c7a['CmListId'][_0x4656('0x88')]())[_0x4656('0x43')](_0x4656('0xb3'))[_0x4656('0x43')](_0x4656('0xae'),squel[_0x4656('0xaf')]()[_0x4656('0xa8')](_0x4656('0xb1'))[_0x4656('0x81')](_0x4656('0xa2'))[_0x4656('0x43')](_0x4656('0x85'),_0x1fc8cb[_0x4656('0x4d')]['id']['toString']())))[_0x4656('0x88')]();break;default:_0x2a1e2a=squel[_0x4656('0xa0')]()['into']('cm_hopper')['fromQuery']([_0x4656('0xa4'),'scheduledAt',_0x4656('0xa6'),'ListId',_0x4656('0x61'),_0x4656('0x5c'),_0x4656('0x5d')],squel['select']()['field'](_0x4656('0xa4'),'phone')[_0x4656('0xa8')](_0x4656('0xaa'),'scheduledAt')[_0x4656('0xa8')]('id',_0x4656('0xa6'))['field'](_0x189c7a[_0x4656('0xa9')][_0x4656('0x88')](),'ListId')['field'](_0x1fc8cb[_0x4656('0x4d')]['id'][_0x4656('0x88')](),_0x4656('0x61'))['field'](_0x4656('0xaa'),_0x4656('0x5c'))[_0x4656('0xa8')](_0x4656('0xaa'),_0x4656('0x5d'))[_0x4656('0x81')](_0x4656('0xab'))['where']('deletedAt\x20IS\x20NULL')['where'](_0x4656('0xad'),_0x189c7a[_0x4656('0xa9')][_0x4656('0x88')]())['where'](_0x4656('0xb3')))[_0x4656('0x88')]();}_0x3f5d6a[_0x4656('0x87')](db[_0x4656('0x76')][_0x4656('0x3b')](_0x2a1e2a));}return BPromise[_0x4656('0x8b')](_0x3f5d6a);}})[_0x4656('0x34')](function(){return _0x5d43b1;})['then'](respondWithResult(_0x2c2c3b,null))['catch'](handleError(_0x2c2c3b,null));};exports[_0x4656('0xb4')]=function(_0x17d602,_0x322f54,_0x56d88f){return db[_0x4656('0x36')][_0x4656('0x30')]({'where':{'id':_0x17d602[_0x4656('0x4d')]['id']}})[_0x4656('0x34')](handleEntityNotFound(_0x322f54,null))[_0x4656('0x34')](function(_0x460e48){if(_0x460e48){return _0x460e48[_0x4656('0xb4')](_0x17d602[_0x4656('0x3b')][_0x4656('0x92')]);}})[_0x4656('0x34')](function(_0x2c0cd3){if(_0x2c0cd3){return db['CmHopper'][_0x4656('0x28')]({'where':{'ListId':_0x17d602[_0x4656('0x3b')][_0x4656('0x92')],'VoiceQueueId':_0x17d602['params']['id']}})[_0x4656('0x34')](function(){return _0x2c0cd3;});}})[_0x4656('0x34')](respondWithStatusCode(_0x322f54,null))[_0x4656('0x50')](handleError(_0x322f54,null));};exports[_0x4656('0xb5')]=function(_0x2d49dc,_0x2ad171,_0x33ae7d){var _0x23a368={};var _0x35cd24={};var _0x442cd2;var _0x521e54;return db[_0x4656('0x36')][_0x4656('0x64')]({'where':{'id':_0x2d49dc[_0x4656('0x4d')]['id']}})[_0x4656('0x34')](handleEntityNotFound(_0x2ad171,null))[_0x4656('0x34')](function(_0xf3c8c1){if(_0xf3c8c1){_0x442cd2=_0xf3c8c1;_0x35cd24[_0x4656('0x3a')]=_[_0x4656('0x4e')](db['CmList'][_0x4656('0x37')]);_0x35cd24[_0x4656('0x3b')]=_[_0x4656('0x4e')](_0x2d49dc[_0x4656('0x3b')]);_0x35cd24[_0x4656('0x3c')]=_[_0x4656('0x3d')](_0x35cd24[_0x4656('0x3a')],_0x35cd24[_0x4656('0x3b')]);_0x23a368[_0x4656('0x3f')]=_[_0x4656('0x3d')](_0x35cd24[_0x4656('0x3a')],qs[_0x4656('0x3e')](_0x2d49dc[_0x4656('0x3b')][_0x4656('0x3e')]));_0x23a368[_0x4656('0x3f')]=_0x23a368['attributes'][_0x4656('0x4f')]?_0x23a368[_0x4656('0x3f')]:_0x35cd24[_0x4656('0x3a')];_0x23a368[_0x4656('0x68')]=qs[_0x4656('0x41')](_0x2d49dc[_0x4656('0x3b')][_0x4656('0x41')]);_0x23a368['where']=qs[_0x4656('0x3c')](_['pick'](_0x2d49dc['query'],_0x35cd24[_0x4656('0x3c')]));if(_0x2d49dc[_0x4656('0x3b')][_0x4656('0x45')]){_0x23a368[_0x4656('0x43')]=_[_0x4656('0x46')](_0x23a368[_0x4656('0x43')],{'$or':_[_0x4656('0x2e')](_0x23a368['attributes'],function(_0x3cca6b){var _0x291a95={};_0x291a95[_0x3cca6b]={'$like':'%'+_0x2d49dc[_0x4656('0x3b')][_0x4656('0x45')]+'%'};return _0x291a95;})});}_0x23a368=_[_0x4656('0x46')]({},_0x23a368,_0x2d49dc['options']);return _0x442cd2[_0x4656('0xb5')](_0x23a368);}})['then'](function(_0x44e653){if(_0x44e653){_0x521e54=_0x44e653[_0x4656('0x4f')];if(!_0x2d49dc[_0x4656('0x3b')][_0x4656('0x60')](_0x4656('0x40'))){_0x23a368[_0x4656('0x22')]=qs['limit'](_0x2d49dc[_0x4656('0x3b')]['limit']);_0x23a368[_0x4656('0x21')]=qs[_0x4656('0x21')](_0x2d49dc['query'][_0x4656('0x21')]);}return _0x442cd2[_0x4656('0xb5')](_0x23a368);}})['then'](function(_0x39edee){if(_0x39edee){return _0x39edee?{'count':_0x521e54,'rows':_0x39edee}:null;}})[_0x4656('0x34')](respondWithResult(_0x2ad171,null))['catch'](handleError(_0x2ad171,null));};exports[_0x4656('0xb6')]=function(_0x168947,_0x8df792,_0x14f9b5){var _0x2053d6,_0x2a3e53;return db['VoiceQueue'][_0x4656('0x30')]({'where':{'id':_0x168947[_0x4656('0x4d')]['id']}})[_0x4656('0x34')](handleEntityNotFound(_0x8df792,null))['then'](function(_0x4cb321){if(_0x4cb321){_0x2a3e53=_0x4cb321;return _0x4cb321[_0x4656('0xb6')](_0x168947['body']['ids'],_[_0x4656('0x91')](_0x168947[_0x4656('0x52')],[_0x4656('0x92'),'id'])||{});}return null;})[_0x4656('0x93')](function(_0x31fc90){var _0xf26840;_0x2053d6=_0x31fc90||[];var _0xff76c5=[];if(_0x31fc90){for(var _0x116015=0x0;_0x116015<_0x31fc90[_0x4656('0x4f')];_0x116015+=0x1){var _0x5bb50a=_0x31fc90[_0x116015][_0x4656('0x29')]({'plain':!![]});_0xf26840=squel['insert']()[_0x4656('0xa1')](_0x4656('0xb7'))[_0x4656('0xa3')]([_0x4656('0xa4'),_0x4656('0xa6'),_0x4656('0xa7'),_0x4656('0x61'),_0x4656('0x5c'),_0x4656('0x5d')],squel['select']()[_0x4656('0xa8')](_0x4656('0xa4'),_0x4656('0xa4'))[_0x4656('0xa8')]('id',_0x4656('0xa6'))[_0x4656('0xa8')](_0x5bb50a['CmListId'][_0x4656('0x88')](),_0x4656('0xa7'))[_0x4656('0xa8')](_0x168947[_0x4656('0x4d')]['id'][_0x4656('0x88')](),_0x4656('0x61'))[_0x4656('0xa8')](_0x4656('0xaa'),_0x4656('0x5c'))[_0x4656('0xa8')](_0x4656('0xaa'),'updatedAt')[_0x4656('0x81')](_0x4656('0xab'))[_0x4656('0x43')]('deletedAt\x20IS\x20NULL')[_0x4656('0x43')](_0x4656('0xad'),_0x5bb50a[_0x4656('0xa9')]['toString']())[_0x4656('0x43')](_0x4656('0xb3')))['toString']();_0xff76c5[_0x4656('0x87')](db[_0x4656('0x76')][_0x4656('0x3b')](_0xf26840));}return BPromise[_0x4656('0x8b')](_0xff76c5);}})[_0x4656('0x34')](function(){return _0x2053d6;})[_0x4656('0x34')](respondWithResult(_0x8df792,null))[_0x4656('0x50')](handleError(_0x8df792,null));};exports[_0x4656('0xb8')]=function(_0x4f2b26,_0x185d69,_0x21c4b5){return db[_0x4656('0x36')][_0x4656('0x30')]({'where':{'id':_0x4f2b26[_0x4656('0x4d')]['id']}})[_0x4656('0x34')](handleEntityNotFound(_0x185d69,null))[_0x4656('0x34')](function(_0x1d1172){if(_0x1d1172){return _0x1d1172[_0x4656('0xb8')](_0x4f2b26[_0x4656('0x3b')][_0x4656('0x92')]);}})[_0x4656('0x34')](function(_0x56f4e6){if(_0x56f4e6){return db[_0x4656('0x6a')][_0x4656('0x28')]({'where':{'ListId':_0x4f2b26[_0x4656('0x3b')]['ids'],'VoiceQueueId':_0x4f2b26[_0x4656('0x4d')]['id']}})[_0x4656('0x34')](function(){return _0x56f4e6;});}})[_0x4656('0x34')](respondWithStatusCode(_0x185d69,null))['catch'](handleError(_0x185d69,null));};
\ No newline at end of file
diff --git a/server/api/voiceQueue/voiceQueue.events.js b/server/api/voiceQueue/voiceQueue.events.js
index db21137..c3b1b8a 100644
--- a/server/api/voiceQueue/voiceQueue.events.js
+++ b/server/api/voiceQueue/voiceQueue.events.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7075=['hasOwnProperty','hook','exports','events','../../mysqldb','setMaxListeners','save','update','emit'];(function(_0x2ffdbf,_0x20c63e){var _0x51550f=function(_0x499cdc){while(--_0x499cdc){_0x2ffdbf['push'](_0x2ffdbf['shift']());}};_0x51550f(++_0x20c63e);}(_0x7075,0x108));var _0x5707=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x7075[_0x122ef9];return _0x42fba0;};'use strict';var EventEmitter=require(_0x5707('0x0'));var VoiceQueue=require(_0x5707('0x1'))['db']['VoiceQueue'];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0x5707('0x2')](0x0);var events={'afterCreate':_0x5707('0x3'),'afterUpdate':_0x5707('0x4'),'afterDestroy':'remove'};function emitEvent(_0x149725){return function(_0x1c80f8,_0x5d3c9d,_0x4023b0){VoiceQueueEvents[_0x5707('0x5')](_0x149725+':'+_0x1c80f8['id'],_0x1c80f8);VoiceQueueEvents[_0x5707('0x5')](_0x149725,_0x1c80f8);_0x4023b0(null);};}for(var e in events){if(events[_0x5707('0x6')](e)){var event=events[e];VoiceQueue[_0x5707('0x7')](e,emitEvent(event));}}module[_0x5707('0x8')]=VoiceQueueEvents;
\ No newline at end of file
+var _0x1b27=['save','update','emit','hasOwnProperty','exports','../../mysqldb','setMaxListeners'];(function(_0x3adb8e,_0x247ca2){var _0x3eacdb=function(_0x127ddf){while(--_0x127ddf){_0x3adb8e['push'](_0x3adb8e['shift']());}};_0x3eacdb(++_0x247ca2);}(_0x1b27,0xd7));var _0x71b2=function(_0x25f04b,_0x43c5ef){_0x25f04b=_0x25f04b-0x0;var _0xe12b1c=_0x1b27[_0x25f04b];return _0xe12b1c;};'use strict';var EventEmitter=require('events');var VoiceQueue=require(_0x71b2('0x0'))['db']['VoiceQueue'];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0x71b2('0x1')](0x0);var events={'afterCreate':_0x71b2('0x2'),'afterUpdate':_0x71b2('0x3'),'afterDestroy':'remove'};function emitEvent(_0x112d29){return function(_0x30e637,_0x5511c9,_0x202834){VoiceQueueEvents[_0x71b2('0x4')](_0x112d29+':'+_0x30e637['id'],_0x30e637);VoiceQueueEvents['emit'](_0x112d29,_0x30e637);_0x202834(null);};}for(var e in events){if(events[_0x71b2('0x5')](e)){var event=events[e];VoiceQueue['hook'](e,emitEvent(event));}}module[_0x71b2('0x6')]=VoiceQueueEvents;
\ No newline at end of file
diff --git a/server/api/voiceQueue/voiceQueue.model.js b/server/api/voiceQueue/voiceQueue.model.js
index 942941d..8201566 100644
--- a/server/api/voiceQueue/voiceQueue.model.js
+++ b/server/api/voiceQueue/voiceQueue.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x875f=['api','moment','bluebird','request-promise','path','rimraf','exports','define','VoiceQueue','lodash','util','../../config/logger'];(function(_0x36952d,_0x2f4779){var _0x3fbff5=function(_0x21aa09){while(--_0x21aa09){_0x36952d['push'](_0x36952d['shift']());}};_0x3fbff5(++_0x2f4779);}(_0x875f,0x81));var _0xf875=function(_0x3173e0,_0x3a36a3){_0x3173e0=_0x3173e0-0x0;var _0x3a0aa6=_0x875f[_0x3173e0];return _0x3a0aa6;};'use strict';var _=require(_0xf875('0x0'));var util=require(_0xf875('0x1'));var logger=require(_0xf875('0x2'))(_0xf875('0x3'));var moment=require(_0xf875('0x4'));var BPromise=require(_0xf875('0x5'));var rp=require(_0xf875('0x6'));var fs=require('fs');var path=require(_0xf875('0x7'));var rimraf=require(_0xf875('0x8'));var config=require('../../config/environment');var attributes=require('./voiceQueue.attributes');module[_0xf875('0x9')]=function(_0x31579b,_0x1a86ea){return _0x31579b[_0xf875('0xa')](_0xf875('0xb'),attributes,{'tableName':'voice_queues','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x2ef0=['util','api','bluebird','path','rimraf','../../config/environment','./voiceQueue.attributes','VoiceQueue','lodash'];(function(_0x39d544,_0x35c14f){var _0x5a5ff2=function(_0x2271fb){while(--_0x2271fb){_0x39d544['push'](_0x39d544['shift']());}};_0x5a5ff2(++_0x35c14f);}(_0x2ef0,0x116));var _0x02ef=function(_0x39fc20,_0x4aff5c){_0x39fc20=_0x39fc20-0x0;var _0x456bf0=_0x2ef0[_0x39fc20];return _0x456bf0;};'use strict';var _=require(_0x02ef('0x0'));var util=require(_0x02ef('0x1'));var logger=require('../../config/logger')(_0x02ef('0x2'));var moment=require('moment');var BPromise=require(_0x02ef('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x02ef('0x4'));var rimraf=require(_0x02ef('0x5'));var config=require(_0x02ef('0x6'));var attributes=require(_0x02ef('0x7'));module['exports']=function(_0x485cf1,_0x33e6cc){return _0x485cf1['define'](_0x02ef('0x8'),attributes,{'tableName':'voice_queues','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/voiceQueue/voiceQueue.rpc.js b/server/api/voiceQueue/voiceQueue.rpc.js
index 1d5f919..db85e66 100644
--- a/server/api/voiceQueue/voiceQueue.rpc.js
+++ b/server/api/voiceQueue/voiceQueue.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xe0be=['then','request\x20sent','debug','VoiceQueue,\x20%s,\x20%s,\x20%s','error','VoiceQueue,\x20%s,\x20%s','message','info','result','catch','VoiceQueue','findAll','options','raw','attributes','limit','include','map','model','GetVoiceQueue','stringify','ShowVoiceQueue','where','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','./voiceQueue.socket','register'];(function(_0x8e4cd2,_0x1080e5){var _0x37a4aa=function(_0x34baf1){while(--_0x34baf1){_0x8e4cd2['push'](_0x8e4cd2['shift']());}};_0x37a4aa(++_0x1080e5);}(_0xe0be,0x167));var _0xee0b=function(_0x76481e,_0x1b3af8){_0x76481e=_0x76481e-0x0;var _0x11b839=_0xe0be[_0x76481e];return _0x11b839;};'use strict';var _=require(_0xee0b('0x0'));var util=require(_0xee0b('0x1'));var moment=require(_0xee0b('0x2'));var BPromise=require(_0xee0b('0x3'));var rs=require(_0xee0b('0x4'));var fs=require('fs');var Redis=require(_0xee0b('0x5'));var db=require(_0xee0b('0x6'))['db'];var utils=require(_0xee0b('0x7'));var logger=require(_0xee0b('0x8'))(_0xee0b('0x9'));var config=require(_0xee0b('0xa'));var jayson=require('jayson/promise');var client=jayson[_0xee0b('0xb')][_0xee0b('0xc')]({'port':0x232a});config[_0xee0b('0xd')]=_[_0xee0b('0xe')](config[_0xee0b('0xd')],{'host':_0xee0b('0xf'),'port':0x18eb});var socket=require(_0xee0b('0x10'))(new Redis(config[_0xee0b('0xd')]));require(_0xee0b('0x11'))[_0xee0b('0x12')](socket);function respondWithRpcPromise(_0x198ade,_0x1a7464,_0x5d4e4c){return new BPromise(function(_0x26ea2d,_0x37d3b5){return client['request'](_0x198ade,_0x5d4e4c)[_0xee0b('0x13')](function(_0x1e9003){logger['info']('VoiceQueue,\x20%s,\x20%s',_0x1a7464,_0xee0b('0x14'));logger[_0xee0b('0x15')](_0xee0b('0x16'),_0x1a7464,_0xee0b('0x14'),JSON['stringify'](_0x1e9003));if(_0x1e9003['error']){if(_0x1e9003[_0xee0b('0x17')]['code']===0x1f4){logger[_0xee0b('0x17')](_0xee0b('0x18'),_0x1a7464,_0x1e9003[_0xee0b('0x17')]['message']);return _0x37d3b5(_0x1e9003[_0xee0b('0x17')]['message']);}logger['error'](_0xee0b('0x18'),_0x1a7464,_0x1e9003[_0xee0b('0x17')]['message']);return _0x26ea2d(_0x1e9003[_0xee0b('0x17')][_0xee0b('0x19')]);}else{logger[_0xee0b('0x1a')](_0xee0b('0x18'),_0x1a7464,'request\x20sent');_0x26ea2d(_0x1e9003[_0xee0b('0x1b')][_0xee0b('0x19')]);}})[_0xee0b('0x1c')](function(_0x1889ed){logger[_0xee0b('0x17')](_0xee0b('0x18'),_0x1a7464,_0x1889ed);_0x37d3b5(_0x1889ed);});});}exports['GetVoiceQueue']=function(_0x3ac25a){var _0x5143c1=this;return new Promise(function(_0x585aec,_0x487e3c){return db[_0xee0b('0x1d')][_0xee0b('0x1e')]({'raw':_0x3ac25a[_0xee0b('0x1f')]?_0x3ac25a[_0xee0b('0x1f')][_0xee0b('0x20')]===undefined?!![]:![]:!![],'where':_0x3ac25a[_0xee0b('0x1f')]?_0x3ac25a['options']['where']||null:null,'attributes':_0x3ac25a[_0xee0b('0x1f')]?_0x3ac25a['options'][_0xee0b('0x21')]||null:null,'limit':_0x3ac25a[_0xee0b('0x1f')]?_0x3ac25a[_0xee0b('0x1f')][_0xee0b('0x22')]||null:null,'include':_0x3ac25a[_0xee0b('0x1f')]?_0x3ac25a[_0xee0b('0x1f')][_0xee0b('0x23')]?_[_0xee0b('0x24')](_0x3ac25a[_0xee0b('0x1f')][_0xee0b('0x23')],function(_0x30cc84){return{'model':db[_0x30cc84['model']],'as':_0x30cc84['as'],'attributes':_0x30cc84['attributes'],'include':_0x30cc84['include']?_[_0xee0b('0x24')](_0x30cc84[_0xee0b('0x23')],function(_0x12c240){return{'model':db[_0x12c240[_0xee0b('0x25')]],'as':_0x12c240['as'],'attributes':_0x12c240[_0xee0b('0x21')],'include':_0x12c240[_0xee0b('0x23')]?_[_0xee0b('0x24')](_0x12c240[_0xee0b('0x23')],function(_0x79dc50){return{'model':db[_0x79dc50['model']],'as':_0x79dc50['as'],'attributes':_0x79dc50[_0xee0b('0x21')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x35deee){logger[_0xee0b('0x1a')]('GetVoiceQueue',_0x3ac25a);logger[_0xee0b('0x15')](_0xee0b('0x26'),_0x3ac25a,JSON[_0xee0b('0x27')](_0x35deee));_0x585aec(_0x35deee);})[_0xee0b('0x1c')](function(_0x768021){logger['error'](_0xee0b('0x26'),_0x768021[_0xee0b('0x19')],_0x3ac25a);_0x487e3c(_0x5143c1[_0xee0b('0x17')](0x1f4,_0x768021[_0xee0b('0x19')]));});});};exports[_0xee0b('0x28')]=function(_0x3c5787){var _0x1a290d=this;return new Promise(function(_0x17f756,_0x56fca8){return db[_0xee0b('0x1d')]['find']({'raw':_0x3c5787[_0xee0b('0x1f')]?_0x3c5787[_0xee0b('0x1f')][_0xee0b('0x20')]===undefined?!![]:![]:!![],'where':_0x3c5787[_0xee0b('0x1f')]?_0x3c5787[_0xee0b('0x1f')][_0xee0b('0x29')]||null:null,'attributes':_0x3c5787[_0xee0b('0x1f')]?_0x3c5787['options'][_0xee0b('0x21')]||null:null,'include':_0x3c5787[_0xee0b('0x1f')]?_0x3c5787[_0xee0b('0x1f')][_0xee0b('0x23')]?_[_0xee0b('0x24')](_0x3c5787[_0xee0b('0x1f')][_0xee0b('0x23')],function(_0x3be47b){return{'model':db[_0x3be47b[_0xee0b('0x25')]],'as':_0x3be47b['as'],'attributes':_0x3be47b['attributes'],'include':_0x3be47b['include']?_[_0xee0b('0x24')](_0x3be47b[_0xee0b('0x23')],function(_0x6f2119){return{'model':db[_0x6f2119[_0xee0b('0x25')]],'as':_0x6f2119['as'],'attributes':_0x6f2119[_0xee0b('0x21')],'include':_0x6f2119[_0xee0b('0x23')]?_[_0xee0b('0x24')](_0x6f2119[_0xee0b('0x23')],function(_0x4d8eb6){return{'model':db[_0x4d8eb6[_0xee0b('0x25')]],'as':_0x4d8eb6['as'],'attributes':_0x4d8eb6[_0xee0b('0x21')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3e627a){logger['info'](_0xee0b('0x28'),_0x3c5787);logger[_0xee0b('0x15')](_0xee0b('0x28'),_0x3c5787,JSON[_0xee0b('0x27')](_0x3e627a));_0x17f756(_0x3e627a);})['catch'](function(_0x15544d){logger[_0xee0b('0x17')](_0xee0b('0x28'),_0x15544d['message'],_0x3c5787);_0x56fca8(_0x1a290d[_0xee0b('0x17')](0x1f4,_0x15544d[_0xee0b('0x19')]));});});};
\ No newline at end of file
+var _0xe764=['stringify','error','message','catch','VoiceQueue','findAll','options','raw','attributes','limit','include','model','map','GetVoiceQueue','ShowVoiceQueue','find','where','debug','lodash','util','bluebird','randomstring','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./voiceQueue.socket','then','info','VoiceQueue,\x20%s,\x20%s','VoiceQueue,\x20%s,\x20%s,\x20%s'];(function(_0x532402,_0x127c1d){var _0x5d35d9=function(_0xa5f80){while(--_0xa5f80){_0x532402['push'](_0x532402['shift']());}};_0x5d35d9(++_0x127c1d);}(_0xe764,0x9e));var _0x4e76=function(_0x134999,_0x4de0c9){_0x134999=_0x134999-0x0;var _0x46e471=_0xe764[_0x134999];return _0x46e471;};'use strict';var _=require(_0x4e76('0x0'));var util=require(_0x4e76('0x1'));var moment=require('moment');var BPromise=require(_0x4e76('0x2'));var rs=require(_0x4e76('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x4e76('0x4'));var jayson=require(_0x4e76('0x5'));var client=jayson[_0x4e76('0x6')][_0x4e76('0x7')]({'port':0x232a});config[_0x4e76('0x8')]=_[_0x4e76('0x9')](config['redis'],{'host':_0x4e76('0xa'),'port':0x18eb});var socket=require(_0x4e76('0xb'))(new Redis(config['redis']));require(_0x4e76('0xc'))['register'](socket);function respondWithRpcPromise(_0x1e54e0,_0x2afab5,_0x4100ce){return new BPromise(function(_0x1f7cf6,_0x5404c1){return client['request'](_0x1e54e0,_0x4100ce)[_0x4e76('0xd')](function(_0x6c924e){logger[_0x4e76('0xe')](_0x4e76('0xf'),_0x2afab5,'request\x20sent');logger['debug'](_0x4e76('0x10'),_0x2afab5,'request\x20sent',JSON[_0x4e76('0x11')](_0x6c924e));if(_0x6c924e[_0x4e76('0x12')]){if(_0x6c924e['error']['code']===0x1f4){logger[_0x4e76('0x12')](_0x4e76('0xf'),_0x2afab5,_0x6c924e['error'][_0x4e76('0x13')]);return _0x5404c1(_0x6c924e['error']['message']);}logger['error'](_0x4e76('0xf'),_0x2afab5,_0x6c924e[_0x4e76('0x12')][_0x4e76('0x13')]);return _0x1f7cf6(_0x6c924e[_0x4e76('0x12')][_0x4e76('0x13')]);}else{logger[_0x4e76('0xe')](_0x4e76('0xf'),_0x2afab5,'request\x20sent');_0x1f7cf6(_0x6c924e['result'][_0x4e76('0x13')]);}})[_0x4e76('0x14')](function(_0x4e7a9d){logger[_0x4e76('0x12')]('VoiceQueue,\x20%s,\x20%s',_0x2afab5,_0x4e7a9d);_0x5404c1(_0x4e7a9d);});});}exports['GetVoiceQueue']=function(_0x26b1b5){var _0x584b04=this;return new Promise(function(_0x2bdf72,_0x3e72ad){return db[_0x4e76('0x15')][_0x4e76('0x16')]({'raw':_0x26b1b5[_0x4e76('0x17')]?_0x26b1b5['options'][_0x4e76('0x18')]===undefined?!![]:![]:!![],'where':_0x26b1b5[_0x4e76('0x17')]?_0x26b1b5['options']['where']||null:null,'attributes':_0x26b1b5[_0x4e76('0x17')]?_0x26b1b5[_0x4e76('0x17')][_0x4e76('0x19')]||null:null,'limit':_0x26b1b5['options']?_0x26b1b5[_0x4e76('0x17')][_0x4e76('0x1a')]||null:null,'include':_0x26b1b5[_0x4e76('0x17')]?_0x26b1b5[_0x4e76('0x17')]['include']?_['map'](_0x26b1b5[_0x4e76('0x17')][_0x4e76('0x1b')],function(_0x12ca39){return{'model':db[_0x12ca39[_0x4e76('0x1c')]],'as':_0x12ca39['as'],'attributes':_0x12ca39[_0x4e76('0x19')],'include':_0x12ca39[_0x4e76('0x1b')]?_[_0x4e76('0x1d')](_0x12ca39[_0x4e76('0x1b')],function(_0x5bbeb7){return{'model':db[_0x5bbeb7[_0x4e76('0x1c')]],'as':_0x5bbeb7['as'],'attributes':_0x5bbeb7[_0x4e76('0x19')],'include':_0x5bbeb7[_0x4e76('0x1b')]?_['map'](_0x5bbeb7[_0x4e76('0x1b')],function(_0x58ba00){return{'model':db[_0x58ba00['model']],'as':_0x58ba00['as'],'attributes':_0x58ba00['attributes']};}):[]};}):[]};}):[]:[]})[_0x4e76('0xd')](function(_0x18d9ee){logger[_0x4e76('0xe')](_0x4e76('0x1e'),_0x26b1b5);logger['debug'](_0x4e76('0x1e'),_0x26b1b5,JSON[_0x4e76('0x11')](_0x18d9ee));_0x2bdf72(_0x18d9ee);})[_0x4e76('0x14')](function(_0x3e46b6){logger[_0x4e76('0x12')](_0x4e76('0x1e'),_0x3e46b6[_0x4e76('0x13')],_0x26b1b5);_0x3e72ad(_0x584b04[_0x4e76('0x12')](0x1f4,_0x3e46b6['message']));});});};exports[_0x4e76('0x1f')]=function(_0xd73f8e){var _0x4c25fc=this;return new Promise(function(_0x239085,_0x13436b){return db[_0x4e76('0x15')][_0x4e76('0x20')]({'raw':_0xd73f8e[_0x4e76('0x17')]?_0xd73f8e[_0x4e76('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0xd73f8e[_0x4e76('0x17')]?_0xd73f8e['options'][_0x4e76('0x21')]||null:null,'attributes':_0xd73f8e[_0x4e76('0x17')]?_0xd73f8e[_0x4e76('0x17')][_0x4e76('0x19')]||null:null,'include':_0xd73f8e[_0x4e76('0x17')]?_0xd73f8e[_0x4e76('0x17')]['include']?_['map'](_0xd73f8e[_0x4e76('0x17')][_0x4e76('0x1b')],function(_0x5826d6){return{'model':db[_0x5826d6[_0x4e76('0x1c')]],'as':_0x5826d6['as'],'attributes':_0x5826d6[_0x4e76('0x19')],'include':_0x5826d6[_0x4e76('0x1b')]?_['map'](_0x5826d6[_0x4e76('0x1b')],function(_0x47df89){return{'model':db[_0x47df89['model']],'as':_0x47df89['as'],'attributes':_0x47df89['attributes'],'include':_0x47df89['include']?_[_0x4e76('0x1d')](_0x47df89[_0x4e76('0x1b')],function(_0x1d0e91){return{'model':db[_0x1d0e91['model']],'as':_0x1d0e91['as'],'attributes':_0x1d0e91['attributes']};}):[]};}):[]};}):[]:[]})[_0x4e76('0xd')](function(_0x331f2e){logger[_0x4e76('0xe')]('ShowVoiceQueue',_0xd73f8e);logger[_0x4e76('0x22')]('ShowVoiceQueue',_0xd73f8e,JSON['stringify'](_0x331f2e));_0x239085(_0x331f2e);})[_0x4e76('0x14')](function(_0x1d0303){logger[_0x4e76('0x12')](_0x4e76('0x1f'),_0x1d0303[_0x4e76('0x13')],_0xd73f8e);_0x13436b(_0x4c25fc['error'](0x1f4,_0x1d0303[_0x4e76('0x13')]));});});};
\ No newline at end of file
diff --git a/server/api/voiceQueue/voiceQueue.socket.js b/server/api/voiceQueue/voiceQueue.socket.js
index e4c64d3..9523f39 100644
--- a/server/api/voiceQueue/voiceQueue.socket.js
+++ b/server/api/voiceQueue/voiceQueue.socket.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x2227=['voiceQueue:','./voiceQueue.events','remove','update','emit','removeListener','length'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2227,0x143));var _0x7222=function(_0x60df74,_0x458e29){_0x60df74=_0x60df74-0x0;var _0x5ee872=_0x2227[_0x60df74];return _0x5ee872;};'use strict';var VoiceQueueEvents=require(_0x7222('0x0'));var events=['save',_0x7222('0x1'),_0x7222('0x2')];function createListener(_0x202646,_0x5d258e){return function(_0x1b3c1e){_0x5d258e[_0x7222('0x3')](_0x202646,_0x1b3c1e);};}function removeListener(_0x1e522c,_0x44f908){return function(){VoiceQueueEvents[_0x7222('0x4')](_0x1e522c,_0x44f908);};}exports['register']=function(_0x2cdd4b){for(var _0x3e62d3=0x0,_0x7ef191=events[_0x7222('0x5')];_0x3e62d3<_0x7ef191;_0x3e62d3++){var _0x5542f3=events[_0x3e62d3];var _0x3cb446=createListener(_0x7222('0x6')+_0x5542f3,_0x2cdd4b);VoiceQueueEvents['on'](_0x5542f3,_0x3cb446);}};
\ No newline at end of file
+var _0x878f=['save','remove','update','emit','removeListener','register','length'];(function(_0x36f65d,_0x3a8cfb){var _0x3ace18=function(_0x128179){while(--_0x128179){_0x36f65d['push'](_0x36f65d['shift']());}};_0x3ace18(++_0x3a8cfb);}(_0x878f,0x173));var _0xf878=function(_0x47c0ac,_0x5ef37c){_0x47c0ac=_0x47c0ac-0x0;var _0x378c6f=_0x878f[_0x47c0ac];return _0x378c6f;};'use strict';var VoiceQueueEvents=require('./voiceQueue.events');var events=[_0xf878('0x0'),_0xf878('0x1'),_0xf878('0x2')];function createListener(_0x12df2b,_0x1b3d0b){return function(_0x3d74cf){_0x1b3d0b[_0xf878('0x3')](_0x12df2b,_0x3d74cf);};}function removeListener(_0x45a37b,_0x240b48){return function(){VoiceQueueEvents[_0xf878('0x4')](_0x45a37b,_0x240b48);};}exports[_0xf878('0x5')]=function(_0x4bc9aa){for(var _0x4ac8d8=0x0,_0x3c5f5c=events[_0xf878('0x6')];_0x4ac8d8<_0x3c5f5c;_0x4ac8d8++){var _0x59e564=events[_0x4ac8d8];var _0x52851e=createListener('voiceQueue:'+_0x59e564,_0x4bc9aa);VoiceQueueEvents['on'](_0x59e564,_0x52851e);}};
\ No newline at end of file
diff --git a/server/api/voiceQueueReport/index.js b/server/api/voiceQueueReport/index.js
index 777c8c7..147ec0a 100644
--- a/server/api/voiceQueueReport/index.js
+++ b/server/api/voiceQueueReport/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x2b29=['delete','destroy','exports','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueueReport.controller','get','isAuthenticated','describe','/index','getVoiceQueuesReport','show','post','create','put','/:id','update'];(function(_0x158ab3,_0x4b5908){var _0x302830=function(_0x19fa14){while(--_0x19fa14){_0x158ab3['push'](_0x158ab3['shift']());}};_0x302830(++_0x4b5908);}(_0x2b29,0x163));var _0x92b2=function(_0x54c871,_0x52439d){_0x54c871=_0x54c871-0x0;var _0x1bcac3=_0x2b29[_0x54c871];return _0x1bcac3;};'use strict';var multer=require('multer');var util=require(_0x92b2('0x0'));var path=require(_0x92b2('0x1'));var timeout=require(_0x92b2('0x2'));var express=require(_0x92b2('0x3'));var router=express['Router']();var auth=require(_0x92b2('0x4'));var interaction=require(_0x92b2('0x5'));var config=require(_0x92b2('0x6'));var controller=require(_0x92b2('0x7'));router[_0x92b2('0x8')]('/',auth[_0x92b2('0x9')](),controller['index']);router[_0x92b2('0x8')]('/describe',auth[_0x92b2('0x9')](),controller[_0x92b2('0xa')]);router['get'](_0x92b2('0xb'),auth[_0x92b2('0x9')](),controller[_0x92b2('0xc')]);router[_0x92b2('0x8')]('/:id',auth[_0x92b2('0x9')](),controller[_0x92b2('0xd')]);router[_0x92b2('0xe')]('/',auth[_0x92b2('0x9')](),controller[_0x92b2('0xf')]);router[_0x92b2('0x10')](_0x92b2('0x11'),auth['isAuthenticated'](),controller[_0x92b2('0x12')]);router[_0x92b2('0x13')](_0x92b2('0x11'),auth['isAuthenticated'](),controller[_0x92b2('0x14')]);module[_0x92b2('0x15')]=router;
\ No newline at end of file
+var _0x50e5=['update','delete','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueueReport.controller','get','isAuthenticated','index','/describe','describe','getVoiceQueuesReport','create','/:id'];(function(_0x4a8e14,_0x519668){var _0x28be98=function(_0x147116){while(--_0x147116){_0x4a8e14['push'](_0x4a8e14['shift']());}};_0x28be98(++_0x519668);}(_0x50e5,0xb7));var _0x550e=function(_0x444bba,_0x4882f0){_0x444bba=_0x444bba-0x0;var _0x3b0a2e=_0x50e5[_0x444bba];return _0x3b0a2e;};'use strict';var multer=require(_0x550e('0x0'));var util=require(_0x550e('0x1'));var path=require('path');var timeout=require(_0x550e('0x2'));var express=require(_0x550e('0x3'));var router=express[_0x550e('0x4')]();var auth=require(_0x550e('0x5'));var interaction=require(_0x550e('0x6'));var config=require(_0x550e('0x7'));var controller=require(_0x550e('0x8'));router[_0x550e('0x9')]('/',auth[_0x550e('0xa')](),controller[_0x550e('0xb')]);router[_0x550e('0x9')](_0x550e('0xc'),auth['isAuthenticated'](),controller[_0x550e('0xd')]);router[_0x550e('0x9')]('/index',auth[_0x550e('0xa')](),controller[_0x550e('0xe')]);router[_0x550e('0x9')]('/:id',auth[_0x550e('0xa')](),controller['show']);router['post']('/',auth[_0x550e('0xa')](),controller[_0x550e('0xf')]);router['put'](_0x550e('0x10'),auth[_0x550e('0xa')](),controller[_0x550e('0x11')]);router[_0x550e('0x12')]('/:id',auth[_0x550e('0xa')](),controller['destroy']);module[_0x550e('0x13')]=router;
\ No newline at end of file
diff --git a/server/api/voiceQueueReport/voiceQueueReport.attributes.js b/server/api/voiceQueueReport/voiceQueueReport.attributes.js
index f2ce519..2623ba5 100644
--- a/server/api/voiceQueueReport/voiceQueueReport.attributes.js
+++ b/server/api/voiceQueueReport/voiceQueueReport.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x3c54=['STRING','DATE','getDataValue','YYYY-MM-DD\x20HH:mm:ss','seconds','setDataValue','queuecallerleaveAt','holdtime','INTEGER','BOOLEAN','FORWARD,\x20BLIND,\x20ATTENDED','sequelize','moment','exports'];(function(_0x337748,_0x402b05){var _0x3bb03f=function(_0x2fcdf4){while(--_0x2fcdf4){_0x337748['push'](_0x337748['shift']());}};_0x3bb03f(++_0x402b05);}(_0x3c54,0x14d));var _0x43c5=function(_0x4925b5,_0x2f8ac2){_0x4925b5=_0x4925b5-0x0;var _0x412b8b=_0x3c54[_0x4925b5];return _0x412b8b;};'use strict';var Sequelize=require(_0x43c5('0x0'));var moment=require(_0x43c5('0x1'));module[_0x43c5('0x2')]={'type':{'type':Sequelize[_0x43c5('0x3')]},'uniqueid':{'type':Sequelize[_0x43c5('0x3')]},'calleridnum':{'type':Sequelize[_0x43c5('0x3')]},'calleridname':{'type':Sequelize[_0x43c5('0x3')]},'queue':{'type':Sequelize[_0x43c5('0x3')]},'queuecallerjoinAt':{'type':Sequelize[_0x43c5('0x4')]},'queuecallerleaveAt':{'type':Sequelize['DATE'],'set':function(_0x564843){var _0x1ff20a=moment(_0x564843);var _0x50aa67=moment(this[_0x43c5('0x5')]('queuecallerjoinAt'))['format'](_0x43c5('0x6'));var _0x4c0594=_0x1ff20a['diff'](_0x50aa67,_0x43c5('0x7'));this[_0x43c5('0x8')](_0x43c5('0x9'),_0x564843);this[_0x43c5('0x8')](_0x43c5('0xa'),_0x4c0594||null);}},'position':{'type':Sequelize[_0x43c5('0xb')]},'count':{'type':Sequelize['INTEGER']},'queuecallerabandon':{'type':Sequelize[_0x43c5('0xc')],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize[_0x43c5('0x4')]},'queuecallercomplete':{'type':Sequelize[_0x43c5('0xc')],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize['DATE']},'queuecallerexit':{'type':Sequelize[_0x43c5('0xc')],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize[_0x43c5('0x4')]},'queuecallerexitreason':{'type':Sequelize[_0x43c5('0x3')],'comment':'COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT'},'originalposition':{'type':Sequelize['INTEGER']},'channel':{'type':Sequelize[_0x43c5('0x3')]},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize[_0x43c5('0x3')]},'accountcode':{'type':Sequelize[_0x43c5('0x3')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize[_0x43c5('0x3')]},'priority':{'type':Sequelize['STRING']},'holdtime':{'type':Sequelize[_0x43c5('0xb')]},'mohtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'assigned':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize[_0x43c5('0x3')]},'transfer':{'type':Sequelize[_0x43c5('0xc')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x43c5('0x3')],'comment':_0x43c5('0xd')},'transferexten':{'type':Sequelize[_0x43c5('0x3')]},'transferuniqueid':{'type':Sequelize[_0x43c5('0x3')]},'disposition':{'type':Sequelize[_0x43c5('0x3')]},'queuecallerenterreason':{'type':Sequelize['INTEGER'],'defaultValue':0x0}};
\ No newline at end of file
+var _0x5973=['BOOLEAN','DATE','FORWARD,\x20BLIND,\x20ATTENDED','sequelize','moment','STRING','getDataValue','queuecallerjoinAt','YYYY-MM-DD\x20HH:mm:ss','seconds','setDataValue','queuecallerleaveAt','holdtime','INTEGER'];(function(_0x32afa0,_0x101934){var _0x89c2c=function(_0x74e98b){while(--_0x74e98b){_0x32afa0['push'](_0x32afa0['shift']());}};_0x89c2c(++_0x101934);}(_0x5973,0xb9));var _0x3597=function(_0x3bd4e5,_0x33854f){_0x3bd4e5=_0x3bd4e5-0x0;var _0x2d1522=_0x5973[_0x3bd4e5];return _0x2d1522;};'use strict';var Sequelize=require(_0x3597('0x0'));var moment=require(_0x3597('0x1'));module['exports']={'type':{'type':Sequelize[_0x3597('0x2')]},'uniqueid':{'type':Sequelize[_0x3597('0x2')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x3597('0x2')]},'queue':{'type':Sequelize[_0x3597('0x2')]},'queuecallerjoinAt':{'type':Sequelize['DATE']},'queuecallerleaveAt':{'type':Sequelize['DATE'],'set':function(_0x347325){var _0x1fcbd2=moment(_0x347325);var _0x55d0b2=moment(this[_0x3597('0x3')](_0x3597('0x4')))['format'](_0x3597('0x5'));var _0x38d15b=_0x1fcbd2['diff'](_0x55d0b2,_0x3597('0x6'));this[_0x3597('0x7')](_0x3597('0x8'),_0x347325);this['setDataValue'](_0x3597('0x9'),_0x38d15b||null);}},'position':{'type':Sequelize['INTEGER']},'count':{'type':Sequelize[_0x3597('0xa')]},'queuecallerabandon':{'type':Sequelize[_0x3597('0xb')],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize['DATE']},'queuecallercomplete':{'type':Sequelize[_0x3597('0xb')],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize[_0x3597('0xc')]},'queuecallerexit':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize['DATE']},'queuecallerexitreason':{'type':Sequelize['STRING'],'comment':'COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT'},'originalposition':{'type':Sequelize[_0x3597('0xa')]},'channel':{'type':Sequelize[_0x3597('0x2')]},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize[_0x3597('0x2')]},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0x3597('0x2')]},'holdtime':{'type':Sequelize[_0x3597('0xa')]},'mohtime':{'type':Sequelize[_0x3597('0xa')],'defaultValue':0x0},'assigned':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize['STRING']},'transfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x3597('0x2')],'comment':_0x3597('0xd')},'transferexten':{'type':Sequelize['STRING']},'transferuniqueid':{'type':Sequelize[_0x3597('0x2')]},'disposition':{'type':Sequelize[_0x3597('0x2')]},'queuecallerenterreason':{'type':Sequelize[_0x3597('0xa')],'defaultValue':0x0}};
\ No newline at end of file
diff --git a/server/api/voiceQueueReport/voiceQueueReport.controller.js b/server/api/voiceQueueReport/voiceQueueReport.controller.js
index 086c1d8..7e9016b 100644
--- a/server/api/voiceQueueReport/voiceQueueReport.controller.js
+++ b/server/api/voiceQueueReport/voiceQueueReport.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7a54=['hasOwnProperty','order','sort','where','pick','filter','merge','type','VIRTUAL','VoiceQueueReport','includeAll','include','findAll','rows','catch','show','keys','options','find','create','body','params','describe','getVoiceQueuesReport','intersection','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./voiceQueueReport.socket','register','sendStatus','end','status','count','offset','limit','set','json','apply','reject','update','destroy','then','error','stack','name','send','index','map','rawAttributes','fieldName','key','model','query','filters','attributes','fields','length'];(function(_0x20a558,_0x160e0e){var _0x53d3f7=function(_0x259bd8){while(--_0x259bd8){_0x20a558['push'](_0x20a558['shift']());}};_0x53d3f7(++_0x160e0e);}(_0x7a54,0x106));var _0x47a5=function(_0x49996c,_0x32682f){_0x49996c=_0x49996c-0x0;var _0x5681c2=_0x7a54[_0x49996c];return _0x5681c2;};'use strict';var pdf=require(_0x47a5('0x0'));var emlformat=require(_0x47a5('0x1'));var rimraf=require(_0x47a5('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x47a5('0x3'));var rp=require(_0x47a5('0x4'));var moment=require('moment');var BPromise=require(_0x47a5('0x5'));var Mustache=require(_0x47a5('0x6'));var util=require(_0x47a5('0x7'));var path=require(_0x47a5('0x8'));var sox=require(_0x47a5('0x9'));var csv=require('to-csv');var ejs=require(_0x47a5('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var db=require(_0x47a5('0x14'))['db'];config[_0x47a5('0x15')]=_[_0x47a5('0x16')](config[_0x47a5('0x15')],{'host':'localhost','port':0x18eb});var socket=require(_0x47a5('0x17'))(new Redis(config[_0x47a5('0x15')]));require(_0x47a5('0x18'))[_0x47a5('0x19')](socket);function respondWithStatusCode(_0x139f25,_0x620ee9){_0x620ee9=_0x620ee9||0xcc;return function(_0x3c6c46){if(_0x3c6c46){return _0x139f25[_0x47a5('0x1a')](_0x620ee9);}return _0x139f25['status'](_0x620ee9)[_0x47a5('0x1b')]();};}function respondWithResult(_0x11faf5,_0x3b001e){_0x3b001e=_0x3b001e||0xc8;return function(_0x2a2cbb){if(_0x2a2cbb){return _0x11faf5[_0x47a5('0x1c')](_0x3b001e)['json'](_0x2a2cbb);}};}function respondWithFilteredResult(_0x549de3,_0x138bc0){return function(_0x4b966e){if(_0x4b966e){var _0x5247fd=_0x4b966e[_0x47a5('0x1d')],_0x423a81=_0x138bc0[_0x47a5('0x1e')],_0xaf70a6=_0x138bc0[_0x47a5('0x1e')]+_0x138bc0[_0x47a5('0x1f')],_0x2ce454;if(_0xaf70a6>=_0x5247fd){_0xaf70a6=_0x5247fd;_0x2ce454=0xc8;}else{_0x2ce454=0xce;}_0x549de3[_0x47a5('0x1c')](_0x2ce454);return _0x549de3[_0x47a5('0x20')]('Content-Range',_0x423a81+'-'+_0xaf70a6+'/'+_0x5247fd)[_0x47a5('0x21')](_0x4b966e);}return null;};}function patchUpdates(_0xf160ba){return function(_0x47cf3c){try{jsonpatch[_0x47a5('0x22')](_0x47cf3c,_0xf160ba,!![]);}catch(_0x1f03f7){return BPromise[_0x47a5('0x23')](_0x1f03f7);}return _0x47cf3c['save']();};}function saveUpdates(_0xb8ae6c,_0x2f142b){return function(_0x23db32){if(_0x23db32){return _0x23db32[_0x47a5('0x24')](_0xb8ae6c)['then'](function(_0xe2dea9){return _0xe2dea9;});}return null;};}function removeEntity(_0x385687,_0x513981){return function(_0x28747d){if(_0x28747d){return _0x28747d[_0x47a5('0x25')]()[_0x47a5('0x26')](function(){_0x385687[_0x47a5('0x1c')](0xcc)[_0x47a5('0x1b')]();});}};}function handleEntityNotFound(_0x50bf17,_0x53078a){return function(_0x136745){if(!_0x136745){_0x50bf17['sendStatus'](0x194);}return _0x136745;};}function handleError(_0x1ea9c8,_0x5b6c4e){_0x5b6c4e=_0x5b6c4e||0x1f4;return function(_0x23cb77){logger[_0x47a5('0x27')](_0x23cb77[_0x47a5('0x28')]);if(_0x23cb77[_0x47a5('0x29')]){delete _0x23cb77[_0x47a5('0x29')];}_0x1ea9c8[_0x47a5('0x1c')](_0x5b6c4e)[_0x47a5('0x2a')](_0x23cb77);};}exports[_0x47a5('0x2b')]=function(_0x16631f,_0x361bfa){var _0x1127f8={},_0x11a4fa={},_0x3ad507={'count':0x0,'rows':[]};var _0x528582=_[_0x47a5('0x2c')](db['VoiceQueueReport'][_0x47a5('0x2d')],function(_0x9ac908){return{'name':_0x9ac908[_0x47a5('0x2e')],'type':_0x9ac908['type'][_0x47a5('0x2f')]};});_0x11a4fa[_0x47a5('0x30')]=_[_0x47a5('0x2c')](_0x528582,_0x47a5('0x29'));_0x11a4fa['query']=_['keys'](_0x16631f[_0x47a5('0x31')]);_0x11a4fa[_0x47a5('0x32')]=_['intersection'](_0x11a4fa['model'],_0x11a4fa[_0x47a5('0x31')]);_0x1127f8[_0x47a5('0x33')]=_['intersection'](_0x11a4fa[_0x47a5('0x30')],qs['fields'](_0x16631f[_0x47a5('0x31')][_0x47a5('0x34')]));_0x1127f8['attributes']=_0x1127f8['attributes'][_0x47a5('0x35')]?_0x1127f8['attributes']:_0x11a4fa[_0x47a5('0x30')];if(!_0x16631f[_0x47a5('0x31')][_0x47a5('0x36')]('nolimit')){_0x1127f8[_0x47a5('0x1f')]=qs['limit'](_0x16631f['query'][_0x47a5('0x1f')]);_0x1127f8['offset']=qs[_0x47a5('0x1e')](_0x16631f['query'][_0x47a5('0x1e')]);}_0x1127f8[_0x47a5('0x37')]=qs[_0x47a5('0x38')](_0x16631f[_0x47a5('0x31')][_0x47a5('0x38')]);_0x1127f8[_0x47a5('0x39')]=qs[_0x47a5('0x32')](_[_0x47a5('0x3a')](_0x16631f[_0x47a5('0x31')],_0x11a4fa['filters']),_0x528582);if(_0x16631f[_0x47a5('0x31')][_0x47a5('0x3b')]){_0x1127f8['where']=_[_0x47a5('0x3c')](_0x1127f8[_0x47a5('0x39')],{'$or':_[_0x47a5('0x2c')](_0x528582,function(_0x49c4b5){if(_0x49c4b5[_0x47a5('0x3d')]!==_0x47a5('0x3e')){var _0x596097={};_0x596097[_0x49c4b5[_0x47a5('0x29')]]={'$like':'%'+_0x16631f[_0x47a5('0x31')]['filter']+'%'};return _0x596097;}})});}_0x1127f8=_['merge']({},_0x1127f8,_0x16631f['options']);var _0x12d9f2={'where':_0x1127f8['where']};return db[_0x47a5('0x3f')][_0x47a5('0x1d')](_0x12d9f2)[_0x47a5('0x26')](function(_0x111f0d){_0x3ad507[_0x47a5('0x1d')]=_0x111f0d;if(_0x16631f[_0x47a5('0x31')][_0x47a5('0x40')]){_0x1127f8[_0x47a5('0x41')]=[{'all':!![]}];}return db[_0x47a5('0x3f')][_0x47a5('0x42')](_0x1127f8);})[_0x47a5('0x26')](function(_0x1658e8){_0x3ad507[_0x47a5('0x43')]=_0x1658e8;return _0x3ad507;})['then'](respondWithFilteredResult(_0x361bfa,_0x1127f8))[_0x47a5('0x44')](handleError(_0x361bfa,null));};exports[_0x47a5('0x45')]=function(_0x331474,_0x23bd8d){var _0x586f4f={'raw':![],'where':{'id':_0x331474['params']['id']}},_0x7de536={};_0x7de536['model']=_['keys'](db['VoiceQueueReport'][_0x47a5('0x2d')]);_0x7de536['query']=_[_0x47a5('0x46')](_0x331474[_0x47a5('0x31')]);_0x7de536[_0x47a5('0x32')]=_['intersection'](_0x7de536[_0x47a5('0x30')],_0x7de536[_0x47a5('0x31')]);_0x586f4f['attributes']=_['intersection'](_0x7de536[_0x47a5('0x30')],qs['fields'](_0x331474[_0x47a5('0x31')][_0x47a5('0x34')]));_0x586f4f[_0x47a5('0x33')]=_0x586f4f[_0x47a5('0x33')][_0x47a5('0x35')]?_0x586f4f[_0x47a5('0x33')]:_0x7de536[_0x47a5('0x30')];if(_0x331474[_0x47a5('0x31')][_0x47a5('0x40')]){_0x586f4f[_0x47a5('0x41')]=[{'all':!![]}];}_0x586f4f=_[_0x47a5('0x3c')]({},_0x586f4f,_0x331474[_0x47a5('0x47')]);return db[_0x47a5('0x3f')][_0x47a5('0x48')](_0x586f4f)[_0x47a5('0x26')](handleEntityNotFound(_0x23bd8d,null))[_0x47a5('0x26')](respondWithResult(_0x23bd8d,null))['catch'](handleError(_0x23bd8d,null));};exports[_0x47a5('0x49')]=function(_0x23bb04,_0x49eab1){return db['VoiceQueueReport'][_0x47a5('0x49')](_0x23bb04['body'],{})[_0x47a5('0x26')](respondWithResult(_0x49eab1,0xc9))[_0x47a5('0x44')](handleError(_0x49eab1,null));};exports['update']=function(_0x4f62d3,_0x3d85cc){if(_0x4f62d3['body']['id']){delete _0x4f62d3[_0x47a5('0x4a')]['id'];}return db[_0x47a5('0x3f')][_0x47a5('0x48')]({'where':{'id':_0x4f62d3[_0x47a5('0x4b')]['id']}})[_0x47a5('0x26')](handleEntityNotFound(_0x3d85cc,null))[_0x47a5('0x26')](saveUpdates(_0x4f62d3[_0x47a5('0x4a')],null))['then'](respondWithResult(_0x3d85cc,null))['catch'](handleError(_0x3d85cc,null));};exports[_0x47a5('0x25')]=function(_0x411230,_0x1163e3){return db[_0x47a5('0x3f')][_0x47a5('0x48')]({'where':{'id':_0x411230[_0x47a5('0x4b')]['id']}})[_0x47a5('0x26')](handleEntityNotFound(_0x1163e3,null))['then'](removeEntity(_0x1163e3,null))[_0x47a5('0x44')](handleError(_0x1163e3,null));};exports[_0x47a5('0x4c')]=function(_0x5f6a,_0x5c3c75){return db[_0x47a5('0x3f')]['describe']()[_0x47a5('0x26')](respondWithResult(_0x5c3c75,null))[_0x47a5('0x44')](handleError(_0x5c3c75,null));};exports[_0x47a5('0x4d')]=function(_0xf03bd5,_0x588551){var _0x3adf14={},_0x1e6de3={},_0x2f66e9={'count':0x0,'rows':[]};_0x1e6de3[_0x47a5('0x30')]=_[_0x47a5('0x46')](db[_0x47a5('0x3f')][_0x47a5('0x2d')]);_0x1e6de3['query']=_[_0x47a5('0x46')](_0xf03bd5[_0x47a5('0x31')]);_0x1e6de3[_0x47a5('0x32')]=_[_0x47a5('0x4e')](_0x1e6de3[_0x47a5('0x30')],_0x1e6de3[_0x47a5('0x31')]);_0x3adf14['attributes']=_[_0x47a5('0x4e')](_0x1e6de3[_0x47a5('0x30')],qs[_0x47a5('0x34')](_0xf03bd5['query'][_0x47a5('0x34')]));_0x3adf14[_0x47a5('0x33')]=_0x3adf14[_0x47a5('0x33')]['length']?_0x3adf14['attributes']:_0x1e6de3[_0x47a5('0x30')];if(!_0xf03bd5[_0x47a5('0x31')]['hasOwnProperty']('nolimit')){_0x3adf14[_0x47a5('0x1f')]=qs['limit'](_0xf03bd5[_0x47a5('0x31')]['limit']);_0x3adf14['offset']=qs[_0x47a5('0x1e')](_0xf03bd5[_0x47a5('0x31')]['offset']);}_0x3adf14[_0x47a5('0x37')]=qs[_0x47a5('0x38')](_0xf03bd5['query']['sort']);_0x3adf14[_0x47a5('0x39')]=qs[_0x47a5('0x32')](_[_0x47a5('0x3a')](_0xf03bd5[_0x47a5('0x31')],_0x1e6de3['filters']));if(_0xf03bd5[_0x47a5('0x31')][_0x47a5('0x3b')]){_0x3adf14[_0x47a5('0x39')]=_['merge'](_0x3adf14[_0x47a5('0x39')],{'$or':_['map'](_0x3adf14[_0x47a5('0x33')],function(_0x470da6){var _0x943a15={};_0x943a15[_0x470da6]={'$like':'%'+_0xf03bd5[_0x47a5('0x31')][_0x47a5('0x3b')]+'%'};return _0x943a15;})});}_0x3adf14=_['merge']({},_0x3adf14,_0xf03bd5[_0x47a5('0x47')]);var _0x5d1550={'where':_0x3adf14['where']};return db['VoiceQueueReport']['count'](_0x5d1550)[_0x47a5('0x26')](function(_0x6cd4ea){_0x2f66e9[_0x47a5('0x1d')]=_0x6cd4ea;if(_0xf03bd5['query']['includeAll']){_0x3adf14[_0x47a5('0x41')]=[{'all':!![]}];}return db[_0x47a5('0x3f')][_0x47a5('0x42')](_0x3adf14);})[_0x47a5('0x26')](function(_0xc45e25){_0x2f66e9['rows']=_0xc45e25;return _0x2f66e9;})[_0x47a5('0x26')](respondWithFilteredResult(_0x588551,_0x3adf14,'getVoiceQueuesReport'))[_0x47a5('0x44')](handleError(_0x588551,null,_0x47a5('0x4d')));};
\ No newline at end of file
+var _0x7a54=['hasOwnProperty','order','sort','where','pick','filter','merge','type','VIRTUAL','VoiceQueueReport','includeAll','include','findAll','rows','catch','show','keys','options','find','create','body','params','describe','getVoiceQueuesReport','intersection','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./voiceQueueReport.socket','register','sendStatus','end','status','count','offset','limit','set','json','apply','reject','update','destroy','then','error','stack','name','send','index','map','rawAttributes','fieldName','key','model','query','filters','attributes','fields','length'];(function(_0x31a371,_0x50828e){var _0x2a5bd6=function(_0x2fb481){while(--_0x2fb481){_0x31a371['push'](_0x31a371['shift']());}};_0x2a5bd6(++_0x50828e);}(_0x7a54,0x106));var _0x47a5=function(_0x2e1036,_0x4c383b){_0x2e1036=_0x2e1036-0x0;var _0x26a8be=_0x7a54[_0x2e1036];return _0x26a8be;};'use strict';var pdf=require(_0x47a5('0x0'));var emlformat=require(_0x47a5('0x1'));var rimraf=require(_0x47a5('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x47a5('0x3'));var rp=require(_0x47a5('0x4'));var moment=require('moment');var BPromise=require(_0x47a5('0x5'));var Mustache=require(_0x47a5('0x6'));var util=require(_0x47a5('0x7'));var path=require(_0x47a5('0x8'));var sox=require(_0x47a5('0x9'));var csv=require('to-csv');var ejs=require(_0x47a5('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var db=require(_0x47a5('0x14'))['db'];config[_0x47a5('0x15')]=_[_0x47a5('0x16')](config[_0x47a5('0x15')],{'host':'localhost','port':0x18eb});var socket=require(_0x47a5('0x17'))(new Redis(config[_0x47a5('0x15')]));require(_0x47a5('0x18'))[_0x47a5('0x19')](socket);function respondWithStatusCode(_0x139f25,_0x620ee9){_0x620ee9=_0x620ee9||0xcc;return function(_0x3c6c46){if(_0x3c6c46){return _0x139f25[_0x47a5('0x1a')](_0x620ee9);}return _0x139f25['status'](_0x620ee9)[_0x47a5('0x1b')]();};}function respondWithResult(_0x11faf5,_0x3b001e){_0x3b001e=_0x3b001e||0xc8;return function(_0x2a2cbb){if(_0x2a2cbb){return _0x11faf5[_0x47a5('0x1c')](_0x3b001e)['json'](_0x2a2cbb);}};}function respondWithFilteredResult(_0x549de3,_0x138bc0){return function(_0x4b966e){if(_0x4b966e){var _0x5247fd=_0x4b966e[_0x47a5('0x1d')],_0x423a81=_0x138bc0[_0x47a5('0x1e')],_0xaf70a6=_0x138bc0[_0x47a5('0x1e')]+_0x138bc0[_0x47a5('0x1f')],_0x2ce454;if(_0xaf70a6>=_0x5247fd){_0xaf70a6=_0x5247fd;_0x2ce454=0xc8;}else{_0x2ce454=0xce;}_0x549de3[_0x47a5('0x1c')](_0x2ce454);return _0x549de3[_0x47a5('0x20')]('Content-Range',_0x423a81+'-'+_0xaf70a6+'/'+_0x5247fd)[_0x47a5('0x21')](_0x4b966e);}return null;};}function patchUpdates(_0xf160ba){return function(_0x47cf3c){try{jsonpatch[_0x47a5('0x22')](_0x47cf3c,_0xf160ba,!![]);}catch(_0x1f03f7){return BPromise[_0x47a5('0x23')](_0x1f03f7);}return _0x47cf3c['save']();};}function saveUpdates(_0xb8ae6c,_0x2f142b){return function(_0x23db32){if(_0x23db32){return _0x23db32[_0x47a5('0x24')](_0xb8ae6c)['then'](function(_0xe2dea9){return _0xe2dea9;});}return null;};}function removeEntity(_0x385687,_0x513981){return function(_0x28747d){if(_0x28747d){return _0x28747d[_0x47a5('0x25')]()[_0x47a5('0x26')](function(){_0x385687[_0x47a5('0x1c')](0xcc)[_0x47a5('0x1b')]();});}};}function handleEntityNotFound(_0x50bf17,_0x53078a){return function(_0x136745){if(!_0x136745){_0x50bf17['sendStatus'](0x194);}return _0x136745;};}function handleError(_0x1ea9c8,_0x5b6c4e){_0x5b6c4e=_0x5b6c4e||0x1f4;return function(_0x23cb77){logger[_0x47a5('0x27')](_0x23cb77[_0x47a5('0x28')]);if(_0x23cb77[_0x47a5('0x29')]){delete _0x23cb77[_0x47a5('0x29')];}_0x1ea9c8[_0x47a5('0x1c')](_0x5b6c4e)[_0x47a5('0x2a')](_0x23cb77);};}exports[_0x47a5('0x2b')]=function(_0x16631f,_0x361bfa){var _0x1127f8={},_0x11a4fa={},_0x3ad507={'count':0x0,'rows':[]};var _0x528582=_[_0x47a5('0x2c')](db['VoiceQueueReport'][_0x47a5('0x2d')],function(_0x9ac908){return{'name':_0x9ac908[_0x47a5('0x2e')],'type':_0x9ac908['type'][_0x47a5('0x2f')]};});_0x11a4fa[_0x47a5('0x30')]=_[_0x47a5('0x2c')](_0x528582,_0x47a5('0x29'));_0x11a4fa['query']=_['keys'](_0x16631f[_0x47a5('0x31')]);_0x11a4fa[_0x47a5('0x32')]=_['intersection'](_0x11a4fa['model'],_0x11a4fa[_0x47a5('0x31')]);_0x1127f8[_0x47a5('0x33')]=_['intersection'](_0x11a4fa[_0x47a5('0x30')],qs['fields'](_0x16631f[_0x47a5('0x31')][_0x47a5('0x34')]));_0x1127f8['attributes']=_0x1127f8['attributes'][_0x47a5('0x35')]?_0x1127f8['attributes']:_0x11a4fa[_0x47a5('0x30')];if(!_0x16631f[_0x47a5('0x31')][_0x47a5('0x36')]('nolimit')){_0x1127f8[_0x47a5('0x1f')]=qs['limit'](_0x16631f['query'][_0x47a5('0x1f')]);_0x1127f8['offset']=qs[_0x47a5('0x1e')](_0x16631f['query'][_0x47a5('0x1e')]);}_0x1127f8[_0x47a5('0x37')]=qs[_0x47a5('0x38')](_0x16631f[_0x47a5('0x31')][_0x47a5('0x38')]);_0x1127f8[_0x47a5('0x39')]=qs[_0x47a5('0x32')](_[_0x47a5('0x3a')](_0x16631f[_0x47a5('0x31')],_0x11a4fa['filters']),_0x528582);if(_0x16631f[_0x47a5('0x31')][_0x47a5('0x3b')]){_0x1127f8['where']=_[_0x47a5('0x3c')](_0x1127f8[_0x47a5('0x39')],{'$or':_[_0x47a5('0x2c')](_0x528582,function(_0x49c4b5){if(_0x49c4b5[_0x47a5('0x3d')]!==_0x47a5('0x3e')){var _0x596097={};_0x596097[_0x49c4b5[_0x47a5('0x29')]]={'$like':'%'+_0x16631f[_0x47a5('0x31')]['filter']+'%'};return _0x596097;}})});}_0x1127f8=_['merge']({},_0x1127f8,_0x16631f['options']);var _0x12d9f2={'where':_0x1127f8['where']};return db[_0x47a5('0x3f')][_0x47a5('0x1d')](_0x12d9f2)[_0x47a5('0x26')](function(_0x111f0d){_0x3ad507[_0x47a5('0x1d')]=_0x111f0d;if(_0x16631f[_0x47a5('0x31')][_0x47a5('0x40')]){_0x1127f8[_0x47a5('0x41')]=[{'all':!![]}];}return db[_0x47a5('0x3f')][_0x47a5('0x42')](_0x1127f8);})[_0x47a5('0x26')](function(_0x1658e8){_0x3ad507[_0x47a5('0x43')]=_0x1658e8;return _0x3ad507;})['then'](respondWithFilteredResult(_0x361bfa,_0x1127f8))[_0x47a5('0x44')](handleError(_0x361bfa,null));};exports[_0x47a5('0x45')]=function(_0x331474,_0x23bd8d){var _0x586f4f={'raw':![],'where':{'id':_0x331474['params']['id']}},_0x7de536={};_0x7de536['model']=_['keys'](db['VoiceQueueReport'][_0x47a5('0x2d')]);_0x7de536['query']=_[_0x47a5('0x46')](_0x331474[_0x47a5('0x31')]);_0x7de536[_0x47a5('0x32')]=_['intersection'](_0x7de536[_0x47a5('0x30')],_0x7de536[_0x47a5('0x31')]);_0x586f4f['attributes']=_['intersection'](_0x7de536[_0x47a5('0x30')],qs['fields'](_0x331474[_0x47a5('0x31')][_0x47a5('0x34')]));_0x586f4f[_0x47a5('0x33')]=_0x586f4f[_0x47a5('0x33')][_0x47a5('0x35')]?_0x586f4f[_0x47a5('0x33')]:_0x7de536[_0x47a5('0x30')];if(_0x331474[_0x47a5('0x31')][_0x47a5('0x40')]){_0x586f4f[_0x47a5('0x41')]=[{'all':!![]}];}_0x586f4f=_[_0x47a5('0x3c')]({},_0x586f4f,_0x331474[_0x47a5('0x47')]);return db[_0x47a5('0x3f')][_0x47a5('0x48')](_0x586f4f)[_0x47a5('0x26')](handleEntityNotFound(_0x23bd8d,null))[_0x47a5('0x26')](respondWithResult(_0x23bd8d,null))['catch'](handleError(_0x23bd8d,null));};exports[_0x47a5('0x49')]=function(_0x23bb04,_0x49eab1){return db['VoiceQueueReport'][_0x47a5('0x49')](_0x23bb04['body'],{})[_0x47a5('0x26')](respondWithResult(_0x49eab1,0xc9))[_0x47a5('0x44')](handleError(_0x49eab1,null));};exports['update']=function(_0x4f62d3,_0x3d85cc){if(_0x4f62d3['body']['id']){delete _0x4f62d3[_0x47a5('0x4a')]['id'];}return db[_0x47a5('0x3f')][_0x47a5('0x48')]({'where':{'id':_0x4f62d3[_0x47a5('0x4b')]['id']}})[_0x47a5('0x26')](handleEntityNotFound(_0x3d85cc,null))[_0x47a5('0x26')](saveUpdates(_0x4f62d3[_0x47a5('0x4a')],null))['then'](respondWithResult(_0x3d85cc,null))['catch'](handleError(_0x3d85cc,null));};exports[_0x47a5('0x25')]=function(_0x411230,_0x1163e3){return db[_0x47a5('0x3f')][_0x47a5('0x48')]({'where':{'id':_0x411230[_0x47a5('0x4b')]['id']}})[_0x47a5('0x26')](handleEntityNotFound(_0x1163e3,null))['then'](removeEntity(_0x1163e3,null))[_0x47a5('0x44')](handleError(_0x1163e3,null));};exports[_0x47a5('0x4c')]=function(_0x5f6a,_0x5c3c75){return db[_0x47a5('0x3f')]['describe']()[_0x47a5('0x26')](respondWithResult(_0x5c3c75,null))[_0x47a5('0x44')](handleError(_0x5c3c75,null));};exports[_0x47a5('0x4d')]=function(_0xf03bd5,_0x588551){var _0x3adf14={},_0x1e6de3={},_0x2f66e9={'count':0x0,'rows':[]};_0x1e6de3[_0x47a5('0x30')]=_[_0x47a5('0x46')](db[_0x47a5('0x3f')][_0x47a5('0x2d')]);_0x1e6de3['query']=_[_0x47a5('0x46')](_0xf03bd5[_0x47a5('0x31')]);_0x1e6de3[_0x47a5('0x32')]=_[_0x47a5('0x4e')](_0x1e6de3[_0x47a5('0x30')],_0x1e6de3[_0x47a5('0x31')]);_0x3adf14['attributes']=_[_0x47a5('0x4e')](_0x1e6de3[_0x47a5('0x30')],qs[_0x47a5('0x34')](_0xf03bd5['query'][_0x47a5('0x34')]));_0x3adf14[_0x47a5('0x33')]=_0x3adf14[_0x47a5('0x33')]['length']?_0x3adf14['attributes']:_0x1e6de3[_0x47a5('0x30')];if(!_0xf03bd5[_0x47a5('0x31')]['hasOwnProperty']('nolimit')){_0x3adf14[_0x47a5('0x1f')]=qs['limit'](_0xf03bd5[_0x47a5('0x31')]['limit']);_0x3adf14['offset']=qs[_0x47a5('0x1e')](_0xf03bd5[_0x47a5('0x31')]['offset']);}_0x3adf14[_0x47a5('0x37')]=qs[_0x47a5('0x38')](_0xf03bd5['query']['sort']);_0x3adf14[_0x47a5('0x39')]=qs[_0x47a5('0x32')](_[_0x47a5('0x3a')](_0xf03bd5[_0x47a5('0x31')],_0x1e6de3['filters']));if(_0xf03bd5[_0x47a5('0x31')][_0x47a5('0x3b')]){_0x3adf14[_0x47a5('0x39')]=_['merge'](_0x3adf14[_0x47a5('0x39')],{'$or':_['map'](_0x3adf14[_0x47a5('0x33')],function(_0x470da6){var _0x943a15={};_0x943a15[_0x470da6]={'$like':'%'+_0xf03bd5[_0x47a5('0x31')][_0x47a5('0x3b')]+'%'};return _0x943a15;})});}_0x3adf14=_['merge']({},_0x3adf14,_0xf03bd5[_0x47a5('0x47')]);var _0x5d1550={'where':_0x3adf14['where']};return db['VoiceQueueReport']['count'](_0x5d1550)[_0x47a5('0x26')](function(_0x6cd4ea){_0x2f66e9[_0x47a5('0x1d')]=_0x6cd4ea;if(_0xf03bd5['query']['includeAll']){_0x3adf14[_0x47a5('0x41')]=[{'all':!![]}];}return db[_0x47a5('0x3f')][_0x47a5('0x42')](_0x3adf14);})[_0x47a5('0x26')](function(_0xc45e25){_0x2f66e9['rows']=_0xc45e25;return _0x2f66e9;})[_0x47a5('0x26')](respondWithFilteredResult(_0x588551,_0x3adf14,'getVoiceQueuesReport'))[_0x47a5('0x44')](handleError(_0x588551,null,_0x47a5('0x4d')));};
\ No newline at end of file
diff --git a/server/api/voiceQueueReport/voiceQueueReport.events.js b/server/api/voiceQueueReport/voiceQueueReport.events.js
index 7c6f285..699054b 100644
--- a/server/api/voiceQueueReport/voiceQueueReport.events.js
+++ b/server/api/voiceQueueReport/voiceQueueReport.events.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xc85d=['hook','exports','../../mysqldb','setMaxListeners','save','remove','emit','hasOwnProperty'];(function(_0x53e209,_0x1d2dad){var _0x58b7c7=function(_0x2befba){while(--_0x2befba){_0x53e209['push'](_0x53e209['shift']());}};_0x58b7c7(++_0x1d2dad);}(_0xc85d,0x19a));var _0xdc85=function(_0xd0a847,_0x72562b){_0xd0a847=_0xd0a847-0x0;var _0x2536ec=_0xc85d[_0xd0a847];return _0x2536ec;};'use strict';var EventEmitter=require('events');var VoiceQueueReport=require(_0xdc85('0x0'))['db']['VoiceQueueReport'];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents[_0xdc85('0x1')](0x0);var events={'afterCreate':_0xdc85('0x2'),'afterUpdate':'update','afterDestroy':_0xdc85('0x3')};function emitEvent(_0x266ee4){return function(_0x10c61e,_0x24a64a,_0x3a802c){VoiceQueueReportEvents[_0xdc85('0x4')](_0x266ee4+':'+_0x10c61e['id'],_0x10c61e);VoiceQueueReportEvents['emit'](_0x266ee4,_0x10c61e);_0x3a802c(null);};}for(var e in events){if(events[_0xdc85('0x5')](e)){var event=events[e];VoiceQueueReport[_0xdc85('0x6')](e,emitEvent(event));}}module[_0xdc85('0x7')]=VoiceQueueReportEvents;
\ No newline at end of file
+var _0xe626=['hasOwnProperty','hook','exports','events','../../mysqldb','VoiceQueueReport','setMaxListeners','save','remove','emit'];(function(_0x1e16f1,_0x48637f){var _0x1bc4bf=function(_0x5b25ba){while(--_0x5b25ba){_0x1e16f1['push'](_0x1e16f1['shift']());}};_0x1bc4bf(++_0x48637f);}(_0xe626,0x99));var _0x6e62=function(_0x3dae91,_0x80df00){_0x3dae91=_0x3dae91-0x0;var _0x430ac5=_0xe626[_0x3dae91];return _0x430ac5;};'use strict';var EventEmitter=require(_0x6e62('0x0'));var VoiceQueueReport=require(_0x6e62('0x1'))['db'][_0x6e62('0x2')];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents[_0x6e62('0x3')](0x0);var events={'afterCreate':_0x6e62('0x4'),'afterUpdate':'update','afterDestroy':_0x6e62('0x5')};function emitEvent(_0x4e5ff3){return function(_0x553e72,_0x24c3fd,_0x5f1ae3){VoiceQueueReportEvents[_0x6e62('0x6')](_0x4e5ff3+':'+_0x553e72['id'],_0x553e72);VoiceQueueReportEvents['emit'](_0x4e5ff3,_0x553e72);_0x5f1ae3(null);};}for(var e in events){if(events[_0x6e62('0x7')](e)){var event=events[e];VoiceQueueReport[_0x6e62('0x8')](e,emitEvent(event));}}module[_0x6e62('0x9')]=VoiceQueueReportEvents;
\ No newline at end of file
diff --git a/server/api/voiceQueueReport/voiceQueueReport.model.js b/server/api/voiceQueueReport/voiceQueueReport.model.js
index 4e895c2..06ce528 100644
--- a/server/api/voiceQueueReport/voiceQueueReport.model.js
+++ b/server/api/voiceQueueReport/voiceQueueReport.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x69b8=['VoiceQueueReport','calleridnum','lodash','util','api','moment','bluebird','exports'];(function(_0x3cea78,_0x4a6751){var _0x33b66b=function(_0x1f45cd){while(--_0x1f45cd){_0x3cea78['push'](_0x3cea78['shift']());}};_0x33b66b(++_0x4a6751);}(_0x69b8,0x17a));var _0x869b=function(_0x44263c,_0x1df29a){_0x44263c=_0x44263c-0x0;var _0x243629=_0x69b8[_0x44263c];return _0x243629;};'use strict';var _=require(_0x869b('0x0'));var util=require(_0x869b('0x1'));var logger=require('../../config/logger')(_0x869b('0x2'));var moment=require(_0x869b('0x3'));var BPromise=require(_0x869b('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./voiceQueueReport.attributes');module[_0x869b('0x5')]=function(_0x58f528,_0x5e6c36){return _0x58f528['define'](_0x869b('0x6'),attributes,{'tableName':'report_queue','paranoid':![],'indexes':[{'fields':['uniqueid']},{'fields':[_0x869b('0x7')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xe556=['rimraf','./voiceQueueReport.attributes','exports','define','VoiceQueueReport','report_queue','uniqueid','calleridnum','lodash','util','api','bluebird','request-promise','path'];(function(_0x4244bb,_0x12ef95){var _0x318297=function(_0x5eacaf){while(--_0x5eacaf){_0x4244bb['push'](_0x4244bb['shift']());}};_0x318297(++_0x12ef95);}(_0xe556,0x182));var _0x6e55=function(_0x47f883,_0x375f48){_0x47f883=_0x47f883-0x0;var _0x29f7c5=_0xe556[_0x47f883];return _0x29f7c5;};'use strict';var _=require(_0x6e55('0x0'));var util=require(_0x6e55('0x1'));var logger=require('../../config/logger')(_0x6e55('0x2'));var moment=require('moment');var BPromise=require(_0x6e55('0x3'));var rp=require(_0x6e55('0x4'));var fs=require('fs');var path=require(_0x6e55('0x5'));var rimraf=require(_0x6e55('0x6'));var config=require('../../config/environment');var attributes=require(_0x6e55('0x7'));module[_0x6e55('0x8')]=function(_0x15a655,_0x5e4bda){return _0x15a655[_0x6e55('0x9')](_0x6e55('0xa'),attributes,{'tableName':_0x6e55('0xb'),'paranoid':![],'indexes':[{'fields':[_0x6e55('0xc')]},{'fields':[_0x6e55('0xd')]}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/voiceQueueReport/voiceQueueReport.rpc.js b/server/api/voiceQueueReport/voiceQueueReport.rpc.js
index 94142ff..ea40097 100644
--- a/server/api/voiceQueueReport/voiceQueueReport.rpc.js
+++ b/server/api/voiceQueueReport/voiceQueueReport.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7924=['catch','CreateVoiceQueueReport','body','update','limit','UpdateVoiceQueueReport','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','./voiceQueueReport.socket','register','request','info','VoiceQueueReport,\x20%s,\x20%s','debug','VoiceQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','GetVoiceQueueReport','VoiceQueueReport','findAll','options','raw','where','attributes','include','map','model','then'];(function(_0x16eb11,_0x1a2251){var _0x3ae7ef=function(_0x575a01){while(--_0x575a01){_0x16eb11['push'](_0x16eb11['shift']());}};_0x3ae7ef(++_0x1a2251);}(_0x7924,0x90));var _0x4792=function(_0x55ff21,_0x1540f0){_0x55ff21=_0x55ff21-0x0;var _0x4baf37=_0x7924[_0x55ff21];return _0x4baf37;};'use strict';var _=require(_0x4792('0x0'));var util=require(_0x4792('0x1'));var moment=require('moment');var BPromise=require(_0x4792('0x2'));var rs=require(_0x4792('0x3'));var fs=require('fs');var Redis=require(_0x4792('0x4'));var db=require(_0x4792('0x5'))['db'];var utils=require(_0x4792('0x6'));var logger=require(_0x4792('0x7'))(_0x4792('0x8'));var config=require(_0x4792('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x4792('0xa')][_0x4792('0xb')]({'port':0x232a});config[_0x4792('0xc')]=_[_0x4792('0xd')](config[_0x4792('0xc')],{'host':_0x4792('0xe'),'port':0x18eb});var socket=require(_0x4792('0xf'))(new Redis(config[_0x4792('0xc')]));require(_0x4792('0x10'))[_0x4792('0x11')](socket);function respondWithRpcPromise(_0xdefa47,_0x488148,_0x45e371){return new BPromise(function(_0x10b29f,_0x424434){return client[_0x4792('0x12')](_0xdefa47,_0x45e371)['then'](function(_0x4e7aa4){logger[_0x4792('0x13')](_0x4792('0x14'),_0x488148,'request\x20sent');logger[_0x4792('0x15')](_0x4792('0x16'),_0x488148,_0x4792('0x17'),JSON[_0x4792('0x18')](_0x4e7aa4));if(_0x4e7aa4[_0x4792('0x19')]){if(_0x4e7aa4[_0x4792('0x19')][_0x4792('0x1a')]===0x1f4){logger[_0x4792('0x19')](_0x4792('0x14'),_0x488148,_0x4e7aa4[_0x4792('0x19')][_0x4792('0x1b')]);return _0x424434(_0x4e7aa4[_0x4792('0x19')]['message']);}logger[_0x4792('0x19')](_0x4792('0x14'),_0x488148,_0x4e7aa4[_0x4792('0x19')][_0x4792('0x1b')]);return _0x10b29f(_0x4e7aa4[_0x4792('0x19')][_0x4792('0x1b')]);}else{logger['info'](_0x4792('0x14'),_0x488148,_0x4792('0x17'));_0x10b29f(_0x4e7aa4[_0x4792('0x1c')]['message']);}})['catch'](function(_0x208692){logger[_0x4792('0x19')](_0x4792('0x14'),_0x488148,_0x208692);_0x424434(_0x208692);});});}exports[_0x4792('0x1d')]=function(_0x2f1fab){var _0x259a52=this;return new Promise(function(_0x44c596,_0x1ed447){return db[_0x4792('0x1e')][_0x4792('0x1f')]({'raw':_0x2f1fab['options']?_0x2f1fab[_0x4792('0x20')][_0x4792('0x21')]===undefined?!![]:![]:!![],'where':_0x2f1fab[_0x4792('0x20')]?_0x2f1fab[_0x4792('0x20')][_0x4792('0x22')]||null:null,'attributes':_0x2f1fab[_0x4792('0x20')]?_0x2f1fab[_0x4792('0x20')][_0x4792('0x23')]||null:null,'limit':_0x2f1fab['options']?_0x2f1fab[_0x4792('0x20')]['limit']||null:null,'include':_0x2f1fab['options']?_0x2f1fab[_0x4792('0x20')][_0x4792('0x24')]?_['map'](_0x2f1fab[_0x4792('0x20')][_0x4792('0x24')],function(_0x1ee6dd){return{'model':db[_0x1ee6dd['model']],'as':_0x1ee6dd['as'],'attributes':_0x1ee6dd[_0x4792('0x23')],'include':_0x1ee6dd[_0x4792('0x24')]?_[_0x4792('0x25')](_0x1ee6dd[_0x4792('0x24')],function(_0x5c8c67){return{'model':db[_0x5c8c67[_0x4792('0x26')]],'as':_0x5c8c67['as'],'attributes':_0x5c8c67[_0x4792('0x23')],'include':_0x5c8c67[_0x4792('0x24')]?_[_0x4792('0x25')](_0x5c8c67['include'],function(_0x4978e8){return{'model':db[_0x4978e8[_0x4792('0x26')]],'as':_0x4978e8['as'],'attributes':_0x4978e8[_0x4792('0x23')]};}):[]};}):[]};}):[]:[]})[_0x4792('0x27')](function(_0x3880ad){logger[_0x4792('0x13')](_0x4792('0x1d'),_0x2f1fab);logger[_0x4792('0x15')](_0x4792('0x1d'),_0x2f1fab,JSON[_0x4792('0x18')](_0x3880ad));_0x44c596(_0x3880ad);})[_0x4792('0x28')](function(_0x15c245){logger[_0x4792('0x19')]('GetVoiceQueueReport',_0x15c245['message'],_0x2f1fab);_0x1ed447(_0x259a52[_0x4792('0x19')](0x1f4,_0x15c245[_0x4792('0x1b')]));});});};exports[_0x4792('0x29')]=function(_0x3d9445){var _0x3cc5a9=this;return new Promise(function(_0x185d5b,_0x4d52fb){return db[_0x4792('0x1e')]['create'](_0x3d9445[_0x4792('0x2a')],{'raw':_0x3d9445[_0x4792('0x20')]?_0x3d9445['options'][_0x4792('0x21')]===undefined?!![]:![]:!![]})[_0x4792('0x27')](function(_0x1777e3){logger['info'](_0x4792('0x29'),_0x3d9445);logger['debug']('CreateVoiceQueueReport',_0x3d9445,JSON[_0x4792('0x18')](_0x1777e3));_0x185d5b(_0x1777e3);})[_0x4792('0x28')](function(_0x1cd2b5){logger['error'](_0x4792('0x29'),_0x1cd2b5[_0x4792('0x1b')],_0x3d9445);_0x4d52fb(_0x3cc5a9[_0x4792('0x19')](0x1f4,_0x1cd2b5['message']));});});};exports['UpdateVoiceQueueReport']=function(_0x55d3c8){var _0x56810e=this;return new Promise(function(_0x435c22,_0x142636){return db[_0x4792('0x1e')][_0x4792('0x2b')](_0x55d3c8['body'],{'raw':_0x55d3c8[_0x4792('0x20')]?_0x55d3c8[_0x4792('0x20')][_0x4792('0x21')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x55d3c8[_0x4792('0x20')]?_0x55d3c8[_0x4792('0x20')][_0x4792('0x22')]||null:null,'attributes':_0x55d3c8[_0x4792('0x20')]?_0x55d3c8['options']['attributes']||null:null,'limit':_0x55d3c8[_0x4792('0x20')]?_0x55d3c8[_0x4792('0x20')][_0x4792('0x2c')]||null:null})[_0x4792('0x27')](function(_0x44e03b){logger[_0x4792('0x13')](_0x4792('0x2d'),_0x55d3c8);logger[_0x4792('0x15')](_0x4792('0x2d'),_0x55d3c8,JSON[_0x4792('0x18')](_0x44e03b));_0x435c22(_0x44e03b);})[_0x4792('0x28')](function(_0x1f3afe){logger[_0x4792('0x19')](_0x4792('0x2d'),_0x1f3afe[_0x4792('0x1b')],_0x55d3c8);_0x142636(_0x56810e[_0x4792('0x19')](0x1f4,_0x1f3afe['message']));});});};
\ No newline at end of file
+var _0xef05=['debug','VoiceQueueReport,\x20%s,\x20%s,\x20%s','error','code','VoiceQueueReport,\x20%s,\x20%s','message','result','VoiceQueueReport','findAll','options','raw','where','attributes','limit','include','map','model','GetVoiceQueueReport','CreateVoiceQueueReport','create','body','stringify','catch','UpdateVoiceQueueReport','update','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','./voiceQueueReport.socket','register','then','info','request\x20sent'];(function(_0x2e2681,_0x4089c1){var _0x368a64=function(_0x267262){while(--_0x267262){_0x2e2681['push'](_0x2e2681['shift']());}};_0x368a64(++_0x4089c1);}(_0xef05,0x73));var _0x5ef0=function(_0x2f6a80,_0x161a7c){_0x2f6a80=_0x2f6a80-0x0;var _0x2bbe8f=_0xef05[_0x2f6a80];return _0x2bbe8f;};'use strict';var _=require(_0x5ef0('0x0'));var util=require(_0x5ef0('0x1'));var moment=require(_0x5ef0('0x2'));var BPromise=require(_0x5ef0('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5ef0('0x4'))['db'];var utils=require(_0x5ef0('0x5'));var logger=require(_0x5ef0('0x6'))(_0x5ef0('0x7'));var config=require(_0x5ef0('0x8'));var jayson=require(_0x5ef0('0x9'));var client=jayson[_0x5ef0('0xa')][_0x5ef0('0xb')]({'port':0x232a});config[_0x5ef0('0xc')]=_[_0x5ef0('0xd')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x5ef0('0xe'))(new Redis(config['redis']));require(_0x5ef0('0xf'))[_0x5ef0('0x10')](socket);function respondWithRpcPromise(_0x10df47,_0x572fa4,_0x51fb30){return new BPromise(function(_0x10d2c9,_0x255cf3){return client['request'](_0x10df47,_0x51fb30)[_0x5ef0('0x11')](function(_0x16ddd2){logger[_0x5ef0('0x12')]('VoiceQueueReport,\x20%s,\x20%s',_0x572fa4,_0x5ef0('0x13'));logger[_0x5ef0('0x14')](_0x5ef0('0x15'),_0x572fa4,_0x5ef0('0x13'),JSON['stringify'](_0x16ddd2));if(_0x16ddd2['error']){if(_0x16ddd2[_0x5ef0('0x16')][_0x5ef0('0x17')]===0x1f4){logger[_0x5ef0('0x16')](_0x5ef0('0x18'),_0x572fa4,_0x16ddd2['error'][_0x5ef0('0x19')]);return _0x255cf3(_0x16ddd2['error'][_0x5ef0('0x19')]);}logger[_0x5ef0('0x16')]('VoiceQueueReport,\x20%s,\x20%s',_0x572fa4,_0x16ddd2[_0x5ef0('0x16')][_0x5ef0('0x19')]);return _0x10d2c9(_0x16ddd2[_0x5ef0('0x16')][_0x5ef0('0x19')]);}else{logger[_0x5ef0('0x12')](_0x5ef0('0x18'),_0x572fa4,'request\x20sent');_0x10d2c9(_0x16ddd2[_0x5ef0('0x1a')][_0x5ef0('0x19')]);}})['catch'](function(_0x598721){logger[_0x5ef0('0x16')](_0x5ef0('0x18'),_0x572fa4,_0x598721);_0x255cf3(_0x598721);});});}exports['GetVoiceQueueReport']=function(_0x486bdb){var _0x3badb8=this;return new Promise(function(_0x55991d,_0x35d69d){return db[_0x5ef0('0x1b')][_0x5ef0('0x1c')]({'raw':_0x486bdb['options']?_0x486bdb[_0x5ef0('0x1d')][_0x5ef0('0x1e')]===undefined?!![]:![]:!![],'where':_0x486bdb['options']?_0x486bdb[_0x5ef0('0x1d')][_0x5ef0('0x1f')]||null:null,'attributes':_0x486bdb[_0x5ef0('0x1d')]?_0x486bdb[_0x5ef0('0x1d')][_0x5ef0('0x20')]||null:null,'limit':_0x486bdb[_0x5ef0('0x1d')]?_0x486bdb['options'][_0x5ef0('0x21')]||null:null,'include':_0x486bdb[_0x5ef0('0x1d')]?_0x486bdb[_0x5ef0('0x1d')][_0x5ef0('0x22')]?_['map'](_0x486bdb['options']['include'],function(_0x360c32){return{'model':db[_0x360c32['model']],'as':_0x360c32['as'],'attributes':_0x360c32['attributes'],'include':_0x360c32[_0x5ef0('0x22')]?_[_0x5ef0('0x23')](_0x360c32[_0x5ef0('0x22')],function(_0x4cbc0c){return{'model':db[_0x4cbc0c[_0x5ef0('0x24')]],'as':_0x4cbc0c['as'],'attributes':_0x4cbc0c[_0x5ef0('0x20')],'include':_0x4cbc0c[_0x5ef0('0x22')]?_[_0x5ef0('0x23')](_0x4cbc0c[_0x5ef0('0x22')],function(_0x336010){return{'model':db[_0x336010[_0x5ef0('0x24')]],'as':_0x336010['as'],'attributes':_0x336010['attributes']};}):[]};}):[]};}):[]:[]})[_0x5ef0('0x11')](function(_0x388e01){logger[_0x5ef0('0x12')](_0x5ef0('0x25'),_0x486bdb);logger[_0x5ef0('0x14')]('GetVoiceQueueReport',_0x486bdb,JSON['stringify'](_0x388e01));_0x55991d(_0x388e01);})['catch'](function(_0x5cad0b){logger[_0x5ef0('0x16')]('GetVoiceQueueReport',_0x5cad0b[_0x5ef0('0x19')],_0x486bdb);_0x35d69d(_0x3badb8[_0x5ef0('0x16')](0x1f4,_0x5cad0b[_0x5ef0('0x19')]));});});};exports[_0x5ef0('0x26')]=function(_0xcca383){var _0x2c9da8=this;return new Promise(function(_0x2ae440,_0x4d973f){return db[_0x5ef0('0x1b')][_0x5ef0('0x27')](_0xcca383[_0x5ef0('0x28')],{'raw':_0xcca383['options']?_0xcca383[_0x5ef0('0x1d')]['raw']===undefined?!![]:![]:!![]})[_0x5ef0('0x11')](function(_0x570827){logger[_0x5ef0('0x12')]('CreateVoiceQueueReport',_0xcca383);logger[_0x5ef0('0x14')](_0x5ef0('0x26'),_0xcca383,JSON[_0x5ef0('0x29')](_0x570827));_0x2ae440(_0x570827);})[_0x5ef0('0x2a')](function(_0x33d85a){logger[_0x5ef0('0x16')]('CreateVoiceQueueReport',_0x33d85a['message'],_0xcca383);_0x4d973f(_0x2c9da8[_0x5ef0('0x16')](0x1f4,_0x33d85a[_0x5ef0('0x19')]));});});};exports[_0x5ef0('0x2b')]=function(_0xe670b4){var _0x48b1fb=this;return new Promise(function(_0x1e7a7b,_0x5b42fc){return db[_0x5ef0('0x1b')][_0x5ef0('0x2c')](_0xe670b4[_0x5ef0('0x28')],{'raw':_0xe670b4['options']?_0xe670b4[_0x5ef0('0x1d')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xe670b4[_0x5ef0('0x1d')]?_0xe670b4[_0x5ef0('0x1d')][_0x5ef0('0x1f')]||null:null,'attributes':_0xe670b4['options']?_0xe670b4[_0x5ef0('0x1d')]['attributes']||null:null,'limit':_0xe670b4[_0x5ef0('0x1d')]?_0xe670b4[_0x5ef0('0x1d')][_0x5ef0('0x21')]||null:null})['then'](function(_0x49f475){logger[_0x5ef0('0x12')](_0x5ef0('0x2b'),_0xe670b4);logger[_0x5ef0('0x14')](_0x5ef0('0x2b'),_0xe670b4,JSON[_0x5ef0('0x29')](_0x49f475));_0x1e7a7b(_0x49f475);})['catch'](function(_0x123d23){logger[_0x5ef0('0x16')](_0x5ef0('0x2b'),_0x123d23[_0x5ef0('0x19')],_0xe670b4);_0x5b42fc(_0x48b1fb[_0x5ef0('0x16')](0x1f4,_0x123d23[_0x5ef0('0x19')]));});});};
\ No newline at end of file
diff --git a/server/api/voiceQueueReport/voiceQueueReport.socket.js b/server/api/voiceQueueReport/voiceQueueReport.socket.js
index 331fa14..3bb08aa 100644
--- a/server/api/voiceQueueReport/voiceQueueReport.socket.js
+++ b/server/api/voiceQueueReport/voiceQueueReport.socket.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x8461=['register','length','voiceQueueReport:','save','update','emit'];(function(_0xd4636c,_0x34dbf6){var _0x5ee17d=function(_0x223c38){while(--_0x223c38){_0xd4636c['push'](_0xd4636c['shift']());}};_0x5ee17d(++_0x34dbf6);}(_0x8461,0x13b));var _0x1846=function(_0x11136e,_0x413e0a){_0x11136e=_0x11136e-0x0;var _0x5c2ae0=_0x8461[_0x11136e];return _0x5c2ae0;};'use strict';var VoiceQueueReportEvents=require('./voiceQueueReport.events');var events=[_0x1846('0x0'),'remove',_0x1846('0x1')];function createListener(_0x56dc79,_0x54f47f){return function(_0x1a98c2){_0x54f47f[_0x1846('0x2')](_0x56dc79,_0x1a98c2);};}function removeListener(_0x3334ce,_0x325c5f){return function(){VoiceQueueReportEvents['removeListener'](_0x3334ce,_0x325c5f);};}exports[_0x1846('0x3')]=function(_0x51ef00){for(var _0x2f4442=0x0,_0x2bbb52=events[_0x1846('0x4')];_0x2f4442<_0x2bbb52;_0x2f4442++){var _0x290361=events[_0x2f4442];var _0x20c776=createListener(_0x1846('0x5')+_0x290361,_0x51ef00);VoiceQueueReportEvents['on'](_0x290361,_0x20c776);}};
\ No newline at end of file
+var _0xa994=['./voiceQueueReport.events','save','remove','update','emit','removeListener','register','length'];(function(_0x392e28,_0xacb4d3){var _0x14263b=function(_0x2f478a){while(--_0x2f478a){_0x392e28['push'](_0x392e28['shift']());}};_0x14263b(++_0xacb4d3);}(_0xa994,0x140));var _0x4a99=function(_0x42e569,_0xf64d0a){_0x42e569=_0x42e569-0x0;var _0xab8f42=_0xa994[_0x42e569];return _0xab8f42;};'use strict';var VoiceQueueReportEvents=require(_0x4a99('0x0'));var events=[_0x4a99('0x1'),_0x4a99('0x2'),_0x4a99('0x3')];function createListener(_0x18992e,_0x26dacf){return function(_0x37be96){_0x26dacf[_0x4a99('0x4')](_0x18992e,_0x37be96);};}function removeListener(_0x1e9914,_0xfa99ed){return function(){VoiceQueueReportEvents[_0x4a99('0x5')](_0x1e9914,_0xfa99ed);};}exports[_0x4a99('0x6')]=function(_0x5e3237){for(var _0xd3c739=0x0,_0x3d2643=events[_0x4a99('0x7')];_0xd3c739<_0x3d2643;_0xd3c739++){var _0xe477eb=events[_0xd3c739];var _0x567c1d=createListener('voiceQueueReport:'+_0xe477eb,_0x5e3237);VoiceQueueReportEvents['on'](_0xe477eb,_0x567c1d);}};
\ No newline at end of file
diff --git a/server/api/voiceQueuesLog/index.js b/server/api/voiceQueuesLog/index.js
index ccb30c1..3390dba 100644
--- a/server/api/voiceQueuesLog/index.js
+++ b/server/api/voiceQueuesLog/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xd4ba=['isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','multer','util','path','connect-timeout','express','../../components/interaction/service','../../config/environment','./voiceQueuesLog.controller','get'];(function(_0x3e2c31,_0x5ce49e){var _0x4814d9=function(_0x586ac0){while(--_0x586ac0){_0x3e2c31['push'](_0x3e2c31['shift']());}};_0x4814d9(++_0x5ce49e);}(_0xd4ba,0x7c));var _0xad4b=function(_0x177c9f,_0x440050){_0x177c9f=_0x177c9f-0x0;var _0x1ec116=_0xd4ba[_0x177c9f];return _0x1ec116;};'use strict';var multer=require(_0xad4b('0x0'));var util=require(_0xad4b('0x1'));var path=require(_0xad4b('0x2'));var timeout=require(_0xad4b('0x3'));var express=require(_0xad4b('0x4'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0xad4b('0x5'));var config=require(_0xad4b('0x6'));var controller=require(_0xad4b('0x7'));router[_0xad4b('0x8')]('/',auth[_0xad4b('0x9')](),controller[_0xad4b('0xa')]);router[_0xad4b('0x8')](_0xad4b('0xb'),auth['isAuthenticated'](),controller[_0xad4b('0xc')]);router[_0xad4b('0xd')]('/',auth[_0xad4b('0x9')](),controller[_0xad4b('0xe')]);router[_0xad4b('0xf')](_0xad4b('0xb'),auth[_0xad4b('0x9')](),controller[_0xad4b('0x10')]);router[_0xad4b('0x11')]('/:id',auth['isAuthenticated'](),controller[_0xad4b('0x12')]);module['exports']=router;
\ No newline at end of file
+var _0x282f=['../../components/interaction/service','../../config/environment','./voiceQueuesLog.controller','get','isAuthenticated','index','/:id','post','create','put','update','delete','destroy','util','path','connect-timeout','express','Router'];(function(_0x405a25,_0x3c63ad){var _0x47b219=function(_0x43bcbd){while(--_0x43bcbd){_0x405a25['push'](_0x405a25['shift']());}};_0x47b219(++_0x3c63ad);}(_0x282f,0x109));var _0xf282=function(_0x1e98cf,_0x27c66f){_0x1e98cf=_0x1e98cf-0x0;var _0x2ee7b6=_0x282f[_0x1e98cf];return _0x2ee7b6;};'use strict';var multer=require('multer');var util=require(_0xf282('0x0'));var path=require(_0xf282('0x1'));var timeout=require(_0xf282('0x2'));var express=require(_0xf282('0x3'));var router=express[_0xf282('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0xf282('0x5'));var config=require(_0xf282('0x6'));var controller=require(_0xf282('0x7'));router[_0xf282('0x8')]('/',auth[_0xf282('0x9')](),controller[_0xf282('0xa')]);router[_0xf282('0x8')](_0xf282('0xb'),auth[_0xf282('0x9')](),controller['show']);router[_0xf282('0xc')]('/',auth[_0xf282('0x9')](),controller[_0xf282('0xd')]);router[_0xf282('0xe')](_0xf282('0xb'),auth['isAuthenticated'](),controller[_0xf282('0xf')]);router[_0xf282('0x10')](_0xf282('0xb'),auth[_0xf282('0x9')](),controller[_0xf282('0x11')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.attributes.js b/server/api/voiceQueuesLog/voiceQueuesLog.attributes.js
index a193840..642be31 100644
--- a/server/api/voiceQueuesLog/voiceQueuesLog.attributes.js
+++ b/server/api/voiceQueuesLog/voiceQueuesLog.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xf2b4=['exports','STRING','format','moment'];(function(_0x3c87f0,_0x2181d8){var _0x5213bb=function(_0x1870b6){while(--_0x1870b6){_0x3c87f0['push'](_0x3c87f0['shift']());}};_0x5213bb(++_0x2181d8);}(_0xf2b4,0x19f));var _0x4f2b=function(_0x5d81e0,_0x152a1b){_0x5d81e0=_0x5d81e0-0x0;var _0x2cd7fe=_0xf2b4[_0x5d81e0];return _0x2cd7fe;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x4f2b('0x0'));module[_0x4f2b('0x1')]={'time':{'type':Sequelize['STRING']},'callid':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize[_0x4f2b('0x2')],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize[_0x4f2b('0x2')],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize[_0x4f2b('0x2')],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize[_0x4f2b('0x2')],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize[_0x4f2b('0x2')],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize[_0x4f2b('0x2')],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize[_0x4f2b('0x2')],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize[_0x4f2b('0x2')],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize[_0x4f2b('0x2')],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':moment()[_0x4f2b('0x3')]('YYYY-MM-DD\x20HH:mm:ss')}};
\ No newline at end of file
+var _0xeab9=['STRING','DATE','moment','exports'];(function(_0x5d6456,_0x58ecc7){var _0x4d66c1=function(_0x4335e3){while(--_0x4335e3){_0x5d6456['push'](_0x5d6456['shift']());}};_0x4d66c1(++_0x58ecc7);}(_0xeab9,0x7e));var _0x9eab=function(_0x40c7cd,_0x8828d){_0x40c7cd=_0x40c7cd-0x0;var _0x2254b4=_0xeab9[_0x40c7cd];return _0x2254b4;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x9eab('0x0'));module[_0x9eab('0x1')]={'time':{'type':Sequelize[_0x9eab('0x2')]},'callid':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize[_0x9eab('0x2')],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize[_0x9eab('0x2')],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize[_0x9eab('0x2')],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize[_0x9eab('0x2')],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize[_0x9eab('0x2')],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize[_0x9eab('0x2')],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize[_0x9eab('0x3')],'allowNull':![],'defaultValue':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')}};
\ No newline at end of file
diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.controller.js b/server/api/voiceQueuesLog/voiceQueuesLog.controller.js
index 0043146..96deebf 100644
--- a/server/api/voiceQueuesLog/voiceQueuesLog.controller.js
+++ b/server/api/voiceQueuesLog/voiceQueuesLog.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xa9e0=['sort','where','pick','filter','VIRTUAL','merge','options','include','findAll','catch','params','includeAll','create','body','find','html-pdf','eml-format','rimraf','request-promise','bluebird','mustache','util','path','sox','ejs','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../mysqldb','sendStatus','status','json','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','end','error','name','send','index','map','VoiceQueuesLog','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','limit'];(function(_0x1e39d2,_0x43887d){var _0x1f7369=function(_0xb8ff01){while(--_0xb8ff01){_0x1e39d2['push'](_0x1e39d2['shift']());}};_0x1f7369(++_0x43887d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4dbaad,_0x730318){_0x4dbaad=_0x4dbaad-0x0;var _0x226c72=_0xa9e0[_0x4dbaad];return _0x226c72;};'use strict';var pdf=require(_0x0a9e('0x0'));var emlformat=require(_0x0a9e('0x1'));var rimraf=require(_0x0a9e('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0a9e('0x3'));var moment=require('moment');var BPromise=require(_0x0a9e('0x4'));var Mustache=require(_0x0a9e('0x5'));var util=require(_0x0a9e('0x6'));var path=require(_0x0a9e('0x7'));var sox=require(_0x0a9e('0x8'));var csv=require('to-csv');var ejs=require(_0x0a9e('0x9'));var fs=require('fs');var _=require(_0x0a9e('0xa'));var squel=require(_0x0a9e('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0a9e('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0a9e('0xd'));var Redis=require(_0x0a9e('0xe'));var authService=require(_0x0a9e('0xf'));var qs=require(_0x0a9e('0x10'));var as=require(_0x0a9e('0x11'));var hardwareService=require(_0x0a9e('0x12'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x0a9e('0x13'))['db'];function respondWithStatusCode(_0x36471c,_0xd5b662){_0xd5b662=_0xd5b662||0xcc;return function(_0x26d672){if(_0x26d672){return _0x36471c[_0x0a9e('0x14')](_0xd5b662);}return _0x36471c[_0x0a9e('0x15')](_0xd5b662)['end']();};}function respondWithResult(_0x4283ce,_0x239b12){_0x239b12=_0x239b12||0xc8;return function(_0x2b4227){if(_0x2b4227){return _0x4283ce[_0x0a9e('0x15')](_0x239b12)[_0x0a9e('0x16')](_0x2b4227);}};}function respondWithFilteredResult(_0x4d5611,_0x52a03d){return function(_0x22dccb){if(_0x22dccb){var _0x5d0880=_0x22dccb[_0x0a9e('0x17')],_0x1985b6=_0x52a03d['offset'],_0x519dfd=_0x52a03d[_0x0a9e('0x18')]+_0x52a03d['limit'],_0x16033c;if(_0x519dfd>=_0x5d0880){_0x519dfd=_0x5d0880;_0x16033c=0xc8;}else{_0x16033c=0xce;}_0x4d5611[_0x0a9e('0x15')](_0x16033c);return _0x4d5611[_0x0a9e('0x19')](_0x0a9e('0x1a'),_0x1985b6+'-'+_0x519dfd+'/'+_0x5d0880)[_0x0a9e('0x16')](_0x22dccb);}return null;};}function patchUpdates(_0x31b1ca){return function(_0x2eb11f){try{jsonpatch[_0x0a9e('0x1b')](_0x2eb11f,_0x31b1ca,!![]);}catch(_0x20559e){return BPromise[_0x0a9e('0x1c')](_0x20559e);}return _0x2eb11f[_0x0a9e('0x1d')]();};}function saveUpdates(_0x1c696a,_0x105080){return function(_0x4bb1e3){if(_0x4bb1e3){return _0x4bb1e3[_0x0a9e('0x1e')](_0x1c696a)[_0x0a9e('0x1f')](function(_0x53682f){return _0x53682f;});}return null;};}function removeEntity(_0x20f109,_0x5a09ef){return function(_0x588269){if(_0x588269){return _0x588269[_0x0a9e('0x20')]()[_0x0a9e('0x1f')](function(){_0x20f109[_0x0a9e('0x15')](0xcc)[_0x0a9e('0x21')]();});}};}function handleEntityNotFound(_0x4abc77,_0xfb6e48){return function(_0x2fb0e4){if(!_0x2fb0e4){_0x4abc77[_0x0a9e('0x14')](0x194);}return _0x2fb0e4;};}function handleError(_0x4d00e6,_0x370d86){_0x370d86=_0x370d86||0x1f4;return function(_0x42ac8f){logger[_0x0a9e('0x22')](_0x42ac8f['stack']);if(_0x42ac8f['name']){delete _0x42ac8f[_0x0a9e('0x23')];}_0x4d00e6[_0x0a9e('0x15')](_0x370d86)[_0x0a9e('0x24')](_0x42ac8f);};}exports[_0x0a9e('0x25')]=function(_0x526cf3,_0x384319){var _0x479bc4={},_0x45a1e7={},_0x5bfb33={'count':0x0,'rows':[]};var _0x1dc186=_[_0x0a9e('0x26')](db[_0x0a9e('0x27')][_0x0a9e('0x28')],function(_0x140511){return{'name':_0x140511[_0x0a9e('0x29')],'type':_0x140511[_0x0a9e('0x2a')][_0x0a9e('0x2b')]};});_0x45a1e7['model']=_[_0x0a9e('0x26')](_0x1dc186,_0x0a9e('0x23'));_0x45a1e7[_0x0a9e('0x2c')]=_[_0x0a9e('0x2d')](_0x526cf3['query']);_0x45a1e7[_0x0a9e('0x2e')]=_[_0x0a9e('0x2f')](_0x45a1e7[_0x0a9e('0x30')],_0x45a1e7[_0x0a9e('0x2c')]);_0x479bc4[_0x0a9e('0x31')]=_[_0x0a9e('0x2f')](_0x45a1e7[_0x0a9e('0x30')],qs[_0x0a9e('0x32')](_0x526cf3[_0x0a9e('0x2c')]['fields']));_0x479bc4[_0x0a9e('0x31')]=_0x479bc4['attributes'][_0x0a9e('0x33')]?_0x479bc4[_0x0a9e('0x31')]:_0x45a1e7[_0x0a9e('0x30')];if(!_0x526cf3[_0x0a9e('0x2c')][_0x0a9e('0x34')]('nolimit')){_0x479bc4[_0x0a9e('0x35')]=qs[_0x0a9e('0x35')](_0x526cf3[_0x0a9e('0x2c')][_0x0a9e('0x35')]);_0x479bc4[_0x0a9e('0x18')]=qs[_0x0a9e('0x18')](_0x526cf3[_0x0a9e('0x2c')][_0x0a9e('0x18')]);}_0x479bc4['order']=qs[_0x0a9e('0x36')](_0x526cf3['query'][_0x0a9e('0x36')]);_0x479bc4[_0x0a9e('0x37')]=qs[_0x0a9e('0x2e')](_[_0x0a9e('0x38')](_0x526cf3['query'],_0x45a1e7[_0x0a9e('0x2e')]),_0x1dc186);if(_0x526cf3[_0x0a9e('0x2c')][_0x0a9e('0x39')]){_0x479bc4[_0x0a9e('0x37')]=_['merge'](_0x479bc4['where'],{'$or':_[_0x0a9e('0x26')](_0x1dc186,function(_0x5640eb){if(_0x5640eb[_0x0a9e('0x2a')]!==_0x0a9e('0x3a')){var _0x381c37={};_0x381c37[_0x5640eb[_0x0a9e('0x23')]]={'$like':'%'+_0x526cf3['query'][_0x0a9e('0x39')]+'%'};return _0x381c37;}})});}_0x479bc4=_[_0x0a9e('0x3b')]({},_0x479bc4,_0x526cf3[_0x0a9e('0x3c')]);var _0x533942={'where':_0x479bc4[_0x0a9e('0x37')]};return db[_0x0a9e('0x27')][_0x0a9e('0x17')](_0x533942)['then'](function(_0x546ef8){_0x5bfb33[_0x0a9e('0x17')]=_0x546ef8;if(_0x526cf3[_0x0a9e('0x2c')]['includeAll']){_0x479bc4[_0x0a9e('0x3d')]=[{'all':!![]}];}return db[_0x0a9e('0x27')][_0x0a9e('0x3e')](_0x479bc4);})[_0x0a9e('0x1f')](function(_0x4b38d9){_0x5bfb33['rows']=_0x4b38d9;return _0x5bfb33;})[_0x0a9e('0x1f')](respondWithFilteredResult(_0x384319,_0x479bc4))[_0x0a9e('0x3f')](handleError(_0x384319,null));};exports['show']=function(_0x183991,_0x1dec2e){var _0x1459bb={'raw':!![],'where':{'id':_0x183991[_0x0a9e('0x40')]['id']}},_0x5b4f5e={};_0x5b4f5e[_0x0a9e('0x30')]=_[_0x0a9e('0x2d')](db[_0x0a9e('0x27')][_0x0a9e('0x28')]);_0x5b4f5e[_0x0a9e('0x2c')]=_[_0x0a9e('0x2d')](_0x183991[_0x0a9e('0x2c')]);_0x5b4f5e[_0x0a9e('0x2e')]=_[_0x0a9e('0x2f')](_0x5b4f5e[_0x0a9e('0x30')],_0x5b4f5e[_0x0a9e('0x2c')]);_0x1459bb[_0x0a9e('0x31')]=_[_0x0a9e('0x2f')](_0x5b4f5e[_0x0a9e('0x30')],qs['fields'](_0x183991['query'][_0x0a9e('0x32')]));_0x1459bb[_0x0a9e('0x31')]=_0x1459bb[_0x0a9e('0x31')][_0x0a9e('0x33')]?_0x1459bb[_0x0a9e('0x31')]:_0x5b4f5e[_0x0a9e('0x30')];if(_0x183991[_0x0a9e('0x2c')][_0x0a9e('0x41')]){_0x1459bb[_0x0a9e('0x3d')]=[{'all':!![]}];}_0x1459bb=_[_0x0a9e('0x3b')]({},_0x1459bb,_0x183991[_0x0a9e('0x3c')]);return db[_0x0a9e('0x27')]['find'](_0x1459bb)[_0x0a9e('0x1f')](handleEntityNotFound(_0x1dec2e,null))[_0x0a9e('0x1f')](respondWithResult(_0x1dec2e,null))[_0x0a9e('0x3f')](handleError(_0x1dec2e,null));};exports[_0x0a9e('0x42')]=function(_0x2e8caf,_0xbe9d19){return db[_0x0a9e('0x27')][_0x0a9e('0x42')](_0x2e8caf['body'],{})[_0x0a9e('0x1f')](respondWithResult(_0xbe9d19,0xc9))['catch'](handleError(_0xbe9d19,null));};exports[_0x0a9e('0x1e')]=function(_0x476688,_0x8d6dd1){if(_0x476688['body']['id']){delete _0x476688[_0x0a9e('0x43')]['id'];}return db[_0x0a9e('0x27')][_0x0a9e('0x44')]({'where':{'id':_0x476688[_0x0a9e('0x40')]['id']}})[_0x0a9e('0x1f')](handleEntityNotFound(_0x8d6dd1,null))[_0x0a9e('0x1f')](saveUpdates(_0x476688[_0x0a9e('0x43')],null))['then'](respondWithResult(_0x8d6dd1,null))[_0x0a9e('0x3f')](handleError(_0x8d6dd1,null));};exports[_0x0a9e('0x20')]=function(_0x1b5e80,_0x16f976){return db[_0x0a9e('0x27')][_0x0a9e('0x44')]({'where':{'id':_0x1b5e80[_0x0a9e('0x40')]['id']}})[_0x0a9e('0x1f')](handleEntityNotFound(_0x16f976,null))[_0x0a9e('0x1f')](removeEntity(_0x16f976,null))['catch'](handleError(_0x16f976,null));};
\ No newline at end of file
+var _0xa9e0=['sort','where','pick','filter','VIRTUAL','merge','options','include','findAll','catch','params','includeAll','create','body','find','html-pdf','eml-format','rimraf','request-promise','bluebird','mustache','util','path','sox','ejs','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../mysqldb','sendStatus','status','json','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','end','error','name','send','index','map','VoiceQueuesLog','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','limit'];(function(_0x4a1cf7,_0x4ee506){var _0x17caad=function(_0x3586d2){while(--_0x3586d2){_0x4a1cf7['push'](_0x4a1cf7['shift']());}};_0x17caad(++_0x4ee506);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0xa9e0[_0x5ddb1c];return _0x354adc;};'use strict';var pdf=require(_0x0a9e('0x0'));var emlformat=require(_0x0a9e('0x1'));var rimraf=require(_0x0a9e('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0a9e('0x3'));var moment=require('moment');var BPromise=require(_0x0a9e('0x4'));var Mustache=require(_0x0a9e('0x5'));var util=require(_0x0a9e('0x6'));var path=require(_0x0a9e('0x7'));var sox=require(_0x0a9e('0x8'));var csv=require('to-csv');var ejs=require(_0x0a9e('0x9'));var fs=require('fs');var _=require(_0x0a9e('0xa'));var squel=require(_0x0a9e('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0a9e('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0a9e('0xd'));var Redis=require(_0x0a9e('0xe'));var authService=require(_0x0a9e('0xf'));var qs=require(_0x0a9e('0x10'));var as=require(_0x0a9e('0x11'));var hardwareService=require(_0x0a9e('0x12'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x0a9e('0x13'))['db'];function respondWithStatusCode(_0x36471c,_0xd5b662){_0xd5b662=_0xd5b662||0xcc;return function(_0x26d672){if(_0x26d672){return _0x36471c[_0x0a9e('0x14')](_0xd5b662);}return _0x36471c[_0x0a9e('0x15')](_0xd5b662)['end']();};}function respondWithResult(_0x4283ce,_0x239b12){_0x239b12=_0x239b12||0xc8;return function(_0x2b4227){if(_0x2b4227){return _0x4283ce[_0x0a9e('0x15')](_0x239b12)[_0x0a9e('0x16')](_0x2b4227);}};}function respondWithFilteredResult(_0x4d5611,_0x52a03d){return function(_0x22dccb){if(_0x22dccb){var _0x5d0880=_0x22dccb[_0x0a9e('0x17')],_0x1985b6=_0x52a03d['offset'],_0x519dfd=_0x52a03d[_0x0a9e('0x18')]+_0x52a03d['limit'],_0x16033c;if(_0x519dfd>=_0x5d0880){_0x519dfd=_0x5d0880;_0x16033c=0xc8;}else{_0x16033c=0xce;}_0x4d5611[_0x0a9e('0x15')](_0x16033c);return _0x4d5611[_0x0a9e('0x19')](_0x0a9e('0x1a'),_0x1985b6+'-'+_0x519dfd+'/'+_0x5d0880)[_0x0a9e('0x16')](_0x22dccb);}return null;};}function patchUpdates(_0x31b1ca){return function(_0x2eb11f){try{jsonpatch[_0x0a9e('0x1b')](_0x2eb11f,_0x31b1ca,!![]);}catch(_0x20559e){return BPromise[_0x0a9e('0x1c')](_0x20559e);}return _0x2eb11f[_0x0a9e('0x1d')]();};}function saveUpdates(_0x1c696a,_0x105080){return function(_0x4bb1e3){if(_0x4bb1e3){return _0x4bb1e3[_0x0a9e('0x1e')](_0x1c696a)[_0x0a9e('0x1f')](function(_0x53682f){return _0x53682f;});}return null;};}function removeEntity(_0x20f109,_0x5a09ef){return function(_0x588269){if(_0x588269){return _0x588269[_0x0a9e('0x20')]()[_0x0a9e('0x1f')](function(){_0x20f109[_0x0a9e('0x15')](0xcc)[_0x0a9e('0x21')]();});}};}function handleEntityNotFound(_0x4abc77,_0xfb6e48){return function(_0x2fb0e4){if(!_0x2fb0e4){_0x4abc77[_0x0a9e('0x14')](0x194);}return _0x2fb0e4;};}function handleError(_0x4d00e6,_0x370d86){_0x370d86=_0x370d86||0x1f4;return function(_0x42ac8f){logger[_0x0a9e('0x22')](_0x42ac8f['stack']);if(_0x42ac8f['name']){delete _0x42ac8f[_0x0a9e('0x23')];}_0x4d00e6[_0x0a9e('0x15')](_0x370d86)[_0x0a9e('0x24')](_0x42ac8f);};}exports[_0x0a9e('0x25')]=function(_0x526cf3,_0x384319){var _0x479bc4={},_0x45a1e7={},_0x5bfb33={'count':0x0,'rows':[]};var _0x1dc186=_[_0x0a9e('0x26')](db[_0x0a9e('0x27')][_0x0a9e('0x28')],function(_0x140511){return{'name':_0x140511[_0x0a9e('0x29')],'type':_0x140511[_0x0a9e('0x2a')][_0x0a9e('0x2b')]};});_0x45a1e7['model']=_[_0x0a9e('0x26')](_0x1dc186,_0x0a9e('0x23'));_0x45a1e7[_0x0a9e('0x2c')]=_[_0x0a9e('0x2d')](_0x526cf3['query']);_0x45a1e7[_0x0a9e('0x2e')]=_[_0x0a9e('0x2f')](_0x45a1e7[_0x0a9e('0x30')],_0x45a1e7[_0x0a9e('0x2c')]);_0x479bc4[_0x0a9e('0x31')]=_[_0x0a9e('0x2f')](_0x45a1e7[_0x0a9e('0x30')],qs[_0x0a9e('0x32')](_0x526cf3[_0x0a9e('0x2c')]['fields']));_0x479bc4[_0x0a9e('0x31')]=_0x479bc4['attributes'][_0x0a9e('0x33')]?_0x479bc4[_0x0a9e('0x31')]:_0x45a1e7[_0x0a9e('0x30')];if(!_0x526cf3[_0x0a9e('0x2c')][_0x0a9e('0x34')]('nolimit')){_0x479bc4[_0x0a9e('0x35')]=qs[_0x0a9e('0x35')](_0x526cf3[_0x0a9e('0x2c')][_0x0a9e('0x35')]);_0x479bc4[_0x0a9e('0x18')]=qs[_0x0a9e('0x18')](_0x526cf3[_0x0a9e('0x2c')][_0x0a9e('0x18')]);}_0x479bc4['order']=qs[_0x0a9e('0x36')](_0x526cf3['query'][_0x0a9e('0x36')]);_0x479bc4[_0x0a9e('0x37')]=qs[_0x0a9e('0x2e')](_[_0x0a9e('0x38')](_0x526cf3['query'],_0x45a1e7[_0x0a9e('0x2e')]),_0x1dc186);if(_0x526cf3[_0x0a9e('0x2c')][_0x0a9e('0x39')]){_0x479bc4[_0x0a9e('0x37')]=_['merge'](_0x479bc4['where'],{'$or':_[_0x0a9e('0x26')](_0x1dc186,function(_0x5640eb){if(_0x5640eb[_0x0a9e('0x2a')]!==_0x0a9e('0x3a')){var _0x381c37={};_0x381c37[_0x5640eb[_0x0a9e('0x23')]]={'$like':'%'+_0x526cf3['query'][_0x0a9e('0x39')]+'%'};return _0x381c37;}})});}_0x479bc4=_[_0x0a9e('0x3b')]({},_0x479bc4,_0x526cf3[_0x0a9e('0x3c')]);var _0x533942={'where':_0x479bc4[_0x0a9e('0x37')]};return db[_0x0a9e('0x27')][_0x0a9e('0x17')](_0x533942)['then'](function(_0x546ef8){_0x5bfb33[_0x0a9e('0x17')]=_0x546ef8;if(_0x526cf3[_0x0a9e('0x2c')]['includeAll']){_0x479bc4[_0x0a9e('0x3d')]=[{'all':!![]}];}return db[_0x0a9e('0x27')][_0x0a9e('0x3e')](_0x479bc4);})[_0x0a9e('0x1f')](function(_0x4b38d9){_0x5bfb33['rows']=_0x4b38d9;return _0x5bfb33;})[_0x0a9e('0x1f')](respondWithFilteredResult(_0x384319,_0x479bc4))[_0x0a9e('0x3f')](handleError(_0x384319,null));};exports['show']=function(_0x183991,_0x1dec2e){var _0x1459bb={'raw':!![],'where':{'id':_0x183991[_0x0a9e('0x40')]['id']}},_0x5b4f5e={};_0x5b4f5e[_0x0a9e('0x30')]=_[_0x0a9e('0x2d')](db[_0x0a9e('0x27')][_0x0a9e('0x28')]);_0x5b4f5e[_0x0a9e('0x2c')]=_[_0x0a9e('0x2d')](_0x183991[_0x0a9e('0x2c')]);_0x5b4f5e[_0x0a9e('0x2e')]=_[_0x0a9e('0x2f')](_0x5b4f5e[_0x0a9e('0x30')],_0x5b4f5e[_0x0a9e('0x2c')]);_0x1459bb[_0x0a9e('0x31')]=_[_0x0a9e('0x2f')](_0x5b4f5e[_0x0a9e('0x30')],qs['fields'](_0x183991['query'][_0x0a9e('0x32')]));_0x1459bb[_0x0a9e('0x31')]=_0x1459bb[_0x0a9e('0x31')][_0x0a9e('0x33')]?_0x1459bb[_0x0a9e('0x31')]:_0x5b4f5e[_0x0a9e('0x30')];if(_0x183991[_0x0a9e('0x2c')][_0x0a9e('0x41')]){_0x1459bb[_0x0a9e('0x3d')]=[{'all':!![]}];}_0x1459bb=_[_0x0a9e('0x3b')]({},_0x1459bb,_0x183991[_0x0a9e('0x3c')]);return db[_0x0a9e('0x27')]['find'](_0x1459bb)[_0x0a9e('0x1f')](handleEntityNotFound(_0x1dec2e,null))[_0x0a9e('0x1f')](respondWithResult(_0x1dec2e,null))[_0x0a9e('0x3f')](handleError(_0x1dec2e,null));};exports[_0x0a9e('0x42')]=function(_0x2e8caf,_0xbe9d19){return db[_0x0a9e('0x27')][_0x0a9e('0x42')](_0x2e8caf['body'],{})[_0x0a9e('0x1f')](respondWithResult(_0xbe9d19,0xc9))['catch'](handleError(_0xbe9d19,null));};exports[_0x0a9e('0x1e')]=function(_0x476688,_0x8d6dd1){if(_0x476688['body']['id']){delete _0x476688[_0x0a9e('0x43')]['id'];}return db[_0x0a9e('0x27')][_0x0a9e('0x44')]({'where':{'id':_0x476688[_0x0a9e('0x40')]['id']}})[_0x0a9e('0x1f')](handleEntityNotFound(_0x8d6dd1,null))[_0x0a9e('0x1f')](saveUpdates(_0x476688[_0x0a9e('0x43')],null))['then'](respondWithResult(_0x8d6dd1,null))[_0x0a9e('0x3f')](handleError(_0x8d6dd1,null));};exports[_0x0a9e('0x20')]=function(_0x1b5e80,_0x16f976){return db[_0x0a9e('0x27')][_0x0a9e('0x44')]({'where':{'id':_0x1b5e80[_0x0a9e('0x40')]['id']}})[_0x0a9e('0x1f')](handleEntityNotFound(_0x16f976,null))[_0x0a9e('0x1f')](removeEntity(_0x16f976,null))['catch'](handleError(_0x16f976,null));};
\ No newline at end of file
diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.model.js b/server/api/voiceQueuesLog/voiceQueuesLog.model.js
index 6a15804..c23d235 100644
--- a/server/api/voiceQueuesLog/voiceQueuesLog.model.js
+++ b/server/api/voiceQueuesLog/voiceQueuesLog.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x277c=['dtm','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','define','voice_queues_log','event_dtm'];(function(_0x5e980d,_0x316987){var _0x347477=function(_0x5566a8){while(--_0x5566a8){_0x5e980d['push'](_0x5e980d['shift']());}};_0x347477(++_0x316987);}(_0x277c,0x153));var _0xc277=function(_0x192900,_0x368955){_0x192900=_0x192900-0x0;var _0x4db314=_0x277c[_0x192900];return _0x4db314;};'use strict';var _=require(_0xc277('0x0'));var util=require('util');var logger=require(_0xc277('0x1'))(_0xc277('0x2'));var moment=require(_0xc277('0x3'));var BPromise=require(_0xc277('0x4'));var rp=require(_0xc277('0x5'));var fs=require('fs');var path=require(_0xc277('0x6'));var rimraf=require(_0xc277('0x7'));var config=require(_0xc277('0x8'));var attributes=require('./voiceQueuesLog.attributes');module['exports']=function(_0x1a6582,_0x5a4f03){return _0x1a6582[_0xc277('0x9')]('VoiceQueuesLog',attributes,{'tableName':_0xc277('0xa'),'paranoid':![],'indexes':[{'name':_0xc277('0xb'),'fields':['event',_0xc277('0xc')]}],'timestamps':![]});};
\ No newline at end of file
+var _0xfb65=['VoiceQueuesLog','voice_queues_log','event_dtm','dtm','util','../../config/logger','moment','request-promise','path','rimraf','../../config/environment','./voiceQueuesLog.attributes','exports','define'];(function(_0x41092c,_0x233b3f){var _0xc2384b=function(_0x168664){while(--_0x168664){_0x41092c['push'](_0x41092c['shift']());}};_0xc2384b(++_0x233b3f);}(_0xfb65,0x82));var _0x5fb6=function(_0x5490db,_0x1282d6){_0x5490db=_0x5490db-0x0;var _0x4fc50b=_0xfb65[_0x5490db];return _0x4fc50b;};'use strict';var _=require('lodash');var util=require(_0x5fb6('0x0'));var logger=require(_0x5fb6('0x1'))('api');var moment=require(_0x5fb6('0x2'));var BPromise=require('bluebird');var rp=require(_0x5fb6('0x3'));var fs=require('fs');var path=require(_0x5fb6('0x4'));var rimraf=require(_0x5fb6('0x5'));var config=require(_0x5fb6('0x6'));var attributes=require(_0x5fb6('0x7'));module[_0x5fb6('0x8')]=function(_0x4dec8f,_0x50782b){return _0x4dec8f[_0x5fb6('0x9')](_0x5fb6('0xa'),attributes,{'tableName':_0x5fb6('0xb'),'paranoid':![],'indexes':[{'name':_0x5fb6('0xc'),'fields':['event',_0x5fb6('0xd')]}],'timestamps':![]});};
\ No newline at end of file
diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.rpc.js b/server/api/voiceQueuesLog/voiceQueuesLog.rpc.js
index e5b9434..30ea41d 100644
--- a/server/api/voiceQueuesLog/voiceQueuesLog.rpc.js
+++ b/server/api/voiceQueuesLog/voiceQueuesLog.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x5eb1=['../../config/environment','jayson/promise','http','request','then','info','VoiceQueuesLog,\x20%s,\x20%s','request\x20sent','debug','VoiceQueuesLog,\x20%s,\x20%s,\x20%s','stringify','error','message','result','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc'];(function(_0xe73080,_0x24c56d){var _0x12cbc4=function(_0x1377e2){while(--_0x1377e2){_0xe73080['push'](_0xe73080['shift']());}};_0x12cbc4(++_0x24c56d);}(_0x5eb1,0x7c));var _0x15eb=function(_0x46d0c9,_0x526bfa){_0x46d0c9=_0x46d0c9-0x0;var _0x174506=_0x5eb1[_0x46d0c9];return _0x174506;};'use strict';var _=require('lodash');var util=require(_0x15eb('0x0'));var moment=require(_0x15eb('0x1'));var BPromise=require(_0x15eb('0x2'));var rs=require(_0x15eb('0x3'));var fs=require('fs');var Redis=require(_0x15eb('0x4'));var db=require(_0x15eb('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x15eb('0x6'))(_0x15eb('0x7'));var config=require(_0x15eb('0x8'));var jayson=require(_0x15eb('0x9'));var client=jayson['client'][_0x15eb('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x212692,_0x594f54,_0xe4d8ce){return new BPromise(function(_0x160879,_0x730b12){return client[_0x15eb('0xb')](_0x212692,_0xe4d8ce)[_0x15eb('0xc')](function(_0x2ad2c1){logger[_0x15eb('0xd')](_0x15eb('0xe'),_0x594f54,_0x15eb('0xf'));logger[_0x15eb('0x10')](_0x15eb('0x11'),_0x594f54,_0x15eb('0xf'),JSON[_0x15eb('0x12')](_0x2ad2c1));if(_0x2ad2c1['error']){if(_0x2ad2c1[_0x15eb('0x13')]['code']===0x1f4){logger['error']('VoiceQueuesLog,\x20%s,\x20%s',_0x594f54,_0x2ad2c1[_0x15eb('0x13')][_0x15eb('0x14')]);return _0x730b12(_0x2ad2c1[_0x15eb('0x13')][_0x15eb('0x14')]);}logger['error'](_0x15eb('0xe'),_0x594f54,_0x2ad2c1[_0x15eb('0x13')][_0x15eb('0x14')]);return _0x160879(_0x2ad2c1[_0x15eb('0x13')]['message']);}else{logger['info']('VoiceQueuesLog,\x20%s,\x20%s',_0x594f54,'request\x20sent');_0x160879(_0x2ad2c1[_0x15eb('0x15')]['message']);}})['catch'](function(_0x3a78e9){logger['error'](_0x15eb('0xe'),_0x594f54,_0x3a78e9);_0x730b12(_0x3a78e9);});});}
\ No newline at end of file
+var _0xbfcc=['VoiceQueuesLog,\x20%s,\x20%s','request\x20sent','debug','VoiceQueuesLog,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','bluebird','randomstring','ioredis','../../mysqldb','jayson/promise','client','request','info'];(function(_0xcb1dd8,_0x3e174d){var _0x599c95=function(_0x44a84c){while(--_0x44a84c){_0xcb1dd8['push'](_0xcb1dd8['shift']());}};_0x599c95(++_0x3e174d);}(_0xbfcc,0x1dd));var _0xcbfc=function(_0x53cf8e,_0x3d290f){_0x53cf8e=_0x53cf8e-0x0;var _0x459197=_0xbfcc[_0x53cf8e];return _0x459197;};'use strict';var _=require(_0xcbfc('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xcbfc('0x1'));var rs=require(_0xcbfc('0x2'));var fs=require('fs');var Redis=require(_0xcbfc('0x3'));var db=require(_0xcbfc('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0xcbfc('0x5'));var client=jayson[_0xcbfc('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1b3917,_0x5a2be0,_0x2ea130){return new BPromise(function(_0x1f8b71,_0x1b1377){return client[_0xcbfc('0x7')](_0x1b3917,_0x2ea130)['then'](function(_0x2e7097){logger[_0xcbfc('0x8')](_0xcbfc('0x9'),_0x5a2be0,_0xcbfc('0xa'));logger[_0xcbfc('0xb')](_0xcbfc('0xc'),_0x5a2be0,'request\x20sent',JSON[_0xcbfc('0xd')](_0x2e7097));if(_0x2e7097[_0xcbfc('0xe')]){if(_0x2e7097[_0xcbfc('0xe')][_0xcbfc('0xf')]===0x1f4){logger[_0xcbfc('0xe')]('VoiceQueuesLog,\x20%s,\x20%s',_0x5a2be0,_0x2e7097[_0xcbfc('0xe')][_0xcbfc('0x10')]);return _0x1b1377(_0x2e7097[_0xcbfc('0xe')]['message']);}logger[_0xcbfc('0xe')](_0xcbfc('0x9'),_0x5a2be0,_0x2e7097[_0xcbfc('0xe')][_0xcbfc('0x10')]);return _0x1f8b71(_0x2e7097[_0xcbfc('0xe')]['message']);}else{logger[_0xcbfc('0x8')](_0xcbfc('0x9'),_0x5a2be0,_0xcbfc('0xa'));_0x1f8b71(_0x2e7097[_0xcbfc('0x11')]['message']);}})['catch'](function(_0x418f18){logger[_0xcbfc('0xe')](_0xcbfc('0x9'),_0x5a2be0,_0x418f18);_0x1b1377(_0x418f18);});});}
\ No newline at end of file
diff --git a/server/api/voiceRecording/index.js b/server/api/voiceRecording/index.js
index 5e96e24..59d9816 100644
--- a/server/api/voiceRecording/index.js
+++ b/server/api/voiceRecording/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xa9e0=['isAuthenticated','/describe','/:id','/:id/download','download','/:id/downloads','downloadTranscribe','post','create','/:id/transcribe','runTranscribe','put','update','delete','exports','multer','util','path','Router','../../components/interaction/service','../../config/environment','./voiceRecording.controller','get'];(function(_0x82a677,_0x113919){var _0x5e8914=function(_0x21522f){while(--_0x21522f){_0x82a677['push'](_0x82a677['shift']());}};_0x5e8914(++_0x113919);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0xa9e0[_0x4cf98e];return _0x1623ac;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x0a9e('0x4'));var config=require(_0x0a9e('0x5'));var controller=require(_0x0a9e('0x6'));router[_0x0a9e('0x7')]('/',auth[_0x0a9e('0x8')](),controller['index']);router[_0x0a9e('0x7')](_0x0a9e('0x9'),auth[_0x0a9e('0x8')](),controller['describe']);router['get'](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0x7')](_0x0a9e('0xb'),auth[_0x0a9e('0x8')](),controller[_0x0a9e('0xc')]);router[_0x0a9e('0x7')](_0x0a9e('0xd'),controller['downloads']);router['get']('/:id/transcribe',auth['isAuthenticated'](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')]('/',auth[_0x0a9e('0x8')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0xf')](_0x0a9e('0x11'),auth['isAuthenticated'](),controller[_0x0a9e('0x12')]);router[_0x0a9e('0x13')](_0x0a9e('0xa'),auth[_0x0a9e('0x8')](),controller[_0x0a9e('0x14')]);router[_0x0a9e('0x15')]('/:id',auth[_0x0a9e('0x8')](),controller['destroy']);module[_0x0a9e('0x16')]=router;
\ No newline at end of file
+var _0xa9e0=['isAuthenticated','/describe','/:id','/:id/download','download','/:id/downloads','downloadTranscribe','post','create','/:id/transcribe','runTranscribe','put','update','delete','exports','multer','util','path','Router','../../components/interaction/service','../../config/environment','./voiceRecording.controller','get'];(function(_0x15d55d,_0x5ac565){var _0x3a6867=function(_0x4d2deb){while(--_0x4d2deb){_0x15d55d['push'](_0x15d55d['shift']());}};_0x3a6867(++_0x5ac565);}(_0xa9e0,0x123));var _0x0a9e=function(_0x934425,_0x5af72f){_0x934425=_0x934425-0x0;var _0x31d596=_0xa9e0[_0x934425];return _0x31d596;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x0a9e('0x4'));var config=require(_0x0a9e('0x5'));var controller=require(_0x0a9e('0x6'));router[_0x0a9e('0x7')]('/',auth[_0x0a9e('0x8')](),controller['index']);router[_0x0a9e('0x7')](_0x0a9e('0x9'),auth[_0x0a9e('0x8')](),controller['describe']);router['get'](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0x7')](_0x0a9e('0xb'),auth[_0x0a9e('0x8')](),controller[_0x0a9e('0xc')]);router[_0x0a9e('0x7')](_0x0a9e('0xd'),controller['downloads']);router['get']('/:id/transcribe',auth['isAuthenticated'](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')]('/',auth[_0x0a9e('0x8')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0xf')](_0x0a9e('0x11'),auth['isAuthenticated'](),controller[_0x0a9e('0x12')]);router[_0x0a9e('0x13')](_0x0a9e('0xa'),auth[_0x0a9e('0x8')](),controller[_0x0a9e('0x14')]);router[_0x0a9e('0x15')]('/:id',auth[_0x0a9e('0x8')](),controller['destroy']);module[_0x0a9e('0x16')]=router;
\ No newline at end of file
diff --git a/server/api/voiceRecording/voiceRecording.attributes.js b/server/api/voiceRecording/voiceRecording.attributes.js
index 873dcca..f17f7ac 100644
--- a/server/api/voiceRecording/voiceRecording.attributes.js
+++ b/server/api/voiceRecording/voiceRecording.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x063e=['exports','VIRTUAL','getDataValue','value','extname','STRING','setDataValue','membername','split','INTEGER','TEXT','NEW','FLOAT','BOOLEAN','createdAt','format','MM-DD-YYYY\x20HH:mm','toString','DATE','updatedAt','sequelize','moment','path'];(function(_0x3686b4,_0xb1d112){var _0x3ce853=function(_0x253b90){while(--_0x253b90){_0x3686b4['push'](_0x3686b4['shift']());}};_0x3ce853(++_0xb1d112);}(_0x063e,0x111));var _0xe063=function(_0x3511d3,_0x4107ae){_0x3511d3=_0x3511d3-0x0;var _0x5d6321=_0x063e[_0x3511d3];return _0x5d6321;};'use strict';var Sequelize=require(_0xe063('0x0'));var moment=require(_0xe063('0x1'));var path=require(_0xe063('0x2'));module[_0xe063('0x3')]={'format':{'type':Sequelize[_0xe063('0x4')],'get':function(){return this[_0xe063('0x5')](_0xe063('0x6'))?path[_0xe063('0x7')](this[_0xe063('0x5')](_0xe063('0x6'))):undefined;}},'uniqueid':{'type':Sequelize[_0xe063('0x8')]},'channel':{'type':Sequelize[_0xe063('0x8')],'set':function(_0x4cc570){if(_0x4cc570){this['setDataValue']('channel',_0x4cc570);this[_0xe063('0x9')](_0xe063('0xa'),_0x4cc570[_0xe063('0xb')](/\/|-/)[0x1]);}}},'membername':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0xe063('0x8')]},'calleridname':{'type':Sequelize[_0xe063('0x8')]},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0xe063('0x8')]},'exten':{'type':Sequelize[_0xe063('0x8')]},'value':{'type':Sequelize[_0xe063('0x8')]},'type':{'type':Sequelize['STRING']},'rating':{'type':Sequelize[_0xe063('0xc')],'validate':{'max':0x5,'min':0x0}},'queue':{'type':Sequelize[_0xe063('0x8')]},'userDisposition':{'type':Sequelize[_0xe063('0x8')]},'location':{'type':Sequelize[_0xe063('0xd')]},'transcribeName':{'type':Sequelize[_0xe063('0x8')]},'transcribeStatus':{'type':Sequelize[_0xe063('0x8')],'defaultValue':_0xe063('0xe')},'fileUri':{'type':Sequelize[_0xe063('0xd')]},'fileText':{'type':Sequelize[_0xe063('0xd')]},'failureReason':{'type':Sequelize[_0xe063('0xd')]},'sentiment':{'type':Sequelize[_0xe063('0x8')]},'sPositive':{'type':Sequelize[_0xe063('0xf')]},'sNegative':{'type':Sequelize['FLOAT']},'sNeutral':{'type':Sequelize['FLOAT']},'sMixed':{'type':Sequelize['FLOAT']},'tempSentiment':{'type':Sequelize[_0xe063('0x10')],'defaultValue':![]},'createdAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0xe063('0x5')](_0xe063('0x11')))[_0xe063('0x12')](_0xe063('0x13'))[_0xe063('0x14')]();}},'updatedAt':{'type':Sequelize[_0xe063('0x15')],'get':function(){return moment(this[_0xe063('0x5')](_0xe063('0x16')))[_0xe063('0x12')]('MM-DD-YYYY\x20HH:mm')[_0xe063('0x14')]();}}};
\ No newline at end of file
+var _0x4d6b=['getDataValue','extname','STRING','membername','split','TEXT','NEW','FLOAT','BOOLEAN','DATE','format','MM-DD-YYYY\x20HH:mm','toString','updatedAt','sequelize','moment','exports','VIRTUAL'];(function(_0x20b5ac,_0x34501d){var _0xd8845=function(_0x2d1ba5){while(--_0x2d1ba5){_0x20b5ac['push'](_0x20b5ac['shift']());}};_0xd8845(++_0x34501d);}(_0x4d6b,0x152));var _0xb4d6=function(_0x2e8874,_0x13cd6c){_0x2e8874=_0x2e8874-0x0;var _0x4ca0cb=_0x4d6b[_0x2e8874];return _0x4ca0cb;};'use strict';var Sequelize=require(_0xb4d6('0x0'));var moment=require(_0xb4d6('0x1'));var path=require('path');module[_0xb4d6('0x2')]={'format':{'type':Sequelize[_0xb4d6('0x3')],'get':function(){return this[_0xb4d6('0x4')]('value')?path[_0xb4d6('0x5')](this[_0xb4d6('0x4')]('value')):undefined;}},'uniqueid':{'type':Sequelize[_0xb4d6('0x6')]},'channel':{'type':Sequelize[_0xb4d6('0x6')],'set':function(_0xba75ca){if(_0xba75ca){this['setDataValue']('channel',_0xba75ca);this['setDataValue'](_0xb4d6('0x7'),_0xba75ca[_0xb4d6('0x8')](/\/|-/)[0x1]);}}},'membername':{'type':Sequelize[_0xb4d6('0x6')]},'calleridnum':{'type':Sequelize[_0xb4d6('0x6')]},'calleridname':{'type':Sequelize[_0xb4d6('0x6')]},'connectedlinenum':{'type':Sequelize[_0xb4d6('0x6')]},'connectedlinename':{'type':Sequelize[_0xb4d6('0x6')]},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0xb4d6('0x6')]},'exten':{'type':Sequelize['STRING']},'value':{'type':Sequelize[_0xb4d6('0x6')]},'type':{'type':Sequelize[_0xb4d6('0x6')]},'rating':{'type':Sequelize['INTEGER'],'validate':{'max':0x5,'min':0x0}},'queue':{'type':Sequelize[_0xb4d6('0x6')]},'userDisposition':{'type':Sequelize['STRING']},'location':{'type':Sequelize[_0xb4d6('0x9')]},'transcribeName':{'type':Sequelize[_0xb4d6('0x6')]},'transcribeStatus':{'type':Sequelize['STRING'],'defaultValue':_0xb4d6('0xa')},'fileUri':{'type':Sequelize['TEXT']},'fileText':{'type':Sequelize['TEXT']},'failureReason':{'type':Sequelize[_0xb4d6('0x9')]},'sentiment':{'type':Sequelize[_0xb4d6('0x6')]},'sPositive':{'type':Sequelize['FLOAT']},'sNegative':{'type':Sequelize[_0xb4d6('0xb')]},'sNeutral':{'type':Sequelize['FLOAT']},'sMixed':{'type':Sequelize[_0xb4d6('0xb')]},'tempSentiment':{'type':Sequelize[_0xb4d6('0xc')],'defaultValue':![]},'createdAt':{'type':Sequelize[_0xb4d6('0xd')],'get':function(){return moment(this[_0xb4d6('0x4')]('createdAt'))[_0xb4d6('0xe')](_0xb4d6('0xf'))[_0xb4d6('0x10')]();}},'updatedAt':{'type':Sequelize[_0xb4d6('0xd')],'get':function(){return moment(this[_0xb4d6('0x4')](_0xb4d6('0x11')))['format'](_0xb4d6('0xf'))[_0xb4d6('0x10')]();}}};
\ No newline at end of file
diff --git a/server/api/voiceRecording/voiceRecording.controller.js b/server/api/voiceRecording/voiceRecording.controller.js
index bcd5ae3..f6437db 100644
--- a/server/api/voiceRecording/voiceRecording.controller.js
+++ b/server/api/voiceRecording/voiceRecording.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x0374=['../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','status','end','json','count','offset','limit','set','reject','save','update','then','destroy','sendStatus','stack','name','send','VoiceRecording','rawAttributes','key','model','map','format','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','type','VIRTUAL','merge','options','includeAll','include','findAll','catch','show','params','keys','find','create','body','describe','../../components/encryptor','uniqueid','value','%s.cypher','existsSync','secrets','VoiceRecording\x20not\x20found','filename','download','unlink','message','Not\x20found','sequelize','MD5','token','$and','push','decryptFile','recording','Sequelize','ValidationError','info','cancellazione\x20fisica\x20documento\x20%s','isNil','File:\x20\x22','unlinkSync','.cypher','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','createBucket','upload','TranscribeService','startTranscriptionJob','[RUNTRANSCRIPT][%d]\x20Starting\x20voice\x20recording\x20upload\x20in\x20bucket\x20%s','basename','readFileSync','[RUNTRANSCRIPT][%d]\x20Voice\x20recording\x20uploaded\x20in\x20bucket\x20%s\x20(%s)','Location','bucket','location','[RUNTRANSCRIPT][%d]\x20Sending\x20transcribe\x20request','[RUNTRANSCRIPT][%d]\x20Transcription\x20job\x20%s\x20created','TranscriptionJob','TranscriptionJobName','transcribeName','findOne','Voice\x20Recording\x20not\x20found','Setting','transcribe','transcribeAccountId','Transcribe\x20not\x20configured','runSentiment','sentimentAccountId','sentimentRegion','language','Sentiment\x20Analysis\x20not\x20configured','CloudProvider','Cloud\x20Provider\x20not\x20available','data2','data1','transcribeRegion','Buckets','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20not\x20available','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20available','transcribeStatus','[RUNTRANSCRIPT][%d]\x20Transcript\x20action\x20already\x20requested','IN_PROGRESS','tempSentiment','updateAttributes','writeFile','downloadTranscribe','fileText','/server/files/transcribes/transcribe_','Transcript\x20not\x20available','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','aws-sdk','uuid/v4','ioredis','../../components/auth/service','../../components/parsers/qs'];(function(_0x1f703f,_0x266ba9){var _0x3ad2ec=function(_0x306f81){while(--_0x306f81){_0x1f703f['push'](_0x1f703f['shift']());}};_0x3ad2ec(++_0x266ba9);}(_0x0374,0x7f));var _0x4037=function(_0x3393eb,_0x33d440){_0x3393eb=_0x3393eb-0x0;var _0x38be55=_0x0374[_0x3393eb];return _0x38be55;};'use strict';var pdf=require(_0x4037('0x0'));var emlformat=require(_0x4037('0x1'));var rimraf=require(_0x4037('0x2'));var zipdir=require(_0x4037('0x3'));var jsonpatch=require(_0x4037('0x4'));var rp=require(_0x4037('0x5'));var moment=require(_0x4037('0x6'));var BPromise=require('bluebird');var Mustache=require(_0x4037('0x7'));var util=require(_0x4037('0x8'));var path=require(_0x4037('0x9'));var sox=require(_0x4037('0xa'));var csv=require('to-csv');var ejs=require(_0x4037('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0x4037('0xc'));var crypto=require(_0x4037('0xd'));var jsforce=require(_0x4037('0xe'));var deskjs=require(_0x4037('0xf'));var toCsv=require('to-csv');var querystring=require(_0x4037('0x10'));var Papa=require(_0x4037('0x11'));var AWS=require(_0x4037('0x12'));var uuidv4=require(_0x4037('0x13'));var Redis=require(_0x4037('0x14'));var authService=require(_0x4037('0x15'));var qs=require(_0x4037('0x16'));var as=require(_0x4037('0x17'));var hardwareService=require(_0x4037('0x18'));var logger=require(_0x4037('0x19'))('api');var utils=require(_0x4037('0x1a'));var config=require(_0x4037('0x1b'));var db=require(_0x4037('0x1c'))['db'];function respondWithStatusCode(_0x46ef2b,_0x4276b3){_0x4276b3=_0x4276b3||0xcc;return function(_0x5c2151){if(_0x5c2151){return _0x46ef2b['sendStatus'](_0x4276b3);}return _0x46ef2b[_0x4037('0x1d')](_0x4276b3)[_0x4037('0x1e')]();};}function respondWithResult(_0x355172,_0x26471c){_0x26471c=_0x26471c||0xc8;return function(_0x27c975){if(_0x27c975){return _0x355172[_0x4037('0x1d')](_0x26471c)[_0x4037('0x1f')](_0x27c975);}};}function respondWithFilteredResult(_0x8d217d,_0x53012b){return function(_0xd77e77){if(_0xd77e77){var _0x47551f=_0xd77e77[_0x4037('0x20')],_0x47c5d3=_0x53012b[_0x4037('0x21')],_0x4e86bb=_0x53012b[_0x4037('0x21')]+_0x53012b[_0x4037('0x22')],_0x3d462f;if(_0x4e86bb>=_0x47551f){_0x4e86bb=_0x47551f;_0x3d462f=0xc8;}else{_0x3d462f=0xce;}_0x8d217d['status'](_0x3d462f);return _0x8d217d[_0x4037('0x23')]('Content-Range',_0x47c5d3+'-'+_0x4e86bb+'/'+_0x47551f)['json'](_0xd77e77);}return null;};}function patchUpdates(_0x689d4){return function(_0x2955d9){try{jsonpatch['apply'](_0x2955d9,_0x689d4,!![]);}catch(_0x555195){return BPromise[_0x4037('0x24')](_0x555195);}return _0x2955d9[_0x4037('0x25')]();};}function saveUpdates(_0x527576,_0x291e66){return function(_0x17b735){if(_0x17b735){return _0x17b735[_0x4037('0x26')](_0x527576)[_0x4037('0x27')](function(_0x268b2f){return _0x268b2f;});}return null;};}function removeEntity(_0x12a152,_0x38c1b2){return function(_0x57f51c){if(_0x57f51c){return _0x57f51c[_0x4037('0x28')]()[_0x4037('0x27')](function(){_0x12a152[_0x4037('0x1d')](0xcc)[_0x4037('0x1e')]();});}};}function handleEntityNotFound(_0x46955c,_0x3b1c51){return function(_0x1ffaa8){if(!_0x1ffaa8){_0x46955c[_0x4037('0x29')](0x194);}return _0x1ffaa8;};}function handleError(_0x1804ac,_0x3b642f){_0x3b642f=_0x3b642f||0x1f4;return function(_0xce6e0e){logger['error'](_0xce6e0e[_0x4037('0x2a')]);if(_0xce6e0e[_0x4037('0x2b')]){delete _0xce6e0e[_0x4037('0x2b')];}_0x1804ac['status'](_0x3b642f)[_0x4037('0x2c')](_0xce6e0e);};}exports['index']=function(_0x5acfb0,_0x59d3dc){var _0x5593fd={},_0x4c4880={},_0x545132={'count':0x0,'rows':[]};var _0x1f8b89=_['map'](db[_0x4037('0x2d')][_0x4037('0x2e')],function(_0x2fa0d4){return{'name':_0x2fa0d4['fieldName'],'type':_0x2fa0d4['type'][_0x4037('0x2f')]};});_0x4c4880[_0x4037('0x30')]=_['differenceBy'](_[_0x4037('0x31')](_0x1f8b89,'name'),[_0x4037('0x32')]);_0x4c4880[_0x4037('0x33')]=_['keys'](_0x5acfb0[_0x4037('0x33')]);_0x4c4880[_0x4037('0x34')]=_[_0x4037('0x35')](_0x4c4880[_0x4037('0x30')],_0x4c4880['query']);_0x5593fd[_0x4037('0x36')]=_['intersection'](_0x4c4880[_0x4037('0x30')],qs[_0x4037('0x37')](_0x5acfb0[_0x4037('0x33')][_0x4037('0x37')]));_0x5593fd[_0x4037('0x36')]=_0x5593fd[_0x4037('0x36')][_0x4037('0x38')]?_0x5593fd[_0x4037('0x36')]:_0x4c4880['model'];if(!_0x5acfb0[_0x4037('0x33')][_0x4037('0x39')]('nolimit')){_0x5593fd['limit']=qs['limit'](_0x5acfb0[_0x4037('0x33')][_0x4037('0x22')]);_0x5593fd[_0x4037('0x21')]=qs[_0x4037('0x21')](_0x5acfb0[_0x4037('0x33')][_0x4037('0x21')]);}_0x5593fd[_0x4037('0x3a')]=qs[_0x4037('0x3b')](_0x5acfb0[_0x4037('0x33')]['sort']);_0x5593fd[_0x4037('0x3c')]=qs['filters'](_[_0x4037('0x3d')](_0x5acfb0['query'],_0x4c4880[_0x4037('0x34')]),_0x1f8b89);if(_0x5acfb0[_0x4037('0x33')]['filter']){_0x5593fd[_0x4037('0x3c')]=_['merge'](_0x5593fd['where'],{'$or':_['map'](_0x1f8b89,function(_0x3e2519){if(_0x3e2519[_0x4037('0x3e')]!==_0x4037('0x3f')){var _0x4225fb={};_0x4225fb[_0x3e2519[_0x4037('0x2b')]]={'$like':'%'+_0x5acfb0[_0x4037('0x33')]['filter']+'%'};return _0x4225fb;}})});}_0x5593fd=_[_0x4037('0x40')]({},_0x5593fd,_0x5acfb0[_0x4037('0x41')]);var _0x3f72e4={'where':_0x5593fd[_0x4037('0x3c')]};return db[_0x4037('0x2d')][_0x4037('0x20')](_0x3f72e4)['then'](function(_0x33402b){_0x545132[_0x4037('0x20')]=_0x33402b;if(_0x5acfb0[_0x4037('0x33')][_0x4037('0x42')]){_0x5593fd[_0x4037('0x43')]=[{'all':!![]}];}return db[_0x4037('0x2d')][_0x4037('0x44')](_0x5593fd);})[_0x4037('0x27')](function(_0x1a75ce){_0x545132['rows']=_0x1a75ce;return _0x545132;})[_0x4037('0x27')](respondWithFilteredResult(_0x59d3dc,_0x5593fd))[_0x4037('0x45')](handleError(_0x59d3dc,null));};exports[_0x4037('0x46')]=function(_0x1ed3fa,_0x2a11e1){var _0x4d2a1d={'raw':![],'where':{'id':_0x1ed3fa[_0x4037('0x47')]['id']}},_0x3ad747={};_0x3ad747[_0x4037('0x30')]=_['keys'](db[_0x4037('0x2d')][_0x4037('0x2e')]);_0x3ad747['query']=_[_0x4037('0x48')](_0x1ed3fa[_0x4037('0x33')]);_0x3ad747['filters']=_[_0x4037('0x35')](_0x3ad747[_0x4037('0x30')],_0x3ad747[_0x4037('0x33')]);_0x4d2a1d['attributes']=_[_0x4037('0x35')](_0x3ad747[_0x4037('0x30')],qs['fields'](_0x1ed3fa[_0x4037('0x33')]['fields']));_0x4d2a1d['attributes']=_0x4d2a1d[_0x4037('0x36')][_0x4037('0x38')]?_0x4d2a1d['attributes']:_0x3ad747['model'];if(_0x1ed3fa['query'][_0x4037('0x42')]){_0x4d2a1d['include']=[{'all':!![]}];}_0x4d2a1d=_['merge']({},_0x4d2a1d,_0x1ed3fa[_0x4037('0x41')]);return db[_0x4037('0x2d')][_0x4037('0x49')](_0x4d2a1d)['then'](handleEntityNotFound(_0x2a11e1,null))[_0x4037('0x27')](respondWithResult(_0x2a11e1,null))[_0x4037('0x45')](handleError(_0x2a11e1,null));};exports[_0x4037('0x4a')]=function(_0x2bfe55,_0x4a2e1e){return db[_0x4037('0x2d')][_0x4037('0x4a')](_0x2bfe55['body'],{})[_0x4037('0x27')](respondWithResult(_0x4a2e1e,0xc9))['catch'](handleError(_0x4a2e1e,null));};exports[_0x4037('0x26')]=function(_0x10c0b4,_0x2f8e53){if(_0x10c0b4[_0x4037('0x4b')]['id']){delete _0x10c0b4[_0x4037('0x4b')]['id'];}return db[_0x4037('0x2d')][_0x4037('0x49')]({'where':{'id':_0x10c0b4[_0x4037('0x47')]['id']}})[_0x4037('0x27')](handleEntityNotFound(_0x2f8e53,null))[_0x4037('0x27')](saveUpdates(_0x10c0b4['body'],null))[_0x4037('0x27')](respondWithResult(_0x2f8e53,null))[_0x4037('0x45')](handleError(_0x2f8e53,null));};exports[_0x4037('0x4c')]=function(_0x7421f0,_0x49ee5f){return db[_0x4037('0x2d')][_0x4037('0x4c')]()[_0x4037('0x27')](respondWithResult(_0x49ee5f,null))[_0x4037('0x45')](handleError(_0x49ee5f,null));};exports['download']=function(_0xf32578,_0x2f38c0,_0x28117d){var _0xbdbc2d=require(_0x4037('0x4d'));var _0x42f2f3=![];var _0xcfd0d6={};if(_0xf32578[_0x4037('0x33')][_0x4037('0x3e')]&&_0xf32578[_0x4037('0x33')][_0x4037('0x3e')]===_0x4037('0x4e')){_0xcfd0d6[_0x4037('0x4e')]=_0xf32578[_0x4037('0x47')]['id'];}else{_0xcfd0d6['id']=_0xf32578['params']['id'];}return db[_0x4037('0x2d')][_0x4037('0x49')]({'where':_0xcfd0d6,'attributes':['id',_0x4037('0x4f')],'raw':!![]})[_0x4037('0x27')](handleEntityNotFound(_0x2f38c0,null))[_0x4037('0x27')](function(_0x570da0){if(_0x570da0){var _0x14d0dd=_0x570da0[_0x4037('0x4f')];var _0x44577a=util[_0x4037('0x32')](_0x4037('0x50'),_0x14d0dd);if(fs[_0x4037('0x51')](_0x44577a)){_0x42f2f3=!![];return _0xbdbc2d['decryptFile'](_0x44577a,_0x14d0dd,config[_0x4037('0x52')]['recording'])[_0x4037('0x27')](function(){return _0x570da0;});}return _0x570da0;}})['then'](function(_0x1f4612){if(_0x1f4612){var _0x434dc3=_0x1f4612[_0x4037('0x4f')];if(!fs[_0x4037('0x51')](_0x434dc3)){throw new db['Sequelize']['ValidationError'](_0x4037('0x53'));}if(_0x1f4612[_0x4037('0x54')]){return _0x2f38c0[_0x4037('0x55')](_0x434dc3,_0x1f4612[_0x4037('0x54')]+path['extname'](_0x434dc3),function(){if(_0x42f2f3){fs[_0x4037('0x56')](_0x434dc3);}});}else{return _0x2f38c0[_0x4037('0x55')](_0x434dc3,function(_0x173ca5){if(_0x42f2f3){fs[_0x4037('0x56')](_0x434dc3);}});}}})[_0x4037('0x45')](function(_0x4ddcdd){if(_0x4ddcdd[_0x4037('0x57')]==='VoiceRecording\x20not\x20found'){_0x2f38c0['status'](0x194)['send'](_0x4037('0x58'));}else{return handleError(_0x2f38c0,null);}});};exports['downloads']=function(_0x6db94,_0x3b1ba4,_0x5bafcd){var _0xcc0171=require('../../components/encryptor');var _0x5bf1d0=![];var _0x51c77d={'$and':[db['sequelize'][_0x4037('0x3c')](db[_0x4037('0x59')]['fn'](_0x4037('0x5a'),db[_0x4037('0x59')]['col'](_0x4037('0x4e'))),_0x6db94[_0x4037('0x33')][_0x4037('0x5b')])]};if(_0x6db94[_0x4037('0x33')][_0x4037('0x3e')]&&_0x6db94[_0x4037('0x33')][_0x4037('0x3e')]===_0x4037('0x4e')){_0x51c77d[_0x4037('0x5c')][_0x4037('0x5d')]({'uniqueid':_0x6db94['params']['id']});}else{_0x51c77d[_0x4037('0x5c')][_0x4037('0x5d')]({'id':_0x6db94['params']['id']});}return db[_0x4037('0x2d')][_0x4037('0x49')]({'where':_0x51c77d,'attributes':['id',_0x4037('0x4f')],'raw':!![]})[_0x4037('0x27')](handleEntityNotFound(_0x3b1ba4,null))[_0x4037('0x27')](function(_0x52fc15){if(_0x52fc15){var _0xc27bee=util[_0x4037('0x32')](_0x4037('0x50'),_0x52fc15[_0x4037('0x4f')]);if(fs[_0x4037('0x51')](_0xc27bee)){_0x5bf1d0=!![];return _0xcc0171[_0x4037('0x5e')](_0xc27bee,_0x52fc15[_0x4037('0x4f')],config['secrets'][_0x4037('0x5f')])[_0x4037('0x27')](function(){return _0x52fc15;});}return _0x52fc15;}})[_0x4037('0x27')](function(_0x5b8fe3){if(_0x5b8fe3){if(!fs[_0x4037('0x51')](_0x5b8fe3[_0x4037('0x4f')])){throw new db[(_0x4037('0x60'))][(_0x4037('0x61'))](_0x4037('0x53'));}if(_0x5b8fe3[_0x4037('0x54')]){return _0x3b1ba4[_0x4037('0x55')](_0x5b8fe3['value'],_0x5b8fe3['filename']+path['extname'](_0x5b8fe3['value']),function(){if(_0x5bf1d0){fs[_0x4037('0x56')](_0x5b8fe3[_0x4037('0x4f')]);}});}else{return _0x3b1ba4[_0x4037('0x55')](_0x5b8fe3['value'],function(_0x5957df){if(_0x5bf1d0){fs[_0x4037('0x56')](_0x5b8fe3[_0x4037('0x4f')]);}});}}})[_0x4037('0x45')](handleError(_0x3b1ba4,null));};exports[_0x4037('0x28')]=function(_0x317155,_0x1093a7){return db[_0x4037('0x2d')][_0x4037('0x49')]({'where':{'id':_0x317155[_0x4037('0x47')]['id']}})['then'](function(_0x550172){if(!_0x550172)throw new ReferenceError('Entity\x20not\x20found');return _0x550172;})[_0x4037('0x27')](function(_0x3586cf){var _0x3de382=_0x3586cf[_0x4037('0x4f')];logger[_0x4037('0x62')](_0x4037('0x63'),_0x3de382);if(!_[_0x4037('0x64')](_0x3586cf[_0x4037('0x4f')])&&fs[_0x4037('0x51')](_0x3de382)){logger[_0x4037('0x62')](_0x4037('0x65')+_0x3de382+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0x4037('0x66')](_0x3de382);}_0x3de382=_0x3de382+_0x4037('0x67');if(!_['isNil'](_0x3586cf[_0x4037('0x4f')])&&fs[_0x4037('0x51')](_0x3de382)){logger[_0x4037('0x62')]('File:\x20\x22'+_0x3de382+_0x4037('0x68'));fs[_0x4037('0x66')](_0x3de382);}return _0x3586cf;})[_0x4037('0x27')](function(_0xd802c7){if(!_0xd802c7)throw new InternalError();return _0xd802c7[_0x4037('0x28')]();})[_0x4037('0x27')](function(){_0x1093a7[_0x4037('0x1d')](0xcc)[_0x4037('0x1e')]();})[_0x4037('0x45')](handleError(_0x1093a7,null));};function getBucketslist(_0x3f46b4,_0x49b980,_0x273b38){return new Promise(function(_0x117287,_0x4e8b66){var _0xd07563=new AWS['S3']({'accessKeyId':_0x49b980,'secretAccessKey':_0x3f46b4,'region':_0x273b38});_0xd07563['listBuckets']({},function(_0x286187,_0x237288){if(_0x286187){return _0x4e8b66(_0x286187);}else{return _0x117287(_0x237288);}});});}function createBucket(_0x45acbb,_0x210b3b,_0x322863,_0x25346a){return new Promise(function(_0xeab839,_0x21836e){var _0x25ecfd=new AWS['S3']({'accessKeyId':_0x210b3b,'secretAccessKey':_0x45acbb,'region':_0x322863});_0x25ecfd[_0x4037('0x69')]({'Bucket':_0x25346a},function(_0x2e89bd,_0x2c723d){if(_0x2e89bd){return _0x21836e(_0x2e89bd);}else{return _0xeab839(_0x2c723d);}});});}function uploadFile(_0x6f41c9,_0xda751a,_0x57d801,_0x44f714,_0x2ddf03,_0x593eb2){return new Promise(function(_0x357f5b,_0x57652e){var _0x2dcce8=new AWS['S3']({'accessKeyId':_0xda751a,'secretAccessKey':_0x6f41c9,'region':_0x57d801});_0x2dcce8[_0x4037('0x6a')]({'Bucket':_0x44f714,'Key':_0x2ddf03,'Body':_0x593eb2},function(_0x12cf43,_0x1027aa){if(_0x12cf43){return _0x57652e(_0x12cf43);}else{return _0x357f5b(_0x1027aa);}});});}function startTranscribe(_0x505185,_0x533871,_0x8ff7d1,_0x58de40,_0x441015,_0x1d60d7){return new Promise(function(_0x1c240e,_0x44e6c9){var _0x51c8d5=new AWS[(_0x4037('0x6b'))]({'accessKeyId':_0x533871,'secretAccessKey':_0x505185,'region':_0x8ff7d1});_0x51c8d5[_0x4037('0x6c')]({'TranscriptionJobName':_0x58de40,'LanguageCode':_0x441015,'Media':{'MediaFileUri':_0x1d60d7}},function(_0x38399d,_0x34e5c5){if(_0x38399d){return _0x44e6c9(_0x38399d);}else{return _0x1c240e(_0x34e5c5);}});});}function transcribe(_0x2653ba,_0x4c491f,_0x102290,_0x1d8c24,_0x1aeeb7,_0x1d697c,_0x18830d){return new Promise(function(_0x44d8c2,_0x49d8e4){var _0x1f96ff={};logger[_0x4037('0x62')](util[_0x4037('0x32')](_0x4037('0x6d'),_0x2653ba,_0x1aeeb7));return uploadFile(_0x4c491f,_0x102290,_0x1d8c24,_0x1aeeb7,path[_0x4037('0x6e')](_0x1d697c),fs[_0x4037('0x6f')](_0x1d697c))[_0x4037('0x27')](function(_0x3568de){logger[_0x4037('0x62')](util[_0x4037('0x32')](_0x4037('0x70'),_0x2653ba,_0x1aeeb7,_0x3568de[_0x4037('0x71')]));_0x1f96ff[_0x4037('0x72')]=_0x3568de['Bucket'];_0x1f96ff[_0x4037('0x73')]=_0x3568de[_0x4037('0x71')];logger['info'](util['format'](_0x4037('0x74'),_0x2653ba));return startTranscribe(_0x4c491f,_0x102290,_0x1d8c24,uuidv4(),_0x18830d,_0x3568de['Location']);})['then'](function(_0x47a840){logger[_0x4037('0x62')](util[_0x4037('0x32')](_0x4037('0x75'),_0x2653ba,_0x47a840[_0x4037('0x76')][_0x4037('0x77')]));_0x1f96ff[_0x4037('0x78')]=_0x47a840[_0x4037('0x76')][_0x4037('0x77')];_0x1f96ff['transcribeStatus']=_0x47a840[_0x4037('0x76')]['TranscriptionJobStatus'];return _0x44d8c2(_0x1f96ff);})[_0x4037('0x45')](function(_0x2a6c74){return _0x49d8e4(_0x2a6c74);});});}exports['runTranscribe']=function(_0x14810c,_0x4a8123,_0x25e45f){var _0xa2df92;var _0xbab2ec;var _0x1625ab;var _0x1269d3=require(_0x4037('0x4d'));return db[_0x4037('0x2d')][_0x4037('0x79')]({'where':{'id':_0x14810c['params']['id']}})['then'](function(_0x490a0f){if(_0x490a0f){var _0x2cba2a=util[_0x4037('0x32')](_0x4037('0x50'),_0x490a0f[_0x4037('0x4f')]);if(fs[_0x4037('0x51')](_0x2cba2a)){cypher=!![];return _0x1269d3[_0x4037('0x5e')](_0x2cba2a,_0x490a0f['value'],config[_0x4037('0x52')]['recording'])[_0x4037('0x27')](function(){return _0x490a0f;});}return _0x490a0f;}})[_0x4037('0x27')](function(_0x3e5357){if(!_0x3e5357){throw new db[(_0x4037('0x60'))]['ValidationError'](_0x4037('0x7a'));}_0xbab2ec=_0x3e5357;return db[_0x4037('0x7b')][_0x4037('0x79')]({'where':{'id':0x1}});})[_0x4037('0x27')](handleEntityNotFound(_0x4a8123,null))[_0x4037('0x27')](function(_0x5a0cb6){if(_0x5a0cb6){_0xa2df92=_0x5a0cb6;if(!_0xa2df92[_0x4037('0x7c')]||!_0xa2df92[_0x4037('0x7d')]||!_0xa2df92['transcribeRegion']||!_0xa2df92['language']||!_0xa2df92[_0x4037('0x72')]){throw new db[(_0x4037('0x60'))][(_0x4037('0x61'))](_0x4037('0x7e'));}if(_0x14810c['body'][_0x4037('0x7f')]&&(!_0xa2df92['sentiment']||!_0xa2df92[_0x4037('0x80')]||!_0xa2df92[_0x4037('0x81')]||!_0xa2df92[_0x4037('0x82')]||!_0xa2df92[_0x4037('0x72')])){throw new db[(_0x4037('0x60'))]['ValidationError'](_0x4037('0x83'));}return db[_0x4037('0x84')]['findOne']({'where':{'id':_0xa2df92[_0x4037('0x7d')]}});}})[_0x4037('0x27')](function(_0x16df27){if(!_0x16df27){throw new db[(_0x4037('0x60'))]['ValidationError'](_0x4037('0x85'));}if(!_0x16df27['data1']||!_0x16df27[_0x4037('0x86')]){throw new db['Sequelize'][(_0x4037('0x61'))]('Cloud\x20Provider\x20not\x20configured');}_0x1625ab=_0x16df27;return getBucketslist(_0x1625ab[_0x4037('0x87')],_0x1625ab[_0x4037('0x86')],_0xa2df92[_0x4037('0x88')]);})[_0x4037('0x27')](function(_0x289cf6){if(_0x289cf6&&_0x289cf6[_0x4037('0x89')]){var _0x40287e=_[_0x4037('0x49')](_0x289cf6['Buckets'],function(_0x1045da){return _0x1045da['Name']===_0xa2df92['bucket'];});if(!_0x40287e){logger[_0x4037('0x62')](util['format'](_0x4037('0x8a'),_0x14810c['params']['id'],_0xa2df92['bucket']));return createBucket(_0x1625ab[_0x4037('0x87')],_0x1625ab[_0x4037('0x86')],_0xa2df92[_0x4037('0x88')],_0xa2df92[_0x4037('0x72')]);}logger[_0x4037('0x62')](util[_0x4037('0x32')](_0x4037('0x8b'),_0x14810c[_0x4037('0x47')]['id'],_0xa2df92[_0x4037('0x72')]));return;}})[_0x4037('0x27')](function(_0xe75a70){if(_0xbab2ec[_0x4037('0x8c')]==='NEW'){return transcribe(_0x14810c[_0x4037('0x47')]['id'],_0x1625ab[_0x4037('0x87')],_0x1625ab[_0x4037('0x86')],_0xa2df92[_0x4037('0x88')],_0xa2df92[_0x4037('0x72')],_0xbab2ec[_0x4037('0x4f')],_0xa2df92[_0x4037('0x82')]);}else{logger[_0x4037('0x62')](util[_0x4037('0x32')](_0x4037('0x8d'),_0x14810c[_0x4037('0x47')]['id']));return{'transcribeStatus':_0x4037('0x8e')};}})[_0x4037('0x27')](function(_0x5b1595){if(_0x5b1595){_0x5b1595[_0x4037('0x8f')]=_0x14810c['body'][_0x4037('0x7f')];return _0xbab2ec[_0x4037('0x90')](_0x5b1595);}})['then'](respondWithResult(_0x4a8123,null))['catch'](handleError(_0x4a8123,null));};function writeFile(_0x32b56a,_0x47ffd1){return new Promise(function(_0x22e216,_0x30efdd){fs[_0x4037('0x91')](_0x47ffd1,_0x32b56a,function(_0x458e45,_0x196632){if(_0x458e45){return _0x30efdd(_0x458e45);}else{return _0x22e216(_0x196632);}});});}exports[_0x4037('0x92')]=function(_0x16645a,_0x10034a,_0x49a9cb){return db[_0x4037('0x2d')][_0x4037('0x79')]({'where':{'id':_0x16645a['params']['id']}})[_0x4037('0x27')](handleEntityNotFound(_0x10034a))[_0x4037('0x27')](function(_0x49f263){if(_0x49f263&&_0x49f263[_0x4037('0x93')]){var _0x3cb498=_0x49f263[_0x4037('0x93')];var _0x2cdb20=config['root']+_0x4037('0x94')+_0x49f263['id']+'.txt';if(fs['existsSync'](_0x2cdb20)){return _0x2cdb20;}return writeFile(_0x3cb498,_0x2cdb20)[_0x4037('0x27')](function(){return _0x2cdb20;});}else{throw new db[(_0x4037('0x60'))][(_0x4037('0x61'))](_0x4037('0x95'));}})[_0x4037('0x27')](function(_0x3cf0a8){return _0x10034a['download'](_0x3cf0a8);})[_0x4037('0x45')](handleError(_0x10034a));};
\ No newline at end of file
+var _0x0a80=['params','fields','find','create','body','describe','../../components/encryptor','uniqueid','value','format','%s.cypher','existsSync','decryptFile','Sequelize','filename','extname','unlink','download','message','Not\x20found','downloads','sequelize','MD5','$and','secrets','recording','ValidationError','VoiceRecording\x20not\x20found','destroy','isNil','info','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','createBucket','upload','TranscribeService','[RUNTRANSCRIPT][%d]\x20Starting\x20voice\x20recording\x20upload\x20in\x20bucket\x20%s','basename','Location','bucket','Bucket','location','[RUNTRANSCRIPT][%d]\x20Sending\x20transcribe\x20request','[RUNTRANSCRIPT][%d]\x20Transcription\x20job\x20%s\x20created','TranscriptionJob','TranscriptionJobName','transcribeName','transcribeStatus','TranscriptionJobStatus','findOne','Voice\x20Recording\x20not\x20found','Setting','transcribe','transcribeAccountId','transcribeRegion','language','runSentiment','sentiment','sentimentAccountId','sentimentRegion','Sentiment\x20Analysis\x20not\x20configured','Cloud\x20Provider\x20not\x20available','data1','data2','Buckets','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20not\x20available','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20available','NEW','[RUNTRANSCRIPT][%d]\x20Transcript\x20action\x20already\x20requested','tempSentiment','updateAttributes','writeFile','fileText','root','/server/files/transcribes/transcribe_','.txt','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','desk.js','querystring','papaparse','aws-sdk','uuid/v4','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../mysqldb','status','end','json','offset','limit','set','Content-Range','apply','update','then','sendStatus','error','stack','name','send','index','map','fieldName','type','model','differenceBy','query','keys','intersection','attributes','hasOwnProperty','order','sort','where','pick','filters','filter','merge','options','VoiceRecording','count','includeAll','include','findAll','rows','catch'];(function(_0x48c79b,_0xd6638a){var _0x3b4538=function(_0x1734a1){while(--_0x1734a1){_0x48c79b['push'](_0x48c79b['shift']());}};_0x3b4538(++_0xd6638a);}(_0x0a80,0xdf));var _0x00a8=function(_0x4a0c28,_0x558479){_0x4a0c28=_0x4a0c28-0x0;var _0x27aead=_0x0a80[_0x4a0c28];return _0x27aead;};'use strict';var pdf=require(_0x00a8('0x0'));var emlformat=require(_0x00a8('0x1'));var rimraf=require(_0x00a8('0x2'));var zipdir=require(_0x00a8('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x00a8('0x4'));var moment=require(_0x00a8('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x00a8('0x6'));var util=require(_0x00a8('0x7'));var path=require(_0x00a8('0x8'));var sox=require(_0x00a8('0x9'));var csv=require(_0x00a8('0xa'));var ejs=require(_0x00a8('0xb'));var fs=require('fs');var _=require(_0x00a8('0xc'));var squel=require(_0x00a8('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x00a8('0xe'));var toCsv=require(_0x00a8('0xa'));var querystring=require(_0x00a8('0xf'));var Papa=require(_0x00a8('0x10'));var AWS=require(_0x00a8('0x11'));var uuidv4=require(_0x00a8('0x12'));var Redis=require(_0x00a8('0x13'));var authService=require(_0x00a8('0x14'));var qs=require(_0x00a8('0x15'));var as=require(_0x00a8('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x00a8('0x17'));var utils=require(_0x00a8('0x18'));var config=require('../../config/environment');var db=require(_0x00a8('0x19'))['db'];function respondWithStatusCode(_0x56fcbd,_0x511db0){_0x511db0=_0x511db0||0xcc;return function(_0x560f50){if(_0x560f50){return _0x56fcbd['sendStatus'](_0x511db0);}return _0x56fcbd[_0x00a8('0x1a')](_0x511db0)[_0x00a8('0x1b')]();};}function respondWithResult(_0x2eab76,_0x27b37b){_0x27b37b=_0x27b37b||0xc8;return function(_0x553917){if(_0x553917){return _0x2eab76[_0x00a8('0x1a')](_0x27b37b)[_0x00a8('0x1c')](_0x553917);}};}function respondWithFilteredResult(_0x50f43b,_0x2ff810){return function(_0x3ca09e){if(_0x3ca09e){var _0x253c54=_0x3ca09e['count'],_0x5ed9a0=_0x2ff810[_0x00a8('0x1d')],_0x191be5=_0x2ff810['offset']+_0x2ff810[_0x00a8('0x1e')],_0x501e77;if(_0x191be5>=_0x253c54){_0x191be5=_0x253c54;_0x501e77=0xc8;}else{_0x501e77=0xce;}_0x50f43b[_0x00a8('0x1a')](_0x501e77);return _0x50f43b[_0x00a8('0x1f')](_0x00a8('0x20'),_0x5ed9a0+'-'+_0x191be5+'/'+_0x253c54)[_0x00a8('0x1c')](_0x3ca09e);}return null;};}function patchUpdates(_0x210d12){return function(_0x34a2b7){try{jsonpatch[_0x00a8('0x21')](_0x34a2b7,_0x210d12,!![]);}catch(_0x1ad683){return BPromise['reject'](_0x1ad683);}return _0x34a2b7['save']();};}function saveUpdates(_0x561553,_0x35c790){return function(_0x3c778b){if(_0x3c778b){return _0x3c778b[_0x00a8('0x22')](_0x561553)[_0x00a8('0x23')](function(_0x3125d1){return _0x3125d1;});}return null;};}function removeEntity(_0x1eab6d,_0x3e923e){return function(_0x51a8ae){if(_0x51a8ae){return _0x51a8ae['destroy']()[_0x00a8('0x23')](function(){_0x1eab6d[_0x00a8('0x1a')](0xcc)[_0x00a8('0x1b')]();});}};}function handleEntityNotFound(_0x2d977b,_0x2590ac){return function(_0x3253b7){if(!_0x3253b7){_0x2d977b[_0x00a8('0x24')](0x194);}return _0x3253b7;};}function handleError(_0x24e5bf,_0x2b9a04){_0x2b9a04=_0x2b9a04||0x1f4;return function(_0x3d6390){logger[_0x00a8('0x25')](_0x3d6390[_0x00a8('0x26')]);if(_0x3d6390[_0x00a8('0x27')]){delete _0x3d6390['name'];}_0x24e5bf[_0x00a8('0x1a')](_0x2b9a04)[_0x00a8('0x28')](_0x3d6390);};}exports[_0x00a8('0x29')]=function(_0x1b5650,_0x464a7e){var _0x1258a4={},_0x2cb4fa={},_0x24f299={'count':0x0,'rows':[]};var _0x2fabd8=_[_0x00a8('0x2a')](db['VoiceRecording']['rawAttributes'],function(_0x4acc36){return{'name':_0x4acc36[_0x00a8('0x2b')],'type':_0x4acc36[_0x00a8('0x2c')]['key']};});_0x2cb4fa[_0x00a8('0x2d')]=_[_0x00a8('0x2e')](_[_0x00a8('0x2a')](_0x2fabd8,_0x00a8('0x27')),['format']);_0x2cb4fa[_0x00a8('0x2f')]=_[_0x00a8('0x30')](_0x1b5650[_0x00a8('0x2f')]);_0x2cb4fa['filters']=_[_0x00a8('0x31')](_0x2cb4fa['model'],_0x2cb4fa[_0x00a8('0x2f')]);_0x1258a4[_0x00a8('0x32')]=_[_0x00a8('0x31')](_0x2cb4fa[_0x00a8('0x2d')],qs['fields'](_0x1b5650[_0x00a8('0x2f')]['fields']));_0x1258a4[_0x00a8('0x32')]=_0x1258a4['attributes']['length']?_0x1258a4[_0x00a8('0x32')]:_0x2cb4fa[_0x00a8('0x2d')];if(!_0x1b5650[_0x00a8('0x2f')][_0x00a8('0x33')]('nolimit')){_0x1258a4[_0x00a8('0x1e')]=qs['limit'](_0x1b5650[_0x00a8('0x2f')]['limit']);_0x1258a4[_0x00a8('0x1d')]=qs['offset'](_0x1b5650[_0x00a8('0x2f')][_0x00a8('0x1d')]);}_0x1258a4[_0x00a8('0x34')]=qs[_0x00a8('0x35')](_0x1b5650['query'][_0x00a8('0x35')]);_0x1258a4[_0x00a8('0x36')]=qs['filters'](_[_0x00a8('0x37')](_0x1b5650[_0x00a8('0x2f')],_0x2cb4fa[_0x00a8('0x38')]),_0x2fabd8);if(_0x1b5650[_0x00a8('0x2f')][_0x00a8('0x39')]){_0x1258a4['where']=_['merge'](_0x1258a4['where'],{'$or':_['map'](_0x2fabd8,function(_0x409029){if(_0x409029[_0x00a8('0x2c')]!=='VIRTUAL'){var _0x28bce0={};_0x28bce0[_0x409029['name']]={'$like':'%'+_0x1b5650['query'][_0x00a8('0x39')]+'%'};return _0x28bce0;}})});}_0x1258a4=_[_0x00a8('0x3a')]({},_0x1258a4,_0x1b5650[_0x00a8('0x3b')]);var _0x364e50={'where':_0x1258a4[_0x00a8('0x36')]};return db[_0x00a8('0x3c')][_0x00a8('0x3d')](_0x364e50)[_0x00a8('0x23')](function(_0x19f03c){_0x24f299[_0x00a8('0x3d')]=_0x19f03c;if(_0x1b5650[_0x00a8('0x2f')][_0x00a8('0x3e')]){_0x1258a4[_0x00a8('0x3f')]=[{'all':!![]}];}return db['VoiceRecording'][_0x00a8('0x40')](_0x1258a4);})[_0x00a8('0x23')](function(_0x43512c){_0x24f299[_0x00a8('0x41')]=_0x43512c;return _0x24f299;})['then'](respondWithFilteredResult(_0x464a7e,_0x1258a4))[_0x00a8('0x42')](handleError(_0x464a7e,null));};exports['show']=function(_0x57159b,_0x47ff7a){var _0x32de7b={'raw':![],'where':{'id':_0x57159b[_0x00a8('0x43')]['id']}},_0x505a43={};_0x505a43[_0x00a8('0x2d')]=_['keys'](db['VoiceRecording']['rawAttributes']);_0x505a43[_0x00a8('0x2f')]=_[_0x00a8('0x30')](_0x57159b[_0x00a8('0x2f')]);_0x505a43['filters']=_[_0x00a8('0x31')](_0x505a43[_0x00a8('0x2d')],_0x505a43[_0x00a8('0x2f')]);_0x32de7b[_0x00a8('0x32')]=_['intersection'](_0x505a43[_0x00a8('0x2d')],qs[_0x00a8('0x44')](_0x57159b[_0x00a8('0x2f')][_0x00a8('0x44')]));_0x32de7b[_0x00a8('0x32')]=_0x32de7b[_0x00a8('0x32')]['length']?_0x32de7b[_0x00a8('0x32')]:_0x505a43[_0x00a8('0x2d')];if(_0x57159b[_0x00a8('0x2f')][_0x00a8('0x3e')]){_0x32de7b['include']=[{'all':!![]}];}_0x32de7b=_['merge']({},_0x32de7b,_0x57159b[_0x00a8('0x3b')]);return db[_0x00a8('0x3c')][_0x00a8('0x45')](_0x32de7b)[_0x00a8('0x23')](handleEntityNotFound(_0x47ff7a,null))[_0x00a8('0x23')](respondWithResult(_0x47ff7a,null))[_0x00a8('0x42')](handleError(_0x47ff7a,null));};exports[_0x00a8('0x46')]=function(_0x4f7e7f,_0x193ee1){return db[_0x00a8('0x3c')][_0x00a8('0x46')](_0x4f7e7f['body'],{})[_0x00a8('0x23')](respondWithResult(_0x193ee1,0xc9))[_0x00a8('0x42')](handleError(_0x193ee1,null));};exports[_0x00a8('0x22')]=function(_0x3b41fd,_0xc795a7){if(_0x3b41fd[_0x00a8('0x47')]['id']){delete _0x3b41fd[_0x00a8('0x47')]['id'];}return db[_0x00a8('0x3c')][_0x00a8('0x45')]({'where':{'id':_0x3b41fd[_0x00a8('0x43')]['id']}})[_0x00a8('0x23')](handleEntityNotFound(_0xc795a7,null))[_0x00a8('0x23')](saveUpdates(_0x3b41fd[_0x00a8('0x47')],null))[_0x00a8('0x23')](respondWithResult(_0xc795a7,null))[_0x00a8('0x42')](handleError(_0xc795a7,null));};exports[_0x00a8('0x48')]=function(_0x9229d3,_0x122e55){return db[_0x00a8('0x3c')][_0x00a8('0x48')]()[_0x00a8('0x23')](respondWithResult(_0x122e55,null))[_0x00a8('0x42')](handleError(_0x122e55,null));};exports['download']=function(_0x3dd26f,_0x4b7d25,_0x19c063){var _0x1ef8f7=require(_0x00a8('0x49'));var _0x154233=![];var _0x356954={};if(_0x3dd26f[_0x00a8('0x2f')][_0x00a8('0x2c')]&&_0x3dd26f['query'][_0x00a8('0x2c')]==='uniqueid'){_0x356954[_0x00a8('0x4a')]=_0x3dd26f[_0x00a8('0x43')]['id'];}else{_0x356954['id']=_0x3dd26f[_0x00a8('0x43')]['id'];}return db[_0x00a8('0x3c')][_0x00a8('0x45')]({'where':_0x356954,'attributes':['id','value'],'raw':!![]})[_0x00a8('0x23')](handleEntityNotFound(_0x4b7d25,null))[_0x00a8('0x23')](function(_0x24bcbe){if(_0x24bcbe){var _0x19d148=_0x24bcbe[_0x00a8('0x4b')];var _0x18bc5d=util[_0x00a8('0x4c')](_0x00a8('0x4d'),_0x19d148);if(fs[_0x00a8('0x4e')](_0x18bc5d)){_0x154233=!![];return _0x1ef8f7[_0x00a8('0x4f')](_0x18bc5d,_0x19d148,config['secrets']['recording'])[_0x00a8('0x23')](function(){return _0x24bcbe;});}return _0x24bcbe;}})[_0x00a8('0x23')](function(_0x11ffa9){if(_0x11ffa9){var _0x1c7b02=_0x11ffa9[_0x00a8('0x4b')];if(!fs[_0x00a8('0x4e')](_0x1c7b02)){throw new db[(_0x00a8('0x50'))]['ValidationError']('VoiceRecording\x20not\x20found');}if(_0x11ffa9[_0x00a8('0x51')]){return _0x4b7d25['download'](_0x1c7b02,_0x11ffa9[_0x00a8('0x51')]+path[_0x00a8('0x52')](_0x1c7b02),function(){if(_0x154233){fs[_0x00a8('0x53')](_0x1c7b02);}});}else{return _0x4b7d25[_0x00a8('0x54')](_0x1c7b02,function(_0xc2cf9b){if(_0x154233){fs[_0x00a8('0x53')](_0x1c7b02);}});}}})[_0x00a8('0x42')](function(_0xcc7f00){if(_0xcc7f00[_0x00a8('0x55')]==='VoiceRecording\x20not\x20found'){_0x4b7d25[_0x00a8('0x1a')](0x194)[_0x00a8('0x28')](_0x00a8('0x56'));}else{return handleError(_0x4b7d25,null);}});};exports[_0x00a8('0x57')]=function(_0x2d1d97,_0xf96658,_0x58ce7f){var _0xfb9169=require(_0x00a8('0x49'));var _0x432e09=![];var _0x33c1d3={'$and':[db[_0x00a8('0x58')][_0x00a8('0x36')](db[_0x00a8('0x58')]['fn'](_0x00a8('0x59'),db[_0x00a8('0x58')]['col']('uniqueid')),_0x2d1d97['query']['token'])]};if(_0x2d1d97[_0x00a8('0x2f')]['type']&&_0x2d1d97[_0x00a8('0x2f')]['type']===_0x00a8('0x4a')){_0x33c1d3[_0x00a8('0x5a')]['push']({'uniqueid':_0x2d1d97['params']['id']});}else{_0x33c1d3[_0x00a8('0x5a')]['push']({'id':_0x2d1d97[_0x00a8('0x43')]['id']});}return db[_0x00a8('0x3c')][_0x00a8('0x45')]({'where':_0x33c1d3,'attributes':['id',_0x00a8('0x4b')],'raw':!![]})[_0x00a8('0x23')](handleEntityNotFound(_0xf96658,null))['then'](function(_0x33eb9a){if(_0x33eb9a){var _0x560154=util[_0x00a8('0x4c')](_0x00a8('0x4d'),_0x33eb9a[_0x00a8('0x4b')]);if(fs[_0x00a8('0x4e')](_0x560154)){_0x432e09=!![];return _0xfb9169['decryptFile'](_0x560154,_0x33eb9a['value'],config[_0x00a8('0x5b')][_0x00a8('0x5c')])['then'](function(){return _0x33eb9a;});}return _0x33eb9a;}})[_0x00a8('0x23')](function(_0x812bb8){if(_0x812bb8){if(!fs[_0x00a8('0x4e')](_0x812bb8[_0x00a8('0x4b')])){throw new db[(_0x00a8('0x50'))][(_0x00a8('0x5d'))](_0x00a8('0x5e'));}if(_0x812bb8['filename']){return _0xf96658[_0x00a8('0x54')](_0x812bb8[_0x00a8('0x4b')],_0x812bb8[_0x00a8('0x51')]+path['extname'](_0x812bb8['value']),function(){if(_0x432e09){fs[_0x00a8('0x53')](_0x812bb8[_0x00a8('0x4b')]);}});}else{return _0xf96658[_0x00a8('0x54')](_0x812bb8[_0x00a8('0x4b')],function(_0x374ffd){if(_0x432e09){fs[_0x00a8('0x53')](_0x812bb8[_0x00a8('0x4b')]);}});}}})[_0x00a8('0x42')](handleError(_0xf96658,null));};exports[_0x00a8('0x5f')]=function(_0x213c93,_0xbc8ed9){return db['VoiceRecording'][_0x00a8('0x45')]({'where':{'id':_0x213c93[_0x00a8('0x43')]['id']}})[_0x00a8('0x23')](function(_0x381120){if(!_0x381120)throw new ReferenceError('Entity\x20not\x20found');return _0x381120;})[_0x00a8('0x23')](function(_0x518646){var _0x14e90a=_0x518646[_0x00a8('0x4b')];logger['info']('cancellazione\x20fisica\x20documento\x20%s',_0x14e90a);if(!_[_0x00a8('0x60')](_0x518646[_0x00a8('0x4b')])&&fs[_0x00a8('0x4e')](_0x14e90a)){logger[_0x00a8('0x61')](_0x00a8('0x62')+_0x14e90a+_0x00a8('0x63'));fs[_0x00a8('0x64')](_0x14e90a);}_0x14e90a=_0x14e90a+_0x00a8('0x65');if(!_[_0x00a8('0x60')](_0x518646[_0x00a8('0x4b')])&&fs[_0x00a8('0x4e')](_0x14e90a)){logger['info'](_0x00a8('0x62')+_0x14e90a+_0x00a8('0x63'));fs[_0x00a8('0x64')](_0x14e90a);}return _0x518646;})['then'](function(_0xa48f80){if(!_0xa48f80)throw new InternalError();return _0xa48f80[_0x00a8('0x5f')]();})[_0x00a8('0x23')](function(){_0xbc8ed9[_0x00a8('0x1a')](0xcc)['end']();})[_0x00a8('0x42')](handleError(_0xbc8ed9,null));};function getBucketslist(_0x511f8b,_0x87596f,_0x29ebe5){return new Promise(function(_0x3923e3,_0x543684){var _0x5ea0fd=new AWS['S3']({'accessKeyId':_0x87596f,'secretAccessKey':_0x511f8b,'region':_0x29ebe5});_0x5ea0fd['listBuckets']({},function(_0x565985,_0x396db3){if(_0x565985){return _0x543684(_0x565985);}else{return _0x3923e3(_0x396db3);}});});}function createBucket(_0x482263,_0x50f4e3,_0x102159,_0x1861a3){return new Promise(function(_0x5e330f,_0x127569){var _0x1a7121=new AWS['S3']({'accessKeyId':_0x50f4e3,'secretAccessKey':_0x482263,'region':_0x102159});_0x1a7121[_0x00a8('0x66')]({'Bucket':_0x1861a3},function(_0x4aeaf7,_0x2271b1){if(_0x4aeaf7){return _0x127569(_0x4aeaf7);}else{return _0x5e330f(_0x2271b1);}});});}function uploadFile(_0x4a5b27,_0x461a03,_0xbce02b,_0x32071c,_0x2e37fd,_0x504ebc){return new Promise(function(_0x1f71f1,_0x36ed75){var _0x31e69c=new AWS['S3']({'accessKeyId':_0x461a03,'secretAccessKey':_0x4a5b27,'region':_0xbce02b});_0x31e69c[_0x00a8('0x67')]({'Bucket':_0x32071c,'Key':_0x2e37fd,'Body':_0x504ebc},function(_0x2b4e30,_0x47e880){if(_0x2b4e30){return _0x36ed75(_0x2b4e30);}else{return _0x1f71f1(_0x47e880);}});});}function startTranscribe(_0x4a0ef7,_0x4bc003,_0x134fca,_0x21099f,_0x14a9c1,_0x38ee54){return new Promise(function(_0x188ef7,_0x29ba9d){var _0x284359=new AWS[(_0x00a8('0x68'))]({'accessKeyId':_0x4bc003,'secretAccessKey':_0x4a0ef7,'region':_0x134fca});_0x284359['startTranscriptionJob']({'TranscriptionJobName':_0x21099f,'LanguageCode':_0x14a9c1,'Media':{'MediaFileUri':_0x38ee54}},function(_0x1bcb08,_0x2ec090){if(_0x1bcb08){return _0x29ba9d(_0x1bcb08);}else{return _0x188ef7(_0x2ec090);}});});}function transcribe(_0x353902,_0x44ab61,_0x2088ea,_0x68203a,_0x1d0fcc,_0x4e67cc,_0x1a0e1c){return new Promise(function(_0x47e5e3,_0x281d54){var _0x57ca4a={};logger[_0x00a8('0x61')](util[_0x00a8('0x4c')](_0x00a8('0x69'),_0x353902,_0x1d0fcc));return uploadFile(_0x44ab61,_0x2088ea,_0x68203a,_0x1d0fcc,path[_0x00a8('0x6a')](_0x4e67cc),fs['readFileSync'](_0x4e67cc))[_0x00a8('0x23')](function(_0x185369){logger[_0x00a8('0x61')](util['format']('[RUNTRANSCRIPT][%d]\x20Voice\x20recording\x20uploaded\x20in\x20bucket\x20%s\x20(%s)',_0x353902,_0x1d0fcc,_0x185369[_0x00a8('0x6b')]));_0x57ca4a[_0x00a8('0x6c')]=_0x185369[_0x00a8('0x6d')];_0x57ca4a[_0x00a8('0x6e')]=_0x185369[_0x00a8('0x6b')];logger[_0x00a8('0x61')](util[_0x00a8('0x4c')](_0x00a8('0x6f'),_0x353902));return startTranscribe(_0x44ab61,_0x2088ea,_0x68203a,uuidv4(),_0x1a0e1c,_0x185369['Location']);})[_0x00a8('0x23')](function(_0x20d045){logger[_0x00a8('0x61')](util[_0x00a8('0x4c')](_0x00a8('0x70'),_0x353902,_0x20d045[_0x00a8('0x71')][_0x00a8('0x72')]));_0x57ca4a[_0x00a8('0x73')]=_0x20d045[_0x00a8('0x71')][_0x00a8('0x72')];_0x57ca4a[_0x00a8('0x74')]=_0x20d045[_0x00a8('0x71')][_0x00a8('0x75')];return _0x47e5e3(_0x57ca4a);})[_0x00a8('0x42')](function(_0x3b4311){return _0x281d54(_0x3b4311);});});}exports['runTranscribe']=function(_0x11b555,_0x5069b2,_0x36bd0e){var _0x1995eb;var _0x579392;var _0x895ab4;var _0x189082=require(_0x00a8('0x49'));return db['VoiceRecording'][_0x00a8('0x76')]({'where':{'id':_0x11b555['params']['id']}})[_0x00a8('0x23')](function(_0x323ca3){if(_0x323ca3){var _0x56f70d=util['format'](_0x00a8('0x4d'),_0x323ca3[_0x00a8('0x4b')]);if(fs[_0x00a8('0x4e')](_0x56f70d)){cypher=!![];return _0x189082[_0x00a8('0x4f')](_0x56f70d,_0x323ca3[_0x00a8('0x4b')],config[_0x00a8('0x5b')]['recording'])['then'](function(){return _0x323ca3;});}return _0x323ca3;}})[_0x00a8('0x23')](function(_0x5be782){if(!_0x5be782){throw new db[(_0x00a8('0x50'))][(_0x00a8('0x5d'))](_0x00a8('0x77'));}_0x579392=_0x5be782;return db[_0x00a8('0x78')][_0x00a8('0x76')]({'where':{'id':0x1}});})[_0x00a8('0x23')](handleEntityNotFound(_0x5069b2,null))[_0x00a8('0x23')](function(_0x46f025){if(_0x46f025){_0x1995eb=_0x46f025;if(!_0x1995eb[_0x00a8('0x79')]||!_0x1995eb[_0x00a8('0x7a')]||!_0x1995eb[_0x00a8('0x7b')]||!_0x1995eb[_0x00a8('0x7c')]||!_0x1995eb[_0x00a8('0x6c')]){throw new db['Sequelize'][(_0x00a8('0x5d'))]('Transcribe\x20not\x20configured');}if(_0x11b555[_0x00a8('0x47')][_0x00a8('0x7d')]&&(!_0x1995eb[_0x00a8('0x7e')]||!_0x1995eb[_0x00a8('0x7f')]||!_0x1995eb[_0x00a8('0x80')]||!_0x1995eb['language']||!_0x1995eb[_0x00a8('0x6c')])){throw new db[(_0x00a8('0x50'))]['ValidationError'](_0x00a8('0x81'));}return db['CloudProvider']['findOne']({'where':{'id':_0x1995eb[_0x00a8('0x7a')]}});}})[_0x00a8('0x23')](function(_0x4ee225){if(!_0x4ee225){throw new db[(_0x00a8('0x50'))][(_0x00a8('0x5d'))](_0x00a8('0x82'));}if(!_0x4ee225[_0x00a8('0x83')]||!_0x4ee225[_0x00a8('0x84')]){throw new db[(_0x00a8('0x50'))][(_0x00a8('0x5d'))]('Cloud\x20Provider\x20not\x20configured');}_0x895ab4=_0x4ee225;return getBucketslist(_0x895ab4['data1'],_0x895ab4[_0x00a8('0x84')],_0x1995eb[_0x00a8('0x7b')]);})[_0x00a8('0x23')](function(_0x118f6d){if(_0x118f6d&&_0x118f6d[_0x00a8('0x85')]){var _0x5ac2f9=_[_0x00a8('0x45')](_0x118f6d[_0x00a8('0x85')],function(_0x125f4b){return _0x125f4b['Name']===_0x1995eb['bucket'];});if(!_0x5ac2f9){logger[_0x00a8('0x61')](util[_0x00a8('0x4c')](_0x00a8('0x86'),_0x11b555[_0x00a8('0x43')]['id'],_0x1995eb[_0x00a8('0x6c')]));return createBucket(_0x895ab4[_0x00a8('0x83')],_0x895ab4['data2'],_0x1995eb[_0x00a8('0x7b')],_0x1995eb[_0x00a8('0x6c')]);}logger[_0x00a8('0x61')](util[_0x00a8('0x4c')](_0x00a8('0x87'),_0x11b555['params']['id'],_0x1995eb['bucket']));return;}})[_0x00a8('0x23')](function(_0x1b5101){if(_0x579392[_0x00a8('0x74')]===_0x00a8('0x88')){return transcribe(_0x11b555[_0x00a8('0x43')]['id'],_0x895ab4[_0x00a8('0x83')],_0x895ab4[_0x00a8('0x84')],_0x1995eb['transcribeRegion'],_0x1995eb['bucket'],_0x579392[_0x00a8('0x4b')],_0x1995eb[_0x00a8('0x7c')]);}else{logger['info'](util['format'](_0x00a8('0x89'),_0x11b555[_0x00a8('0x43')]['id']));return{'transcribeStatus':'IN_PROGRESS'};}})[_0x00a8('0x23')](function(_0x458bfa){if(_0x458bfa){_0x458bfa[_0x00a8('0x8a')]=_0x11b555[_0x00a8('0x47')][_0x00a8('0x7d')];return _0x579392[_0x00a8('0x8b')](_0x458bfa);}})['then'](respondWithResult(_0x5069b2,null))[_0x00a8('0x42')](handleError(_0x5069b2,null));};function writeFile(_0x53706e,_0x42fba5){return new Promise(function(_0x53066f,_0x29000d){fs[_0x00a8('0x8c')](_0x42fba5,_0x53706e,function(_0x265d26,_0x440258){if(_0x265d26){return _0x29000d(_0x265d26);}else{return _0x53066f(_0x440258);}});});}exports['downloadTranscribe']=function(_0x561e8b,_0x3f57f6,_0x5f2cb7){return db[_0x00a8('0x3c')][_0x00a8('0x76')]({'where':{'id':_0x561e8b[_0x00a8('0x43')]['id']}})['then'](handleEntityNotFound(_0x3f57f6))[_0x00a8('0x23')](function(_0x127dc1){if(_0x127dc1&&_0x127dc1['fileText']){var _0x3d5f39=_0x127dc1[_0x00a8('0x8d')];var _0x2ff7d9=config[_0x00a8('0x8e')]+_0x00a8('0x8f')+_0x127dc1['id']+_0x00a8('0x90');if(fs[_0x00a8('0x4e')](_0x2ff7d9)){return _0x2ff7d9;}return writeFile(_0x3d5f39,_0x2ff7d9)[_0x00a8('0x23')](function(){return _0x2ff7d9;});}else{throw new db[(_0x00a8('0x50'))]['ValidationError']('Transcript\x20not\x20available');}})[_0x00a8('0x23')](function(_0x343b55){return _0x3f57f6[_0x00a8('0x54')](_0x343b55);})[_0x00a8('0x42')](handleError(_0x3f57f6));};
\ No newline at end of file
diff --git a/server/api/voiceRecording/voiceRecording.model.js b/server/api/voiceRecording/voiceRecording.model.js
index 903b97f..a5c2a9f 100644
--- a/server/api/voiceRecording/voiceRecording.model.js
+++ b/server/api/voiceRecording/voiceRecording.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x6363=['../../config/environment','./voiceRecording.attributes','exports','define','VoiceRecording','uniqueid','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x240035,_0x2a0a1c){var _0x34748b=function(_0x3621d9){while(--_0x3621d9){_0x240035['push'](_0x240035['shift']());}};_0x34748b(++_0x2a0a1c);}(_0x6363,0x13a));var _0x3636=function(_0x29a186,_0x1fc951){_0x29a186=_0x29a186-0x0;var _0x5ab930=_0x6363[_0x29a186];return _0x5ab930;};'use strict';var _=require(_0x3636('0x0'));var util=require('util');var logger=require(_0x3636('0x1'))(_0x3636('0x2'));var moment=require(_0x3636('0x3'));var BPromise=require(_0x3636('0x4'));var rp=require(_0x3636('0x5'));var fs=require('fs');var path=require(_0x3636('0x6'));var rimraf=require(_0x3636('0x7'));var config=require(_0x3636('0x8'));var attributes=require(_0x3636('0x9'));module[_0x3636('0xa')]=function(_0x15728f,_0x1f94ef){return _0x15728f[_0x3636('0xb')](_0x3636('0xc'),attributes,{'tableName':'voice_recordings','paranoid':![],'indexes':[{'name':_0x3636('0xd'),'fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
+var _0x3831=['voice_recordings','uniqueid','lodash','../../config/logger','api','moment','bluebird','request-promise','rimraf','./voiceRecording.attributes','define'];(function(_0x503655,_0x1acb64){var _0x10defb=function(_0x34fa0d){while(--_0x34fa0d){_0x503655['push'](_0x503655['shift']());}};_0x10defb(++_0x1acb64);}(_0x3831,0x14c));var _0x1383=function(_0x36bbbb,_0x3f6709){_0x36bbbb=_0x36bbbb-0x0;var _0x3ca0eb=_0x3831[_0x36bbbb];return _0x3ca0eb;};'use strict';var _=require(_0x1383('0x0'));var util=require('util');var logger=require(_0x1383('0x1'))(_0x1383('0x2'));var moment=require(_0x1383('0x3'));var BPromise=require(_0x1383('0x4'));var rp=require(_0x1383('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x1383('0x6'));var config=require('../../config/environment');var attributes=require(_0x1383('0x7'));module['exports']=function(_0x5b64b1,_0x5eb4d8){return _0x5b64b1[_0x1383('0x8')]('VoiceRecording',attributes,{'tableName':_0x1383('0x9'),'paranoid':![],'indexes':[{'name':_0x1383('0xa'),'fields':[_0x1383('0xa')]}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/voiceRecording/voiceRecording.rpc.js b/server/api/voiceRecording/voiceRecording.rpc.js
index ddb7f75..2afcb68 100644
--- a/server/api/voiceRecording/voiceRecording.rpc.js
+++ b/server/api/voiceRecording/voiceRecording.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xa9e0=['findOne','callRecordingEncryption','create','existsSync','value','%s.cypher','encryptFile','secrets','recording','unlink','CreateVoiceRecording\x20file\x20encrypted','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','VoiceRecording,\x20%s,\x20%s','request\x20sent','debug','VoiceRecording,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','VoiceRecording','update','body','options','raw','then','UpdateVoiceRecording','stringify','CreateVoiceRecording'];(function(_0x25cb87,_0xc2d352){var _0x3a7537=function(_0x53516a){while(--_0x53516a){_0x25cb87['push'](_0x25cb87['shift']());}};_0x3a7537(++_0xc2d352);}(_0xa9e0,0x123));var _0x0a9e=function(_0x134c2e,_0x3573c4){_0x134c2e=_0x134c2e-0x0;var _0x2825db=_0xa9e0[_0x134c2e];return _0x2825db;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});}exports['UpdateVoiceRecording']=function(_0x459eb1){var _0x478723=this;return new Promise(function(_0x106033,_0x205fd6){return db[_0x0a9e('0x14')][_0x0a9e('0x15')](_0x459eb1[_0x0a9e('0x16')],{'raw':_0x459eb1[_0x0a9e('0x17')]?_0x459eb1[_0x0a9e('0x17')][_0x0a9e('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x459eb1[_0x0a9e('0x17')]?_0x459eb1[_0x0a9e('0x17')]['where']||null:null,'attributes':_0x459eb1[_0x0a9e('0x17')]?_0x459eb1[_0x0a9e('0x17')]['attributes']||null:null,'limit':_0x459eb1[_0x0a9e('0x17')]?_0x459eb1['options']['limit']||null:null})[_0x0a9e('0x19')](function(_0x432e56){logger[_0x0a9e('0xa')](_0x0a9e('0x1a'),_0x459eb1);logger['debug'](_0x0a9e('0x1a'),_0x459eb1,JSON[_0x0a9e('0x1b')](_0x432e56));_0x106033(_0x432e56);})[_0x0a9e('0x13')](function(_0x4d00e6){logger[_0x0a9e('0x10')](_0x0a9e('0x1a'),_0x4d00e6[_0x0a9e('0x11')],_0x459eb1);_0x205fd6(_0x478723['error'](0x1f4,_0x4d00e6['message']));});});};exports[_0x0a9e('0x1c')]=function(_0x3a8e58){var _0x40c424=this;return new Promise(function(_0x33161b,_0x526cf3){var _0x384319=require('../../components/encryptor');var _0x45a1e7;return db['Setting'][_0x0a9e('0x1d')]({'attributes':['id',_0x0a9e('0x1e')],'where':{'id':0x1},'raw':!![]})[_0x0a9e('0x19')](function(_0x14433c){_0x45a1e7=_0x14433c;return db[_0x0a9e('0x14')][_0x0a9e('0x1f')](_0x3a8e58[_0x0a9e('0x16')]);})[_0x0a9e('0x19')](function(_0x5a101a){if(_0x45a1e7[_0x0a9e('0x1e')]&&fs[_0x0a9e('0x20')](_0x5a101a[_0x0a9e('0x21')])){var _0x2ec755=util['format'](_0x0a9e('0x22'),_0x5a101a[_0x0a9e('0x21')]);return _0x384319[_0x0a9e('0x23')](_0x5a101a[_0x0a9e('0x21')],_0x2ec755,config[_0x0a9e('0x24')][_0x0a9e('0x25')])[_0x0a9e('0x19')](function(){fs[_0x0a9e('0x26')](_0x5a101a[_0x0a9e('0x21')]);logger['info'](_0x0a9e('0x27'));return _0x5a101a;});}return _0x5a101a;})['then'](function(_0x2407f9){logger[_0x0a9e('0xa')](_0x0a9e('0x1c'),_0x3a8e58);logger[_0x0a9e('0xd')](_0x0a9e('0x1c'),_0x3a8e58,JSON['stringify'](_0x2407f9));_0x33161b(_0x2407f9);})[_0x0a9e('0x13')](function(_0x46f0a5){logger[_0x0a9e('0x10')](_0x0a9e('0x1c'),_0x46f0a5[_0x0a9e('0x11')],_0x3a8e58);_0x526cf3(_0x40c424[_0x0a9e('0x10')](0x1f4,_0x46f0a5[_0x0a9e('0x11')]));});});};
\ No newline at end of file
+var _0xa9e0=['findOne','callRecordingEncryption','create','existsSync','value','%s.cypher','encryptFile','secrets','recording','unlink','CreateVoiceRecording\x20file\x20encrypted','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','VoiceRecording,\x20%s,\x20%s','request\x20sent','debug','VoiceRecording,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','VoiceRecording','update','body','options','raw','then','UpdateVoiceRecording','stringify','CreateVoiceRecording'];(function(_0x23d7fd,_0x16d5b1){var _0x475743=function(_0x32a188){while(--_0x32a188){_0x23d7fd['push'](_0x23d7fd['shift']());}};_0x475743(++_0x16d5b1);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3a6efd,_0x2a5102){_0x3a6efd=_0x3a6efd-0x0;var _0x487b9a=_0xa9e0[_0x3a6efd];return _0x487b9a;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});}exports['UpdateVoiceRecording']=function(_0x459eb1){var _0x478723=this;return new Promise(function(_0x106033,_0x205fd6){return db[_0x0a9e('0x14')][_0x0a9e('0x15')](_0x459eb1[_0x0a9e('0x16')],{'raw':_0x459eb1[_0x0a9e('0x17')]?_0x459eb1[_0x0a9e('0x17')][_0x0a9e('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x459eb1[_0x0a9e('0x17')]?_0x459eb1[_0x0a9e('0x17')]['where']||null:null,'attributes':_0x459eb1[_0x0a9e('0x17')]?_0x459eb1[_0x0a9e('0x17')]['attributes']||null:null,'limit':_0x459eb1[_0x0a9e('0x17')]?_0x459eb1['options']['limit']||null:null})[_0x0a9e('0x19')](function(_0x432e56){logger[_0x0a9e('0xa')](_0x0a9e('0x1a'),_0x459eb1);logger['debug'](_0x0a9e('0x1a'),_0x459eb1,JSON[_0x0a9e('0x1b')](_0x432e56));_0x106033(_0x432e56);})[_0x0a9e('0x13')](function(_0x4d00e6){logger[_0x0a9e('0x10')](_0x0a9e('0x1a'),_0x4d00e6[_0x0a9e('0x11')],_0x459eb1);_0x205fd6(_0x478723['error'](0x1f4,_0x4d00e6['message']));});});};exports[_0x0a9e('0x1c')]=function(_0x3a8e58){var _0x40c424=this;return new Promise(function(_0x33161b,_0x526cf3){var _0x384319=require('../../components/encryptor');var _0x45a1e7;return db['Setting'][_0x0a9e('0x1d')]({'attributes':['id',_0x0a9e('0x1e')],'where':{'id':0x1},'raw':!![]})[_0x0a9e('0x19')](function(_0x14433c){_0x45a1e7=_0x14433c;return db[_0x0a9e('0x14')][_0x0a9e('0x1f')](_0x3a8e58[_0x0a9e('0x16')]);})[_0x0a9e('0x19')](function(_0x5a101a){if(_0x45a1e7[_0x0a9e('0x1e')]&&fs[_0x0a9e('0x20')](_0x5a101a[_0x0a9e('0x21')])){var _0x2ec755=util['format'](_0x0a9e('0x22'),_0x5a101a[_0x0a9e('0x21')]);return _0x384319[_0x0a9e('0x23')](_0x5a101a[_0x0a9e('0x21')],_0x2ec755,config[_0x0a9e('0x24')][_0x0a9e('0x25')])[_0x0a9e('0x19')](function(){fs[_0x0a9e('0x26')](_0x5a101a[_0x0a9e('0x21')]);logger['info'](_0x0a9e('0x27'));return _0x5a101a;});}return _0x5a101a;})['then'](function(_0x2407f9){logger[_0x0a9e('0xa')](_0x0a9e('0x1c'),_0x3a8e58);logger[_0x0a9e('0xd')](_0x0a9e('0x1c'),_0x3a8e58,JSON['stringify'](_0x2407f9));_0x33161b(_0x2407f9);})[_0x0a9e('0x13')](function(_0x46f0a5){logger[_0x0a9e('0x10')](_0x0a9e('0x1c'),_0x46f0a5[_0x0a9e('0x11')],_0x3a8e58);_0x526cf3(_0x40c424[_0x0a9e('0x10')](0x1f4,_0x46f0a5[_0x0a9e('0x11')]));});});};
\ No newline at end of file
diff --git a/server/api/voiceTransferReport/index.js b/server/api/voiceTransferReport/index.js
index 6f361ef..921818f 100644
--- a/server/api/voiceTransferReport/index.js
+++ b/server/api/voiceTransferReport/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x5fab=['../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceTransferReport.controller','get','isAuthenticated','index','show','post','create','put','/:id','delete','destroy','exports','multer','util','connect-timeout','express','Router'];(function(_0x2acbc6,_0x502cdb){var _0x41ac1c=function(_0x47afe6){while(--_0x47afe6){_0x2acbc6['push'](_0x2acbc6['shift']());}};_0x41ac1c(++_0x502cdb);}(_0x5fab,0x177));var _0xb5fa=function(_0x3e274d,_0x35f95f){_0x3e274d=_0x3e274d-0x0;var _0x352bf9=_0x5fab[_0x3e274d];return _0x352bf9;};'use strict';var multer=require(_0xb5fa('0x0'));var util=require(_0xb5fa('0x1'));var path=require('path');var timeout=require(_0xb5fa('0x2'));var express=require(_0xb5fa('0x3'));var router=express[_0xb5fa('0x4')]();var auth=require(_0xb5fa('0x5'));var interaction=require(_0xb5fa('0x6'));var config=require(_0xb5fa('0x7'));var controller=require(_0xb5fa('0x8'));router[_0xb5fa('0x9')]('/',auth[_0xb5fa('0xa')](),controller[_0xb5fa('0xb')]);router['get']('/:id',auth[_0xb5fa('0xa')](),controller[_0xb5fa('0xc')]);router[_0xb5fa('0xd')]('/',auth['isAuthenticated'](),controller[_0xb5fa('0xe')]);router[_0xb5fa('0xf')](_0xb5fa('0x10'),auth['isAuthenticated'](),controller['update']);router[_0xb5fa('0x11')](_0xb5fa('0x10'),auth[_0xb5fa('0xa')](),controller[_0xb5fa('0x12')]);module[_0xb5fa('0x13')]=router;
\ No newline at end of file
+var _0xba34=['get','isAuthenticated','index','/:id','show','post','create','put','update','delete','exports','multer','util','path','connect-timeout','express','../../config/environment','./voiceTransferReport.controller'];(function(_0x33570c,_0xd1a4c1){var _0x3929ca=function(_0x45cf90){while(--_0x45cf90){_0x33570c['push'](_0x33570c['shift']());}};_0x3929ca(++_0xd1a4c1);}(_0xba34,0x119));var _0x4ba3=function(_0x25b0d0,_0x2d3ac3){_0x25b0d0=_0x25b0d0-0x0;var _0xf0baf8=_0xba34[_0x25b0d0];return _0xf0baf8;};'use strict';var multer=require(_0x4ba3('0x0'));var util=require(_0x4ba3('0x1'));var path=require(_0x4ba3('0x2'));var timeout=require(_0x4ba3('0x3'));var express=require(_0x4ba3('0x4'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x4ba3('0x5'));var controller=require(_0x4ba3('0x6'));router[_0x4ba3('0x7')]('/',auth[_0x4ba3('0x8')](),controller[_0x4ba3('0x9')]);router[_0x4ba3('0x7')](_0x4ba3('0xa'),auth['isAuthenticated'](),controller[_0x4ba3('0xb')]);router[_0x4ba3('0xc')]('/',auth[_0x4ba3('0x8')](),controller[_0x4ba3('0xd')]);router[_0x4ba3('0xe')](_0x4ba3('0xa'),auth[_0x4ba3('0x8')](),controller[_0x4ba3('0xf')]);router[_0x4ba3('0x10')](_0x4ba3('0xa'),auth[_0x4ba3('0x8')](),controller['destroy']);module[_0x4ba3('0x11')]=router;
\ No newline at end of file
diff --git a/server/api/voiceTransferReport/voiceTransferReport.attributes.js b/server/api/voiceTransferReport/voiceTransferReport.attributes.js
index 295ef8e..bfd81cc 100644
--- a/server/api/voiceTransferReport/voiceTransferReport.attributes.js
+++ b/server/api/voiceTransferReport/voiceTransferReport.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x877a=['blind','STRING','Yes','sequelize','moment','ENUM'];(function(_0x4da90d,_0x115e5f){var _0x20c344=function(_0x3ec973){while(--_0x3ec973){_0x4da90d['push'](_0x4da90d['shift']());}};_0x20c344(++_0x115e5f);}(_0x877a,0xed));var _0xa877=function(_0x50041c,_0x4c7d3c){_0x50041c=_0x50041c-0x0;var _0x77770b=_0x877a[_0x50041c];return _0x77770b;};'use strict';var Sequelize=require(_0xa877('0x0'));var moment=require(_0xa877('0x1'));module['exports']={'type':{'type':Sequelize[_0xa877('0x2')](_0xa877('0x3'),'attended')},'result':{'type':Sequelize[_0xa877('0x4')]},'transfererchannel':{'type':Sequelize[_0xa877('0x4')]},'transferercalleridnum':{'type':Sequelize[_0xa877('0x4')]},'transferercalleridname':{'type':Sequelize[_0xa877('0x4')]},'transfererconnectedlinenum':{'type':Sequelize['STRING']},'transfererconnectedlinename':{'type':Sequelize[_0xa877('0x4')]},'transfereraccountcode':{'type':Sequelize['STRING']},'transferercontext':{'type':Sequelize[_0xa877('0x4')]},'transfererexten':{'type':Sequelize[_0xa877('0x4')]},'transfererlinkedid':{'type':Sequelize[_0xa877('0x4')]},'transfereechannel':{'type':Sequelize[_0xa877('0x4')]},'transfereecalleridnum':{'type':Sequelize[_0xa877('0x4')]},'transfereecalleridname':{'type':Sequelize[_0xa877('0x4')]},'transfereeconnectedlinenum':{'type':Sequelize['STRING']},'transfereeconnectedlinename':{'type':Sequelize[_0xa877('0x4')]},'transfereeaccountcode':{'type':Sequelize['STRING']},'transfereecontext':{'type':Sequelize['STRING']},'transfereeexten':{'type':Sequelize[_0xa877('0x4')]},'transfereelinkedid':{'type':Sequelize['STRING']},'isexternal':{'type':Sequelize[_0xa877('0x2')](_0xa877('0x5'),'No')},'context':{'type':Sequelize['STRING']},'extension':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x6751=['exports','ENUM','attended','STRING','sequelize'];(function(_0x257114,_0x455247){var _0x6185a3=function(_0x57094b){while(--_0x57094b){_0x257114['push'](_0x257114['shift']());}};_0x6185a3(++_0x455247);}(_0x6751,0x18a));var _0x1675=function(_0x1326e3,_0x1c6728){_0x1326e3=_0x1326e3-0x0;var _0x33d5bb=_0x6751[_0x1326e3];return _0x33d5bb;};'use strict';var Sequelize=require(_0x1675('0x0'));var moment=require('moment');module[_0x1675('0x1')]={'type':{'type':Sequelize[_0x1675('0x2')]('blind',_0x1675('0x3'))},'result':{'type':Sequelize[_0x1675('0x4')]},'transfererchannel':{'type':Sequelize[_0x1675('0x4')]},'transferercalleridnum':{'type':Sequelize['STRING']},'transferercalleridname':{'type':Sequelize[_0x1675('0x4')]},'transfererconnectedlinenum':{'type':Sequelize[_0x1675('0x4')]},'transfererconnectedlinename':{'type':Sequelize[_0x1675('0x4')]},'transfereraccountcode':{'type':Sequelize['STRING']},'transferercontext':{'type':Sequelize['STRING']},'transfererexten':{'type':Sequelize[_0x1675('0x4')]},'transfererlinkedid':{'type':Sequelize[_0x1675('0x4')]},'transfereechannel':{'type':Sequelize[_0x1675('0x4')]},'transfereecalleridnum':{'type':Sequelize[_0x1675('0x4')]},'transfereecalleridname':{'type':Sequelize[_0x1675('0x4')]},'transfereeconnectedlinenum':{'type':Sequelize[_0x1675('0x4')]},'transfereeconnectedlinename':{'type':Sequelize[_0x1675('0x4')]},'transfereeaccountcode':{'type':Sequelize[_0x1675('0x4')]},'transfereecontext':{'type':Sequelize['STRING']},'transfereeexten':{'type':Sequelize[_0x1675('0x4')]},'transfereelinkedid':{'type':Sequelize['STRING']},'isexternal':{'type':Sequelize[_0x1675('0x2')]('Yes','No')},'context':{'type':Sequelize['STRING']},'extension':{'type':Sequelize['STRING']}};
\ No newline at end of file
diff --git a/server/api/voiceTransferReport/voiceTransferReport.controller.js b/server/api/voiceTransferReport/voiceTransferReport.controller.js
index e103e43..971e7e4 100644
--- a/server/api/voiceTransferReport/voiceTransferReport.controller.js
+++ b/server/api/voiceTransferReport/voiceTransferReport.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x89a4=['error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','VoiceTransferReport','include','findAll','rows','params','includeAll','find','catch','create','body','update','html-pdf','eml-format','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','json','count','offset','limit','Content-Range','apply','reject','save','then','destroy','end','sendStatus'];(function(_0x454017,_0x4c2948){var _0x22d946=function(_0x3b9da6){while(--_0x3b9da6){_0x454017['push'](_0x454017['shift']());}};_0x22d946(++_0x4c2948);}(_0x89a4,0x157));var _0x489a=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x89a4[_0x321bb2];return _0x9c12ed;};'use strict';var pdf=require(_0x489a('0x0'));var emlformat=require(_0x489a('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x489a('0x2'));var jsonpatch=require(_0x489a('0x3'));var rp=require('request-promise');var moment=require(_0x489a('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x489a('0x5'));var util=require(_0x489a('0x6'));var path=require(_0x489a('0x7'));var sox=require(_0x489a('0x8'));var csv=require(_0x489a('0x9'));var ejs=require(_0x489a('0xa'));var fs=require('fs');var _=require(_0x489a('0xb'));var squel=require(_0x489a('0xc'));var crypto=require(_0x489a('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x489a('0x9'));var querystring=require(_0x489a('0xe'));var Papa=require(_0x489a('0xf'));var Redis=require(_0x489a('0x10'));var authService=require(_0x489a('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x489a('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x489a('0x13'))(_0x489a('0x14'));var utils=require(_0x489a('0x15'));var config=require(_0x489a('0x16'));var db=require(_0x489a('0x17'))['db'];function respondWithStatusCode(_0x1f39c9,_0x24c195){_0x24c195=_0x24c195||0xcc;return function(_0x2af587){if(_0x2af587){return _0x1f39c9['sendStatus'](_0x24c195);}return _0x1f39c9[_0x489a('0x18')](_0x24c195)['end']();};}function respondWithResult(_0x450c79,_0x333b64){_0x333b64=_0x333b64||0xc8;return function(_0x37b0ea){if(_0x37b0ea){return _0x450c79[_0x489a('0x18')](_0x333b64)[_0x489a('0x19')](_0x37b0ea);}};}function respondWithFilteredResult(_0xac2813,_0x5f368f){return function(_0x57e469){if(_0x57e469){var _0x10bf35=_0x57e469[_0x489a('0x1a')],_0x26c806=_0x5f368f['offset'],_0x7a4a6c=_0x5f368f[_0x489a('0x1b')]+_0x5f368f[_0x489a('0x1c')],_0x54f94c;if(_0x7a4a6c>=_0x10bf35){_0x7a4a6c=_0x10bf35;_0x54f94c=0xc8;}else{_0x54f94c=0xce;}_0xac2813[_0x489a('0x18')](_0x54f94c);return _0xac2813['set'](_0x489a('0x1d'),_0x26c806+'-'+_0x7a4a6c+'/'+_0x10bf35)[_0x489a('0x19')](_0x57e469);}return null;};}function patchUpdates(_0x517ec2){return function(_0x196a1b){try{jsonpatch[_0x489a('0x1e')](_0x196a1b,_0x517ec2,!![]);}catch(_0x4020ec){return BPromise[_0x489a('0x1f')](_0x4020ec);}return _0x196a1b[_0x489a('0x20')]();};}function saveUpdates(_0x59ca42,_0x48b816){return function(_0x175490){if(_0x175490){return _0x175490['update'](_0x59ca42)[_0x489a('0x21')](function(_0x4f1978){return _0x4f1978;});}return null;};}function removeEntity(_0x3189d6,_0x3b1062){return function(_0x4d51e7){if(_0x4d51e7){return _0x4d51e7[_0x489a('0x22')]()[_0x489a('0x21')](function(){_0x3189d6['status'](0xcc)[_0x489a('0x23')]();});}};}function handleEntityNotFound(_0xa8d66c,_0x30f9d2){return function(_0x3211c2){if(!_0x3211c2){_0xa8d66c[_0x489a('0x24')](0x194);}return _0x3211c2;};}function handleError(_0x321834,_0x141e98){_0x141e98=_0x141e98||0x1f4;return function(_0x30e043){logger[_0x489a('0x25')](_0x30e043[_0x489a('0x26')]);if(_0x30e043[_0x489a('0x27')]){delete _0x30e043[_0x489a('0x27')];}_0x321834[_0x489a('0x18')](_0x141e98)[_0x489a('0x28')](_0x30e043);};}exports[_0x489a('0x29')]=function(_0x1170bc,_0x5eaac1){var _0x3e4c15={},_0x15f332={},_0x49d191={'count':0x0,'rows':[]};var _0x499afd=_[_0x489a('0x2a')](db['VoiceTransferReport'][_0x489a('0x2b')],function(_0x104ebd){return{'name':_0x104ebd[_0x489a('0x2c')],'type':_0x104ebd[_0x489a('0x2d')][_0x489a('0x2e')]};});_0x15f332[_0x489a('0x2f')]=_[_0x489a('0x2a')](_0x499afd,_0x489a('0x27'));_0x15f332[_0x489a('0x30')]=_[_0x489a('0x31')](_0x1170bc[_0x489a('0x30')]);_0x15f332[_0x489a('0x32')]=_[_0x489a('0x33')](_0x15f332[_0x489a('0x2f')],_0x15f332[_0x489a('0x30')]);_0x3e4c15['attributes']=_[_0x489a('0x33')](_0x15f332[_0x489a('0x2f')],qs[_0x489a('0x34')](_0x1170bc[_0x489a('0x30')][_0x489a('0x34')]));_0x3e4c15[_0x489a('0x35')]=_0x3e4c15[_0x489a('0x35')][_0x489a('0x36')]?_0x3e4c15[_0x489a('0x35')]:_0x15f332[_0x489a('0x2f')];if(!_0x1170bc[_0x489a('0x30')][_0x489a('0x37')](_0x489a('0x38'))){_0x3e4c15[_0x489a('0x1c')]=qs[_0x489a('0x1c')](_0x1170bc[_0x489a('0x30')][_0x489a('0x1c')]);_0x3e4c15[_0x489a('0x1b')]=qs[_0x489a('0x1b')](_0x1170bc[_0x489a('0x30')][_0x489a('0x1b')]);}_0x3e4c15[_0x489a('0x39')]=qs['sort'](_0x1170bc['query'][_0x489a('0x3a')]);_0x3e4c15['where']=qs[_0x489a('0x32')](_[_0x489a('0x3b')](_0x1170bc['query'],_0x15f332['filters']),_0x499afd);if(_0x1170bc['query'][_0x489a('0x3c')]){_0x3e4c15[_0x489a('0x3d')]=_[_0x489a('0x3e')](_0x3e4c15[_0x489a('0x3d')],{'$or':_[_0x489a('0x2a')](_0x499afd,function(_0x2e378e){if(_0x2e378e[_0x489a('0x2d')]!==_0x489a('0x3f')){var _0xce6e3e={};_0xce6e3e[_0x2e378e[_0x489a('0x27')]]={'$like':'%'+_0x1170bc[_0x489a('0x30')][_0x489a('0x3c')]+'%'};return _0xce6e3e;}})});}_0x3e4c15=_['merge']({},_0x3e4c15,_0x1170bc[_0x489a('0x40')]);var _0x4a15c5={'where':_0x3e4c15[_0x489a('0x3d')]};return db[_0x489a('0x41')][_0x489a('0x1a')](_0x4a15c5)[_0x489a('0x21')](function(_0x4b56c5){_0x49d191['count']=_0x4b56c5;if(_0x1170bc[_0x489a('0x30')]['includeAll']){_0x3e4c15[_0x489a('0x42')]=[{'all':!![]}];}return db['VoiceTransferReport'][_0x489a('0x43')](_0x3e4c15);})['then'](function(_0x26f9e9){_0x49d191[_0x489a('0x44')]=_0x26f9e9;return _0x49d191;})[_0x489a('0x21')](respondWithFilteredResult(_0x5eaac1,_0x3e4c15))['catch'](handleError(_0x5eaac1,null));};exports['show']=function(_0x5386e3,_0xcd0625){var _0x82f18={'raw':!![],'where':{'id':_0x5386e3[_0x489a('0x45')]['id']}},_0x1654ff={};_0x1654ff[_0x489a('0x2f')]=_['keys'](db['VoiceTransferReport'][_0x489a('0x2b')]);_0x1654ff[_0x489a('0x30')]=_['keys'](_0x5386e3['query']);_0x1654ff[_0x489a('0x32')]=_[_0x489a('0x33')](_0x1654ff['model'],_0x1654ff[_0x489a('0x30')]);_0x82f18[_0x489a('0x35')]=_[_0x489a('0x33')](_0x1654ff[_0x489a('0x2f')],qs[_0x489a('0x34')](_0x5386e3[_0x489a('0x30')]['fields']));_0x82f18[_0x489a('0x35')]=_0x82f18[_0x489a('0x35')]['length']?_0x82f18[_0x489a('0x35')]:_0x1654ff[_0x489a('0x2f')];if(_0x5386e3[_0x489a('0x30')][_0x489a('0x46')]){_0x82f18[_0x489a('0x42')]=[{'all':!![]}];}_0x82f18=_[_0x489a('0x3e')]({},_0x82f18,_0x5386e3[_0x489a('0x40')]);return db[_0x489a('0x41')][_0x489a('0x47')](_0x82f18)[_0x489a('0x21')](handleEntityNotFound(_0xcd0625,null))[_0x489a('0x21')](respondWithResult(_0xcd0625,null))[_0x489a('0x48')](handleError(_0xcd0625,null));};exports[_0x489a('0x49')]=function(_0xc131a3,_0x2d4c2a){return db[_0x489a('0x41')]['create'](_0xc131a3[_0x489a('0x4a')],{})[_0x489a('0x21')](respondWithResult(_0x2d4c2a,0xc9))[_0x489a('0x48')](handleError(_0x2d4c2a,null));};exports[_0x489a('0x4b')]=function(_0x4fadd3,_0x60b12){if(_0x4fadd3[_0x489a('0x4a')]['id']){delete _0x4fadd3['body']['id'];}return db[_0x489a('0x41')][_0x489a('0x47')]({'where':{'id':_0x4fadd3[_0x489a('0x45')]['id']}})[_0x489a('0x21')](handleEntityNotFound(_0x60b12,null))[_0x489a('0x21')](saveUpdates(_0x4fadd3[_0x489a('0x4a')],null))[_0x489a('0x21')](respondWithResult(_0x60b12,null))[_0x489a('0x48')](handleError(_0x60b12,null));};exports[_0x489a('0x22')]=function(_0x589a33,_0xdfa8bf){return db[_0x489a('0x41')][_0x489a('0x47')]({'where':{'id':_0x589a33[_0x489a('0x45')]['id']}})['then'](handleEntityNotFound(_0xdfa8bf,null))[_0x489a('0x21')](removeEntity(_0xdfa8bf,null))['catch'](handleError(_0xdfa8bf,null));};
\ No newline at end of file
+var _0xaf5e=['count','findAll','rows','catch','show','params','keys','includeAll','include','find','create','body','eml-format','rimraf','fast-json-patch','request-promise','moment','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','end','status','json','offset','limit','set','Content-Range','apply','save','update','then','destroy','error','stack','name','send','index','rawAttributes','type','key','model','query','filters','intersection','attributes','fields','length','order','sort','where','pick','merge','map','VIRTUAL','options','VoiceTransferReport'];(function(_0x1d97bc,_0x55d0c6){var _0x56c55e=function(_0x201976){while(--_0x201976){_0x1d97bc['push'](_0x1d97bc['shift']());}};_0x56c55e(++_0x55d0c6);}(_0xaf5e,0xa0));var _0xeaf5=function(_0x125071,_0x51fd2f){_0x125071=_0x125071-0x0;var _0x28e550=_0xaf5e[_0x125071];return _0x28e550;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xeaf5('0x0'));var rimraf=require(_0xeaf5('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xeaf5('0x2'));var rp=require(_0xeaf5('0x3'));var moment=require(_0xeaf5('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xeaf5('0x5'));var path=require(_0xeaf5('0x6'));var sox=require(_0xeaf5('0x7'));var csv=require(_0xeaf5('0x8'));var ejs=require(_0xeaf5('0x9'));var fs=require('fs');var _=require(_0xeaf5('0xa'));var squel=require(_0xeaf5('0xb'));var crypto=require(_0xeaf5('0xc'));var jsforce=require(_0xeaf5('0xd'));var deskjs=require(_0xeaf5('0xe'));var toCsv=require(_0xeaf5('0x8'));var querystring=require(_0xeaf5('0xf'));var Papa=require(_0xeaf5('0x10'));var Redis=require(_0xeaf5('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xeaf5('0x12'));var as=require(_0xeaf5('0x13'));var hardwareService=require(_0xeaf5('0x14'));var logger=require(_0xeaf5('0x15'))(_0xeaf5('0x16'));var utils=require(_0xeaf5('0x17'));var config=require(_0xeaf5('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x42cf03,_0x36e198){_0x36e198=_0x36e198||0xcc;return function(_0x543baa){if(_0x543baa){return _0x42cf03[_0xeaf5('0x19')](_0x36e198);}return _0x42cf03['status'](_0x36e198)[_0xeaf5('0x1a')]();};}function respondWithResult(_0x3096ff,_0x2cf751){_0x2cf751=_0x2cf751||0xc8;return function(_0x146eb4){if(_0x146eb4){return _0x3096ff[_0xeaf5('0x1b')](_0x2cf751)[_0xeaf5('0x1c')](_0x146eb4);}};}function respondWithFilteredResult(_0x325dc5,_0x5d23e9){return function(_0x152116){if(_0x152116){var _0x1bd97c=_0x152116['count'],_0x159cd0=_0x5d23e9[_0xeaf5('0x1d')],_0x397ab3=_0x5d23e9[_0xeaf5('0x1d')]+_0x5d23e9[_0xeaf5('0x1e')],_0x23f7d7;if(_0x397ab3>=_0x1bd97c){_0x397ab3=_0x1bd97c;_0x23f7d7=0xc8;}else{_0x23f7d7=0xce;}_0x325dc5[_0xeaf5('0x1b')](_0x23f7d7);return _0x325dc5[_0xeaf5('0x1f')](_0xeaf5('0x20'),_0x159cd0+'-'+_0x397ab3+'/'+_0x1bd97c)[_0xeaf5('0x1c')](_0x152116);}return null;};}function patchUpdates(_0x1232c2){return function(_0xfb502a){try{jsonpatch[_0xeaf5('0x21')](_0xfb502a,_0x1232c2,!![]);}catch(_0x4d5fe5){return BPromise['reject'](_0x4d5fe5);}return _0xfb502a[_0xeaf5('0x22')]();};}function saveUpdates(_0x1c57f8,_0x32c567){return function(_0x2956ed){if(_0x2956ed){return _0x2956ed[_0xeaf5('0x23')](_0x1c57f8)[_0xeaf5('0x24')](function(_0x4b3608){return _0x4b3608;});}return null;};}function removeEntity(_0x52489c,_0x2d53fd){return function(_0x51f629){if(_0x51f629){return _0x51f629[_0xeaf5('0x25')]()[_0xeaf5('0x24')](function(){_0x52489c['status'](0xcc)[_0xeaf5('0x1a')]();});}};}function handleEntityNotFound(_0x22c664,_0x34ab57){return function(_0x5853b8){if(!_0x5853b8){_0x22c664['sendStatus'](0x194);}return _0x5853b8;};}function handleError(_0xe0c2d2,_0x4d8c13){_0x4d8c13=_0x4d8c13||0x1f4;return function(_0x3c3ce9){logger[_0xeaf5('0x26')](_0x3c3ce9[_0xeaf5('0x27')]);if(_0x3c3ce9[_0xeaf5('0x28')]){delete _0x3c3ce9[_0xeaf5('0x28')];}_0xe0c2d2['status'](_0x4d8c13)[_0xeaf5('0x29')](_0x3c3ce9);};}exports[_0xeaf5('0x2a')]=function(_0x5d604e,_0x4570de){var _0x57197a={},_0x21234a={},_0x4bd87b={'count':0x0,'rows':[]};var _0x30ec7f=_['map'](db['VoiceTransferReport'][_0xeaf5('0x2b')],function(_0x13f950){return{'name':_0x13f950['fieldName'],'type':_0x13f950[_0xeaf5('0x2c')][_0xeaf5('0x2d')]};});_0x21234a[_0xeaf5('0x2e')]=_['map'](_0x30ec7f,_0xeaf5('0x28'));_0x21234a[_0xeaf5('0x2f')]=_['keys'](_0x5d604e[_0xeaf5('0x2f')]);_0x21234a[_0xeaf5('0x30')]=_[_0xeaf5('0x31')](_0x21234a['model'],_0x21234a['query']);_0x57197a[_0xeaf5('0x32')]=_[_0xeaf5('0x31')](_0x21234a['model'],qs[_0xeaf5('0x33')](_0x5d604e[_0xeaf5('0x2f')]['fields']));_0x57197a[_0xeaf5('0x32')]=_0x57197a[_0xeaf5('0x32')][_0xeaf5('0x34')]?_0x57197a[_0xeaf5('0x32')]:_0x21234a['model'];if(!_0x5d604e[_0xeaf5('0x2f')]['hasOwnProperty']('nolimit')){_0x57197a[_0xeaf5('0x1e')]=qs['limit'](_0x5d604e['query']['limit']);_0x57197a['offset']=qs[_0xeaf5('0x1d')](_0x5d604e['query'][_0xeaf5('0x1d')]);}_0x57197a[_0xeaf5('0x35')]=qs['sort'](_0x5d604e[_0xeaf5('0x2f')][_0xeaf5('0x36')]);_0x57197a[_0xeaf5('0x37')]=qs['filters'](_[_0xeaf5('0x38')](_0x5d604e[_0xeaf5('0x2f')],_0x21234a[_0xeaf5('0x30')]),_0x30ec7f);if(_0x5d604e['query']['filter']){_0x57197a[_0xeaf5('0x37')]=_[_0xeaf5('0x39')](_0x57197a[_0xeaf5('0x37')],{'$or':_[_0xeaf5('0x3a')](_0x30ec7f,function(_0x3aa0fd){if(_0x3aa0fd[_0xeaf5('0x2c')]!==_0xeaf5('0x3b')){var _0x3cdced={};_0x3cdced[_0x3aa0fd['name']]={'$like':'%'+_0x5d604e['query']['filter']+'%'};return _0x3cdced;}})});}_0x57197a=_['merge']({},_0x57197a,_0x5d604e[_0xeaf5('0x3c')]);var _0x5a5d62={'where':_0x57197a[_0xeaf5('0x37')]};return db[_0xeaf5('0x3d')][_0xeaf5('0x3e')](_0x5a5d62)[_0xeaf5('0x24')](function(_0x36eafd){_0x4bd87b['count']=_0x36eafd;if(_0x5d604e[_0xeaf5('0x2f')]['includeAll']){_0x57197a['include']=[{'all':!![]}];}return db[_0xeaf5('0x3d')][_0xeaf5('0x3f')](_0x57197a);})[_0xeaf5('0x24')](function(_0x27571c){_0x4bd87b[_0xeaf5('0x40')]=_0x27571c;return _0x4bd87b;})[_0xeaf5('0x24')](respondWithFilteredResult(_0x4570de,_0x57197a))[_0xeaf5('0x41')](handleError(_0x4570de,null));};exports[_0xeaf5('0x42')]=function(_0x37eaf9,_0x1e79b3){var _0x14b225={'raw':!![],'where':{'id':_0x37eaf9[_0xeaf5('0x43')]['id']}},_0x4fe0cb={};_0x4fe0cb[_0xeaf5('0x2e')]=_[_0xeaf5('0x44')](db['VoiceTransferReport'][_0xeaf5('0x2b')]);_0x4fe0cb[_0xeaf5('0x2f')]=_['keys'](_0x37eaf9[_0xeaf5('0x2f')]);_0x4fe0cb[_0xeaf5('0x30')]=_['intersection'](_0x4fe0cb['model'],_0x4fe0cb[_0xeaf5('0x2f')]);_0x14b225[_0xeaf5('0x32')]=_[_0xeaf5('0x31')](_0x4fe0cb[_0xeaf5('0x2e')],qs[_0xeaf5('0x33')](_0x37eaf9[_0xeaf5('0x2f')][_0xeaf5('0x33')]));_0x14b225['attributes']=_0x14b225['attributes']['length']?_0x14b225[_0xeaf5('0x32')]:_0x4fe0cb['model'];if(_0x37eaf9[_0xeaf5('0x2f')][_0xeaf5('0x45')]){_0x14b225[_0xeaf5('0x46')]=[{'all':!![]}];}_0x14b225=_[_0xeaf5('0x39')]({},_0x14b225,_0x37eaf9[_0xeaf5('0x3c')]);return db[_0xeaf5('0x3d')][_0xeaf5('0x47')](_0x14b225)['then'](handleEntityNotFound(_0x1e79b3,null))['then'](respondWithResult(_0x1e79b3,null))[_0xeaf5('0x41')](handleError(_0x1e79b3,null));};exports[_0xeaf5('0x48')]=function(_0x5128d3,_0x5d75b6){return db[_0xeaf5('0x3d')][_0xeaf5('0x48')](_0x5128d3['body'],{})[_0xeaf5('0x24')](respondWithResult(_0x5d75b6,0xc9))['catch'](handleError(_0x5d75b6,null));};exports[_0xeaf5('0x23')]=function(_0x5e1422,_0x308468){if(_0x5e1422['body']['id']){delete _0x5e1422[_0xeaf5('0x49')]['id'];}return db[_0xeaf5('0x3d')][_0xeaf5('0x47')]({'where':{'id':_0x5e1422[_0xeaf5('0x43')]['id']}})[_0xeaf5('0x24')](handleEntityNotFound(_0x308468,null))['then'](saveUpdates(_0x5e1422[_0xeaf5('0x49')],null))[_0xeaf5('0x24')](respondWithResult(_0x308468,null))[_0xeaf5('0x41')](handleError(_0x308468,null));};exports[_0xeaf5('0x25')]=function(_0x10f74d,_0x3e39d7){return db[_0xeaf5('0x3d')][_0xeaf5('0x47')]({'where':{'id':_0x10f74d[_0xeaf5('0x43')]['id']}})[_0xeaf5('0x24')](handleEntityNotFound(_0x3e39d7,null))[_0xeaf5('0x24')](removeEntity(_0x3e39d7,null))[_0xeaf5('0x41')](handleError(_0x3e39d7,null));};
\ No newline at end of file
diff --git a/server/api/voiceTransferReport/voiceTransferReport.model.js b/server/api/voiceTransferReport/voiceTransferReport.model.js
index 0f4bd88..a92f309 100644
--- a/server/api/voiceTransferReport/voiceTransferReport.model.js
+++ b/server/api/voiceTransferReport/voiceTransferReport.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xc834=['report_call_transfer','lodash','util','bluebird','request-promise','path','rimraf','./voiceTransferReport.attributes','define','VoiceTransferReport'];(function(_0x627b1b,_0x462114){var _0x2fd022=function(_0x2059c5){while(--_0x2059c5){_0x627b1b['push'](_0x627b1b['shift']());}};_0x2fd022(++_0x462114);}(_0xc834,0x65));var _0x4c83=function(_0xd6c300,_0xef8607){_0xd6c300=_0xd6c300-0x0;var _0x5ef4e9=_0xc834[_0xd6c300];return _0x5ef4e9;};'use strict';var _=require(_0x4c83('0x0'));var util=require(_0x4c83('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x4c83('0x2'));var rp=require(_0x4c83('0x3'));var fs=require('fs');var path=require(_0x4c83('0x4'));var rimraf=require(_0x4c83('0x5'));var config=require('../../config/environment');var attributes=require(_0x4c83('0x6'));module['exports']=function(_0x86b1b5,_0x39996e){return _0x86b1b5[_0x4c83('0x7')](_0x4c83('0x8'),attributes,{'tableName':_0x4c83('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x3ac7=['path','rimraf','../../config/environment','./voiceTransferReport.attributes','exports','define','util','../../config/logger','api','request-promise'];(function(_0x38af48,_0x400460){var _0x445384=function(_0x464435){while(--_0x464435){_0x38af48['push'](_0x38af48['shift']());}};_0x445384(++_0x400460);}(_0x3ac7,0x1e6));var _0x73ac=function(_0x1035c1,_0x2d8583){_0x1035c1=_0x1035c1-0x0;var _0x308d67=_0x3ac7[_0x1035c1];return _0x308d67;};'use strict';var _=require('lodash');var util=require(_0x73ac('0x0'));var logger=require(_0x73ac('0x1'))(_0x73ac('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x73ac('0x3'));var fs=require('fs');var path=require(_0x73ac('0x4'));var rimraf=require(_0x73ac('0x5'));var config=require(_0x73ac('0x6'));var attributes=require(_0x73ac('0x7'));module[_0x73ac('0x8')]=function(_0x23c168,_0x30f15e){return _0x23c168[_0x73ac('0x9')]('VoiceTransferReport',attributes,{'tableName':'report_call_transfer','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/voiceTransferReport/voiceTransferReport.rpc.js b/server/api/voiceTransferReport/voiceTransferReport.rpc.js
index 34d1d06..7c13013 100644
--- a/server/api/voiceTransferReport/voiceTransferReport.rpc.js
+++ b/server/api/voiceTransferReport/voiceTransferReport.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x0b4c=['../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','VoiceTransferReport,\x20%s,\x20%s','request\x20sent','debug','VoiceTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateVoiceTransferReport','VoiceTransferReport','create','body','options','lodash','util','moment','bluebird','ioredis'];(function(_0x2a0444,_0x243b7b){var _0x2ffd90=function(_0x562429){while(--_0x562429){_0x2a0444['push'](_0x2a0444['shift']());}};_0x2ffd90(++_0x243b7b);}(_0x0b4c,0xe3));var _0xc0b4=function(_0x12cde2,_0xb0aa32){_0x12cde2=_0x12cde2-0x0;var _0x32cfc=_0x0b4c[_0x12cde2];return _0x32cfc;};'use strict';var _=require(_0xc0b4('0x0'));var util=require(_0xc0b4('0x1'));var moment=require(_0xc0b4('0x2'));var BPromise=require(_0xc0b4('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc0b4('0x4'));var db=require(_0xc0b4('0x5'))['db'];var utils=require(_0xc0b4('0x6'));var logger=require(_0xc0b4('0x7'))('rpc');var config=require(_0xc0b4('0x8'));var jayson=require(_0xc0b4('0x9'));var client=jayson[_0xc0b4('0xa')][_0xc0b4('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x462477,_0x15af04,_0x5dfb6f){return new BPromise(function(_0x873802,_0x21ee7c){return client['request'](_0x462477,_0x5dfb6f)[_0xc0b4('0xc')](function(_0x17eb03){logger[_0xc0b4('0xd')](_0xc0b4('0xe'),_0x15af04,_0xc0b4('0xf'));logger[_0xc0b4('0x10')](_0xc0b4('0x11'),_0x15af04,_0xc0b4('0xf'),JSON[_0xc0b4('0x12')](_0x17eb03));if(_0x17eb03[_0xc0b4('0x13')]){if(_0x17eb03[_0xc0b4('0x13')][_0xc0b4('0x14')]===0x1f4){logger['error'](_0xc0b4('0xe'),_0x15af04,_0x17eb03['error'][_0xc0b4('0x15')]);return _0x21ee7c(_0x17eb03[_0xc0b4('0x13')][_0xc0b4('0x15')]);}logger[_0xc0b4('0x13')](_0xc0b4('0xe'),_0x15af04,_0x17eb03[_0xc0b4('0x13')]['message']);return _0x873802(_0x17eb03[_0xc0b4('0x13')][_0xc0b4('0x15')]);}else{logger[_0xc0b4('0xd')](_0xc0b4('0xe'),_0x15af04,_0xc0b4('0xf'));_0x873802(_0x17eb03[_0xc0b4('0x16')][_0xc0b4('0x15')]);}})[_0xc0b4('0x17')](function(_0x585a9b){logger[_0xc0b4('0x13')]('VoiceTransferReport,\x20%s,\x20%s',_0x15af04,_0x585a9b);_0x21ee7c(_0x585a9b);});});}exports[_0xc0b4('0x18')]=function(_0x33cedb){var _0x34d2bc=this;return new Promise(function(_0x525ae8,_0x4627a0){return db[_0xc0b4('0x19')][_0xc0b4('0x1a')](_0x33cedb[_0xc0b4('0x1b')],{'raw':_0x33cedb[_0xc0b4('0x1c')]?_0x33cedb[_0xc0b4('0x1c')]['raw']===undefined?!![]:![]:!![]})[_0xc0b4('0xc')](function(_0x2bba00){logger[_0xc0b4('0xd')]('CreateVoiceTransferReport',_0x33cedb);logger[_0xc0b4('0x10')](_0xc0b4('0x18'),_0x33cedb,JSON['stringify'](_0x2bba00));_0x525ae8(_0x2bba00);})['catch'](function(_0xd845a9){logger[_0xc0b4('0x13')](_0xc0b4('0x18'),_0xd845a9['message'],_0x33cedb);_0x4627a0(_0x34d2bc['error'](0x1f4,_0xd845a9['message']));});});};
\ No newline at end of file
+var _0x9cad=['lodash','util','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','VoiceTransferReport,\x20%s,\x20%s','request\x20sent','VoiceTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','create','options','CreateVoiceTransferReport','debug'];(function(_0x279d37,_0x14de3f){var _0x530173=function(_0x37fc79){while(--_0x37fc79){_0x279d37['push'](_0x279d37['shift']());}};_0x530173(++_0x14de3f);}(_0x9cad,0x96));var _0xd9ca=function(_0x35b195,_0x8893d5){_0x35b195=_0x35b195-0x0;var _0x2433bf=_0x9cad[_0x35b195];return _0x2433bf;};'use strict';var _=require(_0xd9ca('0x0'));var util=require(_0xd9ca('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd9ca('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0xd9ca('0x3'));var logger=require(_0xd9ca('0x4'))(_0xd9ca('0x5'));var config=require(_0xd9ca('0x6'));var jayson=require(_0xd9ca('0x7'));var client=jayson[_0xd9ca('0x8')][_0xd9ca('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x596e68,_0x574a19,_0x378e30){return new BPromise(function(_0x1ccbca,_0xac2897){return client['request'](_0x596e68,_0x378e30)[_0xd9ca('0xa')](function(_0x3bf54a){logger[_0xd9ca('0xb')](_0xd9ca('0xc'),_0x574a19,_0xd9ca('0xd'));logger['debug'](_0xd9ca('0xe'),_0x574a19,_0xd9ca('0xd'),JSON[_0xd9ca('0xf')](_0x3bf54a));if(_0x3bf54a[_0xd9ca('0x10')]){if(_0x3bf54a[_0xd9ca('0x10')][_0xd9ca('0x11')]===0x1f4){logger[_0xd9ca('0x10')](_0xd9ca('0xc'),_0x574a19,_0x3bf54a[_0xd9ca('0x10')][_0xd9ca('0x12')]);return _0xac2897(_0x3bf54a[_0xd9ca('0x10')][_0xd9ca('0x12')]);}logger['error'](_0xd9ca('0xc'),_0x574a19,_0x3bf54a[_0xd9ca('0x10')][_0xd9ca('0x12')]);return _0x1ccbca(_0x3bf54a[_0xd9ca('0x10')][_0xd9ca('0x12')]);}else{logger[_0xd9ca('0xb')](_0xd9ca('0xc'),_0x574a19,_0xd9ca('0xd'));_0x1ccbca(_0x3bf54a[_0xd9ca('0x13')][_0xd9ca('0x12')]);}})[_0xd9ca('0x14')](function(_0x1e678a){logger[_0xd9ca('0x10')](_0xd9ca('0xc'),_0x574a19,_0x1e678a);_0xac2897(_0x1e678a);});});}exports['CreateVoiceTransferReport']=function(_0x1a9d6e){var _0x4613bd=this;return new Promise(function(_0x381e8e,_0x2d23fd){return db['VoiceTransferReport'][_0xd9ca('0x15')](_0x1a9d6e['body'],{'raw':_0x1a9d6e['options']?_0x1a9d6e[_0xd9ca('0x16')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x1db096){logger[_0xd9ca('0xb')](_0xd9ca('0x17'),_0x1a9d6e);logger[_0xd9ca('0x18')](_0xd9ca('0x17'),_0x1a9d6e,JSON[_0xd9ca('0xf')](_0x1db096));_0x381e8e(_0x1db096);})[_0xd9ca('0x14')](function(_0x2f3ed5){logger[_0xd9ca('0x10')](_0xd9ca('0x17'),_0x2f3ed5['message'],_0x1a9d6e);_0x2d23fd(_0x4613bd[_0xd9ca('0x10')](0x1f4,_0x2f3ed5['message']));});});};
\ No newline at end of file
diff --git a/server/api/webbar/index.js b/server/api/webbar/index.js
index 2f896d2..a6b356c 100644
--- a/server/api/webbar/index.js
+++ b/server/api/webbar/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9099=['/originate','isAuthenticated','canUpdate','originate','/hangup','hangup','/answer','/unhold','unhold','/calls','calls','/transfer','transfer','exports','express','../../components/auth/service','./webbar.controller','post'];(function(_0x545dd8,_0x404f75){var _0x44cd80=function(_0xec3ca3){while(--_0xec3ca3){_0x545dd8['push'](_0x545dd8['shift']());}};_0x44cd80(++_0x404f75);}(_0x9099,0x1ac));var _0x9909=function(_0x7275e9,_0x321fa5){_0x7275e9=_0x7275e9-0x0;var _0x17b99d=_0x9099[_0x7275e9];return _0x17b99d;};'use strict';var express=require(_0x9909('0x0'));var router=express['Router']();var auth=require(_0x9909('0x1'));var controller=require(_0x9909('0x2'));router[_0x9909('0x3')](_0x9909('0x4'),auth[_0x9909('0x5')](),auth[_0x9909('0x6')](),controller[_0x9909('0x7')]);router[_0x9909('0x3')](_0x9909('0x8'),auth[_0x9909('0x5')](),auth[_0x9909('0x6')](),controller[_0x9909('0x9')]);router[_0x9909('0x3')](_0x9909('0xa'),auth['isAuthenticated'](),auth[_0x9909('0x6')](),controller['answer']);router['post']('/hold',auth['isAuthenticated'](),auth[_0x9909('0x6')](),controller['hold']);router[_0x9909('0x3')](_0x9909('0xb'),auth[_0x9909('0x5')](),auth['canUpdate'](),controller[_0x9909('0xc')]);router['post'](_0x9909('0xd'),auth[_0x9909('0x5')](),auth[_0x9909('0x6')](),controller[_0x9909('0xe')]);router[_0x9909('0x3')](_0x9909('0xf'),auth[_0x9909('0x5')](),auth[_0x9909('0x6')](),controller[_0x9909('0x10')]);module[_0x9909('0x11')]=router;
\ No newline at end of file
+var _0x8d97=['calls','/transfer','transfer','exports','Router','../../components/auth/service','post','/originate','isAuthenticated','canUpdate','originate','/hangup','answer','/hold','hold','/unhold','unhold','/calls'];(function(_0x1c8e15,_0x1a7c23){var _0x410531=function(_0x3f028b){while(--_0x3f028b){_0x1c8e15['push'](_0x1c8e15['shift']());}};_0x410531(++_0x1a7c23);}(_0x8d97,0x82));var _0x78d9=function(_0x5391fb,_0x786bf0){_0x5391fb=_0x5391fb-0x0;var _0x1b3ef3=_0x8d97[_0x5391fb];return _0x1b3ef3;};'use strict';var express=require('express');var router=express[_0x78d9('0x0')]();var auth=require(_0x78d9('0x1'));var controller=require('./webbar.controller');router[_0x78d9('0x2')](_0x78d9('0x3'),auth[_0x78d9('0x4')](),auth[_0x78d9('0x5')](),controller[_0x78d9('0x6')]);router['post'](_0x78d9('0x7'),auth[_0x78d9('0x4')](),auth[_0x78d9('0x5')](),controller['hangup']);router['post']('/answer',auth[_0x78d9('0x4')](),auth[_0x78d9('0x5')](),controller[_0x78d9('0x8')]);router[_0x78d9('0x2')](_0x78d9('0x9'),auth[_0x78d9('0x4')](),auth['canUpdate'](),controller[_0x78d9('0xa')]);router[_0x78d9('0x2')](_0x78d9('0xb'),auth['isAuthenticated'](),auth['canUpdate'](),controller[_0x78d9('0xc')]);router[_0x78d9('0x2')](_0x78d9('0xd'),auth[_0x78d9('0x4')](),auth[_0x78d9('0x5')](),controller[_0x78d9('0xe')]);router['post'](_0x78d9('0xf'),auth[_0x78d9('0x4')](),auth[_0x78d9('0x5')](),controller[_0x78d9('0x10')]);module[_0x78d9('0x11')]=router;
\ No newline at end of file
diff --git a/server/api/webbar/webbar.controller.js b/server/api/webbar/webbar.controller.js
index b2ef9fc..6387752 100644
--- a/server/api/webbar/webbar.controller.js
+++ b/server/api/webbar/webbar.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x4a81=['userId','callNumber','callerId','entityFound:','format','user:%s','webbar:originate','originate\x20executed!','webbar:hangup','hangup\x20executed!','answer','answer\x20fired:','webbar:answer','hold\x20fired:','webbar:hold','hold\x20executed!','unhold','unhold\x20fired:','calls','conference','webbar:conference','conference\x20executed!','transfer\x20fired:','transferNumber','webbar:transfer','path','lodash','../../mysqldb','../../config/environment','jayson/promise','http','../../config/logger','redis','socket.io-emitter','validate','number','userId\x20is\x20required','string','sessionId\x20is\x20required','info','emit','log','handleError:','error','stack','name','status','send','request','code','message','result','catch','User','findOne','agent','then','VoiceChannels','all','filter','rows','UserId','sessionId','length','sessionId\x20','\x20not\x20found!','originate','json','body'];(function(_0x18cac4,_0x57a4d5){var _0x2227c6=function(_0x72934d){while(--_0x72934d){_0x18cac4['push'](_0x18cac4['shift']());}};_0x2227c6(++_0x57a4d5);}(_0x4a81,0x1b7));var _0x14a8=function(_0x46619f,_0x2a5dd5){_0x46619f=_0x46619f-0x0;var _0x42e23c=_0x4a81[_0x46619f];return _0x42e23c;};'use strict';var path=require(_0x14a8('0x0'));var fs=require('fs');var _=require(_0x14a8('0x1'));var db=require(_0x14a8('0x2'))['db'];var config=require(_0x14a8('0x3'));var util=require('util');var BPromise=require('bluebird');var jayson=require(_0x14a8('0x4'));var amiClient=jayson['client'][_0x14a8('0x5')]({'port':0x232a});var logger=require(_0x14a8('0x6'))('webbarapi');var Redis=require('ioredis');config[_0x14a8('0x7')]=_['defaults'](config[_0x14a8('0x7')],{'host':'localhost','port':0x18eb});var io=require(_0x14a8('0x8'))(new Redis(config[_0x14a8('0x7')]));var Schema=require(_0x14a8('0x9'));var originateValidation=new Schema({'userId':{'type':_0x14a8('0xa'),'required':[!![],_0x14a8('0xb')]},'callNumber':{'type':'string','required':[!![],'callNumber\x20is\x20required']},'callerId':{'type':_0x14a8('0xc')},'callbackUrl':{'type':_0x14a8('0xc')}});var hangupValidation=new Schema({'userId':{'type':_0x14a8('0xa'),'required':[!![],'userId\x20is\x20required']},'sessionId':{'type':_0x14a8('0xc'),'required':![]}});var answerValidation=new Schema({'userId':{'type':_0x14a8('0xa'),'required':[!![],_0x14a8('0xb')]},'sessionId':{'type':_0x14a8('0xc'),'required':![]}});var transferValidation=new Schema({'userId':{'type':_0x14a8('0xa'),'required':[!![],_0x14a8('0xb')]},'sessionId':{'type':_0x14a8('0xc'),'required':[!![],_0x14a8('0xd')]},'transferNumber':{'type':'string','required':[!![],'transferNumber\x20is\x20required']}});var holdValidation=new Schema({'userId':{'type':_0x14a8('0xa'),'required':[!![],_0x14a8('0xb')]},'sessionId':{'type':'string','required':![]}});var unholdValidation=new Schema({'userId':{'type':_0x14a8('0xa'),'required':[!![],'userId\x20is\x20required']},'sessionId':{'type':_0x14a8('0xc'),'required':![]}});var callsValidation=new Schema({'userId':{'type':_0x14a8('0xa'),'required':[!![],_0x14a8('0xb')]}});var conferenceValidation=new Schema({'userId':{'type':_0x14a8('0xa'),'required':[!![],_0x14a8('0xb')]}});function emit(_0x3a7152,_0x4dac6b,_0x356cf0){logger[_0x14a8('0xe')](_0x3a7152,_0x4dac6b,JSON['stringify'](_0x356cf0));io['to'](_0x3a7152)[_0x14a8('0xf')](_0x4dac6b,_0x356cf0);}function handleError(_0x524e35){return function(_0x98e1d5){console[_0x14a8('0x10')](_0x14a8('0x11'),_0x98e1d5,_0x98e1d5 instanceof RangeError);logger[_0x14a8('0x12')](_0x98e1d5[_0x14a8('0x13')]);if(_0x98e1d5 instanceof RangeError){if(_0x98e1d5[_0x14a8('0x14')]){delete _0x98e1d5['name'];}_0x524e35[_0x14a8('0x15')](0x194)[_0x14a8('0x16')](_0x98e1d5);}else{if(_0x98e1d5['name']){delete _0x98e1d5['name'];}_0x524e35[_0x14a8('0x15')](0x1f4)['send'](_0x98e1d5);}};}function checkError(){return function(_0x452c6c){if(!_0x452c6c){throw new RangeError('NotFound');}return _0x452c6c;};}function respondWithRpcPromise(_0x207e9f,_0x53f402){return new BPromise(function(_0x190189,_0x3afd58){var _0x182f2b=amiClient;return _0x182f2b[_0x14a8('0x17')](_0x207e9f,_0x53f402)['then'](function(_0x3d8cd1){if(_0x3d8cd1['error']){if(_0x3d8cd1[_0x14a8('0x12')][_0x14a8('0x18')]===0x1f4){return _0x3afd58(_0x3d8cd1[_0x14a8('0x12')][_0x14a8('0x19')]);}return _0x190189(_0x3d8cd1[_0x14a8('0x12')][_0x14a8('0x19')]);}else{_0x190189(_0x3d8cd1[_0x14a8('0x1a')]);}})[_0x14a8('0x1b')](function(_0x505655){_0x3afd58(_0x505655);});});}function getAgent(_0x2505d9){return db[_0x14a8('0x1c')][_0x14a8('0x1d')]({'where':{'id':_0x2505d9,'role':_0x14a8('0x1e')}})[_0x14a8('0x1f')](checkError());}function getAgentCheckSession(_0x42bdea,_0x3ae40c){return new BPromise(function(_0x37a780,_0x35b1c8){var _0x28d25c=respondWithRpcPromise(_0x14a8('0x20'));var _0x1c378a=getAgent(_0x42bdea);Promise[_0x14a8('0x21')]([_0x28d25c,_0x1c378a])['then'](function(_0x380e9a){var _0x2fdaed=_0x380e9a[0x0];var _0x4d71a1=_0x380e9a[0x1];var _0x3c3268=_[_0x14a8('0x22')](_0x2fdaed[_0x14a8('0x23')],function(_0x486f3f){return _0x486f3f[_0x14a8('0x24')]==_0x4d71a1['id']&&_0x486f3f[_0x14a8('0x25')]==_0x3ae40c;});if(_0x3c3268[_0x14a8('0x26')]==0x1){_0x37a780(_0x4d71a1);}else{_0x35b1c8(new RangeError(_0x14a8('0x27')+_0x3ae40c+_0x14a8('0x28')));}});});}exports[_0x14a8('0x29')]=function(_0x2a3fbc,_0x4f98a0){logger[_0x14a8('0xe')]('originate\x20fired:',_0x2a3fbc['body']);var _0xd74489=originateValidation['validate'](_0x2a3fbc['body']);if(_0xd74489[_0x14a8('0x26')]>0x0){return _0x4f98a0[_0x14a8('0x15')](0x190)[_0x14a8('0x2a')](_0xd74489);}var _0x50f50c=_0x2a3fbc[_0x14a8('0x2b')][_0x14a8('0x2c')];var _0x40e38b=_0x2a3fbc['body'][_0x14a8('0x2d')];var _0x2f9fc0=_0x2a3fbc[_0x14a8('0x2b')][_0x14a8('0x2e')];var _0x2a4c0c=_0x2a3fbc['body']['callbackUrl'];return getAgent(_0x50f50c)[_0x14a8('0x1f')](function(_0x3c96f5){logger[_0x14a8('0xe')](_0x14a8('0x2f'),_0x3c96f5[_0x14a8('0x14')]);emit(util[_0x14a8('0x30')](_0x14a8('0x31'),_0x3c96f5['name']),_0x14a8('0x32'),{'callNumber':_0x40e38b,'callerId':_0x2f9fc0,'callbackUrl':_0x2a4c0c});return _0x4f98a0[_0x14a8('0x15')](0xc8)['json']({'error':![],'message':_0x14a8('0x33')});})['catch'](handleError(_0x4f98a0));};exports['hangup']=function(_0x5d77e3,_0x2da3a1){logger['info']('hangup\x20fired:',_0x5d77e3[_0x14a8('0x2b')]);var _0x334b9e=hangupValidation[_0x14a8('0x9')](_0x5d77e3[_0x14a8('0x2b')]);if(_0x334b9e[_0x14a8('0x26')]>0x0){return _0x2da3a1['status'](0x190)[_0x14a8('0x2a')](_0x334b9e);}var _0x57545b=_0x5d77e3['body'][_0x14a8('0x2c')];var _0x32a3d9=_0x5d77e3[_0x14a8('0x2b')]['sessionId'];return getAgent(_0x57545b)[_0x14a8('0x1f')](function(_0x268a1a){logger[_0x14a8('0xe')](_0x14a8('0x2f'),_0x268a1a['name']);emit(util[_0x14a8('0x30')](_0x14a8('0x31'),_0x268a1a['name']),_0x14a8('0x34'),{'sessionId':_0x32a3d9});return _0x2da3a1[_0x14a8('0x15')](0xc8)[_0x14a8('0x2a')]({'error':![],'message':_0x14a8('0x35')});})[_0x14a8('0x1b')](handleError(_0x2da3a1));};exports[_0x14a8('0x36')]=function(_0x3a8323,_0x56372f){logger[_0x14a8('0xe')](_0x14a8('0x37'),_0x3a8323['body']);var _0x1c28a1=answerValidation[_0x14a8('0x9')](_0x3a8323['body']);if(_0x1c28a1[_0x14a8('0x26')]>0x0){return _0x56372f[_0x14a8('0x15')](0x190)[_0x14a8('0x2a')](_0x1c28a1);}var _0x2b279f=_0x3a8323[_0x14a8('0x2b')][_0x14a8('0x2c')];var _0x4ad341=_0x3a8323[_0x14a8('0x2b')]['sessionId'];return getAgent(_0x2b279f)[_0x14a8('0x1f')](function(_0x9c0a28){logger[_0x14a8('0xe')](_0x14a8('0x2f'),_0x9c0a28[_0x14a8('0x14')]);emit(util[_0x14a8('0x30')](_0x14a8('0x31'),_0x9c0a28['name']),_0x14a8('0x38'),{'sessionId':_0x4ad341});return _0x56372f[_0x14a8('0x15')](0xc8)['json']({'error':![],'message':'answer\x20executed!'});})[_0x14a8('0x1b')](handleError(_0x56372f));};exports['hold']=function(_0x976e04,_0x4f559a){logger[_0x14a8('0xe')](_0x14a8('0x39'),_0x976e04[_0x14a8('0x2b')]);var _0x3433af=holdValidation[_0x14a8('0x9')](_0x976e04[_0x14a8('0x2b')]);if(_0x3433af['length']>0x0){return _0x4f559a['status'](0x190)['json'](_0x3433af);}var _0x14138c=_0x976e04[_0x14a8('0x2b')][_0x14a8('0x2c')];var _0x21df3d=_0x976e04['body'][_0x14a8('0x25')];return getAgent(_0x14138c)[_0x14a8('0x1f')](function(_0xb3a3a0){logger[_0x14a8('0xe')]('entityFound:',_0xb3a3a0['name']);emit(util[_0x14a8('0x30')](_0x14a8('0x31'),_0xb3a3a0[_0x14a8('0x14')]),_0x14a8('0x3a'),{'sessionId':_0x21df3d});return _0x4f559a['status'](0xc8)[_0x14a8('0x2a')]({'error':![],'message':_0x14a8('0x3b')});})[_0x14a8('0x1b')](handleError(_0x4f559a));};exports[_0x14a8('0x3c')]=function(_0x33b86f,_0x1053db){logger[_0x14a8('0xe')](_0x14a8('0x3d'),_0x33b86f[_0x14a8('0x2b')]);var _0x20e54c=unholdValidation[_0x14a8('0x9')](_0x33b86f[_0x14a8('0x2b')]);if(_0x20e54c[_0x14a8('0x26')]>0x0){return _0x1053db[_0x14a8('0x15')](0x190)['json'](_0x20e54c);}var _0x295484=_0x33b86f[_0x14a8('0x2b')][_0x14a8('0x2c')];var _0xfb197b=_0x33b86f['body'][_0x14a8('0x25')];return getAgent(_0x295484)['then'](function(_0x3a373f){logger[_0x14a8('0xe')]('entityFound:',_0x3a373f['name']);emit(util[_0x14a8('0x30')](_0x14a8('0x31'),_0x3a373f[_0x14a8('0x14')]),'webbar:unhold',{'sessionId':_0xfb197b});return _0x1053db[_0x14a8('0x15')](0xc8)[_0x14a8('0x2a')]({'error':![],'message':'unhold\x20executed!'});})['catch'](handleError(_0x1053db));};exports[_0x14a8('0x3e')]=function(_0x60f310,_0x49dfea){logger['info']('calls\x20fired:',_0x49dfea['body']);var _0x192d6c=callsValidation[_0x14a8('0x9')](_0x60f310['body']);if(_0x192d6c[_0x14a8('0x26')]>0x0){return _0x49dfea['status'](0x190)['json'](_0x192d6c);}var _0x3830f8=_0x60f310[_0x14a8('0x2b')]['userId'];var _0x17b945=respondWithRpcPromise(_0x14a8('0x20'));var _0xa1dd0e=getAgent(_0x3830f8);return Promise[_0x14a8('0x21')]([_0x17b945,_0xa1dd0e])[_0x14a8('0x1f')](function(_0x2ef13f){var _0x226ff7=_0x2ef13f[0x0];var _0x5e4de0=_0x2ef13f[0x1];var _0xb4e58d=_[_0x14a8('0x22')](_0x226ff7['rows'],function(_0x27dab7){return _0x27dab7[_0x14a8('0x24')]==_0x5e4de0['id'];});return _0x49dfea[_0x14a8('0x15')](0xc8)[_0x14a8('0x2a')]({'count':_0xb4e58d['length'],'rows':_0xb4e58d});})[_0x14a8('0x1b')](handleError(_0x49dfea));};exports[_0x14a8('0x3f')]=function(_0x4ec75c,_0x545a33){logger[_0x14a8('0xe')]('conference\x20fired:',_0x4ec75c['body']);var _0x448afd=conferenceValidation[_0x14a8('0x9')](_0x4ec75c[_0x14a8('0x2b')]);if(_0x448afd['length']>0x0){return _0x545a33['status'](0x190)[_0x14a8('0x2a')](_0x448afd);}var _0x4b88e7=_0x4ec75c['body']['userId'];return getAgent(_0x4b88e7)['then'](function(_0x119b22){logger['info'](_0x14a8('0x2f'),_0x119b22[_0x14a8('0x14')]);emit(util['format'](_0x14a8('0x31'),_0x119b22[_0x14a8('0x14')]),_0x14a8('0x40'));return _0x545a33[_0x14a8('0x15')](0xc8)[_0x14a8('0x2a')]({'error':![],'message':_0x14a8('0x41')});})[_0x14a8('0x1b')](handleError(_0x545a33));};exports['transfer']=function(_0x2c12ee,_0x4d3de9){logger[_0x14a8('0xe')](_0x14a8('0x42'),_0x2c12ee[_0x14a8('0x2b')]);var _0x3f898e=transferValidation['validate'](_0x2c12ee[_0x14a8('0x2b')]);if(_0x3f898e['length']>0x0){return _0x4d3de9['status'](0x190)[_0x14a8('0x2a')](_0x3f898e);}var _0x17fd52=_0x2c12ee[_0x14a8('0x2b')]['userId'];var _0x3ba685=_0x2c12ee['body'][_0x14a8('0x25')];var _0x3f2ae2=_0x2c12ee[_0x14a8('0x2b')][_0x14a8('0x43')];return getAgent(_0x17fd52)[_0x14a8('0x1f')](function(_0x386a03){logger[_0x14a8('0xe')](_0x14a8('0x2f'),_0x386a03['name']);emit(util['format']('user:%s',_0x386a03[_0x14a8('0x14')]),_0x14a8('0x44'),{'sessionId':_0x3ba685,'transferNumber':_0x3f2ae2});return _0x4d3de9[_0x14a8('0x15')](0xc8)[_0x14a8('0x2a')]({'error':![],'message':'transfer\x20executed!'});})[_0x14a8('0x1b')](handleError(_0x4d3de9));};
\ No newline at end of file
+var _0xc737=['\x20not\x20found!','originate','info','originate\x20fired:','body','userId','callNumber','callbackUrl','entityFound:','format','user:%s','webbar:originate','json','originate\x20executed!','hangup\x20fired:','validate','webbar:hangup','hangup\x20executed!','answer','answer\x20fired:','webbar:answer','answer\x20executed!','hold\x20fired:','unhold','unhold\x20fired:','webbar:unhold','unhold\x20executed!','calls\x20fired:','UserId','conference','conference\x20fired:','webbar:conference','conference\x20executed!','transfer','transferNumber','transfer\x20executed!','path','lodash','../../mysqldb','../../config/environment','bluebird','jayson/promise','client','../../config/logger','webbarapi','defaults','redis','socket.io-emitter','userId\x20is\x20required','string','callNumber\x20is\x20required','number','sessionId\x20is\x20required','transferNumber\x20is\x20required','stringify','emit','log','stack','name','status','send','request','then','error','code','message','catch','User','findOne','VoiceChannels','all','filter','rows','sessionId','length','sessionId\x20'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0xc737,0x154));var _0x7c73=function(_0x1d75bd,_0x17c831){_0x1d75bd=_0x1d75bd-0x0;var _0x16028f=_0xc737[_0x1d75bd];return _0x16028f;};'use strict';var path=require(_0x7c73('0x0'));var fs=require('fs');var _=require(_0x7c73('0x1'));var db=require(_0x7c73('0x2'))['db'];var config=require(_0x7c73('0x3'));var util=require('util');var BPromise=require(_0x7c73('0x4'));var jayson=require(_0x7c73('0x5'));var amiClient=jayson[_0x7c73('0x6')]['http']({'port':0x232a});var logger=require(_0x7c73('0x7'))(_0x7c73('0x8'));var Redis=require('ioredis');config['redis']=_[_0x7c73('0x9')](config[_0x7c73('0xa')],{'host':'localhost','port':0x18eb});var io=require(_0x7c73('0xb'))(new Redis(config[_0x7c73('0xa')]));var Schema=require('validate');var originateValidation=new Schema({'userId':{'type':'number','required':[!![],_0x7c73('0xc')]},'callNumber':{'type':_0x7c73('0xd'),'required':[!![],_0x7c73('0xe')]},'callerId':{'type':'string'},'callbackUrl':{'type':_0x7c73('0xd')}});var hangupValidation=new Schema({'userId':{'type':_0x7c73('0xf'),'required':[!![],'userId\x20is\x20required']},'sessionId':{'type':_0x7c73('0xd'),'required':![]}});var answerValidation=new Schema({'userId':{'type':'number','required':[!![],_0x7c73('0xc')]},'sessionId':{'type':_0x7c73('0xd'),'required':![]}});var transferValidation=new Schema({'userId':{'type':_0x7c73('0xf'),'required':[!![],'userId\x20is\x20required']},'sessionId':{'type':_0x7c73('0xd'),'required':[!![],_0x7c73('0x10')]},'transferNumber':{'type':_0x7c73('0xd'),'required':[!![],_0x7c73('0x11')]}});var holdValidation=new Schema({'userId':{'type':'number','required':[!![],_0x7c73('0xc')]},'sessionId':{'type':'string','required':![]}});var unholdValidation=new Schema({'userId':{'type':_0x7c73('0xf'),'required':[!![],_0x7c73('0xc')]},'sessionId':{'type':_0x7c73('0xd'),'required':![]}});var callsValidation=new Schema({'userId':{'type':_0x7c73('0xf'),'required':[!![],_0x7c73('0xc')]}});var conferenceValidation=new Schema({'userId':{'type':_0x7c73('0xf'),'required':[!![],_0x7c73('0xc')]}});function emit(_0x15be28,_0x5091d6,_0xbf66e){logger['info'](_0x15be28,_0x5091d6,JSON[_0x7c73('0x12')](_0xbf66e));io['to'](_0x15be28)[_0x7c73('0x13')](_0x5091d6,_0xbf66e);}function handleError(_0x4fafb7){return function(_0x534a39){console[_0x7c73('0x14')]('handleError:',_0x534a39,_0x534a39 instanceof RangeError);logger['error'](_0x534a39[_0x7c73('0x15')]);if(_0x534a39 instanceof RangeError){if(_0x534a39[_0x7c73('0x16')]){delete _0x534a39[_0x7c73('0x16')];}_0x4fafb7[_0x7c73('0x17')](0x194)['send'](_0x534a39);}else{if(_0x534a39[_0x7c73('0x16')]){delete _0x534a39[_0x7c73('0x16')];}_0x4fafb7[_0x7c73('0x17')](0x1f4)[_0x7c73('0x18')](_0x534a39);}};}function checkError(){return function(_0x359c26){if(!_0x359c26){throw new RangeError('NotFound');}return _0x359c26;};}function respondWithRpcPromise(_0x2cf4d6,_0x2f9ad7){return new BPromise(function(_0x42867c,_0x1745d9){var _0x3b752c=amiClient;return _0x3b752c[_0x7c73('0x19')](_0x2cf4d6,_0x2f9ad7)[_0x7c73('0x1a')](function(_0x6d5714){if(_0x6d5714[_0x7c73('0x1b')]){if(_0x6d5714['error'][_0x7c73('0x1c')]===0x1f4){return _0x1745d9(_0x6d5714['error'][_0x7c73('0x1d')]);}return _0x42867c(_0x6d5714['error'][_0x7c73('0x1d')]);}else{_0x42867c(_0x6d5714['result']);}})[_0x7c73('0x1e')](function(_0x5c8f9d){_0x1745d9(_0x5c8f9d);});});}function getAgent(_0xd695c6){return db[_0x7c73('0x1f')][_0x7c73('0x20')]({'where':{'id':_0xd695c6,'role':'agent'}})[_0x7c73('0x1a')](checkError());}function getAgentCheckSession(_0x12113d,_0x422094){return new BPromise(function(_0x5ad41e,_0x31f8af){var _0x14c5a0=respondWithRpcPromise(_0x7c73('0x21'));var _0x3c9a44=getAgent(_0x12113d);Promise[_0x7c73('0x22')]([_0x14c5a0,_0x3c9a44])[_0x7c73('0x1a')](function(_0x5800eb){var _0x5909ec=_0x5800eb[0x0];var _0x485f0a=_0x5800eb[0x1];var _0x30fa4f=_[_0x7c73('0x23')](_0x5909ec[_0x7c73('0x24')],function(_0x49b1ad){return _0x49b1ad['UserId']==_0x485f0a['id']&&_0x49b1ad[_0x7c73('0x25')]==_0x422094;});if(_0x30fa4f[_0x7c73('0x26')]==0x1){_0x5ad41e(_0x485f0a);}else{_0x31f8af(new RangeError(_0x7c73('0x27')+_0x422094+_0x7c73('0x28')));}});});}exports[_0x7c73('0x29')]=function(_0x2b924f,_0x353dd0){logger[_0x7c73('0x2a')](_0x7c73('0x2b'),_0x2b924f[_0x7c73('0x2c')]);var _0x50d0ea=originateValidation['validate'](_0x2b924f[_0x7c73('0x2c')]);if(_0x50d0ea[_0x7c73('0x26')]>0x0){return _0x353dd0[_0x7c73('0x17')](0x190)['json'](_0x50d0ea);}var _0x201905=_0x2b924f[_0x7c73('0x2c')][_0x7c73('0x2d')];var _0xdab0d8=_0x2b924f[_0x7c73('0x2c')][_0x7c73('0x2e')];var _0x282366=_0x2b924f[_0x7c73('0x2c')]['callerId'];var _0x34c9e3=_0x2b924f[_0x7c73('0x2c')][_0x7c73('0x2f')];return getAgent(_0x201905)[_0x7c73('0x1a')](function(_0xe670a4){logger[_0x7c73('0x2a')](_0x7c73('0x30'),_0xe670a4[_0x7c73('0x16')]);emit(util[_0x7c73('0x31')](_0x7c73('0x32'),_0xe670a4[_0x7c73('0x16')]),_0x7c73('0x33'),{'callNumber':_0xdab0d8,'callerId':_0x282366,'callbackUrl':_0x34c9e3});return _0x353dd0[_0x7c73('0x17')](0xc8)[_0x7c73('0x34')]({'error':![],'message':_0x7c73('0x35')});})[_0x7c73('0x1e')](handleError(_0x353dd0));};exports['hangup']=function(_0x30690b,_0x2484b4){logger['info'](_0x7c73('0x36'),_0x30690b[_0x7c73('0x2c')]);var _0x55a86d=hangupValidation[_0x7c73('0x37')](_0x30690b['body']);if(_0x55a86d[_0x7c73('0x26')]>0x0){return _0x2484b4[_0x7c73('0x17')](0x190)[_0x7c73('0x34')](_0x55a86d);}var _0x2bbabd=_0x30690b[_0x7c73('0x2c')][_0x7c73('0x2d')];var _0x35e662=_0x30690b[_0x7c73('0x2c')][_0x7c73('0x25')];return getAgent(_0x2bbabd)['then'](function(_0xbc9094){logger[_0x7c73('0x2a')](_0x7c73('0x30'),_0xbc9094[_0x7c73('0x16')]);emit(util[_0x7c73('0x31')]('user:%s',_0xbc9094['name']),_0x7c73('0x38'),{'sessionId':_0x35e662});return _0x2484b4[_0x7c73('0x17')](0xc8)[_0x7c73('0x34')]({'error':![],'message':_0x7c73('0x39')});})[_0x7c73('0x1e')](handleError(_0x2484b4));};exports[_0x7c73('0x3a')]=function(_0x3ef9c1,_0x1e9c21){logger['info'](_0x7c73('0x3b'),_0x3ef9c1[_0x7c73('0x2c')]);var _0x36b18e=answerValidation[_0x7c73('0x37')](_0x3ef9c1[_0x7c73('0x2c')]);if(_0x36b18e[_0x7c73('0x26')]>0x0){return _0x1e9c21['status'](0x190)[_0x7c73('0x34')](_0x36b18e);}var _0x1b0a6f=_0x3ef9c1[_0x7c73('0x2c')][_0x7c73('0x2d')];var _0x4ef5c3=_0x3ef9c1['body']['sessionId'];return getAgent(_0x1b0a6f)[_0x7c73('0x1a')](function(_0x208908){logger[_0x7c73('0x2a')](_0x7c73('0x30'),_0x208908['name']);emit(util[_0x7c73('0x31')](_0x7c73('0x32'),_0x208908[_0x7c73('0x16')]),_0x7c73('0x3c'),{'sessionId':_0x4ef5c3});return _0x1e9c21[_0x7c73('0x17')](0xc8)[_0x7c73('0x34')]({'error':![],'message':_0x7c73('0x3d')});})[_0x7c73('0x1e')](handleError(_0x1e9c21));};exports['hold']=function(_0x1e50ee,_0x5a6fa1){logger['info'](_0x7c73('0x3e'),_0x1e50ee[_0x7c73('0x2c')]);var _0x3c8884=holdValidation[_0x7c73('0x37')](_0x1e50ee['body']);if(_0x3c8884[_0x7c73('0x26')]>0x0){return _0x5a6fa1['status'](0x190)[_0x7c73('0x34')](_0x3c8884);}var _0x51425d=_0x1e50ee['body'][_0x7c73('0x2d')];var _0x9c9369=_0x1e50ee[_0x7c73('0x2c')][_0x7c73('0x25')];return getAgent(_0x51425d)['then'](function(_0x291c15){logger[_0x7c73('0x2a')]('entityFound:',_0x291c15[_0x7c73('0x16')]);emit(util['format'](_0x7c73('0x32'),_0x291c15['name']),'webbar:hold',{'sessionId':_0x9c9369});return _0x5a6fa1[_0x7c73('0x17')](0xc8)['json']({'error':![],'message':'hold\x20executed!'});})[_0x7c73('0x1e')](handleError(_0x5a6fa1));};exports[_0x7c73('0x3f')]=function(_0x400077,_0x488308){logger['info'](_0x7c73('0x40'),_0x400077[_0x7c73('0x2c')]);var _0x181ee0=unholdValidation[_0x7c73('0x37')](_0x400077[_0x7c73('0x2c')]);if(_0x181ee0['length']>0x0){return _0x488308['status'](0x190)[_0x7c73('0x34')](_0x181ee0);}var _0x43fdd3=_0x400077[_0x7c73('0x2c')][_0x7c73('0x2d')];var _0x35bf24=_0x400077[_0x7c73('0x2c')]['sessionId'];return getAgent(_0x43fdd3)['then'](function(_0x213708){logger[_0x7c73('0x2a')](_0x7c73('0x30'),_0x213708['name']);emit(util['format'](_0x7c73('0x32'),_0x213708[_0x7c73('0x16')]),_0x7c73('0x41'),{'sessionId':_0x35bf24});return _0x488308[_0x7c73('0x17')](0xc8)[_0x7c73('0x34')]({'error':![],'message':_0x7c73('0x42')});})['catch'](handleError(_0x488308));};exports['calls']=function(_0x2fc151,_0x25d61f){logger[_0x7c73('0x2a')](_0x7c73('0x43'),_0x25d61f[_0x7c73('0x2c')]);var _0x2d8461=callsValidation[_0x7c73('0x37')](_0x2fc151[_0x7c73('0x2c')]);if(_0x2d8461[_0x7c73('0x26')]>0x0){return _0x25d61f['status'](0x190)[_0x7c73('0x34')](_0x2d8461);}var _0x1b4967=_0x2fc151[_0x7c73('0x2c')][_0x7c73('0x2d')];var _0xa76b80=respondWithRpcPromise('VoiceChannels');var _0x80b2a5=getAgent(_0x1b4967);return Promise[_0x7c73('0x22')]([_0xa76b80,_0x80b2a5])[_0x7c73('0x1a')](function(_0x403537){var _0x33e8b9=_0x403537[0x0];var _0x542945=_0x403537[0x1];var _0x3d3e69=_[_0x7c73('0x23')](_0x33e8b9['rows'],function(_0x29c8b1){return _0x29c8b1[_0x7c73('0x44')]==_0x542945['id'];});return _0x25d61f['status'](0xc8)['json']({'count':_0x3d3e69[_0x7c73('0x26')],'rows':_0x3d3e69});})[_0x7c73('0x1e')](handleError(_0x25d61f));};exports[_0x7c73('0x45')]=function(_0x23ff58,_0x49756c){logger[_0x7c73('0x2a')](_0x7c73('0x46'),_0x23ff58[_0x7c73('0x2c')]);var _0x5a60c4=conferenceValidation[_0x7c73('0x37')](_0x23ff58[_0x7c73('0x2c')]);if(_0x5a60c4[_0x7c73('0x26')]>0x0){return _0x49756c[_0x7c73('0x17')](0x190)['json'](_0x5a60c4);}var _0x481a37=_0x23ff58[_0x7c73('0x2c')]['userId'];return getAgent(_0x481a37)['then'](function(_0x5f3ec7){logger[_0x7c73('0x2a')](_0x7c73('0x30'),_0x5f3ec7[_0x7c73('0x16')]);emit(util[_0x7c73('0x31')](_0x7c73('0x32'),_0x5f3ec7[_0x7c73('0x16')]),_0x7c73('0x47'));return _0x49756c[_0x7c73('0x17')](0xc8)[_0x7c73('0x34')]({'error':![],'message':_0x7c73('0x48')});})['catch'](handleError(_0x49756c));};exports[_0x7c73('0x49')]=function(_0x1af980,_0x393326){logger['info']('transfer\x20fired:',_0x1af980[_0x7c73('0x2c')]);var _0x32eca5=transferValidation['validate'](_0x1af980['body']);if(_0x32eca5[_0x7c73('0x26')]>0x0){return _0x393326[_0x7c73('0x17')](0x190)[_0x7c73('0x34')](_0x32eca5);}var _0x1423d7=_0x1af980[_0x7c73('0x2c')][_0x7c73('0x2d')];var _0x426881=_0x1af980['body'][_0x7c73('0x25')];var _0x4433d8=_0x1af980[_0x7c73('0x2c')][_0x7c73('0x4a')];return getAgent(_0x1423d7)['then'](function(_0x5ccfca){logger[_0x7c73('0x2a')](_0x7c73('0x30'),_0x5ccfca['name']);emit(util[_0x7c73('0x31')](_0x7c73('0x32'),_0x5ccfca[_0x7c73('0x16')]),'webbar:transfer',{'sessionId':_0x426881,'transferNumber':_0x4433d8});return _0x393326[_0x7c73('0x17')](0xc8)[_0x7c73('0x34')]({'error':![],'message':_0x7c73('0x4b')});})[_0x7c73('0x1e')](handleError(_0x393326));};
\ No newline at end of file
diff --git a/server/api/whatsappAccount/index.js b/server/api/whatsappAccount/index.js
index fac1091..58b9f5a 100644
--- a/server/api/whatsappAccount/index.js
+++ b/server/api/whatsappAccount/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xb0e8=['../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappAccount.controller','get','isAuthenticated','index','/describe','describe','/:id','show','getDispositions','/:id/canned_answers','getAnswers','/:id/users','/:id/applications','getApplications','post','create','/:id/dispositions','addDisposition','addAnswer','addAgents','addApplications','/:id/notify','/:id/send','send','update','delete','destroy','removeDispositions','removeAnswers','removeAgents','multer','path','connect-timeout','express','Router'];(function(_0x139701,_0x171296){var _0x2289c0=function(_0x5bbf96){while(--_0x5bbf96){_0x139701['push'](_0x139701['shift']());}};_0x2289c0(++_0x171296);}(_0xb0e8,0x19d));var _0x8b0e=function(_0x256422,_0x367394){_0x256422=_0x256422-0x0;var _0x55dddc=_0xb0e8[_0x256422];return _0x55dddc;};'use strict';var multer=require(_0x8b0e('0x0'));var util=require('util');var path=require(_0x8b0e('0x1'));var timeout=require(_0x8b0e('0x2'));var express=require(_0x8b0e('0x3'));var router=express[_0x8b0e('0x4')]();var auth=require(_0x8b0e('0x5'));var interaction=require(_0x8b0e('0x6'));var config=require(_0x8b0e('0x7'));var controller=require(_0x8b0e('0x8'));router[_0x8b0e('0x9')]('/',auth[_0x8b0e('0xa')](),controller[_0x8b0e('0xb')]);router[_0x8b0e('0x9')](_0x8b0e('0xc'),auth[_0x8b0e('0xa')](),controller[_0x8b0e('0xd')]);router['get'](_0x8b0e('0xe'),auth['isAuthenticated'](),controller[_0x8b0e('0xf')]);router['get']('/:id/dispositions',auth[_0x8b0e('0xa')](),controller[_0x8b0e('0x10')]);router[_0x8b0e('0x9')](_0x8b0e('0x11'),auth[_0x8b0e('0xa')](),controller[_0x8b0e('0x12')]);router[_0x8b0e('0x9')](_0x8b0e('0x13'),auth[_0x8b0e('0xa')](),controller['getAgents']);router[_0x8b0e('0x9')](_0x8b0e('0x14'),auth['isAuthenticated'](),controller[_0x8b0e('0x15')]);router[_0x8b0e('0x16')]('/',auth[_0x8b0e('0xa')](),controller[_0x8b0e('0x17')]);router[_0x8b0e('0x16')](_0x8b0e('0x18'),auth[_0x8b0e('0xa')](),controller[_0x8b0e('0x19')]);router[_0x8b0e('0x16')](_0x8b0e('0x11'),auth[_0x8b0e('0xa')](),controller[_0x8b0e('0x1a')]);router[_0x8b0e('0x16')](_0x8b0e('0x13'),auth[_0x8b0e('0xa')](),controller[_0x8b0e('0x1b')]);router[_0x8b0e('0x16')]('/:id/applications',auth[_0x8b0e('0xa')](),controller[_0x8b0e('0x1c')]);router[_0x8b0e('0x16')](_0x8b0e('0x1d'),controller['notify']);router[_0x8b0e('0x16')](_0x8b0e('0x1e'),auth[_0x8b0e('0xa')](),controller[_0x8b0e('0x1f')]);router['put']('/:id',auth[_0x8b0e('0xa')](),controller[_0x8b0e('0x20')]);router[_0x8b0e('0x21')](_0x8b0e('0xe'),auth['isAuthenticated'](),controller[_0x8b0e('0x22')]);router[_0x8b0e('0x21')](_0x8b0e('0x18'),auth[_0x8b0e('0xa')](),controller[_0x8b0e('0x23')]);router[_0x8b0e('0x21')](_0x8b0e('0x11'),auth[_0x8b0e('0xa')](),controller[_0x8b0e('0x24')]);router[_0x8b0e('0x21')](_0x8b0e('0x13'),auth[_0x8b0e('0xa')](),controller[_0x8b0e('0x25')]);module['exports']=router;
\ No newline at end of file
+var _0xead3=['put','update','destroy','removeAnswers','delete','removeAgents','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappAccount.controller','get','isAuthenticated','/describe','describe','/:id','show','/:id/dispositions','/:id/canned_answers','/:id/users','getAgents','/:id/applications','post','create','addDisposition','addAnswer','addAgents','addApplications','/:id/notify','notify','/:id/send','send'];(function(_0x44ce59,_0x41c568){var _0x36510d=function(_0x29de43){while(--_0x29de43){_0x44ce59['push'](_0x44ce59['shift']());}};_0x36510d(++_0x41c568);}(_0xead3,0x1c3));var _0x3ead=function(_0x25f0ea,_0xd6d029){_0x25f0ea=_0x25f0ea-0x0;var _0x275268=_0xead3[_0x25f0ea];return _0x275268;};'use strict';var multer=require(_0x3ead('0x0'));var util=require('util');var path=require(_0x3ead('0x1'));var timeout=require(_0x3ead('0x2'));var express=require(_0x3ead('0x3'));var router=express[_0x3ead('0x4')]();var auth=require(_0x3ead('0x5'));var interaction=require(_0x3ead('0x6'));var config=require(_0x3ead('0x7'));var controller=require(_0x3ead('0x8'));router[_0x3ead('0x9')]('/',auth[_0x3ead('0xa')](),controller['index']);router[_0x3ead('0x9')](_0x3ead('0xb'),auth['isAuthenticated'](),controller[_0x3ead('0xc')]);router[_0x3ead('0x9')](_0x3ead('0xd'),auth[_0x3ead('0xa')](),controller[_0x3ead('0xe')]);router[_0x3ead('0x9')](_0x3ead('0xf'),auth['isAuthenticated'](),controller['getDispositions']);router[_0x3ead('0x9')](_0x3ead('0x10'),auth[_0x3ead('0xa')](),controller['getAnswers']);router[_0x3ead('0x9')](_0x3ead('0x11'),auth[_0x3ead('0xa')](),controller[_0x3ead('0x12')]);router[_0x3ead('0x9')](_0x3ead('0x13'),auth[_0x3ead('0xa')](),controller['getApplications']);router[_0x3ead('0x14')]('/',auth[_0x3ead('0xa')](),controller[_0x3ead('0x15')]);router['post']('/:id/dispositions',auth['isAuthenticated'](),controller[_0x3ead('0x16')]);router[_0x3ead('0x14')](_0x3ead('0x10'),auth[_0x3ead('0xa')](),controller[_0x3ead('0x17')]);router[_0x3ead('0x14')](_0x3ead('0x11'),auth[_0x3ead('0xa')](),controller[_0x3ead('0x18')]);router[_0x3ead('0x14')](_0x3ead('0x13'),auth[_0x3ead('0xa')](),controller[_0x3ead('0x19')]);router[_0x3ead('0x14')](_0x3ead('0x1a'),controller[_0x3ead('0x1b')]);router['post'](_0x3ead('0x1c'),auth[_0x3ead('0xa')](),controller[_0x3ead('0x1d')]);router[_0x3ead('0x1e')](_0x3ead('0xd'),auth[_0x3ead('0xa')](),controller[_0x3ead('0x1f')]);router['delete']('/:id',auth[_0x3ead('0xa')](),controller[_0x3ead('0x20')]);router['delete'](_0x3ead('0xf'),auth['isAuthenticated'](),controller['removeDispositions']);router['delete'](_0x3ead('0x10'),auth[_0x3ead('0xa')](),controller[_0x3ead('0x21')]);router[_0x3ead('0x22')](_0x3ead('0x11'),auth[_0x3ead('0xa')](),controller[_0x3ead('0x23')]);module[_0x3ead('0x24')]=router;
\ No newline at end of file
diff --git a/server/api/whatsappAccount/whatsappAccount.attributes.js b/server/api/whatsappAccount/whatsappAccount.attributes.js
index f9352ae..5365a4a 100644
--- a/server/api/whatsappAccount/whatsappAccount.attributes.js
+++ b/server/api/whatsappAccount/whatsappAccount.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xb68e=['twilio','TEXT','BOOLEAN','INTEGER','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','exports','STRING','name','generate'];(function(_0x1f1a97,_0xadfc15){var _0x29fc6a=function(_0x38c180){while(--_0x38c180){_0x1f1a97['push'](_0x1f1a97['shift']());}};_0x29fc6a(++_0xadfc15);}(_0xb68e,0xb0));var _0xeb68=function(_0x3397cb,_0x9743cb){_0x3397cb=_0x3397cb-0x0;var _0x119eb1=_0xb68e[_0x3397cb];return _0x119eb1;};'use strict';var Sequelize=require('sequelize');var rs=require('randomstring');module[_0xeb68('0x0')]={'name':{'type':Sequelize[_0xeb68('0x1')],'unique':_0xeb68('0x2'),'allowNull':![]},'key':{'type':Sequelize[_0xeb68('0x1')],'allowNull':![]},'remote':{'type':Sequelize[_0xeb68('0x1')],'allowNull':![]},'token':{'type':Sequelize[_0xeb68('0x1')],'defaultValue':function(){return rs[_0xeb68('0x3')]();}},'phone':{'type':Sequelize[_0xeb68('0x1')]},'type':{'type':Sequelize['ENUM'](_0xeb68('0x4'))},'accountSid':{'type':Sequelize[_0xeb68('0x1')]},'authToken':{'type':Sequelize[_0xeb68('0x1')]},'notificationTemplate':{'type':Sequelize[_0xeb68('0x5')],'defaultValue':function(){return'Account:\x20{{account.name}} {{#queue}}Queue:\x20{{queue.name}} {{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'notificationShake':{'type':Sequelize[_0xeb68('0x6')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xeb68('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xeb68('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xeb68('0x6')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xeb68('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xeb68('0x7')],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0xeb68('0x6')],'defaultValue':![],'comment':_0xeb68('0x8'),'set':function(_0x18c16e){if(!_0x18c16e){this[_0xeb68('0x9')](_0xeb68('0xa'),null);}this[_0xeb68('0x9')](_0xeb68('0xb'),_0x18c16e);}},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0xb838=['name','generate','twilio','TEXT','Account:\x20{{account.name}} {{#queue}}Queue:\x20{{queue.name}} {{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','randomstring','STRING'];(function(_0xe1b5f6,_0x210c09){var _0x44636e=function(_0x3a3212){while(--_0x3a3212){_0xe1b5f6['push'](_0xe1b5f6['shift']());}};_0x44636e(++_0x210c09);}(_0xb838,0x165));var _0x8b83=function(_0x2a91ba,_0x25af3e){_0x2a91ba=_0x2a91ba-0x0;var _0x8be938=_0xb838[_0x2a91ba];return _0x8be938;};'use strict';var Sequelize=require(_0x8b83('0x0'));var rs=require(_0x8b83('0x1'));module['exports']={'name':{'type':Sequelize[_0x8b83('0x2')],'unique':_0x8b83('0x3'),'allowNull':![]},'key':{'type':Sequelize[_0x8b83('0x2')],'allowNull':![]},'remote':{'type':Sequelize[_0x8b83('0x2')],'allowNull':![]},'token':{'type':Sequelize[_0x8b83('0x2')],'defaultValue':function(){return rs[_0x8b83('0x4')]();}},'phone':{'type':Sequelize[_0x8b83('0x2')]},'type':{'type':Sequelize['ENUM'](_0x8b83('0x5'))},'accountSid':{'type':Sequelize['STRING']},'authToken':{'type':Sequelize[_0x8b83('0x2')]},'notificationTemplate':{'type':Sequelize[_0x8b83('0x6')],'defaultValue':function(){return _0x8b83('0x7');}},'notificationSound':{'type':Sequelize[_0x8b83('0x8')],'defaultValue':![]},'notificationShake':{'type':Sequelize[_0x8b83('0x8')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x8b83('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x8b83('0x8')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x8b83('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x8b83('0x8')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x8b83('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x8b83('0x9')],'comment':_0x8b83('0xa')},'mandatoryDisposition':{'type':Sequelize[_0x8b83('0x8')],'defaultValue':![],'comment':_0x8b83('0xb'),'set':function(_0x34462b){if(!_0x34462b){this[_0x8b83('0xc')](_0x8b83('0xd'),null);}this[_0x8b83('0xc')](_0x8b83('0xe'),_0x34462b);}},'description':{'type':Sequelize[_0x8b83('0x2')]}};
\ No newline at end of file
diff --git a/server/api/whatsappAccount/whatsappAccount.controller.js b/server/api/whatsappAccount/whatsappAccount.controller.js
index 5378029..2cb876f 100644
--- a/server/api/whatsappAccount/whatsappAccount.controller.js
+++ b/server/api/whatsappAccount/whatsappAccount.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xdb94=['path','ejs','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','defaults','socket.io-emitter','redis','register','jayson/promise','client','http','Sequelize','ValidationError','request','then','WhatsappAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','catch','sendStatus','status','end','json','offset','limit','set','apply','save','update','get','WhatsappAccounts','UserProfileResource','destroy','stack','name','mandatoryDispositionPause','map','WhatsappAccount','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','count','includeAll','include','findAll','rows','show','Pause','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','params','describe','WhatsappAccountId','Disposition','getDispositions','findOne','hasOwnProperty','order','removeDispositions','addAnswer','CannedAnswer','getAnswers','removeAnswers','ids','addAgents','omit','spread','emit','userWhatsappAccount:save','removeAgents','userWhatsappAccount:remove','getAgents','User','addApplications','transaction','WhatsappApplication','bulkCreate','findAndCountAll','priority','getApplications','notify','whatsapp','Applications','account','applications','CmContact','no\x20available\x20attributes','createdAt','updatedAt','difference','CompanyId','ListId','mobile','twilio','from','replace','whatsapp:','Body','messageId','from\x20is\x20mandatory','isNil','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','Contacts','list','WhatsappInteraction','interaction','created','autoclose','push','close','unmanaged','*,*,*,*','WhatsappMessage','ContactId','UserId','unshift','Start','startRouting','WhatsappAccount,\x20%s,\x20%s,\x20%s','entity\x20found','WhatsappAccount,\x20%s,\x20%s,\x20%s,\x20%s','text/xml','\x0a ','body\x20is\x20mandatory\x20and\x20not\x20empty','CmList','List','Messages','dataValues','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird'];(function(_0x59fd28,_0x52e204){var _0x1136c9=function(_0x552d98){while(--_0x552d98){_0x59fd28['push'](_0x59fd28['shift']());}};_0x1136c9(++_0x52e204);}(_0xdb94,0xab));var _0x4db9=function(_0x4323c6,_0x2dbf03){_0x4323c6=_0x4323c6-0x0;var _0x2a7740=_0xdb94[_0x4323c6];return _0x2a7740;};'use strict';var pdf=require(_0x4db9('0x0'));var emlformat=require(_0x4db9('0x1'));var rimraf=require(_0x4db9('0x2'));var zipdir=require(_0x4db9('0x3'));var jsonpatch=require(_0x4db9('0x4'));var rp=require('request-promise');var moment=require(_0x4db9('0x5'));var BPromise=require(_0x4db9('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0x4db9('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x4db9('0x8'));var fs=require('fs');var _=require('lodash');var squel=require(_0x4db9('0x9'));var crypto=require('crypto');var jsforce=require(_0x4db9('0xa'));var deskjs=require(_0x4db9('0xb'));var toCsv=require(_0x4db9('0xc'));var querystring=require(_0x4db9('0xd'));var Papa=require(_0x4db9('0xe'));var Redis=require(_0x4db9('0xf'));var authService=require(_0x4db9('0x10'));var qs=require(_0x4db9('0x11'));var as=require(_0x4db9('0x12'));var hardwareService=require(_0x4db9('0x13'));var logger=require(_0x4db9('0x14'))('api');var utils=require(_0x4db9('0x15'));var config=require(_0x4db9('0x16'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x4db9('0x17')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x4db9('0x18'))(new Redis(config[_0x4db9('0x19')]));require('./whatsappAccount.socket')[_0x4db9('0x1a')](socket);var jayson=require(_0x4db9('0x1b'));var client=jayson[_0x4db9('0x1c')][_0x4db9('0x1d')]({'port':0x232c});function checkPasswordPattern(_0x51d024,_0x5e04ab,_0x102274){if(_0x102274){var _0x34de1a=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x34de1a['test'](_0x5e04ab)){return _0x51d024;}else{throw new db[(_0x4db9('0x1e'))][(_0x4db9('0x1f'))]('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x51d024;}}function respondWithRpcPromise(_0x5a85c4,_0x250a80,_0x143b88,_0x462af3){return new BPromise(function(_0xa693c4,_0x1d3c33){var _0x55494a=_0x462af3||client;return _0x55494a[_0x4db9('0x20')](_0x5a85c4,_0x143b88)[_0x4db9('0x21')](function(_0x11012e){logger['info'](_0x4db9('0x22'),_0x250a80,_0x4db9('0x23'));logger[_0x4db9('0x24')]('WhatsappAccount,\x20%s,\x20%s,\x20%s',_0x250a80,_0x4db9('0x23'),JSON[_0x4db9('0x25')](_0x11012e));if(_0x11012e[_0x4db9('0x26')]){if(_0x11012e[_0x4db9('0x26')][_0x4db9('0x27')]===0x1f4){logger[_0x4db9('0x26')](_0x4db9('0x22'),_0x250a80,_0x11012e['error'][_0x4db9('0x28')]);return _0x1d3c33(_0x11012e[_0x4db9('0x26')][_0x4db9('0x28')]);}logger[_0x4db9('0x26')]('WhatsappAccount,\x20%s,\x20%s',_0x250a80,_0x11012e[_0x4db9('0x26')][_0x4db9('0x28')]);return _0xa693c4(_0x11012e['error'][_0x4db9('0x28')]);}else{logger[_0x4db9('0x29')](_0x4db9('0x22'),_0x250a80,'request\x20sent');_0xa693c4(_0x11012e[_0x4db9('0x2a')][_0x4db9('0x28')]);}})[_0x4db9('0x2b')](function(_0x2d330e){logger[_0x4db9('0x26')](_0x4db9('0x22'),_0x250a80,_0x2d330e);_0x1d3c33(_0x2d330e);});});}function respondWithStatusCode(_0x385400,_0x2a56b8){_0x2a56b8=_0x2a56b8||0xcc;return function(_0x3d0f12){if(_0x3d0f12){return _0x385400[_0x4db9('0x2c')](_0x2a56b8);}return _0x385400[_0x4db9('0x2d')](_0x2a56b8)[_0x4db9('0x2e')]();};}function respondWithResult(_0x2d646d,_0x20f133){_0x20f133=_0x20f133||0xc8;return function(_0x583861){if(_0x583861){return _0x2d646d['status'](_0x20f133)[_0x4db9('0x2f')](_0x583861);}};}function respondWithFilteredResult(_0x331279,_0x119371){return function(_0x207f2c){if(_0x207f2c){var _0x2af884=_0x207f2c['count'],_0x459131=_0x119371[_0x4db9('0x30')],_0x4dc946=_0x119371[_0x4db9('0x30')]+_0x119371[_0x4db9('0x31')],_0x375834;if(_0x4dc946>=_0x2af884){_0x4dc946=_0x2af884;_0x375834=0xc8;}else{_0x375834=0xce;}_0x331279[_0x4db9('0x2d')](_0x375834);return _0x331279[_0x4db9('0x32')]('Content-Range',_0x459131+'-'+_0x4dc946+'/'+_0x2af884)['json'](_0x207f2c);}return null;};}function patchUpdates(_0x2940cd){return function(_0x49776b){try{jsonpatch[_0x4db9('0x33')](_0x49776b,_0x2940cd,!![]);}catch(_0xddc8b1){return BPromise['reject'](_0xddc8b1);}return _0x49776b[_0x4db9('0x34')]();};}function saveUpdates(_0x3131ba,_0x32c12d){return function(_0x4f396f){if(_0x4f396f){return _0x4f396f[_0x4db9('0x35')](_0x3131ba)['then'](function(_0x40226c){return _0x40226c;});}return null;};}function removeEntity(_0xb4d4fa,_0x1f4959){return function(_0x4dbcd3){if(_0x4dbcd3){return _0x4dbcd3['destroy']()[_0x4db9('0x21')](function(){var _0x1494bc=_0x4dbcd3[_0x4db9('0x36')]({'plain':!![]});var _0x3aec38=_0x4db9('0x37');return db[_0x4db9('0x38')][_0x4db9('0x39')]({'where':{'type':_0x3aec38,'resourceId':_0x1494bc['id']}})[_0x4db9('0x21')](function(){return _0x4dbcd3;});})[_0x4db9('0x21')](function(){_0xb4d4fa['status'](0xcc)[_0x4db9('0x2e')]();});}};}function handleEntityNotFound(_0x94536b,_0x2623ab){return function(_0x2acc28){if(!_0x2acc28){_0x94536b['sendStatus'](0x194);}return _0x2acc28;};}function handleError(_0x2e6425,_0x22fa73){_0x22fa73=_0x22fa73||0x1f4;return function(_0x326a92){logger['error'](_0x326a92[_0x4db9('0x3a')]);if(_0x326a92[_0x4db9('0x3b')]){delete _0x326a92[_0x4db9('0x3b')];}_0x2e6425[_0x4db9('0x2d')](_0x22fa73)['send'](_0x326a92);};}exports['index']=function(_0x41da52,_0x163077){var _0x32e62b={'include':[{'model':db['Pause'],'as':_0x4db9('0x3c')}]},_0x8bc540={},_0x345443={'count':0x0,'rows':[]};var _0x43b0d9=_[_0x4db9('0x3d')](db[_0x4db9('0x3e')][_0x4db9('0x3f')],function(_0x4c3ac6){return{'name':_0x4c3ac6[_0x4db9('0x40')],'type':_0x4c3ac6[_0x4db9('0x41')][_0x4db9('0x42')]};});_0x8bc540['model']=_[_0x4db9('0x3d')](_0x43b0d9,_0x4db9('0x3b'));_0x8bc540[_0x4db9('0x43')]=_[_0x4db9('0x44')](_0x41da52[_0x4db9('0x43')]);_0x8bc540[_0x4db9('0x45')]=_[_0x4db9('0x46')](_0x8bc540[_0x4db9('0x47')],_0x8bc540[_0x4db9('0x43')]);_0x32e62b[_0x4db9('0x48')]=_['intersection'](_0x8bc540['model'],qs['fields'](_0x41da52[_0x4db9('0x43')][_0x4db9('0x49')]));_0x32e62b['attributes']=_0x32e62b[_0x4db9('0x48')][_0x4db9('0x4a')]?_0x32e62b['attributes']:_0x8bc540['model'];if(!_0x41da52[_0x4db9('0x43')]['hasOwnProperty'](_0x4db9('0x4b'))){_0x32e62b[_0x4db9('0x31')]=qs['limit'](_0x41da52[_0x4db9('0x43')][_0x4db9('0x31')]);_0x32e62b['offset']=qs[_0x4db9('0x30')](_0x41da52[_0x4db9('0x43')][_0x4db9('0x30')]);}_0x32e62b['order']=qs['sort'](_0x41da52[_0x4db9('0x43')][_0x4db9('0x4c')]);_0x32e62b[_0x4db9('0x4d')]=qs[_0x4db9('0x45')](_[_0x4db9('0x4e')](_0x41da52[_0x4db9('0x43')],_0x8bc540[_0x4db9('0x45')]),_0x43b0d9);if(_0x41da52[_0x4db9('0x43')][_0x4db9('0x4f')]){_0x32e62b[_0x4db9('0x4d')]=_[_0x4db9('0x50')](_0x32e62b[_0x4db9('0x4d')],{'$or':_[_0x4db9('0x3d')](_0x43b0d9,function(_0x54bbd4){if(_0x54bbd4[_0x4db9('0x41')]!==_0x4db9('0x51')){var _0x3852f0={};_0x3852f0[_0x54bbd4[_0x4db9('0x3b')]]={'$like':'%'+_0x41da52[_0x4db9('0x43')][_0x4db9('0x4f')]+'%'};return _0x3852f0;}})});}_0x32e62b=_[_0x4db9('0x50')]({},_0x32e62b,_0x41da52[_0x4db9('0x52')]);var _0x4016d8={'where':_0x32e62b[_0x4db9('0x4d')]};return db[_0x4db9('0x3e')]['count'](_0x4016d8)['then'](function(_0x36cd58){_0x345443[_0x4db9('0x53')]=_0x36cd58;if(_0x41da52[_0x4db9('0x43')][_0x4db9('0x54')]){_0x32e62b[_0x4db9('0x55')]=[{'all':!![]}];}return db[_0x4db9('0x3e')][_0x4db9('0x56')](_0x32e62b);})[_0x4db9('0x21')](function(_0x4f1e36){_0x345443[_0x4db9('0x57')]=_0x4f1e36;return _0x345443;})[_0x4db9('0x21')](respondWithFilteredResult(_0x163077,_0x32e62b))[_0x4db9('0x2b')](handleError(_0x163077,null));};exports[_0x4db9('0x58')]=function(_0x3c1ad2,_0x2552f9){var _0x1226ea={'raw':![],'where':{'id':_0x3c1ad2['params']['id']},'include':[{'model':db[_0x4db9('0x59')],'as':_0x4db9('0x3c')}]},_0x3db087={};_0x3db087[_0x4db9('0x47')]=_[_0x4db9('0x44')](db[_0x4db9('0x3e')][_0x4db9('0x3f')]);_0x3db087['query']=_[_0x4db9('0x44')](_0x3c1ad2['query']);_0x3db087[_0x4db9('0x45')]=_['intersection'](_0x3db087['model'],_0x3db087[_0x4db9('0x43')]);_0x1226ea['attributes']=_[_0x4db9('0x46')](_0x3db087[_0x4db9('0x47')],qs[_0x4db9('0x49')](_0x3c1ad2[_0x4db9('0x43')]['fields']));_0x1226ea[_0x4db9('0x48')]=_0x1226ea['attributes'][_0x4db9('0x4a')]?_0x1226ea[_0x4db9('0x48')]:_0x3db087['model'];if(_0x3c1ad2[_0x4db9('0x43')]['includeAll']){_0x1226ea[_0x4db9('0x55')]=[{'all':!![]}];}_0x1226ea=_[_0x4db9('0x50')]({},_0x1226ea,_0x3c1ad2[_0x4db9('0x52')]);return db[_0x4db9('0x3e')][_0x4db9('0x5a')](_0x1226ea)[_0x4db9('0x21')](handleEntityNotFound(_0x2552f9,null))[_0x4db9('0x21')](respondWithResult(_0x2552f9,null))[_0x4db9('0x2b')](handleError(_0x2552f9,null));};exports[_0x4db9('0x5b')]=function(_0x14251f,_0x19649c){return db[_0x4db9('0x3e')][_0x4db9('0x5b')](_0x14251f[_0x4db9('0x5c')],{})[_0x4db9('0x21')](function(_0x5b2d83){var _0x225382=_0x14251f[_0x4db9('0x5d')]['get']({'plain':!![]});if(!_0x225382)throw new Error(_0x4db9('0x5e'));if(_0x225382[_0x4db9('0x5f')]===_0x4db9('0x5d')){var _0x200e6d=_0x5b2d83[_0x4db9('0x36')]({'plain':!![]});var _0x2b74c6=_0x4db9('0x37');return db[_0x4db9('0x60')][_0x4db9('0x5a')]({'where':{'name':_0x2b74c6,'userProfileId':_0x225382['userProfileId']},'raw':!![]})['then'](function(_0x8ede64){if(_0x8ede64&&_0x8ede64[_0x4db9('0x61')]===0x0){return db[_0x4db9('0x38')][_0x4db9('0x5b')]({'name':_0x200e6d[_0x4db9('0x3b')],'resourceId':_0x200e6d['id'],'type':_0x8ede64[_0x4db9('0x3b')],'sectionId':_0x8ede64['id']},{})[_0x4db9('0x21')](function(){return _0x5b2d83;});}else{return _0x5b2d83;}})[_0x4db9('0x2b')](function(_0x3ac041){logger[_0x4db9('0x26')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3ac041);throw _0x3ac041;});}return _0x5b2d83;})[_0x4db9('0x21')](respondWithResult(_0x19649c,0xc9))['catch'](handleError(_0x19649c,null));};exports['update']=function(_0x5f009c,_0x4dd2aa){if(_0x5f009c[_0x4db9('0x5c')]['id']){delete _0x5f009c['body']['id'];}return db['WhatsappAccount'][_0x4db9('0x5a')]({'where':{'id':_0x5f009c[_0x4db9('0x62')]['id']},'include':[{'model':db[_0x4db9('0x59')],'as':_0x4db9('0x3c')}]})[_0x4db9('0x21')](handleEntityNotFound(_0x4dd2aa,null))[_0x4db9('0x21')](saveUpdates(_0x5f009c[_0x4db9('0x5c')],null))[_0x4db9('0x21')](respondWithResult(_0x4dd2aa,null))[_0x4db9('0x2b')](handleError(_0x4dd2aa,null));};exports[_0x4db9('0x39')]=function(_0xd018bb,_0x3c5777){return db[_0x4db9('0x3e')][_0x4db9('0x5a')]({'where':{'id':_0xd018bb[_0x4db9('0x62')]['id']}})[_0x4db9('0x21')](handleEntityNotFound(_0x3c5777,null))['then'](removeEntity(_0x3c5777,null))['catch'](handleError(_0x3c5777,null));};exports['describe']=function(_0x154666,_0x4de478){return db[_0x4db9('0x3e')][_0x4db9('0x63')]()[_0x4db9('0x21')](respondWithResult(_0x4de478,null))['catch'](handleError(_0x4de478,null));};exports['addDisposition']=function(_0x2124c3,_0x564bcc,_0x2f3746){if(_0x2124c3[_0x4db9('0x5c')]['id']){delete _0x2124c3[_0x4db9('0x5c')]['id'];}return db[_0x4db9('0x3e')][_0x4db9('0x5a')]({'where':{'id':_0x2124c3['params']['id']}})[_0x4db9('0x21')](handleEntityNotFound(_0x564bcc,null))['then'](function(_0x2abc4d){if(_0x2abc4d){_0x2124c3[_0x4db9('0x5c')][_0x4db9('0x64')]=_0x2abc4d['id'];return db[_0x4db9('0x65')][_0x4db9('0x5b')](_0x2124c3['body']);}})['then'](respondWithResult(_0x564bcc,null))[_0x4db9('0x2b')](handleError(_0x564bcc,null));};exports[_0x4db9('0x66')]=function(_0x4d1f4a,_0x55bcbd,_0x3a96d7){var _0x598fc8={'raw':![],'where':{}};var _0x3f8009={};var _0x4d95a0={'count':0x0,'rows':[]};return db[_0x4db9('0x3e')][_0x4db9('0x67')]({'where':{'id':_0x4d1f4a['params']['id']}})['then'](handleEntityNotFound(_0x55bcbd,null))[_0x4db9('0x21')](function(_0x15266e){if(_0x15266e){_0x3f8009[_0x4db9('0x47')]=_[_0x4db9('0x44')](db[_0x4db9('0x65')]['rawAttributes']);_0x3f8009['query']=_['keys'](_0x4d1f4a['query']);_0x3f8009[_0x4db9('0x45')]=_[_0x4db9('0x46')](_0x3f8009[_0x4db9('0x47')],_0x3f8009[_0x4db9('0x43')]);_0x598fc8['attributes']=_[_0x4db9('0x46')](_0x3f8009['model'],qs[_0x4db9('0x49')](_0x4d1f4a[_0x4db9('0x43')][_0x4db9('0x49')]));_0x598fc8[_0x4db9('0x48')]=_0x598fc8[_0x4db9('0x48')][_0x4db9('0x4a')]?_0x598fc8[_0x4db9('0x48')]:_0x3f8009['model'];if(!_0x4d1f4a[_0x4db9('0x43')][_0x4db9('0x68')](_0x4db9('0x4b'))){_0x598fc8['limit']=qs[_0x4db9('0x31')](_0x4d1f4a[_0x4db9('0x43')]['limit']);_0x598fc8['offset']=qs[_0x4db9('0x30')](_0x4d1f4a['query']['offset']);}_0x598fc8[_0x4db9('0x69')]=qs[_0x4db9('0x4c')](_0x4d1f4a[_0x4db9('0x43')]['sort']);_0x598fc8['where']=qs['filters'](_['pick'](_0x4d1f4a['query'],_0x3f8009[_0x4db9('0x45')]));_0x598fc8[_0x4db9('0x4d')][_0x4db9('0x64')]=_0x15266e['id'];if(_0x4d1f4a[_0x4db9('0x43')][_0x4db9('0x4f')]){_0x598fc8[_0x4db9('0x4d')]=_[_0x4db9('0x50')](_0x598fc8[_0x4db9('0x4d')],{'$or':_['map'](_0x598fc8[_0x4db9('0x48')],function(_0x427434){var _0x3b4839={};_0x3b4839[_0x427434]={'$like':'%'+_0x4d1f4a[_0x4db9('0x43')][_0x4db9('0x4f')]+'%'};return _0x3b4839;})});}_0x598fc8=_[_0x4db9('0x50')]({},_0x598fc8,_0x4d1f4a[_0x4db9('0x52')]);return db[_0x4db9('0x65')]['count']({'where':_0x598fc8[_0x4db9('0x4d')]})['then'](function(_0x17bbcb){_0x4d95a0[_0x4db9('0x53')]=_0x17bbcb;if(_0x4d1f4a[_0x4db9('0x43')][_0x4db9('0x54')]){_0x598fc8['include']=[{'all':!![]}];}return db['Disposition'][_0x4db9('0x56')](_0x598fc8);})['then'](function(_0x450ee1){_0x4d95a0[_0x4db9('0x57')]=_0x450ee1;return _0x4d95a0;});}})[_0x4db9('0x21')](respondWithFilteredResult(_0x55bcbd,_0x598fc8))[_0x4db9('0x2b')](handleError(_0x55bcbd,null));};exports[_0x4db9('0x6a')]=function(_0x31f55f,_0x421537,_0xdd8823){return db['WhatsappAccount'][_0x4db9('0x5a')]({'where':{'id':_0x31f55f[_0x4db9('0x62')]['id']}})[_0x4db9('0x21')](handleEntityNotFound(_0x421537,null))[_0x4db9('0x21')](function(_0x4c1c51){if(_0x4c1c51){return _0x4c1c51[_0x4db9('0x6a')](_0x31f55f[_0x4db9('0x43')]['ids']);}})[_0x4db9('0x21')](respondWithStatusCode(_0x421537,null))[_0x4db9('0x2b')](handleError(_0x421537,null));};exports[_0x4db9('0x6b')]=function(_0x561f4b,_0x5b40a4,_0x168d05){if(_0x561f4b[_0x4db9('0x5c')]['id']){delete _0x561f4b['body']['id'];}return db['WhatsappAccount'][_0x4db9('0x5a')]({'where':{'id':_0x561f4b[_0x4db9('0x62')]['id']}})[_0x4db9('0x21')](handleEntityNotFound(_0x5b40a4,null))[_0x4db9('0x21')](function(_0x34c0e9){if(_0x34c0e9){_0x561f4b[_0x4db9('0x5c')][_0x4db9('0x64')]=_0x34c0e9['id'];return db[_0x4db9('0x6c')][_0x4db9('0x5b')](_0x561f4b[_0x4db9('0x5c')]);}})[_0x4db9('0x21')](respondWithResult(_0x5b40a4,null))[_0x4db9('0x2b')](handleError(_0x5b40a4,null));};exports[_0x4db9('0x6d')]=function(_0x24ee49,_0x1c31fe,_0x51f7b4){var _0x766d10={'raw':![],'where':{}};var _0x541687={};var _0x1efd51={'count':0x0,'rows':[]};return db['WhatsappAccount'][_0x4db9('0x67')]({'where':{'id':_0x24ee49[_0x4db9('0x62')]['id']}})[_0x4db9('0x21')](handleEntityNotFound(_0x1c31fe,null))[_0x4db9('0x21')](function(_0xed6d75){if(_0xed6d75){_0x541687[_0x4db9('0x47')]=_[_0x4db9('0x44')](db[_0x4db9('0x6c')][_0x4db9('0x3f')]);_0x541687[_0x4db9('0x43')]=_[_0x4db9('0x44')](_0x24ee49[_0x4db9('0x43')]);_0x541687['filters']=_[_0x4db9('0x46')](_0x541687[_0x4db9('0x47')],_0x541687['query']);_0x766d10[_0x4db9('0x48')]=_[_0x4db9('0x46')](_0x541687[_0x4db9('0x47')],qs[_0x4db9('0x49')](_0x24ee49['query']['fields']));_0x766d10[_0x4db9('0x48')]=_0x766d10['attributes'][_0x4db9('0x4a')]?_0x766d10[_0x4db9('0x48')]:_0x541687[_0x4db9('0x47')];if(!_0x24ee49[_0x4db9('0x43')][_0x4db9('0x68')](_0x4db9('0x4b'))){_0x766d10['limit']=qs[_0x4db9('0x31')](_0x24ee49[_0x4db9('0x43')][_0x4db9('0x31')]);_0x766d10[_0x4db9('0x30')]=qs[_0x4db9('0x30')](_0x24ee49[_0x4db9('0x43')][_0x4db9('0x30')]);}_0x766d10['order']=qs[_0x4db9('0x4c')](_0x24ee49[_0x4db9('0x43')][_0x4db9('0x4c')]);_0x766d10[_0x4db9('0x4d')]=qs['filters'](_['pick'](_0x24ee49['query'],_0x541687[_0x4db9('0x45')]));_0x766d10[_0x4db9('0x4d')][_0x4db9('0x64')]=_0xed6d75['id'];if(_0x24ee49['query']['filter']){_0x766d10[_0x4db9('0x4d')]=_[_0x4db9('0x50')](_0x766d10['where'],{'$or':_['map'](_0x766d10[_0x4db9('0x48')],function(_0x187df4){var _0x48a88b={};_0x48a88b[_0x187df4]={'$like':'%'+_0x24ee49['query'][_0x4db9('0x4f')]+'%'};return _0x48a88b;})});}_0x766d10=_['merge']({},_0x766d10,_0x24ee49['options']);return db[_0x4db9('0x6c')][_0x4db9('0x53')]({'where':_0x766d10[_0x4db9('0x4d')]})['then'](function(_0x21975d){_0x1efd51['count']=_0x21975d;if(_0x24ee49[_0x4db9('0x43')]['includeAll']){_0x766d10[_0x4db9('0x55')]=[{'all':!![]}];}return db[_0x4db9('0x6c')][_0x4db9('0x56')](_0x766d10);})[_0x4db9('0x21')](function(_0x2075cf){_0x1efd51[_0x4db9('0x57')]=_0x2075cf;return _0x1efd51;});}})[_0x4db9('0x21')](respondWithFilteredResult(_0x1c31fe,_0x766d10))['catch'](handleError(_0x1c31fe,null));};exports['removeAnswers']=function(_0x5b6abf,_0x5dc771,_0x1de02e){return db['WhatsappAccount'][_0x4db9('0x5a')]({'where':{'id':_0x5b6abf['params']['id']}})['then'](handleEntityNotFound(_0x5dc771,null))[_0x4db9('0x21')](function(_0x4f2055){if(_0x4f2055){return _0x4f2055[_0x4db9('0x6e')](_0x5b6abf[_0x4db9('0x43')][_0x4db9('0x6f')]);}})[_0x4db9('0x21')](respondWithStatusCode(_0x5dc771,null))[_0x4db9('0x2b')](handleError(_0x5dc771,null));};exports[_0x4db9('0x70')]=function(_0x179e48,_0x23fd10,_0x416552){return db[_0x4db9('0x3e')][_0x4db9('0x5a')]({'where':{'id':_0x179e48[_0x4db9('0x62')]['id']}})[_0x4db9('0x21')](handleEntityNotFound(_0x23fd10,null))[_0x4db9('0x21')](function(_0x2f1200){if(_0x2f1200){return _0x2f1200['addAgents'](_0x179e48[_0x4db9('0x5c')][_0x4db9('0x6f')],_[_0x4db9('0x71')](_0x179e48[_0x4db9('0x5c')],[_0x4db9('0x6f'),'id'])||{})[_0x4db9('0x72')](function(_0x16f72f){for(var _0x5dc000=0x0;_0x5dc000<_0x179e48[_0x4db9('0x5c')][_0x4db9('0x6f')]['length'];_0x5dc000+=0x1){socket[_0x4db9('0x73')](_0x4db9('0x74'),{'UserId':_0x179e48[_0x4db9('0x5c')]['ids'][_0x5dc000],'WhatsappAccountId':_0x179e48['params']['id']});}return _0x16f72f;});}})[_0x4db9('0x21')](respondWithResult(_0x23fd10,null))[_0x4db9('0x2b')](handleError(_0x23fd10,null));};exports[_0x4db9('0x75')]=function(_0x2dd342,_0x546b70,_0x11de91){return db[_0x4db9('0x3e')][_0x4db9('0x5a')]({'where':{'id':_0x2dd342[_0x4db9('0x62')]['id']}})[_0x4db9('0x21')](handleEntityNotFound(_0x546b70,null))['then'](function(_0x28851e){if(_0x28851e){return _0x28851e[_0x4db9('0x75')](_0x2dd342[_0x4db9('0x43')]['ids'])[_0x4db9('0x21')](function(){if(_['isArray'](_0x2dd342['query'][_0x4db9('0x6f')])){for(var _0x22d686=0x0;_0x22d686<_0x2dd342[_0x4db9('0x43')][_0x4db9('0x6f')][_0x4db9('0x4a')];_0x22d686+=0x1){socket[_0x4db9('0x73')]('userWhatsappAccount:remove',{'UserId':Number(_0x2dd342[_0x4db9('0x43')][_0x4db9('0x6f')][_0x22d686]),'WhatsappAccountId':Number(_0x2dd342['params']['id'])});}}else{socket[_0x4db9('0x73')](_0x4db9('0x76'),{'UserId':Number(_0x2dd342[_0x4db9('0x43')]['ids']),'WhatsappAccountId':Number(_0x2dd342[_0x4db9('0x62')]['id'])});}});}})[_0x4db9('0x21')](respondWithStatusCode(_0x546b70,null))[_0x4db9('0x2b')](handleError(_0x546b70,null));};exports[_0x4db9('0x77')]=function(_0x18c5ad,_0x3c3d2a,_0x463100){var _0x5cbda0={};var _0x167ebb={};var _0xf74a65;var _0x48f481;return db[_0x4db9('0x3e')][_0x4db9('0x67')]({'where':{'id':_0x18c5ad[_0x4db9('0x62')]['id']}})[_0x4db9('0x21')](handleEntityNotFound(_0x3c3d2a,null))[_0x4db9('0x21')](function(_0x15056e){if(_0x15056e){_0xf74a65=_0x15056e;_0x167ebb['model']=_['keys'](db[_0x4db9('0x78')][_0x4db9('0x3f')]);_0x167ebb[_0x4db9('0x43')]=_[_0x4db9('0x44')](_0x18c5ad[_0x4db9('0x43')]);_0x167ebb['filters']=_[_0x4db9('0x46')](_0x167ebb[_0x4db9('0x47')],_0x167ebb[_0x4db9('0x43')]);_0x5cbda0['attributes']=_[_0x4db9('0x46')](_0x167ebb[_0x4db9('0x47')],qs['fields'](_0x18c5ad[_0x4db9('0x43')][_0x4db9('0x49')]));_0x5cbda0['attributes']=_0x5cbda0[_0x4db9('0x48')][_0x4db9('0x4a')]?_0x5cbda0[_0x4db9('0x48')]:_0x167ebb['model'];_0x5cbda0['order']=qs['sort'](_0x18c5ad[_0x4db9('0x43')][_0x4db9('0x4c')]);_0x5cbda0['where']=qs[_0x4db9('0x45')](_[_0x4db9('0x4e')](_0x18c5ad[_0x4db9('0x43')],_0x167ebb[_0x4db9('0x45')]));if(_0x18c5ad[_0x4db9('0x43')][_0x4db9('0x4f')]){_0x5cbda0[_0x4db9('0x4d')]=_['merge'](_0x5cbda0[_0x4db9('0x4d')],{'$or':_['map'](_0x5cbda0['attributes'],function(_0x1f2d3f){var _0x509b91={};_0x509b91[_0x1f2d3f]={'$like':'%'+_0x18c5ad[_0x4db9('0x43')]['filter']+'%'};return _0x509b91;})});}_0x5cbda0=_['merge']({},_0x5cbda0,_0x18c5ad['options']);return _0xf74a65['getAgents'](_0x5cbda0);}})[_0x4db9('0x21')](function(_0x11f240){if(_0x11f240){_0x48f481=_0x11f240[_0x4db9('0x4a')];if(!_0x18c5ad[_0x4db9('0x43')]['hasOwnProperty'](_0x4db9('0x4b'))){_0x5cbda0[_0x4db9('0x31')]=qs['limit'](_0x18c5ad[_0x4db9('0x43')][_0x4db9('0x31')]);_0x5cbda0[_0x4db9('0x30')]=qs[_0x4db9('0x30')](_0x18c5ad[_0x4db9('0x43')][_0x4db9('0x30')]);}return _0xf74a65['getAgents'](_0x5cbda0);}})[_0x4db9('0x21')](function(_0xab4d8b){if(_0xab4d8b){return _0xab4d8b?{'count':_0x48f481,'rows':_0xab4d8b}:null;}})['then'](respondWithResult(_0x3c3d2a,null))[_0x4db9('0x2b')](handleError(_0x3c3d2a,null));};exports[_0x4db9('0x79')]=function(_0x2e89cb,_0x19e6be,_0x37aec1){return db[_0x4db9('0x3e')][_0x4db9('0x67')]({'where':{'id':_0x2e89cb['params']['id']}})[_0x4db9('0x21')](handleEntityNotFound(_0x19e6be,null))[_0x4db9('0x21')](function(_0x26e344){if(_0x26e344){return db['sequelize'][_0x4db9('0x7a')](function(_0x51dbf9){return db[_0x4db9('0x7b')][_0x4db9('0x39')]({'where':{'WhatsappAccountId':_0x2e89cb[_0x4db9('0x62')]['id']},'transaction':_0x51dbf9})[_0x4db9('0x21')](function(_0x28f774){var _0x5b63fe=_[_0x4db9('0x3d')](_0x2e89cb[_0x4db9('0x5c')],function(_0x5bdb27){_0x5bdb27[_0x4db9('0x64')]=_0x2e89cb['params']['id'];return _0x5bdb27;});return db['WhatsappApplication'][_0x4db9('0x7c')](_0x5b63fe,{'transaction':_0x51dbf9});});})[_0x4db9('0x21')](function(){return db[_0x4db9('0x7b')][_0x4db9('0x7d')]({'where':{'WhatsappAccountId':_0x2e89cb[_0x4db9('0x62')]['id']},'order':_0x4db9('0x7e')});});}})[_0x4db9('0x21')](respondWithResult(_0x19e6be,null))[_0x4db9('0x2b')](handleError(_0x19e6be,null));};exports['getApplications']=function(_0x197857,_0xb9fc93,_0x37b157){var _0x970efa={};var _0x33c785={};var _0x4bfe67;var _0x538a24;return db['WhatsappAccount'][_0x4db9('0x67')]({'where':{'id':_0x197857['params']['id']}})[_0x4db9('0x21')](handleEntityNotFound(_0xb9fc93,null))[_0x4db9('0x21')](function(_0x3b7bdf){if(_0x3b7bdf){_0x4bfe67=_0x3b7bdf;_0x33c785['model']=_[_0x4db9('0x44')](db['WhatsappApplication'][_0x4db9('0x3f')]);_0x33c785[_0x4db9('0x43')]=_['keys'](_0x197857[_0x4db9('0x43')]);_0x33c785['filters']=_[_0x4db9('0x46')](_0x33c785[_0x4db9('0x47')],_0x33c785[_0x4db9('0x43')]);_0x970efa[_0x4db9('0x48')]=_[_0x4db9('0x46')](_0x33c785['model'],qs['fields'](_0x197857['query'][_0x4db9('0x49')]));_0x970efa[_0x4db9('0x48')]=_0x970efa[_0x4db9('0x48')][_0x4db9('0x4a')]?_0x970efa[_0x4db9('0x48')]:_0x33c785[_0x4db9('0x47')];_0x970efa[_0x4db9('0x69')]=qs[_0x4db9('0x4c')](_0x197857[_0x4db9('0x43')][_0x4db9('0x4c')]);_0x970efa[_0x4db9('0x4d')]=qs[_0x4db9('0x45')](_[_0x4db9('0x4e')](_0x197857[_0x4db9('0x43')],_0x33c785[_0x4db9('0x45')]));if(_0x197857[_0x4db9('0x43')][_0x4db9('0x4f')]){_0x970efa[_0x4db9('0x4d')]=_[_0x4db9('0x50')](_0x970efa[_0x4db9('0x4d')],{'$or':_[_0x4db9('0x3d')](_0x970efa['attributes'],function(_0x2630c0){var _0x5f13dc={};_0x5f13dc[_0x2630c0]={'$like':'%'+_0x197857[_0x4db9('0x43')]['filter']+'%'};return _0x5f13dc;})});}_0x970efa=_[_0x4db9('0x50')]({},_0x970efa,_0x197857[_0x4db9('0x52')]);return _0x4bfe67[_0x4db9('0x7f')](_0x970efa);}})[_0x4db9('0x21')](function(_0x49de94){if(_0x49de94){_0x538a24=_0x49de94[_0x4db9('0x4a')];if(!_0x197857[_0x4db9('0x43')]['hasOwnProperty']('nolimit')){_0x970efa[_0x4db9('0x31')]=qs[_0x4db9('0x31')](_0x197857[_0x4db9('0x43')][_0x4db9('0x31')]);_0x970efa[_0x4db9('0x30')]=qs[_0x4db9('0x30')](_0x197857['query'][_0x4db9('0x30')]);}return _0x4bfe67[_0x4db9('0x7f')](_0x970efa);}})[_0x4db9('0x21')](function(_0x53f24f){if(_0x53f24f){return _0x53f24f?{'count':_0x538a24,'rows':_0x53f24f}:null;}})[_0x4db9('0x21')](respondWithResult(_0xb9fc93,null))['catch'](handleError(_0xb9fc93,null));};exports[_0x4db9('0x80')]=function(_0x1f222c,_0x1a6eb7,_0x16bee2){var _0x15551c={'channel':_0x4db9('0x81')};var _0x17a236=[];var _0x2e0717=[];var _0x18ffad={};return db[_0x4db9('0x3e')]['find']({'where':{'id':_0x1f222c[_0x4db9('0x62')]['id']},'include':[{'model':db[_0x4db9('0x7b')],'as':_0x4db9('0x82')}]})[_0x4db9('0x21')](handleEntityNotFound(_0x1a6eb7,null))[_0x4db9('0x21')](function(_0x23d989){_0x15551c[_0x4db9('0x83')]=_0x23d989;_0x15551c[_0x4db9('0x84')]=_['orderBy'](_0x23d989['Applications'],['priority'],['asc']);if(_0x15551c[_0x4db9('0x83')]['Applications']){delete _0x15551c[_0x4db9('0x83')][_0x4db9('0x82')];}return db[_0x4db9('0x85')][_0x4db9('0x63')]();})[_0x4db9('0x21')](function(_0x252c9e){if(!_0x252c9e){throw new db[(_0x4db9('0x1e'))][(_0x4db9('0x1f'))](_0x4db9('0x86'));}_0x17a236=_['difference'](_['keys'](_0x252c9e),[_0x4db9('0x87'),_0x4db9('0x88')]);_0x2e0717=_[_0x4db9('0x89')](_[_0x4db9('0x44')](_0x252c9e),[_0x4db9('0x87'),_0x4db9('0x88'),_0x4db9('0x8a'),_0x4db9('0x8b')]);_0x15551c[_0x4db9('0x5c')]={'mapKey':_0x4db9('0x8c')};if(_0x15551c[_0x4db9('0x83')][_0x4db9('0x41')]&&_0x15551c['account'][_0x4db9('0x41')]===_0x4db9('0x8d')){_0x15551c[_0x4db9('0x5c')][_0x4db9('0x8e')]=_0x1f222c['body']['From'][_0x4db9('0x8f')](_0x4db9('0x90'),'');_0x15551c[_0x4db9('0x5c')]['body']=_0x1f222c[_0x4db9('0x5c')][_0x4db9('0x91')];_0x15551c['body'][_0x4db9('0x92')]=_0x1f222c[_0x4db9('0x5c')]['MessageSid'];}if(_0x15551c[_0x4db9('0x5c')]['id']){delete _0x15551c['body']['id'];}if(_['isNil'](_0x15551c['body']['from'])){throw new db[(_0x4db9('0x1e'))][(_0x4db9('0x1f'))](_0x4db9('0x93'));}if(_[_0x4db9('0x94')](_0x15551c[_0x4db9('0x5c')][_0x4db9('0x5c')])||_0x15551c[_0x4db9('0x5c')][_0x4db9('0x5c')]===''){throw new db[(_0x4db9('0x1e'))]['ValidationError']('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x4db9('0x94')](_0x15551c['body'][_0x4db9('0x95')])){throw new db[(_0x4db9('0x1e'))][(_0x4db9('0x1f'))](_0x4db9('0x96')+_0x2e0717);}if(!_['includes'](_0x2e0717,_0x15551c[_0x4db9('0x5c')]['mapKey'])){throw new db['Sequelize'][(_0x4db9('0x1f'))](_0x4db9('0x97')+_0x2e0717);}_0x18ffad[_0x15551c[_0x4db9('0x5c')][_0x4db9('0x95')]]=_0x15551c[_0x4db9('0x5c')]['from'];return db['CmList']['find']({'where':{'id':_0x15551c[_0x4db9('0x83')][_0x4db9('0x8b')]},'include':[{'model':db[_0x4db9('0x85')],'as':_0x4db9('0x98'),'where':_0x18ffad,'limit':0x1,'order':[[_0x4db9('0x88'),'DESC']]}]});})[_0x4db9('0x21')](handleEntityNotFound(_0x1a6eb7,null))[_0x4db9('0x21')](function(_0xd697ae){if(_0xd697ae){_0x15551c[_0x4db9('0x99')]=_[_0x4db9('0x71')](_0xd697ae,[_0x4db9('0x98')]);if(_0xd697ae[_0x4db9('0x98')][_0x4db9('0x4a')]){return _0xd697ae[_0x4db9('0x98')][0x0];}var _0x169c44=_['defaults'](_0x15551c[_0x4db9('0x5c')],{'firstName':_0x15551c[_0x4db9('0x5c')][_0x4db9('0x8e')],'ListId':_0xd697ae['id']});_0x169c44[_0x15551c[_0x4db9('0x5c')]['mapKey']]=_0x15551c[_0x4db9('0x5c')][_0x4db9('0x8e')];return db[_0x4db9('0x85')][_0x4db9('0x5b')](_0x169c44,{'fields':_0x17a236,'raw':!![]});}})[_0x4db9('0x21')](handleEntityNotFound(_0x1a6eb7,null))[_0x4db9('0x21')](function(_0x5af502){if(_0x5af502){_0x15551c['contact']=_0x5af502;var _0x529ec0={'ContactId':_0x5af502['id'],'phone':_0x15551c[_0x4db9('0x5c')][_0x4db9('0x8e')],'WhatsappAccountId':_0x1f222c[_0x4db9('0x62')]['id']};var _0x426bb4={'ContactId':_0x5af502['id'],'WhatsappAccountId':_0x1f222c['params']['id'],'closed':![]};return db[_0x4db9('0x9a')][_0x4db9('0x5a')]({'where':_0x426bb4})['then'](function(_0x42841d){if(_0x42841d){return[_0x42841d,![]];}return db[_0x4db9('0x9a')][_0x4db9('0x5b')](_0x529ec0)[_0x4db9('0x21')](function(_0x47df55){return[_0x47df55,!![]];});});}})[_0x4db9('0x72')](function(_0x5113a8,_0x428e08){_0x15551c[_0x4db9('0x9b')]=_0x5113a8[_0x4db9('0x36')]({'plain':!![]});_0x15551c[_0x4db9('0x9b')][_0x4db9('0x9c')]=![];if(_0x428e08){if(_0x15551c[_0x4db9('0x83')][_0x4db9('0x9d')]){_0x15551c[_0x4db9('0x84')][_0x4db9('0x9e')]({'id':0x0,'priority':_0x15551c['applications'][_0x4db9('0x4a')]+0x1,'app':_0x4db9('0x9f'),'appdata':_0x4db9('0xa0'),'interval':_0x4db9('0xa1')});}_0x15551c[_0x4db9('0x9b')][_0x4db9('0x9c')]=!![];}return db[_0x4db9('0xa2')][_0x4db9('0x5b')]({'phone':_0x15551c[_0x4db9('0x5c')][_0x4db9('0x8e')],'messageId':_0x15551c['body'][_0x4db9('0x92')],'body':_0x15551c['body']['body'],'WhatsappAccountId':_0x1f222c['params']['id'],'WhatsappInteractionId':_0x5113a8['id'],'direction':'in','ContactId':_0x5113a8[_0x4db9('0xa3')],'AttachmentId':_0x15551c[_0x4db9('0x5c')]['AttachmentId']});})[_0x4db9('0x21')](function(_0x35c15a){_0x15551c['message']=_0x35c15a;if(_0x15551c[_0x4db9('0x9b')][_0x4db9('0xa4')]){return db[_0x4db9('0x78')][_0x4db9('0x5a')]({'attributes':['id',_0x4db9('0x3b')],'where':{'id':_0x15551c[_0x4db9('0x9b')]['UserId']}})[_0x4db9('0x21')](function(_0x5984db){if(_0x5984db){_0x15551c[_0x4db9('0x84')][_0x4db9('0xa5')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x5984db['name']+','+(_0x15551c['account']['waitForTheAssignedAgent']||0xa),'interval':_0x4db9('0xa1')});}return respondWithRpcPromise(_0x4db9('0xa6'),_0x4db9('0xa7'),_0x15551c);});}return respondWithRpcPromise(_0x4db9('0xa6'),_0x4db9('0xa7'),_0x15551c);})['then'](function(_0x3d1704){if(_0x3d1704){var _0x56e247=0xc8;var _0x4321b6='receiveMessage';logger['info'](_0x4db9('0xa8'),_0x4321b6,_0x56e247,_0x4db9('0xa9'));logger[_0x4db9('0x24')](_0x4db9('0xaa'),_0x4321b6,_0x56e247,_0x4db9('0xa9'),JSON['stringify'](_0x3d1704));if(_0x15551c['account'][_0x4db9('0x41')]===_0x4db9('0x8d')){return _0x1a6eb7['status'](_0x56e247)['set']('Content-Type',_0x4db9('0xab'))['send'](_0x4db9('0xac'));}else{return _0x1a6eb7[_0x4db9('0x2d')](_0x56e247)[_0x4db9('0x2f')](_0x3d1704);}}})['catch'](handleError(_0x1a6eb7,null));};exports['send']=function(_0x224693,_0x2a3477,_0x3c1e3c){var _0x41046c,_0x210852,_0x751df4;if(_[_0x4db9('0x94')](_0x224693['body'][_0x4db9('0x5c')])||_0x224693['body'][_0x4db9('0x5c')]===''){throw new db[(_0x4db9('0x1e'))][(_0x4db9('0x1f'))](_0x4db9('0xad'));}if(_[_0x4db9('0x94')](_0x224693['body']['to'])){throw new db['Sequelize'][(_0x4db9('0x1f'))]('to\x20is\x20mandatory');}_0x41046c=_0x224693[_0x4db9('0x5c')]['to'];return db[_0x4db9('0x3e')][_0x4db9('0x5a')]({'where':{'id':_0x224693['params']['id']},'include':[{'model':db[_0x4db9('0xae')],'as':_0x4db9('0xaf'),'include':[{'model':db[_0x4db9('0x85')],'as':_0x4db9('0x98'),'where':{'mobile':_0x41046c},'limit':0x1,'order':[[_0x4db9('0x88'),'DESC']]}]}]})[_0x4db9('0x21')](handleEntityNotFound(_0x2a3477,null))[_0x4db9('0x21')](function(_0x193891){if(_0x193891&&_0x193891[_0x4db9('0xaf')]){_0x210852=_0x193891[_0x4db9('0x36')]({'plain':!![]});if(_0x210852[_0x4db9('0xaf')]&&_0x210852['List'][_0x4db9('0x98')]['length']){return _0x210852[_0x4db9('0xaf')][_0x4db9('0x98')][0x0];}return db[_0x4db9('0x85')]['create'](_[_0x4db9('0x17')](_0x224693[_0x4db9('0x5c')],{'firstName':_0x41046c,'mobile':_0x41046c,'phone':_0x41046c,'ListId':_0x210852[_0x4db9('0x8b')]}));}})[_0x4db9('0x21')](handleEntityNotFound(_0x2a3477,null))[_0x4db9('0x21')](function(_0x963fb5){if(_0x963fb5){_0x751df4=_0x963fb5;return db[_0x4db9('0x9a')][_0x4db9('0x5a')]({'where':{'ContactId':_0x751df4['id'],'closed':![],'WhatsappAccountId':_0x210852['id']}})['then'](function(_0x4856fb){if(_0x4856fb){return[_0x4856fb,![]];}return db[_0x4db9('0x9a')][_0x4db9('0x5b')]({'UserId':_0x224693[_0x4db9('0x5d')]['id'],'ContactId':_0x751df4['id'],'WhatsappAccountId':_0x210852['id'],'phone':_0x41046c,'firstMsgDirection':'out','Messages':[_['merge'](_0x224693['body'],{'read':![],'body':_0x224693[_0x4db9('0x5c')]['body'],'phone':_0x41046c,'WhatsappAccountId':_0x210852['id'],'UserId':_0x224693['user']['id'],'ContactId':_0x751df4['id']})]},{'include':[{'model':db[_0x4db9('0xa2')],'as':_0x4db9('0xb0')}]})[_0x4db9('0x21')](function(_0x19fbba){return[_0x19fbba,!![]];});});}})[_0x4db9('0x72')](function(_0x531de4,_0x7489d5){if(_0x7489d5){return _0x531de4;}return db[_0x4db9('0xa2')][_0x4db9('0x5b')](_[_0x4db9('0x50')](_0x224693[_0x4db9('0x5c')],{'read':![],'body':_0x224693[_0x4db9('0x5c')]['body'],'phone':_0x41046c,'WhatsappAccountId':_0x210852['id'],'WhatsappInteractionId':_0x531de4['id'],'UserId':_0x224693['user']['id'],'ContactId':_0x751df4['id']}))['then'](function(_0x3a6bde){_0x531de4[_0x4db9('0xb1')][_0x4db9('0xb0')]=[];_0x531de4[_0x4db9('0xb1')][_0x4db9('0xb0')][_0x4db9('0x9e')](_0x3a6bde[_0x4db9('0xb1')]);return _0x531de4;});})[_0x4db9('0x21')](respondWithResult(_0x2a3477,null))[_0x4db9('0x2b')](handleError(_0x2a3477,null));};
\ No newline at end of file
+var _0x593e=['created','ContactId','AttachmentId','UserId','unshift','agent','Start','startRouting','entity\x20found','stringify','text/xml','send','\x0a ','to\x20is\x20mandatory','DESC','List','ListId','WhatsappMessage','Messages','dataValues','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./whatsappAccount.socket','jayson/promise','client','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','then','info','WhatsappAccount,\x20%s,\x20%s','request\x20sent','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','error','message','result','status','count','offset','limit','set','Content-Range','apply','reject','save','update','destroy','get','WhatsappAccounts','UserProfileResource','end','name','Pause','mandatoryDispositionPause','map','rawAttributes','key','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','merge','type','VIRTUAL','filter','WhatsappAccount','includeAll','rows','catch','show','params','keys','include','options','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','body','find','describe','addDisposition','WhatsappAccountId','getDispositions','findOne','Disposition','order','pick','findAll','removeDispositions','addAnswer','CannedAnswer','ids','omit','spread','removeAgents','emit','userWhatsappAccount:remove','getAgents','User','addApplications','sequelize','transaction','WhatsappApplication','findAndCountAll','getApplications','notify','Applications','account','applications','orderBy','priority','asc','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','twilio','from','whatsapp:','Body','messageId','MessageSid','isNil','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','Contacts','list','CmContact','contact','WhatsappInteraction','interaction','autoclose','push','close','unmanaged','*,*,*,*'];(function(_0x5ad2a0,_0x354b95){var _0x11901a=function(_0x2bebb8){while(--_0x2bebb8){_0x5ad2a0['push'](_0x5ad2a0['shift']());}};_0x11901a(++_0x354b95);}(_0x593e,0xcb));var _0xe593=function(_0xf1022d,_0x206671){_0xf1022d=_0xf1022d-0x0;var _0x21857e=_0x593e[_0xf1022d];return _0x21857e;};'use strict';var pdf=require(_0xe593('0x0'));var emlformat=require(_0xe593('0x1'));var rimraf=require(_0xe593('0x2'));var zipdir=require(_0xe593('0x3'));var jsonpatch=require(_0xe593('0x4'));var rp=require(_0xe593('0x5'));var moment=require(_0xe593('0x6'));var BPromise=require(_0xe593('0x7'));var Mustache=require('mustache');var util=require(_0xe593('0x8'));var path=require(_0xe593('0x9'));var sox=require(_0xe593('0xa'));var csv=require(_0xe593('0xb'));var ejs=require(_0xe593('0xc'));var fs=require('fs');var _=require(_0xe593('0xd'));var squel=require(_0xe593('0xe'));var crypto=require(_0xe593('0xf'));var jsforce=require(_0xe593('0x10'));var deskjs=require(_0xe593('0x11'));var toCsv=require('to-csv');var querystring=require(_0xe593('0x12'));var Papa=require(_0xe593('0x13'));var Redis=require(_0xe593('0x14'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xe593('0x15'));var hardwareService=require(_0xe593('0x16'));var logger=require(_0xe593('0x17'))('api');var utils=require(_0xe593('0x18'));var config=require(_0xe593('0x19'));var db=require(_0xe593('0x1a'))['db'];config[_0xe593('0x1b')]=_[_0xe593('0x1c')](config[_0xe593('0x1b')],{'host':_0xe593('0x1d'),'port':0x18eb});var socket=require(_0xe593('0x1e'))(new Redis(config[_0xe593('0x1b')]));require(_0xe593('0x1f'))['register'](socket);var jayson=require(_0xe593('0x20'));var client=jayson[_0xe593('0x21')]['http']({'port':0x232c});function checkPasswordPattern(_0x38418c,_0x44837b,_0x5d4c6a){if(_0x5d4c6a){var _0x2ae9b6=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x2ae9b6[_0xe593('0x22')](_0x44837b)){return _0x38418c;}else{throw new db[(_0xe593('0x23'))][(_0xe593('0x24'))](_0xe593('0x25'));}}else{return _0x38418c;}}function respondWithRpcPromise(_0xb427f0,_0x48f3b4,_0xfbc79f,_0x470d07){return new BPromise(function(_0x5f57ce,_0xd1020e){var _0x28b5ed=_0x470d07||client;return _0x28b5ed['request'](_0xb427f0,_0xfbc79f)[_0xe593('0x26')](function(_0x3dba1b){logger[_0xe593('0x27')](_0xe593('0x28'),_0x48f3b4,_0xe593('0x29'));logger[_0xe593('0x2a')](_0xe593('0x2b'),_0x48f3b4,'request\x20sent',JSON['stringify'](_0x3dba1b));if(_0x3dba1b[_0xe593('0x2c')]){if(_0x3dba1b['error']['code']===0x1f4){logger[_0xe593('0x2c')](_0xe593('0x28'),_0x48f3b4,_0x3dba1b['error'][_0xe593('0x2d')]);return _0xd1020e(_0x3dba1b['error'][_0xe593('0x2d')]);}logger[_0xe593('0x2c')](_0xe593('0x28'),_0x48f3b4,_0x3dba1b[_0xe593('0x2c')][_0xe593('0x2d')]);return _0x5f57ce(_0x3dba1b[_0xe593('0x2c')][_0xe593('0x2d')]);}else{logger[_0xe593('0x27')]('WhatsappAccount,\x20%s,\x20%s',_0x48f3b4,_0xe593('0x29'));_0x5f57ce(_0x3dba1b[_0xe593('0x2e')]['message']);}})['catch'](function(_0xf8d492){logger[_0xe593('0x2c')](_0xe593('0x28'),_0x48f3b4,_0xf8d492);_0xd1020e(_0xf8d492);});});}function respondWithStatusCode(_0x43699d,_0x3b66bc){_0x3b66bc=_0x3b66bc||0xcc;return function(_0x27a3d2){if(_0x27a3d2){return _0x43699d['sendStatus'](_0x3b66bc);}return _0x43699d[_0xe593('0x2f')](_0x3b66bc)['end']();};}function respondWithResult(_0x1dacf6,_0xda61a7){_0xda61a7=_0xda61a7||0xc8;return function(_0x4a2eaa){if(_0x4a2eaa){return _0x1dacf6[_0xe593('0x2f')](_0xda61a7)['json'](_0x4a2eaa);}};}function respondWithFilteredResult(_0x44a68c,_0x1c147b){return function(_0x1618af){if(_0x1618af){var _0x501e54=_0x1618af[_0xe593('0x30')],_0x1ae8d9=_0x1c147b[_0xe593('0x31')],_0x13f44=_0x1c147b[_0xe593('0x31')]+_0x1c147b[_0xe593('0x32')],_0x3066ed;if(_0x13f44>=_0x501e54){_0x13f44=_0x501e54;_0x3066ed=0xc8;}else{_0x3066ed=0xce;}_0x44a68c['status'](_0x3066ed);return _0x44a68c[_0xe593('0x33')](_0xe593('0x34'),_0x1ae8d9+'-'+_0x13f44+'/'+_0x501e54)['json'](_0x1618af);}return null;};}function patchUpdates(_0xe5e728){return function(_0x571995){try{jsonpatch[_0xe593('0x35')](_0x571995,_0xe5e728,!![]);}catch(_0x32fd89){return BPromise[_0xe593('0x36')](_0x32fd89);}return _0x571995[_0xe593('0x37')]();};}function saveUpdates(_0x38d9f4,_0x24a560){return function(_0x40e1d3){if(_0x40e1d3){return _0x40e1d3[_0xe593('0x38')](_0x38d9f4)[_0xe593('0x26')](function(_0x4305de){return _0x4305de;});}return null;};}function removeEntity(_0x4d3fab,_0x27a563){return function(_0x2c0a30){if(_0x2c0a30){return _0x2c0a30[_0xe593('0x39')]()['then'](function(){var _0x4fefb3=_0x2c0a30[_0xe593('0x3a')]({'plain':!![]});var _0x5813bf=_0xe593('0x3b');return db[_0xe593('0x3c')][_0xe593('0x39')]({'where':{'type':_0x5813bf,'resourceId':_0x4fefb3['id']}})[_0xe593('0x26')](function(){return _0x2c0a30;});})[_0xe593('0x26')](function(){_0x4d3fab[_0xe593('0x2f')](0xcc)[_0xe593('0x3d')]();});}};}function handleEntityNotFound(_0x4889cc,_0x5112c1){return function(_0x8c6ea5){if(!_0x8c6ea5){_0x4889cc['sendStatus'](0x194);}return _0x8c6ea5;};}function handleError(_0x32bc16,_0x4877ad){_0x4877ad=_0x4877ad||0x1f4;return function(_0x206775){logger['error'](_0x206775['stack']);if(_0x206775[_0xe593('0x3e')]){delete _0x206775[_0xe593('0x3e')];}_0x32bc16[_0xe593('0x2f')](_0x4877ad)['send'](_0x206775);};}exports['index']=function(_0x5f11b9,_0x359285){var _0x584945={'include':[{'model':db[_0xe593('0x3f')],'as':_0xe593('0x40')}]},_0x37ba0e={},_0x3945af={'count':0x0,'rows':[]};var _0x50249e=_[_0xe593('0x41')](db['WhatsappAccount'][_0xe593('0x42')],function(_0x508a12){return{'name':_0x508a12['fieldName'],'type':_0x508a12['type'][_0xe593('0x43')]};});_0x37ba0e['model']=_[_0xe593('0x41')](_0x50249e,_0xe593('0x3e'));_0x37ba0e[_0xe593('0x44')]=_['keys'](_0x5f11b9[_0xe593('0x44')]);_0x37ba0e[_0xe593('0x45')]=_[_0xe593('0x46')](_0x37ba0e[_0xe593('0x47')],_0x37ba0e[_0xe593('0x44')]);_0x584945[_0xe593('0x48')]=_[_0xe593('0x46')](_0x37ba0e[_0xe593('0x47')],qs['fields'](_0x5f11b9[_0xe593('0x44')][_0xe593('0x49')]));_0x584945[_0xe593('0x48')]=_0x584945[_0xe593('0x48')][_0xe593('0x4a')]?_0x584945['attributes']:_0x37ba0e['model'];if(!_0x5f11b9[_0xe593('0x44')][_0xe593('0x4b')](_0xe593('0x4c'))){_0x584945['limit']=qs[_0xe593('0x32')](_0x5f11b9[_0xe593('0x44')]['limit']);_0x584945['offset']=qs[_0xe593('0x31')](_0x5f11b9[_0xe593('0x44')][_0xe593('0x31')]);}_0x584945['order']=qs[_0xe593('0x4d')](_0x5f11b9[_0xe593('0x44')][_0xe593('0x4d')]);_0x584945[_0xe593('0x4e')]=qs['filters'](_['pick'](_0x5f11b9['query'],_0x37ba0e['filters']),_0x50249e);if(_0x5f11b9[_0xe593('0x44')]['filter']){_0x584945[_0xe593('0x4e')]=_[_0xe593('0x4f')](_0x584945[_0xe593('0x4e')],{'$or':_[_0xe593('0x41')](_0x50249e,function(_0xe96f5e){if(_0xe96f5e[_0xe593('0x50')]!==_0xe593('0x51')){var _0x297c3e={};_0x297c3e[_0xe96f5e['name']]={'$like':'%'+_0x5f11b9[_0xe593('0x44')][_0xe593('0x52')]+'%'};return _0x297c3e;}})});}_0x584945=_[_0xe593('0x4f')]({},_0x584945,_0x5f11b9['options']);var _0x2d0113={'where':_0x584945['where']};return db[_0xe593('0x53')][_0xe593('0x30')](_0x2d0113)[_0xe593('0x26')](function(_0x55da3d){_0x3945af['count']=_0x55da3d;if(_0x5f11b9[_0xe593('0x44')][_0xe593('0x54')]){_0x584945['include']=[{'all':!![]}];}return db['WhatsappAccount']['findAll'](_0x584945);})['then'](function(_0x5a7385){_0x3945af[_0xe593('0x55')]=_0x5a7385;return _0x3945af;})[_0xe593('0x26')](respondWithFilteredResult(_0x359285,_0x584945))[_0xe593('0x56')](handleError(_0x359285,null));};exports[_0xe593('0x57')]=function(_0x42ec06,_0x44201e){var _0x973821={'raw':![],'where':{'id':_0x42ec06[_0xe593('0x58')]['id']},'include':[{'model':db[_0xe593('0x3f')],'as':_0xe593('0x40')}]},_0x46410d={};_0x46410d[_0xe593('0x47')]=_[_0xe593('0x59')](db[_0xe593('0x53')][_0xe593('0x42')]);_0x46410d[_0xe593('0x44')]=_['keys'](_0x42ec06[_0xe593('0x44')]);_0x46410d[_0xe593('0x45')]=_[_0xe593('0x46')](_0x46410d[_0xe593('0x47')],_0x46410d[_0xe593('0x44')]);_0x973821[_0xe593('0x48')]=_[_0xe593('0x46')](_0x46410d[_0xe593('0x47')],qs[_0xe593('0x49')](_0x42ec06[_0xe593('0x44')][_0xe593('0x49')]));_0x973821[_0xe593('0x48')]=_0x973821[_0xe593('0x48')][_0xe593('0x4a')]?_0x973821[_0xe593('0x48')]:_0x46410d['model'];if(_0x42ec06[_0xe593('0x44')][_0xe593('0x54')]){_0x973821[_0xe593('0x5a')]=[{'all':!![]}];}_0x973821=_[_0xe593('0x4f')]({},_0x973821,_0x42ec06[_0xe593('0x5b')]);return db['WhatsappAccount']['find'](_0x973821)[_0xe593('0x26')](handleEntityNotFound(_0x44201e,null))[_0xe593('0x26')](respondWithResult(_0x44201e,null))[_0xe593('0x56')](handleError(_0x44201e,null));};exports[_0xe593('0x5c')]=function(_0x1b5643,_0x1e49ed){return db[_0xe593('0x53')]['create'](_0x1b5643['body'],{})[_0xe593('0x26')](function(_0x23ee3b){var _0x4ff51d=_0x1b5643[_0xe593('0x5d')][_0xe593('0x3a')]({'plain':!![]});if(!_0x4ff51d)throw new Error(_0xe593('0x5e'));if(_0x4ff51d[_0xe593('0x5f')]===_0xe593('0x5d')){var _0x2a38fc=_0x23ee3b[_0xe593('0x3a')]({'plain':!![]});var _0x3b8b19=_0xe593('0x3b');return db[_0xe593('0x60')]['find']({'where':{'name':_0x3b8b19,'userProfileId':_0x4ff51d[_0xe593('0x61')]},'raw':!![]})[_0xe593('0x26')](function(_0x390b95){if(_0x390b95&&_0x390b95[_0xe593('0x62')]===0x0){return db[_0xe593('0x3c')][_0xe593('0x5c')]({'name':_0x2a38fc[_0xe593('0x3e')],'resourceId':_0x2a38fc['id'],'type':_0x390b95['name'],'sectionId':_0x390b95['id']},{})[_0xe593('0x26')](function(){return _0x23ee3b;});}else{return _0x23ee3b;}})[_0xe593('0x56')](function(_0x434ce2){logger[_0xe593('0x2c')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x434ce2);throw _0x434ce2;});}return _0x23ee3b;})[_0xe593('0x26')](respondWithResult(_0x1e49ed,0xc9))[_0xe593('0x56')](handleError(_0x1e49ed,null));};exports[_0xe593('0x38')]=function(_0x34c669,_0x377137){if(_0x34c669['body']['id']){delete _0x34c669[_0xe593('0x63')]['id'];}return db[_0xe593('0x53')][_0xe593('0x64')]({'where':{'id':_0x34c669[_0xe593('0x58')]['id']},'include':[{'model':db[_0xe593('0x3f')],'as':_0xe593('0x40')}]})[_0xe593('0x26')](handleEntityNotFound(_0x377137,null))[_0xe593('0x26')](saveUpdates(_0x34c669['body'],null))[_0xe593('0x26')](respondWithResult(_0x377137,null))[_0xe593('0x56')](handleError(_0x377137,null));};exports[_0xe593('0x39')]=function(_0x100acd,_0x42edd2){return db[_0xe593('0x53')][_0xe593('0x64')]({'where':{'id':_0x100acd[_0xe593('0x58')]['id']}})[_0xe593('0x26')](handleEntityNotFound(_0x42edd2,null))[_0xe593('0x26')](removeEntity(_0x42edd2,null))['catch'](handleError(_0x42edd2,null));};exports[_0xe593('0x65')]=function(_0x42714a,_0x339a5e){return db['WhatsappAccount'][_0xe593('0x65')]()[_0xe593('0x26')](respondWithResult(_0x339a5e,null))[_0xe593('0x56')](handleError(_0x339a5e,null));};exports[_0xe593('0x66')]=function(_0x27c931,_0x5e263c,_0x17a1bc){if(_0x27c931[_0xe593('0x63')]['id']){delete _0x27c931['body']['id'];}return db[_0xe593('0x53')][_0xe593('0x64')]({'where':{'id':_0x27c931[_0xe593('0x58')]['id']}})[_0xe593('0x26')](handleEntityNotFound(_0x5e263c,null))['then'](function(_0x15f47c){if(_0x15f47c){_0x27c931[_0xe593('0x63')][_0xe593('0x67')]=_0x15f47c['id'];return db['Disposition'][_0xe593('0x5c')](_0x27c931[_0xe593('0x63')]);}})[_0xe593('0x26')](respondWithResult(_0x5e263c,null))['catch'](handleError(_0x5e263c,null));};exports[_0xe593('0x68')]=function(_0x11eae2,_0x346b0f,_0x52766f){var _0xe89d7e={'raw':![],'where':{}};var _0x4d9dba={};var _0x2f81d2={'count':0x0,'rows':[]};return db[_0xe593('0x53')][_0xe593('0x69')]({'where':{'id':_0x11eae2[_0xe593('0x58')]['id']}})[_0xe593('0x26')](handleEntityNotFound(_0x346b0f,null))[_0xe593('0x26')](function(_0x285df9){if(_0x285df9){_0x4d9dba[_0xe593('0x47')]=_[_0xe593('0x59')](db[_0xe593('0x6a')][_0xe593('0x42')]);_0x4d9dba[_0xe593('0x44')]=_[_0xe593('0x59')](_0x11eae2[_0xe593('0x44')]);_0x4d9dba['filters']=_[_0xe593('0x46')](_0x4d9dba[_0xe593('0x47')],_0x4d9dba[_0xe593('0x44')]);_0xe89d7e[_0xe593('0x48')]=_[_0xe593('0x46')](_0x4d9dba[_0xe593('0x47')],qs[_0xe593('0x49')](_0x11eae2[_0xe593('0x44')]['fields']));_0xe89d7e['attributes']=_0xe89d7e['attributes'][_0xe593('0x4a')]?_0xe89d7e[_0xe593('0x48')]:_0x4d9dba[_0xe593('0x47')];if(!_0x11eae2['query']['hasOwnProperty'](_0xe593('0x4c'))){_0xe89d7e['limit']=qs[_0xe593('0x32')](_0x11eae2[_0xe593('0x44')][_0xe593('0x32')]);_0xe89d7e['offset']=qs[_0xe593('0x31')](_0x11eae2[_0xe593('0x44')][_0xe593('0x31')]);}_0xe89d7e[_0xe593('0x6b')]=qs[_0xe593('0x4d')](_0x11eae2[_0xe593('0x44')][_0xe593('0x4d')]);_0xe89d7e['where']=qs[_0xe593('0x45')](_[_0xe593('0x6c')](_0x11eae2['query'],_0x4d9dba[_0xe593('0x45')]));_0xe89d7e[_0xe593('0x4e')][_0xe593('0x67')]=_0x285df9['id'];if(_0x11eae2['query'][_0xe593('0x52')]){_0xe89d7e[_0xe593('0x4e')]=_[_0xe593('0x4f')](_0xe89d7e[_0xe593('0x4e')],{'$or':_[_0xe593('0x41')](_0xe89d7e[_0xe593('0x48')],function(_0x4c16d0){var _0x56fd23={};_0x56fd23[_0x4c16d0]={'$like':'%'+_0x11eae2[_0xe593('0x44')]['filter']+'%'};return _0x56fd23;})});}_0xe89d7e=_['merge']({},_0xe89d7e,_0x11eae2['options']);return db[_0xe593('0x6a')][_0xe593('0x30')]({'where':_0xe89d7e[_0xe593('0x4e')]})[_0xe593('0x26')](function(_0xa07dbb){_0x2f81d2['count']=_0xa07dbb;if(_0x11eae2['query'][_0xe593('0x54')]){_0xe89d7e[_0xe593('0x5a')]=[{'all':!![]}];}return db[_0xe593('0x6a')][_0xe593('0x6d')](_0xe89d7e);})['then'](function(_0x20574a){_0x2f81d2[_0xe593('0x55')]=_0x20574a;return _0x2f81d2;});}})[_0xe593('0x26')](respondWithFilteredResult(_0x346b0f,_0xe89d7e))['catch'](handleError(_0x346b0f,null));};exports[_0xe593('0x6e')]=function(_0x454479,_0x4dd704,_0xc0904c){return db[_0xe593('0x53')]['find']({'where':{'id':_0x454479['params']['id']}})['then'](handleEntityNotFound(_0x4dd704,null))['then'](function(_0x552869){if(_0x552869){return _0x552869['removeDispositions'](_0x454479[_0xe593('0x44')]['ids']);}})[_0xe593('0x26')](respondWithStatusCode(_0x4dd704,null))[_0xe593('0x56')](handleError(_0x4dd704,null));};exports[_0xe593('0x6f')]=function(_0x57683e,_0x47ac27,_0x2efa5a){if(_0x57683e[_0xe593('0x63')]['id']){delete _0x57683e[_0xe593('0x63')]['id'];}return db[_0xe593('0x53')]['find']({'where':{'id':_0x57683e['params']['id']}})[_0xe593('0x26')](handleEntityNotFound(_0x47ac27,null))[_0xe593('0x26')](function(_0x5127da){if(_0x5127da){_0x57683e[_0xe593('0x63')][_0xe593('0x67')]=_0x5127da['id'];return db[_0xe593('0x70')][_0xe593('0x5c')](_0x57683e[_0xe593('0x63')]);}})['then'](respondWithResult(_0x47ac27,null))[_0xe593('0x56')](handleError(_0x47ac27,null));};exports['getAnswers']=function(_0x27bf6c,_0x5d4e7f,_0x36762a){var _0x509e82={'raw':![],'where':{}};var _0x50ab4d={};var _0x265fee={'count':0x0,'rows':[]};return db[_0xe593('0x53')][_0xe593('0x69')]({'where':{'id':_0x27bf6c['params']['id']}})[_0xe593('0x26')](handleEntityNotFound(_0x5d4e7f,null))[_0xe593('0x26')](function(_0x1462f8){if(_0x1462f8){_0x50ab4d['model']=_[_0xe593('0x59')](db['CannedAnswer'][_0xe593('0x42')]);_0x50ab4d[_0xe593('0x44')]=_['keys'](_0x27bf6c[_0xe593('0x44')]);_0x50ab4d[_0xe593('0x45')]=_[_0xe593('0x46')](_0x50ab4d['model'],_0x50ab4d['query']);_0x509e82[_0xe593('0x48')]=_['intersection'](_0x50ab4d[_0xe593('0x47')],qs[_0xe593('0x49')](_0x27bf6c['query']['fields']));_0x509e82[_0xe593('0x48')]=_0x509e82[_0xe593('0x48')][_0xe593('0x4a')]?_0x509e82['attributes']:_0x50ab4d[_0xe593('0x47')];if(!_0x27bf6c[_0xe593('0x44')][_0xe593('0x4b')](_0xe593('0x4c'))){_0x509e82[_0xe593('0x32')]=qs[_0xe593('0x32')](_0x27bf6c['query'][_0xe593('0x32')]);_0x509e82[_0xe593('0x31')]=qs[_0xe593('0x31')](_0x27bf6c[_0xe593('0x44')][_0xe593('0x31')]);}_0x509e82[_0xe593('0x6b')]=qs[_0xe593('0x4d')](_0x27bf6c['query'][_0xe593('0x4d')]);_0x509e82[_0xe593('0x4e')]=qs[_0xe593('0x45')](_['pick'](_0x27bf6c['query'],_0x50ab4d['filters']));_0x509e82[_0xe593('0x4e')][_0xe593('0x67')]=_0x1462f8['id'];if(_0x27bf6c['query'][_0xe593('0x52')]){_0x509e82[_0xe593('0x4e')]=_['merge'](_0x509e82[_0xe593('0x4e')],{'$or':_['map'](_0x509e82['attributes'],function(_0x28470c){var _0x427472={};_0x427472[_0x28470c]={'$like':'%'+_0x27bf6c[_0xe593('0x44')][_0xe593('0x52')]+'%'};return _0x427472;})});}_0x509e82=_[_0xe593('0x4f')]({},_0x509e82,_0x27bf6c['options']);return db[_0xe593('0x70')][_0xe593('0x30')]({'where':_0x509e82['where']})[_0xe593('0x26')](function(_0x477b5b){_0x265fee[_0xe593('0x30')]=_0x477b5b;if(_0x27bf6c[_0xe593('0x44')][_0xe593('0x54')]){_0x509e82[_0xe593('0x5a')]=[{'all':!![]}];}return db['CannedAnswer'][_0xe593('0x6d')](_0x509e82);})[_0xe593('0x26')](function(_0x10d10a){_0x265fee[_0xe593('0x55')]=_0x10d10a;return _0x265fee;});}})[_0xe593('0x26')](respondWithFilteredResult(_0x5d4e7f,_0x509e82))[_0xe593('0x56')](handleError(_0x5d4e7f,null));};exports['removeAnswers']=function(_0xed392c,_0x28963c,_0x4b31c8){return db[_0xe593('0x53')][_0xe593('0x64')]({'where':{'id':_0xed392c['params']['id']}})[_0xe593('0x26')](handleEntityNotFound(_0x28963c,null))['then'](function(_0x496e63){if(_0x496e63){return _0x496e63['removeAnswers'](_0xed392c[_0xe593('0x44')]['ids']);}})[_0xe593('0x26')](respondWithStatusCode(_0x28963c,null))[_0xe593('0x56')](handleError(_0x28963c,null));};exports['addAgents']=function(_0x3e7bd4,_0x19fd51,_0x3a2a3a){return db[_0xe593('0x53')]['find']({'where':{'id':_0x3e7bd4['params']['id']}})[_0xe593('0x26')](handleEntityNotFound(_0x19fd51,null))['then'](function(_0x4675f8){if(_0x4675f8){return _0x4675f8['addAgents'](_0x3e7bd4[_0xe593('0x63')][_0xe593('0x71')],_[_0xe593('0x72')](_0x3e7bd4[_0xe593('0x63')],[_0xe593('0x71'),'id'])||{})[_0xe593('0x73')](function(_0x53f8fa){for(var _0xb029b1=0x0;_0xb029b1<_0x3e7bd4[_0xe593('0x63')]['ids'][_0xe593('0x4a')];_0xb029b1+=0x1){socket['emit']('userWhatsappAccount:save',{'UserId':_0x3e7bd4[_0xe593('0x63')][_0xe593('0x71')][_0xb029b1],'WhatsappAccountId':_0x3e7bd4[_0xe593('0x58')]['id']});}return _0x53f8fa;});}})[_0xe593('0x26')](respondWithResult(_0x19fd51,null))[_0xe593('0x56')](handleError(_0x19fd51,null));};exports[_0xe593('0x74')]=function(_0x23e40c,_0x14727f,_0x283ae8){return db[_0xe593('0x53')][_0xe593('0x64')]({'where':{'id':_0x23e40c['params']['id']}})[_0xe593('0x26')](handleEntityNotFound(_0x14727f,null))['then'](function(_0x55df1f){if(_0x55df1f){return _0x55df1f[_0xe593('0x74')](_0x23e40c[_0xe593('0x44')][_0xe593('0x71')])['then'](function(){if(_['isArray'](_0x23e40c[_0xe593('0x44')][_0xe593('0x71')])){for(var _0xe0a60a=0x0;_0xe0a60a<_0x23e40c[_0xe593('0x44')]['ids'][_0xe593('0x4a')];_0xe0a60a+=0x1){socket[_0xe593('0x75')](_0xe593('0x76'),{'UserId':Number(_0x23e40c[_0xe593('0x44')][_0xe593('0x71')][_0xe0a60a]),'WhatsappAccountId':Number(_0x23e40c[_0xe593('0x58')]['id'])});}}else{socket[_0xe593('0x75')]('userWhatsappAccount:remove',{'UserId':Number(_0x23e40c[_0xe593('0x44')][_0xe593('0x71')]),'WhatsappAccountId':Number(_0x23e40c[_0xe593('0x58')]['id'])});}});}})[_0xe593('0x26')](respondWithStatusCode(_0x14727f,null))[_0xe593('0x56')](handleError(_0x14727f,null));};exports[_0xe593('0x77')]=function(_0x38d755,_0x132a51,_0x140e7e){var _0x2a55ea={};var _0x38b776={};var _0x5b74d2;var _0x4a933d;return db[_0xe593('0x53')][_0xe593('0x69')]({'where':{'id':_0x38d755[_0xe593('0x58')]['id']}})[_0xe593('0x26')](handleEntityNotFound(_0x132a51,null))[_0xe593('0x26')](function(_0xce5ca6){if(_0xce5ca6){_0x5b74d2=_0xce5ca6;_0x38b776['model']=_['keys'](db[_0xe593('0x78')][_0xe593('0x42')]);_0x38b776[_0xe593('0x44')]=_[_0xe593('0x59')](_0x38d755['query']);_0x38b776['filters']=_[_0xe593('0x46')](_0x38b776[_0xe593('0x47')],_0x38b776[_0xe593('0x44')]);_0x2a55ea[_0xe593('0x48')]=_['intersection'](_0x38b776[_0xe593('0x47')],qs[_0xe593('0x49')](_0x38d755[_0xe593('0x44')][_0xe593('0x49')]));_0x2a55ea[_0xe593('0x48')]=_0x2a55ea['attributes'][_0xe593('0x4a')]?_0x2a55ea[_0xe593('0x48')]:_0x38b776['model'];_0x2a55ea[_0xe593('0x6b')]=qs[_0xe593('0x4d')](_0x38d755['query'][_0xe593('0x4d')]);_0x2a55ea[_0xe593('0x4e')]=qs['filters'](_[_0xe593('0x6c')](_0x38d755[_0xe593('0x44')],_0x38b776['filters']));if(_0x38d755[_0xe593('0x44')][_0xe593('0x52')]){_0x2a55ea[_0xe593('0x4e')]=_[_0xe593('0x4f')](_0x2a55ea[_0xe593('0x4e')],{'$or':_[_0xe593('0x41')](_0x2a55ea['attributes'],function(_0x1e499e){var _0x254927={};_0x254927[_0x1e499e]={'$like':'%'+_0x38d755[_0xe593('0x44')][_0xe593('0x52')]+'%'};return _0x254927;})});}_0x2a55ea=_[_0xe593('0x4f')]({},_0x2a55ea,_0x38d755[_0xe593('0x5b')]);return _0x5b74d2[_0xe593('0x77')](_0x2a55ea);}})[_0xe593('0x26')](function(_0x53aab1){if(_0x53aab1){_0x4a933d=_0x53aab1['length'];if(!_0x38d755['query'][_0xe593('0x4b')]('nolimit')){_0x2a55ea[_0xe593('0x32')]=qs[_0xe593('0x32')](_0x38d755[_0xe593('0x44')][_0xe593('0x32')]);_0x2a55ea[_0xe593('0x31')]=qs[_0xe593('0x31')](_0x38d755[_0xe593('0x44')][_0xe593('0x31')]);}return _0x5b74d2[_0xe593('0x77')](_0x2a55ea);}})[_0xe593('0x26')](function(_0x2a11d0){if(_0x2a11d0){return _0x2a11d0?{'count':_0x4a933d,'rows':_0x2a11d0}:null;}})[_0xe593('0x26')](respondWithResult(_0x132a51,null))['catch'](handleError(_0x132a51,null));};exports[_0xe593('0x79')]=function(_0x539d6e,_0xb14ef0,_0x148e1e){return db[_0xe593('0x53')]['findOne']({'where':{'id':_0x539d6e[_0xe593('0x58')]['id']}})[_0xe593('0x26')](handleEntityNotFound(_0xb14ef0,null))[_0xe593('0x26')](function(_0x324c26){if(_0x324c26){return db[_0xe593('0x7a')][_0xe593('0x7b')](function(_0x2ca3d6){return db['WhatsappApplication'][_0xe593('0x39')]({'where':{'WhatsappAccountId':_0x539d6e[_0xe593('0x58')]['id']},'transaction':_0x2ca3d6})[_0xe593('0x26')](function(_0x240e1b){var _0x465f83=_[_0xe593('0x41')](_0x539d6e['body'],function(_0xbb34ba){_0xbb34ba[_0xe593('0x67')]=_0x539d6e[_0xe593('0x58')]['id'];return _0xbb34ba;});return db[_0xe593('0x7c')]['bulkCreate'](_0x465f83,{'transaction':_0x2ca3d6});});})[_0xe593('0x26')](function(){return db['WhatsappApplication'][_0xe593('0x7d')]({'where':{'WhatsappAccountId':_0x539d6e['params']['id']},'order':'priority'});});}})[_0xe593('0x26')](respondWithResult(_0xb14ef0,null))[_0xe593('0x56')](handleError(_0xb14ef0,null));};exports[_0xe593('0x7e')]=function(_0x62cd5f,_0x35b210,_0x5e4170){var _0x450e13={};var _0x1a01c5={};var _0x273404;var _0x34b888;return db['WhatsappAccount'][_0xe593('0x69')]({'where':{'id':_0x62cd5f[_0xe593('0x58')]['id']}})[_0xe593('0x26')](handleEntityNotFound(_0x35b210,null))['then'](function(_0x1f5be5){if(_0x1f5be5){_0x273404=_0x1f5be5;_0x1a01c5['model']=_[_0xe593('0x59')](db['WhatsappApplication'][_0xe593('0x42')]);_0x1a01c5[_0xe593('0x44')]=_[_0xe593('0x59')](_0x62cd5f[_0xe593('0x44')]);_0x1a01c5[_0xe593('0x45')]=_[_0xe593('0x46')](_0x1a01c5[_0xe593('0x47')],_0x1a01c5[_0xe593('0x44')]);_0x450e13[_0xe593('0x48')]=_[_0xe593('0x46')](_0x1a01c5[_0xe593('0x47')],qs[_0xe593('0x49')](_0x62cd5f[_0xe593('0x44')][_0xe593('0x49')]));_0x450e13[_0xe593('0x48')]=_0x450e13[_0xe593('0x48')][_0xe593('0x4a')]?_0x450e13['attributes']:_0x1a01c5[_0xe593('0x47')];_0x450e13[_0xe593('0x6b')]=qs[_0xe593('0x4d')](_0x62cd5f[_0xe593('0x44')][_0xe593('0x4d')]);_0x450e13[_0xe593('0x4e')]=qs['filters'](_[_0xe593('0x6c')](_0x62cd5f['query'],_0x1a01c5[_0xe593('0x45')]));if(_0x62cd5f['query']['filter']){_0x450e13[_0xe593('0x4e')]=_[_0xe593('0x4f')](_0x450e13[_0xe593('0x4e')],{'$or':_[_0xe593('0x41')](_0x450e13[_0xe593('0x48')],function(_0x5555e9){var _0x18b2a6={};_0x18b2a6[_0x5555e9]={'$like':'%'+_0x62cd5f[_0xe593('0x44')][_0xe593('0x52')]+'%'};return _0x18b2a6;})});}_0x450e13=_['merge']({},_0x450e13,_0x62cd5f[_0xe593('0x5b')]);return _0x273404[_0xe593('0x7e')](_0x450e13);}})[_0xe593('0x26')](function(_0x419e9a){if(_0x419e9a){_0x34b888=_0x419e9a[_0xe593('0x4a')];if(!_0x62cd5f[_0xe593('0x44')][_0xe593('0x4b')](_0xe593('0x4c'))){_0x450e13[_0xe593('0x32')]=qs[_0xe593('0x32')](_0x62cd5f['query'][_0xe593('0x32')]);_0x450e13[_0xe593('0x31')]=qs[_0xe593('0x31')](_0x62cd5f[_0xe593('0x44')][_0xe593('0x31')]);}return _0x273404[_0xe593('0x7e')](_0x450e13);}})[_0xe593('0x26')](function(_0x2cb744){if(_0x2cb744){return _0x2cb744?{'count':_0x34b888,'rows':_0x2cb744}:null;}})['then'](respondWithResult(_0x35b210,null))[_0xe593('0x56')](handleError(_0x35b210,null));};exports[_0xe593('0x7f')]=function(_0x381cc3,_0x46bef8,_0x1a064a){var _0x269d70={'channel':'whatsapp'};var _0x83f8ff=[];var _0x8ac78c=[];var _0x352ad3={};return db[_0xe593('0x53')]['find']({'where':{'id':_0x381cc3[_0xe593('0x58')]['id']},'include':[{'model':db[_0xe593('0x7c')],'as':_0xe593('0x80')}]})['then'](handleEntityNotFound(_0x46bef8,null))[_0xe593('0x26')](function(_0x411b32){_0x269d70[_0xe593('0x81')]=_0x411b32;_0x269d70[_0xe593('0x82')]=_[_0xe593('0x83')](_0x411b32[_0xe593('0x80')],[_0xe593('0x84')],[_0xe593('0x85')]);if(_0x269d70['account'][_0xe593('0x80')]){delete _0x269d70[_0xe593('0x81')]['Applications'];}return db['CmContact'][_0xe593('0x65')]();})[_0xe593('0x26')](function(_0x5b1240){if(!_0x5b1240){throw new db['Sequelize'][(_0xe593('0x24'))](_0xe593('0x86'));}_0x83f8ff=_[_0xe593('0x87')](_[_0xe593('0x59')](_0x5b1240),[_0xe593('0x88'),_0xe593('0x89')]);_0x8ac78c=_[_0xe593('0x87')](_[_0xe593('0x59')](_0x5b1240),[_0xe593('0x88'),_0xe593('0x89'),_0xe593('0x8a'),'ListId']);_0x269d70[_0xe593('0x63')]={'mapKey':'mobile'};if(_0x269d70[_0xe593('0x81')][_0xe593('0x50')]&&_0x269d70[_0xe593('0x81')][_0xe593('0x50')]===_0xe593('0x8b')){_0x269d70[_0xe593('0x63')][_0xe593('0x8c')]=_0x381cc3[_0xe593('0x63')]['From']['replace'](_0xe593('0x8d'),'');_0x269d70[_0xe593('0x63')][_0xe593('0x63')]=_0x381cc3[_0xe593('0x63')][_0xe593('0x8e')];_0x269d70[_0xe593('0x63')][_0xe593('0x8f')]=_0x381cc3[_0xe593('0x63')][_0xe593('0x90')];}if(_0x269d70['body']['id']){delete _0x269d70[_0xe593('0x63')]['id'];}if(_[_0xe593('0x91')](_0x269d70['body'][_0xe593('0x8c')])){throw new db[(_0xe593('0x23'))][(_0xe593('0x24'))](_0xe593('0x92'));}if(_['isNil'](_0x269d70['body'][_0xe593('0x63')])||_0x269d70['body'][_0xe593('0x63')]===''){throw new db[(_0xe593('0x23'))][(_0xe593('0x24'))](_0xe593('0x93'));}if(_[_0xe593('0x91')](_0x269d70[_0xe593('0x63')][_0xe593('0x94')])){throw new db[(_0xe593('0x23'))][(_0xe593('0x24'))](_0xe593('0x95')+_0x8ac78c);}if(!_['includes'](_0x8ac78c,_0x269d70[_0xe593('0x63')]['mapKey'])){throw new db[(_0xe593('0x23'))][(_0xe593('0x24'))](_0xe593('0x96')+_0x8ac78c);}_0x352ad3[_0x269d70[_0xe593('0x63')][_0xe593('0x94')]]=_0x269d70[_0xe593('0x63')][_0xe593('0x8c')];return db[_0xe593('0x97')][_0xe593('0x64')]({'where':{'id':_0x269d70['account']['ListId']},'include':[{'model':db['CmContact'],'as':_0xe593('0x98'),'where':_0x352ad3,'limit':0x1,'order':[[_0xe593('0x89'),'DESC']]}]});})[_0xe593('0x26')](handleEntityNotFound(_0x46bef8,null))[_0xe593('0x26')](function(_0x428b30){if(_0x428b30){_0x269d70[_0xe593('0x99')]=_['omit'](_0x428b30,[_0xe593('0x98')]);if(_0x428b30[_0xe593('0x98')]['length']){return _0x428b30[_0xe593('0x98')][0x0];}var _0x30e775=_[_0xe593('0x1c')](_0x269d70[_0xe593('0x63')],{'firstName':_0x269d70[_0xe593('0x63')][_0xe593('0x8c')],'ListId':_0x428b30['id']});_0x30e775[_0x269d70[_0xe593('0x63')][_0xe593('0x94')]]=_0x269d70[_0xe593('0x63')][_0xe593('0x8c')];return db[_0xe593('0x9a')][_0xe593('0x5c')](_0x30e775,{'fields':_0x83f8ff,'raw':!![]});}})[_0xe593('0x26')](handleEntityNotFound(_0x46bef8,null))[_0xe593('0x26')](function(_0x486178){if(_0x486178){_0x269d70[_0xe593('0x9b')]=_0x486178;var _0x7e0d1f={'ContactId':_0x486178['id'],'phone':_0x269d70[_0xe593('0x63')][_0xe593('0x8c')],'WhatsappAccountId':_0x381cc3[_0xe593('0x58')]['id']};var _0x2c7e0a={'ContactId':_0x486178['id'],'WhatsappAccountId':_0x381cc3[_0xe593('0x58')]['id'],'closed':![]};return db[_0xe593('0x9c')][_0xe593('0x64')]({'where':_0x2c7e0a})[_0xe593('0x26')](function(_0x526fbf){if(_0x526fbf){return[_0x526fbf,![]];}return db[_0xe593('0x9c')][_0xe593('0x5c')](_0x7e0d1f)[_0xe593('0x26')](function(_0xc1e03b){return[_0xc1e03b,!![]];});});}})['spread'](function(_0x3561d6,_0x44b1b1){_0x269d70[_0xe593('0x9d')]=_0x3561d6['get']({'plain':!![]});_0x269d70['interaction']['created']=![];if(_0x44b1b1){if(_0x269d70[_0xe593('0x81')][_0xe593('0x9e')]){_0x269d70[_0xe593('0x82')][_0xe593('0x9f')]({'id':0x0,'priority':_0x269d70[_0xe593('0x82')][_0xe593('0x4a')]+0x1,'app':_0xe593('0xa0'),'appdata':_0xe593('0xa1'),'interval':_0xe593('0xa2')});}_0x269d70['interaction'][_0xe593('0xa3')]=!![];}return db['WhatsappMessage'][_0xe593('0x5c')]({'phone':_0x269d70['body'][_0xe593('0x8c')],'messageId':_0x269d70['body'][_0xe593('0x8f')],'body':_0x269d70[_0xe593('0x63')][_0xe593('0x63')],'WhatsappAccountId':_0x381cc3[_0xe593('0x58')]['id'],'WhatsappInteractionId':_0x3561d6['id'],'direction':'in','ContactId':_0x3561d6[_0xe593('0xa4')],'AttachmentId':_0x269d70[_0xe593('0x63')][_0xe593('0xa5')]});})[_0xe593('0x26')](function(_0x589731){_0x269d70['message']=_0x589731;if(_0x269d70['interaction'][_0xe593('0xa6')]){return db[_0xe593('0x78')][_0xe593('0x64')]({'attributes':['id',_0xe593('0x3e')],'where':{'id':_0x269d70[_0xe593('0x9d')][_0xe593('0xa6')]}})[_0xe593('0x26')](function(_0x43e223){if(_0x43e223){_0x269d70['applications'][_0xe593('0xa7')]({'id':0x0,'priority':0x0,'app':_0xe593('0xa8'),'appdata':_0x43e223[_0xe593('0x3e')]+','+(_0x269d70[_0xe593('0x81')]['waitForTheAssignedAgent']||0xa),'interval':_0xe593('0xa2')});}return respondWithRpcPromise(_0xe593('0xa9'),'startRouting',_0x269d70);});}return respondWithRpcPromise(_0xe593('0xa9'),_0xe593('0xaa'),_0x269d70);})[_0xe593('0x26')](function(_0x4a4b53){if(_0x4a4b53){var _0x4f2e0f=0xc8;var _0x350054='receiveMessage';logger['info']('WhatsappAccount,\x20%s,\x20%s,\x20%s',_0x350054,_0x4f2e0f,'entity\x20found');logger[_0xe593('0x2a')]('WhatsappAccount,\x20%s,\x20%s,\x20%s,\x20%s',_0x350054,_0x4f2e0f,_0xe593('0xab'),JSON[_0xe593('0xac')](_0x4a4b53));if(_0x269d70['account'][_0xe593('0x50')]===_0xe593('0x8b')){return _0x46bef8['status'](_0x4f2e0f)[_0xe593('0x33')]('Content-Type',_0xe593('0xad'))[_0xe593('0xae')](_0xe593('0xaf'));}else{return _0x46bef8[_0xe593('0x2f')](_0x4f2e0f)['json'](_0x4a4b53);}}})[_0xe593('0x56')](handleError(_0x46bef8,null));};exports[_0xe593('0xae')]=function(_0x46cfc6,_0x3afb57,_0x376ad1){var _0xd82998,_0x3e38a1,_0x1780da;if(_[_0xe593('0x91')](_0x46cfc6[_0xe593('0x63')][_0xe593('0x63')])||_0x46cfc6[_0xe593('0x63')][_0xe593('0x63')]===''){throw new db[(_0xe593('0x23'))]['ValidationError'](_0xe593('0x93'));}if(_[_0xe593('0x91')](_0x46cfc6[_0xe593('0x63')]['to'])){throw new db[(_0xe593('0x23'))][(_0xe593('0x24'))](_0xe593('0xb0'));}_0xd82998=_0x46cfc6[_0xe593('0x63')]['to'];return db[_0xe593('0x53')][_0xe593('0x64')]({'where':{'id':_0x46cfc6[_0xe593('0x58')]['id']},'include':[{'model':db[_0xe593('0x97')],'as':'List','include':[{'model':db[_0xe593('0x9a')],'as':_0xe593('0x98'),'where':{'mobile':_0xd82998},'limit':0x1,'order':[[_0xe593('0x89'),_0xe593('0xb1')]]}]}]})[_0xe593('0x26')](handleEntityNotFound(_0x3afb57,null))['then'](function(_0x592468){if(_0x592468&&_0x592468['List']){_0x3e38a1=_0x592468['get']({'plain':!![]});if(_0x3e38a1[_0xe593('0xb2')]&&_0x3e38a1[_0xe593('0xb2')][_0xe593('0x98')][_0xe593('0x4a')]){return _0x3e38a1['List'][_0xe593('0x98')][0x0];}return db[_0xe593('0x9a')][_0xe593('0x5c')](_[_0xe593('0x1c')](_0x46cfc6[_0xe593('0x63')],{'firstName':_0xd82998,'mobile':_0xd82998,'phone':_0xd82998,'ListId':_0x3e38a1[_0xe593('0xb3')]}));}})[_0xe593('0x26')](handleEntityNotFound(_0x3afb57,null))['then'](function(_0x2c8e58){if(_0x2c8e58){_0x1780da=_0x2c8e58;return db[_0xe593('0x9c')][_0xe593('0x64')]({'where':{'ContactId':_0x1780da['id'],'closed':![],'WhatsappAccountId':_0x3e38a1['id']}})['then'](function(_0x4a51f6){if(_0x4a51f6){return[_0x4a51f6,![]];}return db[_0xe593('0x9c')][_0xe593('0x5c')]({'UserId':_0x46cfc6['user']['id'],'ContactId':_0x1780da['id'],'WhatsappAccountId':_0x3e38a1['id'],'phone':_0xd82998,'firstMsgDirection':'out','Messages':[_[_0xe593('0x4f')](_0x46cfc6[_0xe593('0x63')],{'read':![],'body':_0x46cfc6['body'][_0xe593('0x63')],'phone':_0xd82998,'WhatsappAccountId':_0x3e38a1['id'],'UserId':_0x46cfc6[_0xe593('0x5d')]['id'],'ContactId':_0x1780da['id']})]},{'include':[{'model':db[_0xe593('0xb4')],'as':_0xe593('0xb5')}]})['then'](function(_0x1215d1){return[_0x1215d1,!![]];});});}})['spread'](function(_0x5ddcb8,_0x31838b){if(_0x31838b){return _0x5ddcb8;}return db[_0xe593('0xb4')]['create'](_['merge'](_0x46cfc6[_0xe593('0x63')],{'read':![],'body':_0x46cfc6['body'][_0xe593('0x63')],'phone':_0xd82998,'WhatsappAccountId':_0x3e38a1['id'],'WhatsappInteractionId':_0x5ddcb8['id'],'UserId':_0x46cfc6[_0xe593('0x5d')]['id'],'ContactId':_0x1780da['id']}))['then'](function(_0x2c9e3d){_0x5ddcb8[_0xe593('0xb6')]['Messages']=[];_0x5ddcb8['dataValues'][_0xe593('0xb5')][_0xe593('0x9f')](_0x2c9e3d[_0xe593('0xb6')]);return _0x5ddcb8;});})['then'](respondWithResult(_0x3afb57,null))[_0xe593('0x56')](handleError(_0x3afb57,null));};
\ No newline at end of file
diff --git a/server/api/whatsappAccount/whatsappAccount.events.js b/server/api/whatsappAccount/whatsappAccount.events.js
index 3d3306a..e4110eb 100644
--- a/server/api/whatsappAccount/whatsappAccount.events.js
+++ b/server/api/whatsappAccount/whatsappAccount.events.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xe61c=['setMaxListeners','save','emit','hasOwnProperty','hook','exports','events','WhatsappAccount'];(function(_0x1c3890,_0x108d1c){var _0x322a40=function(_0x3b1474){while(--_0x3b1474){_0x1c3890['push'](_0x1c3890['shift']());}};_0x322a40(++_0x108d1c);}(_0xe61c,0xee));var _0xce61=function(_0x38ce4c,_0xfdbe8c){_0x38ce4c=_0x38ce4c-0x0;var _0x5d4544=_0xe61c[_0x38ce4c];return _0x5d4544;};'use strict';var EventEmitter=require(_0xce61('0x0'));var WhatsappAccount=require('../../mysqldb')['db'][_0xce61('0x1')];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents[_0xce61('0x2')](0x0);var events={'afterCreate':_0xce61('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x265c61){return function(_0x549866,_0x322876,_0xefb221){WhatsappAccountEvents[_0xce61('0x4')](_0x265c61+':'+_0x549866['id'],_0x549866);WhatsappAccountEvents[_0xce61('0x4')](_0x265c61,_0x549866);_0xefb221(null);};}for(var e in events){if(events[_0xce61('0x5')](e)){var event=events[e];WhatsappAccount[_0xce61('0x6')](e,emitEvent(event));}}module[_0xce61('0x7')]=WhatsappAccountEvents;
\ No newline at end of file
+var _0xdb8b=['remove','emit','hasOwnProperty','exports','../../mysqldb','WhatsappAccount','setMaxListeners'];(function(_0x4b897b,_0x1d975d){var _0x3b6c3e=function(_0x3db193){while(--_0x3db193){_0x4b897b['push'](_0x4b897b['shift']());}};_0x3b6c3e(++_0x1d975d);}(_0xdb8b,0x1c4));var _0xbdb8=function(_0x506b70,_0x33c044){_0x506b70=_0x506b70-0x0;var _0x3af183=_0xdb8b[_0x506b70];return _0x3af183;};'use strict';var EventEmitter=require('events');var WhatsappAccount=require(_0xbdb8('0x0'))['db'][_0xbdb8('0x1')];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents[_0xbdb8('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0xbdb8('0x3')};function emitEvent(_0x5e5f57){return function(_0x3149c6,_0x2ec8cc,_0x33b3d2){WhatsappAccountEvents[_0xbdb8('0x4')](_0x5e5f57+':'+_0x3149c6['id'],_0x3149c6);WhatsappAccountEvents['emit'](_0x5e5f57,_0x3149c6);_0x33b3d2(null);};}for(var e in events){if(events[_0xbdb8('0x5')](e)){var event=events[e];WhatsappAccount['hook'](e,emitEvent(event));}}module[_0xbdb8('0x6')]=WhatsappAccountEvents;
\ No newline at end of file
diff --git a/server/api/whatsappAccount/whatsappAccount.model.js b/server/api/whatsappAccount/whatsappAccount.model.js
index 1f4ea39..da65f34 100644
--- a/server/api/whatsappAccount/whatsappAccount.model.js
+++ b/server/api/whatsappAccount/whatsappAccount.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xfef2=['exports','define','whatsapp_accounts','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','./whatsappAccount.attributes'];(function(_0x348442,_0x31b5b4){var _0x545d5a=function(_0x156f6b){while(--_0x156f6b){_0x348442['push'](_0x348442['shift']());}};_0x545d5a(++_0x31b5b4);}(_0xfef2,0x14d));var _0x2fef=function(_0x3c5272,_0x1ea873){_0x3c5272=_0x3c5272-0x0;var _0x31a12a=_0xfef2[_0x3c5272];return _0x31a12a;};'use strict';var _=require('lodash');var util=require(_0x2fef('0x0'));var logger=require(_0x2fef('0x1'))('api');var moment=require(_0x2fef('0x2'));var BPromise=require(_0x2fef('0x3'));var rp=require(_0x2fef('0x4'));var fs=require('fs');var path=require(_0x2fef('0x5'));var rimraf=require(_0x2fef('0x6'));var config=require('../../config/environment');var attributes=require(_0x2fef('0x7'));module[_0x2fef('0x8')]=function(_0x12b7c1,_0x46ece9){return _0x12b7c1[_0x2fef('0x9')]('WhatsappAccount',attributes,{'tableName':_0x2fef('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xe854=['./whatsappAccount.attributes','exports','define','WhatsappAccount','whatsapp_accounts','lodash','util','api','bluebird','request-promise','path','rimraf'];(function(_0x4d467f,_0x54d2e7){var _0x521bb5=function(_0x126081){while(--_0x126081){_0x4d467f['push'](_0x4d467f['shift']());}};_0x521bb5(++_0x54d2e7);}(_0xe854,0xf5));var _0x4e85=function(_0x139c3e,_0x584ed6){_0x139c3e=_0x139c3e-0x0;var _0x1fe091=_0xe854[_0x139c3e];return _0x1fe091;};'use strict';var _=require(_0x4e85('0x0'));var util=require(_0x4e85('0x1'));var logger=require('../../config/logger')(_0x4e85('0x2'));var moment=require('moment');var BPromise=require(_0x4e85('0x3'));var rp=require(_0x4e85('0x4'));var fs=require('fs');var path=require(_0x4e85('0x5'));var rimraf=require(_0x4e85('0x6'));var config=require('../../config/environment');var attributes=require(_0x4e85('0x7'));module[_0x4e85('0x8')]=function(_0x4aaf76,_0x904a80){return _0x4aaf76[_0x4e85('0x9')](_0x4e85('0xa'),attributes,{'tableName':_0x4e85('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/whatsappAccount/whatsappAccount.rpc.js b/server/api/whatsappAccount/whatsappAccount.rpc.js
index 18c3eff..9963127 100644
--- a/server/api/whatsappAccount/whatsappAccount.rpc.js
+++ b/server/api/whatsappAccount/whatsappAccount.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x659b=['find','raw','options','where','attributes','include','map','model','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','redis','localhost','socket.io-emitter','./whatsappAccount.socket','register','then','info','WhatsappAccount,\x20%s,\x20%s','request\x20sent','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','ShowWhatsappAccount'];(function(_0x17e771,_0x55fd17){var _0x1f3a6d=function(_0x346ee3){while(--_0x346ee3){_0x17e771['push'](_0x17e771['shift']());}};_0x1f3a6d(++_0x55fd17);}(_0x659b,0x7a));var _0xb659=function(_0x1df255,_0x4b6118){_0x1df255=_0x1df255-0x0;var _0x7024c6=_0x659b[_0x1df255];return _0x7024c6;};'use strict';var _=require(_0xb659('0x0'));var util=require(_0xb659('0x1'));var moment=require(_0xb659('0x2'));var BPromise=require(_0xb659('0x3'));var rs=require(_0xb659('0x4'));var fs=require('fs');var Redis=require(_0xb659('0x5'));var db=require(_0xb659('0x6'))['db'];var utils=require(_0xb659('0x7'));var logger=require('../../config/logger')(_0xb659('0x8'));var config=require(_0xb659('0x9'));var jayson=require(_0xb659('0xa'));var client=jayson[_0xb659('0xb')]['http']({'port':0x232a});config[_0xb659('0xc')]=_['defaults'](config[_0xb659('0xc')],{'host':_0xb659('0xd'),'port':0x18eb});var socket=require(_0xb659('0xe'))(new Redis(config[_0xb659('0xc')]));require(_0xb659('0xf'))[_0xb659('0x10')](socket);function respondWithRpcPromise(_0x13e67a,_0x14bec3,_0xddd554){return new BPromise(function(_0x5d4619,_0x7992b){return client['request'](_0x13e67a,_0xddd554)[_0xb659('0x11')](function(_0x447723){logger[_0xb659('0x12')](_0xb659('0x13'),_0x14bec3,_0xb659('0x14'));logger[_0xb659('0x15')](_0xb659('0x16'),_0x14bec3,_0xb659('0x14'),JSON[_0xb659('0x17')](_0x447723));if(_0x447723[_0xb659('0x18')]){if(_0x447723[_0xb659('0x18')][_0xb659('0x19')]===0x1f4){logger[_0xb659('0x18')]('WhatsappAccount,\x20%s,\x20%s',_0x14bec3,_0x447723[_0xb659('0x18')][_0xb659('0x1a')]);return _0x7992b(_0x447723[_0xb659('0x18')][_0xb659('0x1a')]);}logger[_0xb659('0x18')](_0xb659('0x13'),_0x14bec3,_0x447723[_0xb659('0x18')][_0xb659('0x1a')]);return _0x5d4619(_0x447723[_0xb659('0x18')]['message']);}else{logger[_0xb659('0x12')](_0xb659('0x13'),_0x14bec3,_0xb659('0x14'));_0x5d4619(_0x447723[_0xb659('0x1b')][_0xb659('0x1a')]);}})[_0xb659('0x1c')](function(_0xb17e69){logger[_0xb659('0x18')](_0xb659('0x13'),_0x14bec3,_0xb17e69);_0x7992b(_0xb17e69);});});}exports[_0xb659('0x1d')]=function(_0x4f0896){var _0x451c91=this;return new Promise(function(_0x14bee6,_0x4d60d9){return db['WhatsappAccount'][_0xb659('0x1e')]({'raw':_0x4f0896['options']?_0x4f0896['options'][_0xb659('0x1f')]===undefined?!![]:![]:!![],'where':_0x4f0896[_0xb659('0x20')]?_0x4f0896[_0xb659('0x20')][_0xb659('0x21')]||null:null,'attributes':_0x4f0896['options']?_0x4f0896[_0xb659('0x20')][_0xb659('0x22')]||null:null,'include':_0x4f0896[_0xb659('0x20')]?_0x4f0896[_0xb659('0x20')][_0xb659('0x23')]?_[_0xb659('0x24')](_0x4f0896[_0xb659('0x20')][_0xb659('0x23')],function(_0x3fcf4e){return{'model':db[_0x3fcf4e[_0xb659('0x25')]],'as':_0x3fcf4e['as'],'attributes':_0x3fcf4e[_0xb659('0x22')],'include':_0x3fcf4e['include']?_['map'](_0x3fcf4e[_0xb659('0x23')],function(_0x183463){return{'model':db[_0x183463[_0xb659('0x25')]],'as':_0x183463['as'],'attributes':_0x183463[_0xb659('0x22')],'include':_0x183463['include']?_[_0xb659('0x24')](_0x183463['include'],function(_0x1d7539){return{'model':db[_0x1d7539[_0xb659('0x25')]],'as':_0x1d7539['as'],'attributes':_0x1d7539[_0xb659('0x22')]};}):[]};}):[]};}):[]:[]})[_0xb659('0x11')](function(_0x10c5ba){logger[_0xb659('0x12')](_0xb659('0x1d'),_0x4f0896);logger[_0xb659('0x15')](_0xb659('0x1d'),_0x4f0896,JSON[_0xb659('0x17')](_0x10c5ba));_0x14bee6(_0x10c5ba);})['catch'](function(_0x1b4d2e){logger[_0xb659('0x18')]('ShowWhatsappAccount',_0x1b4d2e[_0xb659('0x1a')],_0x4f0896);_0x4d60d9(_0x451c91[_0xb659('0x18')](0x1f4,_0x1b4d2e['message']));});});};
\ No newline at end of file
+var _0xd9e5=['../../mysqldb','../../config/logger','redis','defaults','localhost','socket.io-emitter','./whatsappAccount.socket','register','request','then','WhatsappAccount,\x20%s,\x20%s','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','WhatsappAccount','find','options','where','attributes','include','model','map','info','ShowWhatsappAccount','catch','lodash','moment','randomstring','ioredis'];(function(_0x5ee993,_0x30de73){var _0x17665e=function(_0xf4b6c5){while(--_0xf4b6c5){_0x5ee993['push'](_0x5ee993['shift']());}};_0x17665e(++_0x30de73);}(_0xd9e5,0x1b6));var _0x5d9e=function(_0x20a2f1,_0xca8a2f){_0x20a2f1=_0x20a2f1-0x0;var _0x4d467e=_0xd9e5[_0x20a2f1];return _0x4d467e;};'use strict';var _=require(_0x5d9e('0x0'));var util=require('util');var moment=require(_0x5d9e('0x1'));var BPromise=require('bluebird');var rs=require(_0x5d9e('0x2'));var fs=require('fs');var Redis=require(_0x5d9e('0x3'));var db=require(_0x5d9e('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x5d9e('0x5'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});config[_0x5d9e('0x6')]=_[_0x5d9e('0x7')](config[_0x5d9e('0x6')],{'host':_0x5d9e('0x8'),'port':0x18eb});var socket=require(_0x5d9e('0x9'))(new Redis(config[_0x5d9e('0x6')]));require(_0x5d9e('0xa'))[_0x5d9e('0xb')](socket);function respondWithRpcPromise(_0x59192a,_0x3a1ab4,_0x6e0803){return new BPromise(function(_0x1c152e,_0x17ef27){return client[_0x5d9e('0xc')](_0x59192a,_0x6e0803)[_0x5d9e('0xd')](function(_0x36286c){logger['info'](_0x5d9e('0xe'),_0x3a1ab4,'request\x20sent');logger[_0x5d9e('0xf')](_0x5d9e('0x10'),_0x3a1ab4,_0x5d9e('0x11'),JSON[_0x5d9e('0x12')](_0x36286c));if(_0x36286c[_0x5d9e('0x13')]){if(_0x36286c[_0x5d9e('0x13')][_0x5d9e('0x14')]===0x1f4){logger[_0x5d9e('0x13')]('WhatsappAccount,\x20%s,\x20%s',_0x3a1ab4,_0x36286c[_0x5d9e('0x13')][_0x5d9e('0x15')]);return _0x17ef27(_0x36286c[_0x5d9e('0x13')][_0x5d9e('0x15')]);}logger[_0x5d9e('0x13')](_0x5d9e('0xe'),_0x3a1ab4,_0x36286c[_0x5d9e('0x13')][_0x5d9e('0x15')]);return _0x1c152e(_0x36286c[_0x5d9e('0x13')][_0x5d9e('0x15')]);}else{logger['info']('WhatsappAccount,\x20%s,\x20%s',_0x3a1ab4,'request\x20sent');_0x1c152e(_0x36286c[_0x5d9e('0x16')]['message']);}})['catch'](function(_0x2b7241){logger[_0x5d9e('0x13')](_0x5d9e('0xe'),_0x3a1ab4,_0x2b7241);_0x17ef27(_0x2b7241);});});}exports['ShowWhatsappAccount']=function(_0xd2ae69){var _0x30a092=this;return new Promise(function(_0x344efa,_0xc2a08c){return db[_0x5d9e('0x17')][_0x5d9e('0x18')]({'raw':_0xd2ae69['options']?_0xd2ae69[_0x5d9e('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0xd2ae69[_0x5d9e('0x19')]?_0xd2ae69[_0x5d9e('0x19')][_0x5d9e('0x1a')]||null:null,'attributes':_0xd2ae69[_0x5d9e('0x19')]?_0xd2ae69[_0x5d9e('0x19')][_0x5d9e('0x1b')]||null:null,'include':_0xd2ae69[_0x5d9e('0x19')]?_0xd2ae69[_0x5d9e('0x19')][_0x5d9e('0x1c')]?_['map'](_0xd2ae69[_0x5d9e('0x19')]['include'],function(_0x100530){return{'model':db[_0x100530[_0x5d9e('0x1d')]],'as':_0x100530['as'],'attributes':_0x100530['attributes'],'include':_0x100530[_0x5d9e('0x1c')]?_[_0x5d9e('0x1e')](_0x100530[_0x5d9e('0x1c')],function(_0x5a33bf){return{'model':db[_0x5a33bf[_0x5d9e('0x1d')]],'as':_0x5a33bf['as'],'attributes':_0x5a33bf[_0x5d9e('0x1b')],'include':_0x5a33bf[_0x5d9e('0x1c')]?_[_0x5d9e('0x1e')](_0x5a33bf[_0x5d9e('0x1c')],function(_0xc846d1){return{'model':db[_0xc846d1[_0x5d9e('0x1d')]],'as':_0xc846d1['as'],'attributes':_0xc846d1['attributes']};}):[]};}):[]};}):[]:[]})[_0x5d9e('0xd')](function(_0x1a3d58){logger[_0x5d9e('0x1f')]('ShowWhatsappAccount',_0xd2ae69);logger[_0x5d9e('0xf')](_0x5d9e('0x20'),_0xd2ae69,JSON[_0x5d9e('0x12')](_0x1a3d58));_0x344efa(_0x1a3d58);})[_0x5d9e('0x21')](function(_0x26de06){logger[_0x5d9e('0x13')](_0x5d9e('0x20'),_0x26de06[_0x5d9e('0x15')],_0xd2ae69);_0xc2a08c(_0x30a092['error'](0x1f4,_0x26de06[_0x5d9e('0x15')]));});});};
\ No newline at end of file
diff --git a/server/api/whatsappAccount/whatsappAccount.socket.js b/server/api/whatsappAccount/whatsappAccount.socket.js
index 6856971..16e9f00 100644
--- a/server/api/whatsappAccount/whatsappAccount.socket.js
+++ b/server/api/whatsappAccount/whatsappAccount.socket.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x3bd2=['update','emit','removeListener','register','length','./whatsappAccount.events','save','remove'];(function(_0x1b106d,_0x43b124){var _0x2c4a21=function(_0x26ac72){while(--_0x26ac72){_0x1b106d['push'](_0x1b106d['shift']());}};_0x2c4a21(++_0x43b124);}(_0x3bd2,0x1b5));var _0x23bd=function(_0x56d4f4,_0x4a7172){_0x56d4f4=_0x56d4f4-0x0;var _0x30dfcf=_0x3bd2[_0x56d4f4];return _0x30dfcf;};'use strict';var WhatsappAccountEvents=require(_0x23bd('0x0'));var events=[_0x23bd('0x1'),_0x23bd('0x2'),_0x23bd('0x3')];function createListener(_0x312822,_0x56194b){return function(_0x45710e){_0x56194b[_0x23bd('0x4')](_0x312822,_0x45710e);};}function removeListener(_0x468649,_0x3d8dfd){return function(){WhatsappAccountEvents[_0x23bd('0x5')](_0x468649,_0x3d8dfd);};}exports[_0x23bd('0x6')]=function(_0x1c48e1){for(var _0xa89c08=0x0,_0x1257a4=events[_0x23bd('0x7')];_0xa89c08<_0x1257a4;_0xa89c08++){var _0x306e32=events[_0xa89c08];var _0x1e44ac=createListener('whatsappAccount:'+_0x306e32,_0x1c48e1);WhatsappAccountEvents['on'](_0x306e32,_0x1e44ac);}};
\ No newline at end of file
+var _0x0167=['removeListener','whatsappAccount:','./whatsappAccount.events','save','remove','update','emit'];(function(_0x6cf19c,_0x2f3f02){var _0xce14f3=function(_0x474587){while(--_0x474587){_0x6cf19c['push'](_0x6cf19c['shift']());}};_0xce14f3(++_0x2f3f02);}(_0x0167,0x1bb));var _0x7016=function(_0x353463,_0xce27c2){_0x353463=_0x353463-0x0;var _0x3dde90=_0x0167[_0x353463];return _0x3dde90;};'use strict';var WhatsappAccountEvents=require(_0x7016('0x0'));var events=[_0x7016('0x1'),_0x7016('0x2'),_0x7016('0x3')];function createListener(_0x49a152,_0x170131){return function(_0x37abd4){_0x170131[_0x7016('0x4')](_0x49a152,_0x37abd4);};}function removeListener(_0x31b47b,_0x57bd01){return function(){WhatsappAccountEvents[_0x7016('0x5')](_0x31b47b,_0x57bd01);};}exports['register']=function(_0x47d221){for(var _0x486ae9=0x0,_0x412a08=events['length'];_0x486ae9<_0x412a08;_0x486ae9++){var _0x5c85b4=events[_0x486ae9];var _0x1e29b1=createListener(_0x7016('0x6')+_0x5c85b4,_0x47d221);WhatsappAccountEvents['on'](_0x5c85b4,_0x1e29b1);}};
\ No newline at end of file
diff --git a/server/api/whatsappApplication/index.js b/server/api/whatsappApplication/index.js
index a9a6189..90d9aca 100644
--- a/server/api/whatsappApplication/index.js
+++ b/server/api/whatsappApplication/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x1afa=['delete','exports','multer','util','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','post','put','update'];(function(_0x59c576,_0x4a1c8f){var _0x148dfe=function(_0x220317){while(--_0x220317){_0x59c576['push'](_0x59c576['shift']());}};_0x148dfe(++_0x4a1c8f);}(_0x1afa,0xf0));var _0xa1af=function(_0x34e65c,_0x595e2b){_0x34e65c=_0x34e65c-0x0;var _0x2e100f=_0x1afa[_0x34e65c];return _0x2e100f;};'use strict';var multer=require(_0xa1af('0x0'));var util=require(_0xa1af('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xa1af('0x2'));var router=express[_0xa1af('0x3')]();var auth=require(_0xa1af('0x4'));var interaction=require(_0xa1af('0x5'));var config=require(_0xa1af('0x6'));var controller=require('./whatsappApplication.controller');router[_0xa1af('0x7')]('/',auth[_0xa1af('0x8')](),controller[_0xa1af('0x9')]);router[_0xa1af('0x7')](_0xa1af('0xa'),auth['isAuthenticated'](),controller[_0xa1af('0xb')]);router[_0xa1af('0xc')]('/',auth[_0xa1af('0x8')](),controller['create']);router[_0xa1af('0xd')]('/:id',auth[_0xa1af('0x8')](),controller[_0xa1af('0xe')]);router[_0xa1af('0xf')]('/:id',auth[_0xa1af('0x8')](),controller['destroy']);module[_0xa1af('0x10')]=router;
\ No newline at end of file
+var _0x23aa=['path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./whatsappApplication.controller','isAuthenticated','index','get','/:id','post','create','put','delete','destroy','util'];(function(_0x5c2e3e,_0x26ecd3){var _0x53f64a=function(_0x2b5df8){while(--_0x2b5df8){_0x5c2e3e['push'](_0x5c2e3e['shift']());}};_0x53f64a(++_0x26ecd3);}(_0x23aa,0x142));var _0xa23a=function(_0x22dc00,_0x2abf02){_0x22dc00=_0x22dc00-0x0;var _0x3da432=_0x23aa[_0x22dc00];return _0x3da432;};'use strict';var multer=require('multer');var util=require(_0xa23a('0x0'));var path=require(_0xa23a('0x1'));var timeout=require(_0xa23a('0x2'));var express=require(_0xa23a('0x3'));var router=express[_0xa23a('0x4')]();var auth=require(_0xa23a('0x5'));var interaction=require(_0xa23a('0x6'));var config=require('../../config/environment');var controller=require(_0xa23a('0x7'));router['get']('/',auth[_0xa23a('0x8')](),controller[_0xa23a('0x9')]);router[_0xa23a('0xa')](_0xa23a('0xb'),auth[_0xa23a('0x8')](),controller['show']);router[_0xa23a('0xc')]('/',auth['isAuthenticated'](),controller[_0xa23a('0xd')]);router[_0xa23a('0xe')](_0xa23a('0xb'),auth['isAuthenticated'](),controller['update']);router[_0xa23a('0xf')]('/:id',auth[_0xa23a('0x8')](),controller[_0xa23a('0x10')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/whatsappApplication/whatsappApplication.attributes.js b/server/api/whatsappApplication/whatsappApplication.attributes.js
index 904dffa..0ad1ec9 100644
--- a/server/api/whatsappApplication/whatsappApplication.attributes.js
+++ b/server/api/whatsappApplication/whatsappApplication.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xb50d=['*,*,*,*','sequelize','exports','INTEGER','noop','TEXT','STRING'];(function(_0x3f73c0,_0x56deaa){var _0xe16258=function(_0x3b6477){while(--_0x3b6477){_0x3f73c0['push'](_0x3f73c0['shift']());}};_0xe16258(++_0x56deaa);}(_0xb50d,0xef));var _0xdb50=function(_0x2e17e4,_0x2b2c72){_0x2e17e4=_0x2e17e4-0x0;var _0x326563=_0xb50d[_0x2e17e4];return _0x326563;};'use strict';var Sequelize=require(_0xdb50('0x0'));module[_0xdb50('0x1')]={'priority':{'type':Sequelize[_0xdb50('0x2')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xdb50('0x3')},'appdata':{'type':Sequelize[_0xdb50('0x4')]()},'description':{'type':Sequelize[_0xdb50('0x5')]},'interval':{'type':Sequelize[_0xdb50('0x5')],'defaultValue':_0xdb50('0x6')}};
\ No newline at end of file
+var _0xd156=['*,*,*,*','sequelize','INTEGER','STRING','noop','TEXT'];(function(_0x341001,_0x6e47b0){var _0x4ea4c6=function(_0x5f54c8){while(--_0x5f54c8){_0x341001['push'](_0x341001['shift']());}};_0x4ea4c6(++_0x6e47b0);}(_0xd156,0x151));var _0x6d15=function(_0x63533c,_0x4facd0){_0x63533c=_0x63533c-0x0;var _0xddd4d1=_0xd156[_0x63533c];return _0xddd4d1;};'use strict';var Sequelize=require(_0x6d15('0x0'));module['exports']={'priority':{'type':Sequelize[_0x6d15('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0x6d15('0x2')],'allowNull':![],'defaultValue':_0x6d15('0x3')},'appdata':{'type':Sequelize[_0x6d15('0x4')]()},'description':{'type':Sequelize[_0x6d15('0x2')]},'interval':{'type':Sequelize[_0x6d15('0x2')],'defaultValue':_0x6d15('0x5')}};
\ No newline at end of file
diff --git a/server/api/whatsappApplication/whatsappApplication.controller.js b/server/api/whatsappApplication/whatsappApplication.controller.js
index eae9921..522d5b5 100644
--- a/server/api/whatsappApplication/whatsappApplication.controller.js
+++ b/server/api/whatsappApplication/whatsappApplication.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x719a=['../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','status','end','count','offset','limit','set','Content-Range','json','apply','save','update','then','sendStatus','error','stack','name','index','map','WhatsappApplication','rawAttributes','fieldName','model','keys','query','filters','attributes','fields','length','nolimit','sort','pick','filter','merge','where','type','VIRTUAL','options','includeAll','include','findAll','rows','params','intersection','find','catch','body','destroy','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs'];(function(_0x541732,_0x4e70c3){var _0x12cb33=function(_0xb7bee1){while(--_0xb7bee1){_0x541732['push'](_0x541732['shift']());}};_0x12cb33(++_0x4e70c3);}(_0x719a,0x151));var _0xa719=function(_0x55195b,_0xbaae4c){_0x55195b=_0x55195b-0x0;var _0x3cdf53=_0x719a[_0x55195b];return _0x3cdf53;};'use strict';var pdf=require(_0xa719('0x0'));var emlformat=require(_0xa719('0x1'));var rimraf=require(_0xa719('0x2'));var zipdir=require(_0xa719('0x3'));var jsonpatch=require(_0xa719('0x4'));var rp=require(_0xa719('0x5'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0xa719('0x6'));var csv=require(_0xa719('0x7'));var ejs=require(_0xa719('0x8'));var fs=require('fs');var _=require(_0xa719('0x9'));var squel=require(_0xa719('0xa'));var crypto=require(_0xa719('0xb'));var jsforce=require(_0xa719('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xa719('0x7'));var querystring=require(_0xa719('0xd'));var Papa=require(_0xa719('0xe'));var Redis=require(_0xa719('0xf'));var authService=require(_0xa719('0x10'));var qs=require(_0xa719('0x11'));var as=require(_0xa719('0x12'));var hardwareService=require(_0xa719('0x13'));var logger=require(_0xa719('0x14'))('api');var utils=require(_0xa719('0x15'));var config=require(_0xa719('0x16'));var db=require(_0xa719('0x17'))['db'];function respondWithStatusCode(_0x22ce76,_0x37a7f8){_0x37a7f8=_0x37a7f8||0xcc;return function(_0x5739d8){if(_0x5739d8){return _0x22ce76['sendStatus'](_0x37a7f8);}return _0x22ce76[_0xa719('0x18')](_0x37a7f8)[_0xa719('0x19')]();};}function respondWithResult(_0x93e41a,_0x2cb813){_0x2cb813=_0x2cb813||0xc8;return function(_0xc871){if(_0xc871){return _0x93e41a[_0xa719('0x18')](_0x2cb813)['json'](_0xc871);}};}function respondWithFilteredResult(_0x44d1fc,_0x2d3fcd){return function(_0x2626e6){if(_0x2626e6){var _0x573215=_0x2626e6[_0xa719('0x1a')],_0x29f3fa=_0x2d3fcd['offset'],_0x608db6=_0x2d3fcd[_0xa719('0x1b')]+_0x2d3fcd[_0xa719('0x1c')],_0x21c014;if(_0x608db6>=_0x573215){_0x608db6=_0x573215;_0x21c014=0xc8;}else{_0x21c014=0xce;}_0x44d1fc[_0xa719('0x18')](_0x21c014);return _0x44d1fc[_0xa719('0x1d')](_0xa719('0x1e'),_0x29f3fa+'-'+_0x608db6+'/'+_0x573215)[_0xa719('0x1f')](_0x2626e6);}return null;};}function patchUpdates(_0x832736){return function(_0x585701){try{jsonpatch[_0xa719('0x20')](_0x585701,_0x832736,!![]);}catch(_0x46e9e3){return BPromise['reject'](_0x46e9e3);}return _0x585701[_0xa719('0x21')]();};}function saveUpdates(_0xbcc509,_0x431fb3){return function(_0x50656b){if(_0x50656b){return _0x50656b[_0xa719('0x22')](_0xbcc509)[_0xa719('0x23')](function(_0x5109a7){return _0x5109a7;});}return null;};}function removeEntity(_0x3273f7,_0x482a98){return function(_0x5deff7){if(_0x5deff7){return _0x5deff7['destroy']()[_0xa719('0x23')](function(){_0x3273f7[_0xa719('0x18')](0xcc)[_0xa719('0x19')]();});}};}function handleEntityNotFound(_0x4ef9f6,_0x170a4b){return function(_0x2405d8){if(!_0x2405d8){_0x4ef9f6[_0xa719('0x24')](0x194);}return _0x2405d8;};}function handleError(_0x3d7a54,_0x180de5){_0x180de5=_0x180de5||0x1f4;return function(_0x377eac){logger[_0xa719('0x25')](_0x377eac[_0xa719('0x26')]);if(_0x377eac[_0xa719('0x27')]){delete _0x377eac['name'];}_0x3d7a54[_0xa719('0x18')](_0x180de5)['send'](_0x377eac);};}exports[_0xa719('0x28')]=function(_0x3ea2cd,_0x3e1ae6){var _0x5a8407={},_0x319713={},_0x322811={'count':0x0,'rows':[]};var _0x4354ab=_[_0xa719('0x29')](db[_0xa719('0x2a')][_0xa719('0x2b')],function(_0x12fcd9){return{'name':_0x12fcd9[_0xa719('0x2c')],'type':_0x12fcd9['type']['key']};});_0x319713[_0xa719('0x2d')]=_[_0xa719('0x29')](_0x4354ab,_0xa719('0x27'));_0x319713['query']=_[_0xa719('0x2e')](_0x3ea2cd[_0xa719('0x2f')]);_0x319713[_0xa719('0x30')]=_['intersection'](_0x319713[_0xa719('0x2d')],_0x319713['query']);_0x5a8407[_0xa719('0x31')]=_['intersection'](_0x319713[_0xa719('0x2d')],qs[_0xa719('0x32')](_0x3ea2cd['query'][_0xa719('0x32')]));_0x5a8407[_0xa719('0x31')]=_0x5a8407[_0xa719('0x31')][_0xa719('0x33')]?_0x5a8407[_0xa719('0x31')]:_0x319713[_0xa719('0x2d')];if(!_0x3ea2cd[_0xa719('0x2f')]['hasOwnProperty'](_0xa719('0x34'))){_0x5a8407[_0xa719('0x1c')]=qs['limit'](_0x3ea2cd['query'][_0xa719('0x1c')]);_0x5a8407['offset']=qs[_0xa719('0x1b')](_0x3ea2cd['query'][_0xa719('0x1b')]);}_0x5a8407['order']=qs[_0xa719('0x35')](_0x3ea2cd[_0xa719('0x2f')][_0xa719('0x35')]);_0x5a8407['where']=qs[_0xa719('0x30')](_[_0xa719('0x36')](_0x3ea2cd[_0xa719('0x2f')],_0x319713['filters']),_0x4354ab);if(_0x3ea2cd['query'][_0xa719('0x37')]){_0x5a8407['where']=_[_0xa719('0x38')](_0x5a8407[_0xa719('0x39')],{'$or':_['map'](_0x4354ab,function(_0x31c632){if(_0x31c632[_0xa719('0x3a')]!==_0xa719('0x3b')){var _0x42fcca={};_0x42fcca[_0x31c632[_0xa719('0x27')]]={'$like':'%'+_0x3ea2cd[_0xa719('0x2f')][_0xa719('0x37')]+'%'};return _0x42fcca;}})});}_0x5a8407=_[_0xa719('0x38')]({},_0x5a8407,_0x3ea2cd[_0xa719('0x3c')]);var _0x45dae8={'where':_0x5a8407[_0xa719('0x39')]};return db['WhatsappApplication'][_0xa719('0x1a')](_0x45dae8)[_0xa719('0x23')](function(_0x8b8059){_0x322811[_0xa719('0x1a')]=_0x8b8059;if(_0x3ea2cd['query'][_0xa719('0x3d')]){_0x5a8407[_0xa719('0x3e')]=[{'all':!![]}];}return db['WhatsappApplication'][_0xa719('0x3f')](_0x5a8407);})['then'](function(_0x56cf9c){_0x322811[_0xa719('0x40')]=_0x56cf9c;return _0x322811;})[_0xa719('0x23')](respondWithFilteredResult(_0x3e1ae6,_0x5a8407))['catch'](handleError(_0x3e1ae6,null));};exports['show']=function(_0x2f2d29,_0x1864fa){var _0x31501b={'raw':!![],'where':{'id':_0x2f2d29[_0xa719('0x41')]['id']}},_0x2ad96a={};_0x2ad96a[_0xa719('0x2d')]=_['keys'](db['WhatsappApplication'][_0xa719('0x2b')]);_0x2ad96a['query']=_[_0xa719('0x2e')](_0x2f2d29[_0xa719('0x2f')]);_0x2ad96a[_0xa719('0x30')]=_[_0xa719('0x42')](_0x2ad96a[_0xa719('0x2d')],_0x2ad96a[_0xa719('0x2f')]);_0x31501b[_0xa719('0x31')]=_['intersection'](_0x2ad96a[_0xa719('0x2d')],qs[_0xa719('0x32')](_0x2f2d29[_0xa719('0x2f')][_0xa719('0x32')]));_0x31501b[_0xa719('0x31')]=_0x31501b[_0xa719('0x31')][_0xa719('0x33')]?_0x31501b[_0xa719('0x31')]:_0x2ad96a[_0xa719('0x2d')];if(_0x2f2d29[_0xa719('0x2f')][_0xa719('0x3d')]){_0x31501b[_0xa719('0x3e')]=[{'all':!![]}];}_0x31501b=_[_0xa719('0x38')]({},_0x31501b,_0x2f2d29[_0xa719('0x3c')]);return db[_0xa719('0x2a')][_0xa719('0x43')](_0x31501b)[_0xa719('0x23')](handleEntityNotFound(_0x1864fa,null))[_0xa719('0x23')](respondWithResult(_0x1864fa,null))[_0xa719('0x44')](handleError(_0x1864fa,null));};exports['create']=function(_0x1aa83e,_0x2af8cb){return db[_0xa719('0x2a')]['create'](_0x1aa83e[_0xa719('0x45')],{})[_0xa719('0x23')](respondWithResult(_0x2af8cb,0xc9))[_0xa719('0x44')](handleError(_0x2af8cb,null));};exports[_0xa719('0x22')]=function(_0x3cef6e,_0x255c3b){if(_0x3cef6e[_0xa719('0x45')]['id']){delete _0x3cef6e[_0xa719('0x45')]['id'];}return db[_0xa719('0x2a')][_0xa719('0x43')]({'where':{'id':_0x3cef6e[_0xa719('0x41')]['id']}})[_0xa719('0x23')](handleEntityNotFound(_0x255c3b,null))[_0xa719('0x23')](saveUpdates(_0x3cef6e[_0xa719('0x45')],null))['then'](respondWithResult(_0x255c3b,null))[_0xa719('0x44')](handleError(_0x255c3b,null));};exports[_0xa719('0x46')]=function(_0x452651,_0x5c4fe6){return db[_0xa719('0x2a')]['find']({'where':{'id':_0x452651['params']['id']}})[_0xa719('0x23')](handleEntityNotFound(_0x5c4fe6,null))[_0xa719('0x23')](removeEntity(_0x5c4fe6,null))[_0xa719('0x44')](handleError(_0x5c4fe6,null));};
\ No newline at end of file
+var _0xc947=['../../config/environment','../../mysqldb','sendStatus','status','json','offset','limit','set','apply','reject','update','then','destroy','error','name','send','map','WhatsappApplication','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','count','includeAll','include','findAll','catch','show','create','body','find','params','html-pdf','rimraf','zip-dir','request-promise','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils'];(function(_0x59290a,_0x961ab9){var _0x1cdcb3=function(_0x5903a0){while(--_0x5903a0){_0x59290a['push'](_0x59290a['shift']());}};_0x1cdcb3(++_0x961ab9);}(_0xc947,0x14d));var _0x7c94=function(_0x642116,_0x7fc16){_0x642116=_0x642116-0x0;var _0x3ddeaa=_0xc947[_0x642116];return _0x3ddeaa;};'use strict';var pdf=require(_0x7c94('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x7c94('0x1'));var zipdir=require(_0x7c94('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7c94('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x7c94('0x4'));var path=require(_0x7c94('0x5'));var sox=require(_0x7c94('0x6'));var csv=require(_0x7c94('0x7'));var ejs=require(_0x7c94('0x8'));var fs=require('fs');var _=require(_0x7c94('0x9'));var squel=require(_0x7c94('0xa'));var crypto=require(_0x7c94('0xb'));var jsforce=require(_0x7c94('0xc'));var deskjs=require(_0x7c94('0xd'));var toCsv=require(_0x7c94('0x7'));var querystring=require('querystring');var Papa=require(_0x7c94('0xe'));var Redis=require(_0x7c94('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x7c94('0x10'));var as=require(_0x7c94('0x11'));var hardwareService=require(_0x7c94('0x12'));var logger=require(_0x7c94('0x13'))(_0x7c94('0x14'));var utils=require(_0x7c94('0x15'));var config=require(_0x7c94('0x16'));var db=require(_0x7c94('0x17'))['db'];function respondWithStatusCode(_0x263f86,_0x5345ff){_0x5345ff=_0x5345ff||0xcc;return function(_0x17ca1d){if(_0x17ca1d){return _0x263f86[_0x7c94('0x18')](_0x5345ff);}return _0x263f86[_0x7c94('0x19')](_0x5345ff)['end']();};}function respondWithResult(_0x2762bf,_0x206289){_0x206289=_0x206289||0xc8;return function(_0x4cb190){if(_0x4cb190){return _0x2762bf[_0x7c94('0x19')](_0x206289)[_0x7c94('0x1a')](_0x4cb190);}};}function respondWithFilteredResult(_0x1bec5c,_0x363177){return function(_0x4079be){if(_0x4079be){var _0x1128ea=_0x4079be['count'],_0x50c518=_0x363177['offset'],_0x4e2280=_0x363177[_0x7c94('0x1b')]+_0x363177[_0x7c94('0x1c')],_0x376def;if(_0x4e2280>=_0x1128ea){_0x4e2280=_0x1128ea;_0x376def=0xc8;}else{_0x376def=0xce;}_0x1bec5c[_0x7c94('0x19')](_0x376def);return _0x1bec5c[_0x7c94('0x1d')]('Content-Range',_0x50c518+'-'+_0x4e2280+'/'+_0x1128ea)[_0x7c94('0x1a')](_0x4079be);}return null;};}function patchUpdates(_0xaed9b6){return function(_0x1bbc50){try{jsonpatch[_0x7c94('0x1e')](_0x1bbc50,_0xaed9b6,!![]);}catch(_0x18da01){return BPromise[_0x7c94('0x1f')](_0x18da01);}return _0x1bbc50['save']();};}function saveUpdates(_0x4b9f54,_0x18a951){return function(_0x463d53){if(_0x463d53){return _0x463d53[_0x7c94('0x20')](_0x4b9f54)[_0x7c94('0x21')](function(_0x5cd64e){return _0x5cd64e;});}return null;};}function removeEntity(_0xd5bcaa,_0x2847a6){return function(_0x5eef67){if(_0x5eef67){return _0x5eef67[_0x7c94('0x22')]()[_0x7c94('0x21')](function(){_0xd5bcaa[_0x7c94('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x492551,_0x5aaf6e){return function(_0x1a80a9){if(!_0x1a80a9){_0x492551[_0x7c94('0x18')](0x194);}return _0x1a80a9;};}function handleError(_0x28b6ab,_0x128a82){_0x128a82=_0x128a82||0x1f4;return function(_0x292996){logger[_0x7c94('0x23')](_0x292996['stack']);if(_0x292996[_0x7c94('0x24')]){delete _0x292996[_0x7c94('0x24')];}_0x28b6ab[_0x7c94('0x19')](_0x128a82)[_0x7c94('0x25')](_0x292996);};}exports['index']=function(_0x713925,_0x2e8d5e){var _0x3412c6={},_0x2dba95={},_0x4e0c2d={'count':0x0,'rows':[]};var _0x5c6b98=_[_0x7c94('0x26')](db[_0x7c94('0x27')]['rawAttributes'],function(_0x19d1f8){return{'name':_0x19d1f8[_0x7c94('0x28')],'type':_0x19d1f8[_0x7c94('0x29')][_0x7c94('0x2a')]};});_0x2dba95[_0x7c94('0x2b')]=_['map'](_0x5c6b98,_0x7c94('0x24'));_0x2dba95[_0x7c94('0x2c')]=_[_0x7c94('0x2d')](_0x713925[_0x7c94('0x2c')]);_0x2dba95[_0x7c94('0x2e')]=_[_0x7c94('0x2f')](_0x2dba95[_0x7c94('0x2b')],_0x2dba95['query']);_0x3412c6[_0x7c94('0x30')]=_[_0x7c94('0x2f')](_0x2dba95[_0x7c94('0x2b')],qs[_0x7c94('0x31')](_0x713925['query'][_0x7c94('0x31')]));_0x3412c6[_0x7c94('0x30')]=_0x3412c6[_0x7c94('0x30')][_0x7c94('0x32')]?_0x3412c6[_0x7c94('0x30')]:_0x2dba95['model'];if(!_0x713925[_0x7c94('0x2c')][_0x7c94('0x33')](_0x7c94('0x34'))){_0x3412c6['limit']=qs[_0x7c94('0x1c')](_0x713925[_0x7c94('0x2c')][_0x7c94('0x1c')]);_0x3412c6[_0x7c94('0x1b')]=qs[_0x7c94('0x1b')](_0x713925[_0x7c94('0x2c')][_0x7c94('0x1b')]);}_0x3412c6[_0x7c94('0x35')]=qs[_0x7c94('0x36')](_0x713925[_0x7c94('0x2c')][_0x7c94('0x36')]);_0x3412c6[_0x7c94('0x37')]=qs[_0x7c94('0x2e')](_[_0x7c94('0x38')](_0x713925[_0x7c94('0x2c')],_0x2dba95[_0x7c94('0x2e')]),_0x5c6b98);if(_0x713925[_0x7c94('0x2c')][_0x7c94('0x39')]){_0x3412c6[_0x7c94('0x37')]=_[_0x7c94('0x3a')](_0x3412c6['where'],{'$or':_['map'](_0x5c6b98,function(_0x59ab08){if(_0x59ab08[_0x7c94('0x29')]!==_0x7c94('0x3b')){var _0x5cdf5e={};_0x5cdf5e[_0x59ab08['name']]={'$like':'%'+_0x713925['query'][_0x7c94('0x39')]+'%'};return _0x5cdf5e;}})});}_0x3412c6=_[_0x7c94('0x3a')]({},_0x3412c6,_0x713925[_0x7c94('0x3c')]);var _0x50b7dc={'where':_0x3412c6['where']};return db['WhatsappApplication'][_0x7c94('0x3d')](_0x50b7dc)[_0x7c94('0x21')](function(_0x379f23){_0x4e0c2d[_0x7c94('0x3d')]=_0x379f23;if(_0x713925[_0x7c94('0x2c')][_0x7c94('0x3e')]){_0x3412c6[_0x7c94('0x3f')]=[{'all':!![]}];}return db[_0x7c94('0x27')][_0x7c94('0x40')](_0x3412c6);})[_0x7c94('0x21')](function(_0xad0981){_0x4e0c2d['rows']=_0xad0981;return _0x4e0c2d;})['then'](respondWithFilteredResult(_0x2e8d5e,_0x3412c6))[_0x7c94('0x41')](handleError(_0x2e8d5e,null));};exports[_0x7c94('0x42')]=function(_0x49f46f,_0x43c9da){var _0x319551={'raw':!![],'where':{'id':_0x49f46f['params']['id']}},_0x15b3f4={};_0x15b3f4['model']=_['keys'](db['WhatsappApplication']['rawAttributes']);_0x15b3f4[_0x7c94('0x2c')]=_['keys'](_0x49f46f['query']);_0x15b3f4[_0x7c94('0x2e')]=_[_0x7c94('0x2f')](_0x15b3f4[_0x7c94('0x2b')],_0x15b3f4['query']);_0x319551[_0x7c94('0x30')]=_[_0x7c94('0x2f')](_0x15b3f4[_0x7c94('0x2b')],qs['fields'](_0x49f46f[_0x7c94('0x2c')][_0x7c94('0x31')]));_0x319551[_0x7c94('0x30')]=_0x319551[_0x7c94('0x30')]['length']?_0x319551[_0x7c94('0x30')]:_0x15b3f4['model'];if(_0x49f46f[_0x7c94('0x2c')][_0x7c94('0x3e')]){_0x319551[_0x7c94('0x3f')]=[{'all':!![]}];}_0x319551=_[_0x7c94('0x3a')]({},_0x319551,_0x49f46f[_0x7c94('0x3c')]);return db['WhatsappApplication']['find'](_0x319551)[_0x7c94('0x21')](handleEntityNotFound(_0x43c9da,null))[_0x7c94('0x21')](respondWithResult(_0x43c9da,null))['catch'](handleError(_0x43c9da,null));};exports[_0x7c94('0x43')]=function(_0x5e995a,_0x1163d3){return db[_0x7c94('0x27')][_0x7c94('0x43')](_0x5e995a[_0x7c94('0x44')],{})['then'](respondWithResult(_0x1163d3,0xc9))[_0x7c94('0x41')](handleError(_0x1163d3,null));};exports[_0x7c94('0x20')]=function(_0x7a4c5c,_0x24095c){if(_0x7a4c5c[_0x7c94('0x44')]['id']){delete _0x7a4c5c[_0x7c94('0x44')]['id'];}return db[_0x7c94('0x27')][_0x7c94('0x45')]({'where':{'id':_0x7a4c5c[_0x7c94('0x46')]['id']}})['then'](handleEntityNotFound(_0x24095c,null))[_0x7c94('0x21')](saveUpdates(_0x7a4c5c[_0x7c94('0x44')],null))[_0x7c94('0x21')](respondWithResult(_0x24095c,null))[_0x7c94('0x41')](handleError(_0x24095c,null));};exports['destroy']=function(_0x4f3d3a,_0x1ddbcb){return db['WhatsappApplication']['find']({'where':{'id':_0x4f3d3a[_0x7c94('0x46')]['id']}})['then'](handleEntityNotFound(_0x1ddbcb,null))[_0x7c94('0x21')](removeEntity(_0x1ddbcb,null))[_0x7c94('0x41')](handleError(_0x1ddbcb,null));};
\ No newline at end of file
diff --git a/server/api/whatsappApplication/whatsappApplication.model.js b/server/api/whatsappApplication/whatsappApplication.model.js
index f2c5ffd..c79e6e4 100644
--- a/server/api/whatsappApplication/whatsappApplication.model.js
+++ b/server/api/whatsappApplication/whatsappApplication.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x205d=['../../config/environment','./whatsappApplication.attributes','exports','define','WhatsappApplication','whatsapp_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','bluebird','request-promise','path'];(function(_0x1bfdf2,_0x492061){var _0x52a4d5=function(_0x5f4b08){while(--_0x5f4b08){_0x1bfdf2['push'](_0x1bfdf2['shift']());}};_0x52a4d5(++_0x492061);}(_0x205d,0xf6));var _0xd205=function(_0x52ce3e,_0x25abc7){_0x52ce3e=_0x52ce3e-0x0;var _0x49f0ef=_0x205d[_0x52ce3e];return _0x49f0ef;};'use strict';var _=require(_0xd205('0x0'));var util=require(_0xd205('0x1'));var logger=require(_0xd205('0x2'))('api');var moment=require('moment');var BPromise=require(_0xd205('0x3'));var rp=require(_0xd205('0x4'));var fs=require('fs');var path=require(_0xd205('0x5'));var rimraf=require('rimraf');var config=require(_0xd205('0x6'));var attributes=require(_0xd205('0x7'));module[_0xd205('0x8')]=function(_0x45a533,_0x4c078b){return _0x45a533[_0xd205('0x9')](_0xd205('0xa'),attributes,{'tableName':_0xd205('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xd205('0xc'),'collate':_0xd205('0xd')});};
\ No newline at end of file
+var _0xbd99=['util','api','moment','request-promise','path','rimraf','../../config/environment','./whatsappApplication.attributes','exports','define','WhatsappApplication','whatsapp_applications','utf8mb4','utf8mb4_unicode_ci','lodash'];(function(_0x1d87fc,_0x1e5321){var _0x492b56=function(_0x4c6b16){while(--_0x4c6b16){_0x1d87fc['push'](_0x1d87fc['shift']());}};_0x492b56(++_0x1e5321);}(_0xbd99,0x1df));var _0x9bd9=function(_0x42072c,_0x117b1d){_0x42072c=_0x42072c-0x0;var _0x11ca18=_0xbd99[_0x42072c];return _0x11ca18;};'use strict';var _=require(_0x9bd9('0x0'));var util=require(_0x9bd9('0x1'));var logger=require('../../config/logger')(_0x9bd9('0x2'));var moment=require(_0x9bd9('0x3'));var BPromise=require('bluebird');var rp=require(_0x9bd9('0x4'));var fs=require('fs');var path=require(_0x9bd9('0x5'));var rimraf=require(_0x9bd9('0x6'));var config=require(_0x9bd9('0x7'));var attributes=require(_0x9bd9('0x8'));module[_0x9bd9('0x9')]=function(_0x111a1c,_0x4be10e){return _0x111a1c[_0x9bd9('0xa')](_0x9bd9('0xb'),attributes,{'tableName':_0x9bd9('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x9bd9('0xd'),'collate':_0x9bd9('0xe')});};
\ No newline at end of file
diff --git a/server/api/whatsappApplication/whatsappApplication.rpc.js b/server/api/whatsappApplication/whatsappApplication.rpc.js
index 361b428..48331fe 100644
--- a/server/api/whatsappApplication/whatsappApplication.rpc.js
+++ b/server/api/whatsappApplication/whatsappApplication.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x8958=['client','http','request','then','info','WhatsappApplication,\x20%s,\x20%s','request\x20sent','debug','WhatsappApplication,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','util','../../mysqldb','../../config/logger','rpc','../../config/environment'];(function(_0x35b18a,_0x6b2fbe){var _0x4db1bd=function(_0x389e62){while(--_0x389e62){_0x35b18a['push'](_0x35b18a['shift']());}};_0x4db1bd(++_0x6b2fbe);}(_0x8958,0x93));var _0x8895=function(_0x3123c3,_0x3c1c2d){_0x3123c3=_0x3123c3-0x0;var _0x31095d=_0x8958[_0x3123c3];return _0x31095d;};'use strict';var _=require('lodash');var util=require(_0x8895('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8895('0x1'))['db'];var utils=require('../../config/utils');var logger=require(_0x8895('0x2'))(_0x8895('0x3'));var config=require(_0x8895('0x4'));var jayson=require('jayson/promise');var client=jayson[_0x8895('0x5')][_0x8895('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x124e1e,_0x40cec6,_0x33013a){return new BPromise(function(_0x51376b,_0xe018b8){return client[_0x8895('0x7')](_0x124e1e,_0x33013a)[_0x8895('0x8')](function(_0x24fe49){logger[_0x8895('0x9')](_0x8895('0xa'),_0x40cec6,_0x8895('0xb'));logger[_0x8895('0xc')](_0x8895('0xd'),_0x40cec6,_0x8895('0xb'),JSON['stringify'](_0x24fe49));if(_0x24fe49[_0x8895('0xe')]){if(_0x24fe49[_0x8895('0xe')][_0x8895('0xf')]===0x1f4){logger[_0x8895('0xe')](_0x8895('0xa'),_0x40cec6,_0x24fe49[_0x8895('0xe')]['message']);return _0xe018b8(_0x24fe49[_0x8895('0xe')][_0x8895('0x10')]);}logger[_0x8895('0xe')]('WhatsappApplication,\x20%s,\x20%s',_0x40cec6,_0x24fe49['error'][_0x8895('0x10')]);return _0x51376b(_0x24fe49['error'][_0x8895('0x10')]);}else{logger[_0x8895('0x9')](_0x8895('0xa'),_0x40cec6,_0x8895('0xb'));_0x51376b(_0x24fe49[_0x8895('0x11')]['message']);}})[_0x8895('0x12')](function(_0x100fc8){logger[_0x8895('0xe')](_0x8895('0xa'),_0x40cec6,_0x100fc8);_0xe018b8(_0x100fc8);});});}
\ No newline at end of file
+var _0x723e=['WhatsappApplication,\x20%s,\x20%s','debug','WhatsappApplication,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','info'];(function(_0x35baae,_0x2f15da){var _0x5720a1=function(_0x38e725){while(--_0x38e725){_0x35baae['push'](_0x35baae['shift']());}};_0x5720a1(++_0x2f15da);}(_0x723e,0x179));var _0xe723=function(_0x3a70f0,_0xfcc97){_0x3a70f0=_0x3a70f0-0x0;var _0x1d69b9=_0x723e[_0x3a70f0];return _0x1d69b9;};'use strict';var _=require('lodash');var util=require(_0xe723('0x0'));var moment=require(_0xe723('0x1'));var BPromise=require(_0xe723('0x2'));var rs=require(_0xe723('0x3'));var fs=require('fs');var Redis=require(_0xe723('0x4'));var db=require(_0xe723('0x5'))['db'];var utils=require(_0xe723('0x6'));var logger=require(_0xe723('0x7'))(_0xe723('0x8'));var config=require(_0xe723('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xe723('0xa')][_0xe723('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1335cd,_0x3bf082,_0x2aebbd){return new BPromise(function(_0xe50f7,_0x1b46e0){return client[_0xe723('0xc')](_0x1335cd,_0x2aebbd)['then'](function(_0x380444){logger[_0xe723('0xd')](_0xe723('0xe'),_0x3bf082,'request\x20sent');logger[_0xe723('0xf')](_0xe723('0x10'),_0x3bf082,_0xe723('0x11'),JSON['stringify'](_0x380444));if(_0x380444[_0xe723('0x12')]){if(_0x380444[_0xe723('0x12')][_0xe723('0x13')]===0x1f4){logger[_0xe723('0x12')](_0xe723('0xe'),_0x3bf082,_0x380444['error'][_0xe723('0x14')]);return _0x1b46e0(_0x380444['error']['message']);}logger['error']('WhatsappApplication,\x20%s,\x20%s',_0x3bf082,_0x380444[_0xe723('0x12')][_0xe723('0x14')]);return _0xe50f7(_0x380444[_0xe723('0x12')][_0xe723('0x14')]);}else{logger[_0xe723('0xd')]('WhatsappApplication,\x20%s,\x20%s',_0x3bf082,_0xe723('0x11'));_0xe50f7(_0x380444[_0xe723('0x15')][_0xe723('0x14')]);}})[_0xe723('0x16')](function(_0x347fa0){logger[_0xe723('0x12')](_0xe723('0xe'),_0x3bf082,_0x347fa0);_0x1b46e0(_0x347fa0);});});}
\ No newline at end of file
diff --git a/server/api/whatsappInteraction/index.js b/server/api/whatsappInteraction/index.js
index b7f38ea..1187c50 100644
--- a/server/api/whatsappInteraction/index.js
+++ b/server/api/whatsappInteraction/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xc7c6=['/describe','isAuthenticated','describe','/:id','/:id/messages','getMessages','/:id/download','download','post','addMessage','tracked','whatsapp','whatsappinteraction:addtags','put','whatsappinteraction:update','delete','destroy','exports','multer','util','path','express','Router','../../config/environment','get','index'];(function(_0x39a04c,_0x2b4002){var _0x580cb0=function(_0x138902){while(--_0x138902){_0x39a04c['push'](_0x39a04c['shift']());}};_0x580cb0(++_0x2b4002);}(_0xc7c6,0x14a));var _0x6c7c=function(_0xfba02c,_0x4c50cf){_0xfba02c=_0xfba02c-0x0;var _0x3f9831=_0xc7c6[_0xfba02c];return _0x3f9831;};'use strict';var multer=require(_0x6c7c('0x0'));var util=require(_0x6c7c('0x1'));var path=require(_0x6c7c('0x2'));var timeout=require('connect-timeout');var express=require(_0x6c7c('0x3'));var router=express[_0x6c7c('0x4')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x6c7c('0x5'));var controller=require('./whatsappInteraction.controller');router[_0x6c7c('0x6')]('/',auth['isAuthenticated'](),controller[_0x6c7c('0x7')]);router['get'](_0x6c7c('0x8'),auth[_0x6c7c('0x9')](),controller[_0x6c7c('0xa')]);router['get'](_0x6c7c('0xb'),auth[_0x6c7c('0x9')](),controller['show']);router[_0x6c7c('0x6')](_0x6c7c('0xc'),auth[_0x6c7c('0x9')](),controller[_0x6c7c('0xd')]);router['get'](_0x6c7c('0xe'),auth[_0x6c7c('0x9')](),controller[_0x6c7c('0xf')]);router[_0x6c7c('0x10')]('/',auth['isAuthenticated'](),controller['create']);router[_0x6c7c('0x10')]('/:id/messages',auth[_0x6c7c('0x9')](),controller[_0x6c7c('0x11')]);router[_0x6c7c('0x10')]('/:id/tags',auth[_0x6c7c('0x9')](),interaction[_0x6c7c('0x12')](_0x6c7c('0x13'),_0x6c7c('0x14')),controller['addTags']);router[_0x6c7c('0x15')](_0x6c7c('0xb'),auth[_0x6c7c('0x9')](),interaction[_0x6c7c('0x12')](_0x6c7c('0x13'),_0x6c7c('0x16')),controller['update']);router[_0x6c7c('0x17')]('/:id',auth['isAuthenticated'](),interaction[_0x6c7c('0x12')](_0x6c7c('0x13'),'whatsappinteraction:destroy'),controller[_0x6c7c('0x18')]);router[_0x6c7c('0x17')]('/:id/tags',auth[_0x6c7c('0x9')](),controller['removeTags']);module[_0x6c7c('0x19')]=router;
\ No newline at end of file
+var _0x623e=['whatsapp','whatsappinteraction:addtags','addTags','put','update','delete','whatsappinteraction:destroy','destroy','/:id/tags','removeTags','exports','multer','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappInteraction.controller','isAuthenticated','/describe','describe','get','/:id','getMessages','/:id/download','download','post','/:id/messages','addMessage','tracked'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x623e,0x65));var _0xe623=function(_0x1221df,_0x358abb){_0x1221df=_0x1221df-0x0;var _0x38eff4=_0x623e[_0x1221df];return _0x38eff4;};'use strict';var multer=require(_0xe623('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xe623('0x1'));var express=require('express');var router=express[_0xe623('0x2')]();var auth=require(_0xe623('0x3'));var interaction=require(_0xe623('0x4'));var config=require(_0xe623('0x5'));var controller=require(_0xe623('0x6'));router['get']('/',auth[_0xe623('0x7')](),controller['index']);router['get'](_0xe623('0x8'),auth[_0xe623('0x7')](),controller[_0xe623('0x9')]);router[_0xe623('0xa')](_0xe623('0xb'),auth['isAuthenticated'](),controller['show']);router[_0xe623('0xa')]('/:id/messages',auth['isAuthenticated'](),controller[_0xe623('0xc')]);router[_0xe623('0xa')](_0xe623('0xd'),auth[_0xe623('0x7')](),controller[_0xe623('0xe')]);router[_0xe623('0xf')]('/',auth[_0xe623('0x7')](),controller['create']);router['post'](_0xe623('0x10'),auth[_0xe623('0x7')](),controller[_0xe623('0x11')]);router[_0xe623('0xf')]('/:id/tags',auth[_0xe623('0x7')](),interaction[_0xe623('0x12')](_0xe623('0x13'),_0xe623('0x14')),controller[_0xe623('0x15')]);router[_0xe623('0x16')]('/:id',auth[_0xe623('0x7')](),interaction[_0xe623('0x12')]('whatsapp','whatsappinteraction:update'),controller[_0xe623('0x17')]);router[_0xe623('0x18')](_0xe623('0xb'),auth[_0xe623('0x7')](),interaction[_0xe623('0x12')]('whatsapp',_0xe623('0x19')),controller[_0xe623('0x1a')]);router['delete'](_0xe623('0x1b'),auth[_0xe623('0x7')](),controller[_0xe623('0x1c')]);module[_0xe623('0x1d')]=router;
\ No newline at end of file
diff --git a/server/api/whatsappInteraction/whatsappInteraction.attributes.js b/server/api/whatsappInteraction/whatsappInteraction.attributes.js
index f23e693..4793e2b 100644
--- a/server/api/whatsappInteraction/whatsappInteraction.attributes.js
+++ b/server/api/whatsappInteraction/whatsappInteraction.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xf61e=['moment','DATE','STRING','out','ENUM','sequelize'];(function(_0x2bea38,_0x44e15f){var _0x24185f=function(_0x271dd4){while(--_0x271dd4){_0x2bea38['push'](_0x2bea38['shift']());}};_0x24185f(++_0x44e15f);}(_0xf61e,0xbf));var _0xef61=function(_0x559fe0,_0x5af2ba){_0x559fe0=_0x559fe0-0x0;var _0x4d0296=_0xf61e[_0x559fe0];return _0x4d0296;};'use strict';var Sequelize=require(_0xef61('0x0'));var moment=require(_0xef61('0x1'));module['exports']={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xef61('0x2')]},'disposition':{'type':Sequelize[_0xef61('0x3')]},'note':{'type':Sequelize['STRING']},'phone':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0xef61('0x2')]},'firstMsgDirection':{'type':Sequelize['ENUM']('in',_0xef61('0x4')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xef61('0x2')]},'lastMsgDirection':{'type':Sequelize[_0xef61('0x5')]('in',_0xef61('0x4')),'defaultValue':'in','allowNull':![]}};
\ No newline at end of file
+var _0xed66=['sequelize','moment','exports','BOOLEAN','DATE','STRING','out'];(function(_0x4185d0,_0x326106){var _0x4a12a2=function(_0x3cace1){while(--_0x3cace1){_0x4185d0['push'](_0x4185d0['shift']());}};_0x4a12a2(++_0x326106);}(_0xed66,0x8c));var _0x6ed6=function(_0x1ecbad,_0xe90ac4){_0x1ecbad=_0x1ecbad-0x0;var _0x50fe57=_0xed66[_0x1ecbad];return _0x50fe57;};'use strict';var Sequelize=require(_0x6ed6('0x0'));var moment=require(_0x6ed6('0x1'));module[_0x6ed6('0x2')]={'closed':{'type':Sequelize[_0x6ed6('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x6ed6('0x4')]},'disposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x6ed6('0x5')]},'phone':{'type':Sequelize[_0x6ed6('0x5')]},'read1stAt':{'type':Sequelize['DATE']},'firstMsgDirection':{'type':Sequelize['ENUM']('in',_0x6ed6('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x6ed6('0x4')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0x6ed6('0x6')),'defaultValue':'in','allowNull':![]}};
\ No newline at end of file
diff --git a/server/api/whatsappInteraction/whatsappInteraction.controller.js b/server/api/whatsappInteraction/whatsappInteraction.controller.js
index 548c085..a4e6b10 100644
--- a/server/api/whatsappInteraction/whatsappInteraction.controller.js
+++ b/server/api/whatsappInteraction/whatsappInteraction.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xc4aa=['status','end','json','count','offset','set','Content-Range','apply','save','update','then','destroy','error','stack','name','send','map','fullname','TagIds','Tags','split','push','catch','WhatsappInteraction','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','hasOwnProperty','nolimit','limit','sort','where','pick','select','field','color','from','u.id','u.fullname','ui.WhatsappInteractionId','user_has_whatsapp_interactions','left_join','users','u.id\x20=\x20ui.UserId','whatsapp_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','a.id\x20=\x20i.WhatsappAccountId','whatsapp_messages','me.WhatsappInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','parseSearch','search','sqlOperator','conditions','find','unreadMessages','value','having','`\x20=\x200','Contact','operator','length','getFullTextValue','ContactId','buildExpression','type','start','Tag','forEach','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','text','body','some','compact','isEmpty','WhatsappAccountId','i.WhatsappAccountId\x20IN\x20?','concat','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','isArray','tag','filter','replace','\x27\x27\x27\x27','i.phone\x20LIKE\x20?','group','QueryTypes','SELECT','clone','order','journey','i.WhatsappAccountId\x20IS\x20NOT\x20NULL','getWhatsappAccounts','i.WhatsappAccountId\x20IS\x20NULL','sequelize','toString','keyBy','fields','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','c.firstName','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.email','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.WhatsappInteractionId\x20IN\x20?','groupBy','WhatsappInteractionId','all','rows','show','params','include','merge','create','describe','addMessage','WhatsappMessage','ids','getMessages','findOne','YYYY-MM-DD\x20HH:mm:ss','options','findAll','setTags','omit','emit','whatsappInteractionTags:save','removeTags','unix','join','root','server','files','tmp','attachments','transcript-%d-%s.zip','CmContact','firstName','lastName','Attachment','createdAt','secret','WhatsappAccount','Account','get','mkdirSync','40px','\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
Interaction\x20Transcript \x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','30px','format','%s\x20#%d','Whatsapp','YYYY-MM-DD','Owner','N.A.','closed','closedAt','disposition','basename','existsSync','createReadStream','pipe','createWriteStream','direction','out','System','downloadInteraction.html','transcript-','download','log','err','unlinkSync','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','util','path','sox','to-csv','ejs','lodash','squel','crypto','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./whatsappInteraction.socket','register','sendStatus'];(function(_0x416f9a,_0x1a218f){var _0x478542=function(_0x94220b){while(--_0x94220b){_0x416f9a['push'](_0x416f9a['shift']());}};_0x478542(++_0x1a218f);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x5d6456,_0x58ecc7){_0x5d6456=_0x5d6456-0x0;var _0x4d66c1=_0xc4aa[_0x5d6456];return _0x4d66c1;};'use strict';var pdf=require(_0xac4a('0x0'));var emlformat=require(_0xac4a('0x1'));var rimraf=require(_0xac4a('0x2'));var zipdir=require(_0xac4a('0x3'));var jsonpatch=require(_0xac4a('0x4'));var rp=require(_0xac4a('0x5'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xac4a('0x6'));var path=require(_0xac4a('0x7'));var sox=require(_0xac4a('0x8'));var csv=require(_0xac4a('0x9'));var ejs=require(_0xac4a('0xa'));var fs=require('fs');var _=require(_0xac4a('0xb'));var squel=require(_0xac4a('0xc'));var crypto=require(_0xac4a('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xac4a('0x9'));var querystring=require(_0xac4a('0xe'));var Papa=require(_0xac4a('0xf'));var Redis=require('ioredis');var authService=require(_0xac4a('0x10'));var qs=require(_0xac4a('0x11'));var as=require(_0xac4a('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xac4a('0x13'))('api');var utils=require(_0xac4a('0x14'));var config=require('../../config/environment');var db=require(_0xac4a('0x15'))['db'];config[_0xac4a('0x16')]=_[_0xac4a('0x17')](config['redis'],{'host':_0xac4a('0x18'),'port':0x18eb});var socket=require(_0xac4a('0x19'))(new Redis(config[_0xac4a('0x16')]));require(_0xac4a('0x1a'))[_0xac4a('0x1b')](socket);function respondWithStatusCode(_0x3b71c0,_0x34bc01){_0x34bc01=_0x34bc01||0xcc;return function(_0x33c287){if(_0x33c287){return _0x3b71c0[_0xac4a('0x1c')](_0x34bc01);}return _0x3b71c0[_0xac4a('0x1d')](_0x34bc01)[_0xac4a('0x1e')]();};}function respondWithResult(_0x26dbb8,_0x4a2119){_0x4a2119=_0x4a2119||0xc8;return function(_0x402fff){if(_0x402fff){return _0x26dbb8[_0xac4a('0x1d')](_0x4a2119)[_0xac4a('0x1f')](_0x402fff);}};}function respondWithFilteredResult(_0x144553,_0x3e88e3){return function(_0x387a54){if(_0x387a54){var _0x28e304=_0x387a54[_0xac4a('0x20')],_0x44ec59=_0x3e88e3[_0xac4a('0x21')],_0x546c5d=_0x3e88e3[_0xac4a('0x21')]+_0x3e88e3['limit'],_0x5ac21e;if(_0x546c5d>=_0x28e304){_0x546c5d=_0x28e304;_0x5ac21e=0xc8;}else{_0x5ac21e=0xce;}_0x144553[_0xac4a('0x1d')](_0x5ac21e);return _0x144553[_0xac4a('0x22')](_0xac4a('0x23'),_0x44ec59+'-'+_0x546c5d+'/'+_0x28e304)[_0xac4a('0x1f')](_0x387a54);}return null;};}function patchUpdates(_0x123694){return function(_0x3e829c){try{jsonpatch[_0xac4a('0x24')](_0x3e829c,_0x123694,!![]);}catch(_0x3ca790){return BPromise['reject'](_0x3ca790);}return _0x3e829c[_0xac4a('0x25')]();};}function saveUpdates(_0x3204ad,_0x599787){return function(_0x3d7ce0){if(_0x3d7ce0){return _0x3d7ce0[_0xac4a('0x26')](_0x3204ad)[_0xac4a('0x27')](function(_0x947d8e){return _0x947d8e;});}return null;};}function removeEntity(_0x4d2d6c,_0x1b7998){return function(_0x2503d8){if(_0x2503d8){return _0x2503d8[_0xac4a('0x28')]()[_0xac4a('0x27')](function(){_0x4d2d6c[_0xac4a('0x1d')](0xcc)[_0xac4a('0x1e')]();});}};}function handleEntityNotFound(_0x222507,_0x36054a){return function(_0x3e2c69){if(!_0x3e2c69){_0x222507[_0xac4a('0x1c')](0x194);}return _0x3e2c69;};}function handleError(_0x1d0539,_0x215a31){_0x215a31=_0x215a31||0x1f4;return function(_0x14832b){logger[_0xac4a('0x29')](_0x14832b[_0xac4a('0x2a')]);if(_0x14832b[_0xac4a('0x2b')]){delete _0x14832b['name'];}_0x1d0539[_0xac4a('0x1d')](_0x215a31)[_0xac4a('0x2c')](_0x14832b);};}function getInteractionUsers(_0x42a33c,_0x2772fe){return new BPromise(function(_0x116700,_0x4a5a9e){try{if(_0x2772fe[_0x42a33c['id']]){_0x42a33c['Users']=_[_0xac4a('0x2d')](_0x2772fe[_0x42a33c['id']],function(_0x7a948b){return{'id':_0x7a948b['id'],'fullname':_0x7a948b[_0xac4a('0x2e')]};});}}catch(_0x546b65){_0x4a5a9e(_0x546b65);}_0x116700(_0x42a33c);});}function getInteractionTags(_0x4bda1f,_0x355755){return new BPromise(function(_0x2896bc,_0x228629){try{if(_0x4bda1f[_0xac4a('0x2f')]){_0x4bda1f[_0xac4a('0x30')]=[];_0x4bda1f['TagIds'][_0xac4a('0x31')](',')['forEach'](function(_0x30364b){_0x4bda1f['Tags'][_0xac4a('0x32')](_0x355755[_0x30364b]);});}delete _0x4bda1f[_0xac4a('0x2f')];}catch(_0x31501b){_0x228629(_0x31501b);}_0x2896bc(_0x4bda1f);});}function updateWhatsappInteraction(_0x228aa7,_0x34577f,_0x61e552){return new BPromise(function(_0xbd4591,_0x1f13f3){return getInteractionUsers(_0x228aa7,_0x61e552)[_0xac4a('0x27')](function(_0xfd7c16){return getInteractionTags(_0xfd7c16,_0x34577f);})[_0xac4a('0x27')](function(_0x1634df){_0xbd4591(_0x1634df);})[_0xac4a('0x33')](function(_0x1a9d4e){_0x1f13f3(_0x1a9d4e);});});}exports['index']=function(_0x30442d,_0x1c41fb){var _0x5a4e2b={},_0x2a5419={},_0x1af1c1={'count':0x0,'rows':[]};var _0x565164=_['map'](db[_0xac4a('0x34')][_0xac4a('0x35')],function(_0x1b42b6){return{'name':_0x1b42b6[_0xac4a('0x36')],'type':_0x1b42b6['type'][_0xac4a('0x37')]};});_0x2a5419[_0xac4a('0x38')]=_['map'](_0x565164,_0xac4a('0x2b'));_0x2a5419[_0xac4a('0x39')]=_[_0xac4a('0x3a')](_0x30442d['query']);_0x2a5419[_0xac4a('0x3b')]=_[_0xac4a('0x3c')](_0x2a5419[_0xac4a('0x38')],_0x2a5419['query']);_0x5a4e2b[_0xac4a('0x3d')]=_[_0xac4a('0x3c')](_0x2a5419['model'],qs['fields'](_0x30442d[_0xac4a('0x39')]['fields']));_0x5a4e2b['attributes']=_0x5a4e2b['attributes']['length']?_0x5a4e2b[_0xac4a('0x3d')]:_0x2a5419[_0xac4a('0x38')];if(!_0x30442d[_0xac4a('0x39')][_0xac4a('0x3e')](_0xac4a('0x3f'))){_0x5a4e2b[_0xac4a('0x40')]=qs[_0xac4a('0x40')](_0x30442d[_0xac4a('0x39')][_0xac4a('0x40')]);_0x5a4e2b[_0xac4a('0x21')]=qs[_0xac4a('0x21')](_0x30442d[_0xac4a('0x39')]['offset']);}_0x5a4e2b['order']=qs['sort'](_0x30442d[_0xac4a('0x39')][_0xac4a('0x41')]);_0x5a4e2b[_0xac4a('0x42')]=qs[_0xac4a('0x3b')](_[_0xac4a('0x43')](_0x30442d[_0xac4a('0x39')],_0x2a5419[_0xac4a('0x3b')]),_0x565164);var _0x3441f2=[];var _0x3e9973=squel[_0xac4a('0x44')]()['field']('id')[_0xac4a('0x45')](_0xac4a('0x2b'))[_0xac4a('0x45')](_0xac4a('0x46'))[_0xac4a('0x47')]('tools_tags');var _0x8700b4=squel[_0xac4a('0x44')]()['field'](_0xac4a('0x48'))['field'](_0xac4a('0x49'))[_0xac4a('0x45')](_0xac4a('0x4a'))[_0xac4a('0x47')](_0xac4a('0x4b'),'ui')[_0xac4a('0x4c')](_0xac4a('0x4d'),'u',_0xac4a('0x4e'));var _0x98e0c4=squel[_0xac4a('0x44')]()[_0xac4a('0x47')](_0xac4a('0x4f'),'i')['left_join'](_0xac4a('0x50'),'c',_0xac4a('0x51'))[_0xac4a('0x4c')]('users','o',_0xac4a('0x52'))[_0xac4a('0x4c')]('whatsapp_accounts','a',_0xac4a('0x53'))['left_join'](_0xac4a('0x54'),'me',_0xac4a('0x55'))[_0xac4a('0x4c')]('whatsapp_interaction_has_tags','it','it.WhatsappInteractionId\x20=\x20i.id')[_0xac4a('0x4c')]('tools_tags','t',_0xac4a('0x56'));var _0x566258=squel[_0xac4a('0x57')]();var _0x530bbb=[];var _0x3be103=squel[_0xac4a('0x57')]();var _0x424f9b;if(_0x30442d[_0xac4a('0x39')]['search']){_0x424f9b=as[_0xac4a('0x58')](_0x30442d[_0xac4a('0x39')][_0xac4a('0x59')]);var _0x1ee454=_0x424f9b[_0xac4a('0x5a')];for(var _0x138876=0x0;_0x138876<_0x424f9b[_0xac4a('0x5b')]['length'];_0x138876++){var _0x35dee5=_0x424f9b[_0xac4a('0x5b')][_0x138876];var _0x4828e3='i';var _0x16afbe=_[_0xac4a('0x5c')](_0x565164,[_0xac4a('0x2b'),_0x35dee5[_0xac4a('0x45')]]);if(!_0x16afbe){switch(_0x35dee5['field']){case _0xac4a('0x5d'):if(_0x35dee5[_0xac4a('0x5e')]==0x1){_0x98e0c4[_0xac4a('0x5f')]('`'+_0x35dee5[_0xac4a('0x45')]+_0xac4a('0x60'));}else{_0x98e0c4['having']('`'+_0x35dee5[_0xac4a('0x45')]+'`\x20>\x200');}break;case _0xac4a('0x61'):if(_0x35dee5[_0xac4a('0x62')]==='$substring'){if(_0x35dee5['value'][_0xac4a('0x31')]('\x20')[_0xac4a('0x63')]>0x1){_0x566258[_0x1ee454]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0xac4a('0x64')](_0x35dee5[_0xac4a('0x5e')]),null);}else{var _0x26b582='%'+_0x35dee5[_0xac4a('0x5e')]+'%';_0x566258[_0x1ee454]('c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?',_0x26b582,_0x26b582,_0x26b582);}}else{_0x16afbe=_[_0xac4a('0x5c')](_0x565164,[_0xac4a('0x2b'),_0xac4a('0x65')]);_0x35dee5[_0xac4a('0x45')]=_0xac4a('0x65');_0x19ce2c=as[_0xac4a('0x66')](_0x4828e3,_0x16afbe[_0xac4a('0x67')],_0x35dee5);_0x566258[_0x1ee454](_0x19ce2c['text'],_0x19ce2c[_0xac4a('0x5e')][_0xac4a('0x68')],_0x19ce2c[_0xac4a('0x5e')][_0xac4a('0x1e')]);}break;case _0xac4a('0x69'):var _0x2ac1e9=_0x35dee5[_0xac4a('0x5e')][_0xac4a('0x31')](',')[_0xac4a('0x2d')](function(_0x786d9){return Number(_0x786d9);});_0x2ac1e9[_0xac4a('0x6a')](function(_0x38dd4f){_0x3be103['or'](_0xac4a('0x6b'),'%,'+_0x38dd4f+',%');});_0x530bbb=_[_0xac4a('0x6c')](_0x530bbb,_0x2ac1e9);break;case _0xac4a('0x6d'):if(_0x35dee5[_0xac4a('0x62')]==='$substring'){_0x566258[_0x1ee454](_0xac4a('0x6e'),'%'+_0x35dee5['value']+'%',null);}else{_0x16afbe=_[_0xac4a('0x5c')](_0x565164,['name',_0xac4a('0x6f')]);_0x35dee5['field']=_0xac4a('0x6f');_0x19ce2c=as['buildExpression'](_0x4828e3,_0x16afbe['type'],_0x35dee5);_0x566258[_0x1ee454](_0x19ce2c[_0xac4a('0x70')],_0x19ce2c[_0xac4a('0x5e')][_0xac4a('0x68')],_0x19ce2c[_0xac4a('0x5e')][_0xac4a('0x1e')]);}break;case _0xac4a('0x71'):_0x19ce2c=as['buildExpression']('me',null,_0x35dee5);_0x566258[_0x1ee454](_0x19ce2c[_0xac4a('0x70')],_0x19ce2c['value'][_0xac4a('0x68')],_0x19ce2c['value'][_0xac4a('0x1e')]);break;}}else{var _0x19ce2c=as[_0xac4a('0x66')](_0x4828e3,_0x16afbe[_0xac4a('0x67')],_0x35dee5);_0x566258[_0x1ee454](_0x19ce2c[_0xac4a('0x70')],_0x19ce2c[_0xac4a('0x5e')][_0xac4a('0x68')],_0x19ce2c[_0xac4a('0x5e')][_0xac4a('0x1e')]);}}}else{var _0x430dd0=_(_0x30442d[_0xac4a('0x39')])[_0xac4a('0x3a')]()[_0xac4a('0x2d')](function(_0x2cc410){return _[_0xac4a('0x72')](_0x565164,[_0xac4a('0x2b'),_0x2cc410])?_0x2cc410:undefined;})[_0xac4a('0x73')]()['value']();if(!_[_0xac4a('0x74')](_0x430dd0)){_0x430dd0[_0xac4a('0x6a')](function(_0x4fb812){if(_0x4fb812===_0xac4a('0x75')){_0x98e0c4[_0xac4a('0x42')](_0xac4a('0x76'),[][_0xac4a('0x77')](_0x30442d[_0xac4a('0x39')][_0x4fb812]));}else if(_0x4fb812==='createdAt'){var _0x47c6d8=JSON[_0xac4a('0x78')](_0x30442d[_0xac4a('0x39')][_0x4fb812])[_0xac4a('0x79')];var _0x148288=JSON[_0xac4a('0x78')](_0x30442d[_0xac4a('0x39')][_0x4fb812])[_0xac4a('0x7a')];_0x98e0c4[_0xac4a('0x42')](_0xac4a('0x7b'),_0x47c6d8,_0x148288);}else{if(_0x30442d[_0xac4a('0x39')][_0x4fb812]===_0xac4a('0x7c')){_0x98e0c4['where']('i.'+_0x4fb812+'\x20IS\x20NULL');}else{_0x98e0c4[_0xac4a('0x42')]('i.'+_0x4fb812+_0xac4a('0x7d'),_0x30442d[_0xac4a('0x39')][_0x4fb812]);}}});}if(_0x30442d[_0xac4a('0x39')][_0xac4a('0x7e')]){if(_0x30442d[_0xac4a('0x39')][_0xac4a('0x7e')]==0x1){_0x98e0c4[_0xac4a('0x5f')](_0xac4a('0x7f'));}else{_0x98e0c4[_0xac4a('0x5f')](_0xac4a('0x80'));}}if(_0x30442d[_0xac4a('0x39')]['tag']){_0x530bbb=_[_0xac4a('0x81')](_0x30442d[_0xac4a('0x39')][_0xac4a('0x82')])?_0x30442d[_0xac4a('0x39')]['tag']:new Array(_0x30442d[_0xac4a('0x39')]['tag']);_0x530bbb[_0xac4a('0x6a')](function(_0x3af39a){_0x3be103['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x3af39a+',%');});}if(_0x30442d['query'][_0xac4a('0x83')]){var _0x3b8974=_0x30442d[_0xac4a('0x39')]['filter'][_0xac4a('0x84')]('\x5c','\x5c\x5c')['replace']('\x27\x27',_0xac4a('0x85'));if(qs['isNumeric'](_0x3b8974)){_0x566258['or']('i.id\x20LIKE\x20?',_0x3b8974+'%')['or'](_0xac4a('0x86'),_0x3b8974+'%');}else{_0x566258['or']('MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0xac4a('0x64')](_0x3b8974))['or']('CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?',_0x3b8974+'%');}}}_0x98e0c4[_0xac4a('0x42')](_0x566258);_0x98e0c4[_0xac4a('0x87')]('i.id');var _0x3980ae={'type':db['Sequelize'][_0xac4a('0x88')][_0xac4a('0x89')],'raw':!![]};var _0x522949=_0x98e0c4[_0xac4a('0x8a')]();_0x522949['field']('i.id');_0x522949[_0xac4a('0x45')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0xac4a('0x5d'));if(_0x5a4e2b['order']){_0x5a4e2b['order'][_0xac4a('0x6a')](function(_0x4065c0){_0x98e0c4[_0xac4a('0x8b')]('i.'+_0x4065c0[0x0],_0x4065c0[0x1]==='DESC'?![]:!![]);});}if(!_['isEmpty'](_0x530bbb)){_0x98e0c4[_0xac4a('0x5f')](_0x3be103);_0x522949[_0xac4a('0x42')]('t.id\x20IN\x20?',_0x530bbb);}BPromise['resolve']()[_0xac4a('0x27')](function(){if(!_0x424f9b){if(_0x30442d[_0xac4a('0x39')][_0xac4a('0x75')]||_0x30442d[_0xac4a('0x39')][_0xac4a('0x8c')])return;_0x522949[_0xac4a('0x42')](_0xac4a('0x8d'));_0x98e0c4[_0xac4a('0x42')](_0xac4a('0x8d'));return;}return _0x30442d['user'][_0xac4a('0x8e')]({'attributes':['id'],'raw':!![]})[_0xac4a('0x27')](function(_0x3ba61e){if(_['isEmpty'](_0x3ba61e)){_0x522949[_0xac4a('0x42')](_0xac4a('0x8f'));_0x98e0c4[_0xac4a('0x42')](_0xac4a('0x8f'));}else{_0x522949[_0xac4a('0x42')]('i.WhatsappAccountId\x20IN\x20?',_[_0xac4a('0x2d')](_0x3ba61e,'id'));_0x98e0c4[_0xac4a('0x42')](_0xac4a('0x76'),_[_0xac4a('0x2d')](_0x3ba61e,'id'));}});})[_0xac4a('0x27')](function(){db[_0xac4a('0x90')][_0xac4a('0x39')](_0x522949['toString'](),_0x3980ae)[_0xac4a('0x27')](function(_0x2be178){_0x1af1c1[_0xac4a('0x20')]=_0x2be178[_0xac4a('0x63')];if(_0x1af1c1[_0xac4a('0x20')]===0x0)return[];return db[_0xac4a('0x90')]['query'](_0x3e9973[_0xac4a('0x91')](),_0x3980ae)[_0xac4a('0x27')](function(_0x1b9a33){_0x3441f2=_[_0xac4a('0x92')](_0x1b9a33,'id');_0x3980ae=_['merge'](_0x3980ae,{'model':db[_0xac4a('0x34')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x30442d['query'][_0xac4a('0x93')]){_0x5a4e2b[_0xac4a('0x3d')]['forEach'](function(_0x5b95ab){_0x98e0c4[_0xac4a('0x45')]('i.'+_0x5b95ab);});}else{_0x98e0c4[_0xac4a('0x45')](_0xac4a('0x94'),'unreadMessages');_0x98e0c4[_0xac4a('0x45')]('a.key',_0xac4a('0x95'));_0x98e0c4[_0xac4a('0x45')](_0xac4a('0x96'),_0xac4a('0x97'));_0x98e0c4[_0xac4a('0x45')]('i.*');_0x98e0c4['field'](_0xac4a('0x98'),_0xac4a('0x99'));_0x98e0c4[_0xac4a('0x45')](_0xac4a('0x9a'),_0xac4a('0x9b'));_0x98e0c4[_0xac4a('0x45')](_0xac4a('0x9c'),_0xac4a('0x9d'));_0x98e0c4['field']('c.phone',_0xac4a('0x9e'));_0x98e0c4[_0xac4a('0x45')](_0xac4a('0x9f'),_0xac4a('0xa0'));_0x98e0c4[_0xac4a('0x45')](_0xac4a('0xa1'),_0xac4a('0xa2'));_0x98e0c4[_0xac4a('0x45')]('o.fullname','Owner.fullname');_0x98e0c4[_0xac4a('0x45')](_0xac4a('0xa3'),_0xac4a('0xa4'));_0x98e0c4[_0xac4a('0x45')](_0xac4a('0xa5'),_0xac4a('0x2f'));}if(_0x5a4e2b[_0xac4a('0x40')])_0x98e0c4['limit'](_0x5a4e2b[_0xac4a('0x40')]);if(_0x5a4e2b[_0xac4a('0x21')])_0x98e0c4[_0xac4a('0x21')](_0x5a4e2b['offset']);return db[_0xac4a('0x90')][_0xac4a('0x39')](_0x98e0c4[_0xac4a('0x91')](),_0x3980ae);})[_0xac4a('0x27')](function(_0x1a7448){_0x8700b4[_0xac4a('0x42')](_0xac4a('0xa6'),_[_0xac4a('0x2d')](_0x1a7448,'id'));return db[_0xac4a('0x90')]['query'](_0x8700b4[_0xac4a('0x91')](),_0x3980ae)['then'](function(_0x203321){var _0x1199f6=_[_0xac4a('0xa7')](_0x203321,_0xac4a('0xa8'));var _0x840fec=[];_0x1a7448[_0xac4a('0x6a')](function(_0x19766a){_0x840fec['push'](updateWhatsappInteraction(_0x19766a,_0x3441f2,_0x1199f6));});return BPromise[_0xac4a('0xa9')](_0x840fec);});});})[_0xac4a('0x27')](function(_0x279f9b){_0x1af1c1[_0xac4a('0xaa')]=_0x279f9b;return _0x1af1c1;})[_0xac4a('0x27')](respondWithFilteredResult(_0x1c41fb,_0x5a4e2b));})['catch'](handleError(_0x1c41fb,null));};exports[_0xac4a('0xab')]=function(_0x360d4f,_0x4f2b19){var _0x55af32={'raw':![],'where':{'id':_0x360d4f[_0xac4a('0xac')]['id']}},_0x386d6d={};_0x386d6d['model']=_[_0xac4a('0x3a')](db[_0xac4a('0x34')][_0xac4a('0x35')]);_0x386d6d[_0xac4a('0x39')]=_[_0xac4a('0x3a')](_0x360d4f[_0xac4a('0x39')]);_0x386d6d['filters']=_[_0xac4a('0x3c')](_0x386d6d[_0xac4a('0x38')],_0x386d6d[_0xac4a('0x39')]);_0x55af32['attributes']=_[_0xac4a('0x3c')](_0x386d6d[_0xac4a('0x38')],qs[_0xac4a('0x93')](_0x360d4f[_0xac4a('0x39')][_0xac4a('0x93')]));_0x55af32[_0xac4a('0x3d')]=_0x55af32['attributes'][_0xac4a('0x63')]?_0x55af32[_0xac4a('0x3d')]:_0x386d6d['model'];if(_0x360d4f[_0xac4a('0x39')]['includeAll']){_0x55af32[_0xac4a('0xad')]=[{'all':!![]}];}_0x55af32=_[_0xac4a('0xae')]({},_0x55af32,_0x360d4f['options']);return db[_0xac4a('0x34')]['find'](_0x55af32)[_0xac4a('0x27')](handleEntityNotFound(_0x4f2b19,null))['then'](respondWithResult(_0x4f2b19,null))[_0xac4a('0x33')](handleError(_0x4f2b19,null));};exports[_0xac4a('0xaf')]=function(_0x24f464,_0xfe8977){return db[_0xac4a('0x34')][_0xac4a('0xaf')](_0x24f464[_0xac4a('0x71')],{})[_0xac4a('0x27')](respondWithResult(_0xfe8977,0xc9))[_0xac4a('0x33')](handleError(_0xfe8977,null));};exports[_0xac4a('0x26')]=function(_0x3a0163,_0x455eb7){if(_0x3a0163[_0xac4a('0x71')]['id']){delete _0x3a0163[_0xac4a('0x71')]['id'];}return db['WhatsappInteraction'][_0xac4a('0x5c')]({'where':{'id':_0x3a0163[_0xac4a('0xac')]['id']}})['then'](handleEntityNotFound(_0x455eb7,null))[_0xac4a('0x27')](saveUpdates(_0x3a0163[_0xac4a('0x71')],null))[_0xac4a('0x27')](respondWithResult(_0x455eb7,null))[_0xac4a('0x33')](handleError(_0x455eb7,null));};exports[_0xac4a('0x28')]=function(_0x5d5bb3,_0x101137){return db['WhatsappInteraction'][_0xac4a('0x5c')]({'where':{'id':_0x5d5bb3[_0xac4a('0xac')]['id']}})[_0xac4a('0x27')](handleEntityNotFound(_0x101137,null))[_0xac4a('0x27')](removeEntity(_0x101137,null))['catch'](handleError(_0x101137,null));};exports[_0xac4a('0xb0')]=function(_0x55866d,_0x277fd1){return db[_0xac4a('0x34')][_0xac4a('0xb0')]()['then'](respondWithResult(_0x277fd1,null))[_0xac4a('0x33')](handleError(_0x277fd1,null));};exports[_0xac4a('0xb1')]=function(_0x127ede,_0x52f3f2,_0x2da95f){return db[_0xac4a('0xb2')][_0xac4a('0x5c')]({'where':{'id':_0x127ede[_0xac4a('0xac')]['id']}})[_0xac4a('0x27')](handleEntityNotFound(_0x52f3f2,null))[_0xac4a('0x27')](function(_0x3b4183){if(_0x3b4183){return _0x3b4183[_0xac4a('0xb1')](_0x127ede['body'][_0xac4a('0xb3')],_['omit'](_0x127ede['body'],['ids','id'])||{});}})['then'](respondWithResult(_0x52f3f2,null))['catch'](handleError(_0x52f3f2,null));};exports[_0xac4a('0xb4')]=function(_0x58fcb0,_0xc014a6,_0x377444){var _0x2132b2={'raw':![],'where':{}};var _0x525d50={};var _0x9ea4d1={'count':0x0,'rows':[]};return db[_0xac4a('0x34')][_0xac4a('0xb5')]({'where':{'id':_0x58fcb0[_0xac4a('0xac')]['id']}})[_0xac4a('0x27')](handleEntityNotFound(_0xc014a6,null))[_0xac4a('0x27')](function(_0x7a1b25){if(_0x7a1b25){_0x525d50[_0xac4a('0x38')]=_['keys'](db[_0xac4a('0xb2')][_0xac4a('0x35')]);_0x525d50[_0xac4a('0x39')]=_[_0xac4a('0x3a')](_0x58fcb0[_0xac4a('0x39')]);_0x525d50[_0xac4a('0x3b')]=_[_0xac4a('0x3c')](_0x525d50['model'],_0x525d50['query']);_0x2132b2[_0xac4a('0x3d')]=_[_0xac4a('0x3c')](_0x525d50['model'],qs[_0xac4a('0x93')](_0x58fcb0[_0xac4a('0x39')]['fields']));_0x2132b2['attributes']=_0x2132b2[_0xac4a('0x3d')][_0xac4a('0x63')]?_0x2132b2[_0xac4a('0x3d')]:_0x525d50[_0xac4a('0x38')];if(!_0x58fcb0[_0xac4a('0x39')]['hasOwnProperty'](_0xac4a('0x3f'))){_0x2132b2['limit']=qs['limit'](_0x58fcb0['query'][_0xac4a('0x40')]);_0x2132b2[_0xac4a('0x21')]=qs[_0xac4a('0x21')](_0x58fcb0[_0xac4a('0x39')][_0xac4a('0x21')]);}_0x2132b2[_0xac4a('0x8b')]=qs[_0xac4a('0x41')](_0x58fcb0[_0xac4a('0x39')]['sort']);_0x2132b2['where']=qs['filters'](_[_0xac4a('0x43')](_0x58fcb0[_0xac4a('0x39')],_0x525d50[_0xac4a('0x3b')]));_0x2132b2[_0xac4a('0x42')][_0xac4a('0xa8')]=_0x7a1b25['id'];if(_0x58fcb0[_0xac4a('0x39')][_0xac4a('0x83')]){_0x2132b2[_0xac4a('0x42')]=_[_0xac4a('0xae')](_0x2132b2[_0xac4a('0x42')],{'$or':_[_0xac4a('0x2d')](_0x2132b2[_0xac4a('0x3d')],function(_0xe0fd57){var _0x32b013={};_0x32b013[_0xe0fd57]={'$like':'%'+_0x58fcb0[_0xac4a('0x39')][_0xac4a('0x83')]+'%'};return _0x32b013;})});}if(_0x58fcb0[_0xac4a('0x39')][_0xac4a('0x79')]){var _0x41cdb5=_0x58fcb0[_0xac4a('0x39')][_0xac4a('0x79')][_0xac4a('0x31')](',');var _0x3e2575={};_0x3e2575[_0x41cdb5[0x0]]={'$gte':moment(_0x41cdb5[0x1])['format'](_0xac4a('0xb6'))};_0x2132b2[_0xac4a('0x42')]=_[_0xac4a('0xae')](_0x2132b2[_0xac4a('0x42')],_0x3e2575);}_0x2132b2=_[_0xac4a('0xae')]({},_0x2132b2,_0x58fcb0[_0xac4a('0xb7')]);return db[_0xac4a('0xb2')][_0xac4a('0x20')]({'where':_0x2132b2['where']})['then'](function(_0x113f80){_0x9ea4d1[_0xac4a('0x20')]=_0x113f80;if(_0x58fcb0[_0xac4a('0x39')]['includeAll']){_0x2132b2['include']=[{'all':!![]}];}return db['WhatsappMessage'][_0xac4a('0xb8')](_0x2132b2);})['then'](function(_0x59e82c){_0x9ea4d1[_0xac4a('0xaa')]=_0x59e82c;return _0x9ea4d1;});}})['then'](respondWithFilteredResult(_0xc014a6,_0x2132b2))[_0xac4a('0x33')](handleError(_0xc014a6,null));};exports['addTags']=function(_0x3f95a4,_0x2b4f28,_0x413f5f){return db[_0xac4a('0x34')][_0xac4a('0x5c')]({'where':{'id':_0x3f95a4[_0xac4a('0xac')]['id']}})['then'](handleEntityNotFound(_0x2b4f28,null))[_0xac4a('0x27')](function(_0x34b6d7){if(_0x34b6d7){return _0x34b6d7[_0xac4a('0xb9')](_0x3f95a4['body'][_0xac4a('0xb3')],_[_0xac4a('0xba')](_0x3f95a4[_0xac4a('0x71')],[_0xac4a('0xb3'),'id'])||{})['spread'](function(){return db[_0xac4a('0x69')][_0xac4a('0xb8')]({'attributes':['id',_0xac4a('0x2b'),_0xac4a('0x46')],'where':{'id':_0x3f95a4[_0xac4a('0x71')][_0xac4a('0xb3')]}});})['then'](function(_0x57d3cd){socket[_0xac4a('0xbb')](_0xac4a('0xbc'),{'id':Number(_0x3f95a4[_0xac4a('0xac')]['id']),'tags':_0x57d3cd||[]});return{'id':Number(_0x3f95a4[_0xac4a('0xac')]['id']),'tags':_0x57d3cd||[]};});}})[_0xac4a('0x27')](respondWithResult(_0x2b4f28,null))[_0xac4a('0x33')](handleError(_0x2b4f28,null));};exports['removeTags']=function(_0x21a6f6,_0x580c9b,_0xe4165d){return db['WhatsappInteraction'][_0xac4a('0x5c')]({'where':{'id':_0x21a6f6[_0xac4a('0xac')]['id']}})[_0xac4a('0x27')](handleEntityNotFound(_0x580c9b,null))[_0xac4a('0x27')](function(_0x5650ce){if(_0x5650ce){return _0x5650ce[_0xac4a('0xbd')](_0x21a6f6[_0xac4a('0x39')][_0xac4a('0xb3')]);}})[_0xac4a('0x27')](respondWithStatusCode(_0x580c9b,null))[_0xac4a('0x33')](handleError(_0x580c9b,null));};exports['download']=function(_0x3dd60a,_0xbe1958){var _0x462964=moment()[_0xac4a('0xbe')]()[_0xac4a('0x91')]();var _0x5e5eb1=path[_0xac4a('0xbf')](config[_0xac4a('0xc0')],_0xac4a('0xc1'),_0xac4a('0xc2'),_0xac4a('0xc3'));var _0x55ccc3=path['join'](config['root'],'server',_0xac4a('0xc2'),_0xac4a('0xc4'));var _0x17f815=path[_0xac4a('0xbf')](_0x5e5eb1,_0x462964);var _0xa8b5bb=util['format'](_0xac4a('0xc5'),_0x3dd60a[_0xac4a('0xac')]['id'],_0x462964);var _0x5aad90=path[_0xac4a('0xbf')](_0x5e5eb1,_0xa8b5bb);var _0x14b425=[];_0x14b425[_0xac4a('0x32')]({'model':db['User'],'as':_0xac4a('0x6d'),'attributes':['id',_0xac4a('0x2e')],'raw':!![]});_0x14b425[_0xac4a('0x32')]({'model':db[_0xac4a('0xc6')],'as':_0xac4a('0x61'),'attributes':['id',_0xac4a('0xc7'),_0xac4a('0xc8')],'raw':!![]});if(_0x3dd60a[_0xac4a('0x39')][_0xac4a('0xc4')]){_0x14b425['push']({'model':db[_0xac4a('0xc9')],'as':_0xac4a('0xc9'),'raw':!![]});}var _0x579181=[{'model':db[_0xac4a('0xb2')],'as':'Messages','attributes':['id',_0xac4a('0x71'),_0xac4a('0xca'),'direction',_0xac4a('0xcb'),_0xac4a('0x7e')],'include':_0x14b425}];_0x579181[_0xac4a('0x32')]({'model':db[_0xac4a('0xcc')],'as':_0xac4a('0xcd'),'attributes':['id',_0xac4a('0x2b')]});_0x579181[_0xac4a('0x32')]({'model':db[_0xac4a('0x6d')],'as':'Owner','attributes':['id','fullname']});return db[_0xac4a('0x34')]['find']({'where':{'id':_0x3dd60a['params']['id']},'include':_0x579181})[_0xac4a('0x27')](handleEntityNotFound(_0xbe1958,null))[_0xac4a('0x27')](function(_0x3254c3){if(_0x3254c3){var _0x516225=_0x3254c3[_0xac4a('0xce')]({'plain':!![]});fs[_0xac4a('0xcf')](_0x17f815);var _0x5a2abf={'format':'A4','border':'10px','header':{'height':_0xac4a('0xd0'),'contents':{'first':_0xac4a('0xd1')}},'footer':{'height':_0xac4a('0xd2'),'contents':{'default':util[_0xac4a('0xd3')](' \x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20%s \x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{{page}}/{{pages}} \x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20%s \x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
',util[_0xac4a('0xd3')](_0xac4a('0xd4'),_0xac4a('0xd5'),_0x516225['id']),moment()['format'](_0xac4a('0xd6'))[_0xac4a('0x91')]())}}};var _0x15b97a={'channel':_0xac4a('0xd5'),'account':_0x516225[_0xac4a('0xcd')]['name'],'agent':_0x516225['Owner']?_0x516225[_0xac4a('0xd7')][_0xac4a('0x2e')]:_0xac4a('0xd8'),'createdAt':moment(_0x516225[_0xac4a('0xca')])[_0xac4a('0xd3')](_0xac4a('0xb6'))[_0xac4a('0x91')](),'closedAt':_0x516225[_0xac4a('0xd9')]?moment(_0x516225[_0xac4a('0xda')])[_0xac4a('0xd3')](_0xac4a('0xb6'))[_0xac4a('0x91')]():'','disposition':_0x516225[_0xac4a('0xdb')],'messages':_(_0x516225['Messages'])[_0xac4a('0x83')]({'secret':![]})['map'](function(_0x4ec2c3){if(_0x4ec2c3[_0xac4a('0xc9')]){var _0x27833a=path[_0xac4a('0xbf')](_0x55ccc3,_0x4ec2c3[_0xac4a('0xc9')][_0xac4a('0xdc')]);if(fs[_0xac4a('0xdd')](_0x27833a)){fs[_0xac4a('0xde')](_0x27833a)[_0xac4a('0xdf')](fs[_0xac4a('0xe0')](path['join'](_0x17f815,_0x4ec2c3[_0xac4a('0xc9')][_0xac4a('0xdc')])));}}return{'date':moment(_0x4ec2c3[_0xac4a('0xca')])[_0xac4a('0xd3')]('YYYY-MM-DD\x20HH:mm:ss')['toString'](),'sender':_0x4ec2c3[_0xac4a('0xe1')]===_0xac4a('0xe2')?_0x4ec2c3[_0xac4a('0x6d')]?_0x4ec2c3[_0xac4a('0x6d')][_0xac4a('0x2e')]:_0xac4a('0xe3'):_0x4ec2c3[_0xac4a('0x61')][_0xac4a('0xc7')]+(_0x4ec2c3[_0xac4a('0x61')]['lastName']?'\x20'+_0x4ec2c3[_0xac4a('0x61')][_0xac4a('0xc8')]:''),'body':_0x4ec2c3[_0xac4a('0xc9')]?_0x4ec2c3[_0xac4a('0xc9')][_0xac4a('0xdc')]:_0x4ec2c3[_0xac4a('0x71')],'direction':_0x4ec2c3['direction']==='out'?'A':'C','secret':_0x4ec2c3['secret'],'read':_0x4ec2c3[_0xac4a('0x7e')],'attachment':_0x4ec2c3[_0xac4a('0xc9')]};})['value']()};return ejs['renderFile'](path[_0xac4a('0xbf')](config['root'],_0xac4a('0xc1'),'views',_0xac4a('0xe4')),{'interaction':_0x15b97a})[_0xac4a('0x27')](function(_0x1888c3){return new BPromise(function(_0x4a04c3,_0x14435d){pdf[_0xac4a('0xaf')](_0x1888c3,_0x5a2abf)['toFile'](path[_0xac4a('0xbf')](_0x17f815,_0xac4a('0xe5')+_0x516225['id']+'-'+_0x462964+'.pdf'),function(_0x48a75c,_0x4514a5){if(_0x48a75c)return _0x14435d(_0x48a75c);_0x4a04c3(_0x4514a5);});});})[_0xac4a('0x27')](function(){return new BPromise(function(_0x43df37,_0x45e45b){zipdir(_0x17f815,{'saveTo':_0x5aad90},function(_0x367254,_0x22cc71){if(_0x367254)return _0x45e45b(_0x367254);return _0x43df37(_0x22cc71);});})[_0xac4a('0x27')](function(){return new BPromise(function(_0x1ea4ef,_0x156b67){rimraf(_0x17f815,function(_0x330070){if(_0x330070)_0x156b67(_0x330070);return _0x1ea4ef();});});})[_0xac4a('0x27')](function(){return _0xbe1958[_0xac4a('0xe6')](_0x5aad90,_0xa8b5bb,function(_0x2d755c){if(_0x2d755c){console[_0xac4a('0xe7')](_0xac4a('0xe8'),_0x2d755c);}else{fs[_0xac4a('0xe9')](_0x5aad90);}});});});}else{return _0xbe1958[_0xac4a('0x1c')](0xc8);}})['catch'](handleError(_0xbe1958,null));};
\ No newline at end of file
+var _0x814b=['index','rawAttributes','type','key','model','query','intersection','attributes','length','nolimit','limit','order','sort','filters','select','field','color','from','tools_tags','u.id','u.fullname','ui.WhatsappInteractionId','users','u.id\x20=\x20ui.UserId','whatsapp_interactions','left_join','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','whatsapp_accounts','me.WhatsappInteractionId\x20=\x20i.id','whatsapp_interaction_has_tags','it.WhatsappInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','parseSearch','conditions','unreadMessages','value','having','`\x20=\x200','`\x20>\x200','operator','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','text','start','Tag','union','$substring','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','find','UserId','body','keys','some','compact','WhatsappAccountId','where','i.WhatsappAccountId\x20IN\x20?','concat','createdAt','parse','$lte','\x20IS\x20NULL','\x20=\x20?','`unreadMessages`\x20>\x200','isArray','tag','filter','replace','\x27\x27\x27\x27','isNumeric','i.id\x20LIKE\x20?','i.phone\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','i.id','Sequelize','QueryTypes','SELECT','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','DESC','isEmpty','t.id\x20IN\x20?','journey','i.WhatsappAccountId\x20IS\x20NOT\x20NULL','user','getWhatsappAccounts','toString','count','sequelize','fields','a.key','Account.key','Account.mandatoryDisposition','i.*','Contact.firstName','c.lastName','Contact.lastName','Contact.phone','Contact.mobile','c.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','ui.WhatsappInteractionId\x20IN\x20?','groupBy','all','rows','show','params','WhatsappInteraction','includeAll','merge','options','create','describe','addMessage','WhatsappMessage','ids','getMessages','findOne','hasOwnProperty','WhatsappInteractionId','$gte','format','YYYY-MM-DD\x20HH:mm:ss','include','findAll','addTags','setTags','spread','emit','whatsappInteractionTags:save','removeTags','download','unix','root','server','files','tmp','join','attachments','transcript-%d-%s.zip','User','fullname','Contact','firstName','lastName','Attachment','Messages','direction','secret','read','WhatsappAccount','Account','Owner','get','mkdirSync','10px','\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
Interaction\x20Transcript \x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','%s\x20#%d','Whatsapp','YYYY-MM-DD','closedAt','disposition','existsSync','basename','out','System','renderFile','downloadInteraction.html','toFile','transcript-','.pdf','log','unlinkSync','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./whatsappInteraction.socket','register','sendStatus','status','end','json','offset','set','Content-Range','reject','save','update','destroy','then','error','stack','name','send','map','TagIds','split','forEach','push','catch'];(function(_0x3a91d7,_0x248251){var _0x1880bd=function(_0x583767){while(--_0x583767){_0x3a91d7['push'](_0x3a91d7['shift']());}};_0x1880bd(++_0x248251);}(_0x814b,0x1a2));var _0xb814=function(_0x38e177,_0x59ec9f){_0x38e177=_0x38e177-0x0;var _0x1faf15=_0x814b[_0x38e177];return _0x1faf15;};'use strict';var pdf=require(_0xb814('0x0'));var emlformat=require(_0xb814('0x1'));var rimraf=require(_0xb814('0x2'));var zipdir=require(_0xb814('0x3'));var jsonpatch=require(_0xb814('0x4'));var rp=require(_0xb814('0x5'));var moment=require('moment');var BPromise=require(_0xb814('0x6'));var Mustache=require(_0xb814('0x7'));var util=require(_0xb814('0x8'));var path=require(_0xb814('0x9'));var sox=require(_0xb814('0xa'));var csv=require(_0xb814('0xb'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xb814('0xc'));var squel=require(_0xb814('0xd'));var crypto=require('crypto');var jsforce=require(_0xb814('0xe'));var deskjs=require(_0xb814('0xf'));var toCsv=require(_0xb814('0xb'));var querystring=require(_0xb814('0x10'));var Papa=require(_0xb814('0x11'));var Redis=require(_0xb814('0x12'));var authService=require(_0xb814('0x13'));var qs=require(_0xb814('0x14'));var as=require(_0xb814('0x15'));var hardwareService=require(_0xb814('0x16'));var logger=require(_0xb814('0x17'))('api');var utils=require(_0xb814('0x18'));var config=require('../../config/environment');var db=require(_0xb814('0x19'))['db'];config[_0xb814('0x1a')]=_[_0xb814('0x1b')](config[_0xb814('0x1a')],{'host':_0xb814('0x1c'),'port':0x18eb});var socket=require(_0xb814('0x1d'))(new Redis(config[_0xb814('0x1a')]));require(_0xb814('0x1e'))[_0xb814('0x1f')](socket);function respondWithStatusCode(_0x2ab627,_0x3f4881){_0x3f4881=_0x3f4881||0xcc;return function(_0x44fb96){if(_0x44fb96){return _0x2ab627[_0xb814('0x20')](_0x3f4881);}return _0x2ab627[_0xb814('0x21')](_0x3f4881)[_0xb814('0x22')]();};}function respondWithResult(_0x3a71d6,_0x45e0d0){_0x45e0d0=_0x45e0d0||0xc8;return function(_0x265a83){if(_0x265a83){return _0x3a71d6[_0xb814('0x21')](_0x45e0d0)[_0xb814('0x23')](_0x265a83);}};}function respondWithFilteredResult(_0x7a21ef,_0x48c9df){return function(_0x168a48){if(_0x168a48){var _0x55ba16=_0x168a48['count'],_0x270598=_0x48c9df['offset'],_0xfac75b=_0x48c9df[_0xb814('0x24')]+_0x48c9df['limit'],_0x4c3007;if(_0xfac75b>=_0x55ba16){_0xfac75b=_0x55ba16;_0x4c3007=0xc8;}else{_0x4c3007=0xce;}_0x7a21ef['status'](_0x4c3007);return _0x7a21ef[_0xb814('0x25')](_0xb814('0x26'),_0x270598+'-'+_0xfac75b+'/'+_0x55ba16)[_0xb814('0x23')](_0x168a48);}return null;};}function patchUpdates(_0x4e139e){return function(_0xf5b8aa){try{jsonpatch['apply'](_0xf5b8aa,_0x4e139e,!![]);}catch(_0x1e6393){return BPromise[_0xb814('0x27')](_0x1e6393);}return _0xf5b8aa[_0xb814('0x28')]();};}function saveUpdates(_0x470e81,_0x27352e){return function(_0x2bd039){if(_0x2bd039){return _0x2bd039[_0xb814('0x29')](_0x470e81)['then'](function(_0x2ead86){return _0x2ead86;});}return null;};}function removeEntity(_0x52b7a3,_0x3f81d0){return function(_0x457dac){if(_0x457dac){return _0x457dac[_0xb814('0x2a')]()[_0xb814('0x2b')](function(){_0x52b7a3[_0xb814('0x21')](0xcc)[_0xb814('0x22')]();});}};}function handleEntityNotFound(_0x3d836c,_0x5755ea){return function(_0x392222){if(!_0x392222){_0x3d836c[_0xb814('0x20')](0x194);}return _0x392222;};}function handleError(_0x1c2625,_0x349394){_0x349394=_0x349394||0x1f4;return function(_0x32ed56){logger[_0xb814('0x2c')](_0x32ed56[_0xb814('0x2d')]);if(_0x32ed56[_0xb814('0x2e')]){delete _0x32ed56['name'];}_0x1c2625[_0xb814('0x21')](_0x349394)[_0xb814('0x2f')](_0x32ed56);};}function getInteractionUsers(_0x52ed64,_0x9008b2){return new BPromise(function(_0x37d24d,_0x530744){try{if(_0x9008b2[_0x52ed64['id']]){_0x52ed64['Users']=_[_0xb814('0x30')](_0x9008b2[_0x52ed64['id']],function(_0x2051d0){return{'id':_0x2051d0['id'],'fullname':_0x2051d0['fullname']};});}}catch(_0x338a28){_0x530744(_0x338a28);}_0x37d24d(_0x52ed64);});}function getInteractionTags(_0x526610,_0x6efe9a){return new BPromise(function(_0x5f3e9b,_0x4cfc58){try{if(_0x526610[_0xb814('0x31')]){_0x526610['Tags']=[];_0x526610[_0xb814('0x31')][_0xb814('0x32')](',')[_0xb814('0x33')](function(_0x599f9f){_0x526610['Tags'][_0xb814('0x34')](_0x6efe9a[_0x599f9f]);});}delete _0x526610[_0xb814('0x31')];}catch(_0x523566){_0x4cfc58(_0x523566);}_0x5f3e9b(_0x526610);});}function updateWhatsappInteraction(_0x2c8943,_0xe558d5,_0x692c72){return new BPromise(function(_0x217b7e,_0x1b78de){return getInteractionUsers(_0x2c8943,_0x692c72)[_0xb814('0x2b')](function(_0x3672f3){return getInteractionTags(_0x3672f3,_0xe558d5);})['then'](function(_0x3207ec){_0x217b7e(_0x3207ec);})[_0xb814('0x35')](function(_0x30de5a){_0x1b78de(_0x30de5a);});});}exports[_0xb814('0x36')]=function(_0x14100d,_0x4ff31a){var _0x16ef82={},_0x57e6e6={},_0x43db67={'count':0x0,'rows':[]};var _0x16e21c=_[_0xb814('0x30')](db['WhatsappInteraction'][_0xb814('0x37')],function(_0xbdb3e9){return{'name':_0xbdb3e9['fieldName'],'type':_0xbdb3e9[_0xb814('0x38')][_0xb814('0x39')]};});_0x57e6e6[_0xb814('0x3a')]=_[_0xb814('0x30')](_0x16e21c,_0xb814('0x2e'));_0x57e6e6[_0xb814('0x3b')]=_['keys'](_0x14100d[_0xb814('0x3b')]);_0x57e6e6['filters']=_[_0xb814('0x3c')](_0x57e6e6['model'],_0x57e6e6[_0xb814('0x3b')]);_0x16ef82['attributes']=_[_0xb814('0x3c')](_0x57e6e6[_0xb814('0x3a')],qs['fields'](_0x14100d['query']['fields']));_0x16ef82['attributes']=_0x16ef82[_0xb814('0x3d')][_0xb814('0x3e')]?_0x16ef82[_0xb814('0x3d')]:_0x57e6e6[_0xb814('0x3a')];if(!_0x14100d['query']['hasOwnProperty'](_0xb814('0x3f'))){_0x16ef82['limit']=qs[_0xb814('0x40')](_0x14100d[_0xb814('0x3b')][_0xb814('0x40')]);_0x16ef82[_0xb814('0x24')]=qs[_0xb814('0x24')](_0x14100d[_0xb814('0x3b')][_0xb814('0x24')]);}_0x16ef82[_0xb814('0x41')]=qs[_0xb814('0x42')](_0x14100d['query']['sort']);_0x16ef82['where']=qs[_0xb814('0x43')](_['pick'](_0x14100d[_0xb814('0x3b')],_0x57e6e6['filters']),_0x16e21c);var _0x411723=[];var _0x44ff56=squel[_0xb814('0x44')]()[_0xb814('0x45')]('id')['field'](_0xb814('0x2e'))[_0xb814('0x45')](_0xb814('0x46'))[_0xb814('0x47')](_0xb814('0x48'));var _0x450a08=squel['select']()[_0xb814('0x45')](_0xb814('0x49'))[_0xb814('0x45')](_0xb814('0x4a'))[_0xb814('0x45')](_0xb814('0x4b'))[_0xb814('0x47')]('user_has_whatsapp_interactions','ui')['left_join'](_0xb814('0x4c'),'u',_0xb814('0x4d'));var _0x4c08d6=squel[_0xb814('0x44')]()[_0xb814('0x47')](_0xb814('0x4e'),'i')[_0xb814('0x4f')](_0xb814('0x50'),'c',_0xb814('0x51'))[_0xb814('0x4f')](_0xb814('0x4c'),'o','o.id\x20=\x20i.UserId')[_0xb814('0x4f')](_0xb814('0x52'),'a','a.id\x20=\x20i.WhatsappAccountId')[_0xb814('0x4f')]('whatsapp_messages','me',_0xb814('0x53'))[_0xb814('0x4f')](_0xb814('0x54'),'it',_0xb814('0x55'))[_0xb814('0x4f')](_0xb814('0x48'),'t',_0xb814('0x56'));var _0x45480e=squel[_0xb814('0x57')]();var _0x2a422a=[];var _0x5e6df7=squel['expr']();var _0x32eca6;if(_0x14100d[_0xb814('0x3b')][_0xb814('0x58')]){_0x32eca6=as[_0xb814('0x59')](_0x14100d[_0xb814('0x3b')][_0xb814('0x58')]);var _0x135208=_0x32eca6['sqlOperator'];for(var _0x26fd0b=0x0;_0x26fd0b<_0x32eca6[_0xb814('0x5a')][_0xb814('0x3e')];_0x26fd0b++){var _0x5a916d=_0x32eca6[_0xb814('0x5a')][_0x26fd0b];var _0x4e6f3c='i';var _0x252293=_['find'](_0x16e21c,[_0xb814('0x2e'),_0x5a916d[_0xb814('0x45')]]);if(!_0x252293){switch(_0x5a916d['field']){case _0xb814('0x5b'):if(_0x5a916d[_0xb814('0x5c')]==0x1){_0x4c08d6[_0xb814('0x5d')]('`'+_0x5a916d['field']+_0xb814('0x5e'));}else{_0x4c08d6['having']('`'+_0x5a916d[_0xb814('0x45')]+_0xb814('0x5f'));}break;case'Contact':if(_0x5a916d[_0xb814('0x60')]==='$substring'){if(_0x5a916d['value'][_0xb814('0x32')]('\x20')[_0xb814('0x3e')]>0x1){_0x45480e[_0x135208](_0xb814('0x61'),qs['getFullTextValue'](_0x5a916d[_0xb814('0x5c')]),null);}else{var _0x538b0f='%'+_0x5a916d[_0xb814('0x5c')]+'%';_0x45480e[_0x135208](_0xb814('0x62'),_0x538b0f,_0x538b0f,_0x538b0f);}}else{_0x252293=_['find'](_0x16e21c,[_0xb814('0x2e'),'ContactId']);_0x5a916d[_0xb814('0x45')]=_0xb814('0x63');_0x135e13=as[_0xb814('0x64')](_0x4e6f3c,_0x252293[_0xb814('0x38')],_0x5a916d);_0x45480e[_0x135208](_0x135e13[_0xb814('0x65')],_0x135e13[_0xb814('0x5c')][_0xb814('0x66')],_0x135e13[_0xb814('0x5c')]['end']);}break;case _0xb814('0x67'):var _0x5441c5=_0x5a916d['value'][_0xb814('0x32')](',')[_0xb814('0x30')](function(_0x4d13db){return Number(_0x4d13db);});_0x5441c5[_0xb814('0x33')](function(_0x58b9a6){_0x5e6df7['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x58b9a6+',%');});_0x2a422a=_[_0xb814('0x68')](_0x2a422a,_0x5441c5);break;case'User':if(_0x5a916d[_0xb814('0x60')]===_0xb814('0x69')){_0x45480e[_0x135208](_0xb814('0x6a'),'%'+_0x5a916d['value']+'%',null);}else{_0x252293=_[_0xb814('0x6b')](_0x16e21c,['name',_0xb814('0x6c')]);_0x5a916d[_0xb814('0x45')]=_0xb814('0x6c');_0x135e13=as[_0xb814('0x64')](_0x4e6f3c,_0x252293[_0xb814('0x38')],_0x5a916d);_0x45480e[_0x135208](_0x135e13[_0xb814('0x65')],_0x135e13[_0xb814('0x5c')][_0xb814('0x66')],_0x135e13[_0xb814('0x5c')]['end']);}break;case _0xb814('0x6d'):_0x135e13=as[_0xb814('0x64')]('me',null,_0x5a916d);_0x45480e[_0x135208](_0x135e13[_0xb814('0x65')],_0x135e13[_0xb814('0x5c')][_0xb814('0x66')],_0x135e13[_0xb814('0x5c')]['end']);break;}}else{var _0x135e13=as['buildExpression'](_0x4e6f3c,_0x252293[_0xb814('0x38')],_0x5a916d);_0x45480e[_0x135208](_0x135e13[_0xb814('0x65')],_0x135e13[_0xb814('0x5c')]['start'],_0x135e13[_0xb814('0x5c')]['end']);}}}else{var _0x37e9c5=_(_0x14100d['query'])[_0xb814('0x6e')]()[_0xb814('0x30')](function(_0xa03cd2){return _[_0xb814('0x6f')](_0x16e21c,[_0xb814('0x2e'),_0xa03cd2])?_0xa03cd2:undefined;})[_0xb814('0x70')]()[_0xb814('0x5c')]();if(!_['isEmpty'](_0x37e9c5)){_0x37e9c5[_0xb814('0x33')](function(_0x51ca51){if(_0x51ca51===_0xb814('0x71')){_0x4c08d6[_0xb814('0x72')](_0xb814('0x73'),[][_0xb814('0x74')](_0x14100d[_0xb814('0x3b')][_0x51ca51]));}else if(_0x51ca51===_0xb814('0x75')){var _0x514dab=JSON[_0xb814('0x76')](_0x14100d[_0xb814('0x3b')][_0x51ca51])['$gte'];var _0x3bb2b4=JSON[_0xb814('0x76')](_0x14100d[_0xb814('0x3b')][_0x51ca51])[_0xb814('0x77')];_0x4c08d6[_0xb814('0x72')]('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x514dab,_0x3bb2b4);}else{if(_0x14100d[_0xb814('0x3b')][_0x51ca51]==='null'){_0x4c08d6[_0xb814('0x72')]('i.'+_0x51ca51+_0xb814('0x78'));}else{_0x4c08d6[_0xb814('0x72')]('i.'+_0x51ca51+_0xb814('0x79'),_0x14100d[_0xb814('0x3b')][_0x51ca51]);}}});}if(_0x14100d[_0xb814('0x3b')]['read']){if(_0x14100d['query']['read']==0x1){_0x4c08d6[_0xb814('0x5d')]('`unreadMessages`\x20=\x200');}else{_0x4c08d6[_0xb814('0x5d')](_0xb814('0x7a'));}}if(_0x14100d[_0xb814('0x3b')]['tag']){_0x2a422a=_[_0xb814('0x7b')](_0x14100d[_0xb814('0x3b')][_0xb814('0x7c')])?_0x14100d['query'][_0xb814('0x7c')]:new Array(_0x14100d[_0xb814('0x3b')][_0xb814('0x7c')]);_0x2a422a[_0xb814('0x33')](function(_0x555be0){_0x5e6df7['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x555be0+',%');});}if(_0x14100d[_0xb814('0x3b')][_0xb814('0x7d')]){var _0x39863d=_0x14100d[_0xb814('0x3b')][_0xb814('0x7d')][_0xb814('0x7e')]('\x5c','\x5c\x5c')[_0xb814('0x7e')]('\x27\x27',_0xb814('0x7f'));if(qs[_0xb814('0x80')](_0x39863d)){_0x45480e['or'](_0xb814('0x81'),_0x39863d+'%')['or'](_0xb814('0x82'),_0x39863d+'%');}else{_0x45480e['or'](_0xb814('0x83'),qs[_0xb814('0x84')](_0x39863d))['or'](_0xb814('0x85'),_0x39863d+'%');}}}_0x4c08d6[_0xb814('0x72')](_0x45480e);_0x4c08d6['group'](_0xb814('0x86'));var _0x33cfc4={'type':db[_0xb814('0x87')][_0xb814('0x88')][_0xb814('0x89')],'raw':!![]};var _0x283b0f=_0x4c08d6['clone']();_0x283b0f[_0xb814('0x45')]('i.id');_0x283b0f[_0xb814('0x45')](_0xb814('0x8a'),_0xb814('0x5b'));if(_0x16ef82[_0xb814('0x41')]){_0x16ef82[_0xb814('0x41')]['forEach'](function(_0x4c44ee){_0x4c08d6[_0xb814('0x41')]('i.'+_0x4c44ee[0x0],_0x4c44ee[0x1]===_0xb814('0x8b')?![]:!![]);});}if(!_[_0xb814('0x8c')](_0x2a422a)){_0x4c08d6[_0xb814('0x5d')](_0x5e6df7);_0x283b0f['where'](_0xb814('0x8d'),_0x2a422a);}BPromise['resolve']()[_0xb814('0x2b')](function(){if(!_0x32eca6){if(_0x14100d[_0xb814('0x3b')]['WhatsappAccountId']||_0x14100d['query'][_0xb814('0x8e')])return;_0x283b0f['where'](_0xb814('0x8f'));_0x4c08d6[_0xb814('0x72')](_0xb814('0x8f'));return;}return _0x14100d[_0xb814('0x90')][_0xb814('0x91')]({'attributes':['id'],'raw':!![]})[_0xb814('0x2b')](function(_0x40fe4a){if(_['isEmpty'](_0x40fe4a)){_0x283b0f[_0xb814('0x72')]('i.WhatsappAccountId\x20IS\x20NULL');_0x4c08d6[_0xb814('0x72')]('i.WhatsappAccountId\x20IS\x20NULL');}else{_0x283b0f[_0xb814('0x72')](_0xb814('0x73'),_['map'](_0x40fe4a,'id'));_0x4c08d6[_0xb814('0x72')]('i.WhatsappAccountId\x20IN\x20?',_[_0xb814('0x30')](_0x40fe4a,'id'));}});})[_0xb814('0x2b')](function(){db['sequelize']['query'](_0x283b0f[_0xb814('0x92')](),_0x33cfc4)[_0xb814('0x2b')](function(_0x3309c5){_0x43db67[_0xb814('0x93')]=_0x3309c5[_0xb814('0x3e')];if(_0x43db67[_0xb814('0x93')]===0x0)return[];return db[_0xb814('0x94')][_0xb814('0x3b')](_0x44ff56[_0xb814('0x92')](),_0x33cfc4)[_0xb814('0x2b')](function(_0x53e705){_0x411723=_['keyBy'](_0x53e705,'id');_0x33cfc4=_['merge'](_0x33cfc4,{'model':db['WhatsappInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x14100d['query'][_0xb814('0x95')]){_0x16ef82[_0xb814('0x3d')][_0xb814('0x33')](function(_0x59f3ff){_0x4c08d6[_0xb814('0x45')]('i.'+_0x59f3ff);});}else{_0x4c08d6[_0xb814('0x45')](_0xb814('0x8a'),_0xb814('0x5b'));_0x4c08d6[_0xb814('0x45')](_0xb814('0x96'),_0xb814('0x97'));_0x4c08d6[_0xb814('0x45')]('a.mandatoryDisposition',_0xb814('0x98'));_0x4c08d6[_0xb814('0x45')](_0xb814('0x99'));_0x4c08d6[_0xb814('0x45')]('c.firstName',_0xb814('0x9a'));_0x4c08d6[_0xb814('0x45')](_0xb814('0x9b'),_0xb814('0x9c'));_0x4c08d6[_0xb814('0x45')]('c.email','Contact.email');_0x4c08d6[_0xb814('0x45')]('c.phone',_0xb814('0x9d'));_0x4c08d6[_0xb814('0x45')]('c.mobile',_0xb814('0x9e'));_0x4c08d6['field'](_0xb814('0x9f'),'Contact.fax');_0x4c08d6[_0xb814('0x45')](_0xb814('0xa0'),_0xb814('0xa1'));_0x4c08d6[_0xb814('0x45')](_0xb814('0xa2'),_0xb814('0xa3'));_0x4c08d6[_0xb814('0x45')]('GROUP_CONCAT(DISTINCT\x20t.id)','TagIds');}if(_0x16ef82[_0xb814('0x40')])_0x4c08d6['limit'](_0x16ef82['limit']);if(_0x16ef82[_0xb814('0x24')])_0x4c08d6[_0xb814('0x24')](_0x16ef82[_0xb814('0x24')]);return db['sequelize'][_0xb814('0x3b')](_0x4c08d6['toString'](),_0x33cfc4);})[_0xb814('0x2b')](function(_0x19d508){_0x450a08[_0xb814('0x72')](_0xb814('0xa4'),_['map'](_0x19d508,'id'));return db[_0xb814('0x94')][_0xb814('0x3b')](_0x450a08[_0xb814('0x92')](),_0x33cfc4)['then'](function(_0x1ebbf6){var _0x3fc77d=_[_0xb814('0xa5')](_0x1ebbf6,'WhatsappInteractionId');var _0x5d8626=[];_0x19d508[_0xb814('0x33')](function(_0x9dc06b){_0x5d8626[_0xb814('0x34')](updateWhatsappInteraction(_0x9dc06b,_0x411723,_0x3fc77d));});return BPromise[_0xb814('0xa6')](_0x5d8626);});});})[_0xb814('0x2b')](function(_0x37a7ab){_0x43db67[_0xb814('0xa7')]=_0x37a7ab;return _0x43db67;})[_0xb814('0x2b')](respondWithFilteredResult(_0x4ff31a,_0x16ef82));})[_0xb814('0x35')](handleError(_0x4ff31a,null));};exports[_0xb814('0xa8')]=function(_0x2569a5,_0x2a13fb){var _0x5b8d2e={'raw':![],'where':{'id':_0x2569a5[_0xb814('0xa9')]['id']}},_0x5416dc={};_0x5416dc['model']=_[_0xb814('0x6e')](db[_0xb814('0xaa')][_0xb814('0x37')]);_0x5416dc[_0xb814('0x3b')]=_[_0xb814('0x6e')](_0x2569a5[_0xb814('0x3b')]);_0x5416dc[_0xb814('0x43')]=_['intersection'](_0x5416dc['model'],_0x5416dc[_0xb814('0x3b')]);_0x5b8d2e['attributes']=_[_0xb814('0x3c')](_0x5416dc[_0xb814('0x3a')],qs[_0xb814('0x95')](_0x2569a5['query'][_0xb814('0x95')]));_0x5b8d2e[_0xb814('0x3d')]=_0x5b8d2e[_0xb814('0x3d')][_0xb814('0x3e')]?_0x5b8d2e[_0xb814('0x3d')]:_0x5416dc['model'];if(_0x2569a5[_0xb814('0x3b')][_0xb814('0xab')]){_0x5b8d2e['include']=[{'all':!![]}];}_0x5b8d2e=_[_0xb814('0xac')]({},_0x5b8d2e,_0x2569a5[_0xb814('0xad')]);return db[_0xb814('0xaa')]['find'](_0x5b8d2e)[_0xb814('0x2b')](handleEntityNotFound(_0x2a13fb,null))[_0xb814('0x2b')](respondWithResult(_0x2a13fb,null))['catch'](handleError(_0x2a13fb,null));};exports[_0xb814('0xae')]=function(_0x171f83,_0x5b5634){return db[_0xb814('0xaa')][_0xb814('0xae')](_0x171f83[_0xb814('0x6d')],{})[_0xb814('0x2b')](respondWithResult(_0x5b5634,0xc9))[_0xb814('0x35')](handleError(_0x5b5634,null));};exports[_0xb814('0x29')]=function(_0x40ae0b,_0x336a8f){if(_0x40ae0b[_0xb814('0x6d')]['id']){delete _0x40ae0b[_0xb814('0x6d')]['id'];}return db[_0xb814('0xaa')][_0xb814('0x6b')]({'where':{'id':_0x40ae0b['params']['id']}})['then'](handleEntityNotFound(_0x336a8f,null))[_0xb814('0x2b')](saveUpdates(_0x40ae0b['body'],null))['then'](respondWithResult(_0x336a8f,null))[_0xb814('0x35')](handleError(_0x336a8f,null));};exports['destroy']=function(_0x4f0427,_0x50cb34){return db[_0xb814('0xaa')][_0xb814('0x6b')]({'where':{'id':_0x4f0427[_0xb814('0xa9')]['id']}})['then'](handleEntityNotFound(_0x50cb34,null))[_0xb814('0x2b')](removeEntity(_0x50cb34,null))['catch'](handleError(_0x50cb34,null));};exports[_0xb814('0xaf')]=function(_0x2e6660,_0x49a8de){return db[_0xb814('0xaa')]['describe']()[_0xb814('0x2b')](respondWithResult(_0x49a8de,null))[_0xb814('0x35')](handleError(_0x49a8de,null));};exports[_0xb814('0xb0')]=function(_0x39ce17,_0x11efb8,_0xaf705d){return db[_0xb814('0xb1')][_0xb814('0x6b')]({'where':{'id':_0x39ce17[_0xb814('0xa9')]['id']}})[_0xb814('0x2b')](handleEntityNotFound(_0x11efb8,null))[_0xb814('0x2b')](function(_0x3e7a9a){if(_0x3e7a9a){return _0x3e7a9a[_0xb814('0xb0')](_0x39ce17[_0xb814('0x6d')][_0xb814('0xb2')],_['omit'](_0x39ce17[_0xb814('0x6d')],[_0xb814('0xb2'),'id'])||{});}})['then'](respondWithResult(_0x11efb8,null))[_0xb814('0x35')](handleError(_0x11efb8,null));};exports[_0xb814('0xb3')]=function(_0x1868d9,_0x570191,_0x56b2aa){var _0x473b30={'raw':![],'where':{}};var _0x4af71e={};var _0x2d40e6={'count':0x0,'rows':[]};return db['WhatsappInteraction'][_0xb814('0xb4')]({'where':{'id':_0x1868d9['params']['id']}})['then'](handleEntityNotFound(_0x570191,null))[_0xb814('0x2b')](function(_0x32c956){if(_0x32c956){_0x4af71e[_0xb814('0x3a')]=_[_0xb814('0x6e')](db[_0xb814('0xb1')][_0xb814('0x37')]);_0x4af71e[_0xb814('0x3b')]=_[_0xb814('0x6e')](_0x1868d9[_0xb814('0x3b')]);_0x4af71e[_0xb814('0x43')]=_[_0xb814('0x3c')](_0x4af71e['model'],_0x4af71e[_0xb814('0x3b')]);_0x473b30['attributes']=_[_0xb814('0x3c')](_0x4af71e[_0xb814('0x3a')],qs[_0xb814('0x95')](_0x1868d9['query'][_0xb814('0x95')]));_0x473b30[_0xb814('0x3d')]=_0x473b30[_0xb814('0x3d')][_0xb814('0x3e')]?_0x473b30[_0xb814('0x3d')]:_0x4af71e[_0xb814('0x3a')];if(!_0x1868d9[_0xb814('0x3b')][_0xb814('0xb5')](_0xb814('0x3f'))){_0x473b30[_0xb814('0x40')]=qs[_0xb814('0x40')](_0x1868d9[_0xb814('0x3b')][_0xb814('0x40')]);_0x473b30[_0xb814('0x24')]=qs[_0xb814('0x24')](_0x1868d9['query'][_0xb814('0x24')]);}_0x473b30[_0xb814('0x41')]=qs[_0xb814('0x42')](_0x1868d9['query']['sort']);_0x473b30[_0xb814('0x72')]=qs['filters'](_['pick'](_0x1868d9['query'],_0x4af71e['filters']));_0x473b30[_0xb814('0x72')][_0xb814('0xb6')]=_0x32c956['id'];if(_0x1868d9['query'][_0xb814('0x7d')]){_0x473b30[_0xb814('0x72')]=_[_0xb814('0xac')](_0x473b30[_0xb814('0x72')],{'$or':_[_0xb814('0x30')](_0x473b30[_0xb814('0x3d')],function(_0x20e608){var _0x7b9948={};_0x7b9948[_0x20e608]={'$like':'%'+_0x1868d9[_0xb814('0x3b')][_0xb814('0x7d')]+'%'};return _0x7b9948;})});}if(_0x1868d9[_0xb814('0x3b')]['$gte']){var _0x2a5dff=_0x1868d9['query'][_0xb814('0xb7')][_0xb814('0x32')](',');var _0x35e8f7={};_0x35e8f7[_0x2a5dff[0x0]]={'$gte':moment(_0x2a5dff[0x1])[_0xb814('0xb8')](_0xb814('0xb9'))};_0x473b30[_0xb814('0x72')]=_[_0xb814('0xac')](_0x473b30[_0xb814('0x72')],_0x35e8f7);}_0x473b30=_['merge']({},_0x473b30,_0x1868d9['options']);return db['WhatsappMessage'][_0xb814('0x93')]({'where':_0x473b30[_0xb814('0x72')]})[_0xb814('0x2b')](function(_0x3b7bee){_0x2d40e6[_0xb814('0x93')]=_0x3b7bee;if(_0x1868d9[_0xb814('0x3b')][_0xb814('0xab')]){_0x473b30[_0xb814('0xba')]=[{'all':!![]}];}return db[_0xb814('0xb1')][_0xb814('0xbb')](_0x473b30);})['then'](function(_0x5c989a){_0x2d40e6[_0xb814('0xa7')]=_0x5c989a;return _0x2d40e6;});}})[_0xb814('0x2b')](respondWithFilteredResult(_0x570191,_0x473b30))[_0xb814('0x35')](handleError(_0x570191,null));};exports[_0xb814('0xbc')]=function(_0x3f0c9c,_0x2642ab,_0x48358c){return db[_0xb814('0xaa')]['find']({'where':{'id':_0x3f0c9c[_0xb814('0xa9')]['id']}})[_0xb814('0x2b')](handleEntityNotFound(_0x2642ab,null))[_0xb814('0x2b')](function(_0x94aa05){if(_0x94aa05){return _0x94aa05[_0xb814('0xbd')](_0x3f0c9c[_0xb814('0x6d')][_0xb814('0xb2')],_['omit'](_0x3f0c9c[_0xb814('0x6d')],[_0xb814('0xb2'),'id'])||{})[_0xb814('0xbe')](function(){return db[_0xb814('0x67')]['findAll']({'attributes':['id',_0xb814('0x2e'),_0xb814('0x46')],'where':{'id':_0x3f0c9c[_0xb814('0x6d')][_0xb814('0xb2')]}});})[_0xb814('0x2b')](function(_0x4a2aa5){socket[_0xb814('0xbf')](_0xb814('0xc0'),{'id':Number(_0x3f0c9c[_0xb814('0xa9')]['id']),'tags':_0x4a2aa5||[]});return{'id':Number(_0x3f0c9c['params']['id']),'tags':_0x4a2aa5||[]};});}})[_0xb814('0x2b')](respondWithResult(_0x2642ab,null))['catch'](handleError(_0x2642ab,null));};exports[_0xb814('0xc1')]=function(_0x5b4315,_0x22f6f1,_0x3467bd){return db[_0xb814('0xaa')][_0xb814('0x6b')]({'where':{'id':_0x5b4315['params']['id']}})[_0xb814('0x2b')](handleEntityNotFound(_0x22f6f1,null))[_0xb814('0x2b')](function(_0x3fda0d){if(_0x3fda0d){return _0x3fda0d[_0xb814('0xc1')](_0x5b4315[_0xb814('0x3b')][_0xb814('0xb2')]);}})[_0xb814('0x2b')](respondWithStatusCode(_0x22f6f1,null))[_0xb814('0x35')](handleError(_0x22f6f1,null));};exports[_0xb814('0xc2')]=function(_0x152260,_0x3bc03a){var _0x368696=moment()[_0xb814('0xc3')]()[_0xb814('0x92')]();var _0x8e882a=path['join'](config[_0xb814('0xc4')],_0xb814('0xc5'),_0xb814('0xc6'),_0xb814('0xc7'));var _0x4017b6=path[_0xb814('0xc8')](config['root'],_0xb814('0xc5'),_0xb814('0xc6'),_0xb814('0xc9'));var _0x31b4f5=path['join'](_0x8e882a,_0x368696);var _0x5b5a26=util[_0xb814('0xb8')](_0xb814('0xca'),_0x152260[_0xb814('0xa9')]['id'],_0x368696);var _0x667ca1=path[_0xb814('0xc8')](_0x8e882a,_0x5b5a26);var _0x2c510a=[];_0x2c510a['push']({'model':db[_0xb814('0xcb')],'as':_0xb814('0xcb'),'attributes':['id',_0xb814('0xcc')],'raw':!![]});_0x2c510a[_0xb814('0x34')]({'model':db['CmContact'],'as':_0xb814('0xcd'),'attributes':['id',_0xb814('0xce'),_0xb814('0xcf')],'raw':!![]});if(_0x152260[_0xb814('0x3b')][_0xb814('0xc9')]){_0x2c510a['push']({'model':db[_0xb814('0xd0')],'as':_0xb814('0xd0'),'raw':!![]});}var _0x371dd7=[{'model':db[_0xb814('0xb1')],'as':_0xb814('0xd1'),'attributes':['id',_0xb814('0x6d'),_0xb814('0x75'),_0xb814('0xd2'),_0xb814('0xd3'),_0xb814('0xd4')],'include':_0x2c510a}];_0x371dd7[_0xb814('0x34')]({'model':db[_0xb814('0xd5')],'as':_0xb814('0xd6'),'attributes':['id','name']});_0x371dd7['push']({'model':db[_0xb814('0xcb')],'as':_0xb814('0xd7'),'attributes':['id',_0xb814('0xcc')]});return db['WhatsappInteraction'][_0xb814('0x6b')]({'where':{'id':_0x152260[_0xb814('0xa9')]['id']},'include':_0x371dd7})[_0xb814('0x2b')](handleEntityNotFound(_0x3bc03a,null))['then'](function(_0x10537d){if(_0x10537d){var _0xa651a=_0x10537d[_0xb814('0xd8')]({'plain':!![]});fs[_0xb814('0xd9')](_0x31b4f5);var _0x6ec0f5={'format':'A4','border':_0xb814('0xda'),'header':{'height':'40px','contents':{'first':_0xb814('0xdb')}},'footer':{'height':'30px','contents':{'default':util[_0xb814('0xb8')](' \x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20%s \x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{{page}}/{{pages}} \x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20%s \x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
',util[_0xb814('0xb8')](_0xb814('0xdc'),_0xb814('0xdd'),_0xa651a['id']),moment()['format'](_0xb814('0xde'))[_0xb814('0x92')]())}}};var _0x164304={'channel':'Whatsapp','account':_0xa651a[_0xb814('0xd6')]['name'],'agent':_0xa651a[_0xb814('0xd7')]?_0xa651a[_0xb814('0xd7')][_0xb814('0xcc')]:'N.A.','createdAt':moment(_0xa651a[_0xb814('0x75')])[_0xb814('0xb8')](_0xb814('0xb9'))[_0xb814('0x92')](),'closedAt':_0xa651a['closed']?moment(_0xa651a[_0xb814('0xdf')])[_0xb814('0xb8')](_0xb814('0xb9'))[_0xb814('0x92')]():'','disposition':_0xa651a[_0xb814('0xe0')],'messages':_(_0xa651a[_0xb814('0xd1')])[_0xb814('0x7d')]({'secret':![]})[_0xb814('0x30')](function(_0x9a33d0){if(_0x9a33d0['Attachment']){var _0x2fe47b=path[_0xb814('0xc8')](_0x4017b6,_0x9a33d0[_0xb814('0xd0')]['basename']);if(fs[_0xb814('0xe1')](_0x2fe47b)){fs['createReadStream'](_0x2fe47b)['pipe'](fs['createWriteStream'](path[_0xb814('0xc8')](_0x31b4f5,_0x9a33d0['Attachment'][_0xb814('0xe2')])));}}return{'date':moment(_0x9a33d0[_0xb814('0x75')])['format']('YYYY-MM-DD\x20HH:mm:ss')[_0xb814('0x92')](),'sender':_0x9a33d0['direction']===_0xb814('0xe3')?_0x9a33d0['User']?_0x9a33d0[_0xb814('0xcb')][_0xb814('0xcc')]:_0xb814('0xe4'):_0x9a33d0['Contact']['firstName']+(_0x9a33d0['Contact'][_0xb814('0xcf')]?'\x20'+_0x9a33d0['Contact']['lastName']:''),'body':_0x9a33d0[_0xb814('0xd0')]?_0x9a33d0['Attachment']['basename']:_0x9a33d0['body'],'direction':_0x9a33d0[_0xb814('0xd2')]===_0xb814('0xe3')?'A':'C','secret':_0x9a33d0[_0xb814('0xd3')],'read':_0x9a33d0['read'],'attachment':_0x9a33d0[_0xb814('0xd0')]};})[_0xb814('0x5c')]()};return ejs[_0xb814('0xe5')](path[_0xb814('0xc8')](config[_0xb814('0xc4')],_0xb814('0xc5'),'views',_0xb814('0xe6')),{'interaction':_0x164304})[_0xb814('0x2b')](function(_0x28b818){return new BPromise(function(_0x171845,_0x4f2db2){pdf[_0xb814('0xae')](_0x28b818,_0x6ec0f5)[_0xb814('0xe7')](path[_0xb814('0xc8')](_0x31b4f5,_0xb814('0xe8')+_0xa651a['id']+'-'+_0x368696+_0xb814('0xe9')),function(_0x2cb01d,_0x1f4540){if(_0x2cb01d)return _0x4f2db2(_0x2cb01d);_0x171845(_0x1f4540);});});})[_0xb814('0x2b')](function(){return new BPromise(function(_0x81ebc0,_0x2e7959){zipdir(_0x31b4f5,{'saveTo':_0x667ca1},function(_0x47f054,_0x1aa70b){if(_0x47f054)return _0x2e7959(_0x47f054);return _0x81ebc0(_0x1aa70b);});})[_0xb814('0x2b')](function(){return new BPromise(function(_0x5706ad,_0x3b8438){rimraf(_0x31b4f5,function(_0x56e231){if(_0x56e231)_0x3b8438(_0x56e231);return _0x5706ad();});});})[_0xb814('0x2b')](function(){return _0x3bc03a[_0xb814('0xc2')](_0x667ca1,_0x5b5a26,function(_0x5e2273){if(_0x5e2273){console[_0xb814('0xea')]('err',_0x5e2273);}else{fs[_0xb814('0xeb')](_0x667ca1);}});});});}else{return _0x3bc03a[_0xb814('0x20')](0xc8);}})[_0xb814('0x35')](handleError(_0x3bc03a,null));};
\ No newline at end of file
diff --git a/server/api/whatsappInteraction/whatsappInteraction.events.js b/server/api/whatsappInteraction/whatsappInteraction.events.js
index ba64fe9..cf6a2ad 100644
--- a/server/api/whatsappInteraction/whatsappInteraction.events.js
+++ b/server/api/whatsappInteraction/whatsappInteraction.events.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xb045=['WhatsappInteraction','WhatsappMessage','save','update','then','setDataValue','Users','map','findAll','length','emit','catch','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x592fc1,_0x2f0227){var _0x8471e=function(_0x557bd5){while(--_0x557bd5){_0x592fc1['push'](_0x592fc1['shift']());}};_0x8471e(++_0x2f0227);}(_0xb045,0x1c9));var _0x5b04=function(_0x23b57c,_0xdc7f98){_0x23b57c=_0x23b57c-0x0;var _0x4c3b1d=_0xb045[_0x23b57c];return _0x4c3b1d;};'use strict';var EventEmitter=require(_0x5b04('0x0'));var WhatsappInteraction=require(_0x5b04('0x1'))['db'][_0x5b04('0x2')];var WhatsappMessage=require('../../mysqldb')['db'][_0x5b04('0x3')];var WhatsappInteractionEvents=new EventEmitter();WhatsappInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x5b04('0x4'),'afterUpdate':_0x5b04('0x5'),'afterDestroy':'remove'};function emitEvent(_0x46164b){return function(_0x3e8b49,_0x349287,_0x1cf5a5){_0x3e8b49['getUsers']({'attributes':['id'],'raw':!![]})[_0x5b04('0x6')](function(_0x2d29d6){_0x3e8b49[_0x5b04('0x7')](_0x5b04('0x8'),_0x2d29d6[_0x5b04('0x9')](function(_0x44c1ad){return{'id':_0x44c1ad['id']};}));return WhatsappMessage[_0x5b04('0xa')]({'where':{'WhatsappInteractionId':_0x3e8b49['id'],'direction':'in','read':![]},'raw':!![]});})[_0x5b04('0x6')](function(_0x496ed5){_0x3e8b49[_0x5b04('0x7')]('unreadMessages',_0x496ed5[_0x5b04('0xb')]);WhatsappInteractionEvents[_0x5b04('0xc')](_0x46164b+':'+_0x3e8b49['id'],_0x3e8b49);WhatsappInteractionEvents[_0x5b04('0xc')](_0x46164b,_0x3e8b49);_0x1cf5a5(null);})[_0x5b04('0xd')](_0x1cf5a5(null));};}for(var e in events){if(events[_0x5b04('0xe')](e)){var event=events[e];WhatsappInteraction[_0x5b04('0xf')](e,emitEvent(event));}}module[_0x5b04('0x10')]=WhatsappInteractionEvents;
\ No newline at end of file
+var _0x8d44=['map','findAll','emit','catch','hasOwnProperty','hook','exports','events','WhatsappInteraction','../../mysqldb','WhatsappMessage','setMaxListeners','save','update','remove','getUsers','setDataValue'];(function(_0x5545f7,_0x570414){var _0x52a979=function(_0x28eb97){while(--_0x28eb97){_0x5545f7['push'](_0x5545f7['shift']());}};_0x52a979(++_0x570414);}(_0x8d44,0x7e));var _0x48d4=function(_0x3fb9af,_0x41e2fc){_0x3fb9af=_0x3fb9af-0x0;var _0x19e160=_0x8d44[_0x3fb9af];return _0x19e160;};'use strict';var EventEmitter=require(_0x48d4('0x0'));var WhatsappInteraction=require('../../mysqldb')['db'][_0x48d4('0x1')];var WhatsappMessage=require(_0x48d4('0x2'))['db'][_0x48d4('0x3')];var WhatsappInteractionEvents=new EventEmitter();WhatsappInteractionEvents[_0x48d4('0x4')](0x0);var events={'afterCreate':_0x48d4('0x5'),'afterUpdate':_0x48d4('0x6'),'afterDestroy':_0x48d4('0x7')};function emitEvent(_0x5d38e7){return function(_0x4d2890,_0x1e3197,_0x366fa0){_0x4d2890[_0x48d4('0x8')]({'attributes':['id'],'raw':!![]})['then'](function(_0x2caa1a){_0x4d2890[_0x48d4('0x9')]('Users',_0x2caa1a[_0x48d4('0xa')](function(_0x3d0794){return{'id':_0x3d0794['id']};}));return WhatsappMessage[_0x48d4('0xb')]({'where':{'WhatsappInteractionId':_0x4d2890['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x5d6c13){_0x4d2890[_0x48d4('0x9')]('unreadMessages',_0x5d6c13['length']);WhatsappInteractionEvents[_0x48d4('0xc')](_0x5d38e7+':'+_0x4d2890['id'],_0x4d2890);WhatsappInteractionEvents[_0x48d4('0xc')](_0x5d38e7,_0x4d2890);_0x366fa0(null);})[_0x48d4('0xd')](_0x366fa0(null));};}for(var e in events){if(events[_0x48d4('0xe')](e)){var event=events[e];WhatsappInteraction[_0x48d4('0xf')](e,emitEvent(event));}}module[_0x48d4('0x10')]=WhatsappInteractionEvents;
\ No newline at end of file
diff --git a/server/api/whatsappInteraction/whatsappInteraction.model.js b/server/api/whatsappInteraction/whatsappInteraction.model.js
index cd4ae92..6a10aad 100644
--- a/server/api/whatsappInteraction/whatsappInteraction.model.js
+++ b/server/api/whatsappInteraction/whatsappInteraction.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xa9e0=['define','WhatsappInteraction','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','bluebird','path','rimraf','../../config/environment','./whatsappInteraction.attributes','exports'];(function(_0x481dba,_0x44c386){var _0x59e836=function(_0x1d892e){while(--_0x1d892e){_0x481dba['push'](_0x481dba['shift']());}};_0x59e836(++_0x44c386);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1da04e,_0x31024b){_0x1da04e=_0x1da04e-0x0;var _0xdd8c41=_0xa9e0[_0x1da04e];return _0xdd8c41;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var logger=require(_0x0a9e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x0a9e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0a9e('0x4'));var rimraf=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var attributes=require(_0x0a9e('0x7'));module[_0x0a9e('0x8')]=function(_0x57b080,_0x219af0){return _0x57b080[_0x0a9e('0x9')](_0x0a9e('0xa'),attributes,{'tableName':'whatsapp_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x503809,_0xe42b77,_0x56465b){if(_0x503809['changed'](_0x0a9e('0xb'))){_0x503809[_0x0a9e('0xc')]=moment()[_0x0a9e('0xd')](_0x0a9e('0xe'));}_0x56465b(null,_0x503809);}}});};
\ No newline at end of file
+var _0xa9e0=['define','WhatsappInteraction','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','bluebird','path','rimraf','../../config/environment','./whatsappInteraction.attributes','exports'];(function(_0xf7b8c2,_0x119b83){var _0x2a60db=function(_0x485186){while(--_0x485186){_0xf7b8c2['push'](_0xf7b8c2['shift']());}};_0x2a60db(++_0x119b83);}(_0xa9e0,0x123));var _0x0a9e=function(_0x49ca18,_0x5e6d05){_0x49ca18=_0x49ca18-0x0;var _0x145d54=_0xa9e0[_0x49ca18];return _0x145d54;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var logger=require(_0x0a9e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x0a9e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0a9e('0x4'));var rimraf=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var attributes=require(_0x0a9e('0x7'));module[_0x0a9e('0x8')]=function(_0x57b080,_0x219af0){return _0x57b080[_0x0a9e('0x9')](_0x0a9e('0xa'),attributes,{'tableName':'whatsapp_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x503809,_0xe42b77,_0x56465b){if(_0x503809['changed'](_0x0a9e('0xb'))){_0x503809[_0x0a9e('0xc')]=moment()[_0x0a9e('0xd')](_0x0a9e('0xe'));}_0x56465b(null,_0x503809);}}});};
\ No newline at end of file
diff --git a/server/api/whatsappInteraction/whatsappInteraction.rpc.js b/server/api/whatsappInteraction/whatsappInteraction.rpc.js
index 841f8bd..62434b3 100644
--- a/server/api/whatsappInteraction/whatsappInteraction.rpc.js
+++ b/server/api/whatsappInteraction/whatsappInteraction.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9470=['find','addTags','ids','omit','AddTags','moment','randomstring','ioredis','../../config/utils','../../config/environment','jayson/promise','client','redis','defaults','socket.io-emitter','register','request','then','WhatsappInteraction,\x20%s,\x20%s','debug','stringify','error','message','info','request\x20sent','result','UpdateWhatsappInteraction','update','body','options','raw','where','attributes','catch','AddTagsToWhatsappInteraction','WhatsappInteraction'];(function(_0x598216,_0x265d25){var _0x658a57=function(_0x11be65){while(--_0x11be65){_0x598216['push'](_0x598216['shift']());}};_0x658a57(++_0x265d25);}(_0x9470,0x125));var _0x0947=function(_0xf61c79,_0x43c6fa){_0xf61c79=_0xf61c79-0x0;var _0x127d26=_0x9470[_0xf61c79];return _0x127d26;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x0947('0x0'));var BPromise=require('bluebird');var rs=require(_0x0947('0x1'));var fs=require('fs');var Redis=require(_0x0947('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x0947('0x3'));var logger=require('../../config/logger')('rpc');var config=require(_0x0947('0x4'));var jayson=require(_0x0947('0x5'));var client=jayson[_0x0947('0x6')]['http']({'port':0x232a});config[_0x0947('0x7')]=_[_0x0947('0x8')](config[_0x0947('0x7')],{'host':'localhost','port':0x18eb});var socket=require(_0x0947('0x9'))(new Redis(config[_0x0947('0x7')]));require('./whatsappInteraction.socket')[_0x0947('0xa')](socket);function respondWithRpcPromise(_0x7faf5c,_0x3c98b6,_0x91b70c){return new BPromise(function(_0x20b6ed,_0x4685d7){return client[_0x0947('0xb')](_0x7faf5c,_0x91b70c)[_0x0947('0xc')](function(_0x8938b6){logger['info'](_0x0947('0xd'),_0x3c98b6,'request\x20sent');logger[_0x0947('0xe')]('WhatsappInteraction,\x20%s,\x20%s,\x20%s',_0x3c98b6,'request\x20sent',JSON[_0x0947('0xf')](_0x8938b6));if(_0x8938b6[_0x0947('0x10')]){if(_0x8938b6[_0x0947('0x10')]['code']===0x1f4){logger[_0x0947('0x10')]('WhatsappInteraction,\x20%s,\x20%s',_0x3c98b6,_0x8938b6[_0x0947('0x10')][_0x0947('0x11')]);return _0x4685d7(_0x8938b6['error'][_0x0947('0x11')]);}logger[_0x0947('0x10')]('WhatsappInteraction,\x20%s,\x20%s',_0x3c98b6,_0x8938b6[_0x0947('0x10')][_0x0947('0x11')]);return _0x20b6ed(_0x8938b6[_0x0947('0x10')][_0x0947('0x11')]);}else{logger[_0x0947('0x12')](_0x0947('0xd'),_0x3c98b6,_0x0947('0x13'));_0x20b6ed(_0x8938b6[_0x0947('0x14')][_0x0947('0x11')]);}})['catch'](function(_0x594d50){logger[_0x0947('0x10')](_0x0947('0xd'),_0x3c98b6,_0x594d50);_0x4685d7(_0x594d50);});});}exports[_0x0947('0x15')]=function(_0x29384f){var _0x9c1d26=this;return new Promise(function(_0x69b96c,_0x27f84c){return db['WhatsappInteraction'][_0x0947('0x16')](_0x29384f[_0x0947('0x17')],{'raw':_0x29384f[_0x0947('0x18')]?_0x29384f[_0x0947('0x18')][_0x0947('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x29384f[_0x0947('0x18')]?_0x29384f[_0x0947('0x18')][_0x0947('0x1a')]||null:null,'attributes':_0x29384f[_0x0947('0x18')]?_0x29384f[_0x0947('0x18')][_0x0947('0x1b')]||null:null,'limit':_0x29384f['options']?_0x29384f[_0x0947('0x18')]['limit']||null:null})['then'](function(_0x15b80e){logger[_0x0947('0x12')]('UpdateWhatsappInteraction',_0x29384f);logger[_0x0947('0xe')](_0x0947('0x15'),_0x29384f,JSON[_0x0947('0xf')](_0x15b80e));_0x69b96c(_0x15b80e);})[_0x0947('0x1c')](function(_0xc87b8b){logger[_0x0947('0x10')](_0x0947('0x15'),_0xc87b8b['message'],_0x29384f);_0x27f84c(_0x9c1d26[_0x0947('0x10')](0x1f4,_0xc87b8b[_0x0947('0x11')]));});});};exports[_0x0947('0x1d')]=function(_0x6bcb21){return new Promise(function(_0xaf547c,_0x274e8a){return db[_0x0947('0x1e')][_0x0947('0x1f')]({'where':_0x6bcb21[_0x0947('0x18')]?_0x6bcb21[_0x0947('0x18')][_0x0947('0x1a')]||null:null})[_0x0947('0xc')](function(_0x470067){if(_0x470067){return _0x470067[_0x0947('0x20')](_0x6bcb21[_0x0947('0x17')][_0x0947('0x21')],_[_0x0947('0x22')](_0x6bcb21[_0x0947('0x17')],[_0x0947('0x21'),'id'])||{});}})['spread'](function(_0x4c865b){logger[_0x0947('0x12')](_0x0947('0x23'),_0x6bcb21);logger[_0x0947('0xe')](_0x0947('0x23'),_0x6bcb21,JSON[_0x0947('0xf')](_0x4c865b));_0xaf547c(_0x4c865b);})[_0x0947('0x1c')](function(_0x1fb682){logger[_0x0947('0x10')](_0x0947('0x23'),_0x1fb682[_0x0947('0x11')],_0x6bcb21);_0x274e8a(_this['error'](0x1f4,_0x1fb682[_0x0947('0x11')]));});});};
\ No newline at end of file
+var _0x42ef=['debug','WhatsappInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','UpdateWhatsappInteraction','update','body','options','where','attributes','WhatsappInteraction','find','omit','ids','AddTags','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','client','http','redis','localhost','./whatsappInteraction.socket','register','request','then','info','WhatsappInteraction,\x20%s,\x20%s','request\x20sent'];(function(_0x32dce6,_0x23f570){var _0x1191ba=function(_0x58efa8){while(--_0x58efa8){_0x32dce6['push'](_0x32dce6['shift']());}};_0x1191ba(++_0x23f570);}(_0x42ef,0xd1));var _0xf42e=function(_0x49ca2c,_0x39f68){_0x49ca2c=_0x49ca2c-0x0;var _0x5b9654=_0x42ef[_0x49ca2c];return _0x5b9654;};'use strict';var _=require(_0xf42e('0x0'));var util=require(_0xf42e('0x1'));var moment=require(_0xf42e('0x2'));var BPromise=require(_0xf42e('0x3'));var rs=require(_0xf42e('0x4'));var fs=require('fs');var Redis=require(_0xf42e('0x5'));var db=require(_0xf42e('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xf42e('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xf42e('0x8')][_0xf42e('0x9')]({'port':0x232a});config[_0xf42e('0xa')]=_['defaults'](config[_0xf42e('0xa')],{'host':_0xf42e('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xf42e('0xa')]));require(_0xf42e('0xc'))[_0xf42e('0xd')](socket);function respondWithRpcPromise(_0x543579,_0x568d82,_0xb3f6e1){return new BPromise(function(_0x201e79,_0x1aec54){return client[_0xf42e('0xe')](_0x543579,_0xb3f6e1)[_0xf42e('0xf')](function(_0x474ed3){logger[_0xf42e('0x10')](_0xf42e('0x11'),_0x568d82,_0xf42e('0x12'));logger[_0xf42e('0x13')](_0xf42e('0x14'),_0x568d82,_0xf42e('0x12'),JSON[_0xf42e('0x15')](_0x474ed3));if(_0x474ed3[_0xf42e('0x16')]){if(_0x474ed3[_0xf42e('0x16')][_0xf42e('0x17')]===0x1f4){logger[_0xf42e('0x16')](_0xf42e('0x11'),_0x568d82,_0x474ed3[_0xf42e('0x16')][_0xf42e('0x18')]);return _0x1aec54(_0x474ed3[_0xf42e('0x16')]['message']);}logger[_0xf42e('0x16')](_0xf42e('0x11'),_0x568d82,_0x474ed3[_0xf42e('0x16')][_0xf42e('0x18')]);return _0x201e79(_0x474ed3[_0xf42e('0x16')][_0xf42e('0x18')]);}else{logger[_0xf42e('0x10')]('WhatsappInteraction,\x20%s,\x20%s',_0x568d82,'request\x20sent');_0x201e79(_0x474ed3[_0xf42e('0x19')][_0xf42e('0x18')]);}})[_0xf42e('0x1a')](function(_0x59f753){logger[_0xf42e('0x16')]('WhatsappInteraction,\x20%s,\x20%s',_0x568d82,_0x59f753);_0x1aec54(_0x59f753);});});}exports[_0xf42e('0x1b')]=function(_0x5cf4a9){var _0x2113dd=this;return new Promise(function(_0x1b56ec,_0x4f871e){return db['WhatsappInteraction'][_0xf42e('0x1c')](_0x5cf4a9[_0xf42e('0x1d')],{'raw':_0x5cf4a9['options']?_0x5cf4a9['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5cf4a9['options']?_0x5cf4a9[_0xf42e('0x1e')][_0xf42e('0x1f')]||null:null,'attributes':_0x5cf4a9['options']?_0x5cf4a9[_0xf42e('0x1e')][_0xf42e('0x20')]||null:null,'limit':_0x5cf4a9[_0xf42e('0x1e')]?_0x5cf4a9['options']['limit']||null:null})[_0xf42e('0xf')](function(_0x22dd28){logger[_0xf42e('0x10')](_0xf42e('0x1b'),_0x5cf4a9);logger[_0xf42e('0x13')](_0xf42e('0x1b'),_0x5cf4a9,JSON[_0xf42e('0x15')](_0x22dd28));_0x1b56ec(_0x22dd28);})[_0xf42e('0x1a')](function(_0x143231){logger['error'](_0xf42e('0x1b'),_0x143231[_0xf42e('0x18')],_0x5cf4a9);_0x4f871e(_0x2113dd[_0xf42e('0x16')](0x1f4,_0x143231[_0xf42e('0x18')]));});});};exports['AddTagsToWhatsappInteraction']=function(_0x596f9e){return new Promise(function(_0x6d72e0,_0x33f67f){return db[_0xf42e('0x21')][_0xf42e('0x22')]({'where':_0x596f9e[_0xf42e('0x1e')]?_0x596f9e['options']['where']||null:null})[_0xf42e('0xf')](function(_0x37440b){if(_0x37440b){return _0x37440b['addTags'](_0x596f9e[_0xf42e('0x1d')]['ids'],_[_0xf42e('0x23')](_0x596f9e[_0xf42e('0x1d')],[_0xf42e('0x24'),'id'])||{});}})['spread'](function(_0x50f711){logger[_0xf42e('0x10')](_0xf42e('0x25'),_0x596f9e);logger[_0xf42e('0x13')]('AddTags',_0x596f9e,JSON['stringify'](_0x50f711));_0x6d72e0(_0x50f711);})[_0xf42e('0x1a')](function(_0x30a8b4){logger[_0xf42e('0x16')](_0xf42e('0x25'),_0x30a8b4[_0xf42e('0x18')],_0x596f9e);_0x33f67f(_this['error'](0x1f4,_0x30a8b4[_0xf42e('0x18')]));});});};
\ No newline at end of file
diff --git a/server/api/whatsappInteraction/whatsappInteraction.socket.js b/server/api/whatsappInteraction/whatsappInteraction.socket.js
index 856a1c2..4fb14d0 100644
--- a/server/api/whatsappInteraction/whatsappInteraction.socket.js
+++ b/server/api/whatsappInteraction/whatsappInteraction.socket.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x62b7=['emit','removeListener','register','length','whatsappInteraction:','save'];(function(_0x25897a,_0x3d75de){var _0x481613=function(_0x24ca1f){while(--_0x24ca1f){_0x25897a['push'](_0x25897a['shift']());}};_0x481613(++_0x3d75de);}(_0x62b7,0x8f));var _0x762b=function(_0x3ebd65,_0xb16996){_0x3ebd65=_0x3ebd65-0x0;var _0x31eed1=_0x62b7[_0x3ebd65];return _0x31eed1;};'use strict';var WhatsappInteractionEvents=require('./whatsappInteraction.events');var events=[_0x762b('0x0'),'remove','update'];function createListener(_0x565dbd,_0x964530){return function(_0x58fce8){_0x964530[_0x762b('0x1')](_0x565dbd,_0x58fce8);};}function removeListener(_0x4b87e1,_0xc8537){return function(){WhatsappInteractionEvents[_0x762b('0x2')](_0x4b87e1,_0xc8537);};}exports[_0x762b('0x3')]=function(_0x57fe72){for(var _0x29877a=0x0,_0x4c2d4f=events[_0x762b('0x4')];_0x29877a<_0x4c2d4f;_0x29877a++){var _0x12ddb2=events[_0x29877a];var _0x4151eb=createListener(_0x762b('0x5')+_0x12ddb2,_0x57fe72);WhatsappInteractionEvents['on'](_0x12ddb2,_0x4151eb);}};
\ No newline at end of file
+var _0x091e=['save','update','emit','removeListener','register','length','whatsappInteraction:','./whatsappInteraction.events'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x091e,0x1c7));var _0xe091=function(_0x13d07a,_0x41efc3){_0x13d07a=_0x13d07a-0x0;var _0x5ee0ee=_0x091e[_0x13d07a];return _0x5ee0ee;};'use strict';var WhatsappInteractionEvents=require(_0xe091('0x0'));var events=[_0xe091('0x1'),'remove',_0xe091('0x2')];function createListener(_0x3a6751,_0x1cbf20){return function(_0x26046d){_0x1cbf20[_0xe091('0x3')](_0x3a6751,_0x26046d);};}function removeListener(_0x5a49a5,_0x2f65b3){return function(){WhatsappInteractionEvents[_0xe091('0x4')](_0x5a49a5,_0x2f65b3);};}exports[_0xe091('0x5')]=function(_0xe5890f){for(var _0xe8da83=0x0,_0x1f3346=events[_0xe091('0x6')];_0xe8da83<_0x1f3346;_0xe8da83++){var _0x2179b9=events[_0xe8da83];var _0x30053f=createListener(_0xe091('0x7')+_0x2179b9,_0xe5890f);WhatsappInteractionEvents['on'](_0x2179b9,_0x30053f);}};
\ No newline at end of file
diff --git a/server/api/whatsappMessage/index.js b/server/api/whatsappMessage/index.js
index 812596a..00e770b 100644
--- a/server/api/whatsappMessage/index.js
+++ b/server/api/whatsappMessage/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x5757=['/:id/reject','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappMessage.controller','isAuthenticated','index','get','/describe','describe','/:id','show','post','tracked','whatsapp','create','/:id/status','status','put','/:id/accept','accept'];(function(_0x110c3d,_0x12ee06){var _0x226d67=function(_0x1fb6e1){while(--_0x1fb6e1){_0x110c3d['push'](_0x110c3d['shift']());}};_0x226d67(++_0x12ee06);}(_0x5757,0x12b));var _0x7575=function(_0x4238e9,_0x4ae092){_0x4238e9=_0x4238e9-0x0;var _0x4108c3=_0x5757[_0x4238e9];return _0x4108c3;};'use strict';var multer=require(_0x7575('0x0'));var util=require(_0x7575('0x1'));var path=require(_0x7575('0x2'));var timeout=require(_0x7575('0x3'));var express=require(_0x7575('0x4'));var router=express['Router']();var auth=require(_0x7575('0x5'));var interaction=require(_0x7575('0x6'));var config=require(_0x7575('0x7'));var controller=require(_0x7575('0x8'));router['get']('/',auth[_0x7575('0x9')](),controller[_0x7575('0xa')]);router[_0x7575('0xb')](_0x7575('0xc'),auth[_0x7575('0x9')](),controller[_0x7575('0xd')]);router[_0x7575('0xb')](_0x7575('0xe'),auth[_0x7575('0x9')](),controller[_0x7575('0xf')]);router[_0x7575('0x10')]('/',auth['isAuthenticated'](),interaction[_0x7575('0x11')](_0x7575('0x12'),'whatsappmessage:create'),controller[_0x7575('0x13')]);router[_0x7575('0x10')](_0x7575('0x14'),controller[_0x7575('0x15')]);router[_0x7575('0x16')](_0x7575('0xe'),auth[_0x7575('0x9')](),controller['update']);router[_0x7575('0x16')](_0x7575('0x17'),auth[_0x7575('0x9')](),controller[_0x7575('0x18')]);router['put'](_0x7575('0x19'),auth[_0x7575('0x9')](),controller['reject']);router['delete'](_0x7575('0xe'),auth[_0x7575('0x9')](),controller['destroy']);module[_0x7575('0x1a')]=router;
\ No newline at end of file
+var _0x8b8d=['../../components/interaction/service','../../config/environment','./whatsappMessage.controller','index','get','/describe','isAuthenticated','describe','/:id','show','post','tracked','whatsapp','whatsappmessage:create','create','/:id/status','status','put','update','/:id/accept','accept','/:id/reject','reject','delete','destroy','exports','multer','path','connect-timeout','express','Router'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x8b8d,0x96));var _0xd8b8=function(_0x381589,_0x27a707){_0x381589=_0x381589-0x0;var _0x2a075d=_0x8b8d[_0x381589];return _0x2a075d;};'use strict';var multer=require(_0xd8b8('0x0'));var util=require('util');var path=require(_0xd8b8('0x1'));var timeout=require(_0xd8b8('0x2'));var express=require(_0xd8b8('0x3'));var router=express[_0xd8b8('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0xd8b8('0x5'));var config=require(_0xd8b8('0x6'));var controller=require(_0xd8b8('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0xd8b8('0x8')]);router[_0xd8b8('0x9')](_0xd8b8('0xa'),auth[_0xd8b8('0xb')](),controller[_0xd8b8('0xc')]);router[_0xd8b8('0x9')](_0xd8b8('0xd'),auth[_0xd8b8('0xb')](),controller[_0xd8b8('0xe')]);router[_0xd8b8('0xf')]('/',auth[_0xd8b8('0xb')](),interaction[_0xd8b8('0x10')](_0xd8b8('0x11'),_0xd8b8('0x12')),controller[_0xd8b8('0x13')]);router[_0xd8b8('0xf')](_0xd8b8('0x14'),controller[_0xd8b8('0x15')]);router[_0xd8b8('0x16')](_0xd8b8('0xd'),auth[_0xd8b8('0xb')](),controller[_0xd8b8('0x17')]);router[_0xd8b8('0x16')](_0xd8b8('0x18'),auth[_0xd8b8('0xb')](),controller[_0xd8b8('0x19')]);router[_0xd8b8('0x16')](_0xd8b8('0x1a'),auth[_0xd8b8('0xb')](),controller[_0xd8b8('0x1b')]);router[_0xd8b8('0x1c')](_0xd8b8('0xd'),auth['isAuthenticated'](),controller[_0xd8b8('0x1d')]);module[_0xd8b8('0x1e')]=router;
\ No newline at end of file
diff --git a/server/api/whatsappMessage/whatsappMessage.attributes.js b/server/api/whatsappMessage/whatsappMessage.attributes.js
index 600c681..db8345c 100644
--- a/server/api/whatsappMessage/whatsappMessage.attributes.js
+++ b/server/api/whatsappMessage/whatsappMessage.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x90ae=['BOOLEAN','ENUM','out','STRING','DATE','sequelize','exports','TEXT'];(function(_0x51e166,_0x17b403){var _0x5c068c=function(_0x590a0f){while(--_0x590a0f){_0x51e166['push'](_0x51e166['shift']());}};_0x5c068c(++_0x17b403);}(_0x90ae,0x195));var _0xe90a=function(_0x53dbf7,_0x4953cc){_0x53dbf7=_0x53dbf7-0x0;var _0x543510=_0x90ae[_0x53dbf7];return _0x543510;};'use strict';var Sequelize=require(_0xe90a('0x0'));module[_0xe90a('0x1')]={'body':{'type':Sequelize[_0xe90a('0x2')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0xe90a('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0xe90a('0x4')]('in',_0xe90a('0x5')),'defaultValue':_0xe90a('0x5'),'allowNull':![]},'messageId':{'type':Sequelize[_0xe90a('0x6')](0xbe)},'phone':{'type':Sequelize[_0xe90a('0x6')]},'readAt':{'type':Sequelize[_0xe90a('0x7')]},'secret':{'type':Sequelize[_0xe90a('0x3')],'defaultValue':![]}};
\ No newline at end of file
+var _0xadda=['ENUM','out','DATE','sequelize','exports','TEXT','medium','BOOLEAN'];(function(_0x17172c,_0x19aa42){var _0x2fd64b=function(_0x560431){while(--_0x560431){_0x17172c['push'](_0x17172c['shift']());}};_0x2fd64b(++_0x19aa42);}(_0xadda,0xa3));var _0xaadd=function(_0x18ab2a,_0x4debcd){_0x18ab2a=_0x18ab2a-0x0;var _0x16dcee=_0xadda[_0x18ab2a];return _0x16dcee;};'use strict';var Sequelize=require(_0xaadd('0x0'));module[_0xaadd('0x1')]={'body':{'type':Sequelize[_0xaadd('0x2')](_0xaadd('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0xaadd('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0xaadd('0x5')]('in',_0xaadd('0x6')),'defaultValue':'out','allowNull':![]},'messageId':{'type':Sequelize['STRING'](0xbe)},'phone':{'type':Sequelize['STRING']},'readAt':{'type':Sequelize[_0xaadd('0x7')]},'secret':{'type':Sequelize[_0xaadd('0x4')],'defaultValue':![]}};
\ No newline at end of file
diff --git a/server/api/whatsappMessage/whatsappMessage.controller.js b/server/api/whatsappMessage/whatsappMessage.controller.js
index d12c865..21f4fd4 100644
--- a/server/api/whatsappMessage/whatsappMessage.controller.js
+++ b/server/api/whatsappMessage/whatsappMessage.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xddf5=['html-pdf','eml-format','rimraf','zip-dir','request-promise','mustache','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./whatsappMessage.socket','client','http','test','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','info','WhatsappMessage,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','sendStatus','status','end','count','offset','limit','set','json','apply','reject','save','update','destroy','stack','name','send','index','WhatsappMessage','fieldName','map','query','keys','filters','model','intersection','fields','attributes','hasOwnProperty','order','sort','filter','where','type','VIRTUAL','merge','options','then','includeAll','include','findAll','rows','params','length','find','create','body','describe','whatsapp-interactions','accept','whatsapp','read','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','CmContact','Contact','get','WhatsappInteraction','WhatsappInteractionId','isNil','read1stAt','interaction','[WHATSAPPMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','AcceptMessage','acceptMessage','manual','interface','SIP/%s','channel','event','acceptmessage','null','RejectMessage','rejectMessage','EventManager','rejectmessage','WhatsappAccount','WhatsappAccountId','WhatsppMessage,\x20%s,\x20%s,\x20%s','received\x20delivery\x20report\x20from','inspect','twilio','messageId','MessageStatus','WhatsappAccount,\x20%s,\x20%s,\x20%s'];(function(_0x5e706d,_0x2bf99f){var _0x583c53=function(_0xb98df3){while(--_0xb98df3){_0x5e706d['push'](_0x5e706d['shift']());}};_0x583c53(++_0x2bf99f);}(_0xddf5,0x10a));var _0x5ddf=function(_0x3ca523,_0x2db4a2){_0x3ca523=_0x3ca523-0x0;var _0x20ee1a=_0xddf5[_0x3ca523];return _0x20ee1a;};'use strict';var pdf=require(_0x5ddf('0x0'));var emlformat=require(_0x5ddf('0x1'));var rimraf=require(_0x5ddf('0x2'));var zipdir=require(_0x5ddf('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x5ddf('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x5ddf('0x5'));var util=require('util');var path=require('path');var sox=require(_0x5ddf('0x6'));var csv=require(_0x5ddf('0x7'));var ejs=require(_0x5ddf('0x8'));var fs=require('fs');var _=require(_0x5ddf('0x9'));var squel=require(_0x5ddf('0xa'));var crypto=require(_0x5ddf('0xb'));var jsforce=require(_0x5ddf('0xc'));var deskjs=require(_0x5ddf('0xd'));var toCsv=require(_0x5ddf('0x7'));var querystring=require(_0x5ddf('0xe'));var Papa=require(_0x5ddf('0xf'));var Redis=require(_0x5ddf('0x10'));var authService=require(_0x5ddf('0x11'));var qs=require(_0x5ddf('0x12'));var as=require(_0x5ddf('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x5ddf('0x14'))(_0x5ddf('0x15'));var utils=require(_0x5ddf('0x16'));var config=require(_0x5ddf('0x17'));var db=require(_0x5ddf('0x18'))['db'];config[_0x5ddf('0x19')]=_[_0x5ddf('0x1a')](config[_0x5ddf('0x19')],{'host':_0x5ddf('0x1b'),'port':0x18eb});var socket=require(_0x5ddf('0x1c'))(new Redis(config[_0x5ddf('0x19')]));require(_0x5ddf('0x1d'))['register'](socket);var jayson=require('jayson/promise');var client=jayson[_0x5ddf('0x1e')][_0x5ddf('0x1f')]({'port':0x232c});var client9002=jayson[_0x5ddf('0x1e')][_0x5ddf('0x1f')]({'port':0x232a});function checkPasswordPattern(_0x462df3,_0x23242a,_0x294cad){if(_0x294cad){var _0x42d609=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x42d609[_0x5ddf('0x20')](_0x23242a)){return _0x462df3;}else{throw new db['Sequelize'][(_0x5ddf('0x21'))](_0x5ddf('0x22'));}}else{return _0x462df3;}}function respondWithRpcPromise(_0x521a84,_0x4464d0,_0x14b64d,_0x4f540a){return new BPromise(function(_0x159114,_0xa3f8d4){var _0x16bec1=_0x4f540a||client;return _0x16bec1[_0x5ddf('0x23')](_0x521a84,_0x14b64d)['then'](function(_0x249573){logger[_0x5ddf('0x24')](_0x5ddf('0x25'),_0x4464d0,'request\x20sent');logger[_0x5ddf('0x26')]('WhatsappMessage,\x20%s,\x20%s,\x20%s',_0x4464d0,_0x5ddf('0x27'),JSON[_0x5ddf('0x28')](_0x249573));if(_0x249573[_0x5ddf('0x29')]){if(_0x249573[_0x5ddf('0x29')][_0x5ddf('0x2a')]===0x1f4){logger[_0x5ddf('0x29')](_0x5ddf('0x25'),_0x4464d0,_0x249573[_0x5ddf('0x29')][_0x5ddf('0x2b')]);return _0xa3f8d4(_0x249573[_0x5ddf('0x29')][_0x5ddf('0x2b')]);}logger[_0x5ddf('0x29')](_0x5ddf('0x25'),_0x4464d0,_0x249573[_0x5ddf('0x29')][_0x5ddf('0x2b')]);return _0x159114(_0x249573[_0x5ddf('0x29')]['message']);}else{logger['info']('WhatsappMessage,\x20%s,\x20%s',_0x4464d0,_0x5ddf('0x27'));_0x159114(_0x249573[_0x5ddf('0x2c')]['message']);}})[_0x5ddf('0x2d')](function(_0x52eff7){logger[_0x5ddf('0x29')](_0x5ddf('0x25'),_0x4464d0,_0x52eff7);_0xa3f8d4(_0x52eff7);});});}function respondWithStatusCode(_0x30bbee,_0x41e33e){_0x41e33e=_0x41e33e||0xcc;return function(_0x27bacc){if(_0x27bacc){return _0x30bbee[_0x5ddf('0x2e')](_0x41e33e);}return _0x30bbee[_0x5ddf('0x2f')](_0x41e33e)[_0x5ddf('0x30')]();};}function respondWithResult(_0xb4aa04,_0x3d4dc9){_0x3d4dc9=_0x3d4dc9||0xc8;return function(_0x1fc165){if(_0x1fc165){return _0xb4aa04[_0x5ddf('0x2f')](_0x3d4dc9)['json'](_0x1fc165);}};}function respondWithFilteredResult(_0x2b5039,_0x4fa13b){return function(_0x26ff8a){if(_0x26ff8a){var _0x1b8d48=_0x26ff8a[_0x5ddf('0x31')],_0x135ba0=_0x4fa13b[_0x5ddf('0x32')],_0x4320f5=_0x4fa13b[_0x5ddf('0x32')]+_0x4fa13b[_0x5ddf('0x33')],_0x5a9fe9;if(_0x4320f5>=_0x1b8d48){_0x4320f5=_0x1b8d48;_0x5a9fe9=0xc8;}else{_0x5a9fe9=0xce;}_0x2b5039[_0x5ddf('0x2f')](_0x5a9fe9);return _0x2b5039[_0x5ddf('0x34')]('Content-Range',_0x135ba0+'-'+_0x4320f5+'/'+_0x1b8d48)[_0x5ddf('0x35')](_0x26ff8a);}return null;};}function patchUpdates(_0x4defcb){return function(_0x877c94){try{jsonpatch[_0x5ddf('0x36')](_0x877c94,_0x4defcb,!![]);}catch(_0x279aef){return BPromise[_0x5ddf('0x37')](_0x279aef);}return _0x877c94[_0x5ddf('0x38')]();};}function saveUpdates(_0x4003a7,_0x177acd){return function(_0x2537c4){if(_0x2537c4){return _0x2537c4[_0x5ddf('0x39')](_0x4003a7)['then'](function(_0xe1e459){return _0xe1e459;});}return null;};}function removeEntity(_0x16b105,_0x291390){return function(_0x17980f){if(_0x17980f){return _0x17980f[_0x5ddf('0x3a')]()['then'](function(){_0x16b105['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x260fb6,_0x424918){return function(_0x47b889){if(!_0x47b889){_0x260fb6[_0x5ddf('0x2e')](0x194);}return _0x47b889;};}function handleError(_0x42a10e,_0x4e76b3){_0x4e76b3=_0x4e76b3||0x1f4;return function(_0xf5ce1c){logger[_0x5ddf('0x29')](_0xf5ce1c[_0x5ddf('0x3b')]);if(_0xf5ce1c[_0x5ddf('0x3c')]){delete _0xf5ce1c[_0x5ddf('0x3c')];}_0x42a10e[_0x5ddf('0x2f')](_0x4e76b3)[_0x5ddf('0x3d')](_0xf5ce1c);};}exports[_0x5ddf('0x3e')]=function(_0x447fb2,_0xdcee38){var _0x24fa15={},_0x19bc8c={},_0x408191={'count':0x0,'rows':[]};var _0x35899a=_['map'](db[_0x5ddf('0x3f')]['rawAttributes'],function(_0xeb0e1a){return{'name':_0xeb0e1a[_0x5ddf('0x40')],'type':_0xeb0e1a['type']['key']};});_0x19bc8c['model']=_[_0x5ddf('0x41')](_0x35899a,_0x5ddf('0x3c'));_0x19bc8c[_0x5ddf('0x42')]=_[_0x5ddf('0x43')](_0x447fb2['query']);_0x19bc8c[_0x5ddf('0x44')]=_['intersection'](_0x19bc8c[_0x5ddf('0x45')],_0x19bc8c[_0x5ddf('0x42')]);_0x24fa15['attributes']=_[_0x5ddf('0x46')](_0x19bc8c['model'],qs[_0x5ddf('0x47')](_0x447fb2[_0x5ddf('0x42')][_0x5ddf('0x47')]));_0x24fa15['attributes']=_0x24fa15['attributes']['length']?_0x24fa15[_0x5ddf('0x48')]:_0x19bc8c['model'];if(!_0x447fb2[_0x5ddf('0x42')][_0x5ddf('0x49')]('nolimit')){_0x24fa15['limit']=qs[_0x5ddf('0x33')](_0x447fb2[_0x5ddf('0x42')][_0x5ddf('0x33')]);_0x24fa15[_0x5ddf('0x32')]=qs[_0x5ddf('0x32')](_0x447fb2[_0x5ddf('0x42')]['offset']);}_0x24fa15[_0x5ddf('0x4a')]=qs[_0x5ddf('0x4b')](_0x447fb2[_0x5ddf('0x42')][_0x5ddf('0x4b')]);_0x24fa15['where']=qs['filters'](_['pick'](_0x447fb2['query'],_0x19bc8c[_0x5ddf('0x44')]),_0x35899a);if(_0x447fb2[_0x5ddf('0x42')][_0x5ddf('0x4c')]){_0x24fa15[_0x5ddf('0x4d')]=_['merge'](_0x24fa15[_0x5ddf('0x4d')],{'$or':_['map'](_0x35899a,function(_0x315cc3){if(_0x315cc3[_0x5ddf('0x4e')]!==_0x5ddf('0x4f')){var _0x2bced2={};_0x2bced2[_0x315cc3['name']]={'$like':'%'+_0x447fb2[_0x5ddf('0x42')][_0x5ddf('0x4c')]+'%'};return _0x2bced2;}})});}_0x24fa15=_[_0x5ddf('0x50')]({},_0x24fa15,_0x447fb2[_0x5ddf('0x51')]);var _0x46ef32={'where':_0x24fa15['where']};return db['WhatsappMessage'][_0x5ddf('0x31')](_0x46ef32)[_0x5ddf('0x52')](function(_0x4f0476){_0x408191[_0x5ddf('0x31')]=_0x4f0476;if(_0x447fb2[_0x5ddf('0x42')][_0x5ddf('0x53')]){_0x24fa15[_0x5ddf('0x54')]=[{'all':!![]}];}return db[_0x5ddf('0x3f')][_0x5ddf('0x55')](_0x24fa15);})['then'](function(_0x40ea9e){_0x408191[_0x5ddf('0x56')]=_0x40ea9e;return _0x408191;})[_0x5ddf('0x52')](respondWithFilteredResult(_0xdcee38,_0x24fa15))[_0x5ddf('0x2d')](handleError(_0xdcee38,null));};exports['show']=function(_0x418fc9,_0x1dfdb1){var _0xecc02e={'raw':!![],'where':{'id':_0x418fc9[_0x5ddf('0x57')]['id']}},_0x1c2bd7={};_0x1c2bd7['model']=_['keys'](db[_0x5ddf('0x3f')]['rawAttributes']);_0x1c2bd7['query']=_[_0x5ddf('0x43')](_0x418fc9['query']);_0x1c2bd7[_0x5ddf('0x44')]=_[_0x5ddf('0x46')](_0x1c2bd7['model'],_0x1c2bd7[_0x5ddf('0x42')]);_0xecc02e[_0x5ddf('0x48')]=_[_0x5ddf('0x46')](_0x1c2bd7['model'],qs[_0x5ddf('0x47')](_0x418fc9[_0x5ddf('0x42')][_0x5ddf('0x47')]));_0xecc02e[_0x5ddf('0x48')]=_0xecc02e[_0x5ddf('0x48')][_0x5ddf('0x58')]?_0xecc02e[_0x5ddf('0x48')]:_0x1c2bd7[_0x5ddf('0x45')];if(_0x418fc9['query'][_0x5ddf('0x53')]){_0xecc02e[_0x5ddf('0x54')]=[{'all':!![]}];}_0xecc02e=_[_0x5ddf('0x50')]({},_0xecc02e,_0x418fc9[_0x5ddf('0x51')]);return db[_0x5ddf('0x3f')][_0x5ddf('0x59')](_0xecc02e)['then'](handleEntityNotFound(_0x1dfdb1,null))[_0x5ddf('0x52')](respondWithResult(_0x1dfdb1,null))[_0x5ddf('0x2d')](handleError(_0x1dfdb1,null));};exports['create']=function(_0xfa14f5,_0x25aa97){return db[_0x5ddf('0x3f')][_0x5ddf('0x5a')](_0xfa14f5['body'],{})['then'](respondWithResult(_0x25aa97,0xc9))[_0x5ddf('0x2d')](handleError(_0x25aa97,null));};exports[_0x5ddf('0x39')]=function(_0x88ddfb,_0x137e2e){if(_0x88ddfb[_0x5ddf('0x5b')]['id']){delete _0x88ddfb['body']['id'];}return db['WhatsappMessage'][_0x5ddf('0x59')]({'where':{'id':_0x88ddfb[_0x5ddf('0x57')]['id']}})[_0x5ddf('0x52')](handleEntityNotFound(_0x137e2e,null))[_0x5ddf('0x52')](saveUpdates(_0x88ddfb[_0x5ddf('0x5b')],null))[_0x5ddf('0x52')](respondWithResult(_0x137e2e,null))['catch'](handleError(_0x137e2e,null));};exports[_0x5ddf('0x3a')]=function(_0x369580,_0x5c1710){return db[_0x5ddf('0x3f')]['find']({'where':{'id':_0x369580[_0x5ddf('0x57')]['id']}})[_0x5ddf('0x52')](handleEntityNotFound(_0x5c1710,null))[_0x5ddf('0x52')](removeEntity(_0x5c1710,null))[_0x5ddf('0x2d')](handleError(_0x5c1710,null));};exports['describe']=function(_0x3887e8,_0x1c9c6c){return db[_0x5ddf('0x3f')][_0x5ddf('0x5c')]()['then'](respondWithResult(_0x1c9c6c,null))['catch'](handleError(_0x1c9c6c,null));};var interaction_log=require(_0x5ddf('0x14'))(_0x5ddf('0x5d'));exports[_0x5ddf('0x5e')]=function(_0x21adab,_0x34a7e3,_0x24928c){var _0x370063={'channel':_0x5ddf('0x5f')};if(_0x21adab[_0x5ddf('0x5b')]['id']){delete _0x21adab[_0x5ddf('0x5b')]['id'];}_0x21adab[_0x5ddf('0x5b')][_0x5ddf('0x60')]=!![];_0x21adab['body']['readAt']=moment()[_0x5ddf('0x61')](_0x5ddf('0x62'));_0x21adab[_0x5ddf('0x5b')][_0x5ddf('0x63')]=_0x21adab[_0x5ddf('0x5b')][_0x5ddf('0x63')]||_0x21adab[_0x5ddf('0x64')]['id'];return db[_0x5ddf('0x3f')]['find']({'where':{'id':_0x21adab[_0x5ddf('0x57')]['id'],'UserId':null},'include':[{'model':db[_0x5ddf('0x65')],'as':_0x5ddf('0x66')}]})[_0x5ddf('0x52')](handleEntityNotFound(_0x34a7e3,null))[_0x5ddf('0x52')](saveUpdates(_0x21adab[_0x5ddf('0x5b')],null))[_0x5ddf('0x52')](function(_0x3e9d23){if(_0x3e9d23){_0x370063['message']=_0x3e9d23[_0x5ddf('0x67')]({'plain':!![]});return db[_0x5ddf('0x68')][_0x5ddf('0x59')]({'where':{'id':_0x3e9d23[_0x5ddf('0x69')]}});}return null;})['then'](handleEntityNotFound(_0x34a7e3,null))['then'](function(_0x493596){if(_0x493596){return _0x493596['update']({'UserId':_0x21adab[_0x5ddf('0x5b')][_0x5ddf('0x63')],'read1stAt':_[_0x5ddf('0x6a')](_0x493596[_0x5ddf('0x6b')])?moment()[_0x5ddf('0x61')](_0x5ddf('0x62')):undefined});}return null;})[_0x5ddf('0x52')](function(_0x192c08){if(_0x192c08){_0x370063[_0x5ddf('0x6c')]=_0x192c08[_0x5ddf('0x67')]({'plain':!![]});interaction_log[_0x5ddf('0x24')](_0x5ddf('0x6d'),_0x21adab[_0x5ddf('0x64')]['id'],_0x21adab['user'][_0x5ddf('0x3c')],_0x21adab['user'][_0x5ddf('0x6e')],_0x370063[_0x5ddf('0x6c')]['id'],_0x21adab['body']?JSON[_0x5ddf('0x28')](_0x21adab[_0x5ddf('0x5b')]):'null');return respondWithRpcPromise(_0x5ddf('0x6f'),_0x5ddf('0x70'),_0x370063);}return null;})[_0x5ddf('0x52')](function(_0x395c94){if(_0x395c94){if(_0x21adab[_0x5ddf('0x5b')][_0x5ddf('0x71')]){_0x370063[_0x5ddf('0x2b')][_0x5ddf('0x72')]=util['format'](_0x5ddf('0x73'),_0x21adab[_0x5ddf('0x64')][_0x5ddf('0x3c')]);_0x370063['message'][_0x5ddf('0x74')]=_0x370063[_0x5ddf('0x74')];_0x370063['message'][_0x5ddf('0x75')]='accept';return respondWithRpcPromise('EventManager','EventManager',{'event':_0x5ddf('0x76'),'message':_0x370063[_0x5ddf('0x2b')]},client9002)[_0x5ddf('0x52')](function(){return _0x370063;});}return _0x370063;}return null;})[_0x5ddf('0x52')](respondWithResult(_0x34a7e3,null))[_0x5ddf('0x2d')](handleError(_0x34a7e3,null));};var interaction_log=require(_0x5ddf('0x14'))(_0x5ddf('0x5d'));exports['reject']=function(_0x29d851,_0x1a07b3,_0x22b017){var _0xeac68b={'agent':{},'channel':_0x5ddf('0x5f')};if(_0x29d851['body']['id']){delete _0x29d851[_0x5ddf('0x5b')]['id'];}_0x29d851['body']['UserId']=_0x29d851['body'][_0x5ddf('0x63')]||_0x29d851[_0x5ddf('0x64')]['id'];_0xeac68b['agent']['id']=_0x29d851['body'][_0x5ddf('0x63')];return db[_0x5ddf('0x3f')][_0x5ddf('0x59')]({'where':{'id':_0x29d851[_0x5ddf('0x57')]['id'],'UserId':null}})[_0x5ddf('0x52')](handleEntityNotFound(_0x1a07b3,null))[_0x5ddf('0x52')](function(_0x530c85){if(_0x530c85){_0xeac68b[_0x5ddf('0x2b')]=_0x530c85['get']({'plain':!![]});return db['WhatsappInteraction'][_0x5ddf('0x59')]({'where':{'id':_0x530c85['WhatsappInteractionId']}});}return null;})['then'](handleEntityNotFound(_0x1a07b3,null))[_0x5ddf('0x52')](function(_0x2e1959){if(_0x2e1959){_0xeac68b[_0x5ddf('0x6c')]=_0x2e1959[_0x5ddf('0x67')]({'plain':!![]});interaction_log[_0x5ddf('0x24')]('[WHATSAPPMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x29d851['user']['id'],_0x29d851[_0x5ddf('0x64')][_0x5ddf('0x3c')],_0x29d851[_0x5ddf('0x64')][_0x5ddf('0x6e')],_0xeac68b[_0x5ddf('0x6c')]['id'],_0x29d851['body']?JSON['stringify'](_0x29d851[_0x5ddf('0x5b')]):_0x5ddf('0x77'));return respondWithRpcPromise(_0x5ddf('0x78'),_0x5ddf('0x79'),_0xeac68b);}return null;})[_0x5ddf('0x52')](function(_0xfc2698){if(_0xfc2698){_0xfc2698['message']['interface']=util[_0x5ddf('0x61')](_0x5ddf('0x73'),_0x29d851[_0x5ddf('0x64')][_0x5ddf('0x3c')]);_0xfc2698[_0x5ddf('0x2b')][_0x5ddf('0x74')]=_0xeac68b['channel'];_0xfc2698['message'][_0x5ddf('0x75')]=_0x5ddf('0x37');respondWithRpcPromise(_0x5ddf('0x7a'),_0x5ddf('0x7a'),{'event':_0x5ddf('0x7b'),'message':_0xfc2698[_0x5ddf('0x2b')]},client9002);return _0xeac68b;}return null;})[_0x5ddf('0x52')](respondWithResult(_0x1a07b3,null))[_0x5ddf('0x2d')](handleError(_0x1a07b3,null));};exports[_0x5ddf('0x2f')]=function(_0x1addf7,_0x16d1eb,_0x1d939d){if(_0x1addf7[_0x5ddf('0x5b')]['id']){delete _0x1addf7[_0x5ddf('0x5b')]['id'];}var _0xbe00eb;return db[_0x5ddf('0x3f')][_0x5ddf('0x59')]({'where':{'id':_0x1addf7[_0x5ddf('0x57')]['id']}})[_0x5ddf('0x52')](handleEntityNotFound(_0x16d1eb,null))[_0x5ddf('0x52')](function(_0x5af00f){if(_0x5af00f){_0xbe00eb=_0x5af00f;return db[_0x5ddf('0x7c')][_0x5ddf('0x59')]({'where':{'id':_0x5af00f[_0x5ddf('0x7d')]}});}})[_0x5ddf('0x52')](handleEntityNotFound(_0x16d1eb,null))['then'](function(_0x5cf2e3){if(_0x5cf2e3){logger[_0x5ddf('0x26')](_0x5ddf('0x7e'),_0x5ddf('0x2f'),_0x5ddf('0x7f'),_0x5cf2e3[_0x5ddf('0x4e')],util[_0x5ddf('0x80')](_0x1addf7[_0x5ddf('0x5b')],{'showHidden':![],'depth':null}));switch(_0x5cf2e3[_0x5ddf('0x4e')]){case _0x5ddf('0x81'):if(_0x1addf7[_0x5ddf('0x5b')]['MessageSid']&&_0x1addf7[_0x5ddf('0x5b')]['MessageSid']===_0xbe00eb[_0x5ddf('0x82')]&&_0x1addf7[_0x5ddf('0x5b')][_0x5ddf('0x83')]&&_0x1addf7[_0x5ddf('0x5b')][_0x5ddf('0x83')]===_0x5ddf('0x60')){return _0xbe00eb[_0x5ddf('0x39')]({'read':!![]});}else{logger[_0x5ddf('0x29')](_0x5ddf('0x84'),'status',_0x5ddf('0x81'),util['inspect'](_0x1addf7[_0x5ddf('0x5b')],{'showHidden':![],'depth':null}));}break;}return _0xbe00eb;}})[_0x5ddf('0x52')](respondWithResult(_0x16d1eb,null))[_0x5ddf('0x2d')](handleError(_0x16d1eb,null));};
\ No newline at end of file
+var _0x5322=['name','index','map','WhatsappMessage','rawAttributes','fieldName','type','keys','query','intersection','model','attributes','length','hasOwnProperty','order','sort','filters','pick','where','merge','VIRTUAL','filter','include','show','params','fields','includeAll','options','find','create','body','destroy','describe','whatsapp-interactions','accept','whatsapp','read','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','user','CmContact','get','WhatsappInteractionId','isNil','read1stAt','format','interaction','[WHATSAPPMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','AcceptMessage','acceptMessage','manual','SIP/%s','channel','event','EventManager','acceptmessage','reject','agent','WhatsappInteraction','rejectMessage','interface','rejectmessage','WhatsappAccount','WhatsappAccountId','WhatsppMessage,\x20%s,\x20%s,\x20%s','received\x20delivery\x20report\x20from','inspect','MessageSid','messageId','MessageStatus','WhatsappAccount,\x20%s,\x20%s,\x20%s','twilio','html-pdf','rimraf','zip-dir','fast-json-patch','moment','util','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','redis','defaults','localhost','./whatsappMessage.socket','register','jayson/promise','client','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','then','info','WhatsappMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','sendStatus','status','end','count','offset','limit','set','Content-Range','json','save','update','stack'];(function(_0x3e5086,_0x48f4a2){var _0xfeb102=function(_0x5a945f){while(--_0x5a945f){_0x3e5086['push'](_0x3e5086['shift']());}};_0xfeb102(++_0x48f4a2);}(_0x5322,0x1cd));var _0x2532=function(_0x502598,_0x1e95c8){_0x502598=_0x502598-0x0;var _0xbdee21=_0x5322[_0x502598];return _0xbdee21;};'use strict';var pdf=require(_0x2532('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x2532('0x1'));var zipdir=require(_0x2532('0x2'));var jsonpatch=require(_0x2532('0x3'));var rp=require('request-promise');var moment=require(_0x2532('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x2532('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0x2532('0x6'));var ejs=require(_0x2532('0x7'));var fs=require('fs');var _=require(_0x2532('0x8'));var squel=require(_0x2532('0x9'));var crypto=require('crypto');var jsforce=require(_0x2532('0xa'));var deskjs=require(_0x2532('0xb'));var toCsv=require('to-csv');var querystring=require(_0x2532('0xc'));var Papa=require(_0x2532('0xd'));var Redis=require(_0x2532('0xe'));var authService=require(_0x2532('0xf'));var qs=require(_0x2532('0x10'));var as=require(_0x2532('0x11'));var hardwareService=require(_0x2532('0x12'));var logger=require(_0x2532('0x13'))('api');var utils=require('../../config/utils');var config=require(_0x2532('0x14'));var db=require(_0x2532('0x15'))['db'];config[_0x2532('0x16')]=_[_0x2532('0x17')](config['redis'],{'host':_0x2532('0x18'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x2532('0x16')]));require(_0x2532('0x19'))[_0x2532('0x1a')](socket);var jayson=require(_0x2532('0x1b'));var client=jayson[_0x2532('0x1c')][_0x2532('0x1d')]({'port':0x232c});var client9002=jayson['client']['http']({'port':0x232a});function checkPasswordPattern(_0x20d400,_0x580cdc,_0x2c4980){if(_0x2c4980){var _0x450164=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x450164[_0x2532('0x1e')](_0x580cdc)){return _0x20d400;}else{throw new db['Sequelize']['ValidationError'](_0x2532('0x1f'));}}else{return _0x20d400;}}function respondWithRpcPromise(_0x4c17da,_0x1583eb,_0x45462b,_0x1bc46b){return new BPromise(function(_0x66ef03,_0x4e169c){var _0x545999=_0x1bc46b||client;return _0x545999['request'](_0x4c17da,_0x45462b)[_0x2532('0x20')](function(_0x53550a){logger[_0x2532('0x21')](_0x2532('0x22'),_0x1583eb,_0x2532('0x23'));logger[_0x2532('0x24')]('WhatsappMessage,\x20%s,\x20%s,\x20%s',_0x1583eb,_0x2532('0x23'),JSON[_0x2532('0x25')](_0x53550a));if(_0x53550a[_0x2532('0x26')]){if(_0x53550a[_0x2532('0x26')][_0x2532('0x27')]===0x1f4){logger['error'](_0x2532('0x22'),_0x1583eb,_0x53550a['error'][_0x2532('0x28')]);return _0x4e169c(_0x53550a[_0x2532('0x26')][_0x2532('0x28')]);}logger['error']('WhatsappMessage,\x20%s,\x20%s',_0x1583eb,_0x53550a[_0x2532('0x26')]['message']);return _0x66ef03(_0x53550a[_0x2532('0x26')][_0x2532('0x28')]);}else{logger[_0x2532('0x21')](_0x2532('0x22'),_0x1583eb,_0x2532('0x23'));_0x66ef03(_0x53550a[_0x2532('0x29')]['message']);}})[_0x2532('0x2a')](function(_0x2bac12){logger[_0x2532('0x26')]('WhatsappMessage,\x20%s,\x20%s',_0x1583eb,_0x2bac12);_0x4e169c(_0x2bac12);});});}function respondWithStatusCode(_0x2d5a33,_0x44e54f){_0x44e54f=_0x44e54f||0xcc;return function(_0xdc6060){if(_0xdc6060){return _0x2d5a33[_0x2532('0x2b')](_0x44e54f);}return _0x2d5a33[_0x2532('0x2c')](_0x44e54f)[_0x2532('0x2d')]();};}function respondWithResult(_0x25d1aa,_0x1e1597){_0x1e1597=_0x1e1597||0xc8;return function(_0x39b3d1){if(_0x39b3d1){return _0x25d1aa['status'](_0x1e1597)['json'](_0x39b3d1);}};}function respondWithFilteredResult(_0x4a209f,_0x1f6419){return function(_0x159414){if(_0x159414){var _0x28977a=_0x159414[_0x2532('0x2e')],_0x1ef7c8=_0x1f6419[_0x2532('0x2f')],_0x5b5cc8=_0x1f6419[_0x2532('0x2f')]+_0x1f6419[_0x2532('0x30')],_0x2ecdd4;if(_0x5b5cc8>=_0x28977a){_0x5b5cc8=_0x28977a;_0x2ecdd4=0xc8;}else{_0x2ecdd4=0xce;}_0x4a209f[_0x2532('0x2c')](_0x2ecdd4);return _0x4a209f[_0x2532('0x31')](_0x2532('0x32'),_0x1ef7c8+'-'+_0x5b5cc8+'/'+_0x28977a)[_0x2532('0x33')](_0x159414);}return null;};}function patchUpdates(_0x2fe4df){return function(_0x47e0bc){try{jsonpatch['apply'](_0x47e0bc,_0x2fe4df,!![]);}catch(_0x2deb3c){return BPromise['reject'](_0x2deb3c);}return _0x47e0bc[_0x2532('0x34')]();};}function saveUpdates(_0x3d94f2,_0x5cad41){return function(_0x378184){if(_0x378184){return _0x378184[_0x2532('0x35')](_0x3d94f2)[_0x2532('0x20')](function(_0x3d81f5){return _0x3d81f5;});}return null;};}function removeEntity(_0x3a6ec3,_0x12f968){return function(_0x40aa8a){if(_0x40aa8a){return _0x40aa8a['destroy']()[_0x2532('0x20')](function(){_0x3a6ec3[_0x2532('0x2c')](0xcc)[_0x2532('0x2d')]();});}};}function handleEntityNotFound(_0x1dfd64,_0x15c25c){return function(_0x3b88ed){if(!_0x3b88ed){_0x1dfd64['sendStatus'](0x194);}return _0x3b88ed;};}function handleError(_0x391c03,_0x430c39){_0x430c39=_0x430c39||0x1f4;return function(_0x1ee6af){logger[_0x2532('0x26')](_0x1ee6af[_0x2532('0x36')]);if(_0x1ee6af[_0x2532('0x37')]){delete _0x1ee6af[_0x2532('0x37')];}_0x391c03[_0x2532('0x2c')](_0x430c39)['send'](_0x1ee6af);};}exports[_0x2532('0x38')]=function(_0x2b754e,_0x42e0e4){var _0x57fe68={},_0x140361={},_0x46f750={'count':0x0,'rows':[]};var _0x28ae87=_[_0x2532('0x39')](db[_0x2532('0x3a')][_0x2532('0x3b')],function(_0x5d9d7a){return{'name':_0x5d9d7a[_0x2532('0x3c')],'type':_0x5d9d7a[_0x2532('0x3d')]['key']};});_0x140361['model']=_[_0x2532('0x39')](_0x28ae87,_0x2532('0x37'));_0x140361['query']=_[_0x2532('0x3e')](_0x2b754e[_0x2532('0x3f')]);_0x140361['filters']=_[_0x2532('0x40')](_0x140361[_0x2532('0x41')],_0x140361[_0x2532('0x3f')]);_0x57fe68[_0x2532('0x42')]=_[_0x2532('0x40')](_0x140361[_0x2532('0x41')],qs['fields'](_0x2b754e[_0x2532('0x3f')]['fields']));_0x57fe68[_0x2532('0x42')]=_0x57fe68['attributes'][_0x2532('0x43')]?_0x57fe68[_0x2532('0x42')]:_0x140361[_0x2532('0x41')];if(!_0x2b754e[_0x2532('0x3f')][_0x2532('0x44')]('nolimit')){_0x57fe68[_0x2532('0x30')]=qs[_0x2532('0x30')](_0x2b754e['query']['limit']);_0x57fe68['offset']=qs['offset'](_0x2b754e[_0x2532('0x3f')][_0x2532('0x2f')]);}_0x57fe68[_0x2532('0x45')]=qs[_0x2532('0x46')](_0x2b754e[_0x2532('0x3f')]['sort']);_0x57fe68['where']=qs[_0x2532('0x47')](_[_0x2532('0x48')](_0x2b754e[_0x2532('0x3f')],_0x140361[_0x2532('0x47')]),_0x28ae87);if(_0x2b754e[_0x2532('0x3f')]['filter']){_0x57fe68[_0x2532('0x49')]=_[_0x2532('0x4a')](_0x57fe68[_0x2532('0x49')],{'$or':_[_0x2532('0x39')](_0x28ae87,function(_0x526446){if(_0x526446[_0x2532('0x3d')]!==_0x2532('0x4b')){var _0x2b9d9e={};_0x2b9d9e[_0x526446[_0x2532('0x37')]]={'$like':'%'+_0x2b754e['query'][_0x2532('0x4c')]+'%'};return _0x2b9d9e;}})});}_0x57fe68=_[_0x2532('0x4a')]({},_0x57fe68,_0x2b754e['options']);var _0x4651d4={'where':_0x57fe68['where']};return db[_0x2532('0x3a')][_0x2532('0x2e')](_0x4651d4)[_0x2532('0x20')](function(_0xe5f87d){_0x46f750[_0x2532('0x2e')]=_0xe5f87d;if(_0x2b754e['query']['includeAll']){_0x57fe68[_0x2532('0x4d')]=[{'all':!![]}];}return db[_0x2532('0x3a')]['findAll'](_0x57fe68);})['then'](function(_0x118118){_0x46f750['rows']=_0x118118;return _0x46f750;})[_0x2532('0x20')](respondWithFilteredResult(_0x42e0e4,_0x57fe68))['catch'](handleError(_0x42e0e4,null));};exports[_0x2532('0x4e')]=function(_0x36c9bc,_0x5cc8a0){var _0x276e3b={'raw':!![],'where':{'id':_0x36c9bc[_0x2532('0x4f')]['id']}},_0x148865={};_0x148865[_0x2532('0x41')]=_['keys'](db[_0x2532('0x3a')][_0x2532('0x3b')]);_0x148865[_0x2532('0x3f')]=_[_0x2532('0x3e')](_0x36c9bc['query']);_0x148865[_0x2532('0x47')]=_[_0x2532('0x40')](_0x148865[_0x2532('0x41')],_0x148865[_0x2532('0x3f')]);_0x276e3b[_0x2532('0x42')]=_[_0x2532('0x40')](_0x148865['model'],qs[_0x2532('0x50')](_0x36c9bc[_0x2532('0x3f')][_0x2532('0x50')]));_0x276e3b['attributes']=_0x276e3b[_0x2532('0x42')][_0x2532('0x43')]?_0x276e3b['attributes']:_0x148865[_0x2532('0x41')];if(_0x36c9bc[_0x2532('0x3f')][_0x2532('0x51')]){_0x276e3b[_0x2532('0x4d')]=[{'all':!![]}];}_0x276e3b=_[_0x2532('0x4a')]({},_0x276e3b,_0x36c9bc[_0x2532('0x52')]);return db[_0x2532('0x3a')][_0x2532('0x53')](_0x276e3b)[_0x2532('0x20')](handleEntityNotFound(_0x5cc8a0,null))[_0x2532('0x20')](respondWithResult(_0x5cc8a0,null))[_0x2532('0x2a')](handleError(_0x5cc8a0,null));};exports[_0x2532('0x54')]=function(_0x37cf3d,_0x7a3c6d){return db[_0x2532('0x3a')][_0x2532('0x54')](_0x37cf3d['body'],{})['then'](respondWithResult(_0x7a3c6d,0xc9))[_0x2532('0x2a')](handleError(_0x7a3c6d,null));};exports[_0x2532('0x35')]=function(_0x5b3b2c,_0x1dc17a){if(_0x5b3b2c['body']['id']){delete _0x5b3b2c[_0x2532('0x55')]['id'];}return db[_0x2532('0x3a')][_0x2532('0x53')]({'where':{'id':_0x5b3b2c['params']['id']}})[_0x2532('0x20')](handleEntityNotFound(_0x1dc17a,null))['then'](saveUpdates(_0x5b3b2c['body'],null))[_0x2532('0x20')](respondWithResult(_0x1dc17a,null))[_0x2532('0x2a')](handleError(_0x1dc17a,null));};exports[_0x2532('0x56')]=function(_0x1ce17e,_0x4db917){return db[_0x2532('0x3a')][_0x2532('0x53')]({'where':{'id':_0x1ce17e[_0x2532('0x4f')]['id']}})[_0x2532('0x20')](handleEntityNotFound(_0x4db917,null))[_0x2532('0x20')](removeEntity(_0x4db917,null))[_0x2532('0x2a')](handleError(_0x4db917,null));};exports[_0x2532('0x57')]=function(_0x1750c6,_0x377665){return db[_0x2532('0x3a')][_0x2532('0x57')]()[_0x2532('0x20')](respondWithResult(_0x377665,null))[_0x2532('0x2a')](handleError(_0x377665,null));};var interaction_log=require(_0x2532('0x13'))(_0x2532('0x58'));exports[_0x2532('0x59')]=function(_0x576f6e,_0x7659a5,_0x5b8cc7){var _0x520c2f={'channel':_0x2532('0x5a')};if(_0x576f6e[_0x2532('0x55')]['id']){delete _0x576f6e['body']['id'];}_0x576f6e[_0x2532('0x55')][_0x2532('0x5b')]=!![];_0x576f6e[_0x2532('0x55')][_0x2532('0x5c')]=moment()['format'](_0x2532('0x5d'));_0x576f6e[_0x2532('0x55')][_0x2532('0x5e')]=_0x576f6e[_0x2532('0x55')][_0x2532('0x5e')]||_0x576f6e[_0x2532('0x5f')]['id'];return db[_0x2532('0x3a')][_0x2532('0x53')]({'where':{'id':_0x576f6e['params']['id'],'UserId':null},'include':[{'model':db[_0x2532('0x60')],'as':'Contact'}]})['then'](handleEntityNotFound(_0x7659a5,null))[_0x2532('0x20')](saveUpdates(_0x576f6e[_0x2532('0x55')],null))[_0x2532('0x20')](function(_0x4c769c){if(_0x4c769c){_0x520c2f[_0x2532('0x28')]=_0x4c769c[_0x2532('0x61')]({'plain':!![]});return db['WhatsappInteraction'][_0x2532('0x53')]({'where':{'id':_0x4c769c[_0x2532('0x62')]}});}return null;})[_0x2532('0x20')](handleEntityNotFound(_0x7659a5,null))['then'](function(_0x3c44cd){if(_0x3c44cd){return _0x3c44cd['update']({'UserId':_0x576f6e[_0x2532('0x55')][_0x2532('0x5e')],'read1stAt':_[_0x2532('0x63')](_0x3c44cd[_0x2532('0x64')])?moment()[_0x2532('0x65')](_0x2532('0x5d')):undefined});}return null;})[_0x2532('0x20')](function(_0x5f59a7){if(_0x5f59a7){_0x520c2f[_0x2532('0x66')]=_0x5f59a7[_0x2532('0x61')]({'plain':!![]});interaction_log['info'](_0x2532('0x67'),_0x576f6e[_0x2532('0x5f')]['id'],_0x576f6e[_0x2532('0x5f')][_0x2532('0x37')],_0x576f6e['user'][_0x2532('0x68')],_0x520c2f[_0x2532('0x66')]['id'],_0x576f6e[_0x2532('0x55')]?JSON[_0x2532('0x25')](_0x576f6e['body']):'null');return respondWithRpcPromise(_0x2532('0x69'),_0x2532('0x6a'),_0x520c2f);}return null;})[_0x2532('0x20')](function(_0x2cd4a6){if(_0x2cd4a6){if(_0x576f6e[_0x2532('0x55')][_0x2532('0x6b')]){_0x520c2f[_0x2532('0x28')]['interface']=util['format'](_0x2532('0x6c'),_0x576f6e['user'][_0x2532('0x37')]);_0x520c2f[_0x2532('0x28')][_0x2532('0x6d')]=_0x520c2f[_0x2532('0x6d')];_0x520c2f[_0x2532('0x28')][_0x2532('0x6e')]=_0x2532('0x59');return respondWithRpcPromise(_0x2532('0x6f'),_0x2532('0x6f'),{'event':_0x2532('0x70'),'message':_0x520c2f[_0x2532('0x28')]},client9002)[_0x2532('0x20')](function(){return _0x520c2f;});}return _0x520c2f;}return null;})[_0x2532('0x20')](respondWithResult(_0x7659a5,null))[_0x2532('0x2a')](handleError(_0x7659a5,null));};var interaction_log=require('../../config/logger')('whatsapp-interactions');exports[_0x2532('0x71')]=function(_0x4a8f04,_0x12cec9,_0x474d7d){var _0x45b1e0={'agent':{},'channel':_0x2532('0x5a')};if(_0x4a8f04[_0x2532('0x55')]['id']){delete _0x4a8f04[_0x2532('0x55')]['id'];}_0x4a8f04[_0x2532('0x55')][_0x2532('0x5e')]=_0x4a8f04[_0x2532('0x55')][_0x2532('0x5e')]||_0x4a8f04[_0x2532('0x5f')]['id'];_0x45b1e0[_0x2532('0x72')]['id']=_0x4a8f04[_0x2532('0x55')][_0x2532('0x5e')];return db[_0x2532('0x3a')]['find']({'where':{'id':_0x4a8f04[_0x2532('0x4f')]['id'],'UserId':null}})[_0x2532('0x20')](handleEntityNotFound(_0x12cec9,null))[_0x2532('0x20')](function(_0x238e16){if(_0x238e16){_0x45b1e0[_0x2532('0x28')]=_0x238e16[_0x2532('0x61')]({'plain':!![]});return db[_0x2532('0x73')]['find']({'where':{'id':_0x238e16['WhatsappInteractionId']}});}return null;})['then'](handleEntityNotFound(_0x12cec9,null))[_0x2532('0x20')](function(_0x5b6fa4){if(_0x5b6fa4){_0x45b1e0['interaction']=_0x5b6fa4[_0x2532('0x61')]({'plain':!![]});interaction_log[_0x2532('0x21')]('[WHATSAPPMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x4a8f04[_0x2532('0x5f')]['id'],_0x4a8f04[_0x2532('0x5f')][_0x2532('0x37')],_0x4a8f04['user'][_0x2532('0x68')],_0x45b1e0[_0x2532('0x66')]['id'],_0x4a8f04[_0x2532('0x55')]?JSON[_0x2532('0x25')](_0x4a8f04[_0x2532('0x55')]):'null');return respondWithRpcPromise('RejectMessage',_0x2532('0x74'),_0x45b1e0);}return null;})[_0x2532('0x20')](function(_0x5bc304){if(_0x5bc304){_0x5bc304[_0x2532('0x28')][_0x2532('0x75')]=util[_0x2532('0x65')](_0x2532('0x6c'),_0x4a8f04[_0x2532('0x5f')][_0x2532('0x37')]);_0x5bc304[_0x2532('0x28')][_0x2532('0x6d')]=_0x45b1e0[_0x2532('0x6d')];_0x5bc304[_0x2532('0x28')]['event']='reject';respondWithRpcPromise(_0x2532('0x6f'),_0x2532('0x6f'),{'event':_0x2532('0x76'),'message':_0x5bc304[_0x2532('0x28')]},client9002);return _0x45b1e0;}return null;})['then'](respondWithResult(_0x12cec9,null))[_0x2532('0x2a')](handleError(_0x12cec9,null));};exports['status']=function(_0x3dfde9,_0x339d3c,_0x33f466){if(_0x3dfde9[_0x2532('0x55')]['id']){delete _0x3dfde9[_0x2532('0x55')]['id'];}var _0xa77204;return db[_0x2532('0x3a')][_0x2532('0x53')]({'where':{'id':_0x3dfde9[_0x2532('0x4f')]['id']}})['then'](handleEntityNotFound(_0x339d3c,null))[_0x2532('0x20')](function(_0x267920){if(_0x267920){_0xa77204=_0x267920;return db[_0x2532('0x77')][_0x2532('0x53')]({'where':{'id':_0x267920[_0x2532('0x78')]}});}})[_0x2532('0x20')](handleEntityNotFound(_0x339d3c,null))[_0x2532('0x20')](function(_0x4645ee){if(_0x4645ee){logger[_0x2532('0x24')](_0x2532('0x79'),_0x2532('0x2c'),_0x2532('0x7a'),_0x4645ee[_0x2532('0x3d')],util[_0x2532('0x7b')](_0x3dfde9[_0x2532('0x55')],{'showHidden':![],'depth':null}));switch(_0x4645ee['type']){case'twilio':if(_0x3dfde9[_0x2532('0x55')][_0x2532('0x7c')]&&_0x3dfde9['body'][_0x2532('0x7c')]===_0xa77204[_0x2532('0x7d')]&&_0x3dfde9['body'][_0x2532('0x7e')]&&_0x3dfde9['body'][_0x2532('0x7e')]===_0x2532('0x5b')){return _0xa77204[_0x2532('0x35')]({'read':!![]});}else{logger['error'](_0x2532('0x7f'),_0x2532('0x2c'),_0x2532('0x80'),util[_0x2532('0x7b')](_0x3dfde9[_0x2532('0x55')],{'showHidden':![],'depth':null}));}break;}return _0xa77204;}})[_0x2532('0x20')](respondWithResult(_0x339d3c,null))[_0x2532('0x2a')](handleError(_0x339d3c,null));};
\ No newline at end of file
diff --git a/server/api/whatsappMessage/whatsappMessage.events.js b/server/api/whatsappMessage/whatsappMessage.events.js
index c57b691..008539b 100644
--- a/server/api/whatsappMessage/whatsappMessage.events.js
+++ b/server/api/whatsappMessage/whatsappMessage.events.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xb10b=['hasOwnProperty','hook','events','WhatsappMessage','setMaxListeners','save','remove','emit'];(function(_0x1a0f4c,_0xf66275){var _0x599c9d=function(_0x22e11c){while(--_0x22e11c){_0x1a0f4c['push'](_0x1a0f4c['shift']());}};_0x599c9d(++_0xf66275);}(_0xb10b,0x12a));var _0xbb10=function(_0x1f7201,_0x141b79){_0x1f7201=_0x1f7201-0x0;var _0x289fd2=_0xb10b[_0x1f7201];return _0x289fd2;};'use strict';var EventEmitter=require(_0xbb10('0x0'));var WhatsappMessage=require('../../mysqldb')['db'][_0xbb10('0x1')];var WhatsappMessageEvents=new EventEmitter();WhatsappMessageEvents[_0xbb10('0x2')](0x0);var events={'afterCreate':_0xbb10('0x3'),'afterUpdate':'update','afterDestroy':_0xbb10('0x4')};function emitEvent(_0x9bbed){return function(_0x460981,_0x22320e,_0x49baf4){WhatsappMessageEvents[_0xbb10('0x5')](_0x9bbed+':'+_0x460981['id'],_0x460981);WhatsappMessageEvents['emit'](_0x9bbed,_0x460981);_0x49baf4(null);};}for(var e in events){if(events[_0xbb10('0x6')](e)){var event=events[e];WhatsappMessage[_0xbb10('0x7')](e,emitEvent(event));}}module['exports']=WhatsappMessageEvents;
\ No newline at end of file
+var _0x5f2f=['remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','WhatsappMessage','setMaxListeners','save','update'];(function(_0x42ef5d,_0x2c94f1){var _0xd655c1=function(_0x333505){while(--_0x333505){_0x42ef5d['push'](_0x42ef5d['shift']());}};_0xd655c1(++_0x2c94f1);}(_0x5f2f,0x73));var _0xf5f2=function(_0x40dcd1,_0x5cd1da){_0x40dcd1=_0x40dcd1-0x0;var _0x5c056b=_0x5f2f[_0x40dcd1];return _0x5c056b;};'use strict';var EventEmitter=require(_0xf5f2('0x0'));var WhatsappMessage=require(_0xf5f2('0x1'))['db'][_0xf5f2('0x2')];var WhatsappMessageEvents=new EventEmitter();WhatsappMessageEvents[_0xf5f2('0x3')](0x0);var events={'afterCreate':_0xf5f2('0x4'),'afterUpdate':_0xf5f2('0x5'),'afterDestroy':_0xf5f2('0x6')};function emitEvent(_0x107cf){return function(_0x501fbd,_0x4854b6,_0x1665c7){WhatsappMessageEvents[_0xf5f2('0x7')](_0x107cf+':'+_0x501fbd['id'],_0x501fbd);WhatsappMessageEvents[_0xf5f2('0x7')](_0x107cf,_0x501fbd);_0x1665c7(null);};}for(var e in events){if(events[_0xf5f2('0x8')](e)){var event=events[e];WhatsappMessage[_0xf5f2('0x9')](e,emitEvent(event));}}module[_0xf5f2('0xa')]=WhatsappMessageEvents;
\ No newline at end of file
diff --git a/server/api/whatsappMessage/whatsappMessage.model.js b/server/api/whatsappMessage/whatsappMessage.model.js
index 889f840..7b97dfa 100644
--- a/server/api/whatsappMessage/whatsappMessage.model.js
+++ b/server/api/whatsappMessage/whatsappMessage.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xffec=['token','afterCreate','inspect','WhatsappMessage,\x20%s,\x20%s,\x20%s','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','finally','utf8mb4_unicode_ci','lodash','api','bluebird','request-promise','path','rimraf','./whatsappMessage.attributes','exports','define','messageId','fti_whatsapp_messages','body','FULLTEXT','direction','toLowerCase','out','UserId','WhatsappInteraction','findOne','then','update','createdAt','catch','error','WhatsappAccount','find','WhatsappAccountId','type','twilio','authToken','accountSid','create','whatsapp:','phone','remote','/api/whatsapp/messages/'];(function(_0x4b4fb4,_0x432234){var _0x27fd2f=function(_0x46aabb){while(--_0x46aabb){_0x4b4fb4['push'](_0x4b4fb4['shift']());}};_0x27fd2f(++_0x432234);}(_0xffec,0x88));var _0xcffe=function(_0x35cf6d,_0x2ad75a){_0x35cf6d=_0x35cf6d-0x0;var _0x855c00=_0xffec[_0x35cf6d];return _0x855c00;};'use strict';var _=require(_0xcffe('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xcffe('0x1'));var moment=require('moment');var BPromise=require(_0xcffe('0x2'));var rp=require(_0xcffe('0x3'));var fs=require('fs');var path=require(_0xcffe('0x4'));var rimraf=require(_0xcffe('0x5'));var config=require('../../config/environment');var attributes=require(_0xcffe('0x6'));module[_0xcffe('0x7')]=function(_0x44271d,_0x351588){return _0x44271d[_0xcffe('0x8')]('WhatsappMessage',attributes,{'tableName':'whatsapp_messages','paranoid':![],'indexes':[{'name':_0xcffe('0x9'),'fields':[_0xcffe('0x9')]},{'name':_0xcffe('0xa'),'fields':[_0xcffe('0xb')],'type':_0xcffe('0xc')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x2e757c,_0x46b0ad,_0x4b45d0){var _0x1982f2=_0x44271d['models'];var _0x1fcfa3=_0x2e757c['get']({'plain':!![]});if(_0x1fcfa3[_0xcffe('0xd')][_0xcffe('0xe')]()==='in'||_0x1fcfa3['direction'][_0xcffe('0xe')]()===_0xcffe('0xf')&&!_0x1fcfa3['secret']&&!_['isNil'](_0x1fcfa3[_0xcffe('0x10')])){_0x1982f2[_0xcffe('0x11')][_0xcffe('0x12')]({'where':{'id':_0x1fcfa3['WhatsappInteractionId']}})[_0xcffe('0x13')](function(_0x4d8299){if(_0x4d8299){_0x4d8299[_0xcffe('0x14')]({'lastMsgAt':_0x1fcfa3[_0xcffe('0x15')],'lastMsgDirection':_0x1fcfa3[_0xcffe('0xd')][_0xcffe('0xe')]()});}})[_0xcffe('0x16')](function(_0x127bea){console[_0xcffe('0x17')](_0x127bea);});}if(_0x1fcfa3['direction']===_0xcffe('0xf')&&!_0x1fcfa3['secret']){var _0x4f0cba;_0x1982f2[_0xcffe('0x18')][_0xcffe('0x19')]({'where':{'id':_0x1fcfa3[_0xcffe('0x1a')]},'raw':!![]})['then'](function(_0x4d5039){_0x4f0cba=_0x4d5039;if(_0x4f0cba&&_0x4f0cba[_0xcffe('0x1b')]){switch(_0x4f0cba[_0xcffe('0x1b')]){case _0xcffe('0x1c'):var _0x5b3597=require(_0xcffe('0x1c'));if(_0x4f0cba['accountSid']&&_0x4f0cba[_0xcffe('0x1d')]&&_0x4f0cba['phone']){var _0x10f9ce=new _0x5b3597(_0x4f0cba[_0xcffe('0x1e')],_0x4f0cba[_0xcffe('0x1d')]);_0x10f9ce['messages'][_0xcffe('0x1f')]({'body':_0x1fcfa3[_0xcffe('0xb')],'to':_0xcffe('0x20')+_0x1fcfa3[_0xcffe('0x21')],'from':_0xcffe('0x20')+_0x4f0cba[_0xcffe('0x21')],'statusCallback':_0x4f0cba[_0xcffe('0x22')]+_0xcffe('0x23')+_0x1fcfa3['id']+'/status?token='+_0x4f0cba[_0xcffe('0x24')]})[_0xcffe('0x13')](function(_0x527e93){if(_0x527e93['sid']){return _0x2e757c[_0xcffe('0x14')]({'messageId':_0x527e93['sid']});}})[_0xcffe('0x16')](function(_0x119fc4){logger[_0xcffe('0x17')]('WhatsappMessage,\x20%s,\x20%s,\x20%s',_0xcffe('0x25'),_0xcffe('0x1c'),util[_0xcffe('0x26')](_0x119fc4,{'showHidden':![],'depth':null}));});}else{logger[_0xcffe('0x17')](_0xcffe('0x27'),'afterCreate',_0xcffe('0x1c'),_0xcffe('0x28'));}break;}}})[_0xcffe('0x29')](function(){_0x4b45d0();});}else{_0x4b45d0();}}},'charset':'utf8mb4','collate':_0xcffe('0x2a')});};
\ No newline at end of file
+var _0x6e63=['WhatsappInteraction','findOne','WhatsappInteractionId','then','update','error','WhatsappAccount','type','twilio','accountSid','authToken','phone','messages','create','whatsapp:','/api/whatsapp/messages/','/status?token=','token','sid','WhatsappMessage,\x20%s,\x20%s,\x20%s','afterCreate','inspect','finally','utf8mb4_unicode_ci','lodash','util','moment','rimraf','../../config/environment','./whatsappMessage.attributes','exports','define','WhatsappMessage','whatsapp_messages','messageId','fti_whatsapp_messages','body','FULLTEXT','models','get','direction','toLowerCase','out','secret','isNil','UserId'];(function(_0x5ef905,_0x564b87){var _0x367808=function(_0x14f487){while(--_0x14f487){_0x5ef905['push'](_0x5ef905['shift']());}};_0x367808(++_0x564b87);}(_0x6e63,0x74));var _0x36e6=function(_0x389849,_0x3f0d07){_0x389849=_0x389849-0x0;var _0x65251c=_0x6e63[_0x389849];return _0x65251c;};'use strict';var _=require(_0x36e6('0x0'));var util=require(_0x36e6('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x36e6('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x36e6('0x3'));var config=require(_0x36e6('0x4'));var attributes=require(_0x36e6('0x5'));module[_0x36e6('0x6')]=function(_0x221e0b,_0xbcf4f2){return _0x221e0b[_0x36e6('0x7')](_0x36e6('0x8'),attributes,{'tableName':_0x36e6('0x9'),'paranoid':![],'indexes':[{'name':_0x36e6('0xa'),'fields':[_0x36e6('0xa')]},{'name':_0x36e6('0xb'),'fields':[_0x36e6('0xc')],'type':_0x36e6('0xd')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x3d43cf,_0x501b3c,_0xda22bc){var _0x3b8521=_0x221e0b[_0x36e6('0xe')];var _0x3ce4d1=_0x3d43cf[_0x36e6('0xf')]({'plain':!![]});if(_0x3ce4d1[_0x36e6('0x10')][_0x36e6('0x11')]()==='in'||_0x3ce4d1[_0x36e6('0x10')]['toLowerCase']()===_0x36e6('0x12')&&!_0x3ce4d1[_0x36e6('0x13')]&&!_[_0x36e6('0x14')](_0x3ce4d1[_0x36e6('0x15')])){_0x3b8521[_0x36e6('0x16')][_0x36e6('0x17')]({'where':{'id':_0x3ce4d1[_0x36e6('0x18')]}})[_0x36e6('0x19')](function(_0x2b3cf2){if(_0x2b3cf2){_0x2b3cf2[_0x36e6('0x1a')]({'lastMsgAt':_0x3ce4d1['createdAt'],'lastMsgDirection':_0x3ce4d1[_0x36e6('0x10')][_0x36e6('0x11')]()});}})['catch'](function(_0x51ba69){console[_0x36e6('0x1b')](_0x51ba69);});}if(_0x3ce4d1[_0x36e6('0x10')]===_0x36e6('0x12')&&!_0x3ce4d1[_0x36e6('0x13')]){var _0x3331e2;_0x3b8521[_0x36e6('0x1c')]['find']({'where':{'id':_0x3ce4d1['WhatsappAccountId']},'raw':!![]})[_0x36e6('0x19')](function(_0x27a737){_0x3331e2=_0x27a737;if(_0x3331e2&&_0x3331e2[_0x36e6('0x1d')]){switch(_0x3331e2[_0x36e6('0x1d')]){case'twilio':var _0x18c6ab=require(_0x36e6('0x1e'));if(_0x3331e2[_0x36e6('0x1f')]&&_0x3331e2[_0x36e6('0x20')]&&_0x3331e2[_0x36e6('0x21')]){var _0x1b8088=new _0x18c6ab(_0x3331e2[_0x36e6('0x1f')],_0x3331e2[_0x36e6('0x20')]);_0x1b8088[_0x36e6('0x22')][_0x36e6('0x23')]({'body':_0x3ce4d1[_0x36e6('0xc')],'to':'whatsapp:'+_0x3ce4d1[_0x36e6('0x21')],'from':_0x36e6('0x24')+_0x3331e2['phone'],'statusCallback':_0x3331e2['remote']+_0x36e6('0x25')+_0x3ce4d1['id']+_0x36e6('0x26')+_0x3331e2[_0x36e6('0x27')]})[_0x36e6('0x19')](function(_0xa0754d){if(_0xa0754d[_0x36e6('0x28')]){return _0x3d43cf[_0x36e6('0x1a')]({'messageId':_0xa0754d[_0x36e6('0x28')]});}})['catch'](function(_0x1a5347){logger[_0x36e6('0x1b')](_0x36e6('0x29'),_0x36e6('0x2a'),'twilio',util[_0x36e6('0x2b')](_0x1a5347,{'showHidden':![],'depth':null}));});}else{logger[_0x36e6('0x1b')](_0x36e6('0x29'),_0x36e6('0x2a'),_0x36e6('0x1e'),'Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken');}break;}}})[_0x36e6('0x2c')](function(){_0xda22bc();});}else{_0xda22bc();}}},'charset':'utf8mb4','collate':_0x36e6('0x2d')});};
\ No newline at end of file
diff --git a/server/api/whatsappMessage/whatsappMessage.rpc.js b/server/api/whatsappMessage/whatsappMessage.rpc.js
index 8d17512..62c16b3 100644
--- a/server/api/whatsappMessage/whatsappMessage.rpc.js
+++ b/server/api/whatsappMessage/whatsappMessage.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xfe20=['lodash','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./whatsappMessage.socket','register','request','then','info','request\x20sent','debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','WhatsappMessage,\x20%s,\x20%s','message','result','catch','WhatsappMessage','options','raw','CreateWhatsappMessage'];(function(_0x3a80c3,_0x32f5fe){var _0x3bdb79=function(_0x1536b7){while(--_0x1536b7){_0x3a80c3['push'](_0x3a80c3['shift']());}};_0x3bdb79(++_0x32f5fe);}(_0xfe20,0x1c0));var _0x0fe2=function(_0x4c02ce,_0x1cc41e){_0x4c02ce=_0x4c02ce-0x0;var _0x246b95=_0xfe20[_0x4c02ce];return _0x246b95;};'use strict';var _=require(_0x0fe2('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x0fe2('0x1'));var rs=require(_0x0fe2('0x2'));var fs=require('fs');var Redis=require(_0x0fe2('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0fe2('0x4'));var logger=require(_0x0fe2('0x5'))('rpc');var config=require(_0x0fe2('0x6'));var jayson=require(_0x0fe2('0x7'));var client=jayson['client'][_0x0fe2('0x8')]({'port':0x232a});config[_0x0fe2('0x9')]=_[_0x0fe2('0xa')](config[_0x0fe2('0x9')],{'host':_0x0fe2('0xb'),'port':0x18eb});var socket=require(_0x0fe2('0xc'))(new Redis(config['redis']));require(_0x0fe2('0xd'))[_0x0fe2('0xe')](socket);function respondWithRpcPromise(_0x172fff,_0x3c5083,_0x5210c6){return new BPromise(function(_0x351518,_0x2f4f68){return client[_0x0fe2('0xf')](_0x172fff,_0x5210c6)[_0x0fe2('0x10')](function(_0x495f7b){logger[_0x0fe2('0x11')]('WhatsappMessage,\x20%s,\x20%s',_0x3c5083,_0x0fe2('0x12'));logger[_0x0fe2('0x13')](_0x0fe2('0x14'),_0x3c5083,_0x0fe2('0x12'),JSON[_0x0fe2('0x15')](_0x495f7b));if(_0x495f7b[_0x0fe2('0x16')]){if(_0x495f7b[_0x0fe2('0x16')][_0x0fe2('0x17')]===0x1f4){logger[_0x0fe2('0x16')](_0x0fe2('0x18'),_0x3c5083,_0x495f7b['error'][_0x0fe2('0x19')]);return _0x2f4f68(_0x495f7b[_0x0fe2('0x16')][_0x0fe2('0x19')]);}logger['error'](_0x0fe2('0x18'),_0x3c5083,_0x495f7b['error'][_0x0fe2('0x19')]);return _0x351518(_0x495f7b[_0x0fe2('0x16')][_0x0fe2('0x19')]);}else{logger['info'](_0x0fe2('0x18'),_0x3c5083,_0x0fe2('0x12'));_0x351518(_0x495f7b[_0x0fe2('0x1a')][_0x0fe2('0x19')]);}})[_0x0fe2('0x1b')](function(_0xcd9387){logger[_0x0fe2('0x16')](_0x0fe2('0x18'),_0x3c5083,_0xcd9387);_0x2f4f68(_0xcd9387);});});}exports['CreateWhatsappMessage']=function(_0x45f54a){var _0x25c401=this;return new Promise(function(_0x49f487,_0x40f02f){return db[_0x0fe2('0x1c')]['create'](_0x45f54a['body'],{'raw':_0x45f54a[_0x0fe2('0x1d')]?_0x45f54a[_0x0fe2('0x1d')][_0x0fe2('0x1e')]===undefined?!![]:![]:!![]})[_0x0fe2('0x10')](function(_0x46e415){logger[_0x0fe2('0x11')]('CreateWhatsappMessage',_0x45f54a);logger['debug'](_0x0fe2('0x1f'),_0x45f54a,JSON['stringify'](_0x46e415));_0x49f487(_0x46e415);})[_0x0fe2('0x1b')](function(_0x4355fe){logger['error'](_0x0fe2('0x1f'),_0x4355fe[_0x0fe2('0x19')],_0x45f54a);_0x40f02f(_0x25c401[_0x0fe2('0x16')](0x1f4,_0x4355fe[_0x0fe2('0x19')]));});});};
\ No newline at end of file
+var _0x3a8d=['request','then','info','WhatsappMessage,\x20%s,\x20%s','request\x20sent','debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','CreateWhatsappMessage','WhatsappMessage','create','body','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register'];(function(_0x462450,_0x44f0bd){var _0x391d6a=function(_0x525e26){while(--_0x525e26){_0x462450['push'](_0x462450['shift']());}};_0x391d6a(++_0x44f0bd);}(_0x3a8d,0x1cf));var _0xd3a8=function(_0x3b3210,_0x25e8ed){_0x3b3210=_0x3b3210-0x0;var _0x5b5484=_0x3a8d[_0x3b3210];return _0x5b5484;};'use strict';var _=require(_0xd3a8('0x0'));var util=require(_0xd3a8('0x1'));var moment=require(_0xd3a8('0x2'));var BPromise=require('bluebird');var rs=require(_0xd3a8('0x3'));var fs=require('fs');var Redis=require(_0xd3a8('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xd3a8('0x5'));var logger=require(_0xd3a8('0x6'))(_0xd3a8('0x7'));var config=require(_0xd3a8('0x8'));var jayson=require(_0xd3a8('0x9'));var client=jayson[_0xd3a8('0xa')][_0xd3a8('0xb')]({'port':0x232a});config[_0xd3a8('0xc')]=_[_0xd3a8('0xd')](config[_0xd3a8('0xc')],{'host':_0xd3a8('0xe'),'port':0x18eb});var socket=require(_0xd3a8('0xf'))(new Redis(config[_0xd3a8('0xc')]));require('./whatsappMessage.socket')[_0xd3a8('0x10')](socket);function respondWithRpcPromise(_0x385144,_0x18e75b,_0x45ae45){return new BPromise(function(_0x59861b,_0x33e429){return client[_0xd3a8('0x11')](_0x385144,_0x45ae45)[_0xd3a8('0x12')](function(_0x30e871){logger[_0xd3a8('0x13')](_0xd3a8('0x14'),_0x18e75b,_0xd3a8('0x15'));logger[_0xd3a8('0x16')](_0xd3a8('0x17'),_0x18e75b,_0xd3a8('0x15'),JSON[_0xd3a8('0x18')](_0x30e871));if(_0x30e871[_0xd3a8('0x19')]){if(_0x30e871[_0xd3a8('0x19')]['code']===0x1f4){logger[_0xd3a8('0x19')](_0xd3a8('0x14'),_0x18e75b,_0x30e871[_0xd3a8('0x19')][_0xd3a8('0x1a')]);return _0x33e429(_0x30e871['error'][_0xd3a8('0x1a')]);}logger[_0xd3a8('0x19')](_0xd3a8('0x14'),_0x18e75b,_0x30e871[_0xd3a8('0x19')][_0xd3a8('0x1a')]);return _0x59861b(_0x30e871['error']['message']);}else{logger[_0xd3a8('0x13')](_0xd3a8('0x14'),_0x18e75b,_0xd3a8('0x15'));_0x59861b(_0x30e871['result'][_0xd3a8('0x1a')]);}})[_0xd3a8('0x1b')](function(_0x349e43){logger[_0xd3a8('0x19')]('WhatsappMessage,\x20%s,\x20%s',_0x18e75b,_0x349e43);_0x33e429(_0x349e43);});});}exports[_0xd3a8('0x1c')]=function(_0x3b2e4a){var _0x216b3b=this;return new Promise(function(_0x367365,_0x4226ea){return db[_0xd3a8('0x1d')][_0xd3a8('0x1e')](_0x3b2e4a[_0xd3a8('0x1f')],{'raw':_0x3b2e4a['options']?_0x3b2e4a['options']['raw']===undefined?!![]:![]:!![]})[_0xd3a8('0x12')](function(_0x1dd79b){logger['info'](_0xd3a8('0x1c'),_0x3b2e4a);logger[_0xd3a8('0x16')](_0xd3a8('0x1c'),_0x3b2e4a,JSON[_0xd3a8('0x18')](_0x1dd79b));_0x367365(_0x1dd79b);})[_0xd3a8('0x1b')](function(_0x5593fa){logger[_0xd3a8('0x19')]('CreateWhatsappMessage',_0x5593fa[_0xd3a8('0x1a')],_0x3b2e4a);_0x4226ea(_0x216b3b[_0xd3a8('0x19')](0x1f4,_0x5593fa[_0xd3a8('0x1a')]));});});};
\ No newline at end of file
diff --git a/server/api/whatsappMessage/whatsappMessage.socket.js b/server/api/whatsappMessage/whatsappMessage.socket.js
index 8496514..4b2d7a6 100644
--- a/server/api/whatsappMessage/whatsappMessage.socket.js
+++ b/server/api/whatsappMessage/whatsappMessage.socket.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x1629=['update','length','./whatsappMessage.events','save','remove'];(function(_0x27ccb6,_0x103913){var _0x412043=function(_0x3c1624){while(--_0x3c1624){_0x27ccb6['push'](_0x27ccb6['shift']());}};_0x412043(++_0x103913);}(_0x1629,0x1d8));var _0x9162=function(_0x19d5c6,_0x1092bc){_0x19d5c6=_0x19d5c6-0x0;var _0x21877f=_0x1629[_0x19d5c6];return _0x21877f;};'use strict';var WhatsappMessageEvents=require(_0x9162('0x0'));var events=[_0x9162('0x1'),_0x9162('0x2'),_0x9162('0x3')];function createListener(_0x5045a6,_0x31e5fc){return function(_0x567431){_0x31e5fc['emit'](_0x5045a6,_0x567431);};}function removeListener(_0x16bc88,_0x2a8dc1){return function(){WhatsappMessageEvents['removeListener'](_0x16bc88,_0x2a8dc1);};}exports['register']=function(_0x13368a){for(var _0x1defdd=0x0,_0x4b432e=events[_0x9162('0x4')];_0x1defdd<_0x4b432e;_0x1defdd++){var _0x11d90b=events[_0x1defdd];var _0x168267=createListener('whatsappMessage:'+_0x11d90b,_0x13368a);WhatsappMessageEvents['on'](_0x11d90b,_0x168267);}};
\ No newline at end of file
+var _0xbc6c=['removeListener','register','whatsappMessage:','./whatsappMessage.events','save','update','emit'];(function(_0x46c59b,_0x5635dd){var _0x16dd2d=function(_0x4e7378){while(--_0x4e7378){_0x46c59b['push'](_0x46c59b['shift']());}};_0x16dd2d(++_0x5635dd);}(_0xbc6c,0xc0));var _0xcbc6=function(_0x2f9de6,_0x129db2){_0x2f9de6=_0x2f9de6-0x0;var _0x129303=_0xbc6c[_0x2f9de6];return _0x129303;};'use strict';var WhatsappMessageEvents=require(_0xcbc6('0x0'));var events=[_0xcbc6('0x1'),'remove',_0xcbc6('0x2')];function createListener(_0x10bdc8,_0x1591b0){return function(_0x5575e0){_0x1591b0[_0xcbc6('0x3')](_0x10bdc8,_0x5575e0);};}function removeListener(_0x51db5c,_0x3687b0){return function(){WhatsappMessageEvents[_0xcbc6('0x4')](_0x51db5c,_0x3687b0);};}exports[_0xcbc6('0x5')]=function(_0x4f31af){for(var _0x5b8747=0x0,_0x26331f=events['length'];_0x5b8747<_0x26331f;_0x5b8747++){var _0x453312=events[_0x5b8747];var _0x38409=createListener(_0xcbc6('0x6')+_0x453312,_0x4f31af);WhatsappMessageEvents['on'](_0x453312,_0x38409);}};
\ No newline at end of file
diff --git a/server/api/whatsappQueue/index.js b/server/api/whatsappQueue/index.js
index aecee4f..e6c6792 100644
--- a/server/api/whatsappQueue/index.js
+++ b/server/api/whatsappQueue/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x3a48=['../../components/auth/service','../../components/interaction/service','get','isAuthenticated','describe','/:id/members','/:id/teams','getTeams','/:id/users','getAgents','create','post','addTeams','put','/:id','update','delete','destroy','removeTeams','removeAgents','exports','multer','util','path','connect-timeout','Router'];(function(_0x22a6f6,_0x5d6ea9){var _0x464440=function(_0x147c88){while(--_0x147c88){_0x22a6f6['push'](_0x22a6f6['shift']());}};_0x464440(++_0x5d6ea9);}(_0x3a48,0xe5));var _0x83a4=function(_0x31dd4c,_0x1ec56b){_0x31dd4c=_0x31dd4c-0x0;var _0x45e2fc=_0x3a48[_0x31dd4c];return _0x45e2fc;};'use strict';var multer=require(_0x83a4('0x0'));var util=require(_0x83a4('0x1'));var path=require(_0x83a4('0x2'));var timeout=require(_0x83a4('0x3'));var express=require('express');var router=express[_0x83a4('0x4')]();var auth=require(_0x83a4('0x5'));var interaction=require(_0x83a4('0x6'));var config=require('../../config/environment');var controller=require('./whatsappQueue.controller');router[_0x83a4('0x7')]('/',auth[_0x83a4('0x8')](),controller['index']);router['get']('/describe',auth[_0x83a4('0x8')](),controller[_0x83a4('0x9')]);router[_0x83a4('0x7')]('/:id',auth[_0x83a4('0x8')](),controller['show']);router[_0x83a4('0x7')](_0x83a4('0xa'),auth[_0x83a4('0x8')](),controller['getMembers']);router[_0x83a4('0x7')](_0x83a4('0xb'),auth[_0x83a4('0x8')](),controller[_0x83a4('0xc')]);router[_0x83a4('0x7')](_0x83a4('0xd'),auth['isAuthenticated'](),controller[_0x83a4('0xe')]);router['post']('/',auth[_0x83a4('0x8')](),controller[_0x83a4('0xf')]);router[_0x83a4('0x10')]('/:id/teams',auth[_0x83a4('0x8')](),controller[_0x83a4('0x11')]);router['post'](_0x83a4('0xd'),auth['isAuthenticated'](),controller['addAgents']);router[_0x83a4('0x12')](_0x83a4('0x13'),auth['isAuthenticated'](),controller[_0x83a4('0x14')]);router[_0x83a4('0x15')](_0x83a4('0x13'),auth[_0x83a4('0x8')](),controller[_0x83a4('0x16')]);router['delete'](_0x83a4('0xb'),auth['isAuthenticated'](),controller[_0x83a4('0x17')]);router['delete'](_0x83a4('0xd'),auth[_0x83a4('0x8')](),controller[_0x83a4('0x18')]);module[_0x83a4('0x19')]=router;
\ No newline at end of file
+var _0xf57b=['addTeams','addAgents','put','/:id','update','removeTeams','delete','removeAgents','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappQueue.controller','get','isAuthenticated','index','/describe','describe','show','/:id/members','/:id/teams','getTeams','/:id/users','post'];(function(_0x25fdbb,_0x586736){var _0x35bcc5=function(_0x479abb){while(--_0x479abb){_0x25fdbb['push'](_0x25fdbb['shift']());}};_0x35bcc5(++_0x586736);}(_0xf57b,0x13c));var _0xbf57=function(_0x14d55f,_0xaa0e97){_0x14d55f=_0x14d55f-0x0;var _0x576412=_0xf57b[_0x14d55f];return _0x576412;};'use strict';var multer=require('multer');var util=require(_0xbf57('0x0'));var path=require(_0xbf57('0x1'));var timeout=require(_0xbf57('0x2'));var express=require(_0xbf57('0x3'));var router=express[_0xbf57('0x4')]();var auth=require(_0xbf57('0x5'));var interaction=require(_0xbf57('0x6'));var config=require(_0xbf57('0x7'));var controller=require(_0xbf57('0x8'));router[_0xbf57('0x9')]('/',auth[_0xbf57('0xa')](),controller[_0xbf57('0xb')]);router[_0xbf57('0x9')](_0xbf57('0xc'),auth[_0xbf57('0xa')](),controller[_0xbf57('0xd')]);router[_0xbf57('0x9')]('/:id',auth['isAuthenticated'](),controller[_0xbf57('0xe')]);router[_0xbf57('0x9')](_0xbf57('0xf'),auth['isAuthenticated'](),controller['getMembers']);router[_0xbf57('0x9')](_0xbf57('0x10'),auth['isAuthenticated'](),controller[_0xbf57('0x11')]);router['get'](_0xbf57('0x12'),auth[_0xbf57('0xa')](),controller['getAgents']);router[_0xbf57('0x13')]('/',auth[_0xbf57('0xa')](),controller['create']);router[_0xbf57('0x13')](_0xbf57('0x10'),auth[_0xbf57('0xa')](),controller[_0xbf57('0x14')]);router[_0xbf57('0x13')]('/:id/users',auth[_0xbf57('0xa')](),controller[_0xbf57('0x15')]);router[_0xbf57('0x16')](_0xbf57('0x17'),auth[_0xbf57('0xa')](),controller[_0xbf57('0x18')]);router['delete'](_0xbf57('0x17'),auth['isAuthenticated'](),controller['destroy']);router['delete'](_0xbf57('0x10'),auth['isAuthenticated'](),controller[_0xbf57('0x19')]);router[_0xbf57('0x1a')](_0xbf57('0x12'),auth[_0xbf57('0xa')](),controller[_0xbf57('0x1b')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/whatsappQueue/whatsappQueue.attributes.js b/server/api/whatsappQueue/whatsappQueue.attributes.js
index 2db804b..fc24d27 100644
--- a/server/api/whatsappQueue/whatsappQueue.attributes.js
+++ b/server/api/whatsappQueue/whatsappQueue.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xf7ae=['roundrobin','exports','STRING','name','ENUM','rrmemory'];(function(_0x5385ed,_0x411c7b){var _0x1c1357=function(_0x251c77){while(--_0x251c77){_0x5385ed['push'](_0x5385ed['shift']());}};_0x1c1357(++_0x411c7b);}(_0xf7ae,0xf7));var _0xef7a=function(_0x5418c9,_0x4799bc){_0x5418c9=_0x5418c9-0x0;var _0x20bd40=_0xf7ae[_0x5418c9];return _0x20bd40;};'use strict';var Sequelize=require('sequelize');module[_0xef7a('0x0')]={'name':{'type':Sequelize[_0xef7a('0x1')],'unique':_0xef7a('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xef7a('0x3')](_0xef7a('0x4'),'beepall',_0xef7a('0x5'))},'description':{'type':Sequelize[_0xef7a('0x1')]}};
\ No newline at end of file
+var _0x0d4d=['ENUM','rrmemory','beepall','roundrobin','sequelize','STRING','name','INTEGER'];(function(_0x513d80,_0x1649db){var _0x174463=function(_0x3b3dcd){while(--_0x3b3dcd){_0x513d80['push'](_0x513d80['shift']());}};_0x174463(++_0x1649db);}(_0x0d4d,0x14c));var _0xd0d4=function(_0x17b9b4,_0x2d2296){_0x17b9b4=_0x17b9b4-0x0;var _0x5a7b2e=_0x0d4d[_0x17b9b4];return _0x5a7b2e;};'use strict';var Sequelize=require(_0xd0d4('0x0'));module['exports']={'name':{'type':Sequelize[_0xd0d4('0x1')],'unique':_0xd0d4('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'timeout':{'type':Sequelize[_0xd0d4('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xd0d4('0x4')](_0xd0d4('0x5'),_0xd0d4('0x6'),_0xd0d4('0x7'))},'description':{'type':Sequelize[_0xd0d4('0x1')]}};
\ No newline at end of file
diff --git a/server/api/whatsappQueue/whatsappQueue.controller.js b/server/api/whatsappQueue/whatsappQueue.controller.js
index b49565d..9e1a44c 100644
--- a/server/api/whatsappQueue/whatsappQueue.controller.js
+++ b/server/api/whatsappQueue/whatsappQueue.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x8de5=['set','Content-Range','json','apply','reject','save','then','get','WhatsappQueues','UserProfileResource','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','includeAll','include','WhatsappQueue','findAll','rows','catch','show','params','keys','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','describe','getMembers','findOne','UserWhatsappQueue','User','whatsappPause','createdAt','format','%s/%s','SIP','updatedAt','getTeams','Team','addTeams','ids','Agents','voicePause','interface','flatMap','sequelize','transaction','each','emit','userWhatsappQueue:save','removeTeams','select','field','tq.TeamId','from','team_has_whatsapp_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','clone','push','QueryTypes','SELECT','every','TeamId','includes','all','union','removeAgents','forEach','userWhatsappQueue:remove','addAgents','spread','isArray','getAgents','html-pdf','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','to-csv','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../mysqldb','redis','defaults','./whatsappQueue.socket','sendStatus','status','end','count','offset','limit'];(function(_0x296923,_0x4adaed){var _0x29af70=function(_0x4eeedb){while(--_0x4eeedb){_0x296923['push'](_0x296923['shift']());}};_0x29af70(++_0x4adaed);}(_0x8de5,0x179));var _0x58de=function(_0x4b08e5,_0x2d2fdc){_0x4b08e5=_0x4b08e5-0x0;var _0x399c3d=_0x8de5[_0x4b08e5];return _0x399c3d;};'use strict';var pdf=require(_0x58de('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x58de('0x1'));var zipdir=require(_0x58de('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x58de('0x3'));var moment=require(_0x58de('0x4'));var BPromise=require(_0x58de('0x5'));var Mustache=require(_0x58de('0x6'));var util=require(_0x58de('0x7'));var path=require(_0x58de('0x8'));var sox=require('sox');var csv=require(_0x58de('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x58de('0xa'));var squel=require(_0x58de('0xb'));var crypto=require(_0x58de('0xc'));var jsforce=require(_0x58de('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x58de('0xe'));var Papa=require(_0x58de('0xf'));var Redis=require('ioredis');var authService=require(_0x58de('0x10'));var qs=require(_0x58de('0x11'));var as=require(_0x58de('0x12'));var hardwareService=require(_0x58de('0x13'));var logger=require('../../config/logger')(_0x58de('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x58de('0x15'))['db'];config[_0x58de('0x16')]=_[_0x58de('0x17')](config[_0x58de('0x16')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x58de('0x16')]));require(_0x58de('0x18'))['register'](socket);function respondWithStatusCode(_0x43a2c7,_0x5db5d8){_0x5db5d8=_0x5db5d8||0xcc;return function(_0x11d542){if(_0x11d542){return _0x43a2c7[_0x58de('0x19')](_0x5db5d8);}return _0x43a2c7[_0x58de('0x1a')](_0x5db5d8)[_0x58de('0x1b')]();};}function respondWithResult(_0x459974,_0x2fe0a3){_0x2fe0a3=_0x2fe0a3||0xc8;return function(_0xb3bc23){if(_0xb3bc23){return _0x459974['status'](_0x2fe0a3)['json'](_0xb3bc23);}};}function respondWithFilteredResult(_0x47315f,_0x481280){return function(_0x3378df){if(_0x3378df){var _0x3c35e5=_0x3378df[_0x58de('0x1c')],_0x27e3b1=_0x481280[_0x58de('0x1d')],_0x12eea2=_0x481280[_0x58de('0x1d')]+_0x481280[_0x58de('0x1e')],_0x11805b;if(_0x12eea2>=_0x3c35e5){_0x12eea2=_0x3c35e5;_0x11805b=0xc8;}else{_0x11805b=0xce;}_0x47315f[_0x58de('0x1a')](_0x11805b);return _0x47315f[_0x58de('0x1f')](_0x58de('0x20'),_0x27e3b1+'-'+_0x12eea2+'/'+_0x3c35e5)[_0x58de('0x21')](_0x3378df);}return null;};}function patchUpdates(_0x19a91e){return function(_0x9d33db){try{jsonpatch[_0x58de('0x22')](_0x9d33db,_0x19a91e,!![]);}catch(_0xb02d6f){return BPromise[_0x58de('0x23')](_0xb02d6f);}return _0x9d33db[_0x58de('0x24')]();};}function saveUpdates(_0x5bae6d,_0x2e0bda){return function(_0x2d13e2){if(_0x2d13e2){return _0x2d13e2['update'](_0x5bae6d)[_0x58de('0x25')](function(_0x5e8ae2){return _0x5e8ae2;});}return null;};}function removeEntity(_0x15649f,_0x3aea4c){return function(_0x452bf9){if(_0x452bf9){return _0x452bf9['destroy']()[_0x58de('0x25')](function(){var _0x5b1c6c=_0x452bf9[_0x58de('0x26')]({'plain':!![]});var _0x1fb417=_0x58de('0x27');return db[_0x58de('0x28')][_0x58de('0x29')]({'where':{'type':_0x1fb417,'resourceId':_0x5b1c6c['id']}})[_0x58de('0x25')](function(){return _0x452bf9;});})[_0x58de('0x25')](function(){_0x15649f['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x5964aa,_0x667c9){return function(_0x1fd0b4){if(!_0x1fd0b4){_0x5964aa[_0x58de('0x19')](0x194);}return _0x1fd0b4;};}function handleError(_0x31f5d0,_0x211dca){_0x211dca=_0x211dca||0x1f4;return function(_0x2051ed){logger[_0x58de('0x2a')](_0x2051ed[_0x58de('0x2b')]);if(_0x2051ed[_0x58de('0x2c')]){delete _0x2051ed[_0x58de('0x2c')];}_0x31f5d0['status'](_0x211dca)[_0x58de('0x2d')](_0x2051ed);};}exports[_0x58de('0x2e')]=function(_0x27bd1f,_0x2c47ef){var _0x1c66e0={},_0x1be09a={},_0x463ae1={'count':0x0,'rows':[]};var _0x2ad22d=_[_0x58de('0x2f')](db['WhatsappQueue'][_0x58de('0x30')],function(_0x17aa7d){return{'name':_0x17aa7d[_0x58de('0x31')],'type':_0x17aa7d[_0x58de('0x32')][_0x58de('0x33')]};});_0x1be09a[_0x58de('0x34')]=_[_0x58de('0x2f')](_0x2ad22d,'name');_0x1be09a[_0x58de('0x35')]=_['keys'](_0x27bd1f[_0x58de('0x35')]);_0x1be09a[_0x58de('0x36')]=_[_0x58de('0x37')](_0x1be09a[_0x58de('0x34')],_0x1be09a[_0x58de('0x35')]);_0x1c66e0[_0x58de('0x38')]=_[_0x58de('0x37')](_0x1be09a['model'],qs[_0x58de('0x39')](_0x27bd1f['query']['fields']));_0x1c66e0['attributes']=_0x1c66e0[_0x58de('0x38')][_0x58de('0x3a')]?_0x1c66e0[_0x58de('0x38')]:_0x1be09a[_0x58de('0x34')];if(!_0x27bd1f[_0x58de('0x35')][_0x58de('0x3b')](_0x58de('0x3c'))){_0x1c66e0['limit']=qs[_0x58de('0x1e')](_0x27bd1f[_0x58de('0x35')][_0x58de('0x1e')]);_0x1c66e0[_0x58de('0x1d')]=qs[_0x58de('0x1d')](_0x27bd1f[_0x58de('0x35')]['offset']);}_0x1c66e0[_0x58de('0x3d')]=qs[_0x58de('0x3e')](_0x27bd1f[_0x58de('0x35')]['sort']);_0x1c66e0[_0x58de('0x3f')]=qs['filters'](_[_0x58de('0x40')](_0x27bd1f[_0x58de('0x35')],_0x1be09a['filters']),_0x2ad22d);if(_0x27bd1f[_0x58de('0x35')][_0x58de('0x41')]){_0x1c66e0[_0x58de('0x3f')]=_['merge'](_0x1c66e0[_0x58de('0x3f')],{'$or':_[_0x58de('0x2f')](_0x2ad22d,function(_0x5c55ea){if(_0x5c55ea[_0x58de('0x32')]!==_0x58de('0x42')){var _0x61da81={};_0x61da81[_0x5c55ea[_0x58de('0x2c')]]={'$like':'%'+_0x27bd1f['query']['filter']+'%'};return _0x61da81;}})});}_0x1c66e0=_[_0x58de('0x43')]({},_0x1c66e0,_0x27bd1f['options']);var _0x431aa5={'where':_0x1c66e0[_0x58de('0x3f')]};return db['WhatsappQueue'][_0x58de('0x1c')](_0x431aa5)[_0x58de('0x25')](function(_0x183f84){_0x463ae1[_0x58de('0x1c')]=_0x183f84;if(_0x27bd1f[_0x58de('0x35')][_0x58de('0x44')]){_0x1c66e0[_0x58de('0x45')]=[{'all':!![]}];}return db[_0x58de('0x46')][_0x58de('0x47')](_0x1c66e0);})[_0x58de('0x25')](function(_0x38c303){_0x463ae1[_0x58de('0x48')]=_0x38c303;return _0x463ae1;})[_0x58de('0x25')](respondWithFilteredResult(_0x2c47ef,_0x1c66e0))[_0x58de('0x49')](handleError(_0x2c47ef,null));};exports[_0x58de('0x4a')]=function(_0x2cfa16,_0x3029ec){var _0x3af797={'raw':!![],'where':{'id':_0x2cfa16[_0x58de('0x4b')]['id']}},_0x313f9e={};_0x313f9e[_0x58de('0x34')]=_[_0x58de('0x4c')](db[_0x58de('0x46')][_0x58de('0x30')]);_0x313f9e[_0x58de('0x35')]=_[_0x58de('0x4c')](_0x2cfa16['query']);_0x313f9e[_0x58de('0x36')]=_['intersection'](_0x313f9e[_0x58de('0x34')],_0x313f9e[_0x58de('0x35')]);_0x3af797[_0x58de('0x38')]=_[_0x58de('0x37')](_0x313f9e[_0x58de('0x34')],qs[_0x58de('0x39')](_0x2cfa16['query'][_0x58de('0x39')]));_0x3af797[_0x58de('0x38')]=_0x3af797[_0x58de('0x38')][_0x58de('0x3a')]?_0x3af797[_0x58de('0x38')]:_0x313f9e['model'];if(_0x2cfa16[_0x58de('0x35')]['includeAll']){_0x3af797[_0x58de('0x45')]=[{'all':!![]}];}_0x3af797=_[_0x58de('0x43')]({},_0x3af797,_0x2cfa16[_0x58de('0x4d')]);return db[_0x58de('0x46')][_0x58de('0x4e')](_0x3af797)[_0x58de('0x25')](handleEntityNotFound(_0x3029ec,null))[_0x58de('0x25')](respondWithResult(_0x3029ec,null))[_0x58de('0x49')](handleError(_0x3029ec,null));};exports[_0x58de('0x4f')]=function(_0x42693c,_0x705267){return db[_0x58de('0x46')][_0x58de('0x4f')](_0x42693c[_0x58de('0x50')],{})[_0x58de('0x25')](function(_0x283ffb){var _0xc3dd56=_0x42693c[_0x58de('0x51')][_0x58de('0x26')]({'plain':!![]});if(!_0xc3dd56)throw new Error(_0x58de('0x52'));if(_0xc3dd56[_0x58de('0x53')]===_0x58de('0x51')){var _0x1075ff=_0x283ffb[_0x58de('0x26')]({'plain':!![]});var _0x16911c=_0x58de('0x27');return db['UserProfileSection']['find']({'where':{'name':_0x16911c,'userProfileId':_0xc3dd56['userProfileId']},'raw':!![]})[_0x58de('0x25')](function(_0xe34cd7){if(_0xe34cd7&&_0xe34cd7[_0x58de('0x54')]===0x0){return db[_0x58de('0x28')][_0x58de('0x4f')]({'name':_0x1075ff['name'],'resourceId':_0x1075ff['id'],'type':_0xe34cd7[_0x58de('0x2c')],'sectionId':_0xe34cd7['id']},{})[_0x58de('0x25')](function(){return _0x283ffb;});}else{return _0x283ffb;}})[_0x58de('0x49')](function(_0x3b9ed5){logger[_0x58de('0x2a')](_0x58de('0x55'),_0x3b9ed5);throw _0x3b9ed5;});}return _0x283ffb;})['then'](respondWithResult(_0x705267,0xc9))[_0x58de('0x49')](handleError(_0x705267,null));};exports[_0x58de('0x56')]=function(_0x48a9f,_0x53df57){if(_0x48a9f['body']['id']){delete _0x48a9f['body']['id'];}return db[_0x58de('0x46')]['find']({'where':{'id':_0x48a9f[_0x58de('0x4b')]['id']}})['then'](handleEntityNotFound(_0x53df57,null))[_0x58de('0x25')](saveUpdates(_0x48a9f[_0x58de('0x50')],null))[_0x58de('0x25')](respondWithResult(_0x53df57,null))[_0x58de('0x49')](handleError(_0x53df57,null));};exports[_0x58de('0x29')]=function(_0x19f3ad,_0x3a4c29){return db[_0x58de('0x46')][_0x58de('0x4e')]({'where':{'id':_0x19f3ad[_0x58de('0x4b')]['id']}})[_0x58de('0x25')](handleEntityNotFound(_0x3a4c29,null))[_0x58de('0x25')](removeEntity(_0x3a4c29,null))[_0x58de('0x49')](handleError(_0x3a4c29,null));};exports[_0x58de('0x57')]=function(_0x340065,_0x296f01){return db[_0x58de('0x46')][_0x58de('0x57')]()['then'](respondWithResult(_0x296f01,null))[_0x58de('0x49')](handleError(_0x296f01,null));};exports[_0x58de('0x58')]=function(_0x39faae,_0x4ea2bf,_0x1cec26){var _0x4c405c={'raw':!![],'where':{}},_0x55c1da={},_0x11a44f;return db['WhatsappQueue'][_0x58de('0x59')]({'where':{'id':_0x39faae[_0x58de('0x4b')]['id']}})['then'](handleEntityNotFound(_0x4ea2bf,null))['then'](function(_0x1fb1f6){if(_0x1fb1f6){_0x11a44f=_0x1fb1f6['get']({'plain':!![]});_0x55c1da['model']=_[_0x58de('0x4c')](db[_0x58de('0x5a')]['rawAttributes']);_0x55c1da[_0x58de('0x35')]=_[_0x58de('0x4c')](_0x39faae['query']);_0x55c1da[_0x58de('0x36')]=_[_0x58de('0x37')](_0x55c1da[_0x58de('0x34')],_0x55c1da[_0x58de('0x35')]);_0x4c405c[_0x58de('0x38')]=_[_0x58de('0x37')](_0x55c1da[_0x58de('0x34')],qs[_0x58de('0x39')](_0x39faae['query'][_0x58de('0x39')]));_0x4c405c['attributes']=_0x4c405c[_0x58de('0x38')][_0x58de('0x3a')]?_0x4c405c[_0x58de('0x38')]:_0x55c1da[_0x58de('0x34')];if(!_0x39faae[_0x58de('0x35')][_0x58de('0x3b')](_0x58de('0x3c'))){_0x4c405c['limit']=qs[_0x58de('0x1e')](_0x39faae[_0x58de('0x35')][_0x58de('0x1e')]);_0x4c405c[_0x58de('0x1d')]=qs[_0x58de('0x1d')](_0x39faae['query']['offset']);}_0x4c405c['order']=qs[_0x58de('0x3e')](_0x39faae[_0x58de('0x35')][_0x58de('0x3e')]);_0x4c405c[_0x58de('0x3f')]=qs['filters'](_[_0x58de('0x40')](_0x39faae[_0x58de('0x35')],_0x55c1da[_0x58de('0x36')]));_0x4c405c[_0x58de('0x3f')]['WhatsappQueueId']=_0x1fb1f6['id'];if(_0x39faae[_0x58de('0x35')][_0x58de('0x41')]){_0x4c405c[_0x58de('0x3f')]=_['merge'](_0x4c405c['where'],{'$or':_[_0x58de('0x2f')](_0x4c405c['attributes'],function(_0x750d2){var _0x3d9c4b={};_0x3d9c4b[_0x750d2]={'$like':'%'+_0x39faae[_0x58de('0x35')][_0x58de('0x41')]+'%'};return _0x3d9c4b;})});}_0x4c405c=_['merge']({},_0x4c405c,_0x39faae[_0x58de('0x4d')]);return db['UserWhatsappQueue'][_0x58de('0x47')](_0x4c405c);}})['then'](function(_0x1e9e88){if(_0x1e9e88){return db[_0x58de('0x5b')]['findAndCountAll']({'where':{'id':_[_0x58de('0x2f')](_0x1e9e88,'UserId'),'role':'agent'},'attributes':['id',_0x58de('0x2c'),_0x58de('0x5c'),'updatedAt',_0x58de('0x5d')]});}})[_0x58de('0x25')](function(_0x9afdf1){if(_0x9afdf1){return{'count':_0x9afdf1['count'],'rows':_[_0x58de('0x2f')](_0x9afdf1['rows'],function(_0x1e7fee){return{'membername':_0x1e7fee[_0x58de('0x2c')],'UserId':_0x1e7fee['id'],'queue_name':_0x11a44f[_0x58de('0x2c')],'WhatsappQueueId':_0x11a44f['id'],'interface':util[_0x58de('0x5e')](_0x58de('0x5f'),_0x58de('0x60'),_0x1e7fee[_0x58de('0x2c')]),'penalty':0x0,'paused':_0x1e7fee[_0x58de('0x5c')],'createdAt':_0x1e7fee[_0x58de('0x5d')],'updatedAt':_0x1e7fee[_0x58de('0x61')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x58de('0x25')](respondWithFilteredResult(_0x4ea2bf,_0x4c405c))['catch'](handleError(_0x4ea2bf,null));};exports[_0x58de('0x62')]=function(_0x117fb9,_0x38746b,_0x4d3ce2){var _0x4504cf={};var _0x3d3bd6={};var _0x26f086;var _0xa67336;return db['WhatsappQueue'][_0x58de('0x59')]({'where':{'id':_0x117fb9[_0x58de('0x4b')]['id']}})['then'](handleEntityNotFound(_0x38746b,null))['then'](function(_0x2b1a3b){if(_0x2b1a3b){_0x26f086=_0x2b1a3b;_0x3d3bd6[_0x58de('0x34')]=_[_0x58de('0x4c')](db[_0x58de('0x63')][_0x58de('0x30')]);_0x3d3bd6[_0x58de('0x35')]=_[_0x58de('0x4c')](_0x117fb9['query']);_0x3d3bd6['filters']=_['intersection'](_0x3d3bd6[_0x58de('0x34')],_0x3d3bd6[_0x58de('0x35')]);_0x4504cf['attributes']=_[_0x58de('0x37')](_0x3d3bd6[_0x58de('0x34')],qs[_0x58de('0x39')](_0x117fb9[_0x58de('0x35')][_0x58de('0x39')]));_0x4504cf['attributes']=_0x4504cf[_0x58de('0x38')][_0x58de('0x3a')]?_0x4504cf['attributes']:_0x3d3bd6[_0x58de('0x34')];_0x4504cf[_0x58de('0x3d')]=qs['sort'](_0x117fb9[_0x58de('0x35')][_0x58de('0x3e')]);_0x4504cf[_0x58de('0x3f')]=qs[_0x58de('0x36')](_[_0x58de('0x40')](_0x117fb9['query'],_0x3d3bd6[_0x58de('0x36')]));if(_0x117fb9['query'][_0x58de('0x41')]){_0x4504cf[_0x58de('0x3f')]=_[_0x58de('0x43')](_0x4504cf[_0x58de('0x3f')],{'$or':_[_0x58de('0x2f')](_0x4504cf['attributes'],function(_0x4412ff){var _0x3df38b={};_0x3df38b[_0x4412ff]={'$like':'%'+_0x117fb9['query'][_0x58de('0x41')]+'%'};return _0x3df38b;})});}_0x4504cf=_[_0x58de('0x43')]({},_0x4504cf,_0x117fb9[_0x58de('0x4d')]);return _0x26f086[_0x58de('0x62')](_0x4504cf);}})[_0x58de('0x25')](function(_0x546a10){if(_0x546a10){_0xa67336=_0x546a10[_0x58de('0x3a')];if(!_0x117fb9[_0x58de('0x35')]['hasOwnProperty'](_0x58de('0x3c'))){_0x4504cf['limit']=qs[_0x58de('0x1e')](_0x117fb9[_0x58de('0x35')]['limit']);_0x4504cf[_0x58de('0x1d')]=qs[_0x58de('0x1d')](_0x117fb9[_0x58de('0x35')][_0x58de('0x1d')]);}return _0x26f086['getTeams'](_0x4504cf);}})[_0x58de('0x25')](function(_0x39ca04){if(_0x39ca04){return _0x39ca04?{'count':_0xa67336,'rows':_0x39ca04}:null;}})['then'](respondWithResult(_0x38746b,null))[_0x58de('0x49')](handleError(_0x38746b,null));};exports[_0x58de('0x64')]=function(_0x10ec33,_0x53e293,_0x4a5e51){var _0x41e356=_0x10ec33[_0x58de('0x50')][_0x58de('0x65')];return db[_0x58de('0x63')][_0x58de('0x47')]({'where':{'id':_0x41e356},'attributes':['id'],'include':[{'model':db[_0x58de('0x5b')],'as':_0x58de('0x66'),'attributes':['id','name','online',_0x58de('0x67'),_0x58de('0x68')],'raw':!![]}]})['then'](function(_0x5a34a2){if(_0x5a34a2){var _0x235299=_[_0x58de('0x69')](_0x5a34a2,function(_0x29bfc9){var _0x1dd581=_0x29bfc9['get']({'plain':!![]});return _0x1dd581['Agents'];});return db[_0x58de('0x46')][_0x58de('0x4e')]({'where':{'id':_0x10ec33[_0x58de('0x4b')]['id']}})[_0x58de('0x25')](function(_0x188b37){return db[_0x58de('0x6a')][_0x58de('0x6b')](function(_0x479cc8){return _0x188b37[_0x58de('0x64')](_0x41e356,{'transaction':_0x479cc8})[_0x58de('0x25')](function(){return BPromise[_0x58de('0x6c')](_0x235299,function(_0x527290){return db['UserWhatsappQueue']['findOrCreate']({'where':{'UserId':_0x527290['id'],'WhatsappQueueId':_0x10ec33[_0x58de('0x4b')]['id']},'transaction':_0x479cc8});});})[_0x58de('0x25')](function(){_0x235299['forEach'](function(_0x354d38){socket[_0x58de('0x6d')](_0x58de('0x6e'),{'UserId':_0x354d38['id'],'WhatsappQueueId':_0x188b37['id']});});});});});}})['then'](respondWithStatusCode(_0x53e293,null))['catch'](handleError(_0x53e293,null));};exports[_0x58de('0x6f')]=function(_0x38dd9b,_0x5a2316,_0x5bee81){return db[_0x58de('0x63')][_0x58de('0x47')]({'where':{'id':_0x38dd9b['query']['ids']},'attributes':['id'],'include':[{'model':db[_0x58de('0x5b')],'as':_0x58de('0x66'),'attributes':['id'],'raw':!![]}]})[_0x58de('0x25')](handleEntityNotFound(_0x5a2316,null))[_0x58de('0x25')](function(_0x2d24eb){var _0x596055=_[_0x58de('0x2f')](_0x2d24eb,'id');var _0x34a952=[];var _0x2cb02b=[];var _0x424ee8=squel[_0x58de('0x70')]();_0x424ee8[_0x58de('0x71')](_0x58de('0x72'))[_0x58de('0x73')](_0x58de('0x74'),'tq')[_0x58de('0x75')](_0x58de('0x76'),'ut',_0x58de('0x77'))['where']('WhatsappQueueId\x20=\x20?',_0x38dd9b['params']['id']);for(var _0x4d6ca8=0x0;_0x4d6ca8<_0x2d24eb[_0x58de('0x3a')];_0x4d6ca8+=0x1){let _0x22ba74=_0x2d24eb[_0x4d6ca8];for(var _0x570e72=0x0;_0x570e72<_0x22ba74['Agents'][_0x58de('0x3a')];_0x570e72+=0x1){let _0x14216f=_0x22ba74[_0x58de('0x66')][_0x570e72];var _0x4d2a62=_0x424ee8[_0x58de('0x78')]();_0x4d2a62['where']('ut.UserId\x20=\x20?',_0x14216f['id']);_0x2cb02b[_0x58de('0x79')](db['sequelize'][_0x58de('0x35')](_0x4d2a62['toString'](),{'type':db[_0x58de('0x6a')][_0x58de('0x7a')][_0x58de('0x7b')]})[_0x58de('0x25')](function(_0x21c78e){if(_0x21c78e[_0x58de('0x3a')]===0x1){return _0x14216f['id'];}else{var _0x544c22=_[_0x58de('0x7c')](_['map'](_0x21c78e,_0x58de('0x7d')),function(_0x296d70){return _[_0x58de('0x7e')](_0x596055,_0x296d70);});if(_0x544c22){return _0x14216f['id'];}}}));}}return BPromise[_0x58de('0x7f')](_0x2cb02b)[_0x58de('0x25')](function(_0x5d4ef5){_0x34a952=_(_0x34a952)[_0x58de('0x80')](_0x5d4ef5)['compact']()['value']();return db[_0x58de('0x46')][_0x58de('0x4e')]({'where':{'id':_0x38dd9b['params']['id']}})[_0x58de('0x25')](function(_0x43b3c6){return db['sequelize'][_0x58de('0x6b')](function(_0x251d89){return _0x43b3c6[_0x58de('0x6f')](_0x38dd9b[_0x58de('0x35')]['ids'],{'transaction':_0x251d89})[_0x58de('0x25')](function(){if(!_['isEmpty'](_0x34a952)){return _0x43b3c6[_0x58de('0x81')](_0x34a952,{'transaction':_0x251d89});}})[_0x58de('0x25')](function(){_0x34a952[_0x58de('0x82')](function(_0x6f5f02){socket[_0x58de('0x6d')](_0x58de('0x83'),{'UserId':_0x6f5f02,'WhatsappQueueId':_0x43b3c6['id']});});});});});});})['then'](respondWithStatusCode(_0x5a2316,null))['catch'](handleError(_0x5a2316,null));};exports[_0x58de('0x84')]=function(_0x2b9a04,_0x2f8a4c,_0x1abe69){return db[_0x58de('0x46')][_0x58de('0x4e')]({'where':{'id':_0x2b9a04[_0x58de('0x4b')]['id']}})[_0x58de('0x25')](handleEntityNotFound(_0x2f8a4c,null))['then'](function(_0x48c248){if(_0x48c248){return _0x48c248[_0x58de('0x84')](_0x2b9a04[_0x58de('0x50')][_0x58de('0x65')],_['omit'](_0x2b9a04['body'],[_0x58de('0x65'),'id'])||{})[_0x58de('0x85')](function(_0x1a23b9){for(var _0xce1221=0x0;_0xce1221<_0x2b9a04[_0x58de('0x50')][_0x58de('0x65')]['length'];_0xce1221+=0x1){socket[_0x58de('0x6d')](_0x58de('0x6e'),{'UserId':_0x2b9a04[_0x58de('0x50')][_0x58de('0x65')][_0xce1221],'WhatsappQueueId':_0x2b9a04[_0x58de('0x4b')]['id']});}return _0x1a23b9;});}})['then'](respondWithResult(_0x2f8a4c,null))[_0x58de('0x49')](handleError(_0x2f8a4c,null));};exports[_0x58de('0x81')]=function(_0x296949,_0x1722da,_0x3abc4a){return db['WhatsappQueue']['find']({'where':{'id':_0x296949[_0x58de('0x4b')]['id']}})[_0x58de('0x25')](handleEntityNotFound(_0x1722da,null))[_0x58de('0x25')](function(_0x45648b){if(_0x45648b){return _0x45648b[_0x58de('0x81')](_0x296949['query'][_0x58de('0x65')])[_0x58de('0x25')](function(){if(_[_0x58de('0x86')](_0x296949['query'][_0x58de('0x65')])){for(var _0x199946=0x0;_0x199946<_0x296949[_0x58de('0x35')][_0x58de('0x65')][_0x58de('0x3a')];_0x199946+=0x1){socket['emit'](_0x58de('0x83'),{'UserId':Number(_0x296949[_0x58de('0x35')][_0x58de('0x65')][_0x199946]),'WhatsappQueueId':Number(_0x296949[_0x58de('0x4b')]['id'])});}}else{socket[_0x58de('0x6d')](_0x58de('0x83'),{'UserId':Number(_0x296949[_0x58de('0x35')][_0x58de('0x65')]),'WhatsappQueueId':Number(_0x296949[_0x58de('0x4b')]['id'])});}});}})[_0x58de('0x25')](respondWithStatusCode(_0x1722da,null))[_0x58de('0x49')](handleError(_0x1722da,null));};exports[_0x58de('0x87')]=function(_0x1b9619,_0x3f532a,_0x325f49){var _0x2a89e4={};var _0x37320e={};var _0x1f5754;var _0x1bc7e7;return db[_0x58de('0x46')][_0x58de('0x59')]({'where':{'id':_0x1b9619[_0x58de('0x4b')]['id']}})[_0x58de('0x25')](handleEntityNotFound(_0x3f532a,null))['then'](function(_0x3dd17a){if(_0x3dd17a){_0x1f5754=_0x3dd17a;_0x37320e[_0x58de('0x34')]=_[_0x58de('0x4c')](db[_0x58de('0x5b')][_0x58de('0x30')]);_0x37320e[_0x58de('0x35')]=_[_0x58de('0x4c')](_0x1b9619['query']);_0x37320e[_0x58de('0x36')]=_[_0x58de('0x37')](_0x37320e[_0x58de('0x34')],_0x37320e[_0x58de('0x35')]);_0x2a89e4[_0x58de('0x38')]=_['intersection'](_0x37320e[_0x58de('0x34')],qs[_0x58de('0x39')](_0x1b9619[_0x58de('0x35')][_0x58de('0x39')]));_0x2a89e4[_0x58de('0x38')]=_0x2a89e4[_0x58de('0x38')][_0x58de('0x3a')]?_0x2a89e4[_0x58de('0x38')]:_0x37320e[_0x58de('0x34')];_0x2a89e4[_0x58de('0x3d')]=qs[_0x58de('0x3e')](_0x1b9619[_0x58de('0x35')][_0x58de('0x3e')]);_0x2a89e4[_0x58de('0x3f')]=qs[_0x58de('0x36')](_['pick'](_0x1b9619[_0x58de('0x35')],_0x37320e[_0x58de('0x36')]));if(_0x1b9619[_0x58de('0x35')][_0x58de('0x41')]){_0x2a89e4['where']=_['merge'](_0x2a89e4['where'],{'$or':_['map'](_0x2a89e4[_0x58de('0x38')],function(_0x566e09){var _0x57d34e={};_0x57d34e[_0x566e09]={'$like':'%'+_0x1b9619[_0x58de('0x35')][_0x58de('0x41')]+'%'};return _0x57d34e;})});}_0x2a89e4=_[_0x58de('0x43')]({},_0x2a89e4,_0x1b9619[_0x58de('0x4d')]);return _0x1f5754['getAgents'](_0x2a89e4);}})[_0x58de('0x25')](function(_0x35e801){if(_0x35e801){_0x1bc7e7=_0x35e801['length'];if(!_0x1b9619['query'][_0x58de('0x3b')](_0x58de('0x3c'))){_0x2a89e4[_0x58de('0x1e')]=qs[_0x58de('0x1e')](_0x1b9619['query'][_0x58de('0x1e')]);_0x2a89e4[_0x58de('0x1d')]=qs['offset'](_0x1b9619['query'][_0x58de('0x1d')]);}return _0x1f5754['getAgents'](_0x2a89e4);}})[_0x58de('0x25')](function(_0x5bc3e9){if(_0x5bc3e9){return _0x5bc3e9?{'count':_0x1bc7e7,'rows':_0x5bc3e9}:null;}})[_0x58de('0x25')](respondWithResult(_0x3f532a,null))[_0x58de('0x49')](handleError(_0x3f532a,null));};
\ No newline at end of file
+var _0xc6fb=['./whatsappQueue.socket','sendStatus','status','count','offset','limit','set','json','apply','save','update','destroy','then','get','WhatsappQueues','end','error','stack','name','index','map','WhatsappQueue','rawAttributes','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filters','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','create','body','user','role','UserProfileSection','find','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','pick','WhatsappQueueId','UserWhatsappQueue','User','findAndCountAll','UserId','agent','whatsappPause','updatedAt','createdAt','format','SIP','getTeams','findOne','Team','nolimit','addTeams','Agents','online','voicePause','interface','flatMap','findOrCreate','forEach','emit','userWhatsappQueue:save','ids','field','tq.TeamId','from','team_has_whatsapp_queues','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','WhatsappQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','toString','QueryTypes','SELECT','every','TeamId','includes','union','compact','value','sequelize','transaction','removeTeams','isEmpty','removeAgents','addAgents','omit','spread','isArray','userWhatsappQueue:remove','getAgents','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','redis','localhost'];(function(_0x43a1b8,_0x1c90c8){var _0x324ecc=function(_0x53a93b){while(--_0x53a93b){_0x43a1b8['push'](_0x43a1b8['shift']());}};_0x324ecc(++_0x1c90c8);}(_0xc6fb,0x104));var _0xbc6f=function(_0x3e0763,_0x3d12be){_0x3e0763=_0x3e0763-0x0;var _0x351ca2=_0xc6fb[_0x3e0763];return _0x351ca2;};'use strict';var pdf=require(_0xbc6f('0x0'));var emlformat=require(_0xbc6f('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xbc6f('0x2'));var jsonpatch=require(_0xbc6f('0x3'));var rp=require(_0xbc6f('0x4'));var moment=require(_0xbc6f('0x5'));var BPromise=require(_0xbc6f('0x6'));var Mustache=require(_0xbc6f('0x7'));var util=require(_0xbc6f('0x8'));var path=require(_0xbc6f('0x9'));var sox=require(_0xbc6f('0xa'));var csv=require('to-csv');var ejs=require(_0xbc6f('0xb'));var fs=require('fs');var _=require(_0xbc6f('0xc'));var squel=require(_0xbc6f('0xd'));var crypto=require(_0xbc6f('0xe'));var jsforce=require(_0xbc6f('0xf'));var deskjs=require(_0xbc6f('0x10'));var toCsv=require(_0xbc6f('0x11'));var querystring=require(_0xbc6f('0x12'));var Papa=require(_0xbc6f('0x13'));var Redis=require(_0xbc6f('0x14'));var authService=require(_0xbc6f('0x15'));var qs=require('../../components/parsers/qs');var as=require(_0xbc6f('0x16'));var hardwareService=require(_0xbc6f('0x17'));var logger=require(_0xbc6f('0x18'))('api');var utils=require(_0xbc6f('0x19'));var config=require(_0xbc6f('0x1a'));var db=require(_0xbc6f('0x1b'))['db'];config[_0xbc6f('0x1c')]=_['defaults'](config[_0xbc6f('0x1c')],{'host':_0xbc6f('0x1d'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xbc6f('0x1c')]));require(_0xbc6f('0x1e'))['register'](socket);function respondWithStatusCode(_0x520aa7,_0x51e787){_0x51e787=_0x51e787||0xcc;return function(_0x133594){if(_0x133594){return _0x520aa7[_0xbc6f('0x1f')](_0x51e787);}return _0x520aa7['status'](_0x51e787)['end']();};}function respondWithResult(_0x5c16a1,_0x1863d2){_0x1863d2=_0x1863d2||0xc8;return function(_0x15b36e){if(_0x15b36e){return _0x5c16a1[_0xbc6f('0x20')](_0x1863d2)['json'](_0x15b36e);}};}function respondWithFilteredResult(_0xce6e4e,_0x77f30b){return function(_0x43ba9e){if(_0x43ba9e){var _0x296882=_0x43ba9e[_0xbc6f('0x21')],_0x38e607=_0x77f30b[_0xbc6f('0x22')],_0x25af2b=_0x77f30b[_0xbc6f('0x22')]+_0x77f30b[_0xbc6f('0x23')],_0x12225f;if(_0x25af2b>=_0x296882){_0x25af2b=_0x296882;_0x12225f=0xc8;}else{_0x12225f=0xce;}_0xce6e4e[_0xbc6f('0x20')](_0x12225f);return _0xce6e4e[_0xbc6f('0x24')]('Content-Range',_0x38e607+'-'+_0x25af2b+'/'+_0x296882)[_0xbc6f('0x25')](_0x43ba9e);}return null;};}function patchUpdates(_0x167a89){return function(_0x173bd7){try{jsonpatch[_0xbc6f('0x26')](_0x173bd7,_0x167a89,!![]);}catch(_0x7aba84){return BPromise['reject'](_0x7aba84);}return _0x173bd7[_0xbc6f('0x27')]();};}function saveUpdates(_0xb53c4a,_0x319592){return function(_0xfe44fd){if(_0xfe44fd){return _0xfe44fd[_0xbc6f('0x28')](_0xb53c4a)['then'](function(_0x4445e6){return _0x4445e6;});}return null;};}function removeEntity(_0x4b8b29,_0x4fdba3){return function(_0xc10e2e){if(_0xc10e2e){return _0xc10e2e[_0xbc6f('0x29')]()[_0xbc6f('0x2a')](function(){var _0x1fccff=_0xc10e2e[_0xbc6f('0x2b')]({'plain':!![]});var _0x150756=_0xbc6f('0x2c');return db['UserProfileResource'][_0xbc6f('0x29')]({'where':{'type':_0x150756,'resourceId':_0x1fccff['id']}})[_0xbc6f('0x2a')](function(){return _0xc10e2e;});})['then'](function(){_0x4b8b29[_0xbc6f('0x20')](0xcc)[_0xbc6f('0x2d')]();});}};}function handleEntityNotFound(_0x555053,_0xd228c0){return function(_0xc907f5){if(!_0xc907f5){_0x555053[_0xbc6f('0x1f')](0x194);}return _0xc907f5;};}function handleError(_0x31b8b0,_0x2af641){_0x2af641=_0x2af641||0x1f4;return function(_0x5a9b93){logger[_0xbc6f('0x2e')](_0x5a9b93[_0xbc6f('0x2f')]);if(_0x5a9b93[_0xbc6f('0x30')]){delete _0x5a9b93[_0xbc6f('0x30')];}_0x31b8b0[_0xbc6f('0x20')](_0x2af641)['send'](_0x5a9b93);};}exports[_0xbc6f('0x31')]=function(_0x53d841,_0x55d7ec){var _0x2a44d3={},_0x1d1446={},_0x4c9e80={'count':0x0,'rows':[]};var _0x17bb1d=_[_0xbc6f('0x32')](db[_0xbc6f('0x33')][_0xbc6f('0x34')],function(_0x28a358){return{'name':_0x28a358['fieldName'],'type':_0x28a358['type'][_0xbc6f('0x35')]};});_0x1d1446[_0xbc6f('0x36')]=_[_0xbc6f('0x32')](_0x17bb1d,_0xbc6f('0x30'));_0x1d1446[_0xbc6f('0x37')]=_[_0xbc6f('0x38')](_0x53d841['query']);_0x1d1446['filters']=_[_0xbc6f('0x39')](_0x1d1446[_0xbc6f('0x36')],_0x1d1446[_0xbc6f('0x37')]);_0x2a44d3[_0xbc6f('0x3a')]=_[_0xbc6f('0x39')](_0x1d1446[_0xbc6f('0x36')],qs['fields'](_0x53d841[_0xbc6f('0x37')][_0xbc6f('0x3b')]));_0x2a44d3[_0xbc6f('0x3a')]=_0x2a44d3[_0xbc6f('0x3a')][_0xbc6f('0x3c')]?_0x2a44d3[_0xbc6f('0x3a')]:_0x1d1446[_0xbc6f('0x36')];if(!_0x53d841[_0xbc6f('0x37')][_0xbc6f('0x3d')]('nolimit')){_0x2a44d3[_0xbc6f('0x23')]=qs['limit'](_0x53d841['query'][_0xbc6f('0x23')]);_0x2a44d3[_0xbc6f('0x22')]=qs[_0xbc6f('0x22')](_0x53d841[_0xbc6f('0x37')][_0xbc6f('0x22')]);}_0x2a44d3[_0xbc6f('0x3e')]=qs[_0xbc6f('0x3f')](_0x53d841[_0xbc6f('0x37')][_0xbc6f('0x3f')]);_0x2a44d3[_0xbc6f('0x40')]=qs[_0xbc6f('0x41')](_['pick'](_0x53d841[_0xbc6f('0x37')],_0x1d1446[_0xbc6f('0x41')]),_0x17bb1d);if(_0x53d841['query'][_0xbc6f('0x42')]){_0x2a44d3[_0xbc6f('0x40')]=_[_0xbc6f('0x43')](_0x2a44d3[_0xbc6f('0x40')],{'$or':_[_0xbc6f('0x32')](_0x17bb1d,function(_0x3116f5){if(_0x3116f5[_0xbc6f('0x44')]!==_0xbc6f('0x45')){var _0x453f3f={};_0x453f3f[_0x3116f5[_0xbc6f('0x30')]]={'$like':'%'+_0x53d841[_0xbc6f('0x37')]['filter']+'%'};return _0x453f3f;}})});}_0x2a44d3=_[_0xbc6f('0x43')]({},_0x2a44d3,_0x53d841[_0xbc6f('0x46')]);var _0x25d847={'where':_0x2a44d3[_0xbc6f('0x40')]};return db[_0xbc6f('0x33')][_0xbc6f('0x21')](_0x25d847)['then'](function(_0x4e26af){_0x4c9e80[_0xbc6f('0x21')]=_0x4e26af;if(_0x53d841[_0xbc6f('0x37')][_0xbc6f('0x47')]){_0x2a44d3[_0xbc6f('0x48')]=[{'all':!![]}];}return db[_0xbc6f('0x33')][_0xbc6f('0x49')](_0x2a44d3);})[_0xbc6f('0x2a')](function(_0x31abd5){_0x4c9e80[_0xbc6f('0x4a')]=_0x31abd5;return _0x4c9e80;})[_0xbc6f('0x2a')](respondWithFilteredResult(_0x55d7ec,_0x2a44d3))[_0xbc6f('0x4b')](handleError(_0x55d7ec,null));};exports['show']=function(_0x3a1fde,_0x277c72){var _0x350b11={'raw':!![],'where':{'id':_0x3a1fde[_0xbc6f('0x4c')]['id']}},_0xd9811d={};_0xd9811d['model']=_[_0xbc6f('0x38')](db[_0xbc6f('0x33')]['rawAttributes']);_0xd9811d[_0xbc6f('0x37')]=_[_0xbc6f('0x38')](_0x3a1fde[_0xbc6f('0x37')]);_0xd9811d[_0xbc6f('0x41')]=_[_0xbc6f('0x39')](_0xd9811d['model'],_0xd9811d['query']);_0x350b11['attributes']=_[_0xbc6f('0x39')](_0xd9811d['model'],qs['fields'](_0x3a1fde['query'][_0xbc6f('0x3b')]));_0x350b11[_0xbc6f('0x3a')]=_0x350b11['attributes'][_0xbc6f('0x3c')]?_0x350b11[_0xbc6f('0x3a')]:_0xd9811d[_0xbc6f('0x36')];if(_0x3a1fde[_0xbc6f('0x37')][_0xbc6f('0x47')]){_0x350b11[_0xbc6f('0x48')]=[{'all':!![]}];}_0x350b11=_[_0xbc6f('0x43')]({},_0x350b11,_0x3a1fde['options']);return db[_0xbc6f('0x33')]['find'](_0x350b11)[_0xbc6f('0x2a')](handleEntityNotFound(_0x277c72,null))[_0xbc6f('0x2a')](respondWithResult(_0x277c72,null))[_0xbc6f('0x4b')](handleError(_0x277c72,null));};exports[_0xbc6f('0x4d')]=function(_0x4bc677,_0x1ee7be){return db['WhatsappQueue']['create'](_0x4bc677[_0xbc6f('0x4e')],{})[_0xbc6f('0x2a')](function(_0x29a8f8){var _0xfbbe87=_0x4bc677[_0xbc6f('0x4f')][_0xbc6f('0x2b')]({'plain':!![]});if(!_0xfbbe87)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xfbbe87[_0xbc6f('0x50')]===_0xbc6f('0x4f')){var _0x50d4f6=_0x29a8f8[_0xbc6f('0x2b')]({'plain':!![]});var _0x282789='WhatsappQueues';return db[_0xbc6f('0x51')][_0xbc6f('0x52')]({'where':{'name':_0x282789,'userProfileId':_0xfbbe87[_0xbc6f('0x53')]},'raw':!![]})[_0xbc6f('0x2a')](function(_0x541ac0){if(_0x541ac0&&_0x541ac0[_0xbc6f('0x54')]===0x0){return db[_0xbc6f('0x55')]['create']({'name':_0x50d4f6[_0xbc6f('0x30')],'resourceId':_0x50d4f6['id'],'type':_0x541ac0['name'],'sectionId':_0x541ac0['id']},{})[_0xbc6f('0x2a')](function(){return _0x29a8f8;});}else{return _0x29a8f8;}})[_0xbc6f('0x4b')](function(_0x1115d6){logger['error'](_0xbc6f('0x56'),_0x1115d6);throw _0x1115d6;});}return _0x29a8f8;})['then'](respondWithResult(_0x1ee7be,0xc9))['catch'](handleError(_0x1ee7be,null));};exports[_0xbc6f('0x28')]=function(_0x125601,_0x2e8c1a){if(_0x125601[_0xbc6f('0x4e')]['id']){delete _0x125601[_0xbc6f('0x4e')]['id'];}return db[_0xbc6f('0x33')]['find']({'where':{'id':_0x125601[_0xbc6f('0x4c')]['id']}})[_0xbc6f('0x2a')](handleEntityNotFound(_0x2e8c1a,null))['then'](saveUpdates(_0x125601[_0xbc6f('0x4e')],null))[_0xbc6f('0x2a')](respondWithResult(_0x2e8c1a,null))[_0xbc6f('0x4b')](handleError(_0x2e8c1a,null));};exports['destroy']=function(_0x392355,_0x274937){return db[_0xbc6f('0x33')][_0xbc6f('0x52')]({'where':{'id':_0x392355[_0xbc6f('0x4c')]['id']}})[_0xbc6f('0x2a')](handleEntityNotFound(_0x274937,null))[_0xbc6f('0x2a')](removeEntity(_0x274937,null))[_0xbc6f('0x4b')](handleError(_0x274937,null));};exports[_0xbc6f('0x57')]=function(_0x187507,_0x2d9c77){return db['WhatsappQueue'][_0xbc6f('0x57')]()[_0xbc6f('0x2a')](respondWithResult(_0x2d9c77,null))[_0xbc6f('0x4b')](handleError(_0x2d9c77,null));};exports[_0xbc6f('0x58')]=function(_0x291aaf,_0x22621b,_0x2251f7){var _0x33dc0c={'raw':!![],'where':{}},_0x5a0fbc={},_0x432f1b;return db[_0xbc6f('0x33')]['findOne']({'where':{'id':_0x291aaf[_0xbc6f('0x4c')]['id']}})[_0xbc6f('0x2a')](handleEntityNotFound(_0x22621b,null))['then'](function(_0x352fa7){if(_0x352fa7){_0x432f1b=_0x352fa7[_0xbc6f('0x2b')]({'plain':!![]});_0x5a0fbc[_0xbc6f('0x36')]=_[_0xbc6f('0x38')](db['UserWhatsappQueue'][_0xbc6f('0x34')]);_0x5a0fbc[_0xbc6f('0x37')]=_[_0xbc6f('0x38')](_0x291aaf['query']);_0x5a0fbc[_0xbc6f('0x41')]=_[_0xbc6f('0x39')](_0x5a0fbc[_0xbc6f('0x36')],_0x5a0fbc[_0xbc6f('0x37')]);_0x33dc0c[_0xbc6f('0x3a')]=_[_0xbc6f('0x39')](_0x5a0fbc[_0xbc6f('0x36')],qs[_0xbc6f('0x3b')](_0x291aaf[_0xbc6f('0x37')][_0xbc6f('0x3b')]));_0x33dc0c[_0xbc6f('0x3a')]=_0x33dc0c[_0xbc6f('0x3a')][_0xbc6f('0x3c')]?_0x33dc0c[_0xbc6f('0x3a')]:_0x5a0fbc[_0xbc6f('0x36')];if(!_0x291aaf[_0xbc6f('0x37')][_0xbc6f('0x3d')]('nolimit')){_0x33dc0c['limit']=qs[_0xbc6f('0x23')](_0x291aaf[_0xbc6f('0x37')]['limit']);_0x33dc0c[_0xbc6f('0x22')]=qs['offset'](_0x291aaf[_0xbc6f('0x37')][_0xbc6f('0x22')]);}_0x33dc0c[_0xbc6f('0x3e')]=qs[_0xbc6f('0x3f')](_0x291aaf[_0xbc6f('0x37')][_0xbc6f('0x3f')]);_0x33dc0c['where']=qs[_0xbc6f('0x41')](_[_0xbc6f('0x59')](_0x291aaf['query'],_0x5a0fbc[_0xbc6f('0x41')]));_0x33dc0c['where'][_0xbc6f('0x5a')]=_0x352fa7['id'];if(_0x291aaf[_0xbc6f('0x37')][_0xbc6f('0x42')]){_0x33dc0c[_0xbc6f('0x40')]=_[_0xbc6f('0x43')](_0x33dc0c[_0xbc6f('0x40')],{'$or':_[_0xbc6f('0x32')](_0x33dc0c[_0xbc6f('0x3a')],function(_0x416a29){var _0x50ec25={};_0x50ec25[_0x416a29]={'$like':'%'+_0x291aaf[_0xbc6f('0x37')][_0xbc6f('0x42')]+'%'};return _0x50ec25;})});}_0x33dc0c=_[_0xbc6f('0x43')]({},_0x33dc0c,_0x291aaf['options']);return db[_0xbc6f('0x5b')][_0xbc6f('0x49')](_0x33dc0c);}})[_0xbc6f('0x2a')](function(_0x29a782){if(_0x29a782){return db[_0xbc6f('0x5c')][_0xbc6f('0x5d')]({'where':{'id':_[_0xbc6f('0x32')](_0x29a782,_0xbc6f('0x5e')),'role':_0xbc6f('0x5f')},'attributes':['id','name',_0xbc6f('0x60'),_0xbc6f('0x61'),_0xbc6f('0x62')]});}})['then'](function(_0x39e006){if(_0x39e006){return{'count':_0x39e006[_0xbc6f('0x21')],'rows':_[_0xbc6f('0x32')](_0x39e006[_0xbc6f('0x4a')],function(_0x24d063){return{'membername':_0x24d063[_0xbc6f('0x30')],'UserId':_0x24d063['id'],'queue_name':_0x432f1b[_0xbc6f('0x30')],'WhatsappQueueId':_0x432f1b['id'],'interface':util[_0xbc6f('0x63')]('%s/%s',_0xbc6f('0x64'),_0x24d063['name']),'penalty':0x0,'paused':_0x24d063[_0xbc6f('0x60')],'createdAt':_0x24d063[_0xbc6f('0x62')],'updatedAt':_0x24d063['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0xbc6f('0x2a')](respondWithFilteredResult(_0x22621b,_0x33dc0c))[_0xbc6f('0x4b')](handleError(_0x22621b,null));};exports[_0xbc6f('0x65')]=function(_0x23e2f8,_0x360b7d,_0x24a293){var _0x4453a5={};var _0x2846ba={};var _0x3ffe39;var _0x16ceb1;return db[_0xbc6f('0x33')][_0xbc6f('0x66')]({'where':{'id':_0x23e2f8[_0xbc6f('0x4c')]['id']}})[_0xbc6f('0x2a')](handleEntityNotFound(_0x360b7d,null))['then'](function(_0x425b95){if(_0x425b95){_0x3ffe39=_0x425b95;_0x2846ba['model']=_[_0xbc6f('0x38')](db[_0xbc6f('0x67')][_0xbc6f('0x34')]);_0x2846ba['query']=_['keys'](_0x23e2f8[_0xbc6f('0x37')]);_0x2846ba['filters']=_['intersection'](_0x2846ba['model'],_0x2846ba['query']);_0x4453a5[_0xbc6f('0x3a')]=_['intersection'](_0x2846ba['model'],qs['fields'](_0x23e2f8['query'][_0xbc6f('0x3b')]));_0x4453a5['attributes']=_0x4453a5[_0xbc6f('0x3a')][_0xbc6f('0x3c')]?_0x4453a5[_0xbc6f('0x3a')]:_0x2846ba[_0xbc6f('0x36')];_0x4453a5[_0xbc6f('0x3e')]=qs[_0xbc6f('0x3f')](_0x23e2f8[_0xbc6f('0x37')][_0xbc6f('0x3f')]);_0x4453a5[_0xbc6f('0x40')]=qs['filters'](_[_0xbc6f('0x59')](_0x23e2f8[_0xbc6f('0x37')],_0x2846ba['filters']));if(_0x23e2f8['query'][_0xbc6f('0x42')]){_0x4453a5[_0xbc6f('0x40')]=_['merge'](_0x4453a5[_0xbc6f('0x40')],{'$or':_[_0xbc6f('0x32')](_0x4453a5[_0xbc6f('0x3a')],function(_0x569233){var _0x29bea6={};_0x29bea6[_0x569233]={'$like':'%'+_0x23e2f8['query'][_0xbc6f('0x42')]+'%'};return _0x29bea6;})});}_0x4453a5=_[_0xbc6f('0x43')]({},_0x4453a5,_0x23e2f8[_0xbc6f('0x46')]);return _0x3ffe39[_0xbc6f('0x65')](_0x4453a5);}})[_0xbc6f('0x2a')](function(_0x2c6148){if(_0x2c6148){_0x16ceb1=_0x2c6148[_0xbc6f('0x3c')];if(!_0x23e2f8['query']['hasOwnProperty'](_0xbc6f('0x68'))){_0x4453a5[_0xbc6f('0x23')]=qs['limit'](_0x23e2f8['query'][_0xbc6f('0x23')]);_0x4453a5[_0xbc6f('0x22')]=qs[_0xbc6f('0x22')](_0x23e2f8['query'][_0xbc6f('0x22')]);}return _0x3ffe39[_0xbc6f('0x65')](_0x4453a5);}})[_0xbc6f('0x2a')](function(_0x50d4b2){if(_0x50d4b2){return _0x50d4b2?{'count':_0x16ceb1,'rows':_0x50d4b2}:null;}})[_0xbc6f('0x2a')](respondWithResult(_0x360b7d,null))[_0xbc6f('0x4b')](handleError(_0x360b7d,null));};exports[_0xbc6f('0x69')]=function(_0x169bd7,_0x1f4116,_0x410063){var _0x31b655=_0x169bd7[_0xbc6f('0x4e')]['ids'];return db[_0xbc6f('0x67')]['findAll']({'where':{'id':_0x31b655},'attributes':['id'],'include':[{'model':db['User'],'as':_0xbc6f('0x6a'),'attributes':['id','name',_0xbc6f('0x6b'),_0xbc6f('0x6c'),_0xbc6f('0x6d')],'raw':!![]}]})['then'](function(_0x355144){if(_0x355144){var _0x58d542=_[_0xbc6f('0x6e')](_0x355144,function(_0x166518){var _0x3c55b=_0x166518[_0xbc6f('0x2b')]({'plain':!![]});return _0x3c55b[_0xbc6f('0x6a')];});return db[_0xbc6f('0x33')][_0xbc6f('0x52')]({'where':{'id':_0x169bd7[_0xbc6f('0x4c')]['id']}})[_0xbc6f('0x2a')](function(_0x142095){return db['sequelize']['transaction'](function(_0x26dd9d){return _0x142095[_0xbc6f('0x69')](_0x31b655,{'transaction':_0x26dd9d})[_0xbc6f('0x2a')](function(){return BPromise['each'](_0x58d542,function(_0x26e1a0){return db['UserWhatsappQueue'][_0xbc6f('0x6f')]({'where':{'UserId':_0x26e1a0['id'],'WhatsappQueueId':_0x169bd7[_0xbc6f('0x4c')]['id']},'transaction':_0x26dd9d});});})[_0xbc6f('0x2a')](function(){_0x58d542[_0xbc6f('0x70')](function(_0x13499b){socket[_0xbc6f('0x71')](_0xbc6f('0x72'),{'UserId':_0x13499b['id'],'WhatsappQueueId':_0x142095['id']});});});});});}})[_0xbc6f('0x2a')](respondWithStatusCode(_0x1f4116,null))[_0xbc6f('0x4b')](handleError(_0x1f4116,null));};exports['removeTeams']=function(_0x2e7da7,_0x422717,_0x33212b){return db['Team'][_0xbc6f('0x49')]({'where':{'id':_0x2e7da7['query'][_0xbc6f('0x73')]},'attributes':['id'],'include':[{'model':db[_0xbc6f('0x5c')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0xbc6f('0x2a')](handleEntityNotFound(_0x422717,null))[_0xbc6f('0x2a')](function(_0x423f0d){var _0x52cc7f=_[_0xbc6f('0x32')](_0x423f0d,'id');var _0x3dd52b=[];var _0x4a2e62=[];var _0x33d390=squel['select']();_0x33d390[_0xbc6f('0x74')](_0xbc6f('0x75'))[_0xbc6f('0x76')](_0xbc6f('0x77'),'tq')['join'](_0xbc6f('0x78'),'ut',_0xbc6f('0x79'))[_0xbc6f('0x40')](_0xbc6f('0x7a'),_0x2e7da7[_0xbc6f('0x4c')]['id']);for(var _0x539fd2=0x0;_0x539fd2<_0x423f0d['length'];_0x539fd2+=0x1){let _0x44d540=_0x423f0d[_0x539fd2];for(var _0x25ef7f=0x0;_0x25ef7f<_0x44d540[_0xbc6f('0x6a')]['length'];_0x25ef7f+=0x1){let _0x38c758=_0x44d540[_0xbc6f('0x6a')][_0x25ef7f];var _0x52c524=_0x33d390[_0xbc6f('0x7b')]();_0x52c524[_0xbc6f('0x40')](_0xbc6f('0x7c'),_0x38c758['id']);_0x4a2e62['push'](db['sequelize'][_0xbc6f('0x37')](_0x52c524[_0xbc6f('0x7d')](),{'type':db['sequelize'][_0xbc6f('0x7e')][_0xbc6f('0x7f')]})[_0xbc6f('0x2a')](function(_0x519447){if(_0x519447[_0xbc6f('0x3c')]===0x1){return _0x38c758['id'];}else{var _0x5c9e47=_[_0xbc6f('0x80')](_[_0xbc6f('0x32')](_0x519447,_0xbc6f('0x81')),function(_0x33a985){return _[_0xbc6f('0x82')](_0x52cc7f,_0x33a985);});if(_0x5c9e47){return _0x38c758['id'];}}}));}}return BPromise['all'](_0x4a2e62)[_0xbc6f('0x2a')](function(_0x4e9f82){_0x3dd52b=_(_0x3dd52b)[_0xbc6f('0x83')](_0x4e9f82)[_0xbc6f('0x84')]()[_0xbc6f('0x85')]();return db[_0xbc6f('0x33')][_0xbc6f('0x52')]({'where':{'id':_0x2e7da7[_0xbc6f('0x4c')]['id']}})[_0xbc6f('0x2a')](function(_0xed317d){return db[_0xbc6f('0x86')][_0xbc6f('0x87')](function(_0x5ca252){return _0xed317d[_0xbc6f('0x88')](_0x2e7da7[_0xbc6f('0x37')][_0xbc6f('0x73')],{'transaction':_0x5ca252})[_0xbc6f('0x2a')](function(){if(!_[_0xbc6f('0x89')](_0x3dd52b)){return _0xed317d[_0xbc6f('0x8a')](_0x3dd52b,{'transaction':_0x5ca252});}})['then'](function(){_0x3dd52b[_0xbc6f('0x70')](function(_0x2040b4){socket[_0xbc6f('0x71')]('userWhatsappQueue:remove',{'UserId':_0x2040b4,'WhatsappQueueId':_0xed317d['id']});});});});});});})['then'](respondWithStatusCode(_0x422717,null))[_0xbc6f('0x4b')](handleError(_0x422717,null));};exports[_0xbc6f('0x8b')]=function(_0x44d88b,_0x4b5032,_0x22bd45){return db['WhatsappQueue'][_0xbc6f('0x52')]({'where':{'id':_0x44d88b[_0xbc6f('0x4c')]['id']}})['then'](handleEntityNotFound(_0x4b5032,null))['then'](function(_0x15eadc){if(_0x15eadc){return _0x15eadc[_0xbc6f('0x8b')](_0x44d88b[_0xbc6f('0x4e')][_0xbc6f('0x73')],_[_0xbc6f('0x8c')](_0x44d88b['body'],[_0xbc6f('0x73'),'id'])||{})[_0xbc6f('0x8d')](function(_0x5d5df4){for(var _0x42f0bc=0x0;_0x42f0bc<_0x44d88b[_0xbc6f('0x4e')][_0xbc6f('0x73')][_0xbc6f('0x3c')];_0x42f0bc+=0x1){socket[_0xbc6f('0x71')](_0xbc6f('0x72'),{'UserId':_0x44d88b[_0xbc6f('0x4e')][_0xbc6f('0x73')][_0x42f0bc],'WhatsappQueueId':_0x44d88b['params']['id']});}return _0x5d5df4;});}})['then'](respondWithResult(_0x4b5032,null))[_0xbc6f('0x4b')](handleError(_0x4b5032,null));};exports[_0xbc6f('0x8a')]=function(_0xf1c2b8,_0x39b132,_0x3ddecb){return db[_0xbc6f('0x33')][_0xbc6f('0x52')]({'where':{'id':_0xf1c2b8[_0xbc6f('0x4c')]['id']}})['then'](handleEntityNotFound(_0x39b132,null))[_0xbc6f('0x2a')](function(_0x4950c0){if(_0x4950c0){return _0x4950c0[_0xbc6f('0x8a')](_0xf1c2b8[_0xbc6f('0x37')][_0xbc6f('0x73')])['then'](function(){if(_[_0xbc6f('0x8e')](_0xf1c2b8[_0xbc6f('0x37')][_0xbc6f('0x73')])){for(var _0x10cc17=0x0;_0x10cc17<_0xf1c2b8[_0xbc6f('0x37')][_0xbc6f('0x73')]['length'];_0x10cc17+=0x1){socket[_0xbc6f('0x71')](_0xbc6f('0x8f'),{'UserId':Number(_0xf1c2b8[_0xbc6f('0x37')][_0xbc6f('0x73')][_0x10cc17]),'WhatsappQueueId':Number(_0xf1c2b8[_0xbc6f('0x4c')]['id'])});}}else{socket[_0xbc6f('0x71')](_0xbc6f('0x8f'),{'UserId':Number(_0xf1c2b8[_0xbc6f('0x37')][_0xbc6f('0x73')]),'WhatsappQueueId':Number(_0xf1c2b8[_0xbc6f('0x4c')]['id'])});}});}})[_0xbc6f('0x2a')](respondWithStatusCode(_0x39b132,null))[_0xbc6f('0x4b')](handleError(_0x39b132,null));};exports[_0xbc6f('0x90')]=function(_0x5f34af,_0x28141d,_0x3658a6){var _0x1a12f8={};var _0x11cb5b={};var _0x576d7f;var _0x1a5725;return db[_0xbc6f('0x33')][_0xbc6f('0x66')]({'where':{'id':_0x5f34af[_0xbc6f('0x4c')]['id']}})['then'](handleEntityNotFound(_0x28141d,null))[_0xbc6f('0x2a')](function(_0x174848){if(_0x174848){_0x576d7f=_0x174848;_0x11cb5b[_0xbc6f('0x36')]=_[_0xbc6f('0x38')](db[_0xbc6f('0x5c')][_0xbc6f('0x34')]);_0x11cb5b[_0xbc6f('0x37')]=_[_0xbc6f('0x38')](_0x5f34af[_0xbc6f('0x37')]);_0x11cb5b[_0xbc6f('0x41')]=_[_0xbc6f('0x39')](_0x11cb5b[_0xbc6f('0x36')],_0x11cb5b[_0xbc6f('0x37')]);_0x1a12f8[_0xbc6f('0x3a')]=_[_0xbc6f('0x39')](_0x11cb5b[_0xbc6f('0x36')],qs[_0xbc6f('0x3b')](_0x5f34af[_0xbc6f('0x37')][_0xbc6f('0x3b')]));_0x1a12f8['attributes']=_0x1a12f8[_0xbc6f('0x3a')][_0xbc6f('0x3c')]?_0x1a12f8[_0xbc6f('0x3a')]:_0x11cb5b[_0xbc6f('0x36')];_0x1a12f8[_0xbc6f('0x3e')]=qs[_0xbc6f('0x3f')](_0x5f34af[_0xbc6f('0x37')][_0xbc6f('0x3f')]);_0x1a12f8[_0xbc6f('0x40')]=qs[_0xbc6f('0x41')](_[_0xbc6f('0x59')](_0x5f34af['query'],_0x11cb5b[_0xbc6f('0x41')]));if(_0x5f34af[_0xbc6f('0x37')][_0xbc6f('0x42')]){_0x1a12f8['where']=_[_0xbc6f('0x43')](_0x1a12f8[_0xbc6f('0x40')],{'$or':_[_0xbc6f('0x32')](_0x1a12f8[_0xbc6f('0x3a')],function(_0x15dbae){var _0x510cc1={};_0x510cc1[_0x15dbae]={'$like':'%'+_0x5f34af[_0xbc6f('0x37')][_0xbc6f('0x42')]+'%'};return _0x510cc1;})});}_0x1a12f8=_['merge']({},_0x1a12f8,_0x5f34af[_0xbc6f('0x46')]);return _0x576d7f[_0xbc6f('0x90')](_0x1a12f8);}})[_0xbc6f('0x2a')](function(_0x38647e){if(_0x38647e){_0x1a5725=_0x38647e[_0xbc6f('0x3c')];if(!_0x5f34af[_0xbc6f('0x37')][_0xbc6f('0x3d')](_0xbc6f('0x68'))){_0x1a12f8[_0xbc6f('0x23')]=qs['limit'](_0x5f34af[_0xbc6f('0x37')][_0xbc6f('0x23')]);_0x1a12f8['offset']=qs[_0xbc6f('0x22')](_0x5f34af['query']['offset']);}return _0x576d7f[_0xbc6f('0x90')](_0x1a12f8);}})[_0xbc6f('0x2a')](function(_0xa1612e){if(_0xa1612e){return _0xa1612e?{'count':_0x1a5725,'rows':_0xa1612e}:null;}})[_0xbc6f('0x2a')](respondWithResult(_0x28141d,null))[_0xbc6f('0x4b')](handleError(_0x28141d,null));};
\ No newline at end of file
diff --git a/server/api/whatsappQueue/whatsappQueue.events.js b/server/api/whatsappQueue/whatsappQueue.events.js
index d8e72a7..e7cc42f 100644
--- a/server/api/whatsappQueue/whatsappQueue.events.js
+++ b/server/api/whatsappQueue/whatsappQueue.events.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xbe1e=['setMaxListeners','save','update','emit','hasOwnProperty','hook','events','WhatsappQueue'];(function(_0x552fb8,_0x4ed24b){var _0x2a741a=function(_0x15b7a1){while(--_0x15b7a1){_0x552fb8['push'](_0x552fb8['shift']());}};_0x2a741a(++_0x4ed24b);}(_0xbe1e,0xb6));var _0xebe1=function(_0x5c85c8,_0x16110b){_0x5c85c8=_0x5c85c8-0x0;var _0x42d66f=_0xbe1e[_0x5c85c8];return _0x42d66f;};'use strict';var EventEmitter=require(_0xebe1('0x0'));var WhatsappQueue=require('../../mysqldb')['db'][_0xebe1('0x1')];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents[_0xebe1('0x2')](0x0);var events={'afterCreate':_0xebe1('0x3'),'afterUpdate':_0xebe1('0x4'),'afterDestroy':'remove'};function emitEvent(_0x200676){return function(_0x569d49,_0x3a8a4,_0x3da14b){WhatsappQueueEvents[_0xebe1('0x5')](_0x200676+':'+_0x569d49['id'],_0x569d49);WhatsappQueueEvents['emit'](_0x200676,_0x569d49);_0x3da14b(null);};}for(var e in events){if(events[_0xebe1('0x6')](e)){var event=events[e];WhatsappQueue[_0xebe1('0x7')](e,emitEvent(event));}}module['exports']=WhatsappQueueEvents;
\ No newline at end of file
+var _0x43a6=['save','update','remove','exports','events','setMaxListeners'];(function(_0x457945,_0xde11f5){var _0x3b2adc=function(_0x21319b){while(--_0x21319b){_0x457945['push'](_0x457945['shift']());}};_0x3b2adc(++_0xde11f5);}(_0x43a6,0xe2));var _0x643a=function(_0x1305e3,_0x43a724){_0x1305e3=_0x1305e3-0x0;var _0x1068e9=_0x43a6[_0x1305e3];return _0x1068e9;};'use strict';var EventEmitter=require(_0x643a('0x0'));var WhatsappQueue=require('../../mysqldb')['db']['WhatsappQueue'];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents[_0x643a('0x1')](0x0);var events={'afterCreate':_0x643a('0x2'),'afterUpdate':_0x643a('0x3'),'afterDestroy':_0x643a('0x4')};function emitEvent(_0x34a229){return function(_0xed20f7,_0x2d9a67,_0x220ae8){WhatsappQueueEvents['emit'](_0x34a229+':'+_0xed20f7['id'],_0xed20f7);WhatsappQueueEvents['emit'](_0x34a229,_0xed20f7);_0x220ae8(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];WhatsappQueue['hook'](e,emitEvent(event));}}module[_0x643a('0x5')]=WhatsappQueueEvents;
\ No newline at end of file
diff --git a/server/api/whatsappQueue/whatsappQueue.model.js b/server/api/whatsappQueue/whatsappQueue.model.js
index d6269be..f1edb19 100644
--- a/server/api/whatsappQueue/whatsappQueue.model.js
+++ b/server/api/whatsappQueue/whatsappQueue.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xb5bb=['WhatsappQueue','whatsapp_queues','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./whatsappQueue.attributes','exports','define'];(function(_0x3e829f,_0x5d9381){var _0x41313e=function(_0x16fb4b){while(--_0x16fb4b){_0x3e829f['push'](_0x3e829f['shift']());}};_0x41313e(++_0x5d9381);}(_0xb5bb,0x1d0));var _0xbb5b=function(_0x2b3489,_0x484936){_0x2b3489=_0x2b3489-0x0;var _0x16d9eb=_0xb5bb[_0x2b3489];return _0x16d9eb;};'use strict';var _=require(_0xbb5b('0x0'));var util=require('util');var logger=require(_0xbb5b('0x1'))(_0xbb5b('0x2'));var moment=require(_0xbb5b('0x3'));var BPromise=require(_0xbb5b('0x4'));var rp=require(_0xbb5b('0x5'));var fs=require('fs');var path=require(_0xbb5b('0x6'));var rimraf=require(_0xbb5b('0x7'));var config=require(_0xbb5b('0x8'));var attributes=require(_0xbb5b('0x9'));module[_0xbb5b('0xa')]=function(_0x4a65b8,_0xa402e6){return _0x4a65b8[_0xbb5b('0xb')](_0xbb5b('0xc'),attributes,{'tableName':_0xbb5b('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x320e=['define','WhatsappQueue','whatsapp_queues','lodash','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./whatsappQueue.attributes'];(function(_0x19357e,_0x2e1ea3){var _0x34b9e0=function(_0x4ecfc3){while(--_0x4ecfc3){_0x19357e['push'](_0x19357e['shift']());}};_0x34b9e0(++_0x2e1ea3);}(_0x320e,0x19b));var _0xe320=function(_0x1a9e78,_0x180720){_0x1a9e78=_0x1a9e78-0x0;var _0x113e06=_0x320e[_0x1a9e78];return _0x113e06;};'use strict';var _=require(_0xe320('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xe320('0x1'));var moment=require(_0xe320('0x2'));var BPromise=require(_0xe320('0x3'));var rp=require(_0xe320('0x4'));var fs=require('fs');var path=require(_0xe320('0x5'));var rimraf=require(_0xe320('0x6'));var config=require(_0xe320('0x7'));var attributes=require(_0xe320('0x8'));module['exports']=function(_0x193d13,_0x5de1f7){return _0x193d13[_0xe320('0x9')](_0xe320('0xa'),attributes,{'tableName':_0xe320('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/whatsappQueue/whatsappQueue.rpc.js b/server/api/whatsappQueue/whatsappQueue.rpc.js
index fb0f3a4..619ba41 100644
--- a/server/api/whatsappQueue/whatsappQueue.rpc.js
+++ b/server/api/whatsappQueue/whatsappQueue.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xbadf=['localhost','./whatsappQueue.socket','register','then','info','WhatsappQueue,\x20%s,\x20%s','debug','WhatsappQueue,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','catch','GetWhatsappQueue','WhatsappQueue','options','raw','where','attributes','limit','include','map','model','stringify','find','ShowWhatsappQueue','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','redis','defaults'];(function(_0x1cc8fe,_0x105328){var _0x230054=function(_0x1a1b56){while(--_0x1a1b56){_0x1cc8fe['push'](_0x1cc8fe['shift']());}};_0x230054(++_0x105328);}(_0xbadf,0x152));var _0xfbad=function(_0x2ef8c1,_0x2f72f4){_0x2ef8c1=_0x2ef8c1-0x0;var _0x288305=_0xbadf[_0x2ef8c1];return _0x288305;};'use strict';var _=require(_0xfbad('0x0'));var util=require(_0xfbad('0x1'));var moment=require(_0xfbad('0x2'));var BPromise=require('bluebird');var rs=require(_0xfbad('0x3'));var fs=require('fs');var Redis=require(_0xfbad('0x4'));var db=require(_0xfbad('0x5'))['db'];var utils=require(_0xfbad('0x6'));var logger=require(_0xfbad('0x7'))(_0xfbad('0x8'));var config=require('../../config/environment');var jayson=require(_0xfbad('0x9'));var client=jayson[_0xfbad('0xa')]['http']({'port':0x232a});config[_0xfbad('0xb')]=_[_0xfbad('0xc')](config[_0xfbad('0xb')],{'host':_0xfbad('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xfbad('0xb')]));require(_0xfbad('0xe'))[_0xfbad('0xf')](socket);function respondWithRpcPromise(_0x5d34f0,_0x4cf894,_0x2f9664){return new BPromise(function(_0x53cbdd,_0x2d64b2){return client['request'](_0x5d34f0,_0x2f9664)[_0xfbad('0x10')](function(_0x85b0fd){logger[_0xfbad('0x11')](_0xfbad('0x12'),_0x4cf894,'request\x20sent');logger[_0xfbad('0x13')](_0xfbad('0x14'),_0x4cf894,_0xfbad('0x15'),JSON['stringify'](_0x85b0fd));if(_0x85b0fd['error']){if(_0x85b0fd[_0xfbad('0x16')][_0xfbad('0x17')]===0x1f4){logger[_0xfbad('0x16')](_0xfbad('0x12'),_0x4cf894,_0x85b0fd[_0xfbad('0x16')][_0xfbad('0x18')]);return _0x2d64b2(_0x85b0fd[_0xfbad('0x16')]['message']);}logger[_0xfbad('0x16')]('WhatsappQueue,\x20%s,\x20%s',_0x4cf894,_0x85b0fd[_0xfbad('0x16')][_0xfbad('0x18')]);return _0x53cbdd(_0x85b0fd['error'][_0xfbad('0x18')]);}else{logger[_0xfbad('0x11')](_0xfbad('0x12'),_0x4cf894,_0xfbad('0x15'));_0x53cbdd(_0x85b0fd['result'][_0xfbad('0x18')]);}})[_0xfbad('0x19')](function(_0x2cf9f6){logger[_0xfbad('0x16')]('WhatsappQueue,\x20%s,\x20%s',_0x4cf894,_0x2cf9f6);_0x2d64b2(_0x2cf9f6);});});}exports[_0xfbad('0x1a')]=function(_0x492dd6){var _0x501b3c=this;return new Promise(function(_0x2f2da5,_0x5f303f){return db[_0xfbad('0x1b')]['findAll']({'raw':_0x492dd6['options']?_0x492dd6[_0xfbad('0x1c')][_0xfbad('0x1d')]===undefined?!![]:![]:!![],'where':_0x492dd6[_0xfbad('0x1c')]?_0x492dd6[_0xfbad('0x1c')][_0xfbad('0x1e')]||null:null,'attributes':_0x492dd6[_0xfbad('0x1c')]?_0x492dd6[_0xfbad('0x1c')][_0xfbad('0x1f')]||null:null,'limit':_0x492dd6[_0xfbad('0x1c')]?_0x492dd6[_0xfbad('0x1c')][_0xfbad('0x20')]||null:null,'include':_0x492dd6['options']?_0x492dd6[_0xfbad('0x1c')][_0xfbad('0x21')]?_[_0xfbad('0x22')](_0x492dd6[_0xfbad('0x1c')][_0xfbad('0x21')],function(_0x130686){return{'model':db[_0x130686[_0xfbad('0x23')]],'as':_0x130686['as'],'attributes':_0x130686[_0xfbad('0x1f')],'include':_0x130686[_0xfbad('0x21')]?_[_0xfbad('0x22')](_0x130686[_0xfbad('0x21')],function(_0x51e4cf){return{'model':db[_0x51e4cf[_0xfbad('0x23')]],'as':_0x51e4cf['as'],'attributes':_0x51e4cf[_0xfbad('0x1f')],'include':_0x51e4cf[_0xfbad('0x21')]?_[_0xfbad('0x22')](_0x51e4cf['include'],function(_0x1c51b8){return{'model':db[_0x1c51b8['model']],'as':_0x1c51b8['as'],'attributes':_0x1c51b8[_0xfbad('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xfbad('0x10')](function(_0x1e5066){logger[_0xfbad('0x11')](_0xfbad('0x1a'),_0x492dd6);logger['debug'](_0xfbad('0x1a'),_0x492dd6,JSON[_0xfbad('0x24')](_0x1e5066));_0x2f2da5(_0x1e5066);})[_0xfbad('0x19')](function(_0x2ce782){logger[_0xfbad('0x16')]('GetWhatsappQueue',_0x2ce782['message'],_0x492dd6);_0x5f303f(_0x501b3c['error'](0x1f4,_0x2ce782[_0xfbad('0x18')]));});});};exports['ShowWhatsappQueue']=function(_0x42483d){var _0x487b5a=this;return new Promise(function(_0x4cac5c,_0x16533d){return db['WhatsappQueue'][_0xfbad('0x25')]({'raw':_0x42483d[_0xfbad('0x1c')]?_0x42483d[_0xfbad('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x42483d[_0xfbad('0x1c')]?_0x42483d[_0xfbad('0x1c')]['where']||null:null,'attributes':_0x42483d[_0xfbad('0x1c')]?_0x42483d['options']['attributes']||null:null,'include':_0x42483d[_0xfbad('0x1c')]?_0x42483d[_0xfbad('0x1c')][_0xfbad('0x21')]?_[_0xfbad('0x22')](_0x42483d[_0xfbad('0x1c')][_0xfbad('0x21')],function(_0x3c49a3){return{'model':db[_0x3c49a3[_0xfbad('0x23')]],'as':_0x3c49a3['as'],'attributes':_0x3c49a3[_0xfbad('0x1f')],'include':_0x3c49a3['include']?_[_0xfbad('0x22')](_0x3c49a3['include'],function(_0x288e86){return{'model':db[_0x288e86[_0xfbad('0x23')]],'as':_0x288e86['as'],'attributes':_0x288e86[_0xfbad('0x1f')],'include':_0x288e86['include']?_[_0xfbad('0x22')](_0x288e86[_0xfbad('0x21')],function(_0x4fe7f5){return{'model':db[_0x4fe7f5['model']],'as':_0x4fe7f5['as'],'attributes':_0x4fe7f5[_0xfbad('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xfbad('0x10')](function(_0x54cc89){logger['info']('ShowWhatsappQueue',_0x42483d);logger[_0xfbad('0x13')]('ShowWhatsappQueue',_0x42483d,JSON[_0xfbad('0x24')](_0x54cc89));_0x4cac5c(_0x54cc89);})['catch'](function(_0x3d6355){logger[_0xfbad('0x16')](_0xfbad('0x26'),_0x3d6355[_0xfbad('0x18')],_0x42483d);_0x16533d(_0x487b5a[_0xfbad('0x16')](0x1f4,_0x3d6355['message']));});});};
\ No newline at end of file
+var _0xb657=['options','raw','where','limit','include','map','model','attributes','WhatsappQueue','find','ShowWhatsappQueue','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','redis','defaults','localhost','socket.io-emitter','./whatsappQueue.socket','then','info','WhatsappQueue,\x20%s,\x20%s','debug','WhatsappQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','catch','GetWhatsappQueue'];(function(_0x5609f5,_0x419ff7){var _0x50e7eb=function(_0x1f132b){while(--_0x1f132b){_0x5609f5['push'](_0x5609f5['shift']());}};_0x50e7eb(++_0x419ff7);}(_0xb657,0x187));var _0x7b65=function(_0x32b542,_0x4512fa){_0x32b542=_0x32b542-0x0;var _0x554d54=_0xb657[_0x32b542];return _0x554d54;};'use strict';var _=require('lodash');var util=require(_0x7b65('0x0'));var moment=require(_0x7b65('0x1'));var BPromise=require(_0x7b65('0x2'));var rs=require(_0x7b65('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x7b65('0x4'));var logger=require(_0x7b65('0x5'))(_0x7b65('0x6'));var config=require(_0x7b65('0x7'));var jayson=require(_0x7b65('0x8'));var client=jayson['client']['http']({'port':0x232a});config[_0x7b65('0x9')]=_[_0x7b65('0xa')](config[_0x7b65('0x9')],{'host':_0x7b65('0xb'),'port':0x18eb});var socket=require(_0x7b65('0xc'))(new Redis(config[_0x7b65('0x9')]));require(_0x7b65('0xd'))['register'](socket);function respondWithRpcPromise(_0x1aa106,_0x238f1f,_0x2cce61){return new BPromise(function(_0x55bd6d,_0x4dd4d6){return client['request'](_0x1aa106,_0x2cce61)[_0x7b65('0xe')](function(_0x3a371d){logger[_0x7b65('0xf')](_0x7b65('0x10'),_0x238f1f,'request\x20sent');logger[_0x7b65('0x11')](_0x7b65('0x12'),_0x238f1f,'request\x20sent',JSON[_0x7b65('0x13')](_0x3a371d));if(_0x3a371d[_0x7b65('0x14')]){if(_0x3a371d[_0x7b65('0x14')][_0x7b65('0x15')]===0x1f4){logger[_0x7b65('0x14')]('WhatsappQueue,\x20%s,\x20%s',_0x238f1f,_0x3a371d[_0x7b65('0x14')][_0x7b65('0x16')]);return _0x4dd4d6(_0x3a371d[_0x7b65('0x14')]['message']);}logger[_0x7b65('0x14')]('WhatsappQueue,\x20%s,\x20%s',_0x238f1f,_0x3a371d['error'][_0x7b65('0x16')]);return _0x55bd6d(_0x3a371d[_0x7b65('0x14')][_0x7b65('0x16')]);}else{logger['info']('WhatsappQueue,\x20%s,\x20%s',_0x238f1f,_0x7b65('0x17'));_0x55bd6d(_0x3a371d[_0x7b65('0x18')][_0x7b65('0x16')]);}})[_0x7b65('0x19')](function(_0x275340){logger[_0x7b65('0x14')]('WhatsappQueue,\x20%s,\x20%s',_0x238f1f,_0x275340);_0x4dd4d6(_0x275340);});});}exports[_0x7b65('0x1a')]=function(_0x168e86){var _0x24ba01=this;return new Promise(function(_0x4e6e0b,_0x4913d8){return db['WhatsappQueue']['findAll']({'raw':_0x168e86[_0x7b65('0x1b')]?_0x168e86[_0x7b65('0x1b')][_0x7b65('0x1c')]===undefined?!![]:![]:!![],'where':_0x168e86['options']?_0x168e86[_0x7b65('0x1b')][_0x7b65('0x1d')]||null:null,'attributes':_0x168e86[_0x7b65('0x1b')]?_0x168e86[_0x7b65('0x1b')]['attributes']||null:null,'limit':_0x168e86[_0x7b65('0x1b')]?_0x168e86[_0x7b65('0x1b')][_0x7b65('0x1e')]||null:null,'include':_0x168e86[_0x7b65('0x1b')]?_0x168e86[_0x7b65('0x1b')][_0x7b65('0x1f')]?_['map'](_0x168e86[_0x7b65('0x1b')][_0x7b65('0x1f')],function(_0x312572){return{'model':db[_0x312572['model']],'as':_0x312572['as'],'attributes':_0x312572['attributes'],'include':_0x312572[_0x7b65('0x1f')]?_[_0x7b65('0x20')](_0x312572['include'],function(_0x5bde2b){return{'model':db[_0x5bde2b[_0x7b65('0x21')]],'as':_0x5bde2b['as'],'attributes':_0x5bde2b[_0x7b65('0x22')],'include':_0x5bde2b[_0x7b65('0x1f')]?_['map'](_0x5bde2b[_0x7b65('0x1f')],function(_0x4ee2ce){return{'model':db[_0x4ee2ce['model']],'as':_0x4ee2ce['as'],'attributes':_0x4ee2ce[_0x7b65('0x22')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3b40a3){logger[_0x7b65('0xf')](_0x7b65('0x1a'),_0x168e86);logger[_0x7b65('0x11')](_0x7b65('0x1a'),_0x168e86,JSON[_0x7b65('0x13')](_0x3b40a3));_0x4e6e0b(_0x3b40a3);})['catch'](function(_0x59ccc2){logger['error'](_0x7b65('0x1a'),_0x59ccc2[_0x7b65('0x16')],_0x168e86);_0x4913d8(_0x24ba01[_0x7b65('0x14')](0x1f4,_0x59ccc2[_0x7b65('0x16')]));});});};exports['ShowWhatsappQueue']=function(_0x2c62d6){var _0xb2bcb4=this;return new Promise(function(_0x35aa07,_0x506b0f){return db[_0x7b65('0x23')][_0x7b65('0x24')]({'raw':_0x2c62d6[_0x7b65('0x1b')]?_0x2c62d6['options'][_0x7b65('0x1c')]===undefined?!![]:![]:!![],'where':_0x2c62d6[_0x7b65('0x1b')]?_0x2c62d6[_0x7b65('0x1b')][_0x7b65('0x1d')]||null:null,'attributes':_0x2c62d6[_0x7b65('0x1b')]?_0x2c62d6[_0x7b65('0x1b')]['attributes']||null:null,'include':_0x2c62d6[_0x7b65('0x1b')]?_0x2c62d6[_0x7b65('0x1b')][_0x7b65('0x1f')]?_[_0x7b65('0x20')](_0x2c62d6[_0x7b65('0x1b')][_0x7b65('0x1f')],function(_0x13bc5f){return{'model':db[_0x13bc5f['model']],'as':_0x13bc5f['as'],'attributes':_0x13bc5f[_0x7b65('0x22')],'include':_0x13bc5f[_0x7b65('0x1f')]?_['map'](_0x13bc5f[_0x7b65('0x1f')],function(_0x5d8ec1){return{'model':db[_0x5d8ec1['model']],'as':_0x5d8ec1['as'],'attributes':_0x5d8ec1[_0x7b65('0x22')],'include':_0x5d8ec1[_0x7b65('0x1f')]?_[_0x7b65('0x20')](_0x5d8ec1[_0x7b65('0x1f')],function(_0x127ab3){return{'model':db[_0x127ab3[_0x7b65('0x21')]],'as':_0x127ab3['as'],'attributes':_0x127ab3[_0x7b65('0x22')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x39ecee){logger[_0x7b65('0xf')](_0x7b65('0x25'),_0x2c62d6);logger[_0x7b65('0x11')](_0x7b65('0x25'),_0x2c62d6,JSON['stringify'](_0x39ecee));_0x35aa07(_0x39ecee);})[_0x7b65('0x19')](function(_0x404ef4){logger[_0x7b65('0x14')]('ShowWhatsappQueue',_0x404ef4['message'],_0x2c62d6);_0x506b0f(_0xb2bcb4[_0x7b65('0x14')](0x1f4,_0x404ef4['message']));});});};
\ No newline at end of file
diff --git a/server/api/whatsappQueue/whatsappQueue.socket.js b/server/api/whatsappQueue/whatsappQueue.socket.js
index 5f0667a..c59416f 100644
--- a/server/api/whatsappQueue/whatsappQueue.socket.js
+++ b/server/api/whatsappQueue/whatsappQueue.socket.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x5f7d=['save','remove','update','removeListener','whatsappQueue:'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x5f7d,0x1bd));var _0xd5f7=function(_0x444e37,_0x4d013c){_0x444e37=_0x444e37-0x0;var _0x515b63=_0x5f7d[_0x444e37];return _0x515b63;};'use strict';var WhatsappQueueEvents=require('./whatsappQueue.events');var events=[_0xd5f7('0x0'),_0xd5f7('0x1'),_0xd5f7('0x2')];function createListener(_0xc67ca0,_0xb50da2){return function(_0x2cb8fd){_0xb50da2['emit'](_0xc67ca0,_0x2cb8fd);};}function removeListener(_0x38a48f,_0x3c929e){return function(){WhatsappQueueEvents[_0xd5f7('0x3')](_0x38a48f,_0x3c929e);};}exports['register']=function(_0x5edabb){for(var _0x39d204=0x0,_0x627ed5=events['length'];_0x39d204<_0x627ed5;_0x39d204++){var _0x51143e=events[_0x39d204];var _0x17b872=createListener(_0xd5f7('0x4')+_0x51143e,_0x5edabb);WhatsappQueueEvents['on'](_0x51143e,_0x17b872);}};
\ No newline at end of file
+var _0x8eca=['length','whatsappQueue:','./whatsappQueue.events','save','remove','emit'];(function(_0x64521c,_0x3f4d33){var _0x3984d8=function(_0x5824d3){while(--_0x5824d3){_0x64521c['push'](_0x64521c['shift']());}};_0x3984d8(++_0x3f4d33);}(_0x8eca,0x1e2));var _0xa8ec=function(_0x577b14,_0x5ac386){_0x577b14=_0x577b14-0x0;var _0x252b3b=_0x8eca[_0x577b14];return _0x252b3b;};'use strict';var WhatsappQueueEvents=require(_0xa8ec('0x0'));var events=[_0xa8ec('0x1'),_0xa8ec('0x2'),'update'];function createListener(_0x54f228,_0x2bb833){return function(_0x209b3d){_0x2bb833[_0xa8ec('0x3')](_0x54f228,_0x209b3d);};}function removeListener(_0x2b76e6,_0x4e64a0){return function(){WhatsappQueueEvents['removeListener'](_0x2b76e6,_0x4e64a0);};}exports['register']=function(_0x5363ad){for(var _0x278798=0x0,_0x53209c=events[_0xa8ec('0x4')];_0x278798<_0x53209c;_0x278798++){var _0x5ec6fa=events[_0x278798];var _0x2b7477=createListener(_0xa8ec('0x5')+_0x5ec6fa,_0x5363ad);WhatsappQueueEvents['on'](_0x5ec6fa,_0x2b7477);}};
\ No newline at end of file
diff --git a/server/api/whatsappQueueReport/index.js b/server/api/whatsappQueueReport/index.js
index 64d232a..66e63e5 100644
--- a/server/api/whatsappQueueReport/index.js
+++ b/server/api/whatsappQueueReport/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7b77=['connect-timeout','Router','../../components/auth/service','../../components/interaction/service','./whatsappQueueReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','put','update','delete','destroy','exports','multer','util','path'];(function(_0x271537,_0x8b7b3b){var _0x19dc22=function(_0x459bbf){while(--_0x459bbf){_0x271537['push'](_0x271537['shift']());}};_0x19dc22(++_0x8b7b3b);}(_0x7b77,0x179));var _0x77b7=function(_0x31991b,_0xaf75d2){_0x31991b=_0x31991b-0x0;var _0x307304=_0x7b77[_0x31991b];return _0x307304;};'use strict';var multer=require(_0x77b7('0x0'));var util=require(_0x77b7('0x1'));var path=require(_0x77b7('0x2'));var timeout=require(_0x77b7('0x3'));var express=require('express');var router=express[_0x77b7('0x4')]();var auth=require(_0x77b7('0x5'));var interaction=require(_0x77b7('0x6'));var config=require('../../config/environment');var controller=require(_0x77b7('0x7'));router[_0x77b7('0x8')]('/',auth[_0x77b7('0x9')](),controller[_0x77b7('0xa')]);router[_0x77b7('0x8')](_0x77b7('0xb'),auth['isAuthenticated'](),controller[_0x77b7('0xc')]);router[_0x77b7('0x8')](_0x77b7('0xd'),auth['isAuthenticated'](),controller[_0x77b7('0xe')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x77b7('0xf')](_0x77b7('0xd'),auth['isAuthenticated'](),controller[_0x77b7('0x10')]);router[_0x77b7('0x11')](_0x77b7('0xd'),auth[_0x77b7('0x9')](),controller[_0x77b7('0x12')]);module[_0x77b7('0x13')]=router;
\ No newline at end of file
+var _0x88f5=['express','Router','../../components/interaction/service','isAuthenticated','get','/describe','describe','/:id','show','post','create','put','update','destroy','multer','path','connect-timeout'];(function(_0xfcfa18,_0x2f924f){var _0xc27500=function(_0x597574){while(--_0x597574){_0xfcfa18['push'](_0xfcfa18['shift']());}};_0xc27500(++_0x2f924f);}(_0x88f5,0x162));var _0x588f=function(_0x5f373c,_0x27970c){_0x5f373c=_0x5f373c-0x0;var _0x557d09=_0x88f5[_0x5f373c];return _0x557d09;};'use strict';var multer=require(_0x588f('0x0'));var util=require('util');var path=require(_0x588f('0x1'));var timeout=require(_0x588f('0x2'));var express=require(_0x588f('0x3'));var router=express[_0x588f('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x588f('0x5'));var config=require('../../config/environment');var controller=require('./whatsappQueueReport.controller');router['get']('/',auth[_0x588f('0x6')](),controller['index']);router[_0x588f('0x7')](_0x588f('0x8'),auth[_0x588f('0x6')](),controller[_0x588f('0x9')]);router['get'](_0x588f('0xa'),auth[_0x588f('0x6')](),controller[_0x588f('0xb')]);router[_0x588f('0xc')]('/',auth[_0x588f('0x6')](),controller[_0x588f('0xd')]);router[_0x588f('0xe')](_0x588f('0xa'),auth[_0x588f('0x6')](),controller[_0x588f('0xf')]);router['delete'](_0x588f('0xa'),auth[_0x588f('0x6')](),controller[_0x588f('0x10')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js b/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js
index a4ff1e2..d3373f9 100644
--- a/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js
+++ b/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x34e8=['sequelize','exports','STRING','DATE'];(function(_0x28252a,_0x4c4325){var _0x289281=function(_0x3cc463){while(--_0x3cc463){_0x28252a['push'](_0x28252a['shift']());}};_0x289281(++_0x4c4325);}(_0x34e8,0x12c));var _0x834e=function(_0x35cb33,_0x33c4d2){_0x35cb33=_0x35cb33-0x0;var _0x107106=_0x34e8[_0x35cb33];return _0x107106;};'use strict';var Sequelize=require(_0x834e('0x0'));module[_0x834e('0x1')]={'uniqueid':{'type':Sequelize[_0x834e('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x834e('0x2')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x834e('0x3')]},'acceptAt':{'type':Sequelize[_0x834e('0x3')]},'exitAt':{'type':Sequelize[_0x834e('0x3')]},'reason':{'type':Sequelize[_0x834e('0x2')]}};
\ No newline at end of file
+var _0x7fbe=['STRING','DATE'];(function(_0x13a097,_0x4a480c){var _0x2923c0=function(_0x16cad6){while(--_0x16cad6){_0x13a097['push'](_0x13a097['shift']());}};_0x2923c0(++_0x4a480c);}(_0x7fbe,0x1ec));var _0xe7fb=function(_0x51b861,_0xb480d3){_0x51b861=_0x51b861-0x0;var _0x52401b=_0x7fbe[_0x51b861];return _0x52401b;};'use strict';var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize[_0xe7fb('0x0')],'allowNull':![]},'from':{'type':Sequelize[_0xe7fb('0x0')]},'joinAt':{'type':Sequelize[_0xe7fb('0x1')]},'leaveAt':{'type':Sequelize[_0xe7fb('0x1')]},'acceptAt':{'type':Sequelize[_0xe7fb('0x1')]},'exitAt':{'type':Sequelize[_0xe7fb('0x1')]},'reason':{'type':Sequelize[_0xe7fb('0x0')]}};
\ No newline at end of file
diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.controller.js b/server/api/whatsappQueueReport/whatsappQueueReport.controller.js
index 73de030..f07c2e1 100644
--- a/server/api/whatsappQueueReport/whatsappQueueReport.controller.js
+++ b/server/api/whatsappQueueReport/whatsappQueueReport.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x6a6e=['request-promise','moment','bluebird','mustache','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','count','offset','limit','set','Content-Range','apply','reject','update','then','destroy','sendStatus','stack','name','send','index','WhatsappQueueReport','rawAttributes','fieldName','key','model','map','query','keys','filters','attributes','intersection','fields','hasOwnProperty','sort','where','pick','filter','type','VIRTUAL','merge','options','includeAll','include','findAll','rows','show','params','length','find','create','body','catch','describe','html-pdf','eml-format','zip-dir','fast-json-patch'];(function(_0x48882e,_0x4b5f44){var _0x54f700=function(_0x32f0a0){while(--_0x32f0a0){_0x48882e['push'](_0x48882e['shift']());}};_0x54f700(++_0x4b5f44);}(_0x6a6e,0xe3));var _0xe6a6=function(_0x1b00f1,_0x15ffa8){_0x1b00f1=_0x1b00f1-0x0;var _0x5c3dad=_0x6a6e[_0x1b00f1];return _0x5c3dad;};'use strict';var pdf=require(_0xe6a6('0x0'));var emlformat=require(_0xe6a6('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xe6a6('0x2'));var jsonpatch=require(_0xe6a6('0x3'));var rp=require(_0xe6a6('0x4'));var moment=require(_0xe6a6('0x5'));var BPromise=require(_0xe6a6('0x6'));var Mustache=require(_0xe6a6('0x7'));var util=require('util');var path=require('path');var sox=require(_0xe6a6('0x8'));var csv=require(_0xe6a6('0x9'));var ejs=require(_0xe6a6('0xa'));var fs=require('fs');var _=require(_0xe6a6('0xb'));var squel=require(_0xe6a6('0xc'));var crypto=require(_0xe6a6('0xd'));var jsforce=require(_0xe6a6('0xe'));var deskjs=require(_0xe6a6('0xf'));var toCsv=require(_0xe6a6('0x9'));var querystring=require(_0xe6a6('0x10'));var Papa=require(_0xe6a6('0x11'));var Redis=require(_0xe6a6('0x12'));var authService=require(_0xe6a6('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xe6a6('0x14'));var hardwareService=require(_0xe6a6('0x15'));var logger=require(_0xe6a6('0x16'))(_0xe6a6('0x17'));var utils=require(_0xe6a6('0x18'));var config=require(_0xe6a6('0x19'));var db=require(_0xe6a6('0x1a'))['db'];function respondWithStatusCode(_0x22dda5,_0xd6f9b4){_0xd6f9b4=_0xd6f9b4||0xcc;return function(_0x5b32cc){if(_0x5b32cc){return _0x22dda5['sendStatus'](_0xd6f9b4);}return _0x22dda5[_0xe6a6('0x1b')](_0xd6f9b4)[_0xe6a6('0x1c')]();};}function respondWithResult(_0x4379fc,_0x179414){_0x179414=_0x179414||0xc8;return function(_0x443940){if(_0x443940){return _0x4379fc['status'](_0x179414)['json'](_0x443940);}};}function respondWithFilteredResult(_0x11e531,_0x402b85){return function(_0x44c86b){if(_0x44c86b){var _0x2202bc=_0x44c86b[_0xe6a6('0x1d')],_0x537aee=_0x402b85[_0xe6a6('0x1e')],_0x56b5ed=_0x402b85['offset']+_0x402b85[_0xe6a6('0x1f')],_0x2eb146;if(_0x56b5ed>=_0x2202bc){_0x56b5ed=_0x2202bc;_0x2eb146=0xc8;}else{_0x2eb146=0xce;}_0x11e531[_0xe6a6('0x1b')](_0x2eb146);return _0x11e531[_0xe6a6('0x20')](_0xe6a6('0x21'),_0x537aee+'-'+_0x56b5ed+'/'+_0x2202bc)['json'](_0x44c86b);}return null;};}function patchUpdates(_0x3355d1){return function(_0x5ac1ed){try{jsonpatch[_0xe6a6('0x22')](_0x5ac1ed,_0x3355d1,!![]);}catch(_0x572427){return BPromise[_0xe6a6('0x23')](_0x572427);}return _0x5ac1ed['save']();};}function saveUpdates(_0x269842,_0x155ab0){return function(_0x315d3b){if(_0x315d3b){return _0x315d3b[_0xe6a6('0x24')](_0x269842)[_0xe6a6('0x25')](function(_0x538441){return _0x538441;});}return null;};}function removeEntity(_0x5e653f,_0x12f755){return function(_0x21b019){if(_0x21b019){return _0x21b019[_0xe6a6('0x26')]()[_0xe6a6('0x25')](function(){_0x5e653f[_0xe6a6('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x18412d,_0x99a41f){return function(_0xc1e9fe){if(!_0xc1e9fe){_0x18412d[_0xe6a6('0x27')](0x194);}return _0xc1e9fe;};}function handleError(_0x15f2e3,_0x1db065){_0x1db065=_0x1db065||0x1f4;return function(_0x5c2996){logger['error'](_0x5c2996[_0xe6a6('0x28')]);if(_0x5c2996[_0xe6a6('0x29')]){delete _0x5c2996[_0xe6a6('0x29')];}_0x15f2e3['status'](_0x1db065)[_0xe6a6('0x2a')](_0x5c2996);};}exports[_0xe6a6('0x2b')]=function(_0x4b8478,_0x199b0c){var _0x5e2cac={},_0x3b8fd7={},_0x393080={'count':0x0,'rows':[]};var _0xd9e392=_['map'](db[_0xe6a6('0x2c')][_0xe6a6('0x2d')],function(_0x5c1130){return{'name':_0x5c1130[_0xe6a6('0x2e')],'type':_0x5c1130['type'][_0xe6a6('0x2f')]};});_0x3b8fd7[_0xe6a6('0x30')]=_[_0xe6a6('0x31')](_0xd9e392,_0xe6a6('0x29'));_0x3b8fd7[_0xe6a6('0x32')]=_[_0xe6a6('0x33')](_0x4b8478['query']);_0x3b8fd7[_0xe6a6('0x34')]=_['intersection'](_0x3b8fd7[_0xe6a6('0x30')],_0x3b8fd7[_0xe6a6('0x32')]);_0x5e2cac[_0xe6a6('0x35')]=_[_0xe6a6('0x36')](_0x3b8fd7[_0xe6a6('0x30')],qs['fields'](_0x4b8478[_0xe6a6('0x32')][_0xe6a6('0x37')]));_0x5e2cac[_0xe6a6('0x35')]=_0x5e2cac[_0xe6a6('0x35')]['length']?_0x5e2cac['attributes']:_0x3b8fd7[_0xe6a6('0x30')];if(!_0x4b8478[_0xe6a6('0x32')][_0xe6a6('0x38')]('nolimit')){_0x5e2cac[_0xe6a6('0x1f')]=qs[_0xe6a6('0x1f')](_0x4b8478[_0xe6a6('0x32')]['limit']);_0x5e2cac[_0xe6a6('0x1e')]=qs[_0xe6a6('0x1e')](_0x4b8478[_0xe6a6('0x32')][_0xe6a6('0x1e')]);}_0x5e2cac['order']=qs[_0xe6a6('0x39')](_0x4b8478['query'][_0xe6a6('0x39')]);_0x5e2cac[_0xe6a6('0x3a')]=qs[_0xe6a6('0x34')](_[_0xe6a6('0x3b')](_0x4b8478[_0xe6a6('0x32')],_0x3b8fd7[_0xe6a6('0x34')]),_0xd9e392);if(_0x4b8478[_0xe6a6('0x32')][_0xe6a6('0x3c')]){_0x5e2cac[_0xe6a6('0x3a')]=_['merge'](_0x5e2cac[_0xe6a6('0x3a')],{'$or':_['map'](_0xd9e392,function(_0x3d4f71){if(_0x3d4f71[_0xe6a6('0x3d')]!==_0xe6a6('0x3e')){var _0x129239={};_0x129239[_0x3d4f71['name']]={'$like':'%'+_0x4b8478[_0xe6a6('0x32')]['filter']+'%'};return _0x129239;}})});}_0x5e2cac=_[_0xe6a6('0x3f')]({},_0x5e2cac,_0x4b8478[_0xe6a6('0x40')]);var _0x51a340={'where':_0x5e2cac[_0xe6a6('0x3a')]};return db[_0xe6a6('0x2c')][_0xe6a6('0x1d')](_0x51a340)['then'](function(_0x955b81){_0x393080['count']=_0x955b81;if(_0x4b8478[_0xe6a6('0x32')][_0xe6a6('0x41')]){_0x5e2cac[_0xe6a6('0x42')]=[{'all':!![]}];}return db[_0xe6a6('0x2c')][_0xe6a6('0x43')](_0x5e2cac);})[_0xe6a6('0x25')](function(_0x8e142f){_0x393080[_0xe6a6('0x44')]=_0x8e142f;return _0x393080;})['then'](respondWithFilteredResult(_0x199b0c,_0x5e2cac))['catch'](handleError(_0x199b0c,null));};exports[_0xe6a6('0x45')]=function(_0x5a89c8,_0x474a2b){var _0x1bf04d={'raw':!![],'where':{'id':_0x5a89c8[_0xe6a6('0x46')]['id']}},_0x291763={};_0x291763[_0xe6a6('0x30')]=_[_0xe6a6('0x33')](db[_0xe6a6('0x2c')][_0xe6a6('0x2d')]);_0x291763[_0xe6a6('0x32')]=_[_0xe6a6('0x33')](_0x5a89c8['query']);_0x291763[_0xe6a6('0x34')]=_[_0xe6a6('0x36')](_0x291763['model'],_0x291763['query']);_0x1bf04d[_0xe6a6('0x35')]=_[_0xe6a6('0x36')](_0x291763['model'],qs[_0xe6a6('0x37')](_0x5a89c8[_0xe6a6('0x32')][_0xe6a6('0x37')]));_0x1bf04d['attributes']=_0x1bf04d['attributes'][_0xe6a6('0x47')]?_0x1bf04d[_0xe6a6('0x35')]:_0x291763[_0xe6a6('0x30')];if(_0x5a89c8[_0xe6a6('0x32')][_0xe6a6('0x41')]){_0x1bf04d[_0xe6a6('0x42')]=[{'all':!![]}];}_0x1bf04d=_[_0xe6a6('0x3f')]({},_0x1bf04d,_0x5a89c8[_0xe6a6('0x40')]);return db[_0xe6a6('0x2c')][_0xe6a6('0x48')](_0x1bf04d)[_0xe6a6('0x25')](handleEntityNotFound(_0x474a2b,null))[_0xe6a6('0x25')](respondWithResult(_0x474a2b,null))['catch'](handleError(_0x474a2b,null));};exports[_0xe6a6('0x49')]=function(_0x14c5fe,_0xdd787c){return db[_0xe6a6('0x2c')][_0xe6a6('0x49')](_0x14c5fe[_0xe6a6('0x4a')],{})[_0xe6a6('0x25')](respondWithResult(_0xdd787c,0xc9))['catch'](handleError(_0xdd787c,null));};exports[_0xe6a6('0x24')]=function(_0x22d172,_0x4f1089){if(_0x22d172[_0xe6a6('0x4a')]['id']){delete _0x22d172[_0xe6a6('0x4a')]['id'];}return db[_0xe6a6('0x2c')][_0xe6a6('0x48')]({'where':{'id':_0x22d172[_0xe6a6('0x46')]['id']}})[_0xe6a6('0x25')](handleEntityNotFound(_0x4f1089,null))[_0xe6a6('0x25')](saveUpdates(_0x22d172[_0xe6a6('0x4a')],null))['then'](respondWithResult(_0x4f1089,null))[_0xe6a6('0x4b')](handleError(_0x4f1089,null));};exports['destroy']=function(_0x129549,_0x5f35df){return db['WhatsappQueueReport'][_0xe6a6('0x48')]({'where':{'id':_0x129549[_0xe6a6('0x46')]['id']}})[_0xe6a6('0x25')](handleEntityNotFound(_0x5f35df,null))[_0xe6a6('0x25')](removeEntity(_0x5f35df,null))['catch'](handleError(_0x5f35df,null));};exports[_0xe6a6('0x4c')]=function(_0x1ded01,_0x922632){return db[_0xe6a6('0x2c')][_0xe6a6('0x4c')]()[_0xe6a6('0x25')](respondWithResult(_0x922632,null))[_0xe6a6('0x4b')](handleError(_0x922632,null));};
\ No newline at end of file
+var _0x6a58=['jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/environment','../../mysqldb','status','end','json','count','limit','set','Content-Range','reject','save','update','then','stack','name','send','index','map','WhatsappQueueReport','rawAttributes','fieldName','type','key','keys','filters','intersection','model','query','attributes','fields','length','hasOwnProperty','nolimit','offset','order','sort','pick','merge','where','VIRTUAL','filter','options','includeAll','findAll','rows','catch','show','params','include','create','body','find','describe','html-pdf','eml-format','zip-dir','request-promise','bluebird','mustache','util','path','sox','ejs','lodash','crypto'];(function(_0x2c1ee7,_0x3443b8){var _0x2f9e25=function(_0xee88bf){while(--_0xee88bf){_0x2c1ee7['push'](_0x2c1ee7['shift']());}};_0x2f9e25(++_0x3443b8);}(_0x6a58,0x120));var _0x86a5=function(_0x548d7d,_0x2d41fc){_0x548d7d=_0x548d7d-0x0;var _0xb1c878=_0x6a58[_0x548d7d];return _0xb1c878;};'use strict';var pdf=require(_0x86a5('0x0'));var emlformat=require(_0x86a5('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x86a5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x86a5('0x3'));var moment=require('moment');var BPromise=require(_0x86a5('0x4'));var Mustache=require(_0x86a5('0x5'));var util=require(_0x86a5('0x6'));var path=require(_0x86a5('0x7'));var sox=require(_0x86a5('0x8'));var csv=require('to-csv');var ejs=require(_0x86a5('0x9'));var fs=require('fs');var _=require(_0x86a5('0xa'));var squel=require('squel');var crypto=require(_0x86a5('0xb'));var jsforce=require(_0x86a5('0xc'));var deskjs=require(_0x86a5('0xd'));var toCsv=require(_0x86a5('0xe'));var querystring=require(_0x86a5('0xf'));var Papa=require(_0x86a5('0x10'));var Redis=require(_0x86a5('0x11'));var authService=require(_0x86a5('0x12'));var qs=require(_0x86a5('0x13'));var as=require(_0x86a5('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x86a5('0x15'));var utils=require('../../config/utils');var config=require(_0x86a5('0x16'));var db=require(_0x86a5('0x17'))['db'];function respondWithStatusCode(_0x4b560c,_0x2df079){_0x2df079=_0x2df079||0xcc;return function(_0x320af5){if(_0x320af5){return _0x4b560c['sendStatus'](_0x2df079);}return _0x4b560c[_0x86a5('0x18')](_0x2df079)[_0x86a5('0x19')]();};}function respondWithResult(_0x57730b,_0x40dcf6){_0x40dcf6=_0x40dcf6||0xc8;return function(_0x156a2b){if(_0x156a2b){return _0x57730b[_0x86a5('0x18')](_0x40dcf6)[_0x86a5('0x1a')](_0x156a2b);}};}function respondWithFilteredResult(_0x41661c,_0x5bbdbe){return function(_0x485829){if(_0x485829){var _0x12999d=_0x485829[_0x86a5('0x1b')],_0x5c3c99=_0x5bbdbe['offset'],_0x61d809=_0x5bbdbe['offset']+_0x5bbdbe[_0x86a5('0x1c')],_0x2a9b90;if(_0x61d809>=_0x12999d){_0x61d809=_0x12999d;_0x2a9b90=0xc8;}else{_0x2a9b90=0xce;}_0x41661c[_0x86a5('0x18')](_0x2a9b90);return _0x41661c[_0x86a5('0x1d')](_0x86a5('0x1e'),_0x5c3c99+'-'+_0x61d809+'/'+_0x12999d)[_0x86a5('0x1a')](_0x485829);}return null;};}function patchUpdates(_0x5dc885){return function(_0x44d076){try{jsonpatch['apply'](_0x44d076,_0x5dc885,!![]);}catch(_0x2a90cd){return BPromise[_0x86a5('0x1f')](_0x2a90cd);}return _0x44d076[_0x86a5('0x20')]();};}function saveUpdates(_0x3f306c,_0x1f79b1){return function(_0x390feb){if(_0x390feb){return _0x390feb[_0x86a5('0x21')](_0x3f306c)[_0x86a5('0x22')](function(_0x4f510f){return _0x4f510f;});}return null;};}function removeEntity(_0x48d851,_0x1f0af0){return function(_0x39dcde){if(_0x39dcde){return _0x39dcde['destroy']()['then'](function(){_0x48d851['status'](0xcc)[_0x86a5('0x19')]();});}};}function handleEntityNotFound(_0x2960f7,_0x2ef076){return function(_0x512df9){if(!_0x512df9){_0x2960f7['sendStatus'](0x194);}return _0x512df9;};}function handleError(_0x2a9dee,_0x33d7d7){_0x33d7d7=_0x33d7d7||0x1f4;return function(_0x41c449){logger['error'](_0x41c449[_0x86a5('0x23')]);if(_0x41c449['name']){delete _0x41c449[_0x86a5('0x24')];}_0x2a9dee['status'](_0x33d7d7)[_0x86a5('0x25')](_0x41c449);};}exports[_0x86a5('0x26')]=function(_0x1447c4,_0x19049d){var _0x3af4a5={},_0x887e58={},_0x56ffff={'count':0x0,'rows':[]};var _0x4fd466=_[_0x86a5('0x27')](db[_0x86a5('0x28')][_0x86a5('0x29')],function(_0xcbf54e){return{'name':_0xcbf54e[_0x86a5('0x2a')],'type':_0xcbf54e[_0x86a5('0x2b')][_0x86a5('0x2c')]};});_0x887e58['model']=_[_0x86a5('0x27')](_0x4fd466,'name');_0x887e58['query']=_[_0x86a5('0x2d')](_0x1447c4['query']);_0x887e58[_0x86a5('0x2e')]=_[_0x86a5('0x2f')](_0x887e58[_0x86a5('0x30')],_0x887e58[_0x86a5('0x31')]);_0x3af4a5[_0x86a5('0x32')]=_[_0x86a5('0x2f')](_0x887e58[_0x86a5('0x30')],qs[_0x86a5('0x33')](_0x1447c4[_0x86a5('0x31')][_0x86a5('0x33')]));_0x3af4a5[_0x86a5('0x32')]=_0x3af4a5[_0x86a5('0x32')][_0x86a5('0x34')]?_0x3af4a5[_0x86a5('0x32')]:_0x887e58['model'];if(!_0x1447c4[_0x86a5('0x31')][_0x86a5('0x35')](_0x86a5('0x36'))){_0x3af4a5[_0x86a5('0x1c')]=qs[_0x86a5('0x1c')](_0x1447c4[_0x86a5('0x31')][_0x86a5('0x1c')]);_0x3af4a5['offset']=qs['offset'](_0x1447c4[_0x86a5('0x31')][_0x86a5('0x37')]);}_0x3af4a5[_0x86a5('0x38')]=qs[_0x86a5('0x39')](_0x1447c4[_0x86a5('0x31')][_0x86a5('0x39')]);_0x3af4a5['where']=qs[_0x86a5('0x2e')](_[_0x86a5('0x3a')](_0x1447c4['query'],_0x887e58[_0x86a5('0x2e')]),_0x4fd466);if(_0x1447c4[_0x86a5('0x31')]['filter']){_0x3af4a5['where']=_[_0x86a5('0x3b')](_0x3af4a5[_0x86a5('0x3c')],{'$or':_[_0x86a5('0x27')](_0x4fd466,function(_0x19fffc){if(_0x19fffc['type']!==_0x86a5('0x3d')){var _0x21452b={};_0x21452b[_0x19fffc[_0x86a5('0x24')]]={'$like':'%'+_0x1447c4[_0x86a5('0x31')][_0x86a5('0x3e')]+'%'};return _0x21452b;}})});}_0x3af4a5=_['merge']({},_0x3af4a5,_0x1447c4[_0x86a5('0x3f')]);var _0xc11519={'where':_0x3af4a5[_0x86a5('0x3c')]};return db['WhatsappQueueReport'][_0x86a5('0x1b')](_0xc11519)['then'](function(_0x4c84a0){_0x56ffff['count']=_0x4c84a0;if(_0x1447c4[_0x86a5('0x31')][_0x86a5('0x40')]){_0x3af4a5['include']=[{'all':!![]}];}return db[_0x86a5('0x28')][_0x86a5('0x41')](_0x3af4a5);})['then'](function(_0x16f834){_0x56ffff[_0x86a5('0x42')]=_0x16f834;return _0x56ffff;})[_0x86a5('0x22')](respondWithFilteredResult(_0x19049d,_0x3af4a5))[_0x86a5('0x43')](handleError(_0x19049d,null));};exports[_0x86a5('0x44')]=function(_0x1998e2,_0x4672fd){var _0x4d4cb3={'raw':!![],'where':{'id':_0x1998e2[_0x86a5('0x45')]['id']}},_0x39a675={};_0x39a675[_0x86a5('0x30')]=_[_0x86a5('0x2d')](db[_0x86a5('0x28')]['rawAttributes']);_0x39a675[_0x86a5('0x31')]=_['keys'](_0x1998e2[_0x86a5('0x31')]);_0x39a675[_0x86a5('0x2e')]=_[_0x86a5('0x2f')](_0x39a675[_0x86a5('0x30')],_0x39a675[_0x86a5('0x31')]);_0x4d4cb3['attributes']=_[_0x86a5('0x2f')](_0x39a675[_0x86a5('0x30')],qs['fields'](_0x1998e2[_0x86a5('0x31')][_0x86a5('0x33')]));_0x4d4cb3[_0x86a5('0x32')]=_0x4d4cb3[_0x86a5('0x32')][_0x86a5('0x34')]?_0x4d4cb3[_0x86a5('0x32')]:_0x39a675[_0x86a5('0x30')];if(_0x1998e2[_0x86a5('0x31')][_0x86a5('0x40')]){_0x4d4cb3[_0x86a5('0x46')]=[{'all':!![]}];}_0x4d4cb3=_[_0x86a5('0x3b')]({},_0x4d4cb3,_0x1998e2['options']);return db['WhatsappQueueReport']['find'](_0x4d4cb3)[_0x86a5('0x22')](handleEntityNotFound(_0x4672fd,null))[_0x86a5('0x22')](respondWithResult(_0x4672fd,null))[_0x86a5('0x43')](handleError(_0x4672fd,null));};exports[_0x86a5('0x47')]=function(_0x669466,_0x365b2d){return db['WhatsappQueueReport'][_0x86a5('0x47')](_0x669466[_0x86a5('0x48')],{})['then'](respondWithResult(_0x365b2d,0xc9))[_0x86a5('0x43')](handleError(_0x365b2d,null));};exports[_0x86a5('0x21')]=function(_0x18aeab,_0xb1e8fc){if(_0x18aeab[_0x86a5('0x48')]['id']){delete _0x18aeab[_0x86a5('0x48')]['id'];}return db['WhatsappQueueReport'][_0x86a5('0x49')]({'where':{'id':_0x18aeab[_0x86a5('0x45')]['id']}})[_0x86a5('0x22')](handleEntityNotFound(_0xb1e8fc,null))[_0x86a5('0x22')](saveUpdates(_0x18aeab[_0x86a5('0x48')],null))[_0x86a5('0x22')](respondWithResult(_0xb1e8fc,null))[_0x86a5('0x43')](handleError(_0xb1e8fc,null));};exports['destroy']=function(_0x599412,_0x1fb196){return db['WhatsappQueueReport']['find']({'where':{'id':_0x599412[_0x86a5('0x45')]['id']}})[_0x86a5('0x22')](handleEntityNotFound(_0x1fb196,null))[_0x86a5('0x22')](removeEntity(_0x1fb196,null))[_0x86a5('0x43')](handleError(_0x1fb196,null));};exports[_0x86a5('0x4a')]=function(_0x572a31,_0x5e5e8c){return db[_0x86a5('0x28')][_0x86a5('0x4a')]()[_0x86a5('0x22')](respondWithResult(_0x5e5e8c,null))[_0x86a5('0x43')](handleError(_0x5e5e8c,null));};
\ No newline at end of file
diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.model.js b/server/api/whatsappQueueReport/whatsappQueueReport.model.js
index 630483a..fbb4671 100644
--- a/server/api/whatsappQueueReport/whatsappQueueReport.model.js
+++ b/server/api/whatsappQueueReport/whatsappQueueReport.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7d81=['lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./whatsappQueueReport.attributes','exports','define','report_whatsapp_queue','uniqueid'];(function(_0x2cd02e,_0xaa73d){var _0x123a49=function(_0x464c2d){while(--_0x464c2d){_0x2cd02e['push'](_0x2cd02e['shift']());}};_0x123a49(++_0xaa73d);}(_0x7d81,0xc3));var _0x17d8=function(_0x1db0aa,_0x45dbff){_0x1db0aa=_0x1db0aa-0x0;var _0x171c0e=_0x7d81[_0x1db0aa];return _0x171c0e;};'use strict';var _=require(_0x17d8('0x0'));var util=require(_0x17d8('0x1'));var logger=require(_0x17d8('0x2'))('api');var moment=require(_0x17d8('0x3'));var BPromise=require(_0x17d8('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x17d8('0x5'));var rimraf=require(_0x17d8('0x6'));var config=require(_0x17d8('0x7'));var attributes=require(_0x17d8('0x8'));module[_0x17d8('0x9')]=function(_0x571508,_0x5a9d39){return _0x571508[_0x17d8('0xa')]('WhatsappQueueReport',attributes,{'tableName':_0x17d8('0xb'),'paranoid':![],'indexes':[{'name':_0x17d8('0xc'),'fields':[_0x17d8('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x5707=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./whatsappQueueReport.attributes','exports','uniqueid','lodash','../../config/logger','api'];(function(_0x3c33c4,_0x3490ea){var _0x2c4b73=function(_0x30c053){while(--_0x30c053){_0x3c33c4['push'](_0x3c33c4['shift']());}};_0x2c4b73(++_0x3490ea);}(_0x5707,0x1b9));var _0x7570=function(_0x1b5080,_0x3e7cc9){_0x1b5080=_0x1b5080-0x0;var _0x195c87=_0x5707[_0x1b5080];return _0x195c87;};'use strict';var _=require(_0x7570('0x0'));var util=require('util');var logger=require(_0x7570('0x1'))(_0x7570('0x2'));var moment=require(_0x7570('0x3'));var BPromise=require(_0x7570('0x4'));var rp=require(_0x7570('0x5'));var fs=require('fs');var path=require(_0x7570('0x6'));var rimraf=require(_0x7570('0x7'));var config=require(_0x7570('0x8'));var attributes=require(_0x7570('0x9'));module[_0x7570('0xa')]=function(_0x2ec0f0,_0x3e58ff){return _0x2ec0f0['define']('WhatsappQueueReport',attributes,{'tableName':'report_whatsapp_queue','paranoid':![],'indexes':[{'name':_0x7570('0xb'),'fields':[_0x7570('0xb')]}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.rpc.js b/server/api/whatsappQueueReport/whatsappQueueReport.rpc.js
index 01c1142..5968560 100644
--- a/server/api/whatsappQueueReport/whatsappQueueReport.rpc.js
+++ b/server/api/whatsappQueueReport/whatsappQueueReport.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xb48f=['WhatsappQueueReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','CreateWhatsappQueueReport','body','options','raw','UpdateWhatsappQueueReport','WhatsappQueueReport','where','attributes','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','then','info'];(function(_0x36b355,_0x168752){var _0x1510d8=function(_0x58e943){while(--_0x58e943){_0x36b355['push'](_0x36b355['shift']());}};_0x1510d8(++_0x168752);}(_0xb48f,0x1e4));var _0xfb48=function(_0x262734,_0x6a7eb2){_0x262734=_0x262734-0x0;var _0x52c6c8=_0xb48f[_0x262734];return _0x52c6c8;};'use strict';var _=require('lodash');var util=require(_0xfb48('0x0'));var moment=require(_0xfb48('0x1'));var BPromise=require(_0xfb48('0x2'));var rs=require(_0xfb48('0x3'));var fs=require('fs');var Redis=require(_0xfb48('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xfb48('0x5'))(_0xfb48('0x6'));var config=require(_0xfb48('0x7'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3e9596,_0x3c60f5,_0xe001ad){return new BPromise(function(_0x457624,_0x3ce3db){return client['request'](_0x3e9596,_0xe001ad)[_0xfb48('0x8')](function(_0x25e663){logger[_0xfb48('0x9')](_0xfb48('0xa'),_0x3c60f5,_0xfb48('0xb'));logger[_0xfb48('0xc')]('WhatsappQueueReport,\x20%s,\x20%s,\x20%s',_0x3c60f5,_0xfb48('0xb'),JSON[_0xfb48('0xd')](_0x25e663));if(_0x25e663[_0xfb48('0xe')]){if(_0x25e663[_0xfb48('0xe')]['code']===0x1f4){logger['error']('WhatsappQueueReport,\x20%s,\x20%s',_0x3c60f5,_0x25e663['error'][_0xfb48('0xf')]);return _0x3ce3db(_0x25e663[_0xfb48('0xe')][_0xfb48('0xf')]);}logger['error'](_0xfb48('0xa'),_0x3c60f5,_0x25e663['error'][_0xfb48('0xf')]);return _0x457624(_0x25e663[_0xfb48('0xe')][_0xfb48('0xf')]);}else{logger[_0xfb48('0x9')](_0xfb48('0xa'),_0x3c60f5,_0xfb48('0xb'));_0x457624(_0x25e663[_0xfb48('0x10')]['message']);}})[_0xfb48('0x11')](function(_0x555b3f){logger['error'](_0xfb48('0xa'),_0x3c60f5,_0x555b3f);_0x3ce3db(_0x555b3f);});});}exports[_0xfb48('0x12')]=function(_0x2a8fce){var _0x243a16=this;return new Promise(function(_0x1f19d8,_0x2a33ea){return db['WhatsappQueueReport']['create'](_0x2a8fce[_0xfb48('0x13')],{'raw':_0x2a8fce[_0xfb48('0x14')]?_0x2a8fce[_0xfb48('0x14')][_0xfb48('0x15')]===undefined?!![]:![]:!![]})[_0xfb48('0x8')](function(_0xbab24a){logger[_0xfb48('0x9')](_0xfb48('0x12'),_0x2a8fce);logger[_0xfb48('0xc')](_0xfb48('0x12'),_0x2a8fce,JSON['stringify'](_0xbab24a));_0x1f19d8(_0xbab24a);})[_0xfb48('0x11')](function(_0x3ccfc0){logger[_0xfb48('0xe')](_0xfb48('0x12'),_0x3ccfc0[_0xfb48('0xf')],_0x2a8fce);_0x2a33ea(_0x243a16['error'](0x1f4,_0x3ccfc0[_0xfb48('0xf')]));});});};exports[_0xfb48('0x16')]=function(_0x158c30){var _0xdba0c=this;return new Promise(function(_0x2d14d6,_0xf64ded){return db[_0xfb48('0x17')]['update'](_0x158c30[_0xfb48('0x13')],{'raw':_0x158c30[_0xfb48('0x14')]?_0x158c30[_0xfb48('0x14')][_0xfb48('0x15')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x158c30[_0xfb48('0x14')]?_0x158c30['options'][_0xfb48('0x18')]||null:null,'attributes':_0x158c30[_0xfb48('0x14')]?_0x158c30[_0xfb48('0x14')][_0xfb48('0x19')]||null:null,'limit':_0x158c30[_0xfb48('0x14')]?_0x158c30['options']['limit']||null:null})['then'](function(_0x3561ce){logger[_0xfb48('0x9')](_0xfb48('0x16'),_0x158c30);logger[_0xfb48('0xc')](_0xfb48('0x16'),_0x158c30,JSON[_0xfb48('0xd')](_0x3561ce));_0x2d14d6(_0x3561ce);})[_0xfb48('0x11')](function(_0x3e1efc){logger[_0xfb48('0xe')](_0xfb48('0x16'),_0x3e1efc[_0xfb48('0xf')],_0x158c30);_0xf64ded(_0xdba0c[_0xfb48('0xe')](0x1f4,_0x3e1efc[_0xfb48('0xf')]));});});};
\ No newline at end of file
+var _0x1196=['result','catch','body','options','raw','CreateWhatsappQueueReport','debug','UpdateWhatsappQueueReport','WhatsappQueueReport','update','attributes','limit','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','then','info','WhatsappQueueReport,\x20%s,\x20%s','request\x20sent','WhatsappQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x1230ea,_0x499a33){var _0xe946e2=function(_0x29a4e9){while(--_0x29a4e9){_0x1230ea['push'](_0x1230ea['shift']());}};_0xe946e2(++_0x499a33);}(_0x1196,0x156));var _0x6119=function(_0x58ccec,_0x176ed2){_0x58ccec=_0x58ccec-0x0;var _0x33e59a=_0x1196[_0x58ccec];return _0x33e59a;};'use strict';var _=require(_0x6119('0x0'));var util=require(_0x6119('0x1'));var moment=require(_0x6119('0x2'));var BPromise=require(_0x6119('0x3'));var rs=require(_0x6119('0x4'));var fs=require('fs');var Redis=require(_0x6119('0x5'));var db=require(_0x6119('0x6'))['db'];var utils=require(_0x6119('0x7'));var logger=require(_0x6119('0x8'))(_0x6119('0x9'));var config=require('../../config/environment');var jayson=require(_0x6119('0xa'));var client=jayson['client'][_0x6119('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x330904,_0x1a2d2c,_0x546753){return new BPromise(function(_0x4c2600,_0x357625){return client['request'](_0x330904,_0x546753)[_0x6119('0xc')](function(_0x2120e8){logger[_0x6119('0xd')](_0x6119('0xe'),_0x1a2d2c,_0x6119('0xf'));logger['debug'](_0x6119('0x10'),_0x1a2d2c,_0x6119('0xf'),JSON[_0x6119('0x11')](_0x2120e8));if(_0x2120e8['error']){if(_0x2120e8[_0x6119('0x12')][_0x6119('0x13')]===0x1f4){logger['error'](_0x6119('0xe'),_0x1a2d2c,_0x2120e8[_0x6119('0x12')][_0x6119('0x14')]);return _0x357625(_0x2120e8['error'][_0x6119('0x14')]);}logger[_0x6119('0x12')]('WhatsappQueueReport,\x20%s,\x20%s',_0x1a2d2c,_0x2120e8[_0x6119('0x12')][_0x6119('0x14')]);return _0x4c2600(_0x2120e8[_0x6119('0x12')][_0x6119('0x14')]);}else{logger[_0x6119('0xd')](_0x6119('0xe'),_0x1a2d2c,_0x6119('0xf'));_0x4c2600(_0x2120e8[_0x6119('0x15')][_0x6119('0x14')]);}})[_0x6119('0x16')](function(_0x415a82){logger[_0x6119('0x12')]('WhatsappQueueReport,\x20%s,\x20%s',_0x1a2d2c,_0x415a82);_0x357625(_0x415a82);});});}exports['CreateWhatsappQueueReport']=function(_0x2d179d){var _0x554be9=this;return new Promise(function(_0x13c5ac,_0x5bfa3a){return db['WhatsappQueueReport']['create'](_0x2d179d[_0x6119('0x17')],{'raw':_0x2d179d[_0x6119('0x18')]?_0x2d179d[_0x6119('0x18')][_0x6119('0x19')]===undefined?!![]:![]:!![]})[_0x6119('0xc')](function(_0x464e76){logger[_0x6119('0xd')](_0x6119('0x1a'),_0x2d179d);logger[_0x6119('0x1b')](_0x6119('0x1a'),_0x2d179d,JSON[_0x6119('0x11')](_0x464e76));_0x13c5ac(_0x464e76);})[_0x6119('0x16')](function(_0x13b913){logger[_0x6119('0x12')]('CreateWhatsappQueueReport',_0x13b913['message'],_0x2d179d);_0x5bfa3a(_0x554be9[_0x6119('0x12')](0x1f4,_0x13b913[_0x6119('0x14')]));});});};exports[_0x6119('0x1c')]=function(_0x3b80c5){var _0x106e35=this;return new Promise(function(_0xf5eddc,_0x3e06bb){return db[_0x6119('0x1d')][_0x6119('0x1e')](_0x3b80c5[_0x6119('0x17')],{'raw':_0x3b80c5['options']?_0x3b80c5[_0x6119('0x18')][_0x6119('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3b80c5[_0x6119('0x18')]?_0x3b80c5[_0x6119('0x18')]['where']||null:null,'attributes':_0x3b80c5[_0x6119('0x18')]?_0x3b80c5['options'][_0x6119('0x1f')]||null:null,'limit':_0x3b80c5[_0x6119('0x18')]?_0x3b80c5[_0x6119('0x18')][_0x6119('0x20')]||null:null})['then'](function(_0x2362c8){logger[_0x6119('0xd')]('UpdateWhatsappQueueReport',_0x3b80c5);logger[_0x6119('0x1b')](_0x6119('0x1c'),_0x3b80c5,JSON[_0x6119('0x11')](_0x2362c8));_0xf5eddc(_0x2362c8);})[_0x6119('0x16')](function(_0x358863){logger[_0x6119('0x12')](_0x6119('0x1c'),_0x358863['message'],_0x3b80c5);_0x3e06bb(_0x106e35['error'](0x1f4,_0x358863[_0x6119('0x14')]));});});};
\ No newline at end of file
diff --git a/server/api/whatsappTransferReport/index.js b/server/api/whatsappTransferReport/index.js
index c99744a..4ba1ab5 100644
--- a/server/api/whatsappTransferReport/index.js
+++ b/server/api/whatsappTransferReport/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xdbcd=['exports','util','path','connect-timeout','Router','../../components/interaction/service','../../config/environment','./whatsappTransferReport.controller','get','isAuthenticated','index','/describe','/:id','show','create','delete','destroy'];(function(_0x17d32b,_0x7dfd60){var _0x2a40cf=function(_0x11bcfb){while(--_0x11bcfb){_0x17d32b['push'](_0x17d32b['shift']());}};_0x2a40cf(++_0x7dfd60);}(_0xdbcd,0x67));var _0xddbc=function(_0x323f57,_0x4f68f5){_0x323f57=_0x323f57-0x0;var _0x1813eb=_0xdbcd[_0x323f57];return _0x1813eb;};'use strict';var multer=require('multer');var util=require(_0xddbc('0x0'));var path=require(_0xddbc('0x1'));var timeout=require(_0xddbc('0x2'));var express=require('express');var router=express[_0xddbc('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0xddbc('0x4'));var config=require(_0xddbc('0x5'));var controller=require(_0xddbc('0x6'));router[_0xddbc('0x7')]('/',auth[_0xddbc('0x8')](),controller[_0xddbc('0x9')]);router['get'](_0xddbc('0xa'),auth[_0xddbc('0x8')](),controller['describe']);router[_0xddbc('0x7')](_0xddbc('0xb'),auth[_0xddbc('0x8')](),controller[_0xddbc('0xc')]);router['post']('/',auth['isAuthenticated'](),controller[_0xddbc('0xd')]);router['put'](_0xddbc('0xb'),auth['isAuthenticated'](),controller['update']);router[_0xddbc('0xe')](_0xddbc('0xb'),auth['isAuthenticated'](),controller[_0xddbc('0xf')]);module[_0xddbc('0x10')]=router;
\ No newline at end of file
+var _0xf4bb=['describe','get','/:id','show','post','create','update','exports','multer','util','connect-timeout','Router','../../components/interaction/service','../../config/environment','./whatsappTransferReport.controller','isAuthenticated','/describe'];(function(_0x2ffd05,_0x1840e3){var _0x5038bf=function(_0xe7e075){while(--_0xe7e075){_0x2ffd05['push'](_0x2ffd05['shift']());}};_0x5038bf(++_0x1840e3);}(_0xf4bb,0x118));var _0xbf4b=function(_0x5bd426,_0x4878e5){_0x5bd426=_0x5bd426-0x0;var _0x23a7eb=_0xf4bb[_0x5bd426];return _0x23a7eb;};'use strict';var multer=require(_0xbf4b('0x0'));var util=require(_0xbf4b('0x1'));var path=require('path');var timeout=require(_0xbf4b('0x2'));var express=require('express');var router=express[_0xbf4b('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0xbf4b('0x4'));var config=require(_0xbf4b('0x5'));var controller=require(_0xbf4b('0x6'));router['get']('/',auth[_0xbf4b('0x7')](),controller['index']);router['get'](_0xbf4b('0x8'),auth['isAuthenticated'](),controller[_0xbf4b('0x9')]);router[_0xbf4b('0xa')](_0xbf4b('0xb'),auth[_0xbf4b('0x7')](),controller[_0xbf4b('0xc')]);router[_0xbf4b('0xd')]('/',auth[_0xbf4b('0x7')](),controller[_0xbf4b('0xe')]);router['put'](_0xbf4b('0xb'),auth[_0xbf4b('0x7')](),controller[_0xbf4b('0xf')]);router['delete'](_0xbf4b('0xb'),auth[_0xbf4b('0x7')](),controller['destroy']);module[_0xbf4b('0x10')]=router;
\ No newline at end of file
diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.attributes.js b/server/api/whatsappTransferReport/whatsappTransferReport.attributes.js
index 0bad5f3..53c1f53 100644
--- a/server/api/whatsappTransferReport/whatsappTransferReport.attributes.js
+++ b/server/api/whatsappTransferReport/whatsappTransferReport.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xbaf0=['ENUM','account','agent','queue','exports','STRING'];(function(_0x3d7a61,_0xe8d0ec){var _0x58e78e=function(_0x27a2e5){while(--_0x27a2e5){_0x3d7a61['push'](_0x3d7a61['shift']());}};_0x58e78e(++_0xe8d0ec);}(_0xbaf0,0x12a));var _0x0baf=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0xbaf0[_0x4cf98e];return _0x1623ac;};'use strict';var Sequelize=require('sequelize');module[_0x0baf('0x0')]={'uniqueid':{'type':Sequelize[_0x0baf('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x0baf('0x2')](_0x0baf('0x3'),_0x0baf('0x4'),_0x0baf('0x5')),'allowNull':![]},'transferredAt':{'type':Sequelize['DATE']}};
\ No newline at end of file
+var _0xb10b=['ENUM','account','queue','DATE','sequelize','STRING'];(function(_0x25e7cb,_0x3579b7){var _0x375d92=function(_0xe8cf3b){while(--_0xe8cf3b){_0x25e7cb['push'](_0x25e7cb['shift']());}};_0x375d92(++_0x3579b7);}(_0xb10b,0x12a));var _0xbb10=function(_0x3f1861,_0x7b4285){_0x3f1861=_0x3f1861-0x0;var _0x7ca70a=_0xb10b[_0x3f1861];return _0x7ca70a;};'use strict';var Sequelize=require(_0xbb10('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0xbb10('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0xbb10('0x2')](_0xbb10('0x3'),'agent',_0xbb10('0x4')),'allowNull':![]},'transferredAt':{'type':Sequelize[_0xbb10('0x5')]}};
\ No newline at end of file
diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.controller.js b/server/api/whatsappTransferReport/whatsappTransferReport.controller.js
index b6e40ea..e584312 100644
--- a/server/api/whatsappTransferReport/whatsappTransferReport.controller.js
+++ b/server/api/whatsappTransferReport/whatsappTransferReport.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9ee8=['end','count','offset','limit','set','Content-Range','apply','reject','save','then','error','stack','name','send','index','map','rawAttributes','fieldName','type','model','keys','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','params','WhatsappTransferReport','find','create','update','body','destroy','describe','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','ejs','lodash','jsforce','desk.js','to-csv','querystring','papaparse','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status'];(function(_0x396e61,_0x39d668){var _0x379151=function(_0x296c5f){while(--_0x296c5f){_0x396e61['push'](_0x396e61['shift']());}};_0x379151(++_0x39d668);}(_0x9ee8,0x100));var _0x89ee=function(_0x39b3b2,_0x32c265){_0x39b3b2=_0x39b3b2-0x0;var _0x1e0c72=_0x9ee8[_0x39b3b2];return _0x1e0c72;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x89ee('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x89ee('0x1'));var rp=require(_0x89ee('0x2'));var moment=require(_0x89ee('0x3'));var BPromise=require(_0x89ee('0x4'));var Mustache=require('mustache');var util=require(_0x89ee('0x5'));var path=require(_0x89ee('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x89ee('0x7'));var fs=require('fs');var _=require(_0x89ee('0x8'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x89ee('0x9'));var deskjs=require(_0x89ee('0xa'));var toCsv=require(_0x89ee('0xb'));var querystring=require(_0x89ee('0xc'));var Papa=require(_0x89ee('0xd'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x89ee('0xe'))(_0x89ee('0xf'));var utils=require(_0x89ee('0x10'));var config=require(_0x89ee('0x11'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3563e9,_0x1ad6b3){_0x1ad6b3=_0x1ad6b3||0xcc;return function(_0xd6f8ed){if(_0xd6f8ed){return _0x3563e9[_0x89ee('0x12')](_0x1ad6b3);}return _0x3563e9[_0x89ee('0x13')](_0x1ad6b3)[_0x89ee('0x14')]();};}function respondWithResult(_0x32b4ad,_0x25641a){_0x25641a=_0x25641a||0xc8;return function(_0x2b5a9c){if(_0x2b5a9c){return _0x32b4ad['status'](_0x25641a)['json'](_0x2b5a9c);}};}function respondWithFilteredResult(_0x5eb186,_0x501699){return function(_0x543683){if(_0x543683){var _0x175ca8=_0x543683[_0x89ee('0x15')],_0x16bac3=_0x501699[_0x89ee('0x16')],_0x1b7e26=_0x501699[_0x89ee('0x16')]+_0x501699[_0x89ee('0x17')],_0x2b01d7;if(_0x1b7e26>=_0x175ca8){_0x1b7e26=_0x175ca8;_0x2b01d7=0xc8;}else{_0x2b01d7=0xce;}_0x5eb186[_0x89ee('0x13')](_0x2b01d7);return _0x5eb186[_0x89ee('0x18')](_0x89ee('0x19'),_0x16bac3+'-'+_0x1b7e26+'/'+_0x175ca8)['json'](_0x543683);}return null;};}function patchUpdates(_0x2f21a6){return function(_0x208c3e){try{jsonpatch[_0x89ee('0x1a')](_0x208c3e,_0x2f21a6,!![]);}catch(_0x863719){return BPromise[_0x89ee('0x1b')](_0x863719);}return _0x208c3e[_0x89ee('0x1c')]();};}function saveUpdates(_0x110f54,_0x206131){return function(_0x23ff50){if(_0x23ff50){return _0x23ff50['update'](_0x110f54)[_0x89ee('0x1d')](function(_0x1f59b9){return _0x1f59b9;});}return null;};}function removeEntity(_0x4179cf,_0x5a27cd){return function(_0x572644){if(_0x572644){return _0x572644['destroy']()[_0x89ee('0x1d')](function(){_0x4179cf[_0x89ee('0x13')](0xcc)[_0x89ee('0x14')]();});}};}function handleEntityNotFound(_0x375787,_0x5943d3){return function(_0x2a54ae){if(!_0x2a54ae){_0x375787['sendStatus'](0x194);}return _0x2a54ae;};}function handleError(_0x5584d5,_0x294d36){_0x294d36=_0x294d36||0x1f4;return function(_0x5228f7){logger[_0x89ee('0x1e')](_0x5228f7[_0x89ee('0x1f')]);if(_0x5228f7[_0x89ee('0x20')]){delete _0x5228f7[_0x89ee('0x20')];}_0x5584d5[_0x89ee('0x13')](_0x294d36)[_0x89ee('0x21')](_0x5228f7);};}exports[_0x89ee('0x22')]=function(_0x51044f,_0x42c99d){var _0x3d2658={},_0xbb8fc9={},_0x1a1d7c={'count':0x0,'rows':[]};var _0x53f980=_[_0x89ee('0x23')](db['WhatsappTransferReport'][_0x89ee('0x24')],function(_0x2b85d9){return{'name':_0x2b85d9[_0x89ee('0x25')],'type':_0x2b85d9[_0x89ee('0x26')]['key']};});_0xbb8fc9[_0x89ee('0x27')]=_[_0x89ee('0x23')](_0x53f980,_0x89ee('0x20'));_0xbb8fc9['query']=_[_0x89ee('0x28')](_0x51044f[_0x89ee('0x29')]);_0xbb8fc9['filters']=_[_0x89ee('0x2a')](_0xbb8fc9[_0x89ee('0x27')],_0xbb8fc9['query']);_0x3d2658['attributes']=_['intersection'](_0xbb8fc9[_0x89ee('0x27')],qs[_0x89ee('0x2b')](_0x51044f[_0x89ee('0x29')][_0x89ee('0x2b')]));_0x3d2658[_0x89ee('0x2c')]=_0x3d2658[_0x89ee('0x2c')][_0x89ee('0x2d')]?_0x3d2658['attributes']:_0xbb8fc9[_0x89ee('0x27')];if(!_0x51044f[_0x89ee('0x29')][_0x89ee('0x2e')](_0x89ee('0x2f'))){_0x3d2658[_0x89ee('0x17')]=qs[_0x89ee('0x17')](_0x51044f[_0x89ee('0x29')][_0x89ee('0x17')]);_0x3d2658['offset']=qs['offset'](_0x51044f['query'][_0x89ee('0x16')]);}_0x3d2658[_0x89ee('0x30')]=qs[_0x89ee('0x31')](_0x51044f[_0x89ee('0x29')][_0x89ee('0x31')]);_0x3d2658[_0x89ee('0x32')]=qs[_0x89ee('0x33')](_[_0x89ee('0x34')](_0x51044f[_0x89ee('0x29')],_0xbb8fc9[_0x89ee('0x33')]),_0x53f980);if(_0x51044f[_0x89ee('0x29')][_0x89ee('0x35')]){_0x3d2658[_0x89ee('0x32')]=_[_0x89ee('0x36')](_0x3d2658['where'],{'$or':_[_0x89ee('0x23')](_0x53f980,function(_0x391104){if(_0x391104[_0x89ee('0x26')]!==_0x89ee('0x37')){var _0xb42dfd={};_0xb42dfd[_0x391104['name']]={'$like':'%'+_0x51044f[_0x89ee('0x29')]['filter']+'%'};return _0xb42dfd;}})});}_0x3d2658=_[_0x89ee('0x36')]({},_0x3d2658,_0x51044f[_0x89ee('0x38')]);var _0x3f9ac8={'where':_0x3d2658[_0x89ee('0x32')]};return db['WhatsappTransferReport'][_0x89ee('0x15')](_0x3f9ac8)[_0x89ee('0x1d')](function(_0x28e738){_0x1a1d7c[_0x89ee('0x15')]=_0x28e738;if(_0x51044f[_0x89ee('0x29')][_0x89ee('0x39')]){_0x3d2658[_0x89ee('0x3a')]=[{'all':!![]}];}return db['WhatsappTransferReport'][_0x89ee('0x3b')](_0x3d2658);})[_0x89ee('0x1d')](function(_0x35dda8){_0x1a1d7c['rows']=_0x35dda8;return _0x1a1d7c;})[_0x89ee('0x1d')](respondWithFilteredResult(_0x42c99d,_0x3d2658))[_0x89ee('0x3c')](handleError(_0x42c99d,null));};exports['show']=function(_0x2700c9,_0x4b3a79){var _0xc5defb={'raw':!![],'where':{'id':_0x2700c9[_0x89ee('0x3d')]['id']}},_0x59fb07={};_0x59fb07[_0x89ee('0x27')]=_[_0x89ee('0x28')](db[_0x89ee('0x3e')][_0x89ee('0x24')]);_0x59fb07[_0x89ee('0x29')]=_[_0x89ee('0x28')](_0x2700c9[_0x89ee('0x29')]);_0x59fb07[_0x89ee('0x33')]=_[_0x89ee('0x2a')](_0x59fb07[_0x89ee('0x27')],_0x59fb07[_0x89ee('0x29')]);_0xc5defb['attributes']=_[_0x89ee('0x2a')](_0x59fb07['model'],qs[_0x89ee('0x2b')](_0x2700c9[_0x89ee('0x29')][_0x89ee('0x2b')]));_0xc5defb[_0x89ee('0x2c')]=_0xc5defb['attributes'][_0x89ee('0x2d')]?_0xc5defb[_0x89ee('0x2c')]:_0x59fb07[_0x89ee('0x27')];if(_0x2700c9[_0x89ee('0x29')][_0x89ee('0x39')]){_0xc5defb['include']=[{'all':!![]}];}_0xc5defb=_[_0x89ee('0x36')]({},_0xc5defb,_0x2700c9['options']);return db['WhatsappTransferReport'][_0x89ee('0x3f')](_0xc5defb)['then'](handleEntityNotFound(_0x4b3a79,null))['then'](respondWithResult(_0x4b3a79,null))['catch'](handleError(_0x4b3a79,null));};exports[_0x89ee('0x40')]=function(_0x476aa5,_0x39500f){return db['WhatsappTransferReport'][_0x89ee('0x40')](_0x476aa5['body'],{})[_0x89ee('0x1d')](respondWithResult(_0x39500f,0xc9))[_0x89ee('0x3c')](handleError(_0x39500f,null));};exports[_0x89ee('0x41')]=function(_0x2d5cc4,_0x594b06){if(_0x2d5cc4[_0x89ee('0x42')]['id']){delete _0x2d5cc4[_0x89ee('0x42')]['id'];}return db['WhatsappTransferReport'][_0x89ee('0x3f')]({'where':{'id':_0x2d5cc4[_0x89ee('0x3d')]['id']}})[_0x89ee('0x1d')](handleEntityNotFound(_0x594b06,null))[_0x89ee('0x1d')](saveUpdates(_0x2d5cc4[_0x89ee('0x42')],null))['then'](respondWithResult(_0x594b06,null))[_0x89ee('0x3c')](handleError(_0x594b06,null));};exports[_0x89ee('0x43')]=function(_0x4cbbc7,_0x17e836){return db['WhatsappTransferReport']['find']({'where':{'id':_0x4cbbc7[_0x89ee('0x3d')]['id']}})[_0x89ee('0x1d')](handleEntityNotFound(_0x17e836,null))[_0x89ee('0x1d')](removeEntity(_0x17e836,null))['catch'](handleError(_0x17e836,null));};exports[_0x89ee('0x44')]=function(_0x2169c9,_0x175cac){return db[_0x89ee('0x3e')][_0x89ee('0x44')]()['then'](respondWithResult(_0x175cac,null))[_0x89ee('0x3c')](handleError(_0x175cac,null));};
\ No newline at end of file
+var _0xa165=['pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','find','create','body','destroy','describe','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','count','offset','limit','set','Content-Range','update','then','end','error','stack','name','send','index','map','WhatsappTransferReport','rawAttributes','type','key','query','keys','filters','intersection','fields','attributes','length','model','hasOwnProperty','nolimit','order','sort','where'];(function(_0x268f6f,_0x32ddad){var _0x6a89b0=function(_0x88e820){while(--_0x88e820){_0x268f6f['push'](_0x268f6f['shift']());}};_0x6a89b0(++_0x32ddad);}(_0xa165,0x1d2));var _0x5a16=function(_0x5f3f88,_0x562baf){_0x5f3f88=_0x5f3f88-0x0;var _0xd08119=_0xa165[_0x5f3f88];return _0xd08119;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x5a16('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x5a16('0x1'));var jsonpatch=require(_0x5a16('0x2'));var rp=require(_0x5a16('0x3'));var moment=require('moment');var BPromise=require(_0x5a16('0x4'));var Mustache=require(_0x5a16('0x5'));var util=require('util');var path=require('path');var sox=require(_0x5a16('0x6'));var csv=require(_0x5a16('0x7'));var ejs=require(_0x5a16('0x8'));var fs=require('fs');var _=require(_0x5a16('0x9'));var squel=require(_0x5a16('0xa'));var crypto=require(_0x5a16('0xb'));var jsforce=require(_0x5a16('0xc'));var deskjs=require(_0x5a16('0xd'));var toCsv=require(_0x5a16('0x7'));var querystring=require('querystring');var Papa=require(_0x5a16('0xe'));var Redis=require(_0x5a16('0xf'));var authService=require(_0x5a16('0x10'));var qs=require(_0x5a16('0x11'));var as=require(_0x5a16('0x12'));var hardwareService=require(_0x5a16('0x13'));var logger=require(_0x5a16('0x14'))(_0x5a16('0x15'));var utils=require(_0x5a16('0x16'));var config=require(_0x5a16('0x17'));var db=require(_0x5a16('0x18'))['db'];function respondWithStatusCode(_0x4f37a3,_0x21bf08){_0x21bf08=_0x21bf08||0xcc;return function(_0x56c31f){if(_0x56c31f){return _0x4f37a3[_0x5a16('0x19')](_0x21bf08);}return _0x4f37a3[_0x5a16('0x1a')](_0x21bf08)['end']();};}function respondWithResult(_0x40be17,_0x5d490d){_0x5d490d=_0x5d490d||0xc8;return function(_0xa30cfa){if(_0xa30cfa){return _0x40be17[_0x5a16('0x1a')](_0x5d490d)[_0x5a16('0x1b')](_0xa30cfa);}};}function respondWithFilteredResult(_0x56dfa8,_0x5c0a06){return function(_0x2f240e){if(_0x2f240e){var _0x31093a=_0x2f240e[_0x5a16('0x1c')],_0x2e7dc4=_0x5c0a06['offset'],_0x552be8=_0x5c0a06[_0x5a16('0x1d')]+_0x5c0a06[_0x5a16('0x1e')],_0x570a82;if(_0x552be8>=_0x31093a){_0x552be8=_0x31093a;_0x570a82=0xc8;}else{_0x570a82=0xce;}_0x56dfa8['status'](_0x570a82);return _0x56dfa8[_0x5a16('0x1f')](_0x5a16('0x20'),_0x2e7dc4+'-'+_0x552be8+'/'+_0x31093a)[_0x5a16('0x1b')](_0x2f240e);}return null;};}function patchUpdates(_0x393deb){return function(_0x1c41d8){try{jsonpatch['apply'](_0x1c41d8,_0x393deb,!![]);}catch(_0x5784d0){return BPromise['reject'](_0x5784d0);}return _0x1c41d8['save']();};}function saveUpdates(_0x58aa7d,_0x281bda){return function(_0x44a194){if(_0x44a194){return _0x44a194[_0x5a16('0x21')](_0x58aa7d)[_0x5a16('0x22')](function(_0x26f063){return _0x26f063;});}return null;};}function removeEntity(_0x39bbba,_0x2de0a9){return function(_0x386ecf){if(_0x386ecf){return _0x386ecf['destroy']()[_0x5a16('0x22')](function(){_0x39bbba[_0x5a16('0x1a')](0xcc)[_0x5a16('0x23')]();});}};}function handleEntityNotFound(_0x5543ee,_0x5b5dc6){return function(_0x2bd5a6){if(!_0x2bd5a6){_0x5543ee[_0x5a16('0x19')](0x194);}return _0x2bd5a6;};}function handleError(_0x23bf38,_0xf59ef1){_0xf59ef1=_0xf59ef1||0x1f4;return function(_0x2121b2){logger[_0x5a16('0x24')](_0x2121b2[_0x5a16('0x25')]);if(_0x2121b2[_0x5a16('0x26')]){delete _0x2121b2['name'];}_0x23bf38['status'](_0xf59ef1)[_0x5a16('0x27')](_0x2121b2);};}exports[_0x5a16('0x28')]=function(_0x411645,_0x548f18){var _0x50f6ed={},_0x39c452={},_0x3a1c5d={'count':0x0,'rows':[]};var _0x28e1c6=_[_0x5a16('0x29')](db[_0x5a16('0x2a')][_0x5a16('0x2b')],function(_0x51d768){return{'name':_0x51d768['fieldName'],'type':_0x51d768[_0x5a16('0x2c')][_0x5a16('0x2d')]};});_0x39c452['model']=_[_0x5a16('0x29')](_0x28e1c6,_0x5a16('0x26'));_0x39c452[_0x5a16('0x2e')]=_[_0x5a16('0x2f')](_0x411645[_0x5a16('0x2e')]);_0x39c452[_0x5a16('0x30')]=_[_0x5a16('0x31')](_0x39c452['model'],_0x39c452['query']);_0x50f6ed['attributes']=_['intersection'](_0x39c452['model'],qs[_0x5a16('0x32')](_0x411645['query']['fields']));_0x50f6ed['attributes']=_0x50f6ed[_0x5a16('0x33')][_0x5a16('0x34')]?_0x50f6ed[_0x5a16('0x33')]:_0x39c452[_0x5a16('0x35')];if(!_0x411645[_0x5a16('0x2e')][_0x5a16('0x36')](_0x5a16('0x37'))){_0x50f6ed[_0x5a16('0x1e')]=qs[_0x5a16('0x1e')](_0x411645[_0x5a16('0x2e')][_0x5a16('0x1e')]);_0x50f6ed[_0x5a16('0x1d')]=qs[_0x5a16('0x1d')](_0x411645[_0x5a16('0x2e')][_0x5a16('0x1d')]);}_0x50f6ed[_0x5a16('0x38')]=qs[_0x5a16('0x39')](_0x411645[_0x5a16('0x2e')][_0x5a16('0x39')]);_0x50f6ed[_0x5a16('0x3a')]=qs[_0x5a16('0x30')](_[_0x5a16('0x3b')](_0x411645[_0x5a16('0x2e')],_0x39c452['filters']),_0x28e1c6);if(_0x411645[_0x5a16('0x2e')][_0x5a16('0x3c')]){_0x50f6ed['where']=_[_0x5a16('0x3d')](_0x50f6ed[_0x5a16('0x3a')],{'$or':_['map'](_0x28e1c6,function(_0x22e085){if(_0x22e085[_0x5a16('0x2c')]!==_0x5a16('0x3e')){var _0x1225bf={};_0x1225bf[_0x22e085['name']]={'$like':'%'+_0x411645['query'][_0x5a16('0x3c')]+'%'};return _0x1225bf;}})});}_0x50f6ed=_[_0x5a16('0x3d')]({},_0x50f6ed,_0x411645[_0x5a16('0x3f')]);var _0xcfd4f8={'where':_0x50f6ed[_0x5a16('0x3a')]};return db[_0x5a16('0x2a')]['count'](_0xcfd4f8)[_0x5a16('0x22')](function(_0x32afa7){_0x3a1c5d['count']=_0x32afa7;if(_0x411645[_0x5a16('0x2e')][_0x5a16('0x40')]){_0x50f6ed['include']=[{'all':!![]}];}return db['WhatsappTransferReport'][_0x5a16('0x41')](_0x50f6ed);})[_0x5a16('0x22')](function(_0x437ae7){_0x3a1c5d[_0x5a16('0x42')]=_0x437ae7;return _0x3a1c5d;})[_0x5a16('0x22')](respondWithFilteredResult(_0x548f18,_0x50f6ed))[_0x5a16('0x43')](handleError(_0x548f18,null));};exports[_0x5a16('0x44')]=function(_0x44a481,_0x489654){var _0x325ec8={'raw':!![],'where':{'id':_0x44a481[_0x5a16('0x45')]['id']}},_0x24366f={};_0x24366f['model']=_['keys'](db[_0x5a16('0x2a')][_0x5a16('0x2b')]);_0x24366f[_0x5a16('0x2e')]=_[_0x5a16('0x2f')](_0x44a481['query']);_0x24366f['filters']=_[_0x5a16('0x31')](_0x24366f['model'],_0x24366f[_0x5a16('0x2e')]);_0x325ec8[_0x5a16('0x33')]=_[_0x5a16('0x31')](_0x24366f[_0x5a16('0x35')],qs[_0x5a16('0x32')](_0x44a481[_0x5a16('0x2e')][_0x5a16('0x32')]));_0x325ec8[_0x5a16('0x33')]=_0x325ec8[_0x5a16('0x33')]['length']?_0x325ec8[_0x5a16('0x33')]:_0x24366f[_0x5a16('0x35')];if(_0x44a481[_0x5a16('0x2e')][_0x5a16('0x40')]){_0x325ec8['include']=[{'all':!![]}];}_0x325ec8=_['merge']({},_0x325ec8,_0x44a481[_0x5a16('0x3f')]);return db['WhatsappTransferReport'][_0x5a16('0x46')](_0x325ec8)[_0x5a16('0x22')](handleEntityNotFound(_0x489654,null))[_0x5a16('0x22')](respondWithResult(_0x489654,null))['catch'](handleError(_0x489654,null));};exports[_0x5a16('0x47')]=function(_0x5b65ee,_0x526934){return db['WhatsappTransferReport']['create'](_0x5b65ee[_0x5a16('0x48')],{})[_0x5a16('0x22')](respondWithResult(_0x526934,0xc9))[_0x5a16('0x43')](handleError(_0x526934,null));};exports[_0x5a16('0x21')]=function(_0x7ffe42,_0xf4cf4b){if(_0x7ffe42[_0x5a16('0x48')]['id']){delete _0x7ffe42[_0x5a16('0x48')]['id'];}return db[_0x5a16('0x2a')][_0x5a16('0x46')]({'where':{'id':_0x7ffe42[_0x5a16('0x45')]['id']}})['then'](handleEntityNotFound(_0xf4cf4b,null))[_0x5a16('0x22')](saveUpdates(_0x7ffe42[_0x5a16('0x48')],null))['then'](respondWithResult(_0xf4cf4b,null))[_0x5a16('0x43')](handleError(_0xf4cf4b,null));};exports[_0x5a16('0x49')]=function(_0x4aa4cc,_0x5af288){return db['WhatsappTransferReport'][_0x5a16('0x46')]({'where':{'id':_0x4aa4cc[_0x5a16('0x45')]['id']}})[_0x5a16('0x22')](handleEntityNotFound(_0x5af288,null))['then'](removeEntity(_0x5af288,null))[_0x5a16('0x43')](handleError(_0x5af288,null));};exports[_0x5a16('0x4a')]=function(_0x1eafbb,_0x5381f7){return db[_0x5a16('0x2a')][_0x5a16('0x4a')]()[_0x5a16('0x22')](respondWithResult(_0x5381f7,null))[_0x5a16('0x43')](handleError(_0x5381f7,null));};
\ No newline at end of file
diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.model.js b/server/api/whatsappTransferReport/whatsappTransferReport.model.js
index 85923e6..2ea9cfd 100644
--- a/server/api/whatsappTransferReport/whatsappTransferReport.model.js
+++ b/server/api/whatsappTransferReport/whatsappTransferReport.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xee15=['report_whatsapp_transfer','uniqueid','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./whatsappTransferReport.attributes','exports','define','WhatsappTransferReport'];(function(_0x434c21,_0x3d9d73){var _0x3e7db2=function(_0x4d08ee){while(--_0x4d08ee){_0x434c21['push'](_0x434c21['shift']());}};_0x3e7db2(++_0x3d9d73);}(_0xee15,0xfe));var _0x5ee1=function(_0x209ec9,_0x30378c){_0x209ec9=_0x209ec9-0x0;var _0x129b1b=_0xee15[_0x209ec9];return _0x129b1b;};'use strict';var _=require('lodash');var util=require(_0x5ee1('0x0'));var logger=require(_0x5ee1('0x1'))(_0x5ee1('0x2'));var moment=require(_0x5ee1('0x3'));var BPromise=require(_0x5ee1('0x4'));var rp=require(_0x5ee1('0x5'));var fs=require('fs');var path=require(_0x5ee1('0x6'));var rimraf=require('rimraf');var config=require(_0x5ee1('0x7'));var attributes=require(_0x5ee1('0x8'));module[_0x5ee1('0x9')]=function(_0x42fb31,_0x5029bb){return _0x42fb31[_0x5ee1('0xa')](_0x5ee1('0xb'),attributes,{'tableName':_0x5ee1('0xc'),'paranoid':![],'indexes':[{'name':_0x5ee1('0xd'),'fields':[_0x5ee1('0xd')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x7f15=['request-promise','rimraf','../../config/environment','./whatsappTransferReport.attributes','WhatsappTransferReport','report_whatsapp_transfer','uniqueid','lodash','../../config/logger','moment','bluebird'];(function(_0x4fcbec,_0x90e467){var _0x275177=function(_0x1f706b){while(--_0x1f706b){_0x4fcbec['push'](_0x4fcbec['shift']());}};_0x275177(++_0x90e467);}(_0x7f15,0x80));var _0x57f1=function(_0x57394b,_0x26bfc0){_0x57394b=_0x57394b-0x0;var _0x79f5c3=_0x7f15[_0x57394b];return _0x79f5c3;};'use strict';var _=require(_0x57f1('0x0'));var util=require('util');var logger=require(_0x57f1('0x1'))('api');var moment=require(_0x57f1('0x2'));var BPromise=require(_0x57f1('0x3'));var rp=require(_0x57f1('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x57f1('0x5'));var config=require(_0x57f1('0x6'));var attributes=require(_0x57f1('0x7'));module['exports']=function(_0x5e672e,_0x1522db){return _0x5e672e['define'](_0x57f1('0x8'),attributes,{'tableName':_0x57f1('0x9'),'paranoid':![],'indexes':[{'name':_0x57f1('0xa'),'fields':[_0x57f1('0xa')]}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.rpc.js b/server/api/whatsappTransferReport/whatsappTransferReport.rpc.js
index fc8e612..f9e50f0 100644
--- a/server/api/whatsappTransferReport/whatsappTransferReport.rpc.js
+++ b/server/api/whatsappTransferReport/whatsappTransferReport.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xa9e0=['http','info','WhatsappTransferReport,\x20%s,\x20%s','request\x20sent','debug','WhatsappTransferReport,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x5795b3,_0x281fcc){var _0x62d2d3=function(_0x5b673d){while(--_0x5b673d){_0x5795b3['push'](_0x5795b3['shift']());}};_0x62d2d3(++_0x281fcc);}(_0xa9e0,0x123));var _0x0a9e=function(_0x9aada2,_0xd2d349){_0x9aada2=_0x9aada2-0x0;var _0x196dff=_0xa9e0[_0x9aada2];return _0x196dff;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});}
\ No newline at end of file
+var _0xa9e0=['http','info','WhatsappTransferReport,\x20%s,\x20%s','request\x20sent','debug','WhatsappTransferReport,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x127ce1,_0x4cc67c){var _0x254e44=function(_0x402276){while(--_0x402276){_0x127ce1['push'](_0x127ce1['shift']());}};_0x254e44(++_0x4cc67c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x12d033,_0x25fa2f){_0x12d033=_0x12d033-0x0;var _0x3b4e80=_0xa9e0[_0x12d033];return _0x3b4e80;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});}
\ No newline at end of file
diff --git a/server/app.js b/server/app.js
index b67f668..b1d10a1 100644
--- a/server/app.js
+++ b/server/app.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xc19f=['./config/environment','app','./config/pm2','./config/pm2/config','./config/schedule','./config/schedule/chat','sequelize','sync','then','listen','info','start','Online\x20apps:','map','filter','online','name','join','Offline\x20apps:','status','None','seedDB','./config/seedDB','default','error','Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s','exit','lodash','./mysqldb'];(function(_0x26f308,_0x1c833b){var _0x5af3e3=function(_0x89c274){while(--_0x89c274){_0x26f308['push'](_0x26f308['shift']());}};_0x5af3e3(++_0x1c833b);}(_0xc19f,0x194));var _0xfc19=function(_0x1b8d78,_0x8606df){_0x1b8d78=_0x1b8d78-0x0;var _0x44a515=_0xc19f[_0x1b8d78];return _0x44a515;};'use strict';var _=require(_0xfc19('0x0'));var mysqldb=require(_0xfc19('0x1'));var rpc=require('./rpc');var config=require(_0xfc19('0x2'));var logger=require('./config/logger')(_0xfc19('0x3'));var pm2=require(_0xfc19('0x4'));var pm2Config=require(_0xfc19('0x5'));var schedule=require(_0xfc19('0x6'));var chat=require(_0xfc19('0x7'));var transcribe=require('./config/schedule/transcribe');function main(){return mysqldb['db'][_0xfc19('0x8')][_0xfc19('0x9')]()[_0xfc19('0xa')](function(){return rpc[_0xfc19('0xb')]();})['then'](function(_0xd2f840){logger[_0xfc19('0xc')](_0xd2f840);return chat[_0xfc19('0xd')]();})[_0xfc19('0xa')](function(){return schedule['start']();})[_0xfc19('0xa')](function(){return transcribe[_0xfc19('0xd')]();})['then'](function(_0x10dfa3){logger['info'](_0x10dfa3);return pm2[_0xfc19('0xd')](pm2Config);})[_0xfc19('0xa')](function(_0x24a06f){logger['info'](_0xfc19('0xe'),_[_0xfc19('0xf')](_[_0xfc19('0x10')](_0x24a06f,{'status':_0xfc19('0x11')}),_0xfc19('0x12'))[_0xfc19('0x13')]());logger[_0xfc19('0xc')](_0xfc19('0x14'),_['map'](_[_0xfc19('0x10')](_0x24a06f,function(_0x51cd0d){return _0x51cd0d[_0xfc19('0x15')]!==_0xfc19('0x11');}),_0xfc19('0x12'))[_0xfc19('0x13')]()||_0xfc19('0x16'));config[_0xfc19('0x17')]&&require(_0xfc19('0x18'))['default']();require('./config/license')[_0xfc19('0x19')]();})['catch'](function(_0x49ce21){logger[_0xfc19('0x1a')](_0xfc19('0x1b'),_0x49ce21);process[_0xfc19('0x1c')](0x1);});}main();
\ No newline at end of file
+var _0xc698=['join','status','None','seedDB','./config/seedDB','default','catch','error','Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s','lodash','./mysqldb','./rpc','./config/pm2','./config/pm2/config','./config/schedule','./config/schedule/transcribe','sync','then','listen','info','start','Online\x20apps:','map','filter','online','name'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xc698,0x15b));var _0x8c69=function(_0x4d2993,_0x1c9473){_0x4d2993=_0x4d2993-0x0;var _0x427374=_0xc698[_0x4d2993];return _0x427374;};'use strict';var _=require(_0x8c69('0x0'));var mysqldb=require(_0x8c69('0x1'));var rpc=require(_0x8c69('0x2'));var config=require('./config/environment');var logger=require('./config/logger')('app');var pm2=require(_0x8c69('0x3'));var pm2Config=require(_0x8c69('0x4'));var schedule=require(_0x8c69('0x5'));var chat=require('./config/schedule/chat');var transcribe=require(_0x8c69('0x6'));function main(){return mysqldb['db']['sequelize'][_0x8c69('0x7')]()[_0x8c69('0x8')](function(){return rpc[_0x8c69('0x9')]();})['then'](function(_0x59cbde){logger[_0x8c69('0xa')](_0x59cbde);return chat[_0x8c69('0xb')]();})[_0x8c69('0x8')](function(){return schedule[_0x8c69('0xb')]();})[_0x8c69('0x8')](function(){return transcribe['start']();})['then'](function(_0xa6261c){logger[_0x8c69('0xa')](_0xa6261c);return pm2[_0x8c69('0xb')](pm2Config);})[_0x8c69('0x8')](function(_0x5a0d18){logger[_0x8c69('0xa')](_0x8c69('0xc'),_[_0x8c69('0xd')](_[_0x8c69('0xe')](_0x5a0d18,{'status':_0x8c69('0xf')}),_0x8c69('0x10'))[_0x8c69('0x11')]());logger[_0x8c69('0xa')]('Offline\x20apps:',_[_0x8c69('0xd')](_[_0x8c69('0xe')](_0x5a0d18,function(_0x5d562f){return _0x5d562f[_0x8c69('0x12')]!==_0x8c69('0xf');}),_0x8c69('0x10'))[_0x8c69('0x11')]()||_0x8c69('0x13'));config[_0x8c69('0x14')]&&require(_0x8c69('0x15'))[_0x8c69('0x16')]();require('./config/license')[_0x8c69('0x16')]();})[_0x8c69('0x17')](function(_0x48d7e7){logger[_0x8c69('0x18')](_0x8c69('0x19'),_0x48d7e7);process['exit'](0x1);});}main();
\ No newline at end of file
diff --git a/server/components/auth/service.js b/server/components/auth/service.js
index 9b94a74..6161a0f 100644
--- a/server/components/auth/service.js
+++ b/server/components/auth/service.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xf21a=['hotdesk','userProfileId','isAuthenticated','user','ChatInteraction','params','disposition','then','closed','status','unmanaged','Unmanaged.','catch','headers','startsWith','authorization','Basic','User','find','authenticate','json','Wrong\x20credentials.','Bearer','Unknown\x20authorization\x20format','query','apikey','getUuid','sub','isEqual','apiKeyNonce','API\x20access\x20key\x20is\x20not\x20valid\x20anymore','Invalid\x20API\x20access\x20key','use','User\x20object\x20not\x20found.','canUpdate','getLicense','Forbidden','isMiddleware','signToken','It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.','cookie','motion.token','redirect','/dashboards/general','send','retrieveApiKey','isNil','apiKeyIat','generateApiKey','Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one','promisify','sign','secret','options','verify','randomBytes','toString','hex','floor','now','HS512','../../mysqldb','../../config/environment','../../config/license/hardware','lodash','jsonwebtoken','basic-auth','bluebird','secrets','session','role','fullname','name','internal','email','userpic','permissions','md5secret','voicePause','mailPause','faxPause','smsPause','openchannelPause','pauseType','lastLoginAt','lastPauseAt','crudPermissions','allowmessenger','passwordResetAt','alias','phoneBarAutoAnswerDelay','phoneBarDnd','phoneBarEnableRecording','phoneBarEnableDtmfTone','phoneBarEnableSettings','phoneBarExpires','phoneBarPrefixRequired','phoneBarRemoteControl','phoneBarRemoteControlPort'];(function(_0x240dc5,_0x59d09f){var _0x75f0b1=function(_0x26777e){while(--_0x26777e){_0x240dc5['push'](_0x240dc5['shift']());}};_0x75f0b1(++_0x59d09f);}(_0xf21a,0xa0));var _0xaf21=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0xf21a[_0x19950b];return _0x3c6b41;};'use strict';var db=require(_0xaf21('0x0'))['db'];var config=require(_0xaf21('0x1'));var hardwareConf=require(_0xaf21('0x2'));var _=require(_0xaf21('0x3'));var jwt=require(_0xaf21('0x4'));var expressJwt=require('express-jwt');var compose=require('composable-middleware');var basicAuth=require(_0xaf21('0x5'));var crypto=require('crypto');var BPromise=require(_0xaf21('0x6'));var validateJwt=expressJwt({'secret':config[_0xaf21('0x7')][_0xaf21('0x8')]});var userAttributes=['id',_0xaf21('0x9'),_0xaf21('0xa'),_0xaf21('0xb'),_0xaf21('0xc'),_0xaf21('0xd'),_0xaf21('0xe'),_0xaf21('0xf'),_0xaf21('0x10'),_0xaf21('0x11'),'chatPause',_0xaf21('0x12'),_0xaf21('0x13'),_0xaf21('0x14'),_0xaf21('0x15'),_0xaf21('0x16'),'showWebBar',_0xaf21('0x17'),_0xaf21('0x18'),_0xaf21('0x19'),_0xaf21('0x1a'),_0xaf21('0x1b'),_0xaf21('0x1c'),'phoneBarAutoAnswer',_0xaf21('0x1d'),_0xaf21('0x1e'),_0xaf21('0x1f'),_0xaf21('0x20'),_0xaf21('0x21'),_0xaf21('0x22'),_0xaf21('0x23'),_0xaf21('0x24'),_0xaf21('0x25'),_0xaf21('0x26'),'interface',_0xaf21('0x27')];exports['isChatInteractionAuthorized']=function(){return this[_0xaf21('0x28')](!![])['use'](function(_0x1c371a,_0x5caffc,_0x59e7c2){if(_0x1c371a[_0xaf21('0x29')]){_0x59e7c2();}else{return db[_0xaf21('0x2a')]['findOne']({'where':{'id':_0x1c371a[_0xaf21('0x2b')]['id']},'attributes':['id','closed',_0xaf21('0x2c')],'raw':!![]})[_0xaf21('0x2d')](function(_0x505fa0){if(_0x505fa0&&_0x505fa0[_0xaf21('0x2e')]){return _0x5caffc[_0xaf21('0x2f')](_0x505fa0['disposition']===_0xaf21('0x30')?0x195:0x193)['json']({'message':_0x505fa0['disposition']===_0xaf21('0x30')?_0xaf21('0x31'):'Forbidden.'});}else{_0x59e7c2();}})[_0xaf21('0x32')](function(_0x2eaadf){_0x59e7c2(_0x2eaadf);});}});};exports[_0xaf21('0x28')]=function isAuthenticated(_0x3d8b66){return compose()['use'](function(_0x9a145d,_0x573e71,_0x51aff1){if(_0x9a145d[_0xaf21('0x33')]['authorization']){if(_[_0xaf21('0x34')](_0x9a145d[_0xaf21('0x33')][_0xaf21('0x35')],_0xaf21('0x36'))){var _0x4ac546=basicAuth(_0x9a145d);db[_0xaf21('0x37')][_0xaf21('0x38')]({'where':{'name':_0x4ac546['name']}})[_0xaf21('0x2d')](function(_0x341985){if(!_0x341985||!_0x341985[_0xaf21('0x39')](_0x4ac546['pass'])){return _0x573e71[_0xaf21('0x2f')](0x191)[_0xaf21('0x3a')]({'message':_0xaf21('0x3b')});}_0x9a145d[_0xaf21('0x29')]={'id':_0x341985['id']};_0x51aff1();})[_0xaf21('0x32')](function(_0x382d04){_0x51aff1(_0x382d04);});}else if(_['startsWith'](_0x9a145d[_0xaf21('0x33')][_0xaf21('0x35')],_0xaf21('0x3c'))){validateJwt(_0x9a145d,_0x573e71,_0x51aff1);}else{if(_0x3d8b66){_0x51aff1();}else{return _0x573e71[_0xaf21('0x2f')](0x193)[_0xaf21('0x3a')]({'message':_0xaf21('0x3d')});}}}else if(_0x9a145d[_0xaf21('0x3e')][_0xaf21('0x3f')]){try{var _0x3337e8={'audience':hardwareConf[_0xaf21('0x40')](),'issuer':hardwareConf[_0xaf21('0x40')]()};verifyJwt(_0x9a145d[_0xaf21('0x3e')][_0xaf21('0x3f')],_0x3337e8)[_0xaf21('0x2d')](function(_0x4a745b){return db[_0xaf21('0x37')][_0xaf21('0x38')]({'where':{'id':_0x4a745b[_0xaf21('0x41')]}})[_0xaf21('0x2d')](function(_0x1c4a5f){if(!_0x1c4a5f||!_[_0xaf21('0x42')](_0x1c4a5f[_0xaf21('0x43')],_0x4a745b['nonce'])){return _0x573e71[_0xaf21('0x2f')](0x191)[_0xaf21('0x3a')]({'message':_0xaf21('0x44')});}_0x9a145d[_0xaf21('0x29')]={'id':_0x1c4a5f['id']};_0x51aff1();});})[_0xaf21('0x32')](function(){return _0x573e71[_0xaf21('0x2f')](0x191)[_0xaf21('0x3a')]({'message':_0xaf21('0x45')});});}catch(_0x341f2a){_0x51aff1(_0x341f2a);}}else if(_0x3d8b66){_0x51aff1();}else{return _0x573e71[_0xaf21('0x2f')](0x193)[_0xaf21('0x3a')]({'message':_0xaf21('0x3d')});}})[_0xaf21('0x46')](function(_0x53e259,_0x46326b,_0x2cf39){if(_0x53e259['user']){db[_0xaf21('0x37')]['find']({'where':{'id':_0x53e259['user']['id']},'attributes':userAttributes})[_0xaf21('0x2d')](function(_0x158423){if(!_0x158423){return _0x46326b['status'](0x194)[_0xaf21('0x3a')]({'message':'User\x20not\x20found.'});}_0x53e259['user']=_0x158423;_0x2cf39();})[_0xaf21('0x32')](function(_0x27125a){_0x2cf39(_0x27125a);});}else if(_0x3d8b66){_0x2cf39();}else{return _0x46326b[_0xaf21('0x2f')](0x194)[_0xaf21('0x3a')]({'message':_0xaf21('0x47')});}});};exports[_0xaf21('0x48')]=function canUpdate(){return compose()[_0xaf21('0x46')](function(_0x198015,_0x9c2f6b,_0x397230){return require('../../config/license/util')[_0xaf21('0x49')]()['then'](function(_0x23462c){if(_0x23462c['update']){_0x397230();}else{return _0x9c2f6b['status'](0x193)[_0xaf21('0x3a')]({'message':_0xaf21('0x4a')});}})['catch'](function(_0x2dbec4){_0x397230(_0x2dbec4);});});};exports['isMiddleware']=function(_0x21a8f0,_0x403151,_0x4b8837){_0x21a8f0[_0xaf21('0x4b')]=!![];return _0x4b8837();};exports[_0xaf21('0x4c')]=function signToken(_0x2a270b){return signJwt(_0x2a270b);};exports['setTokenCookie']=function(_0x204e22,_0x52bc96){if(!_0x204e22[_0xaf21('0x29')]){return _0x52bc96['status'](0x194)[_0xaf21('0x3a')]({'message':_0xaf21('0x4d')});}var _0x1c612f={'payload':{'id':_0x204e22['user']['id'],'role':_0x204e22[_0xaf21('0x29')][_0xaf21('0x9')]},'options':{'expiresIn':0x15180}};return signJwt(_0x1c612f)['then'](function(_0x229c46){_0x52bc96[_0xaf21('0x4e')](_0xaf21('0x4f'),_0x229c46);_0x52bc96[_0xaf21('0x50')](_0xaf21('0x51'));})[_0xaf21('0x32')](function(_0x51fb44){return _0x52bc96[_0xaf21('0x2f')](0x1f4)[_0xaf21('0x52')](_0x51fb44);});};exports[_0xaf21('0x53')]=function(_0x95a708){if(_[_0xaf21('0x54')](_0x95a708[_0xaf21('0x43')])||_[_0xaf21('0x54')](_0x95a708[_0xaf21('0x55')])){return null;}else{return createJwt(_0x95a708);}};exports[_0xaf21('0x56')]=function(_0x48610d){_0x48610d[_0xaf21('0x43')]=generateNonce();_0x48610d[_0xaf21('0x55')]=generateIssuedAt();return createJwt(_0x48610d);};exports['regenerateApiKey']=function(_0x2bf0b7,_0x548c4c){var _0x595470=_0x2bf0b7[_0xaf21('0x3e')][_0xaf21('0x3f')];if(_0x595470){var _0x3ce994={'nonce':_0x548c4c[_0xaf21('0x43')],'iat':_0x548c4c[_0xaf21('0x55')],'audience':hardwareConf[_0xaf21('0x40')](),'issuer':hardwareConf[_0xaf21('0x40')]()};return verifyJwt(_0x595470,_0x3ce994)[_0xaf21('0x2d')](function(){return generateApiKey(_0x548c4c);});}else{throw{'message':_0xaf21('0x57')};}};function signJwt(_0x35e2d1){var _0x2d8e46=BPromise[_0xaf21('0x58')](jwt[_0xaf21('0x59')],{'context':jwt});var _0x350eed=_0x35e2d1[_0xaf21('0x5a')]||config[_0xaf21('0x7')][_0xaf21('0x8')];return new BPromise(function(_0x4ba0b0,_0x417b6f){_0x2d8e46(_0x35e2d1['payload'],_0x350eed,_0x35e2d1[_0xaf21('0x5b')])[_0xaf21('0x2d')](function(_0x4884a3){_0x4ba0b0(_0x4884a3);})['catch'](function(_0xded77e){_0x417b6f(_0xded77e);});});}function verifyJwt(_0x402c13,_0x50c316,_0x16bee5){var _0x458fef=BPromise[_0xaf21('0x58')](jwt[_0xaf21('0x5c')],{'context':jwt});var _0x192acb=_0x16bee5||config[_0xaf21('0x7')]['session'];return new BPromise(function(_0x4d3160,_0x39c4c6){_0x458fef(_0x402c13,_0x192acb,_0x50c316)['then'](function(_0x3cfdaa){_0x4d3160(_0x3cfdaa);})['catch'](function(_0x56da32){_0x39c4c6(_0x56da32);});});}function generateNonce(){return crypto[_0xaf21('0x5d')](0x10)[_0xaf21('0x5e')](_0xaf21('0x5f'));}function generateIssuedAt(){return Math[_0xaf21('0x60')](Date[_0xaf21('0x61')]()/0x3e8)['toString']();}function createJwt(_0x195bca){var _0x58791c={'payload':{'iat':_0x195bca['apiKeyIat'],'nonce':_0x195bca[_0xaf21('0x43')]},'options':{'algorithm':_0xaf21('0x62'),'subject':_0x195bca['id']['toString'](),'issuer':hardwareConf[_0xaf21('0x40')](),'audience':hardwareConf[_0xaf21('0x40')]()}};return signJwt(_0x58791c)[_0xaf21('0x2d')](function(_0x51023e){return{'iat':_0x195bca[_0xaf21('0x55')],'nonce':_0x195bca[_0xaf21('0x43')],'token':_0x51023e};});}
\ No newline at end of file
+var _0x3f55=['Basic','User','find','authenticate','pass','status','json','Wrong\x20credentials.','startsWith','Unknown\x20authorization\x20format','query','apikey','getUuid','sub','isEqual','apiKeyNonce','nonce','API\x20access\x20key\x20is\x20not\x20valid\x20anymore','User\x20not\x20found.','User\x20object\x20not\x20found.','canUpdate','../../config/license/util','getLicense','update','isMiddleware','setTokenCookie','cookie','motion.token','redirect','/dashboards/general','send','retrieveApiKey','isNil','apiKeyIat','generateApiKey','regenerateApiKey','Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one','promisify','sign','payload','options','verify','toString','hex','floor','now','HS512','../../config/environment','express-jwt','composable-middleware','basic-auth','crypto','bluebird','secrets','session','role','fullname','name','internal','md5secret','voicePause','chatPause','mailPause','faxPause','smsPause','pauseType','lastLoginAt','allowmessenger','passwordResetAt','alias','phoneBarDnd','phoneBarEnableRecording','phoneBarEnableDtmfTone','phoneBarExpires','phoneBarRemoteControlPort','hotdesk','userProfileId','use','user','ChatInteraction','findOne','params','closed','disposition','then','unmanaged','Unmanaged.','Forbidden.','catch','headers','authorization'];(function(_0x505e10,_0x5a167c){var _0x268002=function(_0x35247b){while(--_0x35247b){_0x505e10['push'](_0x505e10['shift']());}};_0x268002(++_0x5a167c);}(_0x3f55,0x140));var _0x53f5=function(_0x4a9cc,_0x1e37a4){_0x4a9cc=_0x4a9cc-0x0;var _0x1bf672=_0x3f55[_0x4a9cc];return _0x1bf672;};'use strict';var db=require('../../mysqldb')['db'];var config=require(_0x53f5('0x0'));var hardwareConf=require('../../config/license/hardware');var _=require('lodash');var jwt=require('jsonwebtoken');var expressJwt=require(_0x53f5('0x1'));var compose=require(_0x53f5('0x2'));var basicAuth=require(_0x53f5('0x3'));var crypto=require(_0x53f5('0x4'));var BPromise=require(_0x53f5('0x5'));var validateJwt=expressJwt({'secret':config[_0x53f5('0x6')][_0x53f5('0x7')]});var userAttributes=['id',_0x53f5('0x8'),_0x53f5('0x9'),_0x53f5('0xa'),_0x53f5('0xb'),'email','userpic','permissions',_0x53f5('0xc'),_0x53f5('0xd'),_0x53f5('0xe'),_0x53f5('0xf'),_0x53f5('0x10'),_0x53f5('0x11'),'openchannelPause',_0x53f5('0x12'),'showWebBar',_0x53f5('0x13'),'lastPauseAt','crudPermissions',_0x53f5('0x14'),_0x53f5('0x15'),_0x53f5('0x16'),'phoneBarAutoAnswer','phoneBarAutoAnswerDelay',_0x53f5('0x17'),_0x53f5('0x18'),_0x53f5('0x19'),'phoneBarEnableSettings',_0x53f5('0x1a'),'phoneBarPrefixRequired','phoneBarRemoteControl',_0x53f5('0x1b'),_0x53f5('0x1c'),'interface',_0x53f5('0x1d')];exports['isChatInteractionAuthorized']=function(){return this['isAuthenticated'](!![])[_0x53f5('0x1e')](function(_0x2704f7,_0x5c184c,_0x172103){if(_0x2704f7[_0x53f5('0x1f')]){_0x172103();}else{return db[_0x53f5('0x20')][_0x53f5('0x21')]({'where':{'id':_0x2704f7[_0x53f5('0x22')]['id']},'attributes':['id',_0x53f5('0x23'),_0x53f5('0x24')],'raw':!![]})[_0x53f5('0x25')](function(_0x517c74){if(_0x517c74&&_0x517c74[_0x53f5('0x23')]){return _0x5c184c['status'](_0x517c74['disposition']===_0x53f5('0x26')?0x195:0x193)['json']({'message':_0x517c74[_0x53f5('0x24')]===_0x53f5('0x26')?_0x53f5('0x27'):_0x53f5('0x28')});}else{_0x172103();}})[_0x53f5('0x29')](function(_0x402d02){_0x172103(_0x402d02);});}});};exports['isAuthenticated']=function isAuthenticated(_0xc5554c){return compose()[_0x53f5('0x1e')](function(_0x3275d4,_0x463e4e,_0x46a424){if(_0x3275d4[_0x53f5('0x2a')][_0x53f5('0x2b')]){if(_['startsWith'](_0x3275d4[_0x53f5('0x2a')]['authorization'],_0x53f5('0x2c'))){var _0x4070b0=basicAuth(_0x3275d4);db[_0x53f5('0x2d')][_0x53f5('0x2e')]({'where':{'name':_0x4070b0[_0x53f5('0xa')]}})[_0x53f5('0x25')](function(_0x23bc62){if(!_0x23bc62||!_0x23bc62[_0x53f5('0x2f')](_0x4070b0[_0x53f5('0x30')])){return _0x463e4e[_0x53f5('0x31')](0x191)[_0x53f5('0x32')]({'message':_0x53f5('0x33')});}_0x3275d4['user']={'id':_0x23bc62['id']};_0x46a424();})[_0x53f5('0x29')](function(_0x26a460){_0x46a424(_0x26a460);});}else if(_[_0x53f5('0x34')](_0x3275d4[_0x53f5('0x2a')]['authorization'],'Bearer')){validateJwt(_0x3275d4,_0x463e4e,_0x46a424);}else{if(_0xc5554c){_0x46a424();}else{return _0x463e4e[_0x53f5('0x31')](0x193)[_0x53f5('0x32')]({'message':_0x53f5('0x35')});}}}else if(_0x3275d4[_0x53f5('0x36')][_0x53f5('0x37')]){try{var _0x4c7524={'audience':hardwareConf[_0x53f5('0x38')](),'issuer':hardwareConf[_0x53f5('0x38')]()};verifyJwt(_0x3275d4[_0x53f5('0x36')]['apikey'],_0x4c7524)['then'](function(_0x54c2c8){return db[_0x53f5('0x2d')][_0x53f5('0x2e')]({'where':{'id':_0x54c2c8[_0x53f5('0x39')]}})[_0x53f5('0x25')](function(_0x240ec3){if(!_0x240ec3||!_[_0x53f5('0x3a')](_0x240ec3[_0x53f5('0x3b')],_0x54c2c8[_0x53f5('0x3c')])){return _0x463e4e[_0x53f5('0x31')](0x191)['json']({'message':_0x53f5('0x3d')});}_0x3275d4[_0x53f5('0x1f')]={'id':_0x240ec3['id']};_0x46a424();});})[_0x53f5('0x29')](function(){return _0x463e4e[_0x53f5('0x31')](0x191)[_0x53f5('0x32')]({'message':'Invalid\x20API\x20access\x20key'});});}catch(_0xdd69d6){_0x46a424(_0xdd69d6);}}else if(_0xc5554c){_0x46a424();}else{return _0x463e4e['status'](0x193)[_0x53f5('0x32')]({'message':_0x53f5('0x35')});}})[_0x53f5('0x1e')](function(_0x14b32d,_0x10f166,_0x43967f){if(_0x14b32d[_0x53f5('0x1f')]){db[_0x53f5('0x2d')][_0x53f5('0x2e')]({'where':{'id':_0x14b32d[_0x53f5('0x1f')]['id']},'attributes':userAttributes})['then'](function(_0x15bece){if(!_0x15bece){return _0x10f166[_0x53f5('0x31')](0x194)[_0x53f5('0x32')]({'message':_0x53f5('0x3e')});}_0x14b32d[_0x53f5('0x1f')]=_0x15bece;_0x43967f();})['catch'](function(_0x336d69){_0x43967f(_0x336d69);});}else if(_0xc5554c){_0x43967f();}else{return _0x10f166[_0x53f5('0x31')](0x194)[_0x53f5('0x32')]({'message':_0x53f5('0x3f')});}});};exports[_0x53f5('0x40')]=function canUpdate(){return compose()['use'](function(_0x644ac0,_0x1376d5,_0x323bed){return require(_0x53f5('0x41'))[_0x53f5('0x42')]()[_0x53f5('0x25')](function(_0x3e833f){if(_0x3e833f[_0x53f5('0x43')]){_0x323bed();}else{return _0x1376d5[_0x53f5('0x31')](0x193)[_0x53f5('0x32')]({'message':'Forbidden'});}})[_0x53f5('0x29')](function(_0x14f9e3){_0x323bed(_0x14f9e3);});});};exports[_0x53f5('0x44')]=function(_0x56cdaf,_0x7beba2,_0x3babe4){_0x56cdaf[_0x53f5('0x44')]=!![];return _0x3babe4();};exports['signToken']=function signToken(_0x24f147){return signJwt(_0x24f147);};exports[_0x53f5('0x45')]=function(_0x4df5ab,_0x53dc6f){if(!_0x4df5ab['user']){return _0x53dc6f[_0x53f5('0x31')](0x194)[_0x53f5('0x32')]({'message':'It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.'});}var _0x2f0b32={'payload':{'id':_0x4df5ab[_0x53f5('0x1f')]['id'],'role':_0x4df5ab[_0x53f5('0x1f')][_0x53f5('0x8')]},'options':{'expiresIn':0x15180}};return signJwt(_0x2f0b32)['then'](function(_0x521150){_0x53dc6f[_0x53f5('0x46')](_0x53f5('0x47'),_0x521150);_0x53dc6f[_0x53f5('0x48')](_0x53f5('0x49'));})[_0x53f5('0x29')](function(_0x516113){return _0x53dc6f[_0x53f5('0x31')](0x1f4)[_0x53f5('0x4a')](_0x516113);});};exports[_0x53f5('0x4b')]=function(_0x19eb77){if(_[_0x53f5('0x4c')](_0x19eb77[_0x53f5('0x3b')])||_[_0x53f5('0x4c')](_0x19eb77[_0x53f5('0x4d')])){return null;}else{return createJwt(_0x19eb77);}};exports[_0x53f5('0x4e')]=function(_0x9e0b69){_0x9e0b69['apiKeyNonce']=generateNonce();_0x9e0b69['apiKeyIat']=generateIssuedAt();return createJwt(_0x9e0b69);};exports[_0x53f5('0x4f')]=function(_0x3a256b,_0x39fc70){var _0x17d32e=_0x3a256b[_0x53f5('0x36')]['apikey'];if(_0x17d32e){var _0x5db1f5={'nonce':_0x39fc70[_0x53f5('0x3b')],'iat':_0x39fc70[_0x53f5('0x4d')],'audience':hardwareConf[_0x53f5('0x38')](),'issuer':hardwareConf[_0x53f5('0x38')]()};return verifyJwt(_0x17d32e,_0x5db1f5)[_0x53f5('0x25')](function(){return generateApiKey(_0x39fc70);});}else{throw{'message':_0x53f5('0x50')};}};function signJwt(_0x3897a3){var _0xe1f264=BPromise[_0x53f5('0x51')](jwt[_0x53f5('0x52')],{'context':jwt});var _0x32b34d=_0x3897a3['secret']||config[_0x53f5('0x6')][_0x53f5('0x7')];return new BPromise(function(_0x24a91f,_0x126e4f){_0xe1f264(_0x3897a3[_0x53f5('0x53')],_0x32b34d,_0x3897a3[_0x53f5('0x54')])['then'](function(_0xb4d322){_0x24a91f(_0xb4d322);})[_0x53f5('0x29')](function(_0x424865){_0x126e4f(_0x424865);});});}function verifyJwt(_0x163cd5,_0x144876,_0x5de171){var _0x160740=BPromise[_0x53f5('0x51')](jwt[_0x53f5('0x55')],{'context':jwt});var _0x103402=_0x5de171||config['secrets'][_0x53f5('0x7')];return new BPromise(function(_0x519e3f,_0x38553d){_0x160740(_0x163cd5,_0x103402,_0x144876)['then'](function(_0x2269c9){_0x519e3f(_0x2269c9);})[_0x53f5('0x29')](function(_0x5496d5){_0x38553d(_0x5496d5);});});}function generateNonce(){return crypto['randomBytes'](0x10)[_0x53f5('0x56')](_0x53f5('0x57'));}function generateIssuedAt(){return Math[_0x53f5('0x58')](Date[_0x53f5('0x59')]()/0x3e8)[_0x53f5('0x56')]();}function createJwt(_0x414fbc){var _0x35088b={'payload':{'iat':_0x414fbc[_0x53f5('0x4d')],'nonce':_0x414fbc['apiKeyNonce']},'options':{'algorithm':_0x53f5('0x5a'),'subject':_0x414fbc['id']['toString'](),'issuer':hardwareConf['getUuid'](),'audience':hardwareConf[_0x53f5('0x38')]()}};return signJwt(_0x35088b)['then'](function(_0x543c03){return{'iat':_0x414fbc[_0x53f5('0x4d')],'nonce':_0x414fbc[_0x53f5('0x3b')],'token':_0x543c03};});}
\ No newline at end of file
diff --git a/server/components/encryptor/index.js b/server/components/encryptor/index.js
index 652a4a6..9e88bf2 100644
--- a/server/components/encryptor/index.js
+++ b/server/components/encryptor/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x70e0=['createDecipher','algorithm','data','close','unlink','crypto','bluebird','aes192','hasOwnProperty','createReadStream','createWriteStream','createCipher','update','binary','write','end','final'];(function(_0xcec8bd,_0x3d8a50){var _0x53e555=function(_0x1d0cab){while(--_0x1d0cab){_0xcec8bd['push'](_0xcec8bd['shift']());}};_0x53e555(++_0x3d8a50);}(_0x70e0,0x17b));var _0x070e=function(_0x566b8d,_0x233ea9){_0x566b8d=_0x566b8d-0x0;var _0x860aa1=_0x70e0[_0x566b8d];return _0x860aa1;};'use strict';var crypto=require(_0x070e('0x0'));var fs=require('fs');var BPromise=require(_0x070e('0x1'));var defaultOptions={'algorithm':_0x070e('0x2')};function combineOptions(_0x4d95bb){var _0x579b83={};for(var _0x16e651 in defaultOptions){if(defaultOptions[_0x070e('0x3')](_0x16e651)){_0x579b83[_0x16e651]=defaultOptions[_0x16e651];}}if(_0x4d95bb){for(var _0x277d32 in _0x4d95bb){if(_0x4d95bb[_0x070e('0x3')](_0x277d32)){_0x579b83[_0x277d32]=_0x4d95bb[_0x277d32];}}}return _0x579b83;}exports['encryptFile']=function(_0x7bce9b,_0x579a6b,_0x46fe68,_0x4b041d){return new BPromise(function(_0x56e420,_0x5032e5){_0x4b041d=combineOptions(_0x4b041d);var _0x35ab0c=new Buffer(_0x46fe68);var _0x1e11f0=fs[_0x070e('0x4')](_0x7bce9b);var _0x2611e6=fs[_0x070e('0x5')](_0x579a6b);var _0x68a09e=crypto[_0x070e('0x6')](_0x4b041d['algorithm'],_0x35ab0c);_0x1e11f0['on']('data',function(_0x50f4eb){var _0x2e3e5e=new Buffer(_0x68a09e[_0x070e('0x7')](_0x50f4eb),_0x070e('0x8'));_0x2611e6[_0x070e('0x9')](_0x2e3e5e);});_0x1e11f0['on'](_0x070e('0xa'),function(){try{var _0x25cfe1=new Buffer(_0x68a09e[_0x070e('0xb')](_0x070e('0x8')),_0x070e('0x8'));_0x2611e6[_0x070e('0x9')](_0x25cfe1);_0x2611e6['end']();_0x2611e6['on']('close',function(){return _0x56e420(_0x579a6b);});}catch(_0x24baba){fs['unlink'](_0x579a6b);return _0x5032e5(_0x24baba);}});});};exports['decryptFile']=function(_0x5bae0f,_0x11d2ce,_0x14c3fd,_0x51d14d){return new BPromise(function(_0x5d3a38,_0x373d86){_0x51d14d=combineOptions(_0x51d14d);var _0xeae1a5=new Buffer(_0x14c3fd);var _0x180897=fs[_0x070e('0x4')](_0x5bae0f);var _0x5bc71e=fs['createWriteStream'](_0x11d2ce);var _0x17e2e4=crypto[_0x070e('0xc')](_0x51d14d[_0x070e('0xd')],_0xeae1a5);_0x180897['on'](_0x070e('0xe'),function(_0x364b3f){var _0x5037eb=new Buffer(_0x17e2e4[_0x070e('0x7')](_0x364b3f),_0x070e('0x8'));_0x5bc71e[_0x070e('0x9')](_0x5037eb);});_0x180897['on'](_0x070e('0xa'),function(){try{var _0x259893=new Buffer(_0x17e2e4['final']('binary'),'binary');_0x5bc71e[_0x070e('0x9')](_0x259893);_0x5bc71e[_0x070e('0xa')]();_0x5bc71e['on'](_0x070e('0xf'),function(){return _0x5d3a38(_0x11d2ce);});}catch(_0x4be0d7){fs[_0x070e('0x10')](_0x11d2ce);return _0x373d86(_0x4be0d7);}});});};
\ No newline at end of file
+var _0xb7e7=['crypto','aes192','hasOwnProperty','encryptFile','createReadStream','createWriteStream','createCipher','algorithm','update','binary','write','end','final','createDecipher','data','close','unlink'];(function(_0x354cd3,_0x37de36){var _0x420042=function(_0x3f83f8){while(--_0x3f83f8){_0x354cd3['push'](_0x354cd3['shift']());}};_0x420042(++_0x37de36);}(_0xb7e7,0x121));var _0x7b7e=function(_0x31e29a,_0x349c9b){_0x31e29a=_0x31e29a-0x0;var _0x32d892=_0xb7e7[_0x31e29a];return _0x32d892;};'use strict';var crypto=require(_0x7b7e('0x0'));var fs=require('fs');var BPromise=require('bluebird');var defaultOptions={'algorithm':_0x7b7e('0x1')};function combineOptions(_0x518dc6){var _0x1b7cc7={};for(var _0x54a37f in defaultOptions){if(defaultOptions[_0x7b7e('0x2')](_0x54a37f)){_0x1b7cc7[_0x54a37f]=defaultOptions[_0x54a37f];}}if(_0x518dc6){for(var _0x556d68 in _0x518dc6){if(_0x518dc6[_0x7b7e('0x2')](_0x556d68)){_0x1b7cc7[_0x556d68]=_0x518dc6[_0x556d68];}}}return _0x1b7cc7;}exports[_0x7b7e('0x3')]=function(_0x1d9384,_0x52047f,_0x53ed64,_0x333fa4){return new BPromise(function(_0x372bde,_0x7f87e0){_0x333fa4=combineOptions(_0x333fa4);var _0x55ce81=new Buffer(_0x53ed64);var _0x42b871=fs[_0x7b7e('0x4')](_0x1d9384);var _0x2917f9=fs[_0x7b7e('0x5')](_0x52047f);var _0x148964=crypto[_0x7b7e('0x6')](_0x333fa4[_0x7b7e('0x7')],_0x55ce81);_0x42b871['on']('data',function(_0x299519){var _0x1eef0a=new Buffer(_0x148964[_0x7b7e('0x8')](_0x299519),_0x7b7e('0x9'));_0x2917f9[_0x7b7e('0xa')](_0x1eef0a);});_0x42b871['on'](_0x7b7e('0xb'),function(){try{var _0x36d2a3=new Buffer(_0x148964[_0x7b7e('0xc')](_0x7b7e('0x9')),'binary');_0x2917f9[_0x7b7e('0xa')](_0x36d2a3);_0x2917f9[_0x7b7e('0xb')]();_0x2917f9['on']('close',function(){return _0x372bde(_0x52047f);});}catch(_0x422d3a){fs['unlink'](_0x52047f);return _0x7f87e0(_0x422d3a);}});});};exports['decryptFile']=function(_0x2889ed,_0xd304f5,_0xf067da,_0x457ec5){return new BPromise(function(_0x3d2fb2,_0x5703fd){_0x457ec5=combineOptions(_0x457ec5);var _0x51baf6=new Buffer(_0xf067da);var _0xc7f087=fs[_0x7b7e('0x4')](_0x2889ed);var _0x27f999=fs[_0x7b7e('0x5')](_0xd304f5);var _0x2cc400=crypto[_0x7b7e('0xd')](_0x457ec5[_0x7b7e('0x7')],_0x51baf6);_0xc7f087['on'](_0x7b7e('0xe'),function(_0x2acb8c){var _0x429a0e=new Buffer(_0x2cc400[_0x7b7e('0x8')](_0x2acb8c),_0x7b7e('0x9'));_0x27f999[_0x7b7e('0xa')](_0x429a0e);});_0xc7f087['on'](_0x7b7e('0xb'),function(){try{var _0x9776c3=new Buffer(_0x2cc400[_0x7b7e('0xc')](_0x7b7e('0x9')),'binary');_0x27f999[_0x7b7e('0xa')](_0x9776c3);_0x27f999[_0x7b7e('0xb')]();_0x27f999['on'](_0x7b7e('0xf'),function(){return _0x3d2fb2(_0xd304f5);});}catch(_0x4c0647){fs[_0x7b7e('0x10')](_0xd304f5);return _0x5703fd(_0x4c0647);}});});};
\ No newline at end of file
diff --git a/server/components/export/csv.js b/server/components/export/csv.js
index 0febf48..fa8c3af 100644
--- a/server/components/export/csv.js
+++ b/server/components/export/csv.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xaa88=['join','each','csv','writeFileSync','%s.%s','zip','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','util','path','lodash','to-csv','zip-dir','rimraf','../../mysqldb','dbH','../../config/logger','argv','AnalyticExtractedReport','update','info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','CSV','find','split','then','splitSizeCsv','sequelize','query','num','Empty','length','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','push','SELECT','dirname','basename','existsSync','mkdirSync'];(function(_0x3237d5,_0xe45965){var _0x38e1a5=function(_0x586a8f){while(--_0x586a8f){_0x3237d5['push'](_0x3237d5['shift']());}};_0x38e1a5(++_0xe45965);}(_0xaa88,0x137));var _0x8aa8=function(_0x369151,_0x179f72){_0x369151=_0x369151-0x0;var _0x4292d5=_0xaa88[_0x369151];return _0x4292d5;};'use strict';var util=require(_0x8aa8('0x0'));var path=require(_0x8aa8('0x1'));var _=require(_0x8aa8('0x2'));var csv=require(_0x8aa8('0x3'));var fs=require('fs');var BPromise=require('bluebird');var zipdir=require(_0x8aa8('0x4'));var rimraf=require(_0x8aa8('0x5'));var db=require(_0x8aa8('0x6'))['db'];var dbH=require(_0x8aa8('0x6'))[_0x8aa8('0x7')];var logger=require(_0x8aa8('0x8'))('analytics');var EXTRACTED_REPORT_ID=Number(process['argv'][0x2]);var QUERY=process[_0x8aa8('0x9')][0x3];var PATH=process['argv'][0x4];function analyticExtractedReport(_0x449d2d,_0x1ed84d){var _0x27c08d={'status':_0x449d2d};var _0x40826f={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x1ed84d){_0x27c08d['savename']=_0x1ed84d;}return db[_0x8aa8('0xa')][_0x8aa8('0xb')](_0x27c08d,_0x40826f);}function main(){var _0x224f25=0x1388;var _0x5c94d4;logger[_0x8aa8('0xc')](util[_0x8aa8('0xd')](_0x8aa8('0xe'),EXTRACTED_REPORT_ID,_0x8aa8('0xf')));return db['Setting'][_0x8aa8('0x10')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x8aa8('0x11'),'splitSizeCsv']})[_0x8aa8('0x12')](function(_0xa691d6){if(_0xa691d6){_0x5c94d4=_0xa691d6;_0x224f25=_0x5c94d4[_0x8aa8('0x13')]||0x1388;}})['then'](function(){return dbH[_0x8aa8('0x14')][_0x8aa8('0x15')](util[_0x8aa8('0xd')]('SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t',QUERY),{'type':dbH[_0x8aa8('0x14')]['QueryTypes']['SELECT']});})[_0x8aa8('0x12')](function(_0x200662){if(!_0x200662[0x0][_0x8aa8('0x16')]){return analyticExtractedReport(_0x8aa8('0x17'));}var _0x42a6a4=[];var _0x3778f4=0x0;var _0x1bdd39=!![];if(_0x200662&&_0x200662[_0x8aa8('0x18')]){var _0x20d303=_0x200662[0x0]['num']%(_0x3778f4+_0x224f25);if(_0x5c94d4['split']){for(;_0x1bdd39;_0x3778f4+=_0x224f25,_0x20d303=_0x200662[0x0][_0x8aa8('0x16')]%(_0x3778f4+_0x224f25)){if(_0x20d303==0x0||_0x20d303==_0x200662[0x0]['num']){_0x1bdd39=![];}_0x42a6a4['push'](dbH[_0x8aa8('0x14')]['query'](util[_0x8aa8('0xd')](_0x8aa8('0x19'),QUERY,_0x224f25,_0x3778f4),{'type':dbH[_0x8aa8('0x14')][_0x8aa8('0x1a')]['SELECT']}));}}else{_0x42a6a4[_0x8aa8('0x1b')](dbH[_0x8aa8('0x14')][_0x8aa8('0x15')](QUERY,{'type':dbH[_0x8aa8('0x14')][_0x8aa8('0x1a')][_0x8aa8('0x1c')]}));}}var _0x5d9b62=path[_0x8aa8('0x1d')](PATH);var _0x4cc455=path[_0x8aa8('0x1e')](PATH,'.csv');var _0x2c1828=_0x5c94d4['split']&&_0x42a6a4[_0x8aa8('0x18')]>0x1;var _0x40adb5=[];if(!fs[_0x8aa8('0x1f')](path['join'](_0x5d9b62,_0x4cc455))&&_0x2c1828){fs[_0x8aa8('0x20')](path[_0x8aa8('0x21')](_0x5d9b62,_0x4cc455));}return BPromise[_0x8aa8('0x22')](_0x42a6a4,function(_0x547a7b){_0x40adb5['push'](_0x547a7b);})[_0x8aa8('0x12')](function(){for(var _0x44e2d8=0x0;_0x44e2d8<_0x40adb5[_0x8aa8('0x18')];_0x44e2d8+=0x1){var _0x3a3c7a;var _0x24143e=_0x40adb5[_0x44e2d8];if(_0x2c1828){_0x3a3c7a=path['join'](_0x5d9b62,_0x4cc455,util[_0x8aa8('0xd')]('%s%d.%s',_0x4cc455,_0x44e2d8,_0x8aa8('0x23')));}else{_0x3a3c7a=path[_0x8aa8('0x21')](_0x5d9b62,util[_0x8aa8('0xd')]('%s.%s',_0x4cc455,'csv'));}fs[_0x8aa8('0x24')](_0x3a3c7a,csv(_0x24143e));}})['then'](function(){if(_0x2c1828){zipdir(path[_0x8aa8('0x21')](_0x5d9b62,_0x4cc455),{'saveTo':path[_0x8aa8('0x21')](_0x5d9b62,util[_0x8aa8('0xd')](_0x8aa8('0x25'),_0x4cc455,_0x8aa8('0x26')))},function(_0x4d5c2e,_0x267f4c){});rimraf(path[_0x8aa8('0x21')](_0x5d9b62,_0x4cc455),function(){});}})['then'](function(){logger[_0x8aa8('0xc')](util[_0x8aa8('0xd')](_0x8aa8('0x27'),EXTRACTED_REPORT_ID,'CSV'));return analyticExtractedReport(_0x8aa8('0x28'),_0x2c1828?util[_0x8aa8('0xd')](_0x8aa8('0x25'),_0x4cc455,_0x2c1828?_0x8aa8('0x26'):_0x8aa8('0x23')):null);});})[_0x8aa8('0x29')](function(_0x370401){logger[_0x8aa8('0xc')](util[_0x8aa8('0xd')](_0x8aa8('0x2a'),EXTRACTED_REPORT_ID,_0x8aa8('0xf')),util['inspect'](_0x370401,{'showHidden':![],'depth':null}));return analyticExtractedReport('Failed');});}main();
\ No newline at end of file
+var _0xb903=['each','%s%d.%s','csv','%s.%s','writeFileSync','zip','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','catch','info','inspect','util','path','lodash','to-csv','zip-dir','rimraf','../../mysqldb','dbH','../../config/logger','analytics','argv','savename','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','CSV','find','split','then','splitSizeCsv','query','sequelize','QueryTypes','num','Empty','push','format','SELECT','dirname','basename','length','existsSync','join'];(function(_0x1d5eec,_0x3150de){var _0x1fec28=function(_0x4e073b){while(--_0x4e073b){_0x1d5eec['push'](_0x1d5eec['shift']());}};_0x1fec28(++_0x3150de);}(_0xb903,0x185));var _0x3b90=function(_0x174daa,_0x448c43){_0x174daa=_0x174daa-0x0;var _0x341847=_0xb903[_0x174daa];return _0x341847;};'use strict';var util=require(_0x3b90('0x0'));var path=require(_0x3b90('0x1'));var _=require(_0x3b90('0x2'));var csv=require(_0x3b90('0x3'));var fs=require('fs');var BPromise=require('bluebird');var zipdir=require(_0x3b90('0x4'));var rimraf=require(_0x3b90('0x5'));var db=require(_0x3b90('0x6'))['db'];var dbH=require(_0x3b90('0x6'))[_0x3b90('0x7')];var logger=require(_0x3b90('0x8'))(_0x3b90('0x9'));var EXTRACTED_REPORT_ID=Number(process['argv'][0x2]);var QUERY=process[_0x3b90('0xa')][0x3];var PATH=process['argv'][0x4];function analyticExtractedReport(_0x55792c,_0x153283){var _0x2e4c06={'status':_0x55792c};var _0x42efe8={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x153283){_0x2e4c06[_0x3b90('0xb')]=_0x153283;}return db['AnalyticExtractedReport']['update'](_0x2e4c06,_0x42efe8);}function main(){var _0x52401e=0x1388;var _0x51f916;logger['info'](util['format'](_0x3b90('0xc'),EXTRACTED_REPORT_ID,_0x3b90('0xd')));return db['Setting'][_0x3b90('0xe')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x3b90('0xf'),'splitSizeCsv']})[_0x3b90('0x10')](function(_0x174c0d){if(_0x174c0d){_0x51f916=_0x174c0d;_0x52401e=_0x51f916[_0x3b90('0x11')]||0x1388;}})['then'](function(){return dbH['sequelize'][_0x3b90('0x12')](util['format']('SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t',QUERY),{'type':dbH[_0x3b90('0x13')][_0x3b90('0x14')]['SELECT']});})['then'](function(_0x3725b9){if(!_0x3725b9[0x0][_0x3b90('0x15')]){return analyticExtractedReport(_0x3b90('0x16'));}var _0x1af265=[];var _0x1efe01=0x0;var _0x529421=!![];if(_0x3725b9&&_0x3725b9['length']){var _0xd83280=_0x3725b9[0x0][_0x3b90('0x15')]%(_0x1efe01+_0x52401e);if(_0x51f916['split']){for(;_0x529421;_0x1efe01+=_0x52401e,_0xd83280=_0x3725b9[0x0][_0x3b90('0x15')]%(_0x1efe01+_0x52401e)){if(_0xd83280==0x0||_0xd83280==_0x3725b9[0x0][_0x3b90('0x15')]){_0x529421=![];}_0x1af265[_0x3b90('0x17')](dbH[_0x3b90('0x13')]['query'](util[_0x3b90('0x18')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x52401e,_0x1efe01),{'type':dbH[_0x3b90('0x13')][_0x3b90('0x14')]['SELECT']}));}}else{_0x1af265[_0x3b90('0x17')](dbH[_0x3b90('0x13')][_0x3b90('0x12')](QUERY,{'type':dbH[_0x3b90('0x13')][_0x3b90('0x14')][_0x3b90('0x19')]}));}}var _0x3bc7d5=path[_0x3b90('0x1a')](PATH);var _0xa98414=path[_0x3b90('0x1b')](PATH,'.csv');var _0x20b06a=_0x51f916[_0x3b90('0xf')]&&_0x1af265[_0x3b90('0x1c')]>0x1;var _0x7faee=[];if(!fs[_0x3b90('0x1d')](path[_0x3b90('0x1e')](_0x3bc7d5,_0xa98414))&&_0x20b06a){fs['mkdirSync'](path['join'](_0x3bc7d5,_0xa98414));}return BPromise[_0x3b90('0x1f')](_0x1af265,function(_0x29d472){_0x7faee[_0x3b90('0x17')](_0x29d472);})[_0x3b90('0x10')](function(){for(var _0x583523=0x0;_0x583523<_0x7faee[_0x3b90('0x1c')];_0x583523+=0x1){var _0x2936d7;var _0x1787d1=_0x7faee[_0x583523];if(_0x20b06a){_0x2936d7=path['join'](_0x3bc7d5,_0xa98414,util[_0x3b90('0x18')](_0x3b90('0x20'),_0xa98414,_0x583523,_0x3b90('0x21')));}else{_0x2936d7=path[_0x3b90('0x1e')](_0x3bc7d5,util[_0x3b90('0x18')](_0x3b90('0x22'),_0xa98414,'csv'));}fs[_0x3b90('0x23')](_0x2936d7,csv(_0x1787d1));}})['then'](function(){if(_0x20b06a){zipdir(path[_0x3b90('0x1e')](_0x3bc7d5,_0xa98414),{'saveTo':path[_0x3b90('0x1e')](_0x3bc7d5,util[_0x3b90('0x18')](_0x3b90('0x22'),_0xa98414,_0x3b90('0x24')))},function(_0x6704f,_0x290283){});rimraf(path[_0x3b90('0x1e')](_0x3bc7d5,_0xa98414),function(){});}})['then'](function(){logger['info'](util[_0x3b90('0x18')](_0x3b90('0x25'),EXTRACTED_REPORT_ID,_0x3b90('0xd')));return analyticExtractedReport(_0x3b90('0x26'),_0x20b06a?util['format']('%s.%s',_0xa98414,_0x20b06a?_0x3b90('0x24'):_0x3b90('0x21')):null);});})[_0x3b90('0x27')](function(_0x4f3ab5){logger[_0x3b90('0x28')](util['format']('Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0x3b90('0xd')),util[_0x3b90('0x29')](_0x4f3ab5,{'showHidden':![],'depth':null}));return analyticExtractedReport('Failed');});}main();
\ No newline at end of file
diff --git a/server/components/export/pdf.js b/server/components/export/pdf.js
index 69a3066..1794426 100644
--- a/server/components/export/pdf.js
+++ b/server/components/export/pdf.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xd8b0=['format','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','SELECT','existsSync','join','mkdirSync','each','Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s','name','endDate','landscape','black','body','toString','/fonts/Roboto-Medium.ttf','/fonts/Roboto-Italic.ttf','/fonts/Roboto-MediumItalic.ttf','createPdfKitDocument','%s%d.%s','pdf','pipe','finish','error','log','err','%s.%s','zip','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','CSV','Completed','info','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','PDF','findOne','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','lodash','bluebird','pdfmake/src/printer','zip-dir','rimraf','../../mysqldb','analytics','argv','MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a','savename','AnalyticExtractedReport','update','hasOwnProperty','tableHeader','num','Empty','dirname','basename','.pdf','Setting','find','split','splitSizePdf','then','length','push','sequelize','query'];(function(_0x4e8cad,_0x4e8c9c){var _0x1bf7b6=function(_0x3ae71d){while(--_0x3ae71d){_0x4e8cad['push'](_0x4e8cad['shift']());}};_0x1bf7b6(++_0x4e8c9c);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var _=require(_0x0d8b('0x0'));var fs=require('fs');var BPromise=require(_0x0d8b('0x1'));var util=require('util');var path=require('path');var moment=require('moment');var PdfPrinter=require(_0x0d8b('0x2'));var zipdir=require(_0x0d8b('0x3'));var rimraf=require(_0x0d8b('0x4'));var db=require(_0x0d8b('0x5'))['db'];var dbH=require(_0x0d8b('0x5'))['dbH'];var logger=require('../../config/logger')(_0x0d8b('0x6'));var EXTRACTED_REPORT_ID=Number(process[_0x0d8b('0x7')][0x2]);var QUERY=process[_0x0d8b('0x7')][0x3];var PATH=process['argv'][0x4];var NAME=process[_0x0d8b('0x7')][0x5];var FORMAT=_0x0d8b('0x8');var _extractedReport;function analyticExtractedReport(_0x58e4e2,_0x129310){var _0x348e65={'status':_0x58e4e2};var _0x3b027f={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x129310){_0x348e65[_0x0d8b('0x9')]=_0x129310;}return db[_0x0d8b('0xa')][_0x0d8b('0xb')](_0x348e65,_0x3b027f);}function getHeader(_0x2c5e9e){var _0x28f87c=[];for(var _0x48fa16 in _0x2c5e9e){if(_0x2c5e9e[_0x0d8b('0xc')](_0x48fa16)){_0x28f87c['push']({'text':_0x48fa16,'style':_0x0d8b('0xd')});}}return _0x28f87c;}function extractReport(_0xc574a3){var _0x340cc4=0x1388;var _0x92cdd8;if(!_0xc574a3[0x0][_0x0d8b('0xe')]){return analyticExtractedReport(_0x0d8b('0xf'));}var _0x15dd0f=[];var _0x31a8cc=0x0;var _0x1d4bbc=!![];var _0x2ce75e=path[_0x0d8b('0x10')](PATH);var _0xe65334=path[_0x0d8b('0x11')](PATH,_0x0d8b('0x12'));var _0x4f6f21=![];var _0x23eb7b=[];return db[_0x0d8b('0x13')][_0x0d8b('0x14')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x0d8b('0x15'),_0x0d8b('0x16')]})['then'](function(_0x106a01){if(_0x106a01){_0x92cdd8=_0x106a01;_0x340cc4=_0x92cdd8[_0x0d8b('0x16')]||0x3e8;}})[_0x0d8b('0x17')](function(){if(_0xc574a3&&_0xc574a3[_0x0d8b('0x18')]){var _0x333674=_0xc574a3[0x0][_0x0d8b('0xe')]%(_0x31a8cc+_0x340cc4);if(_0x92cdd8[_0x0d8b('0x15')]){for(;_0x1d4bbc;_0x31a8cc+=_0x340cc4,_0x333674=_0xc574a3[0x0][_0x0d8b('0xe')]%(_0x31a8cc+_0x340cc4)){if(_0x333674==0x0||_0x333674==_0xc574a3[0x0]['num']){_0x1d4bbc=![];}_0x15dd0f[_0x0d8b('0x19')](dbH[_0x0d8b('0x1a')][_0x0d8b('0x1b')](util[_0x0d8b('0x1c')](_0x0d8b('0x1d'),QUERY,_0x340cc4,_0x31a8cc),{'type':dbH[_0x0d8b('0x1a')][_0x0d8b('0x1e')][_0x0d8b('0x1f')]}));}}else{_0x15dd0f['push'](dbH['sequelize'][_0x0d8b('0x1b')](QUERY,{'type':dbH['sequelize']['QueryTypes']['SELECT']}));}}_0x4f6f21=_0x92cdd8[_0x0d8b('0x15')]&&_0x15dd0f[_0x0d8b('0x18')]>0x1;if(!fs[_0x0d8b('0x20')](path[_0x0d8b('0x21')](_0x2ce75e,_0xe65334))&&_0x4f6f21){fs[_0x0d8b('0x22')](path[_0x0d8b('0x21')](_0x2ce75e,_0xe65334));}return BPromise[_0x0d8b('0x23')](_0x15dd0f,function(_0x4562cb){_0x23eb7b[_0x0d8b('0x19')](_0x4562cb);});})['then'](function(){return BPromise[_0x0d8b('0x23')](_0x15dd0f,function(_0x4463ee,_0x5363e3){var _0xe1ef20;var _0x4a0ae4=util[_0x0d8b('0x1c')](_0x0d8b('0x24'),NAME,_extractedReport[_0x0d8b('0x25')],moment(_extractedReport['startDate'])['format'](FORMAT),moment(_extractedReport[_0x0d8b('0x26')])[_0x0d8b('0x1c')](FORMAT));var _0x4c05ee={'pageSize':'A4','pageOrientation':_0x0d8b('0x27'),'content':[{'text':_0x4a0ae4,'style':'header'}],'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':_0x0d8b('0x28')}}};var _0x4b59e5={'headerRows':0x1,'body':[]};_0x4b59e5[_0x0d8b('0x29')]['push'](getHeader(_0x4463ee[0x0]));var _0x2ab00d;for(var _0x546bf6=0x0;_0x546bf6<_0x4463ee[_0x0d8b('0x18')];_0x546bf6+=0x1){_0x2ab00d=[];for(var _0x544735 in _0x4463ee[_0x546bf6]){if(_0x4463ee[_0x546bf6][_0x0d8b('0xc')](_0x544735)){_0x2ab00d[_0x0d8b('0x19')](_0x4463ee[_0x546bf6][_0x544735]?_[_0x0d8b('0x2a')](_0x4463ee[_0x546bf6][_0x544735]):'');}}_0x4b59e5['body']['push'](_0x2ab00d);}_0x4c05ee['content'][_0x0d8b('0x19')]({'table':_0x4b59e5});return new BPromise(function(_0x5515d2,_0x3cdf3c){var _0x54f6f3=new PdfPrinter({'Roboto':{'normal':__dirname+'/fonts/Roboto-Regular.ttf','bold':__dirname+_0x0d8b('0x2b'),'italics':__dirname+_0x0d8b('0x2c'),'bolditalics':__dirname+_0x0d8b('0x2d')}});var _0xdeee5d=_0x54f6f3[_0x0d8b('0x2e')](_0x4c05ee);if(_0x4f6f21){_0xe1ef20=path[_0x0d8b('0x21')](_0x2ce75e,_0xe65334,util[_0x0d8b('0x1c')](_0x0d8b('0x2f'),_0xe65334,_0x5363e3,'pdf'));}else{_0xe1ef20=path[_0x0d8b('0x21')](_0x2ce75e,util[_0x0d8b('0x1c')]('%s.%s',_0xe65334,_0x0d8b('0x30')));}var _0x23f7f6=_0xdeee5d[_0x0d8b('0x31')](fs['createWriteStream'](_0xe1ef20));_0x23f7f6['on'](_0x0d8b('0x32'),function(){_0x5515d2();});_0x23f7f6['on'](_0x0d8b('0x33'),function(_0x206157){console[_0x0d8b('0x34')](_0x0d8b('0x35'),_0x206157);_0x3cdf3c(_0x206157);});_0xdeee5d['end']();});});})[_0x0d8b('0x17')](function(){if(_0x4f6f21){return new BPromise(function(_0x1649fc,_0x5ad0fe){zipdir(path[_0x0d8b('0x21')](_0x2ce75e,_0xe65334),{'saveTo':path[_0x0d8b('0x21')](_0x2ce75e,util[_0x0d8b('0x1c')](_0x0d8b('0x36'),_0xe65334,_0x0d8b('0x37')))},function(_0x519088){if(_0x519088){_0x5ad0fe(_0x519088);}else{_0x1649fc();}});});}})['then'](function(){if(_0x4f6f21){rimraf(path[_0x0d8b('0x21')](_0x2ce75e,_0xe65334),function(){});}})['then'](function(){logger['info'](util[_0x0d8b('0x1c')](_0x0d8b('0x38'),EXTRACTED_REPORT_ID,_0x0d8b('0x39')));return analyticExtractedReport(_0x0d8b('0x3a'),_0x4f6f21?util[_0x0d8b('0x1c')](_0x0d8b('0x36'),_0xe65334,_0x4f6f21?'zip':_0x0d8b('0x30')):null);});}function main(){logger[_0x0d8b('0x3b')](util[_0x0d8b('0x1c')](_0x0d8b('0x3c'),EXTRACTED_REPORT_ID,_0x0d8b('0x3d')));return db[_0x0d8b('0xa')][_0x0d8b('0x3e')]({'where':{'id':EXTRACTED_REPORT_ID}})['then'](function(_0x1d06b6){_extractedReport=_0x1d06b6;return dbH[_0x0d8b('0x1a')][_0x0d8b('0x1b')](util[_0x0d8b('0x1c')]('SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t',QUERY),{'type':dbH[_0x0d8b('0x1a')]['QueryTypes'][_0x0d8b('0x1f')]});})[_0x0d8b('0x17')](extractReport)[_0x0d8b('0x3f')](function(_0x26ac10){logger[_0x0d8b('0x3b')](util[_0x0d8b('0x1c')](_0x0d8b('0x40'),EXTRACTED_REPORT_ID,_0x0d8b('0x3d')),util[_0x0d8b('0x41')](_0x26ac10,{'showHidden':![],'depth':null}));return analyticExtractedReport(_0x0d8b('0x42'));});}main();
\ No newline at end of file
+var _0xd8b0=['format','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','SELECT','existsSync','join','mkdirSync','each','Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s','name','endDate','landscape','black','body','toString','/fonts/Roboto-Medium.ttf','/fonts/Roboto-Italic.ttf','/fonts/Roboto-MediumItalic.ttf','createPdfKitDocument','%s%d.%s','pdf','pipe','finish','error','log','err','%s.%s','zip','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','CSV','Completed','info','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','PDF','findOne','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','lodash','bluebird','pdfmake/src/printer','zip-dir','rimraf','../../mysqldb','analytics','argv','MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a','savename','AnalyticExtractedReport','update','hasOwnProperty','tableHeader','num','Empty','dirname','basename','.pdf','Setting','find','split','splitSizePdf','then','length','push','sequelize','query'];(function(_0x12f923,_0x26e3f7){var _0x4248cc=function(_0x35943c){while(--_0x35943c){_0x12f923['push'](_0x12f923['shift']());}};_0x4248cc(++_0x26e3f7);}(_0xd8b0,0xad));var _0x0d8b=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xd8b0[_0x122ef9];return _0x42fba0;};'use strict';var _=require(_0x0d8b('0x0'));var fs=require('fs');var BPromise=require(_0x0d8b('0x1'));var util=require('util');var path=require('path');var moment=require('moment');var PdfPrinter=require(_0x0d8b('0x2'));var zipdir=require(_0x0d8b('0x3'));var rimraf=require(_0x0d8b('0x4'));var db=require(_0x0d8b('0x5'))['db'];var dbH=require(_0x0d8b('0x5'))['dbH'];var logger=require('../../config/logger')(_0x0d8b('0x6'));var EXTRACTED_REPORT_ID=Number(process[_0x0d8b('0x7')][0x2]);var QUERY=process[_0x0d8b('0x7')][0x3];var PATH=process['argv'][0x4];var NAME=process[_0x0d8b('0x7')][0x5];var FORMAT=_0x0d8b('0x8');var _extractedReport;function analyticExtractedReport(_0x58e4e2,_0x129310){var _0x348e65={'status':_0x58e4e2};var _0x3b027f={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x129310){_0x348e65[_0x0d8b('0x9')]=_0x129310;}return db[_0x0d8b('0xa')][_0x0d8b('0xb')](_0x348e65,_0x3b027f);}function getHeader(_0x2c5e9e){var _0x28f87c=[];for(var _0x48fa16 in _0x2c5e9e){if(_0x2c5e9e[_0x0d8b('0xc')](_0x48fa16)){_0x28f87c['push']({'text':_0x48fa16,'style':_0x0d8b('0xd')});}}return _0x28f87c;}function extractReport(_0xc574a3){var _0x340cc4=0x1388;var _0x92cdd8;if(!_0xc574a3[0x0][_0x0d8b('0xe')]){return analyticExtractedReport(_0x0d8b('0xf'));}var _0x15dd0f=[];var _0x31a8cc=0x0;var _0x1d4bbc=!![];var _0x2ce75e=path[_0x0d8b('0x10')](PATH);var _0xe65334=path[_0x0d8b('0x11')](PATH,_0x0d8b('0x12'));var _0x4f6f21=![];var _0x23eb7b=[];return db[_0x0d8b('0x13')][_0x0d8b('0x14')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x0d8b('0x15'),_0x0d8b('0x16')]})['then'](function(_0x106a01){if(_0x106a01){_0x92cdd8=_0x106a01;_0x340cc4=_0x92cdd8[_0x0d8b('0x16')]||0x3e8;}})[_0x0d8b('0x17')](function(){if(_0xc574a3&&_0xc574a3[_0x0d8b('0x18')]){var _0x333674=_0xc574a3[0x0][_0x0d8b('0xe')]%(_0x31a8cc+_0x340cc4);if(_0x92cdd8[_0x0d8b('0x15')]){for(;_0x1d4bbc;_0x31a8cc+=_0x340cc4,_0x333674=_0xc574a3[0x0][_0x0d8b('0xe')]%(_0x31a8cc+_0x340cc4)){if(_0x333674==0x0||_0x333674==_0xc574a3[0x0]['num']){_0x1d4bbc=![];}_0x15dd0f[_0x0d8b('0x19')](dbH[_0x0d8b('0x1a')][_0x0d8b('0x1b')](util[_0x0d8b('0x1c')](_0x0d8b('0x1d'),QUERY,_0x340cc4,_0x31a8cc),{'type':dbH[_0x0d8b('0x1a')][_0x0d8b('0x1e')][_0x0d8b('0x1f')]}));}}else{_0x15dd0f['push'](dbH['sequelize'][_0x0d8b('0x1b')](QUERY,{'type':dbH['sequelize']['QueryTypes']['SELECT']}));}}_0x4f6f21=_0x92cdd8[_0x0d8b('0x15')]&&_0x15dd0f[_0x0d8b('0x18')]>0x1;if(!fs[_0x0d8b('0x20')](path[_0x0d8b('0x21')](_0x2ce75e,_0xe65334))&&_0x4f6f21){fs[_0x0d8b('0x22')](path[_0x0d8b('0x21')](_0x2ce75e,_0xe65334));}return BPromise[_0x0d8b('0x23')](_0x15dd0f,function(_0x4562cb){_0x23eb7b[_0x0d8b('0x19')](_0x4562cb);});})['then'](function(){return BPromise[_0x0d8b('0x23')](_0x15dd0f,function(_0x4463ee,_0x5363e3){var _0xe1ef20;var _0x4a0ae4=util[_0x0d8b('0x1c')](_0x0d8b('0x24'),NAME,_extractedReport[_0x0d8b('0x25')],moment(_extractedReport['startDate'])['format'](FORMAT),moment(_extractedReport[_0x0d8b('0x26')])[_0x0d8b('0x1c')](FORMAT));var _0x4c05ee={'pageSize':'A4','pageOrientation':_0x0d8b('0x27'),'content':[{'text':_0x4a0ae4,'style':'header'}],'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':_0x0d8b('0x28')}}};var _0x4b59e5={'headerRows':0x1,'body':[]};_0x4b59e5[_0x0d8b('0x29')]['push'](getHeader(_0x4463ee[0x0]));var _0x2ab00d;for(var _0x546bf6=0x0;_0x546bf6<_0x4463ee[_0x0d8b('0x18')];_0x546bf6+=0x1){_0x2ab00d=[];for(var _0x544735 in _0x4463ee[_0x546bf6]){if(_0x4463ee[_0x546bf6][_0x0d8b('0xc')](_0x544735)){_0x2ab00d[_0x0d8b('0x19')](_0x4463ee[_0x546bf6][_0x544735]?_[_0x0d8b('0x2a')](_0x4463ee[_0x546bf6][_0x544735]):'');}}_0x4b59e5['body']['push'](_0x2ab00d);}_0x4c05ee['content'][_0x0d8b('0x19')]({'table':_0x4b59e5});return new BPromise(function(_0x5515d2,_0x3cdf3c){var _0x54f6f3=new PdfPrinter({'Roboto':{'normal':__dirname+'/fonts/Roboto-Regular.ttf','bold':__dirname+_0x0d8b('0x2b'),'italics':__dirname+_0x0d8b('0x2c'),'bolditalics':__dirname+_0x0d8b('0x2d')}});var _0xdeee5d=_0x54f6f3[_0x0d8b('0x2e')](_0x4c05ee);if(_0x4f6f21){_0xe1ef20=path[_0x0d8b('0x21')](_0x2ce75e,_0xe65334,util[_0x0d8b('0x1c')](_0x0d8b('0x2f'),_0xe65334,_0x5363e3,'pdf'));}else{_0xe1ef20=path[_0x0d8b('0x21')](_0x2ce75e,util[_0x0d8b('0x1c')]('%s.%s',_0xe65334,_0x0d8b('0x30')));}var _0x23f7f6=_0xdeee5d[_0x0d8b('0x31')](fs['createWriteStream'](_0xe1ef20));_0x23f7f6['on'](_0x0d8b('0x32'),function(){_0x5515d2();});_0x23f7f6['on'](_0x0d8b('0x33'),function(_0x206157){console[_0x0d8b('0x34')](_0x0d8b('0x35'),_0x206157);_0x3cdf3c(_0x206157);});_0xdeee5d['end']();});});})[_0x0d8b('0x17')](function(){if(_0x4f6f21){return new BPromise(function(_0x1649fc,_0x5ad0fe){zipdir(path[_0x0d8b('0x21')](_0x2ce75e,_0xe65334),{'saveTo':path[_0x0d8b('0x21')](_0x2ce75e,util[_0x0d8b('0x1c')](_0x0d8b('0x36'),_0xe65334,_0x0d8b('0x37')))},function(_0x519088){if(_0x519088){_0x5ad0fe(_0x519088);}else{_0x1649fc();}});});}})['then'](function(){if(_0x4f6f21){rimraf(path[_0x0d8b('0x21')](_0x2ce75e,_0xe65334),function(){});}})['then'](function(){logger['info'](util[_0x0d8b('0x1c')](_0x0d8b('0x38'),EXTRACTED_REPORT_ID,_0x0d8b('0x39')));return analyticExtractedReport(_0x0d8b('0x3a'),_0x4f6f21?util[_0x0d8b('0x1c')](_0x0d8b('0x36'),_0xe65334,_0x4f6f21?'zip':_0x0d8b('0x30')):null);});}function main(){logger[_0x0d8b('0x3b')](util[_0x0d8b('0x1c')](_0x0d8b('0x3c'),EXTRACTED_REPORT_ID,_0x0d8b('0x3d')));return db[_0x0d8b('0xa')][_0x0d8b('0x3e')]({'where':{'id':EXTRACTED_REPORT_ID}})['then'](function(_0x1d06b6){_extractedReport=_0x1d06b6;return dbH[_0x0d8b('0x1a')][_0x0d8b('0x1b')](util[_0x0d8b('0x1c')]('SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t',QUERY),{'type':dbH[_0x0d8b('0x1a')]['QueryTypes'][_0x0d8b('0x1f')]});})[_0x0d8b('0x17')](extractReport)[_0x0d8b('0x3f')](function(_0x26ac10){logger[_0x0d8b('0x3b')](util[_0x0d8b('0x1c')](_0x0d8b('0x40'),EXTRACTED_REPORT_ID,_0x0d8b('0x3d')),util[_0x0d8b('0x41')](_0x26ac10,{'showHidden':![],'depth':null}));return analyticExtractedReport(_0x0d8b('0x42'));});}main();
\ No newline at end of file
diff --git a/server/components/export/xlsx.js b/server/components/export/xlsx.js
index fd4844e..b9d9999 100644
--- a/server/components/export/xlsx.js
+++ b/server/components/export/xlsx.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x58d5=['Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','zip','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','Failed','util','path','lodash','bluebird','zip-dir','rimraf','../../mysqldb','dbH','../../config/logger','analytics','AnalyticExtractedReport','update','info','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','XLSX','find','split','splitSizeXlsx','then','query','sequelize','QueryTypes','SELECT','num','length','push','format','%s\x20limit\x20%d\x20OFFSET\x20%d','dirname','.xlsx','existsSync','join','mkdirSync','each','%s%d.%s','%s.%s','xlsx','writeFileSync'];(function(_0x334841,_0x2bbc4c){var _0x5beb4b=function(_0x4bea72){while(--_0x4bea72){_0x334841['push'](_0x334841['shift']());}};_0x5beb4b(++_0x2bbc4c);}(_0x58d5,0x107));var _0x558d=function(_0x37e796,_0x24784e){_0x37e796=_0x37e796-0x0;var _0x287054=_0x58d5[_0x37e796];return _0x287054;};'use strict';var util=require(_0x558d('0x0'));var path=require(_0x558d('0x1'));var _=require(_0x558d('0x2'));var fs=require('fs');var json2xls=require('json2xls');var BPromise=require(_0x558d('0x3'));var zipdir=require(_0x558d('0x4'));var rimraf=require(_0x558d('0x5'));var db=require(_0x558d('0x6'))['db'];var dbH=require('../../mysqldb')[_0x558d('0x7')];var logger=require(_0x558d('0x8'))(_0x558d('0x9'));var EXTRACTED_REPORT_ID=Number(process['argv'][0x2]);var QUERY=process['argv'][0x3];var PATH=process['argv'][0x4];function analyticExtractedReport(_0x8498a8,_0x4946de){var _0x4e478e={'status':_0x8498a8};var _0x14b004={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x4946de){_0x4e478e['savename']=_0x4946de;}return db[_0x558d('0xa')][_0x558d('0xb')](_0x4e478e,_0x14b004);}function main(){var _0x5d9b38=0x1388;var _0x38abb5;logger[_0x558d('0xc')](util['format'](_0x558d('0xd'),EXTRACTED_REPORT_ID,_0x558d('0xe')));return db['Setting'][_0x558d('0xf')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x558d('0x10'),'splitSizeXlsx']})['then'](function(_0x28164c){if(_0x28164c){_0x38abb5=_0x28164c;_0x5d9b38=_0x38abb5[_0x558d('0x11')]||0x1388;}})[_0x558d('0x12')](function(){return dbH['sequelize'][_0x558d('0x13')](util['format']('SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t',QUERY),{'type':dbH[_0x558d('0x14')][_0x558d('0x15')][_0x558d('0x16')]});})[_0x558d('0x12')](function(_0x263ccc){if(!_0x263ccc[0x0][_0x558d('0x17')]){return analyticExtractedReport('Empty');}var _0x4f35da=[];var _0x1dc524=0x0;var _0x29dacd=!![];if(_0x38abb5[_0x558d('0x10')]){if(_0x263ccc&&_0x263ccc[_0x558d('0x18')]){var _0x455f35=_0x263ccc[0x0][_0x558d('0x17')]%(_0x1dc524+_0x5d9b38);for(;_0x29dacd;_0x1dc524+=_0x5d9b38,_0x455f35=_0x263ccc[0x0][_0x558d('0x17')]%(_0x1dc524+_0x5d9b38)){if(_0x455f35==0x0||_0x455f35==_0x263ccc[0x0][_0x558d('0x17')]){_0x29dacd=![];}_0x4f35da[_0x558d('0x19')](dbH[_0x558d('0x14')]['query'](util[_0x558d('0x1a')](_0x558d('0x1b'),QUERY,_0x5d9b38,_0x1dc524),{'type':dbH['sequelize'][_0x558d('0x15')]['SELECT']}));}}}else{_0x4f35da['push'](dbH[_0x558d('0x14')][_0x558d('0x13')](QUERY,{'type':dbH['sequelize'][_0x558d('0x15')][_0x558d('0x16')]}));}var _0x443b0a=path[_0x558d('0x1c')](PATH);var _0x50b3ad=path['basename'](PATH,_0x558d('0x1d'));var _0x40788c=_0x38abb5[_0x558d('0x10')]&&_0x4f35da['length']>0x1;var _0x854cfa=[];if(!fs[_0x558d('0x1e')](path[_0x558d('0x1f')](_0x443b0a,_0x50b3ad))&&_0x40788c){fs[_0x558d('0x20')](path[_0x558d('0x1f')](_0x443b0a,_0x50b3ad));}return BPromise[_0x558d('0x21')](_0x4f35da,function(_0x9f1f63){_0x854cfa['push'](_0x9f1f63);})[_0x558d('0x12')](function(){for(var _0x3f7dd7=0x0;_0x3f7dd7<_0x854cfa[_0x558d('0x18')];_0x3f7dd7+=0x1){var _0x5255ac;var _0x1c8a42=_0x854cfa[_0x3f7dd7];if(_0x40788c){_0x5255ac=path['join'](_0x443b0a,_0x50b3ad,util[_0x558d('0x1a')](_0x558d('0x22'),_0x50b3ad,_0x3f7dd7,'xlsx'));}else{_0x5255ac=path['join'](_0x443b0a,util[_0x558d('0x1a')](_0x558d('0x23'),_0x50b3ad,_0x558d('0x24')));}fs[_0x558d('0x25')](_0x5255ac,json2xls(_0x1c8a42),'binary');}})[_0x558d('0x12')](function(){if(_0x40788c){zipdir(path['join'](_0x443b0a,_0x50b3ad),{'saveTo':path[_0x558d('0x1f')](_0x443b0a,util['format']('%s.%s',_0x50b3ad,'zip'))},function(_0x3f5366,_0x7c9110){});rimraf(path[_0x558d('0x1f')](_0x443b0a,_0x50b3ad),function(){});}})[_0x558d('0x12')](function(){logger[_0x558d('0xc')](util['format'](_0x558d('0x26'),EXTRACTED_REPORT_ID,_0x558d('0xe')));return analyticExtractedReport(_0x558d('0x27'),_0x40788c?util['format'](_0x558d('0x23'),_0x50b3ad,_0x40788c?_0x558d('0x28'):_0x558d('0x24')):null);});})['catch'](function(_0x1a5d06){logger[_0x558d('0xc')](util['format'](_0x558d('0x29'),EXTRACTED_REPORT_ID,_0x558d('0xe')),util['inspect'](_0x1a5d06,{'showHidden':![],'depth':null}));return analyticExtractedReport(_0x558d('0x2a'));});}main();
\ No newline at end of file
+var _0xc7d5=['info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','XLSX','find','splitSizeXlsx','then','sequelize','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','num','Empty','push','query','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','SELECT','dirname','basename','.xlsx','split','length','join','mkdirSync','each','%s%d.%s','%s.%s','xlsx','zip','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','util','lodash','json2xls','zip-dir','../../mysqldb','dbH','../../config/logger','analytics','argv','update'];(function(_0x56258c,_0x64be62){var _0x1e42af=function(_0x4e3240){while(--_0x4e3240){_0x56258c['push'](_0x56258c['shift']());}};_0x1e42af(++_0x64be62);}(_0xc7d5,0x156));var _0x5c7d=function(_0x327c93,_0x424cd7){_0x327c93=_0x327c93-0x0;var _0x308d1d=_0xc7d5[_0x327c93];return _0x308d1d;};'use strict';var util=require(_0x5c7d('0x0'));var path=require('path');var _=require(_0x5c7d('0x1'));var fs=require('fs');var json2xls=require(_0x5c7d('0x2'));var BPromise=require('bluebird');var zipdir=require(_0x5c7d('0x3'));var rimraf=require('rimraf');var db=require('../../mysqldb')['db'];var dbH=require(_0x5c7d('0x4'))[_0x5c7d('0x5')];var logger=require(_0x5c7d('0x6'))(_0x5c7d('0x7'));var EXTRACTED_REPORT_ID=Number(process[_0x5c7d('0x8')][0x2]);var QUERY=process[_0x5c7d('0x8')][0x3];var PATH=process[_0x5c7d('0x8')][0x4];function analyticExtractedReport(_0x3b930f,_0x46b8b5){var _0x576f5e={'status':_0x3b930f};var _0x3b09ef={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x46b8b5){_0x576f5e['savename']=_0x46b8b5;}return db['AnalyticExtractedReport'][_0x5c7d('0x9')](_0x576f5e,_0x3b09ef);}function main(){var _0x689cae=0x1388;var _0x292d8d;logger[_0x5c7d('0xa')](util[_0x5c7d('0xb')](_0x5c7d('0xc'),EXTRACTED_REPORT_ID,_0x5c7d('0xd')));return db['Setting'][_0x5c7d('0xe')]({'where':{'id':0x1},'raw':!![],'attributes':['id','split',_0x5c7d('0xf')]})[_0x5c7d('0x10')](function(_0x22e435){if(_0x22e435){_0x292d8d=_0x22e435;_0x689cae=_0x292d8d[_0x5c7d('0xf')]||0x1388;}})[_0x5c7d('0x10')](function(){return dbH[_0x5c7d('0x11')]['query'](util[_0x5c7d('0xb')](_0x5c7d('0x12'),QUERY),{'type':dbH[_0x5c7d('0x11')]['QueryTypes']['SELECT']});})[_0x5c7d('0x10')](function(_0x29a6d5){if(!_0x29a6d5[0x0][_0x5c7d('0x13')]){return analyticExtractedReport(_0x5c7d('0x14'));}var _0x19f265=[];var _0x48679f=0x0;var _0x653593=!![];if(_0x292d8d['split']){if(_0x29a6d5&&_0x29a6d5['length']){var _0xc8a203=_0x29a6d5[0x0]['num']%(_0x48679f+_0x689cae);for(;_0x653593;_0x48679f+=_0x689cae,_0xc8a203=_0x29a6d5[0x0][_0x5c7d('0x13')]%(_0x48679f+_0x689cae)){if(_0xc8a203==0x0||_0xc8a203==_0x29a6d5[0x0]['num']){_0x653593=![];}_0x19f265[_0x5c7d('0x15')](dbH[_0x5c7d('0x11')][_0x5c7d('0x16')](util[_0x5c7d('0xb')](_0x5c7d('0x17'),QUERY,_0x689cae,_0x48679f),{'type':dbH[_0x5c7d('0x11')]['QueryTypes']['SELECT']}));}}}else{_0x19f265[_0x5c7d('0x15')](dbH['sequelize']['query'](QUERY,{'type':dbH['sequelize'][_0x5c7d('0x18')][_0x5c7d('0x19')]}));}var _0x13e4de=path[_0x5c7d('0x1a')](PATH);var _0x1abcb2=path[_0x5c7d('0x1b')](PATH,_0x5c7d('0x1c'));var _0x3bf466=_0x292d8d[_0x5c7d('0x1d')]&&_0x19f265[_0x5c7d('0x1e')]>0x1;var _0x457ba1=[];if(!fs['existsSync'](path[_0x5c7d('0x1f')](_0x13e4de,_0x1abcb2))&&_0x3bf466){fs[_0x5c7d('0x20')](path[_0x5c7d('0x1f')](_0x13e4de,_0x1abcb2));}return BPromise[_0x5c7d('0x21')](_0x19f265,function(_0x447f8f){_0x457ba1[_0x5c7d('0x15')](_0x447f8f);})[_0x5c7d('0x10')](function(){for(var _0x1cdff7=0x0;_0x1cdff7<_0x457ba1[_0x5c7d('0x1e')];_0x1cdff7+=0x1){var _0x35d7f6;var _0x342aeb=_0x457ba1[_0x1cdff7];if(_0x3bf466){_0x35d7f6=path['join'](_0x13e4de,_0x1abcb2,util[_0x5c7d('0xb')](_0x5c7d('0x22'),_0x1abcb2,_0x1cdff7,'xlsx'));}else{_0x35d7f6=path[_0x5c7d('0x1f')](_0x13e4de,util[_0x5c7d('0xb')](_0x5c7d('0x23'),_0x1abcb2,_0x5c7d('0x24')));}fs['writeFileSync'](_0x35d7f6,json2xls(_0x342aeb),'binary');}})[_0x5c7d('0x10')](function(){if(_0x3bf466){zipdir(path[_0x5c7d('0x1f')](_0x13e4de,_0x1abcb2),{'saveTo':path[_0x5c7d('0x1f')](_0x13e4de,util[_0x5c7d('0xb')](_0x5c7d('0x23'),_0x1abcb2,_0x5c7d('0x25')))},function(_0x37d12d,_0x2eb680){});rimraf(path[_0x5c7d('0x1f')](_0x13e4de,_0x1abcb2),function(){});}})[_0x5c7d('0x10')](function(){logger[_0x5c7d('0xa')](util[_0x5c7d('0xb')](_0x5c7d('0x26'),EXTRACTED_REPORT_ID,_0x5c7d('0xd')));return analyticExtractedReport(_0x5c7d('0x27'),_0x3bf466?util[_0x5c7d('0xb')](_0x5c7d('0x23'),_0x1abcb2,_0x3bf466?'zip':_0x5c7d('0x24')):null);});})[_0x5c7d('0x28')](function(_0x355f7a){logger[_0x5c7d('0xa')](util[_0x5c7d('0xb')](_0x5c7d('0x29'),EXTRACTED_REPORT_ID,'XLSX'),util[_0x5c7d('0x2a')](_0x355f7a,{'showHidden':![],'depth':null}));return analyticExtractedReport(_0x5c7d('0x2b'));});}main();
\ No newline at end of file
diff --git a/server/components/extensions/rewrite.js b/server/components/extensions/rewrite.js
index 7d19173..7de0243 100644
--- a/server/components/extensions/rewrite.js
+++ b/server/components/extensions/rewrite.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x0d98=['VoiceExtensionId','outbound','push','${EXTEN}','CDR(routeid)=','ExecIf','):Goto(','cutdigits','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','hasOwnProperty','recordingFormat','none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','wav','XCALLY-MOTION-PROGRESS=0','toLowerCase','createdAt','updatedAt','*,*,*,*','interval','map','intervals','IntervalId','tag','CDR(tag)=','callerID','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)=','length','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No\x20number\x20available)','indexOf','appType','custom','answer','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','splice','GotoIfTime',',${EXTEN},','last','concat','Hangup','transaction','VoiceExtension','destroy','bulkCreate','error','rewrite','lodash','util','Interval','findAll','then','models','uniq','CAST(priority\x20AS\x20UNSIGNED)','filter','groupBy','queue','priority','extension','find','exten','extensions','type','Set','format','CDR(type)=%s','context'];(function(_0x1593af,_0x1fec40){var _0x3b8361=function(_0x3911f7){while(--_0x3911f7){_0x1593af['push'](_0x1593af['shift']());}};_0x3b8361(++_0x1fec40);}(_0x0d98,0x149));var _0x80d9=function(_0x10567b,_0x31d474){_0x10567b=_0x10567b-0x0;var _0x36ad35=_0x0d98[_0x10567b];return _0x36ad35;};'use strict';var _=require(_0x80d9('0x0'));var util=require(_0x80d9('0x1'));function rewrite(_0x3d9289,_0x5f4122){var _0x4dffe3=this;return _0x3d9289['models'][_0x80d9('0x2')][_0x80d9('0x3')]({'raw':!![]})[_0x80d9('0x4')](function(_0x459acd){_0x4dffe3['intervals']=_0x459acd;return _0x3d9289[_0x80d9('0x5')]['VoiceExtension']['findAll']({'where':{'IntervalId':_0x5f4122['IntervalId']},'raw':!![]});})[_0x80d9('0x4')](function(_0xb8d05){return _0x3d9289['models']['VoiceExtension'][_0x80d9('0x3')]({'where':{'exten':{'$in':_[_0x80d9('0x6')](_['map'](_0xb8d05,'exten'))}},'order':[{'raw':_0x80d9('0x7')}],'raw':!![]});})[_0x80d9('0x4')](function(_0x5d1f65){var _0x306de8=_[_0x80d9('0x8')](_0x5d1f65,{'priority':'1'});var _0x2e86bd=_[_0x80d9('0x8')](_0x5d1f65,{'isApp':0x1});var _0x429ca6=_[_0x80d9('0x9')](_0x2e86bd,'exten');var _0x18d8ae=[_0x80d9('0xa'),'playback'];var _0x1de228=[];var _0xe47790=[];for(var _0x38dda2 in _0x429ca6){if(_0x429ca6['hasOwnProperty'](_0x38dda2)){_0x4dffe3[_0x80d9('0xb')]=0x2;_0x4dffe3['extensions']=[];_0x4dffe3[_0x80d9('0xc')]=_[_0x80d9('0xd')](_0x306de8,{'exten':_0x429ca6[_0x38dda2][0x0][_0x80d9('0xe')]});_0x4dffe3[_0x80d9('0xf')]['push']({'type':_0x429ca6[_0x38dda2][0x0][_0x80d9('0x10')],'app':_0x80d9('0x11'),'appdata':util[_0x80d9('0x12')](_0x80d9('0x13'),_0x429ca6[_0x38dda2][0x0][_0x80d9('0x10')]),'context':_0x429ca6[_0x38dda2][0x0][_0x80d9('0x14')],'exten':_0x429ca6[_0x38dda2][0x0][_0x80d9('0xe')],'priority':_0x4dffe3[_0x80d9('0xb')]++,'VoiceExtensionId':_0x429ca6[_0x38dda2][0x0][_0x80d9('0x15')]});if(_0x429ca6[_0x38dda2][0x0][_0x80d9('0x10')]===_0x80d9('0x16')){if(_0x4dffe3[_0x80d9('0xc')]){_0x4dffe3[_0x80d9('0xf')][_0x80d9('0x17')]({'type':_0x429ca6[_0x38dda2][0x0][_0x80d9('0x10')],'app':'Set','appdata':'CDR(destination)='+(_0x4dffe3[_0x80d9('0xc')]['cutdigits']?'${EXTEN:'+_0x4dffe3[_0x80d9('0xc')]['cutdigits']+'}':_0x80d9('0x18')),'context':_0x429ca6[_0x38dda2][0x0][_0x80d9('0x14')],'exten':_0x429ca6[_0x38dda2][0x0][_0x80d9('0xe')],'priority':_0x4dffe3[_0x80d9('0xb')]++,'VoiceExtensionId':_0x429ca6[_0x38dda2][0x0][_0x80d9('0x15')]});}_0x4dffe3['extensions'][_0x80d9('0x17')]({'type':_0x429ca6[_0x38dda2][0x0]['type'],'app':_0x80d9('0x11'),'appdata':_0x80d9('0x19')+_0x429ca6[_0x38dda2][0x0][_0x80d9('0x15')],'context':_0x429ca6[_0x38dda2][0x0][_0x80d9('0x14')],'exten':_0x429ca6[_0x38dda2][0x0][_0x80d9('0xe')],'priority':_0x4dffe3['priority']++,'VoiceExtensionId':_0x429ca6[_0x38dda2][0x0][_0x80d9('0x15')]});var _0x2d32fa=_0x4dffe3[_0x80d9('0xb')]++;_0x4dffe3['extensions'][_0x80d9('0x17')]({'type':_0x429ca6[_0x38dda2][0x0][_0x80d9('0x10')],'app':_0x80d9('0x1a'),'appdata':'$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto('+(_0x2d32fa+0x2)+_0x80d9('0x1b')+(_0x2d32fa+0x1)+')','context':_0x429ca6[_0x38dda2][0x0][_0x80d9('0x14')],'exten':_0x429ca6[_0x38dda2][0x0][_0x80d9('0xe')],'priority':_0x2d32fa,'VoiceExtensionId':_0x429ca6[_0x38dda2][0x0][_0x80d9('0x15')]});if(_0x4dffe3['extension']){_0x4dffe3['extensions'][_0x80d9('0x17')]({'type':_0x429ca6[_0x38dda2][0x0][_0x80d9('0x10')],'app':_0x80d9('0x11'),'appdata':_0x4dffe3['extension'][_0x80d9('0x1c')]?_0x80d9('0x1d')+_0x4dffe3[_0x80d9('0xc')][_0x80d9('0x1c')]+'}':_0x80d9('0x1e'),'context':_0x429ca6[_0x38dda2][0x0][_0x80d9('0x14')],'exten':_0x429ca6[_0x38dda2][0x0][_0x80d9('0xe')],'priority':_0x4dffe3[_0x80d9('0xb')]++,'VoiceExtensionId':_0x429ca6[_0x38dda2][0x0][_0x80d9('0x15')]});}_0x4dffe3[_0x80d9('0xf')][_0x80d9('0x17')]({'type':_0x429ca6[_0x38dda2][0x0][_0x80d9('0x10')],'app':_0x80d9('0x11'),'appdata':'outboundrouteid='+_0x429ca6[_0x38dda2][0x0][_0x80d9('0x15')],'context':_0x429ca6[_0x38dda2][0x0][_0x80d9('0x14')],'exten':_0x429ca6[_0x38dda2][0x0]['exten'],'priority':_0x4dffe3[_0x80d9('0xb')]++,'VoiceExtensionId':_0x429ca6[_0x38dda2][0x0][_0x80d9('0x15')]});if(_0x4dffe3[_0x80d9('0xc')]&&_0x4dffe3[_0x80d9('0xc')][_0x80d9('0x1f')](_0x80d9('0x20'))&&_0x4dffe3['extension']['recordingFormat']!==_0x80d9('0x21')){_0x4dffe3[_0x80d9('0xf')][_0x80d9('0x17')]({'type':_0x429ca6[_0x38dda2][0x0]['type'],'app':_0x80d9('0x11'),'appdata':_0x80d9('0x22'),'context':_0x429ca6[_0x38dda2][0x0][_0x80d9('0x14')],'exten':_0x429ca6[_0x38dda2][0x0]['exten'],'priority':_0x4dffe3[_0x80d9('0xb')]++,'VoiceExtensionId':_0x429ca6[_0x38dda2][0x0][_0x80d9('0x15')]});_0x4dffe3[_0x80d9('0xf')][_0x80d9('0x17')]({'type':_0x429ca6[_0x38dda2][0x0][_0x80d9('0x10')],'app':'Set','appdata':_0x80d9('0x23')+_0x4dffe3['extension'][_0x80d9('0x20')]||_0x80d9('0x24'),'context':_0x429ca6[_0x38dda2][0x0]['context'],'exten':_0x429ca6[_0x38dda2][0x0][_0x80d9('0xe')],'priority':_0x4dffe3[_0x80d9('0xb')]++,'VoiceExtensionId':_0x429ca6[_0x38dda2][0x0][_0x80d9('0x15')]});}}_0x4dffe3[_0x80d9('0xf')][_0x80d9('0x17')]({'type':_0x429ca6[_0x38dda2][0x0][_0x80d9('0x10')],'app':'Set','appdata':'XCALLY-MOTION-ANSWER=0','context':_0x429ca6[_0x38dda2][0x0]['context'],'exten':_0x429ca6[_0x38dda2][0x0]['exten'],'priority':_0x4dffe3[_0x80d9('0xb')]++,'VoiceExtensionId':_0x429ca6[_0x38dda2][0x0][_0x80d9('0x15')]});_0x4dffe3['extensions'][_0x80d9('0x17')]({'type':_0x429ca6[_0x38dda2][0x0][_0x80d9('0x10')],'app':_0x80d9('0x11'),'appdata':_0x80d9('0x25'),'context':_0x429ca6[_0x38dda2][0x0]['context'],'exten':_0x429ca6[_0x38dda2][0x0][_0x80d9('0xe')],'priority':_0x4dffe3[_0x80d9('0xb')]++,'VoiceExtensionId':_0x429ca6[_0x38dda2][0x0][_0x80d9('0x15')]});_0x4dffe3['extensions'][_0x80d9('0x17')]({'type':_0x429ca6[_0x38dda2][0x0]['type'],'app':_0x80d9('0x11'),'appdata':'MONITOR_OPTIONS=ab','context':_0x429ca6[_0x38dda2][0x0][_0x80d9('0x14')],'exten':_0x429ca6[_0x38dda2][0x0][_0x80d9('0xe')],'priority':_0x4dffe3[_0x80d9('0xb')]++,'VoiceExtensionId':_0x429ca6[_0x38dda2][0x0][_0x80d9('0x15')]});for(var _0x2c8587=0x0,_0xa84bd5=0x0;_0x2c8587<_0x429ca6[_0x38dda2]['length'];_0x2c8587+=0x1,_0xa84bd5=0x0){var _0x5326b7=_0x429ca6[_0x38dda2][_0x2c8587];if(_0x5326b7['type']){_0x5326b7[_0x80d9('0x10')]=_0x5326b7[_0x80d9('0x10')][_0x80d9('0x26')]();}var _0x3abf3f=[];var _0x2ab544=[];delete _0x5326b7['id'];delete _0x5326b7[_0x80d9('0x27')];delete _0x5326b7[_0x80d9('0x28')];var _0x2d40a4=_0x5326b7['interval']!==_0x80d9('0x29')?[_0x5326b7[_0x80d9('0x2a')]]:_0x5326b7['IntervalId']?_[_0x80d9('0x2b')](_[_0x80d9('0x8')](_0x4dffe3[_0x80d9('0x2c')],{'IntervalId':_0x5326b7[_0x80d9('0x2d')]}),_0x80d9('0x2a')):[];if(_0x5326b7['hasOwnProperty'](_0x80d9('0x2e'))){if(_0x5326b7[_0x80d9('0x2e')]&&_0x5326b7[_0x80d9('0x2e')]!=='--'){_0x3abf3f['push']({'type':_0x5326b7[_0x80d9('0x10')],'app':'Set','appdata':_0x80d9('0x2f')+_0x5326b7[_0x80d9('0x2e')],'context':_0x5326b7[_0x80d9('0x14')],'exten':_0x5326b7[_0x80d9('0xe')],'priority':_0x2d40a4['length']+_0x4dffe3[_0x80d9('0xb')]+_0xa84bd5++,'VoiceExtensionId':_0x5326b7['VoiceExtensionId']});}}if(_0x5326b7[_0x80d9('0x10')]===_0x80d9('0x16')&&_0x5326b7[_0x80d9('0x1f')](_0x80d9('0x30'))){if(_0x5326b7['callerID']){_0x3abf3f[_0x80d9('0x17')]({'type':_0x5326b7['type'],'app':_0x80d9('0x1a'),'appdata':_0x80d9('0x31')+_0x5326b7['callerID']+')','context':_0x5326b7[_0x80d9('0x14')],'exten':_0x5326b7[_0x80d9('0xe')],'priority':_0x2d40a4[_0x80d9('0x32')]+_0x4dffe3[_0x80d9('0xb')]+_0xa84bd5++,'VoiceExtensionId':_0x5326b7['VoiceExtensionId']});}else{_0x3abf3f[_0x80d9('0x17')]({'type':_0x5326b7[_0x80d9('0x10')],'app':_0x80d9('0x1a'),'appdata':_0x80d9('0x33'),'context':_0x5326b7[_0x80d9('0x14')],'exten':_0x5326b7['exten'],'priority':_0x2d40a4['length']+_0x4dffe3[_0x80d9('0xb')]+_0xa84bd5++,'VoiceExtensionId':_0x5326b7[_0x80d9('0x15')]});}}if(_0x5326b7[_0x80d9('0x1f')]('answer')){if(_0x18d8ae[_0x80d9('0x34')](_0x5326b7['app']['toLowerCase']())>=0x0&&_0x5326b7[_0x80d9('0x35')]!==_0x80d9('0x36')){if(_0x5326b7[_0x80d9('0x37')]){_0x3abf3f[_0x80d9('0x17')]({'type':_0x5326b7[_0x80d9('0x10')],'app':_0x80d9('0x1a'),'appdata':'$[${XCALLY-MOTION-ANSWER}=0]?Answer','context':_0x5326b7[_0x80d9('0x14')],'exten':_0x5326b7[_0x80d9('0xe')],'priority':_0x2d40a4[_0x80d9('0x32')]+_0x4dffe3[_0x80d9('0xb')]+_0xa84bd5++,'VoiceExtensionId':_0x5326b7[_0x80d9('0x15')]});_0x3abf3f[_0x80d9('0x17')]({'type':_0x5326b7[_0x80d9('0x10')],'app':_0x80d9('0x11'),'appdata':_0x80d9('0x38'),'context':_0x5326b7[_0x80d9('0x14')],'exten':_0x5326b7['exten'],'priority':_0x2d40a4[_0x80d9('0x32')]+_0x4dffe3[_0x80d9('0xb')]+_0xa84bd5++,'VoiceExtensionId':_0x5326b7[_0x80d9('0x15')]});}else{_0x3abf3f[_0x80d9('0x17')]({'type':_0x5326b7[_0x80d9('0x10')],'app':_0x80d9('0x1a'),'appdata':_0x80d9('0x39'),'context':_0x5326b7['context'],'exten':_0x5326b7[_0x80d9('0xe')],'priority':_0x2d40a4[_0x80d9('0x32')]+_0x4dffe3['priority']+_0xa84bd5++,'VoiceExtensionId':_0x5326b7[_0x80d9('0x15')]});_0x3abf3f[_0x80d9('0x17')]({'type':_0x5326b7['type'],'app':_0x80d9('0x11'),'appdata':'XCALLY-MOTION-PROGRESS=1','context':_0x5326b7[_0x80d9('0x14')],'exten':_0x5326b7[_0x80d9('0xe')],'priority':_0x2d40a4[_0x80d9('0x32')]+_0x4dffe3[_0x80d9('0xb')]+_0xa84bd5++,'VoiceExtensionId':_0x5326b7[_0x80d9('0x15')]});}}}for(var _0x37cb4d=0x0;_0x37cb4d<_0x2d40a4['length'];_0x37cb4d+=0x1){var _0x2ceaa1=_0x4dffe3[_0x80d9('0xb')]+_0x2d40a4[_0x80d9('0x32')];var _0x64eaae=_0x37cb4d===_0x2d40a4[_0x80d9('0x32')]-0x1?_0x4dffe3[_0x80d9('0xb')]+_0x3abf3f['length']+_0x2ab544[_0x80d9('0x32')]+0x2:_0x4dffe3['priority']+_0x37cb4d+0x1;_0x3abf3f[_0x80d9('0x3a')](_0x37cb4d,0x0,{'type':_0x5326b7['type'],'app':_0x80d9('0x3b'),'appdata':_0x2d40a4[_0x37cb4d]+'?'+_0x5326b7[_0x80d9('0x14')]+_0x80d9('0x3c')+_0x2ceaa1+':'+_0x5326b7[_0x80d9('0x14')]+_0x80d9('0x3c')+_0x64eaae,'exten':_0x5326b7['exten'],'context':_0x5326b7[_0x80d9('0x14')],'priority':_0x4dffe3[_0x80d9('0xb')]+_0x37cb4d,'VoiceExtensionId':_0x429ca6[_0x38dda2][0x0][_0x80d9('0x15')]});}_0x5326b7[_0x80d9('0xb')]=_0x3abf3f[_0x80d9('0x32')]?_[_0x80d9('0x3d')](_0x3abf3f)['priority']+0x1:_0x4dffe3[_0x80d9('0xb')];_0x4dffe3[_0x80d9('0xb')]=(_0x2ab544['length']?_['last'](_0x2ab544)[_0x80d9('0xb')]:_0x5326b7['priority'])+0x1;_0x4dffe3[_0x80d9('0xf')]=_[_0x80d9('0x3e')](_0x4dffe3['extensions'],_0x3abf3f,[_0x5326b7],_0x2ab544);}_0x4dffe3[_0x80d9('0xf')][_0x80d9('0x17')]({'type':_0x429ca6[_0x38dda2][0x0][_0x80d9('0x10')],'app':_0x80d9('0x3f'),'exten':_0x429ca6[_0x38dda2][0x0][_0x80d9('0xe')],'context':_0x429ca6[_0x38dda2][0x0][_0x80d9('0x14')],'priority':_0x4dffe3[_0x80d9('0xb')],'VoiceExtensionId':_0x429ca6[_0x38dda2][0x0][_0x80d9('0x15')]});_0x1de228[_0x80d9('0x17')](_0x429ca6[_0x38dda2][0x0][_0x80d9('0x15')]);_0xe47790=_[_0x80d9('0x3e')](_0xe47790,_0x4dffe3[_0x80d9('0xf')]);}}return _0x3d9289[_0x80d9('0x40')](function(_0x1badee){return _0x3d9289[_0x80d9('0x5')][_0x80d9('0x41')][_0x80d9('0x42')]({'where':{'VoiceExtensionId':{'$in':_0x1de228}},'transaction':_0x1badee})[_0x80d9('0x4')](function(_0x55616c){return _0x3d9289[_0x80d9('0x5')][_0x80d9('0x41')][_0x80d9('0x43')](_['sortBy'](_0xe47790,_0x80d9('0xb')),{'transaction':_0x1badee});});});})['catch'](function(_0x394882){console[_0x80d9('0x44')](_0x394882);});}exports[_0x80d9('0x45')]=rewrite;
\ No newline at end of file
+var _0x5cbc=['groupBy','exten','playback','hasOwnProperty','priority','extensions','extension','push','type','Set','CDR(type)=%s','context','outbound','CDR(destination)=','${EXTEN:','cutdigits','VoiceExtensionId','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','recordingFormat','none','_XCALLY_MIXMONITOR_FORMAT=','wav','XCALLY-MOTION-ANSWER=0','MONITOR_OPTIONS=ab','length','toLowerCase','createdAt','*,*,*,*','interval','filter','tag','CDR(tag)=','callerID','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No\x20number\x20available)','answer','app','appType','custom','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','splice','GotoIfTime',',${EXTEN},','last','Hangup','bulkCreate','sortBy','catch','error','rewrite','lodash','models','findAll','then','IntervalId','VoiceExtension','uniq','map','CAST(priority\x20AS\x20UNSIGNED)'];(function(_0x33a499,_0x302924){var _0x4a437f=function(_0x294db8){while(--_0x294db8){_0x33a499['push'](_0x33a499['shift']());}};_0x4a437f(++_0x302924);}(_0x5cbc,0xfb));var _0xc5cb=function(_0x374672,_0x4f495a){_0x374672=_0x374672-0x0;var _0x2318e1=_0x5cbc[_0x374672];return _0x2318e1;};'use strict';var _=require(_0xc5cb('0x0'));var util=require('util');function rewrite(_0x29b739,_0x1ec545){var _0x38586e=this;return _0x29b739[_0xc5cb('0x1')]['Interval'][_0xc5cb('0x2')]({'raw':!![]})[_0xc5cb('0x3')](function(_0x1f4383){_0x38586e['intervals']=_0x1f4383;return _0x29b739[_0xc5cb('0x1')]['VoiceExtension'][_0xc5cb('0x2')]({'where':{'IntervalId':_0x1ec545[_0xc5cb('0x4')]},'raw':!![]});})['then'](function(_0x1804f6){return _0x29b739['models'][_0xc5cb('0x5')][_0xc5cb('0x2')]({'where':{'exten':{'$in':_[_0xc5cb('0x6')](_[_0xc5cb('0x7')](_0x1804f6,'exten'))}},'order':[{'raw':_0xc5cb('0x8')}],'raw':!![]});})['then'](function(_0x46d8d3){var _0x5d8973=_['filter'](_0x46d8d3,{'priority':'1'});var _0x295b75=_['filter'](_0x46d8d3,{'isApp':0x1});var _0x3b7be4=_[_0xc5cb('0x9')](_0x295b75,_0xc5cb('0xa'));var _0x57de51=['queue',_0xc5cb('0xb')];var _0x20d71f=[];var _0x5cc765=[];for(var _0x42a792 in _0x3b7be4){if(_0x3b7be4[_0xc5cb('0xc')](_0x42a792)){_0x38586e[_0xc5cb('0xd')]=0x2;_0x38586e[_0xc5cb('0xe')]=[];_0x38586e[_0xc5cb('0xf')]=_['find'](_0x5d8973,{'exten':_0x3b7be4[_0x42a792][0x0]['exten']});_0x38586e[_0xc5cb('0xe')][_0xc5cb('0x10')]({'type':_0x3b7be4[_0x42a792][0x0][_0xc5cb('0x11')],'app':_0xc5cb('0x12'),'appdata':util['format'](_0xc5cb('0x13'),_0x3b7be4[_0x42a792][0x0][_0xc5cb('0x11')]),'context':_0x3b7be4[_0x42a792][0x0][_0xc5cb('0x14')],'exten':_0x3b7be4[_0x42a792][0x0][_0xc5cb('0xa')],'priority':_0x38586e['priority']++,'VoiceExtensionId':_0x3b7be4[_0x42a792][0x0]['VoiceExtensionId']});if(_0x3b7be4[_0x42a792][0x0]['type']===_0xc5cb('0x15')){if(_0x38586e[_0xc5cb('0xf')]){_0x38586e['extensions'][_0xc5cb('0x10')]({'type':_0x3b7be4[_0x42a792][0x0][_0xc5cb('0x11')],'app':_0xc5cb('0x12'),'appdata':_0xc5cb('0x16')+(_0x38586e[_0xc5cb('0xf')]['cutdigits']?_0xc5cb('0x17')+_0x38586e[_0xc5cb('0xf')][_0xc5cb('0x18')]+'}':'${EXTEN}'),'context':_0x3b7be4[_0x42a792][0x0]['context'],'exten':_0x3b7be4[_0x42a792][0x0][_0xc5cb('0xa')],'priority':_0x38586e['priority']++,'VoiceExtensionId':_0x3b7be4[_0x42a792][0x0][_0xc5cb('0x19')]});}_0x38586e[_0xc5cb('0xe')]['push']({'type':_0x3b7be4[_0x42a792][0x0]['type'],'app':_0xc5cb('0x12'),'appdata':'CDR(routeid)='+_0x3b7be4[_0x42a792][0x0][_0xc5cb('0x19')],'context':_0x3b7be4[_0x42a792][0x0]['context'],'exten':_0x3b7be4[_0x42a792][0x0][_0xc5cb('0xa')],'priority':_0x38586e[_0xc5cb('0xd')]++,'VoiceExtensionId':_0x3b7be4[_0x42a792][0x0][_0xc5cb('0x19')]});var _0x567057=_0x38586e['priority']++;_0x38586e[_0xc5cb('0xe')]['push']({'type':_0x3b7be4[_0x42a792][0x0]['type'],'app':_0xc5cb('0x1a'),'appdata':_0xc5cb('0x1b')+(_0x567057+0x2)+_0xc5cb('0x1c')+(_0x567057+0x1)+')','context':_0x3b7be4[_0x42a792][0x0][_0xc5cb('0x14')],'exten':_0x3b7be4[_0x42a792][0x0][_0xc5cb('0xa')],'priority':_0x567057,'VoiceExtensionId':_0x3b7be4[_0x42a792][0x0][_0xc5cb('0x19')]});if(_0x38586e[_0xc5cb('0xf')]){_0x38586e['extensions']['push']({'type':_0x3b7be4[_0x42a792][0x0][_0xc5cb('0x11')],'app':'Set','appdata':_0x38586e[_0xc5cb('0xf')][_0xc5cb('0x18')]?_0xc5cb('0x1d')+_0x38586e[_0xc5cb('0xf')][_0xc5cb('0x18')]+'}':_0xc5cb('0x1e'),'context':_0x3b7be4[_0x42a792][0x0][_0xc5cb('0x14')],'exten':_0x3b7be4[_0x42a792][0x0][_0xc5cb('0xa')],'priority':_0x38586e[_0xc5cb('0xd')]++,'VoiceExtensionId':_0x3b7be4[_0x42a792][0x0]['VoiceExtensionId']});}_0x38586e[_0xc5cb('0xe')][_0xc5cb('0x10')]({'type':_0x3b7be4[_0x42a792][0x0][_0xc5cb('0x11')],'app':'Set','appdata':'outboundrouteid='+_0x3b7be4[_0x42a792][0x0][_0xc5cb('0x19')],'context':_0x3b7be4[_0x42a792][0x0]['context'],'exten':_0x3b7be4[_0x42a792][0x0]['exten'],'priority':_0x38586e[_0xc5cb('0xd')]++,'VoiceExtensionId':_0x3b7be4[_0x42a792][0x0]['VoiceExtensionId']});if(_0x38586e[_0xc5cb('0xf')]&&_0x38586e[_0xc5cb('0xf')]['hasOwnProperty']('recordingFormat')&&_0x38586e['extension'][_0xc5cb('0x1f')]!==_0xc5cb('0x20')){_0x38586e[_0xc5cb('0xe')][_0xc5cb('0x10')]({'type':_0x3b7be4[_0x42a792][0x0][_0xc5cb('0x11')],'app':_0xc5cb('0x12'),'appdata':'_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','context':_0x3b7be4[_0x42a792][0x0][_0xc5cb('0x14')],'exten':_0x3b7be4[_0x42a792][0x0][_0xc5cb('0xa')],'priority':_0x38586e[_0xc5cb('0xd')]++,'VoiceExtensionId':_0x3b7be4[_0x42a792][0x0]['VoiceExtensionId']});_0x38586e[_0xc5cb('0xe')][_0xc5cb('0x10')]({'type':_0x3b7be4[_0x42a792][0x0][_0xc5cb('0x11')],'app':_0xc5cb('0x12'),'appdata':_0xc5cb('0x21')+_0x38586e[_0xc5cb('0xf')][_0xc5cb('0x1f')]||_0xc5cb('0x22'),'context':_0x3b7be4[_0x42a792][0x0][_0xc5cb('0x14')],'exten':_0x3b7be4[_0x42a792][0x0][_0xc5cb('0xa')],'priority':_0x38586e[_0xc5cb('0xd')]++,'VoiceExtensionId':_0x3b7be4[_0x42a792][0x0][_0xc5cb('0x19')]});}}_0x38586e['extensions'][_0xc5cb('0x10')]({'type':_0x3b7be4[_0x42a792][0x0][_0xc5cb('0x11')],'app':_0xc5cb('0x12'),'appdata':_0xc5cb('0x23'),'context':_0x3b7be4[_0x42a792][0x0][_0xc5cb('0x14')],'exten':_0x3b7be4[_0x42a792][0x0]['exten'],'priority':_0x38586e[_0xc5cb('0xd')]++,'VoiceExtensionId':_0x3b7be4[_0x42a792][0x0][_0xc5cb('0x19')]});_0x38586e[_0xc5cb('0xe')][_0xc5cb('0x10')]({'type':_0x3b7be4[_0x42a792][0x0][_0xc5cb('0x11')],'app':'Set','appdata':'XCALLY-MOTION-PROGRESS=0','context':_0x3b7be4[_0x42a792][0x0]['context'],'exten':_0x3b7be4[_0x42a792][0x0][_0xc5cb('0xa')],'priority':_0x38586e[_0xc5cb('0xd')]++,'VoiceExtensionId':_0x3b7be4[_0x42a792][0x0][_0xc5cb('0x19')]});_0x38586e[_0xc5cb('0xe')][_0xc5cb('0x10')]({'type':_0x3b7be4[_0x42a792][0x0][_0xc5cb('0x11')],'app':_0xc5cb('0x12'),'appdata':_0xc5cb('0x24'),'context':_0x3b7be4[_0x42a792][0x0][_0xc5cb('0x14')],'exten':_0x3b7be4[_0x42a792][0x0]['exten'],'priority':_0x38586e['priority']++,'VoiceExtensionId':_0x3b7be4[_0x42a792][0x0][_0xc5cb('0x19')]});for(var _0x5c9182=0x0,_0x33fdc3=0x0;_0x5c9182<_0x3b7be4[_0x42a792][_0xc5cb('0x25')];_0x5c9182+=0x1,_0x33fdc3=0x0){var _0x57432c=_0x3b7be4[_0x42a792][_0x5c9182];if(_0x57432c[_0xc5cb('0x11')]){_0x57432c[_0xc5cb('0x11')]=_0x57432c[_0xc5cb('0x11')][_0xc5cb('0x26')]();}var _0x3cb3cb=[];var _0x3ec035=[];delete _0x57432c['id'];delete _0x57432c[_0xc5cb('0x27')];delete _0x57432c['updatedAt'];var _0x3783bd=_0x57432c['interval']!==_0xc5cb('0x28')?[_0x57432c[_0xc5cb('0x29')]]:_0x57432c[_0xc5cb('0x4')]?_[_0xc5cb('0x7')](_[_0xc5cb('0x2a')](_0x38586e['intervals'],{'IntervalId':_0x57432c[_0xc5cb('0x4')]}),_0xc5cb('0x29')):[];if(_0x57432c[_0xc5cb('0xc')]('tag')){if(_0x57432c[_0xc5cb('0x2b')]&&_0x57432c['tag']!=='--'){_0x3cb3cb[_0xc5cb('0x10')]({'type':_0x57432c[_0xc5cb('0x11')],'app':_0xc5cb('0x12'),'appdata':_0xc5cb('0x2c')+_0x57432c[_0xc5cb('0x2b')],'context':_0x57432c['context'],'exten':_0x57432c[_0xc5cb('0xa')],'priority':_0x3783bd[_0xc5cb('0x25')]+_0x38586e[_0xc5cb('0xd')]+_0x33fdc3++,'VoiceExtensionId':_0x57432c[_0xc5cb('0x19')]});}}if(_0x57432c[_0xc5cb('0x11')]===_0xc5cb('0x15')&&_0x57432c['hasOwnProperty'](_0xc5cb('0x2d'))){if(_0x57432c[_0xc5cb('0x2d')]){_0x3cb3cb[_0xc5cb('0x10')]({'type':_0x57432c[_0xc5cb('0x11')],'app':'ExecIf','appdata':'$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)='+_0x57432c[_0xc5cb('0x2d')]+')','context':_0x57432c[_0xc5cb('0x14')],'exten':_0x57432c[_0xc5cb('0xa')],'priority':_0x3783bd[_0xc5cb('0x25')]+_0x38586e['priority']+_0x33fdc3++,'VoiceExtensionId':_0x57432c[_0xc5cb('0x19')]});}else{_0x3cb3cb[_0xc5cb('0x10')]({'type':_0x57432c[_0xc5cb('0x11')],'app':_0xc5cb('0x1a'),'appdata':_0xc5cb('0x2e'),'context':_0x57432c[_0xc5cb('0x14')],'exten':_0x57432c[_0xc5cb('0xa')],'priority':_0x3783bd[_0xc5cb('0x25')]+_0x38586e['priority']+_0x33fdc3++,'VoiceExtensionId':_0x57432c['VoiceExtensionId']});}}if(_0x57432c[_0xc5cb('0xc')](_0xc5cb('0x2f'))){if(_0x57de51['indexOf'](_0x57432c[_0xc5cb('0x30')][_0xc5cb('0x26')]())>=0x0&&_0x57432c[_0xc5cb('0x31')]!==_0xc5cb('0x32')){if(_0x57432c[_0xc5cb('0x2f')]){_0x3cb3cb[_0xc5cb('0x10')]({'type':_0x57432c[_0xc5cb('0x11')],'app':_0xc5cb('0x1a'),'appdata':_0xc5cb('0x33'),'context':_0x57432c[_0xc5cb('0x14')],'exten':_0x57432c[_0xc5cb('0xa')],'priority':_0x3783bd[_0xc5cb('0x25')]+_0x38586e['priority']+_0x33fdc3++,'VoiceExtensionId':_0x57432c['VoiceExtensionId']});_0x3cb3cb[_0xc5cb('0x10')]({'type':_0x57432c[_0xc5cb('0x11')],'app':_0xc5cb('0x12'),'appdata':_0xc5cb('0x34'),'context':_0x57432c[_0xc5cb('0x14')],'exten':_0x57432c[_0xc5cb('0xa')],'priority':_0x3783bd[_0xc5cb('0x25')]+_0x38586e['priority']+_0x33fdc3++,'VoiceExtensionId':_0x57432c['VoiceExtensionId']});}else{_0x3cb3cb[_0xc5cb('0x10')]({'type':_0x57432c[_0xc5cb('0x11')],'app':_0xc5cb('0x1a'),'appdata':_0xc5cb('0x35'),'context':_0x57432c[_0xc5cb('0x14')],'exten':_0x57432c['exten'],'priority':_0x3783bd[_0xc5cb('0x25')]+_0x38586e['priority']+_0x33fdc3++,'VoiceExtensionId':_0x57432c[_0xc5cb('0x19')]});_0x3cb3cb[_0xc5cb('0x10')]({'type':_0x57432c[_0xc5cb('0x11')],'app':'Set','appdata':_0xc5cb('0x36'),'context':_0x57432c['context'],'exten':_0x57432c[_0xc5cb('0xa')],'priority':_0x3783bd[_0xc5cb('0x25')]+_0x38586e['priority']+_0x33fdc3++,'VoiceExtensionId':_0x57432c['VoiceExtensionId']});}}}for(var _0x5ba1d3=0x0;_0x5ba1d3<_0x3783bd[_0xc5cb('0x25')];_0x5ba1d3+=0x1){var _0x3fcf4f=_0x38586e[_0xc5cb('0xd')]+_0x3783bd[_0xc5cb('0x25')];var _0x157d54=_0x5ba1d3===_0x3783bd['length']-0x1?_0x38586e[_0xc5cb('0xd')]+_0x3cb3cb[_0xc5cb('0x25')]+_0x3ec035[_0xc5cb('0x25')]+0x2:_0x38586e[_0xc5cb('0xd')]+_0x5ba1d3+0x1;_0x3cb3cb[_0xc5cb('0x37')](_0x5ba1d3,0x0,{'type':_0x57432c[_0xc5cb('0x11')],'app':_0xc5cb('0x38'),'appdata':_0x3783bd[_0x5ba1d3]+'?'+_0x57432c[_0xc5cb('0x14')]+_0xc5cb('0x39')+_0x3fcf4f+':'+_0x57432c['context']+_0xc5cb('0x39')+_0x157d54,'exten':_0x57432c['exten'],'context':_0x57432c[_0xc5cb('0x14')],'priority':_0x38586e[_0xc5cb('0xd')]+_0x5ba1d3,'VoiceExtensionId':_0x3b7be4[_0x42a792][0x0][_0xc5cb('0x19')]});}_0x57432c[_0xc5cb('0xd')]=_0x3cb3cb[_0xc5cb('0x25')]?_[_0xc5cb('0x3a')](_0x3cb3cb)['priority']+0x1:_0x38586e[_0xc5cb('0xd')];_0x38586e[_0xc5cb('0xd')]=(_0x3ec035[_0xc5cb('0x25')]?_['last'](_0x3ec035)[_0xc5cb('0xd')]:_0x57432c[_0xc5cb('0xd')])+0x1;_0x38586e[_0xc5cb('0xe')]=_['concat'](_0x38586e[_0xc5cb('0xe')],_0x3cb3cb,[_0x57432c],_0x3ec035);}_0x38586e[_0xc5cb('0xe')][_0xc5cb('0x10')]({'type':_0x3b7be4[_0x42a792][0x0][_0xc5cb('0x11')],'app':_0xc5cb('0x3b'),'exten':_0x3b7be4[_0x42a792][0x0]['exten'],'context':_0x3b7be4[_0x42a792][0x0]['context'],'priority':_0x38586e['priority'],'VoiceExtensionId':_0x3b7be4[_0x42a792][0x0][_0xc5cb('0x19')]});_0x20d71f[_0xc5cb('0x10')](_0x3b7be4[_0x42a792][0x0][_0xc5cb('0x19')]);_0x5cc765=_['concat'](_0x5cc765,_0x38586e['extensions']);}}return _0x29b739['transaction'](function(_0x5970c0){return _0x29b739[_0xc5cb('0x1')]['VoiceExtension']['destroy']({'where':{'VoiceExtensionId':{'$in':_0x20d71f}},'transaction':_0x5970c0})[_0xc5cb('0x3')](function(_0x21b4a4){return _0x29b739[_0xc5cb('0x1')][_0xc5cb('0x5')][_0xc5cb('0x3c')](_[_0xc5cb('0x3d')](_0x5cc765,_0xc5cb('0xd')),{'transaction':_0x5970c0});});});})[_0xc5cb('0x3e')](function(_0x31fa82){console[_0xc5cb('0x3f')](_0x31fa82);});}exports[_0xc5cb('0x40')]=rewrite;
\ No newline at end of file
diff --git a/server/components/import/cm/csv.js b/server/components/import/cm/csv.js
index a287015..dece1f2 100644
--- a/server/components/import/cm/csv.js
+++ b/server/components/import/cm/csv.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xa9e0=['CmContact','create','keys','then','push','pick','Error\x20while\x20creating\x20contact:\x20','stringify','cmContact','checkHopper','inspect','insert','into','cm_hopper','fromQuery','scheduledAt','ContactId','updatedAt','select','field','NOW()','toString','createdAt','from','cm_contacts','where','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','\x20=\x20?','str','calleridnum','cm_hopper_final','id\x20IN\x20?','cm_hopper_black','VoiceQueue','findAll','outbound','dialCheckDuplicateType','CmList','Lists','get','always','sequelize','VoiceQueueId','onlyIfOpen','query','catch','all','BlackLists','Campaign','CampaignId','cmContact,\x20%s,\x20%s','generalCheckHopper','Error\x20processing\x20rows\x20block:','contact:csv_','emit','unlinkSync','SIGINT','info','CSV\x20import\x20process\x20stopped!','resolve','createReadStream','parse','pause','CSV\x20parsed\x20correctly!','CSV\x20parse\x20error','Error\x20executing\x20contact\x20csv\x20import:','bluebird','util','lodash','ioredis','../../../config/environment','../../../config/logger','api','redis','defaults','localhost','socket.io-emitter','argv','null','Missing\x20filepath\x20parameter!','undefined','Missing\x20binding\x20parameters!','zipObject','split','Missing\x20socket_timestamp\x20parameter!','error','contact','index','isNil','errors','length','map','message','hasOwnProperty','data','firstName','firstName\x20not\x20specified!','phone','phone\x20not\x20specified!','birthDate','isValid','birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!','email','email\x20format\x20is\x20not\x20valid!','ListId','CompanyId','find','duplicate'];(function(_0x3e2447,_0xf1ecce){var _0x444a27=function(_0x26a658){while(--_0x26a658){_0x3e2447['push'](_0x3e2447['shift']());}};_0x444a27(++_0xf1ecce);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5b78e8,_0x55096b){_0x5b78e8=_0x5b78e8-0x0;var _0xf2c321=_0xa9e0[_0x5b78e8];return _0xf2c321;};'use strict';var BPromise=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var _=require(_0x0a9e('0x2'));var fs=require('fs');var squel=require('squel');var Papa=require('papaparse');var Redis=require(_0x0a9e('0x3'));var db=require('../../../mysqldb')['db'];var config=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));config[_0x0a9e('0x7')]=_[_0x0a9e('0x8')](config['redis'],{'host':_0x0a9e('0x9'),'port':0x18eb});var socket=require(_0x0a9e('0xa'))(new Redis(config[_0x0a9e('0x7')]));require('../../../api/cmContact/cmContact.socket')['register'](socket);try{if(!process[_0x0a9e('0xb')][0x2]||process['argv'][0x2]==='undefined'||process[_0x0a9e('0xb')][0x2]===_0x0a9e('0xc')){throw new Error(_0x0a9e('0xd'));}var FILEPATH=process[_0x0a9e('0xb')][0x2];if(!process[_0x0a9e('0xb')][0x3]||process[_0x0a9e('0xb')][0x3]==='undefined'||process['argv'][0x3]==='null'||!process['argv'][0x4]||process[_0x0a9e('0xb')][0x4]===_0x0a9e('0xe')||process[_0x0a9e('0xb')][0x4]===_0x0a9e('0xc')){throw new Error(_0x0a9e('0xf'));}var FIELDS=_[_0x0a9e('0x10')](process['argv'][0x3][_0x0a9e('0x11')](','),process[_0x0a9e('0xb')][0x4][_0x0a9e('0x11')](','));if(!process[_0x0a9e('0xb')][0x5]||process[_0x0a9e('0xb')][0x5]===_0x0a9e('0xe')||process['argv'][0x5]===_0x0a9e('0xc')){throw new Error('Missing\x20ListId\x20parameter!');}var LISTID=process[_0x0a9e('0xb')][0x5];var COMPANYID=process['argv'][0x6]&&process[_0x0a9e('0xb')][0x6]!==_0x0a9e('0xe')&&process['argv'][0x6]!==_0x0a9e('0xc')?process['argv'][0x6]:null;var DUPLICATES=process[_0x0a9e('0xb')][0x7]&&process[_0x0a9e('0xb')][0x7]!==_0x0a9e('0xe')&&process[_0x0a9e('0xb')][0x7]!==_0x0a9e('0xc')?process[_0x0a9e('0xb')][0x7]:null;if(!process[_0x0a9e('0xb')][0x8]||process[_0x0a9e('0xb')][0x8]===_0x0a9e('0xe')||process[_0x0a9e('0xb')][0x8]===_0x0a9e('0xc')){throw new Error(_0x0a9e('0x12'));}var SOCKET_TIMESTAMP=process['argv'][0x8];}catch(_0x2c3407){logger[_0x0a9e('0x13')](_0x2c3407);endCsv();}var total=0x0;var pTotal=0x0;var success=0x0;var errors=0x0;var duplicates=0x0;var rows=[];var hopperContacts='';var promises=[];var index=0x0;var alreadyInvalid=![];function handleCheckRowError(_0x53682f,_0x20f109,_0x5a09ef,_0x588269){var _0x3a02e1={'message':_0x20f109};_0x3a02e1[_0x53682f]=!![];if(_0x5a09ef){_0x3a02e1[_0x0a9e('0x14')]=_0x5a09ef;}if(_0x588269){_0x3a02e1[_0x0a9e('0x15')]=_0x588269;}return _0x3a02e1;}function isEmail(_0x30bae6){return/^([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x22([^\x0d\x22\x5c\x80-\xff]|\x5c[\x00-\x7f])*\x22)(\x2e([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x22([^\x0d\x22\x5c\x80-\xff]|\x5c[\x00-\x7f])*\x22))*\x40([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x5b([^\x0d\x5b-\x5d\x80-\xff]|\x5c[\x00-\x7f])*\x5d)(\x2e([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x5b([^\x0d\x5b-\x5d\x80-\xff]|\x5c[\x00-\x7f])*\x5d))*$/['test'](_0x30bae6);}function checkRow(_0xfb6e48,_0x2fb0e4,_0x3b45bc){return new BPromise(function(_0x4d00e6,_0x370d86){if(_[_0x0a9e('0x16')](_0xfb6e48)){return _0x370d86(handleCheckRowError(_0x0a9e('0x13'),'The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!',null,_0x3b45bc));}if(_0xfb6e48['errors']&&_0xfb6e48[_0x0a9e('0x17')][_0x0a9e('0x18')]){var _0x40c424=_[_0x0a9e('0x19')](_0xfb6e48['errors'],_0x0a9e('0x1a'))['join'](';');return _0x370d86(handleCheckRowError(_0x0a9e('0x13'),_0x40c424,null,_0x3b45bc));}var _0x5bfb33={};for(var _0x1dc186 in FIELDS){if(FIELDS[_0x0a9e('0x1b')](_0x1dc186)&&FIELDS[_0x1dc186]){_0x5bfb33[_0x1dc186]=_0xfb6e48[_0x0a9e('0x1c')][0x0][FIELDS[_0x1dc186]]||_0xfb6e48[_0x0a9e('0x1c')][0x0]['\ufeff'+FIELDS[_0x1dc186]];}}if(!_0x5bfb33[_0x0a9e('0x1d')]){return _0x370d86(handleCheckRowError(_0x0a9e('0x13'),_0x0a9e('0x1e'),null,_0x3b45bc));}if(!_0x5bfb33[_0x0a9e('0x1f')]){return _0x370d86(handleCheckRowError('error',_0x0a9e('0x20'),null,_0x3b45bc));}if(_0x5bfb33[_0x0a9e('0x21')]){var _0x2b1f27=moment(_0x5bfb33[_0x0a9e('0x21')],'YYYY-MM-DD');if(!_0x2b1f27[_0x0a9e('0x22')]()){return _0x370d86(handleCheckRowError(_0x0a9e('0x13'),_0x0a9e('0x23'),null,_0x3b45bc));}}if(_0x5bfb33[_0x0a9e('0x24')]){if(!isEmail(_0x5bfb33[_0x0a9e('0x24')])){return _0x370d86(handleCheckRowError(_0x0a9e('0x13'),_0x0a9e('0x25'),null,_0x3b45bc));}}_0x5bfb33[_0x0a9e('0x26')]=LISTID;_0x5bfb33[_0x0a9e('0x27')]=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES['length']&&_0x2fb0e4){var _0x426950={};for(var _0x5d1e0e=0x0,_0x2407f9=DUPLICATES[_0x0a9e('0x18')];_0x5d1e0e<_0x2407f9;_0x5d1e0e+=0x1){_0x426950[DUPLICATES[_0x5d1e0e]]=_0x5bfb33[DUPLICATES[_0x5d1e0e]];}var _0x1122db=_[_0x0a9e('0x28')](_0x2fb0e4,_0x426950);if(_0x1122db){return _0x370d86(handleCheckRowError(_0x0a9e('0x29'),'Duplicate\x20Contact',_0x1122db,_0x3b45bc));}}return db[_0x0a9e('0x2a')][_0x0a9e('0x2b')](_0x5bfb33,{'raw':!![],'hooks':![],'fields':_[_0x0a9e('0x2c')](_0x5bfb33)})[_0x0a9e('0x2d')](function(_0x2b45ea){if(DUPLICATES&&DUPLICATES[_0x0a9e('0x18')]&&_0x2fb0e4){_0x2fb0e4[_0x0a9e('0x2e')](_[_0x0a9e('0x2f')](_0x5bfb33,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x2b45ea['id'];return _0x4d00e6();})['catch'](function(_0x44295a){return _0x370d86(handleCheckRowError('error',_0x0a9e('0x30')+(_0x44295a[_0x0a9e('0x1a')]||JSON[_0x0a9e('0x31')](_0x44295a)),null,_0x3b45bc));});});}function checkHopper(){function _0x3f3d41(){return function(_0x567193){logger[_0x0a9e('0x13')](_0x0a9e('0x32'),_0x0a9e('0x33'),util[_0x0a9e('0x34')](_0x567193,{'showHidden':![],'depth':null}));};}var _0x4853b1=function(_0x54135e,_0x1e8694){var _0x5640eb=squel[_0x0a9e('0x35')]()[_0x0a9e('0x36')](_0x0a9e('0x37'))[_0x0a9e('0x38')](['phone',_0x0a9e('0x39'),_0x0a9e('0x3a'),_0x0a9e('0x26'),_0x1e8694,'createdAt',_0x0a9e('0x3b')],squel[_0x0a9e('0x3c')]()[_0x0a9e('0x3d')]('phone','phone')[_0x0a9e('0x3d')](_0x0a9e('0x3e'),'scheduledAt')[_0x0a9e('0x3d')]('id',_0x0a9e('0x3a'))[_0x0a9e('0x3d')](LISTID[_0x0a9e('0x3f')](),'ListId')['field'](_0x54135e['id'][_0x0a9e('0x3f')](),_0x1e8694)[_0x0a9e('0x3d')]('NOW()',_0x0a9e('0x40'))[_0x0a9e('0x3d')](_0x0a9e('0x3e'),'updatedAt')[_0x0a9e('0x41')](_0x0a9e('0x42'))[_0x0a9e('0x43')](_0x0a9e('0x44'))[_0x0a9e('0x43')](_0x0a9e('0x45'),LISTID[_0x0a9e('0x3f')]())[_0x0a9e('0x43')](_0x0a9e('0x46'))[_0x0a9e('0x43')](_0x0a9e('0x47'),squel[_0x0a9e('0x3c')]()[_0x0a9e('0x3d')](_0x0a9e('0x1f'))[_0x0a9e('0x41')]('cm_hopper')['where'](_0x1e8694+_0x0a9e('0x48'),_0x54135e['id'][_0x0a9e('0x3f')]())))[_0x0a9e('0x3f')]();return _0x5640eb;};var _0x315881=function(_0x1a69dd,_0xc9a702){var _0x10b040=squel[_0x0a9e('0x35')]()[_0x0a9e('0x36')](_0x0a9e('0x37'))[_0x0a9e('0x38')]([_0x0a9e('0x1f'),'scheduledAt',_0x0a9e('0x3a'),_0x0a9e('0x26'),_0xc9a702,_0x0a9e('0x40'),_0x0a9e('0x3b')],squel[_0x0a9e('0x3c')]()[_0x0a9e('0x3d')](_0x0a9e('0x1f'),_0x0a9e('0x1f'))['field'](_0x0a9e('0x3e'),'scheduledAt')[_0x0a9e('0x3d')]('id',_0x0a9e('0x3a'))[_0x0a9e('0x3d')](LISTID['toString'](),_0x0a9e('0x26'))[_0x0a9e('0x3d')](_0x1a69dd['id'][_0x0a9e('0x3f')](),_0xc9a702)[_0x0a9e('0x3d')](_0x0a9e('0x3e'),_0x0a9e('0x40'))[_0x0a9e('0x3d')]('NOW()',_0x0a9e('0x3b'))[_0x0a9e('0x41')](_0x0a9e('0x42'))[_0x0a9e('0x43')](_0x0a9e('0x44'))[_0x0a9e('0x43')](_0x0a9e('0x45'),LISTID[_0x0a9e('0x3f')]())[_0x0a9e('0x43')]('id\x20IN\x20?',squel[_0x0a9e('0x49')](hopperContacts))[_0x0a9e('0x43')]('phone\x20IS\x20NOT\x20NULL')['where']('phone\x20NOT\x20IN\x20(?)',squel[_0x0a9e('0x3c')]()[_0x0a9e('0x3d')](_0x0a9e('0x4a'))[_0x0a9e('0x41')](_0x0a9e('0x4b'))[_0x0a9e('0x43')](_0xc9a702+_0x0a9e('0x48'),_0x1a69dd['id'][_0x0a9e('0x3f')]()))['where']('phone\x20NOT\x20IN\x20(?)',squel['select']()[_0x0a9e('0x3d')](_0x0a9e('0x1f'))[_0x0a9e('0x41')]('cm_hopper')[_0x0a9e('0x43')](_0xc9a702+_0x0a9e('0x48'),_0x1a69dd['id']['toString']())))['toString']();return _0x10b040;};function _0x2ef381(_0x59c6ff,_0x443e72){var _0x4c3845=squel[_0x0a9e('0x35')]()[_0x0a9e('0x36')](_0x0a9e('0x37'))['fromQuery']([_0x0a9e('0x1f'),_0x0a9e('0x39'),'ContactId','ListId',_0x443e72,_0x0a9e('0x40'),_0x0a9e('0x3b')],squel['select']()[_0x0a9e('0x3d')]('phone',_0x0a9e('0x1f'))['field'](_0x0a9e('0x3e'),'scheduledAt')['field']('id','ContactId')[_0x0a9e('0x3d')](LISTID['toString'](),_0x0a9e('0x26'))[_0x0a9e('0x3d')](_0x59c6ff['id'][_0x0a9e('0x3f')](),_0x443e72)[_0x0a9e('0x3d')](_0x0a9e('0x3e'),_0x0a9e('0x40'))[_0x0a9e('0x3d')](_0x0a9e('0x3e'),'updatedAt')[_0x0a9e('0x41')](_0x0a9e('0x42'))[_0x0a9e('0x43')](_0x0a9e('0x44'))[_0x0a9e('0x43')](_0x0a9e('0x45'),LISTID['toString']())[_0x0a9e('0x43')](_0x0a9e('0x4c'),squel['str'](hopperContacts))[_0x0a9e('0x43')]('phone\x20IS\x20NOT\x20NULL'))[_0x0a9e('0x3f')]();return _0x4c3845;}function _0x5ba1f9(_0x4b3c1a,_0x5674ee){var _0x273cb5=squel['insert']()[_0x0a9e('0x36')](_0x0a9e('0x4d'))[_0x0a9e('0x38')]([_0x0a9e('0x1f'),_0x0a9e('0x3a'),_0x0a9e('0x26'),_0x5674ee,'createdAt',_0x0a9e('0x3b')],squel['select']()[_0x0a9e('0x3d')](_0x0a9e('0x1f'),_0x0a9e('0x1f'))['field']('id',_0x0a9e('0x3a'))[_0x0a9e('0x3d')](LISTID[_0x0a9e('0x3f')](),_0x0a9e('0x26'))['field'](_0x4b3c1a['id'][_0x0a9e('0x3f')](),_0x5674ee)[_0x0a9e('0x3d')]('NOW()',_0x0a9e('0x40'))[_0x0a9e('0x3d')](_0x0a9e('0x3e'),_0x0a9e('0x3b'))[_0x0a9e('0x41')]('cm_contacts')[_0x0a9e('0x43')](_0x0a9e('0x44'))[_0x0a9e('0x43')]('ListId\x20=\x20?',LISTID[_0x0a9e('0x3f')]())['where']('id\x20IN\x20?',squel[_0x0a9e('0x49')](hopperContacts))[_0x0a9e('0x43')](_0x0a9e('0x46')))[_0x0a9e('0x3f')]();return _0x273cb5;}return db[_0x0a9e('0x4e')][_0x0a9e('0x4f')]({'where':{'type':_0x0a9e('0x50')},'attributes':['id',_0x0a9e('0x51')],'include':[{'model':db[_0x0a9e('0x52')],'as':_0x0a9e('0x53'),'where':{'id':LISTID}}]})[_0x0a9e('0x2d')](function(_0x19012b){var _0x2bbb86=[];if(_0x19012b){var _0x2b8192;for(var _0x320898=0x0,_0x412a72;_0x320898<_0x19012b[_0x0a9e('0x18')];_0x320898+=0x1){_0x412a72=_0x19012b[_0x320898][_0x0a9e('0x54')]({'plain':!![]});switch(_0x412a72['dialCheckDuplicateType']){case _0x0a9e('0x55'):_0x2bbb86[_0x0a9e('0x2e')](db[_0x0a9e('0x56')]['query'](_0x315881(_0x412a72,_0x0a9e('0x57')))[_0x0a9e('0x2d')](function(){})['catch'](_0x3f3d41()));break;case _0x0a9e('0x58'):_0x2bbb86[_0x0a9e('0x2e')](db[_0x0a9e('0x56')][_0x0a9e('0x59')](_0x4853b1(_0x412a72,_0x0a9e('0x57')))['then'](function(){})['catch'](_0x3f3d41()));break;default:_0x2bbb86['push'](db[_0x0a9e('0x56')][_0x0a9e('0x59')](_0x2ef381(_0x412a72,_0x0a9e('0x57')))[_0x0a9e('0x2d')](function(){})[_0x0a9e('0x5a')](_0x3f3d41()));}}}return _0x2bbb86;})[_0x0a9e('0x5b')]()[_0x0a9e('0x2d')](function(){return db[_0x0a9e('0x4e')]['findAll']({'where':{'type':_0x0a9e('0x50')},'attributes':['id'],'include':[{'model':db[_0x0a9e('0x52')],'as':_0x0a9e('0x5c'),'where':{'id':LISTID}}]})['then'](function(_0x2bdc44){var _0x583b2e=[];if(_0x2bdc44){var _0x4437ff;for(var _0x44351d=0x0,_0x4c46c1;_0x44351d<_0x2bdc44[_0x0a9e('0x18')];_0x44351d+=0x1){_0x4c46c1=_0x2bdc44[_0x44351d][_0x0a9e('0x54')]({'plain':!![]});_0x583b2e[_0x0a9e('0x2e')](db[_0x0a9e('0x56')]['query'](_0x5ba1f9(_0x4c46c1,_0x0a9e('0x57')))[_0x0a9e('0x2d')](function(){})[_0x0a9e('0x5a')](_0x3f3d41()));}}return _0x583b2e;})[_0x0a9e('0x5b')]();})['then'](function(){return db[_0x0a9e('0x5d')][_0x0a9e('0x4f')]({'attributes':['id',_0x0a9e('0x51')],'include':[{'model':db[_0x0a9e('0x52')],'as':'Lists','where':{'id':LISTID}}]})[_0x0a9e('0x2d')](function(_0x3511c9){var _0x30a4c7=[];if(_0x3511c9){for(var _0xf410e5=0x0,_0x332367;_0xf410e5<_0x3511c9[_0x0a9e('0x18')];_0xf410e5+=0x1){_0x332367=_0x3511c9[_0xf410e5][_0x0a9e('0x54')]({'plain':!![]});switch(_0x332367[_0x0a9e('0x51')]){case _0x0a9e('0x55'):_0x30a4c7[_0x0a9e('0x2e')](db[_0x0a9e('0x56')][_0x0a9e('0x59')](_0x315881(_0x332367,_0x0a9e('0x5e')))[_0x0a9e('0x2d')](function(){})['catch'](_0x3f3d41()));break;case _0x0a9e('0x58'):_0x30a4c7[_0x0a9e('0x2e')](db[_0x0a9e('0x56')]['query'](_0x4853b1(_0x332367,_0x0a9e('0x5e')))[_0x0a9e('0x2d')](function(){})[_0x0a9e('0x5a')](_0x3f3d41()));break;default:_0x30a4c7[_0x0a9e('0x2e')](db['sequelize']['query'](_0x2ef381(_0x332367,_0x0a9e('0x5e')))[_0x0a9e('0x2d')](function(){})['catch'](_0x3f3d41()));}}}return _0x30a4c7;})[_0x0a9e('0x5b')]();})['then'](function(){return db[_0x0a9e('0x5d')][_0x0a9e('0x4f')]({'attributes':['id'],'include':[{'model':db['CmList'],'as':_0x0a9e('0x5c'),'where':{'id':LISTID}}]})[_0x0a9e('0x2d')](function(_0x2d2286){var _0x42b959=[];if(_0x2d2286){for(var _0x3755fe=0x0,_0x1f42a0;_0x3755fe<_0x2d2286[_0x0a9e('0x18')];_0x3755fe+=0x1){_0x1f42a0=_0x2d2286[_0x3755fe]['get']({'plain':!![]});_0x42b959[_0x0a9e('0x2e')](db[_0x0a9e('0x56')][_0x0a9e('0x59')](_0x5ba1f9(_0x1f42a0,_0x0a9e('0x5e')))['then'](function(){})[_0x0a9e('0x5a')](_0x3f3d41()));}}return _0x42b959;})[_0x0a9e('0x5b')]();})['catch'](function(_0x1d6834){logger['error'](_0x0a9e('0x5f'),_0x0a9e('0x60'),_0x1d6834[_0x0a9e('0x1a')]);});}var processPromises=function(_0x385d52){return BPromise['all'](promises)['then'](function(_0x353384){})[_0x0a9e('0x5a')](function(_0x94dcf5){logger['error'](_0x0a9e('0x61'),JSON[_0x0a9e('0x31')](_0x94dcf5));})['finally'](function(){socket['emit'](_0x0a9e('0x62')+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x385d52){return _0x385d52['resume']();}});};var endCsv=function(){return BPromise['resolve']()['then'](function(){if(hopperContacts){return checkHopper();}})[_0x0a9e('0x2d')](function(){socket[_0x0a9e('0x63')](_0x0a9e('0x62')+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs[_0x0a9e('0x64')](FILEPATH);}catch(_0x3c6dd6){logger[_0x0a9e('0x13')]('Unable\x20to\x20delete\x20temp\x20file:',JSON[_0x0a9e('0x31')](_0x3c6dd6));}finally{process['exit'](0x0);}});};process['on'](_0x0a9e('0x65'),function(){logger[_0x0a9e('0x66')](_0x0a9e('0x67'));endCsv();});function main(){return BPromise[_0x0a9e('0x68')]()['then'](function(){if(DUPLICATES){DUPLICATES=DUPLICATES[_0x0a9e('0x11')](',');return db[_0x0a9e('0x2a')][_0x0a9e('0x4f')]({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})['then'](function(_0xb6e411){var _0x21e592=fs[_0x0a9e('0x69')](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa[_0x0a9e('0x6a')](_0x21e592,{'header':!![],'skipEmptyLines':!![],'step':function(_0x255e49,_0x1910bf){total+=0x1;var _0x32b9bd=total;promises[_0x0a9e('0x2e')](checkRow(_0x255e49,_0xb6e411,_0x32b9bd)['then'](function(){success+=0x1;})[_0x0a9e('0x5a')](function(_0x3325c5){if(_0x3325c5['error']){errors+=0x1;delete _0x3325c5[_0x0a9e('0x13')];}else if(_0x3325c5[_0x0a9e('0x29')]){duplicates+=0x1;delete _0x3325c5[_0x0a9e('0x29')];}rows['push'](_0x3325c5);}));if(total%0xc8===0x0){_0x1910bf[_0x0a9e('0x6b')]();return processPromises(_0x1910bf);}},'complete':function(){return processPromises()['then'](function(){logger[_0x0a9e('0x66')](_0x0a9e('0x6c'));endCsv();});},'error':function(_0x558a87,_0x1f29bd){logger[_0x0a9e('0x66')](_0x0a9e('0x6d'),JSON[_0x0a9e('0x31')](_0x558a87));endCsv();}});})[_0x0a9e('0x5a')](function(_0x501050){logger[_0x0a9e('0x13')](_0x0a9e('0x6e'),JSON[_0x0a9e('0x31')](_0x501050));});}main();
\ No newline at end of file
+var _0xe706=['toString','ListId','from','cm_contacts','deletedAt\x20IS\x20NULL','where','ListId\x20=\x20?','insert','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','calleridnum','cm_hopper_final','\x20=\x20?','cm_hopper_black','VoiceQueue','findAll','outbound','CmList','Lists','get','dialCheckDuplicateType','always','push','sequelize','VoiceQueueId','catch','onlyIfOpen','query','all','Campaign','CampaignId','BlackLists','cmContact,\x20%s,\x20%s','generalCheckHopper','Error\x20processing\x20rows\x20block:','finally','contact:csv_','resume','resolve','emit','Unable\x20to\x20delete\x20temp\x20file:','info','CSV\x20import\x20process\x20stopped!','split','parse','pause','CSV\x20parsed\x20correctly!','Error\x20executing\x20contact\x20csv\x20import:','bluebird','util','lodash','papaparse','ioredis','../../../mysqldb','../../../config/environment','../../../config/logger','api','redis','defaults','localhost','socket.io-emitter','../../../api/cmContact/cmContact.socket','register','argv','undefined','null','Missing\x20filepath\x20parameter!','Missing\x20binding\x20parameters!','zipObject','Missing\x20socket_timestamp\x20parameter!','error','contact','index','isNil','The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!','errors','length','map','join','hasOwnProperty','data','firstName','firstName\x20not\x20specified!','phone','phone\x20not\x20specified!','birthDate','isValid','birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!','email','email\x20format\x20is\x20not\x20valid!','CompanyId','find','duplicate','Duplicate\x20Contact','CmContact','create','keys','then','pick','Error\x20while\x20creating\x20contact:\x20','message','stringify','cmContact','checkHopper','inspect','into','cm_hopper','fromQuery','scheduledAt','ContactId','createdAt','updatedAt','select','field','NOW()'];(function(_0x576ef1,_0x3ea235){var _0x30f812=function(_0xb990ca){while(--_0xb990ca){_0x576ef1['push'](_0x576ef1['shift']());}};_0x30f812(++_0x3ea235);}(_0xe706,0xa3));var _0x6e70=function(_0x3cfb0d,_0x4df584){_0x3cfb0d=_0x3cfb0d-0x0;var _0x3486b4=_0xe706[_0x3cfb0d];return _0x3486b4;};'use strict';var BPromise=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var _=require(_0x6e70('0x2'));var fs=require('fs');var squel=require('squel');var Papa=require(_0x6e70('0x3'));var Redis=require(_0x6e70('0x4'));var db=require(_0x6e70('0x5'))['db'];var config=require(_0x6e70('0x6'));var logger=require(_0x6e70('0x7'))(_0x6e70('0x8'));config[_0x6e70('0x9')]=_[_0x6e70('0xa')](config[_0x6e70('0x9')],{'host':_0x6e70('0xb'),'port':0x18eb});var socket=require(_0x6e70('0xc'))(new Redis(config[_0x6e70('0x9')]));require(_0x6e70('0xd'))[_0x6e70('0xe')](socket);try{if(!process[_0x6e70('0xf')][0x2]||process[_0x6e70('0xf')][0x2]===_0x6e70('0x10')||process[_0x6e70('0xf')][0x2]===_0x6e70('0x11')){throw new Error(_0x6e70('0x12'));}var FILEPATH=process[_0x6e70('0xf')][0x2];if(!process[_0x6e70('0xf')][0x3]||process[_0x6e70('0xf')][0x3]===_0x6e70('0x10')||process['argv'][0x3]==='null'||!process[_0x6e70('0xf')][0x4]||process[_0x6e70('0xf')][0x4]===_0x6e70('0x10')||process[_0x6e70('0xf')][0x4]===_0x6e70('0x11')){throw new Error(_0x6e70('0x13'));}var FIELDS=_[_0x6e70('0x14')](process[_0x6e70('0xf')][0x3]['split'](','),process['argv'][0x4]['split'](','));if(!process[_0x6e70('0xf')][0x5]||process['argv'][0x5]==='undefined'||process[_0x6e70('0xf')][0x5]===_0x6e70('0x11')){throw new Error('Missing\x20ListId\x20parameter!');}var LISTID=process[_0x6e70('0xf')][0x5];var COMPANYID=process['argv'][0x6]&&process[_0x6e70('0xf')][0x6]!==_0x6e70('0x10')&&process['argv'][0x6]!=='null'?process[_0x6e70('0xf')][0x6]:null;var DUPLICATES=process['argv'][0x7]&&process[_0x6e70('0xf')][0x7]!==_0x6e70('0x10')&&process['argv'][0x7]!=='null'?process[_0x6e70('0xf')][0x7]:null;if(!process[_0x6e70('0xf')][0x8]||process[_0x6e70('0xf')][0x8]===_0x6e70('0x10')||process[_0x6e70('0xf')][0x8]===_0x6e70('0x11')){throw new Error(_0x6e70('0x15'));}var SOCKET_TIMESTAMP=process[_0x6e70('0xf')][0x8];}catch(_0x29326f){logger[_0x6e70('0x16')](_0x29326f);endCsv();}var total=0x0;var pTotal=0x0;var success=0x0;var errors=0x0;var duplicates=0x0;var rows=[];var hopperContacts='';var promises=[];var index=0x0;var alreadyInvalid=![];function handleCheckRowError(_0x4a0cfe,_0x228350,_0x344b65,_0x27b294){var _0x502b2d={'message':_0x228350};_0x502b2d[_0x4a0cfe]=!![];if(_0x344b65){_0x502b2d[_0x6e70('0x17')]=_0x344b65;}if(_0x27b294){_0x502b2d[_0x6e70('0x18')]=_0x27b294;}return _0x502b2d;}function isEmail(_0x3337a6){return/^([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x22([^\x0d\x22\x5c\x80-\xff]|\x5c[\x00-\x7f])*\x22)(\x2e([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x22([^\x0d\x22\x5c\x80-\xff]|\x5c[\x00-\x7f])*\x22))*\x40([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x5b([^\x0d\x5b-\x5d\x80-\xff]|\x5c[\x00-\x7f])*\x5d)(\x2e([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x5b([^\x0d\x5b-\x5d\x80-\xff]|\x5c[\x00-\x7f])*\x5d))*$/['test'](_0x3337a6);}function checkRow(_0x10fc91,_0x538b9c,_0x50aec2){return new BPromise(function(_0x4e97c7,_0x41e352){if(_[_0x6e70('0x19')](_0x10fc91)){return _0x41e352(handleCheckRowError('error',_0x6e70('0x1a'),null,_0x50aec2));}if(_0x10fc91[_0x6e70('0x1b')]&&_0x10fc91['errors'][_0x6e70('0x1c')]){var _0x67fb43=_[_0x6e70('0x1d')](_0x10fc91['errors'],'message')[_0x6e70('0x1e')](';');return _0x41e352(handleCheckRowError(_0x6e70('0x16'),_0x67fb43,null,_0x50aec2));}var _0x83c836={};for(var _0x114344 in FIELDS){if(FIELDS[_0x6e70('0x1f')](_0x114344)&&FIELDS[_0x114344]){_0x83c836[_0x114344]=_0x10fc91['data'][0x0][FIELDS[_0x114344]]||_0x10fc91[_0x6e70('0x20')][0x0]['\ufeff'+FIELDS[_0x114344]];}}if(!_0x83c836[_0x6e70('0x21')]){return _0x41e352(handleCheckRowError(_0x6e70('0x16'),_0x6e70('0x22'),null,_0x50aec2));}if(!_0x83c836[_0x6e70('0x23')]){return _0x41e352(handleCheckRowError(_0x6e70('0x16'),_0x6e70('0x24'),null,_0x50aec2));}if(_0x83c836[_0x6e70('0x25')]){var _0x3a0821=moment(_0x83c836[_0x6e70('0x25')],'YYYY-MM-DD');if(!_0x3a0821[_0x6e70('0x26')]()){return _0x41e352(handleCheckRowError('error',_0x6e70('0x27'),null,_0x50aec2));}}if(_0x83c836['email']){if(!isEmail(_0x83c836[_0x6e70('0x28')])){return _0x41e352(handleCheckRowError(_0x6e70('0x16'),_0x6e70('0x29'),null,_0x50aec2));}}_0x83c836['ListId']=LISTID;_0x83c836[_0x6e70('0x2a')]=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES[_0x6e70('0x1c')]&&_0x538b9c){var _0x5780a1={};for(var _0x13d673=0x0,_0x154925=DUPLICATES['length'];_0x13d673<_0x154925;_0x13d673+=0x1){_0x5780a1[DUPLICATES[_0x13d673]]=_0x83c836[DUPLICATES[_0x13d673]];}var _0x10d8f6=_[_0x6e70('0x2b')](_0x538b9c,_0x5780a1);if(_0x10d8f6){return _0x41e352(handleCheckRowError(_0x6e70('0x2c'),_0x6e70('0x2d'),_0x10d8f6,_0x50aec2));}}return db[_0x6e70('0x2e')][_0x6e70('0x2f')](_0x83c836,{'raw':!![],'hooks':![],'fields':_[_0x6e70('0x30')](_0x83c836)})[_0x6e70('0x31')](function(_0xf146fd){if(DUPLICATES&&DUPLICATES[_0x6e70('0x1c')]&&_0x538b9c){_0x538b9c['push'](_[_0x6e70('0x32')](_0x83c836,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0xf146fd['id'];return _0x4e97c7();})['catch'](function(_0x23cd1a){return _0x41e352(handleCheckRowError(_0x6e70('0x16'),_0x6e70('0x33')+(_0x23cd1a[_0x6e70('0x34')]||JSON[_0x6e70('0x35')](_0x23cd1a)),null,_0x50aec2));});});}function checkHopper(){function _0x989b80(){return function(_0x2440be){logger[_0x6e70('0x16')](_0x6e70('0x36'),_0x6e70('0x37'),util[_0x6e70('0x38')](_0x2440be,{'showHidden':![],'depth':null}));};}var _0x23d5e2=function(_0x5594d3,_0x501b53){var _0x5446a2=squel['insert']()[_0x6e70('0x39')](_0x6e70('0x3a'))[_0x6e70('0x3b')]([_0x6e70('0x23'),_0x6e70('0x3c'),_0x6e70('0x3d'),'ListId',_0x501b53,_0x6e70('0x3e'),_0x6e70('0x3f')],squel[_0x6e70('0x40')]()[_0x6e70('0x41')](_0x6e70('0x23'),_0x6e70('0x23'))[_0x6e70('0x41')](_0x6e70('0x42'),'scheduledAt')[_0x6e70('0x41')]('id',_0x6e70('0x3d'))[_0x6e70('0x41')](LISTID[_0x6e70('0x43')](),_0x6e70('0x44'))[_0x6e70('0x41')](_0x5594d3['id'][_0x6e70('0x43')](),_0x501b53)['field']('NOW()','createdAt')[_0x6e70('0x41')](_0x6e70('0x42'),_0x6e70('0x3f'))[_0x6e70('0x45')](_0x6e70('0x46'))['where'](_0x6e70('0x47'))[_0x6e70('0x48')](_0x6e70('0x49'),LISTID['toString']())['where']('phone\x20IS\x20NOT\x20NULL')[_0x6e70('0x48')]('phone\x20NOT\x20IN\x20(?)',squel[_0x6e70('0x40')]()[_0x6e70('0x41')](_0x6e70('0x23'))[_0x6e70('0x45')]('cm_hopper')[_0x6e70('0x48')](_0x501b53+'\x20=\x20?',_0x5594d3['id'][_0x6e70('0x43')]())))[_0x6e70('0x43')]();return _0x5446a2;};var _0x2dafb5=function(_0x3478e2,_0x5bbc3a){var _0x291de6=squel[_0x6e70('0x4a')]()[_0x6e70('0x39')](_0x6e70('0x3a'))[_0x6e70('0x3b')]([_0x6e70('0x23'),_0x6e70('0x3c'),'ContactId',_0x6e70('0x44'),_0x5bbc3a,_0x6e70('0x3e'),_0x6e70('0x3f')],squel[_0x6e70('0x40')]()[_0x6e70('0x41')](_0x6e70('0x23'),_0x6e70('0x23'))['field'](_0x6e70('0x42'),'scheduledAt')[_0x6e70('0x41')]('id',_0x6e70('0x3d'))['field'](LISTID['toString'](),_0x6e70('0x44'))[_0x6e70('0x41')](_0x3478e2['id'][_0x6e70('0x43')](),_0x5bbc3a)['field']('NOW()',_0x6e70('0x3e'))[_0x6e70('0x41')](_0x6e70('0x42'),_0x6e70('0x3f'))[_0x6e70('0x45')](_0x6e70('0x46'))['where'](_0x6e70('0x47'))[_0x6e70('0x48')](_0x6e70('0x49'),LISTID[_0x6e70('0x43')]())[_0x6e70('0x48')]('id\x20IN\x20?',squel['str'](hopperContacts))[_0x6e70('0x48')](_0x6e70('0x4b'))[_0x6e70('0x48')](_0x6e70('0x4c'),squel[_0x6e70('0x40')]()['field'](_0x6e70('0x4d'))[_0x6e70('0x45')](_0x6e70('0x4e'))[_0x6e70('0x48')](_0x5bbc3a+_0x6e70('0x4f'),_0x3478e2['id']['toString']()))[_0x6e70('0x48')](_0x6e70('0x4c'),squel[_0x6e70('0x40')]()[_0x6e70('0x41')](_0x6e70('0x23'))[_0x6e70('0x45')]('cm_hopper')[_0x6e70('0x48')](_0x5bbc3a+_0x6e70('0x4f'),_0x3478e2['id']['toString']())))[_0x6e70('0x43')]();return _0x291de6;};function _0xebe5f7(_0x54efdf,_0x3cfaa9){var _0xb3f06c=squel[_0x6e70('0x4a')]()[_0x6e70('0x39')](_0x6e70('0x3a'))['fromQuery']([_0x6e70('0x23'),_0x6e70('0x3c'),_0x6e70('0x3d'),_0x6e70('0x44'),_0x3cfaa9,_0x6e70('0x3e'),_0x6e70('0x3f')],squel[_0x6e70('0x40')]()[_0x6e70('0x41')](_0x6e70('0x23'),_0x6e70('0x23'))[_0x6e70('0x41')](_0x6e70('0x42'),_0x6e70('0x3c'))[_0x6e70('0x41')]('id',_0x6e70('0x3d'))[_0x6e70('0x41')](LISTID[_0x6e70('0x43')](),_0x6e70('0x44'))[_0x6e70('0x41')](_0x54efdf['id'][_0x6e70('0x43')](),_0x3cfaa9)['field'](_0x6e70('0x42'),_0x6e70('0x3e'))[_0x6e70('0x41')](_0x6e70('0x42'),_0x6e70('0x3f'))[_0x6e70('0x45')]('cm_contacts')[_0x6e70('0x48')](_0x6e70('0x47'))['where'](_0x6e70('0x49'),LISTID[_0x6e70('0x43')]())[_0x6e70('0x48')]('id\x20IN\x20?',squel['str'](hopperContacts))[_0x6e70('0x48')](_0x6e70('0x4b')))[_0x6e70('0x43')]();return _0xb3f06c;}function _0x41a861(_0x10d299,_0x739946){var _0x30cd88=squel['insert']()['into'](_0x6e70('0x50'))[_0x6e70('0x3b')]([_0x6e70('0x23'),_0x6e70('0x3d'),'ListId',_0x739946,'createdAt',_0x6e70('0x3f')],squel[_0x6e70('0x40')]()['field']('phone',_0x6e70('0x23'))['field']('id',_0x6e70('0x3d'))[_0x6e70('0x41')](LISTID[_0x6e70('0x43')](),_0x6e70('0x44'))[_0x6e70('0x41')](_0x10d299['id'][_0x6e70('0x43')](),_0x739946)[_0x6e70('0x41')](_0x6e70('0x42'),'createdAt')[_0x6e70('0x41')](_0x6e70('0x42'),_0x6e70('0x3f'))[_0x6e70('0x45')](_0x6e70('0x46'))['where']('deletedAt\x20IS\x20NULL')['where'](_0x6e70('0x49'),LISTID[_0x6e70('0x43')]())[_0x6e70('0x48')]('id\x20IN\x20?',squel['str'](hopperContacts))[_0x6e70('0x48')](_0x6e70('0x4b')))[_0x6e70('0x43')]();return _0x30cd88;}return db[_0x6e70('0x51')][_0x6e70('0x52')]({'where':{'type':_0x6e70('0x53')},'attributes':['id','dialCheckDuplicateType'],'include':[{'model':db[_0x6e70('0x54')],'as':_0x6e70('0x55'),'where':{'id':LISTID}}]})[_0x6e70('0x31')](function(_0x82a9a){var _0x515c0c=[];if(_0x82a9a){var _0xce964b;for(var _0x531097=0x0,_0x5b4046;_0x531097<_0x82a9a[_0x6e70('0x1c')];_0x531097+=0x1){_0x5b4046=_0x82a9a[_0x531097][_0x6e70('0x56')]({'plain':!![]});switch(_0x5b4046[_0x6e70('0x57')]){case _0x6e70('0x58'):_0x515c0c[_0x6e70('0x59')](db[_0x6e70('0x5a')]['query'](_0x2dafb5(_0x5b4046,_0x6e70('0x5b')))[_0x6e70('0x31')](function(){})[_0x6e70('0x5c')](_0x989b80()));break;case _0x6e70('0x5d'):_0x515c0c[_0x6e70('0x59')](db[_0x6e70('0x5a')][_0x6e70('0x5e')](_0x23d5e2(_0x5b4046,_0x6e70('0x5b')))[_0x6e70('0x31')](function(){})[_0x6e70('0x5c')](_0x989b80()));break;default:_0x515c0c['push'](db[_0x6e70('0x5a')][_0x6e70('0x5e')](_0xebe5f7(_0x5b4046,_0x6e70('0x5b')))['then'](function(){})['catch'](_0x989b80()));}}}return _0x515c0c;})[_0x6e70('0x5f')]()[_0x6e70('0x31')](function(){return db[_0x6e70('0x51')][_0x6e70('0x52')]({'where':{'type':_0x6e70('0x53')},'attributes':['id'],'include':[{'model':db['CmList'],'as':'BlackLists','where':{'id':LISTID}}]})[_0x6e70('0x31')](function(_0x241a21){var _0x56d4d9=[];if(_0x241a21){var _0x58666a;for(var _0x1c7c5f=0x0,_0xf7a034;_0x1c7c5f<_0x241a21[_0x6e70('0x1c')];_0x1c7c5f+=0x1){_0xf7a034=_0x241a21[_0x1c7c5f][_0x6e70('0x56')]({'plain':!![]});_0x56d4d9[_0x6e70('0x59')](db[_0x6e70('0x5a')][_0x6e70('0x5e')](_0x41a861(_0xf7a034,_0x6e70('0x5b')))[_0x6e70('0x31')](function(){})[_0x6e70('0x5c')](_0x989b80()));}}return _0x56d4d9;})[_0x6e70('0x5f')]();})[_0x6e70('0x31')](function(){return db[_0x6e70('0x60')]['findAll']({'attributes':['id','dialCheckDuplicateType'],'include':[{'model':db[_0x6e70('0x54')],'as':'Lists','where':{'id':LISTID}}]})[_0x6e70('0x31')](function(_0x4b2d40){var _0x5b5471=[];if(_0x4b2d40){for(var _0x402f6f=0x0,_0x48e04b;_0x402f6f<_0x4b2d40['length'];_0x402f6f+=0x1){_0x48e04b=_0x4b2d40[_0x402f6f][_0x6e70('0x56')]({'plain':!![]});switch(_0x48e04b[_0x6e70('0x57')]){case _0x6e70('0x58'):_0x5b5471['push'](db['sequelize']['query'](_0x2dafb5(_0x48e04b,_0x6e70('0x61')))['then'](function(){})[_0x6e70('0x5c')](_0x989b80()));break;case _0x6e70('0x5d'):_0x5b5471[_0x6e70('0x59')](db[_0x6e70('0x5a')][_0x6e70('0x5e')](_0x23d5e2(_0x48e04b,_0x6e70('0x61')))[_0x6e70('0x31')](function(){})['catch'](_0x989b80()));break;default:_0x5b5471[_0x6e70('0x59')](db[_0x6e70('0x5a')][_0x6e70('0x5e')](_0xebe5f7(_0x48e04b,'CampaignId'))[_0x6e70('0x31')](function(){})[_0x6e70('0x5c')](_0x989b80()));}}}return _0x5b5471;})[_0x6e70('0x5f')]();})[_0x6e70('0x31')](function(){return db[_0x6e70('0x60')][_0x6e70('0x52')]({'attributes':['id'],'include':[{'model':db[_0x6e70('0x54')],'as':_0x6e70('0x62'),'where':{'id':LISTID}}]})[_0x6e70('0x31')](function(_0x48f6fd){var _0x463eed=[];if(_0x48f6fd){for(var _0x39e6db=0x0,_0x53acc8;_0x39e6db<_0x48f6fd[_0x6e70('0x1c')];_0x39e6db+=0x1){_0x53acc8=_0x48f6fd[_0x39e6db][_0x6e70('0x56')]({'plain':!![]});_0x463eed['push'](db['sequelize'][_0x6e70('0x5e')](_0x41a861(_0x53acc8,'CampaignId'))[_0x6e70('0x31')](function(){})['catch'](_0x989b80()));}}return _0x463eed;})[_0x6e70('0x5f')]();})[_0x6e70('0x5c')](function(_0x106f32){logger[_0x6e70('0x16')](_0x6e70('0x63'),_0x6e70('0x64'),_0x106f32[_0x6e70('0x34')]);});}var processPromises=function(_0x5afbf5){return BPromise['all'](promises)[_0x6e70('0x31')](function(_0x4bf451){})[_0x6e70('0x5c')](function(_0xa2a4d5){logger[_0x6e70('0x16')](_0x6e70('0x65'),JSON['stringify'](_0xa2a4d5));})[_0x6e70('0x66')](function(){socket['emit'](_0x6e70('0x67')+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x5afbf5){return _0x5afbf5[_0x6e70('0x68')]();}});};var endCsv=function(){return BPromise[_0x6e70('0x69')]()[_0x6e70('0x31')](function(){if(hopperContacts){return checkHopper();}})[_0x6e70('0x31')](function(){socket[_0x6e70('0x6a')](_0x6e70('0x67')+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs['unlinkSync'](FILEPATH);}catch(_0x1d6acf){logger['error'](_0x6e70('0x6b'),JSON['stringify'](_0x1d6acf));}finally{process['exit'](0x0);}});};process['on']('SIGINT',function(){logger[_0x6e70('0x6c')](_0x6e70('0x6d'));endCsv();});function main(){return BPromise[_0x6e70('0x69')]()[_0x6e70('0x31')](function(){if(DUPLICATES){DUPLICATES=DUPLICATES[_0x6e70('0x6e')](',');return db['CmContact'][_0x6e70('0x52')]({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})[_0x6e70('0x31')](function(_0x48c30c){var _0x3c2d33=fs['createReadStream'](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa[_0x6e70('0x6f')](_0x3c2d33,{'header':!![],'skipEmptyLines':!![],'step':function(_0x5d0585,_0x4a87e2){total+=0x1;var _0x25f60c=total;promises[_0x6e70('0x59')](checkRow(_0x5d0585,_0x48c30c,_0x25f60c)[_0x6e70('0x31')](function(){success+=0x1;})[_0x6e70('0x5c')](function(_0x3e6661){if(_0x3e6661[_0x6e70('0x16')]){errors+=0x1;delete _0x3e6661[_0x6e70('0x16')];}else if(_0x3e6661['duplicate']){duplicates+=0x1;delete _0x3e6661[_0x6e70('0x2c')];}rows['push'](_0x3e6661);}));if(total%0xc8===0x0){_0x4a87e2[_0x6e70('0x70')]();return processPromises(_0x4a87e2);}},'complete':function(){return processPromises()[_0x6e70('0x31')](function(){logger[_0x6e70('0x6c')](_0x6e70('0x71'));endCsv();});},'error':function(_0x4764d5,_0x41b7de){logger[_0x6e70('0x6c')]('CSV\x20parse\x20error',JSON[_0x6e70('0x35')](_0x4764d5));endCsv();}});})['catch'](function(_0x27bdf2){logger[_0x6e70('0x16')](_0x6e70('0x72'),JSON[_0x6e70('0x35')](_0x27bdf2));});}main();
\ No newline at end of file
diff --git a/server/components/import/cm/csv2.js b/server/components/import/cm/csv2.js
index 4c5c601..309e5ed 100644
--- a/server/components/import/cm/csv2.js
+++ b/server/components/import/cm/csv2.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7a54=['.CmListId\x20=\x20?','toString','date_add(cm_contacts.scheduledat,interval\x20','cm_contacts.priority','UserId','\x20=\x20?','concat','keys','CompanyId',')\x20NOT\x20IN\x20?','ListId\x20=\x20?','deletedAt\x20IS\x20NULL','MIN(id)','min_id','group','info','Received\x20SIGINT','error','message','exit','errors','push','spread','campaigns.id','campaigns','campaigns_has_cm_lists','campaigns.id\x20=\x20campaigns_has_cm_lists.CampaignId','campaigns_has_cm_lists.CmListId=','sequelize','query','length','all','catch','voice_queues.id','voice_queues.dialTimezone','voice_queues','voice_queues.id\x20=\x20voice_queues_has_cm_lists.VoiceQueueId','voice_queues_has_cm_lists.CmListId=','timezones','dialTimezone','isNil','utcOffset','set','offset','main','stringify','send','start','binding','socket_timestamp','root','server/files/tmp','header',',utcOffset','writeFileSync','parse','createReadStream','data','hasOwnProperty','trim','replace','YYYY-MM-DD\x20HH:mm:ss','isValid','scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)','includes','agent\x20not\x20exists','email','email\x20wrong\x20format','dateOfBirth','dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)','firstName','\x20not\x20specified','SystemRow','appendFileSync','rows','contact:import:','abort','SystemError','step','duplicates','cm_contacts_','\x20LIKE\x20cm_contacts;','campaigns_','CREATE\x20TABLE\x20','(id\x20int,dialTimezone\x20varchar(255),offset\x20int);','each','then','format','VoiceQueueId','voice_queues_has_cm_blacklists','CampaignId','campaigns_has_cm_blacklists','voice_queues_has_cm_lists','DROP\x20TABLE\x20','finish','affectedRows','emit','unlink','argv','arguments\x20\x20\x20','file\x20doesn\x27t\x20exists','binding\x20doesn\x27t\x20exists','firstName\x20is\x20mandatory','ListId\x20is\x20mandatory','body\x20id\x20mandatory','map','SIGINT','path','lodash','papaparse','bluebird','moment','ioredis','../../../mysqldb','../../../config/environment','../../../config/environment/shared','../../../config/logger','redis','localhost','test','select','field','phone','from','join','.id\x20=\x20','where','.dialCheckDuplicateType\x20IN\x20(','cm_contacts.phone','cm_contacts.scheduledat','cm_contacts.id','cm_contacts.ListId','cm_contacts.createdAt','cm_contacts.UserId','cm_hopper','fromQuery','scheduledat','ContactId','ListId','createdAt','updatedAt','priority','recallme','cm_contacts','.CmListId','cm_contacts.createdAt\x20=\x20?','cm_contacts.phone\x20NOT\x20IN\x20(?)','\x22always\x22','\x22onlyIfOpen\x22','cm_contacts.updatedAt','insert','into','cm_hopper_black','fields','cm_contacts.ListId\x20=\x20'];(function(_0x879e31,_0x139d02){var _0x3467e8=function(_0x544fc6){while(--_0x544fc6){_0x879e31['push'](_0x879e31['shift']());}};_0x3467e8(++_0x139d02);}(_0x7a54,0x106));var _0x47a5=function(_0x368c2f,_0x2eb034){_0x368c2f=_0x368c2f-0x0;var _0x390d01=_0x7a54[_0x368c2f];return _0x390d01;};'use strict';var fs=require('fs');var path=require(_0x47a5('0x0'));var _=require(_0x47a5('0x1'));var Papa=require(_0x47a5('0x2'));var util=require('util');var BPromise=require(_0x47a5('0x3'));var moment=require(_0x47a5('0x4'));var squel=require('squel');var Redis=require(_0x47a5('0x5'));var db=require(_0x47a5('0x6'))['db'];var config=require(_0x47a5('0x7'));var shared=require(_0x47a5('0x8'));var logger=require(_0x47a5('0x9'))('import');config[_0x47a5('0xa')]=_['defaults'](config[_0x47a5('0xa')],{'host':_0x47a5('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x47a5('0xa')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var stopped=![];var tmp_voice_queues;var tmp_campaigns;var tzOffset=0x0;var hasTZ;var NOW=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');function isEmail(_0x582352){return/^([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x22([^\x0d\x22\x5c\x80-\xff]|\x5c[\x00-\x7f])*\x22)(\x2e([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x22([^\x0d\x22\x5c\x80-\xff]|\x5c[\x00-\x7f])*\x22))*\x40([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x5b([^\x0d\x5b-\x5d\x80-\xff]|\x5c[\x00-\x7f])*\x5d)(\x2e([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x5b([^\x0d\x5b-\x5d\x80-\xff]|\x5c[\x00-\x7f])*\x5d))*$/[_0x47a5('0xc')](_0x582352);}function selectNotIn(_0x2baee7,_0x5e31dd,_0x2eb0dd,_0x49e844,_0x5de6d7){return squel[_0x47a5('0xd')]()[_0x47a5('0xe')](_0x47a5('0xf'))[_0x47a5('0x10')](_0x49e844)[_0x47a5('0x11')](_0x5e31dd,null,_0x5e31dd+_0x47a5('0x12')+_0x49e844+'.'+_0x2eb0dd)[_0x47a5('0x13')](_0x49e844+'.'+_0x2eb0dd+'\x20=\x20'+_0x2baee7+'.'+_0x2eb0dd)[_0x47a5('0x13')](_0x5e31dd+_0x47a5('0x14')+_0x5de6d7[_0x47a5('0x11')]()+')');}function insertCmHopper(_0x711793,_0x139f25,_0x620ee9,_0x3c6c46,_0x190faa){var _0x4e99a8=[_0x47a5('0x15'),_0x47a5('0x16'),_0x47a5('0x17'),_0x47a5('0x18'),_0x139f25+'.'+_0x3c6c46,_0x47a5('0x19'),'cm_contacts.updatedAt','cm_contacts.priority',_0x47a5('0x1a'),'\x22'+_0x190faa+'\x22'];return squel['insert']()['into'](_0x47a5('0x1b'))[_0x47a5('0x1c')]([_0x47a5('0xf'),_0x47a5('0x1d'),_0x47a5('0x1e'),_0x47a5('0x1f'),_0x3c6c46,_0x47a5('0x20'),_0x47a5('0x21'),_0x47a5('0x22'),'UserId',_0x47a5('0x23')],squel[_0x47a5('0xd')]()['fields'](_0x4e99a8)[_0x47a5('0x10')](_0x139f25)[_0x47a5('0x11')](_0x47a5('0x24'),null,'cm_contacts.ListId\x20=\x20'+_0x139f25+_0x47a5('0x25'))[_0x47a5('0x11')](_0x620ee9,null,_0x620ee9+_0x47a5('0x12')+_0x139f25+'.'+_0x3c6c46)[_0x47a5('0x13')](_0x139f25+'.CmListId\x20=\x20?',_0x711793)[_0x47a5('0x13')](_0x47a5('0x26'),NOW)['where'](_0x47a5('0x27'),selectNotIn(_0x139f25,_0x620ee9,_0x3c6c46,_0x47a5('0x1b'),[_0x47a5('0x28'),_0x47a5('0x29')]))[_0x47a5('0x13')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0x139f25,_0x620ee9,_0x3c6c46,'cm_hopper',[_0x47a5('0x28')])))['toString']();}function insertCmHopperBlack(_0x1ea9c8,_0x5b6c4e,_0x23cb77,_0x378208){var _0x36ad34=[_0x47a5('0x15'),_0x47a5('0x17'),_0x47a5('0x18'),_0x5b6c4e+'.'+_0x378208,_0x47a5('0x19'),_0x47a5('0x2a')];return squel[_0x47a5('0x2b')]()[_0x47a5('0x2c')](_0x47a5('0x2d'))[_0x47a5('0x1c')]([_0x47a5('0xf'),'ContactId',_0x47a5('0x1f'),_0x378208,'createdAt',_0x47a5('0x21')],squel[_0x47a5('0xd')]()[_0x47a5('0x2e')](_0x36ad34)['from'](_0x5b6c4e)[_0x47a5('0x11')](_0x47a5('0x24'),null,_0x47a5('0x2f')+_0x5b6c4e+_0x47a5('0x25'))['join'](_0x23cb77,null,_0x23cb77+'.id\x20=\x20'+_0x5b6c4e+'.'+_0x378208)[_0x47a5('0x13')](_0x5b6c4e+_0x47a5('0x30'),_0x1ea9c8)['where']('cm_contacts.createdAt\x20=\x20?',NOW)[_0x47a5('0x13')](_0x47a5('0x27'),squel['select']()[_0x47a5('0xe')]('phone')[_0x47a5('0x10')](_0x47a5('0x2d'))['where']('ListId\x20=\x20?',_0x1ea9c8)[_0x47a5('0x13')](_0x378208+'\x20=\x20?',_0x5b6c4e+'.'+_0x378208)))[_0x47a5('0x31')]();}function insertTzCmHopper(_0x87e4c9,_0xf269a8,_0x52749b,_0x18f7e9,_0x50c086,_0x53c754){var _0x65542e=['cm_contacts.phone',_0x47a5('0x32')+_0x53c754+'.offset-cm_contacts.utcOffset\x20minute)',_0x47a5('0x17'),_0x47a5('0x18'),_0xf269a8+'.'+_0x18f7e9,_0x47a5('0x19'),_0x47a5('0x2a'),_0x47a5('0x33'),_0x47a5('0x1a'),'\x22'+_0x50c086+'\x22'];var _0xee582c=squel[_0x47a5('0x2b')]()[_0x47a5('0x2c')]('cm_hopper')[_0x47a5('0x1c')]([_0x47a5('0xf'),'scheduledat',_0x47a5('0x1e'),_0x47a5('0x1f'),_0x18f7e9,_0x47a5('0x20'),'updatedAt',_0x47a5('0x22'),_0x47a5('0x34'),'recallme'],squel[_0x47a5('0xd')]()[_0x47a5('0x2e')](_0x65542e)['from'](_0xf269a8)['join']('cm_contacts',null,_0x47a5('0x2f')+_0xf269a8+'.CmListId')[_0x47a5('0x11')](_0x52749b,null,_0x52749b+_0x47a5('0x12')+_0xf269a8+'.'+_0x18f7e9)[_0x47a5('0x11')](_0x53c754,null,_0x53c754+_0x47a5('0x12')+_0xf269a8+'.'+_0x18f7e9)[_0x47a5('0x13')](_0xf269a8+_0x47a5('0x30'),_0x87e4c9)[_0x47a5('0x13')](_0x47a5('0x26'),NOW)[_0x47a5('0x13')](_0x47a5('0x27'),selectNotIn(_0xf269a8,_0x52749b,_0x18f7e9,_0x47a5('0x1b'),[_0x47a5('0x28'),_0x47a5('0x29')]))['where'](_0x47a5('0x27'),selectNotIn(_0xf269a8,_0x52749b,_0x18f7e9,_0x47a5('0x1b'),[_0x47a5('0x28')])))[_0x47a5('0x31')]();return _0xee582c;}function insertTzCmHopperBlack(_0x586f4f,_0x7de536,_0x528ef3,_0x47c7a2){var _0x55c43d=['cm_contacts.phone',_0x47a5('0x17'),'cm_contacts.ListId',_0x7de536+'.'+_0x47c7a2,_0x47a5('0x19'),_0x47a5('0x2a')];return squel[_0x47a5('0x2b')]()['into'](_0x47a5('0x2d'))[_0x47a5('0x1c')](['phone','ContactId',_0x47a5('0x1f'),_0x47c7a2,'createdAt',_0x47a5('0x21')],squel[_0x47a5('0xd')]()[_0x47a5('0x2e')](_0x55c43d)[_0x47a5('0x10')](_0x7de536)[_0x47a5('0x11')](_0x47a5('0x24'),null,_0x47a5('0x2f')+_0x7de536+_0x47a5('0x25'))[_0x47a5('0x11')](_0x528ef3,null,_0x528ef3+_0x47a5('0x12')+_0x7de536+'.'+_0x47c7a2)[_0x47a5('0x13')](_0x7de536+_0x47a5('0x30'),_0x586f4f)[_0x47a5('0x13')](_0x47a5('0x26'),NOW)[_0x47a5('0x13')](_0x47a5('0x27'),squel['select']()[_0x47a5('0xe')](_0x47a5('0xf'))['from']('cm_hopper_black')[_0x47a5('0x13')]('ListId\x20=\x20?',_0x586f4f)[_0x47a5('0x13')](_0x47c7a2+_0x47a5('0x35'),_0x7de536+'.'+_0x47c7a2)))['toString']();}function insertCmContact(_0x4f62d3,_0x3d85cc,_0x52d409,_0x2d147c){var _0x1d1039=_[_0x47a5('0x36')](_[_0x47a5('0x37')](_0x2d147c),[_0x47a5('0x1f'),_0x47a5('0x38'),_0x47a5('0x20'),'updatedAt']);return squel['insert']()[_0x47a5('0x2c')](_0x47a5('0x24'))[_0x47a5('0x1c')](_0x1d1039,squel[_0x47a5('0xd')]()[_0x47a5('0x2e')](_0x1d1039)[_0x47a5('0x10')](_0x3d85cc)[_0x47a5('0x13')]('('+_0x52d409['join'](',')+_0x47a5('0x39'),squel[_0x47a5('0xd')]()[_0x47a5('0x2e')](_0x52d409)['from'](_0x47a5('0x24'))['where'](_0x47a5('0x3a'),_0x4f62d3)[_0x47a5('0x13')](_0x47a5('0x3b')))[_0x47a5('0x13')]('id\x20IN\x20?',squel[_0x47a5('0xd')]()[_0x47a5('0xe')](_0x47a5('0x3c'),_0x47a5('0x3d'))[_0x47a5('0x10')](_0x3d85cc)[_0x47a5('0x3e')](_0x52d409[_0x47a5('0x11')](','))))['toString']();}function handleStop(){logger[_0x47a5('0x3f')](_0x47a5('0x40'));stopped=!![];}function handleUncaughtException(_0x187d7e){logger[_0x47a5('0x41')](_0x187d7e[_0x47a5('0x42')]);process[_0x47a5('0x43')](0x1);}function handleError(_0x572233,_0x1ad6a9){stats[_0x47a5('0x44')][_0x47a5('0x45')]({'name':_0x1ad6a9['code'],'message':_0x1ad6a9[_0x47a5('0x42')],'row':_0x572233});}function handleQuery(_0x3c78b7){logger[_0x47a5('0x3f')](_0x3c78b7);return db['sequelize']['query'](_0x3c78b7)[_0x47a5('0x46')](function(_0x376e1d){results['push'](_0x376e1d);})['catch'](function(_0x6d6b2b){logger['error'](_0x6d6b2b[_0x47a5('0x42')]);});}function updateTzCampaigns(_0x5d383d){return new Promise(function(_0x482de6,_0x389ed9){var _0x46d2d3=squel['select']()[_0x47a5('0x2e')]([_0x47a5('0x47'),'campaigns.dialTimezone'])['from'](_0x47a5('0x48'))[_0x47a5('0x11')](_0x47a5('0x49'),null,_0x47a5('0x4a'))['where'](_0x47a5('0x4b')+_0x5d383d);db[_0x47a5('0x4c')][_0x47a5('0x4d')](_0x46d2d3['toString']())[_0x47a5('0x46')](function(_0x4db625){var _0x485e3c=[];for(var _0x470da6=0x0;_0x470da6<_0x4db625[_0x47a5('0x4e')];_0x470da6++){_0x485e3c[_0x47a5('0x45')](getTimezoneData(_0x4db625[_0x470da6],tmp_campaigns));}BPromise[_0x47a5('0x4f')](_0x485e3c)['then'](function(){_0x482de6({'val':0x1});});})[_0x47a5('0x50')](function(_0x5d1550){logger['error'](_0x5d1550['message']);_0x482de6({'val':0x0});});});}function updateTzVoiceQueues(_0x4f8564){return new Promise(function(_0x212d92,_0x6cd4ea){var _0x1e2bb4=squel['select']()['fields']([_0x47a5('0x51'),_0x47a5('0x52')])[_0x47a5('0x10')](_0x47a5('0x53'))[_0x47a5('0x11')]('voice_queues_has_cm_lists',null,_0x47a5('0x54'))['where'](_0x47a5('0x55')+_0x4f8564);db[_0x47a5('0x4c')]['query'](_0x1e2bb4[_0x47a5('0x31')]())[_0x47a5('0x46')](function(_0x132854){var _0x3e8274=[];for(var _0x2d6494=0x0;_0x2d6494<_0x132854[_0x47a5('0x4e')];_0x2d6494++){_0x3e8274[_0x47a5('0x45')](getTimezoneData(_0x132854[_0x2d6494],tmp_voice_queues));}BPromise[_0x47a5('0x4f')](_0x3e8274)['then'](function(){_0x212d92({'val':0x1});});})[_0x47a5('0x50')](function(_0x2a3a57){logger[_0x47a5('0x41')](_0x2a3a57[_0x47a5('0x42')]);_0x212d92({'val':0x0});});});}function getTimezoneData(_0x396cb0,_0x4bbe14){return new Promise(function(_0xbec033,_0xdfcecc){var _0x1224bc=shared[_0x47a5('0x56')];var _0x4228a3=_0x1224bc[_0x396cb0[_0x47a5('0x57')]];if(_[_0x47a5('0x58')](_0x4228a3)){_0xbec033({'ret':0x1});}else{var _0x149d34=_0x4228a3[_0x47a5('0x59')];var _0x44cb90=squel[_0x47a5('0x2b')]()[_0x47a5('0x2c')](_0x4bbe14)[_0x47a5('0x5a')]('id',_0x396cb0['id'])[_0x47a5('0x5a')](_0x47a5('0x5b'),_0x149d34)['set'](_0x47a5('0x57'),_0x396cb0[_0x47a5('0x57')])[_0x47a5('0x31')]();return db['sequelize'][_0x47a5('0x4d')](_0x44cb90)[_0x47a5('0x46')](function(_0x36c67){_0xbec033({'ret':0x1});})[_0x47a5('0x50')](function(_0x5d9822){logger[_0x47a5('0x41')](_0x5d9822['message']);_0xdfcecc({'ret':0x1});});}});}function handleTZQuery(_0x2d5ee6){logger['info'](_0x2d5ee6);return db[_0x47a5('0x4c')]['query'](_0x2d5ee6)[_0x47a5('0x46')](function(_0x2f27c3){})[_0x47a5('0x50')](function(_0x58473b){logger['error'](_0x58473b['message']);});}function main(_0x4164a3,_0x2b1303,_0xe3c0a7,_0x117510){logger['info'](_0x47a5('0x5c'),_0x4164a3,JSON[_0x47a5('0x5d')](_0x2b1303));process[_0x47a5('0x5e')](_0x47a5('0x5f'));var _0x308c9a=_0x2b1303[_0x47a5('0x60')];var _0x1155f6=_0x2b1303[_0x47a5('0x61')];var _0x4618a0=path[_0x47a5('0x11')](config[_0x47a5('0x62')],_0x47a5('0x63'),_0x1155f6+'.csv');hasTZ=_[_0x47a5('0x37')](_0x308c9a)['includes'](_0x47a5('0x57'));var _0x2ac30f=_[_0x47a5('0x37')](_0x308c9a)[_0x47a5('0x11')]();logger[_0x47a5('0x3f')](_0x47a5('0x64'),_0x2ac30f);if(hasTZ)_0x2ac30f+=_0x47a5('0x65');fs[_0x47a5('0x66')](_0x4618a0,_0x2ac30f+'\x0a');Papa[_0x47a5('0x67')](fs[_0x47a5('0x68')](_0x4164a3),{'header':!![],'skipEmptyLines':!![],'step':function(_0x1cfb37,_0x1f07ac){try{for(var _0x8f0035=0x0,_0x2d434c=[];_0x8f0035<_0x1cfb37[_0x47a5('0x69')]['length'];_0x8f0035++){stats['rows']+=0x1;if(_0x1cfb37['errors'][_0x8f0035]){handleError(_0x1cfb37['data'][_0x8f0035],_0x1cfb37[_0x47a5('0x44')][_0x8f0035]);}else{var _0x28b8e9=[];for(var _0x5d6916 in _0x308c9a){if(_0x308c9a[_0x47a5('0x6a')](_0x5d6916)){if(_0x1cfb37[_0x47a5('0x69')][_0x8f0035][_0x308c9a[_0x5d6916]]){var _0x1baa5a=_[_0x47a5('0x6b')](_0x1cfb37[_0x47a5('0x69')][_0x8f0035][_0x308c9a[_0x5d6916]][_0x47a5('0x6c')](/"/g,'\x27'));switch(_0x5d6916){case _0x47a5('0x1d'):var _0x1c7302=moment(_0x1baa5a,_0x47a5('0x6d'),!![]);if(_0x1c7302[_0x47a5('0x6e')]()){_0x2d434c[_0x47a5('0x45')]('\x22'+_0x1baa5a+'\x22');}else{_0x28b8e9['push'](_0x47a5('0x6f'));}break;case _0x47a5('0x22'):var _0x420671=parseInt(_0x1baa5a);_0x1baa5a=_['isNaN'](_0x420671)||_0x420671<0x0||_0x420671>0x4?_0x117510?0x3:0x2:_0x420671;_0x2d434c[_0x47a5('0x45')]('\x22'+_0x1baa5a+'\x22');break;case _0x47a5('0x34'):var _0x17b61d=parseInt(_0x1baa5a);if(_['isNumber'](_0x17b61d)&&_[_0x47a5('0x70')](_0xe3c0a7,_0x17b61d)){_0x2d434c['push']('\x22'+_0x17b61d+'\x22');}else{_0x28b8e9['push'](_0x47a5('0x71'));}break;case _0x47a5('0x72'):if(isEmail(_0x1baa5a)){_0x2d434c[_0x47a5('0x45')]('\x22'+_0x1baa5a+'\x22');}else{_0x28b8e9[_0x47a5('0x45')](_0x47a5('0x73'));}break;case _0x47a5('0x74'):var _0x479a82=moment(_0x1baa5a,'YYYY-MM-DD',!![]);if(_0x479a82[_0x47a5('0x6e')]()){_0x2d434c['push']('\x22'+_0x1baa5a+'\x22');}else{_0x28b8e9[_0x47a5('0x45')](_0x47a5('0x75'));}break;case _0x47a5('0x57'):var _0xb16bdd=shared['timezones'];var _0x3c66e3=_0xb16bdd[_0x1baa5a];if(!_['isNil'](_0x3c66e3)){var _0x5f3a04=_0x3c66e3[_0x47a5('0x59')];_0x2d434c[_0x47a5('0x45')]('\x22'+_0x1baa5a+'\x22');_0x2d434c['push']('\x22'+_0x5f3a04+'\x22');}break;default:_0x2d434c[_0x47a5('0x45')]('\x22'+_0x1baa5a+'\x22');}}else{switch(_0x5d6916){case _0x47a5('0x76'):case _0x47a5('0xf'):_0x28b8e9['push'](_0x5d6916+_0x47a5('0x77'));break;default:_0x2d434c['push']('\x22\x22');}}}}if(_0x28b8e9[_0x47a5('0x4e')]){handleError(_0x1cfb37[_0x47a5('0x69')][_0x8f0035],{'code':_0x47a5('0x78'),'message':_0x28b8e9['join']()});}else{fs[_0x47a5('0x79')](_0x4618a0,_0x2d434c[_0x47a5('0x11')]()+'\x0a');}_0x2d434c=[];}if(!(stats[_0x47a5('0x7a')]%0xc8)){socket['emit'](_0x47a5('0x7b')+_0x1155f6,stats);stats['errors']=[];}}if(stopped){logger[_0x47a5('0x3f')]('Abort\x20parser');_0x1f07ac[_0x47a5('0x7c')]();}}catch(_0x20d8bd){handleError(_0x1cfb37[_0x47a5('0x69')][_0x8f0035],{'code':_0x47a5('0x7d'),'message':_0x20d8bd['message']});logger[_0x47a5('0x41')](_0x47a5('0x7e'),_0x20d8bd[_0x47a5('0x42')]);}},'complete':function(){try{var _0x1bbfba=[];var _0x22d84a=[];var _0x57ac25='cm_contacts';if(_0x2b1303[_0x47a5('0x7f')]&&_0x2b1303['duplicates'][_0x47a5('0x4e')]){_0x57ac25=_0x47a5('0x80')+_0x1155f6;_0x1bbfba[_0x47a5('0x45')]('CREATE\x20TABLE\x20'+_0x57ac25+_0x47a5('0x81'));}tmp_campaigns=_0x47a5('0x82')+_0x1155f6;tmp_voice_queues='voice_queues_'+_0x1155f6;_0x22d84a[_0x47a5('0x45')](_0x47a5('0x83')+tmp_campaigns+_0x47a5('0x84'));_0x22d84a[_0x47a5('0x45')]('CREATE\x20TABLE\x20'+tmp_voice_queues+'(id\x20int,dialTimezone\x20varchar(255),offset\x20int);');BPromise[_0x47a5('0x85')](_0x22d84a,handleTZQuery)[_0x47a5('0x86')](function(_0x48e7f3){updateTzCampaigns(_0x2b1303[_0x47a5('0x1f')])[_0x47a5('0x86')](function(_0x5a0901){updateTzVoiceQueues(_0x2b1303[_0x47a5('0x1f')])[_0x47a5('0x86')](function(_0x2930d9){var _0x59f010=util[_0x47a5('0x87')]('LOAD\x20DATA\x20LOCAL\x20INFILE\x20\x27%s\x27\x20INTO\x20TABLE\x20%s\x20CHARACTER\x20SET\x20UTF8\x20FIELDS\x20TERMINATED\x20BY\x20\x27,\x27\x20ENCLOSED\x20BY\x20\x27\x22\x27\x20LINES\x20TERMINATED\x20BY\x20\x27\x0a\x27\x20IGNORE\x201\x20ROWS\x20(%s)\x20SET\x20id\x20=\x20NULL,\x20ListId\x20=\x20%s,\x20CompanyId\x20=\x20%s,\x20createdAt\x20=\x20\x27%s\x27,\x20updatedAt\x20=\x20\x27%s\x27',_0x4618a0,_0x57ac25,_0x2ac30f,_0x2b1303[_0x47a5('0x1f')],_0x2b1303['CompanyId']||null,NOW,NOW);if(_[_0x47a5('0x58')](_0x308c9a[_0x47a5('0x1d')])){_0x59f010+=',\x20scheduledAt\x20=\x20NOW()';}_0x1bbfba[_0x47a5('0x45')](_0x59f010);if(_0x2b1303['duplicates']&&_0x2b1303[_0x47a5('0x7f')][_0x47a5('0x4e')]){_0x1bbfba[_0x47a5('0x45')](insertCmContact(_0x2b1303[_0x47a5('0x1f')],_0x57ac25,_0x2b1303['duplicates'],_0x308c9a));}if(hasTZ){_0x1bbfba[_0x47a5('0x45')](insertTzCmHopper(_0x2b1303['ListId'],'voice_queues_has_cm_lists',_0x47a5('0x53'),_0x47a5('0x88'),_0x117510,tmp_voice_queues));_0x1bbfba[_0x47a5('0x45')](insertTzCmHopperBlack(_0x2b1303[_0x47a5('0x1f')],_0x47a5('0x89'),'voice_queues',_0x47a5('0x88')));_0x1bbfba[_0x47a5('0x45')](insertTzCmHopper(_0x2b1303[_0x47a5('0x1f')],_0x47a5('0x49'),'campaigns',_0x47a5('0x8a'),_0x117510,tmp_campaigns));_0x1bbfba['push'](insertTzCmHopperBlack(_0x2b1303[_0x47a5('0x1f')],_0x47a5('0x8b'),_0x47a5('0x48'),_0x47a5('0x8a')));}else{_0x1bbfba[_0x47a5('0x45')](insertCmHopper(_0x2b1303[_0x47a5('0x1f')],_0x47a5('0x8c'),_0x47a5('0x53'),_0x47a5('0x88'),_0x117510));_0x1bbfba['push'](insertCmHopperBlack(_0x2b1303[_0x47a5('0x1f')],_0x47a5('0x89'),'voice_queues',_0x47a5('0x88')));_0x1bbfba[_0x47a5('0x45')](insertCmHopper(_0x2b1303[_0x47a5('0x1f')],'campaigns_has_cm_lists','campaigns',_0x47a5('0x8a'),_0x117510));_0x1bbfba[_0x47a5('0x45')](insertCmHopperBlack(_0x2b1303['ListId'],'campaigns_has_cm_blacklists',_0x47a5('0x48'),_0x47a5('0x8a')));}_0x1bbfba['push'](_0x47a5('0x8d')+tmp_campaigns+';');_0x1bbfba[_0x47a5('0x45')]('DROP\x20TABLE\x20'+tmp_voice_queues+';');BPromise[_0x47a5('0x85')](_0x1bbfba,handleQuery)[_0x47a5('0x86')](function(_0x109805){stats[_0x47a5('0x8e')]=!![];stats[_0x47a5('0x8f')]=_0x2b1303[_0x47a5('0x7f')]&&_0x2b1303['duplicates']['length']?results[0x2]['affectedRows']:results[0x0][_0x47a5('0x8f')];socket[_0x47a5('0x90')]('contact:import:'+_0x1155f6,stats);fs[_0x47a5('0x91')](_0x4164a3);fs[_0x47a5('0x91')](_0x4618a0);process[_0x47a5('0x43')](0x0);})[_0x47a5('0x50')](function(_0xcdbfd7){logger['error'](_0xcdbfd7[_0x47a5('0x42')]);process['exit'](0x1);});})['catch'](function(_0x5db0ed){logger[_0x47a5('0x41')](_0x5db0ed['message']);process[_0x47a5('0x43')](0x1);});});});}catch(_0xf3edc8){logger[_0x47a5('0x41')]('complete',_0xf3edc8[_0x47a5('0x42')]);process[_0x47a5('0x43')](0x1);}},'error':function(_0x35bf37,_0x121750,_0x392ad7,_0x581a87){throw new Error(_0x581a87);}});}function validate(){if(process[_0x47a5('0x92')]&&process[_0x47a5('0x92')]['length']<0x4){throw new Error(_0x47a5('0x93'));}var _0x419870=path[_0x47a5('0x11')](config[_0x47a5('0x62')],_0x47a5('0x63'),process[_0x47a5('0x92')][0x2]);if(!fs['existsSync'](_0x419870)){throw new Error(_0x47a5('0x94'));}var _0x2e418d={};try{_0x2e418d=JSON['parse'](process[_0x47a5('0x92')][0x3]);if(!_0x2e418d[_0x47a5('0x60')]){throw new Error(_0x47a5('0x95'));}if(!_0x2e418d[_0x47a5('0x60')]['phone']){throw new Error('phone\x20is\x20mandatory');}if(!_0x2e418d['binding']['firstName']){throw new Error(_0x47a5('0x96'));}var _0x27793e=0x0;if(_0x2e418d[_0x47a5('0x60')][_0x47a5('0x34')]){_0x27793e=0x1;}if(!_0x2e418d[_0x47a5('0x1f')]){throw new Error(_0x47a5('0x97'));}}catch(_0xac1f9e){throw new Error(_0x47a5('0x98'));}var _0x4bd164=[];try{_0x4bd164=_[_0x47a5('0x99')](JSON[_0x47a5('0x67')](process[_0x47a5('0x92')][0x4]),'id');}catch(_0x399528){logger['info']('No\x20agent\x20available');}main(_0x419870,_0x2e418d,_0x4bd164,_0x27793e);}validate();process['on'](_0x47a5('0x9a'),handleStop);process['on']('uncaughtException',handleUncaughtException);
\ No newline at end of file
+var _0x7a54=['.CmListId\x20=\x20?','toString','date_add(cm_contacts.scheduledat,interval\x20','cm_contacts.priority','UserId','\x20=\x20?','concat','keys','CompanyId',')\x20NOT\x20IN\x20?','ListId\x20=\x20?','deletedAt\x20IS\x20NULL','MIN(id)','min_id','group','info','Received\x20SIGINT','error','message','exit','errors','push','spread','campaigns.id','campaigns','campaigns_has_cm_lists','campaigns.id\x20=\x20campaigns_has_cm_lists.CampaignId','campaigns_has_cm_lists.CmListId=','sequelize','query','length','all','catch','voice_queues.id','voice_queues.dialTimezone','voice_queues','voice_queues.id\x20=\x20voice_queues_has_cm_lists.VoiceQueueId','voice_queues_has_cm_lists.CmListId=','timezones','dialTimezone','isNil','utcOffset','set','offset','main','stringify','send','start','binding','socket_timestamp','root','server/files/tmp','header',',utcOffset','writeFileSync','parse','createReadStream','data','hasOwnProperty','trim','replace','YYYY-MM-DD\x20HH:mm:ss','isValid','scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)','includes','agent\x20not\x20exists','email','email\x20wrong\x20format','dateOfBirth','dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)','firstName','\x20not\x20specified','SystemRow','appendFileSync','rows','contact:import:','abort','SystemError','step','duplicates','cm_contacts_','\x20LIKE\x20cm_contacts;','campaigns_','CREATE\x20TABLE\x20','(id\x20int,dialTimezone\x20varchar(255),offset\x20int);','each','then','format','VoiceQueueId','voice_queues_has_cm_blacklists','CampaignId','campaigns_has_cm_blacklists','voice_queues_has_cm_lists','DROP\x20TABLE\x20','finish','affectedRows','emit','unlink','argv','arguments\x20\x20\x20','file\x20doesn\x27t\x20exists','binding\x20doesn\x27t\x20exists','firstName\x20is\x20mandatory','ListId\x20is\x20mandatory','body\x20id\x20mandatory','map','SIGINT','path','lodash','papaparse','bluebird','moment','ioredis','../../../mysqldb','../../../config/environment','../../../config/environment/shared','../../../config/logger','redis','localhost','test','select','field','phone','from','join','.id\x20=\x20','where','.dialCheckDuplicateType\x20IN\x20(','cm_contacts.phone','cm_contacts.scheduledat','cm_contacts.id','cm_contacts.ListId','cm_contacts.createdAt','cm_contacts.UserId','cm_hopper','fromQuery','scheduledat','ContactId','ListId','createdAt','updatedAt','priority','recallme','cm_contacts','.CmListId','cm_contacts.createdAt\x20=\x20?','cm_contacts.phone\x20NOT\x20IN\x20(?)','\x22always\x22','\x22onlyIfOpen\x22','cm_contacts.updatedAt','insert','into','cm_hopper_black','fields','cm_contacts.ListId\x20=\x20'];(function(_0x58c20f,_0x4cdb1b){var _0x3b0318=function(_0x36fa84){while(--_0x36fa84){_0x58c20f['push'](_0x58c20f['shift']());}};_0x3b0318(++_0x4cdb1b);}(_0x7a54,0x106));var _0x47a5=function(_0x42b16e,_0x25f2b2){_0x42b16e=_0x42b16e-0x0;var _0x5f5cb0=_0x7a54[_0x42b16e];return _0x5f5cb0;};'use strict';var fs=require('fs');var path=require(_0x47a5('0x0'));var _=require(_0x47a5('0x1'));var Papa=require(_0x47a5('0x2'));var util=require('util');var BPromise=require(_0x47a5('0x3'));var moment=require(_0x47a5('0x4'));var squel=require('squel');var Redis=require(_0x47a5('0x5'));var db=require(_0x47a5('0x6'))['db'];var config=require(_0x47a5('0x7'));var shared=require(_0x47a5('0x8'));var logger=require(_0x47a5('0x9'))('import');config[_0x47a5('0xa')]=_['defaults'](config[_0x47a5('0xa')],{'host':_0x47a5('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x47a5('0xa')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var stopped=![];var tmp_voice_queues;var tmp_campaigns;var tzOffset=0x0;var hasTZ;var NOW=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');function isEmail(_0x582352){return/^([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x22([^\x0d\x22\x5c\x80-\xff]|\x5c[\x00-\x7f])*\x22)(\x2e([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x22([^\x0d\x22\x5c\x80-\xff]|\x5c[\x00-\x7f])*\x22))*\x40([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x5b([^\x0d\x5b-\x5d\x80-\xff]|\x5c[\x00-\x7f])*\x5d)(\x2e([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x5b([^\x0d\x5b-\x5d\x80-\xff]|\x5c[\x00-\x7f])*\x5d))*$/[_0x47a5('0xc')](_0x582352);}function selectNotIn(_0x2baee7,_0x5e31dd,_0x2eb0dd,_0x49e844,_0x5de6d7){return squel[_0x47a5('0xd')]()[_0x47a5('0xe')](_0x47a5('0xf'))[_0x47a5('0x10')](_0x49e844)[_0x47a5('0x11')](_0x5e31dd,null,_0x5e31dd+_0x47a5('0x12')+_0x49e844+'.'+_0x2eb0dd)[_0x47a5('0x13')](_0x49e844+'.'+_0x2eb0dd+'\x20=\x20'+_0x2baee7+'.'+_0x2eb0dd)[_0x47a5('0x13')](_0x5e31dd+_0x47a5('0x14')+_0x5de6d7[_0x47a5('0x11')]()+')');}function insertCmHopper(_0x711793,_0x139f25,_0x620ee9,_0x3c6c46,_0x190faa){var _0x4e99a8=[_0x47a5('0x15'),_0x47a5('0x16'),_0x47a5('0x17'),_0x47a5('0x18'),_0x139f25+'.'+_0x3c6c46,_0x47a5('0x19'),'cm_contacts.updatedAt','cm_contacts.priority',_0x47a5('0x1a'),'\x22'+_0x190faa+'\x22'];return squel['insert']()['into'](_0x47a5('0x1b'))[_0x47a5('0x1c')]([_0x47a5('0xf'),_0x47a5('0x1d'),_0x47a5('0x1e'),_0x47a5('0x1f'),_0x3c6c46,_0x47a5('0x20'),_0x47a5('0x21'),_0x47a5('0x22'),'UserId',_0x47a5('0x23')],squel[_0x47a5('0xd')]()['fields'](_0x4e99a8)[_0x47a5('0x10')](_0x139f25)[_0x47a5('0x11')](_0x47a5('0x24'),null,'cm_contacts.ListId\x20=\x20'+_0x139f25+_0x47a5('0x25'))[_0x47a5('0x11')](_0x620ee9,null,_0x620ee9+_0x47a5('0x12')+_0x139f25+'.'+_0x3c6c46)[_0x47a5('0x13')](_0x139f25+'.CmListId\x20=\x20?',_0x711793)[_0x47a5('0x13')](_0x47a5('0x26'),NOW)['where'](_0x47a5('0x27'),selectNotIn(_0x139f25,_0x620ee9,_0x3c6c46,_0x47a5('0x1b'),[_0x47a5('0x28'),_0x47a5('0x29')]))[_0x47a5('0x13')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0x139f25,_0x620ee9,_0x3c6c46,'cm_hopper',[_0x47a5('0x28')])))['toString']();}function insertCmHopperBlack(_0x1ea9c8,_0x5b6c4e,_0x23cb77,_0x378208){var _0x36ad34=[_0x47a5('0x15'),_0x47a5('0x17'),_0x47a5('0x18'),_0x5b6c4e+'.'+_0x378208,_0x47a5('0x19'),_0x47a5('0x2a')];return squel[_0x47a5('0x2b')]()[_0x47a5('0x2c')](_0x47a5('0x2d'))[_0x47a5('0x1c')]([_0x47a5('0xf'),'ContactId',_0x47a5('0x1f'),_0x378208,'createdAt',_0x47a5('0x21')],squel[_0x47a5('0xd')]()[_0x47a5('0x2e')](_0x36ad34)['from'](_0x5b6c4e)[_0x47a5('0x11')](_0x47a5('0x24'),null,_0x47a5('0x2f')+_0x5b6c4e+_0x47a5('0x25'))['join'](_0x23cb77,null,_0x23cb77+'.id\x20=\x20'+_0x5b6c4e+'.'+_0x378208)[_0x47a5('0x13')](_0x5b6c4e+_0x47a5('0x30'),_0x1ea9c8)['where']('cm_contacts.createdAt\x20=\x20?',NOW)[_0x47a5('0x13')](_0x47a5('0x27'),squel['select']()[_0x47a5('0xe')]('phone')[_0x47a5('0x10')](_0x47a5('0x2d'))['where']('ListId\x20=\x20?',_0x1ea9c8)[_0x47a5('0x13')](_0x378208+'\x20=\x20?',_0x5b6c4e+'.'+_0x378208)))[_0x47a5('0x31')]();}function insertTzCmHopper(_0x87e4c9,_0xf269a8,_0x52749b,_0x18f7e9,_0x50c086,_0x53c754){var _0x65542e=['cm_contacts.phone',_0x47a5('0x32')+_0x53c754+'.offset-cm_contacts.utcOffset\x20minute)',_0x47a5('0x17'),_0x47a5('0x18'),_0xf269a8+'.'+_0x18f7e9,_0x47a5('0x19'),_0x47a5('0x2a'),_0x47a5('0x33'),_0x47a5('0x1a'),'\x22'+_0x50c086+'\x22'];var _0xee582c=squel[_0x47a5('0x2b')]()[_0x47a5('0x2c')]('cm_hopper')[_0x47a5('0x1c')]([_0x47a5('0xf'),'scheduledat',_0x47a5('0x1e'),_0x47a5('0x1f'),_0x18f7e9,_0x47a5('0x20'),'updatedAt',_0x47a5('0x22'),_0x47a5('0x34'),'recallme'],squel[_0x47a5('0xd')]()[_0x47a5('0x2e')](_0x65542e)['from'](_0xf269a8)['join']('cm_contacts',null,_0x47a5('0x2f')+_0xf269a8+'.CmListId')[_0x47a5('0x11')](_0x52749b,null,_0x52749b+_0x47a5('0x12')+_0xf269a8+'.'+_0x18f7e9)[_0x47a5('0x11')](_0x53c754,null,_0x53c754+_0x47a5('0x12')+_0xf269a8+'.'+_0x18f7e9)[_0x47a5('0x13')](_0xf269a8+_0x47a5('0x30'),_0x87e4c9)[_0x47a5('0x13')](_0x47a5('0x26'),NOW)[_0x47a5('0x13')](_0x47a5('0x27'),selectNotIn(_0xf269a8,_0x52749b,_0x18f7e9,_0x47a5('0x1b'),[_0x47a5('0x28'),_0x47a5('0x29')]))['where'](_0x47a5('0x27'),selectNotIn(_0xf269a8,_0x52749b,_0x18f7e9,_0x47a5('0x1b'),[_0x47a5('0x28')])))[_0x47a5('0x31')]();return _0xee582c;}function insertTzCmHopperBlack(_0x586f4f,_0x7de536,_0x528ef3,_0x47c7a2){var _0x55c43d=['cm_contacts.phone',_0x47a5('0x17'),'cm_contacts.ListId',_0x7de536+'.'+_0x47c7a2,_0x47a5('0x19'),_0x47a5('0x2a')];return squel[_0x47a5('0x2b')]()['into'](_0x47a5('0x2d'))[_0x47a5('0x1c')](['phone','ContactId',_0x47a5('0x1f'),_0x47c7a2,'createdAt',_0x47a5('0x21')],squel[_0x47a5('0xd')]()[_0x47a5('0x2e')](_0x55c43d)[_0x47a5('0x10')](_0x7de536)[_0x47a5('0x11')](_0x47a5('0x24'),null,_0x47a5('0x2f')+_0x7de536+_0x47a5('0x25'))[_0x47a5('0x11')](_0x528ef3,null,_0x528ef3+_0x47a5('0x12')+_0x7de536+'.'+_0x47c7a2)[_0x47a5('0x13')](_0x7de536+_0x47a5('0x30'),_0x586f4f)[_0x47a5('0x13')](_0x47a5('0x26'),NOW)[_0x47a5('0x13')](_0x47a5('0x27'),squel['select']()[_0x47a5('0xe')](_0x47a5('0xf'))['from']('cm_hopper_black')[_0x47a5('0x13')]('ListId\x20=\x20?',_0x586f4f)[_0x47a5('0x13')](_0x47c7a2+_0x47a5('0x35'),_0x7de536+'.'+_0x47c7a2)))['toString']();}function insertCmContact(_0x4f62d3,_0x3d85cc,_0x52d409,_0x2d147c){var _0x1d1039=_[_0x47a5('0x36')](_[_0x47a5('0x37')](_0x2d147c),[_0x47a5('0x1f'),_0x47a5('0x38'),_0x47a5('0x20'),'updatedAt']);return squel['insert']()[_0x47a5('0x2c')](_0x47a5('0x24'))[_0x47a5('0x1c')](_0x1d1039,squel[_0x47a5('0xd')]()[_0x47a5('0x2e')](_0x1d1039)[_0x47a5('0x10')](_0x3d85cc)[_0x47a5('0x13')]('('+_0x52d409['join'](',')+_0x47a5('0x39'),squel[_0x47a5('0xd')]()[_0x47a5('0x2e')](_0x52d409)['from'](_0x47a5('0x24'))['where'](_0x47a5('0x3a'),_0x4f62d3)[_0x47a5('0x13')](_0x47a5('0x3b')))[_0x47a5('0x13')]('id\x20IN\x20?',squel[_0x47a5('0xd')]()[_0x47a5('0xe')](_0x47a5('0x3c'),_0x47a5('0x3d'))[_0x47a5('0x10')](_0x3d85cc)[_0x47a5('0x3e')](_0x52d409[_0x47a5('0x11')](','))))['toString']();}function handleStop(){logger[_0x47a5('0x3f')](_0x47a5('0x40'));stopped=!![];}function handleUncaughtException(_0x187d7e){logger[_0x47a5('0x41')](_0x187d7e[_0x47a5('0x42')]);process[_0x47a5('0x43')](0x1);}function handleError(_0x572233,_0x1ad6a9){stats[_0x47a5('0x44')][_0x47a5('0x45')]({'name':_0x1ad6a9['code'],'message':_0x1ad6a9[_0x47a5('0x42')],'row':_0x572233});}function handleQuery(_0x3c78b7){logger[_0x47a5('0x3f')](_0x3c78b7);return db['sequelize']['query'](_0x3c78b7)[_0x47a5('0x46')](function(_0x376e1d){results['push'](_0x376e1d);})['catch'](function(_0x6d6b2b){logger['error'](_0x6d6b2b[_0x47a5('0x42')]);});}function updateTzCampaigns(_0x5d383d){return new Promise(function(_0x482de6,_0x389ed9){var _0x46d2d3=squel['select']()[_0x47a5('0x2e')]([_0x47a5('0x47'),'campaigns.dialTimezone'])['from'](_0x47a5('0x48'))[_0x47a5('0x11')](_0x47a5('0x49'),null,_0x47a5('0x4a'))['where'](_0x47a5('0x4b')+_0x5d383d);db[_0x47a5('0x4c')][_0x47a5('0x4d')](_0x46d2d3['toString']())[_0x47a5('0x46')](function(_0x4db625){var _0x485e3c=[];for(var _0x470da6=0x0;_0x470da6<_0x4db625[_0x47a5('0x4e')];_0x470da6++){_0x485e3c[_0x47a5('0x45')](getTimezoneData(_0x4db625[_0x470da6],tmp_campaigns));}BPromise[_0x47a5('0x4f')](_0x485e3c)['then'](function(){_0x482de6({'val':0x1});});})[_0x47a5('0x50')](function(_0x5d1550){logger['error'](_0x5d1550['message']);_0x482de6({'val':0x0});});});}function updateTzVoiceQueues(_0x4f8564){return new Promise(function(_0x212d92,_0x6cd4ea){var _0x1e2bb4=squel['select']()['fields']([_0x47a5('0x51'),_0x47a5('0x52')])[_0x47a5('0x10')](_0x47a5('0x53'))[_0x47a5('0x11')]('voice_queues_has_cm_lists',null,_0x47a5('0x54'))['where'](_0x47a5('0x55')+_0x4f8564);db[_0x47a5('0x4c')]['query'](_0x1e2bb4[_0x47a5('0x31')]())[_0x47a5('0x46')](function(_0x132854){var _0x3e8274=[];for(var _0x2d6494=0x0;_0x2d6494<_0x132854[_0x47a5('0x4e')];_0x2d6494++){_0x3e8274[_0x47a5('0x45')](getTimezoneData(_0x132854[_0x2d6494],tmp_voice_queues));}BPromise[_0x47a5('0x4f')](_0x3e8274)['then'](function(){_0x212d92({'val':0x1});});})[_0x47a5('0x50')](function(_0x2a3a57){logger[_0x47a5('0x41')](_0x2a3a57[_0x47a5('0x42')]);_0x212d92({'val':0x0});});});}function getTimezoneData(_0x396cb0,_0x4bbe14){return new Promise(function(_0xbec033,_0xdfcecc){var _0x1224bc=shared[_0x47a5('0x56')];var _0x4228a3=_0x1224bc[_0x396cb0[_0x47a5('0x57')]];if(_[_0x47a5('0x58')](_0x4228a3)){_0xbec033({'ret':0x1});}else{var _0x149d34=_0x4228a3[_0x47a5('0x59')];var _0x44cb90=squel[_0x47a5('0x2b')]()[_0x47a5('0x2c')](_0x4bbe14)[_0x47a5('0x5a')]('id',_0x396cb0['id'])[_0x47a5('0x5a')](_0x47a5('0x5b'),_0x149d34)['set'](_0x47a5('0x57'),_0x396cb0[_0x47a5('0x57')])[_0x47a5('0x31')]();return db['sequelize'][_0x47a5('0x4d')](_0x44cb90)[_0x47a5('0x46')](function(_0x36c67){_0xbec033({'ret':0x1});})[_0x47a5('0x50')](function(_0x5d9822){logger[_0x47a5('0x41')](_0x5d9822['message']);_0xdfcecc({'ret':0x1});});}});}function handleTZQuery(_0x2d5ee6){logger['info'](_0x2d5ee6);return db[_0x47a5('0x4c')]['query'](_0x2d5ee6)[_0x47a5('0x46')](function(_0x2f27c3){})[_0x47a5('0x50')](function(_0x58473b){logger['error'](_0x58473b['message']);});}function main(_0x4164a3,_0x2b1303,_0xe3c0a7,_0x117510){logger['info'](_0x47a5('0x5c'),_0x4164a3,JSON[_0x47a5('0x5d')](_0x2b1303));process[_0x47a5('0x5e')](_0x47a5('0x5f'));var _0x308c9a=_0x2b1303[_0x47a5('0x60')];var _0x1155f6=_0x2b1303[_0x47a5('0x61')];var _0x4618a0=path[_0x47a5('0x11')](config[_0x47a5('0x62')],_0x47a5('0x63'),_0x1155f6+'.csv');hasTZ=_[_0x47a5('0x37')](_0x308c9a)['includes'](_0x47a5('0x57'));var _0x2ac30f=_[_0x47a5('0x37')](_0x308c9a)[_0x47a5('0x11')]();logger[_0x47a5('0x3f')](_0x47a5('0x64'),_0x2ac30f);if(hasTZ)_0x2ac30f+=_0x47a5('0x65');fs[_0x47a5('0x66')](_0x4618a0,_0x2ac30f+'\x0a');Papa[_0x47a5('0x67')](fs[_0x47a5('0x68')](_0x4164a3),{'header':!![],'skipEmptyLines':!![],'step':function(_0x1cfb37,_0x1f07ac){try{for(var _0x8f0035=0x0,_0x2d434c=[];_0x8f0035<_0x1cfb37[_0x47a5('0x69')]['length'];_0x8f0035++){stats['rows']+=0x1;if(_0x1cfb37['errors'][_0x8f0035]){handleError(_0x1cfb37['data'][_0x8f0035],_0x1cfb37[_0x47a5('0x44')][_0x8f0035]);}else{var _0x28b8e9=[];for(var _0x5d6916 in _0x308c9a){if(_0x308c9a[_0x47a5('0x6a')](_0x5d6916)){if(_0x1cfb37[_0x47a5('0x69')][_0x8f0035][_0x308c9a[_0x5d6916]]){var _0x1baa5a=_[_0x47a5('0x6b')](_0x1cfb37[_0x47a5('0x69')][_0x8f0035][_0x308c9a[_0x5d6916]][_0x47a5('0x6c')](/"/g,'\x27'));switch(_0x5d6916){case _0x47a5('0x1d'):var _0x1c7302=moment(_0x1baa5a,_0x47a5('0x6d'),!![]);if(_0x1c7302[_0x47a5('0x6e')]()){_0x2d434c[_0x47a5('0x45')]('\x22'+_0x1baa5a+'\x22');}else{_0x28b8e9['push'](_0x47a5('0x6f'));}break;case _0x47a5('0x22'):var _0x420671=parseInt(_0x1baa5a);_0x1baa5a=_['isNaN'](_0x420671)||_0x420671<0x0||_0x420671>0x4?_0x117510?0x3:0x2:_0x420671;_0x2d434c[_0x47a5('0x45')]('\x22'+_0x1baa5a+'\x22');break;case _0x47a5('0x34'):var _0x17b61d=parseInt(_0x1baa5a);if(_['isNumber'](_0x17b61d)&&_[_0x47a5('0x70')](_0xe3c0a7,_0x17b61d)){_0x2d434c['push']('\x22'+_0x17b61d+'\x22');}else{_0x28b8e9['push'](_0x47a5('0x71'));}break;case _0x47a5('0x72'):if(isEmail(_0x1baa5a)){_0x2d434c[_0x47a5('0x45')]('\x22'+_0x1baa5a+'\x22');}else{_0x28b8e9[_0x47a5('0x45')](_0x47a5('0x73'));}break;case _0x47a5('0x74'):var _0x479a82=moment(_0x1baa5a,'YYYY-MM-DD',!![]);if(_0x479a82[_0x47a5('0x6e')]()){_0x2d434c['push']('\x22'+_0x1baa5a+'\x22');}else{_0x28b8e9[_0x47a5('0x45')](_0x47a5('0x75'));}break;case _0x47a5('0x57'):var _0xb16bdd=shared['timezones'];var _0x3c66e3=_0xb16bdd[_0x1baa5a];if(!_['isNil'](_0x3c66e3)){var _0x5f3a04=_0x3c66e3[_0x47a5('0x59')];_0x2d434c[_0x47a5('0x45')]('\x22'+_0x1baa5a+'\x22');_0x2d434c['push']('\x22'+_0x5f3a04+'\x22');}break;default:_0x2d434c[_0x47a5('0x45')]('\x22'+_0x1baa5a+'\x22');}}else{switch(_0x5d6916){case _0x47a5('0x76'):case _0x47a5('0xf'):_0x28b8e9['push'](_0x5d6916+_0x47a5('0x77'));break;default:_0x2d434c['push']('\x22\x22');}}}}if(_0x28b8e9[_0x47a5('0x4e')]){handleError(_0x1cfb37[_0x47a5('0x69')][_0x8f0035],{'code':_0x47a5('0x78'),'message':_0x28b8e9['join']()});}else{fs[_0x47a5('0x79')](_0x4618a0,_0x2d434c[_0x47a5('0x11')]()+'\x0a');}_0x2d434c=[];}if(!(stats[_0x47a5('0x7a')]%0xc8)){socket['emit'](_0x47a5('0x7b')+_0x1155f6,stats);stats['errors']=[];}}if(stopped){logger[_0x47a5('0x3f')]('Abort\x20parser');_0x1f07ac[_0x47a5('0x7c')]();}}catch(_0x20d8bd){handleError(_0x1cfb37[_0x47a5('0x69')][_0x8f0035],{'code':_0x47a5('0x7d'),'message':_0x20d8bd['message']});logger[_0x47a5('0x41')](_0x47a5('0x7e'),_0x20d8bd[_0x47a5('0x42')]);}},'complete':function(){try{var _0x1bbfba=[];var _0x22d84a=[];var _0x57ac25='cm_contacts';if(_0x2b1303[_0x47a5('0x7f')]&&_0x2b1303['duplicates'][_0x47a5('0x4e')]){_0x57ac25=_0x47a5('0x80')+_0x1155f6;_0x1bbfba[_0x47a5('0x45')]('CREATE\x20TABLE\x20'+_0x57ac25+_0x47a5('0x81'));}tmp_campaigns=_0x47a5('0x82')+_0x1155f6;tmp_voice_queues='voice_queues_'+_0x1155f6;_0x22d84a[_0x47a5('0x45')](_0x47a5('0x83')+tmp_campaigns+_0x47a5('0x84'));_0x22d84a[_0x47a5('0x45')]('CREATE\x20TABLE\x20'+tmp_voice_queues+'(id\x20int,dialTimezone\x20varchar(255),offset\x20int);');BPromise[_0x47a5('0x85')](_0x22d84a,handleTZQuery)[_0x47a5('0x86')](function(_0x48e7f3){updateTzCampaigns(_0x2b1303[_0x47a5('0x1f')])[_0x47a5('0x86')](function(_0x5a0901){updateTzVoiceQueues(_0x2b1303[_0x47a5('0x1f')])[_0x47a5('0x86')](function(_0x2930d9){var _0x59f010=util[_0x47a5('0x87')]('LOAD\x20DATA\x20LOCAL\x20INFILE\x20\x27%s\x27\x20INTO\x20TABLE\x20%s\x20CHARACTER\x20SET\x20UTF8\x20FIELDS\x20TERMINATED\x20BY\x20\x27,\x27\x20ENCLOSED\x20BY\x20\x27\x22\x27\x20LINES\x20TERMINATED\x20BY\x20\x27\x0a\x27\x20IGNORE\x201\x20ROWS\x20(%s)\x20SET\x20id\x20=\x20NULL,\x20ListId\x20=\x20%s,\x20CompanyId\x20=\x20%s,\x20createdAt\x20=\x20\x27%s\x27,\x20updatedAt\x20=\x20\x27%s\x27',_0x4618a0,_0x57ac25,_0x2ac30f,_0x2b1303[_0x47a5('0x1f')],_0x2b1303['CompanyId']||null,NOW,NOW);if(_[_0x47a5('0x58')](_0x308c9a[_0x47a5('0x1d')])){_0x59f010+=',\x20scheduledAt\x20=\x20NOW()';}_0x1bbfba[_0x47a5('0x45')](_0x59f010);if(_0x2b1303['duplicates']&&_0x2b1303[_0x47a5('0x7f')][_0x47a5('0x4e')]){_0x1bbfba[_0x47a5('0x45')](insertCmContact(_0x2b1303[_0x47a5('0x1f')],_0x57ac25,_0x2b1303['duplicates'],_0x308c9a));}if(hasTZ){_0x1bbfba[_0x47a5('0x45')](insertTzCmHopper(_0x2b1303['ListId'],'voice_queues_has_cm_lists',_0x47a5('0x53'),_0x47a5('0x88'),_0x117510,tmp_voice_queues));_0x1bbfba[_0x47a5('0x45')](insertTzCmHopperBlack(_0x2b1303[_0x47a5('0x1f')],_0x47a5('0x89'),'voice_queues',_0x47a5('0x88')));_0x1bbfba[_0x47a5('0x45')](insertTzCmHopper(_0x2b1303[_0x47a5('0x1f')],_0x47a5('0x49'),'campaigns',_0x47a5('0x8a'),_0x117510,tmp_campaigns));_0x1bbfba['push'](insertTzCmHopperBlack(_0x2b1303[_0x47a5('0x1f')],_0x47a5('0x8b'),_0x47a5('0x48'),_0x47a5('0x8a')));}else{_0x1bbfba[_0x47a5('0x45')](insertCmHopper(_0x2b1303[_0x47a5('0x1f')],_0x47a5('0x8c'),_0x47a5('0x53'),_0x47a5('0x88'),_0x117510));_0x1bbfba['push'](insertCmHopperBlack(_0x2b1303[_0x47a5('0x1f')],_0x47a5('0x89'),'voice_queues',_0x47a5('0x88')));_0x1bbfba[_0x47a5('0x45')](insertCmHopper(_0x2b1303[_0x47a5('0x1f')],'campaigns_has_cm_lists','campaigns',_0x47a5('0x8a'),_0x117510));_0x1bbfba[_0x47a5('0x45')](insertCmHopperBlack(_0x2b1303['ListId'],'campaigns_has_cm_blacklists',_0x47a5('0x48'),_0x47a5('0x8a')));}_0x1bbfba['push'](_0x47a5('0x8d')+tmp_campaigns+';');_0x1bbfba[_0x47a5('0x45')]('DROP\x20TABLE\x20'+tmp_voice_queues+';');BPromise[_0x47a5('0x85')](_0x1bbfba,handleQuery)[_0x47a5('0x86')](function(_0x109805){stats[_0x47a5('0x8e')]=!![];stats[_0x47a5('0x8f')]=_0x2b1303[_0x47a5('0x7f')]&&_0x2b1303['duplicates']['length']?results[0x2]['affectedRows']:results[0x0][_0x47a5('0x8f')];socket[_0x47a5('0x90')]('contact:import:'+_0x1155f6,stats);fs[_0x47a5('0x91')](_0x4164a3);fs[_0x47a5('0x91')](_0x4618a0);process[_0x47a5('0x43')](0x0);})[_0x47a5('0x50')](function(_0xcdbfd7){logger['error'](_0xcdbfd7[_0x47a5('0x42')]);process['exit'](0x1);});})['catch'](function(_0x5db0ed){logger[_0x47a5('0x41')](_0x5db0ed['message']);process[_0x47a5('0x43')](0x1);});});});}catch(_0xf3edc8){logger[_0x47a5('0x41')]('complete',_0xf3edc8[_0x47a5('0x42')]);process[_0x47a5('0x43')](0x1);}},'error':function(_0x35bf37,_0x121750,_0x392ad7,_0x581a87){throw new Error(_0x581a87);}});}function validate(){if(process[_0x47a5('0x92')]&&process[_0x47a5('0x92')]['length']<0x4){throw new Error(_0x47a5('0x93'));}var _0x419870=path[_0x47a5('0x11')](config[_0x47a5('0x62')],_0x47a5('0x63'),process[_0x47a5('0x92')][0x2]);if(!fs['existsSync'](_0x419870)){throw new Error(_0x47a5('0x94'));}var _0x2e418d={};try{_0x2e418d=JSON['parse'](process[_0x47a5('0x92')][0x3]);if(!_0x2e418d[_0x47a5('0x60')]){throw new Error(_0x47a5('0x95'));}if(!_0x2e418d[_0x47a5('0x60')]['phone']){throw new Error('phone\x20is\x20mandatory');}if(!_0x2e418d['binding']['firstName']){throw new Error(_0x47a5('0x96'));}var _0x27793e=0x0;if(_0x2e418d[_0x47a5('0x60')][_0x47a5('0x34')]){_0x27793e=0x1;}if(!_0x2e418d[_0x47a5('0x1f')]){throw new Error(_0x47a5('0x97'));}}catch(_0xac1f9e){throw new Error(_0x47a5('0x98'));}var _0x4bd164=[];try{_0x4bd164=_[_0x47a5('0x99')](JSON[_0x47a5('0x67')](process[_0x47a5('0x92')][0x4]),'id');}catch(_0x399528){logger['info']('No\x20agent\x20available');}main(_0x419870,_0x2e418d,_0x4bd164,_0x27793e);}validate();process['on'](_0x47a5('0x9a'),handleStop);process['on']('uncaughtException',handleUncaughtException);
\ No newline at end of file
diff --git a/server/components/import/cm/csvUpdates.js b/server/components/import/cm/csvUpdates.js
index bb8fbf0..105eda2 100644
--- a/server/components/import/cm/csvUpdates.js
+++ b/server/components/import/cm/csvUpdates.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9be3=['contact:import:','Abort\x20parser','abort','step','CREATE\x20TABLE\x20','\x20LIKE\x20cm_contacts;','LOAD\x20DATA\x20LOCAL\x20INFILE\x20\x27%s\x27\x20INTO\x20TABLE\x20%s\x20CHARACTER\x20SET\x20UTF8\x20FIELDS\x20TERMINATED\x20BY\x20\x27,\x27\x20ENCLOSED\x20BY\x20\x27\x22\x27\x20LINES\x20TERMINATED\x20BY\x20\x27\x0a\x27\x20IGNORE\x201\x20ROWS\x20(%s)\x20SET\x20ListId\x20=\x20%s,\x20CompanyId\x20=\x20%s,\x20createdAt\x20=\x20\x27%s\x27,\x20updatedAt\x20=\x20\x27%s\x27',',\x20scheduledAt\x20=\x20NOW()','each','contact','contactId','orderBy','DROP\x20TABLE\x20','unlink','complete','argv','existsSync','file\x20doesn\x27t\x20exists','binding\x20doesn\x27t\x20exists','ListId\x20is\x20mandatory','map','No\x20agent\x20available','SIGINT','uncaughtException','path','lodash','papaparse','util','moment','squel','../../../mysqldb','../../../config/environment','../../../config/logger','socket.io-emitter','redis','format','YYYY-MM-DD\x20HH:mm:ss','cm_contacts_temp_','YYYYMMDDHHmmss','test','field','join','.id\x20=\x20','where','\x20=\x20','.dialCheckDuplicateType\x20IN\x20(','sequelize','query','select\x20*\x20from\x20','spread','isNil','AdditionalPhones','push','then','catch','error','message','length','all','split','filter','CmContactHasItem','update','updated','create','PHONE','inserted','CmHopper','phone','cm_contacts.createdAt','cm_contacts.priority','cm_contacts.UserId','insert','into','cm_hopper','fromQuery','ListId','createdAt','updatedAt','priority','UserId','select','fields','cm_contacts','cm_contacts.ListId\x20=\x20','.CmListId\x20=\x20?','cm_contacts.createdAt\x20=\x20?','cm_contacts.phone\x20NOT\x20IN\x20(?)','\x22onlyIfOpen\x22','toString','cm_contacts.phone','cm_contacts.id','cm_contacts.ListId','cm_contacts.updatedAt','cm_hopper_black','from','ListId\x20=\x20?','cm_hopper.id','cm_contact_has_items.item','cm_contact_has_items.OrderBy','cm_contact_has_items.updatedAt','CmHopperId','cm_hopper.ListId\x20=\x20?','concat','CompanyId','MIN(id)','min_id','group','Received\x20SIGINT','exit','errors','code','info','main','start','binding','clone','socket_timestamp','root','server/files/tmp','.csv','body','ContactItemType','findAll','name','keys','writeFileSync','createReadStream','data','rows','find','trim','replace','scheduledat','isValid','isNaN','isNumber','includes','agent\x20not\x20exists','email\x20wrong\x20format','dateOfBirth','YYYY-MM-DD','dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)','firstName','\x20not\x20specified','SystemRow','appendFileSync','emit'];(function(_0x12ae02,_0x53b7db){var _0x5890b3=function(_0x2b4c13){while(--_0x2b4c13){_0x12ae02['push'](_0x12ae02['shift']());}};_0x5890b3(++_0x53b7db);}(_0x9be3,0x1d4));var _0x39be=function(_0x513eb1,_0x510484){_0x513eb1=_0x513eb1-0x0;var _0xe2f119=_0x9be3[_0x513eb1];return _0xe2f119;};'use strict';var fs=require('fs');var path=require(_0x39be('0x0'));var _=require(_0x39be('0x1'));var Papa=require(_0x39be('0x2'));var util=require(_0x39be('0x3'));var BPromise=require('bluebird');var moment=require(_0x39be('0x4'));var squel=require(_0x39be('0x5'));var Redis=require('ioredis');var db=require(_0x39be('0x6'))['db'];var config=require(_0x39be('0x7'));var logger=require(_0x39be('0x8'))('import');config['redis']=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x39be('0x9'))(new Redis(config[_0x39be('0xa')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var promisesAdditionalPhones=[];var promisesContact=[];var orderBy=0x0;var updatedRows=0x0;var stopped=![];var NOW=moment()[_0x39be('0xb')](_0x39be('0xc'));var tempTableName=_0x39be('0xd')+moment()[_0x39be('0xb')](_0x39be('0xe'));var contactItemTypes=[];var hasAdditionalPhones=![];function isEmail(_0x35f958){return/^([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x22([^\x0d\x22\x5c\x80-\xff]|\x5c[\x00-\x7f])*\x22)(\x2e([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x22([^\x0d\x22\x5c\x80-\xff]|\x5c[\x00-\x7f])*\x22))*\x40([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x5b([^\x0d\x5b-\x5d\x80-\xff]|\x5c[\x00-\x7f])*\x5d)(\x2e([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x5b([^\x0d\x5b-\x5d\x80-\xff]|\x5c[\x00-\x7f])*\x5d))*$/[_0x39be('0xf')](_0x35f958);}function selectNotIn(_0x5583ce,_0xbf2b84,_0x3a6493,_0x677c65,_0x3ed6e0){return squel['select']()[_0x39be('0x10')]('phone')['from'](_0x677c65)[_0x39be('0x11')](_0xbf2b84,null,_0xbf2b84+_0x39be('0x12')+_0x677c65+'.'+_0x3a6493)[_0x39be('0x13')](_0x677c65+'.'+_0x3a6493+_0x39be('0x14')+_0x5583ce+'.'+_0x3a6493)['where'](_0xbf2b84+_0x39be('0x15')+_0x3ed6e0['join']()+')');}function handleAdditionalPhones(){return new Promise(function(_0x58d861,_0x48a1e6){promisesAdditionalPhones=[];promisesContact=[];return db[_0x39be('0x16')][_0x39be('0x17')](_0x39be('0x18')+tempTableName)[_0x39be('0x19')](function(_0x249754){if(_0x249754!==null){var _0x23aa0d=[];for(var _0x5556ba=0x0;_0x5556ba<_0x249754['length'];_0x5556ba++){var _0x259317=_0x249754[_0x5556ba];if(!_[_0x39be('0x1a')](_0x259317['phone'])){if(!_[_0x39be('0x1a')](_0x259317[_0x39be('0x1b')]))_0x23aa0d[_0x39be('0x1c')](insertAdditionalPhones(_0x259317));promisesContact[_0x39be('0x1c')]({'contact':_0x259317});}}}Promise['all'](_0x23aa0d)[_0x39be('0x1d')](function(){_0x58d861({'val':0x1});});})[_0x39be('0x1e')](function(_0x575152){logger[_0x39be('0x1f')](_0x575152[_0x39be('0x20')]);});});}function insertAdditionalPhones(_0xed7fad){return new Promise(function(_0x1edae1,_0x11e435){var _0x1e8a17=_0xed7fad[_0x39be('0x1b')];if(_['isNil'](_0x1e8a17))_0x11e435({'val':0x0});else{var _0x378463=_0x1e8a17['split'](';');var _0x352910=[];orderBy=0x0;for(var _0xf1a852=0x0;_0xf1a852<_0x378463[_0x39be('0x21')];_0xf1a852++){_0x352910[_0x39be('0x1c')](splitAdditionalPhone(_0xed7fad['id'],_0x378463[_0xf1a852]));}Promise[_0x39be('0x22')](_0x352910)['then'](function(){_0x1edae1({'val':_0x378463[_0x39be('0x21')]});});}});}function splitAdditionalPhone(_0x5ef026,_0x22bd0f){return new Promise(function(_0x4bf628,_0x5f4909){var _0x2258e9=_0x22bd0f[_0x39be('0x23')](':');var _0x93a138=_0x2258e9[0x0];var _0x9b678=_0x2258e9[0x1];if(_0x9b678!==''){var _0x538576=_0x9b678['split']('|');var _0x132ea3=[];for(var _0x1eb7ad=0x0;_0x1eb7ad<_0x538576[_0x39be('0x21')];_0x1eb7ad++){if(_0x538576[_0x1eb7ad]!==''){var _0x2b51eb=_[_0x39be('0x24')](promisesAdditionalPhones,{'contactId':_0x5ef026,'phone':_0x538576[_0x1eb7ad]});if(_0x2b51eb['length']==0x0){orderBy++;promisesAdditionalPhones[_0x39be('0x1c')]({'contactId':_0x5ef026,'contactTypeId':_0x93a138,'phone':_0x538576[_0x1eb7ad],'orderBy':orderBy});}}}_0x4bf628({'ok':0x1});}else _0x4bf628({'res':0x0});});}function createAdditionalPhone(_0x31f193,_0x43ad69,_0x1de714,_0x10eafb){return new Promise(function(_0xd2996,_0x50c81a){return db[_0x39be('0x25')]['findOne']({'where':{'CmContactId':_0x31f193,'item':_0x1de714}})[_0x39be('0x1d')](function(_0x245f35){if(_0x245f35){return db[_0x39be('0x25')][_0x39be('0x26')]({'ItemTypeId':_0x43ad69,'OrderBy':_0x10eafb},{'where':{'CmContactId':_0x31f193,'item':_0x1de714}})[_0x39be('0x1d')](function(_0x20a206){_0xd2996({'res':_0x39be('0x27')});});}else{return db[_0x39be('0x25')][_0x39be('0x28')]({'CmContactId':_0x31f193,'item':_0x1de714,'ItemTypeId':_0x43ad69,'OrderBy':_0x10eafb,'ItemClass':_0x39be('0x29')})[_0x39be('0x1d')](function(_0x39b8e4){_0xd2996({'res':_0x39be('0x2a')});});}});});}function updateContact(_0x327ec6){return new Promise(function(_0x595c82,_0x11bdce){var _0x573db7=_0x327ec6['id'];delete _0x327ec6['id'];return db['CmContact'][_0x39be('0x26')](_0x327ec6,{'where':{'id':_0x573db7}})[_0x39be('0x1d')](function(_0x1a70f6){updatedRows+=0x1;return db[_0x39be('0x2b')]['update']({'phone':_0x327ec6[_0x39be('0x2c')]},{'where':{'ContactId':_0x573db7}})[_0x39be('0x1d')](function(_0x3865e3){_0x595c82({'ret':'OK'});});});});}function insertCmHopper(_0x26f4cf,_0x4ec7ae,_0x2f84f4,_0x2dcf6f,_0x4cd4d0){var _0xf9bf90=['cm_contacts.phone','cm_contacts.scheduledat','cm_contacts.id','cm_contacts.ListId',_0x4ec7ae+'.'+_0x2dcf6f,_0x39be('0x2d'),'cm_contacts.updatedAt',_0x39be('0x2e'),_0x39be('0x2f'),'\x22'+_0x4cd4d0+'\x22'];return squel[_0x39be('0x30')]()[_0x39be('0x31')](_0x39be('0x32'))[_0x39be('0x33')](['phone','scheduledat','ContactId',_0x39be('0x34'),_0x2dcf6f,_0x39be('0x35'),_0x39be('0x36'),_0x39be('0x37'),_0x39be('0x38'),'recallme'],squel[_0x39be('0x39')]()[_0x39be('0x3a')](_0xf9bf90)['from'](_0x4ec7ae)['join'](_0x39be('0x3b'),null,_0x39be('0x3c')+_0x4ec7ae+'.CmListId')['join'](_0x2f84f4,null,_0x2f84f4+_0x39be('0x12')+_0x4ec7ae+'.'+_0x2dcf6f)[_0x39be('0x13')](_0x4ec7ae+_0x39be('0x3d'),_0x26f4cf)[_0x39be('0x13')](_0x39be('0x3e'),NOW)[_0x39be('0x13')](_0x39be('0x3f'),selectNotIn(_0x4ec7ae,_0x2f84f4,_0x2dcf6f,_0x39be('0x32'),['\x22always\x22',_0x39be('0x40')]))['where']('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0x4ec7ae,_0x2f84f4,_0x2dcf6f,_0x39be('0x32'),['\x22always\x22'])))[_0x39be('0x41')]();}function insertCmHopperBlack(_0x23037f,_0x3cc8a8,_0x55713e,_0x141310){var _0x3155cf=[_0x39be('0x42'),_0x39be('0x43'),_0x39be('0x44'),_0x3cc8a8+'.'+_0x141310,'cm_contacts.createdAt',_0x39be('0x45')];return squel[_0x39be('0x30')]()['into'](_0x39be('0x46'))[_0x39be('0x33')]([_0x39be('0x2c'),'ContactId','ListId',_0x141310,_0x39be('0x35'),_0x39be('0x36')],squel[_0x39be('0x39')]()[_0x39be('0x3a')](_0x3155cf)['from'](_0x3cc8a8)[_0x39be('0x11')]('cm_contacts',null,_0x39be('0x3c')+_0x3cc8a8+'.CmListId')['join'](_0x55713e,null,_0x55713e+_0x39be('0x12')+_0x3cc8a8+'.'+_0x141310)[_0x39be('0x13')](_0x3cc8a8+_0x39be('0x3d'),_0x23037f)[_0x39be('0x13')](_0x39be('0x3e'),NOW)['where'](_0x39be('0x3f'),squel[_0x39be('0x39')]()['field']('phone')[_0x39be('0x47')](_0x39be('0x46'))[_0x39be('0x13')](_0x39be('0x48'),_0x23037f)[_0x39be('0x13')](_0x141310+'\x20=\x20?',_0x3cc8a8+'.'+_0x141310)))[_0x39be('0x41')]();}function insertCmHopperAdditionalPhones(_0x344ab4){var _0x4b3a53=[_0x39be('0x49'),_0x39be('0x4a'),_0x39be('0x4b'),'cm_contact_has_items.createdAt',_0x39be('0x4c')];return squel[_0x39be('0x30')]()[_0x39be('0x31')]('cm_hopper_additional_phones')['fromQuery']([_0x39be('0x4d'),_0x39be('0x2c'),'OrderBy',_0x39be('0x35'),'updatedAt'],squel[_0x39be('0x39')]()[_0x39be('0x3a')](_0x4b3a53)['from'](_0x39be('0x32'))[_0x39be('0x11')]('cm_contacts',null,'cm_contacts.id\x20=\x20cm_hopper.ContactId')[_0x39be('0x11')]('cm_contact_has_items',null,'cm_contacts.id\x20=\x20cm_contact_has_items.CmContactId')[_0x39be('0x13')](_0x39be('0x4e'),_0x344ab4)[_0x39be('0x13')](_0x39be('0x3e'),NOW))[_0x39be('0x41')]();}function insertCmContact(_0x34d8d6,_0x52c0fc,_0x3f5e5e,_0x265e86){var _0x16ab7c=_[_0x39be('0x4f')](_['keys'](_0x265e86),['ListId',_0x39be('0x50'),_0x39be('0x35'),_0x39be('0x36')]);return squel[_0x39be('0x30')]()[_0x39be('0x31')]('cm_contacts')[_0x39be('0x33')](_0x16ab7c,squel[_0x39be('0x39')]()[_0x39be('0x3a')](_0x16ab7c)[_0x39be('0x47')](_0x52c0fc)[_0x39be('0x13')]('('+_0x3f5e5e[_0x39be('0x11')](',')+')\x20NOT\x20IN\x20?',squel['select']()[_0x39be('0x3a')](_0x3f5e5e)[_0x39be('0x47')]('cm_contacts')['where'](_0x39be('0x48'),_0x34d8d6))[_0x39be('0x13')]('id\x20IN\x20?',squel[_0x39be('0x39')]()[_0x39be('0x10')](_0x39be('0x51'),_0x39be('0x52'))[_0x39be('0x47')](_0x52c0fc)[_0x39be('0x53')](_0x3f5e5e[_0x39be('0x11')](','))))['toString']();}function handleStop(){logger['info'](_0x39be('0x54'));stopped=!![];}function handleUncaughtException(_0x4858a6){logger[_0x39be('0x1f')](_0x4858a6[_0x39be('0x20')]);process[_0x39be('0x55')](0x1);}function handleError(_0x93a79e,_0x5a4047){stats[_0x39be('0x56')][_0x39be('0x1c')]({'name':_0x5a4047[_0x39be('0x57')],'message':_0x5a4047['message'],'row':_0x93a79e});}function handleQuery(_0x2f38cc){logger[_0x39be('0x58')](_0x2f38cc);return db[_0x39be('0x16')][_0x39be('0x17')](_0x2f38cc)['spread'](function(_0x5c9802){results[_0x39be('0x1c')](_0x5c9802);})[_0x39be('0x1e')](function(_0x2f33a1){logger['error'](_0x2f33a1[_0x39be('0x20')]);});}function main(_0x4e0b8f,_0x14978b,_0x1d073e,_0x41f65b){logger[_0x39be('0x58')](_0x39be('0x59'),_0x4e0b8f,JSON['stringify'](_0x14978b));process['send'](_0x39be('0x5a'));var _0x95ba88=_0x14978b[_0x39be('0x5b')];var _0x41c022=_[_0x39be('0x5c')](_0x95ba88);var _0x36e46e=_0x14978b[_0x39be('0x5d')];var _0x4af0fc=path[_0x39be('0x11')](config[_0x39be('0x5e')],_0x39be('0x5f'),_0x36e46e+_0x39be('0x60'));logger[_0x39be('0x58')](_0x39be('0x61'),_0x14978b);db[_0x39be('0x62')][_0x39be('0x63')]({'raw':!![],'attributes':['id',_0x39be('0x64')]})[_0x39be('0x1d')](function(_0x29429b){for(var _0xc25923=0x0;_0xc25923<_0x29429b[_0x39be('0x21')];_0xc25923++){if(_0x29429b[_0xc25923][_0x39be('0x64')]in _0x95ba88){contactItemTypes[_0x39be('0x1c')](_0x29429b[_0xc25923]);delete _0x41c022[_0x29429b[_0xc25923][_0x39be('0x64')]];hasAdditionalPhones=!![];}else{}}if(hasAdditionalPhones)_0x41c022[_0x39be('0x1b')]='';var _0x257f82=_[_0x39be('0x65')](_0x41c022)[_0x39be('0x11')]();logger[_0x39be('0x58')]('header',_0x257f82);fs[_0x39be('0x66')](_0x4af0fc,_0x257f82+'\x0a');Papa['parse'](fs[_0x39be('0x67')](_0x4e0b8f),{'header':!![],'skipEmptyLines':!![],'step':function(_0x41cee6,_0x403c86){try{for(var _0x58e464=0x0,_0x3d464b=[];_0x58e464<_0x41cee6[_0x39be('0x68')]['length'];_0x58e464++){stats[_0x39be('0x69')]+=0x1;if(_0x41cee6[_0x39be('0x56')][_0x58e464]){handleError(_0x41cee6[_0x39be('0x68')][_0x58e464],_0x41cee6[_0x39be('0x56')][_0x58e464]);}else{var _0x9a1732=[];var _0x3a202e=[];for(var _0xb542cd in _0x95ba88){let _0x2e6964=contactItemTypes[_0x39be('0x6a')](_0x49213b=>_0x49213b[_0x39be('0x64')]===_0xb542cd);if(_[_0x39be('0x1a')](_0x2e6964)){if(_0x95ba88['hasOwnProperty'](_0xb542cd)){if(_0x41cee6[_0x39be('0x68')][_0x58e464][_0x95ba88[_0xb542cd]]){var _0x1002b5=_[_0x39be('0x6b')](_0x41cee6['data'][_0x58e464][_0x95ba88[_0xb542cd]][_0x39be('0x6c')](/"/g,'\x27'));switch(_0xb542cd){case _0x39be('0x6d'):var _0x146aca=moment(_0x1002b5,'YYYY-MM-DD\x20HH:mm:ss',!![]);if(_0x146aca[_0x39be('0x6e')]()){_0x3d464b[_0x39be('0x1c')]('\x22'+_0x1002b5+'\x22');}else{_0x9a1732[_0x39be('0x1c')]('scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)');}break;case _0x39be('0x37'):var _0x3a88bc=parseInt(_0x1002b5);_0x1002b5=_[_0x39be('0x6f')](_0x3a88bc)||_0x3a88bc<0x0||_0x3a88bc>0x4?_0x41f65b?0x3:0x2:_0x3a88bc;_0x3d464b['push']('\x22'+_0x1002b5+'\x22');break;case _0x39be('0x38'):var _0x4e0958=parseInt(_0x1002b5);if(_[_0x39be('0x70')](_0x4e0958)&&_[_0x39be('0x71')](_0x1d073e,_0x4e0958)){_0x3d464b[_0x39be('0x1c')]('\x22'+_0x4e0958+'\x22');}else{_0x9a1732[_0x39be('0x1c')](_0x39be('0x72'));}break;case'email':if(isEmail(_0x1002b5)){_0x3d464b[_0x39be('0x1c')]('\x22'+_0x1002b5+'\x22');}else{_0x9a1732[_0x39be('0x1c')](_0x39be('0x73'));}break;case _0x39be('0x74'):var _0x48eb6c=moment(_0x1002b5,_0x39be('0x75'),!![]);if(_0x48eb6c[_0x39be('0x6e')]()){_0x3d464b[_0x39be('0x1c')]('\x22'+_0x1002b5+'\x22');}else{_0x9a1732[_0x39be('0x1c')](_0x39be('0x76'));}break;default:_0x3d464b[_0x39be('0x1c')]('\x22'+_0x1002b5+'\x22');}}else{switch(_0xb542cd){case _0x39be('0x77'):case _0x39be('0x2c'):_0x9a1732[_0x39be('0x1c')](_0xb542cd+_0x39be('0x78'));break;default:_0x3d464b[_0x39be('0x1c')]('\x22\x22');}}}}else{var _0x15e81b='';for(var _0xf03b35=0x0;_0xf03b35<_0x95ba88[_0xb542cd][_0x39be('0x21')];_0xf03b35++){var _0x1002b5=_[_0x39be('0x6b')](_0x41cee6[_0x39be('0x68')][_0x58e464][_0x95ba88[_0xb542cd][_0xf03b35]]['replace'](/"/g,'\x27'));if(_0x15e81b=='')_0x15e81b=_0x1002b5;else _0x15e81b+='|'+_0x1002b5;}_0x3a202e['push'](_0x2e6964['id']+':'+_0x15e81b);}}if(hasAdditionalPhones){_0x3d464b[_0x39be('0x1c')]('\x22'+_0x3a202e[_0x39be('0x11')](';')+'\x22');}if(_0x9a1732[_0x39be('0x21')]){handleError(_0x41cee6[_0x39be('0x68')][_0x58e464],{'code':_0x39be('0x79'),'message':_0x9a1732[_0x39be('0x11')]()});}else{fs[_0x39be('0x7a')](_0x4af0fc,_0x3d464b['join']()+'\x0a');}_0x3d464b=[];}if(!(stats[_0x39be('0x69')]%0xc8)){socket[_0x39be('0x7b')](_0x39be('0x7c')+_0x36e46e,stats);stats[_0x39be('0x56')]=[];}}if(stopped){logger[_0x39be('0x58')](_0x39be('0x7d'));_0x403c86[_0x39be('0x7e')]();}}catch(_0x4452af){handleError(_0x41cee6[_0x39be('0x68')][_0x58e464],{'code':'SystemError','message':_0x4452af[_0x39be('0x20')]});logger[_0x39be('0x1f')](_0x39be('0x7f'),_0x4452af[_0x39be('0x20')]);}},'complete':function(){try{var _0x2e2a5a=[];var _0x3b8c86=tempTableName;_0x2e2a5a['push'](_0x39be('0x80')+_0x3b8c86+_0x39be('0x81'));logger['info']('CIS\x20len',contactItemTypes['length']);var _0xf612e9=util['format'](_0x39be('0x82'),_0x4af0fc,_0x3b8c86,_0x257f82,_0x14978b[_0x39be('0x34')],_0x14978b[_0x39be('0x50')]||null,NOW,NOW);if(_[_0x39be('0x1a')](_0x95ba88['scheduledat'])){_0xf612e9+=_0x39be('0x83');}_0x2e2a5a[_0x39be('0x1c')](_0xf612e9);BPromise[_0x39be('0x84')](_0x2e2a5a,handleQuery)[_0x39be('0x1d')](function(_0x546e26){BPromise[_0x39be('0x22')]([handleAdditionalPhones()])['then'](function(){_0x2e2a5a=[];for(var _0x49fa85=0x0;_0x49fa85\x20\x20');}var _0x198a53=path[_0x39be('0x11')](config['root'],_0x39be('0x5f'),process[_0x39be('0x8b')][0x2]);if(!fs[_0x39be('0x8c')](_0x198a53)){throw new Error(_0x39be('0x8d'));}var _0x1e1f9c={};try{_0x1e1f9c=JSON['parse'](process['argv'][0x3]);if(!_0x1e1f9c[_0x39be('0x5b')]){throw new Error(_0x39be('0x8e'));}var _0xec8bdd=0x0;if(_0x1e1f9c[_0x39be('0x5b')][_0x39be('0x38')]){_0xec8bdd=0x1;}if(!_0x1e1f9c[_0x39be('0x34')]){throw new Error(_0x39be('0x8f'));}}catch(_0x115d19){throw new Error('body\x20id\x20mandatory');}var _0x28bc28=[];try{_0x28bc28=_[_0x39be('0x90')](JSON['parse'](process['argv'][0x4]),'id');}catch(_0x3e0cdf){logger['info'](_0x39be('0x91'));}main(_0x198a53,_0x1e1f9c,_0x28bc28,_0xec8bdd);}validate();process['on'](_0x39be('0x92'),handleStop);process['on'](_0x39be('0x93'),handleUncaughtException);
\ No newline at end of file
+var _0x1072=['ListId\x20=\x20?','\x20=\x20?','cm_hopper.id','cm_contact_has_items.item','cm_contact_has_items.OrderBy','cm_contact_has_items.createdAt','cm_contact_has_items.updatedAt','cm_hopper_additional_phones','OrderBy','cm_contacts.id\x20=\x20cm_hopper.ContactId','cm_contact_has_items','cm_contacts.id\x20=\x20cm_contact_has_items.CmContactId','cm_hopper.ListId\x20=\x20?','concat','keys','ListId','CompanyId',')\x20NOT\x20IN\x20?','id\x20IN\x20?','MIN(id)','min_id','group','info','exit','errors','code','query','catch','main','stringify','send','start','binding','clone','root','server/files/tmp','body','ContactItemType','findAll','name','header','writeFileSync','parse','createReadStream','data','rows','find','hasOwnProperty','trim','replace','scheduledat','isValid','isNumber','includes','agent\x20not\x20exists','email','email\x20wrong\x20format','dateOfBirth','YYYY-MM-DD','firstName','\x20not\x20specified','SystemRow','appendFileSync','emit','contact:import:','Abort\x20parser','abort','SystemError','step','CREATE\x20TABLE\x20','\x20LIKE\x20cm_contacts;','CIS\x20len','LOAD\x20DATA\x20LOCAL\x20INFILE\x20\x27%s\x27\x20INTO\x20TABLE\x20%s\x20CHARACTER\x20SET\x20UTF8\x20FIELDS\x20TERMINATED\x20BY\x20\x27,\x27\x20ENCLOSED\x20BY\x20\x27\x22\x27\x20LINES\x20TERMINATED\x20BY\x20\x27\x0a\x27\x20IGNORE\x201\x20ROWS\x20(%s)\x20SET\x20ListId\x20=\x20%s,\x20CompanyId\x20=\x20%s,\x20createdAt\x20=\x20\x27%s\x27,\x20updatedAt\x20=\x20\x27%s\x27',',\x20scheduledAt\x20=\x20NOW()','each','orderBy','affectedRows','unlink','complete','argv','arguments\x20\x20\x20','existsSync','binding\x20doesn\x27t\x20exists','body\x20id\x20mandatory','No\x20agent\x20available','SIGINT','uncaughtException','path','lodash','papaparse','util','bluebird','moment','ioredis','../../../mysqldb','../../../config/environment','import','redis','defaults','localhost','socket.io-emitter','YYYY-MM-DD\x20HH:mm:ss','cm_contacts_temp_','format','YYYYMMDDHHmmss','test','field','phone','from','where','\x20=\x20','join','sequelize','select\x20*\x20from\x20','spread','isNil','AdditionalPhones','all','then','error','message','length','push','split','CmContactHasItem','findOne','update','updated','CmContact','CmHopper','cm_contacts.phone','cm_contacts.scheduledat','cm_contacts.id','cm_contacts.ListId','cm_contacts.updatedAt','cm_contacts.UserId','insert','into','cm_hopper','ContactId','createdAt','updatedAt','priority','UserId','recallme','select','fields','cm_contacts','cm_contacts.ListId\x20=\x20','.id\x20=\x20','cm_contacts.createdAt\x20=\x20?','cm_contacts.phone\x20NOT\x20IN\x20(?)','\x22always\x22','\x22onlyIfOpen\x22','toString','fromQuery','.CmListId','.CmListId\x20=\x20?','cm_hopper_black'];(function(_0x30c649,_0x2ebbac){var _0x3edfb9=function(_0xab82f5){while(--_0xab82f5){_0x30c649['push'](_0x30c649['shift']());}};_0x3edfb9(++_0x2ebbac);}(_0x1072,0x195));var _0x2107=function(_0xac151d,_0x4ea1d2){_0xac151d=_0xac151d-0x0;var _0x111dba=_0x1072[_0xac151d];return _0x111dba;};'use strict';var fs=require('fs');var path=require(_0x2107('0x0'));var _=require(_0x2107('0x1'));var Papa=require(_0x2107('0x2'));var util=require(_0x2107('0x3'));var BPromise=require(_0x2107('0x4'));var moment=require(_0x2107('0x5'));var squel=require('squel');var Redis=require(_0x2107('0x6'));var db=require(_0x2107('0x7'))['db'];var config=require(_0x2107('0x8'));var logger=require('../../../config/logger')(_0x2107('0x9'));config[_0x2107('0xa')]=_[_0x2107('0xb')](config[_0x2107('0xa')],{'host':_0x2107('0xc'),'port':0x18eb});var socket=require(_0x2107('0xd'))(new Redis(config[_0x2107('0xa')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var promisesAdditionalPhones=[];var promisesContact=[];var orderBy=0x0;var updatedRows=0x0;var stopped=![];var NOW=moment()['format'](_0x2107('0xe'));var tempTableName=_0x2107('0xf')+moment()[_0x2107('0x10')](_0x2107('0x11'));var contactItemTypes=[];var hasAdditionalPhones=![];function isEmail(_0x2e6e38){return/^([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x22([^\x0d\x22\x5c\x80-\xff]|\x5c[\x00-\x7f])*\x22)(\x2e([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x22([^\x0d\x22\x5c\x80-\xff]|\x5c[\x00-\x7f])*\x22))*\x40([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x5b([^\x0d\x5b-\x5d\x80-\xff]|\x5c[\x00-\x7f])*\x5d)(\x2e([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x5b([^\x0d\x5b-\x5d\x80-\xff]|\x5c[\x00-\x7f])*\x5d))*$/[_0x2107('0x12')](_0x2e6e38);}function selectNotIn(_0x326de0,_0x825073,_0x2ddfa4,_0x23f696,_0x367f4b){return squel['select']()[_0x2107('0x13')](_0x2107('0x14'))[_0x2107('0x15')](_0x23f696)['join'](_0x825073,null,_0x825073+'.id\x20=\x20'+_0x23f696+'.'+_0x2ddfa4)[_0x2107('0x16')](_0x23f696+'.'+_0x2ddfa4+_0x2107('0x17')+_0x326de0+'.'+_0x2ddfa4)[_0x2107('0x16')](_0x825073+'.dialCheckDuplicateType\x20IN\x20('+_0x367f4b[_0x2107('0x18')]()+')');}function handleAdditionalPhones(){return new Promise(function(_0x1c0d05,_0x3673df){promisesAdditionalPhones=[];promisesContact=[];return db[_0x2107('0x19')]['query'](_0x2107('0x1a')+tempTableName)[_0x2107('0x1b')](function(_0x5a2114){if(_0x5a2114!==null){var _0x81a966=[];for(var _0x7743a4=0x0;_0x7743a4<_0x5a2114['length'];_0x7743a4++){var _0x3ee7e5=_0x5a2114[_0x7743a4];if(!_[_0x2107('0x1c')](_0x3ee7e5[_0x2107('0x14')])){if(!_['isNil'](_0x3ee7e5[_0x2107('0x1d')]))_0x81a966['push'](insertAdditionalPhones(_0x3ee7e5));promisesContact['push']({'contact':_0x3ee7e5});}}}Promise[_0x2107('0x1e')](_0x81a966)[_0x2107('0x1f')](function(){_0x1c0d05({'val':0x1});});})['catch'](function(_0xec5118){logger[_0x2107('0x20')](_0xec5118[_0x2107('0x21')]);});});}function insertAdditionalPhones(_0x3bcaea){return new Promise(function(_0x80f7c3,_0x49d4c1){var _0xd4864f=_0x3bcaea['AdditionalPhones'];if(_[_0x2107('0x1c')](_0xd4864f))_0x49d4c1({'val':0x0});else{var _0x2463a6=_0xd4864f['split'](';');var _0x2200e9=[];orderBy=0x0;for(var _0x13ef54=0x0;_0x13ef54<_0x2463a6[_0x2107('0x22')];_0x13ef54++){_0x2200e9[_0x2107('0x23')](splitAdditionalPhone(_0x3bcaea['id'],_0x2463a6[_0x13ef54]));}Promise['all'](_0x2200e9)[_0x2107('0x1f')](function(){_0x80f7c3({'val':_0x2463a6['length']});});}});}function splitAdditionalPhone(_0x152341,_0x511d16){return new Promise(function(_0x1cdf65,_0x222f24){var _0x4ab383=_0x511d16[_0x2107('0x24')](':');var _0x2be724=_0x4ab383[0x0];var _0x3acd15=_0x4ab383[0x1];if(_0x3acd15!==''){var _0xecea64=_0x3acd15[_0x2107('0x24')]('|');var _0x66e58f=[];for(var _0x22bf6=0x0;_0x22bf6<_0xecea64['length'];_0x22bf6++){if(_0xecea64[_0x22bf6]!==''){var _0x164eae=_['filter'](promisesAdditionalPhones,{'contactId':_0x152341,'phone':_0xecea64[_0x22bf6]});if(_0x164eae['length']==0x0){orderBy++;promisesAdditionalPhones[_0x2107('0x23')]({'contactId':_0x152341,'contactTypeId':_0x2be724,'phone':_0xecea64[_0x22bf6],'orderBy':orderBy});}}}_0x1cdf65({'ok':0x1});}else _0x1cdf65({'res':0x0});});}function createAdditionalPhone(_0x56fb86,_0x144a64,_0x382b3b,_0xbe4f64){return new Promise(function(_0x13b2ad,_0x58e757){return db[_0x2107('0x25')][_0x2107('0x26')]({'where':{'CmContactId':_0x56fb86,'item':_0x382b3b}})['then'](function(_0x320d1e){if(_0x320d1e){return db['CmContactHasItem'][_0x2107('0x27')]({'ItemTypeId':_0x144a64,'OrderBy':_0xbe4f64},{'where':{'CmContactId':_0x56fb86,'item':_0x382b3b}})[_0x2107('0x1f')](function(_0xf96879){_0x13b2ad({'res':_0x2107('0x28')});});}else{return db['CmContactHasItem']['create']({'CmContactId':_0x56fb86,'item':_0x382b3b,'ItemTypeId':_0x144a64,'OrderBy':_0xbe4f64,'ItemClass':'PHONE'})['then'](function(_0x1a396f){_0x13b2ad({'res':'inserted'});});}});});}function updateContact(_0x59e2d4){return new Promise(function(_0x4435e6,_0x24c240){var _0x51b690=_0x59e2d4['id'];delete _0x59e2d4['id'];return db[_0x2107('0x29')][_0x2107('0x27')](_0x59e2d4,{'where':{'id':_0x51b690}})[_0x2107('0x1f')](function(_0x560dc5){updatedRows+=0x1;return db[_0x2107('0x2a')][_0x2107('0x27')]({'phone':_0x59e2d4[_0x2107('0x14')]},{'where':{'ContactId':_0x51b690}})[_0x2107('0x1f')](function(_0x1fd90e){_0x4435e6({'ret':'OK'});});});});}function insertCmHopper(_0x383d7e,_0x43234d,_0x2c5246,_0xd51f04,_0x389cd0){var _0x42c626=[_0x2107('0x2b'),_0x2107('0x2c'),_0x2107('0x2d'),_0x2107('0x2e'),_0x43234d+'.'+_0xd51f04,'cm_contacts.createdAt',_0x2107('0x2f'),'cm_contacts.priority',_0x2107('0x30'),'\x22'+_0x389cd0+'\x22'];return squel[_0x2107('0x31')]()[_0x2107('0x32')](_0x2107('0x33'))['fromQuery'](['phone','scheduledat',_0x2107('0x34'),'ListId',_0xd51f04,_0x2107('0x35'),_0x2107('0x36'),_0x2107('0x37'),_0x2107('0x38'),_0x2107('0x39')],squel[_0x2107('0x3a')]()[_0x2107('0x3b')](_0x42c626)[_0x2107('0x15')](_0x43234d)[_0x2107('0x18')](_0x2107('0x3c'),null,_0x2107('0x3d')+_0x43234d+'.CmListId')[_0x2107('0x18')](_0x2c5246,null,_0x2c5246+_0x2107('0x3e')+_0x43234d+'.'+_0xd51f04)[_0x2107('0x16')](_0x43234d+'.CmListId\x20=\x20?',_0x383d7e)['where'](_0x2107('0x3f'),NOW)['where'](_0x2107('0x40'),selectNotIn(_0x43234d,_0x2c5246,_0xd51f04,'cm_hopper',[_0x2107('0x41'),_0x2107('0x42')]))[_0x2107('0x16')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0x43234d,_0x2c5246,_0xd51f04,_0x2107('0x33'),['\x22always\x22'])))[_0x2107('0x43')]();}function insertCmHopperBlack(_0x77af13,_0x47d77e,_0xcbac11,_0x14e19f){var _0x133690=[_0x2107('0x2b'),_0x2107('0x2d'),_0x2107('0x2e'),_0x47d77e+'.'+_0x14e19f,'cm_contacts.createdAt',_0x2107('0x2f')];return squel[_0x2107('0x31')]()['into']('cm_hopper_black')[_0x2107('0x44')]([_0x2107('0x14'),_0x2107('0x34'),'ListId',_0x14e19f,'createdAt','updatedAt'],squel[_0x2107('0x3a')]()[_0x2107('0x3b')](_0x133690)[_0x2107('0x15')](_0x47d77e)[_0x2107('0x18')](_0x2107('0x3c'),null,_0x2107('0x3d')+_0x47d77e+_0x2107('0x45'))[_0x2107('0x18')](_0xcbac11,null,_0xcbac11+_0x2107('0x3e')+_0x47d77e+'.'+_0x14e19f)[_0x2107('0x16')](_0x47d77e+_0x2107('0x46'),_0x77af13)[_0x2107('0x16')](_0x2107('0x3f'),NOW)[_0x2107('0x16')](_0x2107('0x40'),squel[_0x2107('0x3a')]()[_0x2107('0x13')]('phone')['from'](_0x2107('0x47'))['where'](_0x2107('0x48'),_0x77af13)[_0x2107('0x16')](_0x14e19f+_0x2107('0x49'),_0x47d77e+'.'+_0x14e19f)))[_0x2107('0x43')]();}function insertCmHopperAdditionalPhones(_0x1395c4){var _0x48c536=[_0x2107('0x4a'),_0x2107('0x4b'),_0x2107('0x4c'),_0x2107('0x4d'),_0x2107('0x4e')];return squel['insert']()['into'](_0x2107('0x4f'))[_0x2107('0x44')](['CmHopperId',_0x2107('0x14'),_0x2107('0x50'),_0x2107('0x35'),_0x2107('0x36')],squel['select']()['fields'](_0x48c536)['from']('cm_hopper')[_0x2107('0x18')]('cm_contacts',null,_0x2107('0x51'))[_0x2107('0x18')](_0x2107('0x52'),null,_0x2107('0x53'))[_0x2107('0x16')](_0x2107('0x54'),_0x1395c4)[_0x2107('0x16')](_0x2107('0x3f'),NOW))[_0x2107('0x43')]();}function insertCmContact(_0x579863,_0x4b1ae5,_0x221de9,_0x326b3b){var _0x2929a1=_[_0x2107('0x55')](_[_0x2107('0x56')](_0x326b3b),[_0x2107('0x57'),_0x2107('0x58'),'createdAt',_0x2107('0x36')]);return squel[_0x2107('0x31')]()[_0x2107('0x32')](_0x2107('0x3c'))['fromQuery'](_0x2929a1,squel[_0x2107('0x3a')]()[_0x2107('0x3b')](_0x2929a1)[_0x2107('0x15')](_0x4b1ae5)[_0x2107('0x16')]('('+_0x221de9[_0x2107('0x18')](',')+_0x2107('0x59'),squel['select']()[_0x2107('0x3b')](_0x221de9)[_0x2107('0x15')](_0x2107('0x3c'))['where'](_0x2107('0x48'),_0x579863))['where'](_0x2107('0x5a'),squel[_0x2107('0x3a')]()['field'](_0x2107('0x5b'),_0x2107('0x5c'))[_0x2107('0x15')](_0x4b1ae5)[_0x2107('0x5d')](_0x221de9[_0x2107('0x18')](','))))['toString']();}function handleStop(){logger[_0x2107('0x5e')]('Received\x20SIGINT');stopped=!![];}function handleUncaughtException(_0x19b395){logger['error'](_0x19b395[_0x2107('0x21')]);process[_0x2107('0x5f')](0x1);}function handleError(_0x5db1bc,_0x590125){stats[_0x2107('0x60')]['push']({'name':_0x590125[_0x2107('0x61')],'message':_0x590125[_0x2107('0x21')],'row':_0x5db1bc});}function handleQuery(_0x15c532){logger[_0x2107('0x5e')](_0x15c532);return db[_0x2107('0x19')][_0x2107('0x62')](_0x15c532)[_0x2107('0x1b')](function(_0x13cee7){results[_0x2107('0x23')](_0x13cee7);})[_0x2107('0x63')](function(_0x209fd5){logger[_0x2107('0x20')](_0x209fd5[_0x2107('0x21')]);});}function main(_0x200789,_0xa6d945,_0x2132bb,_0x3d45af){logger['info'](_0x2107('0x64'),_0x200789,JSON[_0x2107('0x65')](_0xa6d945));process[_0x2107('0x66')](_0x2107('0x67'));var _0x32287d=_0xa6d945[_0x2107('0x68')];var _0xbc0347=_[_0x2107('0x69')](_0x32287d);var _0x1748c3=_0xa6d945['socket_timestamp'];var _0xf6d358=path[_0x2107('0x18')](config[_0x2107('0x6a')],_0x2107('0x6b'),_0x1748c3+'.csv');logger[_0x2107('0x5e')](_0x2107('0x6c'),_0xa6d945);db[_0x2107('0x6d')][_0x2107('0x6e')]({'raw':!![],'attributes':['id',_0x2107('0x6f')]})['then'](function(_0x110220){for(var _0x42e73c=0x0;_0x42e73c<_0x110220['length'];_0x42e73c++){if(_0x110220[_0x42e73c]['name']in _0x32287d){contactItemTypes[_0x2107('0x23')](_0x110220[_0x42e73c]);delete _0xbc0347[_0x110220[_0x42e73c][_0x2107('0x6f')]];hasAdditionalPhones=!![];}else{}}if(hasAdditionalPhones)_0xbc0347[_0x2107('0x1d')]='';var _0x5cde90=_[_0x2107('0x56')](_0xbc0347)[_0x2107('0x18')]();logger[_0x2107('0x5e')](_0x2107('0x70'),_0x5cde90);fs[_0x2107('0x71')](_0xf6d358,_0x5cde90+'\x0a');Papa[_0x2107('0x72')](fs[_0x2107('0x73')](_0x200789),{'header':!![],'skipEmptyLines':!![],'step':function(_0xf07c88,_0x418ffd){try{for(var _0x341a78=0x0,_0x2c6828=[];_0x341a78<_0xf07c88[_0x2107('0x74')][_0x2107('0x22')];_0x341a78++){stats[_0x2107('0x75')]+=0x1;if(_0xf07c88[_0x2107('0x60')][_0x341a78]){handleError(_0xf07c88[_0x2107('0x74')][_0x341a78],_0xf07c88[_0x2107('0x60')][_0x341a78]);}else{var _0xee2c4d=[];var _0x2c5240=[];for(var _0x27a82a in _0x32287d){let _0x51c0b1=contactItemTypes[_0x2107('0x76')](_0x4c730f=>_0x4c730f['name']===_0x27a82a);if(_[_0x2107('0x1c')](_0x51c0b1)){if(_0x32287d[_0x2107('0x77')](_0x27a82a)){if(_0xf07c88[_0x2107('0x74')][_0x341a78][_0x32287d[_0x27a82a]]){var _0x57c7c5=_[_0x2107('0x78')](_0xf07c88[_0x2107('0x74')][_0x341a78][_0x32287d[_0x27a82a]][_0x2107('0x79')](/"/g,'\x27'));switch(_0x27a82a){case _0x2107('0x7a'):var _0x309cb0=moment(_0x57c7c5,_0x2107('0xe'),!![]);if(_0x309cb0[_0x2107('0x7b')]()){_0x2c6828[_0x2107('0x23')]('\x22'+_0x57c7c5+'\x22');}else{_0xee2c4d['push']('scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)');}break;case _0x2107('0x37'):var _0x2d4789=parseInt(_0x57c7c5);_0x57c7c5=_['isNaN'](_0x2d4789)||_0x2d4789<0x0||_0x2d4789>0x4?_0x3d45af?0x3:0x2:_0x2d4789;_0x2c6828[_0x2107('0x23')]('\x22'+_0x57c7c5+'\x22');break;case _0x2107('0x38'):var _0x97b6a4=parseInt(_0x57c7c5);if(_[_0x2107('0x7c')](_0x97b6a4)&&_[_0x2107('0x7d')](_0x2132bb,_0x97b6a4)){_0x2c6828['push']('\x22'+_0x97b6a4+'\x22');}else{_0xee2c4d[_0x2107('0x23')](_0x2107('0x7e'));}break;case _0x2107('0x7f'):if(isEmail(_0x57c7c5)){_0x2c6828['push']('\x22'+_0x57c7c5+'\x22');}else{_0xee2c4d[_0x2107('0x23')](_0x2107('0x80'));}break;case _0x2107('0x81'):var _0x33f4d6=moment(_0x57c7c5,_0x2107('0x82'),!![]);if(_0x33f4d6[_0x2107('0x7b')]()){_0x2c6828['push']('\x22'+_0x57c7c5+'\x22');}else{_0xee2c4d[_0x2107('0x23')]('dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)');}break;default:_0x2c6828[_0x2107('0x23')]('\x22'+_0x57c7c5+'\x22');}}else{switch(_0x27a82a){case _0x2107('0x83'):case _0x2107('0x14'):_0xee2c4d[_0x2107('0x23')](_0x27a82a+_0x2107('0x84'));break;default:_0x2c6828[_0x2107('0x23')]('\x22\x22');}}}}else{var _0x209115='';for(var _0x4ad668=0x0;_0x4ad668<_0x32287d[_0x27a82a][_0x2107('0x22')];_0x4ad668++){var _0x57c7c5=_[_0x2107('0x78')](_0xf07c88[_0x2107('0x74')][_0x341a78][_0x32287d[_0x27a82a][_0x4ad668]][_0x2107('0x79')](/"/g,'\x27'));if(_0x209115=='')_0x209115=_0x57c7c5;else _0x209115+='|'+_0x57c7c5;}_0x2c5240[_0x2107('0x23')](_0x51c0b1['id']+':'+_0x209115);}}if(hasAdditionalPhones){_0x2c6828[_0x2107('0x23')]('\x22'+_0x2c5240[_0x2107('0x18')](';')+'\x22');}if(_0xee2c4d[_0x2107('0x22')]){handleError(_0xf07c88[_0x2107('0x74')][_0x341a78],{'code':_0x2107('0x85'),'message':_0xee2c4d[_0x2107('0x18')]()});}else{fs[_0x2107('0x86')](_0xf6d358,_0x2c6828['join']()+'\x0a');}_0x2c6828=[];}if(!(stats['rows']%0xc8)){socket[_0x2107('0x87')](_0x2107('0x88')+_0x1748c3,stats);stats[_0x2107('0x60')]=[];}}if(stopped){logger['info'](_0x2107('0x89'));_0x418ffd[_0x2107('0x8a')]();}}catch(_0x3f44f3){handleError(_0xf07c88[_0x2107('0x74')][_0x341a78],{'code':_0x2107('0x8b'),'message':_0x3f44f3[_0x2107('0x21')]});logger['error'](_0x2107('0x8c'),_0x3f44f3[_0x2107('0x21')]);}},'complete':function(){try{var _0x2b4420=[];var _0x3f1c8d=tempTableName;_0x2b4420[_0x2107('0x23')](_0x2107('0x8d')+_0x3f1c8d+_0x2107('0x8e'));logger['info'](_0x2107('0x8f'),contactItemTypes[_0x2107('0x22')]);var _0x86c2a0=util['format'](_0x2107('0x90'),_0xf6d358,_0x3f1c8d,_0x5cde90,_0xa6d945[_0x2107('0x57')],_0xa6d945['CompanyId']||null,NOW,NOW);if(_['isNil'](_0x32287d[_0x2107('0x7a')])){_0x86c2a0+=_0x2107('0x91');}_0x2b4420[_0x2107('0x23')](_0x86c2a0);BPromise[_0x2107('0x92')](_0x2b4420,handleQuery)[_0x2107('0x1f')](function(_0xfcf5df){BPromise['all']([handleAdditionalPhones()])['then'](function(){_0x2b4420=[];for(var _0x594d36=0x0;_0x594d36=_0x349441){return _0x41c2f7[_0xc302('0x13')](0x193)[_0xc302('0x14')]({'message':util[_0xc302('0xa')](_0xc302('0x15'),_0x11f086)});}_0x1975c5();})[_0xc302('0x16')](function(_0x98f96d){_0x1975c5(_0x98f96d);});});}function isUserLimit(){return isLimit(_0xc302('0x17'),0x1,db[_0xc302('0x18')],{'where':{'$or':[{'role':_0xc302('0x19')},{'role':_0xc302('0x1a')}]}});}exports[_0xc302('0x1b')]=isUserLimit;
\ No newline at end of file
+var _0xbb9a=['then','count','status','json','format','Maximum\x20%s\x20limit\x20have\x20been\x20reached','catch','User','admin','user','crypto','util','composable-middleware','../../mysqldb','../../config/environment','data1','license','split','aes-256-ctr','%s:%s:%s','update','utf8','final','hasOwnProperty','use','License','findOne'];(function(_0x3eead8,_0x304c6a){var _0x579b22=function(_0x365d43){while(--_0x365d43){_0x3eead8['push'](_0x3eead8['shift']());}};_0x579b22(++_0x304c6a);}(_0xbb9a,0x91));var _0xabb9=function(_0x13852f,_0x443192){_0x13852f=_0x13852f-0x0;var _0x537e98=_0xbb9a[_0x13852f];return _0x537e98;};'use strict';var crypto=require(_0xabb9('0x0'));var util=require(_0xabb9('0x1'));var compose=require(_0xabb9('0x2'));var db=require(_0xabb9('0x3'))['db'];var config=require(_0xabb9('0x4'));function getValueFromLicense(_0x2766a6,_0x5d23dd){if(_0x2766a6&&_0x5d23dd){if(_0x5d23dd[_0xabb9('0x5')]&&_0x5d23dd[_0xabb9('0x6')]){var _0x28e956=_0x5d23dd['data1'];var _0x477482=_0x5d23dd[_0xabb9('0x6')];var _0x1dd067=_0x28e956[_0xabb9('0x7')]('-')[0x4];var _0x523d0b=_0x28e956['split']('-')[0x0];var _0x5b57e5=crypto['createDecipher'](_0xabb9('0x8'),util['format'](_0xabb9('0x9'),_0x1dd067,_0x28e956,_0x523d0b));var _0x2c8497=_0x5b57e5[_0xabb9('0xa')](_0x477482,'base64',_0xabb9('0xb'));_0x2c8497+=_0x5b57e5[_0xabb9('0xc')]('utf8');var _0x54c870=JSON['parse'](_0x2c8497);return _0x54c870[_0xabb9('0xd')](_0x2766a6)?_0x54c870[_0x2766a6]:null;}}return null;}function isLimit(_0x29e200,_0xef72ab,_0x1de4b9,_0x24288b){var _0x4c7d5f=_0xef72ab;return compose()[_0xabb9('0xe')](function(_0x4f7a8b,_0x485e5e,_0x4fbc39){return db[_0xabb9('0xf')][_0xabb9('0x10')]({'where':{'id':0x1},'raw':!![]})[_0xabb9('0x11')](function(_0x3d1538){var _0x1ef1ef=getValueFromLicense(_0x29e200,_0x3d1538);return _0x1ef1ef?_0x1ef1ef:_0x4c7d5f;})[_0xabb9('0x11')](function(_0x1bd534){_0x4c7d5f=_0x1bd534;return _0x1de4b9[_0xabb9('0x12')](_0x24288b);})['then'](function(_0xdb9d06){if(_0xdb9d06>=_0x4c7d5f){return _0x485e5e[_0xabb9('0x13')](0x193)[_0xabb9('0x14')]({'message':util[_0xabb9('0x15')](_0xabb9('0x16'),_0x29e200)});}_0x4fbc39();})[_0xabb9('0x17')](function(_0xf5db74){_0x4fbc39(_0xf5db74);});});}function isUserLimit(){return isLimit('users',0x1,db[_0xabb9('0x18')],{'where':{'$or':[{'role':_0xabb9('0x19')},{'role':_0xabb9('0x1a')}]}});}exports['isUserLimit']=isUserLimit;
\ No newline at end of file
diff --git a/server/components/parsers/advancedSearch.js b/server/components/parsers/advancedSearch.js
index 02cf5d1..126eabd 100644
--- a/server/components/parsers/advancedSearch.js
+++ b/server/components/parsers/advancedSearch.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x27ba=['operator','$between','value','$gt','$lte','add','days','format','YYYY-MM-DD','castTo','text','CAST(','\x20AS\x20','includes','$ne','$notIn','field','\x20IS\x20NULL)','NOT\x20IN\x20?','$eq','=\x20?','$substring','$startsWith','$endsWith','LIKE\x20?','$lt','<\x20?','<=\x20?','$gte','>=\x20?','BETWEEN\x20?\x20AND\x20?','$in','start','utcOffset','hours','minutes','seconds','lodash','moment','parseSearch','sqlOperator','startsWith','and','[$and]','replace','[$or]','split','length','slice','shift','match','filter','indexOf','map','push','buildExpression','DATE'];(function(_0x1ce7d5,_0x5198eb){var _0x586b82=function(_0x49cb85){while(--_0x49cb85){_0x1ce7d5['push'](_0x1ce7d5['shift']());}};_0x586b82(++_0x5198eb);}(_0x27ba,0x97));var _0xa27b=function(_0x23c9e0,_0x46f2e1){_0x23c9e0=_0x23c9e0-0x0;var _0x1238bb=_0x27ba[_0x23c9e0];return _0x1238bb;};'use strict';var _=require(_0xa27b('0x0'));var moment=require(_0xa27b('0x1'));exports[_0xa27b('0x2')]=function(_0x215551){var _0x1c6a1e={'conditions':[]};_0x1c6a1e[_0xa27b('0x3')]=_[_0xa27b('0x4')](_0x215551,'[$or]')?'or':_0xa27b('0x5');var _0x5011df=_0x215551['replace'](_0xa27b('0x6'),'')[_0xa27b('0x7')](_0xa27b('0x8'),'')[_0xa27b('0x9')]('||');for(var _0x42a253=0x0;_0x42a253<_0x5011df[_0xa27b('0xa')];_0x42a253++){var _0x50fd44=_0x5011df[_0x42a253][_0xa27b('0x9')](':=');var _0x3f32be=_0x50fd44[0x0];var _0x5aa359=_0x50fd44[_0xa27b('0xb')](0x1);_0x5aa359['forEach'](function(_0x449c63){var _0x110d38=_0x449c63[_0xa27b('0x9')]('[')[_0xa27b('0xc')]();var _0x38e4c5=_0x449c63[_0xa27b('0xd')](/\[(.*?)\]/g);_0x38e4c5['forEach'](function(_0x242a0f){var _0x190fd1=_0x242a0f['split']('[')[_0xa27b('0xe')](function(_0x17b517){return _0x17b517[_0xa27b('0xf')](']')>-0x1;})[_0xa27b('0x10')](function(_0x1bdadc){return _0x1bdadc[_0xa27b('0x9')](']')[0x0];})[0x0];_0x1c6a1e['conditions'][_0xa27b('0x11')]({'field':_0x3f32be,'operator':_0x110d38,'value':_0x190fd1});});});}return _0x1c6a1e;};exports[_0xa27b('0x12')]=function(_0x3fbf32,_0x4ac1e3,_0x4325d3){var _0xa5506d={};if(_0x4ac1e3===_0xa27b('0x13')){if(_0x4325d3[_0xa27b('0x14')]==='$eq'){_0x4325d3[_0xa27b('0x14')]=_0xa27b('0x15');_0x4325d3[_0xa27b('0x16')]+=','+_0x4325d3[_0xa27b('0x16')];}else if(_['includes']([_0xa27b('0x17'),_0xa27b('0x18')],_0x4325d3[_0xa27b('0x14')])){_0x4325d3['value']=moment(_0x4325d3[_0xa27b('0x16')])[_0xa27b('0x19')](0x1,_0xa27b('0x1a'))[_0xa27b('0x1b')](_0xa27b('0x1c'));}}if(_0x4325d3[_0xa27b('0x1d')]){_0x4ac1e3=_0x4325d3[_0xa27b('0x1d')];_0xa5506d[_0xa27b('0x1e')]=_0xa27b('0x1f')+_0x3fbf32+'.'+_0x4325d3['field']+_0xa27b('0x20')+_0x4325d3[_0xa27b('0x1d')]+')\x20'+parseOperator(_0x4325d3['operator']);}else{_0xa5506d[_0xa27b('0x1e')]=_0x3fbf32+'.'+_0x4325d3['field']+'\x20'+parseOperator(_0x4325d3[_0xa27b('0x14')]);}if(_[_0xa27b('0x21')]([_0xa27b('0x22'),_0xa27b('0x23')],_0x4325d3[_0xa27b('0x14')]))_0xa5506d[_0xa27b('0x1e')]='('+_0xa5506d[_0xa27b('0x1e')]+'\x20OR\x20'+_0x3fbf32+'.'+_0x4325d3[_0xa27b('0x24')]+_0xa27b('0x25');_0xa5506d[_0xa27b('0x16')]=parseValue(_0x4ac1e3,_0x4325d3['operator'],_0x4325d3[_0xa27b('0x16')]);return _0xa5506d;};function parseOperator(_0x3dac1c){var _0x22459d;switch(_0x3dac1c){case'$in':_0x22459d='IN\x20?';break;case _0xa27b('0x23'):_0x22459d=_0xa27b('0x26');break;case _0xa27b('0x27'):_0x22459d=_0xa27b('0x28');break;case _0xa27b('0x22'):_0x22459d='<>\x20?';break;case _0xa27b('0x29'):case _0xa27b('0x2a'):case _0xa27b('0x2b'):_0x22459d=_0xa27b('0x2c');break;case _0xa27b('0x2d'):_0x22459d=_0xa27b('0x2e');break;case'$gt':_0x22459d='>\x20?';break;case'$lte':_0x22459d=_0xa27b('0x2f');break;case _0xa27b('0x30'):_0x22459d=_0xa27b('0x31');break;case _0xa27b('0x15'):_0x22459d=_0xa27b('0x32');break;}return _0x22459d;}function parseValue(_0x557620,_0xdd38bf,_0x11fecb){var _0x37ffb6={'start':undefined,'end':undefined};switch(_0xdd38bf){case _0xa27b('0x33'):case _0xa27b('0x23'):_0x37ffb6[_0xa27b('0x34')]=_0x11fecb[_0xa27b('0x9')](',');break;case'$substring':_0x37ffb6[_0xa27b('0x34')]='%'+_0x11fecb+'%';break;case'$startsWith':_0x37ffb6['start']=_0x11fecb+'%';break;case'$endsWith':_0x37ffb6[_0xa27b('0x34')]='%'+_0x11fecb;break;case _0xa27b('0x15'):var _0x567335=_0x11fecb[_0xa27b('0x9')](',');var _0x11fecb=_0x567335['shift']();var _0x4f7567=_0x567335['pop']();if(_0x557620===_0xa27b('0x13')){_0x11fecb=moment(_0x11fecb)[_0xa27b('0x35')](0x0,!![])[_0xa27b('0x1b')]();_0x4f7567=moment(_0x4f7567)[_0xa27b('0x35')](0x0,!![])[_0xa27b('0x19')](0x17,_0xa27b('0x36'))['add'](0x3b,_0xa27b('0x37'))[_0xa27b('0x19')](0x3b,_0xa27b('0x38'))[_0xa27b('0x1b')]();}_0x37ffb6={'start':_0x11fecb,'end':_0x4f7567};break;default:_0x37ffb6['start']=_0x11fecb;break;}return _0x37ffb6;}
\ No newline at end of file
+var _0xc465=['LIKE\x20?','$lt','<\x20?','>\x20?','$gte','BETWEEN\x20?\x20AND\x20?','$in','start','pop','DATE','utcOffset','hours','minutes','lodash','moment','sqlOperator','startsWith','[$or]','and','replace','[$and]','split','slice','forEach','shift','match','filter','map','buildExpression','operator','$eq','$between','value','$gt','$lte','add','days','format','castTo','text','CAST(','field','\x20AS\x20','includes','$ne','$notIn','\x20OR\x20','\x20IS\x20NULL)','NOT\x20IN\x20?','<>\x20?','$substring','$startsWith','$endsWith'];(function(_0x24576b,_0x19ee95){var _0x5ca615=function(_0x13e727){while(--_0x13e727){_0x24576b['push'](_0x24576b['shift']());}};_0x5ca615(++_0x19ee95);}(_0xc465,0xac));var _0x5c46=function(_0x2070da,_0x45e586){_0x2070da=_0x2070da-0x0;var _0x4f9fe1=_0xc465[_0x2070da];return _0x4f9fe1;};'use strict';var _=require(_0x5c46('0x0'));var moment=require(_0x5c46('0x1'));exports['parseSearch']=function(_0x4fba6e){var _0x2d02c5={'conditions':[]};_0x2d02c5[_0x5c46('0x2')]=_[_0x5c46('0x3')](_0x4fba6e,_0x5c46('0x4'))?'or':_0x5c46('0x5');var _0x5634ff=_0x4fba6e[_0x5c46('0x6')](_0x5c46('0x7'),'')[_0x5c46('0x6')](_0x5c46('0x4'),'')[_0x5c46('0x8')]('||');for(var _0x284681=0x0;_0x284681<_0x5634ff['length'];_0x284681++){var _0x559479=_0x5634ff[_0x284681][_0x5c46('0x8')](':=');var _0x24eee7=_0x559479[0x0];var _0x2eebbf=_0x559479[_0x5c46('0x9')](0x1);_0x2eebbf[_0x5c46('0xa')](function(_0x3ffd4b){var _0x24b849=_0x3ffd4b[_0x5c46('0x8')]('[')[_0x5c46('0xb')]();var _0x12f7f3=_0x3ffd4b[_0x5c46('0xc')](/\[(.*?)\]/g);_0x12f7f3['forEach'](function(_0x2a3df6){var _0x5b13ae=_0x2a3df6['split']('[')[_0x5c46('0xd')](function(_0x36fed3){return _0x36fed3['indexOf'](']')>-0x1;})[_0x5c46('0xe')](function(_0x507bf8){return _0x507bf8['split'](']')[0x0];})[0x0];_0x2d02c5['conditions']['push']({'field':_0x24eee7,'operator':_0x24b849,'value':_0x5b13ae});});});}return _0x2d02c5;};exports[_0x5c46('0xf')]=function(_0x441a69,_0x33b34a,_0x32c163){var _0x45bcf6={};if(_0x33b34a==='DATE'){if(_0x32c163[_0x5c46('0x10')]===_0x5c46('0x11')){_0x32c163['operator']=_0x5c46('0x12');_0x32c163[_0x5c46('0x13')]+=','+_0x32c163[_0x5c46('0x13')];}else if(_['includes']([_0x5c46('0x14'),_0x5c46('0x15')],_0x32c163[_0x5c46('0x10')])){_0x32c163[_0x5c46('0x13')]=moment(_0x32c163['value'])[_0x5c46('0x16')](0x1,_0x5c46('0x17'))[_0x5c46('0x18')]('YYYY-MM-DD');}}if(_0x32c163[_0x5c46('0x19')]){_0x33b34a=_0x32c163[_0x5c46('0x19')];_0x45bcf6[_0x5c46('0x1a')]=_0x5c46('0x1b')+_0x441a69+'.'+_0x32c163[_0x5c46('0x1c')]+_0x5c46('0x1d')+_0x32c163[_0x5c46('0x19')]+')\x20'+parseOperator(_0x32c163['operator']);}else{_0x45bcf6[_0x5c46('0x1a')]=_0x441a69+'.'+_0x32c163[_0x5c46('0x1c')]+'\x20'+parseOperator(_0x32c163[_0x5c46('0x10')]);}if(_[_0x5c46('0x1e')]([_0x5c46('0x1f'),_0x5c46('0x20')],_0x32c163[_0x5c46('0x10')]))_0x45bcf6[_0x5c46('0x1a')]='('+_0x45bcf6[_0x5c46('0x1a')]+_0x5c46('0x21')+_0x441a69+'.'+_0x32c163[_0x5c46('0x1c')]+_0x5c46('0x22');_0x45bcf6['value']=parseValue(_0x33b34a,_0x32c163[_0x5c46('0x10')],_0x32c163[_0x5c46('0x13')]);return _0x45bcf6;};function parseOperator(_0x325b0f){var _0x1f6c14;switch(_0x325b0f){case'$in':_0x1f6c14='IN\x20?';break;case _0x5c46('0x20'):_0x1f6c14=_0x5c46('0x23');break;case _0x5c46('0x11'):_0x1f6c14='=\x20?';break;case'$ne':_0x1f6c14=_0x5c46('0x24');break;case _0x5c46('0x25'):case _0x5c46('0x26'):case _0x5c46('0x27'):_0x1f6c14=_0x5c46('0x28');break;case _0x5c46('0x29'):_0x1f6c14=_0x5c46('0x2a');break;case _0x5c46('0x14'):_0x1f6c14=_0x5c46('0x2b');break;case _0x5c46('0x15'):_0x1f6c14='<=\x20?';break;case _0x5c46('0x2c'):_0x1f6c14='>=\x20?';break;case'$between':_0x1f6c14=_0x5c46('0x2d');break;}return _0x1f6c14;}function parseValue(_0x19de51,_0x142c11,_0x4309a7){var _0x5e6106={'start':undefined,'end':undefined};switch(_0x142c11){case _0x5c46('0x2e'):case _0x5c46('0x20'):_0x5e6106['start']=_0x4309a7[_0x5c46('0x8')](',');break;case _0x5c46('0x25'):_0x5e6106[_0x5c46('0x2f')]='%'+_0x4309a7+'%';break;case _0x5c46('0x26'):_0x5e6106['start']=_0x4309a7+'%';break;case'$endsWith':_0x5e6106[_0x5c46('0x2f')]='%'+_0x4309a7;break;case _0x5c46('0x12'):var _0x3f85b5=_0x4309a7[_0x5c46('0x8')](',');var _0x4309a7=_0x3f85b5['shift']();var _0xd586ed=_0x3f85b5[_0x5c46('0x30')]();if(_0x19de51===_0x5c46('0x31')){_0x4309a7=moment(_0x4309a7)[_0x5c46('0x32')](0x0,!![])[_0x5c46('0x18')]();_0xd586ed=moment(_0xd586ed)[_0x5c46('0x32')](0x0,!![])[_0x5c46('0x16')](0x17,_0x5c46('0x33'))[_0x5c46('0x16')](0x3b,_0x5c46('0x34'))[_0x5c46('0x16')](0x3b,'seconds')[_0x5c46('0x18')]();}_0x5e6106={'start':_0x4309a7,'end':_0xd586ed};break;default:_0x5e6106[_0x5c46('0x2f')]=_0x4309a7;break;}return _0x5e6106;}
\ No newline at end of file
diff --git a/server/components/parsers/qs.js b/server/components/parsers/qs.js
index f3648ae..1b6fd24 100644
--- a/server/components/parsers/qs.js
+++ b/server/components/parsers/qs.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x41b7=['match','isEmail','forEach','join','lodash','sequelize','moment','fields','split','filters','isEmpty','forOwn','find','DATE','isPlainObject','parse','$gte','format','YYYY-MM-DD','utc','$lte','subtract','isArray','limit','offset','map','indexOf','priority','cast','col','unsigned','DESC','ASC','length','omit','isObject','isString','unset','hasOwnProperty','isNumeric'];(function(_0x3911a4,_0x3ab9cc){var _0x56dc8d=function(_0x281271){while(--_0x281271){_0x3911a4['push'](_0x3911a4['shift']());}};_0x56dc8d(++_0x3ab9cc);}(_0x41b7,0x1bc));var _0x741b=function(_0x2fc3b2,_0x1acf79){_0x2fc3b2=_0x2fc3b2-0x0;var _0x35dd1c=_0x41b7[_0x2fc3b2];return _0x35dd1c;};'use strict';var _=require(_0x741b('0x0'));var sequelize=require(_0x741b('0x1'));var moment=require(_0x741b('0x2'));var LIMIT_VALUE=0xfa;exports[_0x741b('0x3')]=function(_0x471d15){var _0x1fb401=null;if(_0x471d15){_0x1fb401=_0x471d15[_0x741b('0x4')](',');}return _0x1fb401;};exports[_0x741b('0x5')]=function(_0x58f416,_0x1d60cf){var _0x36deed={};if(!_[_0x741b('0x6')](_0x58f416)){_[_0x741b('0x7')](_0x58f416,function(_0x354e8b,_0x13f210){try{if(_0x1d60cf){var _0x2f5077=_[_0x741b('0x8')](_0x1d60cf,{'name':_0x13f210})||{};if(_0x2f5077['type']===_0x741b('0x9')&&_[_0x741b('0xa')](_0x354e8b)){var _0x26dbb8=JSON[_0x741b('0xb')](_0x354e8b);var _0x38a7fa={'$gte':moment(moment(_0x26dbb8[_0x741b('0xc')])[_0x741b('0xd')](_0x741b('0xe')))[_0x741b('0xf')]()['format'](),'$lte':moment(moment(_0x26dbb8[_0x741b('0x10')])[_0x741b('0xd')](_0x741b('0xe')))['utc']()[_0x741b('0x11')](0x1,'s')['format']()};_0x36deed[_0x13f210]=_0x38a7fa;}else{_0x36deed[_0x13f210]=_[_0x741b('0x12')](_0x354e8b)?_0x354e8b:JSON[_0x741b('0xb')](_0x354e8b);}}else{_0x36deed[_0x13f210]=_[_0x741b('0x12')](_0x354e8b)?_0x354e8b:JSON[_0x741b('0xb')](_0x354e8b);}}catch(_0x5eb29d){_0x36deed[_0x13f210]=_0x354e8b[_0x741b('0x4')](',');}});}return _0x36deed;};exports[_0x741b('0x13')]=function(_0x4b8fc6){_0x4b8fc6=parseInt(_0x4b8fc6,0xa);if(!_0x4b8fc6||_0x4b8fc6<0x0){_0x4b8fc6=LIMIT_VALUE;}return _0x4b8fc6;};exports[_0x741b('0x14')]=function(_0x44fe67){_0x44fe67=parseInt(_0x44fe67,0xa);if(!_0x44fe67||_0x44fe67<0x0){_0x44fe67=0x0;}return _0x44fe67;};exports['sort']=function(_0x1a6906){var _0x4f20f0,_0x5812d0=null;if(_0x1a6906){_0x4f20f0=_0x1a6906[_0x741b('0x4')](',');_0x5812d0=_[_0x741b('0x15')](_0x4f20f0,function(_0x179e1c){if(_0x179e1c[_0x741b('0x16')]('-')===0x0){return[_0x179e1c===_0x741b('0x17')?sequelize[_0x741b('0x18')](sequelize[_0x741b('0x19')](_0x741b('0x17')),_0x741b('0x1a')):_0x179e1c['substr'](0x1),_0x741b('0x1b')];}else{return[_0x179e1c===_0x741b('0x17')?sequelize['cast'](sequelize[_0x741b('0x19')](_0x741b('0x17')),_0x741b('0x1a')):_0x179e1c,_0x741b('0x1c')];}});}return _0x5812d0;};exports['omit']=function(_0x5f54b9,_0x4f7fb7){if(_['isEmpty'](_0x5f54b9)){return _0x5f54b9;}if(_['isArray'](_0x5f54b9)){for(var _0x52d578=0x0;_0x52d578<_0x5f54b9[_0x741b('0x1d')];_0x52d578+=0x1){_0x5f54b9[_0x52d578]=this[_0x741b('0x1e')](_0x5f54b9[_0x52d578],_0x4f7fb7);}return _0x5f54b9;}if(!_[_0x741b('0x1f')](_0x5f54b9)){return _0x5f54b9;}if(_[_0x741b('0x20')](_0x4f7fb7)){_0x4f7fb7=[_0x4f7fb7];}if(!_['isArray'](_0x4f7fb7)){return _0x5f54b9;}for(var _0x157534=0x0;_0x157534<_0x4f7fb7['length'];_0x157534+=0x1){_[_0x741b('0x21')](_0x5f54b9,_0x4f7fb7[_0x157534]);}for(var _0x3c14d9 in _0x5f54b9){if(_0x5f54b9[_0x741b('0x22')](_0x3c14d9)){_0x5f54b9[_0x3c14d9]=this[_0x741b('0x1e')](_0x5f54b9[_0x3c14d9],_0x4f7fb7);}}return _0x5f54b9;};exports[_0x741b('0x23')]=function(_0x399007){return _0x399007[_0x741b('0x24')](RegExp('^[0-9]*$'))?!![]:![];};exports[_0x741b('0x25')]=function(_0xec3f64){return _0xec3f64[_0x741b('0x24')](/^\S+@\S+$/)?!![]:![];};exports['getFullTextValue']=function(_0x5e16b1){var _0x3ccae9=[];_0x5e16b1['split']('\x20')[_0x741b('0x26')](function(_0x22e4cd){_0x3ccae9['push']('+'+_0x22e4cd['toString']()+'*');});return _0x3ccae9[_0x741b('0x27')]('\x20');};
\ No newline at end of file
+var _0xdb84=['priority','unsigned','DESC','col','ASC','omit','isArray','length','unset','^[0-9]*$','isEmail','match','getFullTextValue','forEach','toString','join','sequelize','moment','split','filters','isEmpty','forOwn','find','type','DATE','parse','$gte','format','YYYY-MM-DD','utc','$lte','subtract','limit','offset','sort','map','indexOf','cast'];(function(_0x5cdf3c,_0x896c88){var _0x58757f=function(_0x36684a){while(--_0x36684a){_0x5cdf3c['push'](_0x5cdf3c['shift']());}};_0x58757f(++_0x896c88);}(_0xdb84,0xa8));var _0x4db8=function(_0x28391f,_0x4b8ca0){_0x28391f=_0x28391f-0x0;var _0x46e332=_0xdb84[_0x28391f];return _0x46e332;};'use strict';var _=require('lodash');var sequelize=require(_0x4db8('0x0'));var moment=require(_0x4db8('0x1'));var LIMIT_VALUE=0xfa;exports['fields']=function(_0xb46fee){var _0x30e72d=null;if(_0xb46fee){_0x30e72d=_0xb46fee[_0x4db8('0x2')](',');}return _0x30e72d;};exports[_0x4db8('0x3')]=function(_0x44ac53,_0x3c1226){var _0x229794={};if(!_[_0x4db8('0x4')](_0x44ac53)){_[_0x4db8('0x5')](_0x44ac53,function(_0x2962d0,_0x102ff0){try{if(_0x3c1226){var _0x160009=_[_0x4db8('0x6')](_0x3c1226,{'name':_0x102ff0})||{};if(_0x160009[_0x4db8('0x7')]===_0x4db8('0x8')&&_['isPlainObject'](_0x2962d0)){var _0x24bc23=JSON[_0x4db8('0x9')](_0x2962d0);var _0x304e80={'$gte':moment(moment(_0x24bc23[_0x4db8('0xa')])[_0x4db8('0xb')](_0x4db8('0xc')))[_0x4db8('0xd')]()[_0x4db8('0xb')](),'$lte':moment(moment(_0x24bc23[_0x4db8('0xe')])['format'](_0x4db8('0xc')))[_0x4db8('0xd')]()[_0x4db8('0xf')](0x1,'s')[_0x4db8('0xb')]()};_0x229794[_0x102ff0]=_0x304e80;}else{_0x229794[_0x102ff0]=_['isArray'](_0x2962d0)?_0x2962d0:JSON[_0x4db8('0x9')](_0x2962d0);}}else{_0x229794[_0x102ff0]=_['isArray'](_0x2962d0)?_0x2962d0:JSON[_0x4db8('0x9')](_0x2962d0);}}catch(_0x14960d){_0x229794[_0x102ff0]=_0x2962d0[_0x4db8('0x2')](',');}});}return _0x229794;};exports[_0x4db8('0x10')]=function(_0x3c064b){_0x3c064b=parseInt(_0x3c064b,0xa);if(!_0x3c064b||_0x3c064b<0x0){_0x3c064b=LIMIT_VALUE;}return _0x3c064b;};exports[_0x4db8('0x11')]=function(_0x357c4c){_0x357c4c=parseInt(_0x357c4c,0xa);if(!_0x357c4c||_0x357c4c<0x0){_0x357c4c=0x0;}return _0x357c4c;};exports[_0x4db8('0x12')]=function(_0x154c9a){var _0x3c55e9,_0x4d4b61=null;if(_0x154c9a){_0x3c55e9=_0x154c9a['split'](',');_0x4d4b61=_[_0x4db8('0x13')](_0x3c55e9,function(_0x4fbbff){if(_0x4fbbff[_0x4db8('0x14')]('-')===0x0){return[_0x4fbbff==='priority'?sequelize[_0x4db8('0x15')](sequelize['col'](_0x4db8('0x16')),_0x4db8('0x17')):_0x4fbbff['substr'](0x1),_0x4db8('0x18')];}else{return[_0x4fbbff==='priority'?sequelize[_0x4db8('0x15')](sequelize[_0x4db8('0x19')](_0x4db8('0x16')),_0x4db8('0x17')):_0x4fbbff,_0x4db8('0x1a')];}});}return _0x4d4b61;};exports[_0x4db8('0x1b')]=function(_0xe8a81d,_0xece800){if(_[_0x4db8('0x4')](_0xe8a81d)){return _0xe8a81d;}if(_[_0x4db8('0x1c')](_0xe8a81d)){for(var _0x4bb9e4=0x0;_0x4bb9e4<_0xe8a81d['length'];_0x4bb9e4+=0x1){_0xe8a81d[_0x4bb9e4]=this[_0x4db8('0x1b')](_0xe8a81d[_0x4bb9e4],_0xece800);}return _0xe8a81d;}if(!_['isObject'](_0xe8a81d)){return _0xe8a81d;}if(_['isString'](_0xece800)){_0xece800=[_0xece800];}if(!_[_0x4db8('0x1c')](_0xece800)){return _0xe8a81d;}for(var _0x5c9e8a=0x0;_0x5c9e8a<_0xece800[_0x4db8('0x1d')];_0x5c9e8a+=0x1){_[_0x4db8('0x1e')](_0xe8a81d,_0xece800[_0x5c9e8a]);}for(var _0xaaf5ba in _0xe8a81d){if(_0xe8a81d['hasOwnProperty'](_0xaaf5ba)){_0xe8a81d[_0xaaf5ba]=this[_0x4db8('0x1b')](_0xe8a81d[_0xaaf5ba],_0xece800);}}return _0xe8a81d;};exports['isNumeric']=function(_0x4994a9){return _0x4994a9['match'](RegExp(_0x4db8('0x1f')))?!![]:![];};exports[_0x4db8('0x20')]=function(_0x523ef6){return _0x523ef6[_0x4db8('0x21')](/^\S+@\S+$/)?!![]:![];};exports[_0x4db8('0x22')]=function(_0xec5371){var _0x32abb2=[];_0xec5371[_0x4db8('0x2')]('\x20')[_0x4db8('0x23')](function(_0x9e887e){_0x32abb2['push']('+'+_0x9e887e[_0x4db8('0x24')]()+'*');});return _0x32abb2[_0x4db8('0x25')]('\x20');};
\ No newline at end of file
diff --git a/server/config/express.js b/server/config/express.js
index 6bf13be..08f94a4 100644
--- a/server/config/express.js
+++ b/server/config/express.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x58f2=['production','set','appPath','root','client','use','json\x20replacer','toISOString','split','/server/views','engine','ejs','renderFile','view\x20engine','html','urlencoded','50mb','json','initialize','express','serve-favicon','method-override','cookie-parser','errorhandler','passport','cors','moment','./environment','../mysqldb','default','get'];(function(_0x96844e,_0x2bb145){var _0x4f9d58=function(_0x444047){while(--_0x444047){_0x96844e['push'](_0x96844e['shift']());}};_0x4f9d58(++_0x2bb145);}(_0x58f2,0x149));var _0x258f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x58f2[_0x3dd15e];return _0x231fd0;};'use strict';var express=require(_0x258f('0x0'));var favicon=require(_0x258f('0x1'));var bodyParser=require('body-parser');var methodOverride=require(_0x258f('0x2'));var cookieParser=require(_0x258f('0x3'));var errorHandler=require(_0x258f('0x4'));var path=require('path');var passport=require(_0x258f('0x5'));var cors=require(_0x258f('0x6'));var moment=require(_0x258f('0x7'));var config=require(_0x258f('0x8'));var db=require(_0x258f('0x9'))['db'];exports[_0x258f('0xa')]=function(_0x2bb5c6){var _0x753bbc=_0x2bb5c6[_0x258f('0xb')]('env');if(_0x753bbc===_0x258f('0xc')){_0x2bb5c6[_0x258f('0xd')](_0x258f('0xe'),path['join'](config[_0x258f('0xf')],'public'));}if(_0x753bbc==='development'||_0x753bbc==='test'){_0x2bb5c6[_0x258f('0xd')](_0x258f('0xe'),path['join'](config['root'],_0x258f('0x10')));_0x2bb5c6[_0x258f('0x11')](errorHandler());}_0x2bb5c6[_0x258f('0xd')](_0x258f('0x12'),function(_0x51d969,_0x5e8a49){if(this[_0x51d969]instanceof Date){_0x5e8a49=this[_0x51d969][_0x258f('0x13')]()[_0x258f('0x14')]('.')[0x0]+'Z';}return _0x5e8a49;});_0x2bb5c6[_0x258f('0x11')](express['static'](_0x2bb5c6[_0x258f('0xb')](_0x258f('0xe'))));_0x2bb5c6['set']('views',config[_0x258f('0xf')]+_0x258f('0x15'));_0x2bb5c6[_0x258f('0x16')]('html',require(_0x258f('0x17'))[_0x258f('0x18')]);_0x2bb5c6['set'](_0x258f('0x19'),_0x258f('0x1a'));_0x2bb5c6['use'](bodyParser[_0x258f('0x1b')]({'limit':_0x258f('0x1c'),'extended':!![]}));_0x2bb5c6[_0x258f('0x11')](bodyParser[_0x258f('0x1d')]({'limit':'50mb'}));_0x2bb5c6[_0x258f('0x11')](cors());_0x2bb5c6[_0x258f('0x11')](methodOverride());_0x2bb5c6['use'](cookieParser());_0x2bb5c6[_0x258f('0x11')](passport[_0x258f('0x1e')]());};
\ No newline at end of file
+var _0x158d=['cookie-parser','errorhandler','path','passport','cors','moment','./environment','../mysqldb','default','get','env','production','set','appPath','join','root','json\x20replacer','toISOString','split','use','static','views','/server/views','engine','html','ejs','renderFile','urlencoded','50mb','json','initialize','express','body-parser','method-override'];(function(_0x321172,_0x241332){var _0x4046f2=function(_0x7d791c){while(--_0x7d791c){_0x321172['push'](_0x321172['shift']());}};_0x4046f2(++_0x241332);}(_0x158d,0x1b7));var _0xd158=function(_0x1e172a,_0x52102b){_0x1e172a=_0x1e172a-0x0;var _0x96338b=_0x158d[_0x1e172a];return _0x96338b;};'use strict';var express=require(_0xd158('0x0'));var favicon=require('serve-favicon');var bodyParser=require(_0xd158('0x1'));var methodOverride=require(_0xd158('0x2'));var cookieParser=require(_0xd158('0x3'));var errorHandler=require(_0xd158('0x4'));var path=require(_0xd158('0x5'));var passport=require(_0xd158('0x6'));var cors=require(_0xd158('0x7'));var moment=require(_0xd158('0x8'));var config=require(_0xd158('0x9'));var db=require(_0xd158('0xa'))['db'];exports[_0xd158('0xb')]=function(_0x3f79f8){var _0x254d86=_0x3f79f8[_0xd158('0xc')](_0xd158('0xd'));if(_0x254d86===_0xd158('0xe')){_0x3f79f8[_0xd158('0xf')](_0xd158('0x10'),path[_0xd158('0x11')](config[_0xd158('0x12')],'public'));}if(_0x254d86==='development'||_0x254d86==='test'){_0x3f79f8[_0xd158('0xf')](_0xd158('0x10'),path[_0xd158('0x11')](config[_0xd158('0x12')],'client'));_0x3f79f8['use'](errorHandler());}_0x3f79f8[_0xd158('0xf')](_0xd158('0x13'),function(_0x508867,_0x1c0eef){if(this[_0x508867]instanceof Date){_0x1c0eef=this[_0x508867][_0xd158('0x14')]()[_0xd158('0x15')]('.')[0x0]+'Z';}return _0x1c0eef;});_0x3f79f8[_0xd158('0x16')](express[_0xd158('0x17')](_0x3f79f8['get']('appPath')));_0x3f79f8[_0xd158('0xf')](_0xd158('0x18'),config['root']+_0xd158('0x19'));_0x3f79f8[_0xd158('0x1a')](_0xd158('0x1b'),require(_0xd158('0x1c'))[_0xd158('0x1d')]);_0x3f79f8['set']('view\x20engine',_0xd158('0x1b'));_0x3f79f8[_0xd158('0x16')](bodyParser[_0xd158('0x1e')]({'limit':_0xd158('0x1f'),'extended':!![]}));_0x3f79f8[_0xd158('0x16')](bodyParser[_0xd158('0x20')]({'limit':_0xd158('0x1f')}));_0x3f79f8['use'](cors());_0x3f79f8[_0xd158('0x16')](methodOverride());_0x3f79f8[_0xd158('0x16')](cookieParser());_0x3f79f8[_0xd158('0x16')](passport[_0xd158('0x21')]());};
\ No newline at end of file
diff --git a/server/config/license/hardware.js b/server/config/license/hardware.js
index e347853..7180c5e 100644
--- a/server/config/license/hardware.js
+++ b/server/config/license/hardware.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x10af=['update','digest','hex','platform','utf8','replace','macAddress','ipAddress','substring','lodash','bimedia-machine-uuid','child_process','execSync','networkInterfaces','orderBy','length','family','IPv4','internal','mac','00:00:00:00:00:00','127.0.0.1','map','model','join','createHash','md5'];(function(_0x364b32,_0x4dec35){var _0x3f3ea0=function(_0x1911a8){while(--_0x1911a8){_0x364b32['push'](_0x364b32['shift']());}};_0x3f3ea0(++_0x4dec35);}(_0x10af,0xfc));var _0xf10a=function(_0x5d4607,_0x6b5e7b){_0x5d4607=_0x5d4607-0x0;var _0x5e4a86=_0x10af[_0x5d4607];return _0x5e4a86;};'use strict';var _=require(_0xf10a('0x0'));var os=require('os');var crypto=require('crypto');var machine=require(_0xf10a('0x1'));var exec=require(_0xf10a('0x2'))[_0xf10a('0x3')];function getInterfaces(){var _0x211890=[];var _0x453e1a=os[_0xf10a('0x4')]();var _0xbffc71=_[_0xf10a('0x5')](_['keys'](_0x453e1a));for(var _0x32060a=0x0;_0x32060a<_0xbffc71[_0xf10a('0x6')];_0x32060a++){var _0x5c9a4c=_0x453e1a[_0xbffc71[_0x32060a]]['filter'](function(_0x8c9add){return _0x8c9add[_0xf10a('0x7')]===_0xf10a('0x8')&&_0x8c9add[_0xf10a('0x9')]===![];});_0x211890=_0x211890['concat'](_0x5c9a4c);}return _0x211890;}function getFirstInterface(){var _0x2045aa=_['head'](getInterfaces());return{'macAddress':_0x2045aa&&_0x2045aa[_0xf10a('0xa')]?_0x2045aa['mac']:_0xf10a('0xb'),'ipAddress':_0x2045aa&&_0x2045aa['address']?_0x2045aa['address']:_0xf10a('0xc')};}exports['getFirstInterface']=getFirstInterface;function getCPUhash(){var _0x3558c6=_[_0xf10a('0x5')](os['cpus']()[_0xf10a('0xd')](function(_0x24632c){return _0x24632c[_0xf10a('0xe')];}))[_0xf10a('0xf')](':');return crypto[_0xf10a('0x10')](_0xf10a('0x11'))[_0xf10a('0x12')](_0x3558c6)[_0xf10a('0x13')](_0xf10a('0x14'));}exports['getUuid']=function(){switch(os[_0xf10a('0x15')]()){case'win32':return exec('dmidecode\x20--string\x20system-uuid',{'encoding':_0xf10a('0x16')})[_0xf10a('0x17')]('\x0d\x0a','');default:var _0x484c3a=getFirstInterface();var _0x10fa6f=getCPUhash();var _0x18cb80=_0x10fa6f+'|'+os['hostname']()+'|'+_0x484c3a[_0xf10a('0x18')]+'|'+_0x484c3a[_0xf10a('0x19')];var _0x6f2520=crypto[_0xf10a('0x10')](_0xf10a('0x11'))[_0xf10a('0x12')](_0x18cb80)[_0xf10a('0x13')](_0xf10a('0x14'));return _0x6f2520[_0xf10a('0x1a')](0x0,0x8)+'-'+_0x6f2520[_0xf10a('0x1a')](0x8,0xc)+'-'+_0x6f2520[_0xf10a('0x1a')](0xc,0x10)+'-'+_0x6f2520['substring'](0x10,0x14)+'-'+_0x6f2520[_0xf10a('0x1a')](0x14);}};
\ No newline at end of file
+var _0x304b=['address','127.0.0.1','getFirstInterface','orderBy','map','model','join','md5','update','digest','hex','getUuid','platform','win32','dmidecode\x20--string\x20system-uuid','utf8','replace','macAddress','createHash','substring','crypto','bimedia-machine-uuid','child_process','execSync','networkInterfaces','length','filter','family','IPv4','internal','concat','head','mac'];(function(_0x358e06,_0x11975c){var _0x567433=function(_0x213b48){while(--_0x213b48){_0x358e06['push'](_0x358e06['shift']());}};_0x567433(++_0x11975c);}(_0x304b,0xfb));var _0xb304=function(_0x378689,_0x56d71b){_0x378689=_0x378689-0x0;var _0x48a228=_0x304b[_0x378689];return _0x48a228;};'use strict';var _=require('lodash');var os=require('os');var crypto=require(_0xb304('0x0'));var machine=require(_0xb304('0x1'));var exec=require(_0xb304('0x2'))[_0xb304('0x3')];function getInterfaces(){var _0x2c36b9=[];var _0x1a54ea=os[_0xb304('0x4')]();var _0xedd10a=_['orderBy'](_['keys'](_0x1a54ea));for(var _0x110d34=0x0;_0x110d34<_0xedd10a[_0xb304('0x5')];_0x110d34++){var _0x1eef78=_0x1a54ea[_0xedd10a[_0x110d34]][_0xb304('0x6')](function(_0x177964){return _0x177964[_0xb304('0x7')]===_0xb304('0x8')&&_0x177964[_0xb304('0x9')]===![];});_0x2c36b9=_0x2c36b9[_0xb304('0xa')](_0x1eef78);}return _0x2c36b9;}function getFirstInterface(){var _0x5138c5=_[_0xb304('0xb')](getInterfaces());return{'macAddress':_0x5138c5&&_0x5138c5[_0xb304('0xc')]?_0x5138c5[_0xb304('0xc')]:'00:00:00:00:00:00','ipAddress':_0x5138c5&&_0x5138c5[_0xb304('0xd')]?_0x5138c5[_0xb304('0xd')]:_0xb304('0xe')};}exports[_0xb304('0xf')]=getFirstInterface;function getCPUhash(){var _0x387851=_[_0xb304('0x10')](os['cpus']()[_0xb304('0x11')](function(_0x1f4ddb){return _0x1f4ddb[_0xb304('0x12')];}))[_0xb304('0x13')](':');return crypto['createHash'](_0xb304('0x14'))[_0xb304('0x15')](_0x387851)[_0xb304('0x16')](_0xb304('0x17'));}exports[_0xb304('0x18')]=function(){switch(os[_0xb304('0x19')]()){case _0xb304('0x1a'):return exec(_0xb304('0x1b'),{'encoding':_0xb304('0x1c')})[_0xb304('0x1d')]('\x0d\x0a','');default:var _0x3d20b5=getFirstInterface();var _0x3be8cb=getCPUhash();var _0x1252cb=_0x3be8cb+'|'+os['hostname']()+'|'+_0x3d20b5[_0xb304('0x1e')]+'|'+_0x3d20b5['ipAddress'];var _0x522fca=crypto[_0xb304('0x1f')](_0xb304('0x14'))[_0xb304('0x15')](_0x1252cb)[_0xb304('0x16')](_0xb304('0x17'));return _0x522fca['substring'](0x0,0x8)+'-'+_0x522fca[_0xb304('0x20')](0x8,0xc)+'-'+_0x522fca['substring'](0xc,0x10)+'-'+_0x522fca[_0xb304('0x20')](0x10,0x14)+'-'+_0x522fca[_0xb304('0x20')](0x14);}};
\ No newline at end of file
diff --git a/server/config/license/index.js b/server/config/license/index.js
index c94e71b..2b81fd1 100644
--- a/server/config/license/index.js
+++ b/server/config/license/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x082a=['base64','createDecipher','aes-256-ctr','||FIELD||VALUE||\x0a','findOne','admin','email','|reason|','|machineUuid|','fullname','|email|','ipAddress','openIssue','MOTLICENSE','Motion\x20License\x20Alert','Alert','get','active','data2','info','THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED','THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED','Changed','data1','NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s','uuid','%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s','toUpperCase','YYYY-MM-DD\x20HH:mm','diff','DEMO\x20START\x20AT\x20%s','message','finally','getUuid','License','findOrCreate','SERVICE\x20LICENSE\x20STARTED\x20%s','catch','error','default','crypto','moment','request-promise','pkginfo','version','../../mysqldb','../environment','./hardware','license','https://www.xcallymotion.com','format','exports','%s/api/servers/%s/check?version=%s&oldtoken=%s','GET','then','createCipher','secrets','session','update','utf8'];(function(_0x322cbd,_0x36095c){var _0x8db788=function(_0x124ce1){while(--_0x124ce1){_0x322cbd['push'](_0x322cbd['shift']());}};_0x8db788(++_0x36095c);}(_0x082a,0x154));var _0xa082=function(_0x24597e,_0x4dd50b){_0x24597e=_0x24597e-0x0;var _0x31312c=_0x082a[_0x24597e];return _0x31312c;};'use strict';var util=require('util');var crypto=require(_0xa082('0x0'));var moment=require(_0xa082('0x1'));var rp=require(_0xa082('0x2'));var BPromise=require('bluebird');var pkginfo=require(_0xa082('0x3'))(module,_0xa082('0x4'));var db=require(_0xa082('0x5'))['db'];var config=require(_0xa082('0x6'));var hardware=require(_0xa082('0x7'));var logger=require('../logger')(_0xa082('0x8'));var jira=require('../../api/jira/jira.controller');var HOST=_0xa082('0x9');var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var ADMIN;var oldToken;function httpRequest(_0x41030c){return new BPromise(function(_0x5ae561,_0x31c98d){var _0x193550=util[_0xa082('0xa')]('%s/api/servers/%s/check?version=%s',HOST,_0x41030c,module[_0xa082('0xb')][_0xa082('0x4')]);if(oldToken){_0x193550=util[_0xa082('0xa')](_0xa082('0xc'),HOST,_0x41030c,module[_0xa082('0xb')]['version'],oldToken);}var _0x1fcf69={'uri':_0x193550,'method':_0xa082('0xd'),'timeout':0xea60,'json':!![]};return rp(_0x1fcf69)[_0xa082('0xe')](function(_0x5798dc){_0x5ae561(_0x5798dc);})['catch'](function(_0x21cf44){_0x31c98d(_0x21cf44);});});}function encryptDate(_0x18d742){var _0x473b1d=crypto[_0xa082('0xf')]('aes-256-ctr',config[_0xa082('0x10')][_0xa082('0x11')]);var _0xe0276=_0x473b1d[_0xa082('0x12')](_0x18d742,_0xa082('0x13'),_0xa082('0x14'));_0xe0276+=_0x473b1d['final'](_0xa082('0x14'));return _0xe0276;}function decryptDate(_0x1eb38a){var _0x5cce12=crypto[_0xa082('0x15')](_0xa082('0x16'),config[_0xa082('0x10')][_0xa082('0x11')]);var _0x507d9c=_0x5cce12['update'](_0x1eb38a,_0xa082('0x14'),_0xa082('0x13'));_0x507d9c+=_0x5cce12['final'](_0xa082('0x13'));return _0x507d9c;}function sendJiraAlert(_0x536ffa,_0xeaa1ce,_0x284376){var _0x127b29=_0xa082('0x17');return db['User'][_0xa082('0x18')]({'where':{'role':_0xa082('0x19')},'attributes':['fullname',_0xa082('0x1a')],'raw':!![]})[_0xa082('0xe')](function(_0x417943){ADMIN=_0x417943;_0x127b29+=_0xa082('0x1b')+_0x284376+'|\x0a';_0x127b29+='|uuid|'+_0x536ffa+'|\x0a';_0x127b29+=_0xa082('0x1c')+_0xeaa1ce+'|\x0a';_0x127b29+='|name|'+ADMIN[_0xa082('0x1d')]+'|\x0a';_0x127b29+=_0xa082('0x1e')+ADMIN['email']+'|\x0a';return _0x127b29;})[_0xa082('0xe')](function(_0x1c1575){var _0x4fdc57=hardware['getFirstInterface']()[_0xa082('0x1f')];return jira[_0xa082('0x20')]({'key':_0xa082('0x21'),'summary':_0xa082('0x22'),'description':_0x1c1575,'issuetype':_0xa082('0x23'),'oldToken':_0x536ffa,'newToken':_0xeaa1ce,'email':ADMIN[_0xa082('0x1a')],'name':ADMIN[_0xa082('0x1d')],'reason':GRAY_PERIOD_REASON,'ip':_0x4fdc57});});}function manageLicense(_0x457ca9,_0x273812){var _0x388b1e=_0x273812[_0xa082('0x24')]({'plain':!![]});httpRequest(_0x457ca9)[_0xa082('0xe')](function(_0x3032d2){if(oldToken){oldToken=undefined;}if(_0x3032d2[_0xa082('0x25')]){if(!_0x388b1e[_0xa082('0x8')]&&_0x388b1e[_0xa082('0x8')]!=_0x3032d2[_0xa082('0x8')]||_0x388b1e[_0xa082('0x8')]&&_0x388b1e[_0xa082('0x26')]){logger[_0xa082('0x27')](_0xa082('0x28'));}if(_0x388b1e[_0xa082('0x8')]&&!_0x388b1e[_0xa082('0x26')]&&_0x388b1e[_0xa082('0x8')]!=_0x3032d2[_0xa082('0x8')]){logger[_0xa082('0x27')]('THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED');}if(_0x388b1e[_0xa082('0x8')]&&!_0x388b1e[_0xa082('0x26')]&&_0x388b1e[_0xa082('0x8')]==_0x3032d2[_0xa082('0x8')]){return _0x273812;}return _0x273812[_0xa082('0x12')]({'data1':_0x457ca9,'data2':null,'license':_0x3032d2['license']});}else{if(_0x3032d2[_0xa082('0x8')]||_0x388b1e[_0xa082('0x8')]){if(!_0x388b1e['data2']){if(_0x388b1e['data1']==_0x457ca9){GRAY_PERIOD_REASON='Disabled';logger[_0xa082('0x27')](_0xa082('0x29'));}else{GRAY_PERIOD_REASON=_0xa082('0x2a');oldToken=_0x388b1e[_0xa082('0x2b')];logger[_0xa082('0x27')](_0xa082('0x2c'),_0x388b1e[_0xa082('0x2b')],_0x457ca9);}sendJiraAlert(_0x388b1e[_0xa082('0x2b')],_0x3032d2[_0xa082('0x2d')],GRAY_PERIOD_REASON);logger[_0xa082('0x27')](_0xa082('0x2e'),GRAY_PERIOD_REASON[_0xa082('0x2f')](),moment()[_0xa082('0xa')]('YYYY-MM-DD\x20HH:mm'));return _0x273812['update']({'data2':encryptDate(moment()['format'](_0xa082('0x30')))});}else{if(moment()[_0xa082('0x31')](decryptDate(_0x388b1e[_0xa082('0x26')]),'days')>DAYS){logger['info'](_0xa082('0x32'),moment()[_0xa082('0xa')](_0xa082('0x30')));return _0x273812['update']({'data1':_0x457ca9,'data2':null,'license':null});}}}else{if(_0x388b1e[_0xa082('0x2b')]!=_0x457ca9){logger['info'](_0xa082('0x2c'),_0x388b1e[_0xa082('0x2b')],_0x457ca9);return _0x273812['update']({'data1':_0x457ca9,'data2':null,'license':null});}}}return _0x273812;})[_0xa082('0xe')](function(_0x2e3c3c){_0x273812=_0x2e3c3c;})['catch'](function(_0xa14d14){logger['error'](_0xa14d14[_0xa082('0x33')]);})[_0xa082('0x34')](function(){setTimeout(function(){manageLicense(hardware[_0xa082('0x35')](),_0x273812);},TIME);});}function defaultLicense(){var _0x3fbfdd=hardware[_0xa082('0x35')]();if(_0x3fbfdd){return db[_0xa082('0x36')][_0xa082('0x37')]({'where':{'id':0x1},'defaults':{'data1':_0x3fbfdd}})['spread'](function(_0xa942c9,_0x182f82){logger[_0xa082('0x27')](_0xa082('0x38'),_0x3fbfdd);manageLicense(_0x3fbfdd,_0xa942c9);})[_0xa082('0x39')](function(_0x1a2286){logger[_0xa082('0x3a')](_0x1a2286['message']);});}}exports[_0xa082('0x3b')]=defaultLicense;
\ No newline at end of file
+var _0xf3e2=['update','utf8','||FIELD||VALUE||\x0a','User','findOne','admin','fullname','email','|reason|','|uuid|','|machineUuid|','|name|','|email|','getFirstInterface','openIssue','MOTLICENSE','Alert','get','active','info','data2','data1','Disabled','THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED','Changed','NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s','uuid','%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s','YYYY-MM-DD\x20HH:mm','diff','days','DEMO\x20START\x20AT\x20%s','finally','getUuid','License','findOrCreate','spread','SERVICE\x20LICENSE\x20STARTED\x20%s','error','message','util','crypto','moment','request-promise','bluebird','pkginfo','version','../../mysqldb','./hardware','license','../../api/jira/jira.controller','https://www.xcallymotion.com','format','exports','%s/api/servers/%s/check?version=%s&oldtoken=%s','GET','then','catch','aes-256-ctr','session','base64','final','createDecipher','secrets'];(function(_0x4cf98e,_0xba4b79){var _0x1623ac=function(_0x459bc0){while(--_0x459bc0){_0x4cf98e['push'](_0x4cf98e['shift']());}};_0x1623ac(++_0xba4b79);}(_0xf3e2,0x168));var _0x2f3e=function(_0x575446,_0x1a13fa){_0x575446=_0x575446-0x0;var _0x2fb644=_0xf3e2[_0x575446];return _0x2fb644;};'use strict';var util=require(_0x2f3e('0x0'));var crypto=require(_0x2f3e('0x1'));var moment=require(_0x2f3e('0x2'));var rp=require(_0x2f3e('0x3'));var BPromise=require(_0x2f3e('0x4'));var pkginfo=require(_0x2f3e('0x5'))(module,_0x2f3e('0x6'));var db=require(_0x2f3e('0x7'))['db'];var config=require('../environment');var hardware=require(_0x2f3e('0x8'));var logger=require('../logger')(_0x2f3e('0x9'));var jira=require(_0x2f3e('0xa'));var HOST=_0x2f3e('0xb');var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var ADMIN;var oldToken;function httpRequest(_0x392f91){return new BPromise(function(_0x3b556b,_0x1ac142){var _0x30f939=util[_0x2f3e('0xc')]('%s/api/servers/%s/check?version=%s',HOST,_0x392f91,module[_0x2f3e('0xd')]['version']);if(oldToken){_0x30f939=util[_0x2f3e('0xc')](_0x2f3e('0xe'),HOST,_0x392f91,module[_0x2f3e('0xd')][_0x2f3e('0x6')],oldToken);}var _0x412819={'uri':_0x30f939,'method':_0x2f3e('0xf'),'timeout':0xea60,'json':!![]};return rp(_0x412819)[_0x2f3e('0x10')](function(_0x3a797f){_0x3b556b(_0x3a797f);})[_0x2f3e('0x11')](function(_0x14c0bd){_0x1ac142(_0x14c0bd);});});}function encryptDate(_0x1a7596){var _0x105ea6=crypto['createCipher'](_0x2f3e('0x12'),config['secrets'][_0x2f3e('0x13')]);var _0x1b2c62=_0x105ea6['update'](_0x1a7596,'utf8',_0x2f3e('0x14'));_0x1b2c62+=_0x105ea6[_0x2f3e('0x15')](_0x2f3e('0x14'));return _0x1b2c62;}function decryptDate(_0x14a2a1){var _0x38ac85=crypto[_0x2f3e('0x16')]('aes-256-ctr',config[_0x2f3e('0x17')][_0x2f3e('0x13')]);var _0x15398d=_0x38ac85[_0x2f3e('0x18')](_0x14a2a1,'base64',_0x2f3e('0x19'));_0x15398d+=_0x38ac85['final'](_0x2f3e('0x19'));return _0x15398d;}function sendJiraAlert(_0x452bd8,_0x64f096,_0x27eff9){var _0x74d2a1=_0x2f3e('0x1a');return db[_0x2f3e('0x1b')][_0x2f3e('0x1c')]({'where':{'role':_0x2f3e('0x1d')},'attributes':[_0x2f3e('0x1e'),_0x2f3e('0x1f')],'raw':!![]})[_0x2f3e('0x10')](function(_0x34ee59){ADMIN=_0x34ee59;_0x74d2a1+=_0x2f3e('0x20')+_0x27eff9+'|\x0a';_0x74d2a1+=_0x2f3e('0x21')+_0x452bd8+'|\x0a';_0x74d2a1+=_0x2f3e('0x22')+_0x64f096+'|\x0a';_0x74d2a1+=_0x2f3e('0x23')+ADMIN[_0x2f3e('0x1e')]+'|\x0a';_0x74d2a1+=_0x2f3e('0x24')+ADMIN[_0x2f3e('0x1f')]+'|\x0a';return _0x74d2a1;})[_0x2f3e('0x10')](function(_0x3bd446){var _0x16c8fc=hardware[_0x2f3e('0x25')]()['ipAddress'];return jira[_0x2f3e('0x26')]({'key':_0x2f3e('0x27'),'summary':'Motion\x20License\x20Alert','description':_0x3bd446,'issuetype':_0x2f3e('0x28'),'oldToken':_0x452bd8,'newToken':_0x64f096,'email':ADMIN[_0x2f3e('0x1f')],'name':ADMIN[_0x2f3e('0x1e')],'reason':GRAY_PERIOD_REASON,'ip':_0x16c8fc});});}function manageLicense(_0x6a2c1f,_0x59231b){var _0x5e8389=_0x59231b[_0x2f3e('0x29')]({'plain':!![]});httpRequest(_0x6a2c1f)[_0x2f3e('0x10')](function(_0x3f9976){if(oldToken){oldToken=undefined;}if(_0x3f9976[_0x2f3e('0x2a')]){if(!_0x5e8389[_0x2f3e('0x9')]&&_0x5e8389['license']!=_0x3f9976[_0x2f3e('0x9')]||_0x5e8389['license']&&_0x5e8389['data2']){logger[_0x2f3e('0x2b')]('THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED');}if(_0x5e8389[_0x2f3e('0x9')]&&!_0x5e8389['data2']&&_0x5e8389['license']!=_0x3f9976[_0x2f3e('0x9')]){logger[_0x2f3e('0x2b')]('THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED');}if(_0x5e8389[_0x2f3e('0x9')]&&!_0x5e8389[_0x2f3e('0x2c')]&&_0x5e8389[_0x2f3e('0x9')]==_0x3f9976[_0x2f3e('0x9')]){return _0x59231b;}return _0x59231b[_0x2f3e('0x18')]({'data1':_0x6a2c1f,'data2':null,'license':_0x3f9976['license']});}else{if(_0x3f9976[_0x2f3e('0x9')]||_0x5e8389[_0x2f3e('0x9')]){if(!_0x5e8389['data2']){if(_0x5e8389[_0x2f3e('0x2d')]==_0x6a2c1f){GRAY_PERIOD_REASON=_0x2f3e('0x2e');logger[_0x2f3e('0x2b')](_0x2f3e('0x2f'));}else{GRAY_PERIOD_REASON=_0x2f3e('0x30');oldToken=_0x5e8389['data1'];logger['info'](_0x2f3e('0x31'),_0x5e8389[_0x2f3e('0x2d')],_0x6a2c1f);}sendJiraAlert(_0x5e8389[_0x2f3e('0x2d')],_0x3f9976[_0x2f3e('0x32')],GRAY_PERIOD_REASON);logger[_0x2f3e('0x2b')](_0x2f3e('0x33'),GRAY_PERIOD_REASON['toUpperCase'](),moment()[_0x2f3e('0xc')]('YYYY-MM-DD\x20HH:mm'));return _0x59231b[_0x2f3e('0x18')]({'data2':encryptDate(moment()[_0x2f3e('0xc')](_0x2f3e('0x34')))});}else{if(moment()[_0x2f3e('0x35')](decryptDate(_0x5e8389[_0x2f3e('0x2c')]),_0x2f3e('0x36'))>DAYS){logger[_0x2f3e('0x2b')](_0x2f3e('0x37'),moment()['format'](_0x2f3e('0x34')));return _0x59231b[_0x2f3e('0x18')]({'data1':_0x6a2c1f,'data2':null,'license':null});}}}else{if(_0x5e8389['data1']!=_0x6a2c1f){logger[_0x2f3e('0x2b')]('NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s',_0x5e8389['data1'],_0x6a2c1f);return _0x59231b[_0x2f3e('0x18')]({'data1':_0x6a2c1f,'data2':null,'license':null});}}}return _0x59231b;})[_0x2f3e('0x10')](function(_0x5a2c64){_0x59231b=_0x5a2c64;})[_0x2f3e('0x11')](function(_0x463601){logger['error'](_0x463601['message']);})[_0x2f3e('0x38')](function(){setTimeout(function(){manageLicense(hardware[_0x2f3e('0x39')](),_0x59231b);},TIME);});}function defaultLicense(){var _0x2bf355=hardware[_0x2f3e('0x39')]();if(_0x2bf355){return db[_0x2f3e('0x3a')][_0x2f3e('0x3b')]({'where':{'id':0x1},'defaults':{'data1':_0x2bf355}})[_0x2f3e('0x3c')](function(_0x170136,_0x903b29){logger[_0x2f3e('0x2b')](_0x2f3e('0x3d'),_0x2bf355);manageLicense(_0x2bf355,_0x170136);})[_0x2f3e('0x11')](function(_0x376c17){logger[_0x2f3e('0x3e')](_0x376c17[_0x2f3e('0x3f')]);});}}exports['default']=defaultLicense;
\ No newline at end of file
diff --git a/server/config/license/util.js b/server/config/license/util.js
index f2cdbd2..ac574d2 100644
--- a/server/config/license/util.js
+++ b/server/config/license/util.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x970d=['base64','final','utf8','demo','uuid','machineUuid','getUuid','secrets','session','gray','add','days','grayReason','disabled','2027-01-01T00:00:00.000Z','Breaking\x20license','message','Demo\x20license','License','find','then','checkLicense','crypto','util','lodash','moment','./hardware','../environment','../../mysqldb','license','isEmpty','License\x20key\x20value\x20not\x20found','data1','data2','split','aes-256-ctr','format','%s:%s:%s','update'];(function(_0x126558,_0x143c9a){var _0x1f6d14=function(_0x2b0eea){while(--_0x2b0eea){_0x126558['push'](_0x126558['shift']());}};_0x1f6d14(++_0x143c9a);}(_0x970d,0x14e));var _0xd970=function(_0xf66a25,_0x527689){_0xf66a25=_0xf66a25-0x0;var _0x231422=_0x970d[_0xf66a25];return _0x231422;};'use strict';var crypto=require(_0xd970('0x0'));var util=require(_0xd970('0x1'));var _=require(_0xd970('0x2'));var moment=require(_0xd970('0x3'));var hardware=require(_0xd970('0x4'));var config=require(_0xd970('0x5'));var db=require(_0xd970('0x6'))['db'];function checkLicense(_0x469e97,_0x42f35d){if(_0x469e97){try{var _0x4dad70=_0x42f35d||_0x469e97[_0xd970('0x7')];if(_[_0xd970('0x8')](_0x4dad70)){throw new Error(_0xd970('0x9'));}var _0x220b73=_0x469e97[_0xd970('0xa')];var _0x5e4d09=_0x469e97[_0xd970('0xb')];var _0x3f529a=_0x220b73[_0xd970('0xc')]('-')[0x4];var _0x58ccf7=_0x220b73[_0xd970('0xc')]('-')[0x0];var _0x34317e=crypto['createDecipher'](_0xd970('0xd'),util[_0xd970('0xe')](_0xd970('0xf'),_0x3f529a,_0x220b73,_0x58ccf7));var _0x3b176a=_0x34317e[_0xd970('0x10')](_0x4dad70,_0xd970('0x11'),'utf8');_0x3b176a+=_0x34317e[_0xd970('0x12')](_0xd970('0x13'));var _0x2534f4=JSON['parse'](_0x3b176a);_0x2534f4[_0xd970('0x14')]=![];_0x2534f4[_0xd970('0x15')]=_0x220b73;_0x2534f4[_0xd970('0x16')]=hardware[_0xd970('0x17')]();if(_0x5e4d09){var _0x4fcccf=crypto['createDecipher'](_0xd970('0xd'),config[_0xd970('0x18')][_0xd970('0x19')]);var _0xaca945=_0x4fcccf[_0xd970('0x10')](_0x5e4d09,_0xd970('0x11'),_0xd970('0x13'));_0xaca945+=_0x4fcccf[_0xd970('0x12')]('utf8');_0x2534f4[_0xd970('0x1a')]=_0xaca945;_0x2534f4['deadline']=moment(_0xaca945)[_0xd970('0x1b')](0x7,_0xd970('0x1c'))['format']();_0x2534f4[_0xd970('0x1d')]=_0x2534f4[_0xd970('0x15')]!=_0x2534f4[_0xd970('0x16')]?'changed':_0xd970('0x1e');}return _0x2534f4;}catch(_0x32f52e){return{'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0xd970('0x1f'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':_0xd970('0x20'),'uuid':_0x469e97[_0xd970('0xa')],'machineUuid':hardware['getUuid'](),'message':_0x32f52e[_0xd970('0x21')],'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};}}return{'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0xd970('0x1f'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':_0xd970('0x22'),'uuid':_0x469e97['data1'],'machineUuid':hardware[_0xd970('0x17')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};}exports['getLicense']=function(_0x5c32a7){return db[_0xd970('0x23')][_0xd970('0x24')](_['defaults'](_0x5c32a7,{'raw':!![],'where':{'id':0x1}}))[_0xd970('0x25')](function(_0x5fce43){return checkLicense(_0x5fce43,null);});};exports[_0xd970('0x26')]=checkLicense;
\ No newline at end of file
+var _0xad47=['getUuid','secrets','session','utf8','deadline','add','days','grayReason','changed','disabled','2027-01-01T00:00:00.000Z','Breaking\x20license','data1','message','License','find','checkLicense','crypto','util','lodash','moment','./hardware','../environment','../../mysqldb','license','isEmpty','License\x20key\x20value\x20not\x20found','data2','createDecipher','aes-256-ctr','format','%s:%s:%s','update','base64','final','parse','demo','uuid','machineUuid'];(function(_0x19a5fa,_0x2b2004){var _0x2c158d=function(_0x1fc843){while(--_0x1fc843){_0x19a5fa['push'](_0x19a5fa['shift']());}};_0x2c158d(++_0x2b2004);}(_0xad47,0xad));var _0x7ad4=function(_0x3203a1,_0x46c498){_0x3203a1=_0x3203a1-0x0;var _0x24215e=_0xad47[_0x3203a1];return _0x24215e;};'use strict';var crypto=require(_0x7ad4('0x0'));var util=require(_0x7ad4('0x1'));var _=require(_0x7ad4('0x2'));var moment=require(_0x7ad4('0x3'));var hardware=require(_0x7ad4('0x4'));var config=require(_0x7ad4('0x5'));var db=require(_0x7ad4('0x6'))['db'];function checkLicense(_0xf2ae45,_0x305628){if(_0xf2ae45){try{var _0x220c04=_0x305628||_0xf2ae45[_0x7ad4('0x7')];if(_[_0x7ad4('0x8')](_0x220c04)){throw new Error(_0x7ad4('0x9'));}var _0x1f969d=_0xf2ae45['data1'];var _0x3952e2=_0xf2ae45[_0x7ad4('0xa')];var _0x294578=_0x1f969d['split']('-')[0x4];var _0x3989b7=_0x1f969d['split']('-')[0x0];var _0x16989e=crypto[_0x7ad4('0xb')](_0x7ad4('0xc'),util[_0x7ad4('0xd')](_0x7ad4('0xe'),_0x294578,_0x1f969d,_0x3989b7));var _0x5d618d=_0x16989e[_0x7ad4('0xf')](_0x220c04,_0x7ad4('0x10'),'utf8');_0x5d618d+=_0x16989e[_0x7ad4('0x11')]('utf8');var _0x2414bf=JSON[_0x7ad4('0x12')](_0x5d618d);_0x2414bf[_0x7ad4('0x13')]=![];_0x2414bf[_0x7ad4('0x14')]=_0x1f969d;_0x2414bf[_0x7ad4('0x15')]=hardware[_0x7ad4('0x16')]();if(_0x3952e2){var _0x4ac13b=crypto[_0x7ad4('0xb')]('aes-256-ctr',config[_0x7ad4('0x17')][_0x7ad4('0x18')]);var _0xa1a9ba=_0x4ac13b['update'](_0x3952e2,_0x7ad4('0x10'),_0x7ad4('0x19'));_0xa1a9ba+=_0x4ac13b['final'](_0x7ad4('0x19'));_0x2414bf['gray']=_0xa1a9ba;_0x2414bf[_0x7ad4('0x1a')]=moment(_0xa1a9ba)[_0x7ad4('0x1b')](0x7,_0x7ad4('0x1c'))[_0x7ad4('0xd')]();_0x2414bf[_0x7ad4('0x1d')]=_0x2414bf[_0x7ad4('0x14')]!=_0x2414bf[_0x7ad4('0x15')]?_0x7ad4('0x1e'):_0x7ad4('0x1f');}return _0x2414bf;}catch(_0x4d5b61){return{'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x7ad4('0x20'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':_0x7ad4('0x21'),'uuid':_0xf2ae45[_0x7ad4('0x22')],'machineUuid':hardware['getUuid'](),'message':_0x4d5b61[_0x7ad4('0x23')],'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};}}return{'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':'2027-01-01T00:00:00.000Z','chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':'Demo\x20license','uuid':_0xf2ae45[_0x7ad4('0x22')],'machineUuid':hardware[_0x7ad4('0x16')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};}exports['getLicense']=function(_0x5006ee){return db[_0x7ad4('0x24')][_0x7ad4('0x25')](_['defaults'](_0x5006ee,{'raw':!![],'where':{'id':0x1}}))['then'](function(_0x1436f0){return checkLicense(_0x1436f0,null);});};exports[_0x7ad4('0x26')]=checkLicense;
\ No newline at end of file
diff --git a/server/config/local.env.js b/server/config/local.env.js
index 507a7d6..f24c47e 100644
--- a/server/config/local.env.js
+++ b/server/config/local.env.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x41ee=['http://localhost:9000','app-id','exports'];(function(_0x194262,_0x54eb5c){var _0x5eaf44=function(_0x454013){while(--_0x454013){_0x194262['push'](_0x194262['shift']());}};_0x5eaf44(++_0x54eb5c);}(_0x41ee,0x9b));var _0xe41e=function(_0x34298b,_0x3e5e07){_0x34298b=_0x34298b-0x0;var _0x28a747=_0x41ee[_0x34298b];return _0x28a747;};'use strict';module[_0xe41e('0x0')]={'DOMAIN':_0xe41e('0x1'),'SESSION_SECRET':'myappanuglar-secret','GOOGLE_ID':_0xe41e('0x2'),'GOOGLE_SECRET':'secret','DEBUG':''};
\ No newline at end of file
+var _0xd80d=['http://localhost:9000','myappanuglar-secret','app-id','secret','exports'];(function(_0x1f6dd6,_0x325b9a){var _0x349a1b=function(_0x52abf0){while(--_0x52abf0){_0x1f6dd6['push'](_0x1f6dd6['shift']());}};_0x349a1b(++_0x325b9a);}(_0xd80d,0x1c1));var _0xdd80=function(_0x53413c,_0x5dd313){_0x53413c=_0x53413c-0x0;var _0x5af911=_0xd80d[_0x53413c];return _0x5af911;};'use strict';module[_0xdd80('0x0')]={'DOMAIN':_0xdd80('0x1'),'SESSION_SECRET':_0xdd80('0x2'),'GOOGLE_ID':_0xdd80('0x3'),'GOOGLE_SECRET':_0xdd80('0x4'),'DEBUG':''};
\ No newline at end of file
diff --git a/server/config/logger.js b/server/config/logger.js
index c251c6a..d366c32 100644
--- a/server/config/logger.js
+++ b/server/config/logger.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7707=['Console','env','moment','winston','INFO','join','log','format','[%s]\x20[%s]\x20%s\x20-\x20%s','YYYY-MM-DD\x20HH:mm:ss','level','message','transports','File','%s-%s','error','info'];(function(_0x52b15d,_0x111cb9){var _0x3f4bce=function(_0x3e528f){while(--_0x3e528f){_0x52b15d['push'](_0x52b15d['shift']());}};_0x3f4bce(++_0x111cb9);}(_0x7707,0x9b));var _0x7770=function(_0x269a72,_0x2ba574){_0x269a72=_0x269a72-0x0;var _0xa8f9b0=_0x7707[_0x269a72];return _0xa8f9b0;};'use strict';var moment=require(_0x7770('0x0'));var winston=require(_0x7770('0x1'));var util=require('util');var path=require('path');var debugLevel=_0x7770('0x2');function filename(_0x16ae44,_0x4e9735){return path[_0x7770('0x3')]('/var',_0x7770('0x4'),'xcally',util['format']('%s-%s.log',_0x16ae44,_0x4e9735));}function formatter(_0x404500,_0x16eda4){return util[_0x7770('0x5')](_0x7770('0x6'),moment()[_0x7770('0x5')](_0x7770('0x7')),_0x16eda4[_0x7770('0x8')]['toUpperCase'](),_0x404500,_0x16eda4[_0x7770('0x9')]);}module['exports']=function(_0x598e62){return new winston['Logger']({'transports':[new winston[(_0x7770('0xa'))][(_0x7770('0xb'))]({'name':util[_0x7770('0x5')](_0x7770('0xc'),_0x598e62,_0x7770('0xd')),'filename':filename(_0x598e62,_0x7770('0xd')),'level':'error','json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x1dbdd4){return formatter(_0x598e62,_0x1dbdd4);}}),new winston['transports'][(_0x7770('0xb'))]({'name':util[_0x7770('0x5')](_0x7770('0xc'),_0x598e62,_0x7770('0xe')),'filename':filename(_0x598e62,'info'),'level':'info','json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x1c07cb){return formatter(_0x598e62,_0x1c07cb);}}),new winston[(_0x7770('0xa'))][(_0x7770('0xf'))]({'level':process[_0x7770('0x10')]['debugLevel']||debugLevel,'json':![],'formatter':function(_0x239d49){return formatter(_0x598e62,_0x239d49);}})]});};
\ No newline at end of file
+var _0xfe32=['INFO','log','xcally','format','%s-%s.log','[%s]\x20[%s]\x20%s\x20-\x20%s','YYYY-MM-DD\x20HH:mm:ss','level','toUpperCase','message','exports','transports','File','%s-%s','error','info','Console','env','debugLevel','util','path'];(function(_0x35b99b,_0x2efd45){var _0xc34057=function(_0x59ffe9){while(--_0x59ffe9){_0x35b99b['push'](_0x35b99b['shift']());}};_0xc34057(++_0x2efd45);}(_0xfe32,0x1e1));var _0x2fe3=function(_0x2f53d6,_0x5e50ab){_0x2f53d6=_0x2f53d6-0x0;var _0x4d4e74=_0xfe32[_0x2f53d6];return _0x4d4e74;};'use strict';var moment=require('moment');var winston=require('winston');var util=require(_0x2fe3('0x0'));var path=require(_0x2fe3('0x1'));var debugLevel=_0x2fe3('0x2');function filename(_0x2912be,_0x1cdd6a){return path['join']('/var',_0x2fe3('0x3'),_0x2fe3('0x4'),util[_0x2fe3('0x5')](_0x2fe3('0x6'),_0x2912be,_0x1cdd6a));}function formatter(_0x6fe26b,_0x5efcc5){return util[_0x2fe3('0x5')](_0x2fe3('0x7'),moment()[_0x2fe3('0x5')](_0x2fe3('0x8')),_0x5efcc5[_0x2fe3('0x9')][_0x2fe3('0xa')](),_0x6fe26b,_0x5efcc5[_0x2fe3('0xb')]);}module[_0x2fe3('0xc')]=function(_0x401cd3){return new winston['Logger']({'transports':[new winston[(_0x2fe3('0xd'))][(_0x2fe3('0xe'))]({'name':util['format'](_0x2fe3('0xf'),_0x401cd3,_0x2fe3('0x10')),'filename':filename(_0x401cd3,'error'),'level':_0x2fe3('0x10'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x5fc935){return formatter(_0x401cd3,_0x5fc935);}}),new winston[(_0x2fe3('0xd'))][(_0x2fe3('0xe'))]({'name':util[_0x2fe3('0x5')](_0x2fe3('0xf'),_0x401cd3,_0x2fe3('0x11')),'filename':filename(_0x401cd3,'info'),'level':_0x2fe3('0x11'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x1beaa5){return formatter(_0x401cd3,_0x1beaa5);}}),new winston[(_0x2fe3('0xd'))][(_0x2fe3('0x12'))]({'level':process[_0x2fe3('0x13')][_0x2fe3('0x14')]||debugLevel,'json':![],'formatter':function(_0x26f97d){return formatter(_0x401cd3,_0x26f97d);}})]});};
\ No newline at end of file
diff --git a/server/config/pm2/config.js b/server/config/pm2/config.js
index 404a7ff..8a8d1f3 100644
--- a/server/config/pm2/config.js
+++ b/server/config/pm2/config.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x2e2b=['ami','join','../../services/agi/index.js','email','../../services/email/index.js','routing','../../services/routing/index.js','../../services/xdr/index.js','exports','path','express','../../services/express/index.js'];(function(_0x3287a6,_0x35e598){var _0x9c6449=function(_0x407e41){while(--_0x407e41){_0x3287a6['push'](_0x3287a6['shift']());}};_0x9c6449(++_0x35e598);}(_0x2e2b,0xc9));var _0xb2e2=function(_0x8a969d,_0x339d9f){_0x8a969d=_0x8a969d-0x0;var _0x1d8dc7=_0x2e2b[_0x8a969d];return _0x1d8dc7;};'use strict';var path=require(_0xb2e2('0x0'));var os=require('os');var config={'apps':[{'name':_0xb2e2('0x1'),'script':path['join'](__dirname,_0xb2e2('0x2'))},{'name':_0xb2e2('0x3'),'script':path[_0xb2e2('0x4')](__dirname,'../../services/ami/index.js')},{'name':'agi','script':path[_0xb2e2('0x4')](__dirname,_0xb2e2('0x5'))},{'name':_0xb2e2('0x6'),'script':path[_0xb2e2('0x4')](__dirname,_0xb2e2('0x7'))},{'name':_0xb2e2('0x8'),'script':path[_0xb2e2('0x4')](__dirname,_0xb2e2('0x9'))},{'name':'xdr','script':path[_0xb2e2('0x4')](__dirname,_0xb2e2('0xa'))}]};module[_0xb2e2('0xb')]=config;
\ No newline at end of file
+var _0xa781=['join','../../services/express/index.js','ami','agi','../../services/agi/index.js','../../services/email/index.js','../../services/routing/index.js','xdr','../../services/xdr/index.js','exports','path','express'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xa781,0x82));var _0x1a78=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa781[_0x3dd15e];return _0x231fd0;};'use strict';var path=require(_0x1a78('0x0'));var os=require('os');var config={'apps':[{'name':_0x1a78('0x1'),'script':path[_0x1a78('0x2')](__dirname,_0x1a78('0x3'))},{'name':_0x1a78('0x4'),'script':path[_0x1a78('0x2')](__dirname,'../../services/ami/index.js')},{'name':_0x1a78('0x5'),'script':path[_0x1a78('0x2')](__dirname,_0x1a78('0x6'))},{'name':'email','script':path['join'](__dirname,_0x1a78('0x7'))},{'name':'routing','script':path[_0x1a78('0x2')](__dirname,_0x1a78('0x8'))},{'name':_0x1a78('0x9'),'script':path['join'](__dirname,_0x1a78('0xa'))}]};module[_0x1a78('0xb')]=config;
\ No newline at end of file
diff --git a/server/config/pm2/index.js b/server/config/pm2/index.js
index f0d2e95..36dd12c 100644
--- a/server/config/pm2/index.js
+++ b/server/config/pm2/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xdd50=['list','disconnect','describe','delete','dump','saved','bluebird','./config','connect','start','stop','then','restart'];(function(_0x2dadb9,_0x42cfe6){var _0x2f0097=function(_0x21163f){while(--_0x21163f){_0x2dadb9['push'](_0x2dadb9['shift']());}};_0x2f0097(++_0x42cfe6);}(_0xdd50,0x172));var _0x0dd5=function(_0x3c957d,_0x40d8f3){_0x3c957d=_0x3c957d-0x0;var _0x46ab64=_0xdd50[_0x3c957d];return _0x46ab64;};'use strict';var pm2=require('pm2');var BPromise=require(_0x0dd5('0x0'));var config=require(_0x0dd5('0x1'));function connect(){return new BPromise(function(_0x47f2dd,_0x36ae3d){return pm2[_0x0dd5('0x2')](function(_0x12af99){if(_0x12af99){return _0x36ae3d(_0x12af99);}return _0x47f2dd('connected');});});};exports['start']=function(_0x4a14ab){return connect()['then'](function(){return new BPromise(function(_0x27ea09,_0x4f6b13){return pm2[_0x0dd5('0x3')](_0x4a14ab,function(_0xcc1ca,_0x91b1a){if(_0xcc1ca){return _0x4f6b13(_0xcc1ca);}pm2['disconnect']();return _0x27ea09(_0x91b1a);});});});};exports[_0x0dd5('0x4')]=function(_0x27611e){return connect()[_0x0dd5('0x5')](function(){return new BPromise(function(_0x5e1f20,_0x54f9a8){return pm2[_0x0dd5('0x4')](_0x27611e,function(_0x22419f,_0x20b37b){if(_0x22419f){return _0x54f9a8(_0x22419f);}pm2['disconnect']();return _0x5e1f20(_0x20b37b);});});});};exports['restart']=function(_0x194b50){return connect()[_0x0dd5('0x5')](function(){return new BPromise(function(_0x51b19a,_0x49c5e0){return pm2[_0x0dd5('0x6')](_0x194b50,function(_0x320b20,_0x355924){if(_0x320b20){return _0x49c5e0(_0x320b20);}pm2['disconnect']();return _0x51b19a(_0x355924);});});});};exports[_0x0dd5('0x7')]=function(){return connect()['then'](function(){return new BPromise(function(_0x165175,_0x55dce4){return pm2[_0x0dd5('0x7')](function(_0x6d8748,_0x17b0b5){if(_0x6d8748){return _0x55dce4(_0x6d8748);}pm2[_0x0dd5('0x8')]();return _0x165175(_0x17b0b5);});});});};exports[_0x0dd5('0x9')]=function(_0x259654){return connect()['then'](function(){return new BPromise(function(_0x1f2c8e,_0x44b112){return pm2[_0x0dd5('0x9')](_0x259654,function(_0x27b603,_0x4b7336){if(_0x27b603){return _0x44b112(_0x27b603);}pm2[_0x0dd5('0x8')]();return _0x1f2c8e(_0x4b7336);});});});};exports[_0x0dd5('0xa')]=function(_0x320c77){return connect()['then'](function(){return new BPromise(function(_0x23123c,_0x375093){return pm2[_0x0dd5('0xa')](_0x320c77,function(_0x2cba7e,_0x2f9c88){if(_0x2cba7e){return _0x375093(_0x2cba7e);}pm2[_0x0dd5('0x8')]();return _0x23123c(_0x2f9c88);});});});};exports[_0x0dd5('0xb')]=function(){return connect()['then'](function(){return new BPromise(function(_0x323f9b,_0x2cf354){return pm2['dump'](function(_0xb632de){if(_0xb632de){return _0x2cf354(_0xb632de);}return _0x323f9b(_0x0dd5('0xc'));});});});};
\ No newline at end of file
+var _0x35f5=['describe','delete','dump','saved','pm2','./config','connect','then','stop','disconnect','restart','list'];(function(_0x291e85,_0x2c6059){var _0x538ba2=function(_0x69c44a){while(--_0x69c44a){_0x291e85['push'](_0x291e85['shift']());}};_0x538ba2(++_0x2c6059);}(_0x35f5,0x100));var _0x535f=function(_0x176d14,_0x3984ea){_0x176d14=_0x176d14-0x0;var _0x89522c=_0x35f5[_0x176d14];return _0x89522c;};'use strict';var pm2=require(_0x535f('0x0'));var BPromise=require('bluebird');var config=require(_0x535f('0x1'));function connect(){return new BPromise(function(_0x3d1ae7,_0x46e486){return pm2[_0x535f('0x2')](function(_0x4fd48a){if(_0x4fd48a){return _0x46e486(_0x4fd48a);}return _0x3d1ae7('connected');});});};exports['start']=function(_0x3a8b37){return connect()[_0x535f('0x3')](function(){return new BPromise(function(_0x4e52d2,_0x6b403a){return pm2['start'](_0x3a8b37,function(_0x24a137,_0x14c55b){if(_0x24a137){return _0x6b403a(_0x24a137);}pm2['disconnect']();return _0x4e52d2(_0x14c55b);});});});};exports[_0x535f('0x4')]=function(_0x4cc7b6){return connect()[_0x535f('0x3')](function(){return new BPromise(function(_0x2231fc,_0x41e216){return pm2[_0x535f('0x4')](_0x4cc7b6,function(_0x361853,_0x46fdd7){if(_0x361853){return _0x41e216(_0x361853);}pm2[_0x535f('0x5')]();return _0x2231fc(_0x46fdd7);});});});};exports[_0x535f('0x6')]=function(_0x546837){return connect()[_0x535f('0x3')](function(){return new BPromise(function(_0x3ebf54,_0x1e1c58){return pm2[_0x535f('0x6')](_0x546837,function(_0x39f1be,_0x2d24cf){if(_0x39f1be){return _0x1e1c58(_0x39f1be);}pm2['disconnect']();return _0x3ebf54(_0x2d24cf);});});});};exports[_0x535f('0x7')]=function(){return connect()['then'](function(){return new BPromise(function(_0x5054da,_0x2bede5){return pm2[_0x535f('0x7')](function(_0x423f95,_0x47e080){if(_0x423f95){return _0x2bede5(_0x423f95);}pm2['disconnect']();return _0x5054da(_0x47e080);});});});};exports[_0x535f('0x8')]=function(_0x4a97fc){return connect()[_0x535f('0x3')](function(){return new BPromise(function(_0x3ea018,_0x592a67){return pm2['describe'](_0x4a97fc,function(_0x899232,_0x571289){if(_0x899232){return _0x592a67(_0x899232);}pm2[_0x535f('0x5')]();return _0x3ea018(_0x571289);});});});};exports[_0x535f('0x9')]=function(_0x2aa879){return connect()[_0x535f('0x3')](function(){return new BPromise(function(_0x629869,_0x3b4f3f){return pm2[_0x535f('0x9')](_0x2aa879,function(_0x2d38f3,_0xdedc3e){if(_0x2d38f3){return _0x3b4f3f(_0x2d38f3);}pm2[_0x535f('0x5')]();return _0x629869(_0xdedc3e);});});});};exports[_0x535f('0xa')]=function(){return connect()[_0x535f('0x3')](function(){return new BPromise(function(_0x86f494,_0x2d3f84){return pm2[_0x535f('0xa')](function(_0xe13d3e){if(_0xe13d3e){return _0x2d3f84(_0xe13d3e);}return _0x86f494(_0x535f('0xb'));});});});};
\ No newline at end of file
diff --git a/server/config/schedule/chat.js b/server/config/schedule/chat.js
index 437a475..c9b7c55 100644
--- a/server/config/schedule/chat.js
+++ b/server/config/schedule/chat.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9035=['ChatInteraction','system','timeout','map','emit','chatInteraction:update','catch','error','lodash','moment','../../mysqldb','../../config/environment','redis','defaults','localhost','find','chatTimeout','then','findAll','subtract','minutes'];(function(_0x301ba4,_0x5d6c25){var _0x581a9d=function(_0x50fae3){while(--_0x50fae3){_0x301ba4['push'](_0x301ba4['shift']());}};_0x581a9d(++_0x5d6c25);}(_0x9035,0x158));var _0x5903=function(_0x32e978,_0x593361){_0x32e978=_0x32e978-0x0;var _0x220f5e=_0x9035[_0x32e978];return _0x220f5e;};'use strict';var _=require(_0x5903('0x0'));var moment=require(_0x5903('0x1'));var Redis=require('ioredis');var db=require(_0x5903('0x2'))['db'];var config=require(_0x5903('0x3'));config[_0x5903('0x4')]=_[_0x5903('0x5')](config['redis'],{'host':_0x5903('0x6'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function closeInteractions(){var _0x54d629=0x0;var _0x4c43e1=[];return db['Setting'][_0x5903('0x7')]({'raw':!![],'attributes':['id',_0x5903('0x8')],'where':{'id':0x1}})[_0x5903('0x9')](function(_0x286b2b){_0x54d629=_0x286b2b[_0x5903('0x8')];if(_0x54d629){return db['ChatInteraction'][_0x5903('0xa')]({'raw':!![],'attributes':['id','lastMsgAt'],'where':{'closed':![],'lastMsgAt':{'$lt':moment()[_0x5903('0xb')](_0x286b2b[_0x5903('0x8')],_0x5903('0xc'))}}});}else{return[];}})[_0x5903('0x9')](function(_0x4e01ad){_0x4c43e1=_0x4e01ad;if(_0x54d629){return db[_0x5903('0xd')]['update']({'closeReason':_0x5903('0xe'),'disposition':_0x5903('0xf'),'closed':!![],'closedAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')},{'where':{'id':_[_0x5903('0x10')](_0x4c43e1||[],'id')}});}})[_0x5903('0x9')](function(_0x27c22f){for(var _0x4e9221=0x0;_0x4e9221<_0x4c43e1['length'];_0x4e9221++){io[_0x5903('0x11')](_0x5903('0x12'),{'id':_0x4c43e1[_0x4e9221]['id'],'closed':!![]});}})[_0x5903('0x13')](function(_0xd709ff){console[_0x5903('0x14')](_0xd709ff);});}exports['start']=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();};
\ No newline at end of file
+var _0x3b81=['start','lodash','moment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','find','chatTimeout','then','findAll','lastMsgAt','subtract','ChatInteraction','update','timeout','format','YYYY-MM-DD\x20HH:mm:ss','length','emit','catch','error'];(function(_0x2994ae,_0x2822cf){var _0x33b413=function(_0x5d74a3){while(--_0x5d74a3){_0x2994ae['push'](_0x2994ae['shift']());}};_0x33b413(++_0x2822cf);}(_0x3b81,0xfe));var _0x13b8=function(_0x3e387b,_0x461cc8){_0x3e387b=_0x3e387b-0x0;var _0x24d5ad=_0x3b81[_0x3e387b];return _0x24d5ad;};'use strict';var _=require(_0x13b8('0x0'));var moment=require(_0x13b8('0x1'));var Redis=require('ioredis');var db=require(_0x13b8('0x2'))['db'];var config=require('../../config/environment');config[_0x13b8('0x3')]=_[_0x13b8('0x4')](config[_0x13b8('0x3')],{'host':_0x13b8('0x5'),'port':0x18eb});var io=require(_0x13b8('0x6'))(new Redis(config[_0x13b8('0x3')]));function closeInteractions(){var _0x2fae2d=0x0;var _0x259f2d=[];return db['Setting'][_0x13b8('0x7')]({'raw':!![],'attributes':['id',_0x13b8('0x8')],'where':{'id':0x1}})[_0x13b8('0x9')](function(_0x46dc84){_0x2fae2d=_0x46dc84[_0x13b8('0x8')];if(_0x2fae2d){return db['ChatInteraction'][_0x13b8('0xa')]({'raw':!![],'attributes':['id',_0x13b8('0xb')],'where':{'closed':![],'lastMsgAt':{'$lt':moment()[_0x13b8('0xc')](_0x46dc84[_0x13b8('0x8')],'minutes')}}});}else{return[];}})[_0x13b8('0x9')](function(_0x30feba){_0x259f2d=_0x30feba;if(_0x2fae2d){return db[_0x13b8('0xd')][_0x13b8('0xe')]({'closeReason':'system','disposition':_0x13b8('0xf'),'closed':!![],'closedAt':moment()[_0x13b8('0x10')](_0x13b8('0x11'))},{'where':{'id':_['map'](_0x259f2d||[],'id')}});}})[_0x13b8('0x9')](function(_0x43f630){for(var _0xc0b5a0=0x0;_0xc0b5a0<_0x259f2d[_0x13b8('0x12')];_0xc0b5a0++){io[_0x13b8('0x13')]('chatInteraction:update',{'id':_0x259f2d[_0xc0b5a0]['id'],'closed':!![]});}})[_0x13b8('0x14')](function(_0x25206b){console[_0x13b8('0x15')](_0x25206b);});}exports[_0x13b8('0x16')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();};
\ No newline at end of file
diff --git a/server/config/schedule/index.js b/server/config/schedule/index.js
index 75abbb2..60ec3fa 100644
--- a/server/config/schedule/index.js
+++ b/server/config/schedule/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x12fb=['stringify','isNil','subtractNumber\x20null\x20or\x20undefined','subtract','subtractUnit','YYYY-MM-DD\x20HH:mm:ss','scheduled','output','DefaultReportId','runReport','exec\x20custom\x20report\x20id:%s','CustomReportId','no\x20report\x20id','findAll','MailServerOut','keys','jobs','toString','keyBy','difference','intersection','length','exists','stop','deleteJob','delete\x20cron','toRun','index','my\x20id','resolve','cron','active','isBetween','startAt','endAt','add','start','update\x20cron','stop\x20cron','run','path','lodash','cron-job-manager','jayson/promise','bluebird','../logger','schedule','../../mysqldb','../../api/analyticCustomReport/analyticCustomReport.controller','client','Try\x20to\x20send\x20a\x20mail\x20to','MailAccount','Smtp','service','host','port','secure','authentication','auth','user','\x22%s\x22\x20<%s>','name','email','bcc','format','subtractNumber','savename','%s.%s','basename','extname','zip','join','existsSync','Sent','attachments','message','status','text','info','SendMail','then','error','error\x20mail','email\x20sent','catch'];(function(_0x57c1f0,_0x391dd3){var _0x56545b=function(_0x564fc2){while(--_0x564fc2){_0x57c1f0['push'](_0x57c1f0['shift']());}};_0x56545b(++_0x391dd3);}(_0x12fb,0xd2));var _0xb12f=function(_0x5e9c63,_0x74027f){_0x5e9c63=_0x5e9c63-0x0;var _0x2afc55=_0x12fb[_0x5e9c63];return _0x2afc55;};'use strict';var fs=require('fs');var util=require('util');var path=require(_0xb12f('0x0'));var _=require(_0xb12f('0x1'));var moment=require('moment');var CronJobManager=require(_0xb12f('0x2'));var jayson=require(_0xb12f('0x3'));var BPromise=require(_0xb12f('0x4'));var logger=require(_0xb12f('0x5'))(_0xb12f('0x6'));var db=require(_0xb12f('0x7'))['db'];var analyticCustomReportController=require(_0xb12f('0x8'));var analyticDefaultReportController=require('../../api/analyticDefaultReport/analyticDefaultReport.controller');var client=jayson[_0xb12f('0x9')]['http']({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x5b2e70,_0x44763a){return function(){logger['info'](_0xb12f('0xa'),_0x5b2e70['email']);var _0x2754ec=!![];var _0x59145a={'tls':{'rejectUnauthorized':![]}};if(_0x5b2e70[_0xb12f('0xb')][_0xb12f('0xc')][_0xb12f('0xd')]){_0x59145a[_0xb12f('0xd')]=_0x5b2e70['MailAccount'][_0xb12f('0xc')]['service'];}else{_0x59145a[_0xb12f('0xe')]=_0x5b2e70['MailAccount']['Smtp'][_0xb12f('0xe')];_0x59145a[_0xb12f('0xf')]=_0x5b2e70[_0xb12f('0xb')][_0xb12f('0xc')]['port'];_0x59145a[_0xb12f('0x10')]=_0x5b2e70['MailAccount'][_0xb12f('0xc')][_0xb12f('0x10')];}if(_0x5b2e70[_0xb12f('0xb')][_0xb12f('0xc')][_0xb12f('0x11')]){_0x59145a[_0xb12f('0x12')]={'user':_0x5b2e70[_0xb12f('0xb')][_0xb12f('0xc')][_0xb12f('0x13')],'pass':_0x5b2e70[_0xb12f('0xb')][_0xb12f('0xc')]['pass']};}var _0x25f7d2={'account':_0x59145a,'message':{'from':util['format'](_0xb12f('0x14'),_0x5b2e70[_0xb12f('0xb')][_0xb12f('0x15')],_0x5b2e70[_0xb12f('0xb')][_0xb12f('0x16')]||_0x5b2e70[_0xb12f('0xb')][_0xb12f('0xc')][_0xb12f('0x13')]),'to':_0x5b2e70[_0xb12f('0x16')],'cc':_0x5b2e70['cc'],'bcc':_0x5b2e70[_0xb12f('0x17')],'subject':util[_0xb12f('0x18')]('Report\x20%s\x20last\x20%s\x20%s',_0x44763a[_0xb12f('0x15')],_0x5b2e70[_0xb12f('0x19')],_0x5b2e70['subtractUnit'])}};var _0x3f56c8=path['join'](__dirname,'../../files/reports');var _0x30a3a2=_0x44763a[_0xb12f('0x1a')];var _0x7a25e4=util[_0xb12f('0x18')](_0xb12f('0x1b'),path[_0xb12f('0x1c')](_0x44763a[_0xb12f('0x1a')],path[_0xb12f('0x1d')](_0x44763a['savename'])),_0xb12f('0x1e'));var _0x4e25f0=path['join'](_0x3f56c8,_0x30a3a2);var _0xce8e79=path[_0xb12f('0x1f')](_0x3f56c8,_0x7a25e4);if(fs[_0xb12f('0x20')](_0x4e25f0)){_0x44763a['status']=_0xb12f('0x21');_0x25f7d2['message'][_0xb12f('0x22')]=[{'filename':_0x30a3a2,'path':_0x4e25f0}];_0x25f7d2[_0xb12f('0x23')]['text']=util[_0xb12f('0x18')]('Info\x20report:\x0a%s\x0aPlease\x20see\x20the\x20attachments\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20it.\x0a\x0a',JSON['stringify'](_0x44763a,null,0x2));}else if(fs[_0xb12f('0x20')](_0xce8e79)){_0x44763a[_0xb12f('0x24')]='Sent';_0x25f7d2[_0xb12f('0x23')]['attachments']=[{'filename':_0x7a25e4,'path':_0xce8e79}];}else{_0x25f7d2[_0xb12f('0x23')][_0xb12f('0x25')]='Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a';if(!_0x5b2e70['sendIfEmpty']){_0x2754ec=![];logger[_0xb12f('0x26')]('empty\x20file,\x20email\x20not\x20sent');}}if(_0x2754ec){return client['request'](_0xb12f('0x27'),_0x25f7d2)[_0xb12f('0x28')](function(_0xcf76c6){if(_0xcf76c6['error']){return logger[_0xb12f('0x29')](_0xb12f('0x2a'),JSON['stringify'](_0xcf76c6));}return logger[_0xb12f('0x26')](_0xb12f('0x2b'));})[_0xb12f('0x2c')](function(_0x50a189){return logger[_0xb12f('0x29')](_0xb12f('0x2a'),JSON[_0xb12f('0x2d')](_0x50a189));});}};}function handleError(){return function(_0x3dd863){return logger['error'](JSON[_0xb12f('0x2d')](_0x3dd863));};}function handleResult(_0xb95fa){return function(_0x54fc03){logger[_0xb12f('0x26')]('data',JSON[_0xb12f('0x2d')](_0x54fc03));if(_0xb95fa[_0xb12f('0xb')]&&_0xb95fa[_0xb12f('0xb')][_0xb12f('0xc')]&&!_[_0xb12f('0x2e')](_0xb95fa[_0xb12f('0x16')])){setTimeout(handleSendEmail(_0xb95fa,_0x54fc03),0x3c*0x3e8);}};}function handleJob(_0x575f8d){return function(){try{if(_[_0xb12f('0x2e')](_0x575f8d[_0xb12f('0x19')])){return logger[_0xb12f('0x26')](_0xb12f('0x2f'));}if(_['isNil'](_0x575f8d['subtractUnit'])){return logger[_0xb12f('0x26')]('subtractUnit\x20null\x20or\x20undefined');}var _0x3a9cf5={'startDate':moment()[_0xb12f('0x30')](_0x575f8d[_0xb12f('0x19')],_0x575f8d[_0xb12f('0x31')])[_0xb12f('0x18')](_0xb12f('0x32')),'endDate':moment()[_0xb12f('0x18')](_0xb12f('0x32')),'type':_0xb12f('0x33'),'output':_0x575f8d[_0xb12f('0x34')],'name':_0x575f8d[_0xb12f('0x15')]};if(!_[_0xb12f('0x2e')](_0x575f8d[_0xb12f('0x35')])){logger['info']('exec\x20defaul\x20report\x20id:%s',_0x575f8d['DefaultReportId']);return analyticDefaultReportController[_0xb12f('0x36')]({'id':_0x575f8d[_0xb12f('0x35')]},_0x3a9cf5)[_0xb12f('0x28')](handleResult(_0x575f8d))[_0xb12f('0x2c')](handleError());}if(!_[_0xb12f('0x2e')](_0x575f8d['CustomReportId'])){logger['info'](_0xb12f('0x37'),_0x575f8d[_0xb12f('0x38')]);return analyticCustomReportController[_0xb12f('0x36')]({'id':_0x575f8d[_0xb12f('0x38')]},_0x3a9cf5)['then'](handleResult(_0x575f8d))[_0xb12f('0x2c')](handleError());}}catch(_0x19944f){logger[_0xb12f('0x29')](JSON[_0xb12f('0x2d')](_0x19944f));}return logger[_0xb12f('0x26')](_0xb12f('0x39'));};}function getJobs(_0x83b33){var _0x15708e={};if(_0x83b33){_0x15708e['id']=_0x83b33;}return db['Schedule'][_0xb12f('0x3a')]({'where':_0x15708e,'include':[{'model':db[_0xb12f('0xb')],'attributes':['id',_0xb12f('0x15'),_0xb12f('0x16')],'include':[{'model':db[_0xb12f('0x3b')],'as':_0xb12f('0xc')}]}]})[_0xb12f('0x28')](function(_0x193942){var _0x2fa724=_[_0xb12f('0x3c')](manager[_0xb12f('0x3d')]);var _0x2d8802=_['map'](_0x193942,function(_0x126c72){return _0x126c72['id'][_0xb12f('0x3e')]();});var _0x6bbe0a=_[_0xb12f('0x3f')](_0x193942,function(_0x131514){return _0x131514['id'][_0xb12f('0x3e')]();});var _0x53baad=_0x83b33?_0x2d8802:_[_0xb12f('0x40')](_0x2d8802,_0x2fa724);var _0x19d8fa=_[_0xb12f('0x41')](_0x2d8802,_0x2fa724);var _0x2b422d=_[_0xb12f('0x40')](_0x2fa724,_0x2d8802);var _0x3dc561;var _0x4496ee;for(_0x3dc561=0x0;_0x3dc561<_0x2b422d[_0xb12f('0x42')]&&!_0x83b33;_0x3dc561+=0x1){_0x4496ee=_0x2b422d[_0x3dc561][_0xb12f('0x3e')]();if(manager[_0xb12f('0x43')](_0x4496ee)){manager[_0xb12f('0x44')](_0x4496ee);manager[_0xb12f('0x45')](_0x4496ee);logger['info'](_0xb12f('0x46'),_0x4496ee);}}logger[_0xb12f('0x26')](_0xb12f('0x47'),JSON[_0xb12f('0x2d')](_0x53baad));for(_0x3dc561=0x0;_0x3dc561<_0x53baad[_0xb12f('0x42')];_0x3dc561+=0x1){_0x4496ee=_0x53baad[_0x3dc561][_0xb12f('0x3e')]();logger[_0xb12f('0x26')](_0xb12f('0x48'),_0x4496ee);if(_0x83b33){logger[_0xb12f('0x26')](_0xb12f('0x49'),_0x83b33);logger[_0xb12f('0x26')](JSON[_0xb12f('0x2d')](_0x6bbe0a[_0x4496ee]));BPromise[_0xb12f('0x4a')]()[_0xb12f('0x28')](handleJob(_0x6bbe0a[_0x4496ee]));logger['info']('run\x20job',_0x6bbe0a[_0x4496ee][_0xb12f('0x15')],_0x6bbe0a[_0x4496ee][_0xb12f('0x4b')]);}else if(_0x6bbe0a[_0x4496ee][_0xb12f('0x4b')]&&_0x6bbe0a[_0x4496ee][_0xb12f('0x4c')]&&moment()[_0xb12f('0x4d')](_0x6bbe0a[_0x4496ee][_0xb12f('0x4e')],_0x6bbe0a[_0x4496ee][_0xb12f('0x4f')])){manager[_0xb12f('0x50')](_0x4496ee,_0x6bbe0a[_0x4496ee][_0xb12f('0x4b')],handleJob(_0x6bbe0a[_0x4496ee]));manager[_0xb12f('0x51')](_0x4496ee);logger[_0xb12f('0x26')]('add\x20cron',_0x6bbe0a[_0x4496ee]['name'],_0x6bbe0a[_0x4496ee][_0xb12f('0x4b')]);}else if(manager[_0xb12f('0x43')](_0x4496ee)){manager['stop'](_0x4496ee);manager[_0xb12f('0x45')](_0x4496ee);logger[_0xb12f('0x26')]('stop\x20cron',_0x6bbe0a[_0x4496ee][_0xb12f('0x15')],_0x6bbe0a[_0x4496ee][_0xb12f('0x4b')]);}}for(_0x3dc561=0x0,_0x4496ee;_0x3dc561<_0x19d8fa[_0xb12f('0x42')]&&!_0x83b33;_0x3dc561+=0x1){_0x4496ee=_0x19d8fa[_0x3dc561][_0xb12f('0x3e')]();if(manager['exists'](_0x4496ee)){if(_0x6bbe0a[_0x4496ee][_0xb12f('0x4b')]&&_0x6bbe0a[_0x4496ee][_0xb12f('0x4c')]&&moment()[_0xb12f('0x4d')](_0x6bbe0a[_0x4496ee][_0xb12f('0x4e')],_0x6bbe0a[_0x4496ee][_0xb12f('0x4f')])){manager['update'](_0x4496ee,_0x6bbe0a[_0x4496ee][_0xb12f('0x4b')],handleJob(_0x6bbe0a[_0x4496ee]));logger[_0xb12f('0x26')](_0xb12f('0x52'),_0x6bbe0a[_0x4496ee][_0xb12f('0x15')],_0x6bbe0a[_0x4496ee][_0xb12f('0x4b')]);}else{manager[_0xb12f('0x44')](_0x4496ee);manager['deleteJob'](_0x4496ee);logger[_0xb12f('0x26')](_0xb12f('0x53'),_0x6bbe0a[_0x4496ee][_0xb12f('0x15')],_0x6bbe0a[_0x4496ee][_0xb12f('0x4b')]);}}}})[_0xb12f('0x2c')](function(_0xa621bc){logger['error'](JSON[_0xb12f('0x2d')](_0xa621bc));});}exports[_0xb12f('0x54')]=function(_0x249646){return getJobs(_0x249646);};exports[_0xb12f('0x51')]=function(){setInterval(function(){return getJobs();},0x3c*0x3e8);return getJobs();};
\ No newline at end of file
+var _0x3c2e=['sendIfEmpty','empty\x20file,\x20email\x20not\x20sent','request','SendMail','then','error','stringify','email\x20sent','data','isNil','subtractNumber\x20null\x20or\x20undefined','subtractUnit\x20null\x20or\x20undefined','subtract','YYYY-MM-DD\x20HH:mm:ss','output','DefaultReportId','exec\x20defaul\x20report\x20id:%s','runReport','catch','exec\x20custom\x20report\x20id:%s','CustomReportId','no\x20report\x20id','Schedule','findAll','MailServerOut','keys','jobs','map','toString','intersection','difference','exists','stop','deleteJob','delete\x20cron','toRun','length','index','my\x20id','resolve','run\x20job','cron','active','isBetween','startAt','endAt','start','add\x20cron','stop\x20cron','update','update\x20cron','run','util','lodash','moment','cron-job-manager','jayson/promise','bluebird','schedule','../../mysqldb','../../api/analyticCustomReport/analyticCustomReport.controller','client','http','info','Try\x20to\x20send\x20a\x20mail\x20to','MailAccount','Smtp','service','host','port','secure','authentication','auth','user','pass','format','name','email','bcc','subtractNumber','subtractUnit','../../files/reports','savename','%s.%s','basename','extname','zip','join','existsSync','status','Sent','message','text','Info\x20report:\x0a%s\x0aPlease\x20see\x20the\x20attachments\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20it.\x0a\x0a','attachments','Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a'];(function(_0x4d70df,_0x2ef178){var _0xc0d57c=function(_0x1ab8cd){while(--_0x1ab8cd){_0x4d70df['push'](_0x4d70df['shift']());}};_0xc0d57c(++_0x2ef178);}(_0x3c2e,0x1b4));var _0xe3c2=function(_0xdd5f8d,_0x31c56f){_0xdd5f8d=_0xdd5f8d-0x0;var _0x416989=_0x3c2e[_0xdd5f8d];return _0x416989;};'use strict';var fs=require('fs');var util=require(_0xe3c2('0x0'));var path=require('path');var _=require(_0xe3c2('0x1'));var moment=require(_0xe3c2('0x2'));var CronJobManager=require(_0xe3c2('0x3'));var jayson=require(_0xe3c2('0x4'));var BPromise=require(_0xe3c2('0x5'));var logger=require('../logger')(_0xe3c2('0x6'));var db=require(_0xe3c2('0x7'))['db'];var analyticCustomReportController=require(_0xe3c2('0x8'));var analyticDefaultReportController=require('../../api/analyticDefaultReport/analyticDefaultReport.controller');var client=jayson[_0xe3c2('0x9')][_0xe3c2('0xa')]({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x756e84,_0x5b4bd1){return function(){logger[_0xe3c2('0xb')](_0xe3c2('0xc'),_0x756e84['email']);var _0xec1ca8=!![];var _0x59c11f={'tls':{'rejectUnauthorized':![]}};if(_0x756e84[_0xe3c2('0xd')][_0xe3c2('0xe')][_0xe3c2('0xf')]){_0x59c11f['service']=_0x756e84[_0xe3c2('0xd')][_0xe3c2('0xe')][_0xe3c2('0xf')];}else{_0x59c11f['host']=_0x756e84['MailAccount']['Smtp'][_0xe3c2('0x10')];_0x59c11f[_0xe3c2('0x11')]=_0x756e84[_0xe3c2('0xd')][_0xe3c2('0xe')]['port'];_0x59c11f[_0xe3c2('0x12')]=_0x756e84[_0xe3c2('0xd')][_0xe3c2('0xe')][_0xe3c2('0x12')];}if(_0x756e84['MailAccount'][_0xe3c2('0xe')][_0xe3c2('0x13')]){_0x59c11f[_0xe3c2('0x14')]={'user':_0x756e84['MailAccount'][_0xe3c2('0xe')][_0xe3c2('0x15')],'pass':_0x756e84['MailAccount'][_0xe3c2('0xe')][_0xe3c2('0x16')]};}var _0xd3994f={'account':_0x59c11f,'message':{'from':util[_0xe3c2('0x17')]('\x22%s\x22\x20<%s>',_0x756e84['MailAccount'][_0xe3c2('0x18')],_0x756e84['MailAccount'][_0xe3c2('0x19')]||_0x756e84[_0xe3c2('0xd')][_0xe3c2('0xe')][_0xe3c2('0x15')]),'to':_0x756e84[_0xe3c2('0x19')],'cc':_0x756e84['cc'],'bcc':_0x756e84[_0xe3c2('0x1a')],'subject':util[_0xe3c2('0x17')]('Report\x20%s\x20last\x20%s\x20%s',_0x5b4bd1[_0xe3c2('0x18')],_0x756e84[_0xe3c2('0x1b')],_0x756e84[_0xe3c2('0x1c')])}};var _0x11106f=path['join'](__dirname,_0xe3c2('0x1d'));var _0x3c90af=_0x5b4bd1[_0xe3c2('0x1e')];var _0x367e77=util[_0xe3c2('0x17')](_0xe3c2('0x1f'),path[_0xe3c2('0x20')](_0x5b4bd1[_0xe3c2('0x1e')],path[_0xe3c2('0x21')](_0x5b4bd1[_0xe3c2('0x1e')])),_0xe3c2('0x22'));var _0x273f4e=path[_0xe3c2('0x23')](_0x11106f,_0x3c90af);var _0x4594d1=path[_0xe3c2('0x23')](_0x11106f,_0x367e77);if(fs[_0xe3c2('0x24')](_0x273f4e)){_0x5b4bd1[_0xe3c2('0x25')]=_0xe3c2('0x26');_0xd3994f[_0xe3c2('0x27')]['attachments']=[{'filename':_0x3c90af,'path':_0x273f4e}];_0xd3994f[_0xe3c2('0x27')][_0xe3c2('0x28')]=util[_0xe3c2('0x17')](_0xe3c2('0x29'),JSON['stringify'](_0x5b4bd1,null,0x2));}else if(fs[_0xe3c2('0x24')](_0x4594d1)){_0x5b4bd1['status']=_0xe3c2('0x26');_0xd3994f['message'][_0xe3c2('0x2a')]=[{'filename':_0x367e77,'path':_0x4594d1}];}else{_0xd3994f[_0xe3c2('0x27')][_0xe3c2('0x28')]=_0xe3c2('0x2b');if(!_0x756e84[_0xe3c2('0x2c')]){_0xec1ca8=![];logger[_0xe3c2('0xb')](_0xe3c2('0x2d'));}}if(_0xec1ca8){return client[_0xe3c2('0x2e')](_0xe3c2('0x2f'),_0xd3994f)[_0xe3c2('0x30')](function(_0x3ad999){if(_0x3ad999[_0xe3c2('0x31')]){return logger[_0xe3c2('0x31')]('error\x20mail',JSON[_0xe3c2('0x32')](_0x3ad999));}return logger['info'](_0xe3c2('0x33'));})['catch'](function(_0x3c9fe3){return logger['error']('error\x20mail',JSON[_0xe3c2('0x32')](_0x3c9fe3));});}};}function handleError(){return function(_0x23facb){return logger['error'](JSON[_0xe3c2('0x32')](_0x23facb));};}function handleResult(_0x2b3fe4){return function(_0x5da321){logger[_0xe3c2('0xb')](_0xe3c2('0x34'),JSON[_0xe3c2('0x32')](_0x5da321));if(_0x2b3fe4[_0xe3c2('0xd')]&&_0x2b3fe4[_0xe3c2('0xd')][_0xe3c2('0xe')]&&!_[_0xe3c2('0x35')](_0x2b3fe4['email'])){setTimeout(handleSendEmail(_0x2b3fe4,_0x5da321),0x3c*0x3e8);}};}function handleJob(_0x6048ce){return function(){try{if(_[_0xe3c2('0x35')](_0x6048ce[_0xe3c2('0x1b')])){return logger['info'](_0xe3c2('0x36'));}if(_[_0xe3c2('0x35')](_0x6048ce[_0xe3c2('0x1c')])){return logger['info'](_0xe3c2('0x37'));}var _0x4a6bf2={'startDate':moment()[_0xe3c2('0x38')](_0x6048ce[_0xe3c2('0x1b')],_0x6048ce[_0xe3c2('0x1c')])[_0xe3c2('0x17')](_0xe3c2('0x39')),'endDate':moment()[_0xe3c2('0x17')]('YYYY-MM-DD\x20HH:mm:ss'),'type':'scheduled','output':_0x6048ce[_0xe3c2('0x3a')],'name':_0x6048ce[_0xe3c2('0x18')]};if(!_[_0xe3c2('0x35')](_0x6048ce[_0xe3c2('0x3b')])){logger[_0xe3c2('0xb')](_0xe3c2('0x3c'),_0x6048ce[_0xe3c2('0x3b')]);return analyticDefaultReportController[_0xe3c2('0x3d')]({'id':_0x6048ce[_0xe3c2('0x3b')]},_0x4a6bf2)[_0xe3c2('0x30')](handleResult(_0x6048ce))[_0xe3c2('0x3e')](handleError());}if(!_[_0xe3c2('0x35')](_0x6048ce['CustomReportId'])){logger[_0xe3c2('0xb')](_0xe3c2('0x3f'),_0x6048ce['CustomReportId']);return analyticCustomReportController['runReport']({'id':_0x6048ce[_0xe3c2('0x40')]},_0x4a6bf2)[_0xe3c2('0x30')](handleResult(_0x6048ce))[_0xe3c2('0x3e')](handleError());}}catch(_0x5abbcf){logger[_0xe3c2('0x31')](JSON[_0xe3c2('0x32')](_0x5abbcf));}return logger[_0xe3c2('0xb')](_0xe3c2('0x41'));};}function getJobs(_0x9d4722){var _0x39acf9={};if(_0x9d4722){_0x39acf9['id']=_0x9d4722;}return db[_0xe3c2('0x42')][_0xe3c2('0x43')]({'where':_0x39acf9,'include':[{'model':db[_0xe3c2('0xd')],'attributes':['id',_0xe3c2('0x18'),_0xe3c2('0x19')],'include':[{'model':db[_0xe3c2('0x44')],'as':_0xe3c2('0xe')}]}]})[_0xe3c2('0x30')](function(_0x24b6ed){var _0x582c28=_[_0xe3c2('0x45')](manager[_0xe3c2('0x46')]);var _0x3f873c=_[_0xe3c2('0x47')](_0x24b6ed,function(_0x5c5f1a){return _0x5c5f1a['id'][_0xe3c2('0x48')]();});var _0x2c69b6=_['keyBy'](_0x24b6ed,function(_0x328502){return _0x328502['id']['toString']();});var _0x195a50=_0x9d4722?_0x3f873c:_['difference'](_0x3f873c,_0x582c28);var _0x529c90=_[_0xe3c2('0x49')](_0x3f873c,_0x582c28);var _0x17d75e=_[_0xe3c2('0x4a')](_0x582c28,_0x3f873c);var _0x87c5e6;var _0x1f5562;for(_0x87c5e6=0x0;_0x87c5e6<_0x17d75e['length']&&!_0x9d4722;_0x87c5e6+=0x1){_0x1f5562=_0x17d75e[_0x87c5e6]['toString']();if(manager[_0xe3c2('0x4b')](_0x1f5562)){manager[_0xe3c2('0x4c')](_0x1f5562);manager[_0xe3c2('0x4d')](_0x1f5562);logger[_0xe3c2('0xb')](_0xe3c2('0x4e'),_0x1f5562);}}logger[_0xe3c2('0xb')](_0xe3c2('0x4f'),JSON[_0xe3c2('0x32')](_0x195a50));for(_0x87c5e6=0x0;_0x87c5e6<_0x195a50[_0xe3c2('0x50')];_0x87c5e6+=0x1){_0x1f5562=_0x195a50[_0x87c5e6][_0xe3c2('0x48')]();logger['info'](_0xe3c2('0x51'),_0x1f5562);if(_0x9d4722){logger[_0xe3c2('0xb')](_0xe3c2('0x52'),_0x9d4722);logger['info'](JSON['stringify'](_0x2c69b6[_0x1f5562]));BPromise[_0xe3c2('0x53')]()[_0xe3c2('0x30')](handleJob(_0x2c69b6[_0x1f5562]));logger[_0xe3c2('0xb')](_0xe3c2('0x54'),_0x2c69b6[_0x1f5562]['name'],_0x2c69b6[_0x1f5562][_0xe3c2('0x55')]);}else if(_0x2c69b6[_0x1f5562][_0xe3c2('0x55')]&&_0x2c69b6[_0x1f5562][_0xe3c2('0x56')]&&moment()[_0xe3c2('0x57')](_0x2c69b6[_0x1f5562][_0xe3c2('0x58')],_0x2c69b6[_0x1f5562][_0xe3c2('0x59')])){manager['add'](_0x1f5562,_0x2c69b6[_0x1f5562][_0xe3c2('0x55')],handleJob(_0x2c69b6[_0x1f5562]));manager[_0xe3c2('0x5a')](_0x1f5562);logger[_0xe3c2('0xb')](_0xe3c2('0x5b'),_0x2c69b6[_0x1f5562][_0xe3c2('0x18')],_0x2c69b6[_0x1f5562]['cron']);}else if(manager[_0xe3c2('0x4b')](_0x1f5562)){manager['stop'](_0x1f5562);manager[_0xe3c2('0x4d')](_0x1f5562);logger[_0xe3c2('0xb')](_0xe3c2('0x5c'),_0x2c69b6[_0x1f5562][_0xe3c2('0x18')],_0x2c69b6[_0x1f5562][_0xe3c2('0x55')]);}}for(_0x87c5e6=0x0,_0x1f5562;_0x87c5e6<_0x529c90['length']&&!_0x9d4722;_0x87c5e6+=0x1){_0x1f5562=_0x529c90[_0x87c5e6][_0xe3c2('0x48')]();if(manager[_0xe3c2('0x4b')](_0x1f5562)){if(_0x2c69b6[_0x1f5562][_0xe3c2('0x55')]&&_0x2c69b6[_0x1f5562][_0xe3c2('0x56')]&&moment()['isBetween'](_0x2c69b6[_0x1f5562]['startAt'],_0x2c69b6[_0x1f5562][_0xe3c2('0x59')])){manager[_0xe3c2('0x5d')](_0x1f5562,_0x2c69b6[_0x1f5562]['cron'],handleJob(_0x2c69b6[_0x1f5562]));logger[_0xe3c2('0xb')](_0xe3c2('0x5e'),_0x2c69b6[_0x1f5562]['name'],_0x2c69b6[_0x1f5562]['cron']);}else{manager[_0xe3c2('0x4c')](_0x1f5562);manager[_0xe3c2('0x4d')](_0x1f5562);logger[_0xe3c2('0xb')]('stop\x20cron',_0x2c69b6[_0x1f5562]['name'],_0x2c69b6[_0x1f5562][_0xe3c2('0x55')]);}}}})[_0xe3c2('0x3e')](function(_0x45830d){logger[_0xe3c2('0x31')](JSON[_0xe3c2('0x32')](_0x45830d));});}exports[_0xe3c2('0x5f')]=function(_0x35e0cc){return getJobs(_0x35e0cc);};exports[_0xe3c2('0x5a')]=function(){setInterval(function(){return getJobs();},0x3c*0x3e8);return getJobs();};
\ No newline at end of file
diff --git a/server/config/schedule/transcribe.js b/server/config/schedule/transcribe.js
index 3f8a751..e2b8933 100644
--- a/server/config/schedule/transcribe.js
+++ b/server/config/schedule/transcribe.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x21ab=['bucket','Sentiment\x20Analysis\x20not\x20configured','Transcript\x20not\x20available','Cloud\x20Provider\x20not\x20available','[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis','[RECORDING:%d]\x20Sentiment\x20Analysis\x20available','SentimentScore','Positive','Negative','Mixed','Neutral','FAILED','FailureReason','[RECORDING:%d]\x20Transcript\x20Job\x20status\x20not\x20managed','resolve','sentiment','CloudProvider','findOne','Cloud\x20Provider\x20not\x20configured','Sentiment','name','SequelizeValidationError','error','[RECORDING:%d]\x20Error\x20running\x20Transcribe\x20&\x20Sentiment\x20Analysis','No\x20transcribe\x20job\x20to\x20check','Setting','Settings\x20not\x20available','transcribeAccountId','forEach','push','all','start','request-promise','bluebird','../../mysqldb','../../config/logger','transcribe','getTranscriptionJob','Comprehend','detectSentiment','format','[RECORDING:%d]\x20Get\x20status\x20for\x20transcript\x20job\x20(%s)','transcribeName','data1','data2','transcribeRegion','then','info','[RECORDING:%d]\x20Status\x20of\x20transcript\x20job\x20(%s):\x20%s','TranscriptionJobStatus','fileText','TranscriptionJob','COMPLETED','Transcript','TranscriptFileUri','[RECORDING:%d]\x20Get\x20transcript','results','transcripts','length','transcript','update','[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated','tempSentiment','Sequelize','ValidationError','Sentiment\x20Analysis\x20not\x20requested','sentimentAccountId','sentimentRegion','language'];(function(_0x4ff09b,_0x53f67d){var _0x3f5c2e=function(_0x124592){while(--_0x124592){_0x4ff09b['push'](_0x4ff09b['shift']());}};_0x3f5c2e(++_0x53f67d);}(_0x21ab,0x65));var _0xb21a=function(_0xe05ae6,_0x2b82a7){_0xe05ae6=_0xe05ae6-0x0;var _0x4f3030=_0x21ab[_0xe05ae6];return _0x4f3030;};var _=require('lodash');var AWS=require('aws-sdk');var rp=require(_0xb21a('0x0'));var util=require('util');var BPromise=require(_0xb21a('0x1'));var db=require(_0xb21a('0x2'))['db'];var logger=require(_0xb21a('0x3'))(_0xb21a('0x4'));function getTranscriptionJob(_0x213397,_0x23392b,_0xb33ff6,_0x10261c){return new Promise(function(_0x2fab15,_0x3d1831){var _0x40bc6d=new AWS['TranscribeService']({'accessKeyId':_0x23392b,'secretAccessKey':_0x213397,'region':_0xb33ff6});_0x40bc6d[_0xb21a('0x5')]({'TranscriptionJobName':_0x10261c},function(_0x193af7,_0xe146d8){if(_0x193af7){return _0x3d1831(_0x193af7);}else{return _0x2fab15(_0xe146d8);}});});}function sentiment(_0x39dded,_0x2316c6,_0x3629ba,_0x474990,_0x133258){return new Promise(function(_0x49dab9,_0x3c2d07){var _0x268fe4=new AWS[(_0xb21a('0x6'))]({'accessKeyId':_0x2316c6,'secretAccessKey':_0x39dded,'region':_0x3629ba});_0x268fe4[_0xb21a('0x7')]({'Text':_0x474990,'LanguageCode':_0x133258['substring'](0x0,0x2)},function(_0x580197,_0x2e81a1){if(_0x580197){return _0x3c2d07(_0x580197);}else{return _0x49dab9(_0x2e81a1);}});});}function checkTranscribeJob(_0x45f5cb,_0x53738b,_0x51a41d){var _0x1886b5;return new BPromise(function(_0x4748fe,_0x1b8db6){logger['info'](util[_0xb21a('0x8')](_0xb21a('0x9'),_0x45f5cb['id'],_0x45f5cb[_0xb21a('0xa')]));return getTranscriptionJob(_0x51a41d[_0xb21a('0xb')],_0x51a41d[_0xb21a('0xc')],_0x53738b[_0xb21a('0xd')],_0x45f5cb[_0xb21a('0xa')])[_0xb21a('0xe')](function(_0x4e5c08){logger[_0xb21a('0xf')](util[_0xb21a('0x8')](_0xb21a('0x10'),_0x45f5cb['id'],_0x45f5cb[_0xb21a('0xa')],_0x4e5c08['TranscriptionJob'][_0xb21a('0x11')]));if(!_0x45f5cb[_0xb21a('0x12')]){switch(_0x4e5c08[_0xb21a('0x13')][_0xb21a('0x11')]){case _0xb21a('0x14'):var _0x3d06ab={'transcribeStatus':_0x4e5c08[_0xb21a('0x13')]['TranscriptionJobStatus'],'fileUri':_0x4e5c08['TranscriptionJob'][_0xb21a('0x15')][_0xb21a('0x16')]};logger[_0xb21a('0xf')](util[_0xb21a('0x8')](_0xb21a('0x17'),_0x45f5cb['id']));return rp({'uri':_0x4e5c08[_0xb21a('0x13')][_0xb21a('0x15')][_0xb21a('0x16')],'json':!![]})[_0xb21a('0xe')](function(_0x4be3a4){logger[_0xb21a('0xf')](util[_0xb21a('0x8')]('[RECORDING:%d]\x20Transcript\x20downloaded',_0x45f5cb['id']));if(_0x4be3a4&&_0x4be3a4[_0xb21a('0x18')]&&_0x4be3a4['results'][_0xb21a('0x19')]&&_0x4be3a4['results'][_0xb21a('0x19')][_0xb21a('0x1a')]){_0x3d06ab[_0xb21a('0x12')]='';for(var _0x25e9af=0x0;_0x25e9af<_0x4be3a4[_0xb21a('0x18')][_0xb21a('0x19')][_0xb21a('0x1a')];_0x25e9af++){_0x3d06ab['fileText']+=_0x4be3a4[_0xb21a('0x18')][_0xb21a('0x19')][_0x25e9af][_0xb21a('0x1b')]+'';}}return _0x45f5cb[_0xb21a('0x1c')](_0x3d06ab);})[_0xb21a('0xe')](function(){logger[_0xb21a('0xf')](util[_0xb21a('0x8')](_0xb21a('0x1d'),_0x45f5cb['id']));if(!_0x45f5cb[_0xb21a('0x1e')]){throw new db[(_0xb21a('0x1f'))][(_0xb21a('0x20'))](_0xb21a('0x21'));}if(!_0x53738b['sentiment']||!_0x53738b[_0xb21a('0x22')]||!_0x53738b[_0xb21a('0x23')]||!_0x53738b[_0xb21a('0x24')]||!_0x53738b[_0xb21a('0x25')]){throw new db['Sequelize'][(_0xb21a('0x20'))](_0xb21a('0x26'));}if(!_0x3d06ab[_0xb21a('0x12')]){throw new Error(_0xb21a('0x27'));}if(_0x53738b['sentimentAccountId']===_0x51a41d['id']){return _0x51a41d;}else{return db['CloudProvider']['findOne']({'where':{'id':_settings[_0xb21a('0x22')]}});}})[_0xb21a('0xe')](function(_0x966f8f){if(!_0x966f8f){throw new db[(_0xb21a('0x1f'))][(_0xb21a('0x20'))](_0xb21a('0x28'));}if(!_0x966f8f[_0xb21a('0xb')]||!_0x966f8f[_0xb21a('0xc')]){throw new db[(_0xb21a('0x1f'))]['ValidationError']('Cloud\x20Provider\x20not\x20configured');}_0x1886b5=_0x966f8f;logger[_0xb21a('0xf')](util['format'](_0xb21a('0x29'),_0x45f5cb['id']));return sentiment(_0x1886b5[_0xb21a('0xb')],_0x1886b5[_0xb21a('0xc')],_0x53738b['sentimentRegion'],_0x3d06ab[_0xb21a('0x12')],_0x53738b['language']);})[_0xb21a('0xe')](function(_0x186b01){logger[_0xb21a('0xf')](util[_0xb21a('0x8')](_0xb21a('0x2a'),_0x45f5cb['id']));return _0x45f5cb[_0xb21a('0x1c')]({'sentiment':_0x186b01['Sentiment'],'sPositive':_0x186b01[_0xb21a('0x2b')][_0xb21a('0x2c')],'sNegative':_0x186b01['SentimentScore'][_0xb21a('0x2d')],'sMixed':_0x186b01[_0xb21a('0x2b')][_0xb21a('0x2e')],'sNeutral':_0x186b01['SentimentScore'][_0xb21a('0x2f')]});})[_0xb21a('0xe')](function(){logger['info'](util[_0xb21a('0x8')](_0xb21a('0x1d'),_0x45f5cb['id']));_0x4748fe();});case _0xb21a('0x30'):return _0x45f5cb[_0xb21a('0x1c')]({'transcribeStatus':_0xb21a('0x30'),'failureReason':_0x4e5c08[_0xb21a('0x13')][_0xb21a('0x31')]})[_0xb21a('0xe')](function(){logger['info'](util[_0xb21a('0x8')](_0xb21a('0x1d'),_0x45f5cb['id']));_0x4748fe();});default:logger['info'](util['format'](_0xb21a('0x32'),_0x45f5cb['id']));break;}}else{return BPromise[_0xb21a('0x33')]()[_0xb21a('0xe')](function(){if(!_0x45f5cb['tempSentiment']){throw new db['Sequelize'][(_0xb21a('0x20'))]('Sentiment\x20Analysis\x20not\x20requested');}if(!_0x53738b[_0xb21a('0x34')]||!_0x53738b[_0xb21a('0x22')]||!_0x53738b[_0xb21a('0x23')]||!_0x53738b[_0xb21a('0x24')]||!_0x53738b['bucket']){throw new db[(_0xb21a('0x1f'))][(_0xb21a('0x20'))]('Sentiment\x20Analysis\x20not\x20configured');}if(!_0x45f5cb['fileText']){throw new Error(_0xb21a('0x27'));}if(_0x53738b[_0xb21a('0x22')]===_0x51a41d['id']){return _0x51a41d;}else{return db[_0xb21a('0x35')][_0xb21a('0x36')]({'where':{'id':_settings[_0xb21a('0x22')]}});}})[_0xb21a('0xe')](function(_0x1c6b76){if(!_0x1c6b76){throw new db[(_0xb21a('0x1f'))]['ValidationError']('Cloud\x20Provider\x20not\x20available');}if(!_0x1c6b76['data1']||!_0x1c6b76[_0xb21a('0xc')]){throw new db[(_0xb21a('0x1f'))][(_0xb21a('0x20'))](_0xb21a('0x37'));}_0x1886b5=_0x1c6b76;logger[_0xb21a('0xf')](util[_0xb21a('0x8')](_0xb21a('0x29'),_0x45f5cb['id']));return sentiment(_0x1886b5[_0xb21a('0xb')],_0x1886b5[_0xb21a('0xc')],_0x53738b[_0xb21a('0x23')],_0x45f5cb[_0xb21a('0x12')],_0x53738b[_0xb21a('0x24')]);})[_0xb21a('0xe')](function(_0x5e8e1a){logger['info'](util['format'](_0xb21a('0x2a'),_0x45f5cb['id']));return _0x45f5cb['update']({'sentiment':_0x5e8e1a[_0xb21a('0x38')],'sPositive':_0x5e8e1a[_0xb21a('0x2b')]['Positive'],'sNegative':_0x5e8e1a['SentimentScore'][_0xb21a('0x2d')],'sMixed':_0x5e8e1a[_0xb21a('0x2b')][_0xb21a('0x2e')],'sNeutral':_0x5e8e1a[_0xb21a('0x2b')][_0xb21a('0x2f')],'transcribeStatus':'COMPLETED'});})[_0xb21a('0xe')](function(){logger['info'](util['format'](_0xb21a('0x1d'),_0x45f5cb['id']));_0x4748fe();});}})['catch'](function(_0x5adab4){if(_0x5adab4){if(!_0x5adab4[_0xb21a('0x39')]||_0x5adab4[_0xb21a('0x39')]!==_0xb21a('0x3a')){logger[_0xb21a('0x3b')](util[_0xb21a('0x8')](_0xb21a('0x3c'),_0x45f5cb['id']),util['inspect'](_0x5adab4,{'showHidden':![],'depth':null}));}}_0x4748fe();});});}function checkTranscribe(){var _0x220b89;var _0x456e37;var _0x214970;return db['VoiceRecording']['findAll']({'where':{'transcribeStatus':'IN_PROGRESS'}})[_0xb21a('0xe')](function(_0x1a1334){if(!_0x1a1334||!_0x1a1334[_0xb21a('0x1a')]){throw new db[(_0xb21a('0x1f'))][(_0xb21a('0x20'))](_0xb21a('0x3d'));}_0x220b89=_0x1a1334;return db[_0xb21a('0x3e')][_0xb21a('0x36')]({'where':{'id':0x1}});})['then'](function(_0x534094){if(!_0x534094){throw new db[(_0xb21a('0x1f'))][(_0xb21a('0x20'))](_0xb21a('0x3f'));}_0x456e37=_0x534094;if(!_0x456e37[_0xb21a('0x4')]||!_0x456e37[_0xb21a('0x40')]||!_0x456e37['transcribeRegion']||!_0x456e37[_0xb21a('0x24')]||!_0x456e37[_0xb21a('0x25')]){throw new db[(_0xb21a('0x1f'))][(_0xb21a('0x20'))]('Transcribe\x20not\x20configured');}return db[_0xb21a('0x35')][_0xb21a('0x36')]({'where':{'id':_0x456e37['transcribeAccountId']}});})[_0xb21a('0xe')](function(_0x329329){if(!_0x329329){throw new db[(_0xb21a('0x1f'))]['ValidationError'](_0xb21a('0x28'));}if(!_0x329329[_0xb21a('0xb')]||!_0x329329['data2']){throw new db[(_0xb21a('0x1f'))]['ValidationError'](_0xb21a('0x37'));}_0x214970=_0x329329;var _0x2fa98f=[];_0x220b89[_0xb21a('0x41')](function(_0x16f226){_0x2fa98f[_0xb21a('0x42')](checkTranscribeJob(_0x16f226,_0x456e37,_0x214970));});return BPromise[_0xb21a('0x43')](_0x2fa98f);})['catch'](function(_0x414a1a){if(_0x414a1a){if(!_0x414a1a['name']||_0x414a1a[_0xb21a('0x39')]!=='SequelizeValidationError'){logger[_0xb21a('0x3b')](util['inspect'](_0x414a1a,{'showHidden':![],'depth':null}));}}});}exports[_0xb21a('0x44')]=function(){setInterval(function(){return checkTranscribe();},0x3c*0x3e8);return checkTranscribe();};
\ No newline at end of file
+var _0xc43d=['[RECORDING:%d]\x20Get\x20status\x20for\x20transcript\x20job\x20(%s)','data1','transcribeRegion','then','format','[RECORDING:%d]\x20Status\x20of\x20transcript\x20job\x20(%s):\x20%s','transcribeName','TranscriptionJob','TranscriptionJobStatus','fileText','COMPLETED','TranscriptFileUri','[RECORDING:%d]\x20Get\x20transcript','[RECORDING:%d]\x20Transcript\x20downloaded','transcripts','results','length','transcript','[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated','tempSentiment','Sequelize','ValidationError','Sentiment\x20Analysis\x20not\x20requested','sentiment','sentimentAccountId','sentimentRegion','language','bucket','Transcript\x20not\x20available','CloudProvider','findOne','Cloud\x20Provider\x20not\x20available','data2','Cloud\x20Provider\x20not\x20configured','[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis','[RECORDING:%d]\x20Sentiment\x20Analysis\x20available','update','SentimentScore','Positive','Negative','Mixed','FAILED','FailureReason','[RECORDING:%d]\x20Transcript\x20Job\x20status\x20not\x20managed','resolve','Sentiment\x20Analysis\x20not\x20configured','Sentiment','catch','name','SequelizeValidationError','[RECORDING:%d]\x20Error\x20running\x20Transcribe\x20&\x20Sentiment\x20Analysis','inspect','VoiceRecording','findAll','IN_PROGRESS','No\x20transcribe\x20job\x20to\x20check','Settings\x20not\x20available','transcribeAccountId','Transcribe\x20not\x20configured','push','error','start','lodash','aws-sdk','request-promise','util','../../mysqldb','../../config/logger','transcribe','TranscribeService','getTranscriptionJob','Comprehend','detectSentiment','info'];(function(_0x17df7f,_0x1cd9e4){var _0x3ba5b0=function(_0x34fad9){while(--_0x34fad9){_0x17df7f['push'](_0x17df7f['shift']());}};_0x3ba5b0(++_0x1cd9e4);}(_0xc43d,0x1b0));var _0xdc43=function(_0x2f5a22,_0x5e9f03){_0x2f5a22=_0x2f5a22-0x0;var _0x326b70=_0xc43d[_0x2f5a22];return _0x326b70;};var _=require(_0xdc43('0x0'));var AWS=require(_0xdc43('0x1'));var rp=require(_0xdc43('0x2'));var util=require(_0xdc43('0x3'));var BPromise=require('bluebird');var db=require(_0xdc43('0x4'))['db'];var logger=require(_0xdc43('0x5'))(_0xdc43('0x6'));function getTranscriptionJob(_0x1c534e,_0x3fe7ed,_0x154d41,_0x2dcf16){return new Promise(function(_0x521e53,_0x88e1ea){var _0x1c30f1=new AWS[(_0xdc43('0x7'))]({'accessKeyId':_0x3fe7ed,'secretAccessKey':_0x1c534e,'region':_0x154d41});_0x1c30f1[_0xdc43('0x8')]({'TranscriptionJobName':_0x2dcf16},function(_0x482bc5,_0x5b1824){if(_0x482bc5){return _0x88e1ea(_0x482bc5);}else{return _0x521e53(_0x5b1824);}});});}function sentiment(_0x3f2d4d,_0x47ea56,_0x30095b,_0x40f8c9,_0x4f14bd){return new Promise(function(_0x5d5a26,_0x16d9dc){var _0x263ee3=new AWS[(_0xdc43('0x9'))]({'accessKeyId':_0x47ea56,'secretAccessKey':_0x3f2d4d,'region':_0x30095b});_0x263ee3[_0xdc43('0xa')]({'Text':_0x40f8c9,'LanguageCode':_0x4f14bd['substring'](0x0,0x2)},function(_0x2efb56,_0x1721bc){if(_0x2efb56){return _0x16d9dc(_0x2efb56);}else{return _0x5d5a26(_0x1721bc);}});});}function checkTranscribeJob(_0x4ca6a5,_0x7f010f,_0x198087){var _0x4739ed;return new BPromise(function(_0x4e8a00,_0x20e266){logger[_0xdc43('0xb')](util['format'](_0xdc43('0xc'),_0x4ca6a5['id'],_0x4ca6a5['transcribeName']));return getTranscriptionJob(_0x198087[_0xdc43('0xd')],_0x198087['data2'],_0x7f010f[_0xdc43('0xe')],_0x4ca6a5['transcribeName'])[_0xdc43('0xf')](function(_0x2d53c3){logger['info'](util[_0xdc43('0x10')](_0xdc43('0x11'),_0x4ca6a5['id'],_0x4ca6a5[_0xdc43('0x12')],_0x2d53c3[_0xdc43('0x13')][_0xdc43('0x14')]));if(!_0x4ca6a5[_0xdc43('0x15')]){switch(_0x2d53c3[_0xdc43('0x13')][_0xdc43('0x14')]){case _0xdc43('0x16'):var _0x22742e={'transcribeStatus':_0x2d53c3[_0xdc43('0x13')][_0xdc43('0x14')],'fileUri':_0x2d53c3[_0xdc43('0x13')]['Transcript'][_0xdc43('0x17')]};logger[_0xdc43('0xb')](util[_0xdc43('0x10')](_0xdc43('0x18'),_0x4ca6a5['id']));return rp({'uri':_0x2d53c3[_0xdc43('0x13')]['Transcript'][_0xdc43('0x17')],'json':!![]})[_0xdc43('0xf')](function(_0x4e5f2a){logger[_0xdc43('0xb')](util['format'](_0xdc43('0x19'),_0x4ca6a5['id']));if(_0x4e5f2a&&_0x4e5f2a['results']&&_0x4e5f2a['results'][_0xdc43('0x1a')]&&_0x4e5f2a[_0xdc43('0x1b')]['transcripts'][_0xdc43('0x1c')]){_0x22742e[_0xdc43('0x15')]='';for(var _0x22f5f4=0x0;_0x22f5f4<_0x4e5f2a[_0xdc43('0x1b')][_0xdc43('0x1a')][_0xdc43('0x1c')];_0x22f5f4++){_0x22742e[_0xdc43('0x15')]+=_0x4e5f2a['results'][_0xdc43('0x1a')][_0x22f5f4][_0xdc43('0x1d')]+'';}}return _0x4ca6a5['update'](_0x22742e);})[_0xdc43('0xf')](function(){logger[_0xdc43('0xb')](util[_0xdc43('0x10')](_0xdc43('0x1e'),_0x4ca6a5['id']));if(!_0x4ca6a5[_0xdc43('0x1f')]){throw new db[(_0xdc43('0x20'))][(_0xdc43('0x21'))](_0xdc43('0x22'));}if(!_0x7f010f[_0xdc43('0x23')]||!_0x7f010f[_0xdc43('0x24')]||!_0x7f010f[_0xdc43('0x25')]||!_0x7f010f[_0xdc43('0x26')]||!_0x7f010f[_0xdc43('0x27')]){throw new db[(_0xdc43('0x20'))][(_0xdc43('0x21'))]('Sentiment\x20Analysis\x20not\x20configured');}if(!_0x22742e[_0xdc43('0x15')]){throw new Error(_0xdc43('0x28'));}if(_0x7f010f[_0xdc43('0x24')]===_0x198087['id']){return _0x198087;}else{return db[_0xdc43('0x29')][_0xdc43('0x2a')]({'where':{'id':_settings[_0xdc43('0x24')]}});}})['then'](function(_0x158ac0){if(!_0x158ac0){throw new db['Sequelize'][(_0xdc43('0x21'))](_0xdc43('0x2b'));}if(!_0x158ac0[_0xdc43('0xd')]||!_0x158ac0[_0xdc43('0x2c')]){throw new db[(_0xdc43('0x20'))][(_0xdc43('0x21'))](_0xdc43('0x2d'));}_0x4739ed=_0x158ac0;logger['info'](util[_0xdc43('0x10')](_0xdc43('0x2e'),_0x4ca6a5['id']));return sentiment(_0x4739ed[_0xdc43('0xd')],_0x4739ed[_0xdc43('0x2c')],_0x7f010f['sentimentRegion'],_0x22742e['fileText'],_0x7f010f['language']);})[_0xdc43('0xf')](function(_0xddfb9b){logger[_0xdc43('0xb')](util[_0xdc43('0x10')](_0xdc43('0x2f'),_0x4ca6a5['id']));return _0x4ca6a5[_0xdc43('0x30')]({'sentiment':_0xddfb9b['Sentiment'],'sPositive':_0xddfb9b[_0xdc43('0x31')][_0xdc43('0x32')],'sNegative':_0xddfb9b['SentimentScore'][_0xdc43('0x33')],'sMixed':_0xddfb9b[_0xdc43('0x31')][_0xdc43('0x34')],'sNeutral':_0xddfb9b['SentimentScore']['Neutral']});})['then'](function(){logger['info'](util[_0xdc43('0x10')](_0xdc43('0x1e'),_0x4ca6a5['id']));_0x4e8a00();});case _0xdc43('0x35'):return _0x4ca6a5[_0xdc43('0x30')]({'transcribeStatus':_0xdc43('0x35'),'failureReason':_0x2d53c3[_0xdc43('0x13')][_0xdc43('0x36')]})['then'](function(){logger[_0xdc43('0xb')](util['format'](_0xdc43('0x1e'),_0x4ca6a5['id']));_0x4e8a00();});default:logger[_0xdc43('0xb')](util[_0xdc43('0x10')](_0xdc43('0x37'),_0x4ca6a5['id']));break;}}else{return BPromise[_0xdc43('0x38')]()['then'](function(){if(!_0x4ca6a5[_0xdc43('0x1f')]){throw new db[(_0xdc43('0x20'))]['ValidationError'](_0xdc43('0x22'));}if(!_0x7f010f['sentiment']||!_0x7f010f['sentimentAccountId']||!_0x7f010f['sentimentRegion']||!_0x7f010f['language']||!_0x7f010f[_0xdc43('0x27')]){throw new db[(_0xdc43('0x20'))]['ValidationError'](_0xdc43('0x39'));}if(!_0x4ca6a5[_0xdc43('0x15')]){throw new Error(_0xdc43('0x28'));}if(_0x7f010f[_0xdc43('0x24')]===_0x198087['id']){return _0x198087;}else{return db[_0xdc43('0x29')]['findOne']({'where':{'id':_settings['sentimentAccountId']}});}})[_0xdc43('0xf')](function(_0x12754b){if(!_0x12754b){throw new db['Sequelize'][(_0xdc43('0x21'))]('Cloud\x20Provider\x20not\x20available');}if(!_0x12754b[_0xdc43('0xd')]||!_0x12754b[_0xdc43('0x2c')]){throw new db['Sequelize'][(_0xdc43('0x21'))]('Cloud\x20Provider\x20not\x20configured');}_0x4739ed=_0x12754b;logger[_0xdc43('0xb')](util['format']('[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis',_0x4ca6a5['id']));return sentiment(_0x4739ed['data1'],_0x4739ed[_0xdc43('0x2c')],_0x7f010f[_0xdc43('0x25')],_0x4ca6a5[_0xdc43('0x15')],_0x7f010f[_0xdc43('0x26')]);})['then'](function(_0x4fe721){logger[_0xdc43('0xb')](util['format']('[RECORDING:%d]\x20Sentiment\x20Analysis\x20available',_0x4ca6a5['id']));return _0x4ca6a5['update']({'sentiment':_0x4fe721[_0xdc43('0x3a')],'sPositive':_0x4fe721['SentimentScore'][_0xdc43('0x32')],'sNegative':_0x4fe721[_0xdc43('0x31')][_0xdc43('0x33')],'sMixed':_0x4fe721[_0xdc43('0x31')][_0xdc43('0x34')],'sNeutral':_0x4fe721[_0xdc43('0x31')]['Neutral'],'transcribeStatus':_0xdc43('0x16')});})['then'](function(){logger['info'](util[_0xdc43('0x10')]('[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated',_0x4ca6a5['id']));_0x4e8a00();});}})[_0xdc43('0x3b')](function(_0xb80021){if(_0xb80021){if(!_0xb80021[_0xdc43('0x3c')]||_0xb80021['name']!==_0xdc43('0x3d')){logger['error'](util[_0xdc43('0x10')](_0xdc43('0x3e'),_0x4ca6a5['id']),util[_0xdc43('0x3f')](_0xb80021,{'showHidden':![],'depth':null}));}}_0x4e8a00();});});}function checkTranscribe(){var _0x3be710;var _0x3bb236;var _0x31525c;return db[_0xdc43('0x40')][_0xdc43('0x41')]({'where':{'transcribeStatus':_0xdc43('0x42')}})[_0xdc43('0xf')](function(_0x5c1df0){if(!_0x5c1df0||!_0x5c1df0['length']){throw new db[(_0xdc43('0x20'))]['ValidationError'](_0xdc43('0x43'));}_0x3be710=_0x5c1df0;return db['Setting'][_0xdc43('0x2a')]({'where':{'id':0x1}});})[_0xdc43('0xf')](function(_0x275faf){if(!_0x275faf){throw new db[(_0xdc43('0x20'))][(_0xdc43('0x21'))](_0xdc43('0x44'));}_0x3bb236=_0x275faf;if(!_0x3bb236[_0xdc43('0x6')]||!_0x3bb236[_0xdc43('0x45')]||!_0x3bb236['transcribeRegion']||!_0x3bb236[_0xdc43('0x26')]||!_0x3bb236[_0xdc43('0x27')]){throw new db[(_0xdc43('0x20'))][(_0xdc43('0x21'))](_0xdc43('0x46'));}return db[_0xdc43('0x29')][_0xdc43('0x2a')]({'where':{'id':_0x3bb236[_0xdc43('0x45')]}});})[_0xdc43('0xf')](function(_0x190bfc){if(!_0x190bfc){throw new db[(_0xdc43('0x20'))][(_0xdc43('0x21'))](_0xdc43('0x2b'));}if(!_0x190bfc['data1']||!_0x190bfc[_0xdc43('0x2c')]){throw new db[(_0xdc43('0x20'))][(_0xdc43('0x21'))](_0xdc43('0x2d'));}_0x31525c=_0x190bfc;var _0x210c0c=[];_0x3be710['forEach'](function(_0xdc4597){_0x210c0c[_0xdc43('0x47')](checkTranscribeJob(_0xdc4597,_0x3bb236,_0x31525c));});return BPromise['all'](_0x210c0c);})[_0xdc43('0x3b')](function(_0x5f948a){if(_0x5f948a){if(!_0x5f948a[_0xdc43('0x3c')]||_0x5f948a[_0xdc43('0x3c')]!==_0xdc43('0x3d')){logger[_0xdc43('0x48')](util['inspect'](_0x5f948a,{'showHidden':![],'depth':null}));}}});}exports[_0xdc43('0x49')]=function(){setInterval(function(){return checkTranscribe();},0x3c*0x3e8);return checkTranscribe();};
\ No newline at end of file
diff --git a/server/config/seedContact.js b/server/config/seedContact.js
index 5e5dfac..3382abd 100644
--- a/server/config/seedContact.js
+++ b/server/config/seedContact.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x6246=['CmHopper','then','finished\x20populating','contacts2','hopper2','catch','util','push','Innocenzo','Biondo','innocenzo.biondo','now','@xcally.com','destroy','CmContact','bulkCreate','log'];(function(_0x277a13,_0x29a2ab){var _0x25974b=function(_0x1a0ffb){while(--_0x1a0ffb){_0x277a13['push'](_0x277a13['shift']());}};_0x25974b(++_0x29a2ab);}(_0x6246,0x1e2));var _0x6624=function(_0x20d2a1,_0x39b3ca){_0x20d2a1=_0x20d2a1-0x0;var _0x331e7d=_0x6246[_0x20d2a1];return _0x331e7d;};'use strict';var util=require(_0x6624('0x0'));var db=require('../mysqldb')['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts[_0x6624('0x1')]({'id':i,'firstName':_0x6624('0x2')+i,'lastName':_0x6624('0x3')+i,'phone':0xf879fb460+i,'email':_0x6624('0x4')+i+'@xcally.com'});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper['push']({'id':i,'active':![],'scheduledat':Date[_0x6624('0x5')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x6624('0x5')](),'updatedAt':Date[_0x6624('0x5')]()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2[_0x6624('0x1')]({'id':i,'firstName':_0x6624('0x2')+i,'lastName':'Biondo'+i,'phone':0xf879fb460+i,'email':_0x6624('0x4')+i+_0x6624('0x6')});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2['push']({'id':i,'active':![],'scheduledat':Date[_0x6624('0x5')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x6624('0x5')](),'updatedAt':Date[_0x6624('0x5')]()});}db['CmContact'][_0x6624('0x7')]({'where':{}})['then'](function(){return db[_0x6624('0x8')][_0x6624('0x9')](contacts);})['then'](function(){console[_0x6624('0xa')]('finished\x20populating','contacts1');return db[_0x6624('0xb')]['destroy']({'where':{}});})['then'](function(){return db[_0x6624('0xb')]['bulkCreate'](hopper);})[_0x6624('0xc')](function(){console[_0x6624('0xa')](_0x6624('0xd'),'hopper1');return db[_0x6624('0x8')][_0x6624('0x9')](contacts2);})[_0x6624('0xc')](function(){console[_0x6624('0xa')](_0x6624('0xd'),_0x6624('0xe'));return db[_0x6624('0xb')][_0x6624('0x9')](hopper2);})[_0x6624('0xc')](function(){console[_0x6624('0xa')]('finished\x20populating',_0x6624('0xf'));})[_0x6624('0x10')](function(_0x29a0a6){console[_0x6624('0xa')](_0x29a0a6);});
\ No newline at end of file
+var _0x65b4=['innocenzo.biondo','@xcally.com','now','CmContact','destroy','then','bulkCreate','log','finished\x20populating','contacts1','CmHopper','hopper1','catch','util','../mysqldb','push','Innocenzo','Biondo'];(function(_0x57db49,_0x288094){var _0xd0636f=function(_0x227787){while(--_0x227787){_0x57db49['push'](_0x57db49['shift']());}};_0xd0636f(++_0x288094);}(_0x65b4,0x13f));var _0x465b=function(_0x919116,_0x690d49){_0x919116=_0x919116-0x0;var _0x1830e9=_0x65b4[_0x919116];return _0x1830e9;};'use strict';var util=require(_0x465b('0x0'));var db=require(_0x465b('0x1'))['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts[_0x465b('0x2')]({'id':i,'firstName':_0x465b('0x3')+i,'lastName':_0x465b('0x4')+i,'phone':0xf879fb460+i,'email':_0x465b('0x5')+i+_0x465b('0x6')});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper[_0x465b('0x2')]({'id':i,'active':![],'scheduledat':Date[_0x465b('0x7')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x465b('0x7')](),'updatedAt':Date[_0x465b('0x7')]()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2['push']({'id':i,'firstName':_0x465b('0x3')+i,'lastName':'Biondo'+i,'phone':0xf879fb460+i,'email':'innocenzo.biondo'+i+_0x465b('0x6')});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2[_0x465b('0x2')]({'id':i,'active':![],'scheduledat':Date[_0x465b('0x7')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x465b('0x7')](),'updatedAt':Date[_0x465b('0x7')]()});}db[_0x465b('0x8')][_0x465b('0x9')]({'where':{}})[_0x465b('0xa')](function(){return db[_0x465b('0x8')][_0x465b('0xb')](contacts);})[_0x465b('0xa')](function(){console[_0x465b('0xc')](_0x465b('0xd'),_0x465b('0xe'));return db[_0x465b('0xf')]['destroy']({'where':{}});})[_0x465b('0xa')](function(){return db[_0x465b('0xf')][_0x465b('0xb')](hopper);})['then'](function(){console['log'](_0x465b('0xd'),_0x465b('0x10'));return db[_0x465b('0x8')]['bulkCreate'](contacts2);})[_0x465b('0xa')](function(){console[_0x465b('0xc')](_0x465b('0xd'),'contacts2');return db['CmHopper'][_0x465b('0xb')](hopper2);})[_0x465b('0xa')](function(){console[_0x465b('0xc')](_0x465b('0xd'),'hopper2');})[_0x465b('0x11')](function(_0x1ddd98){console[_0x465b('0xc')](_0x1ddd98);});
\ No newline at end of file
diff --git a/server/config/seedUsers.js b/server/config/seedUsers.js
index e11c20e..76550ad 100644
--- a/server/config/seedUsers.js
+++ b/server/config/seedUsers.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x3b97=['friend','all','ulaw','yes','actpass','\x22%s\x22\x20<%s>','User','bulkCreate','log','catch','util','../mysqldb','push','format','agent','%s%s','%s%s@xcally.com','password'];(function(_0x8a30cf,_0x40f19b){var _0x20f439=function(_0x157a5d){while(--_0x157a5d){_0x8a30cf['push'](_0x8a30cf['shift']());}};_0x20f439(++_0x40f19b);}(_0x3b97,0x1a8));var _0x73b9=function(_0x3de3b8,_0x172ec4){_0x3de3b8=_0x3de3b8-0x0;var _0x48c06c=_0x3b97[_0x3de3b8];return _0x48c06c;};'use strict';var util=require(_0x73b9('0x0'));var db=require(_0x73b9('0x1'))['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users[_0x73b9('0x2')]({'name':util[_0x73b9('0x3')]('%s%s',_0x73b9('0x4'),i),'fullname':util[_0x73b9('0x3')](_0x73b9('0x5'),_0x73b9('0x4'),i),'email':util[_0x73b9('0x3')](_0x73b9('0x6'),_0x73b9('0x4'),i),'role':'agent','password':_0x73b9('0x7'),'internal':0xfa0+i,'type':_0x73b9('0x8'),'transport':['udp','ws','wss'],'disallow':[_0x73b9('0x9')],'allow':[_0x73b9('0xa')],'defaultuser':util[_0x73b9('0x3')](_0x73b9('0x5'),_0x73b9('0x4'),i),'encryption':_0x73b9('0xb'),'avpf':_0x73b9('0xb'),'force_avp':_0x73b9('0xb'),'icesupport':_0x73b9('0xb'),'dtlsenable':_0x73b9('0xb'),'dtlsverify':'no','dtlscertfile':'/etc/pki/tls/certs/motion.crt','dtlsprivatekey':'/etc/pki/tls/private/motion.key','dtlssetup':_0x73b9('0xc'),'callerid':util[_0x73b9('0x3')](_0x73b9('0xd'),util[_0x73b9('0x3')](_0x73b9('0x5'),_0x73b9('0x4'),i),0xfa0+i)});}db[_0x73b9('0xe')][_0x73b9('0xf')](users)['then'](function(){console[_0x73b9('0x10')]('add\x20user');})[_0x73b9('0x11')](function(_0x173e6b){console[_0x73b9('0x10')](_0x173e6b);});
\ No newline at end of file
+var _0xab99=['password','friend','udp','wss','all','ulaw','yes','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','actpass','\x22%s\x22\x20<%s>','User','bulkCreate','then','log','add\x20user','catch','../mysqldb','format','%s%s','agent'];(function(_0x5819d7,_0x3d5363){var _0x303b21=function(_0x5eb832){while(--_0x5eb832){_0x5819d7['push'](_0x5819d7['shift']());}};_0x303b21(++_0x3d5363);}(_0xab99,0x137));var _0x9ab9=function(_0x34069a,_0x308fe7){_0x34069a=_0x34069a-0x0;var _0x3da329=_0xab99[_0x34069a];return _0x3da329;};'use strict';var util=require('util');var db=require(_0x9ab9('0x0'))['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users['push']({'name':util[_0x9ab9('0x1')]('%s%s','agent',i),'fullname':util[_0x9ab9('0x1')](_0x9ab9('0x2'),_0x9ab9('0x3'),i),'email':util[_0x9ab9('0x1')]('%s%s@xcally.com',_0x9ab9('0x3'),i),'role':'agent','password':_0x9ab9('0x4'),'internal':0xfa0+i,'type':_0x9ab9('0x5'),'transport':[_0x9ab9('0x6'),'ws',_0x9ab9('0x7')],'disallow':[_0x9ab9('0x8')],'allow':[_0x9ab9('0x9')],'defaultuser':util[_0x9ab9('0x1')](_0x9ab9('0x2'),_0x9ab9('0x3'),i),'encryption':_0x9ab9('0xa'),'avpf':_0x9ab9('0xa'),'force_avp':_0x9ab9('0xa'),'icesupport':_0x9ab9('0xa'),'dtlsenable':_0x9ab9('0xa'),'dtlsverify':'no','dtlscertfile':_0x9ab9('0xb'),'dtlsprivatekey':_0x9ab9('0xc'),'dtlssetup':_0x9ab9('0xd'),'callerid':util[_0x9ab9('0x1')](_0x9ab9('0xe'),util['format'](_0x9ab9('0x2'),'agent',i),0xfa0+i)});}db[_0x9ab9('0xf')][_0x9ab9('0x10')](users)[_0x9ab9('0x11')](function(){console[_0x9ab9('0x12')](_0x9ab9('0x13'));})[_0x9ab9('0x14')](function(_0x312ddc){console[_0x9ab9('0x12')](_0x312ddc);});
\ No newline at end of file
diff --git a/server/config/socketio.js b/server/config/socketio.js
index cba29c2..f4bcc7f 100644
--- a/server/config/socketio.js
+++ b/server/config/socketio.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x6bf8=['util','bluebird','./environment','name','Agents','User','role','agent','telephone','type','UserProfileSection','findOne','then','autoAssociation','VoiceQueues','ChatQueues','FaxQueues','OpenchannelQueues','WhatsappQueues','Telephones','findAll','Trunks','IvrCampaigns','UserProfileResource','resourceId','where','ivr','length','format','user:%s','handshake','query','find','userProfileId','ChatInteraction','ChatInteractions','MailInteractions','SmsInteraction','SmsInteractions','OpenchannelInteraction','OpenchannelInteractions','admin','voice:inbound','voice:outbound','hasOwnProperty','include','VoiceQueue','push','ChatQueue','OpenchannelQueue','Campaign','user','SmsQueues','SmsQueue','MailQueues','MailQueue','WhatsappQueue','getVoiceQueues','getChatQueues','getMailQueues','getWhatsappQueues','all','voice','chat','fax','mail','openchannel','whatsapp','trunk:%s','leave','map','emit','removeMailInteractions','user_has_mail_interactions:remove','FaxInteractions','removeFaxInteractions','user_has_fax_interactions:remove','removeSmsInteractions','user_has_sms_interactions:remove','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','WhatsappInteractions','removeWhatsappInteractions','user_has_whatsapp_interactions:remove','catch','join','connection','setMaxListeners','remoteAddress','connectedAt','log','nsp','address','disconnect','DISCONNECTED','CONNECTED','lodash'];(function(_0x55969f,_0x2cc83f){var _0x367e62=function(_0x10b2d3){while(--_0x10b2d3){_0x55969f['push'](_0x55969f['shift']());}};_0x367e62(++_0x2cc83f);}(_0x6bf8,0x183));var _0x86bf=function(_0x491fbc,_0x1a708a){_0x491fbc=_0x491fbc-0x0;var _0x2559d7=_0x6bf8[_0x491fbc];return _0x2559d7;};'use strict';var _=require(_0x86bf('0x0'));var util=require(_0x86bf('0x1'));var BPromise=require(_0x86bf('0x2'));var db=require('../mysqldb')['db'];var config=require(_0x86bf('0x3'));var queryQueues={'attributes':['id',_0x86bf('0x4')],'include':[{'as':_0x86bf('0x5'),'model':db[_0x86bf('0x6')],'attributes':['id',_0x86bf('0x4'),_0x86bf('0x7')],'raw':!![],'where':{'role':_0x86bf('0x8')},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id','name'],'where':{'role':_0x86bf('0x9')}};var queryTrunks={'raw':!![],'attributes':['id',_0x86bf('0x4')]};var queryAgents={'raw':!![],'attributes':['id','name'],'where':{'role':_0x86bf('0x8')}};var queryCampaigns={'raw':!![],'attributes':['id',_0x86bf('0x4'),_0x86bf('0xa')],'where':{'type':'ivr'}};function getAssociatedResources(_0x131708,_0x145f3d,_0x4f465e){return db[_0x86bf('0xb')][_0x86bf('0xc')]({'where':{'name':_0x131708,'userProfileId':_0x145f3d},'raw':!![]})[_0x86bf('0xd')](function(_0x53c243){if(_0x53c243){if(_0x53c243[_0x86bf('0xe')]){switch(_0x131708){case _0x86bf('0xf'):case _0x86bf('0x10'):case _0x86bf('0x11'):case'SmsQueues':case'MailQueues':case _0x86bf('0x12'):case _0x86bf('0x13'):return db[_0x4f465e]['findAll'](queryQueues);case _0x86bf('0x14'):return db[_0x4f465e][_0x86bf('0x15')](queryTelephones);case _0x86bf('0x16'):return db[_0x4f465e][_0x86bf('0x15')](queryTrunks);case _0x86bf('0x17'):return db[_0x4f465e][_0x86bf('0x15')](queryCampaigns);}}else{return db[_0x86bf('0x18')][_0x86bf('0x15')]({'attributes':[_0x86bf('0x19')],'where':{'sectionId':_0x53c243['id']},'raw':!![]})[_0x86bf('0xd')](function(_0x58bb41){if(_0x58bb41){var _0x17761f={'where':{'id':_['map'](_0x58bb41,_0x86bf('0x19'))},'raw':!![]};switch(_0x4f465e){case'User':_0x17761f[_0x86bf('0x1a')][_0x86bf('0x7')]='telephone';break;case'Campaign':_0x17761f[_0x86bf('0x1a')][_0x86bf('0xa')]=_0x86bf('0x1b');break;}return db[_0x4f465e][_0x86bf('0x15')](_0x17761f);}else{return[];}});}}else{return[];}})[_0x86bf('0xd')](function(_0x2eda9d){return _0x2eda9d;});}function joinOrLeaveQueues(_0x312403,_0x3892eb,_0x2494aa,_0xed4fdd){_0x312403[_0x3892eb](util['format']('%s:queue:%s',_0x2494aa,_0xed4fdd[_0x86bf('0x4')]));if(_0xed4fdd[_0x86bf('0x5')]){for(var _0x132a54=0x0;_0x132a54<_0xed4fdd[_0x86bf('0x5')][_0x86bf('0x1c')];_0x132a54+=0x1){_0x312403[_0x3892eb](util[_0x86bf('0x1d')](_0x86bf('0x1e'),_0xed4fdd[_0x86bf('0x5')][_0x132a54][_0x86bf('0x4')]));}}}function joinOrLeave(_0x1a3653,_0x5664eb,_0x5388cc){var _0x4c182;if(_0x1a3653[_0x86bf('0x1f')][_0x86bf('0x20')]['id']){db['User'][_0x86bf('0x21')]({'attributes':['id','name',_0x86bf('0x7'),_0x86bf('0x22')],'where':{'id':_0x1a3653['handshake'][_0x86bf('0x20')]['id']},'include':[{'model':db[_0x86bf('0x23')],'as':_0x86bf('0x24'),'attributes':['id'],'raw':!![]},{'model':db['MailInteraction'],'as':_0x86bf('0x25'),'attributes':['id'],'raw':!![]},{'model':db['FaxInteraction'],'as':'FaxInteractions','attributes':['id'],'raw':!![]},{'model':db[_0x86bf('0x26')],'as':_0x86bf('0x27'),'attributes':['id'],'raw':!![]},{'model':db[_0x86bf('0x28')],'as':_0x86bf('0x29'),'attributes':['id'],'raw':!![]},{'model':db['WhatsappInteraction'],'as':'WhatsappInteractions','attributes':['id'],'raw':!![]}]})[_0x86bf('0xd')](function(_0x58d28a){if(_0x58d28a){_0x4c182=_0x58d28a;_0x1a3653[_0x5664eb](util[_0x86bf('0x1d')](_0x86bf('0x1e'),_0x58d28a[_0x86bf('0x4')]));var _0x2c701f=[];switch(_0x58d28a[_0x86bf('0x7')]){case _0x86bf('0x2a'):_0x1a3653[_0x5664eb](_0x86bf('0x2b'));_0x1a3653[_0x5664eb](_0x86bf('0x2c'));if(queryQueues[_0x86bf('0x2d')](_0x86bf('0x2e'))){delete queryQueues[_0x86bf('0x2e')];}_0x2c701f['push'](db[_0x86bf('0x2f')][_0x86bf('0x15')](queryQueues));_0x2c701f[_0x86bf('0x30')](db[_0x86bf('0x31')]['findAll'](queryQueues));_0x2c701f['push'](db['FaxQueue'][_0x86bf('0x15')](queryQueues));_0x2c701f[_0x86bf('0x30')](db['SmsQueue'][_0x86bf('0x15')](queryQueues));_0x2c701f[_0x86bf('0x30')](db['MailQueue'][_0x86bf('0x15')](queryQueues));_0x2c701f[_0x86bf('0x30')](db[_0x86bf('0x32')][_0x86bf('0x15')](queryQueues));_0x2c701f[_0x86bf('0x30')](db['WhatsappQueue'][_0x86bf('0x15')](queryQueues));_0x2c701f['push'](db[_0x86bf('0x6')][_0x86bf('0x15')](queryTelephones));_0x2c701f[_0x86bf('0x30')](db['Trunk'][_0x86bf('0x15')](queryTrunks));_0x2c701f[_0x86bf('0x30')](db[_0x86bf('0x33')][_0x86bf('0x15')](queryCampaigns));_0x2c701f[_0x86bf('0x30')](db[_0x86bf('0x6')][_0x86bf('0x15')](queryAgents));break;case _0x86bf('0x34'):_0x1a3653[_0x5664eb](_0x86bf('0x2b'));_0x1a3653[_0x5664eb](_0x86bf('0x2c'));_0x2c701f[_0x86bf('0x30')](getAssociatedResources(_0x86bf('0xf'),_0x58d28a[_0x86bf('0x22')],_0x86bf('0x2f')));_0x2c701f[_0x86bf('0x30')](getAssociatedResources(_0x86bf('0x10'),_0x58d28a[_0x86bf('0x22')],_0x86bf('0x31')));_0x2c701f[_0x86bf('0x30')](getAssociatedResources('FaxQueues',_0x58d28a['userProfileId'],'FaxQueue'));_0x2c701f[_0x86bf('0x30')](getAssociatedResources(_0x86bf('0x35'),_0x58d28a[_0x86bf('0x22')],_0x86bf('0x36')));_0x2c701f['push'](getAssociatedResources(_0x86bf('0x37'),_0x58d28a[_0x86bf('0x22')],_0x86bf('0x38')));_0x2c701f[_0x86bf('0x30')](getAssociatedResources('OpenchannelQueues',_0x58d28a[_0x86bf('0x22')],_0x86bf('0x32')));_0x2c701f['push'](getAssociatedResources(_0x86bf('0x13'),_0x58d28a['userProfileId'],_0x86bf('0x39')));_0x2c701f[_0x86bf('0x30')](getAssociatedResources('Telephones',_0x58d28a[_0x86bf('0x22')],_0x86bf('0x6')));_0x2c701f[_0x86bf('0x30')](getAssociatedResources(_0x86bf('0x16'),_0x58d28a[_0x86bf('0x22')],'Trunk'));_0x2c701f[_0x86bf('0x30')](getAssociatedResources(_0x86bf('0x17'),_0x58d28a[_0x86bf('0x22')],_0x86bf('0x33')));_0x2c701f[_0x86bf('0x30')](db[_0x86bf('0x6')]['findAll'](queryAgents));break;case'agent':_0x1a3653[_0x5664eb](_0x86bf('0x2b'));_0x1a3653[_0x5664eb](_0x86bf('0x2c'));_0x2c701f[_0x86bf('0x30')](_0x58d28a[_0x86bf('0x3a')]({'attributes':['id',_0x86bf('0x4')]}));_0x2c701f[_0x86bf('0x30')](_0x58d28a[_0x86bf('0x3b')]({'attributes':['id',_0x86bf('0x4')]}));_0x2c701f['push'](_0x58d28a['getFaxQueues']({'attributes':['id',_0x86bf('0x4')]}));_0x2c701f[_0x86bf('0x30')](_0x58d28a['getSmsQueues']({'attributes':['id',_0x86bf('0x4')]}));_0x2c701f[_0x86bf('0x30')](_0x58d28a[_0x86bf('0x3c')]({'attributes':['id',_0x86bf('0x4')]}));_0x2c701f['push'](_0x58d28a['getOpenchannelQueues']({'attributes':['id',_0x86bf('0x4')]}));_0x2c701f[_0x86bf('0x30')](_0x58d28a[_0x86bf('0x3d')]({'attributes':['id',_0x86bf('0x4')]}));break;}return BPromise[_0x86bf('0x3e')](_0x2c701f);}})[_0x86bf('0xd')](function(_0x15cbcd){if(_0x15cbcd&&_0x15cbcd['length']){for(var _0xdb8082=0x0;_0xdb8082<_0x15cbcd[_0x86bf('0x1c')];_0xdb8082+=0x1){for(var _0x3679fd=0x0;_0x3679fd<_0x15cbcd[_0xdb8082][_0x86bf('0x1c')];_0x3679fd+=0x1){switch(_0xdb8082){case 0x0:joinOrLeaveQueues(_0x1a3653,_0x5664eb,_0x86bf('0x3f'),_0x15cbcd[_0xdb8082][_0x3679fd]);break;case 0x1:joinOrLeaveQueues(_0x1a3653,_0x5664eb,_0x86bf('0x40'),_0x15cbcd[_0xdb8082][_0x3679fd]);break;case 0x2:joinOrLeaveQueues(_0x1a3653,_0x5664eb,_0x86bf('0x41'),_0x15cbcd[_0xdb8082][_0x3679fd]);break;case 0x3:joinOrLeaveQueues(_0x1a3653,_0x5664eb,'sms',_0x15cbcd[_0xdb8082][_0x3679fd]);break;case 0x4:joinOrLeaveQueues(_0x1a3653,_0x5664eb,_0x86bf('0x42'),_0x15cbcd[_0xdb8082][_0x3679fd]);break;case 0x5:joinOrLeaveQueues(_0x1a3653,_0x5664eb,_0x86bf('0x43'),_0x15cbcd[_0xdb8082][_0x3679fd]);break;case 0x6:joinOrLeaveQueues(_0x1a3653,_0x5664eb,_0x86bf('0x44'),_0x15cbcd[_0xdb8082][_0x3679fd]);break;case 0x7:_0x1a3653[_0x5664eb](util[_0x86bf('0x1d')]('telephone:%s',_0x15cbcd[_0xdb8082][_0x3679fd][_0x86bf('0x4')]));break;case 0x8:_0x1a3653[_0x5664eb](util[_0x86bf('0x1d')](_0x86bf('0x45'),_0x15cbcd[_0xdb8082][_0x3679fd][_0x86bf('0x4')]));break;case 0x9:_0x1a3653[_0x5664eb](util[_0x86bf('0x1d')]('campaign:%s:%s',_0x15cbcd[_0xdb8082][_0x3679fd][_0x86bf('0xa')],_0x15cbcd[_0xdb8082][_0x3679fd][_0x86bf('0x4')]));break;case 0xa:_0x1a3653[_0x5664eb](util[_0x86bf('0x1d')]('user:%s',_0x15cbcd[_0xdb8082][_0x3679fd][_0x86bf('0x4')]));break;}}}}})[_0x86bf('0xd')](function(){if(_0x5664eb===_0x86bf('0x46')){var _0x53b10b=_[_0x86bf('0x47')](_0x4c182['ChatInteractions'],'id');return _0x4c182['removeChatInteractions'](_0x53b10b)[_0x86bf('0xd')](function(){for(var _0x33c649=0x0;_0x33c649<_0x53b10b[_0x86bf('0x1c')];_0x33c649+=0x1){_0x5388cc[_0x86bf('0x48')]('user_has_chat_interactions:remove',{'ChatInteractionId':Number(_0x53b10b[_0x33c649]),'UserId':Number(_0x4c182['id'])});}});}})[_0x86bf('0xd')](function(){if(_0x5664eb==='leave'){var _0x124a4f=_[_0x86bf('0x47')](_0x4c182[_0x86bf('0x25')],'id');return _0x4c182[_0x86bf('0x49')](_0x124a4f)['then'](function(){for(var _0xb27e0c=0x0;_0xb27e0c<_0x124a4f[_0x86bf('0x1c')];_0xb27e0c+=0x1){_0x5388cc['emit'](_0x86bf('0x4a'),{'MailInteractionId':Number(_0x124a4f[_0xb27e0c]),'UserId':Number(_0x4c182['id'])});}});}})[_0x86bf('0xd')](function(){if(_0x5664eb===_0x86bf('0x46')){var _0x3af2cd=_[_0x86bf('0x47')](_0x4c182[_0x86bf('0x4b')],'id');return _0x4c182[_0x86bf('0x4c')](_0x3af2cd)[_0x86bf('0xd')](function(){for(var _0x312387=0x0;_0x312387<_0x3af2cd['length'];_0x312387+=0x1){_0x5388cc['emit'](_0x86bf('0x4d'),{'FaxInteractionId':Number(_0x3af2cd[_0x312387]),'UserId':Number(_0x4c182['id'])});}});}})[_0x86bf('0xd')](function(){if(_0x5664eb===_0x86bf('0x46')){var _0x27a1ec=_['map'](_0x4c182[_0x86bf('0x27')],'id');return _0x4c182[_0x86bf('0x4e')](_0x27a1ec)[_0x86bf('0xd')](function(){for(var _0x1e2077=0x0;_0x1e2077<_0x27a1ec[_0x86bf('0x1c')];_0x1e2077+=0x1){_0x5388cc['emit'](_0x86bf('0x4f'),{'SmsInteractionId':Number(_0x27a1ec[_0x1e2077]),'UserId':Number(_0x4c182['id'])});}});}})[_0x86bf('0xd')](function(){if(_0x5664eb===_0x86bf('0x46')){var _0x3c49d9=_[_0x86bf('0x47')](_0x4c182[_0x86bf('0x29')],'id');return _0x4c182[_0x86bf('0x50')](_0x3c49d9)[_0x86bf('0xd')](function(){for(var _0x5c2b0d=0x0;_0x5c2b0d<_0x3c49d9[_0x86bf('0x1c')];_0x5c2b0d+=0x1){_0x5388cc[_0x86bf('0x48')](_0x86bf('0x51'),{'OpenchannelInteractionId':Number(_0x3c49d9[_0x5c2b0d]),'UserId':Number(_0x4c182['id'])});}});}})['then'](function(){if(_0x5664eb==='leave'){var _0xcfa265=_[_0x86bf('0x47')](_0x4c182[_0x86bf('0x52')],'id');return _0x4c182[_0x86bf('0x53')](_0xcfa265)['then'](function(){for(var _0x5f2928=0x0;_0x5f2928<_0xcfa265[_0x86bf('0x1c')];_0x5f2928+=0x1){_0x5388cc[_0x86bf('0x48')](_0x86bf('0x54'),{'WhatsappInteractionId':Number(_0xcfa265[_0x5f2928]),'UserId':Number(_0x4c182['id'])});}});}})[_0x86bf('0x55')](function(_0x3be8d2){_0x1a3653['log'](_0x3be8d2);});}}function onDisconnect(_0x19d321,_0x2f49a3){joinOrLeave(_0x19d321,_0x86bf('0x46'),_0x2f49a3);}function onConnect(_0x3ab81c){joinOrLeave(_0x3ab81c,_0x86bf('0x56'));}exports['default']=function(_0x2d4936){_0x2d4936['on'](_0x86bf('0x57'),function(_0x4fa5e8){_0x4fa5e8[_0x86bf('0x58')](0x0);_0x4fa5e8['address']=_0x4fa5e8['request'][_0x86bf('0x57')][_0x86bf('0x59')]+':'+_0x4fa5e8['request'][_0x86bf('0x57')]['remotePort'];_0x4fa5e8[_0x86bf('0x5a')]=new Date();_0x4fa5e8['log']=function(_0x450769){console[_0x86bf('0x5b')]('SocketIO\x20'+_0x4fa5e8[_0x86bf('0x5c')][_0x86bf('0x4')]+'['+_0x4fa5e8[_0x86bf('0x5d')]+']',_0x450769);};_0x4fa5e8['on'](_0x86bf('0x5e'),function(){onDisconnect(_0x4fa5e8,_0x2d4936);_0x4fa5e8[_0x86bf('0x5b')](_0x86bf('0x5f'));});onConnect(_0x4fa5e8);_0x4fa5e8[_0x86bf('0x5b')](_0x86bf('0x60'));});};
\ No newline at end of file
+var _0x3e35=['user','ChatQueue','MailQueue','WhatsappQueues','Telephones','getFaxQueues','getSmsQueues','getOpenchannelQueues','getWhatsappQueues','all','voice','fax','sms','whatsapp','trunk:%s','campaign:%s:%s','leave','removeChatInteractions','emit','user_has_chat_interactions:remove','removeMailInteractions','FaxInteractions','removeFaxInteractions','user_has_fax_interactions:remove','SmsInteractions','user_has_sms_interactions:remove','OpenchannelInteractions','user_has_openchannel_interactions:remove','removeWhatsappInteractions','catch','log','join','default','connection','setMaxListeners','address','remoteAddress','request','remotePort','connectedAt','CONNECTED','lodash','util','bluebird','../mysqldb','./environment','name','User','role','telephone','agent','type','ivr','UserProfileSection','findOne','autoAssociation','VoiceQueues','ChatQueues','FaxQueues','SmsQueues','MailQueues','findAll','Trunks','IvrCampaigns','UserProfileResource','resourceId','then','map','where','Campaign','format','Agents','length','user:%s','handshake','query','find','userProfileId','ChatInteraction','ChatInteractions','MailInteraction','MailInteractions','FaxInteraction','SmsInteraction','OpenchannelInteraction','WhatsappInteraction','admin','voice:inbound','voice:outbound','hasOwnProperty','include','push','FaxQueue','SmsQueue','OpenchannelQueue','WhatsappQueue','Trunk'];(function(_0x8816b4,_0x12d85f){var _0x29854b=function(_0x2cd466){while(--_0x2cd466){_0x8816b4['push'](_0x8816b4['shift']());}};_0x29854b(++_0x12d85f);}(_0x3e35,0x1ad));var _0x53e3=function(_0x1fc36f,_0x464552){_0x1fc36f=_0x1fc36f-0x0;var _0x2856b4=_0x3e35[_0x1fc36f];return _0x2856b4;};'use strict';var _=require(_0x53e3('0x0'));var util=require(_0x53e3('0x1'));var BPromise=require(_0x53e3('0x2'));var db=require(_0x53e3('0x3'))['db'];var config=require(_0x53e3('0x4'));var queryQueues={'attributes':['id',_0x53e3('0x5')],'include':[{'as':'Agents','model':db[_0x53e3('0x6')],'attributes':['id',_0x53e3('0x5'),_0x53e3('0x7')],'raw':!![],'where':{'role':'agent'},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id',_0x53e3('0x5')],'where':{'role':_0x53e3('0x8')}};var queryTrunks={'raw':!![],'attributes':['id',_0x53e3('0x5')]};var queryAgents={'raw':!![],'attributes':['id','name'],'where':{'role':_0x53e3('0x9')}};var queryCampaigns={'raw':!![],'attributes':['id',_0x53e3('0x5'),_0x53e3('0xa')],'where':{'type':_0x53e3('0xb')}};function getAssociatedResources(_0x1c2667,_0xe48e86,_0x2379ac){return db[_0x53e3('0xc')][_0x53e3('0xd')]({'where':{'name':_0x1c2667,'userProfileId':_0xe48e86},'raw':!![]})['then'](function(_0x384b06){if(_0x384b06){if(_0x384b06[_0x53e3('0xe')]){switch(_0x1c2667){case _0x53e3('0xf'):case _0x53e3('0x10'):case _0x53e3('0x11'):case _0x53e3('0x12'):case _0x53e3('0x13'):case'OpenchannelQueues':case'WhatsappQueues':return db[_0x2379ac][_0x53e3('0x14')](queryQueues);case'Telephones':return db[_0x2379ac]['findAll'](queryTelephones);case _0x53e3('0x15'):return db[_0x2379ac][_0x53e3('0x14')](queryTrunks);case _0x53e3('0x16'):return db[_0x2379ac][_0x53e3('0x14')](queryCampaigns);}}else{return db[_0x53e3('0x17')]['findAll']({'attributes':[_0x53e3('0x18')],'where':{'sectionId':_0x384b06['id']},'raw':!![]})[_0x53e3('0x19')](function(_0x7945e){if(_0x7945e){var _0x13ab67={'where':{'id':_[_0x53e3('0x1a')](_0x7945e,_0x53e3('0x18'))},'raw':!![]};switch(_0x2379ac){case _0x53e3('0x6'):_0x13ab67[_0x53e3('0x1b')][_0x53e3('0x7')]='telephone';break;case _0x53e3('0x1c'):_0x13ab67[_0x53e3('0x1b')][_0x53e3('0xa')]=_0x53e3('0xb');break;}return db[_0x2379ac][_0x53e3('0x14')](_0x13ab67);}else{return[];}});}}else{return[];}})['then'](function(_0xc17de){return _0xc17de;});}function joinOrLeaveQueues(_0x3396e5,_0x579e98,_0x105fdb,_0x40ea73){_0x3396e5[_0x579e98](util[_0x53e3('0x1d')]('%s:queue:%s',_0x105fdb,_0x40ea73['name']));if(_0x40ea73[_0x53e3('0x1e')]){for(var _0x1671e6=0x0;_0x1671e6<_0x40ea73[_0x53e3('0x1e')][_0x53e3('0x1f')];_0x1671e6+=0x1){_0x3396e5[_0x579e98](util['format'](_0x53e3('0x20'),_0x40ea73[_0x53e3('0x1e')][_0x1671e6]['name']));}}}function joinOrLeave(_0x15666b,_0xc0e66,_0x1d3691){var _0x27be86;if(_0x15666b[_0x53e3('0x21')][_0x53e3('0x22')]['id']){db[_0x53e3('0x6')][_0x53e3('0x23')]({'attributes':['id',_0x53e3('0x5'),_0x53e3('0x7'),_0x53e3('0x24')],'where':{'id':_0x15666b[_0x53e3('0x21')][_0x53e3('0x22')]['id']},'include':[{'model':db[_0x53e3('0x25')],'as':_0x53e3('0x26'),'attributes':['id'],'raw':!![]},{'model':db[_0x53e3('0x27')],'as':_0x53e3('0x28'),'attributes':['id'],'raw':!![]},{'model':db[_0x53e3('0x29')],'as':'FaxInteractions','attributes':['id'],'raw':!![]},{'model':db[_0x53e3('0x2a')],'as':'SmsInteractions','attributes':['id'],'raw':!![]},{'model':db[_0x53e3('0x2b')],'as':'OpenchannelInteractions','attributes':['id'],'raw':!![]},{'model':db[_0x53e3('0x2c')],'as':'WhatsappInteractions','attributes':['id'],'raw':!![]}]})[_0x53e3('0x19')](function(_0x372d19){if(_0x372d19){_0x27be86=_0x372d19;_0x15666b[_0xc0e66](util[_0x53e3('0x1d')](_0x53e3('0x20'),_0x372d19[_0x53e3('0x5')]));var _0x3501f2=[];switch(_0x372d19[_0x53e3('0x7')]){case _0x53e3('0x2d'):_0x15666b[_0xc0e66](_0x53e3('0x2e'));_0x15666b[_0xc0e66](_0x53e3('0x2f'));if(queryQueues[_0x53e3('0x30')](_0x53e3('0x31'))){delete queryQueues[_0x53e3('0x31')];}_0x3501f2[_0x53e3('0x32')](db['VoiceQueue'][_0x53e3('0x14')](queryQueues));_0x3501f2[_0x53e3('0x32')](db['ChatQueue']['findAll'](queryQueues));_0x3501f2[_0x53e3('0x32')](db[_0x53e3('0x33')][_0x53e3('0x14')](queryQueues));_0x3501f2[_0x53e3('0x32')](db[_0x53e3('0x34')][_0x53e3('0x14')](queryQueues));_0x3501f2[_0x53e3('0x32')](db['MailQueue'][_0x53e3('0x14')](queryQueues));_0x3501f2[_0x53e3('0x32')](db[_0x53e3('0x35')][_0x53e3('0x14')](queryQueues));_0x3501f2[_0x53e3('0x32')](db[_0x53e3('0x36')][_0x53e3('0x14')](queryQueues));_0x3501f2[_0x53e3('0x32')](db['User']['findAll'](queryTelephones));_0x3501f2[_0x53e3('0x32')](db[_0x53e3('0x37')][_0x53e3('0x14')](queryTrunks));_0x3501f2['push'](db[_0x53e3('0x1c')][_0x53e3('0x14')](queryCampaigns));_0x3501f2[_0x53e3('0x32')](db[_0x53e3('0x6')][_0x53e3('0x14')](queryAgents));break;case _0x53e3('0x38'):_0x15666b[_0xc0e66](_0x53e3('0x2e'));_0x15666b[_0xc0e66](_0x53e3('0x2f'));_0x3501f2[_0x53e3('0x32')](getAssociatedResources('VoiceQueues',_0x372d19[_0x53e3('0x24')],'VoiceQueue'));_0x3501f2[_0x53e3('0x32')](getAssociatedResources('ChatQueues',_0x372d19['userProfileId'],_0x53e3('0x39')));_0x3501f2[_0x53e3('0x32')](getAssociatedResources(_0x53e3('0x11'),_0x372d19['userProfileId'],'FaxQueue'));_0x3501f2['push'](getAssociatedResources(_0x53e3('0x12'),_0x372d19[_0x53e3('0x24')],_0x53e3('0x34')));_0x3501f2[_0x53e3('0x32')](getAssociatedResources(_0x53e3('0x13'),_0x372d19[_0x53e3('0x24')],_0x53e3('0x3a')));_0x3501f2[_0x53e3('0x32')](getAssociatedResources('OpenchannelQueues',_0x372d19[_0x53e3('0x24')],_0x53e3('0x35')));_0x3501f2[_0x53e3('0x32')](getAssociatedResources(_0x53e3('0x3b'),_0x372d19[_0x53e3('0x24')],'WhatsappQueue'));_0x3501f2['push'](getAssociatedResources(_0x53e3('0x3c'),_0x372d19['userProfileId'],_0x53e3('0x6')));_0x3501f2[_0x53e3('0x32')](getAssociatedResources(_0x53e3('0x15'),_0x372d19[_0x53e3('0x24')],'Trunk'));_0x3501f2[_0x53e3('0x32')](getAssociatedResources(_0x53e3('0x16'),_0x372d19[_0x53e3('0x24')],_0x53e3('0x1c')));_0x3501f2[_0x53e3('0x32')](db[_0x53e3('0x6')][_0x53e3('0x14')](queryAgents));break;case _0x53e3('0x9'):_0x15666b[_0xc0e66](_0x53e3('0x2e'));_0x15666b[_0xc0e66]('voice:outbound');_0x3501f2['push'](_0x372d19['getVoiceQueues']({'attributes':['id',_0x53e3('0x5')]}));_0x3501f2['push'](_0x372d19['getChatQueues']({'attributes':['id','name']}));_0x3501f2['push'](_0x372d19[_0x53e3('0x3d')]({'attributes':['id',_0x53e3('0x5')]}));_0x3501f2['push'](_0x372d19[_0x53e3('0x3e')]({'attributes':['id',_0x53e3('0x5')]}));_0x3501f2[_0x53e3('0x32')](_0x372d19['getMailQueues']({'attributes':['id',_0x53e3('0x5')]}));_0x3501f2[_0x53e3('0x32')](_0x372d19[_0x53e3('0x3f')]({'attributes':['id',_0x53e3('0x5')]}));_0x3501f2[_0x53e3('0x32')](_0x372d19[_0x53e3('0x40')]({'attributes':['id',_0x53e3('0x5')]}));break;}return BPromise[_0x53e3('0x41')](_0x3501f2);}})[_0x53e3('0x19')](function(_0x422203){if(_0x422203&&_0x422203[_0x53e3('0x1f')]){for(var _0x5a700e=0x0;_0x5a700e<_0x422203[_0x53e3('0x1f')];_0x5a700e+=0x1){for(var _0x115476=0x0;_0x115476<_0x422203[_0x5a700e][_0x53e3('0x1f')];_0x115476+=0x1){switch(_0x5a700e){case 0x0:joinOrLeaveQueues(_0x15666b,_0xc0e66,_0x53e3('0x42'),_0x422203[_0x5a700e][_0x115476]);break;case 0x1:joinOrLeaveQueues(_0x15666b,_0xc0e66,'chat',_0x422203[_0x5a700e][_0x115476]);break;case 0x2:joinOrLeaveQueues(_0x15666b,_0xc0e66,_0x53e3('0x43'),_0x422203[_0x5a700e][_0x115476]);break;case 0x3:joinOrLeaveQueues(_0x15666b,_0xc0e66,_0x53e3('0x44'),_0x422203[_0x5a700e][_0x115476]);break;case 0x4:joinOrLeaveQueues(_0x15666b,_0xc0e66,'mail',_0x422203[_0x5a700e][_0x115476]);break;case 0x5:joinOrLeaveQueues(_0x15666b,_0xc0e66,'openchannel',_0x422203[_0x5a700e][_0x115476]);break;case 0x6:joinOrLeaveQueues(_0x15666b,_0xc0e66,_0x53e3('0x45'),_0x422203[_0x5a700e][_0x115476]);break;case 0x7:_0x15666b[_0xc0e66](util[_0x53e3('0x1d')]('telephone:%s',_0x422203[_0x5a700e][_0x115476][_0x53e3('0x5')]));break;case 0x8:_0x15666b[_0xc0e66](util['format'](_0x53e3('0x46'),_0x422203[_0x5a700e][_0x115476][_0x53e3('0x5')]));break;case 0x9:_0x15666b[_0xc0e66](util[_0x53e3('0x1d')](_0x53e3('0x47'),_0x422203[_0x5a700e][_0x115476][_0x53e3('0xa')],_0x422203[_0x5a700e][_0x115476]['name']));break;case 0xa:_0x15666b[_0xc0e66](util[_0x53e3('0x1d')](_0x53e3('0x20'),_0x422203[_0x5a700e][_0x115476][_0x53e3('0x5')]));break;}}}}})[_0x53e3('0x19')](function(){if(_0xc0e66===_0x53e3('0x48')){var _0x5b1098=_['map'](_0x27be86[_0x53e3('0x26')],'id');return _0x27be86[_0x53e3('0x49')](_0x5b1098)['then'](function(){for(var _0xedf670=0x0;_0xedf670<_0x5b1098[_0x53e3('0x1f')];_0xedf670+=0x1){_0x1d3691[_0x53e3('0x4a')](_0x53e3('0x4b'),{'ChatInteractionId':Number(_0x5b1098[_0xedf670]),'UserId':Number(_0x27be86['id'])});}});}})[_0x53e3('0x19')](function(){if(_0xc0e66==='leave'){var _0x2bd461=_[_0x53e3('0x1a')](_0x27be86[_0x53e3('0x28')],'id');return _0x27be86[_0x53e3('0x4c')](_0x2bd461)['then'](function(){for(var _0x3dbfa8=0x0;_0x3dbfa8<_0x2bd461[_0x53e3('0x1f')];_0x3dbfa8+=0x1){_0x1d3691[_0x53e3('0x4a')]('user_has_mail_interactions:remove',{'MailInteractionId':Number(_0x2bd461[_0x3dbfa8]),'UserId':Number(_0x27be86['id'])});}});}})[_0x53e3('0x19')](function(){if(_0xc0e66===_0x53e3('0x48')){var _0x21a243=_[_0x53e3('0x1a')](_0x27be86[_0x53e3('0x4d')],'id');return _0x27be86[_0x53e3('0x4e')](_0x21a243)[_0x53e3('0x19')](function(){for(var _0x15c4e4=0x0;_0x15c4e4<_0x21a243[_0x53e3('0x1f')];_0x15c4e4+=0x1){_0x1d3691[_0x53e3('0x4a')](_0x53e3('0x4f'),{'FaxInteractionId':Number(_0x21a243[_0x15c4e4]),'UserId':Number(_0x27be86['id'])});}});}})[_0x53e3('0x19')](function(){if(_0xc0e66===_0x53e3('0x48')){var _0x2c90ad=_[_0x53e3('0x1a')](_0x27be86[_0x53e3('0x50')],'id');return _0x27be86['removeSmsInteractions'](_0x2c90ad)[_0x53e3('0x19')](function(){for(var _0x572f43=0x0;_0x572f43<_0x2c90ad[_0x53e3('0x1f')];_0x572f43+=0x1){_0x1d3691[_0x53e3('0x4a')](_0x53e3('0x51'),{'SmsInteractionId':Number(_0x2c90ad[_0x572f43]),'UserId':Number(_0x27be86['id'])});}});}})[_0x53e3('0x19')](function(){if(_0xc0e66==='leave'){var _0xb70704=_[_0x53e3('0x1a')](_0x27be86[_0x53e3('0x52')],'id');return _0x27be86['removeOpenchannelInteractions'](_0xb70704)[_0x53e3('0x19')](function(){for(var _0x2876f9=0x0;_0x2876f9<_0xb70704[_0x53e3('0x1f')];_0x2876f9+=0x1){_0x1d3691[_0x53e3('0x4a')](_0x53e3('0x53'),{'OpenchannelInteractionId':Number(_0xb70704[_0x2876f9]),'UserId':Number(_0x27be86['id'])});}});}})[_0x53e3('0x19')](function(){if(_0xc0e66===_0x53e3('0x48')){var _0x4665e1=_[_0x53e3('0x1a')](_0x27be86['WhatsappInteractions'],'id');return _0x27be86[_0x53e3('0x54')](_0x4665e1)[_0x53e3('0x19')](function(){for(var _0x48f305=0x0;_0x48f305<_0x4665e1[_0x53e3('0x1f')];_0x48f305+=0x1){_0x1d3691[_0x53e3('0x4a')]('user_has_whatsapp_interactions:remove',{'WhatsappInteractionId':Number(_0x4665e1[_0x48f305]),'UserId':Number(_0x27be86['id'])});}});}})[_0x53e3('0x55')](function(_0x30f782){_0x15666b[_0x53e3('0x56')](_0x30f782);});}}function onDisconnect(_0x42bac4,_0x2740d2){joinOrLeave(_0x42bac4,_0x53e3('0x48'),_0x2740d2);}function onConnect(_0x537828){joinOrLeave(_0x537828,_0x53e3('0x57'));}exports[_0x53e3('0x58')]=function(_0x357d61){_0x357d61['on'](_0x53e3('0x59'),function(_0x4c27cb){_0x4c27cb[_0x53e3('0x5a')](0x0);_0x4c27cb[_0x53e3('0x5b')]=_0x4c27cb['request'][_0x53e3('0x59')][_0x53e3('0x5c')]+':'+_0x4c27cb[_0x53e3('0x5d')][_0x53e3('0x59')][_0x53e3('0x5e')];_0x4c27cb[_0x53e3('0x5f')]=new Date();_0x4c27cb[_0x53e3('0x56')]=function(_0x595c07){console['log']('SocketIO\x20'+_0x4c27cb['nsp'][_0x53e3('0x5')]+'['+_0x4c27cb[_0x53e3('0x5b')]+']',_0x595c07);};_0x4c27cb['on']('disconnect',function(){onDisconnect(_0x4c27cb,_0x357d61);_0x4c27cb[_0x53e3('0x56')]('DISCONNECTED');});onConnect(_0x4c27cb);_0x4c27cb[_0x53e3('0x56')](_0x53e3('0x60'));});};
\ No newline at end of file
diff --git a/server/config/triggers/index.js b/server/config/triggers/index.js
index ea1f9ae..3c4e0da 100644
--- a/server/config/triggers/index.js
+++ b/server/config/triggers/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xccda=['hasOwnProperty','model','hook','toLowerCase','condition','util','jayson/promise','../logger','triggers','client','http','Chat','afterCreate','afterUpdate','ChatMessage','newmessage','SmsInteraction','newinteraction','Sms','closedinteraction','SmsMessage','WhatsappInteraction','Whatsapp','Fax','FaxInteraction','FaxMessage','MailInteraction','Mail','MailMessage','Openchannel','OpenchannelInteraction','request','EventManager','then','info','error','code','Trigger,\x20%s','catch','get','event','direction','UserId','name','format','SIP/%s','channel','incomingmessage','outgoingmessage','opened','changed','closed','User','default','length'];(function(_0x239587,_0x438ff1){var _0x8d6acb=function(_0x1232ee){while(--_0x1232ee){_0x239587['push'](_0x239587['shift']());}};_0x8d6acb(++_0x438ff1);}(_0xccda,0x14f));var _0xaccd=function(_0x212b5d,_0x318113){_0x212b5d=_0x212b5d-0x0;var _0xd29835=_0xccda[_0x212b5d];return _0xd29835;};'use strict';var util=require(_0xaccd('0x0'));var db=require('../../mysqldb')['db'];var jayson=require(_0xaccd('0x1'));var logger=require(_0xaccd('0x2'))(_0xaccd('0x3'));var client=jayson[_0xaccd('0x4')][_0xaccd('0x5')]({'port':0x232a});var triggers=[{'channel':_0xaccd('0x6'),'model':'ChatInteraction','event':_0xaccd('0x7'),'condition':'newinteraction','callback':afterCreate},{'channel':_0xaccd('0x6'),'model':'ChatInteraction','event':_0xaccd('0x8'),'condition':'closedinteraction','callback':afterUpdate},{'channel':_0xaccd('0x6'),'model':_0xaccd('0x9'),'event':'afterCreate','condition':_0xaccd('0xa'),'callback':afterCreateMessage},{'channel':'Sms','model':_0xaccd('0xb'),'event':_0xaccd('0x7'),'condition':_0xaccd('0xc'),'callback':afterCreate},{'channel':_0xaccd('0xd'),'model':_0xaccd('0xb'),'event':_0xaccd('0x8'),'condition':_0xaccd('0xe'),'callback':afterUpdate},{'channel':'Sms','model':_0xaccd('0xf'),'event':_0xaccd('0x7'),'condition':_0xaccd('0xa'),'callback':afterCreateMessage},{'channel':'Whatsapp','model':_0xaccd('0x10'),'event':'afterCreate','condition':_0xaccd('0xc'),'callback':afterCreate},{'channel':_0xaccd('0x11'),'model':'WhatsappInteraction','event':_0xaccd('0x8'),'condition':'closedinteraction','callback':afterUpdate},{'channel':'Whatsapp','model':'WhatsappMessage','event':_0xaccd('0x7'),'condition':_0xaccd('0xa'),'callback':afterCreateMessage},{'channel':_0xaccd('0x12'),'model':_0xaccd('0x13'),'event':_0xaccd('0x7'),'condition':'newinteraction','callback':afterCreate},{'channel':_0xaccd('0x12'),'model':_0xaccd('0x13'),'event':'afterUpdate','condition':'closedinteraction','callback':afterUpdate},{'channel':_0xaccd('0x12'),'model':_0xaccd('0x14'),'event':_0xaccd('0x7'),'condition':'newmessage','callback':afterCreateMessage},{'channel':'Mail','model':_0xaccd('0x15'),'event':_0xaccd('0x7'),'condition':_0xaccd('0xc'),'callback':afterCreate},{'channel':_0xaccd('0x16'),'model':'MailInteraction','event':_0xaccd('0x8'),'condition':_0xaccd('0xe'),'callback':afterUpdate},{'channel':'Mail','model':_0xaccd('0x17'),'event':'afterCreate','condition':_0xaccd('0xa'),'callback':afterCreateMessage},{'channel':_0xaccd('0x18'),'model':_0xaccd('0x19'),'event':'afterCreate','condition':_0xaccd('0xc'),'callback':afterCreate},{'channel':_0xaccd('0x18'),'model':'OpenchannelInteraction','event':_0xaccd('0x8'),'condition':_0xaccd('0xe'),'callback':afterUpdate},{'channel':_0xaccd('0x18'),'model':'OpenchannelMessage','event':'afterCreate','condition':_0xaccd('0xa'),'callback':afterCreateMessage}];function request(_0x1f756b){return client[_0xaccd('0x1a')](_0xaccd('0x1b'),_0x1f756b)[_0xaccd('0x1c')](function(_0x76e7a6){logger[_0xaccd('0x1d')]('Trigger,\x20%s',_0xaccd('0x1b'),_0x76e7a6);if(_0x76e7a6[_0xaccd('0x1e')]){if(_0x76e7a6[_0xaccd('0x1e')][_0xaccd('0x1f')]===0x1f4){logger[_0xaccd('0x1e')](_0xaccd('0x20'),_0xaccd('0x1b'),_0x76e7a6[_0xaccd('0x1e')]);}}})[_0xaccd('0x21')](function(_0x39636c){logger[_0xaccd('0x1e')]('Trigger,\x20%s','EventManager',_0x39636c);});}function afterCreateMessage(_0xa5e35e,_0x5b6ea2){return function(_0x7b51ae,_0x1b2610){_0x7b51ae=_0x7b51ae[_0xaccd('0x22')]({'plain':!![]});_0x7b51ae['channel']=_0xa5e35e;_0x7b51ae[_0xaccd('0x23')]=_0x7b51ae[_0xaccd('0x24')];if(_0x7b51ae['UserId']){return db['User']['find']({'where':{'id':_0x7b51ae[_0xaccd('0x25')]},'attributes':['id',_0xaccd('0x26')],'raw':!![]})['then'](function(_0x221021){_0x7b51ae['interface']=util[_0xaccd('0x27')](_0xaccd('0x28'),_0x221021['name']);_0x7b51ae[_0xaccd('0x29')]=_0xa5e35e;return request({'event':_0xaccd('0x2a'),'message':_0x7b51ae});})[_0xaccd('0x21')](function(_0x442b4c){console[_0xaccd('0x1e')](_0x442b4c);});}else{return request({'event':_0xaccd('0x2b'),'message':_0x7b51ae});}};}function afterCreate(_0x42ff1c,_0x4b3713){return function(_0x150271,_0x3a93b1){_0x150271=_0x150271[_0xaccd('0x22')]({'plain':!![]});_0x150271[_0xaccd('0x29')]=_0x42ff1c;_0x150271[_0xaccd('0x23')]=_0xaccd('0x2c');return request({'event':_0x4b3713,'message':_0x150271});};}function afterUpdate(_0x530bc9,_0x2e8649){return function(_0x403174,_0x1ee87a){if(_0x403174[_0xaccd('0x2d')]('closed')&&_0x403174[_0xaccd('0x2e')]){_0x403174=_0x403174[_0xaccd('0x22')]({'plain':!![]});_0x403174[_0xaccd('0x29')]=_0x530bc9;_0x403174[_0xaccd('0x23')]=_0xaccd('0x2e');if(_0x403174[_0xaccd('0x25')]){return db[_0xaccd('0x2f')]['find']({'where':{'id':_0x403174[_0xaccd('0x25')]},'attributes':['id',_0xaccd('0x26')],'raw':!![]})[_0xaccd('0x1c')](function(_0x1a6346){_0x403174['interface']=util[_0xaccd('0x27')](_0xaccd('0x28'),_0x1a6346[_0xaccd('0x26')]);return request({'event':_0x2e8649,'message':_0x403174});})[_0xaccd('0x21')](function(_0x5bac52){console[_0xaccd('0x1e')](_0x5bac52);});}else{return request({'event':_0x2e8649,'message':_0x403174});}}};}exports[_0xaccd('0x30')]=function(){for(var _0x3873ef=0x0;_0x3873ef=_0x1a1785['agents']){throw Error(_0xf432('0x14'));}_0x52b5dc(_0x1246ae);})[_0xf432('0x15')](function(_0x336164){_0xc84b92(_0x336164);});});};
\ No newline at end of file
+var _0xbdda=['then','agents','Maximum\x20login\x20has\x20been\x20reached','catch','lodash','bluebird','../mysqldb','./license/util','voice','mail','chat','fax','sms','whatsapp','openchannel','getChannels','toLowerCase','isUndefined','blockedAt','updateAttributes','getLicense','agent','count'];(function(_0x21ee4f,_0x360b81){var _0x1a3ec7=function(_0x3b9d84){while(--_0x3b9d84){_0x21ee4f['push'](_0x21ee4f['shift']());}};_0x1a3ec7(++_0x360b81);}(_0xbdda,0x1b9));var _0xabdd=function(_0x45bf2f,_0x14efce){_0x45bf2f=_0x45bf2f-0x0;var _0x202857=_0xbdda[_0x45bf2f];return _0x202857;};'use strict';var _=require(_0xabdd('0x0'));var BPromise=require(_0xabdd('0x1'));var db=require(_0xabdd('0x2'))['db'];var util=require(_0xabdd('0x3'));var channels=[_0xabdd('0x4'),_0xabdd('0x5'),_0xabdd('0x6'),_0xabdd('0x7'),_0xabdd('0x8'),_0xabdd('0x9'),_0xabdd('0xa')];exports[_0xabdd('0xb')]=function(){return channels;};exports['isValidChannel']=function(_0x27e118){_0x27e118=_0x27e118[_0xabdd('0xc')]();return _['includes'](channels,_0x27e118);};exports['clearBlockUser']=function(_0x810395,_0x3f2fc7,_0x594191,_0x46b4ab){var _0x21f9c1={'loginAttempts':_0x3f2fc7,'blocked':_0x594191};if(!_[_0xabdd('0xd')](_0x46b4ab)){_0x21f9c1[_0xabdd('0xe')]=_0x46b4ab;}return _0x810395[_0xabdd('0xf')](_0x21f9c1);};exports[_0xabdd('0x10')]=function(_0x42fd96){return new BPromise(function(_0x1abd7e,_0x5c6370){var _0xed8139=0x0;if(_0x42fd96['role']!==_0xabdd('0x11')){_0x1abd7e(_0x42fd96);}db['User'][_0xabdd('0x12')]({'where':{'role':'agent','online':!![],'id':{'$ne':_0x42fd96['id']}}})['then'](function(_0x3a29a1){_0xed8139=_0x3a29a1;return util['getLicense']();})[_0xabdd('0x13')](function(_0x3fbef0){if(_0x3fbef0&&_0x3fbef0[_0xabdd('0x14')]&&_0xed8139>=_0x3fbef0['agents']){throw Error(_0xabdd('0x15'));}_0x1abd7e(_0x42fd96);})[_0xabdd('0x16')](function(_0x3e2803){_0x5c6370(_0x3e2803);});});};
\ No newline at end of file
diff --git a/server/errors/index.js b/server/errors/index.js
index 660a914..65d081a 100644
--- a/server/errors/index.js
+++ b/server/errors/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x3eef=['render','json','send','exports','status'];(function(_0x244fdd,_0x1de564){var _0x51cd53=function(_0x3f75c3){while(--_0x3f75c3){_0x244fdd['push'](_0x244fdd['shift']());}};_0x51cd53(++_0x1de564);}(_0x3eef,0x19d));var _0xf3ee=function(_0x36ec2a,_0x4f1e02){_0x36ec2a=_0x36ec2a-0x0;var _0xbb2583=_0x3eef[_0x36ec2a];return _0xbb2583;};'use strict';module[_0xf3ee('0x0')][0x194]=function pageNotFound(_0x29a6d8,_0x271fbd){var _0x318748='404';var _0x3fd0d3=0x194;var _0x451a3b={'status':_0x3fd0d3};_0x271fbd[_0xf3ee('0x1')](_0x451a3b[_0xf3ee('0x1')]);_0x271fbd[_0xf3ee('0x2')](_0x318748,{},function(_0x5df701,_0x1c72e6){if(_0x5df701){return _0x271fbd[_0xf3ee('0x1')](_0x451a3b['status'])[_0xf3ee('0x3')](_0x451a3b);}_0x271fbd[_0xf3ee('0x4')](_0x1c72e6);});};
\ No newline at end of file
+var _0xe24c=['status','render','json','send','404'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0xe24c,0xb3));var _0xce24=function(_0x138adb,_0x193fee){_0x138adb=_0x138adb-0x0;var _0x1b27f2=_0xe24c[_0x138adb];return _0x1b27f2;};'use strict';module['exports'][0x194]=function pageNotFound(_0x136fe6,_0x52d89){var _0x49d5f8=_0xce24('0x0');var _0x2a8905=0x194;var _0x27f555={'status':_0x2a8905};_0x52d89[_0xce24('0x1')](_0x27f555[_0xce24('0x1')]);_0x52d89[_0xce24('0x2')](_0x49d5f8,{},function(_0x4f8521,_0x2439fe){if(_0x4f8521){return _0x52d89[_0xce24('0x1')](_0x27f555[_0xce24('0x1')])[_0xce24('0x3')](_0x27f555);}_0x52d89[_0xce24('0x4')](_0x2439fe);});};
\ No newline at end of file
diff --git a/server/mysqldb/index.js b/server/mysqldb/index.js
index 50c45df..c0599d9 100644
--- a/server/mysqldb/index.js
+++ b/server/mysqldb/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xb182=['ChatQueueReport','../api/chatQueueReport/chatQueueReport.model','../api/chatInternalMessage/chatInternalMessage.model','JscriptyAnswerReport','../api/jscriptyAnswerReport/jscriptyAnswerReport.model','JscriptyQuestionReport','../api/jscriptyQuestionReport/jscriptyQuestionReport.model','JscriptySessionReport','../api/jscriptySessionReport/jscriptySessionReport.model','SquareReport','../api/squareReport/squareReport.model','JscriptyProject','../api/jscriptyProject/jscriptyProject.model','Setting','../api/setting/setting.model','../api/squareOdbc/squareOdbc.model','SquareProject','../api/squareMessage/squareMessage.model','../api/team/team.model','License','Campaign','../api/campaign/campaign.model','../api/migration/migration.model','Attachment','Plugin','../api/plugin/plugin.model','MailTransferReport','ChatTransferReport','../api/chatTransferReport/chatTransferReport.model','FaxTransferReport','../api/faxTransferReport/faxTransferReport.model','OpenchannelTransferReport','CmList','../api/cmList/cmList.model','VoicePrefix','../api/voicePrefix/voicePrefix.model','UserProfile','../api/userProfile/userProfile.model','UserProfileSection','../api/userProfileSection/userProfileSection.model','UserProfileResource','Notification','../api/notification/notification.model','WhatsappAccount','../api/whatsappAccount/whatsappAccount.model','WhatsappApplication','../api/whatsappApplication/whatsappApplication.model','WhatsappInteraction','WhatsappMessage','../api/whatsappMessage/whatsappMessage.model','WhatsappQueueReport','../api/whatsappQueueReport/whatsappQueueReport.model','WhatsappTransferReport','../api/whatsappTransferReport/whatsappTransferReport.model','WhatsappQueue','../api/whatsappQueue/whatsappQueue.model','CloudProvider','../api/cloudProvider/cloudProvider.model','hasOne','VoiceMail','UserId','hasMany','Recordings','VoiceQueuesRt','Extensions','cascade','HopperFinals','CmHopperHistory','HopperHistory','OpenchannelInteractions','ChatInteractions','SmsInteractions','FaxInteractions','MailInteractions','WhatsappInteractions','Notifications','SenderId','belongsToMany','Groups','Contacts','cm_user_has_contacts','Lists','cm_user_has_lists','Team','user_has_teams','user_has_mail_interactions','user_has_chat_interactions','user_has_fax_interactions','user_has_sms_interactions','user_has_openchannel_interactions','user_has_whatsapp_interactions','VoiceQueues','UserVoiceQueue','MailQueues','ChatQueues','FaxQueues','SmsQueues','OpenchannelQueues','WhatsappQueues','VoicePrefixes','ChatWebsites','MailAccounts','OpenchannelAccounts','user_has_openchannel_accounts','SmsAccounts','WhatsappAccounts','user_has_whatsapp_accounts','SquareProjects','user_has_square_projects','VoiceChanSpy','SpiedAgents','ChanSpyId','Applications','Sounds','moh_has_sounds','Members','VoiceQueueId','Hoppers','HopperHistories','CmHopperBlack','HopperBlacks','JscriptySessions','TrunkId','belongsTo','TrunkBackup','TrunkBackupId','Interval','Agents','Teams','team_has_voice_queues','voice_queues_has_cm_blacklists','ScreenRecording','Messages','mailboxuser','mailbox','QueueCalls','uniqueid','AgentReports','Contact','MailAccountId','Imap','Answers','Interactions','List','ListId','TemplateId','mandatoryDispositionPauseId','team_has_mail_queues','MailInteractionId','Account','Owner','mail_interaction_has_tags','Tags','ThroughTags','Users','Attachments','Interaction','restrict','Tag','TagId','ContactId','Items','Dispositions','FaxAccountId','Exntensions','user_has_fax_accounts','FaxInteractionId','fax_interaction_has_tags','team_has_fax_queues','SmsAccountId','SmsInteraction','SmsApplication','user_has_sms_accounts','SmsInteractionId','sms_interaction_has_tags','team_has_sms_queues','OpenchannelAccountId','OpenchannelMessage','mandatoryDispositionPause','OpenchannelQueueId','IntervalId','openchannel_interaction_has_tags','AttachmentId','ChatWebsite','ChatWebsiteId','ProactiveActions','user_has_chat_websites','Agent','ChatQueueId','chat_interaction_has_tags','ChatInteractionId','ChatOfflineMessage','team_has_chat_queues','ChatInternalMessage','chat_group_has_users','Website','Company','CompanyId','cm_contact_has_tags','Queue','CampaignId','All','OneAll','AutomationAllId','Any','OneAny','AutomationAnyId','Actions','MailApplications','FaxApplications','SmsApplications','DefaultReportId','Schedule','Mohs','whatsapp_interaction_has_tags','AllConditions','AllCondition','TriggerAllId','AnyCondition','TriggerId','Fields','CustomReportId','AnalyticMetric','MetricId','SalesforceConfiguration','Configurations','AccountId','SalesforceField','Subjects','SubjectId','Descriptions','Subject','FieldId','VariableId','SugarcrmField','Description','DeskAccount','int_desk_configuration_has_tags','DescriptionId','Field','ZendeskConfiguration','FreshdeskConfiguration','int_freshdesk_configuration_has_tags','VtigerConfiguration','VtigerField','ServicenowConfiguration','FromId','ToId','SessionId','SmsQueueReport','ProjectId','team_has_openchannel_queues','team_has_whatsapp_queues','SquareProjectId','campaigns_has_cm_lists','BlackLists','FromMailAccountId','FromAccount','FromUserId','ToUserId','ToQueue','ToMailAccountId','ToAccount','FromChatWebsiteId','FromAgent','ToAgent','ToChatQueueId','FromFaxAccountId','ToFaxQueueId','ToFaxAccountId','FromOpenchannelAccountId','ToOpenchannelQueueId','ToOpenchannelAccountId','SmsTransferReport','FromSmsAccountId','ToSmsQueueId','ToSmsAccountId','CustomFields','Queues','user_has_voice_prefixes','userProfileId','sectionId','WhatsappAccountId','WhatsappInteractionId','FromWhatsappAccountId','ToQueueId','UserWhatsappQueue','WhatsappQueueId','exports','../config/environment','sequelize','lodash','defaultsDeep','xcall','xC@LL1234','127.0.0.1','mysql','utf8mb4','name','utf8','sequelizeHistory','motion2','utf8_general_ci','username','options','database','password','User','../api/user/user.model','../api/voiceChanSpy/voiceChanSpy.model','VoiceContext','import','../api/voiceContext/voiceContext.model','VoiceExtension','../api/voiceExtension/voiceExtension.model','VoiceMusicOnHold','../api/voiceMusicOnHold/voiceMusicOnHold.model','VoiceQueue','../api/voiceQueue/voiceQueue.model','VoiceRecording','../api/voiceRecording/voiceRecording.model','../api/screenRecording/screenRecording.model','../api/voiceMail/voiceMail.model','VoiceMailMessage','../api/voiceMailMessage/voiceMailMessage.model','VoiceCallReport','../api/voiceCallReport/voiceCallReport.model','VoiceDialReport','../api/voiceDialReport/voiceDialReport.model','VoiceAgentReport','../api/voiceAgentReport/voiceAgentReport.model','VoiceQueueReport','../api/voiceQueueReport/voiceQueueReport.model','MemberReport','../api/memberReport/memberReport.model','Trunk','../api/trunk/trunk.model','VoiceTransferReport','UserVoiceQueueRt','../api/userVoiceQueueRt/userVoiceQueueRt.model','../api/userVoiceQueue/userVoiceQueue.model','UserChatQueue','../api/userChatQueue/userChatQueue.model','UserMailQueue','../api/userMailQueue/userMailQueue.model','UserFaxQueue','../api/userFaxQueue/userFaxQueue.model','UserSmsQueue','UserOpenchannelQueue','../api/userOpenchannelQueue/userOpenchannelQueue.model','../api/userWhatsappQueue/userWhatsappQueue.model','MailServerIn','../api/mailServerIn/mailServerIn.model','MailServerOut','../api/mailServerOut/mailServerOut.model','MailAccount','../api/mailAccount/mailAccount.model','MailQueue','../api/mailQueue/mailQueue.model','MailSubstatus','../api/mailSubstatus/mailSubstatus.model','MailInteraction','../api/mailInteraction/mailInteraction.model','MailMessage','../api/mailMessage/mailMessage.model','MailApplication','../api/mailApplication/mailApplication.model','MailQueueReport','../api/mailQueueReport/mailQueueReport.model','Dashboard','DashboardItem','../api/dashboardItem/dashboardItem.model','FaxAccount','FaxApplication','../api/faxApplication/faxApplication.model','FaxInteraction','../api/faxInteraction/faxInteraction.model','FaxMessage','../api/faxMessage/faxMessage.model','FaxQueue','../api/faxQueue/faxQueue.model','FaxQueueReport','SmsAccount','../api/smsAccount/smsAccount.model','../api/smsApplication/smsApplication.model','../api/smsInteraction/smsInteraction.model','SmsMessage','../api/smsMessage/smsMessage.model','SmsQueue','../api/smsQueue/smsQueue.model','OpenchannelAccount','../api/openchannelAccount/openchannelAccount.model','OpenchannelApplication','OpenchannelInteraction','../api/openchannelInteraction/openchannelInteraction.model','OpenchannelQueue','../api/openchannelQueue/openchannelQueue.model','OpenchannelQueueReport','../api/openchannelQueueReport/openchannelQueueReport.model','ChatApplication','../api/chatApplication/chatApplication.model','ChatInteraction','../api/chatInteraction/chatInteraction.model','ChatMessage','ChatQueue','../api/chatQueue/chatQueue.model','ChatGroup','../api/chatGroup/chatGroup.model','ChatProactiveAction','CmCompany','../api/cmCompany/cmCompany.model','CmContact','CmHopper','../api/cmHopper/cmHopper.model','../api/cmHopperBlack/cmHopperBlack.model','CmHopperFinal','../api/cmHopperFinal/cmHopperFinal.model','../api/cmHopperHistory/cmHopperHistory.model','ReportAgentPreview','../api/reportAgentPreview/reportAgentPreview.model','CmCustomField','../api/cmCustomField/cmCustomField.model','Action','../api/action/action.model','Automation','../api/automation/automation.model','CannedAnswer','../api/cannedAnswer/cannedAnswer.model','Disposition','../api/disposition/disposition.model','Condition','../api/condition/condition.model','../api/interval/interval.model','Pause','../api/pause/pause.model','Cdr','../api/cdr/cdr.model','../api/voiceQueuesLog/voiceQueuesLog.model','../api/schedule/schedule.model','Sound','../api/tag/tag.model','Template','../api/template/template.model','Trigger','../api/trigger/trigger.model','Variable','../api/variable/variable.model','Integration','../api/integration/integration.model','IntegrationReport','../api/integrationReport/integrationReport.model','AnalyticCustomReport','../api/analyticCustomReport/analyticCustomReport.model','AnalyticDefaultReport','../api/analyticDefaultReport/analyticDefaultReport.model','AnalyticExtractedReport','../api/analyticExtractedReport/analyticExtractedReport.model','../api/analyticMetric/analyticMetric.model','AnalyticFieldReport','../api/analyticFieldReport/analyticFieldReport.model','AnalyticTreeReport','SalesforceAccount','../api/intSalesforceAccount/intSalesforceAccount.model','../api/intSalesforceConfiguration/intSalesforceConfiguration.model','../api/intSalesforceField/intSalesforceField.model','SugarcrmAccount','SugarcrmConfiguration','../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model','../api/intSugarcrmField/intSugarcrmField.model','../api/intDeskAccount/intDeskAccount.model','DeskConfiguration','../api/intDeskConfiguration/intDeskConfiguration.model','DeskField','../api/intDeskField/intDeskField.model','ZohoAccount','../api/intZohoAccount/intZohoAccount.model','ZohoConfiguration','ZohoField','../api/intZohoField/intZohoField.model','ZendeskAccount','../api/intZendeskAccount/intZendeskAccount.model','../api/intZendeskConfiguration/intZendeskConfiguration.model','ZendeskField','FreshdeskAccount','../api/intFreshdeskAccount/intFreshdeskAccount.model','../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model','FreshdeskField','../api/intFreshdeskField/intFreshdeskField.model','VtigerAccount','../api/intVtigerAccount/intVtigerAccount.model','../api/intVtigerConfiguration/intVtigerConfiguration.model','../api/intVtigerField/intVtigerField.model','ServicenowAccount','../api/intServicenowConfiguration/intServicenowConfiguration.model','ServicenowField','../api/intServicenowField/intServicenowField.model','Dynamics365Account','Dynamics365Configuration','../api/intDynamics365Configuration/intDynamics365Configuration.model','Dynamics365Field','../api/intDynamics365Field/intDynamics365Field.model','FreshsalesAccount','FreshsalesConfiguration','../api/intFreshsalesConfiguration/intFreshsalesConfiguration.model','FreshsalesField','../api/intFreshsalesField/intFreshsalesField.model','../api/network/network.model'];(function(_0x4fa0f1,_0x46f90c){var _0xc09fef=function(_0x465032){while(--_0x465032){_0x4fa0f1['push'](_0x4fa0f1['shift']());}};_0xc09fef(++_0x46f90c);}(_0xb182,0x121));var _0x2b18=function(_0x24618a,_0x2cd0f4){_0x24618a=_0x24618a-0x0;var _0x2e3d64=_0xb182[_0x24618a];return _0x2e3d64;};'use strict';var path=require('path');var config=require(_0x2b18('0x0'));var Sequelize=require(_0x2b18('0x1'));var _=require(_0x2b18('0x2'));var jstz=require('jstz');var timezone=jstz['determine']();config[_0x2b18('0x1')]=_[_0x2b18('0x3')](config[_0x2b18('0x1')],{'database':'motion2','username':_0x2b18('0x4'),'password':_0x2b18('0x5'),'options':{'host':_0x2b18('0x6'),'port':0xcea,'dialect':_0x2b18('0x7'),'dialectOptions':{'charset':_0x2b18('0x8')},'logging':![],'timezone':timezone[_0x2b18('0x9')](),'define':{'charset':_0x2b18('0xa'),'collate':'utf8_general_ci'}}});config[_0x2b18('0xb')]=_[_0x2b18('0x3')](config[_0x2b18('0xb')],{'database':_0x2b18('0xc'),'username':_0x2b18('0x4'),'password':_0x2b18('0x5'),'options':{'host':_0x2b18('0x6'),'port':0xcea,'dialect':_0x2b18('0x7'),'dialectOptions':{'charset':_0x2b18('0x8')},'logging':![],'timezone':timezone[_0x2b18('0x9')](),'define':{'charset':_0x2b18('0xa'),'collate':_0x2b18('0xd')}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0x2b18('0x1')]['database'],config[_0x2b18('0x1')][_0x2b18('0xe')],config['sequelize']['password'],config[_0x2b18('0x1')][_0x2b18('0xf')])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0x2b18('0xb')][_0x2b18('0x10')],config[_0x2b18('0xb')][_0x2b18('0xe')],config[_0x2b18('0xb')][_0x2b18('0x11')],config['sequelizeHistory'][_0x2b18('0xf')])};db[_0x2b18('0x12')]=db[_0x2b18('0x1')]['import'](_0x2b18('0x13'));db['VoiceChanSpy']=db['sequelize']['import'](_0x2b18('0x14'));db[_0x2b18('0x15')]=db[_0x2b18('0x1')][_0x2b18('0x16')](_0x2b18('0x17'));db[_0x2b18('0x18')]=db[_0x2b18('0x1')]['import'](_0x2b18('0x19'));db[_0x2b18('0x1a')]=db['sequelize']['import'](_0x2b18('0x1b'));db[_0x2b18('0x1c')]=db['sequelize'][_0x2b18('0x16')](_0x2b18('0x1d'));db[_0x2b18('0x1e')]=db[_0x2b18('0x1')]['import'](_0x2b18('0x1f'));db['ScreenRecording']=db[_0x2b18('0x1')][_0x2b18('0x16')](_0x2b18('0x20'));db['VoiceMail']=db['sequelize']['import'](_0x2b18('0x21'));db[_0x2b18('0x22')]=db[_0x2b18('0x1')][_0x2b18('0x16')](_0x2b18('0x23'));db[_0x2b18('0x24')]=db[_0x2b18('0x1')][_0x2b18('0x16')](_0x2b18('0x25'));db[_0x2b18('0x26')]=db[_0x2b18('0x1')][_0x2b18('0x16')](_0x2b18('0x27'));db[_0x2b18('0x28')]=db[_0x2b18('0x1')][_0x2b18('0x16')](_0x2b18('0x29'));db[_0x2b18('0x2a')]=db[_0x2b18('0x1')][_0x2b18('0x16')](_0x2b18('0x2b'));db[_0x2b18('0x2c')]=db[_0x2b18('0x1')][_0x2b18('0x16')](_0x2b18('0x2d'));db[_0x2b18('0x2e')]=db[_0x2b18('0x1')][_0x2b18('0x16')](_0x2b18('0x2f'));db[_0x2b18('0x30')]=db[_0x2b18('0x1')][_0x2b18('0x16')]('../api/voiceTransferReport/voiceTransferReport.model');db[_0x2b18('0x31')]=db[_0x2b18('0x1')][_0x2b18('0x16')](_0x2b18('0x32'));db['UserVoiceQueue']=db['sequelize']['import'](_0x2b18('0x33'));db[_0x2b18('0x34')]=db[_0x2b18('0x1')][_0x2b18('0x16')](_0x2b18('0x35'));db[_0x2b18('0x36')]=db[_0x2b18('0x1')][_0x2b18('0x16')](_0x2b18('0x37'));db[_0x2b18('0x38')]=db[_0x2b18('0x1')][_0x2b18('0x16')](_0x2b18('0x39'));db[_0x2b18('0x3a')]=db['sequelize']['import']('../api/userSmsQueue/userSmsQueue.model');db[_0x2b18('0x3b')]=db[_0x2b18('0x1')][_0x2b18('0x16')](_0x2b18('0x3c'));db['UserWhatsappQueue']=db['sequelize'][_0x2b18('0x16')](_0x2b18('0x3d'));db[_0x2b18('0x3e')]=db[_0x2b18('0x1')][_0x2b18('0x16')](_0x2b18('0x3f'));db[_0x2b18('0x40')]=db[_0x2b18('0x1')][_0x2b18('0x16')](_0x2b18('0x41'));db[_0x2b18('0x42')]=db[_0x2b18('0x1')][_0x2b18('0x16')](_0x2b18('0x43'));db[_0x2b18('0x44')]=db[_0x2b18('0x1')]['import'](_0x2b18('0x45'));db[_0x2b18('0x46')]=db[_0x2b18('0x1')][_0x2b18('0x16')](_0x2b18('0x47'));db[_0x2b18('0x48')]=db[_0x2b18('0x1')][_0x2b18('0x16')](_0x2b18('0x49'));db[_0x2b18('0x4a')]=db[_0x2b18('0x1')][_0x2b18('0x16')](_0x2b18('0x4b'));db[_0x2b18('0x4c')]=db[_0x2b18('0x1')][_0x2b18('0x16')](_0x2b18('0x4d'));db[_0x2b18('0x4e')]=db[_0x2b18('0x1')][_0x2b18('0x16')](_0x2b18('0x4f'));db[_0x2b18('0x50')]=db[_0x2b18('0x1')]['import']('../api/dashboard/dashboard.model');db[_0x2b18('0x51')]=db[_0x2b18('0x1')][_0x2b18('0x16')](_0x2b18('0x52'));db[_0x2b18('0x53')]=db[_0x2b18('0x1')]['import']('../api/faxAccount/faxAccount.model');db[_0x2b18('0x54')]=db[_0x2b18('0x1')][_0x2b18('0x16')](_0x2b18('0x55'));db[_0x2b18('0x56')]=db['sequelize']['import'](_0x2b18('0x57'));db[_0x2b18('0x58')]=db['sequelize']['import'](_0x2b18('0x59'));db[_0x2b18('0x5a')]=db[_0x2b18('0x1')][_0x2b18('0x16')](_0x2b18('0x5b'));db[_0x2b18('0x5c')]=db[_0x2b18('0x1')][_0x2b18('0x16')]('../api/faxQueueReport/faxQueueReport.model');db[_0x2b18('0x5d')]=db[_0x2b18('0x1')]['import'](_0x2b18('0x5e'));db['SmsApplication']=db['sequelize']['import'](_0x2b18('0x5f'));db['SmsInteraction']=db['sequelize'][_0x2b18('0x16')](_0x2b18('0x60'));db[_0x2b18('0x61')]=db[_0x2b18('0x1')][_0x2b18('0x16')](_0x2b18('0x62'));db[_0x2b18('0x63')]=db[_0x2b18('0x1')]['import'](_0x2b18('0x64'));db[_0x2b18('0x65')]=db[_0x2b18('0x1')][_0x2b18('0x16')](_0x2b18('0x66'));db[_0x2b18('0x67')]=db[_0x2b18('0x1')][_0x2b18('0x16')]('../api/openchannelApplication/openchannelApplication.model');db[_0x2b18('0x68')]=db[_0x2b18('0x1')][_0x2b18('0x16')](_0x2b18('0x69'));db['OpenchannelMessage']=db[_0x2b18('0x1')][_0x2b18('0x16')]('../api/openchannelMessage/openchannelMessage.model');db[_0x2b18('0x6a')]=db[_0x2b18('0x1')][_0x2b18('0x16')](_0x2b18('0x6b'));db['ChatWebsite']=db[_0x2b18('0x1')]['import']('../api/chatWebsite/chatWebsite.model');db[_0x2b18('0x6c')]=db['sequelize'][_0x2b18('0x16')](_0x2b18('0x6d'));db[_0x2b18('0x6e')]=db[_0x2b18('0x1')][_0x2b18('0x16')](_0x2b18('0x6f'));db[_0x2b18('0x70')]=db[_0x2b18('0x1')]['import'](_0x2b18('0x71'));db[_0x2b18('0x72')]=db['sequelize'][_0x2b18('0x16')]('../api/chatMessage/chatMessage.model');db['ChatOfflineMessage']=db[_0x2b18('0x1')]['import']('../api/chatOfflineMessage/chatOfflineMessage.model');db[_0x2b18('0x73')]=db[_0x2b18('0x1')][_0x2b18('0x16')](_0x2b18('0x74'));db[_0x2b18('0x75')]=db['sequelize'][_0x2b18('0x16')](_0x2b18('0x76'));db[_0x2b18('0x77')]=db['sequelize'][_0x2b18('0x16')]('../api/chatProactiveAction/chatProactiveAction.model');db[_0x2b18('0x78')]=db[_0x2b18('0x1')][_0x2b18('0x16')](_0x2b18('0x79'));db[_0x2b18('0x7a')]=db['sequelize'][_0x2b18('0x16')]('../api/cmContact/cmContact.model');db[_0x2b18('0x7b')]=db[_0x2b18('0x1')][_0x2b18('0x16')](_0x2b18('0x7c'));db['CmHopperBlack']=db[_0x2b18('0x1')][_0x2b18('0x16')](_0x2b18('0x7d'));db[_0x2b18('0x7e')]=db[_0x2b18('0x1')]['import'](_0x2b18('0x7f'));db['CmHopperHistory']=db['sequelize'][_0x2b18('0x16')](_0x2b18('0x80'));db[_0x2b18('0x81')]=db['sequelize']['import'](_0x2b18('0x82'));db[_0x2b18('0x83')]=db[_0x2b18('0x1')][_0x2b18('0x16')](_0x2b18('0x84'));db[_0x2b18('0x85')]=db['sequelize'][_0x2b18('0x16')](_0x2b18('0x86'));db[_0x2b18('0x87')]=db['sequelize'][_0x2b18('0x16')](_0x2b18('0x88'));db[_0x2b18('0x89')]=db[_0x2b18('0x1')][_0x2b18('0x16')](_0x2b18('0x8a'));db[_0x2b18('0x8b')]=db[_0x2b18('0x1')][_0x2b18('0x16')](_0x2b18('0x8c'));db[_0x2b18('0x8d')]=db[_0x2b18('0x1')][_0x2b18('0x16')](_0x2b18('0x8e'));db['Interval']=db[_0x2b18('0x1')][_0x2b18('0x16')](_0x2b18('0x8f'));db[_0x2b18('0x90')]=db[_0x2b18('0x1')]['import'](_0x2b18('0x91'));db[_0x2b18('0x92')]=db['sequelize'][_0x2b18('0x16')](_0x2b18('0x93'));db['VoiceQueuesLog']=db[_0x2b18('0x1')][_0x2b18('0x16')](_0x2b18('0x94'));db['Schedule']=db[_0x2b18('0x1')][_0x2b18('0x16')](_0x2b18('0x95'));db[_0x2b18('0x96')]=db[_0x2b18('0x1')]['import']('../api/sound/sound.model');db['Tag']=db['sequelize'][_0x2b18('0x16')](_0x2b18('0x97'));db[_0x2b18('0x98')]=db[_0x2b18('0x1')]['import'](_0x2b18('0x99'));db[_0x2b18('0x9a')]=db[_0x2b18('0x1')][_0x2b18('0x16')](_0x2b18('0x9b'));db[_0x2b18('0x9c')]=db['sequelize'][_0x2b18('0x16')](_0x2b18('0x9d'));db[_0x2b18('0x9e')]=db[_0x2b18('0x1')][_0x2b18('0x16')](_0x2b18('0x9f'));db[_0x2b18('0xa0')]=db[_0x2b18('0x1')][_0x2b18('0x16')](_0x2b18('0xa1'));db[_0x2b18('0xa2')]=db['sequelize'][_0x2b18('0x16')](_0x2b18('0xa3'));db[_0x2b18('0xa4')]=db[_0x2b18('0x1')][_0x2b18('0x16')](_0x2b18('0xa5'));db[_0x2b18('0xa6')]=db[_0x2b18('0x1')]['import'](_0x2b18('0xa7'));db['AnalyticMetric']=db[_0x2b18('0x1')][_0x2b18('0x16')](_0x2b18('0xa8'));db[_0x2b18('0xa9')]=db['sequelize'][_0x2b18('0x16')](_0x2b18('0xaa'));db[_0x2b18('0xab')]=db[_0x2b18('0x1')]['import']('../api/analyticTreeReport/analyticTreeReport.model');db[_0x2b18('0xac')]=db[_0x2b18('0x1')]['import'](_0x2b18('0xad'));db['SalesforceConfiguration']=db['sequelize'][_0x2b18('0x16')](_0x2b18('0xae'));db['SalesforceField']=db[_0x2b18('0x1')][_0x2b18('0x16')](_0x2b18('0xaf'));db[_0x2b18('0xb0')]=db[_0x2b18('0x1')][_0x2b18('0x16')]('../api/intSugarcrmAccount/intSugarcrmAccount.model');db[_0x2b18('0xb1')]=db[_0x2b18('0x1')][_0x2b18('0x16')](_0x2b18('0xb2'));db['SugarcrmField']=db['sequelize'][_0x2b18('0x16')](_0x2b18('0xb3'));db['DeskAccount']=db[_0x2b18('0x1')][_0x2b18('0x16')](_0x2b18('0xb4'));db[_0x2b18('0xb5')]=db[_0x2b18('0x1')]['import'](_0x2b18('0xb6'));db[_0x2b18('0xb7')]=db[_0x2b18('0x1')][_0x2b18('0x16')](_0x2b18('0xb8'));db[_0x2b18('0xb9')]=db['sequelize']['import'](_0x2b18('0xba'));db[_0x2b18('0xbb')]=db[_0x2b18('0x1')][_0x2b18('0x16')]('../api/intZohoConfiguration/intZohoConfiguration.model');db[_0x2b18('0xbc')]=db[_0x2b18('0x1')][_0x2b18('0x16')](_0x2b18('0xbd'));db[_0x2b18('0xbe')]=db['sequelize'][_0x2b18('0x16')](_0x2b18('0xbf'));db['ZendeskConfiguration']=db['sequelize'][_0x2b18('0x16')](_0x2b18('0xc0'));db[_0x2b18('0xc1')]=db[_0x2b18('0x1')][_0x2b18('0x16')]('../api/intZendeskField/intZendeskField.model');db[_0x2b18('0xc2')]=db['sequelize']['import'](_0x2b18('0xc3'));db['FreshdeskConfiguration']=db[_0x2b18('0x1')][_0x2b18('0x16')](_0x2b18('0xc4'));db[_0x2b18('0xc5')]=db[_0x2b18('0x1')][_0x2b18('0x16')](_0x2b18('0xc6'));db[_0x2b18('0xc7')]=db[_0x2b18('0x1')][_0x2b18('0x16')](_0x2b18('0xc8'));db['VtigerConfiguration']=db['sequelize'][_0x2b18('0x16')](_0x2b18('0xc9'));db['VtigerField']=db['sequelize'][_0x2b18('0x16')](_0x2b18('0xca'));db[_0x2b18('0xcb')]=db['sequelize'][_0x2b18('0x16')]('../api/intServicenowAccount/intServicenowAccount.model');db['ServicenowConfiguration']=db[_0x2b18('0x1')][_0x2b18('0x16')](_0x2b18('0xcc'));db[_0x2b18('0xcd')]=db[_0x2b18('0x1')][_0x2b18('0x16')](_0x2b18('0xce'));db[_0x2b18('0xcf')]=db[_0x2b18('0x1')][_0x2b18('0x16')]('../api/intDynamics365Account/intDynamics365Account.model');db[_0x2b18('0xd0')]=db[_0x2b18('0x1')][_0x2b18('0x16')](_0x2b18('0xd1'));db[_0x2b18('0xd2')]=db['sequelize'][_0x2b18('0x16')](_0x2b18('0xd3'));db[_0x2b18('0xd4')]=db['sequelize']['import']('../api/intFreshsalesAccount/intFreshsalesAccount.model');db[_0x2b18('0xd5')]=db[_0x2b18('0x1')][_0x2b18('0x16')](_0x2b18('0xd6'));db[_0x2b18('0xd7')]=db[_0x2b18('0x1')][_0x2b18('0x16')](_0x2b18('0xd8'));db['Integration']=db[_0x2b18('0x1')][_0x2b18('0x16')](_0x2b18('0x9f'));db['Network']=db[_0x2b18('0x1')][_0x2b18('0x16')](_0x2b18('0xd9'));db[_0x2b18('0xda')]=db[_0x2b18('0x1')]['import'](_0x2b18('0xdb'));db['ChatInternalMessage']=db[_0x2b18('0x1')][_0x2b18('0x16')](_0x2b18('0xdc'));db[_0x2b18('0xdd')]=db[_0x2b18('0x1')]['import'](_0x2b18('0xde'));db[_0x2b18('0xdf')]=db[_0x2b18('0x1')][_0x2b18('0x16')](_0x2b18('0xe0'));db[_0x2b18('0xe1')]=db[_0x2b18('0x1')]['import'](_0x2b18('0xe2'));db['SmsQueueReport']=db[_0x2b18('0x1')][_0x2b18('0x16')]('../api/smsQueueReport/smsQueueReport.model');db[_0x2b18('0xe3')]=db[_0x2b18('0x1')]['import'](_0x2b18('0xe4'));db['SquareDetailsReport']=db[_0x2b18('0x1')][_0x2b18('0x16')]('../api/squareReportDetail/squareReportDetail.model');db[_0x2b18('0xe5')]=db[_0x2b18('0x1')][_0x2b18('0x16')](_0x2b18('0xe6'));db[_0x2b18('0xe7')]=db[_0x2b18('0x1')]['import'](_0x2b18('0xe8'));db['SquareOdbc']=db['sequelize'][_0x2b18('0x16')](_0x2b18('0xe9'));db[_0x2b18('0xea')]=db['sequelize'][_0x2b18('0x16')]('../api/squareProject/squareProject.model');db['SquareRecording']=db[_0x2b18('0x1')][_0x2b18('0x16')]('../api/squareRecording/squareRecording.model');db['SquareMessage']=db['sequelize'][_0x2b18('0x16')](_0x2b18('0xeb'));db['Team']=db[_0x2b18('0x1')][_0x2b18('0x16')](_0x2b18('0xec'));db[_0x2b18('0xed')]=db[_0x2b18('0x1')]['import']('../api/license/license.model');db[_0x2b18('0xee')]=db[_0x2b18('0x1')]['import'](_0x2b18('0xef'));db['Migration']=db['sequelize'][_0x2b18('0x16')](_0x2b18('0xf0'));db[_0x2b18('0xf1')]=db[_0x2b18('0x1')][_0x2b18('0x16')]('../api/attachment/attachment.model');db[_0x2b18('0xf2')]=db[_0x2b18('0x1')][_0x2b18('0x16')](_0x2b18('0xf3'));db[_0x2b18('0xf4')]=db[_0x2b18('0x1')][_0x2b18('0x16')]('../api/mailTransferReport/mailTransferReport.model');db[_0x2b18('0xf5')]=db['sequelize'][_0x2b18('0x16')](_0x2b18('0xf6'));db[_0x2b18('0xf7')]=db[_0x2b18('0x1')][_0x2b18('0x16')](_0x2b18('0xf8'));db[_0x2b18('0xf9')]=db['sequelize']['import']('../api/openchannelTransferReport/openchannelTransferReport.model');db['SmsTransferReport']=db[_0x2b18('0x1')][_0x2b18('0x16')]('../api/smsTransferReport/smsTransferReport.model');db[_0x2b18('0xfa')]=db[_0x2b18('0x1')]['import'](_0x2b18('0xfb'));db[_0x2b18('0xfc')]=db['sequelize'][_0x2b18('0x16')](_0x2b18('0xfd'));db[_0x2b18('0xfe')]=db['sequelize'][_0x2b18('0x16')](_0x2b18('0xff'));db[_0x2b18('0x100')]=db[_0x2b18('0x1')][_0x2b18('0x16')](_0x2b18('0x101'));db[_0x2b18('0x102')]=db[_0x2b18('0x1')][_0x2b18('0x16')]('../api/userProfileResource/userProfileResource.model');db[_0x2b18('0x103')]=db[_0x2b18('0x1')]['import'](_0x2b18('0x104'));db[_0x2b18('0x105')]=db[_0x2b18('0x1')]['import'](_0x2b18('0x106'));db[_0x2b18('0x107')]=db[_0x2b18('0x1')][_0x2b18('0x16')](_0x2b18('0x108'));db[_0x2b18('0x109')]=db['sequelize'][_0x2b18('0x16')]('../api/whatsappInteraction/whatsappInteraction.model');db[_0x2b18('0x10a')]=db[_0x2b18('0x1')][_0x2b18('0x16')](_0x2b18('0x10b'));db[_0x2b18('0x10c')]=db['sequelize'][_0x2b18('0x16')](_0x2b18('0x10d'));db[_0x2b18('0x10e')]=db[_0x2b18('0x1')][_0x2b18('0x16')](_0x2b18('0x10f'));db[_0x2b18('0x110')]=db['sequelize'][_0x2b18('0x16')](_0x2b18('0x111'));db[_0x2b18('0x112')]=db[_0x2b18('0x1')][_0x2b18('0x16')](_0x2b18('0x113'));db['User'][_0x2b18('0x114')](db[_0x2b18('0x115')],{'as':_0x2b18('0x115'),'onDelete':'cascade','foreignKey':_0x2b18('0x116')});db[_0x2b18('0x12')][_0x2b18('0x117')](db[_0x2b18('0x1e')],{'as':_0x2b18('0x118'),'foreignKey':'UserId'});db['User'][_0x2b18('0x117')](db[_0x2b18('0x31')],{'as':_0x2b18('0x119'),'foreignKey':_0x2b18('0x116')});db[_0x2b18('0x12')]['hasMany'](db['VoiceExtension'],{'as':_0x2b18('0x11a'),'onDelete':_0x2b18('0x11b'),'hooks':!![]});db[_0x2b18('0x12')][_0x2b18('0x117')](db[_0x2b18('0x7e')],{'as':_0x2b18('0x11c'),'foreignKey':'UserId'});db[_0x2b18('0x12')]['hasMany'](db[_0x2b18('0x11d')],{'as':_0x2b18('0x11e'),'foreignKey':'UserId'});db[_0x2b18('0x12')]['hasMany'](db[_0x2b18('0x81')],{'as':_0x2b18('0x81'),'foreignKey':_0x2b18('0x116')});db[_0x2b18('0x12')][_0x2b18('0x117')](db[_0x2b18('0x68')],{'as':_0x2b18('0x11f'),'foreignKey':_0x2b18('0x116')});db[_0x2b18('0x12')]['hasMany'](db['ChatInteraction'],{'as':_0x2b18('0x120'),'foreignKey':_0x2b18('0x116')});db[_0x2b18('0x12')][_0x2b18('0x117')](db['SmsInteraction'],{'as':_0x2b18('0x121'),'foreignKey':_0x2b18('0x116')});db[_0x2b18('0x12')][_0x2b18('0x117')](db[_0x2b18('0x56')],{'as':_0x2b18('0x122'),'foreignKey':_0x2b18('0x116')});db['User'][_0x2b18('0x117')](db[_0x2b18('0x48')],{'as':_0x2b18('0x123'),'foreignKey':'UserId'});db[_0x2b18('0x12')][_0x2b18('0x117')](db[_0x2b18('0x109')],{'as':_0x2b18('0x124'),'foreignKey':'UserId'});db[_0x2b18('0x12')][_0x2b18('0x117')](db[_0x2b18('0x103')],{'as':_0x2b18('0x125'),'foreignKey':_0x2b18('0x126')});db[_0x2b18('0x12')]['belongsTo'](db['UserProfile'],{'as':_0x2b18('0xfe'),'foreignKey':'userProfileId'});db[_0x2b18('0x12')][_0x2b18('0x127')](db[_0x2b18('0x75')],{'as':_0x2b18('0x128'),'through':'chat_group_has_users'});db[_0x2b18('0x12')][_0x2b18('0x127')](db['CmContact'],{'as':_0x2b18('0x129'),'through':_0x2b18('0x12a')});db[_0x2b18('0x12')][_0x2b18('0x127')](db[_0x2b18('0xfa')],{'as':_0x2b18('0x12b'),'through':_0x2b18('0x12c')});db[_0x2b18('0x12')][_0x2b18('0x127')](db[_0x2b18('0x12d')],{'through':_0x2b18('0x12e')});db['User']['belongsToMany'](db[_0x2b18('0x48')],{'as':'MailInteractions','through':_0x2b18('0x12f')});db['User'][_0x2b18('0x127')](db[_0x2b18('0x70')],{'as':'ChatInteractions','through':_0x2b18('0x130')});db[_0x2b18('0x12')]['belongsToMany'](db[_0x2b18('0x56')],{'as':_0x2b18('0x122'),'through':_0x2b18('0x131')});db[_0x2b18('0x12')][_0x2b18('0x127')](db['SmsInteraction'],{'as':'SmsInteractions','through':_0x2b18('0x132')});db[_0x2b18('0x12')][_0x2b18('0x127')](db['OpenchannelInteraction'],{'as':_0x2b18('0x11f'),'through':_0x2b18('0x133')});db[_0x2b18('0x12')][_0x2b18('0x127')](db[_0x2b18('0x109')],{'as':_0x2b18('0x124'),'through':_0x2b18('0x134')});db[_0x2b18('0x12')]['belongsToMany'](db[_0x2b18('0x1c')],{'as':_0x2b18('0x135'),'through':_0x2b18('0x136'),'required':![]});db[_0x2b18('0x12')][_0x2b18('0x127')](db['MailQueue'],{'as':_0x2b18('0x137'),'through':_0x2b18('0x36'),'required':![]});db['User'][_0x2b18('0x127')](db['ChatQueue'],{'as':_0x2b18('0x138'),'through':_0x2b18('0x34'),'required':![],'hooks':!![]});db[_0x2b18('0x12')][_0x2b18('0x127')](db[_0x2b18('0x5a')],{'as':_0x2b18('0x139'),'through':'UserFaxQueue','required':![]});db[_0x2b18('0x12')][_0x2b18('0x127')](db['SmsQueue'],{'as':_0x2b18('0x13a'),'through':_0x2b18('0x3a'),'required':![]});db[_0x2b18('0x12')][_0x2b18('0x127')](db[_0x2b18('0x6a')],{'as':_0x2b18('0x13b'),'through':_0x2b18('0x3b'),'required':![]});db['User'][_0x2b18('0x127')](db[_0x2b18('0x110')],{'as':_0x2b18('0x13c'),'through':'UserWhatsappQueue','required':![]});db[_0x2b18('0x12')][_0x2b18('0x127')](db[_0x2b18('0xfa')],{'through':'cm_user_has_lists'});db[_0x2b18('0x12')][_0x2b18('0x127')](db[_0x2b18('0xfc')],{'as':_0x2b18('0x13d'),'through':'user_has_voice_prefixes','required':![]});db['User'][_0x2b18('0x127')](db['ChatWebsite'],{'as':_0x2b18('0x13e'),'through':'user_has_chat_websites'});db[_0x2b18('0x12')][_0x2b18('0x127')](db[_0x2b18('0x53')],{'as':'FaxAccounts','through':'user_has_fax_accounts'});db[_0x2b18('0x12')]['belongsToMany'](db[_0x2b18('0x42')],{'as':_0x2b18('0x13f'),'through':'user_has_mail_accounts'});db[_0x2b18('0x12')][_0x2b18('0x127')](db[_0x2b18('0x65')],{'as':_0x2b18('0x140'),'through':_0x2b18('0x141')});db['User'][_0x2b18('0x127')](db['SmsAccount'],{'as':_0x2b18('0x142'),'through':'user_has_sms_accounts'});db[_0x2b18('0x12')][_0x2b18('0x127')](db['WhatsappAccount'],{'as':_0x2b18('0x143'),'through':_0x2b18('0x144')});db[_0x2b18('0x12')]['belongsToMany'](db[_0x2b18('0xea')],{'as':_0x2b18('0x145'),'through':_0x2b18('0x146')});db[_0x2b18('0x147')][_0x2b18('0x117')](db['VoiceExtension'],{'as':_0x2b18('0x148'),'onDelete':_0x2b18('0x11b'),'foreignKey':_0x2b18('0x149')});db[_0x2b18('0x15')][_0x2b18('0x117')](db['VoiceExtension'],{'onDelete':_0x2b18('0x11b')});db[_0x2b18('0x18')]['hasMany'](db['VoiceExtension'],{'as':_0x2b18('0x14a'),'onDelete':_0x2b18('0x11b')});db[_0x2b18('0x1a')][_0x2b18('0x127')](db[_0x2b18('0x96')],{'as':_0x2b18('0x14b'),'through':_0x2b18('0x14c')});db['VoiceQueue'][_0x2b18('0x117')](db['UserVoiceQueueRt'],{'as':_0x2b18('0x14d'),'foreignKey':_0x2b18('0x14e')});db[_0x2b18('0x1c')][_0x2b18('0x117')](db[_0x2b18('0x7b')],{'as':_0x2b18('0x14f'),'foreignKey':_0x2b18('0x14e')});db[_0x2b18('0x1c')][_0x2b18('0x117')](db[_0x2b18('0x7e')],{'as':_0x2b18('0x11c'),'foreignKey':'VoiceQueueId'});db[_0x2b18('0x1c')][_0x2b18('0x117')](db[_0x2b18('0x11d')],{'as':_0x2b18('0x150'),'foreignKey':_0x2b18('0x14e')});db[_0x2b18('0x1c')][_0x2b18('0x117')](db[_0x2b18('0x81')],{'as':'ReportAgentPreview','foreignKey':_0x2b18('0x14e')});db[_0x2b18('0x1c')][_0x2b18('0x117')](db[_0x2b18('0x151')],{'as':_0x2b18('0x152'),'foreignKey':_0x2b18('0x14e')});db[_0x2b18('0x1c')][_0x2b18('0x117')](db[_0x2b18('0xe1')],{'as':_0x2b18('0x153'),'foreignKey':_0x2b18('0x14e')});db[_0x2b18('0x1c')]['belongsTo'](db[_0x2b18('0x2e')],{'as':_0x2b18('0x2e'),'foreignKey':_0x2b18('0x154')});db[_0x2b18('0x1c')][_0x2b18('0x155')](db[_0x2b18('0x2e')],{'as':_0x2b18('0x156'),'foreignKey':_0x2b18('0x157')});db[_0x2b18('0x1c')][_0x2b18('0x155')](db['Interval'],{'as':_0x2b18('0x158'),'foreignKey':'IntervalId'});db[_0x2b18('0x1c')][_0x2b18('0x155')](db[_0x2b18('0x90')],{'as':'mandatoryDispositionPause','foreignKey':'mandatoryDispositionPauseId'});db['VoiceQueue'][_0x2b18('0x127')](db[_0x2b18('0xfa')],{'as':_0x2b18('0x12b'),'through':'voice_queues_has_cm_lists'});db[_0x2b18('0x1c')][_0x2b18('0x127')](db[_0x2b18('0x12')],{'as':_0x2b18('0x159'),'through':_0x2b18('0x136')});db[_0x2b18('0x1c')][_0x2b18('0x127')](db[_0x2b18('0x12d')],{'as':_0x2b18('0x15a'),'through':_0x2b18('0x15b')});db[_0x2b18('0x1c')][_0x2b18('0x127')](db['CmList'],{'as':'BlackLists','through':_0x2b18('0x15c')});db[_0x2b18('0x1e')][_0x2b18('0x155')](db[_0x2b18('0x12')],{'as':_0x2b18('0x12'),'foreignKey':_0x2b18('0x116')});db[_0x2b18('0x15d')][_0x2b18('0x155')](db[_0x2b18('0x12')],{'as':'User','foreignKey':_0x2b18('0x116')});db[_0x2b18('0x115')][_0x2b18('0x117')](db[_0x2b18('0x22')],{'as':_0x2b18('0x15e'),'onDelete':_0x2b18('0x11b'),'foreignKey':_0x2b18('0x15f'),'sourceKey':_0x2b18('0x160')});db[_0x2b18('0x22')][_0x2b18('0x155')](db[_0x2b18('0x115')],{'foreignKey':'mailboxuser','targetKey':_0x2b18('0x160')});db[_0x2b18('0x24')][_0x2b18('0x117')](db[_0x2b18('0x2a')],{'as':_0x2b18('0x161'),'foreignKey':_0x2b18('0x162'),'constraints':![]});db[_0x2b18('0x24')][_0x2b18('0x117')](db['VoiceAgentReport'],{'as':_0x2b18('0x163'),'foreignKey':_0x2b18('0x162'),'constraints':![]});db[_0x2b18('0x24')][_0x2b18('0x155')](db['User'],{'as':_0x2b18('0x12'),'foreignKey':_0x2b18('0x116')});db[_0x2b18('0x24')][_0x2b18('0x155')](db[_0x2b18('0x7a')],{'as':_0x2b18('0x164'),'foreignKey':'ContactId'});db[_0x2b18('0x3e')]['belongsTo'](db['MailAccount'],{'as':'MailAccount','foreignKey':_0x2b18('0x165')});db['MailServerOut']['belongsTo'](db['MailAccount'],{'as':_0x2b18('0x42'),'foreignKey':_0x2b18('0x165')});db['MailAccount'][_0x2b18('0x114')](db['MailServerIn'],{'as':_0x2b18('0x166'),'onDelete':_0x2b18('0x11b')});db[_0x2b18('0x42')][_0x2b18('0x114')](db[_0x2b18('0x40')],{'as':'Smtp','onDelete':_0x2b18('0x11b')});db['MailAccount']['hasMany'](db[_0x2b18('0x8b')],{'as':'Dispositions','foreignKey':_0x2b18('0x165')});db[_0x2b18('0x42')][_0x2b18('0x117')](db[_0x2b18('0x89')],{'as':_0x2b18('0x167'),'foreignKey':_0x2b18('0x165')});db['MailAccount'][_0x2b18('0x117')](db[_0x2b18('0x4a')],{'as':'Messages','foreignKey':_0x2b18('0x165')});db[_0x2b18('0x42')][_0x2b18('0x117')](db[_0x2b18('0x48')],{'as':_0x2b18('0x168')});db[_0x2b18('0x42')]['hasMany'](db[_0x2b18('0x4c')],{'as':_0x2b18('0x14a')});db[_0x2b18('0x42')][_0x2b18('0x155')](db['CmList'],{'as':_0x2b18('0x169'),'foreignKey':_0x2b18('0x16a')});db[_0x2b18('0x42')][_0x2b18('0x155')](db[_0x2b18('0x98')],{'as':'Template','foreignKey':_0x2b18('0x16b')});db[_0x2b18('0x42')][_0x2b18('0x155')](db[_0x2b18('0x90')],{'as':'mandatoryDispositionPause','foreignKey':_0x2b18('0x16c')});db['MailAccount'][_0x2b18('0x127')](db[_0x2b18('0x12')],{'as':'Agents','through':'user_has_mail_accounts'});db[_0x2b18('0x44')][_0x2b18('0x127')](db['User'],{'as':_0x2b18('0x159'),'through':_0x2b18('0x36')});db['MailQueue']['belongsToMany'](db[_0x2b18('0x12d')],{'through':_0x2b18('0x16d'),'as':'Teams'});db['MailInteraction'][_0x2b18('0x117')](db[_0x2b18('0x4a')],{'as':'Messages','onDelete':_0x2b18('0x11b'),'foreignKey':_0x2b18('0x16e')});db[_0x2b18('0x48')][_0x2b18('0x155')](db['MailAccount'],{'as':_0x2b18('0x16f'),'foreignKey':_0x2b18('0x165')});db['MailInteraction'][_0x2b18('0x155')](db[_0x2b18('0x7a')],{'as':_0x2b18('0x164'),'foreignKey':'ContactId'});db['MailInteraction'][_0x2b18('0x155')](db[_0x2b18('0x12')],{'as':_0x2b18('0x170'),'foreignKey':_0x2b18('0x116')});db[_0x2b18('0x48')][_0x2b18('0x127')](db['Tag'],{'through':_0x2b18('0x171'),'as':_0x2b18('0x172')});db['MailInteraction'][_0x2b18('0x127')](db['Tag'],{'through':_0x2b18('0x171'),'as':_0x2b18('0x173')});db[_0x2b18('0x48')][_0x2b18('0x127')](db[_0x2b18('0x12')],{'as':_0x2b18('0x174'),'through':'user_has_mail_interactions','foreignKey':_0x2b18('0x16e')});db[_0x2b18('0x4a')][_0x2b18('0x117')](db['Attachment'],{'as':_0x2b18('0x175'),'onDelete':_0x2b18('0x11b')});db[_0x2b18('0x4a')]['belongsTo'](db['User'],{'as':'User'});db[_0x2b18('0x4a')][_0x2b18('0x155')](db[_0x2b18('0x7a')],{'onDelete':'cascade','as':'Contact'});db[_0x2b18('0x4a')]['belongsTo'](db[_0x2b18('0x48')],{'as':_0x2b18('0x176'),'foreignKey':'MailInteractionId'});db[_0x2b18('0x4a')][_0x2b18('0x155')](db[_0x2b18('0x42')],{'as':_0x2b18('0x16f'),'foreignKey':_0x2b18('0x165')});db[_0x2b18('0x4c')][_0x2b18('0x155')](db[_0x2b18('0x12')],{'onDelete':_0x2b18('0x177')});db[_0x2b18('0x4c')][_0x2b18('0x155')](db[_0x2b18('0x44')],{'onDelete':_0x2b18('0x177')});db[_0x2b18('0x4c')]['belongsTo'](db[_0x2b18('0x42')],{'onDelete':_0x2b18('0x177')});db[_0x2b18('0x4c')][_0x2b18('0x155')](db[_0x2b18('0x158')],{'onDelete':'restrict','foreignKey':'IntervalId'});db[_0x2b18('0x4c')][_0x2b18('0x155')](db[_0x2b18('0x178')],{'onDelete':_0x2b18('0x177'),'foreignKey':_0x2b18('0x179')});db[_0x2b18('0x4e')][_0x2b18('0x155')](db[_0x2b18('0x42')],{});db['MailQueueReport'][_0x2b18('0x155')](db['CmList'],{'as':'List','foreignKey':_0x2b18('0x16a')});db[_0x2b18('0x4e')]['belongsTo'](db[_0x2b18('0x7a')],{'as':'Contact','foreignKey':_0x2b18('0x17a')});db[_0x2b18('0x4e')][_0x2b18('0x155')](db[_0x2b18('0x48')],{});db['MailQueueReport'][_0x2b18('0x155')](db[_0x2b18('0x4a')],{});db['MailQueueReport'][_0x2b18('0x155')](db[_0x2b18('0x12')],{});db[_0x2b18('0x4e')]['belongsTo'](db[_0x2b18('0x44')],{});db['Dashboard']['hasMany'](db[_0x2b18('0x51')],{'as':_0x2b18('0x17b'),'onDelete':_0x2b18('0x11b')});db[_0x2b18('0x53')][_0x2b18('0x117')](db[_0x2b18('0x8b')],{'as':_0x2b18('0x17c'),'foreignKey':_0x2b18('0x17d')});db[_0x2b18('0x53')][_0x2b18('0x117')](db[_0x2b18('0x89')],{'as':_0x2b18('0x167'),'foreignKey':_0x2b18('0x17d')});db[_0x2b18('0x53')][_0x2b18('0x117')](db[_0x2b18('0x56')],{'as':_0x2b18('0x168')});db[_0x2b18('0x53')][_0x2b18('0x117')](db['FaxApplication'],{'as':_0x2b18('0x14a')});db[_0x2b18('0x53')]['hasMany'](db['VoiceExtension'],{'as':_0x2b18('0x17e'),'onDelete':_0x2b18('0x11b')});db['FaxAccount'][_0x2b18('0x117')](db[_0x2b18('0x58')],{'as':_0x2b18('0x15e')});db[_0x2b18('0x53')][_0x2b18('0x155')](db[_0x2b18('0x2e')],{'as':_0x2b18('0x2e')});db['FaxAccount'][_0x2b18('0x155')](db[_0x2b18('0xfa')],{'as':'List','foreignKey':_0x2b18('0x16a')});db[_0x2b18('0x53')][_0x2b18('0x155')](db[_0x2b18('0x90')],{'as':'mandatoryDispositionPause','foreignKey':_0x2b18('0x16c')});db[_0x2b18('0x53')]['belongsToMany'](db[_0x2b18('0x12')],{'as':_0x2b18('0x159'),'through':_0x2b18('0x17f')});db[_0x2b18('0x54')][_0x2b18('0x155')](db[_0x2b18('0x12')],{'onDelete':'restrict'});db[_0x2b18('0x54')][_0x2b18('0x155')](db[_0x2b18('0x5a')],{'onDelete':_0x2b18('0x177')});db[_0x2b18('0x54')][_0x2b18('0x155')](db[_0x2b18('0x53')],{'onDelete':_0x2b18('0x177')});db[_0x2b18('0x54')][_0x2b18('0x155')](db[_0x2b18('0x178')],{'onDelete':_0x2b18('0x177'),'foreignKey':'TagId'});db[_0x2b18('0x56')][_0x2b18('0x117')](db[_0x2b18('0x58')],{'as':_0x2b18('0x15e'),'onDelete':'cascade','foreignKey':_0x2b18('0x180')});db['FaxInteraction'][_0x2b18('0x155')](db[_0x2b18('0x53')],{'as':'Account','foreignKey':_0x2b18('0x17d')});db[_0x2b18('0x56')][_0x2b18('0x155')](db['CmContact'],{'as':_0x2b18('0x164'),'foreignKey':_0x2b18('0x17a')});db[_0x2b18('0x56')][_0x2b18('0x155')](db[_0x2b18('0x12')],{'as':_0x2b18('0x170'),'foreignKey':_0x2b18('0x116')});db[_0x2b18('0x56')][_0x2b18('0x127')](db[_0x2b18('0x178')],{'through':'fax_interaction_has_tags','as':'Tags'});db[_0x2b18('0x56')]['belongsToMany'](db['Tag'],{'through':_0x2b18('0x181'),'as':_0x2b18('0x173')});db[_0x2b18('0x56')][_0x2b18('0x127')](db['User'],{'as':_0x2b18('0x174'),'through':_0x2b18('0x131'),'foreignKey':_0x2b18('0x180')});db[_0x2b18('0x58')]['belongsTo'](db[_0x2b18('0x12')],{'onDelete':'cascade','as':_0x2b18('0x12')});db['FaxMessage'][_0x2b18('0x155')](db['FaxInteraction'],{'as':_0x2b18('0x176'),'foreignKey':_0x2b18('0x180')});db[_0x2b18('0x58')]['belongsTo'](db[_0x2b18('0x7a')],{'onDelete':_0x2b18('0x11b'),'as':_0x2b18('0x164')});db['FaxMessage'][_0x2b18('0x155')](db[_0x2b18('0xf1')],{'as':_0x2b18('0xf1'),'foreignKey':'AttachmentId'});db['FaxMessage']['belongsTo'](db['FaxAccount'],{'as':'Account','foreignKey':_0x2b18('0x17d')});db[_0x2b18('0x5a')][_0x2b18('0x127')](db[_0x2b18('0x12')],{'as':_0x2b18('0x159'),'through':_0x2b18('0x38')});db[_0x2b18('0x5a')][_0x2b18('0x127')](db[_0x2b18('0x12d')],{'through':_0x2b18('0x182'),'as':_0x2b18('0x15a')});db[_0x2b18('0x5c')][_0x2b18('0x155')](db[_0x2b18('0x53')],{});db[_0x2b18('0x5c')][_0x2b18('0x155')](db[_0x2b18('0xfa')],{'as':_0x2b18('0x169'),'foreignKey':_0x2b18('0x16a')});db[_0x2b18('0x5c')][_0x2b18('0x155')](db[_0x2b18('0x7a')],{'as':_0x2b18('0x164'),'foreignKey':'ContactId'});db['FaxQueueReport'][_0x2b18('0x155')](db[_0x2b18('0x56')],{});db[_0x2b18('0x5c')]['belongsTo'](db[_0x2b18('0x58')],{});db[_0x2b18('0x5c')][_0x2b18('0x155')](db['User'],{});db['FaxQueueReport'][_0x2b18('0x155')](db[_0x2b18('0x5a')],{});db[_0x2b18('0x5d')]['hasMany'](db[_0x2b18('0x8b')],{'as':_0x2b18('0x17c'),'foreignKey':_0x2b18('0x183')});db['SmsAccount'][_0x2b18('0x117')](db[_0x2b18('0x89')],{'as':'Answers','foreignKey':_0x2b18('0x183')});db[_0x2b18('0x5d')][_0x2b18('0x117')](db['SmsMessage'],{'as':_0x2b18('0x15e'),'foreignKey':_0x2b18('0x183')});db[_0x2b18('0x5d')][_0x2b18('0x117')](db[_0x2b18('0x184')],{'as':_0x2b18('0x168')});db['SmsAccount'][_0x2b18('0x117')](db[_0x2b18('0x185')],{'as':_0x2b18('0x14a')});db['SmsAccount']['belongsTo'](db[_0x2b18('0xfa')],{'as':_0x2b18('0x169'),'foreignKey':_0x2b18('0x16a')});db[_0x2b18('0x5d')]['belongsTo'](db['Pause'],{'as':'mandatoryDispositionPause','foreignKey':_0x2b18('0x16c')});db[_0x2b18('0x5d')][_0x2b18('0x127')](db[_0x2b18('0x12')],{'as':'Agents','through':_0x2b18('0x186')});db[_0x2b18('0x185')][_0x2b18('0x155')](db['User'],{'onDelete':_0x2b18('0x177')});db[_0x2b18('0x185')][_0x2b18('0x155')](db['SmsQueue'],{'onDelete':'restrict'});db[_0x2b18('0x185')]['belongsTo'](db[_0x2b18('0x5d')],{'onDelete':_0x2b18('0x177')});db[_0x2b18('0x185')][_0x2b18('0x155')](db['Interval'],{'onDelete':_0x2b18('0x177'),'foreignKey':'IntervalId'});db['SmsApplication'][_0x2b18('0x155')](db[_0x2b18('0x178')],{'onDelete':'restrict','foreignKey':'TagId'});db[_0x2b18('0x184')][_0x2b18('0x117')](db[_0x2b18('0x61')],{'as':_0x2b18('0x15e'),'onDelete':_0x2b18('0x11b'),'foreignKey':_0x2b18('0x187')});db[_0x2b18('0x184')][_0x2b18('0x155')](db['SmsAccount'],{'as':_0x2b18('0x16f'),'foreignKey':_0x2b18('0x183')});db['SmsInteraction'][_0x2b18('0x155')](db[_0x2b18('0x7a')],{'as':_0x2b18('0x164'),'foreignKey':_0x2b18('0x17a')});db[_0x2b18('0x184')]['belongsTo'](db['User'],{'as':_0x2b18('0x170'),'foreignKey':_0x2b18('0x116')});db[_0x2b18('0x184')][_0x2b18('0x127')](db[_0x2b18('0x178')],{'through':_0x2b18('0x188'),'as':_0x2b18('0x172')});db[_0x2b18('0x184')]['belongsToMany'](db[_0x2b18('0x178')],{'through':'sms_interaction_has_tags','as':_0x2b18('0x173')});db['SmsInteraction'][_0x2b18('0x127')](db[_0x2b18('0x12')],{'as':'Users','through':_0x2b18('0x132'),'foreignKey':_0x2b18('0x187')});db[_0x2b18('0x61')][_0x2b18('0x155')](db['User'],{'as':_0x2b18('0x12')});db[_0x2b18('0x61')][_0x2b18('0x155')](db['CmContact'],{'onDelete':_0x2b18('0x11b'),'as':_0x2b18('0x164')});db[_0x2b18('0x61')][_0x2b18('0x155')](db[_0x2b18('0x184')],{'onDelete':_0x2b18('0x11b'),'as':'Interaction','foreignKey':_0x2b18('0x187')});db[_0x2b18('0x61')]['belongsTo'](db[_0x2b18('0x5d')],{'as':_0x2b18('0x16f'),'foreignKey':'SmsAccountId'});db[_0x2b18('0x63')][_0x2b18('0x127')](db[_0x2b18('0x12')],{'as':_0x2b18('0x159'),'through':_0x2b18('0x3a'),'foreignKey':'SmsQueueId'});db[_0x2b18('0x63')]['belongsToMany'](db[_0x2b18('0x12d')],{'through':_0x2b18('0x189'),'as':_0x2b18('0x15a')});db['OpenchannelAccount'][_0x2b18('0x117')](db[_0x2b18('0x8b')],{'as':_0x2b18('0x17c'),'foreignKey':'OpenchannelAccountId'});db[_0x2b18('0x65')][_0x2b18('0x117')](db[_0x2b18('0x89')],{'as':'Answers','foreignKey':_0x2b18('0x18a')});db[_0x2b18('0x65')][_0x2b18('0x117')](db[_0x2b18('0x68')],{'as':'Interactions','foreignKey':'OpenchannelAccountId'});db[_0x2b18('0x65')][_0x2b18('0x117')](db[_0x2b18('0x18b')],{'as':'Messages','foreignKey':_0x2b18('0x18a')});db[_0x2b18('0x65')]['hasMany'](db[_0x2b18('0x67')],{'as':_0x2b18('0x14a'),'foreignKey':_0x2b18('0x18a')});db[_0x2b18('0x65')][_0x2b18('0x155')](db[_0x2b18('0xfa')],{'as':_0x2b18('0x169'),'foreignKey':_0x2b18('0x16a')});db[_0x2b18('0x65')]['belongsTo'](db[_0x2b18('0x90')],{'as':_0x2b18('0x18c'),'foreignKey':_0x2b18('0x16c')});db[_0x2b18('0x65')]['belongsToMany'](db[_0x2b18('0x12')],{'as':_0x2b18('0x159'),'through':_0x2b18('0x141')});db[_0x2b18('0x67')][_0x2b18('0x155')](db[_0x2b18('0x12')],{'onDelete':_0x2b18('0x177')});db['OpenchannelApplication']['belongsTo'](db[_0x2b18('0x6a')],{'onDelete':_0x2b18('0x177'),'foreignKey':_0x2b18('0x18d')});db[_0x2b18('0x67')]['belongsTo'](db['OpenchannelAccount'],{'onDelete':_0x2b18('0x177'),'foreignKey':_0x2b18('0x18a')});db['OpenchannelApplication'][_0x2b18('0x155')](db['Interval'],{'onDelete':_0x2b18('0x177'),'foreignKey':_0x2b18('0x18e')});db[_0x2b18('0x67')][_0x2b18('0x155')](db['Tag'],{'onDelete':_0x2b18('0x177'),'foreignKey':_0x2b18('0x179')});db[_0x2b18('0x68')][_0x2b18('0x117')](db[_0x2b18('0x18b')],{'as':_0x2b18('0x15e'),'onDelete':_0x2b18('0x11b'),'foreignKey':'OpenchannelInteractionId'});db[_0x2b18('0x68')]['belongsTo'](db[_0x2b18('0x65')],{'as':_0x2b18('0x16f'),'foreignKey':_0x2b18('0x18a')});db[_0x2b18('0x68')][_0x2b18('0x155')](db[_0x2b18('0x7a')],{'as':_0x2b18('0x164'),'foreignKey':'ContactId'});db[_0x2b18('0x68')]['belongsTo'](db['User'],{'as':_0x2b18('0x170'),'foreignKey':'UserId'});db[_0x2b18('0x68')][_0x2b18('0x127')](db[_0x2b18('0x178')],{'through':_0x2b18('0x18f'),'as':_0x2b18('0x172')});db[_0x2b18('0x68')][_0x2b18('0x127')](db[_0x2b18('0x178')],{'through':_0x2b18('0x18f'),'as':_0x2b18('0x173')});db[_0x2b18('0x68')][_0x2b18('0x127')](db[_0x2b18('0x12')],{'as':_0x2b18('0x174'),'through':_0x2b18('0x133'),'foreignKey':'OpenchannelInteractionId'});db[_0x2b18('0x18b')][_0x2b18('0x155')](db['User'],{'onDelete':'cascade','as':_0x2b18('0x12')});db[_0x2b18('0x18b')][_0x2b18('0x155')](db[_0x2b18('0x7a')],{'onDelete':_0x2b18('0x11b'),'as':_0x2b18('0x164')});db[_0x2b18('0x18b')][_0x2b18('0x155')](db[_0x2b18('0x68')],{'onDelete':'cascade','as':_0x2b18('0x176'),'foreignKey':'OpenchannelInteractionId'});db[_0x2b18('0x18b')]['belongsTo'](db['Attachment'],{'as':_0x2b18('0xf1'),'foreignKey':_0x2b18('0x190')});db[_0x2b18('0x18b')][_0x2b18('0x155')](db[_0x2b18('0x65')],{'as':_0x2b18('0x16f'),'foreignKey':_0x2b18('0x18a')});db[_0x2b18('0x6a')][_0x2b18('0x127')](db['User'],{'as':'Agents','through':'UserOpenchannelQueue','foreignKey':'OpenchannelQueueId'});db['OpenchannelQueue']['belongsToMany'](db[_0x2b18('0x12d')],{'through':'team_has_openchannel_queues','as':'Teams'});db[_0x2b18('0x191')]['hasMany'](db[_0x2b18('0x8b')],{'as':_0x2b18('0x17c'),'foreignKey':'ChatWebsiteId'});db['ChatWebsite']['hasMany'](db[_0x2b18('0x89')],{'as':_0x2b18('0x167'),'foreignKey':_0x2b18('0x192')});db[_0x2b18('0x191')]['hasMany'](db[_0x2b18('0x77')],{'as':_0x2b18('0x193')});db[_0x2b18('0x191')]['hasMany'](db['ChatInteraction'],{'as':'Interactions'});db[_0x2b18('0x191')]['hasMany'](db[_0x2b18('0x6e')],{'as':'Applications'});db[_0x2b18('0x191')][_0x2b18('0x117')](db[_0x2b18('0x72')],{'as':'Messages'});db['ChatWebsite'][_0x2b18('0x155')](db[_0x2b18('0xfa')],{'as':_0x2b18('0x169'),'foreignKey':_0x2b18('0x16a')});db[_0x2b18('0x191')][_0x2b18('0x155')](db[_0x2b18('0x158')],{'as':_0x2b18('0x158'),'foreignKey':_0x2b18('0x18e')});db[_0x2b18('0x191')]['belongsTo'](db[_0x2b18('0x90')],{'as':_0x2b18('0x18c'),'foreignKey':_0x2b18('0x16c')});db[_0x2b18('0x191')][_0x2b18('0x127')](db[_0x2b18('0x12')],{'as':_0x2b18('0x159'),'through':_0x2b18('0x194')});db[_0x2b18('0x6c')][_0x2b18('0x155')](db[_0x2b18('0x65')],{});db['OpenchannelQueueReport'][_0x2b18('0x155')](db['CmList'],{'as':_0x2b18('0x169'),'foreignKey':'ListId'});db[_0x2b18('0x6c')][_0x2b18('0x155')](db['CmContact'],{'as':'Contact','foreignKey':_0x2b18('0x17a')});db[_0x2b18('0x6c')]['belongsTo'](db[_0x2b18('0x68')],{});db[_0x2b18('0x6c')][_0x2b18('0x155')](db['OpenchannelMessage'],{});db[_0x2b18('0x6c')][_0x2b18('0x155')](db[_0x2b18('0x12')],{});db[_0x2b18('0x6c')]['belongsTo'](db[_0x2b18('0x6a')],{});db[_0x2b18('0x6e')][_0x2b18('0x155')](db['User'],{'as':_0x2b18('0x195'),'foreignKey':_0x2b18('0x116'),'onDelete':_0x2b18('0x177')});db['ChatApplication'][_0x2b18('0x155')](db[_0x2b18('0x73')],{'as':'Queue','foreignKey':_0x2b18('0x196'),'onDelete':_0x2b18('0x177')});db['ChatApplication'][_0x2b18('0x155')](db['ChatWebsite'],{'as':'Website','foreignKey':_0x2b18('0x192'),'onDelete':_0x2b18('0x177')});db['ChatApplication']['belongsTo'](db[_0x2b18('0x178')],{'onDelete':'restrict','foreignKey':'TagId'});db[_0x2b18('0x70')][_0x2b18('0x117')](db[_0x2b18('0x72')],{'as':_0x2b18('0x15e'),'onDelete':_0x2b18('0x11b'),'foreignKey':'ChatInteractionId'});db['ChatInteraction'][_0x2b18('0x155')](db['ChatWebsite'],{'as':'Account','foreignKey':_0x2b18('0x192')});db[_0x2b18('0x70')][_0x2b18('0x155')](db[_0x2b18('0x7a')],{'as':_0x2b18('0x164'),'foreignKey':'ContactId'});db[_0x2b18('0x70')][_0x2b18('0x155')](db[_0x2b18('0x12')],{'as':_0x2b18('0x170'),'foreignKey':'UserId'});db[_0x2b18('0x70')][_0x2b18('0x127')](db[_0x2b18('0x178')],{'through':'chat_interaction_has_tags','as':'Tags'});db['ChatInteraction'][_0x2b18('0x127')](db[_0x2b18('0x178')],{'through':_0x2b18('0x197'),'as':'ThroughTags'});db[_0x2b18('0x70')][_0x2b18('0x127')](db['User'],{'as':_0x2b18('0x174'),'through':_0x2b18('0x130'),'foreignKey':_0x2b18('0x198')});db[_0x2b18('0x72')][_0x2b18('0x155')](db[_0x2b18('0x12')],{'onDelete':'cascade','as':_0x2b18('0x12')});db[_0x2b18('0x72')]['belongsTo'](db[_0x2b18('0x7a')],{'onDelete':'cascade','as':_0x2b18('0x164'),'foreignKey':_0x2b18('0x17a')});db['ChatMessage'][_0x2b18('0x155')](db[_0x2b18('0x70')],{'onDelete':_0x2b18('0x11b'),'as':_0x2b18('0x176'),'foreignKey':_0x2b18('0x198')});db[_0x2b18('0x72')][_0x2b18('0x155')](db[_0x2b18('0xf1')],{'as':'Attachment','foreignKey':_0x2b18('0x190')});db[_0x2b18('0x72')][_0x2b18('0x155')](db[_0x2b18('0x191')],{'as':'Account','foreignKey':_0x2b18('0x192')});db[_0x2b18('0x199')][_0x2b18('0x155')](db[_0x2b18('0x7a')],{'onDelete':'cascade','as':_0x2b18('0x164'),'foreignKey':'ContactId'});db[_0x2b18('0x199')]['belongsTo'](db['ChatWebsite'],{'as':'Account','foreignKey':_0x2b18('0x192')});db[_0x2b18('0x73')]['belongsToMany'](db[_0x2b18('0x12')],{'as':'Agents','through':_0x2b18('0x34'),'hooks':!![]});db['ChatQueue'][_0x2b18('0x127')](db['Team'],{'through':_0x2b18('0x19a'),'as':_0x2b18('0x15a')});db[_0x2b18('0x75')][_0x2b18('0x117')](db[_0x2b18('0x19b')],{'as':'Messages','foreignKey':'ChatGroupId','onDelete':'cascade'});db[_0x2b18('0x75')][_0x2b18('0x127')](db['User'],{'as':_0x2b18('0x14d'),'through':_0x2b18('0x19c')});db[_0x2b18('0x77')][_0x2b18('0x155')](db['ChatWebsite'],{'as':_0x2b18('0x19d'),'foreignKey':'ChatWebsiteId'});db[_0x2b18('0x78')][_0x2b18('0x117')](db[_0x2b18('0x7a')],{'as':_0x2b18('0x129'),'foreignKey':'CompanyId'});db[_0x2b18('0x7a')][_0x2b18('0x117')](db[_0x2b18('0x7b')],{'as':'Hoppers','foreignKey':_0x2b18('0x17a')});db[_0x2b18('0x7a')][_0x2b18('0x117')](db[_0x2b18('0x7e')],{'as':'HopperFinals','foreignKey':_0x2b18('0x17a')});db[_0x2b18('0x7a')]['hasMany'](db['CmHopperHistory'],{'as':_0x2b18('0x150'),'foreignKey':_0x2b18('0x17a')});db[_0x2b18('0x7a')][_0x2b18('0x117')](db[_0x2b18('0x81')],{'as':_0x2b18('0x81'),'foreignKey':_0x2b18('0x17a')});db['CmContact']['hasMany'](db[_0x2b18('0xe1')],{'as':_0x2b18('0x153'),'foreignKey':'ContactId'});db[_0x2b18('0x7a')][_0x2b18('0x117')](db[_0x2b18('0x68')],{'as':_0x2b18('0x11f'),'foreignKey':_0x2b18('0x17a'),'onDelete':_0x2b18('0x177')});db[_0x2b18('0x7a')]['hasMany'](db[_0x2b18('0x70')],{'as':_0x2b18('0x120'),'foreignKey':'ContactId','onDelete':_0x2b18('0x177')});db['CmContact'][_0x2b18('0x117')](db['SmsInteraction'],{'as':_0x2b18('0x121'),'foreignKey':_0x2b18('0x17a'),'onDelete':_0x2b18('0x177')});db['CmContact'][_0x2b18('0x117')](db['FaxInteraction'],{'as':_0x2b18('0x122'),'foreignKey':_0x2b18('0x17a'),'onDelete':_0x2b18('0x177')});db[_0x2b18('0x7a')][_0x2b18('0x117')](db[_0x2b18('0x48')],{'as':'MailInteractions','foreignKey':_0x2b18('0x17a'),'onDelete':'restrict'});db[_0x2b18('0x7a')]['belongsTo'](db['CmCompany'],{'as':_0x2b18('0x19e'),'foreignKey':_0x2b18('0x19f')});db['CmContact']['belongsTo'](db[_0x2b18('0xfa')],{'as':_0x2b18('0x169'),'foreignKey':_0x2b18('0x16a'),'onDelete':_0x2b18('0x11b')});db[_0x2b18('0x7a')][_0x2b18('0x127')](db['User'],{'as':_0x2b18('0x174'),'through':_0x2b18('0x12a')});db[_0x2b18('0x7a')][_0x2b18('0x127')](db[_0x2b18('0x178')],{'as':'Tags','through':'cm_contact_has_tags'});db[_0x2b18('0x7a')][_0x2b18('0x127')](db[_0x2b18('0x178')],{'through':_0x2b18('0x1a0'),'as':_0x2b18('0x173')});db['CmHopper'][_0x2b18('0x155')](db[_0x2b18('0x7a')],{'as':_0x2b18('0x164'),'foreignKey':_0x2b18('0x17a'),'onDelete':'cascade'});db['CmHopper'][_0x2b18('0x155')](db[_0x2b18('0xfa')],{'as':'List','foreignKey':'ListId','onDelete':_0x2b18('0x11b')});db[_0x2b18('0x7b')][_0x2b18('0x155')](db[_0x2b18('0x12')],{'as':_0x2b18('0x195'),'foreignKey':_0x2b18('0x116')});db['CmHopper']['belongsTo'](db[_0x2b18('0x1c')],{'as':_0x2b18('0x1a1'),'foreignKey':_0x2b18('0x14e'),'onDelete':_0x2b18('0x11b')});db['CmHopper'][_0x2b18('0x155')](db[_0x2b18('0xee')],{'as':_0x2b18('0xee'),'foreignKey':_0x2b18('0x1a2'),'onDelete':_0x2b18('0x11b')});db[_0x2b18('0x7b')][_0x2b18('0x155')](db['User'],{'as':_0x2b18('0x170'),'foreignKey':'OwnerId'});db[_0x2b18('0x151')][_0x2b18('0x155')](db[_0x2b18('0x7a')],{'as':_0x2b18('0x164'),'foreignKey':_0x2b18('0x17a'),'onDelete':_0x2b18('0x11b')});db[_0x2b18('0x151')]['belongsTo'](db['CmList'],{'as':_0x2b18('0x169'),'foreignKey':_0x2b18('0x16a'),'onDelete':_0x2b18('0x11b')});db[_0x2b18('0x151')]['belongsTo'](db['VoiceQueue'],{'as':_0x2b18('0x1a1'),'foreignKey':_0x2b18('0x14e'),'onDelete':_0x2b18('0x11b')});db[_0x2b18('0x151')]['belongsTo'](db[_0x2b18('0xee')],{'as':_0x2b18('0xee'),'foreignKey':_0x2b18('0x1a2'),'onDelete':_0x2b18('0x11b')});db[_0x2b18('0x87')][_0x2b18('0x117')](db[_0x2b18('0x8d')],{'as':{'plural':_0x2b18('0x1a3'),'singular':_0x2b18('0x1a4')},'foreignKey':_0x2b18('0x1a5'),'onDelete':'cascade','hooks':!![]});db['Automation'][_0x2b18('0x117')](db[_0x2b18('0x8d')],{'as':{'plural':_0x2b18('0x1a6'),'singular':_0x2b18('0x1a7')},'foreignKey':_0x2b18('0x1a8'),'onDelete':_0x2b18('0x11b'),'hooks':!![]});db['Automation']['hasMany'](db[_0x2b18('0x85')],{'as':_0x2b18('0x1a9'),'foreignKey':'AutomationId','onDelete':'cascade','hooks':!![]});db['Interval']['hasMany'](db['Interval'],{'as':'Intervals','foreignKey':_0x2b18('0x18e'),'onDelete':_0x2b18('0x11b'),'hooks':!![],'required':![]});db['Interval'][_0x2b18('0x117')](db[_0x2b18('0x18')],{'as':_0x2b18('0x11a'),'foreignKey':_0x2b18('0x18e'),'onDelete':_0x2b18('0x177')});db[_0x2b18('0x158')]['hasMany'](db[_0x2b18('0x4c')],{'as':_0x2b18('0x1aa'),'foreignKey':_0x2b18('0x18e')});db['Interval'][_0x2b18('0x117')](db[_0x2b18('0x6e')],{'as':'ChatApplications','foreignKey':_0x2b18('0x18e')});db[_0x2b18('0x158')]['hasMany'](db[_0x2b18('0x54')],{'as':_0x2b18('0x1ab'),'foreignKey':_0x2b18('0x18e')});db['Interval']['hasMany'](db[_0x2b18('0x185')],{'as':_0x2b18('0x1ac'),'foreignKey':_0x2b18('0x18e')});db['Schedule']['belongsTo'](db[_0x2b18('0x42')],{});db['Schedule'][_0x2b18('0x155')](db[_0x2b18('0xa4')],{'foreignKey':_0x2b18('0x1ad')});db[_0x2b18('0x1ae')]['belongsTo'](db[_0x2b18('0xa2')],{'foreignKey':'CustomReportId'});db[_0x2b18('0x96')][_0x2b18('0x127')](db[_0x2b18('0x1a')],{'as':_0x2b18('0x1af'),'through':_0x2b18('0x14c'),'onDelete':_0x2b18('0x177')});db[_0x2b18('0x178')]['belongsToMany'](db[_0x2b18('0x7a')],{'through':_0x2b18('0x1a0')});db[_0x2b18('0x178')][_0x2b18('0x127')](db[_0x2b18('0x70')],{'through':_0x2b18('0x197')});db[_0x2b18('0x178')][_0x2b18('0x127')](db[_0x2b18('0x48')],{'through':'mail_interaction_has_tags'});db[_0x2b18('0x178')][_0x2b18('0x127')](db['SmsInteraction'],{'through':_0x2b18('0x188')});db[_0x2b18('0x178')]['belongsToMany'](db[_0x2b18('0x56')],{'through':_0x2b18('0x181')});db[_0x2b18('0x178')][_0x2b18('0x127')](db[_0x2b18('0x68')],{'through':_0x2b18('0x18f')});db[_0x2b18('0x178')][_0x2b18('0x127')](db[_0x2b18('0x109')],{'through':_0x2b18('0x1b0')});db[_0x2b18('0x9a')][_0x2b18('0x117')](db[_0x2b18('0x8d')],{'as':{'plural':_0x2b18('0x1b1'),'singular':_0x2b18('0x1b2')},'foreignKey':_0x2b18('0x1b3'),'onDelete':_0x2b18('0x11b'),'hooks':!![]});db[_0x2b18('0x9a')][_0x2b18('0x117')](db[_0x2b18('0x8d')],{'as':{'plural':'AnyConditions','singular':_0x2b18('0x1b4')},'foreignKey':'TriggerAnyId','onDelete':_0x2b18('0x11b'),'hooks':!![]});db[_0x2b18('0x9a')][_0x2b18('0x117')](db[_0x2b18('0x85')],{'as':'Actions','foreignKey':_0x2b18('0x1b5'),'onDelete':_0x2b18('0x11b'),'hooks':!![]});db[_0x2b18('0xa2')]['hasMany'](db['AnalyticFieldReport'],{'as':_0x2b18('0x1b6'),'onDelete':'cascade','foreignKey':_0x2b18('0x1b7'),'hooks':!![]});db['AnalyticDefaultReport'][_0x2b18('0x117')](db[_0x2b18('0xa9')],{'as':'Fields','onDelete':_0x2b18('0x11b'),'foreignKey':_0x2b18('0x1ad')});db[_0x2b18('0x1b8')][_0x2b18('0x117')](db[_0x2b18('0xa9')],{'as':_0x2b18('0x1b6'),'onDelete':_0x2b18('0x11b'),'foreignKey':_0x2b18('0x1b9')});db[_0x2b18('0xa9')]['belongsTo'](db[_0x2b18('0x1b8')],{'foreignKey':_0x2b18('0x1b9')});db[_0x2b18('0xac')]['hasMany'](db[_0x2b18('0x1ba')],{'as':_0x2b18('0x1bb'),'onDelete':_0x2b18('0x11b'),'foreignKey':_0x2b18('0x1bc')});db[_0x2b18('0x1ba')][_0x2b18('0x117')](db[_0x2b18('0x1bd')],{'as':_0x2b18('0x1be'),'onDelete':_0x2b18('0x11b'),'foreignKey':_0x2b18('0x1bf')});db[_0x2b18('0x1ba')][_0x2b18('0x117')](db[_0x2b18('0x1bd')],{'as':_0x2b18('0x1c0'),'onDelete':_0x2b18('0x11b'),'foreignKey':'DescriptionId'});db[_0x2b18('0x1ba')][_0x2b18('0x117')](db[_0x2b18('0x1bd')],{'as':'Fields','onDelete':'cascade','foreignKey':'FieldId'});db[_0x2b18('0x1ba')][_0x2b18('0x155')](db[_0x2b18('0xac')],{'as':_0x2b18('0x16f'),'foreignKey':_0x2b18('0x1bc')});db[_0x2b18('0x1bd')]['hasMany'](db[_0x2b18('0x1bd')],{'as':_0x2b18('0x1c1'),'foreignKey':_0x2b18('0x1bf')});db['SalesforceField']['hasMany'](db[_0x2b18('0x1bd')],{'as':'Description','foreignKey':'DescriptionId'});db[_0x2b18('0x1bd')][_0x2b18('0x117')](db['SalesforceField'],{'as':'Field','foreignKey':_0x2b18('0x1c2')});db['SalesforceField'][_0x2b18('0x155')](db[_0x2b18('0x9c')],{'as':'Variable','foreignKey':_0x2b18('0x1c3')});db['SugarcrmAccount'][_0x2b18('0x117')](db[_0x2b18('0xb1')],{'as':_0x2b18('0x1bb'),'onDelete':_0x2b18('0x11b'),'foreignKey':_0x2b18('0x1bc')});db[_0x2b18('0xb1')]['hasMany'](db['SugarcrmField'],{'as':_0x2b18('0x1be'),'onDelete':'cascade','foreignKey':'SubjectId'});db[_0x2b18('0xb1')][_0x2b18('0x117')](db['SugarcrmField'],{'as':'Descriptions','onDelete':_0x2b18('0x11b'),'foreignKey':'DescriptionId'});db[_0x2b18('0xb1')][_0x2b18('0x117')](db[_0x2b18('0x1c4')],{'as':'Fields','onDelete':'cascade','foreignKey':_0x2b18('0x1c2')});db['SugarcrmConfiguration'][_0x2b18('0x155')](db['SugarcrmAccount'],{'as':_0x2b18('0x16f'),'foreignKey':'AccountId'});db[_0x2b18('0x1c4')]['hasMany'](db[_0x2b18('0x1c4')],{'as':'Subject','foreignKey':_0x2b18('0x1bf')});db[_0x2b18('0x1c4')][_0x2b18('0x117')](db['SugarcrmField'],{'as':_0x2b18('0x1c5'),'foreignKey':'DescriptionId'});db['SugarcrmField'][_0x2b18('0x117')](db[_0x2b18('0x1c4')],{'as':'Field','foreignKey':_0x2b18('0x1c2')});db['SugarcrmField'][_0x2b18('0x155')](db['Variable'],{'as':'Variable','foreignKey':_0x2b18('0x1c3')});db[_0x2b18('0x1c6')][_0x2b18('0x117')](db[_0x2b18('0xb5')],{'as':_0x2b18('0x1bb'),'onDelete':_0x2b18('0x11b'),'foreignKey':'AccountId'});db[_0x2b18('0xb5')][_0x2b18('0x117')](db[_0x2b18('0xb7')],{'as':_0x2b18('0x1be'),'onDelete':'cascade','foreignKey':_0x2b18('0x1bf')});db['DeskConfiguration'][_0x2b18('0x117')](db['DeskField'],{'as':'Descriptions','onDelete':_0x2b18('0x11b'),'foreignKey':'DescriptionId'});db[_0x2b18('0xb5')][_0x2b18('0x117')](db['DeskField'],{'as':_0x2b18('0x1b6'),'onDelete':_0x2b18('0x11b'),'foreignKey':_0x2b18('0x1c2')});db['DeskConfiguration'][_0x2b18('0x155')](db[_0x2b18('0x1c6')],{'as':_0x2b18('0x16f'),'foreignKey':_0x2b18('0x1bc')});db[_0x2b18('0xb5')]['belongsToMany'](db['Tag'],{'through':_0x2b18('0x1c7')});db[_0x2b18('0xb7')]['hasMany'](db['DeskField'],{'as':_0x2b18('0x1c1'),'foreignKey':'SubjectId'});db[_0x2b18('0xb7')][_0x2b18('0x117')](db[_0x2b18('0xb7')],{'as':_0x2b18('0x1c5'),'foreignKey':_0x2b18('0x1c8')});db[_0x2b18('0xb7')]['hasMany'](db[_0x2b18('0xb7')],{'as':'Field','foreignKey':'FieldId'});db['DeskField'][_0x2b18('0x155')](db[_0x2b18('0x9c')],{'as':_0x2b18('0x9c'),'foreignKey':_0x2b18('0x1c3')});db[_0x2b18('0xb9')]['hasMany'](db[_0x2b18('0xbb')],{'as':_0x2b18('0x1bb'),'onDelete':'cascade','foreignKey':_0x2b18('0x1bc')});db[_0x2b18('0xbb')][_0x2b18('0x117')](db['ZohoField'],{'as':_0x2b18('0x1be'),'onDelete':_0x2b18('0x11b'),'foreignKey':_0x2b18('0x1bf')});db[_0x2b18('0xbb')][_0x2b18('0x117')](db[_0x2b18('0xbc')],{'as':_0x2b18('0x1c0'),'onDelete':_0x2b18('0x11b'),'foreignKey':_0x2b18('0x1c8')});db['ZohoConfiguration'][_0x2b18('0x117')](db[_0x2b18('0xbc')],{'as':_0x2b18('0x1b6'),'onDelete':'cascade','foreignKey':_0x2b18('0x1c2')});db[_0x2b18('0xbb')][_0x2b18('0x155')](db[_0x2b18('0xb9')],{'as':_0x2b18('0x16f'),'foreignKey':_0x2b18('0x1bc')});db[_0x2b18('0xbc')][_0x2b18('0x117')](db[_0x2b18('0xbc')],{'as':_0x2b18('0x1c1'),'foreignKey':'SubjectId'});db[_0x2b18('0xbc')]['hasMany'](db[_0x2b18('0xbc')],{'as':_0x2b18('0x1c5'),'foreignKey':_0x2b18('0x1c8')});db[_0x2b18('0xbc')]['hasMany'](db[_0x2b18('0xbc')],{'as':_0x2b18('0x1c9'),'foreignKey':_0x2b18('0x1c2')});db[_0x2b18('0xbc')][_0x2b18('0x155')](db[_0x2b18('0x9c')],{'as':_0x2b18('0x9c'),'foreignKey':_0x2b18('0x1c3')});db['ZendeskAccount'][_0x2b18('0x117')](db[_0x2b18('0x1ca')],{'as':_0x2b18('0x1bb'),'onDelete':_0x2b18('0x11b'),'foreignKey':_0x2b18('0x1bc')});db[_0x2b18('0x1ca')][_0x2b18('0x117')](db['ZendeskField'],{'as':'Subjects','foreignKey':_0x2b18('0x1bf')});db[_0x2b18('0x1ca')]['hasMany'](db[_0x2b18('0xc1')],{'as':_0x2b18('0x1c0'),'foreignKey':_0x2b18('0x1c8')});db[_0x2b18('0x1ca')]['hasMany'](db[_0x2b18('0xc1')],{'as':'Fields','foreignKey':_0x2b18('0x1c2')});db[_0x2b18('0x1ca')][_0x2b18('0x155')](db['ZendeskAccount'],{'as':_0x2b18('0x16f'),'foreignKey':_0x2b18('0x1bc')});db['ZendeskConfiguration']['belongsToMany'](db[_0x2b18('0x178')],{'through':'int_zendesk_configuration_has_tags'});db[_0x2b18('0xc1')][_0x2b18('0x117')](db['ZendeskField'],{'as':_0x2b18('0x1c1'),'foreignKey':_0x2b18('0x1bf')});db[_0x2b18('0xc1')]['hasMany'](db[_0x2b18('0xc1')],{'as':_0x2b18('0x1c5'),'foreignKey':_0x2b18('0x1c8')});db['ZendeskField']['hasMany'](db[_0x2b18('0xc1')],{'as':'Field','foreignKey':_0x2b18('0x1c2')});db['ZendeskField'][_0x2b18('0x155')](db[_0x2b18('0x9c')],{'as':'Variable','foreignKey':_0x2b18('0x1c3')});db[_0x2b18('0xc2')][_0x2b18('0x117')](db['FreshdeskConfiguration'],{'as':'Configurations','onDelete':_0x2b18('0x11b'),'foreignKey':_0x2b18('0x1bc')});db[_0x2b18('0x1cb')][_0x2b18('0x117')](db['FreshdeskField'],{'as':_0x2b18('0x1be'),'onDelete':'cascade','foreignKey':_0x2b18('0x1bf')});db[_0x2b18('0x1cb')][_0x2b18('0x117')](db['FreshdeskField'],{'as':_0x2b18('0x1c0'),'onDelete':_0x2b18('0x11b'),'foreignKey':_0x2b18('0x1c8')});db[_0x2b18('0x1cb')]['hasMany'](db[_0x2b18('0xc5')],{'as':'Fields','onDelete':_0x2b18('0x11b'),'foreignKey':_0x2b18('0x1c2')});db[_0x2b18('0x1cb')][_0x2b18('0x155')](db[_0x2b18('0xc2')],{'as':_0x2b18('0x16f'),'foreignKey':'AccountId'});db[_0x2b18('0x1cb')][_0x2b18('0x127')](db[_0x2b18('0x178')],{'through':_0x2b18('0x1cc')});db[_0x2b18('0xc5')][_0x2b18('0x117')](db[_0x2b18('0xc5')],{'as':'Subject','foreignKey':_0x2b18('0x1bf')});db[_0x2b18('0xc5')][_0x2b18('0x117')](db['FreshdeskField'],{'as':_0x2b18('0x1c5'),'foreignKey':_0x2b18('0x1c8')});db[_0x2b18('0xc5')][_0x2b18('0x117')](db['FreshdeskField'],{'as':_0x2b18('0x1c9'),'foreignKey':_0x2b18('0x1c2')});db[_0x2b18('0xc5')]['belongsTo'](db[_0x2b18('0x9c')],{'as':'Variable','foreignKey':_0x2b18('0x1c3')});db['VtigerAccount']['hasMany'](db[_0x2b18('0x1cd')],{'as':'Configurations','onDelete':_0x2b18('0x11b'),'foreignKey':_0x2b18('0x1bc')});db[_0x2b18('0x1cd')]['hasMany'](db[_0x2b18('0x1ce')],{'as':_0x2b18('0x1be'),'foreignKey':_0x2b18('0x1bf')});db[_0x2b18('0x1cd')][_0x2b18('0x117')](db[_0x2b18('0x1ce')],{'as':_0x2b18('0x1c0'),'foreignKey':_0x2b18('0x1c8')});db[_0x2b18('0x1cd')][_0x2b18('0x117')](db[_0x2b18('0x1ce')],{'as':_0x2b18('0x1b6'),'foreignKey':_0x2b18('0x1c2')});db['VtigerConfiguration'][_0x2b18('0x155')](db['VtigerAccount'],{'as':_0x2b18('0x16f'),'foreignKey':_0x2b18('0x1bc')});db[_0x2b18('0x1ce')][_0x2b18('0x117')](db[_0x2b18('0x1ce')],{'as':_0x2b18('0x1c1'),'foreignKey':_0x2b18('0x1bf')});db['VtigerField'][_0x2b18('0x117')](db[_0x2b18('0x1ce')],{'as':_0x2b18('0x1c5'),'foreignKey':_0x2b18('0x1c8')});db[_0x2b18('0x1ce')]['hasMany'](db[_0x2b18('0x1ce')],{'as':_0x2b18('0x1c9'),'foreignKey':_0x2b18('0x1c2')});db[_0x2b18('0x1ce')][_0x2b18('0x155')](db[_0x2b18('0x9c')],{'as':_0x2b18('0x9c'),'foreignKey':'VariableId'});db[_0x2b18('0xcb')][_0x2b18('0x117')](db[_0x2b18('0x1cf')],{'as':_0x2b18('0x1bb'),'onDelete':'cascade','foreignKey':_0x2b18('0x1bc')});db[_0x2b18('0x1cf')]['hasMany'](db[_0x2b18('0xcd')],{'as':_0x2b18('0x1be'),'foreignKey':_0x2b18('0x1bf')});db['ServicenowConfiguration'][_0x2b18('0x117')](db[_0x2b18('0xcd')],{'as':'Descriptions','foreignKey':'DescriptionId'});db[_0x2b18('0x1cf')][_0x2b18('0x117')](db[_0x2b18('0xcd')],{'as':_0x2b18('0x1b6'),'foreignKey':_0x2b18('0x1c2')});db[_0x2b18('0x1cf')][_0x2b18('0x155')](db['ServicenowAccount'],{'as':_0x2b18('0x16f'),'foreignKey':_0x2b18('0x1bc')});db[_0x2b18('0xcd')][_0x2b18('0x117')](db[_0x2b18('0xcd')],{'as':_0x2b18('0x1c1'),'foreignKey':_0x2b18('0x1bf')});db[_0x2b18('0xcd')][_0x2b18('0x117')](db[_0x2b18('0xcd')],{'as':_0x2b18('0x1c5'),'foreignKey':_0x2b18('0x1c8')});db[_0x2b18('0xcd')][_0x2b18('0x117')](db[_0x2b18('0xcd')],{'as':_0x2b18('0x1c9'),'foreignKey':_0x2b18('0x1c2')});db[_0x2b18('0xcd')][_0x2b18('0x155')](db[_0x2b18('0x9c')],{'as':_0x2b18('0x9c'),'foreignKey':'VariableId'});db[_0x2b18('0xcf')]['hasMany'](db[_0x2b18('0xd0')],{'as':_0x2b18('0x1bb'),'onDelete':_0x2b18('0x11b'),'foreignKey':_0x2b18('0x1bc')});db[_0x2b18('0xd0')][_0x2b18('0x117')](db[_0x2b18('0xd2')],{'as':_0x2b18('0x1be'),'onDelete':_0x2b18('0x11b'),'foreignKey':'SubjectId'});db[_0x2b18('0xd0')][_0x2b18('0x117')](db[_0x2b18('0xd2')],{'as':_0x2b18('0x1c0'),'onDelete':_0x2b18('0x11b'),'foreignKey':_0x2b18('0x1c8')});db[_0x2b18('0xd0')][_0x2b18('0x117')](db['Dynamics365Field'],{'as':_0x2b18('0x1b6'),'onDelete':'cascade','foreignKey':_0x2b18('0x1c2')});db[_0x2b18('0xd0')]['belongsTo'](db[_0x2b18('0xcf')],{'as':_0x2b18('0x16f'),'foreignKey':_0x2b18('0x1bc')});db['Dynamics365Field'][_0x2b18('0x117')](db['Dynamics365Field'],{'as':_0x2b18('0x1c1'),'foreignKey':_0x2b18('0x1bf')});db[_0x2b18('0xd2')][_0x2b18('0x117')](db[_0x2b18('0xd2')],{'as':'Description','foreignKey':_0x2b18('0x1c8')});db[_0x2b18('0xd2')]['hasMany'](db[_0x2b18('0xd2')],{'as':_0x2b18('0x1c9'),'foreignKey':'FieldId'});db[_0x2b18('0xd2')][_0x2b18('0x155')](db[_0x2b18('0x9c')],{'as':_0x2b18('0x9c'),'foreignKey':_0x2b18('0x1c3')});db[_0x2b18('0xd4')][_0x2b18('0x117')](db[_0x2b18('0xd5')],{'as':_0x2b18('0x1bb'),'onDelete':'cascade','foreignKey':'AccountId'});db[_0x2b18('0xd5')][_0x2b18('0x117')](db[_0x2b18('0xd7')],{'as':_0x2b18('0x1be'),'foreignKey':_0x2b18('0x1bf')});db[_0x2b18('0xd5')][_0x2b18('0x117')](db['FreshsalesField'],{'as':_0x2b18('0x1c0'),'foreignKey':_0x2b18('0x1c8')});db['FreshsalesConfiguration'][_0x2b18('0x117')](db[_0x2b18('0xd7')],{'as':_0x2b18('0x1b6'),'foreignKey':'FieldId'});db[_0x2b18('0xd5')]['belongsTo'](db[_0x2b18('0xd4')],{'as':'Account','foreignKey':_0x2b18('0x1bc')});db['FreshsalesField'][_0x2b18('0x117')](db['FreshsalesField'],{'as':_0x2b18('0x1c1'),'foreignKey':_0x2b18('0x1bf')});db[_0x2b18('0xd7')][_0x2b18('0x117')](db[_0x2b18('0xd7')],{'as':'Description','foreignKey':'DescriptionId'});db[_0x2b18('0xd7')][_0x2b18('0x117')](db[_0x2b18('0xd7')],{'as':_0x2b18('0x1c9'),'foreignKey':'FieldId'});db[_0x2b18('0xd7')][_0x2b18('0x155')](db[_0x2b18('0x9c')],{'as':_0x2b18('0x9c'),'foreignKey':_0x2b18('0x1c3')});db[_0x2b18('0xda')][_0x2b18('0x155')](db[_0x2b18('0x191')],{});db[_0x2b18('0xda')]['belongsTo'](db[_0x2b18('0xfa')],{'as':'List','foreignKey':_0x2b18('0x16a')});db['ChatQueueReport'][_0x2b18('0x155')](db[_0x2b18('0x7a')],{'as':_0x2b18('0x164'),'foreignKey':_0x2b18('0x17a')});db[_0x2b18('0xda')]['belongsTo'](db[_0x2b18('0x70')],{});db[_0x2b18('0xda')][_0x2b18('0x155')](db[_0x2b18('0x72')],{});db[_0x2b18('0xda')]['belongsTo'](db[_0x2b18('0x12')],{});db[_0x2b18('0xda')][_0x2b18('0x155')](db[_0x2b18('0x73')],{});db[_0x2b18('0x19b')]['belongsTo'](db[_0x2b18('0x12')],{'onDelete':'cascade','foreignKey':_0x2b18('0x1d0')});db['ChatInternalMessage'][_0x2b18('0x155')](db['User'],{'onDelete':'cascade','foreignKey':_0x2b18('0x1d1')});db['JscriptySessionReport'][_0x2b18('0x117')](db[_0x2b18('0xdf')],{'foreignKey':_0x2b18('0x1d2'),'onDelete':_0x2b18('0x11b')});db['JscriptySessionReport']['hasMany'](db['JscriptyAnswerReport'],{'foreignKey':_0x2b18('0x1d2'),'onDelete':_0x2b18('0x11b')});db[_0x2b18('0x1d3')][_0x2b18('0x155')](db[_0x2b18('0x5d')],{});db[_0x2b18('0x1d3')]['belongsTo'](db[_0x2b18('0xfa')],{'as':_0x2b18('0x169'),'foreignKey':_0x2b18('0x16a')});db[_0x2b18('0x1d3')]['belongsTo'](db[_0x2b18('0x7a')],{'as':'Contact','foreignKey':_0x2b18('0x17a')});db[_0x2b18('0x1d3')][_0x2b18('0x155')](db[_0x2b18('0x184')],{});db[_0x2b18('0x1d3')][_0x2b18('0x155')](db['SmsMessage'],{});db['SmsQueueReport'][_0x2b18('0x155')](db[_0x2b18('0x12')],{});db[_0x2b18('0x1d3')][_0x2b18('0x155')](db[_0x2b18('0x63')],{});db[_0x2b18('0xe5')][_0x2b18('0x117')](db['JscriptySessionReport'],{'foreignKey':_0x2b18('0x1d4')});db[_0x2b18('0xe5')]['hasMany'](db[_0x2b18('0xdf')],{'foreignKey':_0x2b18('0x1d4')});db['JscriptyProject']['hasMany'](db['JscriptyAnswerReport'],{'foreignKey':'ProjectId'});db[_0x2b18('0xea')][_0x2b18('0x127')](db[_0x2b18('0x12')],{'as':_0x2b18('0x174'),'through':_0x2b18('0x146')});db['Team'][_0x2b18('0x127')](db[_0x2b18('0x12')],{'as':_0x2b18('0x159'),'through':'user_has_teams'});db[_0x2b18('0x12d')][_0x2b18('0x127')](db[_0x2b18('0x1c')],{'through':_0x2b18('0x15b'),'as':_0x2b18('0x135')});db[_0x2b18('0x12d')][_0x2b18('0x127')](db[_0x2b18('0x44')],{'through':_0x2b18('0x16d'),'as':_0x2b18('0x137')});db['Team']['belongsToMany'](db['ChatQueue'],{'through':_0x2b18('0x19a'),'as':_0x2b18('0x138')});db[_0x2b18('0x12d')][_0x2b18('0x127')](db[_0x2b18('0x5a')],{'through':_0x2b18('0x182'),'as':_0x2b18('0x139')});db['Team'][_0x2b18('0x127')](db['SmsQueue'],{'through':'team_has_sms_queues','as':_0x2b18('0x13a')});db[_0x2b18('0x12d')]['belongsToMany'](db[_0x2b18('0x6a')],{'through':_0x2b18('0x1d5'),'as':_0x2b18('0x13b')});db[_0x2b18('0x12d')][_0x2b18('0x127')](db['WhatsappQueue'],{'through':_0x2b18('0x1d6'),'as':_0x2b18('0x13c')});db['Campaign'][_0x2b18('0x117')](db[_0x2b18('0x7b')],{'as':_0x2b18('0x14f'),'foreignKey':_0x2b18('0x1a2')});db['Campaign'][_0x2b18('0x117')](db['CmHopperFinal'],{'as':'HopperFinals','foreignKey':_0x2b18('0x1a2')});db[_0x2b18('0xee')]['hasMany'](db[_0x2b18('0x11d')],{'as':_0x2b18('0x150'),'foreignKey':'CampaignId'});db[_0x2b18('0xee')]['hasMany'](db[_0x2b18('0x151')],{'as':_0x2b18('0x152'),'foreignKey':_0x2b18('0x1a2')});db[_0x2b18('0xee')]['belongsTo'](db[_0x2b18('0x2e')],{'as':_0x2b18('0x2e'),'foreignKey':_0x2b18('0x154')});db[_0x2b18('0xee')][_0x2b18('0x155')](db[_0x2b18('0x2e')],{'as':'TrunkBackup','foreignKey':_0x2b18('0x157')});db['Campaign']['belongsTo'](db[_0x2b18('0x158')],{'as':_0x2b18('0x158'),'foreignKey':'IntervalId'});db[_0x2b18('0xee')][_0x2b18('0x155')](db[_0x2b18('0xea')],{'as':_0x2b18('0xea'),'foreignKey':_0x2b18('0x1d7')});db[_0x2b18('0xee')][_0x2b18('0x127')](db[_0x2b18('0xfa')],{'as':_0x2b18('0x12b'),'through':_0x2b18('0x1d8')});db[_0x2b18('0xee')][_0x2b18('0x127')](db[_0x2b18('0xfa')],{'as':_0x2b18('0x1d9'),'through':'campaigns_has_cm_blacklists'});db[_0x2b18('0xf4')][_0x2b18('0x155')](db[_0x2b18('0x4a')],{});db['MailTransferReport']['belongsTo'](db[_0x2b18('0x48')],{});db[_0x2b18('0xf4')][_0x2b18('0x155')](db['MailAccount'],{'foreignKey':_0x2b18('0x1da'),'as':_0x2b18('0x1db')});db[_0x2b18('0xf4')]['belongsTo'](db[_0x2b18('0x12')],{'foreignKey':_0x2b18('0x1dc'),'as':'FromAgent'});db[_0x2b18('0xf4')]['belongsTo'](db[_0x2b18('0x12')],{'foreignKey':_0x2b18('0x1dd'),'as':'ToAgent'});db[_0x2b18('0xf4')][_0x2b18('0x155')](db[_0x2b18('0x44')],{'foreignKey':'ToMailQueueId','as':_0x2b18('0x1de')});db[_0x2b18('0xf4')][_0x2b18('0x155')](db['MailAccount'],{'foreignKey':_0x2b18('0x1df'),'as':_0x2b18('0x1e0')});db[_0x2b18('0xf5')][_0x2b18('0x155')](db[_0x2b18('0x72')],{});db[_0x2b18('0xf5')][_0x2b18('0x155')](db[_0x2b18('0x70')],{});db[_0x2b18('0xf5')][_0x2b18('0x155')](db[_0x2b18('0x191')],{'foreignKey':_0x2b18('0x1e1'),'as':'FromAccount'});db[_0x2b18('0xf5')][_0x2b18('0x155')](db[_0x2b18('0x12')],{'foreignKey':_0x2b18('0x1dc'),'as':_0x2b18('0x1e2')});db[_0x2b18('0xf5')]['belongsTo'](db['User'],{'foreignKey':_0x2b18('0x1dd'),'as':_0x2b18('0x1e3')});db[_0x2b18('0xf5')]['belongsTo'](db['ChatQueue'],{'foreignKey':_0x2b18('0x1e4'),'as':_0x2b18('0x1de')});db[_0x2b18('0xf5')]['belongsTo'](db[_0x2b18('0x191')],{'foreignKey':'ToChatWebsiteId','as':_0x2b18('0x1e0')});db[_0x2b18('0xf7')][_0x2b18('0x155')](db[_0x2b18('0x58')],{});db[_0x2b18('0xf7')][_0x2b18('0x155')](db[_0x2b18('0x56')],{});db['FaxTransferReport'][_0x2b18('0x155')](db[_0x2b18('0x53')],{'foreignKey':_0x2b18('0x1e5'),'as':_0x2b18('0x1db')});db[_0x2b18('0xf7')][_0x2b18('0x155')](db[_0x2b18('0x12')],{'foreignKey':_0x2b18('0x1dc'),'as':_0x2b18('0x1e2')});db[_0x2b18('0xf7')][_0x2b18('0x155')](db['User'],{'foreignKey':_0x2b18('0x1dd'),'as':_0x2b18('0x1e3')});db[_0x2b18('0xf7')]['belongsTo'](db[_0x2b18('0x5a')],{'foreignKey':_0x2b18('0x1e6'),'as':_0x2b18('0x1de')});db['FaxTransferReport'][_0x2b18('0x155')](db[_0x2b18('0x53')],{'foreignKey':_0x2b18('0x1e7'),'as':_0x2b18('0x1e0')});db['OpenchannelTransferReport']['belongsTo'](db[_0x2b18('0x18b')],{});db[_0x2b18('0xf9')]['belongsTo'](db[_0x2b18('0x68')],{});db['OpenchannelTransferReport']['belongsTo'](db[_0x2b18('0x65')],{'foreignKey':_0x2b18('0x1e8'),'as':'FromAccount'});db[_0x2b18('0xf9')]['belongsTo'](db[_0x2b18('0x12')],{'foreignKey':'FromUserId','as':_0x2b18('0x1e2')});db[_0x2b18('0xf9')][_0x2b18('0x155')](db[_0x2b18('0x12')],{'foreignKey':_0x2b18('0x1dd'),'as':_0x2b18('0x1e3')});db['OpenchannelTransferReport']['belongsTo'](db['OpenchannelQueue'],{'foreignKey':_0x2b18('0x1e9'),'as':_0x2b18('0x1de')});db[_0x2b18('0xf9')][_0x2b18('0x155')](db[_0x2b18('0x65')],{'foreignKey':_0x2b18('0x1ea'),'as':_0x2b18('0x1e0')});db['SmsTransferReport'][_0x2b18('0x155')](db[_0x2b18('0x61')],{});db['SmsTransferReport'][_0x2b18('0x155')](db['SmsInteraction'],{});db[_0x2b18('0x1eb')][_0x2b18('0x155')](db[_0x2b18('0x5d')],{'foreignKey':_0x2b18('0x1ec'),'as':_0x2b18('0x1db')});db['SmsTransferReport']['belongsTo'](db[_0x2b18('0x12')],{'foreignKey':_0x2b18('0x1dc'),'as':_0x2b18('0x1e2')});db[_0x2b18('0x1eb')][_0x2b18('0x155')](db[_0x2b18('0x12')],{'foreignKey':_0x2b18('0x1dd'),'as':'ToAgent'});db[_0x2b18('0x1eb')][_0x2b18('0x155')](db['SmsQueue'],{'foreignKey':_0x2b18('0x1ed'),'as':'ToQueue'});db[_0x2b18('0x1eb')][_0x2b18('0x155')](db[_0x2b18('0x5d')],{'foreignKey':_0x2b18('0x1ee'),'as':_0x2b18('0x1e0')});db['CmList'][_0x2b18('0x117')](db[_0x2b18('0x8b')],{'as':_0x2b18('0x17c'),'foreignKey':_0x2b18('0x16a')});db[_0x2b18('0xfa')][_0x2b18('0x117')](db[_0x2b18('0x83')],{'as':_0x2b18('0x1ef'),'foreignKey':'ListId'});db['CmList'][_0x2b18('0x117')](db['CmContact'],{'as':_0x2b18('0x129'),'onDelete':_0x2b18('0x11b'),'foreignKey':_0x2b18('0x16a')});db[_0x2b18('0xfa')][_0x2b18('0x117')](db[_0x2b18('0x7e')],{'as':_0x2b18('0x11c'),'foreignKey':_0x2b18('0x16a')});db[_0x2b18('0xfa')][_0x2b18('0x117')](db['CmHopperHistory'],{'as':_0x2b18('0x11e'),'foreignKey':_0x2b18('0x16a')});db[_0x2b18('0xfa')][_0x2b18('0x117')](db[_0x2b18('0x81')],{'as':_0x2b18('0x81'),'foreignKey':'ListId'});db[_0x2b18('0xfa')][_0x2b18('0x127')](db[_0x2b18('0x1c')],{'as':_0x2b18('0x1f0'),'through':'voice_queues_has_cm_lists'});db[_0x2b18('0xfa')]['belongsToMany'](db[_0x2b18('0x12')],{'as':'Agents','through':'cm_user_has_lists'});db[_0x2b18('0xfc')][_0x2b18('0x117')](db['VoiceExtension'],{'as':'Extensions','onDelete':'cascade'});db[_0x2b18('0xfc')][_0x2b18('0x127')](db[_0x2b18('0x12')],{'as':_0x2b18('0x159'),'through':_0x2b18('0x1f1')});db[_0x2b18('0xfe')][_0x2b18('0x117')](db[_0x2b18('0x12')],{'as':_0x2b18('0x174'),'foreignKey':_0x2b18('0x1f2')});db[_0x2b18('0xfe')][_0x2b18('0x117')](db[_0x2b18('0x100')],{'as':'UserProfileSections','foreignKey':'userProfileId','onDelete':_0x2b18('0x11b')});db[_0x2b18('0x100')]['hasMany'](db[_0x2b18('0x102')],{'as':'Resources','foreignKey':_0x2b18('0x1f3'),'onDelete':'cascade'});db[_0x2b18('0x105')][_0x2b18('0x117')](db['Disposition'],{'as':_0x2b18('0x17c'),'foreignKey':_0x2b18('0x1f4')});db[_0x2b18('0x105')][_0x2b18('0x117')](db['CannedAnswer'],{'as':'Answers','foreignKey':_0x2b18('0x1f4')});db[_0x2b18('0x105')][_0x2b18('0x117')](db['WhatsappMessage'],{'as':_0x2b18('0x15e'),'foreignKey':_0x2b18('0x1f4')});db['WhatsappAccount']['hasMany'](db[_0x2b18('0x109')],{'as':_0x2b18('0x168')});db['WhatsappAccount']['hasMany'](db['WhatsappApplication'],{'as':_0x2b18('0x14a')});db[_0x2b18('0x105')][_0x2b18('0x155')](db[_0x2b18('0xfa')],{'as':'List','foreignKey':'ListId'});db[_0x2b18('0x105')]['belongsTo'](db[_0x2b18('0x90')],{'as':_0x2b18('0x18c'),'foreignKey':'mandatoryDispositionPauseId'});db['WhatsappAccount']['belongsToMany'](db[_0x2b18('0x12')],{'as':_0x2b18('0x159'),'through':'user_has_whatsapp_accounts'});db[_0x2b18('0x107')]['belongsTo'](db[_0x2b18('0x12')],{'onDelete':_0x2b18('0x177')});db['WhatsappApplication'][_0x2b18('0x155')](db[_0x2b18('0x110')],{'onDelete':_0x2b18('0x177')});db['WhatsappApplication'][_0x2b18('0x155')](db['WhatsappAccount'],{'onDelete':_0x2b18('0x177')});db[_0x2b18('0x107')]['belongsTo'](db[_0x2b18('0x158')],{'onDelete':_0x2b18('0x177'),'foreignKey':_0x2b18('0x18e')});db[_0x2b18('0x107')][_0x2b18('0x155')](db[_0x2b18('0x178')],{'onDelete':'restrict','foreignKey':_0x2b18('0x179')});db[_0x2b18('0x109')][_0x2b18('0x117')](db[_0x2b18('0x10a')],{'as':'Messages','onDelete':'cascade','foreignKey':_0x2b18('0x1f5')});db[_0x2b18('0x109')][_0x2b18('0x155')](db[_0x2b18('0x105')],{'as':_0x2b18('0x16f'),'foreignKey':'WhatsappAccountId'});db[_0x2b18('0x109')][_0x2b18('0x155')](db['CmContact'],{'as':'Contact','foreignKey':'ContactId'});db['WhatsappInteraction']['belongsTo'](db[_0x2b18('0x12')],{'as':_0x2b18('0x170'),'foreignKey':_0x2b18('0x116')});db[_0x2b18('0x109')][_0x2b18('0x127')](db[_0x2b18('0x178')],{'through':_0x2b18('0x1b0'),'as':'Tags'});db[_0x2b18('0x109')][_0x2b18('0x127')](db['Tag'],{'through':_0x2b18('0x1b0'),'as':'ThroughTags'});db['WhatsappInteraction']['belongsToMany'](db['User'],{'as':_0x2b18('0x174'),'through':'user_has_whatsapp_interactions','foreignKey':_0x2b18('0x1f5')});db['WhatsappMessage'][_0x2b18('0x155')](db[_0x2b18('0x12')],{'as':_0x2b18('0x12')});db[_0x2b18('0x10a')][_0x2b18('0x155')](db[_0x2b18('0x7a')],{'onDelete':_0x2b18('0x11b'),'as':_0x2b18('0x164')});db['WhatsappMessage'][_0x2b18('0x155')](db['WhatsappInteraction'],{'onDelete':_0x2b18('0x11b'),'as':'Interaction','foreignKey':'WhatsappInteractionId'});db[_0x2b18('0x10a')][_0x2b18('0x155')](db[_0x2b18('0x105')],{'as':'Account','foreignKey':_0x2b18('0x1f4')});db[_0x2b18('0x10c')][_0x2b18('0x155')](db[_0x2b18('0x105')],{});db[_0x2b18('0x10c')][_0x2b18('0x155')](db['CmList'],{'as':_0x2b18('0x169'),'foreignKey':_0x2b18('0x16a')});db['WhatsappQueueReport'][_0x2b18('0x155')](db['CmContact'],{'as':_0x2b18('0x164'),'foreignKey':'ContactId'});db[_0x2b18('0x10c')][_0x2b18('0x155')](db['WhatsappInteraction'],{});db[_0x2b18('0x10c')]['belongsTo'](db[_0x2b18('0x110')],{});db[_0x2b18('0x10c')][_0x2b18('0x155')](db[_0x2b18('0x10a')],{});db[_0x2b18('0x10c')][_0x2b18('0x155')](db[_0x2b18('0x12')],{});db[_0x2b18('0x10e')][_0x2b18('0x155')](db[_0x2b18('0x10a')],{});db['WhatsappTransferReport'][_0x2b18('0x155')](db[_0x2b18('0x109')],{});db[_0x2b18('0x10e')][_0x2b18('0x155')](db[_0x2b18('0x105')],{'foreignKey':_0x2b18('0x1f6'),'as':_0x2b18('0x1db')});db[_0x2b18('0x10e')][_0x2b18('0x155')](db['WhatsappAccount'],{'foreignKey':'ToWhatsappAccountId','as':_0x2b18('0x1e0')});db[_0x2b18('0x10e')][_0x2b18('0x155')](db['WhatsappQueue'],{'foreignKey':_0x2b18('0x1f7'),'as':'ToQueue'});db[_0x2b18('0x10e')][_0x2b18('0x155')](db[_0x2b18('0x12')],{'foreignKey':_0x2b18('0x1dc'),'as':_0x2b18('0x1e2')});db[_0x2b18('0x10e')][_0x2b18('0x155')](db[_0x2b18('0x12')],{'foreignKey':_0x2b18('0x1dd'),'as':_0x2b18('0x1e3')});db['WhatsappQueue'][_0x2b18('0x127')](db[_0x2b18('0x12')],{'as':'Agents','through':_0x2b18('0x1f8'),'foreignKey':_0x2b18('0x1f9')});db[_0x2b18('0x110')][_0x2b18('0x127')](db[_0x2b18('0x12d')],{'through':'team_has_whatsapp_queues','as':'Teams'});module[_0x2b18('0x1fa')]={'db':db,'dbH':dbH};
\ No newline at end of file
+var _0xb234=['SalesforceConfiguration','SalesforceField','../api/intSugarcrmAccount/intSugarcrmAccount.model','../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model','SugarcrmField','DeskAccount','../api/intDeskAccount/intDeskAccount.model','../api/intDeskConfiguration/intDeskConfiguration.model','../api/intDeskField/intDeskField.model','ZohoAccount','../api/intZohoAccount/intZohoAccount.model','ZohoConfiguration','../api/intZohoConfiguration/intZohoConfiguration.model','../api/intZohoField/intZohoField.model','ZendeskAccount','../api/intZendeskAccount/intZendeskAccount.model','ZendeskConfiguration','ZendeskField','../api/intZendeskField/intZendeskField.model','FreshdeskField','../api/intFreshdeskField/intFreshdeskField.model','../api/intVtigerAccount/intVtigerAccount.model','VtigerConfiguration','VtigerField','../api/intVtigerField/intVtigerField.model','ServicenowAccount','../api/intServicenowAccount/intServicenowAccount.model','../api/intServicenowConfiguration/intServicenowConfiguration.model','ServicenowField','../api/intServicenowField/intServicenowField.model','../api/intDynamics365Account/intDynamics365Account.model','Dynamics365Configuration','Dynamics365Field','../api/intDynamics365Field/intDynamics365Field.model','FreshsalesAccount','FreshsalesConfiguration','../api/intFreshsalesConfiguration/intFreshsalesConfiguration.model','FreshsalesField','Network','ChatQueueReport','../api/chatQueueReport/chatQueueReport.model','ChatInternalMessage','JscriptyAnswerReport','../api/jscriptyAnswerReport/jscriptyAnswerReport.model','../api/jscriptyQuestionReport/jscriptyQuestionReport.model','../api/smsQueueReport/smsQueueReport.model','SquareDetailsReport','JscriptyProject','SquareOdbc','SquareProject','../api/squareProject/squareProject.model','SquareRecording','SquareMessage','../api/squareMessage/squareMessage.model','Team','../api/team/team.model','License','../api/license/license.model','Migration','../api/migration/migration.model','Attachment','../api/plugin/plugin.model','ChatTransferReport','../api/chatTransferReport/chatTransferReport.model','FaxTransferReport','OpenchannelTransferReport','../api/openchannelTransferReport/openchannelTransferReport.model','SmsTransferReport','../api/smsTransferReport/smsTransferReport.model','CmList','../api/cmList/cmList.model','../api/voicePrefix/voicePrefix.model','UserProfile','../api/userProfile/userProfile.model','UserProfileResource','../api/userProfileResource/userProfileResource.model','../api/notification/notification.model','WhatsappApplication','WhatsappInteraction','../api/whatsappInteraction/whatsappInteraction.model','WhatsappMessage','../api/whatsappMessage/whatsappMessage.model','WhatsappQueueReport','../api/whatsappQueueReport/whatsappQueueReport.model','../api/whatsappTransferReport/whatsappTransferReport.model','WhatsappQueue','CloudProvider','hasOne','VoiceMail','cascade','Recordings','UserId','hasMany','Extensions','HopperFinals','HopperHistory','OpenchannelInteractions','ChatInteractions','SmsInteractions','FaxInteractions','MailInteractions','Notification','Notifications','belongsTo','belongsToMany','Groups','chat_group_has_users','CmContact','cm_user_has_contacts','Lists','cm_user_has_lists','user_has_teams','user_has_mail_interactions','user_has_chat_interactions','user_has_fax_interactions','user_has_openchannel_interactions','WhatsappInteractions','user_has_whatsapp_interactions','VoiceQueues','UserVoiceQueue','MailQueues','FaxQueues','UserFaxQueue','SmsQueues','OpenchannelQueues','UserOpenchannelQueue','WhatsappQueues','VoicePrefix','ChatWebsite','user_has_chat_websites','MailAccounts','user_has_mail_accounts','OpenchannelAccounts','user_has_openchannel_accounts','SmsAccounts','user_has_sms_accounts','SquareProjects','user_has_square_projects','SpiedAgents','ChanSpyId','Applications','Sound','Sounds','Members','VoiceQueueId','Hoppers','JscriptySessionReport','JscriptySessions','TrunkId','TrunkBackupId','mandatoryDispositionPauseId','voice_queues_has_cm_lists','Agents','Teams','BlackLists','Messages','mailboxuser','mailbox','QueueCalls','uniqueid','AgentReports','Contact','MailAccountId','MailServerOut','Imap','Smtp','Dispositions','Answers','MailMessage','Interactions','List','TemplateId','Pause','mandatoryDispositionPause','ContactId','Owner','mail_interaction_has_tags','ThroughTags','MailInteractionId','Attachments','restrict','IntervalId','TagId','ListId','Items','FaxAccountId','Exntensions','user_has_fax_accounts','FaxInteractionId','Account','Tags','fax_interaction_has_tags','Interaction','AttachmentId','team_has_fax_queues','SmsAccountId','SmsInteractionId','sms_interaction_has_tags','Users','user_has_sms_interactions','SmsQueueId','team_has_sms_queues','OpenchannelAccountId','OpenchannelInteractionId','openchannel_interaction_has_tags','OpenchannelQueueId','team_has_openchannel_queues','ChatWebsiteId','ProactiveActions','ChatInteraction','OpenchannelQueueReport','Agent','ChatQueueId','Website','ChatInteractionId','chat_interaction_has_tags','team_has_chat_queues','ChatGroupId','CmCompany','Contacts','CompanyId','HopperHistories','Company','cm_contact_has_tags','Campaign','CampaignId','OwnerId','Queue','AutomationAllId','Any','OneAny','AutomationAnyId','Action','Intervals','MailApplications','ChatApplications','FaxApplications','SmsApplications','Schedule','DefaultReportId','CustomReportId','Mohs','moh_has_sounds','whatsapp_interaction_has_tags','Trigger','AllCondition','TriggerAllId','AnyCondition','TriggerAnyId','Actions','TriggerId','Fields','MetricId','Configurations','AccountId','Subjects','SubjectId','Descriptions','DescriptionId','FieldId','Subject','Description','Field','VariableId','SugarcrmAccount','SugarcrmConfiguration','DeskConfiguration','DeskField','int_desk_configuration_has_tags','ZohoField','FreshdeskAccount','FreshdeskConfiguration','VtigerAccount','ServicenowConfiguration','Dynamics365Account','ToId','JscriptyQuestionReport','SessionId','SmsQueueReport','ProjectId','team_has_voice_queues','team_has_mail_queues','team_has_whatsapp_queues','TrunkBackup','campaigns_has_cm_blacklists','MailTransferReport','FromMailAccountId','FromAccount','FromUserId','FromAgent','ToMailQueueId','ToQueue','ToMailAccountId','FromChatWebsiteId','ToUserId','FromFaxAccountId','ToFaxQueueId','ToOpenchannelQueueId','ToAccount','FromSmsAccountId','ToSmsQueueId','ToSmsAccountId','CustomFields','Queues','user_has_voice_prefixes','userProfileId','UserProfileSection','UserProfileSections','Resources','sectionId','WhatsappAccount','WhatsappAccountId','WhatsappInteractionId','WhatsappTransferReport','FromWhatsappAccountId','ToWhatsappAccountId','ToQueueId','ToAgent','WhatsappQueueId','path','../config/environment','lodash','jstz','determine','sequelize','motion2','xcall','127.0.0.1','utf8mb4','utf8_general_ci','sequelizeHistory','xC@LL1234','mysql','name','utf8','username','password','options','database','User','../api/user/user.model','VoiceChanSpy','import','../api/voiceChanSpy/voiceChanSpy.model','VoiceContext','../api/voiceContext/voiceContext.model','VoiceExtension','../api/voiceExtension/voiceExtension.model','VoiceMusicOnHold','VoiceQueue','../api/voiceQueue/voiceQueue.model','VoiceRecording','../api/voiceRecording/voiceRecording.model','ScreenRecording','../api/screenRecording/screenRecording.model','VoiceMailMessage','VoiceCallReport','../api/voiceCallReport/voiceCallReport.model','../api/voiceDialReport/voiceDialReport.model','VoiceAgentReport','../api/voiceAgentReport/voiceAgentReport.model','VoiceQueueReport','../api/voiceQueueReport/voiceQueueReport.model','../api/memberReport/memberReport.model','Trunk','../api/trunk/trunk.model','../api/voiceTransferReport/voiceTransferReport.model','UserVoiceQueueRt','../api/userVoiceQueueRt/userVoiceQueueRt.model','UserChatQueue','../api/userChatQueue/userChatQueue.model','UserMailQueue','../api/userFaxQueue/userFaxQueue.model','UserSmsQueue','../api/userSmsQueue/userSmsQueue.model','../api/userOpenchannelQueue/userOpenchannelQueue.model','UserWhatsappQueue','../api/userWhatsappQueue/userWhatsappQueue.model','MailServerIn','../api/mailServerIn/mailServerIn.model','../api/mailServerOut/mailServerOut.model','MailAccount','../api/mailAccount/mailAccount.model','MailQueue','../api/mailQueue/mailQueue.model','../api/mailSubstatus/mailSubstatus.model','MailInteraction','../api/mailInteraction/mailInteraction.model','../api/mailMessage/mailMessage.model','MailApplication','../api/mailApplication/mailApplication.model','MailQueueReport','../api/mailQueueReport/mailQueueReport.model','Dashboard','../api/dashboard/dashboard.model','DashboardItem','FaxAccount','../api/faxAccount/faxAccount.model','FaxApplication','FaxInteraction','FaxMessage','../api/faxMessage/faxMessage.model','FaxQueue','FaxQueueReport','../api/faxQueueReport/faxQueueReport.model','SmsAccount','../api/smsAccount/smsAccount.model','SmsApplication','../api/smsApplication/smsApplication.model','SmsInteraction','../api/smsInteraction/smsInteraction.model','SmsMessage','../api/smsMessage/smsMessage.model','SmsQueue','OpenchannelAccount','../api/openchannelAccount/openchannelAccount.model','OpenchannelApplication','../api/openchannelApplication/openchannelApplication.model','OpenchannelInteraction','../api/openchannelInteraction/openchannelInteraction.model','OpenchannelMessage','../api/openchannelMessage/openchannelMessage.model','OpenchannelQueue','../api/chatWebsite/chatWebsite.model','../api/openchannelQueueReport/openchannelQueueReport.model','ChatApplication','../api/chatApplication/chatApplication.model','../api/chatInteraction/chatInteraction.model','ChatMessage','../api/chatMessage/chatMessage.model','ChatOfflineMessage','ChatQueue','../api/chatQueue/chatQueue.model','ChatGroup','ChatProactiveAction','../api/chatProactiveAction/chatProactiveAction.model','../api/cmCompany/cmCompany.model','CmHopper','../api/cmHopper/cmHopper.model','CmHopperBlack','../api/cmHopperBlack/cmHopperBlack.model','CmHopperFinal','CmHopperHistory','../api/cmHopperHistory/cmHopperHistory.model','ReportAgentPreview','../api/reportAgentPreview/reportAgentPreview.model','CmCustomField','../api/cmCustomField/cmCustomField.model','Automation','../api/automation/automation.model','CannedAnswer','../api/cannedAnswer/cannedAnswer.model','Disposition','../api/disposition/disposition.model','Condition','Interval','../api/interval/interval.model','../api/cdr/cdr.model','VoiceQueuesLog','../api/voiceQueuesLog/voiceQueuesLog.model','../api/sound/sound.model','Tag','Template','../api/template/template.model','Variable','../api/variable/variable.model','Integration','../api/integration/integration.model','IntegrationReport','../api/integrationReport/integrationReport.model','AnalyticCustomReport','../api/analyticCustomReport/analyticCustomReport.model','AnalyticDefaultReport','../api/analyticDefaultReport/analyticDefaultReport.model','AnalyticExtractedReport','../api/analyticExtractedReport/analyticExtractedReport.model','AnalyticMetric','../api/analyticMetric/analyticMetric.model','AnalyticFieldReport','../api/analyticFieldReport/analyticFieldReport.model','AnalyticTreeReport','../api/analyticTreeReport/analyticTreeReport.model','SalesforceAccount','../api/intSalesforceAccount/intSalesforceAccount.model'];(function(_0x47fae1,_0x45b329){var _0x5625b9=function(_0x538779){while(--_0x538779){_0x47fae1['push'](_0x47fae1['shift']());}};_0x5625b9(++_0x45b329);}(_0xb234,0x13f));var _0x4b23=function(_0x56204f,_0x3a16ab){_0x56204f=_0x56204f-0x0;var _0x40307f=_0xb234[_0x56204f];return _0x40307f;};'use strict';var path=require(_0x4b23('0x0'));var config=require(_0x4b23('0x1'));var Sequelize=require('sequelize');var _=require(_0x4b23('0x2'));var jstz=require(_0x4b23('0x3'));var timezone=jstz[_0x4b23('0x4')]();config[_0x4b23('0x5')]=_['defaultsDeep'](config['sequelize'],{'database':_0x4b23('0x6'),'username':_0x4b23('0x7'),'password':'xC@LL1234','options':{'host':_0x4b23('0x8'),'port':0xcea,'dialect':'mysql','dialectOptions':{'charset':_0x4b23('0x9')},'logging':![],'timezone':timezone['name'](),'define':{'charset':'utf8','collate':_0x4b23('0xa')}}});config[_0x4b23('0xb')]=_['defaultsDeep'](config[_0x4b23('0xb')],{'database':_0x4b23('0x6'),'username':'xcall','password':_0x4b23('0xc'),'options':{'host':'127.0.0.1','port':0xcea,'dialect':_0x4b23('0xd'),'dialectOptions':{'charset':_0x4b23('0x9')},'logging':![],'timezone':timezone[_0x4b23('0xe')](),'define':{'charset':_0x4b23('0xf'),'collate':'utf8_general_ci'}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config['sequelize']['database'],config[_0x4b23('0x5')][_0x4b23('0x10')],config[_0x4b23('0x5')][_0x4b23('0x11')],config[_0x4b23('0x5')][_0x4b23('0x12')])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0x4b23('0xb')][_0x4b23('0x13')],config[_0x4b23('0xb')][_0x4b23('0x10')],config['sequelizeHistory'][_0x4b23('0x11')],config[_0x4b23('0xb')][_0x4b23('0x12')])};db[_0x4b23('0x14')]=db[_0x4b23('0x5')]['import'](_0x4b23('0x15'));db[_0x4b23('0x16')]=db[_0x4b23('0x5')][_0x4b23('0x17')](_0x4b23('0x18'));db[_0x4b23('0x19')]=db['sequelize'][_0x4b23('0x17')](_0x4b23('0x1a'));db[_0x4b23('0x1b')]=db[_0x4b23('0x5')][_0x4b23('0x17')](_0x4b23('0x1c'));db[_0x4b23('0x1d')]=db[_0x4b23('0x5')]['import']('../api/voiceMusicOnHold/voiceMusicOnHold.model');db[_0x4b23('0x1e')]=db[_0x4b23('0x5')][_0x4b23('0x17')](_0x4b23('0x1f'));db[_0x4b23('0x20')]=db[_0x4b23('0x5')][_0x4b23('0x17')](_0x4b23('0x21'));db[_0x4b23('0x22')]=db[_0x4b23('0x5')]['import'](_0x4b23('0x23'));db['VoiceMail']=db[_0x4b23('0x5')][_0x4b23('0x17')]('../api/voiceMail/voiceMail.model');db[_0x4b23('0x24')]=db[_0x4b23('0x5')]['import']('../api/voiceMailMessage/voiceMailMessage.model');db[_0x4b23('0x25')]=db[_0x4b23('0x5')][_0x4b23('0x17')](_0x4b23('0x26'));db['VoiceDialReport']=db[_0x4b23('0x5')][_0x4b23('0x17')](_0x4b23('0x27'));db[_0x4b23('0x28')]=db['sequelize'][_0x4b23('0x17')](_0x4b23('0x29'));db[_0x4b23('0x2a')]=db['sequelize'][_0x4b23('0x17')](_0x4b23('0x2b'));db['MemberReport']=db[_0x4b23('0x5')]['import'](_0x4b23('0x2c'));db[_0x4b23('0x2d')]=db[_0x4b23('0x5')][_0x4b23('0x17')](_0x4b23('0x2e'));db['VoiceTransferReport']=db[_0x4b23('0x5')][_0x4b23('0x17')](_0x4b23('0x2f'));db[_0x4b23('0x30')]=db['sequelize'][_0x4b23('0x17')](_0x4b23('0x31'));db['UserVoiceQueue']=db['sequelize'][_0x4b23('0x17')]('../api/userVoiceQueue/userVoiceQueue.model');db[_0x4b23('0x32')]=db['sequelize'][_0x4b23('0x17')](_0x4b23('0x33'));db[_0x4b23('0x34')]=db[_0x4b23('0x5')][_0x4b23('0x17')]('../api/userMailQueue/userMailQueue.model');db['UserFaxQueue']=db[_0x4b23('0x5')][_0x4b23('0x17')](_0x4b23('0x35'));db[_0x4b23('0x36')]=db[_0x4b23('0x5')]['import'](_0x4b23('0x37'));db['UserOpenchannelQueue']=db[_0x4b23('0x5')][_0x4b23('0x17')](_0x4b23('0x38'));db[_0x4b23('0x39')]=db[_0x4b23('0x5')][_0x4b23('0x17')](_0x4b23('0x3a'));db[_0x4b23('0x3b')]=db[_0x4b23('0x5')][_0x4b23('0x17')](_0x4b23('0x3c'));db['MailServerOut']=db[_0x4b23('0x5')][_0x4b23('0x17')](_0x4b23('0x3d'));db[_0x4b23('0x3e')]=db[_0x4b23('0x5')]['import'](_0x4b23('0x3f'));db[_0x4b23('0x40')]=db[_0x4b23('0x5')][_0x4b23('0x17')](_0x4b23('0x41'));db['MailSubstatus']=db[_0x4b23('0x5')]['import'](_0x4b23('0x42'));db[_0x4b23('0x43')]=db['sequelize'][_0x4b23('0x17')](_0x4b23('0x44'));db['MailMessage']=db[_0x4b23('0x5')][_0x4b23('0x17')](_0x4b23('0x45'));db[_0x4b23('0x46')]=db['sequelize'][_0x4b23('0x17')](_0x4b23('0x47'));db[_0x4b23('0x48')]=db[_0x4b23('0x5')][_0x4b23('0x17')](_0x4b23('0x49'));db[_0x4b23('0x4a')]=db[_0x4b23('0x5')][_0x4b23('0x17')](_0x4b23('0x4b'));db[_0x4b23('0x4c')]=db[_0x4b23('0x5')]['import']('../api/dashboardItem/dashboardItem.model');db[_0x4b23('0x4d')]=db[_0x4b23('0x5')][_0x4b23('0x17')](_0x4b23('0x4e'));db[_0x4b23('0x4f')]=db[_0x4b23('0x5')][_0x4b23('0x17')]('../api/faxApplication/faxApplication.model');db[_0x4b23('0x50')]=db[_0x4b23('0x5')][_0x4b23('0x17')]('../api/faxInteraction/faxInteraction.model');db[_0x4b23('0x51')]=db['sequelize'][_0x4b23('0x17')](_0x4b23('0x52'));db[_0x4b23('0x53')]=db['sequelize']['import']('../api/faxQueue/faxQueue.model');db[_0x4b23('0x54')]=db['sequelize']['import'](_0x4b23('0x55'));db[_0x4b23('0x56')]=db[_0x4b23('0x5')]['import'](_0x4b23('0x57'));db[_0x4b23('0x58')]=db['sequelize'][_0x4b23('0x17')](_0x4b23('0x59'));db[_0x4b23('0x5a')]=db[_0x4b23('0x5')][_0x4b23('0x17')](_0x4b23('0x5b'));db[_0x4b23('0x5c')]=db['sequelize'][_0x4b23('0x17')](_0x4b23('0x5d'));db[_0x4b23('0x5e')]=db[_0x4b23('0x5')][_0x4b23('0x17')]('../api/smsQueue/smsQueue.model');db[_0x4b23('0x5f')]=db[_0x4b23('0x5')][_0x4b23('0x17')](_0x4b23('0x60'));db[_0x4b23('0x61')]=db['sequelize'][_0x4b23('0x17')](_0x4b23('0x62'));db[_0x4b23('0x63')]=db[_0x4b23('0x5')]['import'](_0x4b23('0x64'));db[_0x4b23('0x65')]=db['sequelize']['import'](_0x4b23('0x66'));db[_0x4b23('0x67')]=db[_0x4b23('0x5')][_0x4b23('0x17')]('../api/openchannelQueue/openchannelQueue.model');db['ChatWebsite']=db[_0x4b23('0x5')]['import'](_0x4b23('0x68'));db['OpenchannelQueueReport']=db[_0x4b23('0x5')][_0x4b23('0x17')](_0x4b23('0x69'));db[_0x4b23('0x6a')]=db[_0x4b23('0x5')][_0x4b23('0x17')](_0x4b23('0x6b'));db['ChatInteraction']=db[_0x4b23('0x5')][_0x4b23('0x17')](_0x4b23('0x6c'));db[_0x4b23('0x6d')]=db['sequelize']['import'](_0x4b23('0x6e'));db[_0x4b23('0x6f')]=db[_0x4b23('0x5')]['import']('../api/chatOfflineMessage/chatOfflineMessage.model');db[_0x4b23('0x70')]=db[_0x4b23('0x5')]['import'](_0x4b23('0x71'));db[_0x4b23('0x72')]=db['sequelize'][_0x4b23('0x17')]('../api/chatGroup/chatGroup.model');db[_0x4b23('0x73')]=db[_0x4b23('0x5')][_0x4b23('0x17')](_0x4b23('0x74'));db['CmCompany']=db[_0x4b23('0x5')]['import'](_0x4b23('0x75'));db['CmContact']=db['sequelize'][_0x4b23('0x17')]('../api/cmContact/cmContact.model');db[_0x4b23('0x76')]=db[_0x4b23('0x5')][_0x4b23('0x17')](_0x4b23('0x77'));db[_0x4b23('0x78')]=db[_0x4b23('0x5')]['import'](_0x4b23('0x79'));db[_0x4b23('0x7a')]=db[_0x4b23('0x5')][_0x4b23('0x17')]('../api/cmHopperFinal/cmHopperFinal.model');db[_0x4b23('0x7b')]=db[_0x4b23('0x5')][_0x4b23('0x17')](_0x4b23('0x7c'));db[_0x4b23('0x7d')]=db[_0x4b23('0x5')]['import'](_0x4b23('0x7e'));db[_0x4b23('0x7f')]=db[_0x4b23('0x5')][_0x4b23('0x17')](_0x4b23('0x80'));db['Action']=db[_0x4b23('0x5')][_0x4b23('0x17')]('../api/action/action.model');db[_0x4b23('0x81')]=db[_0x4b23('0x5')][_0x4b23('0x17')](_0x4b23('0x82'));db[_0x4b23('0x83')]=db[_0x4b23('0x5')][_0x4b23('0x17')](_0x4b23('0x84'));db[_0x4b23('0x85')]=db[_0x4b23('0x5')][_0x4b23('0x17')](_0x4b23('0x86'));db[_0x4b23('0x87')]=db[_0x4b23('0x5')][_0x4b23('0x17')]('../api/condition/condition.model');db[_0x4b23('0x88')]=db[_0x4b23('0x5')][_0x4b23('0x17')](_0x4b23('0x89'));db['Pause']=db['sequelize'][_0x4b23('0x17')]('../api/pause/pause.model');db['Cdr']=db[_0x4b23('0x5')][_0x4b23('0x17')](_0x4b23('0x8a'));db[_0x4b23('0x8b')]=db['sequelize'][_0x4b23('0x17')](_0x4b23('0x8c'));db['Schedule']=db['sequelize'][_0x4b23('0x17')]('../api/schedule/schedule.model');db['Sound']=db[_0x4b23('0x5')][_0x4b23('0x17')](_0x4b23('0x8d'));db[_0x4b23('0x8e')]=db[_0x4b23('0x5')][_0x4b23('0x17')]('../api/tag/tag.model');db[_0x4b23('0x8f')]=db[_0x4b23('0x5')][_0x4b23('0x17')](_0x4b23('0x90'));db['Trigger']=db[_0x4b23('0x5')][_0x4b23('0x17')]('../api/trigger/trigger.model');db[_0x4b23('0x91')]=db[_0x4b23('0x5')]['import'](_0x4b23('0x92'));db[_0x4b23('0x93')]=db[_0x4b23('0x5')][_0x4b23('0x17')](_0x4b23('0x94'));db[_0x4b23('0x95')]=db[_0x4b23('0x5')][_0x4b23('0x17')](_0x4b23('0x96'));db[_0x4b23('0x97')]=db[_0x4b23('0x5')][_0x4b23('0x17')](_0x4b23('0x98'));db[_0x4b23('0x99')]=db[_0x4b23('0x5')]['import'](_0x4b23('0x9a'));db[_0x4b23('0x9b')]=db[_0x4b23('0x5')][_0x4b23('0x17')](_0x4b23('0x9c'));db[_0x4b23('0x9d')]=db[_0x4b23('0x5')]['import'](_0x4b23('0x9e'));db[_0x4b23('0x9f')]=db['sequelize'][_0x4b23('0x17')](_0x4b23('0xa0'));db[_0x4b23('0xa1')]=db['sequelize']['import'](_0x4b23('0xa2'));db[_0x4b23('0xa3')]=db['sequelize'][_0x4b23('0x17')](_0x4b23('0xa4'));db[_0x4b23('0xa5')]=db['sequelize'][_0x4b23('0x17')]('../api/intSalesforceConfiguration/intSalesforceConfiguration.model');db[_0x4b23('0xa6')]=db[_0x4b23('0x5')][_0x4b23('0x17')]('../api/intSalesforceField/intSalesforceField.model');db['SugarcrmAccount']=db[_0x4b23('0x5')][_0x4b23('0x17')](_0x4b23('0xa7'));db['SugarcrmConfiguration']=db[_0x4b23('0x5')][_0x4b23('0x17')](_0x4b23('0xa8'));db[_0x4b23('0xa9')]=db['sequelize'][_0x4b23('0x17')]('../api/intSugarcrmField/intSugarcrmField.model');db[_0x4b23('0xaa')]=db['sequelize'][_0x4b23('0x17')](_0x4b23('0xab'));db['DeskConfiguration']=db[_0x4b23('0x5')][_0x4b23('0x17')](_0x4b23('0xac'));db['DeskField']=db[_0x4b23('0x5')][_0x4b23('0x17')](_0x4b23('0xad'));db[_0x4b23('0xae')]=db[_0x4b23('0x5')][_0x4b23('0x17')](_0x4b23('0xaf'));db[_0x4b23('0xb0')]=db[_0x4b23('0x5')][_0x4b23('0x17')](_0x4b23('0xb1'));db['ZohoField']=db[_0x4b23('0x5')][_0x4b23('0x17')](_0x4b23('0xb2'));db[_0x4b23('0xb3')]=db[_0x4b23('0x5')][_0x4b23('0x17')](_0x4b23('0xb4'));db[_0x4b23('0xb5')]=db[_0x4b23('0x5')][_0x4b23('0x17')]('../api/intZendeskConfiguration/intZendeskConfiguration.model');db[_0x4b23('0xb6')]=db[_0x4b23('0x5')][_0x4b23('0x17')](_0x4b23('0xb7'));db['FreshdeskAccount']=db[_0x4b23('0x5')][_0x4b23('0x17')]('../api/intFreshdeskAccount/intFreshdeskAccount.model');db['FreshdeskConfiguration']=db['sequelize'][_0x4b23('0x17')]('../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model');db[_0x4b23('0xb8')]=db[_0x4b23('0x5')][_0x4b23('0x17')](_0x4b23('0xb9'));db['VtigerAccount']=db['sequelize'][_0x4b23('0x17')](_0x4b23('0xba'));db[_0x4b23('0xbb')]=db[_0x4b23('0x5')][_0x4b23('0x17')]('../api/intVtigerConfiguration/intVtigerConfiguration.model');db[_0x4b23('0xbc')]=db['sequelize']['import'](_0x4b23('0xbd'));db[_0x4b23('0xbe')]=db[_0x4b23('0x5')]['import'](_0x4b23('0xbf'));db['ServicenowConfiguration']=db['sequelize'][_0x4b23('0x17')](_0x4b23('0xc0'));db[_0x4b23('0xc1')]=db[_0x4b23('0x5')][_0x4b23('0x17')](_0x4b23('0xc2'));db['Dynamics365Account']=db[_0x4b23('0x5')][_0x4b23('0x17')](_0x4b23('0xc3'));db[_0x4b23('0xc4')]=db[_0x4b23('0x5')][_0x4b23('0x17')]('../api/intDynamics365Configuration/intDynamics365Configuration.model');db[_0x4b23('0xc5')]=db[_0x4b23('0x5')][_0x4b23('0x17')](_0x4b23('0xc6'));db[_0x4b23('0xc7')]=db['sequelize'][_0x4b23('0x17')]('../api/intFreshsalesAccount/intFreshsalesAccount.model');db[_0x4b23('0xc8')]=db[_0x4b23('0x5')][_0x4b23('0x17')](_0x4b23('0xc9'));db[_0x4b23('0xca')]=db['sequelize'][_0x4b23('0x17')]('../api/intFreshsalesField/intFreshsalesField.model');db[_0x4b23('0x93')]=db[_0x4b23('0x5')][_0x4b23('0x17')]('../api/integration/integration.model');db[_0x4b23('0xcb')]=db[_0x4b23('0x5')][_0x4b23('0x17')]('../api/network/network.model');db[_0x4b23('0xcc')]=db[_0x4b23('0x5')][_0x4b23('0x17')](_0x4b23('0xcd'));db[_0x4b23('0xce')]=db[_0x4b23('0x5')]['import']('../api/chatInternalMessage/chatInternalMessage.model');db[_0x4b23('0xcf')]=db[_0x4b23('0x5')][_0x4b23('0x17')](_0x4b23('0xd0'));db['JscriptyQuestionReport']=db[_0x4b23('0x5')][_0x4b23('0x17')](_0x4b23('0xd1'));db['JscriptySessionReport']=db[_0x4b23('0x5')]['import']('../api/jscriptySessionReport/jscriptySessionReport.model');db['SmsQueueReport']=db[_0x4b23('0x5')][_0x4b23('0x17')](_0x4b23('0xd2'));db['SquareReport']=db[_0x4b23('0x5')]['import']('../api/squareReport/squareReport.model');db[_0x4b23('0xd3')]=db['sequelize'][_0x4b23('0x17')]('../api/squareReportDetail/squareReportDetail.model');db[_0x4b23('0xd4')]=db[_0x4b23('0x5')]['import']('../api/jscriptyProject/jscriptyProject.model');db['Setting']=db[_0x4b23('0x5')]['import']('../api/setting/setting.model');db[_0x4b23('0xd5')]=db[_0x4b23('0x5')][_0x4b23('0x17')]('../api/squareOdbc/squareOdbc.model');db[_0x4b23('0xd6')]=db[_0x4b23('0x5')]['import'](_0x4b23('0xd7'));db[_0x4b23('0xd8')]=db['sequelize'][_0x4b23('0x17')]('../api/squareRecording/squareRecording.model');db[_0x4b23('0xd9')]=db[_0x4b23('0x5')][_0x4b23('0x17')](_0x4b23('0xda'));db[_0x4b23('0xdb')]=db[_0x4b23('0x5')][_0x4b23('0x17')](_0x4b23('0xdc'));db[_0x4b23('0xdd')]=db[_0x4b23('0x5')][_0x4b23('0x17')](_0x4b23('0xde'));db['Campaign']=db[_0x4b23('0x5')][_0x4b23('0x17')]('../api/campaign/campaign.model');db[_0x4b23('0xdf')]=db['sequelize'][_0x4b23('0x17')](_0x4b23('0xe0'));db[_0x4b23('0xe1')]=db[_0x4b23('0x5')][_0x4b23('0x17')]('../api/attachment/attachment.model');db['Plugin']=db['sequelize'][_0x4b23('0x17')](_0x4b23('0xe2'));db['MailTransferReport']=db[_0x4b23('0x5')][_0x4b23('0x17')]('../api/mailTransferReport/mailTransferReport.model');db[_0x4b23('0xe3')]=db[_0x4b23('0x5')][_0x4b23('0x17')](_0x4b23('0xe4'));db[_0x4b23('0xe5')]=db[_0x4b23('0x5')][_0x4b23('0x17')]('../api/faxTransferReport/faxTransferReport.model');db[_0x4b23('0xe6')]=db[_0x4b23('0x5')][_0x4b23('0x17')](_0x4b23('0xe7'));db[_0x4b23('0xe8')]=db[_0x4b23('0x5')][_0x4b23('0x17')](_0x4b23('0xe9'));db[_0x4b23('0xea')]=db[_0x4b23('0x5')]['import'](_0x4b23('0xeb'));db['VoicePrefix']=db[_0x4b23('0x5')][_0x4b23('0x17')](_0x4b23('0xec'));db[_0x4b23('0xed')]=db['sequelize'][_0x4b23('0x17')](_0x4b23('0xee'));db['UserProfileSection']=db[_0x4b23('0x5')]['import']('../api/userProfileSection/userProfileSection.model');db[_0x4b23('0xef')]=db['sequelize']['import'](_0x4b23('0xf0'));db['Notification']=db['sequelize']['import'](_0x4b23('0xf1'));db['WhatsappAccount']=db['sequelize'][_0x4b23('0x17')]('../api/whatsappAccount/whatsappAccount.model');db[_0x4b23('0xf2')]=db[_0x4b23('0x5')][_0x4b23('0x17')]('../api/whatsappApplication/whatsappApplication.model');db[_0x4b23('0xf3')]=db[_0x4b23('0x5')]['import'](_0x4b23('0xf4'));db[_0x4b23('0xf5')]=db[_0x4b23('0x5')][_0x4b23('0x17')](_0x4b23('0xf6'));db[_0x4b23('0xf7')]=db['sequelize'][_0x4b23('0x17')](_0x4b23('0xf8'));db['WhatsappTransferReport']=db['sequelize'][_0x4b23('0x17')](_0x4b23('0xf9'));db[_0x4b23('0xfa')]=db[_0x4b23('0x5')][_0x4b23('0x17')]('../api/whatsappQueue/whatsappQueue.model');db[_0x4b23('0xfb')]=db[_0x4b23('0x5')][_0x4b23('0x17')]('../api/cloudProvider/cloudProvider.model');db['User'][_0x4b23('0xfc')](db[_0x4b23('0xfd')],{'as':'VoiceMail','onDelete':_0x4b23('0xfe'),'foreignKey':'UserId'});db[_0x4b23('0x14')]['hasMany'](db['VoiceRecording'],{'as':_0x4b23('0xff'),'foreignKey':_0x4b23('0x100')});db[_0x4b23('0x14')][_0x4b23('0x101')](db['UserVoiceQueueRt'],{'as':'VoiceQueuesRt','foreignKey':_0x4b23('0x100')});db[_0x4b23('0x14')][_0x4b23('0x101')](db[_0x4b23('0x1b')],{'as':_0x4b23('0x102'),'onDelete':'cascade','hooks':!![]});db['User']['hasMany'](db['CmHopperFinal'],{'as':_0x4b23('0x103'),'foreignKey':_0x4b23('0x100')});db['User']['hasMany'](db[_0x4b23('0x7b')],{'as':_0x4b23('0x104'),'foreignKey':_0x4b23('0x100')});db['User'][_0x4b23('0x101')](db['ReportAgentPreview'],{'as':_0x4b23('0x7d'),'foreignKey':_0x4b23('0x100')});db[_0x4b23('0x14')][_0x4b23('0x101')](db[_0x4b23('0x63')],{'as':_0x4b23('0x105'),'foreignKey':_0x4b23('0x100')});db[_0x4b23('0x14')]['hasMany'](db['ChatInteraction'],{'as':_0x4b23('0x106'),'foreignKey':_0x4b23('0x100')});db[_0x4b23('0x14')][_0x4b23('0x101')](db[_0x4b23('0x5a')],{'as':_0x4b23('0x107'),'foreignKey':_0x4b23('0x100')});db[_0x4b23('0x14')]['hasMany'](db[_0x4b23('0x50')],{'as':_0x4b23('0x108'),'foreignKey':_0x4b23('0x100')});db['User']['hasMany'](db[_0x4b23('0x43')],{'as':_0x4b23('0x109'),'foreignKey':_0x4b23('0x100')});db['User']['hasMany'](db[_0x4b23('0xf3')],{'as':'WhatsappInteractions','foreignKey':_0x4b23('0x100')});db[_0x4b23('0x14')][_0x4b23('0x101')](db[_0x4b23('0x10a')],{'as':_0x4b23('0x10b'),'foreignKey':'SenderId'});db[_0x4b23('0x14')][_0x4b23('0x10c')](db[_0x4b23('0xed')],{'as':_0x4b23('0xed'),'foreignKey':'userProfileId'});db['User'][_0x4b23('0x10d')](db[_0x4b23('0x72')],{'as':_0x4b23('0x10e'),'through':_0x4b23('0x10f')});db['User'][_0x4b23('0x10d')](db[_0x4b23('0x110')],{'as':'Contacts','through':_0x4b23('0x111')});db[_0x4b23('0x14')][_0x4b23('0x10d')](db[_0x4b23('0xea')],{'as':_0x4b23('0x112'),'through':_0x4b23('0x113')});db['User'][_0x4b23('0x10d')](db[_0x4b23('0xdb')],{'through':_0x4b23('0x114')});db[_0x4b23('0x14')][_0x4b23('0x10d')](db[_0x4b23('0x43')],{'as':_0x4b23('0x109'),'through':_0x4b23('0x115')});db['User'][_0x4b23('0x10d')](db['ChatInteraction'],{'as':_0x4b23('0x106'),'through':_0x4b23('0x116')});db[_0x4b23('0x14')][_0x4b23('0x10d')](db[_0x4b23('0x50')],{'as':_0x4b23('0x108'),'through':_0x4b23('0x117')});db['User'][_0x4b23('0x10d')](db[_0x4b23('0x5a')],{'as':_0x4b23('0x107'),'through':'user_has_sms_interactions'});db['User']['belongsToMany'](db[_0x4b23('0x63')],{'as':_0x4b23('0x105'),'through':_0x4b23('0x118')});db[_0x4b23('0x14')][_0x4b23('0x10d')](db['WhatsappInteraction'],{'as':_0x4b23('0x119'),'through':_0x4b23('0x11a')});db[_0x4b23('0x14')]['belongsToMany'](db[_0x4b23('0x1e')],{'as':_0x4b23('0x11b'),'through':_0x4b23('0x11c'),'required':![]});db[_0x4b23('0x14')][_0x4b23('0x10d')](db[_0x4b23('0x40')],{'as':_0x4b23('0x11d'),'through':_0x4b23('0x34'),'required':![]});db[_0x4b23('0x14')]['belongsToMany'](db[_0x4b23('0x70')],{'as':'ChatQueues','through':_0x4b23('0x32'),'required':![],'hooks':!![]});db[_0x4b23('0x14')][_0x4b23('0x10d')](db[_0x4b23('0x53')],{'as':_0x4b23('0x11e'),'through':_0x4b23('0x11f'),'required':![]});db[_0x4b23('0x14')][_0x4b23('0x10d')](db[_0x4b23('0x5e')],{'as':_0x4b23('0x120'),'through':_0x4b23('0x36'),'required':![]});db[_0x4b23('0x14')]['belongsToMany'](db[_0x4b23('0x67')],{'as':_0x4b23('0x121'),'through':_0x4b23('0x122'),'required':![]});db[_0x4b23('0x14')][_0x4b23('0x10d')](db[_0x4b23('0xfa')],{'as':_0x4b23('0x123'),'through':_0x4b23('0x39'),'required':![]});db[_0x4b23('0x14')][_0x4b23('0x10d')](db['CmList'],{'through':'cm_user_has_lists'});db['User'][_0x4b23('0x10d')](db[_0x4b23('0x124')],{'as':'VoicePrefixes','through':'user_has_voice_prefixes','required':![]});db[_0x4b23('0x14')][_0x4b23('0x10d')](db[_0x4b23('0x125')],{'as':'ChatWebsites','through':_0x4b23('0x126')});db[_0x4b23('0x14')][_0x4b23('0x10d')](db[_0x4b23('0x4d')],{'as':'FaxAccounts','through':'user_has_fax_accounts'});db['User'][_0x4b23('0x10d')](db[_0x4b23('0x3e')],{'as':_0x4b23('0x127'),'through':_0x4b23('0x128')});db[_0x4b23('0x14')]['belongsToMany'](db[_0x4b23('0x5f')],{'as':_0x4b23('0x129'),'through':_0x4b23('0x12a')});db[_0x4b23('0x14')]['belongsToMany'](db[_0x4b23('0x56')],{'as':_0x4b23('0x12b'),'through':_0x4b23('0x12c')});db['User']['belongsToMany'](db['WhatsappAccount'],{'as':'WhatsappAccounts','through':'user_has_whatsapp_accounts'});db[_0x4b23('0x14')][_0x4b23('0x10d')](db['SquareProject'],{'as':_0x4b23('0x12d'),'through':_0x4b23('0x12e')});db['VoiceChanSpy'][_0x4b23('0x101')](db[_0x4b23('0x1b')],{'as':_0x4b23('0x12f'),'onDelete':_0x4b23('0xfe'),'foreignKey':_0x4b23('0x130')});db[_0x4b23('0x19')][_0x4b23('0x101')](db['VoiceExtension'],{'onDelete':_0x4b23('0xfe')});db[_0x4b23('0x1b')][_0x4b23('0x101')](db[_0x4b23('0x1b')],{'as':_0x4b23('0x131'),'onDelete':_0x4b23('0xfe')});db[_0x4b23('0x1d')]['belongsToMany'](db[_0x4b23('0x132')],{'as':_0x4b23('0x133'),'through':'moh_has_sounds'});db[_0x4b23('0x1e')][_0x4b23('0x101')](db[_0x4b23('0x30')],{'as':_0x4b23('0x134'),'foreignKey':_0x4b23('0x135')});db[_0x4b23('0x1e')][_0x4b23('0x101')](db['CmHopper'],{'as':_0x4b23('0x136'),'foreignKey':_0x4b23('0x135')});db[_0x4b23('0x1e')][_0x4b23('0x101')](db[_0x4b23('0x7a')],{'as':_0x4b23('0x103'),'foreignKey':'VoiceQueueId'});db['VoiceQueue'][_0x4b23('0x101')](db[_0x4b23('0x7b')],{'as':'HopperHistories','foreignKey':_0x4b23('0x135')});db[_0x4b23('0x1e')]['hasMany'](db['ReportAgentPreview'],{'as':'ReportAgentPreview','foreignKey':_0x4b23('0x135')});db[_0x4b23('0x1e')][_0x4b23('0x101')](db[_0x4b23('0x78')],{'as':'HopperBlacks','foreignKey':'VoiceQueueId'});db[_0x4b23('0x1e')][_0x4b23('0x101')](db[_0x4b23('0x137')],{'as':_0x4b23('0x138'),'foreignKey':_0x4b23('0x135')});db['VoiceQueue'][_0x4b23('0x10c')](db[_0x4b23('0x2d')],{'as':_0x4b23('0x2d'),'foreignKey':_0x4b23('0x139')});db[_0x4b23('0x1e')]['belongsTo'](db[_0x4b23('0x2d')],{'as':'TrunkBackup','foreignKey':_0x4b23('0x13a')});db[_0x4b23('0x1e')]['belongsTo'](db[_0x4b23('0x88')],{'as':'Interval','foreignKey':'IntervalId'});db[_0x4b23('0x1e')][_0x4b23('0x10c')](db['Pause'],{'as':'mandatoryDispositionPause','foreignKey':_0x4b23('0x13b')});db['VoiceQueue'][_0x4b23('0x10d')](db[_0x4b23('0xea')],{'as':_0x4b23('0x112'),'through':_0x4b23('0x13c')});db[_0x4b23('0x1e')][_0x4b23('0x10d')](db[_0x4b23('0x14')],{'as':_0x4b23('0x13d'),'through':_0x4b23('0x11c')});db['VoiceQueue'][_0x4b23('0x10d')](db[_0x4b23('0xdb')],{'as':_0x4b23('0x13e'),'through':'team_has_voice_queues'});db[_0x4b23('0x1e')][_0x4b23('0x10d')](db[_0x4b23('0xea')],{'as':_0x4b23('0x13f'),'through':'voice_queues_has_cm_blacklists'});db[_0x4b23('0x20')]['belongsTo'](db[_0x4b23('0x14')],{'as':_0x4b23('0x14'),'foreignKey':_0x4b23('0x100')});db[_0x4b23('0x22')][_0x4b23('0x10c')](db[_0x4b23('0x14')],{'as':'User','foreignKey':_0x4b23('0x100')});db[_0x4b23('0xfd')]['hasMany'](db[_0x4b23('0x24')],{'as':_0x4b23('0x140'),'onDelete':_0x4b23('0xfe'),'foreignKey':_0x4b23('0x141'),'sourceKey':_0x4b23('0x142')});db['VoiceMailMessage']['belongsTo'](db[_0x4b23('0xfd')],{'foreignKey':'mailboxuser','targetKey':'mailbox'});db[_0x4b23('0x25')]['hasMany'](db[_0x4b23('0x2a')],{'as':_0x4b23('0x143'),'foreignKey':_0x4b23('0x144'),'constraints':![]});db[_0x4b23('0x25')]['hasMany'](db[_0x4b23('0x28')],{'as':_0x4b23('0x145'),'foreignKey':_0x4b23('0x144'),'constraints':![]});db[_0x4b23('0x25')][_0x4b23('0x10c')](db[_0x4b23('0x14')],{'as':'User','foreignKey':_0x4b23('0x100')});db[_0x4b23('0x25')][_0x4b23('0x10c')](db['CmContact'],{'as':_0x4b23('0x146'),'foreignKey':'ContactId'});db['MailServerIn'][_0x4b23('0x10c')](db[_0x4b23('0x3e')],{'as':_0x4b23('0x3e'),'foreignKey':_0x4b23('0x147')});db[_0x4b23('0x148')][_0x4b23('0x10c')](db['MailAccount'],{'as':_0x4b23('0x3e'),'foreignKey':_0x4b23('0x147')});db[_0x4b23('0x3e')][_0x4b23('0xfc')](db['MailServerIn'],{'as':_0x4b23('0x149'),'onDelete':'cascade'});db['MailAccount'][_0x4b23('0xfc')](db[_0x4b23('0x148')],{'as':_0x4b23('0x14a'),'onDelete':'cascade'});db['MailAccount'][_0x4b23('0x101')](db[_0x4b23('0x85')],{'as':_0x4b23('0x14b'),'foreignKey':_0x4b23('0x147')});db[_0x4b23('0x3e')][_0x4b23('0x101')](db[_0x4b23('0x83')],{'as':_0x4b23('0x14c'),'foreignKey':_0x4b23('0x147')});db[_0x4b23('0x3e')]['hasMany'](db[_0x4b23('0x14d')],{'as':_0x4b23('0x140'),'foreignKey':_0x4b23('0x147')});db[_0x4b23('0x3e')][_0x4b23('0x101')](db['MailInteraction'],{'as':_0x4b23('0x14e')});db['MailAccount'][_0x4b23('0x101')](db[_0x4b23('0x46')],{'as':_0x4b23('0x131')});db[_0x4b23('0x3e')][_0x4b23('0x10c')](db['CmList'],{'as':_0x4b23('0x14f'),'foreignKey':'ListId'});db[_0x4b23('0x3e')]['belongsTo'](db[_0x4b23('0x8f')],{'as':_0x4b23('0x8f'),'foreignKey':_0x4b23('0x150')});db[_0x4b23('0x3e')][_0x4b23('0x10c')](db[_0x4b23('0x151')],{'as':_0x4b23('0x152'),'foreignKey':_0x4b23('0x13b')});db['MailAccount'][_0x4b23('0x10d')](db[_0x4b23('0x14')],{'as':_0x4b23('0x13d'),'through':_0x4b23('0x128')});db[_0x4b23('0x40')][_0x4b23('0x10d')](db['User'],{'as':_0x4b23('0x13d'),'through':_0x4b23('0x34')});db[_0x4b23('0x40')][_0x4b23('0x10d')](db['Team'],{'through':'team_has_mail_queues','as':_0x4b23('0x13e')});db[_0x4b23('0x43')][_0x4b23('0x101')](db[_0x4b23('0x14d')],{'as':_0x4b23('0x140'),'onDelete':'cascade','foreignKey':'MailInteractionId'});db[_0x4b23('0x43')][_0x4b23('0x10c')](db[_0x4b23('0x3e')],{'as':'Account','foreignKey':_0x4b23('0x147')});db[_0x4b23('0x43')]['belongsTo'](db[_0x4b23('0x110')],{'as':_0x4b23('0x146'),'foreignKey':_0x4b23('0x153')});db['MailInteraction']['belongsTo'](db['User'],{'as':_0x4b23('0x154'),'foreignKey':_0x4b23('0x100')});db[_0x4b23('0x43')][_0x4b23('0x10d')](db['Tag'],{'through':_0x4b23('0x155'),'as':'Tags'});db[_0x4b23('0x43')][_0x4b23('0x10d')](db[_0x4b23('0x8e')],{'through':'mail_interaction_has_tags','as':_0x4b23('0x156')});db[_0x4b23('0x43')][_0x4b23('0x10d')](db[_0x4b23('0x14')],{'as':'Users','through':_0x4b23('0x115'),'foreignKey':_0x4b23('0x157')});db[_0x4b23('0x14d')][_0x4b23('0x101')](db[_0x4b23('0xe1')],{'as':_0x4b23('0x158'),'onDelete':'cascade'});db[_0x4b23('0x14d')][_0x4b23('0x10c')](db[_0x4b23('0x14')],{'as':'User'});db[_0x4b23('0x14d')][_0x4b23('0x10c')](db['CmContact'],{'onDelete':'cascade','as':_0x4b23('0x146')});db[_0x4b23('0x14d')][_0x4b23('0x10c')](db[_0x4b23('0x43')],{'as':'Interaction','foreignKey':_0x4b23('0x157')});db['MailMessage'][_0x4b23('0x10c')](db[_0x4b23('0x3e')],{'as':'Account','foreignKey':_0x4b23('0x147')});db[_0x4b23('0x46')]['belongsTo'](db['User'],{'onDelete':_0x4b23('0x159')});db['MailApplication'][_0x4b23('0x10c')](db[_0x4b23('0x40')],{'onDelete':_0x4b23('0x159')});db[_0x4b23('0x46')][_0x4b23('0x10c')](db[_0x4b23('0x3e')],{'onDelete':_0x4b23('0x159')});db[_0x4b23('0x46')][_0x4b23('0x10c')](db[_0x4b23('0x88')],{'onDelete':_0x4b23('0x159'),'foreignKey':_0x4b23('0x15a')});db[_0x4b23('0x46')][_0x4b23('0x10c')](db[_0x4b23('0x8e')],{'onDelete':_0x4b23('0x159'),'foreignKey':_0x4b23('0x15b')});db[_0x4b23('0x48')]['belongsTo'](db['MailAccount'],{});db['MailQueueReport'][_0x4b23('0x10c')](db['CmList'],{'as':_0x4b23('0x14f'),'foreignKey':_0x4b23('0x15c')});db[_0x4b23('0x48')]['belongsTo'](db[_0x4b23('0x110')],{'as':'Contact','foreignKey':'ContactId'});db['MailQueueReport']['belongsTo'](db[_0x4b23('0x43')],{});db[_0x4b23('0x48')][_0x4b23('0x10c')](db[_0x4b23('0x14d')],{});db[_0x4b23('0x48')][_0x4b23('0x10c')](db[_0x4b23('0x14')],{});db[_0x4b23('0x48')]['belongsTo'](db[_0x4b23('0x40')],{});db[_0x4b23('0x4a')][_0x4b23('0x101')](db['DashboardItem'],{'as':_0x4b23('0x15d'),'onDelete':'cascade'});db[_0x4b23('0x4d')][_0x4b23('0x101')](db['Disposition'],{'as':_0x4b23('0x14b'),'foreignKey':_0x4b23('0x15e')});db[_0x4b23('0x4d')][_0x4b23('0x101')](db[_0x4b23('0x83')],{'as':_0x4b23('0x14c'),'foreignKey':_0x4b23('0x15e')});db[_0x4b23('0x4d')]['hasMany'](db['FaxInteraction'],{'as':_0x4b23('0x14e')});db[_0x4b23('0x4d')][_0x4b23('0x101')](db[_0x4b23('0x4f')],{'as':_0x4b23('0x131')});db[_0x4b23('0x4d')][_0x4b23('0x101')](db[_0x4b23('0x1b')],{'as':_0x4b23('0x15f'),'onDelete':_0x4b23('0xfe')});db[_0x4b23('0x4d')][_0x4b23('0x101')](db['FaxMessage'],{'as':_0x4b23('0x140')});db['FaxAccount'][_0x4b23('0x10c')](db['Trunk'],{'as':_0x4b23('0x2d')});db[_0x4b23('0x4d')]['belongsTo'](db[_0x4b23('0xea')],{'as':_0x4b23('0x14f'),'foreignKey':'ListId'});db[_0x4b23('0x4d')][_0x4b23('0x10c')](db['Pause'],{'as':_0x4b23('0x152'),'foreignKey':'mandatoryDispositionPauseId'});db[_0x4b23('0x4d')][_0x4b23('0x10d')](db['User'],{'as':_0x4b23('0x13d'),'through':_0x4b23('0x160')});db['FaxApplication'][_0x4b23('0x10c')](db[_0x4b23('0x14')],{'onDelete':_0x4b23('0x159')});db[_0x4b23('0x4f')][_0x4b23('0x10c')](db[_0x4b23('0x53')],{'onDelete':_0x4b23('0x159')});db[_0x4b23('0x4f')][_0x4b23('0x10c')](db[_0x4b23('0x4d')],{'onDelete':'restrict'});db[_0x4b23('0x4f')][_0x4b23('0x10c')](db[_0x4b23('0x8e')],{'onDelete':_0x4b23('0x159'),'foreignKey':_0x4b23('0x15b')});db[_0x4b23('0x50')][_0x4b23('0x101')](db[_0x4b23('0x51')],{'as':_0x4b23('0x140'),'onDelete':'cascade','foreignKey':_0x4b23('0x161')});db[_0x4b23('0x50')]['belongsTo'](db[_0x4b23('0x4d')],{'as':_0x4b23('0x162'),'foreignKey':_0x4b23('0x15e')});db['FaxInteraction'][_0x4b23('0x10c')](db[_0x4b23('0x110')],{'as':_0x4b23('0x146'),'foreignKey':'ContactId'});db[_0x4b23('0x50')][_0x4b23('0x10c')](db['User'],{'as':_0x4b23('0x154'),'foreignKey':_0x4b23('0x100')});db[_0x4b23('0x50')][_0x4b23('0x10d')](db[_0x4b23('0x8e')],{'through':'fax_interaction_has_tags','as':_0x4b23('0x163')});db[_0x4b23('0x50')][_0x4b23('0x10d')](db[_0x4b23('0x8e')],{'through':_0x4b23('0x164'),'as':'ThroughTags'});db['FaxInteraction']['belongsToMany'](db[_0x4b23('0x14')],{'as':'Users','through':'user_has_fax_interactions','foreignKey':_0x4b23('0x161')});db[_0x4b23('0x51')][_0x4b23('0x10c')](db[_0x4b23('0x14')],{'onDelete':_0x4b23('0xfe'),'as':'User'});db[_0x4b23('0x51')][_0x4b23('0x10c')](db[_0x4b23('0x50')],{'as':_0x4b23('0x165'),'foreignKey':'FaxInteractionId'});db[_0x4b23('0x51')][_0x4b23('0x10c')](db[_0x4b23('0x110')],{'onDelete':_0x4b23('0xfe'),'as':_0x4b23('0x146')});db[_0x4b23('0x51')][_0x4b23('0x10c')](db[_0x4b23('0xe1')],{'as':'Attachment','foreignKey':_0x4b23('0x166')});db[_0x4b23('0x51')][_0x4b23('0x10c')](db['FaxAccount'],{'as':_0x4b23('0x162'),'foreignKey':_0x4b23('0x15e')});db[_0x4b23('0x53')][_0x4b23('0x10d')](db[_0x4b23('0x14')],{'as':_0x4b23('0x13d'),'through':_0x4b23('0x11f')});db[_0x4b23('0x53')][_0x4b23('0x10d')](db['Team'],{'through':_0x4b23('0x167'),'as':_0x4b23('0x13e')});db[_0x4b23('0x54')]['belongsTo'](db['FaxAccount'],{});db[_0x4b23('0x54')][_0x4b23('0x10c')](db[_0x4b23('0xea')],{'as':_0x4b23('0x14f'),'foreignKey':_0x4b23('0x15c')});db[_0x4b23('0x54')][_0x4b23('0x10c')](db[_0x4b23('0x110')],{'as':'Contact','foreignKey':'ContactId'});db[_0x4b23('0x54')][_0x4b23('0x10c')](db['FaxInteraction'],{});db['FaxQueueReport'][_0x4b23('0x10c')](db[_0x4b23('0x51')],{});db[_0x4b23('0x54')][_0x4b23('0x10c')](db[_0x4b23('0x14')],{});db[_0x4b23('0x54')][_0x4b23('0x10c')](db[_0x4b23('0x53')],{});db['SmsAccount']['hasMany'](db[_0x4b23('0x85')],{'as':'Dispositions','foreignKey':_0x4b23('0x168')});db[_0x4b23('0x56')][_0x4b23('0x101')](db[_0x4b23('0x83')],{'as':_0x4b23('0x14c'),'foreignKey':_0x4b23('0x168')});db['SmsAccount']['hasMany'](db[_0x4b23('0x5c')],{'as':_0x4b23('0x140'),'foreignKey':_0x4b23('0x168')});db[_0x4b23('0x56')][_0x4b23('0x101')](db['SmsInteraction'],{'as':_0x4b23('0x14e')});db[_0x4b23('0x56')][_0x4b23('0x101')](db[_0x4b23('0x58')],{'as':'Applications'});db[_0x4b23('0x56')][_0x4b23('0x10c')](db[_0x4b23('0xea')],{'as':_0x4b23('0x14f'),'foreignKey':_0x4b23('0x15c')});db[_0x4b23('0x56')][_0x4b23('0x10c')](db[_0x4b23('0x151')],{'as':_0x4b23('0x152'),'foreignKey':_0x4b23('0x13b')});db['SmsAccount'][_0x4b23('0x10d')](db['User'],{'as':_0x4b23('0x13d'),'through':_0x4b23('0x12c')});db[_0x4b23('0x58')][_0x4b23('0x10c')](db[_0x4b23('0x14')],{'onDelete':'restrict'});db[_0x4b23('0x58')][_0x4b23('0x10c')](db[_0x4b23('0x5e')],{'onDelete':'restrict'});db['SmsApplication']['belongsTo'](db[_0x4b23('0x56')],{'onDelete':_0x4b23('0x159')});db[_0x4b23('0x58')][_0x4b23('0x10c')](db[_0x4b23('0x88')],{'onDelete':_0x4b23('0x159'),'foreignKey':_0x4b23('0x15a')});db[_0x4b23('0x58')][_0x4b23('0x10c')](db[_0x4b23('0x8e')],{'onDelete':_0x4b23('0x159'),'foreignKey':_0x4b23('0x15b')});db[_0x4b23('0x5a')]['hasMany'](db[_0x4b23('0x5c')],{'as':_0x4b23('0x140'),'onDelete':'cascade','foreignKey':_0x4b23('0x169')});db[_0x4b23('0x5a')][_0x4b23('0x10c')](db[_0x4b23('0x56')],{'as':_0x4b23('0x162'),'foreignKey':_0x4b23('0x168')});db[_0x4b23('0x5a')][_0x4b23('0x10c')](db['CmContact'],{'as':_0x4b23('0x146'),'foreignKey':_0x4b23('0x153')});db[_0x4b23('0x5a')]['belongsTo'](db['User'],{'as':_0x4b23('0x154'),'foreignKey':'UserId'});db[_0x4b23('0x5a')][_0x4b23('0x10d')](db[_0x4b23('0x8e')],{'through':_0x4b23('0x16a'),'as':_0x4b23('0x163')});db[_0x4b23('0x5a')][_0x4b23('0x10d')](db['Tag'],{'through':'sms_interaction_has_tags','as':'ThroughTags'});db[_0x4b23('0x5a')][_0x4b23('0x10d')](db['User'],{'as':_0x4b23('0x16b'),'through':_0x4b23('0x16c'),'foreignKey':'SmsInteractionId'});db['SmsMessage'][_0x4b23('0x10c')](db[_0x4b23('0x14')],{'as':_0x4b23('0x14')});db[_0x4b23('0x5c')]['belongsTo'](db[_0x4b23('0x110')],{'onDelete':_0x4b23('0xfe'),'as':'Contact'});db[_0x4b23('0x5c')]['belongsTo'](db[_0x4b23('0x5a')],{'onDelete':_0x4b23('0xfe'),'as':_0x4b23('0x165'),'foreignKey':_0x4b23('0x169')});db[_0x4b23('0x5c')][_0x4b23('0x10c')](db[_0x4b23('0x56')],{'as':_0x4b23('0x162'),'foreignKey':_0x4b23('0x168')});db[_0x4b23('0x5e')][_0x4b23('0x10d')](db[_0x4b23('0x14')],{'as':_0x4b23('0x13d'),'through':_0x4b23('0x36'),'foreignKey':_0x4b23('0x16d')});db['SmsQueue'][_0x4b23('0x10d')](db['Team'],{'through':_0x4b23('0x16e'),'as':_0x4b23('0x13e')});db[_0x4b23('0x5f')][_0x4b23('0x101')](db[_0x4b23('0x85')],{'as':_0x4b23('0x14b'),'foreignKey':'OpenchannelAccountId'});db[_0x4b23('0x5f')]['hasMany'](db[_0x4b23('0x83')],{'as':_0x4b23('0x14c'),'foreignKey':'OpenchannelAccountId'});db[_0x4b23('0x5f')]['hasMany'](db[_0x4b23('0x63')],{'as':_0x4b23('0x14e'),'foreignKey':_0x4b23('0x16f')});db[_0x4b23('0x5f')][_0x4b23('0x101')](db[_0x4b23('0x65')],{'as':_0x4b23('0x140'),'foreignKey':'OpenchannelAccountId'});db[_0x4b23('0x5f')][_0x4b23('0x101')](db[_0x4b23('0x61')],{'as':_0x4b23('0x131'),'foreignKey':_0x4b23('0x16f')});db['OpenchannelAccount'][_0x4b23('0x10c')](db[_0x4b23('0xea')],{'as':'List','foreignKey':_0x4b23('0x15c')});db[_0x4b23('0x5f')]['belongsTo'](db[_0x4b23('0x151')],{'as':_0x4b23('0x152'),'foreignKey':'mandatoryDispositionPauseId'});db['OpenchannelAccount'][_0x4b23('0x10d')](db[_0x4b23('0x14')],{'as':'Agents','through':_0x4b23('0x12a')});db[_0x4b23('0x61')][_0x4b23('0x10c')](db[_0x4b23('0x14')],{'onDelete':_0x4b23('0x159')});db[_0x4b23('0x61')][_0x4b23('0x10c')](db['OpenchannelQueue'],{'onDelete':_0x4b23('0x159'),'foreignKey':'OpenchannelQueueId'});db[_0x4b23('0x61')][_0x4b23('0x10c')](db[_0x4b23('0x5f')],{'onDelete':_0x4b23('0x159'),'foreignKey':'OpenchannelAccountId'});db[_0x4b23('0x61')][_0x4b23('0x10c')](db[_0x4b23('0x88')],{'onDelete':_0x4b23('0x159'),'foreignKey':_0x4b23('0x15a')});db['OpenchannelApplication'][_0x4b23('0x10c')](db[_0x4b23('0x8e')],{'onDelete':_0x4b23('0x159'),'foreignKey':_0x4b23('0x15b')});db[_0x4b23('0x63')][_0x4b23('0x101')](db[_0x4b23('0x65')],{'as':'Messages','onDelete':_0x4b23('0xfe'),'foreignKey':_0x4b23('0x170')});db[_0x4b23('0x63')][_0x4b23('0x10c')](db[_0x4b23('0x5f')],{'as':_0x4b23('0x162'),'foreignKey':_0x4b23('0x16f')});db[_0x4b23('0x63')][_0x4b23('0x10c')](db[_0x4b23('0x110')],{'as':_0x4b23('0x146'),'foreignKey':_0x4b23('0x153')});db['OpenchannelInteraction']['belongsTo'](db[_0x4b23('0x14')],{'as':'Owner','foreignKey':_0x4b23('0x100')});db[_0x4b23('0x63')]['belongsToMany'](db[_0x4b23('0x8e')],{'through':'openchannel_interaction_has_tags','as':'Tags'});db[_0x4b23('0x63')][_0x4b23('0x10d')](db['Tag'],{'through':_0x4b23('0x171'),'as':_0x4b23('0x156')});db[_0x4b23('0x63')]['belongsToMany'](db[_0x4b23('0x14')],{'as':_0x4b23('0x16b'),'through':_0x4b23('0x118'),'foreignKey':'OpenchannelInteractionId'});db[_0x4b23('0x65')][_0x4b23('0x10c')](db[_0x4b23('0x14')],{'onDelete':_0x4b23('0xfe'),'as':_0x4b23('0x14')});db[_0x4b23('0x65')][_0x4b23('0x10c')](db[_0x4b23('0x110')],{'onDelete':_0x4b23('0xfe'),'as':_0x4b23('0x146')});db[_0x4b23('0x65')][_0x4b23('0x10c')](db['OpenchannelInteraction'],{'onDelete':_0x4b23('0xfe'),'as':'Interaction','foreignKey':'OpenchannelInteractionId'});db[_0x4b23('0x65')][_0x4b23('0x10c')](db[_0x4b23('0xe1')],{'as':'Attachment','foreignKey':'AttachmentId'});db[_0x4b23('0x65')][_0x4b23('0x10c')](db[_0x4b23('0x5f')],{'as':_0x4b23('0x162'),'foreignKey':_0x4b23('0x16f')});db[_0x4b23('0x67')][_0x4b23('0x10d')](db[_0x4b23('0x14')],{'as':_0x4b23('0x13d'),'through':'UserOpenchannelQueue','foreignKey':_0x4b23('0x172')});db['OpenchannelQueue'][_0x4b23('0x10d')](db[_0x4b23('0xdb')],{'through':_0x4b23('0x173'),'as':_0x4b23('0x13e')});db['ChatWebsite'][_0x4b23('0x101')](db[_0x4b23('0x85')],{'as':_0x4b23('0x14b'),'foreignKey':_0x4b23('0x174')});db['ChatWebsite'][_0x4b23('0x101')](db[_0x4b23('0x83')],{'as':'Answers','foreignKey':_0x4b23('0x174')});db['ChatWebsite']['hasMany'](db[_0x4b23('0x73')],{'as':_0x4b23('0x175')});db[_0x4b23('0x125')][_0x4b23('0x101')](db[_0x4b23('0x176')],{'as':_0x4b23('0x14e')});db['ChatWebsite'][_0x4b23('0x101')](db[_0x4b23('0x6a')],{'as':_0x4b23('0x131')});db['ChatWebsite'][_0x4b23('0x101')](db[_0x4b23('0x6d')],{'as':_0x4b23('0x140')});db[_0x4b23('0x125')][_0x4b23('0x10c')](db[_0x4b23('0xea')],{'as':_0x4b23('0x14f'),'foreignKey':'ListId'});db[_0x4b23('0x125')]['belongsTo'](db[_0x4b23('0x88')],{'as':_0x4b23('0x88'),'foreignKey':_0x4b23('0x15a')});db[_0x4b23('0x125')][_0x4b23('0x10c')](db[_0x4b23('0x151')],{'as':_0x4b23('0x152'),'foreignKey':'mandatoryDispositionPauseId'});db[_0x4b23('0x125')][_0x4b23('0x10d')](db['User'],{'as':_0x4b23('0x13d'),'through':_0x4b23('0x126')});db[_0x4b23('0x177')][_0x4b23('0x10c')](db[_0x4b23('0x5f')],{});db[_0x4b23('0x177')][_0x4b23('0x10c')](db[_0x4b23('0xea')],{'as':_0x4b23('0x14f'),'foreignKey':_0x4b23('0x15c')});db[_0x4b23('0x177')]['belongsTo'](db[_0x4b23('0x110')],{'as':_0x4b23('0x146'),'foreignKey':_0x4b23('0x153')});db[_0x4b23('0x177')][_0x4b23('0x10c')](db[_0x4b23('0x63')],{});db[_0x4b23('0x177')][_0x4b23('0x10c')](db[_0x4b23('0x65')],{});db[_0x4b23('0x177')][_0x4b23('0x10c')](db['User'],{});db[_0x4b23('0x177')]['belongsTo'](db[_0x4b23('0x67')],{});db['ChatApplication']['belongsTo'](db[_0x4b23('0x14')],{'as':_0x4b23('0x178'),'foreignKey':'UserId','onDelete':_0x4b23('0x159')});db[_0x4b23('0x6a')][_0x4b23('0x10c')](db[_0x4b23('0x70')],{'as':'Queue','foreignKey':_0x4b23('0x179'),'onDelete':_0x4b23('0x159')});db[_0x4b23('0x6a')]['belongsTo'](db[_0x4b23('0x125')],{'as':_0x4b23('0x17a'),'foreignKey':_0x4b23('0x174'),'onDelete':_0x4b23('0x159')});db[_0x4b23('0x6a')][_0x4b23('0x10c')](db[_0x4b23('0x8e')],{'onDelete':'restrict','foreignKey':_0x4b23('0x15b')});db[_0x4b23('0x176')][_0x4b23('0x101')](db[_0x4b23('0x6d')],{'as':_0x4b23('0x140'),'onDelete':'cascade','foreignKey':_0x4b23('0x17b')});db['ChatInteraction'][_0x4b23('0x10c')](db[_0x4b23('0x125')],{'as':_0x4b23('0x162'),'foreignKey':_0x4b23('0x174')});db[_0x4b23('0x176')]['belongsTo'](db['CmContact'],{'as':_0x4b23('0x146'),'foreignKey':_0x4b23('0x153')});db['ChatInteraction']['belongsTo'](db[_0x4b23('0x14')],{'as':_0x4b23('0x154'),'foreignKey':_0x4b23('0x100')});db['ChatInteraction'][_0x4b23('0x10d')](db['Tag'],{'through':_0x4b23('0x17c'),'as':_0x4b23('0x163')});db[_0x4b23('0x176')][_0x4b23('0x10d')](db[_0x4b23('0x8e')],{'through':_0x4b23('0x17c'),'as':_0x4b23('0x156')});db[_0x4b23('0x176')][_0x4b23('0x10d')](db[_0x4b23('0x14')],{'as':_0x4b23('0x16b'),'through':_0x4b23('0x116'),'foreignKey':'ChatInteractionId'});db['ChatMessage'][_0x4b23('0x10c')](db[_0x4b23('0x14')],{'onDelete':_0x4b23('0xfe'),'as':_0x4b23('0x14')});db['ChatMessage']['belongsTo'](db[_0x4b23('0x110')],{'onDelete':_0x4b23('0xfe'),'as':_0x4b23('0x146'),'foreignKey':'ContactId'});db['ChatMessage']['belongsTo'](db[_0x4b23('0x176')],{'onDelete':_0x4b23('0xfe'),'as':'Interaction','foreignKey':_0x4b23('0x17b')});db['ChatMessage'][_0x4b23('0x10c')](db[_0x4b23('0xe1')],{'as':'Attachment','foreignKey':_0x4b23('0x166')});db[_0x4b23('0x6d')][_0x4b23('0x10c')](db[_0x4b23('0x125')],{'as':'Account','foreignKey':'ChatWebsiteId'});db[_0x4b23('0x6f')][_0x4b23('0x10c')](db['CmContact'],{'onDelete':_0x4b23('0xfe'),'as':_0x4b23('0x146'),'foreignKey':_0x4b23('0x153')});db[_0x4b23('0x6f')][_0x4b23('0x10c')](db[_0x4b23('0x125')],{'as':_0x4b23('0x162'),'foreignKey':_0x4b23('0x174')});db[_0x4b23('0x70')][_0x4b23('0x10d')](db['User'],{'as':_0x4b23('0x13d'),'through':_0x4b23('0x32'),'hooks':!![]});db[_0x4b23('0x70')][_0x4b23('0x10d')](db['Team'],{'through':_0x4b23('0x17d'),'as':_0x4b23('0x13e')});db[_0x4b23('0x72')]['hasMany'](db[_0x4b23('0xce')],{'as':'Messages','foreignKey':_0x4b23('0x17e'),'onDelete':'cascade'});db[_0x4b23('0x72')][_0x4b23('0x10d')](db[_0x4b23('0x14')],{'as':_0x4b23('0x134'),'through':'chat_group_has_users'});db[_0x4b23('0x73')][_0x4b23('0x10c')](db[_0x4b23('0x125')],{'as':_0x4b23('0x17a'),'foreignKey':_0x4b23('0x174')});db[_0x4b23('0x17f')]['hasMany'](db[_0x4b23('0x110')],{'as':_0x4b23('0x180'),'foreignKey':_0x4b23('0x181')});db[_0x4b23('0x110')][_0x4b23('0x101')](db[_0x4b23('0x76')],{'as':_0x4b23('0x136'),'foreignKey':_0x4b23('0x153')});db[_0x4b23('0x110')][_0x4b23('0x101')](db['CmHopperFinal'],{'as':_0x4b23('0x103'),'foreignKey':_0x4b23('0x153')});db[_0x4b23('0x110')][_0x4b23('0x101')](db[_0x4b23('0x7b')],{'as':_0x4b23('0x182'),'foreignKey':_0x4b23('0x153')});db[_0x4b23('0x110')][_0x4b23('0x101')](db[_0x4b23('0x7d')],{'as':_0x4b23('0x7d'),'foreignKey':'ContactId'});db[_0x4b23('0x110')][_0x4b23('0x101')](db[_0x4b23('0x137')],{'as':_0x4b23('0x138'),'foreignKey':'ContactId'});db[_0x4b23('0x110')]['hasMany'](db[_0x4b23('0x63')],{'as':_0x4b23('0x105'),'foreignKey':_0x4b23('0x153'),'onDelete':_0x4b23('0x159')});db[_0x4b23('0x110')]['hasMany'](db[_0x4b23('0x176')],{'as':_0x4b23('0x106'),'foreignKey':_0x4b23('0x153'),'onDelete':_0x4b23('0x159')});db['CmContact']['hasMany'](db[_0x4b23('0x5a')],{'as':_0x4b23('0x107'),'foreignKey':_0x4b23('0x153'),'onDelete':'restrict'});db[_0x4b23('0x110')]['hasMany'](db[_0x4b23('0x50')],{'as':_0x4b23('0x108'),'foreignKey':_0x4b23('0x153'),'onDelete':'restrict'});db[_0x4b23('0x110')]['hasMany'](db[_0x4b23('0x43')],{'as':_0x4b23('0x109'),'foreignKey':'ContactId','onDelete':_0x4b23('0x159')});db[_0x4b23('0x110')][_0x4b23('0x10c')](db['CmCompany'],{'as':_0x4b23('0x183'),'foreignKey':_0x4b23('0x181')});db[_0x4b23('0x110')][_0x4b23('0x10c')](db[_0x4b23('0xea')],{'as':_0x4b23('0x14f'),'foreignKey':_0x4b23('0x15c'),'onDelete':_0x4b23('0xfe')});db['CmContact'][_0x4b23('0x10d')](db['User'],{'as':'Users','through':_0x4b23('0x111')});db[_0x4b23('0x110')][_0x4b23('0x10d')](db[_0x4b23('0x8e')],{'as':_0x4b23('0x163'),'through':'cm_contact_has_tags'});db['CmContact']['belongsToMany'](db[_0x4b23('0x8e')],{'through':_0x4b23('0x184'),'as':_0x4b23('0x156')});db[_0x4b23('0x76')][_0x4b23('0x10c')](db[_0x4b23('0x110')],{'as':'Contact','foreignKey':_0x4b23('0x153'),'onDelete':'cascade'});db['CmHopper']['belongsTo'](db['CmList'],{'as':_0x4b23('0x14f'),'foreignKey':_0x4b23('0x15c'),'onDelete':_0x4b23('0xfe')});db[_0x4b23('0x76')][_0x4b23('0x10c')](db['User'],{'as':_0x4b23('0x178'),'foreignKey':_0x4b23('0x100')});db[_0x4b23('0x76')][_0x4b23('0x10c')](db[_0x4b23('0x1e')],{'as':'Queue','foreignKey':_0x4b23('0x135'),'onDelete':_0x4b23('0xfe')});db[_0x4b23('0x76')]['belongsTo'](db[_0x4b23('0x185')],{'as':_0x4b23('0x185'),'foreignKey':_0x4b23('0x186'),'onDelete':_0x4b23('0xfe')});db['CmHopper'][_0x4b23('0x10c')](db[_0x4b23('0x14')],{'as':_0x4b23('0x154'),'foreignKey':_0x4b23('0x187')});db['CmHopperBlack']['belongsTo'](db[_0x4b23('0x110')],{'as':_0x4b23('0x146'),'foreignKey':_0x4b23('0x153'),'onDelete':_0x4b23('0xfe')});db[_0x4b23('0x78')][_0x4b23('0x10c')](db['CmList'],{'as':_0x4b23('0x14f'),'foreignKey':_0x4b23('0x15c'),'onDelete':_0x4b23('0xfe')});db['CmHopperBlack'][_0x4b23('0x10c')](db[_0x4b23('0x1e')],{'as':_0x4b23('0x188'),'foreignKey':_0x4b23('0x135'),'onDelete':_0x4b23('0xfe')});db['CmHopperBlack'][_0x4b23('0x10c')](db[_0x4b23('0x185')],{'as':_0x4b23('0x185'),'foreignKey':_0x4b23('0x186'),'onDelete':_0x4b23('0xfe')});db[_0x4b23('0x81')][_0x4b23('0x101')](db[_0x4b23('0x87')],{'as':{'plural':'All','singular':'OneAll'},'foreignKey':_0x4b23('0x189'),'onDelete':'cascade','hooks':!![]});db['Automation'][_0x4b23('0x101')](db[_0x4b23('0x87')],{'as':{'plural':_0x4b23('0x18a'),'singular':_0x4b23('0x18b')},'foreignKey':_0x4b23('0x18c'),'onDelete':'cascade','hooks':!![]});db[_0x4b23('0x81')][_0x4b23('0x101')](db[_0x4b23('0x18d')],{'as':'Actions','foreignKey':'AutomationId','onDelete':_0x4b23('0xfe'),'hooks':!![]});db['Interval']['hasMany'](db['Interval'],{'as':_0x4b23('0x18e'),'foreignKey':_0x4b23('0x15a'),'onDelete':_0x4b23('0xfe'),'hooks':!![],'required':![]});db[_0x4b23('0x88')]['hasMany'](db[_0x4b23('0x1b')],{'as':_0x4b23('0x102'),'foreignKey':_0x4b23('0x15a'),'onDelete':_0x4b23('0x159')});db[_0x4b23('0x88')]['hasMany'](db[_0x4b23('0x46')],{'as':_0x4b23('0x18f'),'foreignKey':'IntervalId'});db[_0x4b23('0x88')][_0x4b23('0x101')](db[_0x4b23('0x6a')],{'as':_0x4b23('0x190'),'foreignKey':_0x4b23('0x15a')});db['Interval'][_0x4b23('0x101')](db['FaxApplication'],{'as':_0x4b23('0x191'),'foreignKey':_0x4b23('0x15a')});db[_0x4b23('0x88')][_0x4b23('0x101')](db[_0x4b23('0x58')],{'as':_0x4b23('0x192'),'foreignKey':'IntervalId'});db[_0x4b23('0x193')][_0x4b23('0x10c')](db[_0x4b23('0x3e')],{});db['Schedule'][_0x4b23('0x10c')](db['AnalyticDefaultReport'],{'foreignKey':_0x4b23('0x194')});db[_0x4b23('0x193')][_0x4b23('0x10c')](db[_0x4b23('0x97')],{'foreignKey':_0x4b23('0x195')});db[_0x4b23('0x132')][_0x4b23('0x10d')](db[_0x4b23('0x1d')],{'as':_0x4b23('0x196'),'through':_0x4b23('0x197'),'onDelete':_0x4b23('0x159')});db['Tag'][_0x4b23('0x10d')](db[_0x4b23('0x110')],{'through':_0x4b23('0x184')});db[_0x4b23('0x8e')][_0x4b23('0x10d')](db[_0x4b23('0x176')],{'through':_0x4b23('0x17c')});db[_0x4b23('0x8e')][_0x4b23('0x10d')](db[_0x4b23('0x43')],{'through':_0x4b23('0x155')});db['Tag']['belongsToMany'](db[_0x4b23('0x5a')],{'through':_0x4b23('0x16a')});db[_0x4b23('0x8e')][_0x4b23('0x10d')](db[_0x4b23('0x50')],{'through':'fax_interaction_has_tags'});db[_0x4b23('0x8e')][_0x4b23('0x10d')](db[_0x4b23('0x63')],{'through':_0x4b23('0x171')});db[_0x4b23('0x8e')][_0x4b23('0x10d')](db[_0x4b23('0xf3')],{'through':_0x4b23('0x198')});db[_0x4b23('0x199')][_0x4b23('0x101')](db['Condition'],{'as':{'plural':'AllConditions','singular':_0x4b23('0x19a')},'foreignKey':_0x4b23('0x19b'),'onDelete':_0x4b23('0xfe'),'hooks':!![]});db[_0x4b23('0x199')][_0x4b23('0x101')](db[_0x4b23('0x87')],{'as':{'plural':'AnyConditions','singular':_0x4b23('0x19c')},'foreignKey':_0x4b23('0x19d'),'onDelete':_0x4b23('0xfe'),'hooks':!![]});db[_0x4b23('0x199')][_0x4b23('0x101')](db['Action'],{'as':_0x4b23('0x19e'),'foreignKey':_0x4b23('0x19f'),'onDelete':_0x4b23('0xfe'),'hooks':!![]});db[_0x4b23('0x97')][_0x4b23('0x101')](db[_0x4b23('0x9f')],{'as':_0x4b23('0x1a0'),'onDelete':_0x4b23('0xfe'),'foreignKey':_0x4b23('0x195'),'hooks':!![]});db[_0x4b23('0x99')][_0x4b23('0x101')](db[_0x4b23('0x9f')],{'as':_0x4b23('0x1a0'),'onDelete':_0x4b23('0xfe'),'foreignKey':_0x4b23('0x194')});db[_0x4b23('0x9d')][_0x4b23('0x101')](db[_0x4b23('0x9f')],{'as':_0x4b23('0x1a0'),'onDelete':_0x4b23('0xfe'),'foreignKey':'MetricId'});db['AnalyticFieldReport'][_0x4b23('0x10c')](db[_0x4b23('0x9d')],{'foreignKey':_0x4b23('0x1a1')});db[_0x4b23('0xa3')][_0x4b23('0x101')](db['SalesforceConfiguration'],{'as':_0x4b23('0x1a2'),'onDelete':_0x4b23('0xfe'),'foreignKey':_0x4b23('0x1a3')});db['SalesforceConfiguration']['hasMany'](db['SalesforceField'],{'as':_0x4b23('0x1a4'),'onDelete':_0x4b23('0xfe'),'foreignKey':_0x4b23('0x1a5')});db[_0x4b23('0xa5')][_0x4b23('0x101')](db[_0x4b23('0xa6')],{'as':_0x4b23('0x1a6'),'onDelete':_0x4b23('0xfe'),'foreignKey':_0x4b23('0x1a7')});db[_0x4b23('0xa5')]['hasMany'](db['SalesforceField'],{'as':'Fields','onDelete':_0x4b23('0xfe'),'foreignKey':_0x4b23('0x1a8')});db[_0x4b23('0xa5')][_0x4b23('0x10c')](db[_0x4b23('0xa3')],{'as':_0x4b23('0x162'),'foreignKey':'AccountId'});db['SalesforceField'][_0x4b23('0x101')](db[_0x4b23('0xa6')],{'as':_0x4b23('0x1a9'),'foreignKey':_0x4b23('0x1a5')});db[_0x4b23('0xa6')]['hasMany'](db['SalesforceField'],{'as':_0x4b23('0x1aa'),'foreignKey':_0x4b23('0x1a7')});db[_0x4b23('0xa6')][_0x4b23('0x101')](db['SalesforceField'],{'as':_0x4b23('0x1ab'),'foreignKey':_0x4b23('0x1a8')});db['SalesforceField'][_0x4b23('0x10c')](db[_0x4b23('0x91')],{'as':_0x4b23('0x91'),'foreignKey':_0x4b23('0x1ac')});db[_0x4b23('0x1ad')][_0x4b23('0x101')](db['SugarcrmConfiguration'],{'as':_0x4b23('0x1a2'),'onDelete':_0x4b23('0xfe'),'foreignKey':_0x4b23('0x1a3')});db[_0x4b23('0x1ae')]['hasMany'](db[_0x4b23('0xa9')],{'as':_0x4b23('0x1a4'),'onDelete':_0x4b23('0xfe'),'foreignKey':_0x4b23('0x1a5')});db[_0x4b23('0x1ae')]['hasMany'](db[_0x4b23('0xa9')],{'as':_0x4b23('0x1a6'),'onDelete':_0x4b23('0xfe'),'foreignKey':'DescriptionId'});db[_0x4b23('0x1ae')]['hasMany'](db[_0x4b23('0xa9')],{'as':'Fields','onDelete':_0x4b23('0xfe'),'foreignKey':_0x4b23('0x1a8')});db['SugarcrmConfiguration'][_0x4b23('0x10c')](db['SugarcrmAccount'],{'as':_0x4b23('0x162'),'foreignKey':_0x4b23('0x1a3')});db[_0x4b23('0xa9')]['hasMany'](db[_0x4b23('0xa9')],{'as':'Subject','foreignKey':_0x4b23('0x1a5')});db['SugarcrmField']['hasMany'](db[_0x4b23('0xa9')],{'as':_0x4b23('0x1aa'),'foreignKey':'DescriptionId'});db[_0x4b23('0xa9')][_0x4b23('0x101')](db[_0x4b23('0xa9')],{'as':_0x4b23('0x1ab'),'foreignKey':_0x4b23('0x1a8')});db['SugarcrmField'][_0x4b23('0x10c')](db['Variable'],{'as':_0x4b23('0x91'),'foreignKey':_0x4b23('0x1ac')});db[_0x4b23('0xaa')][_0x4b23('0x101')](db[_0x4b23('0x1af')],{'as':_0x4b23('0x1a2'),'onDelete':_0x4b23('0xfe'),'foreignKey':_0x4b23('0x1a3')});db['DeskConfiguration']['hasMany'](db[_0x4b23('0x1b0')],{'as':_0x4b23('0x1a4'),'onDelete':_0x4b23('0xfe'),'foreignKey':_0x4b23('0x1a5')});db[_0x4b23('0x1af')]['hasMany'](db[_0x4b23('0x1b0')],{'as':_0x4b23('0x1a6'),'onDelete':_0x4b23('0xfe'),'foreignKey':_0x4b23('0x1a7')});db['DeskConfiguration'][_0x4b23('0x101')](db['DeskField'],{'as':'Fields','onDelete':_0x4b23('0xfe'),'foreignKey':'FieldId'});db['DeskConfiguration'][_0x4b23('0x10c')](db[_0x4b23('0xaa')],{'as':'Account','foreignKey':_0x4b23('0x1a3')});db['DeskConfiguration']['belongsToMany'](db[_0x4b23('0x8e')],{'through':_0x4b23('0x1b1')});db['DeskField'][_0x4b23('0x101')](db['DeskField'],{'as':_0x4b23('0x1a9'),'foreignKey':_0x4b23('0x1a5')});db[_0x4b23('0x1b0')][_0x4b23('0x101')](db['DeskField'],{'as':_0x4b23('0x1aa'),'foreignKey':_0x4b23('0x1a7')});db[_0x4b23('0x1b0')]['hasMany'](db['DeskField'],{'as':_0x4b23('0x1ab'),'foreignKey':'FieldId'});db[_0x4b23('0x1b0')][_0x4b23('0x10c')](db[_0x4b23('0x91')],{'as':_0x4b23('0x91'),'foreignKey':'VariableId'});db['ZohoAccount'][_0x4b23('0x101')](db[_0x4b23('0xb0')],{'as':_0x4b23('0x1a2'),'onDelete':_0x4b23('0xfe'),'foreignKey':_0x4b23('0x1a3')});db[_0x4b23('0xb0')]['hasMany'](db['ZohoField'],{'as':_0x4b23('0x1a4'),'onDelete':_0x4b23('0xfe'),'foreignKey':_0x4b23('0x1a5')});db[_0x4b23('0xb0')]['hasMany'](db['ZohoField'],{'as':_0x4b23('0x1a6'),'onDelete':_0x4b23('0xfe'),'foreignKey':'DescriptionId'});db['ZohoConfiguration'][_0x4b23('0x101')](db['ZohoField'],{'as':_0x4b23('0x1a0'),'onDelete':_0x4b23('0xfe'),'foreignKey':_0x4b23('0x1a8')});db[_0x4b23('0xb0')][_0x4b23('0x10c')](db[_0x4b23('0xae')],{'as':_0x4b23('0x162'),'foreignKey':_0x4b23('0x1a3')});db[_0x4b23('0x1b2')][_0x4b23('0x101')](db['ZohoField'],{'as':_0x4b23('0x1a9'),'foreignKey':_0x4b23('0x1a5')});db[_0x4b23('0x1b2')][_0x4b23('0x101')](db['ZohoField'],{'as':'Description','foreignKey':_0x4b23('0x1a7')});db[_0x4b23('0x1b2')]['hasMany'](db['ZohoField'],{'as':'Field','foreignKey':_0x4b23('0x1a8')});db[_0x4b23('0x1b2')][_0x4b23('0x10c')](db[_0x4b23('0x91')],{'as':_0x4b23('0x91'),'foreignKey':_0x4b23('0x1ac')});db[_0x4b23('0xb3')][_0x4b23('0x101')](db['ZendeskConfiguration'],{'as':_0x4b23('0x1a2'),'onDelete':'cascade','foreignKey':'AccountId'});db['ZendeskConfiguration']['hasMany'](db['ZendeskField'],{'as':_0x4b23('0x1a4'),'foreignKey':'SubjectId'});db[_0x4b23('0xb5')][_0x4b23('0x101')](db['ZendeskField'],{'as':_0x4b23('0x1a6'),'foreignKey':_0x4b23('0x1a7')});db[_0x4b23('0xb5')][_0x4b23('0x101')](db[_0x4b23('0xb6')],{'as':_0x4b23('0x1a0'),'foreignKey':_0x4b23('0x1a8')});db[_0x4b23('0xb5')][_0x4b23('0x10c')](db['ZendeskAccount'],{'as':_0x4b23('0x162'),'foreignKey':_0x4b23('0x1a3')});db[_0x4b23('0xb5')][_0x4b23('0x10d')](db[_0x4b23('0x8e')],{'through':'int_zendesk_configuration_has_tags'});db['ZendeskField'][_0x4b23('0x101')](db['ZendeskField'],{'as':_0x4b23('0x1a9'),'foreignKey':_0x4b23('0x1a5')});db[_0x4b23('0xb6')]['hasMany'](db[_0x4b23('0xb6')],{'as':_0x4b23('0x1aa'),'foreignKey':_0x4b23('0x1a7')});db[_0x4b23('0xb6')][_0x4b23('0x101')](db[_0x4b23('0xb6')],{'as':_0x4b23('0x1ab'),'foreignKey':_0x4b23('0x1a8')});db[_0x4b23('0xb6')][_0x4b23('0x10c')](db[_0x4b23('0x91')],{'as':'Variable','foreignKey':_0x4b23('0x1ac')});db[_0x4b23('0x1b3')]['hasMany'](db[_0x4b23('0x1b4')],{'as':_0x4b23('0x1a2'),'onDelete':_0x4b23('0xfe'),'foreignKey':_0x4b23('0x1a3')});db[_0x4b23('0x1b4')][_0x4b23('0x101')](db['FreshdeskField'],{'as':'Subjects','onDelete':_0x4b23('0xfe'),'foreignKey':_0x4b23('0x1a5')});db[_0x4b23('0x1b4')][_0x4b23('0x101')](db[_0x4b23('0xb8')],{'as':'Descriptions','onDelete':'cascade','foreignKey':'DescriptionId'});db[_0x4b23('0x1b4')][_0x4b23('0x101')](db[_0x4b23('0xb8')],{'as':_0x4b23('0x1a0'),'onDelete':_0x4b23('0xfe'),'foreignKey':'FieldId'});db['FreshdeskConfiguration'][_0x4b23('0x10c')](db[_0x4b23('0x1b3')],{'as':_0x4b23('0x162'),'foreignKey':_0x4b23('0x1a3')});db['FreshdeskConfiguration'][_0x4b23('0x10d')](db[_0x4b23('0x8e')],{'through':'int_freshdesk_configuration_has_tags'});db[_0x4b23('0xb8')][_0x4b23('0x101')](db[_0x4b23('0xb8')],{'as':_0x4b23('0x1a9'),'foreignKey':_0x4b23('0x1a5')});db['FreshdeskField'][_0x4b23('0x101')](db[_0x4b23('0xb8')],{'as':_0x4b23('0x1aa'),'foreignKey':_0x4b23('0x1a7')});db[_0x4b23('0xb8')][_0x4b23('0x101')](db[_0x4b23('0xb8')],{'as':_0x4b23('0x1ab'),'foreignKey':_0x4b23('0x1a8')});db[_0x4b23('0xb8')]['belongsTo'](db[_0x4b23('0x91')],{'as':_0x4b23('0x91'),'foreignKey':_0x4b23('0x1ac')});db[_0x4b23('0x1b5')][_0x4b23('0x101')](db[_0x4b23('0xbb')],{'as':_0x4b23('0x1a2'),'onDelete':_0x4b23('0xfe'),'foreignKey':_0x4b23('0x1a3')});db['VtigerConfiguration'][_0x4b23('0x101')](db[_0x4b23('0xbc')],{'as':'Subjects','foreignKey':_0x4b23('0x1a5')});db[_0x4b23('0xbb')][_0x4b23('0x101')](db[_0x4b23('0xbc')],{'as':_0x4b23('0x1a6'),'foreignKey':'DescriptionId'});db[_0x4b23('0xbb')][_0x4b23('0x101')](db['VtigerField'],{'as':'Fields','foreignKey':'FieldId'});db[_0x4b23('0xbb')]['belongsTo'](db[_0x4b23('0x1b5')],{'as':_0x4b23('0x162'),'foreignKey':_0x4b23('0x1a3')});db[_0x4b23('0xbc')][_0x4b23('0x101')](db[_0x4b23('0xbc')],{'as':'Subject','foreignKey':_0x4b23('0x1a5')});db[_0x4b23('0xbc')][_0x4b23('0x101')](db['VtigerField'],{'as':_0x4b23('0x1aa'),'foreignKey':_0x4b23('0x1a7')});db[_0x4b23('0xbc')][_0x4b23('0x101')](db['VtigerField'],{'as':_0x4b23('0x1ab'),'foreignKey':_0x4b23('0x1a8')});db[_0x4b23('0xbc')]['belongsTo'](db[_0x4b23('0x91')],{'as':'Variable','foreignKey':_0x4b23('0x1ac')});db['ServicenowAccount'][_0x4b23('0x101')](db['ServicenowConfiguration'],{'as':_0x4b23('0x1a2'),'onDelete':_0x4b23('0xfe'),'foreignKey':'AccountId'});db[_0x4b23('0x1b6')][_0x4b23('0x101')](db[_0x4b23('0xc1')],{'as':_0x4b23('0x1a4'),'foreignKey':_0x4b23('0x1a5')});db['ServicenowConfiguration'][_0x4b23('0x101')](db[_0x4b23('0xc1')],{'as':'Descriptions','foreignKey':_0x4b23('0x1a7')});db['ServicenowConfiguration'][_0x4b23('0x101')](db[_0x4b23('0xc1')],{'as':'Fields','foreignKey':_0x4b23('0x1a8')});db['ServicenowConfiguration']['belongsTo'](db[_0x4b23('0xbe')],{'as':_0x4b23('0x162'),'foreignKey':'AccountId'});db[_0x4b23('0xc1')]['hasMany'](db['ServicenowField'],{'as':'Subject','foreignKey':'SubjectId'});db['ServicenowField'][_0x4b23('0x101')](db[_0x4b23('0xc1')],{'as':'Description','foreignKey':'DescriptionId'});db[_0x4b23('0xc1')][_0x4b23('0x101')](db[_0x4b23('0xc1')],{'as':_0x4b23('0x1ab'),'foreignKey':_0x4b23('0x1a8')});db['ServicenowField'][_0x4b23('0x10c')](db['Variable'],{'as':_0x4b23('0x91'),'foreignKey':_0x4b23('0x1ac')});db[_0x4b23('0x1b7')][_0x4b23('0x101')](db[_0x4b23('0xc4')],{'as':_0x4b23('0x1a2'),'onDelete':_0x4b23('0xfe'),'foreignKey':_0x4b23('0x1a3')});db['Dynamics365Configuration'][_0x4b23('0x101')](db['Dynamics365Field'],{'as':'Subjects','onDelete':_0x4b23('0xfe'),'foreignKey':_0x4b23('0x1a5')});db[_0x4b23('0xc4')]['hasMany'](db['Dynamics365Field'],{'as':_0x4b23('0x1a6'),'onDelete':_0x4b23('0xfe'),'foreignKey':'DescriptionId'});db[_0x4b23('0xc4')][_0x4b23('0x101')](db[_0x4b23('0xc5')],{'as':_0x4b23('0x1a0'),'onDelete':'cascade','foreignKey':'FieldId'});db['Dynamics365Configuration']['belongsTo'](db[_0x4b23('0x1b7')],{'as':_0x4b23('0x162'),'foreignKey':_0x4b23('0x1a3')});db[_0x4b23('0xc5')][_0x4b23('0x101')](db[_0x4b23('0xc5')],{'as':_0x4b23('0x1a9'),'foreignKey':_0x4b23('0x1a5')});db[_0x4b23('0xc5')]['hasMany'](db[_0x4b23('0xc5')],{'as':_0x4b23('0x1aa'),'foreignKey':_0x4b23('0x1a7')});db[_0x4b23('0xc5')][_0x4b23('0x101')](db['Dynamics365Field'],{'as':'Field','foreignKey':_0x4b23('0x1a8')});db[_0x4b23('0xc5')]['belongsTo'](db[_0x4b23('0x91')],{'as':_0x4b23('0x91'),'foreignKey':_0x4b23('0x1ac')});db['FreshsalesAccount']['hasMany'](db[_0x4b23('0xc8')],{'as':'Configurations','onDelete':_0x4b23('0xfe'),'foreignKey':_0x4b23('0x1a3')});db[_0x4b23('0xc8')]['hasMany'](db[_0x4b23('0xca')],{'as':_0x4b23('0x1a4'),'foreignKey':'SubjectId'});db[_0x4b23('0xc8')][_0x4b23('0x101')](db[_0x4b23('0xca')],{'as':_0x4b23('0x1a6'),'foreignKey':_0x4b23('0x1a7')});db[_0x4b23('0xc8')][_0x4b23('0x101')](db[_0x4b23('0xca')],{'as':'Fields','foreignKey':'FieldId'});db['FreshsalesConfiguration']['belongsTo'](db[_0x4b23('0xc7')],{'as':_0x4b23('0x162'),'foreignKey':'AccountId'});db['FreshsalesField'][_0x4b23('0x101')](db[_0x4b23('0xca')],{'as':_0x4b23('0x1a9'),'foreignKey':'SubjectId'});db['FreshsalesField'][_0x4b23('0x101')](db[_0x4b23('0xca')],{'as':_0x4b23('0x1aa'),'foreignKey':_0x4b23('0x1a7')});db['FreshsalesField'][_0x4b23('0x101')](db['FreshsalesField'],{'as':'Field','foreignKey':_0x4b23('0x1a8')});db[_0x4b23('0xca')]['belongsTo'](db[_0x4b23('0x91')],{'as':_0x4b23('0x91'),'foreignKey':'VariableId'});db[_0x4b23('0xcc')][_0x4b23('0x10c')](db['ChatWebsite'],{});db['ChatQueueReport'][_0x4b23('0x10c')](db['CmList'],{'as':_0x4b23('0x14f'),'foreignKey':_0x4b23('0x15c')});db['ChatQueueReport'][_0x4b23('0x10c')](db['CmContact'],{'as':_0x4b23('0x146'),'foreignKey':_0x4b23('0x153')});db['ChatQueueReport'][_0x4b23('0x10c')](db['ChatInteraction'],{});db[_0x4b23('0xcc')][_0x4b23('0x10c')](db[_0x4b23('0x6d')],{});db[_0x4b23('0xcc')][_0x4b23('0x10c')](db[_0x4b23('0x14')],{});db[_0x4b23('0xcc')][_0x4b23('0x10c')](db['ChatQueue'],{});db[_0x4b23('0xce')][_0x4b23('0x10c')](db['User'],{'onDelete':'cascade','foreignKey':'FromId'});db[_0x4b23('0xce')][_0x4b23('0x10c')](db[_0x4b23('0x14')],{'onDelete':_0x4b23('0xfe'),'foreignKey':_0x4b23('0x1b8')});db['JscriptySessionReport'][_0x4b23('0x101')](db[_0x4b23('0x1b9')],{'foreignKey':_0x4b23('0x1ba'),'onDelete':_0x4b23('0xfe')});db['JscriptySessionReport'][_0x4b23('0x101')](db[_0x4b23('0xcf')],{'foreignKey':'SessionId','onDelete':_0x4b23('0xfe')});db[_0x4b23('0x1bb')][_0x4b23('0x10c')](db[_0x4b23('0x56')],{});db[_0x4b23('0x1bb')][_0x4b23('0x10c')](db[_0x4b23('0xea')],{'as':'List','foreignKey':_0x4b23('0x15c')});db[_0x4b23('0x1bb')][_0x4b23('0x10c')](db[_0x4b23('0x110')],{'as':_0x4b23('0x146'),'foreignKey':_0x4b23('0x153')});db[_0x4b23('0x1bb')][_0x4b23('0x10c')](db[_0x4b23('0x5a')],{});db['SmsQueueReport']['belongsTo'](db[_0x4b23('0x5c')],{});db[_0x4b23('0x1bb')][_0x4b23('0x10c')](db['User'],{});db[_0x4b23('0x1bb')][_0x4b23('0x10c')](db[_0x4b23('0x5e')],{});db[_0x4b23('0xd4')][_0x4b23('0x101')](db[_0x4b23('0x137')],{'foreignKey':_0x4b23('0x1bc')});db[_0x4b23('0xd4')][_0x4b23('0x101')](db[_0x4b23('0x1b9')],{'foreignKey':_0x4b23('0x1bc')});db[_0x4b23('0xd4')][_0x4b23('0x101')](db[_0x4b23('0xcf')],{'foreignKey':'ProjectId'});db[_0x4b23('0xd6')][_0x4b23('0x10d')](db[_0x4b23('0x14')],{'as':_0x4b23('0x16b'),'through':_0x4b23('0x12e')});db['Team'][_0x4b23('0x10d')](db['User'],{'as':_0x4b23('0x13d'),'through':_0x4b23('0x114')});db[_0x4b23('0xdb')]['belongsToMany'](db[_0x4b23('0x1e')],{'through':_0x4b23('0x1bd'),'as':_0x4b23('0x11b')});db[_0x4b23('0xdb')][_0x4b23('0x10d')](db[_0x4b23('0x40')],{'through':_0x4b23('0x1be'),'as':_0x4b23('0x11d')});db[_0x4b23('0xdb')][_0x4b23('0x10d')](db[_0x4b23('0x70')],{'through':_0x4b23('0x17d'),'as':'ChatQueues'});db[_0x4b23('0xdb')][_0x4b23('0x10d')](db[_0x4b23('0x53')],{'through':_0x4b23('0x167'),'as':_0x4b23('0x11e')});db[_0x4b23('0xdb')]['belongsToMany'](db[_0x4b23('0x5e')],{'through':'team_has_sms_queues','as':_0x4b23('0x120')});db[_0x4b23('0xdb')]['belongsToMany'](db[_0x4b23('0x67')],{'through':_0x4b23('0x173'),'as':_0x4b23('0x121')});db['Team'][_0x4b23('0x10d')](db[_0x4b23('0xfa')],{'through':_0x4b23('0x1bf'),'as':_0x4b23('0x123')});db['Campaign'][_0x4b23('0x101')](db[_0x4b23('0x76')],{'as':_0x4b23('0x136'),'foreignKey':_0x4b23('0x186')});db[_0x4b23('0x185')][_0x4b23('0x101')](db['CmHopperFinal'],{'as':_0x4b23('0x103'),'foreignKey':'CampaignId'});db[_0x4b23('0x185')]['hasMany'](db[_0x4b23('0x7b')],{'as':_0x4b23('0x182'),'foreignKey':_0x4b23('0x186')});db[_0x4b23('0x185')][_0x4b23('0x101')](db[_0x4b23('0x78')],{'as':'HopperBlacks','foreignKey':_0x4b23('0x186')});db['Campaign'][_0x4b23('0x10c')](db[_0x4b23('0x2d')],{'as':_0x4b23('0x2d'),'foreignKey':_0x4b23('0x139')});db[_0x4b23('0x185')][_0x4b23('0x10c')](db[_0x4b23('0x2d')],{'as':_0x4b23('0x1c0'),'foreignKey':_0x4b23('0x13a')});db[_0x4b23('0x185')][_0x4b23('0x10c')](db[_0x4b23('0x88')],{'as':_0x4b23('0x88'),'foreignKey':_0x4b23('0x15a')});db[_0x4b23('0x185')][_0x4b23('0x10c')](db[_0x4b23('0xd6')],{'as':_0x4b23('0xd6'),'foreignKey':'SquareProjectId'});db[_0x4b23('0x185')]['belongsToMany'](db[_0x4b23('0xea')],{'as':'Lists','through':'campaigns_has_cm_lists'});db[_0x4b23('0x185')][_0x4b23('0x10d')](db['CmList'],{'as':'BlackLists','through':_0x4b23('0x1c1')});db[_0x4b23('0x1c2')]['belongsTo'](db['MailMessage'],{});db['MailTransferReport'][_0x4b23('0x10c')](db[_0x4b23('0x43')],{});db[_0x4b23('0x1c2')][_0x4b23('0x10c')](db[_0x4b23('0x3e')],{'foreignKey':_0x4b23('0x1c3'),'as':_0x4b23('0x1c4')});db['MailTransferReport'][_0x4b23('0x10c')](db[_0x4b23('0x14')],{'foreignKey':_0x4b23('0x1c5'),'as':_0x4b23('0x1c6')});db[_0x4b23('0x1c2')]['belongsTo'](db['User'],{'foreignKey':'ToUserId','as':'ToAgent'});db[_0x4b23('0x1c2')][_0x4b23('0x10c')](db['MailQueue'],{'foreignKey':_0x4b23('0x1c7'),'as':_0x4b23('0x1c8')});db[_0x4b23('0x1c2')][_0x4b23('0x10c')](db[_0x4b23('0x3e')],{'foreignKey':_0x4b23('0x1c9'),'as':'ToAccount'});db[_0x4b23('0xe3')]['belongsTo'](db[_0x4b23('0x6d')],{});db[_0x4b23('0xe3')][_0x4b23('0x10c')](db[_0x4b23('0x176')],{});db['ChatTransferReport'][_0x4b23('0x10c')](db['ChatWebsite'],{'foreignKey':_0x4b23('0x1ca'),'as':'FromAccount'});db[_0x4b23('0xe3')][_0x4b23('0x10c')](db[_0x4b23('0x14')],{'foreignKey':'FromUserId','as':_0x4b23('0x1c6')});db[_0x4b23('0xe3')][_0x4b23('0x10c')](db['User'],{'foreignKey':_0x4b23('0x1cb'),'as':'ToAgent'});db[_0x4b23('0xe3')][_0x4b23('0x10c')](db[_0x4b23('0x70')],{'foreignKey':'ToChatQueueId','as':_0x4b23('0x1c8')});db[_0x4b23('0xe3')][_0x4b23('0x10c')](db['ChatWebsite'],{'foreignKey':'ToChatWebsiteId','as':'ToAccount'});db['FaxTransferReport'][_0x4b23('0x10c')](db[_0x4b23('0x51')],{});db[_0x4b23('0xe5')]['belongsTo'](db[_0x4b23('0x50')],{});db[_0x4b23('0xe5')][_0x4b23('0x10c')](db[_0x4b23('0x4d')],{'foreignKey':_0x4b23('0x1cc'),'as':_0x4b23('0x1c4')});db[_0x4b23('0xe5')][_0x4b23('0x10c')](db[_0x4b23('0x14')],{'foreignKey':'FromUserId','as':_0x4b23('0x1c6')});db[_0x4b23('0xe5')][_0x4b23('0x10c')](db['User'],{'foreignKey':_0x4b23('0x1cb'),'as':'ToAgent'});db['FaxTransferReport'][_0x4b23('0x10c')](db[_0x4b23('0x53')],{'foreignKey':_0x4b23('0x1cd'),'as':_0x4b23('0x1c8')});db[_0x4b23('0xe5')][_0x4b23('0x10c')](db[_0x4b23('0x4d')],{'foreignKey':'ToFaxAccountId','as':'ToAccount'});db[_0x4b23('0xe6')][_0x4b23('0x10c')](db[_0x4b23('0x65')],{});db[_0x4b23('0xe6')]['belongsTo'](db['OpenchannelInteraction'],{});db[_0x4b23('0xe6')]['belongsTo'](db[_0x4b23('0x5f')],{'foreignKey':'FromOpenchannelAccountId','as':_0x4b23('0x1c4')});db['OpenchannelTransferReport']['belongsTo'](db[_0x4b23('0x14')],{'foreignKey':_0x4b23('0x1c5'),'as':'FromAgent'});db[_0x4b23('0xe6')][_0x4b23('0x10c')](db['User'],{'foreignKey':_0x4b23('0x1cb'),'as':'ToAgent'});db['OpenchannelTransferReport'][_0x4b23('0x10c')](db['OpenchannelQueue'],{'foreignKey':_0x4b23('0x1ce'),'as':_0x4b23('0x1c8')});db[_0x4b23('0xe6')][_0x4b23('0x10c')](db[_0x4b23('0x5f')],{'foreignKey':'ToOpenchannelAccountId','as':_0x4b23('0x1cf')});db[_0x4b23('0xe8')][_0x4b23('0x10c')](db[_0x4b23('0x5c')],{});db[_0x4b23('0xe8')]['belongsTo'](db[_0x4b23('0x5a')],{});db[_0x4b23('0xe8')][_0x4b23('0x10c')](db[_0x4b23('0x56')],{'foreignKey':_0x4b23('0x1d0'),'as':'FromAccount'});db['SmsTransferReport'][_0x4b23('0x10c')](db[_0x4b23('0x14')],{'foreignKey':'FromUserId','as':_0x4b23('0x1c6')});db[_0x4b23('0xe8')][_0x4b23('0x10c')](db[_0x4b23('0x14')],{'foreignKey':_0x4b23('0x1cb'),'as':'ToAgent'});db[_0x4b23('0xe8')][_0x4b23('0x10c')](db[_0x4b23('0x5e')],{'foreignKey':_0x4b23('0x1d1'),'as':_0x4b23('0x1c8')});db['SmsTransferReport']['belongsTo'](db[_0x4b23('0x56')],{'foreignKey':_0x4b23('0x1d2'),'as':_0x4b23('0x1cf')});db[_0x4b23('0xea')][_0x4b23('0x101')](db[_0x4b23('0x85')],{'as':_0x4b23('0x14b'),'foreignKey':_0x4b23('0x15c')});db['CmList'][_0x4b23('0x101')](db[_0x4b23('0x7f')],{'as':_0x4b23('0x1d3'),'foreignKey':_0x4b23('0x15c')});db[_0x4b23('0xea')][_0x4b23('0x101')](db[_0x4b23('0x110')],{'as':_0x4b23('0x180'),'onDelete':'cascade','foreignKey':'ListId'});db['CmList'][_0x4b23('0x101')](db[_0x4b23('0x7a')],{'as':_0x4b23('0x103'),'foreignKey':'ListId'});db[_0x4b23('0xea')]['hasMany'](db[_0x4b23('0x7b')],{'as':_0x4b23('0x104'),'foreignKey':_0x4b23('0x15c')});db[_0x4b23('0xea')][_0x4b23('0x101')](db['ReportAgentPreview'],{'as':'ReportAgentPreview','foreignKey':_0x4b23('0x15c')});db[_0x4b23('0xea')][_0x4b23('0x10d')](db['VoiceQueue'],{'as':_0x4b23('0x1d4'),'through':_0x4b23('0x13c')});db[_0x4b23('0xea')]['belongsToMany'](db['User'],{'as':_0x4b23('0x13d'),'through':_0x4b23('0x113')});db[_0x4b23('0x124')][_0x4b23('0x101')](db[_0x4b23('0x1b')],{'as':_0x4b23('0x102'),'onDelete':_0x4b23('0xfe')});db[_0x4b23('0x124')][_0x4b23('0x10d')](db[_0x4b23('0x14')],{'as':_0x4b23('0x13d'),'through':_0x4b23('0x1d5')});db['UserProfile']['hasMany'](db['User'],{'as':'Users','foreignKey':_0x4b23('0x1d6')});db[_0x4b23('0xed')][_0x4b23('0x101')](db[_0x4b23('0x1d7')],{'as':_0x4b23('0x1d8'),'foreignKey':_0x4b23('0x1d6'),'onDelete':_0x4b23('0xfe')});db[_0x4b23('0x1d7')][_0x4b23('0x101')](db[_0x4b23('0xef')],{'as':_0x4b23('0x1d9'),'foreignKey':_0x4b23('0x1da'),'onDelete':_0x4b23('0xfe')});db[_0x4b23('0x1db')][_0x4b23('0x101')](db[_0x4b23('0x85')],{'as':_0x4b23('0x14b'),'foreignKey':'WhatsappAccountId'});db['WhatsappAccount'][_0x4b23('0x101')](db['CannedAnswer'],{'as':_0x4b23('0x14c'),'foreignKey':_0x4b23('0x1dc')});db['WhatsappAccount'][_0x4b23('0x101')](db['WhatsappMessage'],{'as':_0x4b23('0x140'),'foreignKey':_0x4b23('0x1dc')});db[_0x4b23('0x1db')][_0x4b23('0x101')](db[_0x4b23('0xf3')],{'as':_0x4b23('0x14e')});db[_0x4b23('0x1db')]['hasMany'](db[_0x4b23('0xf2')],{'as':_0x4b23('0x131')});db['WhatsappAccount'][_0x4b23('0x10c')](db[_0x4b23('0xea')],{'as':_0x4b23('0x14f'),'foreignKey':_0x4b23('0x15c')});db[_0x4b23('0x1db')]['belongsTo'](db[_0x4b23('0x151')],{'as':_0x4b23('0x152'),'foreignKey':_0x4b23('0x13b')});db[_0x4b23('0x1db')][_0x4b23('0x10d')](db[_0x4b23('0x14')],{'as':_0x4b23('0x13d'),'through':'user_has_whatsapp_accounts'});db[_0x4b23('0xf2')][_0x4b23('0x10c')](db['User'],{'onDelete':'restrict'});db[_0x4b23('0xf2')][_0x4b23('0x10c')](db[_0x4b23('0xfa')],{'onDelete':_0x4b23('0x159')});db['WhatsappApplication'][_0x4b23('0x10c')](db[_0x4b23('0x1db')],{'onDelete':_0x4b23('0x159')});db['WhatsappApplication']['belongsTo'](db[_0x4b23('0x88')],{'onDelete':_0x4b23('0x159'),'foreignKey':_0x4b23('0x15a')});db['WhatsappApplication'][_0x4b23('0x10c')](db[_0x4b23('0x8e')],{'onDelete':_0x4b23('0x159'),'foreignKey':_0x4b23('0x15b')});db[_0x4b23('0xf3')]['hasMany'](db[_0x4b23('0xf5')],{'as':_0x4b23('0x140'),'onDelete':_0x4b23('0xfe'),'foreignKey':_0x4b23('0x1dd')});db[_0x4b23('0xf3')]['belongsTo'](db[_0x4b23('0x1db')],{'as':_0x4b23('0x162'),'foreignKey':_0x4b23('0x1dc')});db[_0x4b23('0xf3')][_0x4b23('0x10c')](db[_0x4b23('0x110')],{'as':_0x4b23('0x146'),'foreignKey':_0x4b23('0x153')});db[_0x4b23('0xf3')][_0x4b23('0x10c')](db[_0x4b23('0x14')],{'as':_0x4b23('0x154'),'foreignKey':_0x4b23('0x100')});db['WhatsappInteraction'][_0x4b23('0x10d')](db[_0x4b23('0x8e')],{'through':'whatsapp_interaction_has_tags','as':_0x4b23('0x163')});db[_0x4b23('0xf3')][_0x4b23('0x10d')](db[_0x4b23('0x8e')],{'through':_0x4b23('0x198'),'as':_0x4b23('0x156')});db[_0x4b23('0xf3')][_0x4b23('0x10d')](db[_0x4b23('0x14')],{'as':_0x4b23('0x16b'),'through':_0x4b23('0x11a'),'foreignKey':_0x4b23('0x1dd')});db[_0x4b23('0xf5')][_0x4b23('0x10c')](db['User'],{'as':_0x4b23('0x14')});db[_0x4b23('0xf5')][_0x4b23('0x10c')](db['CmContact'],{'onDelete':_0x4b23('0xfe'),'as':_0x4b23('0x146')});db[_0x4b23('0xf5')]['belongsTo'](db[_0x4b23('0xf3')],{'onDelete':_0x4b23('0xfe'),'as':_0x4b23('0x165'),'foreignKey':'WhatsappInteractionId'});db[_0x4b23('0xf5')][_0x4b23('0x10c')](db[_0x4b23('0x1db')],{'as':_0x4b23('0x162'),'foreignKey':_0x4b23('0x1dc')});db[_0x4b23('0xf7')][_0x4b23('0x10c')](db[_0x4b23('0x1db')],{});db[_0x4b23('0xf7')][_0x4b23('0x10c')](db[_0x4b23('0xea')],{'as':_0x4b23('0x14f'),'foreignKey':'ListId'});db['WhatsappQueueReport'][_0x4b23('0x10c')](db[_0x4b23('0x110')],{'as':_0x4b23('0x146'),'foreignKey':_0x4b23('0x153')});db[_0x4b23('0xf7')][_0x4b23('0x10c')](db[_0x4b23('0xf3')],{});db[_0x4b23('0xf7')]['belongsTo'](db['WhatsappQueue'],{});db['WhatsappQueueReport'][_0x4b23('0x10c')](db['WhatsappMessage'],{});db[_0x4b23('0xf7')]['belongsTo'](db[_0x4b23('0x14')],{});db[_0x4b23('0x1de')]['belongsTo'](db[_0x4b23('0xf5')],{});db['WhatsappTransferReport'][_0x4b23('0x10c')](db[_0x4b23('0xf3')],{});db['WhatsappTransferReport'][_0x4b23('0x10c')](db['WhatsappAccount'],{'foreignKey':_0x4b23('0x1df'),'as':_0x4b23('0x1c4')});db['WhatsappTransferReport'][_0x4b23('0x10c')](db[_0x4b23('0x1db')],{'foreignKey':_0x4b23('0x1e0'),'as':_0x4b23('0x1cf')});db[_0x4b23('0x1de')]['belongsTo'](db[_0x4b23('0xfa')],{'foreignKey':_0x4b23('0x1e1'),'as':'ToQueue'});db[_0x4b23('0x1de')][_0x4b23('0x10c')](db[_0x4b23('0x14')],{'foreignKey':'FromUserId','as':_0x4b23('0x1c6')});db[_0x4b23('0x1de')][_0x4b23('0x10c')](db[_0x4b23('0x14')],{'foreignKey':_0x4b23('0x1cb'),'as':_0x4b23('0x1e2')});db['WhatsappQueue']['belongsToMany'](db[_0x4b23('0x14')],{'as':_0x4b23('0x13d'),'through':_0x4b23('0x39'),'foreignKey':_0x4b23('0x1e3')});db[_0x4b23('0xfa')][_0x4b23('0x10d')](db['Team'],{'through':_0x4b23('0x1bf'),'as':_0x4b23('0x13e')});module['exports']={'db':db,'dbH':dbH};
\ No newline at end of file
diff --git a/server/routes.js b/server/routes.js
index 052b2c6..ebf28b8 100644
--- a/server/routes.js
+++ b/server/routes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x83ed=['./api/cdr','/api/schedules','./api/schedule','./api/tag','/api/templates','./api/template','/api/triggers','/api/variables','./api/variable','/api/integrations','/api/integrations/reports','./api/integrationReport','/api/analytics/custom_reports','./api/analyticCustomReport','/api/analytics/default_reports','./api/analyticDefaultReport','./api/analyticExtractedReport','/api/analytics/metrics','./api/analyticMetric','/api/analytics/field_reports','./api/analyticFieldReport','/api/analytics/tree_reports','./api/analyticTreeReport','/api/integrations/salesforce/accounts','./api/intSalesforceAccount','./api/intSalesforceConfiguration','/api/integrations/salesforce/fields','./api/intSalesforceField','/api/integrations/sugarcrm/accounts','./api/intSugarcrmAccount','/api/integrations/sugarcrm/configurations','/api/integrations/sugarcrm/fields','./api/intSugarcrmField','/api/integrations/desk/accounts','./api/intDeskAccount','./api/intDeskConfiguration','./api/intDeskField','./api/intZohoAccount','/api/integrations/zoho/configurations','./api/intZohoConfiguration','./api/intZohoField','/api/integrations/zendesk/accounts','/api/integrations/zendesk/configurations','./api/intZendeskConfiguration','./api/intZendeskField','/api/integrations/freshdesk/accounts','./api/intFreshdeskAccount','/api/integrations/freshdesk/configurations','/api/integrations/freshdesk/fields','/api/integrations/vtiger/accounts','./api/intVtigerAccount','./api/intVtigerField','/api/integrations/servicenow/accounts','./api/intServicenowAccount','/api/integrations/servicenow/configurations','./api/intServicenowConfiguration','/api/integrations/servicenow/fields','./api/intServicenowField','/api/integrations/dynamics365/accounts','./api/intDynamics365Account','/api/integrations/dynamics365/fields','./api/intDynamics365Field','/api/integrations/freshsales/accounts','./api/intFreshsalesAccount','/api/integrations/freshsales/configurations','./api/intFreshsalesConfiguration','./api/intFreshsalesField','/api/networks','./api/network','/api/chat/reports/queue','/api/chat/internal/messages','/api/jscripty/answers/reports','./api/jscriptyAnswerReport','/api/jscripty/questions/reports','./api/jscriptyQuestionReport','/api/jscripty/sessions/reports','./api/jscriptySessionReport','/api/sms/reports/queue','./api/smsQueueReport','/api/square/reports','/api/square/details/reports','/api/jscripty/projects','./api/jscriptyProject','./api/squareOdbc','./api/squareProject','./api/squareRecording','/api/square/messages','./api/squareMessage','/api/teams','./api/team','/api/license','/api/campaigns','./api/campaign','/api/migrations','./api/migration','/api/attachments','./api/attachment','./api/plugin','./api/mailTransferReport','/api/chat/reports/transfer','./api/chatTransferReport','/api/fax/reports/transfer','/api/openchannel/reports/transfer','./api/openchannelTransferReport','./api/smsTransferReport','/api/cm/lists','./api/cmList','./api/voicePrefix','./api/userProfile','/api/userProfile/sections','./api/userProfileResource','./api/notification','/api/whatsapp/accounts','./api/whatsappAccount','./api/whatsappApplication','/api/whatsapp/interactions','./api/whatsappInteraction','/api/whatsapp/messages','/api/whatsapp/reports/queue','./api/whatsappQueueReport','/api/whatsapp/reports/transfer','./api/whatsappTransferReport','/api/whatsapp/queues','/api/cloudProviders','./api/cloudProvider','/api/auth/local','./api/authLocal','/api/auth/google','./api/authGoogle','/api/jira','./api/jira','/api/rpc','./api/rpc','/api/version','./api/version','/api/system','./api/system','/api/pm2','./api/pm2','./api/webbar','/apidoc','static','join','root','/www','/demo','snippet','1.0.16','/plugins','/server/files/plugins','get','sendFile','resolve','appPath','/index.html','express','util','./config/environment','./config/logger','api','default','use','logger','headers','x-forwarded-for','remoteAddress','url','statusCode','responseTime','user','role','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s','body','device','agent_id','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s\x20(id=%s\x20name=%s)','format','method','name','other','agent_name','test','/api/users','./api/user','/api/voice/chanspy','./api/voiceChanSpy','/api/voice/contexts','./api/voiceContext','/api/voice/extensions','/api/voice/mohs','/api/voice/recordings','./api/voiceRecording','./api/screenRecording','./api/voiceMail','/api/voice/mails/messages','./api/voiceMailMessage','/api/voice/calls/reports','./api/voiceCallReport','/api/voice/dials/reports','./api/voiceDialReport','/api/voice/agents/reports','./api/voiceAgentReport','/api/voice/queues/reports','./api/memberReport','/api/trunks','./api/trunk','./api/voiceTransferReport','/api/mail/out_servers','/api/mail/accounts','./api/mailAccount','/api/mail/queues','/api/mail/substatuses','/api/mail/interactions','./api/mailInteraction','/api/mail/messages','./api/mailMessage','/api/mail/applications','./api/mailApplication','/api/mail/reports/queue','./api/mailQueueReport','/api/dashboards','./api/dashboard','/api/dashboards/items','./api/dashboardItem','/api/fax/accounts','./api/faxAccount','/api/fax/applications','./api/faxApplication','./api/faxInteraction','./api/faxMessage','./api/faxQueue','/api/fax/reports/queue','./api/faxQueueReport','/api/sms/accounts','./api/smsAccount','./api/smsApplication','/api/sms/interactions','./api/smsInteraction','/api/sms/messages','./api/smsMessage','/api/sms/queues','./api/smsQueue','./api/openchannelAccount','/api/openchannel/applications','./api/openchannelApplication','./api/openchannelInteraction','/api/openchannel/messages','./api/openchannelMessage','/api/openchannel/queues','./api/openchannelQueue','./api/chatWebsite','/api/openchannel/reports/queue','./api/chatApplication','/api/chat/interactions','./api/chatInteraction','./api/chatMessage','./api/chatOfflineMessage','/api/chat/queues','./api/chatQueue','/api/chat/groups','./api/chatGroup','/api/chat/proactive_actions','./api/chatProactiveAction','./api/cmCompany','/api/cm/contacts','./api/cmContact','/api/cm/hopper','./api/cmHopper','/api/cm/hopper_black','./api/cmHopperBlack','./api/cmHopperFinal','/api/cm/hopper_history','./api/cmHopperHistory','./api/cmCustomField','/api/automations','./api/automation','/api/canned_answers','./api/cannedAnswer','/api/dispositions','./api/condition','/api/intervals','./api/interval','/api/pauses','./api/pause','/api/cdr'];(function(_0x12f4af,_0x4a2bb9){var _0x4c4d50=function(_0x25a7f7){while(--_0x25a7f7){_0x12f4af['push'](_0x12f4af['shift']());}};_0x4c4d50(++_0x4a2bb9);}(_0x83ed,0x1b8));var _0xd83e=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x83ed[_0x1facfa];return _0x9ec701;};'use strict';var path=require('path');var express=require(_0xd83e('0x0'));var ewinston=require('express-winston');var util=require(_0xd83e('0x1'));var errors=require('./errors');var config=require(_0xd83e('0x2'));var logger=require(_0xd83e('0x3'))(_0xd83e('0x4'));var authLogger=require(_0xd83e('0x3'))('auth');exports[_0xd83e('0x5')]=function(_0x125f19){_0x125f19[_0xd83e('0x6')](ewinston[_0xd83e('0x7')]({'winstonInstance':logger,'meta':![],'statusLevels':!![],'msg':function(_0x202b85,_0x3677a4){return util['format']('%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s',_0x202b85['method'],_0x202b85[_0xd83e('0x8')][_0xd83e('0x9')]?_0x202b85[_0xd83e('0x8')][_0xd83e('0x9')]:_0x202b85['connection'][_0xd83e('0xa')]||_0x202b85['ip'],_0x202b85[_0xd83e('0xb')],_0x3677a4[_0xd83e('0xc')],_0x3677a4[_0xd83e('0xd')],_0x202b85['user']?_0x202b85[_0xd83e('0xe')]['id']:null,_0x202b85[_0xd83e('0xe')]?_0x202b85[_0xd83e('0xe')]['name']:null,_0x202b85[_0xd83e('0xe')]?_0x202b85[_0xd83e('0xe')][_0xd83e('0xf')]:null);}}));_0x125f19[_0xd83e('0x6')](ewinston['logger']({'winstonInstance':authLogger,'meta':![],'statusLevels':!![],'msg':function(_0x33975b,_0x17beff){var _0x514712=_0xd83e('0x10');if(_0x33975b[_0xd83e('0x11')]&&_0x33975b[_0xd83e('0x11')][_0xd83e('0x12')]&&_0x33975b[_0xd83e('0x11')][_0xd83e('0x13')]){_0x514712=_0xd83e('0x14');}return util[_0xd83e('0x15')](_0x514712,_0x33975b[_0xd83e('0x16')],_0x33975b[_0xd83e('0x8')][_0xd83e('0x9')]?_0x33975b[_0xd83e('0x8')][_0xd83e('0x9')]:_0x33975b['connection']['remoteAddress']||_0x33975b['ip'],_0x33975b['url'],_0x17beff[_0xd83e('0xc')],_0x17beff[_0xd83e('0xd')],_0x33975b['user']?_0x33975b[_0xd83e('0xe')]['id']:null,_0x33975b['user']?_0x33975b[_0xd83e('0xe')][_0xd83e('0x17')]:null,_0x33975b[_0xd83e('0xe')]?_0x33975b[_0xd83e('0xe')]['role']:null,_0x33975b[_0xd83e('0x11')]&&_0x33975b['body'][_0xd83e('0x12')]?_0x33975b[_0xd83e('0x11')][_0xd83e('0x12')]:_0xd83e('0x18'),_0x33975b[_0xd83e('0x11')]&&_0x33975b['body']['agent_id']?_0x33975b['body']['agent_id']:'',_0x33975b['body']&&_0x33975b[_0xd83e('0x11')]['agent_name']?_0x33975b[_0xd83e('0x11')][_0xd83e('0x19')]:'');},'ignoreRoute':function(_0x531822){var _0x2867ed=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x2867ed[_0xd83e('0x1a')](_0x531822[_0xd83e('0xb')]);}}));_0x125f19[_0xd83e('0x6')](_0xd83e('0x1b'),require(_0xd83e('0x1c')));_0x125f19[_0xd83e('0x6')](_0xd83e('0x1d'),require(_0xd83e('0x1e')));_0x125f19[_0xd83e('0x6')](_0xd83e('0x1f'),require(_0xd83e('0x20')));_0x125f19[_0xd83e('0x6')](_0xd83e('0x21'),require('./api/voiceExtension'));_0x125f19['use'](_0xd83e('0x22'),require('./api/voiceMusicOnHold'));_0x125f19[_0xd83e('0x6')]('/api/voice/queues',require('./api/voiceQueue'));_0x125f19['use'](_0xd83e('0x23'),require(_0xd83e('0x24')));_0x125f19[_0xd83e('0x6')]('/api/screen/recordings',require(_0xd83e('0x25')));_0x125f19[_0xd83e('0x6')]('/api/voice/mails',require(_0xd83e('0x26')));_0x125f19['use'](_0xd83e('0x27'),require(_0xd83e('0x28')));_0x125f19[_0xd83e('0x6')](_0xd83e('0x29'),require(_0xd83e('0x2a')));_0x125f19[_0xd83e('0x6')](_0xd83e('0x2b'),require(_0xd83e('0x2c')));_0x125f19[_0xd83e('0x6')](_0xd83e('0x2d'),require(_0xd83e('0x2e')));_0x125f19[_0xd83e('0x6')](_0xd83e('0x2f'),require('./api/voiceQueueReport'));_0x125f19[_0xd83e('0x6')]('/api/members/reports',require(_0xd83e('0x30')));_0x125f19[_0xd83e('0x6')](_0xd83e('0x31'),require(_0xd83e('0x32')));_0x125f19[_0xd83e('0x6')]('/api/voice/transfers/reports',require(_0xd83e('0x33')));_0x125f19['use'](_0xd83e('0x34'),require('./api/mailServerOut'));_0x125f19[_0xd83e('0x6')](_0xd83e('0x35'),require(_0xd83e('0x36')));_0x125f19[_0xd83e('0x6')](_0xd83e('0x37'),require('./api/mailQueue'));_0x125f19[_0xd83e('0x6')](_0xd83e('0x38'),require('./api/mailSubstatus'));_0x125f19[_0xd83e('0x6')](_0xd83e('0x39'),require(_0xd83e('0x3a')));_0x125f19['use'](_0xd83e('0x3b'),require(_0xd83e('0x3c')));_0x125f19[_0xd83e('0x6')](_0xd83e('0x3d'),require(_0xd83e('0x3e')));_0x125f19[_0xd83e('0x6')](_0xd83e('0x3f'),require(_0xd83e('0x40')));_0x125f19[_0xd83e('0x6')](_0xd83e('0x41'),require(_0xd83e('0x42')));_0x125f19[_0xd83e('0x6')](_0xd83e('0x43'),require(_0xd83e('0x44')));_0x125f19[_0xd83e('0x6')](_0xd83e('0x45'),require(_0xd83e('0x46')));_0x125f19[_0xd83e('0x6')](_0xd83e('0x47'),require(_0xd83e('0x48')));_0x125f19['use']('/api/fax/interactions',require(_0xd83e('0x49')));_0x125f19[_0xd83e('0x6')]('/api/fax/messages',require(_0xd83e('0x4a')));_0x125f19[_0xd83e('0x6')]('/api/fax/queues',require(_0xd83e('0x4b')));_0x125f19[_0xd83e('0x6')](_0xd83e('0x4c'),require(_0xd83e('0x4d')));_0x125f19[_0xd83e('0x6')](_0xd83e('0x4e'),require(_0xd83e('0x4f')));_0x125f19[_0xd83e('0x6')]('/api/sms/applications',require(_0xd83e('0x50')));_0x125f19[_0xd83e('0x6')](_0xd83e('0x51'),require(_0xd83e('0x52')));_0x125f19['use'](_0xd83e('0x53'),require(_0xd83e('0x54')));_0x125f19[_0xd83e('0x6')](_0xd83e('0x55'),require(_0xd83e('0x56')));_0x125f19['use']('/api/openchannel/accounts',require(_0xd83e('0x57')));_0x125f19[_0xd83e('0x6')](_0xd83e('0x58'),require(_0xd83e('0x59')));_0x125f19[_0xd83e('0x6')]('/api/openchannel/interactions',require(_0xd83e('0x5a')));_0x125f19[_0xd83e('0x6')](_0xd83e('0x5b'),require(_0xd83e('0x5c')));_0x125f19[_0xd83e('0x6')](_0xd83e('0x5d'),require(_0xd83e('0x5e')));_0x125f19[_0xd83e('0x6')]('/api/chat/websites',require(_0xd83e('0x5f')));_0x125f19[_0xd83e('0x6')](_0xd83e('0x60'),require('./api/openchannelQueueReport'));_0x125f19[_0xd83e('0x6')]('/api/chat/applications',require(_0xd83e('0x61')));_0x125f19['use'](_0xd83e('0x62'),require(_0xd83e('0x63')));_0x125f19[_0xd83e('0x6')]('/api/chat/messages',require(_0xd83e('0x64')));_0x125f19['use']('/api/chat/offline_messages',require(_0xd83e('0x65')));_0x125f19['use'](_0xd83e('0x66'),require(_0xd83e('0x67')));_0x125f19[_0xd83e('0x6')](_0xd83e('0x68'),require(_0xd83e('0x69')));_0x125f19[_0xd83e('0x6')](_0xd83e('0x6a'),require(_0xd83e('0x6b')));_0x125f19[_0xd83e('0x6')]('/api/cm/companies',require(_0xd83e('0x6c')));_0x125f19[_0xd83e('0x6')](_0xd83e('0x6d'),require(_0xd83e('0x6e')));_0x125f19['use'](_0xd83e('0x6f'),require(_0xd83e('0x70')));_0x125f19[_0xd83e('0x6')](_0xd83e('0x71'),require(_0xd83e('0x72')));_0x125f19[_0xd83e('0x6')]('/api/cm/hopper_final',require(_0xd83e('0x73')));_0x125f19[_0xd83e('0x6')](_0xd83e('0x74'),require(_0xd83e('0x75')));_0x125f19[_0xd83e('0x6')]('/api/cm/custom_fields',require(_0xd83e('0x76')));_0x125f19['use']('/api/actions',require('./api/action'));_0x125f19['use'](_0xd83e('0x77'),require(_0xd83e('0x78')));_0x125f19[_0xd83e('0x6')](_0xd83e('0x79'),require(_0xd83e('0x7a')));_0x125f19['use'](_0xd83e('0x7b'),require('./api/disposition'));_0x125f19['use']('/api/conditions',require(_0xd83e('0x7c')));_0x125f19[_0xd83e('0x6')](_0xd83e('0x7d'),require(_0xd83e('0x7e')));_0x125f19[_0xd83e('0x6')](_0xd83e('0x7f'),require(_0xd83e('0x80')));_0x125f19[_0xd83e('0x6')](_0xd83e('0x81'),require(_0xd83e('0x82')));_0x125f19[_0xd83e('0x6')]('/api/voiceQueuesLog',require('./api/voiceQueuesLog'));_0x125f19[_0xd83e('0x6')](_0xd83e('0x83'),require(_0xd83e('0x84')));_0x125f19[_0xd83e('0x6')]('/api/sounds',require('./api/sound'));_0x125f19[_0xd83e('0x6')]('/api/tags',require(_0xd83e('0x85')));_0x125f19[_0xd83e('0x6')](_0xd83e('0x86'),require(_0xd83e('0x87')));_0x125f19[_0xd83e('0x6')](_0xd83e('0x88'),require('./api/trigger'));_0x125f19[_0xd83e('0x6')](_0xd83e('0x89'),require(_0xd83e('0x8a')));_0x125f19[_0xd83e('0x6')](_0xd83e('0x8b'),require('./api/integration'));_0x125f19[_0xd83e('0x6')](_0xd83e('0x8c'),require(_0xd83e('0x8d')));_0x125f19[_0xd83e('0x6')](_0xd83e('0x8e'),require(_0xd83e('0x8f')));_0x125f19[_0xd83e('0x6')](_0xd83e('0x90'),require(_0xd83e('0x91')));_0x125f19[_0xd83e('0x6')]('/api/analytics/extracted_reports',require(_0xd83e('0x92')));_0x125f19[_0xd83e('0x6')](_0xd83e('0x93'),require(_0xd83e('0x94')));_0x125f19['use'](_0xd83e('0x95'),require(_0xd83e('0x96')));_0x125f19['use'](_0xd83e('0x97'),require(_0xd83e('0x98')));_0x125f19['use'](_0xd83e('0x99'),require(_0xd83e('0x9a')));_0x125f19['use']('/api/integrations/salesforce/configurations',require(_0xd83e('0x9b')));_0x125f19[_0xd83e('0x6')](_0xd83e('0x9c'),require(_0xd83e('0x9d')));_0x125f19['use'](_0xd83e('0x9e'),require(_0xd83e('0x9f')));_0x125f19[_0xd83e('0x6')](_0xd83e('0xa0'),require('./api/intSugarcrmConfiguration'));_0x125f19[_0xd83e('0x6')](_0xd83e('0xa1'),require(_0xd83e('0xa2')));_0x125f19[_0xd83e('0x6')](_0xd83e('0xa3'),require(_0xd83e('0xa4')));_0x125f19[_0xd83e('0x6')]('/api/integrations/desk/configurations',require(_0xd83e('0xa5')));_0x125f19['use']('/api/integrations/desk/fields',require(_0xd83e('0xa6')));_0x125f19[_0xd83e('0x6')]('/api/integrations/zoho/accounts',require(_0xd83e('0xa7')));_0x125f19[_0xd83e('0x6')](_0xd83e('0xa8'),require(_0xd83e('0xa9')));_0x125f19[_0xd83e('0x6')]('/api/integrations/zoho/fields',require(_0xd83e('0xaa')));_0x125f19[_0xd83e('0x6')](_0xd83e('0xab'),require('./api/intZendeskAccount'));_0x125f19[_0xd83e('0x6')](_0xd83e('0xac'),require(_0xd83e('0xad')));_0x125f19['use']('/api/integrations/zendesk/fields',require(_0xd83e('0xae')));_0x125f19[_0xd83e('0x6')](_0xd83e('0xaf'),require(_0xd83e('0xb0')));_0x125f19[_0xd83e('0x6')](_0xd83e('0xb1'),require('./api/intFreshdeskConfiguration'));_0x125f19[_0xd83e('0x6')](_0xd83e('0xb2'),require('./api/intFreshdeskField'));_0x125f19[_0xd83e('0x6')](_0xd83e('0xb3'),require(_0xd83e('0xb4')));_0x125f19[_0xd83e('0x6')]('/api/integrations/vtiger/configurations',require('./api/intVtigerConfiguration'));_0x125f19[_0xd83e('0x6')]('/api/integrations/vtiger/fields',require(_0xd83e('0xb5')));_0x125f19[_0xd83e('0x6')](_0xd83e('0xb6'),require(_0xd83e('0xb7')));_0x125f19[_0xd83e('0x6')](_0xd83e('0xb8'),require(_0xd83e('0xb9')));_0x125f19[_0xd83e('0x6')](_0xd83e('0xba'),require(_0xd83e('0xbb')));_0x125f19[_0xd83e('0x6')](_0xd83e('0xbc'),require(_0xd83e('0xbd')));_0x125f19[_0xd83e('0x6')]('/api/integrations/dynamics365/configurations',require('./api/intDynamics365Configuration'));_0x125f19[_0xd83e('0x6')](_0xd83e('0xbe'),require(_0xd83e('0xbf')));_0x125f19['use'](_0xd83e('0xc0'),require(_0xd83e('0xc1')));_0x125f19[_0xd83e('0x6')](_0xd83e('0xc2'),require(_0xd83e('0xc3')));_0x125f19[_0xd83e('0x6')]('/api/integrations/freshsales/fields',require(_0xd83e('0xc4')));_0x125f19[_0xd83e('0x6')](_0xd83e('0xc5'),require(_0xd83e('0xc6')));_0x125f19[_0xd83e('0x6')](_0xd83e('0xc7'),require('./api/chatQueueReport'));_0x125f19[_0xd83e('0x6')](_0xd83e('0xc8'),require('./api/chatInternalMessage'));_0x125f19[_0xd83e('0x6')](_0xd83e('0xc9'),require(_0xd83e('0xca')));_0x125f19[_0xd83e('0x6')](_0xd83e('0xcb'),require(_0xd83e('0xcc')));_0x125f19['use'](_0xd83e('0xcd'),require(_0xd83e('0xce')));_0x125f19['use'](_0xd83e('0xcf'),require(_0xd83e('0xd0')));_0x125f19['use'](_0xd83e('0xd1'),require('./api/squareReport'));_0x125f19[_0xd83e('0x6')](_0xd83e('0xd2'),require('./api/squareReportDetail'));_0x125f19['use'](_0xd83e('0xd3'),require(_0xd83e('0xd4')));_0x125f19[_0xd83e('0x6')]('/api/settings',require('./api/setting'));_0x125f19[_0xd83e('0x6')]('/api/square/odbc',require(_0xd83e('0xd5')));_0x125f19[_0xd83e('0x6')]('/api/square/projects',require(_0xd83e('0xd6')));_0x125f19[_0xd83e('0x6')]('/api/square/recordings',require(_0xd83e('0xd7')));_0x125f19[_0xd83e('0x6')](_0xd83e('0xd8'),require(_0xd83e('0xd9')));_0x125f19['use'](_0xd83e('0xda'),require(_0xd83e('0xdb')));_0x125f19['use'](_0xd83e('0xdc'),require('./api/license'));_0x125f19[_0xd83e('0x6')](_0xd83e('0xdd'),require(_0xd83e('0xde')));_0x125f19[_0xd83e('0x6')](_0xd83e('0xdf'),require(_0xd83e('0xe0')));_0x125f19[_0xd83e('0x6')](_0xd83e('0xe1'),require(_0xd83e('0xe2')));_0x125f19['use']('/api/plugins',require(_0xd83e('0xe3')));_0x125f19[_0xd83e('0x6')]('/api/mail/reports/transfer',require(_0xd83e('0xe4')));_0x125f19[_0xd83e('0x6')](_0xd83e('0xe5'),require(_0xd83e('0xe6')));_0x125f19[_0xd83e('0x6')](_0xd83e('0xe7'),require('./api/faxTransferReport'));_0x125f19[_0xd83e('0x6')](_0xd83e('0xe8'),require(_0xd83e('0xe9')));_0x125f19[_0xd83e('0x6')]('/api/sms/reports/transfer',require(_0xd83e('0xea')));_0x125f19['use'](_0xd83e('0xeb'),require(_0xd83e('0xec')));_0x125f19[_0xd83e('0x6')]('/api/voice/prefixes',require(_0xd83e('0xed')));_0x125f19[_0xd83e('0x6')]('/api/userProfiles',require(_0xd83e('0xee')));_0x125f19[_0xd83e('0x6')](_0xd83e('0xef'),require('./api/userProfileSection'));_0x125f19[_0xd83e('0x6')]('/api/userProfile/resources',require(_0xd83e('0xf0')));_0x125f19[_0xd83e('0x6')]('/api/notifications',require(_0xd83e('0xf1')));_0x125f19[_0xd83e('0x6')](_0xd83e('0xf2'),require(_0xd83e('0xf3')));_0x125f19[_0xd83e('0x6')]('/api/whatsapp/applications',require(_0xd83e('0xf4')));_0x125f19[_0xd83e('0x6')](_0xd83e('0xf5'),require(_0xd83e('0xf6')));_0x125f19[_0xd83e('0x6')](_0xd83e('0xf7'),require('./api/whatsappMessage'));_0x125f19['use'](_0xd83e('0xf8'),require(_0xd83e('0xf9')));_0x125f19['use'](_0xd83e('0xfa'),require(_0xd83e('0xfb')));_0x125f19[_0xd83e('0x6')](_0xd83e('0xfc'),require('./api/whatsappQueue'));_0x125f19['use'](_0xd83e('0xfd'),require(_0xd83e('0xfe')));_0x125f19[_0xd83e('0x6')](_0xd83e('0xff'),require(_0xd83e('0x100')));_0x125f19[_0xd83e('0x6')](_0xd83e('0x101'),require(_0xd83e('0x102')));_0x125f19[_0xd83e('0x6')](_0xd83e('0x103'),require(_0xd83e('0x104')));_0x125f19[_0xd83e('0x6')](_0xd83e('0x105'),require(_0xd83e('0x106')));_0x125f19[_0xd83e('0x6')](_0xd83e('0x107'),require(_0xd83e('0x108')));_0x125f19[_0xd83e('0x6')](_0xd83e('0x109'),require(_0xd83e('0x10a')));_0x125f19['use'](_0xd83e('0x10b'),require(_0xd83e('0x10c')));_0x125f19['use']('/api/webbar',require(_0xd83e('0x10d')));_0x125f19[_0xd83e('0x6')](_0xd83e('0x10e'),express[_0xd83e('0x10f')](path[_0xd83e('0x110')](config[_0xd83e('0x111')],_0xd83e('0x10e'))));_0x125f19['use']('/www',express[_0xd83e('0x10f')](path['join'](config[_0xd83e('0x111')],_0xd83e('0x112'))));_0x125f19[_0xd83e('0x6')]('/demo',express[_0xd83e('0x10f')](path[_0xd83e('0x110')](config[_0xd83e('0x111')],_0xd83e('0x113'))));_0x125f19['use']('/snippet',express[_0xd83e('0x10f')](path[_0xd83e('0x110')](config['root'],_0xd83e('0x114'),_0xd83e('0x115'))));_0x125f19[_0xd83e('0x6')](_0xd83e('0x116'),express['static'](path[_0xd83e('0x110')](config[_0xd83e('0x111')],_0xd83e('0x117'))));_0x125f19['route']('/:url(api|auth|components|app|bower_components|assets)/*')['get'](errors[0x194]);_0x125f19['route']('/*')[_0xd83e('0x118')](function(_0x48a72c,_0x43a9ac){_0x43a9ac[_0xd83e('0x119')](path[_0xd83e('0x11a')](_0x125f19[_0xd83e('0x118')](_0xd83e('0x11b'))+_0xd83e('0x11c')));});};
\ No newline at end of file
+var _0x1fb1=['./api/dashboardItem','./api/faxAccount','/api/fax/applications','./api/faxApplication','./api/faxInteraction','/api/fax/messages','/api/fax/queues','./api/faxQueue','/api/fax/reports/queue','/api/sms/accounts','./api/smsAccount','/api/sms/applications','./api/smsApplication','./api/smsInteraction','/api/sms/messages','./api/smsMessage','/api/sms/queues','/api/openchannel/accounts','./api/openchannelAccount','/api/openchannel/applications','./api/openchannelApplication','/api/openchannel/interactions','./api/openchannelInteraction','/api/openchannel/messages','/api/openchannel/queues','./api/openchannelQueue','/api/chat/websites','./api/chatWebsite','/api/openchannel/reports/queue','./api/openchannelQueueReport','/api/chat/applications','./api/chatApplication','/api/chat/interactions','./api/chatInteraction','/api/chat/messages','./api/chatMessage','/api/chat/offline_messages','/api/chat/queues','./api/chatQueue','/api/chat/groups','./api/chatGroup','/api/chat/proactive_actions','./api/chatProactiveAction','/api/cm/companies','/api/cm/contacts','/api/cm/hopper','/api/cm/hopper_final','./api/cmHopperFinal','/api/cm/hopper_history','./api/cmHopperHistory','/api/cm/custom_fields','./api/cmCustomField','/api/actions','./api/action','/api/automations','/api/canned_answers','./api/cannedAnswer','/api/dispositions','./api/disposition','/api/conditions','/api/intervals','./api/interval','./api/pause','./api/cdr','./api/voiceQueuesLog','/api/schedules','./api/schedule','/api/sounds','./api/sound','./api/tag','/api/templates','./api/template','./api/trigger','/api/variables','./api/variable','/api/integrations','./api/integration','/api/integrations/reports','/api/analytics/default_reports','./api/analyticDefaultReport','/api/analytics/extracted_reports','./api/analyticExtractedReport','/api/analytics/metrics','./api/analyticMetric','/api/analytics/field_reports','/api/analytics/tree_reports','./api/analyticTreeReport','/api/integrations/salesforce/accounts','./api/intSalesforceAccount','/api/integrations/salesforce/configurations','/api/integrations/salesforce/fields','./api/intSalesforceField','./api/intSugarcrmAccount','/api/integrations/sugarcrm/configurations','./api/intSugarcrmConfiguration','/api/integrations/sugarcrm/fields','./api/intSugarcrmField','/api/integrations/desk/accounts','./api/intDeskAccount','/api/integrations/desk/configurations','./api/intDeskConfiguration','/api/integrations/desk/fields','./api/intDeskField','/api/integrations/zoho/accounts','./api/intZohoAccount','./api/intZohoConfiguration','/api/integrations/zoho/fields','./api/intZohoField','/api/integrations/zendesk/accounts','./api/intZendeskAccount','/api/integrations/zendesk/configurations','./api/intZendeskConfiguration','/api/integrations/zendesk/fields','./api/intFreshdeskConfiguration','/api/integrations/freshdesk/fields','/api/integrations/vtiger/accounts','./api/intVtigerAccount','/api/integrations/vtiger/fields','/api/integrations/servicenow/accounts','/api/integrations/servicenow/configurations','./api/intServicenowConfiguration','/api/integrations/servicenow/fields','./api/intServicenowField','./api/intDynamics365Account','/api/integrations/dynamics365/configurations','./api/intDynamics365Configuration','/api/integrations/dynamics365/fields','/api/integrations/freshsales/configurations','/api/integrations/freshsales/fields','./api/intFreshsalesField','/api/networks','./api/network','./api/chatInternalMessage','/api/jscripty/questions/reports','./api/jscriptyQuestionReport','/api/jscripty/sessions/reports','./api/jscriptySessionReport','/api/sms/reports/queue','/api/square/reports','./api/squareReport','/api/square/details/reports','/api/jscripty/projects','/api/settings','/api/square/odbc','./api/squareOdbc','/api/square/projects','./api/squareProject','/api/square/messages','./api/squareMessage','./api/team','/api/license','/api/campaigns','./api/campaign','/api/migrations','./api/migration','/api/attachments','./api/attachment','/api/plugins','./api/plugin','/api/mail/reports/transfer','/api/chat/reports/transfer','/api/fax/reports/transfer','/api/openchannel/reports/transfer','./api/openchannelTransferReport','/api/sms/reports/transfer','./api/smsTransferReport','/api/cm/lists','./api/cmList','./api/voicePrefix','/api/userProfiles','./api/userProfile','/api/userProfile/sections','./api/userProfileResource','/api/notifications','./api/notification','./api/whatsappAccount','/api/whatsapp/applications','./api/whatsappApplication','./api/whatsappInteraction','/api/whatsapp/messages','./api/whatsappMessage','/api/whatsapp/reports/transfer','/api/whatsapp/queues','./api/whatsappQueue','/api/cloudProviders','./api/cloudProvider','/api/auth/local','./api/authLocal','/api/auth/google','./api/authGoogle','/api/jira','./api/jira','./api/rpc','/api/version','./api/version','./api/system','./api/pm2','/api/webbar','./api/webbar','/apidoc','static','join','root','/demo','snippet','1.0.16','/plugins','/server/files/plugins','get','resolve','appPath','/index.html','path','express','util','./errors','./config/environment','api','./config/logger','default','use','logger','format','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s','method','headers','x-forwarded-for','connection','remoteAddress','statusCode','user','role','body','device','agent_id','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s\x20(id=%s\x20name=%s)','url','responseTime','name','agent_name','/api/users','./api/user','/api/voice/chanspy','/api/voice/contexts','./api/voiceContext','/api/voice/extensions','./api/voiceExtension','./api/voiceMusicOnHold','/api/voice/queues','./api/voiceQueue','/api/screen/recordings','./api/screenRecording','./api/voiceMail','/api/voice/mails/messages','./api/voiceMailMessage','/api/voice/calls/reports','./api/voiceCallReport','/api/voice/dials/reports','/api/voice/agents/reports','./api/voiceAgentReport','/api/voice/queues/reports','./api/voiceQueueReport','/api/members/reports','./api/memberReport','/api/trunks','./api/trunk','/api/voice/transfers/reports','/api/mail/out_servers','./api/mailServerOut','/api/mail/accounts','./api/mailAccount','/api/mail/queues','/api/mail/substatuses','./api/mailSubstatus','/api/mail/interactions','./api/mailInteraction','./api/mailMessage','/api/mail/applications','./api/mailApplication','/api/mail/reports/queue','./api/dashboard','/api/dashboards/items'];(function(_0xab8668,_0x5204ac){var _0x571c10=function(_0x4ed488){while(--_0x4ed488){_0xab8668['push'](_0xab8668['shift']());}};_0x571c10(++_0x5204ac);}(_0x1fb1,0xd4));var _0x11fb=function(_0x1d4739,_0x192944){_0x1d4739=_0x1d4739-0x0;var _0x48c5cb=_0x1fb1[_0x1d4739];return _0x48c5cb;};'use strict';var path=require(_0x11fb('0x0'));var express=require(_0x11fb('0x1'));var ewinston=require('express-winston');var util=require(_0x11fb('0x2'));var errors=require(_0x11fb('0x3'));var config=require(_0x11fb('0x4'));var logger=require('./config/logger')(_0x11fb('0x5'));var authLogger=require(_0x11fb('0x6'))('auth');exports[_0x11fb('0x7')]=function(_0x51de10){_0x51de10[_0x11fb('0x8')](ewinston[_0x11fb('0x9')]({'winstonInstance':logger,'meta':![],'statusLevels':!![],'msg':function(_0x2e9b4c,_0x6b5420){return util[_0x11fb('0xa')](_0x11fb('0xb'),_0x2e9b4c[_0x11fb('0xc')],_0x2e9b4c[_0x11fb('0xd')][_0x11fb('0xe')]?_0x2e9b4c['headers'][_0x11fb('0xe')]:_0x2e9b4c[_0x11fb('0xf')][_0x11fb('0x10')]||_0x2e9b4c['ip'],_0x2e9b4c['url'],_0x6b5420[_0x11fb('0x11')],_0x6b5420['responseTime'],_0x2e9b4c[_0x11fb('0x12')]?_0x2e9b4c[_0x11fb('0x12')]['id']:null,_0x2e9b4c['user']?_0x2e9b4c[_0x11fb('0x12')]['name']:null,_0x2e9b4c[_0x11fb('0x12')]?_0x2e9b4c[_0x11fb('0x12')][_0x11fb('0x13')]:null);}}));_0x51de10[_0x11fb('0x8')](ewinston[_0x11fb('0x9')]({'winstonInstance':authLogger,'meta':![],'statusLevels':!![],'msg':function(_0x228bf3,_0x329847){var _0x319405='%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s';if(_0x228bf3[_0x11fb('0x14')]&&_0x228bf3[_0x11fb('0x14')][_0x11fb('0x15')]&&_0x228bf3[_0x11fb('0x14')][_0x11fb('0x16')]){_0x319405=_0x11fb('0x17');}return util[_0x11fb('0xa')](_0x319405,_0x228bf3[_0x11fb('0xc')],_0x228bf3[_0x11fb('0xd')][_0x11fb('0xe')]?_0x228bf3[_0x11fb('0xd')][_0x11fb('0xe')]:_0x228bf3[_0x11fb('0xf')][_0x11fb('0x10')]||_0x228bf3['ip'],_0x228bf3[_0x11fb('0x18')],_0x329847[_0x11fb('0x11')],_0x329847[_0x11fb('0x19')],_0x228bf3[_0x11fb('0x12')]?_0x228bf3[_0x11fb('0x12')]['id']:null,_0x228bf3['user']?_0x228bf3[_0x11fb('0x12')][_0x11fb('0x1a')]:null,_0x228bf3[_0x11fb('0x12')]?_0x228bf3['user'][_0x11fb('0x13')]:null,_0x228bf3[_0x11fb('0x14')]&&_0x228bf3['body'][_0x11fb('0x15')]?_0x228bf3[_0x11fb('0x14')][_0x11fb('0x15')]:'other',_0x228bf3[_0x11fb('0x14')]&&_0x228bf3[_0x11fb('0x14')]['agent_id']?_0x228bf3['body'][_0x11fb('0x16')]:'',_0x228bf3[_0x11fb('0x14')]&&_0x228bf3[_0x11fb('0x14')][_0x11fb('0x1b')]?_0x228bf3[_0x11fb('0x14')][_0x11fb('0x1b')]:'');},'ignoreRoute':function(_0x1f7e0c){var _0x1c7149=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x1c7149['test'](_0x1f7e0c[_0x11fb('0x18')]);}}));_0x51de10[_0x11fb('0x8')](_0x11fb('0x1c'),require(_0x11fb('0x1d')));_0x51de10[_0x11fb('0x8')](_0x11fb('0x1e'),require('./api/voiceChanSpy'));_0x51de10['use'](_0x11fb('0x1f'),require(_0x11fb('0x20')));_0x51de10[_0x11fb('0x8')](_0x11fb('0x21'),require(_0x11fb('0x22')));_0x51de10[_0x11fb('0x8')]('/api/voice/mohs',require(_0x11fb('0x23')));_0x51de10[_0x11fb('0x8')](_0x11fb('0x24'),require(_0x11fb('0x25')));_0x51de10[_0x11fb('0x8')]('/api/voice/recordings',require('./api/voiceRecording'));_0x51de10[_0x11fb('0x8')](_0x11fb('0x26'),require(_0x11fb('0x27')));_0x51de10[_0x11fb('0x8')]('/api/voice/mails',require(_0x11fb('0x28')));_0x51de10[_0x11fb('0x8')](_0x11fb('0x29'),require(_0x11fb('0x2a')));_0x51de10[_0x11fb('0x8')](_0x11fb('0x2b'),require(_0x11fb('0x2c')));_0x51de10['use'](_0x11fb('0x2d'),require('./api/voiceDialReport'));_0x51de10[_0x11fb('0x8')](_0x11fb('0x2e'),require(_0x11fb('0x2f')));_0x51de10[_0x11fb('0x8')](_0x11fb('0x30'),require(_0x11fb('0x31')));_0x51de10['use'](_0x11fb('0x32'),require(_0x11fb('0x33')));_0x51de10[_0x11fb('0x8')](_0x11fb('0x34'),require(_0x11fb('0x35')));_0x51de10[_0x11fb('0x8')](_0x11fb('0x36'),require('./api/voiceTransferReport'));_0x51de10[_0x11fb('0x8')](_0x11fb('0x37'),require(_0x11fb('0x38')));_0x51de10[_0x11fb('0x8')](_0x11fb('0x39'),require(_0x11fb('0x3a')));_0x51de10[_0x11fb('0x8')](_0x11fb('0x3b'),require('./api/mailQueue'));_0x51de10[_0x11fb('0x8')](_0x11fb('0x3c'),require(_0x11fb('0x3d')));_0x51de10[_0x11fb('0x8')](_0x11fb('0x3e'),require(_0x11fb('0x3f')));_0x51de10[_0x11fb('0x8')]('/api/mail/messages',require(_0x11fb('0x40')));_0x51de10[_0x11fb('0x8')](_0x11fb('0x41'),require(_0x11fb('0x42')));_0x51de10[_0x11fb('0x8')](_0x11fb('0x43'),require('./api/mailQueueReport'));_0x51de10[_0x11fb('0x8')]('/api/dashboards',require(_0x11fb('0x44')));_0x51de10['use'](_0x11fb('0x45'),require(_0x11fb('0x46')));_0x51de10[_0x11fb('0x8')]('/api/fax/accounts',require(_0x11fb('0x47')));_0x51de10[_0x11fb('0x8')](_0x11fb('0x48'),require(_0x11fb('0x49')));_0x51de10[_0x11fb('0x8')]('/api/fax/interactions',require(_0x11fb('0x4a')));_0x51de10[_0x11fb('0x8')](_0x11fb('0x4b'),require('./api/faxMessage'));_0x51de10['use'](_0x11fb('0x4c'),require(_0x11fb('0x4d')));_0x51de10[_0x11fb('0x8')](_0x11fb('0x4e'),require('./api/faxQueueReport'));_0x51de10['use'](_0x11fb('0x4f'),require(_0x11fb('0x50')));_0x51de10[_0x11fb('0x8')](_0x11fb('0x51'),require(_0x11fb('0x52')));_0x51de10[_0x11fb('0x8')]('/api/sms/interactions',require(_0x11fb('0x53')));_0x51de10[_0x11fb('0x8')](_0x11fb('0x54'),require(_0x11fb('0x55')));_0x51de10[_0x11fb('0x8')](_0x11fb('0x56'),require('./api/smsQueue'));_0x51de10[_0x11fb('0x8')](_0x11fb('0x57'),require(_0x11fb('0x58')));_0x51de10['use'](_0x11fb('0x59'),require(_0x11fb('0x5a')));_0x51de10[_0x11fb('0x8')](_0x11fb('0x5b'),require(_0x11fb('0x5c')));_0x51de10[_0x11fb('0x8')](_0x11fb('0x5d'),require('./api/openchannelMessage'));_0x51de10[_0x11fb('0x8')](_0x11fb('0x5e'),require(_0x11fb('0x5f')));_0x51de10[_0x11fb('0x8')](_0x11fb('0x60'),require(_0x11fb('0x61')));_0x51de10[_0x11fb('0x8')](_0x11fb('0x62'),require(_0x11fb('0x63')));_0x51de10[_0x11fb('0x8')](_0x11fb('0x64'),require(_0x11fb('0x65')));_0x51de10[_0x11fb('0x8')](_0x11fb('0x66'),require(_0x11fb('0x67')));_0x51de10[_0x11fb('0x8')](_0x11fb('0x68'),require(_0x11fb('0x69')));_0x51de10['use'](_0x11fb('0x6a'),require('./api/chatOfflineMessage'));_0x51de10['use'](_0x11fb('0x6b'),require(_0x11fb('0x6c')));_0x51de10[_0x11fb('0x8')](_0x11fb('0x6d'),require(_0x11fb('0x6e')));_0x51de10[_0x11fb('0x8')](_0x11fb('0x6f'),require(_0x11fb('0x70')));_0x51de10[_0x11fb('0x8')](_0x11fb('0x71'),require('./api/cmCompany'));_0x51de10[_0x11fb('0x8')](_0x11fb('0x72'),require('./api/cmContact'));_0x51de10[_0x11fb('0x8')](_0x11fb('0x73'),require('./api/cmHopper'));_0x51de10['use']('/api/cm/hopper_black',require('./api/cmHopperBlack'));_0x51de10[_0x11fb('0x8')](_0x11fb('0x74'),require(_0x11fb('0x75')));_0x51de10[_0x11fb('0x8')](_0x11fb('0x76'),require(_0x11fb('0x77')));_0x51de10[_0x11fb('0x8')](_0x11fb('0x78'),require(_0x11fb('0x79')));_0x51de10['use'](_0x11fb('0x7a'),require(_0x11fb('0x7b')));_0x51de10[_0x11fb('0x8')](_0x11fb('0x7c'),require('./api/automation'));_0x51de10[_0x11fb('0x8')](_0x11fb('0x7d'),require(_0x11fb('0x7e')));_0x51de10['use'](_0x11fb('0x7f'),require(_0x11fb('0x80')));_0x51de10['use'](_0x11fb('0x81'),require('./api/condition'));_0x51de10[_0x11fb('0x8')](_0x11fb('0x82'),require(_0x11fb('0x83')));_0x51de10[_0x11fb('0x8')]('/api/pauses',require(_0x11fb('0x84')));_0x51de10['use']('/api/cdr',require(_0x11fb('0x85')));_0x51de10['use']('/api/voiceQueuesLog',require(_0x11fb('0x86')));_0x51de10['use'](_0x11fb('0x87'),require(_0x11fb('0x88')));_0x51de10[_0x11fb('0x8')](_0x11fb('0x89'),require(_0x11fb('0x8a')));_0x51de10['use']('/api/tags',require(_0x11fb('0x8b')));_0x51de10[_0x11fb('0x8')](_0x11fb('0x8c'),require(_0x11fb('0x8d')));_0x51de10['use']('/api/triggers',require(_0x11fb('0x8e')));_0x51de10[_0x11fb('0x8')](_0x11fb('0x8f'),require(_0x11fb('0x90')));_0x51de10[_0x11fb('0x8')](_0x11fb('0x91'),require(_0x11fb('0x92')));_0x51de10[_0x11fb('0x8')](_0x11fb('0x93'),require('./api/integrationReport'));_0x51de10[_0x11fb('0x8')]('/api/analytics/custom_reports',require('./api/analyticCustomReport'));_0x51de10['use'](_0x11fb('0x94'),require(_0x11fb('0x95')));_0x51de10['use'](_0x11fb('0x96'),require(_0x11fb('0x97')));_0x51de10[_0x11fb('0x8')](_0x11fb('0x98'),require(_0x11fb('0x99')));_0x51de10['use'](_0x11fb('0x9a'),require('./api/analyticFieldReport'));_0x51de10[_0x11fb('0x8')](_0x11fb('0x9b'),require(_0x11fb('0x9c')));_0x51de10[_0x11fb('0x8')](_0x11fb('0x9d'),require(_0x11fb('0x9e')));_0x51de10['use'](_0x11fb('0x9f'),require('./api/intSalesforceConfiguration'));_0x51de10[_0x11fb('0x8')](_0x11fb('0xa0'),require(_0x11fb('0xa1')));_0x51de10[_0x11fb('0x8')]('/api/integrations/sugarcrm/accounts',require(_0x11fb('0xa2')));_0x51de10['use'](_0x11fb('0xa3'),require(_0x11fb('0xa4')));_0x51de10['use'](_0x11fb('0xa5'),require(_0x11fb('0xa6')));_0x51de10['use'](_0x11fb('0xa7'),require(_0x11fb('0xa8')));_0x51de10['use'](_0x11fb('0xa9'),require(_0x11fb('0xaa')));_0x51de10[_0x11fb('0x8')](_0x11fb('0xab'),require(_0x11fb('0xac')));_0x51de10['use'](_0x11fb('0xad'),require(_0x11fb('0xae')));_0x51de10[_0x11fb('0x8')]('/api/integrations/zoho/configurations',require(_0x11fb('0xaf')));_0x51de10[_0x11fb('0x8')](_0x11fb('0xb0'),require(_0x11fb('0xb1')));_0x51de10[_0x11fb('0x8')](_0x11fb('0xb2'),require(_0x11fb('0xb3')));_0x51de10['use'](_0x11fb('0xb4'),require(_0x11fb('0xb5')));_0x51de10[_0x11fb('0x8')](_0x11fb('0xb6'),require('./api/intZendeskField'));_0x51de10['use']('/api/integrations/freshdesk/accounts',require('./api/intFreshdeskAccount'));_0x51de10[_0x11fb('0x8')]('/api/integrations/freshdesk/configurations',require(_0x11fb('0xb7')));_0x51de10['use'](_0x11fb('0xb8'),require('./api/intFreshdeskField'));_0x51de10[_0x11fb('0x8')](_0x11fb('0xb9'),require(_0x11fb('0xba')));_0x51de10[_0x11fb('0x8')]('/api/integrations/vtiger/configurations',require('./api/intVtigerConfiguration'));_0x51de10['use'](_0x11fb('0xbb'),require('./api/intVtigerField'));_0x51de10['use'](_0x11fb('0xbc'),require('./api/intServicenowAccount'));_0x51de10[_0x11fb('0x8')](_0x11fb('0xbd'),require(_0x11fb('0xbe')));_0x51de10[_0x11fb('0x8')](_0x11fb('0xbf'),require(_0x11fb('0xc0')));_0x51de10['use']('/api/integrations/dynamics365/accounts',require(_0x11fb('0xc1')));_0x51de10['use'](_0x11fb('0xc2'),require(_0x11fb('0xc3')));_0x51de10[_0x11fb('0x8')](_0x11fb('0xc4'),require('./api/intDynamics365Field'));_0x51de10[_0x11fb('0x8')]('/api/integrations/freshsales/accounts',require('./api/intFreshsalesAccount'));_0x51de10[_0x11fb('0x8')](_0x11fb('0xc5'),require('./api/intFreshsalesConfiguration'));_0x51de10[_0x11fb('0x8')](_0x11fb('0xc6'),require(_0x11fb('0xc7')));_0x51de10[_0x11fb('0x8')](_0x11fb('0xc8'),require(_0x11fb('0xc9')));_0x51de10['use']('/api/chat/reports/queue',require('./api/chatQueueReport'));_0x51de10[_0x11fb('0x8')]('/api/chat/internal/messages',require(_0x11fb('0xca')));_0x51de10[_0x11fb('0x8')]('/api/jscripty/answers/reports',require('./api/jscriptyAnswerReport'));_0x51de10[_0x11fb('0x8')](_0x11fb('0xcb'),require(_0x11fb('0xcc')));_0x51de10[_0x11fb('0x8')](_0x11fb('0xcd'),require(_0x11fb('0xce')));_0x51de10['use'](_0x11fb('0xcf'),require('./api/smsQueueReport'));_0x51de10[_0x11fb('0x8')](_0x11fb('0xd0'),require(_0x11fb('0xd1')));_0x51de10[_0x11fb('0x8')](_0x11fb('0xd2'),require('./api/squareReportDetail'));_0x51de10['use'](_0x11fb('0xd3'),require('./api/jscriptyProject'));_0x51de10[_0x11fb('0x8')](_0x11fb('0xd4'),require('./api/setting'));_0x51de10[_0x11fb('0x8')](_0x11fb('0xd5'),require(_0x11fb('0xd6')));_0x51de10[_0x11fb('0x8')](_0x11fb('0xd7'),require(_0x11fb('0xd8')));_0x51de10[_0x11fb('0x8')]('/api/square/recordings',require('./api/squareRecording'));_0x51de10[_0x11fb('0x8')](_0x11fb('0xd9'),require(_0x11fb('0xda')));_0x51de10['use']('/api/teams',require(_0x11fb('0xdb')));_0x51de10[_0x11fb('0x8')](_0x11fb('0xdc'),require('./api/license'));_0x51de10[_0x11fb('0x8')](_0x11fb('0xdd'),require(_0x11fb('0xde')));_0x51de10[_0x11fb('0x8')](_0x11fb('0xdf'),require(_0x11fb('0xe0')));_0x51de10['use'](_0x11fb('0xe1'),require(_0x11fb('0xe2')));_0x51de10[_0x11fb('0x8')](_0x11fb('0xe3'),require(_0x11fb('0xe4')));_0x51de10[_0x11fb('0x8')](_0x11fb('0xe5'),require('./api/mailTransferReport'));_0x51de10[_0x11fb('0x8')](_0x11fb('0xe6'),require('./api/chatTransferReport'));_0x51de10[_0x11fb('0x8')](_0x11fb('0xe7'),require('./api/faxTransferReport'));_0x51de10[_0x11fb('0x8')](_0x11fb('0xe8'),require(_0x11fb('0xe9')));_0x51de10['use'](_0x11fb('0xea'),require(_0x11fb('0xeb')));_0x51de10[_0x11fb('0x8')](_0x11fb('0xec'),require(_0x11fb('0xed')));_0x51de10['use']('/api/voice/prefixes',require(_0x11fb('0xee')));_0x51de10[_0x11fb('0x8')](_0x11fb('0xef'),require(_0x11fb('0xf0')));_0x51de10[_0x11fb('0x8')](_0x11fb('0xf1'),require('./api/userProfileSection'));_0x51de10[_0x11fb('0x8')]('/api/userProfile/resources',require(_0x11fb('0xf2')));_0x51de10[_0x11fb('0x8')](_0x11fb('0xf3'),require(_0x11fb('0xf4')));_0x51de10[_0x11fb('0x8')]('/api/whatsapp/accounts',require(_0x11fb('0xf5')));_0x51de10[_0x11fb('0x8')](_0x11fb('0xf6'),require(_0x11fb('0xf7')));_0x51de10[_0x11fb('0x8')]('/api/whatsapp/interactions',require(_0x11fb('0xf8')));_0x51de10[_0x11fb('0x8')](_0x11fb('0xf9'),require(_0x11fb('0xfa')));_0x51de10['use']('/api/whatsapp/reports/queue',require('./api/whatsappQueueReport'));_0x51de10[_0x11fb('0x8')](_0x11fb('0xfb'),require('./api/whatsappTransferReport'));_0x51de10[_0x11fb('0x8')](_0x11fb('0xfc'),require(_0x11fb('0xfd')));_0x51de10[_0x11fb('0x8')](_0x11fb('0xfe'),require(_0x11fb('0xff')));_0x51de10['use'](_0x11fb('0x100'),require(_0x11fb('0x101')));_0x51de10[_0x11fb('0x8')](_0x11fb('0x102'),require(_0x11fb('0x103')));_0x51de10[_0x11fb('0x8')](_0x11fb('0x104'),require(_0x11fb('0x105')));_0x51de10['use']('/api/rpc',require(_0x11fb('0x106')));_0x51de10[_0x11fb('0x8')](_0x11fb('0x107'),require(_0x11fb('0x108')));_0x51de10[_0x11fb('0x8')]('/api/system',require(_0x11fb('0x109')));_0x51de10[_0x11fb('0x8')]('/api/pm2',require(_0x11fb('0x10a')));_0x51de10[_0x11fb('0x8')](_0x11fb('0x10b'),require(_0x11fb('0x10c')));_0x51de10[_0x11fb('0x8')](_0x11fb('0x10d'),express[_0x11fb('0x10e')](path[_0x11fb('0x10f')](config['root'],_0x11fb('0x10d'))));_0x51de10[_0x11fb('0x8')]('/www',express['static'](path[_0x11fb('0x10f')](config[_0x11fb('0x110')],'/www')));_0x51de10[_0x11fb('0x8')](_0x11fb('0x111'),express[_0x11fb('0x10e')](path[_0x11fb('0x10f')](config['root'],_0x11fb('0x111'))));_0x51de10['use']('/snippet',express[_0x11fb('0x10e')](path[_0x11fb('0x10f')](config[_0x11fb('0x110')],_0x11fb('0x112'),_0x11fb('0x113'))));_0x51de10[_0x11fb('0x8')](_0x11fb('0x114'),express['static'](path[_0x11fb('0x10f')](config[_0x11fb('0x110')],_0x11fb('0x115'))));_0x51de10['route']('/:url(api|auth|components|app|bower_components|assets)/*')[_0x11fb('0x116')](errors[0x194]);_0x51de10['route']('/*')[_0x11fb('0x116')](function(_0x33da42,_0x480155){_0x480155['sendFile'](path[_0x11fb('0x117')](_0x51de10[_0x11fb('0x116')](_0x11fb('0x118'))+_0x11fb('0x119')));});};
\ No newline at end of file
diff --git a/server/rpc/index.js b/server/rpc/index.js
index 964bb1c..9625d4f 100644
--- a/server/rpc/index.js
+++ b/server/rpc/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xbd41=['server','http','rpc','port','localhost','error','log','Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!','../config/triggers','RPC\x20listening\x20on\x20','jayson/promise','lodash','../config/environment','listen','merge','../api/voiceExtension/voiceExtension.rpc','../api/voiceQueue/voiceQueue.rpc','../api/voiceRecording/voiceRecording.rpc','../api/voiceCallReport/voiceCallReport.rpc','../api/voiceDialReport/voiceDialReport.rpc','../api/voiceAgentReport/voiceAgentReport.rpc','../api/memberReport/memberReport.rpc','../api/trunk/trunk.rpc','../api/userVoiceQueueRt/userVoiceQueueRt.rpc','../api/mailAccount/mailAccount.rpc','../api/mailQueue/mailQueue.rpc','../api/mailInteraction/mailInteraction.rpc','../api/mailMessage/mailMessage.rpc','../api/mailApplication/mailApplication.rpc','../api/faxAccount/faxAccount.rpc','../api/faxApplication/faxApplication.rpc','../api/faxInteraction/faxInteraction.rpc','../api/faxMessage/faxMessage.rpc','../api/faxQueue/faxQueue.rpc','../api/smsAccount/smsAccount.rpc','../api/smsInteraction/smsInteraction.rpc','../api/smsMessage/smsMessage.rpc','../api/smsQueue/smsQueue.rpc','../api/openchannelInteraction/openchannelInteraction.rpc','../api/openchannelMessage/openchannelMessage.rpc','../api/openchannelQueue/openchannelQueue.rpc','../api/openchannelQueueReport/openchannelQueueReport.rpc','../api/chatInteraction/chatInteraction.rpc','../api/cmContact/cmContact.rpc','../api/cmHopperFinal/cmHopperFinal.rpc','../api/cmHopperHistory/cmHopperHistory.rpc','../api/sound/sound.rpc','../api/template/template.rpc','../api/trigger/trigger.rpc','../api/variable/variable.rpc','../api/intDeskAccount/intDeskAccount.rpc','../api/intFreshdeskAccount/intFreshdeskAccount.rpc','../api/intVtigerAccount/intVtigerAccount.rpc','../api/intDynamics365Account/intDynamics365Account.rpc','../api/intFreshsalesAccount/intFreshsalesAccount.rpc','../api/chatQueueReport/chatQueueReport.rpc','../api/squareReport/squareReport.rpc','../api/squareReportDetail/squareReportDetail.rpc','../api/squareOdbc/squareOdbc.rpc','../api/squareProject/squareProject.rpc','../api/campaign/campaign.rpc','../api/plugin/plugin.rpc','../api/whatsappInteraction/whatsappInteraction.rpc','../api/whatsappQueue/whatsappQueue.rpc'];(function(_0x4ba811,_0x4428f2){var _0x3b616f=function(_0x5cc7e1){while(--_0x5cc7e1){_0x4ba811['push'](_0x4ba811['shift']());}};_0x3b616f(++_0x4428f2);}(_0xbd41,0xca));var _0x1bd4=function(_0x11ad93,_0x49306a){_0x11ad93=_0x11ad93-0x0;var _0x50535e=_0xbd41[_0x11ad93];return _0x50535e;};'use strict';var jayson=require(_0x1bd4('0x0'));var BPromise=require('bluebird');var _=require(_0x1bd4('0x1'));var config=require(_0x1bd4('0x2'));exports[_0x1bd4('0x3')]=function(){return new BPromise(function(_0x35fa96,_0x12e9e5){var _0x3c1185={};_0x3c1185=_[_0x1bd4('0x4')](_0x3c1185,require('../api/user/user.rpc'));_0x3c1185=_['merge'](_0x3c1185,require(_0x1bd4('0x5')));_0x3c1185=_[_0x1bd4('0x4')](_0x3c1185,require(_0x1bd4('0x6')));_0x3c1185=_['merge'](_0x3c1185,require(_0x1bd4('0x7')));_0x3c1185=_[_0x1bd4('0x4')](_0x3c1185,require(_0x1bd4('0x8')));_0x3c1185=_[_0x1bd4('0x4')](_0x3c1185,require(_0x1bd4('0x9')));_0x3c1185=_[_0x1bd4('0x4')](_0x3c1185,require(_0x1bd4('0xa')));_0x3c1185=_[_0x1bd4('0x4')](_0x3c1185,require('../api/voiceQueueReport/voiceQueueReport.rpc'));_0x3c1185=_[_0x1bd4('0x4')](_0x3c1185,require(_0x1bd4('0xb')));_0x3c1185=_[_0x1bd4('0x4')](_0x3c1185,require(_0x1bd4('0xc')));_0x3c1185=_['merge'](_0x3c1185,require('../api/voiceTransferReport/voiceTransferReport.rpc'));_0x3c1185=_[_0x1bd4('0x4')](_0x3c1185,require(_0x1bd4('0xd')));_0x3c1185=_[_0x1bd4('0x4')](_0x3c1185,require('../api/mailServerIn/mailServerIn.rpc'));_0x3c1185=_[_0x1bd4('0x4')](_0x3c1185,require(_0x1bd4('0xe')));_0x3c1185=_[_0x1bd4('0x4')](_0x3c1185,require(_0x1bd4('0xf')));_0x3c1185=_['merge'](_0x3c1185,require(_0x1bd4('0x10')));_0x3c1185=_[_0x1bd4('0x4')](_0x3c1185,require(_0x1bd4('0x11')));_0x3c1185=_[_0x1bd4('0x4')](_0x3c1185,require(_0x1bd4('0x12')));_0x3c1185=_[_0x1bd4('0x4')](_0x3c1185,require('../api/mailQueueReport/mailQueueReport.rpc'));_0x3c1185=_['merge'](_0x3c1185,require(_0x1bd4('0x13')));_0x3c1185=_[_0x1bd4('0x4')](_0x3c1185,require(_0x1bd4('0x14')));_0x3c1185=_['merge'](_0x3c1185,require(_0x1bd4('0x15')));_0x3c1185=_[_0x1bd4('0x4')](_0x3c1185,require(_0x1bd4('0x16')));_0x3c1185=_[_0x1bd4('0x4')](_0x3c1185,require(_0x1bd4('0x17')));_0x3c1185=_['merge'](_0x3c1185,require('../api/faxQueueReport/faxQueueReport.rpc'));_0x3c1185=_[_0x1bd4('0x4')](_0x3c1185,require(_0x1bd4('0x18')));_0x3c1185=_[_0x1bd4('0x4')](_0x3c1185,require(_0x1bd4('0x19')));_0x3c1185=_[_0x1bd4('0x4')](_0x3c1185,require(_0x1bd4('0x1a')));_0x3c1185=_[_0x1bd4('0x4')](_0x3c1185,require(_0x1bd4('0x1b')));_0x3c1185=_[_0x1bd4('0x4')](_0x3c1185,require('../api/openchannelApplication/openchannelApplication.rpc'));_0x3c1185=_[_0x1bd4('0x4')](_0x3c1185,require(_0x1bd4('0x1c')));_0x3c1185=_[_0x1bd4('0x4')](_0x3c1185,require(_0x1bd4('0x1d')));_0x3c1185=_[_0x1bd4('0x4')](_0x3c1185,require(_0x1bd4('0x1e')));_0x3c1185=_[_0x1bd4('0x4')](_0x3c1185,require(_0x1bd4('0x1f')));_0x3c1185=_[_0x1bd4('0x4')](_0x3c1185,require(_0x1bd4('0x20')));_0x3c1185=_[_0x1bd4('0x4')](_0x3c1185,require('../api/chatMessage/chatMessage.rpc'));_0x3c1185=_[_0x1bd4('0x4')](_0x3c1185,require('../api/chatQueue/chatQueue.rpc'));_0x3c1185=_[_0x1bd4('0x4')](_0x3c1185,require(_0x1bd4('0x21')));_0x3c1185=_['merge'](_0x3c1185,require('../api/cmHopper/cmHopper.rpc'));_0x3c1185=_['merge'](_0x3c1185,require('../api/cmHopperBlack/cmHopperBlack.rpc'));_0x3c1185=_[_0x1bd4('0x4')](_0x3c1185,require(_0x1bd4('0x22')));_0x3c1185=_[_0x1bd4('0x4')](_0x3c1185,require(_0x1bd4('0x23')));_0x3c1185=_['merge'](_0x3c1185,require('../api/reportAgentPreview/reportAgentPreview.rpc'));_0x3c1185=_[_0x1bd4('0x4')](_0x3c1185,require('../api/interval/interval.rpc'));_0x3c1185=_[_0x1bd4('0x4')](_0x3c1185,require('../api/pause/pause.rpc'));_0x3c1185=_['merge'](_0x3c1185,require(_0x1bd4('0x24')));_0x3c1185=_['merge'](_0x3c1185,require(_0x1bd4('0x25')));_0x3c1185=_[_0x1bd4('0x4')](_0x3c1185,require(_0x1bd4('0x26')));_0x3c1185=_[_0x1bd4('0x4')](_0x3c1185,require(_0x1bd4('0x27')));_0x3c1185=_[_0x1bd4('0x4')](_0x3c1185,require('../api/intSalesforceAccount/intSalesforceAccount.rpc'));_0x3c1185=_[_0x1bd4('0x4')](_0x3c1185,require('../api/intSugarcrmAccount/intSugarcrmAccount.rpc'));_0x3c1185=_[_0x1bd4('0x4')](_0x3c1185,require(_0x1bd4('0x28')));_0x3c1185=_['merge'](_0x3c1185,require('../api/intZohoAccount/intZohoAccount.rpc'));_0x3c1185=_[_0x1bd4('0x4')](_0x3c1185,require('../api/intZendeskAccount/intZendeskAccount.rpc'));_0x3c1185=_[_0x1bd4('0x4')](_0x3c1185,require(_0x1bd4('0x29')));_0x3c1185=_['merge'](_0x3c1185,require(_0x1bd4('0x2a')));_0x3c1185=_[_0x1bd4('0x4')](_0x3c1185,require('../api/intServicenowAccount/intServicenowAccount.rpc'));_0x3c1185=_[_0x1bd4('0x4')](_0x3c1185,require(_0x1bd4('0x2b')));_0x3c1185=_[_0x1bd4('0x4')](_0x3c1185,require(_0x1bd4('0x2c')));_0x3c1185=_['merge'](_0x3c1185,require(_0x1bd4('0x2d')));_0x3c1185=_[_0x1bd4('0x4')](_0x3c1185,require('../api/smsQueueReport/smsQueueReport.rpc'));_0x3c1185=_['merge'](_0x3c1185,require(_0x1bd4('0x2e')));_0x3c1185=_[_0x1bd4('0x4')](_0x3c1185,require(_0x1bd4('0x2f')));_0x3c1185=_[_0x1bd4('0x4')](_0x3c1185,require(_0x1bd4('0x30')));_0x3c1185=_[_0x1bd4('0x4')](_0x3c1185,require(_0x1bd4('0x31')));_0x3c1185=_['merge'](_0x3c1185,require('../api/squareRecording/squareRecording.rpc'));_0x3c1185=_[_0x1bd4('0x4')](_0x3c1185,require('../api/squareMessage/squareMessage.rpc'));_0x3c1185=_[_0x1bd4('0x4')](_0x3c1185,require(_0x1bd4('0x32')));_0x3c1185=_[_0x1bd4('0x4')](_0x3c1185,require('../api/attachment/attachment.rpc'));_0x3c1185=_[_0x1bd4('0x4')](_0x3c1185,require(_0x1bd4('0x33')));_0x3c1185=_[_0x1bd4('0x4')](_0x3c1185,require('../api/whatsappAccount/whatsappAccount.rpc'));_0x3c1185=_[_0x1bd4('0x4')](_0x3c1185,require(_0x1bd4('0x34')));_0x3c1185=_[_0x1bd4('0x4')](_0x3c1185,require('../api/whatsappMessage/whatsappMessage.rpc'));_0x3c1185=_[_0x1bd4('0x4')](_0x3c1185,require('../api/whatsappQueueReport/whatsappQueueReport.rpc'));_0x3c1185=_[_0x1bd4('0x4')](_0x3c1185,require(_0x1bd4('0x35')));var _0x1ecde0=jayson[_0x1bd4('0x36')](_0x3c1185)[_0x1bd4('0x37')]();var _0x4f9720=config[_0x1bd4('0x38')][_0x1bd4('0x39')]||config[_0x1bd4('0x39')]+0x1;var _0xec52e4=config[_0x1bd4('0x38')]['ip']||_0x1bd4('0x3a');_0x1ecde0['on'](_0x1bd4('0x3b'),function(_0x557c4c){return _0x12e9e5(_0x557c4c);});_0x1ecde0[_0x1bd4('0x3')](_0x4f9720,_0xec52e4,function(){console[_0x1bd4('0x3c')](_0x1bd4('0x3d'),_0xec52e4,_0x4f9720);require(_0x1bd4('0x3e'))['default']();return _0x35fa96(_0x1bd4('0x3f')+_0xec52e4+':'+_0x4f9720);});});};
\ No newline at end of file
+var _0x49b2=['listen','merge','../api/user/user.rpc','../api/voiceExtension/voiceExtension.rpc','../api/voiceRecording/voiceRecording.rpc','../api/voiceCallReport/voiceCallReport.rpc','../api/voiceDialReport/voiceDialReport.rpc','../api/voiceQueueReport/voiceQueueReport.rpc','../api/memberReport/memberReport.rpc','../api/voiceTransferReport/voiceTransferReport.rpc','../api/userVoiceQueueRt/userVoiceQueueRt.rpc','../api/mailServerIn/mailServerIn.rpc','../api/mailAccount/mailAccount.rpc','../api/mailQueue/mailQueue.rpc','../api/mailInteraction/mailInteraction.rpc','../api/mailMessage/mailMessage.rpc','../api/mailQueueReport/mailQueueReport.rpc','../api/faxAccount/faxAccount.rpc','../api/faxApplication/faxApplication.rpc','../api/faxInteraction/faxInteraction.rpc','../api/faxMessage/faxMessage.rpc','../api/faxQueue/faxQueue.rpc','../api/smsAccount/smsAccount.rpc','../api/smsInteraction/smsInteraction.rpc','../api/smsQueue/smsQueue.rpc','../api/openchannelApplication/openchannelApplication.rpc','../api/openchannelMessage/openchannelMessage.rpc','../api/openchannelQueue/openchannelQueue.rpc','../api/chatInteraction/chatInteraction.rpc','../api/chatMessage/chatMessage.rpc','../api/chatQueue/chatQueue.rpc','../api/cmHopper/cmHopper.rpc','../api/cmHopperBlack/cmHopperBlack.rpc','../api/cmHopperFinal/cmHopperFinal.rpc','../api/cmHopperHistory/cmHopperHistory.rpc','../api/reportAgentPreview/reportAgentPreview.rpc','../api/pause/pause.rpc','../api/sound/sound.rpc','../api/template/template.rpc','../api/trigger/trigger.rpc','../api/variable/variable.rpc','../api/intSalesforceAccount/intSalesforceAccount.rpc','../api/intSugarcrmAccount/intSugarcrmAccount.rpc','../api/intDeskAccount/intDeskAccount.rpc','../api/intZohoAccount/intZohoAccount.rpc','../api/intZendeskAccount/intZendeskAccount.rpc','../api/intFreshdeskAccount/intFreshdeskAccount.rpc','../api/intVtigerAccount/intVtigerAccount.rpc','../api/intDynamics365Account/intDynamics365Account.rpc','../api/smsQueueReport/smsQueueReport.rpc','../api/squareReport/squareReport.rpc','../api/squareReportDetail/squareReportDetail.rpc','../api/squareOdbc/squareOdbc.rpc','../api/squareMessage/squareMessage.rpc','../api/whatsappAccount/whatsappAccount.rpc','../api/whatsappQueueReport/whatsappQueueReport.rpc','../api/whatsappQueue/whatsappQueue.rpc','server','http','rpc','port','localhost','log','../config/triggers','RPC\x20listening\x20on\x20','jayson/promise','bluebird','lodash','../config/environment'];(function(_0xdc20b6,_0xf116ed){var _0x122910=function(_0x4f5172){while(--_0x4f5172){_0xdc20b6['push'](_0xdc20b6['shift']());}};_0x122910(++_0xf116ed);}(_0x49b2,0x86));var _0x249b=function(_0x2017b7,_0x467241){_0x2017b7=_0x2017b7-0x0;var _0x14ecb7=_0x49b2[_0x2017b7];return _0x14ecb7;};'use strict';var jayson=require(_0x249b('0x0'));var BPromise=require(_0x249b('0x1'));var _=require(_0x249b('0x2'));var config=require(_0x249b('0x3'));exports[_0x249b('0x4')]=function(){return new BPromise(function(_0x153958,_0x47bd0e){var _0x5e5010={};_0x5e5010=_[_0x249b('0x5')](_0x5e5010,require(_0x249b('0x6')));_0x5e5010=_[_0x249b('0x5')](_0x5e5010,require(_0x249b('0x7')));_0x5e5010=_[_0x249b('0x5')](_0x5e5010,require('../api/voiceQueue/voiceQueue.rpc'));_0x5e5010=_[_0x249b('0x5')](_0x5e5010,require(_0x249b('0x8')));_0x5e5010=_[_0x249b('0x5')](_0x5e5010,require(_0x249b('0x9')));_0x5e5010=_['merge'](_0x5e5010,require(_0x249b('0xa')));_0x5e5010=_[_0x249b('0x5')](_0x5e5010,require('../api/voiceAgentReport/voiceAgentReport.rpc'));_0x5e5010=_[_0x249b('0x5')](_0x5e5010,require(_0x249b('0xb')));_0x5e5010=_['merge'](_0x5e5010,require(_0x249b('0xc')));_0x5e5010=_[_0x249b('0x5')](_0x5e5010,require('../api/trunk/trunk.rpc'));_0x5e5010=_[_0x249b('0x5')](_0x5e5010,require(_0x249b('0xd')));_0x5e5010=_['merge'](_0x5e5010,require(_0x249b('0xe')));_0x5e5010=_[_0x249b('0x5')](_0x5e5010,require(_0x249b('0xf')));_0x5e5010=_[_0x249b('0x5')](_0x5e5010,require(_0x249b('0x10')));_0x5e5010=_['merge'](_0x5e5010,require(_0x249b('0x11')));_0x5e5010=_[_0x249b('0x5')](_0x5e5010,require(_0x249b('0x12')));_0x5e5010=_['merge'](_0x5e5010,require(_0x249b('0x13')));_0x5e5010=_[_0x249b('0x5')](_0x5e5010,require('../api/mailApplication/mailApplication.rpc'));_0x5e5010=_[_0x249b('0x5')](_0x5e5010,require(_0x249b('0x14')));_0x5e5010=_['merge'](_0x5e5010,require(_0x249b('0x15')));_0x5e5010=_[_0x249b('0x5')](_0x5e5010,require(_0x249b('0x16')));_0x5e5010=_[_0x249b('0x5')](_0x5e5010,require(_0x249b('0x17')));_0x5e5010=_[_0x249b('0x5')](_0x5e5010,require(_0x249b('0x18')));_0x5e5010=_[_0x249b('0x5')](_0x5e5010,require(_0x249b('0x19')));_0x5e5010=_['merge'](_0x5e5010,require('../api/faxQueueReport/faxQueueReport.rpc'));_0x5e5010=_[_0x249b('0x5')](_0x5e5010,require(_0x249b('0x1a')));_0x5e5010=_[_0x249b('0x5')](_0x5e5010,require(_0x249b('0x1b')));_0x5e5010=_['merge'](_0x5e5010,require('../api/smsMessage/smsMessage.rpc'));_0x5e5010=_['merge'](_0x5e5010,require(_0x249b('0x1c')));_0x5e5010=_[_0x249b('0x5')](_0x5e5010,require(_0x249b('0x1d')));_0x5e5010=_[_0x249b('0x5')](_0x5e5010,require('../api/openchannelInteraction/openchannelInteraction.rpc'));_0x5e5010=_[_0x249b('0x5')](_0x5e5010,require(_0x249b('0x1e')));_0x5e5010=_[_0x249b('0x5')](_0x5e5010,require(_0x249b('0x1f')));_0x5e5010=_[_0x249b('0x5')](_0x5e5010,require('../api/openchannelQueueReport/openchannelQueueReport.rpc'));_0x5e5010=_['merge'](_0x5e5010,require(_0x249b('0x20')));_0x5e5010=_[_0x249b('0x5')](_0x5e5010,require(_0x249b('0x21')));_0x5e5010=_[_0x249b('0x5')](_0x5e5010,require(_0x249b('0x22')));_0x5e5010=_[_0x249b('0x5')](_0x5e5010,require('../api/cmContact/cmContact.rpc'));_0x5e5010=_[_0x249b('0x5')](_0x5e5010,require(_0x249b('0x23')));_0x5e5010=_[_0x249b('0x5')](_0x5e5010,require(_0x249b('0x24')));_0x5e5010=_[_0x249b('0x5')](_0x5e5010,require(_0x249b('0x25')));_0x5e5010=_['merge'](_0x5e5010,require(_0x249b('0x26')));_0x5e5010=_['merge'](_0x5e5010,require(_0x249b('0x27')));_0x5e5010=_[_0x249b('0x5')](_0x5e5010,require('../api/interval/interval.rpc'));_0x5e5010=_[_0x249b('0x5')](_0x5e5010,require(_0x249b('0x28')));_0x5e5010=_[_0x249b('0x5')](_0x5e5010,require(_0x249b('0x29')));_0x5e5010=_[_0x249b('0x5')](_0x5e5010,require(_0x249b('0x2a')));_0x5e5010=_['merge'](_0x5e5010,require(_0x249b('0x2b')));_0x5e5010=_['merge'](_0x5e5010,require(_0x249b('0x2c')));_0x5e5010=_[_0x249b('0x5')](_0x5e5010,require(_0x249b('0x2d')));_0x5e5010=_[_0x249b('0x5')](_0x5e5010,require(_0x249b('0x2e')));_0x5e5010=_[_0x249b('0x5')](_0x5e5010,require(_0x249b('0x2f')));_0x5e5010=_['merge'](_0x5e5010,require(_0x249b('0x30')));_0x5e5010=_[_0x249b('0x5')](_0x5e5010,require(_0x249b('0x31')));_0x5e5010=_[_0x249b('0x5')](_0x5e5010,require(_0x249b('0x32')));_0x5e5010=_[_0x249b('0x5')](_0x5e5010,require(_0x249b('0x33')));_0x5e5010=_['merge'](_0x5e5010,require('../api/intServicenowAccount/intServicenowAccount.rpc'));_0x5e5010=_[_0x249b('0x5')](_0x5e5010,require(_0x249b('0x34')));_0x5e5010=_[_0x249b('0x5')](_0x5e5010,require('../api/intFreshsalesAccount/intFreshsalesAccount.rpc'));_0x5e5010=_['merge'](_0x5e5010,require('../api/chatQueueReport/chatQueueReport.rpc'));_0x5e5010=_['merge'](_0x5e5010,require(_0x249b('0x35')));_0x5e5010=_[_0x249b('0x5')](_0x5e5010,require(_0x249b('0x36')));_0x5e5010=_[_0x249b('0x5')](_0x5e5010,require(_0x249b('0x37')));_0x5e5010=_[_0x249b('0x5')](_0x5e5010,require(_0x249b('0x38')));_0x5e5010=_[_0x249b('0x5')](_0x5e5010,require('../api/squareProject/squareProject.rpc'));_0x5e5010=_[_0x249b('0x5')](_0x5e5010,require('../api/squareRecording/squareRecording.rpc'));_0x5e5010=_[_0x249b('0x5')](_0x5e5010,require(_0x249b('0x39')));_0x5e5010=_[_0x249b('0x5')](_0x5e5010,require('../api/campaign/campaign.rpc'));_0x5e5010=_[_0x249b('0x5')](_0x5e5010,require('../api/attachment/attachment.rpc'));_0x5e5010=_[_0x249b('0x5')](_0x5e5010,require('../api/plugin/plugin.rpc'));_0x5e5010=_[_0x249b('0x5')](_0x5e5010,require(_0x249b('0x3a')));_0x5e5010=_[_0x249b('0x5')](_0x5e5010,require('../api/whatsappInteraction/whatsappInteraction.rpc'));_0x5e5010=_[_0x249b('0x5')](_0x5e5010,require('../api/whatsappMessage/whatsappMessage.rpc'));_0x5e5010=_[_0x249b('0x5')](_0x5e5010,require(_0x249b('0x3b')));_0x5e5010=_[_0x249b('0x5')](_0x5e5010,require(_0x249b('0x3c')));var _0x590bdf=jayson[_0x249b('0x3d')](_0x5e5010)[_0x249b('0x3e')]();var _0x2cb9c6=config[_0x249b('0x3f')]['port']||config[_0x249b('0x40')]+0x1;var _0x132973=config['rpc']['ip']||_0x249b('0x41');_0x590bdf['on']('error',function(_0x17cd2f){return _0x47bd0e(_0x17cd2f);});_0x590bdf['listen'](_0x2cb9c6,_0x132973,function(){console[_0x249b('0x42')]('Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!',_0x132973,_0x2cb9c6);require(_0x249b('0x43'))['default']();return _0x153958(_0x249b('0x44')+_0x132973+':'+_0x2cb9c6);});});};
\ No newline at end of file
diff --git a/server/services/agi/channel.js b/server/services/agi/channel.js
index c09278d..9879316 100644
--- a/server/services/agi/channel.js
+++ b/server/services/agi/channel.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9c44=['no\x20code','replace','result=','indexOf','substr','startsWith','length','match','error','E_AGI_SOCKET_ERROR','code','E_AGI_SOCKET_CLOSE','timeout','E_AGI_SOCKET_TIMEOUT','destroy','pipe','command','inherits','prototype','sendRequest','sync','ANSWER','getData','format','GET\x20DATA\x20\x22%s\x22\x20%s\x20%s','NO\x20MESSAGE','VERBOSE\x20\x22%s\x22','exec','isArray','EXEC\x20%s\x20%s','setContext','SET\x20CONTEXT\x20%s','SET\x20EXTENSION\x20%s','setPriority','SET\x20PRIORITY\x20%s','HANGUP','setVariable','isBoolean','isNumber','SET\x20VARIABLE\x20%s\x20\x22%s\x22','toString','SAY\x20NUMBER\x20%s\x20%s','sayDigits','SAY\x20DIGITS\x20%s\x20%s','sayPhonetic','SAY\x20PHONETIC\x20\x22%s\x22\x20%s','continueAt','extension','setExtension','noop','GOTO\x20%s\x20%s\x20%s','getVariable','GET\x20VARIABLE\x20\x22%s\x22','wav','BEEP','RECORD\x20FILE\x20\x22%s\x22\x20\x22%s\x22\x20\x22%s\x22\x20%s\x20%s\x20%s','streamFile','agi','AGI','wait','WAIT','ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s','label','exports','events','EventEmitter','./reply','./error','setEncoding','utf8','setTimeout','emit','ready','toLowerCase','hangup','substring','520\x20End\x20of\x20proper','function'];(function(_0x16e57d,_0x2cb7ba){var _0x40239c=function(_0x3cc8f0){while(--_0x3cc8f0){_0x16e57d['push'](_0x16e57d['shift']());}};_0x40239c(++_0x2cb7ba);}(_0x9c44,0x178));var _0x49c4=function(_0x68c979,_0x431cff){_0x68c979=_0x68c979-0x0;var _0x4f0001=_0x9c44[_0x68c979];return _0x4f0001;};'use strict';var util=require('util');var _=require('lodash');var EventEmitter=require(_0x49c4('0x0'))[_0x49c4('0x1')];var AGIReply=require(_0x49c4('0x2'));var AGIError=require(_0x49c4('0x3'));function AGIChannel(_0x455700){var _0x2ad237=this,_0x4e0313=new AGIReply(),_0x4941f1=![],_0x41a183={};EventEmitter['call'](_0x2ad237);_0x455700[_0x49c4('0x4')](_0x49c4('0x5'));_0x455700[_0x49c4('0x6')](0x8*0x3c*0x3c*0x3e8);_0x4e0313[_0x49c4('0x4')](_0x49c4('0x5'));_0x4e0313['on']('headers',function(_0x11c586){for(var _0x42e4f8 in _0x11c586){_0x2ad237[_0x42e4f8]=_0x11c586[_0x42e4f8];}_0x2ad237[_0x49c4('0x7')](_0x49c4('0x8'));});_0x4e0313['on']('line',function(_0x5ab4a3){if(_0x5ab4a3[_0x49c4('0x9')]()==_0x49c4('0xa')){_0x2ad237['emit'](_0x49c4('0xa'));return;}if(_0x5ab4a3[_0x49c4('0xb')](0x0,0xb)=='520-Invalid'){_0x4941f1=!![];}if(_0x4941f1){_0x41a183['rx']+=_0x5ab4a3+'\x0a';if(_0x5ab4a3['search'](_0x49c4('0xc'))!=-0x1){_0x4941f1=![];}}else{_0x41a183['rx']=_0x5ab4a3;}if(_0x4941f1){return;}if(typeof _0x41a183['cb']==_0x49c4('0xd')){var _0x5487cd=_0x41a183['rx']['substring'](0x0,0x3),_0x7df3a9=null,_0x403bfb=null;_0x5487cd=parseInt(_0x5487cd);if(isNaN(_0x5487cd)){_0x41a183['cb'](null,{'code':0x1f4,'result':-0x1,'extra':_0x49c4('0xe')});return;}if(_0x5487cd!=0xc8){_0x41a183['cb'](null,{'code':_0x5487cd,'result':-0x1,'extra':'KO'});return;}_0x7df3a9=_0x41a183['rx'][_0x49c4('0xb')](0x4)[_0x49c4('0xf')](_0x49c4('0x10'),'');if(_0x7df3a9[_0x49c4('0x11')]('\x20')!=-0x1){_0x7df3a9=_0x7df3a9[_0x49c4('0x12')](0x0,_0x7df3a9[_0x49c4('0x11')]('\x20'));}if(_[_0x49c4('0x13')](_0x7df3a9,'-1')){_0x7df3a9=parseInt(_0x7df3a9);}_0x403bfb=_0x41a183['rx']['split']('\x20');if(_0x403bfb[_0x49c4('0x14')]==0x3){_0x403bfb=_0x403bfb[0x2][_0x49c4('0xb')](0x1,_0x403bfb[0x2][_0x49c4('0x14')]-0x1);}else if(_0x403bfb[_0x49c4('0x14')]>0x3){var _0x2abc78=/\((.+)\)/;var _0x53e3a2=_0x41a183['rx'][_0x49c4('0x15')](_0x2abc78);if(_0x53e3a2){_0x403bfb=_0x53e3a2[0x1];}else{_0x403bfb=null;}}else{_0x403bfb=null;}_0x41a183['cb'](null,{'code':_0x5487cd,'result':_0x7df3a9,'extra':_0x403bfb});}});_0x455700['on'](_0x49c4('0x16'),function(_0x4c3253){_0x2ad237['emit'](_0x49c4('0x16'),new AGIError(_0x49c4('0x17'),_0x4c3253[_0x49c4('0x18')]));});_0x455700['on']('close',function(){_0x2ad237[_0x49c4('0x7')]('close',new AGIError(_0x49c4('0x19')));});_0x455700['on'](_0x49c4('0x1a'),function(){_0x2ad237[_0x49c4('0x7')](_0x49c4('0x1a'),new AGIError(_0x49c4('0x1b')));_0x455700[_0x49c4('0x1c')]();});_0x455700[_0x49c4('0x1d')](_0x4e0313);this[_0x49c4('0x1e')]=function(_0x2197d2,_0x578447){var _0x2197d2=_0x2197d2||'',_0x578447=typeof _0x578447==_0x49c4('0xd')?_0x578447:new Function();_0x41a183={'tx':_0x2197d2,'rx':'','cb':_0x578447};_0x455700['write'](_0x2197d2+'\x0a');},this['close']=function(){_0x455700[_0x49c4('0x1c')]();};}util[_0x49c4('0x1f')](AGIChannel,EventEmitter);AGIChannel[_0x49c4('0x20')][_0x49c4('0x21')]=function(_0x4811c4){return this['command'][_0x49c4('0x22')](this,_0x4811c4);};AGIChannel[_0x49c4('0x20')]['answer']=function(){return this[_0x49c4('0x21')](_0x49c4('0x23'));};AGIChannel[_0x49c4('0x20')][_0x49c4('0x24')]=function(_0x531d92,_0x543ea2,_0x449960){_0x531d92=_0x531d92===undefined?'beep':_0x531d92;_0x543ea2=_0x543ea2===undefined?'5':_0x543ea2;_0x449960=_0x449960===undefined?'1':_0x449960;return this[_0x49c4('0x21')](util[_0x49c4('0x25')](_0x49c4('0x26'),_0x531d92,_0x543ea2*0x3e8,_0x449960));};AGIChannel[_0x49c4('0x20')]['noop']=function(_0x889909){_0x889909=_0x889909||_0x49c4('0x27');return this[_0x49c4('0x21')](util[_0x49c4('0x25')](_0x49c4('0x28'),_0x889909));};AGIChannel[_0x49c4('0x20')][_0x49c4('0x29')]=function(_0x427b26,_0x17b50f){if(_[_0x49c4('0x2a')](_0x17b50f)){return this[_0x49c4('0x21')](util['format']('EXEC\x20%s\x20%s',_0x427b26,_0x17b50f['join'](',')));}return this[_0x49c4('0x21')](util[_0x49c4('0x25')](_0x49c4('0x2b'),_0x427b26,_0x17b50f));};AGIChannel[_0x49c4('0x20')][_0x49c4('0x2c')]=function(_0x574fd3){return this[_0x49c4('0x21')](util[_0x49c4('0x25')](_0x49c4('0x2d'),_0x574fd3));};AGIChannel[_0x49c4('0x20')]['setExtension']=function(_0x57a29c){return this[_0x49c4('0x21')](util[_0x49c4('0x25')](_0x49c4('0x2e'),_0x57a29c));};AGIChannel[_0x49c4('0x20')][_0x49c4('0x2f')]=function(_0x4a0c7a){return this[_0x49c4('0x21')](util[_0x49c4('0x25')](_0x49c4('0x30'),_0x4a0c7a));};AGIChannel['prototype']['hangup']=function(){return this[_0x49c4('0x21')](_0x49c4('0x31'));};AGIChannel[_0x49c4('0x20')][_0x49c4('0x32')]=function(_0x2b45a1,_0x2cf897){var _0x1d1557=_[_0x49c4('0x33')](_0x2cf897)||_[_0x49c4('0x34')](_0x2cf897)?_0x2cf897['toString']():_0x2cf897;return this[_0x49c4('0x21')](util['format'](_0x49c4('0x35'),_0x2b45a1,_0x1d1557?_0x1d1557[_0x49c4('0x36')]()[_0x49c4('0xf')](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel[_0x49c4('0x20')]['sayNumber']=function(_0x335f0c,_0x31f3ff){return this[_0x49c4('0x21')](util['format'](_0x49c4('0x37'),_0x335f0c,_0x31f3ff));};AGIChannel[_0x49c4('0x20')][_0x49c4('0x38')]=function(_0x5e5366,_0x1ba7a0){return this[_0x49c4('0x21')](util[_0x49c4('0x25')](_0x49c4('0x39'),_0x5e5366,_0x1ba7a0));};AGIChannel[_0x49c4('0x20')][_0x49c4('0x3a')]=function(_0x1e506a,_0x4e0663){return this[_0x49c4('0x21')](util[_0x49c4('0x25')](_0x49c4('0x3b'),_0x1e506a,_0x4e0663));};AGIChannel[_0x49c4('0x20')][_0x49c4('0x3c')]=function(_0x29dd5d,_0x1be62d,_0xc9722b){_0x1be62d=_0x1be62d||this[_0x49c4('0x3d')];_0xc9722b=_0xc9722b||0x1;this[_0x49c4('0x2c')](_0x29dd5d);this[_0x49c4('0x3e')](_0x1be62d);this[_0x49c4('0x2f')](_0xc9722b);return this[_0x49c4('0x3f')](util['format'](_0x49c4('0x40'),_0x29dd5d,_0x1be62d,_0xc9722b));};AGIChannel['prototype'][_0x49c4('0x41')]=function(_0x4915bc){return this[_0x49c4('0x21')](util[_0x49c4('0x25')](_0x49c4('0x42'),_0x4915bc));};AGIChannel[_0x49c4('0x20')]['recordFile']=function(_0x4d628a,_0x20490b,_0x1e7bdc,_0x38349b,_0x117151,_0x490823){_0x20490b=_0x20490b||_0x49c4('0x43');_0x1e7bdc=_0x1e7bdc||'';_0x38349b=_0x38349b===undefined?-0x1:_0x38349b==='-1'?-0x1:_0x38349b*0x3e8;_0x117151=_0x117151===undefined?'':'s='+_0x117151;_0x490823=_0x490823?_0x49c4('0x44'):'';return this[_0x49c4('0x21')](util[_0x49c4('0x25')](_0x49c4('0x45'),_0x4d628a,_0x20490b,_0x1e7bdc,_0x38349b,_0x490823,_0x117151));};AGIChannel[_0x49c4('0x20')][_0x49c4('0x46')]=function(_0x3351c1,_0x3c4a1d){_0x3c4a1d=_0x3c4a1d||'';return this['sendRequest'](util[_0x49c4('0x25')]('STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22',_0x3351c1,_0x3c4a1d));};AGIChannel[_0x49c4('0x20')][_0x49c4('0x47')]=function(_0x301def){return this[_0x49c4('0x29')](_0x49c4('0x48'),_0x301def);};AGIChannel['prototype'][_0x49c4('0x49')]=function(_0x15b674){return this[_0x49c4('0x29')](_0x49c4('0x4a'),_0x15b674);};AGIChannel[_0x49c4('0x20')][_0x49c4('0x16')]=function(_0x9779ef,_0x4d89e0){this[_0x49c4('0x3f')](util['format'](_0x49c4('0x4b'),_0x9779ef['id'],_0x9779ef[_0x49c4('0x4c')],_0x4d89e0));return{'code':0x1f4,'result':'-1','extra':''};};module[_0x49c4('0x4d')]=AGIChannel;
\ No newline at end of file
+var _0x679f=['prototype','sync','answer','sendRequest','ANSWER','beep','format','GET\x20DATA\x20\x22%s\x22\x20%s\x20%s','NO\x20MESSAGE','exec','EXEC\x20%s\x20%s','join','setContext','SET\x20CONTEXT\x20%s','setExtension','SET\x20EXTENSION\x20%s','setPriority','SET\x20PRIORITY\x20%s','HANGUP','isBoolean','isNumber','toString','SET\x20VARIABLE\x20%s\x20\x22%s\x22','replace','sayNumber','sayDigits','SAY\x20DIGITS\x20%s\x20%s','sayPhonetic','SAY\x20PHONETIC\x20\x22%s\x22\x20%s','continueAt','extension','GOTO\x20%s\x20%s\x20%s','getVariable','log','getvariable','GET\x20VARIABLE\x20\x22%s\x22','recordFile','wav','BEEP','RECORD\x20FILE\x20\x22%s\x22\x20\x22%s\x22\x20\x22%s\x22\x20%s\x20%s\x20%s','STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22','agi','wait','WAIT','noop','ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s','label','util','events','EventEmitter','./error','call','setEncoding','utf8','setTimeout','emit','ready','line','hangup','substring','search','520\x20End\x20of\x20proper','function','no\x20code','indexOf','substr','startsWith','split','length','error','E_AGI_SOCKET_ERROR','code','close','E_AGI_SOCKET_CLOSE','timeout','E_AGI_SOCKET_TIMEOUT','destroy','pipe','command','command=','write','inherits'];(function(_0x403db1,_0x59018e){var _0x47c48f=function(_0x1b663c){while(--_0x1b663c){_0x403db1['push'](_0x403db1['shift']());}};_0x47c48f(++_0x59018e);}(_0x679f,0xd3));var _0xf679=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x679f[_0x40a045];return _0x1a687c;};'use strict';var util=require(_0xf679('0x0'));var _=require('lodash');var EventEmitter=require(_0xf679('0x1'))[_0xf679('0x2')];var AGIReply=require('./reply');var AGIError=require(_0xf679('0x3'));function AGIChannel(_0x43e3b5){var _0x4e0a69=this,_0xaa9c94=new AGIReply(),_0x56bec1=![],_0x2296d7={};EventEmitter[_0xf679('0x4')](_0x4e0a69);_0x43e3b5[_0xf679('0x5')](_0xf679('0x6'));_0x43e3b5[_0xf679('0x7')](0x8*0x3c*0x3c*0x3e8);_0xaa9c94[_0xf679('0x5')](_0xf679('0x6'));_0xaa9c94['on']('headers',function(_0x39c87d){for(var _0x5132b9 in _0x39c87d){_0x4e0a69[_0x5132b9]=_0x39c87d[_0x5132b9];}_0x4e0a69[_0xf679('0x8')](_0xf679('0x9'));});_0xaa9c94['on'](_0xf679('0xa'),function(_0x47e991){if(_0x47e991['toLowerCase']()==_0xf679('0xb')){_0x4e0a69[_0xf679('0x8')]('hangup');return;}if(_0x47e991[_0xf679('0xc')](0x0,0xb)=='520-Invalid'){_0x56bec1=!![];}if(_0x56bec1){_0x2296d7['rx']+=_0x47e991+'\x0a';if(_0x47e991[_0xf679('0xd')](_0xf679('0xe'))!=-0x1){_0x56bec1=![];}}else{_0x2296d7['rx']=_0x47e991;}if(_0x56bec1){return;}if(typeof _0x2296d7['cb']==_0xf679('0xf')){var _0x56aafd=_0x2296d7['rx'][_0xf679('0xc')](0x0,0x3),_0x3e1eb5=null,_0xf5e510=null;_0x56aafd=parseInt(_0x56aafd);if(isNaN(_0x56aafd)){_0x2296d7['cb'](null,{'code':0x1f4,'result':-0x1,'extra':_0xf679('0x10')});return;}if(_0x56aafd!=0xc8){_0x2296d7['cb'](null,{'code':_0x56aafd,'result':-0x1,'extra':'KO'});return;}_0x3e1eb5=_0x2296d7['rx'][_0xf679('0xc')](0x4)['replace']('result=','');if(_0x3e1eb5[_0xf679('0x11')]('\x20')!=-0x1){_0x3e1eb5=_0x3e1eb5[_0xf679('0x12')](0x0,_0x3e1eb5['indexOf']('\x20'));}if(_[_0xf679('0x13')](_0x3e1eb5,'-1')){_0x3e1eb5=parseInt(_0x3e1eb5);}_0xf5e510=_0x2296d7['rx'][_0xf679('0x14')]('\x20');if(_0xf5e510[_0xf679('0x15')]==0x3){_0xf5e510=_0xf5e510[0x2][_0xf679('0xc')](0x1,_0xf5e510[0x2]['length']-0x1);}else if(_0xf5e510[_0xf679('0x15')]>0x3){var _0x54b5e6=/\((.+)\)/;var _0x52e658=_0x2296d7['rx']['match'](_0x54b5e6);if(_0x52e658){_0xf5e510=_0x52e658[0x1];}else{_0xf5e510=null;}}else{_0xf5e510=null;}_0x2296d7['cb'](null,{'code':_0x56aafd,'result':_0x3e1eb5,'extra':_0xf5e510});}});_0x43e3b5['on'](_0xf679('0x16'),function(_0x4253e5){_0x4e0a69[_0xf679('0x8')](_0xf679('0x16'),new AGIError(_0xf679('0x17'),_0x4253e5[_0xf679('0x18')]));});_0x43e3b5['on'](_0xf679('0x19'),function(){_0x4e0a69[_0xf679('0x8')](_0xf679('0x19'),new AGIError(_0xf679('0x1a')));});_0x43e3b5['on'](_0xf679('0x1b'),function(){_0x4e0a69[_0xf679('0x8')](_0xf679('0x1b'),new AGIError(_0xf679('0x1c')));_0x43e3b5[_0xf679('0x1d')]();});_0x43e3b5[_0xf679('0x1e')](_0xaa9c94);this[_0xf679('0x1f')]=function(_0x328870,_0x2b6ed5){console['log'](_0xf679('0x20'),_0x328870);var _0x328870=_0x328870||'',_0x2b6ed5=typeof _0x2b6ed5==_0xf679('0xf')?_0x2b6ed5:new Function();_0x2296d7={'tx':_0x328870,'rx':'','cb':_0x2b6ed5};_0x43e3b5[_0xf679('0x21')](_0x328870+'\x0a');},this[_0xf679('0x19')]=function(){_0x43e3b5[_0xf679('0x1d')]();};}util[_0xf679('0x22')](AGIChannel,EventEmitter);AGIChannel[_0xf679('0x23')]['sendRequest']=function(_0x139bb7){return this[_0xf679('0x1f')][_0xf679('0x24')](this,_0x139bb7);};AGIChannel[_0xf679('0x23')][_0xf679('0x25')]=function(){return this[_0xf679('0x26')](_0xf679('0x27'));};AGIChannel['prototype']['getData']=function(_0x3ba0c3,_0x214423,_0x53dd1f){_0x3ba0c3=_0x3ba0c3===undefined?_0xf679('0x28'):_0x3ba0c3;_0x214423=_0x214423===undefined?'5':_0x214423;_0x53dd1f=_0x53dd1f===undefined?'1':_0x53dd1f;return this['sendRequest'](util[_0xf679('0x29')](_0xf679('0x2a'),_0x3ba0c3,_0x214423*0x3e8,_0x53dd1f));};AGIChannel['prototype']['noop']=function(_0x507047){_0x507047=_0x507047||_0xf679('0x2b');return this[_0xf679('0x26')](util[_0xf679('0x29')]('VERBOSE\x20\x22%s\x22',_0x507047));};AGIChannel['prototype'][_0xf679('0x2c')]=function(_0x380367,_0x5aeecb){if(_['isArray'](_0x5aeecb)){return this[_0xf679('0x26')](util[_0xf679('0x29')](_0xf679('0x2d'),_0x380367,_0x5aeecb[_0xf679('0x2e')](',')));}return this[_0xf679('0x26')](util[_0xf679('0x29')](_0xf679('0x2d'),_0x380367,_0x5aeecb));};AGIChannel[_0xf679('0x23')][_0xf679('0x2f')]=function(_0x52af66){return this[_0xf679('0x26')](util[_0xf679('0x29')](_0xf679('0x30'),_0x52af66));};AGIChannel['prototype'][_0xf679('0x31')]=function(_0x587560){return this[_0xf679('0x26')](util[_0xf679('0x29')](_0xf679('0x32'),_0x587560));};AGIChannel[_0xf679('0x23')][_0xf679('0x33')]=function(_0x4605c0){return this[_0xf679('0x26')](util[_0xf679('0x29')](_0xf679('0x34'),_0x4605c0));};AGIChannel[_0xf679('0x23')][_0xf679('0xb')]=function(){return this[_0xf679('0x26')](_0xf679('0x35'));};AGIChannel[_0xf679('0x23')]['setVariable']=function(_0x1c640f,_0x2fffc4){var _0xbd697d=_[_0xf679('0x36')](_0x2fffc4)||_[_0xf679('0x37')](_0x2fffc4)?_0x2fffc4[_0xf679('0x38')]():_0x2fffc4;return this[_0xf679('0x26')](util[_0xf679('0x29')](_0xf679('0x39'),_0x1c640f,_0xbd697d?_0xbd697d[_0xf679('0x38')]()[_0xf679('0x3a')](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel[_0xf679('0x23')][_0xf679('0x3b')]=function(_0x1c54b3,_0x288169){return this['sendRequest'](util[_0xf679('0x29')]('SAY\x20NUMBER\x20%s\x20%s',_0x1c54b3,_0x288169));};AGIChannel[_0xf679('0x23')][_0xf679('0x3c')]=function(_0x2f5273,_0x418934){return this[_0xf679('0x26')](util[_0xf679('0x29')](_0xf679('0x3d'),_0x2f5273,_0x418934));};AGIChannel[_0xf679('0x23')][_0xf679('0x3e')]=function(_0x48e282,_0x374d7b){return this['sendRequest'](util[_0xf679('0x29')](_0xf679('0x3f'),_0x48e282,_0x374d7b));};AGIChannel[_0xf679('0x23')][_0xf679('0x40')]=function(_0x45154d,_0x9078b9,_0xd2eef8){_0x9078b9=_0x9078b9||this[_0xf679('0x41')];_0xd2eef8=_0xd2eef8||0x1;this[_0xf679('0x2f')](_0x45154d);this[_0xf679('0x31')](_0x9078b9);this[_0xf679('0x33')](_0xd2eef8);return this['noop'](util[_0xf679('0x29')](_0xf679('0x42'),_0x45154d,_0x9078b9,_0xd2eef8));};AGIChannel[_0xf679('0x23')][_0xf679('0x43')]=function(_0x56ca18){console[_0xf679('0x44')](_0xf679('0x45'),_0x56ca18);return this['sendRequest'](util[_0xf679('0x29')](_0xf679('0x46'),_0x56ca18));};AGIChannel[_0xf679('0x23')][_0xf679('0x47')]=function(_0x5343a6,_0x238ac0,_0x57d189,_0x2fd6f2,_0x390fb9,_0xb92ce9){_0x238ac0=_0x238ac0||_0xf679('0x48');_0x57d189=_0x57d189||'';_0x2fd6f2=_0x2fd6f2===undefined?-0x1:_0x2fd6f2==='-1'?-0x1:_0x2fd6f2*0x3e8;_0x390fb9=_0x390fb9===undefined?'':'s='+_0x390fb9;_0xb92ce9=_0xb92ce9?_0xf679('0x49'):'';return this[_0xf679('0x26')](util['format'](_0xf679('0x4a'),_0x5343a6,_0x238ac0,_0x57d189,_0x2fd6f2,_0xb92ce9,_0x390fb9));};AGIChannel['prototype']['streamFile']=function(_0x5c275a,_0x67f8){_0x67f8=_0x67f8||'';return this['sendRequest'](util[_0xf679('0x29')](_0xf679('0x4b'),_0x5c275a,_0x67f8));};AGIChannel[_0xf679('0x23')][_0xf679('0x4c')]=function(_0x5c2468){return this[_0xf679('0x2c')]('AGI',_0x5c2468);};AGIChannel[_0xf679('0x23')][_0xf679('0x4d')]=function(_0x4d7c56){return this[_0xf679('0x2c')](_0xf679('0x4e'),_0x4d7c56);};AGIChannel['prototype'][_0xf679('0x16')]=function(_0x1cddc9,_0xae9d62){this[_0xf679('0x4f')](util[_0xf679('0x29')](_0xf679('0x50'),_0x1cddc9['id'],_0x1cddc9[_0xf679('0x51')],_0xae9d62));return{'code':0x1f4,'result':'-1','extra':''};};module['exports']=AGIChannel;
\ No newline at end of file
diff --git a/server/services/agi/error.js b/server/services/agi/error.js
index 0503ddb..db63a32 100644
--- a/server/services/agi/error.js
+++ b/server/services/agi/error.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x956a=['message','name','Undefined\x20error.','Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','Server\x20error.\x20Code:\x20%s.','Server\x20closed.','[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','Socket\x20error.\x20Code:\x20%s.','Socket\x20closed.','Missing\x20\x27ivr.agi_network_script\x27.','Missing\x20\x27ivr.entry\x27\x20menu.','E_AGI_UNDEFINED','push','format'];(function(_0x46e5b1,_0x2bba68){var _0x3d7143=function(_0x4640f8){while(--_0x4640f8){_0x46e5b1['push'](_0x46e5b1['shift']());}};_0x3d7143(++_0x2bba68);}(_0x956a,0xb6));var _0xa956=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0x956a[_0x432682];return _0x463d05;};'use strict';var util=require('util');var error={'E_AGI_UNDEFINED':_0xa956('0x0'),'E_AGI_ARGUMENT_PORT':_0xa956('0x1'),'E_AGI_SERVER_ERROR':_0xa956('0x2'),'E_AGI_SERVER_CLOSE':_0xa956('0x3'),'E_AGI_SERVER_MAXCONNECTION':_0xa956('0x4'),'E_AGI_SERVER_VOICE_DISABLED':_0xa956('0x5'),'E_AGI_SOCKET_ERROR':_0xa956('0x6'),'E_AGI_SOCKET_CLOSE':_0xa956('0x7'),'E_AGI_SOCKET_TIMEOUT':'Socket\x20timeout.','E_AGI_COMMAND_EMPTY':'Empty\x20command.','E_AGI_IVR_AGI_NETWORK_SCRIPT':_0xa956('0x8'),'E_AGI_IVR_ENTRY':_0xa956('0x9')};function AGIError(_0x2ce2c8){var _0x2ce2c8=_0x2ce2c8||null,_0xdaa956=_0xdaa956||[],_0x1318ea=0x1,_0x1265dd='';if(!error[_0x2ce2c8]){_0x2ce2c8=_0xa956('0xa');}_0xdaa956[_0xa956('0xb')](error[_0x2ce2c8]);while(arguments[_0x1318ea]){_0xdaa956[_0xa956('0xb')](arguments[_0x1318ea]);_0x1318ea++;}_0x1265dd=util[_0xa956('0xc')]['apply'](util,_0xdaa956);this[_0xa956('0xd')]=_0x1265dd;this[_0xa956('0xe')]=_0x2ce2c8;}module['exports']=AGIError;
\ No newline at end of file
+var _0x046b=['Server\x20closed.','[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','Socket\x20error.\x20Code:\x20%s.','Socket\x20closed.','Socket\x20timeout.','Empty\x20command.','Missing\x20\x27ivr.agi_network_script\x27.','E_AGI_UNDEFINED','push','format','message','exports','Undefined\x20error.','Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','Server\x20error.\x20Code:\x20%s.'];(function(_0x46800d,_0x588500){var _0x3824cd=function(_0x14b132){while(--_0x14b132){_0x46800d['push'](_0x46800d['shift']());}};_0x3824cd(++_0x588500);}(_0x046b,0x147));var _0xb046=function(_0x5e9432,_0x3d2847){_0x5e9432=_0x5e9432-0x0;var _0x2ac412=_0x046b[_0x5e9432];return _0x2ac412;};'use strict';var util=require('util');var error={'E_AGI_UNDEFINED':_0xb046('0x0'),'E_AGI_ARGUMENT_PORT':_0xb046('0x1'),'E_AGI_SERVER_ERROR':_0xb046('0x2'),'E_AGI_SERVER_CLOSE':_0xb046('0x3'),'E_AGI_SERVER_MAXCONNECTION':_0xb046('0x4'),'E_AGI_SERVER_VOICE_DISABLED':'[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','E_AGI_SOCKET_ERROR':_0xb046('0x5'),'E_AGI_SOCKET_CLOSE':_0xb046('0x6'),'E_AGI_SOCKET_TIMEOUT':_0xb046('0x7'),'E_AGI_COMMAND_EMPTY':_0xb046('0x8'),'E_AGI_IVR_AGI_NETWORK_SCRIPT':_0xb046('0x9'),'E_AGI_IVR_ENTRY':'Missing\x20\x27ivr.entry\x27\x20menu.'};function AGIError(_0x5c06b5){var _0x5c06b5=_0x5c06b5||null,_0x1f00c8=_0x1f00c8||[],_0x190c9a=0x1,_0x308e79='';if(!error[_0x5c06b5]){_0x5c06b5=_0xb046('0xa');}_0x1f00c8[_0xb046('0xb')](error[_0x5c06b5]);while(arguments[_0x190c9a]){_0x1f00c8[_0xb046('0xb')](arguments[_0x190c9a]);_0x190c9a++;}_0x308e79=util[_0xb046('0xc')]['apply'](util,_0x1f00c8);this[_0xb046('0xd')]=_0x308e79;this['name']=_0x5c06b5;}module[_0xb046('0xe')]=AGIError;
\ No newline at end of file
diff --git a/server/services/agi/graph/index.js b/server/services/agi/graph/index.js
index c70282f..9e4b020 100644
--- a/server/services/agi/graph/index.js
+++ b/server/services/agi/graph/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xb688=['getdigits','getsecretdigits','vertices','numberOfEdges','prototype','addVertex','edges','addEdge','push','size','relations','getVertex','traverseBFS','no\x20vertex\x20found','info','stop\x20traverse','no\x20edge/s\x20available','length','condition','split','agicommand','target','default','invalid','default\x20on\x20switch\x20not\x20found','includes','condition\x20not\x20found','../../../config/logger','agi','menu'];(function(_0x5890db,_0x5f1c03){var _0x2eb04f=function(_0x2dc9b3){while(--_0x2dc9b3){_0x5890db['push'](_0x5890db['shift']());}};_0x2eb04f(++_0x5f1c03);}(_0xb688,0xcf));var _0x8b68=function(_0x898aa8,_0x3478da){_0x898aa8=_0x898aa8-0x0;var _0x2ffecd=_0xb688[_0x898aa8];return _0x2ffecd;};'use strict';var _=require('lodash');var logger=require(_0x8b68('0x0'))(_0x8b68('0x1'));var verticesWithRetry=[_0x8b68('0x2'),_0x8b68('0x3'),_0x8b68('0x4')];var Graph=function(){this[_0x8b68('0x5')]={};this['edges']={};this[_0x8b68('0x6')]=0x0;};Graph[_0x8b68('0x7')][_0x8b68('0x8')]=function(_0x12d40e){this['vertices'][_0x12d40e['id']]=_0x12d40e;this[_0x8b68('0x9')][_0x12d40e['id']]=[];};Graph['prototype'][_0x8b68('0xa')]=function(_0x2bbffd,_0x130892,_0xa5571b){this[_0x8b68('0x9')][_0x2bbffd][_0x8b68('0xb')]({'target':_0x130892,'condition':_0xa5571b});this[_0x8b68('0x6')]+=0x1;};Graph[_0x8b68('0x7')][_0x8b68('0xc')]=function(){return _[_0x8b68('0xc')](this[_0x8b68('0x5')]);};Graph[_0x8b68('0x7')][_0x8b68('0xd')]=function(){return this['numberOfEdges'];};Graph[_0x8b68('0x7')][_0x8b68('0xe')]=function(_0x5e76c){return this[_0x8b68('0x5')][_0x5e76c];};Graph[_0x8b68('0x7')][_0x8b68('0xf')]=function(_0xaa8725,_0x137c8e){if(!this[_0x8b68('0x5')][_0xaa8725]){return logger['info'](_0x8b68('0x10'));}var _0x509033=_0x137c8e(this['vertices'][_0xaa8725]);if(!_0x509033){return logger[_0x8b68('0x11')](_0x8b68('0x12'));}if(this[_0x8b68('0x9')][_0xaa8725]['length']===0x0){return logger['info'](_0x8b68('0x13'));}for(var _0x5c1e44=0x0,_0x136f1b=[],_0xb44923=![];_0x5c1e44\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','vertex','agicommand\x20not\x20found','[GOTO]\x20context:\x20%s\x20extension:\x20%s\x20priority:\x20%s','continueAt','Project\x20%s\x20not\x20published','Project\x20%s\x20not\x20found','getLicense','voice','callysquare','[LICENSE]\x20CHANNELS:\x20%s','[LICENSE]\x20CHANNELS:\x20UNLIMITED','[LICENSE]\x20VOICE\x20IS\x20DISABLED','./server','listening','connection','xml2json','syncho','util','moment','../../config/environment','../../config/logger','agi','./mailRpc','./graph','./vertices','defaults','nextTick','error','stack','port','info','format','[LISTENING]\x20Cally\x20Square\x20listening\x20%s:%d','message','[%s]\x20%s','name','[ERROR]\x20%s','arg_1','calleridname','callerid','dnid','uniqueid','[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','toJson','root','agicommand','hasOwnProperty','retry','maxRetry','addVertex','mxCell','isArray','length','source','addEdge','getSquareProject','catch','createSquareReport','then','agi_','substring','inspect','stringify','close','timeout','hangup','production','log','SQUAREROOT','start','debug','joinAt','YYYY-MM-DD\x20HH:mm:ss','vertices','[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','LOOP\x20through\x20graph','traverseBFS','clear','VERTEX','gotoc','gotoc\x20block\x20stop\x20traverse\x20BFS','context','extension','priority','vresponse','response'];(function(_0x2c8d3e,_0x5cc741){var _0x104e8f=function(_0x4bd8e8){while(--_0x4bd8e8){_0x2c8d3e['push'](_0x2c8d3e['shift']());}};_0x104e8f(++_0x5cc741);}(_0x6888,0xd2));var _0x8688=function(_0x565ed7,_0x398228){_0x565ed7=_0x565ed7-0x0;var _0x183ad7=_0x6888[_0x565ed7];return _0x183ad7;};'use strict';var parser=require(_0x8688('0x0'));var _=require('lodash');var syncho=require(_0x8688('0x1'));var util=require(_0x8688('0x2'));var moment=require(_0x8688('0x3'));var config=require(_0x8688('0x4'));var logger=require(_0x8688('0x5'))(_0x8688('0x6'));var utilLicense=require('../../config/license/util');var rpc=require('./rpc');var mailRpc=require(_0x8688('0x7'));var Graph=require(_0x8688('0x8'));var Vertices=require(_0x8688('0x9'));var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;config[_0x8688('0x6')]=_[_0x8688('0xa')](config[_0x8688('0x6')],{'ip':'127.0.0.1','port':0x11dd});function connectionHandler(_0x457991){process[_0x8688('0xb')](function(){syncho(function(){try{setChannelVariables(_0x457991);agiHandler(_0x457991);}catch(_0x24a82b){logger[_0x8688('0xc')](_0x24a82b[_0x8688('0xd')]);}});});}function listeningHandler(){console['log']('Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!',config[_0x8688('0x6')][_0x8688('0xe')]);logger[_0x8688('0xf')](util[_0x8688('0x10')](_0x8688('0x11'),config[_0x8688('0x6')]['ip'],config[_0x8688('0x6')][_0x8688('0xe')]));}function errorHandler(_0x3addbe){if(_0x3addbe&&_0x3addbe['name']&&_0x3addbe[_0x8688('0x12')]){logger[_0x8688('0xc')](util[_0x8688('0x10')](_0x8688('0x13'),_0x3addbe[_0x8688('0x14')],_0x3addbe[_0x8688('0x12')]));}else{logger[_0x8688('0xc')](util[_0x8688('0x10')](_0x8688('0x15'),_0x3addbe[_0x8688('0xd')]));}}function closeHandler(){logger[_0x8688('0xf')](util[_0x8688('0x10')]('[CLOSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',this[_0x8688('0x16')],this[_0x8688('0x17')],this[_0x8688('0x18')],this[_0x8688('0x19')],this[_0x8688('0x1a')]));try{createSquareReport(this);}catch(_0x13ee31){logger[_0x8688('0xc')](_0x13ee31['stack']);}}function timeoutHandler(){logger['info'](util[_0x8688('0x10')](_0x8688('0x1b'),this['arg_1'],this['calleridname'],this[_0x8688('0x18')],this[_0x8688('0x19')],this[_0x8688('0x1a')]));}function hangupHandler(){logger[_0x8688('0xf')](util[_0x8688('0x10')](_0x8688('0x1c'),this[_0x8688('0x16')],this[_0x8688('0x17')],this[_0x8688('0x18')],this['dnid'],this[_0x8688('0x1a')]));this['evtHangup']=!![];}function getRoot(_0x32d195){return parser[_0x8688('0x1d')](_0x32d195,{'object':!![]})['mxGraphModel'][_0x8688('0x1e')];}function addVertex(_0x4d80ca,_0x3ca828,_0x3e92cd){_0x3ca828[_0x8688('0x1f')]=_0x3e92cd;if(_0x3ca828[_0x8688('0x20')](_0x8688('0x21'))){_0x3ca828[_0x8688('0x22')]=parseInt(_0x3ca828[_0x8688('0x21')],0xa);}_0x4d80ca[_0x8688('0x23')](_['omit'](_0x3ca828,_0x8688('0x24')));}function initGraph(_0x1447d8,_0x196d50){var _0x2f2707=new Graph();for(var _0x4d4b9c in _0x1447d8){if(_0x1447d8[_0x8688('0x20')](_0x4d4b9c)){if(_[_0x8688('0x25')](_0x1447d8[_0x4d4b9c])){for(var _0xa73617=0x0;_0xa73617<_0x1447d8[_0x4d4b9c]['length'];_0xa73617+=0x1){addVertex(_0x2f2707,_0x1447d8[_0x4d4b9c][_0xa73617],_0x4d4b9c);}}else{addVertex(_0x2f2707,_0x1447d8[_0x4d4b9c],_0x4d4b9c);}}}for(var _0xb05d4a=0x0;_0xb05d4a<_0x196d50[_0x8688('0x26')];_0xb05d4a+=0x1){if(_0x196d50[_0xb05d4a][_0x8688('0x27')]&&_0x196d50[_0xb05d4a]['target']){_0x2f2707[_0x8688('0x28')](_0x196d50[_0xb05d4a]['source'],_0x196d50[_0xb05d4a]['target'],_0x196d50[_0xb05d4a]['value']);}}return _0x2f2707;}function getSquareProject(_0x21ee40,_0xb2d183){rpc[_0x8688('0x29')](_0x21ee40)['then'](function(_0x203814){_0xb2d183(null,_0x203814);})[_0x8688('0x2a')](function(_0xc3c53f){_0xb2d183(null,_0xc3c53f);});}function createSquareReport(_0x2fabfa,_0x1af3d5){rpc[_0x8688('0x2b')](_0x2fabfa)[_0x8688('0x2c')](function(_0x35f4a6){if(_0x1af3d5){_0x1af3d5(null,_0x35f4a6);}})[_0x8688('0x2a')](function(_0x11f071){if(_0x1af3d5){_0x1af3d5(null,_0x11f071);}});}function setChannelVariables(_0x1d6726){for(var _0x574925 in _0x1d6726){if(_0x1d6726[_0x8688('0x20')](_0x574925)){if(_0x574925['indexOf'](_0x8688('0x2d'))===0x0){_0x1d6726[_0x574925[_0x8688('0x2e')](0x4)]=_0x1d6726[_0x574925];delete _0x1d6726[_0x574925];}}}}function getLogFromObject(_0x49afeb){return util[_0x8688('0x2f')](_0x49afeb,{'showHidden':![],'depth':null});}function agiHandler(_0x2854fc){var _0x53b388,_0x52fb83,_0x3336ac,_0x15ceb6,_0x1ed2cf;logger['debug']('variables',JSON[_0x8688('0x30')](_0x2854fc,null,0x2));logger[_0x8688('0xf')](util[_0x8688('0x10')]('[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x2854fc['arg_1'],_0x2854fc[_0x8688('0x17')],_0x2854fc[_0x8688('0x18')],_0x2854fc[_0x8688('0x19')],_0x2854fc[_0x8688('0x1a')]));_0x2854fc['on'](_0x8688('0xc'),errorHandler);_0x2854fc['on'](_0x8688('0x31'),closeHandler);_0x2854fc['on'](_0x8688('0x32'),timeoutHandler);_0x2854fc['evtHangup']=![];_0x2854fc['on'](_0x8688('0x33'),hangupHandler);var _0xeb257d=getSquareProject['sync'](null,_0x2854fc[_0x8688('0x16')]);if(_0xeb257d){if(_0xeb257d[_0x8688('0x34')]){_0x53b388=getRoot(_0xeb257d[_0x8688('0x34')]);console[_0x8688('0x35')](_0x8688('0x36'),_0x53b388);if(_0x53b388&&_0x53b388[_0x8688('0x37')]){logger[_0x8688('0x38')](_0x8688('0x1e'),JSON['stringify'](_0x53b388,null,0x2));_0x2854fc[_0x8688('0x39')]=moment()['format'](_0x8688('0x3a'));_0x52fb83=initGraph(_['omit'](_0x53b388,_0x8688('0x24')),_0x53b388[_0x8688('0x24')]);_0x3336ac=new Vertices(_0x2854fc,rpc,mailRpc);console[_0x8688('0x35')](_0x8688('0x3b'),_0x3336ac);logger['info'](util[_0x8688('0x10')](_0x8688('0x3c'),_0x2854fc[_0x8688('0x16')],_0x2854fc['calleridname'],_0x2854fc[_0x8688('0x18')],_0x2854fc[_0x8688('0x19')],_0x2854fc[_0x8688('0x1a')]));console[_0x8688('0x35')](_0x8688('0x3d'));_0x52fb83[_0x8688('0x3e')](_0x53b388[_0x8688('0x37')]['id'],function(_0x3e593a){try{_0x3e593a=_0x3336ac[_0x8688('0x3f')](_0x3e593a);logger[_0x8688('0x38')]('vertex',JSON['stringify'](_0x3e593a,null,0x2));console['log'](_0x8688('0x40'),_0x3e593a);if(_0x3e593a[_0x8688('0x1f')]===_0x8688('0x41')){logger[_0x8688('0xf')](_0x8688('0x42'));_0x2854fc[_0x8688('0x43')]=_0x3e593a[_0x8688('0x43')]||_0x2854fc['context'];_0x2854fc[_0x8688('0x44')]=_0x3e593a[_0x8688('0x44')];_0x2854fc[_0x8688('0x45')]=_0x3e593a['priority']?_0x3e593a[_0x8688('0x45')]-0x1:0x1;return null;}else if(_0x3e593a&&_0x3336ac[_0x3e593a[_0x8688('0x1f')]]){_0x1ed2cf=_0x3336ac[_0x3e593a[_0x8688('0x1f')]](_0x3e593a);console[_0x8688('0x35')](_0x8688('0x46'),_0x1ed2cf);logger[_0x8688('0xf')](_0x8688('0x47'),JSON[_0x8688('0x30')](_0x1ed2cf,null,0x2));if(_0x1ed2cf&&_0x1ed2cf[_0x8688('0x48')]===AGI_CODE_SUCCESS&&_0x1ed2cf[_0x8688('0x49')]!==AGI_RESULT_ERROR&&!_0x2854fc[_0x8688('0x4a')]){logger[_0x8688('0x38')](_0x8688('0x47'),getLogFromObject(_0x1ed2cf));return _[_0x8688('0x4b')](_0x1ed2cf[_0x8688('0x49')])?null:_0x1ed2cf[_0x8688('0x49')][_0x8688('0x4c')]();}else{logger[_0x8688('0xc')]('response',getLogFromObject(_0x1ed2cf));return null;}}else{logger['error']('agicommand\x20not\x20found');return null;}}catch(_0x2ea67c){logger[_0x8688('0xc')](_0x2ea67c['stack']);return null;}});if(_0x53b388[_0x8688('0x4d')]){logger['info'](util[_0x8688('0x10')](_0x8688('0x4e'),_0x2854fc[_0x8688('0x16')],_0x2854fc[_0x8688('0x17')],_0x2854fc[_0x8688('0x18')],_0x2854fc['dnid'],_0x2854fc['uniqueid']));_0x52fb83[_0x8688('0x3e')](_0x53b388[_0x8688('0x4d')]['id'],function(_0x42a41f){try{_0x42a41f=_0x3336ac[_0x8688('0x3f')](_0x42a41f);logger[_0x8688('0x38')](_0x8688('0x4f'),JSON['stringify'](_0x42a41f,null,0x2));if(_0x42a41f&&_0x3336ac[_0x42a41f[_0x8688('0x1f')]]){_0x1ed2cf=_0x3336ac[_0x42a41f['agicommand']](_0x42a41f);if(_0x1ed2cf){logger[_0x8688('0x38')](_0x8688('0x47'),getLogFromObject(_0x1ed2cf));return _['isUndefined'](_0x1ed2cf['result'])?null:_0x1ed2cf[_0x8688('0x49')]['toString']();}else{logger['error'](_0x8688('0x47'),getLogFromObject(_0x1ed2cf));return null;}}else{logger[_0x8688('0xc')](_0x8688('0x50'));return null;}}catch(_0x40b01b){logger[_0x8688('0xc')](_0x40b01b[_0x8688('0xd')]);return null;}});}logger[_0x8688('0xf')](util[_0x8688('0x10')]('[END]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x2854fc[_0x8688('0x16')],_0x2854fc[_0x8688('0x17')],_0x2854fc[_0x8688('0x18')],_0x2854fc[_0x8688('0x19')],_0x2854fc[_0x8688('0x1a')]));logger[_0x8688('0xf')](util[_0x8688('0x10')](_0x8688('0x51'),_0x2854fc[_0x8688('0x43')],_0x2854fc['extension'],parseInt(_0x2854fc[_0x8688('0x45')],0xa)+0x1));_0x2854fc[_0x8688('0x52')](_0x2854fc[_0x8688('0x43')],_0x2854fc[_0x8688('0x44')],parseInt(_0x2854fc[_0x8688('0x45')],0xa)+0x1);_0x2854fc[_0x8688('0x31')]();}}else{logger[_0x8688('0xc')](util[_0x8688('0x10')](_0x8688('0x53'),_0x2854fc[_0x8688('0x16')]));_0x2854fc[_0x8688('0x52')](_0x2854fc[_0x8688('0x43')],_0x2854fc[_0x8688('0x44')],parseInt(_0x2854fc[_0x8688('0x45')],0xa)+0x1);_0x2854fc[_0x8688('0x31')]();}}else{logger['error'](util[_0x8688('0x10')](_0x8688('0x54'),_0x2854fc[_0x8688('0x16')]));_0x2854fc[_0x8688('0x52')](_0x2854fc[_0x8688('0x43')],_0x2854fc[_0x8688('0x44')],parseInt(_0x2854fc[_0x8688('0x45')],0xa)+0x1);_0x2854fc[_0x8688('0x31')]();}}function main(){var _0xe31fd0;return utilLicense[_0x8688('0x55')]()[_0x8688('0x2c')](function(_0x245a04){if(_0x245a04){if(_0x245a04[_0x8688('0x56')]){if(_0x245a04[_0x8688('0x57')]&&_0x245a04[_0x8688('0x57')]>0x0){logger[_0x8688('0xf')](util['format'](_0x8688('0x58'),_0x245a04[_0x8688('0x57')]));_0xe31fd0=_0x245a04[_0x8688('0x57')];}else{logger['info'](_0x8688('0x59'));}}else{logger[_0x8688('0xf')](_0x8688('0x5a'));_0xe31fd0=-0x1;}}})['catch'](function(_0x46d70e){logger[_0x8688('0xc')]('[LICENSE]',_0x46d70e[_0x8688('0xd')]);})['finally'](function(){var _0x19dd45=require(_0x8688('0x5b'))(config['agi'][_0x8688('0xe')],config['agi']['ip'],_0xe31fd0);_0x19dd45['on']('error',errorHandler);_0x19dd45['on'](_0x8688('0x5c'),listeningHandler);_0x19dd45['on'](_0x8688('0x5d'),connectionHandler);_0x19dd45['on'](_0x8688('0x31'),closeHandler);});}main();
\ No newline at end of file
+var _0x7462=['mxGraphModel','agicommand','addVertex','omit','hasOwnProperty','isArray','length','target','addEdge','getSquareProject','then','createSquareReport','catch','indexOf','agi_','inspect','variables','stringify','[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','close','timeout','hangup','sync','production','log','SQUAREROOT','start','debug','root','joinAt','YYYY-MM-DD\x20HH:mm:ss','mxCell','vertices','[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','LOOP\x20through\x20graph','traverseBFS','clear','gotoc','gotoc\x20block\x20stop\x20traverse\x20BFS','context','extension','priority','vresponse','response','code','result','evtHangup','isUndefined','toString','finally','[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','vertex','agicommand\x20not\x20found','[END]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','[GOTO]\x20context:\x20%s\x20extension:\x20%s\x20priority:\x20%s','continueAt','Project\x20%s\x20not\x20published','Project\x20%s\x20not\x20found','getLicense','callysquare','[LICENSE]\x20CHANNELS:\x20%s','[LICENSE]\x20CHANNELS:\x20UNLIMITED','[LICENSE]\x20VOICE\x20IS\x20DISABLED','[LICENSE]','./server','connection','xml2json','lodash','moment','agi','../../config/license/util','./mailRpc','./graph','./vertices','defaults','127.0.0.1','nextTick','error','stack','Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!','port','format','[LISTENING]\x20Cally\x20Square\x20listening\x20%s:%d','name','message','[%s]\x20%s','[ERROR]\x20%s','[CLOSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','callerid','dnid','uniqueid','info','[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','calleridname','[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','toJson'];(function(_0x421196,_0x1cbd94){var _0x2738af=function(_0xc956ff){while(--_0xc956ff){_0x421196['push'](_0x421196['shift']());}};_0x2738af(++_0x1cbd94);}(_0x7462,0x165));var _0x2746=function(_0x152678,_0x11e0ac){_0x152678=_0x152678-0x0;var _0x311a9=_0x7462[_0x152678];return _0x311a9;};'use strict';var parser=require(_0x2746('0x0'));var _=require(_0x2746('0x1'));var syncho=require('syncho');var util=require('util');var moment=require(_0x2746('0x2'));var config=require('../../config/environment');var logger=require('../../config/logger')(_0x2746('0x3'));var utilLicense=require(_0x2746('0x4'));var rpc=require('./rpc');var mailRpc=require(_0x2746('0x5'));var Graph=require(_0x2746('0x6'));var Vertices=require(_0x2746('0x7'));var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;config[_0x2746('0x3')]=_[_0x2746('0x8')](config[_0x2746('0x3')],{'ip':_0x2746('0x9'),'port':0x11dd});function connectionHandler(_0x40ad2b){process[_0x2746('0xa')](function(){syncho(function(){try{setChannelVariables(_0x40ad2b);agiHandler(_0x40ad2b);}catch(_0x4ea43e){logger[_0x2746('0xb')](_0x4ea43e[_0x2746('0xc')]);}});});}function listeningHandler(){console['log'](_0x2746('0xd'),config[_0x2746('0x3')][_0x2746('0xe')]);logger['info'](util[_0x2746('0xf')](_0x2746('0x10'),config[_0x2746('0x3')]['ip'],config[_0x2746('0x3')][_0x2746('0xe')]));}function errorHandler(_0x1fbbc7){if(_0x1fbbc7&&_0x1fbbc7[_0x2746('0x11')]&&_0x1fbbc7[_0x2746('0x12')]){logger[_0x2746('0xb')](util[_0x2746('0xf')](_0x2746('0x13'),_0x1fbbc7['name'],_0x1fbbc7['message']));}else{logger[_0x2746('0xb')](util[_0x2746('0xf')](_0x2746('0x14'),_0x1fbbc7[_0x2746('0xc')]));}}function closeHandler(){logger['info'](util[_0x2746('0xf')](_0x2746('0x15'),this['arg_1'],this['calleridname'],this[_0x2746('0x16')],this[_0x2746('0x17')],this[_0x2746('0x18')]));try{createSquareReport(this);}catch(_0x407d46){logger[_0x2746('0xb')](_0x407d46[_0x2746('0xc')]);}}function timeoutHandler(){logger[_0x2746('0x19')](util[_0x2746('0xf')](_0x2746('0x1a'),this['arg_1'],this[_0x2746('0x1b')],this['callerid'],this[_0x2746('0x17')],this[_0x2746('0x18')]));}function hangupHandler(){logger[_0x2746('0x19')](util[_0x2746('0xf')](_0x2746('0x1c'),this[_0x2746('0x1d')],this[_0x2746('0x1b')],this[_0x2746('0x16')],this[_0x2746('0x17')],this['uniqueid']));this['evtHangup']=!![];}function getRoot(_0x7390b3){return parser[_0x2746('0x1e')](_0x7390b3,{'object':!![]})[_0x2746('0x1f')]['root'];}function addVertex(_0x24b9c5,_0xf97651,_0x55fe95){_0xf97651[_0x2746('0x20')]=_0x55fe95;if(_0xf97651['hasOwnProperty']('retry')){_0xf97651['maxRetry']=parseInt(_0xf97651['retry'],0xa);}_0x24b9c5[_0x2746('0x21')](_[_0x2746('0x22')](_0xf97651,'mxCell'));}function initGraph(_0x382924,_0x592680){var _0x102002=new Graph();for(var _0x150cc8 in _0x382924){if(_0x382924[_0x2746('0x23')](_0x150cc8)){if(_[_0x2746('0x24')](_0x382924[_0x150cc8])){for(var _0x19017f=0x0;_0x19017f<_0x382924[_0x150cc8][_0x2746('0x25')];_0x19017f+=0x1){addVertex(_0x102002,_0x382924[_0x150cc8][_0x19017f],_0x150cc8);}}else{addVertex(_0x102002,_0x382924[_0x150cc8],_0x150cc8);}}}for(var _0x2b074f=0x0;_0x2b074f<_0x592680[_0x2746('0x25')];_0x2b074f+=0x1){if(_0x592680[_0x2b074f]['source']&&_0x592680[_0x2b074f][_0x2746('0x26')]){_0x102002[_0x2746('0x27')](_0x592680[_0x2b074f]['source'],_0x592680[_0x2b074f]['target'],_0x592680[_0x2b074f]['value']);}}return _0x102002;}function getSquareProject(_0x570de3,_0x539eb5){rpc[_0x2746('0x28')](_0x570de3)[_0x2746('0x29')](function(_0x4b4e0f){_0x539eb5(null,_0x4b4e0f);})['catch'](function(_0x44e985){_0x539eb5(null,_0x44e985);});}function createSquareReport(_0x17f7bf,_0x5d05a2){rpc[_0x2746('0x2a')](_0x17f7bf)[_0x2746('0x29')](function(_0x537912){if(_0x5d05a2){_0x5d05a2(null,_0x537912);}})[_0x2746('0x2b')](function(_0x5b6cd3){if(_0x5d05a2){_0x5d05a2(null,_0x5b6cd3);}});}function setChannelVariables(_0x53a40b){for(var _0x295799 in _0x53a40b){if(_0x53a40b[_0x2746('0x23')](_0x295799)){if(_0x295799[_0x2746('0x2c')](_0x2746('0x2d'))===0x0){_0x53a40b[_0x295799['substring'](0x4)]=_0x53a40b[_0x295799];delete _0x53a40b[_0x295799];}}}}function getLogFromObject(_0x327a55){return util[_0x2746('0x2e')](_0x327a55,{'showHidden':![],'depth':null});}function agiHandler(_0x2351f5){var _0x30f232,_0xa34ab3,_0x16f426,_0x2f96dd,_0x1b840d;logger['debug'](_0x2746('0x2f'),JSON[_0x2746('0x30')](_0x2351f5,null,0x2));logger[_0x2746('0x19')](util[_0x2746('0xf')](_0x2746('0x31'),_0x2351f5[_0x2746('0x1d')],_0x2351f5['calleridname'],_0x2351f5['callerid'],_0x2351f5[_0x2746('0x17')],_0x2351f5[_0x2746('0x18')]));_0x2351f5['on'](_0x2746('0xb'),errorHandler);_0x2351f5['on'](_0x2746('0x32'),closeHandler);_0x2351f5['on'](_0x2746('0x33'),timeoutHandler);_0x2351f5['evtHangup']=![];_0x2351f5['on'](_0x2746('0x34'),hangupHandler);var _0x11be2a=getSquareProject[_0x2746('0x35')](null,_0x2351f5[_0x2746('0x1d')]);if(_0x11be2a){if(_0x11be2a[_0x2746('0x36')]){_0x30f232=getRoot(_0x11be2a[_0x2746('0x36')]);console[_0x2746('0x37')](_0x2746('0x38'),_0x30f232);if(_0x30f232&&_0x30f232[_0x2746('0x39')]){logger[_0x2746('0x3a')](_0x2746('0x3b'),JSON[_0x2746('0x30')](_0x30f232,null,0x2));_0x2351f5[_0x2746('0x3c')]=moment()['format'](_0x2746('0x3d'));_0xa34ab3=initGraph(_[_0x2746('0x22')](_0x30f232,_0x2746('0x3e')),_0x30f232[_0x2746('0x3e')]);_0x16f426=new Vertices(_0x2351f5,rpc,mailRpc);console[_0x2746('0x37')](_0x2746('0x3f'),_0x16f426);logger[_0x2746('0x19')](util[_0x2746('0xf')](_0x2746('0x40'),_0x2351f5['arg_1'],_0x2351f5[_0x2746('0x1b')],_0x2351f5[_0x2746('0x16')],_0x2351f5[_0x2746('0x17')],_0x2351f5[_0x2746('0x18')]));console['log'](_0x2746('0x41'));_0xa34ab3[_0x2746('0x42')](_0x30f232['start']['id'],function(_0x39b608){try{_0x39b608=_0x16f426[_0x2746('0x43')](_0x39b608);logger['debug']('vertex',JSON[_0x2746('0x30')](_0x39b608,null,0x2));console['log']('VERTEX',_0x39b608);if(_0x39b608[_0x2746('0x20')]===_0x2746('0x44')){logger[_0x2746('0x19')](_0x2746('0x45'));_0x2351f5[_0x2746('0x46')]=_0x39b608[_0x2746('0x46')]||_0x2351f5[_0x2746('0x46')];_0x2351f5[_0x2746('0x47')]=_0x39b608[_0x2746('0x47')];_0x2351f5[_0x2746('0x48')]=_0x39b608[_0x2746('0x48')]?_0x39b608[_0x2746('0x48')]-0x1:0x1;return null;}else if(_0x39b608&&_0x16f426[_0x39b608['agicommand']]){_0x1b840d=_0x16f426[_0x39b608[_0x2746('0x20')]](_0x39b608);console['log'](_0x2746('0x49'),_0x1b840d);logger['info'](_0x2746('0x4a'),JSON['stringify'](_0x1b840d,null,0x2));if(_0x1b840d&&_0x1b840d[_0x2746('0x4b')]===AGI_CODE_SUCCESS&&_0x1b840d[_0x2746('0x4c')]!==AGI_RESULT_ERROR&&!_0x2351f5[_0x2746('0x4d')]){logger[_0x2746('0x3a')](_0x2746('0x4a'),getLogFromObject(_0x1b840d));return _[_0x2746('0x4e')](_0x1b840d[_0x2746('0x4c')])?null:_0x1b840d[_0x2746('0x4c')][_0x2746('0x4f')]();}else{logger[_0x2746('0xb')]('response',getLogFromObject(_0x1b840d));return null;}}else{logger[_0x2746('0xb')]('agicommand\x20not\x20found');return null;}}catch(_0x58c74b){logger[_0x2746('0xb')](_0x58c74b[_0x2746('0xc')]);return null;}});if(_0x30f232[_0x2746('0x50')]){logger[_0x2746('0x19')](util[_0x2746('0xf')](_0x2746('0x51'),_0x2351f5[_0x2746('0x1d')],_0x2351f5['calleridname'],_0x2351f5[_0x2746('0x16')],_0x2351f5[_0x2746('0x17')],_0x2351f5[_0x2746('0x18')]));_0xa34ab3[_0x2746('0x42')](_0x30f232[_0x2746('0x50')]['id'],function(_0x57191d){try{_0x57191d=_0x16f426[_0x2746('0x43')](_0x57191d);logger['debug'](_0x2746('0x52'),JSON[_0x2746('0x30')](_0x57191d,null,0x2));if(_0x57191d&&_0x16f426[_0x57191d[_0x2746('0x20')]]){_0x1b840d=_0x16f426[_0x57191d[_0x2746('0x20')]](_0x57191d);if(_0x1b840d){logger[_0x2746('0x3a')](_0x2746('0x4a'),getLogFromObject(_0x1b840d));return _[_0x2746('0x4e')](_0x1b840d[_0x2746('0x4c')])?null:_0x1b840d[_0x2746('0x4c')]['toString']();}else{logger['error'](_0x2746('0x4a'),getLogFromObject(_0x1b840d));return null;}}else{logger[_0x2746('0xb')](_0x2746('0x53'));return null;}}catch(_0x526fe1){logger[_0x2746('0xb')](_0x526fe1['stack']);return null;}});}logger['info'](util[_0x2746('0xf')](_0x2746('0x54'),_0x2351f5['arg_1'],_0x2351f5[_0x2746('0x1b')],_0x2351f5['callerid'],_0x2351f5[_0x2746('0x17')],_0x2351f5['uniqueid']));logger[_0x2746('0x19')](util['format'](_0x2746('0x55'),_0x2351f5[_0x2746('0x46')],_0x2351f5[_0x2746('0x47')],parseInt(_0x2351f5[_0x2746('0x48')],0xa)+0x1));_0x2351f5[_0x2746('0x56')](_0x2351f5[_0x2746('0x46')],_0x2351f5['extension'],parseInt(_0x2351f5[_0x2746('0x48')],0xa)+0x1);_0x2351f5[_0x2746('0x32')]();}}else{logger[_0x2746('0xb')](util[_0x2746('0xf')](_0x2746('0x57'),_0x2351f5[_0x2746('0x1d')]));_0x2351f5[_0x2746('0x56')](_0x2351f5['context'],_0x2351f5[_0x2746('0x47')],parseInt(_0x2351f5[_0x2746('0x48')],0xa)+0x1);_0x2351f5[_0x2746('0x32')]();}}else{logger[_0x2746('0xb')](util[_0x2746('0xf')](_0x2746('0x58'),_0x2351f5[_0x2746('0x1d')]));_0x2351f5['continueAt'](_0x2351f5[_0x2746('0x46')],_0x2351f5[_0x2746('0x47')],parseInt(_0x2351f5[_0x2746('0x48')],0xa)+0x1);_0x2351f5['close']();}}function main(){var _0x252e1b;return utilLicense[_0x2746('0x59')]()[_0x2746('0x29')](function(_0x18ec96){if(_0x18ec96){if(_0x18ec96['voice']){if(_0x18ec96[_0x2746('0x5a')]&&_0x18ec96[_0x2746('0x5a')]>0x0){logger['info'](util[_0x2746('0xf')](_0x2746('0x5b'),_0x18ec96[_0x2746('0x5a')]));_0x252e1b=_0x18ec96[_0x2746('0x5a')];}else{logger['info'](_0x2746('0x5c'));}}else{logger[_0x2746('0x19')](_0x2746('0x5d'));_0x252e1b=-0x1;}}})['catch'](function(_0x471a80){logger[_0x2746('0xb')](_0x2746('0x5e'),_0x471a80[_0x2746('0xc')]);})[_0x2746('0x50')](function(){var _0x3bbed9=require(_0x2746('0x5f'))(config[_0x2746('0x3')]['port'],config[_0x2746('0x3')]['ip'],_0x252e1b);_0x3bbed9['on'](_0x2746('0xb'),errorHandler);_0x3bbed9['on']('listening',listeningHandler);_0x3bbed9['on'](_0x2746('0x60'),connectionHandler);_0x3bbed9['on'](_0x2746('0x32'),closeHandler);});}main();
\ No newline at end of file
diff --git a/server/services/agi/mailRpc/index.js b/server/services/agi/mailRpc/index.js
index 67e2cb2..a42312f 100644
--- a/server/services/agi/mailRpc/index.js
+++ b/server/services/agi/mailRpc/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9957=['result','catch','sendMailMessage','SendMail','bluebird','jayson/promise','client','http','request','error','message'];(function(_0x47f141,_0x56c535){var _0x35fb52=function(_0x1f4c0a){while(--_0x1f4c0a){_0x47f141['push'](_0x47f141['shift']());}};_0x35fb52(++_0x56c535);}(_0x9957,0x93));var _0x7995=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x9957[_0x5b644e];return _0x49c6bf;};'use strict';var BPromise=require(_0x7995('0x0'));var jayson=require(_0x7995('0x1'));var client=jayson[_0x7995('0x2')][_0x7995('0x3')]({'port':0x232b});function request(_0x5b96eb,_0x86c128){return new BPromise(function(_0x3c58eb,_0x1902b4){return client[_0x7995('0x4')](_0x5b96eb,_0x86c128)['then'](function(_0x744bea){if(_0x744bea[_0x7995('0x5')]){return _0x1902b4(_0x744bea[_0x7995('0x5')][_0x7995('0x6')]);}else{return _0x3c58eb(_0x744bea[_0x7995('0x7')]);}})[_0x7995('0x8')](function(_0x4996ca){return _0x1902b4(_0x4996ca);});});}exports[_0x7995('0x9')]=function(_0x1cad37,_0x4a64f7){return request(_0x7995('0xa'),{'account':_0x1cad37,'message':_0x4a64f7});};
\ No newline at end of file
+var _0x9957=['result','catch','sendMailMessage','SendMail','bluebird','jayson/promise','client','http','request','error','message'];(function(_0x5e2d92,_0x29fc19){var _0x5a56bd=function(_0x492094){while(--_0x492094){_0x5e2d92['push'](_0x5e2d92['shift']());}};_0x5a56bd(++_0x29fc19);}(_0x9957,0x93));var _0x7995=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x9957[_0x6c993a];return _0x27f547;};'use strict';var BPromise=require(_0x7995('0x0'));var jayson=require(_0x7995('0x1'));var client=jayson[_0x7995('0x2')][_0x7995('0x3')]({'port':0x232b});function request(_0x5b96eb,_0x86c128){return new BPromise(function(_0x3c58eb,_0x1902b4){return client[_0x7995('0x4')](_0x5b96eb,_0x86c128)['then'](function(_0x744bea){if(_0x744bea[_0x7995('0x5')]){return _0x1902b4(_0x744bea[_0x7995('0x5')][_0x7995('0x6')]);}else{return _0x3c58eb(_0x744bea[_0x7995('0x7')]);}})[_0x7995('0x8')](function(_0x4996ca){return _0x1902b4(_0x4996ca);});});}exports[_0x7995('0x9')]=function(_0x1cad37,_0x4a64f7){return request(_0x7995('0xa'),{'account':_0x1cad37,'message':_0x4a64f7});};
\ No newline at end of file
diff --git a/server/services/agi/reply.js b/server/services/agi/reply.js
index a743c3a..c2b3631 100644
--- a/server/services/agi/reply.js
+++ b/server/services/agi/reply.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xb10b=['call','_inBody','inherits','prototype','_transform','\x0d\x0a\x0d\x0a','_localBuffer','toString','indexOf','substring','split','trim','slice','length','emit','headers','line','exports','util','Transform'];(function(_0x5ea94c,_0x19937b){var _0xededd7=function(_0x27d10e){while(--_0x27d10e){_0x5ea94c['push'](_0x5ea94c['shift']());}};_0xededd7(++_0x19937b);}(_0xb10b,0x12a));var _0xbb10=function(_0x50a004,_0x193d84){_0x50a004=_0x50a004-0x0;var _0x5e9992=_0xb10b[_0x50a004];return _0x5e9992;};'use strict';var util=require(_0xbb10('0x0'));var Transform=require('stream')[_0xbb10('0x1')];function AGIReply(_0x35bc5f){Transform[_0xbb10('0x2')](this,_0x35bc5f);this['_localBuffer']='';this[_0xbb10('0x3')]=![];}util[_0xbb10('0x4')](AGIReply,Transform);AGIReply[_0xbb10('0x5')][_0xbb10('0x6')]=function(_0x49baf4,_0x312b72,_0x481979){var _0x328583='\x0a',_0x3cdd53=['\x0a\x0a',_0xbb10('0x7')],_0x513741=-0x1,_0x1b9e94=-0x1,_0x3fb675='',_0x21370f=0x0,_0x1c3ee5='',_0x2353ef='';this[_0xbb10('0x8')]+=_0x49baf4[_0xbb10('0x9')]();_0x1c3ee5=this['_localBuffer'];if(!this['_inBody']){_0x21370f=0x0;while(_0x3cdd53[_0x21370f]){while((_0x1b9e94=_0x1c3ee5[_0xbb10('0xa')](_0x3cdd53[_0x21370f]))!=-0x1){_0x3fb675=_0x3cdd53[_0x21370f];_0x2353ef=_0x1c3ee5[_0xbb10('0xb')](0x0,_0x1b9e94);_0x1c3ee5=_0x1c3ee5[_0xbb10('0xb')](_0x1b9e94+_0x3fb675['length']);var _0x408248=_0x2353ef[_0xbb10('0xc')](_0x328583),_0x5be7e0=0x0,_0x44fb19={},_0x916a32='',_0x285009='',_0x193a27=-0x1;while(_0x408248[_0x5be7e0]){_0x193a27=_0x408248[_0x5be7e0][_0xbb10('0xa')](':');if(_0x193a27!=-0x1){_0x916a32=_0x408248[_0x5be7e0]['slice'](0x0,_0x193a27)[_0xbb10('0xd')]();_0x285009=_0x408248[_0x5be7e0][_0xbb10('0xe')](_0x193a27+0x1)[_0xbb10('0xd')]();if(_0x916a32[_0xbb10('0xf')]>0x0){_0x44fb19[_0x916a32]=_0x285009;}}else{}_0x5be7e0++;}this[_0xbb10('0x10')](_0xbb10('0x11'),_0x44fb19);this[_0xbb10('0x3')]=!![];}_0x21370f++;}this[_0xbb10('0x8')]=_0x1c3ee5;}else{while((_0x513741=_0x1c3ee5[_0xbb10('0xa')](_0x328583))!=-0x1){_0x2353ef=_0x1c3ee5[_0xbb10('0xb')](0x0,_0x513741);this['emit'](_0xbb10('0x12'),_0x2353ef);_0x1c3ee5=_0x1c3ee5[_0xbb10('0xb')](_0x513741+_0x328583[_0xbb10('0xf')]);}this[_0xbb10('0x8')]=_0x1c3ee5;}_0x481979();};module[_0xbb10('0x13')]=AGIReply;
\ No newline at end of file
+var _0xb10b=['call','_inBody','inherits','prototype','_transform','\x0d\x0a\x0d\x0a','_localBuffer','toString','indexOf','substring','split','trim','slice','length','emit','headers','line','exports','util','Transform'];(function(_0x14a4d0,_0x4c7068){var _0x18c8ab=function(_0x10bd3b){while(--_0x10bd3b){_0x14a4d0['push'](_0x14a4d0['shift']());}};_0x18c8ab(++_0x4c7068);}(_0xb10b,0x12a));var _0xbb10=function(_0x42bbd8,_0x32af99){_0x42bbd8=_0x42bbd8-0x0;var _0x2d4a1c=_0xb10b[_0x42bbd8];return _0x2d4a1c;};'use strict';var util=require(_0xbb10('0x0'));var Transform=require('stream')[_0xbb10('0x1')];function AGIReply(_0x35bc5f){Transform[_0xbb10('0x2')](this,_0x35bc5f);this['_localBuffer']='';this[_0xbb10('0x3')]=![];}util[_0xbb10('0x4')](AGIReply,Transform);AGIReply[_0xbb10('0x5')][_0xbb10('0x6')]=function(_0x49baf4,_0x312b72,_0x481979){var _0x328583='\x0a',_0x3cdd53=['\x0a\x0a',_0xbb10('0x7')],_0x513741=-0x1,_0x1b9e94=-0x1,_0x3fb675='',_0x21370f=0x0,_0x1c3ee5='',_0x2353ef='';this[_0xbb10('0x8')]+=_0x49baf4[_0xbb10('0x9')]();_0x1c3ee5=this['_localBuffer'];if(!this['_inBody']){_0x21370f=0x0;while(_0x3cdd53[_0x21370f]){while((_0x1b9e94=_0x1c3ee5[_0xbb10('0xa')](_0x3cdd53[_0x21370f]))!=-0x1){_0x3fb675=_0x3cdd53[_0x21370f];_0x2353ef=_0x1c3ee5[_0xbb10('0xb')](0x0,_0x1b9e94);_0x1c3ee5=_0x1c3ee5[_0xbb10('0xb')](_0x1b9e94+_0x3fb675['length']);var _0x408248=_0x2353ef[_0xbb10('0xc')](_0x328583),_0x5be7e0=0x0,_0x44fb19={},_0x916a32='',_0x285009='',_0x193a27=-0x1;while(_0x408248[_0x5be7e0]){_0x193a27=_0x408248[_0x5be7e0][_0xbb10('0xa')](':');if(_0x193a27!=-0x1){_0x916a32=_0x408248[_0x5be7e0]['slice'](0x0,_0x193a27)[_0xbb10('0xd')]();_0x285009=_0x408248[_0x5be7e0][_0xbb10('0xe')](_0x193a27+0x1)[_0xbb10('0xd')]();if(_0x916a32[_0xbb10('0xf')]>0x0){_0x44fb19[_0x916a32]=_0x285009;}}else{}_0x5be7e0++;}this[_0xbb10('0x10')](_0xbb10('0x11'),_0x44fb19);this[_0xbb10('0x3')]=!![];}_0x21370f++;}this[_0xbb10('0x8')]=_0x1c3ee5;}else{while((_0x513741=_0x1c3ee5[_0xbb10('0xa')](_0x328583))!=-0x1){_0x2353ef=_0x1c3ee5[_0xbb10('0xb')](0x0,_0x513741);this['emit'](_0xbb10('0x12'),_0x2353ef);_0x1c3ee5=_0x1c3ee5[_0xbb10('0xb')](_0x513741+_0x328583[_0xbb10('0xf')]);}this[_0xbb10('0x8')]=_0x1c3ee5;}_0x481979();};module[_0xbb10('0x13')]=AGIReply;
\ No newline at end of file
diff --git a/server/services/agi/rpc/index.js b/server/services/agi/rpc/index.js
index b95a797..e9ec7a0 100644
--- a/server/services/agi/rpc/index.js
+++ b/server/services/agi/rpc/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x31ec=['jayson/promise','client','error','result','getSquareProject','ShowSquareProject','production','ShowMailAccount','Smtp','email','getSquareProjectById','getVoiceQueueById','ShowVoiceQueue','name','getVariableById','ShowVariable','ShowSquareOdbc','dsn','ShowUser','getTrunkById','ShowTrunk','getSoundById','ShowSound','save_name','getIntervalById','ShowInterval','Intervals','getSmsAccountById','ShowSmsAccount','createSmsMessage','CreateSmsMessage','createSquareDetailsReport','CreateSquareDetailsReport','createSquareReport','merge','arg_1','arg_2','format','createSquareRecording','createSquareMessage','CreateSquareMessage','ShowCmHopper','phone','ListId','then','CreateCmContact','getPauseById','ShowPause','agentPause','PauseUser','agentUnpause','LogoutUser','bluebird','moment','util'];(function(_0x30f87a,_0x2cce5a){var _0x3a8efc=function(_0x225d6b){while(--_0x225d6b){_0x30f87a['push'](_0x30f87a['shift']());}};_0x3a8efc(++_0x2cce5a);}(_0x31ec,0x110));var _0xc31e=function(_0x24c6df,_0x4f12b0){_0x24c6df=_0x24c6df-0x0;var _0x229765=_0x31ec[_0x24c6df];return _0x229765;};'use strict';var BPromise=require(_0xc31e('0x0'));var moment=require(_0xc31e('0x1'));var _=require('lodash');var util=require(_0xc31e('0x2'));var jayson=require(_0xc31e('0x3'));var client=jayson[_0xc31e('0x4')]['http']({'port':0x2329});function request(_0x2142b6,_0x231fd4){return new BPromise(function(_0x3ca301,_0x3b9b02){return client['request'](_0x2142b6,_0x231fd4)['then'](function(_0x392369){if(_0x392369['error']){return _0x3b9b02(_0x392369[_0xc31e('0x5')]['message']);}else{return _0x3ca301(_0x392369[_0xc31e('0x6')]);}})['catch'](function(_0x98f8f1){return _0x3b9b02(_0x98f8f1);});});}exports[_0xc31e('0x7')]=function(_0x459f47){return request(_0xc31e('0x8'),{'options':{'raw':![],'where':{'name':_0x459f47},'attributes':[_0xc31e('0x9')]}});};exports['getMailAccountById']=function(_0x294cd0){return request(_0xc31e('0xa'),{'options':{'raw':![],'where':{'id':_0x294cd0},'include':[{'model':'MailServerOut','as':_0xc31e('0xb')}],'attributes':['id','name',_0xc31e('0xc')]}});};exports[_0xc31e('0xd')]=function(_0x1e17dc){return request(_0xc31e('0x8'),{'options':{'where':{'id':_0x1e17dc},'attributes':['name']}});};exports[_0xc31e('0xe')]=function(_0x4c82c5){return request(_0xc31e('0xf'),{'options':{'where':{'id':_0x4c82c5},'attributes':[_0xc31e('0x10')]}});};exports[_0xc31e('0x11')]=function(_0x5e6233){return request(_0xc31e('0x12'),{'options':{'where':{'id':_0x5e6233},'attributes':['name']}});};exports['getSquareOdbcById']=function(_0x5344cd){return request(_0xc31e('0x13'),{'options':{'where':{'id':_0x5344cd},'attributes':[_0xc31e('0x14')]}});};exports['getUserById']=function(_0x50cfef){return request(_0xc31e('0x15'),{'options':{'where':{'id':_0x50cfef},'attributes':[_0xc31e('0x10')]}});};exports[_0xc31e('0x16')]=function(_0x5d4e93){return request(_0xc31e('0x17'),{'options':{'where':{'id':_0x5d4e93},'attributes':[_0xc31e('0x10')]}});};exports[_0xc31e('0x18')]=function(_0x5438a6){return request(_0xc31e('0x19'),{'options':{'where':{'id':_0x5438a6},'attributes':[_0xc31e('0x1a')]}});};exports[_0xc31e('0x1b')]=function(_0x3d48af){return request(_0xc31e('0x1c'),{'options':{'raw':![],'where':{'id':_0x3d48af},'include':[{'model':'Interval','as':_0xc31e('0x1d')}]}});};exports[_0xc31e('0x1e')]=function(_0x307e03){return request(_0xc31e('0x1f'),{'options':{'where':{'id':_0x307e03},'attributes':['id',_0xc31e('0x10')]}});};exports[_0xc31e('0x20')]=function(_0x5dd868){return request(_0xc31e('0x21'),{'body':_0x5dd868});};exports[_0xc31e('0x22')]=function(_0x45a1ac){return request(_0xc31e('0x23'),{'body':_0x45a1ac});};exports[_0xc31e('0x24')]=function(_0xc2999){return request('CreateSquareReport',{'body':_[_0xc31e('0x25')](_0xc2999,{'project_name':_0xc2999[_0xc31e('0x26')],'prev_project_name':_0xc2999[_0xc31e('0x27')]||'','is_subproject':_0xc2999['arg_2']?!![]:![],'leaveAt':moment()[_0xc31e('0x28')]('YYYY-MM-DD\x20HH:mm:ss')})});};exports[_0xc31e('0x29')]=function(_0xc7ffb9){return request('CreateSquareRecording',{'body':_0xc7ffb9});};exports[_0xc31e('0x2a')]=function(_0x1e2dc4){return request(_0xc31e('0x2b'),{'body':_0x1e2dc4});};exports['createCmContact']=function(_0x36cfa9){return request(_0xc31e('0x2c'),{'options':{'raw':![],'where':{'phone':_0x36cfa9[_0xc31e('0x2d')],'ListId':_0x36cfa9[_0xc31e('0x2e')]}}})[_0xc31e('0x2f')](function(_0x3c2970){if(_0x3c2970){return _0x3c2970;}return request(_0xc31e('0x30'),{'body':_0x36cfa9});});};exports[_0xc31e('0x31')]=function(_0x3cc8f9){return request(_0xc31e('0x32'),{'options':{'where':{'id':_0x3cc8f9},'attributes':[_0xc31e('0x10')]}});};exports['agentLogin']=function(_0x3e7e10,_0x54ed9f){return request('LoginUser',{'body':{'interface':_0x54ed9f},'options':{'where':_0x3e7e10}});};exports[_0xc31e('0x33')]=function(_0x5226aa,_0x2f9a5d,_0x31804e){return request(_0xc31e('0x34'),{'body':{'type':_0x2f9a5d,'uniqueid':_0x31804e},'options':{'where':_0x5226aa}});};exports[_0xc31e('0x35')]=function(_0x554c3b){return request('UnpauseUser',{'body':{},'options':{'where':_0x554c3b}});};exports['agentLogout']=function(_0x19d727){return request(_0xc31e('0x36'),{'body':{},'options':{'where':_0x19d727}});};
\ No newline at end of file
+var _0x11ff=['ShowPause','agentLogin','LoginUser','agentPause','UnpauseUser','agentLogout','bluebird','moment','lodash','jayson/promise','client','http','then','error','message','result','ShowSquareProject','production','getMailAccountById','ShowMailAccount','MailServerOut','email','name','getVoiceQueueById','ShowVoiceQueue','ShowVariable','getSquareOdbcById','dsn','getUserById','getTrunkById','getSoundById','save_name','getIntervalById','Interval','Intervals','getSmsAccountById','ShowSmsAccount','CreateSmsMessage','createSquareDetailsReport','CreateSquareDetailsReport','createSquareReport','merge','arg_1','arg_2','format','createSquareRecording','createCmContact','ShowCmHopper','phone','ListId','CreateCmContact'];(function(_0x4797fa,_0x3fe610){var _0x502b5b=function(_0x3efffc){while(--_0x3efffc){_0x4797fa['push'](_0x4797fa['shift']());}};_0x502b5b(++_0x3fe610);}(_0x11ff,0x1d1));var _0xf11f=function(_0x24a94e,_0x3dabab){_0x24a94e=_0x24a94e-0x0;var _0x48b72a=_0x11ff[_0x24a94e];return _0x48b72a;};'use strict';var BPromise=require(_0xf11f('0x0'));var moment=require(_0xf11f('0x1'));var _=require(_0xf11f('0x2'));var util=require('util');var jayson=require(_0xf11f('0x3'));var client=jayson[_0xf11f('0x4')][_0xf11f('0x5')]({'port':0x2329});function request(_0x53d1bc,_0x4e9239){return new BPromise(function(_0x893004,_0x3911ce){return client['request'](_0x53d1bc,_0x4e9239)[_0xf11f('0x6')](function(_0x590bb9){if(_0x590bb9[_0xf11f('0x7')]){return _0x3911ce(_0x590bb9['error'][_0xf11f('0x8')]);}else{return _0x893004(_0x590bb9[_0xf11f('0x9')]);}})['catch'](function(_0x1d29b4){return _0x3911ce(_0x1d29b4);});});}exports['getSquareProject']=function(_0x158375){return request(_0xf11f('0xa'),{'options':{'raw':![],'where':{'name':_0x158375},'attributes':[_0xf11f('0xb')]}});};exports[_0xf11f('0xc')]=function(_0x41490d){return request(_0xf11f('0xd'),{'options':{'raw':![],'where':{'id':_0x41490d},'include':[{'model':_0xf11f('0xe'),'as':'Smtp'}],'attributes':['id','name',_0xf11f('0xf')]}});};exports['getSquareProjectById']=function(_0x31b465){return request(_0xf11f('0xa'),{'options':{'where':{'id':_0x31b465},'attributes':[_0xf11f('0x10')]}});};exports[_0xf11f('0x11')]=function(_0x323ba6){return request(_0xf11f('0x12'),{'options':{'where':{'id':_0x323ba6},'attributes':[_0xf11f('0x10')]}});};exports['getVariableById']=function(_0x52cd6f){return request(_0xf11f('0x13'),{'options':{'where':{'id':_0x52cd6f},'attributes':[_0xf11f('0x10')]}});};exports[_0xf11f('0x14')]=function(_0x123d7a){return request('ShowSquareOdbc',{'options':{'where':{'id':_0x123d7a},'attributes':[_0xf11f('0x15')]}});};exports[_0xf11f('0x16')]=function(_0x501c76){return request('ShowUser',{'options':{'where':{'id':_0x501c76},'attributes':[_0xf11f('0x10')]}});};exports[_0xf11f('0x17')]=function(_0x4043fe){return request('ShowTrunk',{'options':{'where':{'id':_0x4043fe},'attributes':['name']}});};exports[_0xf11f('0x18')]=function(_0x149f43){return request('ShowSound',{'options':{'where':{'id':_0x149f43},'attributes':[_0xf11f('0x19')]}});};exports[_0xf11f('0x1a')]=function(_0x29eacb){return request('ShowInterval',{'options':{'raw':![],'where':{'id':_0x29eacb},'include':[{'model':_0xf11f('0x1b'),'as':_0xf11f('0x1c')}]}});};exports[_0xf11f('0x1d')]=function(_0x2c513c){return request(_0xf11f('0x1e'),{'options':{'where':{'id':_0x2c513c},'attributes':['id','name']}});};exports['createSmsMessage']=function(_0x3b8f12){return request(_0xf11f('0x1f'),{'body':_0x3b8f12});};exports[_0xf11f('0x20')]=function(_0x189ff0){return request(_0xf11f('0x21'),{'body':_0x189ff0});};exports[_0xf11f('0x22')]=function(_0x5567b1){return request('CreateSquareReport',{'body':_[_0xf11f('0x23')](_0x5567b1,{'project_name':_0x5567b1[_0xf11f('0x24')],'prev_project_name':_0x5567b1[_0xf11f('0x25')]||'','is_subproject':_0x5567b1[_0xf11f('0x25')]?!![]:![],'leaveAt':moment()[_0xf11f('0x26')]('YYYY-MM-DD\x20HH:mm:ss')})});};exports[_0xf11f('0x27')]=function(_0xaae271){return request('CreateSquareRecording',{'body':_0xaae271});};exports['createSquareMessage']=function(_0x2a9152){return request('CreateSquareMessage',{'body':_0x2a9152});};exports[_0xf11f('0x28')]=function(_0x4e3182){return request(_0xf11f('0x29'),{'options':{'raw':![],'where':{'phone':_0x4e3182[_0xf11f('0x2a')],'ListId':_0x4e3182[_0xf11f('0x2b')]}}})['then'](function(_0xcc38f3){if(_0xcc38f3){return _0xcc38f3;}return request(_0xf11f('0x2c'),{'body':_0x4e3182});});};exports['getPauseById']=function(_0x2f16e3){return request(_0xf11f('0x2d'),{'options':{'where':{'id':_0x2f16e3},'attributes':[_0xf11f('0x10')]}});};exports[_0xf11f('0x2e')]=function(_0x2d6c2a,_0x32d6c1){return request(_0xf11f('0x2f'),{'body':{'interface':_0x32d6c1},'options':{'where':_0x2d6c2a}});};exports[_0xf11f('0x30')]=function(_0x4481e7,_0x5ab3f2,_0x409da2){return request('PauseUser',{'body':{'type':_0x5ab3f2,'uniqueid':_0x409da2},'options':{'where':_0x4481e7}});};exports['agentUnpause']=function(_0x253ba6){return request(_0xf11f('0x31'),{'body':{},'options':{'where':_0x253ba6}});};exports[_0xf11f('0x32')]=function(_0x515db1){return request('LogoutUser',{'body':{},'options':{'where':_0x515db1}});};
\ No newline at end of file
diff --git a/server/services/agi/scripts/aws/index.js b/server/services/agi/scripts/aws/index.js
index d0777b1..28cfe96 100644
--- a/server/services/agi/scripts/aws/index.js
+++ b/server/services/agi/scripts/aws/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xbb53=['exports','./polly','./lex'];(function(_0x5a1d78,_0x14975c){var _0x36f850=function(_0x6b038c){while(--_0x6b038c){_0x5a1d78['push'](_0x5a1d78['shift']());}};_0x36f850(++_0x14975c);}(_0xbb53,0x121));var _0x3bb5=function(_0x2e057a,_0x399f37){_0x2e057a=_0x2e057a-0x0;var _0x10c9f3=_0xbb53[_0x2e057a];return _0x10c9f3;};var polly=require(_0x3bb5('0x0'));var lex=require(_0x3bb5('0x1'));module[_0x3bb5('0x2')]={'polly':polly,'lex':lex};
\ No newline at end of file
+var polly=require('./polly');var lex=require('./lex');module['exports']={'polly':polly,'lex':lex};
\ No newline at end of file
diff --git a/server/services/agi/scripts/aws/lex/index.js b/server/services/agi/scripts/aws/lex/index.js
index 214dd7e..fafbfe4 100644
--- a/server/services/agi/scripts/aws/lex/index.js
+++ b/server/services/agi/scripts/aws/lex/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x07c3=['exports','./lib/api'];(function(_0x5c7fd7,_0x382a4f){var _0x13d55e=function(_0x4aeaf4){while(--_0x4aeaf4){_0x5c7fd7['push'](_0x5c7fd7['shift']());}};_0x13d55e(++_0x382a4f);}(_0x07c3,0x1bf));var _0x307c=function(_0x599e60,_0x5b6519){_0x599e60=_0x599e60-0x0;var _0x468e19=_0x07c3[_0x599e60];return _0x468e19;};'use strict';var lex=require(_0x307c('0x0'));module[_0x307c('0x1')]=function(_0x44b77c,_0xc54e42,_0x39fd38,_0x8b0b1c,_0x3b8f6e,_0x186b09){return lex(_0x44b77c,_0xc54e42,_0x39fd38,_0x8b0b1c,_0x3b8f6e,_0x186b09);};
\ No newline at end of file
+var _0xd49c=['exports'];(function(_0x762971,_0x2bd0a9){var _0x20a2ba=function(_0x27458c){while(--_0x27458c){_0x762971['push'](_0x762971['shift']());}};_0x20a2ba(++_0x2bd0a9);}(_0xd49c,0x1d8));var _0xcd49=function(_0x1dc4e1,_0x25c368){_0x1dc4e1=_0x1dc4e1-0x0;var _0x14cda5=_0xd49c[_0x1dc4e1];return _0x14cda5;};'use strict';var lex=require('./lib/api');module[_0xcd49('0x0')]=function(_0x59c5ab,_0x2d8e38,_0x190db1,_0x5bda72,_0x1181d4,_0x52362d){return lex(_0x59c5ab,_0x2d8e38,_0x190db1,_0x5bda72,_0x1181d4,_0x52362d);};
\ No newline at end of file
diff --git a/server/services/agi/scripts/aws/lex/lib/api.js b/server/services/agi/scripts/aws/lex/lib/api.js
index 4413c3a..98e6a5f 100644
--- a/server/services/agi/scripts/aws/lex/lib/api.js
+++ b/server/services/agi/scripts/aws/lex/lib/api.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xdc4b=['slots','hasOwnProperty','slot_','LexRuntime','$LATEST','aws-sdk','postText'];(function(_0x5af382,_0x5a4a63){var _0x1b3821=function(_0x3e9093){while(--_0x3e9093){_0x5af382['push'](_0x5af382['shift']());}};_0x1b3821(++_0x5a4a63);}(_0xdc4b,0xa6));var _0xbdc4=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0xdc4b[_0x19950b];return _0x3c6b41;};'use strict';var BPromise=require('bluebird');var AWS=require(_0xbdc4('0x0'));function lexResult(_0x5abb0b,_0x36626e){return new BPromise(function(_0x2041e9,_0xd21b35){_0x5abb0b[_0xbdc4('0x1')](_0x36626e,function(_0xb8b17f,_0x390558){if(_0xb8b17f){_0xd21b35(_0xb8b17f);}if(_0x390558[_0xbdc4('0x2')]){for(const _0x503612 in _0x390558[_0xbdc4('0x2')]){if(_0x390558['slots'][_0xbdc4('0x3')](_0x503612)){var _0x2c9285=_0x390558[_0xbdc4('0x2')][_0x503612];_0x390558[_0xbdc4('0x4')+_0x503612]=_0x2c9285;}}}_0x2041e9(_0x390558);});});}module['exports']=function(_0x50bfe0,_0x4c8c00,_0x5388,_0x3a6f6b,_0x309215,_0x3288b6){var _0x20a12f=new AWS[(_0xbdc4('0x5'))]({'accessKeyId':_0x4c8c00,'secretAccessKey':_0x5388,'region':_0x3a6f6b});var _0x3ee180={'botAlias':_0xbdc4('0x6'),'botName':_0x3288b6,'inputText':_0x309215,'userId':_0x50bfe0};return lexResult(_0x20a12f,_0x3ee180);};
\ No newline at end of file
+var _0xcbc3=['hasOwnProperty','exports','$LATEST','bluebird','aws-sdk','slots'];(function(_0x3a0ef4,_0x14ce45){var _0x2e9b51=function(_0x50135b){while(--_0x50135b){_0x3a0ef4['push'](_0x3a0ef4['shift']());}};_0x2e9b51(++_0x14ce45);}(_0xcbc3,0x8d));var _0x3cbc=function(_0x3d7595,_0x23bf60){_0x3d7595=_0x3d7595-0x0;var _0x163d06=_0xcbc3[_0x3d7595];return _0x163d06;};'use strict';var BPromise=require(_0x3cbc('0x0'));var AWS=require(_0x3cbc('0x1'));function lexResult(_0x1a960c,_0x12e464){return new BPromise(function(_0x18e0a2,_0x5f2fe0){_0x1a960c['postText'](_0x12e464,function(_0x5ccafa,_0x644945){if(_0x5ccafa){_0x5f2fe0(_0x5ccafa);}if(_0x644945[_0x3cbc('0x2')]){for(const _0x29e0f4 in _0x644945[_0x3cbc('0x2')]){if(_0x644945[_0x3cbc('0x2')][_0x3cbc('0x3')](_0x29e0f4)){var _0x4180d2=_0x644945[_0x3cbc('0x2')][_0x29e0f4];_0x644945['slot_'+_0x29e0f4]=_0x4180d2;}}}_0x18e0a2(_0x644945);});});}module[_0x3cbc('0x4')]=function(_0x25d86d,_0x247840,_0x381eec,_0x61de1e,_0x5e7edd,_0x1a688a){var _0x12ea32=new AWS['LexRuntime']({'accessKeyId':_0x247840,'secretAccessKey':_0x381eec,'region':_0x61de1e});var _0x4fa85c={'botAlias':_0x3cbc('0x5'),'botName':_0x1a688a,'inputText':_0x5e7edd,'userId':_0x25d86d};return lexResult(_0x12ea32,_0x4fa85c);};
\ No newline at end of file
diff --git a/server/services/agi/scripts/aws/polly/index.js b/server/services/agi/scripts/aws/polly/index.js
index 9232257..2771bd3 100644
--- a/server/services/agi/scripts/aws/polly/index.js
+++ b/server/services/agi/scripts/aws/polly/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9af5=['exports','./lib/api'];(function(_0xf46a82,_0x7002d6){var _0x5befba=function(_0x316463){while(--_0x316463){_0xf46a82['push'](_0xf46a82['shift']());}};_0x5befba(++_0x7002d6);}(_0x9af5,0xc9));var _0x59af=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x9af5[_0x2641f9];return _0x585741;};'use strict';var polly=require(_0x59af('0x0'));module[_0x59af('0x1')]=function(_0x21bbaf,_0x58840f,_0x32fc37,_0x1d8ef0,_0x13b01d,_0x1806c1,_0x392fc6){return polly(_0x21bbaf,_0x58840f,_0x32fc37,_0x1d8ef0,_0x13b01d,_0x1806c1,_0x392fc6);};
\ No newline at end of file
+var _0x6401=['./lib/api'];(function(_0x3509d8,_0x5074b5){var _0x4dcedb=function(_0x164ac4){while(--_0x164ac4){_0x3509d8['push'](_0x3509d8['shift']());}};_0x4dcedb(++_0x5074b5);}(_0x6401,0xdf));var _0x1640=function(_0x344773,_0x17c411){_0x344773=_0x344773-0x0;var _0x4cb584=_0x6401[_0x344773];return _0x4cb584;};'use strict';var polly=require(_0x1640('0x0'));module['exports']=function(_0x513efe,_0x332f15,_0xee9777,_0x5b2d44,_0x27a13c,_0x2b8ffe,_0x2e66c1){return polly(_0x513efe,_0x332f15,_0xee9777,_0x5b2d44,_0x27a13c,_0x2b8ffe,_0x2e66c1);};
\ No newline at end of file
diff --git a/server/services/agi/scripts/aws/polly/lib/api.js b/server/services/agi/scripts/aws/polly/lib/api.js
index f716076..1740769 100644
--- a/server/services/agi/scripts/aws/polly/lib/api.js
+++ b/server/services/agi/scripts/aws/polly/lib/api.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x1d93=['synthesizeSpeech','writeFile','No\x20data\x20response\x20from\x20aws\x20Polly!','exports','Polly','text','mp3','path','bluebird','randomstring','aws-sdk'];(function(_0x1b314c,_0x5d18f0){var _0x8d807b=function(_0x5c28ae){while(--_0x5c28ae){_0x1b314c['push'](_0x1b314c['shift']());}};_0x8d807b(++_0x5d18f0);}(_0x1d93,0x80));var _0x31d9=function(_0x28db16,_0x31b243){_0x28db16=_0x28db16-0x0;var _0x5524b5=_0x1d93[_0x28db16];return _0x5524b5;};'use strict';var fs=require('fs');var path=require(_0x31d9('0x0'));var BPromise=require(_0x31d9('0x1'));var rs=require(_0x31d9('0x2'));var AWS=require(_0x31d9('0x3'));function pollyResult(_0x4c8409,_0x4d5f0d,_0x569ce2){return new BPromise(function(_0x4100e1,_0x313a26){_0x4c8409[_0x31d9('0x4')](_0x4d5f0d,function(_0x23e969,_0x1603f8){if(_0x23e969){_0x313a26(_0x23e969);}else if(_0x1603f8){if(_0x1603f8['AudioStream']instanceof Buffer){fs[_0x31d9('0x5')](_0x569ce2,_0x1603f8['AudioStream'],function(_0x2b43fe){if(_0x2b43fe){_0x313a26(_0x2b43fe);}else{_0x4100e1();}});}else{_0x313a26(new Error('Invalid\x20data\x20response\x20from\x20aws\x20Polly!'));}}else{_0x313a26(new Error(_0x31d9('0x6')));}});});}module[_0x31d9('0x7')]=function(_0x5d374c,_0xaf5c77,_0x3655ea,_0x102cbb,_0x2fae96,_0x2ca9b8,_0xc26cbb){var _0x19ec9f=new AWS[(_0x31d9('0x8'))]({'accessKeyId':_0x5d374c,'secretAccessKey':_0xaf5c77,'region':_0x3655ea});var _0x42d1b3={'Text':_0x2fae96,'TextType':_0x2ca9b8||_0x31d9('0x9'),'OutputFormat':_0x31d9('0xa'),'VoiceId':_0x102cbb};return pollyResult(_0x19ec9f,_0x42d1b3,_0xc26cbb);};
\ No newline at end of file
+var _0x44e6=['path','bluebird','aws-sdk','AudioStream','writeFile','Invalid\x20data\x20response\x20from\x20aws\x20Polly!','No\x20data\x20response\x20from\x20aws\x20Polly!','text','mp3'];(function(_0x4a450a,_0x54d42f){var _0x28baf9=function(_0x5cb70a){while(--_0x5cb70a){_0x4a450a['push'](_0x4a450a['shift']());}};_0x28baf9(++_0x54d42f);}(_0x44e6,0x18c));var _0x644e=function(_0x2be8fc,_0x398f30){_0x2be8fc=_0x2be8fc-0x0;var _0x1319a9=_0x44e6[_0x2be8fc];return _0x1319a9;};'use strict';var fs=require('fs');var path=require(_0x644e('0x0'));var BPromise=require(_0x644e('0x1'));var rs=require('randomstring');var AWS=require(_0x644e('0x2'));function pollyResult(_0x5234d8,_0x12ba59,_0x200aca){return new BPromise(function(_0x2d475c,_0xc72379){_0x5234d8['synthesizeSpeech'](_0x12ba59,function(_0x99a5c,_0x4a796b){if(_0x99a5c){_0xc72379(_0x99a5c);}else if(_0x4a796b){if(_0x4a796b[_0x644e('0x3')]instanceof Buffer){fs[_0x644e('0x4')](_0x200aca,_0x4a796b[_0x644e('0x3')],function(_0x36cc93){if(_0x36cc93){_0xc72379(_0x36cc93);}else{_0x2d475c();}});}else{_0xc72379(new Error(_0x644e('0x5')));}}else{_0xc72379(new Error(_0x644e('0x6')));}});});}module['exports']=function(_0x4b6e82,_0x3fe845,_0x22a33f,_0x5221ab,_0x16bec9,_0x1a8d07,_0x147c64){var _0x3dc169=new AWS['Polly']({'accessKeyId':_0x4b6e82,'secretAccessKey':_0x3fe845,'region':_0x22a33f});var _0x1c8514={'Text':_0x16bec9,'TextType':_0x1a8d07||_0x644e('0x7'),'OutputFormat':_0x644e('0x8'),'VoiceId':_0x5221ab};return pollyResult(_0x3dc169,_0x1c8514,_0x147c64);};
\ No newline at end of file
diff --git a/server/services/agi/scripts/google/asr/index.js b/server/services/agi/scripts/google/asr/index.js
index 1552099..16873b8 100644
--- a/server/services/agi/scripts/google/asr/index.js
+++ b/server/services/agi/scripts/google/asr/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x33d5=['exports','./lib/api'];(function(_0x3bed2e,_0x2e85dd){var _0x422c4c=function(_0x3fc287){while(--_0x3fc287){_0x3bed2e['push'](_0x3bed2e['shift']());}};_0x422c4c(++_0x2e85dd);}(_0x33d5,0x7b));var _0x533d=function(_0x37ed96,_0x48a102){_0x37ed96=_0x37ed96-0x0;var _0x12f276=_0x33d5[_0x37ed96];return _0x12f276;};'use strict';var asr=require(_0x533d('0x0'));module[_0x533d('0x1')]=function(_0xb2befe,_0x578939,_0x2ed108,_0x2e7e91){return asr(_0xb2befe,_0x578939,_0x2ed108);};
\ No newline at end of file
+var _0x819e=['./lib/api','exports'];(function(_0xb58bc2,_0x3fff5f){var _0x3902d6=function(_0x3e3855){while(--_0x3e3855){_0xb58bc2['push'](_0xb58bc2['shift']());}};_0x3902d6(++_0x3fff5f);}(_0x819e,0x1a6));var _0xe819=function(_0x2deb15,_0x102a17){_0x2deb15=_0x2deb15-0x0;var _0x1abb33=_0x819e[_0x2deb15];return _0x1abb33;};'use strict';var asr=require(_0xe819('0x0'));module[_0xe819('0x1')]=function(_0x1468c5,_0x5c3666,_0x5260e7,_0x2bbff2){return asr(_0x1468c5,_0x5c3666,_0x5260e7);};
\ No newline at end of file
diff --git a/server/services/agi/scripts/google/asr/lib/api.js b/server/services/agi/scripts/google/asr/lib/api.js
index 2427ed8..981dbe5 100644
--- a/server/services/agi/scripts/google/asr/lib/api.js
+++ b/server/services/agi/scripts/google/asr/lib/api.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x8562=['url','bluebird','string','length','filepath\x20should\x20be\x20a\x20string','key\x20should\x20be\x20a\x20string','readFileSync','toString','base64','POST','/v1/speech:recognize?key=','LINEAR16','8000'];(function(_0x1ff9e2,_0x453ea1){var _0x2c6b81=function(_0x59e391){while(--_0x59e391){_0x1ff9e2['push'](_0x1ff9e2['shift']());}};_0x2c6b81(++_0x453ea1);}(_0x8562,0x186));var _0x2856=function(_0x4c04bd,_0x1e02f6){_0x4c04bd=_0x4c04bd-0x0;var _0x38e297=_0x8562[_0x4c04bd];return _0x38e297;};'use strict';var url=require(_0x2856('0x0'));var BPromise=require(_0x2856('0x1'));var fs=require('fs');var host='https://speech.googleapis.com';module['exports']=function(_0x40ddee,_0x21e860,_0x2ba489){return new BPromise(function(_0x144704,_0x40daff){var _0xa4805;if(typeof _0x40ddee!==_0x2856('0x2')||_0x40ddee[_0x2856('0x3')]===0x0){return _0x40daff(_0x2856('0x4'));}if(typeof _0x21e860!==_0x2856('0x2')||_0x21e860[_0x2856('0x3')]===0x0){return _0x40daff(_0x2856('0x5'));}if(typeof _0x2ba489!=='undefined'&&(typeof _0x2ba489!==_0x2856('0x2')||_0x2ba489['length']===0x0)){return _0x40daff('lang\x20should\x20be\x20a\x20string');}try{_0xa4805=fs[_0x2856('0x6')](_0x40ddee)[_0x2856('0x7')](_0x2856('0x8'));}catch(_0x20ca6e){return _0x40daff(_0x20ca6e);}return _0x144704({'method':_0x2856('0x9'),'uri':host+_0x2856('0xa')+_0x21e860,'body':{'config':{'encoding':_0x2856('0xb'),'sampleRateHertz':_0x2856('0xc'),'languageCode':_0x2ba489},'audio':{'content':_0xa4805}},'json':!![]});});};
\ No newline at end of file
+var _0x4133=['8000','bluebird','exports','string','length','key\x20should\x20be\x20a\x20string','lang\x20should\x20be\x20a\x20string','readFileSync','toString','POST'];(function(_0x158a58,_0x28e8e7){var _0x4935d9=function(_0x1e698c){while(--_0x1e698c){_0x158a58['push'](_0x158a58['shift']());}};_0x4935d9(++_0x28e8e7);}(_0x4133,0xf1));var _0x3413=function(_0x272a46,_0x12b300){_0x272a46=_0x272a46-0x0;var _0x2bfd12=_0x4133[_0x272a46];return _0x2bfd12;};'use strict';var url=require('url');var BPromise=require(_0x3413('0x0'));var fs=require('fs');var host='https://speech.googleapis.com';module[_0x3413('0x1')]=function(_0x1b5540,_0x10af5b,_0x140ff){return new BPromise(function(_0x439688,_0x25ad08){var _0xd554d6;if(typeof _0x1b5540!==_0x3413('0x2')||_0x1b5540[_0x3413('0x3')]===0x0){return _0x25ad08('filepath\x20should\x20be\x20a\x20string');}if(typeof _0x10af5b!=='string'||_0x10af5b[_0x3413('0x3')]===0x0){return _0x25ad08(_0x3413('0x4'));}if(typeof _0x140ff!=='undefined'&&(typeof _0x140ff!==_0x3413('0x2')||_0x140ff[_0x3413('0x3')]===0x0)){return _0x25ad08(_0x3413('0x5'));}try{_0xd554d6=fs[_0x3413('0x6')](_0x1b5540)[_0x3413('0x7')]('base64');}catch(_0xf37e8e){return _0x25ad08(_0xf37e8e);}return _0x439688({'method':_0x3413('0x8'),'uri':host+'/v1/speech:recognize?key='+_0x10af5b,'body':{'config':{'encoding':'LINEAR16','sampleRateHertz':_0x3413('0x9'),'languageCode':_0x140ff},'audio':{'content':_0xd554d6}},'json':!![]});});};
\ No newline at end of file
diff --git a/server/services/agi/scripts/google/index.js b/server/services/agi/scripts/google/index.js
index b8a1241..9425fa0 100644
--- a/server/services/agi/scripts/google/index.js
+++ b/server/services/agi/scripts/google/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xc664=['exports','./asr'];(function(_0x55e4e1,_0x352a79){var _0x1644e8=function(_0x4a2446){while(--_0x4a2446){_0x55e4e1['push'](_0x55e4e1['shift']());}};_0x1644e8(++_0x352a79);}(_0xc664,0x1ad));var _0x4c66=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc664[_0x3dd15e];return _0x231fd0;};var asr=require(_0x4c66('0x0'));module[_0x4c66('0x1')]={'asr':asr};
\ No newline at end of file
+var _0xd1d3=['./asr'];(function(_0x2af8f2,_0xe53d46){var _0x58f9d8=function(_0xfad37d){while(--_0xfad37d){_0x2af8f2['push'](_0x2af8f2['shift']());}};_0x58f9d8(++_0xe53d46);}(_0xd1d3,0xd7));var _0x3d1d=function(_0x161c51,_0x2d6bb3){_0x161c51=_0x161c51-0x0;var _0x7c222d=_0xd1d3[_0x161c51];return _0x7c222d;};var asr=require(_0x3d1d('0x0'));module['exports']={'asr':asr};
\ No newline at end of file
diff --git a/server/services/agi/scripts/index.js b/server/services/agi/scripts/index.js
index 22e4432..68012d4 100644
--- a/server/services/agi/scripts/index.js
+++ b/server/services/agi/scripts/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x8db7=['unlink','pipe','end','statusMessage','data','transcode','wav','error\x20convert','finish\x20to\x20convert','start','tmp','generate','.wav','writeFileSync','base64','then','chmodSync','777','split','toString','ssml','input','voice','audioConfig','MP3','text:synthesize','POST','resolve','.mp3','from','audioContent','writeFile','googleCloudTTS\x20path','googleTTS','googleASR','asr','uri','results','alternatives','transcript','join','map','confidence','googleASR\x20transcription','googleASR\x20confidence','catch','name','message','source','result','resolvedQuery','action','fulfillment','speech','score','status','code','metadata','endConversation','isFallbackIntent','Tilde\x20ASR\x20transcription','polly','awsLex','stringify','ispeechTTS','format','%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3','ispeechASR','%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s','model=%s','sestekNDA','text','channelData','CustomAction','CustomActionData','AudioFromTts','Data','audiofile','dirName','http','parse','bluebird','randomstring','sox','request-promise','util','querystring','google-tts-api','apiai-promise','md5','./aws','./sestek','../../../config/logger','agi','https://api.ispeech.org/api/rest','protocol','https:','host','path','WHAT_EVER','get','error','request\x20to\x20','\x20failed,\x20status\x20code\x20=\x20','statusCode','createWriteStream','finish','info','close'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x8db7,0x196));var _0x78db=function(_0x3e5086,_0x48f4a2){_0x3e5086=_0x3e5086-0x0;var _0xfeb102=_0x8db7[_0x3e5086];return _0xfeb102;};'use strict';var fs=require('fs');var path=require('path');var http=require(_0x78db('0x0'));var https=require('https');var urlParse=require('url')[_0x78db('0x1')];var BPromise=require(_0x78db('0x2'));var rs=require(_0x78db('0x3'));var sox=require(_0x78db('0x4'));var rp=require(_0x78db('0x5'));var util=require(_0x78db('0x6'));var querystring=require(_0x78db('0x7'));var tts=require(_0x78db('0x8'));var apiai=require(_0x78db('0x9'));var md5=require(_0x78db('0xa'));var google=require('./google');var aws=require(_0x78db('0xb'));var tilde=require('./tilde');var sestek=require(_0x78db('0xc'));var logger=require(_0x78db('0xd'))(_0x78db('0xe'));var ISPEECH_API=_0x78db('0xf');function downloadFile(_0xed0a1d,_0x26011c){return new BPromise(function(_0x11ce54,_0x4c248e){var _0x4349bf=urlParse(_0xed0a1d);var _0x1e7537=_0x4349bf[_0x78db('0x10')]===_0x78db('0x11')?https:http;var _0x2e25e8={'host':_0x4349bf[_0x78db('0x12')],'path':_0x4349bf[_0x78db('0x13')],'headers':{'user-agent':_0x78db('0x14')}};_0x1e7537[_0x78db('0x15')](_0x2e25e8,function(_0x501f6c){if(_0x501f6c['statusCode']!==0xc8){logger[_0x78db('0x16')](_0x78db('0x17')+_0xed0a1d+_0x78db('0x18')+_0x501f6c[_0x78db('0x19')]+'\x20('+_0x501f6c['statusMessage']+')');_0x4c248e(new Error(_0x78db('0x17')+_0xed0a1d+'\x20failed,\x20status\x20code\x20=\x20'+_0x501f6c['statusCode']+'\x20('+_0x501f6c['statusMessage']+')'));return;}var _0x3f4157=fs[_0x78db('0x1a')](_0x26011c);_0x3f4157['on'](_0x78db('0x1b'),function(){logger[_0x78db('0x1c')]('finish\x20download\x20file');_0x3f4157[_0x78db('0x1d')](_0x11ce54);});_0x3f4157['on'](_0x78db('0x16'),function(_0x59a6b7){fs[_0x78db('0x1e')](_0x26011c);logger[_0x78db('0x16')]('download\x20error',_0x59a6b7);_0x4c248e(_0x59a6b7);});_0x501f6c[_0x78db('0x1f')](_0x3f4157);})['on'](_0x78db('0x16'),function(_0x25fd7f){logger[_0x78db('0x16')](_0x25fd7f);_0x4c248e(_0x25fd7f);})[_0x78db('0x20')]();});}function uploadFile(_0x423b9a){return new BPromise(function(_0x1492d1,_0x33aead){var _0xba294e=urlParse(_0x423b9a);var _0x5d9364=_0xba294e[_0x78db('0x10')]==='https:'?https:http;var _0x59debe={'host':_0xba294e['host'],'path':_0xba294e[_0x78db('0x13')],'headers':{'user-agent':_0x78db('0x14')}};_0x5d9364[_0x78db('0x15')](_0x59debe,function(_0xe044fa){if(_0xe044fa[_0x78db('0x19')]!==0xc8){_0x33aead(new Error(_0x78db('0x17')+_0x423b9a+_0x78db('0x18')+_0xe044fa[_0x78db('0x19')]+'\x20('+_0xe044fa[_0x78db('0x21')]+')'));return;}var _0x57751b='';_0xe044fa['on'](_0x78db('0x22'),function(_0x543266){_0x57751b+=_0x543266;});_0xe044fa['on']('end',function(){_0x1492d1(_0x57751b);});})['on'](_0x78db('0x16'),function(_0x36fe37){_0x33aead(_0x36fe37);})[_0x78db('0x20')]();});}function convertFile(_0x526c15,_0x5cb133){return new BPromise(function(_0x285b48,_0xb5a04){var _0x3dcbc9=sox[_0x78db('0x23')](_0x526c15,_0x5cb133,{'sampleRate':0x1f40,'format':_0x78db('0x24'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x3dcbc9['on']('error',function(_0xe5f345){logger[_0x78db('0x16')](_0x78db('0x25'),_0xe5f345);_0xb5a04(_0xe5f345);});_0x3dcbc9['on']('end',function(){logger[_0x78db('0x1c')](_0x78db('0x26'));_0x285b48();});_0x3dcbc9[_0x78db('0x27')]();});}function base64Decode(_0x122088,_0x4612de){var _0x411b7c=path['resolve'](__dirname,_0x78db('0x28'),rs[_0x78db('0x29')](0x4)+_0x78db('0x2a'));fs[_0x78db('0x2b')](_0x411b7c,_0x122088,_0x78db('0x2c'));return convertFile(_0x411b7c,_0x4612de)[_0x78db('0x2d')](function(){try{fs['unlink'](_0x411b7c);fs[_0x78db('0x2e')](_0x4612de,_0x78db('0x2f'));}catch(_0x2fbcb1){logger[_0x78db('0x16')](_0x2fbcb1);}return _0x4612de[_0x78db('0x30')]('.')[0x0];});}function base64Encode(_0x393afb){var _0x4109af=fs['readFileSync'](_0x393afb);return new Buffer(_0x4109af)[_0x78db('0x31')]('base64');}exports['googleCloudTTS']=function(_0x4af48d,_0x9d8b4b,_0x1ca923,_0xfcaebc,_0xddc4cb,_0x5b7898){var _0x4f9dea,_0x3763f7;var _0x43206d='https://texttospeech.googleapis.com/v1/';var _0x487195='?key='+_0x4af48d;var _0x280f78={};if(_0x9d8b4b===_0x78db('0x32')){_0x280f78[_0x78db('0x33')]={'ssml':_0x1ca923};}else{_0x280f78[_0x78db('0x33')]={'text':_0x1ca923};};_0x280f78[_0x78db('0x34')]={'languageCode':_0xfcaebc,'ssmlGender':_0xddc4cb};_0x280f78[_0x78db('0x35')]={'audioEncoding':_0x78db('0x36'),'sampleRateHertz':0x1f40};var _0x4dacfd={'url':_0x43206d+_0x78db('0x37')+_0x487195,'method':_0x78db('0x38'),'json':!![],'body':_0x280f78};return rp(_0x4dacfd)['then'](function(_0x515de2){return new BPromise(function(_0xef99bf,_0x40f05c){_0x4f9dea=path[_0x78db('0x39')](__dirname,_0x78db('0x28'),rs[_0x78db('0x29')](0x4)+_0x78db('0x3a'));var _0xf122ba=Buffer[_0x78db('0x3b')](_0x515de2[_0x78db('0x3c')],_0x78db('0x2c'));return fs[_0x78db('0x3d')](_0x4f9dea,_0xf122ba,function(_0x1d8b68){_0x40f05c(_0x1d8b68);},function(_0x23b8ef){fs['chmodSync'](_0x4f9dea,_0x78db('0x2f'));_0xef99bf(_0x23b8ef);});});})[_0x78db('0x2d')](function(_0x1238f5){_0x3763f7=path['resolve'](__dirname,_0x78db('0x28'),rs[_0x78db('0x29')](0x4)+_0x78db('0x2a'));return convertFile(_0x4f9dea,_0x3763f7);})[_0x78db('0x2d')](function(){try{fs[_0x78db('0x1e')](_0x4f9dea);fs[_0x78db('0x2e')](_0x3763f7,_0x78db('0x2f'));}catch(_0x2ae423){logger['error'](_0x2ae423);}logger[_0x78db('0x1c')](_0x78db('0x3e'),_0x3763f7['split']('.')[0x0]);return _0x3763f7[_0x78db('0x30')]('.')[0x0];});};exports[_0x78db('0x3f')]=function(_0x626fb3,_0x362346){var _0x167d64,_0x511ec1;return tts(_0x626fb3,_0x362346||'en',0x1)[_0x78db('0x2d')](function(_0x3bf7f9){logger['info'](_0x3bf7f9);_0x167d64=path['resolve'](__dirname,_0x78db('0x28'),rs[_0x78db('0x29')](0x4)+_0x78db('0x3a'));return downloadFile(_0x3bf7f9,_0x167d64);})['then'](function(){_0x511ec1=path[_0x78db('0x39')](__dirname,_0x78db('0x28'),rs[_0x78db('0x29')](0x4)+_0x78db('0x2a'));return convertFile(_0x167d64,_0x511ec1);})[_0x78db('0x2d')](function(){try{fs['unlink'](_0x167d64);fs[_0x78db('0x2e')](_0x511ec1,_0x78db('0x2f'));}catch(_0x31efbd){logger[_0x78db('0x16')](_0x31efbd);}logger[_0x78db('0x1c')]('goggleTTS\x20path',_0x511ec1[_0x78db('0x30')]('.')[0x0]);return _0x511ec1[_0x78db('0x30')]('.')[0x0];});};exports[_0x78db('0x40')]=function(_0x47e461,_0x141e31,_0x26c0eb){return google[_0x78db('0x41')](_0x47e461,_0x141e31,_0x26c0eb)[_0x78db('0x2d')](function(_0x496459){logger['info'](_0x496459[_0x78db('0x42')]);return rp(_0x496459);})[_0x78db('0x2d')](function(_0x1da908){var _0x2dcff8='';var _0xb8140b=0x0;try{fs[_0x78db('0x1e')](_0x47e461);}catch(_0x29e9d9){logger['error'](_0x29e9d9);}if(_0x1da908&&_0x1da908['results']){_0x2dcff8=_0x1da908[_0x78db('0x43')]['map'](function(_0x40c00a){return _0x40c00a&&_0x40c00a['alternatives'][0x0]&&_0x40c00a[_0x78db('0x44')][0x0]['transcript']?_0x40c00a[_0x78db('0x44')][0x0][_0x78db('0x45')]:'';})[_0x78db('0x46')]('\x0a');_0xb8140b=_0x1da908[_0x78db('0x43')][_0x78db('0x47')](function(_0x233b17){return _0x233b17&&_0x233b17[_0x78db('0x44')][0x0]&&_0x233b17[_0x78db('0x44')][0x0][_0x78db('0x48')]?_0x233b17[_0x78db('0x44')][0x0][_0x78db('0x48')]:0x0;})[_0x78db('0x46')]('\x0a');}logger[_0x78db('0x1c')](_0x78db('0x49'),_0x2dcff8);logger[_0x78db('0x1c')](_0x78db('0x4a'),_0xb8140b);return{'transcript':_0x2dcff8,'confidence':_0xb8140b};})[_0x78db('0x4b')](function(_0x581a02){logger[_0x78db('0x16')]('[%s]\x20%s:%s',_0x581a02[_0x78db('0x19')],_0x581a02[_0x78db('0x4c')],_0x581a02[_0x78db('0x4d')]);});};exports['googleDialogflow']=function(_0x15c83a,_0x1db0f2,_0x2f92fa,_0x1920fa){var _0x4d845f=apiai(_0x1db0f2,{'language':_0x1920fa||'en'});return _0x4d845f['textRequest'](_0x2f92fa,{'sessionId':md5(_0x15c83a)})[_0x78db('0x2d')](function(_0x4834d6){logger[_0x78db('0x1c')](JSON['stringify'](_0x4834d6));return{'source':_0x4834d6['result'][_0x78db('0x4e')],'resolvedQuery':_0x4834d6[_0x78db('0x4f')][_0x78db('0x50')],'action':_0x4834d6['result'][_0x78db('0x51')],'actionIncomplete':_0x4834d6[_0x78db('0x4f')]['actionIncomplete'],'speech':_0x4834d6['result'][_0x78db('0x52')][_0x78db('0x53')],'score':_0x4834d6[_0x78db('0x4f')][_0x78db('0x54')],'statusCode':_0x4834d6[_0x78db('0x55')][_0x78db('0x56')],'endConversation':_0x4834d6[_0x78db('0x4f')][_0x78db('0x57')][_0x78db('0x58')]||![],'isFallbackIntent':_0x4834d6[_0x78db('0x4f')][_0x78db('0x57')][_0x78db('0x59')]};});};exports['tildeASR']=function(_0x5417cb,_0x4fae22,_0x263666,_0x4e1a85){return tilde[_0x78db('0x41')](_0x5417cb,_0x4fae22,_0x263666,_0x4e1a85)[_0x78db('0x2d')](function(_0x58be49){try{fs[_0x78db('0x1e')](_0x5417cb);}catch(_0x1c90e0){logger[_0x78db('0x16')](_0x1c90e0);}logger[_0x78db('0x1c')](_0x78db('0x5a'),_0x58be49[_0x78db('0x45')]);logger[_0x78db('0x1c')]('Tilde\x20ASR\x20confidence',_0x58be49[_0x78db('0x48')]);return _0x58be49;});};exports['awsPolly']=function(_0x192e8f,_0x42759a,_0x1aded9,_0x3c3de9,_0x3151a6,_0x347244){var _0x78540d=path[_0x78db('0x39')](__dirname,_0x78db('0x28'),rs[_0x78db('0x29')](0x4)+_0x78db('0x3a'));var _0x7854a3;return aws[_0x78db('0x5b')](_0x192e8f,_0x42759a,_0x1aded9,_0x3c3de9,_0x3151a6,_0x347244,_0x78540d)[_0x78db('0x2d')](function(){_0x7854a3=path['resolve'](__dirname,'tmp',rs[_0x78db('0x29')](0x4)+_0x78db('0x2a'));return convertFile(_0x78540d,_0x7854a3);})[_0x78db('0x2d')](function(){try{fs['unlink'](_0x78540d);fs['chmodSync'](_0x7854a3,'777');}catch(_0x1a0fb7){logger[_0x78db('0x16')](_0x1a0fb7);}return _0x7854a3[_0x78db('0x30')]('.')[0x0];});};exports[_0x78db('0x5c')]=function(_0x52b83e,_0x9cebc1,_0x1e682d,_0x7c8700,_0x1d321b,_0x56198c){return aws['lex'](_0x52b83e,_0x9cebc1,_0x1e682d,_0x7c8700,_0x1d321b,_0x56198c)[_0x78db('0x2d')](function(_0x6c6d16){logger['info'](JSON[_0x78db('0x5d')](_0x6c6d16));return _0x6c6d16;});};exports[_0x78db('0x5e')]=function(_0x20f068,_0x256f73,_0x434764,_0x44dff8){var _0x8abc2f=util[_0x78db('0x5f')](_0x78db('0x60'),ISPEECH_API,_0x20f068,encodeURIComponent(_0x256f73),_0x434764,_0x44dff8);var _0x455e69=path[_0x78db('0x39')](__dirname,_0x78db('0x28'),rs[_0x78db('0x29')](0x4)+'.mp3');var _0x3ed0a7;return downloadFile(_0x8abc2f,_0x455e69)[_0x78db('0x2d')](function(){_0x3ed0a7=path[_0x78db('0x39')](__dirname,_0x78db('0x28'),rs[_0x78db('0x29')](0x4)+'.wav');return convertFile(_0x455e69,_0x3ed0a7);})[_0x78db('0x2d')](function(){try{fs[_0x78db('0x1e')](_0x455e69);fs[_0x78db('0x2e')](_0x3ed0a7,_0x78db('0x2f'));}catch(_0x5dd84c){logger[_0x78db('0x16')](_0x5dd84c);}return _0x3ed0a7['split']('.')[0x0];});};exports[_0x78db('0x61')]=function(_0x4bb7e0,_0x32083d,_0x84acd6,_0x4f571f){var _0xdf5b44=util[_0x78db('0x5f')](_0x78db('0x62'),ISPEECH_API,_0x32083d,_0x84acd6,base64Encode(_0x4bb7e0),_0x4f571f?util[_0x78db('0x5f')](_0x78db('0x63'),encodeURIComponent(_0x4f571f)):'freeform=3');return uploadFile(_0xdf5b44)['then'](function(_0x1bfe60){return querystring[_0x78db('0x1')](_0x1bfe60);});};exports[_0x78db('0x64')]=function(_0x24e758,_0x433490){return sestek['nda'](_0x24e758,_0x433490)['then'](function(_0x23556f){logger[_0x78db('0x1c')](JSON[_0x78db('0x5d')](_0x23556f));var _0xff80a2={'speech':_0x23556f[_0x78db('0x65')],'action':_0x23556f['channelData']?_0x23556f[_0x78db('0x66')][_0x78db('0x67')]:undefined,'actiondata':_0x23556f[_0x78db('0x66')]?_0x23556f['channelData'][_0x78db('0x68')]:undefined};if(_0x23556f['channelData']&&_0x23556f['channelData'][_0x78db('0x69')]){return base64Decode(_0x23556f[_0x78db('0x66')][_0x78db('0x69')][_0x78db('0x6a')],path[_0x78db('0x39')](__dirname,_0x78db('0x28'),rs[_0x78db('0x29')](0x4)+'.wav'))[_0x78db('0x2d')](function(_0x5ce59b){_0xff80a2[_0x78db('0x6b')]=_0x5ce59b;return _0xff80a2;});}return _0xff80a2;});};exports[_0x78db('0x6c')]=function(){return __dirname;};
\ No newline at end of file
+var _0xa55f=['writeFile','googleCloudTTS\x20path','googleTTS','.mp3','goggleTTS\x20path','googleASR','asr','uri','results','alternatives','transcript','join','map','confidence','googleASR\x20transcription','googleASR\x20confidence','googleDialogflow','textRequest','stringify','result','source','resolvedQuery','action','actionIncomplete','speech','score','status','metadata','isFallbackIntent','tildeASR','Tilde\x20ASR\x20transcription','Tilde\x20ASR\x20confidence','awsPolly','polly','awsLex','lex','format','%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3','ispeechASR','model=%s','freeform=3','sestekNDA','nda','text','channelData','CustomAction','CustomActionData','AudioFromTts','audiofile','path','http','https','parse','randomstring','request-promise','util','google-tts-api','apiai-promise','md5','./aws','./tilde','agi','protocol','https:','host','WHAT_EVER','get','statusCode','error','\x20failed,\x20status\x20code\x20=\x20','statusMessage','createWriteStream','finish','info','finish\x20download\x20file','close','unlink','download\x20error','pipe','request\x20to\x20','data','end','transcode','error\x20convert','finish\x20to\x20convert','resolve','tmp','generate','.wav','writeFileSync','base64','then','chmodSync','777','split','readFileSync','toString','https://texttospeech.googleapis.com/v1/','?key=','ssml','input','voice','audioConfig','MP3','POST','from','audioContent'];(function(_0x2f21ca,_0x547624){var _0x30495f=function(_0x49c760){while(--_0x49c760){_0x2f21ca['push'](_0x2f21ca['shift']());}};_0x30495f(++_0x547624);}(_0xa55f,0x172));var _0xfa55=function(_0x44bb94,_0x3b2bed){_0x44bb94=_0x44bb94-0x0;var _0x54019f=_0xa55f[_0x44bb94];return _0x54019f;};'use strict';var fs=require('fs');var path=require(_0xfa55('0x0'));var http=require(_0xfa55('0x1'));var https=require(_0xfa55('0x2'));var urlParse=require('url')[_0xfa55('0x3')];var BPromise=require('bluebird');var rs=require(_0xfa55('0x4'));var sox=require('sox');var rp=require(_0xfa55('0x5'));var util=require(_0xfa55('0x6'));var querystring=require('querystring');var tts=require(_0xfa55('0x7'));var apiai=require(_0xfa55('0x8'));var md5=require(_0xfa55('0x9'));var google=require('./google');var aws=require(_0xfa55('0xa'));var tilde=require(_0xfa55('0xb'));var sestek=require('./sestek');var logger=require('../../../config/logger')(_0xfa55('0xc'));var ISPEECH_API='https://api.ispeech.org/api/rest';function downloadFile(_0x49ce38,_0x1a49cc){return new BPromise(function(_0x4ad3ce,_0x2a6d02){var _0x28b94e=urlParse(_0x49ce38);var _0x4c61a6=_0x28b94e[_0xfa55('0xd')]===_0xfa55('0xe')?https:http;var _0x48a946={'host':_0x28b94e[_0xfa55('0xf')],'path':_0x28b94e[_0xfa55('0x0')],'headers':{'user-agent':_0xfa55('0x10')}};_0x4c61a6[_0xfa55('0x11')](_0x48a946,function(_0x4a2b88){if(_0x4a2b88[_0xfa55('0x12')]!==0xc8){logger[_0xfa55('0x13')]('request\x20to\x20'+_0x49ce38+_0xfa55('0x14')+_0x4a2b88[_0xfa55('0x12')]+'\x20('+_0x4a2b88['statusMessage']+')');_0x2a6d02(new Error('request\x20to\x20'+_0x49ce38+'\x20failed,\x20status\x20code\x20=\x20'+_0x4a2b88[_0xfa55('0x12')]+'\x20('+_0x4a2b88[_0xfa55('0x15')]+')'));return;}var _0x1a39ca=fs[_0xfa55('0x16')](_0x1a49cc);_0x1a39ca['on'](_0xfa55('0x17'),function(){logger[_0xfa55('0x18')](_0xfa55('0x19'));_0x1a39ca[_0xfa55('0x1a')](_0x4ad3ce);});_0x1a39ca['on']('error',function(_0x4b0095){fs[_0xfa55('0x1b')](_0x1a49cc);logger[_0xfa55('0x13')](_0xfa55('0x1c'),_0x4b0095);_0x2a6d02(_0x4b0095);});_0x4a2b88[_0xfa55('0x1d')](_0x1a39ca);})['on'](_0xfa55('0x13'),function(_0x559a28){logger[_0xfa55('0x13')](_0x559a28);_0x2a6d02(_0x559a28);})['end']();});}function uploadFile(_0x300210){return new BPromise(function(_0x4d9b03,_0x1702c4){var _0x6bab10=urlParse(_0x300210);var _0x16c080=_0x6bab10[_0xfa55('0xd')]===_0xfa55('0xe')?https:http;var _0x1dc36c={'host':_0x6bab10[_0xfa55('0xf')],'path':_0x6bab10[_0xfa55('0x0')],'headers':{'user-agent':_0xfa55('0x10')}};_0x16c080[_0xfa55('0x11')](_0x1dc36c,function(_0x2e9274){if(_0x2e9274[_0xfa55('0x12')]!==0xc8){_0x1702c4(new Error(_0xfa55('0x1e')+_0x300210+_0xfa55('0x14')+_0x2e9274[_0xfa55('0x12')]+'\x20('+_0x2e9274[_0xfa55('0x15')]+')'));return;}var _0x3ca4d6='';_0x2e9274['on'](_0xfa55('0x1f'),function(_0x4dec3b){_0x3ca4d6+=_0x4dec3b;});_0x2e9274['on'](_0xfa55('0x20'),function(){_0x4d9b03(_0x3ca4d6);});})['on']('error',function(_0x2eff8b){_0x1702c4(_0x2eff8b);})[_0xfa55('0x20')]();});}function convertFile(_0x2b1ee8,_0x5d42b0){return new BPromise(function(_0x4f5013,_0x3cd22a){var _0x550b63=sox[_0xfa55('0x21')](_0x2b1ee8,_0x5d42b0,{'sampleRate':0x1f40,'format':'wav','channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x550b63['on'](_0xfa55('0x13'),function(_0x42292f){logger[_0xfa55('0x13')](_0xfa55('0x22'),_0x42292f);_0x3cd22a(_0x42292f);});_0x550b63['on'](_0xfa55('0x20'),function(){logger[_0xfa55('0x18')](_0xfa55('0x23'));_0x4f5013();});_0x550b63['start']();});}function base64Decode(_0x29f76e,_0x5af8f6){var _0x2c14d6=path[_0xfa55('0x24')](__dirname,_0xfa55('0x25'),rs[_0xfa55('0x26')](0x4)+_0xfa55('0x27'));fs[_0xfa55('0x28')](_0x2c14d6,_0x29f76e,_0xfa55('0x29'));return convertFile(_0x2c14d6,_0x5af8f6)[_0xfa55('0x2a')](function(){try{fs[_0xfa55('0x1b')](_0x2c14d6);fs[_0xfa55('0x2b')](_0x5af8f6,_0xfa55('0x2c'));}catch(_0x4c61ae){logger['error'](_0x4c61ae);}return _0x5af8f6[_0xfa55('0x2d')]('.')[0x0];});}function base64Encode(_0x508946){var _0x509eba=fs[_0xfa55('0x2e')](_0x508946);return new Buffer(_0x509eba)[_0xfa55('0x2f')](_0xfa55('0x29'));}exports['googleCloudTTS']=function(_0x5cdada,_0x18f9fe,_0x171520,_0x3fd056,_0x379e20,_0x3537ba){var _0xa932ee,_0x380625;var _0x178fc8=_0xfa55('0x30');var _0x1f5311=_0xfa55('0x31')+_0x5cdada;var _0x2f3e96={};if(_0x18f9fe===_0xfa55('0x32')){_0x2f3e96[_0xfa55('0x33')]={'ssml':_0x171520};}else{_0x2f3e96[_0xfa55('0x33')]={'text':_0x171520};};_0x2f3e96[_0xfa55('0x34')]={'languageCode':_0x3fd056,'ssmlGender':_0x379e20};_0x2f3e96[_0xfa55('0x35')]={'audioEncoding':_0xfa55('0x36'),'sampleRateHertz':0x1f40};var _0x3f1d7e={'url':_0x178fc8+'text:synthesize'+_0x1f5311,'method':_0xfa55('0x37'),'json':!![],'body':_0x2f3e96};return rp(_0x3f1d7e)['then'](function(_0x276d7d){return new BPromise(function(_0x490480,_0x25fc81){_0xa932ee=path[_0xfa55('0x24')](__dirname,_0xfa55('0x25'),rs['generate'](0x4)+'.mp3');var _0x2a41b0=Buffer[_0xfa55('0x38')](_0x276d7d[_0xfa55('0x39')],_0xfa55('0x29'));return fs[_0xfa55('0x3a')](_0xa932ee,_0x2a41b0,function(_0xe1c305){_0x25fc81(_0xe1c305);},function(_0x3693b8){fs[_0xfa55('0x2b')](_0xa932ee,_0xfa55('0x2c'));_0x490480(_0x3693b8);});});})[_0xfa55('0x2a')](function(_0x1519fc){_0x380625=path[_0xfa55('0x24')](__dirname,'tmp',rs['generate'](0x4)+_0xfa55('0x27'));return convertFile(_0xa932ee,_0x380625);})[_0xfa55('0x2a')](function(){try{fs[_0xfa55('0x1b')](_0xa932ee);fs['chmodSync'](_0x380625,_0xfa55('0x2c'));}catch(_0x522983){logger[_0xfa55('0x13')](_0x522983);}logger[_0xfa55('0x18')](_0xfa55('0x3b'),_0x380625[_0xfa55('0x2d')]('.')[0x0]);return _0x380625[_0xfa55('0x2d')]('.')[0x0];});};exports[_0xfa55('0x3c')]=function(_0x2f52aa,_0x29530a){var _0x433384,_0x4b06c6;return tts(_0x2f52aa,_0x29530a||'en',0x1)[_0xfa55('0x2a')](function(_0x16e85a){logger[_0xfa55('0x18')](_0x16e85a);_0x433384=path[_0xfa55('0x24')](__dirname,_0xfa55('0x25'),rs[_0xfa55('0x26')](0x4)+_0xfa55('0x3d'));return downloadFile(_0x16e85a,_0x433384);})[_0xfa55('0x2a')](function(){_0x4b06c6=path[_0xfa55('0x24')](__dirname,_0xfa55('0x25'),rs['generate'](0x4)+_0xfa55('0x27'));return convertFile(_0x433384,_0x4b06c6);})['then'](function(){try{fs[_0xfa55('0x1b')](_0x433384);fs[_0xfa55('0x2b')](_0x4b06c6,_0xfa55('0x2c'));}catch(_0x10c561){logger[_0xfa55('0x13')](_0x10c561);}logger[_0xfa55('0x18')](_0xfa55('0x3e'),_0x4b06c6['split']('.')[0x0]);return _0x4b06c6[_0xfa55('0x2d')]('.')[0x0];});};exports[_0xfa55('0x3f')]=function(_0x4b7cab,_0x2bacd7,_0x3c40ac){return google[_0xfa55('0x40')](_0x4b7cab,_0x2bacd7,_0x3c40ac)['then'](function(_0x48be0d){logger['info'](_0x48be0d[_0xfa55('0x41')]);return rp(_0x48be0d);})[_0xfa55('0x2a')](function(_0x56e7ec){var _0x381bea='';var _0x4c1891=0x0;try{fs[_0xfa55('0x1b')](_0x4b7cab);}catch(_0x2cc1ce){logger[_0xfa55('0x13')](_0x2cc1ce);}if(_0x56e7ec&&_0x56e7ec[_0xfa55('0x42')]){_0x381bea=_0x56e7ec[_0xfa55('0x42')]['map'](function(_0xe66e7f){return _0xe66e7f&&_0xe66e7f['alternatives'][0x0]&&_0xe66e7f[_0xfa55('0x43')][0x0][_0xfa55('0x44')]?_0xe66e7f['alternatives'][0x0][_0xfa55('0x44')]:'';})[_0xfa55('0x45')]('\x0a');_0x4c1891=_0x56e7ec[_0xfa55('0x42')][_0xfa55('0x46')](function(_0x598919){return _0x598919&&_0x598919[_0xfa55('0x43')][0x0]&&_0x598919[_0xfa55('0x43')][0x0]['confidence']?_0x598919[_0xfa55('0x43')][0x0][_0xfa55('0x47')]:0x0;})[_0xfa55('0x45')]('\x0a');}logger[_0xfa55('0x18')](_0xfa55('0x48'),_0x381bea);logger[_0xfa55('0x18')](_0xfa55('0x49'),_0x4c1891);return{'transcript':_0x381bea,'confidence':_0x4c1891};})['catch'](function(_0x35f6e2){logger[_0xfa55('0x13')]('[%s]\x20%s:%s',_0x35f6e2[_0xfa55('0x12')],_0x35f6e2['name'],_0x35f6e2['message']);});};exports[_0xfa55('0x4a')]=function(_0x370109,_0x3d969e,_0x5f05a5,_0x4ef8e0){var _0x5e903a=apiai(_0x3d969e,{'language':_0x4ef8e0||'en'});return _0x5e903a[_0xfa55('0x4b')](_0x5f05a5,{'sessionId':md5(_0x370109)})[_0xfa55('0x2a')](function(_0x43d88f){logger[_0xfa55('0x18')](JSON[_0xfa55('0x4c')](_0x43d88f));return{'source':_0x43d88f[_0xfa55('0x4d')][_0xfa55('0x4e')],'resolvedQuery':_0x43d88f[_0xfa55('0x4d')][_0xfa55('0x4f')],'action':_0x43d88f[_0xfa55('0x4d')][_0xfa55('0x50')],'actionIncomplete':_0x43d88f[_0xfa55('0x4d')][_0xfa55('0x51')],'speech':_0x43d88f['result']['fulfillment'][_0xfa55('0x52')],'score':_0x43d88f[_0xfa55('0x4d')][_0xfa55('0x53')],'statusCode':_0x43d88f[_0xfa55('0x54')]['code'],'endConversation':_0x43d88f['result'][_0xfa55('0x55')]['endConversation']||![],'isFallbackIntent':_0x43d88f['result'][_0xfa55('0x55')][_0xfa55('0x56')]};});};exports[_0xfa55('0x57')]=function(_0x478834,_0x1f1df4,_0x5e8508,_0x2dae6e){return tilde['asr'](_0x478834,_0x1f1df4,_0x5e8508,_0x2dae6e)[_0xfa55('0x2a')](function(_0x473d07){try{fs[_0xfa55('0x1b')](_0x478834);}catch(_0x21d39a){logger[_0xfa55('0x13')](_0x21d39a);}logger[_0xfa55('0x18')](_0xfa55('0x58'),_0x473d07[_0xfa55('0x44')]);logger[_0xfa55('0x18')](_0xfa55('0x59'),_0x473d07[_0xfa55('0x47')]);return _0x473d07;});};exports[_0xfa55('0x5a')]=function(_0x1207a7,_0x39bc08,_0x581b5e,_0x3b6706,_0x347d1d,_0x3cf451){var _0x519338=path[_0xfa55('0x24')](__dirname,'tmp',rs['generate'](0x4)+_0xfa55('0x3d'));var _0x1b4bb2;return aws[_0xfa55('0x5b')](_0x1207a7,_0x39bc08,_0x581b5e,_0x3b6706,_0x347d1d,_0x3cf451,_0x519338)['then'](function(){_0x1b4bb2=path['resolve'](__dirname,_0xfa55('0x25'),rs[_0xfa55('0x26')](0x4)+_0xfa55('0x27'));return convertFile(_0x519338,_0x1b4bb2);})[_0xfa55('0x2a')](function(){try{fs[_0xfa55('0x1b')](_0x519338);fs['chmodSync'](_0x1b4bb2,_0xfa55('0x2c'));}catch(_0x36daf4){logger['error'](_0x36daf4);}return _0x1b4bb2['split']('.')[0x0];});};exports[_0xfa55('0x5c')]=function(_0x4eecf7,_0x1929bf,_0x562bd7,_0x244f77,_0x2b005d,_0x2e0f2c){return aws[_0xfa55('0x5d')](_0x4eecf7,_0x1929bf,_0x562bd7,_0x244f77,_0x2b005d,_0x2e0f2c)[_0xfa55('0x2a')](function(_0x3b370c){logger[_0xfa55('0x18')](JSON[_0xfa55('0x4c')](_0x3b370c));return _0x3b370c;});};exports['ispeechTTS']=function(_0x3f207c,_0x2d03c6,_0x3a6c22,_0x1ab61a){var _0xd4a95d=util[_0xfa55('0x5e')](_0xfa55('0x5f'),ISPEECH_API,_0x3f207c,encodeURIComponent(_0x2d03c6),_0x3a6c22,_0x1ab61a);var _0x12e7ac=path[_0xfa55('0x24')](__dirname,_0xfa55('0x25'),rs[_0xfa55('0x26')](0x4)+_0xfa55('0x3d'));var _0x58f179;return downloadFile(_0xd4a95d,_0x12e7ac)['then'](function(){_0x58f179=path[_0xfa55('0x24')](__dirname,_0xfa55('0x25'),rs[_0xfa55('0x26')](0x4)+'.wav');return convertFile(_0x12e7ac,_0x58f179);})['then'](function(){try{fs[_0xfa55('0x1b')](_0x12e7ac);fs['chmodSync'](_0x58f179,_0xfa55('0x2c'));}catch(_0x777372){logger[_0xfa55('0x13')](_0x777372);}return _0x58f179['split']('.')[0x0];});};exports[_0xfa55('0x60')]=function(_0x4bdb93,_0x3c49ed,_0x5cc420,_0x59a6b0){var _0x4cce84=util[_0xfa55('0x5e')]('%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s',ISPEECH_API,_0x3c49ed,_0x5cc420,base64Encode(_0x4bdb93),_0x59a6b0?util[_0xfa55('0x5e')](_0xfa55('0x61'),encodeURIComponent(_0x59a6b0)):_0xfa55('0x62'));return uploadFile(_0x4cce84)['then'](function(_0x59d002){return querystring['parse'](_0x59d002);});};exports[_0xfa55('0x63')]=function(_0x15e0e6,_0x3445ea){return sestek[_0xfa55('0x64')](_0x15e0e6,_0x3445ea)[_0xfa55('0x2a')](function(_0x560dc4){logger[_0xfa55('0x18')](JSON[_0xfa55('0x4c')](_0x560dc4));var _0x1bd17f={'speech':_0x560dc4[_0xfa55('0x65')],'action':_0x560dc4[_0xfa55('0x66')]?_0x560dc4[_0xfa55('0x66')][_0xfa55('0x67')]:undefined,'actiondata':_0x560dc4[_0xfa55('0x66')]?_0x560dc4[_0xfa55('0x66')][_0xfa55('0x68')]:undefined};if(_0x560dc4['channelData']&&_0x560dc4['channelData'][_0xfa55('0x69')]){return base64Decode(_0x560dc4[_0xfa55('0x66')][_0xfa55('0x69')]['Data'],path[_0xfa55('0x24')](__dirname,'tmp',rs[_0xfa55('0x26')](0x4)+_0xfa55('0x27')))['then'](function(_0x1d0eaf){_0x1bd17f[_0xfa55('0x6a')]=_0x1d0eaf;return _0x1bd17f;});}return _0x1bd17f;});};exports['dirName']=function(){return __dirname;};
\ No newline at end of file
diff --git a/server/services/agi/scripts/sestek/index.js b/server/services/agi/scripts/sestek/index.js
index 1be46be..7008704 100644
--- a/server/services/agi/scripts/sestek/index.js
+++ b/server/services/agi/scripts/sestek/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x64fc=['./nda','exports'];(function(_0x3abcfe,_0x4cd0ab){var _0x5f5cef=function(_0x47a9d8){while(--_0x47a9d8){_0x3abcfe['push'](_0x3abcfe['shift']());}};_0x5f5cef(++_0x4cd0ab);}(_0x64fc,0xd2));var _0xc64f=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0x64fc[_0x2b4411];return _0x8e41ef;};var nda=require(_0xc64f('0x0'));module[_0xc64f('0x1')]={'nda':nda};
\ No newline at end of file
+var _0xfcbf=['./nda','exports'];(function(_0x56ca0f,_0x52d7d2){var _0x3893ec=function(_0x5130ce){while(--_0x5130ce){_0x56ca0f['push'](_0x56ca0f['shift']());}};_0x3893ec(++_0x52d7d2);}(_0xfcbf,0x192));var _0xffcb=function(_0x285cd0,_0x457f37){_0x285cd0=_0x285cd0-0x0;var _0x5afb57=_0xfcbf[_0x285cd0];return _0x5afb57;};var nda=require(_0xffcb('0x0'));module[_0xffcb('0x1')]={'nda':nda};
\ No newline at end of file
diff --git a/server/services/agi/scripts/sestek/nda/index.js b/server/services/agi/scripts/sestek/nda/index.js
index b22898c..9088e5f 100644
--- a/server/services/agi/scripts/sestek/nda/index.js
+++ b/server/services/agi/scripts/sestek/nda/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x8de2=['audio/wav','custom_action','CustomAction','custom_action_data','CustomActionData','stringify','request-promise','url','exports','POST','resolve','ndauth_url','/token','password','then','ndassistant_url','/api/NaturalDialogAssistant/v1/Run','ndaactivity_type','message','uniqueid','extension','text','Bearer\x20','access_token','project','body','channelData','ndagenerate_audio','AudioOutputSettings'];(function(_0x4063a4,_0x19d730){var _0x17908d=function(_0x3ce714){while(--_0x3ce714){_0x4063a4['push'](_0x4063a4['shift']());}};_0x17908d(++_0x19d730);}(_0x8de2,0x19c));var _0x28de=function(_0x1eef28,_0x33d718){_0x1eef28=_0x1eef28-0x0;var _0x2cc758=_0x8de2[_0x1eef28];return _0x2cc758;};'use strict';var rp=require(_0x28de('0x0'));var url=require(_0x28de('0x1'));var logger=require('../../../../../config/logger')('agi');module[_0x28de('0x2')]=function(_0xa4e590,_0x4b13ae){var _0x38dc17={'method':_0x28de('0x3'),'uri':url[_0x28de('0x4')](_0x4b13ae[_0x28de('0x5')],_0x28de('0x6')),'form':{'grant_type':_0x28de('0x7'),'username':_0x4b13ae['username'],'password':_0x4b13ae[_0x28de('0x7')]},'json':!![]};return rp(_0x38dc17)[_0x28de('0x8')](function(_0x5b8736){var _0x15908b={'method':_0x28de('0x3'),'uri':url[_0x28de('0x4')](_0x4b13ae[_0x28de('0x9')],_0x28de('0xa')),'body':{'type':_0x4b13ae[_0x28de('0xb')]||_0x28de('0xc'),'channelId':'Nda','conversation':{'id':_0xa4e590[_0x28de('0xd')]},'from':{'id':_0xa4e590['callerid'],'name':_0xa4e590['calleridname']},'recipient':{'id':_0xa4e590['dnid'],'name':_0xa4e590[_0x28de('0xe')]},'text':_0x4b13ae[_0x28de('0xf')],'channelData':{}},'headers':{'Authorization':_0x28de('0x10')+_0x5b8736[_0x28de('0x11')]},'json':!![]};if(_0x4b13ae[_0x28de('0x12')]){_0x15908b[_0x28de('0x13')][_0x28de('0x14')]['ProjectName']=_0x4b13ae[_0x28de('0x12')];}if(_0x4b13ae[_0x28de('0x15')]=='1'){_0x15908b[_0x28de('0x13')]['channelData'][_0x28de('0x16')]={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':_0x28de('0x17')};}if(_0x4b13ae[_0x28de('0x18')]){_0x15908b['body'][_0x28de('0x14')][_0x28de('0x19')]=_0x4b13ae[_0x28de('0x18')];if(_0x4b13ae[_0x28de('0x1a')]){_0x15908b[_0x28de('0x13')]['channelData'][_0x28de('0x1b')]=_0x4b13ae[_0x28de('0x1a')];}}logger['info'](JSON[_0x28de('0x1c')](_0x15908b));return rp(_0x15908b);});};
\ No newline at end of file
+var _0xb8df=['../../../../../config/logger','POST','resolve','ndauth_url','/token','password','username','then','ndassistant_url','/api/NaturalDialogAssistant/v1/Run','message','callerid','dnid','extension','text','Bearer\x20','access_token','channelData','ProjectName','project','ndagenerate_audio','body','AudioOutputSettings','custom_action','CustomAction','custom_action_data','stringify','request-promise','url'];(function(_0x4586a9,_0x3cff02){var _0x18bc48=function(_0x591b45){while(--_0x591b45){_0x4586a9['push'](_0x4586a9['shift']());}};_0x18bc48(++_0x3cff02);}(_0xb8df,0x194));var _0xfb8d=function(_0x4320ce,_0x49f5f5){_0x4320ce=_0x4320ce-0x0;var _0x537dae=_0xb8df[_0x4320ce];return _0x537dae;};'use strict';var rp=require(_0xfb8d('0x0'));var url=require(_0xfb8d('0x1'));var logger=require(_0xfb8d('0x2'))('agi');module['exports']=function(_0x128bba,_0xc68ff5){var _0x15338c={'method':_0xfb8d('0x3'),'uri':url[_0xfb8d('0x4')](_0xc68ff5[_0xfb8d('0x5')],_0xfb8d('0x6')),'form':{'grant_type':_0xfb8d('0x7'),'username':_0xc68ff5[_0xfb8d('0x8')],'password':_0xc68ff5['password']},'json':!![]};return rp(_0x15338c)[_0xfb8d('0x9')](function(_0x35c346){var _0x2de28c={'method':_0xfb8d('0x3'),'uri':url[_0xfb8d('0x4')](_0xc68ff5[_0xfb8d('0xa')],_0xfb8d('0xb')),'body':{'type':_0xc68ff5['ndaactivity_type']||_0xfb8d('0xc'),'channelId':'Nda','conversation':{'id':_0x128bba['uniqueid']},'from':{'id':_0x128bba[_0xfb8d('0xd')],'name':_0x128bba['calleridname']},'recipient':{'id':_0x128bba[_0xfb8d('0xe')],'name':_0x128bba[_0xfb8d('0xf')]},'text':_0xc68ff5[_0xfb8d('0x10')],'channelData':{}},'headers':{'Authorization':_0xfb8d('0x11')+_0x35c346[_0xfb8d('0x12')]},'json':!![]};if(_0xc68ff5['project']){_0x2de28c['body'][_0xfb8d('0x13')][_0xfb8d('0x14')]=_0xc68ff5[_0xfb8d('0x15')];}if(_0xc68ff5[_0xfb8d('0x16')]=='1'){_0x2de28c[_0xfb8d('0x17')][_0xfb8d('0x13')][_0xfb8d('0x18')]={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':'audio/wav'};}if(_0xc68ff5[_0xfb8d('0x19')]){_0x2de28c[_0xfb8d('0x17')][_0xfb8d('0x13')][_0xfb8d('0x1a')]=_0xc68ff5[_0xfb8d('0x19')];if(_0xc68ff5[_0xfb8d('0x1b')]){_0x2de28c[_0xfb8d('0x17')][_0xfb8d('0x13')]['CustomActionData']=_0xc68ff5[_0xfb8d('0x1b')];}}logger['info'](JSON[_0xfb8d('0x1c')](_0x2de28c));return rp(_0x2de28c);});};
\ No newline at end of file
diff --git a/server/services/agi/scripts/tilde/asr/index.js b/server/services/agi/scripts/tilde/asr/index.js
index 16959f7..e50c714 100644
--- a/server/services/agi/scripts/tilde/asr/index.js
+++ b/server/services/agi/scripts/tilde/asr/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x62c0=['exports','./lib/api'];(function(_0xd30d7c,_0x7b9e69){var _0x197294=function(_0xe077fa){while(--_0xe077fa){_0xd30d7c['push'](_0xd30d7c['shift']());}};_0x197294(++_0x7b9e69);}(_0x62c0,0xb1));var _0x062c=function(_0x4de1b1,_0x18c64c){_0x4de1b1=_0x4de1b1-0x0;var _0x639f27=_0x62c0[_0x4de1b1];return _0x639f27;};'use strict';var asr=require(_0x062c('0x0'));module[_0x062c('0x1')]=function(_0x594f59,_0x187ced,_0x426100,_0x76717c){return asr(_0x594f59,_0x187ced,_0x426100,_0x76717c);};
\ No newline at end of file
+var _0x4407=['./lib/api'];(function(_0x381eae,_0x499a30){var _0x34c099=function(_0x4296ba){while(--_0x4296ba){_0x381eae['push'](_0x381eae['shift']());}};_0x34c099(++_0x499a30);}(_0x4407,0x15e));var _0x7440=function(_0x54169,_0x5cee48){_0x54169=_0x54169-0x0;var _0x4b9d8c=_0x4407[_0x54169];return _0x4b9d8c;};'use strict';var asr=require(_0x7440('0x0'));module['exports']=function(_0x4ab9ce,_0x50ba4d,_0x2401ff,_0x5aa2cb){return asr(_0x4ab9ce,_0x50ba4d,_0x2401ff,_0x5aa2cb);};
\ No newline at end of file
diff --git a/server/services/agi/scripts/tilde/asr/lib/api.js b/server/services/agi/scripts/tilde/asr/lib/api.js
index ea0fd7d..e0a328d 100644
--- a/server/services/agi/scripts/tilde/asr/lib/api.js
+++ b/server/services/agi/scripts/tilde/asr/lib/api.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x4b8c=['unix','send','createReadStream','data','EOS','Tilde\x20ASR\x20send\x20error','stringify','terminate','parse','status','result','hypotheses','transcript','likelihood','Not\x20available.\x20Max\x20load\x20limit\x20reached.','Authentication\x20failed.','All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.','error','Tilde\x20ASR\x20parse\x20error','Error\x20Tilde\x20ASR\x20socket','isNil','isObject','message','close','bluebird','lodash','moment','crypto','../../../../../../config/logger','info','wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE','No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech','update','digest','hex','Open\x20Tilde\x20ASR\x20socket'];(function(_0x4b0290,_0x188c34){var _0x4bd9f4=function(_0x357f3f){while(--_0x357f3f){_0x4b0290['push'](_0x4b0290['shift']());}};_0x4bd9f4(++_0x188c34);}(_0x4b8c,0xa8));var _0xc4b8=function(_0x20546f,_0x42c4fa){_0x20546f=_0x20546f-0x0;var _0x22ac4a=_0x4b8c[_0x20546f];return _0x22ac4a;};'use strict';var BPromise=require(_0xc4b8('0x0'));var _=require(_0xc4b8('0x1'));var fs=require('fs');var WebSocket=require('ws');var moment=require(_0xc4b8('0x2'));var crypto=require(_0xc4b8('0x3'));var logger=require(_0xc4b8('0x4'))('agi');module['exports']=function(_0xd38ca2,_0xc0728,_0x43c0a9,_0x5bb223){return new BPromise(function(_0x1cc952,_0x2e9528){logger[_0xc4b8('0x5')]('Tilde\x20URI',_0x5bb223||_0xc4b8('0x6'));var _0x1caf28=new WebSocket(_0x5bb223||_0xc4b8('0x6'),{'perMessageDeflate':![]});var _0x10fcb9='';var _0x366446='0';var _0x261afc='1';var _0x4cc3eb=_0xc4b8('0x7');function _0x30b67d(_0x7ac532){var _0x9d9392=crypto['createHash']('sha1');_0x9d9392[_0xc4b8('0x8')](_0x7ac532);return _0x9d9392[_0xc4b8('0x9')](_0xc4b8('0xa'));}function _0x3e77c6(){try{logger[_0xc4b8('0x5')](_0xc4b8('0xb'));var _0x29e057=moment()[_0xc4b8('0xc')]();var _0x418c89=_0x30b67d(_0x29e057+_0xc0728+_0x43c0a9);_0x1caf28[_0xc4b8('0xd')](JSON['stringify']({'appID':_0xc0728,'timestamp':_0x29e057,'appKey':_0x418c89}));var _0x3fe9c0=fs[_0xc4b8('0xe')](_0xd38ca2);_0x3fe9c0['on'](_0xc4b8('0xf'),function(_0x2665ab){_0x1caf28['send'](_0x2665ab);});_0x3fe9c0['on']('close',function(){_0x1caf28['send'](_0xc4b8('0x10'));});}catch(_0x72e08a){logger['error'](_0xc4b8('0x11'),JSON[_0xc4b8('0x12')](_0x72e08a));_0x1caf28[_0xc4b8('0x13')]();}}function _0x1c9a93(_0x5c82fa){try{if(_0x5c82fa){var _0x4ba5cb=JSON[_0xc4b8('0x14')](_0x5c82fa);switch(_0x4ba5cb[_0xc4b8('0x15')]){case 0x0:if(_0x4ba5cb['result']){if(_0x4ba5cb['result']['final']){logger['info']('Tilde\x20ASR\x20hypoteses',JSON[_0xc4b8('0x12')](_0x4ba5cb[_0xc4b8('0x16')][_0xc4b8('0x17')]));_0x10fcb9=_0x4ba5cb[_0xc4b8('0x16')][_0xc4b8('0x17')][0x0][_0xc4b8('0x18')];_0x366446=_0x4ba5cb[_0xc4b8('0x16')][_0xc4b8('0x17')][0x0][_0xc4b8('0x19')];_0x261afc='0';_0x4cc3eb='Success.';_0x1caf28['terminate']();}}break;case 0x1:logger[_0xc4b8('0x5')]('No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech');_0x261afc='1';_0x4cc3eb=_0xc4b8('0x7');break;case 0x2:logger[_0xc4b8('0x5')]('Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.');_0x261afc='2';_0x4cc3eb='Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.';break;case 0x9:logger[_0xc4b8('0x5')]('Not\x20available.\x20Max\x20load\x20limit\x20reached.');_0x261afc='9';_0x4cc3eb=_0xc4b8('0x1a');break;case 0xa:logger[_0xc4b8('0x5')](_0xc4b8('0x1b'));_0x261afc='10';_0x4cc3eb='Authentication\x20failed.';break;case 0xb:logger[_0xc4b8('0x5')](_0xc4b8('0x1c'));_0x261afc='11';_0x4cc3eb='All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.';}}}catch(_0x56df4c){logger[_0xc4b8('0x1d')](_0xc4b8('0x1e'),JSON[_0xc4b8('0x12')](_0x56df4c));_0x1caf28['terminate']();}}function _0xa8e34(){logger[_0xc4b8('0x5')]('Close\x20Tilde\x20ASR\x20socket');_0x1cc952({'transcript':_0x10fcb9,'confidence':_0x366446,'status':_0x261afc,'status_message':_0x4cc3eb});}function _0x30f225(_0x29fed9){logger[_0xc4b8('0x1d')](_0xc4b8('0x1f'));if(!_[_0xc4b8('0x20')](_0x29fed9)){logger[_0xc4b8('0x1d')](_[_0xc4b8('0x21')](_0x29fed9)?JSON['stringify'](_0x29fed9):_0x29fed9);}}_0x1caf28['on']('open',_0x3e77c6);_0x1caf28['on'](_0xc4b8('0x22'),_0x1c9a93);_0x1caf28['on'](_0xc4b8('0x23'),_0xa8e34);_0x1caf28['on'](_0xc4b8('0x1d'),_0x30f225);});};
\ No newline at end of file
+var _0x90ac=['createReadStream','data','close','EOS','error','status','result','final','Tilde\x20ASR\x20hypoteses','hypotheses','likelihood','Success.','terminate','Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.','Not\x20available.\x20Max\x20load\x20limit\x20reached.','Authentication\x20failed.','All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.','Tilde\x20ASR\x20parse\x20error','Error\x20Tilde\x20ASR\x20socket','isNil','isObject','message','bluebird','moment','crypto','../../../../../../config/logger','agi','exports','info','Tilde\x20URI','wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE','No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech','createHash','sha1','update','hex','Open\x20Tilde\x20ASR\x20socket','unix','send','stringify'];(function(_0x3c392c,_0x31f46f){var _0x2f6813=function(_0x77f678){while(--_0x77f678){_0x3c392c['push'](_0x3c392c['shift']());}};_0x2f6813(++_0x31f46f);}(_0x90ac,0x1ce));var _0xc90a=function(_0x4578aa,_0x318ec8){_0x4578aa=_0x4578aa-0x0;var _0xa6ca87=_0x90ac[_0x4578aa];return _0xa6ca87;};'use strict';var BPromise=require(_0xc90a('0x0'));var _=require('lodash');var fs=require('fs');var WebSocket=require('ws');var moment=require(_0xc90a('0x1'));var crypto=require(_0xc90a('0x2'));var logger=require(_0xc90a('0x3'))(_0xc90a('0x4'));module[_0xc90a('0x5')]=function(_0x218bf5,_0x482777,_0x3dd341,_0x292a75){return new BPromise(function(_0x4b79e4,_0x3b7dae){logger[_0xc90a('0x6')](_0xc90a('0x7'),_0x292a75||_0xc90a('0x8'));var _0x24e9a7=new WebSocket(_0x292a75||_0xc90a('0x8'),{'perMessageDeflate':![]});var _0x249d06='';var _0x2dbc7e='0';var _0x71dec8='1';var _0x4182f4=_0xc90a('0x9');function _0x1f911e(_0x55cf9c){var _0xb796e6=crypto[_0xc90a('0xa')](_0xc90a('0xb'));_0xb796e6[_0xc90a('0xc')](_0x55cf9c);return _0xb796e6['digest'](_0xc90a('0xd'));}function _0x19a8b5(){try{logger[_0xc90a('0x6')](_0xc90a('0xe'));var _0x46b7b4=moment()[_0xc90a('0xf')]();var _0x226aa7=_0x1f911e(_0x46b7b4+_0x482777+_0x3dd341);_0x24e9a7[_0xc90a('0x10')](JSON[_0xc90a('0x11')]({'appID':_0x482777,'timestamp':_0x46b7b4,'appKey':_0x226aa7}));var _0x29ac68=fs[_0xc90a('0x12')](_0x218bf5);_0x29ac68['on'](_0xc90a('0x13'),function(_0x4b2e89){_0x24e9a7[_0xc90a('0x10')](_0x4b2e89);});_0x29ac68['on'](_0xc90a('0x14'),function(){_0x24e9a7[_0xc90a('0x10')](_0xc90a('0x15'));});}catch(_0x567583){logger[_0xc90a('0x16')]('Tilde\x20ASR\x20send\x20error',JSON['stringify'](_0x567583));_0x24e9a7['terminate']();}}function _0x51c332(_0x41e603){try{if(_0x41e603){var _0x236a38=JSON['parse'](_0x41e603);switch(_0x236a38[_0xc90a('0x17')]){case 0x0:if(_0x236a38[_0xc90a('0x18')]){if(_0x236a38['result'][_0xc90a('0x19')]){logger[_0xc90a('0x6')](_0xc90a('0x1a'),JSON[_0xc90a('0x11')](_0x236a38[_0xc90a('0x18')][_0xc90a('0x1b')]));_0x249d06=_0x236a38['result']['hypotheses'][0x0]['transcript'];_0x2dbc7e=_0x236a38[_0xc90a('0x18')]['hypotheses'][0x0][_0xc90a('0x1c')];_0x71dec8='0';_0x4182f4=_0xc90a('0x1d');_0x24e9a7[_0xc90a('0x1e')]();}}break;case 0x1:logger[_0xc90a('0x6')](_0xc90a('0x9'));_0x71dec8='1';_0x4182f4=_0xc90a('0x9');break;case 0x2:logger[_0xc90a('0x6')](_0xc90a('0x1f'));_0x71dec8='2';_0x4182f4=_0xc90a('0x1f');break;case 0x9:logger[_0xc90a('0x6')]('Not\x20available.\x20Max\x20load\x20limit\x20reached.');_0x71dec8='9';_0x4182f4=_0xc90a('0x20');break;case 0xa:logger[_0xc90a('0x6')](_0xc90a('0x21'));_0x71dec8='10';_0x4182f4='Authentication\x20failed.';break;case 0xb:logger[_0xc90a('0x6')](_0xc90a('0x22'));_0x71dec8='11';_0x4182f4=_0xc90a('0x22');}}}catch(_0x5b81ee){logger['error'](_0xc90a('0x23'),JSON[_0xc90a('0x11')](_0x5b81ee));_0x24e9a7[_0xc90a('0x1e')]();}}function _0x9d17ec(){logger[_0xc90a('0x6')]('Close\x20Tilde\x20ASR\x20socket');_0x4b79e4({'transcript':_0x249d06,'confidence':_0x2dbc7e,'status':_0x71dec8,'status_message':_0x4182f4});}function _0x1fb6a9(_0x19b41f){logger['error'](_0xc90a('0x24'));if(!_[_0xc90a('0x25')](_0x19b41f)){logger[_0xc90a('0x16')](_[_0xc90a('0x26')](_0x19b41f)?JSON[_0xc90a('0x11')](_0x19b41f):_0x19b41f);}}_0x24e9a7['on']('open',_0x19a8b5);_0x24e9a7['on'](_0xc90a('0x27'),_0x51c332);_0x24e9a7['on'](_0xc90a('0x14'),_0x9d17ec);_0x24e9a7['on'](_0xc90a('0x16'),_0x1fb6a9);});};
\ No newline at end of file
diff --git a/server/services/agi/scripts/tilde/index.js b/server/services/agi/scripts/tilde/index.js
index 2f0528f..ace3148 100644
--- a/server/services/agi/scripts/tilde/index.js
+++ b/server/services/agi/scripts/tilde/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7fe4=['exports'];(function(_0x16a71f,_0xbe276a){var _0x1af713=function(_0x313a14){while(--_0x313a14){_0x16a71f['push'](_0x16a71f['shift']());}};_0x1af713(++_0xbe276a);}(_0x7fe4,0x130));var _0x47fe=function(_0x2aec52,_0x59d962){_0x2aec52=_0x2aec52-0x0;var _0x3b8835=_0x7fe4[_0x2aec52];return _0x3b8835;};var asr=require('./asr');module[_0x47fe('0x0')]={'asr':asr};
\ No newline at end of file
+var _0x4ac7=['./asr'];(function(_0x266618,_0x18f637){var _0x54dbf5=function(_0x1f7985){while(--_0x1f7985){_0x266618['push'](_0x266618['shift']());}};_0x54dbf5(++_0x18f637);}(_0x4ac7,0x13b));var _0x74ac=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0x4ac7[_0x432682];return _0x463d05;};var asr=require(_0x74ac('0x0'));module['exports']={'asr':asr};
\ No newline at end of file
diff --git a/server/services/agi/server.js b/server/services/agi/server.js
index c18cc25..bf88b90 100644
--- a/server/services/agi/server.js
+++ b/server/services/agi/server.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x44ae=['listen','listening','connection','getConnections','error','E_AGI_SERVER_VOICE_DISABLED','destroy','E_AGI_SERVER_MAXCONNECTION','ready','close','E_AGI_SERVER_CLOSE','inherits','exports','util','net','events','EventEmitter','./channel','127.0.0.1','call','emit','E_AGI_ARGUMENT_PORT','createServer'];(function(_0x15e30c,_0x581414){var _0x117a37=function(_0x5698c0){while(--_0x5698c0){_0x15e30c['push'](_0x15e30c['shift']());}};_0x117a37(++_0x581414);}(_0x44ae,0x17d));var _0xe44a=function(_0x3513a0,_0x3bdc88){_0x3513a0=_0x3513a0-0x0;var _0x2bdeb9=_0x44ae[_0x3513a0];return _0x2bdeb9;};'use strict';var util=require(_0xe44a('0x0'));var net=require(_0xe44a('0x1'));var EventEmitter=require(_0xe44a('0x2'))[_0xe44a('0x3')];var AGIError=require('./error');var AGIChannel=require(_0xe44a('0x4'));var AGIServer=function(_0x548b5b,_0x33c40a,_0x18455c){var _0x174a3f=this,_0x548b5b=_0x548b5b||0x11dd,_0x33c40a=_0x33c40a||_0xe44a('0x5'),_0x3f9763=null,_0x5c1c49=0x0;EventEmitter[_0xe44a('0x6')](_0x174a3f);function _0x21f98c(){if(!_0x548b5b){_0x174a3f[_0xe44a('0x7')]('error',new AGIError(_0xe44a('0x8')));return![];}_0x3f9763=net[_0xe44a('0x9')]();_0x3f9763[_0xe44a('0xa')](_0x548b5b,_0x33c40a);_0x3f9763['on'](_0xe44a('0xb'),function(){_0x174a3f['emit'](_0xe44a('0xb'));});_0x3f9763['on'](_0xe44a('0xc'),function(_0x353bf8){_0x3f9763[_0xe44a('0xd')](function(_0xe19628,_0x30fd36){if(_0xe19628){_0x174a3f[_0xe44a('0x7')]('error',new AGIError('E_AGI_SERVER_ERROR',_0xe19628));}else if(_0x18455c&&_0x18455c<0x0){_0x174a3f['emit'](_0xe44a('0xe'),new AGIError(_0xe44a('0xf')));_0x353bf8[_0xe44a('0x10')]();}else if(_0x18455c&&_0x18455c>0x0&&_0x18455c<_0x30fd36){_0x5c1c49+=0x1;_0x174a3f['emit'](_0xe44a('0xe'),new AGIError(_0xe44a('0x11'),_0x5c1c49));_0x353bf8[_0xe44a('0x10')]();}else{var _0x14c1a8=new AGIChannel(_0x353bf8);_0x14c1a8['on'](_0xe44a('0x12'),function(){_0x174a3f[_0xe44a('0x7')](_0xe44a('0xc'),_0x14c1a8);});}});});_0x3f9763['on']('error',function(_0x1ec698){_0x174a3f[_0xe44a('0x7')]('error',new AGIError('E_AGI_SERVER_ERROR',_0x1ec698['code']));});_0x3f9763['on']('close',function(){_0x174a3f[_0xe44a('0x7')](_0xe44a('0x13'),new AGIError(_0xe44a('0x14')));});}process['nextTick'](function(){_0x21f98c();});};util[_0xe44a('0x15')](AGIServer,EventEmitter);module[_0xe44a('0x16')]=function(_0x1d3c58,_0x20193c,_0x1fcfce){return new AGIServer(_0x1d3c58,_0x20193c,_0x1fcfce);};
\ No newline at end of file
+var _0xfe60=['nextTick','inherits','exports','net','EventEmitter','./error','./channel','127.0.0.1','call','error','listening','connection','getConnections','emit','E_AGI_SERVER_ERROR','ready','code','close','E_AGI_SERVER_CLOSE'];(function(_0xe65499,_0x2e7f76){var _0x3b89b0=function(_0x470e84){while(--_0x470e84){_0xe65499['push'](_0xe65499['shift']());}};_0x3b89b0(++_0x2e7f76);}(_0xfe60,0x1cb));var _0x0fe6=function(_0x4cd34b,_0x2d8e36){_0x4cd34b=_0x4cd34b-0x0;var _0x22f1d2=_0xfe60[_0x4cd34b];return _0x22f1d2;};'use strict';var util=require('util');var net=require(_0x0fe6('0x0'));var EventEmitter=require('events')[_0x0fe6('0x1')];var AGIError=require(_0x0fe6('0x2'));var AGIChannel=require(_0x0fe6('0x3'));var AGIServer=function(_0x4aa401,_0x40740,_0x244c56){var _0x402912=this,_0x4aa401=_0x4aa401||0x11dd,_0x40740=_0x40740||_0x0fe6('0x4'),_0x1281fc=null,_0x13b947=0x0;EventEmitter[_0x0fe6('0x5')](_0x402912);function _0x24e88f(){if(!_0x4aa401){_0x402912['emit'](_0x0fe6('0x6'),new AGIError('E_AGI_ARGUMENT_PORT'));return![];}_0x1281fc=net['createServer']();_0x1281fc['listen'](_0x4aa401,_0x40740);_0x1281fc['on'](_0x0fe6('0x7'),function(){_0x402912['emit'](_0x0fe6('0x7'));});_0x1281fc['on'](_0x0fe6('0x8'),function(_0x1a14f3){_0x1281fc[_0x0fe6('0x9')](function(_0x299994,_0x2498a0){if(_0x299994){_0x402912[_0x0fe6('0xa')]('error',new AGIError(_0x0fe6('0xb'),_0x299994));}else if(_0x244c56&&_0x244c56<0x0){_0x402912[_0x0fe6('0xa')](_0x0fe6('0x6'),new AGIError('E_AGI_SERVER_VOICE_DISABLED'));_0x1a14f3['destroy']();}else if(_0x244c56&&_0x244c56>0x0&&_0x244c56<_0x2498a0){_0x13b947+=0x1;_0x402912[_0x0fe6('0xa')]('error',new AGIError('E_AGI_SERVER_MAXCONNECTION',_0x13b947));_0x1a14f3['destroy']();}else{var _0x225253=new AGIChannel(_0x1a14f3);_0x225253['on'](_0x0fe6('0xc'),function(){_0x402912[_0x0fe6('0xa')](_0x0fe6('0x8'),_0x225253);});}});});_0x1281fc['on'](_0x0fe6('0x6'),function(_0x16f2f6){_0x402912[_0x0fe6('0xa')](_0x0fe6('0x6'),new AGIError(_0x0fe6('0xb'),_0x16f2f6[_0x0fe6('0xd')]));});_0x1281fc['on'](_0x0fe6('0xe'),function(){_0x402912[_0x0fe6('0xa')]('close',new AGIError(_0x0fe6('0xf')));});}process[_0x0fe6('0x10')](function(){_0x24e88f();});};util[_0x0fe6('0x11')](AGIServer,EventEmitter);module[_0x0fe6('0x12')]=function(_0x38bdeb,_0x3738bd,_0xf351d5){return new AGIServer(_0x38bdeb,_0x3738bd,_0xf351d5);};
\ No newline at end of file
diff --git a/server/services/agi/vertices.js b/server/services/agi/vertices.js
index fbea7ba..73830e5 100644
--- a/server/services/agi/vertices.js
+++ b/server/services/agi/vertices.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x68cd=['application','Executed\x20command\x20%s\x20%s','lumenvoxtts','sestektts','Enter\x20in\x20SESTEKTTS\x20(%s)\x20block','lumenvoxasr','LUMENVOX_ASR_CONFIDENCE','LUMENVOX_ASR_TRANSCRIPT','RECOG_INSTANCE()','LUMENVOX_ASR_INSTANCE','Enter\x20in\x20SESTEKASR\x20(%s)\x20block','SESTEK_ASR_CONFIDENCE','SESTEK_ASR_TRANSCRIPT','database','Enter\x20in\x20DATABASE\x20(%s)\x20block','odbc_id','no\x20odbc\x20database\x20found','query:\x20%s','variable_id','forEach','keys','%s[%s][%s]','%s_ROWS_COUNT','debug','Enter\x20in\x20DIAL\x20(%s)\x20block','no\x20user\x20selected','sip_id','no\x20user\x20found','DIAL','SIP/%s','dialogflow','no\x20key\x20configured','bot','DIALOGFLOW_%s','speech','out','Dialogflow\x20Result\x20%s','Dialogflow\x20is\x20unreachable','ndauth_url','no\x20ndauth\x20url\x20configured','username','no\x20username\x20configured','password','ndassistant_url','Trying\x20SestekNDA:\x20%s','SESTEK_NDA_%s','audiofile','Sestek\x20NDA\x20%s\x20file\x20created','streamFile','unlink','.wav','SestekNDA\x20Result\x20%s','SestekNDA\x20is\x20unreachable','end','Enter\x20in\x20END\x20(%s)\x20block','ext_dial','Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block','trunk_id','no\x20trunk\x20found','trunk_name','no\x20trunk\x20selected','SIP/%s/%s','opts','Executed\x20command\x20%s','finally','Enter\x20in\x20GETDIGITS\x20(%s)\x20block','retry','file_id','no\x20file\x20audio\x20selected','no\x20variable\x20selected\x20for\x20the\x20result','getData','response','maxdigit','test','mindigit','hiddendigitsnum','hiddendigitspos','first','substr','generate','Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block','goal','Enter\x20in\x20GOAL\x20(%s)\x20block','goalname','GOAL\x20%s','awspolly','[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block','no\x20valid\x20credentials\x20configured','Trying\x20aws\x20Polly\x20%s','aws\x20Polly\x20%s\x20file\x20created','no\x20bot\x20name\x20configured','Trying\x20Amazon\x20Lex:\x20%s','AWS_LEX_%s','message','Amazon\x20Lex\x20ready\x20for\x20fulfillment','Amazon\x20Lex\x20Result\x20%s','Amazon\x20Lex\x20is\x20unreachable','googleasr','Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s','wav','%s/recordings/%s','beep','recordFile','intKey','google\x20%s\x20file\x20created','GOOGLE_ASR_%s','GoogleASR\x20Result\x20%s','tildeasr','Enter\x20in\x20TILDEASR\x20(%s)\x20block','no\x20appid\x20configured','no\x20appsecret\x20configured','NOBEEP','tilde\x20%s\x20file\x20created','TILDE_ASR_%s','TildeASR\x20Result\x20%s','Enter\x20in\x20GOTO\x20(%s)\x20block','continueAt','gotoif','Enter\x20in\x20GOTOIF\x20(%s)\x20block','condition','true','false','EVAL\x20CONDITION\x20%s\x20%s','Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block','no\x20intervals\x20found','IFTIME(%s?true:false)','IFTIME\x20%s\x20%s','Enter\x20in\x20HANGUP\x20(%s)\x20block','Enter\x20in\x20ISPEECHASR\x20(%s)\x20block','ispeech\x20%s\x20file\x20created','ISPEECH_ASR_%s','IspeechASR\x20Result\x20%s','ispeechtts','Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block','Trying\x20ispeech\x20TTS\x20%s','login','Enter\x20in\x20LOGIN\x20(%s)\x20block','no\x20find\x20by\x20configured','FIND\x20AGENT\x20%s\x20BY\x20%s','findBy','AGENT\x20%s\x20FOUND\x20BY','success','AGENT\x20%s\x20NOT\x20FOUND\x20BY','Enter\x20in\x20LOGOUT\x20(%s)\x20block','failure','Enter\x20in\x20MATH\x20(%s)\x20block','operation','no\x20operation\x20configured','math\x20%s','no\x20variable\x20found','variable\x20%s[key]\x20set','Enter\x20in\x20MENU\x20(%s)\x20block','no\x20file\x20audio\x20found','Enter\x20in\x20NOOP\x20(%s)\x20block','output','Enter\x20in\x20PAUSE\x20(%s)\x20block','pause_id','playback','Enter\x20in\x20PLAYBACK\x20(%s)\x20block','getSound','PLAYBACK','queue','queue_id','no\x20queue\x20selected','no\x20queue\x20found','indexOf','XMCS-QUEUE','toLowerCase','QUEUE','macro','gosub','position','record','Enter\x20in\x20RECORD\x20(%s)\x20block','recordingFormat','%s_%s','%s/recordings/%s.%s','createSquareRecording','RECORDING_SAVENAME','Recording\x20%s\x20%s\x20%s\x20%s','escape_digits','restapi','Enter\x20in\x20RESTAPI\x20(%s)\x20block','no\x20url\x20configured','restAPI','inspect','%s_STATUS_CODE','200','%s_STATUS_MESSAGE','Unable\x20to\x20set\x20result\x20in\x20variable\x20%s','variable\x20%s\x20set','saydigits','Enter\x20in\x20SAYDIGITS\x20(%s)\x20block','sayDigits','digits','saynumber','Enter\x20in\x20SAYNUMBER\x20(%s)\x20block','sayNumber','sayphonetic','Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block','sayPhonetic','account_id','no\x20mail\x20account\x20configured','Smtp','no\x20mail\x20account\x20found','\x22%s\x22\x20<%s>','email','user','bcc','subject','service','host','port','authentication','pass','template_id','Trying\x20SendMail\x20with\x20account\x20%s','Mail\x20message\x20added\x20to\x20outgoing\x20process','sendFax','Enter\x20in\x20SENDFAX\x20(%s)\x20block','SENDFAX\x20block\x20not\x20implemented','sendSMS','sms_account_id','no\x20sms\x20account\x20configured','no\x20sms\x20account\x20found','sms_text','Trying\x20SendSMS\x20with\x20account\x20%s','Sms\x20message\x20added\x20to\x20outgoing\x20process','set','Enter\x20in\x20SET\x20(%s)\x20block','variable_value','start','Enter\x20in\x20START\x20(%s)\x20block','START\x20CALLY\x20SQUARE','yes','Answer','Skipped\x20Answer','subproject','Enter\x20in\x20SUBPROJECT\x20(%s)\x20block','project_id','no\x20subproject\x20selected','no\x20subproject\x20found\x20with\x20id\x20%d','project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project','AGI','agi://%s/square,\x22%s\x22,\x22%s\x22','127.0.0.1','system','Enter\x20in\x20SYSTEM\x20(%s)\x20block','command','sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s','sh\x20command:\x20%s\x20result\x20no\x20stored','google_cloud_tts','Enter\x20in\x20Google\x20Cloud\x20TTS\x20(%s)\x20block','apiKey','Trying\x20Google\x20Cloud\x20TTS\x20%s','Google\x20Cloud\x20TTS\x20is\x20unreachable','tts','Enter\x20in\x20GOOGLETTS\x20(%s)\x20block','Google\x20TTS\x20is\x20unreachable','unpause','Enter\x20in\x20UNPAUSE\x20(%s)\x20block','voicemail','Enter\x20in\x20VOICEMAIL\x20(%s)\x20block','VOICEMAIL','mailbox','vswitch','join','lodash','shelljs','odbc','randomstring','mustache','request-promise','../../config/logger','agi','./scripts','rawHeaders','menu','getdigits','getsecretdigits','channel','rpc','prototype','getVariableById','then','catch','getVoiceQueue','name','getSquareProject','getSquareProjectById','getSquareOdbc','dsn','getUser','getUserById','getTrunk','getTrunkById','getSoundPath','save_name','getMailAccount','sendMailMessage','mailRpc','getIntervals','getIntervalById','IntervalId','interval','format','%s/sounds/converted/%s','getQueryOdbc','open','error','Error\x20getting\x20ODBC\x20connection\x20%s','info','ODBC\x20connection\x20successfully','query','close','Error\x20closing\x20connection\x20to\x20odbc\x20%s','getSmsAccount','getSmsAccountById','createSmsMessage','createSquareDetailsReport','uniqueid','label','agicommand','callerid','calleridname','context','extension','priority','accountcode','dnid','arg_1','createSquareMessage','createCmContact','log','in\x20createcmcontact','in\x20createcmcontact\x20callback','isEmpty','isNil','callback_','random','lastName','list_id','scheduledAt','callback','toString','getPause','getPauseById','agent','agentPause','agentUnpause','agentLogout','agentLogin','internal','LOCAL','shellCommand','exec','replace','googleCloudTTS','google_cloud_tts_text_type','text','languageCode','en-US','ssmlGender','MALE','audioEncoding','MP3','googleTTS','google_tts_language','url','method','timeout','number','includes','POST','PUT','toUpperCase','rawBody','parse','headers','An\x20incorrect\x20formatted\x20json\x20headers\x20has\x20been\x20passed\x20to\x20the\x20function','computedVariables','uri','render','stringify','body','An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function','statusMessage','statusCode','500\x20-\x20Internal\x20Server\x20Error','options','googleDialogflow','dialogflow_language','sestekNDA','ispeechTTS','key','speed','ispeechASR','model','awsPolly','aws_access_key_id','aws_secret_access_key','aws_polly_region','aws_polly_voice','Amy','awsLex','aws_bot_name','googleASR','google_asr_language','tildeASR','appid','appsecret','clear','clone','hasOwnProperty','isString','replaceObjectAllVariables','replaceAllVariables','recursiveNodeIndex','length','saveRestApiResult','isPlainObject','isArray','%s.%s','setVariable','replaceall\x20init','replaceAll','getVariable','extra','replaceall\x20end','The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s','isConfigured','maxRetry','sync','mrcpsynth','Enter\x20in\x20MRCPSynth\x20(%s)\x20block','noop','no\x20text\x20configured','MRCPSynth','result','Executed\x20command\x20MRCPSynth\x20%s','Enter\x20in\x20MRCPRecog\x20(%s)\x20block','grammar','no\x20grammar\x20configured','MRCPRecog','getAndSetVariable','RECOG_CONFIDENCE()','MRCP_RECOG_CONFIDENCE','RECOG_INPUT()','MRCP_RECOG_TRANSCRIPT','MRCP_RECOG_INSTANCE','Executed\x20command\x20MRCPRecog\x20%s','Enter\x20in\x20AGI\x20(%s)\x20block','answer','Enter\x20in\x20ANSWER\x20(%s)\x20block','Wait\x20%s\x20seconds\x20before\x20answer','logh','enter\x20in\x20callbackblock','Enter\x20in\x20CALLBACK\x20(%s)\x20block','no\x20list\x20selected','delay','callback_priority','CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s','phone','custom_app','Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block'];(function(_0x400da3,_0x55d4fa){var _0x1c7073=function(_0x3d2d90){while(--_0x3d2d90){_0x400da3['push'](_0x400da3['shift']());}};_0x1c7073(++_0x55d4fa);}(_0x68cd,0x10b));var _0xd68c=function(_0x25e625,_0x2a97e2){_0x25e625=_0x25e625-0x0;var _0x3312cb=_0x68cd[_0x25e625];return _0x3312cb;};'use strict';var fs=require('fs');var path=require('path');var util=require('util');var _=require(_0xd68c('0x0'));var sh=require(_0xd68c('0x1'));var odbc=require(_0xd68c('0x2'))();var rs=require(_0xd68c('0x3'));var moment=require('moment');var Mustache=require(_0xd68c('0x4'));var rp=require(_0xd68c('0x5'));var logger=require(_0xd68c('0x6'))(_0xd68c('0x7'));var config=require('../../config/environment');var scripts=require(_0xd68c('0x8'));var FILES_PATH='/var/opt/motion2/server/files';var recursiveMapAttributes=[_0xd68c('0x9'),'rawBody'];var verticesWithRetry=[_0xd68c('0xa'),_0xd68c('0xb'),_0xd68c('0xc')];var AGIVertices=function(_0x482ece,_0x321462,_0xe80596){this[_0xd68c('0xd')]=_0x482ece;this[_0xd68c('0xe')]=_0x321462;this['mailRpc']=_0xe80596;};AGIVertices[_0xd68c('0xf')]['getVariable']=function(_0x26f3c2,_0x256ff7){this[_0xd68c('0xe')][_0xd68c('0x10')](_0x26f3c2)[_0xd68c('0x11')](function(_0x3f643b){_0x256ff7(null,_0x3f643b?_0x3f643b['name']:![]);})[_0xd68c('0x12')](function(_0x3a840a){_0x256ff7(_0x3a840a);});};AGIVertices[_0xd68c('0xf')][_0xd68c('0x13')]=function(_0x103c9c,_0xfc953){this[_0xd68c('0xe')]['getVoiceQueueById'](_0x103c9c)[_0xd68c('0x11')](function(_0x458c35){_0xfc953(null,_0x458c35?_0x458c35[_0xd68c('0x14')]:![]);})[_0xd68c('0x12')](function(_0x500e39){_0xfc953(_0x500e39);});};AGIVertices['prototype'][_0xd68c('0x15')]=function(_0x2b4584,_0x4a5453){this['rpc'][_0xd68c('0x16')](_0x2b4584)['then'](function(_0xef7216){_0x4a5453(null,_0xef7216?_0xef7216[_0xd68c('0x14')]:![]);})[_0xd68c('0x12')](function(_0x67c630){_0x4a5453(_0x67c630);});};AGIVertices[_0xd68c('0xf')][_0xd68c('0x17')]=function(_0x425bd4,_0x421d13){this['rpc']['getSquareOdbcById'](_0x425bd4)[_0xd68c('0x11')](function(_0x54a133){_0x421d13(null,_0x54a133?_0x54a133[_0xd68c('0x18')]:![]);})['catch'](function(_0x44c947){_0x421d13(_0x44c947);});};AGIVertices[_0xd68c('0xf')][_0xd68c('0x19')]=function(_0x56df1b,_0x130add){this[_0xd68c('0xe')][_0xd68c('0x1a')](_0x56df1b)[_0xd68c('0x11')](function(_0xaa4698){_0x130add(null,_0xaa4698?_0xaa4698['name']:![]);})[_0xd68c('0x12')](function(_0x22615f){_0x130add(_0x22615f);});};AGIVertices[_0xd68c('0xf')][_0xd68c('0x1b')]=function(_0x4aa6d6,_0x1341bf){this[_0xd68c('0xe')][_0xd68c('0x1c')](_0x4aa6d6)[_0xd68c('0x11')](function(_0x3cdf91){_0x1341bf(null,_0x3cdf91?_0x3cdf91[_0xd68c('0x14')]:![]);})['catch'](function(_0xb6ea39){_0x1341bf(_0xb6ea39);});};AGIVertices['prototype']['getSound']=function(_0x43546c,_0x13bc6b){var _0x3538f5=this;this[_0xd68c('0xe')]['getSoundById'](_0x43546c)[_0xd68c('0x11')](function(_0x266d11){_0x13bc6b(null,_0x266d11?_0x3538f5[_0xd68c('0x1d')](_0x266d11[_0xd68c('0x1e')]):![]);})[_0xd68c('0x12')](function(_0x58da4a){_0x13bc6b(_0x58da4a);});};AGIVertices[_0xd68c('0xf')][_0xd68c('0x1f')]=function(_0x23b9e8,_0x4fa5af){this[_0xd68c('0xe')]['getMailAccountById'](_0x23b9e8)[_0xd68c('0x11')](function(_0x526da0){_0x4fa5af(null,_0x526da0?_0x526da0:![]);})['catch'](function(_0x332d4f){_0x4fa5af(_0x332d4f);});};AGIVertices[_0xd68c('0xf')][_0xd68c('0x20')]=function(_0x4e7c2e,_0x38dd44,_0x5dc150){this[_0xd68c('0x21')][_0xd68c('0x20')](_0x4e7c2e,_0x38dd44)['then'](function(){_0x5dc150(null);})[_0xd68c('0x12')](function(_0x2efec6){_0x5dc150(_0x2efec6);});};AGIVertices[_0xd68c('0xf')][_0xd68c('0x22')]=function(_0x2f7430,_0x532cf6){this[_0xd68c('0xe')][_0xd68c('0x23')](_0x2f7430)['then'](function(_0x5c75f2){if(_0x5c75f2){if(_0x5c75f2[_0xd68c('0x24')]){_0x532cf6(null,[_0x5c75f2[_0xd68c('0x25')]]);}else{_0x532cf6(null,_['map'](_0x5c75f2['Intervals'],'interval'));}}else{_0x532cf6(null,![]);}})[_0xd68c('0x12')](function(_0xda5443){_0x532cf6(_0xda5443);});};AGIVertices['prototype']['getSoundPath']=function(_0x4b6895){return util[_0xd68c('0x26')](_0xd68c('0x27'),FILES_PATH,_0x4b6895);};AGIVertices['prototype'][_0xd68c('0x28')]=function(_0x3eb71b,_0x5ca275,_0x3c0bdd){odbc[_0xd68c('0x29')](_0x3eb71b,function(_0x2d8858){if(_0x2d8858){logger[_0xd68c('0x2a')](_0xd68c('0x2b'),_0x2d8858);_0x3c0bdd(_0x2d8858);}else{logger[_0xd68c('0x2c')](_0xd68c('0x2d'));odbc[_0xd68c('0x2e')](_0x5ca275,function(_0x11643e,_0x2d3428){if(_0x11643e){logger[_0xd68c('0x2c')]('Error\x20executing\x20query\x20%s',_0x5ca275);_0x3c0bdd(_0x11643e);}else{logger['info']('Query\x20executed\x20correctly\x20%s',_0x5ca275);odbc[_0xd68c('0x2f')](function(_0x28cfb1){if(_0x28cfb1){logger['error'](_0xd68c('0x30'),_0x28cfb1);}_0x3c0bdd(null,_0x2d3428);});}});}});};AGIVertices[_0xd68c('0xf')][_0xd68c('0x31')]=function(_0x5c15af,_0x1e031a){this[_0xd68c('0xe')][_0xd68c('0x32')](_0x5c15af)[_0xd68c('0x11')](function(_0x1000f0){_0x1e031a(null,_0x1000f0?_0x1000f0:![]);})[_0xd68c('0x12')](function(_0x4d2f5d){_0x1e031a(_0x4d2f5d);});};AGIVertices['prototype'][_0xd68c('0x33')]=function(_0xc31c94,_0x1c8367){this[_0xd68c('0xe')][_0xd68c('0x33')](_0xc31c94)[_0xd68c('0x11')](function(_0x5eeaee){_0x1c8367(null,_0x5eeaee);})[_0xd68c('0x12')](function(_0xa31560){_0x1c8367(_0xa31560);});};AGIVertices['prototype']['createSquareDetailsReport']=function(_0x3f1f04,_0x286c2,_0x2b0c07){this[_0xd68c('0xe')][_0xd68c('0x34')]({'uniqueid':this[_0xd68c('0xd')][_0xd68c('0x35')],'node':_0x3f1f04[_0xd68c('0x36')],'application':_0x3f1f04[_0xd68c('0x37')],'data':_0x286c2||null,'project_name':this[_0xd68c('0xd')]['arg_1'],'callerid':this[_0xd68c('0xd')][_0xd68c('0x38')]})[_0xd68c('0x11')](function(_0x35464a){if(_0x2b0c07){_0x2b0c07(null,_0x35464a);}})[_0xd68c('0x12')](function(_0x1feaf6){if(_0x2b0c07){_0x2b0c07(_0x1feaf6);}});};AGIVertices[_0xd68c('0xf')]['createSquareRecording']=function(_0x581eb4,_0x1c5399,_0x3b00a3,_0x1d9bb9){this[_0xd68c('0xe')]['createSquareRecording']({'uniqueid':this[_0xd68c('0xd')][_0xd68c('0x35')],'callerid':this[_0xd68c('0xd')][_0xd68c('0x38')],'calleridname':this['channel'][_0xd68c('0x39')],'context':this[_0xd68c('0xd')][_0xd68c('0x3a')],'extension':this[_0xd68c('0xd')][_0xd68c('0x3b')],'priority':this['channel'][_0xd68c('0x3c')],'accountcode':this[_0xd68c('0xd')][_0xd68c('0x3d')],'dnid':this[_0xd68c('0xd')][_0xd68c('0x3e')],'projectName':this[_0xd68c('0xd')][_0xd68c('0x3f')],'saveName':_0x1c5399,'filename':_0x581eb4['file']||_0x1c5399,'savePath':_0x3b00a3})['then'](function(_0x5db4f9){_0x1d9bb9(null,_0x5db4f9);})['catch'](function(_0x5f1964){_0x1d9bb9(_0x5f1964);});};AGIVertices['prototype'][_0xd68c('0x40')]=function(_0x34b6c1,_0x3354ab,_0x25cdb6){this['rpc'][_0xd68c('0x40')]({'uniqueid':this[_0xd68c('0xd')][_0xd68c('0x35')],'body':_0x34b6c1,'direction':_0x3354ab})['then'](function(_0x326cec){if(_0x25cdb6){_0x25cdb6(null,_0x326cec);}})['catch'](function(_0x14d7f4){if(_0x25cdb6){_0x25cdb6(_0x14d7f4);}});};AGIVertices[_0xd68c('0xf')][_0xd68c('0x41')]=function(_0x9bf0ab,_0x25b5be){console[_0xd68c('0x42')](_0xd68c('0x43'),_0x9bf0ab);console['log'](_0xd68c('0x44'),_0x25b5be);this[_0xd68c('0xe')][_0xd68c('0x41')]({'firstName':_[_0xd68c('0x45')](_0x9bf0ab['name'])||_[_0xd68c('0x46')](_0x9bf0ab['name'])?_0xd68c('0x47')+Math[_0xd68c('0x48')]():_0x9bf0ab[_0xd68c('0x14')],'lastName':_[_0xd68c('0x45')](_0x9bf0ab[_0xd68c('0x49')])||_[_0xd68c('0x46')](_0x9bf0ab['lastName'])?null:_0x9bf0ab[_0xd68c('0x49')],'phone':_0x9bf0ab['phone'],'ListId':_0x9bf0ab[_0xd68c('0x4a')],'scheduledat':_0x9bf0ab[_0xd68c('0x4b')],'callbackUniqueid':this[_0xd68c('0xd')]['uniqueid'],'tags':_0xd68c('0x4c'),'description':'Callback\x20scheduled\x20at\x20'+_0x9bf0ab[_0xd68c('0x4b')][_0xd68c('0x4d')](),'priority':_0x9bf0ab['callback_priority']})[_0xd68c('0x11')](function(_0x5ec485){_0x25b5be(null,_0x5ec485);})[_0xd68c('0x12')](function(_0x1191a8){_0x25b5be(_0x1191a8);});};AGIVertices['prototype'][_0xd68c('0x4e')]=function(_0xbcc6e3,_0x5a9f07){this['rpc'][_0xd68c('0x4f')](_0xbcc6e3)[_0xd68c('0x11')](function(_0x5e1826){_0x5a9f07(null,_0x5e1826?_0x5e1826[_0xd68c('0x14')]:![]);})[_0xd68c('0x12')](function(_0x3a512f){_0x5a9f07(_0x3a512f);});};AGIVertices[_0xd68c('0xf')]['agentPause']=function(_0x5c3a77,_0x32ad61,_0x44f521){var _0x55fe2a={'role':_0xd68c('0x50')};_0x55fe2a[_0x5c3a77]=this[_0xd68c('0xd')][_0xd68c('0x38')];this[_0xd68c('0xe')][_0xd68c('0x51')](_0x55fe2a,_0x32ad61,this['channel'][_0xd68c('0x35')])['then'](function(_0x29133e){_0x44f521(null,_[_0xd68c('0x46')](_0x29133e)?![]:!![]);})[_0xd68c('0x12')](function(_0x58dc0f){logger['error'](_0x58dc0f);_0x44f521(null,![]);});};AGIVertices['prototype'][_0xd68c('0x52')]=function(_0x4c5f2a,_0x4639d0){var _0x4c1eb9={'role':'agent'};_0x4c1eb9[_0x4c5f2a]=this['channel'][_0xd68c('0x38')];this['rpc'][_0xd68c('0x52')](_0x4c1eb9)['then'](function(_0x560bc5){_0x4639d0(null,_[_0xd68c('0x46')](_0x560bc5)?![]:!![]);})[_0xd68c('0x12')](function(_0xa11fad){logger['error'](_0xa11fad);_0x4639d0(null,![]);});};AGIVertices[_0xd68c('0xf')]['agentLogout']=function(_0x341df1,_0x5cb1a7){var _0x3e8531={'role':_0xd68c('0x50')};_0x3e8531[_0x341df1]=this[_0xd68c('0xd')][_0xd68c('0x38')];this[_0xd68c('0xe')][_0xd68c('0x53')](_0x3e8531)[_0xd68c('0x11')](function(_0x1c35ee){_0x5cb1a7(null,_[_0xd68c('0x46')](_0x1c35ee)?![]:!![]);})[_0xd68c('0x12')](function(_0x533d81){logger['error'](_0x533d81);_0x5cb1a7(null,![]);});};AGIVertices[_0xd68c('0xf')][_0xd68c('0x54')]=function(_0x561c19,_0x37d27e){var _0x5218c2={'role':_0xd68c('0x50')};_0x5218c2[_0x561c19]=this['channel'][_0xd68c('0x38')];var _0x3d4d8b=_0x561c19!=_0xd68c('0x55')?util[_0xd68c('0x26')]('%s/%s@from-sip/n',_0xd68c('0x56'),this[_0xd68c('0xd')]['callerid']):undefined;this[_0xd68c('0xe')][_0xd68c('0x54')](_0x5218c2,_0x3d4d8b)[_0xd68c('0x11')](function(_0x3364d2){_0x37d27e(null,_[_0xd68c('0x46')](_0x3364d2)?![]:!![]);})[_0xd68c('0x12')](function(_0x13fbe7){logger[_0xd68c('0x2a')](_0x13fbe7);_0x37d27e(null,![]);});};AGIVertices[_0xd68c('0xf')][_0xd68c('0x57')]=function(_0x427b2d,_0x36f053){sh[_0xd68c('0x58')](_['trim'](_0x427b2d),function(_0x4efce2,_0x5dee38){var _0x5e1700=_0x5dee38[_0xd68c('0x59')](/(\r\n|\n|\r)/gm,'');_0x36f053(null,_0x5e1700);});};AGIVertices[_0xd68c('0xf')][_0xd68c('0x5a')]=function(_0x501dc5,_0x1c02af){scripts['googleCloudTTS'](_0x501dc5['apiKey'],_0x501dc5[_0xd68c('0x5b')]||'text',_0x501dc5[_0xd68c('0x5c')],_0x501dc5[_0xd68c('0x5d')]||_0xd68c('0x5e'),_0x501dc5[_0xd68c('0x5f')]||_0xd68c('0x60'),_0x501dc5[_0xd68c('0x61')]||_0xd68c('0x62'))[_0xd68c('0x11')](function(_0x173b73){_0x1c02af(null,_0x173b73);})[_0xd68c('0x12')](function(_0x29b4b6){_0x1c02af(_0x29b4b6);});};AGIVertices[_0xd68c('0xf')][_0xd68c('0x63')]=function(_0xd1e084,_0x3a7b8c){scripts[_0xd68c('0x63')](_0xd1e084[_0xd68c('0x5c')],_0xd1e084[_0xd68c('0x64')]||'en',0x1)[_0xd68c('0x11')](function(_0x2d7f20){_0x3a7b8c(null,_0x2d7f20);})[_0xd68c('0x12')](function(_0x4c7a1b){_0x3a7b8c(_0x4c7a1b);});};AGIVertices[_0xd68c('0xf')]['restAPI']=function(_0x2f109f,_0x1b5bf4){var _0x275867={'uri':_0x2f109f[_0xd68c('0x65')],'method':_0x2f109f[_0xd68c('0x66')],'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x2f109f[_0xd68c('0x67')])===_0xd68c('0x68')&&parseInt(_0x2f109f[_0xd68c('0x67')])>=0x1?parseInt(_0x2f109f[_0xd68c('0x67')])*0x3e8:0x5*0x3e8};if(_[_0xd68c('0x69')]([_0xd68c('0x6a'),_0xd68c('0x6b')],_0x275867[_0xd68c('0x66')][_0xd68c('0x6c')]())){try{_0x275867['body']=_0x2f109f[_0xd68c('0x6d')]?JSON[_0xd68c('0x6e')](_0x2f109f[_0xd68c('0x6d')]):{};}catch(_0x1e59a2){logger[_0xd68c('0x2a')]('An\x20incorrect\x20formatted\x20json\x20body\x20has\x20been\x20passed\x20to\x20the\x20function',_0x1e59a2);}}try{_0x275867[_0xd68c('0x6f')]=_0x2f109f[_0xd68c('0x9')]?JSON[_0xd68c('0x6e')](_0x2f109f[_0xd68c('0x9')]):{};}catch(_0x385458){logger['error'](_0xd68c('0x70'),_0x385458);}if(_0x2f109f[_0xd68c('0x71')]){try{var _0x407e5a=require(_0x2f109f[_0xd68c('0x71')])['sync'](this,_0x275867);_0x275867[_0xd68c('0x72')]=Mustache[_0xd68c('0x73')](_0x2f109f[_0xd68c('0x65')],_0x407e5a,{},['$$','$$']);if(_0x275867[_0xd68c('0x6f')]){_0x275867['headers']=JSON[_0xd68c('0x6e')](Mustache[_0xd68c('0x73')](JSON[_0xd68c('0x74')](_0x275867[_0xd68c('0x6f')]),_0x407e5a,{},['$$','$$']));}if(_0x275867['body']){_0x275867[_0xd68c('0x75')]=JSON[_0xd68c('0x6e')](Mustache[_0xd68c('0x73')](JSON[_0xd68c('0x74')](_0x275867[_0xd68c('0x75')]),_0x407e5a,{},['$$','$$']));}}catch(_0x4c0e45){logger[_0xd68c('0x2a')](_0xd68c('0x76'),_0x4c0e45);}}rp(_0x275867)['then'](function(_0x225477){var _0xe17f7d={'statusCode':_0x225477['statusCode']||0xc8,'statusMessage':_0x225477[_0xd68c('0x77')]||'OK','headers':_0x225477[_0xd68c('0x6f')]||{},'body':_0x225477[_0xd68c('0x75')]||{}};_0x1b5bf4(null,_0xe17f7d);})['catch'](function(_0x462f26){var _0x2edcb5={'statusCode':_0x462f26[_0xd68c('0x78')]||0x1f4,'statusMessage':_0x462f26['message']||_0xd68c('0x79'),'headers':_0x462f26['options'][_0xd68c('0x6f')]||{},'body':_0x462f26[_0xd68c('0x7a')][_0xd68c('0x75')]||{}};_0x1b5bf4(null,_0x2edcb5);});};AGIVertices[_0xd68c('0xf')]['googleDialogflow']=function(_0x3afc16,_0x152841){scripts[_0xd68c('0x7b')](this[_0xd68c('0xd')][_0xd68c('0x35')],_0x3afc16['key'],_0x3afc16[_0xd68c('0x5c')],_0x3afc16[_0xd68c('0x7c')]||'en')['then'](function(_0x42a569){_0x152841(null,_0x42a569);})[_0xd68c('0x12')](function(_0x4d06b5){_0x152841(_0x4d06b5);});};AGIVertices['prototype'][_0xd68c('0x7d')]=function(_0x38c168,_0x3ce79e){scripts['sestekNDA'](this['channel'],_0x38c168)[_0xd68c('0x11')](function(_0x3c413b){_0x3ce79e(null,_0x3c413b);})['catch'](function(_0x5180e5){_0x3ce79e(_0x5180e5);});};AGIVertices[_0xd68c('0xf')][_0xd68c('0x7e')]=function(_0x226d1a,_0x9c0212){scripts[_0xd68c('0x7e')](_0x226d1a[_0xd68c('0x7f')],_0x226d1a[_0xd68c('0x5c')],_0x226d1a['ispeech_tts_language']||_0xd68c('0x5e'),_0x226d1a[_0xd68c('0x80')])['then'](function(_0x53ffcf){_0x9c0212(null,_0x53ffcf);})['catch'](function(_0x44d278){_0x9c0212(_0x44d278);});};AGIVertices[_0xd68c('0xf')]['ispeechASR']=function(_0x1213ed,_0x2788d7,_0x27166b){scripts[_0xd68c('0x81')](_0x2788d7,_0x1213ed['key'],_0x1213ed['ispeech_asr_language']||'en-US',this['isConfigured'](_0x1213ed[_0xd68c('0x82')])?_0x1213ed[_0xd68c('0x82')]:undefined)[_0xd68c('0x11')](function(_0x306be4){_0x27166b(null,_0x306be4);})[_0xd68c('0x12')](function(_0x232b75){_0x27166b(_0x232b75);});};AGIVertices[_0xd68c('0xf')][_0xd68c('0x83')]=function(_0x45930c,_0x55ba8e){scripts[_0xd68c('0x83')](_0x45930c[_0xd68c('0x84')],_0x45930c[_0xd68c('0x85')],_0x45930c[_0xd68c('0x86')],_0x45930c[_0xd68c('0x87')]||_0xd68c('0x88'),_0x45930c[_0xd68c('0x5c')],_0x45930c['aws_text_type']||'text')[_0xd68c('0x11')](function(_0x5cbedf){_0x55ba8e(null,_0x5cbedf);})[_0xd68c('0x12')](function(_0x5f25a5){_0x55ba8e(_0x5f25a5);});};AGIVertices[_0xd68c('0xf')][_0xd68c('0x89')]=function(_0x476bc1,_0x3bd5c3){scripts[_0xd68c('0x89')](this[_0xd68c('0xd')]['uniqueid'],_0x476bc1['aws_access_key_id'],_0x476bc1[_0xd68c('0x85')],_0x476bc1['aws_lex_region'],_0x476bc1[_0xd68c('0x5c')],_0x476bc1[_0xd68c('0x8a')])[_0xd68c('0x11')](function(_0x1b274d){_0x3bd5c3(null,_0x1b274d);})[_0xd68c('0x12')](function(_0x1e1aff){_0x3bd5c3(_0x1e1aff);});};AGIVertices[_0xd68c('0xf')][_0xd68c('0x8b')]=function(_0x4c4401,_0x1dafce,_0x3f6be4){scripts[_0xd68c('0x8b')](_0x1dafce,_0x4c4401[_0xd68c('0x7f')],_0x4c4401[_0xd68c('0x8c')]||'en-US')[_0xd68c('0x11')](function(_0xa9e6f7){_0x3f6be4(null,_0xa9e6f7);})[_0xd68c('0x12')](function(_0x397030){_0x3f6be4(_0x397030);});};AGIVertices['prototype'][_0xd68c('0x8d')]=function(_0x13e626,_0x18d883,_0x33fa59){scripts[_0xd68c('0x8d')](_0x18d883,_0x13e626[_0xd68c('0x8e')],_0x13e626[_0xd68c('0x8f')],_0x13e626[_0xd68c('0x72')])[_0xd68c('0x11')](function(_0x5c744e){_0x33fa59(null,_0x5c744e);})[_0xd68c('0x12')](function(_0x3c729d){_0x33fa59(_0x3c729d);});};AGIVertices[_0xd68c('0xf')][_0xd68c('0x90')]=function(_0x3955eb){var _0x26e807=_[_0xd68c('0x69')](verticesWithRetry,_0x3955eb[_0xd68c('0x37')])?_0x3955eb:_[_0xd68c('0x91')](_0x3955eb);for(var _0x30bf4b in _0x26e807){if(_0x26e807[_0xd68c('0x92')](_0x30bf4b)){if(_0x26e807[_0x30bf4b]&&_[_0xd68c('0x93')](_0x26e807[_0x30bf4b])){if(_[_0xd68c('0x69')](recursiveMapAttributes,_0x30bf4b)){_0x26e807[_0x30bf4b]=this[_0xd68c('0x94')](_0x26e807[_0x30bf4b]);}else{_0x26e807[_0x30bf4b]=this[_0xd68c('0x95')](_0x26e807[_0x30bf4b]);}}}}return _0x26e807;};AGIVertices[_0xd68c('0xf')][_0xd68c('0x96')]=function(_0x4381cb){for(var _0x5d1f00 in _0x4381cb){if(_0x4381cb[_0xd68c('0x92')](_0x5d1f00)){if(_['isPlainObject'](_0x4381cb[_0x5d1f00])){this['recursiveNodeIndex'](_0x4381cb[_0x5d1f00]);}else if(_['isArray'](_0x4381cb[_0x5d1f00])){for(var _0x4de8b7=0x0;_0x4de8b7<_0x4381cb[_0x5d1f00][_0xd68c('0x97')];_0x4de8b7++){this['recursiveNodeIndex'](_0x4381cb[_0x5d1f00][_0x4de8b7]);}}else if(_['isString'](_0x4381cb[_0x5d1f00])){_0x4381cb[_0x5d1f00]=this[_0xd68c('0x95')](_0x4381cb[_0x5d1f00]);}}}};AGIVertices[_0xd68c('0xf')][_0xd68c('0x98')]=function(_0x2b57e1,_0x3f1c8b){for(var _0xf93abe in _0x2b57e1){if(_0x2b57e1[_0xd68c('0x92')](_0xf93abe)){if(_[_0xd68c('0x99')](_0x2b57e1[_0xf93abe])){if(!_[_0xd68c('0x45')](_0x2b57e1[_0xf93abe])){this['saveRestApiResult'](_0x2b57e1[_0xf93abe],util[_0xd68c('0x26')]('%s.%s',_0x3f1c8b,_0xf93abe));}}else if(_[_0xd68c('0x9a')](_0x2b57e1[_0xf93abe])){for(var _0x22cadd=0x0;_0x22cadd<_0x2b57e1[_0xf93abe][_0xd68c('0x97')];_0x22cadd++){this[_0xd68c('0x98')](_0x2b57e1[_0xf93abe][_0x22cadd],util[_0xd68c('0x26')](_0xd68c('0x9b'),_0x3f1c8b,_0xf93abe+'['+_0x22cadd+']'));}}else{if(!_[_0xd68c('0x46')](_0x2b57e1[_0xf93abe])){this[_0xd68c('0xd')][_0xd68c('0x9c')](util[_0xd68c('0x26')](_0xd68c('0x9b'),_0x3f1c8b,_0xf93abe),_0x2b57e1[_0xf93abe]);}}}}};AGIVertices['prototype'][_0xd68c('0x94')]=function(_0x5257c1){try{var _0x5a3075=JSON['parse'](_0x5257c1);this[_0xd68c('0x96')](_0x5a3075);return JSON[_0xd68c('0x74')](_0x5a3075);}catch(_0x57e97e){return this[_0xd68c('0x95')](_0x5257c1);}};AGIVertices[_0xd68c('0xf')][_0xd68c('0x95')]=function(_0x248d50){console['log'](_0xd68c('0x9d'),_0x248d50);var _0x4f5ee0=_0x248d50['split']('{');for(var _0x515674=0x1;_0x515674<_0x4f5ee0[_0xd68c('0x97')];_0x515674+=0x1){var _0x1c6624=_0x4f5ee0[_0x515674]['split']('}');if(_0x1c6624['length']>0x1){_0x248d50=_0x248d50[_0xd68c('0x9e')]('{'+_0x1c6624[0x0]+'}',this[_0xd68c('0xd')][_0xd68c('0x9f')](_0x1c6624[0x0])[_0xd68c('0xa0')]||_0x1c6624[0x0]);}}if(_0x4f5ee0[_0xd68c('0x97')]===0x1){return _0x248d50[_0xd68c('0x4d')]();}console[_0xd68c('0x42')](_0xd68c('0xa1'),_0x248d50);return this[_0xd68c('0x95')](_0x248d50);};AGIVertices['prototype']['getAndSetVariable']=function(_0x411f20,_0xb8389b){var _0x20fedd=this[_0xd68c('0xd')]['getVariable'](_0x411f20);if(_0x20fedd['result']===-0x1){return _0x20fedd;}logger['info'](util[_0xd68c('0x26')](_0xd68c('0xa2'),_0xb8389b,_0x20fedd[_0xd68c('0xa0')]));return this['channel'][_0xd68c('0x9c')](_0xb8389b,_0x20fedd[_0xd68c('0xa0')]);};AGIVertices['prototype'][_0xd68c('0xa3')]=function(_0x5d9117){return _0x5d9117&&_0x5d9117!=='0'&&_0x5d9117!=='-1'&&_0x5d9117!=='';};AGIVertices[_0xd68c('0xf')][_0xd68c('0xa4')]=function(_0x2813d2){this[_0xd68c('0x34')][_0xd68c('0xa5')](this,_0x2813d2,'-');_0x2813d2['retry']=_0x2813d2[_0xd68c('0xa4')];return{'code':0xc8,'result':'-'};};AGIVertices[_0xd68c('0xf')][_0xd68c('0xa6')]=function(_0x2ca2a9){logger[_0xd68c('0x2c')](util[_0xd68c('0x26')](_0xd68c('0xa7'),_0x2ca2a9[_0xd68c('0x36')]));if(!this[_0xd68c('0xa3')](_0x2ca2a9[_0xd68c('0x5c')])){return this[_0xd68c('0xd')][_0xd68c('0xa8')](_0xd68c('0xa9'));}var _0x1b5b59='\x22'+_0x2ca2a9[_0xd68c('0x5c')]+'\x22';if(this[_0xd68c('0xa3')](_0x2ca2a9[_0xd68c('0x7a')])){_0x1b5b59+=','+_0x2ca2a9['options'];}var _0x4e2164=this[_0xd68c('0xd')]['exec'](_0xd68c('0xaa'),_0x1b5b59);if(_0x4e2164[_0xd68c('0xab')]===-0x1){return _0x4e2164;}return this[_0xd68c('0xd')][_0xd68c('0xa8')](util['format'](_0xd68c('0xac'),_0x1b5b59));};AGIVertices[_0xd68c('0xf')]['mrcprecog']=function(_0x31c802){logger[_0xd68c('0x2c')](util[_0xd68c('0x26')](_0xd68c('0xad'),_0x31c802[_0xd68c('0x36')]));if(!this['isConfigured'](_0x31c802[_0xd68c('0xae')])){return this[_0xd68c('0xd')][_0xd68c('0xa8')](_0xd68c('0xaf'));}var _0x45272b=_0x31c802[_0xd68c('0xae')];if(this[_0xd68c('0xa3')](_0x31c802[_0xd68c('0x7a')])){_0x45272b+=','+_0x31c802[_0xd68c('0x7a')];}var _0x587949=this[_0xd68c('0xd')][_0xd68c('0x58')](_0xd68c('0xb0'),_0x45272b);if(_0x587949[_0xd68c('0xab')]===-0x1){return _0x587949;}var _0x59d986=this[_0xd68c('0xb1')](_0xd68c('0xb2'),_0xd68c('0xb3'));if(_0x59d986[_0xd68c('0xab')]===-0x1){return _0x59d986;}var _0x147667=this['getAndSetVariable'](_0xd68c('0xb4'),_0xd68c('0xb5'));if(_0x147667['result']===-0x1){return _0x147667;}var _0x4da594=this['getAndSetVariable']('RECOG_INSTANCE()',_0xd68c('0xb6'));if(_0x4da594['result']===-0x1){return _0x4da594;}return this[_0xd68c('0xd')][_0xd68c('0xa8')](util[_0xd68c('0x26')](_0xd68c('0xb7'),_0x45272b));};AGIVertices['prototype'][_0xd68c('0x7')]=function(_0x33941a){logger['info'](util[_0xd68c('0x26')](_0xd68c('0xb8'),_0x33941a['label']));return this['channel']['agi']([_0x33941a['command'],_0x33941a['args']]);};AGIVertices['prototype'][_0xd68c('0xb9')]=function(_0x2b56e0){logger[_0xd68c('0x2c')](util[_0xd68c('0x26')](_0xd68c('0xba'),_0x2b56e0['label']));if(this[_0xd68c('0xa3')](_0x2b56e0[_0xd68c('0x67')])){logger[_0xd68c('0x2c')](util['format'](_0xd68c('0xbb'),_0x2b56e0[_0xd68c('0x67')]));var _0x51e6d8=this[_0xd68c('0xd')]['wait'](_0x2b56e0[_0xd68c('0x67')]);if(_0x51e6d8[_0xd68c('0xab')]===-0x1){return _0x51e6d8;}}return this['channel']['answer']();};AGIVertices['prototype']['callback']=function(_0x402110){console[_0xd68c('0xbc')](_0xd68c('0xbd'),_0x402110);logger[_0xd68c('0x2c')](util[_0xd68c('0x26')](_0xd68c('0xbe'),_0x402110[_0xd68c('0x36')]));if(!this[_0xd68c('0xa3')](_0x402110['list_id'])){return this[_0xd68c('0xd')]['error'](_0x402110,_0xd68c('0xbf'));}_0x402110[_0xd68c('0x4b')]=moment();if(this[_0xd68c('0xa3')](_0x402110[_0xd68c('0xc0')])){_0x402110[_0xd68c('0x4b')]=moment()['add'](_0x402110[_0xd68c('0xc0')],'minutes');}if(!this[_0xd68c('0xa3')](_0x402110[_0xd68c('0xc1')])){_0x402110[_0xd68c('0xc1')]=0x2;}console['log']('before\x20createcmcontact',_0x402110);this[_0xd68c('0x41')]['sync'](this,_0x402110);return this['channel'][_0xd68c('0xa8')](util[_0xd68c('0x26')](_0xd68c('0xc2'),_0x402110[_0xd68c('0xc3')],_0x402110[_0xd68c('0x4a')],_0x402110['scheduledAt']));};AGIVertices[_0xd68c('0xf')][_0xd68c('0xc4')]=function(_0xcf980c){logger['info'](util[_0xd68c('0x26')](_0xd68c('0xc5'),_0xcf980c[_0xd68c('0x36')]));var _0xd6002a=this[_0xd68c('0xd')][_0xd68c('0x58')](_0xcf980c[_0xd68c('0xc6')],_0xcf980c['options']);if(_0xd6002a[_0xd68c('0xab')]===-0x1){return _0xd6002a;}return this[_0xd68c('0xd')][_0xd68c('0xa8')](util[_0xd68c('0x26')](_0xd68c('0xc7'),_0xcf980c[_0xd68c('0xc6')],_0xcf980c[_0xd68c('0x7a')]));};AGIVertices[_0xd68c('0xf')][_0xd68c('0xc8')]=function(_0x16fc7f){logger[_0xd68c('0x2c')](util[_0xd68c('0x26')]('Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block',_0x16fc7f[_0xd68c('0x36')]));if(!this[_0xd68c('0xa3')](_0x16fc7f[_0xd68c('0x5c')])){return this[_0xd68c('0xd')][_0xd68c('0xa8')]('no\x20text\x20configured');}var _0x59a187='\x22'+_0x16fc7f[_0xd68c('0x5c')]+'\x22';if(this[_0xd68c('0xa3')](_0x16fc7f[_0xd68c('0x7a')])){_0x59a187+=','+_0x16fc7f[_0xd68c('0x7a')];}var _0x5224aa=this[_0xd68c('0xd')][_0xd68c('0x58')]('MRCPSynth',_0x59a187);if(_0x5224aa[_0xd68c('0xab')]===-0x1){return _0x5224aa;}return this[_0xd68c('0xd')][_0xd68c('0xa8')](util['format'](_0xd68c('0xac'),_0x59a187));};AGIVertices[_0xd68c('0xf')][_0xd68c('0xc9')]=function(_0x462029){logger[_0xd68c('0x2c')](util[_0xd68c('0x26')](_0xd68c('0xca'),_0x462029['label']));if(!this['isConfigured'](_0x462029['text'])){return this[_0xd68c('0xd')][_0xd68c('0xa8')](_0xd68c('0xa9'));}var _0x1ad619='\x22'+_0x462029[_0xd68c('0x5c')]+'\x22';if(this['isConfigured'](_0x462029[_0xd68c('0x7a')])){_0x1ad619+=','+_0x462029['options'];}var _0x254b48=this['channel'][_0xd68c('0x58')](_0xd68c('0xaa'),_0x1ad619);if(_0x254b48[_0xd68c('0xab')]===-0x1){return _0x254b48;}return this[_0xd68c('0xd')][_0xd68c('0xa8')](util[_0xd68c('0x26')](_0xd68c('0xac'),_0x1ad619));};AGIVertices[_0xd68c('0xf')][_0xd68c('0xcb')]=function(_0x48008f){logger[_0xd68c('0x2c')](util[_0xd68c('0x26')]('Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block',_0x48008f[_0xd68c('0x36')]));if(!this[_0xd68c('0xa3')](_0x48008f[_0xd68c('0xae')])){return this[_0xd68c('0xd')][_0xd68c('0xa8')](_0xd68c('0xaf'));}var _0x3435fb=_0x48008f[_0xd68c('0xae')];if(this[_0xd68c('0xa3')](_0x48008f[_0xd68c('0x7a')])){_0x3435fb+=','+_0x48008f[_0xd68c('0x7a')];}var _0x5a3bd9=this[_0xd68c('0xd')][_0xd68c('0x58')]('MRCPRecog',_0x3435fb);if(_0x5a3bd9['result']===-0x1){return _0x5a3bd9;}var _0x396d61=this[_0xd68c('0xb1')]('RECOG_CONFIDENCE()',_0xd68c('0xcc'));if(_0x396d61[_0xd68c('0xab')]===-0x1){return _0x396d61;}var _0x1bd14e=this['getAndSetVariable'](_0xd68c('0xb4'),_0xd68c('0xcd'));if(_0x1bd14e[_0xd68c('0xab')]===-0x1){return _0x1bd14e;}var _0x34aed3=this['getAndSetVariable'](_0xd68c('0xce'),_0xd68c('0xcf'));if(_0x34aed3[_0xd68c('0xab')]===-0x1){return _0x34aed3;}return this['channel']['noop'](util[_0xd68c('0x26')](_0xd68c('0xb7'),_0x3435fb));};AGIVertices[_0xd68c('0xf')]['sestekasr']=function(_0x5e7119){logger[_0xd68c('0x2c')](util[_0xd68c('0x26')](_0xd68c('0xd0'),_0x5e7119[_0xd68c('0x36')]));if(!this[_0xd68c('0xa3')](_0x5e7119[_0xd68c('0xae')])){return this[_0xd68c('0xd')][_0xd68c('0xa8')](_0xd68c('0xaf'));}var _0x40c3ad=_0x5e7119[_0xd68c('0xae')];if(this['isConfigured'](_0x5e7119[_0xd68c('0x7a')])){_0x40c3ad+=','+_0x5e7119[_0xd68c('0x7a')];}var _0x31a863=this[_0xd68c('0xd')][_0xd68c('0x58')](_0xd68c('0xb0'),_0x40c3ad);if(_0x31a863[_0xd68c('0xab')]===-0x1){return _0x31a863;}var _0x26519a=this[_0xd68c('0xb1')](_0xd68c('0xb2'),_0xd68c('0xd1'));if(_0x26519a[_0xd68c('0xab')]===-0x1){return _0x26519a;}var _0x46e8df=this[_0xd68c('0xb1')](_0xd68c('0xb4'),_0xd68c('0xd2'));if(_0x46e8df['result']===-0x1){return _0x46e8df;}var _0x525cc7=this[_0xd68c('0xb1')](_0xd68c('0xce'),'SESTEK_ASR_INSTANCE');if(_0x525cc7[_0xd68c('0xab')]===-0x1){return _0x525cc7;}return this['channel'][_0xd68c('0xa8')](util[_0xd68c('0x26')](_0xd68c('0xb7'),_0x40c3ad));};AGIVertices[_0xd68c('0xf')][_0xd68c('0xd3')]=function(_0x4bb3cb){logger[_0xd68c('0x2c')](util[_0xd68c('0x26')](_0xd68c('0xd4'),_0x4bb3cb[_0xd68c('0x36')]));if(!this['isConfigured'](_0x4bb3cb['odbc_id'])){return this[_0xd68c('0xd')]['error'](_0x4bb3cb,'no\x20database\x20selected');}var _0x59cba9=this['getSquareOdbc']['sync'](this,_0x4bb3cb[_0xd68c('0xd5')]);if(!_0x59cba9){return this[_0xd68c('0xd')][_0xd68c('0x2a')](_0x4bb3cb,_0xd68c('0xd6'));}if(!this[_0xd68c('0xa3')](_0x4bb3cb[_0xd68c('0x2e')])){return this['channel'][_0xd68c('0x2a')](_0x4bb3cb,'no\x20query\x20configured');}var _0x51c3a8=_0x4bb3cb[_0xd68c('0x2e')][_0xd68c('0x59')](/(\r\n|\n|\r)/gm,'\x20');this[_0xd68c('0xd')][_0xd68c('0xa8')](util[_0xd68c('0x26')](_0xd68c('0xd7'),_0x51c3a8));var _0x40794f=this[_0xd68c('0x28')]['sync'](this,_0x59cba9,_0x51c3a8);this[_0xd68c('0x34')][_0xd68c('0xa5')](this,_0x4bb3cb,_0x51c3a8);if(!this[_0xd68c('0xa3')](_0x4bb3cb[_0xd68c('0xd8')])){return this[_0xd68c('0xd')][_0xd68c('0xa8')]('no\x20variable\x20selected\x20for\x20the\x20result');}var _0x420383=this[_0xd68c('0x9f')][_0xd68c('0xa5')](this,_0x4bb3cb[_0xd68c('0xd8')]);if(!_0x420383){return this['channel'][_0xd68c('0x2a')](_0x4bb3cb,'no\x20variable\x20found');}var _0x4eba4a=this;_0x40794f[_0xd68c('0xd9')](function(_0x149b3a,_0x9cd787){Object[_0xd68c('0xda')](_0x149b3a)['forEach'](function(_0x1e3d03){_0x4eba4a[_0xd68c('0xd')][_0xd68c('0x9c')](util[_0xd68c('0x26')](_0xd68c('0xdb'),_0x420383,_0x9cd787,_0x1e3d03),_0x149b3a[_0x1e3d03]);});});this[_0xd68c('0xd')]['setVariable'](util[_0xd68c('0x26')](_0xd68c('0xdc'),_0x420383),_0x40794f[_0xd68c('0x97')]);return this[_0xd68c('0xd')][_0xd68c('0xa8')](util[_0xd68c('0x26')]('variable\x20%s\x20set',_0x420383));};AGIVertices[_0xd68c('0xf')]['dial']=function(_0x17793d){logger[_0xd68c('0xdd')](util[_0xd68c('0x26')](_0xd68c('0xde'),_0x17793d[_0xd68c('0x36')]));if(!this[_0xd68c('0xa3')](_0x17793d['sip_id'])){return this[_0xd68c('0xd')][_0xd68c('0x2a')](_0x17793d,_0xd68c('0xdf'));}var _0x456185=this[_0xd68c('0x19')][_0xd68c('0xa5')](this,_0x17793d[_0xd68c('0xe0')]);if(!_0x456185){return this['channel'][_0xd68c('0x2a')](_0x17793d,_0xd68c('0xe1'));}var _0x26bbd9=this[_0xd68c('0xd')]['exec'](_0xd68c('0xe2'),[util[_0xd68c('0x26')](_0xd68c('0xe3'),_0x456185),_0x17793d[_0xd68c('0x67')],_0x17793d['opts'],_0x17793d[_0xd68c('0x65')]]);if(_0x26bbd9[_0xd68c('0xab')]===-0x1){return _0x26bbd9;}return this['channel']['noop'](util[_0xd68c('0x26')]('Executed\x20command\x20%s',_0xd68c('0xe2')));};AGIVertices[_0xd68c('0xf')][_0xd68c('0xe4')]=function(_0x41ed5d){logger[_0xd68c('0x2c')](util[_0xd68c('0x26')]('Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block',_0x41ed5d['label']));if(!this['isConfigured'](_0x41ed5d[_0xd68c('0x7f')])){return this[_0xd68c('0xd')][_0xd68c('0xa8')](_0xd68c('0xe5'));}if(!this[_0xd68c('0xa3')](_0x41ed5d[_0xd68c('0x5c')])){return this[_0xd68c('0xd')]['noop']('no\x20text\x20configured');}this[_0xd68c('0xd')][_0xd68c('0xe6')]=!![];this['createSquareDetailsReport'](_0x41ed5d);this['createSquareMessage'](_0x41ed5d[_0xd68c('0x5c')],'in');this[_0xd68c('0xd')]['noop'](util[_0xd68c('0x26')]('Trying\x20Dialogflow:\x20%s',_0x41ed5d[_0xd68c('0x5c')]));var _0x27fccd=this[_0xd68c('0x7b')][_0xd68c('0xa5')](this,_0x41ed5d);if(_0x27fccd){for(var _0x4b951e in _0x27fccd){if(_0x27fccd[_0xd68c('0x92')](_0x4b951e)){this[_0xd68c('0xd')][_0xd68c('0x9c')](util[_0xd68c('0x26')](_0xd68c('0xe7'),_0x4b951e[_0xd68c('0x6c')]()),_0x27fccd[_0x4b951e]);}}this[_0xd68c('0x40')](_0x27fccd[_0xd68c('0xe8')],_0xd68c('0xe9'));return this[_0xd68c('0xd')][_0xd68c('0xa8')](util[_0xd68c('0x26')](_0xd68c('0xea'),_0x27fccd[_0xd68c('0xe8')]));}return this[_0xd68c('0xd')]['error'](_0x41ed5d,_0xd68c('0xeb'));};AGIVertices[_0xd68c('0xf')]['sesteknda']=function(_0x255ee7){logger[_0xd68c('0x2c')](util[_0xd68c('0x26')]('Enter\x20in\x20SESTEKNDA\x20(%s)\x20block',_0x255ee7[_0xd68c('0x36')]));if(!this['isConfigured'](_0x255ee7[_0xd68c('0xec')])){return this[_0xd68c('0xd')][_0xd68c('0xa8')](_0xd68c('0xed'));}if(!this[_0xd68c('0xa3')](_0x255ee7[_0xd68c('0xee')])){return this[_0xd68c('0xd')][_0xd68c('0xa8')](_0xd68c('0xef'));}if(!this['isConfigured'](_0x255ee7[_0xd68c('0xf0')])){return this[_0xd68c('0xd')][_0xd68c('0xa8')]('no\x20password\x20configured');}if(!this[_0xd68c('0xa3')](_0x255ee7[_0xd68c('0xf1')])){return this[_0xd68c('0xd')]['noop']('no\x20text\x20configured');}this[_0xd68c('0xd')][_0xd68c('0xe6')]=!![];this['createSquareDetailsReport'](_0x255ee7);this[_0xd68c('0x40')](_0x255ee7['text'],'in');this[_0xd68c('0xd')][_0xd68c('0xa8')](util[_0xd68c('0x26')](_0xd68c('0xf2'),_0x255ee7[_0xd68c('0x5c')]));var _0x50bd43=this['sestekNDA'][_0xd68c('0xa5')](this,_0x255ee7);if(_0x50bd43){for(var _0x21ffc3 in _0x50bd43){if(_0x50bd43['hasOwnProperty'](_0x21ffc3)){this['channel'][_0xd68c('0x9c')](util[_0xd68c('0x26')](_0xd68c('0xf3'),_0x21ffc3[_0xd68c('0x6c')]()),_0x50bd43[_0x21ffc3]);}}this['createSquareMessage'](_0x50bd43[_0xd68c('0xe8')],'out');if(_0x50bd43[_0xd68c('0xf4')]){this[_0xd68c('0xd')][_0xd68c('0xa8')](util[_0xd68c('0x26')](_0xd68c('0xf5'),_0x50bd43['audiofile']));var _0x36f426=this[_0xd68c('0xd')][_0xd68c('0xf6')](_0x50bd43['audiofile']);try{fs[_0xd68c('0xf7')](_0x50bd43[_0xd68c('0xf4')]+_0xd68c('0xf8'));}catch(_0x416f57){logger['error'](_0x416f57);}return _0x36f426;}else{return this[_0xd68c('0xd')][_0xd68c('0xa8')](util['format'](_0xd68c('0xf9'),_0x50bd43[_0xd68c('0xe8')]));}}return this[_0xd68c('0xd')][_0xd68c('0x2a')](_0x255ee7,_0xd68c('0xfa'));};AGIVertices[_0xd68c('0xf')][_0xd68c('0xfb')]=function(_0xf8d0d7){logger[_0xd68c('0x2c')](util['format'](_0xd68c('0xfc'),_0xf8d0d7['label']));return this['channel'][_0xd68c('0xa8')](_0xd68c('0xfb'));};AGIVertices[_0xd68c('0xf')][_0xd68c('0xfd')]=function(_0x3eedbe){logger['info'](util[_0xd68c('0x26')](_0xd68c('0xfe'),_0x3eedbe['label']));var _0x397587='';if(_0x3eedbe['trunk_id']){if(!this[_0xd68c('0xa3')](_0x3eedbe[_0xd68c('0xff')])){return this['channel'][_0xd68c('0x2a')](_0x3eedbe,'no\x20trunk\x20selected');}else{var _0x5c7bd2=parseInt(_0x3eedbe['trunk_id'],0xa);if(isNaN(_0x5c7bd2)){_0x397587=_0x3eedbe[_0xd68c('0xff')];}else{_0x397587=this[_0xd68c('0x1b')]['sync'](this,_0x3eedbe[_0xd68c('0xff')]);if(!_0x397587){return this[_0xd68c('0xd')][_0xd68c('0x2a')](_0x3eedbe,_0xd68c('0x100'));}}}}else if(_0x3eedbe[_0xd68c('0x101')]){_0x397587=_0x3eedbe['trunk_name'];}else{return this['channel'][_0xd68c('0x2a')](_0x3eedbe,_0xd68c('0x102'));}var _0x237884=this[_0xd68c('0xd')][_0xd68c('0x58')](_0xd68c('0xe2'),[util[_0xd68c('0x26')](_0xd68c('0x103'),_0x397587,_0x3eedbe[_0xd68c('0xc3')]),_0x3eedbe[_0xd68c('0x67')],_0x3eedbe[_0xd68c('0x104')],_0x3eedbe[_0xd68c('0x65')]]);if(_0x237884[_0xd68c('0xab')]===-0x1){return _0x237884;}return this[_0xd68c('0xd')][_0xd68c('0xa8')](util[_0xd68c('0x26')](_0xd68c('0x105'),_0xd68c('0xe2')));};AGIVertices[_0xd68c('0xf')][_0xd68c('0x106')]=function(_0x2cb94f){logger['info'](util[_0xd68c('0x26')]('Enter\x20in\x20FINALLY\x20(%s)\x20block',_0x2cb94f[_0xd68c('0x36')]));return this[_0xd68c('0xd')][_0xd68c('0xa8')]('finally');};AGIVertices[_0xd68c('0xf')]['getdigits']=function(_0x5a9e8d){logger[_0xd68c('0x2c')](util[_0xd68c('0x26')](_0xd68c('0x107'),_0x5a9e8d['label']));if(_0x5a9e8d[_0xd68c('0x108')]===0x0){return this['maxRetry'](_0x5a9e8d);}_0x5a9e8d[_0xd68c('0x108')]-=0x1;if(!this[_0xd68c('0xa3')](_0x5a9e8d[_0xd68c('0x109')])){return this[_0xd68c('0xd')][_0xd68c('0x2a')](_0x5a9e8d,_0xd68c('0x10a'));}var _0x636b89=this['getSound']['sync'](this,_0x5a9e8d[_0xd68c('0x109')]);if(!_0x636b89){return this[_0xd68c('0xd')]['error'](_0x5a9e8d,'no\x20file\x20audio\x20found');}if(!this[_0xd68c('0xa3')](_0x5a9e8d[_0xd68c('0xd8')])){return this[_0xd68c('0xd')]['error'](_0xd68c('0x10b'));}var _0x5c0fb0=this[_0xd68c('0xd')][_0xd68c('0x10c')](_0x636b89,_0x5a9e8d[_0xd68c('0x10d')],_0x5a9e8d[_0xd68c('0x10e')]);var _0x3d46ca=_0x5c0fb0['result']?_0x5c0fb0['result']['toString']():'';logger[_0xd68c('0x2c')](_0xd68c('0x10f'),JSON[_0xd68c('0x74')](_0x5c0fb0));if(_0x5c0fb0[_0xd68c('0xab')]===-0x1){this[_0xd68c('0x34')][_0xd68c('0xa5')](this,_0x5a9e8d,_0x3d46ca);return _0x5c0fb0;}else if(_0x5c0fb0['extra']===_0xd68c('0x67')){_0x5c0fb0['result']=_0x3d46ca['length']>=parseInt(_0x5a9e8d[_0xd68c('0x110')])?'x':'i';}else{_0x5c0fb0[_0xd68c('0xab')]=_0x3d46ca[_0xd68c('0x97')]>=parseInt(_0x5a9e8d[_0xd68c('0x110')])&&_0x3d46ca[_0xd68c('0x97')]<=parseInt(_0x5a9e8d[_0xd68c('0x10e')])?'x':'i';}var _0x453b3=this[_0xd68c('0x9f')][_0xd68c('0xa5')](this,_0x5a9e8d['variable_id']);if(!_0x453b3){return this[_0xd68c('0xd')][_0xd68c('0x2a')](_0x5a9e8d,'no\x20variable\x20found');}this[_0xd68c('0xd')][_0xd68c('0x9c')](_0x453b3,_0x3d46ca);if(this['isConfigured'](_0x5a9e8d[_0xd68c('0x111')])){var _0x215393=parseInt(_0x5a9e8d[_0xd68c('0x111')],0xa);var _0x2325f5=rs['generate']({'charset':'*','length':_0x215393});var _0x531e3b=_0x3d46ca[_0xd68c('0x97')];if(_0x531e3b>0x0){if(_0x531e3b>_0x215393){this['createSquareDetailsReport']['sync'](this,_0x5a9e8d,_0x5a9e8d[_0xd68c('0x112')]===_0xd68c('0x113')?_0x2325f5+_0x3d46ca['substr'](_0x215393):_0x3d46ca[_0xd68c('0x114')](0x0,_0x531e3b-_0x215393)+_0x2325f5);}else{this[_0xd68c('0x34')][_0xd68c('0xa5')](this,_0x5a9e8d,rs[_0xd68c('0x115')]({'charset':'*','length':_0x531e3b}));}}else{this[_0xd68c('0x34')][_0xd68c('0xa5')](this,_0x5a9e8d,'');}}else{this[_0xd68c('0x34')][_0xd68c('0xa5')](this,_0x5a9e8d,_0x3d46ca);}return _0x5c0fb0;};AGIVertices[_0xd68c('0xf')][_0xd68c('0xc')]=function(_0x4faead){logger[_0xd68c('0x2c')](util[_0xd68c('0x26')](_0xd68c('0x116'),_0x4faead[_0xd68c('0x36')]));return this[_0xd68c('0xb')](_0x4faead);};AGIVertices[_0xd68c('0xf')][_0xd68c('0x117')]=function(_0x11075d){logger[_0xd68c('0x2c')](util[_0xd68c('0x26')](_0xd68c('0x118'),_0x11075d['label']));this[_0xd68c('0x34')][_0xd68c('0xa5')](this,_0x11075d,_0x11075d[_0xd68c('0x119')]);return this[_0xd68c('0xd')][_0xd68c('0xa8')](util[_0xd68c('0x26')](_0xd68c('0x11a'),_0x11075d[_0xd68c('0x119')]));};AGIVertices[_0xd68c('0xf')][_0xd68c('0x11b')]=function(_0x585437){logger[_0xd68c('0x2c')](util[_0xd68c('0x26')](_0xd68c('0x11c'),_0x585437['label']));if(!this[_0xd68c('0xa3')](_0x585437[_0xd68c('0x84')])||!this[_0xd68c('0xa3')](_0x585437[_0xd68c('0x85')])){return this[_0xd68c('0xd')]['noop'](_0xd68c('0x11d'));}if(!this[_0xd68c('0xa3')](_0x585437['text'])){return this[_0xd68c('0xd')][_0xd68c('0xa8')](_0xd68c('0xa9'));}this[_0xd68c('0xd')][_0xd68c('0xa8')](util['format'](_0xd68c('0x11e'),_0x585437[_0xd68c('0x5c')]));var _0xb7e8e6=this[_0xd68c('0x83')][_0xd68c('0xa5')](this,_0x585437);if(_0xb7e8e6){this[_0xd68c('0xd')][_0xd68c('0xa8')](util[_0xd68c('0x26')](_0xd68c('0x11f'),_0xb7e8e6));var _0x2cf456=this[_0xd68c('0xd')][_0xd68c('0xf6')](_0xb7e8e6);try{fs[_0xd68c('0xf7')](_0xb7e8e6+_0xd68c('0xf8'));}catch(_0x141aef){logger['error'](_0x141aef);}return _0x2cf456;}return this[_0xd68c('0xd')][_0xd68c('0x2a')](_0x585437,'aws\x20Polly\x20is\x20unreachable');};AGIVertices[_0xd68c('0xf')]['awslex']=function(_0x120a62){logger[_0xd68c('0x2c')](util[_0xd68c('0x26')]('Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block',_0x120a62[_0xd68c('0x36')]));if(!this['isConfigured'](_0x120a62['aws_access_key_id'])||!this[_0xd68c('0xa3')](_0x120a62['aws_secret_access_key'])){return this['channel']['noop'](_0xd68c('0x11d'));}if(!this[_0xd68c('0xa3')](_0x120a62[_0xd68c('0x8a')])){return this[_0xd68c('0xd')][_0xd68c('0xa8')](_0xd68c('0x120'));}if(!this[_0xd68c('0xa3')](_0x120a62[_0xd68c('0x5c')])){return this['channel'][_0xd68c('0xa8')](_0xd68c('0xa9'));}this[_0xd68c('0xd')][_0xd68c('0xe6')]=!![];this[_0xd68c('0x34')](_0x120a62);this['createSquareMessage'](_0x120a62['text'],'in');this[_0xd68c('0xd')][_0xd68c('0xa8')](util[_0xd68c('0x26')](_0xd68c('0x121'),_0x120a62[_0xd68c('0x5c')]));var _0x599de2=this[_0xd68c('0x89')]['sync'](this,_0x120a62);if(_0x599de2){for(var _0x16d265 in _0x599de2){if(_0x599de2['hasOwnProperty'](_0x16d265)&&_[_0xd68c('0x93')](_0x599de2[_0x16d265])){this[_0xd68c('0xd')][_0xd68c('0x9c')](util[_0xd68c('0x26')](_0xd68c('0x122'),_0x16d265[_0xd68c('0x6c')]()),_0x599de2[_0x16d265]);}}if(_[_0xd68c('0x46')](_0x599de2[_0xd68c('0x123')])){return this[_0xd68c('0xd')][_0xd68c('0xa8')](_0xd68c('0x124'));}else{this['createSquareMessage'](_0x599de2[_0xd68c('0x123')],_0xd68c('0xe9'));return this[_0xd68c('0xd')][_0xd68c('0xa8')](util['format'](_0xd68c('0x125'),_0x599de2[_0xd68c('0x123')]));}}return this[_0xd68c('0xd')][_0xd68c('0x2a')](_0x120a62,_0xd68c('0x126'));};AGIVertices['prototype'][_0xd68c('0x127')]=function(_0xb7b358){logger['info'](util[_0xd68c('0x26')](_0xd68c('0x128'),_0xb7b358[_0xd68c('0x36')],_0xb7b358[_0xd68c('0x67')]));if(!this[_0xd68c('0xa3')](_0xb7b358[_0xd68c('0x7f')])){return this[_0xd68c('0xd')][_0xd68c('0xa8')](_0xd68c('0xe5'));}var _0x129a06=_0xd68c('0x129');var _0x32c93a=util[_0xd68c('0x26')](_0xd68c('0x12a'),FILES_PATH,rs[_0xd68c('0x115')](0x4));var _0x3055f9=util[_0xd68c('0x26')](_0xd68c('0x9b'),_0x32c93a,_0x129a06);var _0x6e0a26=!![];if(_0xb7b358[_0xd68c('0x12b')]==='NOBEEP'){_0x6e0a26=![];}var _0x1e8034=this[_0xd68c('0xd')][_0xd68c('0x12c')](_0x32c93a,_0x129a06,_0xb7b358[_0xd68c('0x12d')],_0xb7b358[_0xd68c('0x67')],undefined,_0x6e0a26);if(_0x1e8034['result']!==-0x1){this[_0xd68c('0xd')]['noop'](util[_0xd68c('0x26')](_0xd68c('0x12e'),_0x3055f9));var _0x5572cd=this['googleASR']['sync'](this,_0xb7b358,_0x3055f9);if(_0x5572cd){for(var _0x545592 in _0x5572cd){if(_0x5572cd[_0xd68c('0x92')](_0x545592)){this['channel'][_0xd68c('0x9c')](util[_0xd68c('0x26')](_0xd68c('0x12f'),_0x545592[_0xd68c('0x6c')]()),_0x5572cd[_0x545592]);}}return this['channel']['noop'](util[_0xd68c('0x26')](_0xd68c('0x130'),JSON[_0xd68c('0x74')](_0x5572cd)));}}return _0x1e8034;};AGIVertices[_0xd68c('0xf')][_0xd68c('0x131')]=function(_0x5263d5){logger[_0xd68c('0x2c')](util[_0xd68c('0x26')](_0xd68c('0x132'),_0x5263d5['label']));if(!this[_0xd68c('0xa3')](_0x5263d5[_0xd68c('0x8e')])){return this[_0xd68c('0xd')][_0xd68c('0xa8')](_0xd68c('0x133'));}if(!this['isConfigured'](_0x5263d5['appsecret'])){return this[_0xd68c('0xd')][_0xd68c('0xa8')](_0xd68c('0x134'));}var _0x4f2821=_0xd68c('0x129');var _0x80c603=util[_0xd68c('0x26')](_0xd68c('0x12a'),FILES_PATH,rs['generate'](0x4));var _0x25c39e=util[_0xd68c('0x26')](_0xd68c('0x9b'),_0x80c603,_0x4f2821);var _0x3b433f=!![];if(_0x5263d5[_0xd68c('0x12b')]===_0xd68c('0x135')){_0x3b433f=![];}var _0x4167b9=this[_0xd68c('0xd')][_0xd68c('0x12c')](_0x80c603,_0x4f2821,_0x5263d5[_0xd68c('0x12d')],_0x5263d5['timeout'],undefined,_0x3b433f);if(_0x4167b9[_0xd68c('0xab')]!==-0x1){this['channel'][_0xd68c('0xa8')](util[_0xd68c('0x26')](_0xd68c('0x136'),_0x25c39e));var _0x616289=this[_0xd68c('0x8d')]['sync'](this,_0x5263d5,_0x25c39e);if(_0x616289){for(var _0x2556dd in _0x616289){if(_0x616289[_0xd68c('0x92')](_0x2556dd)){this[_0xd68c('0xd')]['setVariable'](util['format'](_0xd68c('0x137'),_0x2556dd['toUpperCase']()),_0x616289[_0x2556dd]);}}return this[_0xd68c('0xd')][_0xd68c('0xa8')](util[_0xd68c('0x26')](_0xd68c('0x138'),JSON[_0xd68c('0x74')](_0x616289)));}}return _0x4167b9;};AGIVertices[_0xd68c('0xf')]['gotoc']=function(_0x842770){logger[_0xd68c('0x2c')](util[_0xd68c('0x26')](_0xd68c('0x139'),_0x842770[_0xd68c('0x36')]));return this[_0xd68c('0xd')][_0xd68c('0x13a')](_0x842770[_0xd68c('0x3a')],_0x842770['extension'],_0x842770['priority']);};AGIVertices[_0xd68c('0xf')][_0xd68c('0x13b')]=function(_0x25406f){logger[_0xd68c('0x2c')](util[_0xd68c('0x26')](_0xd68c('0x13c'),_0x25406f[_0xd68c('0x36')]));if(!this[_0xd68c('0xa3')](_0x25406f[_0xd68c('0x13d')])){return this[_0xd68c('0xd')]['error'](_0x25406f,'no\x20condition\x20configured');}try{var _0x187fbc=eval(_0x25406f[_0xd68c('0x13d')])?_0xd68c('0x13e'):_0xd68c('0x13f');this[_0xd68c('0xd')]['noop'](util[_0xd68c('0x26')](_0xd68c('0x140'),_0x25406f[_0xd68c('0x13d')],_0x187fbc));return{'code':0xc8,'result':_0x187fbc};}catch(_0xa8c34d){return{'code':0xc8,'result':_0xd68c('0x13f')};}};AGIVertices[_0xd68c('0xf')]['gotoiftime']=function(_0x3a27c7){logger[_0xd68c('0x2c')](util[_0xd68c('0x26')](_0xd68c('0x141'),_0x3a27c7[_0xd68c('0x36')]));if(!this[_0xd68c('0xa3')](_0x3a27c7['interval_id'])){return this[_0xd68c('0xd')][_0xd68c('0x2a')](_0x3a27c7,'no\x20interval\x20configured');}var _0x2f5b75=this[_0xd68c('0x22')]['sync'](this,_0x3a27c7['interval_id']);if(!_0x2f5b75){return this['channel']['error'](_0x3a27c7,_0xd68c('0x142'));}for(var _0x5ee57f=0x0;_0x5ee57f<_0x2f5b75['length'];_0x5ee57f+=0x1){var _0x1f536f=this[_0xd68c('0xd')]['getVariable'](util[_0xd68c('0x26')](_0xd68c('0x143'),_0x2f5b75[_0x5ee57f]));if(_0x1f536f[_0xd68c('0xab')]===-0x1){return _0x1f536f;}logger[_0xd68c('0x2c')](util[_0xd68c('0x26')](_0xd68c('0x144'),_0x2f5b75[_0x5ee57f],_0x1f536f['extra']));if(_0x1f536f[_0xd68c('0xa0')]===_0xd68c('0x13e')){logger[_0xd68c('0x2c')](util['format'](_0xd68c('0x144'),_0x2f5b75[_0x5ee57f],_0xd68c('0x13e')));this[_0xd68c('0xd')][_0xd68c('0xa8')](util[_0xd68c('0x26')]('IFTIME\x20%s\x20%s',_0x2f5b75[_0x5ee57f],_0xd68c('0x13e')));return{'code':0xc8,'result':_0xd68c('0x13e')};}else{logger[_0xd68c('0x2c')](util['format']('IFTIME\x20%s\x20%s',_0x2f5b75[_0x5ee57f],_0xd68c('0x13f')));this['channel'][_0xd68c('0xa8')](util['format'](_0xd68c('0x144'),_0x2f5b75[_0x5ee57f],'false'));}}return{'code':0xc8,'result':_0xd68c('0x13f')};};AGIVertices[_0xd68c('0xf')]['hangup']=function(_0x2b8605){logger[_0xd68c('0x2c')](util[_0xd68c('0x26')](_0xd68c('0x145'),_0x2b8605['label']));return this[_0xd68c('0xd')]['hangup']();};AGIVertices[_0xd68c('0xf')]['ispeechasr']=function(_0x414634){logger['info'](util[_0xd68c('0x26')](_0xd68c('0x146'),_0x414634[_0xd68c('0x36')]));if(!this[_0xd68c('0xa3')](_0x414634['key'])){return this[_0xd68c('0xd')][_0xd68c('0xa8')]('no\x20key\x20configured');}var _0x9d9fb0=_0xd68c('0x129');var _0x55a88f=util[_0xd68c('0x26')](_0xd68c('0x12a'),FILES_PATH,rs[_0xd68c('0x115')](0x4));var _0x5343d0=util['format'](_0xd68c('0x9b'),_0x55a88f,_0x9d9fb0);var _0x4fd7b9=!![];if(_0x414634[_0xd68c('0x12b')]===_0xd68c('0x135')){_0x4fd7b9=![];}var _0x278d10=this[_0xd68c('0xd')]['recordFile'](_0x55a88f,_0x9d9fb0,_0x414634[_0xd68c('0x12d')],_0x414634[_0xd68c('0x67')],undefined,_0x4fd7b9);if(_0x278d10[_0xd68c('0xab')]!==-0x1){this[_0xd68c('0xd')]['noop'](util['format'](_0xd68c('0x147'),_0x5343d0));var _0x5f44a4=this[_0xd68c('0x81')][_0xd68c('0xa5')](this,_0x414634,_0x5343d0);if(_0x5f44a4){for(var _0x4ba2a6 in _0x5f44a4){if(_0x5f44a4[_0xd68c('0x92')](_0x4ba2a6)){this[_0xd68c('0xd')][_0xd68c('0x9c')](util['format'](_0xd68c('0x148'),_0x4ba2a6[_0xd68c('0x6c')]()),_0x5f44a4[_0x4ba2a6]);}}return this['channel'][_0xd68c('0xa8')](util[_0xd68c('0x26')](_0xd68c('0x149'),JSON['stringify'](_0x5f44a4)));}}return _0x278d10;};AGIVertices['prototype'][_0xd68c('0x14a')]=function(_0x503140){logger['info'](util['format'](_0xd68c('0x14b'),_0x503140[_0xd68c('0x36')]));if(!this[_0xd68c('0xa3')](_0x503140[_0xd68c('0x7f')])){return this[_0xd68c('0xd')][_0xd68c('0xa8')](_0xd68c('0xe5'));}if(!this[_0xd68c('0xa3')](_0x503140[_0xd68c('0x5c')])){return this['channel'][_0xd68c('0xa8')](_0xd68c('0xa9'));}this['channel']['noop'](util[_0xd68c('0x26')](_0xd68c('0x14c'),_0x503140[_0xd68c('0x5c')]));var _0x504007=this[_0xd68c('0x7e')]['sync'](this,_0x503140);if(_0x504007){this[_0xd68c('0xd')][_0xd68c('0xa8')](util['format']('ispeech\x20%s\x20file\x20created',_0x504007));var _0x23a3c8=this[_0xd68c('0xd')][_0xd68c('0xf6')](_0x504007,_0x503140[_0xd68c('0x12d')]);try{fs[_0xd68c('0xf7')](_0x504007+_0xd68c('0xf8'));}catch(_0x5d6986){logger[_0xd68c('0x2a')](_0x5d6986);}return _0x23a3c8;}return this[_0xd68c('0xd')][_0xd68c('0x2a')](_0x503140,'ispeech\x20TTS\x20is\x20unreachable');};AGIVertices[_0xd68c('0xf')][_0xd68c('0x14d')]=function(_0x349ba1){logger[_0xd68c('0x2c')](util[_0xd68c('0x26')](_0xd68c('0x14e'),_0x349ba1['label']));if(!this[_0xd68c('0xa3')](_0x349ba1['findBy'])){return this[_0xd68c('0xd')][_0xd68c('0x2a')](_0x349ba1,_0xd68c('0x14f'));}logger['info'](util['format'](_0xd68c('0x150'),this[_0xd68c('0xd')]['callerid'],_0x349ba1[_0xd68c('0x151')]));var _0x3596ee=this['agentLogin']['sync'](this,_0x349ba1[_0xd68c('0x151')]);if(_0x3596ee){logger['info'](util[_0xd68c('0x26')](_0xd68c('0x152'),this['channel'][_0xd68c('0x38')],_0x349ba1['findBy']));this['channel'][_0xd68c('0xa8')](util[_0xd68c('0x26')]('AGENT\x20%s\x20FOUND\x20BY',this[_0xd68c('0xd')][_0xd68c('0x38')],_0x349ba1[_0xd68c('0x151')]));return{'code':0xc8,'result':_0xd68c('0x153')};}else{logger[_0xd68c('0x2c')](util[_0xd68c('0x26')](_0xd68c('0x154'),this[_0xd68c('0xd')][_0xd68c('0x38')],_0x349ba1[_0xd68c('0x151')]));this[_0xd68c('0xd')]['noop'](util['format'](_0xd68c('0x154'),this[_0xd68c('0xd')][_0xd68c('0x38')],_0x349ba1[_0xd68c('0x151')]));return{'code':0xc8,'result':'failure'};}};AGIVertices[_0xd68c('0xf')]['logout']=function(_0x3156d7){logger[_0xd68c('0x2c')](util[_0xd68c('0x26')](_0xd68c('0x155'),_0x3156d7[_0xd68c('0x36')]));if(!this[_0xd68c('0xa3')](_0x3156d7[_0xd68c('0x151')])){return this[_0xd68c('0xd')][_0xd68c('0x2a')](_0x3156d7,'no\x20find\x20by\x20configured');}logger[_0xd68c('0x2c')](util[_0xd68c('0x26')]('FIND\x20AGENT\x20%s\x20BY\x20%s',this['channel']['callerid'],_0x3156d7['findBy']));var _0x2b1576=this[_0xd68c('0x53')][_0xd68c('0xa5')](this,_0x3156d7['findBy']);if(_0x2b1576){logger['info'](util['format'](_0xd68c('0x152'),this[_0xd68c('0xd')][_0xd68c('0x38')],_0x3156d7[_0xd68c('0x151')]));this[_0xd68c('0xd')][_0xd68c('0xa8')](util[_0xd68c('0x26')](_0xd68c('0x152'),this[_0xd68c('0xd')][_0xd68c('0x38')],_0x3156d7[_0xd68c('0x151')]));return{'code':0xc8,'result':_0xd68c('0x153')};}else{logger[_0xd68c('0x2c')](util[_0xd68c('0x26')](_0xd68c('0x154'),this['channel'][_0xd68c('0x38')],_0x3156d7['findBy']));this[_0xd68c('0xd')][_0xd68c('0xa8')](util[_0xd68c('0x26')](_0xd68c('0x154'),this[_0xd68c('0xd')]['callerid'],_0x3156d7[_0xd68c('0x151')]));return{'code':0xc8,'result':_0xd68c('0x156')};}};AGIVertices[_0xd68c('0xf')]['math']=function(_0x192139){logger['info'](util[_0xd68c('0x26')](_0xd68c('0x157'),_0x192139[_0xd68c('0x36')]));if(!this[_0xd68c('0xa3')](_0x192139[_0xd68c('0x158')])){return this[_0xd68c('0xd')]['error'](_0x192139,_0xd68c('0x159'));}this[_0xd68c('0xd')][_0xd68c('0xa8')](util[_0xd68c('0x26')](_0xd68c('0x15a'),_0x192139[_0xd68c('0x158')]));var _0x27755c=eval(_0x192139['operation']);if(!this['isConfigured'](_0x192139[_0xd68c('0xd8')])){return this[_0xd68c('0xd')]['noop']('no\x20variable\x20selected\x20for\x20the\x20result');}var _0x19d7b6=this['getVariable'][_0xd68c('0xa5')](this,_0x192139[_0xd68c('0xd8')]);if(!_0x19d7b6){return this['channel'][_0xd68c('0x2a')](_0x192139,_0xd68c('0x15b'));}if(_[_0xd68c('0x9a')](_0x27755c)){var _0x5514a3=this;_0x27755c[_0xd68c('0xd9')](function(_0x2a3527,_0x50dedf){_0x5514a3[_0xd68c('0xd')][_0xd68c('0x9c')](util[_0xd68c('0x26')]('%s[%s]',_0x19d7b6,_0x50dedf),_0x2a3527);});return this[_0xd68c('0xd')][_0xd68c('0xa8')](util[_0xd68c('0x26')](_0xd68c('0x15c'),_0x19d7b6));}else{return this[_0xd68c('0xd')][_0xd68c('0x9c')](_0x19d7b6,_0x27755c);}};AGIVertices[_0xd68c('0xf')][_0xd68c('0xa')]=function(_0x2f9c30){logger[_0xd68c('0x2c')](util['format'](_0xd68c('0x15d'),_0x2f9c30['label']));if(_0x2f9c30[_0xd68c('0x108')]===0x0){return this[_0xd68c('0xa4')](_0x2f9c30);}_0x2f9c30['retry']-=0x1;if(!this[_0xd68c('0xa3')](_0x2f9c30[_0xd68c('0x109')])){return this[_0xd68c('0xd')][_0xd68c('0x2a')](_0x2f9c30,_0xd68c('0x10a'));}var _0x4daee6=this['getSound'][_0xd68c('0xa5')](this,_0x2f9c30[_0xd68c('0x109')]);if(!_0x4daee6){return this[_0xd68c('0xd')]['error'](_0x2f9c30,_0xd68c('0x15e'));}var _0x27eab1=this[_0xd68c('0xd')][_0xd68c('0x10c')](_0x4daee6,_0x2f9c30[_0xd68c('0x10d')],_0x2f9c30['digit']);var _0x593078=_0x27eab1[_0xd68c('0xab')];if(_0x27eab1[_0xd68c('0xab')]===-0x1){this[_0xd68c('0x34')]['sync'](this,_0x2f9c30,'-1');return _0x27eab1;}else if(_0x27eab1[_0xd68c('0xa0')]===_0xd68c('0x67')){_0x27eab1['result']=_0x27eab1['result'][_0xd68c('0x97')]>0x0?_0x27eab1[_0xd68c('0xab')]:'t';}else if(_[_0xd68c('0x45')](_0x27eab1[_0xd68c('0xab')])){_0x27eab1[_0xd68c('0xab')]='#';_0x593078='#';}if(!this[_0xd68c('0xa3')](_0x2f9c30[_0xd68c('0xd8')])){this[_0xd68c('0xd')][_0xd68c('0xa8')]('no\x20variable\x20selected\x20for\x20the\x20result');}else{var _0x5ed581=this[_0xd68c('0x9f')][_0xd68c('0xa5')](this,_0x2f9c30[_0xd68c('0xd8')]);if(!_0x5ed581){return this[_0xd68c('0xd')]['error'](_0x2f9c30,_0xd68c('0x15b'));}this[_0xd68c('0xd')][_0xd68c('0x9c')](_0x5ed581,_0x593078);}this['createSquareDetailsReport']['sync'](this,_0x2f9c30,_0x593078);return _0x27eab1;};AGIVertices[_0xd68c('0xf')]['noop']=function(_0x2a31e1){logger[_0xd68c('0x2c')](util[_0xd68c('0x26')](_0xd68c('0x15f'),_0x2a31e1[_0xd68c('0x36')]));return this[_0xd68c('0xd')]['noop'](_0x2a31e1[_0xd68c('0x160')]||_0x2a31e1[_0xd68c('0x36')]);};AGIVertices['prototype']['pause']=function(_0xa92f60){logger[_0xd68c('0x2c')](util['format'](_0xd68c('0x161'),_0xa92f60[_0xd68c('0x36')]));if(!this['isConfigured'](_0xa92f60[_0xd68c('0x151')])){return this[_0xd68c('0xd')][_0xd68c('0x2a')](_0xa92f60,_0xd68c('0x14f'));}logger['info'](util[_0xd68c('0x26')](_0xd68c('0x150'),this[_0xd68c('0xd')][_0xd68c('0x38')],_0xa92f60[_0xd68c('0x151')]));var _0x188647=this[_0xd68c('0x4e')][_0xd68c('0xa5')](this,_0xa92f60[_0xd68c('0x162')]);var _0xdd2441=this[_0xd68c('0x51')][_0xd68c('0xa5')](this,_0xa92f60[_0xd68c('0x151')],_0x188647);if(_0xdd2441){logger[_0xd68c('0x2c')](util[_0xd68c('0x26')](_0xd68c('0x152'),this['channel'][_0xd68c('0x38')],_0xa92f60[_0xd68c('0x151')]));this[_0xd68c('0xd')]['noop'](util[_0xd68c('0x26')](_0xd68c('0x152'),this[_0xd68c('0xd')]['callerid'],_0xa92f60['findBy']));return{'code':0xc8,'result':_0xd68c('0x153')};}else{logger[_0xd68c('0x2c')](util[_0xd68c('0x26')](_0xd68c('0x154'),this[_0xd68c('0xd')][_0xd68c('0x38')],_0xa92f60[_0xd68c('0x151')]));this[_0xd68c('0xd')][_0xd68c('0xa8')](util[_0xd68c('0x26')](_0xd68c('0x152'),this[_0xd68c('0xd')][_0xd68c('0x38')],_0xa92f60[_0xd68c('0x151')]));return{'code':0xc8,'result':_0xd68c('0x156')};}};AGIVertices['prototype'][_0xd68c('0x163')]=function(_0x45229b){logger[_0xd68c('0x2c')](util[_0xd68c('0x26')](_0xd68c('0x164'),_0x45229b['label']));if(!this[_0xd68c('0xa3')](_0x45229b[_0xd68c('0x109')])){return this['channel'][_0xd68c('0x2a')](_0x45229b,_0xd68c('0x10a'));}var _0x3cd186=this[_0xd68c('0x165')][_0xd68c('0xa5')](this,_0x45229b[_0xd68c('0x109')]);if(!_0x3cd186){return this['channel'][_0xd68c('0x2a')](_0x45229b,_0xd68c('0x15e'));}var _0x2d7e03=this['channel']['exec'](_0xd68c('0x166'),[_0x3cd186,_0x45229b['opts']]);if(_0x2d7e03[_0xd68c('0xab')]===-0x1){return _0x2d7e03;}return this['channel'][_0xd68c('0xa8')](util[_0xd68c('0x26')]('Executed\x20command\x20%s\x20%s',_0xd68c('0x166'),_0x3cd186));};AGIVertices[_0xd68c('0xf')][_0xd68c('0x167')]=function(_0xa8a77f){logger[_0xd68c('0x2c')](util['format']('Enter\x20in\x20QUEUE\x20(%s)\x20block',_0xa8a77f[_0xd68c('0x36')]));if(!this[_0xd68c('0xa3')](_0xa8a77f[_0xd68c('0x168')])){return this['channel'][_0xd68c('0x2a')](_0xa8a77f,_0xd68c('0x169'));}var _0x3b9a0f='';var _0x2cba3b=parseInt(_0xa8a77f[_0xd68c('0x168')],0xa);if(isNaN(_0x2cba3b)){_0x3b9a0f=_0xa8a77f['queue_id'];}else{_0x3b9a0f=this['getVoiceQueue']['sync'](this,_0xa8a77f[_0xd68c('0x168')]);if(!_0x3b9a0f){return this['channel'][_0xd68c('0x2a')](_0xa8a77f,_0xd68c('0x16a'));}}var _0xaf2931='';if(this['isConfigured'](_0xa8a77f[_0xd68c('0x109')])){var _0x20a844=this[_0xd68c('0x165')][_0xd68c('0xa5')](this,_0xa8a77f[_0xd68c('0x109')]);if(_0x20a844){_0xaf2931=_0x20a844;}}this[_0xd68c('0x34')][_0xd68c('0xa5')](this,_0xa8a77f,_0x3b9a0f);if(_0xa8a77f['opts']['indexOf']('x')<0x0){_0xa8a77f[_0xd68c('0x104')]+='x';}if(_0xa8a77f[_0xd68c('0x104')][_0xd68c('0x16b')]('X')<0x0){_0xa8a77f[_0xd68c('0x104')]+='X';}this[_0xd68c('0xd')]['setVariable'](_0xd68c('0x16c'),_0x3b9a0f?_0x3b9a0f[_0xd68c('0x16d')]():'');var _0x11e134=this[_0xd68c('0xd')][_0xd68c('0x58')](_0xd68c('0x16e'),[_0x3b9a0f,_0xa8a77f[_0xd68c('0x104')],_0xa8a77f[_0xd68c('0x65')],_0xaf2931,_0xa8a77f[_0xd68c('0x67')],_0xa8a77f['agi'],_0xa8a77f[_0xd68c('0x16f')],_0xa8a77f[_0xd68c('0x170')],'',_0xa8a77f[_0xd68c('0x171')]]);if(_0x11e134['result']===-0x1){return _0x11e134;}return this[_0xd68c('0xd')]['noop'](util['format'](_0xd68c('0xc7'),'QUEUE',_0x3b9a0f));};AGIVertices[_0xd68c('0xf')][_0xd68c('0x172')]=function(_0x32b37a){logger['info'](util[_0xd68c('0x26')](_0xd68c('0x173'),_0x32b37a[_0xd68c('0x36')]));var _0x44c380=_0x32b37a[_0xd68c('0x174')]||'wav';var _0x4260c2=util[_0xd68c('0x26')](_0xd68c('0x175'),this[_0xd68c('0xd')][_0xd68c('0x35')],rs['generate'](0x5));var _0x185cea=util[_0xd68c('0x26')](_0xd68c('0x176'),FILES_PATH,_0x4260c2,_0x44c380);var _0x1487ab=util['format'](_0xd68c('0x12a'),FILES_PATH,_0x4260c2);this[_0xd68c('0x177')][_0xd68c('0xa5')](this,_0x32b37a,_0x4260c2,_0x185cea);this[_0xd68c('0xd')][_0xd68c('0x9c')](_0xd68c('0x178'),_0x4260c2);logger[_0xd68c('0x2c')](_0xd68c('0x179'),_0x1487ab,_0x44c380,_0x32b37a[_0xd68c('0x17a')],_0x32b37a[_0xd68c('0x67')]);return this[_0xd68c('0xd')][_0xd68c('0x12c')](_0x1487ab,_0x44c380,_0x32b37a[_0xd68c('0x17a')],_0x32b37a[_0xd68c('0x67')],undefined,!![]);};AGIVertices[_0xd68c('0xf')][_0xd68c('0x17b')]=function(_0x51d876){logger[_0xd68c('0x2c')](util[_0xd68c('0x26')](_0xd68c('0x17c'),_0x51d876[_0xd68c('0x36')]));if(!this['isConfigured'](_0x51d876[_0xd68c('0x65')])){return this[_0xd68c('0xd')][_0xd68c('0xa8')](_0xd68c('0x17d'));}var _0x3b9b5f=this[_0xd68c('0x17e')][_0xd68c('0xa5')](this,_0x51d876);logger[_0xd68c('0x2c')](util[_0xd68c('0x26')]('Response:',util[_0xd68c('0x17f')](_0x3b9b5f,{'showHidden':![],'depth':null})));if(!this[_0xd68c('0xa3')](_0x51d876[_0xd68c('0xd8')])){return this[_0xd68c('0xd')][_0xd68c('0xa8')]('no\x20variable\x20selected\x20for\x20the\x20response');}var _0x10d907=this[_0xd68c('0x9f')][_0xd68c('0xa5')](this,_0x51d876[_0xd68c('0xd8')]);if(!_0x10d907){return this[_0xd68c('0xd')][_0xd68c('0x2a')](_0x51d876,_0xd68c('0x15b'));}this[_0xd68c('0xd')][_0xd68c('0x9c')](util[_0xd68c('0x26')](_0xd68c('0x180'),_0x10d907),_0x3b9b5f['statusCode']?_0x3b9b5f[_0xd68c('0x78')]:_0xd68c('0x181'));this[_0xd68c('0xd')][_0xd68c('0x9c')](util[_0xd68c('0x26')](_0xd68c('0x182'),_0x10d907),_0x3b9b5f['statusMessage']?_0x3b9b5f[_0xd68c('0x77')]:'OK');if(_0x3b9b5f[_0xd68c('0x75')]){try{this['saveRestApiResult'](_0x3b9b5f[_0xd68c('0x75')],_0x10d907);}catch(_0x5dae08){logger[_0xd68c('0x2a')](util[_0xd68c('0x26')](_0xd68c('0x183'),_0x10d907));}}return this[_0xd68c('0xd')]['noop'](util['format'](_0xd68c('0x184'),_0x10d907));};AGIVertices[_0xd68c('0xf')][_0xd68c('0x185')]=function(_0x3cb144){logger[_0xd68c('0x2c')](util[_0xd68c('0x26')](_0xd68c('0x186'),_0x3cb144['label']));return this[_0xd68c('0xd')][_0xd68c('0x187')](_0x3cb144[_0xd68c('0x188')][_0xd68c('0x59')](/\s+/g,''),_0x3cb144['escape_digits']);};AGIVertices['prototype'][_0xd68c('0x189')]=function(_0x322e6a){logger[_0xd68c('0x2c')](util[_0xd68c('0x26')](_0xd68c('0x18a'),_0x322e6a['label']));return this['channel'][_0xd68c('0x18b')](_0x322e6a['number'][_0xd68c('0x59')](/\s+/g,''),_0x322e6a[_0xd68c('0x17a')]);};AGIVertices[_0xd68c('0xf')][_0xd68c('0x18c')]=function(_0x45a7a8){logger[_0xd68c('0x2c')](util[_0xd68c('0x26')](_0xd68c('0x18d'),_0x45a7a8[_0xd68c('0x36')]));return this[_0xd68c('0xd')][_0xd68c('0x18e')](_0x45a7a8[_0xd68c('0x5c')],_0x45a7a8['escape_digits']);};AGIVertices[_0xd68c('0xf')]['sendMail']=function(_0x124754){logger[_0xd68c('0x2c')](util[_0xd68c('0x26')]('Enter\x20in\x20SENDMAIL\x20(%s)\x20block',_0x124754[_0xd68c('0x36')]));if(!this[_0xd68c('0xa3')](_0x124754[_0xd68c('0x18f')])){return this[_0xd68c('0xd')]['noop'](_0xd68c('0x190'));}var _0x11dd1e=this['getMailAccount'][_0xd68c('0xa5')](this,_0x124754[_0xd68c('0x18f')]);if(!_0x11dd1e||!_0x11dd1e[_0xd68c('0x191')]){return this[_0xd68c('0xd')]['error'](_0x124754,_0xd68c('0x192'));}var _0x2c5c20={'from':util[_0xd68c('0x26')](_0xd68c('0x193'),_0x11dd1e['name'],_0x11dd1e[_0xd68c('0x194')]||_0x11dd1e[_0xd68c('0x191')][_0xd68c('0x195')]),'to':_0x124754['to']||'','cc':_0x124754['cc']||'','bcc':_0x124754[_0xd68c('0x196')]||'','subject':_0x124754[_0xd68c('0x197')],'html':_0x124754[_0xd68c('0x5c')],'text':_0x124754['text']};var _0xccf9c={'tls':{'rejectUnauthorized':![]}};if(_0x11dd1e['Smtp'][_0xd68c('0x198')]){_0xccf9c[_0xd68c('0x198')]=_0x11dd1e[_0xd68c('0x191')][_0xd68c('0x198')];}else{_0xccf9c[_0xd68c('0x199')]=_0x11dd1e[_0xd68c('0x191')][_0xd68c('0x199')];_0xccf9c[_0xd68c('0x19a')]=_0x11dd1e[_0xd68c('0x191')][_0xd68c('0x19a')];_0xccf9c['secure']=_0x11dd1e[_0xd68c('0x191')]['secure'];}if(_0x11dd1e[_0xd68c('0x191')][_0xd68c('0x19b')]){_0xccf9c['auth']={'user':_0x11dd1e[_0xd68c('0x191')][_0xd68c('0x195')],'pass':_0x11dd1e[_0xd68c('0x191')][_0xd68c('0x19c')]};}if(this[_0xd68c('0xa3')](_0x124754[_0xd68c('0x19d')])){}logger[_0xd68c('0xdd')]('sendMail\x20message',JSON[_0xd68c('0x74')](_0x2c5c20));this[_0xd68c('0x34')][_0xd68c('0xa5')](this,_0x124754,_0x124754['account_id']);this[_0xd68c('0xd')][_0xd68c('0xa8')](util[_0xd68c('0x26')](_0xd68c('0x19e'),_0x11dd1e[_0xd68c('0x14')]));this[_0xd68c('0x20')][_0xd68c('0xa5')](this,_0xccf9c,_0x2c5c20);return this[_0xd68c('0xd')][_0xd68c('0xa8')](_0xd68c('0x19f'));};AGIVertices[_0xd68c('0xf')][_0xd68c('0x1a0')]=function(_0x572559){logger[_0xd68c('0x2c')](util[_0xd68c('0x26')](_0xd68c('0x1a1'),_0x572559[_0xd68c('0x36')]));return this['channel'][_0xd68c('0xa8')](_0xd68c('0x1a2'));};AGIVertices[_0xd68c('0xf')][_0xd68c('0x1a3')]=function(_0x3af1ce){logger[_0xd68c('0x2c')](util[_0xd68c('0x26')]('Enter\x20in\x20SENDSMS\x20(%s)\x20block',_0x3af1ce[_0xd68c('0x36')]));if(!this[_0xd68c('0xa3')](_0x3af1ce[_0xd68c('0x1a4')])){return this[_0xd68c('0xd')][_0xd68c('0xa8')](_0xd68c('0x1a5'));}var _0x27b019=this[_0xd68c('0x31')][_0xd68c('0xa5')](this,_0x3af1ce[_0xd68c('0x1a4')]);if(!_0x27b019){return this['channel'][_0xd68c('0x2a')](_0x3af1ce,_0xd68c('0x1a6'));}var _0x2ff669={'body':_0x3af1ce[_0xd68c('0x1a7')],'phone':_0x3af1ce['to']||'','SmsAccountId':_0x27b019['id']};logger[_0xd68c('0xdd')]('sendSMS\x20message',JSON[_0xd68c('0x74')](_0x2ff669));this[_0xd68c('0x34')][_0xd68c('0xa5')](this,_0x3af1ce,_0x3af1ce['sms_account_id']);this['channel'][_0xd68c('0xa8')](util[_0xd68c('0x26')](_0xd68c('0x1a8'),_0x27b019['name']));this[_0xd68c('0x33')]['sync'](this,_0x2ff669);return this[_0xd68c('0xd')]['noop'](_0xd68c('0x1a9'));};AGIVertices['prototype'][_0xd68c('0x1aa')]=function(_0x11d609){logger[_0xd68c('0x2c')](util[_0xd68c('0x26')](_0xd68c('0x1ab'),_0x11d609[_0xd68c('0x36')]));if(!this['isConfigured'](_0x11d609[_0xd68c('0xd8')])){return this[_0xd68c('0xd')][_0xd68c('0x2a')](_0x11d609,'no\x20variable\x20selected');}var _0x14c4f2=this[_0xd68c('0x9f')][_0xd68c('0xa5')](this,_0x11d609['variable_id']);if(!_0x14c4f2){return this['channel'][_0xd68c('0x2a')](_0x11d609,_0xd68c('0x15b'));}return this['channel'][_0xd68c('0x9c')](_0x14c4f2,_0x11d609[_0xd68c('0x1ac')]);};AGIVertices['prototype'][_0xd68c('0x1ad')]=function(_0x43fce8){logger[_0xd68c('0x2c')](util[_0xd68c('0x26')](_0xd68c('0x1ae'),_0x43fce8[_0xd68c('0x36')]));this[_0xd68c('0xd')][_0xd68c('0xa8')](_0xd68c('0x1af'));if(_0x43fce8[_0xd68c('0xb9')]===_0xd68c('0x1b0')){this[_0xd68c('0xd')][_0xd68c('0xa8')](_0xd68c('0x1b1'));return this[_0xd68c('0xd')]['answer']();}return this[_0xd68c('0xd')][_0xd68c('0xa8')](_0xd68c('0x1b2'));};AGIVertices['prototype'][_0xd68c('0x1b3')]=function(_0x3a3c82){logger[_0xd68c('0x2c')](util[_0xd68c('0x26')](_0xd68c('0x1b4'),_0x3a3c82['label']));if(!this[_0xd68c('0xa3')](_0x3a3c82[_0xd68c('0x1b5')])){return this['channel'][_0xd68c('0x2a')](_0x3a3c82,_0xd68c('0x1b6'));}var _0x3dc56c=this['getSquareProject']['sync'](this,_0x3a3c82[_0xd68c('0x1b5')]);if(!this[_0xd68c('0xa3')](_0x3dc56c)){return this[_0xd68c('0xd')][_0xd68c('0x2a')](_0x3a3c82,util[_0xd68c('0x26')](_0xd68c('0x1b7'),_0x3a3c82[_0xd68c('0x1b5')]));}if(_0x3dc56c===this['channel'][_0xd68c('0x3f')]){return this[_0xd68c('0xd')]['error'](_0x3a3c82,_0xd68c('0x1b8'));}this[_0xd68c('0x34')][_0xd68c('0xa5')](this,_0x3a3c82,_0x3dc56c);var _0x1f0714=this[_0xd68c('0xd')][_0xd68c('0x58')](_0xd68c('0x1b9'),util[_0xd68c('0x26')](_0xd68c('0x1ba'),config[_0xd68c('0x7')][_0xd68c('0x199')]||_0xd68c('0x1bb'),_0x3dc56c,this['channel'][_0xd68c('0x3f')]));if(_0x1f0714['result']===-0x1){return _0x1f0714;}return this[_0xd68c('0xd')][_0xd68c('0xa8')](util['format'](_0xd68c('0xc7'),_0xd68c('0x1b9'),_0x3dc56c));};AGIVertices[_0xd68c('0xf')][_0xd68c('0x1bc')]=function(_0x34066b){logger[_0xd68c('0x2c')](util[_0xd68c('0x26')](_0xd68c('0x1bd'),_0x34066b[_0xd68c('0x36')]));var _0x321a6d=this[_0xd68c('0x57')][_0xd68c('0xa5')](this,_0x34066b[_0xd68c('0x1be')]);this[_0xd68c('0x34')][_0xd68c('0xa5')](this,_0x34066b,_0x34066b['command']);if(this[_0xd68c('0xa3')](_0x34066b[_0xd68c('0xd8')])){var _0x1cec65=this[_0xd68c('0x9f')][_0xd68c('0xa5')](this,_0x34066b[_0xd68c('0xd8')]);if(_0x1cec65){this['channel']['setVariable'](_0x1cec65,_0x321a6d);return this['channel'][_0xd68c('0xa8')](util['format'](_0xd68c('0x1bf'),_0x34066b[_0xd68c('0x1be')],_0x1cec65));}}return this[_0xd68c('0xd')]['noop'](util['format'](_0xd68c('0x1c0'),_0x34066b[_0xd68c('0x1be')]));};AGIVertices['prototype'][_0xd68c('0x1c1')]=function(_0x3e345d){logger[_0xd68c('0x2c')](util[_0xd68c('0x26')](_0xd68c('0x1c2'),_0x3e345d[_0xd68c('0x36')]));_0x3e345d[_0xd68c('0x5c')]=_0x3e345d[_0xd68c('0x5c')][_0xd68c('0x59')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0xd68c('0xa3')](_0x3e345d[_0xd68c('0x1c3')])){return this[_0xd68c('0xd')][_0xd68c('0xa8')]('no\x20apiKey\x20configured');}if(!this[_0xd68c('0xa3')](_0x3e345d[_0xd68c('0x5c')])){return this['channel'][_0xd68c('0xa8')]('no\x20text\x20configured');}this[_0xd68c('0xd')]['noop'](util[_0xd68c('0x26')](_0xd68c('0x1c4'),_0x3e345d['text']));var _0x33e902=this[_0xd68c('0x5a')]['sync'](this,_0x3e345d);if(_0x33e902){this[_0xd68c('0xd')][_0xd68c('0xa8')](util['format']('Google\x20Cloud\x20TTS\x20%s\x20file\x20created',_0x33e902));var _0x554f30=this['channel'][_0xd68c('0xf6')](_0x33e902);try{fs[_0xd68c('0xf7')](_0x33e902+_0xd68c('0xf8'));}catch(_0x23a88f){logger['error'](_0x23a88f);}return _0x554f30;}return this[_0xd68c('0xd')][_0xd68c('0x2a')](_0x3e345d,_0xd68c('0x1c5'));};AGIVertices['prototype'][_0xd68c('0x1c6')]=function(_0x493b14){logger['info'](util[_0xd68c('0x26')](_0xd68c('0x1c7'),_0x493b14[_0xd68c('0x36')]));_0x493b14['text']=_0x493b14[_0xd68c('0x5c')]['replace'](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0xd68c('0xa3')](_0x493b14[_0xd68c('0x5c')])){return this[_0xd68c('0xd')][_0xd68c('0xa8')](_0xd68c('0xa9'));}this[_0xd68c('0xd')][_0xd68c('0xa8')](util[_0xd68c('0x26')]('Trying\x20Google\x20TTS\x20%s',_0x493b14[_0xd68c('0x5c')]));var _0x96be97=this[_0xd68c('0x63')][_0xd68c('0xa5')](this,_0x493b14);if(_0x96be97){this[_0xd68c('0xd')]['noop'](util['format']('Google\x20TTS\x20%s\x20file\x20created',_0x96be97));var _0x46cf60=this[_0xd68c('0xd')][_0xd68c('0xf6')](_0x96be97);try{fs[_0xd68c('0xf7')](_0x96be97+_0xd68c('0xf8'));}catch(_0x570d5a){logger[_0xd68c('0x2a')](_0x570d5a);}return _0x46cf60;}return this[_0xd68c('0xd')][_0xd68c('0x2a')](_0x493b14,_0xd68c('0x1c8'));};AGIVertices[_0xd68c('0xf')][_0xd68c('0x1c9')]=function(_0x4da339){logger[_0xd68c('0x2c')](util[_0xd68c('0x26')](_0xd68c('0x1ca'),_0x4da339[_0xd68c('0x36')]));if(!this[_0xd68c('0xa3')](_0x4da339[_0xd68c('0x151')])){return this[_0xd68c('0xd')][_0xd68c('0x2a')](_0x4da339,_0xd68c('0x14f'));}logger[_0xd68c('0x2c')](util[_0xd68c('0x26')](_0xd68c('0x150'),this[_0xd68c('0xd')][_0xd68c('0x38')],_0x4da339[_0xd68c('0x151')]));var _0x329b74=this[_0xd68c('0x52')][_0xd68c('0xa5')](this,_0x4da339[_0xd68c('0x151')]);if(_0x329b74){logger['info'](util[_0xd68c('0x26')](_0xd68c('0x152'),this['channel'][_0xd68c('0x38')],_0x4da339[_0xd68c('0x151')]));this[_0xd68c('0xd')][_0xd68c('0xa8')](util[_0xd68c('0x26')](_0xd68c('0x152'),this[_0xd68c('0xd')][_0xd68c('0x38')],_0x4da339[_0xd68c('0x151')]));return{'code':0xc8,'result':_0xd68c('0x153')};}else{logger['info'](util[_0xd68c('0x26')](_0xd68c('0x154'),this[_0xd68c('0xd')][_0xd68c('0x38')],_0x4da339['findBy']));this[_0xd68c('0xd')]['noop'](util[_0xd68c('0x26')](_0xd68c('0x154'),this[_0xd68c('0xd')][_0xd68c('0x38')],_0x4da339[_0xd68c('0x151')]));return{'code':0xc8,'result':_0xd68c('0x156')};}};AGIVertices['prototype'][_0xd68c('0x1cb')]=function(_0x1c4613){logger[_0xd68c('0x2c')](util[_0xd68c('0x26')](_0xd68c('0x1cc'),_0x1c4613[_0xd68c('0x36')]));var _0x23e21f=this[_0xd68c('0xd')][_0xd68c('0x58')](_0xd68c('0x1cd'),[_0x1c4613[_0xd68c('0x1ce')],_0x1c4613[_0xd68c('0x7a')]]);if(_0x23e21f[_0xd68c('0xab')]===-0x1){return _0x23e21f;}return this[_0xd68c('0xd')][_0xd68c('0xa8')](util[_0xd68c('0x26')](_0xd68c('0xc7'),_0xd68c('0x1cd'),_0x1c4613['mailbox']));};AGIVertices['prototype'][_0xd68c('0x1cf')]=function(_0x4b44f5){logger[_0xd68c('0x2c')](util[_0xd68c('0x26')]('Enter\x20in\x20SWITCH\x20(%s)\x20block',_0x4b44f5[_0xd68c('0x36')]));if(!this[_0xd68c('0xa3')](_0x4b44f5[_0xd68c('0xd8')])){return this[_0xd68c('0xd')]['error'](_0x4b44f5,'no\x20variable\x20selected');}var _0xe83686=this[_0xd68c('0x9f')][_0xd68c('0xa5')](this,_0x4b44f5[_0xd68c('0xd8')]);if(!_0xe83686){return this[_0xd68c('0xd')][_0xd68c('0x2a')](_0x4b44f5,_0xd68c('0x15b'));}var _0x5cc7d0=this[_0xd68c('0xd')][_0xd68c('0x9f')](_0xe83686);return{'code':0xc8,'result':_0x5cc7d0[_0xd68c('0xa0')]?_0x5cc7d0[_0xd68c('0xa0')]:'-'};};String[_0xd68c('0xf')]['replaceAll']=function(_0x44be84,_0x17c4bd){return this['split'](_0x44be84)[_0xd68c('0x1d0')](_0x17c4bd);};module['exports']=AGIVertices;
\ No newline at end of file
+var _0xe1b3=['name','catch','getVoiceQueue','getSquareProjectById','getSquareOdbc','getSquareOdbcById','dsn','getUser','getUserById','getSound','getSoundById','save_name','getMailAccount','getMailAccountById','sendMailMessage','getIntervals','getIntervalById','IntervalId','interval','map','Intervals','getSoundPath','format','%s/sounds/converted/%s','getQueryOdbc','error','Error\x20getting\x20ODBC\x20connection\x20%s','query','info','Error\x20executing\x20query\x20%s','Query\x20executed\x20correctly\x20%s','close','Error\x20closing\x20connection\x20to\x20odbc\x20%s','getSmsAccount','createSmsMessage','createSquareDetailsReport','label','agicommand','callerid','createSquareRecording','uniqueid','calleridname','context','extension','priority','dnid','file','createSquareMessage','createCmContact','log','in\x20createcmcontact','in\x20createcmcontact\x20callback','isNil','random','lastName','phone','list_id','scheduledAt','toString','callback_priority','getPause','agentPause','agent','agentUnpause','agentLogout','internal','agentLogin','exec','trim','googleCloudTTS','text','languageCode','MALE','audioEncoding','MP3','googleTTS','google_tts_language','restAPI','url','method','timeout','POST','PUT','body','parse','rawBody','An\x20incorrect\x20formatted\x20json\x20body\x20has\x20been\x20passed\x20to\x20the\x20function','headers','An\x20incorrect\x20formatted\x20json\x20headers\x20has\x20been\x20passed\x20to\x20the\x20function','computedVariables','sync','render','stringify','An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function','statusMessage','message','500\x20-\x20Internal\x20Server\x20Error','options','googleDialogflow','key','sestekNDA','ispeechTTS','ispeech_tts_language','en-US','speed','ispeechASR','ispeech_asr_language','isConfigured','awsPolly','aws_access_key_id','aws_secret_access_key','aws_polly_region','aws_polly_voice','awsLex','aws_lex_region','aws_bot_name','googleASR','google_asr_language','tildeASR','appsecret','uri','clear','clone','hasOwnProperty','isString','includes','replaceObjectAllVariables','isPlainObject','recursiveNodeIndex','isArray','length','saveRestApiResult','isEmpty','%s.%s','setVariable','replaceAllVariables','split','nextbracket','replaceAll','extra','replaceall\x20end','getAndSetVariable','result','The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s','maxRetry','retry','mrcpsynth','Enter\x20in\x20MRCPSynth\x20(%s)\x20block','noop','no\x20text\x20configured','MRCPSynth','mrcprecog','Enter\x20in\x20MRCPRecog\x20(%s)\x20block','grammar','MRCPRecog','RECOG_CONFIDENCE()','RECOG_INPUT()','RECOG_INSTANCE()','Executed\x20command\x20MRCPRecog\x20%s','Enter\x20in\x20AGI\x20(%s)\x20block','command','args','answer','Enter\x20in\x20ANSWER\x20(%s)\x20block','Wait\x20%s\x20seconds\x20before\x20answer','wait','logh','Enter\x20in\x20CALLBACK\x20(%s)\x20block','no\x20list\x20selected','delay','add','minutes','Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block','application','Executed\x20command\x20%s\x20%s','lumenvoxtts','Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block','Executed\x20command\x20MRCPSynth\x20%s','Enter\x20in\x20SESTEKTTS\x20(%s)\x20block','lumenvoxasr','Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block','LUMENVOX_ASR_CONFIDENCE','LUMENVOX_ASR_TRANSCRIPT','LUMENVOX_ASR_INSTANCE','no\x20grammar\x20configured','SESTEK_ASR_CONFIDENCE','SESTEK_ASR_TRANSCRIPT','SESTEK_ASR_INSTANCE','database','Enter\x20in\x20DATABASE\x20(%s)\x20block','odbc_id','no\x20database\x20selected','no\x20query\x20configured','replace','query:\x20%s','variable_id','no\x20variable\x20found','forEach','keys','%s[%s][%s]','%s_ROWS_COUNT','variable\x20%s\x20set','debug','Enter\x20in\x20DIAL\x20(%s)\x20block','sip_id','no\x20user\x20selected','no\x20user\x20found','SIP/%s','Executed\x20command\x20%s','DIAL','dialogflow','Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block','no\x20key\x20configured','bot','Trying\x20Dialogflow:\x20%s','DIALOGFLOW_%s','Dialogflow\x20Result\x20%s','speech','Dialogflow\x20is\x20unreachable','sesteknda','Enter\x20in\x20SESTEKNDA\x20(%s)\x20block','ndauth_url','no\x20ndauth\x20url\x20configured','no\x20username\x20configured','password','ndassistant_url','SESTEK_NDA_%s','toUpperCase','out','Sestek\x20NDA\x20%s\x20file\x20created','streamFile','unlink','.wav','SestekNDA\x20Result\x20%s','SestekNDA\x20is\x20unreachable','end','Enter\x20in\x20END\x20(%s)\x20block','ext_dial','trunk_id','no\x20trunk\x20selected','getTrunk','no\x20trunk\x20found','trunk_name','SIP/%s/%s','finally','Enter\x20in\x20GETDIGITS\x20(%s)\x20block','file_id','no\x20file\x20audio\x20selected','no\x20file\x20audio\x20found','no\x20variable\x20selected\x20for\x20the\x20result','getData','maxdigit','test','mindigit','hiddendigitsnum','generate','hiddendigitspos','first','substr','Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block','goal','Enter\x20in\x20GOAL\x20(%s)\x20block','GOAL\x20%s','goalname','awspolly','Trying\x20aws\x20Polly\x20%s','aws\x20Polly\x20is\x20unreachable','Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block','no\x20valid\x20credentials\x20configured','no\x20bot\x20name\x20configured','Trying\x20Amazon\x20Lex:\x20%s','AWS_LEX_%s','Amazon\x20Lex\x20ready\x20for\x20fulfillment','Amazon\x20Lex\x20Result\x20%s','googleasr','Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s','wav','%s/recordings/%s','NOBEEP','recordFile','GOOGLE_ASR_%s','GoogleASR\x20Result\x20%s','Enter\x20in\x20TILDEASR\x20(%s)\x20block','no\x20appid\x20configured','intKey','tilde\x20%s\x20file\x20created','TILDE_ASR_%s','TildeASR\x20Result\x20%s','gotoc','Enter\x20in\x20GOTO\x20(%s)\x20block','continueAt','Enter\x20in\x20GOTOIF\x20(%s)\x20block','no\x20condition\x20configured','condition','false','EVAL\x20CONDITION\x20%s\x20%s','gotoiftime','Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block','interval_id','no\x20interval\x20configured','no\x20intervals\x20found','IFTIME\x20%s\x20%s','true','hangup','ispeechasr','beep','ISPEECH_ASR_%s','IspeechASR\x20Result\x20%s','ispeechtts','Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block','ispeech\x20%s\x20file\x20created','login','Enter\x20in\x20LOGIN\x20(%s)\x20block','findBy','no\x20find\x20by\x20configured','AGENT\x20%s\x20FOUND\x20BY','AGENT\x20%s\x20NOT\x20FOUND\x20BY','failure','logout','Enter\x20in\x20LOGOUT\x20(%s)\x20block','FIND\x20AGENT\x20%s\x20BY\x20%s','success','math','operation','math\x20%s','%s[%s]','Enter\x20in\x20MENU\x20(%s)\x20block','response','Enter\x20in\x20NOOP\x20(%s)\x20block','pause','Enter\x20in\x20PAUSE\x20(%s)\x20block','pause_id','playback','Enter\x20in\x20PLAYBACK\x20(%s)\x20block','opts','PLAYBACK','queue','Enter\x20in\x20QUEUE\x20(%s)\x20block','queue_id','no\x20queue\x20selected','no\x20queue\x20found','indexOf','XMCS-QUEUE','toLowerCase','macro','gosub','Enter\x20in\x20RECORD\x20(%s)\x20block','%s_%s','RECORDING_SAVENAME','escape_digits','restapi','Enter\x20in\x20RESTAPI\x20(%s)\x20block','no\x20url\x20configured','Response:','inspect','%s_STATUS_CODE','statusCode','%s_STATUS_MESSAGE','Unable\x20to\x20set\x20result\x20in\x20variable\x20%s','Enter\x20in\x20SAYDIGITS\x20(%s)\x20block','digits','saynumber','Enter\x20in\x20SAYNUMBER\x20(%s)\x20block','sayNumber','sayphonetic','Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block','sayPhonetic','account_id','no\x20mail\x20account\x20configured','email','Smtp','user','bcc','subject','service','host','port','secure','authentication','auth','pass','template_id','sendMail\x20message','Mail\x20message\x20added\x20to\x20outgoing\x20process','Enter\x20in\x20SENDFAX\x20(%s)\x20block','SENDFAX\x20block\x20not\x20implemented','Enter\x20in\x20SENDSMS\x20(%s)\x20block','sms_account_id','no\x20sms\x20account\x20configured','no\x20sms\x20account\x20found','sms_text','sendSMS\x20message','Trying\x20SendSMS\x20with\x20account\x20%s','Sms\x20message\x20added\x20to\x20outgoing\x20process','set','Enter\x20in\x20SET\x20(%s)\x20block','no\x20variable\x20selected','variable_value','start','Enter\x20in\x20START\x20(%s)\x20block','yes','Answer','Skipped\x20Answer','subproject','Enter\x20in\x20SUBPROJECT\x20(%s)\x20block','project_id','no\x20subproject\x20selected','no\x20subproject\x20found\x20with\x20id\x20%d','project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project','AGI','agi://%s/square,\x22%s\x22,\x22%s\x22','arg_1','system','Enter\x20in\x20SYSTEM\x20(%s)\x20block','shellCommand','sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s','sh\x20command:\x20%s\x20result\x20no\x20stored','google_cloud_tts','Enter\x20in\x20Google\x20Cloud\x20TTS\x20(%s)\x20block','apiKey','no\x20apiKey\x20configured','Trying\x20Google\x20Cloud\x20TTS\x20%s','Google\x20Cloud\x20TTS\x20%s\x20file\x20created','Google\x20Cloud\x20TTS\x20is\x20unreachable','Trying\x20Google\x20TTS\x20%s','Google\x20TTS\x20%s\x20file\x20created','Google\x20TTS\x20is\x20unreachable','Enter\x20in\x20UNPAUSE\x20(%s)\x20block','voicemail','Enter\x20in\x20VOICEMAIL\x20(%s)\x20block','VOICEMAIL','mailbox','vswitch','Enter\x20in\x20SWITCH\x20(%s)\x20block','join','exports','path','lodash','shelljs','odbc','moment','mustache','request-promise','../../config/logger','agi','./scripts','/var/opt/motion2/server/files','rawHeaders','menu','getdigits','getsecretdigits','channel','rpc','mailRpc','prototype','getVariable','getVariableById','then'];(function(_0xc46be2,_0x2952d1){var _0x295537=function(_0x27a640){while(--_0x27a640){_0xc46be2['push'](_0xc46be2['shift']());}};_0x295537(++_0x2952d1);}(_0xe1b3,0x1b4));var _0x3e1b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xe1b3[_0x20a584];return _0x4b41a8;};'use strict';var fs=require('fs');var path=require(_0x3e1b('0x0'));var util=require('util');var _=require(_0x3e1b('0x1'));var sh=require(_0x3e1b('0x2'));var odbc=require(_0x3e1b('0x3'))();var rs=require('randomstring');var moment=require(_0x3e1b('0x4'));var Mustache=require(_0x3e1b('0x5'));var rp=require(_0x3e1b('0x6'));var logger=require(_0x3e1b('0x7'))(_0x3e1b('0x8'));var config=require('../../config/environment');var scripts=require(_0x3e1b('0x9'));var FILES_PATH=_0x3e1b('0xa');var recursiveMapAttributes=[_0x3e1b('0xb'),'rawBody'];var verticesWithRetry=[_0x3e1b('0xc'),_0x3e1b('0xd'),_0x3e1b('0xe')];var AGIVertices=function(_0x1e8d18,_0x33c1cc,_0x461d8d){this[_0x3e1b('0xf')]=_0x1e8d18;this[_0x3e1b('0x10')]=_0x33c1cc;this[_0x3e1b('0x11')]=_0x461d8d;};AGIVertices[_0x3e1b('0x12')][_0x3e1b('0x13')]=function(_0x5e46c3,_0x1c0fd8){this[_0x3e1b('0x10')][_0x3e1b('0x14')](_0x5e46c3)[_0x3e1b('0x15')](function(_0xc0ba36){_0x1c0fd8(null,_0xc0ba36?_0xc0ba36[_0x3e1b('0x16')]:![]);})[_0x3e1b('0x17')](function(_0xe5f1bf){_0x1c0fd8(_0xe5f1bf);});};AGIVertices[_0x3e1b('0x12')][_0x3e1b('0x18')]=function(_0xb5523b,_0x1ee9ea){this[_0x3e1b('0x10')]['getVoiceQueueById'](_0xb5523b)[_0x3e1b('0x15')](function(_0x388a86){_0x1ee9ea(null,_0x388a86?_0x388a86['name']:![]);})[_0x3e1b('0x17')](function(_0x2c3eee){_0x1ee9ea(_0x2c3eee);});};AGIVertices[_0x3e1b('0x12')]['getSquareProject']=function(_0xdada55,_0x4cbcd4){this[_0x3e1b('0x10')][_0x3e1b('0x19')](_0xdada55)[_0x3e1b('0x15')](function(_0x2be5c4){_0x4cbcd4(null,_0x2be5c4?_0x2be5c4[_0x3e1b('0x16')]:![]);})[_0x3e1b('0x17')](function(_0x4f6045){_0x4cbcd4(_0x4f6045);});};AGIVertices[_0x3e1b('0x12')][_0x3e1b('0x1a')]=function(_0xa41a85,_0x303673){this['rpc'][_0x3e1b('0x1b')](_0xa41a85)[_0x3e1b('0x15')](function(_0x1ddc24){_0x303673(null,_0x1ddc24?_0x1ddc24[_0x3e1b('0x1c')]:![]);})[_0x3e1b('0x17')](function(_0x32d57d){_0x303673(_0x32d57d);});};AGIVertices[_0x3e1b('0x12')][_0x3e1b('0x1d')]=function(_0x1d8d74,_0x1b028c){this[_0x3e1b('0x10')][_0x3e1b('0x1e')](_0x1d8d74)[_0x3e1b('0x15')](function(_0x2a8749){_0x1b028c(null,_0x2a8749?_0x2a8749['name']:![]);})[_0x3e1b('0x17')](function(_0x52cb17){_0x1b028c(_0x52cb17);});};AGIVertices[_0x3e1b('0x12')]['getTrunk']=function(_0xbc9169,_0x1aeee2){this[_0x3e1b('0x10')]['getTrunkById'](_0xbc9169)[_0x3e1b('0x15')](function(_0x58459f){_0x1aeee2(null,_0x58459f?_0x58459f[_0x3e1b('0x16')]:![]);})[_0x3e1b('0x17')](function(_0x59f06a){_0x1aeee2(_0x59f06a);});};AGIVertices[_0x3e1b('0x12')][_0x3e1b('0x1f')]=function(_0x7f12d6,_0x24ef84){var _0x572348=this;this['rpc'][_0x3e1b('0x20')](_0x7f12d6)[_0x3e1b('0x15')](function(_0x220313){_0x24ef84(null,_0x220313?_0x572348['getSoundPath'](_0x220313[_0x3e1b('0x21')]):![]);})[_0x3e1b('0x17')](function(_0x17e41b){_0x24ef84(_0x17e41b);});};AGIVertices[_0x3e1b('0x12')][_0x3e1b('0x22')]=function(_0x5e9ad2,_0x143ff0){this[_0x3e1b('0x10')][_0x3e1b('0x23')](_0x5e9ad2)[_0x3e1b('0x15')](function(_0x1246b4){_0x143ff0(null,_0x1246b4?_0x1246b4:![]);})[_0x3e1b('0x17')](function(_0x433a29){_0x143ff0(_0x433a29);});};AGIVertices[_0x3e1b('0x12')][_0x3e1b('0x24')]=function(_0x1db2e3,_0x169194,_0x4c660e){this['mailRpc']['sendMailMessage'](_0x1db2e3,_0x169194)['then'](function(){_0x4c660e(null);})[_0x3e1b('0x17')](function(_0x252b41){_0x4c660e(_0x252b41);});};AGIVertices[_0x3e1b('0x12')][_0x3e1b('0x25')]=function(_0x2c6286,_0x446d47){this[_0x3e1b('0x10')][_0x3e1b('0x26')](_0x2c6286)['then'](function(_0x148636){if(_0x148636){if(_0x148636[_0x3e1b('0x27')]){_0x446d47(null,[_0x148636[_0x3e1b('0x28')]]);}else{_0x446d47(null,_[_0x3e1b('0x29')](_0x148636[_0x3e1b('0x2a')],'interval'));}}else{_0x446d47(null,![]);}})['catch'](function(_0xdc2460){_0x446d47(_0xdc2460);});};AGIVertices[_0x3e1b('0x12')][_0x3e1b('0x2b')]=function(_0x905a67){return util[_0x3e1b('0x2c')](_0x3e1b('0x2d'),FILES_PATH,_0x905a67);};AGIVertices['prototype'][_0x3e1b('0x2e')]=function(_0x13c5d0,_0x11bcab,_0xdc1e78){odbc['open'](_0x13c5d0,function(_0x1c619d){if(_0x1c619d){logger[_0x3e1b('0x2f')](_0x3e1b('0x30'),_0x1c619d);_0xdc1e78(_0x1c619d);}else{logger['info']('ODBC\x20connection\x20successfully');odbc[_0x3e1b('0x31')](_0x11bcab,function(_0x1fe467,_0x5143b0){if(_0x1fe467){logger[_0x3e1b('0x32')](_0x3e1b('0x33'),_0x11bcab);_0xdc1e78(_0x1fe467);}else{logger[_0x3e1b('0x32')](_0x3e1b('0x34'),_0x11bcab);odbc[_0x3e1b('0x35')](function(_0x429915){if(_0x429915){logger[_0x3e1b('0x2f')](_0x3e1b('0x36'),_0x429915);}_0xdc1e78(null,_0x5143b0);});}});}});};AGIVertices['prototype'][_0x3e1b('0x37')]=function(_0x387f00,_0x3696dc){this[_0x3e1b('0x10')]['getSmsAccountById'](_0x387f00)[_0x3e1b('0x15')](function(_0x8f0f03){_0x3696dc(null,_0x8f0f03?_0x8f0f03:![]);})[_0x3e1b('0x17')](function(_0x1be35e){_0x3696dc(_0x1be35e);});};AGIVertices[_0x3e1b('0x12')][_0x3e1b('0x38')]=function(_0x1a5a71,_0x1db8c3){this[_0x3e1b('0x10')][_0x3e1b('0x38')](_0x1a5a71)['then'](function(_0x5f00a7){_0x1db8c3(null,_0x5f00a7);})[_0x3e1b('0x17')](function(_0x1a6009){_0x1db8c3(_0x1a6009);});};AGIVertices[_0x3e1b('0x12')][_0x3e1b('0x39')]=function(_0x1bc795,_0x40960a,_0x2e579b){this[_0x3e1b('0x10')][_0x3e1b('0x39')]({'uniqueid':this[_0x3e1b('0xf')]['uniqueid'],'node':_0x1bc795[_0x3e1b('0x3a')],'application':_0x1bc795[_0x3e1b('0x3b')],'data':_0x40960a||null,'project_name':this[_0x3e1b('0xf')]['arg_1'],'callerid':this['channel'][_0x3e1b('0x3c')]})[_0x3e1b('0x15')](function(_0x581af2){if(_0x2e579b){_0x2e579b(null,_0x581af2);}})[_0x3e1b('0x17')](function(_0x84e532){if(_0x2e579b){_0x2e579b(_0x84e532);}});};AGIVertices[_0x3e1b('0x12')][_0x3e1b('0x3d')]=function(_0x2e5d45,_0x29b834,_0x1ee4f0,_0x2171bb){this[_0x3e1b('0x10')][_0x3e1b('0x3d')]({'uniqueid':this[_0x3e1b('0xf')][_0x3e1b('0x3e')],'callerid':this[_0x3e1b('0xf')][_0x3e1b('0x3c')],'calleridname':this[_0x3e1b('0xf')][_0x3e1b('0x3f')],'context':this[_0x3e1b('0xf')][_0x3e1b('0x40')],'extension':this[_0x3e1b('0xf')][_0x3e1b('0x41')],'priority':this[_0x3e1b('0xf')][_0x3e1b('0x42')],'accountcode':this['channel']['accountcode'],'dnid':this[_0x3e1b('0xf')][_0x3e1b('0x43')],'projectName':this[_0x3e1b('0xf')]['arg_1'],'saveName':_0x29b834,'filename':_0x2e5d45[_0x3e1b('0x44')]||_0x29b834,'savePath':_0x1ee4f0})['then'](function(_0x2d0a0f){_0x2171bb(null,_0x2d0a0f);})['catch'](function(_0xc1ea5a){_0x2171bb(_0xc1ea5a);});};AGIVertices[_0x3e1b('0x12')][_0x3e1b('0x45')]=function(_0x29ba86,_0x413505,_0x10d8f5){this[_0x3e1b('0x10')][_0x3e1b('0x45')]({'uniqueid':this[_0x3e1b('0xf')][_0x3e1b('0x3e')],'body':_0x29ba86,'direction':_0x413505})[_0x3e1b('0x15')](function(_0x52b7de){if(_0x10d8f5){_0x10d8f5(null,_0x52b7de);}})[_0x3e1b('0x17')](function(_0x4edd35){if(_0x10d8f5){_0x10d8f5(_0x4edd35);}});};AGIVertices[_0x3e1b('0x12')][_0x3e1b('0x46')]=function(_0x398c23,_0x426854){console[_0x3e1b('0x47')](_0x3e1b('0x48'),_0x398c23);console['log'](_0x3e1b('0x49'),_0x426854);this[_0x3e1b('0x10')][_0x3e1b('0x46')]({'firstName':_['isEmpty'](_0x398c23[_0x3e1b('0x16')])||_[_0x3e1b('0x4a')](_0x398c23['name'])?'callback_'+Math[_0x3e1b('0x4b')]():_0x398c23['name'],'lastName':_['isEmpty'](_0x398c23['lastName'])||_[_0x3e1b('0x4a')](_0x398c23['lastName'])?null:_0x398c23[_0x3e1b('0x4c')],'phone':_0x398c23[_0x3e1b('0x4d')],'ListId':_0x398c23[_0x3e1b('0x4e')],'scheduledat':_0x398c23['scheduledAt'],'callbackUniqueid':this['channel']['uniqueid'],'tags':'callback','description':'Callback\x20scheduled\x20at\x20'+_0x398c23[_0x3e1b('0x4f')][_0x3e1b('0x50')](),'priority':_0x398c23[_0x3e1b('0x51')]})[_0x3e1b('0x15')](function(_0x49a4b6){_0x426854(null,_0x49a4b6);})[_0x3e1b('0x17')](function(_0x4fc835){_0x426854(_0x4fc835);});};AGIVertices[_0x3e1b('0x12')][_0x3e1b('0x52')]=function(_0x84bd59,_0x5cf8fd){this['rpc']['getPauseById'](_0x84bd59)['then'](function(_0xd2e2c7){_0x5cf8fd(null,_0xd2e2c7?_0xd2e2c7[_0x3e1b('0x16')]:![]);})[_0x3e1b('0x17')](function(_0x3ab66a){_0x5cf8fd(_0x3ab66a);});};AGIVertices[_0x3e1b('0x12')][_0x3e1b('0x53')]=function(_0x7c2f47,_0x14a2d3,_0x4ca25f){var _0x5d49b7={'role':_0x3e1b('0x54')};_0x5d49b7[_0x7c2f47]=this[_0x3e1b('0xf')][_0x3e1b('0x3c')];this[_0x3e1b('0x10')][_0x3e1b('0x53')](_0x5d49b7,_0x14a2d3,this['channel'][_0x3e1b('0x3e')])['then'](function(_0x37b239){_0x4ca25f(null,_[_0x3e1b('0x4a')](_0x37b239)?![]:!![]);})['catch'](function(_0x2e3a3b){logger[_0x3e1b('0x2f')](_0x2e3a3b);_0x4ca25f(null,![]);});};AGIVertices[_0x3e1b('0x12')][_0x3e1b('0x55')]=function(_0x412f38,_0x2c7c1c){var _0x5e1a28={'role':_0x3e1b('0x54')};_0x5e1a28[_0x412f38]=this[_0x3e1b('0xf')]['callerid'];this[_0x3e1b('0x10')][_0x3e1b('0x55')](_0x5e1a28)[_0x3e1b('0x15')](function(_0x4c3727){_0x2c7c1c(null,_['isNil'](_0x4c3727)?![]:!![]);})[_0x3e1b('0x17')](function(_0x5a2ea2){logger[_0x3e1b('0x2f')](_0x5a2ea2);_0x2c7c1c(null,![]);});};AGIVertices[_0x3e1b('0x12')][_0x3e1b('0x56')]=function(_0x5ea865,_0xb7957a){var _0x437c07={'role':'agent'};_0x437c07[_0x5ea865]=this[_0x3e1b('0xf')][_0x3e1b('0x3c')];this[_0x3e1b('0x10')][_0x3e1b('0x56')](_0x437c07)[_0x3e1b('0x15')](function(_0x51e389){_0xb7957a(null,_[_0x3e1b('0x4a')](_0x51e389)?![]:!![]);})[_0x3e1b('0x17')](function(_0x24a3bd){logger[_0x3e1b('0x2f')](_0x24a3bd);_0xb7957a(null,![]);});};AGIVertices[_0x3e1b('0x12')]['agentLogin']=function(_0x2d4e04,_0x34d268){var _0x184c5b={'role':'agent'};_0x184c5b[_0x2d4e04]=this[_0x3e1b('0xf')]['callerid'];var _0x16c25e=_0x2d4e04!=_0x3e1b('0x57')?util['format']('%s/%s@from-sip/n','LOCAL',this[_0x3e1b('0xf')][_0x3e1b('0x3c')]):undefined;this['rpc'][_0x3e1b('0x58')](_0x184c5b,_0x16c25e)['then'](function(_0x224609){_0x34d268(null,_[_0x3e1b('0x4a')](_0x224609)?![]:!![]);})['catch'](function(_0x589739){logger[_0x3e1b('0x2f')](_0x589739);_0x34d268(null,![]);});};AGIVertices[_0x3e1b('0x12')]['shellCommand']=function(_0x426cc9,_0x48af4f){sh[_0x3e1b('0x59')](_[_0x3e1b('0x5a')](_0x426cc9),function(_0x1baaa7,_0x2fee4b){var _0x2c5d80=_0x2fee4b['replace'](/(\r\n|\n|\r)/gm,'');_0x48af4f(null,_0x2c5d80);});};AGIVertices[_0x3e1b('0x12')][_0x3e1b('0x5b')]=function(_0x1a5ff1,_0x24466e){scripts['googleCloudTTS'](_0x1a5ff1['apiKey'],_0x1a5ff1['google_cloud_tts_text_type']||_0x3e1b('0x5c'),_0x1a5ff1['text'],_0x1a5ff1[_0x3e1b('0x5d')]||'en-US',_0x1a5ff1['ssmlGender']||_0x3e1b('0x5e'),_0x1a5ff1[_0x3e1b('0x5f')]||_0x3e1b('0x60'))[_0x3e1b('0x15')](function(_0x3b31ad){_0x24466e(null,_0x3b31ad);})['catch'](function(_0x504b82){_0x24466e(_0x504b82);});};AGIVertices[_0x3e1b('0x12')][_0x3e1b('0x61')]=function(_0x271f1d,_0xc5fb47){scripts[_0x3e1b('0x61')](_0x271f1d['text'],_0x271f1d[_0x3e1b('0x62')]||'en',0x1)[_0x3e1b('0x15')](function(_0xcdd0f8){_0xc5fb47(null,_0xcdd0f8);})[_0x3e1b('0x17')](function(_0x8b7e08){_0xc5fb47(_0x8b7e08);});};AGIVertices[_0x3e1b('0x12')][_0x3e1b('0x63')]=function(_0x362902,_0x3f7f5f){var _0x4bec0d={'uri':_0x362902[_0x3e1b('0x64')],'method':_0x362902[_0x3e1b('0x65')],'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x362902[_0x3e1b('0x66')])==='number'&&parseInt(_0x362902[_0x3e1b('0x66')])>=0x1?parseInt(_0x362902[_0x3e1b('0x66')])*0x3e8:0x5*0x3e8};if(_['includes']([_0x3e1b('0x67'),_0x3e1b('0x68')],_0x4bec0d[_0x3e1b('0x65')]['toUpperCase']())){try{_0x4bec0d[_0x3e1b('0x69')]=_0x362902['rawBody']?JSON[_0x3e1b('0x6a')](_0x362902[_0x3e1b('0x6b')]):{};}catch(_0x4d73aa){logger[_0x3e1b('0x2f')](_0x3e1b('0x6c'),_0x4d73aa);}}try{_0x4bec0d[_0x3e1b('0x6d')]=_0x362902[_0x3e1b('0xb')]?JSON[_0x3e1b('0x6a')](_0x362902[_0x3e1b('0xb')]):{};}catch(_0x482a3b){logger['error'](_0x3e1b('0x6e'),_0x482a3b);}if(_0x362902[_0x3e1b('0x6f')]){try{var _0x281c89=require(_0x362902[_0x3e1b('0x6f')])[_0x3e1b('0x70')](this,_0x4bec0d);_0x4bec0d['uri']=Mustache[_0x3e1b('0x71')](_0x362902[_0x3e1b('0x64')],_0x281c89,{},['$$','$$']);if(_0x4bec0d[_0x3e1b('0x6d')]){_0x4bec0d[_0x3e1b('0x6d')]=JSON['parse'](Mustache[_0x3e1b('0x71')](JSON[_0x3e1b('0x72')](_0x4bec0d[_0x3e1b('0x6d')]),_0x281c89,{},['$$','$$']));}if(_0x4bec0d['body']){_0x4bec0d[_0x3e1b('0x69')]=JSON['parse'](Mustache[_0x3e1b('0x71')](JSON['stringify'](_0x4bec0d[_0x3e1b('0x69')]),_0x281c89,{},['$$','$$']));}}catch(_0x3552dc){logger[_0x3e1b('0x2f')](_0x3e1b('0x73'),_0x3552dc);}}rp(_0x4bec0d)[_0x3e1b('0x15')](function(_0x483d87){var _0x33e723={'statusCode':_0x483d87['statusCode']||0xc8,'statusMessage':_0x483d87[_0x3e1b('0x74')]||'OK','headers':_0x483d87[_0x3e1b('0x6d')]||{},'body':_0x483d87[_0x3e1b('0x69')]||{}};_0x3f7f5f(null,_0x33e723);})[_0x3e1b('0x17')](function(_0x393638){var _0x5105d7={'statusCode':_0x393638['statusCode']||0x1f4,'statusMessage':_0x393638[_0x3e1b('0x75')]||_0x3e1b('0x76'),'headers':_0x393638['options'][_0x3e1b('0x6d')]||{},'body':_0x393638[_0x3e1b('0x77')][_0x3e1b('0x69')]||{}};_0x3f7f5f(null,_0x5105d7);});};AGIVertices[_0x3e1b('0x12')][_0x3e1b('0x78')]=function(_0x2f8213,_0x2d4401){scripts[_0x3e1b('0x78')](this[_0x3e1b('0xf')][_0x3e1b('0x3e')],_0x2f8213[_0x3e1b('0x79')],_0x2f8213[_0x3e1b('0x5c')],_0x2f8213['dialogflow_language']||'en')['then'](function(_0x5e284c){_0x2d4401(null,_0x5e284c);})['catch'](function(_0x14159c){_0x2d4401(_0x14159c);});};AGIVertices['prototype'][_0x3e1b('0x7a')]=function(_0x4ae7ce,_0x55a7b0){scripts[_0x3e1b('0x7a')](this[_0x3e1b('0xf')],_0x4ae7ce)[_0x3e1b('0x15')](function(_0x43b4f3){_0x55a7b0(null,_0x43b4f3);})[_0x3e1b('0x17')](function(_0x15fc9e){_0x55a7b0(_0x15fc9e);});};AGIVertices['prototype'][_0x3e1b('0x7b')]=function(_0x458236,_0x416890){scripts[_0x3e1b('0x7b')](_0x458236['key'],_0x458236[_0x3e1b('0x5c')],_0x458236[_0x3e1b('0x7c')]||_0x3e1b('0x7d'),_0x458236[_0x3e1b('0x7e')])['then'](function(_0x393a07){_0x416890(null,_0x393a07);})[_0x3e1b('0x17')](function(_0x186850){_0x416890(_0x186850);});};AGIVertices[_0x3e1b('0x12')][_0x3e1b('0x7f')]=function(_0x4f66b8,_0x2a5055,_0x423908){scripts[_0x3e1b('0x7f')](_0x2a5055,_0x4f66b8[_0x3e1b('0x79')],_0x4f66b8[_0x3e1b('0x80')]||_0x3e1b('0x7d'),this[_0x3e1b('0x81')](_0x4f66b8['model'])?_0x4f66b8['model']:undefined)[_0x3e1b('0x15')](function(_0x578b69){_0x423908(null,_0x578b69);})[_0x3e1b('0x17')](function(_0x123ee2){_0x423908(_0x123ee2);});};AGIVertices['prototype'][_0x3e1b('0x82')]=function(_0x15ce7d,_0x19b9d5){scripts['awsPolly'](_0x15ce7d[_0x3e1b('0x83')],_0x15ce7d[_0x3e1b('0x84')],_0x15ce7d[_0x3e1b('0x85')],_0x15ce7d[_0x3e1b('0x86')]||'Amy',_0x15ce7d[_0x3e1b('0x5c')],_0x15ce7d['aws_text_type']||_0x3e1b('0x5c'))[_0x3e1b('0x15')](function(_0x240ae1){_0x19b9d5(null,_0x240ae1);})[_0x3e1b('0x17')](function(_0x1ea114){_0x19b9d5(_0x1ea114);});};AGIVertices['prototype'][_0x3e1b('0x87')]=function(_0x3c5104,_0x1ff234){scripts[_0x3e1b('0x87')](this['channel']['uniqueid'],_0x3c5104[_0x3e1b('0x83')],_0x3c5104['aws_secret_access_key'],_0x3c5104[_0x3e1b('0x88')],_0x3c5104[_0x3e1b('0x5c')],_0x3c5104[_0x3e1b('0x89')])[_0x3e1b('0x15')](function(_0x3fe910){_0x1ff234(null,_0x3fe910);})[_0x3e1b('0x17')](function(_0x5b4e91){_0x1ff234(_0x5b4e91);});};AGIVertices[_0x3e1b('0x12')]['googleASR']=function(_0x58afab,_0xfeffe2,_0x322007){scripts[_0x3e1b('0x8a')](_0xfeffe2,_0x58afab[_0x3e1b('0x79')],_0x58afab[_0x3e1b('0x8b')]||'en-US')[_0x3e1b('0x15')](function(_0x1bf7ac){_0x322007(null,_0x1bf7ac);})['catch'](function(_0x5b713b){_0x322007(_0x5b713b);});};AGIVertices[_0x3e1b('0x12')][_0x3e1b('0x8c')]=function(_0x2a300d,_0x3455ea,_0x8562d){scripts[_0x3e1b('0x8c')](_0x3455ea,_0x2a300d['appid'],_0x2a300d[_0x3e1b('0x8d')],_0x2a300d[_0x3e1b('0x8e')])[_0x3e1b('0x15')](function(_0x558cc7){_0x8562d(null,_0x558cc7);})[_0x3e1b('0x17')](function(_0x32cea7){_0x8562d(_0x32cea7);});};AGIVertices[_0x3e1b('0x12')][_0x3e1b('0x8f')]=function(_0xb1fda4){var _0x273ba6=_['includes'](verticesWithRetry,_0xb1fda4[_0x3e1b('0x3b')])?_0xb1fda4:_[_0x3e1b('0x90')](_0xb1fda4);for(var _0x2b16fe in _0x273ba6){if(_0x273ba6[_0x3e1b('0x91')](_0x2b16fe)){if(_0x273ba6[_0x2b16fe]&&_[_0x3e1b('0x92')](_0x273ba6[_0x2b16fe])){if(_[_0x3e1b('0x93')](recursiveMapAttributes,_0x2b16fe)){_0x273ba6[_0x2b16fe]=this[_0x3e1b('0x94')](_0x273ba6[_0x2b16fe]);}else{_0x273ba6[_0x2b16fe]=this['replaceAllVariables'](_0x273ba6[_0x2b16fe]);}}}}return _0x273ba6;};AGIVertices[_0x3e1b('0x12')]['recursiveNodeIndex']=function(_0x19792c){for(var _0x3c93e2 in _0x19792c){if(_0x19792c['hasOwnProperty'](_0x3c93e2)){if(_[_0x3e1b('0x95')](_0x19792c[_0x3c93e2])){this[_0x3e1b('0x96')](_0x19792c[_0x3c93e2]);}else if(_[_0x3e1b('0x97')](_0x19792c[_0x3c93e2])){for(var _0x459249=0x0;_0x459249<_0x19792c[_0x3c93e2][_0x3e1b('0x98')];_0x459249++){this[_0x3e1b('0x96')](_0x19792c[_0x3c93e2][_0x459249]);}}else if(_['isString'](_0x19792c[_0x3c93e2])){_0x19792c[_0x3c93e2]=this['replaceAllVariables'](_0x19792c[_0x3c93e2]);}}}};AGIVertices[_0x3e1b('0x12')][_0x3e1b('0x99')]=function(_0x81dcac,_0x12508c){for(var _0x587189 in _0x81dcac){if(_0x81dcac['hasOwnProperty'](_0x587189)){if(_[_0x3e1b('0x95')](_0x81dcac[_0x587189])){if(!_[_0x3e1b('0x9a')](_0x81dcac[_0x587189])){this[_0x3e1b('0x99')](_0x81dcac[_0x587189],util[_0x3e1b('0x2c')](_0x3e1b('0x9b'),_0x12508c,_0x587189));}}else if(_['isArray'](_0x81dcac[_0x587189])){for(var _0x3f10f5=0x0;_0x3f10f5<_0x81dcac[_0x587189][_0x3e1b('0x98')];_0x3f10f5++){this['saveRestApiResult'](_0x81dcac[_0x587189][_0x3f10f5],util['format'](_0x3e1b('0x9b'),_0x12508c,_0x587189+'['+_0x3f10f5+']'));}}else{if(!_[_0x3e1b('0x4a')](_0x81dcac[_0x587189])){this['channel'][_0x3e1b('0x9c')](util[_0x3e1b('0x2c')](_0x3e1b('0x9b'),_0x12508c,_0x587189),_0x81dcac[_0x587189]);}}}}};AGIVertices['prototype'][_0x3e1b('0x94')]=function(_0x562f83){try{var _0x5c43ff=JSON[_0x3e1b('0x6a')](_0x562f83);this['recursiveNodeIndex'](_0x5c43ff);return JSON[_0x3e1b('0x72')](_0x5c43ff);}catch(_0x505f8c){return this['replaceAllVariables'](_0x562f83);}};AGIVertices[_0x3e1b('0x12')][_0x3e1b('0x9d')]=function(_0x15ae29){console[_0x3e1b('0x47')]('replaceall\x20init',_0x15ae29);var _0x4ac56a=_0x15ae29['split']('{');for(var _0x57a864=0x1;_0x57a864<_0x4ac56a[_0x3e1b('0x98')];_0x57a864+=0x1){var _0x294a7d=_0x4ac56a[_0x57a864][_0x3e1b('0x9e')]('}');console[_0x3e1b('0x47')](_0x3e1b('0x9f'),_0x294a7d);if(_0x294a7d['length']>0x1){_0x15ae29=_0x15ae29[_0x3e1b('0xa0')]('{'+_0x294a7d[0x0]+'}',this['channel'][_0x3e1b('0x13')](_0x294a7d[0x0])[_0x3e1b('0xa1')]||_0x294a7d[0x0]);}}if(_0x4ac56a[_0x3e1b('0x98')]===0x1){return _0x15ae29[_0x3e1b('0x50')]();}console[_0x3e1b('0x47')](_0x3e1b('0xa2'),_0x15ae29);return this[_0x3e1b('0x9d')](_0x15ae29);};AGIVertices[_0x3e1b('0x12')][_0x3e1b('0xa3')]=function(_0x3d9a61,_0x349482){var _0x20fc32=this[_0x3e1b('0xf')][_0x3e1b('0x13')](_0x3d9a61);if(_0x20fc32[_0x3e1b('0xa4')]===-0x1){return _0x20fc32;}logger[_0x3e1b('0x32')](util['format'](_0x3e1b('0xa5'),_0x349482,_0x20fc32[_0x3e1b('0xa1')]));return this[_0x3e1b('0xf')][_0x3e1b('0x9c')](_0x349482,_0x20fc32[_0x3e1b('0xa1')]);};AGIVertices['prototype'][_0x3e1b('0x81')]=function(_0x4c2169){return _0x4c2169&&_0x4c2169!=='0'&&_0x4c2169!=='-1'&&_0x4c2169!=='';};AGIVertices['prototype'][_0x3e1b('0xa6')]=function(_0x50138d){this[_0x3e1b('0x39')]['sync'](this,_0x50138d,'-');_0x50138d[_0x3e1b('0xa7')]=_0x50138d[_0x3e1b('0xa6')];return{'code':0xc8,'result':'-'};};AGIVertices[_0x3e1b('0x12')][_0x3e1b('0xa8')]=function(_0x2c535f){logger['info'](util[_0x3e1b('0x2c')](_0x3e1b('0xa9'),_0x2c535f[_0x3e1b('0x3a')]));if(!this[_0x3e1b('0x81')](_0x2c535f[_0x3e1b('0x5c')])){return this['channel'][_0x3e1b('0xaa')](_0x3e1b('0xab'));}var _0x332e31='\x22'+_0x2c535f[_0x3e1b('0x5c')]+'\x22';if(this['isConfigured'](_0x2c535f[_0x3e1b('0x77')])){_0x332e31+=','+_0x2c535f[_0x3e1b('0x77')];}var _0x781196=this[_0x3e1b('0xf')][_0x3e1b('0x59')](_0x3e1b('0xac'),_0x332e31);if(_0x781196[_0x3e1b('0xa4')]===-0x1){return _0x781196;}return this[_0x3e1b('0xf')][_0x3e1b('0xaa')](util['format']('Executed\x20command\x20MRCPSynth\x20%s',_0x332e31));};AGIVertices[_0x3e1b('0x12')][_0x3e1b('0xad')]=function(_0xf9c764){logger['info'](util[_0x3e1b('0x2c')](_0x3e1b('0xae'),_0xf9c764['label']));if(!this['isConfigured'](_0xf9c764['grammar'])){return this[_0x3e1b('0xf')][_0x3e1b('0xaa')]('no\x20grammar\x20configured');}var _0x25b807=_0xf9c764[_0x3e1b('0xaf')];if(this[_0x3e1b('0x81')](_0xf9c764[_0x3e1b('0x77')])){_0x25b807+=','+_0xf9c764[_0x3e1b('0x77')];}var _0x561467=this[_0x3e1b('0xf')]['exec'](_0x3e1b('0xb0'),_0x25b807);if(_0x561467[_0x3e1b('0xa4')]===-0x1){return _0x561467;}var _0x5c4825=this['getAndSetVariable'](_0x3e1b('0xb1'),'MRCP_RECOG_CONFIDENCE');if(_0x5c4825['result']===-0x1){return _0x5c4825;}var _0x82a86=this['getAndSetVariable'](_0x3e1b('0xb2'),'MRCP_RECOG_TRANSCRIPT');if(_0x82a86[_0x3e1b('0xa4')]===-0x1){return _0x82a86;}var _0x182384=this[_0x3e1b('0xa3')](_0x3e1b('0xb3'),'MRCP_RECOG_INSTANCE');if(_0x182384[_0x3e1b('0xa4')]===-0x1){return _0x182384;}return this[_0x3e1b('0xf')][_0x3e1b('0xaa')](util['format'](_0x3e1b('0xb4'),_0x25b807));};AGIVertices[_0x3e1b('0x12')][_0x3e1b('0x8')]=function(_0x56b670){logger[_0x3e1b('0x32')](util[_0x3e1b('0x2c')](_0x3e1b('0xb5'),_0x56b670[_0x3e1b('0x3a')]));return this[_0x3e1b('0xf')][_0x3e1b('0x8')]([_0x56b670[_0x3e1b('0xb6')],_0x56b670[_0x3e1b('0xb7')]]);};AGIVertices[_0x3e1b('0x12')][_0x3e1b('0xb8')]=function(_0x3d76a0){logger[_0x3e1b('0x32')](util[_0x3e1b('0x2c')](_0x3e1b('0xb9'),_0x3d76a0[_0x3e1b('0x3a')]));if(this['isConfigured'](_0x3d76a0[_0x3e1b('0x66')])){logger[_0x3e1b('0x32')](util[_0x3e1b('0x2c')](_0x3e1b('0xba'),_0x3d76a0[_0x3e1b('0x66')]));var _0x19104f=this['channel'][_0x3e1b('0xbb')](_0x3d76a0['timeout']);if(_0x19104f[_0x3e1b('0xa4')]===-0x1){return _0x19104f;}}return this['channel'][_0x3e1b('0xb8')]();};AGIVertices[_0x3e1b('0x12')]['callback']=function(_0xcef7ff){console[_0x3e1b('0xbc')]('enter\x20in\x20callbackblock',_0xcef7ff);logger[_0x3e1b('0x32')](util['format'](_0x3e1b('0xbd'),_0xcef7ff['label']));if(!this[_0x3e1b('0x81')](_0xcef7ff['list_id'])){return this['channel'][_0x3e1b('0x2f')](_0xcef7ff,_0x3e1b('0xbe'));}_0xcef7ff[_0x3e1b('0x4f')]=moment();if(this[_0x3e1b('0x81')](_0xcef7ff[_0x3e1b('0xbf')])){_0xcef7ff['scheduledAt']=moment()[_0x3e1b('0xc0')](_0xcef7ff[_0x3e1b('0xbf')],_0x3e1b('0xc1'));}if(!this[_0x3e1b('0x81')](_0xcef7ff[_0x3e1b('0x51')])){_0xcef7ff[_0x3e1b('0x51')]=0x2;}console[_0x3e1b('0x47')]('before\x20createcmcontact',_0xcef7ff);this[_0x3e1b('0x46')][_0x3e1b('0x70')](this,_0xcef7ff);return this[_0x3e1b('0xf')][_0x3e1b('0xaa')](util['format']('CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s',_0xcef7ff[_0x3e1b('0x4d')],_0xcef7ff['list_id'],_0xcef7ff['scheduledAt']));};AGIVertices['prototype']['custom_app']=function(_0x36a082){logger[_0x3e1b('0x32')](util['format'](_0x3e1b('0xc2'),_0x36a082[_0x3e1b('0x3a')]));var _0xbe5d9b=this[_0x3e1b('0xf')][_0x3e1b('0x59')](_0x36a082[_0x3e1b('0xc3')],_0x36a082[_0x3e1b('0x77')]);if(_0xbe5d9b[_0x3e1b('0xa4')]===-0x1){return _0xbe5d9b;}return this['channel']['noop'](util[_0x3e1b('0x2c')](_0x3e1b('0xc4'),_0x36a082['application'],_0x36a082[_0x3e1b('0x77')]));};AGIVertices['prototype'][_0x3e1b('0xc5')]=function(_0x142c01){logger[_0x3e1b('0x32')](util[_0x3e1b('0x2c')](_0x3e1b('0xc6'),_0x142c01['label']));if(!this[_0x3e1b('0x81')](_0x142c01[_0x3e1b('0x5c')])){return this[_0x3e1b('0xf')]['noop'](_0x3e1b('0xab'));}var _0x52303c='\x22'+_0x142c01['text']+'\x22';if(this[_0x3e1b('0x81')](_0x142c01[_0x3e1b('0x77')])){_0x52303c+=','+_0x142c01[_0x3e1b('0x77')];}var _0x31cadf=this[_0x3e1b('0xf')][_0x3e1b('0x59')]('MRCPSynth',_0x52303c);if(_0x31cadf[_0x3e1b('0xa4')]===-0x1){return _0x31cadf;}return this[_0x3e1b('0xf')][_0x3e1b('0xaa')](util[_0x3e1b('0x2c')](_0x3e1b('0xc7'),_0x52303c));};AGIVertices['prototype']['sestektts']=function(_0x1acb76){logger[_0x3e1b('0x32')](util['format'](_0x3e1b('0xc8'),_0x1acb76['label']));if(!this['isConfigured'](_0x1acb76['text'])){return this['channel'][_0x3e1b('0xaa')](_0x3e1b('0xab'));}var _0x4f7b67='\x22'+_0x1acb76[_0x3e1b('0x5c')]+'\x22';if(this[_0x3e1b('0x81')](_0x1acb76[_0x3e1b('0x77')])){_0x4f7b67+=','+_0x1acb76[_0x3e1b('0x77')];}var _0x4de6aa=this['channel'][_0x3e1b('0x59')](_0x3e1b('0xac'),_0x4f7b67);if(_0x4de6aa[_0x3e1b('0xa4')]===-0x1){return _0x4de6aa;}return this[_0x3e1b('0xf')][_0x3e1b('0xaa')](util[_0x3e1b('0x2c')](_0x3e1b('0xc7'),_0x4f7b67));};AGIVertices['prototype'][_0x3e1b('0xc9')]=function(_0x3d9926){logger[_0x3e1b('0x32')](util[_0x3e1b('0x2c')](_0x3e1b('0xca'),_0x3d9926[_0x3e1b('0x3a')]));if(!this['isConfigured'](_0x3d9926[_0x3e1b('0xaf')])){return this[_0x3e1b('0xf')]['noop']('no\x20grammar\x20configured');}var _0x388837=_0x3d9926['grammar'];if(this[_0x3e1b('0x81')](_0x3d9926[_0x3e1b('0x77')])){_0x388837+=','+_0x3d9926[_0x3e1b('0x77')];}var _0x2aefd3=this[_0x3e1b('0xf')][_0x3e1b('0x59')](_0x3e1b('0xb0'),_0x388837);if(_0x2aefd3[_0x3e1b('0xa4')]===-0x1){return _0x2aefd3;}var _0x2301ad=this[_0x3e1b('0xa3')](_0x3e1b('0xb1'),_0x3e1b('0xcb'));if(_0x2301ad[_0x3e1b('0xa4')]===-0x1){return _0x2301ad;}var _0x2ee41f=this[_0x3e1b('0xa3')](_0x3e1b('0xb2'),_0x3e1b('0xcc'));if(_0x2ee41f[_0x3e1b('0xa4')]===-0x1){return _0x2ee41f;}var _0x528e05=this[_0x3e1b('0xa3')](_0x3e1b('0xb3'),_0x3e1b('0xcd'));if(_0x528e05[_0x3e1b('0xa4')]===-0x1){return _0x528e05;}return this[_0x3e1b('0xf')]['noop'](util[_0x3e1b('0x2c')](_0x3e1b('0xb4'),_0x388837));};AGIVertices[_0x3e1b('0x12')]['sestekasr']=function(_0x430645){logger[_0x3e1b('0x32')](util['format']('Enter\x20in\x20SESTEKASR\x20(%s)\x20block',_0x430645[_0x3e1b('0x3a')]));if(!this['isConfigured'](_0x430645[_0x3e1b('0xaf')])){return this[_0x3e1b('0xf')][_0x3e1b('0xaa')](_0x3e1b('0xce'));}var _0x3b2a66=_0x430645['grammar'];if(this['isConfigured'](_0x430645[_0x3e1b('0x77')])){_0x3b2a66+=','+_0x430645[_0x3e1b('0x77')];}var _0xde72cd=this[_0x3e1b('0xf')]['exec'](_0x3e1b('0xb0'),_0x3b2a66);if(_0xde72cd['result']===-0x1){return _0xde72cd;}var _0x17a0b2=this[_0x3e1b('0xa3')](_0x3e1b('0xb1'),_0x3e1b('0xcf'));if(_0x17a0b2[_0x3e1b('0xa4')]===-0x1){return _0x17a0b2;}var _0x1fe012=this[_0x3e1b('0xa3')](_0x3e1b('0xb2'),_0x3e1b('0xd0'));if(_0x1fe012[_0x3e1b('0xa4')]===-0x1){return _0x1fe012;}var _0x3f9399=this[_0x3e1b('0xa3')](_0x3e1b('0xb3'),_0x3e1b('0xd1'));if(_0x3f9399[_0x3e1b('0xa4')]===-0x1){return _0x3f9399;}return this[_0x3e1b('0xf')][_0x3e1b('0xaa')](util['format'](_0x3e1b('0xb4'),_0x3b2a66));};AGIVertices['prototype'][_0x3e1b('0xd2')]=function(_0x3df080){logger['info'](util[_0x3e1b('0x2c')](_0x3e1b('0xd3'),_0x3df080[_0x3e1b('0x3a')]));if(!this[_0x3e1b('0x81')](_0x3df080[_0x3e1b('0xd4')])){return this[_0x3e1b('0xf')][_0x3e1b('0x2f')](_0x3df080,_0x3e1b('0xd5'));}var _0x51987a=this[_0x3e1b('0x1a')][_0x3e1b('0x70')](this,_0x3df080[_0x3e1b('0xd4')]);if(!_0x51987a){return this[_0x3e1b('0xf')][_0x3e1b('0x2f')](_0x3df080,'no\x20odbc\x20database\x20found');}if(!this[_0x3e1b('0x81')](_0x3df080[_0x3e1b('0x31')])){return this[_0x3e1b('0xf')][_0x3e1b('0x2f')](_0x3df080,_0x3e1b('0xd6'));}var _0xb179e0=_0x3df080[_0x3e1b('0x31')][_0x3e1b('0xd7')](/(\r\n|\n|\r)/gm,'\x20');this[_0x3e1b('0xf')][_0x3e1b('0xaa')](util[_0x3e1b('0x2c')](_0x3e1b('0xd8'),_0xb179e0));var _0x2426e5=this[_0x3e1b('0x2e')][_0x3e1b('0x70')](this,_0x51987a,_0xb179e0);this['createSquareDetailsReport']['sync'](this,_0x3df080,_0xb179e0);if(!this[_0x3e1b('0x81')](_0x3df080[_0x3e1b('0xd9')])){return this[_0x3e1b('0xf')][_0x3e1b('0xaa')]('no\x20variable\x20selected\x20for\x20the\x20result');}var _0x303c93=this[_0x3e1b('0x13')]['sync'](this,_0x3df080[_0x3e1b('0xd9')]);if(!_0x303c93){return this['channel'][_0x3e1b('0x2f')](_0x3df080,_0x3e1b('0xda'));}var _0x33011d=this;_0x2426e5[_0x3e1b('0xdb')](function(_0x19247b,_0x223426){Object[_0x3e1b('0xdc')](_0x19247b)[_0x3e1b('0xdb')](function(_0x51ffda){_0x33011d[_0x3e1b('0xf')][_0x3e1b('0x9c')](util[_0x3e1b('0x2c')](_0x3e1b('0xdd'),_0x303c93,_0x223426,_0x51ffda),_0x19247b[_0x51ffda]);});});this['channel'][_0x3e1b('0x9c')](util['format'](_0x3e1b('0xde'),_0x303c93),_0x2426e5[_0x3e1b('0x98')]);return this['channel'][_0x3e1b('0xaa')](util[_0x3e1b('0x2c')](_0x3e1b('0xdf'),_0x303c93));};AGIVertices[_0x3e1b('0x12')]['dial']=function(_0x207dd7){logger[_0x3e1b('0xe0')](util[_0x3e1b('0x2c')](_0x3e1b('0xe1'),_0x207dd7['label']));if(!this['isConfigured'](_0x207dd7[_0x3e1b('0xe2')])){return this[_0x3e1b('0xf')][_0x3e1b('0x2f')](_0x207dd7,_0x3e1b('0xe3'));}var _0x36def4=this['getUser'][_0x3e1b('0x70')](this,_0x207dd7[_0x3e1b('0xe2')]);if(!_0x36def4){return this[_0x3e1b('0xf')]['error'](_0x207dd7,_0x3e1b('0xe4'));}var _0x265029=this[_0x3e1b('0xf')][_0x3e1b('0x59')]('DIAL',[util[_0x3e1b('0x2c')](_0x3e1b('0xe5'),_0x36def4),_0x207dd7['timeout'],_0x207dd7['opts'],_0x207dd7['url']]);if(_0x265029[_0x3e1b('0xa4')]===-0x1){return _0x265029;}return this[_0x3e1b('0xf')]['noop'](util[_0x3e1b('0x2c')](_0x3e1b('0xe6'),_0x3e1b('0xe7')));};AGIVertices[_0x3e1b('0x12')][_0x3e1b('0xe8')]=function(_0x4b0038){logger['info'](util[_0x3e1b('0x2c')](_0x3e1b('0xe9'),_0x4b0038[_0x3e1b('0x3a')]));if(!this[_0x3e1b('0x81')](_0x4b0038[_0x3e1b('0x79')])){return this[_0x3e1b('0xf')][_0x3e1b('0xaa')](_0x3e1b('0xea'));}if(!this['isConfigured'](_0x4b0038['text'])){return this['channel'][_0x3e1b('0xaa')](_0x3e1b('0xab'));}this['channel'][_0x3e1b('0xeb')]=!![];this['createSquareDetailsReport'](_0x4b0038);this[_0x3e1b('0x45')](_0x4b0038[_0x3e1b('0x5c')],'in');this[_0x3e1b('0xf')][_0x3e1b('0xaa')](util[_0x3e1b('0x2c')](_0x3e1b('0xec'),_0x4b0038[_0x3e1b('0x5c')]));var _0x4ad241=this[_0x3e1b('0x78')]['sync'](this,_0x4b0038);if(_0x4ad241){for(var _0x16d885 in _0x4ad241){if(_0x4ad241[_0x3e1b('0x91')](_0x16d885)){this['channel']['setVariable'](util['format'](_0x3e1b('0xed'),_0x16d885['toUpperCase']()),_0x4ad241[_0x16d885]);}}this['createSquareMessage'](_0x4ad241['speech'],'out');return this[_0x3e1b('0xf')][_0x3e1b('0xaa')](util[_0x3e1b('0x2c')](_0x3e1b('0xee'),_0x4ad241[_0x3e1b('0xef')]));}return this[_0x3e1b('0xf')][_0x3e1b('0x2f')](_0x4b0038,_0x3e1b('0xf0'));};AGIVertices[_0x3e1b('0x12')][_0x3e1b('0xf1')]=function(_0x59e28f){logger[_0x3e1b('0x32')](util[_0x3e1b('0x2c')](_0x3e1b('0xf2'),_0x59e28f[_0x3e1b('0x3a')]));if(!this['isConfigured'](_0x59e28f[_0x3e1b('0xf3')])){return this['channel'][_0x3e1b('0xaa')](_0x3e1b('0xf4'));}if(!this[_0x3e1b('0x81')](_0x59e28f['username'])){return this[_0x3e1b('0xf')]['noop'](_0x3e1b('0xf5'));}if(!this[_0x3e1b('0x81')](_0x59e28f[_0x3e1b('0xf6')])){return this[_0x3e1b('0xf')][_0x3e1b('0xaa')]('no\x20password\x20configured');}if(!this[_0x3e1b('0x81')](_0x59e28f[_0x3e1b('0xf7')])){return this[_0x3e1b('0xf')][_0x3e1b('0xaa')](_0x3e1b('0xab'));}this[_0x3e1b('0xf')][_0x3e1b('0xeb')]=!![];this['createSquareDetailsReport'](_0x59e28f);this[_0x3e1b('0x45')](_0x59e28f['text'],'in');this[_0x3e1b('0xf')][_0x3e1b('0xaa')](util['format']('Trying\x20SestekNDA:\x20%s',_0x59e28f[_0x3e1b('0x5c')]));var _0x2677b5=this[_0x3e1b('0x7a')]['sync'](this,_0x59e28f);if(_0x2677b5){for(var _0x276b6f in _0x2677b5){if(_0x2677b5['hasOwnProperty'](_0x276b6f)){this[_0x3e1b('0xf')][_0x3e1b('0x9c')](util[_0x3e1b('0x2c')](_0x3e1b('0xf8'),_0x276b6f[_0x3e1b('0xf9')]()),_0x2677b5[_0x276b6f]);}}this[_0x3e1b('0x45')](_0x2677b5[_0x3e1b('0xef')],_0x3e1b('0xfa'));if(_0x2677b5['audiofile']){this[_0x3e1b('0xf')][_0x3e1b('0xaa')](util[_0x3e1b('0x2c')](_0x3e1b('0xfb'),_0x2677b5['audiofile']));var _0x41363b=this[_0x3e1b('0xf')][_0x3e1b('0xfc')](_0x2677b5['audiofile']);try{fs[_0x3e1b('0xfd')](_0x2677b5['audiofile']+_0x3e1b('0xfe'));}catch(_0x5dbe8c){logger[_0x3e1b('0x2f')](_0x5dbe8c);}return _0x41363b;}else{return this[_0x3e1b('0xf')]['noop'](util[_0x3e1b('0x2c')](_0x3e1b('0xff'),_0x2677b5[_0x3e1b('0xef')]));}}return this[_0x3e1b('0xf')]['error'](_0x59e28f,_0x3e1b('0x100'));};AGIVertices[_0x3e1b('0x12')][_0x3e1b('0x101')]=function(_0x2e71e1){logger[_0x3e1b('0x32')](util[_0x3e1b('0x2c')](_0x3e1b('0x102'),_0x2e71e1[_0x3e1b('0x3a')]));return this[_0x3e1b('0xf')][_0x3e1b('0xaa')]('end');};AGIVertices['prototype'][_0x3e1b('0x103')]=function(_0x16cbb4){logger['info'](util[_0x3e1b('0x2c')]('Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block',_0x16cbb4[_0x3e1b('0x3a')]));var _0x1c9369='';if(_0x16cbb4[_0x3e1b('0x104')]){if(!this[_0x3e1b('0x81')](_0x16cbb4[_0x3e1b('0x104')])){return this[_0x3e1b('0xf')][_0x3e1b('0x2f')](_0x16cbb4,_0x3e1b('0x105'));}else{var _0x1e32e3=parseInt(_0x16cbb4[_0x3e1b('0x104')],0xa);if(isNaN(_0x1e32e3)){_0x1c9369=_0x16cbb4[_0x3e1b('0x104')];}else{_0x1c9369=this[_0x3e1b('0x106')][_0x3e1b('0x70')](this,_0x16cbb4['trunk_id']);if(!_0x1c9369){return this[_0x3e1b('0xf')][_0x3e1b('0x2f')](_0x16cbb4,_0x3e1b('0x107'));}}}}else if(_0x16cbb4[_0x3e1b('0x108')]){_0x1c9369=_0x16cbb4[_0x3e1b('0x108')];}else{return this[_0x3e1b('0xf')][_0x3e1b('0x2f')](_0x16cbb4,_0x3e1b('0x105'));}var _0x501020=this[_0x3e1b('0xf')]['exec'](_0x3e1b('0xe7'),[util[_0x3e1b('0x2c')](_0x3e1b('0x109'),_0x1c9369,_0x16cbb4['phone']),_0x16cbb4[_0x3e1b('0x66')],_0x16cbb4['opts'],_0x16cbb4[_0x3e1b('0x64')]]);if(_0x501020[_0x3e1b('0xa4')]===-0x1){return _0x501020;}return this[_0x3e1b('0xf')][_0x3e1b('0xaa')](util[_0x3e1b('0x2c')]('Executed\x20command\x20%s',_0x3e1b('0xe7')));};AGIVertices['prototype'][_0x3e1b('0x10a')]=function(_0x1ed7ce){logger[_0x3e1b('0x32')](util[_0x3e1b('0x2c')]('Enter\x20in\x20FINALLY\x20(%s)\x20block',_0x1ed7ce[_0x3e1b('0x3a')]));return this[_0x3e1b('0xf')][_0x3e1b('0xaa')](_0x3e1b('0x10a'));};AGIVertices[_0x3e1b('0x12')]['getdigits']=function(_0x460b64){logger[_0x3e1b('0x32')](util['format'](_0x3e1b('0x10b'),_0x460b64['label']));if(_0x460b64['retry']===0x0){return this[_0x3e1b('0xa6')](_0x460b64);}_0x460b64[_0x3e1b('0xa7')]-=0x1;if(!this['isConfigured'](_0x460b64[_0x3e1b('0x10c')])){return this['channel'][_0x3e1b('0x2f')](_0x460b64,_0x3e1b('0x10d'));}var _0x39bd52=this['getSound'][_0x3e1b('0x70')](this,_0x460b64[_0x3e1b('0x10c')]);if(!_0x39bd52){return this[_0x3e1b('0xf')][_0x3e1b('0x2f')](_0x460b64,_0x3e1b('0x10e'));}if(!this[_0x3e1b('0x81')](_0x460b64[_0x3e1b('0xd9')])){return this['channel'][_0x3e1b('0x2f')](_0x3e1b('0x10f'));}var _0x439db4=this['channel'][_0x3e1b('0x110')](_0x39bd52,_0x460b64['response'],_0x460b64[_0x3e1b('0x111')]);var _0xc01851=_0x439db4[_0x3e1b('0xa4')]?_0x439db4[_0x3e1b('0xa4')][_0x3e1b('0x50')]():'';logger['info'](_0x3e1b('0x112'),JSON[_0x3e1b('0x72')](_0x439db4));if(_0x439db4[_0x3e1b('0xa4')]===-0x1){this[_0x3e1b('0x39')][_0x3e1b('0x70')](this,_0x460b64,_0xc01851);return _0x439db4;}else if(_0x439db4[_0x3e1b('0xa1')]===_0x3e1b('0x66')){_0x439db4[_0x3e1b('0xa4')]=_0xc01851['length']>=parseInt(_0x460b64[_0x3e1b('0x113')])?'x':'i';}else{_0x439db4[_0x3e1b('0xa4')]=_0xc01851[_0x3e1b('0x98')]>=parseInt(_0x460b64['mindigit'])&&_0xc01851['length']<=parseInt(_0x460b64[_0x3e1b('0x111')])?'x':'i';}var _0xacc330=this['getVariable'][_0x3e1b('0x70')](this,_0x460b64[_0x3e1b('0xd9')]);if(!_0xacc330){return this[_0x3e1b('0xf')][_0x3e1b('0x2f')](_0x460b64,_0x3e1b('0xda'));}this[_0x3e1b('0xf')][_0x3e1b('0x9c')](_0xacc330,_0xc01851);if(this[_0x3e1b('0x81')](_0x460b64[_0x3e1b('0x114')])){var _0x9ac798=parseInt(_0x460b64[_0x3e1b('0x114')],0xa);var _0x33ace4=rs[_0x3e1b('0x115')]({'charset':'*','length':_0x9ac798});var _0x2fd183=_0xc01851[_0x3e1b('0x98')];if(_0x2fd183>0x0){if(_0x2fd183>_0x9ac798){this[_0x3e1b('0x39')][_0x3e1b('0x70')](this,_0x460b64,_0x460b64[_0x3e1b('0x116')]===_0x3e1b('0x117')?_0x33ace4+_0xc01851['substr'](_0x9ac798):_0xc01851[_0x3e1b('0x118')](0x0,_0x2fd183-_0x9ac798)+_0x33ace4);}else{this[_0x3e1b('0x39')][_0x3e1b('0x70')](this,_0x460b64,rs[_0x3e1b('0x115')]({'charset':'*','length':_0x2fd183}));}}else{this[_0x3e1b('0x39')][_0x3e1b('0x70')](this,_0x460b64,'');}}else{this[_0x3e1b('0x39')]['sync'](this,_0x460b64,_0xc01851);}return _0x439db4;};AGIVertices[_0x3e1b('0x12')][_0x3e1b('0xe')]=function(_0x6fed65){logger[_0x3e1b('0x32')](util[_0x3e1b('0x2c')](_0x3e1b('0x119'),_0x6fed65['label']));return this[_0x3e1b('0xd')](_0x6fed65);};AGIVertices[_0x3e1b('0x12')][_0x3e1b('0x11a')]=function(_0xfa8f6b){logger[_0x3e1b('0x32')](util['format'](_0x3e1b('0x11b'),_0xfa8f6b['label']));this[_0x3e1b('0x39')][_0x3e1b('0x70')](this,_0xfa8f6b,_0xfa8f6b['goalname']);return this[_0x3e1b('0xf')][_0x3e1b('0xaa')](util[_0x3e1b('0x2c')](_0x3e1b('0x11c'),_0xfa8f6b[_0x3e1b('0x11d')]));};AGIVertices[_0x3e1b('0x12')][_0x3e1b('0x11e')]=function(_0xd3fc31){logger['info'](util['format']('[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block',_0xd3fc31[_0x3e1b('0x3a')]));if(!this[_0x3e1b('0x81')](_0xd3fc31['aws_access_key_id'])||!this[_0x3e1b('0x81')](_0xd3fc31[_0x3e1b('0x84')])){return this['channel']['noop']('no\x20valid\x20credentials\x20configured');}if(!this['isConfigured'](_0xd3fc31[_0x3e1b('0x5c')])){return this[_0x3e1b('0xf')][_0x3e1b('0xaa')](_0x3e1b('0xab'));}this[_0x3e1b('0xf')][_0x3e1b('0xaa')](util[_0x3e1b('0x2c')](_0x3e1b('0x11f'),_0xd3fc31[_0x3e1b('0x5c')]));var _0x285f06=this[_0x3e1b('0x82')][_0x3e1b('0x70')](this,_0xd3fc31);if(_0x285f06){this['channel'][_0x3e1b('0xaa')](util[_0x3e1b('0x2c')]('aws\x20Polly\x20%s\x20file\x20created',_0x285f06));var _0x31e0f2=this[_0x3e1b('0xf')]['streamFile'](_0x285f06);try{fs[_0x3e1b('0xfd')](_0x285f06+_0x3e1b('0xfe'));}catch(_0x1f2c34){logger[_0x3e1b('0x2f')](_0x1f2c34);}return _0x31e0f2;}return this[_0x3e1b('0xf')][_0x3e1b('0x2f')](_0xd3fc31,_0x3e1b('0x120'));};AGIVertices[_0x3e1b('0x12')]['awslex']=function(_0x108d31){logger[_0x3e1b('0x32')](util[_0x3e1b('0x2c')](_0x3e1b('0x121'),_0x108d31[_0x3e1b('0x3a')]));if(!this[_0x3e1b('0x81')](_0x108d31[_0x3e1b('0x83')])||!this[_0x3e1b('0x81')](_0x108d31[_0x3e1b('0x84')])){return this['channel'][_0x3e1b('0xaa')](_0x3e1b('0x122'));}if(!this['isConfigured'](_0x108d31[_0x3e1b('0x89')])){return this[_0x3e1b('0xf')]['noop'](_0x3e1b('0x123'));}if(!this[_0x3e1b('0x81')](_0x108d31[_0x3e1b('0x5c')])){return this[_0x3e1b('0xf')][_0x3e1b('0xaa')]('no\x20text\x20configured');}this[_0x3e1b('0xf')][_0x3e1b('0xeb')]=!![];this[_0x3e1b('0x39')](_0x108d31);this[_0x3e1b('0x45')](_0x108d31[_0x3e1b('0x5c')],'in');this[_0x3e1b('0xf')]['noop'](util['format'](_0x3e1b('0x124'),_0x108d31[_0x3e1b('0x5c')]));var _0x549458=this[_0x3e1b('0x87')][_0x3e1b('0x70')](this,_0x108d31);if(_0x549458){for(var _0x2625f9 in _0x549458){if(_0x549458[_0x3e1b('0x91')](_0x2625f9)&&_[_0x3e1b('0x92')](_0x549458[_0x2625f9])){this[_0x3e1b('0xf')][_0x3e1b('0x9c')](util[_0x3e1b('0x2c')](_0x3e1b('0x125'),_0x2625f9['toUpperCase']()),_0x549458[_0x2625f9]);}}if(_[_0x3e1b('0x4a')](_0x549458[_0x3e1b('0x75')])){return this[_0x3e1b('0xf')]['noop'](_0x3e1b('0x126'));}else{this[_0x3e1b('0x45')](_0x549458[_0x3e1b('0x75')],_0x3e1b('0xfa'));return this[_0x3e1b('0xf')][_0x3e1b('0xaa')](util[_0x3e1b('0x2c')](_0x3e1b('0x127'),_0x549458['message']));}}return this[_0x3e1b('0xf')][_0x3e1b('0x2f')](_0x108d31,'Amazon\x20Lex\x20is\x20unreachable');};AGIVertices['prototype'][_0x3e1b('0x128')]=function(_0x3f926e){logger[_0x3e1b('0x32')](util[_0x3e1b('0x2c')](_0x3e1b('0x129'),_0x3f926e[_0x3e1b('0x3a')],_0x3f926e[_0x3e1b('0x66')]));if(!this[_0x3e1b('0x81')](_0x3f926e['key'])){return this[_0x3e1b('0xf')][_0x3e1b('0xaa')](_0x3e1b('0xea'));}var _0x3d3236=_0x3e1b('0x12a');var _0x1eb81e=util[_0x3e1b('0x2c')](_0x3e1b('0x12b'),FILES_PATH,rs[_0x3e1b('0x115')](0x4));var _0x3ea9b1=util['format'](_0x3e1b('0x9b'),_0x1eb81e,_0x3d3236);var _0x15520a=!![];if(_0x3f926e['beep']===_0x3e1b('0x12c')){_0x15520a=![];}var _0x3ab5f4=this[_0x3e1b('0xf')][_0x3e1b('0x12d')](_0x1eb81e,_0x3d3236,_0x3f926e['intKey'],_0x3f926e[_0x3e1b('0x66')],undefined,_0x15520a);if(_0x3ab5f4['result']!==-0x1){this[_0x3e1b('0xf')][_0x3e1b('0xaa')](util[_0x3e1b('0x2c')]('google\x20%s\x20file\x20created',_0x3ea9b1));var _0x24149a=this[_0x3e1b('0x8a')][_0x3e1b('0x70')](this,_0x3f926e,_0x3ea9b1);if(_0x24149a){for(var _0x34396c in _0x24149a){if(_0x24149a[_0x3e1b('0x91')](_0x34396c)){this[_0x3e1b('0xf')][_0x3e1b('0x9c')](util[_0x3e1b('0x2c')](_0x3e1b('0x12e'),_0x34396c[_0x3e1b('0xf9')]()),_0x24149a[_0x34396c]);}}return this[_0x3e1b('0xf')]['noop'](util[_0x3e1b('0x2c')](_0x3e1b('0x12f'),JSON[_0x3e1b('0x72')](_0x24149a)));}}return _0x3ab5f4;};AGIVertices[_0x3e1b('0x12')]['tildeasr']=function(_0x195516){logger[_0x3e1b('0x32')](util[_0x3e1b('0x2c')](_0x3e1b('0x130'),_0x195516[_0x3e1b('0x3a')]));if(!this['isConfigured'](_0x195516['appid'])){return this[_0x3e1b('0xf')][_0x3e1b('0xaa')](_0x3e1b('0x131'));}if(!this[_0x3e1b('0x81')](_0x195516[_0x3e1b('0x8d')])){return this[_0x3e1b('0xf')][_0x3e1b('0xaa')]('no\x20appsecret\x20configured');}var _0x1ed7bb='wav';var _0x5408d9=util[_0x3e1b('0x2c')](_0x3e1b('0x12b'),FILES_PATH,rs[_0x3e1b('0x115')](0x4));var _0x53d713=util[_0x3e1b('0x2c')](_0x3e1b('0x9b'),_0x5408d9,_0x1ed7bb);var _0x174110=!![];if(_0x195516['beep']===_0x3e1b('0x12c')){_0x174110=![];}var _0x3ee9bf=this['channel']['recordFile'](_0x5408d9,_0x1ed7bb,_0x195516[_0x3e1b('0x132')],_0x195516[_0x3e1b('0x66')],undefined,_0x174110);if(_0x3ee9bf[_0x3e1b('0xa4')]!==-0x1){this['channel'][_0x3e1b('0xaa')](util[_0x3e1b('0x2c')](_0x3e1b('0x133'),_0x53d713));var _0x2c85f8=this['tildeASR'][_0x3e1b('0x70')](this,_0x195516,_0x53d713);if(_0x2c85f8){for(var _0xcd4dde in _0x2c85f8){if(_0x2c85f8[_0x3e1b('0x91')](_0xcd4dde)){this[_0x3e1b('0xf')][_0x3e1b('0x9c')](util[_0x3e1b('0x2c')](_0x3e1b('0x134'),_0xcd4dde[_0x3e1b('0xf9')]()),_0x2c85f8[_0xcd4dde]);}}return this[_0x3e1b('0xf')][_0x3e1b('0xaa')](util[_0x3e1b('0x2c')](_0x3e1b('0x135'),JSON['stringify'](_0x2c85f8)));}}return _0x3ee9bf;};AGIVertices[_0x3e1b('0x12')][_0x3e1b('0x136')]=function(_0xfe5b26){logger[_0x3e1b('0x32')](util[_0x3e1b('0x2c')](_0x3e1b('0x137'),_0xfe5b26[_0x3e1b('0x3a')]));return this['channel'][_0x3e1b('0x138')](_0xfe5b26['context'],_0xfe5b26[_0x3e1b('0x41')],_0xfe5b26[_0x3e1b('0x42')]);};AGIVertices[_0x3e1b('0x12')]['gotoif']=function(_0x55d020){logger['info'](util[_0x3e1b('0x2c')](_0x3e1b('0x139'),_0x55d020['label']));if(!this[_0x3e1b('0x81')](_0x55d020['condition'])){return this[_0x3e1b('0xf')][_0x3e1b('0x2f')](_0x55d020,_0x3e1b('0x13a'));}try{var _0x29cbe4=eval(_0x55d020[_0x3e1b('0x13b')])?'true':_0x3e1b('0x13c');this['channel']['noop'](util['format'](_0x3e1b('0x13d'),_0x55d020[_0x3e1b('0x13b')],_0x29cbe4));return{'code':0xc8,'result':_0x29cbe4};}catch(_0x2f80fd){return{'code':0xc8,'result':_0x3e1b('0x13c')};}};AGIVertices['prototype'][_0x3e1b('0x13e')]=function(_0x3973cd){logger[_0x3e1b('0x32')](util['format'](_0x3e1b('0x13f'),_0x3973cd[_0x3e1b('0x3a')]));if(!this[_0x3e1b('0x81')](_0x3973cd[_0x3e1b('0x140')])){return this[_0x3e1b('0xf')][_0x3e1b('0x2f')](_0x3973cd,_0x3e1b('0x141'));}var _0x14c76d=this['getIntervals'][_0x3e1b('0x70')](this,_0x3973cd[_0x3e1b('0x140')]);if(!_0x14c76d){return this['channel'][_0x3e1b('0x2f')](_0x3973cd,_0x3e1b('0x142'));}for(var _0x2b5cbb=0x0;_0x2b5cbb<_0x14c76d[_0x3e1b('0x98')];_0x2b5cbb+=0x1){var _0x39f077=this[_0x3e1b('0xf')][_0x3e1b('0x13')](util['format']('IFTIME(%s?true:false)',_0x14c76d[_0x2b5cbb]));if(_0x39f077[_0x3e1b('0xa4')]===-0x1){return _0x39f077;}logger[_0x3e1b('0x32')](util[_0x3e1b('0x2c')](_0x3e1b('0x143'),_0x14c76d[_0x2b5cbb],_0x39f077[_0x3e1b('0xa1')]));if(_0x39f077[_0x3e1b('0xa1')]===_0x3e1b('0x144')){logger['info'](util[_0x3e1b('0x2c')]('IFTIME\x20%s\x20%s',_0x14c76d[_0x2b5cbb],_0x3e1b('0x144')));this[_0x3e1b('0xf')][_0x3e1b('0xaa')](util['format'](_0x3e1b('0x143'),_0x14c76d[_0x2b5cbb],_0x3e1b('0x144')));return{'code':0xc8,'result':_0x3e1b('0x144')};}else{logger['info'](util['format'](_0x3e1b('0x143'),_0x14c76d[_0x2b5cbb],_0x3e1b('0x13c')));this[_0x3e1b('0xf')][_0x3e1b('0xaa')](util[_0x3e1b('0x2c')](_0x3e1b('0x143'),_0x14c76d[_0x2b5cbb],_0x3e1b('0x13c')));}}return{'code':0xc8,'result':_0x3e1b('0x13c')};};AGIVertices[_0x3e1b('0x12')][_0x3e1b('0x145')]=function(_0x9eda3a){logger[_0x3e1b('0x32')](util[_0x3e1b('0x2c')]('Enter\x20in\x20HANGUP\x20(%s)\x20block',_0x9eda3a['label']));return this[_0x3e1b('0xf')][_0x3e1b('0x145')]();};AGIVertices[_0x3e1b('0x12')][_0x3e1b('0x146')]=function(_0x3bf9c8){logger[_0x3e1b('0x32')](util['format']('Enter\x20in\x20ISPEECHASR\x20(%s)\x20block',_0x3bf9c8[_0x3e1b('0x3a')]));if(!this[_0x3e1b('0x81')](_0x3bf9c8[_0x3e1b('0x79')])){return this[_0x3e1b('0xf')]['noop'](_0x3e1b('0xea'));}var _0x18afdd='wav';var _0x535d9a=util[_0x3e1b('0x2c')](_0x3e1b('0x12b'),FILES_PATH,rs[_0x3e1b('0x115')](0x4));var _0x59d991=util['format'](_0x3e1b('0x9b'),_0x535d9a,_0x18afdd);var _0x38122b=!![];if(_0x3bf9c8[_0x3e1b('0x147')]===_0x3e1b('0x12c')){_0x38122b=![];}var _0x513765=this[_0x3e1b('0xf')][_0x3e1b('0x12d')](_0x535d9a,_0x18afdd,_0x3bf9c8['intKey'],_0x3bf9c8[_0x3e1b('0x66')],undefined,_0x38122b);if(_0x513765['result']!==-0x1){this[_0x3e1b('0xf')][_0x3e1b('0xaa')](util[_0x3e1b('0x2c')]('ispeech\x20%s\x20file\x20created',_0x59d991));var _0x49521b=this[_0x3e1b('0x7f')][_0x3e1b('0x70')](this,_0x3bf9c8,_0x59d991);if(_0x49521b){for(var _0xcdfbb7 in _0x49521b){if(_0x49521b['hasOwnProperty'](_0xcdfbb7)){this[_0x3e1b('0xf')][_0x3e1b('0x9c')](util[_0x3e1b('0x2c')](_0x3e1b('0x148'),_0xcdfbb7[_0x3e1b('0xf9')]()),_0x49521b[_0xcdfbb7]);}}return this['channel'][_0x3e1b('0xaa')](util['format'](_0x3e1b('0x149'),JSON[_0x3e1b('0x72')](_0x49521b)));}}return _0x513765;};AGIVertices[_0x3e1b('0x12')][_0x3e1b('0x14a')]=function(_0x630c8d){logger['info'](util[_0x3e1b('0x2c')](_0x3e1b('0x14b'),_0x630c8d[_0x3e1b('0x3a')]));if(!this[_0x3e1b('0x81')](_0x630c8d[_0x3e1b('0x79')])){return this[_0x3e1b('0xf')][_0x3e1b('0xaa')]('no\x20key\x20configured');}if(!this['isConfigured'](_0x630c8d['text'])){return this[_0x3e1b('0xf')][_0x3e1b('0xaa')]('no\x20text\x20configured');}this[_0x3e1b('0xf')][_0x3e1b('0xaa')](util[_0x3e1b('0x2c')]('Trying\x20ispeech\x20TTS\x20%s',_0x630c8d['text']));var _0x115564=this[_0x3e1b('0x7b')][_0x3e1b('0x70')](this,_0x630c8d);if(_0x115564){this['channel'][_0x3e1b('0xaa')](util[_0x3e1b('0x2c')](_0x3e1b('0x14c'),_0x115564));var _0xcd5a98=this[_0x3e1b('0xf')][_0x3e1b('0xfc')](_0x115564,_0x630c8d['intKey']);try{fs[_0x3e1b('0xfd')](_0x115564+_0x3e1b('0xfe'));}catch(_0x6cf0b6){logger['error'](_0x6cf0b6);}return _0xcd5a98;}return this[_0x3e1b('0xf')][_0x3e1b('0x2f')](_0x630c8d,'ispeech\x20TTS\x20is\x20unreachable');};AGIVertices[_0x3e1b('0x12')][_0x3e1b('0x14d')]=function(_0x4677de){logger[_0x3e1b('0x32')](util[_0x3e1b('0x2c')](_0x3e1b('0x14e'),_0x4677de['label']));if(!this['isConfigured'](_0x4677de[_0x3e1b('0x14f')])){return this['channel']['error'](_0x4677de,_0x3e1b('0x150'));}logger[_0x3e1b('0x32')](util['format']('FIND\x20AGENT\x20%s\x20BY\x20%s',this[_0x3e1b('0xf')][_0x3e1b('0x3c')],_0x4677de[_0x3e1b('0x14f')]));var _0x429a8a=this[_0x3e1b('0x58')]['sync'](this,_0x4677de[_0x3e1b('0x14f')]);if(_0x429a8a){logger[_0x3e1b('0x32')](util[_0x3e1b('0x2c')](_0x3e1b('0x151'),this[_0x3e1b('0xf')][_0x3e1b('0x3c')],_0x4677de[_0x3e1b('0x14f')]));this['channel'][_0x3e1b('0xaa')](util[_0x3e1b('0x2c')](_0x3e1b('0x151'),this[_0x3e1b('0xf')][_0x3e1b('0x3c')],_0x4677de[_0x3e1b('0x14f')]));return{'code':0xc8,'result':'success'};}else{logger[_0x3e1b('0x32')](util[_0x3e1b('0x2c')](_0x3e1b('0x152'),this[_0x3e1b('0xf')][_0x3e1b('0x3c')],_0x4677de[_0x3e1b('0x14f')]));this[_0x3e1b('0xf')][_0x3e1b('0xaa')](util['format'](_0x3e1b('0x152'),this[_0x3e1b('0xf')]['callerid'],_0x4677de[_0x3e1b('0x14f')]));return{'code':0xc8,'result':_0x3e1b('0x153')};}};AGIVertices[_0x3e1b('0x12')][_0x3e1b('0x154')]=function(_0x520c78){logger[_0x3e1b('0x32')](util[_0x3e1b('0x2c')](_0x3e1b('0x155'),_0x520c78[_0x3e1b('0x3a')]));if(!this[_0x3e1b('0x81')](_0x520c78[_0x3e1b('0x14f')])){return this['channel']['error'](_0x520c78,'no\x20find\x20by\x20configured');}logger[_0x3e1b('0x32')](util[_0x3e1b('0x2c')](_0x3e1b('0x156'),this[_0x3e1b('0xf')]['callerid'],_0x520c78[_0x3e1b('0x14f')]));var _0x3d0ea6=this[_0x3e1b('0x56')][_0x3e1b('0x70')](this,_0x520c78['findBy']);if(_0x3d0ea6){logger[_0x3e1b('0x32')](util[_0x3e1b('0x2c')](_0x3e1b('0x151'),this[_0x3e1b('0xf')]['callerid'],_0x520c78[_0x3e1b('0x14f')]));this[_0x3e1b('0xf')][_0x3e1b('0xaa')](util[_0x3e1b('0x2c')](_0x3e1b('0x151'),this[_0x3e1b('0xf')]['callerid'],_0x520c78[_0x3e1b('0x14f')]));return{'code':0xc8,'result':_0x3e1b('0x157')};}else{logger[_0x3e1b('0x32')](util['format'](_0x3e1b('0x152'),this[_0x3e1b('0xf')]['callerid'],_0x520c78['findBy']));this[_0x3e1b('0xf')][_0x3e1b('0xaa')](util['format'](_0x3e1b('0x152'),this['channel'][_0x3e1b('0x3c')],_0x520c78[_0x3e1b('0x14f')]));return{'code':0xc8,'result':_0x3e1b('0x153')};}};AGIVertices[_0x3e1b('0x12')][_0x3e1b('0x158')]=function(_0x4aa1ef){logger[_0x3e1b('0x32')](util[_0x3e1b('0x2c')]('Enter\x20in\x20MATH\x20(%s)\x20block',_0x4aa1ef[_0x3e1b('0x3a')]));if(!this[_0x3e1b('0x81')](_0x4aa1ef[_0x3e1b('0x159')])){return this[_0x3e1b('0xf')][_0x3e1b('0x2f')](_0x4aa1ef,'no\x20operation\x20configured');}this['channel'][_0x3e1b('0xaa')](util['format'](_0x3e1b('0x15a'),_0x4aa1ef[_0x3e1b('0x159')]));var _0x3f4942=eval(_0x4aa1ef[_0x3e1b('0x159')]);if(!this[_0x3e1b('0x81')](_0x4aa1ef[_0x3e1b('0xd9')])){return this[_0x3e1b('0xf')][_0x3e1b('0xaa')](_0x3e1b('0x10f'));}var _0x2bc8df=this['getVariable'][_0x3e1b('0x70')](this,_0x4aa1ef[_0x3e1b('0xd9')]);if(!_0x2bc8df){return this[_0x3e1b('0xf')][_0x3e1b('0x2f')](_0x4aa1ef,_0x3e1b('0xda'));}if(_[_0x3e1b('0x97')](_0x3f4942)){var _0x214e52=this;_0x3f4942[_0x3e1b('0xdb')](function(_0x97881e,_0x4ed3c3){_0x214e52[_0x3e1b('0xf')][_0x3e1b('0x9c')](util['format'](_0x3e1b('0x15b'),_0x2bc8df,_0x4ed3c3),_0x97881e);});return this['channel'][_0x3e1b('0xaa')](util[_0x3e1b('0x2c')]('variable\x20%s[key]\x20set',_0x2bc8df));}else{return this['channel']['setVariable'](_0x2bc8df,_0x3f4942);}};AGIVertices[_0x3e1b('0x12')][_0x3e1b('0xc')]=function(_0x2e0474){logger[_0x3e1b('0x32')](util['format'](_0x3e1b('0x15c'),_0x2e0474['label']));if(_0x2e0474[_0x3e1b('0xa7')]===0x0){return this[_0x3e1b('0xa6')](_0x2e0474);}_0x2e0474[_0x3e1b('0xa7')]-=0x1;if(!this[_0x3e1b('0x81')](_0x2e0474[_0x3e1b('0x10c')])){return this[_0x3e1b('0xf')][_0x3e1b('0x2f')](_0x2e0474,_0x3e1b('0x10d'));}var _0x344d0e=this[_0x3e1b('0x1f')][_0x3e1b('0x70')](this,_0x2e0474[_0x3e1b('0x10c')]);if(!_0x344d0e){return this['channel'][_0x3e1b('0x2f')](_0x2e0474,_0x3e1b('0x10e'));}var _0x348ae1=this[_0x3e1b('0xf')][_0x3e1b('0x110')](_0x344d0e,_0x2e0474[_0x3e1b('0x15d')],_0x2e0474['digit']);var _0x1ab3f9=_0x348ae1[_0x3e1b('0xa4')];if(_0x348ae1[_0x3e1b('0xa4')]===-0x1){this[_0x3e1b('0x39')][_0x3e1b('0x70')](this,_0x2e0474,'-1');return _0x348ae1;}else if(_0x348ae1[_0x3e1b('0xa1')]==='timeout'){_0x348ae1[_0x3e1b('0xa4')]=_0x348ae1['result'][_0x3e1b('0x98')]>0x0?_0x348ae1[_0x3e1b('0xa4')]:'t';}else if(_[_0x3e1b('0x9a')](_0x348ae1[_0x3e1b('0xa4')])){_0x348ae1[_0x3e1b('0xa4')]='#';_0x1ab3f9='#';}if(!this[_0x3e1b('0x81')](_0x2e0474[_0x3e1b('0xd9')])){this[_0x3e1b('0xf')][_0x3e1b('0xaa')](_0x3e1b('0x10f'));}else{var _0x30c065=this[_0x3e1b('0x13')][_0x3e1b('0x70')](this,_0x2e0474[_0x3e1b('0xd9')]);if(!_0x30c065){return this['channel'][_0x3e1b('0x2f')](_0x2e0474,_0x3e1b('0xda'));}this[_0x3e1b('0xf')][_0x3e1b('0x9c')](_0x30c065,_0x1ab3f9);}this['createSquareDetailsReport']['sync'](this,_0x2e0474,_0x1ab3f9);return _0x348ae1;};AGIVertices[_0x3e1b('0x12')]['noop']=function(_0x2d8105){logger[_0x3e1b('0x32')](util[_0x3e1b('0x2c')](_0x3e1b('0x15e'),_0x2d8105[_0x3e1b('0x3a')]));return this[_0x3e1b('0xf')][_0x3e1b('0xaa')](_0x2d8105['output']||_0x2d8105[_0x3e1b('0x3a')]);};AGIVertices['prototype'][_0x3e1b('0x15f')]=function(_0x3ecf76){logger[_0x3e1b('0x32')](util[_0x3e1b('0x2c')](_0x3e1b('0x160'),_0x3ecf76[_0x3e1b('0x3a')]));if(!this[_0x3e1b('0x81')](_0x3ecf76['findBy'])){return this['channel'][_0x3e1b('0x2f')](_0x3ecf76,'no\x20find\x20by\x20configured');}logger[_0x3e1b('0x32')](util[_0x3e1b('0x2c')](_0x3e1b('0x156'),this[_0x3e1b('0xf')][_0x3e1b('0x3c')],_0x3ecf76[_0x3e1b('0x14f')]));var _0x33c560=this[_0x3e1b('0x52')]['sync'](this,_0x3ecf76[_0x3e1b('0x161')]);var _0x3911ce=this[_0x3e1b('0x53')][_0x3e1b('0x70')](this,_0x3ecf76[_0x3e1b('0x14f')],_0x33c560);if(_0x3911ce){logger['info'](util[_0x3e1b('0x2c')]('AGENT\x20%s\x20FOUND\x20BY',this['channel']['callerid'],_0x3ecf76['findBy']));this[_0x3e1b('0xf')][_0x3e1b('0xaa')](util['format']('AGENT\x20%s\x20FOUND\x20BY',this[_0x3e1b('0xf')]['callerid'],_0x3ecf76[_0x3e1b('0x14f')]));return{'code':0xc8,'result':_0x3e1b('0x157')};}else{logger[_0x3e1b('0x32')](util['format'](_0x3e1b('0x152'),this[_0x3e1b('0xf')][_0x3e1b('0x3c')],_0x3ecf76['findBy']));this['channel'][_0x3e1b('0xaa')](util['format']('AGENT\x20%s\x20FOUND\x20BY',this[_0x3e1b('0xf')][_0x3e1b('0x3c')],_0x3ecf76[_0x3e1b('0x14f')]));return{'code':0xc8,'result':_0x3e1b('0x153')};}};AGIVertices[_0x3e1b('0x12')][_0x3e1b('0x162')]=function(_0x12bab4){logger[_0x3e1b('0x32')](util[_0x3e1b('0x2c')](_0x3e1b('0x163'),_0x12bab4[_0x3e1b('0x3a')]));if(!this[_0x3e1b('0x81')](_0x12bab4[_0x3e1b('0x10c')])){return this[_0x3e1b('0xf')][_0x3e1b('0x2f')](_0x12bab4,'no\x20file\x20audio\x20selected');}var _0x1b71c5=this[_0x3e1b('0x1f')][_0x3e1b('0x70')](this,_0x12bab4['file_id']);if(!_0x1b71c5){return this[_0x3e1b('0xf')][_0x3e1b('0x2f')](_0x12bab4,_0x3e1b('0x10e'));}var _0x4b07ce=this[_0x3e1b('0xf')]['exec']('PLAYBACK',[_0x1b71c5,_0x12bab4[_0x3e1b('0x164')]]);if(_0x4b07ce[_0x3e1b('0xa4')]===-0x1){return _0x4b07ce;}return this['channel'][_0x3e1b('0xaa')](util[_0x3e1b('0x2c')](_0x3e1b('0xc4'),_0x3e1b('0x165'),_0x1b71c5));};AGIVertices[_0x3e1b('0x12')][_0x3e1b('0x166')]=function(_0x99c49d){logger[_0x3e1b('0x32')](util['format'](_0x3e1b('0x167'),_0x99c49d[_0x3e1b('0x3a')]));if(!this[_0x3e1b('0x81')](_0x99c49d[_0x3e1b('0x168')])){return this[_0x3e1b('0xf')]['error'](_0x99c49d,_0x3e1b('0x169'));}var _0x43bcc0='';var _0x306c00=parseInt(_0x99c49d[_0x3e1b('0x168')],0xa);if(isNaN(_0x306c00)){_0x43bcc0=_0x99c49d['queue_id'];}else{_0x43bcc0=this[_0x3e1b('0x18')][_0x3e1b('0x70')](this,_0x99c49d[_0x3e1b('0x168')]);if(!_0x43bcc0){return this[_0x3e1b('0xf')][_0x3e1b('0x2f')](_0x99c49d,_0x3e1b('0x16a'));}}var _0x414a3f='';if(this[_0x3e1b('0x81')](_0x99c49d['file_id'])){var _0x4c2048=this[_0x3e1b('0x1f')][_0x3e1b('0x70')](this,_0x99c49d['file_id']);if(_0x4c2048){_0x414a3f=_0x4c2048;}}this[_0x3e1b('0x39')][_0x3e1b('0x70')](this,_0x99c49d,_0x43bcc0);if(_0x99c49d[_0x3e1b('0x164')]['indexOf']('x')<0x0){_0x99c49d[_0x3e1b('0x164')]+='x';}if(_0x99c49d[_0x3e1b('0x164')][_0x3e1b('0x16b')]('X')<0x0){_0x99c49d[_0x3e1b('0x164')]+='X';}this[_0x3e1b('0xf')][_0x3e1b('0x9c')](_0x3e1b('0x16c'),_0x43bcc0?_0x43bcc0[_0x3e1b('0x16d')]():'');var _0x3ae8f8=this['channel'][_0x3e1b('0x59')]('QUEUE',[_0x43bcc0,_0x99c49d[_0x3e1b('0x164')],_0x99c49d[_0x3e1b('0x64')],_0x414a3f,_0x99c49d['timeout'],_0x99c49d[_0x3e1b('0x8')],_0x99c49d[_0x3e1b('0x16e')],_0x99c49d[_0x3e1b('0x16f')],'',_0x99c49d['position']]);if(_0x3ae8f8[_0x3e1b('0xa4')]===-0x1){return _0x3ae8f8;}return this['channel'][_0x3e1b('0xaa')](util[_0x3e1b('0x2c')](_0x3e1b('0xc4'),'QUEUE',_0x43bcc0));};AGIVertices[_0x3e1b('0x12')]['record']=function(_0x82537e){logger[_0x3e1b('0x32')](util['format'](_0x3e1b('0x170'),_0x82537e[_0x3e1b('0x3a')]));var _0x1d59ef=_0x82537e['recordingFormat']||_0x3e1b('0x12a');var _0x193ceb=util['format'](_0x3e1b('0x171'),this[_0x3e1b('0xf')][_0x3e1b('0x3e')],rs[_0x3e1b('0x115')](0x5));var _0xe08e7b=util[_0x3e1b('0x2c')]('%s/recordings/%s.%s',FILES_PATH,_0x193ceb,_0x1d59ef);var _0x172b42=util[_0x3e1b('0x2c')](_0x3e1b('0x12b'),FILES_PATH,_0x193ceb);this[_0x3e1b('0x3d')][_0x3e1b('0x70')](this,_0x82537e,_0x193ceb,_0xe08e7b);this[_0x3e1b('0xf')][_0x3e1b('0x9c')](_0x3e1b('0x172'),_0x193ceb);logger[_0x3e1b('0x32')]('Recording\x20%s\x20%s\x20%s\x20%s',_0x172b42,_0x1d59ef,_0x82537e[_0x3e1b('0x173')],_0x82537e[_0x3e1b('0x66')]);return this['channel']['recordFile'](_0x172b42,_0x1d59ef,_0x82537e['escape_digits'],_0x82537e[_0x3e1b('0x66')],undefined,!![]);};AGIVertices[_0x3e1b('0x12')][_0x3e1b('0x174')]=function(_0x5d64ee){logger[_0x3e1b('0x32')](util['format'](_0x3e1b('0x175'),_0x5d64ee['label']));if(!this[_0x3e1b('0x81')](_0x5d64ee[_0x3e1b('0x64')])){return this[_0x3e1b('0xf')][_0x3e1b('0xaa')](_0x3e1b('0x176'));}var _0x20f7d2=this[_0x3e1b('0x63')]['sync'](this,_0x5d64ee);logger[_0x3e1b('0x32')](util[_0x3e1b('0x2c')](_0x3e1b('0x177'),util[_0x3e1b('0x178')](_0x20f7d2,{'showHidden':![],'depth':null})));if(!this[_0x3e1b('0x81')](_0x5d64ee[_0x3e1b('0xd9')])){return this['channel']['noop']('no\x20variable\x20selected\x20for\x20the\x20response');}var _0x220bcc=this[_0x3e1b('0x13')][_0x3e1b('0x70')](this,_0x5d64ee[_0x3e1b('0xd9')]);if(!_0x220bcc){return this['channel'][_0x3e1b('0x2f')](_0x5d64ee,_0x3e1b('0xda'));}this[_0x3e1b('0xf')][_0x3e1b('0x9c')](util['format'](_0x3e1b('0x179'),_0x220bcc),_0x20f7d2[_0x3e1b('0x17a')]?_0x20f7d2[_0x3e1b('0x17a')]:'200');this[_0x3e1b('0xf')][_0x3e1b('0x9c')](util[_0x3e1b('0x2c')](_0x3e1b('0x17b'),_0x220bcc),_0x20f7d2[_0x3e1b('0x74')]?_0x20f7d2['statusMessage']:'OK');if(_0x20f7d2[_0x3e1b('0x69')]){try{this['saveRestApiResult'](_0x20f7d2[_0x3e1b('0x69')],_0x220bcc);}catch(_0x5b39d1){logger[_0x3e1b('0x2f')](util['format'](_0x3e1b('0x17c'),_0x220bcc));}}return this[_0x3e1b('0xf')][_0x3e1b('0xaa')](util[_0x3e1b('0x2c')](_0x3e1b('0xdf'),_0x220bcc));};AGIVertices[_0x3e1b('0x12')]['saydigits']=function(_0x39140f){logger[_0x3e1b('0x32')](util[_0x3e1b('0x2c')](_0x3e1b('0x17d'),_0x39140f[_0x3e1b('0x3a')]));return this[_0x3e1b('0xf')]['sayDigits'](_0x39140f[_0x3e1b('0x17e')][_0x3e1b('0xd7')](/\s+/g,''),_0x39140f[_0x3e1b('0x173')]);};AGIVertices[_0x3e1b('0x12')][_0x3e1b('0x17f')]=function(_0xeb0298){logger['info'](util[_0x3e1b('0x2c')](_0x3e1b('0x180'),_0xeb0298[_0x3e1b('0x3a')]));return this[_0x3e1b('0xf')][_0x3e1b('0x181')](_0xeb0298['number'][_0x3e1b('0xd7')](/\s+/g,''),_0xeb0298[_0x3e1b('0x173')]);};AGIVertices[_0x3e1b('0x12')][_0x3e1b('0x182')]=function(_0x517889){logger[_0x3e1b('0x32')](util[_0x3e1b('0x2c')](_0x3e1b('0x183'),_0x517889[_0x3e1b('0x3a')]));return this['channel'][_0x3e1b('0x184')](_0x517889['text'],_0x517889[_0x3e1b('0x173')]);};AGIVertices[_0x3e1b('0x12')]['sendMail']=function(_0x550df5){logger[_0x3e1b('0x32')](util[_0x3e1b('0x2c')]('Enter\x20in\x20SENDMAIL\x20(%s)\x20block',_0x550df5[_0x3e1b('0x3a')]));if(!this[_0x3e1b('0x81')](_0x550df5[_0x3e1b('0x185')])){return this[_0x3e1b('0xf')][_0x3e1b('0xaa')](_0x3e1b('0x186'));}var _0x167afd=this[_0x3e1b('0x22')][_0x3e1b('0x70')](this,_0x550df5['account_id']);if(!_0x167afd||!_0x167afd['Smtp']){return this[_0x3e1b('0xf')][_0x3e1b('0x2f')](_0x550df5,'no\x20mail\x20account\x20found');}var _0x2551e8={'from':util[_0x3e1b('0x2c')]('\x22%s\x22\x20<%s>',_0x167afd[_0x3e1b('0x16')],_0x167afd[_0x3e1b('0x187')]||_0x167afd[_0x3e1b('0x188')][_0x3e1b('0x189')]),'to':_0x550df5['to']||'','cc':_0x550df5['cc']||'','bcc':_0x550df5[_0x3e1b('0x18a')]||'','subject':_0x550df5[_0x3e1b('0x18b')],'html':_0x550df5[_0x3e1b('0x5c')],'text':_0x550df5[_0x3e1b('0x5c')]};var _0x551d31={'tls':{'rejectUnauthorized':![]}};if(_0x167afd['Smtp'][_0x3e1b('0x18c')]){_0x551d31['service']=_0x167afd[_0x3e1b('0x188')]['service'];}else{_0x551d31[_0x3e1b('0x18d')]=_0x167afd[_0x3e1b('0x188')][_0x3e1b('0x18d')];_0x551d31[_0x3e1b('0x18e')]=_0x167afd[_0x3e1b('0x188')]['port'];_0x551d31[_0x3e1b('0x18f')]=_0x167afd[_0x3e1b('0x188')][_0x3e1b('0x18f')];}if(_0x167afd[_0x3e1b('0x188')][_0x3e1b('0x190')]){_0x551d31[_0x3e1b('0x191')]={'user':_0x167afd[_0x3e1b('0x188')]['user'],'pass':_0x167afd[_0x3e1b('0x188')][_0x3e1b('0x192')]};}if(this[_0x3e1b('0x81')](_0x550df5[_0x3e1b('0x193')])){}logger['debug'](_0x3e1b('0x194'),JSON[_0x3e1b('0x72')](_0x2551e8));this[_0x3e1b('0x39')][_0x3e1b('0x70')](this,_0x550df5,_0x550df5[_0x3e1b('0x185')]);this['channel'][_0x3e1b('0xaa')](util['format']('Trying\x20SendMail\x20with\x20account\x20%s',_0x167afd[_0x3e1b('0x16')]));this['sendMailMessage'][_0x3e1b('0x70')](this,_0x551d31,_0x2551e8);return this[_0x3e1b('0xf')]['noop'](_0x3e1b('0x195'));};AGIVertices['prototype']['sendFax']=function(_0x39d035){logger[_0x3e1b('0x32')](util[_0x3e1b('0x2c')](_0x3e1b('0x196'),_0x39d035[_0x3e1b('0x3a')]));return this['channel'][_0x3e1b('0xaa')](_0x3e1b('0x197'));};AGIVertices[_0x3e1b('0x12')]['sendSMS']=function(_0x3e2620){logger[_0x3e1b('0x32')](util[_0x3e1b('0x2c')](_0x3e1b('0x198'),_0x3e2620[_0x3e1b('0x3a')]));if(!this[_0x3e1b('0x81')](_0x3e2620[_0x3e1b('0x199')])){return this[_0x3e1b('0xf')][_0x3e1b('0xaa')](_0x3e1b('0x19a'));}var _0x5d6a05=this[_0x3e1b('0x37')][_0x3e1b('0x70')](this,_0x3e2620['sms_account_id']);if(!_0x5d6a05){return this[_0x3e1b('0xf')][_0x3e1b('0x2f')](_0x3e2620,_0x3e1b('0x19b'));}var _0x3a17b5={'body':_0x3e2620[_0x3e1b('0x19c')],'phone':_0x3e2620['to']||'','SmsAccountId':_0x5d6a05['id']};logger['debug'](_0x3e1b('0x19d'),JSON[_0x3e1b('0x72')](_0x3a17b5));this[_0x3e1b('0x39')][_0x3e1b('0x70')](this,_0x3e2620,_0x3e2620[_0x3e1b('0x199')]);this[_0x3e1b('0xf')]['noop'](util[_0x3e1b('0x2c')](_0x3e1b('0x19e'),_0x5d6a05['name']));this[_0x3e1b('0x38')][_0x3e1b('0x70')](this,_0x3a17b5);return this[_0x3e1b('0xf')]['noop'](_0x3e1b('0x19f'));};AGIVertices['prototype'][_0x3e1b('0x1a0')]=function(_0x2b1ec7){logger['info'](util['format'](_0x3e1b('0x1a1'),_0x2b1ec7[_0x3e1b('0x3a')]));if(!this[_0x3e1b('0x81')](_0x2b1ec7[_0x3e1b('0xd9')])){return this[_0x3e1b('0xf')][_0x3e1b('0x2f')](_0x2b1ec7,_0x3e1b('0x1a2'));}var _0x4ef0ec=this[_0x3e1b('0x13')][_0x3e1b('0x70')](this,_0x2b1ec7[_0x3e1b('0xd9')]);if(!_0x4ef0ec){return this['channel']['error'](_0x2b1ec7,'no\x20variable\x20found');}return this['channel'][_0x3e1b('0x9c')](_0x4ef0ec,_0x2b1ec7[_0x3e1b('0x1a3')]);};AGIVertices['prototype'][_0x3e1b('0x1a4')]=function(_0x140935){logger[_0x3e1b('0x32')](util[_0x3e1b('0x2c')](_0x3e1b('0x1a5'),_0x140935[_0x3e1b('0x3a')]));this[_0x3e1b('0xf')][_0x3e1b('0xaa')]('START\x20CALLY\x20SQUARE');if(_0x140935[_0x3e1b('0xb8')]===_0x3e1b('0x1a6')){this['channel'][_0x3e1b('0xaa')](_0x3e1b('0x1a7'));return this[_0x3e1b('0xf')][_0x3e1b('0xb8')]();}return this[_0x3e1b('0xf')]['noop'](_0x3e1b('0x1a8'));};AGIVertices['prototype'][_0x3e1b('0x1a9')]=function(_0x4059e9){logger['info'](util[_0x3e1b('0x2c')](_0x3e1b('0x1aa'),_0x4059e9[_0x3e1b('0x3a')]));if(!this[_0x3e1b('0x81')](_0x4059e9[_0x3e1b('0x1ab')])){return this[_0x3e1b('0xf')][_0x3e1b('0x2f')](_0x4059e9,_0x3e1b('0x1ac'));}var _0x5527b6=this['getSquareProject'][_0x3e1b('0x70')](this,_0x4059e9[_0x3e1b('0x1ab')]);if(!this[_0x3e1b('0x81')](_0x5527b6)){return this['channel'][_0x3e1b('0x2f')](_0x4059e9,util[_0x3e1b('0x2c')](_0x3e1b('0x1ad'),_0x4059e9[_0x3e1b('0x1ab')]));}if(_0x5527b6===this['channel']['arg_1']){return this[_0x3e1b('0xf')][_0x3e1b('0x2f')](_0x4059e9,_0x3e1b('0x1ae'));}this[_0x3e1b('0x39')][_0x3e1b('0x70')](this,_0x4059e9,_0x5527b6);var _0x4d7c14=this['channel'][_0x3e1b('0x59')](_0x3e1b('0x1af'),util[_0x3e1b('0x2c')](_0x3e1b('0x1b0'),config[_0x3e1b('0x8')][_0x3e1b('0x18d')]||'127.0.0.1',_0x5527b6,this[_0x3e1b('0xf')][_0x3e1b('0x1b1')]));if(_0x4d7c14[_0x3e1b('0xa4')]===-0x1){return _0x4d7c14;}return this[_0x3e1b('0xf')]['noop'](util[_0x3e1b('0x2c')](_0x3e1b('0xc4'),'AGI',_0x5527b6));};AGIVertices['prototype'][_0x3e1b('0x1b2')]=function(_0x1538fb){logger['info'](util[_0x3e1b('0x2c')](_0x3e1b('0x1b3'),_0x1538fb[_0x3e1b('0x3a')]));var _0x383c1f=this[_0x3e1b('0x1b4')][_0x3e1b('0x70')](this,_0x1538fb[_0x3e1b('0xb6')]);this['createSquareDetailsReport'][_0x3e1b('0x70')](this,_0x1538fb,_0x1538fb[_0x3e1b('0xb6')]);if(this[_0x3e1b('0x81')](_0x1538fb[_0x3e1b('0xd9')])){var _0x10795e=this[_0x3e1b('0x13')][_0x3e1b('0x70')](this,_0x1538fb[_0x3e1b('0xd9')]);if(_0x10795e){this['channel']['setVariable'](_0x10795e,_0x383c1f);return this[_0x3e1b('0xf')][_0x3e1b('0xaa')](util[_0x3e1b('0x2c')](_0x3e1b('0x1b5'),_0x1538fb['command'],_0x10795e));}}return this[_0x3e1b('0xf')][_0x3e1b('0xaa')](util['format'](_0x3e1b('0x1b6'),_0x1538fb[_0x3e1b('0xb6')]));};AGIVertices[_0x3e1b('0x12')][_0x3e1b('0x1b7')]=function(_0x5883ac){logger[_0x3e1b('0x32')](util['format'](_0x3e1b('0x1b8'),_0x5883ac[_0x3e1b('0x3a')]));_0x5883ac[_0x3e1b('0x5c')]=_0x5883ac['text'][_0x3e1b('0xd7')](/(\r\n|\n|\r)/gm,'\x20');if(!this['isConfigured'](_0x5883ac[_0x3e1b('0x1b9')])){return this[_0x3e1b('0xf')][_0x3e1b('0xaa')](_0x3e1b('0x1ba'));}if(!this['isConfigured'](_0x5883ac['text'])){return this[_0x3e1b('0xf')]['noop']('no\x20text\x20configured');}this['channel'][_0x3e1b('0xaa')](util['format'](_0x3e1b('0x1bb'),_0x5883ac[_0x3e1b('0x5c')]));var _0x2576ef=this[_0x3e1b('0x5b')][_0x3e1b('0x70')](this,_0x5883ac);if(_0x2576ef){this[_0x3e1b('0xf')][_0x3e1b('0xaa')](util['format'](_0x3e1b('0x1bc'),_0x2576ef));var _0x22cd90=this[_0x3e1b('0xf')]['streamFile'](_0x2576ef);try{fs[_0x3e1b('0xfd')](_0x2576ef+'.wav');}catch(_0xb5e82f){logger[_0x3e1b('0x2f')](_0xb5e82f);}return _0x22cd90;}return this[_0x3e1b('0xf')][_0x3e1b('0x2f')](_0x5883ac,_0x3e1b('0x1bd'));};AGIVertices[_0x3e1b('0x12')]['tts']=function(_0x175fed){logger[_0x3e1b('0x32')](util[_0x3e1b('0x2c')]('Enter\x20in\x20GOOGLETTS\x20(%s)\x20block',_0x175fed[_0x3e1b('0x3a')]));_0x175fed[_0x3e1b('0x5c')]=_0x175fed[_0x3e1b('0x5c')][_0x3e1b('0xd7')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0x3e1b('0x81')](_0x175fed[_0x3e1b('0x5c')])){return this[_0x3e1b('0xf')][_0x3e1b('0xaa')](_0x3e1b('0xab'));}this['channel'][_0x3e1b('0xaa')](util['format'](_0x3e1b('0x1be'),_0x175fed[_0x3e1b('0x5c')]));var _0x8574d7=this['googleTTS']['sync'](this,_0x175fed);if(_0x8574d7){this[_0x3e1b('0xf')][_0x3e1b('0xaa')](util[_0x3e1b('0x2c')](_0x3e1b('0x1bf'),_0x8574d7));var _0x4b8940=this['channel'][_0x3e1b('0xfc')](_0x8574d7);try{fs['unlink'](_0x8574d7+'.wav');}catch(_0x513494){logger[_0x3e1b('0x2f')](_0x513494);}return _0x4b8940;}return this[_0x3e1b('0xf')][_0x3e1b('0x2f')](_0x175fed,_0x3e1b('0x1c0'));};AGIVertices[_0x3e1b('0x12')]['unpause']=function(_0x22d156){logger[_0x3e1b('0x32')](util[_0x3e1b('0x2c')](_0x3e1b('0x1c1'),_0x22d156['label']));if(!this['isConfigured'](_0x22d156[_0x3e1b('0x14f')])){return this[_0x3e1b('0xf')][_0x3e1b('0x2f')](_0x22d156,_0x3e1b('0x150'));}logger[_0x3e1b('0x32')](util[_0x3e1b('0x2c')](_0x3e1b('0x156'),this[_0x3e1b('0xf')][_0x3e1b('0x3c')],_0x22d156[_0x3e1b('0x14f')]));var _0x1cdaca=this['agentUnpause'][_0x3e1b('0x70')](this,_0x22d156[_0x3e1b('0x14f')]);if(_0x1cdaca){logger['info'](util['format'](_0x3e1b('0x151'),this[_0x3e1b('0xf')]['callerid'],_0x22d156[_0x3e1b('0x14f')]));this[_0x3e1b('0xf')][_0x3e1b('0xaa')](util['format']('AGENT\x20%s\x20FOUND\x20BY',this[_0x3e1b('0xf')]['callerid'],_0x22d156['findBy']));return{'code':0xc8,'result':_0x3e1b('0x157')};}else{logger[_0x3e1b('0x32')](util[_0x3e1b('0x2c')](_0x3e1b('0x152'),this[_0x3e1b('0xf')][_0x3e1b('0x3c')],_0x22d156[_0x3e1b('0x14f')]));this[_0x3e1b('0xf')][_0x3e1b('0xaa')](util[_0x3e1b('0x2c')](_0x3e1b('0x152'),this['channel'][_0x3e1b('0x3c')],_0x22d156['findBy']));return{'code':0xc8,'result':'failure'};}};AGIVertices[_0x3e1b('0x12')][_0x3e1b('0x1c2')]=function(_0x44d471){logger[_0x3e1b('0x32')](util['format'](_0x3e1b('0x1c3'),_0x44d471[_0x3e1b('0x3a')]));var _0x19c779=this[_0x3e1b('0xf')]['exec'](_0x3e1b('0x1c4'),[_0x44d471['mailbox'],_0x44d471[_0x3e1b('0x77')]]);if(_0x19c779[_0x3e1b('0xa4')]===-0x1){return _0x19c779;}return this[_0x3e1b('0xf')][_0x3e1b('0xaa')](util[_0x3e1b('0x2c')](_0x3e1b('0xc4'),_0x3e1b('0x1c4'),_0x44d471[_0x3e1b('0x1c5')]));};AGIVertices['prototype'][_0x3e1b('0x1c6')]=function(_0x45f642){logger['info'](util[_0x3e1b('0x2c')](_0x3e1b('0x1c7'),_0x45f642[_0x3e1b('0x3a')]));if(!this[_0x3e1b('0x81')](_0x45f642['variable_id'])){return this[_0x3e1b('0xf')][_0x3e1b('0x2f')](_0x45f642,'no\x20variable\x20selected');}var _0x506c7a=this[_0x3e1b('0x13')]['sync'](this,_0x45f642[_0x3e1b('0xd9')]);if(!_0x506c7a){return this[_0x3e1b('0xf')][_0x3e1b('0x2f')](_0x45f642,'no\x20variable\x20found');}var _0x12df8f=this[_0x3e1b('0xf')][_0x3e1b('0x13')](_0x506c7a);return{'code':0xc8,'result':_0x12df8f[_0x3e1b('0xa1')]?_0x12df8f[_0x3e1b('0xa1')]:'-'};};String[_0x3e1b('0x12')][_0x3e1b('0xa0')]=function(_0x3289f7,_0x418b7f){return this[_0x3e1b('0x9e')](_0x3289f7)[_0x3e1b('0x1c8')](_0x418b7f);};module[_0x3e1b('0x1c9')]=AGIVertices;
\ No newline at end of file
diff --git a/server/services/ami/acw/index.js b/server/services/ami/acw/index.js
index b737999..4151a97 100644
--- a/server/services/ami/acw/index.js
+++ b/server/services/ami/acw/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xb903=['attended','destlinkedid','savePause','info','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','timer','stopAcw','acwTimeout','lastPauseAt','YYYY-MM-DD\x20HH:mm:ss','uniqueid','queue','updateAcw','[%s][UPDATE][ACWTIME:%s]','error','[%s][UPDATE][ERRORS:%s]','[%s][INPAUSE][AGENT:%s][QUEUE:%s]','catch','finally','[ACW][START]\x20%s','[TIMER][STOP][AGENT:%s]','saveUnpause','update','[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer','[ACW][TIMERS]','stringify','[ACW][STOP]\x20%s','message','interface','[ACW][syncAgentConnect]\x20%s','syncAgentConnectPreview','[ACW][syncAgentConnectPreview]\x20%s','syncHangupRequest','isUndefined','[%s][HANGUP:UNIQUEID]','linkedid','[%s][HANGUP:LINKEDID]','[ACW][syncHangupRequest]\x20%s','syncHangup','isNil','transfereeuniqueid','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','[ACW][syncAttendedTransfer]\x20%s','transfereruniqueid','[%s][BLINDTRANSFER:UNIQUEID]','transfererlinkedid','[%s][BLINDTRANSFER:LINKEDID]','[ACW][syncBlindTransfer]\x20%s','all','Auto-Pause','exports','util','lodash','moment','../ami','acw','../rpc/user','../rpc/voiceAgentReport','voiceQueues','agents','timers','agentconnect','syncAgentConnect','bind','hanguprequest','syncAgentRingNoAnswer','syncAttendedTransfer','syncBlindTransfer','custom:agentConnectPreview','milliseconds','prototype','startAcw','channels','mandatoryDisposition','name','mandatoryDispositionPause','Action','QueuePause','then','getAgent','voicePause','[%s][START][AGENT:%s][QUEUE:%s]'];(function(_0x456ce4,_0x147b6){var _0x506003=function(_0x4361bd){while(--_0x4361bd){_0x456ce4['push'](_0x456ce4['shift']());}};_0x506003(++_0x147b6);}(_0xb903,0x185));var _0x3b90=function(_0x40846d,_0x5e82b6){_0x40846d=_0x40846d-0x0;var _0xe0fc33=_0xb903[_0x40846d];return _0xe0fc33;};'use strict';var util=require(_0x3b90('0x0'));var _=require(_0x3b90('0x1'));var moment=require(_0x3b90('0x2'));var ami=require(_0x3b90('0x3'));var logger=require('../../../config/logger')(_0x3b90('0x4'));var RpcUser=require(_0x3b90('0x5'));var RpcVoiceAgentReport=require(_0x3b90('0x6'));function Acw(_0x1cd5d8){this[_0x3b90('0x7')]=_0x1cd5d8[_0x3b90('0x7')];this[_0x3b90('0x8')]=_0x1cd5d8['agents'];this[_0x3b90('0x9')]=_0x1cd5d8['timers'];this['channels']={};ami['on'](_0x3b90('0xa'),this[_0x3b90('0xb')][_0x3b90('0xc')](this));ami['on'](_0x3b90('0xd'),this['syncHangupRequest']['bind'](this));ami['on']('hangup',this['syncHangup']['bind'](this));ami['on']('agentringnoanswer',this[_0x3b90('0xe')][_0x3b90('0xc')](this));ami['on']('attendedtransfer',this[_0x3b90('0xf')][_0x3b90('0xc')](this));ami['on']('blindtransfer',this[_0x3b90('0x10')][_0x3b90('0xc')](this));ami['on'](_0x3b90('0x11'),this['syncAgentConnectPreview']['bind'](this));}function getDiff(_0x58c4d1){var _0x542cb3=moment()['milliseconds'](0x0);var _0x3a0a55=moment(_0x58c4d1)[_0x3b90('0x12')](0x0);return _0x542cb3['diff'](_0x3a0a55,'seconds');}Acw[_0x3b90('0x13')][_0x3b90('0x14')]=function(_0x381a9e){try{var _0x1af265=this;var _0x1efe01=this['channels'][_0x381a9e]['interface'];var _0xd83280=this[_0x3b90('0x15')][_0x381a9e]['queue'];var _0x269488=this[_0x3b90('0x7')][_0xd83280];var _0x11ad7d=![];var _0x131f3f='ACW';if(_0x269488[_0x3b90('0x16')]){if(_0x269488['mandatoryDispositionPause'][_0x3b90('0x17')]){_0x11ad7d=!![];_0x131f3f=_0x269488[_0x3b90('0x18')]['name'];}}ami[_0x3b90('0x19')]({'action':_0x3b90('0x1a'),'interface':_0x1efe01,'paused':!![],'reason':_0x131f3f})[_0x3b90('0x1b')](function(_0x3ce411){if(_0x1af265[_0x3b90('0x8')][_0x1efe01]){return RpcUser[_0x3b90('0x1c')](_0x1af265[_0x3b90('0x8')][_0x1efe01]['id'])[_0x3b90('0x1b')](function(_0xa98414){if(_0xa98414&&!_0xa98414[_0x3b90('0x1d')]){logger['info'](_0x3b90('0x1e'),_0x381a9e,_0x1efe01,_0xd83280);var _0x36b93e=_0x1af265[_0x3b90('0x15')][_0x381a9e][_0x3b90('0x1f')]&&_0x1af265[_0x3b90('0x15')][_0x381a9e][_0x3b90('0x20')]?_0x1af265['channels'][_0x381a9e]['destlinkedid']:_0x381a9e;return RpcUser[_0x3b90('0x21')](_0x1af265[_0x3b90('0x8')][_0x1efe01],_0x131f3f,_0x36b93e)[_0x3b90('0x1b')](function(_0x2ffa1a){if(!_0x11ad7d){_0x1af265['timers'][_0x1efe01]={};logger[_0x3b90('0x22')](_0x3b90('0x23'),_0x381a9e,_0x1af265[_0x3b90('0x7')][_0xd83280]['acwTimeout'],_0x1efe01,_0xd83280);_0x1af265[_0x3b90('0x9')][_0x1efe01][_0x3b90('0x24')]=setTimeout(_0x1af265[_0x3b90('0x25')][_0x3b90('0xc')](_0x1af265,_0x1efe01),_0x1af265[_0x3b90('0x7')][_0xd83280][_0x3b90('0x26')]*0x3e8);_0x1af265['timers'][_0x1efe01][_0x3b90('0x27')]=moment()['format'](_0x3b90('0x28'));_0x1af265[_0x3b90('0x9')][_0x1efe01][_0x3b90('0x29')]=_0x381a9e;_0x1af265[_0x3b90('0x9')][_0x1efe01][_0x3b90('0x2a')]=_0xd83280;_0x1af265[_0x3b90('0x9')][_0x1efe01][_0x3b90('0x2b')]=function(){var _0x2430ec=getDiff(_0x1af265['timers'][_0x1efe01]['lastPauseAt']);clearTimeout(_0x1af265[_0x3b90('0x9')][_0x1efe01][_0x3b90('0x24')]);_0x1af265[_0x3b90('0x9')][_0x1efe01][_0x3b90('0x24')]=![];RpcVoiceAgentReport['update']({'acwtime':_0x2430ec},_0x1af265['timers'][_0x1efe01][_0x3b90('0x29')],_0x1efe01)[_0x3b90('0x1b')](function(_0x24d5c9){logger['info'](_0x3b90('0x2c'),_0x381a9e,_0x2430ec,_0x24d5c9);})['catch'](function(_0x49b4d2){logger[_0x3b90('0x2d')](_0x3b90('0x2e'),_0x381a9e,_0x49b4d2);});delete _0x1af265['timers'][_0x1efe01];};}});}else{logger[_0x3b90('0x22')](_0x3b90('0x2f'),_0x381a9e,_0x1efe01,_0xd83280);}});}})[_0x3b90('0x30')](function(_0x562882){logger['error'](_0x3b90('0x23'),_0x381a9e,_0x1af265[_0x3b90('0x7')][_0xd83280][_0x3b90('0x26')],_0x1efe01,_0xd83280);})[_0x3b90('0x31')](function(){delete _0x1af265['channels'][_0x381a9e];});}catch(_0x5a97fe){logger[_0x3b90('0x2d')](_0x3b90('0x32'),_0x5a97fe['message']);}};Acw['prototype'][_0x3b90('0x25')]=function(_0x146bc7){try{var _0x20416d=this;if(_0x20416d[_0x3b90('0x9')][_0x146bc7]){_0x20416d['timers'][_0x146bc7][_0x3b90('0x24')]=![];var _0x583842=_0x20416d[_0x3b90('0x9')][_0x146bc7][_0x3b90('0x29')];var _0x2355bf=_0x20416d[_0x3b90('0x9')][_0x146bc7][_0x3b90('0x2a')];var _0x3bf148=_0x20416d[_0x3b90('0x7')][_0x2355bf]['acwTimeout'];logger[_0x3b90('0x22')](_0x3b90('0x33'),_0x146bc7);RpcUser[_0x3b90('0x34')](this[_0x3b90('0x8')][_0x146bc7]);RpcVoiceAgentReport[_0x3b90('0x35')]({'acwtime':_0x3bf148,'agentacw':!![]},_0x583842,_0x146bc7)[_0x3b90('0x1b')](function(_0x63c44e){logger[_0x3b90('0x22')](_0x3b90('0x2c'),_0x583842,_0x3bf148,_0x63c44e);})['catch'](function(_0x369d0d){logger[_0x3b90('0x2d')](_0x3b90('0x2e'),_0x583842,_0x369d0d);});}else{logger[_0x3b90('0x2d')](_0x3b90('0x36'),_0x146bc7);if(_0x20416d[_0x3b90('0x9')]){logger[_0x3b90('0x22')](_0x3b90('0x37'),JSON[_0x3b90('0x38')](_0x20416d[_0x3b90('0x9')]));}}}catch(_0x47592a){logger[_0x3b90('0x2d')](_0x3b90('0x39'),_0x47592a[_0x3b90('0x3a')]);}};Acw[_0x3b90('0x13')][_0x3b90('0xb')]=function(_0x3a27cf){try{if(this[_0x3b90('0x7')][_0x3a27cf[_0x3b90('0x2a')]]&&(this[_0x3b90('0x7')][_0x3a27cf[_0x3b90('0x2a')]]['acw']||this[_0x3b90('0x7')][_0x3a27cf[_0x3b90('0x2a')]][_0x3b90('0x16')])){if(this[_0x3b90('0x8')][_0x3a27cf['interface']]){this[_0x3b90('0x15')][_0x3a27cf['uniqueid']]={'queue':_0x3a27cf['queue'],'interface':_0x3a27cf[_0x3b90('0x3b')],'destlinkedid':_0x3a27cf[_0x3b90('0x20')]};}}}catch(_0x49187d){logger[_0x3b90('0x2d')](_0x3b90('0x3c'),_0x49187d[_0x3b90('0x3a')]);}};Acw[_0x3b90('0x13')][_0x3b90('0x3d')]=function(_0x3fd5a1){try{if(this[_0x3b90('0x7')][_0x3fd5a1[_0x3b90('0x2a')]]&&(this[_0x3b90('0x7')][_0x3fd5a1['queue']][_0x3b90('0x4')]||this[_0x3b90('0x7')][_0x3fd5a1['queue']][_0x3b90('0x16')])){if(this[_0x3b90('0x8')][_0x3fd5a1[_0x3b90('0x3b')]]){this[_0x3b90('0x15')][_0x3fd5a1[_0x3b90('0x29')]]={'queue':_0x3fd5a1['queue'],'interface':_0x3fd5a1['interface']};}}}catch(_0x4034a3){logger['error'](_0x3b90('0x3e'),_0x4034a3[_0x3b90('0x3a')]);}};Acw[_0x3b90('0x13')][_0x3b90('0x3f')]=function(_0x177234){try{if(this['channels'][_0x177234['uniqueid']]&&_[_0x3b90('0x40')](this[_0x3b90('0x15')][_0x177234[_0x3b90('0x29')]]['attended'])){logger[_0x3b90('0x22')](_0x3b90('0x41'),_0x177234[_0x3b90('0x29')]);this[_0x3b90('0x14')](_0x177234[_0x3b90('0x29')]);}else if(this[_0x3b90('0x15')][_0x177234[_0x3b90('0x42')]]&&_[_0x3b90('0x40')](this[_0x3b90('0x15')][_0x177234['linkedid']][_0x3b90('0x1f')])){logger[_0x3b90('0x22')](_0x3b90('0x43'),_0x177234['linkedid']);this[_0x3b90('0x14')](_0x177234['linkedid']);}}catch(_0x288fbb){logger[_0x3b90('0x2d')](_0x3b90('0x44'),_0x288fbb['message']);}};Acw[_0x3b90('0x13')][_0x3b90('0x45')]=function(_0x5334b5){try{if(this['channels'][_0x5334b5[_0x3b90('0x29')]]&&this[_0x3b90('0x15')][_0x5334b5[_0x3b90('0x29')]][_0x3b90('0x1f')]){logger['info']('[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]',_0x5334b5[_0x3b90('0x29')]);this[_0x3b90('0x14')](_0x5334b5[_0x3b90('0x29')]);}else if(this[_0x3b90('0x15')][_0x5334b5[_0x3b90('0x42')]]&&this[_0x3b90('0x15')][_0x5334b5[_0x3b90('0x42')]][_0x3b90('0x1f')]){logger[_0x3b90('0x22')]('[%s][HANGUPATTENDEDTRANSFER:LINKEDID]',_0x5334b5[_0x3b90('0x42')]);this[_0x3b90('0x14')](_0x5334b5['linkedid']);}}catch(_0x1d211a){logger[_0x3b90('0x2d')]('[ACW][syncHangup]\x20%s',_0x1d211a[_0x3b90('0x3a')]);}};Acw[_0x3b90('0x13')][_0x3b90('0xf')]=function(_0x1bada9){try{if(!_[_0x3b90('0x46')](this[_0x3b90('0x15')][_0x1bada9[_0x3b90('0x47')]])){this['startAcw'](_0x1bada9[_0x3b90('0x47')]);if(this[_0x3b90('0x15')][_0x1bada9[_0x3b90('0x48')]]){this[_0x3b90('0x15')][_0x1bada9[_0x3b90('0x48')]][_0x3b90('0x1f')]=!![];this[_0x3b90('0x15')][_0x1bada9[_0x3b90('0x49')]]=this[_0x3b90('0x15')][_0x1bada9[_0x3b90('0x48')]];delete this[_0x3b90('0x15')][_0x1bada9[_0x3b90('0x48')]];}}else if(!_[_0x3b90('0x46')](this[_0x3b90('0x15')][_0x1bada9[_0x3b90('0x49')]])){this['startAcw'](_0x1bada9[_0x3b90('0x49')]);if(this['channels'][_0x1bada9[_0x3b90('0x4a')]]){this[_0x3b90('0x15')][_0x1bada9[_0x3b90('0x4a')]][_0x3b90('0x1f')]=!![];this[_0x3b90('0x15')][_0x1bada9[_0x3b90('0x47')]]=this['channels'][_0x1bada9[_0x3b90('0x4a')]];delete this[_0x3b90('0x15')][_0x1bada9[_0x3b90('0x4a')]];}}}catch(_0x8e1229){logger[_0x3b90('0x2d')](_0x3b90('0x4b'),_0x8e1229['message']);}};Acw[_0x3b90('0x13')][_0x3b90('0x10')]=function(_0xb41920){try{if(this['channels'][_0xb41920[_0x3b90('0x4c')]]){logger[_0x3b90('0x22')](_0x3b90('0x4d'),JSON[_0x3b90('0x38')](_0xb41920[_0x3b90('0x4c')]));this[_0x3b90('0x14')](_0xb41920[_0x3b90('0x4c')]);}else if(this[_0x3b90('0x15')][_0xb41920[_0x3b90('0x4e')]]){logger['info'](_0x3b90('0x4f'),JSON['stringify'](_0xb41920['transfererlinkedid']));this[_0x3b90('0x14')](_0xb41920[_0x3b90('0x4e')]);}}catch(_0x52c099){logger[_0x3b90('0x2d')](_0x3b90('0x50'),_0x52c099[_0x3b90('0x3a')]);}};Acw[_0x3b90('0x13')][_0x3b90('0xe')]=function(_0x260de4){try{if(this[_0x3b90('0x7')][_0x260de4['queue']]&&this['voiceQueues'][_0x260de4[_0x3b90('0x2a')]]['autopause']===_0x3b90('0x51')){if(this['agents'][_0x260de4[_0x3b90('0x3b')]]){logger['info']('[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]',_0x260de4['uniqueid'],_0x260de4[_0x3b90('0x3b')],_0x260de4[_0x3b90('0x2a')]);return RpcUser[_0x3b90('0x21')](this[_0x3b90('0x8')][_0x260de4[_0x3b90('0x3b')]],_0x3b90('0x52'),_0x260de4[_0x3b90('0x29')]);}}}catch(_0x490fd1){logger['error']('[ACW][syncAgentRingNoAnswer]\x20%s',_0x490fd1[_0x3b90('0x3a')]);}};module[_0x3b90('0x53')]=Acw;
\ No newline at end of file
+var _0x7dfd=['mandatoryDispositionPause','name','QueuePause','getAgent','then','voicePause','info','[%s][START][AGENT:%s][QUEUE:%s]','attended','destlinkedid','savePause','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','timer','stopAcw','acwTimeout','lastPauseAt','updateAcw','update','uniqueid','[%s][UPDATE][ACWTIME:%s]','catch','error','[%s][UPDATE][ERRORS:%s]','[%s][INPAUSE][AGENT:%s][QUEUE:%s]','finally','saveUnpause','prototype','interface','[ACW][syncAgentConnect]\x20%s','message','[ACW][syncAgentConnectPreview]\x20%s','isUndefined','[%s][HANGUP:UNIQUEID]','linkedid','[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]','isNil','transfereeuniqueid','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','[ACW][syncAttendedTransfer]\x20%s','transfereruniqueid','stringify','transfererlinkedid','[%s][BLINDTRANSFER:LINKEDID]','[ACW][syncBlindTransfer]\x20%s','all','[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]','Auto-Pause','exports','util','lodash','moment','../ami','../../../config/logger','acw','../rpc/user','../rpc/voiceAgentReport','voiceQueues','agents','timers','channels','agentconnect','bind','hanguprequest','syncHangupRequest','syncHangup','agentringnoanswer','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','custom:agentConnectPreview','syncAgentConnectPreview','milliseconds','diff','seconds','startAcw','queue','mandatoryDisposition'];(function(_0xc059cc,_0x46b267){var _0x2eed7e=function(_0x461fa2){while(--_0x461fa2){_0xc059cc['push'](_0xc059cc['shift']());}};_0x2eed7e(++_0x46b267);}(_0x7dfd,0x1c2));var _0xd7df=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7dfd[_0x3dd15e];return _0x231fd0;};'use strict';var util=require(_0xd7df('0x0'));var _=require(_0xd7df('0x1'));var moment=require(_0xd7df('0x2'));var ami=require(_0xd7df('0x3'));var logger=require(_0xd7df('0x4'))(_0xd7df('0x5'));var RpcUser=require(_0xd7df('0x6'));var RpcVoiceAgentReport=require(_0xd7df('0x7'));function Acw(_0x3ef231){this[_0xd7df('0x8')]=_0x3ef231[_0xd7df('0x8')];this[_0xd7df('0x9')]=_0x3ef231[_0xd7df('0x9')];this[_0xd7df('0xa')]=_0x3ef231[_0xd7df('0xa')];this[_0xd7df('0xb')]={};ami['on'](_0xd7df('0xc'),this['syncAgentConnect'][_0xd7df('0xd')](this));ami['on'](_0xd7df('0xe'),this[_0xd7df('0xf')][_0xd7df('0xd')](this));ami['on']('hangup',this[_0xd7df('0x10')]['bind'](this));ami['on'](_0xd7df('0x11'),this['syncAgentRingNoAnswer'][_0xd7df('0xd')](this));ami['on'](_0xd7df('0x12'),this[_0xd7df('0x13')][_0xd7df('0xd')](this));ami['on'](_0xd7df('0x14'),this[_0xd7df('0x15')][_0xd7df('0xd')](this));ami['on'](_0xd7df('0x16'),this[_0xd7df('0x17')][_0xd7df('0xd')](this));}function getDiff(_0xa70589){var _0x4723b7=moment()[_0xd7df('0x18')](0x0);var _0x196632=moment(_0xa70589)[_0xd7df('0x18')](0x0);return _0x4723b7[_0xd7df('0x19')](_0x196632,_0xd7df('0x1a'));}Acw['prototype'][_0xd7df('0x1b')]=function(_0x23cdbc){try{var _0x513b13=this;var _0x18d38f=this[_0xd7df('0xb')][_0x23cdbc]['interface'];var _0x43bc73=this[_0xd7df('0xb')][_0x23cdbc][_0xd7df('0x1c')];var _0x5210e5=this[_0xd7df('0x8')][_0x43bc73];var _0x471621=![];var _0x3cea3='ACW';if(_0x5210e5[_0xd7df('0x1d')]){if(_0x5210e5[_0xd7df('0x1e')][_0xd7df('0x1f')]){_0x471621=!![];_0x3cea3=_0x5210e5['mandatoryDispositionPause'][_0xd7df('0x1f')];}}ami['Action']({'action':_0xd7df('0x20'),'interface':_0x18d38f,'paused':!![],'reason':_0x3cea3})['then'](function(_0x3ae7c3){if(_0x513b13[_0xd7df('0x9')][_0x18d38f]){return RpcUser[_0xd7df('0x21')](_0x513b13['agents'][_0x18d38f]['id'])[_0xd7df('0x22')](function(_0x502ae8){if(_0x502ae8&&!_0x502ae8[_0xd7df('0x23')]){logger[_0xd7df('0x24')](_0xd7df('0x25'),_0x23cdbc,_0x18d38f,_0x43bc73);var _0x29f354=_0x513b13[_0xd7df('0xb')][_0x23cdbc][_0xd7df('0x26')]&&_0x513b13[_0xd7df('0xb')][_0x23cdbc]['destlinkedid']?_0x513b13['channels'][_0x23cdbc][_0xd7df('0x27')]:_0x23cdbc;return RpcUser[_0xd7df('0x28')](_0x513b13[_0xd7df('0x9')][_0x18d38f],_0x3cea3,_0x29f354)[_0xd7df('0x22')](function(_0x13f190){if(!_0x471621){_0x513b13[_0xd7df('0xa')][_0x18d38f]={};logger[_0xd7df('0x24')](_0xd7df('0x29'),_0x23cdbc,_0x513b13[_0xd7df('0x8')][_0x43bc73]['acwTimeout'],_0x18d38f,_0x43bc73);_0x513b13[_0xd7df('0xa')][_0x18d38f][_0xd7df('0x2a')]=setTimeout(_0x513b13[_0xd7df('0x2b')][_0xd7df('0xd')](_0x513b13,_0x18d38f),_0x513b13[_0xd7df('0x8')][_0x43bc73][_0xd7df('0x2c')]*0x3e8);_0x513b13[_0xd7df('0xa')][_0x18d38f][_0xd7df('0x2d')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x513b13['timers'][_0x18d38f]['uniqueid']=_0x23cdbc;_0x513b13['timers'][_0x18d38f][_0xd7df('0x1c')]=_0x43bc73;_0x513b13['timers'][_0x18d38f][_0xd7df('0x2e')]=function(){var _0x156612=getDiff(_0x513b13['timers'][_0x18d38f][_0xd7df('0x2d')]);clearTimeout(_0x513b13[_0xd7df('0xa')][_0x18d38f]['timer']);_0x513b13[_0xd7df('0xa')][_0x18d38f][_0xd7df('0x2a')]=![];RpcVoiceAgentReport[_0xd7df('0x2f')]({'acwtime':_0x156612},_0x513b13[_0xd7df('0xa')][_0x18d38f][_0xd7df('0x30')],_0x18d38f)[_0xd7df('0x22')](function(_0x5a658f){logger[_0xd7df('0x24')](_0xd7df('0x31'),_0x23cdbc,_0x156612,_0x5a658f);})[_0xd7df('0x32')](function(_0x1d81b2){logger[_0xd7df('0x33')](_0xd7df('0x34'),_0x23cdbc,_0x1d81b2);});delete _0x513b13[_0xd7df('0xa')][_0x18d38f];};}});}else{logger[_0xd7df('0x24')](_0xd7df('0x35'),_0x23cdbc,_0x18d38f,_0x43bc73);}});}})[_0xd7df('0x32')](function(_0x2e828e){logger['error']('[%s][TIMER:%s][AGENT:%s][QUEUE:%s]',_0x23cdbc,_0x513b13[_0xd7df('0x8')][_0x43bc73]['acwTimeout'],_0x18d38f,_0x43bc73);})[_0xd7df('0x36')](function(){delete _0x513b13[_0xd7df('0xb')][_0x23cdbc];});}catch(_0xa0ed20){logger[_0xd7df('0x33')]('[ACW][START]\x20%s',_0xa0ed20['message']);}};Acw['prototype'][_0xd7df('0x2b')]=function(_0x15e682){try{var _0x55c43f=this;if(_0x55c43f[_0xd7df('0xa')][_0x15e682]){_0x55c43f[_0xd7df('0xa')][_0x15e682][_0xd7df('0x2a')]=![];var _0x574567=_0x55c43f['timers'][_0x15e682][_0xd7df('0x30')];var _0x45642c=_0x55c43f['timers'][_0x15e682][_0xd7df('0x1c')];var _0x564ce2=_0x55c43f[_0xd7df('0x8')][_0x45642c][_0xd7df('0x2c')];logger[_0xd7df('0x24')]('[TIMER][STOP][AGENT:%s]',_0x15e682);RpcUser[_0xd7df('0x37')](this[_0xd7df('0x9')][_0x15e682]);RpcVoiceAgentReport[_0xd7df('0x2f')]({'acwtime':_0x564ce2,'agentacw':!![]},_0x574567,_0x15e682)[_0xd7df('0x22')](function(_0x54ea42){logger[_0xd7df('0x24')](_0xd7df('0x31'),_0x574567,_0x564ce2,_0x54ea42);})[_0xd7df('0x32')](function(_0x4f6286){logger[_0xd7df('0x33')](_0xd7df('0x34'),_0x574567,_0x4f6286);});}else{logger[_0xd7df('0x33')]('[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer',_0x15e682);if(_0x55c43f[_0xd7df('0xa')]){logger[_0xd7df('0x24')]('[ACW][TIMERS]',JSON['stringify'](_0x55c43f[_0xd7df('0xa')]));}}}catch(_0x211feb){logger[_0xd7df('0x33')]('[ACW][STOP]\x20%s',_0x211feb['message']);}};Acw[_0xd7df('0x38')]['syncAgentConnect']=function(_0xe606f4){try{if(this['voiceQueues'][_0xe606f4['queue']]&&(this[_0xd7df('0x8')][_0xe606f4['queue']][_0xd7df('0x5')]||this[_0xd7df('0x8')][_0xe606f4[_0xd7df('0x1c')]][_0xd7df('0x1d')])){if(this[_0xd7df('0x9')][_0xe606f4[_0xd7df('0x39')]]){this[_0xd7df('0xb')][_0xe606f4[_0xd7df('0x30')]]={'queue':_0xe606f4[_0xd7df('0x1c')],'interface':_0xe606f4['interface'],'destlinkedid':_0xe606f4[_0xd7df('0x27')]};}}}catch(_0x4b9076){logger[_0xd7df('0x33')](_0xd7df('0x3a'),_0x4b9076[_0xd7df('0x3b')]);}};Acw[_0xd7df('0x38')][_0xd7df('0x17')]=function(_0x145223){try{if(this[_0xd7df('0x8')][_0x145223[_0xd7df('0x1c')]]&&(this[_0xd7df('0x8')][_0x145223['queue']][_0xd7df('0x5')]||this[_0xd7df('0x8')][_0x145223['queue']]['mandatoryDisposition'])){if(this[_0xd7df('0x9')][_0x145223[_0xd7df('0x39')]]){this[_0xd7df('0xb')][_0x145223['uniqueid']]={'queue':_0x145223['queue'],'interface':_0x145223[_0xd7df('0x39')]};}}}catch(_0x49a763){logger[_0xd7df('0x33')](_0xd7df('0x3c'),_0x49a763[_0xd7df('0x3b')]);}};Acw[_0xd7df('0x38')][_0xd7df('0xf')]=function(_0x28c13f){try{if(this[_0xd7df('0xb')][_0x28c13f[_0xd7df('0x30')]]&&_[_0xd7df('0x3d')](this[_0xd7df('0xb')][_0x28c13f[_0xd7df('0x30')]][_0xd7df('0x26')])){logger['info'](_0xd7df('0x3e'),_0x28c13f[_0xd7df('0x30')]);this[_0xd7df('0x1b')](_0x28c13f[_0xd7df('0x30')]);}else if(this[_0xd7df('0xb')][_0x28c13f['linkedid']]&&_[_0xd7df('0x3d')](this[_0xd7df('0xb')][_0x28c13f[_0xd7df('0x3f')]]['attended'])){logger[_0xd7df('0x24')]('[%s][HANGUP:LINKEDID]',_0x28c13f[_0xd7df('0x3f')]);this[_0xd7df('0x1b')](_0x28c13f[_0xd7df('0x3f')]);}}catch(_0x579bec){logger[_0xd7df('0x33')]('[ACW][syncHangupRequest]\x20%s',_0x579bec['message']);}};Acw['prototype'][_0xd7df('0x10')]=function(_0x4a6cf5){try{if(this[_0xd7df('0xb')][_0x4a6cf5[_0xd7df('0x30')]]&&this[_0xd7df('0xb')][_0x4a6cf5[_0xd7df('0x30')]][_0xd7df('0x26')]){logger[_0xd7df('0x24')](_0xd7df('0x40'),_0x4a6cf5[_0xd7df('0x30')]);this[_0xd7df('0x1b')](_0x4a6cf5[_0xd7df('0x30')]);}else if(this[_0xd7df('0xb')][_0x4a6cf5[_0xd7df('0x3f')]]&&this[_0xd7df('0xb')][_0x4a6cf5[_0xd7df('0x3f')]][_0xd7df('0x26')]){logger[_0xd7df('0x24')]('[%s][HANGUPATTENDEDTRANSFER:LINKEDID]',_0x4a6cf5[_0xd7df('0x3f')]);this[_0xd7df('0x1b')](_0x4a6cf5['linkedid']);}}catch(_0x56819b){logger[_0xd7df('0x33')]('[ACW][syncHangup]\x20%s',_0x56819b[_0xd7df('0x3b')]);}};Acw['prototype'][_0xd7df('0x13')]=function(_0x28151a){try{if(!_[_0xd7df('0x41')](this['channels'][_0x28151a['transfereeuniqueid']])){this['startAcw'](_0x28151a[_0xd7df('0x42')]);if(this[_0xd7df('0xb')][_0x28151a[_0xd7df('0x43')]]){this[_0xd7df('0xb')][_0x28151a[_0xd7df('0x43')]][_0xd7df('0x26')]=!![];this['channels'][_0x28151a[_0xd7df('0x44')]]=this[_0xd7df('0xb')][_0x28151a[_0xd7df('0x43')]];delete this[_0xd7df('0xb')][_0x28151a[_0xd7df('0x43')]];}}else if(!_[_0xd7df('0x41')](this[_0xd7df('0xb')][_0x28151a[_0xd7df('0x44')]])){this[_0xd7df('0x1b')](_0x28151a[_0xd7df('0x44')]);if(this[_0xd7df('0xb')][_0x28151a[_0xd7df('0x45')]]){this[_0xd7df('0xb')][_0x28151a[_0xd7df('0x45')]][_0xd7df('0x26')]=!![];this[_0xd7df('0xb')][_0x28151a[_0xd7df('0x42')]]=this[_0xd7df('0xb')][_0x28151a[_0xd7df('0x45')]];delete this[_0xd7df('0xb')][_0x28151a[_0xd7df('0x45')]];}}}catch(_0x393a3a){logger[_0xd7df('0x33')](_0xd7df('0x46'),_0x393a3a[_0xd7df('0x3b')]);}};Acw[_0xd7df('0x38')]['syncBlindTransfer']=function(_0x57ec6f){try{if(this[_0xd7df('0xb')][_0x57ec6f[_0xd7df('0x47')]]){logger[_0xd7df('0x24')]('[%s][BLINDTRANSFER:UNIQUEID]',JSON[_0xd7df('0x48')](_0x57ec6f[_0xd7df('0x47')]));this[_0xd7df('0x1b')](_0x57ec6f[_0xd7df('0x47')]);}else if(this['channels'][_0x57ec6f[_0xd7df('0x49')]]){logger[_0xd7df('0x24')](_0xd7df('0x4a'),JSON[_0xd7df('0x48')](_0x57ec6f[_0xd7df('0x49')]));this[_0xd7df('0x1b')](_0x57ec6f[_0xd7df('0x49')]);}}catch(_0x2fdad0){logger['error'](_0xd7df('0x4b'),_0x2fdad0[_0xd7df('0x3b')]);}};Acw['prototype']['syncAgentRingNoAnswer']=function(_0x481fa5){try{if(this[_0xd7df('0x8')][_0x481fa5[_0xd7df('0x1c')]]&&this[_0xd7df('0x8')][_0x481fa5[_0xd7df('0x1c')]]['autopause']===_0xd7df('0x4c')){if(this[_0xd7df('0x9')][_0x481fa5[_0xd7df('0x39')]]){logger[_0xd7df('0x24')](_0xd7df('0x4d'),_0x481fa5[_0xd7df('0x30')],_0x481fa5[_0xd7df('0x39')],_0x481fa5['queue']);return RpcUser['savePause'](this[_0xd7df('0x9')][_0x481fa5['interface']],_0xd7df('0x4e'),_0x481fa5[_0xd7df('0x30')]);}}}catch(_0x1efefa){logger['error']('[ACW][syncAgentRingNoAnswer]\x20%s',_0x1efefa[_0xd7df('0x3b')]);}};module[_0xd7df('0x4f')]=Acw;
\ No newline at end of file
diff --git a/server/services/ami/ami.js b/server/services/ami/ami.js
index 03ce729..81d6c5d 100644
--- a/server/services/ami/ami.js
+++ b/server/services/ami/ami.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xa01f=['actionSipPeerStatus','sippeerstatus','actionQueueSummary','info','once','close','connect','Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s','fullybooted','Fullybooted\x20\x22%s\x22\x20to\x20%s:%s','then','actionSipShowRegistry','catch','exports','bluebird','moment','util','lodash','../../config/logger','../../config/environment','asterisk','keepConnected','Action','promisify','action','format','Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s','username','inspect','error','port','sipshowregistry','actionDeviceStateList','devicestatelist'];(function(_0xbb33c8,_0x1527f3){var _0x559b75=function(_0xbdb532){while(--_0xbdb532){_0xbb33c8['push'](_0xbb33c8['shift']());}};_0x559b75(++_0x1527f3);}(_0xa01f,0x11e));var _0xfa01=function(_0xb0f7c3,_0x4eae95){_0xb0f7c3=_0xb0f7c3-0x0;var _0x28ea68=_0xa01f[_0xb0f7c3];return _0x28ea68;};'use strict';var Manager=require('asterisk-manager');var BPromise=require(_0xfa01('0x0'));var moment=require(_0xfa01('0x1'));var util=require(_0xfa01('0x2'));var _=require(_0xfa01('0x3'));var logger=require(_0xfa01('0x4'))('ami');var config=require(_0xfa01('0x5'));var ami=new Manager(config[_0xfa01('0x6')]['port'],config[_0xfa01('0x6')]['ip'],config['asterisk']['username'],config['asterisk']['password'],!![]);ami[_0xfa01('0x7')]();ami[_0xfa01('0x8')]=BPromise[_0xfa01('0x9')](ami[_0xfa01('0xa')]);function error(_0x47c762){logger['error'](util[_0xfa01('0xb')](_0xfa01('0xc'),config[_0xfa01('0x6')][_0xfa01('0xd')],config[_0xfa01('0x6')]['ip'],config[_0xfa01('0x6')]['port'],util[_0xfa01('0xe')](_0x47c762,![],null)));}function close(){logger[_0xfa01('0xf')](util[_0xfa01('0xb')]('Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s',config[_0xfa01('0x6')][_0xfa01('0xd')],config['asterisk']['ip'],config[_0xfa01('0x6')][_0xfa01('0x10')]));}ami['actionSipShowRegistry']=function(){return function(){return ami['Action']({'action':_0xfa01('0x11')});};};ami[_0xfa01('0x12')]=function(){return function(){return ami[_0xfa01('0x8')]({'action':_0xfa01('0x13')});};};ami[_0xfa01('0x14')]=function(){return function(){return ami[_0xfa01('0x8')]({'action':_0xfa01('0x15')});};};ami[_0xfa01('0x16')]=function(){return function(){return ami[_0xfa01('0x8')]({'action':'queuesummary'});};};ami['actionCoreShowChannels']=function(){return function(){return ami[_0xfa01('0x8')]({'action':'coreshowchannels'});};};function connect(_0x27859e){logger[_0xfa01('0x17')](util[_0xfa01('0xb')]('Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s',config[_0xfa01('0x6')][_0xfa01('0xd')],config[_0xfa01('0x6')]['ip'],config[_0xfa01('0x6')][_0xfa01('0x10')]));ami['once'](_0xfa01('0xf'),error);ami[_0xfa01('0x18')](_0xfa01('0x19'),close);}ami['on'](_0xfa01('0x1a'),connect);ami['on']('shutdown',function(_0x4fe67f){logger[_0xfa01('0x17')](util['format'](_0xfa01('0x1b'),config['asterisk'][_0xfa01('0xd')],config[_0xfa01('0x6')]['ip'],config[_0xfa01('0x6')][_0xfa01('0x10')],util[_0xfa01('0xe')](_0x4fe67f,![],null)));});ami['on'](_0xfa01('0x1c'),function(_0x1f3051){logger['info'](util[_0xfa01('0xb')](_0xfa01('0x1d'),config['asterisk'][_0xfa01('0xd')],config[_0xfa01('0x6')]['ip'],config[_0xfa01('0x6')][_0xfa01('0x10')]));return BPromise['resolve']()[_0xfa01('0x1e')](ami[_0xfa01('0x1f')]())[_0xfa01('0x1e')](ami[_0xfa01('0x12')]())[_0xfa01('0x1e')](ami[_0xfa01('0x14')]())[_0xfa01('0x1e')](ami['actionQueueSummary']())[_0xfa01('0x1e')](ami['actionCoreShowChannels']())[_0xfa01('0x20')](function(_0x33e1a3){console['log'](_0x33e1a3);});});ami[_0xfa01('0x18')]('error',error);ami['once'](_0xfa01('0x19'),close);module[_0xfa01('0x21')]=ami;
\ No newline at end of file
+var _0x966b=['error','Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s','username','actionSipShowRegistry','sipshowregistry','devicestatelist','actionSipPeerStatus','actionQueueSummary','actionCoreShowChannels','coreshowchannels','info','Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s','once','close','connect','shutdown','Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s','fullybooted','Fullybooted\x20\x22%s\x22\x20to\x20%s:%s','resolve','then','actionDeviceStateList','log','exports','bluebird','lodash','../../config/logger','ami','../../config/environment','asterisk','port','keepConnected','Action','promisify','format','Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s','inspect'];(function(_0x253b26,_0x11b62e){var _0x3ea3a0=function(_0x1a5cad){while(--_0x1a5cad){_0x253b26['push'](_0x253b26['shift']());}};_0x3ea3a0(++_0x11b62e);}(_0x966b,0xf6));var _0xb966=function(_0x3783be,_0x47a0bb){_0x3783be=_0x3783be-0x0;var _0x3af1dc=_0x966b[_0x3783be];return _0x3af1dc;};'use strict';var Manager=require('asterisk-manager');var BPromise=require(_0xb966('0x0'));var moment=require('moment');var util=require('util');var _=require(_0xb966('0x1'));var logger=require(_0xb966('0x2'))(_0xb966('0x3'));var config=require(_0xb966('0x4'));var ami=new Manager(config[_0xb966('0x5')][_0xb966('0x6')],config['asterisk']['ip'],config['asterisk']['username'],config[_0xb966('0x5')]['password'],!![]);ami[_0xb966('0x7')]();ami[_0xb966('0x8')]=BPromise[_0xb966('0x9')](ami['action']);function error(_0x122284){logger['error'](util[_0xb966('0xa')](_0xb966('0xb'),config[_0xb966('0x5')]['username'],config[_0xb966('0x5')]['ip'],config[_0xb966('0x5')][_0xb966('0x6')],util[_0xb966('0xc')](_0x122284,![],null)));}function close(){logger[_0xb966('0xd')](util[_0xb966('0xa')](_0xb966('0xe'),config[_0xb966('0x5')][_0xb966('0xf')],config[_0xb966('0x5')]['ip'],config[_0xb966('0x5')][_0xb966('0x6')]));}ami[_0xb966('0x10')]=function(){return function(){return ami[_0xb966('0x8')]({'action':_0xb966('0x11')});};};ami['actionDeviceStateList']=function(){return function(){return ami[_0xb966('0x8')]({'action':_0xb966('0x12')});};};ami[_0xb966('0x13')]=function(){return function(){return ami[_0xb966('0x8')]({'action':'sippeerstatus'});};};ami[_0xb966('0x14')]=function(){return function(){return ami[_0xb966('0x8')]({'action':'queuesummary'});};};ami[_0xb966('0x15')]=function(){return function(){return ami['Action']({'action':_0xb966('0x16')});};};function connect(_0x423a81){logger[_0xb966('0x17')](util[_0xb966('0xa')](_0xb966('0x18'),config[_0xb966('0x5')][_0xb966('0xf')],config[_0xb966('0x5')]['ip'],config[_0xb966('0x5')][_0xb966('0x6')]));ami[_0xb966('0x19')](_0xb966('0xd'),error);ami[_0xb966('0x19')](_0xb966('0x1a'),close);}ami['on'](_0xb966('0x1b'),connect);ami['on'](_0xb966('0x1c'),function(_0x38acca){logger[_0xb966('0x17')](util[_0xb966('0xa')](_0xb966('0x1d'),config['asterisk']['username'],config[_0xb966('0x5')]['ip'],config[_0xb966('0x5')][_0xb966('0x6')],util[_0xb966('0xc')](_0x38acca,![],null)));});ami['on'](_0xb966('0x1e'),function(_0xfae334){logger['info'](util['format'](_0xb966('0x1f'),config[_0xb966('0x5')][_0xb966('0xf')],config[_0xb966('0x5')]['ip'],config[_0xb966('0x5')][_0xb966('0x6')]));return BPromise[_0xb966('0x20')]()[_0xb966('0x21')](ami[_0xb966('0x10')]())[_0xb966('0x21')](ami[_0xb966('0x22')]())[_0xb966('0x21')](ami[_0xb966('0x13')]())[_0xb966('0x21')](ami[_0xb966('0x14')]())[_0xb966('0x21')](ami[_0xb966('0x15')]())['catch'](function(_0x12d45b){console[_0xb966('0x23')](_0x12d45b);});});ami[_0xb966('0x19')](_0xb966('0xd'),error);ami['once'](_0xb966('0x1a'),close);module[_0xb966('0x24')]=ami;
\ No newline at end of file
diff --git a/server/services/ami/client.js b/server/services/ami/client.js
index a943fd2..408dd49 100644
--- a/server/services/ami/client.js
+++ b/server/services/ami/client.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xc2b2=['error','message','result','catch','exports','jayson/promise','bluebird','../../config/logger','ami','http','request','then','debug','rpc','memberReport'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0xc2b2,0xd7));var _0x2c2b=function(_0x58c986,_0x54b83c){_0x58c986=_0x58c986-0x0;var _0x3dea02=_0xc2b2[_0x58c986];return _0x3dea02;};'use strict';var jayson=require(_0x2c2b('0x0'));var BPromise=require(_0x2c2b('0x1'));var logger=require(_0x2c2b('0x2'))(_0x2c2b('0x3'));var client=jayson['client'][_0x2c2b('0x4')]({'port':0x2329});client['Request']=function(_0x33fe3b,_0x566607){return new BPromise(function(_0x18657e,_0x34cab4){return client[_0x2c2b('0x5')](_0x33fe3b,_0x566607)[_0x2c2b('0x6')](function(_0x49788a){logger[_0x2c2b('0x7')](_0x2c2b('0x8'),_0x2c2b('0x9'),_0x33fe3b,_0x566607,_0x49788a);if(_0x49788a['error']){logger[_0x2c2b('0xa')](_0x2c2b('0x8'),'memberReport',_0x33fe3b,_0x49788a[_0x2c2b('0xa')][_0x2c2b('0xb')],_0x566607);return _0x34cab4(_0x49788a[_0x2c2b('0xa')][_0x2c2b('0xb')]);}else{return _0x18657e(_0x49788a[_0x2c2b('0xc')]);}})[_0x2c2b('0xd')](function(_0x34ccec){logger[_0x2c2b('0xa')](_0x2c2b('0x8'),_0x2c2b('0x9'),_0x33fe3b,_0x34ccec,_0x566607);return _0x34cab4(_0x34ccec);});});};module[_0x2c2b('0xe')]=client;
\ No newline at end of file
+var _0xc68e=['rpc','message','result','catch','exports','jayson/promise','../../config/logger','ami','client','request','then','debug','memberReport','error'];(function(_0x49d55b,_0x439332){var _0x459027=function(_0x1cd626){while(--_0x1cd626){_0x49d55b['push'](_0x49d55b['shift']());}};_0x459027(++_0x439332);}(_0xc68e,0x91));var _0xec68=function(_0x5e0c27,_0xfe9ee0){_0x5e0c27=_0x5e0c27-0x0;var _0x495393=_0xc68e[_0x5e0c27];return _0x495393;};'use strict';var jayson=require(_0xec68('0x0'));var BPromise=require('bluebird');var logger=require(_0xec68('0x1'))(_0xec68('0x2'));var client=jayson[_0xec68('0x3')]['http']({'port':0x2329});client['Request']=function(_0x413a1c,_0x32db43){return new BPromise(function(_0x189a71,_0x592d1a){return client[_0xec68('0x4')](_0x413a1c,_0x32db43)[_0xec68('0x5')](function(_0x14b3fa){logger[_0xec68('0x6')]('rpc',_0xec68('0x7'),_0x413a1c,_0x32db43,_0x14b3fa);if(_0x14b3fa[_0xec68('0x8')]){logger['error'](_0xec68('0x9'),_0xec68('0x7'),_0x413a1c,_0x14b3fa['error'][_0xec68('0xa')],_0x32db43);return _0x592d1a(_0x14b3fa['error'][_0xec68('0xa')]);}else{return _0x189a71(_0x14b3fa[_0xec68('0xb')]);}})[_0xec68('0xc')](function(_0x4c5d39){logger['error'](_0xec68('0x9'),_0xec68('0x7'),_0x413a1c,_0x4c5d39,_0x32db43);return _0x592d1a(_0x4c5d39);});});};module[_0xec68('0xd')]=client;
\ No newline at end of file
diff --git a/server/services/ami/dialer/action.js b/server/services/ami/dialer/action.js
index c279dbc..6cf9314 100644
--- a/server/services/ami/dialer/action.js
+++ b/server/services/ami/dialer/action.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9f85=['originatecalleridname','prototype','substring','dialCutDigit','getQueue','util','moment','isNil','string','voiceQueue','name','Contact','phone','firstName','lastName','number','queue','active','type','dialQueueTimeout','scheduledat','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countabandonedretry','countmachineretry','ContactId','ListId','UserId','CampaignId','idHopper','ContactFirstName','starttime','format','YYYY-MM-DD\x20HH:mm:ss','callback','callbackuniqueid','callbackat','recallme','originatecalleridnum'];(function(_0x50027a,_0x7f0218){var _0x3fab50=function(_0x5f5a38){while(--_0x5f5a38){_0x50027a['push'](_0x50027a['shift']());}};_0x3fab50(++_0x7f0218);}(_0x9f85,0xf5));var _0x59f8=function(_0x44d3a4,_0x70eb47){_0x44d3a4=_0x44d3a4-0x0;var _0x4daead=_0x9f85[_0x44d3a4];return _0x4daead;};'use strict';var util=require(_0x59f8('0x0'));var _=require('lodash');var moment=require(_0x59f8('0x1'));function checkNameSurname(_0x42ab47,_0x3e932e,_0x225e68){var _0x3fa33b='';if(!_[_0x59f8('0x2')](_0x3e932e)&&_0x59f8('0x3')===typeof _0x3e932e){_0x3fa33b+=_0x3e932e;}if(!_[_0x59f8('0x2')](_0x225e68)&&_0x59f8('0x3')===typeof _0x225e68){_0x3fa33b+='\x20'+_0x225e68;}if(_0x3fa33b!==''){return _0x3fa33b;}return _0x42ab47;}function Action(_0x39240e,_0x947153,_0x302e45){this[_0x59f8('0x4')]=_0x39240e;this['uniqueid']=_0x302e45||undefined;this[_0x59f8('0x5')]=checkNameSurname(_0x947153[_0x59f8('0x6')][_0x59f8('0x7')],_0x947153[_0x59f8('0x6')][_0x59f8('0x8')],_0x947153[_0x59f8('0x6')][_0x59f8('0x9')]);this[_0x59f8('0xa')]=_0x947153[_0x59f8('0x6')][_0x59f8('0x7')];this[_0x59f8('0xb')]=_0x39240e[_0x59f8('0x5')];this['active']=_0x947153[_0x59f8('0xc')]||![];this[_0x59f8('0xd')]=_0x39240e[_0x59f8('0xd')];this['dialQueueTimeout']=_0x39240e[_0x59f8('0xe')]||0x3;this[_0x59f8('0xf')]=_0x947153[_0x59f8('0xf')];this['countbusyretry']=_0x947153['countbusyretry'];this[_0x59f8('0x10')]=_0x947153[_0x59f8('0x10')];this[_0x59f8('0x11')]=_0x947153[_0x59f8('0x11')];this[_0x59f8('0x12')]=_0x947153[_0x59f8('0x12')];this['countdropretry']=_0x947153['countdropretry'];this['countabandonedretry']=_0x947153[_0x59f8('0x13')];this['countmachineretry']=_0x947153[_0x59f8('0x14')];this['countagentrejectretry']=_0x947153['countagentrejectretry'];this['ContactId']=_0x947153[_0x59f8('0x15')];this[_0x59f8('0x16')]=_0x947153[_0x59f8('0x16')];this['UserId']=_0x947153[_0x59f8('0x17')];this['VoiceQueueId']=_0x947153['VoiceQueueId'];this[_0x59f8('0x18')]=_0x947153[_0x59f8('0x18')];this[_0x59f8('0x19')]=_0x947153['id'];this[_0x59f8('0x1a')]=_0x947153['Contact']['firstName']||'';this[_0x59f8('0x1b')]=moment()[_0x59f8('0x1c')](_0x59f8('0x1d'));this[_0x59f8('0x1e')]=_0x947153[_0x59f8('0x1e')];this[_0x59f8('0x1f')]=_0x947153[_0x59f8('0x1f')];this[_0x59f8('0x20')]=_0x947153[_0x59f8('0x20')];this[_0x59f8('0x21')]=_0x947153[_0x59f8('0x21')];this[_0x59f8('0x22')]='';this[_0x59f8('0x23')]='';}Action[_0x59f8('0x24')]['getCaller']=function(){return util[_0x59f8('0x1c')]('\x22%s\x22\x20<%s>',this[_0x59f8('0x5')],this[_0x59f8('0x4')]['dialCutDigit']>0x0?this[_0x59f8('0xa')][_0x59f8('0x25')](this[_0x59f8('0x4')][_0x59f8('0x26')]):this[_0x59f8('0xa')]);};Action['prototype'][_0x59f8('0x27')]=function(){return this[_0x59f8('0xb')];};module['exports']=Action;
\ No newline at end of file
+var _0xc4e6=['callbackuniqueid','callbackat','recallme','originatecalleridname','prototype','getCaller','format','\x22%s\x22\x20<%s>','voiceQueue','substring','dialCutDigit','getQueue','exports','util','lodash','string','isNil','uniqueid','name','Contact','phone','firstName','lastName','number','queue','active','type','dialQueueTimeout','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countagentrejectretry','ContactId','ListId','UserId','VoiceQueueId','CampaignId','idHopper','ContactFirstName','starttime','YYYY-MM-DD\x20HH:mm:ss','callback'];(function(_0x3432ca,_0x77ca){var _0x450277=function(_0x331cb6){while(--_0x331cb6){_0x3432ca['push'](_0x3432ca['shift']());}};_0x450277(++_0x77ca);}(_0xc4e6,0x1d9));var _0x6c4e=function(_0x545a3a,_0x3123aa){_0x545a3a=_0x545a3a-0x0;var _0x5a5493=_0xc4e6[_0x545a3a];return _0x5a5493;};'use strict';var util=require(_0x6c4e('0x0'));var _=require(_0x6c4e('0x1'));var moment=require('moment');function checkNameSurname(_0x79153b,_0x1b3896,_0x86fe20){var _0x399a44='';if(!_['isNil'](_0x1b3896)&&_0x6c4e('0x2')===typeof _0x1b3896){_0x399a44+=_0x1b3896;}if(!_[_0x6c4e('0x3')](_0x86fe20)&&_0x6c4e('0x2')===typeof _0x86fe20){_0x399a44+='\x20'+_0x86fe20;}if(_0x399a44!==''){return _0x399a44;}return _0x79153b;}function Action(_0x5d8d70,_0x266061,_0x587927){this['voiceQueue']=_0x5d8d70;this[_0x6c4e('0x4')]=_0x587927||undefined;this[_0x6c4e('0x5')]=checkNameSurname(_0x266061[_0x6c4e('0x6')][_0x6c4e('0x7')],_0x266061[_0x6c4e('0x6')][_0x6c4e('0x8')],_0x266061[_0x6c4e('0x6')][_0x6c4e('0x9')]);this[_0x6c4e('0xa')]=_0x266061[_0x6c4e('0x6')][_0x6c4e('0x7')];this[_0x6c4e('0xb')]=_0x5d8d70['name'];this['active']=_0x266061[_0x6c4e('0xc')]||![];this[_0x6c4e('0xd')]=_0x5d8d70[_0x6c4e('0xd')];this['dialQueueTimeout']=_0x5d8d70[_0x6c4e('0xe')]||0x3;this[_0x6c4e('0xf')]=_0x266061[_0x6c4e('0xf')];this[_0x6c4e('0x10')]=_0x266061['countbusyretry'];this[_0x6c4e('0x11')]=_0x266061[_0x6c4e('0x11')];this[_0x6c4e('0x12')]=_0x266061[_0x6c4e('0x12')];this[_0x6c4e('0x13')]=_0x266061['countnosuchnumberretry'];this[_0x6c4e('0x14')]=_0x266061[_0x6c4e('0x14')];this[_0x6c4e('0x15')]=_0x266061['countabandonedretry'];this['countmachineretry']=_0x266061['countmachineretry'];this['countagentrejectretry']=_0x266061[_0x6c4e('0x16')];this[_0x6c4e('0x17')]=_0x266061[_0x6c4e('0x17')];this['ListId']=_0x266061[_0x6c4e('0x18')];this[_0x6c4e('0x19')]=_0x266061['UserId'];this[_0x6c4e('0x1a')]=_0x266061['VoiceQueueId'];this[_0x6c4e('0x1b')]=_0x266061[_0x6c4e('0x1b')];this[_0x6c4e('0x1c')]=_0x266061['id'];this[_0x6c4e('0x1d')]=_0x266061['Contact'][_0x6c4e('0x8')]||'';this[_0x6c4e('0x1e')]=moment()['format'](_0x6c4e('0x1f'));this[_0x6c4e('0x20')]=_0x266061[_0x6c4e('0x20')];this[_0x6c4e('0x21')]=_0x266061[_0x6c4e('0x21')];this['callbackat']=_0x266061[_0x6c4e('0x22')];this[_0x6c4e('0x23')]=_0x266061['recallme'];this['originatecalleridnum']='';this[_0x6c4e('0x24')]='';}Action[_0x6c4e('0x25')][_0x6c4e('0x26')]=function(){return util[_0x6c4e('0x27')](_0x6c4e('0x28'),this[_0x6c4e('0x5')],this[_0x6c4e('0x29')]['dialCutDigit']>0x0?this[_0x6c4e('0xa')][_0x6c4e('0x2a')](this[_0x6c4e('0x29')][_0x6c4e('0x2b')]):this['number']);};Action[_0x6c4e('0x25')][_0x6c4e('0x2c')]=function(){return this[_0x6c4e('0xb')];};module[_0x6c4e('0x2d')]=Action;
\ No newline at end of file
diff --git a/server/services/ami/dialer/additionalPhone.js b/server/services/ami/dialer/additionalPhone.js
index ec1a783..e882330 100644
--- a/server/services/ami/dialer/additionalPhone.js
+++ b/server/services/ami/dialer/additionalPhone.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x8000=['CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','milliseconds','diff','seconds','uniqueid','scheduledat','type','outbound','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countmachineretry','countagentrejectretry','countdropretry','countabandonedretry','name','calleridnum','number','starttime','responsetime','endtime','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','UserId','VoiceQueueId'];(function(_0x24af91,_0x2b3882){var _0x13f997=function(_0x5af363){while(--_0x5af363){_0x24af91['push'](_0x24af91['shift']());}};_0x13f997(++_0x2b3882);}(_0x8000,0x12c));var _0x0800=function(_0x2d2423,_0x5ef6c){_0x2d2423=_0x2d2423-0x0;var _0x538db4=_0x8000[_0x2d2423];return _0x538db4;};'use strict';var util=require(_0x0800('0x0'));var _=require(_0x0800('0x1'));var moment=require('moment');function getSeconds(_0x207319,_0x413426){var _0x4cdcf8=moment(_0x207319)[_0x0800('0x2')](0x0);var _0x47ddc8=moment(_0x413426)[_0x0800('0x2')](0x0);return _0x4cdcf8[_0x0800('0x3')](_0x47ddc8,_0x0800('0x4'));}function AdditionalPhone(_0x34561b){this[_0x0800('0x5')]=_0x34561b[_0x0800('0x5')];this[_0x0800('0x6')]=_0x34561b[_0x0800('0x6')]||undefined;this[_0x0800('0x7')]=_0x34561b[_0x0800('0x7')];this['campaigntype']=_0x34561b[_0x0800('0x7')]===_0x0800('0x8')?'queue':_0x34561b[_0x0800('0x7')];this['countbusyretry']=_0x34561b[_0x0800('0x9')];this['countcongestionretry']=_0x34561b[_0x0800('0xa')];this[_0x0800('0xb')]=_0x34561b[_0x0800('0xb')];this[_0x0800('0xc')]=_0x34561b[_0x0800('0x9')]+_0x34561b[_0x0800('0xa')]+_0x34561b[_0x0800('0xb')]+_0x34561b[_0x0800('0xd')]+_0x34561b['countdropretry']+_0x34561b['countabandonedretry']+_0x34561b[_0x0800('0xe')]+_0x34561b[_0x0800('0xf')];this[_0x0800('0xd')]=_0x34561b[_0x0800('0xd')];this['countdropretry']=_0x34561b[_0x0800('0x10')];this[_0x0800('0x11')]=_0x34561b['countabandonedretry'];this[_0x0800('0xe')]=_0x34561b[_0x0800('0xe')];this[_0x0800('0xf')]=_0x34561b[_0x0800('0xf')];this['queue']=_0x34561b['queue'];this['calleridname']=_0x34561b[_0x0800('0x12')];this[_0x0800('0x13')]=_0x34561b[_0x0800('0x14')];this[_0x0800('0x15')]=_0x34561b[_0x0800('0x15')];this[_0x0800('0x16')]=_0x34561b[_0x0800('0x16')];this[_0x0800('0x17')]=_0x34561b[_0x0800('0x16')];this['ringtime']=getSeconds(_0x34561b['responsetime'],_0x34561b['starttime']);this[_0x0800('0x18')]=0x0;this[_0x0800('0x19')]=0x0;this[_0x0800('0x1a')]=_0x34561b[_0x0800('0x1a')];this['callbackuniqueid']=_0x34561b[_0x0800('0x1b')];this['callbackat']=_0x34561b[_0x0800('0x1c')];this['recallme']=_0x34561b[_0x0800('0x1d')];this[_0x0800('0x1e')]=_0x34561b[_0x0800('0x1e')];this['ListId']=_0x34561b['ListId'];this['UserId']=_0x34561b[_0x0800('0x1f')];this['VoiceQueueId']=_0x34561b[_0x0800('0x20')];this[_0x0800('0x21')]=_0x34561b[_0x0800('0x21')];this[_0x0800('0x22')]=_0x34561b[_0x0800('0x22')]||'';this[_0x0800('0x23')]=_0x34561b['originatecalleridname']||'';}module[_0x0800('0x24')]=History;
\ No newline at end of file
+var _0x030e=['responsetime','endtime','ringtime','starttime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','moment','milliseconds','diff','seconds','uniqueid','type','campaigntype','outbound','queue','countcongestionretry','countnoanswerretry','countbusyretry','countmachineretry','countagentrejectretry','countnosuchnumberretry','countdropretry','countabandonedretry','calleridname','name','calleridnum','number'];(function(_0x4dc3c2,_0x11e73e){var _0x31f644=function(_0x2f501e){while(--_0x2f501e){_0x4dc3c2['push'](_0x4dc3c2['shift']());}};_0x31f644(++_0x11e73e);}(_0x030e,0x1bd));var _0xe030=function(_0x44bb29,_0x41924e){_0x44bb29=_0x44bb29-0x0;var _0x2e34fd=_0x030e[_0x44bb29];return _0x2e34fd;};'use strict';var util=require(_0xe030('0x0'));var _=require(_0xe030('0x1'));var moment=require(_0xe030('0x2'));function getSeconds(_0x25c19f,_0x518ea9){var _0x498190=moment(_0x25c19f)['milliseconds'](0x0);var _0xc68663=moment(_0x518ea9)[_0xe030('0x3')](0x0);return _0x498190[_0xe030('0x4')](_0xc68663,_0xe030('0x5'));}function AdditionalPhone(_0x8be6af){this[_0xe030('0x6')]=_0x8be6af['uniqueid'];this['scheduledat']=_0x8be6af['scheduledat']||undefined;this['type']=_0x8be6af[_0xe030('0x7')];this[_0xe030('0x8')]=_0x8be6af[_0xe030('0x7')]===_0xe030('0x9')?_0xe030('0xa'):_0x8be6af[_0xe030('0x7')];this['countbusyretry']=_0x8be6af['countbusyretry'];this[_0xe030('0xb')]=_0x8be6af['countcongestionretry'];this[_0xe030('0xc')]=_0x8be6af[_0xe030('0xc')];this['countglobal']=_0x8be6af[_0xe030('0xd')]+_0x8be6af[_0xe030('0xb')]+_0x8be6af[_0xe030('0xc')]+_0x8be6af['countnosuchnumberretry']+_0x8be6af['countdropretry']+_0x8be6af['countabandonedretry']+_0x8be6af[_0xe030('0xe')]+_0x8be6af[_0xe030('0xf')];this[_0xe030('0x10')]=_0x8be6af[_0xe030('0x10')];this[_0xe030('0x11')]=_0x8be6af['countdropretry'];this['countabandonedretry']=_0x8be6af[_0xe030('0x12')];this['countmachineretry']=_0x8be6af[_0xe030('0xe')];this[_0xe030('0xf')]=_0x8be6af[_0xe030('0xf')];this['queue']=_0x8be6af['queue'];this[_0xe030('0x13')]=_0x8be6af[_0xe030('0x14')];this[_0xe030('0x15')]=_0x8be6af[_0xe030('0x16')];this['starttime']=_0x8be6af['starttime'];this[_0xe030('0x17')]=_0x8be6af[_0xe030('0x17')];this[_0xe030('0x18')]=_0x8be6af['responsetime'];this[_0xe030('0x19')]=getSeconds(_0x8be6af[_0xe030('0x17')],_0x8be6af[_0xe030('0x1a')]);this['holdtime']=0x0;this['talktime']=0x0;this['callback']=_0x8be6af[_0xe030('0x1b')];this[_0xe030('0x1c')]=_0x8be6af[_0xe030('0x1c')];this[_0xe030('0x1d')]=_0x8be6af[_0xe030('0x1d')];this[_0xe030('0x1e')]=_0x8be6af[_0xe030('0x1e')];this[_0xe030('0x1f')]=_0x8be6af['ContactId'];this['ListId']=_0x8be6af[_0xe030('0x20')];this['UserId']=_0x8be6af[_0xe030('0x21')];this[_0xe030('0x22')]=_0x8be6af['VoiceQueueId'];this['CampaignId']=_0x8be6af[_0xe030('0x23')];this[_0xe030('0x24')]=_0x8be6af['originatecalleridnum']||'';this['originatecalleridname']=_0x8be6af[_0xe030('0x25')]||'';}module[_0xe030('0x26')]=History;
\ No newline at end of file
diff --git a/server/services/ami/dialer/agentComplete.js b/server/services/ami/dialer/agentComplete.js
index 82b589f..6c8b46d 100644
--- a/server/services/ami/dialer/agentComplete.js
+++ b/server/services/ami/dialer/agentComplete.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x8975=['callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','lodash','moment','milliseconds','diff','seconds','state','statedesc','scheduledat','type','campaigntype','outbound','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','calleridnum','starttime','responsetime','answertime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','ringtime','holdtime','talktime','queue','membername','reason','callback'];(function(_0x4de54e,_0x575fb5){var _0x2dddf1=function(_0x4c847d){while(--_0x4c847d){_0x4de54e['push'](_0x4de54e['shift']());}};_0x2dddf1(++_0x575fb5);}(_0x8975,0xeb));var _0x5897=function(_0x13d07a,_0x41efc3){_0x13d07a=_0x13d07a-0x0;var _0x5ee0ee=_0x8975[_0x13d07a];return _0x5ee0ee;};'use strict';var util=require('util');var _=require(_0x5897('0x0'));var moment=require(_0x5897('0x1'));function getSeconds(_0x5c38ca,_0x59145e){var _0x185d89=moment(_0x5c38ca)[_0x5897('0x2')](0x0);var _0x2235e3=moment(_0x59145e)[_0x5897('0x2')](0x0);return _0x185d89[_0x5897('0x3')](_0x2235e3,_0x5897('0x4'));}function AgentComplete(_0x5492c7,_0x3a8315){this[_0x5897('0x5')]=0x4;this[_0x5897('0x6')]='Answer';this[_0x5897('0x7')]=_0x5492c7['scheduledat'];this[_0x5897('0x8')]=_0x5492c7['type'];this[_0x5897('0x9')]=_0x5492c7[_0x5897('0x8')]===_0x5897('0xa')?'queue':_0x5492c7[_0x5897('0x8')];this['countbusyretry']=_0x5492c7[_0x5897('0xb')];this[_0x5897('0xc')]=_0x5492c7[_0x5897('0xc')];this[_0x5897('0xd')]=_0x5492c7[_0x5897('0xd')];this[_0x5897('0xe')]=_0x5492c7['countbusyretry']+_0x5492c7['countcongestionretry']+_0x5492c7[_0x5897('0xd')]+_0x5492c7[_0x5897('0xf')]+_0x5492c7[_0x5897('0x10')]+_0x5492c7[_0x5897('0x11')]+_0x5492c7[_0x5897('0x12')]+_0x5492c7[_0x5897('0x13')];this['countnosuchnumberretry']=_0x5492c7[_0x5897('0xf')];this[_0x5897('0x10')]=_0x5492c7['countdropretry'];this[_0x5897('0x11')]=_0x5492c7['countabandonedretry'];this[_0x5897('0x12')]=_0x5492c7[_0x5897('0x12')];this[_0x5897('0x13')]=_0x5492c7['countagentrejectretry'];this[_0x5897('0x14')]=_0x3a8315[_0x5897('0x14')];this['calleridname']=_0x5492c7['name'];this[_0x5897('0x15')]=_0x5492c7['number'];this['starttime']=_0x5492c7[_0x5897('0x16')];this['responsetime']=_0x5492c7[_0x5897('0x17')];this[_0x5897('0x18')]=_0x5492c7[_0x5897('0x18')];this[_0x5897('0x19')]=moment()[_0x5897('0x1a')](_0x5897('0x1b'));this[_0x5897('0x1c')]=getSeconds(_0x5492c7[_0x5897('0x17')],_0x5492c7[_0x5897('0x16')]);this[_0x5897('0x1d')]=getSeconds(_0x5492c7[_0x5897('0x18')],_0x5492c7[_0x5897('0x17')]);this[_0x5897('0x1e')]=getSeconds(this[_0x5897('0x19')],_0x5492c7[_0x5897('0x18')]);this[_0x5897('0x1f')]=_0x3a8315[_0x5897('0x1f')];this[_0x5897('0x20')]=_0x3a8315[_0x5897('0x20')];this[_0x5897('0x21')]=_0x3a8315['reason'];this[_0x5897('0x22')]=_0x5492c7['callback'];this[_0x5897('0x23')]=_0x5492c7[_0x5897('0x23')];this['callbackat']=_0x5492c7[_0x5897('0x24')];this[_0x5897('0x25')]=_0x5492c7[_0x5897('0x25')];this[_0x5897('0x26')]=_0x5492c7['ContactId'];this[_0x5897('0x27')]=_0x5492c7['ListId'];this[_0x5897('0x28')]=_0x5492c7[_0x5897('0x28')];this[_0x5897('0x29')]=_0x5492c7[_0x5897('0x29')];this[_0x5897('0x2a')]=_0x5492c7[_0x5897('0x2a')];this[_0x5897('0x2b')]=_0x5492c7[_0x5897('0x2b')]||'';this[_0x5897('0x2c')]=_0x5492c7[_0x5897('0x2c')]||'';}module['exports']=AgentComplete;
\ No newline at end of file
+var _0x5c8e=['uniqueid','calleridname','name','calleridnum','starttime','responsetime','answertime','endtime','YYYY-MM-DD\x20HH:mm:ss','ringtime','holdtime','reason','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','moment','milliseconds','seconds','state','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countabandonedretry','countmachineretry','countagentrejectretry'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x5c8e,0xbb));var _0xe5c8=function(_0xa43ffe,_0x3999c7){_0xa43ffe=_0xa43ffe-0x0;var _0x1df04b=_0x5c8e[_0xa43ffe];return _0x1df04b;};'use strict';var util=require(_0xe5c8('0x0'));var _=require(_0xe5c8('0x1'));var moment=require(_0xe5c8('0x2'));function getSeconds(_0x1f81bb,_0xb95295){var _0x30510b=moment(_0x1f81bb)['milliseconds'](0x0);var _0x57d39a=moment(_0xb95295)[_0xe5c8('0x3')](0x0);return _0x30510b['diff'](_0x57d39a,_0xe5c8('0x4'));}function AgentComplete(_0x15cb32,_0x5c6b2a){this[_0xe5c8('0x5')]=0x4;this['statedesc']='Answer';this['scheduledat']=_0x15cb32[_0xe5c8('0x6')];this[_0xe5c8('0x7')]=_0x15cb32['type'];this[_0xe5c8('0x8')]=_0x15cb32[_0xe5c8('0x7')]===_0xe5c8('0x9')?_0xe5c8('0xa'):_0x15cb32[_0xe5c8('0x7')];this['countbusyretry']=_0x15cb32[_0xe5c8('0xb')];this[_0xe5c8('0xc')]=_0x15cb32['countcongestionretry'];this['countnoanswerretry']=_0x15cb32[_0xe5c8('0xd')];this['countglobal']=_0x15cb32[_0xe5c8('0xb')]+_0x15cb32[_0xe5c8('0xc')]+_0x15cb32[_0xe5c8('0xd')]+_0x15cb32[_0xe5c8('0xe')]+_0x15cb32['countdropretry']+_0x15cb32[_0xe5c8('0xf')]+_0x15cb32[_0xe5c8('0x10')]+_0x15cb32[_0xe5c8('0x11')];this[_0xe5c8('0xe')]=_0x15cb32[_0xe5c8('0xe')];this['countdropretry']=_0x15cb32['countdropretry'];this['countabandonedretry']=_0x15cb32[_0xe5c8('0xf')];this[_0xe5c8('0x10')]=_0x15cb32['countmachineretry'];this[_0xe5c8('0x11')]=_0x15cb32[_0xe5c8('0x11')];this[_0xe5c8('0x12')]=_0x5c6b2a[_0xe5c8('0x12')];this[_0xe5c8('0x13')]=_0x15cb32[_0xe5c8('0x14')];this[_0xe5c8('0x15')]=_0x15cb32['number'];this['starttime']=_0x15cb32[_0xe5c8('0x16')];this[_0xe5c8('0x17')]=_0x15cb32[_0xe5c8('0x17')];this['answertime']=_0x15cb32[_0xe5c8('0x18')];this[_0xe5c8('0x19')]=moment()['format'](_0xe5c8('0x1a'));this[_0xe5c8('0x1b')]=getSeconds(_0x15cb32['responsetime'],_0x15cb32[_0xe5c8('0x16')]);this[_0xe5c8('0x1c')]=getSeconds(_0x15cb32['answertime'],_0x15cb32[_0xe5c8('0x17')]);this['talktime']=getSeconds(this['endtime'],_0x15cb32[_0xe5c8('0x18')]);this['queue']=_0x5c6b2a['queue'];this['membername']=_0x5c6b2a['membername'];this[_0xe5c8('0x1d')]=_0x5c6b2a['reason'];this['callback']=_0x15cb32['callback'];this[_0xe5c8('0x1e')]=_0x15cb32[_0xe5c8('0x1e')];this['callbackat']=_0x15cb32[_0xe5c8('0x1f')];this[_0xe5c8('0x20')]=_0x15cb32[_0xe5c8('0x20')];this[_0xe5c8('0x21')]=_0x15cb32['ContactId'];this[_0xe5c8('0x22')]=_0x15cb32['ListId'];this[_0xe5c8('0x23')]=_0x15cb32[_0xe5c8('0x23')];this[_0xe5c8('0x24')]=_0x15cb32[_0xe5c8('0x24')];this[_0xe5c8('0x25')]=_0x15cb32[_0xe5c8('0x25')];this[_0xe5c8('0x26')]=_0x15cb32[_0xe5c8('0x26')]||'';this[_0xe5c8('0x27')]=_0x15cb32[_0xe5c8('0x27')]||'';}module[_0xe5c8('0x28')]=AgentComplete;
\ No newline at end of file
diff --git a/server/services/ami/dialer/final.js b/server/services/ami/dialer/final.js
index 731b660..f8ec490 100644
--- a/server/services/ami/dialer/final.js
+++ b/server/services/ami/dialer/final.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xe90d=['ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','util','lodash','moment','milliseconds','seconds','uniqueid','scheduledat','type','campaigntype','outbound','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countagentrejectretry','countmachineretry','queue','calleridname','calleridnum','responsetime','ringtime','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme'];(function(_0x7e2eb0,_0x17cd58){var _0xd92de4=function(_0x5d005b){while(--_0x5d005b){_0x7e2eb0['push'](_0x7e2eb0['shift']());}};_0xd92de4(++_0x17cd58);}(_0xe90d,0x97));var _0xde90=function(_0x5350b0,_0x52f632){_0x5350b0=_0x5350b0-0x0;var _0x486c30=_0xe90d[_0x5350b0];return _0x486c30;};'use strict';var util=require(_0xde90('0x0'));var _=require(_0xde90('0x1'));var moment=require(_0xde90('0x2'));function getSeconds(_0x15f714,_0x146cae){var _0x5f8e58=moment(_0x15f714)[_0xde90('0x3')](0x0);var _0x3c95cd=moment(_0x146cae)[_0xde90('0x3')](0x0);return _0x5f8e58['diff'](_0x3c95cd,_0xde90('0x4'));}function Final(_0x1bba9d){this[_0xde90('0x5')]=_0x1bba9d[_0xde90('0x5')];this[_0xde90('0x6')]=_0x1bba9d[_0xde90('0x6')];this[_0xde90('0x7')]=_0x1bba9d['type'];this[_0xde90('0x8')]=_0x1bba9d[_0xde90('0x7')]===_0xde90('0x9')?'queue':_0x1bba9d[_0xde90('0x7')];this[_0xde90('0xa')]=_0x1bba9d[_0xde90('0xa')];this[_0xde90('0xb')]=_0x1bba9d[_0xde90('0xb')];this['countnoanswerretry']=_0x1bba9d[_0xde90('0xc')];this['countglobal']=_0x1bba9d[_0xde90('0xa')]+_0x1bba9d[_0xde90('0xb')]+_0x1bba9d[_0xde90('0xc')]+_0x1bba9d[_0xde90('0xd')]+_0x1bba9d[_0xde90('0xe')]+_0x1bba9d[_0xde90('0xf')]+_0x1bba9d['countmachineretry']+_0x1bba9d[_0xde90('0x10')];this[_0xde90('0xd')]=_0x1bba9d[_0xde90('0xd')];this[_0xde90('0xe')]=_0x1bba9d[_0xde90('0xe')];this['countabandonedretry']=_0x1bba9d['countabandonedretry'];this['countmachineretry']=_0x1bba9d[_0xde90('0x11')];this[_0xde90('0x10')]=_0x1bba9d['countagentrejectretry'];this[_0xde90('0x12')]=_0x1bba9d[_0xde90('0x12')];this['calleridname']=_0x1bba9d[_0xde90('0x13')];this[_0xde90('0x14')]=_0x1bba9d[_0xde90('0x14')];this['starttime']=_0x1bba9d['starttime'];this[_0xde90('0x15')]=_0x1bba9d['responsetime'];this['endtime']=_0x1bba9d[_0xde90('0x15')];this['ringtime']=_0x1bba9d[_0xde90('0x16')]||0x0;this[_0xde90('0x17')]=_0x1bba9d[_0xde90('0x17')]||0x0;this[_0xde90('0x18')]=_0x1bba9d[_0xde90('0x18')]||0x0;this[_0xde90('0x19')]=_0x1bba9d['callback'];this['callbackuniqueid']=_0x1bba9d[_0xde90('0x1a')];this['callbackat']=_0x1bba9d[_0xde90('0x1b')];this[_0xde90('0x1c')]=_0x1bba9d[_0xde90('0x1c')];this['ContactId']=_0x1bba9d[_0xde90('0x1d')];this[_0xde90('0x1e')]=_0x1bba9d[_0xde90('0x1e')];this[_0xde90('0x1f')]=_0x1bba9d[_0xde90('0x1f')];this[_0xde90('0x20')]=_0x1bba9d[_0xde90('0x20')];this[_0xde90('0x21')]=_0x1bba9d[_0xde90('0x21')];this[_0xde90('0x22')]=_0x1bba9d[_0xde90('0x22')]||'';this[_0xde90('0x23')]=_0x1bba9d['originatecalleridname']||'';}module['exports']=Final;
\ No newline at end of file
+var _0x624e=['callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','lodash','milliseconds','diff','seconds','uniqueid','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countdropretry','countmachineretry','countabandonedretry','countagentrejectretry','calleridname','calleridnum','starttime','responsetime','endtime','ringtime','holdtime','talktime'];(function(_0x40afbc,_0x2c0e71){var _0x11d3f3=function(_0x13b9e0){while(--_0x13b9e0){_0x40afbc['push'](_0x40afbc['shift']());}};_0x11d3f3(++_0x2c0e71);}(_0x624e,0x162));var _0xe624=function(_0x2aeaed,_0x11ef0c){_0x2aeaed=_0x2aeaed-0x0;var _0x352d69=_0x624e[_0x2aeaed];return _0x352d69;};'use strict';var util=require('util');var _=require(_0xe624('0x0'));var moment=require('moment');function getSeconds(_0x26188a,_0x44f2c1){var _0x2388bb=moment(_0x26188a)[_0xe624('0x1')](0x0);var _0x4506f9=moment(_0x44f2c1)['milliseconds'](0x0);return _0x2388bb[_0xe624('0x2')](_0x4506f9,_0xe624('0x3'));}function Final(_0x3cbf74){this[_0xe624('0x4')]=_0x3cbf74['uniqueid'];this[_0xe624('0x5')]=_0x3cbf74[_0xe624('0x5')];this[_0xe624('0x6')]=_0x3cbf74['type'];this[_0xe624('0x7')]=_0x3cbf74[_0xe624('0x6')]===_0xe624('0x8')?_0xe624('0x9'):_0x3cbf74[_0xe624('0x6')];this[_0xe624('0xa')]=_0x3cbf74[_0xe624('0xa')];this['countcongestionretry']=_0x3cbf74[_0xe624('0xb')];this[_0xe624('0xc')]=_0x3cbf74[_0xe624('0xc')];this[_0xe624('0xd')]=_0x3cbf74[_0xe624('0xa')]+_0x3cbf74['countcongestionretry']+_0x3cbf74[_0xe624('0xc')]+_0x3cbf74['countnosuchnumberretry']+_0x3cbf74[_0xe624('0xe')]+_0x3cbf74['countabandonedretry']+_0x3cbf74[_0xe624('0xf')]+_0x3cbf74['countagentrejectretry'];this['countnosuchnumberretry']=_0x3cbf74['countnosuchnumberretry'];this[_0xe624('0xe')]=_0x3cbf74['countdropretry'];this['countabandonedretry']=_0x3cbf74[_0xe624('0x10')];this[_0xe624('0xf')]=_0x3cbf74[_0xe624('0xf')];this[_0xe624('0x11')]=_0x3cbf74['countagentrejectretry'];this[_0xe624('0x9')]=_0x3cbf74[_0xe624('0x9')];this['calleridname']=_0x3cbf74[_0xe624('0x12')];this[_0xe624('0x13')]=_0x3cbf74[_0xe624('0x13')];this['starttime']=_0x3cbf74[_0xe624('0x14')];this[_0xe624('0x15')]=_0x3cbf74['responsetime'];this[_0xe624('0x16')]=_0x3cbf74['responsetime'];this[_0xe624('0x17')]=_0x3cbf74[_0xe624('0x17')]||0x0;this[_0xe624('0x18')]=_0x3cbf74[_0xe624('0x18')]||0x0;this[_0xe624('0x19')]=_0x3cbf74[_0xe624('0x19')]||0x0;this[_0xe624('0x1a')]=_0x3cbf74['callback'];this['callbackuniqueid']=_0x3cbf74[_0xe624('0x1b')];this[_0xe624('0x1c')]=_0x3cbf74[_0xe624('0x1c')];this[_0xe624('0x1d')]=_0x3cbf74[_0xe624('0x1d')];this[_0xe624('0x1e')]=_0x3cbf74['ContactId'];this[_0xe624('0x1f')]=_0x3cbf74[_0xe624('0x1f')];this[_0xe624('0x20')]=_0x3cbf74[_0xe624('0x20')];this[_0xe624('0x21')]=_0x3cbf74['VoiceQueueId'];this[_0xe624('0x22')]=_0x3cbf74[_0xe624('0x22')];this['originatecalleridnum']=_0x3cbf74[_0xe624('0x23')]||'';this['originatecalleridname']=_0x3cbf74[_0xe624('0x24')]||'';}module[_0xe624('0x25')]=Final;
\ No newline at end of file
diff --git a/server/services/ami/dialer/hangup.js b/server/services/ami/dialer/hangup.js
index 2886a53..8dc2ef6 100644
--- a/server/services/ami/dialer/hangup.js
+++ b/server/services/ami/dialer/hangup.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x5472=['diff','state','statedesc','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countdropretry','countabandonedretry','countmachineretry','countnosuchnumberretry','countagentrejectretry','uniqueid','calleridname','name','calleridnum','number','starttime','responsetime','format','YYYY-MM-DD\x20HH:mm:ss','ringtime','holdtime','talktime','membername','IVR','reason','callback','callbackuniqueid','recallme','ContactId','ListId','UserId','CampaignId','lodash','moment','milliseconds'];(function(_0x2ae1ca,_0x23aa0b){var _0x1f82ad=function(_0x46474f){while(--_0x46474f){_0x2ae1ca['push'](_0x2ae1ca['shift']());}};_0x1f82ad(++_0x23aa0b);}(_0x5472,0x7b));var _0x2547=function(_0x708c47,_0x6eaa1f){_0x708c47=_0x708c47-0x0;var _0x52a470=_0x5472[_0x708c47];return _0x52a470;};'use strict';var util=require('util');var _=require(_0x2547('0x0'));var moment=require(_0x2547('0x1'));function getSeconds(_0x3650c4,_0x1ab408){var _0x5f5a81=moment(_0x3650c4)[_0x2547('0x2')](0x0);var _0x286916=moment(_0x1ab408)[_0x2547('0x2')](0x0);return _0x5f5a81[_0x2547('0x3')](_0x286916,'seconds');}function Hangup(_0x55c5b5,_0x442b57){this[_0x2547('0x4')]=0x4;this[_0x2547('0x5')]='Answer';this[_0x2547('0x6')]=_0x55c5b5[_0x2547('0x6')];this[_0x2547('0x7')]=_0x55c5b5[_0x2547('0x7')];this[_0x2547('0x8')]=_0x55c5b5['type']===_0x2547('0x9')?_0x2547('0xa'):_0x55c5b5[_0x2547('0x7')];this[_0x2547('0xb')]=_0x55c5b5[_0x2547('0xb')];this[_0x2547('0xc')]=_0x55c5b5[_0x2547('0xc')];this['countnoanswerretry']=_0x55c5b5[_0x2547('0xd')];this[_0x2547('0xe')]=_0x55c5b5['countbusyretry']+_0x55c5b5['countcongestionretry']+_0x55c5b5[_0x2547('0xd')]+_0x55c5b5['countnosuchnumberretry']+_0x55c5b5[_0x2547('0xf')]+_0x55c5b5[_0x2547('0x10')]+_0x55c5b5[_0x2547('0x11')]+_0x55c5b5['countagentrejectretry'];this[_0x2547('0x12')]=_0x55c5b5[_0x2547('0x12')];this[_0x2547('0xf')]=_0x55c5b5[_0x2547('0xf')];this[_0x2547('0x10')]=_0x55c5b5[_0x2547('0x10')];this[_0x2547('0x11')]=_0x55c5b5[_0x2547('0x11')];this[_0x2547('0x13')]=_0x55c5b5[_0x2547('0x13')];this['uniqueid']=_0x442b57[_0x2547('0x14')];this[_0x2547('0x15')]=_0x55c5b5[_0x2547('0x16')];this[_0x2547('0x17')]=_0x55c5b5[_0x2547('0x18')];this['starttime']=_0x55c5b5[_0x2547('0x19')];this[_0x2547('0x1a')]=_0x55c5b5['responsetime'];this['endtime']=moment()[_0x2547('0x1b')](_0x2547('0x1c'));this[_0x2547('0x1d')]=getSeconds(_0x55c5b5['responsetime'],_0x55c5b5[_0x2547('0x19')]);this[_0x2547('0x1e')]=0x0;this[_0x2547('0x1f')]=getSeconds(this['endtime'],_0x55c5b5['responsetime']);this[_0x2547('0xa')]=_0x55c5b5[_0x2547('0xa')];this[_0x2547('0x20')]=_0x2547('0x21');this[_0x2547('0x22')]=_0x442b57['cause-txt'];this[_0x2547('0x23')]=_0x55c5b5[_0x2547('0x23')];this[_0x2547('0x24')]=_0x55c5b5[_0x2547('0x24')];this['callbackat']=_0x55c5b5['callbackat'];this[_0x2547('0x25')]=_0x55c5b5['recallme'];this['ContactId']=_0x55c5b5[_0x2547('0x26')];this[_0x2547('0x27')]=_0x55c5b5['ListId'];this[_0x2547('0x28')]=_0x55c5b5[_0x2547('0x28')];this['VoiceQueueId']=_0x55c5b5['VoiceQueueId'];this[_0x2547('0x29')]=_0x55c5b5['CampaignId'];}module['exports']=Hangup;
\ No newline at end of file
+var _0x4359=['countagentrejectretry','countnosuchnumberretry','countabandonedretry','uniqueid','calleridname','name','calleridnum','starttime','responsetime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','ringtime','holdtime','membername','IVR','reason','cause-txt','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','exports','util','lodash','moment','milliseconds','diff','seconds','state','Answer','scheduledat','type','campaigntype','queue','countcongestionretry','countnoanswerretry','countglobal','countbusyretry','countdropretry','countmachineretry'];(function(_0x4a64f5,_0x2ec027){var _0x3ce2eb=function(_0x504ae2){while(--_0x504ae2){_0x4a64f5['push'](_0x4a64f5['shift']());}};_0x3ce2eb(++_0x2ec027);}(_0x4359,0x1dd));var _0x9435=function(_0x703841,_0x52fe1b){_0x703841=_0x703841-0x0;var _0x5e9e58=_0x4359[_0x703841];return _0x5e9e58;};'use strict';var util=require(_0x9435('0x0'));var _=require(_0x9435('0x1'));var moment=require(_0x9435('0x2'));function getSeconds(_0x287f3f,_0x32e54f){var _0x3cac57=moment(_0x287f3f)[_0x9435('0x3')](0x0);var _0x3d9270=moment(_0x32e54f)['milliseconds'](0x0);return _0x3cac57[_0x9435('0x4')](_0x3d9270,_0x9435('0x5'));}function Hangup(_0x5d6843,_0xcc1f9d){this[_0x9435('0x6')]=0x4;this['statedesc']=_0x9435('0x7');this[_0x9435('0x8')]=_0x5d6843[_0x9435('0x8')];this[_0x9435('0x9')]=_0x5d6843['type'];this[_0x9435('0xa')]=_0x5d6843[_0x9435('0x9')]==='outbound'?_0x9435('0xb'):_0x5d6843[_0x9435('0x9')];this['countbusyretry']=_0x5d6843['countbusyretry'];this[_0x9435('0xc')]=_0x5d6843[_0x9435('0xc')];this[_0x9435('0xd')]=_0x5d6843[_0x9435('0xd')];this[_0x9435('0xe')]=_0x5d6843[_0x9435('0xf')]+_0x5d6843['countcongestionretry']+_0x5d6843[_0x9435('0xd')]+_0x5d6843['countnosuchnumberretry']+_0x5d6843[_0x9435('0x10')]+_0x5d6843['countabandonedretry']+_0x5d6843[_0x9435('0x11')]+_0x5d6843[_0x9435('0x12')];this[_0x9435('0x13')]=_0x5d6843[_0x9435('0x13')];this[_0x9435('0x10')]=_0x5d6843[_0x9435('0x10')];this[_0x9435('0x14')]=_0x5d6843[_0x9435('0x14')];this[_0x9435('0x11')]=_0x5d6843[_0x9435('0x11')];this[_0x9435('0x12')]=_0x5d6843[_0x9435('0x12')];this[_0x9435('0x15')]=_0xcc1f9d[_0x9435('0x15')];this[_0x9435('0x16')]=_0x5d6843[_0x9435('0x17')];this[_0x9435('0x18')]=_0x5d6843['number'];this['starttime']=_0x5d6843[_0x9435('0x19')];this[_0x9435('0x1a')]=_0x5d6843[_0x9435('0x1a')];this[_0x9435('0x1b')]=moment()[_0x9435('0x1c')](_0x9435('0x1d'));this[_0x9435('0x1e')]=getSeconds(_0x5d6843['responsetime'],_0x5d6843[_0x9435('0x19')]);this[_0x9435('0x1f')]=0x0;this['talktime']=getSeconds(this[_0x9435('0x1b')],_0x5d6843['responsetime']);this[_0x9435('0xb')]=_0x5d6843['queue'];this[_0x9435('0x20')]=_0x9435('0x21');this[_0x9435('0x22')]=_0xcc1f9d[_0x9435('0x23')];this['callback']=_0x5d6843['callback'];this[_0x9435('0x24')]=_0x5d6843['callbackuniqueid'];this[_0x9435('0x25')]=_0x5d6843['callbackat'];this['recallme']=_0x5d6843[_0x9435('0x26')];this[_0x9435('0x27')]=_0x5d6843[_0x9435('0x27')];this[_0x9435('0x28')]=_0x5d6843['ListId'];this[_0x9435('0x29')]=_0x5d6843['UserId'];this['VoiceQueueId']=_0x5d6843[_0x9435('0x2a')];this[_0x9435('0x2b')]=_0x5d6843[_0x9435('0x2b')];}module[_0x9435('0x2c')]=Hangup;
\ No newline at end of file
diff --git a/server/services/ami/dialer/history.js b/server/services/ami/dialer/history.js
index 125dcab..88dab47 100644
--- a/server/services/ami/dialer/history.js
+++ b/server/services/ami/dialer/history.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x78f4=['countmachineretry','calleridnum','number','responsetime','starttime','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','CampaignId','originatecalleridnum','originatecalleridname','exports','moment','milliseconds','seconds','uniqueid','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countagentrejectretry'];(function(_0x5be7aa,_0x5de661){var _0x215408=function(_0x353715){while(--_0x353715){_0x5be7aa['push'](_0x5be7aa['shift']());}};_0x215408(++_0x5de661);}(_0x78f4,0x193));var _0x478f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x78f4[_0x3dd15e];return _0x231fd0;};'use strict';var util=require('util');var _=require('lodash');var moment=require(_0x478f('0x0'));function getSeconds(_0x4a4d67,_0x104b99){var _0x5ccd95=moment(_0x4a4d67)[_0x478f('0x1')](0x0);var _0x198b15=moment(_0x104b99)['milliseconds'](0x0);return _0x5ccd95['diff'](_0x198b15,_0x478f('0x2'));}function History(_0xd697b){this[_0x478f('0x3')]=_0xd697b[_0x478f('0x3')];this[_0x478f('0x4')]=_0xd697b[_0x478f('0x4')]||undefined;this['type']=_0xd697b[_0x478f('0x5')];this[_0x478f('0x6')]=_0xd697b['type']===_0x478f('0x7')?_0x478f('0x8'):_0xd697b['type'];this[_0x478f('0x9')]=_0xd697b[_0x478f('0x9')];this[_0x478f('0xa')]=_0xd697b[_0x478f('0xa')];this[_0x478f('0xb')]=_0xd697b[_0x478f('0xb')];this[_0x478f('0xc')]=_0xd697b[_0x478f('0x9')]+_0xd697b['countcongestionretry']+_0xd697b[_0x478f('0xb')]+_0xd697b[_0x478f('0xd')]+_0xd697b[_0x478f('0xe')]+_0xd697b[_0x478f('0xf')]+_0xd697b['countmachineretry']+_0xd697b[_0x478f('0x10')];this['countnosuchnumberretry']=_0xd697b[_0x478f('0xd')];this[_0x478f('0xe')]=_0xd697b[_0x478f('0xe')];this[_0x478f('0xf')]=_0xd697b[_0x478f('0xf')];this[_0x478f('0x11')]=_0xd697b[_0x478f('0x11')];this[_0x478f('0x10')]=_0xd697b[_0x478f('0x10')];this[_0x478f('0x8')]=_0xd697b['queue'];this['calleridname']=_0xd697b['name'];this[_0x478f('0x12')]=_0xd697b[_0x478f('0x13')];this['starttime']=_0xd697b['starttime'];this[_0x478f('0x14')]=_0xd697b[_0x478f('0x14')];this['endtime']=_0xd697b[_0x478f('0x14')];this['ringtime']=getSeconds(_0xd697b[_0x478f('0x14')],_0xd697b[_0x478f('0x15')]);this[_0x478f('0x16')]=0x0;this[_0x478f('0x17')]=0x0;this[_0x478f('0x18')]=_0xd697b[_0x478f('0x18')];this[_0x478f('0x19')]=_0xd697b[_0x478f('0x19')];this[_0x478f('0x1a')]=_0xd697b[_0x478f('0x1a')];this[_0x478f('0x1b')]=_0xd697b[_0x478f('0x1b')];this[_0x478f('0x1c')]=_0xd697b[_0x478f('0x1c')];this[_0x478f('0x1d')]=_0xd697b[_0x478f('0x1d')];this[_0x478f('0x1e')]=_0xd697b['UserId'];this['VoiceQueueId']=_0xd697b['VoiceQueueId'];this[_0x478f('0x1f')]=_0xd697b[_0x478f('0x1f')];this[_0x478f('0x20')]=_0xd697b[_0x478f('0x20')]||'';this[_0x478f('0x21')]=_0xd697b[_0x478f('0x21')]||'';}module[_0x478f('0x22')]=History;
\ No newline at end of file
+var _0xb4a3=['milliseconds','seconds','uniqueid','scheduledat','type','campaigntype','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countabandonedretry','countmachineretry','countagentrejectretry','countdropretry','name','calleridnum','starttime','responsetime','endtime','ringtime','holdtime','callback','callbackuniqueid','callbackat','ContactId','ListId','UserId','VoiceQueueId','originatecalleridnum','originatecalleridname','util','lodash'];(function(_0x413feb,_0x10477f){var _0x40ee88=function(_0x32a3f6){while(--_0x32a3f6){_0x413feb['push'](_0x413feb['shift']());}};_0x40ee88(++_0x10477f);}(_0xb4a3,0x174));var _0x3b4a=function(_0x2fdce0,_0x496242){_0x2fdce0=_0x2fdce0-0x0;var _0x36f07e=_0xb4a3[_0x2fdce0];return _0x36f07e;};'use strict';var util=require(_0x3b4a('0x0'));var _=require(_0x3b4a('0x1'));var moment=require('moment');function getSeconds(_0x1563cc,_0x506539){var _0x39016d=moment(_0x1563cc)['milliseconds'](0x0);var _0x410b5b=moment(_0x506539)[_0x3b4a('0x2')](0x0);return _0x39016d['diff'](_0x410b5b,_0x3b4a('0x3'));}function History(_0x47b8bf){this[_0x3b4a('0x4')]=_0x47b8bf[_0x3b4a('0x4')];this[_0x3b4a('0x5')]=_0x47b8bf['scheduledat']||undefined;this['type']=_0x47b8bf[_0x3b4a('0x6')];this[_0x3b4a('0x7')]=_0x47b8bf['type']==='outbound'?_0x3b4a('0x8'):_0x47b8bf[_0x3b4a('0x6')];this[_0x3b4a('0x9')]=_0x47b8bf[_0x3b4a('0x9')];this[_0x3b4a('0xa')]=_0x47b8bf['countcongestionretry'];this[_0x3b4a('0xb')]=_0x47b8bf[_0x3b4a('0xb')];this[_0x3b4a('0xc')]=_0x47b8bf[_0x3b4a('0x9')]+_0x47b8bf['countcongestionretry']+_0x47b8bf[_0x3b4a('0xb')]+_0x47b8bf[_0x3b4a('0xd')]+_0x47b8bf['countdropretry']+_0x47b8bf[_0x3b4a('0xe')]+_0x47b8bf[_0x3b4a('0xf')]+_0x47b8bf[_0x3b4a('0x10')];this[_0x3b4a('0xd')]=_0x47b8bf[_0x3b4a('0xd')];this[_0x3b4a('0x11')]=_0x47b8bf[_0x3b4a('0x11')];this['countabandonedretry']=_0x47b8bf[_0x3b4a('0xe')];this['countmachineretry']=_0x47b8bf[_0x3b4a('0xf')];this[_0x3b4a('0x10')]=_0x47b8bf['countagentrejectretry'];this[_0x3b4a('0x8')]=_0x47b8bf[_0x3b4a('0x8')];this['calleridname']=_0x47b8bf[_0x3b4a('0x12')];this[_0x3b4a('0x13')]=_0x47b8bf['number'];this[_0x3b4a('0x14')]=_0x47b8bf[_0x3b4a('0x14')];this['responsetime']=_0x47b8bf[_0x3b4a('0x15')];this[_0x3b4a('0x16')]=_0x47b8bf['responsetime'];this[_0x3b4a('0x17')]=getSeconds(_0x47b8bf[_0x3b4a('0x15')],_0x47b8bf['starttime']);this[_0x3b4a('0x18')]=0x0;this['talktime']=0x0;this[_0x3b4a('0x19')]=_0x47b8bf['callback'];this[_0x3b4a('0x1a')]=_0x47b8bf['callbackuniqueid'];this[_0x3b4a('0x1b')]=_0x47b8bf[_0x3b4a('0x1b')];this['recallme']=_0x47b8bf['recallme'];this[_0x3b4a('0x1c')]=_0x47b8bf[_0x3b4a('0x1c')];this[_0x3b4a('0x1d')]=_0x47b8bf[_0x3b4a('0x1d')];this[_0x3b4a('0x1e')]=_0x47b8bf[_0x3b4a('0x1e')];this[_0x3b4a('0x1f')]=_0x47b8bf[_0x3b4a('0x1f')];this['CampaignId']=_0x47b8bf['CampaignId'];this[_0x3b4a('0x20')]=_0x47b8bf[_0x3b4a('0x20')]||'';this[_0x3b4a('0x21')]=_0x47b8bf[_0x3b4a('0x21')]||'';}module['exports']=History;
\ No newline at end of file
diff --git a/server/services/ami/dialer/index.js b/server/services/ami/dialer/index.js
index 72f6335..8d177ad 100644
--- a/server/services/ami/dialer/index.js
+++ b/server/services/ami/dialer/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xdf88=['AVAILABLE_CONTACTS_FINISHED','[getContactDialer2][Empty]','sendMessageOneNotActive','talking','waiting','pTalking','IS_DISACTIVED','[syncQueueSummary]\x20Campaign\x20Queue:\x20','is\x20disactive','is\x20not\x20active','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','state','statedesc','endtime','starttime','clearZombieChannels','[uniqueid]','[actions]','isNil','Action','channel','catch','No\x20such\x20channel','updateOriginated','[Dialer][checkChannel]','queue','[Dialer][checkChannel][ivr]','resolve','then','countReScheduled','checkIsBlackList','[checkIsBlackList]\x20','checkIsBlackListIvr','[checkIsBlackListIvr]\x20','averageHandleTime','avgHandleTime','[averageHandleTime]\x20','rescheduleContact','[rescheduleContact]\x20','unlockContact','getContactDialer','[getContactDialer]\x20','getContactDialerIvr','getVoiceQueueRtPauses','moveContactManagedDialer','createHistory','[createHistory]\x20','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','loggerHandler','inspect','emptyContact','merge','pick','ContactId','UserId','VoiceQueueId','[emptyContact][createHistory]','Success','SIP/%s','reachable','status','unmonitored','saveInDb','uniqueid','variable','amdstatus','exten','xcally-motion-dialer','dialAMDActive','value','HANGUP','HangupInAMD','membername','AMD','[syncHangupInAMD]','MACHINE','Machine','countmachineretry','countglobal','amd','[syncAgentComplete][createHistory][0]','countcongestionretry','countnoanswerretry','countdropretry','countabandonedretry','countagentrejectretry','dialGlobalMaxRetry','stateGlobal','dialMachineMaxRetry','add','dialMachineRetryFrequency','YYYY-MM-DD\x20HH:mm:ss','ListId','CampaignId','[syncHangupInAMDIvr][createHistory]','countbusyretry','countnosuchnumberretry','reason19\x20machine....','reason\x2019\x20machine....','minutes','[rescheduleContact][Machine]','dialQueueProject','AnswerAGI','AGI','[syncHangupIvr][createHistory]','[syncHangupIvr]','cause-txt','Unknow','reason','agent','agiafterat','dialQueueProject2','dialAgiAfterHangupAgent','[syncAgentComplete]','answertime','queueCallerAbandonCreateState','[syncAgentComplete][createHistory]','[syncQueueCallerAbandon]\x20[Drop]','droptime','responsetime','dialQueueTimeout','Drop','dropreason','TIMEOUT','dialDropRetryFrequency','[rescheduleContact][Drop]','calleridname','calleridnum','[syncAgentComplete][createHistory][10]','Abandoned','CALLEREXIT','dialAbandonedRetryFrequency','[syncAgentComplete][createHistory][11]','actionid','stateinterface','locked','push','idHopper','[unlockQueueStatus][undefined]','[booked][unlockQueueStatus]','queueStatusComplete','run','[unlock][syncQueueStatusComplete]','queueBookedRR','_rr','length','paused','unlockRR','Agent:\x20','contactAgent-idHopper:\x20','[Catch][Preview][syncQueueStatusComplete]','[booked][unlock]','[booked][unlock2]','[booked][unlock3]','[unlock3][syncQueueStatusComplete]','syncCampaigns','checkIsTrunkReachable','isTrunkReachable','TRUNK_IS_NOT_REACHABLE','\x20trunk\x20is\x20not\x20reachable','ifTime','checkIfTimeIntervals','Intervals','Failure','\x20Intervals\x20is\x20null\x20','INTERVAL_IS_EMPTY','timezones','TIMEZONE_UNKNOW','iftime\x20%s,%s','indexOf','command','content','true','all','some','GLOBAL_INTERVAL_IS_OVERTIME','INTERVAL_IS_OVERTIME','[ifTime][promiseAll]','Timezone:\x20','checkDialMethod','progressive','handlePower','power','dialPowerLevel','booked','Queue','method\x20not\x20recognized','launchHandleIvr','handleIvr','checkIfTime','dialTimezone','[syncQueueSummary]','dialGlobalInterval','[syncCampaigns]','\x5cw{0,','pow','replace','random','match','actionOriginate','object','Contact','phone','originate','contact\x20is\x20undefine','getCaller','\x22agi://%s/square,%s\x22','NONE','\x22%s,%s%s,,,%s\x22','dialQueueOptions','dialer','ACTIVE','XMD-AMDINITIALSILENCE','dialAMDInitialSilence','XMD-AMDAFTERGREETINGSILENCE','dialAMDAfterGreetingSilence','XMD-AMDTOTALANALYSISTIME','dialAMDTotalAnalysisTime','dialAMDMinWordLength','XMD-AMDBETWEENWORDSSILENCE','dialAMDBetweenWordsSilence','XMD-AMDMAXIMUMNUMBEROFWORDS','dialAMDMaximumNumberOfWords','XMD-AMDSILENCETHRESHOLD','dialAMDSilenceThreshold','XMD-AMDMAXIMUMWORDLENGTH','dialAMDMaximumWordLength','XMD-VOICEQUEUEID','XMD-CAMPAIGNID','tags','createdAt','updatedAt','%s%s','XMD-','toUpper','dialRandomLastDigitCallerIdNumber','TrunkBackup','XMD-ORIGINATECALLERIDNAME','originatecalleridname','XMD-ORIGINATECALLERIDNUM','SIP/%s/%s%s','dialPrefix','trim','dialCutDigit','substring','[originateError]:\x20%s','OriginateError','[originate][error]','isSuccess','response','[callProgressDetecting]\x20','checkRetriveMax','dialNoAnswerRetryFrequency','[rescheduleContact][NoAnswer]','dialBusyRetryFrequency','[rescheduleContact]\x20[Busy]','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','[rescheduleContact][NoSuchNumber]','dialDropMaxRetry','dialAbandonedMaxRetry','[rescheduleContact][Abandoned]','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','[rescheduleContact][AgentReject]','callProgressDetecting','entity\x20is\x20undefine','[callProgressDetecting]','evt\x20is\x20undefine','NoSuchNumber','custom:agentnosuchnumber','nosuchnumber','createStateFinal','reason\x200\x20no\x20such\x20number....','outboundNoAnswerCallsDay','NoAnswer','custom:agentnoanswer','buildObj','dialNoAnswerMaxRetry','reason\x203\x20ringing\x20no\x20answer','custom:agentbusy','dialBusyMaxRetry','reason\x205\x20busy','outboundCongestionCallsDay','Congestion','custom:agentcongestion','[syncAgentComplete][createHistory][8]','reason\x208\x20congestion','reason\x2011\x20abandoned','AgentReject','custom:agentreject','agentreject','[syncAgentComplete][createHistory][20]','reason\x2020\x20agentreject','[syncAgentComplete][createHistory][?]','[moveContactManagedDialer][0]','dialPredictiveOptimizationPercentage','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','round','predictiveIntervalMinThreshold','floor','predictiveIntervalMultiplicativeFactor','[startMethodPredictive][StartProgressive]','check\x20handlePredictive\x20is\x20not\x20undefine','collection\x20data\x20in\x20progressive\x20at','dialPredictiveInterval','[startMethodPredictive][StartProgressive][Loop]','dropRate','[stopMethodPredictive][ReStartProgressive][ExceededDropDay]','dialPredictiveOptimization','Drop\x20in\x20this\x20interval','started\x20in\x20predictive\x20at','getDataPredictive','startMethodPredictive','recalculate\x20predictive\x20at','Predictive\x20for\x20every\x20interval','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',')\x20are\x20more\x20than\x20threshold\x20(','agentBusyFactor','busyFactor','[getDataPredictive]','Unknown\x20Predictive','check\x20failure','getDataPredictiveOld','outboundQueuePauses','abandonmentRate','[CatchErlangB]','one\x20call\x20every:','[handlePredictive]','checkContactBlack','recallme','queueStatusComplete:\x20','Queue:\x20','[unlockOriginate][syncQueueStatusComplete]','scheduledat','Agent','voicePause','outboundReCallsDay','dialRecallInQueue','[rescheduleContact][dialRecallInQueue]','RECALLINQUEUE','[Originate][HistoryDialRecallInQueue][historyCatch]','RecallFailedTimeout','[Originate][HistoryRecallClose]','BLACKLIST','Blacklist','[Originate][historyBlacklist]','[Originate][MoveBlacklist]','inBlackList','limitCalls','temp','dialOrderByScheduledAt','[getContactCampaign2][Empty]','[actionOriginate]\x20','Contact.phone','[getContactCampaign2]','dialLimitQueue','not_inuse','[countReScheduled]\x20','RUNNING','tryOriginatePredictive','[actionOriginatePredictive]\x20','--------\x20Drop\x20Rate\x20--------','Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Amax:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','m\x20=\x20','[abandonmentRate]','Ts\x20=\x20','p\x20=\x20','interval\x20=\x20','Amax\x20=\x20','Ts:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','P:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Umin:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[busyFactor]','exports','util','lodash','bluebird','uuid','moment','md5','../preview/util/util','../../../config/logger','predictive','syncQueueSummary','../ami','redis','../rpc/cmHopperFinal','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/voiceQueueRt','./history','./final','./agentComplete','./queueCallerAbandon','./hangup','env','XCALLY_IP_AGI','rrmemory','roundrobin','prototype','enqueue','tail','finally','sequence','preview','voiceQueues','campaigns','agents','trunks','maxNumberOriginate','channels','actions','contactsId','uniqueId','optionPredictive','startPredictive','startProgressive','ivrOriginated','queueBooked','syncAgentConnect','bind','syncQueueCallerAbandon','syncOriginateResponse','agentcomplete','syncAgentComplete','hangup','syncHangup','newexten','syncNewExten','varset','syncVarSet','syncQueueMember','queuestatuscomplete','syncQueueStatusComplete','loopCampaigns','loopClearZombieChannels','message','name','\x20AGENTS\x20NOT\x20LOGGED','NOT_ACTIVE','\x20NOT\x20Active','Interval','\x20INTERVAL_IS_NULL','isEmpty','INTERVAL_IS_NULL','[ifTime][Action]','Error','milliseconds','diff','seconds','emit','type','outbound','strategy','answered','available','loggedIn','sumBillable','sumDuration','sumHoldTime','total','unmanaged','abandoned','loggedInDb','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalPauses','predictiveIntervalTotalCalls','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','Trunk','active','callerid','stringify','format','voice:queue:%s','voice_queue:save','ivr','campaign:ivr:%s','campaign:save','-----\x20Stats\x20Predictive\x20---','info','Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','---------------------------','Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive','History\x20information\x20are\x20empty','Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20','isUndefined','clearing\x20variable\x20start\x20progressive','clearing\x20variable\x20start\x20predictive','handlePredictive','clearing\x20variable\x20handle\x20predictive','string','\x22%s\x22\x20<%s>','\x22\x22\x20<>','error','stack','hasOwnProperty','[decremetOriginate]\x20object\x20originated\x20is\x20negative','[decremetOriginate]\x20is\x20null\x20or\x20undefined','RESCHEDULED_CONTACTS','[getContactDialer2][ReScheduled]','contactsRescheduled','contacts'];(function(_0x2142a0,_0xd5220){var _0xed9a6e=function(_0x30c060){while(--_0x30c060){_0x2142a0['push'](_0x2142a0['shift']());}};_0xed9a6e(++_0xd5220);}(_0xdf88,0x17c));var _0x8df8=function(_0x4026c0,_0x5045e6){_0x4026c0=_0x4026c0-0x0;var _0x59c7dc=_0xdf88[_0x4026c0];return _0x59c7dc;};'use strict';var util=require(_0x8df8('0x0'));var _=require(_0x8df8('0x1'));var BPromise=require(_0x8df8('0x2'));var uuid=require(_0x8df8('0x3'));var moment=require(_0x8df8('0x4'));var rr=require('rr');var md5=require(_0x8df8('0x5'));var Redis=require('ioredis');var ut=require(_0x8df8('0x6'));var config=require('../../../config/environment/');var logger=require(_0x8df8('0x7'))('dialer');var loggerBooked=require(_0x8df8('0x7'))('booked');var loggerPredictive=require(_0x8df8('0x7'))(_0x8df8('0x8'));var loggerPredictiveCalls=require(_0x8df8('0x7'))('predictiveCalls');var loggerSyncQueueSummary=require(_0x8df8('0x7'))(_0x8df8('0x9'));var ami=require(_0x8df8('0xa'));config['redis']=_['defaults'](config[_0x8df8('0xb')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x8df8('0xb')]));var cmHopper=require('../rpc/cmHopper');var cmHopperFinal=require(_0x8df8('0xc'));var cmHopperHistory=require(_0x8df8('0xd'));var cmHopperBlack=require(_0x8df8('0xe'));var voiceQueueRt=require(_0x8df8('0xf'));var Action=require('./action');var History=require(_0x8df8('0x10'));var Final=require(_0x8df8('0x11'));var AgentComplete=require(_0x8df8('0x12'));var QueueCallerAbandon=require(_0x8df8('0x13'));var Hangup=require(_0x8df8('0x14'));var ipAgi=process[_0x8df8('0x15')][_0x8df8('0x16')]||'127.0.0.1';var strategy={'rrmemory':_0x8df8('0x17'),'roundrobin':_0x8df8('0x18')};var Sequence=function(){};Sequence[_0x8df8('0x19')][_0x8df8('0x1a')]=function(_0xb648c5){this[_0x8df8('0x1b')]=this['tail']?this[_0x8df8('0x1b')][_0x8df8('0x1c')](_0xb648c5):_0xb648c5();};function Dialer(_0xacf4f,_0x3b9579){this[_0x8df8('0x1d')]=new Sequence();this[_0x8df8('0x1e')]=_0x3b9579;this['voiceQueues']=_0xacf4f[_0x8df8('0x1f')];this[_0x8df8('0x20')]=_0xacf4f[_0x8df8('0x20')];this['agents']=_0xacf4f[_0x8df8('0x21')];this[_0x8df8('0x22')]=_0xacf4f[_0x8df8('0x22')];this[_0x8df8('0x23')]=config[_0x8df8('0x23')]||0x2;this[_0x8df8('0x24')]={};this[_0x8df8('0x25')]={};this[_0x8df8('0x26')]={};this[_0x8df8('0x27')]={};this[_0x8df8('0x28')]={};this[_0x8df8('0x29')]={};this[_0x8df8('0x2a')]={};this[_0x8df8('0x2b')]={};this[_0x8df8('0x2c')]={};this['queueBookedRR']={};ami['on']('agentconnect',this[_0x8df8('0x2d')][_0x8df8('0x2e')](this));ami['on']('queuecallerabandon',this[_0x8df8('0x2f')][_0x8df8('0x2e')](this));ami['on']('originateresponse',this[_0x8df8('0x30')][_0x8df8('0x2e')](this));ami['on'](_0x8df8('0x31'),this[_0x8df8('0x32')]['bind'](this));ami['on']('custom:queuesummary',this['syncQueueSummary']['bind'](this));ami['on'](_0x8df8('0x33'),this[_0x8df8('0x34')]['bind'](this));ami['on'](_0x8df8('0x35'),this[_0x8df8('0x36')][_0x8df8('0x2e')](this));ami['on'](_0x8df8('0x37'),this[_0x8df8('0x38')][_0x8df8('0x2e')](this));ami['on']('queuemember',this[_0x8df8('0x39')][_0x8df8('0x2e')](this));ami['on'](_0x8df8('0x3a'),this[_0x8df8('0x3b')]['bind'](this));this[_0x8df8('0x3c')]();this[_0x8df8('0x3d')]();}function isNotNull(_0x1a0c9a){return _0x1a0c9a!==null&&!_['isUndefined'](_0x1a0c9a);}function checkIsLoggedIn(_0x17aa31,_0x41aa5a){return function(){if(_0x41aa5a<=0x0){_0x17aa31[_0x8df8('0x3e')]='AGENTS_NOT_LOGGED';throw _0x17aa31[_0x8df8('0x3f')]+_0x8df8('0x40');}};}function isActive(_0x1395f5){return _0x1395f5;}function checkIsActive(_0xafd88a,_0x2f59f4){return function(){if(!isActive(_0x2f59f4)){_0xafd88a['message']=_0x8df8('0x41');throw _0xafd88a['name']+_0x8df8('0x42');}};}function checkInterval(_0x23b590){return function(){if(!isNotNull(_0x23b590[_0x8df8('0x43')])){_0x23b590[_0x8df8('0x3e')]='INTERVAL_IS_NULL';throw _0x23b590[_0x8df8('0x3f')]+_0x8df8('0x44');}if(!isNotNull(_0x23b590[_0x8df8('0x43')]['Intervals'])){_0x23b590['message']='INTERVAL_IS_NULL';throw _0x23b590['name']+_0x8df8('0x44');}if(!isNotNull(_[_0x8df8('0x45')](_0x23b590[_0x8df8('0x43')]['Intervals']))){_0x23b590[_0x8df8('0x3e')]=_0x8df8('0x46');throw _0x23b590[_0x8df8('0x3f')]+_0x8df8('0x44');}};}function msgResponse(_0x226b8f,_0x4d1c21,_0x10a0cb){return{'action':_0x226b8f,'response':_0x4d1c21,'message':_0x10a0cb,'stack':_0x10a0cb};}function myreject(_0x41018c){return function(_0x4b8cd9){return _0x41018c(msgResponse(_0x8df8('0x47'),_0x8df8('0x48'),JSON['stringify'](_0x4b8cd9)));};}function getSeconds(_0x558223,_0x43f153){var _0x381328=moment(_0x558223)['milliseconds'](0x0);var _0x24aebb=moment(_0x43f153)[_0x8df8('0x49')](0x0);return _0x381328[_0x8df8('0x4a')](_0x24aebb,_0x8df8('0x4b'));}function emit(_0x18b08e,_0x100f1e,_0x5cade6){io['to'](_0x18b08e)[_0x8df8('0x4c')](_0x100f1e,_0x5cade6);}function emitVoiceQueueSummary(_0x4cb0ee){if(_0x4cb0ee[_0x8df8('0x4d')]===_0x8df8('0x4e')){var _0x1d5918={'id':_0x4cb0ee['id'],'name':_0x4cb0ee[_0x8df8('0x3f')],'strategy':_0x4cb0ee[_0x8df8('0x4f')],'answered':_0x4cb0ee[_0x8df8('0x50')],'available':_0x4cb0ee[_0x8df8('0x51')],'loggedIn':_0x4cb0ee[_0x8df8('0x52')],'pTalking':_0x4cb0ee['pTalking'],'sumBillable':_0x4cb0ee[_0x8df8('0x53')],'sumDuration':_0x4cb0ee[_0x8df8('0x54')],'sumHoldTime':_0x4cb0ee[_0x8df8('0x55')]||0x0,'talking':_0x4cb0ee['talking'],'total':_0x4cb0ee[_0x8df8('0x56')],'type':_0x4cb0ee[_0x8df8('0x4d')],'unmanaged':_0x4cb0ee[_0x8df8('0x57')],'abandoned':_0x4cb0ee[_0x8df8('0x58')],'waiting':_0x4cb0ee['waiting'],'loggedInDb':_0x4cb0ee[_0x8df8('0x59')],'dialActive':_0x4cb0ee[_0x8df8('0x5a')],'dialMethod':_0x4cb0ee[_0x8df8('0x5b')],'dialOriginateCallerIdName':_0x4cb0ee[_0x8df8('0x5c')],'dialOriginateCallerIdNumber':_0x4cb0ee[_0x8df8('0x5d')],'dialOriginateTimeout':_0x4cb0ee[_0x8df8('0x5e')],'dialPrefix':_0x4cb0ee['dialPrefix'],'outboundAnswerAgiCallsDay':_0x4cb0ee[_0x8df8('0x5f')],'outboundAnswerCallsDay':_0x4cb0ee[_0x8df8('0x60')],'outboundBlacklistCallsDay':_0x4cb0ee[_0x8df8('0x61')],'outboundBusyCallsDay':_0x4cb0ee[_0x8df8('0x62')],'outboundCongestionCallsDay':_0x4cb0ee['outboundCongestionCallsDay'],'outboundDropCallsDayACS':_0x4cb0ee[_0x8df8('0x63')],'outboundDropCallsDayCallersExit':_0x4cb0ee[_0x8df8('0x64')],'outboundDropCallsDayTimeout':_0x4cb0ee[_0x8df8('0x65')],'outboundNoAnswerCallsDay':_0x4cb0ee['outboundNoAnswerCallsDay'],'outboundNoSuchCallsDay':_0x4cb0ee[_0x8df8('0x66')],'outboundOriginateFailureCallsDay':_0x4cb0ee[_0x8df8('0x67')],'outboundReCallsDay':_0x4cb0ee['outboundReCallsDay'],'outboundRejectCallsDay':_0x4cb0ee[_0x8df8('0x68')],'outboundUnknownCallsDay':_0x4cb0ee[_0x8df8('0x69')],'predictiveIntervalAnsweredCalls':_0x4cb0ee[_0x8df8('0x6a')],'predictiveIntervalAvgHoldtime':_0x4cb0ee[_0x8df8('0x6b')],'predictiveIntervalAvgTalktime':_0x4cb0ee[_0x8df8('0x6c')],'predictiveIntervalDroppedCallsCallersExit':_0x4cb0ee[_0x8df8('0x6d')],'predictiveIntervalDroppedCallsTimeout':_0x4cb0ee[_0x8df8('0x6e')],'predictiveIntervalErlangCalls':_0x4cb0ee[_0x8df8('0x6f')],'predictiveIntervalErlangCallsDroppedCalls':_0x4cb0ee[_0x8df8('0x70')],'predictiveIntervalHitRate':_0x4cb0ee[_0x8df8('0x71')],'predictiveIntervalMultiplicativeFactor':_0x4cb0ee['predictiveIntervalMultiplicativeFactor'],'predictiveIntervalPauses':_0x4cb0ee[_0x8df8('0x72')],'predictiveIntervalAvailable':_0x4cb0ee['predictiveIntervalAvailable'],'predictiveIntervalTotalCalls':_0x4cb0ee[_0x8df8('0x73')],'message':_0x4cb0ee['message'],'originated':_0x4cb0ee[_0x8df8('0x74')],'erlangCalls':_0x4cb0ee[_0x8df8('0x75')],'erlangCallToSecond':_0x4cb0ee[_0x8df8('0x76')],'erlangAbandonmentRate':_0x4cb0ee[_0x8df8('0x77')],'erlangBusyFactor':_0x4cb0ee[_0x8df8('0x78')],'startPredictive':_0x4cb0ee[_0x8df8('0x29')],'startProgressive':_0x4cb0ee['startProgressive']};if(_0x4cb0ee[_0x8df8('0x79')]){_0x1d5918[_0x8df8('0x79')]={'id':_0x4cb0ee['Trunk']['id'],'name':_0x4cb0ee[_0x8df8('0x79')][_0x8df8('0x3f')],'active':_0x4cb0ee['Trunk'][_0x8df8('0x7a')],'callerid':_0x4cb0ee[_0x8df8('0x79')][_0x8df8('0x7b')]};}if(_0x4cb0ee[_0x8df8('0x43')]){_0x1d5918['Interval']={'id':_0x4cb0ee[_0x8df8('0x43')]['id'],'name':_0x4cb0ee[_0x8df8('0x43')]['name']};}var _0xd64b16=md5(JSON[_0x8df8('0x7c')](_0x1d5918));if(_0x4cb0ee[_0x8df8('0x5')]!==_0xd64b16){_0x4cb0ee[_0x8df8('0x5')]=_0xd64b16;emit(util[_0x8df8('0x7d')](_0x8df8('0x7e'),_0x1d5918['name']),_0x8df8('0x7f'),_0x1d5918);}}}function emitCampaignSummary(_0xf87022){if(_0xf87022[_0x8df8('0x4d')]===_0x8df8('0x80')){emit(util[_0x8df8('0x7d')](_0x8df8('0x81'),_0xf87022[_0x8df8('0x3f')]),_0x8df8('0x82'),_0xf87022);}}function checkGetDataPredictive(_0x6aa4cd){if(isNotNull(_0x6aa4cd)){if(!_['isEmpty'](_0x6aa4cd)){loggerPredictive['info'](_0x8df8('0x83'));loggerPredictive[_0x8df8('0x84')]('Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x6aa4cd[_0x8df8('0x73')]);loggerPredictive[_0x8df8('0x84')](_0x8df8('0x85'),_0x6aa4cd[_0x8df8('0x6a')]);loggerPredictive['info']('Dropped\x20Timeout:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x6aa4cd[_0x8df8('0x6e')]);loggerPredictive[_0x8df8('0x84')]('Dropped\x20Exit:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x6aa4cd[_0x8df8('0x6d')]);loggerPredictive[_0x8df8('0x84')]('AVG\x20Hold\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x6aa4cd['predictiveIntervalAvgHoldtime']);loggerPredictive[_0x8df8('0x84')]('AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x6aa4cd['predictiveIntervalAvgTalktime']);loggerPredictive[_0x8df8('0x84')](_0x8df8('0x86'));if(_0x6aa4cd[_0x8df8('0x73')]>0x0){if(!_['isUndefined'](_0x6aa4cd[_0x8df8('0x6c')])&&_0x6aa4cd[_0x8df8('0x6c')]>0x0){return!![];}else{loggerPredictive[_0x8df8('0x84')](_0x8df8('0x87'));}if(!_['isUndefined'](_0x6aa4cd[_0x8df8('0x6b')])&&_0x6aa4cd[_0x8df8('0x6b')]>0x0){return!![];}else{loggerPredictive[_0x8df8('0x84')]('Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive');}}else{loggerPredictive['info'](_0x8df8('0x88'));}}else{loggerPredictive[_0x8df8('0x84')](_0x8df8('0x89'));}}else{loggerPredictive[_0x8df8('0x84')](_0x8df8('0x89'));}return![];}function mergeDataErlangB(_0x17384d){return function(_0x229548){loggerPredictive[_0x8df8('0x84')]('---------\x20ErlangB\x20---------');loggerPredictive[_0x8df8('0x84')](_0x8df8('0x8a'),_0x229548['erlangCalls']);loggerPredictive[_0x8df8('0x84')]('One\x20call\x20every:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x229548[_0x8df8('0x76')]);loggerPredictive[_0x8df8('0x84')](_0x8df8('0x8b'),_0x229548[_0x8df8('0x77')]);loggerPredictive['info'](_0x8df8('0x8c'),_0x229548[_0x8df8('0x78')]);loggerPredictive[_0x8df8('0x84')](_0x8df8('0x8b'),_0x229548['erlangAbandonmentRate']);loggerPredictive[_0x8df8('0x84')](_0x8df8('0x86'));_['merge'](_0x17384d,_0x229548);};}function getDiff(_0x5b9856){var _0x3d4084=moment()[_0x8df8('0x49')](0x0);var _0xec31f4=moment(_0x5b9856)[_0x8df8('0x49')](0x0);return _0x3d4084[_0x8df8('0x4a')](_0xec31f4,'seconds');}function ifInterval(_0x4e5e60,_0x396f63){if(_[_0x8df8('0x8d')](_0x396f63)){return![];}if(getDiff(_0x396f63)<_0x4e5e60*0x3c){return!![];}else{return![];}}function freeVariablesPredictive(_0x27d9b2){if(isNotNull(_0x27d9b2)){if(!_[_0x8df8('0x8d')](_0x27d9b2['startProgressive'])){_0x27d9b2[_0x8df8('0x2a')]=undefined;loggerPredictive[_0x8df8('0x84')](_0x27d9b2[_0x8df8('0x3f')],_0x8df8('0x8e'));}if(!_[_0x8df8('0x8d')](_0x27d9b2[_0x8df8('0x29')])){_0x27d9b2[_0x8df8('0x29')]=undefined;loggerPredictive[_0x8df8('0x84')](_0x27d9b2['name'],_0x8df8('0x8f'));}if(!_['isUndefined'](_0x27d9b2[_0x8df8('0x90')])){clearInterval(_0x27d9b2[_0x8df8('0x90')]);_0x27d9b2[_0x8df8('0x90')]=undefined;loggerPredictive['info'](_0x27d9b2[_0x8df8('0x3f')],_0x8df8('0x91'));}}}function erlangb(_0x46a375,_0x550d59){if(_0x550d59===0x0){return 0x0;}var _0x5d5017=0x1;for(var _0x4fd4de=0x1;_0x4fd4de<=_0x550d59;_0x4fd4de+=0x1){_0x5d5017=0x1+_0x5d5017*_0x4fd4de/_0x46a375;}return 0x1/_0x5d5017;}function isVoiceQueueOutbound(_0x5b4258){return _0x5b4258==='outbound';}function isNotPreview(_0x136961){return _0x136961!==_0x8df8('0x1e');}function isCampaignIvr(_0x2397b2){return _0x2397b2===_0x8df8('0x80');}function getCallerId(_0x442e94,_0x2b79ba,_0x326bb6){if(!_[_0x8df8('0x8d')](_0x326bb6)&&_0x8df8('0x92')===typeof _0x326bb6&&!_[_0x8df8('0x45')](_0x326bb6)){if(!_[_0x8df8('0x8d')](_0x2b79ba)&&_0x8df8('0x92')===typeof _0x2b79ba&&!_['isEmpty'](_0x2b79ba)){return util[_0x8df8('0x7d')](_0x8df8('0x93'),_0x2b79ba,_0x326bb6);}return util[_0x8df8('0x7d')]('\x22%s\x22\x20<%s>',_0x326bb6,_0x326bb6);}if(!_['isUndefined'](_0x442e94)&&_0x8df8('0x92')===typeof _0x442e94&&!_['isEmpty'](_0x442e94)){return _0x442e94;}return _0x8df8('0x94');}function loggerCatchQueueSummary(_0x337914,_0x4b3b52){return function(_0x477271){freeVariablesPredictive(_0x4b3b52);emitVoiceQueueSummary(_0x4b3b52);emitCampaignSummary(_0x4b3b52);loggerSyncQueueSummary[_0x8df8('0x95')](_0x337914,util['inspect'](_0x477271,{'showHidden':![],'depth':null}));};}function loggerCatchPredictive(_0x2f6ca4,_0x86c5c){return function(_0x539347){loggerPredictive[_0x8df8('0x95')](_0x86c5c[_0x8df8('0x3f')],_0x2f6ca4);loggerPredictive['error'](_0x539347[_0x8df8('0x96')]);freeVariablesPredictive(_0x86c5c);};}function loggerCatch(_0x2970c4){return function(_0x3b91dd){logger[_0x8df8('0x95')](_0x2970c4,util['inspect'](_0x3b91dd,{'showHidden':![],'depth':null}));};}function checkContactEmpty(_0x2bd03e){return _0x2bd03e&&!_[_0x8df8('0x8d')](_0x2bd03e)&&_0x2bd03e['length']>0x0;}function decremetOriginate(_0x3a241d){if(!_[_0x8df8('0x8d')](_0x3a241d)&&_0x3a241d!==null){if(_0x3a241d[_0x8df8('0x97')](_0x8df8('0x74'))){if(_0x3a241d['originated']>0x0){_0x3a241d['originated']-=0x1;}else{logger[_0x8df8('0x95')](_0x8df8('0x98'));}}}else{logger[_0x8df8('0x95')](_0x8df8('0x99'));}}function checkContactLowerLimitOriginate(_0x4af6e3,_0x3ec0ea,_0x7ef848){if(_0x3ec0ea>_0x7ef848){for(var _0x316c39=0x0;_0x316c39<_0x3ec0ea-_0x7ef848;_0x316c39+=0x1){decremetOriginate(_0x4af6e3);}}}function loggerGetContactDialer(_0x46bbed,_0x5d912e,_0x301892){return function(_0x16d607){checkContactLowerLimitOriginate(_0x5d912e,_0x301892,0x0);logger[_0x8df8('0x95')](_0x46bbed,util['inspect'](_0x16d607,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x152c7f){return function(_0x4ab973){if(isNotNull(_0x4ab973)&&isNotNull(_0x4ab973[0x0])){if(_0x4ab973[0x0]['contactsRescheduled']>0x0){_0x152c7f[_0x8df8('0x3e')]=_0x8df8('0x9a');logger['info'](_0x8df8('0x9b')+_0x152c7f[_0x8df8('0x3f')],_0x4ab973[0x0][_0x8df8('0x9c')],_0x8df8('0x9d'));}else{_0x152c7f[_0x8df8('0x3e')]=_0x8df8('0x9e');logger[_0x8df8('0x84')](_0x8df8('0x9f')+_0x152c7f['name']);}}};}function notSendMessagesQueue(_0xcfc519){if(_0xcfc519[_0x8df8('0xa0')]){freeVariablesPredictive(_0xcfc519);if(_0xcfc519[_0x8df8('0x74')]===0x0&&_0xcfc519[_0x8df8('0xa1')]===0x0&&_0xcfc519[_0x8df8('0xa2')]===0x0&&(_0xcfc519[_0x8df8('0xa3')]||0x0)===0x0){_0xcfc519[_0x8df8('0xa0')]=![];_0xcfc519[_0x8df8('0x51')]=0x0;_0xcfc519[_0x8df8('0x3e')]='NOT_ACTIVE';loggerSyncQueueSummary[_0x8df8('0x95')]('[syncQueueSummary]\x20Campaign\x20Queue:\x20',_0xcfc519[_0x8df8('0x3f')],'is\x20not\x20active');}else{_0xcfc519[_0x8df8('0x3e')]=_0x8df8('0xa4');loggerSyncQueueSummary['error'](_0x8df8('0xa5'),_0xcfc519[_0x8df8('0x3f')],_0x8df8('0xa6'));}emitVoiceQueueSummary(_0xcfc519);}}function notSendMessagesCampaign(_0x352f4f){if(_0x352f4f[_0x8df8('0xa0')]){if(_0x352f4f[_0x8df8('0x74')]===0x0){_0x352f4f[_0x8df8('0xa0')]=![];_0x352f4f[_0x8df8('0x3e')]=_0x8df8('0x41');loggerSyncQueueSummary[_0x8df8('0x95')]('[syncQueueSummary]\x20Campaign\x20Ivr:\x20',_0x352f4f[_0x8df8('0x3f')],_0x8df8('0xa7'));}else{_0x352f4f[_0x8df8('0x3e')]=_0x8df8('0xa4');loggerSyncQueueSummary[_0x8df8('0x95')](_0x8df8('0xa8'),_0x352f4f['name'],_0x8df8('0xa6'));}emitCampaignSummary(_0x352f4f);}}function createObjHistory(_0x59f58f,_0x556f9e,_0x4505fa,_0x781b47,_0x19e4f1){_0x59f58f['message']=_0x4505fa;var _0x27c699=new Action(_0x59f58f,_0x556f9e);var _0x32a741=new History(_0x27c699);_0x32a741[_0x8df8('0xa9')]=_0x781b47;_0x32a741[_0x8df8('0xaa')]=_0x19e4f1;_0x32a741[_0x8df8('0xab')]=_0x27c699[_0x8df8('0xac')];return _0x32a741;}Dialer[_0x8df8('0x19')]['loopClearZombieChannels']=function(){var _0x3ab24f=this;setInterval(function(){_0x3ab24f[_0x8df8('0xad')](_0x3ab24f[_0x8df8('0x27')],_0x8df8('0xae'));_0x3ab24f[_0x8df8('0xad')](_0x3ab24f[_0x8df8('0x25')],_0x8df8('0xaf'));},0x32c8);};Dialer[_0x8df8('0x19')]['clearZombieChannels']=function(_0xa12423,_0x5aa8b6){var _0x47592e=this;for(var _0x5db167 in _0xa12423){if(_0xa12423[_0x8df8('0x97')](_0x5db167)){this[_0x8df8('0x1d')]['enqueue'](function(){if(!_[_0x8df8('0xb0')](_0xa12423[_0x5db167])){return ami[_0x8df8('0xb1')]({'action':'status','channel':_0xa12423[_0x5db167][_0x8df8('0xb2')]})[_0x8df8('0xb3')](function(_0x296aec){if(_0x296aec['message']===_0x8df8('0xb4')){setTimeout(function(){if(_0xa12423[_0x5db167]&&_0xa12423[_0x5db167][_0x8df8('0x4d')]!==_0x8df8('0x80')){_0x47592e[_0x8df8('0xb5')](_0x47592e['voiceQueues'][_0xa12423[_0x5db167]['queue']]);logger[_0x8df8('0x95')](_0x8df8('0xb6'),_0x5aa8b6,_0x5db167,_0xa12423[_0x5db167][_0x8df8('0xb7')]);delete _0xa12423[_0x5db167];}if(_0xa12423[_0x5db167]&&_0xa12423[_0x5db167][_0x8df8('0x4d')]===_0x8df8('0x80')){_0x47592e[_0x8df8('0xb5')](_0x47592e[_0x8df8('0x20')][_0xa12423[_0x5db167][_0x8df8('0xb7')]]);logger[_0x8df8('0x95')](_0x8df8('0xb8'),_0x5aa8b6,_0x5db167,_0xa12423[_0x5db167][_0x8df8('0xb7')]);delete _0xa12423[_0x5db167];}},0x2328);}});}});}}};Dialer['prototype']['countReScheduled']=function(_0x34605b){return BPromise[_0x8df8('0xb9')]()[_0x8df8('0xba')](cmHopper[_0x8df8('0xbb')](_0x34605b))[_0x8df8('0xb3')](loggerCatch('[countReScheduled]\x20'));};Dialer[_0x8df8('0x19')][_0x8df8('0xbc')]=function(_0x19b3f2){return BPromise[_0x8df8('0xb9')]()[_0x8df8('0xba')](cmHopperBlack[_0x8df8('0xbc')](_0x19b3f2))[_0x8df8('0xb3')](loggerCatch(_0x8df8('0xbd')));};Dialer[_0x8df8('0x19')][_0x8df8('0xbe')]=function(_0x492169){return BPromise[_0x8df8('0xb9')]()[_0x8df8('0xba')](cmHopperBlack[_0x8df8('0xbe')](_0x492169))[_0x8df8('0xb3')](loggerCatch(_0x8df8('0xbf')));};Dialer[_0x8df8('0x19')][_0x8df8('0xc0')]=function(_0x5eab20){return BPromise[_0x8df8('0xb9')]()[_0x8df8('0xba')](cmHopperHistory[_0x8df8('0xc1')](_0x5eab20))[_0x8df8('0xb3')](loggerCatch(_0x8df8('0xc2')));};Dialer['prototype'][_0x8df8('0xc3')]=function(_0x1c8e33){return BPromise[_0x8df8('0xb9')]()[_0x8df8('0xba')](cmHopper['rescheduleContact'](_0x1c8e33))[_0x8df8('0xb3')](loggerCatch(_0x8df8('0xc4')));};Dialer[_0x8df8('0x19')][_0x8df8('0xc5')]=function(_0x302a67,_0x5df000,_0x5b2030){return BPromise[_0x8df8('0xb9')]()['then'](cmHopper[_0x8df8('0xc5')](_0x302a67,_0x5df000,_0x5b2030))[_0x8df8('0xb3')](loggerCatch('[unlockContact]\x20'));};Dialer[_0x8df8('0x19')]['getContactDialer']=function(_0x42693a,_0x3647e6,_0x4693bf,_0x3136a5){return BPromise[_0x8df8('0xb9')]()[_0x8df8('0xba')](cmHopper[_0x8df8('0xc6')](_0x42693a,_0x3647e6,_0x4693bf,_0x3136a5))[_0x8df8('0xb3')](loggerCatch(_0x8df8('0xc7')));};Dialer[_0x8df8('0x19')]['getContactDialerIvr']=function(_0x11a878,_0x3ebf23,_0x2ee388){return BPromise[_0x8df8('0xb9')]()['then'](cmHopper[_0x8df8('0xc8')](_0x11a878,_0x3ebf23,_0x2ee388))[_0x8df8('0xb3')](loggerCatch(_0x8df8('0xc7')));};Dialer[_0x8df8('0x19')]['getVoiceQueueRtPauses']=function(_0x197273){return BPromise[_0x8df8('0xb9')]()[_0x8df8('0xba')](voiceQueueRt[_0x8df8('0xc9')](_0x197273))['catch'](loggerCatch('[getVoiceQueueRtPauses]\x20'));};Dialer[_0x8df8('0x19')]['moveContactManagedDialer']=function(_0x1c86d5){return BPromise[_0x8df8('0xb9')]()[_0x8df8('0xba')](cmHopper[_0x8df8('0xca')](_0x1c86d5))[_0x8df8('0xb3')](loggerCatch('[moveContactManagedDialer]\x20'));};Dialer['prototype'][_0x8df8('0xcb')]=function(_0x8250d3){return BPromise[_0x8df8('0xb9')]()[_0x8df8('0xba')](cmHopperHistory[_0x8df8('0xcb')](_0x8250d3))[_0x8df8('0xb3')](loggerCatch(_0x8df8('0xcc')));};Dialer[_0x8df8('0x19')][_0x8df8('0xb5')]=function(_0x133c81){if(!_[_0x8df8('0x8d')](_0x133c81)&&_0x133c81!==null){if(_0x133c81[_0x8df8('0x97')](_0x8df8('0x74'))){if(_0x133c81['originated']>0x0){_0x133c81[_0x8df8('0x74')]-=0x1;}else{logger[_0x8df8('0x95')](_0x8df8('0xcd'));}}}else{logger['error'](_0x8df8('0xce'));}};Dialer[_0x8df8('0x19')][_0x8df8('0xcf')]=function(_0x3791df,_0x3e0689){var _0x7d824=this;return function(_0x3ba8f6){_0x7d824['updateOriginated'](_0x3e0689);logger[_0x8df8('0x95')](_0x3791df,util[_0x8df8('0xd0')](_0x3ba8f6,{'showHidden':![],'depth':null}));};};Dialer[_0x8df8('0x19')][_0x8df8('0xd1')]=function(_0x3bc3d4,_0x236226,_0xb77c01){var _0x2e776c={'state':0x19,'statedesc':'notFound'};this[_0x8df8('0xb5')](_0x236226);this['saveInDb'](_[_0x8df8('0xd2')](_0x2e776c,_[_0x8df8('0xd3')](_0xb77c01,[_0x8df8('0xd4'),'ListId',_0x8df8('0xd5'),_0x8df8('0xd6'),'CampaignId'])),_0x8df8('0xd7'),'[emptyContact]');logger[_0x8df8('0x95')](_0x3bc3d4);};Dialer[_0x8df8('0x19')]['isSuccess']=function(_0x10ef12){return _0x10ef12===_0x8df8('0xd8');};Dialer[_0x8df8('0x19')]['isTrunkReachable']=function(_0x3c15ac){return!_['isUndefined'](_0x3c15ac)&&_0x3c15ac&&!_[_0x8df8('0x8d')](_0x3c15ac[_0x8df8('0x3f')])&&!_[_0x8df8('0x8d')](_0x3c15ac[_0x8df8('0x7a')])&&_0x3c15ac[_0x8df8('0x7a')]&&(this[_0x8df8('0x22')][util[_0x8df8('0x7d')](_0x8df8('0xd9'),_0x3c15ac[_0x8df8('0x3f')])]['status']===_0x8df8('0xda')||this['trunks'][util[_0x8df8('0x7d')](_0x8df8('0xd9'),_0x3c15ac['name'])][_0x8df8('0xdb')]===_0x8df8('0xdc'));};Dialer['prototype'][_0x8df8('0xdd')]=function(_0x269c78,_0xd35d11,_0x34445e){this[_0x8df8('0xcb')](_0x269c78)['catch'](loggerCatch(_0xd35d11));this[_0x8df8('0xca')](_0x269c78)[_0x8df8('0xb3')](loggerCatch(_0x34445e));};Dialer[_0x8df8('0x19')][_0x8df8('0x38')]=function(_0x53d3a3){var _0x320cba=this[_0x8df8('0x27')][_0x53d3a3[_0x8df8('0xde')]];var _0x5a20bb;if(!_[_0x8df8('0xb0')](_0x53d3a3)&&!_['isNil'](_0x53d3a3[_0x8df8('0xdf')])&&!_[_0x8df8('0xb0')](_0x53d3a3[_0x8df8('0xdf')][_0x8df8('0xe0')])&&_0x53d3a3[_0x8df8('0xe1')]===_0x8df8('0xe2')&&_0x320cba){if(_0x320cba[_0x8df8('0x4d')]!==_0x8df8('0x80')&&this['voiceQueues'][_0x320cba['queue']][_0x8df8('0xe3')]&&_0x53d3a3[_0x8df8('0xe4')]===_0x8df8('0xe5')){delete this[_0x8df8('0x27')][_0x53d3a3[_0x8df8('0xde')]];this[_0x8df8('0xb5')](this['voiceQueues'][_0x320cba[_0x8df8('0xb7')]]);this[_0x8df8('0x1f')][_0x320cba['queue']][_0x8df8('0x60')]+=0x1;this['voiceQueues'][_0x320cba[_0x8df8('0xb7')]][_0x8df8('0x5f')]+=0x1;_0x5a20bb=new Hangup(_0x320cba,_0x53d3a3);_0x5a20bb[_0x8df8('0xa9')]=0x12;_0x5a20bb[_0x8df8('0xaa')]=_0x8df8('0xe6');_0x5a20bb[_0x8df8('0xe7')]=_0x8df8('0xe8');this['saveInDb'](_0x5a20bb,'[syncHangupInAMD][createHistory]',_0x8df8('0xe9'));}if(_0x320cba[_0x8df8('0x4d')]!=='ivr'&&this['voiceQueues'][_0x320cba[_0x8df8('0xb7')]][_0x8df8('0xe3')]&&_0x53d3a3['value']===_0x8df8('0xea')){var _0x39fd02=this;return new BPromise(function(_0x59fbfc,_0x6e86eb){delete _0x39fd02[_0x8df8('0x27')][_0x53d3a3['uniqueid']];_0x39fd02[_0x8df8('0xb5')](_0x39fd02[_0x8df8('0x1f')][_0x320cba[_0x8df8('0xb7')]]);_0x39fd02['voiceQueues'][_0x320cba['queue']]['outboundAnswerCallsDay']+=0x1;_0x39fd02[_0x8df8('0x1f')][_0x320cba[_0x8df8('0xb7')]][_0x8df8('0x5f')]+=0x1;var _0x654eb7=_0x39fd02[_0x8df8('0x1f')][_0x320cba[_0x8df8('0xb7')]];var _0x77818a=new Hangup(_0x320cba,_0x53d3a3);_0x77818a[_0x8df8('0xa9')]=0x13;_0x77818a[_0x8df8('0xaa')]=_0x8df8('0xeb');_0x77818a['membername']=_0x8df8('0xe8');_0x77818a[_0x8df8('0xec')]+=0x1;_0x77818a[_0x8df8('0xed')]+=0x1;_0x77818a[_0x8df8('0xee')]=!![];_0x39fd02[_0x8df8('0xcb')](_0x77818a)[_0x8df8('0xb3')](loggerCatch(_0x8df8('0xef')));if(_0x77818a['countbusyretry']+_0x77818a[_0x8df8('0xf0')]+_0x77818a[_0x8df8('0xf1')]+_0x77818a['countnosuchnumberretry']+_0x77818a[_0x8df8('0xf2')]+_0x77818a[_0x8df8('0xf3')]+_0x77818a[_0x8df8('0xec')]+_0x77818a[_0x8df8('0xf4')]>=_0x654eb7[_0x8df8('0xf5')]){_0x39fd02[_0x8df8('0xf6')](_0x77818a,_0x59fbfc,_0x6e86eb,'reason19\x20machine....');}else{if(_0x77818a[_0x8df8('0xec')]>=_0x654eb7[_0x8df8('0xf7')]){_0x39fd02['createStateFinal'](_0x77818a,_0x59fbfc,_0x6e86eb,'reason\x2019\x20machine....');}else{_0x39fd02[_0x8df8('0xc3')]({'active':![],'countmachineretry':_0x77818a['countmachineretry'],'scheduledat':moment()[_0x8df8('0xf8')](_0x654eb7[_0x8df8('0xf9')],'minutes')['format'](_0x8df8('0xfa')),'ContactId':_0x77818a['ContactId'],'ListId':_0x77818a[_0x8df8('0xfb')],'VoiceQueueId':_0x77818a['VoiceQueueId']||undefined,'CampaignId':_0x77818a[_0x8df8('0xfc')]||undefined})[_0x8df8('0xb3')](loggerCatch('[rescheduleContact][Machine]'));_0x59fbfc({'reschedule':0x1});}}});}if(_0x320cba['type']===_0x8df8('0x80')&&this['campaigns'][_0x320cba[_0x8df8('0xb7')]][_0x8df8('0xe3')]&&_0x53d3a3['value']===_0x8df8('0xe5')){delete this['uniqueId'][_0x53d3a3[_0x8df8('0xde')]];this[_0x8df8('0xb5')](this[_0x8df8('0x20')][_0x320cba[_0x8df8('0xb7')]]);_0x5a20bb=new Hangup(_0x320cba,_0x53d3a3);_0x5a20bb[_0x8df8('0xa9')]=0x12;_0x5a20bb[_0x8df8('0xaa')]=_0x8df8('0xe6');_0x5a20bb[_0x8df8('0xe7')]=_0x8df8('0xe8');this[_0x8df8('0xdd')](_0x5a20bb,_0x8df8('0xfd'),'[syncHangupInAMDIvr]');}if(_0x320cba[_0x8df8('0x4d')]==='ivr'&&this['campaigns'][_0x320cba[_0x8df8('0xb7')]][_0x8df8('0xe3')]&&_0x53d3a3[_0x8df8('0xe4')]==='MACHINE'){var _0x39fd02=this;return new BPromise(function(_0xd3476e,_0x573790){delete _0x39fd02[_0x8df8('0x27')][_0x53d3a3[_0x8df8('0xde')]];_0x39fd02[_0x8df8('0xb5')](_0x39fd02['campaigns'][_0x320cba[_0x8df8('0xb7')]]);_0x39fd02[_0x8df8('0x20')][_0x320cba['queue']][_0x8df8('0x60')]+=0x1;_0x39fd02['campaigns'][_0x320cba[_0x8df8('0xb7')]]['outboundAnswerAgiCallsDay']+=0x1;var _0x1d302a=_0x39fd02[_0x8df8('0x20')][_0x320cba[_0x8df8('0xb7')]];var _0x2db0ae=new Hangup(_0x320cba,_0x53d3a3);_0x2db0ae[_0x8df8('0xa9')]=0x13;_0x2db0ae[_0x8df8('0xaa')]=_0x8df8('0xeb');_0x2db0ae[_0x8df8('0xe7')]=_0x8df8('0xe8');_0x2db0ae[_0x8df8('0xec')]+=0x1;_0x2db0ae['countglobal']+=0x1;_0x2db0ae[_0x8df8('0xee')]=!![];_0x39fd02[_0x8df8('0xcb')](_0x2db0ae)[_0x8df8('0xb3')](loggerCatch(_0x8df8('0xef')));if(_0x2db0ae[_0x8df8('0xfe')]+_0x2db0ae['countcongestionretry']+_0x2db0ae[_0x8df8('0xf1')]+_0x2db0ae[_0x8df8('0xff')]+_0x2db0ae[_0x8df8('0xf2')]+_0x2db0ae[_0x8df8('0xf3')]+_0x2db0ae['countmachineretry']+_0x2db0ae['countagentrejectretry']>=_0x1d302a[_0x8df8('0xf5')]){_0x39fd02[_0x8df8('0xf6')](_0x2db0ae,_0xd3476e,_0x573790,_0x8df8('0x100'));}else{if(_0x2db0ae[_0x8df8('0xec')]>=_0x1d302a['dialMachineMaxRetry']){_0x39fd02['createStateFinal'](_0x2db0ae,_0xd3476e,_0x573790,_0x8df8('0x101'));}else{_0x39fd02[_0x8df8('0xc3')]({'active':![],'countmachineretry':_0x2db0ae[_0x8df8('0xec')],'scheduledat':moment()[_0x8df8('0xf8')](_0x1d302a[_0x8df8('0xf9')],_0x8df8('0x102'))['format'](_0x8df8('0xfa')),'ContactId':_0x2db0ae[_0x8df8('0xd4')],'ListId':_0x2db0ae['ListId'],'VoiceQueueId':_0x2db0ae['VoiceQueueId']||undefined,'CampaignId':_0x2db0ae[_0x8df8('0xfc')]||undefined})[_0x8df8('0xb3')](loggerCatch(_0x8df8('0x103')));_0xd3476e({'reschedule':0x1});}}});}}};Dialer[_0x8df8('0x19')]['syncHangup']=function(_0x150f49){var _0x2b9065=this[_0x8df8('0x27')][_0x150f49[_0x8df8('0xde')]];var _0x44bb4b=this;var _0xdef52;if(_0x2b9065&&_0x2b9065[_0x8df8('0x4d')]===_0x8df8('0x80')){delete this[_0x8df8('0x27')][_0x150f49[_0x8df8('0xde')]];this[_0x8df8('0xb5')](this['campaigns'][_0x2b9065['queue']]);this[_0x8df8('0x20')][_0x2b9065[_0x8df8('0xb7')]]['ivrAnswerCallsDay']+=0x1;_0xdef52=new Hangup(_0x2b9065,_0x150f49);this[_0x8df8('0xcb')](_0xdef52)[_0x8df8('0xb3')](loggerCatch('[syncHangupIvr][createHistory]'));this[_0x8df8('0xca')](_0xdef52)[_0x8df8('0xb3')](loggerCatch('[syncHangupIvr]'));}if(_0x2b9065&&_0x2b9065['type']!==_0x8df8('0x80')&&isNotNull(this[_0x8df8('0x1f')][_0x2b9065[_0x8df8('0xb7')]][_0x8df8('0x104')])){delete this['uniqueId'][_0x150f49['uniqueid']];this[_0x8df8('0xb5')](this['voiceQueues'][_0x2b9065[_0x8df8('0xb7')]]);this[_0x8df8('0x1f')][_0x2b9065[_0x8df8('0xb7')]][_0x8df8('0x60')]+=0x1;this[_0x8df8('0x1f')][_0x2b9065[_0x8df8('0xb7')]][_0x8df8('0x5f')]+=0x1;_0xdef52=new Hangup(_0x2b9065,_0x150f49);_0xdef52[_0x8df8('0xa9')]=0x10;_0xdef52[_0x8df8('0xaa')]=_0x8df8('0x105');_0xdef52[_0x8df8('0xe7')]=_0x8df8('0x106');this[_0x8df8('0xcb')](_0xdef52)['catch'](loggerCatch(_0x8df8('0x107')));this[_0x8df8('0xca')](_0xdef52)[_0x8df8('0xb3')](loggerCatch(_0x8df8('0x108')));}if(_0x2b9065&&_0x2b9065[_0x8df8('0x4d')]!==_0x8df8('0x80')&&!isNotNull(this[_0x8df8('0x1f')][_0x2b9065['queue']]['dialQueueProject'])){delete this[_0x8df8('0x27')][_0x150f49['uniqueid']];this[_0x8df8('0xb5')](this[_0x8df8('0x1f')][_0x2b9065[_0x8df8('0xb7')]]);this['voiceQueues'][_0x2b9065[_0x8df8('0xb7')]][_0x8df8('0x69')]+=0x1;_0xdef52=new Hangup(_0x2b9065,_0x150f49);_0xdef52[_0x8df8('0xa9')]=0xc;_0xdef52['statedesc']=_0x150f49[_0x8df8('0x109')];_0xdef52[_0x8df8('0xe7')]=_0x8df8('0x10a');this[_0x8df8('0xcb')](_0xdef52)['catch'](loggerCatch('[syncHangupIvr][createHistory]'));this[_0x8df8('0xca')](_0xdef52)[_0x8df8('0xb3')](loggerCatch('[syncHangupIvr]'));}};Dialer[_0x8df8('0x19')]['syncAgentComplete']=function(_0x360dd5){var _0x212cd8=this[_0x8df8('0x27')][_0x360dd5['uniqueid']];var _0x58df53=this;if(this['voiceQueues'][_0x360dd5[_0x8df8('0xb7')]]){if(_0x212cd8&&_0x212cd8[_0x8df8('0x4d')]!==_0x8df8('0x80')){delete this[_0x8df8('0x27')][_0x360dd5['uniqueid']];this[_0x8df8('0x1f')][_0x360dd5[_0x8df8('0xb7')]][_0x8df8('0x60')]+=0x1;var _0x50ffc2=new AgentComplete(_0x212cd8,_0x360dd5);if(_0x360dd5[_0x8df8('0x10b')]===_0x8df8('0x10c')){_0x50ffc2[_0x8df8('0x10d')]=this[_0x8df8('0x1f')][_0x360dd5[_0x8df8('0xb7')]][_0x8df8('0x10e')]&&this[_0x8df8('0x1f')][_0x360dd5[_0x8df8('0xb7')]][_0x8df8('0x10f')]?moment()['format']('YYYY-MM-DD\x20HH:mm:ss'):undefined;}this[_0x8df8('0xcb')](_0x50ffc2)[_0x8df8('0xb3')](loggerCatch('[syncAgentComplete][createHistory]'));this[_0x8df8('0xca')](_0x50ffc2)['catch'](loggerCatch(_0x8df8('0x110')));}}};Dialer[_0x8df8('0x19')][_0x8df8('0x2d')]=function(_0x39df3f){if(this[_0x8df8('0x1f')][_0x39df3f['queue']]){if(this[_0x8df8('0x27')][_0x39df3f[_0x8df8('0xde')]]&&this[_0x8df8('0x27')][_0x39df3f[_0x8df8('0xde')]][_0x8df8('0x4d')]!=='ivr'){this['updateOriginated'](this[_0x8df8('0x1f')][_0x39df3f[_0x8df8('0xb7')]]);this[_0x8df8('0x27')][_0x39df3f[_0x8df8('0xde')]][_0x8df8('0x111')]=moment()[_0x8df8('0x7d')]('YYYY-MM-DD\x20HH:mm:ss');}}};Dialer[_0x8df8('0x19')][_0x8df8('0x112')]=function(_0x435126){this[_0x8df8('0xcb')](_0x435126)['catch'](loggerCatch(_0x8df8('0x113')));this[_0x8df8('0xca')](_0x435126)[_0x8df8('0xb3')](loggerCatch(_0x8df8('0x114')));};Dialer[_0x8df8('0x19')]['syncQueueCallerAbandon']=function(_0x2f6ab3){var _0x5a1298=this[_0x8df8('0x27')][_0x2f6ab3[_0x8df8('0xde')]];var _0x34a7c9=this;if(this[_0x8df8('0x1f')][_0x2f6ab3[_0x8df8('0xb7')]]){if(_0x5a1298&&_0x5a1298[_0x8df8('0x4d')]!==_0x8df8('0x80')){delete this[_0x8df8('0x27')][_0x2f6ab3[_0x8df8('0xde')]];this['updateOriginated'](this['voiceQueues'][_0x2f6ab3[_0x8df8('0xb7')]]);_0x5a1298['droptime']=moment()[_0x8df8('0x7d')](_0x8df8('0xfa'));var _0x3b5af0=new QueueCallerAbandon(_0x5a1298,_0x2f6ab3);if(getSeconds(_0x5a1298[_0x8df8('0x115')],_0x5a1298[_0x8df8('0x116')])>=_0x5a1298[_0x8df8('0x117')]){this[_0x8df8('0x1f')][_0x2f6ab3[_0x8df8('0xb7')]][_0x8df8('0x6e')]+=0x1;this['voiceQueues'][_0x2f6ab3['queue']][_0x8df8('0x65')]+=0x1;this[_0x8df8('0x1f')][_0x2f6ab3[_0x8df8('0xb7')]][_0x8df8('0x70')]+=0x1;_0x3b5af0[_0x8df8('0xa9')]=0xa;_0x3b5af0[_0x8df8('0xaa')]=_0x8df8('0x118');_0x3b5af0[_0x8df8('0x119')]=_0x8df8('0x11a');_0x3b5af0[_0x8df8('0x10d')]=this[_0x8df8('0x1f')][_0x2f6ab3[_0x8df8('0xb7')]][_0x8df8('0x10e')]?moment()[_0x8df8('0x7d')](_0x8df8('0xfa')):undefined;_0x3b5af0[_0x8df8('0xf2')]+=0x1;_0x3b5af0['countglobal']+=0x1;if(_0x3b5af0[_0x8df8('0xf2')]>=this[_0x8df8('0x1f')][_0x2f6ab3['queue']]['dialDropMaxRetry']){this['queueCallerAbandonCreateState'](_0x3b5af0);}else{this['rescheduleContact']({'active':![],'countdropretry':_0x3b5af0['countdropretry'],'scheduledat':moment()[_0x8df8('0xf8')](this[_0x8df8('0x1f')][_0x2f6ab3[_0x8df8('0xb7')]][_0x8df8('0x11b')],_0x8df8('0x102'))['format'](_0x8df8('0xfa')),'ContactId':_0x5a1298[_0x8df8('0xd4')],'ListId':_0x5a1298[_0x8df8('0xfb')],'VoiceQueueId':_0x5a1298[_0x8df8('0xd6')]||undefined,'CampaignId':_0x5a1298['CampaignId']||undefined})[_0x8df8('0xb3')](loggerCatch(_0x8df8('0x11c')));var _0x2eeda8=new History(_0x3b5af0);_0x2eeda8['state']=0xa;_0x2eeda8[_0x8df8('0xaa')]='Drop';_0x2eeda8[_0x8df8('0xac')]=moment()[_0x8df8('0x7d')]('YYYY-MM-DD\x20HH:mm:ss');_0x2eeda8['endtime']=_0x2eeda8[_0x8df8('0xac')];_0x2eeda8[_0x8df8('0x11d')]=_0x3b5af0[_0x8df8('0x11d')];_0x2eeda8[_0x8df8('0x11e')]=_0x3b5af0[_0x8df8('0x11e')];this[_0x8df8('0xcb')](_0x2eeda8)[_0x8df8('0xb3')](loggerCatch(_0x8df8('0x11f')));}}else{this[_0x8df8('0x1f')][_0x2f6ab3[_0x8df8('0xb7')]][_0x8df8('0x6d')]+=0x1;this[_0x8df8('0x1f')][_0x2f6ab3['queue']][_0x8df8('0x64')]+=0x1;_0x3b5af0[_0x8df8('0xa9')]=0xb;_0x3b5af0['statedesc']=_0x8df8('0x120');_0x3b5af0['dropreason']=_0x8df8('0x121');_0x3b5af0['countabandonedretry']+=0x1;_0x3b5af0[_0x8df8('0xed')]+=0x1;if(_0x3b5af0[_0x8df8('0xf3')]>=this[_0x8df8('0x1f')][_0x2f6ab3[_0x8df8('0xb7')]]['dialAbandonedMaxRetry']){this[_0x8df8('0x112')](_0x3b5af0);}else{this[_0x8df8('0xc3')]({'active':![],'countabandonedretry':_0x3b5af0['countabandonedretry'],'scheduledat':moment()[_0x8df8('0xf8')](this[_0x8df8('0x1f')][_0x2f6ab3[_0x8df8('0xb7')]][_0x8df8('0x122')],_0x8df8('0x102'))['format'](_0x8df8('0xfa')),'ContactId':_0x5a1298[_0x8df8('0xd4')],'ListId':_0x5a1298[_0x8df8('0xfb')],'VoiceQueueId':_0x5a1298[_0x8df8('0xd6')]||undefined,'CampaignId':_0x5a1298[_0x8df8('0xfc')]||undefined})[_0x8df8('0xb3')](loggerCatch('[rescheduleContact][Abandoned]'));var _0x2eeda8=new History(_0x3b5af0);_0x2eeda8['state']=0xb;_0x2eeda8[_0x8df8('0xaa')]='Abandoned';_0x2eeda8[_0x8df8('0xac')]=moment()['format'](_0x8df8('0xfa'));_0x2eeda8[_0x8df8('0xab')]=_0x2eeda8[_0x8df8('0xac')];_0x2eeda8[_0x8df8('0x11d')]=_0x3b5af0[_0x8df8('0x11d')];_0x2eeda8[_0x8df8('0x11e')]=_0x3b5af0[_0x8df8('0x11e')];this['createHistory'](_0x2eeda8)[_0x8df8('0xb3')](loggerCatch(_0x8df8('0x123')));}}}}};Dialer[_0x8df8('0x19')][_0x8df8('0x36')]=function(_0x2710bc){if(this[_0x8df8('0x25')][_0x2710bc[_0x8df8('0xde')]]){this[_0x8df8('0x25')][_0x2710bc[_0x8df8('0xde')]][_0x8df8('0xb2')]=_0x2710bc[_0x8df8('0xb2')];}if(this[_0x8df8('0x27')][_0x2710bc[_0x8df8('0xde')]]){this[_0x8df8('0x27')][_0x2710bc[_0x8df8('0xde')]][_0x8df8('0xb2')]=_0x2710bc[_0x8df8('0xb2')];}};Dialer['prototype'][_0x8df8('0x39')]=function(_0x27817d){if(strategy[this[_0x8df8('0x1f')][this['actions'][_0x27817d[_0x8df8('0x124')]][_0x8df8('0xb7')]][_0x8df8('0x4f')]]===_0x8df8('0x18')){if(this[_0x8df8('0x25')][_0x27817d[_0x8df8('0x124')]]&&_[_0x8df8('0xb0')](this[_0x8df8('0x25')][_0x27817d[_0x8df8('0x124')]]['locked'])&&_0x27817d[_0x8df8('0xdb')]==='1'&&_0x27817d['paused']==='0'){if(this[_0x8df8('0x21')][_0x27817d[_0x8df8('0x125')]]){if(!this[_0x8df8('0x21')][_0x27817d[_0x8df8('0x125')]][_0x8df8('0x126')]){this[_0x8df8('0x21')][_0x27817d[_0x8df8('0x125')]]['locked']=!![];this[_0x8df8('0x25')][_0x27817d[_0x8df8('0x124')]][_0x8df8('0x126')]=!![];this[_0x8df8('0x25')][_0x27817d[_0x8df8('0x124')]]['stateinterface']=_0x27817d[_0x8df8('0x125')];}}}}else if((strategy[this[_0x8df8('0x1f')][this['actions'][_0x27817d['actionid']][_0x8df8('0xb7')]]['strategy']]||_0x8df8('0x17'))==='rrmemory'){if(this[_0x8df8('0x25')][_0x27817d['actionid']]){if(this[_0x8df8('0x21')][_0x27817d[_0x8df8('0x125')]]){this[_0x8df8('0x25')][_0x27817d[_0x8df8('0x124')]][_0x8df8('0x125')]=_0x27817d[_0x8df8('0x125')];if(_[_0x8df8('0xb0')](this[_0x8df8('0x2c')][this[_0x8df8('0x25')][_0x27817d[_0x8df8('0x124')]][_0x8df8('0xb7')]])){this[_0x8df8('0x2c')][this[_0x8df8('0x25')][_0x27817d['actionid']][_0x8df8('0xb7')]]=[];}this[_0x8df8('0x2c')][this[_0x8df8('0x25')][_0x27817d[_0x8df8('0x124')]][_0x8df8('0xb7')]][_0x8df8('0x127')](_[_0x8df8('0xd2')](_[_0x8df8('0xd3')](this[_0x8df8('0x25')][_0x27817d[_0x8df8('0x124')]],[_0x8df8('0x128'),_0x8df8('0x125')]),{'status':_0x27817d['status'],'paused':_0x27817d['paused']}));}}}};function unlockQueueStatus(_0x3dfd43,_0x13eed3){setTimeout(function(){if(_[_0x8df8('0x8d')](_0x3dfd43['queueStatusComplete'])){loggerBooked[_0x8df8('0x95')](_0x8df8('0x129'),_0x13eed3);}_0x3dfd43['queueStatusComplete']=!![];loggerBooked[_0x8df8('0x84')](_0x8df8('0x12a'),_0x13eed3,JSON['stringify'](_[_0x8df8('0xd3')](_0x3dfd43,[_0x8df8('0x3f'),_0x8df8('0x12b')])));},0x1f3);}Dialer['prototype']['syncQueueStatusComplete']=function(_0x526ab5){var _0x1b83bb=this;var _0x34603=_0x1b83bb[_0x8df8('0x1f')][_0x1b83bb[_0x8df8('0x25')][_0x526ab5[_0x8df8('0x124')]][_0x8df8('0xb7')]];if(strategy[this[_0x8df8('0x1f')][this[_0x8df8('0x25')][_0x526ab5['actionid']][_0x8df8('0xb7')]][_0x8df8('0x4f')]]===_0x8df8('0x18')){if(this[_0x8df8('0x25')][_0x526ab5['actionid']]&&this['actions'][_0x526ab5[_0x8df8('0x124')]][_0x8df8('0x125')]){this[_0x8df8('0x1e')][_0x8df8('0x12c')](this[_0x8df8('0x25')][_0x526ab5[_0x8df8('0x124')]][_0x8df8('0x128')],this[_0x8df8('0x25')][_0x526ab5['actionid']][_0x8df8('0x125')])[_0x8df8('0xb3')](function(_0x4677e6){logger[_0x8df8('0x95')]('[Catch][Preview][syncQueueStatusComplete]',util[_0x8df8('0xd0')](_0x4677e6,{'showHidden':![],'depth':null}));})['finally'](function(){_0x1b83bb['updateOriginated'](_0x1b83bb[_0x8df8('0x1f')][_0x1b83bb[_0x8df8('0x25')][_0x526ab5[_0x8df8('0x124')]][_0x8df8('0xb7')]]);_0x1b83bb[_0x8df8('0x21')][_0x1b83bb['actions'][_0x526ab5['actionid']]['stateinterface']][_0x8df8('0x126')]=![];delete _0x1b83bb[_0x8df8('0x25')][_0x526ab5[_0x8df8('0x124')]];unlockQueueStatus(_0x34603);});}else{this[_0x8df8('0xb5')](this[_0x8df8('0x1f')][this['actions'][_0x526ab5['actionid']][_0x8df8('0xb7')]]);this['rescheduleContact']({'active':![],'ContactId':this[_0x8df8('0x25')][_0x526ab5['actionid']]['ContactId'],'ListId':this[_0x8df8('0x25')][_0x526ab5['actionid']][_0x8df8('0xfb')],'VoiceQueueId':this['actions'][_0x526ab5[_0x8df8('0x124')]][_0x8df8('0xd6')]||undefined,'CampaignId':this['actions'][_0x526ab5[_0x8df8('0x124')]][_0x8df8('0xfc')]||undefined})[_0x8df8('0xb3')](loggerCatch(_0x8df8('0x12d')));delete this[_0x8df8('0x25')][_0x526ab5[_0x8df8('0x124')]];unlockQueueStatus(_0x34603);}}else if((strategy[this['voiceQueues'][this[_0x8df8('0x25')][_0x526ab5[_0x8df8('0x124')]][_0x8df8('0xb7')]][_0x8df8('0x4f')]]||_0x8df8('0x17'))===_0x8df8('0x17')){var _0x2dc5d8;if(this[_0x8df8('0x25')][_0x526ab5['actionid']]&&!_[_0x8df8('0x45')](this[_0x8df8('0x2c')][this[_0x8df8('0x25')][_0x526ab5[_0x8df8('0x124')]]['queue']])){if(this[_0x8df8('0x12e')][_0x1b83bb[_0x8df8('0x25')][_0x526ab5[_0x8df8('0x124')]][_0x8df8('0xb7')]]){this[_0x8df8('0x12e')][_0x1b83bb['actions'][_0x526ab5[_0x8df8('0x124')]][_0x8df8('0xb7')]]=this[_0x8df8('0x12e')][this[_0x8df8('0x25')][_0x526ab5['actionid']][_0x8df8('0xb7')]]?this[_0x8df8('0x12e')][this['actions'][_0x526ab5[_0x8df8('0x124')]][_0x8df8('0xb7')]]:this['queueBooked'][this['actions'][_0x526ab5[_0x8df8('0x124')]][_0x8df8('0xb7')]]?this['queueBooked'][this['actions'][_0x526ab5[_0x8df8('0x124')]][_0x8df8('0xb7')]][_0x8df8('0x12f')]||0x0:0x0;}this[_0x8df8('0x2c')][this[_0x8df8('0x25')][_0x526ab5['actionid']][_0x8df8('0xb7')]][_0x8df8('0x12f')]=this['queueBookedRR'][this['actions'][_0x526ab5[_0x8df8('0x124')]][_0x8df8('0xb7')]];for(var _0x3ef1d3=0x0;_0x3ef1d3=0x0?!![]:![];})['catch'](myreject(_0x584bc8)));}}else{_0x4b3627[_0x8df8('0x127')](ami[_0x8df8('0xb1')]({'action':_0x8df8('0x149'),'command':util[_0x8df8('0x7d')](_0x8df8('0x147'),_0x522802,!_[_0x8df8('0x8d')](config[_0x8df8('0x145')][_0x53c08b])?_0x53c08b:'')})['then'](function(_0x266824){return _0x266824[_0x8df8('0x14a')][_0x8df8('0x148')](_0x8df8('0x14b'))>=0x0?!![]:![];})[_0x8df8('0xb3')](myreject(_0x584bc8)));}BPromise[_0x8df8('0x14c')](_0x4b3627)[_0x8df8('0xba')](function(_0x386581){var _0x1dd869=_[_0x8df8('0x14d')](_0x386581);if(_0x1dd869){return _0x353be3(_0x1dd869);}else{_0x18ccb8['message']=_0x52cca4?_0x8df8('0x14e'):_0x8df8('0x14f');return _0x584bc8(msgResponse(_0x8df8('0x150'),_0x8df8('0x142'),'Global:\x20'+_0x52cca4+'\x20'+_0x4326d4+'\x20Interval\x20is\x20overtime:\x20'+util[_0x8df8('0xd0')](_0x522802,{'showHidden':![],'depth':null})+_0x8df8('0x151')+_0x53c08b));}})['catch'](function(_0xbbc0fa){return _0x584bc8(msgResponse('ifTime','Failure',JSON[_0x8df8('0x7c')](_0xbbc0fa)));});});};Dialer['prototype'][_0x8df8('0x152')]=function(_0x7ae4ce){var _0xab25bd=this;return function(){switch(_0x7ae4ce[_0x8df8('0x5b')]){case _0x8df8('0x153'):freeVariablesPredictive(_0x7ae4ce);_0xab25bd[_0x8df8('0x154')](_0x7ae4ce,0x1);break;case _0x8df8('0x155'):freeVariablesPredictive(_0x7ae4ce);_0xab25bd[_0x8df8('0x154')](_0x7ae4ce,_0x7ae4ce[_0x8df8('0x156')]);break;case _0x8df8('0x8'):_0xab25bd['predictive'](_0x7ae4ce);break;case _0x8df8('0x157'):freeVariablesPredictive(_0x7ae4ce);_0xab25bd[_0x8df8('0x154')](_0x7ae4ce,0x1);break;default:freeVariablesPredictive(_0x7ae4ce);logger[_0x8df8('0x95')](_0x8df8('0x158'),_0x7ae4ce[_0x8df8('0x3f')],_0x8df8('0x159'));}};};Dialer[_0x8df8('0x19')][_0x8df8('0x15a')]=function(_0x385bea){var _0x2beaa0=this;return function(){_0x2beaa0[_0x8df8('0x15b')](_0x385bea);};};Dialer[_0x8df8('0x19')][_0x8df8('0x9')]=function(_0x4ac83e){var _0xc5ad76=this;if(isNotPreview(_0x4ac83e['dialMethod'])){if(isVoiceQueueOutbound(_0x4ac83e[_0x8df8('0x4d')])&&isActive(_0x4ac83e[_0x8df8('0x5a')])){_0x4ac83e[_0x8df8('0xa0')]=!![];BPromise[_0x8df8('0xb9')]()[_0x8df8('0xba')](checkIsLoggedIn(_0x4ac83e,_0x4ac83e[_0x8df8('0x52')]))[_0x8df8('0xba')](checkIsActive(_0x4ac83e,_0x4ac83e[_0x8df8('0x5a')]))['then'](checkInterval(_0x4ac83e))[_0x8df8('0xba')](_0xc5ad76[_0x8df8('0x13b')](_0x4ac83e))['then'](_0xc5ad76[_0x8df8('0x15c')](_0x4ac83e['dialGlobalInterval'],_0x4ac83e[_0x8df8('0x15d')],_0x4ac83e[_0x8df8('0x3f')],_0x4ac83e))[_0x8df8('0xba')](_0xc5ad76[_0x8df8('0x140')](_0x4ac83e['Interval'],_0x4ac83e['dialTimezone'],_0x4ac83e['name'],_0x4ac83e))[_0x8df8('0xba')](_0xc5ad76[_0x8df8('0x152')](_0x4ac83e))[_0x8df8('0xb3')](loggerCatchQueueSummary(_0x8df8('0x15e'),_0x4ac83e));}else{notSendMessagesQueue(_0x4ac83e);}}else{freeVariablesPredictive(_0x4ac83e);}};Dialer[_0x8df8('0x19')][_0x8df8('0x13a')]=function(){var _0x4c1b3a=this;var _0x230cc6;for(var _0x439a19 in this[_0x8df8('0x20')]){if(this[_0x8df8('0x20')][_0x8df8('0x97')](_0x439a19)){_0x230cc6=this[_0x8df8('0x20')][_0x439a19];if(isCampaignIvr(_0x230cc6[_0x8df8('0x4d')])&&isActive(_0x230cc6[_0x8df8('0x7a')])){_0x230cc6[_0x8df8('0xa0')]=!![];BPromise[_0x8df8('0xb9')]()[_0x8df8('0xba')](checkIsActive(_0x230cc6,_0x230cc6[_0x8df8('0x7a')]))[_0x8df8('0xba')](checkInterval(_0x230cc6))['then'](_0x4c1b3a[_0x8df8('0x13b')](_0x230cc6))[_0x8df8('0xba')](_0x4c1b3a['checkIfTime'](_0x230cc6[_0x8df8('0x15f')],_0x230cc6[_0x8df8('0x15d')],_0x230cc6[_0x8df8('0x3f')],_0x230cc6))[_0x8df8('0xba')](_0x4c1b3a[_0x8df8('0x140')](_0x230cc6[_0x8df8('0x43')],_0x230cc6[_0x8df8('0x15d')],_0x230cc6[_0x8df8('0x3f')],_0x230cc6))[_0x8df8('0xba')](_0x4c1b3a['launchHandleIvr'](_0x230cc6))[_0x8df8('0xb3')](loggerCatchQueueSummary(_0x8df8('0x160'),_0x230cc6));}else{notSendMessagesCampaign(_0x230cc6);}}}};function getCallerIdRandom(_0x594098,_0x1f8463){var _0x17fcf5,_0x28f632,_0x3a65ea;if(_0x1f8463<=0x0){_0x1f8463=0x1;}_0x17fcf5=new RegExp(_0x8df8('0x161')+_0x1f8463+'}$');_0x28f632=Math[_0x8df8('0x162')](0xa,_0x1f8463-0x1);_0x3a65ea=Math[_0x8df8('0x162')](0xa,_0x1f8463)-0x1;return util['format']('%s',_[_0x8df8('0x163')](_0x594098,_0x17fcf5,_[_0x8df8('0x164')](_0x28f632,_0x3a65ea)));}function extractCalleridName(_0xe625fc){var _0x3c73a8=_0xe625fc['match'](/"(.*?)"/);return _0x3c73a8?_0x3c73a8[0x1]:_0xe625fc;}function extractCalleridNumber(_0x564fbb){var _0x43440a=_0x564fbb[_0x8df8('0x165')](/<(.*?)>/);return _0x43440a?_0x43440a[0x1]:_0x564fbb;}Dialer['prototype'][_0x8df8('0x166')]=function(_0x454435,_0x5c36fd){var _0x140249=this;var _0x135087=uuid['v4']();this[_0x8df8('0x25')][_0x135087]=new Action(_0x454435,_0x5c36fd,_0x135087);return new BPromise(function(_0x14e77f,_0x53ccd7){if(_[_0x8df8('0x8d')](_0x454435)&&_0x8df8('0x167')!==typeof _0x454435){return _0x53ccd7(msgResponse('originate',_0x8df8('0x142'),'voiceQueue\x20is\x20undefine'));}if(_[_0x8df8('0x8d')](_0x5c36fd[_0x8df8('0x168')][_0x8df8('0x169')])||_0x5c36fd[_0x8df8('0x168')]['phone']===null){return _0x53ccd7(msgResponse(_0x8df8('0x16a'),_0x8df8('0x142'),_0x8df8('0x16b')));}var _0x34e736={'XMD-CALLERID':_0x140249[_0x8df8('0x25')][_0x135087][_0x8df8('0x16c')](),'XMD-AGI':_0x454435['dialQueueProject']?util[_0x8df8('0x7d')](_0x8df8('0x16d'),ipAgi,_0x454435[_0x8df8('0x104')]):_0x8df8('0x16e'),'XMD-AGIAFTER':_0x454435[_0x8df8('0x10e')]?util[_0x8df8('0x7d')](_0x8df8('0x16d'),ipAgi,_0x454435[_0x8df8('0x10e')]):_0x8df8('0x16e'),'XMD-QUEUE':_0x454435[_0x8df8('0x4d')]==='outbound'?util['format'](_0x8df8('0x16f'),_0x454435['name'],_0x454435[_0x8df8('0x170')]||'',_0x454435[_0x8df8('0x10f')]?'c':'',_0x454435[_0x8df8('0x117')]||0x3):_0x8df8('0x16e'),'XMD-CONTACTID':_0x5c36fd[_0x8df8('0xd4')],'XMD-CDRTYPE':_0x8df8('0x171'),'CALLERID(all)':_0x140249[_0x8df8('0x25')][_0x135087][_0x8df8('0x16c')](),'XMD-AMD':_0x454435[_0x8df8('0xe3')]?_0x8df8('0x172'):'NONE','XMD-DESTINATION':_0x8df8('0xe2')};if(_0x454435[_0x8df8('0xe3')]){_0x34e736[_0x8df8('0x173')]=_0x454435[_0x8df8('0x174')]||0x9c4;_0x34e736['XMD-AMDGREETING']=_0x454435['dialAMDGreeting']||0x5dc;_0x34e736[_0x8df8('0x175')]=_0x454435[_0x8df8('0x176')]||0x320;_0x34e736[_0x8df8('0x177')]=_0x454435[_0x8df8('0x178')]||0x1388;_0x34e736['XMD-AMDMINWORDLENGTH']=_0x454435[_0x8df8('0x179')]||0x64;_0x34e736[_0x8df8('0x17a')]=_0x454435[_0x8df8('0x17b')]||0x32;_0x34e736[_0x8df8('0x17c')]=_0x454435[_0x8df8('0x17d')]||0x3;_0x34e736[_0x8df8('0x17e')]=_0x454435[_0x8df8('0x17f')]||0x100;_0x34e736[_0x8df8('0x180')]=_0x454435[_0x8df8('0x181')]||0x1388;}if(_0x454435[_0x8df8('0x4d')]==='outbound'){_0x34e736[_0x8df8('0x182')]=_0x5c36fd[_0x8df8('0xd6')];}else{_0x34e736[_0x8df8('0x183')]=_0x5c36fd[_0x8df8('0xfc')];}for(var _0x96e4ba in _0x5c36fd[_0x8df8('0x168')]){if(_0x5c36fd['Contact']['hasOwnProperty'](_0x96e4ba)){if(isNotNull(_0x5c36fd[_0x8df8('0x168')][_0x96e4ba])&&_0x96e4ba!=='id'&&_0x96e4ba!==_0x8df8('0x184')&&_0x96e4ba!==_0x8df8('0x185')&&_0x96e4ba!==_0x8df8('0x186')){_0x34e736[util['format'](_0x8df8('0x187'),_0x8df8('0x188'),_[_0x8df8('0x189')](_0x96e4ba))]=_0x5c36fd[_0x8df8('0x168')][_0x96e4ba];}}}var _0x1f933c=_0x140249[_0x8df8('0x13c')](_0x454435[_0x8df8('0x79')])?getCallerId(_0x454435[_0x8df8('0x79')]['callerid'],_0x454435[_0x8df8('0x5c')],_0x454435[_0x8df8('0x18a')]>0x0?getCallerIdRandom(_0x454435['dialOriginateCallerIdNumber'],_0x454435[_0x8df8('0x18a')]):_0x454435[_0x8df8('0x5d')]):getCallerId(_['isNil'](_0x454435[_0x8df8('0x18b')])?_0x454435[_0x8df8('0x79')][_0x8df8('0x7b')]:_0x454435[_0x8df8('0x18b')][_0x8df8('0x7b')],_0x454435[_0x8df8('0x5c')],_0x454435[_0x8df8('0x18a')]>0x0?getCallerIdRandom(_0x454435['dialOriginateCallerIdNumber'],_0x454435[_0x8df8('0x18a')]):_0x454435['dialOriginateCallerIdNumber']);if(_0x1f933c){_0x34e736[_0x8df8('0x18c')]=_0x140249['actions'][_0x135087][_0x8df8('0x18d')]=extractCalleridName(_0x1f933c);_0x34e736[_0x8df8('0x18e')]=_0x140249['actions'][_0x135087]['originatecalleridnum']=extractCalleridNumber(_0x1f933c);}return ami[_0x8df8('0xb1')]({'actionid':_0x135087,'action':_0x8df8('0x16a'),'channel':_0x140249[_0x8df8('0x13c')](_0x454435[_0x8df8('0x79')])?util['format'](_0x8df8('0x18f'),_0x454435['Trunk'][_0x8df8('0x3f')],isNotNull(_0x454435[_0x8df8('0x190')])?_0x454435[_0x8df8('0x190')][_0x8df8('0x191')]()||'':'',_0x454435[_0x8df8('0x192')]>0x0?_0x5c36fd[_0x8df8('0x168')][_0x8df8('0x169')][_0x8df8('0x193')](_0x454435[_0x8df8('0x192')]):_0x5c36fd[_0x8df8('0x168')][_0x8df8('0x169')]):util['format'](_0x8df8('0x18f'),_[_0x8df8('0xb0')](_0x454435[_0x8df8('0x18b')])?_0x454435[_0x8df8('0x79')][_0x8df8('0x3f')]:_0x454435[_0x8df8('0x18b')][_0x8df8('0x3f')],isNotNull(_0x454435['dialPrefix'])?_0x454435['dialPrefix'][_0x8df8('0x191')]()||'':'',_0x454435['dialCutDigit']>0x0?_0x5c36fd[_0x8df8('0x168')]['phone']['substring'](_0x454435['dialCutDigit']):_0x5c36fd['Contact'][_0x8df8('0x169')]),'callerid':_0x1f933c,'Exten':_0x8df8('0xe2'),'Context':'from-sip','Priority':'1','variable':_0x34e736,'timeout':(_0x454435[_0x8df8('0x5e')]||0x1e)*0x3e8,'async':!![],'channelid':_0x135087})['then'](function(_0x68676d){return _0x14e77f(_0x68676d);})[_0x8df8('0xb3')](function(_0xbd054a){_0x454435['outboundOriginateFailureCallsDay']+=0x1;var _0x92f0bf=new History(_0x140249[_0x8df8('0x25')][_0x135087]);logger['error'](util[_0x8df8('0x7d')](_0x8df8('0x194'),JSON[_0x8df8('0x7c')](_0xbd054a)));_0x92f0bf['state']=0xe;_0x92f0bf[_0x8df8('0xaa')]=_0x8df8('0x195');_0x92f0bf[_0x8df8('0xac')]=moment()['format'](_0x8df8('0xfa'));_0x92f0bf[_0x8df8('0xab')]=_0x92f0bf[_0x8df8('0xac')];_0x140249[_0x8df8('0xcb')](_0x92f0bf)[_0x8df8('0xb3')](loggerCatch(_0x8df8('0x196')));_0x140249['moveContactManagedDialer'](_0x92f0bf)[_0x8df8('0xb3')](loggerCatch(_0x8df8('0x196')))[_0x8df8('0x1c')](function(){delete _0x140249[_0x8df8('0x25')][_0x135087];return _0x53ccd7(msgResponse(_0x8df8('0x16a'),'Error','originate\x20action\x20Error'));});});});};Dialer[_0x8df8('0x19')][_0x8df8('0x30')]=function(_0x14a455){var _0x440baa=this[_0x8df8('0x25')][_0x14a455[_0x8df8('0x124')]];var _0x16df4b=this;if(_0x440baa){delete this['actions'][_0x14a455[_0x8df8('0x124')]];_0x440baa[_0x8df8('0x116')]=moment()[_0x8df8('0x7d')](_0x8df8('0xfa'));var _0x501eb6=_0x440baa[_0x8df8('0x4d')]==='ivr'?this[_0x8df8('0x20')][_0x440baa[_0x8df8('0xb7')]]:this[_0x8df8('0x1f')][_0x440baa['getQueue']()];if(!this[_0x8df8('0x197')](_0x14a455[_0x8df8('0x198')])){this['updateOriginated'](_0x501eb6);return this['callProgressDetecting'](_0x440baa,_0x501eb6,_0x14a455)[_0x8df8('0xba')](function(_0x468adb){})['catch'](loggerCatch(_0x8df8('0x199')));}else{this[_0x8df8('0x27')][_0x14a455['uniqueid']]=_0x440baa;}}};Dialer['prototype'][_0x8df8('0x19a')]=function(_0x19deb8,_0x35893a,_0x29d437){var _0x420c7b=new History(_0x35893a);if(_0x420c7b[_0x8df8('0xfe')]+_0x420c7b['countcongestionretry']+_0x420c7b[_0x8df8('0xf1')]+_0x420c7b[_0x8df8('0xff')]+_0x420c7b[_0x8df8('0xf2')]+_0x420c7b[_0x8df8('0xf3')]+_0x420c7b['countmachineretry']+_0x420c7b[_0x8df8('0xf4')]>=_0x29d437[_0x8df8('0xf5')]-0x1){return!![];}switch(_0x19deb8){case 0x3:if(_0x420c7b['countnoanswerretry']>=_0x29d437['dialNoAnswerMaxRetry']-0x1){return!![];}else{this[_0x8df8('0xc3')]({'active':![],'countnoanswerretry':_0x420c7b[_0x8df8('0xf1')]+=0x1,'scheduledat':moment()['add'](_0x29d437[_0x8df8('0x19b')],_0x8df8('0x102'))[_0x8df8('0x7d')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x420c7b[_0x8df8('0xd4')],'ListId':_0x420c7b[_0x8df8('0xfb')],'VoiceQueueId':_0x420c7b[_0x8df8('0xd6')]||undefined,'CampaignId':_0x420c7b['CampaignId']||undefined})[_0x8df8('0xb3')](loggerCatch(_0x8df8('0x19c')));}break;case 0x5:if(_0x420c7b[_0x8df8('0xfe')]>=_0x29d437['dialBusyMaxRetry']-0x1){return!![];}else{this[_0x8df8('0xc3')]({'active':![],'countbusyretry':_0x420c7b['countbusyretry']+=0x1,'scheduledat':moment()[_0x8df8('0xf8')](_0x29d437[_0x8df8('0x19d')],_0x8df8('0x102'))[_0x8df8('0x7d')](_0x8df8('0xfa')),'ContactId':_0x420c7b['ContactId'],'ListId':_0x420c7b['ListId'],'VoiceQueueId':_0x420c7b[_0x8df8('0xd6')]||undefined,'CampaignId':_0x420c7b[_0x8df8('0xfc')]||undefined})[_0x8df8('0xb3')](loggerCatch(_0x8df8('0x19e')));}break;case 0x8:if(_0x420c7b['countcongestionretry']>=_0x29d437[_0x8df8('0x19f')]-0x1){return!![];}else{this[_0x8df8('0xc3')]({'active':![],'countcongestionretry':_0x420c7b[_0x8df8('0xf0')]+=0x1,'scheduledat':moment()[_0x8df8('0xf8')](_0x29d437[_0x8df8('0x1a0')],_0x8df8('0x102'))[_0x8df8('0x7d')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x420c7b[_0x8df8('0xd4')],'ListId':_0x420c7b[_0x8df8('0xfb')],'VoiceQueueId':_0x420c7b['VoiceQueueId']||undefined,'CampaignId':_0x420c7b[_0x8df8('0xfc')]||undefined})[_0x8df8('0xb3')](loggerCatch('[rescheduleContact]\x20[Congestion]'));}break;case 0x0:if(_0x420c7b[_0x8df8('0xff')]>=_0x29d437[_0x8df8('0x1a1')]-0x1){return!![];}else{this[_0x8df8('0xc3')]({'active':![],'countnosuchnumberretry':_0x420c7b['countnosuchnumberretry']+=0x1,'scheduledat':moment()[_0x8df8('0xf8')](_0x29d437[_0x8df8('0x1a2')],_0x8df8('0x102'))[_0x8df8('0x7d')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x420c7b[_0x8df8('0xd4')],'ListId':_0x420c7b[_0x8df8('0xfb')],'VoiceQueueId':_0x420c7b['VoiceQueueId']||undefined,'CampaignId':_0x420c7b[_0x8df8('0xfc')]||undefined})[_0x8df8('0xb3')](loggerCatch(_0x8df8('0x1a3')));}break;case 0xa:if(_0x420c7b['countdropretry']>=_0x29d437[_0x8df8('0x1a4')]-0x1){return!![];}else{this[_0x8df8('0xc3')]({'active':![],'countdropretry':_0x420c7b[_0x8df8('0xf2')]+=0x1,'scheduledat':moment()[_0x8df8('0xf8')](_0x29d437[_0x8df8('0x11b')],_0x8df8('0x102'))[_0x8df8('0x7d')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x420c7b[_0x8df8('0xd4')],'ListId':_0x420c7b[_0x8df8('0xfb')],'VoiceQueueId':_0x420c7b[_0x8df8('0xd6')]||undefined,'CampaignId':_0x420c7b['CampaignId']||undefined})['catch'](loggerCatch('[rescheduleContact][Drop]'));}break;case 0xb:if(_0x420c7b[_0x8df8('0xf3')]>=_0x29d437[_0x8df8('0x1a5')]-0x1){return!![];}else{this[_0x8df8('0xc3')]({'active':![],'countabandonedretry':_0x420c7b[_0x8df8('0xf3')]+=0x1,'scheduledat':moment()['add'](_0x29d437[_0x8df8('0x122')],_0x8df8('0x102'))[_0x8df8('0x7d')](_0x8df8('0xfa')),'ContactId':_0x420c7b[_0x8df8('0xd4')],'ListId':_0x420c7b[_0x8df8('0xfb')],'VoiceQueueId':_0x420c7b[_0x8df8('0xd6')]||undefined,'CampaignId':_0x420c7b['CampaignId']||undefined})[_0x8df8('0xb3')](loggerCatch(_0x8df8('0x1a6')));}break;case 0x13:if(_0x420c7b[_0x8df8('0xec')]>=_0x29d437[_0x8df8('0xf7')]-0x1){return!![];}else{this[_0x8df8('0xc3')]({'active':![],'countmachineretry':_0x420c7b['countmachineretry']+=0x1,'scheduledat':moment()[_0x8df8('0xf8')](_0x29d437[_0x8df8('0xf9')],'minutes')[_0x8df8('0x7d')](_0x8df8('0xfa')),'ContactId':_0x420c7b[_0x8df8('0xd4')],'ListId':_0x420c7b[_0x8df8('0xfb')],'VoiceQueueId':_0x420c7b[_0x8df8('0xd6')]||undefined,'CampaignId':_0x420c7b[_0x8df8('0xfc')]||undefined})[_0x8df8('0xb3')](loggerCatch(_0x8df8('0x103')));}break;case 0x14:if(_0x420c7b[_0x8df8('0xf4')]>=_0x29d437[_0x8df8('0x1a7')]-0x1){return!![];}else{this[_0x8df8('0xc3')]({'active':![],'countagentrejectretry':_0x420c7b['countagentrejectretry']+=0x1,'scheduledat':moment()[_0x8df8('0xf8')](_0x29d437[_0x8df8('0x1a8')],_0x8df8('0x102'))[_0x8df8('0x7d')](_0x8df8('0xfa')),'ContactId':_0x420c7b['ContactId'],'ListId':_0x420c7b[_0x8df8('0xfb')],'VoiceQueueId':_0x420c7b[_0x8df8('0xd6')]||undefined,'CampaignId':_0x420c7b['CampaignId']||undefined})[_0x8df8('0xb3')](loggerCatch(_0x8df8('0x1a9')));}break;default:return!![];}};Dialer[_0x8df8('0x19')][_0x8df8('0x1aa')]=function(_0x4ee873,_0x37bcee,_0x3361a5){var _0x555231=this;var _0x24fbb5=new History(_0x4ee873);return new BPromise(function(_0x589424,_0x532d12){if(_[_0x8df8('0x8d')](_0x37bcee)&&_0x8df8('0x167')!==typeof _0x37bcee){return _0x532d12(msgResponse('[callProgressDetecting]',_0x8df8('0x142'),_0x8df8('0x1ab')));}if(_[_0x8df8('0x8d')](_0x3361a5)&&_0x8df8('0x167')!==typeof _0x3361a5){return _0x532d12(msgResponse(_0x8df8('0x1ac'),_0x8df8('0x142'),_0x8df8('0x1ad')));}switch(_0x3361a5[_0x8df8('0x10b')]){case'0':_0x37bcee['outboundNoSuchCallsDay']+=0x1;_0x24fbb5[_0x8df8('0xa9')]=0x0;_0x24fbb5[_0x8df8('0xaa')]=_0x8df8('0x1ae');_0x24fbb5[_0x8df8('0xff')]+=0x1;_0x24fbb5[_0x8df8('0xed')]+=0x1;ami[_0x8df8('0x4c')](_0x8df8('0x1af'),ut['buildObj'](_0x4ee873,_0x8df8('0x1b0')));_0x555231[_0x8df8('0xcb')](_0x24fbb5)[_0x8df8('0xb3')](loggerCatch(_0x8df8('0xef')));if(_0x555231[_0x8df8('0x19a')](0x0,_0x4ee873,_0x37bcee)){if(_0x24fbb5[_0x8df8('0xff')]>=_0x37bcee[_0x8df8('0x1a1')]){_0x555231[_0x8df8('0x1b1')](_0x24fbb5,_0x589424,_0x532d12,_0x8df8('0x1b2'));}else{_0x555231[_0x8df8('0xf6')](_0x24fbb5,_0x589424,_0x532d12,_0x8df8('0x1b2'));}}break;case'3':_0x37bcee[_0x8df8('0x1b3')]+=0x1;_0x24fbb5[_0x8df8('0xa9')]=0x3;_0x24fbb5[_0x8df8('0xaa')]=_0x8df8('0x1b4');_0x24fbb5[_0x8df8('0xf1')]+=0x1;_0x24fbb5[_0x8df8('0xed')]+=0x1;ami[_0x8df8('0x4c')](_0x8df8('0x1b5'),ut[_0x8df8('0x1b6')](_0x4ee873,'noanswer'));_0x555231[_0x8df8('0xcb')](_0x24fbb5)[_0x8df8('0xb3')](loggerCatch('[syncAgentComplete][createHistory][3]'));if(_0x555231[_0x8df8('0x19a')](0x3,_0x4ee873,_0x37bcee)){if(_0x24fbb5[_0x8df8('0xf1')]>=_0x37bcee[_0x8df8('0x1b7')]){_0x555231[_0x8df8('0x1b1')](_0x24fbb5,_0x589424,_0x532d12,'reason\x203\x20ringing\x20no\x20answer');}else{_0x555231[_0x8df8('0xf6')](_0x24fbb5,_0x589424,_0x532d12,_0x8df8('0x1b8'));}}break;case'5':_0x37bcee['outboundBusyCallsDay']+=0x1;_0x24fbb5['state']=0x5;_0x24fbb5[_0x8df8('0xaa')]='Busy';_0x24fbb5['countbusyretry']+=0x1;_0x24fbb5[_0x8df8('0xed')]+=0x1;ami['emit'](_0x8df8('0x1b9'),ut[_0x8df8('0x1b6')](_0x4ee873,'busy'));_0x555231['createHistory'](_0x24fbb5)['catch'](loggerCatch('[syncAgentComplete][createHistory][5]'));if(_0x555231[_0x8df8('0x19a')](0x5,_0x4ee873,_0x37bcee)){if(_0x24fbb5[_0x8df8('0xfe')]>=_0x37bcee[_0x8df8('0x1ba')]){_0x555231['createStateFinal'](_0x24fbb5,_0x589424,_0x532d12,'reason\x205\x20busy');}else{_0x555231['stateGlobal'](_0x24fbb5,_0x589424,_0x532d12,_0x8df8('0x1bb'));}}break;case'8':_0x37bcee[_0x8df8('0x1bc')]+=0x1;_0x24fbb5[_0x8df8('0xa9')]=0x8;_0x24fbb5['statedesc']=_0x8df8('0x1bd');_0x24fbb5[_0x8df8('0xf0')]+=0x1;_0x24fbb5['countglobal']+=0x1;ami[_0x8df8('0x4c')](_0x8df8('0x1be'),ut[_0x8df8('0x1b6')](_0x4ee873,'congestion'));_0x555231['createHistory'](_0x24fbb5)['catch'](loggerCatch(_0x8df8('0x1bf')));if(_0x555231[_0x8df8('0x19a')](0x8,_0x4ee873,_0x37bcee)){if(_0x24fbb5[_0x8df8('0xf0')]>=_0x37bcee['dialCongestionMaxRetry']){_0x555231[_0x8df8('0x1b1')](_0x24fbb5,_0x589424,_0x532d12,'reason\x208\x20congestion');}else{_0x555231[_0x8df8('0xf6')](_0x24fbb5,_0x589424,_0x532d12,_0x8df8('0x1c0'));}}break;case'11':_0x37bcee['outboundAbandonedCallsDay']+=0x1;_0x24fbb5[_0x8df8('0xa9')]=0xb;_0x24fbb5[_0x8df8('0xaa')]=_0x8df8('0x120');_0x24fbb5[_0x8df8('0xf3')]+=0x1;_0x24fbb5['countglobal']+=0x1;_0x555231[_0x8df8('0xcb')](_0x24fbb5)[_0x8df8('0xb3')](loggerCatch(_0x8df8('0x123')));if(_0x555231[_0x8df8('0x19a')](0xb,_0x4ee873,_0x37bcee)){if(_0x24fbb5[_0x8df8('0xf3')]>=_0x37bcee['dialAbandonedMaxRetry']){_0x555231[_0x8df8('0x1b1')](_0x24fbb5,_0x589424,_0x532d12,_0x8df8('0x1c1'));}else{_0x555231['stateGlobal'](_0x24fbb5,_0x589424,_0x532d12,_0x8df8('0x1c1'));}}break;case'20':_0x37bcee[_0x8df8('0x68')]+=0x1;_0x24fbb5[_0x8df8('0xa9')]=0x14;_0x24fbb5[_0x8df8('0xaa')]=_0x8df8('0x1c2');_0x24fbb5[_0x8df8('0xf4')]+=0x1;_0x24fbb5[_0x8df8('0xed')]+=0x1;ami[_0x8df8('0x4c')](_0x8df8('0x1c3'),ut['buildObj'](_0x4ee873,_0x8df8('0x1c4')));_0x555231[_0x8df8('0xcb')](_0x24fbb5)[_0x8df8('0xb3')](loggerCatch(_0x8df8('0x1c5')));if(_0x555231[_0x8df8('0x19a')](0x14,_0x4ee873,_0x37bcee)){if(_0x24fbb5[_0x8df8('0xf4')]>=_0x37bcee[_0x8df8('0x1a7')]){_0x555231[_0x8df8('0x1b1')](_0x24fbb5,_0x589424,_0x532d12,_0x8df8('0x1c6'));}else{_0x555231['stateGlobal'](_0x24fbb5,_0x589424,_0x532d12,'reason\x2020\x20agentreject');}}break;default:_0x37bcee[_0x8df8('0x69')]+=0x1;_0x24fbb5[_0x8df8('0xa9')]=0xc;_0x24fbb5[_0x8df8('0xaa')]=_0x3361a5[_0x8df8('0x10b')];_0x555231[_0x8df8('0xcb')](_0x24fbb5)[_0x8df8('0xb3')](loggerCatch(_0x8df8('0x1c7')));if(_0x555231[_0x8df8('0x19a')](_0x3361a5[_0x8df8('0x10b')],_0x4ee873,_0x37bcee)){if(_0x24fbb5[_0x8df8('0xfe')]+_0x24fbb5['countcongestionretry']+_0x24fbb5[_0x8df8('0xf1')]+_0x24fbb5[_0x8df8('0xff')]+_0x24fbb5[_0x8df8('0xf2')]+_0x24fbb5[_0x8df8('0xf3')]+_0x24fbb5[_0x8df8('0xec')]+_0x24fbb5['countagentrejectretry']>=_0x37bcee[_0x8df8('0xf5')]){_0x555231[_0x8df8('0xf6')](_0x24fbb5,_0x589424,_0x532d12,_0x3361a5[_0x8df8('0x10b')]);}else{_0x555231[_0x8df8('0x1b1')](_0x24fbb5,_0x589424,_0x532d12,_0x3361a5[_0x8df8('0x10b')]);}}}});};Dialer[_0x8df8('0x19')][_0x8df8('0xf6')]=function(_0x1d65dd,_0x3ac23b,_0x25e832,_0x3af22f){var _0x1a41ec=new Final(_0x1d65dd);_0x1a41ec[_0x8df8('0xa9')]=0xf;_0x1a41ec[_0x8df8('0xaa')]='Global';this['createStateFinal'](_0x1a41ec,_0x3ac23b,_0x25e832,_0x3af22f);};Dialer[_0x8df8('0x19')]['createStateFinal']=function(_0x34b281,_0x40cb51,_0x13405d,_0x396f16){this[_0x8df8('0xca')](_0x34b281)[_0x8df8('0xba')](function(_0x51bdd8){return _0x40cb51(msgResponse('[callProgressDetecting]',_0x8df8('0xd8'),_0x396f16));})[_0x8df8('0xb3')](function(_0x3e9712){return _0x13405d(msgResponse(_0x8df8('0x1c8'),_0x8df8('0x142'),'contact\x20not\x20moved'));});};Dialer[_0x8df8('0x19')][_0x8df8('0x8')]=function(_0x286d30){var _0x25a8af=this;var _0x362acc=_0x286d30[_0x8df8('0x1c9')]/0x64;var _0x5ae6d7=_0x286d30[_0x8df8('0x65')]/(_0x286d30['outboundDropCallsDayTimeout']+_0x286d30['outboundAnswerCallsDay']);var _0x504c79=Math['round'](_0x286d30[_0x8df8('0x1ca')]*(_0x286d30[_0x8df8('0x1cb')]/0x64));var _0x197a33=Math[_0x8df8('0x1cc')](_0x286d30[_0x8df8('0x1ca')]*(_0x286d30[_0x8df8('0x1cd')]/0x64));var _0x579ca6=_0x286d30[_0x8df8('0x51')]+_0x286d30[_0x8df8('0xa1')];var _0x1e4364=Math[_0x8df8('0x1ce')](_0x286d30[_0x8df8('0x75')]*_0x286d30[_0x8df8('0x77')]*_0x286d30[_0x8df8('0x71')]*_0x286d30[_0x8df8('0x1cf')]);if(_[_0x8df8('0x8d')](_0x286d30[_0x8df8('0x2a')])){if(!_['isUndefined'](_0x286d30[_0x8df8('0x29')])){_0x286d30['startPredictive']=undefined;loggerPredictive[_0x8df8('0x95')](_0x8df8('0x1d0'),'check\x20predictive\x20is\x20not\x20undefine');}if(!_['isUndefined'](_0x286d30[_0x8df8('0x90')])){loggerPredictive[_0x8df8('0x95')](_0x8df8('0x1d0'),_0x8df8('0x1d1'));clearInterval(_0x286d30[_0x8df8('0x90')]);_0x286d30[_0x8df8('0x90')]=undefined;}_0x286d30['startProgressive']=moment()[_0x8df8('0x7d')](_0x8df8('0xfa'));loggerPredictive[_0x8df8('0x84')](_0x286d30[_0x8df8('0x3f')],_0x8df8('0x1d2'),_0x286d30[_0x8df8('0x2a')]);this['handlePower'](_0x286d30,0x1);}else if(ifInterval(_0x286d30[_0x8df8('0x1d3')],_0x286d30[_0x8df8('0x2a')])){this[_0x8df8('0x154')](_0x286d30,0x1);loggerPredictiveCalls[_0x8df8('0x84')](_0x8df8('0x1d4'),_0x286d30[_0x8df8('0x2a')],_0x286d30['name']);_0x286d30[_0x8df8('0x75')]=0x0;_0x286d30['predictiveIntervalErlangCallsDroppedCalls']=0x0;}else if(_0x362acc<_0x5ae6d7&&_0x286d30['dialPredictiveOptimization']===_0x8df8('0x1d5')){freeVariablesPredictive(_0x286d30);loggerPredictive[_0x8df8('0x84')](_0x8df8('0x1d6'),'Dropped\x20calls\x20day',_0x5ae6d7,_0x8df8('0x2a'),_0x286d30[_0x8df8('0x3f')]);}else if(_0x1e4364<_0x286d30[_0x8df8('0x70')]&&_0x286d30[_0x8df8('0x1d7')]===_0x8df8('0x1d5')){freeVariablesPredictive(_0x286d30);loggerPredictive[_0x8df8('0x84')]('[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]','Max\x20Drop\x20',_0x1e4364,_0x8df8('0x1d8'),_0x286d30['predictiveIntervalErlangCallsDroppedCalls'],_0x8df8('0x2a'),_0x286d30[_0x8df8('0x3f')]);}else if(!ifInterval(_0x286d30[_0x8df8('0x1d3')],_0x286d30[_0x8df8('0x2a')])&&_[_0x8df8('0x8d')](_0x286d30[_0x8df8('0x29')])&&!_[_0x8df8('0x8d')](_0x286d30[_0x8df8('0x2a')])){_0x286d30[_0x8df8('0x29')]=moment()[_0x8df8('0x7d')](_0x8df8('0xfa'));loggerPredictive[_0x8df8('0x84')](_0x286d30[_0x8df8('0x3f')],_0x8df8('0x1d9'),_0x286d30[_0x8df8('0x29')]);this[_0x8df8('0xc0')](_0x286d30['dialPredictiveInterval'])[_0x8df8('0xba')](this[_0x8df8('0x1da')](_0x286d30))[_0x8df8('0xba')](mergeDataErlangB(_0x286d30))[_0x8df8('0xba')](this[_0x8df8('0x1db')](_0x286d30))['catch'](loggerCatchPredictive('Predictive\x20after\x20first\x20interval',_0x286d30));}else if(!ifInterval(_0x286d30[_0x8df8('0x1d3')],_0x286d30[_0x8df8('0x29')])){_0x286d30[_0x8df8('0x70')]=0x0;_0x286d30[_0x8df8('0x29')]=moment()[_0x8df8('0x7d')](_0x8df8('0xfa'));loggerPredictive[_0x8df8('0x84')](_0x286d30[_0x8df8('0x3f')],_0x8df8('0x1dc'),_0x286d30[_0x8df8('0x29')]);clearInterval(_0x286d30['handlePredictive']);_0x286d30['handlePredictive']=undefined;this[_0x8df8('0xc0')](_0x286d30[_0x8df8('0x1d3')])[_0x8df8('0xba')](this[_0x8df8('0x1da')](_0x286d30))[_0x8df8('0xba')](mergeDataErlangB(_0x286d30))[_0x8df8('0xba')](this[_0x8df8('0x1db')](_0x286d30))[_0x8df8('0xb3')](loggerCatchPredictive(_0x8df8('0x1dd'),_0x286d30));}else if(_0x286d30[_0x8df8('0x1ca')]&&_0x579ca6<_0x286d30[_0x8df8('0x1ca')]-_0x197a33){freeVariablesPredictive(_0x286d30);loggerPredictive[_0x8df8('0x84')](_0x286d30['name'],_0x8df8('0x1de'),_0x579ca6,')\x20are\x20less\x20than\x20threshold\x20(',_0x286d30[_0x8df8('0x1ca')],'-',_0x197a33,'=',_0x286d30['predictiveIntervalAvailable']-_0x197a33,')');}else if(_0x286d30['predictiveIntervalAvailable']&&_0x579ca6>_0x286d30['predictiveIntervalAvailable']+_0x504c79){freeVariablesPredictive(_0x286d30);loggerPredictive[_0x8df8('0x84')](_0x286d30[_0x8df8('0x3f')],_0x8df8('0x1de'),_0x579ca6,_0x8df8('0x1df'),_0x286d30[_0x8df8('0x1ca')],'+',_0x504c79,'=',_0x286d30[_0x8df8('0x1ca')]+_0x504c79,')');}};Dialer[_0x8df8('0x19')][_0x8df8('0x1da')]=function(_0x56e799){var _0x50d1e8=this;return function(_0xe728e4){return new BPromise(function(_0x39133d,_0x52a5c5){_['merge'](_0x56e799,_0xe728e4[0x0]);if(checkGetDataPredictive(_0xe728e4[0x0])){var _0x375d91=_0x56e799[_0x8df8('0x1ca')]=_0x56e799[_0x8df8('0xa1')]+_0x56e799['available'];var _0x201396=_0x56e799[_0x8df8('0x1d3')]*0x3c;var _0x2d0173=_0xe728e4[0x0][_0x8df8('0x6c')]+_0xe728e4[0x0]['predictiveIntervalAvgHoldtime'];var _0x3d03b3=(_0xe728e4[0x0]['predictiveIntervalAnsweredCalls']+_0xe728e4[0x0][_0x8df8('0x6e')]+_0xe728e4[0x0]['predictiveIntervalDroppedCallsCallersExit'])/_0xe728e4[0x0][_0x8df8('0x73')];_0x56e799[_0x8df8('0x71')]=_0x3d03b3>0x0?_0x3d03b3:0x1;switch(_0x56e799[_0x8df8('0x1d7')]){case'dropRate':var _0x2ce69f=_0x56e799[_0x8df8('0x1c9')]/0x64;return _0x50d1e8['abandonmentRate'](_0x375d91,_0x201396,_0x2d0173,_0x3d03b3,_0x2ce69f)['then'](function(_0x18ec3e){return _0x39133d(_0x18ec3e);});case _0x8df8('0x1e0'):var _0x1d394c=_0x56e799['dialPredictiveOptimizationPercentage']/0x64;return _0x50d1e8[_0x8df8('0x1e1')](_0x375d91,_0x201396,_0x2d0173,_0x3d03b3,_0x1d394c)[_0x8df8('0xba')](function(_0x5a8600){return _0x39133d(_0x5a8600);});default:return _0x52a5c5(msgResponse(_0x8df8('0x1e2'),_0x8df8('0x142'),_0x8df8('0x1e3')));}}else{return _0x52a5c5(msgResponse(_0x8df8('0x1e2'),_0x8df8('0x142'),_0x8df8('0x1e4')));}});};};Dialer['prototype'][_0x8df8('0x1e5')]=function(_0x3101f4){var _0x35be3b=this;return function(_0x3fceaf){return new BPromise(function(_0x2effb5,_0x342a41){_[_0x8df8('0xd2')](_0x3101f4,_0x3fceaf[0x0]);if(checkGetDataPredictive(_0x3fceaf[0x0])){loggerPredictive[_0x8df8('0x84')](JSON[_0x8df8('0x7c')](_0x3fceaf[0x0]));if(_0x3101f4[_0x8df8('0x1d7')]===_0x8df8('0x1d5')){return _0x35be3b[_0x8df8('0xc9')](_0x3101f4['id'])[_0x8df8('0xba')](function(_0x3f8aef){var _0x4f76d8=_0x3101f4['loggedIn']-_0x3f8aef[0x0][_0x8df8('0x1e6')];var _0x50dd54=_0x3101f4[_0x8df8('0x1d3')]*0x3c;var _0x3149ce=_0x3fceaf[0x0][_0x8df8('0x6c')]+_0x3fceaf[0x0][_0x8df8('0x6b')];var _0x31fe17=(_0x3fceaf[0x0][_0x8df8('0x6a')]+_0x3fceaf[0x0][_0x8df8('0x6e')]+_0x3fceaf[0x0][_0x8df8('0x6d')])/_0x3fceaf[0x0][_0x8df8('0x73')];var _0x45ff4f=_0x3101f4[_0x8df8('0x1c9')]/0x64;_0x3101f4[_0x8df8('0x72')]=_0x3f8aef[0x0]['outboundQueuePauses']||0x0;_0x3101f4[_0x8df8('0x71')]=_0x31fe17>0x0?_0x31fe17:0x1;return _0x35be3b[_0x8df8('0x1e7')](_0x4f76d8,_0x50dd54,_0x3149ce,_0x31fe17,_0x45ff4f);})[_0x8df8('0xba')](function(_0x5d91a0){return _0x2effb5(_0x5d91a0);})[_0x8df8('0xb3')](function(_0x51f1fa){return _0x342a41(msgResponse(_0x8df8('0x1e8'),'Failure',JSON['stringify'](_0x51f1fa)));});}if(_0x3101f4['dialPredictiveOptimization']===_0x8df8('0x1e0')){return _0x35be3b[_0x8df8('0xc9')](_0x3101f4['id'])['then'](function(_0x51db3e){var _0x3bec0a=_0x3101f4[_0x8df8('0x52')]-_0x51db3e[0x0]['outboundQueuePauses'];var _0x13e434=_0x3101f4['dialPredictiveInterval']*0x3c;var _0xb83ebe=_0x3fceaf[0x0][_0x8df8('0x6c')]+_0x3fceaf[0x0][_0x8df8('0x6b')];var _0x51a62e=(_0x3fceaf[0x0][_0x8df8('0x6a')]+_0x3fceaf[0x0][_0x8df8('0x6e')]+_0x3fceaf[0x0][_0x8df8('0x6d')])/_0x3fceaf[0x0][_0x8df8('0x73')];var _0xc9ff5b=_0x3101f4[_0x8df8('0x1c9')]/0x64;_0x3101f4[_0x8df8('0x72')]=_0x51db3e[0x0][_0x8df8('0x1e6')]||0x0;_0x3101f4[_0x8df8('0x71')]=_0x51a62e>0x0?_0x51a62e:0x1;return _0x35be3b['busyFactor'](_0x3bec0a,_0x13e434,_0xb83ebe,_0x51a62e,_0xc9ff5b);})[_0x8df8('0xba')](function(_0x5abb21){return _0x2effb5(_0x5abb21);})['catch'](function(_0x22c170){return _0x342a41(msgResponse('[CatchErlangB]',_0x8df8('0x142'),JSON['stringify'](_0x22c170)));});}}else{return _0x342a41(msgResponse(_0x8df8('0x1e2'),_0x8df8('0x142'),_0x8df8('0x1e4')));}});};};Dialer[_0x8df8('0x19')][_0x8df8('0x1db')]=function(_0x2da3be){var _0x2be95b=this;return function(){var _0x3a15d3=0x0;var _0x26f464=Math[_0x8df8('0x1ce')](_0x2da3be[_0x8df8('0x76')]*0x3e8);if(_0x26f464>0x0){_0x26f464=_0x26f464<0x64?0x64:_0x26f464;loggerPredictive[_0x8df8('0x84')](_0x2da3be['name'],_0x8df8('0x1e9'),_0x26f464,'milliseconds');_0x2da3be[_0x8df8('0x90')]=setInterval(function(){_0x2be95b[_0x8df8('0x90')](_0x2da3be);loggerPredictiveCalls['info'](_0x8df8('0x1ea'),_0x3a15d3+=0x1);},_0x26f464);}else{loggerPredictive[_0x8df8('0x84')](_0x2da3be['name'],'fail\x20to\x20scheduled\x20calls');}};};Dialer['prototype'][_0x8df8('0x1eb')]=function(_0x1dc3aa,_0x47a7e5){var _0x32bf79=this;return function(_0x3c7acf){if(_[_0x8df8('0x45')](_0x3c7acf)){if(_[_0x8df8('0xb0')](_0x47a7e5[_0x8df8('0xd5')])||!_0x47a7e5[_0x8df8('0x1ec')]){if(_0x1dc3aa['dialMethod']===_0x8df8('0x157')){_0x1dc3aa[_0x8df8('0x12b')]=_[_0x8df8('0x8d')](_0x1dc3aa[_0x8df8('0x12b')])?!![]:_0x1dc3aa[_0x8df8('0x12b')];var _0x136eb8=uuid['v4']();_0x32bf79[_0x8df8('0x25')][_0x136eb8]=new Action(_0x1dc3aa,_0x47a7e5,_0x136eb8);loggerBooked[_0x8df8('0x84')]('[booked][checkContactBlack]',_0x136eb8,_0x8df8('0x1ed'),JSON[_0x8df8('0x7c')](_0x1dc3aa[_0x8df8('0x12b')]),_0x8df8('0x1ee'),_0x1dc3aa[_0x8df8('0x3f')]);if(_0x1dc3aa[_0x8df8('0x12b')]){_0x1dc3aa['queueStatusComplete']=![];_0x32bf79['queueBooked'][_0x32bf79[_0x8df8('0x25')][_0x136eb8]['queue']]=[];ami['Action']({'actionid':_0x136eb8,'action':'queuestatus','queue':_0x1dc3aa[_0x8df8('0x3f')]})[_0x8df8('0xb3')](function(_0x11725c){_0x32bf79[_0x8df8('0xb5')](_0x1dc3aa);_0x32bf79[_0x8df8('0xc3')]({'active':![],'ContactId':_0x32bf79[_0x8df8('0x25')][_0x136eb8][_0x8df8('0xd4')],'ListId':_0x32bf79[_0x8df8('0x25')][_0x136eb8][_0x8df8('0xfb')],'VoiceQueueId':_0x32bf79[_0x8df8('0x25')][_0x136eb8][_0x8df8('0xd6')]||undefined,'CampaignId':_0x32bf79[_0x8df8('0x25')][_0x136eb8][_0x8df8('0xfc')]||undefined})[_0x8df8('0xb3')](loggerCatch(_0x8df8('0x1ef')));delete _0x32bf79[_0x8df8('0x25')][_0x136eb8];});}else{loggerBooked['info']('[booked][checkContactBlack][else]',JSON[_0x8df8('0x7c')](_0x1dc3aa[_0x8df8('0x12b')]),'Queue:\x20',_0x1dc3aa['name']);_0x32bf79[_0x8df8('0xb5')](_0x1dc3aa);_0x32bf79[_0x8df8('0xc3')]({'active':![],'ContactId':_0x32bf79['actions'][_0x136eb8][_0x8df8('0xd4')],'ListId':_0x32bf79['actions'][_0x136eb8][_0x8df8('0xfb')],'VoiceQueueId':_0x32bf79[_0x8df8('0x25')][_0x136eb8][_0x8df8('0xd6')]||undefined,'CampaignId':_0x32bf79['actions'][_0x136eb8][_0x8df8('0xfc')]||undefined})[_0x8df8('0xb3')](loggerCatch(_0x8df8('0x1ef')));delete _0x32bf79[_0x8df8('0x25')][_0x136eb8];}}else{return _0x32bf79[_0x8df8('0x166')](_0x1dc3aa,_0x47a7e5);}}else{if(getDiff(_0x47a7e5[_0x8df8('0x1f0')])<_0x1dc3aa['dialRecallMeTimeout']*0x3c){if(_0x47a7e5[_0x8df8('0x1f1')]&&!_0x47a7e5[_0x8df8('0x1f1')][_0x8df8('0x1f2')]){_0x32bf79[_0x8df8('0x1e')][_0x8df8('0x12c')](_0x47a7e5['id'])[_0x8df8('0x1c')](function(){_0x32bf79['updateOriginated'](_0x1dc3aa);});}else{_0x32bf79[_0x8df8('0xc5')]({'active':![]},_0x47a7e5['id'],0x1)[_0x8df8('0x1c')](function(){console['log']('Contact\x20updated');_0x32bf79[_0x8df8('0xb5')](_0x1dc3aa);});}}else{_0x1dc3aa[_0x8df8('0x1f3')]+=0x1;_0x32bf79['updateOriginated'](_0x1dc3aa);if(_0x1dc3aa[_0x8df8('0x1f4')]){_0x32bf79[_0x8df8('0xc3')]({'active':![],'recallme':![],'UserId':null,'ContactId':_0x47a7e5['ContactId'],'ListId':_0x47a7e5[_0x8df8('0xfb')],'VoiceQueueId':_0x47a7e5['VoiceQueueId']||undefined,'CampaignId':_0x47a7e5['CampaignId']||undefined})['catch'](loggerCatch(_0x8df8('0x1f5')));_0x32bf79['createHistory'](createObjHistory(_0x1dc3aa,_0x47a7e5,_0x8df8('0x1f6'),0x17,'RecallInQueue'))[_0x8df8('0xb3')](loggerCatch(_0x8df8('0x1f7')));}else{_0x32bf79[_0x8df8('0xdd')](createObjHistory(_0x1dc3aa,_0x47a7e5,'RECALLFAILEDTIMEOUT',0x16,_0x8df8('0x1f8')),'[Originate][HistoryRecallClose][historyCatch]',_0x8df8('0x1f9'));}}}}else{_0x1dc3aa['outboundBlacklistCallsDay']+=0x1;_0x32bf79[_0x8df8('0xdd')](createObjHistory(_0x1dc3aa,_0x47a7e5,_0x8df8('0x1fa'),0xd,_0x8df8('0x1fb')),_0x8df8('0x1fc'),_0x8df8('0x1fd'));throw _0x8df8('0x1fe');}};};Dialer['prototype']['handleIvr']=function(_0x5aadde){var _0x20ee57=this;var _0x29f695=[];var _0x18cf87=_0x5aadde[_0x8df8('0x1ff')]-_0x5aadde[_0x8df8('0x74')]-_0x5aadde[_0x8df8('0x200')];emitCampaignSummary(_0x5aadde);if(_0x18cf87>0x0){if(_0x18cf87>this[_0x8df8('0x23')]){_0x18cf87=this[_0x8df8('0x23')];}_0x5aadde[_0x8df8('0x200')]+=_0x18cf87;this[_0x8df8('0xc8')](_0x5aadde['id'],_0x18cf87,_0x5aadde[_0x8df8('0x201')])['then'](function(_0x356a83){_0x5aadde[_0x8df8('0x200')]-=_0x18cf87;_0x5aadde[_0x8df8('0x200')]=_0x5aadde[_0x8df8('0x200')]>0x0?_0x5aadde['temp']:0x0;if(!checkContactEmpty(_0x356a83)){_0x5aadde[_0x8df8('0x3e')]=_0x8df8('0x9e');logger['info'](_0x8df8('0x202')+_0x5aadde[_0x8df8('0x3f')]);}else{_0x5aadde['originated']+=_0x356a83[_0x8df8('0x130')];_0x5aadde[_0x8df8('0x3e')]='RUNNING';for(var _0x20304e=0x0;_0x20304e<_0x356a83[_0x8df8('0x130')];_0x20304e+=0x1){_0x5aadde['ivrTotalCallsDays']+=0x1;if(_[_0x8df8('0xb0')](_0x356a83[_0x20304e])||_[_0x8df8('0xb0')](_0x356a83[_0x20304e][_0x8df8('0x168')])||_[_0x8df8('0xb0')](_0x356a83[_0x20304e]['Contact'][_0x8df8('0x169')])){_0x20ee57[_0x8df8('0xd1')](_0x8df8('0x203'),_0x5aadde,_0x356a83[_0x20304e]);}else{_0x20ee57[_0x8df8('0xbe')](_[_0x8df8('0xd3')](_0x356a83[_0x20304e],[_0x8df8('0xfc'),_0x8df8('0x204')]))[_0x8df8('0xba')](_0x20ee57[_0x8df8('0x1eb')](_0x5aadde,_0x356a83[_0x20304e]))['catch'](_0x20ee57[_0x8df8('0xcf')]('[actionOriginateIvr]\x20',_0x5aadde));}}}})[_0x8df8('0xb3')](loggerGetContactDialer(_0x8df8('0x205'),_0x5aadde,_0x18cf87));}};Dialer[_0x8df8('0x19')]['handlePower']=function(_0xe63ac,_0x12cba0){var _0x3e915b=this;var _0x33a3a6=[];var _0x194fd8=_0x12cba0>=0x1?_0x12cba0:0x1;var _0x1388d2=[];if(_0xe63ac['dialMethod']===_0x8df8('0x157')){_0x194fd8=0x1;}var _0x5ac1d8=Math[_0x8df8('0x1ce')](_0xe63ac[_0x8df8('0x51')]*_0x194fd8)-_0xe63ac[_0x8df8('0x74')]-_0xe63ac[_0x8df8('0x200')];emitVoiceQueueSummary(_0xe63ac);if(_0xe63ac['dialLimitQueue']>0x0){var _0x1480c4=_0xe63ac[_0x8df8('0x206')]-_0xe63ac[_0x8df8('0x74')]-_0xe63ac[_0x8df8('0xa1')]-_0xe63ac[_0x8df8('0x200')]-_0xe63ac[_0x8df8('0xa3')];if(_0x5ac1d8>_0x1480c4){_0x5ac1d8=_0x1480c4;}}if(_0x5ac1d8>0x0){if(_0xe63ac['dialMethod']==='booked'){_0x5ac1d8=0x1;}if(_0x5ac1d8>this[_0x8df8('0x23')]){_0x5ac1d8=this[_0x8df8('0x23')];}_0xe63ac[_0x8df8('0x200')]+=_0x5ac1d8;for(var _0x4c683c in this['agents']){if(this[_0x8df8('0x21')][_0x8df8('0x97')](_0x4c683c)){if(this[_0x8df8('0x21')][_0x4c683c][_0x8df8('0xa9')]===_0x8df8('0x207')&&this[_0x8df8('0x21')][_0x4c683c][_0x8df8('0xdb')]===_0x8df8('0xda')){_0x33a3a6[_0x8df8('0x127')](this[_0x8df8('0x21')][_0x4c683c]['id']);}}}this['getContactDialer'](_0xe63ac['id'],_0x33a3a6,_0x5ac1d8,_0xe63ac[_0x8df8('0x201')])[_0x8df8('0xba')](function(_0x305601){_0xe63ac[_0x8df8('0x200')]-=_0x5ac1d8;_0xe63ac['temp']=_0xe63ac['temp']>0x0?_0xe63ac[_0x8df8('0x200')]:0x0;if(!checkContactEmpty(_0x305601)){_0x3e915b[_0x8df8('0xbb')](_0xe63ac)[_0x8df8('0xba')](sendMessageReschedule(_0xe63ac))[_0x8df8('0xb3')](loggerCatch(_0x8df8('0x208')));}else{_0xe63ac['originated']+=_0x305601['length'];_0xe63ac[_0x8df8('0x3e')]=_0xe63ac[_0x8df8('0x5b')]===_0x8df8('0x157')?_0x8df8('0x172'):_0x8df8('0x209');for(var _0x31cd46=0x0;_0x31cd46<_0x305601[_0x8df8('0x130')];_0x31cd46+=0x1){if(_['isNil'](_0x305601[_0x31cd46])||_[_0x8df8('0xb0')](_0x305601[_0x31cd46][_0x8df8('0x168')])||_['isNil'](_0x305601[_0x31cd46][_0x8df8('0x168')][_0x8df8('0x169')])){_0x3e915b[_0x8df8('0xd1')]('[actionOriginate]\x20',_0xe63ac,_0x305601[_0x31cd46]);}else{_0x3e915b[_0x8df8('0xbc')](_[_0x8df8('0xd3')](_0x305601[_0x31cd46],[_0x8df8('0xd6'),_0x8df8('0x204')]))[_0x8df8('0xba')](_0x3e915b['checkContactBlack'](_0xe63ac,_0x305601[_0x31cd46]))[_0x8df8('0xb3')](_0x3e915b[_0x8df8('0xcf')](_0x8df8('0x203'),_0xe63ac));}}}})['catch'](loggerGetContactDialer('[getContactDialer2]',_0xe63ac,_0x5ac1d8));}};Dialer[_0x8df8('0x19')][_0x8df8('0x90')]=function(_0x26280d){var _0x4e5e53=this;if(_0x26280d[_0x8df8('0x206')]>0x0){var _0x2a2bea=_0x26280d[_0x8df8('0x206')]-_0x26280d['originated']-_0x26280d[_0x8df8('0xa1')];if(_0x2a2bea>0x0){this[_0x8df8('0x20a')](_0x26280d);}else{loggerPredictiveCalls[_0x8df8('0x84')]('[handlePredictive][limitChannel]');}}else{this['tryOriginatePredictive'](_0x26280d);}};Dialer[_0x8df8('0x19')]['tryOriginatePredictive']=function(_0x3dd3a5){var _0x1dddd3=this;var _0x1bac4e=[];_0x3dd3a5[_0x8df8('0x74')]+=0x1;for(var _0x2d7ff8 in this[_0x8df8('0x21')]){if(this['agents'][_0x8df8('0x97')](_0x2d7ff8)){if(this[_0x8df8('0x21')][_0x2d7ff8][_0x8df8('0xa9')]===_0x8df8('0x207')&&this['agents'][_0x2d7ff8]['status']===_0x8df8('0xda')){_0x1bac4e[_0x8df8('0x127')](this[_0x8df8('0x21')][_0x2d7ff8]['id']);}}}this[_0x8df8('0xc6')](_0x3dd3a5['id'],_0x1bac4e,0x1,_0x3dd3a5[_0x8df8('0x201')])[_0x8df8('0xba')](function(_0x3ef80d){if(!checkContactEmpty(_0x3ef80d)){checkContactLowerLimitOriginate(_0x3dd3a5,0x1,0x0);_0x1dddd3[_0x8df8('0xbb')](_0x3dd3a5)[_0x8df8('0xba')](sendMessageReschedule(_0x3dd3a5))[_0x8df8('0xb3')](loggerCatch(_0x8df8('0x208')));}else{_0x3dd3a5[_0x8df8('0x3e')]=_0x8df8('0x209');if(_[_0x8df8('0xb0')](_0x3ef80d[0x0])||_[_0x8df8('0xb0')](_0x3ef80d[0x0]['Contact'])||_[_0x8df8('0xb0')](_0x3ef80d[0x0][_0x8df8('0x168')]['phone'])){_0x1dddd3['emptyContact']('[actionOriginate]\x20',_0x3dd3a5,_0x3ef80d[0x0]);}else{_0x1dddd3[_0x8df8('0xbc')](_[_0x8df8('0xd3')](_0x3ef80d[0x0],[_0x8df8('0xd6'),_0x8df8('0x204')]))[_0x8df8('0xba')](_0x1dddd3['checkContactBlack'](_0x3dd3a5,_0x3ef80d[0x0]))[_0x8df8('0xb3')](_0x1dddd3['loggerHandler'](_0x8df8('0x20b'),_0x3dd3a5));}}})['catch'](loggerGetContactDialer('[getContactDialerPredictive]',_0x3dd3a5,0x1));emitVoiceQueueSummary(_0x3dd3a5);};Dialer[_0x8df8('0x19')]['abandonmentRate']=function(_0x4e4bc9,_0x4e2219,_0x2b8c3e,_0xa7eda,_0x3f12b4,_0x229759){loggerPredictive['info'](_0x8df8('0x20c'));loggerPredictive[_0x8df8('0x84')]('M:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x4e4bc9);loggerPredictive[_0x8df8('0x84')](_0x8df8('0x20d'),_0x4e2219);loggerPredictive[_0x8df8('0x84')]('Ts:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x2b8c3e);loggerPredictive[_0x8df8('0x84')]('P:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0xa7eda);loggerPredictive['info'](_0x8df8('0x20e'),_0x3f12b4);loggerPredictive[_0x8df8('0x84')](_0x8df8('0x86'));return new BPromise(function(_0x6bc691,_0x1358ea){if(_0x4e4bc9<=0x0||isNaN(_0x4e4bc9)){return _0x1358ea(msgResponse('[abandonmentRate]',_0x8df8('0x48'),_0x8df8('0x20f')+_0x4e4bc9));}if(_0x2b8c3e<=0x0||isNaN(_0x2b8c3e)){return _0x1358ea(msgResponse(_0x8df8('0x210'),_0x8df8('0x48'),_0x8df8('0x211')+_0x2b8c3e));}if(_0xa7eda<=0x0||isNaN(_0xa7eda)){return _0x1358ea(msgResponse(_0x8df8('0x210'),_0x8df8('0x48'),_0x8df8('0x212')+_0xa7eda));}if(_0x4e2219<=0x0||isNaN(_0x4e2219)){return _0x1358ea(msgResponse(_0x8df8('0x210'),_0x8df8('0x48'),_0x8df8('0x213')+_0x4e2219));}if(_0x3f12b4<=0x0||isNaN(_0x3f12b4)){return _0x1358ea(msgResponse(_0x8df8('0x210'),_0x8df8('0x48'),_0x8df8('0x214')+_0x3f12b4));}_0x229759=_0x229759||0x0;var _0x4935d6=0x1/_0x2b8c3e;var _0x22de21=0x0;var _0x2aeea0=0x0;var _0x24c0c7=0x0;var _0x2e8ee2=0x0;for(var _0x4d2bab=0x0;_0x24c0c7<_0x3f12b4;_0x4d2bab+=0x1){_0x2aeea0=_0x4d2bab/_0x4e2219;_0x22de21=(_0xa7eda*_0x2aeea0+_0x229759)/_0x4935d6;_0x24c0c7=erlangb(_0x22de21,_0x4e4bc9);_0x2e8ee2=_0x22de21/_0x4e4bc9*(0x1-erlangb(_0x22de21,_0x4e4bc9));}return _0x6bc691({'erlangCalls':_0x4d2bab,'erlangCallToSecond':_0x4e2219/_0x4d2bab,'erlangAbandonmentRate':_0x24c0c7,'erlangBusyFactor':_0x2e8ee2});});};Dialer[_0x8df8('0x19')]['busyFactor']=function(_0x309e55,_0x4d72b3,_0x56cf1b,_0x25f35d,_0xa0df56,_0x4a7d1b){loggerPredictive[_0x8df8('0x84')]('----\x20Agent\x20Busy\x20Factor\x20----');loggerPredictive[_0x8df8('0x84')]('M:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x309e55);loggerPredictive['info'](_0x8df8('0x20d'),_0x4d72b3);loggerPredictive[_0x8df8('0x84')](_0x8df8('0x215'),_0x56cf1b);loggerPredictive[_0x8df8('0x84')](_0x8df8('0x216'),_0x25f35d);loggerPredictive[_0x8df8('0x84')](_0x8df8('0x217'),_0xa0df56);loggerPredictive[_0x8df8('0x84')]('---------------------------');return new BPromise(function(_0x3f3ddd,_0x16b767){if(_0x309e55<=0x0||isNaN(_0x309e55)){return _0x16b767(msgResponse('[busyFactor]',_0x8df8('0x48'),_0x8df8('0x20f')+_0x309e55));}if(_0x56cf1b<=0x0||isNaN(_0x56cf1b)){return _0x16b767(msgResponse(_0x8df8('0x218'),'Error',_0x8df8('0x211')+_0x56cf1b));}if(_0x25f35d<=0x0||isNaN(_0x25f35d)){return _0x16b767(msgResponse(_0x8df8('0x218'),'Error',_0x8df8('0x212')+_0x25f35d));}if(_0x4d72b3<=0x0||isNaN(_0x4d72b3)){return _0x16b767(msgResponse('[busyFactor]',_0x8df8('0x48'),_0x8df8('0x213')+_0x4d72b3));}if(_0xa0df56<=0x0||isNaN(_0xa0df56)){return _0x16b767(msgResponse('[busyFactor]',_0x8df8('0x48'),'Umin\x20=\x20'+_0xa0df56));}_0x4a7d1b=_0x4a7d1b||0x0;var _0xb00325=0x1/_0x56cf1b;var _0x22de31=0x0;var _0xe1026a=0x0;var _0x22b465=0x0;var _0x39359e=0x0;for(var _0xc5ccac=0x0;_0x39359e<_0xa0df56;_0xc5ccac+=0x1){_0xe1026a=_0xc5ccac/_0x4d72b3;_0x22de31=(_0x25f35d*_0xe1026a+_0x4a7d1b)/_0xb00325;_0x22b465=erlangb(_0x22de31,_0x309e55);_0x39359e=_0x22de31/_0x309e55*(0x1-erlangb(_0x22de31,_0x309e55));}return _0x3f3ddd({'erlangCalls':_0xc5ccac,'erlangCallToSecond':_0x4d72b3/_0xc5ccac,'erlangAbandonmentRate':_0x22b465,'erlangBusyFactor':_0x39359e});});};module[_0x8df8('0x219')]=Dialer;
\ No newline at end of file
+var _0x52a5=['syncQueueStatusComplete','loopCampaigns','isUndefined','message','AGENTS_NOT_LOGGED','name','\x20AGENTS\x20NOT\x20LOGGED','\x20NOT\x20Active','Interval','INTERVAL_IS_NULL','Intervals','\x20INTERVAL_IS_NULL','isEmpty','Error','stringify','milliseconds','diff','seconds','emit','type','outbound','answered','available','loggedIn','sumBillable','sumHoldTime','talking','total','unmanaged','abandoned','waiting','loggedInDb','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundNoSuchCallsDay','outboundReCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangAbandonmentRate','erlangBusyFactor','Trunk','active','callerid','format','voice:queue:%s','voice_queue:save','ivr','campaign:ivr:%s','campaign:save','info','Dropped\x20Timeout:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Dropped\x20Exit:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','AVG\x20Hold\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalAvgTalktime','---------------------------','Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive','History\x20information\x20are\x20empty','---------\x20ErlangB\x20---------','erlangCalls','One\x20call\x20every:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20','clearing\x20variable\x20start\x20progressive','clearing\x20variable\x20start\x20predictive','handlePredictive','clearing\x20variable\x20handle\x20predictive','string','\x22\x22\x20<>','error','stack','inspect','length','hasOwnProperty','[decremetOriginate]\x20object\x20originated\x20is\x20negative','[decremetOriginate]\x20is\x20null\x20or\x20undefined','contactsRescheduled','[getContactDialer2][ReScheduled]','contacts','AVAILABLE_CONTACTS_FINISHED','[getContactDialer2][Empty]','sendMessageOneNotActive','NOT_ACTIVE','[syncQueueSummary]\x20Campaign\x20Queue:\x20','IS_DISACTIVED','is\x20disactive','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','is\x20not\x20active','state','statedesc','endtime','starttime','prototype','loopClearZombieChannels','[uniqueid]','clearZombieChannels','[actions]','sequence','isNil','Action','status','channel','catch','No\x20such\x20channel','updateOriginated','queue','[Dialer][checkChannel]','[Dialer][checkChannel][ivr]','countReScheduled','resolve','[countReScheduled]\x20','checkIsBlackList','checkIsBlackListIvr','[checkIsBlackListIvr]\x20','averageHandleTime','then','avgHandleTime','[averageHandleTime]\x20','[rescheduleContact]\x20','unlockContact','getContactDialer','getContactDialerIvr','[getContactDialer]\x20','getVoiceQueueRtPauses','[getVoiceQueueRtPauses]\x20','moveContactManagedDialer','[moveContactManagedDialer]\x20','createHistory','[createHistory]\x20','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','emptyContact','notFound','saveInDb','merge','pick','ContactId','ListId','VoiceQueueId','[emptyContact][createHistory]','[emptyContact]','isSuccess','Success','isTrunkReachable','reachable','SIP/%s','variable','amdstatus','exten','xcally-motion-dialer','dialAMDActive','HANGUP','uniqueid','HangupInAMD','membername','[syncHangupInAMD][createHistory]','[syncHangupInAMD]','MACHINE','Machine','AMD','countmachineretry','amd','[syncAgentComplete][createHistory][0]','countbusyretry','countcongestionretry','countdropretry','countabandonedretry','countagentrejectretry','dialGlobalMaxRetry','stateGlobal','dialMachineMaxRetry','createStateFinal','reason\x2019\x20machine....','rescheduleContact','add','dialMachineRetryFrequency','CampaignId','[rescheduleContact][Machine]','value','[syncHangupInAMDIvr]','countglobal','countnoanswerretry','countnosuchnumberretry','reason19\x20machine....','minutes','YYYY-MM-DD\x20HH:mm:ss','ivrAnswerCallsDay','[syncHangupIvr][createHistory]','[syncHangupIvr]','dialQueueProject','AnswerAGI','AGI','cause-txt','Unknow','reason','agent','dialQueueProject2','[syncAgentComplete]','answertime','[syncAgentComplete][createHistory]','[syncQueueCallerAbandon]\x20[Drop]','droptime','responsetime','dialQueueTimeout','outboundDropCallsDayTimeout','Drop','dropreason','TIMEOUT','agiafterat','dialDropMaxRetry','queueCallerAbandonCreateState','dialDropRetryFrequency','[rescheduleContact][Drop]','calleridname','calleridnum','[syncAgentComplete][createHistory][10]','CALLEREXIT','dialAbandonedMaxRetry','[rescheduleContact][Abandoned]','Abandoned','[syncAgentComplete][createHistory][11]','actionid','strategy','roundrobin','paused','stateinterface','locked','queueBooked','push','idHopper','queueStatusComplete','[unlockQueueStatus][undefined]','[booked][unlockQueueStatus]','run','[Catch][Preview][syncQueueStatusComplete]','_rr','unlockRR','[booked][RR]','Agent:\x20','contactAgent-idHopper:\x20','[booked][unlock]','[unlock][syncQueueStatusComplete]','[booked][unlock2]','[booked][unlock3]','syncCampaigns','checkIsTrunkReachable','TrunkBackup','checkIfTime','ifTime','Failure','INTERVAL_IS_EMPTY','\x20Intervals\x20is\x20empty\x20','TIMEZONE_UNKNOW','isArray','command','interval','timezones','content','indexOf','true','iftime\x20%s,%s','all','GLOBAL_INTERVAL_IS_OVERTIME','INTERVAL_IS_OVERTIME','[ifTime][promiseAll]','Global:\x20','\x20Interval\x20is\x20overtime:\x20','Timezone:\x20','checkDialMethod','handlePower','power','Queue','method\x20not\x20recognized','launchHandleIvr','dialGlobalInterval','dialTimezone','[syncQueueSummary]','checkIfTimeIntervals','[syncCampaigns]','pow','replace','random','match','phone','Contact','originate','getCaller','\x22agi://%s/square,%s\x22','NONE','dialQueueOptions','XMD-AMDINITIALSILENCE','dialAMDInitialSilence','dialAMDGreeting','XMD-AMDAFTERGREETINGSILENCE','dialAMDAfterGreetingSilence','XMD-AMDMINWORDLENGTH','dialAMDMinWordLength','XMD-AMDBETWEENWORDSSILENCE','XMD-AMDMAXIMUMNUMBEROFWORDS','dialAMDMaximumNumberOfWords','XMD-AMDSILENCETHRESHOLD','dialAMDSilenceThreshold','XMD-AMDMAXIMUMWORDLENGTH','dialAMDMaximumWordLength','XMD-VOICEQUEUEID','XMD-CAMPAIGNID','tags','createdAt','updatedAt','%s%s','XMD-','dialRandomLastDigitCallerIdNumber','originatecalleridname','XMD-ORIGINATECALLERIDNUM','dialPrefix','trim','substring','dialCutDigit','SIP/%s/%s%s','[originateError]:\x20%s','OriginateError','[originate][error]','originate\x20action\x20Error','getQueue','response','checkRetriveMax','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','[rescheduleContact][NoAnswer]','dialBusyRetryFrequency','[rescheduleContact]\x20[Busy]','dialCongestionMaxRetry','[rescheduleContact]\x20[Congestion]','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','[rescheduleContact][NoSuchNumber]','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','[rescheduleContact][AgentReject]','object','[callProgressDetecting]','entity\x20is\x20undefine','evt\x20is\x20undefine','NoSuchNumber','buildObj','nosuchnumber','reason\x200\x20no\x20such\x20number....','outboundNoAnswerCallsDay','NoAnswer','custom:agentnoanswer','noanswer','[syncAgentComplete][createHistory][3]','reason\x203\x20ringing\x20no\x20answer','Busy','custom:agentbusy','busy','[syncAgentComplete][createHistory][5]','Congestion','custom:agentcongestion','congestion','reason\x208\x20congestion','reason\x2011\x20abandoned','outboundRejectCallsDay','custom:agentreject','agentreject','reason\x2020\x20agentreject','[moveContactManagedDialer][0]','contact\x20not\x20moved','dialPredictiveOptimizationPercentage','round','predictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','floor','predictiveIntervalHitRate','[startMethodPredictive][StartProgressive]','check\x20handlePredictive\x20is\x20not\x20undefine','collection\x20data\x20in\x20progressive\x20at','[startMethodPredictive][StartProgressive][Loop]','dialPredictiveOptimization','dropRate','[stopMethodPredictive][ReStartProgressive][ExceededDropDay]','Dropped\x20calls\x20day','[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]','Max\x20Drop\x20','started\x20in\x20predictive\x20at','dialPredictiveInterval','startMethodPredictive','Predictive\x20after\x20first\x20interval','getDataPredictive','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',')\x20are\x20less\x20than\x20threshold\x20(',')\x20are\x20more\x20than\x20threshold\x20(','busyFactor','[getDataPredictive]','check\x20failure','getDataPredictiveOld','outboundQueuePauses','abandonmentRate','[CatchErlangB]','erlangCallToSecond','one\x20call\x20every:','[handlePredictive]','fail\x20to\x20scheduled\x20calls','UserId','[booked][checkContactBlack]','Queue:\x20','queuestatus','[unlockOriginate][syncQueueStatusComplete]','[booked][checkContactBlack][else]','scheduledat','dialRecallMeTimeout','Agent','voicePause','Contact\x20updated','dialRecallInQueue','[rescheduleContact][dialRecallInQueue]','RECALLINQUEUE','RecallInQueue','[Originate][HistoryDialRecallInQueue][historyCatch]','RecallFailedTimeout','[Originate][HistoryRecallClose][historyCatch]','BLACKLIST','Blacklist','[Originate][historyBlacklist]','[Originate][MoveBlacklist]','inBlackList','handleIvr','temp','dialOrderByScheduledAt','[getContactCampaign2][Empty]','RUNNING','checkContactBlack','loggerHandler','[actionOriginateIvr]\x20','[getContactCampaign2]','dialLimitQueue','pTalking','not_inuse','ACTIVE','[actionOriginate]\x20','[getContactDialer2]','tryOriginatePredictive','[handlePredictive][limitChannel]','Contact.phone','[getContactDialerPredictive]','--------\x20Drop\x20Rate\x20--------','M:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','P:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[abandonmentRate]','m\x20=\x20','Ts\x20=\x20','interval\x20=\x20','----\x20Agent\x20Busy\x20Factor\x20----','Ts:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[busyFactor]','Umin\x20=\x20','exports','util','lodash','bluebird','uuid','moment','md5','ioredis','../../../config/environment/','dialer','../../../config/logger','booked','predictive','predictiveCalls','syncQueueSummary','../ami','redis','defaults','localhost','socket.io-emitter','../rpc/cmHopper','../rpc/cmHopperHistory','../rpc/cmHopperBlack','./action','./history','./final','./agentComplete','./hangup','env','127.0.0.1','rrmemory','enqueue','tail','finally','preview','voiceQueues','campaigns','agents','trunks','maxNumberOriginate','actions','contactsId','uniqueId','startPredictive','startProgressive','ivrOriginated','queueBookedRR','syncAgentConnect','queuecallerabandon','bind','originateresponse','syncOriginateResponse','agentcomplete','syncAgentComplete','hangup','syncHangup','newexten','syncNewExten','varset','syncVarSet','queuemember','syncQueueMember','queuestatuscomplete'];(function(_0x16b9ed,_0x56517a){var _0x66b1f8=function(_0x1c883){while(--_0x1c883){_0x16b9ed['push'](_0x16b9ed['shift']());}};_0x66b1f8(++_0x56517a);}(_0x52a5,0x1de));var _0x552a=function(_0x5cc0bf,_0x528720){_0x5cc0bf=_0x5cc0bf-0x0;var _0x217dbd=_0x52a5[_0x5cc0bf];return _0x217dbd;};'use strict';var util=require(_0x552a('0x0'));var _=require(_0x552a('0x1'));var BPromise=require(_0x552a('0x2'));var uuid=require(_0x552a('0x3'));var moment=require(_0x552a('0x4'));var rr=require('rr');var md5=require(_0x552a('0x5'));var Redis=require(_0x552a('0x6'));var ut=require('../preview/util/util');var config=require(_0x552a('0x7'));var logger=require('../../../config/logger')(_0x552a('0x8'));var loggerBooked=require(_0x552a('0x9'))(_0x552a('0xa'));var loggerPredictive=require(_0x552a('0x9'))(_0x552a('0xb'));var loggerPredictiveCalls=require(_0x552a('0x9'))(_0x552a('0xc'));var loggerSyncQueueSummary=require(_0x552a('0x9'))(_0x552a('0xd'));var ami=require(_0x552a('0xe'));config[_0x552a('0xf')]=_[_0x552a('0x10')](config[_0x552a('0xf')],{'host':_0x552a('0x11'),'port':0x18eb});var io=require(_0x552a('0x12'))(new Redis(config[_0x552a('0xf')]));var cmHopper=require(_0x552a('0x13'));var cmHopperFinal=require('../rpc/cmHopperFinal');var cmHopperHistory=require(_0x552a('0x14'));var cmHopperBlack=require(_0x552a('0x15'));var voiceQueueRt=require('../rpc/voiceQueueRt');var Action=require(_0x552a('0x16'));var History=require(_0x552a('0x17'));var Final=require(_0x552a('0x18'));var AgentComplete=require(_0x552a('0x19'));var QueueCallerAbandon=require('./queueCallerAbandon');var Hangup=require(_0x552a('0x1a'));var ipAgi=process[_0x552a('0x1b')]['XCALLY_IP_AGI']||_0x552a('0x1c');var strategy={'rrmemory':_0x552a('0x1d'),'roundrobin':'roundrobin'};var Sequence=function(){};Sequence['prototype'][_0x552a('0x1e')]=function(_0x3b1d5d){this[_0x552a('0x1f')]=this[_0x552a('0x1f')]?this[_0x552a('0x1f')][_0x552a('0x20')](_0x3b1d5d):_0x3b1d5d();};function Dialer(_0x13acdd,_0x5b3504){this['sequence']=new Sequence();this[_0x552a('0x21')]=_0x5b3504;this[_0x552a('0x22')]=_0x13acdd['voiceQueues'];this[_0x552a('0x23')]=_0x13acdd['campaigns'];this[_0x552a('0x24')]=_0x13acdd[_0x552a('0x24')];this[_0x552a('0x25')]=_0x13acdd[_0x552a('0x25')];this[_0x552a('0x26')]=config[_0x552a('0x26')]||0x2;this['channels']={};this[_0x552a('0x27')]={};this[_0x552a('0x28')]={};this[_0x552a('0x29')]={};this['optionPredictive']={};this[_0x552a('0x2a')]={};this[_0x552a('0x2b')]={};this[_0x552a('0x2c')]={};this['queueBooked']={};this[_0x552a('0x2d')]={};ami['on']('agentconnect',this[_0x552a('0x2e')]['bind'](this));ami['on'](_0x552a('0x2f'),this['syncQueueCallerAbandon'][_0x552a('0x30')](this));ami['on'](_0x552a('0x31'),this[_0x552a('0x32')]['bind'](this));ami['on'](_0x552a('0x33'),this[_0x552a('0x34')][_0x552a('0x30')](this));ami['on']('custom:queuesummary',this[_0x552a('0xd')][_0x552a('0x30')](this));ami['on'](_0x552a('0x35'),this[_0x552a('0x36')][_0x552a('0x30')](this));ami['on'](_0x552a('0x37'),this[_0x552a('0x38')][_0x552a('0x30')](this));ami['on'](_0x552a('0x39'),this[_0x552a('0x3a')]['bind'](this));ami['on'](_0x552a('0x3b'),this[_0x552a('0x3c')]['bind'](this));ami['on'](_0x552a('0x3d'),this[_0x552a('0x3e')]['bind'](this));this[_0x552a('0x3f')]();this['loopClearZombieChannels']();}function isNotNull(_0x4e9208){return _0x4e9208!==null&&!_[_0x552a('0x40')](_0x4e9208);}function checkIsLoggedIn(_0x44fdce,_0x1a8f14){return function(){if(_0x1a8f14<=0x0){_0x44fdce[_0x552a('0x41')]=_0x552a('0x42');throw _0x44fdce[_0x552a('0x43')]+_0x552a('0x44');}};}function isActive(_0xb42952){return _0xb42952;}function checkIsActive(_0x5bf4e2,_0x58a61e){return function(){if(!isActive(_0x58a61e)){_0x5bf4e2[_0x552a('0x41')]='NOT_ACTIVE';throw _0x5bf4e2[_0x552a('0x43')]+_0x552a('0x45');}};}function checkInterval(_0x21d346){return function(){if(!isNotNull(_0x21d346[_0x552a('0x46')])){_0x21d346[_0x552a('0x41')]=_0x552a('0x47');throw _0x21d346[_0x552a('0x43')]+'\x20INTERVAL_IS_NULL';}if(!isNotNull(_0x21d346[_0x552a('0x46')][_0x552a('0x48')])){_0x21d346['message']='INTERVAL_IS_NULL';throw _0x21d346['name']+_0x552a('0x49');}if(!isNotNull(_[_0x552a('0x4a')](_0x21d346[_0x552a('0x46')][_0x552a('0x48')]))){_0x21d346[_0x552a('0x41')]=_0x552a('0x47');throw _0x21d346[_0x552a('0x43')]+'\x20INTERVAL_IS_NULL';}};}function msgResponse(_0x52a6ef,_0x17dd78,_0xe67da8){return{'action':_0x52a6ef,'response':_0x17dd78,'message':_0xe67da8,'stack':_0xe67da8};}function myreject(_0x40d846){return function(_0x30d501){return _0x40d846(msgResponse('[ifTime][Action]',_0x552a('0x4b'),JSON[_0x552a('0x4c')](_0x30d501)));};}function getSeconds(_0x19fc74,_0x344536){var _0x272698=moment(_0x19fc74)[_0x552a('0x4d')](0x0);var _0x263588=moment(_0x344536)[_0x552a('0x4d')](0x0);return _0x272698[_0x552a('0x4e')](_0x263588,_0x552a('0x4f'));}function emit(_0x1167fb,_0x19e83a,_0x11acbe){io['to'](_0x1167fb)[_0x552a('0x50')](_0x19e83a,_0x11acbe);}function emitVoiceQueueSummary(_0x3a52d3){if(_0x3a52d3[_0x552a('0x51')]===_0x552a('0x52')){var _0x2d8232={'id':_0x3a52d3['id'],'name':_0x3a52d3['name'],'strategy':_0x3a52d3['strategy'],'answered':_0x3a52d3[_0x552a('0x53')],'available':_0x3a52d3[_0x552a('0x54')],'loggedIn':_0x3a52d3[_0x552a('0x55')],'pTalking':_0x3a52d3['pTalking'],'sumBillable':_0x3a52d3[_0x552a('0x56')],'sumDuration':_0x3a52d3['sumDuration'],'sumHoldTime':_0x3a52d3[_0x552a('0x57')]||0x0,'talking':_0x3a52d3[_0x552a('0x58')],'total':_0x3a52d3[_0x552a('0x59')],'type':_0x3a52d3[_0x552a('0x51')],'unmanaged':_0x3a52d3[_0x552a('0x5a')],'abandoned':_0x3a52d3[_0x552a('0x5b')],'waiting':_0x3a52d3[_0x552a('0x5c')],'loggedInDb':_0x3a52d3[_0x552a('0x5d')],'dialActive':_0x3a52d3[_0x552a('0x5e')],'dialMethod':_0x3a52d3[_0x552a('0x5f')],'dialOriginateCallerIdName':_0x3a52d3[_0x552a('0x60')],'dialOriginateCallerIdNumber':_0x3a52d3[_0x552a('0x61')],'dialOriginateTimeout':_0x3a52d3[_0x552a('0x62')],'dialPrefix':_0x3a52d3['dialPrefix'],'outboundAnswerAgiCallsDay':_0x3a52d3[_0x552a('0x63')],'outboundAnswerCallsDay':_0x3a52d3[_0x552a('0x64')],'outboundBlacklistCallsDay':_0x3a52d3[_0x552a('0x65')],'outboundBusyCallsDay':_0x3a52d3[_0x552a('0x66')],'outboundCongestionCallsDay':_0x3a52d3[_0x552a('0x67')],'outboundDropCallsDayACS':_0x3a52d3[_0x552a('0x68')],'outboundDropCallsDayCallersExit':_0x3a52d3[_0x552a('0x69')],'outboundDropCallsDayTimeout':_0x3a52d3['outboundDropCallsDayTimeout'],'outboundNoAnswerCallsDay':_0x3a52d3['outboundNoAnswerCallsDay'],'outboundNoSuchCallsDay':_0x3a52d3[_0x552a('0x6a')],'outboundOriginateFailureCallsDay':_0x3a52d3['outboundOriginateFailureCallsDay'],'outboundReCallsDay':_0x3a52d3[_0x552a('0x6b')],'outboundRejectCallsDay':_0x3a52d3['outboundRejectCallsDay'],'outboundUnknownCallsDay':_0x3a52d3[_0x552a('0x6c')],'predictiveIntervalAnsweredCalls':_0x3a52d3[_0x552a('0x6d')],'predictiveIntervalAvgHoldtime':_0x3a52d3[_0x552a('0x6e')],'predictiveIntervalAvgTalktime':_0x3a52d3['predictiveIntervalAvgTalktime'],'predictiveIntervalDroppedCallsCallersExit':_0x3a52d3[_0x552a('0x6f')],'predictiveIntervalDroppedCallsTimeout':_0x3a52d3[_0x552a('0x70')],'predictiveIntervalErlangCalls':_0x3a52d3['predictiveIntervalErlangCalls'],'predictiveIntervalErlangCallsDroppedCalls':_0x3a52d3[_0x552a('0x71')],'predictiveIntervalHitRate':_0x3a52d3['predictiveIntervalHitRate'],'predictiveIntervalMultiplicativeFactor':_0x3a52d3[_0x552a('0x72')],'predictiveIntervalPauses':_0x3a52d3[_0x552a('0x73')],'predictiveIntervalAvailable':_0x3a52d3[_0x552a('0x74')],'predictiveIntervalTotalCalls':_0x3a52d3[_0x552a('0x75')],'message':_0x3a52d3[_0x552a('0x41')],'originated':_0x3a52d3[_0x552a('0x76')],'erlangCalls':_0x3a52d3['erlangCalls'],'erlangCallToSecond':_0x3a52d3['erlangCallToSecond'],'erlangAbandonmentRate':_0x3a52d3[_0x552a('0x77')],'erlangBusyFactor':_0x3a52d3[_0x552a('0x78')],'startPredictive':_0x3a52d3['startPredictive'],'startProgressive':_0x3a52d3[_0x552a('0x2b')]};if(_0x3a52d3[_0x552a('0x79')]){_0x2d8232['Trunk']={'id':_0x3a52d3['Trunk']['id'],'name':_0x3a52d3[_0x552a('0x79')][_0x552a('0x43')],'active':_0x3a52d3[_0x552a('0x79')][_0x552a('0x7a')],'callerid':_0x3a52d3[_0x552a('0x79')][_0x552a('0x7b')]};}if(_0x3a52d3[_0x552a('0x46')]){_0x2d8232[_0x552a('0x46')]={'id':_0x3a52d3['Interval']['id'],'name':_0x3a52d3['Interval'][_0x552a('0x43')]};}var _0x44417e=md5(JSON[_0x552a('0x4c')](_0x2d8232));if(_0x3a52d3[_0x552a('0x5')]!==_0x44417e){_0x3a52d3[_0x552a('0x5')]=_0x44417e;emit(util[_0x552a('0x7c')](_0x552a('0x7d'),_0x2d8232[_0x552a('0x43')]),_0x552a('0x7e'),_0x2d8232);}}}function emitCampaignSummary(_0x40ed93){if(_0x40ed93['type']===_0x552a('0x7f')){emit(util[_0x552a('0x7c')](_0x552a('0x80'),_0x40ed93['name']),_0x552a('0x81'),_0x40ed93);}}function checkGetDataPredictive(_0x5d41f9){if(isNotNull(_0x5d41f9)){if(!_[_0x552a('0x4a')](_0x5d41f9)){loggerPredictive['info']('-----\x20Stats\x20Predictive\x20---');loggerPredictive[_0x552a('0x82')]('Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x5d41f9[_0x552a('0x75')]);loggerPredictive['info']('Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x5d41f9[_0x552a('0x6d')]);loggerPredictive[_0x552a('0x82')](_0x552a('0x83'),_0x5d41f9[_0x552a('0x70')]);loggerPredictive[_0x552a('0x82')](_0x552a('0x84'),_0x5d41f9[_0x552a('0x6f')]);loggerPredictive[_0x552a('0x82')](_0x552a('0x85'),_0x5d41f9[_0x552a('0x6e')]);loggerPredictive['info'](_0x552a('0x86'),_0x5d41f9[_0x552a('0x87')]);loggerPredictive['info'](_0x552a('0x88'));if(_0x5d41f9['predictiveIntervalTotalCalls']>0x0){if(!_[_0x552a('0x40')](_0x5d41f9[_0x552a('0x87')])&&_0x5d41f9[_0x552a('0x87')]>0x0){return!![];}else{loggerPredictive[_0x552a('0x82')](_0x552a('0x89'));}if(!_[_0x552a('0x40')](_0x5d41f9[_0x552a('0x6e')])&&_0x5d41f9['predictiveIntervalAvgHoldtime']>0x0){return!![];}else{loggerPredictive[_0x552a('0x82')](_0x552a('0x8a'));}}else{loggerPredictive[_0x552a('0x82')]('Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive');}}else{loggerPredictive[_0x552a('0x82')](_0x552a('0x8b'));}}else{loggerPredictive[_0x552a('0x82')]('History\x20information\x20are\x20empty');}return![];}function mergeDataErlangB(_0xe3404a){return function(_0x37b334){loggerPredictive[_0x552a('0x82')](_0x552a('0x8c'));loggerPredictive[_0x552a('0x82')]('Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x37b334[_0x552a('0x8d')]);loggerPredictive[_0x552a('0x82')](_0x552a('0x8e'),_0x37b334['erlangCallToSecond']);loggerPredictive['info'](_0x552a('0x8f'),_0x37b334[_0x552a('0x77')]);loggerPredictive[_0x552a('0x82')](_0x552a('0x90'),_0x37b334['erlangBusyFactor']);loggerPredictive[_0x552a('0x82')](_0x552a('0x8f'),_0x37b334['erlangAbandonmentRate']);loggerPredictive[_0x552a('0x82')](_0x552a('0x88'));_['merge'](_0xe3404a,_0x37b334);};}function getDiff(_0x530c98){var _0x4d7bf8=moment()[_0x552a('0x4d')](0x0);var _0x4cf3aa=moment(_0x530c98)['milliseconds'](0x0);return _0x4d7bf8[_0x552a('0x4e')](_0x4cf3aa,_0x552a('0x4f'));}function ifInterval(_0x342c83,_0xbd2ca7){if(_[_0x552a('0x40')](_0xbd2ca7)){return![];}if(getDiff(_0xbd2ca7)<_0x342c83*0x3c){return!![];}else{return![];}}function freeVariablesPredictive(_0x479ead){if(isNotNull(_0x479ead)){if(!_['isUndefined'](_0x479ead['startProgressive'])){_0x479ead[_0x552a('0x2b')]=undefined;loggerPredictive[_0x552a('0x82')](_0x479ead['name'],_0x552a('0x91'));}if(!_[_0x552a('0x40')](_0x479ead[_0x552a('0x2a')])){_0x479ead[_0x552a('0x2a')]=undefined;loggerPredictive[_0x552a('0x82')](_0x479ead[_0x552a('0x43')],_0x552a('0x92'));}if(!_['isUndefined'](_0x479ead[_0x552a('0x93')])){clearInterval(_0x479ead[_0x552a('0x93')]);_0x479ead['handlePredictive']=undefined;loggerPredictive[_0x552a('0x82')](_0x479ead[_0x552a('0x43')],_0x552a('0x94'));}}}function erlangb(_0x335728,_0x9bd203){if(_0x9bd203===0x0){return 0x0;}var _0x2f47b8=0x1;for(var _0x553606=0x1;_0x553606<=_0x9bd203;_0x553606+=0x1){_0x2f47b8=0x1+_0x2f47b8*_0x553606/_0x335728;}return 0x1/_0x2f47b8;}function isVoiceQueueOutbound(_0x3ce1ae){return _0x3ce1ae===_0x552a('0x52');}function isNotPreview(_0x594c5a){return _0x594c5a!==_0x552a('0x21');}function isCampaignIvr(_0x4421a1){return _0x4421a1===_0x552a('0x7f');}function getCallerId(_0x2a4ba9,_0x1a845d,_0x18b4fd){if(!_[_0x552a('0x40')](_0x18b4fd)&&_0x552a('0x95')===typeof _0x18b4fd&&!_[_0x552a('0x4a')](_0x18b4fd)){if(!_[_0x552a('0x40')](_0x1a845d)&&_0x552a('0x95')===typeof _0x1a845d&&!_['isEmpty'](_0x1a845d)){return util['format']('\x22%s\x22\x20<%s>',_0x1a845d,_0x18b4fd);}return util[_0x552a('0x7c')]('\x22%s\x22\x20<%s>',_0x18b4fd,_0x18b4fd);}if(!_['isUndefined'](_0x2a4ba9)&&_0x552a('0x95')===typeof _0x2a4ba9&&!_[_0x552a('0x4a')](_0x2a4ba9)){return _0x2a4ba9;}return _0x552a('0x96');}function loggerCatchQueueSummary(_0x4309c4,_0x6ca4b3){return function(_0x16fcfc){freeVariablesPredictive(_0x6ca4b3);emitVoiceQueueSummary(_0x6ca4b3);emitCampaignSummary(_0x6ca4b3);loggerSyncQueueSummary[_0x552a('0x97')](_0x4309c4,util['inspect'](_0x16fcfc,{'showHidden':![],'depth':null}));};}function loggerCatchPredictive(_0x32dd00,_0x1d93be){return function(_0x3c6d06){loggerPredictive['error'](_0x1d93be[_0x552a('0x43')],_0x32dd00);loggerPredictive['error'](_0x3c6d06[_0x552a('0x98')]);freeVariablesPredictive(_0x1d93be);};}function loggerCatch(_0x7c379e){return function(_0x4bb990){logger[_0x552a('0x97')](_0x7c379e,util[_0x552a('0x99')](_0x4bb990,{'showHidden':![],'depth':null}));};}function checkContactEmpty(_0x15d506){return _0x15d506&&!_[_0x552a('0x40')](_0x15d506)&&_0x15d506[_0x552a('0x9a')]>0x0;}function decremetOriginate(_0x1a98bd){if(!_[_0x552a('0x40')](_0x1a98bd)&&_0x1a98bd!==null){if(_0x1a98bd[_0x552a('0x9b')](_0x552a('0x76'))){if(_0x1a98bd[_0x552a('0x76')]>0x0){_0x1a98bd[_0x552a('0x76')]-=0x1;}else{logger['error'](_0x552a('0x9c'));}}}else{logger[_0x552a('0x97')](_0x552a('0x9d'));}}function checkContactLowerLimitOriginate(_0x582fd8,_0x242417,_0x217297){if(_0x242417>_0x217297){for(var _0x2a6f3f=0x0;_0x2a6f3f<_0x242417-_0x217297;_0x2a6f3f+=0x1){decremetOriginate(_0x582fd8);}}}function loggerGetContactDialer(_0x163c70,_0x3f1dd8,_0x5d1714){return function(_0x42e423){checkContactLowerLimitOriginate(_0x3f1dd8,_0x5d1714,0x0);logger[_0x552a('0x97')](_0x163c70,util[_0x552a('0x99')](_0x42e423,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x1835ff){return function(_0x480dae){if(isNotNull(_0x480dae)&&isNotNull(_0x480dae[0x0])){if(_0x480dae[0x0][_0x552a('0x9e')]>0x0){_0x1835ff[_0x552a('0x41')]='RESCHEDULED_CONTACTS';logger[_0x552a('0x82')](_0x552a('0x9f')+_0x1835ff[_0x552a('0x43')],_0x480dae[0x0][_0x552a('0x9e')],_0x552a('0xa0'));}else{_0x1835ff[_0x552a('0x41')]=_0x552a('0xa1');logger['info'](_0x552a('0xa2')+_0x1835ff[_0x552a('0x43')]);}}};}function notSendMessagesQueue(_0x2e2414){if(_0x2e2414[_0x552a('0xa3')]){freeVariablesPredictive(_0x2e2414);if(_0x2e2414[_0x552a('0x76')]===0x0&&_0x2e2414[_0x552a('0x58')]===0x0&&_0x2e2414[_0x552a('0x5c')]===0x0&&(_0x2e2414['pTalking']||0x0)===0x0){_0x2e2414[_0x552a('0xa3')]=![];_0x2e2414[_0x552a('0x54')]=0x0;_0x2e2414[_0x552a('0x41')]=_0x552a('0xa4');loggerSyncQueueSummary[_0x552a('0x97')](_0x552a('0xa5'),_0x2e2414['name'],'is\x20not\x20active');}else{_0x2e2414[_0x552a('0x41')]=_0x552a('0xa6');loggerSyncQueueSummary[_0x552a('0x97')](_0x552a('0xa5'),_0x2e2414[_0x552a('0x43')],_0x552a('0xa7'));}emitVoiceQueueSummary(_0x2e2414);}}function notSendMessagesCampaign(_0x555543){if(_0x555543['sendMessageOneNotActive']){if(_0x555543['originated']===0x0){_0x555543[_0x552a('0xa3')]=![];_0x555543['message']=_0x552a('0xa4');loggerSyncQueueSummary[_0x552a('0x97')](_0x552a('0xa8'),_0x555543['name'],_0x552a('0xa9'));}else{_0x555543['message']='IS_DISACTIVED';loggerSyncQueueSummary[_0x552a('0x97')](_0x552a('0xa8'),_0x555543[_0x552a('0x43')],_0x552a('0xa7'));}emitCampaignSummary(_0x555543);}}function createObjHistory(_0x20b363,_0x5d912c,_0xfb272d,_0x422fa8,_0x3638e7){_0x20b363[_0x552a('0x41')]=_0xfb272d;var _0x46101c=new Action(_0x20b363,_0x5d912c);var _0x53cb1e=new History(_0x46101c);_0x53cb1e[_0x552a('0xaa')]=_0x422fa8;_0x53cb1e[_0x552a('0xab')]=_0x3638e7;_0x53cb1e[_0x552a('0xac')]=_0x46101c[_0x552a('0xad')];return _0x53cb1e;}Dialer[_0x552a('0xae')][_0x552a('0xaf')]=function(){var _0x419f13=this;setInterval(function(){_0x419f13['clearZombieChannels'](_0x419f13[_0x552a('0x29')],_0x552a('0xb0'));_0x419f13[_0x552a('0xb1')](_0x419f13[_0x552a('0x27')],_0x552a('0xb2'));},0x32c8);};Dialer[_0x552a('0xae')]['clearZombieChannels']=function(_0x172bc3,_0x55461d){var _0x16172f=this;for(var _0x46654c in _0x172bc3){if(_0x172bc3[_0x552a('0x9b')](_0x46654c)){this[_0x552a('0xb3')][_0x552a('0x1e')](function(){if(!_[_0x552a('0xb4')](_0x172bc3[_0x46654c])){return ami[_0x552a('0xb5')]({'action':_0x552a('0xb6'),'channel':_0x172bc3[_0x46654c][_0x552a('0xb7')]})[_0x552a('0xb8')](function(_0x106633){if(_0x106633[_0x552a('0x41')]===_0x552a('0xb9')){setTimeout(function(){if(_0x172bc3[_0x46654c]&&_0x172bc3[_0x46654c][_0x552a('0x51')]!==_0x552a('0x7f')){_0x16172f[_0x552a('0xba')](_0x16172f['voiceQueues'][_0x172bc3[_0x46654c][_0x552a('0xbb')]]);logger['error'](_0x552a('0xbc'),_0x55461d,_0x46654c,_0x172bc3[_0x46654c]['queue']);delete _0x172bc3[_0x46654c];}if(_0x172bc3[_0x46654c]&&_0x172bc3[_0x46654c][_0x552a('0x51')]===_0x552a('0x7f')){_0x16172f[_0x552a('0xba')](_0x16172f[_0x552a('0x23')][_0x172bc3[_0x46654c][_0x552a('0xbb')]]);logger[_0x552a('0x97')](_0x552a('0xbd'),_0x55461d,_0x46654c,_0x172bc3[_0x46654c]['queue']);delete _0x172bc3[_0x46654c];}},0x2328);}});}});}}};Dialer[_0x552a('0xae')][_0x552a('0xbe')]=function(_0x37162c){return BPromise[_0x552a('0xbf')]()['then'](cmHopper['countReScheduled'](_0x37162c))[_0x552a('0xb8')](loggerCatch(_0x552a('0xc0')));};Dialer['prototype'][_0x552a('0xc1')]=function(_0x4169c2){return BPromise[_0x552a('0xbf')]()['then'](cmHopperBlack[_0x552a('0xc1')](_0x4169c2))['catch'](loggerCatch('[checkIsBlackList]\x20'));};Dialer['prototype'][_0x552a('0xc2')]=function(_0x2818a3){return BPromise['resolve']()['then'](cmHopperBlack[_0x552a('0xc2')](_0x2818a3))['catch'](loggerCatch(_0x552a('0xc3')));};Dialer[_0x552a('0xae')][_0x552a('0xc4')]=function(_0x52baf5){return BPromise[_0x552a('0xbf')]()[_0x552a('0xc5')](cmHopperHistory[_0x552a('0xc6')](_0x52baf5))[_0x552a('0xb8')](loggerCatch(_0x552a('0xc7')));};Dialer[_0x552a('0xae')]['rescheduleContact']=function(_0x141bb7){return BPromise['resolve']()[_0x552a('0xc5')](cmHopper['rescheduleContact'](_0x141bb7))[_0x552a('0xb8')](loggerCatch(_0x552a('0xc8')));};Dialer[_0x552a('0xae')][_0x552a('0xc9')]=function(_0x3c2cac,_0x22770f,_0x49aa55){return BPromise[_0x552a('0xbf')]()[_0x552a('0xc5')](cmHopper[_0x552a('0xc9')](_0x3c2cac,_0x22770f,_0x49aa55))['catch'](loggerCatch('[unlockContact]\x20'));};Dialer[_0x552a('0xae')][_0x552a('0xca')]=function(_0x125fb1,_0x5bf603,_0x3ec965,_0x4fb9c7){return BPromise[_0x552a('0xbf')]()[_0x552a('0xc5')](cmHopper['getContactDialer'](_0x125fb1,_0x5bf603,_0x3ec965,_0x4fb9c7))[_0x552a('0xb8')](loggerCatch('[getContactDialer]\x20'));};Dialer[_0x552a('0xae')][_0x552a('0xcb')]=function(_0x1e8d8d,_0x4b60c4,_0x2d90a2){return BPromise[_0x552a('0xbf')]()[_0x552a('0xc5')](cmHopper[_0x552a('0xcb')](_0x1e8d8d,_0x4b60c4,_0x2d90a2))[_0x552a('0xb8')](loggerCatch(_0x552a('0xcc')));};Dialer[_0x552a('0xae')][_0x552a('0xcd')]=function(_0x187b6f){return BPromise['resolve']()[_0x552a('0xc5')](voiceQueueRt[_0x552a('0xcd')](_0x187b6f))[_0x552a('0xb8')](loggerCatch(_0x552a('0xce')));};Dialer[_0x552a('0xae')]['moveContactManagedDialer']=function(_0x150c25){return BPromise['resolve']()[_0x552a('0xc5')](cmHopper[_0x552a('0xcf')](_0x150c25))[_0x552a('0xb8')](loggerCatch(_0x552a('0xd0')));};Dialer[_0x552a('0xae')][_0x552a('0xd1')]=function(_0x57a330){return BPromise[_0x552a('0xbf')]()['then'](cmHopperHistory[_0x552a('0xd1')](_0x57a330))[_0x552a('0xb8')](loggerCatch(_0x552a('0xd2')));};Dialer[_0x552a('0xae')][_0x552a('0xba')]=function(_0x59a7e){if(!_[_0x552a('0x40')](_0x59a7e)&&_0x59a7e!==null){if(_0x59a7e[_0x552a('0x9b')](_0x552a('0x76'))){if(_0x59a7e[_0x552a('0x76')]>0x0){_0x59a7e['originated']-=0x1;}else{logger[_0x552a('0x97')](_0x552a('0xd3'));}}}else{logger[_0x552a('0x97')](_0x552a('0xd4'));}};Dialer['prototype']['loggerHandler']=function(_0x3b7c0a,_0x17883e){var _0x4fd3be=this;return function(_0x33fde2){_0x4fd3be['updateOriginated'](_0x17883e);logger['error'](_0x3b7c0a,util[_0x552a('0x99')](_0x33fde2,{'showHidden':![],'depth':null}));};};Dialer[_0x552a('0xae')][_0x552a('0xd5')]=function(_0x19f706,_0x1b077b,_0x49d610){var _0x2893c9={'state':0x19,'statedesc':_0x552a('0xd6')};this['updateOriginated'](_0x1b077b);this[_0x552a('0xd7')](_[_0x552a('0xd8')](_0x2893c9,_[_0x552a('0xd9')](_0x49d610,[_0x552a('0xda'),_0x552a('0xdb'),'UserId',_0x552a('0xdc'),'CampaignId'])),_0x552a('0xdd'),_0x552a('0xde'));logger[_0x552a('0x97')](_0x19f706);};Dialer[_0x552a('0xae')][_0x552a('0xdf')]=function(_0x5bb571){return _0x5bb571===_0x552a('0xe0');};Dialer[_0x552a('0xae')][_0x552a('0xe1')]=function(_0x1829aa){return!_['isUndefined'](_0x1829aa)&&_0x1829aa&&!_['isUndefined'](_0x1829aa[_0x552a('0x43')])&&!_[_0x552a('0x40')](_0x1829aa[_0x552a('0x7a')])&&_0x1829aa['active']&&(this[_0x552a('0x25')][util[_0x552a('0x7c')]('SIP/%s',_0x1829aa[_0x552a('0x43')])][_0x552a('0xb6')]===_0x552a('0xe2')||this['trunks'][util[_0x552a('0x7c')](_0x552a('0xe3'),_0x1829aa[_0x552a('0x43')])][_0x552a('0xb6')]==='unmonitored');};Dialer['prototype']['saveInDb']=function(_0x591b76,_0x1567de,_0x7dde2f){this[_0x552a('0xd1')](_0x591b76)[_0x552a('0xb8')](loggerCatch(_0x1567de));this[_0x552a('0xcf')](_0x591b76)[_0x552a('0xb8')](loggerCatch(_0x7dde2f));};Dialer[_0x552a('0xae')][_0x552a('0x3a')]=function(_0x792516){var _0x3de919=this[_0x552a('0x29')][_0x792516['uniqueid']];var _0x4c5157;if(!_['isNil'](_0x792516)&&!_['isNil'](_0x792516[_0x552a('0xe4')])&&!_[_0x552a('0xb4')](_0x792516[_0x552a('0xe4')][_0x552a('0xe5')])&&_0x792516[_0x552a('0xe6')]===_0x552a('0xe7')&&_0x3de919){if(_0x3de919[_0x552a('0x51')]!==_0x552a('0x7f')&&this[_0x552a('0x22')][_0x3de919['queue']][_0x552a('0xe8')]&&_0x792516['value']===_0x552a('0xe9')){delete this[_0x552a('0x29')][_0x792516[_0x552a('0xea')]];this[_0x552a('0xba')](this[_0x552a('0x22')][_0x3de919[_0x552a('0xbb')]]);this[_0x552a('0x22')][_0x3de919[_0x552a('0xbb')]][_0x552a('0x64')]+=0x1;this[_0x552a('0x22')][_0x3de919[_0x552a('0xbb')]][_0x552a('0x63')]+=0x1;_0x4c5157=new Hangup(_0x3de919,_0x792516);_0x4c5157[_0x552a('0xaa')]=0x12;_0x4c5157['statedesc']=_0x552a('0xeb');_0x4c5157[_0x552a('0xec')]='AMD';this[_0x552a('0xd7')](_0x4c5157,_0x552a('0xed'),_0x552a('0xee'));}if(_0x3de919['type']!==_0x552a('0x7f')&&this['voiceQueues'][_0x3de919[_0x552a('0xbb')]][_0x552a('0xe8')]&&_0x792516['value']===_0x552a('0xef')){var _0x5c9311=this;return new BPromise(function(_0x3213b4,_0x41431e){delete _0x5c9311[_0x552a('0x29')][_0x792516[_0x552a('0xea')]];_0x5c9311[_0x552a('0xba')](_0x5c9311[_0x552a('0x22')][_0x3de919[_0x552a('0xbb')]]);_0x5c9311[_0x552a('0x22')][_0x3de919[_0x552a('0xbb')]][_0x552a('0x64')]+=0x1;_0x5c9311['voiceQueues'][_0x3de919[_0x552a('0xbb')]][_0x552a('0x63')]+=0x1;var _0x5efb4f=_0x5c9311[_0x552a('0x22')][_0x3de919[_0x552a('0xbb')]];var _0x32f56f=new Hangup(_0x3de919,_0x792516);_0x32f56f[_0x552a('0xaa')]=0x13;_0x32f56f['statedesc']=_0x552a('0xf0');_0x32f56f[_0x552a('0xec')]=_0x552a('0xf1');_0x32f56f[_0x552a('0xf2')]+=0x1;_0x32f56f['countglobal']+=0x1;_0x32f56f[_0x552a('0xf3')]=!![];_0x5c9311[_0x552a('0xd1')](_0x32f56f)[_0x552a('0xb8')](loggerCatch(_0x552a('0xf4')));if(_0x32f56f[_0x552a('0xf5')]+_0x32f56f[_0x552a('0xf6')]+_0x32f56f['countnoanswerretry']+_0x32f56f['countnosuchnumberretry']+_0x32f56f[_0x552a('0xf7')]+_0x32f56f[_0x552a('0xf8')]+_0x32f56f[_0x552a('0xf2')]+_0x32f56f[_0x552a('0xf9')]>=_0x5efb4f[_0x552a('0xfa')]){_0x5c9311[_0x552a('0xfb')](_0x32f56f,_0x3213b4,_0x41431e,'reason19\x20machine....');}else{if(_0x32f56f['countmachineretry']>=_0x5efb4f[_0x552a('0xfc')]){_0x5c9311[_0x552a('0xfd')](_0x32f56f,_0x3213b4,_0x41431e,_0x552a('0xfe'));}else{_0x5c9311[_0x552a('0xff')]({'active':![],'countmachineretry':_0x32f56f['countmachineretry'],'scheduledat':moment()[_0x552a('0x100')](_0x5efb4f[_0x552a('0x101')],'minutes')[_0x552a('0x7c')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x32f56f[_0x552a('0xda')],'ListId':_0x32f56f['ListId'],'VoiceQueueId':_0x32f56f[_0x552a('0xdc')]||undefined,'CampaignId':_0x32f56f[_0x552a('0x102')]||undefined})[_0x552a('0xb8')](loggerCatch(_0x552a('0x103')));_0x3213b4({'reschedule':0x1});}}});}if(_0x3de919[_0x552a('0x51')]===_0x552a('0x7f')&&this[_0x552a('0x23')][_0x3de919[_0x552a('0xbb')]][_0x552a('0xe8')]&&_0x792516[_0x552a('0x104')]==='HANGUP'){delete this[_0x552a('0x29')][_0x792516[_0x552a('0xea')]];this[_0x552a('0xba')](this[_0x552a('0x23')][_0x3de919[_0x552a('0xbb')]]);_0x4c5157=new Hangup(_0x3de919,_0x792516);_0x4c5157[_0x552a('0xaa')]=0x12;_0x4c5157[_0x552a('0xab')]=_0x552a('0xeb');_0x4c5157[_0x552a('0xec')]=_0x552a('0xf1');this[_0x552a('0xd7')](_0x4c5157,'[syncHangupInAMDIvr][createHistory]',_0x552a('0x105'));}if(_0x3de919['type']===_0x552a('0x7f')&&this[_0x552a('0x23')][_0x3de919[_0x552a('0xbb')]]['dialAMDActive']&&_0x792516[_0x552a('0x104')]===_0x552a('0xef')){var _0x5c9311=this;return new BPromise(function(_0x304964,_0x17eb99){delete _0x5c9311[_0x552a('0x29')][_0x792516['uniqueid']];_0x5c9311[_0x552a('0xba')](_0x5c9311['campaigns'][_0x3de919[_0x552a('0xbb')]]);_0x5c9311[_0x552a('0x23')][_0x3de919['queue']][_0x552a('0x64')]+=0x1;_0x5c9311[_0x552a('0x23')][_0x3de919[_0x552a('0xbb')]][_0x552a('0x63')]+=0x1;var _0x3bddb6=_0x5c9311[_0x552a('0x23')][_0x3de919[_0x552a('0xbb')]];var _0x4bc540=new Hangup(_0x3de919,_0x792516);_0x4bc540[_0x552a('0xaa')]=0x13;_0x4bc540['statedesc']=_0x552a('0xf0');_0x4bc540[_0x552a('0xec')]=_0x552a('0xf1');_0x4bc540[_0x552a('0xf2')]+=0x1;_0x4bc540[_0x552a('0x106')]+=0x1;_0x4bc540[_0x552a('0xf3')]=!![];_0x5c9311['createHistory'](_0x4bc540)[_0x552a('0xb8')](loggerCatch(_0x552a('0xf4')));if(_0x4bc540[_0x552a('0xf5')]+_0x4bc540[_0x552a('0xf6')]+_0x4bc540[_0x552a('0x107')]+_0x4bc540[_0x552a('0x108')]+_0x4bc540[_0x552a('0xf7')]+_0x4bc540[_0x552a('0xf8')]+_0x4bc540['countmachineretry']+_0x4bc540[_0x552a('0xf9')]>=_0x3bddb6[_0x552a('0xfa')]){_0x5c9311[_0x552a('0xfb')](_0x4bc540,_0x304964,_0x17eb99,_0x552a('0x109'));}else{if(_0x4bc540[_0x552a('0xf2')]>=_0x3bddb6[_0x552a('0xfc')]){_0x5c9311[_0x552a('0xfd')](_0x4bc540,_0x304964,_0x17eb99,_0x552a('0xfe'));}else{_0x5c9311[_0x552a('0xff')]({'active':![],'countmachineretry':_0x4bc540['countmachineretry'],'scheduledat':moment()[_0x552a('0x100')](_0x3bddb6[_0x552a('0x101')],_0x552a('0x10a'))['format'](_0x552a('0x10b')),'ContactId':_0x4bc540[_0x552a('0xda')],'ListId':_0x4bc540[_0x552a('0xdb')],'VoiceQueueId':_0x4bc540[_0x552a('0xdc')]||undefined,'CampaignId':_0x4bc540[_0x552a('0x102')]||undefined})[_0x552a('0xb8')](loggerCatch(_0x552a('0x103')));_0x304964({'reschedule':0x1});}}});}}};Dialer[_0x552a('0xae')][_0x552a('0x36')]=function(_0x3c8971){var _0x5e5dd7=this[_0x552a('0x29')][_0x3c8971[_0x552a('0xea')]];var _0x2cbc85=this;var _0x31333a;if(_0x5e5dd7&&_0x5e5dd7[_0x552a('0x51')]===_0x552a('0x7f')){delete this[_0x552a('0x29')][_0x3c8971[_0x552a('0xea')]];this[_0x552a('0xba')](this[_0x552a('0x23')][_0x5e5dd7[_0x552a('0xbb')]]);this[_0x552a('0x23')][_0x5e5dd7['queue']][_0x552a('0x10c')]+=0x1;_0x31333a=new Hangup(_0x5e5dd7,_0x3c8971);this[_0x552a('0xd1')](_0x31333a)[_0x552a('0xb8')](loggerCatch(_0x552a('0x10d')));this[_0x552a('0xcf')](_0x31333a)['catch'](loggerCatch(_0x552a('0x10e')));}if(_0x5e5dd7&&_0x5e5dd7[_0x552a('0x51')]!==_0x552a('0x7f')&&isNotNull(this['voiceQueues'][_0x5e5dd7['queue']][_0x552a('0x10f')])){delete this[_0x552a('0x29')][_0x3c8971[_0x552a('0xea')]];this['updateOriginated'](this[_0x552a('0x22')][_0x5e5dd7['queue']]);this[_0x552a('0x22')][_0x5e5dd7['queue']][_0x552a('0x64')]+=0x1;this[_0x552a('0x22')][_0x5e5dd7[_0x552a('0xbb')]][_0x552a('0x63')]+=0x1;_0x31333a=new Hangup(_0x5e5dd7,_0x3c8971);_0x31333a[_0x552a('0xaa')]=0x10;_0x31333a[_0x552a('0xab')]=_0x552a('0x110');_0x31333a[_0x552a('0xec')]=_0x552a('0x111');this[_0x552a('0xd1')](_0x31333a)[_0x552a('0xb8')](loggerCatch(_0x552a('0x10d')));this[_0x552a('0xcf')](_0x31333a)[_0x552a('0xb8')](loggerCatch(_0x552a('0x10e')));}if(_0x5e5dd7&&_0x5e5dd7[_0x552a('0x51')]!==_0x552a('0x7f')&&!isNotNull(this[_0x552a('0x22')][_0x5e5dd7[_0x552a('0xbb')]][_0x552a('0x10f')])){delete this['uniqueId'][_0x3c8971[_0x552a('0xea')]];this[_0x552a('0xba')](this[_0x552a('0x22')][_0x5e5dd7[_0x552a('0xbb')]]);this[_0x552a('0x22')][_0x5e5dd7['queue']][_0x552a('0x6c')]+=0x1;_0x31333a=new Hangup(_0x5e5dd7,_0x3c8971);_0x31333a['state']=0xc;_0x31333a[_0x552a('0xab')]=_0x3c8971[_0x552a('0x112')];_0x31333a['membername']=_0x552a('0x113');this[_0x552a('0xd1')](_0x31333a)['catch'](loggerCatch(_0x552a('0x10d')));this[_0x552a('0xcf')](_0x31333a)[_0x552a('0xb8')](loggerCatch(_0x552a('0x10e')));}};Dialer[_0x552a('0xae')][_0x552a('0x34')]=function(_0x24c83f){var _0x45e245=this[_0x552a('0x29')][_0x24c83f[_0x552a('0xea')]];var _0x51cc63=this;if(this['voiceQueues'][_0x24c83f[_0x552a('0xbb')]]){if(_0x45e245&&_0x45e245['type']!==_0x552a('0x7f')){delete this[_0x552a('0x29')][_0x24c83f[_0x552a('0xea')]];this[_0x552a('0x22')][_0x24c83f[_0x552a('0xbb')]]['outboundAnswerCallsDay']+=0x1;var _0x59cd62=new AgentComplete(_0x45e245,_0x24c83f);if(_0x24c83f[_0x552a('0x114')]===_0x552a('0x115')){_0x59cd62['agiafterat']=this[_0x552a('0x22')][_0x24c83f[_0x552a('0xbb')]][_0x552a('0x116')]&&this[_0x552a('0x22')][_0x24c83f[_0x552a('0xbb')]]['dialAgiAfterHangupAgent']?moment()[_0x552a('0x7c')](_0x552a('0x10b')):undefined;}this[_0x552a('0xd1')](_0x59cd62)[_0x552a('0xb8')](loggerCatch('[syncAgentComplete][createHistory]'));this['moveContactManagedDialer'](_0x59cd62)[_0x552a('0xb8')](loggerCatch(_0x552a('0x117')));}}};Dialer[_0x552a('0xae')]['syncAgentConnect']=function(_0x4f493d){if(this['voiceQueues'][_0x4f493d[_0x552a('0xbb')]]){if(this[_0x552a('0x29')][_0x4f493d[_0x552a('0xea')]]&&this[_0x552a('0x29')][_0x4f493d['uniqueid']][_0x552a('0x51')]!=='ivr'){this[_0x552a('0xba')](this[_0x552a('0x22')][_0x4f493d[_0x552a('0xbb')]]);this['uniqueId'][_0x4f493d[_0x552a('0xea')]][_0x552a('0x118')]=moment()[_0x552a('0x7c')](_0x552a('0x10b'));}}};Dialer['prototype']['queueCallerAbandonCreateState']=function(_0xdd5512){this[_0x552a('0xd1')](_0xdd5512)[_0x552a('0xb8')](loggerCatch(_0x552a('0x119')));this['moveContactManagedDialer'](_0xdd5512)['catch'](loggerCatch(_0x552a('0x11a')));};Dialer['prototype']['syncQueueCallerAbandon']=function(_0x223030){var _0x53fe99=this[_0x552a('0x29')][_0x223030[_0x552a('0xea')]];var _0x50b600=this;if(this[_0x552a('0x22')][_0x223030['queue']]){if(_0x53fe99&&_0x53fe99[_0x552a('0x51')]!==_0x552a('0x7f')){delete this[_0x552a('0x29')][_0x223030[_0x552a('0xea')]];this['updateOriginated'](this[_0x552a('0x22')][_0x223030['queue']]);_0x53fe99['droptime']=moment()[_0x552a('0x7c')](_0x552a('0x10b'));var _0x4a5fd4=new QueueCallerAbandon(_0x53fe99,_0x223030);if(getSeconds(_0x53fe99[_0x552a('0x11b')],_0x53fe99[_0x552a('0x11c')])>=_0x53fe99[_0x552a('0x11d')]){this[_0x552a('0x22')][_0x223030['queue']][_0x552a('0x70')]+=0x1;this[_0x552a('0x22')][_0x223030[_0x552a('0xbb')]][_0x552a('0x11e')]+=0x1;this[_0x552a('0x22')][_0x223030[_0x552a('0xbb')]][_0x552a('0x71')]+=0x1;_0x4a5fd4[_0x552a('0xaa')]=0xa;_0x4a5fd4[_0x552a('0xab')]=_0x552a('0x11f');_0x4a5fd4[_0x552a('0x120')]=_0x552a('0x121');_0x4a5fd4[_0x552a('0x122')]=this[_0x552a('0x22')][_0x223030[_0x552a('0xbb')]]['dialQueueProject2']?moment()[_0x552a('0x7c')]('YYYY-MM-DD\x20HH:mm:ss'):undefined;_0x4a5fd4[_0x552a('0xf7')]+=0x1;_0x4a5fd4[_0x552a('0x106')]+=0x1;if(_0x4a5fd4[_0x552a('0xf7')]>=this['voiceQueues'][_0x223030[_0x552a('0xbb')]][_0x552a('0x123')]){this[_0x552a('0x124')](_0x4a5fd4);}else{this[_0x552a('0xff')]({'active':![],'countdropretry':_0x4a5fd4['countdropretry'],'scheduledat':moment()[_0x552a('0x100')](this[_0x552a('0x22')][_0x223030['queue']][_0x552a('0x125')],'minutes')['format'](_0x552a('0x10b')),'ContactId':_0x53fe99[_0x552a('0xda')],'ListId':_0x53fe99[_0x552a('0xdb')],'VoiceQueueId':_0x53fe99[_0x552a('0xdc')]||undefined,'CampaignId':_0x53fe99[_0x552a('0x102')]||undefined})[_0x552a('0xb8')](loggerCatch(_0x552a('0x126')));var _0x287ce7=new History(_0x4a5fd4);_0x287ce7[_0x552a('0xaa')]=0xa;_0x287ce7[_0x552a('0xab')]=_0x552a('0x11f');_0x287ce7[_0x552a('0xad')]=moment()[_0x552a('0x7c')](_0x552a('0x10b'));_0x287ce7[_0x552a('0xac')]=_0x287ce7[_0x552a('0xad')];_0x287ce7['calleridname']=_0x4a5fd4[_0x552a('0x127')];_0x287ce7[_0x552a('0x128')]=_0x4a5fd4[_0x552a('0x128')];this[_0x552a('0xd1')](_0x287ce7)['catch'](loggerCatch(_0x552a('0x129')));}}else{this['voiceQueues'][_0x223030['queue']][_0x552a('0x6f')]+=0x1;this['voiceQueues'][_0x223030[_0x552a('0xbb')]]['outboundDropCallsDayCallersExit']+=0x1;_0x4a5fd4[_0x552a('0xaa')]=0xb;_0x4a5fd4[_0x552a('0xab')]='Abandoned';_0x4a5fd4[_0x552a('0x120')]=_0x552a('0x12a');_0x4a5fd4[_0x552a('0xf8')]+=0x1;_0x4a5fd4['countglobal']+=0x1;if(_0x4a5fd4[_0x552a('0xf8')]>=this[_0x552a('0x22')][_0x223030[_0x552a('0xbb')]][_0x552a('0x12b')]){this[_0x552a('0x124')](_0x4a5fd4);}else{this[_0x552a('0xff')]({'active':![],'countabandonedretry':_0x4a5fd4[_0x552a('0xf8')],'scheduledat':moment()[_0x552a('0x100')](this[_0x552a('0x22')][_0x223030['queue']]['dialAbandonedRetryFrequency'],_0x552a('0x10a'))[_0x552a('0x7c')](_0x552a('0x10b')),'ContactId':_0x53fe99[_0x552a('0xda')],'ListId':_0x53fe99[_0x552a('0xdb')],'VoiceQueueId':_0x53fe99[_0x552a('0xdc')]||undefined,'CampaignId':_0x53fe99[_0x552a('0x102')]||undefined})[_0x552a('0xb8')](loggerCatch(_0x552a('0x12c')));var _0x287ce7=new History(_0x4a5fd4);_0x287ce7[_0x552a('0xaa')]=0xb;_0x287ce7['statedesc']=_0x552a('0x12d');_0x287ce7['starttime']=moment()[_0x552a('0x7c')](_0x552a('0x10b'));_0x287ce7['endtime']=_0x287ce7[_0x552a('0xad')];_0x287ce7['calleridname']=_0x4a5fd4[_0x552a('0x127')];_0x287ce7[_0x552a('0x128')]=_0x4a5fd4[_0x552a('0x128')];this[_0x552a('0xd1')](_0x287ce7)[_0x552a('0xb8')](loggerCatch(_0x552a('0x12e')));}}}}};Dialer['prototype'][_0x552a('0x38')]=function(_0x4f6ca1){if(this[_0x552a('0x27')][_0x4f6ca1['uniqueid']]){this[_0x552a('0x27')][_0x4f6ca1[_0x552a('0xea')]]['channel']=_0x4f6ca1[_0x552a('0xb7')];}if(this['uniqueId'][_0x4f6ca1[_0x552a('0xea')]]){this[_0x552a('0x29')][_0x4f6ca1[_0x552a('0xea')]][_0x552a('0xb7')]=_0x4f6ca1[_0x552a('0xb7')];}};Dialer[_0x552a('0xae')]['syncQueueMember']=function(_0x5179b1){if(strategy[this[_0x552a('0x22')][this[_0x552a('0x27')][_0x5179b1[_0x552a('0x12f')]][_0x552a('0xbb')]][_0x552a('0x130')]]===_0x552a('0x131')){if(this[_0x552a('0x27')][_0x5179b1[_0x552a('0x12f')]]&&_['isNil'](this[_0x552a('0x27')][_0x5179b1[_0x552a('0x12f')]]['locked'])&&_0x5179b1[_0x552a('0xb6')]==='1'&&_0x5179b1[_0x552a('0x132')]==='0'){if(this[_0x552a('0x24')][_0x5179b1[_0x552a('0x133')]]){if(!this[_0x552a('0x24')][_0x5179b1[_0x552a('0x133')]][_0x552a('0x134')]){this[_0x552a('0x24')][_0x5179b1['stateinterface']][_0x552a('0x134')]=!![];this[_0x552a('0x27')][_0x5179b1[_0x552a('0x12f')]][_0x552a('0x134')]=!![];this[_0x552a('0x27')][_0x5179b1['actionid']][_0x552a('0x133')]=_0x5179b1[_0x552a('0x133')];}}}}else if((strategy[this[_0x552a('0x22')][this[_0x552a('0x27')][_0x5179b1['actionid']]['queue']]['strategy']]||_0x552a('0x1d'))===_0x552a('0x1d')){if(this[_0x552a('0x27')][_0x5179b1[_0x552a('0x12f')]]){if(this[_0x552a('0x24')][_0x5179b1[_0x552a('0x133')]]){this[_0x552a('0x27')][_0x5179b1[_0x552a('0x12f')]][_0x552a('0x133')]=_0x5179b1[_0x552a('0x133')];if(_[_0x552a('0xb4')](this[_0x552a('0x135')][this[_0x552a('0x27')][_0x5179b1[_0x552a('0x12f')]][_0x552a('0xbb')]])){this[_0x552a('0x135')][this[_0x552a('0x27')][_0x5179b1[_0x552a('0x12f')]][_0x552a('0xbb')]]=[];}this[_0x552a('0x135')][this[_0x552a('0x27')][_0x5179b1['actionid']][_0x552a('0xbb')]][_0x552a('0x136')](_[_0x552a('0xd8')](_[_0x552a('0xd9')](this[_0x552a('0x27')][_0x5179b1['actionid']],[_0x552a('0x137'),'stateinterface']),{'status':_0x5179b1[_0x552a('0xb6')],'paused':_0x5179b1[_0x552a('0x132')]}));}}}};function unlockQueueStatus(_0x125760,_0x55a856){setTimeout(function(){if(_[_0x552a('0x40')](_0x125760[_0x552a('0x138')])){loggerBooked['error'](_0x552a('0x139'),_0x55a856);}_0x125760[_0x552a('0x138')]=!![];loggerBooked[_0x552a('0x82')](_0x552a('0x13a'),_0x55a856,JSON[_0x552a('0x4c')](_[_0x552a('0xd9')](_0x125760,['name',_0x552a('0x138')])));},0x1f3);}Dialer['prototype'][_0x552a('0x3e')]=function(_0x4a7fdc){var _0x482c7e=this;var _0x30a4a3=_0x482c7e[_0x552a('0x22')][_0x482c7e[_0x552a('0x27')][_0x4a7fdc[_0x552a('0x12f')]]['queue']];if(strategy[this[_0x552a('0x22')][this[_0x552a('0x27')][_0x4a7fdc[_0x552a('0x12f')]][_0x552a('0xbb')]][_0x552a('0x130')]]===_0x552a('0x131')){if(this[_0x552a('0x27')][_0x4a7fdc[_0x552a('0x12f')]]&&this[_0x552a('0x27')][_0x4a7fdc['actionid']]['stateinterface']){this['preview'][_0x552a('0x13b')](this['actions'][_0x4a7fdc['actionid']][_0x552a('0x137')],this[_0x552a('0x27')][_0x4a7fdc[_0x552a('0x12f')]][_0x552a('0x133')])[_0x552a('0xb8')](function(_0x348b5d){logger[_0x552a('0x97')](_0x552a('0x13c'),util[_0x552a('0x99')](_0x348b5d,{'showHidden':![],'depth':null}));})[_0x552a('0x20')](function(){_0x482c7e[_0x552a('0xba')](_0x482c7e[_0x552a('0x22')][_0x482c7e['actions'][_0x4a7fdc['actionid']][_0x552a('0xbb')]]);_0x482c7e['agents'][_0x482c7e[_0x552a('0x27')][_0x4a7fdc['actionid']][_0x552a('0x133')]][_0x552a('0x134')]=![];delete _0x482c7e['actions'][_0x4a7fdc[_0x552a('0x12f')]];unlockQueueStatus(_0x30a4a3);});}else{this['updateOriginated'](this[_0x552a('0x22')][this[_0x552a('0x27')][_0x4a7fdc[_0x552a('0x12f')]]['queue']]);this[_0x552a('0xff')]({'active':![],'ContactId':this['actions'][_0x4a7fdc[_0x552a('0x12f')]][_0x552a('0xda')],'ListId':this[_0x552a('0x27')][_0x4a7fdc[_0x552a('0x12f')]][_0x552a('0xdb')],'VoiceQueueId':this['actions'][_0x4a7fdc[_0x552a('0x12f')]][_0x552a('0xdc')]||undefined,'CampaignId':this[_0x552a('0x27')][_0x4a7fdc['actionid']]['CampaignId']||undefined})[_0x552a('0xb8')](loggerCatch('[unlock][syncQueueStatusComplete]'));delete this[_0x552a('0x27')][_0x4a7fdc[_0x552a('0x12f')]];unlockQueueStatus(_0x30a4a3);}}else if((strategy[this[_0x552a('0x22')][this['actions'][_0x4a7fdc['actionid']][_0x552a('0xbb')]]['strategy']]||_0x552a('0x1d'))===_0x552a('0x1d')){var _0x1264e9;if(this[_0x552a('0x27')][_0x4a7fdc[_0x552a('0x12f')]]&&!_[_0x552a('0x4a')](this[_0x552a('0x135')][this[_0x552a('0x27')][_0x4a7fdc[_0x552a('0x12f')]]['queue']])){if(this[_0x552a('0x2d')][_0x482c7e[_0x552a('0x27')][_0x4a7fdc[_0x552a('0x12f')]][_0x552a('0xbb')]]){this[_0x552a('0x2d')][_0x482c7e[_0x552a('0x27')][_0x4a7fdc['actionid']][_0x552a('0xbb')]]=this[_0x552a('0x2d')][this['actions'][_0x4a7fdc['actionid']]['queue']]?this[_0x552a('0x2d')][this[_0x552a('0x27')][_0x4a7fdc[_0x552a('0x12f')]][_0x552a('0xbb')]]:this[_0x552a('0x135')][this['actions'][_0x4a7fdc[_0x552a('0x12f')]][_0x552a('0xbb')]]?this[_0x552a('0x135')][this[_0x552a('0x27')][_0x4a7fdc['actionid']][_0x552a('0xbb')]][_0x552a('0x13d')]||0x0:0x0;}this[_0x552a('0x135')][this[_0x552a('0x27')][_0x4a7fdc[_0x552a('0x12f')]][_0x552a('0xbb')]][_0x552a('0x13d')]=this[_0x552a('0x2d')][this['actions'][_0x4a7fdc[_0x552a('0x12f')]][_0x552a('0xbb')]];for(var _0x347c75=0x0;_0x347c75=0x0?!![]:![];})['catch'](myreject(_0x51b28b)));}}else{_0x7883a2[_0x552a('0x136')](ami[_0x552a('0xb5')]({'action':_0x552a('0x150'),'command':util['format'](_0x552a('0x156'),_0x2ae489,!_[_0x552a('0x40')](config[_0x552a('0x152')][_0x50d2d5])?_0x50d2d5:'')})[_0x552a('0xc5')](function(_0x4208e2){return _0x4208e2[_0x552a('0x153')][_0x552a('0x154')]('true')>=0x0?!![]:![];})[_0x552a('0xb8')](myreject(_0x51b28b)));}BPromise[_0x552a('0x157')](_0x7883a2)[_0x552a('0xc5')](function(_0x333552){var _0x43bbdf=_['some'](_0x333552);if(_0x43bbdf){return _0x5e26d9(_0x43bbdf);}else{_0x1a0a1b[_0x552a('0x41')]=_0x319219?_0x552a('0x158'):_0x552a('0x159');return _0x51b28b(msgResponse(_0x552a('0x15a'),_0x552a('0x14b'),_0x552a('0x15b')+_0x319219+'\x20'+_0x19c773+_0x552a('0x15c')+util['inspect'](_0x2ae489,{'showHidden':![],'depth':null})+_0x552a('0x15d')+_0x50d2d5));}})[_0x552a('0xb8')](function(_0x3aebcd){return _0x51b28b(msgResponse(_0x552a('0x14a'),'Failure',JSON['stringify'](_0x3aebcd)));});});};Dialer[_0x552a('0xae')][_0x552a('0x15e')]=function(_0x15b1f1){var _0x3c7955=this;return function(){switch(_0x15b1f1[_0x552a('0x5f')]){case'progressive':freeVariablesPredictive(_0x15b1f1);_0x3c7955[_0x552a('0x15f')](_0x15b1f1,0x1);break;case _0x552a('0x160'):freeVariablesPredictive(_0x15b1f1);_0x3c7955['handlePower'](_0x15b1f1,_0x15b1f1['dialPowerLevel']);break;case _0x552a('0xb'):_0x3c7955[_0x552a('0xb')](_0x15b1f1);break;case'booked':freeVariablesPredictive(_0x15b1f1);_0x3c7955[_0x552a('0x15f')](_0x15b1f1,0x1);break;default:freeVariablesPredictive(_0x15b1f1);logger[_0x552a('0x97')](_0x552a('0x161'),_0x15b1f1[_0x552a('0x43')],_0x552a('0x162'));}};};Dialer[_0x552a('0xae')][_0x552a('0x163')]=function(_0x3f1030){var _0x1b1ca8=this;return function(){_0x1b1ca8['handleIvr'](_0x3f1030);};};Dialer[_0x552a('0xae')]['syncQueueSummary']=function(_0x3768e){var _0xbe057=this;if(isNotPreview(_0x3768e['dialMethod'])){if(isVoiceQueueOutbound(_0x3768e[_0x552a('0x51')])&&isActive(_0x3768e[_0x552a('0x5e')])){_0x3768e[_0x552a('0xa3')]=!![];BPromise[_0x552a('0xbf')]()[_0x552a('0xc5')](checkIsLoggedIn(_0x3768e,_0x3768e[_0x552a('0x55')]))[_0x552a('0xc5')](checkIsActive(_0x3768e,_0x3768e[_0x552a('0x5e')]))[_0x552a('0xc5')](checkInterval(_0x3768e))[_0x552a('0xc5')](_0xbe057[_0x552a('0x147')](_0x3768e))[_0x552a('0xc5')](_0xbe057['checkIfTime'](_0x3768e[_0x552a('0x164')],_0x3768e[_0x552a('0x165')],_0x3768e[_0x552a('0x43')],_0x3768e))[_0x552a('0xc5')](_0xbe057['checkIfTimeIntervals'](_0x3768e[_0x552a('0x46')],_0x3768e[_0x552a('0x165')],_0x3768e['name'],_0x3768e))[_0x552a('0xc5')](_0xbe057['checkDialMethod'](_0x3768e))[_0x552a('0xb8')](loggerCatchQueueSummary(_0x552a('0x166'),_0x3768e));}else{notSendMessagesQueue(_0x3768e);}}else{freeVariablesPredictive(_0x3768e);}};Dialer[_0x552a('0xae')]['syncCampaigns']=function(){var _0x296a9b=this;var _0x5bb068;for(var _0x483e00 in this[_0x552a('0x23')]){if(this[_0x552a('0x23')][_0x552a('0x9b')](_0x483e00)){_0x5bb068=this[_0x552a('0x23')][_0x483e00];if(isCampaignIvr(_0x5bb068[_0x552a('0x51')])&&isActive(_0x5bb068[_0x552a('0x7a')])){_0x5bb068[_0x552a('0xa3')]=!![];BPromise[_0x552a('0xbf')]()[_0x552a('0xc5')](checkIsActive(_0x5bb068,_0x5bb068[_0x552a('0x7a')]))[_0x552a('0xc5')](checkInterval(_0x5bb068))['then'](_0x296a9b[_0x552a('0x147')](_0x5bb068))[_0x552a('0xc5')](_0x296a9b[_0x552a('0x149')](_0x5bb068[_0x552a('0x164')],_0x5bb068['dialTimezone'],_0x5bb068[_0x552a('0x43')],_0x5bb068))[_0x552a('0xc5')](_0x296a9b[_0x552a('0x167')](_0x5bb068[_0x552a('0x46')],_0x5bb068[_0x552a('0x165')],_0x5bb068[_0x552a('0x43')],_0x5bb068))[_0x552a('0xc5')](_0x296a9b['launchHandleIvr'](_0x5bb068))[_0x552a('0xb8')](loggerCatchQueueSummary(_0x552a('0x168'),_0x5bb068));}else{notSendMessagesCampaign(_0x5bb068);}}}};function getCallerIdRandom(_0x306d38,_0x1d864c){var _0x1cbecc,_0x538f68,_0x4367a7;if(_0x1d864c<=0x0){_0x1d864c=0x1;}_0x1cbecc=new RegExp('\x5cw{0,'+_0x1d864c+'}$');_0x538f68=Math['pow'](0xa,_0x1d864c-0x1);_0x4367a7=Math[_0x552a('0x169')](0xa,_0x1d864c)-0x1;return util[_0x552a('0x7c')]('%s',_[_0x552a('0x16a')](_0x306d38,_0x1cbecc,_[_0x552a('0x16b')](_0x538f68,_0x4367a7)));}function extractCalleridName(_0x26ea70){var _0x2bcebb=_0x26ea70[_0x552a('0x16c')](/"(.*?)"/);return _0x2bcebb?_0x2bcebb[0x1]:_0x26ea70;}function extractCalleridNumber(_0x53efbf){var _0x1d5e1f=_0x53efbf[_0x552a('0x16c')](/<(.*?)>/);return _0x1d5e1f?_0x1d5e1f[0x1]:_0x53efbf;}Dialer['prototype']['actionOriginate']=function(_0x1ea9ce,_0x462c20){var _0x3dd793=this;var _0x3060a4=uuid['v4']();this[_0x552a('0x27')][_0x3060a4]=new Action(_0x1ea9ce,_0x462c20,_0x3060a4);return new BPromise(function(_0x5115b8,_0x3bcee9){if(_[_0x552a('0x40')](_0x1ea9ce)&&'object'!==typeof _0x1ea9ce){return _0x3bcee9(msgResponse('originate',_0x552a('0x14b'),'voiceQueue\x20is\x20undefine'));}if(_[_0x552a('0x40')](_0x462c20['Contact'][_0x552a('0x16d')])||_0x462c20[_0x552a('0x16e')][_0x552a('0x16d')]===null){return _0x3bcee9(msgResponse(_0x552a('0x16f'),_0x552a('0x14b'),'contact\x20is\x20undefine'));}var _0x12b986={'XMD-CALLERID':_0x3dd793[_0x552a('0x27')][_0x3060a4][_0x552a('0x170')](),'XMD-AGI':_0x1ea9ce['dialQueueProject']?util[_0x552a('0x7c')](_0x552a('0x171'),ipAgi,_0x1ea9ce[_0x552a('0x10f')]):_0x552a('0x172'),'XMD-AGIAFTER':_0x1ea9ce['dialQueueProject2']?util['format'](_0x552a('0x171'),ipAgi,_0x1ea9ce[_0x552a('0x116')]):'NONE','XMD-QUEUE':_0x1ea9ce[_0x552a('0x51')]===_0x552a('0x52')?util[_0x552a('0x7c')]('\x22%s,%s%s,,,%s\x22',_0x1ea9ce[_0x552a('0x43')],_0x1ea9ce[_0x552a('0x173')]||'',_0x1ea9ce['dialAgiAfterHangupAgent']?'c':'',_0x1ea9ce[_0x552a('0x11d')]||0x3):_0x552a('0x172'),'XMD-CONTACTID':_0x462c20[_0x552a('0xda')],'XMD-CDRTYPE':'dialer','CALLERID(all)':_0x3dd793[_0x552a('0x27')][_0x3060a4][_0x552a('0x170')](),'XMD-AMD':_0x1ea9ce[_0x552a('0xe8')]?'ACTIVE':_0x552a('0x172'),'XMD-DESTINATION':'xcally-motion-dialer'};if(_0x1ea9ce[_0x552a('0xe8')]){_0x12b986[_0x552a('0x174')]=_0x1ea9ce[_0x552a('0x175')]||0x9c4;_0x12b986['XMD-AMDGREETING']=_0x1ea9ce[_0x552a('0x176')]||0x5dc;_0x12b986[_0x552a('0x177')]=_0x1ea9ce[_0x552a('0x178')]||0x320;_0x12b986['XMD-AMDTOTALANALYSISTIME']=_0x1ea9ce['dialAMDTotalAnalysisTime']||0x1388;_0x12b986[_0x552a('0x179')]=_0x1ea9ce[_0x552a('0x17a')]||0x64;_0x12b986[_0x552a('0x17b')]=_0x1ea9ce['dialAMDBetweenWordsSilence']||0x32;_0x12b986[_0x552a('0x17c')]=_0x1ea9ce[_0x552a('0x17d')]||0x3;_0x12b986[_0x552a('0x17e')]=_0x1ea9ce[_0x552a('0x17f')]||0x100;_0x12b986[_0x552a('0x180')]=_0x1ea9ce[_0x552a('0x181')]||0x1388;}if(_0x1ea9ce[_0x552a('0x51')]===_0x552a('0x52')){_0x12b986[_0x552a('0x182')]=_0x462c20[_0x552a('0xdc')];}else{_0x12b986[_0x552a('0x183')]=_0x462c20[_0x552a('0x102')];}for(var _0x21b68a in _0x462c20[_0x552a('0x16e')]){if(_0x462c20['Contact']['hasOwnProperty'](_0x21b68a)){if(isNotNull(_0x462c20[_0x552a('0x16e')][_0x21b68a])&&_0x21b68a!=='id'&&_0x21b68a!==_0x552a('0x184')&&_0x21b68a!==_0x552a('0x185')&&_0x21b68a!==_0x552a('0x186')){_0x12b986[util[_0x552a('0x7c')](_0x552a('0x187'),_0x552a('0x188'),_['toUpper'](_0x21b68a))]=_0x462c20[_0x552a('0x16e')][_0x21b68a];}}}var _0x17470b=_0x3dd793[_0x552a('0xe1')](_0x1ea9ce[_0x552a('0x79')])?getCallerId(_0x1ea9ce[_0x552a('0x79')][_0x552a('0x7b')],_0x1ea9ce[_0x552a('0x60')],_0x1ea9ce[_0x552a('0x189')]>0x0?getCallerIdRandom(_0x1ea9ce[_0x552a('0x61')],_0x1ea9ce[_0x552a('0x189')]):_0x1ea9ce['dialOriginateCallerIdNumber']):getCallerId(_['isNil'](_0x1ea9ce[_0x552a('0x148')])?_0x1ea9ce['Trunk'][_0x552a('0x7b')]:_0x1ea9ce[_0x552a('0x148')][_0x552a('0x7b')],_0x1ea9ce['dialOriginateCallerIdName'],_0x1ea9ce['dialRandomLastDigitCallerIdNumber']>0x0?getCallerIdRandom(_0x1ea9ce[_0x552a('0x61')],_0x1ea9ce[_0x552a('0x189')]):_0x1ea9ce[_0x552a('0x61')]);if(_0x17470b){_0x12b986['XMD-ORIGINATECALLERIDNAME']=_0x3dd793['actions'][_0x3060a4][_0x552a('0x18a')]=extractCalleridName(_0x17470b);_0x12b986[_0x552a('0x18b')]=_0x3dd793[_0x552a('0x27')][_0x3060a4]['originatecalleridnum']=extractCalleridNumber(_0x17470b);}return ami[_0x552a('0xb5')]({'actionid':_0x3060a4,'action':_0x552a('0x16f'),'channel':_0x3dd793['isTrunkReachable'](_0x1ea9ce[_0x552a('0x79')])?util[_0x552a('0x7c')]('SIP/%s/%s%s',_0x1ea9ce['Trunk'][_0x552a('0x43')],isNotNull(_0x1ea9ce[_0x552a('0x18c')])?_0x1ea9ce[_0x552a('0x18c')][_0x552a('0x18d')]()||'':'',_0x1ea9ce['dialCutDigit']>0x0?_0x462c20['Contact'][_0x552a('0x16d')][_0x552a('0x18e')](_0x1ea9ce[_0x552a('0x18f')]):_0x462c20[_0x552a('0x16e')][_0x552a('0x16d')]):util['format'](_0x552a('0x190'),_['isNil'](_0x1ea9ce[_0x552a('0x148')])?_0x1ea9ce[_0x552a('0x79')][_0x552a('0x43')]:_0x1ea9ce[_0x552a('0x148')][_0x552a('0x43')],isNotNull(_0x1ea9ce['dialPrefix'])?_0x1ea9ce[_0x552a('0x18c')][_0x552a('0x18d')]()||'':'',_0x1ea9ce['dialCutDigit']>0x0?_0x462c20[_0x552a('0x16e')][_0x552a('0x16d')][_0x552a('0x18e')](_0x1ea9ce['dialCutDigit']):_0x462c20[_0x552a('0x16e')][_0x552a('0x16d')]),'callerid':_0x17470b,'Exten':_0x552a('0xe7'),'Context':'from-sip','Priority':'1','variable':_0x12b986,'timeout':(_0x1ea9ce[_0x552a('0x62')]||0x1e)*0x3e8,'async':!![],'channelid':_0x3060a4})[_0x552a('0xc5')](function(_0x2257d3){return _0x5115b8(_0x2257d3);})['catch'](function(_0x43075e){_0x1ea9ce['outboundOriginateFailureCallsDay']+=0x1;var _0x3326a2=new History(_0x3dd793[_0x552a('0x27')][_0x3060a4]);logger[_0x552a('0x97')](util[_0x552a('0x7c')](_0x552a('0x191'),JSON['stringify'](_0x43075e)));_0x3326a2['state']=0xe;_0x3326a2[_0x552a('0xab')]=_0x552a('0x192');_0x3326a2['starttime']=moment()[_0x552a('0x7c')](_0x552a('0x10b'));_0x3326a2['endtime']=_0x3326a2[_0x552a('0xad')];_0x3dd793[_0x552a('0xd1')](_0x3326a2)[_0x552a('0xb8')](loggerCatch(_0x552a('0x193')));_0x3dd793[_0x552a('0xcf')](_0x3326a2)[_0x552a('0xb8')](loggerCatch(_0x552a('0x193')))[_0x552a('0x20')](function(){delete _0x3dd793[_0x552a('0x27')][_0x3060a4];return _0x3bcee9(msgResponse('originate',_0x552a('0x4b'),_0x552a('0x194')));});});});};Dialer[_0x552a('0xae')][_0x552a('0x32')]=function(_0x41cce0){var _0x1f0986=this[_0x552a('0x27')][_0x41cce0['actionid']];var _0x3d91a6=this;if(_0x1f0986){delete this['actions'][_0x41cce0[_0x552a('0x12f')]];_0x1f0986[_0x552a('0x11c')]=moment()[_0x552a('0x7c')]('YYYY-MM-DD\x20HH:mm:ss');var _0x4dfbbb=_0x1f0986['type']==='ivr'?this[_0x552a('0x23')][_0x1f0986[_0x552a('0xbb')]]:this['voiceQueues'][_0x1f0986[_0x552a('0x195')]()];if(!this[_0x552a('0xdf')](_0x41cce0[_0x552a('0x196')])){this[_0x552a('0xba')](_0x4dfbbb);return this['callProgressDetecting'](_0x1f0986,_0x4dfbbb,_0x41cce0)['then'](function(_0x84c58d){})[_0x552a('0xb8')](loggerCatch('[callProgressDetecting]\x20'));}else{this[_0x552a('0x29')][_0x41cce0[_0x552a('0xea')]]=_0x1f0986;}}};Dialer['prototype'][_0x552a('0x197')]=function(_0x4ccda5,_0x389c84,_0x42cbd0){var _0x41dcd8=new History(_0x389c84);if(_0x41dcd8[_0x552a('0xf5')]+_0x41dcd8['countcongestionretry']+_0x41dcd8[_0x552a('0x107')]+_0x41dcd8['countnosuchnumberretry']+_0x41dcd8[_0x552a('0xf7')]+_0x41dcd8[_0x552a('0xf8')]+_0x41dcd8[_0x552a('0xf2')]+_0x41dcd8['countagentrejectretry']>=_0x42cbd0[_0x552a('0xfa')]-0x1){return!![];}switch(_0x4ccda5){case 0x3:if(_0x41dcd8[_0x552a('0x107')]>=_0x42cbd0[_0x552a('0x198')]-0x1){return!![];}else{this[_0x552a('0xff')]({'active':![],'countnoanswerretry':_0x41dcd8['countnoanswerretry']+=0x1,'scheduledat':moment()['add'](_0x42cbd0[_0x552a('0x199')],'minutes')[_0x552a('0x7c')](_0x552a('0x10b')),'ContactId':_0x41dcd8[_0x552a('0xda')],'ListId':_0x41dcd8[_0x552a('0xdb')],'VoiceQueueId':_0x41dcd8['VoiceQueueId']||undefined,'CampaignId':_0x41dcd8[_0x552a('0x102')]||undefined})['catch'](loggerCatch(_0x552a('0x19a')));}break;case 0x5:if(_0x41dcd8[_0x552a('0xf5')]>=_0x42cbd0['dialBusyMaxRetry']-0x1){return!![];}else{this[_0x552a('0xff')]({'active':![],'countbusyretry':_0x41dcd8[_0x552a('0xf5')]+=0x1,'scheduledat':moment()[_0x552a('0x100')](_0x42cbd0[_0x552a('0x19b')],_0x552a('0x10a'))[_0x552a('0x7c')](_0x552a('0x10b')),'ContactId':_0x41dcd8[_0x552a('0xda')],'ListId':_0x41dcd8[_0x552a('0xdb')],'VoiceQueueId':_0x41dcd8[_0x552a('0xdc')]||undefined,'CampaignId':_0x41dcd8[_0x552a('0x102')]||undefined})[_0x552a('0xb8')](loggerCatch(_0x552a('0x19c')));}break;case 0x8:if(_0x41dcd8['countcongestionretry']>=_0x42cbd0[_0x552a('0x19d')]-0x1){return!![];}else{this[_0x552a('0xff')]({'active':![],'countcongestionretry':_0x41dcd8['countcongestionretry']+=0x1,'scheduledat':moment()['add'](_0x42cbd0['dialCongestionRetryFrequency'],_0x552a('0x10a'))['format'](_0x552a('0x10b')),'ContactId':_0x41dcd8['ContactId'],'ListId':_0x41dcd8[_0x552a('0xdb')],'VoiceQueueId':_0x41dcd8['VoiceQueueId']||undefined,'CampaignId':_0x41dcd8[_0x552a('0x102')]||undefined})['catch'](loggerCatch(_0x552a('0x19e')));}break;case 0x0:if(_0x41dcd8[_0x552a('0x108')]>=_0x42cbd0[_0x552a('0x19f')]-0x1){return!![];}else{this[_0x552a('0xff')]({'active':![],'countnosuchnumberretry':_0x41dcd8[_0x552a('0x108')]+=0x1,'scheduledat':moment()[_0x552a('0x100')](_0x42cbd0[_0x552a('0x1a0')],_0x552a('0x10a'))[_0x552a('0x7c')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x41dcd8[_0x552a('0xda')],'ListId':_0x41dcd8[_0x552a('0xdb')],'VoiceQueueId':_0x41dcd8[_0x552a('0xdc')]||undefined,'CampaignId':_0x41dcd8[_0x552a('0x102')]||undefined})[_0x552a('0xb8')](loggerCatch(_0x552a('0x1a1')));}break;case 0xa:if(_0x41dcd8[_0x552a('0xf7')]>=_0x42cbd0[_0x552a('0x123')]-0x1){return!![];}else{this[_0x552a('0xff')]({'active':![],'countdropretry':_0x41dcd8['countdropretry']+=0x1,'scheduledat':moment()[_0x552a('0x100')](_0x42cbd0[_0x552a('0x125')],_0x552a('0x10a'))[_0x552a('0x7c')](_0x552a('0x10b')),'ContactId':_0x41dcd8[_0x552a('0xda')],'ListId':_0x41dcd8[_0x552a('0xdb')],'VoiceQueueId':_0x41dcd8['VoiceQueueId']||undefined,'CampaignId':_0x41dcd8[_0x552a('0x102')]||undefined})[_0x552a('0xb8')](loggerCatch(_0x552a('0x126')));}break;case 0xb:if(_0x41dcd8[_0x552a('0xf8')]>=_0x42cbd0[_0x552a('0x12b')]-0x1){return!![];}else{this[_0x552a('0xff')]({'active':![],'countabandonedretry':_0x41dcd8[_0x552a('0xf8')]+=0x1,'scheduledat':moment()[_0x552a('0x100')](_0x42cbd0['dialAbandonedRetryFrequency'],_0x552a('0x10a'))[_0x552a('0x7c')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x41dcd8[_0x552a('0xda')],'ListId':_0x41dcd8['ListId'],'VoiceQueueId':_0x41dcd8[_0x552a('0xdc')]||undefined,'CampaignId':_0x41dcd8[_0x552a('0x102')]||undefined})[_0x552a('0xb8')](loggerCatch(_0x552a('0x12c')));}break;case 0x13:if(_0x41dcd8[_0x552a('0xf2')]>=_0x42cbd0['dialMachineMaxRetry']-0x1){return!![];}else{this[_0x552a('0xff')]({'active':![],'countmachineretry':_0x41dcd8[_0x552a('0xf2')]+=0x1,'scheduledat':moment()[_0x552a('0x100')](_0x42cbd0[_0x552a('0x101')],'minutes')[_0x552a('0x7c')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x41dcd8[_0x552a('0xda')],'ListId':_0x41dcd8[_0x552a('0xdb')],'VoiceQueueId':_0x41dcd8['VoiceQueueId']||undefined,'CampaignId':_0x41dcd8[_0x552a('0x102')]||undefined})[_0x552a('0xb8')](loggerCatch(_0x552a('0x103')));}break;case 0x14:if(_0x41dcd8[_0x552a('0xf9')]>=_0x42cbd0[_0x552a('0x1a2')]-0x1){return!![];}else{this[_0x552a('0xff')]({'active':![],'countagentrejectretry':_0x41dcd8['countagentrejectretry']+=0x1,'scheduledat':moment()[_0x552a('0x100')](_0x42cbd0[_0x552a('0x1a3')],'minutes')['format']('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x41dcd8[_0x552a('0xda')],'ListId':_0x41dcd8['ListId'],'VoiceQueueId':_0x41dcd8[_0x552a('0xdc')]||undefined,'CampaignId':_0x41dcd8[_0x552a('0x102')]||undefined})[_0x552a('0xb8')](loggerCatch(_0x552a('0x1a4')));}break;default:return!![];}};Dialer['prototype']['callProgressDetecting']=function(_0x5ab74f,_0x330e09,_0xcfb0b1){var _0x50c82a=this;var _0x476fc9=new History(_0x5ab74f);return new BPromise(function(_0x5385c0,_0x3cd306){if(_[_0x552a('0x40')](_0x330e09)&&_0x552a('0x1a5')!==typeof _0x330e09){return _0x3cd306(msgResponse(_0x552a('0x1a6'),_0x552a('0x14b'),_0x552a('0x1a7')));}if(_[_0x552a('0x40')](_0xcfb0b1)&&_0x552a('0x1a5')!==typeof _0xcfb0b1){return _0x3cd306(msgResponse(_0x552a('0x1a6'),_0x552a('0x14b'),_0x552a('0x1a8')));}switch(_0xcfb0b1[_0x552a('0x114')]){case'0':_0x330e09[_0x552a('0x6a')]+=0x1;_0x476fc9[_0x552a('0xaa')]=0x0;_0x476fc9[_0x552a('0xab')]=_0x552a('0x1a9');_0x476fc9['countnosuchnumberretry']+=0x1;_0x476fc9[_0x552a('0x106')]+=0x1;ami[_0x552a('0x50')]('custom:agentnosuchnumber',ut[_0x552a('0x1aa')](_0x5ab74f,_0x552a('0x1ab')));_0x50c82a['createHistory'](_0x476fc9)['catch'](loggerCatch(_0x552a('0xf4')));if(_0x50c82a[_0x552a('0x197')](0x0,_0x5ab74f,_0x330e09)){if(_0x476fc9['countnosuchnumberretry']>=_0x330e09[_0x552a('0x19f')]){_0x50c82a[_0x552a('0xfd')](_0x476fc9,_0x5385c0,_0x3cd306,_0x552a('0x1ac'));}else{_0x50c82a[_0x552a('0xfb')](_0x476fc9,_0x5385c0,_0x3cd306,'reason\x200\x20no\x20such\x20number....');}}break;case'3':_0x330e09[_0x552a('0x1ad')]+=0x1;_0x476fc9[_0x552a('0xaa')]=0x3;_0x476fc9['statedesc']=_0x552a('0x1ae');_0x476fc9[_0x552a('0x107')]+=0x1;_0x476fc9['countglobal']+=0x1;ami[_0x552a('0x50')](_0x552a('0x1af'),ut[_0x552a('0x1aa')](_0x5ab74f,_0x552a('0x1b0')));_0x50c82a[_0x552a('0xd1')](_0x476fc9)[_0x552a('0xb8')](loggerCatch(_0x552a('0x1b1')));if(_0x50c82a[_0x552a('0x197')](0x3,_0x5ab74f,_0x330e09)){if(_0x476fc9['countnoanswerretry']>=_0x330e09[_0x552a('0x198')]){_0x50c82a[_0x552a('0xfd')](_0x476fc9,_0x5385c0,_0x3cd306,_0x552a('0x1b2'));}else{_0x50c82a[_0x552a('0xfb')](_0x476fc9,_0x5385c0,_0x3cd306,_0x552a('0x1b2'));}}break;case'5':_0x330e09[_0x552a('0x66')]+=0x1;_0x476fc9[_0x552a('0xaa')]=0x5;_0x476fc9[_0x552a('0xab')]=_0x552a('0x1b3');_0x476fc9[_0x552a('0xf5')]+=0x1;_0x476fc9[_0x552a('0x106')]+=0x1;ami[_0x552a('0x50')](_0x552a('0x1b4'),ut[_0x552a('0x1aa')](_0x5ab74f,_0x552a('0x1b5')));_0x50c82a['createHistory'](_0x476fc9)['catch'](loggerCatch(_0x552a('0x1b6')));if(_0x50c82a['checkRetriveMax'](0x5,_0x5ab74f,_0x330e09)){if(_0x476fc9[_0x552a('0xf5')]>=_0x330e09['dialBusyMaxRetry']){_0x50c82a[_0x552a('0xfd')](_0x476fc9,_0x5385c0,_0x3cd306,'reason\x205\x20busy');}else{_0x50c82a['stateGlobal'](_0x476fc9,_0x5385c0,_0x3cd306,'reason\x205\x20busy');}}break;case'8':_0x330e09[_0x552a('0x67')]+=0x1;_0x476fc9['state']=0x8;_0x476fc9[_0x552a('0xab')]=_0x552a('0x1b7');_0x476fc9['countcongestionretry']+=0x1;_0x476fc9[_0x552a('0x106')]+=0x1;ami[_0x552a('0x50')](_0x552a('0x1b8'),ut[_0x552a('0x1aa')](_0x5ab74f,_0x552a('0x1b9')));_0x50c82a[_0x552a('0xd1')](_0x476fc9)[_0x552a('0xb8')](loggerCatch('[syncAgentComplete][createHistory][8]'));if(_0x50c82a[_0x552a('0x197')](0x8,_0x5ab74f,_0x330e09)){if(_0x476fc9[_0x552a('0xf6')]>=_0x330e09['dialCongestionMaxRetry']){_0x50c82a[_0x552a('0xfd')](_0x476fc9,_0x5385c0,_0x3cd306,_0x552a('0x1ba'));}else{_0x50c82a['stateGlobal'](_0x476fc9,_0x5385c0,_0x3cd306,_0x552a('0x1ba'));}}break;case'11':_0x330e09['outboundAbandonedCallsDay']+=0x1;_0x476fc9[_0x552a('0xaa')]=0xb;_0x476fc9[_0x552a('0xab')]=_0x552a('0x12d');_0x476fc9[_0x552a('0xf8')]+=0x1;_0x476fc9[_0x552a('0x106')]+=0x1;_0x50c82a[_0x552a('0xd1')](_0x476fc9)[_0x552a('0xb8')](loggerCatch('[syncAgentComplete][createHistory][11]'));if(_0x50c82a[_0x552a('0x197')](0xb,_0x5ab74f,_0x330e09)){if(_0x476fc9['countabandonedretry']>=_0x330e09[_0x552a('0x12b')]){_0x50c82a['createStateFinal'](_0x476fc9,_0x5385c0,_0x3cd306,'reason\x2011\x20abandoned');}else{_0x50c82a['stateGlobal'](_0x476fc9,_0x5385c0,_0x3cd306,_0x552a('0x1bb'));}}break;case'20':_0x330e09[_0x552a('0x1bc')]+=0x1;_0x476fc9[_0x552a('0xaa')]=0x14;_0x476fc9[_0x552a('0xab')]='AgentReject';_0x476fc9['countagentrejectretry']+=0x1;_0x476fc9[_0x552a('0x106')]+=0x1;ami[_0x552a('0x50')](_0x552a('0x1bd'),ut[_0x552a('0x1aa')](_0x5ab74f,_0x552a('0x1be')));_0x50c82a[_0x552a('0xd1')](_0x476fc9)[_0x552a('0xb8')](loggerCatch('[syncAgentComplete][createHistory][20]'));if(_0x50c82a[_0x552a('0x197')](0x14,_0x5ab74f,_0x330e09)){if(_0x476fc9['countagentrejectretry']>=_0x330e09[_0x552a('0x1a2')]){_0x50c82a['createStateFinal'](_0x476fc9,_0x5385c0,_0x3cd306,_0x552a('0x1bf'));}else{_0x50c82a['stateGlobal'](_0x476fc9,_0x5385c0,_0x3cd306,_0x552a('0x1bf'));}}break;default:_0x330e09[_0x552a('0x6c')]+=0x1;_0x476fc9[_0x552a('0xaa')]=0xc;_0x476fc9['statedesc']=_0xcfb0b1[_0x552a('0x114')];_0x50c82a[_0x552a('0xd1')](_0x476fc9)[_0x552a('0xb8')](loggerCatch('[syncAgentComplete][createHistory][?]'));if(_0x50c82a[_0x552a('0x197')](_0xcfb0b1['reason'],_0x5ab74f,_0x330e09)){if(_0x476fc9[_0x552a('0xf5')]+_0x476fc9[_0x552a('0xf6')]+_0x476fc9[_0x552a('0x107')]+_0x476fc9[_0x552a('0x108')]+_0x476fc9[_0x552a('0xf7')]+_0x476fc9[_0x552a('0xf8')]+_0x476fc9[_0x552a('0xf2')]+_0x476fc9[_0x552a('0xf9')]>=_0x330e09[_0x552a('0xfa')]){_0x50c82a['stateGlobal'](_0x476fc9,_0x5385c0,_0x3cd306,_0xcfb0b1['reason']);}else{_0x50c82a[_0x552a('0xfd')](_0x476fc9,_0x5385c0,_0x3cd306,_0xcfb0b1[_0x552a('0x114')]);}}}});};Dialer[_0x552a('0xae')][_0x552a('0xfb')]=function(_0x3886c8,_0x81ab8d,_0x4cfc46,_0x1fe9ab){var _0x51371c=new Final(_0x3886c8);_0x51371c[_0x552a('0xaa')]=0xf;_0x51371c['statedesc']='Global';this[_0x552a('0xfd')](_0x51371c,_0x81ab8d,_0x4cfc46,_0x1fe9ab);};Dialer['prototype'][_0x552a('0xfd')]=function(_0x176c58,_0x1d9b67,_0x3578e2,_0x4cb271){this[_0x552a('0xcf')](_0x176c58)[_0x552a('0xc5')](function(_0x58e98d){return _0x1d9b67(msgResponse(_0x552a('0x1a6'),'Success',_0x4cb271));})[_0x552a('0xb8')](function(_0xd0a1b){return _0x3578e2(msgResponse(_0x552a('0x1c0'),_0x552a('0x14b'),_0x552a('0x1c1')));});};Dialer['prototype'][_0x552a('0xb')]=function(_0x453262){var _0x501305=this;var _0x539388=_0x453262[_0x552a('0x1c2')]/0x64;var _0x222a0a=_0x453262[_0x552a('0x11e')]/(_0x453262[_0x552a('0x11e')]+_0x453262[_0x552a('0x64')]);var _0x229926=Math[_0x552a('0x1c3')](_0x453262[_0x552a('0x74')]*(_0x453262[_0x552a('0x1c4')]/0x64));var _0x5e6abf=Math[_0x552a('0x1c3')](_0x453262['predictiveIntervalAvailable']*(_0x453262[_0x552a('0x1c5')]/0x64));var _0x371e96=_0x453262['available']+_0x453262['talking'];var _0x1b95b9=Math[_0x552a('0x1c6')](_0x453262['erlangCalls']*_0x453262['erlangAbandonmentRate']*_0x453262[_0x552a('0x1c7')]*_0x453262['predictiveIntervalMultiplicativeFactor']);if(_[_0x552a('0x40')](_0x453262[_0x552a('0x2b')])){if(!_[_0x552a('0x40')](_0x453262['startPredictive'])){_0x453262[_0x552a('0x2a')]=undefined;loggerPredictive['error'](_0x552a('0x1c8'),'check\x20predictive\x20is\x20not\x20undefine');}if(!_[_0x552a('0x40')](_0x453262['handlePredictive'])){loggerPredictive[_0x552a('0x97')](_0x552a('0x1c8'),_0x552a('0x1c9'));clearInterval(_0x453262['handlePredictive']);_0x453262['handlePredictive']=undefined;}_0x453262[_0x552a('0x2b')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');loggerPredictive['info'](_0x453262[_0x552a('0x43')],_0x552a('0x1ca'),_0x453262[_0x552a('0x2b')]);this[_0x552a('0x15f')](_0x453262,0x1);}else if(ifInterval(_0x453262['dialPredictiveInterval'],_0x453262[_0x552a('0x2b')])){this[_0x552a('0x15f')](_0x453262,0x1);loggerPredictiveCalls[_0x552a('0x82')](_0x552a('0x1cb'),_0x453262['startProgressive'],_0x453262[_0x552a('0x43')]);_0x453262[_0x552a('0x8d')]=0x0;_0x453262[_0x552a('0x71')]=0x0;}else if(_0x539388<_0x222a0a&&_0x453262[_0x552a('0x1cc')]===_0x552a('0x1cd')){freeVariablesPredictive(_0x453262);loggerPredictive[_0x552a('0x82')](_0x552a('0x1ce'),_0x552a('0x1cf'),_0x222a0a,'startProgressive',_0x453262['name']);}else if(_0x1b95b9<_0x453262[_0x552a('0x71')]&&_0x453262[_0x552a('0x1cc')]===_0x552a('0x1cd')){freeVariablesPredictive(_0x453262);loggerPredictive[_0x552a('0x82')](_0x552a('0x1d0'),_0x552a('0x1d1'),_0x1b95b9,'Drop\x20in\x20this\x20interval',_0x453262[_0x552a('0x71')],'startProgressive',_0x453262['name']);}else if(!ifInterval(_0x453262['dialPredictiveInterval'],_0x453262[_0x552a('0x2b')])&&_[_0x552a('0x40')](_0x453262[_0x552a('0x2a')])&&!_[_0x552a('0x40')](_0x453262[_0x552a('0x2b')])){_0x453262['startPredictive']=moment()['format'](_0x552a('0x10b'));loggerPredictive[_0x552a('0x82')](_0x453262[_0x552a('0x43')],_0x552a('0x1d2'),_0x453262['startPredictive']);this[_0x552a('0xc4')](_0x453262[_0x552a('0x1d3')])[_0x552a('0xc5')](this['getDataPredictive'](_0x453262))['then'](mergeDataErlangB(_0x453262))[_0x552a('0xc5')](this[_0x552a('0x1d4')](_0x453262))[_0x552a('0xb8')](loggerCatchPredictive(_0x552a('0x1d5'),_0x453262));}else if(!ifInterval(_0x453262[_0x552a('0x1d3')],_0x453262[_0x552a('0x2a')])){_0x453262['predictiveIntervalErlangCallsDroppedCalls']=0x0;_0x453262[_0x552a('0x2a')]=moment()[_0x552a('0x7c')](_0x552a('0x10b'));loggerPredictive[_0x552a('0x82')](_0x453262['name'],'recalculate\x20predictive\x20at',_0x453262['startPredictive']);clearInterval(_0x453262[_0x552a('0x93')]);_0x453262['handlePredictive']=undefined;this['averageHandleTime'](_0x453262['dialPredictiveInterval'])[_0x552a('0xc5')](this[_0x552a('0x1d6')](_0x453262))['then'](mergeDataErlangB(_0x453262))['then'](this[_0x552a('0x1d4')](_0x453262))[_0x552a('0xb8')](loggerCatchPredictive('Predictive\x20for\x20every\x20interval',_0x453262));}else if(_0x453262['predictiveIntervalAvailable']&&_0x371e96<_0x453262[_0x552a('0x74')]-_0x5e6abf){freeVariablesPredictive(_0x453262);loggerPredictive[_0x552a('0x82')](_0x453262[_0x552a('0x43')],_0x552a('0x1d7'),_0x371e96,_0x552a('0x1d8'),_0x453262[_0x552a('0x74')],'-',_0x5e6abf,'=',_0x453262[_0x552a('0x74')]-_0x5e6abf,')');}else if(_0x453262[_0x552a('0x74')]&&_0x371e96>_0x453262[_0x552a('0x74')]+_0x229926){freeVariablesPredictive(_0x453262);loggerPredictive[_0x552a('0x82')](_0x453262[_0x552a('0x43')],_0x552a('0x1d7'),_0x371e96,_0x552a('0x1d9'),_0x453262[_0x552a('0x74')],'+',_0x229926,'=',_0x453262['predictiveIntervalAvailable']+_0x229926,')');}};Dialer['prototype']['getDataPredictive']=function(_0x526e83){var _0x25fde5=this;return function(_0x30ea76){return new BPromise(function(_0x4b9556,_0x13e11e){_[_0x552a('0xd8')](_0x526e83,_0x30ea76[0x0]);if(checkGetDataPredictive(_0x30ea76[0x0])){var _0x34fc24=_0x526e83[_0x552a('0x74')]=_0x526e83['talking']+_0x526e83[_0x552a('0x54')];var _0x496649=_0x526e83[_0x552a('0x1d3')]*0x3c;var _0x45e730=_0x30ea76[0x0][_0x552a('0x87')]+_0x30ea76[0x0]['predictiveIntervalAvgHoldtime'];var _0x388b91=(_0x30ea76[0x0][_0x552a('0x6d')]+_0x30ea76[0x0][_0x552a('0x70')]+_0x30ea76[0x0][_0x552a('0x6f')])/_0x30ea76[0x0][_0x552a('0x75')];_0x526e83[_0x552a('0x1c7')]=_0x388b91>0x0?_0x388b91:0x1;switch(_0x526e83['dialPredictiveOptimization']){case'dropRate':var _0x2570fb=_0x526e83['dialPredictiveOptimizationPercentage']/0x64;return _0x25fde5['abandonmentRate'](_0x34fc24,_0x496649,_0x45e730,_0x388b91,_0x2570fb)[_0x552a('0xc5')](function(_0x532ae6){return _0x4b9556(_0x532ae6);});case'agentBusyFactor':var _0x3526c3=_0x526e83[_0x552a('0x1c2')]/0x64;return _0x25fde5[_0x552a('0x1da')](_0x34fc24,_0x496649,_0x45e730,_0x388b91,_0x3526c3)[_0x552a('0xc5')](function(_0x189f52){return _0x4b9556(_0x189f52);});default:return _0x13e11e(msgResponse(_0x552a('0x1db'),_0x552a('0x14b'),'Unknown\x20Predictive'));}}else{return _0x13e11e(msgResponse(_0x552a('0x1db'),'Failure',_0x552a('0x1dc')));}});};};Dialer[_0x552a('0xae')][_0x552a('0x1dd')]=function(_0x1c4ebe){var _0x49c106=this;return function(_0x385dfb){return new BPromise(function(_0x406f6a,_0x357c98){_['merge'](_0x1c4ebe,_0x385dfb[0x0]);if(checkGetDataPredictive(_0x385dfb[0x0])){loggerPredictive['info'](JSON[_0x552a('0x4c')](_0x385dfb[0x0]));if(_0x1c4ebe[_0x552a('0x1cc')]===_0x552a('0x1cd')){return _0x49c106[_0x552a('0xcd')](_0x1c4ebe['id'])[_0x552a('0xc5')](function(_0x38509d){var _0x45515a=_0x1c4ebe[_0x552a('0x55')]-_0x38509d[0x0][_0x552a('0x1de')];var _0x2b6459=_0x1c4ebe['dialPredictiveInterval']*0x3c;var _0x279f89=_0x385dfb[0x0]['predictiveIntervalAvgTalktime']+_0x385dfb[0x0]['predictiveIntervalAvgHoldtime'];var _0x6127be=(_0x385dfb[0x0]['predictiveIntervalAnsweredCalls']+_0x385dfb[0x0][_0x552a('0x70')]+_0x385dfb[0x0][_0x552a('0x6f')])/_0x385dfb[0x0][_0x552a('0x75')];var _0x360a36=_0x1c4ebe[_0x552a('0x1c2')]/0x64;_0x1c4ebe[_0x552a('0x73')]=_0x38509d[0x0][_0x552a('0x1de')]||0x0;_0x1c4ebe[_0x552a('0x1c7')]=_0x6127be>0x0?_0x6127be:0x1;return _0x49c106[_0x552a('0x1df')](_0x45515a,_0x2b6459,_0x279f89,_0x6127be,_0x360a36);})[_0x552a('0xc5')](function(_0x1ec7c1){return _0x406f6a(_0x1ec7c1);})[_0x552a('0xb8')](function(_0x4fb5fa){return _0x357c98(msgResponse(_0x552a('0x1e0'),_0x552a('0x14b'),JSON['stringify'](_0x4fb5fa)));});}if(_0x1c4ebe[_0x552a('0x1cc')]==='agentBusyFactor'){return _0x49c106[_0x552a('0xcd')](_0x1c4ebe['id'])['then'](function(_0x54bd9e){var _0x384c65=_0x1c4ebe['loggedIn']-_0x54bd9e[0x0][_0x552a('0x1de')];var _0xad447d=_0x1c4ebe['dialPredictiveInterval']*0x3c;var _0x5d5914=_0x385dfb[0x0]['predictiveIntervalAvgTalktime']+_0x385dfb[0x0][_0x552a('0x6e')];var _0x1d0194=(_0x385dfb[0x0]['predictiveIntervalAnsweredCalls']+_0x385dfb[0x0][_0x552a('0x70')]+_0x385dfb[0x0][_0x552a('0x6f')])/_0x385dfb[0x0][_0x552a('0x75')];var _0x544629=_0x1c4ebe[_0x552a('0x1c2')]/0x64;_0x1c4ebe['predictiveIntervalPauses']=_0x54bd9e[0x0][_0x552a('0x1de')]||0x0;_0x1c4ebe[_0x552a('0x1c7')]=_0x1d0194>0x0?_0x1d0194:0x1;return _0x49c106[_0x552a('0x1da')](_0x384c65,_0xad447d,_0x5d5914,_0x1d0194,_0x544629);})[_0x552a('0xc5')](function(_0x5ade20){return _0x406f6a(_0x5ade20);})[_0x552a('0xb8')](function(_0x4650ee){return _0x357c98(msgResponse(_0x552a('0x1e0'),'Failure',JSON[_0x552a('0x4c')](_0x4650ee)));});}}else{return _0x357c98(msgResponse(_0x552a('0x1db'),'Failure',_0x552a('0x1dc')));}});};};Dialer[_0x552a('0xae')][_0x552a('0x1d4')]=function(_0x6d38fd){var _0x1963ed=this;return function(){var _0x5c014e=0x0;var _0x592dc7=Math[_0x552a('0x1c6')](_0x6d38fd[_0x552a('0x1e1')]*0x3e8);if(_0x592dc7>0x0){_0x592dc7=_0x592dc7<0x64?0x64:_0x592dc7;loggerPredictive['info'](_0x6d38fd['name'],_0x552a('0x1e2'),_0x592dc7,_0x552a('0x4d'));_0x6d38fd[_0x552a('0x93')]=setInterval(function(){_0x1963ed[_0x552a('0x93')](_0x6d38fd);loggerPredictiveCalls[_0x552a('0x82')](_0x552a('0x1e3'),_0x5c014e+=0x1);},_0x592dc7);}else{loggerPredictive[_0x552a('0x82')](_0x6d38fd[_0x552a('0x43')],_0x552a('0x1e4'));}};};Dialer[_0x552a('0xae')]['checkContactBlack']=function(_0x22ead9,_0x2b720b){var _0x4b0458=this;return function(_0x19ea71){if(_[_0x552a('0x4a')](_0x19ea71)){if(_[_0x552a('0xb4')](_0x2b720b[_0x552a('0x1e5')])||!_0x2b720b['recallme']){if(_0x22ead9['dialMethod']===_0x552a('0xa')){_0x22ead9['queueStatusComplete']=_['isUndefined'](_0x22ead9[_0x552a('0x138')])?!![]:_0x22ead9[_0x552a('0x138')];var _0x5cd2cc=uuid['v4']();_0x4b0458[_0x552a('0x27')][_0x5cd2cc]=new Action(_0x22ead9,_0x2b720b,_0x5cd2cc);loggerBooked[_0x552a('0x82')](_0x552a('0x1e6'),_0x5cd2cc,'queueStatusComplete:\x20',JSON[_0x552a('0x4c')](_0x22ead9['queueStatusComplete']),_0x552a('0x1e7'),_0x22ead9[_0x552a('0x43')]);if(_0x22ead9['queueStatusComplete']){_0x22ead9[_0x552a('0x138')]=![];_0x4b0458[_0x552a('0x135')][_0x4b0458[_0x552a('0x27')][_0x5cd2cc]['queue']]=[];ami[_0x552a('0xb5')]({'actionid':_0x5cd2cc,'action':_0x552a('0x1e8'),'queue':_0x22ead9[_0x552a('0x43')]})[_0x552a('0xb8')](function(_0x1442f2){_0x4b0458['updateOriginated'](_0x22ead9);_0x4b0458['rescheduleContact']({'active':![],'ContactId':_0x4b0458[_0x552a('0x27')][_0x5cd2cc][_0x552a('0xda')],'ListId':_0x4b0458[_0x552a('0x27')][_0x5cd2cc]['ListId'],'VoiceQueueId':_0x4b0458[_0x552a('0x27')][_0x5cd2cc][_0x552a('0xdc')]||undefined,'CampaignId':_0x4b0458[_0x552a('0x27')][_0x5cd2cc]['CampaignId']||undefined})['catch'](loggerCatch(_0x552a('0x1e9')));delete _0x4b0458[_0x552a('0x27')][_0x5cd2cc];});}else{loggerBooked['info'](_0x552a('0x1ea'),JSON[_0x552a('0x4c')](_0x22ead9['queueStatusComplete']),_0x552a('0x1e7'),_0x22ead9[_0x552a('0x43')]);_0x4b0458['updateOriginated'](_0x22ead9);_0x4b0458[_0x552a('0xff')]({'active':![],'ContactId':_0x4b0458['actions'][_0x5cd2cc][_0x552a('0xda')],'ListId':_0x4b0458[_0x552a('0x27')][_0x5cd2cc][_0x552a('0xdb')],'VoiceQueueId':_0x4b0458[_0x552a('0x27')][_0x5cd2cc][_0x552a('0xdc')]||undefined,'CampaignId':_0x4b0458[_0x552a('0x27')][_0x5cd2cc][_0x552a('0x102')]||undefined})['catch'](loggerCatch(_0x552a('0x1e9')));delete _0x4b0458[_0x552a('0x27')][_0x5cd2cc];}}else{return _0x4b0458['actionOriginate'](_0x22ead9,_0x2b720b);}}else{if(getDiff(_0x2b720b[_0x552a('0x1eb')])<_0x22ead9[_0x552a('0x1ec')]*0x3c){if(_0x2b720b[_0x552a('0x1ed')]&&!_0x2b720b[_0x552a('0x1ed')][_0x552a('0x1ee')]){_0x4b0458[_0x552a('0x21')]['run'](_0x2b720b['id'])[_0x552a('0x20')](function(){_0x4b0458[_0x552a('0xba')](_0x22ead9);});}else{_0x4b0458[_0x552a('0xc9')]({'active':![]},_0x2b720b['id'],0x1)[_0x552a('0x20')](function(){console['log'](_0x552a('0x1ef'));_0x4b0458[_0x552a('0xba')](_0x22ead9);});}}else{_0x22ead9['outboundReCallsDay']+=0x1;_0x4b0458[_0x552a('0xba')](_0x22ead9);if(_0x22ead9[_0x552a('0x1f0')]){_0x4b0458[_0x552a('0xff')]({'active':![],'recallme':![],'UserId':null,'ContactId':_0x2b720b[_0x552a('0xda')],'ListId':_0x2b720b[_0x552a('0xdb')],'VoiceQueueId':_0x2b720b[_0x552a('0xdc')]||undefined,'CampaignId':_0x2b720b[_0x552a('0x102')]||undefined})[_0x552a('0xb8')](loggerCatch(_0x552a('0x1f1')));_0x4b0458['createHistory'](createObjHistory(_0x22ead9,_0x2b720b,_0x552a('0x1f2'),0x17,_0x552a('0x1f3')))[_0x552a('0xb8')](loggerCatch(_0x552a('0x1f4')));}else{_0x4b0458[_0x552a('0xd7')](createObjHistory(_0x22ead9,_0x2b720b,'RECALLFAILEDTIMEOUT',0x16,_0x552a('0x1f5')),_0x552a('0x1f6'),'[Originate][HistoryRecallClose]');}}}}else{_0x22ead9['outboundBlacklistCallsDay']+=0x1;_0x4b0458['saveInDb'](createObjHistory(_0x22ead9,_0x2b720b,_0x552a('0x1f7'),0xd,_0x552a('0x1f8')),_0x552a('0x1f9'),_0x552a('0x1fa'));throw _0x552a('0x1fb');}};};Dialer[_0x552a('0xae')][_0x552a('0x1fc')]=function(_0x4c9ee3){var _0x572a86=this;var _0x11dd40=[];var _0x45ac48=_0x4c9ee3['limitCalls']-_0x4c9ee3[_0x552a('0x76')]-_0x4c9ee3[_0x552a('0x1fd')];emitCampaignSummary(_0x4c9ee3);if(_0x45ac48>0x0){if(_0x45ac48>this[_0x552a('0x26')]){_0x45ac48=this[_0x552a('0x26')];}_0x4c9ee3[_0x552a('0x1fd')]+=_0x45ac48;this[_0x552a('0xcb')](_0x4c9ee3['id'],_0x45ac48,_0x4c9ee3[_0x552a('0x1fe')])[_0x552a('0xc5')](function(_0x118e6b){_0x4c9ee3[_0x552a('0x1fd')]-=_0x45ac48;_0x4c9ee3[_0x552a('0x1fd')]=_0x4c9ee3['temp']>0x0?_0x4c9ee3[_0x552a('0x1fd')]:0x0;if(!checkContactEmpty(_0x118e6b)){_0x4c9ee3[_0x552a('0x41')]=_0x552a('0xa1');logger['info'](_0x552a('0x1ff')+_0x4c9ee3[_0x552a('0x43')]);}else{_0x4c9ee3[_0x552a('0x76')]+=_0x118e6b[_0x552a('0x9a')];_0x4c9ee3['message']=_0x552a('0x200');for(var _0x4e9fe6=0x0;_0x4e9fe6<_0x118e6b[_0x552a('0x9a')];_0x4e9fe6+=0x1){_0x4c9ee3['ivrTotalCallsDays']+=0x1;if(_[_0x552a('0xb4')](_0x118e6b[_0x4e9fe6])||_[_0x552a('0xb4')](_0x118e6b[_0x4e9fe6][_0x552a('0x16e')])||_[_0x552a('0xb4')](_0x118e6b[_0x4e9fe6]['Contact'][_0x552a('0x16d')])){_0x572a86['emptyContact']('[actionOriginate]\x20',_0x4c9ee3,_0x118e6b[_0x4e9fe6]);}else{_0x572a86[_0x552a('0xc2')](_['pick'](_0x118e6b[_0x4e9fe6],['CampaignId','Contact.phone']))[_0x552a('0xc5')](_0x572a86[_0x552a('0x201')](_0x4c9ee3,_0x118e6b[_0x4e9fe6]))[_0x552a('0xb8')](_0x572a86[_0x552a('0x202')](_0x552a('0x203'),_0x4c9ee3));}}}})[_0x552a('0xb8')](loggerGetContactDialer(_0x552a('0x204'),_0x4c9ee3,_0x45ac48));}};Dialer[_0x552a('0xae')]['handlePower']=function(_0x39131a,_0x50fd8b){var _0x540dfa=this;var _0x542a7f=[];var _0x322b22=_0x50fd8b>=0x1?_0x50fd8b:0x1;var _0xbb55cd=[];if(_0x39131a[_0x552a('0x5f')]===_0x552a('0xa')){_0x322b22=0x1;}var _0x4379e3=Math['floor'](_0x39131a[_0x552a('0x54')]*_0x322b22)-_0x39131a[_0x552a('0x76')]-_0x39131a[_0x552a('0x1fd')];emitVoiceQueueSummary(_0x39131a);if(_0x39131a[_0x552a('0x205')]>0x0){var _0x4af52a=_0x39131a[_0x552a('0x205')]-_0x39131a['originated']-_0x39131a[_0x552a('0x58')]-_0x39131a[_0x552a('0x1fd')]-_0x39131a[_0x552a('0x206')];if(_0x4379e3>_0x4af52a){_0x4379e3=_0x4af52a;}}if(_0x4379e3>0x0){if(_0x39131a['dialMethod']===_0x552a('0xa')){_0x4379e3=0x1;}if(_0x4379e3>this['maxNumberOriginate']){_0x4379e3=this[_0x552a('0x26')];}_0x39131a[_0x552a('0x1fd')]+=_0x4379e3;for(var _0x2c419a in this['agents']){if(this[_0x552a('0x24')][_0x552a('0x9b')](_0x2c419a)){if(this[_0x552a('0x24')][_0x2c419a][_0x552a('0xaa')]===_0x552a('0x207')&&this[_0x552a('0x24')][_0x2c419a][_0x552a('0xb6')]===_0x552a('0xe2')){_0x542a7f[_0x552a('0x136')](this[_0x552a('0x24')][_0x2c419a]['id']);}}}this[_0x552a('0xca')](_0x39131a['id'],_0x542a7f,_0x4379e3,_0x39131a[_0x552a('0x1fe')])['then'](function(_0x1c337a){_0x39131a['temp']-=_0x4379e3;_0x39131a[_0x552a('0x1fd')]=_0x39131a[_0x552a('0x1fd')]>0x0?_0x39131a['temp']:0x0;if(!checkContactEmpty(_0x1c337a)){_0x540dfa[_0x552a('0xbe')](_0x39131a)['then'](sendMessageReschedule(_0x39131a))[_0x552a('0xb8')](loggerCatch(_0x552a('0xc0')));}else{_0x39131a['originated']+=_0x1c337a[_0x552a('0x9a')];_0x39131a['message']=_0x39131a['dialMethod']===_0x552a('0xa')?_0x552a('0x208'):_0x552a('0x200');for(var _0x3f73db=0x0;_0x3f73db<_0x1c337a[_0x552a('0x9a')];_0x3f73db+=0x1){if(_[_0x552a('0xb4')](_0x1c337a[_0x3f73db])||_[_0x552a('0xb4')](_0x1c337a[_0x3f73db]['Contact'])||_[_0x552a('0xb4')](_0x1c337a[_0x3f73db]['Contact'][_0x552a('0x16d')])){_0x540dfa['emptyContact'](_0x552a('0x209'),_0x39131a,_0x1c337a[_0x3f73db]);}else{_0x540dfa[_0x552a('0xc1')](_[_0x552a('0xd9')](_0x1c337a[_0x3f73db],['VoiceQueueId','Contact.phone']))[_0x552a('0xc5')](_0x540dfa[_0x552a('0x201')](_0x39131a,_0x1c337a[_0x3f73db]))[_0x552a('0xb8')](_0x540dfa['loggerHandler'](_0x552a('0x209'),_0x39131a));}}}})[_0x552a('0xb8')](loggerGetContactDialer(_0x552a('0x20a'),_0x39131a,_0x4379e3));}};Dialer[_0x552a('0xae')][_0x552a('0x93')]=function(_0x3c6912){var _0x5869be=this;if(_0x3c6912[_0x552a('0x205')]>0x0){var _0x1c8911=_0x3c6912[_0x552a('0x205')]-_0x3c6912['originated']-_0x3c6912[_0x552a('0x58')];if(_0x1c8911>0x0){this[_0x552a('0x20b')](_0x3c6912);}else{loggerPredictiveCalls[_0x552a('0x82')](_0x552a('0x20c'));}}else{this[_0x552a('0x20b')](_0x3c6912);}};Dialer[_0x552a('0xae')][_0x552a('0x20b')]=function(_0x179814){var _0x169074=this;var _0xc8fefe=[];_0x179814['originated']+=0x1;for(var _0x1ab8c7 in this[_0x552a('0x24')]){if(this[_0x552a('0x24')]['hasOwnProperty'](_0x1ab8c7)){if(this[_0x552a('0x24')][_0x1ab8c7][_0x552a('0xaa')]===_0x552a('0x207')&&this[_0x552a('0x24')][_0x1ab8c7][_0x552a('0xb6')]===_0x552a('0xe2')){_0xc8fefe['push'](this['agents'][_0x1ab8c7]['id']);}}}this[_0x552a('0xca')](_0x179814['id'],_0xc8fefe,0x1,_0x179814[_0x552a('0x1fe')])[_0x552a('0xc5')](function(_0x4ad218){if(!checkContactEmpty(_0x4ad218)){checkContactLowerLimitOriginate(_0x179814,0x1,0x0);_0x169074[_0x552a('0xbe')](_0x179814)[_0x552a('0xc5')](sendMessageReschedule(_0x179814))[_0x552a('0xb8')](loggerCatch(_0x552a('0xc0')));}else{_0x179814[_0x552a('0x41')]=_0x552a('0x200');if(_[_0x552a('0xb4')](_0x4ad218[0x0])||_[_0x552a('0xb4')](_0x4ad218[0x0]['Contact'])||_[_0x552a('0xb4')](_0x4ad218[0x0][_0x552a('0x16e')][_0x552a('0x16d')])){_0x169074[_0x552a('0xd5')](_0x552a('0x209'),_0x179814,_0x4ad218[0x0]);}else{_0x169074[_0x552a('0xc1')](_[_0x552a('0xd9')](_0x4ad218[0x0],[_0x552a('0xdc'),_0x552a('0x20d')]))[_0x552a('0xc5')](_0x169074['checkContactBlack'](_0x179814,_0x4ad218[0x0]))[_0x552a('0xb8')](_0x169074['loggerHandler']('[actionOriginatePredictive]\x20',_0x179814));}}})['catch'](loggerGetContactDialer(_0x552a('0x20e'),_0x179814,0x1));emitVoiceQueueSummary(_0x179814);};Dialer[_0x552a('0xae')][_0x552a('0x1df')]=function(_0x570e56,_0x2c0e08,_0x48447a,_0x312a74,_0x4abc65,_0x3257ea){loggerPredictive[_0x552a('0x82')](_0x552a('0x20f'));loggerPredictive[_0x552a('0x82')](_0x552a('0x210'),_0x570e56);loggerPredictive[_0x552a('0x82')](_0x552a('0x211'),_0x2c0e08);loggerPredictive[_0x552a('0x82')]('Ts:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x48447a);loggerPredictive[_0x552a('0x82')](_0x552a('0x212'),_0x312a74);loggerPredictive['info']('Amax:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x4abc65);loggerPredictive[_0x552a('0x82')](_0x552a('0x88'));return new BPromise(function(_0x1ca699,_0x4a8fa5){if(_0x570e56<=0x0||isNaN(_0x570e56)){return _0x4a8fa5(msgResponse(_0x552a('0x213'),_0x552a('0x4b'),_0x552a('0x214')+_0x570e56));}if(_0x48447a<=0x0||isNaN(_0x48447a)){return _0x4a8fa5(msgResponse(_0x552a('0x213'),_0x552a('0x4b'),_0x552a('0x215')+_0x48447a));}if(_0x312a74<=0x0||isNaN(_0x312a74)){return _0x4a8fa5(msgResponse(_0x552a('0x213'),_0x552a('0x4b'),'p\x20=\x20'+_0x312a74));}if(_0x2c0e08<=0x0||isNaN(_0x2c0e08)){return _0x4a8fa5(msgResponse(_0x552a('0x213'),_0x552a('0x4b'),_0x552a('0x216')+_0x2c0e08));}if(_0x4abc65<=0x0||isNaN(_0x4abc65)){return _0x4a8fa5(msgResponse('[abandonmentRate]',_0x552a('0x4b'),'Amax\x20=\x20'+_0x4abc65));}_0x3257ea=_0x3257ea||0x0;var _0x5875cf=0x1/_0x48447a;var _0x60e294=0x0;var _0x58a865=0x0;var _0x5e3717=0x0;var _0x2772f9=0x0;for(var _0x432b92=0x0;_0x5e3717<_0x4abc65;_0x432b92+=0x1){_0x58a865=_0x432b92/_0x2c0e08;_0x60e294=(_0x312a74*_0x58a865+_0x3257ea)/_0x5875cf;_0x5e3717=erlangb(_0x60e294,_0x570e56);_0x2772f9=_0x60e294/_0x570e56*(0x1-erlangb(_0x60e294,_0x570e56));}return _0x1ca699({'erlangCalls':_0x432b92,'erlangCallToSecond':_0x2c0e08/_0x432b92,'erlangAbandonmentRate':_0x5e3717,'erlangBusyFactor':_0x2772f9});});};Dialer[_0x552a('0xae')][_0x552a('0x1da')]=function(_0x1c0e44,_0x4b49a7,_0x222aac,_0x2e723f,_0x552241,_0x3192c1){loggerPredictive[_0x552a('0x82')](_0x552a('0x217'));loggerPredictive[_0x552a('0x82')](_0x552a('0x210'),_0x1c0e44);loggerPredictive[_0x552a('0x82')]('Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x4b49a7);loggerPredictive['info'](_0x552a('0x218'),_0x222aac);loggerPredictive[_0x552a('0x82')](_0x552a('0x212'),_0x2e723f);loggerPredictive[_0x552a('0x82')]('Umin:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x552241);loggerPredictive[_0x552a('0x82')](_0x552a('0x88'));return new BPromise(function(_0x337a9b,_0x1c9f09){if(_0x1c0e44<=0x0||isNaN(_0x1c0e44)){return _0x1c9f09(msgResponse(_0x552a('0x219'),_0x552a('0x4b'),_0x552a('0x214')+_0x1c0e44));}if(_0x222aac<=0x0||isNaN(_0x222aac)){return _0x1c9f09(msgResponse('[busyFactor]',_0x552a('0x4b'),'Ts\x20=\x20'+_0x222aac));}if(_0x2e723f<=0x0||isNaN(_0x2e723f)){return _0x1c9f09(msgResponse('[busyFactor]',_0x552a('0x4b'),'p\x20=\x20'+_0x2e723f));}if(_0x4b49a7<=0x0||isNaN(_0x4b49a7)){return _0x1c9f09(msgResponse(_0x552a('0x219'),'Error',_0x552a('0x216')+_0x4b49a7));}if(_0x552241<=0x0||isNaN(_0x552241)){return _0x1c9f09(msgResponse(_0x552a('0x219'),_0x552a('0x4b'),_0x552a('0x21a')+_0x552241));}_0x3192c1=_0x3192c1||0x0;var _0x2f9a2d=0x1/_0x222aac;var _0x39b042=0x0;var _0x5de975=0x0;var _0x45a07b=0x0;var _0x1825a8=0x0;for(var _0x2527df=0x0;_0x1825a8<_0x552241;_0x2527df+=0x1){_0x5de975=_0x2527df/_0x4b49a7;_0x39b042=(_0x2e723f*_0x5de975+_0x3192c1)/_0x2f9a2d;_0x45a07b=erlangb(_0x39b042,_0x1c0e44);_0x1825a8=_0x39b042/_0x1c0e44*(0x1-erlangb(_0x39b042,_0x1c0e44));}return _0x337a9b({'erlangCalls':_0x2527df,'erlangCallToSecond':_0x4b49a7/_0x2527df,'erlangAbandonmentRate':_0x45a07b,'erlangBusyFactor':_0x1825a8});});};module[_0x552a('0x21b')]=Dialer;
\ No newline at end of file
diff --git a/server/services/ami/dialer/queueCallerAbandon.js b/server/services/ami/dialer/queueCallerAbandon.js
index 4ded52b..054666f 100644
--- a/server/services/ami/dialer/queueCallerAbandon.js
+++ b/server/services/ami/dialer/queueCallerAbandon.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xb091=['callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','moment','milliseconds','scheduledat','campaigntype','type','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countmachineretry','countagentrejectretry','countabandonedretry','uniqueid','calleridname','calleridnum','number','starttime','responsetime','droptime','ringtime','holdtime','talktime','membername','connectedlinename','callback'];(function(_0x335402,_0x58b053){var _0x17d784=function(_0x496c38){while(--_0x496c38){_0x335402['push'](_0x335402['shift']());}};_0x17d784(++_0x58b053);}(_0xb091,0xd8));var _0x1b09=function(_0x18f2f2,_0x2608b3){_0x18f2f2=_0x18f2f2-0x0;var _0x4444a0=_0xb091[_0x18f2f2];return _0x4444a0;};'use strict';var util=require(_0x1b09('0x0'));var _=require('lodash');var moment=require(_0x1b09('0x1'));function getSeconds(_0x5e2983,_0x52073d){var _0x46caa=moment(_0x5e2983)['milliseconds'](0x0);var _0x5ae76f=moment(_0x52073d)[_0x1b09('0x2')](0x0);return _0x46caa['diff'](_0x5ae76f,'seconds');}function QueueCallerAbandon(_0x3ffaaa,_0xda5697){this[_0x1b09('0x3')]=_0x3ffaaa['scheduledat'];this['type']=_0x3ffaaa['type'];this[_0x1b09('0x4')]=_0x3ffaaa[_0x1b09('0x5')]===_0x1b09('0x6')?_0x1b09('0x7'):_0x3ffaaa[_0x1b09('0x5')];this[_0x1b09('0x8')]=_0x3ffaaa[_0x1b09('0x8')];this[_0x1b09('0x9')]=_0x3ffaaa[_0x1b09('0x9')];this[_0x1b09('0xa')]=_0x3ffaaa[_0x1b09('0xa')];this[_0x1b09('0xb')]=_0x3ffaaa['countbusyretry']+_0x3ffaaa['countcongestionretry']+_0x3ffaaa['countnoanswerretry']+_0x3ffaaa[_0x1b09('0xc')]+_0x3ffaaa[_0x1b09('0xd')]+_0x3ffaaa['countabandonedretry']+_0x3ffaaa[_0x1b09('0xe')]+_0x3ffaaa[_0x1b09('0xf')];this[_0x1b09('0xc')]=_0x3ffaaa['countnosuchnumberretry'];this[_0x1b09('0xd')]=_0x3ffaaa['countdropretry'];this['countabandonedretry']=_0x3ffaaa[_0x1b09('0x10')];this[_0x1b09('0xe')]=_0x3ffaaa[_0x1b09('0xe')];this[_0x1b09('0xf')]=_0x3ffaaa[_0x1b09('0xf')];this[_0x1b09('0x11')]=_0xda5697[_0x1b09('0x11')];this[_0x1b09('0x12')]=_0x3ffaaa['name'];this[_0x1b09('0x13')]=_0x3ffaaa[_0x1b09('0x14')];this[_0x1b09('0x15')]=_0x3ffaaa[_0x1b09('0x15')];this[_0x1b09('0x16')]=_0x3ffaaa[_0x1b09('0x16')];this[_0x1b09('0x17')]=_0x3ffaaa[_0x1b09('0x17')];this['endtime']=this['droptime'];this[_0x1b09('0x18')]=getSeconds(_0x3ffaaa[_0x1b09('0x16')],_0x3ffaaa['starttime']);this[_0x1b09('0x19')]=getSeconds(this['droptime'],_0x3ffaaa[_0x1b09('0x16')]);this[_0x1b09('0x1a')]=0x0;this[_0x1b09('0x7')]=_0xda5697[_0x1b09('0x7')];this[_0x1b09('0x1b')]=_0xda5697[_0x1b09('0x1c')];this['reason']=_0xda5697['reason'];this['callback']=_0x3ffaaa[_0x1b09('0x1d')];this[_0x1b09('0x1e')]=_0x3ffaaa[_0x1b09('0x1e')];this[_0x1b09('0x1f')]=_0x3ffaaa[_0x1b09('0x1f')];this[_0x1b09('0x20')]=_0x3ffaaa[_0x1b09('0x20')];this['ContactId']=_0x3ffaaa[_0x1b09('0x21')];this[_0x1b09('0x22')]=_0x3ffaaa[_0x1b09('0x22')];this[_0x1b09('0x23')]=_0x3ffaaa['UserId'];this[_0x1b09('0x24')]=_0x3ffaaa['VoiceQueueId'];this[_0x1b09('0x25')]=_0x3ffaaa['CampaignId'];this[_0x1b09('0x26')]=_0x3ffaaa['originatecalleridnum']||'';this[_0x1b09('0x27')]=_0x3ffaaa['originatecalleridname']||'';}module[_0x1b09('0x28')]=QueueCallerAbandon;
\ No newline at end of file
+var _0x9369=['ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','moment','milliseconds','diff','seconds','scheduledat','campaigntype','outbound','queue','type','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','uniqueid','calleridname','number','starttime','responsetime','droptime','endtime','ringtime','holdtime','membername','reason','callback','callbackuniqueid','callbackat','ContactId'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x9369,0x14f));var _0x9936=function(_0x2e3864,_0x3e2777){_0x2e3864=_0x2e3864-0x0;var _0x305521=_0x9369[_0x2e3864];return _0x305521;};'use strict';var util=require(_0x9936('0x0'));var _=require(_0x9936('0x1'));var moment=require(_0x9936('0x2'));function getSeconds(_0x142f57,_0x15f8f4){var _0x37675a=moment(_0x142f57)[_0x9936('0x3')](0x0);var _0x1744ce=moment(_0x15f8f4)[_0x9936('0x3')](0x0);return _0x37675a[_0x9936('0x4')](_0x1744ce,_0x9936('0x5'));}function QueueCallerAbandon(_0x490749,_0x131509){this[_0x9936('0x6')]=_0x490749[_0x9936('0x6')];this['type']=_0x490749['type'];this[_0x9936('0x7')]=_0x490749['type']===_0x9936('0x8')?_0x9936('0x9'):_0x490749[_0x9936('0xa')];this[_0x9936('0xb')]=_0x490749[_0x9936('0xb')];this[_0x9936('0xc')]=_0x490749['countcongestionretry'];this[_0x9936('0xd')]=_0x490749[_0x9936('0xd')];this[_0x9936('0xe')]=_0x490749[_0x9936('0xb')]+_0x490749[_0x9936('0xc')]+_0x490749[_0x9936('0xd')]+_0x490749[_0x9936('0xf')]+_0x490749[_0x9936('0x10')]+_0x490749[_0x9936('0x11')]+_0x490749[_0x9936('0x12')]+_0x490749['countagentrejectretry'];this['countnosuchnumberretry']=_0x490749['countnosuchnumberretry'];this['countdropretry']=_0x490749['countdropretry'];this[_0x9936('0x11')]=_0x490749['countabandonedretry'];this[_0x9936('0x12')]=_0x490749[_0x9936('0x12')];this['countagentrejectretry']=_0x490749['countagentrejectretry'];this[_0x9936('0x13')]=_0x131509['uniqueid'];this[_0x9936('0x14')]=_0x490749['name'];this['calleridnum']=_0x490749[_0x9936('0x15')];this[_0x9936('0x16')]=_0x490749[_0x9936('0x16')];this[_0x9936('0x17')]=_0x490749[_0x9936('0x17')];this[_0x9936('0x18')]=_0x490749['droptime'];this[_0x9936('0x19')]=this[_0x9936('0x18')];this[_0x9936('0x1a')]=getSeconds(_0x490749[_0x9936('0x17')],_0x490749[_0x9936('0x16')]);this[_0x9936('0x1b')]=getSeconds(this[_0x9936('0x18')],_0x490749[_0x9936('0x17')]);this['talktime']=0x0;this['queue']=_0x131509[_0x9936('0x9')];this[_0x9936('0x1c')]=_0x131509['connectedlinename'];this[_0x9936('0x1d')]=_0x131509['reason'];this[_0x9936('0x1e')]=_0x490749[_0x9936('0x1e')];this[_0x9936('0x1f')]=_0x490749[_0x9936('0x1f')];this['callbackat']=_0x490749[_0x9936('0x20')];this['recallme']=_0x490749['recallme'];this[_0x9936('0x21')]=_0x490749['ContactId'];this[_0x9936('0x22')]=_0x490749[_0x9936('0x22')];this['UserId']=_0x490749[_0x9936('0x23')];this[_0x9936('0x24')]=_0x490749[_0x9936('0x24')];this[_0x9936('0x25')]=_0x490749[_0x9936('0x25')];this[_0x9936('0x26')]=_0x490749['originatecalleridnum']||'';this[_0x9936('0x27')]=_0x490749[_0x9936('0x27')]||'';}module[_0x9936('0x28')]=QueueCallerAbandon;
\ No newline at end of file
diff --git a/server/services/ami/fax/action.js b/server/services/ami/fax/action.js
index f236b68..2cecd0f 100644
--- a/server/services/ami/fax/action.js
+++ b/server/services/ami/fax/action.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x5155=['exports','util','lodash','uniqueid','channel','Trunk','name','fax','localstationid','headerinfo','path','AttachmentId'];(function(_0xfa8b0,_0x2c4f21){var _0x584007=function(_0xef8e23){while(--_0xef8e23){_0xfa8b0['push'](_0xfa8b0['shift']());}};_0x584007(++_0x2c4f21);}(_0x5155,0xb5));var _0x5515=function(_0x5d2110,_0x1e1200){_0x5d2110=_0x5d2110-0x0;var _0x211a6f=_0x5155[_0x5d2110];return _0x211a6f;};'use strict';var util=require(_0x5515('0x0'));var _=require(_0x5515('0x1'));var moment=require('moment');function Action(_0xd17161,_0x4b761b,_0x1e7a29){this[_0x5515('0x2')]=_0xd17161||undefined;this[_0x5515('0x3')]=util['format']('%s/%s/%s',_0x4b761b['tech'],_0x4b761b[_0x5515('0x4')][_0x5515('0x5')],_0x1e7a29[_0x5515('0x6')]);this[_0x5515('0x7')]=_0x4b761b['localstationid'];this[_0x5515('0x8')]=_0x4b761b[_0x5515('0x8')];this[_0x5515('0x9')]=_0x1e7a29['path'];this[_0x5515('0xa')]=_0x1e7a29[_0x5515('0xa')];}module[_0x5515('0xb')]=Action;
\ No newline at end of file
+var _0xa96e=['localstationid','headerinfo','path','AttachmentId','exports','util','moment','uniqueid','%s/%s/%s','tech','name','fax'];(function(_0x778778,_0x389c6c){var _0x162093=function(_0x2c545d){while(--_0x2c545d){_0x778778['push'](_0x778778['shift']());}};_0x162093(++_0x389c6c);}(_0xa96e,0x191));var _0xea96=function(_0x28e18b,_0x48c862){_0x28e18b=_0x28e18b-0x0;var _0xb9d183=_0xa96e[_0x28e18b];return _0xb9d183;};'use strict';var util=require(_0xea96('0x0'));var _=require('lodash');var moment=require(_0xea96('0x1'));function Action(_0x42aff4,_0x21fe12,_0x266ffe){this[_0xea96('0x2')]=_0x42aff4||undefined;this['channel']=util['format'](_0xea96('0x3'),_0x21fe12[_0xea96('0x4')],_0x21fe12['Trunk'][_0xea96('0x5')],_0x266ffe[_0xea96('0x6')]);this['localstationid']=_0x21fe12[_0xea96('0x7')];this['headerinfo']=_0x21fe12[_0xea96('0x8')];this[_0xea96('0x9')]=_0x266ffe['path'];this[_0xea96('0xa')]=_0x266ffe[_0xea96('0xa')];}module[_0xea96('0xb')]=Action;
\ No newline at end of file
diff --git a/server/services/ami/fax/index.js b/server/services/ami/fax/index.js
index f503b5f..c0f58c3 100644
--- a/server/services/ami/fax/index.js
+++ b/server/services/ami/fax/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xfd6c=['Is\x20Valid','util','lodash','bluebird','uuid','path','./util/gs','fax','../ami','./rpcDb','./channel','./util/util','./action','../rpc/faxAccount','../rpc/attachment','../rpc/faxMessage','faxAccounts','trunks','syncNewchannel','bind','varset','syncVarSet','newstate','syncNewState','newexten','syncNewExten','faxstatus','syncFaxStatus','receivefax','syncReceiveFax','hangup','syncHangup','originateresponse','syncOriginateResponse','prototype','context','hasOwnProperty','exten','channels','uniqueid','channel','name','info','\x20syncNewchannel\x20','actions','variable','value','channelstatedesc','operation','status','localstationid','filename','\x20syncFaxStatus\x20','remotestationid','pagestransferred','resolution','transferrate','calleridnum','/var/opt/motion2/server/files/attachments/','create','parse','then','notify','.pdf','catch','\x20notify\x20','error','stringify','\x20receiveFax\x20','pick','response','AttachmentId','update','[Fax][Message][Error][Updated]','logger','[Fax][Message][Error][NoUpdate2]','updateStatus','[Fax][Message][NoUpdate1]','[Fax][Message][NoUpdate2]','\x20hangup\x20faxRiceive\x20','faxpages','faxstatusstring','SENDING\x20FAILED:\x20','SENDING\x20FAILED','send','execOriginate','FaxAccountId','[Fax][execOriginate][success]','message','Fax\x20received','[Fax][execOriginate][failure]','checkAfterSend','checkTrunk','isValid','Trunk\x20Reachable','format','gs\x20-q\x20-dNOPAUSE\x20-dBATCH\x20-sDEVICE=tiffg4\x20-sPAPERSIZE=letter\x20-sOutputFile=/var/opt/motion2/server/files/attachments/%s.tif\x20\x20%s\x20-c\x20quit','execute','%s/%s.tif','XMF-PATH','Action','variablesAction','ext','isTrunkReachable','isNil','active','SIP/%s','reachable','unmonitored','\x20Trunk\x20is\x20not\x20active','[Fax][checkTrunk][Empty\x20Fax]','Empty\x20Fax','[Fax][checkTrunk][Empty\x20path]','Empty\x20path'];(function(_0x618414,_0x1a7a60){var _0x21c19a=function(_0x507b17){while(--_0x507b17){_0x618414['push'](_0x618414['shift']());}};_0x21c19a(++_0x1a7a60);}(_0xfd6c,0x1c9));var _0xcfd6=function(_0x118653,_0x50ef26){_0x118653=_0x118653-0x0;var _0xc11fa6=_0xfd6c[_0x118653];return _0xc11fa6;};'use strict';var util=require(_0xcfd6('0x0'));var _=require(_0xcfd6('0x1'));var BPromise=require(_0xcfd6('0x2'));var uuid=require(_0xcfd6('0x3'));var moment=require('moment');var path=require(_0xcfd6('0x4'));var tiff2pdf=require('tiff2pdf');var gs=require(_0xcfd6('0x5'));var logger=require('../../../config/logger')(_0xcfd6('0x6'));var ami=require(_0xcfd6('0x7'));var rpcDb=require(_0xcfd6('0x8'));var Channel=require(_0xcfd6('0x9'));var ut=require(_0xcfd6('0xa'));var Action=require(_0xcfd6('0xb'));var faxAccount=require(_0xcfd6('0xc'));var attachment=require(_0xcfd6('0xd'));var faxMessage=require(_0xcfd6('0xe'));function Fax(_0x140e91){this['channels']={};this['faxAccounts']=_0x140e91[_0xcfd6('0xf')];this[_0xcfd6('0x10')]=_0x140e91[_0xcfd6('0x10')];this['actions']={};ami['on']('newchannel',this[_0xcfd6('0x11')][_0xcfd6('0x12')](this));ami['on'](_0xcfd6('0x13'),this[_0xcfd6('0x14')][_0xcfd6('0x12')](this));ami['on'](_0xcfd6('0x15'),this[_0xcfd6('0x16')][_0xcfd6('0x12')](this));ami['on'](_0xcfd6('0x17'),this[_0xcfd6('0x18')][_0xcfd6('0x12')](this));ami['on'](_0xcfd6('0x19'),this[_0xcfd6('0x1a')][_0xcfd6('0x12')](this));ami['on'](_0xcfd6('0x1b'),this[_0xcfd6('0x1c')][_0xcfd6('0x12')](this));ami['on'](_0xcfd6('0x1d'),this[_0xcfd6('0x1e')][_0xcfd6('0x12')](this));ami['on'](_0xcfd6('0x1f'),this[_0xcfd6('0x20')][_0xcfd6('0x12')](this));}Fax[_0xcfd6('0x21')][_0xcfd6('0x11')]=function(_0x41a693){if(_0x41a693[_0xcfd6('0x22')]==='from-voip-provider'){for(var _0x5b4728 in this[_0xcfd6('0xf')]){if(this['faxAccounts'][_0xcfd6('0x23')](_0x5b4728)){if(_0x41a693[_0xcfd6('0x24')]===this[_0xcfd6('0xf')][_0x5b4728]['localstationid']){this[_0xcfd6('0x25')][_0x41a693['uniqueid']]={};this[_0xcfd6('0x25')][_0x41a693[_0xcfd6('0x26')]][_0xcfd6('0x27')]=_0x41a693[_0xcfd6('0x27')];this[_0xcfd6('0x25')][_0x41a693[_0xcfd6('0x26')]]['id']=this[_0xcfd6('0xf')][_0x5b4728]['id'];this['channels'][_0x41a693[_0xcfd6('0x26')]][_0xcfd6('0x28')]=this['faxAccounts'][_0x5b4728][_0xcfd6('0x28')];logger[_0xcfd6('0x29')](_0x41a693[_0xcfd6('0x26')],_0xcfd6('0x2a'));}}}}if(this[_0xcfd6('0x2b')][_0x41a693[_0xcfd6('0x26')]]){this['channels'][_0x41a693[_0xcfd6('0x26')]]={};this[_0xcfd6('0x25')][_0x41a693[_0xcfd6('0x26')]]['channel']=_0x41a693[_0xcfd6('0x27')];logger[_0xcfd6('0x29')](_0x41a693[_0xcfd6('0x26')],_0xcfd6('0x2a'));}};Fax[_0xcfd6('0x21')][_0xcfd6('0x14')]=function(_0x39a146){if(this[_0xcfd6('0x25')][_0x39a146[_0xcfd6('0x26')]]){for(var _0xc9ece1 in _0x39a146[_0xcfd6('0x2c')]){if(_0x39a146['variable'][_0xcfd6('0x23')](_0xc9ece1)){this['channels'][_0x39a146[_0xcfd6('0x26')]][_0xc9ece1]=_0x39a146[_0xcfd6('0x2d')];}}}};Fax[_0xcfd6('0x21')][_0xcfd6('0x16')]=function(_0x472add){if(this['channels'][_0x472add['uniqueid']]){this[_0xcfd6('0x25')][_0x472add['uniqueid']]['channelstate']=_0x472add['channelstate'];this[_0xcfd6('0x25')][_0x472add['uniqueid']]['channelstatedesc']=_0x472add[_0xcfd6('0x2e')];}};Fax[_0xcfd6('0x21')][_0xcfd6('0x18')]=function(_0x358c1c){if(this[_0xcfd6('0x25')][_0x358c1c['uniqueid']]){for(var _0x876a75 in _0x358c1c[_0xcfd6('0x2c')]){if(_0x358c1c['variable']['hasOwnProperty'](_0x876a75)){this[_0xcfd6('0x25')][_0x358c1c['uniqueid']][_0x876a75]=_0x358c1c[_0xcfd6('0x2d')];}}}};Fax[_0xcfd6('0x21')][_0xcfd6('0x1a')]=function(_0x54739f){if(this[_0xcfd6('0x25')][_0x54739f[_0xcfd6('0x26')]]){this[_0xcfd6('0x25')][_0x54739f['uniqueid']][_0xcfd6('0x2f')]=_0x54739f[_0xcfd6('0x2f')];this['channels'][_0x54739f[_0xcfd6('0x26')]][_0xcfd6('0x30')]=_0x54739f[_0xcfd6('0x30')];this[_0xcfd6('0x25')][_0x54739f[_0xcfd6('0x26')]]['localstationid']=_0x54739f[_0xcfd6('0x31')];this[_0xcfd6('0x25')][_0x54739f['uniqueid']][_0xcfd6('0x32')]=_0x54739f['filename'];logger[_0xcfd6('0x29')](_0x54739f[_0xcfd6('0x26')],_0xcfd6('0x33'));}};Fax['prototype'][_0xcfd6('0x1c')]=function(_0x10693c){var _0x1f2d8d=this;if(this[_0xcfd6('0x25')][_0x10693c[_0xcfd6('0x26')]]){var _0x40aacf=this['channels'][_0x10693c[_0xcfd6('0x26')]]['id'];this[_0xcfd6('0x25')][_0x10693c[_0xcfd6('0x26')]][_0xcfd6('0x34')]=_0x10693c['remotestationid'];this['channels'][_0x10693c[_0xcfd6('0x26')]][_0xcfd6('0x35')]=_0x10693c[_0xcfd6('0x35')];this[_0xcfd6('0x25')][_0x10693c[_0xcfd6('0x26')]][_0xcfd6('0x31')]=_0x10693c[_0xcfd6('0x31')];this[_0xcfd6('0x25')][_0x10693c['uniqueid']][_0xcfd6('0x36')]=_0x10693c[_0xcfd6('0x36')];this[_0xcfd6('0x25')][_0x10693c['uniqueid']][_0xcfd6('0x37')]=_0x10693c['transferrate'];this[_0xcfd6('0x25')][_0x10693c[_0xcfd6('0x26')]][_0xcfd6('0x32')]=_0x10693c[_0xcfd6('0x32')];this['channels'][_0x10693c[_0xcfd6('0x26')]][_0xcfd6('0x38')]=_0x10693c[_0xcfd6('0x38')];if(this['channels'][_0x10693c[_0xcfd6('0x26')]][_0xcfd6('0x35')]>0x0){tiff2pdf(_0x10693c[_0xcfd6('0x32')],_0xcfd6('0x39'),function(_0x12243c){logger['info'](_0x10693c[_0xcfd6('0x26')],'\x20result\x20conversion\x20file\x20',_0x12243c['message']);attachment[_0xcfd6('0x3a')]({'name':path['parse'](_0x10693c[_0xcfd6('0x32')])[_0xcfd6('0x28')],'basename':path[_0xcfd6('0x3b')](_0x10693c[_0xcfd6('0x32')])[_0xcfd6('0x28')]+'.pdf','type':'application/pdf'})[_0xcfd6('0x3c')](function(_0x46ea99){faxAccount[_0xcfd6('0x3d')](_0x40aacf,{'from':_0x10693c[_0xcfd6('0x38')],'mapKey':_0xcfd6('0x6'),'body':path[_0xcfd6('0x3b')](_0x10693c[_0xcfd6('0x32')])[_0xcfd6('0x28')]+_0xcfd6('0x3e'),'AttachmentId':_0x46ea99['id']})[_0xcfd6('0x3f')](function(_0xf0a0a1){logger['error'](_0x10693c['uniqueid'],_0xcfd6('0x40'),JSON['stringify'](_0xf0a0a1));});})[_0xcfd6('0x3f')](function(_0xd56602){logger[_0xcfd6('0x41')](_0x10693c[_0xcfd6('0x26')],'\x20receiveFax\x20',JSON[_0xcfd6('0x42')](_0xd56602));});});}logger['info'](_0x10693c[_0xcfd6('0x26')],_0xcfd6('0x43'));}};Fax['prototype'][_0xcfd6('0x20')]=function(_0x527edf){if(this[_0xcfd6('0x2b')][_0x527edf[_0xcfd6('0x26')]]){_['merge'](this[_0xcfd6('0x25')][_0x527edf[_0xcfd6('0x26')]],_[_0xcfd6('0x44')](_0x527edf,[_0xcfd6('0x45'),'reason']));}};function updateStatus(_0xf46390){if(_0xf46390[_0xcfd6('0x46')]){faxMessage[_0xcfd6('0x47')](_0xf46390['AttachmentId'],{'failMessage':'SENDING\x20FAILED\x20'})[_0xcfd6('0x3c')](function(_0x328448){ut['logger'](_0xcfd6('0x48'),_0x328448);})['catch'](function(_0x4418b7){ut[_0xcfd6('0x49')]('[Fax][Message][Error][NoUpdate1]',_0x4418b7);});}else{ut[_0xcfd6('0x49')](_0xcfd6('0x4a'));}}Fax[_0xcfd6('0x21')][_0xcfd6('0x4b')]=function(_0x1efc32,_0x452811,_0x21cd99){var _0x1b4382=this;var _0x39b1dc={};if(_0x452811){_0x39b1dc={'read':_0x452811};}else{_0x39b1dc={'failMessage':_0x21cd99};}if(this[_0xcfd6('0x2b')][_0x1efc32][_0xcfd6('0x46')]){faxMessage['update'](this['actions'][_0x1efc32]['AttachmentId'],_0x39b1dc)['then'](function(_0x472e45){ut[_0xcfd6('0x49')]('[Fax][Message][Updated]',_0x472e45);})['catch'](function(_0x2a6240){ut[_0xcfd6('0x49')](_0xcfd6('0x4c'),_0x2a6240);})['finally'](function(){delete _0x1b4382[_0xcfd6('0x25')][_0x1efc32];delete _0x1b4382[_0xcfd6('0x2b')][_0x1efc32];});}else{ut[_0xcfd6('0x49')](_0xcfd6('0x4d'));delete this[_0xcfd6('0x25')][_0x1efc32];delete this[_0xcfd6('0x2b')][_0x1efc32];}};Fax[_0xcfd6('0x21')][_0xcfd6('0x1e')]=function(_0x389aff){var _0x36d14a=this;if(this[_0xcfd6('0x25')][_0x389aff['uniqueid']]){if(this[_0xcfd6('0x2b')][_0x389aff[_0xcfd6('0x26')]]){this[_0xcfd6('0x25')][_0x389aff[_0xcfd6('0x26')]]['id']=this[_0xcfd6('0x2b')][_0x389aff[_0xcfd6('0x26')]]['id'];this[_0xcfd6('0x25')][_0x389aff[_0xcfd6('0x26')]]['name']=this[_0xcfd6('0x2b')][_0x389aff[_0xcfd6('0x26')]][_0xcfd6('0x28')];}logger['info'](_0x389aff[_0xcfd6('0x26')],this['actions'][_0x389aff[_0xcfd6('0x26')]]?'\x20hangup\x20sendFile\x20':_0xcfd6('0x4e'),JSON[_0xcfd6('0x42')](this[_0xcfd6('0x25')][_0x389aff[_0xcfd6('0x26')]]));if(this[_0xcfd6('0x2b')][_0x389aff[_0xcfd6('0x26')]]){if(this[_0xcfd6('0x25')][_0x389aff[_0xcfd6('0x26')]][_0xcfd6('0x4f')]>0x0&&this[_0xcfd6('0x25')][_0x389aff[_0xcfd6('0x26')]]['faxstatus']==='SUCCESS'){this[_0xcfd6('0x4b')](_0x389aff[_0xcfd6('0x26')],!![]);}else{this['updateStatus'](_0x389aff[_0xcfd6('0x26')],![],this[_0xcfd6('0x25')][_0x389aff['uniqueid']][_0xcfd6('0x50')]?_0xcfd6('0x51')+this[_0xcfd6('0x25')][_0x389aff['uniqueid']][_0xcfd6('0x50')]:_0xcfd6('0x52'));}}}};Fax[_0xcfd6('0x21')][_0xcfd6('0x53')]=function(_0x5021d5){var _0x14b796=this;return new BPromise(function(_0x6f454a,_0x2a3e8e){_0x14b796[_0xcfd6('0x54')](_0x5021d5,_0x14b796[_0xcfd6('0xf')][_0x5021d5[_0xcfd6('0x55')]])[_0xcfd6('0x3c')](function(_0xbf3d0){ut[_0xcfd6('0x49')](_0xcfd6('0x56'),_0xbf3d0);_0x6f454a(ut[_0xcfd6('0x57')](_0xcfd6('0x58')));})[_0xcfd6('0x3f')](function(_0x41b361){ut['logger'](_0xcfd6('0x59'),_0x41b361);updateStatus(_0x5021d5);_0x2a3e8e(ut[_0xcfd6('0x57')]('Fax\x20failed'));});});};Fax[_0xcfd6('0x21')][_0xcfd6('0x5a')]=function(_0x115950){var _0x820c88=this;return new BPromise(function(_0x42ec2e,_0x419a41){var _0xe7de6c=_0x820c88[_0xcfd6('0x5b')](_0x820c88[_0xcfd6('0xf')][_0x115950[_0xcfd6('0x55')]]['Trunk'],_0x115950);if(_0xe7de6c[_0xcfd6('0x5c')]){_0x42ec2e(ut[_0xcfd6('0x57')](_0xcfd6('0x5d')));}else{_0x419a41(ut[_0xcfd6('0x57')](_0xe7de6c[_0xcfd6('0x57')]));}});};function originate(_0x364eb1,_0xecd7fa,_0xf6ceae){return new BPromise(function(_0x44c037,_0x28aa82){if(_0xf6ceae){var _0x233efb=util[_0xcfd6('0x5e')](_0xcfd6('0x5f'),path[_0xcfd6('0x3b')](_0x364eb1['path'])[_0xcfd6('0x28')],_0x364eb1[_0xcfd6('0x4')]);gs[_0xcfd6('0x60')](_0x233efb)[_0xcfd6('0x3c')](function(){_0x364eb1[_0xcfd6('0x4')]=util[_0xcfd6('0x5e')](_0xcfd6('0x61'),path['parse'](_0x364eb1[_0xcfd6('0x4')])['dir'],path[_0xcfd6('0x3b')](_0x364eb1[_0xcfd6('0x4')])[_0xcfd6('0x28')]);_0xecd7fa[_0xcfd6('0x62')]=_0x364eb1[_0xcfd6('0x4')];ut[_0xcfd6('0x49')]('Convert\x20pdf\x20to\x20tif','');ami[_0xcfd6('0x63')](ut[_0xcfd6('0x64')](_0x364eb1,_0xecd7fa))[_0xcfd6('0x3c')](function(_0x2bad53){_0x44c037(_0x2bad53);})[_0xcfd6('0x3f')](function(_0x12aaac){_0x28aa82(_0x12aaac);});})[_0xcfd6('0x3f')](function(_0x216a3b){_0x28aa82(_0x216a3b);});}else{ami[_0xcfd6('0x63')](ut[_0xcfd6('0x64')](_0x364eb1,_0xecd7fa))[_0xcfd6('0x3c')](function(_0x1af396){_0x44c037(_0x1af396);})[_0xcfd6('0x3f')](function(_0x217769){_0x28aa82(_0x217769);});}});}Fax['prototype'][_0xcfd6('0x54')]=function(_0x524435,_0x383732){var _0x340f59=this;return new BPromise(function(_0x4116a0,_0x49b9a1){var _0x13a30e=uuid['v4']();var _0x514d2d=ut['addVariables'](_0x524435,_0x383732);_0x340f59['actions'][_0x13a30e]=new Action(_0x13a30e,_0x383732,_0x524435);var _0x3b3053=_0x340f59[_0xcfd6('0x2b')][_0x13a30e];if(path[_0xcfd6('0x3b')](_0x524435[_0xcfd6('0x4')])[_0xcfd6('0x65')]===_0xcfd6('0x3e')){originate(_0x3b3053,_0x514d2d,!![])[_0xcfd6('0x3c')](function(_0x5b4fde){_0x4116a0(_0x5b4fde);})[_0xcfd6('0x3f')](function(_0x22a26c){_0x49b9a1(_0x22a26c);});}else{originate(_0x3b3053,_0x514d2d,![])['then'](function(_0x29f26b){_0x4116a0(_0x29f26b);})[_0xcfd6('0x3f')](function(_0x2424a2){_0x49b9a1(_0x2424a2);});}});};Fax[_0xcfd6('0x21')][_0xcfd6('0x66')]=function(_0x17f9f6){return!_['isNil'](_0x17f9f6)&&!_[_0xcfd6('0x67')](_0x17f9f6[_0xcfd6('0x28')])&&!_[_0xcfd6('0x67')](_0x17f9f6[_0xcfd6('0x68')])&&_0x17f9f6[_0xcfd6('0x68')]&&!_['isNil'](this[_0xcfd6('0x10')][util[_0xcfd6('0x5e')](_0xcfd6('0x69'),_0x17f9f6[_0xcfd6('0x28')])])&&!_[_0xcfd6('0x67')](this['trunks'][util[_0xcfd6('0x5e')](_0xcfd6('0x69'),_0x17f9f6['name'])][_0xcfd6('0x30')])&&(this[_0xcfd6('0x10')][util['format']('SIP/%s',_0x17f9f6[_0xcfd6('0x28')])][_0xcfd6('0x30')]===_0xcfd6('0x6a')||this[_0xcfd6('0x10')][util[_0xcfd6('0x5e')](_0xcfd6('0x69'),_0x17f9f6[_0xcfd6('0x28')])][_0xcfd6('0x30')]===_0xcfd6('0x6b'));};Fax[_0xcfd6('0x21')][_0xcfd6('0x5b')]=function(_0x362fd0,_0x4c7927){if(!this['isTrunkReachable'](_0x362fd0)){ut[_0xcfd6('0x49')]('[Fax][checkTrunk][Trunk\x20not\x20work]',_[_0xcfd6('0x67')](_0x362fd0)?'':_0x362fd0['name']+_0xcfd6('0x6c'));return{'isValid':![],'message':'Trunk\x20not\x20working'};}if(_[_0xcfd6('0x67')](_0x4c7927[_0xcfd6('0x6')])){ut[_0xcfd6('0x49')](_0xcfd6('0x6d'),JSON[_0xcfd6('0x42')](_0x4c7927));return{'isValid':![],'message':_0xcfd6('0x6e')};}if(_['isNil'](_0x4c7927['path'])){ut[_0xcfd6('0x49')](_0xcfd6('0x6f'),JSON['stringify'](_0x4c7927));return{'isValid':![],'message':_0xcfd6('0x70')};}return{'isValid':!![],'message':_0xcfd6('0x71')};};module['exports']=Fax;
\ No newline at end of file
+var _0xf03b=['syncNewExten','operation','status','filename','\x20syncFaxStatus\x20','remotestationid','pagestransferred','resolution','transferrate','calleridnum','/var/opt/motion2/server/files/attachments/','\x20result\x20conversion\x20file\x20','message','create','parse','application/pdf','then','notify','.pdf','catch','error','\x20notify\x20','stringify','\x20receiveFax\x20','merge','pick','response','reason','AttachmentId','update','SENDING\x20FAILED\x20','logger','[Fax][Message][Error][Updated]','updateStatus','[Fax][Message][Updated]','[Fax][Message][NoUpdate1]','finally','[Fax][Message][NoUpdate2]','syncHangup','\x20hangup\x20sendFile\x20','\x20hangup\x20faxRiceive\x20','SUCCESS','faxstatusstring','SENDING\x20FAILED:\x20','SENDING\x20FAILED','execOriginate','FaxAccountId','Fax\x20received','[Fax][execOriginate][failure]','Fax\x20failed','checkAfterSend','Trunk','isValid','path','execute','format','%s/%s.tif','dir','XMF-PATH','Convert\x20pdf\x20to\x20tif','Action','variablesAction','addVariables','ext','isTrunkReachable','isNil','active','trunks','SIP/%s','checkTrunk','[Fax][checkTrunk][Trunk\x20not\x20work]','Trunk\x20not\x20working','Empty\x20Fax','Empty\x20path','Is\x20Valid','exports','util','lodash','bluebird','uuid','tiff2pdf','./util/gs','../../../config/logger','fax','../ami','./rpcDb','./channel','./util/util','./action','../rpc/faxAccount','../rpc/faxMessage','channels','faxAccounts','actions','newchannel','syncNewchannel','bind','varset','syncVarSet','newstate','syncNewState','faxstatus','syncFaxStatus','syncReceiveFax','hangup','originateresponse','syncOriginateResponse','prototype','from-voip-provider','hasOwnProperty','exten','localstationid','uniqueid','channel','name','info','\x20syncNewchannel\x20','variable','value','channelstate','channelstatedesc'];(function(_0x44cf39,_0x5578ce){var _0x5dd390=function(_0x2fb792){while(--_0x2fb792){_0x44cf39['push'](_0x44cf39['shift']());}};_0x5dd390(++_0x5578ce);}(_0xf03b,0xc5));var _0xbf03=function(_0x51eb63,_0x57cad9){_0x51eb63=_0x51eb63-0x0;var _0x63daa6=_0xf03b[_0x51eb63];return _0x63daa6;};'use strict';var util=require(_0xbf03('0x0'));var _=require(_0xbf03('0x1'));var BPromise=require(_0xbf03('0x2'));var uuid=require(_0xbf03('0x3'));var moment=require('moment');var path=require('path');var tiff2pdf=require(_0xbf03('0x4'));var gs=require(_0xbf03('0x5'));var logger=require(_0xbf03('0x6'))(_0xbf03('0x7'));var ami=require(_0xbf03('0x8'));var rpcDb=require(_0xbf03('0x9'));var Channel=require(_0xbf03('0xa'));var ut=require(_0xbf03('0xb'));var Action=require(_0xbf03('0xc'));var faxAccount=require(_0xbf03('0xd'));var attachment=require('../rpc/attachment');var faxMessage=require(_0xbf03('0xe'));function Fax(_0x3532e4){this[_0xbf03('0xf')]={};this[_0xbf03('0x10')]=_0x3532e4[_0xbf03('0x10')];this['trunks']=_0x3532e4['trunks'];this[_0xbf03('0x11')]={};ami['on'](_0xbf03('0x12'),this[_0xbf03('0x13')][_0xbf03('0x14')](this));ami['on'](_0xbf03('0x15'),this[_0xbf03('0x16')]['bind'](this));ami['on'](_0xbf03('0x17'),this[_0xbf03('0x18')][_0xbf03('0x14')](this));ami['on']('newexten',this['syncNewExten'][_0xbf03('0x14')](this));ami['on'](_0xbf03('0x19'),this[_0xbf03('0x1a')][_0xbf03('0x14')](this));ami['on']('receivefax',this[_0xbf03('0x1b')][_0xbf03('0x14')](this));ami['on'](_0xbf03('0x1c'),this['syncHangup'][_0xbf03('0x14')](this));ami['on'](_0xbf03('0x1d'),this[_0xbf03('0x1e')]['bind'](this));}Fax[_0xbf03('0x1f')][_0xbf03('0x13')]=function(_0x29fff0){if(_0x29fff0['context']===_0xbf03('0x20')){for(var _0x21e625 in this[_0xbf03('0x10')]){if(this[_0xbf03('0x10')][_0xbf03('0x21')](_0x21e625)){if(_0x29fff0[_0xbf03('0x22')]===this['faxAccounts'][_0x21e625][_0xbf03('0x23')]){this['channels'][_0x29fff0[_0xbf03('0x24')]]={};this[_0xbf03('0xf')][_0x29fff0[_0xbf03('0x24')]][_0xbf03('0x25')]=_0x29fff0[_0xbf03('0x25')];this[_0xbf03('0xf')][_0x29fff0[_0xbf03('0x24')]]['id']=this[_0xbf03('0x10')][_0x21e625]['id'];this[_0xbf03('0xf')][_0x29fff0['uniqueid']][_0xbf03('0x26')]=this[_0xbf03('0x10')][_0x21e625]['name'];logger[_0xbf03('0x27')](_0x29fff0[_0xbf03('0x24')],_0xbf03('0x28'));}}}}if(this[_0xbf03('0x11')][_0x29fff0[_0xbf03('0x24')]]){this['channels'][_0x29fff0[_0xbf03('0x24')]]={};this['channels'][_0x29fff0['uniqueid']]['channel']=_0x29fff0[_0xbf03('0x25')];logger['info'](_0x29fff0[_0xbf03('0x24')],_0xbf03('0x28'));}};Fax[_0xbf03('0x1f')]['syncVarSet']=function(_0x5d5c0d){if(this['channels'][_0x5d5c0d['uniqueid']]){for(var _0x5cca0e in _0x5d5c0d['variable']){if(_0x5d5c0d[_0xbf03('0x29')]['hasOwnProperty'](_0x5cca0e)){this[_0xbf03('0xf')][_0x5d5c0d[_0xbf03('0x24')]][_0x5cca0e]=_0x5d5c0d[_0xbf03('0x2a')];}}}};Fax[_0xbf03('0x1f')][_0xbf03('0x18')]=function(_0x52f239){if(this[_0xbf03('0xf')][_0x52f239[_0xbf03('0x24')]]){this[_0xbf03('0xf')][_0x52f239[_0xbf03('0x24')]][_0xbf03('0x2b')]=_0x52f239[_0xbf03('0x2b')];this[_0xbf03('0xf')][_0x52f239[_0xbf03('0x24')]][_0xbf03('0x2c')]=_0x52f239['channelstatedesc'];}};Fax[_0xbf03('0x1f')][_0xbf03('0x2d')]=function(_0x2c7705){if(this[_0xbf03('0xf')][_0x2c7705[_0xbf03('0x24')]]){for(var _0x127c3d in _0x2c7705[_0xbf03('0x29')]){if(_0x2c7705['variable'][_0xbf03('0x21')](_0x127c3d)){this[_0xbf03('0xf')][_0x2c7705[_0xbf03('0x24')]][_0x127c3d]=_0x2c7705['value'];}}}};Fax[_0xbf03('0x1f')][_0xbf03('0x1a')]=function(_0x3f03d2){if(this[_0xbf03('0xf')][_0x3f03d2[_0xbf03('0x24')]]){this[_0xbf03('0xf')][_0x3f03d2[_0xbf03('0x24')]][_0xbf03('0x2e')]=_0x3f03d2[_0xbf03('0x2e')];this[_0xbf03('0xf')][_0x3f03d2[_0xbf03('0x24')]][_0xbf03('0x2f')]=_0x3f03d2[_0xbf03('0x2f')];this[_0xbf03('0xf')][_0x3f03d2[_0xbf03('0x24')]][_0xbf03('0x23')]=_0x3f03d2['localstationid'];this[_0xbf03('0xf')][_0x3f03d2[_0xbf03('0x24')]][_0xbf03('0x30')]=_0x3f03d2[_0xbf03('0x30')];logger[_0xbf03('0x27')](_0x3f03d2[_0xbf03('0x24')],_0xbf03('0x31'));}};Fax[_0xbf03('0x1f')][_0xbf03('0x1b')]=function(_0x10a314){var _0x2bc986=this;if(this['channels'][_0x10a314['uniqueid']]){var _0x479d9b=this[_0xbf03('0xf')][_0x10a314[_0xbf03('0x24')]]['id'];this[_0xbf03('0xf')][_0x10a314[_0xbf03('0x24')]][_0xbf03('0x32')]=_0x10a314[_0xbf03('0x32')];this[_0xbf03('0xf')][_0x10a314[_0xbf03('0x24')]][_0xbf03('0x33')]=_0x10a314[_0xbf03('0x33')];this[_0xbf03('0xf')][_0x10a314[_0xbf03('0x24')]][_0xbf03('0x23')]=_0x10a314[_0xbf03('0x23')];this[_0xbf03('0xf')][_0x10a314[_0xbf03('0x24')]][_0xbf03('0x34')]=_0x10a314[_0xbf03('0x34')];this[_0xbf03('0xf')][_0x10a314[_0xbf03('0x24')]][_0xbf03('0x35')]=_0x10a314[_0xbf03('0x35')];this['channels'][_0x10a314[_0xbf03('0x24')]][_0xbf03('0x30')]=_0x10a314[_0xbf03('0x30')];this['channels'][_0x10a314[_0xbf03('0x24')]]['calleridnum']=_0x10a314[_0xbf03('0x36')];if(this[_0xbf03('0xf')][_0x10a314[_0xbf03('0x24')]][_0xbf03('0x33')]>0x0){tiff2pdf(_0x10a314['filename'],_0xbf03('0x37'),function(_0x47f349){logger[_0xbf03('0x27')](_0x10a314[_0xbf03('0x24')],_0xbf03('0x38'),_0x47f349[_0xbf03('0x39')]);attachment[_0xbf03('0x3a')]({'name':path[_0xbf03('0x3b')](_0x10a314[_0xbf03('0x30')])[_0xbf03('0x26')],'basename':path[_0xbf03('0x3b')](_0x10a314[_0xbf03('0x30')])['name']+'.pdf','type':_0xbf03('0x3c')})[_0xbf03('0x3d')](function(_0x2ab33f){faxAccount[_0xbf03('0x3e')](_0x479d9b,{'from':_0x10a314[_0xbf03('0x36')],'mapKey':_0xbf03('0x7'),'body':path[_0xbf03('0x3b')](_0x10a314[_0xbf03('0x30')])[_0xbf03('0x26')]+_0xbf03('0x3f'),'AttachmentId':_0x2ab33f['id']})[_0xbf03('0x40')](function(_0x5ae410){logger[_0xbf03('0x41')](_0x10a314[_0xbf03('0x24')],_0xbf03('0x42'),JSON[_0xbf03('0x43')](_0x5ae410));});})[_0xbf03('0x40')](function(_0x18e053){logger[_0xbf03('0x41')](_0x10a314[_0xbf03('0x24')],'\x20receiveFax\x20',JSON['stringify'](_0x18e053));});});}logger['info'](_0x10a314['uniqueid'],_0xbf03('0x44'));}};Fax[_0xbf03('0x1f')][_0xbf03('0x1e')]=function(_0x40c2df){if(this[_0xbf03('0x11')][_0x40c2df[_0xbf03('0x24')]]){_[_0xbf03('0x45')](this[_0xbf03('0xf')][_0x40c2df[_0xbf03('0x24')]],_[_0xbf03('0x46')](_0x40c2df,[_0xbf03('0x47'),_0xbf03('0x48')]));}};function updateStatus(_0x47428f){if(_0x47428f[_0xbf03('0x49')]){faxMessage[_0xbf03('0x4a')](_0x47428f[_0xbf03('0x49')],{'failMessage':_0xbf03('0x4b')})[_0xbf03('0x3d')](function(_0x2730e0){ut[_0xbf03('0x4c')](_0xbf03('0x4d'),_0x2730e0);})[_0xbf03('0x40')](function(_0x539146){ut['logger']('[Fax][Message][Error][NoUpdate1]',_0x539146);});}else{ut[_0xbf03('0x4c')]('[Fax][Message][Error][NoUpdate2]');}}Fax[_0xbf03('0x1f')][_0xbf03('0x4e')]=function(_0x5a879b,_0x2acda2,_0x16b0fd){var _0x5822bc=this;var _0x7907f0={};if(_0x2acda2){_0x7907f0={'read':_0x2acda2};}else{_0x7907f0={'failMessage':_0x16b0fd};}if(this[_0xbf03('0x11')][_0x5a879b][_0xbf03('0x49')]){faxMessage[_0xbf03('0x4a')](this[_0xbf03('0x11')][_0x5a879b][_0xbf03('0x49')],_0x7907f0)[_0xbf03('0x3d')](function(_0x1608d3){ut['logger'](_0xbf03('0x4f'),_0x1608d3);})[_0xbf03('0x40')](function(_0x570da5){ut[_0xbf03('0x4c')](_0xbf03('0x50'),_0x570da5);})[_0xbf03('0x51')](function(){delete _0x5822bc[_0xbf03('0xf')][_0x5a879b];delete _0x5822bc[_0xbf03('0x11')][_0x5a879b];});}else{ut[_0xbf03('0x4c')](_0xbf03('0x52'));delete this[_0xbf03('0xf')][_0x5a879b];delete this[_0xbf03('0x11')][_0x5a879b];}};Fax[_0xbf03('0x1f')][_0xbf03('0x53')]=function(_0x2132fe){var _0x3e1f99=this;if(this[_0xbf03('0xf')][_0x2132fe['uniqueid']]){if(this[_0xbf03('0x11')][_0x2132fe['uniqueid']]){this[_0xbf03('0xf')][_0x2132fe[_0xbf03('0x24')]]['id']=this[_0xbf03('0x11')][_0x2132fe[_0xbf03('0x24')]]['id'];this['channels'][_0x2132fe[_0xbf03('0x24')]][_0xbf03('0x26')]=this[_0xbf03('0x11')][_0x2132fe[_0xbf03('0x24')]][_0xbf03('0x26')];}logger[_0xbf03('0x27')](_0x2132fe[_0xbf03('0x24')],this[_0xbf03('0x11')][_0x2132fe['uniqueid']]?_0xbf03('0x54'):_0xbf03('0x55'),JSON[_0xbf03('0x43')](this[_0xbf03('0xf')][_0x2132fe[_0xbf03('0x24')]]));if(this[_0xbf03('0x11')][_0x2132fe[_0xbf03('0x24')]]){if(this[_0xbf03('0xf')][_0x2132fe[_0xbf03('0x24')]]['faxpages']>0x0&&this[_0xbf03('0xf')][_0x2132fe[_0xbf03('0x24')]][_0xbf03('0x19')]===_0xbf03('0x56')){this[_0xbf03('0x4e')](_0x2132fe['uniqueid'],!![]);}else{this['updateStatus'](_0x2132fe[_0xbf03('0x24')],![],this[_0xbf03('0xf')][_0x2132fe['uniqueid']][_0xbf03('0x57')]?_0xbf03('0x58')+this[_0xbf03('0xf')][_0x2132fe[_0xbf03('0x24')]][_0xbf03('0x57')]:_0xbf03('0x59'));}}}};Fax[_0xbf03('0x1f')]['send']=function(_0x218e78){var _0x543cc6=this;return new BPromise(function(_0x14d7c0,_0x4470d2){_0x543cc6[_0xbf03('0x5a')](_0x218e78,_0x543cc6[_0xbf03('0x10')][_0x218e78[_0xbf03('0x5b')]])[_0xbf03('0x3d')](function(_0x47bebd){ut['logger']('[Fax][execOriginate][success]',_0x47bebd);_0x14d7c0(ut[_0xbf03('0x39')](_0xbf03('0x5c')));})['catch'](function(_0x2e2523){ut[_0xbf03('0x4c')](_0xbf03('0x5d'),_0x2e2523);updateStatus(_0x218e78);_0x4470d2(ut[_0xbf03('0x39')](_0xbf03('0x5e')));});});};Fax['prototype'][_0xbf03('0x5f')]=function(_0x1c7727){var _0x479ef1=this;return new BPromise(function(_0x192bc9,_0x5b72d1){var _0x40a017=_0x479ef1['checkTrunk'](_0x479ef1[_0xbf03('0x10')][_0x1c7727['FaxAccountId']][_0xbf03('0x60')],_0x1c7727);if(_0x40a017[_0xbf03('0x61')]){_0x192bc9(ut[_0xbf03('0x39')]('Trunk\x20Reachable'));}else{_0x5b72d1(ut[_0xbf03('0x39')](_0x40a017[_0xbf03('0x39')]));}});};function originate(_0x5291cb,_0x26b432,_0x28f15f){return new BPromise(function(_0x1c6b18,_0x318d97){if(_0x28f15f){var _0x19faf4=util['format']('gs\x20-q\x20-dNOPAUSE\x20-dBATCH\x20-sDEVICE=tiffg4\x20-sPAPERSIZE=letter\x20-sOutputFile=/var/opt/motion2/server/files/attachments/%s.tif\x20\x20%s\x20-c\x20quit',path['parse'](_0x5291cb[_0xbf03('0x62')])[_0xbf03('0x26')],_0x5291cb[_0xbf03('0x62')]);gs[_0xbf03('0x63')](_0x19faf4)[_0xbf03('0x3d')](function(){_0x5291cb[_0xbf03('0x62')]=util[_0xbf03('0x64')](_0xbf03('0x65'),path[_0xbf03('0x3b')](_0x5291cb['path'])[_0xbf03('0x66')],path[_0xbf03('0x3b')](_0x5291cb[_0xbf03('0x62')])[_0xbf03('0x26')]);_0x26b432[_0xbf03('0x67')]=_0x5291cb[_0xbf03('0x62')];ut[_0xbf03('0x4c')](_0xbf03('0x68'),'');ami[_0xbf03('0x69')](ut[_0xbf03('0x6a')](_0x5291cb,_0x26b432))[_0xbf03('0x3d')](function(_0x3d55c6){_0x1c6b18(_0x3d55c6);})[_0xbf03('0x40')](function(_0x5c37fb){_0x318d97(_0x5c37fb);});})[_0xbf03('0x40')](function(_0x4f35d9){_0x318d97(_0x4f35d9);});}else{ami['Action'](ut['variablesAction'](_0x5291cb,_0x26b432))['then'](function(_0x16ae91){_0x1c6b18(_0x16ae91);})[_0xbf03('0x40')](function(_0x3761e0){_0x318d97(_0x3761e0);});}});}Fax[_0xbf03('0x1f')]['execOriginate']=function(_0x4ebc1f,_0xdd71c6){var _0x529209=this;return new BPromise(function(_0x4632ac,_0x5d16a4){var _0x418f01=uuid['v4']();var _0x36a768=ut[_0xbf03('0x6b')](_0x4ebc1f,_0xdd71c6);_0x529209[_0xbf03('0x11')][_0x418f01]=new Action(_0x418f01,_0xdd71c6,_0x4ebc1f);var _0xf24f71=_0x529209[_0xbf03('0x11')][_0x418f01];if(path[_0xbf03('0x3b')](_0x4ebc1f['path'])[_0xbf03('0x6c')]==='.pdf'){originate(_0xf24f71,_0x36a768,!![])[_0xbf03('0x3d')](function(_0x1db868){_0x4632ac(_0x1db868);})[_0xbf03('0x40')](function(_0x44b83e){_0x5d16a4(_0x44b83e);});}else{originate(_0xf24f71,_0x36a768,![])[_0xbf03('0x3d')](function(_0x175ce3){_0x4632ac(_0x175ce3);})[_0xbf03('0x40')](function(_0x20f9a4){_0x5d16a4(_0x20f9a4);});}});};Fax[_0xbf03('0x1f')][_0xbf03('0x6d')]=function(_0x1c096e){return!_[_0xbf03('0x6e')](_0x1c096e)&&!_['isNil'](_0x1c096e[_0xbf03('0x26')])&&!_['isNil'](_0x1c096e[_0xbf03('0x6f')])&&_0x1c096e['active']&&!_[_0xbf03('0x6e')](this[_0xbf03('0x70')][util[_0xbf03('0x64')](_0xbf03('0x71'),_0x1c096e[_0xbf03('0x26')])])&&!_[_0xbf03('0x6e')](this[_0xbf03('0x70')][util['format'](_0xbf03('0x71'),_0x1c096e[_0xbf03('0x26')])]['status'])&&(this[_0xbf03('0x70')][util[_0xbf03('0x64')](_0xbf03('0x71'),_0x1c096e[_0xbf03('0x26')])]['status']==='reachable'||this[_0xbf03('0x70')][util[_0xbf03('0x64')]('SIP/%s',_0x1c096e[_0xbf03('0x26')])][_0xbf03('0x2f')]==='unmonitored');};Fax[_0xbf03('0x1f')][_0xbf03('0x72')]=function(_0x5adec5,_0xcfea1){if(!this[_0xbf03('0x6d')](_0x5adec5)){ut[_0xbf03('0x4c')](_0xbf03('0x73'),_[_0xbf03('0x6e')](_0x5adec5)?'':_0x5adec5[_0xbf03('0x26')]+'\x20Trunk\x20is\x20not\x20active');return{'isValid':![],'message':_0xbf03('0x74')};}if(_['isNil'](_0xcfea1[_0xbf03('0x7')])){ut[_0xbf03('0x4c')]('[Fax][checkTrunk][Empty\x20Fax]',JSON['stringify'](_0xcfea1));return{'isValid':![],'message':_0xbf03('0x75')};}if(_[_0xbf03('0x6e')](_0xcfea1['path'])){ut['logger']('[Fax][checkTrunk][Empty\x20path]',JSON['stringify'](_0xcfea1));return{'isValid':![],'message':_0xbf03('0x76')};}return{'isValid':!![],'message':_0xbf03('0x77')};};module[_0xbf03('0x78')]=Fax;
\ No newline at end of file
diff --git a/server/services/ami/fax/rpcDb.js b/server/services/ami/fax/rpcDb.js
index 34539b1..de6a1cf 100644
--- a/server/services/ami/fax/rpcDb.js
+++ b/server/services/ami/fax/rpcDb.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x3f5e=['then','catch','[Notify]\x20','util','../../../config/logger','preview','lodash','error','inspect','notify'];(function(_0x55e2bc,_0x49bffb){var _0x195837=function(_0x3e32fc){while(--_0x3e32fc){_0x55e2bc['push'](_0x55e2bc['shift']());}};_0x195837(++_0x49bffb);}(_0x3f5e,0x189));var _0xe3f5=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3f5e[_0x3dd15e];return _0x231fd0;};'use strict';var util=require(_0xe3f5('0x0'));var BPromise=require('bluebird');var logger=require(_0xe3f5('0x1'))(_0xe3f5('0x2'));var _=require(_0xe3f5('0x3'));var faxAccount=require('../rpc/faxAccount');function loggerCatch(_0x2d72dc){return function(_0x40a403){logger[_0xe3f5('0x4')](_0x2d72dc,util[_0xe3f5('0x5')](_0x40a403,{'showHidden':![],'depth':null}));};}exports[_0xe3f5('0x6')]=function(_0x1f1958,_0x1c2efa){return BPromise['resolve']()[_0xe3f5('0x7')](faxAccount[_0xe3f5('0x6')](_0x1f1958,_0x1c2efa))[_0xe3f5('0x8')](loggerCatch(_0xe3f5('0x9')));};
\ No newline at end of file
+var _0x9224=['../../../config/logger','preview','lodash','../rpc/faxAccount','error','inspect','notify','resolve','then','catch','[Notify]\x20'];(function(_0x469852,_0x532e8c){var _0xa844b9=function(_0x511046){while(--_0x511046){_0x469852['push'](_0x469852['shift']());}};_0xa844b9(++_0x532e8c);}(_0x9224,0x11e));var _0x4922=function(_0x295f92,_0x5e9fb2){_0x295f92=_0x295f92-0x0;var _0x38c56f=_0x9224[_0x295f92];return _0x38c56f;};'use strict';var util=require('util');var BPromise=require('bluebird');var logger=require(_0x4922('0x0'))(_0x4922('0x1'));var _=require(_0x4922('0x2'));var faxAccount=require(_0x4922('0x3'));function loggerCatch(_0x2d6602){return function(_0x4ebaf3){logger[_0x4922('0x4')](_0x2d6602,util[_0x4922('0x5')](_0x4ebaf3,{'showHidden':![],'depth':null}));};}exports[_0x4922('0x6')]=function(_0x25f8b6,_0x5de1e4){return BPromise[_0x4922('0x7')]()[_0x4922('0x8')](faxAccount['notify'](_0x25f8b6,_0x5de1e4))[_0x4922('0x9')](loggerCatch(_0x4922('0xa')));};
\ No newline at end of file
diff --git a/server/services/ami/fax/util/gs.js b/server/services/ami/fax/util/gs.js
index 5501440..210f956 100644
--- a/server/services/ami/fax/util/gs.js
+++ b/server/services/ami/fax/util/gs.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x500f=['child_process','exec','info','\x20Error\x20:','inspect','util'];(function(_0x39bbbc,_0x10aab4){var _0xf946c2=function(_0x572b9e){while(--_0x572b9e){_0x39bbbc['push'](_0x39bbbc['shift']());}};_0xf946c2(++_0x10aab4);}(_0x500f,0x1b5));var _0xf500=function(_0x5948dd,_0x1f6ac8){_0x5948dd=_0x5948dd-0x0;var _0xb1f8be=_0x500f[_0x5948dd];return _0xb1f8be;};'use strict';var util=require(_0xf500('0x0'));var logger=require('../../../../config/logger')('fax');var BPromise=require('bluebird');var exec=require(_0xf500('0x1'))[_0xf500('0x2')];exports['execute']=function(_0x394992){return new BPromise(function(_0x36cfed,_0x40937e){exec(_0x394992,function(_0x437d6f,_0x3a0bd5,_0x278844){logger['info']('Exec\x20gs',_0x3a0bd5);if(_0x437d6f){logger[_0xf500('0x3')]('Exec\x20gs',_0xf500('0x4'),util[_0xf500('0x5')](_0x437d6f,{'showHidden':![],'depth':null}),_0x3a0bd5,_0x278844);_0x40937e(_0x437d6f);}_0x36cfed(_0x3a0bd5);});});};
\ No newline at end of file
+var _0xb650=['child_process','exec','execute','info','Exec\x20gs','\x20Error\x20:','inspect','util','../../../../config/logger','fax','bluebird'];(function(_0x4061e0,_0x40f378){var _0x1a5ef2=function(_0x25e09a){while(--_0x25e09a){_0x4061e0['push'](_0x4061e0['shift']());}};_0x1a5ef2(++_0x40f378);}(_0xb650,0xc2));var _0x0b65=function(_0x17bb0c,_0x1e4f75){_0x17bb0c=_0x17bb0c-0x0;var _0x2beb45=_0xb650[_0x17bb0c];return _0x2beb45;};'use strict';var util=require(_0x0b65('0x0'));var logger=require(_0x0b65('0x1'))(_0x0b65('0x2'));var BPromise=require(_0x0b65('0x3'));var exec=require(_0x0b65('0x4'))[_0x0b65('0x5')];exports[_0x0b65('0x6')]=function(_0x441f53){return new BPromise(function(_0x5c624d,_0x2d6366){exec(_0x441f53,function(_0x4af9e0,_0xf46ac8,_0x5ad669){logger[_0x0b65('0x7')]('Exec\x20gs',_0xf46ac8);if(_0x4af9e0){logger[_0x0b65('0x7')](_0x0b65('0x8'),_0x0b65('0x9'),util[_0x0b65('0xa')](_0x4af9e0,{'showHidden':![],'depth':null}),_0xf46ac8,_0x5ad669);_0x2d6366(_0x4af9e0);}_0x5c624d(_0xf46ac8);});});};
\ No newline at end of file
diff --git a/server/services/ami/fax/util/util.js b/server/services/ami/fax/util/util.js
index 066dde1..7328db9 100644
--- a/server/services/ami/fax/util/util.js
+++ b/server/services/ami/fax/util/util.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xf109=['t38timeout','localstationid','uniqueid','channel','xcally-motion-fax','from-sip','\x22%s\x22\x20<%s>','headerinfo','util','lodash','moment','logger','info','inspect','addVariables','ecm','minrate','maxrate','format','\x22%s\x22','modem','faxdetect'];(function(_0x5ddb1c,_0x5ea4df){var _0x354adc=function(_0x2dfb1f){while(--_0x2dfb1f){_0x5ddb1c['push'](_0x5ddb1c['shift']());}};_0x354adc(++_0x5ea4df);}(_0xf109,0xce));var _0x9f10=function(_0x32f7d7,_0x54231b){_0x32f7d7=_0x32f7d7-0x0;var _0x133d09=_0xf109[_0x32f7d7];return _0x133d09;};'use strict';var util=require(_0x9f10('0x0'));var _=require(_0x9f10('0x1'));var moment=require(_0x9f10('0x2'));var logger=require('../../../../config/logger')('fax');exports['message']=function(_0x3659ce){return{'message':_0x3659ce};};exports[_0x9f10('0x3')]=function(_0x74d0ee,_0x26f01c){logger[_0x9f10('0x4')](_0x74d0ee,util[_0x9f10('0x5')](_0x26f01c,{'showHidden':![],'depth':null}));};exports[_0x9f10('0x6')]=function(_0xd3137b,_0x227a29){var _0x2a877e={'XMF-ECM':_0x227a29[_0x9f10('0x7')],'XMF-HEADERINFO':_0x227a29['headerinfo'],'XMF-MINRATE':_0x227a29[_0x9f10('0x8')],'XMF-MAXRATE':_0x227a29[_0x9f10('0x9')],'XMF-MODEM':util[_0x9f10('0xa')](_0x9f10('0xb'),_0x227a29[_0x9f10('0xc')]),'XMF-GATEWAY':_0x227a29['gateway'],'XMF-FAXDETECT':_0x227a29[_0x9f10('0xd')],'XMF-T38TIMEOUT':_0x227a29[_0x9f10('0xe')],'XMF-LOCALSTATIONID':_0x227a29[_0x9f10('0xf')],'XMF-PATH':_0xd3137b['path']};return _0x2a877e;};exports['variablesAction']=function(_0x3fac2b,_0x311935){return{'actionid':_0x3fac2b[_0x9f10('0x10')],'action':'originate','channel':_0x3fac2b[_0x9f10('0x11')],'Exten':_0x9f10('0x12'),'Context':_0x9f10('0x13'),'Priority':'1','callerid':util['format'](_0x9f10('0x14'),_0x3fac2b[_0x9f10('0x15')]?_0x3fac2b['headerinfo']:'',_0x3fac2b[_0x9f10('0xf')]),'variable':_0x311935,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x3fac2b[_0x9f10('0x10')]};};
\ No newline at end of file
+var _0x68fc=['from-sip','\x22%s\x22\x20<%s>','localstationid','util','lodash','moment','message','logger','info','inspect','addVariables','ecm','headerinfo','minrate','maxrate','format','\x22%s\x22','modem','gateway','faxdetect','t38timeout','path','variablesAction','uniqueid','originate','channel','xcally-motion-fax'];(function(_0x100e36,_0x4da225){var _0x1df0c9=function(_0xe4b84f){while(--_0xe4b84f){_0x100e36['push'](_0x100e36['shift']());}};_0x1df0c9(++_0x4da225);}(_0x68fc,0xa5));var _0xc68f=function(_0x3e08e3,_0x282c0a){_0x3e08e3=_0x3e08e3-0x0;var _0x3ed43a=_0x68fc[_0x3e08e3];return _0x3ed43a;};'use strict';var util=require(_0xc68f('0x0'));var _=require(_0xc68f('0x1'));var moment=require(_0xc68f('0x2'));var logger=require('../../../../config/logger')('fax');exports[_0xc68f('0x3')]=function(_0x506fb5){return{'message':_0x506fb5};};exports[_0xc68f('0x4')]=function(_0x593648,_0x5899ea){logger[_0xc68f('0x5')](_0x593648,util[_0xc68f('0x6')](_0x5899ea,{'showHidden':![],'depth':null}));};exports[_0xc68f('0x7')]=function(_0x363cdf,_0x4fcce4){var _0x4a6f7d={'XMF-ECM':_0x4fcce4[_0xc68f('0x8')],'XMF-HEADERINFO':_0x4fcce4[_0xc68f('0x9')],'XMF-MINRATE':_0x4fcce4[_0xc68f('0xa')],'XMF-MAXRATE':_0x4fcce4[_0xc68f('0xb')],'XMF-MODEM':util[_0xc68f('0xc')](_0xc68f('0xd'),_0x4fcce4[_0xc68f('0xe')]),'XMF-GATEWAY':_0x4fcce4[_0xc68f('0xf')],'XMF-FAXDETECT':_0x4fcce4[_0xc68f('0x10')],'XMF-T38TIMEOUT':_0x4fcce4[_0xc68f('0x11')],'XMF-LOCALSTATIONID':_0x4fcce4['localstationid'],'XMF-PATH':_0x363cdf[_0xc68f('0x12')]};return _0x4a6f7d;};exports[_0xc68f('0x13')]=function(_0x1f2758,_0x1d4ae4){return{'actionid':_0x1f2758[_0xc68f('0x14')],'action':_0xc68f('0x15'),'channel':_0x1f2758[_0xc68f('0x16')],'Exten':_0xc68f('0x17'),'Context':_0xc68f('0x18'),'Priority':'1','callerid':util[_0xc68f('0xc')](_0xc68f('0x19'),_0x1f2758['headerinfo']?_0x1f2758[_0xc68f('0x9')]:'',_0x1f2758[_0xc68f('0x1a')]),'variable':_0x1d4ae4,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x1f2758[_0xc68f('0x14')]};};
\ No newline at end of file
diff --git a/server/services/ami/index.js b/server/services/ami/index.js
index 2e15748..ce55cf8 100644
--- a/server/services/ami/index.js
+++ b/server/services/ami/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xb862=['log','listen','sync','bluebird','util','moment','./realtime','./dialer','./preview','./rpc/user','./rpc/voiceQueue','./rpc/voiceQueueReport','./rpc/trunk','./rpc/template','./rpc/voiceExtension','./rpc/faxAccount','./rpc/integrations/zendesk','./rpc/integrations/salesforce','./rpc/integrations/sugarcrm','./rpc/integrations/freshdesk','./rpc/integrations/desk','./rpc/integrations/zoho','./rpc/integrations/freshsales','./rpc/integrations/servicenow','get','hour','resolve','then','getAgents','initAgents','initTelephones','getTrunks','getVoiceQueues','initVoiceQueues','getTriggers','initTriggers','getTemplates','getZendeskAccounts','getSalesforceAccounts','initSalesforceAccounts','getSugarcrmAccounts','initSugarcrmAccounts','getFreshdeskAccounts','initFreshdeskAccounts','getDeskAccounts','initDeskAccounts','getZohoAccounts','initZohoAccounts','getVtigerAccounts','getFreshsalesAccounts','initFreshsalesAccounts','getServicenowAccounts','initServicenowAccounts','initDynamics365Accounts','getCampaigns','initCampaigns','getVoiceExtensions','getFaxAccounts','initFaxAccounts','initVoiceQueueReports','getVoiceQueueHopperHistory','initVoiceQueueHopperHistory','getCampaignHopperHistory','initCampaignHopperHistory','getVoiceCallReports','initVoiceCallReports','catch'];(function(_0x38f522,_0x33bd57){var _0x39bec5=function(_0x5b7c63){while(--_0x5b7c63){_0x38f522['push'](_0x38f522['shift']());}};_0x39bec5(++_0x33bd57);}(_0xb862,0x1d8));var _0x2b86=function(_0x494c3c,_0x54367a){_0x494c3c=_0x494c3c-0x0;var _0x431e00=_0xb862[_0x494c3c];return _0x431e00;};'use strict';var BPromise=require(_0x2b86('0x0'));var util=require(_0x2b86('0x1'));var moment=require(_0x2b86('0x2'));var server=require('./server');var Realtime=require(_0x2b86('0x3'));var Report=require('./report');var Acw=require('./acw');var Trigger=require('./trigger');var Dialer=require(_0x2b86('0x4'));var Preview=require(_0x2b86('0x5'));var Fax=require('./fax');var user=require(_0x2b86('0x6'));var voiceQueue=require(_0x2b86('0x7'));var voiceQueueReport=require(_0x2b86('0x8'));var voiceCallReport=require('./rpc/voiceCallReport');var trunk=require(_0x2b86('0x9'));var trigger=require('./rpc/trigger');var template=require(_0x2b86('0xa'));var cmHopperHistory=require('./rpc/cmHopperHistory');var campaign=require('./rpc/campaign');var voiceExtension=require(_0x2b86('0xb'));var faxAccount=require(_0x2b86('0xc'));var zendesk=require(_0x2b86('0xd'));var salesforce=require(_0x2b86('0xe'));var sugarcrm=require(_0x2b86('0xf'));var freshdesk=require(_0x2b86('0x10'));var desk=require(_0x2b86('0x11'));var zoho=require(_0x2b86('0x12'));var vtiger=require('./rpc/integrations/vtiger');var freshsales=require(_0x2b86('0x13'));var servicenow=require(_0x2b86('0x14'));var dynamics365=require('./rpc/integrations/dynamics365');var realtime=new Realtime();var report=new Report(realtime);var acw=new Acw(realtime);var channelTrigger=new Trigger(realtime);var preview=new Preview(realtime);var dialer=new Dialer(realtime,preview);var fax=new Fax(realtime);var isTrue=!![];var initP=!![];function ifMidnight(){if(moment()[_0x2b86('0x15')](_0x2b86('0x16'))===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()[_0x2b86('0x15')](_0x2b86('0x16'))===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return BPromise[_0x2b86('0x17')]()[_0x2b86('0x18')](user[_0x2b86('0x19')]())[_0x2b86('0x18')](realtime[_0x2b86('0x1a')]())['then'](user['getTelephones']())[_0x2b86('0x18')](realtime[_0x2b86('0x1b')]())[_0x2b86('0x18')](trunk[_0x2b86('0x1c')]())[_0x2b86('0x18')](realtime['initTrunks']())[_0x2b86('0x18')](voiceQueue[_0x2b86('0x1d')]())[_0x2b86('0x18')](realtime[_0x2b86('0x1e')]())['then'](trigger[_0x2b86('0x1f')]())[_0x2b86('0x18')](realtime[_0x2b86('0x20')]())[_0x2b86('0x18')](template[_0x2b86('0x21')]())[_0x2b86('0x18')](realtime['initTemplates']())['then'](zendesk[_0x2b86('0x22')]())[_0x2b86('0x18')](realtime['initZendeskAccounts']())[_0x2b86('0x18')](salesforce[_0x2b86('0x23')]())[_0x2b86('0x18')](realtime[_0x2b86('0x24')]())[_0x2b86('0x18')](sugarcrm[_0x2b86('0x25')]())[_0x2b86('0x18')](realtime[_0x2b86('0x26')]())[_0x2b86('0x18')](freshdesk[_0x2b86('0x27')]())[_0x2b86('0x18')](realtime[_0x2b86('0x28')]())['then'](desk[_0x2b86('0x29')]())[_0x2b86('0x18')](realtime[_0x2b86('0x2a')]())[_0x2b86('0x18')](zoho[_0x2b86('0x2b')]())['then'](realtime[_0x2b86('0x2c')]())['then'](vtiger[_0x2b86('0x2d')]())[_0x2b86('0x18')](realtime['initVtigerAccounts']())[_0x2b86('0x18')](freshsales[_0x2b86('0x2e')]())[_0x2b86('0x18')](realtime[_0x2b86('0x2f')]())[_0x2b86('0x18')](servicenow[_0x2b86('0x30')]())[_0x2b86('0x18')](realtime[_0x2b86('0x31')]())['then'](dynamics365['getDynamics365Accounts']())['then'](realtime[_0x2b86('0x32')]())[_0x2b86('0x18')](campaign[_0x2b86('0x33')]())['then'](realtime[_0x2b86('0x34')]())[_0x2b86('0x18')](voiceExtension[_0x2b86('0x35')]())[_0x2b86('0x18')](realtime['initVoiceExtensions']())[_0x2b86('0x18')](faxAccount[_0x2b86('0x36')]())[_0x2b86('0x18')](realtime[_0x2b86('0x37')]())[_0x2b86('0x18')](function(){return realtime;});}function initParams(){return BPromise[_0x2b86('0x17')]()[_0x2b86('0x18')](voiceQueueReport['getVoiceQueueReports']())[_0x2b86('0x18')](realtime[_0x2b86('0x38')]())[_0x2b86('0x18')](cmHopperHistory[_0x2b86('0x39')]())[_0x2b86('0x18')](realtime[_0x2b86('0x3a')]())[_0x2b86('0x18')](cmHopperHistory[_0x2b86('0x3b')]())[_0x2b86('0x18')](realtime[_0x2b86('0x3c')]())['then'](voiceCallReport[_0x2b86('0x3d')]())[_0x2b86('0x18')](realtime[_0x2b86('0x3e')]())[_0x2b86('0x18')](function(_0x5638d3){})[_0x2b86('0x3f')](function(_0x5a68dd){console[_0x2b86('0x40')](_0x5a68dd);});}function main(){return server[_0x2b86('0x41')](realtime,preview,fax)[_0x2b86('0x18')](function(_0x4f1e5a){return initRealtime();})[_0x2b86('0x18')](function(){return initParams();})['then'](function(){report[_0x2b86('0x42')]();setInterval(initRealtime,0x1388);})['catch'](function(_0x220d8e){console[_0x2b86('0x40')](_0x220d8e);});}main();
\ No newline at end of file
+var _0xf3e0=['initServicenowAccounts','getCampaigns','initCampaigns','getVoiceExtensions','initVoiceExtensions','getFaxAccounts','getVoiceQueueReports','initVoiceQueueReports','getVoiceQueueHopperHistory','initVoiceQueueHopperHistory','getCampaignHopperHistory','initCampaignHopperHistory','getVoiceCallReports','catch','log','bluebird','util','moment','./server','./realtime','./report','./dialer','./preview','./fax','./rpc/user','./rpc/voiceQueue','./rpc/voiceCallReport','./rpc/trigger','./rpc/template','./rpc/cmHopperHistory','./rpc/campaign','./rpc/voiceExtension','./rpc/faxAccount','./rpc/integrations/zendesk','./rpc/integrations/salesforce','./rpc/integrations/vtiger','./rpc/integrations/dynamics365','get','resolve','then','getAgents','initAgents','getTelephones','initTelephones','getTrunks','initTrunks','getVoiceQueues','initTriggers','initZendeskAccounts','getSalesforceAccounts','getFreshdeskAccounts','initFreshdeskAccounts','getDeskAccounts','initDeskAccounts','initZohoAccounts','getVtigerAccounts','getFreshsalesAccounts','getServicenowAccounts'];(function(_0x2b8325,_0x527c7a){var _0x3019d3=function(_0x18982b){while(--_0x18982b){_0x2b8325['push'](_0x2b8325['shift']());}};_0x3019d3(++_0x527c7a);}(_0xf3e0,0x131));var _0x0f3e=function(_0x5d6456,_0x58ecc7){_0x5d6456=_0x5d6456-0x0;var _0x4d66c1=_0xf3e0[_0x5d6456];return _0x4d66c1;};'use strict';var BPromise=require(_0x0f3e('0x0'));var util=require(_0x0f3e('0x1'));var moment=require(_0x0f3e('0x2'));var server=require(_0x0f3e('0x3'));var Realtime=require(_0x0f3e('0x4'));var Report=require(_0x0f3e('0x5'));var Acw=require('./acw');var Trigger=require('./trigger');var Dialer=require(_0x0f3e('0x6'));var Preview=require(_0x0f3e('0x7'));var Fax=require(_0x0f3e('0x8'));var user=require(_0x0f3e('0x9'));var voiceQueue=require(_0x0f3e('0xa'));var voiceQueueReport=require('./rpc/voiceQueueReport');var voiceCallReport=require(_0x0f3e('0xb'));var trunk=require('./rpc/trunk');var trigger=require(_0x0f3e('0xc'));var template=require(_0x0f3e('0xd'));var cmHopperHistory=require(_0x0f3e('0xe'));var campaign=require(_0x0f3e('0xf'));var voiceExtension=require(_0x0f3e('0x10'));var faxAccount=require(_0x0f3e('0x11'));var zendesk=require(_0x0f3e('0x12'));var salesforce=require(_0x0f3e('0x13'));var sugarcrm=require('./rpc/integrations/sugarcrm');var freshdesk=require('./rpc/integrations/freshdesk');var desk=require('./rpc/integrations/desk');var zoho=require('./rpc/integrations/zoho');var vtiger=require(_0x0f3e('0x14'));var freshsales=require('./rpc/integrations/freshsales');var servicenow=require('./rpc/integrations/servicenow');var dynamics365=require(_0x0f3e('0x15'));var realtime=new Realtime();var report=new Report(realtime);var acw=new Acw(realtime);var channelTrigger=new Trigger(realtime);var preview=new Preview(realtime);var dialer=new Dialer(realtime,preview);var fax=new Fax(realtime);var isTrue=!![];var initP=!![];function ifMidnight(){if(moment()[_0x0f3e('0x16')]('hour')===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()[_0x0f3e('0x16')]('hour')===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return BPromise[_0x0f3e('0x17')]()[_0x0f3e('0x18')](user[_0x0f3e('0x19')]())['then'](realtime[_0x0f3e('0x1a')]())[_0x0f3e('0x18')](user[_0x0f3e('0x1b')]())[_0x0f3e('0x18')](realtime[_0x0f3e('0x1c')]())[_0x0f3e('0x18')](trunk[_0x0f3e('0x1d')]())[_0x0f3e('0x18')](realtime[_0x0f3e('0x1e')]())['then'](voiceQueue[_0x0f3e('0x1f')]())['then'](realtime['initVoiceQueues']())[_0x0f3e('0x18')](trigger['getTriggers']())['then'](realtime[_0x0f3e('0x20')]())[_0x0f3e('0x18')](template['getTemplates']())[_0x0f3e('0x18')](realtime['initTemplates']())[_0x0f3e('0x18')](zendesk['getZendeskAccounts']())['then'](realtime[_0x0f3e('0x21')]())['then'](salesforce[_0x0f3e('0x22')]())['then'](realtime['initSalesforceAccounts']())[_0x0f3e('0x18')](sugarcrm['getSugarcrmAccounts']())['then'](realtime['initSugarcrmAccounts']())['then'](freshdesk[_0x0f3e('0x23')]())[_0x0f3e('0x18')](realtime[_0x0f3e('0x24')]())[_0x0f3e('0x18')](desk[_0x0f3e('0x25')]())[_0x0f3e('0x18')](realtime[_0x0f3e('0x26')]())['then'](zoho['getZohoAccounts']())[_0x0f3e('0x18')](realtime[_0x0f3e('0x27')]())['then'](vtiger[_0x0f3e('0x28')]())[_0x0f3e('0x18')](realtime['initVtigerAccounts']())[_0x0f3e('0x18')](freshsales[_0x0f3e('0x29')]())[_0x0f3e('0x18')](realtime['initFreshsalesAccounts']())[_0x0f3e('0x18')](servicenow[_0x0f3e('0x2a')]())[_0x0f3e('0x18')](realtime[_0x0f3e('0x2b')]())['then'](dynamics365['getDynamics365Accounts']())[_0x0f3e('0x18')](realtime['initDynamics365Accounts']())[_0x0f3e('0x18')](campaign[_0x0f3e('0x2c')]())['then'](realtime[_0x0f3e('0x2d')]())['then'](voiceExtension[_0x0f3e('0x2e')]())['then'](realtime[_0x0f3e('0x2f')]())['then'](faxAccount[_0x0f3e('0x30')]())['then'](realtime['initFaxAccounts']())[_0x0f3e('0x18')](function(){return realtime;});}function initParams(){return BPromise[_0x0f3e('0x17')]()[_0x0f3e('0x18')](voiceQueueReport[_0x0f3e('0x31')]())[_0x0f3e('0x18')](realtime[_0x0f3e('0x32')]())[_0x0f3e('0x18')](cmHopperHistory[_0x0f3e('0x33')]())['then'](realtime[_0x0f3e('0x34')]())[_0x0f3e('0x18')](cmHopperHistory[_0x0f3e('0x35')]())[_0x0f3e('0x18')](realtime[_0x0f3e('0x36')]())[_0x0f3e('0x18')](voiceCallReport[_0x0f3e('0x37')]())[_0x0f3e('0x18')](realtime['initVoiceCallReports']())[_0x0f3e('0x18')](function(_0x5f482d){})[_0x0f3e('0x38')](function(_0x4b3040){console[_0x0f3e('0x39')](_0x4b3040);});}function main(){return server['listen'](realtime,preview,fax)[_0x0f3e('0x18')](function(_0x5d14c2){return initRealtime();})[_0x0f3e('0x18')](function(){return initParams();})['then'](function(){report['sync']();setInterval(initRealtime,0x1388);})['catch'](function(_0x42e5cf){console['log'](_0x42e5cf);});}main();
\ No newline at end of file
diff --git a/server/services/ami/model/agent.js b/server/services/ami/model/agent.js
index 9c115cc..610e5c1 100644
--- a/server/services/ami/model/agent.js
+++ b/server/services/ami/model/agent.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xc182=['idle','talking','statePause','format','voiceStatusCallerIdNumber','user:%s','emit','user:save','exports','lodash','util','moment','md5','ioredis','redis','localhost','socket.io-emitter','name','email','accountcode','fullname','state','stateTime','status','unknown','address','phone','mobile','interface','online','voiceStatus','voiceStatusTime','voiceStatusQueue','onhold','local','prototype','updateStatusRealtime','toLowerCase','not_inuse'];(function(_0x179391,_0x4eb9b6){var _0x2f2208=function(_0x3b2211){while(--_0x3b2211){_0x179391['push'](_0x179391['shift']());}};_0x2f2208(++_0x4eb9b6);}(_0xc182,0x7e));var _0x2c18=function(_0x13f0cd,_0x56c55d){_0x13f0cd=_0x13f0cd-0x0;var _0x354f4e=_0xc182[_0x13f0cd];return _0x354f4e;};'use strict';var _=require(_0x2c18('0x0'));var util=require(_0x2c18('0x1'));var moment=require(_0x2c18('0x2'));var md5=require(_0x2c18('0x3'));var Redis=require(_0x2c18('0x4'));var config=require('../../../config/environment');config[_0x2c18('0x5')]=_['defaults'](config[_0x2c18('0x5')],{'host':_0x2c18('0x6'),'port':0x18eb});var io=require(_0x2c18('0x7'))(new Redis(config[_0x2c18('0x5')]));function Agent(_0x8abb8d){this['id']=_0x8abb8d['id']||0x0;this['name']=_0x8abb8d[_0x2c18('0x8')]||'';this[_0x2c18('0x9')]=_0x8abb8d[_0x2c18('0x9')]||'';this[_0x2c18('0xa')]=_0x8abb8d['accountcode']||'';this[_0x2c18('0xb')]=_0x8abb8d['fullname']||'';this[_0x2c18('0xc')]='unknown';this[_0x2c18('0xd')]=0x0;this[_0x2c18('0xe')]=_0x2c18('0xf');this[_0x2c18('0x10')]='';this[_0x2c18('0x11')]='';this[_0x2c18('0x12')]='';this[_0x2c18('0x13')]='';this[_0x2c18('0x14')]=_0x8abb8d[_0x2c18('0x14')]||![];this[_0x2c18('0x15')]=_0x2c18('0xf');this[_0x2c18('0x16')]=0x0;this['voiceStatusCallerIdNumber']='';this[_0x2c18('0x17')]='';this[_0x2c18('0x18')]=![];this[_0x2c18('0x19')]=![];this[_0x2c18('0x3')]='';}Agent[_0x2c18('0x1a')][_0x2c18('0x1b')]=function(_0x131b86){var _0x4f933c;if(_0x131b86&&_0x131b86[_0x2c18('0xc')]){_0x4f933c=_0x131b86[_0x2c18('0xc')][_0x2c18('0x1c')]();switch(_0x4f933c){case _0x2c18('0x1d'):_0x4f933c=_0x2c18('0x1e');break;case'inuse':_0x4f933c=_0x2c18('0x1f');break;}}if(_0x4f933c&&this[_0x2c18('0x15')]!==_0x4f933c||_0x131b86[_0x2c18('0x20')]){this['voiceStatusTime']=_['toNumber'](moment()[_0x2c18('0x21')]('x'));}if(_0x4f933c){this['voiceStatus']=_0x4f933c;}var _0x1ffa8b={'id':this['id'],'name':this[_0x2c18('0x8')],'email':this[_0x2c18('0x9')],'accountcode':this[_0x2c18('0xa')],'fullname':this[_0x2c18('0xb')],'state':this[_0x2c18('0xc')],'stateTime':this[_0x2c18('0xd')],'status':this[_0x2c18('0xe')],'address':this[_0x2c18('0x10')],'online':this['online'],'voiceStatus':this['voiceStatus'],'voiceStatusTime':this[_0x2c18('0x16')],'voiceStatusCallerIdNumber':this[_0x2c18('0x22')],'voiceStatusQueue':this['voiceStatusQueue'],'interface':this['interface'],'onhold':this['onhold']};var _0x38778f=md5(JSON['stringify'](_0x1ffa8b));if(this[_0x2c18('0x3')]!==_0x38778f){this['md5']=_0x38778f;io['to'](util[_0x2c18('0x21')](_0x2c18('0x23'),_0x1ffa8b[_0x2c18('0x8')]))[_0x2c18('0x24')](_0x2c18('0x25'),_0x1ffa8b);}};module[_0x2c18('0x26')]=Agent;
\ No newline at end of file
+var _0x86d8=['local','md5','updateStatusRealtime','toLowerCase','idle','inuse','statePause','voiceStatusTime','format','stateTime','user:%s','emit','user:save','exports','lodash','util','../../../config/environment','redis','socket.io-emitter','name','email','accountcode','fullname','state','status','unknown','address','phone','interface','online','voiceStatus','voiceStatusCallerIdNumber','voiceStatusQueue','onhold'];(function(_0x16b13d,_0x2faf09){var _0x1f1e77=function(_0x2c4d2a){while(--_0x2c4d2a){_0x16b13d['push'](_0x16b13d['shift']());}};_0x1f1e77(++_0x2faf09);}(_0x86d8,0xb8));var _0x886d=function(_0x3def41,_0x16bccf){_0x3def41=_0x3def41-0x0;var _0x391741=_0x86d8[_0x3def41];return _0x391741;};'use strict';var _=require(_0x886d('0x0'));var util=require(_0x886d('0x1'));var moment=require('moment');var md5=require('md5');var Redis=require('ioredis');var config=require(_0x886d('0x2'));config[_0x886d('0x3')]=_['defaults'](config[_0x886d('0x3')],{'host':'localhost','port':0x18eb});var io=require(_0x886d('0x4'))(new Redis(config[_0x886d('0x3')]));function Agent(_0x22b950){this['id']=_0x22b950['id']||0x0;this[_0x886d('0x5')]=_0x22b950[_0x886d('0x5')]||'';this['email']=_0x22b950[_0x886d('0x6')]||'';this[_0x886d('0x7')]=_0x22b950[_0x886d('0x7')]||'';this[_0x886d('0x8')]=_0x22b950[_0x886d('0x8')]||'';this[_0x886d('0x9')]='unknown';this['stateTime']=0x0;this[_0x886d('0xa')]=_0x886d('0xb');this[_0x886d('0xc')]='';this[_0x886d('0xd')]='';this['mobile']='';this[_0x886d('0xe')]='';this[_0x886d('0xf')]=_0x22b950[_0x886d('0xf')]||![];this[_0x886d('0x10')]=_0x886d('0xb');this['voiceStatusTime']=0x0;this[_0x886d('0x11')]='';this[_0x886d('0x12')]='';this[_0x886d('0x13')]=![];this[_0x886d('0x14')]=![];this[_0x886d('0x15')]='';}Agent['prototype'][_0x886d('0x16')]=function(_0x34a8ee){var _0x57447f;if(_0x34a8ee&&_0x34a8ee[_0x886d('0x9')]){_0x57447f=_0x34a8ee['state'][_0x886d('0x17')]();switch(_0x57447f){case'not_inuse':_0x57447f=_0x886d('0x18');break;case _0x886d('0x19'):_0x57447f='talking';break;}}if(_0x57447f&&this[_0x886d('0x10')]!==_0x57447f||_0x34a8ee[_0x886d('0x1a')]){this[_0x886d('0x1b')]=_['toNumber'](moment()[_0x886d('0x1c')]('x'));}if(_0x57447f){this[_0x886d('0x10')]=_0x57447f;}var _0x5c7f44={'id':this['id'],'name':this[_0x886d('0x5')],'email':this[_0x886d('0x6')],'accountcode':this['accountcode'],'fullname':this[_0x886d('0x8')],'state':this[_0x886d('0x9')],'stateTime':this[_0x886d('0x1d')],'status':this[_0x886d('0xa')],'address':this[_0x886d('0xc')],'online':this[_0x886d('0xf')],'voiceStatus':this[_0x886d('0x10')],'voiceStatusTime':this[_0x886d('0x1b')],'voiceStatusCallerIdNumber':this[_0x886d('0x11')],'voiceStatusQueue':this['voiceStatusQueue'],'interface':this[_0x886d('0xe')],'onhold':this[_0x886d('0x13')]};var _0x2d10e3=md5(JSON['stringify'](_0x5c7f44));if(this[_0x886d('0x15')]!==_0x2d10e3){this[_0x886d('0x15')]=_0x2d10e3;io['to'](util['format'](_0x886d('0x1e'),_0x5c7f44[_0x886d('0x5')]))[_0x886d('0x1f')](_0x886d('0x20'),_0x5c7f44);}};module[_0x886d('0x21')]=Agent;
\ No newline at end of file
diff --git a/server/services/ami/model/campaign.js b/server/services/ami/model/campaign.js
index 00b2306..a7d6ccb 100644
--- a/server/services/ami/model/campaign.js
+++ b/server/services/ami/model/campaign.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x6868=['dialGlobalMaxRetry','dialNoSuchNumberMaxRetry','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialOrderByScheduledAt','dialPrefix','dialRandomLastDigitCallerIdNumber','dialCutDigit','TrunkBackup','Trunk','Interval','SquareProject','dialQueueProject','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','exports','name','type','campaign','originated','ivrAnswerCallsDay','message','sendMessageOneNotActive','active','limitCalls','dialTimezone','dialGlobalInterval','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency'];(function(_0x3b6f58,_0x5870de){var _0x987c61=function(_0x3a9281){while(--_0x3a9281){_0x3b6f58['push'](_0x3b6f58['shift']());}};_0x987c61(++_0x5870de);}(_0x6868,0xdd));var _0x8686=function(_0x47a537,_0x3bf6a9){_0x47a537=_0x47a537-0x0;var _0x394fb1=_0x6868[_0x47a537];return _0x394fb1;};'use strict';function Campaign(_0x4f32cf){this['id']=_0x4f32cf['id']||0x0;this['name']=_0x4f32cf[_0x8686('0x0')]||'';this[_0x8686('0x1')]=_0x4f32cf['type']||_0x8686('0x2');this[_0x8686('0x3')]=0x0;this['temp']=0x0;this[_0x8686('0x4')]=0x0;this['ivrTotalCallsDays']=0x0;this[_0x8686('0x5')]='';this[_0x8686('0x6')]=!![];this[_0x8686('0x7')]=_0x4f32cf[_0x8686('0x7')];this[_0x8686('0x8')]=_0x4f32cf[_0x8686('0x8')];this[_0x8686('0x9')]=_0x4f32cf[_0x8686('0x9')]||null;this[_0x8686('0xa')]=_0x4f32cf[_0x8686('0xa')]?_0x4f32cf[_0x8686('0xa')]:null;this['dialOriginateCallerIdName']=_0x4f32cf['dialOriginateCallerIdName'];this[_0x8686('0xb')]=_0x4f32cf['dialOriginateCallerIdNumber'];this[_0x8686('0xc')]=_0x4f32cf[_0x8686('0xc')]||0x1e;this[_0x8686('0xd')]=_0x4f32cf[_0x8686('0xd')];this[_0x8686('0xe')]=_0x4f32cf[_0x8686('0xe')];this[_0x8686('0xf')]=_0x4f32cf['dialBusyMaxRetry'];this[_0x8686('0x10')]=_0x4f32cf[_0x8686('0x10')];this[_0x8686('0x11')]=_0x4f32cf[_0x8686('0x11')];this['dialNoAnswerRetryFrequency']=_0x4f32cf[_0x8686('0x12')];this['dialGlobalMaxRetry']=_0x4f32cf[_0x8686('0x13')];this['dialNoSuchNumberMaxRetry']=_0x4f32cf[_0x8686('0x14')]||0x3;this['dialNoSuchNumberRetryFrequency']=_0x4f32cf['dialNoSuchNumberRetryFrequency']||0x96;this['dialDropMaxRetry']=_0x4f32cf[_0x8686('0x15')]||0x3;this[_0x8686('0x16')]=_0x4f32cf[_0x8686('0x16')]||0x96;this[_0x8686('0x17')]=_0x4f32cf[_0x8686('0x17')]||0x3;this[_0x8686('0x18')]=_0x4f32cf[_0x8686('0x18')]||0x96;this['dialMachineMaxRetry']=_0x4f32cf['dialMachineMaxRetry']||0x3;this[_0x8686('0x19')]=_0x4f32cf[_0x8686('0x19')]||0x96;this[_0x8686('0x1a')]=_0x4f32cf[_0x8686('0x1a')]||0x3;this[_0x8686('0x1b')]=_0x4f32cf[_0x8686('0x1b')]||0x96;this[_0x8686('0x1c')]=_0x4f32cf[_0x8686('0x1c')]||'DESC';this[_0x8686('0x1d')]=_0x4f32cf['dialPrefix']||undefined;this[_0x8686('0x1e')]=_0x4f32cf[_0x8686('0x1e')]||undefined;this[_0x8686('0x1f')]=_0x4f32cf[_0x8686('0x1f')]||undefined;this[_0x8686('0x20')]=_0x4f32cf['TrunkBackup']?_0x4f32cf['TrunkBackup']:undefined;this['Trunk']=_0x4f32cf[_0x8686('0x21')]?_0x4f32cf[_0x8686('0x21')]:undefined;this[_0x8686('0x22')]=_0x4f32cf['Interval']?_0x4f32cf[_0x8686('0x22')]:undefined;this[_0x8686('0x23')]=_0x4f32cf['SquareProject']?_0x4f32cf[_0x8686('0x23')]:undefined;this[_0x8686('0x24')]=_0x4f32cf[_0x8686('0x23')]?_0x4f32cf[_0x8686('0x23')][_0x8686('0x0')]:undefined;this[_0x8686('0x25')]=_0x4f32cf['dialAMDActive']||![];this['dialAMDInitialSilence']=_0x4f32cf[_0x8686('0x26')];this[_0x8686('0x27')]=_0x4f32cf[_0x8686('0x27')];this[_0x8686('0x28')]=_0x4f32cf[_0x8686('0x28')];this[_0x8686('0x29')]=_0x4f32cf['dialAMDTotalAnalysisTime'];this[_0x8686('0x2a')]=_0x4f32cf['dialAMDMinWordLength'];this[_0x8686('0x2b')]=_0x4f32cf['dialAMDBetweenWordsSilence'];this[_0x8686('0x2c')]=_0x4f32cf[_0x8686('0x2c')];this[_0x8686('0x2d')]=_0x4f32cf[_0x8686('0x2d')];this[_0x8686('0x2e')]=_0x4f32cf['dialAMDMaximumWordLength'];}module[_0x8686('0x2f')]=Campaign;
\ No newline at end of file
+var _0xab04=['dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','name','type','campaign','originated','temp','ivrTotalCallsDays','sendMessageOneNotActive','active','limitCalls','dialTimezone','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialOrderByScheduledAt','dialPrefix','dialRandomLastDigitCallerIdNumber','dialCutDigit','TrunkBackup','Trunk','Interval','SquareProject','dialQueueProject','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength'];(function(_0x33c82f,_0x44f7a3){var _0x1f1425=function(_0x168bb6){while(--_0x168bb6){_0x33c82f['push'](_0x33c82f['shift']());}};_0x1f1425(++_0x44f7a3);}(_0xab04,0x194));var _0x4ab0=function(_0xef1e4c,_0x5cb9ae){_0xef1e4c=_0xef1e4c-0x0;var _0x203904=_0xab04[_0xef1e4c];return _0x203904;};'use strict';function Campaign(_0x3bf5b9){this['id']=_0x3bf5b9['id']||0x0;this[_0x4ab0('0x0')]=_0x3bf5b9[_0x4ab0('0x0')]||'';this[_0x4ab0('0x1')]=_0x3bf5b9[_0x4ab0('0x1')]||_0x4ab0('0x2');this[_0x4ab0('0x3')]=0x0;this[_0x4ab0('0x4')]=0x0;this['ivrAnswerCallsDay']=0x0;this[_0x4ab0('0x5')]=0x0;this['message']='';this[_0x4ab0('0x6')]=!![];this['active']=_0x3bf5b9[_0x4ab0('0x7')];this[_0x4ab0('0x8')]=_0x3bf5b9[_0x4ab0('0x8')];this[_0x4ab0('0x9')]=_0x3bf5b9['dialTimezone']||null;this[_0x4ab0('0xa')]=_0x3bf5b9[_0x4ab0('0xa')]?_0x3bf5b9['dialGlobalInterval']:null;this['dialOriginateCallerIdName']=_0x3bf5b9[_0x4ab0('0xb')];this[_0x4ab0('0xc')]=_0x3bf5b9['dialOriginateCallerIdNumber'];this[_0x4ab0('0xd')]=_0x3bf5b9[_0x4ab0('0xd')]||0x1e;this[_0x4ab0('0xe')]=_0x3bf5b9[_0x4ab0('0xe')];this[_0x4ab0('0xf')]=_0x3bf5b9[_0x4ab0('0xf')];this['dialBusyMaxRetry']=_0x3bf5b9[_0x4ab0('0x10')];this[_0x4ab0('0x11')]=_0x3bf5b9[_0x4ab0('0x11')];this[_0x4ab0('0x12')]=_0x3bf5b9['dialNoAnswerMaxRetry'];this[_0x4ab0('0x13')]=_0x3bf5b9[_0x4ab0('0x13')];this[_0x4ab0('0x14')]=_0x3bf5b9[_0x4ab0('0x14')];this[_0x4ab0('0x15')]=_0x3bf5b9[_0x4ab0('0x15')]||0x3;this[_0x4ab0('0x16')]=_0x3bf5b9[_0x4ab0('0x16')]||0x96;this[_0x4ab0('0x17')]=_0x3bf5b9['dialDropMaxRetry']||0x3;this[_0x4ab0('0x18')]=_0x3bf5b9['dialDropRetryFrequency']||0x96;this[_0x4ab0('0x19')]=_0x3bf5b9['dialAbandonedMaxRetry']||0x3;this[_0x4ab0('0x1a')]=_0x3bf5b9['dialAbandonedRetryFrequency']||0x96;this[_0x4ab0('0x1b')]=_0x3bf5b9[_0x4ab0('0x1b')]||0x3;this[_0x4ab0('0x1c')]=_0x3bf5b9[_0x4ab0('0x1c')]||0x96;this[_0x4ab0('0x1d')]=_0x3bf5b9[_0x4ab0('0x1d')]||0x3;this[_0x4ab0('0x1e')]=_0x3bf5b9[_0x4ab0('0x1e')]||0x96;this[_0x4ab0('0x1f')]=_0x3bf5b9[_0x4ab0('0x1f')]||'DESC';this[_0x4ab0('0x20')]=_0x3bf5b9[_0x4ab0('0x20')]||undefined;this[_0x4ab0('0x21')]=_0x3bf5b9[_0x4ab0('0x21')]||undefined;this[_0x4ab0('0x22')]=_0x3bf5b9[_0x4ab0('0x22')]||undefined;this[_0x4ab0('0x23')]=_0x3bf5b9[_0x4ab0('0x23')]?_0x3bf5b9['TrunkBackup']:undefined;this[_0x4ab0('0x24')]=_0x3bf5b9[_0x4ab0('0x24')]?_0x3bf5b9[_0x4ab0('0x24')]:undefined;this[_0x4ab0('0x25')]=_0x3bf5b9[_0x4ab0('0x25')]?_0x3bf5b9['Interval']:undefined;this[_0x4ab0('0x26')]=_0x3bf5b9[_0x4ab0('0x26')]?_0x3bf5b9['SquareProject']:undefined;this[_0x4ab0('0x27')]=_0x3bf5b9['SquareProject']?_0x3bf5b9[_0x4ab0('0x26')][_0x4ab0('0x0')]:undefined;this[_0x4ab0('0x28')]=_0x3bf5b9[_0x4ab0('0x28')]||![];this[_0x4ab0('0x29')]=_0x3bf5b9['dialAMDInitialSilence'];this[_0x4ab0('0x2a')]=_0x3bf5b9[_0x4ab0('0x2a')];this[_0x4ab0('0x2b')]=_0x3bf5b9[_0x4ab0('0x2b')];this[_0x4ab0('0x2c')]=_0x3bf5b9[_0x4ab0('0x2c')];this['dialAMDMinWordLength']=_0x3bf5b9[_0x4ab0('0x2d')];this[_0x4ab0('0x2e')]=_0x3bf5b9[_0x4ab0('0x2e')];this[_0x4ab0('0x2f')]=_0x3bf5b9['dialAMDMaximumNumberOfWords'];this['dialAMDSilenceThreshold']=_0x3bf5b9[_0x4ab0('0x30')];this[_0x4ab0('0x31')]=_0x3bf5b9[_0x4ab0('0x31')];}module['exports']=Campaign;
\ No newline at end of file
diff --git a/server/services/ami/model/channel.js b/server/services/ami/model/channel.js
index 4df1225..4688839 100644
--- a/server/services/ami/model/channel.js
+++ b/server/services/ami/model/channel.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x4325=['answertime','unmanaged','lastapplication','lastdata','duration','billableseconds','holdtime','tag','monitor','monitorFilename','queue','monitors','mohtime','exports','starttime','channel','calleridnum','calleridname','connectedlinenum','context','uniqueid','linkedid','answered'];(function(_0x23db26,_0x5083b0){var _0x7d47a9=function(_0x443e16){while(--_0x443e16){_0x23db26['push'](_0x23db26['shift']());}};_0x7d47a9(++_0x5083b0);}(_0x4325,0x1da));var _0x5432=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0x4325[_0x167cc1];return _0x10bc4b;};'use strict';function Channel(){this[_0x5432('0x0')]=null;this[_0x5432('0x1')]='';this['destinationchannel']='';this[_0x5432('0x2')]=0x0;this[_0x5432('0x3')]='';this[_0x5432('0x4')]=undefined;this['connectedlinename']=undefined;this['accountcode']=0x0;this[_0x5432('0x5')]='';this[_0x5432('0x6')]=0x0;this[_0x5432('0x7')]=0x0;this['exten']=0x0;this[_0x5432('0x8')]=![];this[_0x5432('0x9')]=null;this['endtime']=null;this[_0x5432('0xa')]=![];this['abandoned']=![];this[_0x5432('0xb')]='';this[_0x5432('0xc')]='';this[_0x5432('0xd')]=0x0;this[_0x5432('0xe')]=0x0;this[_0x5432('0xf')]=0x0;this['type']=null;this[_0x5432('0x10')]=null;this['disposition']=null;this[_0x5432('0x11')]=![];this[_0x5432('0x12')]=null;this[_0x5432('0x13')]=null;this[_0x5432('0x14')]=[];this['transfercalleridnum']=undefined;this['transferconnectedlinenum']=undefined;this[_0x5432('0x15')]=0x0;}module[_0x5432('0x16')]=Channel;
\ No newline at end of file
+var _0x3ce9=['starttime','destinationchannel','calleridnum','calleridname','connectedlinenum','connectedlinename','accountcode','uniqueid','linkedid','exten','answered','answertime','unmanaged','abandoned','billableseconds','type','disposition','monitorFilename','exports'];(function(_0x3b085,_0x250543){var _0x476a57=function(_0x480941){while(--_0x480941){_0x3b085['push'](_0x3b085['shift']());}};_0x476a57(++_0x250543);}(_0x3ce9,0x85));var _0x93ce=function(_0x212a7c,_0x26ef0d){_0x212a7c=_0x212a7c-0x0;var _0x1ab30f=_0x3ce9[_0x212a7c];return _0x1ab30f;};'use strict';function Channel(){this[_0x93ce('0x0')]=null;this['channel']='';this[_0x93ce('0x1')]='';this[_0x93ce('0x2')]=0x0;this[_0x93ce('0x3')]='';this[_0x93ce('0x4')]=undefined;this[_0x93ce('0x5')]=undefined;this[_0x93ce('0x6')]=0x0;this['context']='';this[_0x93ce('0x7')]=0x0;this[_0x93ce('0x8')]=0x0;this[_0x93ce('0x9')]=0x0;this[_0x93ce('0xa')]=![];this[_0x93ce('0xb')]=null;this['endtime']=null;this[_0x93ce('0xc')]=![];this[_0x93ce('0xd')]=![];this['lastapplication']='';this['lastdata']='';this['duration']=0x0;this[_0x93ce('0xe')]=0x0;this['holdtime']=0x0;this[_0x93ce('0xf')]=null;this['tag']=null;this[_0x93ce('0x10')]=null;this['monitor']=![];this[_0x93ce('0x11')]=null;this['queue']=null;this['monitors']=[];this['transfercalleridnum']=undefined;this['transferconnectedlinenum']=undefined;this['mohtime']=0x0;}module[_0x93ce('0x12')]=Channel;
\ No newline at end of file
diff --git a/server/services/ami/model/deskAccount.js b/server/services/ami/model/deskAccount.js
index 6d2ebff..54fd9ba 100644
--- a/server/services/ami/model/deskAccount.js
+++ b/server/services/ami/model/deskAccount.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x03db=['type','serverUrl','Configurations','exports','name','username','remoteUri','authType','password','consumerKey','consumerSecret','token','tokenSecret'];(function(_0x4bd11d,_0xee69b8){var _0x328238=function(_0x42bec7){while(--_0x42bec7){_0x4bd11d['push'](_0x4bd11d['shift']());}};_0x328238(++_0xee69b8);}(_0x03db,0x156));var _0xb03d=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x03db[_0x321bb2];return _0x9c12ed;};'use strict';function DeskAccount(_0x956be5){this['id']=_0x956be5['id']||0x0;this[_0xb03d('0x0')]=_0x956be5[_0xb03d('0x0')]||'';this[_0xb03d('0x1')]=_0x956be5['username']||'';this[_0xb03d('0x2')]=_0x956be5[_0xb03d('0x2')]||'';this[_0xb03d('0x3')]=_0x956be5[_0xb03d('0x3')]||'';this[_0xb03d('0x4')]=_0x956be5['password']||'';this[_0xb03d('0x5')]=_0x956be5[_0xb03d('0x5')]||'';this[_0xb03d('0x6')]=_0x956be5['consumerSecret']||'';this[_0xb03d('0x7')]=_0x956be5['token']||'';this[_0xb03d('0x8')]=_0x956be5[_0xb03d('0x8')]||'';this[_0xb03d('0x9')]=_0x956be5[_0xb03d('0x9')]||'';this[_0xb03d('0xa')]=_0x956be5[_0xb03d('0xa')]||'';this[_0xb03d('0xb')]=_0x956be5['Configurations']||{};}module[_0xb03d('0xc')]=DeskAccount;
\ No newline at end of file
+var _0x7a2d=['remoteUri','password','consumerKey','consumerSecret','token','tokenSecret','type','serverUrl','Configurations','exports','name','username'];(function(_0x352f63,_0x4bbe67){var _0x4e883b=function(_0x134d96){while(--_0x134d96){_0x352f63['push'](_0x352f63['shift']());}};_0x4e883b(++_0x4bbe67);}(_0x7a2d,0x142));var _0xd7a2=function(_0x397748,_0x352004){_0x397748=_0x397748-0x0;var _0x248ecf=_0x7a2d[_0x397748];return _0x248ecf;};'use strict';function DeskAccount(_0x3388c3){this['id']=_0x3388c3['id']||0x0;this[_0xd7a2('0x0')]=_0x3388c3[_0xd7a2('0x0')]||'';this[_0xd7a2('0x1')]=_0x3388c3[_0xd7a2('0x1')]||'';this[_0xd7a2('0x2')]=_0x3388c3[_0xd7a2('0x2')]||'';this['authType']=_0x3388c3['authType']||'';this[_0xd7a2('0x3')]=_0x3388c3[_0xd7a2('0x3')]||'';this[_0xd7a2('0x4')]=_0x3388c3[_0xd7a2('0x4')]||'';this['consumerSecret']=_0x3388c3[_0xd7a2('0x5')]||'';this[_0xd7a2('0x6')]=_0x3388c3[_0xd7a2('0x6')]||'';this[_0xd7a2('0x7')]=_0x3388c3[_0xd7a2('0x7')]||'';this[_0xd7a2('0x8')]=_0x3388c3[_0xd7a2('0x8')]||'';this[_0xd7a2('0x9')]=_0x3388c3[_0xd7a2('0x9')]||'';this['Configurations']=_0x3388c3[_0xd7a2('0xa')]||{};}module[_0xd7a2('0xb')]=DeskAccount;
\ No newline at end of file
diff --git a/server/services/ami/model/dynamics365Account.js b/server/services/ami/model/dynamics365Account.js
index 3e8a461..f43e3ff 100644
--- a/server/services/ami/model/dynamics365Account.js
+++ b/server/services/ami/model/dynamics365Account.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xeb63=['exports','name','username','password','remoteUri','tenantId','clientId','clientSecret','serverUrl','Configurations'];(function(_0xce37a1,_0x5c3a7a){var _0x69649d=function(_0x3c2aa9){while(--_0x3c2aa9){_0xce37a1['push'](_0xce37a1['shift']());}};_0x69649d(++_0x5c3a7a);}(_0xeb63,0x105));var _0x3eb6=function(_0x4e630a,_0x3c006b){_0x4e630a=_0x4e630a-0x0;var _0x2cc905=_0xeb63[_0x4e630a];return _0x2cc905;};'use strict';function Dynamics365Account(_0x4fe67b){this['id']=_0x4fe67b['id']||0x0;this[_0x3eb6('0x0')]=_0x4fe67b['name']||'';this[_0x3eb6('0x1')]=_0x4fe67b[_0x3eb6('0x1')]||'';this['password']=_0x4fe67b[_0x3eb6('0x2')]||'';this['remoteUri']=_0x4fe67b[_0x3eb6('0x3')]||'';this[_0x3eb6('0x4')]=_0x4fe67b[_0x3eb6('0x4')]||'';this[_0x3eb6('0x5')]=_0x4fe67b['clientId']||'';this[_0x3eb6('0x6')]=_0x4fe67b[_0x3eb6('0x6')]||{};this[_0x3eb6('0x7')]=_0x4fe67b[_0x3eb6('0x7')]||'';this[_0x3eb6('0x8')]=_0x4fe67b[_0x3eb6('0x8')]||{};}module[_0x3eb6('0x9')]=Dynamics365Account;
\ No newline at end of file
+var _0x8587=['exports','name','username','password','remoteUri','tenantId','clientId','clientSecret','serverUrl','Configurations'];(function(_0x3070dc,_0x40cf11){var _0x431489=function(_0x49bc2a){while(--_0x49bc2a){_0x3070dc['push'](_0x3070dc['shift']());}};_0x431489(++_0x40cf11);}(_0x8587,0x169));var _0x7858=function(_0x555eb3,_0x2defb1){_0x555eb3=_0x555eb3-0x0;var _0x32fa3c=_0x8587[_0x555eb3];return _0x32fa3c;};'use strict';function Dynamics365Account(_0x488093){this['id']=_0x488093['id']||0x0;this[_0x7858('0x0')]=_0x488093['name']||'';this['username']=_0x488093[_0x7858('0x1')]||'';this[_0x7858('0x2')]=_0x488093[_0x7858('0x2')]||'';this[_0x7858('0x3')]=_0x488093[_0x7858('0x3')]||'';this[_0x7858('0x4')]=_0x488093['tenantId']||'';this['clientId']=_0x488093[_0x7858('0x5')]||'';this[_0x7858('0x6')]=_0x488093[_0x7858('0x6')]||{};this[_0x7858('0x7')]=_0x488093['serverUrl']||'';this[_0x7858('0x8')]=_0x488093[_0x7858('0x8')]||{};}module[_0x7858('0x9')]=Dynamics365Account;
\ No newline at end of file
diff --git a/server/services/ami/model/faxAccount.js b/server/services/ami/model/faxAccount.js
index a50587c..163ccc1 100644
--- a/server/services/ami/model/faxAccount.js
+++ b/server/services/ami/model/faxAccount.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x996f=['ecm','localstationid','minrate','maxrate','modem','v17,v27,v29','gateway','faxdetect','t38timeout','tech','SIP','Trunk','ListId','key','exports','name','description'];(function(_0x47b4d6,_0x28a641){var _0x76e8b0=function(_0x4a17b6){while(--_0x4a17b6){_0x47b4d6['push'](_0x47b4d6['shift']());}};_0x76e8b0(++_0x28a641);}(_0x996f,0x97));var _0xf996=function(_0x4d8ed9,_0x2ae284){_0x4d8ed9=_0x4d8ed9-0x0;var _0x1e2140=_0x996f[_0x4d8ed9];return _0x1e2140;};'use strict';function FaxAccount(_0x375a85){this['id']=_0x375a85['id']||0x0;this[_0xf996('0x0')]=_0x375a85[_0xf996('0x0')]||'';this['description']=_0x375a85[_0xf996('0x1')];this[_0xf996('0x2')]=_0x375a85[_0xf996('0x2')];this['headerinfo']=_0x375a85['headerinfo'];this[_0xf996('0x3')]=_0x375a85['localstationid'];this[_0xf996('0x4')]=_0x375a85[_0xf996('0x4')]||0x960;this[_0xf996('0x5')]=_0x375a85['maxrate']||0x3840;this[_0xf996('0x6')]=_0x375a85['modem']||_0xf996('0x7');this[_0xf996('0x8')]=_0x375a85[_0xf996('0x8')]||'no';this[_0xf996('0x9')]=_0x375a85[_0xf996('0x9')]||'no';this[_0xf996('0xa')]=_0x375a85[_0xf996('0xa')]||0x1388;this[_0xf996('0xb')]=_0x375a85[_0xf996('0xb')]||_0xf996('0xc');this[_0xf996('0xd')]=_0x375a85[_0xf996('0xd')]?_0x375a85[_0xf996('0xd')]:undefined;this[_0xf996('0xe')]=_0x375a85[_0xf996('0xe')];this[_0xf996('0xf')]=_0x375a85[_0xf996('0xf')];}module[_0xf996('0x10')]=FaxAccount;
\ No newline at end of file
+var _0x101e=['modem','faxdetect','t38timeout','tech','SIP','Trunk','key','exports','name','description','headerinfo','localstationid','minrate','maxrate'];(function(_0x3c59fc,_0x10dbd2){var _0x2b78d4=function(_0x5f161a){while(--_0x5f161a){_0x3c59fc['push'](_0x3c59fc['shift']());}};_0x2b78d4(++_0x10dbd2);}(_0x101e,0xbe));var _0xe101=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x101e[_0x6131cd];return _0x47e916;};'use strict';function FaxAccount(_0x1ffcdb){this['id']=_0x1ffcdb['id']||0x0;this['name']=_0x1ffcdb[_0xe101('0x0')]||'';this['description']=_0x1ffcdb[_0xe101('0x1')];this['ecm']=_0x1ffcdb['ecm'];this[_0xe101('0x2')]=_0x1ffcdb['headerinfo'];this[_0xe101('0x3')]=_0x1ffcdb['localstationid'];this[_0xe101('0x4')]=_0x1ffcdb[_0xe101('0x4')]||0x960;this[_0xe101('0x5')]=_0x1ffcdb[_0xe101('0x5')]||0x3840;this[_0xe101('0x6')]=_0x1ffcdb['modem']||'v17,v27,v29';this['gateway']=_0x1ffcdb['gateway']||'no';this['faxdetect']=_0x1ffcdb[_0xe101('0x7')]||'no';this[_0xe101('0x8')]=_0x1ffcdb[_0xe101('0x8')]||0x1388;this[_0xe101('0x9')]=_0x1ffcdb[_0xe101('0x9')]||_0xe101('0xa');this[_0xe101('0xb')]=_0x1ffcdb['Trunk']?_0x1ffcdb[_0xe101('0xb')]:undefined;this['ListId']=_0x1ffcdb['ListId'];this[_0xe101('0xc')]=_0x1ffcdb['key'];}module[_0xe101('0xd')]=FaxAccount;
\ No newline at end of file
diff --git a/server/services/ami/model/freshdeskAccount.js b/server/services/ami/model/freshdeskAccount.js
index 2b71b51..4946d45 100644
--- a/server/services/ami/model/freshdeskAccount.js
+++ b/server/services/ami/model/freshdeskAccount.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x26a4=['remoteUri','serverUrl','Configurations','exports','name','username','apiKey','token'];(function(_0x13ea00,_0x12f610){var _0x1f7347=function(_0x34ae63){while(--_0x34ae63){_0x13ea00['push'](_0x13ea00['shift']());}};_0x1f7347(++_0x12f610);}(_0x26a4,0x74));var _0x426a=function(_0x250638,_0xd1cfe){_0x250638=_0x250638-0x0;var _0x99b713=_0x26a4[_0x250638];return _0x99b713;};'use strict';function FreshdeskAccount(_0x207091){this['id']=_0x207091['id']||0x0;this[_0x426a('0x0')]=_0x207091[_0x426a('0x0')]||'';this[_0x426a('0x1')]=_0x207091[_0x426a('0x1')]||'';this[_0x426a('0x2')]=_0x207091[_0x426a('0x3')]||'';this['remoteUri']=_0x207091[_0x426a('0x4')]||'';this[_0x426a('0x5')]=_0x207091[_0x426a('0x5')]||'';this[_0x426a('0x6')]=_0x207091['Configurations']||{};}module[_0x426a('0x7')]=FreshdeskAccount;
\ No newline at end of file
+var _0x9c01=['serverUrl','Configurations','exports','name','username','apiKey','token','remoteUri'];(function(_0x5c32e0,_0x279cc8){var _0x4a5c11=function(_0x3cd97b){while(--_0x3cd97b){_0x5c32e0['push'](_0x5c32e0['shift']());}};_0x4a5c11(++_0x279cc8);}(_0x9c01,0xf3));var _0x19c0=function(_0x24faff,_0x2ade2d){_0x24faff=_0x24faff-0x0;var _0x53f8eb=_0x9c01[_0x24faff];return _0x53f8eb;};'use strict';function FreshdeskAccount(_0xf0a798){this['id']=_0xf0a798['id']||0x0;this[_0x19c0('0x0')]=_0xf0a798[_0x19c0('0x0')]||'';this['username']=_0xf0a798[_0x19c0('0x1')]||'';this[_0x19c0('0x2')]=_0xf0a798[_0x19c0('0x3')]||'';this[_0x19c0('0x4')]=_0xf0a798[_0x19c0('0x4')]||'';this[_0x19c0('0x5')]=_0xf0a798[_0x19c0('0x5')]||'';this[_0x19c0('0x6')]=_0xf0a798[_0x19c0('0x6')]||{};}module[_0x19c0('0x7')]=FreshdeskAccount;
\ No newline at end of file
diff --git a/server/services/ami/model/freshsalesAccount.js b/server/services/ami/model/freshsalesAccount.js
index e0d8223..5f58745 100644
--- a/server/services/ami/model/freshsalesAccount.js
+++ b/server/services/ami/model/freshsalesAccount.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x83e4=['username','apiKey','token','remoteUri','serverUrl','Configurations','exports','name'];(function(_0x456cbb,_0x547275){var _0x9c3a70=function(_0x1c8686){while(--_0x1c8686){_0x456cbb['push'](_0x456cbb['shift']());}};_0x9c3a70(++_0x547275);}(_0x83e4,0x137));var _0x483e=function(_0x51ad6f,_0x1e64b6){_0x51ad6f=_0x51ad6f-0x0;var _0x273ff8=_0x83e4[_0x51ad6f];return _0x273ff8;};'use strict';function FreshsalesAccount(_0x167a82){this['id']=_0x167a82['id']||0x0;this[_0x483e('0x0')]=_0x167a82['name']||'';this[_0x483e('0x1')]=_0x167a82[_0x483e('0x1')]||'';this[_0x483e('0x2')]=_0x167a82[_0x483e('0x3')]||'';this[_0x483e('0x4')]=_0x167a82['remoteUri']||'';this[_0x483e('0x5')]=_0x167a82[_0x483e('0x5')]||'';this['Configurations']=_0x167a82[_0x483e('0x6')]||{};}module[_0x483e('0x7')]=FreshsalesAccount;
\ No newline at end of file
+var _0x416a=['remoteUri','serverUrl','Configurations','name','username','apiKey'];(function(_0x47c5bf,_0x45977e){var _0x11b779=function(_0x1bd585){while(--_0x1bd585){_0x47c5bf['push'](_0x47c5bf['shift']());}};_0x11b779(++_0x45977e);}(_0x416a,0x7b));var _0xa416=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x416a[_0x3dd15e];return _0x231fd0;};'use strict';function FreshsalesAccount(_0x3135ab){this['id']=_0x3135ab['id']||0x0;this[_0xa416('0x0')]=_0x3135ab[_0xa416('0x0')]||'';this[_0xa416('0x1')]=_0x3135ab['username']||'';this[_0xa416('0x2')]=_0x3135ab['token']||'';this[_0xa416('0x3')]=_0x3135ab['remoteUri']||'';this[_0xa416('0x4')]=_0x3135ab[_0xa416('0x4')]||'';this['Configurations']=_0x3135ab[_0xa416('0x5')]||{};}module['exports']=FreshsalesAccount;
\ No newline at end of file
diff --git a/server/services/ami/model/queueReport.js b/server/services/ami/model/queueReport.js
index aea2a39..9c06cce 100644
--- a/server/services/ami/model/queueReport.js
+++ b/server/services/ami/model/queueReport.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x775e=['priority','holdtime','assigned','variables','exports','type','inbound','uniqueid','calleridnum','queuecallerjoinAt','queuecallerleaveAt','position','count','queuecallercomplete','queuecallercompleteAt','connectedlinenum','connectedlinename','accountcode','context','exten'];(function(_0x54ce4a,_0x502cba){var _0x279dce=function(_0x217ed8){while(--_0x217ed8){_0x54ce4a['push'](_0x54ce4a['shift']());}};_0x279dce(++_0x502cba);}(_0x775e,0x181));var _0xe775=function(_0x14958d,_0x3d070e){_0x14958d=_0x14958d-0x0;var _0x437911=_0x775e[_0x14958d];return _0x437911;};'use strict';function QueueReport(){this[_0xe775('0x0')]=_0xe775('0x1');this[_0xe775('0x2')]='';this[_0xe775('0x3')]='';this['calleridname']='';this['queue']='';this[_0xe775('0x4')]=null;this[_0xe775('0x5')]=null;this[_0xe775('0x6')]=0x1;this[_0xe775('0x7')]=0x1;this['queuecallerabandon']=![];this['queuecallerabandonAt']=null;this[_0xe775('0x8')]=![];this[_0xe775('0x9')]=null;this['queuecallerexit']=![];this['queuecallerexitAt']=null;this['originalposition']=0x1;this['channel']='';this[_0xe775('0xa')]='';this[_0xe775('0xb')]='';this[_0xe775('0xc')]='';this[_0xe775('0xd')]='';this[_0xe775('0xe')]='';this[_0xe775('0xf')]='';this[_0xe775('0x10')]=0x0;this[_0xe775('0x11')]=![];this['lastAssignedTo']='';this['mohtime']=0x0;this[_0xe775('0x12')]={};}module[_0xe775('0x13')]=QueueReport;
\ No newline at end of file
+var _0x21ab=['queuecallercompleteAt','queuecallerexit','queuecallerexitAt','connectedlinenum','accountcode','context','exten','priority','lastAssignedTo','exports','type','calleridnum','calleridname','queue','queuecallerleaveAt','position','queuecallerabandon','queuecallerabandonAt','queuecallercomplete'];(function(_0x8127f1,_0x20fe64){var _0x129b7f=function(_0x1c3e5a){while(--_0x1c3e5a){_0x8127f1['push'](_0x8127f1['shift']());}};_0x129b7f(++_0x20fe64);}(_0x21ab,0x7c));var _0xb21a=function(_0x2673c1,_0x489c00){_0x2673c1=_0x2673c1-0x0;var _0x46bde=_0x21ab[_0x2673c1];return _0x46bde;};'use strict';function QueueReport(){this[_0xb21a('0x0')]='inbound';this['uniqueid']='';this[_0xb21a('0x1')]='';this[_0xb21a('0x2')]='';this[_0xb21a('0x3')]='';this['queuecallerjoinAt']=null;this[_0xb21a('0x4')]=null;this[_0xb21a('0x5')]=0x1;this['count']=0x1;this[_0xb21a('0x6')]=![];this[_0xb21a('0x7')]=null;this[_0xb21a('0x8')]=![];this[_0xb21a('0x9')]=null;this[_0xb21a('0xa')]=![];this[_0xb21a('0xb')]=null;this['originalposition']=0x1;this['channel']='';this[_0xb21a('0xc')]='';this['connectedlinename']='';this[_0xb21a('0xd')]='';this[_0xb21a('0xe')]='';this[_0xb21a('0xf')]='';this[_0xb21a('0x10')]='';this['holdtime']=0x0;this['assigned']=![];this[_0xb21a('0x11')]='';this['mohtime']=0x0;this['variables']={};}module[_0xb21a('0x12')]=QueueReport;
\ No newline at end of file
diff --git a/server/services/ami/model/salesforceAccount.js b/server/services/ami/model/salesforceAccount.js
index b6d844a..46ae95c 100644
--- a/server/services/ami/model/salesforceAccount.js
+++ b/server/services/ami/model/salesforceAccount.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xf63e=['integrationTab','serverUrl','Configurations','name','username','remoteUri','password','clientSecret','securityToken','type'];(function(_0x2d987c,_0x584b28){var _0x1bb7ae=function(_0x4b1637){while(--_0x4b1637){_0x2d987c['push'](_0x2d987c['shift']());}};_0x1bb7ae(++_0x584b28);}(_0xf63e,0xa3));var _0xef63=function(_0x376c8b,_0xc2e49a){_0x376c8b=_0x376c8b-0x0;var _0x5e81f1=_0xf63e[_0x376c8b];return _0x5e81f1;};'use strict';function SalesforceAccount(_0x49ce17){this['id']=_0x49ce17['id']||0x0;this[_0xef63('0x0')]=_0x49ce17['name']||'';this['username']=_0x49ce17[_0xef63('0x1')]||'';this[_0xef63('0x2')]=_0x49ce17[_0xef63('0x2')]||'';this['password']=_0x49ce17[_0xef63('0x3')]||'';this['clientId']=_0x49ce17['clientId']||'';this['clientSecret']=_0x49ce17[_0xef63('0x4')]||'';this['securityToken']=_0x49ce17[_0xef63('0x5')]||'';this[_0xef63('0x6')]=_0x49ce17['type']||_0xef63('0x7');this['serverUrl']=_0x49ce17[_0xef63('0x8')]||'';this[_0xef63('0x9')]=_0x49ce17[_0xef63('0x9')]||{};}module['exports']=SalesforceAccount;
\ No newline at end of file
+var _0x7348=['type','serverUrl','Configurations','name','username','remoteUri','password','clientId','clientSecret','securityToken'];(function(_0x13ce0c,_0x3f2a0d){var _0x4388fb=function(_0x27db4b){while(--_0x27db4b){_0x13ce0c['push'](_0x13ce0c['shift']());}};_0x4388fb(++_0x3f2a0d);}(_0x7348,0x16b));var _0x8734=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7348[_0x3dd15e];return _0x231fd0;};'use strict';function SalesforceAccount(_0x54f965){this['id']=_0x54f965['id']||0x0;this[_0x8734('0x0')]=_0x54f965[_0x8734('0x0')]||'';this['username']=_0x54f965[_0x8734('0x1')]||'';this[_0x8734('0x2')]=_0x54f965[_0x8734('0x2')]||'';this[_0x8734('0x3')]=_0x54f965[_0x8734('0x3')]||'';this['clientId']=_0x54f965[_0x8734('0x4')]||'';this['clientSecret']=_0x54f965[_0x8734('0x5')]||'';this['securityToken']=_0x54f965[_0x8734('0x6')]||'';this[_0x8734('0x7')]=_0x54f965[_0x8734('0x7')]||'integrationTab';this[_0x8734('0x8')]=_0x54f965['serverUrl']||'';this['Configurations']=_0x54f965[_0x8734('0x9')]||{};}module['exports']=SalesforceAccount;
\ No newline at end of file
diff --git a/server/services/ami/model/servicenowAccount.js b/server/services/ami/model/servicenowAccount.js
index 5ff4b4e..9741345 100644
--- a/server/services/ami/model/servicenowAccount.js
+++ b/server/services/ami/model/servicenowAccount.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x0ab8=['username','password','remoteUri','serverUrl','Configurations','name'];(function(_0x1be833,_0x1a9d40){var _0x19dfda=function(_0x2c9396){while(--_0x2c9396){_0x1be833['push'](_0x1be833['shift']());}};_0x19dfda(++_0x1a9d40);}(_0x0ab8,0x1df));var _0x80ab=function(_0x4972ed,_0x29d03e){_0x4972ed=_0x4972ed-0x0;var _0x31c973=_0x0ab8[_0x4972ed];return _0x31c973;};'use strict';function ServicenowAccount(_0x2f7564){this['id']=_0x2f7564['id']||0x0;this['name']=_0x2f7564[_0x80ab('0x0')]||'';this[_0x80ab('0x1')]=_0x2f7564[_0x80ab('0x1')]||'';this['password']=_0x2f7564[_0x80ab('0x2')]||'';this[_0x80ab('0x3')]=_0x2f7564[_0x80ab('0x3')]||'';this[_0x80ab('0x4')]=_0x2f7564['serverUrl']||'';this[_0x80ab('0x5')]=_0x2f7564[_0x80ab('0x5')]||{};}module['exports']=ServicenowAccount;
\ No newline at end of file
+var _0xc2c8=['password','remoteUri','serverUrl','Configurations','exports','name','username'];(function(_0x3b02a6,_0x114854){var _0xddeff4=function(_0x52fd87){while(--_0x52fd87){_0x3b02a6['push'](_0x3b02a6['shift']());}};_0xddeff4(++_0x114854);}(_0xc2c8,0x171));var _0x8c2c=function(_0x1546c1,_0x233f19){_0x1546c1=_0x1546c1-0x0;var _0x5d33fe=_0xc2c8[_0x1546c1];return _0x5d33fe;};'use strict';function ServicenowAccount(_0x295315){this['id']=_0x295315['id']||0x0;this[_0x8c2c('0x0')]=_0x295315[_0x8c2c('0x0')]||'';this[_0x8c2c('0x1')]=_0x295315['username']||'';this[_0x8c2c('0x2')]=_0x295315[_0x8c2c('0x2')]||'';this[_0x8c2c('0x3')]=_0x295315['remoteUri']||'';this[_0x8c2c('0x4')]=_0x295315['serverUrl']||'';this['Configurations']=_0x295315[_0x8c2c('0x5')]||{};}module[_0x8c2c('0x6')]=ServicenowAccount;
\ No newline at end of file
diff --git a/server/services/ami/model/sugarcrmAccount.js b/server/services/ami/model/sugarcrmAccount.js
index 1002e84..5242d30 100644
--- a/server/services/ami/model/sugarcrmAccount.js
+++ b/server/services/ami/model/sugarcrmAccount.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xb5d1=['Configurations','name','username','remoteUri','serverUrl'];(function(_0xa21e0,_0x16728f){var _0x37a584=function(_0x42610a){while(--_0x42610a){_0xa21e0['push'](_0xa21e0['shift']());}};_0x37a584(++_0x16728f);}(_0xb5d1,0x10a));var _0x1b5d=function(_0x3e0558,_0x4818a4){_0x3e0558=_0x3e0558-0x0;var _0xfa1387=_0xb5d1[_0x3e0558];return _0xfa1387;};'use strict';function SugarcrmAccount(_0x3207a1){this['id']=_0x3207a1['id']||0x0;this[_0x1b5d('0x0')]=_0x3207a1[_0x1b5d('0x0')]||'';this[_0x1b5d('0x1')]=_0x3207a1[_0x1b5d('0x1')]||'';this['password']=_0x3207a1['password']||'';this[_0x1b5d('0x2')]=_0x3207a1['remoteUri']||'';this['serverUrl']=_0x3207a1[_0x1b5d('0x3')]||'';this[_0x1b5d('0x4')]=_0x3207a1[_0x1b5d('0x4')]||{};}module['exports']=SugarcrmAccount;
\ No newline at end of file
+var _0xb29e=['name','username','password','serverUrl','Configurations','exports'];(function(_0x811631,_0x38238e){var _0x565d3d=function(_0xe6c23c){while(--_0xe6c23c){_0x811631['push'](_0x811631['shift']());}};_0x565d3d(++_0x38238e);}(_0xb29e,0x150));var _0xeb29=function(_0x1a9ca4,_0x5115db){_0x1a9ca4=_0x1a9ca4-0x0;var _0x19a2c2=_0xb29e[_0x1a9ca4];return _0x19a2c2;};'use strict';function SugarcrmAccount(_0x412bdb){this['id']=_0x412bdb['id']||0x0;this['name']=_0x412bdb[_0xeb29('0x0')]||'';this[_0xeb29('0x1')]=_0x412bdb['username']||'';this[_0xeb29('0x2')]=_0x412bdb[_0xeb29('0x2')]||'';this['remoteUri']=_0x412bdb['remoteUri']||'';this[_0xeb29('0x3')]=_0x412bdb[_0xeb29('0x3')]||'';this[_0xeb29('0x4')]=_0x412bdb['Configurations']||{};}module[_0xeb29('0x5')]=SugarcrmAccount;
\ No newline at end of file
diff --git a/server/services/ami/model/telephone.js b/server/services/ami/model/telephone.js
index ce7fc70..00dd575 100644
--- a/server/services/ami/model/telephone.js
+++ b/server/services/ami/model/telephone.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xad19=['name','accountcode','state','stateTime','unknown','address'];(function(_0x48aba0,_0x42eda9){var _0x25546a=function(_0x4ae745){while(--_0x4ae745){_0x48aba0['push'](_0x48aba0['shift']());}};_0x25546a(++_0x42eda9);}(_0xad19,0x66));var _0x9ad1=function(_0x179c9a,_0x36cac5){_0x179c9a=_0x179c9a-0x0;var _0x2f2f4a=_0xad19[_0x179c9a];return _0x2f2f4a;};'use strict';function Telephone(_0x44ef5d){this['id']=_0x44ef5d['id']||0x0;this[_0x9ad1('0x0')]=_0x44ef5d[_0x9ad1('0x0')]||'';this[_0x9ad1('0x1')]=_0x44ef5d[_0x9ad1('0x1')]||'';this[_0x9ad1('0x2')]='unknown';this[_0x9ad1('0x3')]=0x0;this['status']=_0x9ad1('0x4');this[_0x9ad1('0x5')]='';}module['exports']=Telephone;
\ No newline at end of file
+var _0x05eb=['exports','name','accountcode','state','unknown','stateTime','status','address'];(function(_0x58f23c,_0x1ad6f6){var _0x679af1=function(_0xa819c7){while(--_0xa819c7){_0x58f23c['push'](_0x58f23c['shift']());}};_0x679af1(++_0x1ad6f6);}(_0x05eb,0xe1));var _0xb05e=function(_0x3e835f,_0x56b6be){_0x3e835f=_0x3e835f-0x0;var _0x59a843=_0x05eb[_0x3e835f];return _0x59a843;};'use strict';function Telephone(_0x13f648){this['id']=_0x13f648['id']||0x0;this['name']=_0x13f648[_0xb05e('0x0')]||'';this['accountcode']=_0x13f648[_0xb05e('0x1')]||'';this[_0xb05e('0x2')]=_0xb05e('0x3');this[_0xb05e('0x4')]=0x0;this[_0xb05e('0x5')]=_0xb05e('0x3');this[_0xb05e('0x6')]='';}module[_0xb05e('0x7')]=Telephone;
\ No newline at end of file
diff --git a/server/services/ami/model/template.js b/server/services/ami/model/template.js
index 11bc48f..fe2eafb 100644
--- a/server/services/ami/model/template.js
+++ b/server/services/ami/model/template.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x30ff=['name','html','exports'];(function(_0x5ccbbb,_0x3067c9){var _0x5732b2=function(_0x25d6ae){while(--_0x25d6ae){_0x5ccbbb['push'](_0x5ccbbb['shift']());}};_0x5732b2(++_0x3067c9);}(_0x30ff,0x13e));var _0xf30f=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0x30ff[_0x502c7d];return _0x30b7ed;};'use strict';function template(_0x310e86){this['id']=_0x310e86['id']||0x0;this[_0xf30f('0x0')]=_0x310e86[_0xf30f('0x0')]||'';this[_0xf30f('0x1')]=_0x310e86['html']||'';}module[_0xf30f('0x2')]=template;
\ No newline at end of file
+var _0xac47=['html','exports','name'];(function(_0x363335,_0x233d78){var _0x527bf4=function(_0x167143){while(--_0x167143){_0x363335['push'](_0x363335['shift']());}};_0x527bf4(++_0x233d78);}(_0xac47,0x1af));var _0x7ac4=function(_0x17a842,_0x1ac67a){_0x17a842=_0x17a842-0x0;var _0x142199=_0xac47[_0x17a842];return _0x142199;};'use strict';function template(_0x2f55d1){this['id']=_0x2f55d1['id']||0x0;this[_0x7ac4('0x0')]=_0x2f55d1[_0x7ac4('0x0')]||'';this[_0x7ac4('0x1')]=_0x2f55d1[_0x7ac4('0x1')]||'';}module[_0x7ac4('0x2')]=template;
\ No newline at end of file
diff --git a/server/services/ami/model/trigger.js b/server/services/ami/model/trigger.js
index 8461759..6fd4d8c 100644
--- a/server/services/ami/model/trigger.js
+++ b/server/services/ami/model/trigger.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9bde=['exports','name','channel','voice','status','AllConditions','AnyConditions','Actions'];(function(_0xbea429,_0x3bc7b1){var _0x5b355a=function(_0x59c73d){while(--_0x59c73d){_0xbea429['push'](_0xbea429['shift']());}};_0x5b355a(++_0x3bc7b1);}(_0x9bde,0xe1));var _0xe9bd=function(_0x25fb8e,_0x5c2e60){_0x25fb8e=_0x25fb8e-0x0;var _0x110b46=_0x9bde[_0x25fb8e];return _0x110b46;};'use strict';function Trigger(_0x284147){this['id']=_0x284147['id']||0x0;this[_0xe9bd('0x0')]=_0x284147['name']||'';this[_0xe9bd('0x1')]=_0x284147['channel']||_0xe9bd('0x2');this[_0xe9bd('0x3')]=_0x284147[_0xe9bd('0x3')]||![];this[_0xe9bd('0x4')]=_0x284147[_0xe9bd('0x4')]||[];this[_0xe9bd('0x5')]=_0x284147[_0xe9bd('0x5')]||[];this['Actions']=_0x284147[_0xe9bd('0x6')]||[];}module[_0xe9bd('0x7')]=Trigger;
\ No newline at end of file
+var _0x54ef=['Actions','exports','name','channel','voice','status','AllConditions','AnyConditions'];(function(_0x2aee74,_0x3019e2){var _0x2cd40b=function(_0x14ab50){while(--_0x14ab50){_0x2aee74['push'](_0x2aee74['shift']());}};_0x2cd40b(++_0x3019e2);}(_0x54ef,0x112));var _0xf54e=function(_0x514ff6,_0x16577f){_0x514ff6=_0x514ff6-0x0;var _0x219ab9=_0x54ef[_0x514ff6];return _0x219ab9;};'use strict';function Trigger(_0x19d4d5){this['id']=_0x19d4d5['id']||0x0;this[_0xf54e('0x0')]=_0x19d4d5[_0xf54e('0x0')]||'';this['channel']=_0x19d4d5[_0xf54e('0x1')]||_0xf54e('0x2');this[_0xf54e('0x3')]=_0x19d4d5[_0xf54e('0x3')]||![];this[_0xf54e('0x4')]=_0x19d4d5[_0xf54e('0x4')]||[];this[_0xf54e('0x5')]=_0x19d4d5['AnyConditions']||[];this['Actions']=_0x19d4d5[_0xf54e('0x6')]||[];}module[_0xf54e('0x7')]=Trigger;
\ No newline at end of file
diff --git a/server/services/ami/model/trunk.js b/server/services/ami/model/trunk.js
index 4c2f1a6..f48492d 100644
--- a/server/services/ami/model/trunk.js
+++ b/server/services/ami/model/trunk.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9232=['refresh','stateRegistry','registrationtime','address','exports','active','name','unknown','status','registry','indexOf','split','host','port','domain','domainport'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x9232,0x75));var _0x2923=function(_0x57fc59,_0x19f1fc){_0x57fc59=_0x57fc59-0x0;var _0x448c1e=_0x9232[_0x57fc59];return _0x448c1e;};'use strict';function Trunk(_0x3e6ba4){this['id']=_0x3e6ba4['id']||0x0;this[_0x2923('0x0')]=_0x3e6ba4['active']||![];this[_0x2923('0x1')]=_0x3e6ba4[_0x2923('0x1')]||'';this['state']=_0x2923('0x2');this['stateTime']=0x0;this[_0x2923('0x3')]=_0x2923('0x2');this['registry']=_0x3e6ba4[_0x2923('0x4')]&&_0x3e6ba4[_0x2923('0x4')][_0x2923('0x5')](':')?_0x3e6ba4['registry'][_0x2923('0x6')](':')[0x0]:'';this[_0x2923('0x7')]='';this[_0x2923('0x8')]='';this[_0x2923('0x9')]='';this[_0x2923('0xa')]='';this[_0x2923('0xb')]='';this[_0x2923('0xc')]=_0x2923('0x2');this[_0x2923('0xd')]='';this[_0x2923('0xe')]='';}module[_0x2923('0xf')]=Trunk;
\ No newline at end of file
+var _0x465a=['port','domain','domainport','refresh','stateRegistry','registrationtime','exports','active','name','state','unknown','registry','indexOf','split','host'];(function(_0x45dc79,_0x31256f){var _0x118ae6=function(_0x279862){while(--_0x279862){_0x45dc79['push'](_0x45dc79['shift']());}};_0x118ae6(++_0x31256f);}(_0x465a,0x1d8));var _0xa465=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x465a[_0xa464c9];return _0x3d73c4;};'use strict';function Trunk(_0x27691d){this['id']=_0x27691d['id']||0x0;this[_0xa465('0x0')]=_0x27691d['active']||![];this[_0xa465('0x1')]=_0x27691d[_0xa465('0x1')]||'';this[_0xa465('0x2')]=_0xa465('0x3');this['stateTime']=0x0;this['status']=_0xa465('0x3');this[_0xa465('0x4')]=_0x27691d[_0xa465('0x4')]&&_0x27691d[_0xa465('0x4')][_0xa465('0x5')](':')?_0x27691d['registry'][_0xa465('0x6')](':')[0x0]:'';this[_0xa465('0x7')]='';this[_0xa465('0x8')]='';this[_0xa465('0x9')]='';this[_0xa465('0xa')]='';this[_0xa465('0xb')]='';this[_0xa465('0xc')]='unknown';this[_0xa465('0xd')]='';this['address']='';}module[_0xa465('0xe')]=Trunk;
\ No newline at end of file
diff --git a/server/services/ami/model/voiceExtension.js b/server/services/ami/model/voiceExtension.js
index 1d2ddb0..d8adeb5 100644
--- a/server/services/ami/model/voiceExtension.js
+++ b/server/services/ami/model/voiceExtension.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xe883=['none','mandatoryDisposition','exports','exten','recordingFormat'];(function(_0x4eee0a,_0x2e55ac){var _0x183661=function(_0x314bd3){while(--_0x314bd3){_0x4eee0a['push'](_0x4eee0a['shift']());}};_0x183661(++_0x2e55ac);}(_0xe883,0x76));var _0x3e88=function(_0x56916d,_0x37b935){_0x56916d=_0x56916d-0x0;var _0x2b7f1f=_0xe883[_0x56916d];return _0x2b7f1f;};'use strict';function voiceExtension(_0x486a4c){this['id']=_0x486a4c['id']||0x0;this['exten']=_0x486a4c[_0x3e88('0x0')]||'';this['recordingFormat']=_0x486a4c[_0x3e88('0x1')]||_0x3e88('0x2');this[_0x3e88('0x3')]=_0x486a4c[_0x3e88('0x3')]||![];}module[_0x3e88('0x4')]=voiceExtension;
\ No newline at end of file
+var _0x8c0a=['recordingFormat','none','mandatoryDisposition','exports','exten'];(function(_0x45fffc,_0x3f0396){var _0x11b743=function(_0x5be52a){while(--_0x5be52a){_0x45fffc['push'](_0x45fffc['shift']());}};_0x11b743(++_0x3f0396);}(_0x8c0a,0x1a8));var _0xa8c0=function(_0x2ff20a,_0x56f373){_0x2ff20a=_0x2ff20a-0x0;var _0x49c281=_0x8c0a[_0x2ff20a];return _0x49c281;};'use strict';function voiceExtension(_0x46ebbe){this['id']=_0x46ebbe['id']||0x0;this[_0xa8c0('0x0')]=_0x46ebbe['exten']||'';this[_0xa8c0('0x1')]=_0x46ebbe[_0xa8c0('0x1')]||_0xa8c0('0x2');this['mandatoryDisposition']=_0x46ebbe[_0xa8c0('0x3')]||![];}module[_0xa8c0('0x4')]=voiceExtension;
\ No newline at end of file
diff --git a/server/services/ami/model/voiceQueue.js b/server/services/ami/model/voiceQueue.js
index aaf6797..9c2b8b7 100644
--- a/server/services/ami/model/voiceQueue.js
+++ b/server/services/ami/model/voiceQueue.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x824a=['wav','gsm','rrmemory','roundrobin','name','monitor_format','type','waiting','talking','sumDuration','unmanaged','abandoned','loggedIn','acw','sendMessageOneNotActive','message','originated','temp','dialTimezone','dialGlobalInterval','dialActive','dialMethod','progressive','dialLimitChannel','dialLimitQueue','dialPowerLevel','dropRate','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','anonymous','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','tTxX','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialGlobalMaxRetry','Trunk','TrunkBackup','dialPrefix','Interval','dialOrderByScheduledAt','dialRandomLastDigitCallerIdNumber','dialCutDigit','strategy','queueStatusComplete','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','pTalking','timeout','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundOriginateFailureCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundDropCallsDayACS','outboundReCallsDay','outboundAbandonedDay','startPredictive','handlePredictive','predictiveIntervalMultiplicativeFactor','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','dialPredictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','erlangCallToSecond','erlangBusyFactor','dialRecallMeTimeout','dialRecallInQueue','dialQueueProject2','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','mandatoryDisposition','mandatoryDispositionPause','exports','unknown','not_inuse','inuse','busy','unavailable','ringinuse'];(function(_0x55fa03,_0xcb96c2){var _0x2cd7cd=function(_0x56611f){while(--_0x56611f){_0x55fa03['push'](_0x55fa03['shift']());}};_0x2cd7cd(++_0xcb96c2);}(_0x824a,0xe0));var _0xa824=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x824a[_0xfae23b];return _0x200640;};'use strict';var statusDesc=[_0xa824('0x0'),_0xa824('0x1'),_0xa824('0x2'),_0xa824('0x3'),'invalid',_0xa824('0x4'),'ringing',_0xa824('0x5'),'onhold'];var monitorFormat={'wav':_0xa824('0x6'),'wav49':'wav49','gsm':_0xa824('0x7')};var strategy={'rrmemory':_0xa824('0x8'),'roundrobin':_0xa824('0x9')};function VoiceQueue(_0xed067d){this['id']=_0xed067d['id']||0x0;this[_0xa824('0xa')]=_0xed067d[_0xa824('0xa')]||'';this['monitor_format']=_0xed067d[_0xa824('0xb')]||'';this[_0xa824('0xc')]=_0xed067d[_0xa824('0xc')]||'inbound';this[_0xa824('0xd')]=0x0;this[_0xa824('0xe')]=0x0;this['total']=0x0;this['answered']=0x0;this[_0xa824('0xf')]=0x0;this['sumHoldTime']=0x0;this['sumBillable']=0x0;this[_0xa824('0x10')]=0x0;this[_0xa824('0x11')]=0x0;this[_0xa824('0x12')]=0x0;this['available']=0x0;this[_0xa824('0x13')]=_0xed067d['acw']||![];this['acwTimeout']=_0xed067d['acwTimeout']||0xa;this['autopause']=_0xed067d['autopause']||'no';this[_0xa824('0x14')]=!![];this[_0xa824('0x15')]='';this[_0xa824('0x16')]=0x0;this[_0xa824('0x17')]=0x0;this[_0xa824('0x18')]=_0xed067d[_0xa824('0x18')]||null;this[_0xa824('0x19')]=_0xed067d[_0xa824('0x19')]?_0xed067d['dialGlobalInterval']:null;this[_0xa824('0x1a')]=_0xed067d['dialActive'];this[_0xa824('0x1b')]=_0xed067d[_0xa824('0x1b')]||_0xa824('0x1c');this[_0xa824('0x1d')]=_0xed067d['dialLimitChannel']||0x0;this[_0xa824('0x1e')]=_0xed067d[_0xa824('0x1e')]||0x0;this[_0xa824('0x1f')]=_0xed067d[_0xa824('0x1f')]||0x1;this['dialPredictiveOptimization']=_0xed067d['dialPredictiveOptimization']||_0xa824('0x20');this[_0xa824('0x21')]=_0xed067d[_0xa824('0x21')]||0.03;this[_0xa824('0x22')]=_0xed067d[_0xa824('0x22')]||0x258;this[_0xa824('0x23')]=_0xed067d[_0xa824('0x23')]||_0xa824('0x24');this[_0xa824('0x25')]=_0xed067d['dialOriginateCallerIdNumber']||_0xa824('0x24');this[_0xa824('0x26')]=_0xed067d[_0xa824('0x26')]||0x1e;this['dialQueueOptions']=_0xed067d[_0xa824('0x27')]||_0xa824('0x28');this['dialQueueTimeout']=_0xed067d['dialQueueTimeout']||0x3;this[_0xa824('0x29')]=_0xed067d[_0xa824('0x29')]||undefined;this[_0xa824('0x2a')]=_0xed067d['dialCongestionMaxRetry']||0x3;this[_0xa824('0x2b')]=_0xed067d[_0xa824('0x2b')]||0x96;this[_0xa824('0x2c')]=_0xed067d[_0xa824('0x2c')]||0x3;this[_0xa824('0x2d')]=_0xed067d[_0xa824('0x2d')]||0x96;this[_0xa824('0x2e')]=_0xed067d[_0xa824('0x2e')]||0x3;this['dialNoAnswerRetryFrequency']=_0xed067d[_0xa824('0x2f')]||0x96;this[_0xa824('0x30')]=_0xed067d['dialNoSuchNumberMaxRetry']||0x3;this['dialNoSuchNumberRetryFrequency']=_0xed067d[_0xa824('0x31')]||0x96;this[_0xa824('0x32')]=_0xed067d[_0xa824('0x32')]||0x3;this[_0xa824('0x33')]=_0xed067d[_0xa824('0x33')]||0x96;this[_0xa824('0x34')]=_0xed067d[_0xa824('0x34')]||0x3;this['dialAbandonedRetryFrequency']=_0xed067d['dialAbandonedRetryFrequency']||0x96;this[_0xa824('0x35')]=_0xed067d['dialMachineMaxRetry']||0x3;this[_0xa824('0x36')]=_0xed067d['dialMachineRetryFrequency']||0x96;this[_0xa824('0x37')]=_0xed067d['dialAgentRejectMaxRetry']||0x3;this['dialAgentRejectRetryFrequency']=_0xed067d[_0xa824('0x38')]||0x96;this[_0xa824('0x39')]=_0xed067d[_0xa824('0x39')]||0x4;this[_0xa824('0x3a')]=_0xed067d[_0xa824('0x3a')]?_0xed067d['Trunk']:undefined;this['TrunkBackup']=_0xed067d[_0xa824('0x3b')]?_0xed067d[_0xa824('0x3b')]:undefined;this[_0xa824('0x3c')]=_0xed067d[_0xa824('0x3c')]||undefined;this['Interval']=_0xed067d[_0xa824('0x3d')]?_0xed067d['Interval']:undefined;this[_0xa824('0x3e')]=_0xed067d['dialOrderByScheduledAt']||'DESC';this[_0xa824('0x3f')]=_0xed067d[_0xa824('0x3f')]||undefined;this[_0xa824('0x40')]=_0xed067d[_0xa824('0x40')]||undefined;this[_0xa824('0x41')]=strategy[_0xed067d[_0xa824('0x41')]]||_0xa824('0x8');this[_0xa824('0x42')]=!![];this[_0xa824('0x43')]=_0xed067d[_0xa824('0x43')]||![];this[_0xa824('0x44')]=_0xed067d[_0xa824('0x44')];this[_0xa824('0x45')]=_0xed067d[_0xa824('0x45')];this[_0xa824('0x46')]=_0xed067d[_0xa824('0x46')];this[_0xa824('0x47')]=_0xed067d[_0xa824('0x47')];this[_0xa824('0x48')]=_0xed067d[_0xa824('0x48')];this[_0xa824('0x49')]=_0xed067d[_0xa824('0x49')];this[_0xa824('0x4a')]=_0xed067d['dialAMDMaximumNumberOfWords'];this[_0xa824('0x4b')]=_0xed067d['dialAMDSilenceThreshold'];this[_0xa824('0x4c')]=_0xed067d[_0xa824('0x4c')];this['outboundRejectCallsDay']=0x0;this[_0xa824('0x4d')]=0x0;this[_0xa824('0x4e')]=_0xed067d[_0xa824('0x4e')];this['outboundAnswerCallsDay']=0x0;this[_0xa824('0x4f')]=0x0;this[_0xa824('0x50')]=0x0;this['outboundBusyCallsDay']=0x0;this[_0xa824('0x51')]=0x0;this[_0xa824('0x52')]=0x0;this[_0xa824('0x53')]=0x0;this['outboundBlacklistCallsDay']=0x0;this[_0xa824('0x54')]=0x0;this[_0xa824('0x55')]=0x0;this[_0xa824('0x56')]=0x0;this[_0xa824('0x57')]=0x0;this[_0xa824('0x58')]=0x0;this[_0xa824('0x59')]=0x0;this['startProgressive']=undefined;this[_0xa824('0x5a')]=undefined;this[_0xa824('0x5b')]=undefined;this[_0xa824('0x5c')]=1.05;this['predictiveIntervalTotalCalls']=0x0;this[_0xa824('0x5d')]=0x0;this[_0xa824('0x5e')]=0x0;this[_0xa824('0x5f')]=0x0;this[_0xa824('0x60')]=0x0;this[_0xa824('0x61')]=0x0;this[_0xa824('0x62')]=0x0;this[_0xa824('0x63')]=0x0;this[_0xa824('0x64')]=_0xed067d[_0xa824('0x65')]||0x14;this[_0xa824('0x66')]=_0xed067d[_0xa824('0x65')]||0xa;this['predictiveIntervalErlangCalls']=0x0;this[_0xa824('0x67')]=0x0;this[_0xa824('0x68')]=0x1;this['erlangCalls']=0x0;this[_0xa824('0x69')]=0x0;this['erlangAbandonmentRate']=0x0;this[_0xa824('0x6a')]=0x0;this['dialRecallMeTimeout']=_0xed067d[_0xa824('0x6b')]||0x1e;this[_0xa824('0x6c')]=_0xed067d['dialRecallInQueue']||![];this[_0xa824('0x6d')]=_0xed067d[_0xa824('0x6d')]||undefined;this[_0xa824('0x6e')]=_0xed067d[_0xa824('0x6e')]||![];this[_0xa824('0x6f')]=_0xed067d[_0xa824('0x6f')]||![];this[_0xa824('0xb')]=monitorFormat[_0xed067d[_0xa824('0xb')]]?monitorFormat[_0xed067d['monitor_format']]:undefined;this[_0xa824('0x70')]=_0xed067d['mandatoryDisposition']||![];this[_0xa824('0x71')]=_0xed067d[_0xa824('0x71')]?_0xed067d[_0xa824('0x71')]:undefined;}module[_0xa824('0x72')]=VoiceQueue;
\ No newline at end of file
+var _0x52b6=['sendMessageOneNotActive','message','originated','temp','dialTimezone','dialGlobalInterval','dialActive','dialMethod','progressive','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dropRate','dialPredictiveOptimizationPercentage','dialPredictiveInterval','anonymous','dialOriginateCallerIdNumber','dialQueueOptions','tTxX','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialGlobalMaxRetry','Trunk','TrunkBackup','dialPrefix','Interval','dialOrderByScheduledAt','DESC','dialRandomLastDigitCallerIdNumber','dialCutDigit','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','outboundRejectCallsDay','pTalking','timeout','outboundAnswerCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundDropCallsDayACS','outboundReCallsDay','outboundAbandonedDay','startPredictive','predictiveIntervalMultiplicativeFactor','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalPauses','predictiveIntervalMaxThreshold','dialPredictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','erlangCalls','erlangAbandonmentRate','erlangBusyFactor','dialRecallMeTimeout','dialRecallInQueue','dialQueueProject2','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','mandatoryDisposition','mandatoryDispositionPause','exports','inuse','invalid','unavailable','ringinuse','onhold','wav','gsm','rrmemory','roundrobin','name','monitor_format','type','waiting','talking','total','sumDuration','sumHoldTime','sumBillable','abandoned','loggedIn','available','acw','acwTimeout','autopause'];(function(_0xaa0309,_0x1c8008){var _0x5de7ce=function(_0x3aa6ae){while(--_0x3aa6ae){_0xaa0309['push'](_0xaa0309['shift']());}};_0x5de7ce(++_0x1c8008);}(_0x52b6,0x1c4));var _0x652b=function(_0x33628a,_0x2df134){_0x33628a=_0x33628a-0x0;var _0x25d370=_0x52b6[_0x33628a];return _0x25d370;};'use strict';var statusDesc=['unknown','not_inuse',_0x652b('0x0'),'busy',_0x652b('0x1'),_0x652b('0x2'),'ringing',_0x652b('0x3'),_0x652b('0x4')];var monitorFormat={'wav':_0x652b('0x5'),'wav49':'wav49','gsm':_0x652b('0x6')};var strategy={'rrmemory':_0x652b('0x7'),'roundrobin':_0x652b('0x8')};function VoiceQueue(_0x1de10b){this['id']=_0x1de10b['id']||0x0;this[_0x652b('0x9')]=_0x1de10b[_0x652b('0x9')]||'';this[_0x652b('0xa')]=_0x1de10b[_0x652b('0xa')]||'';this['type']=_0x1de10b[_0x652b('0xb')]||'inbound';this[_0x652b('0xc')]=0x0;this[_0x652b('0xd')]=0x0;this[_0x652b('0xe')]=0x0;this['answered']=0x0;this[_0x652b('0xf')]=0x0;this[_0x652b('0x10')]=0x0;this[_0x652b('0x11')]=0x0;this['unmanaged']=0x0;this[_0x652b('0x12')]=0x0;this[_0x652b('0x13')]=0x0;this[_0x652b('0x14')]=0x0;this[_0x652b('0x15')]=_0x1de10b[_0x652b('0x15')]||![];this['acwTimeout']=_0x1de10b[_0x652b('0x16')]||0xa;this[_0x652b('0x17')]=_0x1de10b[_0x652b('0x17')]||'no';this[_0x652b('0x18')]=!![];this[_0x652b('0x19')]='';this[_0x652b('0x1a')]=0x0;this[_0x652b('0x1b')]=0x0;this[_0x652b('0x1c')]=_0x1de10b[_0x652b('0x1c')]||null;this['dialGlobalInterval']=_0x1de10b['dialGlobalInterval']?_0x1de10b[_0x652b('0x1d')]:null;this[_0x652b('0x1e')]=_0x1de10b[_0x652b('0x1e')];this[_0x652b('0x1f')]=_0x1de10b[_0x652b('0x1f')]||_0x652b('0x20');this[_0x652b('0x21')]=_0x1de10b[_0x652b('0x21')]||0x0;this[_0x652b('0x22')]=_0x1de10b[_0x652b('0x22')]||0x0;this[_0x652b('0x23')]=_0x1de10b[_0x652b('0x23')]||0x1;this[_0x652b('0x24')]=_0x1de10b[_0x652b('0x24')]||_0x652b('0x25');this[_0x652b('0x26')]=_0x1de10b['dialPredictiveOptimizationPercentage']||0.03;this[_0x652b('0x27')]=_0x1de10b[_0x652b('0x27')]||0x258;this['dialOriginateCallerIdName']=_0x1de10b['dialOriginateCallerIdName']||_0x652b('0x28');this[_0x652b('0x29')]=_0x1de10b[_0x652b('0x29')]||_0x652b('0x28');this['dialOriginateTimeout']=_0x1de10b['dialOriginateTimeout']||0x1e;this[_0x652b('0x2a')]=_0x1de10b['dialQueueOptions']||_0x652b('0x2b');this['dialQueueTimeout']=_0x1de10b[_0x652b('0x2c')]||0x3;this[_0x652b('0x2d')]=_0x1de10b['dialQueueProject']||undefined;this[_0x652b('0x2e')]=_0x1de10b[_0x652b('0x2e')]||0x3;this[_0x652b('0x2f')]=_0x1de10b[_0x652b('0x2f')]||0x96;this['dialBusyMaxRetry']=_0x1de10b[_0x652b('0x30')]||0x3;this[_0x652b('0x31')]=_0x1de10b[_0x652b('0x31')]||0x96;this[_0x652b('0x32')]=_0x1de10b[_0x652b('0x32')]||0x3;this[_0x652b('0x33')]=_0x1de10b[_0x652b('0x33')]||0x96;this[_0x652b('0x34')]=_0x1de10b['dialNoSuchNumberMaxRetry']||0x3;this[_0x652b('0x35')]=_0x1de10b[_0x652b('0x35')]||0x96;this[_0x652b('0x36')]=_0x1de10b[_0x652b('0x36')]||0x3;this[_0x652b('0x37')]=_0x1de10b[_0x652b('0x37')]||0x96;this[_0x652b('0x38')]=_0x1de10b[_0x652b('0x38')]||0x3;this['dialAbandonedRetryFrequency']=_0x1de10b[_0x652b('0x39')]||0x96;this[_0x652b('0x3a')]=_0x1de10b[_0x652b('0x3a')]||0x3;this['dialMachineRetryFrequency']=_0x1de10b[_0x652b('0x3b')]||0x96;this[_0x652b('0x3c')]=_0x1de10b[_0x652b('0x3c')]||0x3;this[_0x652b('0x3d')]=_0x1de10b['dialAgentRejectRetryFrequency']||0x96;this['dialGlobalMaxRetry']=_0x1de10b[_0x652b('0x3e')]||0x4;this[_0x652b('0x3f')]=_0x1de10b[_0x652b('0x3f')]?_0x1de10b[_0x652b('0x3f')]:undefined;this[_0x652b('0x40')]=_0x1de10b[_0x652b('0x40')]?_0x1de10b[_0x652b('0x40')]:undefined;this[_0x652b('0x41')]=_0x1de10b[_0x652b('0x41')]||undefined;this['Interval']=_0x1de10b[_0x652b('0x42')]?_0x1de10b[_0x652b('0x42')]:undefined;this[_0x652b('0x43')]=_0x1de10b['dialOrderByScheduledAt']||_0x652b('0x44');this[_0x652b('0x45')]=_0x1de10b[_0x652b('0x45')]||undefined;this[_0x652b('0x46')]=_0x1de10b[_0x652b('0x46')]||undefined;this['strategy']=strategy[_0x1de10b['strategy']]||_0x652b('0x7');this['queueStatusComplete']=!![];this[_0x652b('0x47')]=_0x1de10b['dialAMDActive']||![];this[_0x652b('0x48')]=_0x1de10b[_0x652b('0x48')];this[_0x652b('0x49')]=_0x1de10b[_0x652b('0x49')];this[_0x652b('0x4a')]=_0x1de10b[_0x652b('0x4a')];this[_0x652b('0x4b')]=_0x1de10b[_0x652b('0x4b')];this[_0x652b('0x4c')]=_0x1de10b[_0x652b('0x4c')];this['dialAMDBetweenWordsSilence']=_0x1de10b[_0x652b('0x4d')];this['dialAMDMaximumNumberOfWords']=_0x1de10b[_0x652b('0x4e')];this[_0x652b('0x4f')]=_0x1de10b['dialAMDSilenceThreshold'];this[_0x652b('0x50')]=_0x1de10b[_0x652b('0x50')];this[_0x652b('0x51')]=0x0;this[_0x652b('0x52')]=0x0;this['timeout']=_0x1de10b[_0x652b('0x53')];this[_0x652b('0x54')]=0x0;this['outboundAnswerAgiCallsDay']=0x0;this[_0x652b('0x55')]=0x0;this[_0x652b('0x56')]=0x0;this[_0x652b('0x57')]=0x0;this[_0x652b('0x58')]=0x0;this['outboundUnknownCallsDay']=0x0;this['outboundBlacklistCallsDay']=0x0;this['outboundOriginateFailureCallsDay']=0x0;this[_0x652b('0x59')]=0x0;this[_0x652b('0x5a')]=0x0;this[_0x652b('0x5b')]=0x0;this[_0x652b('0x5c')]=0x0;this[_0x652b('0x5d')]=0x0;this['startProgressive']=undefined;this[_0x652b('0x5e')]=undefined;this['handlePredictive']=undefined;this[_0x652b('0x5f')]=1.05;this[_0x652b('0x60')]=0x0;this[_0x652b('0x61')]=0x0;this[_0x652b('0x62')]=0x0;this[_0x652b('0x63')]=0x0;this[_0x652b('0x64')]=0x0;this[_0x652b('0x65')]=0x0;this[_0x652b('0x66')]=0x0;this['predictiveIntervalAvailable']=0x0;this[_0x652b('0x67')]=_0x1de10b[_0x652b('0x68')]||0x14;this[_0x652b('0x69')]=_0x1de10b[_0x652b('0x68')]||0xa;this[_0x652b('0x6a')]=0x0;this[_0x652b('0x6b')]=0x0;this['predictiveIntervalHitRate']=0x1;this[_0x652b('0x6c')]=0x0;this['erlangCallToSecond']=0x0;this[_0x652b('0x6d')]=0x0;this[_0x652b('0x6e')]=0x0;this[_0x652b('0x6f')]=_0x1de10b[_0x652b('0x6f')]||0x1e;this['dialRecallInQueue']=_0x1de10b[_0x652b('0x70')]||![];this[_0x652b('0x71')]=_0x1de10b[_0x652b('0x71')]||undefined;this[_0x652b('0x72')]=_0x1de10b['dialAgiAfterHangupClient']||![];this['dialAgiAfterHangupAgent']=_0x1de10b[_0x652b('0x73')]||![];this[_0x652b('0xa')]=monitorFormat[_0x1de10b[_0x652b('0xa')]]?monitorFormat[_0x1de10b[_0x652b('0xa')]]:undefined;this[_0x652b('0x74')]=_0x1de10b['mandatoryDisposition']||![];this['mandatoryDispositionPause']=_0x1de10b['mandatoryDispositionPause']?_0x1de10b[_0x652b('0x75')]:undefined;}module[_0x652b('0x76')]=VoiceQueue;
\ No newline at end of file
diff --git a/server/services/ami/model/vtigerAccount.js b/server/services/ami/model/vtigerAccount.js
index 18a1e88..a16f2fb 100644
--- a/server/services/ami/model/vtigerAccount.js
+++ b/server/services/ami/model/vtigerAccount.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9850=['remoteUri','serverUrl','Configurations','exports','name','username','accessKey'];(function(_0xa35b12,_0x4f4b9b){var _0x4a9246=function(_0x5db3ff){while(--_0x5db3ff){_0xa35b12['push'](_0xa35b12['shift']());}};_0x4a9246(++_0x4f4b9b);}(_0x9850,0xba));var _0x0985=function(_0x215336,_0x56430f){_0x215336=_0x215336-0x0;var _0x1790c9=_0x9850[_0x215336];return _0x1790c9;};'use strict';function VtigerAccount(_0x29faf3){this['id']=_0x29faf3['id']||0x0;this[_0x0985('0x0')]=_0x29faf3[_0x0985('0x0')]||'';this[_0x0985('0x1')]=_0x29faf3['username']||'';this[_0x0985('0x2')]=_0x29faf3[_0x0985('0x2')]||'';this[_0x0985('0x3')]=_0x29faf3[_0x0985('0x3')]||'';this[_0x0985('0x4')]=_0x29faf3['serverUrl']||'';this[_0x0985('0x5')]=_0x29faf3['Configurations']||{};}module[_0x0985('0x6')]=VtigerAccount;
\ No newline at end of file
+var _0x93f6=['username','accessKey','remoteUri','serverUrl','Configurations','exports','name'];(function(_0x25979f,_0x32a3eb){var _0x4de4e7=function(_0x32bbdd){while(--_0x32bbdd){_0x25979f['push'](_0x25979f['shift']());}};_0x4de4e7(++_0x32a3eb);}(_0x93f6,0x1f0));var _0x693f=function(_0x401939,_0x26b63a){_0x401939=_0x401939-0x0;var _0x343c3b=_0x93f6[_0x401939];return _0x343c3b;};'use strict';function VtigerAccount(_0x31617c){this['id']=_0x31617c['id']||0x0;this[_0x693f('0x0')]=_0x31617c[_0x693f('0x0')]||'';this[_0x693f('0x1')]=_0x31617c[_0x693f('0x1')]||'';this['accessKey']=_0x31617c[_0x693f('0x2')]||'';this[_0x693f('0x3')]=_0x31617c['remoteUri']||'';this['serverUrl']=_0x31617c[_0x693f('0x4')]||'';this[_0x693f('0x5')]=_0x31617c[_0x693f('0x5')]||{};}module[_0x693f('0x6')]=VtigerAccount;
\ No newline at end of file
diff --git a/server/services/ami/model/zendeskAccount.js b/server/services/ami/model/zendeskAccount.js
index f0719d2..6136e8b 100644
--- a/server/services/ami/model/zendeskAccount.js
+++ b/server/services/ami/model/zendeskAccount.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x0b0e=['exports','name','username','password','token','remoteUri','authType','type','serverUrl','Configurations'];(function(_0x32f05c,_0x273aef){var _0x4307ed=function(_0x1be4da){while(--_0x1be4da){_0x32f05c['push'](_0x32f05c['shift']());}};_0x4307ed(++_0x273aef);}(_0x0b0e,0x187));var _0xe0b0=function(_0x22e9fe,_0x3d019f){_0x22e9fe=_0x22e9fe-0x0;var _0x47cd19=_0x0b0e[_0x22e9fe];return _0x47cd19;};'use strict';function ZendeskAccount(_0x29cd1e){this['id']=_0x29cd1e['id']||0x0;this['name']=_0x29cd1e[_0xe0b0('0x0')]||'';this['username']=_0x29cd1e[_0xe0b0('0x1')]||'';this[_0xe0b0('0x2')]=_0x29cd1e[_0xe0b0('0x2')]||'';this[_0xe0b0('0x3')]=_0x29cd1e[_0xe0b0('0x3')]||'';this[_0xe0b0('0x4')]=_0x29cd1e[_0xe0b0('0x4')]||'';this[_0xe0b0('0x5')]=_0x29cd1e[_0xe0b0('0x5')]||'';this[_0xe0b0('0x6')]=_0x29cd1e[_0xe0b0('0x6')]||'integrationTab';this['serverUrl']=_0x29cd1e[_0xe0b0('0x7')]||'';this[_0xe0b0('0x8')]=_0x29cd1e[_0xe0b0('0x8')]||{};}module[_0xe0b0('0x9')]=ZendeskAccount;
\ No newline at end of file
+var _0x5f66=['remoteUri','authType','integrationTab','serverUrl','Configurations','exports','name','username','password','token'];(function(_0xcad7b0,_0x34fd73){var _0x56cf8d=function(_0x332613){while(--_0x332613){_0xcad7b0['push'](_0xcad7b0['shift']());}};_0x56cf8d(++_0x34fd73);}(_0x5f66,0x1a0));var _0x65f6=function(_0x4243a3,_0x447337){_0x4243a3=_0x4243a3-0x0;var _0x1b2a33=_0x5f66[_0x4243a3];return _0x1b2a33;};'use strict';function ZendeskAccount(_0x253044){this['id']=_0x253044['id']||0x0;this[_0x65f6('0x0')]=_0x253044['name']||'';this[_0x65f6('0x1')]=_0x253044[_0x65f6('0x1')]||'';this[_0x65f6('0x2')]=_0x253044[_0x65f6('0x2')]||'';this[_0x65f6('0x3')]=_0x253044['token']||'';this[_0x65f6('0x4')]=_0x253044['remoteUri']||'';this[_0x65f6('0x5')]=_0x253044[_0x65f6('0x5')]||'';this['type']=_0x253044['type']||_0x65f6('0x6');this[_0x65f6('0x7')]=_0x253044[_0x65f6('0x7')]||'';this[_0x65f6('0x8')]=_0x253044[_0x65f6('0x8')]||{};}module[_0x65f6('0x9')]=ZendeskAccount;
\ No newline at end of file
diff --git a/server/services/ami/model/zohoAccount.js b/server/services/ami/model/zohoAccount.js
index f571edb..df76e60 100644
--- a/server/services/ami/model/zohoAccount.js
+++ b/server/services/ami/model/zohoAccount.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xb19a=['zone','clientId','clientSecret','serverUrl','code','refreshToken','Configurations','exports','description','host'];(function(_0x48837d,_0x5a94de){var _0x1a34b7=function(_0x40dccf){while(--_0x40dccf){_0x48837d['push'](_0x48837d['shift']());}};_0x1a34b7(++_0x5a94de);}(_0xb19a,0xd0));var _0xab19=function(_0x47769f,_0x4fd2dd){_0x47769f=_0x47769f-0x0;var _0xdb050a=_0xb19a[_0x47769f];return _0xdb050a;};'use strict';function ZohoAccount(_0x358609){this['id']=_0x358609['id']||0x0;this['name']=_0x358609['name']||'';this[_0xab19('0x0')]=_0x358609['description']||'';this['host']=_0x358609[_0xab19('0x1')]||'';this[_0xab19('0x2')]=_0x358609[_0xab19('0x2')]||'';this[_0xab19('0x3')]=_0x358609[_0xab19('0x3')]||'';this[_0xab19('0x4')]=_0x358609[_0xab19('0x4')]||'';this['serverUrl']=_0x358609[_0xab19('0x5')]||'';this[_0xab19('0x6')]=_0x358609['code']||'';this[_0xab19('0x7')]=_0x358609['refreshToken']||'';this[_0xab19('0x8')]=_0x358609[_0xab19('0x8')]||{};}module[_0xab19('0x9')]=ZohoAccount;
\ No newline at end of file
+var _0x659c=['code','refreshToken','description','host','zone','clientId','clientSecret','serverUrl'];(function(_0x1731a9,_0x4fb551){var _0x22b9a5=function(_0x3b62fd){while(--_0x3b62fd){_0x1731a9['push'](_0x1731a9['shift']());}};_0x22b9a5(++_0x4fb551);}(_0x659c,0x1aa));var _0xc659=function(_0x75e866,_0x30b4de){_0x75e866=_0x75e866-0x0;var _0x5e4b64=_0x659c[_0x75e866];return _0x5e4b64;};'use strict';function ZohoAccount(_0x5d69e3){this['id']=_0x5d69e3['id']||0x0;this['name']=_0x5d69e3['name']||'';this[_0xc659('0x0')]=_0x5d69e3[_0xc659('0x0')]||'';this['host']=_0x5d69e3[_0xc659('0x1')]||'';this[_0xc659('0x2')]=_0x5d69e3['zone']||'';this['clientId']=_0x5d69e3[_0xc659('0x3')]||'';this[_0xc659('0x4')]=_0x5d69e3[_0xc659('0x4')]||'';this[_0xc659('0x5')]=_0x5d69e3[_0xc659('0x5')]||'';this[_0xc659('0x6')]=_0x5d69e3['code']||'';this['refreshToken']=_0x5d69e3[_0xc659('0x7')]||'';this['Configurations']=_0x5d69e3['Configurations']||{};}module['exports']=ZohoAccount;
\ No newline at end of file
diff --git a/server/services/ami/preview/action.js b/server/services/ami/preview/action.js
index 5c0b919..41e03b6 100644
--- a/server/services/ami/preview/action.js
+++ b/server/services/ami/preview/action.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x0793=['dialAnswer','membername','Agent','name','channelAgent','format','SIP/%s','calleridname','phone','Contact','lastName','active','calleridnum','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countabandonedretry','countmachineretry','countdropretry','countagentrejectretry','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','prototype','getCaller','number','exports','util','moment','isNil','string','queue','type','campaigntype'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x0793,0x193));var _0x3079=function(_0x5a7f65,_0x3a6f0a){_0x5a7f65=_0x5a7f65-0x0;var _0x5bea13=_0x0793[_0x5a7f65];return _0x5bea13;};'use strict';var util=require(_0x3079('0x0'));var _=require('lodash');var moment=require(_0x3079('0x1'));function checkNameSurname(_0x46554f,_0x41a474,_0x5907f9){var _0x10d00b='';if(!_[_0x3079('0x2')](_0x41a474)&&_0x3079('0x3')===typeof _0x41a474){_0x10d00b+=_0x41a474;}if(!_[_0x3079('0x2')](_0x5907f9)&&'string'===typeof _0x5907f9){_0x10d00b+='\x20'+_0x5907f9;}if(_0x10d00b!==''){return _0x10d00b;}return _0x46554f;}function Action(_0x3b418e,_0x55e528,_0x491dba,_0x4e933c,_0x112a42){this['uniqueid']=_0x491dba||undefined;this['idContact']=_0x3b418e['id'];this[_0x3079('0x4')]=_0x55e528['name'];this['type']=_0x55e528[_0x3079('0x5')];this[_0x3079('0x6')]=_0x3079('0x4');this[_0x3079('0x7')]=![];this[_0x3079('0x8')]=_[_0x3079('0x2')](_0x3b418e[_0x3079('0x9')])?undefined:_0x3b418e[_0x3079('0x9')][_0x3079('0xa')];this[_0x3079('0xb')]=this['membername']?util[_0x3079('0xc')](_0x3079('0xd'),this['membername']):_0x4e933c||undefined;this[_0x3079('0xe')]=checkNameSurname(_0x3b418e['Contact'][_0x3079('0xf')],_0x3b418e['Contact']['firstName'],_0x3b418e[_0x3079('0x10')][_0x3079('0x11')]);this[_0x3079('0x12')]=_0x3b418e[_0x3079('0x12')]||![];this[_0x3079('0x13')]=_0x3b418e[_0x3079('0x10')][_0x3079('0xf')];this[_0x3079('0x14')]=_0x3b418e[_0x3079('0x14')];this[_0x3079('0x15')]=_0x3b418e['countbusyretry']||0x0;this[_0x3079('0x16')]=_0x3b418e[_0x3079('0x16')]||0x0;this['countnoanswerretry']=_0x3b418e[_0x3079('0x17')]||0x0;this['countglobal']=(_0x3b418e[_0x3079('0x15')]||0x0)+(_0x3b418e[_0x3079('0x16')]||0x0)+(_0x3b418e[_0x3079('0x17')]||0x0)+(_0x3b418e[_0x3079('0x18')]||0x0)+(_0x3b418e['countdropretry']||0x0)+(_0x3b418e[_0x3079('0x19')]||0x0)+(_0x3b418e[_0x3079('0x1a')]||0x0)+(_0x3b418e['countagentrejectretry']||0x0);this[_0x3079('0x18')]=_0x3b418e[_0x3079('0x18')]||0x0;this[_0x3079('0x1b')]=_0x3b418e[_0x3079('0x1b')]||0x0;this[_0x3079('0x19')]=_0x3b418e[_0x3079('0x19')]||0x0;this[_0x3079('0x1a')]=_0x3b418e['countmachineretry']||0x0;this[_0x3079('0x1c')]=_0x3b418e[_0x3079('0x1c')]||0x0;this['callback']=_0x3b418e[_0x3079('0x1d')];this[_0x3079('0x1e')]=_0x3b418e[_0x3079('0x1e')];this['callbackat']=_0x3b418e[_0x3079('0x1f')];this['recallme']=_0x3b418e[_0x3079('0x20')];this[_0x3079('0x21')]=_0x3b418e[_0x3079('0x21')];this[_0x3079('0x22')]=_0x3b418e['ListId'];this[_0x3079('0x23')]=_[_0x3079('0x2')](_0x3b418e[_0x3079('0x9')])?_0x3b418e[_0x3079('0x23')]:_0x3b418e[_0x3079('0x9')]['id'];this[_0x3079('0x24')]=_0x3b418e[_0x3079('0x24')];this['originatecalleridnum']='';this['originatecalleridname']='';}Action[_0x3079('0x25')][_0x3079('0x26')]=function(){return util[_0x3079('0xc')]('\x22%s\x22\x20<%s>',this[_0x3079('0xe')],this[_0x3079('0x27')]);};module[_0x3079('0x28')]=Action;
\ No newline at end of file
+var _0x901e=['name','type','campaigntype','queue','Agent','membername','format','SIP/%s','calleridname','Contact','phone','firstName','lastName','active','calleridnum','scheduledat','countbusyretry','countcongestionretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','callback','callbackat','recallme','ListId','UserId','VoiceQueueId','originatecalleridnum','originatecalleridname','getCaller','\x22%s\x22\x20<%s>','number','exports','util','lodash','moment','isNil','string','uniqueid','idContact'];(function(_0x41e8c4,_0x30d9ff){var _0x54ffbe=function(_0x4131af){while(--_0x4131af){_0x41e8c4['push'](_0x41e8c4['shift']());}};_0x54ffbe(++_0x30d9ff);}(_0x901e,0x1a7));var _0xe901=function(_0x326d35,_0x4f65b3){_0x326d35=_0x326d35-0x0;var _0xd3f8f3=_0x901e[_0x326d35];return _0xd3f8f3;};'use strict';var util=require(_0xe901('0x0'));var _=require(_0xe901('0x1'));var moment=require(_0xe901('0x2'));function checkNameSurname(_0x2229bb,_0x10cb68,_0x46768d){var _0x3d02d5='';if(!_[_0xe901('0x3')](_0x10cb68)&&'string'===typeof _0x10cb68){_0x3d02d5+=_0x10cb68;}if(!_[_0xe901('0x3')](_0x46768d)&&_0xe901('0x4')===typeof _0x46768d){_0x3d02d5+='\x20'+_0x46768d;}if(_0x3d02d5!==''){return _0x3d02d5;}return _0x2229bb;}function Action(_0x570f90,_0x82b025,_0x1663ae,_0x29c8da,_0x398f32){this[_0xe901('0x5')]=_0x1663ae||undefined;this[_0xe901('0x6')]=_0x570f90['id'];this['queue']=_0x82b025[_0xe901('0x7')];this[_0xe901('0x8')]=_0x82b025[_0xe901('0x8')];this[_0xe901('0x9')]=_0xe901('0xa');this['dialAnswer']=![];this['membername']=_['isNil'](_0x570f90[_0xe901('0xb')])?undefined:_0x570f90['Agent'][_0xe901('0x7')];this['channelAgent']=this[_0xe901('0xc')]?util[_0xe901('0xd')](_0xe901('0xe'),this['membername']):_0x29c8da||undefined;this[_0xe901('0xf')]=checkNameSurname(_0x570f90[_0xe901('0x10')][_0xe901('0x11')],_0x570f90[_0xe901('0x10')][_0xe901('0x12')],_0x570f90['Contact'][_0xe901('0x13')]);this[_0xe901('0x14')]=_0x570f90['active']||![];this[_0xe901('0x15')]=_0x570f90[_0xe901('0x10')][_0xe901('0x11')];this[_0xe901('0x16')]=_0x570f90[_0xe901('0x16')];this[_0xe901('0x17')]=_0x570f90[_0xe901('0x17')]||0x0;this[_0xe901('0x18')]=_0x570f90['countcongestionretry']||0x0;this['countnoanswerretry']=_0x570f90['countnoanswerretry']||0x0;this[_0xe901('0x19')]=(_0x570f90[_0xe901('0x17')]||0x0)+(_0x570f90[_0xe901('0x18')]||0x0)+(_0x570f90['countnoanswerretry']||0x0)+(_0x570f90[_0xe901('0x1a')]||0x0)+(_0x570f90[_0xe901('0x1b')]||0x0)+(_0x570f90[_0xe901('0x1c')]||0x0)+(_0x570f90[_0xe901('0x1d')]||0x0)+(_0x570f90[_0xe901('0x1e')]||0x0);this['countnosuchnumberretry']=_0x570f90[_0xe901('0x1a')]||0x0;this['countdropretry']=_0x570f90[_0xe901('0x1b')]||0x0;this['countabandonedretry']=_0x570f90[_0xe901('0x1c')]||0x0;this[_0xe901('0x1d')]=_0x570f90[_0xe901('0x1d')]||0x0;this[_0xe901('0x1e')]=_0x570f90[_0xe901('0x1e')]||0x0;this[_0xe901('0x1f')]=_0x570f90[_0xe901('0x1f')];this['callbackuniqueid']=_0x570f90['callbackuniqueid'];this[_0xe901('0x20')]=_0x570f90[_0xe901('0x20')];this['recallme']=_0x570f90[_0xe901('0x21')];this['ContactId']=_0x570f90['ContactId'];this[_0xe901('0x22')]=_0x570f90[_0xe901('0x22')];this[_0xe901('0x23')]=_[_0xe901('0x3')](_0x570f90[_0xe901('0xb')])?_0x570f90['UserId']:_0x570f90['Agent']['id'];this[_0xe901('0x24')]=_0x570f90[_0xe901('0x24')];this[_0xe901('0x25')]='';this[_0xe901('0x26')]='';}Action['prototype'][_0xe901('0x27')]=function(){return util[_0xe901('0xd')](_0xe901('0x28'),this[_0xe901('0xf')],this[_0xe901('0x29')]);};module[_0xe901('0x2a')]=Action;
\ No newline at end of file
diff --git a/server/services/ami/preview/index.js b/server/services/ami/preview/index.js
index 9bf6b51..8015e8f 100644
--- a/server/services/ami/preview/index.js
+++ b/server/services/ami/preview/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x70e8=['unlockAgent','NOANSWER','countnoanswerretry','NoAnswer','noanswer','[callProgressDetectingCustomer][logNoAnswer]','[callProgressDetectingCustomer][logNoAnswerGlobal]','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','activeContact','CONGESTION','countcongestionretry','custom:agentcongestion','congestion','[callProgressDetectingCustomer][logCongestion]','[callProgressDetectingCustomer][logCongestionGlobal]','dialBusyRetryFrequency','CANCEL','AgentReject','custom:agentreject','agentreject','[syncHangupRequest][logAgentReject]','[callProgressDetectingCustomer][logAgentReject]','countagentrejectretry','ABANDONED','Abandoned','[callProgressDetectingCustomer][logAbandoned]','countabandonedretry','dialAbandonedRetryFrequency','[default]','[Dialer][decrementTalkink][no\x20Hangup][Preview]','outboundUnknownCallsDay','dialstatus','[callProgressDetectingCustomer][logUnknown]','[callProgressDetectingCustomer][logUnknownGlobal]','updateOriginated','[callProgressDetectingCustomer]','[originated][decrement][callProgressDetectingCustomer]','destlinkedid','isUndefined','object','reason','logAgent','[callProgressDetectingAgent][logNoSuch]','createAgentHistory','[callProgressDetectingAgent][logNoAnswer]','[callProgressDetectingAgent][logBusy]','Congestion','[callProgressDetectingAgent][logCongestion]','[callProgressDetectingAgent][logAnswerAGI]','[callProgressDetectingAgent]','[originated][decrement][callProgressDetectingAgent]','checkInBlack','Contact','phone','Contact\x20is\x20undefined','lookAgent','isEmpty','execCall','Queue:\x20','\x20IdHopper:\x20','idContact','called','Call\x20failed','logBlacklist','createHistory','[Blacklist][error]','SIP/%s','reachable','unmonitored','execRun','unlockContact','active','getContactPreview','recallme','validateContact','checkIsBlackList','Contact.phone','[Preview][checkIsBlackList]','Call\x20unsuccessful','[Preview][getContactPreview]','[Preview][validateContact][Empty\x20Contact]','Empty\x20Contact','[Preview][validateContact][Empty\x20Campaign]','Empty\x20Campaign','[Preview][validateContact][Trunk\x20not\x20work]','campaign\x20Name:\x20','\x20Trunk\x20is\x20not\x20active','\x20Not\x20Active','Is\x20Valid','SIP/%s/%s%s','substring','dialCutDigit','getCallerId','dialRandomLastDigitCallerIdNumber','getCallerIdRandom','extractCalleridName','extractCalleridNumber','addVariables','merge','toLowerVariables','Action','variablesAction','[originated][increment]','OriginateError','[originateFailure][logOriginateFailure]','channel','actionid','logLookAgent','clone','isFailure','rejected','callProgressDetectingAgent','[callProgressDetectingAgent][logAnswer]','syncHangup','[syncHangup][talking]','cause','dialQueueProject','channelstate','transfer','[syncHangup][talking][transfer]','[syncHangup][talking][cause]','destuniqueid','addVariable','variables','filterKey','keys','variable','value','error','[syncVarSet][Preview]','inspect','transfertargetlinkedid','transfererlinkedid','exports','util','lodash','uuid','moment','md5','ioredis','../../../config/environment','preview','actionPreview','../ami','./rpcDb','./action','./util/util','defaults','redis','localhost','socket.io-emitter','prototype','enqueue','tail','finally','sequence','campaignsPreview','voiceQueues','trunks','actions','agents','clockClearZombieChannels','syncOriginateResponse','bind','hangup','hanguprequest','syncHangupRequest','syncDialEnd','newexten','syncNewExten','varset','syncVarSet','attendedtransfer','syncAttendedTransfer','syncBlindTransfer','loopCampaigns','type','outbound','name','strategy','loggedIn','pTalking','sumBillable','sumDuration','sumHoldTime','talking','unmanaged','abandoned','waiting','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundAbandonedCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalAvailable','predictiveIntervalTotalCalls','message','erlangCalls','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','Trunk','callerid','Interval','format','voice:queue:%s','info','[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event','stringify','voice_queue_channel:remove','originated','available','paused','NOT_ACTIVE','logger','[CampaignPreview]\x20Campaign\x20Queue:\x20','\x20is\x20not\x20active','IS_DISACTIVED','\x20is\x20disactive','syncCampaigns','hasOwnProperty','booked','setMessage','recallMe','clearZombieChannel','[clearZombieChannels][talking]','Queue','originated:\x20','queue','pTalking:\x20','dialAnswer','pick','contactId','VoiceQueueId','ListId','status','No\x20such\x20channel','[clearZombieChannel]','decrementTalkink','loggerError','[Dialer][checkChannel][pTalking][Preview]','[Dialer][checkChannel][Preview]','clearZombieChannels','[action]','size','then','isNil','getDiff','scheduledat','Agent','voicePause','logger2','[RecallMe]','catch','disableContact','starttime','YYYY-MM-DD\x20HH:mm:ss','logCustomer','RecallInQueue','dialRecallInQueue','rescheduleContactInQueue','createCustomerHistory','[HistoryDialRecallInQueue][historyCatch]','RecallFailedTimeout','createCustomerFinal','[HistoryRecallClose]','[getContactRecallMe]','sendMessageOneNotActive','IsNotLoggedIn','isActive','isTrunkReachable','TrunkBackup','TRUNK_IS_NOT_REACHABLE','ACTIVE','callProgressDetectingCustomer','countglobal','NoSuchNumber','emit','custom:agentnosuchnumber','buildObj','nosuchnumber','[callProgressDetectingCustomer][logNoSuch]','dialGlobalMaxRetry','Global','[callProgressDetectingCustomer][logNoSuchGlobal]','countnosuchnumberretry','rescheduleContact','scheduledAt','dialNoSuchNumberRetryFrequency','linkedid','responsetime','answertime','uniqueid','connect','custom:agentConnectPreview','buildAcw','complete','total','answered','[16]','totalGlobal','[callProgressDetectingCustomer][logAnswer]','[callProgressDetectingCustomer][logAnswerGlobal]','crateCustomerReportQueue','talktime','[syncHangup][talking][decrement]','\x20Queue','BUSY','Busy','custom:agentbusy','busy','[callProgressDetectingCustomer][logBusy]','cloneAction','countbusyretry','dialBusyMaxRetry'];(function(_0x2129d8,_0x162523){var _0x44e139=function(_0x85a27a){while(--_0x85a27a){_0x2129d8['push'](_0x2129d8['shift']());}};_0x44e139(++_0x162523);}(_0x70e8,0x1d9));var _0x870e=function(_0xa5a889,_0x47f48a){_0xa5a889=_0xa5a889-0x0;var _0x4c0ead=_0x70e8[_0xa5a889];return _0x4c0ead;};'use strict';var util=require(_0x870e('0x0'));var _=require(_0x870e('0x1'));var BPromise=require('bluebird');var uuid=require(_0x870e('0x2'));var moment=require(_0x870e('0x3'));var md5=require(_0x870e('0x4'));var Redis=require(_0x870e('0x5'));var config=require(_0x870e('0x6'));var logger=require('../../../config/logger')(_0x870e('0x7'));var loggerAction=require('../../../config/logger')(_0x870e('0x8'));var ami=require(_0x870e('0x9'));var rpcDb=require(_0x870e('0xa'));var Action=require(_0x870e('0xb'));var ut=require(_0x870e('0xc'));config['redis']=_[_0x870e('0xd')](config[_0x870e('0xe')],{'host':_0x870e('0xf'),'port':0x18eb});var io=require(_0x870e('0x10'))(new Redis(config[_0x870e('0xe')]));var Sequence=function(){};Sequence[_0x870e('0x11')][_0x870e('0x12')]=function(_0x41c12a){this[_0x870e('0x13')]=this[_0x870e('0x13')]?this['tail'][_0x870e('0x14')](_0x41c12a):_0x41c12a();};function Preview(_0x64a4ac){this[_0x870e('0x15')]=new Sequence();this[_0x870e('0x16')]=_0x64a4ac[_0x870e('0x17')];this['trunks']=_0x64a4ac[_0x870e('0x18')];this[_0x870e('0x19')]={};this[_0x870e('0x1a')]=_0x64a4ac[_0x870e('0x1a')];this[_0x870e('0x1b')]=0x0;ami['on']('originateresponse',this[_0x870e('0x1c')][_0x870e('0x1d')](this));ami['on'](_0x870e('0x1e'),this['syncHangup'][_0x870e('0x1d')](this));ami['on'](_0x870e('0x1f'),this[_0x870e('0x20')][_0x870e('0x1d')](this));ami['on']('dialend',this[_0x870e('0x21')][_0x870e('0x1d')](this));ami['on'](_0x870e('0x22'),this[_0x870e('0x23')]['bind'](this));ami['on'](_0x870e('0x24'),this[_0x870e('0x25')][_0x870e('0x1d')](this));ami['on'](_0x870e('0x26'),this[_0x870e('0x27')][_0x870e('0x1d')](this));ami['on']('blindtransfer',this[_0x870e('0x28')]['bind'](this));this[_0x870e('0x29')](this[_0x870e('0x16')]);}function emit(_0x359b92,_0x220289,_0x4bc444){io['to'](_0x359b92)['emit'](_0x220289,_0x4bc444);}function emitCampaignPreview(_0x525301){if(_0x525301[_0x870e('0x2a')]===_0x870e('0x2b')){var _0x1d46eb={'id':_0x525301['id'],'name':_0x525301[_0x870e('0x2c')],'strategy':_0x525301[_0x870e('0x2d')],'answered':_0x525301['answered'],'available':_0x525301['available'],'loggedIn':_0x525301[_0x870e('0x2e')],'pTalking':_0x525301[_0x870e('0x2f')],'sumBillable':_0x525301[_0x870e('0x30')],'sumDuration':_0x525301[_0x870e('0x31')],'sumHoldTime':_0x525301[_0x870e('0x32')]||0x0,'talking':_0x525301[_0x870e('0x33')],'total':_0x525301['total'],'type':_0x525301['type'],'unmanaged':_0x525301[_0x870e('0x34')],'abandoned':_0x525301[_0x870e('0x35')],'waiting':_0x525301[_0x870e('0x36')],'loggedInDb':_0x525301['loggedInDb'],'dialActive':_0x525301[_0x870e('0x37')],'dialMethod':_0x525301[_0x870e('0x38')],'dialOriginateCallerIdName':_0x525301[_0x870e('0x39')],'dialOriginateCallerIdNumber':_0x525301[_0x870e('0x3a')],'dialOriginateTimeout':_0x525301['dialOriginateTimeout'],'dialPrefix':_0x525301[_0x870e('0x3b')],'outboundAnswerAgiCallsDay':_0x525301[_0x870e('0x3c')],'outboundAnswerCallsDay':_0x525301[_0x870e('0x3d')],'outboundBlacklistCallsDay':_0x525301[_0x870e('0x3e')],'outboundBusyCallsDay':_0x525301[_0x870e('0x3f')],'outboundCongestionCallsDay':_0x525301[_0x870e('0x40')],'outboundDropCallsDayACS':_0x525301[_0x870e('0x41')],'outboundDropCallsDayCallersExit':_0x525301[_0x870e('0x42')],'outboundDropCallsDayTimeout':_0x525301[_0x870e('0x43')],'outboundNoAnswerCallsDay':_0x525301[_0x870e('0x44')],'outboundNoSuchCallsDay':_0x525301[_0x870e('0x45')],'outboundOriginateFailureCallsDay':_0x525301[_0x870e('0x46')],'outboundReCallsDay':_0x525301[_0x870e('0x47')],'outboundRejectCallsDay':_0x525301[_0x870e('0x48')],'outboundUnknownCallsDay':_0x525301['outboundUnknownCallsDay'],'outboundAbandonedCallsDay':_0x525301[_0x870e('0x49')],'predictiveIntervalAnsweredCalls':_0x525301[_0x870e('0x4a')],'predictiveIntervalAvgHoldtime':_0x525301[_0x870e('0x4b')],'predictiveIntervalAvgTalktime':_0x525301[_0x870e('0x4c')],'predictiveIntervalDroppedCallsCallersExit':_0x525301['predictiveIntervalDroppedCallsCallersExit'],'predictiveIntervalDroppedCallsTimeout':_0x525301[_0x870e('0x4d')],'predictiveIntervalErlangCalls':_0x525301[_0x870e('0x4e')],'predictiveIntervalErlangCallsDroppedCalls':_0x525301[_0x870e('0x4f')],'predictiveIntervalHitRate':_0x525301[_0x870e('0x50')],'predictiveIntervalMultiplicativeFactor':_0x525301['predictiveIntervalMultiplicativeFactor'],'predictiveIntervalPauses':_0x525301['predictiveIntervalPauses'],'predictiveIntervalAvailable':_0x525301[_0x870e('0x51')],'predictiveIntervalTotalCalls':_0x525301[_0x870e('0x52')],'message':_0x525301[_0x870e('0x53')],'originated':_0x525301['originated'],'erlangCalls':_0x525301[_0x870e('0x54')],'erlangCallToSecond':_0x525301['erlangCallToSecond'],'erlangAbandonmentRate':_0x525301[_0x870e('0x55')],'erlangBusyFactor':_0x525301[_0x870e('0x56')],'startPredictive':_0x525301[_0x870e('0x57')],'startProgressive':_0x525301[_0x870e('0x58')]};if(_0x525301[_0x870e('0x59')]){_0x1d46eb[_0x870e('0x59')]={'id':_0x525301[_0x870e('0x59')]['id'],'name':_0x525301[_0x870e('0x59')]['name'],'active':_0x525301[_0x870e('0x59')]['active'],'callerid':_0x525301[_0x870e('0x59')][_0x870e('0x5a')]};}if(_0x525301[_0x870e('0x5b')]){_0x1d46eb[_0x870e('0x5b')]={'id':_0x525301['Interval']['id'],'name':_0x525301[_0x870e('0x5b')][_0x870e('0x2c')]};}var _0x1c5f40=md5(JSON['stringify'](_0x1d46eb));if(_0x525301[_0x870e('0x4')]!==_0x1c5f40){_0x525301['md5']=_0x1c5f40;emit(util[_0x870e('0x5c')](_0x870e('0x5d'),_0x1d46eb[_0x870e('0x2c')]),'voice_queue:save',_0x1d46eb);}}}function emitVoiceQueueChannelRemove(_0x4b0a45){logger[_0x870e('0x5e')](_0x870e('0x5f'),JSON[_0x870e('0x60')](_0x4b0a45));emit(util[_0x870e('0x5c')]('voice:queue:%s',_0x4b0a45[_0x870e('0x2c')]),_0x870e('0x61'),_0x4b0a45);}function notSendMessagesQueue(_0x1d6621){if(_0x1d6621['sendMessageOneNotActive']){if(_0x1d6621[_0x870e('0x62')]===0x0&&_0x1d6621[_0x870e('0x2f')]===0x0){_0x1d6621['sendMessageOneNotActive']=![];_0x1d6621[_0x870e('0x63')]=0x0;_0x1d6621[_0x870e('0x64')]=0x0;_0x1d6621['message']=_0x870e('0x65');ut[_0x870e('0x66')](_0x870e('0x67'),_0x1d6621[_0x870e('0x2c')]+_0x870e('0x68'));}else{_0x1d6621[_0x870e('0x53')]=_0x870e('0x69');ut[_0x870e('0x66')](_0x870e('0x67'),_0x1d6621[_0x870e('0x2c')]+_0x870e('0x6a'));}emitCampaignPreview(_0x1d6621);}}Preview[_0x870e('0x11')][_0x870e('0x29')]=function(){var _0x51a3ad=this;setInterval(function(){_0x51a3ad[_0x870e('0x6b')]();},0x7cf);};Preview['prototype'][_0x870e('0x6b')]=function(){var _0x25d1cc=this[_0x870e('0x16')];this[_0x870e('0x1b')]+=0x1;for(var _0x2f3c96 in _0x25d1cc){if(_0x25d1cc[_0x870e('0x6c')](_0x2f3c96)&&(_0x25d1cc[_0x2f3c96]['dialMethod']===_0x870e('0x7')||_0x25d1cc[_0x2f3c96][_0x870e('0x38')]===_0x870e('0x6d'))&&_0x25d1cc[_0x2f3c96][_0x870e('0x2a')]===_0x870e('0x2b')){if(this[_0x870e('0x1b')]>0x7){this['clockClearZombieChannels']=0x0;this['clearZombieChannels']();}}if(_0x25d1cc['hasOwnProperty'](_0x2f3c96)&&_0x25d1cc[_0x2f3c96][_0x870e('0x38')]==='preview'&&_0x25d1cc[_0x2f3c96][_0x870e('0x2a')]===_0x870e('0x2b')){if(_0x25d1cc[_0x2f3c96][_0x870e('0x37')]){this[_0x870e('0x6e')](_0x25d1cc[_0x2f3c96]);this[_0x870e('0x6f')](_0x25d1cc[_0x2f3c96]);}else{notSendMessagesQueue(_0x25d1cc[_0x2f3c96]);}}}};Preview[_0x870e('0x11')][_0x870e('0x70')]=function(_0xdb23e2){var _0x1043bc=this;this[_0x870e('0x15')][_0x870e('0x12')](function(){if(!_['isNil'](_0x1043bc[_0x870e('0x19')][_0xdb23e2])){loggerAction[_0x870e('0x5e')](_0x870e('0x71'),_0xdb23e2,_0x870e('0x72'),_0x1043bc[_0x870e('0x19')][_0xdb23e2]['queue'],_0x870e('0x73'),JSON['stringify'](_0x1043bc['campaignsPreview'][_0x1043bc[_0x870e('0x19')][_0xdb23e2][_0x870e('0x74')]][_0x870e('0x62')]),_0x870e('0x75'),JSON['stringify'](_0x1043bc[_0x870e('0x16')][_0x1043bc['actions'][_0xdb23e2][_0x870e('0x74')]]['pTalking']),JSON[_0x870e('0x60')](_0x1043bc[_0x870e('0x19')][_0xdb23e2][_0x870e('0x76')]),JSON[_0x870e('0x60')](_[_0x870e('0x77')](_0x1043bc['actions'][_0xdb23e2],[_0x870e('0x78'),'UserId',_0x870e('0x79'),_0x870e('0x7a')])));return ami['Action']({'action':_0x870e('0x7b'),'channel':_0x1043bc['actions'][_0xdb23e2]['channel']})['catch'](function(_0x311989){if(_0x311989[_0x870e('0x53')]===_0x870e('0x7c')){setTimeout(function(){if(_0x1043bc[_0x870e('0x19')][_0xdb23e2]){ut['updateOriginated'](_0x1043bc[_0x870e('0x16')][_0x1043bc[_0x870e('0x19')][_0xdb23e2][_0x870e('0x74')]],_0x870e('0x7d'));if(_0x1043bc[_0x870e('0x19')][_0xdb23e2][_0x870e('0x76')]===!![]){ut[_0x870e('0x7e')](_0x1043bc['campaignsPreview'][_0x1043bc[_0x870e('0x19')][_0xdb23e2][_0x870e('0x74')]],_0x870e('0x7d'));ut[_0x870e('0x7f')](_0x870e('0x80')+_0xdb23e2,_0x1043bc[_0x870e('0x19')][_0xdb23e2][_0x870e('0x74')]);}ut['loggerError'](_0x870e('0x81')+_0xdb23e2,_0x1043bc['actions'][_0xdb23e2][_0x870e('0x74')]);delete _0x1043bc[_0x870e('0x19')][_0xdb23e2];}},0x2328);}});}});};Preview['prototype'][_0x870e('0x82')]=function(){var _0x416794=this;loggerAction[_0x870e('0x5e')](_0x870e('0x83'),_[_0x870e('0x84')](this['actions']));for(var _0x155143 in this[_0x870e('0x19')]){if(_0x416794[_0x870e('0x19')][_0x870e('0x6c')](_0x155143)){_0x416794[_0x870e('0x70')](_0x155143);}}};Preview[_0x870e('0x11')]['recallMe']=function(_0x34734d){var _0x363f26=this;rpcDb['getContactRecallMe'](_0x34734d['id'],ut['agentReadyId'](this[_0x870e('0x1a')]))[_0x870e('0x85')](function(_0xded23c){if(!_[_0x870e('0x86')](_0xded23c)){for(var _0x249e2d=0x0;_0x249e2d<_0xded23c['length'];_0x249e2d+=0x1){if(ut[_0x870e('0x87')](_0xded23c[_0x249e2d][_0x870e('0x88')])<_0x34734d['dialRecallMeTimeout']*0x3c){if(_0xded23c[_0x249e2d][_0x870e('0x89')]&&!_0xded23c[_0x249e2d][_0x870e('0x89')][_0x870e('0x8a')]){_0x363f26['run'](_0xded23c[_0x249e2d]['id'])[_0x870e('0x85')](ut[_0x870e('0x8b')](_0x870e('0x8c')))[_0x870e('0x8d')](ut[_0x870e('0x8b')](_0x870e('0x8c')));}else{rpcDb[_0x870e('0x8e')](_0xded23c[_0x249e2d]['id']);}}else{var _0x1093f0=new Action(_0xded23c[_0x249e2d],_0x34734d);_0x1093f0[_0x870e('0x8f')]=moment()['format'](_0x870e('0x90'));_0x34734d[_0x870e('0x47')]+=0x1;ut[_0x870e('0x91')](_0x1093f0,0x17,_0x870e('0x92'));if(_0x34734d[_0x870e('0x93')]){rpcDb[_0x870e('0x94')](ut['createBody'](_0xded23c[_0x249e2d]));rpcDb[_0x870e('0x95')](_0x1093f0,_0x870e('0x96'));}else{ut[_0x870e('0x91')](_0x1093f0,0x16,_0x870e('0x97'));rpcDb[_0x870e('0x95')](_0x1093f0,'[HistoryRecallClose]');rpcDb[_0x870e('0x98')](_0x1093f0,_0x870e('0x99'));}}}}})[_0x870e('0x8d')](ut[_0x870e('0x8b')](_0x870e('0x9a')));};Preview['prototype'][_0x870e('0x6e')]=function(_0x3ecb52){_0x3ecb52[_0x870e('0x9b')]=!![];if(ut[_0x870e('0x9c')](_0x3ecb52[_0x870e('0x2e')])){_0x3ecb52[_0x870e('0x53')]='AGENTS_NOT_LOGGED';}else if(!ut[_0x870e('0x9d')](_0x3ecb52[_0x870e('0x37')])){_0x3ecb52[_0x870e('0x53')]=_0x870e('0x65');}else if(!this[_0x870e('0x9e')](_0x3ecb52[_0x870e('0x59')])){if(!this[_0x870e('0x9e')](_0x3ecb52[_0x870e('0x9f')])){_0x3ecb52[_0x870e('0x53')]=_0x870e('0xa0');}else{_0x3ecb52[_0x870e('0x53')]=_0x870e('0xa1');}}else{_0x3ecb52[_0x870e('0x53')]=_0x870e('0xa1');}emitCampaignPreview(_0x3ecb52);};Preview[_0x870e('0x11')][_0x870e('0xa2')]=function(_0x541a0d,_0x33c4a3,_0x5f5411){var _0x525c07=this;var _0x8f592f=this[_0x870e('0x19')][_0x33c4a3];var _0x43fe94=this[_0x870e('0x16')][_0x8f592f['queue']];var _0x5d77dc;if(_0x43fe94){switch(_0x5f5411){case'1':_0x43fe94[_0x870e('0x45')]+=0x1;_0x8f592f['countnosuchnumberretry']+=0x1;_0x8f592f[_0x870e('0xa3')]=ut['totalGlobal'](_0x8f592f);ut[_0x870e('0x91')](_0x8f592f,0x0,_0x870e('0xa4'));ami[_0x870e('0xa5')](_0x870e('0xa6'),ut[_0x870e('0xa7')](_0x8f592f,_0x870e('0xa8')));rpcDb[_0x870e('0x95')](_0x8f592f,_0x870e('0xa9'));if(ut['totalGlobal'](_0x8f592f)>=_0x43fe94[_0x870e('0xaa')]){_0x5d77dc=ut['cloneAction'](_0x8f592f,0xf,_0x870e('0xab'));rpcDb[_0x870e('0x98')](_0x5d77dc,_0x870e('0xac'));}else{if(_0x8f592f[_0x870e('0xad')]>=_0x43fe94['dialNoSuchNumberMaxRetry']){rpcDb[_0x870e('0x98')](_0x8f592f,_0x870e('0xac'));}else{rpcDb[_0x870e('0xae')](ut[_0x870e('0xaf')](_0x8f592f,_0x870e('0xad'),_0x43fe94[_0x870e('0xb0')]),_0x8f592f['unlockAgent'],_0x8f592f['activeContact']);}}delete this[_0x870e('0x19')][_0x541a0d[_0x870e('0xb1')]];break;case'ANSWER':var _0x570b8a=moment()[_0x870e('0x5c')]('YYYY-MM-DD\x20HH:mm:ss');_0x8f592f[_0x870e('0xb2')]=_0x570b8a;_0x8f592f[_0x870e('0xb3')]=_0x570b8a;_0x8f592f[_0x870e('0x76')]=!![];_0x43fe94['pTalking']+=0x1;logger[_0x870e('0x5e')]('[syncHangup][talking][increment]',_0x8f592f[_0x870e('0xb4')],'\x20Queue',_0x43fe94[_0x870e('0x2c')],_0x870e('0x75'),_0x43fe94['pTalking']);ami['emit']('custom:agentconnect',ut['buildObj'](_0x8f592f,_0x870e('0xb5')));if(_0x43fe94['acw']){ami[_0x870e('0xa5')](_0x870e('0xb6'),ut[_0x870e('0xb7')](_0x8f592f));}break;case'16':ami[_0x870e('0xa5')]('custom:agentcomplete',ut[_0x870e('0xa7')](_0x8f592f,_0x870e('0xb8')));emitVoiceQueueChannelRemove(ut[_0x870e('0xa7')](_0x8f592f,_0x870e('0xb8')));_0x43fe94[_0x870e('0x3d')]+=0x1;_0x43fe94[_0x870e('0xb9')]+=0x1;_0x43fe94[_0x870e('0xba')]+=0x1;ut[_0x870e('0x7e')](_0x43fe94,_0x870e('0xbb'));_0x8f592f['countglobal']=ut[_0x870e('0xbc')](_0x8f592f);ut[_0x870e('0x91')](_0x8f592f,0x4,'Answer');rpcDb['createCustomerHistory'](_0x8f592f,_0x870e('0xbd'));rpcDb['createCustomerFinal'](_0x8f592f,_0x870e('0xbe'));rpcDb[_0x870e('0xbf')](_0x8f592f);_0x43fe94[_0x870e('0x31')]+=_0x8f592f[_0x870e('0xc0')];_0x43fe94[_0x870e('0x30')]+=_0x8f592f[_0x870e('0xc0')];logger['info'](_0x870e('0xc1'),_0x8f592f[_0x870e('0xb4')],_0x870e('0xc2'),_0x43fe94[_0x870e('0x2c')],_0x870e('0x75'),_0x43fe94['pTalking']);delete this['actions'][_0x541a0d[_0x870e('0xb1')]];break;case _0x870e('0xc3'):_0x43fe94[_0x870e('0x3f')]+=0x1;_0x8f592f['countbusyretry']+=0x1;_0x8f592f[_0x870e('0xa3')]=ut[_0x870e('0xbc')](_0x8f592f);ut[_0x870e('0x91')](_0x8f592f,0x5,_0x870e('0xc4'));ami[_0x870e('0xa5')](_0x870e('0xc5'),ut[_0x870e('0xa7')](_0x8f592f,_0x870e('0xc6')));rpcDb[_0x870e('0x95')](_0x8f592f,_0x870e('0xc7'));if(ut[_0x870e('0xbc')](_0x8f592f)>=_0x43fe94['dialGlobalMaxRetry']){_0x5d77dc=ut[_0x870e('0xc8')](_0x8f592f,0xf,_0x870e('0xab'));rpcDb[_0x870e('0x98')](_0x5d77dc,'[callProgressDetectingCustomer][logBusyGlobal]');}else{if(_0x8f592f[_0x870e('0xc9')]>=_0x43fe94[_0x870e('0xca')]){rpcDb[_0x870e('0x98')](_0x8f592f,_0x870e('0xc7'));}else{rpcDb['rescheduleContact'](ut[_0x870e('0xaf')](_0x8f592f,'countbusyretry',_0x43fe94['dialBusyRetryFrequency']),_0x8f592f[_0x870e('0xcb')],_0x8f592f['activeContact']);}}break;case _0x870e('0xcc'):_0x43fe94['outboundNoAnswerCallsDay']+=0x1;_0x8f592f[_0x870e('0xcd')]+=0x1;_0x8f592f[_0x870e('0xa3')]=ut[_0x870e('0xbc')](_0x8f592f);ut[_0x870e('0x91')](_0x8f592f,0x3,_0x870e('0xce'));ami[_0x870e('0xa5')]('custom:agentnoanswer',ut[_0x870e('0xa7')](_0x8f592f,_0x870e('0xcf')));rpcDb[_0x870e('0x95')](_0x8f592f,_0x870e('0xd0'));if(ut[_0x870e('0xbc')](_0x8f592f)>=_0x43fe94[_0x870e('0xaa')]){_0x5d77dc=ut['cloneAction'](_0x8f592f,0xf,_0x870e('0xab'));rpcDb['createCustomerFinal'](_0x5d77dc,_0x870e('0xd1'));}else{if(_0x8f592f[_0x870e('0xcd')]>=_0x43fe94[_0x870e('0xd2')]){rpcDb['createCustomerFinal'](_0x8f592f,_0x870e('0xd0'));}else{rpcDb['rescheduleContact'](ut[_0x870e('0xaf')](_0x8f592f,_0x870e('0xcd'),_0x43fe94[_0x870e('0xd3')]),_0x8f592f[_0x870e('0xcb')],_0x8f592f[_0x870e('0xd4')]);}}break;case _0x870e('0xd5'):_0x43fe94[_0x870e('0x40')]+=0x1;_0x8f592f[_0x870e('0xd6')]+=0x1;_0x8f592f['countglobal']=ut[_0x870e('0xbc')](_0x8f592f);ut[_0x870e('0x91')](_0x8f592f,0x8,'Congestion');ami['emit'](_0x870e('0xd7'),ut[_0x870e('0xa7')](_0x8f592f,_0x870e('0xd8')));rpcDb[_0x870e('0x95')](_0x8f592f,_0x870e('0xd9'));if(ut[_0x870e('0xbc')](_0x8f592f)>=_0x43fe94[_0x870e('0xaa')]){_0x5d77dc=ut[_0x870e('0xc8')](_0x8f592f,0xf,_0x870e('0xab'));rpcDb['createCustomerFinal'](_0x5d77dc,_0x870e('0xda'));}else{if(_0x8f592f[_0x870e('0xd6')]>=_0x43fe94['dialCongestionMaxRetry']){rpcDb[_0x870e('0x98')](_0x8f592f,_0x870e('0xd9'));}else{rpcDb[_0x870e('0xae')](ut[_0x870e('0xaf')](_0x8f592f,'countcongestionretry',_0x43fe94[_0x870e('0xdb')]),_0x8f592f[_0x870e('0xcb')],_0x8f592f[_0x870e('0xd4')]);}}break;case _0x870e('0xdc'):_0x43fe94['outboundRejectCallsDay']+=0x1;_0x8f592f['countagentrejectretry']+=0x1;_0x8f592f[_0x870e('0xa3')]=ut[_0x870e('0xbc')](_0x8f592f);ut[_0x870e('0x91')](_0x8f592f,0x14,_0x870e('0xdd'));ami[_0x870e('0xa5')](_0x870e('0xde'),ut[_0x870e('0xa7')](_0x8f592f,_0x870e('0xdf')));rpcDb['createCustomerHistory'](_0x8f592f,_0x870e('0xe0'));if(ut[_0x870e('0xbc')](_0x8f592f)>=_0x43fe94['dialGlobalMaxRetry']){_0x5d77dc=ut[_0x870e('0xc8')](_0x8f592f,0x14,'AgentReject');rpcDb[_0x870e('0x98')](_0x5d77dc,'[callProgressDetectingCustomer][logAgentReject]');}else{if(_0x8f592f['countagentrejectretry']>=_0x43fe94['dialAgentRejectMaxRetry']){rpcDb[_0x870e('0x98')](_0x8f592f,_0x870e('0xe1'));}else{rpcDb[_0x870e('0xae')](ut['scheduledAt'](_0x8f592f,_0x870e('0xe2'),_0x43fe94['dialAgentRejectRetryFrequency']),_0x8f592f[_0x870e('0xcb')],_0x8f592f[_0x870e('0xd4')]);}}break;case _0x870e('0xe3'):_0x43fe94['outboundAbandonedCallsDay']+=0x1;_0x8f592f['countabandonedretry']+=0x1;_0x8f592f[_0x870e('0xa3')]=ut[_0x870e('0xbc')](_0x8f592f);ut[_0x870e('0x91')](_0x8f592f,0xb,_0x870e('0xe4'));rpcDb[_0x870e('0x95')](_0x8f592f,'[callProgressDetectingCustomer][logAbandoned]');if(ut[_0x870e('0xbc')](_0x8f592f)>=_0x43fe94[_0x870e('0xaa')]){_0x5d77dc=ut['cloneAction'](_0x8f592f,0xf,_0x870e('0xab'));rpcDb[_0x870e('0x98')](_0x5d77dc,_0x870e('0xe5'));}else{if(_0x8f592f['countabandonedetry']>=_0x43fe94['dialAbandonedMaxRety']){rpcDb[_0x870e('0x98')](_0x8f592f,_0x870e('0xe5'));}else{rpcDb[_0x870e('0xae')](ut['scheduledAt'](_0x8f592f,_0x870e('0xe6'),_0x43fe94[_0x870e('0xe7')]),_0x8f592f[_0x870e('0xcb')],_0x8f592f[_0x870e('0xd4')]);}}break;default:if(_0x8f592f[_0x870e('0x76')]){ut[_0x870e('0x7e')](_0x43fe94,_0x870e('0xe8'));ut[_0x870e('0x7f')](_0x870e('0xe9')+_0x43fe94['name'],_0x541a0d);}_0x43fe94[_0x870e('0xea')]+=0x1;_0x8f592f[_0x870e('0xa3')]=ut[_0x870e('0xbc')](_0x8f592f);ut[_0x870e('0x91')](_0x8f592f,0xc,_0x541a0d['cause-txt']||_0x541a0d[_0x870e('0xeb')]);rpcDb['createCustomerHistory'](_0x8f592f,_0x870e('0xec'));if(ut[_0x870e('0xbc')](_0x8f592f)>=_0x43fe94['dialGlobalMaxRetry']){_0x5d77dc=ut[_0x870e('0xc8')](_0x8f592f,0xf,_0x870e('0xab'));rpcDb[_0x870e('0x98')](_0x5d77dc,_0x870e('0xed'));}else{rpcDb[_0x870e('0x98')](_0x8f592f,_0x870e('0xed'));}delete this['actions'][_0x541a0d['linkedid']];}if(!(_0x8f592f['dialAnswer']&&_0x5f5411==='16')){ut[_0x870e('0xee')](_0x43fe94,_0x870e('0xef'));logger['info'](_0x870e('0xf0'),_0x8f592f[_0x870e('0xb4')],_0x870e('0xc2'),_0x43fe94['name'],_0x870e('0x73'),_0x43fe94[_0x870e('0x62')]);}if(_0x5f5411!=='ANSWER'){delete this[_0x870e('0x19')][_0x541a0d[_0x870e('0xb1')]];delete this[_0x870e('0x19')][_0x541a0d[_0x870e('0xf1')]];}}};Preview[_0x870e('0x11')]['callProgressDetectingAgent']=function(_0x563fd3,_0x4efa84,_0xd43e2b){if(_[_0x870e('0xf2')](_0x4efa84)&&'object'!==typeof _0x4efa84){return;}if(_['isUndefined'](_0xd43e2b)&&_0x870e('0xf3')!==typeof _0xd43e2b){return;}switch(_0xd43e2b[_0x870e('0xf4')]){case'0':ut[_0x870e('0xf5')](_0x563fd3,0x0,_0x870e('0xa4'));rpcDb['createAgentHistory'](_0x563fd3,_0x870e('0xf6'));break;case'3':ut[_0x870e('0xf5')](_0x563fd3,0x3,_0x870e('0xce'));rpcDb[_0x870e('0xf7')](_0x563fd3,_0x870e('0xf8'));break;case'5':ut[_0x870e('0xf5')](_0x563fd3,0x5,'Busy');rpcDb[_0x870e('0xf7')](_0x563fd3,_0x870e('0xf9'));break;case'8':ut[_0x870e('0xf5')](_0x563fd3,0x8,_0x870e('0xfa'));rpcDb[_0x870e('0xf7')](_0x563fd3,_0x870e('0xfb'));break;case'22':ut['logAgent'](_0x563fd3,0x16,'AnswerAGI');rpcDb[_0x870e('0xf7')](_0x563fd3,_0x870e('0xfc'));break;default:ut[_0x870e('0xf5')](_0x563fd3,0xc,_0xd43e2b['reason']);rpcDb[_0x870e('0xf7')](_0x563fd3,_0x870e('0xfb'));}ut[_0x870e('0xee')](_0x4efa84,_0x870e('0xfd'));logger['info'](_0x870e('0xfe'),_0x563fd3['uniqueid'],_0x870e('0xc2'),_0x4efa84['name'],_0x870e('0x73'),_0x4efa84[_0x870e('0x62')]);delete this['actions'][_0x563fd3[_0x870e('0xb4')]];};Preview['prototype'][_0x870e('0xff')]=function(_0x50e343,_0x15fddc,_0x4411f0,_0x15b42e,_0x5e9b8c){var _0xb6ae58=this;return new BPromise(function(_0x329859,_0x2a7239){if(_[_0x870e('0x86')](_0x15fddc)||_['isNil'](_0x15fddc[_0x870e('0x100')])||_[_0x870e('0x86')](_0x15fddc[_0x870e('0x100')][_0x870e('0x101')])||_[_0x870e('0x86')](_0x15fddc[_0x870e('0x79')])){_0x2a7239(ut[_0x870e('0x53')](_0x870e('0x102'),_0x15b42e,_0x5e9b8c));return;}var _0x340f14=uuid['v4']();var _0x1b184b=_0xb6ae58['campaignsPreview'][_0x15fddc[_0x870e('0x72')][_0x870e('0x2c')]];var _0x2b22de=_0x4411f0?_0xb6ae58['agents'][_0x4411f0]['id']:undefined;_0xb6ae58['actions'][_0x340f14]=new Action(_0x15fddc,_0x1b184b,_0x340f14,_0x4411f0,_0x2b22de);var _0x1dceab=_0xb6ae58[_0x870e('0x19')][_0x340f14];_0x1dceab[_0x870e('0xcb')]=_0x15b42e;_0x1dceab[_0x870e('0xd4')]=_0x5e9b8c;_0x1dceab[_0x870e('0x103')]=_0x4411f0;if(_[_0x870e('0x104')](_0x50e343)){_0xb6ae58[_0x870e('0x105')](_0x1dceab,_0x1b184b,_0x15fddc,_0x4411f0)[_0x870e('0x85')](function(_0x493dd2){logger[_0x870e('0x5e')]('[Preview][execCall][success]',_0x870e('0x106')+_0x1dceab['queue']+_0x870e('0x107')+_0x1dceab[_0x870e('0x108')],JSON[_0x870e('0x60')](_0x493dd2));ami[_0x870e('0xa5')]('custom:agentcalled',ut['buildObj'](_0x1dceab,_0x870e('0x109')));_0x329859(ut[_0x870e('0x53')]('Calling'));})[_0x870e('0x8d')](function(_0x5caa70){ut['logger']('[Preview][execCall][failure]',_0x5caa70);_0x2a7239(ut[_0x870e('0x53')](_0x870e('0x10a'),_0x15b42e,_0x5e9b8c));});}else{_0x1b184b[_0x870e('0x3e')]+=0x1;ut[_0x870e('0x10b')](_0x1dceab);rpcDb[_0x870e('0x10c')](_0x1dceab,_0x870e('0x10d'));delete _0xb6ae58[_0x870e('0x19')][_0x340f14];_0x2a7239(ut[_0x870e('0x53')]('Contact\x20in\x20black\x20List',_0x15b42e,_0x5e9b8c));}});};Preview[_0x870e('0x11')][_0x870e('0x9e')]=function(_0x174189){return!_['isNil'](_0x174189)&&!_[_0x870e('0x86')](_0x174189[_0x870e('0x2c')])&&!_[_0x870e('0x86')](_0x174189['active'])&&_0x174189['active']&&!_['isNil'](this['trunks'][util[_0x870e('0x5c')](_0x870e('0x10e'),_0x174189[_0x870e('0x2c')])])&&!_['isNil'](this[_0x870e('0x18')][util['format'](_0x870e('0x10e'),_0x174189[_0x870e('0x2c')])][_0x870e('0x7b')])&&(this['trunks'][util['format'](_0x870e('0x10e'),_0x174189[_0x870e('0x2c')])][_0x870e('0x7b')]===_0x870e('0x10f')||this[_0x870e('0x18')][util[_0x870e('0x5c')](_0x870e('0x10e'),_0x174189['name'])]['status']===_0x870e('0x110'));};Preview[_0x870e('0x11')]['run']=function(_0x3bc81f,_0x21dbc7){var _0x3d3616=this;return new BPromise(function(_0x28c07f,_0x5d62ac){_0x3d3616[_0x870e('0x111')](_0x3bc81f,_0x21dbc7)[_0x870e('0x85')](function(_0x1ab77e){_0x28c07f(_['pick'](_0x1ab77e,[_0x870e('0x53')]));})['catch'](function(_0x49fbc3){if(_0x49fbc3['unlock']){rpcDb[_0x870e('0x112')](_0x3bc81f);}if(_0x49fbc3[_0x870e('0x113')]){rpcDb[_0x870e('0x8e')](_0x3bc81f);}_0x5d62ac(_[_0x870e('0x77')](_0x49fbc3,[_0x870e('0x53')]));});});};Preview[_0x870e('0x11')][_0x870e('0x111')]=function(_0x352446,_0x1c73f4){var _0x260513=this;return new BPromise(function(_0x255b8c,_0x47a895){var _0x4b91a1,_0x468f78;rpcDb[_0x870e('0x114')](_0x352446)['then'](function(_0x46ad22){if(!_[_0x870e('0x86')](_0x46ad22[0x0])){_0x468f78=_0x46ad22[0x0][_0x870e('0x115')]?![]:!![];_0x4b91a1=_0x46ad22[0x0]['recallme']?!![]:![];_0x4b91a1=_0x1c73f4?!![]:_0x4b91a1;}var _0xca6ace=_0x260513[_0x870e('0x116')](_0x46ad22);if(_0xca6ace['isValid']){rpcDb[_0x870e('0x117')](_[_0x870e('0x77')](_0x46ad22[0x0],[_0x870e('0x79'),_0x870e('0x118')]))[_0x870e('0x85')](function(_0x321499){_0x260513[_0x870e('0xff')](_0x321499,_0x46ad22[0x0],_0x1c73f4,_0x468f78,_0x4b91a1)['then'](function(_0x500064){_0x255b8c(_0x500064);})['catch'](function(_0x242e8a){_0x47a895(_0x242e8a);});})[_0x870e('0x8d')](function(_0x1919b6){ut[_0x870e('0x66')](_0x870e('0x119'),_0x1919b6);_0x47a895(ut[_0x870e('0x53')](_0x870e('0x11a'),_0x468f78,_0x4b91a1));});}else{_0x47a895(ut[_0x870e('0x53')](_0xca6ace['message'],_0x468f78,_0x4b91a1));}})[_0x870e('0x8d')](function(_0x1542d5){ut[_0x870e('0x66')](_0x870e('0x11b'),_0x1542d5);_0x47a895(ut[_0x870e('0x53')]('Call\x20unsuccessful',![],!![]));});});};Preview['prototype'][_0x870e('0x116')]=function(_0x4283da){if(_[_0x870e('0x86')](_0x4283da)||_[_0x870e('0x104')](_0x4283da)||!_[_0x870e('0x86')](_0x4283da[0x0][_0x870e('0x89')])&&_['isNil'](_0x4283da[0x0][_0x870e('0x89')][_0x870e('0x2c')])){ut[_0x870e('0x66')](_0x870e('0x11c'),_0x4283da);return{'isValid':![],'message':_0x870e('0x11d')};}var _0x5b4d97=this[_0x870e('0x16')][_0x4283da[0x0][_0x870e('0x72')][_0x870e('0x2c')]];_0x5b4d97[_0x870e('0x53')]='ACTIVE';if(_['isNil'](_0x5b4d97)){ut[_0x870e('0x66')](_0x870e('0x11e'),_0x5b4d97);return{'isValid':![],'message':_0x870e('0x11f')};}if(!this[_0x870e('0x9e')](_0x5b4d97[_0x870e('0x59')])){ut[_0x870e('0x66')](_0x870e('0x120'),_0x870e('0x121')+_0x5b4d97[_0x870e('0x2c')]+_0x870e('0x122'));if(!this[_0x870e('0x9e')](_0x5b4d97[_0x870e('0x9f')])){ut[_0x870e('0x66')](_0x870e('0x120'),_0x5b4d97[_0x870e('0x2c')]+'\x20Trunk\x20Backup\x20is\x20not\x20active');return{'isValid':![],'message':'Trunk\x20not\x20work'};}}if(!ut[_0x870e('0x9d')](_0x5b4d97[_0x870e('0x37')])){ut[_0x870e('0x66')]('[Preview][validateContact][Campaign\x20Active]',_0x5b4d97['name']+'\x20Not\x20Active');return{'isValid':![],'message':_0x870e('0x121')+_0x5b4d97[_0x870e('0x2c')]+_0x870e('0x123')};}return{'isValid':!![],'message':_0x870e('0x124')};};Preview[_0x870e('0x11')]['execCall']=function(_0x5a47fa,_0x307077,_0x3a0709,_0x2f50d4){var _0x5cf5cb=this;return new BPromise(function(_0x5ed83e,_0x2f33c0){var _0x12c283=_0x5a47fa[_0x870e('0xb4')];var _0x505002=_0x5cf5cb[_0x870e('0x9e')](_0x307077['Trunk'])?util[_0x870e('0x5c')](_0x870e('0x125'),_0x307077[_0x870e('0x59')][_0x870e('0x2c')],_[_0x870e('0x86')](_0x307077[_0x870e('0x3b')])?'':_0x307077['dialPrefix']['trim']()||'',_0x307077['dialCutDigit']>0x0?_0x3a0709[_0x870e('0x100')][_0x870e('0x101')][_0x870e('0x126')](_0x307077[_0x870e('0x127')]):_0x3a0709['Contact'][_0x870e('0x101')]):util[_0x870e('0x5c')](_0x870e('0x125'),_[_0x870e('0x86')](_0x307077[_0x870e('0x9f')])?_0x307077['Trunk']['name']:_0x307077[_0x870e('0x9f')][_0x870e('0x2c')],_['isNil'](_0x307077[_0x870e('0x3b')])?'':_0x307077[_0x870e('0x3b')]['trim']()||'',_0x307077[_0x870e('0x127')]>0x0?_0x3a0709[_0x870e('0x100')][_0x870e('0x101')][_0x870e('0x126')](_0x307077[_0x870e('0x127')]):_0x3a0709[_0x870e('0x100')][_0x870e('0x101')]);var _0xa04720=_0x5cf5cb['isTrunkReachable'](_0x307077[_0x870e('0x59')])?ut[_0x870e('0x128')](_0x307077[_0x870e('0x59')][_0x870e('0x5a')],_0x307077[_0x870e('0x39')],_0x307077[_0x870e('0x129')]>0x0?ut['getCallerIdRandom'](_0x307077[_0x870e('0x3a')],_0x307077[_0x870e('0x129')]):_0x307077[_0x870e('0x3a')]):ut[_0x870e('0x128')](_['isNil'](_0x307077[_0x870e('0x9f')])?_0x307077['Trunk'][_0x870e('0x5a')]:_0x307077['TrunkBackup'][_0x870e('0x5a')],_0x307077[_0x870e('0x39')],_0x307077[_0x870e('0x129')]>0x0?ut[_0x870e('0x12a')](_0x307077[_0x870e('0x3a')],_0x307077['dialRandomLastDigitCallerIdNumber']):_0x307077[_0x870e('0x3a')]);if(_0xa04720){_0x5a47fa['originatecalleridname']=ut[_0x870e('0x12b')](_0xa04720);_0x5a47fa['originatecalleridnum']=ut[_0x870e('0x12c')](_0xa04720);}var _0x58bb67=ut[_0x870e('0x12d')](_0x307077,_0x3a0709,_0x505002,_0xa04720,_0x12c283,_0x5a47fa);_[_0x870e('0x12e')](_0x5a47fa,ut[_0x870e('0x12f')](_0x58bb67));_0x5a47fa[_0x870e('0x8f')]=moment()[_0x870e('0x5c')]('YYYY-MM-DD\x20HH:mm:ss');ami[_0x870e('0x130')](ut[_0x870e('0x131')](_0x5a47fa,_0x307077,_0x58bb67,_0x5a47fa[_0x870e('0xd4')],_0x2f50d4))['then'](function(_0x127605){_0x307077[_0x870e('0x62')]+=0x1;logger[_0x870e('0x5e')](_0x870e('0x132'),_0x12c283,_0x870e('0xc2'),_0x307077['name'],_0x870e('0x73'),_0x307077[_0x870e('0x62')]);_0x5ed83e(_0x127605);})[_0x870e('0x8d')](function(_0x282070){ut[_0x870e('0xf5')](_0x5a47fa,0xe,_0x870e('0x133'));rpcDb[_0x870e('0xf7')](_0x5a47fa,_0x870e('0x134'));_0x2f33c0(_0x282070);});});};Preview['prototype'][_0x870e('0x23')]=function(_0x181bc0){if(this[_0x870e('0x19')][_0x181bc0[_0x870e('0xb1')]]){this[_0x870e('0x19')][_0x181bc0[_0x870e('0xb1')]][_0x870e('0x135')]=_0x181bc0[_0x870e('0x135')];}};Preview[_0x870e('0x11')]['syncOriginateResponse']=function(_0x280f56){var _0x5e7e65=this;var _0x2b9b5c=this[_0x870e('0x19')][_0x280f56[_0x870e('0x136')]];if(_0x2b9b5c){if(_0x2b9b5c[_0x870e('0x103')]&&this[_0x870e('0x1a')][_0x2b9b5c[_0x870e('0x103')]]){ut[_0x870e('0x137')](_0x2b9b5c,this[_0x870e('0x1a')][_0x2b9b5c[_0x870e('0x103')]][_0x870e('0x2c')],this[_0x870e('0x1a')][_0x2b9b5c[_0x870e('0x103')]]['id']);}var _0x5bb81a=_[_0x870e('0x138')](_0x2b9b5c);_0x5bb81a[_0x870e('0xb2')]=moment()['format'](_0x870e('0x90'));var _0x567cdb=_0x5e7e65[_0x870e('0x16')][_0x2b9b5c[_0x870e('0x74')]];if(ut[_0x870e('0x139')](_0x280f56['response'])){if(_0x2b9b5c['unlockAgent']){rpcDb['unlockContact'](_0x2b9b5c[_0x870e('0x108')]);}if(_0x2b9b5c[_0x870e('0xd4')]){rpcDb[_0x870e('0x8e')](_0x2b9b5c[_0x870e('0x108')]);}ami['emit']('custom:agentringnoanswer',ut[_0x870e('0xa7')](_0x2b9b5c,_0x870e('0x13a')));this[_0x870e('0x13b')](_0x5bb81a,_0x567cdb,_0x280f56);}else{_0x2b9b5c['starttime']=moment()[_0x870e('0x5c')](_0x870e('0x90'));ut[_0x870e('0xf5')](_0x5bb81a,0x4,'Answer');rpcDb[_0x870e('0xf7')](_0x5bb81a,_0x870e('0x13c'));}}};Preview[_0x870e('0x11')][_0x870e('0x13d')]=function(_0x31bc24){var _0x4ae266=this;var _0x2ecfcd=this[_0x870e('0x19')][_0x31bc24[_0x870e('0xb1')]];var _0x3eaea4;if(_0x2ecfcd){_0x3eaea4=this[_0x870e('0x16')][_0x2ecfcd['queue']];logger[_0x870e('0x5e')](_0x870e('0x13e'),_0x31bc24[_0x870e('0xb1')],_0x870e('0xc2'),_0x3eaea4['name'],'pTalking:\x20',_0x3eaea4[_0x870e('0x2f')]);}if(this[_0x870e('0x19')][_0x31bc24[_0x870e('0xb1')]]&&_0x31bc24['linkedid']!==_0x31bc24[_0x870e('0xb4')]){if(_0x31bc24[_0x870e('0x13f')]==='16'&&this[_0x870e('0x19')][_0x31bc24[_0x870e('0xb1')]][_0x870e('0x76')]){this[_0x870e('0xa2')](_0x31bc24,_0x31bc24[_0x870e('0xb1')],_0x31bc24[_0x870e('0x13f')]);}else if(this[_0x870e('0x19')][_0x31bc24['linkedid']][_0x870e('0x76')]){logger[_0x870e('0x5e')]('[syncHangup][talking][cause]',_0x31bc24[_0x870e('0xb1')],_0x31bc24[_0x870e('0x13f')],_0x870e('0xc2'),_0x3eaea4[_0x870e('0x2c')],_0x870e('0x75'),_0x3eaea4[_0x870e('0x2f')]);this[_0x870e('0xa2')](_0x31bc24,_0x31bc24[_0x870e('0xb1')],_0x31bc24['cause']);}}else if(_0x2ecfcd&&_[_0x870e('0x86')](_0x2ecfcd['statedesc'])&&_0x3eaea4[_0x870e('0x140')]&&_0x31bc24['linkedid']===_0x31bc24[_0x870e('0xb4')]&&_[_0x870e('0x86')](_0x31bc24['reason'])&&_0x31bc24[_0x870e('0x13f')]==='16'&&_0x31bc24[_0x870e('0x141')]==='6'&&_[_0x870e('0xf2')](_0x2ecfcd[_0x870e('0x142')])){if(_0x2ecfcd[_0x870e('0xcb')]){rpcDb['unlockContact'](_0x2ecfcd['idContact']);}if(_0x2ecfcd['activeContact']){rpcDb[_0x870e('0x8e')](_0x2ecfcd['idContact']);}_0x31bc24[_0x870e('0xf4')]='22';this[_0x870e('0x13b')](_0x2ecfcd,_0x3eaea4,_0x31bc24);}else if(_0x2ecfcd&&_0x2ecfcd[_0x870e('0x142')]){if(_0x31bc24['cause']==='16'&&this[_0x870e('0x19')][_0x31bc24[_0x870e('0xb1')]][_0x870e('0x76')]){logger[_0x870e('0x5e')](_0x870e('0x143'),_0x31bc24[_0x870e('0xb1')],_0x31bc24['cause'],_0x870e('0xc2'),_0x3eaea4[_0x870e('0x2c')],_0x870e('0x75'),_0x3eaea4[_0x870e('0x2f')]);this[_0x870e('0xa2')](_0x31bc24,_0x31bc24[_0x870e('0xb1')],_0x31bc24['cause']);}else if(this[_0x870e('0x19')][_0x31bc24[_0x870e('0xb1')]][_0x870e('0x76')]){logger[_0x870e('0x5e')](_0x870e('0x144'),_0x31bc24[_0x870e('0xb1')],_0x31bc24[_0x870e('0x13f')],_0x870e('0xc2'),_0x3eaea4[_0x870e('0x2c')],_0x870e('0x75'),_0x3eaea4[_0x870e('0x2f')]);this['callProgressDetectingCustomer'](_0x31bc24,_0x31bc24['linkedid'],_0x31bc24['cause']);}}};Preview[_0x870e('0x11')][_0x870e('0x21')]=function(_0x40e5b3){if(this[_0x870e('0x19')][_0x40e5b3[_0x870e('0xf1')]]&&_0x40e5b3[_0x870e('0xf1')]!==_0x40e5b3[_0x870e('0x145')]){this['callProgressDetectingCustomer'](_0x40e5b3,_0x40e5b3[_0x870e('0xf1')],_0x40e5b3['dialstatus']);}};Preview['prototype'][_0x870e('0x20')]=function(_0x3e495a){if(this[_0x870e('0x19')][_0x3e495a[_0x870e('0xb1')]]&&_0x3e495a[_0x870e('0xb1')]!==_0x3e495a[_0x870e('0xb4')]&&!this[_0x870e('0x19')][_0x3e495a['linkedid']][_0x870e('0x76')]){if(_0x3e495a[_0x870e('0x13f')]==='1'){this[_0x870e('0xa2')](_0x3e495a,_0x3e495a['linkedid'],_0x3e495a[_0x870e('0x13f')]);}}};Preview[_0x870e('0x11')][_0x870e('0x146')]=function(_0x111e6b,_0x3d6c5f,_0x560ca0){if(this[_0x870e('0x19')][_0x111e6b]){if(_[_0x870e('0x86')](this[_0x870e('0x19')][_0x111e6b][_0x870e('0x147')])){this[_0x870e('0x19')][_0x111e6b][_0x870e('0x147')]={};}this['actions'][_0x111e6b][_0x870e('0x147')][_0x3d6c5f]=_0x560ca0;}};Preview[_0x870e('0x11')][_0x870e('0x25')]=function(_0xeeffef){try{if(!_[_0x870e('0x86')](_0xeeffef)){if(ut[_0x870e('0x148')](_[_0x870e('0x149')](_0xeeffef['variable'])[0x0])){this[_0x870e('0x146')](_0xeeffef[_0x870e('0xb4')],_[_0x870e('0x149')](_0xeeffef[_0x870e('0x14a')])[0x0],_0xeeffef[_0x870e('0x14b')]);}}}catch(_0x899145){logger[_0x870e('0x14c')](_0x870e('0x14d'),util[_0x870e('0x14e')](_0x899145,{'showHidden':![],'depth':null}));}};Preview[_0x870e('0x11')][_0x870e('0x27')]=function(_0x14ecf2){if(_0x14ecf2){if(this[_0x870e('0x19')][_0x14ecf2[_0x870e('0x14f')]]){this[_0x870e('0x19')][_0x14ecf2[_0x870e('0x14f')]][_0x870e('0x142')]=!![];}}};Preview[_0x870e('0x11')][_0x870e('0x28')]=function(_0x241d3a){if(_0x241d3a){if(this[_0x870e('0x19')][_0x241d3a[_0x870e('0x150')]]){this[_0x870e('0x19')][_0x241d3a['transfererlinkedid']][_0x870e('0x142')]=!![];}}};module[_0x870e('0x151')]=Preview;
\ No newline at end of file
+var _0x5dd4=['[syncHangup][talking]','callProgressDetectingCustomer','[syncHangup][talking][cause]','cause','statedesc','dialQueueProject','transfer','destuniqueid','addVariable','variables','filterKey','keys','variable','value','[syncVarSet][Preview]','inspect','syncAttendedTransfer','transfertargetlinkedid','transfererlinkedid','exports','util','moment','ioredis','../../../config/environment','../../../config/logger','actionPreview','./rpcDb','./action','redis','prototype','enqueue','tail','sequence','campaignsPreview','voiceQueues','trunks','actions','agents','originateresponse','syncOriginateResponse','bind','hangup','syncHangup','hanguprequest','syncHangupRequest','dialend','syncDialEnd','newexten','varset','syncVarSet','blindtransfer','syncBlindTransfer','name','answered','loggedIn','talking','unmanaged','abandoned','loggedInDb','dialMethod','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundDropCallsDayACS','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','outboundAbandonedCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalAvailable','message','originated','erlangCalls','erlangCallToSecond','startPredictive','startProgressive','Trunk','active','Interval','stringify','md5','format','voice:queue:%s','voice_queue:save','voice_queue_channel:remove','sendMessageOneNotActive','available','paused','NOT_ACTIVE','logger','[CampaignPreview]\x20Campaign\x20Queue:\x20','\x20is\x20not\x20active','IS_DISACTIVED','syncCampaigns','hasOwnProperty','booked','type','outbound','clockClearZombieChannels','clearZombieChannels','preview','setMessage','clearZombieChannel','isNil','info','[clearZombieChannels][talking]','Queue','queue','pTalking','pick','contactId','UserId','VoiceQueueId','ListId','Action','status','channel','catch','updateOriginated','[clearZombieChannel]','dialAnswer','decrementTalkink','loggerError','[Dialer][checkChannel][pTalking][Preview]','[Dialer][checkChannel][Preview]','[action]','recallMe','getContactRecallMe','agentReadyId','length','getDiff','dialRecallMeTimeout','Agent','voicePause','run','logger2','[RecallMe]','starttime','YYYY-MM-DD\x20HH:mm:ss','dialRecallInQueue','rescheduleContactInQueue','createBody','createCustomerHistory','[HistoryDialRecallInQueue][historyCatch]','logCustomer','RecallFailedTimeout','createCustomerFinal','[HistoryRecallClose]','[getContactRecallMe]','IsNotLoggedIn','AGENTS_NOT_LOGGED','isTrunkReachable','TrunkBackup','TRUNK_IS_NOT_REACHABLE','ACTIVE','countnosuchnumberretry','NoSuchNumber','emit','custom:agentnosuchnumber','buildObj','nosuchnumber','totalGlobal','dialGlobalMaxRetry','cloneAction','Global','[callProgressDetectingCustomer][logNoSuchGlobal]','dialNoSuchNumberMaxRetry','rescheduleContact','dialNoSuchNumberRetryFrequency','unlockAgent','activeContact','linkedid','ANSWER','responsetime','answertime','pTalking:\x20','acw','custom:agentConnectPreview','custom:agentcomplete','complete','[16]','countglobal','Answer','[callProgressDetectingCustomer][logAnswerGlobal]','crateCustomerReportQueue','sumDuration','talktime','sumBillable','[syncHangup][talking][decrement]','uniqueid','\x20Queue','outboundBusyCallsDay','countbusyretry','Busy','custom:agentbusy','busy','[callProgressDetectingCustomer][logBusyGlobal]','[callProgressDetectingCustomer][logBusy]','scheduledAt','dialBusyRetryFrequency','NOANSWER','countnoanswerretry','NoAnswer','custom:agentnoanswer','[callProgressDetectingCustomer][logNoAnswer]','[callProgressDetectingCustomer][logNoAnswerGlobal]','dialNoAnswerMaxRetry','CONGESTION','outboundCongestionCallsDay','countcongestionretry','custom:agentcongestion','congestion','[callProgressDetectingCustomer][logCongestion]','[callProgressDetectingCustomer][logCongestionGlobal]','countagentrejectretry','custom:agentreject','agentreject','[syncHangupRequest][logAgentReject]','[callProgressDetectingCustomer][logAgentReject]','dialAgentRejectRetryFrequency','ABANDONED','countabandonedretry','Abandoned','[callProgressDetectingCustomer][logAbandoned]','countabandonedetry','dialAbandonedMaxRety','dialAbandonedRetryFrequency','[default]','[Dialer][decrementTalkink][no\x20Hangup][Preview]','dialstatus','[callProgressDetectingCustomer][logUnknown]','[callProgressDetectingCustomer][logUnknownGlobal]','[originated][decrement][callProgressDetectingCustomer]','originated:\x20','destlinkedid','callProgressDetectingAgent','isUndefined','object','reason','logAgent','createAgentHistory','[callProgressDetectingAgent][logNoSuch]','[callProgressDetectingAgent][logNoAnswer]','[callProgressDetectingAgent][logBusy]','Congestion','[callProgressDetectingAgent][logCongestion]','AnswerAGI','[callProgressDetectingAgent][logAnswerAGI]','checkInBlack','Contact','phone','Contact\x20is\x20undefined','isEmpty','execCall','then','[Preview][execCall][success]','Queue:\x20','custom:agentcalled','called','[Preview][execCall][failure]','logBlacklist','createHistory','[Blacklist][error]','Contact\x20in\x20black\x20List','SIP/%s','reachable','unmonitored','unlock','unlockContact','disableContact','execRun','getContactPreview','recallme','validateContact','isValid','checkIsBlackList','Contact.phone','[Preview][checkIsBlackList]','Call\x20unsuccessful','[Preview][getContactPreview]','[Preview][validateContact][Empty\x20Contact]','Empty\x20Contact','Empty\x20Campaign','[Preview][validateContact][Trunk\x20not\x20work]','campaign\x20Name:\x20','\x20Trunk\x20Backup\x20is\x20not\x20active','Trunk\x20not\x20work','isActive','dialActive','[Preview][validateContact][Campaign\x20Active]','\x20Not\x20Active','Is\x20Valid','SIP/%s/%s%s','dialCutDigit','substring','trim','dialOriginateCallerIdName','dialRandomLastDigitCallerIdNumber','getCallerId','callerid','getCallerIdRandom','originatecalleridname','originatecalleridnum','addVariables','toLowerVariables','[originated][increment]','OriginateError','[originateFailure][logOriginateFailure]','syncNewExten','actionid','lookAgent','clone','response','idContact','custom:agentringnoanswer','rejected','[callProgressDetectingAgent][logAnswer]'];(function(_0x15336e,_0x3fb381){var _0x3ead42=function(_0x599ce1){while(--_0x599ce1){_0x15336e['push'](_0x15336e['shift']());}};_0x3ead42(++_0x3fb381);}(_0x5dd4,0x15e));var _0x45dd=function(_0x318a0d,_0x5ed3bb){_0x318a0d=_0x318a0d-0x0;var _0x3e56c2=_0x5dd4[_0x318a0d];return _0x3e56c2;};'use strict';var util=require(_0x45dd('0x0'));var _=require('lodash');var BPromise=require('bluebird');var uuid=require('uuid');var moment=require(_0x45dd('0x1'));var md5=require('md5');var Redis=require(_0x45dd('0x2'));var config=require(_0x45dd('0x3'));var logger=require(_0x45dd('0x4'))('preview');var loggerAction=require(_0x45dd('0x4'))(_0x45dd('0x5'));var ami=require('../ami');var rpcDb=require(_0x45dd('0x6'));var Action=require(_0x45dd('0x7'));var ut=require('./util/util');config[_0x45dd('0x8')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x45dd('0x8')]));var Sequence=function(){};Sequence[_0x45dd('0x9')][_0x45dd('0xa')]=function(_0x39371a){this['tail']=this[_0x45dd('0xb')]?this[_0x45dd('0xb')]['finally'](_0x39371a):_0x39371a();};function Preview(_0x2cb7d0){this[_0x45dd('0xc')]=new Sequence();this[_0x45dd('0xd')]=_0x2cb7d0[_0x45dd('0xe')];this['trunks']=_0x2cb7d0[_0x45dd('0xf')];this[_0x45dd('0x10')]={};this[_0x45dd('0x11')]=_0x2cb7d0[_0x45dd('0x11')];this['clockClearZombieChannels']=0x0;ami['on'](_0x45dd('0x12'),this[_0x45dd('0x13')][_0x45dd('0x14')](this));ami['on'](_0x45dd('0x15'),this[_0x45dd('0x16')][_0x45dd('0x14')](this));ami['on'](_0x45dd('0x17'),this[_0x45dd('0x18')][_0x45dd('0x14')](this));ami['on'](_0x45dd('0x19'),this[_0x45dd('0x1a')][_0x45dd('0x14')](this));ami['on'](_0x45dd('0x1b'),this['syncNewExten'][_0x45dd('0x14')](this));ami['on'](_0x45dd('0x1c'),this[_0x45dd('0x1d')][_0x45dd('0x14')](this));ami['on']('attendedtransfer',this['syncAttendedTransfer'][_0x45dd('0x14')](this));ami['on'](_0x45dd('0x1e'),this[_0x45dd('0x1f')][_0x45dd('0x14')](this));this['loopCampaigns'](this[_0x45dd('0xd')]);}function emit(_0x2b07c5,_0x353090,_0x23caf2){io['to'](_0x2b07c5)['emit'](_0x353090,_0x23caf2);}function emitCampaignPreview(_0x301643){if(_0x301643['type']==='outbound'){var _0x4217eb={'id':_0x301643['id'],'name':_0x301643[_0x45dd('0x20')],'strategy':_0x301643['strategy'],'answered':_0x301643[_0x45dd('0x21')],'available':_0x301643['available'],'loggedIn':_0x301643[_0x45dd('0x22')],'pTalking':_0x301643['pTalking'],'sumBillable':_0x301643['sumBillable'],'sumDuration':_0x301643['sumDuration'],'sumHoldTime':_0x301643['sumHoldTime']||0x0,'talking':_0x301643[_0x45dd('0x23')],'total':_0x301643['total'],'type':_0x301643['type'],'unmanaged':_0x301643[_0x45dd('0x24')],'abandoned':_0x301643[_0x45dd('0x25')],'waiting':_0x301643['waiting'],'loggedInDb':_0x301643[_0x45dd('0x26')],'dialActive':_0x301643['dialActive'],'dialMethod':_0x301643[_0x45dd('0x27')],'dialOriginateCallerIdName':_0x301643['dialOriginateCallerIdName'],'dialOriginateCallerIdNumber':_0x301643[_0x45dd('0x28')],'dialOriginateTimeout':_0x301643[_0x45dd('0x29')],'dialPrefix':_0x301643[_0x45dd('0x2a')],'outboundAnswerAgiCallsDay':_0x301643[_0x45dd('0x2b')],'outboundAnswerCallsDay':_0x301643[_0x45dd('0x2c')],'outboundBlacklistCallsDay':_0x301643[_0x45dd('0x2d')],'outboundBusyCallsDay':_0x301643['outboundBusyCallsDay'],'outboundCongestionCallsDay':_0x301643['outboundCongestionCallsDay'],'outboundDropCallsDayACS':_0x301643[_0x45dd('0x2e')],'outboundDropCallsDayCallersExit':_0x301643['outboundDropCallsDayCallersExit'],'outboundDropCallsDayTimeout':_0x301643['outboundDropCallsDayTimeout'],'outboundNoAnswerCallsDay':_0x301643[_0x45dd('0x2f')],'outboundNoSuchCallsDay':_0x301643[_0x45dd('0x30')],'outboundOriginateFailureCallsDay':_0x301643[_0x45dd('0x31')],'outboundReCallsDay':_0x301643[_0x45dd('0x32')],'outboundRejectCallsDay':_0x301643[_0x45dd('0x33')],'outboundUnknownCallsDay':_0x301643[_0x45dd('0x34')],'outboundAbandonedCallsDay':_0x301643[_0x45dd('0x35')],'predictiveIntervalAnsweredCalls':_0x301643[_0x45dd('0x36')],'predictiveIntervalAvgHoldtime':_0x301643[_0x45dd('0x37')],'predictiveIntervalAvgTalktime':_0x301643[_0x45dd('0x38')],'predictiveIntervalDroppedCallsCallersExit':_0x301643[_0x45dd('0x39')],'predictiveIntervalDroppedCallsTimeout':_0x301643[_0x45dd('0x3a')],'predictiveIntervalErlangCalls':_0x301643['predictiveIntervalErlangCalls'],'predictiveIntervalErlangCallsDroppedCalls':_0x301643[_0x45dd('0x3b')],'predictiveIntervalHitRate':_0x301643[_0x45dd('0x3c')],'predictiveIntervalMultiplicativeFactor':_0x301643[_0x45dd('0x3d')],'predictiveIntervalPauses':_0x301643['predictiveIntervalPauses'],'predictiveIntervalAvailable':_0x301643[_0x45dd('0x3e')],'predictiveIntervalTotalCalls':_0x301643['predictiveIntervalTotalCalls'],'message':_0x301643[_0x45dd('0x3f')],'originated':_0x301643[_0x45dd('0x40')],'erlangCalls':_0x301643[_0x45dd('0x41')],'erlangCallToSecond':_0x301643[_0x45dd('0x42')],'erlangAbandonmentRate':_0x301643['erlangAbandonmentRate'],'erlangBusyFactor':_0x301643['erlangBusyFactor'],'startPredictive':_0x301643[_0x45dd('0x43')],'startProgressive':_0x301643[_0x45dd('0x44')]};if(_0x301643[_0x45dd('0x45')]){_0x4217eb['Trunk']={'id':_0x301643[_0x45dd('0x45')]['id'],'name':_0x301643['Trunk'][_0x45dd('0x20')],'active':_0x301643['Trunk'][_0x45dd('0x46')],'callerid':_0x301643['Trunk']['callerid']};}if(_0x301643['Interval']){_0x4217eb[_0x45dd('0x47')]={'id':_0x301643[_0x45dd('0x47')]['id'],'name':_0x301643[_0x45dd('0x47')][_0x45dd('0x20')]};}var _0x13c074=md5(JSON[_0x45dd('0x48')](_0x4217eb));if(_0x301643[_0x45dd('0x49')]!==_0x13c074){_0x301643[_0x45dd('0x49')]=_0x13c074;emit(util[_0x45dd('0x4a')](_0x45dd('0x4b'),_0x4217eb[_0x45dd('0x20')]),_0x45dd('0x4c'),_0x4217eb);}}}function emitVoiceQueueChannelRemove(_0x21f594){logger['info']('[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event',JSON[_0x45dd('0x48')](_0x21f594));emit(util['format'](_0x45dd('0x4b'),_0x21f594[_0x45dd('0x20')]),_0x45dd('0x4d'),_0x21f594);}function notSendMessagesQueue(_0x535aa1){if(_0x535aa1[_0x45dd('0x4e')]){if(_0x535aa1['originated']===0x0&&_0x535aa1['pTalking']===0x0){_0x535aa1[_0x45dd('0x4e')]=![];_0x535aa1[_0x45dd('0x4f')]=0x0;_0x535aa1[_0x45dd('0x50')]=0x0;_0x535aa1[_0x45dd('0x3f')]=_0x45dd('0x51');ut[_0x45dd('0x52')](_0x45dd('0x53'),_0x535aa1[_0x45dd('0x20')]+_0x45dd('0x54'));}else{_0x535aa1[_0x45dd('0x3f')]=_0x45dd('0x55');ut[_0x45dd('0x52')]('[CampaignPreview]\x20Campaign\x20Queue:\x20',_0x535aa1['name']+'\x20is\x20disactive');}emitCampaignPreview(_0x535aa1);}}Preview['prototype']['loopCampaigns']=function(){var _0x48656c=this;setInterval(function(){_0x48656c[_0x45dd('0x56')]();},0x7cf);};Preview[_0x45dd('0x9')][_0x45dd('0x56')]=function(){var _0x57530c=this[_0x45dd('0xd')];this['clockClearZombieChannels']+=0x1;for(var _0x498025 in _0x57530c){if(_0x57530c[_0x45dd('0x57')](_0x498025)&&(_0x57530c[_0x498025][_0x45dd('0x27')]==='preview'||_0x57530c[_0x498025][_0x45dd('0x27')]===_0x45dd('0x58'))&&_0x57530c[_0x498025][_0x45dd('0x59')]===_0x45dd('0x5a')){if(this[_0x45dd('0x5b')]>0x7){this[_0x45dd('0x5b')]=0x0;this[_0x45dd('0x5c')]();}}if(_0x57530c['hasOwnProperty'](_0x498025)&&_0x57530c[_0x498025][_0x45dd('0x27')]===_0x45dd('0x5d')&&_0x57530c[_0x498025][_0x45dd('0x59')]==='outbound'){if(_0x57530c[_0x498025]['dialActive']){this[_0x45dd('0x5e')](_0x57530c[_0x498025]);this['recallMe'](_0x57530c[_0x498025]);}else{notSendMessagesQueue(_0x57530c[_0x498025]);}}}};Preview[_0x45dd('0x9')][_0x45dd('0x5f')]=function(_0xaa24c7){var _0x305300=this;this[_0x45dd('0xc')][_0x45dd('0xa')](function(){if(!_[_0x45dd('0x60')](_0x305300['actions'][_0xaa24c7])){loggerAction[_0x45dd('0x61')](_0x45dd('0x62'),_0xaa24c7,_0x45dd('0x63'),_0x305300[_0x45dd('0x10')][_0xaa24c7][_0x45dd('0x64')],'originated:\x20',JSON[_0x45dd('0x48')](_0x305300['campaignsPreview'][_0x305300[_0x45dd('0x10')][_0xaa24c7][_0x45dd('0x64')]][_0x45dd('0x40')]),'pTalking:\x20',JSON[_0x45dd('0x48')](_0x305300[_0x45dd('0xd')][_0x305300[_0x45dd('0x10')][_0xaa24c7][_0x45dd('0x64')]][_0x45dd('0x65')]),JSON['stringify'](_0x305300[_0x45dd('0x10')][_0xaa24c7]['dialAnswer']),JSON[_0x45dd('0x48')](_[_0x45dd('0x66')](_0x305300['actions'][_0xaa24c7],[_0x45dd('0x67'),_0x45dd('0x68'),_0x45dd('0x69'),_0x45dd('0x6a')])));return ami[_0x45dd('0x6b')]({'action':_0x45dd('0x6c'),'channel':_0x305300['actions'][_0xaa24c7][_0x45dd('0x6d')]})[_0x45dd('0x6e')](function(_0x38feea){if(_0x38feea['message']==='No\x20such\x20channel'){setTimeout(function(){if(_0x305300[_0x45dd('0x10')][_0xaa24c7]){ut[_0x45dd('0x6f')](_0x305300[_0x45dd('0xd')][_0x305300[_0x45dd('0x10')][_0xaa24c7][_0x45dd('0x64')]],_0x45dd('0x70'));if(_0x305300[_0x45dd('0x10')][_0xaa24c7][_0x45dd('0x71')]===!![]){ut[_0x45dd('0x72')](_0x305300[_0x45dd('0xd')][_0x305300['actions'][_0xaa24c7][_0x45dd('0x64')]],_0x45dd('0x70'));ut[_0x45dd('0x73')](_0x45dd('0x74')+_0xaa24c7,_0x305300['actions'][_0xaa24c7][_0x45dd('0x64')]);}ut[_0x45dd('0x73')](_0x45dd('0x75')+_0xaa24c7,_0x305300[_0x45dd('0x10')][_0xaa24c7]['queue']);delete _0x305300[_0x45dd('0x10')][_0xaa24c7];}},0x2328);}});}});};Preview[_0x45dd('0x9')]['clearZombieChannels']=function(){var _0x41460e=this;loggerAction[_0x45dd('0x61')](_0x45dd('0x76'),_['size'](this[_0x45dd('0x10')]));for(var _0x421cb4 in this['actions']){if(_0x41460e[_0x45dd('0x10')][_0x45dd('0x57')](_0x421cb4)){_0x41460e[_0x45dd('0x5f')](_0x421cb4);}}};Preview[_0x45dd('0x9')][_0x45dd('0x77')]=function(_0x18c705){var _0x1d2cec=this;rpcDb[_0x45dd('0x78')](_0x18c705['id'],ut[_0x45dd('0x79')](this['agents']))['then'](function(_0x1cf331){if(!_[_0x45dd('0x60')](_0x1cf331)){for(var _0x416534=0x0;_0x416534<_0x1cf331[_0x45dd('0x7a')];_0x416534+=0x1){if(ut[_0x45dd('0x7b')](_0x1cf331[_0x416534]['scheduledat'])<_0x18c705[_0x45dd('0x7c')]*0x3c){if(_0x1cf331[_0x416534][_0x45dd('0x7d')]&&!_0x1cf331[_0x416534]['Agent'][_0x45dd('0x7e')]){_0x1d2cec[_0x45dd('0x7f')](_0x1cf331[_0x416534]['id'])['then'](ut[_0x45dd('0x80')](_0x45dd('0x81')))[_0x45dd('0x6e')](ut['logger2']('[RecallMe]'));}else{rpcDb['disableContact'](_0x1cf331[_0x416534]['id']);}}else{var _0x5a1de8=new Action(_0x1cf331[_0x416534],_0x18c705);_0x5a1de8[_0x45dd('0x82')]=moment()[_0x45dd('0x4a')](_0x45dd('0x83'));_0x18c705[_0x45dd('0x32')]+=0x1;ut['logCustomer'](_0x5a1de8,0x17,'RecallInQueue');if(_0x18c705[_0x45dd('0x84')]){rpcDb[_0x45dd('0x85')](ut[_0x45dd('0x86')](_0x1cf331[_0x416534]));rpcDb[_0x45dd('0x87')](_0x5a1de8,_0x45dd('0x88'));}else{ut[_0x45dd('0x89')](_0x5a1de8,0x16,_0x45dd('0x8a'));rpcDb[_0x45dd('0x87')](_0x5a1de8,'[HistoryRecallClose]');rpcDb[_0x45dd('0x8b')](_0x5a1de8,_0x45dd('0x8c'));}}}}})[_0x45dd('0x6e')](ut[_0x45dd('0x80')](_0x45dd('0x8d')));};Preview[_0x45dd('0x9')][_0x45dd('0x5e')]=function(_0x1bbe67){_0x1bbe67[_0x45dd('0x4e')]=!![];if(ut[_0x45dd('0x8e')](_0x1bbe67[_0x45dd('0x22')])){_0x1bbe67[_0x45dd('0x3f')]=_0x45dd('0x8f');}else if(!ut['isActive'](_0x1bbe67['dialActive'])){_0x1bbe67[_0x45dd('0x3f')]=_0x45dd('0x51');}else if(!this[_0x45dd('0x90')](_0x1bbe67[_0x45dd('0x45')])){if(!this[_0x45dd('0x90')](_0x1bbe67[_0x45dd('0x91')])){_0x1bbe67['message']=_0x45dd('0x92');}else{_0x1bbe67['message']=_0x45dd('0x93');}}else{_0x1bbe67[_0x45dd('0x3f')]=_0x45dd('0x93');}emitCampaignPreview(_0x1bbe67);};Preview[_0x45dd('0x9')]['callProgressDetectingCustomer']=function(_0x1ff3cc,_0x20d347,_0x32a509){var _0x836b13=this;var _0x24a014=this[_0x45dd('0x10')][_0x20d347];var _0xb0c978=this[_0x45dd('0xd')][_0x24a014[_0x45dd('0x64')]];var _0x3f9f5c;if(_0xb0c978){switch(_0x32a509){case'1':_0xb0c978['outboundNoSuchCallsDay']+=0x1;_0x24a014[_0x45dd('0x94')]+=0x1;_0x24a014['countglobal']=ut['totalGlobal'](_0x24a014);ut[_0x45dd('0x89')](_0x24a014,0x0,_0x45dd('0x95'));ami[_0x45dd('0x96')](_0x45dd('0x97'),ut[_0x45dd('0x98')](_0x24a014,_0x45dd('0x99')));rpcDb[_0x45dd('0x87')](_0x24a014,'[callProgressDetectingCustomer][logNoSuch]');if(ut[_0x45dd('0x9a')](_0x24a014)>=_0xb0c978[_0x45dd('0x9b')]){_0x3f9f5c=ut[_0x45dd('0x9c')](_0x24a014,0xf,_0x45dd('0x9d'));rpcDb[_0x45dd('0x8b')](_0x3f9f5c,_0x45dd('0x9e'));}else{if(_0x24a014[_0x45dd('0x94')]>=_0xb0c978[_0x45dd('0x9f')]){rpcDb[_0x45dd('0x8b')](_0x24a014,_0x45dd('0x9e'));}else{rpcDb[_0x45dd('0xa0')](ut['scheduledAt'](_0x24a014,_0x45dd('0x94'),_0xb0c978[_0x45dd('0xa1')]),_0x24a014[_0x45dd('0xa2')],_0x24a014[_0x45dd('0xa3')]);}}delete this[_0x45dd('0x10')][_0x1ff3cc[_0x45dd('0xa4')]];break;case _0x45dd('0xa5'):var _0x491eb4=moment()['format'](_0x45dd('0x83'));_0x24a014[_0x45dd('0xa6')]=_0x491eb4;_0x24a014[_0x45dd('0xa7')]=_0x491eb4;_0x24a014[_0x45dd('0x71')]=!![];_0xb0c978[_0x45dd('0x65')]+=0x1;logger[_0x45dd('0x61')]('[syncHangup][talking][increment]',_0x24a014['uniqueid'],'\x20Queue',_0xb0c978[_0x45dd('0x20')],_0x45dd('0xa8'),_0xb0c978[_0x45dd('0x65')]);ami[_0x45dd('0x96')]('custom:agentconnect',ut[_0x45dd('0x98')](_0x24a014,'connect'));if(_0xb0c978[_0x45dd('0xa9')]){ami[_0x45dd('0x96')](_0x45dd('0xaa'),ut['buildAcw'](_0x24a014));}break;case'16':ami[_0x45dd('0x96')](_0x45dd('0xab'),ut[_0x45dd('0x98')](_0x24a014,'complete'));emitVoiceQueueChannelRemove(ut[_0x45dd('0x98')](_0x24a014,_0x45dd('0xac')));_0xb0c978[_0x45dd('0x2c')]+=0x1;_0xb0c978['total']+=0x1;_0xb0c978[_0x45dd('0x21')]+=0x1;ut['decrementTalkink'](_0xb0c978,_0x45dd('0xad'));_0x24a014[_0x45dd('0xae')]=ut[_0x45dd('0x9a')](_0x24a014);ut[_0x45dd('0x89')](_0x24a014,0x4,_0x45dd('0xaf'));rpcDb['createCustomerHistory'](_0x24a014,'[callProgressDetectingCustomer][logAnswer]');rpcDb[_0x45dd('0x8b')](_0x24a014,_0x45dd('0xb0'));rpcDb[_0x45dd('0xb1')](_0x24a014);_0xb0c978[_0x45dd('0xb2')]+=_0x24a014[_0x45dd('0xb3')];_0xb0c978[_0x45dd('0xb4')]+=_0x24a014[_0x45dd('0xb3')];logger[_0x45dd('0x61')](_0x45dd('0xb5'),_0x24a014[_0x45dd('0xb6')],_0x45dd('0xb7'),_0xb0c978[_0x45dd('0x20')],'pTalking:\x20',_0xb0c978[_0x45dd('0x65')]);delete this[_0x45dd('0x10')][_0x1ff3cc[_0x45dd('0xa4')]];break;case'BUSY':_0xb0c978[_0x45dd('0xb8')]+=0x1;_0x24a014[_0x45dd('0xb9')]+=0x1;_0x24a014[_0x45dd('0xae')]=ut[_0x45dd('0x9a')](_0x24a014);ut[_0x45dd('0x89')](_0x24a014,0x5,_0x45dd('0xba'));ami[_0x45dd('0x96')](_0x45dd('0xbb'),ut[_0x45dd('0x98')](_0x24a014,_0x45dd('0xbc')));rpcDb[_0x45dd('0x87')](_0x24a014,'[callProgressDetectingCustomer][logBusy]');if(ut['totalGlobal'](_0x24a014)>=_0xb0c978[_0x45dd('0x9b')]){_0x3f9f5c=ut[_0x45dd('0x9c')](_0x24a014,0xf,_0x45dd('0x9d'));rpcDb[_0x45dd('0x8b')](_0x3f9f5c,_0x45dd('0xbd'));}else{if(_0x24a014['countbusyretry']>=_0xb0c978['dialBusyMaxRetry']){rpcDb['createCustomerFinal'](_0x24a014,_0x45dd('0xbe'));}else{rpcDb['rescheduleContact'](ut[_0x45dd('0xbf')](_0x24a014,'countbusyretry',_0xb0c978[_0x45dd('0xc0')]),_0x24a014[_0x45dd('0xa2')],_0x24a014[_0x45dd('0xa3')]);}}break;case _0x45dd('0xc1'):_0xb0c978['outboundNoAnswerCallsDay']+=0x1;_0x24a014[_0x45dd('0xc2')]+=0x1;_0x24a014['countglobal']=ut[_0x45dd('0x9a')](_0x24a014);ut['logCustomer'](_0x24a014,0x3,_0x45dd('0xc3'));ami[_0x45dd('0x96')](_0x45dd('0xc4'),ut[_0x45dd('0x98')](_0x24a014,'noanswer'));rpcDb[_0x45dd('0x87')](_0x24a014,_0x45dd('0xc5'));if(ut['totalGlobal'](_0x24a014)>=_0xb0c978['dialGlobalMaxRetry']){_0x3f9f5c=ut['cloneAction'](_0x24a014,0xf,_0x45dd('0x9d'));rpcDb[_0x45dd('0x8b')](_0x3f9f5c,_0x45dd('0xc6'));}else{if(_0x24a014[_0x45dd('0xc2')]>=_0xb0c978[_0x45dd('0xc7')]){rpcDb[_0x45dd('0x8b')](_0x24a014,_0x45dd('0xc5'));}else{rpcDb[_0x45dd('0xa0')](ut['scheduledAt'](_0x24a014,_0x45dd('0xc2'),_0xb0c978['dialNoAnswerRetryFrequency']),_0x24a014[_0x45dd('0xa2')],_0x24a014[_0x45dd('0xa3')]);}}break;case _0x45dd('0xc8'):_0xb0c978[_0x45dd('0xc9')]+=0x1;_0x24a014[_0x45dd('0xca')]+=0x1;_0x24a014[_0x45dd('0xae')]=ut[_0x45dd('0x9a')](_0x24a014);ut[_0x45dd('0x89')](_0x24a014,0x8,'Congestion');ami[_0x45dd('0x96')](_0x45dd('0xcb'),ut[_0x45dd('0x98')](_0x24a014,_0x45dd('0xcc')));rpcDb['createCustomerHistory'](_0x24a014,_0x45dd('0xcd'));if(ut[_0x45dd('0x9a')](_0x24a014)>=_0xb0c978['dialGlobalMaxRetry']){_0x3f9f5c=ut[_0x45dd('0x9c')](_0x24a014,0xf,_0x45dd('0x9d'));rpcDb[_0x45dd('0x8b')](_0x3f9f5c,_0x45dd('0xce'));}else{if(_0x24a014['countcongestionretry']>=_0xb0c978['dialCongestionMaxRetry']){rpcDb[_0x45dd('0x8b')](_0x24a014,_0x45dd('0xcd'));}else{rpcDb[_0x45dd('0xa0')](ut[_0x45dd('0xbf')](_0x24a014,'countcongestionretry',_0xb0c978[_0x45dd('0xc0')]),_0x24a014[_0x45dd('0xa2')],_0x24a014[_0x45dd('0xa3')]);}}break;case'CANCEL':_0xb0c978[_0x45dd('0x33')]+=0x1;_0x24a014[_0x45dd('0xcf')]+=0x1;_0x24a014[_0x45dd('0xae')]=ut['totalGlobal'](_0x24a014);ut[_0x45dd('0x89')](_0x24a014,0x14,'AgentReject');ami[_0x45dd('0x96')](_0x45dd('0xd0'),ut[_0x45dd('0x98')](_0x24a014,_0x45dd('0xd1')));rpcDb[_0x45dd('0x87')](_0x24a014,_0x45dd('0xd2'));if(ut[_0x45dd('0x9a')](_0x24a014)>=_0xb0c978[_0x45dd('0x9b')]){_0x3f9f5c=ut[_0x45dd('0x9c')](_0x24a014,0x14,'AgentReject');rpcDb[_0x45dd('0x8b')](_0x3f9f5c,_0x45dd('0xd3'));}else{if(_0x24a014[_0x45dd('0xcf')]>=_0xb0c978['dialAgentRejectMaxRetry']){rpcDb[_0x45dd('0x8b')](_0x24a014,_0x45dd('0xd3'));}else{rpcDb[_0x45dd('0xa0')](ut[_0x45dd('0xbf')](_0x24a014,_0x45dd('0xcf'),_0xb0c978[_0x45dd('0xd4')]),_0x24a014[_0x45dd('0xa2')],_0x24a014['activeContact']);}}break;case _0x45dd('0xd5'):_0xb0c978[_0x45dd('0x35')]+=0x1;_0x24a014[_0x45dd('0xd6')]+=0x1;_0x24a014[_0x45dd('0xae')]=ut['totalGlobal'](_0x24a014);ut[_0x45dd('0x89')](_0x24a014,0xb,_0x45dd('0xd7'));rpcDb[_0x45dd('0x87')](_0x24a014,_0x45dd('0xd8'));if(ut[_0x45dd('0x9a')](_0x24a014)>=_0xb0c978[_0x45dd('0x9b')]){_0x3f9f5c=ut['cloneAction'](_0x24a014,0xf,_0x45dd('0x9d'));rpcDb[_0x45dd('0x8b')](_0x3f9f5c,_0x45dd('0xd8'));}else{if(_0x24a014[_0x45dd('0xd9')]>=_0xb0c978[_0x45dd('0xda')]){rpcDb[_0x45dd('0x8b')](_0x24a014,_0x45dd('0xd8'));}else{rpcDb['rescheduleContact'](ut[_0x45dd('0xbf')](_0x24a014,_0x45dd('0xd6'),_0xb0c978[_0x45dd('0xdb')]),_0x24a014[_0x45dd('0xa2')],_0x24a014[_0x45dd('0xa3')]);}}break;default:if(_0x24a014[_0x45dd('0x71')]){ut[_0x45dd('0x72')](_0xb0c978,_0x45dd('0xdc'));ut[_0x45dd('0x73')](_0x45dd('0xdd')+_0xb0c978['name'],_0x1ff3cc);}_0xb0c978[_0x45dd('0x34')]+=0x1;_0x24a014['countglobal']=ut[_0x45dd('0x9a')](_0x24a014);ut[_0x45dd('0x89')](_0x24a014,0xc,_0x1ff3cc['cause-txt']||_0x1ff3cc[_0x45dd('0xde')]);rpcDb[_0x45dd('0x87')](_0x24a014,_0x45dd('0xdf'));if(ut[_0x45dd('0x9a')](_0x24a014)>=_0xb0c978['dialGlobalMaxRetry']){_0x3f9f5c=ut['cloneAction'](_0x24a014,0xf,'Global');rpcDb['createCustomerFinal'](_0x3f9f5c,_0x45dd('0xe0'));}else{rpcDb['createCustomerFinal'](_0x24a014,_0x45dd('0xe0'));}delete this[_0x45dd('0x10')][_0x1ff3cc['linkedid']];}if(!(_0x24a014[_0x45dd('0x71')]&&_0x32a509==='16')){ut[_0x45dd('0x6f')](_0xb0c978,'[callProgressDetectingCustomer]');logger[_0x45dd('0x61')](_0x45dd('0xe1'),_0x24a014['uniqueid'],_0x45dd('0xb7'),_0xb0c978[_0x45dd('0x20')],_0x45dd('0xe2'),_0xb0c978[_0x45dd('0x40')]);}if(_0x32a509!=='ANSWER'){delete this['actions'][_0x1ff3cc[_0x45dd('0xa4')]];delete this['actions'][_0x1ff3cc[_0x45dd('0xe3')]];}}};Preview['prototype'][_0x45dd('0xe4')]=function(_0x1158e1,_0x1c73cb,_0x84c99d){if(_[_0x45dd('0xe5')](_0x1c73cb)&&_0x45dd('0xe6')!==typeof _0x1c73cb){return;}if(_[_0x45dd('0xe5')](_0x84c99d)&&_0x45dd('0xe6')!==typeof _0x84c99d){return;}switch(_0x84c99d[_0x45dd('0xe7')]){case'0':ut[_0x45dd('0xe8')](_0x1158e1,0x0,_0x45dd('0x95'));rpcDb[_0x45dd('0xe9')](_0x1158e1,_0x45dd('0xea'));break;case'3':ut[_0x45dd('0xe8')](_0x1158e1,0x3,'NoAnswer');rpcDb['createAgentHistory'](_0x1158e1,_0x45dd('0xeb'));break;case'5':ut[_0x45dd('0xe8')](_0x1158e1,0x5,_0x45dd('0xba'));rpcDb[_0x45dd('0xe9')](_0x1158e1,_0x45dd('0xec'));break;case'8':ut[_0x45dd('0xe8')](_0x1158e1,0x8,_0x45dd('0xed'));rpcDb[_0x45dd('0xe9')](_0x1158e1,_0x45dd('0xee'));break;case'22':ut[_0x45dd('0xe8')](_0x1158e1,0x16,_0x45dd('0xef'));rpcDb[_0x45dd('0xe9')](_0x1158e1,_0x45dd('0xf0'));break;default:ut[_0x45dd('0xe8')](_0x1158e1,0xc,_0x84c99d[_0x45dd('0xe7')]);rpcDb[_0x45dd('0xe9')](_0x1158e1,_0x45dd('0xee'));}ut[_0x45dd('0x6f')](_0x1c73cb,'[callProgressDetectingAgent]');logger['info']('[originated][decrement][callProgressDetectingAgent]',_0x1158e1[_0x45dd('0xb6')],'\x20Queue',_0x1c73cb[_0x45dd('0x20')],_0x45dd('0xe2'),_0x1c73cb['originated']);delete this[_0x45dd('0x10')][_0x1158e1[_0x45dd('0xb6')]];};Preview[_0x45dd('0x9')][_0x45dd('0xf1')]=function(_0x262e0c,_0x4e9421,_0x1b801d,_0x5792ec,_0x2af238){var _0x1d14ba=this;return new BPromise(function(_0x5c7eaf,_0x4bc5c8){if(_['isNil'](_0x4e9421)||_[_0x45dd('0x60')](_0x4e9421[_0x45dd('0xf2')])||_[_0x45dd('0x60')](_0x4e9421[_0x45dd('0xf2')][_0x45dd('0xf3')])||_[_0x45dd('0x60')](_0x4e9421['VoiceQueueId'])){_0x4bc5c8(ut[_0x45dd('0x3f')](_0x45dd('0xf4'),_0x5792ec,_0x2af238));return;}var _0x589da4=uuid['v4']();var _0x192f62=_0x1d14ba[_0x45dd('0xd')][_0x4e9421['Queue'][_0x45dd('0x20')]];var _0xb7bae4=_0x1b801d?_0x1d14ba[_0x45dd('0x11')][_0x1b801d]['id']:undefined;_0x1d14ba[_0x45dd('0x10')][_0x589da4]=new Action(_0x4e9421,_0x192f62,_0x589da4,_0x1b801d,_0xb7bae4);var _0x4eba92=_0x1d14ba[_0x45dd('0x10')][_0x589da4];_0x4eba92[_0x45dd('0xa2')]=_0x5792ec;_0x4eba92[_0x45dd('0xa3')]=_0x2af238;_0x4eba92['lookAgent']=_0x1b801d;if(_[_0x45dd('0xf5')](_0x262e0c)){_0x1d14ba[_0x45dd('0xf6')](_0x4eba92,_0x192f62,_0x4e9421,_0x1b801d)[_0x45dd('0xf7')](function(_0x132ee0){logger['info'](_0x45dd('0xf8'),_0x45dd('0xf9')+_0x4eba92[_0x45dd('0x64')]+'\x20IdHopper:\x20'+_0x4eba92['idContact'],JSON[_0x45dd('0x48')](_0x132ee0));ami[_0x45dd('0x96')](_0x45dd('0xfa'),ut[_0x45dd('0x98')](_0x4eba92,_0x45dd('0xfb')));_0x5c7eaf(ut['message']('Calling'));})[_0x45dd('0x6e')](function(_0x46f24e){ut[_0x45dd('0x52')](_0x45dd('0xfc'),_0x46f24e);_0x4bc5c8(ut[_0x45dd('0x3f')]('Call\x20failed',_0x5792ec,_0x2af238));});}else{_0x192f62['outboundBlacklistCallsDay']+=0x1;ut[_0x45dd('0xfd')](_0x4eba92);rpcDb[_0x45dd('0xfe')](_0x4eba92,_0x45dd('0xff'));delete _0x1d14ba[_0x45dd('0x10')][_0x589da4];_0x4bc5c8(ut[_0x45dd('0x3f')](_0x45dd('0x100'),_0x5792ec,_0x2af238));}});};Preview[_0x45dd('0x9')][_0x45dd('0x90')]=function(_0x49c2dd){return!_['isNil'](_0x49c2dd)&&!_[_0x45dd('0x60')](_0x49c2dd['name'])&&!_[_0x45dd('0x60')](_0x49c2dd['active'])&&_0x49c2dd[_0x45dd('0x46')]&&!_['isNil'](this[_0x45dd('0xf')][util[_0x45dd('0x4a')](_0x45dd('0x101'),_0x49c2dd[_0x45dd('0x20')])])&&!_[_0x45dd('0x60')](this[_0x45dd('0xf')][util[_0x45dd('0x4a')](_0x45dd('0x101'),_0x49c2dd[_0x45dd('0x20')])][_0x45dd('0x6c')])&&(this[_0x45dd('0xf')][util['format']('SIP/%s',_0x49c2dd[_0x45dd('0x20')])][_0x45dd('0x6c')]===_0x45dd('0x102')||this[_0x45dd('0xf')][util[_0x45dd('0x4a')]('SIP/%s',_0x49c2dd[_0x45dd('0x20')])][_0x45dd('0x6c')]===_0x45dd('0x103'));};Preview[_0x45dd('0x9')]['run']=function(_0x5c624e,_0x51219d){var _0x1040dd=this;return new BPromise(function(_0x2cea38,_0x14941e){_0x1040dd['execRun'](_0x5c624e,_0x51219d)[_0x45dd('0xf7')](function(_0x48fe95){_0x2cea38(_[_0x45dd('0x66')](_0x48fe95,[_0x45dd('0x3f')]));})[_0x45dd('0x6e')](function(_0x5870aa){if(_0x5870aa[_0x45dd('0x104')]){rpcDb[_0x45dd('0x105')](_0x5c624e);}if(_0x5870aa['active']){rpcDb[_0x45dd('0x106')](_0x5c624e);}_0x14941e(_['pick'](_0x5870aa,[_0x45dd('0x3f')]));});});};Preview[_0x45dd('0x9')][_0x45dd('0x107')]=function(_0x247681,_0x4db1ce){var _0x57e25b=this;return new BPromise(function(_0x48b35d,_0x2d14dd){var _0x4b784e,_0x45f63f;rpcDb[_0x45dd('0x108')](_0x247681)['then'](function(_0x5e6d2d){if(!_[_0x45dd('0x60')](_0x5e6d2d[0x0])){_0x45f63f=_0x5e6d2d[0x0][_0x45dd('0x109')]?![]:!![];_0x4b784e=_0x5e6d2d[0x0][_0x45dd('0x109')]?!![]:![];_0x4b784e=_0x4db1ce?!![]:_0x4b784e;}var _0x26b66e=_0x57e25b[_0x45dd('0x10a')](_0x5e6d2d);if(_0x26b66e[_0x45dd('0x10b')]){rpcDb[_0x45dd('0x10c')](_[_0x45dd('0x66')](_0x5e6d2d[0x0],[_0x45dd('0x69'),_0x45dd('0x10d')]))[_0x45dd('0xf7')](function(_0x40ee98){_0x57e25b[_0x45dd('0xf1')](_0x40ee98,_0x5e6d2d[0x0],_0x4db1ce,_0x45f63f,_0x4b784e)[_0x45dd('0xf7')](function(_0x4dab1a){_0x48b35d(_0x4dab1a);})['catch'](function(_0x1ac087){_0x2d14dd(_0x1ac087);});})[_0x45dd('0x6e')](function(_0x3f23ee){ut[_0x45dd('0x52')](_0x45dd('0x10e'),_0x3f23ee);_0x2d14dd(ut['message'](_0x45dd('0x10f'),_0x45f63f,_0x4b784e));});}else{_0x2d14dd(ut[_0x45dd('0x3f')](_0x26b66e[_0x45dd('0x3f')],_0x45f63f,_0x4b784e));}})[_0x45dd('0x6e')](function(_0x2769bb){ut[_0x45dd('0x52')](_0x45dd('0x110'),_0x2769bb);_0x2d14dd(ut[_0x45dd('0x3f')](_0x45dd('0x10f'),![],!![]));});});};Preview[_0x45dd('0x9')]['validateContact']=function(_0x593024){if(_[_0x45dd('0x60')](_0x593024)||_[_0x45dd('0xf5')](_0x593024)||!_[_0x45dd('0x60')](_0x593024[0x0]['Agent'])&&_[_0x45dd('0x60')](_0x593024[0x0][_0x45dd('0x7d')][_0x45dd('0x20')])){ut[_0x45dd('0x52')](_0x45dd('0x111'),_0x593024);return{'isValid':![],'message':_0x45dd('0x112')};}var _0x40e1eb=this[_0x45dd('0xd')][_0x593024[0x0][_0x45dd('0x63')][_0x45dd('0x20')]];_0x40e1eb[_0x45dd('0x3f')]='ACTIVE';if(_['isNil'](_0x40e1eb)){ut['logger']('[Preview][validateContact][Empty\x20Campaign]',_0x40e1eb);return{'isValid':![],'message':_0x45dd('0x113')};}if(!this[_0x45dd('0x90')](_0x40e1eb[_0x45dd('0x45')])){ut[_0x45dd('0x52')](_0x45dd('0x114'),_0x45dd('0x115')+_0x40e1eb[_0x45dd('0x20')]+'\x20Trunk\x20is\x20not\x20active');if(!this[_0x45dd('0x90')](_0x40e1eb[_0x45dd('0x91')])){ut[_0x45dd('0x52')](_0x45dd('0x114'),_0x40e1eb['name']+_0x45dd('0x116'));return{'isValid':![],'message':_0x45dd('0x117')};}}if(!ut[_0x45dd('0x118')](_0x40e1eb[_0x45dd('0x119')])){ut['logger'](_0x45dd('0x11a'),_0x40e1eb['name']+_0x45dd('0x11b'));return{'isValid':![],'message':_0x45dd('0x115')+_0x40e1eb[_0x45dd('0x20')]+_0x45dd('0x11b')};}return{'isValid':!![],'message':_0x45dd('0x11c')};};Preview['prototype']['execCall']=function(_0x2720b5,_0x5586c0,_0x249a3f,_0x9bf88b){var _0x2ecd5b=this;return new BPromise(function(_0xcb9fd5,_0x557357){var _0x422b2a=_0x2720b5[_0x45dd('0xb6')];var _0x499eb7=_0x2ecd5b[_0x45dd('0x90')](_0x5586c0[_0x45dd('0x45')])?util[_0x45dd('0x4a')](_0x45dd('0x11d'),_0x5586c0[_0x45dd('0x45')][_0x45dd('0x20')],_['isNil'](_0x5586c0['dialPrefix'])?'':_0x5586c0['dialPrefix']['trim']()||'',_0x5586c0[_0x45dd('0x11e')]>0x0?_0x249a3f[_0x45dd('0xf2')][_0x45dd('0xf3')][_0x45dd('0x11f')](_0x5586c0[_0x45dd('0x11e')]):_0x249a3f['Contact']['phone']):util['format']('SIP/%s/%s%s',_['isNil'](_0x5586c0['TrunkBackup'])?_0x5586c0[_0x45dd('0x45')][_0x45dd('0x20')]:_0x5586c0[_0x45dd('0x91')][_0x45dd('0x20')],_['isNil'](_0x5586c0['dialPrefix'])?'':_0x5586c0[_0x45dd('0x2a')][_0x45dd('0x120')]()||'',_0x5586c0[_0x45dd('0x11e')]>0x0?_0x249a3f[_0x45dd('0xf2')]['phone'][_0x45dd('0x11f')](_0x5586c0[_0x45dd('0x11e')]):_0x249a3f['Contact'][_0x45dd('0xf3')]);var _0x5047f1=_0x2ecd5b['isTrunkReachable'](_0x5586c0[_0x45dd('0x45')])?ut['getCallerId'](_0x5586c0[_0x45dd('0x45')]['callerid'],_0x5586c0[_0x45dd('0x121')],_0x5586c0[_0x45dd('0x122')]>0x0?ut['getCallerIdRandom'](_0x5586c0['dialOriginateCallerIdNumber'],_0x5586c0['dialRandomLastDigitCallerIdNumber']):_0x5586c0['dialOriginateCallerIdNumber']):ut[_0x45dd('0x123')](_[_0x45dd('0x60')](_0x5586c0[_0x45dd('0x91')])?_0x5586c0[_0x45dd('0x45')][_0x45dd('0x124')]:_0x5586c0[_0x45dd('0x91')][_0x45dd('0x124')],_0x5586c0['dialOriginateCallerIdName'],_0x5586c0[_0x45dd('0x122')]>0x0?ut[_0x45dd('0x125')](_0x5586c0[_0x45dd('0x28')],_0x5586c0[_0x45dd('0x122')]):_0x5586c0[_0x45dd('0x28')]);if(_0x5047f1){_0x2720b5[_0x45dd('0x126')]=ut['extractCalleridName'](_0x5047f1);_0x2720b5[_0x45dd('0x127')]=ut['extractCalleridNumber'](_0x5047f1);}var _0x7228f8=ut[_0x45dd('0x128')](_0x5586c0,_0x249a3f,_0x499eb7,_0x5047f1,_0x422b2a,_0x2720b5);_['merge'](_0x2720b5,ut[_0x45dd('0x129')](_0x7228f8));_0x2720b5[_0x45dd('0x82')]=moment()[_0x45dd('0x4a')]('YYYY-MM-DD\x20HH:mm:ss');ami[_0x45dd('0x6b')](ut['variablesAction'](_0x2720b5,_0x5586c0,_0x7228f8,_0x2720b5[_0x45dd('0xa3')],_0x9bf88b))[_0x45dd('0xf7')](function(_0x10acaf){_0x5586c0[_0x45dd('0x40')]+=0x1;logger['info'](_0x45dd('0x12a'),_0x422b2a,_0x45dd('0xb7'),_0x5586c0[_0x45dd('0x20')],_0x45dd('0xe2'),_0x5586c0[_0x45dd('0x40')]);_0xcb9fd5(_0x10acaf);})['catch'](function(_0x526508){ut[_0x45dd('0xe8')](_0x2720b5,0xe,_0x45dd('0x12b'));rpcDb[_0x45dd('0xe9')](_0x2720b5,_0x45dd('0x12c'));_0x557357(_0x526508);});});};Preview[_0x45dd('0x9')][_0x45dd('0x12d')]=function(_0x14058a){if(this[_0x45dd('0x10')][_0x14058a[_0x45dd('0xa4')]]){this['actions'][_0x14058a['linkedid']]['channel']=_0x14058a[_0x45dd('0x6d')];}};Preview[_0x45dd('0x9')][_0x45dd('0x13')]=function(_0x518e3f){var _0x1670ed=this;var _0x1678cd=this['actions'][_0x518e3f[_0x45dd('0x12e')]];if(_0x1678cd){if(_0x1678cd[_0x45dd('0x12f')]&&this[_0x45dd('0x11')][_0x1678cd['lookAgent']]){ut['logLookAgent'](_0x1678cd,this[_0x45dd('0x11')][_0x1678cd['lookAgent']][_0x45dd('0x20')],this[_0x45dd('0x11')][_0x1678cd[_0x45dd('0x12f')]]['id']);}var _0x335f06=_[_0x45dd('0x130')](_0x1678cd);_0x335f06['responsetime']=moment()[_0x45dd('0x4a')]('YYYY-MM-DD\x20HH:mm:ss');var _0x16fb2b=_0x1670ed['campaignsPreview'][_0x1678cd[_0x45dd('0x64')]];if(ut['isFailure'](_0x518e3f[_0x45dd('0x131')])){if(_0x1678cd[_0x45dd('0xa2')]){rpcDb[_0x45dd('0x105')](_0x1678cd[_0x45dd('0x132')]);}if(_0x1678cd[_0x45dd('0xa3')]){rpcDb[_0x45dd('0x106')](_0x1678cd[_0x45dd('0x132')]);}ami[_0x45dd('0x96')](_0x45dd('0x133'),ut['buildObj'](_0x1678cd,_0x45dd('0x134')));this[_0x45dd('0xe4')](_0x335f06,_0x16fb2b,_0x518e3f);}else{_0x1678cd['starttime']=moment()[_0x45dd('0x4a')](_0x45dd('0x83'));ut['logAgent'](_0x335f06,0x4,'Answer');rpcDb['createAgentHistory'](_0x335f06,_0x45dd('0x135'));}}};Preview[_0x45dd('0x9')][_0x45dd('0x16')]=function(_0x43ced1){var _0x5056ab=this;var _0xc63dac=this['actions'][_0x43ced1[_0x45dd('0xa4')]];var _0xa474ed;if(_0xc63dac){_0xa474ed=this[_0x45dd('0xd')][_0xc63dac[_0x45dd('0x64')]];logger[_0x45dd('0x61')](_0x45dd('0x136'),_0x43ced1['linkedid'],_0x45dd('0xb7'),_0xa474ed[_0x45dd('0x20')],_0x45dd('0xa8'),_0xa474ed['pTalking']);}if(this[_0x45dd('0x10')][_0x43ced1[_0x45dd('0xa4')]]&&_0x43ced1['linkedid']!==_0x43ced1[_0x45dd('0xb6')]){if(_0x43ced1['cause']==='16'&&this['actions'][_0x43ced1[_0x45dd('0xa4')]][_0x45dd('0x71')]){this[_0x45dd('0x137')](_0x43ced1,_0x43ced1['linkedid'],_0x43ced1['cause']);}else if(this[_0x45dd('0x10')][_0x43ced1[_0x45dd('0xa4')]][_0x45dd('0x71')]){logger[_0x45dd('0x61')](_0x45dd('0x138'),_0x43ced1[_0x45dd('0xa4')],_0x43ced1[_0x45dd('0x139')],_0x45dd('0xb7'),_0xa474ed[_0x45dd('0x20')],_0x45dd('0xa8'),_0xa474ed[_0x45dd('0x65')]);this[_0x45dd('0x137')](_0x43ced1,_0x43ced1[_0x45dd('0xa4')],_0x43ced1[_0x45dd('0x139')]);}}else if(_0xc63dac&&_['isNil'](_0xc63dac[_0x45dd('0x13a')])&&_0xa474ed[_0x45dd('0x13b')]&&_0x43ced1['linkedid']===_0x43ced1['uniqueid']&&_[_0x45dd('0x60')](_0x43ced1['reason'])&&_0x43ced1['cause']==='16'&&_0x43ced1['channelstate']==='6'&&_[_0x45dd('0xe5')](_0xc63dac[_0x45dd('0x13c')])){if(_0xc63dac[_0x45dd('0xa2')]){rpcDb[_0x45dd('0x105')](_0xc63dac[_0x45dd('0x132')]);}if(_0xc63dac[_0x45dd('0xa3')]){rpcDb[_0x45dd('0x106')](_0xc63dac['idContact']);}_0x43ced1[_0x45dd('0xe7')]='22';this[_0x45dd('0xe4')](_0xc63dac,_0xa474ed,_0x43ced1);}else if(_0xc63dac&&_0xc63dac[_0x45dd('0x13c')]){if(_0x43ced1['cause']==='16'&&this[_0x45dd('0x10')][_0x43ced1[_0x45dd('0xa4')]][_0x45dd('0x71')]){logger[_0x45dd('0x61')]('[syncHangup][talking][transfer]',_0x43ced1[_0x45dd('0xa4')],_0x43ced1[_0x45dd('0x139')],'\x20Queue',_0xa474ed[_0x45dd('0x20')],_0x45dd('0xa8'),_0xa474ed['pTalking']);this['callProgressDetectingCustomer'](_0x43ced1,_0x43ced1['linkedid'],_0x43ced1[_0x45dd('0x139')]);}else if(this[_0x45dd('0x10')][_0x43ced1[_0x45dd('0xa4')]]['dialAnswer']){logger['info'](_0x45dd('0x138'),_0x43ced1['linkedid'],_0x43ced1[_0x45dd('0x139')],_0x45dd('0xb7'),_0xa474ed[_0x45dd('0x20')],'pTalking:\x20',_0xa474ed['pTalking']);this[_0x45dd('0x137')](_0x43ced1,_0x43ced1[_0x45dd('0xa4')],_0x43ced1[_0x45dd('0x139')]);}}};Preview[_0x45dd('0x9')][_0x45dd('0x1a')]=function(_0x163841){if(this[_0x45dd('0x10')][_0x163841[_0x45dd('0xe3')]]&&_0x163841['destlinkedid']!==_0x163841[_0x45dd('0x13d')]){this[_0x45dd('0x137')](_0x163841,_0x163841[_0x45dd('0xe3')],_0x163841[_0x45dd('0xde')]);}};Preview[_0x45dd('0x9')][_0x45dd('0x18')]=function(_0x380764){if(this[_0x45dd('0x10')][_0x380764[_0x45dd('0xa4')]]&&_0x380764[_0x45dd('0xa4')]!==_0x380764[_0x45dd('0xb6')]&&!this[_0x45dd('0x10')][_0x380764[_0x45dd('0xa4')]][_0x45dd('0x71')]){if(_0x380764[_0x45dd('0x139')]==='1'){this[_0x45dd('0x137')](_0x380764,_0x380764[_0x45dd('0xa4')],_0x380764[_0x45dd('0x139')]);}}};Preview[_0x45dd('0x9')][_0x45dd('0x13e')]=function(_0x5c4eac,_0x40c9ff,_0x2887f2){if(this[_0x45dd('0x10')][_0x5c4eac]){if(_[_0x45dd('0x60')](this[_0x45dd('0x10')][_0x5c4eac][_0x45dd('0x13f')])){this['actions'][_0x5c4eac]['variables']={};}this['actions'][_0x5c4eac][_0x45dd('0x13f')][_0x40c9ff]=_0x2887f2;}};Preview[_0x45dd('0x9')][_0x45dd('0x1d')]=function(_0x10b958){try{if(!_['isNil'](_0x10b958)){if(ut[_0x45dd('0x140')](_[_0x45dd('0x141')](_0x10b958[_0x45dd('0x142')])[0x0])){this[_0x45dd('0x13e')](_0x10b958[_0x45dd('0xb6')],_[_0x45dd('0x141')](_0x10b958[_0x45dd('0x142')])[0x0],_0x10b958[_0x45dd('0x143')]);}}}catch(_0x3f91b8){logger['error'](_0x45dd('0x144'),util[_0x45dd('0x145')](_0x3f91b8,{'showHidden':![],'depth':null}));}};Preview[_0x45dd('0x9')][_0x45dd('0x146')]=function(_0x23f260){if(_0x23f260){if(this[_0x45dd('0x10')][_0x23f260[_0x45dd('0x147')]]){this[_0x45dd('0x10')][_0x23f260['transfertargetlinkedid']][_0x45dd('0x13c')]=!![];}}};Preview[_0x45dd('0x9')][_0x45dd('0x1f')]=function(_0x1495cf){if(_0x1495cf){if(this['actions'][_0x1495cf['transfererlinkedid']]){this[_0x45dd('0x10')][_0x1495cf[_0x45dd('0x148')]][_0x45dd('0x13c')]=!![];}}};module[_0x45dd('0x149')]=Preview;
\ No newline at end of file
diff --git a/server/services/ami/preview/rpcDb.js b/server/services/ami/preview/rpcDb.js
index 7a4aa4c..46faf1b 100644
--- a/server/services/ami/preview/rpcDb.js
+++ b/server/services/ami/preview/rpcDb.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x6aa7=['type','uniqueid','calleridnum','calleridname','queue','answertime','queuecallerleaveAt','queuecallercomplete','queuecallercompleteAt','endtime','connectedlinename','context','from-sip','xcally-motion-preview','assigned','membername','create','getContactRecallMe','[GetContactRecallMe]\x20','util','../../../config/logger','preview','lodash','../rpc/cmHopper','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/voiceQueueRt','error','inspect','then','createHistory','catch','resolve','[createHistory]\x20','moveContactManagedDialer','[moveContactManagedDialer]\x20','checkIsBlackList','getContactPreview','[getContactPreview]\x20','createAgentHistory','createCustomerFinal','rescheduleContact','UserId','active','[rescheduleContact]\x20','countReScheduled','[countReScheduled]\x20','unlockContact','[unlockContact]\x20','disableContact','[activeContact]\x20'];(function(_0x579c3a,_0x3f64e2){var _0x399969=function(_0x5f10bf){while(--_0x5f10bf){_0x579c3a['push'](_0x579c3a['shift']());}};_0x399969(++_0x3f64e2);}(_0x6aa7,0x178));var _0x76aa=function(_0x480a16,_0x45ca6e){_0x480a16=_0x480a16-0x0;var _0x31fdb4=_0x6aa7[_0x480a16];return _0x31fdb4;};'use strict';var util=require(_0x76aa('0x0'));var BPromise=require('bluebird');var logger=require(_0x76aa('0x1'))(_0x76aa('0x2'));var _=require(_0x76aa('0x3'));var cmHopper=require(_0x76aa('0x4'));var cmHopperFinal=require('../rpc/cmHopperFinal');var cmHopperHistory=require(_0x76aa('0x5'));var cmHopperBlack=require(_0x76aa('0x6'));var voiceQueueRt=require(_0x76aa('0x7'));var agentReportPreview=require('../rpc/agentReportPreview');var voiceQueueReport=require('../rpc/voiceQueueReport');function loggerCatch(_0x1aceaa){return function(_0x4d53f6){logger[_0x76aa('0x8')](_0x1aceaa,util[_0x76aa('0x9')](_0x4d53f6,{'showHidden':![],'depth':null}));};}function create(_0xa9b695){return BPromise['resolve']()[_0x76aa('0xa')](cmHopperHistory[_0x76aa('0xb')](_0xa9b695))[_0x76aa('0xc')](loggerCatch('[createHistory]\x20'));}function createAgent(_0xcd99aa){return BPromise[_0x76aa('0xd')]()[_0x76aa('0xa')](agentReportPreview[_0x76aa('0xb')](_0xcd99aa))[_0x76aa('0xc')](loggerCatch(_0x76aa('0xe')));}function moveContact(_0x2c5075){return BPromise[_0x76aa('0xd')]()[_0x76aa('0xa')](cmHopper[_0x76aa('0xf')](_0x2c5075,!![]))['catch'](loggerCatch(_0x76aa('0x10')));}exports['checkIsBlackList']=function(_0x226536){return BPromise[_0x76aa('0xd')]()[_0x76aa('0xa')](cmHopperBlack[_0x76aa('0x11')](_0x226536))[_0x76aa('0xc')](loggerCatch('[checkIsBlackList]\x20'));};exports['getContactPreview']=function(_0x2b3b4f){return BPromise['resolve']()[_0x76aa('0xa')](cmHopper[_0x76aa('0x12')](_0x2b3b4f))['catch'](loggerCatch(_0x76aa('0x13')));};exports['createHistory']=function(_0x328381,_0x5181d2){create(_0x328381)[_0x76aa('0xc')](loggerCatch(_0x5181d2));moveContact(_0x328381)[_0x76aa('0xc')](loggerCatch(_0x5181d2));};exports[_0x76aa('0x14')]=function(_0x21c16d,_0xa1bc7){createAgent(_0x21c16d)[_0x76aa('0xc')](loggerCatch(_0xa1bc7));};exports['createCustomerHistory']=function(_0x5d6202,_0x256636){create(_0x5d6202)[_0x76aa('0xc')](loggerCatch(_0x256636));};exports[_0x76aa('0x15')]=function(_0x15b931,_0x15109b){moveContact(_0x15b931)[_0x76aa('0xc')](loggerCatch(_0x15109b));};exports[_0x76aa('0x16')]=function(_0x2eaf48,_0x385157,_0x5990c1){if(_0x385157){_0x2eaf48[_0x76aa('0x17')]=null;}if(_0x5990c1){_0x2eaf48[_0x76aa('0x18')]=![];}return BPromise[_0x76aa('0xd')]()['then'](cmHopper[_0x76aa('0x16')](_0x2eaf48))[_0x76aa('0xc')](loggerCatch(_0x76aa('0x19')));};exports[_0x76aa('0x1a')]=function(_0x29c50c){return BPromise[_0x76aa('0xd')]()[_0x76aa('0xa')](cmHopper[_0x76aa('0x1a')](_0x29c50c))[_0x76aa('0xc')](loggerCatch(_0x76aa('0x1b')));};exports[_0x76aa('0x1c')]=function(_0x26b75e){return BPromise[_0x76aa('0xd')]()['then'](cmHopper[_0x76aa('0x1c')]({'UserId':null},_0x26b75e,0x1))[_0x76aa('0xc')](loggerCatch(_0x76aa('0x1d')));};exports[_0x76aa('0x1e')]=function(_0xa1e6){return BPromise[_0x76aa('0xd')]()[_0x76aa('0xa')](cmHopper[_0x76aa('0x1c')]({'active':![]},_0xa1e6,0x1))[_0x76aa('0xc')](loggerCatch(_0x76aa('0x1f')));};exports['crateCustomerReportQueue']=function(_0x3fcb7f){var _0x5a8030={};_0x5a8030[_0x76aa('0x20')]=_0x3fcb7f[_0x76aa('0x20')];_0x5a8030[_0x76aa('0x21')]=_0x3fcb7f[_0x76aa('0x21')];_0x5a8030[_0x76aa('0x22')]=_0x3fcb7f[_0x76aa('0x22')];_0x5a8030[_0x76aa('0x23')]=_0x3fcb7f[_0x76aa('0x23')];_0x5a8030[_0x76aa('0x24')]=_0x3fcb7f[_0x76aa('0x24')];_0x5a8030['queuecallerjoinAt']=_0x3fcb7f[_0x76aa('0x25')];_0x5a8030[_0x76aa('0x26')]=_0x3fcb7f[_0x76aa('0x25')];_0x5a8030[_0x76aa('0x27')]=0x1;_0x5a8030[_0x76aa('0x28')]=_0x3fcb7f[_0x76aa('0x29')];_0x5a8030[_0x76aa('0x2a')]=_0x3fcb7f['membername'];_0x5a8030[_0x76aa('0x2b')]=_0x76aa('0x2c');_0x5a8030['exten']=_0x76aa('0x2d');_0x5a8030['holdtime']=0x0;_0x5a8030[_0x76aa('0x2e')]=0x1;_0x5a8030['lastAssignedTo']=_0x3fcb7f[_0x76aa('0x2f')];_0x5a8030['queuecallerexitreason']='COMPLETED';return BPromise[_0x76aa('0xd')]()[_0x76aa('0xa')](voiceQueueReport[_0x76aa('0x30')](_0x5a8030))[_0x76aa('0xc')](loggerCatch('[voiceQueueReport]\x20'));};exports['getContactRecallMe']=function(_0xdb18d3,_0x1c7b6f){return BPromise[_0x76aa('0xd')]()[_0x76aa('0xa')](cmHopper[_0x76aa('0x31')](_0xdb18d3,_0x1c7b6f))['catch'](loggerCatch(_0x76aa('0x32')));};exports['rescheduleContactInQueue']=function(_0x5086f5){return BPromise[_0x76aa('0xd')]()[_0x76aa('0xa')](cmHopper[_0x76aa('0x16')](_0x5086f5,!![],!![]))[_0x76aa('0xc')](loggerCatch('[rescheduleContactInQueue]\x20'));};
\ No newline at end of file
+var _0x0faf=['rescheduleContact','UserId','[rescheduleContact]\x20','countReScheduled','[countReScheduled]\x20','[unlockContact]\x20','disableContact','unlockContact','[activeContact]\x20','crateCustomerReportQueue','type','uniqueid','calleridnum','calleridname','queue','queuecallerjoinAt','answertime','queuecallerleaveAt','queuecallercomplete','connectedlinename','membername','from-sip','assigned','queuecallerexitreason','COMPLETED','create','[voiceQueueReport]\x20','getContactRecallMe','[GetContactRecallMe]\x20','rescheduleContactInQueue','[rescheduleContactInQueue]\x20','util','../../../config/logger','preview','lodash','../rpc/cmHopper','../rpc/cmHopperFinal','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/voiceQueueRt','../rpc/agentReportPreview','error','inspect','then','createHistory','resolve','catch','[createHistory]\x20','moveContactManagedDialer','[moveContactManagedDialer]\x20','[checkIsBlackList]\x20','getContactPreview','[getContactPreview]\x20','createAgentHistory','createCustomerFinal'];(function(_0x48b977,_0x135e03){var _0x4fd510=function(_0x1d2653){while(--_0x1d2653){_0x48b977['push'](_0x48b977['shift']());}};_0x4fd510(++_0x135e03);}(_0x0faf,0x132));var _0xf0fa=function(_0x218ca4,_0x41cc40){_0x218ca4=_0x218ca4-0x0;var _0x1b3ff9=_0x0faf[_0x218ca4];return _0x1b3ff9;};'use strict';var util=require(_0xf0fa('0x0'));var BPromise=require('bluebird');var logger=require(_0xf0fa('0x1'))(_0xf0fa('0x2'));var _=require(_0xf0fa('0x3'));var cmHopper=require(_0xf0fa('0x4'));var cmHopperFinal=require(_0xf0fa('0x5'));var cmHopperHistory=require(_0xf0fa('0x6'));var cmHopperBlack=require(_0xf0fa('0x7'));var voiceQueueRt=require(_0xf0fa('0x8'));var agentReportPreview=require(_0xf0fa('0x9'));var voiceQueueReport=require('../rpc/voiceQueueReport');function loggerCatch(_0x3637a3){return function(_0x44ffa0){logger[_0xf0fa('0xa')](_0x3637a3,util[_0xf0fa('0xb')](_0x44ffa0,{'showHidden':![],'depth':null}));};}function create(_0x2db1d9){return BPromise['resolve']()[_0xf0fa('0xc')](cmHopperHistory[_0xf0fa('0xd')](_0x2db1d9))['catch'](loggerCatch('[createHistory]\x20'));}function createAgent(_0x3bda51){return BPromise[_0xf0fa('0xe')]()[_0xf0fa('0xc')](agentReportPreview[_0xf0fa('0xd')](_0x3bda51))[_0xf0fa('0xf')](loggerCatch(_0xf0fa('0x10')));}function moveContact(_0x379ff6){return BPromise[_0xf0fa('0xe')]()['then'](cmHopper[_0xf0fa('0x11')](_0x379ff6,!![]))['catch'](loggerCatch(_0xf0fa('0x12')));}exports['checkIsBlackList']=function(_0x39ae2b){return BPromise[_0xf0fa('0xe')]()[_0xf0fa('0xc')](cmHopperBlack['checkIsBlackList'](_0x39ae2b))['catch'](loggerCatch(_0xf0fa('0x13')));};exports['getContactPreview']=function(_0x1f7159){return BPromise[_0xf0fa('0xe')]()[_0xf0fa('0xc')](cmHopper[_0xf0fa('0x14')](_0x1f7159))[_0xf0fa('0xf')](loggerCatch(_0xf0fa('0x15')));};exports[_0xf0fa('0xd')]=function(_0x3f3bb7,_0x497542){create(_0x3f3bb7)[_0xf0fa('0xf')](loggerCatch(_0x497542));moveContact(_0x3f3bb7)[_0xf0fa('0xf')](loggerCatch(_0x497542));};exports[_0xf0fa('0x16')]=function(_0x1d3c22,_0x2bdf82){createAgent(_0x1d3c22)[_0xf0fa('0xf')](loggerCatch(_0x2bdf82));};exports['createCustomerHistory']=function(_0x56ef81,_0x2f376d){create(_0x56ef81)[_0xf0fa('0xf')](loggerCatch(_0x2f376d));};exports[_0xf0fa('0x17')]=function(_0x2385e2,_0x1a3620){moveContact(_0x2385e2)[_0xf0fa('0xf')](loggerCatch(_0x1a3620));};exports[_0xf0fa('0x18')]=function(_0x3de639,_0x3b87a2,_0x15942b){if(_0x3b87a2){_0x3de639[_0xf0fa('0x19')]=null;}if(_0x15942b){_0x3de639['active']=![];}return BPromise[_0xf0fa('0xe')]()[_0xf0fa('0xc')](cmHopper[_0xf0fa('0x18')](_0x3de639))[_0xf0fa('0xf')](loggerCatch(_0xf0fa('0x1a')));};exports[_0xf0fa('0x1b')]=function(_0x3901aa){return BPromise[_0xf0fa('0xe')]()[_0xf0fa('0xc')](cmHopper['countReScheduled'](_0x3901aa))[_0xf0fa('0xf')](loggerCatch(_0xf0fa('0x1c')));};exports['unlockContact']=function(_0x3b5d7d){return BPromise[_0xf0fa('0xe')]()[_0xf0fa('0xc')](cmHopper['unlockContact']({'UserId':null},_0x3b5d7d,0x1))[_0xf0fa('0xf')](loggerCatch(_0xf0fa('0x1d')));};exports[_0xf0fa('0x1e')]=function(_0xf631f6){return BPromise['resolve']()['then'](cmHopper[_0xf0fa('0x1f')]({'active':![]},_0xf631f6,0x1))[_0xf0fa('0xf')](loggerCatch(_0xf0fa('0x20')));};exports[_0xf0fa('0x21')]=function(_0x57b8e9){var _0x4058d6={};_0x4058d6[_0xf0fa('0x22')]=_0x57b8e9[_0xf0fa('0x22')];_0x4058d6['uniqueid']=_0x57b8e9[_0xf0fa('0x23')];_0x4058d6['calleridnum']=_0x57b8e9[_0xf0fa('0x24')];_0x4058d6[_0xf0fa('0x25')]=_0x57b8e9[_0xf0fa('0x25')];_0x4058d6['queue']=_0x57b8e9[_0xf0fa('0x26')];_0x4058d6[_0xf0fa('0x27')]=_0x57b8e9[_0xf0fa('0x28')];_0x4058d6[_0xf0fa('0x29')]=_0x57b8e9[_0xf0fa('0x28')];_0x4058d6[_0xf0fa('0x2a')]=0x1;_0x4058d6['queuecallercompleteAt']=_0x57b8e9['endtime'];_0x4058d6[_0xf0fa('0x2b')]=_0x57b8e9[_0xf0fa('0x2c')];_0x4058d6['context']=_0xf0fa('0x2d');_0x4058d6['exten']='xcally-motion-preview';_0x4058d6['holdtime']=0x0;_0x4058d6[_0xf0fa('0x2e')]=0x1;_0x4058d6['lastAssignedTo']=_0x57b8e9[_0xf0fa('0x2c')];_0x4058d6[_0xf0fa('0x2f')]=_0xf0fa('0x30');return BPromise[_0xf0fa('0xe')]()[_0xf0fa('0xc')](voiceQueueReport[_0xf0fa('0x31')](_0x4058d6))[_0xf0fa('0xf')](loggerCatch(_0xf0fa('0x32')));};exports['getContactRecallMe']=function(_0x3abd96,_0x307aa8){return BPromise[_0xf0fa('0xe')]()['then'](cmHopper[_0xf0fa('0x33')](_0x3abd96,_0x307aa8))[_0xf0fa('0xf')](loggerCatch(_0xf0fa('0x34')));};exports[_0xf0fa('0x35')]=function(_0x4879ef){return BPromise['resolve']()[_0xf0fa('0xc')](cmHopper[_0xf0fa('0x18')](_0x4879ef,!![],!![]))[_0xf0fa('0xf')](loggerCatch(_0xf0fa('0x36')));};
\ No newline at end of file
diff --git a/server/services/ami/preview/util/util.js b/server/services/ami/preview/util/util.js
index a5e95cc..0f46fec 100644
--- a/server/services/ami/preview/util/util.js
+++ b/server/services/ami/preview/util/util.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x855f=['add','ListId','decrementTalkink','pTalking','[decrementTalkink]\x20is\x20null\x20or\x20undefined','IsNotLoggedIn','buildObj','lastevent','name','queue','interface','buildAcw','not_inuse','reachable','push','createBody','filterKey','type','campaigntype','dialAnswer','active','countglobal','callback','callbackuniqueid','recallme','xmd-voicequeueid','xmd-queue','xmd-phone','xmd-listid','xmd-dialurl','xmd-dialid','xmd-contactid','xmd-cdrtype','xmd-callerid','xmd-agiafter','xmd-agi','rtpaudioqosbridged','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','rtpaudioqos','bridgepeer','bridgepvtcallid','getCallerIdRandom','\x5cw{0,','pow','random','extractCalleridName','match','util','moment','../../../../config/logger','preview','env','XCALLY_IP_AGI','milliseconds','diff','seconds','loggerCatch','inspect','logger','info','loggerError','error','logger2','message','isUndefined','string','isEmpty','format','\x22%s\x22\x20<%s>','isActive','isNil','addVariables','Queue','calleridname','ContactId','VoiceQueueId','dialOriginateTimeout','dialQueueProject2','U(xcally-mixmonitor-context)','dialPreviewUrl','dialQueueProject','\x22agi://%s/square,%s\x22','NONE','originatecalleridnum','originatecalleridname','xcally-motion-preview','monitor_format','_XCALLY_MIXMONITOR_FORMAT','Contact','hasOwnProperty','tags','updatedAt','%s%s','XMD-','toLowerVariables','toLower','originated','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','logBlacklist','YYYY-MM-DD\x20HH:mm:ss','state','statedesc','Blacklist','starttime','endtime','logAgent','responsetime','ringtime','logLookAgent','membername','UserId','logCustomer','talktime','answertime','Failure','RECALL','BOOKED','uniqueid','originate','channelAgent','calleridnum','timeout','totalGlobal','countbusyretry','countnoanswerretry','countagentrejectretry','countnosuchnumberretry','cloneAction','clone','Global','scheduledAt','scheduledat'];(function(_0x4a1514,_0x466bc7){var _0xbefbb2=function(_0x1fd2de){while(--_0x1fd2de){_0x4a1514['push'](_0x4a1514['shift']());}};_0xbefbb2(++_0x466bc7);}(_0x855f,0x145));var _0xf855=function(_0x1b3d68,_0x381dc9){_0x1b3d68=_0x1b3d68-0x0;var _0x33e126=_0x855f[_0x1b3d68];return _0x33e126;};'use strict';var util=require(_0xf855('0x0'));var _=require('lodash');var moment=require(_0xf855('0x1'));var logger=require(_0xf855('0x2'))(_0xf855('0x3'));var ipAgi=process[_0xf855('0x4')][_0xf855('0x5')]||'127.0.0.1';function getSeconds(_0x4620ba,_0x33ad4f){var _0x4887c0=moment(_0x4620ba)['milliseconds'](0x0);var _0x8d6830=moment(_0x33ad4f)[_0xf855('0x6')](0x0);return _0x4887c0[_0xf855('0x7')](_0x8d6830,_0xf855('0x8'));}exports[_0xf855('0x9')]=function(_0x3a9bda){return function(_0x23f738){logger['error'](_0x3a9bda,util[_0xf855('0xa')](_0x23f738,{'showHidden':![],'depth':null}));};};exports[_0xf855('0xb')]=function(_0x24aebb,_0xe34bb5){logger[_0xf855('0xc')](_0x24aebb,util[_0xf855('0xa')](_0xe34bb5,{'showHidden':![],'depth':null}));};exports[_0xf855('0xd')]=function(_0x53d217,_0x482030){logger[_0xf855('0xe')](_0x53d217,util[_0xf855('0xa')](_0x482030,{'showHidden':![],'depth':null}));};exports[_0xf855('0xf')]=function(_0x57eb2f){return function(_0x188ec1){logger[_0xf855('0xc')](_0x57eb2f,util[_0xf855('0xa')](_0x188ec1,{'showHidden':![],'depth':null}));};};exports[_0xf855('0x10')]=function(_0xb39e74,_0x312984,_0x5877b){return{'message':_0xb39e74,'unlock':_0x312984,'active':_0x5877b};};exports['getCallerId']=function(_0x42edd8,_0x2bdcc3,_0x39a0fe){if(!_[_0xf855('0x11')](_0x39a0fe)&&_0xf855('0x12')===typeof _0x39a0fe&&!_[_0xf855('0x13')](_0x39a0fe)){if(!_[_0xf855('0x11')](_0x2bdcc3)&&'string'===typeof _0x2bdcc3&&!_['isEmpty'](_0x2bdcc3)){return util[_0xf855('0x14')](_0xf855('0x15'),_0x2bdcc3,_0x39a0fe);}return util[_0xf855('0x14')]('\x22%s\x22\x20<%s>',_0x39a0fe,_0x39a0fe);}if(!_[_0xf855('0x11')](_0x42edd8)&&_0xf855('0x12')===typeof _0x42edd8&&!_['isEmpty'](_0x42edd8)){return _0x42edd8;}return'\x22\x22\x20<>';};exports[_0xf855('0x16')]=function(_0x43cbd0){if(_[_0xf855('0x17')](_0x43cbd0)){return![];}return _0x43cbd0;};exports[_0xf855('0x18')]=function(_0x81b60a,_0x24e3ad,_0x30f0e3,_0xdefc1c,_0x1995f7,_0x9ab34d){var _0x329687={'XMD-QUEUE':_0x24e3ad[_0xf855('0x19')]?_0x24e3ad[_0xf855('0x19')]['name']:'','XMD-CALLERID':_0xdefc1c,'XMD-CALLERID-PREVIEW':_0x9ab34d?util[_0xf855('0x14')](_0xf855('0x15'),_0x9ab34d[_0xf855('0x1a')],_0x9ab34d['calleridnum']):_0xdefc1c,'XMD-DIALID':_0x1995f7,'XMD-CONTACTID':_0x24e3ad[_0xf855('0x1b')],'XMD-CDRTYPE':'dialer','CALLERID(all)':_0xdefc1c,'XMD-VOICEQUEUEID':_0x24e3ad[_0xf855('0x1c')],'XMD-DIALCHANNEL':_0x30f0e3,'XMD-DIALTIMEOUT':_0x81b60a[_0xf855('0x1d')]||0x1e,'XMD-DIALOPTIONS':util[_0xf855('0x14')]('\x22rtTxX%s%s\x22',_0x81b60a[_0xf855('0x1e')]?'g':'',_[_0xf855('0x13')](_0x81b60a['monitor_format'])?'':_0xf855('0x1f')),'XMD-DIALURL':_0x81b60a[_0xf855('0x20')]||'','XMD-AGI':_0x81b60a[_0xf855('0x21')]?util[_0xf855('0x14')](_0xf855('0x22'),ipAgi,_0x81b60a['dialQueueProject']):'NONE','XMD-AGIAFTER':_0x81b60a[_0xf855('0x1e')]?util[_0xf855('0x14')]('\x22agi://%s/square,%s\x22',ipAgi,_0x81b60a[_0xf855('0x1e')]):_0xf855('0x23'),'XMD-ORIGINATECALLERIDNUM':_0x9ab34d?_0x9ab34d[_0xf855('0x24')]:'','XMD-ORIGINATECALLERIDNAME':_0x9ab34d?_0x9ab34d[_0xf855('0x25')]:'','XMD-DESTINATION':_0xf855('0x26')};if(!_[_0xf855('0x13')](_0x81b60a[_0xf855('0x27')])){_0x329687[util[_0xf855('0x14')]('%s',_0xf855('0x28'))]=_0x81b60a[_0xf855('0x27')];_0x329687[util[_0xf855('0x14')]('%s','_XCALLY_MIXMONITOR_UNIQUEID')]=_0x1995f7;}if(_0x24e3ad&&_0x24e3ad[_0xf855('0x29')]){for(var _0x574033 in _0x24e3ad['Contact']){if(_0x24e3ad['Contact'][_0xf855('0x2a')](_0x574033)){if(!_[_0xf855('0x17')](_0x24e3ad[_0xf855('0x29')][_0x574033])&&_0x574033!=='id'&&_0x574033!==_0xf855('0x2b')&&_0x574033!=='createdAt'&&_0x574033!==_0xf855('0x2c')){_0x329687[util[_0xf855('0x14')](_0xf855('0x2d'),_0xf855('0x2e'),_['toUpper'](_0x574033))]=_0x24e3ad[_0xf855('0x29')][_0x574033];}}}}return _0x329687;};exports[_0xf855('0x2f')]=function(_0x6d9206){var _0xbc9b0b={};for(var _0x529af5 in _0x6d9206){if(_0x6d9206['hasOwnProperty'](_0x529af5)){_0xbc9b0b[util[_0xf855('0x14')]('%s',_[_0xf855('0x30')](_0x529af5))]=_0x6d9206[_0x529af5];}}return{'variables':_0xbc9b0b};};exports['updateOriginated']=function(_0x1f77d5,_0x5ab5d6){if(!_[_0xf855('0x17')](_0x1f77d5)){if(_0x1f77d5[_0xf855('0x2a')](_0xf855('0x31'))){if(_0x1f77d5[_0xf855('0x31')]>0x0){_0x1f77d5[_0xf855('0x31')]-=0x1;}else{logger[_0xf855('0xe')](_0xf855('0x32'),_0x5ab5d6);}}}else{logger[_0xf855('0xe')](_0xf855('0x33'),_0x5ab5d6);}};exports[_0xf855('0x34')]=function(_0x98a68d){var _0x3a6f64=moment()[_0xf855('0x14')](_0xf855('0x35'));_0x98a68d[_0xf855('0x36')]=0xd;_0x98a68d[_0xf855('0x37')]=_0xf855('0x38');_0x98a68d[_0xf855('0x39')]=_0x3a6f64;_0x98a68d['responsetime']=_0x3a6f64;_0x98a68d[_0xf855('0x3a')]=_0x3a6f64;};exports[_0xf855('0x3b')]=function(_0x2f54ae,_0x4eb368,_0xd4916b){var _0xd2edc2=moment()[_0xf855('0x14')]('YYYY-MM-DD\x20HH:mm:ss');_0x2f54ae[_0xf855('0x36')]=_0x4eb368;_0x2f54ae[_0xf855('0x37')]=_0xd4916b;_0x2f54ae[_0xf855('0x3c')]=_0xd2edc2;_0x2f54ae[_0xf855('0x3d')]=getSeconds(_0x2f54ae[_0xf855('0x3c')],_0x2f54ae[_0xf855('0x39')]);};exports[_0xf855('0x3e')]=function(_0x59a0a7,_0x385775,_0x214fec){_0x59a0a7[_0xf855('0x3f')]=_0x385775;_0x59a0a7[_0xf855('0x40')]=_0x214fec;};exports[_0xf855('0x41')]=function(_0x3ab673,_0x24f92b,_0x335949){var _0x243f25=moment()[_0xf855('0x14')]('YYYY-MM-DD\x20HH:mm:ss');_0x3ab673[_0xf855('0x36')]=_0x24f92b;_0x3ab673[_0xf855('0x37')]=_0x335949;_0x3ab673[_0xf855('0x3c')]=_0x3ab673[_0xf855('0x3c')]?_0x3ab673[_0xf855('0x3c')]:_0x243f25;_0x3ab673[_0xf855('0x3a')]=_0x3ab673[_0xf855('0x3a')]?_0x3ab673['endtime']:_0x243f25;_0x3ab673[_0xf855('0x3d')]=getSeconds(_0x3ab673[_0xf855('0x3c')]||0x0,_0x3ab673[_0xf855('0x39')]||0x0);_0x3ab673[_0xf855('0x42')]=_0x3ab673[_0xf855('0x43')]?getSeconds(_0x3ab673['endtime'],_0x3ab673[_0xf855('0x43')]):0x0;};exports['isFailure']=function(_0x4dda78){return _0x4dda78===_0xf855('0x44');};exports['variablesAction']=function(_0xb9091b,_0x54c7a1,_0x425750,_0x4664b2,_0x510228){var _0x2a664a=_0x4664b2?_0xf855('0x45'):_0xb9091b[_0xf855('0x1a')];_0x2a664a=_0x510228?_0xf855('0x46'):_0x2a664a;return{'actionid':_0xb9091b[_0xf855('0x47')],'action':_0xf855('0x48'),'channel':_0xb9091b[_0xf855('0x49')],'callerid':util[_0xf855('0x14')](_0xf855('0x15'),_0x2a664a,_0xb9091b[_0xf855('0x4a')]),'Exten':_0xf855('0x26'),'Context':'from-sip','Priority':'1','variable':_0x425750,'timeout':(_0x54c7a1[_0xf855('0x4b')]||0x1e)*0x3e8,'async':!![],'channelid':_0xb9091b[_0xf855('0x47')]};};exports[_0xf855('0x4c')]=function(_0x30e776){return _0x30e776[_0xf855('0x4d')]+_0x30e776['countcongestionretry']+_0x30e776[_0xf855('0x4e')]+_0x30e776[_0xf855('0x4f')]+_0x30e776[_0xf855('0x50')];};exports[_0xf855('0x51')]=function(_0x31488b){var _0x1228ae=_[_0xf855('0x52')](_0x31488b);_0x1228ae[_0xf855('0x36')]=0xf;_0x1228ae[_0xf855('0x37')]=_0xf855('0x53');return _0x1228ae;};exports[_0xf855('0x54')]=function(_0xecf524,_0x384ae3,_0x698f27){var _0x459b3b={};_0x459b3b[_0x384ae3]=_0xecf524[_0x384ae3];_0x459b3b['active']=![];_0x459b3b[_0xf855('0x55')]=moment()[_0xf855('0x56')](_0x698f27,'minutes')[_0xf855('0x14')]('YYYY-MM-DD\x20HH:mm:ss');_0x459b3b[_0xf855('0x1b')]=_0xecf524['ContactId'];_0x459b3b[_0xf855('0x57')]=_0xecf524[_0xf855('0x57')];_0x459b3b[_0xf855('0x1c')]=_0xecf524['VoiceQueueId']||undefined;return _0x459b3b;};exports[_0xf855('0x58')]=function(_0x5eaf60,_0x542a68){if(!_[_0xf855('0x17')](_0x5eaf60)){if(_0x5eaf60[_0xf855('0x59')]>0x0){_0x5eaf60['pTalking']-=0x1;}else{logger[_0xf855('0xe')](_0x542a68,'[decrementTalkink]\x20object\x20talking\x20is\x20negative');}}else{logger['error'](_0x542a68,_0xf855('0x5a'));}};exports[_0xf855('0x5b')]=function(_0x14b074){if(_0x14b074<=0x0){return!![];}return![];};exports[_0xf855('0x5c')]=function(_0x5433be,_0x142b53){_0x5433be[_0xf855('0x5d')]=_0x142b53;_0x5433be[_0xf855('0x5e')]=_0x5433be[_0xf855('0x5f')];_0x5433be[_0xf855('0x60')]=_0x5433be[_0xf855('0x49')];return _0x5433be;};exports[_0xf855('0x61')]=function(_0x3131f1){var _0x4ba97c={};_0x4ba97c['queue']=_0x3131f1[_0xf855('0x5f')];_0x4ba97c[_0xf855('0x60')]=_0x3131f1[_0xf855('0x49')];_0x4ba97c[_0xf855('0x47')]=_0x3131f1[_0xf855('0x47')];return _0x4ba97c;};exports['agentReadyId']=function(_0x2a09d1){var _0x468eb9=[];for(var _0x5cf401 in _0x2a09d1){if(_0x2a09d1[_0xf855('0x2a')](_0x5cf401)){if(!_[_0xf855('0x17')](_0x2a09d1[_0x5cf401])&&_0x2a09d1[_0x5cf401][_0xf855('0x36')]===_0xf855('0x62')&&_0x2a09d1[_0x5cf401]['status']===_0xf855('0x63')){_0x468eb9[_0xf855('0x64')](_0x2a09d1[_0x5cf401]['id']);}}}return _0x468eb9;};exports['getDiff']=function(_0xb7da8f){var _0x12aad6=moment()[_0xf855('0x6')](0x0);var _0x56036b=moment(_0xb7da8f)[_0xf855('0x6')](0x0);return _0x12aad6[_0xf855('0x7')](_0x56036b,_0xf855('0x8'));};exports[_0xf855('0x65')]=function(_0x4a67b1){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x4a67b1[_0xf855('0x1b')],'ListId':_0x4a67b1[_0xf855('0x57')],'VoiceQueueId':_0x4a67b1[_0xf855('0x1c')]||undefined,'CampaignId':_0x4a67b1['CampaignId']||undefined};};exports[_0xf855('0x66')]=function(_0x46ec2c){if(_0x46ec2c==='uniqueid'||_0x46ec2c==='idContact'||_0x46ec2c==='queue'||_0x46ec2c===_0xf855('0x67')||_0x46ec2c===_0xf855('0x68')||_0x46ec2c===_0xf855('0x69')||_0x46ec2c===_0xf855('0x3f')||_0x46ec2c===_0xf855('0x49')||_0x46ec2c==='calleridname'||_0x46ec2c===_0xf855('0x6a')||_0x46ec2c===_0xf855('0x4a')||_0x46ec2c===_0xf855('0x55')||_0x46ec2c===_0xf855('0x4d')||_0x46ec2c==='countcongestionretry'||_0x46ec2c===_0xf855('0x4e')||_0x46ec2c===_0xf855('0x6b')||_0x46ec2c===_0xf855('0x6c')||_0x46ec2c===_0xf855('0x6d')||_0x46ec2c==='callbackat'||_0x46ec2c===_0xf855('0x6e')||_0x46ec2c===_0xf855('0x1b')||_0x46ec2c===_0xf855('0x57')||_0x46ec2c===_0xf855('0x40')||_0x46ec2c==='VoiceQueueId'||_0x46ec2c==='sipcallid'||_0x46ec2c===_0xf855('0x6f')||_0x46ec2c===_0xf855('0x70')||_0x46ec2c===_0xf855('0x71')||_0x46ec2c===_0xf855('0x72')||_0x46ec2c===_0xf855('0x73')||_0x46ec2c==='xmd-dialtimeout'||_0x46ec2c==='xmd-dialoptions'||_0x46ec2c===_0xf855('0x74')||_0x46ec2c==='xmd-dialchannel'||_0x46ec2c===_0xf855('0x75')||_0x46ec2c===_0xf855('0x76')||_0x46ec2c===_0xf855('0x77')||_0x46ec2c===_0xf855('0x78')||_0x46ec2c===_0xf855('0x79')||_0x46ec2c==='rtpaudioqos'||_0x46ec2c===_0xf855('0x7a')||_0x46ec2c==='rtpaudioqosjitter'||_0x46ec2c===_0xf855('0x7b')||_0x46ec2c===_0xf855('0x7c')||_0x46ec2c===_0xf855('0x7d')||_0x46ec2c===_0xf855('0x7e')||_0x46ec2c===_0xf855('0x7f')||_0x46ec2c===_0xf855('0x80')||_0x46ec2c===_0xf855('0x7a')||_0x46ec2c==='rtpaudioqosjitter'||_0x46ec2c===_0xf855('0x7b')||_0x46ec2c==='rtpaudioqosloss'||_0x46ec2c===_0xf855('0x7d')||_0x46ec2c===_0xf855('0x7e')||_0x46ec2c===_0xf855('0x7f')||_0x46ec2c===_0xf855('0x81')||_0x46ec2c===_0xf855('0x82')||_0x46ec2c===_0xf855('0x36')||_0x46ec2c===_0xf855('0x37')){return![];}return!![];};exports[_0xf855('0x83')]=function(_0x3eb961,_0x5a8b5c){var _0x52b0f0,_0x54d069,_0x46b248;if(_0x5a8b5c<=0x0){_0x5a8b5c=0x1;}_0x52b0f0=new RegExp(_0xf855('0x84')+_0x5a8b5c+'}$');_0x54d069=Math['pow'](0xa,_0x5a8b5c-0x1);_0x46b248=Math[_0xf855('0x85')](0xa,_0x5a8b5c)-0x1;return util[_0xf855('0x14')]('%s',_['replace'](_0x3eb961,_0x52b0f0,_[_0xf855('0x86')](_0x54d069,_0x46b248)));};exports[_0xf855('0x87')]=function(_0x2294fd){var _0x20e273=_0x2294fd[_0xf855('0x88')](/"(.*?)"/);return _0x20e273?_0x20e273[0x1]:_0x2294fd;};exports['extractCalleridNumber']=function(_0x3eb368){var _0x48ccd3=_0x3eb368[_0xf855('0x88')](/<(.*?)>/);return _0x48ccd3?_0x48ccd3[0x1]:_0x3eb368;};
\ No newline at end of file
+var _0x4bd3=['addVariables','Queue','name','dialer','dialOriginateTimeout','\x22rtTxX%s%s\x22','monitor_format','U(xcally-mixmonitor-context)','dialPreviewUrl','\x22agi://%s/square,%s\x22','dialQueueProject','NONE','originatecalleridnum','originatecalleridname','xcally-motion-preview','Contact','tags','createdAt','updatedAt','%s%s','XMD-','toUpper','toLowerVariables','toLower','updateOriginated','originated','[updateOriginated]\x20object\x20originated\x20is\x20negative','logBlacklist','YYYY-MM-DD\x20HH:mm:ss','state','responsetime','endtime','statedesc','starttime','membername','UserId','ringtime','talktime','answertime','Failure','variablesAction','RECALL','BOOKED','channelAgent','calleridnum','from-sip','timeout','countcongestionretry','countnoanswerretry','countagentrejectretry','clone','scheduledAt','scheduledat','add','minutes','ContactId','ListId','VoiceQueueId','pTalking','buildObj','queue','buildAcw','uniqueid','agentReadyId','hasOwnProperty','not_inuse','status','reachable','push','getDiff','CampaignId','filterKey','idContact','type','campaigntype','dialAnswer','calleridname','active','countglobal','callback','callbackuniqueid','callbackat','sipcallid','xmd-queue','xmd-phone','xmd-listid','xmd-dialtimeout','xmd-dialoptions','xmd-dialid','xmd-dialchannel','xmd-contactid','xmd-cdrtype','xmd-callerid','xmd-agiafter','rtpaudioqosbridged','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqos','rtpaudioqosjitter','rtpaudioqosrtt','rtpaudioqosrttbridged','bridgepeer','bridgepvtcallid','getCallerIdRandom','\x5cw{0,','pow','extractCalleridName','extractCalleridNumber','match','util','moment','../../../../config/logger','127.0.0.1','milliseconds','diff','seconds','error','inspect','logger','info','loggerError','message','getCallerId','isEmpty','isUndefined','string','format','\x22%s\x22\x20<%s>','isActive','isNil'];(function(_0x3987dc,_0x170b21){var _0x2a15bb=function(_0x44dcbd){while(--_0x44dcbd){_0x3987dc['push'](_0x3987dc['shift']());}};_0x2a15bb(++_0x170b21);}(_0x4bd3,0x174));var _0x34bd=function(_0x5bdf4f,_0x2c260d){_0x5bdf4f=_0x5bdf4f-0x0;var _0x474581=_0x4bd3[_0x5bdf4f];return _0x474581;};'use strict';var util=require(_0x34bd('0x0'));var _=require('lodash');var moment=require(_0x34bd('0x1'));var logger=require(_0x34bd('0x2'))('preview');var ipAgi=process['env']['XCALLY_IP_AGI']||_0x34bd('0x3');function getSeconds(_0x44854a,_0x1fc8eb){var _0x5846f3=moment(_0x44854a)[_0x34bd('0x4')](0x0);var _0x2a15a2=moment(_0x1fc8eb)['milliseconds'](0x0);return _0x5846f3[_0x34bd('0x5')](_0x2a15a2,_0x34bd('0x6'));}exports['loggerCatch']=function(_0xd600e1){return function(_0x76de8d){logger[_0x34bd('0x7')](_0xd600e1,util[_0x34bd('0x8')](_0x76de8d,{'showHidden':![],'depth':null}));};};exports[_0x34bd('0x9')]=function(_0x36a463,_0x4db0ba){logger[_0x34bd('0xa')](_0x36a463,util[_0x34bd('0x8')](_0x4db0ba,{'showHidden':![],'depth':null}));};exports[_0x34bd('0xb')]=function(_0x7c7992,_0x501b7f){logger['error'](_0x7c7992,util[_0x34bd('0x8')](_0x501b7f,{'showHidden':![],'depth':null}));};exports['logger2']=function(_0x4ac0dc){return function(_0x275d80){logger[_0x34bd('0xa')](_0x4ac0dc,util[_0x34bd('0x8')](_0x275d80,{'showHidden':![],'depth':null}));};};exports[_0x34bd('0xc')]=function(_0x2ee180,_0x14cd37,_0x4134ee){return{'message':_0x2ee180,'unlock':_0x14cd37,'active':_0x4134ee};};exports[_0x34bd('0xd')]=function(_0xf6d2f2,_0x59ed5d,_0x3fa6a8){if(!_['isUndefined'](_0x3fa6a8)&&'string'===typeof _0x3fa6a8&&!_[_0x34bd('0xe')](_0x3fa6a8)){if(!_[_0x34bd('0xf')](_0x59ed5d)&&_0x34bd('0x10')===typeof _0x59ed5d&&!_[_0x34bd('0xe')](_0x59ed5d)){return util[_0x34bd('0x11')](_0x34bd('0x12'),_0x59ed5d,_0x3fa6a8);}return util[_0x34bd('0x11')](_0x34bd('0x12'),_0x3fa6a8,_0x3fa6a8);}if(!_[_0x34bd('0xf')](_0xf6d2f2)&&_0x34bd('0x10')===typeof _0xf6d2f2&&!_[_0x34bd('0xe')](_0xf6d2f2)){return _0xf6d2f2;}return'\x22\x22\x20<>';};exports[_0x34bd('0x13')]=function(_0x324f7d){if(_[_0x34bd('0x14')](_0x324f7d)){return![];}return _0x324f7d;};exports[_0x34bd('0x15')]=function(_0x3976e4,_0x23a94a,_0x288638,_0x3d5f76,_0x130bd0,_0x55538e){var _0x15c0d1={'XMD-QUEUE':_0x23a94a[_0x34bd('0x16')]?_0x23a94a[_0x34bd('0x16')][_0x34bd('0x17')]:'','XMD-CALLERID':_0x3d5f76,'XMD-CALLERID-PREVIEW':_0x55538e?util[_0x34bd('0x11')]('\x22%s\x22\x20<%s>',_0x55538e['calleridname'],_0x55538e['calleridnum']):_0x3d5f76,'XMD-DIALID':_0x130bd0,'XMD-CONTACTID':_0x23a94a['ContactId'],'XMD-CDRTYPE':_0x34bd('0x18'),'CALLERID(all)':_0x3d5f76,'XMD-VOICEQUEUEID':_0x23a94a['VoiceQueueId'],'XMD-DIALCHANNEL':_0x288638,'XMD-DIALTIMEOUT':_0x3976e4[_0x34bd('0x19')]||0x1e,'XMD-DIALOPTIONS':util[_0x34bd('0x11')](_0x34bd('0x1a'),_0x3976e4['dialQueueProject2']?'g':'',_[_0x34bd('0xe')](_0x3976e4[_0x34bd('0x1b')])?'':_0x34bd('0x1c')),'XMD-DIALURL':_0x3976e4[_0x34bd('0x1d')]||'','XMD-AGI':_0x3976e4['dialQueueProject']?util[_0x34bd('0x11')](_0x34bd('0x1e'),ipAgi,_0x3976e4[_0x34bd('0x1f')]):_0x34bd('0x20'),'XMD-AGIAFTER':_0x3976e4['dialQueueProject2']?util[_0x34bd('0x11')](_0x34bd('0x1e'),ipAgi,_0x3976e4['dialQueueProject2']):_0x34bd('0x20'),'XMD-ORIGINATECALLERIDNUM':_0x55538e?_0x55538e[_0x34bd('0x21')]:'','XMD-ORIGINATECALLERIDNAME':_0x55538e?_0x55538e[_0x34bd('0x22')]:'','XMD-DESTINATION':_0x34bd('0x23')};if(!_[_0x34bd('0xe')](_0x3976e4[_0x34bd('0x1b')])){_0x15c0d1[util[_0x34bd('0x11')]('%s','_XCALLY_MIXMONITOR_FORMAT')]=_0x3976e4[_0x34bd('0x1b')];_0x15c0d1[util[_0x34bd('0x11')]('%s','_XCALLY_MIXMONITOR_UNIQUEID')]=_0x130bd0;}if(_0x23a94a&&_0x23a94a['Contact']){for(var _0x38bdba in _0x23a94a[_0x34bd('0x24')]){if(_0x23a94a[_0x34bd('0x24')]['hasOwnProperty'](_0x38bdba)){if(!_['isNil'](_0x23a94a[_0x34bd('0x24')][_0x38bdba])&&_0x38bdba!=='id'&&_0x38bdba!==_0x34bd('0x25')&&_0x38bdba!==_0x34bd('0x26')&&_0x38bdba!==_0x34bd('0x27')){_0x15c0d1[util['format'](_0x34bd('0x28'),_0x34bd('0x29'),_[_0x34bd('0x2a')](_0x38bdba))]=_0x23a94a[_0x34bd('0x24')][_0x38bdba];}}}}return _0x15c0d1;};exports[_0x34bd('0x2b')]=function(_0x375cc7){var _0x4ae886={};for(var _0x72bb10 in _0x375cc7){if(_0x375cc7['hasOwnProperty'](_0x72bb10)){_0x4ae886[util[_0x34bd('0x11')]('%s',_[_0x34bd('0x2c')](_0x72bb10))]=_0x375cc7[_0x72bb10];}}return{'variables':_0x4ae886};};exports[_0x34bd('0x2d')]=function(_0x4e9e70,_0x2ff72e){if(!_[_0x34bd('0x14')](_0x4e9e70)){if(_0x4e9e70['hasOwnProperty'](_0x34bd('0x2e'))){if(_0x4e9e70[_0x34bd('0x2e')]>0x0){_0x4e9e70[_0x34bd('0x2e')]-=0x1;}else{logger['error'](_0x34bd('0x2f'),_0x2ff72e);}}}else{logger[_0x34bd('0x7')]('[updateOriginated]\x20is\x20null\x20or\x20undefined',_0x2ff72e);}};exports[_0x34bd('0x30')]=function(_0x41c377){var _0x2bcbf9=moment()[_0x34bd('0x11')](_0x34bd('0x31'));_0x41c377[_0x34bd('0x32')]=0xd;_0x41c377['statedesc']='Blacklist';_0x41c377['starttime']=_0x2bcbf9;_0x41c377[_0x34bd('0x33')]=_0x2bcbf9;_0x41c377[_0x34bd('0x34')]=_0x2bcbf9;};exports['logAgent']=function(_0x5b5f86,_0x13d2f0,_0x4f5c8f){var _0x597a82=moment()[_0x34bd('0x11')](_0x34bd('0x31'));_0x5b5f86[_0x34bd('0x32')]=_0x13d2f0;_0x5b5f86[_0x34bd('0x35')]=_0x4f5c8f;_0x5b5f86[_0x34bd('0x33')]=_0x597a82;_0x5b5f86['ringtime']=getSeconds(_0x5b5f86['responsetime'],_0x5b5f86[_0x34bd('0x36')]);};exports['logLookAgent']=function(_0xce6bc6,_0x2c9b7a,_0x3fc418){_0xce6bc6[_0x34bd('0x37')]=_0x2c9b7a;_0xce6bc6[_0x34bd('0x38')]=_0x3fc418;};exports['logCustomer']=function(_0x282297,_0xc1f4c4,_0x16858c){var _0x1b86e1=moment()['format'](_0x34bd('0x31'));_0x282297['state']=_0xc1f4c4;_0x282297[_0x34bd('0x35')]=_0x16858c;_0x282297[_0x34bd('0x33')]=_0x282297['responsetime']?_0x282297[_0x34bd('0x33')]:_0x1b86e1;_0x282297['endtime']=_0x282297[_0x34bd('0x34')]?_0x282297[_0x34bd('0x34')]:_0x1b86e1;_0x282297[_0x34bd('0x39')]=getSeconds(_0x282297[_0x34bd('0x33')]||0x0,_0x282297[_0x34bd('0x36')]||0x0);_0x282297[_0x34bd('0x3a')]=_0x282297[_0x34bd('0x3b')]?getSeconds(_0x282297['endtime'],_0x282297['answertime']):0x0;};exports['isFailure']=function(_0xede936){return _0xede936===_0x34bd('0x3c');};exports[_0x34bd('0x3d')]=function(_0x787f74,_0x514fb3,_0x412fa5,_0x148abe,_0x1c652a){var _0x72a37=_0x148abe?_0x34bd('0x3e'):_0x787f74['calleridname'];_0x72a37=_0x1c652a?_0x34bd('0x3f'):_0x72a37;return{'actionid':_0x787f74['uniqueid'],'action':'originate','channel':_0x787f74[_0x34bd('0x40')],'callerid':util['format'](_0x34bd('0x12'),_0x72a37,_0x787f74[_0x34bd('0x41')]),'Exten':_0x34bd('0x23'),'Context':_0x34bd('0x42'),'Priority':'1','variable':_0x412fa5,'timeout':(_0x514fb3[_0x34bd('0x43')]||0x1e)*0x3e8,'async':!![],'channelid':_0x787f74['uniqueid']};};exports['totalGlobal']=function(_0x33e8e8){return _0x33e8e8['countbusyretry']+_0x33e8e8[_0x34bd('0x44')]+_0x33e8e8[_0x34bd('0x45')]+_0x33e8e8[_0x34bd('0x46')]+_0x33e8e8['countnosuchnumberretry'];};exports['cloneAction']=function(_0x4f96dd){var _0x5a68f3=_[_0x34bd('0x47')](_0x4f96dd);_0x5a68f3['state']=0xf;_0x5a68f3[_0x34bd('0x35')]='Global';return _0x5a68f3;};exports[_0x34bd('0x48')]=function(_0x1d01d7,_0x1fa341,_0x4dc5c0){var _0x2da5c5={};_0x2da5c5[_0x1fa341]=_0x1d01d7[_0x1fa341];_0x2da5c5['active']=![];_0x2da5c5[_0x34bd('0x49')]=moment()[_0x34bd('0x4a')](_0x4dc5c0,_0x34bd('0x4b'))[_0x34bd('0x11')](_0x34bd('0x31'));_0x2da5c5['ContactId']=_0x1d01d7[_0x34bd('0x4c')];_0x2da5c5[_0x34bd('0x4d')]=_0x1d01d7['ListId'];_0x2da5c5[_0x34bd('0x4e')]=_0x1d01d7[_0x34bd('0x4e')]||undefined;return _0x2da5c5;};exports['decrementTalkink']=function(_0x561d77,_0x37ac16){if(!_['isNil'](_0x561d77)){if(_0x561d77['pTalking']>0x0){_0x561d77[_0x34bd('0x4f')]-=0x1;}else{logger[_0x34bd('0x7')](_0x37ac16,'[decrementTalkink]\x20object\x20talking\x20is\x20negative');}}else{logger['error'](_0x37ac16,'[decrementTalkink]\x20is\x20null\x20or\x20undefined');}};exports['IsNotLoggedIn']=function(_0x1cbf91){if(_0x1cbf91<=0x0){return!![];}return![];};exports[_0x34bd('0x50')]=function(_0x482a0b,_0x4a8291){_0x482a0b['lastevent']=_0x4a8291;_0x482a0b[_0x34bd('0x17')]=_0x482a0b[_0x34bd('0x51')];_0x482a0b['interface']=_0x482a0b[_0x34bd('0x40')];return _0x482a0b;};exports[_0x34bd('0x52')]=function(_0x3f714b){var _0x2c4064={};_0x2c4064[_0x34bd('0x51')]=_0x3f714b[_0x34bd('0x51')];_0x2c4064['interface']=_0x3f714b[_0x34bd('0x40')];_0x2c4064[_0x34bd('0x53')]=_0x3f714b[_0x34bd('0x53')];return _0x2c4064;};exports[_0x34bd('0x54')]=function(_0x589ef1){var _0x1b8b37=[];for(var _0x5235e4 in _0x589ef1){if(_0x589ef1[_0x34bd('0x55')](_0x5235e4)){if(!_['isNil'](_0x589ef1[_0x5235e4])&&_0x589ef1[_0x5235e4][_0x34bd('0x32')]===_0x34bd('0x56')&&_0x589ef1[_0x5235e4][_0x34bd('0x57')]===_0x34bd('0x58')){_0x1b8b37[_0x34bd('0x59')](_0x589ef1[_0x5235e4]['id']);}}}return _0x1b8b37;};exports[_0x34bd('0x5a')]=function(_0x6db4ba){var _0x28394c=moment()[_0x34bd('0x4')](0x0);var _0x3b1dd5=moment(_0x6db4ba)[_0x34bd('0x4')](0x0);return _0x28394c['diff'](_0x3b1dd5,_0x34bd('0x6'));};exports['createBody']=function(_0x15fea7){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x15fea7['ContactId'],'ListId':_0x15fea7[_0x34bd('0x4d')],'VoiceQueueId':_0x15fea7['VoiceQueueId']||undefined,'CampaignId':_0x15fea7[_0x34bd('0x5b')]||undefined};};exports[_0x34bd('0x5c')]=function(_0x2da924){if(_0x2da924===_0x34bd('0x53')||_0x2da924===_0x34bd('0x5d')||_0x2da924===_0x34bd('0x51')||_0x2da924===_0x34bd('0x5e')||_0x2da924===_0x34bd('0x5f')||_0x2da924===_0x34bd('0x60')||_0x2da924===_0x34bd('0x37')||_0x2da924===_0x34bd('0x40')||_0x2da924===_0x34bd('0x61')||_0x2da924===_0x34bd('0x62')||_0x2da924===_0x34bd('0x41')||_0x2da924===_0x34bd('0x49')||_0x2da924==='countbusyretry'||_0x2da924==='countcongestionretry'||_0x2da924===_0x34bd('0x45')||_0x2da924===_0x34bd('0x63')||_0x2da924===_0x34bd('0x64')||_0x2da924===_0x34bd('0x65')||_0x2da924===_0x34bd('0x66')||_0x2da924==='recallme'||_0x2da924==='ContactId'||_0x2da924==='ListId'||_0x2da924==='UserId'||_0x2da924===_0x34bd('0x4e')||_0x2da924===_0x34bd('0x67')||_0x2da924==='xmd-voicequeueid'||_0x2da924===_0x34bd('0x68')||_0x2da924===_0x34bd('0x69')||_0x2da924===_0x34bd('0x6a')||_0x2da924==='xmd-dialurl'||_0x2da924===_0x34bd('0x6b')||_0x2da924===_0x34bd('0x6c')||_0x2da924===_0x34bd('0x6d')||_0x2da924===_0x34bd('0x6e')||_0x2da924===_0x34bd('0x6f')||_0x2da924===_0x34bd('0x70')||_0x2da924===_0x34bd('0x71')||_0x2da924===_0x34bd('0x72')||_0x2da924==='xmd-agi'||_0x2da924==='rtpaudioqos'||_0x2da924===_0x34bd('0x73')||_0x2da924==='rtpaudioqosjitter'||_0x2da924===_0x34bd('0x74')||_0x2da924===_0x34bd('0x75')||_0x2da924===_0x34bd('0x76')||_0x2da924==='rtpaudioqosrtt'||_0x2da924==='rtpaudioqosrttbridged'||_0x2da924===_0x34bd('0x77')||_0x2da924===_0x34bd('0x73')||_0x2da924===_0x34bd('0x78')||_0x2da924==='rtpaudioqosjitterbridged'||_0x2da924==='rtpaudioqosloss'||_0x2da924===_0x34bd('0x76')||_0x2da924===_0x34bd('0x79')||_0x2da924===_0x34bd('0x7a')||_0x2da924===_0x34bd('0x7b')||_0x2da924===_0x34bd('0x7c')||_0x2da924===_0x34bd('0x32')||_0x2da924===_0x34bd('0x35')){return![];}return!![];};exports[_0x34bd('0x7d')]=function(_0x31bedd,_0x4f397f){var _0x4d3118,_0x3878a0,_0x4fab21;if(_0x4f397f<=0x0){_0x4f397f=0x1;}_0x4d3118=new RegExp(_0x34bd('0x7e')+_0x4f397f+'}$');_0x3878a0=Math[_0x34bd('0x7f')](0xa,_0x4f397f-0x1);_0x4fab21=Math[_0x34bd('0x7f')](0xa,_0x4f397f)-0x1;return util[_0x34bd('0x11')]('%s',_['replace'](_0x31bedd,_0x4d3118,_['random'](_0x3878a0,_0x4fab21)));};exports[_0x34bd('0x80')]=function(_0x2273af){var _0x38e91=_0x2273af['match'](/"(.*?)"/);return _0x38e91?_0x38e91[0x1]:_0x2273af;};exports[_0x34bd('0x81')]=function(_0x4832d5){var _0x3ec753=_0x4832d5[_0x34bd('0x82')](/<(.*?)>/);return _0x3ec753?_0x3ec753[0x1]:_0x4832d5;};
\ No newline at end of file
diff --git a/server/services/ami/properties.js b/server/services/ami/properties.js
index ff49c1d..5fad734 100644
--- a/server/services/ami/properties.js
+++ b/server/services/ami/properties.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7a54=['number','boolean','queuepause','reload','voicequeuechannel','voicequeuechannelhangup','queueadd','string'];(function(_0x39e15c,_0x16361b){var _0x2a5879=function(_0x3436f2){while(--_0x3436f2){_0x39e15c['push'](_0x39e15c['shift']());}};_0x2a5879(++_0x16361b);}(_0x7a54,0x106));var _0x47a5=function(_0x56917e,_0x252166){_0x56917e=_0x56917e-0x0;var _0x2a3438=_0x7a54[_0x56917e];return _0x2a3438;};'use strict';exports[_0x47a5('0x0')]={'queue':{'type':_0x47a5('0x1'),'required':!![]},'interface':{'type':_0x47a5('0x1'),'required':!![]},'membername':{'type':'string','required':!![]},'penalty':{'type':_0x47a5('0x2'),'required':![]},'paused':{'type':_0x47a5('0x3'),'required':![]}};exports['queueremove']={'queue':{'type':_0x47a5('0x1'),'required':!![]},'interface':{'type':_0x47a5('0x1'),'required':!![]}};exports[_0x47a5('0x4')]={'interface':{'type':_0x47a5('0x1'),'required':!![]},'paused':{'type':_0x47a5('0x3')},'reason':{'type':'string','required':![]}};exports[_0x47a5('0x5')]={'module':{'type':'string','required':![]}};exports[_0x47a5('0x6')]={'uniqueid':{'type':_0x47a5('0x1'),'required':!![]}};exports['voicechannel']={'uniqueid':{'type':_0x47a5('0x1'),'required':!![]},'filename':{'type':'string'},'format':{'type':'string'},'mixmonitorid':{'type':'string'}};exports[_0x47a5('0x7')]={'uniqueid':{'type':_0x47a5('0x1'),'required':!![]}};exports['voicequeuechannelredirect']={'uniqueid':{'type':_0x47a5('0x1'),'required':!![]},'exten':{'type':'string','required':!![]},'context':{'type':'string'}};
\ No newline at end of file
+var _0x7a54=['number','boolean','queuepause','reload','voicequeuechannel','voicequeuechannelhangup','queueadd','string'];(function(_0x3be3af,_0x383cb8){var _0x461444=function(_0xf5d882){while(--_0xf5d882){_0x3be3af['push'](_0x3be3af['shift']());}};_0x461444(++_0x383cb8);}(_0x7a54,0x106));var _0x47a5=function(_0xaa4cd4,_0xdc824a){_0xaa4cd4=_0xaa4cd4-0x0;var _0x3cc524=_0x7a54[_0xaa4cd4];return _0x3cc524;};'use strict';exports[_0x47a5('0x0')]={'queue':{'type':_0x47a5('0x1'),'required':!![]},'interface':{'type':_0x47a5('0x1'),'required':!![]},'membername':{'type':'string','required':!![]},'penalty':{'type':_0x47a5('0x2'),'required':![]},'paused':{'type':_0x47a5('0x3'),'required':![]}};exports['queueremove']={'queue':{'type':_0x47a5('0x1'),'required':!![]},'interface':{'type':_0x47a5('0x1'),'required':!![]}};exports[_0x47a5('0x4')]={'interface':{'type':_0x47a5('0x1'),'required':!![]},'paused':{'type':_0x47a5('0x3')},'reason':{'type':'string','required':![]}};exports[_0x47a5('0x5')]={'module':{'type':'string','required':![]}};exports[_0x47a5('0x6')]={'uniqueid':{'type':_0x47a5('0x1'),'required':!![]}};exports['voicechannel']={'uniqueid':{'type':_0x47a5('0x1'),'required':!![]},'filename':{'type':'string'},'format':{'type':'string'},'mixmonitorid':{'type':'string'}};exports[_0x47a5('0x7')]={'uniqueid':{'type':_0x47a5('0x1'),'required':!![]}};exports['voicequeuechannelredirect']={'uniqueid':{'type':_0x47a5('0x1'),'required':!![]},'exten':{'type':'string','required':!![]},'context':{'type':'string'}};
\ No newline at end of file
diff --git a/server/services/ami/realtime/index.js b/server/services/ami/realtime/index.js
index 9fbdb94..bda98b8 100644
--- a/server/services/ami/realtime/index.js
+++ b/server/services/ami/realtime/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xdbad=['templates','outbound','channels','queueChannels','timers','zendeskAccounts','sugarcrmAccounts','zohoAccounts','deskAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','faxAccounts','mapKeys','hasOwnProperty','format','isNil','interface','SIP/%s','name','total','sumHoldTime','sumDuration','sumBillable','isEmpty','ivrTotalCallsDays','ivrAnswerCallsDay','answered','unmanaged','abandoned','outboundAnswerAgiCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundDropCallsDayTimeout','outboundDropCallsDayCallersExit','outboundBlacklistCallsDay','outboundReCallsDay','outboundAnswerCallsDay','prototype','mergeFromDatabase','agents','length','isUndefined','initTelephones','initTrunks','initVoiceQueues','initTriggers','initTemplates','initZendeskAccounts','initSalesforceAccounts','salesforceAccounts','initFreshdeskAccounts','freshdeskAccounts','initZohoAccounts','initDeskAccounts','initSugarcrmAccounts','initVtigerAccounts','initDynamics365Accounts','initFreshsalesAccounts','freshsalesAccounts','initVoiceQueueHopperHistory','merge','initVoiceQueueReports','queue','queuecallerexit','queuecallerabandon','diff','queuecallerjoinAt','seconds','queuecallercompleteAt','queuecallerabandonAt','queuecallercomplete','initVoiceCallReports','duration','ANSWERED','billableseconds','initCampaigns','dialQueueProject','SquareProject','initVoiceExtensions','voiceExtensions','initCampaignHopperHistory','initFaxAccounts','exports','bluebird','../model/telephone','../model/trunk','../model/voiceQueue','../model/trigger','../model/template','../model/campaign','../model/voiceExtension','../model/zendeskAccount','../model/freshdeskAccount','../model/sugarcrmAccount','../model/servicenowAccount','../model/dynamics365Account','../model/freshsalesAccount','telephones','trunks','voiceQueues','triggers','campaigns'];(function(_0x5bd426,_0x4878e5){var _0x23a7eb=function(_0x594b42){while(--_0x594b42){_0x5bd426['push'](_0x5bd426['shift']());}};_0x23a7eb(++_0x4878e5);}(_0xdbad,0x18d));var _0xddba=function(_0x44cecc,_0xa22ba7){_0x44cecc=_0x44cecc-0x0;var _0x1b3e71=_0xdbad[_0x44cecc];return _0x1b3e71;};'use strict';var BPromise=require(_0xddba('0x0'));var util=require('util');var _=require('lodash');var moment=require('moment');var Agent=require('../model/agent');var Telephone=require(_0xddba('0x1'));var Trunk=require(_0xddba('0x2'));var VoiceQueue=require(_0xddba('0x3'));var Trigger=require(_0xddba('0x4'));var Template=require(_0xddba('0x5'));var Campaign=require(_0xddba('0x6'));var VoiceExtension=require(_0xddba('0x7'));var ZendeskAccount=require(_0xddba('0x8'));var SalesforceAccount=require('../model/salesforceAccount');var FreshdeskAccount=require(_0xddba('0x9'));var SugarcrmAccount=require(_0xddba('0xa'));var ZohoAccount=require('../model/zohoAccount');var DeskAccount=require('../model/deskAccount');var VtigerAccount=require('../model/vtigerAccount');var ServicenowAccount=require(_0xddba('0xb'));var Dynamics365Account=require(_0xddba('0xc'));var FreshsalesAccount=require(_0xddba('0xd'));var FaxAccount=require('../model/faxAccount');var Realtime=function(){this['agents']={};this[_0xddba('0xe')]={};this[_0xddba('0xf')]={};this[_0xddba('0x10')]={};this[_0xddba('0x11')]={};this[_0xddba('0x12')]={};this[_0xddba('0x13')]={};this[_0xddba('0x14')]={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this['voiceExtensions']={};this[_0xddba('0x15')]={};this[_0xddba('0x16')]={};this['outboundChannels']={};this[_0xddba('0x17')]={};this[_0xddba('0x18')]={};this['salesforceAccounts']={};this[_0xddba('0x19')]={};this['freshdeskAccounts']={};this[_0xddba('0x1a')]={};this[_0xddba('0x1b')]={};this[_0xddba('0x1c')]={};this[_0xddba('0x1d')]={};this[_0xddba('0x1e')]={};this['freshsalesAccounts']={};this[_0xddba('0x1f')]={};};function freeIsNotKey(_0x2b2a36,_0x136534,_0x24322d){var _0x5d0151=_[_0xddba('0x20')](_0x2b2a36,function(_0x27cfa1,_0x569841){return _0x27cfa1[_0x24322d];});for(var _0x31d482 in _0x136534){if(_0x136534[_0xddba('0x21')](_0x31d482)){if(!_0x5d0151[_0x31d482]){delete _0x136534[_0x31d482];}}}}function freeIsNotKeySip(_0x5e2007,_0x49c9d4){var _0xde4e1b=_[_0xddba('0x20')](_0x5e2007,function(_0x3854ee,_0x27302a){return util[_0xddba('0x22')]('SIP/%s',_0x3854ee['name']);});for(var _0x35e2cf in _0x49c9d4){if(_0x49c9d4['hasOwnProperty'](_0x35e2cf)){if(!_0xde4e1b[_0x35e2cf]){delete _0x49c9d4[_0x35e2cf];}}}}function freeIsNotKeyAgent(_0x5d4428,_0x243807){var _0x76e1eb=_['mapKeys'](_0x5d4428,function(_0x2f1397,_0x5d43ce){var _0x26c3e2=_[_0xddba('0x23')](_0x2f1397[_0xddba('0x24')])?util[_0xddba('0x22')](_0xddba('0x25'),_0x2f1397[_0xddba('0x26')]):_0x2f1397[_0xddba('0x24')];return _0x26c3e2;});for(var _0x5eaa72 in _0x243807){if(_0x243807[_0xddba('0x21')](_0x5eaa72)){if(!_0x76e1eb[_0x5eaa72]){delete _0x243807[_0x5eaa72];}}}}function clearVoiceCallReports(_0x5c0b83){_0x5c0b83[_0xddba('0x27')]=0x0;_0x5c0b83['answered']=0x0;_0x5c0b83[_0xddba('0x28')]=0x0;_0x5c0b83[_0xddba('0x29')]=0x0;_0x5c0b83[_0xddba('0x2a')]=0x0;}function clearCampaigns(_0x5031ca){if(!_[_0xddba('0x2b')](_0x5031ca)){for(var _0x498aac in _0x5031ca){if(_0x5031ca[_0xddba('0x21')](_0x498aac)){_0x5031ca[_0x498aac][_0xddba('0x2c')]=0x0;_0x5031ca[_0x498aac][_0xddba('0x2d')]=0x0;}}}}function clearVoiceQueues(_0x309e56){if(!_[_0xddba('0x2b')](_0x309e56)){for(var _0x1578fc in _0x309e56){if(_0x309e56[_0xddba('0x21')](_0x1578fc)){_0x309e56[_0x1578fc]['total']=0x0;_0x309e56[_0x1578fc][_0xddba('0x2e')]=0x0;_0x309e56[_0x1578fc][_0xddba('0x2f')]=0x0;_0x309e56[_0x1578fc][_0xddba('0x30')]=0x0;_0x309e56[_0x1578fc][_0xddba('0x28')]=0x0;_0x309e56[_0x1578fc][_0xddba('0x29')]=0x0;_0x309e56[_0x1578fc][_0xddba('0x2a')]=0x0;_0x309e56[_0x1578fc][_0xddba('0x31')]=0x0;_0x309e56[_0x1578fc]['outboundNoAnswerCallsDay']=0x0;_0x309e56[_0x1578fc][_0xddba('0x32')]=0x0;_0x309e56[_0x1578fc][_0xddba('0x33')]=0x0;_0x309e56[_0x1578fc][_0xddba('0x34')]=0x0;_0x309e56[_0x1578fc]['outboundUnknownCallsDay']=0x0;_0x309e56[_0x1578fc][_0xddba('0x35')]=0x0;_0x309e56[_0x1578fc][_0xddba('0x36')]=0x0;_0x309e56[_0x1578fc][_0xddba('0x37')]=0x0;_0x309e56[_0x1578fc]['outboundOriginateFailureCallsDay']=0x0;_0x309e56[_0x1578fc]['outboundRejectCallsDay']=0x0;_0x309e56[_0x1578fc][_0xddba('0x38')]=0x0;_0x309e56[_0x1578fc][_0xddba('0x31')]=0x0;_0x309e56[_0x1578fc][_0xddba('0x39')]=0x0;_0x309e56[_0x1578fc]['queueStatusComplete']=!![];}}}}Realtime[_0xddba('0x3a')][_0xddba('0x3b')]=function(_0x82f555,_0x49b27e){for(var _0x29b512 in _0x49b27e){if(_0x82f555[_0xddba('0x21')](_0x29b512)){_0x82f555[_0x29b512]=_0x49b27e[_0x29b512];}}};Realtime[_0xddba('0x3a')]['initAgents']=function(){var _0x4efbc8=this;return function(_0x34e20c){if(_0x34e20c){freeIsNotKeyAgent(_0x34e20c,_0x4efbc8[_0xddba('0x3c')]);for(var _0x5ef804=0x0,_0x51d2e={},_0x3064de={};_0x5ef804<_0x34e20c[_0xddba('0x3d')];_0x5ef804+=0x1){_0x51d2e=_0x34e20c[_0x5ef804];var _0x3ecc3=_[_0xddba('0x23')](_0x51d2e[_0xddba('0x24')])?util[_0xddba('0x22')](_0xddba('0x25'),_0x51d2e[_0xddba('0x26')]):_0x51d2e[_0xddba('0x24')];if(_[_0xddba('0x3e')](_0x4efbc8[_0xddba('0x3c')][_0x3ecc3])){_0x4efbc8[_0xddba('0x3c')][_0x3ecc3]=new Agent(_0x51d2e);}else{_0x4efbc8['mergeFromDatabase'](_0x4efbc8[_0xddba('0x3c')][_0x3ecc3],_0x51d2e);}}}return _0x4efbc8[_0xddba('0x3c')];};};Realtime[_0xddba('0x3a')][_0xddba('0x3f')]=function(){var _0xd40616=this;return function(_0x14d3f2){if(_0x14d3f2){freeIsNotKeySip(_0x14d3f2,_0xd40616['telephones']);for(var _0x4e71e5=0x0,_0x26ad09={},_0x438f18={};_0x4e71e5<_0x14d3f2['length'];_0x4e71e5+=0x1){_0x26ad09=_0x14d3f2[_0x4e71e5];if(_[_0xddba('0x3e')](_0xd40616['telephones'][util[_0xddba('0x22')](_0xddba('0x25'),_0x26ad09['name'])])){_0xd40616[_0xddba('0xe')][util[_0xddba('0x22')]('SIP/%s',_0x26ad09[_0xddba('0x26')])]=new Telephone(_0x26ad09);}else{_0xd40616[_0xddba('0x3b')](_0xd40616['telephones'][util['format'](_0xddba('0x25'),_0x26ad09['name'])],_0x26ad09);}}}return _0xd40616[_0xddba('0xe')];};};Realtime['prototype'][_0xddba('0x40')]=function(){var _0x324f0a=this;return function(_0x20b4c2){if(_0x20b4c2){freeIsNotKeySip(_0x20b4c2,_0x324f0a[_0xddba('0xf')]);for(var _0x45b807=0x0,_0xe7942b={},_0x4fca2a={};_0x45b807<_0x20b4c2[_0xddba('0x3d')];_0x45b807+=0x1){_0xe7942b=_0x20b4c2[_0x45b807];if(_['isUndefined'](_0x324f0a[_0xddba('0xf')][util[_0xddba('0x22')]('SIP/%s',_0xe7942b[_0xddba('0x26')])])){_0x324f0a['trunks'][util[_0xddba('0x22')](_0xddba('0x25'),_0xe7942b[_0xddba('0x26')])]=new Trunk(_0xe7942b);}else{_0x324f0a[_0xddba('0x3b')](_0x324f0a['trunks'][util[_0xddba('0x22')](_0xddba('0x25'),_0xe7942b[_0xddba('0x26')])],_0xe7942b);}}}return _0x324f0a[_0xddba('0xf')];};};Realtime['prototype'][_0xddba('0x41')]=function(){var _0xaa49a4=this;return function(_0x126d2d){if(_0x126d2d){freeIsNotKey(_0x126d2d,_0xaa49a4[_0xddba('0x10')],_0xddba('0x26'));for(var _0x5ded99=0x0,_0x38f5f9={},_0x16ac1b={};_0x5ded99<_0x126d2d[_0xddba('0x3d')];_0x5ded99+=0x1){_0x38f5f9=_0x126d2d[_0x5ded99];if(_[_0xddba('0x3e')](_0xaa49a4[_0xddba('0x10')][_0x38f5f9[_0xddba('0x26')]])){_0xaa49a4[_0xddba('0x10')][_0x38f5f9[_0xddba('0x26')]]=new VoiceQueue(_0x38f5f9);}else{_0xaa49a4['mergeFromDatabase'](_0xaa49a4[_0xddba('0x10')][_0x38f5f9[_0xddba('0x26')]],_0x38f5f9);}}}return _0xaa49a4['voiceQueues'];};};Realtime['prototype'][_0xddba('0x42')]=function(){var _0x289a22=this;return function(_0x163ddf){if(_0x163ddf){freeIsNotKey(_0x163ddf,_0x289a22[_0xddba('0x11')],'id');for(var _0x574f2e=0x0,_0x5692e7={},_0x27b3ed={};_0x574f2e<_0x163ddf['length'];_0x574f2e+=0x1){_0x5692e7=_0x163ddf[_0x574f2e];if(_[_0xddba('0x3e')](_0x289a22[_0xddba('0x11')][_0x5692e7['id']])){_0x289a22[_0xddba('0x11')][_0x5692e7['id']]=new Trigger(_0x5692e7);}else{_0x289a22['mergeFromDatabase'](_0x289a22[_0xddba('0x11')][_0x5692e7['id']],_0x5692e7);}}}return _0x289a22[_0xddba('0x11')];};};Realtime['prototype'][_0xddba('0x43')]=function(){var _0x717d8b=this;return function(_0xfb0215){if(_0xfb0215){freeIsNotKey(_0xfb0215,_0x717d8b[_0xddba('0x13')],'id');for(var _0x292377=0x0,_0x524ea0={},_0x393b17={};_0x292377<_0xfb0215[_0xddba('0x3d')];_0x292377+=0x1){_0x524ea0=_0xfb0215[_0x292377];if(_[_0xddba('0x3e')](_0x717d8b[_0xddba('0x13')][_0x524ea0['id']])){_0x717d8b['templates'][_0x524ea0['id']]=new Template(_0x524ea0);}else{_0x717d8b[_0xddba('0x3b')](_0x717d8b[_0xddba('0x13')][_0x524ea0['id']],_0x524ea0);}}}return _0x717d8b[_0xddba('0x13')];};};Realtime[_0xddba('0x3a')][_0xddba('0x44')]=function(){var _0xb5d4ec=this;return function(_0x392d6a){if(_0x392d6a){freeIsNotKey(_0x392d6a,_0xb5d4ec[_0xddba('0x18')],'id');for(var _0x38f0bc=0x0,_0x721fff={},_0x4b986c={};_0x38f0bc<_0x392d6a[_0xddba('0x3d')];_0x38f0bc+=0x1){_0x721fff=_0x392d6a[_0x38f0bc];if(_[_0xddba('0x3e')](_0xb5d4ec['zendeskAccounts'][_0x721fff['id']])){_0xb5d4ec[_0xddba('0x18')][_0x721fff['id']]=new ZendeskAccount(_0x721fff);}else{_0xb5d4ec[_0xddba('0x3b')](_0xb5d4ec['zendeskAccounts'][_0x721fff['id']],_0x721fff);}}}return _0xb5d4ec[_0xddba('0x18')];};};Realtime[_0xddba('0x3a')][_0xddba('0x45')]=function(){var _0x4135a6=this;return function(_0x5db630){if(_0x5db630){freeIsNotKey(_0x5db630,_0x4135a6[_0xddba('0x46')],'id');for(var _0x4e0f65=0x0,_0x2da85e={},_0xcd031c={};_0x4e0f65<_0x5db630[_0xddba('0x3d')];_0x4e0f65+=0x1){_0x2da85e=_0x5db630[_0x4e0f65];if(_[_0xddba('0x3e')](_0x4135a6[_0xddba('0x46')][_0x2da85e['id']])){_0x4135a6[_0xddba('0x46')][_0x2da85e['id']]=new SalesforceAccount(_0x2da85e);}else{_0x4135a6[_0xddba('0x3b')](_0x4135a6['salesforceAccounts'][_0x2da85e['id']],_0x2da85e);}}}return _0x4135a6['salesforceAccounts'];};};Realtime[_0xddba('0x3a')][_0xddba('0x47')]=function(){var _0x2ead06=this;return function(_0x424527){if(_0x424527){freeIsNotKey(_0x424527,_0x2ead06['freshdeskAccounts'],'id');for(var _0x47ac74=0x0,_0x3cdfad={},_0x45c962={};_0x47ac74<_0x424527[_0xddba('0x3d')];_0x47ac74+=0x1){_0x3cdfad=_0x424527[_0x47ac74];if(_[_0xddba('0x3e')](_0x2ead06[_0xddba('0x48')][_0x3cdfad['id']])){_0x2ead06[_0xddba('0x48')][_0x3cdfad['id']]=new FreshdeskAccount(_0x3cdfad);}else{_0x2ead06['mergeFromDatabase'](_0x2ead06[_0xddba('0x48')][_0x3cdfad['id']],_0x3cdfad);}}}return _0x2ead06[_0xddba('0x48')];};};Realtime[_0xddba('0x3a')][_0xddba('0x49')]=function(){var _0x4cfb55=this;return function(_0x4cf66d){if(_0x4cf66d){freeIsNotKey(_0x4cf66d,_0x4cfb55[_0xddba('0x1a')],'id');for(var _0x28cf03=0x0,_0x4af37e={},_0x1780e6={};_0x28cf03<_0x4cf66d[_0xddba('0x3d')];_0x28cf03+=0x1){_0x4af37e=_0x4cf66d[_0x28cf03];if(_[_0xddba('0x3e')](_0x4cfb55['zohoAccounts'][_0x4af37e['id']])){_0x4cfb55[_0xddba('0x1a')][_0x4af37e['id']]=new ZohoAccount(_0x4af37e);}else{_0x4cfb55[_0xddba('0x3b')](_0x4cfb55['zohoAccounts'][_0x4af37e['id']],_0x4af37e);}}}return _0x4cfb55[_0xddba('0x1a')];};};Realtime[_0xddba('0x3a')][_0xddba('0x4a')]=function(){var _0x47df9b=this;return function(_0x3516e6){if(_0x3516e6){freeIsNotKey(_0x3516e6,_0x47df9b['deskAccounts'],'id');for(var _0x9777f7=0x0,_0x5d175b={},_0x106a7b={};_0x9777f7<_0x3516e6[_0xddba('0x3d')];_0x9777f7+=0x1){_0x5d175b=_0x3516e6[_0x9777f7];if(_[_0xddba('0x3e')](_0x47df9b[_0xddba('0x1b')][_0x5d175b['id']])){_0x47df9b[_0xddba('0x1b')][_0x5d175b['id']]=new DeskAccount(_0x5d175b);}else{_0x47df9b['mergeFromDatabase'](_0x47df9b[_0xddba('0x1b')][_0x5d175b['id']],_0x5d175b);}}}return _0x47df9b[_0xddba('0x1b')];};};Realtime['prototype'][_0xddba('0x4b')]=function(){var _0x23f30e=this;return function(_0x49ccf7){if(_0x49ccf7){freeIsNotKey(_0x49ccf7,_0x23f30e[_0xddba('0x19')],'id');for(var _0x6f73b2=0x0,_0x4a1650={},_0x345e96={};_0x6f73b2<_0x49ccf7[_0xddba('0x3d')];_0x6f73b2+=0x1){_0x4a1650=_0x49ccf7[_0x6f73b2];if(_['isUndefined'](_0x23f30e['sugarcrmAccounts'][_0x4a1650['id']])){_0x23f30e[_0xddba('0x19')][_0x4a1650['id']]=new SugarcrmAccount(_0x4a1650);}else{_0x23f30e[_0xddba('0x3b')](_0x23f30e[_0xddba('0x19')][_0x4a1650['id']],_0x4a1650);}}}return _0x23f30e[_0xddba('0x19')];};};Realtime[_0xddba('0x3a')][_0xddba('0x4c')]=function(){var _0x40daec=this;return function(_0x17522e){if(_0x17522e){freeIsNotKey(_0x17522e,_0x40daec[_0xddba('0x1c')],'id');for(var _0x385e7c=0x0,_0x20da65={},_0x1be705={};_0x385e7c<_0x17522e[_0xddba('0x3d')];_0x385e7c+=0x1){_0x20da65=_0x17522e[_0x385e7c];if(_[_0xddba('0x3e')](_0x40daec[_0xddba('0x1c')][_0x20da65['id']])){_0x40daec[_0xddba('0x1c')][_0x20da65['id']]=new VtigerAccount(_0x20da65);}else{_0x40daec[_0xddba('0x3b')](_0x40daec[_0xddba('0x1c')][_0x20da65['id']],_0x20da65);}}}return _0x40daec['vtigerAccounts'];};};Realtime[_0xddba('0x3a')]['initServicenowAccounts']=function(){var _0x1930f8=this;return function(_0x2c32c3){if(_0x2c32c3){freeIsNotKey(_0x2c32c3,_0x1930f8[_0xddba('0x1d')],'id');for(var _0x2071fa=0x0,_0x2aaa7f={},_0x53204a={};_0x2071fa<_0x2c32c3[_0xddba('0x3d')];_0x2071fa+=0x1){_0x2aaa7f=_0x2c32c3[_0x2071fa];if(_[_0xddba('0x3e')](_0x1930f8['servicenowAccounts'][_0x2aaa7f['id']])){_0x1930f8[_0xddba('0x1d')][_0x2aaa7f['id']]=new ServicenowAccount(_0x2aaa7f);}else{_0x1930f8[_0xddba('0x3b')](_0x1930f8[_0xddba('0x1d')][_0x2aaa7f['id']],_0x2aaa7f);}}}return _0x1930f8[_0xddba('0x1d')];};};Realtime[_0xddba('0x3a')][_0xddba('0x4d')]=function(){var _0x2736c7=this;return function(_0x2606f4){if(_0x2606f4){freeIsNotKey(_0x2606f4,_0x2736c7[_0xddba('0x1e')],'id');for(var _0x3854a0=0x0,_0x40c02e={},_0x50d250={};_0x3854a0<_0x2606f4[_0xddba('0x3d')];_0x3854a0+=0x1){_0x40c02e=_0x2606f4[_0x3854a0];if(_[_0xddba('0x3e')](_0x2736c7[_0xddba('0x1e')][_0x40c02e['id']])){_0x2736c7['dynamics365Accounts'][_0x40c02e['id']]=new Dynamics365Account(_0x40c02e);}else{_0x2736c7['mergeFromDatabase'](_0x2736c7[_0xddba('0x1e')][_0x40c02e['id']],_0x40c02e);}}}return _0x2736c7[_0xddba('0x1e')];};};Realtime[_0xddba('0x3a')][_0xddba('0x4e')]=function(){var _0x4953b6=this;return function(_0x5cb27a){if(_0x5cb27a){freeIsNotKey(_0x5cb27a,_0x4953b6['freshsalesAccounts'],'id');for(var _0x2ed297=0x0,_0x3336b6={},_0x39bfe8={};_0x2ed297<_0x5cb27a[_0xddba('0x3d')];_0x2ed297+=0x1){_0x3336b6=_0x5cb27a[_0x2ed297];if(_[_0xddba('0x3e')](_0x4953b6['freshsalesAccounts'][_0x3336b6['id']])){_0x4953b6[_0xddba('0x4f')][_0x3336b6['id']]=new FreshsalesAccount(_0x3336b6);}else{_0x4953b6['mergeFromDatabase'](_0x4953b6['freshsalesAccounts'][_0x3336b6['id']],_0x3336b6);}}}return _0x4953b6[_0xddba('0x4f')];};};Realtime[_0xddba('0x3a')][_0xddba('0x50')]=function(){var _0x2d0c0b=this;return function(_0x38a1c2){for(var _0x5ba1b5=0x0;_0x5ba1b5<_0x38a1c2[_0xddba('0x3d')];_0x5ba1b5+=0x1){_[_0xddba('0x51')](_0x2d0c0b['voiceQueues'][_0x38a1c2[_0x5ba1b5][_0xddba('0x26')]],_0x38a1c2[_0x5ba1b5]);}return _0x2d0c0b[_0xddba('0x10')];};};Realtime[_0xddba('0x3a')][_0xddba('0x52')]=function(){var _0x573e1e=this;return function(_0x221de5){clearVoiceQueues(_0x573e1e[_0xddba('0x10')]);if(_0x221de5){_0x221de5=_['groupBy'](_0x221de5,'uniqueid');for(var _0xbc3c49 in _0x221de5){if(_0x221de5['hasOwnProperty'](_0xbc3c49)){var _0xb3f887={};for(var _0x787ad2=0x0;_0x787ad2<_0x221de5[_0xbc3c49][_0xddba('0x3d')];_0x787ad2+=0x1){var _0x31a47d=_0x221de5[_0xbc3c49][_0x787ad2][_0xddba('0x53')];if(_0x573e1e[_0xddba('0x10')][_0x31a47d]){if(_0x221de5[_0xbc3c49][_0x787ad2][_0xddba('0x54')]){_0x573e1e[_0xddba('0x10')][_0x31a47d][_0xddba('0x2f')]+=0x1;}if(_0x221de5[_0xbc3c49][_0x787ad2][_0xddba('0x55')]){_0x573e1e['voiceQueues'][_0x31a47d][_0xddba('0x30')]+=0x1;}_0x573e1e['voiceQueues'][_0x31a47d]['sumHoldTime']+=moment(_0x221de5[_0xbc3c49][_0x787ad2]['queuecallerleaveAt'])[_0xddba('0x56')](moment(_0x221de5[_0xbc3c49][_0x787ad2][_0xddba('0x57')]),_0xddba('0x58'))||0x0;if(_0x787ad2===_0x221de5[_0xbc3c49][_0xddba('0x3d')]-0x1){_0x573e1e[_0xddba('0x10')][_0x31a47d]['sumDuration']+=moment(_0x221de5[_0xbc3c49][_0x787ad2][_0xddba('0x59')]||_0x221de5[_0xbc3c49][_0x787ad2][_0xddba('0x5a')]||_0x221de5[_0xbc3c49][_0x787ad2]['queuecallerexitAt'])[_0xddba('0x56')](moment(_0x221de5[_0xbc3c49][_0x787ad2]['queuecallerjoinAt']),_0xddba('0x58'))||0x0;_0x573e1e[_0xddba('0x10')][_0x31a47d][_0xddba('0x27')]+=0x1;if(_0x221de5[_0xbc3c49][_0x787ad2][_0xddba('0x5b')]){_0x573e1e['voiceQueues'][_0x31a47d][_0xddba('0x2e')]+=0x1;_0x573e1e['voiceQueues'][_0x31a47d][_0xddba('0x2a')]+=moment(_0x221de5[_0xbc3c49][_0x787ad2][_0xddba('0x59')])[_0xddba('0x56')](moment(_0x221de5[_0xbc3c49][_0x787ad2]['queuecallerleaveAt']),'seconds')||0x0;}}else{_0x573e1e[_0xddba('0x10')][_0x31a47d][_0xddba('0x29')]+=_0x573e1e[_0xddba('0x10')][_0x31a47d]['sumHoldTime']||0x0;}}}}}}return _0x573e1e['voiceQueues'];};};Realtime[_0xddba('0x3a')][_0xddba('0x5c')]=function(){var _0x2befd7=this;return function(_0x181829){clearVoiceCallReports(_0x2befd7[_0xddba('0x14')]);if(_0x181829){for(var _0x401d1a=0x0;_0x401d1a<_0x181829[_0xddba('0x3d')];_0x401d1a+=0x1){_0x2befd7[_0xddba('0x14')]['total']+=0x1;_0x2befd7['outbound'][_0xddba('0x29')]+=_0x181829[_0x401d1a][_0xddba('0x5d')];if(_0x181829[_0x401d1a]['disposition']===_0xddba('0x5e')){_0x2befd7['outbound'][_0xddba('0x2e')]+=0x1;_0x2befd7['outbound']['sumHoldTime']+=_0x181829[_0x401d1a][_0xddba('0x5d')]-_0x181829[_0x401d1a]['billableseconds']||0x0;_0x2befd7['outbound'][_0xddba('0x2a')]+=_0x181829[_0x401d1a][_0xddba('0x5f')];}}}return _0x2befd7['outbound'];};};Realtime[_0xddba('0x3a')][_0xddba('0x60')]=function(){var _0x4c74c1=this;return function(_0x51a546){if(_0x51a546){freeIsNotKey(_0x51a546,_0x4c74c1['campaigns'],_0xddba('0x26'));for(var _0x576b78=0x0,_0x9595f6={};_0x576b78<_0x51a546[_0xddba('0x3d')];_0x576b78+=0x1){_0x9595f6=_0x51a546[_0x576b78];if(_[_0xddba('0x3e')](_0x4c74c1[_0xddba('0x12')][_0x9595f6[_0xddba('0x26')]])){_0x4c74c1[_0xddba('0x12')][_0x9595f6[_0xddba('0x26')]]=new Campaign(_0x9595f6);}else{_0x4c74c1[_0xddba('0x3b')](_0x4c74c1[_0xddba('0x12')][_0x9595f6[_0xddba('0x26')]],_0x9595f6);_0x4c74c1['campaigns'][_0x9595f6[_0xddba('0x26')]][_0xddba('0x61')]=_0x9595f6[_0xddba('0x62')]?_0x9595f6[_0xddba('0x62')][_0xddba('0x26')]:undefined;}}}return _0x4c74c1[_0xddba('0x12')];};};Realtime[_0xddba('0x3a')][_0xddba('0x63')]=function(){var _0x92fc0d=this;return function(_0x3822ca){if(_0x3822ca){freeIsNotKey(_0x3822ca,_0x92fc0d[_0xddba('0x64')],'id');for(var _0x85a327=0x0,_0x16e001={};_0x85a327<_0x3822ca[_0xddba('0x3d')];_0x85a327+=0x1){_0x16e001=_0x3822ca[_0x85a327];if(_[_0xddba('0x3e')](_0x92fc0d[_0xddba('0x64')][_0x16e001['id']])){_0x92fc0d['voiceExtensions'][_0x16e001['id']]=new VoiceExtension(_0x16e001);}else{_0x92fc0d[_0xddba('0x3b')](_0x92fc0d[_0xddba('0x64')][_0x16e001['id']],_0x16e001);}}}return _0x92fc0d['voiceExtensions'];};};Realtime['prototype'][_0xddba('0x65')]=function(){var _0x261bc4=this;return function(_0x83123){clearCampaigns(_0x261bc4[_0xddba('0x12')]);for(var _0x2cc8ae=0x0;_0x2cc8ae<_0x83123[_0xddba('0x3d')];_0x2cc8ae+=0x1){_[_0xddba('0x51')](_0x261bc4[_0xddba('0x12')][_0x83123[_0x2cc8ae]['name']],_0x83123[_0x2cc8ae]);}return _0x261bc4[_0xddba('0x12')];};};Realtime['prototype'][_0xddba('0x66')]=function(){var _0x182f63=this;return function(_0x3ba8e7){if(_0x3ba8e7){freeIsNotKey(_0x3ba8e7,_0x182f63['faxAccounts'],'id');for(var _0xec9594=0x0,_0x13941f={},_0x26a349={};_0xec9594<_0x3ba8e7[_0xddba('0x3d')];_0xec9594+=0x1){_0x13941f=_0x3ba8e7[_0xec9594];if(_[_0xddba('0x3e')](_0x182f63['faxAccounts'][_0x13941f['id']])){_0x182f63[_0xddba('0x1f')][_0x13941f['id']]=new FaxAccount(_0x13941f);}else{_0x182f63['mergeFromDatabase'](_0x182f63[_0xddba('0x1f')][_0x13941f['id']],_0x13941f);}}}return _0x182f63[_0xddba('0x1f')];};};module[_0xddba('0x67')]=Realtime;
\ No newline at end of file
+var _0x6713=['../model/voiceQueue','../model/trigger','../model/voiceExtension','../model/zendeskAccount','../model/freshdeskAccount','../model/sugarcrmAccount','../model/zohoAccount','../model/deskAccount','../model/vtigerAccount','../model/dynamics365Account','../model/freshsalesAccount','../model/faxAccount','agents','telephones','trunks','voiceQueues','triggers','campaigns','templates','voiceExtensions','channels','queueChannels','outboundChannels','zendeskAccounts','sugarcrmAccounts','freshdeskAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','freshsalesAccounts','faxAccounts','mapKeys','hasOwnProperty','format','isNil','interface','SIP/%s','name','total','sumHoldTime','isEmpty','ivrTotalCallsDays','ivrAnswerCallsDay','answered','unmanaged','sumBillable','outboundAnswerAgiCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundDropCallsDayTimeout','outboundDropCallsDayCallersExit','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundAnswerCallsDay','queueStatusComplete','prototype','mergeFromDatabase','length','isUndefined','initTelephones','initTrunks','initVoiceQueues','initTemplates','initZendeskAccounts','salesforceAccounts','initFreshdeskAccounts','initZohoAccounts','zohoAccounts','initDeskAccounts','deskAccounts','initSugarcrmAccounts','initVtigerAccounts','initServicenowAccounts','initDynamics365Accounts','initFreshsalesAccounts','initVoiceQueueHopperHistory','merge','initVoiceQueueReports','groupBy','uniqueid','queue','queuecallerexit','queuecallerabandon','abandoned','queuecallerleaveAt','queuecallerjoinAt','seconds','queuecallerabandonAt','queuecallerexitAt','diff','queuecallercomplete','queuecallercompleteAt','initVoiceCallReports','outbound','sumDuration','ANSWERED','billableseconds','initCampaigns','dialQueueProject','SquareProject','initVoiceExtensions','initCampaignHopperHistory','initFaxAccounts','exports','bluebird','lodash','../model/agent','../model/telephone','../model/trunk'];(function(_0x55d2ee,_0x5a796c){var _0x1eeb19=function(_0x42f6a3){while(--_0x42f6a3){_0x55d2ee['push'](_0x55d2ee['shift']());}};_0x1eeb19(++_0x5a796c);}(_0x6713,0x6a));var _0x3671=function(_0x3f8a03,_0x319b9c){_0x3f8a03=_0x3f8a03-0x0;var _0x147fb2=_0x6713[_0x3f8a03];return _0x147fb2;};'use strict';var BPromise=require(_0x3671('0x0'));var util=require('util');var _=require(_0x3671('0x1'));var moment=require('moment');var Agent=require(_0x3671('0x2'));var Telephone=require(_0x3671('0x3'));var Trunk=require(_0x3671('0x4'));var VoiceQueue=require(_0x3671('0x5'));var Trigger=require(_0x3671('0x6'));var Template=require('../model/template');var Campaign=require('../model/campaign');var VoiceExtension=require(_0x3671('0x7'));var ZendeskAccount=require(_0x3671('0x8'));var SalesforceAccount=require('../model/salesforceAccount');var FreshdeskAccount=require(_0x3671('0x9'));var SugarcrmAccount=require(_0x3671('0xa'));var ZohoAccount=require(_0x3671('0xb'));var DeskAccount=require(_0x3671('0xc'));var VtigerAccount=require(_0x3671('0xd'));var ServicenowAccount=require('../model/servicenowAccount');var Dynamics365Account=require(_0x3671('0xe'));var FreshsalesAccount=require(_0x3671('0xf'));var FaxAccount=require(_0x3671('0x10'));var Realtime=function(){this[_0x3671('0x11')]={};this[_0x3671('0x12')]={};this[_0x3671('0x13')]={};this[_0x3671('0x14')]={};this[_0x3671('0x15')]={};this[_0x3671('0x16')]={};this[_0x3671('0x17')]={};this['outbound']={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this[_0x3671('0x18')]={};this[_0x3671('0x19')]={};this[_0x3671('0x1a')]={};this[_0x3671('0x1b')]={};this['timers']={};this[_0x3671('0x1c')]={};this['salesforceAccounts']={};this[_0x3671('0x1d')]={};this[_0x3671('0x1e')]={};this['zohoAccounts']={};this['deskAccounts']={};this[_0x3671('0x1f')]={};this[_0x3671('0x20')]={};this[_0x3671('0x21')]={};this[_0x3671('0x22')]={};this[_0x3671('0x23')]={};};function freeIsNotKey(_0x43d164,_0x20af06,_0x447654){var _0x3ec9aa=_[_0x3671('0x24')](_0x43d164,function(_0x11a387,_0x1c240b){return _0x11a387[_0x447654];});for(var _0x2c40cd in _0x20af06){if(_0x20af06[_0x3671('0x25')](_0x2c40cd)){if(!_0x3ec9aa[_0x2c40cd]){delete _0x20af06[_0x2c40cd];}}}}function freeIsNotKeySip(_0x3a8636,_0x327ca1){var _0x29a1ae=_[_0x3671('0x24')](_0x3a8636,function(_0x76df67,_0x4f3a4a){return util[_0x3671('0x26')]('SIP/%s',_0x76df67['name']);});for(var _0xdbdd3b in _0x327ca1){if(_0x327ca1['hasOwnProperty'](_0xdbdd3b)){if(!_0x29a1ae[_0xdbdd3b]){delete _0x327ca1[_0xdbdd3b];}}}}function freeIsNotKeyAgent(_0x5d33c8,_0x5f58b8){var _0x4bf54e=_[_0x3671('0x24')](_0x5d33c8,function(_0x4d5cb1,_0x244ce0){var _0x15c222=_[_0x3671('0x27')](_0x4d5cb1[_0x3671('0x28')])?util[_0x3671('0x26')](_0x3671('0x29'),_0x4d5cb1[_0x3671('0x2a')]):_0x4d5cb1[_0x3671('0x28')];return _0x15c222;});for(var _0x51f1f6 in _0x5f58b8){if(_0x5f58b8[_0x3671('0x25')](_0x51f1f6)){if(!_0x4bf54e[_0x51f1f6]){delete _0x5f58b8[_0x51f1f6];}}}}function clearVoiceCallReports(_0x25e2ff){_0x25e2ff[_0x3671('0x2b')]=0x0;_0x25e2ff['answered']=0x0;_0x25e2ff[_0x3671('0x2c')]=0x0;_0x25e2ff['sumDuration']=0x0;_0x25e2ff['sumBillable']=0x0;}function clearCampaigns(_0x42cdb4){if(!_[_0x3671('0x2d')](_0x42cdb4)){for(var _0x423032 in _0x42cdb4){if(_0x42cdb4['hasOwnProperty'](_0x423032)){_0x42cdb4[_0x423032][_0x3671('0x2e')]=0x0;_0x42cdb4[_0x423032][_0x3671('0x2f')]=0x0;}}}}function clearVoiceQueues(_0x5d7a3b){if(!_[_0x3671('0x2d')](_0x5d7a3b)){for(var _0x36e1c7 in _0x5d7a3b){if(_0x5d7a3b['hasOwnProperty'](_0x36e1c7)){_0x5d7a3b[_0x36e1c7][_0x3671('0x2b')]=0x0;_0x5d7a3b[_0x36e1c7][_0x3671('0x30')]=0x0;_0x5d7a3b[_0x36e1c7][_0x3671('0x31')]=0x0;_0x5d7a3b[_0x36e1c7]['abandoned']=0x0;_0x5d7a3b[_0x36e1c7][_0x3671('0x2c')]=0x0;_0x5d7a3b[_0x36e1c7]['sumDuration']=0x0;_0x5d7a3b[_0x36e1c7][_0x3671('0x32')]=0x0;_0x5d7a3b[_0x36e1c7][_0x3671('0x33')]=0x0;_0x5d7a3b[_0x36e1c7]['outboundNoAnswerCallsDay']=0x0;_0x5d7a3b[_0x36e1c7]['outboundBusyCallsDay']=0x0;_0x5d7a3b[_0x36e1c7][_0x3671('0x34')]=0x0;_0x5d7a3b[_0x36e1c7][_0x3671('0x35')]=0x0;_0x5d7a3b[_0x36e1c7][_0x3671('0x36')]=0x0;_0x5d7a3b[_0x36e1c7][_0x3671('0x37')]=0x0;_0x5d7a3b[_0x36e1c7][_0x3671('0x38')]=0x0;_0x5d7a3b[_0x36e1c7][_0x3671('0x39')]=0x0;_0x5d7a3b[_0x36e1c7][_0x3671('0x3a')]=0x0;_0x5d7a3b[_0x36e1c7]['outboundRejectCallsDay']=0x0;_0x5d7a3b[_0x36e1c7][_0x3671('0x3b')]=0x0;_0x5d7a3b[_0x36e1c7]['outboundAnswerAgiCallsDay']=0x0;_0x5d7a3b[_0x36e1c7][_0x3671('0x3c')]=0x0;_0x5d7a3b[_0x36e1c7][_0x3671('0x3d')]=!![];}}}}Realtime[_0x3671('0x3e')][_0x3671('0x3f')]=function(_0x526367,_0x508656){for(var _0x43a9b5 in _0x508656){if(_0x526367[_0x3671('0x25')](_0x43a9b5)){_0x526367[_0x43a9b5]=_0x508656[_0x43a9b5];}}};Realtime['prototype']['initAgents']=function(){var _0xa87eb3=this;return function(_0x1c8fdf){if(_0x1c8fdf){freeIsNotKeyAgent(_0x1c8fdf,_0xa87eb3[_0x3671('0x11')]);for(var _0x3e265b=0x0,_0x40e6f7={},_0x58e11b={};_0x3e265b<_0x1c8fdf[_0x3671('0x40')];_0x3e265b+=0x1){_0x40e6f7=_0x1c8fdf[_0x3e265b];var _0x237cbd=_[_0x3671('0x27')](_0x40e6f7[_0x3671('0x28')])?util['format'](_0x3671('0x29'),_0x40e6f7[_0x3671('0x2a')]):_0x40e6f7['interface'];if(_[_0x3671('0x41')](_0xa87eb3[_0x3671('0x11')][_0x237cbd])){_0xa87eb3[_0x3671('0x11')][_0x237cbd]=new Agent(_0x40e6f7);}else{_0xa87eb3[_0x3671('0x3f')](_0xa87eb3[_0x3671('0x11')][_0x237cbd],_0x40e6f7);}}}return _0xa87eb3[_0x3671('0x11')];};};Realtime[_0x3671('0x3e')][_0x3671('0x42')]=function(){var _0x5bdcaa=this;return function(_0xea669e){if(_0xea669e){freeIsNotKeySip(_0xea669e,_0x5bdcaa[_0x3671('0x12')]);for(var _0x178ec6=0x0,_0x20ed3e={},_0x2e33d6={};_0x178ec6<_0xea669e[_0x3671('0x40')];_0x178ec6+=0x1){_0x20ed3e=_0xea669e[_0x178ec6];if(_['isUndefined'](_0x5bdcaa[_0x3671('0x12')][util['format'](_0x3671('0x29'),_0x20ed3e[_0x3671('0x2a')])])){_0x5bdcaa[_0x3671('0x12')][util['format'](_0x3671('0x29'),_0x20ed3e[_0x3671('0x2a')])]=new Telephone(_0x20ed3e);}else{_0x5bdcaa[_0x3671('0x3f')](_0x5bdcaa[_0x3671('0x12')][util[_0x3671('0x26')]('SIP/%s',_0x20ed3e[_0x3671('0x2a')])],_0x20ed3e);}}}return _0x5bdcaa[_0x3671('0x12')];};};Realtime['prototype'][_0x3671('0x43')]=function(){var _0x25e50d=this;return function(_0x510cc1){if(_0x510cc1){freeIsNotKeySip(_0x510cc1,_0x25e50d[_0x3671('0x13')]);for(var _0x1856be=0x0,_0x5a28c1={},_0x2d37a7={};_0x1856be<_0x510cc1[_0x3671('0x40')];_0x1856be+=0x1){_0x5a28c1=_0x510cc1[_0x1856be];if(_['isUndefined'](_0x25e50d[_0x3671('0x13')][util[_0x3671('0x26')](_0x3671('0x29'),_0x5a28c1[_0x3671('0x2a')])])){_0x25e50d[_0x3671('0x13')][util[_0x3671('0x26')](_0x3671('0x29'),_0x5a28c1[_0x3671('0x2a')])]=new Trunk(_0x5a28c1);}else{_0x25e50d['mergeFromDatabase'](_0x25e50d[_0x3671('0x13')][util['format']('SIP/%s',_0x5a28c1['name'])],_0x5a28c1);}}}return _0x25e50d['trunks'];};};Realtime[_0x3671('0x3e')][_0x3671('0x44')]=function(){var _0x20549b=this;return function(_0x1b0e52){if(_0x1b0e52){freeIsNotKey(_0x1b0e52,_0x20549b[_0x3671('0x14')],_0x3671('0x2a'));for(var _0x544e54=0x0,_0x1c4088={},_0x4c7ff5={};_0x544e54<_0x1b0e52['length'];_0x544e54+=0x1){_0x1c4088=_0x1b0e52[_0x544e54];if(_[_0x3671('0x41')](_0x20549b[_0x3671('0x14')][_0x1c4088[_0x3671('0x2a')]])){_0x20549b[_0x3671('0x14')][_0x1c4088[_0x3671('0x2a')]]=new VoiceQueue(_0x1c4088);}else{_0x20549b[_0x3671('0x3f')](_0x20549b[_0x3671('0x14')][_0x1c4088[_0x3671('0x2a')]],_0x1c4088);}}}return _0x20549b[_0x3671('0x14')];};};Realtime[_0x3671('0x3e')]['initTriggers']=function(){var _0x4ddfdc=this;return function(_0x2ce28a){if(_0x2ce28a){freeIsNotKey(_0x2ce28a,_0x4ddfdc[_0x3671('0x15')],'id');for(var _0x5c5a24=0x0,_0x414b0c={},_0x18aad5={};_0x5c5a24<_0x2ce28a[_0x3671('0x40')];_0x5c5a24+=0x1){_0x414b0c=_0x2ce28a[_0x5c5a24];if(_[_0x3671('0x41')](_0x4ddfdc[_0x3671('0x15')][_0x414b0c['id']])){_0x4ddfdc[_0x3671('0x15')][_0x414b0c['id']]=new Trigger(_0x414b0c);}else{_0x4ddfdc['mergeFromDatabase'](_0x4ddfdc[_0x3671('0x15')][_0x414b0c['id']],_0x414b0c);}}}return _0x4ddfdc[_0x3671('0x15')];};};Realtime[_0x3671('0x3e')][_0x3671('0x45')]=function(){var _0x65201c=this;return function(_0x3e556a){if(_0x3e556a){freeIsNotKey(_0x3e556a,_0x65201c[_0x3671('0x17')],'id');for(var _0x1efbfc=0x0,_0xc0c637={},_0x342851={};_0x1efbfc<_0x3e556a[_0x3671('0x40')];_0x1efbfc+=0x1){_0xc0c637=_0x3e556a[_0x1efbfc];if(_[_0x3671('0x41')](_0x65201c[_0x3671('0x17')][_0xc0c637['id']])){_0x65201c['templates'][_0xc0c637['id']]=new Template(_0xc0c637);}else{_0x65201c[_0x3671('0x3f')](_0x65201c[_0x3671('0x17')][_0xc0c637['id']],_0xc0c637);}}}return _0x65201c[_0x3671('0x17')];};};Realtime['prototype'][_0x3671('0x46')]=function(){var _0x13dd93=this;return function(_0x2f0ccd){if(_0x2f0ccd){freeIsNotKey(_0x2f0ccd,_0x13dd93[_0x3671('0x1c')],'id');for(var _0x5ccd58=0x0,_0x3c95c4={},_0x3002ea={};_0x5ccd58<_0x2f0ccd[_0x3671('0x40')];_0x5ccd58+=0x1){_0x3c95c4=_0x2f0ccd[_0x5ccd58];if(_[_0x3671('0x41')](_0x13dd93[_0x3671('0x1c')][_0x3c95c4['id']])){_0x13dd93[_0x3671('0x1c')][_0x3c95c4['id']]=new ZendeskAccount(_0x3c95c4);}else{_0x13dd93['mergeFromDatabase'](_0x13dd93[_0x3671('0x1c')][_0x3c95c4['id']],_0x3c95c4);}}}return _0x13dd93[_0x3671('0x1c')];};};Realtime[_0x3671('0x3e')]['initSalesforceAccounts']=function(){var _0x2b2dc4=this;return function(_0x4717b0){if(_0x4717b0){freeIsNotKey(_0x4717b0,_0x2b2dc4[_0x3671('0x47')],'id');for(var _0x31e7c6=0x0,_0x1fc597={},_0x1192b3={};_0x31e7c6<_0x4717b0[_0x3671('0x40')];_0x31e7c6+=0x1){_0x1fc597=_0x4717b0[_0x31e7c6];if(_['isUndefined'](_0x2b2dc4['salesforceAccounts'][_0x1fc597['id']])){_0x2b2dc4[_0x3671('0x47')][_0x1fc597['id']]=new SalesforceAccount(_0x1fc597);}else{_0x2b2dc4[_0x3671('0x3f')](_0x2b2dc4[_0x3671('0x47')][_0x1fc597['id']],_0x1fc597);}}}return _0x2b2dc4[_0x3671('0x47')];};};Realtime[_0x3671('0x3e')][_0x3671('0x48')]=function(){var _0x5118c3=this;return function(_0x3aebe4){if(_0x3aebe4){freeIsNotKey(_0x3aebe4,_0x5118c3[_0x3671('0x1e')],'id');for(var _0x3fed65=0x0,_0x2655c4={},_0x108049={};_0x3fed65<_0x3aebe4[_0x3671('0x40')];_0x3fed65+=0x1){_0x2655c4=_0x3aebe4[_0x3fed65];if(_['isUndefined'](_0x5118c3['freshdeskAccounts'][_0x2655c4['id']])){_0x5118c3[_0x3671('0x1e')][_0x2655c4['id']]=new FreshdeskAccount(_0x2655c4);}else{_0x5118c3[_0x3671('0x3f')](_0x5118c3[_0x3671('0x1e')][_0x2655c4['id']],_0x2655c4);}}}return _0x5118c3[_0x3671('0x1e')];};};Realtime[_0x3671('0x3e')][_0x3671('0x49')]=function(){var _0x243b1a=this;return function(_0x58a902){if(_0x58a902){freeIsNotKey(_0x58a902,_0x243b1a['zohoAccounts'],'id');for(var _0x4d1a42=0x0,_0x3f7b59={},_0x5e5f99={};_0x4d1a42<_0x58a902[_0x3671('0x40')];_0x4d1a42+=0x1){_0x3f7b59=_0x58a902[_0x4d1a42];if(_['isUndefined'](_0x243b1a['zohoAccounts'][_0x3f7b59['id']])){_0x243b1a['zohoAccounts'][_0x3f7b59['id']]=new ZohoAccount(_0x3f7b59);}else{_0x243b1a['mergeFromDatabase'](_0x243b1a[_0x3671('0x4a')][_0x3f7b59['id']],_0x3f7b59);}}}return _0x243b1a[_0x3671('0x4a')];};};Realtime['prototype'][_0x3671('0x4b')]=function(){var _0x611d75=this;return function(_0x15466f){if(_0x15466f){freeIsNotKey(_0x15466f,_0x611d75['deskAccounts'],'id');for(var _0xeb0205=0x0,_0x334c7c={},_0x5a1e4c={};_0xeb0205<_0x15466f[_0x3671('0x40')];_0xeb0205+=0x1){_0x334c7c=_0x15466f[_0xeb0205];if(_[_0x3671('0x41')](_0x611d75[_0x3671('0x4c')][_0x334c7c['id']])){_0x611d75['deskAccounts'][_0x334c7c['id']]=new DeskAccount(_0x334c7c);}else{_0x611d75[_0x3671('0x3f')](_0x611d75[_0x3671('0x4c')][_0x334c7c['id']],_0x334c7c);}}}return _0x611d75[_0x3671('0x4c')];};};Realtime[_0x3671('0x3e')][_0x3671('0x4d')]=function(){var _0x27acf9=this;return function(_0x4a69c6){if(_0x4a69c6){freeIsNotKey(_0x4a69c6,_0x27acf9[_0x3671('0x1d')],'id');for(var _0x2dc8e7=0x0,_0x489a47={},_0xd40cda={};_0x2dc8e7<_0x4a69c6['length'];_0x2dc8e7+=0x1){_0x489a47=_0x4a69c6[_0x2dc8e7];if(_[_0x3671('0x41')](_0x27acf9['sugarcrmAccounts'][_0x489a47['id']])){_0x27acf9[_0x3671('0x1d')][_0x489a47['id']]=new SugarcrmAccount(_0x489a47);}else{_0x27acf9[_0x3671('0x3f')](_0x27acf9[_0x3671('0x1d')][_0x489a47['id']],_0x489a47);}}}return _0x27acf9[_0x3671('0x1d')];};};Realtime[_0x3671('0x3e')][_0x3671('0x4e')]=function(){var _0x2f01f7=this;return function(_0x4c1a18){if(_0x4c1a18){freeIsNotKey(_0x4c1a18,_0x2f01f7['vtigerAccounts'],'id');for(var _0x1d2e92=0x0,_0x51a20a={},_0x51d1f7={};_0x1d2e92<_0x4c1a18[_0x3671('0x40')];_0x1d2e92+=0x1){_0x51a20a=_0x4c1a18[_0x1d2e92];if(_['isUndefined'](_0x2f01f7[_0x3671('0x1f')][_0x51a20a['id']])){_0x2f01f7['vtigerAccounts'][_0x51a20a['id']]=new VtigerAccount(_0x51a20a);}else{_0x2f01f7['mergeFromDatabase'](_0x2f01f7['vtigerAccounts'][_0x51a20a['id']],_0x51a20a);}}}return _0x2f01f7[_0x3671('0x1f')];};};Realtime[_0x3671('0x3e')][_0x3671('0x4f')]=function(){var _0x5d5ee9=this;return function(_0x23fa4d){if(_0x23fa4d){freeIsNotKey(_0x23fa4d,_0x5d5ee9[_0x3671('0x20')],'id');for(var _0x1016f4=0x0,_0x1c1cde={},_0x592835={};_0x1016f4<_0x23fa4d[_0x3671('0x40')];_0x1016f4+=0x1){_0x1c1cde=_0x23fa4d[_0x1016f4];if(_[_0x3671('0x41')](_0x5d5ee9[_0x3671('0x20')][_0x1c1cde['id']])){_0x5d5ee9[_0x3671('0x20')][_0x1c1cde['id']]=new ServicenowAccount(_0x1c1cde);}else{_0x5d5ee9[_0x3671('0x3f')](_0x5d5ee9['servicenowAccounts'][_0x1c1cde['id']],_0x1c1cde);}}}return _0x5d5ee9[_0x3671('0x20')];};};Realtime['prototype'][_0x3671('0x50')]=function(){var _0x1c89e6=this;return function(_0x2e1d58){if(_0x2e1d58){freeIsNotKey(_0x2e1d58,_0x1c89e6[_0x3671('0x21')],'id');for(var _0xb62c7c=0x0,_0x2c714c={},_0x24dd95={};_0xb62c7c<_0x2e1d58['length'];_0xb62c7c+=0x1){_0x2c714c=_0x2e1d58[_0xb62c7c];if(_[_0x3671('0x41')](_0x1c89e6[_0x3671('0x21')][_0x2c714c['id']])){_0x1c89e6[_0x3671('0x21')][_0x2c714c['id']]=new Dynamics365Account(_0x2c714c);}else{_0x1c89e6[_0x3671('0x3f')](_0x1c89e6[_0x3671('0x21')][_0x2c714c['id']],_0x2c714c);}}}return _0x1c89e6[_0x3671('0x21')];};};Realtime['prototype'][_0x3671('0x51')]=function(){var _0x25a992=this;return function(_0x41ce02){if(_0x41ce02){freeIsNotKey(_0x41ce02,_0x25a992[_0x3671('0x22')],'id');for(var _0x55d67d=0x0,_0x35829b={},_0x258b64={};_0x55d67d<_0x41ce02[_0x3671('0x40')];_0x55d67d+=0x1){_0x35829b=_0x41ce02[_0x55d67d];if(_[_0x3671('0x41')](_0x25a992[_0x3671('0x22')][_0x35829b['id']])){_0x25a992[_0x3671('0x22')][_0x35829b['id']]=new FreshsalesAccount(_0x35829b);}else{_0x25a992[_0x3671('0x3f')](_0x25a992[_0x3671('0x22')][_0x35829b['id']],_0x35829b);}}}return _0x25a992['freshsalesAccounts'];};};Realtime[_0x3671('0x3e')][_0x3671('0x52')]=function(){var _0x4c54c6=this;return function(_0x42109e){for(var _0x182a78=0x0;_0x182a78<_0x42109e[_0x3671('0x40')];_0x182a78+=0x1){_[_0x3671('0x53')](_0x4c54c6[_0x3671('0x14')][_0x42109e[_0x182a78][_0x3671('0x2a')]],_0x42109e[_0x182a78]);}return _0x4c54c6[_0x3671('0x14')];};};Realtime[_0x3671('0x3e')][_0x3671('0x54')]=function(){var _0x352807=this;return function(_0x2cf433){clearVoiceQueues(_0x352807[_0x3671('0x14')]);if(_0x2cf433){_0x2cf433=_[_0x3671('0x55')](_0x2cf433,_0x3671('0x56'));for(var _0x5ba3c3 in _0x2cf433){if(_0x2cf433['hasOwnProperty'](_0x5ba3c3)){var _0x5d8ca0={};for(var _0x16119c=0x0;_0x16119c<_0x2cf433[_0x5ba3c3]['length'];_0x16119c+=0x1){var _0xf300e2=_0x2cf433[_0x5ba3c3][_0x16119c][_0x3671('0x57')];if(_0x352807[_0x3671('0x14')][_0xf300e2]){if(_0x2cf433[_0x5ba3c3][_0x16119c][_0x3671('0x58')]){_0x352807[_0x3671('0x14')][_0xf300e2][_0x3671('0x31')]+=0x1;}if(_0x2cf433[_0x5ba3c3][_0x16119c][_0x3671('0x59')]){_0x352807[_0x3671('0x14')][_0xf300e2][_0x3671('0x5a')]+=0x1;}_0x352807[_0x3671('0x14')][_0xf300e2][_0x3671('0x2c')]+=moment(_0x2cf433[_0x5ba3c3][_0x16119c][_0x3671('0x5b')])['diff'](moment(_0x2cf433[_0x5ba3c3][_0x16119c][_0x3671('0x5c')]),_0x3671('0x5d'))||0x0;if(_0x16119c===_0x2cf433[_0x5ba3c3][_0x3671('0x40')]-0x1){_0x352807[_0x3671('0x14')][_0xf300e2]['sumDuration']+=moment(_0x2cf433[_0x5ba3c3][_0x16119c]['queuecallercompleteAt']||_0x2cf433[_0x5ba3c3][_0x16119c][_0x3671('0x5e')]||_0x2cf433[_0x5ba3c3][_0x16119c][_0x3671('0x5f')])[_0x3671('0x60')](moment(_0x2cf433[_0x5ba3c3][_0x16119c][_0x3671('0x5c')]),_0x3671('0x5d'))||0x0;_0x352807[_0x3671('0x14')][_0xf300e2][_0x3671('0x2b')]+=0x1;if(_0x2cf433[_0x5ba3c3][_0x16119c][_0x3671('0x61')]){_0x352807[_0x3671('0x14')][_0xf300e2][_0x3671('0x30')]+=0x1;_0x352807[_0x3671('0x14')][_0xf300e2][_0x3671('0x32')]+=moment(_0x2cf433[_0x5ba3c3][_0x16119c][_0x3671('0x62')])[_0x3671('0x60')](moment(_0x2cf433[_0x5ba3c3][_0x16119c][_0x3671('0x5b')]),_0x3671('0x5d'))||0x0;}}else{_0x352807[_0x3671('0x14')][_0xf300e2]['sumDuration']+=_0x352807['voiceQueues'][_0xf300e2]['sumHoldTime']||0x0;}}}}}}return _0x352807[_0x3671('0x14')];};};Realtime[_0x3671('0x3e')][_0x3671('0x63')]=function(){var _0x45f1d6=this;return function(_0x16c992){clearVoiceCallReports(_0x45f1d6[_0x3671('0x64')]);if(_0x16c992){for(var _0xd9658e=0x0;_0xd9658e<_0x16c992[_0x3671('0x40')];_0xd9658e+=0x1){_0x45f1d6[_0x3671('0x64')][_0x3671('0x2b')]+=0x1;_0x45f1d6[_0x3671('0x64')][_0x3671('0x65')]+=_0x16c992[_0xd9658e]['duration'];if(_0x16c992[_0xd9658e]['disposition']===_0x3671('0x66')){_0x45f1d6[_0x3671('0x64')]['answered']+=0x1;_0x45f1d6[_0x3671('0x64')]['sumHoldTime']+=_0x16c992[_0xd9658e]['duration']-_0x16c992[_0xd9658e][_0x3671('0x67')]||0x0;_0x45f1d6[_0x3671('0x64')][_0x3671('0x32')]+=_0x16c992[_0xd9658e][_0x3671('0x67')];}}}return _0x45f1d6[_0x3671('0x64')];};};Realtime[_0x3671('0x3e')][_0x3671('0x68')]=function(){var _0x1dfd1a=this;return function(_0x186413){if(_0x186413){freeIsNotKey(_0x186413,_0x1dfd1a[_0x3671('0x16')],_0x3671('0x2a'));for(var _0x30e39b=0x0,_0xbdfde4={};_0x30e39b<_0x186413[_0x3671('0x40')];_0x30e39b+=0x1){_0xbdfde4=_0x186413[_0x30e39b];if(_['isUndefined'](_0x1dfd1a[_0x3671('0x16')][_0xbdfde4[_0x3671('0x2a')]])){_0x1dfd1a[_0x3671('0x16')][_0xbdfde4[_0x3671('0x2a')]]=new Campaign(_0xbdfde4);}else{_0x1dfd1a[_0x3671('0x3f')](_0x1dfd1a[_0x3671('0x16')][_0xbdfde4[_0x3671('0x2a')]],_0xbdfde4);_0x1dfd1a[_0x3671('0x16')][_0xbdfde4['name']][_0x3671('0x69')]=_0xbdfde4[_0x3671('0x6a')]?_0xbdfde4['SquareProject'][_0x3671('0x2a')]:undefined;}}}return _0x1dfd1a['campaigns'];};};Realtime[_0x3671('0x3e')][_0x3671('0x6b')]=function(){var _0x2aeea0=this;return function(_0x459f35){if(_0x459f35){freeIsNotKey(_0x459f35,_0x2aeea0[_0x3671('0x18')],'id');for(var _0x268044=0x0,_0x2bedb5={};_0x268044<_0x459f35[_0x3671('0x40')];_0x268044+=0x1){_0x2bedb5=_0x459f35[_0x268044];if(_[_0x3671('0x41')](_0x2aeea0['voiceExtensions'][_0x2bedb5['id']])){_0x2aeea0[_0x3671('0x18')][_0x2bedb5['id']]=new VoiceExtension(_0x2bedb5);}else{_0x2aeea0[_0x3671('0x3f')](_0x2aeea0[_0x3671('0x18')][_0x2bedb5['id']],_0x2bedb5);}}}return _0x2aeea0[_0x3671('0x18')];};};Realtime[_0x3671('0x3e')][_0x3671('0x6c')]=function(){var _0x386f4e=this;return function(_0x4bcaca){clearCampaigns(_0x386f4e[_0x3671('0x16')]);for(var _0x192ef0=0x0;_0x192ef0<_0x4bcaca[_0x3671('0x40')];_0x192ef0+=0x1){_[_0x3671('0x53')](_0x386f4e[_0x3671('0x16')][_0x4bcaca[_0x192ef0][_0x3671('0x2a')]],_0x4bcaca[_0x192ef0]);}return _0x386f4e[_0x3671('0x16')];};};Realtime[_0x3671('0x3e')][_0x3671('0x6d')]=function(){var _0x4a9c70=this;return function(_0x2e2fe){if(_0x2e2fe){freeIsNotKey(_0x2e2fe,_0x4a9c70[_0x3671('0x23')],'id');for(var _0x1f7f0f=0x0,_0x3e2be1={},_0x2b0b95={};_0x1f7f0f<_0x2e2fe['length'];_0x1f7f0f+=0x1){_0x3e2be1=_0x2e2fe[_0x1f7f0f];if(_[_0x3671('0x41')](_0x4a9c70[_0x3671('0x23')][_0x3e2be1['id']])){_0x4a9c70['faxAccounts'][_0x3e2be1['id']]=new FaxAccount(_0x3e2be1);}else{_0x4a9c70[_0x3671('0x3f')](_0x4a9c70[_0x3671('0x23')][_0x3e2be1['id']],_0x3e2be1);}}}return _0x4a9c70['faxAccounts'];};};module[_0x3671('0x6e')]=Realtime;
\ No newline at end of file
diff --git a/server/services/ami/report/index.js b/server/services/ami/report/index.js
index b603491..41f1750 100644
--- a/server/services/ami/report/index.js
+++ b/server/services/ami/report/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xde46=['voiceQueueReport','custom:voiceCallReport','bind','voiceAgentReport','voiceDialReport','blindtransfer','blindTransfer','findAgent','find','accountcode','name','telephones','interface','SIP/%s','assigned','isNil','format','queuecallercomplete','queuecallercompleteAt','YYYY-MM-DD\x20HH:mm:ss','queuecallerexit','queuecallerexitAt','match','destination','dialer','lastapplication','queue','context','calleridpreview','calleridnum','originatecalleridnum','destinationchannel','channel','callerid','disposition','ANSWERED','connectedlinenum','\x22%s\x22\x20<%s>','calleridname','create','monitor','monitors','length','filename','createdAt','exten','xcally-motion-preview','connectedlinename','membername','xcally-motion-dialer','isArray','forEach','startsWith','Local','substring','indexOf','phone','lastIndexOf','attendedTransfer','exports','lodash','../../../config/environment','../../../config/logger','ami','../ami','../rpc/voiceAgentReport','../rpc/voiceCallReport','../rpc/voiceRecording','../rpc/voiceTransferReport','./voiceCallReport','./voiceAgentReport','./voiceDialReport','./userReport','realtime','agents','prototype','sync','xdr','disabled','custom:voiceQueueReport'];(function(_0x5aa27f,_0x2d93b8){var _0x531dc7=function(_0x27d694){while(--_0x27d694){_0x5aa27f['push'](_0x5aa27f['shift']());}};_0x531dc7(++_0x2d93b8);}(_0xde46,0x1cc));var _0x6de4=function(_0xb8fdc7,_0x3a98e8){_0xb8fdc7=_0xb8fdc7-0x0;var _0x5f5148=_0xde46[_0xb8fdc7];return _0x5f5148;};'use strict';var BPromise=require('bluebird');var _=require(_0x6de4('0x0'));var moment=require('moment');var util=require('util');var config=require(_0x6de4('0x1'));var logger=require(_0x6de4('0x2'))(_0x6de4('0x3'));var ami=require(_0x6de4('0x4'));var RpcVoiceAgentReport=require(_0x6de4('0x5'));var RpcVoiceCallReport=require(_0x6de4('0x6'));var RpcVoiceDialReport=require('../rpc/voiceDialReport');var RpcMemberReport=require('../rpc/memberReport');var RpcVoiceQueueReport=require('../rpc/voiceQueueReport');var RpcVoiceRecording=require(_0x6de4('0x7'));var RpcVoiceTransferReport=require(_0x6de4('0x8'));var VoiceQueueReport=require('./voiceQueueReport');var VoiceCallReport=require(_0x6de4('0x9'));var VoiceAgentReport=require(_0x6de4('0xa'));var VoiceDialReport=require(_0x6de4('0xb'));var UserReport=require(_0x6de4('0xc'));function Report(_0x2335d6){this[_0x6de4('0xd')]=_0x2335d6;this[_0x6de4('0xe')]=_0x2335d6[_0x6de4('0xe')];this['telephones']=_0x2335d6['telephones'];}Report[_0x6de4('0xf')][_0x6de4('0x10')]=function(_0x430d74){var _0x3013e0=new VoiceQueueReport(this[_0x6de4('0xd')]);var _0x34667b=new VoiceAgentReport(this[_0x6de4('0xd')]);var _0x2dc4e2=new VoiceDialReport(this[_0x6de4('0xd')]);var _0x32bc49=new VoiceCallReport(this['realtime']);var _0x34b776=new UserReport(this[_0x6de4('0xd')]);if(config[_0x6de4('0x11')]&&config[_0x6de4('0x11')][_0x6de4('0x12')]){ami['on'](_0x6de4('0x13'),this[_0x6de4('0x14')]['bind'](this));ami['on'](_0x6de4('0x15'),this['voiceCallReport'][_0x6de4('0x16')](this));ami['on']('custom:voiceAgentReport',this[_0x6de4('0x17')][_0x6de4('0x16')](this));ami['on']('custom:voiceDialReport',this[_0x6de4('0x18')]['bind'](this));ami['on'](_0x6de4('0x19'),this[_0x6de4('0x1a')]['bind'](this));ami['on']('attendedtransfer',this['attendedTransfer']['bind'](this));}};Report[_0x6de4('0xf')][_0x6de4('0x1b')]=function(_0x4045a8){var _0x106ec9=undefined;_0x106ec9=_[_0x6de4('0x1c')](this['agents'],function(_0x33d36d){return _0x33d36d[_0x6de4('0x1d')]==_0x4045a8||_0x33d36d[_0x6de4('0x1e')]==_0x4045a8;});if(_['isNil'](_0x106ec9)){var _0x7c5e9d=_['find'](this[_0x6de4('0x1f')],function(_0x5c1bd8){return _0x5c1bd8[_0x6de4('0x1d')]==_0x4045a8||_0x5c1bd8['name']==_0x4045a8;});if(_0x7c5e9d){_0x106ec9=_[_0x6de4('0x1c')](this[_0x6de4('0xe')],function(_0x23a564){return _0x23a564[_0x6de4('0x20')]==util['format'](_0x6de4('0x21'),_0x7c5e9d[_0x6de4('0x1e')]);});}}return _0x106ec9;};Report[_0x6de4('0xf')][_0x6de4('0x14')]=function(_0x1c353e){for(var _0x58acdf=0x0;_0x58acdf<_0x1c353e['length'];_0x58acdf+=0x1){var _0x56e15a=this[_0x6de4('0x1b')](_0x1c353e[_0x58acdf]['connectedlinenum']);if(_0x56e15a){_0x1c353e[_0x58acdf][_0x6de4('0x1d')]=_0x56e15a[_0x6de4('0x1d')];_0x1c353e[_0x58acdf][_0x6de4('0x22')]=!![];_0x1c353e[_0x58acdf]['lastAssignedTo']=_0x56e15a[_0x6de4('0x1e')];_0x1c353e[_0x58acdf][_0x6de4('0x20')]=_[_0x6de4('0x23')](_0x56e15a[_0x6de4('0x20')])?util[_0x6de4('0x24')](_0x6de4('0x21'),_0x56e15a['name']):_0x56e15a[_0x6de4('0x20')];if(_0x1c353e[_0x58acdf][_0x6de4('0x25')]){_0x1c353e[_0x58acdf][_0x6de4('0x26')]=moment()[_0x6de4('0x24')](_0x6de4('0x27'));}if(_0x1c353e[_0x58acdf][_0x6de4('0x28')]){_0x1c353e[_0x58acdf][_0x6de4('0x29')]=moment()[_0x6de4('0x24')](_0x6de4('0x27'));}RpcMemberReport[_0x6de4('0x14')](_0x1c353e[_0x58acdf]);}RpcVoiceQueueReport['create'](_0x1c353e[_0x58acdf]);}};function extractCalleridNumber(_0x720d52){var _0x29898a=_0x720d52[_0x6de4('0x2a')](/<(.*?)>/);return _0x29898a?_0x29898a[0x1]:_0x720d52;}Report['prototype']['voiceCallReport']=function(_0x14db4b){_0x14db4b['destination']=_0x14db4b[_0x6de4('0x2b')]||_0x14db4b['exten'];if(_0x14db4b['type']==_0x6de4('0x2c')){_0x14db4b[_0x6de4('0x2d')]=_0x6de4('0x2e');_0x14db4b['lastdata']=_0x14db4b[_0x6de4('0x2e')];if(_0x14db4b[_0x6de4('0x2f')]=='from-voip-provider'){_0x14db4b[_0x6de4('0x1d')]='';_0x14db4b[_0x6de4('0x2b')]=extractCalleridNumber(_0x14db4b['callerid']);}else if(_0x14db4b[_0x6de4('0x2f')]=='from-sip'){if(_0x14db4b['destination']=='xcally-motion-preview'){_0x14db4b[_0x6de4('0x2b')]=extractCalleridNumber(_0x14db4b[_0x6de4('0x30')]);_0x14db4b[_0x6de4('0x31')]=_0x14db4b[_0x6de4('0x32')];_0x14db4b[_0x6de4('0x33')]=[_0x14db4b[_0x6de4('0x34')],_0x14db4b['channel']=_0x14db4b[_0x6de4('0x33')]][0x0];_0x14db4b[_0x6de4('0x35')]=_0x14db4b['calleridpreview'];}else{_0x14db4b[_0x6de4('0x2b')]=_0x14db4b[_0x6de4('0x31')];_0x14db4b[_0x6de4('0x31')]=_0x14db4b['originatecalleridnum'];if(_0x14db4b[_0x6de4('0x36')]==_0x6de4('0x37')){_0x14db4b['accountcode']=_0x14db4b[_0x6de4('0x38')];}else{_0x14db4b[_0x6de4('0x1d')]='';}}}}else{_0x14db4b[_0x6de4('0x35')]=util['format'](_0x6de4('0x39'),_0x14db4b[_0x6de4('0x3a')],_0x14db4b['calleridnum']);}RpcVoiceCallReport[_0x6de4('0x3b')](_0x14db4b);if(_0x14db4b[_0x6de4('0x3c')]){for(var _0x278fe3=0x0;_0x278fe3<_0x14db4b[_0x6de4('0x3d')][_0x6de4('0x3e')];_0x278fe3+=0x1){_0x14db4b['monitorFilename']=_0x14db4b['monitors'][_0x278fe3][_0x6de4('0x3f')];_0x14db4b['createdAt']=_0x14db4b['monitors'][_0x278fe3][_0x6de4('0x40')];if(_0x14db4b[_0x6de4('0x41')]==_0x6de4('0x42')){_0x14db4b[_0x6de4('0x31')]=_0x14db4b['connectedlinenum'];_0x14db4b['calleridname']=_0x14db4b[_0x6de4('0x43')];_0x14db4b[_0x6de4('0x38')]=_0x14db4b[_0x6de4('0x1d')];_0x14db4b['connectedlinename']=_0x14db4b[_0x6de4('0x44')];_0x14db4b['exten']=_0x14db4b[_0x6de4('0x32')];}else if(_0x14db4b['exten']==_0x6de4('0x45')){_0x14db4b[_0x6de4('0x31')]=_0x14db4b[_0x6de4('0x2b')];_0x14db4b[_0x6de4('0x41')]=_0x14db4b['originatecalleridnum'];}RpcVoiceRecording[_0x6de4('0x3b')](_0x14db4b);}}};Report[_0x6de4('0xf')][_0x6de4('0x17')]=function(_0x13659d){if(_[_0x6de4('0x46')](_0x13659d)){_0x13659d[_0x6de4('0x47')](function(_0x3808b1){RpcVoiceAgentReport[_0x6de4('0x3b')](_0x3808b1);});}else{RpcVoiceAgentReport[_0x6de4('0x3b')](_0x13659d);}};Report['prototype'][_0x6de4('0x18')]=function(_0x1c2082){RpcVoiceDialReport[_0x6de4('0x3b')](_0x1c2082);var _0x8a8c37=undefined;var _0x661ad8=_0x1c2082['channel'];if(_[_0x6de4('0x48')](_0x661ad8,_0x6de4('0x49'))){var _0x46c135=_0x661ad8[_0x6de4('0x4a')](_0x661ad8[_0x6de4('0x4b')]('/')+0x1,_0x661ad8[_0x6de4('0x4b')]('@'));_0x8a8c37=_[_0x6de4('0x1c')](this['agents'],function(_0x1f6292){return _0x1f6292['mobile']==_0x46c135||_0x1f6292[_0x6de4('0x4c')]==_0x46c135||_0x1f6292[_0x6de4('0x1d')]==_0x46c135;});}else{var _0x46c135=_0x661ad8[_0x6de4('0x4a')](_0x661ad8[_0x6de4('0x4b')]('/')+0x1,_0x661ad8[_0x6de4('0x4d')]('-'));_0x8a8c37=this[_0x6de4('0x1b')](_0x46c135);}if(_0x8a8c37){_0x1c2082['interface']=_[_0x6de4('0x23')](_0x8a8c37[_0x6de4('0x20')])?util[_0x6de4('0x24')](_0x6de4('0x21'),_0x8a8c37[_0x6de4('0x1e')]):_0x8a8c37[_0x6de4('0x20')];_0x1c2082[_0x6de4('0x44')]=_0x8a8c37[_0x6de4('0x1e')];_0x1c2082[_0x6de4('0x1d')]=_0x8a8c37[_0x6de4('0x1d')];RpcMemberReport[_0x6de4('0x18')](_0x1c2082);}};Report[_0x6de4('0xf')][_0x6de4('0x1a')]=function(_0x5dcffc){RpcVoiceTransferReport[_0x6de4('0x1a')](_0x5dcffc);};Report[_0x6de4('0xf')][_0x6de4('0x4e')]=function(_0x29548b){RpcVoiceTransferReport[_0x6de4('0x4e')](_0x29548b);};module[_0x6de4('0x4f')]=Report;
\ No newline at end of file
+var _0x00f2=['format','SIP/%s','length','connectedlinenum','assigned','lastAssignedTo','queuecallercompleteAt','YYYY-MM-DD\x20HH:mm:ss','queuecallerexitAt','create','match','destination','exten','dialer','lastapplication','queue','context','from-voip-provider','callerid','from-sip','calleridpreview','originatecalleridnum','destinationchannel','channel','calleridnum','calleridname','monitor','monitors','monitorFilename','filename','createdAt','xcally-motion-preview','connectedlinename','membername','xcally-motion-dialer','voiceAgentReport','isArray','forEach','startsWith','Local','substring','indexOf','mobile','phone','lastIndexOf','exports','bluebird','lodash','moment','util','../../../config/environment','../../../config/logger','../ami','../rpc/voiceAgentReport','../rpc/voiceDialReport','../rpc/memberReport','../rpc/voiceQueueReport','../rpc/voiceRecording','../rpc/voiceTransferReport','./voiceQueueReport','./voiceDialReport','./userReport','realtime','agents','telephones','prototype','sync','xdr','disabled','custom:voiceQueueReport','voiceQueueReport','voiceCallReport','bind','custom:voiceAgentReport','custom:voiceDialReport','voiceDialReport','blindTransfer','attendedtransfer','attendedTransfer','findAgent','find','accountcode','name','isNil','interface'];(function(_0x373dee,_0x1a8c45){var _0x46798f=function(_0xc389f0){while(--_0xc389f0){_0x373dee['push'](_0x373dee['shift']());}};_0x46798f(++_0x1a8c45);}(_0x00f2,0x182));var _0x200f=function(_0xda4532,_0x4af293){_0xda4532=_0xda4532-0x0;var _0x58b32e=_0x00f2[_0xda4532];return _0x58b32e;};'use strict';var BPromise=require(_0x200f('0x0'));var _=require(_0x200f('0x1'));var moment=require(_0x200f('0x2'));var util=require(_0x200f('0x3'));var config=require(_0x200f('0x4'));var logger=require(_0x200f('0x5'))('ami');var ami=require(_0x200f('0x6'));var RpcVoiceAgentReport=require(_0x200f('0x7'));var RpcVoiceCallReport=require('../rpc/voiceCallReport');var RpcVoiceDialReport=require(_0x200f('0x8'));var RpcMemberReport=require(_0x200f('0x9'));var RpcVoiceQueueReport=require(_0x200f('0xa'));var RpcVoiceRecording=require(_0x200f('0xb'));var RpcVoiceTransferReport=require(_0x200f('0xc'));var VoiceQueueReport=require(_0x200f('0xd'));var VoiceCallReport=require('./voiceCallReport');var VoiceAgentReport=require('./voiceAgentReport');var VoiceDialReport=require(_0x200f('0xe'));var UserReport=require(_0x200f('0xf'));function Report(_0x3b725c){this[_0x200f('0x10')]=_0x3b725c;this[_0x200f('0x11')]=_0x3b725c[_0x200f('0x11')];this['telephones']=_0x3b725c[_0x200f('0x12')];}Report[_0x200f('0x13')][_0x200f('0x14')]=function(_0xef4454){var _0x3c829d=new VoiceQueueReport(this[_0x200f('0x10')]);var _0x4008b1=new VoiceAgentReport(this['realtime']);var _0x13f4e9=new VoiceDialReport(this[_0x200f('0x10')]);var _0x667119=new VoiceCallReport(this[_0x200f('0x10')]);var _0x3d5438=new UserReport(this[_0x200f('0x10')]);if(config['xdr']&&config[_0x200f('0x15')][_0x200f('0x16')]){ami['on'](_0x200f('0x17'),this[_0x200f('0x18')]['bind'](this));ami['on']('custom:voiceCallReport',this[_0x200f('0x19')][_0x200f('0x1a')](this));ami['on'](_0x200f('0x1b'),this['voiceAgentReport'][_0x200f('0x1a')](this));ami['on'](_0x200f('0x1c'),this[_0x200f('0x1d')][_0x200f('0x1a')](this));ami['on']('blindtransfer',this[_0x200f('0x1e')]['bind'](this));ami['on'](_0x200f('0x1f'),this[_0x200f('0x20')]['bind'](this));}};Report[_0x200f('0x13')][_0x200f('0x21')]=function(_0x146419){var _0x5d6697=undefined;_0x5d6697=_[_0x200f('0x22')](this[_0x200f('0x11')],function(_0x5ce36d){return _0x5ce36d[_0x200f('0x23')]==_0x146419||_0x5ce36d[_0x200f('0x24')]==_0x146419;});if(_[_0x200f('0x25')](_0x5d6697)){var _0x235752=_[_0x200f('0x22')](this[_0x200f('0x12')],function(_0x324c97){return _0x324c97['accountcode']==_0x146419||_0x324c97[_0x200f('0x24')]==_0x146419;});if(_0x235752){_0x5d6697=_['find'](this[_0x200f('0x11')],function(_0x8a2157){return _0x8a2157[_0x200f('0x26')]==util[_0x200f('0x27')](_0x200f('0x28'),_0x235752[_0x200f('0x24')]);});}}return _0x5d6697;};Report[_0x200f('0x13')][_0x200f('0x18')]=function(_0x31892f){for(var _0x3db4a9=0x0;_0x3db4a9<_0x31892f[_0x200f('0x29')];_0x3db4a9+=0x1){var _0xf372ef=this['findAgent'](_0x31892f[_0x3db4a9][_0x200f('0x2a')]);if(_0xf372ef){_0x31892f[_0x3db4a9][_0x200f('0x23')]=_0xf372ef[_0x200f('0x23')];_0x31892f[_0x3db4a9][_0x200f('0x2b')]=!![];_0x31892f[_0x3db4a9][_0x200f('0x2c')]=_0xf372ef[_0x200f('0x24')];_0x31892f[_0x3db4a9][_0x200f('0x26')]=_[_0x200f('0x25')](_0xf372ef['interface'])?util['format']('SIP/%s',_0xf372ef[_0x200f('0x24')]):_0xf372ef[_0x200f('0x26')];if(_0x31892f[_0x3db4a9]['queuecallercomplete']){_0x31892f[_0x3db4a9][_0x200f('0x2d')]=moment()['format'](_0x200f('0x2e'));}if(_0x31892f[_0x3db4a9]['queuecallerexit']){_0x31892f[_0x3db4a9][_0x200f('0x2f')]=moment()['format'](_0x200f('0x2e'));}RpcMemberReport[_0x200f('0x18')](_0x31892f[_0x3db4a9]);}RpcVoiceQueueReport[_0x200f('0x30')](_0x31892f[_0x3db4a9]);}};function extractCalleridNumber(_0x27dd25){var _0x4397f0=_0x27dd25[_0x200f('0x31')](/<(.*?)>/);return _0x4397f0?_0x4397f0[0x1]:_0x27dd25;}Report[_0x200f('0x13')][_0x200f('0x19')]=function(_0x2b10ba){_0x2b10ba[_0x200f('0x32')]=_0x2b10ba[_0x200f('0x32')]||_0x2b10ba[_0x200f('0x33')];if(_0x2b10ba['type']==_0x200f('0x34')){_0x2b10ba[_0x200f('0x35')]=_0x200f('0x36');_0x2b10ba['lastdata']=_0x2b10ba[_0x200f('0x36')];if(_0x2b10ba[_0x200f('0x37')]==_0x200f('0x38')){_0x2b10ba[_0x200f('0x23')]='';_0x2b10ba[_0x200f('0x32')]=extractCalleridNumber(_0x2b10ba[_0x200f('0x39')]);}else if(_0x2b10ba[_0x200f('0x37')]==_0x200f('0x3a')){if(_0x2b10ba[_0x200f('0x32')]=='xcally-motion-preview'){_0x2b10ba[_0x200f('0x32')]=extractCalleridNumber(_0x2b10ba[_0x200f('0x3b')]);_0x2b10ba['calleridnum']=_0x2b10ba[_0x200f('0x3c')];_0x2b10ba[_0x200f('0x3d')]=[_0x2b10ba[_0x200f('0x3e')],_0x2b10ba[_0x200f('0x3e')]=_0x2b10ba[_0x200f('0x3d')]][0x0];_0x2b10ba[_0x200f('0x39')]=_0x2b10ba['calleridpreview'];}else{_0x2b10ba[_0x200f('0x32')]=_0x2b10ba[_0x200f('0x3f')];_0x2b10ba[_0x200f('0x3f')]=_0x2b10ba[_0x200f('0x3c')];if(_0x2b10ba['disposition']=='ANSWERED'){_0x2b10ba[_0x200f('0x23')]=_0x2b10ba[_0x200f('0x2a')];}else{_0x2b10ba[_0x200f('0x23')]='';}}}}else{_0x2b10ba[_0x200f('0x39')]=util[_0x200f('0x27')]('\x22%s\x22\x20<%s>',_0x2b10ba[_0x200f('0x40')],_0x2b10ba[_0x200f('0x3f')]);}RpcVoiceCallReport[_0x200f('0x30')](_0x2b10ba);if(_0x2b10ba[_0x200f('0x41')]){for(var _0x365f7f=0x0;_0x365f7f<_0x2b10ba[_0x200f('0x42')][_0x200f('0x29')];_0x365f7f+=0x1){_0x2b10ba[_0x200f('0x43')]=_0x2b10ba[_0x200f('0x42')][_0x365f7f][_0x200f('0x44')];_0x2b10ba[_0x200f('0x45')]=_0x2b10ba['monitors'][_0x365f7f][_0x200f('0x45')];if(_0x2b10ba[_0x200f('0x33')]==_0x200f('0x46')){_0x2b10ba[_0x200f('0x3f')]=_0x2b10ba[_0x200f('0x2a')];_0x2b10ba[_0x200f('0x40')]=_0x2b10ba[_0x200f('0x47')];_0x2b10ba[_0x200f('0x2a')]=_0x2b10ba['accountcode'];_0x2b10ba[_0x200f('0x47')]=_0x2b10ba[_0x200f('0x48')];_0x2b10ba[_0x200f('0x33')]=_0x2b10ba['originatecalleridnum'];}else if(_0x2b10ba[_0x200f('0x33')]==_0x200f('0x49')){_0x2b10ba[_0x200f('0x3f')]=_0x2b10ba['destination'];_0x2b10ba[_0x200f('0x33')]=_0x2b10ba[_0x200f('0x3c')];}RpcVoiceRecording[_0x200f('0x30')](_0x2b10ba);}}};Report['prototype'][_0x200f('0x4a')]=function(_0x360801){if(_[_0x200f('0x4b')](_0x360801)){_0x360801[_0x200f('0x4c')](function(_0x45ccf0){RpcVoiceAgentReport['create'](_0x45ccf0);});}else{RpcVoiceAgentReport[_0x200f('0x30')](_0x360801);}};Report[_0x200f('0x13')][_0x200f('0x1d')]=function(_0x2b4189){RpcVoiceDialReport['create'](_0x2b4189);var _0x150746=undefined;var _0x35f12a=_0x2b4189[_0x200f('0x3e')];if(_[_0x200f('0x4d')](_0x35f12a,_0x200f('0x4e'))){var _0xb0f04c=_0x35f12a[_0x200f('0x4f')](_0x35f12a['indexOf']('/')+0x1,_0x35f12a[_0x200f('0x50')]('@'));_0x150746=_[_0x200f('0x22')](this[_0x200f('0x11')],function(_0x3f6cc9){return _0x3f6cc9[_0x200f('0x51')]==_0xb0f04c||_0x3f6cc9[_0x200f('0x52')]==_0xb0f04c||_0x3f6cc9[_0x200f('0x23')]==_0xb0f04c;});}else{var _0xb0f04c=_0x35f12a[_0x200f('0x4f')](_0x35f12a[_0x200f('0x50')]('/')+0x1,_0x35f12a[_0x200f('0x53')]('-'));_0x150746=this[_0x200f('0x21')](_0xb0f04c);}if(_0x150746){_0x2b4189[_0x200f('0x26')]=_[_0x200f('0x25')](_0x150746[_0x200f('0x26')])?util['format']('SIP/%s',_0x150746['name']):_0x150746[_0x200f('0x26')];_0x2b4189['membername']=_0x150746[_0x200f('0x24')];_0x2b4189['accountcode']=_0x150746[_0x200f('0x23')];RpcMemberReport['voiceDialReport'](_0x2b4189);}};Report['prototype'][_0x200f('0x1e')]=function(_0x78194f){RpcVoiceTransferReport[_0x200f('0x1e')](_0x78194f);};Report['prototype'][_0x200f('0x20')]=function(_0x50f006){RpcVoiceTransferReport[_0x200f('0x20')](_0x50f006);};module[_0x200f('0x54')]=Report;
\ No newline at end of file
diff --git a/server/services/ami/report/userReport.js b/server/services/ami/report/userReport.js
index 3c1e1b9..16e83a9 100644
--- a/server/services/ami/report/userReport.js
+++ b/server/services/ami/report/userReport.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x3485=['format','trunk:%s','name','trunk:save','[syncRegistry][UserReport]','inspect','syncDeviceState','device','local','inuse','toLowerCase','stateTime','toNumber','updateStatusRealtime','telephone:%s','telephone:save','startsWith','Queue','Local','substring','indexOf','mobile','phone','accountcode','[syncDeviceState][UserReport]','peer','registered','status','address','exports','lodash','moment','util','ioredis','../../../config/environment','../../../config/logger','ami','../ami','redis','defaults','localhost','socket.io-emitter','trunks','agents','telephones','syncRegistry','bind','devicestatechange','peerstatus','syncPeerStatus','loopSyncRealTimeShow','actionSipShowRegistry','then','actionDeviceStateList','actionSipPeerStatus','catch','error','prototype','resolve','[loopSyncRealTimeShow]','isNotNull','emit','find','username','state','merge','actionid'];(function(_0x220dbb,_0x99328d){var _0x2b77de=function(_0x15e966){while(--_0x15e966){_0x220dbb['push'](_0x220dbb['shift']());}};_0x2b77de(++_0x99328d);}(_0x3485,0x1f3));var _0x5348=function(_0x39c697,_0x139e0e){_0x39c697=_0x39c697-0x0;var _0x5ac429=_0x3485[_0x39c697];return _0x5ac429;};'use strict';var _=require(_0x5348('0x0'));var moment=require(_0x5348('0x1'));var BPromise=require('bluebird');var util=require(_0x5348('0x2'));var Redis=require(_0x5348('0x3'));var config=require(_0x5348('0x4'));var logger=require(_0x5348('0x5'))(_0x5348('0x6'));var ami=require(_0x5348('0x7'));config[_0x5348('0x8')]=_[_0x5348('0x9')](config[_0x5348('0x8')],{'host':_0x5348('0xa'),'port':0x18eb});var io=require(_0x5348('0xb'))(new Redis(config[_0x5348('0x8')]));function UserReport(_0x7f868b){this[_0x5348('0xc')]=_0x7f868b[_0x5348('0xc')];this[_0x5348('0xd')]=_0x7f868b[_0x5348('0xd')];this[_0x5348('0xe')]=_0x7f868b[_0x5348('0xe')];ami['on']('registryentry',this[_0x5348('0xf')][_0x5348('0x10')](this));ami['on']('registry',this[_0x5348('0xf')][_0x5348('0x10')](this));ami['on'](_0x5348('0x11'),this['syncDeviceState'][_0x5348('0x10')](this));ami['on'](_0x5348('0x12'),this[_0x5348('0x13')][_0x5348('0x10')](this));this[_0x5348('0x14')]();return BPromise['resolve']()['then'](ami[_0x5348('0x15')]())[_0x5348('0x16')](ami[_0x5348('0x17')]())[_0x5348('0x16')](ami[_0x5348('0x18')]())[_0x5348('0x19')](loggerCatch('[loopSyncRealTimeShow]'));}function loggerCatch(_0x511d07){return function(_0x5b990f){logger[_0x5348('0x1a')](_0x511d07,util['inspect'](_0x5b990f,{'showHidden':![],'depth':null}));};}UserReport[_0x5348('0x1b')]['loopSyncRealTimeShow']=function(){setInterval(function(){BPromise[_0x5348('0x1c')]()[_0x5348('0x16')](ami[_0x5348('0x15')]())[_0x5348('0x16')](ami['actionDeviceStateList']())[_0x5348('0x16')](ami['actionSipPeerStatus']())[_0x5348('0x19')](loggerCatch(_0x5348('0x1d')));},0x32c8);};UserReport[_0x5348('0x1b')][_0x5348('0x1e')]=function(_0x14450c){return _0x14450c!==null&&!_['isUndefined'](_0x14450c);};UserReport['prototype'][_0x5348('0x1f')]=function(_0x96062c,_0x126e9c,_0xe16676){io['to'](_0x96062c)[_0x5348('0x1f')](_0x126e9c,_0xe16676);};UserReport[_0x5348('0x1b')]['syncRegistry']=function(_0x4cd14d){try{if(this[_0x5348('0x1e')](_0x4cd14d)){var _0x1e91c5=_[_0x5348('0x20')](this[_0x5348('0xc')],{'registry':_0x4cd14d[_0x5348('0x21')]});if(_0x1e91c5){_0x4cd14d['stateRegistry']=_0x4cd14d[_0x5348('0x22')];_[_0x5348('0x23')](_0x1e91c5,_['omit'](_0x4cd14d,['event',_0x5348('0x24'),_0x5348('0x21'),_0x5348('0x22')]));this[_0x5348('0x1f')](util[_0x5348('0x25')](_0x5348('0x26'),_0x1e91c5[_0x5348('0x27')]),_0x5348('0x28'),_0x1e91c5);}}}catch(_0x3aad2a){logger['error'](_0x5348('0x29'),util[_0x5348('0x2a')](_0x3aad2a,{'showHidden':![],'depth':null}));}};UserReport['prototype'][_0x5348('0x2b')]=function(_0x44ac91){try{if(this[_0x5348('0x1e')](_0x44ac91)){if(this[_0x5348('0xd')][_0x44ac91[_0x5348('0x2c')]]){if(!this[_0x5348('0xd')][_0x44ac91[_0x5348('0x2c')]][_0x5348('0x2d')]||_0x44ac91['state']['toLowerCase']()==_0x5348('0x2e')){this[_0x5348('0xd')][_0x44ac91[_0x5348('0x2c')]][_0x5348('0x2d')]=![];if(this[_0x5348('0xd')][_0x44ac91['device']][_0x5348('0x22')]!==_0x44ac91[_0x5348('0x22')][_0x5348('0x2f')]()){this['agents'][_0x44ac91[_0x5348('0x2c')]][_0x5348('0x30')]=_[_0x5348('0x31')](moment()[_0x5348('0x25')]('x'));}this['agents'][_0x44ac91[_0x5348('0x2c')]][_0x5348('0x22')]=_0x44ac91[_0x5348('0x22')][_0x5348('0x2f')]();this['agents'][_0x44ac91[_0x5348('0x2c')]][_0x5348('0x32')](_0x44ac91);}}else if(this['telephones'][_0x44ac91[_0x5348('0x2c')]]){if(this[_0x5348('0xe')][_0x44ac91[_0x5348('0x2c')]][_0x5348('0x22')]!==_0x44ac91[_0x5348('0x22')][_0x5348('0x2f')]()){this[_0x5348('0xe')][_0x44ac91[_0x5348('0x2c')]][_0x5348('0x30')]=_[_0x5348('0x31')](moment()[_0x5348('0x25')]('x'));}this[_0x5348('0xe')][_0x44ac91[_0x5348('0x2c')]]['state']=_0x44ac91[_0x5348('0x22')]['toLowerCase']();this[_0x5348('0x1f')](util[_0x5348('0x25')](_0x5348('0x33'),this['telephones'][_0x44ac91[_0x5348('0x2c')]][_0x5348('0x27')]),_0x5348('0x34'),this[_0x5348('0xe')][_0x44ac91[_0x5348('0x2c')]]);}else if(this['trunks'][_0x44ac91[_0x5348('0x2c')]]){if(this[_0x5348('0xc')][_0x44ac91[_0x5348('0x2c')]][_0x5348('0x22')]!==_0x44ac91[_0x5348('0x22')]['toLowerCase']()){this['trunks'][_0x44ac91['device']][_0x5348('0x30')]=_['toNumber'](moment()['format']('x'));}this[_0x5348('0xc')][_0x44ac91[_0x5348('0x2c')]][_0x5348('0x22')]=_0x44ac91[_0x5348('0x22')][_0x5348('0x2f')]();this[_0x5348('0x1f')](util[_0x5348('0x25')](_0x5348('0x26'),this['trunks'][_0x44ac91[_0x5348('0x2c')]][_0x5348('0x27')]),_0x5348('0x28'),this[_0x5348('0xc')][_0x44ac91['device']]);}else if(_[_0x5348('0x35')](_0x44ac91[_0x5348('0x2c')],_0x5348('0x36'))){}else if(_['startsWith'](_0x44ac91[_0x5348('0x2c')],_0x5348('0x37'))){var _0x40d561=_0x44ac91[_0x5348('0x2c')];var _0x47b100=_0x40d561[_0x5348('0x38')](_0x40d561[_0x5348('0x39')]('/')+0x1,_0x40d561[_0x5348('0x39')]('@'));var _0x45ee1d=_['find'](this[_0x5348('0xd')],function(_0x2df978){return _0x2df978[_0x5348('0x3a')]==_0x47b100||_0x2df978[_0x5348('0x3b')]==_0x47b100||_0x2df978[_0x5348('0x3c')]==_0x47b100;});if(_0x45ee1d){if(_0x45ee1d[_0x5348('0x22')]!==_0x44ac91[_0x5348('0x22')][_0x5348('0x2f')]()){_0x45ee1d[_0x5348('0x30')]=_[_0x5348('0x31')](moment()[_0x5348('0x25')]('x'));}_0x45ee1d[_0x5348('0x22')]=_0x44ac91[_0x5348('0x22')][_0x5348('0x2f')]();_0x45ee1d['local']=!![];_0x45ee1d['updateStatusRealtime'](_0x44ac91);}}else{}}}catch(_0x4c0130){logger[_0x5348('0x1a')](_0x5348('0x3d'),util[_0x5348('0x2a')](_0x4c0130,{'showHidden':![],'depth':null}));}};UserReport['prototype'][_0x5348('0x13')]=function(_0x53414a){try{if(this[_0x5348('0x1e')](_0x53414a)&&this[_0x5348('0x1e')](_0x53414a['peerstatus'])){if(this[_0x5348('0xd')][_0x53414a[_0x5348('0x3e')]]){if(!this[_0x5348('0xd')][_0x53414a['peer']][_0x5348('0x2d')]||_0x53414a[_0x5348('0x12')][_0x5348('0x2f')]()==_0x5348('0x3f')){this[_0x5348('0xd')][_0x53414a[_0x5348('0x3e')]][_0x5348('0x2d')]=![];this[_0x5348('0xd')][_0x53414a[_0x5348('0x3e')]][_0x5348('0x40')]=_0x53414a[_0x5348('0x12')]['toLowerCase']();this[_0x5348('0xd')][_0x53414a[_0x5348('0x3e')]]['address']=_0x53414a[_0x5348('0x41')];this[_0x5348('0xd')][_0x53414a[_0x5348('0x3e')]][_0x5348('0x32')](_0x53414a);}}else if(this[_0x5348('0xe')][_0x53414a[_0x5348('0x3e')]]){this[_0x5348('0xe')][_0x53414a[_0x5348('0x3e')]][_0x5348('0x40')]=_0x53414a[_0x5348('0x12')][_0x5348('0x2f')]();this[_0x5348('0xe')][_0x53414a[_0x5348('0x3e')]][_0x5348('0x41')]=_0x53414a[_0x5348('0x41')];this['emit'](util['format'](_0x5348('0x33'),this[_0x5348('0xe')][_0x53414a[_0x5348('0x3e')]][_0x5348('0x27')]),_0x5348('0x34'),this[_0x5348('0xe')][_0x53414a[_0x5348('0x3e')]]);}else if(this[_0x5348('0xc')][_0x53414a[_0x5348('0x3e')]]){this[_0x5348('0xc')][_0x53414a[_0x5348('0x3e')]][_0x5348('0x40')]=_0x53414a['peerstatus']['toLowerCase']();this[_0x5348('0xc')][_0x53414a[_0x5348('0x3e')]][_0x5348('0x41')]=_0x53414a[_0x5348('0x41')];this['emit'](util[_0x5348('0x25')](_0x5348('0x26'),this[_0x5348('0xc')][_0x53414a[_0x5348('0x3e')]]['name']),'trunk:save',this[_0x5348('0xc')][_0x53414a['peer']]);}else{}}}catch(_0x37b91f){logger[_0x5348('0x1a')]('[syncPeerStatus][UserReport]',util[_0x5348('0x2a')](_0x37b91f,{'showHidden':![],'depth':null}));}};module[_0x5348('0x42')]=UserReport;
\ No newline at end of file
+var _0x0ab8=['toNumber','updateStatusRealtime','telephone:%s','startsWith','Local','substring','indexOf','find','mobile','phone','accountcode','[syncDeviceState][UserReport]','inspect','peer','registered','status','address','telephone:save','[syncPeerStatus][UserReport]','exports','lodash','moment','bluebird','ioredis','../../../config/environment','ami','redis','defaults','socket.io-emitter','agents','telephones','registryentry','bind','registry','syncRegistry','syncDeviceState','peerstatus','syncPeerStatus','loopSyncRealTimeShow','then','actionSipShowRegistry','actionDeviceStateList','error','prototype','actionSipPeerStatus','[loopSyncRealTimeShow]','isNotNull','emit','trunks','username','stateRegistry','state','merge','omit','actionid','format','trunk:%s','name','trunk:save','[syncRegistry][UserReport]','device','local','inuse','toLowerCase','stateTime'];(function(_0x11ce46,_0x177a85){var _0x368a1e=function(_0x425454){while(--_0x425454){_0x11ce46['push'](_0x11ce46['shift']());}};_0x368a1e(++_0x177a85);}(_0x0ab8,0x1db));var _0x80ab=function(_0x39c5e1,_0x4f9c62){_0x39c5e1=_0x39c5e1-0x0;var _0x51af6f=_0x0ab8[_0x39c5e1];return _0x51af6f;};'use strict';var _=require(_0x80ab('0x0'));var moment=require(_0x80ab('0x1'));var BPromise=require(_0x80ab('0x2'));var util=require('util');var Redis=require(_0x80ab('0x3'));var config=require(_0x80ab('0x4'));var logger=require('../../../config/logger')(_0x80ab('0x5'));var ami=require('../ami');config[_0x80ab('0x6')]=_[_0x80ab('0x7')](config[_0x80ab('0x6')],{'host':'localhost','port':0x18eb});var io=require(_0x80ab('0x8'))(new Redis(config['redis']));function UserReport(_0x11c61d){this['trunks']=_0x11c61d['trunks'];this['agents']=_0x11c61d[_0x80ab('0x9')];this['telephones']=_0x11c61d[_0x80ab('0xa')];ami['on'](_0x80ab('0xb'),this['syncRegistry'][_0x80ab('0xc')](this));ami['on'](_0x80ab('0xd'),this[_0x80ab('0xe')][_0x80ab('0xc')](this));ami['on']('devicestatechange',this[_0x80ab('0xf')][_0x80ab('0xc')](this));ami['on'](_0x80ab('0x10'),this[_0x80ab('0x11')][_0x80ab('0xc')](this));this[_0x80ab('0x12')]();return BPromise['resolve']()[_0x80ab('0x13')](ami[_0x80ab('0x14')]())[_0x80ab('0x13')](ami[_0x80ab('0x15')]())[_0x80ab('0x13')](ami['actionSipPeerStatus']())['catch'](loggerCatch('[loopSyncRealTimeShow]'));}function loggerCatch(_0x271f02){return function(_0x24259b){logger[_0x80ab('0x16')](_0x271f02,util['inspect'](_0x24259b,{'showHidden':![],'depth':null}));};}UserReport[_0x80ab('0x17')][_0x80ab('0x12')]=function(){setInterval(function(){BPromise['resolve']()[_0x80ab('0x13')](ami[_0x80ab('0x14')]())[_0x80ab('0x13')](ami[_0x80ab('0x15')]())[_0x80ab('0x13')](ami[_0x80ab('0x18')]())['catch'](loggerCatch(_0x80ab('0x19')));},0x32c8);};UserReport[_0x80ab('0x17')][_0x80ab('0x1a')]=function(_0x335ad8){return _0x335ad8!==null&&!_['isUndefined'](_0x335ad8);};UserReport[_0x80ab('0x17')][_0x80ab('0x1b')]=function(_0x190760,_0x428d46,_0xb5c55a){io['to'](_0x190760)[_0x80ab('0x1b')](_0x428d46,_0xb5c55a);};UserReport[_0x80ab('0x17')][_0x80ab('0xe')]=function(_0x12b950){try{if(this[_0x80ab('0x1a')](_0x12b950)){var _0x35b489=_['find'](this[_0x80ab('0x1c')],{'registry':_0x12b950[_0x80ab('0x1d')]});if(_0x35b489){_0x12b950[_0x80ab('0x1e')]=_0x12b950[_0x80ab('0x1f')];_[_0x80ab('0x20')](_0x35b489,_[_0x80ab('0x21')](_0x12b950,['event',_0x80ab('0x22'),_0x80ab('0x1d'),_0x80ab('0x1f')]));this[_0x80ab('0x1b')](util[_0x80ab('0x23')](_0x80ab('0x24'),_0x35b489[_0x80ab('0x25')]),_0x80ab('0x26'),_0x35b489);}}}catch(_0x5da429){logger[_0x80ab('0x16')](_0x80ab('0x27'),util['inspect'](_0x5da429,{'showHidden':![],'depth':null}));}};UserReport[_0x80ab('0x17')][_0x80ab('0xf')]=function(_0x19c615){try{if(this[_0x80ab('0x1a')](_0x19c615)){if(this['agents'][_0x19c615['device']]){if(!this[_0x80ab('0x9')][_0x19c615[_0x80ab('0x28')]][_0x80ab('0x29')]||_0x19c615['state']['toLowerCase']()==_0x80ab('0x2a')){this[_0x80ab('0x9')][_0x19c615['device']]['local']=![];if(this['agents'][_0x19c615[_0x80ab('0x28')]][_0x80ab('0x1f')]!==_0x19c615[_0x80ab('0x1f')][_0x80ab('0x2b')]()){this[_0x80ab('0x9')][_0x19c615[_0x80ab('0x28')]][_0x80ab('0x2c')]=_[_0x80ab('0x2d')](moment()['format']('x'));}this['agents'][_0x19c615[_0x80ab('0x28')]]['state']=_0x19c615[_0x80ab('0x1f')]['toLowerCase']();this[_0x80ab('0x9')][_0x19c615[_0x80ab('0x28')]][_0x80ab('0x2e')](_0x19c615);}}else if(this[_0x80ab('0xa')][_0x19c615[_0x80ab('0x28')]]){if(this[_0x80ab('0xa')][_0x19c615[_0x80ab('0x28')]][_0x80ab('0x1f')]!==_0x19c615[_0x80ab('0x1f')][_0x80ab('0x2b')]()){this['telephones'][_0x19c615[_0x80ab('0x28')]][_0x80ab('0x2c')]=_[_0x80ab('0x2d')](moment()['format']('x'));}this['telephones'][_0x19c615[_0x80ab('0x28')]][_0x80ab('0x1f')]=_0x19c615[_0x80ab('0x1f')][_0x80ab('0x2b')]();this[_0x80ab('0x1b')](util[_0x80ab('0x23')](_0x80ab('0x2f'),this[_0x80ab('0xa')][_0x19c615[_0x80ab('0x28')]]['name']),'telephone:save',this[_0x80ab('0xa')][_0x19c615[_0x80ab('0x28')]]);}else if(this['trunks'][_0x19c615[_0x80ab('0x28')]]){if(this[_0x80ab('0x1c')][_0x19c615['device']][_0x80ab('0x1f')]!==_0x19c615[_0x80ab('0x1f')][_0x80ab('0x2b')]()){this['trunks'][_0x19c615[_0x80ab('0x28')]][_0x80ab('0x2c')]=_[_0x80ab('0x2d')](moment()[_0x80ab('0x23')]('x'));}this[_0x80ab('0x1c')][_0x19c615[_0x80ab('0x28')]][_0x80ab('0x1f')]=_0x19c615[_0x80ab('0x1f')]['toLowerCase']();this['emit'](util[_0x80ab('0x23')](_0x80ab('0x24'),this[_0x80ab('0x1c')][_0x19c615[_0x80ab('0x28')]][_0x80ab('0x25')]),_0x80ab('0x26'),this[_0x80ab('0x1c')][_0x19c615[_0x80ab('0x28')]]);}else if(_[_0x80ab('0x30')](_0x19c615[_0x80ab('0x28')],'Queue')){}else if(_[_0x80ab('0x30')](_0x19c615[_0x80ab('0x28')],_0x80ab('0x31'))){var _0x4e0f3d=_0x19c615['device'];var _0x1ce9e8=_0x4e0f3d[_0x80ab('0x32')](_0x4e0f3d[_0x80ab('0x33')]('/')+0x1,_0x4e0f3d[_0x80ab('0x33')]('@'));var _0x5859a3=_[_0x80ab('0x34')](this[_0x80ab('0x9')],function(_0x22130a){return _0x22130a[_0x80ab('0x35')]==_0x1ce9e8||_0x22130a[_0x80ab('0x36')]==_0x1ce9e8||_0x22130a[_0x80ab('0x37')]==_0x1ce9e8;});if(_0x5859a3){if(_0x5859a3['state']!==_0x19c615['state'][_0x80ab('0x2b')]()){_0x5859a3['stateTime']=_[_0x80ab('0x2d')](moment()[_0x80ab('0x23')]('x'));}_0x5859a3[_0x80ab('0x1f')]=_0x19c615[_0x80ab('0x1f')][_0x80ab('0x2b')]();_0x5859a3['local']=!![];_0x5859a3[_0x80ab('0x2e')](_0x19c615);}}else{}}}catch(_0x547595){logger[_0x80ab('0x16')](_0x80ab('0x38'),util[_0x80ab('0x39')](_0x547595,{'showHidden':![],'depth':null}));}};UserReport[_0x80ab('0x17')][_0x80ab('0x11')]=function(_0x14e81c){try{if(this[_0x80ab('0x1a')](_0x14e81c)&&this[_0x80ab('0x1a')](_0x14e81c[_0x80ab('0x10')])){if(this[_0x80ab('0x9')][_0x14e81c[_0x80ab('0x3a')]]){if(!this[_0x80ab('0x9')][_0x14e81c[_0x80ab('0x3a')]][_0x80ab('0x29')]||_0x14e81c[_0x80ab('0x10')][_0x80ab('0x2b')]()==_0x80ab('0x3b')){this['agents'][_0x14e81c[_0x80ab('0x3a')]]['local']=![];this[_0x80ab('0x9')][_0x14e81c[_0x80ab('0x3a')]][_0x80ab('0x3c')]=_0x14e81c[_0x80ab('0x10')][_0x80ab('0x2b')]();this['agents'][_0x14e81c[_0x80ab('0x3a')]][_0x80ab('0x3d')]=_0x14e81c['address'];this[_0x80ab('0x9')][_0x14e81c['peer']][_0x80ab('0x2e')](_0x14e81c);}}else if(this[_0x80ab('0xa')][_0x14e81c[_0x80ab('0x3a')]]){this[_0x80ab('0xa')][_0x14e81c['peer']][_0x80ab('0x3c')]=_0x14e81c[_0x80ab('0x10')][_0x80ab('0x2b')]();this['telephones'][_0x14e81c[_0x80ab('0x3a')]][_0x80ab('0x3d')]=_0x14e81c[_0x80ab('0x3d')];this[_0x80ab('0x1b')](util['format'](_0x80ab('0x2f'),this[_0x80ab('0xa')][_0x14e81c[_0x80ab('0x3a')]][_0x80ab('0x25')]),_0x80ab('0x3e'),this['telephones'][_0x14e81c[_0x80ab('0x3a')]]);}else if(this['trunks'][_0x14e81c[_0x80ab('0x3a')]]){this['trunks'][_0x14e81c['peer']]['status']=_0x14e81c[_0x80ab('0x10')]['toLowerCase']();this[_0x80ab('0x1c')][_0x14e81c[_0x80ab('0x3a')]]['address']=_0x14e81c[_0x80ab('0x3d')];this[_0x80ab('0x1b')](util[_0x80ab('0x23')](_0x80ab('0x24'),this[_0x80ab('0x1c')][_0x14e81c['peer']][_0x80ab('0x25')]),_0x80ab('0x26'),this[_0x80ab('0x1c')][_0x14e81c[_0x80ab('0x3a')]]);}else{}}}catch(_0x8b9f1){logger['error'](_0x80ab('0x3f'),util[_0x80ab('0x39')](_0x8b9f1,{'showHidden':![],'depth':null}));}};module[_0x80ab('0x40')]=UserReport;
\ No newline at end of file
diff --git a/server/services/ami/report/voiceAgentReport.js b/server/services/ami/report/voiceAgentReport.js
index 5324743..d32eb34 100644
--- a/server/services/ami/report/voiceAgentReport.js
+++ b/server/services/ami/report/voiceAgentReport.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x21aa=['syncHangup','syncMusicOnHoldStart','musiconholdstop','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','prototype','emit','isNotNull','isUndefined','syncAgentCalled','channels','uniqueid','destuniqueid','format','YYYY-MM-DD\x20HH:mm:ss','queue','type','inbound','merge','event','privilege','custom:agentcalled','user:%s','membername','user:called','[syncAgentCalled][VoiceAgentReport]','inspect','hasOwnProperty','agentconnectAt','lastevent','connect','connectedlinenum','destchannelstate','destchannelstatedesc','interface','pick','destconnectedlinenum','user:agentconnect','custom:agentconnect','agentringnoanswerAt','answered_elsewhere','answeredelsewheredestinationuniqueid','answeredelsewheremembername','custom:agentansweredelsewhere','error','[syncAgentConnect][VoiceAgentReport]','reason','rejected','custom:agentringnoanswer','[syncAgentRingNoAnswer][VoiceAgentReport]','syncQueueCallerAbandon','abandoned','custom:agentqueuecallerabandon','syncAgentComplete','complete','talktime','transfer','agent','acw','acwtime','omit','user:agentcomplete','custom:agentcomplete','[syncAgentComplete][VoiceAgentReport]','addVariable','keys','value','[syncVarSet][VoiceAgentReport]','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','sipcallid','bridgepeer','bridgepvtcallid','memberdynamic','memberinterface','memberlastcall','memberpenalty','isNil','includes','custom:voiceAgentReport','[syncHangup][VoiceAgentReport]','transfereeuniqueid','origtransfereruniqueid','agentcompleteAt','diff','secondtransfereruniqueid','[syncAttendedTransfer][VoiceAgentReport]','transfereruniqueid','seconds','[syncBlindTransfer][VoiceAgentReport]','channel','substring','lastIndexOf','onhold','[syncMusicOnHoldStart][VoiceAgentReport]','syncMusicOnHoldStop','[syncMusicOnHoldStop][VoiceAgentReport]','exports','moment','util','ioredis','../../../config/logger','ami','redis','defaults','socket.io-emitter','voiceQueues','agents','variables','agentcalled','bind','agentconnect','syncAgentConnect','agentringnoanswer','syncAgentRingNoAnswer','queuecallerabandon','agentcomplete','syncVarSet','hangup'];(function(_0x273f77,_0xe5b0cb){var _0x71e147=function(_0x564056){while(--_0x564056){_0x273f77['push'](_0x273f77['shift']());}};_0x71e147(++_0xe5b0cb);}(_0x21aa,0xe5));var _0xa21a=function(_0x15ca1a,_0x30fc82){_0x15ca1a=_0x15ca1a-0x0;var _0x507626=_0x21aa[_0x15ca1a];return _0x507626;};'use strict';var _=require('lodash');var moment=require(_0xa21a('0x0'));var util=require(_0xa21a('0x1'));var Redis=require(_0xa21a('0x2'));var config=require('../../../config/environment');var logger=require(_0xa21a('0x3'))(_0xa21a('0x4'));var ami=require('../ami');config[_0xa21a('0x5')]=_[_0xa21a('0x6')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0xa21a('0x7'))(new Redis(config[_0xa21a('0x5')]));function VoiceAgentReport(_0x51189e){this['channels']={};this[_0xa21a('0x8')]=_0x51189e[_0xa21a('0x8')];this[_0xa21a('0x9')]=_0x51189e[_0xa21a('0x9')];this[_0xa21a('0xa')]={};ami['on'](_0xa21a('0xb'),this['syncAgentCalled'][_0xa21a('0xc')](this));ami['on'](_0xa21a('0xd'),this[_0xa21a('0xe')][_0xa21a('0xc')](this));ami['on'](_0xa21a('0xf'),this[_0xa21a('0x10')][_0xa21a('0xc')](this));ami['on'](_0xa21a('0x11'),this['syncQueueCallerAbandon'][_0xa21a('0xc')](this));ami['on'](_0xa21a('0x12'),this['syncAgentComplete'][_0xa21a('0xc')](this));ami['on']('varset',this[_0xa21a('0x13')][_0xa21a('0xc')](this));ami['on'](_0xa21a('0x14'),this[_0xa21a('0x15')][_0xa21a('0xc')](this));ami['on']('musiconholdstart',this[_0xa21a('0x16')]['bind'](this));ami['on'](_0xa21a('0x17'),this['syncMusicOnHoldStop'][_0xa21a('0xc')](this));ami['on'](_0xa21a('0x18'),this[_0xa21a('0x19')][_0xa21a('0xc')](this));ami['on'](_0xa21a('0x1a'),this[_0xa21a('0x1b')][_0xa21a('0xc')](this));}VoiceAgentReport[_0xa21a('0x1c')][_0xa21a('0x1d')]=function(_0x4789a3,_0x50d5ba,_0x4f5749){io['to'](_0x4789a3)[_0xa21a('0x1d')](_0x50d5ba,_0x4f5749);};VoiceAgentReport[_0xa21a('0x1c')][_0xa21a('0x1e')]=function(_0x4bad2a){return _0x4bad2a!==null&&!_[_0xa21a('0x1f')](_0x4bad2a);};VoiceAgentReport['prototype'][_0xa21a('0x20')]=function(_0x494825){try{if(this[_0xa21a('0x1e')](_0x494825)){if(_['isUndefined'](this[_0xa21a('0x21')][_0x494825[_0xa21a('0x22')]])){this[_0xa21a('0x21')][_0x494825['uniqueid']]={};}if(_[_0xa21a('0x1f')](this[_0xa21a('0x21')][_0x494825[_0xa21a('0x22')]][_0x494825['destuniqueid']])){this[_0xa21a('0x21')][_0x494825[_0xa21a('0x22')]][_0x494825[_0xa21a('0x23')]]={'agentcalledAt':moment()[_0xa21a('0x24')](_0xa21a('0x25')),'lastevent':'called','variables':this[_0xa21a('0xa')][_0x494825[_0xa21a('0x22')]],'type':this[_0xa21a('0x8')][_0x494825[_0xa21a('0x26')]]?this[_0xa21a('0x8')][_0x494825[_0xa21a('0x26')]][_0xa21a('0x27')]||_0xa21a('0x28'):_0xa21a('0x28')};}_[_0xa21a('0x29')](this[_0xa21a('0x21')][_0x494825[_0xa21a('0x22')]][_0x494825[_0xa21a('0x23')]],_['omit'](_0x494825,[_0xa21a('0x2a'),_0xa21a('0x2b')]));ami[_0xa21a('0x1d')](_0xa21a('0x2c'),this['channels'][_0x494825[_0xa21a('0x22')]][_0x494825[_0xa21a('0x23')]]);this[_0xa21a('0x1d')](util['format'](_0xa21a('0x2d'),_0x494825[_0xa21a('0x2e')]),_0xa21a('0x2f'),this[_0xa21a('0x21')][_0x494825[_0xa21a('0x22')]][_0x494825[_0xa21a('0x23')]]);}}catch(_0x391efe){logger['error'](_0xa21a('0x30'),util[_0xa21a('0x31')](_0x391efe,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xa21a('0x1c')][_0xa21a('0xe')]=function(_0x24f068){try{if(this[_0xa21a('0x1e')](_0x24f068)){if(this[_0xa21a('0x21')][_0x24f068['uniqueid']]){for(var _0x58eee2 in this[_0xa21a('0x21')][_0x24f068[_0xa21a('0x22')]]){if(this[_0xa21a('0x21')][_0x24f068[_0xa21a('0x22')]][_0xa21a('0x32')](_0x58eee2)){if(_0x24f068[_0xa21a('0x23')]===_0x58eee2){this[_0xa21a('0x21')][_0x24f068[_0xa21a('0x22')]][_0x58eee2][_0xa21a('0x33')]=moment()[_0xa21a('0x24')]('YYYY-MM-DD\x20HH:mm:ss');this[_0xa21a('0x21')][_0x24f068['uniqueid']][_0x58eee2][_0xa21a('0x34')]=_0xa21a('0x35');this[_0xa21a('0x21')][_0x24f068[_0xa21a('0x22')]][_0x58eee2]['holdtime']=_0x24f068['holdtime'];this['channels'][_0x24f068[_0xa21a('0x22')]][_0x58eee2][_0xa21a('0x36')]=_0x24f068[_0xa21a('0x36')];this[_0xa21a('0x21')][_0x24f068[_0xa21a('0x22')]][_0x58eee2]['connectedlinename']=_0x24f068['connectedlinename'];this['channels'][_0x24f068['uniqueid']][_0x58eee2]['destchannelstate']=_0x24f068[_0xa21a('0x37')];this[_0xa21a('0x21')][_0x24f068[_0xa21a('0x22')]][_0x58eee2][_0xa21a('0x38')]=_0x24f068[_0xa21a('0x38')];_[_0xa21a('0x29')](this[_0xa21a('0x9')][_0x24f068[_0xa21a('0x39')]],_[_0xa21a('0x3a')](_0x24f068,[_0xa21a('0x26'),_0xa21a('0x3b')]));this[_0xa21a('0x1d')](util['format'](_0xa21a('0x2d'),_0x24f068[_0xa21a('0x2e')]),_0xa21a('0x3c'),this['channels'][_0x24f068[_0xa21a('0x22')]][_0x24f068[_0xa21a('0x23')]]);ami[_0xa21a('0x1d')](_0xa21a('0x3d'),this['channels'][_0x24f068[_0xa21a('0x22')]][_0x58eee2]);}else if(!this[_0xa21a('0x21')][_0x24f068[_0xa21a('0x22')]][_0x58eee2][_0xa21a('0xf')]&&!this[_0xa21a('0x21')][_0x24f068['uniqueid']][_0x58eee2][_0xa21a('0x12')]){this[_0xa21a('0x21')][_0x24f068[_0xa21a('0x22')]][_0x58eee2]['agentringnoanswer']=!![];this[_0xa21a('0x21')][_0x24f068[_0xa21a('0x22')]][_0x58eee2][_0xa21a('0x3e')]=moment()[_0xa21a('0x24')](_0xa21a('0x25'));this[_0xa21a('0x21')][_0x24f068[_0xa21a('0x22')]][_0x58eee2]['reason']=_0xa21a('0x3f');this[_0xa21a('0x21')][_0x24f068['uniqueid']][_0x58eee2]['lastevent']=_0xa21a('0x3f');this[_0xa21a('0x21')][_0x24f068[_0xa21a('0x22')]][_0x58eee2][_0xa21a('0x40')]=_0x24f068[_0xa21a('0x23')];this[_0xa21a('0x21')][_0x24f068[_0xa21a('0x22')]][_0x58eee2][_0xa21a('0x41')]=_0x24f068[_0xa21a('0x2e')];ami[_0xa21a('0x1d')](_0xa21a('0x42'),this[_0xa21a('0x21')][_0x24f068[_0xa21a('0x22')]][_0x58eee2]);}}}}}}catch(_0x576410){logger[_0xa21a('0x43')](_0xa21a('0x44'),util[_0xa21a('0x31')](_0x576410,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xa21a('0x1c')]['syncAgentRingNoAnswer']=function(_0x6eb19){try{if(this[_0xa21a('0x1e')](_0x6eb19)){if(this[_0xa21a('0x21')][_0x6eb19[_0xa21a('0x22')]]&&this['channels'][_0x6eb19[_0xa21a('0x22')]][_0x6eb19[_0xa21a('0x23')]]){this['channels'][_0x6eb19[_0xa21a('0x22')]][_0x6eb19[_0xa21a('0x23')]][_0xa21a('0xf')]=!![];this[_0xa21a('0x21')][_0x6eb19[_0xa21a('0x22')]][_0x6eb19['destuniqueid']][_0xa21a('0x3e')]=moment()[_0xa21a('0x24')](_0xa21a('0x25'));this[_0xa21a('0x21')][_0x6eb19['uniqueid']][_0x6eb19['destuniqueid']][_0xa21a('0x45')]=_0xa21a('0x46');this['channels'][_0x6eb19[_0xa21a('0x22')]][_0x6eb19['destuniqueid']][_0xa21a('0x34')]=_0xa21a('0x46');ami['emit'](_0xa21a('0x47'),this[_0xa21a('0x21')][_0x6eb19[_0xa21a('0x22')]][_0x6eb19[_0xa21a('0x23')]]);}}}catch(_0x4f1cf){logger[_0xa21a('0x43')](_0xa21a('0x48'),util[_0xa21a('0x31')](_0x4f1cf,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xa21a('0x1c')][_0xa21a('0x49')]=function(_0x381dfa){try{if(this[_0xa21a('0x1e')](_0x381dfa)){if(this[_0xa21a('0x21')][_0x381dfa[_0xa21a('0x22')]]){for(var _0x1e424b in this['channels'][_0x381dfa['uniqueid']]){if(this[_0xa21a('0x21')][_0x381dfa[_0xa21a('0x22')]]['hasOwnProperty'](_0x1e424b)&&!this[_0xa21a('0x21')][_0x381dfa[_0xa21a('0x22')]][_0x1e424b][_0xa21a('0xf')]&&!this[_0xa21a('0x21')][_0x381dfa['uniqueid']][_0x1e424b]['agentcomplete']){this[_0xa21a('0x21')][_0x381dfa[_0xa21a('0x22')]][_0x1e424b][_0xa21a('0xf')]=!![];this['channels'][_0x381dfa['uniqueid']][_0x1e424b][_0xa21a('0x3e')]=moment()[_0xa21a('0x24')](_0xa21a('0x25'));this['channels'][_0x381dfa[_0xa21a('0x22')]][_0x1e424b][_0xa21a('0x45')]=_0xa21a('0x4a');this[_0xa21a('0x21')][_0x381dfa[_0xa21a('0x22')]][_0x1e424b]['lastevent']=_0xa21a('0x4a');ami[_0xa21a('0x1d')](_0xa21a('0x4b'),this[_0xa21a('0x21')][_0x381dfa[_0xa21a('0x22')]][_0x1e424b]);}}}}}catch(_0x34bd43){logger['error']('[syncQueueCallerAbandon][VoiceAgentReport]',util['inspect'](_0x34bd43,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0xa21a('0x4c')]=function(_0x237266){try{if(this[_0xa21a('0x1e')](_0x237266)){if(this['channels'][_0x237266[_0xa21a('0x22')]]){for(var _0x22f2df in this['channels'][_0x237266[_0xa21a('0x22')]]){if(this[_0xa21a('0x21')][_0x237266[_0xa21a('0x22')]]['hasOwnProperty'](_0x22f2df)){if(this[_0xa21a('0x21')][_0x237266[_0xa21a('0x22')]][_0x22f2df][_0xa21a('0x33')]&&!this[_0xa21a('0x21')][_0x237266['uniqueid']][_0x22f2df]['agentcomplete']){this[_0xa21a('0x21')][_0x237266[_0xa21a('0x22')]][_0x22f2df][_0xa21a('0x12')]=!![];this['channels'][_0x237266[_0xa21a('0x22')]][_0x22f2df]['agentcompleteAt']=moment()[_0xa21a('0x24')](_0xa21a('0x25'));this[_0xa21a('0x21')][_0x237266['uniqueid']][_0x22f2df][_0xa21a('0x34')]=_0xa21a('0x4d');this[_0xa21a('0x21')][_0x237266[_0xa21a('0x22')]][_0x22f2df][_0xa21a('0x4e')]=_0x237266[_0xa21a('0x4e')];this['channels'][_0x237266[_0xa21a('0x22')]][_0x22f2df]['reason']=_0x237266[_0xa21a('0x45')]==_0xa21a('0x4f')?_0xa21a('0x50'):_0x237266[_0xa21a('0x45')];if(this['voiceQueues'][_0x237266['queue']]&&this[_0xa21a('0x8')][_0x237266[_0xa21a('0x26')]][_0xa21a('0x51')]){this[_0xa21a('0x21')][_0x237266['uniqueid']][_0x22f2df]['agentacw']=!![];this['channels'][_0x237266['uniqueid']][_0x22f2df][_0xa21a('0x52')]=this[_0xa21a('0x8')][_0x237266[_0xa21a('0x26')]]['acwTimeout'];}this[_0xa21a('0x9')][_0x237266[_0xa21a('0x39')]]=_[_0xa21a('0x53')](this[_0xa21a('0x9')][_0x237266['interface']],[_0xa21a('0x26'),'destconnectedlinenum']);this['emit'](util[_0xa21a('0x24')]('user:%s',_0x237266['membername']),_0xa21a('0x54'),this['channels'][_0x237266[_0xa21a('0x22')]][_0x22f2df]);ami[_0xa21a('0x1d')](_0xa21a('0x55'),this[_0xa21a('0x21')][_0x237266[_0xa21a('0x22')]][_0x22f2df]);}}}}}}catch(_0x30bf80){logger['error'](_0xa21a('0x56'),util[_0xa21a('0x31')](_0x30bf80,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xa21a('0x1c')][_0xa21a('0x13')]=function(_0x19fb39){try{if(this[_0xa21a('0x1e')](_0x19fb39)){this[_0xa21a('0x57')](_0x19fb39[_0xa21a('0x22')],_[_0xa21a('0x58')](_0x19fb39['variable'])[0x0],_0x19fb39[_0xa21a('0x59')]);if(this[_0xa21a('0x21')][_0x19fb39[_0xa21a('0x22')]]){for(var _0x241196 in this[_0xa21a('0x21')][_0x19fb39['uniqueid']]){if(this['channels'][_0x19fb39['uniqueid']][_0xa21a('0x32')](_0x241196)){if(_['isUndefined'](this[_0xa21a('0x21')][_0x19fb39['uniqueid']][_0x241196]['variables'])){this[_0xa21a('0x21')][_0x19fb39[_0xa21a('0x22')]][_0x241196]['variables']={};}this[_0xa21a('0x21')][_0x19fb39[_0xa21a('0x22')]][_0x241196][_0xa21a('0xa')]=this[_0xa21a('0xa')][_0x19fb39['uniqueid']];}}}}}catch(_0x14bccd){logger['error'](_0xa21a('0x5a'),util['inspect'](_0x14bccd,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype']['addVariable']=function(_0x246d44,_0x34f05f,_0x39a3cb){var _0x31368f=[_0xa21a('0x5b'),_0xa21a('0x5c'),_0xa21a('0x5d'),'rtpaudioqosjitterbridged',_0xa21a('0x5e'),_0xa21a('0x5f'),_0xa21a('0x60'),'rtpaudioqosrttbridged',_0xa21a('0x61'),'sipuri',_0xa21a('0x62'),_0xa21a('0x63'),'membercalls',_0xa21a('0x64'),_0xa21a('0x65'),_0xa21a('0x66'),_0xa21a('0x2e'),_0xa21a('0x67'),'memberrealtime'];if(!_[_0xa21a('0x68')](_0x34f05f)&&!_[_0xa21a('0x69')](_0x31368f,_0x34f05f)){if(_[_0xa21a('0x1f')](this[_0xa21a('0xa')][_0x246d44])){this[_0xa21a('0xa')][_0x246d44]={};}this[_0xa21a('0xa')][_0x246d44][_0x34f05f]=_0x39a3cb;}};VoiceAgentReport[_0xa21a('0x1c')][_0xa21a('0x15')]=function(_0x55a1d3){try{if(this[_0xa21a('0x1e')](_0x55a1d3)){if(this[_0xa21a('0x21')][_0x55a1d3[_0xa21a('0x22')]]){for(var _0xfa7ff2 in this[_0xa21a('0x21')][_0x55a1d3[_0xa21a('0x22')]]){if(this[_0xa21a('0x21')][_0x55a1d3[_0xa21a('0x22')]][_0xa21a('0x32')](_0xfa7ff2)){if(this[_0xa21a('0x21')][_0x55a1d3[_0xa21a('0x22')]][_0xfa7ff2][_0xa21a('0x45')]==_0xa21a('0x4f')&&this[_0xa21a('0x21')][_0x55a1d3[_0xa21a('0x22')]][_0xfa7ff2][_0xa21a('0x12')]){this[_0xa21a('0x21')][_0x55a1d3[_0xa21a('0x22')]][_0xfa7ff2]['agentcompleteAt']=moment()[_0xa21a('0x24')](_0xa21a('0x25'));}}}ami['emit'](_0xa21a('0x6a'),_['values'](this[_0xa21a('0x21')][_0x55a1d3[_0xa21a('0x22')]]));delete this['channels'][_0x55a1d3[_0xa21a('0x22')]];}if(this[_0xa21a('0xa')][_0x55a1d3[_0xa21a('0x22')]]){delete this[_0xa21a('0xa')][_0x55a1d3['uniqueid']];}}}catch(_0x2f7c9d){logger[_0xa21a('0x43')](_0xa21a('0x6b'),util[_0xa21a('0x31')](_0x2f7c9d,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xa21a('0x1c')][_0xa21a('0x19')]=function(_0x478fcd){try{if(this[_0xa21a('0x1e')](_0x478fcd)){if(this['channels'][_0x478fcd['transfereeuniqueid']]){for(var _0x28c7b4 in this[_0xa21a('0x21')][_0x478fcd[_0xa21a('0x6c')]]){if(this[_0xa21a('0x21')][_0x478fcd['transfereeuniqueid']]['hasOwnProperty'](_0x28c7b4)){if(_0x478fcd[_0xa21a('0x6d')]===_0x28c7b4){var _0x1f4436=moment();this[_0xa21a('0x21')][_0x478fcd[_0xa21a('0x6c')]][_0x28c7b4][_0xa21a('0x12')]=!![];this['channels'][_0x478fcd['transfereeuniqueid']][_0x28c7b4][_0xa21a('0x6e')]=moment()[_0xa21a('0x24')](_0xa21a('0x25'));this[_0xa21a('0x21')][_0x478fcd['transfereeuniqueid']][_0x28c7b4][_0xa21a('0x45')]=_0xa21a('0x4f');this[_0xa21a('0x21')][_0x478fcd[_0xa21a('0x6c')]][_0x28c7b4][_0xa21a('0x34')]='complete';this[_0xa21a('0x21')][_0x478fcd['transfereeuniqueid']][_0x28c7b4]['talktime']=_0x1f4436[_0xa21a('0x6f')](this[_0xa21a('0x21')][_0x478fcd[_0xa21a('0x6c')]][_0x28c7b4][_0xa21a('0x33')],'seconds');}}}}if(this[_0xa21a('0x21')][_0x478fcd['secondtransfereruniqueid']]){var _0x5a6ee1=this[_0xa21a('0x21')][_0x478fcd[_0xa21a('0x70')]];this[_0xa21a('0x21')][_0x478fcd[_0xa21a('0x70')]]=this[_0xa21a('0x21')][_0x478fcd[_0xa21a('0x6c')]];this[_0xa21a('0x21')][_0x478fcd[_0xa21a('0x6c')]]=_0x5a6ee1;}}}catch(_0x45d707){logger['error'](_0xa21a('0x71'),util[_0xa21a('0x31')](_0x45d707,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xa21a('0x1c')][_0xa21a('0x1b')]=function(_0x25a587){try{if(this[_0xa21a('0x1e')](_0x25a587)){if(this[_0xa21a('0x21')][_0x25a587['transfereeuniqueid']]){for(var _0x2894c3 in this[_0xa21a('0x21')][_0x25a587['transfereeuniqueid']]){if(this[_0xa21a('0x21')][_0x25a587[_0xa21a('0x6c')]]['hasOwnProperty'](_0x2894c3)){if(_0x25a587[_0xa21a('0x72')]===_0x2894c3){var _0x1fe3cd=moment();this[_0xa21a('0x21')][_0x25a587[_0xa21a('0x6c')]][_0x2894c3][_0xa21a('0x12')]=!![];this['channels'][_0x25a587['transfereeuniqueid']][_0x2894c3][_0xa21a('0x6e')]=_0x1fe3cd;this[_0xa21a('0x21')][_0x25a587['transfereeuniqueid']][_0x2894c3][_0xa21a('0x45')]=_0xa21a('0x4f');this['channels'][_0x25a587[_0xa21a('0x6c')]][_0x2894c3][_0xa21a('0x34')]='complete';this[_0xa21a('0x21')][_0x25a587[_0xa21a('0x6c')]][_0x2894c3][_0xa21a('0x4e')]=_0x1fe3cd[_0xa21a('0x6f')](this[_0xa21a('0x21')][_0x25a587[_0xa21a('0x6c')]][_0x2894c3]['agentconnectAt'],_0xa21a('0x73'));}}}}}}catch(_0xfa5955){logger[_0xa21a('0x43')](_0xa21a('0x74'),util[_0xa21a('0x31')](_0xfa5955,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0xa21a('0x16')]=function(_0xe043b3){var _0x1a8593='';try{if(this[_0xa21a('0x1e')](_0xe043b3)){if(_0xe043b3[_0xa21a('0x75')]){_0x1a8593=_0xe043b3[_0xa21a('0x75')][_0xa21a('0x76')](0x0,_0xe043b3[_0xa21a('0x75')][_0xa21a('0x77')]('-'));if(this[_0xa21a('0x9')][_0x1a8593]){this[_0xa21a('0x9')][_0x1a8593][_0xa21a('0x78')]=!![];}}}}catch(_0x134928){logger[_0xa21a('0x43')](_0xa21a('0x79'),util[_0xa21a('0x31')](_0x134928,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xa21a('0x1c')][_0xa21a('0x7a')]=function(_0x4acbf6){var _0x179a81='';try{if(this[_0xa21a('0x1e')](_0x4acbf6)){if(_0x4acbf6['channel']){_0x179a81=_0x4acbf6[_0xa21a('0x75')][_0xa21a('0x76')](0x0,_0x4acbf6[_0xa21a('0x75')]['lastIndexOf']('-'));if(this['agents'][_0x179a81]){this[_0xa21a('0x9')][_0x179a81][_0xa21a('0x78')]=![];}}}}catch(_0x2bd437){logger['error'](_0xa21a('0x7b'),util['inspect'](_0x2bd437,{'showHidden':![],'depth':null}));}};module[_0xa21a('0x7c')]=VoiceAgentReport;
\ No newline at end of file
+var _0xa432=['lastIndexOf','[syncMusicOnHoldStop][VoiceAgentReport]','lodash','moment','util','ioredis','../../../config/environment','../ami','redis','defaults','localhost','socket.io-emitter','channels','voiceQueues','agents','variables','agentcalled','syncAgentCalled','bind','agentconnect','syncAgentConnect','agentringnoanswer','syncAgentRingNoAnswer','queuecallerabandon','syncQueueCallerAbandon','agentcomplete','syncAgentComplete','varset','syncHangup','musiconholdstart','syncMusicOnHoldStart','musiconholdstop','syncMusicOnHoldStop','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','emit','prototype','isNotNull','isUndefined','uniqueid','destuniqueid','format','YYYY-MM-DD\x20HH:mm:ss','called','queue','type','inbound','merge','omit','event','privilege','custom:agentcalled','user:%s','[syncAgentCalled][VoiceAgentReport]','inspect','lastevent','connect','holdtime','connectedlinenum','connectedlinename','destchannelstate','destchannelstatedesc','interface','pick','destconnectedlinenum','membername','user:agentconnect','agentringnoanswerAt','reason','answered_elsewhere','answeredelsewheredestinationuniqueid','answeredelsewheremembername','custom:agentansweredelsewhere','error','[syncAgentConnect][VoiceAgentReport]','rejected','custom:agentringnoanswer','[syncAgentRingNoAnswer][VoiceAgentReport]','hasOwnProperty','abandoned','custom:agentqueuecallerabandon','[syncQueueCallerAbandon][VoiceAgentReport]','agentconnectAt','complete','talktime','transfer','agent','acwtime','acwTimeout','[syncAgentComplete][VoiceAgentReport]','syncVarSet','addVariable','keys','variable','value','[syncVarSet][VoiceAgentReport]','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','sipcallid','sipuri','bridgepvtcallid','memberdynamic','memberlastcall','memberrealtime','isNil','includes','agentcompleteAt','custom:voiceAgentReport','values','[syncHangup][VoiceAgentReport]','transfereeuniqueid','origtransfereruniqueid','diff','secondtransfereruniqueid','[syncAttendedTransfer][VoiceAgentReport]','transfereruniqueid','seconds','[syncBlindTransfer][VoiceAgentReport]','channel','substring','onhold','[syncMusicOnHoldStart][VoiceAgentReport]'];(function(_0x80adec,_0x5f133e){var _0x3231e2=function(_0x4f0003){while(--_0x4f0003){_0x80adec['push'](_0x80adec['shift']());}};_0x3231e2(++_0x5f133e);}(_0xa432,0x84));var _0x2a43=function(_0x33032e,_0x31411a){_0x33032e=_0x33032e-0x0;var _0x13316b=_0xa432[_0x33032e];return _0x13316b;};'use strict';var _=require(_0x2a43('0x0'));var moment=require(_0x2a43('0x1'));var util=require(_0x2a43('0x2'));var Redis=require(_0x2a43('0x3'));var config=require(_0x2a43('0x4'));var logger=require('../../../config/logger')('ami');var ami=require(_0x2a43('0x5'));config[_0x2a43('0x6')]=_[_0x2a43('0x7')](config['redis'],{'host':_0x2a43('0x8'),'port':0x18eb});var io=require(_0x2a43('0x9'))(new Redis(config[_0x2a43('0x6')]));function VoiceAgentReport(_0x47e062){this[_0x2a43('0xa')]={};this[_0x2a43('0xb')]=_0x47e062[_0x2a43('0xb')];this[_0x2a43('0xc')]=_0x47e062[_0x2a43('0xc')];this[_0x2a43('0xd')]={};ami['on'](_0x2a43('0xe'),this[_0x2a43('0xf')][_0x2a43('0x10')](this));ami['on'](_0x2a43('0x11'),this[_0x2a43('0x12')][_0x2a43('0x10')](this));ami['on'](_0x2a43('0x13'),this[_0x2a43('0x14')]['bind'](this));ami['on'](_0x2a43('0x15'),this[_0x2a43('0x16')][_0x2a43('0x10')](this));ami['on'](_0x2a43('0x17'),this[_0x2a43('0x18')][_0x2a43('0x10')](this));ami['on'](_0x2a43('0x19'),this['syncVarSet']['bind'](this));ami['on']('hangup',this[_0x2a43('0x1a')][_0x2a43('0x10')](this));ami['on'](_0x2a43('0x1b'),this[_0x2a43('0x1c')][_0x2a43('0x10')](this));ami['on'](_0x2a43('0x1d'),this[_0x2a43('0x1e')][_0x2a43('0x10')](this));ami['on'](_0x2a43('0x1f'),this[_0x2a43('0x20')][_0x2a43('0x10')](this));ami['on'](_0x2a43('0x21'),this[_0x2a43('0x22')][_0x2a43('0x10')](this));}VoiceAgentReport['prototype'][_0x2a43('0x23')]=function(_0x2da567,_0xc8614b,_0x507b4a){io['to'](_0x2da567)['emit'](_0xc8614b,_0x507b4a);};VoiceAgentReport[_0x2a43('0x24')][_0x2a43('0x25')]=function(_0x2b79b3){return _0x2b79b3!==null&&!_[_0x2a43('0x26')](_0x2b79b3);};VoiceAgentReport[_0x2a43('0x24')][_0x2a43('0xf')]=function(_0x54bc47){try{if(this['isNotNull'](_0x54bc47)){if(_[_0x2a43('0x26')](this['channels'][_0x54bc47[_0x2a43('0x27')]])){this[_0x2a43('0xa')][_0x54bc47['uniqueid']]={};}if(_[_0x2a43('0x26')](this[_0x2a43('0xa')][_0x54bc47[_0x2a43('0x27')]][_0x54bc47[_0x2a43('0x28')]])){this['channels'][_0x54bc47['uniqueid']][_0x54bc47[_0x2a43('0x28')]]={'agentcalledAt':moment()[_0x2a43('0x29')](_0x2a43('0x2a')),'lastevent':_0x2a43('0x2b'),'variables':this['variables'][_0x54bc47[_0x2a43('0x27')]],'type':this['voiceQueues'][_0x54bc47[_0x2a43('0x2c')]]?this[_0x2a43('0xb')][_0x54bc47['queue']][_0x2a43('0x2d')]||_0x2a43('0x2e'):'inbound'};}_[_0x2a43('0x2f')](this['channels'][_0x54bc47[_0x2a43('0x27')]][_0x54bc47[_0x2a43('0x28')]],_[_0x2a43('0x30')](_0x54bc47,[_0x2a43('0x31'),_0x2a43('0x32')]));ami[_0x2a43('0x23')](_0x2a43('0x33'),this['channels'][_0x54bc47[_0x2a43('0x27')]][_0x54bc47[_0x2a43('0x28')]]);this[_0x2a43('0x23')](util['format'](_0x2a43('0x34'),_0x54bc47['membername']),'user:called',this[_0x2a43('0xa')][_0x54bc47['uniqueid']][_0x54bc47[_0x2a43('0x28')]]);}}catch(_0x191a1b){logger['error'](_0x2a43('0x35'),util[_0x2a43('0x36')](_0x191a1b,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x2a43('0x24')][_0x2a43('0x12')]=function(_0x37f1f0){try{if(this['isNotNull'](_0x37f1f0)){if(this[_0x2a43('0xa')][_0x37f1f0[_0x2a43('0x27')]]){for(var _0x2e76cb in this[_0x2a43('0xa')][_0x37f1f0['uniqueid']]){if(this['channels'][_0x37f1f0[_0x2a43('0x27')]]['hasOwnProperty'](_0x2e76cb)){if(_0x37f1f0[_0x2a43('0x28')]===_0x2e76cb){this['channels'][_0x37f1f0[_0x2a43('0x27')]][_0x2e76cb]['agentconnectAt']=moment()[_0x2a43('0x29')](_0x2a43('0x2a'));this[_0x2a43('0xa')][_0x37f1f0[_0x2a43('0x27')]][_0x2e76cb][_0x2a43('0x37')]=_0x2a43('0x38');this[_0x2a43('0xa')][_0x37f1f0[_0x2a43('0x27')]][_0x2e76cb][_0x2a43('0x39')]=_0x37f1f0['holdtime'];this[_0x2a43('0xa')][_0x37f1f0['uniqueid']][_0x2e76cb][_0x2a43('0x3a')]=_0x37f1f0[_0x2a43('0x3a')];this[_0x2a43('0xa')][_0x37f1f0[_0x2a43('0x27')]][_0x2e76cb][_0x2a43('0x3b')]=_0x37f1f0[_0x2a43('0x3b')];this['channels'][_0x37f1f0[_0x2a43('0x27')]][_0x2e76cb]['destchannelstate']=_0x37f1f0[_0x2a43('0x3c')];this['channels'][_0x37f1f0['uniqueid']][_0x2e76cb][_0x2a43('0x3d')]=_0x37f1f0[_0x2a43('0x3d')];_['merge'](this['agents'][_0x37f1f0[_0x2a43('0x3e')]],_[_0x2a43('0x3f')](_0x37f1f0,['queue',_0x2a43('0x40')]));this[_0x2a43('0x23')](util['format'](_0x2a43('0x34'),_0x37f1f0[_0x2a43('0x41')]),_0x2a43('0x42'),this[_0x2a43('0xa')][_0x37f1f0[_0x2a43('0x27')]][_0x37f1f0['destuniqueid']]);ami['emit']('custom:agentconnect',this[_0x2a43('0xa')][_0x37f1f0[_0x2a43('0x27')]][_0x2e76cb]);}else if(!this[_0x2a43('0xa')][_0x37f1f0['uniqueid']][_0x2e76cb][_0x2a43('0x13')]&&!this['channels'][_0x37f1f0[_0x2a43('0x27')]][_0x2e76cb]['agentcomplete']){this[_0x2a43('0xa')][_0x37f1f0[_0x2a43('0x27')]][_0x2e76cb][_0x2a43('0x13')]=!![];this[_0x2a43('0xa')][_0x37f1f0[_0x2a43('0x27')]][_0x2e76cb][_0x2a43('0x43')]=moment()['format'](_0x2a43('0x2a'));this[_0x2a43('0xa')][_0x37f1f0[_0x2a43('0x27')]][_0x2e76cb][_0x2a43('0x44')]=_0x2a43('0x45');this[_0x2a43('0xa')][_0x37f1f0[_0x2a43('0x27')]][_0x2e76cb][_0x2a43('0x37')]=_0x2a43('0x45');this['channels'][_0x37f1f0['uniqueid']][_0x2e76cb][_0x2a43('0x46')]=_0x37f1f0['destuniqueid'];this[_0x2a43('0xa')][_0x37f1f0['uniqueid']][_0x2e76cb][_0x2a43('0x47')]=_0x37f1f0['membername'];ami[_0x2a43('0x23')](_0x2a43('0x48'),this['channels'][_0x37f1f0['uniqueid']][_0x2e76cb]);}}}}}}catch(_0x5838f9){logger[_0x2a43('0x49')](_0x2a43('0x4a'),util[_0x2a43('0x36')](_0x5838f9,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x2a43('0x14')]=function(_0x27f6e0){try{if(this[_0x2a43('0x25')](_0x27f6e0)){if(this['channels'][_0x27f6e0[_0x2a43('0x27')]]&&this['channels'][_0x27f6e0[_0x2a43('0x27')]][_0x27f6e0[_0x2a43('0x28')]]){this[_0x2a43('0xa')][_0x27f6e0[_0x2a43('0x27')]][_0x27f6e0[_0x2a43('0x28')]]['agentringnoanswer']=!![];this[_0x2a43('0xa')][_0x27f6e0[_0x2a43('0x27')]][_0x27f6e0[_0x2a43('0x28')]][_0x2a43('0x43')]=moment()[_0x2a43('0x29')](_0x2a43('0x2a'));this[_0x2a43('0xa')][_0x27f6e0[_0x2a43('0x27')]][_0x27f6e0['destuniqueid']][_0x2a43('0x44')]=_0x2a43('0x4b');this[_0x2a43('0xa')][_0x27f6e0['uniqueid']][_0x27f6e0[_0x2a43('0x28')]][_0x2a43('0x37')]=_0x2a43('0x4b');ami['emit'](_0x2a43('0x4c'),this[_0x2a43('0xa')][_0x27f6e0['uniqueid']][_0x27f6e0['destuniqueid']]);}}}catch(_0x61b277){logger[_0x2a43('0x49')](_0x2a43('0x4d'),util['inspect'](_0x61b277,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x2a43('0x24')][_0x2a43('0x16')]=function(_0x51c457){try{if(this[_0x2a43('0x25')](_0x51c457)){if(this[_0x2a43('0xa')][_0x51c457[_0x2a43('0x27')]]){for(var _0x1d64a8 in this[_0x2a43('0xa')][_0x51c457[_0x2a43('0x27')]]){if(this[_0x2a43('0xa')][_0x51c457[_0x2a43('0x27')]][_0x2a43('0x4e')](_0x1d64a8)&&!this['channels'][_0x51c457['uniqueid']][_0x1d64a8][_0x2a43('0x13')]&&!this['channels'][_0x51c457[_0x2a43('0x27')]][_0x1d64a8]['agentcomplete']){this[_0x2a43('0xa')][_0x51c457[_0x2a43('0x27')]][_0x1d64a8][_0x2a43('0x13')]=!![];this[_0x2a43('0xa')][_0x51c457['uniqueid']][_0x1d64a8][_0x2a43('0x43')]=moment()[_0x2a43('0x29')](_0x2a43('0x2a'));this[_0x2a43('0xa')][_0x51c457['uniqueid']][_0x1d64a8][_0x2a43('0x44')]=_0x2a43('0x4f');this[_0x2a43('0xa')][_0x51c457[_0x2a43('0x27')]][_0x1d64a8][_0x2a43('0x37')]='abandoned';ami['emit'](_0x2a43('0x50'),this[_0x2a43('0xa')][_0x51c457[_0x2a43('0x27')]][_0x1d64a8]);}}}}}catch(_0x261427){logger['error'](_0x2a43('0x51'),util[_0x2a43('0x36')](_0x261427,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x2a43('0x24')][_0x2a43('0x18')]=function(_0x2769ed){try{if(this[_0x2a43('0x25')](_0x2769ed)){if(this['channels'][_0x2769ed[_0x2a43('0x27')]]){for(var _0x43931a in this['channels'][_0x2769ed[_0x2a43('0x27')]]){if(this['channels'][_0x2769ed[_0x2a43('0x27')]][_0x2a43('0x4e')](_0x43931a)){if(this['channels'][_0x2769ed['uniqueid']][_0x43931a][_0x2a43('0x52')]&&!this[_0x2a43('0xa')][_0x2769ed[_0x2a43('0x27')]][_0x43931a][_0x2a43('0x17')]){this[_0x2a43('0xa')][_0x2769ed[_0x2a43('0x27')]][_0x43931a][_0x2a43('0x17')]=!![];this[_0x2a43('0xa')][_0x2769ed['uniqueid']][_0x43931a]['agentcompleteAt']=moment()[_0x2a43('0x29')](_0x2a43('0x2a'));this[_0x2a43('0xa')][_0x2769ed[_0x2a43('0x27')]][_0x43931a]['lastevent']=_0x2a43('0x53');this[_0x2a43('0xa')][_0x2769ed[_0x2a43('0x27')]][_0x43931a][_0x2a43('0x54')]=_0x2769ed['talktime'];this[_0x2a43('0xa')][_0x2769ed['uniqueid']][_0x43931a][_0x2a43('0x44')]=_0x2769ed[_0x2a43('0x44')]==_0x2a43('0x55')?_0x2a43('0x56'):_0x2769ed[_0x2a43('0x44')];if(this['voiceQueues'][_0x2769ed[_0x2a43('0x2c')]]&&this['voiceQueues'][_0x2769ed[_0x2a43('0x2c')]]['acw']){this[_0x2a43('0xa')][_0x2769ed[_0x2a43('0x27')]][_0x43931a]['agentacw']=!![];this[_0x2a43('0xa')][_0x2769ed[_0x2a43('0x27')]][_0x43931a][_0x2a43('0x57')]=this[_0x2a43('0xb')][_0x2769ed['queue']][_0x2a43('0x58')];}this['agents'][_0x2769ed[_0x2a43('0x3e')]]=_[_0x2a43('0x30')](this[_0x2a43('0xc')][_0x2769ed[_0x2a43('0x3e')]],['queue','destconnectedlinenum']);this['emit'](util[_0x2a43('0x29')]('user:%s',_0x2769ed['membername']),'user:agentcomplete',this[_0x2a43('0xa')][_0x2769ed[_0x2a43('0x27')]][_0x43931a]);ami['emit']('custom:agentcomplete',this[_0x2a43('0xa')][_0x2769ed[_0x2a43('0x27')]][_0x43931a]);}}}}}}catch(_0x40103b){logger[_0x2a43('0x49')](_0x2a43('0x59'),util[_0x2a43('0x36')](_0x40103b,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x2a43('0x5a')]=function(_0x47583e){try{if(this[_0x2a43('0x25')](_0x47583e)){this[_0x2a43('0x5b')](_0x47583e[_0x2a43('0x27')],_[_0x2a43('0x5c')](_0x47583e[_0x2a43('0x5d')])[0x0],_0x47583e[_0x2a43('0x5e')]);if(this[_0x2a43('0xa')][_0x47583e[_0x2a43('0x27')]]){for(var _0x668768 in this['channels'][_0x47583e[_0x2a43('0x27')]]){if(this[_0x2a43('0xa')][_0x47583e[_0x2a43('0x27')]][_0x2a43('0x4e')](_0x668768)){if(_[_0x2a43('0x26')](this[_0x2a43('0xa')][_0x47583e['uniqueid']][_0x668768][_0x2a43('0xd')])){this[_0x2a43('0xa')][_0x47583e[_0x2a43('0x27')]][_0x668768]['variables']={};}this[_0x2a43('0xa')][_0x47583e[_0x2a43('0x27')]][_0x668768][_0x2a43('0xd')]=this[_0x2a43('0xd')][_0x47583e[_0x2a43('0x27')]];}}}}}catch(_0x1d2a2b){logger[_0x2a43('0x49')](_0x2a43('0x5f'),util[_0x2a43('0x36')](_0x1d2a2b,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x2a43('0x24')]['addVariable']=function(_0x3dc6eb,_0xda611a,_0x163b28){var _0x51d46a=[_0x2a43('0x60'),_0x2a43('0x61'),_0x2a43('0x62'),_0x2a43('0x63'),_0x2a43('0x64'),_0x2a43('0x65'),_0x2a43('0x66'),_0x2a43('0x67'),_0x2a43('0x68'),_0x2a43('0x69'),'bridgepeer',_0x2a43('0x6a'),'membercalls',_0x2a43('0x6b'),'memberinterface',_0x2a43('0x6c'),'membername','memberpenalty',_0x2a43('0x6d')];if(!_[_0x2a43('0x6e')](_0xda611a)&&!_[_0x2a43('0x6f')](_0x51d46a,_0xda611a)){if(_[_0x2a43('0x26')](this[_0x2a43('0xd')][_0x3dc6eb])){this['variables'][_0x3dc6eb]={};}this['variables'][_0x3dc6eb][_0xda611a]=_0x163b28;}};VoiceAgentReport[_0x2a43('0x24')][_0x2a43('0x1a')]=function(_0x235f07){try{if(this[_0x2a43('0x25')](_0x235f07)){if(this[_0x2a43('0xa')][_0x235f07['uniqueid']]){for(var _0x243dbc in this['channels'][_0x235f07[_0x2a43('0x27')]]){if(this[_0x2a43('0xa')][_0x235f07[_0x2a43('0x27')]][_0x2a43('0x4e')](_0x243dbc)){if(this[_0x2a43('0xa')][_0x235f07[_0x2a43('0x27')]][_0x243dbc]['reason']=='transfer'&&this[_0x2a43('0xa')][_0x235f07[_0x2a43('0x27')]][_0x243dbc][_0x2a43('0x17')]){this[_0x2a43('0xa')][_0x235f07[_0x2a43('0x27')]][_0x243dbc][_0x2a43('0x70')]=moment()[_0x2a43('0x29')](_0x2a43('0x2a'));}}}ami['emit'](_0x2a43('0x71'),_[_0x2a43('0x72')](this[_0x2a43('0xa')][_0x235f07[_0x2a43('0x27')]]));delete this[_0x2a43('0xa')][_0x235f07[_0x2a43('0x27')]];}if(this['variables'][_0x235f07[_0x2a43('0x27')]]){delete this[_0x2a43('0xd')][_0x235f07['uniqueid']];}}}catch(_0x401366){logger[_0x2a43('0x49')](_0x2a43('0x73'),util[_0x2a43('0x36')](_0x401366,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x2a43('0x24')]['syncAttendedTransfer']=function(_0x3235c8){try{if(this[_0x2a43('0x25')](_0x3235c8)){if(this[_0x2a43('0xa')][_0x3235c8[_0x2a43('0x74')]]){for(var _0x490aca in this['channels'][_0x3235c8[_0x2a43('0x74')]]){if(this['channels'][_0x3235c8['transfereeuniqueid']][_0x2a43('0x4e')](_0x490aca)){if(_0x3235c8[_0x2a43('0x75')]===_0x490aca){var _0x1059e7=moment();this[_0x2a43('0xa')][_0x3235c8[_0x2a43('0x74')]][_0x490aca]['agentcomplete']=!![];this['channels'][_0x3235c8['transfereeuniqueid']][_0x490aca]['agentcompleteAt']=moment()[_0x2a43('0x29')]('YYYY-MM-DD\x20HH:mm:ss');this[_0x2a43('0xa')][_0x3235c8[_0x2a43('0x74')]][_0x490aca]['reason']='transfer';this[_0x2a43('0xa')][_0x3235c8['transfereeuniqueid']][_0x490aca]['lastevent']=_0x2a43('0x53');this[_0x2a43('0xa')][_0x3235c8[_0x2a43('0x74')]][_0x490aca][_0x2a43('0x54')]=_0x1059e7[_0x2a43('0x76')](this[_0x2a43('0xa')][_0x3235c8['transfereeuniqueid']][_0x490aca][_0x2a43('0x52')],'seconds');}}}}if(this[_0x2a43('0xa')][_0x3235c8[_0x2a43('0x77')]]){var _0x3c16fa=this['channels'][_0x3235c8[_0x2a43('0x77')]];this[_0x2a43('0xa')][_0x3235c8[_0x2a43('0x77')]]=this['channels'][_0x3235c8[_0x2a43('0x74')]];this[_0x2a43('0xa')][_0x3235c8[_0x2a43('0x74')]]=_0x3c16fa;}}}catch(_0x531743){logger[_0x2a43('0x49')](_0x2a43('0x78'),util['inspect'](_0x531743,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x2a43('0x24')][_0x2a43('0x22')]=function(_0xf3729){try{if(this[_0x2a43('0x25')](_0xf3729)){if(this['channels'][_0xf3729[_0x2a43('0x74')]]){for(var _0x212712 in this[_0x2a43('0xa')][_0xf3729[_0x2a43('0x74')]]){if(this[_0x2a43('0xa')][_0xf3729[_0x2a43('0x74')]]['hasOwnProperty'](_0x212712)){if(_0xf3729[_0x2a43('0x79')]===_0x212712){var _0x14f5bb=moment();this[_0x2a43('0xa')][_0xf3729[_0x2a43('0x74')]][_0x212712]['agentcomplete']=!![];this[_0x2a43('0xa')][_0xf3729[_0x2a43('0x74')]][_0x212712][_0x2a43('0x70')]=_0x14f5bb;this[_0x2a43('0xa')][_0xf3729[_0x2a43('0x74')]][_0x212712][_0x2a43('0x44')]=_0x2a43('0x55');this[_0x2a43('0xa')][_0xf3729[_0x2a43('0x74')]][_0x212712][_0x2a43('0x37')]=_0x2a43('0x53');this[_0x2a43('0xa')][_0xf3729[_0x2a43('0x74')]][_0x212712][_0x2a43('0x54')]=_0x14f5bb[_0x2a43('0x76')](this[_0x2a43('0xa')][_0xf3729[_0x2a43('0x74')]][_0x212712]['agentconnectAt'],_0x2a43('0x7a'));}}}}}}catch(_0x3774a0){logger['error'](_0x2a43('0x7b'),util[_0x2a43('0x36')](_0x3774a0,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x2a43('0x24')][_0x2a43('0x1c')]=function(_0x278017){var _0x31e42d='';try{if(this['isNotNull'](_0x278017)){if(_0x278017[_0x2a43('0x7c')]){_0x31e42d=_0x278017[_0x2a43('0x7c')][_0x2a43('0x7d')](0x0,_0x278017[_0x2a43('0x7c')]['lastIndexOf']('-'));if(this[_0x2a43('0xc')][_0x31e42d]){this[_0x2a43('0xc')][_0x31e42d][_0x2a43('0x7e')]=!![];}}}}catch(_0x1f514a){logger[_0x2a43('0x49')](_0x2a43('0x7f'),util[_0x2a43('0x36')](_0x1f514a,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x2a43('0x1e')]=function(_0x27b2a7){var _0x35436b='';try{if(this[_0x2a43('0x25')](_0x27b2a7)){if(_0x27b2a7[_0x2a43('0x7c')]){_0x35436b=_0x27b2a7['channel'][_0x2a43('0x7d')](0x0,_0x27b2a7[_0x2a43('0x7c')][_0x2a43('0x80')]('-'));if(this[_0x2a43('0xc')][_0x35436b]){this['agents'][_0x35436b][_0x2a43('0x7e')]=![];}}}}catch(_0x2e08ac){logger[_0x2a43('0x49')](_0x2a43('0x81'),util[_0x2a43('0x36')](_0x2e08ac,{'showHidden':![],'depth':null}));}};module['exports']=VoiceAgentReport;
\ No newline at end of file
diff --git a/server/services/ami/report/voiceCallReport.js b/server/services/ami/report/voiceCallReport.js
index d459f8f..4296ecb 100644
--- a/server/services/ami/report/voiceCallReport.js
+++ b/server/services/ami/report/voiceCallReport.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xe8a4=['xmd-queue','queue','xmd-originatecalleridnum','originatecalleridnum','xmd-destination','xmd-callerid-preview','xmcs-queue','sipcallid','sipcalluniqueid','mixmonitor_filename','parse','[syncVarSet][VoiceCallReport]','endtime','diff','billableseconds','context','omit','destconnectedlinenum','user:agentcomplete','accountcode','custom:voiceCallReport','[syncHangup][VoiceCallReport]','transfereeuniqueid','transfercalleridnum','origtransferercalleridnum','transferconnectedlinenum','transfertargetcalleridnum','transfertargetuniqueid','origtransfereruniqueid','syncBlindTransfer','transfereecalleridnum','extension','syncHangup','BlindTransfer','transfererchannel','[syncBlindTransfer][VoiceCallReport]','mohstarttime','[syncMusicOnHoldStart][VoiceCallReport]','milliseconds','[syncMusicOnHoldStop][VoiceCallReport]','bluebird','moment','path','ioredis','../../../config/environment','ami','../ami','unknown','not_inuse','inuse','busy','invalid','unavailable','ringing','ringinuse','onhold','set','agi','dial','playback','voicemail','FAILED','NO\x20ANSWER','ANSWERED','BUSY','redis','defaults','socket.io-emitter','channels','agents','coreshowchannel','syncNewExten','bind','newchannel','syncNewChannel','newstate','syncNewState','varset','syncVarSet','newcallerid','syncNewCallerId','attendedtransfer','syncAttendedTransfer','musiconholdstart','syncMusicOnHoldStart','syncMusicOnHoldStop','then','actionCoreShowChannels','prototype','isNotNull','isUndefined','emit','uniqueid','linkedid','pick','keys','error','channel','OutgoingSpoolFailed','format','disposition','toNumber','from-sip','split','user:%s','name','user:agentconnect','exten','[syncNewChannel][VoiceCallReport]','inspect','application','toLowerCase','applicationdata','appdata','starttime','duration','subtract','seconds','YYYY-MM-DD\x20HH:mm:ss','lastapplication','lastdata','startsWith','cdr(','match','[syncNewExten][VoiceCallReport]','channelstate','answered','answertime','xcally-motion-preview','connectedlinenum','calleridnum','connectedlinename','calleridname','destinationchannel','membername','UserId','[syncNewState][VoiceCallReport]','syncMixMonitorFilename','monitor','replace','monitorFilename','find','monitors','isNil','push','rec','value','variable','xmd-callerid','callerid','xmd-cdrtype','type'];(function(_0x3e940b,_0x26da84){var _0x3d9a81=function(_0x56e9ba){while(--_0x56e9ba){_0x3e940b['push'](_0x3e940b['shift']());}};_0x3d9a81(++_0x26da84);}(_0xe8a4,0x158));var _0x4e8a=function(_0x54d4a8,_0x585a59){_0x54d4a8=_0x54d4a8-0x0;var _0x3b321b=_0xe8a4[_0x54d4a8];return _0x3b321b;};'use strict';var BPromise=require(_0x4e8a('0x0'));var _=require('lodash');var moment=require(_0x4e8a('0x1'));var util=require('util');var path=require(_0x4e8a('0x2'));var Redis=require(_0x4e8a('0x3'));var config=require(_0x4e8a('0x4'));var logger=require('../../../config/logger')(_0x4e8a('0x5'));var ami=require(_0x4e8a('0x6'));var Channel=require('../model/channel');var statusDesc=[_0x4e8a('0x7'),_0x4e8a('0x8'),_0x4e8a('0x9'),_0x4e8a('0xa'),_0x4e8a('0xb'),_0x4e8a('0xc'),_0x4e8a('0xd'),_0x4e8a('0xe'),_0x4e8a('0xf')];var applications=[_0x4e8a('0x10'),'queue',_0x4e8a('0x11'),_0x4e8a('0x12'),_0x4e8a('0x13'),_0x4e8a('0x14')];var dispositions=['NO\x20ANSWER',_0x4e8a('0x15'),_0x4e8a('0x15'),'NO\x20ANSWER',_0x4e8a('0x16'),_0x4e8a('0x16'),_0x4e8a('0x17'),_0x4e8a('0x18'),'FAILED',_0x4e8a('0x15'),'FAILED'];var actions={};config[_0x4e8a('0x19')]=_[_0x4e8a('0x1a')](config[_0x4e8a('0x19')],{'host':'localhost','port':0x18eb});var io=require(_0x4e8a('0x1b'))(new Redis(config['redis']));function VoiceCallReport(_0x3eaf56){this[_0x4e8a('0x1c')]=_0x3eaf56[_0x4e8a('0x1c')];this['agents']=_0x3eaf56[_0x4e8a('0x1d')];ami['on'](_0x4e8a('0x1e'),this[_0x4e8a('0x1f')][_0x4e8a('0x20')](this));ami['on']('newexten',this[_0x4e8a('0x1f')]['bind'](this));ami['on'](_0x4e8a('0x21'),this[_0x4e8a('0x22')][_0x4e8a('0x20')](this));ami['on'](_0x4e8a('0x23'),this[_0x4e8a('0x24')][_0x4e8a('0x20')](this));ami['on'](_0x4e8a('0x25'),this[_0x4e8a('0x26')][_0x4e8a('0x20')](this));ami['on']('hangup',this['syncHangup']['bind'](this));ami['on'](_0x4e8a('0x27'),this[_0x4e8a('0x28')][_0x4e8a('0x20')](this));ami['on'](_0x4e8a('0x29'),this[_0x4e8a('0x2a')]['bind'](this));ami['on']('blindtransfer',this['syncBlindTransfer']['bind'](this));ami['on'](_0x4e8a('0x2b'),this[_0x4e8a('0x2c')][_0x4e8a('0x20')](this));ami['on']('musiconholdstop',this[_0x4e8a('0x2d')][_0x4e8a('0x20')](this));return BPromise['resolve']()[_0x4e8a('0x2e')](ami[_0x4e8a('0x2f')]())['catch'](function(_0x1c6598){console['log'](_0x1c6598);});}VoiceCallReport[_0x4e8a('0x30')][_0x4e8a('0x31')]=function(_0x3a9d32){return _0x3a9d32!==null&&!_[_0x4e8a('0x32')](_0x3a9d32);};VoiceCallReport['prototype']['emit']=function(_0x27a048,_0x31bbe1,_0x5a71e3){io['to'](_0x27a048)[_0x4e8a('0x33')](_0x31bbe1,_0x5a71e3);};VoiceCallReport['prototype'][_0x4e8a('0x28')]=function(_0x5766c5){try{if(this[_0x4e8a('0x31')](_0x5766c5)){if(_0x5766c5[_0x4e8a('0x34')]===_0x5766c5[_0x4e8a('0x35')]){if(!_[_0x4e8a('0x32')](this[_0x4e8a('0x1c')][_0x5766c5['uniqueid']])){_['merge'](this['channels'][_0x5766c5[_0x4e8a('0x34')]],_[_0x4e8a('0x36')](_0x5766c5,_[_0x4e8a('0x37')](this['channels'][_0x5766c5[_0x4e8a('0x34')]])));}}}}catch(_0x5a85a0){logger[_0x4e8a('0x38')]('[syncNewCallerId][VoiceCallReport]',util['inspect'](_0x5a85a0,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype']['syncNewChannel']=function(_0x2be564){try{if(this[_0x4e8a('0x31')](_0x2be564)){if(_0x2be564[_0x4e8a('0x34')]===_0x2be564[_0x4e8a('0x35')]&&_0x2be564[_0x4e8a('0x39')]!=_0x4e8a('0x3a')){if(_[_0x4e8a('0x32')](this[_0x4e8a('0x1c')][_0x2be564['uniqueid']])){this[_0x4e8a('0x1c')][_0x2be564['uniqueid']]=new Channel();this[_0x4e8a('0x1c')][_0x2be564[_0x4e8a('0x34')]]['starttime']=moment()[_0x4e8a('0x3b')]('YYYY-MM-DD\x20HH:mm:ss');this[_0x4e8a('0x1c')][_0x2be564[_0x4e8a('0x34')]][_0x4e8a('0x3c')]=dispositions[_[_0x4e8a('0x3d')](_0x2be564['channelstate'])];_['merge'](this['channels'][_0x2be564[_0x4e8a('0x34')]],_['pick'](_0x2be564,_[_0x4e8a('0x37')](this[_0x4e8a('0x1c')][_0x2be564[_0x4e8a('0x34')]])));if(_0x2be564['context']===_0x4e8a('0x3e')){if(this[_0x4e8a('0x1d')][_0x2be564[_0x4e8a('0x39')][_0x4e8a('0x3f')]('-')[0x0]]){this[_0x4e8a('0x1d')][_0x2be564[_0x4e8a('0x39')]['split']('-')[0x0]]['destconnectedlinenum']=_0x2be564['exten'];this[_0x4e8a('0x33')](util[_0x4e8a('0x3b')](_0x4e8a('0x40'),this[_0x4e8a('0x1d')][_0x2be564[_0x4e8a('0x39')][_0x4e8a('0x3f')]('-')[0x0]][_0x4e8a('0x41')]),_0x4e8a('0x42'),{'destaccountcode':this['agents'][_0x2be564['channel']['split']('-')[0x0]]['accountcode'],'destconnectedlinenum':_0x2be564[_0x4e8a('0x43')]});}}}}}}catch(_0x4fe83b){logger[_0x4e8a('0x38')](_0x4e8a('0x44'),util[_0x4e8a('0x45')](_0x4fe83b,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0x4e8a('0x1f')]=function(_0x41104e){try{if(this['isNotNull'](_0x41104e)){if(_0x41104e[_0x4e8a('0x34')]===_0x41104e[_0x4e8a('0x35')]&&_0x41104e['exten']!='h'&&_0x41104e['channel']!=_0x4e8a('0x3a')){_0x41104e[_0x4e8a('0x46')]=_0x41104e['application'][_0x4e8a('0x47')]();_0x41104e[_0x4e8a('0x48')]=(_0x41104e[_0x4e8a('0x49')]||_0x41104e[_0x4e8a('0x48')])[_0x4e8a('0x47')]();if(_[_0x4e8a('0x32')](this['channels'][_0x41104e[_0x4e8a('0x34')]])){this['channels'][_0x41104e[_0x4e8a('0x34')]]=new Channel();this[_0x4e8a('0x1c')][_0x41104e['uniqueid']][_0x4e8a('0x4a')]=_0x41104e[_0x4e8a('0x4b')]?moment()[_0x4e8a('0x4c')](moment[_0x4e8a('0x4b')](_0x41104e[_0x4e8a('0x4b')])[_0x4e8a('0x4d')](),_0x4e8a('0x4d'))['format'](_0x4e8a('0x4e')):moment()['format'](_0x4e8a('0x4e'));this['channels'][_0x41104e[_0x4e8a('0x34')]][_0x4e8a('0x3c')]=_0x4e8a('0x16');}_['merge'](this[_0x4e8a('0x1c')][_0x41104e['uniqueid']],_['pick'](_0x41104e,_[_0x4e8a('0x37')](this[_0x4e8a('0x1c')][_0x41104e['uniqueid']])));if(_['includes'](applications,_0x41104e['application'])){this[_0x4e8a('0x1c')][_0x41104e[_0x4e8a('0x34')]][_0x4e8a('0x4f')]=_0x41104e[_0x4e8a('0x46')];this[_0x4e8a('0x1c')][_0x41104e['uniqueid']][_0x4e8a('0x50')]=_0x41104e['applicationdata'];if(_0x41104e['application']===_0x4e8a('0x10')&&_[_0x4e8a('0x51')](_0x41104e[_0x4e8a('0x48')],_0x4e8a('0x52'))){var _0x20b0d2=_0x41104e[_0x4e8a('0x48')][_0x4e8a('0x3f')]('=');var _0x11eb98=_0x20b0d2[0x0][_0x4e8a('0x53')](/cdr\((.*)\)/);if(_0x11eb98){this[_0x4e8a('0x1c')][_0x41104e[_0x4e8a('0x34')]][_0x11eb98[0x1]]=_0x20b0d2[0x1];}}else if(_0x41104e[_0x4e8a('0x46')]==='queue'){this[_0x4e8a('0x1c')][_0x41104e[_0x4e8a('0x34')]]['queue']=_0x41104e[_0x4e8a('0x48')][_0x4e8a('0x3f')](',')[0x0];}}}}}catch(_0x434631){logger['error'](_0x4e8a('0x54'),util[_0x4e8a('0x45')](_0x434631,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x4e8a('0x30')][_0x4e8a('0x24')]=function(_0xf92b28){try{if(this['isNotNull'](_0xf92b28)){if(_0xf92b28[_0x4e8a('0x34')]!==_0xf92b28[_0x4e8a('0x35')]){if(this[_0x4e8a('0x1c')][_0xf92b28[_0x4e8a('0x35')]]){if(_0xf92b28[_0x4e8a('0x55')]==='6'){if(!this[_0x4e8a('0x1c')][_0xf92b28['linkedid']][_0x4e8a('0x56')]){var _0x1d8719=moment();this[_0x4e8a('0x1c')][_0xf92b28['linkedid']][_0x4e8a('0x56')]=!![];this[_0x4e8a('0x1c')][_0xf92b28[_0x4e8a('0x35')]][_0x4e8a('0x57')]=_0x1d8719[_0x4e8a('0x3b')](_0x4e8a('0x4e'));if(this[_0x4e8a('0x1c')][_0xf92b28['linkedid']][_0x4e8a('0x4a')]){this[_0x4e8a('0x1c')][_0xf92b28[_0x4e8a('0x35')]]['holdtime']=_0x1d8719['diff'](this['channels'][_0xf92b28[_0x4e8a('0x35')]][_0x4e8a('0x4a')],_0x4e8a('0x4d'));}}this['channels'][_0xf92b28['linkedid']][_0x4e8a('0x35')]=_0xf92b28['uniqueid'];if(_0xf92b28['calleridnum']!==_0x4e8a('0x58')){this[_0x4e8a('0x1c')][_0xf92b28['linkedid']][_0x4e8a('0x59')]=_0xf92b28[_0x4e8a('0x5a')];}this[_0x4e8a('0x1c')][_0xf92b28[_0x4e8a('0x35')]][_0x4e8a('0x5b')]=_0xf92b28[_0x4e8a('0x5c')];this['channels'][_0xf92b28[_0x4e8a('0x35')]][_0x4e8a('0x5d')]=_0xf92b28[_0x4e8a('0x39')];this['channels'][_0xf92b28['linkedid']][_0x4e8a('0x3c')]=dispositions[_[_0x4e8a('0x3d')](_0xf92b28[_0x4e8a('0x55')])];if(this[_0x4e8a('0x1d')][_0xf92b28[_0x4e8a('0x39')][_0x4e8a('0x3f')]('-')[0x0]]){this['channels'][_0xf92b28[_0x4e8a('0x35')]]['UserId']=this[_0x4e8a('0x1d')][_0xf92b28[_0x4e8a('0x39')][_0x4e8a('0x3f')]('-')[0x0]]['id'];this['channels'][_0xf92b28['linkedid']][_0x4e8a('0x5e')]=this[_0x4e8a('0x1d')][_0xf92b28['channel'][_0x4e8a('0x3f')]('-')[0x0]][_0x4e8a('0x41')];}}}}else{if(this[_0x4e8a('0x1c')][_0xf92b28['uniqueid']]){if(_0xf92b28['channelstate']==='6'){if(this['agents'][_0xf92b28['channel']['split']('-')[0x0]]){this['channels'][_0xf92b28[_0x4e8a('0x34')]][_0x4e8a('0x5f')]=this[_0x4e8a('0x1d')][_0xf92b28[_0x4e8a('0x39')]['split']('-')[0x0]]['id'];this[_0x4e8a('0x1c')][_0xf92b28[_0x4e8a('0x34')]][_0x4e8a('0x5e')]=this[_0x4e8a('0x1d')][_0xf92b28[_0x4e8a('0x39')][_0x4e8a('0x3f')]('-')[0x0]][_0x4e8a('0x41')];}}}}}}catch(_0x182c57){logger['error'](_0x4e8a('0x60'),util[_0x4e8a('0x45')](_0x182c57,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x4e8a('0x30')][_0x4e8a('0x61')]=function(_0x19c96f,_0x24e88e){if(this[_0x4e8a('0x1c')][_0x19c96f]){this['channels'][_0x19c96f][_0x4e8a('0x62')]=!![];if(_['endsWith'](_0x24e88e,'.wav49')){_0x24e88e=_0x24e88e[_0x4e8a('0x63')]('.wav49','.WAV');}this[_0x4e8a('0x1c')][_0x19c96f][_0x4e8a('0x64')]=_0x24e88e;var _0x3c34a3=_[_0x4e8a('0x65')](this[_0x4e8a('0x1c')][_0x19c96f][_0x4e8a('0x66')],{'filename':_0x24e88e});if(_[_0x4e8a('0x67')](_0x3c34a3)){this['channels'][_0x19c96f][_0x4e8a('0x66')][_0x4e8a('0x68')]({'filename':_0x24e88e,'createdAt':moment()[_0x4e8a('0x3b')](_0x4e8a('0x4e')),'mixmonitorid':'','status':_0x4e8a('0x69')});}}};VoiceCallReport[_0x4e8a('0x30')][_0x4e8a('0x26')]=function(_0x1134fa){try{if(this[_0x4e8a('0x31')](_0x1134fa)){if(this[_0x4e8a('0x1c')][_0x1134fa[_0x4e8a('0x34')]]&&_0x1134fa['channel']!=_0x4e8a('0x3a')){if(this['isNotNull'](_0x1134fa['variable'])){if(this[_0x4e8a('0x31')](_0x1134fa['variable']['mixmonitor_filename'])){this[_0x4e8a('0x61')](_0x1134fa[_0x4e8a('0x34')],_0x1134fa[_0x4e8a('0x6a')]);}else if(this['isNotNull'](_0x1134fa[_0x4e8a('0x6b')]['xmd-phone'])){this[_0x4e8a('0x1c')][_0x1134fa[_0x4e8a('0x34')]][_0x4e8a('0x5a')]=_0x1134fa['value'];}else if(this[_0x4e8a('0x31')](_0x1134fa[_0x4e8a('0x6b')][_0x4e8a('0x6c')])){this[_0x4e8a('0x1c')][_0x1134fa[_0x4e8a('0x34')]][_0x4e8a('0x6d')]=_0x1134fa[_0x4e8a('0x6a')];}else if(this['isNotNull'](_0x1134fa[_0x4e8a('0x6b')][_0x4e8a('0x6e')])){this[_0x4e8a('0x1c')][_0x1134fa[_0x4e8a('0x34')]][_0x4e8a('0x6f')]=_0x1134fa[_0x4e8a('0x6a')];}else if(this['isNotNull'](_0x1134fa['variable'][_0x4e8a('0x70')])){this['channels'][_0x1134fa[_0x4e8a('0x34')]][_0x4e8a('0x71')]=_0x1134fa[_0x4e8a('0x6a')][_0x4e8a('0x3f')](',')[0x0];}else if(this[_0x4e8a('0x31')](_0x1134fa['variable'][_0x4e8a('0x72')])){this[_0x4e8a('0x1c')][_0x1134fa[_0x4e8a('0x34')]][_0x4e8a('0x73')]=_0x1134fa[_0x4e8a('0x6a')];}else if(this[_0x4e8a('0x31')](_0x1134fa['variable'][_0x4e8a('0x74')])){this[_0x4e8a('0x1c')][_0x1134fa[_0x4e8a('0x34')]]['destination']=_0x1134fa[_0x4e8a('0x6a')];}else if(this[_0x4e8a('0x31')](_0x1134fa[_0x4e8a('0x6b')][_0x4e8a('0x75')])){this[_0x4e8a('0x1c')][_0x1134fa[_0x4e8a('0x34')]]['calleridpreview']=_0x1134fa[_0x4e8a('0x6a')];}else if(this[_0x4e8a('0x31')](_0x1134fa[_0x4e8a('0x6b')][_0x4e8a('0x76')])){this[_0x4e8a('0x1c')][_0x1134fa['uniqueid']][_0x4e8a('0x71')]=_0x1134fa['value'];}else if(this[_0x4e8a('0x31')](_0x1134fa[_0x4e8a('0x6b')][_0x4e8a('0x77')])){this[_0x4e8a('0x1c')][_0x1134fa['uniqueid']][_0x4e8a('0x78')]=_0x1134fa[_0x4e8a('0x6a')];}}}else if(this['isNotNull'](_0x1134fa[_0x4e8a('0x6b')][_0x4e8a('0x79')])){if(_0x1134fa['value']){var _0x1260b8=path[_0x4e8a('0x7a')](_0x1134fa['value'])[_0x4e8a('0x41')];this[_0x4e8a('0x61')](_0x1260b8,_0x1134fa[_0x4e8a('0x6a')]);}}else if(this[_0x4e8a('0x1c')][_0x1134fa[_0x4e8a('0x35')]]){if(this[_0x4e8a('0x31')](_0x1134fa[_0x4e8a('0x6b')])){if(this[_0x4e8a('0x31')](_0x1134fa['variable'][_0x4e8a('0x77')])){this['channels'][_0x1134fa['linkedid']]['sipcalllinkedid']=_0x1134fa['value'];}}}}}catch(_0x186c68){logger[_0x4e8a('0x38')](_0x4e8a('0x7b'),util[_0x4e8a('0x45')](_0x186c68,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x4e8a('0x30')]['syncHangup']=function(_0x36a7ca){try{if(this[_0x4e8a('0x31')](_0x36a7ca)){if(this[_0x4e8a('0x1c')][_0x36a7ca[_0x4e8a('0x34')]]){var _0x47a725=moment();this[_0x4e8a('0x1c')][_0x36a7ca[_0x4e8a('0x34')]][_0x4e8a('0x7c')]=_0x47a725[_0x4e8a('0x3b')](_0x4e8a('0x4e'));this[_0x4e8a('0x1c')][_0x36a7ca[_0x4e8a('0x34')]]['duration']=_0x47a725[_0x4e8a('0x7d')](this[_0x4e8a('0x1c')][_0x36a7ca['uniqueid']]['starttime'],_0x4e8a('0x4d'));if(this[_0x4e8a('0x1c')][_0x36a7ca[_0x4e8a('0x34')]][_0x4e8a('0x56')]){this[_0x4e8a('0x1c')][_0x36a7ca[_0x4e8a('0x34')]][_0x4e8a('0x7e')]=_0x47a725[_0x4e8a('0x7d')](this[_0x4e8a('0x1c')][_0x36a7ca[_0x4e8a('0x34')]][_0x4e8a('0x57')],_0x4e8a('0x4d'));this[_0x4e8a('0x1c')][_0x36a7ca['uniqueid']]['holdtime']=this['channels'][_0x36a7ca['uniqueid']]['duration']-this[_0x4e8a('0x1c')][_0x36a7ca[_0x4e8a('0x34')]][_0x4e8a('0x7e')];}if(_0x36a7ca[_0x4e8a('0x7f')]===_0x4e8a('0x3e')){if(this[_0x4e8a('0x1d')][_0x36a7ca[_0x4e8a('0x39')][_0x4e8a('0x3f')]('-')[0x0]]){this[_0x4e8a('0x1d')][_0x36a7ca['channel']['split']('-')[0x0]]=_[_0x4e8a('0x80')](this[_0x4e8a('0x1d')][_0x36a7ca[_0x4e8a('0x39')][_0x4e8a('0x3f')]('-')[0x0]],[_0x4e8a('0x81')]);this[_0x4e8a('0x33')](util[_0x4e8a('0x3b')](_0x4e8a('0x40'),this[_0x4e8a('0x1d')][_0x36a7ca['channel'][_0x4e8a('0x3f')]('-')[0x0]][_0x4e8a('0x41')]),_0x4e8a('0x82'),{'destaccountcode':this[_0x4e8a('0x1d')][_0x36a7ca[_0x4e8a('0x39')][_0x4e8a('0x3f')]('-')[0x0]][_0x4e8a('0x83')]});}}ami[_0x4e8a('0x33')](_0x4e8a('0x84'),this[_0x4e8a('0x1c')][_0x36a7ca[_0x4e8a('0x34')]]);delete this[_0x4e8a('0x1c')][_0x36a7ca[_0x4e8a('0x34')]];}}}catch(_0x4f975a){logger[_0x4e8a('0x38')](_0x4e8a('0x85'),util[_0x4e8a('0x45')](_0x4f975a,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x4e8a('0x30')][_0x4e8a('0x2a')]=function(_0x59f31b){try{if(this['isNotNull'](_0x59f31b)){if(this[_0x4e8a('0x1c')][_0x59f31b[_0x4e8a('0x86')]]){this['channels'][_0x59f31b[_0x4e8a('0x86')]][_0x4e8a('0x87')]=_0x59f31b[_0x4e8a('0x88')];this[_0x4e8a('0x1c')][_0x59f31b[_0x4e8a('0x86')]][_0x4e8a('0x89')]=_0x59f31b[_0x4e8a('0x8a')];if(this['channels'][_0x59f31b['secondtransfereruniqueid']]){var _0x31f050=this[_0x4e8a('0x1c')][_0x59f31b['secondtransfereruniqueid']];this[_0x4e8a('0x1c')][_0x59f31b['secondtransfereruniqueid']]=this['channels'][_0x59f31b[_0x4e8a('0x86')]];this['channels'][_0x59f31b[_0x4e8a('0x86')]]=_0x31f050;}}else if(this['channels'][_0x59f31b[_0x4e8a('0x8b')]]){this['channels'][_0x59f31b[_0x4e8a('0x8b')]]['transfercalleridnum']=_0x59f31b[_0x4e8a('0x88')];this[_0x4e8a('0x1c')][_0x59f31b[_0x4e8a('0x8b')]][_0x4e8a('0x89')]=_0x59f31b[_0x4e8a('0x8a')];if(this[_0x4e8a('0x1c')][_0x59f31b[_0x4e8a('0x8c')]]){var _0x31f050=this[_0x4e8a('0x1c')][_0x59f31b[_0x4e8a('0x8c')]];this[_0x4e8a('0x1c')][_0x59f31b['origtransfereruniqueid']]=this[_0x4e8a('0x1c')][_0x59f31b[_0x4e8a('0x8b')]];this[_0x4e8a('0x1c')][_0x59f31b[_0x4e8a('0x8b')]]=_0x31f050;}}}}catch(_0x25df7c){logger['error']('[syncAttendedTransfer][VoiceCallReport]',util[_0x4e8a('0x45')](_0x25df7c,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0x4e8a('0x8d')]=function(_0x5253fe){try{if(this[_0x4e8a('0x31')](_0x5253fe)){if(this[_0x4e8a('0x1c')][_0x5253fe[_0x4e8a('0x86')]]){this[_0x4e8a('0x1c')][_0x5253fe[_0x4e8a('0x86')]][_0x4e8a('0x87')]=_0x5253fe[_0x4e8a('0x8e')];this[_0x4e8a('0x1c')][_0x5253fe[_0x4e8a('0x86')]][_0x4e8a('0x89')]=_0x5253fe[_0x4e8a('0x8f')];this[_0x4e8a('0x90')]({'event':_0x4e8a('0x91'),'uniqueid':_0x5253fe[_0x4e8a('0x86')],'context':_0x5253fe[_0x4e8a('0x7f')],'channel':_0x5253fe[_0x4e8a('0x92')]});}}}catch(_0x2f24a1){logger['error'](_0x4e8a('0x93'),util[_0x4e8a('0x45')](_0x2f24a1,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x4e8a('0x30')]['syncMusicOnHoldStart']=function(_0x1627ef){try{if(this[_0x4e8a('0x31')](_0x1627ef)){if(this[_0x4e8a('0x1c')][_0x1627ef[_0x4e8a('0x34')]]){if(!_[_0x4e8a('0x67')](this[_0x4e8a('0x1c')][_0x1627ef[_0x4e8a('0x34')]][_0x4e8a('0x57')])){this['channels'][_0x1627ef['uniqueid']][_0x4e8a('0x94')]=moment()['format'](_0x4e8a('0x4e'));}}}}catch(_0x5c0245){logger[_0x4e8a('0x38')](_0x4e8a('0x95'),util[_0x4e8a('0x45')](_0x5c0245,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x4e8a('0x30')][_0x4e8a('0x2d')]=function(_0x5ed29c){try{if(this[_0x4e8a('0x31')](_0x5ed29c)){if(this[_0x4e8a('0x1c')][_0x5ed29c['uniqueid']]){if(!_[_0x4e8a('0x67')](this[_0x4e8a('0x1c')][_0x5ed29c[_0x4e8a('0x34')]][_0x4e8a('0x94')])){this[_0x4e8a('0x1c')][_0x5ed29c[_0x4e8a('0x34')]]['mohtime']+=moment()[_0x4e8a('0x96')](0x0)['diff'](this['channels'][_0x5ed29c[_0x4e8a('0x34')]][_0x4e8a('0x94')],_0x4e8a('0x4d'));delete this[_0x4e8a('0x1c')][_0x5ed29c[_0x4e8a('0x34')]][_0x4e8a('0x94')];}}}}catch(_0x670c28){logger[_0x4e8a('0x38')](_0x4e8a('0x97'),util[_0x4e8a('0x45')](_0x670c28,{'showHidden':![],'depth':null}));}};module['exports']=VoiceCallReport;
\ No newline at end of file
+var _0x8d5b=['then','actionCoreShowChannels','catch','log','isNotNull','isUndefined','emit','prototype','syncNewCallerId','uniqueid','linkedid','channels','pick','keys','channel','OutgoingSpoolFailed','starttime','YYYY-MM-DD\x20HH:mm:ss','toNumber','channelstate','merge','context','split','destconnectedlinenum','exten','format','name','user:agentconnect','error','inspect','application','applicationdata','appdata','duration','subtract','seconds','disposition','includes','lastdata','cdr(','match','[syncNewExten][VoiceCallReport]','syncNewState','answered','holdtime','diff','xcally-motion-preview','connectedlinenum','calleridnum','connectedlinename','calleridname','destinationchannel','UserId','membername','[syncNewState][VoiceCallReport]','syncMixMonitorFilename','monitor','endsWith','.wav49','replace','.WAV','monitorFilename','find','monitors','isNil','push','variable','mixmonitor_filename','xmd-phone','xmd-callerid','xmd-cdrtype','type','value','originatecalleridnum','xmd-destination','destination','xmd-callerid-preview','calleridpreview','xmcs-queue','parse','sipcallid','[syncVarSet][VoiceCallReport]','endtime','billableseconds','answertime','from-sip','user:agentcomplete','accountcode','[syncHangup][VoiceCallReport]','transfereeuniqueid','transfercalleridnum','origtransferercalleridnum','transfertargetcalleridnum','secondtransfereruniqueid','transfertargetuniqueid','transferconnectedlinenum','origtransfereruniqueid','[syncAttendedTransfer][VoiceCallReport]','transfereecalleridnum','extension','BlindTransfer','[syncBlindTransfer][VoiceCallReport]','mohstarttime','[syncMusicOnHoldStart][VoiceCallReport]','milliseconds','[syncMusicOnHoldStop][VoiceCallReport]','exports','bluebird','lodash','moment','util','../../../config/environment','../../../config/logger','ami','unknown','inuse','busy','invalid','ringing','ringinuse','onhold','set','queue','dial','voicemail','NO\x20ANSWER','FAILED','BUSY','localhost','socket.io-emitter','agents','coreshowchannel','syncNewExten','bind','newexten','newchannel','syncNewChannel','newstate','varset','syncVarSet','hangup','syncHangup','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','musiconholdstart','syncMusicOnHoldStart','musiconholdstop','syncMusicOnHoldStop','resolve'];(function(_0x2f1a30,_0x75bad6){var _0x410238=function(_0x21a58b){while(--_0x21a58b){_0x2f1a30['push'](_0x2f1a30['shift']());}};_0x410238(++_0x75bad6);}(_0x8d5b,0x102));var _0xb8d5=function(_0x4b89d9,_0x3a4a59){_0x4b89d9=_0x4b89d9-0x0;var _0x5648ac=_0x8d5b[_0x4b89d9];return _0x5648ac;};'use strict';var BPromise=require(_0xb8d5('0x0'));var _=require(_0xb8d5('0x1'));var moment=require(_0xb8d5('0x2'));var util=require(_0xb8d5('0x3'));var path=require('path');var Redis=require('ioredis');var config=require(_0xb8d5('0x4'));var logger=require(_0xb8d5('0x5'))(_0xb8d5('0x6'));var ami=require('../ami');var Channel=require('../model/channel');var statusDesc=[_0xb8d5('0x7'),'not_inuse',_0xb8d5('0x8'),_0xb8d5('0x9'),_0xb8d5('0xa'),'unavailable',_0xb8d5('0xb'),_0xb8d5('0xc'),_0xb8d5('0xd')];var applications=[_0xb8d5('0xe'),_0xb8d5('0xf'),'agi',_0xb8d5('0x10'),'playback',_0xb8d5('0x11')];var dispositions=[_0xb8d5('0x12'),_0xb8d5('0x13'),_0xb8d5('0x13'),_0xb8d5('0x12'),_0xb8d5('0x12'),_0xb8d5('0x12'),'ANSWERED',_0xb8d5('0x14'),_0xb8d5('0x13'),_0xb8d5('0x13'),_0xb8d5('0x13')];var actions={};config['redis']=_['defaults'](config['redis'],{'host':_0xb8d5('0x15'),'port':0x18eb});var io=require(_0xb8d5('0x16'))(new Redis(config['redis']));function VoiceCallReport(_0x3263d3){this['channels']=_0x3263d3['channels'];this[_0xb8d5('0x17')]=_0x3263d3[_0xb8d5('0x17')];ami['on'](_0xb8d5('0x18'),this[_0xb8d5('0x19')][_0xb8d5('0x1a')](this));ami['on'](_0xb8d5('0x1b'),this[_0xb8d5('0x19')]['bind'](this));ami['on'](_0xb8d5('0x1c'),this[_0xb8d5('0x1d')][_0xb8d5('0x1a')](this));ami['on'](_0xb8d5('0x1e'),this['syncNewState'][_0xb8d5('0x1a')](this));ami['on'](_0xb8d5('0x1f'),this[_0xb8d5('0x20')]['bind'](this));ami['on'](_0xb8d5('0x21'),this[_0xb8d5('0x22')][_0xb8d5('0x1a')](this));ami['on']('newcallerid',this['syncNewCallerId']['bind'](this));ami['on'](_0xb8d5('0x23'),this[_0xb8d5('0x24')][_0xb8d5('0x1a')](this));ami['on'](_0xb8d5('0x25'),this[_0xb8d5('0x26')][_0xb8d5('0x1a')](this));ami['on'](_0xb8d5('0x27'),this[_0xb8d5('0x28')][_0xb8d5('0x1a')](this));ami['on'](_0xb8d5('0x29'),this[_0xb8d5('0x2a')][_0xb8d5('0x1a')](this));return BPromise[_0xb8d5('0x2b')]()[_0xb8d5('0x2c')](ami[_0xb8d5('0x2d')]())[_0xb8d5('0x2e')](function(_0x41faec){console[_0xb8d5('0x2f')](_0x41faec);});}VoiceCallReport['prototype'][_0xb8d5('0x30')]=function(_0x113d01){return _0x113d01!==null&&!_[_0xb8d5('0x31')](_0x113d01);};VoiceCallReport['prototype'][_0xb8d5('0x32')]=function(_0x577512,_0x771cea,_0x4dc696){io['to'](_0x577512)[_0xb8d5('0x32')](_0x771cea,_0x4dc696);};VoiceCallReport[_0xb8d5('0x33')][_0xb8d5('0x34')]=function(_0x4cef0b){try{if(this['isNotNull'](_0x4cef0b)){if(_0x4cef0b[_0xb8d5('0x35')]===_0x4cef0b[_0xb8d5('0x36')]){if(!_['isUndefined'](this[_0xb8d5('0x37')][_0x4cef0b[_0xb8d5('0x35')]])){_['merge'](this[_0xb8d5('0x37')][_0x4cef0b[_0xb8d5('0x35')]],_[_0xb8d5('0x38')](_0x4cef0b,_[_0xb8d5('0x39')](this[_0xb8d5('0x37')][_0x4cef0b[_0xb8d5('0x35')]])));}}}}catch(_0x57bdcf){logger['error']('[syncNewCallerId][VoiceCallReport]',util['inspect'](_0x57bdcf,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0xb8d5('0x1d')]=function(_0x194952){try{if(this[_0xb8d5('0x30')](_0x194952)){if(_0x194952[_0xb8d5('0x35')]===_0x194952['linkedid']&&_0x194952[_0xb8d5('0x3a')]!=_0xb8d5('0x3b')){if(_[_0xb8d5('0x31')](this[_0xb8d5('0x37')][_0x194952['uniqueid']])){this[_0xb8d5('0x37')][_0x194952['uniqueid']]=new Channel();this[_0xb8d5('0x37')][_0x194952[_0xb8d5('0x35')]][_0xb8d5('0x3c')]=moment()['format'](_0xb8d5('0x3d'));this[_0xb8d5('0x37')][_0x194952['uniqueid']]['disposition']=dispositions[_[_0xb8d5('0x3e')](_0x194952[_0xb8d5('0x3f')])];_[_0xb8d5('0x40')](this[_0xb8d5('0x37')][_0x194952[_0xb8d5('0x35')]],_[_0xb8d5('0x38')](_0x194952,_['keys'](this[_0xb8d5('0x37')][_0x194952[_0xb8d5('0x35')]])));if(_0x194952[_0xb8d5('0x41')]==='from-sip'){if(this[_0xb8d5('0x17')][_0x194952[_0xb8d5('0x3a')][_0xb8d5('0x42')]('-')[0x0]]){this[_0xb8d5('0x17')][_0x194952[_0xb8d5('0x3a')][_0xb8d5('0x42')]('-')[0x0]][_0xb8d5('0x43')]=_0x194952[_0xb8d5('0x44')];this[_0xb8d5('0x32')](util[_0xb8d5('0x45')]('user:%s',this[_0xb8d5('0x17')][_0x194952[_0xb8d5('0x3a')][_0xb8d5('0x42')]('-')[0x0]][_0xb8d5('0x46')]),_0xb8d5('0x47'),{'destaccountcode':this['agents'][_0x194952[_0xb8d5('0x3a')][_0xb8d5('0x42')]('-')[0x0]]['accountcode'],'destconnectedlinenum':_0x194952[_0xb8d5('0x44')]});}}}}}}catch(_0x6ffb35){logger[_0xb8d5('0x48')]('[syncNewChannel][VoiceCallReport]',util[_0xb8d5('0x49')](_0x6ffb35,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xb8d5('0x33')][_0xb8d5('0x19')]=function(_0xae1494){try{if(this[_0xb8d5('0x30')](_0xae1494)){if(_0xae1494[_0xb8d5('0x35')]===_0xae1494[_0xb8d5('0x36')]&&_0xae1494[_0xb8d5('0x44')]!='h'&&_0xae1494[_0xb8d5('0x3a')]!='OutgoingSpoolFailed'){_0xae1494[_0xb8d5('0x4a')]=_0xae1494[_0xb8d5('0x4a')]['toLowerCase']();_0xae1494[_0xb8d5('0x4b')]=(_0xae1494[_0xb8d5('0x4c')]||_0xae1494['applicationdata'])['toLowerCase']();if(_[_0xb8d5('0x31')](this[_0xb8d5('0x37')][_0xae1494[_0xb8d5('0x35')]])){this[_0xb8d5('0x37')][_0xae1494[_0xb8d5('0x35')]]=new Channel();this[_0xb8d5('0x37')][_0xae1494[_0xb8d5('0x35')]][_0xb8d5('0x3c')]=_0xae1494[_0xb8d5('0x4d')]?moment()[_0xb8d5('0x4e')](moment[_0xb8d5('0x4d')](_0xae1494[_0xb8d5('0x4d')])[_0xb8d5('0x4f')](),_0xb8d5('0x4f'))[_0xb8d5('0x45')](_0xb8d5('0x3d')):moment()[_0xb8d5('0x45')](_0xb8d5('0x3d'));this['channels'][_0xae1494[_0xb8d5('0x35')]][_0xb8d5('0x50')]=_0xb8d5('0x12');}_[_0xb8d5('0x40')](this['channels'][_0xae1494[_0xb8d5('0x35')]],_[_0xb8d5('0x38')](_0xae1494,_['keys'](this['channels'][_0xae1494[_0xb8d5('0x35')]])));if(_[_0xb8d5('0x51')](applications,_0xae1494[_0xb8d5('0x4a')])){this['channels'][_0xae1494['uniqueid']]['lastapplication']=_0xae1494[_0xb8d5('0x4a')];this[_0xb8d5('0x37')][_0xae1494[_0xb8d5('0x35')]][_0xb8d5('0x52')]=_0xae1494[_0xb8d5('0x4b')];if(_0xae1494[_0xb8d5('0x4a')]===_0xb8d5('0xe')&&_['startsWith'](_0xae1494[_0xb8d5('0x4b')],_0xb8d5('0x53'))){var _0x4e3bbc=_0xae1494[_0xb8d5('0x4b')][_0xb8d5('0x42')]('=');var _0x458b9=_0x4e3bbc[0x0][_0xb8d5('0x54')](/cdr\((.*)\)/);if(_0x458b9){this[_0xb8d5('0x37')][_0xae1494[_0xb8d5('0x35')]][_0x458b9[0x1]]=_0x4e3bbc[0x1];}}else if(_0xae1494[_0xb8d5('0x4a')]===_0xb8d5('0xf')){this[_0xb8d5('0x37')][_0xae1494[_0xb8d5('0x35')]][_0xb8d5('0xf')]=_0xae1494[_0xb8d5('0x4b')][_0xb8d5('0x42')](',')[0x0];}}}}}catch(_0x57ee9d){logger[_0xb8d5('0x48')](_0xb8d5('0x55'),util[_0xb8d5('0x49')](_0x57ee9d,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xb8d5('0x33')][_0xb8d5('0x56')]=function(_0xaa0bc1){try{if(this['isNotNull'](_0xaa0bc1)){if(_0xaa0bc1['uniqueid']!==_0xaa0bc1[_0xb8d5('0x36')]){if(this[_0xb8d5('0x37')][_0xaa0bc1[_0xb8d5('0x36')]]){if(_0xaa0bc1[_0xb8d5('0x3f')]==='6'){if(!this[_0xb8d5('0x37')][_0xaa0bc1[_0xb8d5('0x36')]][_0xb8d5('0x57')]){var _0x5cd656=moment();this[_0xb8d5('0x37')][_0xaa0bc1['linkedid']][_0xb8d5('0x57')]=!![];this[_0xb8d5('0x37')][_0xaa0bc1[_0xb8d5('0x36')]]['answertime']=_0x5cd656[_0xb8d5('0x45')](_0xb8d5('0x3d'));if(this['channels'][_0xaa0bc1[_0xb8d5('0x36')]]['starttime']){this['channels'][_0xaa0bc1[_0xb8d5('0x36')]][_0xb8d5('0x58')]=_0x5cd656[_0xb8d5('0x59')](this[_0xb8d5('0x37')][_0xaa0bc1[_0xb8d5('0x36')]]['starttime'],_0xb8d5('0x4f'));}}this['channels'][_0xaa0bc1[_0xb8d5('0x36')]][_0xb8d5('0x36')]=_0xaa0bc1[_0xb8d5('0x35')];if(_0xaa0bc1['calleridnum']!==_0xb8d5('0x5a')){this[_0xb8d5('0x37')][_0xaa0bc1[_0xb8d5('0x36')]][_0xb8d5('0x5b')]=_0xaa0bc1[_0xb8d5('0x5c')];}this['channels'][_0xaa0bc1[_0xb8d5('0x36')]][_0xb8d5('0x5d')]=_0xaa0bc1[_0xb8d5('0x5e')];this[_0xb8d5('0x37')][_0xaa0bc1[_0xb8d5('0x36')]][_0xb8d5('0x5f')]=_0xaa0bc1[_0xb8d5('0x3a')];this['channels'][_0xaa0bc1[_0xb8d5('0x36')]][_0xb8d5('0x50')]=dispositions[_[_0xb8d5('0x3e')](_0xaa0bc1['channelstate'])];if(this[_0xb8d5('0x17')][_0xaa0bc1[_0xb8d5('0x3a')][_0xb8d5('0x42')]('-')[0x0]]){this[_0xb8d5('0x37')][_0xaa0bc1['linkedid']][_0xb8d5('0x60')]=this[_0xb8d5('0x17')][_0xaa0bc1['channel']['split']('-')[0x0]]['id'];this[_0xb8d5('0x37')][_0xaa0bc1[_0xb8d5('0x36')]][_0xb8d5('0x61')]=this['agents'][_0xaa0bc1[_0xb8d5('0x3a')][_0xb8d5('0x42')]('-')[0x0]][_0xb8d5('0x46')];}}}}else{if(this['channels'][_0xaa0bc1[_0xb8d5('0x35')]]){if(_0xaa0bc1[_0xb8d5('0x3f')]==='6'){if(this[_0xb8d5('0x17')][_0xaa0bc1[_0xb8d5('0x3a')][_0xb8d5('0x42')]('-')[0x0]]){this[_0xb8d5('0x37')][_0xaa0bc1[_0xb8d5('0x35')]][_0xb8d5('0x60')]=this[_0xb8d5('0x17')][_0xaa0bc1[_0xb8d5('0x3a')][_0xb8d5('0x42')]('-')[0x0]]['id'];this[_0xb8d5('0x37')][_0xaa0bc1[_0xb8d5('0x35')]][_0xb8d5('0x61')]=this['agents'][_0xaa0bc1[_0xb8d5('0x3a')][_0xb8d5('0x42')]('-')[0x0]][_0xb8d5('0x46')];}}}}}}catch(_0x151661){logger['error'](_0xb8d5('0x62'),util[_0xb8d5('0x49')](_0x151661,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xb8d5('0x33')][_0xb8d5('0x63')]=function(_0x4fd1ab,_0x4c01da){if(this[_0xb8d5('0x37')][_0x4fd1ab]){this['channels'][_0x4fd1ab][_0xb8d5('0x64')]=!![];if(_[_0xb8d5('0x65')](_0x4c01da,_0xb8d5('0x66'))){_0x4c01da=_0x4c01da[_0xb8d5('0x67')]('.wav49',_0xb8d5('0x68'));}this[_0xb8d5('0x37')][_0x4fd1ab][_0xb8d5('0x69')]=_0x4c01da;var _0x4df7f4=_[_0xb8d5('0x6a')](this[_0xb8d5('0x37')][_0x4fd1ab][_0xb8d5('0x6b')],{'filename':_0x4c01da});if(_[_0xb8d5('0x6c')](_0x4df7f4)){this[_0xb8d5('0x37')][_0x4fd1ab][_0xb8d5('0x6b')][_0xb8d5('0x6d')]({'filename':_0x4c01da,'createdAt':moment()[_0xb8d5('0x45')](_0xb8d5('0x3d')),'mixmonitorid':'','status':'rec'});}}};VoiceCallReport[_0xb8d5('0x33')][_0xb8d5('0x20')]=function(_0x5ba6d9){try{if(this['isNotNull'](_0x5ba6d9)){if(this[_0xb8d5('0x37')][_0x5ba6d9[_0xb8d5('0x35')]]&&_0x5ba6d9[_0xb8d5('0x3a')]!=_0xb8d5('0x3b')){if(this['isNotNull'](_0x5ba6d9[_0xb8d5('0x6e')])){if(this['isNotNull'](_0x5ba6d9[_0xb8d5('0x6e')][_0xb8d5('0x6f')])){this['syncMixMonitorFilename'](_0x5ba6d9[_0xb8d5('0x35')],_0x5ba6d9['value']);}else if(this[_0xb8d5('0x30')](_0x5ba6d9[_0xb8d5('0x6e')][_0xb8d5('0x70')])){this[_0xb8d5('0x37')][_0x5ba6d9[_0xb8d5('0x35')]][_0xb8d5('0x5c')]=_0x5ba6d9['value'];}else if(this[_0xb8d5('0x30')](_0x5ba6d9[_0xb8d5('0x6e')][_0xb8d5('0x71')])){this[_0xb8d5('0x37')][_0x5ba6d9[_0xb8d5('0x35')]]['callerid']=_0x5ba6d9['value'];}else if(this[_0xb8d5('0x30')](_0x5ba6d9[_0xb8d5('0x6e')][_0xb8d5('0x72')])){this[_0xb8d5('0x37')][_0x5ba6d9[_0xb8d5('0x35')]][_0xb8d5('0x73')]=_0x5ba6d9[_0xb8d5('0x74')];}else if(this[_0xb8d5('0x30')](_0x5ba6d9[_0xb8d5('0x6e')]['xmd-queue'])){this[_0xb8d5('0x37')][_0x5ba6d9[_0xb8d5('0x35')]][_0xb8d5('0xf')]=_0x5ba6d9[_0xb8d5('0x74')][_0xb8d5('0x42')](',')[0x0];}else if(this[_0xb8d5('0x30')](_0x5ba6d9['variable']['xmd-originatecalleridnum'])){this['channels'][_0x5ba6d9[_0xb8d5('0x35')]][_0xb8d5('0x75')]=_0x5ba6d9['value'];}else if(this[_0xb8d5('0x30')](_0x5ba6d9['variable'][_0xb8d5('0x76')])){this['channels'][_0x5ba6d9[_0xb8d5('0x35')]][_0xb8d5('0x77')]=_0x5ba6d9['value'];}else if(this[_0xb8d5('0x30')](_0x5ba6d9['variable'][_0xb8d5('0x78')])){this[_0xb8d5('0x37')][_0x5ba6d9['uniqueid']][_0xb8d5('0x79')]=_0x5ba6d9[_0xb8d5('0x74')];}else if(this[_0xb8d5('0x30')](_0x5ba6d9[_0xb8d5('0x6e')][_0xb8d5('0x7a')])){this[_0xb8d5('0x37')][_0x5ba6d9[_0xb8d5('0x35')]]['queue']=_0x5ba6d9[_0xb8d5('0x74')];}else if(this[_0xb8d5('0x30')](_0x5ba6d9[_0xb8d5('0x6e')]['sipcallid'])){this[_0xb8d5('0x37')][_0x5ba6d9[_0xb8d5('0x35')]]['sipcalluniqueid']=_0x5ba6d9[_0xb8d5('0x74')];}}}else if(this['isNotNull'](_0x5ba6d9[_0xb8d5('0x6e')]['mixmonitor_filename'])){if(_0x5ba6d9[_0xb8d5('0x74')]){var _0x2576c1=path[_0xb8d5('0x7b')](_0x5ba6d9[_0xb8d5('0x74')])['name'];this[_0xb8d5('0x63')](_0x2576c1,_0x5ba6d9[_0xb8d5('0x74')]);}}else if(this[_0xb8d5('0x37')][_0x5ba6d9[_0xb8d5('0x36')]]){if(this[_0xb8d5('0x30')](_0x5ba6d9['variable'])){if(this[_0xb8d5('0x30')](_0x5ba6d9[_0xb8d5('0x6e')][_0xb8d5('0x7c')])){this['channels'][_0x5ba6d9['linkedid']]['sipcalllinkedid']=_0x5ba6d9[_0xb8d5('0x74')];}}}}}catch(_0x539a6a){logger['error'](_0xb8d5('0x7d'),util[_0xb8d5('0x49')](_0x539a6a,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xb8d5('0x33')]['syncHangup']=function(_0xce90ad){try{if(this[_0xb8d5('0x30')](_0xce90ad)){if(this[_0xb8d5('0x37')][_0xce90ad['uniqueid']]){var _0x59a680=moment();this['channels'][_0xce90ad[_0xb8d5('0x35')]][_0xb8d5('0x7e')]=_0x59a680[_0xb8d5('0x45')](_0xb8d5('0x3d'));this[_0xb8d5('0x37')][_0xce90ad[_0xb8d5('0x35')]][_0xb8d5('0x4d')]=_0x59a680[_0xb8d5('0x59')](this[_0xb8d5('0x37')][_0xce90ad[_0xb8d5('0x35')]][_0xb8d5('0x3c')],'seconds');if(this[_0xb8d5('0x37')][_0xce90ad[_0xb8d5('0x35')]][_0xb8d5('0x57')]){this[_0xb8d5('0x37')][_0xce90ad[_0xb8d5('0x35')]][_0xb8d5('0x7f')]=_0x59a680[_0xb8d5('0x59')](this[_0xb8d5('0x37')][_0xce90ad[_0xb8d5('0x35')]][_0xb8d5('0x80')],_0xb8d5('0x4f'));this[_0xb8d5('0x37')][_0xce90ad[_0xb8d5('0x35')]][_0xb8d5('0x58')]=this['channels'][_0xce90ad['uniqueid']][_0xb8d5('0x4d')]-this[_0xb8d5('0x37')][_0xce90ad[_0xb8d5('0x35')]][_0xb8d5('0x7f')];}if(_0xce90ad['context']===_0xb8d5('0x81')){if(this['agents'][_0xce90ad['channel'][_0xb8d5('0x42')]('-')[0x0]]){this[_0xb8d5('0x17')][_0xce90ad[_0xb8d5('0x3a')]['split']('-')[0x0]]=_['omit'](this['agents'][_0xce90ad[_0xb8d5('0x3a')][_0xb8d5('0x42')]('-')[0x0]],[_0xb8d5('0x43')]);this[_0xb8d5('0x32')](util[_0xb8d5('0x45')]('user:%s',this[_0xb8d5('0x17')][_0xce90ad['channel'][_0xb8d5('0x42')]('-')[0x0]]['name']),_0xb8d5('0x82'),{'destaccountcode':this['agents'][_0xce90ad[_0xb8d5('0x3a')][_0xb8d5('0x42')]('-')[0x0]][_0xb8d5('0x83')]});}}ami['emit']('custom:voiceCallReport',this[_0xb8d5('0x37')][_0xce90ad[_0xb8d5('0x35')]]);delete this['channels'][_0xce90ad[_0xb8d5('0x35')]];}}}catch(_0x2e3eee){logger[_0xb8d5('0x48')](_0xb8d5('0x84'),util[_0xb8d5('0x49')](_0x2e3eee,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xb8d5('0x33')][_0xb8d5('0x24')]=function(_0xcb1acf){try{if(this[_0xb8d5('0x30')](_0xcb1acf)){if(this[_0xb8d5('0x37')][_0xcb1acf[_0xb8d5('0x85')]]){this[_0xb8d5('0x37')][_0xcb1acf[_0xb8d5('0x85')]][_0xb8d5('0x86')]=_0xcb1acf[_0xb8d5('0x87')];this[_0xb8d5('0x37')][_0xcb1acf[_0xb8d5('0x85')]]['transferconnectedlinenum']=_0xcb1acf[_0xb8d5('0x88')];if(this['channels'][_0xcb1acf['secondtransfereruniqueid']]){var _0x37e006=this[_0xb8d5('0x37')][_0xcb1acf[_0xb8d5('0x89')]];this['channels'][_0xcb1acf[_0xb8d5('0x89')]]=this[_0xb8d5('0x37')][_0xcb1acf['transfereeuniqueid']];this[_0xb8d5('0x37')][_0xcb1acf[_0xb8d5('0x85')]]=_0x37e006;}}else if(this['channels'][_0xcb1acf['transfertargetuniqueid']]){this[_0xb8d5('0x37')][_0xcb1acf[_0xb8d5('0x8a')]][_0xb8d5('0x86')]=_0xcb1acf['origtransferercalleridnum'];this[_0xb8d5('0x37')][_0xcb1acf[_0xb8d5('0x8a')]][_0xb8d5('0x8b')]=_0xcb1acf[_0xb8d5('0x88')];if(this[_0xb8d5('0x37')][_0xcb1acf[_0xb8d5('0x8c')]]){var _0x37e006=this['channels'][_0xcb1acf[_0xb8d5('0x8c')]];this['channels'][_0xcb1acf[_0xb8d5('0x8c')]]=this[_0xb8d5('0x37')][_0xcb1acf[_0xb8d5('0x8a')]];this[_0xb8d5('0x37')][_0xcb1acf[_0xb8d5('0x8a')]]=_0x37e006;}}}}catch(_0xe2b2cd){logger['error'](_0xb8d5('0x8d'),util[_0xb8d5('0x49')](_0xe2b2cd,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xb8d5('0x33')][_0xb8d5('0x26')]=function(_0x12e2f6){try{if(this['isNotNull'](_0x12e2f6)){if(this['channels'][_0x12e2f6['transfereeuniqueid']]){this[_0xb8d5('0x37')][_0x12e2f6['transfereeuniqueid']][_0xb8d5('0x86')]=_0x12e2f6[_0xb8d5('0x8e')];this[_0xb8d5('0x37')][_0x12e2f6[_0xb8d5('0x85')]][_0xb8d5('0x8b')]=_0x12e2f6[_0xb8d5('0x8f')];this[_0xb8d5('0x22')]({'event':_0xb8d5('0x90'),'uniqueid':_0x12e2f6[_0xb8d5('0x85')],'context':_0x12e2f6[_0xb8d5('0x41')],'channel':_0x12e2f6['transfererchannel']});}}}catch(_0x18f32c){logger['error'](_0xb8d5('0x91'),util['inspect'](_0x18f32c,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xb8d5('0x33')][_0xb8d5('0x28')]=function(_0xf02bf5){try{if(this['isNotNull'](_0xf02bf5)){if(this[_0xb8d5('0x37')][_0xf02bf5[_0xb8d5('0x35')]]){if(!_[_0xb8d5('0x6c')](this[_0xb8d5('0x37')][_0xf02bf5['uniqueid']]['answertime'])){this[_0xb8d5('0x37')][_0xf02bf5['uniqueid']][_0xb8d5('0x92')]=moment()[_0xb8d5('0x45')](_0xb8d5('0x3d'));}}}}catch(_0x4602a7){logger[_0xb8d5('0x48')](_0xb8d5('0x93'),util[_0xb8d5('0x49')](_0x4602a7,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0xb8d5('0x2a')]=function(_0x48b3d6){try{if(this[_0xb8d5('0x30')](_0x48b3d6)){if(this[_0xb8d5('0x37')][_0x48b3d6['uniqueid']]){if(!_[_0xb8d5('0x6c')](this[_0xb8d5('0x37')][_0x48b3d6['uniqueid']][_0xb8d5('0x92')])){this[_0xb8d5('0x37')][_0x48b3d6[_0xb8d5('0x35')]]['mohtime']+=moment()[_0xb8d5('0x94')](0x0)[_0xb8d5('0x59')](this[_0xb8d5('0x37')][_0x48b3d6[_0xb8d5('0x35')]][_0xb8d5('0x92')],'seconds');delete this[_0xb8d5('0x37')][_0x48b3d6[_0xb8d5('0x35')]][_0xb8d5('0x92')];}}}}catch(_0x2e4a71){logger[_0xb8d5('0x48')](_0xb8d5('0x95'),util[_0xb8d5('0x49')](_0x2e4a71,{'showHidden':![],'depth':null}));}};module[_0xb8d5('0x96')]=VoiceCallReport;
\ No newline at end of file
diff --git a/server/services/ami/report/voiceDialReport.js b/server/services/ami/report/voiceDialReport.js
index 8d1df9d..dbffd77 100644
--- a/server/services/ami/report/voiceDialReport.js
+++ b/server/services/ami/report/voiceDialReport.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xcb4f=['channel','lastIndexOf','omit','privilege','voice:outbound','voice_outbound_channel:save','custom:dialbegin','uniqueid','error','[syncDialBegin][VoiceDialReport]','inspect','isNotNull','dialstatus','connectedlinenum','connectedlinename','lastevent','custom:dialconnect','[syncDialEnd][VoiceDialReport]','keys','variable','value','outboundrouteid','isUndefined','[syncVarSet][VoiceDialReport]','addVariable','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqosrttbridged','sipuri','bridgepeer','bridgepvtcallid','membercalls','memberdynamic','memberlastcall','membername','memberpenalty','includes','endtime','duration','diff','starttime','total','answered','holdtime','answertime','seconds','billableseconds','sumHoldTime','sumBillable','custom:voiceDialReport','custom:dialend','voice_outbound:save','info','[DEBUG]\x20Emit\x20voice_outbound_channel:remove\x20event','stringify','[syncHangup][VoiceDialReport]','exports','lodash','moment','ioredis','../../../config/environment','../../../config/logger','ami','../ami','defaults','redis','localhost','socket.io-emitter','channels','outbound','variables','dialbegin','syncDialBegin','bind','dialend','syncDialEnd','syncVarSet','hangup','syncHangup','prototype','emit','merge','format','YYYY-MM-DD\x20HH:mm:ss','called','substring'];(function(_0x5d7722,_0x54eea4){var _0x495f29=function(_0x5b92e3){while(--_0x5b92e3){_0x5d7722['push'](_0x5d7722['shift']());}};_0x495f29(++_0x54eea4);}(_0xcb4f,0x147));var _0xfcb4=function(_0x15bc81,_0x4d4f77){_0x15bc81=_0x15bc81-0x0;var _0x59440e=_0xcb4f[_0x15bc81];return _0x59440e;};'use strict';var _=require(_0xfcb4('0x0'));var moment=require(_0xfcb4('0x1'));var util=require('util');var Redis=require(_0xfcb4('0x2'));var config=require(_0xfcb4('0x3'));var logger=require(_0xfcb4('0x4'))(_0xfcb4('0x5'));var ami=require(_0xfcb4('0x6'));config['redis']=_[_0xfcb4('0x7')](config[_0xfcb4('0x8')],{'host':_0xfcb4('0x9'),'port':0x18eb});var io=require(_0xfcb4('0xa'))(new Redis(config[_0xfcb4('0x8')]));function VoiceDialReport(_0x2648b7){this[_0xfcb4('0xb')]=_0x2648b7['outboundChannels'];this[_0xfcb4('0xc')]=_0x2648b7['outbound'];this[_0xfcb4('0xd')]={};ami['on'](_0xfcb4('0xe'),this[_0xfcb4('0xf')][_0xfcb4('0x10')](this));ami['on'](_0xfcb4('0x11'),this[_0xfcb4('0x12')]['bind'](this));ami['on']('varset',this[_0xfcb4('0x13')][_0xfcb4('0x10')](this));ami['on'](_0xfcb4('0x14'),this[_0xfcb4('0x15')][_0xfcb4('0x10')](this));}VoiceDialReport['prototype']['isNotNull']=function(_0x7a31a1){return _0x7a31a1!==null&&!_['isUndefined'](_0x7a31a1);};VoiceDialReport[_0xfcb4('0x16')]['emit']=function(_0x7899e3,_0x60dbbe,_0x3caf19){io['to'](_0x7899e3)[_0xfcb4('0x17')](_0x60dbbe,_0x3caf19);};VoiceDialReport[_0xfcb4('0x16')]['syncDialBegin']=function(_0x514fc8){try{if(this['isNotNull'](_0x514fc8)){if(this[_0xfcb4('0xb')][_0x514fc8['uniqueid']]){_[_0xfcb4('0x18')](this['channels'][_0x514fc8['uniqueid']],{'starttime':moment()[_0xfcb4('0x19')](_0xfcb4('0x1a')),'lastevent':_0xfcb4('0x1b'),'interface':_0x514fc8['channel'][_0xfcb4('0x1c')](0x0,_0x514fc8[_0xfcb4('0x1d')][_0xfcb4('0x1e')]('-')),'membername':_0x514fc8[_0xfcb4('0x1d')][_0xfcb4('0x1c')](_0x514fc8['channel'][_0xfcb4('0x1e')]('/')+0x1,_0x514fc8['channel'][_0xfcb4('0x1e')]('-'))},_[_0xfcb4('0x1f')](_0x514fc8,['event',_0xfcb4('0x20')]));this['emit'](_0xfcb4('0x21'),_0xfcb4('0x22'),this['channels'][_0x514fc8['uniqueid']]);ami[_0xfcb4('0x17')](_0xfcb4('0x23'),this['channels'][_0x514fc8[_0xfcb4('0x24')]]);}}}catch(_0x54e352){logger[_0xfcb4('0x25')](_0xfcb4('0x26'),util[_0xfcb4('0x27')](_0x54e352,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0xfcb4('0x16')][_0xfcb4('0x12')]=function(_0x3a37e1){try{if(this[_0xfcb4('0x28')](_0x3a37e1)){if(this[_0xfcb4('0xb')][_0x3a37e1['uniqueid']]){this['channels'][_0x3a37e1[_0xfcb4('0x24')]][_0xfcb4('0x29')]=_0x3a37e1['dialstatus'];if(_0x3a37e1[_0xfcb4('0x29')]==='ANSWER'){this[_0xfcb4('0xb')][_0x3a37e1[_0xfcb4('0x24')]][_0xfcb4('0x2a')]=_0x3a37e1[_0xfcb4('0x2a')];this[_0xfcb4('0xb')][_0x3a37e1['uniqueid']][_0xfcb4('0x2b')]=_0x3a37e1[_0xfcb4('0x2b')];this['channels'][_0x3a37e1[_0xfcb4('0x24')]]['answertime']=moment()[_0xfcb4('0x19')](_0xfcb4('0x1a'));this[_0xfcb4('0xb')][_0x3a37e1[_0xfcb4('0x24')]][_0xfcb4('0x2c')]='connect';ami[_0xfcb4('0x17')](_0xfcb4('0x2d'),this[_0xfcb4('0xb')][_0x3a37e1[_0xfcb4('0x24')]]);}this['emit'](_0xfcb4('0x21'),_0xfcb4('0x22'),this[_0xfcb4('0xb')][_0x3a37e1['uniqueid']]);}}}catch(_0x1f08cf){logger[_0xfcb4('0x25')](_0xfcb4('0x2e'),util[_0xfcb4('0x27')](_0x1f08cf,{'showHidden':![],'depth':null}));}};VoiceDialReport['prototype'][_0xfcb4('0x13')]=function(_0x5a1e81){try{if(this[_0xfcb4('0x28')](_0x5a1e81)){this['addVariable'](_0x5a1e81[_0xfcb4('0x24')],_[_0xfcb4('0x2f')](_0x5a1e81[_0xfcb4('0x30')])[0x0],_0x5a1e81[_0xfcb4('0x31')]);if(this[_0xfcb4('0x28')](_0x5a1e81[_0xfcb4('0x30')])&&this[_0xfcb4('0x28')](_0x5a1e81[_0xfcb4('0x30')][_0xfcb4('0x32')])){if(_[_0xfcb4('0x33')](this[_0xfcb4('0xb')][_0x5a1e81[_0xfcb4('0x24')]])){this['channels'][_0x5a1e81[_0xfcb4('0x24')]]={'routeId':_0x5a1e81['value'],'variables':this[_0xfcb4('0xd')][_0x5a1e81[_0xfcb4('0x24')]]};this[_0xfcb4('0x17')](_0xfcb4('0x21'),_0xfcb4('0x22'),this[_0xfcb4('0xb')][_0x5a1e81[_0xfcb4('0x24')]]);}}}}catch(_0xb62617){logger[_0xfcb4('0x25')](_0xfcb4('0x34'),util[_0xfcb4('0x27')](_0xb62617,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0xfcb4('0x16')][_0xfcb4('0x35')]=function(_0x27d3d3,_0x1a4a3f,_0x3b8f29){var _0x5234ff=[_0xfcb4('0x36'),_0xfcb4('0x37'),_0xfcb4('0x38'),_0xfcb4('0x39'),_0xfcb4('0x3a'),'rtpaudioqoslossbridged','rtpaudioqosrtt',_0xfcb4('0x3b'),'sipcallid',_0xfcb4('0x3c'),_0xfcb4('0x3d'),_0xfcb4('0x3e'),_0xfcb4('0x3f'),_0xfcb4('0x40'),'memberinterface',_0xfcb4('0x41'),_0xfcb4('0x42'),_0xfcb4('0x43'),'memberrealtime'];if(!_['isNil'](_0x1a4a3f)&&!_[_0xfcb4('0x44')](_0x5234ff,_0x1a4a3f)){if(_[_0xfcb4('0x33')](this[_0xfcb4('0xd')][_0x27d3d3])){this[_0xfcb4('0xd')][_0x27d3d3]={};}this['variables'][_0x27d3d3][_0x1a4a3f]=_0x3b8f29;}};VoiceDialReport[_0xfcb4('0x16')]['syncHangup']=function(_0x295769){try{if(this[_0xfcb4('0x28')](_0x295769)){if(this[_0xfcb4('0xb')][_0x295769['uniqueid']]){this[_0xfcb4('0xb')][_0x295769['uniqueid']][_0xfcb4('0x45')]=moment()[_0xfcb4('0x19')]('YYYY-MM-DD\x20HH:mm:ss');this['channels'][_0x295769[_0xfcb4('0x24')]][_0xfcb4('0x46')]=moment(this[_0xfcb4('0xb')][_0x295769[_0xfcb4('0x24')]][_0xfcb4('0x45')])[_0xfcb4('0x47')](this[_0xfcb4('0xb')][_0x295769[_0xfcb4('0x24')]][_0xfcb4('0x48')],'seconds');this[_0xfcb4('0xb')][_0x295769[_0xfcb4('0x24')]][_0xfcb4('0x2c')]='complete';this['outbound'][_0xfcb4('0x49')]+=0x1;if(this[_0xfcb4('0xb')][_0x295769[_0xfcb4('0x24')]]['answertime']){this['outbound'][_0xfcb4('0x4a')]+=0x1;this['channels'][_0x295769[_0xfcb4('0x24')]][_0xfcb4('0x4b')]=moment(this['channels'][_0x295769[_0xfcb4('0x24')]][_0xfcb4('0x4c')])['diff'](this['channels'][_0x295769['uniqueid']]['starttime'],_0xfcb4('0x4d'));this[_0xfcb4('0xb')][_0x295769[_0xfcb4('0x24')]][_0xfcb4('0x4e')]=moment(this[_0xfcb4('0xb')][_0x295769[_0xfcb4('0x24')]][_0xfcb4('0x45')])['diff'](this['channels'][_0x295769['uniqueid']]['answertime'],_0xfcb4('0x4d'));this[_0xfcb4('0xc')][_0xfcb4('0x4f')]+=this['channels'][_0x295769[_0xfcb4('0x24')]][_0xfcb4('0x4b')]||0x0;this[_0xfcb4('0xc')][_0xfcb4('0x50')]+=this['channels'][_0x295769[_0xfcb4('0x24')]][_0xfcb4('0x4e')];}this['outbound']['sumDuration']+=this['channels'][_0x295769['uniqueid']]['duration'];ami[_0xfcb4('0x17')](_0xfcb4('0x51'),this[_0xfcb4('0xb')][_0x295769[_0xfcb4('0x24')]]);ami[_0xfcb4('0x17')](_0xfcb4('0x52'),this[_0xfcb4('0xb')][_0x295769[_0xfcb4('0x24')]]);this[_0xfcb4('0x17')](_0xfcb4('0x21'),_0xfcb4('0x53'),this[_0xfcb4('0xc')]);logger[_0xfcb4('0x54')](_0xfcb4('0x55'),JSON[_0xfcb4('0x56')](this[_0xfcb4('0xb')][_0x295769[_0xfcb4('0x24')]]));this[_0xfcb4('0x17')]('voice:outbound','voice_outbound_channel:remove',this[_0xfcb4('0xb')][_0x295769[_0xfcb4('0x24')]]);delete this[_0xfcb4('0xb')][_0x295769[_0xfcb4('0x24')]];}if(this[_0xfcb4('0xd')][_0x295769[_0xfcb4('0x24')]]){delete this['variables'][_0x295769['uniqueid']];}}}catch(_0x4fc0ef){logger[_0xfcb4('0x25')](_0xfcb4('0x57'),util[_0xfcb4('0x27')](_0x4fc0ef,{'showHidden':![],'depth':null}));}};module[_0xfcb4('0x58')]=VoiceDialReport;
\ No newline at end of file
+var _0x2234=['duration','diff','starttime','seconds','complete','outbound','answered','holdtime','billableseconds','sumHoldTime','sumDuration','custom:voiceDialReport','custom:dialend','voice_outbound:save','[DEBUG]\x20Emit\x20voice_outbound_channel:remove\x20event','stringify','[syncHangup][VoiceDialReport]','exports','lodash','moment','util','ioredis','../../../config/environment','../../../config/logger','ami','../ami','redis','defaults','localhost','channels','variables','dialbegin','syncDialBegin','bind','dialend','varset','syncVarSet','hangup','syncHangup','prototype','isNotNull','uniqueid','merge','format','YYYY-MM-DD\x20HH:mm:ss','called','channel','substring','lastIndexOf','event','privilege','emit','voice:outbound','error','[syncDialBegin][VoiceDialReport]','inspect','syncDialEnd','dialstatus','connectedlinenum','connectedlinename','answertime','lastevent','connect','custom:dialconnect','voice_outbound_channel:save','[syncDialEnd][VoiceDialReport]','addVariable','variable','outboundrouteid','isUndefined','value','[syncVarSet][VoiceDialReport]','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','bridgepvtcallid','membercalls','memberdynamic','memberinterface','membername','memberpenalty','memberrealtime','isNil','endtime'];(function(_0x42a62a,_0x2d3511){var _0x1a52d9=function(_0x279c51){while(--_0x279c51){_0x42a62a['push'](_0x42a62a['shift']());}};_0x1a52d9(++_0x2d3511);}(_0x2234,0x16e));var _0x4223=function(_0x34d823,_0x2d20b0){_0x34d823=_0x34d823-0x0;var _0x1eb90c=_0x2234[_0x34d823];return _0x1eb90c;};'use strict';var _=require(_0x4223('0x0'));var moment=require(_0x4223('0x1'));var util=require(_0x4223('0x2'));var Redis=require(_0x4223('0x3'));var config=require(_0x4223('0x4'));var logger=require(_0x4223('0x5'))(_0x4223('0x6'));var ami=require(_0x4223('0x7'));config[_0x4223('0x8')]=_[_0x4223('0x9')](config['redis'],{'host':_0x4223('0xa'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x4223('0x8')]));function VoiceDialReport(_0x4f1a2){this[_0x4223('0xb')]=_0x4f1a2['outboundChannels'];this['outbound']=_0x4f1a2['outbound'];this[_0x4223('0xc')]={};ami['on'](_0x4223('0xd'),this[_0x4223('0xe')][_0x4223('0xf')](this));ami['on'](_0x4223('0x10'),this['syncDialEnd'][_0x4223('0xf')](this));ami['on'](_0x4223('0x11'),this[_0x4223('0x12')][_0x4223('0xf')](this));ami['on'](_0x4223('0x13'),this[_0x4223('0x14')][_0x4223('0xf')](this));}VoiceDialReport[_0x4223('0x15')]['isNotNull']=function(_0x32913e){return _0x32913e!==null&&!_['isUndefined'](_0x32913e);};VoiceDialReport[_0x4223('0x15')]['emit']=function(_0x3c6fdb,_0x3b41bb,_0x20649e){io['to'](_0x3c6fdb)['emit'](_0x3b41bb,_0x20649e);};VoiceDialReport['prototype']['syncDialBegin']=function(_0x26e986){try{if(this[_0x4223('0x16')](_0x26e986)){if(this[_0x4223('0xb')][_0x26e986[_0x4223('0x17')]]){_[_0x4223('0x18')](this[_0x4223('0xb')][_0x26e986[_0x4223('0x17')]],{'starttime':moment()[_0x4223('0x19')](_0x4223('0x1a')),'lastevent':_0x4223('0x1b'),'interface':_0x26e986[_0x4223('0x1c')][_0x4223('0x1d')](0x0,_0x26e986[_0x4223('0x1c')][_0x4223('0x1e')]('-')),'membername':_0x26e986[_0x4223('0x1c')]['substring'](_0x26e986[_0x4223('0x1c')]['lastIndexOf']('/')+0x1,_0x26e986[_0x4223('0x1c')][_0x4223('0x1e')]('-'))},_['omit'](_0x26e986,[_0x4223('0x1f'),_0x4223('0x20')]));this[_0x4223('0x21')](_0x4223('0x22'),'voice_outbound_channel:save',this[_0x4223('0xb')][_0x26e986[_0x4223('0x17')]]);ami['emit']('custom:dialbegin',this[_0x4223('0xb')][_0x26e986[_0x4223('0x17')]]);}}}catch(_0x1bea2f){logger[_0x4223('0x23')](_0x4223('0x24'),util[_0x4223('0x25')](_0x1bea2f,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0x4223('0x15')][_0x4223('0x26')]=function(_0x61fb76){try{if(this[_0x4223('0x16')](_0x61fb76)){if(this[_0x4223('0xb')][_0x61fb76[_0x4223('0x17')]]){this['channels'][_0x61fb76['uniqueid']][_0x4223('0x27')]=_0x61fb76[_0x4223('0x27')];if(_0x61fb76[_0x4223('0x27')]==='ANSWER'){this[_0x4223('0xb')][_0x61fb76['uniqueid']][_0x4223('0x28')]=_0x61fb76[_0x4223('0x28')];this[_0x4223('0xb')][_0x61fb76[_0x4223('0x17')]][_0x4223('0x29')]=_0x61fb76[_0x4223('0x29')];this[_0x4223('0xb')][_0x61fb76['uniqueid']][_0x4223('0x2a')]=moment()[_0x4223('0x19')](_0x4223('0x1a'));this['channels'][_0x61fb76[_0x4223('0x17')]][_0x4223('0x2b')]=_0x4223('0x2c');ami['emit'](_0x4223('0x2d'),this[_0x4223('0xb')][_0x61fb76[_0x4223('0x17')]]);}this[_0x4223('0x21')]('voice:outbound',_0x4223('0x2e'),this[_0x4223('0xb')][_0x61fb76[_0x4223('0x17')]]);}}}catch(_0x5a450d){logger[_0x4223('0x23')](_0x4223('0x2f'),util['inspect'](_0x5a450d,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0x4223('0x15')]['syncVarSet']=function(_0x2c6493){try{if(this[_0x4223('0x16')](_0x2c6493)){this[_0x4223('0x30')](_0x2c6493[_0x4223('0x17')],_['keys'](_0x2c6493[_0x4223('0x31')])[0x0],_0x2c6493['value']);if(this[_0x4223('0x16')](_0x2c6493[_0x4223('0x31')])&&this[_0x4223('0x16')](_0x2c6493[_0x4223('0x31')][_0x4223('0x32')])){if(_[_0x4223('0x33')](this['channels'][_0x2c6493[_0x4223('0x17')]])){this['channels'][_0x2c6493[_0x4223('0x17')]]={'routeId':_0x2c6493[_0x4223('0x34')],'variables':this[_0x4223('0xc')][_0x2c6493[_0x4223('0x17')]]};this[_0x4223('0x21')](_0x4223('0x22'),_0x4223('0x2e'),this[_0x4223('0xb')][_0x2c6493[_0x4223('0x17')]]);}}}}catch(_0x28af53){logger[_0x4223('0x23')](_0x4223('0x35'),util['inspect'](_0x28af53,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0x4223('0x15')][_0x4223('0x30')]=function(_0x53faff,_0x593d1e,_0x1fc3cf){var _0x5cb5d4=[_0x4223('0x36'),_0x4223('0x37'),_0x4223('0x38'),_0x4223('0x39'),'rtpaudioqosloss','rtpaudioqoslossbridged',_0x4223('0x3a'),_0x4223('0x3b'),'sipcallid','sipuri','bridgepeer',_0x4223('0x3c'),_0x4223('0x3d'),_0x4223('0x3e'),_0x4223('0x3f'),'memberlastcall',_0x4223('0x40'),_0x4223('0x41'),_0x4223('0x42')];if(!_[_0x4223('0x43')](_0x593d1e)&&!_['includes'](_0x5cb5d4,_0x593d1e)){if(_['isUndefined'](this[_0x4223('0xc')][_0x53faff])){this[_0x4223('0xc')][_0x53faff]={};}this['variables'][_0x53faff][_0x593d1e]=_0x1fc3cf;}};VoiceDialReport['prototype'][_0x4223('0x14')]=function(_0x1200b4){try{if(this[_0x4223('0x16')](_0x1200b4)){if(this[_0x4223('0xb')][_0x1200b4[_0x4223('0x17')]]){this['channels'][_0x1200b4[_0x4223('0x17')]][_0x4223('0x44')]=moment()[_0x4223('0x19')](_0x4223('0x1a'));this['channels'][_0x1200b4['uniqueid']][_0x4223('0x45')]=moment(this['channels'][_0x1200b4['uniqueid']]['endtime'])[_0x4223('0x46')](this[_0x4223('0xb')][_0x1200b4['uniqueid']][_0x4223('0x47')],_0x4223('0x48'));this['channels'][_0x1200b4['uniqueid']][_0x4223('0x2b')]=_0x4223('0x49');this[_0x4223('0x4a')]['total']+=0x1;if(this[_0x4223('0xb')][_0x1200b4[_0x4223('0x17')]][_0x4223('0x2a')]){this[_0x4223('0x4a')][_0x4223('0x4b')]+=0x1;this[_0x4223('0xb')][_0x1200b4['uniqueid']][_0x4223('0x4c')]=moment(this[_0x4223('0xb')][_0x1200b4['uniqueid']]['answertime'])[_0x4223('0x46')](this[_0x4223('0xb')][_0x1200b4[_0x4223('0x17')]][_0x4223('0x47')],'seconds');this[_0x4223('0xb')][_0x1200b4['uniqueid']][_0x4223('0x4d')]=moment(this['channels'][_0x1200b4[_0x4223('0x17')]]['endtime'])['diff'](this[_0x4223('0xb')][_0x1200b4[_0x4223('0x17')]][_0x4223('0x2a')],'seconds');this[_0x4223('0x4a')][_0x4223('0x4e')]+=this[_0x4223('0xb')][_0x1200b4['uniqueid']]['holdtime']||0x0;this[_0x4223('0x4a')]['sumBillable']+=this['channels'][_0x1200b4[_0x4223('0x17')]]['billableseconds'];}this[_0x4223('0x4a')][_0x4223('0x4f')]+=this[_0x4223('0xb')][_0x1200b4[_0x4223('0x17')]]['duration'];ami['emit'](_0x4223('0x50'),this[_0x4223('0xb')][_0x1200b4[_0x4223('0x17')]]);ami['emit'](_0x4223('0x51'),this[_0x4223('0xb')][_0x1200b4[_0x4223('0x17')]]);this[_0x4223('0x21')](_0x4223('0x22'),_0x4223('0x52'),this['outbound']);logger['info'](_0x4223('0x53'),JSON[_0x4223('0x54')](this[_0x4223('0xb')][_0x1200b4[_0x4223('0x17')]]));this[_0x4223('0x21')](_0x4223('0x22'),'voice_outbound_channel:remove',this[_0x4223('0xb')][_0x1200b4['uniqueid']]);delete this[_0x4223('0xb')][_0x1200b4[_0x4223('0x17')]];}if(this[_0x4223('0xc')][_0x1200b4['uniqueid']]){delete this[_0x4223('0xc')][_0x1200b4[_0x4223('0x17')]];}}}catch(_0x334438){logger[_0x4223('0x23')](_0x4223('0x55'),util[_0x4223('0x25')](_0x334438,{'showHidden':![],'depth':null}));}};module[_0x4223('0x56')]=VoiceDialReport;
\ No newline at end of file
diff --git a/server/services/ami/report/voiceQueueReport.js b/server/services/ami/report/voiceQueueReport.js
index e4ba8d3..63099dd 100644
--- a/server/services/ami/report/voiceQueueReport.js
+++ b/server/services/ami/report/voiceQueueReport.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xa2f7=['available','loggedIn','sumBillable','sumDuration','sumHoldTime','total','unmanaged','Trunk','active','callerid','Interval','voice_queue:save','isNotNull','queues','[queues]','catch','queue','countBy','callers','toNumber','loggedin','custom:queuesummary','[syncQueueSummary][VoiceQueueReport]','inspect','syncNewExten','uniqueid','queuecallerjoinAt','YYYY-MM-DD\x20HH:mm:ss','position','count','merge','keys','[syncQueueCallerJoin][VoiceQueueReport]','queuecallercomplete','queuecallercompleteAt','holdtime','originalposition','queuecallerexitreason','lastAssignedTo','[syncQueueCallerAbandon][VoiceQueueReport]','syncQueueCallerLeave','last','queuecallerleaveAt','connectedlinenum','connectedlinename','[syncQueueCallerLeave][VoiceQueueReport]','COMPLETEDBYAGENT','[syncAgentConnect][VoiceQueueReport]','syncAgentComplete','queuecallerabandonAt','assigned','membername','queuecallerexit','queuecallerexitAt','transfer','reason','COMPLETED','startsWith','toLowerCase','local/','linkedid','seconds','transfertype','FORWARD','transferexten','destexten','COMPLETEDBY','toUpperCase','[syncAgentComplete][VoiceQueueReport]','syncVarSet','addVariable','variable','value','queuestatus','CONTINUE','TIMEOUT','lastevent','timeout','custom:timeout','queueposition','[syncVarSet][VoiceQueueReport]','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','sipuri','bridgepvtcallid','membercalls','memberdynamic','memberinterface','memberlastcall','memberrealtime','abandoned','diff','length','milliseconds','custom:queuecallerabandon','emitVoiceQueueSummary','custom:voiceQueueReport','[syncHangup][VoiceQueueReport]','transfereeuniqueid','secondtransfererexten','transferuniqueid','ATTENDED','secondtransfereruniqueid','transfertargetuniqueid','origtransfererexten','origtransfereruniqueid','switch','[syncAttendedTransfer][VoiceQueueReport]','syncBlindTransfer','BLINDTRANSFER','BLIND','extension','BlindTransfer','transfererchannel','[syncBlindTransfer][VoiceQueueReport]','mohstarttime','mohtime','[syncMusicOnHoldStop][VoiceQueueReport]','exports','lodash','moment','bluebird','util','md5','ioredis','../../../config/environment','../../../config/logger','ami','../ami','../model/queueReport','redis','defaults','localhost','socket.io-emitter','prototype','enqueue','tail','finally','sequence','queueReports','agents','voiceQueues','flagQueueSummary','variables','queuesummary','syncQueueSummary','queuesummarycomplete','syncQueueSummaryComplete','bind','queuecallerjoin','syncQueueCallerJoin','queuecallerabandon','syncQueueCallerAbandon','queuecallerleave','agentcomplete','syncAgentConnect','varset','hangup','syncHangup','fullybooted','syncFullyBooted','musiconholdstart','syncMusicOnHoldStart','syncMusicOnHoldStop','attendedtransfer','syncAttendedTransfer','loopQueueSummary','loopQueueShow','isUndefined','isEmpty','hasOwnProperty','originated','talking','waiting','queueStatusComplete','unlockRR','clearZombieChannels','channels','isNil','Action','status','channel','No\x20such\x20channel','error','[voiceQueueReport][checkChannel]','[voiceQueueReport][checkVariables]','[FullyBooted]\x20clear\x20realtime','clearQueueReport','emitVoiceQueueChannelRemove','emit','emitVoiceQueueChannelSave','format','voice:queue:%s','name','stringify','voice_queue_channel:remove','type','inbound','strategy','answered'];(function(_0x10b3fa,_0x1fefc0){var _0x12518e=function(_0x17c552){while(--_0x17c552){_0x10b3fa['push'](_0x10b3fa['shift']());}};_0x12518e(++_0x1fefc0);}(_0xa2f7,0x7c));var _0x7a2f=function(_0x17b797,_0x12a262){_0x17b797=_0x17b797-0x0;var _0x498c70=_0xa2f7[_0x17b797];return _0x498c70;};'use strict';var _=require(_0x7a2f('0x0'));var moment=require(_0x7a2f('0x1'));var BPromise=require(_0x7a2f('0x2'));var util=require(_0x7a2f('0x3'));var md5=require(_0x7a2f('0x4'));var Redis=require(_0x7a2f('0x5'));var config=require(_0x7a2f('0x6'));var logger=require(_0x7a2f('0x7'))(_0x7a2f('0x8'));var ami=require(_0x7a2f('0x9'));var QueueReport=require(_0x7a2f('0xa'));config[_0x7a2f('0xb')]=_[_0x7a2f('0xc')](config['redis'],{'host':_0x7a2f('0xd'),'port':0x18eb});var io=require(_0x7a2f('0xe'))(new Redis(config['redis']));var Sequence=function(){};Sequence[_0x7a2f('0xf')][_0x7a2f('0x10')]=function(_0x293d07){this[_0x7a2f('0x11')]=this[_0x7a2f('0x11')]?this[_0x7a2f('0x11')][_0x7a2f('0x12')](_0x293d07):_0x293d07();};function VoiceQueueReport(_0x2edcf4){this[_0x7a2f('0x13')]=new Sequence();this[_0x7a2f('0x14')]={};this[_0x7a2f('0x15')]=_0x2edcf4['agents'];this['channels']=_0x2edcf4['queueChannels'];this[_0x7a2f('0x16')]=_0x2edcf4['voiceQueues'];this[_0x7a2f('0x17')]=!![];this['campaigns']=_0x2edcf4['campaigns'];this[_0x7a2f('0x18')]={};ami['on'](_0x7a2f('0x19'),this[_0x7a2f('0x1a')]['bind'](this));ami['on'](_0x7a2f('0x1b'),this[_0x7a2f('0x1c')][_0x7a2f('0x1d')](this));ami['on'](_0x7a2f('0x1e'),this[_0x7a2f('0x1f')][_0x7a2f('0x1d')](this));ami['on'](_0x7a2f('0x20'),this[_0x7a2f('0x21')][_0x7a2f('0x1d')](this));ami['on'](_0x7a2f('0x22'),this['syncQueueCallerLeave'][_0x7a2f('0x1d')](this));ami['on'](_0x7a2f('0x23'),this['syncAgentComplete'][_0x7a2f('0x1d')](this));ami['on']('agentconnect',this[_0x7a2f('0x24')][_0x7a2f('0x1d')](this));ami['on'](_0x7a2f('0x25'),this['syncVarSet'][_0x7a2f('0x1d')](this));ami['on'](_0x7a2f('0x26'),this[_0x7a2f('0x27')]['bind'](this));ami['on'](_0x7a2f('0x28'),this[_0x7a2f('0x29')][_0x7a2f('0x1d')](this));ami['on'](_0x7a2f('0x2a'),this[_0x7a2f('0x2b')][_0x7a2f('0x1d')](this));ami['on']('musiconholdstop',this[_0x7a2f('0x2c')][_0x7a2f('0x1d')](this));ami['on'](_0x7a2f('0x2d'),this[_0x7a2f('0x2e')][_0x7a2f('0x1d')](this));ami['on']('blindtransfer',this['syncBlindTransfer'][_0x7a2f('0x1d')](this));this[_0x7a2f('0x2f')]();this[_0x7a2f('0x30')]();}function isNotNull(_0x57a7b9){return _0x57a7b9!==null&&!_[_0x7a2f('0x31')](_0x57a7b9);}function clearChannels(_0x500213){if(!_[_0x7a2f('0x32')](_0x500213)){for(var _0x2877cb in _0x500213){if(_0x500213[_0x7a2f('0x33')](_0x2877cb)){delete _0x500213[_0x2877cb];}}}}function clearCampaigns(_0x2ee208){if(!_[_0x7a2f('0x32')](_0x2ee208)){for(var _0xf73880 in _0x2ee208){if(_0x2ee208['hasOwnProperty'](_0xf73880)){_0x2ee208[_0xf73880][_0x7a2f('0x34')]=0x0;}}}}function clearVoiceQueues(_0x5a0a7a){if(!_[_0x7a2f('0x32')](_0x5a0a7a)){for(var _0x334b53 in _0x5a0a7a){if(_0x5a0a7a[_0x7a2f('0x33')](_0x334b53)){_0x5a0a7a[_0x334b53][_0x7a2f('0x34')]=0x0;_0x5a0a7a[_0x334b53][_0x7a2f('0x35')]=0x0;_0x5a0a7a[_0x334b53]['pTalking']=0x0;_0x5a0a7a[_0x334b53][_0x7a2f('0x36')]=0x0;_0x5a0a7a[_0x334b53][_0x7a2f('0x37')]=!![];}}}}function clearAgentBooked(_0x1abf65){if(!_[_0x7a2f('0x32')](_0x1abf65)){for(var _0xc1bddb in _0x1abf65){if(_0x1abf65[_0x7a2f('0x33')](_0xc1bddb)){_0x1abf65[_0xc1bddb][_0x7a2f('0x38')]=!![];}}}}VoiceQueueReport[_0x7a2f('0xf')][_0x7a2f('0x39')]=function(){var _0x5496f2=this;for(var _0x8863f9 in this[_0x7a2f('0x3a')]){if(this[_0x7a2f('0x3a')][_0x7a2f('0x33')](_0x8863f9)&&!this[_0x7a2f('0x3a')][_0x8863f9]['switch']){this[_0x7a2f('0x13')][_0x7a2f('0x10')](function(){if(!_[_0x7a2f('0x3b')](_0x5496f2['channels'][_0x8863f9])){return ami[_0x7a2f('0x3c')]({'action':_0x7a2f('0x3d'),'channel':_0x5496f2[_0x7a2f('0x3a')][_0x8863f9][_0x7a2f('0x3e')]})['catch'](function(_0x523e3f){if(_0x523e3f['message']===_0x7a2f('0x3f')){setTimeout(function(){if(_0x5496f2[_0x7a2f('0x3a')][_0x8863f9]){delete _0x5496f2['channels'][_0x8863f9];logger[_0x7a2f('0x40')](_0x7a2f('0x41'),_0x8863f9);}if(_0x5496f2['queueReports'][_0x8863f9]){delete _0x5496f2['queueReports'][_0x8863f9];logger['error']('[voiceQueueReport][checkQueueReport]',_0x8863f9);}if(_0x5496f2['variables'][_0x8863f9]){delete _0x5496f2['variables'][_0x8863f9];logger[_0x7a2f('0x40')](_0x7a2f('0x42'),_0x8863f9);}},0x1f40);}});}});}}};VoiceQueueReport[_0x7a2f('0xf')][_0x7a2f('0x29')]=function(){logger['error'](_0x7a2f('0x43'));clearChannels(this[_0x7a2f('0x3a')]);this[_0x7a2f('0x44')](this[_0x7a2f('0x14')]);clearAgentBooked(this[_0x7a2f('0x15')]);clearVoiceQueues(this[_0x7a2f('0x16')]);clearCampaigns(this['campaigns']);};VoiceQueueReport[_0x7a2f('0xf')]['clearQueueReport']=function(_0x57ac62){var _0x1e2dd2=this;if(!_[_0x7a2f('0x32')](_0x57ac62)){for(var _0x2e79e9 in _0x57ac62){if(_0x57ac62['hasOwnProperty'](_0x2e79e9)){_0x1e2dd2[_0x7a2f('0x45')](_0x57ac62[_0x2e79e9]);delete _0x57ac62[_0x2e79e9];}}}};function loggerCatch(_0x3dbcc6){return function(_0x321e6f){logger[_0x7a2f('0x40')](_0x3dbcc6,util['inspect'](_0x321e6f,{'showHidden':![],'depth':null}));};}VoiceQueueReport[_0x7a2f('0xf')][_0x7a2f('0x46')]=function(_0x2c4394,_0x3f88c4,_0x23c545){io['to'](_0x2c4394)['emit'](_0x3f88c4,_0x23c545);};VoiceQueueReport['prototype'][_0x7a2f('0x47')]=function(_0x5dd170){this[_0x7a2f('0x46')](util[_0x7a2f('0x48')](_0x7a2f('0x49'),_0x5dd170[_0x7a2f('0x4a')]),'voice_queue_channel:save',_0x5dd170);};VoiceQueueReport['prototype'][_0x7a2f('0x45')]=function(_0x2c5c15){logger['info']('[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event',JSON[_0x7a2f('0x4b')](_0x2c5c15));this[_0x7a2f('0x46')](util[_0x7a2f('0x48')](_0x7a2f('0x49'),_0x2c5c15[_0x7a2f('0x4a')]),_0x7a2f('0x4c'),_0x2c5c15);};VoiceQueueReport[_0x7a2f('0xf')]['emitVoiceQueueSummary']=function(_0xc6c26d){if(_0xc6c26d[_0x7a2f('0x4d')]===_0x7a2f('0x4e')){var _0x36a538={'id':_0xc6c26d['id'],'name':_0xc6c26d['name'],'strategy':_0xc6c26d[_0x7a2f('0x4f')],'answered':_0xc6c26d[_0x7a2f('0x50')],'available':_0xc6c26d[_0x7a2f('0x51')],'loggedIn':_0xc6c26d[_0x7a2f('0x52')],'pTalking':_0xc6c26d['pTalking'],'sumBillable':_0xc6c26d[_0x7a2f('0x53')],'sumDuration':_0xc6c26d[_0x7a2f('0x54')],'sumHoldTime':_0xc6c26d[_0x7a2f('0x55')]||0x0,'talking':_0xc6c26d[_0x7a2f('0x35')],'total':_0xc6c26d[_0x7a2f('0x56')],'type':_0xc6c26d['type'],'unmanaged':_0xc6c26d[_0x7a2f('0x57')],'abandoned':_0xc6c26d['abandoned'],'waiting':_0xc6c26d[_0x7a2f('0x36')]};if(_0xc6c26d[_0x7a2f('0x58')]){_0x36a538['Trunk']={'id':_0xc6c26d[_0x7a2f('0x58')]['id'],'name':_0xc6c26d['Trunk']['name'],'active':_0xc6c26d[_0x7a2f('0x58')][_0x7a2f('0x59')],'callerid':_0xc6c26d[_0x7a2f('0x58')][_0x7a2f('0x5a')]};}if(_0xc6c26d[_0x7a2f('0x5b')]){_0x36a538[_0x7a2f('0x5b')]={'id':_0xc6c26d[_0x7a2f('0x5b')]['id'],'name':_0xc6c26d[_0x7a2f('0x5b')][_0x7a2f('0x4a')]};}var _0x27fd2f=md5(JSON['stringify'](_0x36a538));if(_0xc6c26d['md5']!==_0x27fd2f){_0xc6c26d['md5']=_0x27fd2f;this[_0x7a2f('0x46')](util['format'](_0x7a2f('0x49'),_0x36a538[_0x7a2f('0x4a')]),_0x7a2f('0x5c'),_0x36a538);}}};VoiceQueueReport[_0x7a2f('0xf')][_0x7a2f('0x5d')]=function(_0x18306a){return _0x18306a!==null&&!_[_0x7a2f('0x31')](_0x18306a);};VoiceQueueReport['prototype'][_0x7a2f('0x30')]=function(){var _0x59d0e6=this;setInterval(function(){_0x59d0e6[_0x7a2f('0x39')]();ami['Action']({'action':_0x7a2f('0x5e')})['catch'](loggerCatch(_0x7a2f('0x5f')));},0x2710);};VoiceQueueReport[_0x7a2f('0xf')][_0x7a2f('0x2f')]=function(){var _0x2caf7d=this;setInterval(function(){if(_0x2caf7d[_0x7a2f('0x17')]){return ami[_0x7a2f('0x3c')]({'action':'queuesummary'})['then'](function(_0x4f12cd){_0x2caf7d['flagQueueSummary']=![];})[_0x7a2f('0x60')](loggerCatch('[queuesummary]'));}},0x3e8);};VoiceQueueReport[_0x7a2f('0xf')][_0x7a2f('0x1a')]=function(_0x5bbe1b){try{if(this[_0x7a2f('0x5d')](_0x5bbe1b)&&this[_0x7a2f('0x5d')](_0x5bbe1b[_0x7a2f('0x61')])){if(this[_0x7a2f('0x16')][_0x5bbe1b[_0x7a2f('0x61')]]){var _0x3e1a89=_[_0x7a2f('0x62')](this[_0x7a2f('0x3a')],_0x7a2f('0x61'))[_0x5bbe1b[_0x7a2f('0x61')]]||0x0;var _0x2b6957=_0x3e1a89-_0x5bbe1b[_0x7a2f('0x63')];if(this[_0x7a2f('0x16')][_0x5bbe1b[_0x7a2f('0x61')]][_0x7a2f('0x36')]!==_[_0x7a2f('0x64')](_0x5bbe1b[_0x7a2f('0x63')])||this[_0x7a2f('0x16')][_0x5bbe1b[_0x7a2f('0x61')]]['loggedIn']!==_[_0x7a2f('0x64')](_0x5bbe1b[_0x7a2f('0x65')])||this[_0x7a2f('0x16')][_0x5bbe1b[_0x7a2f('0x61')]][_0x7a2f('0x51')]!==_[_0x7a2f('0x64')](_0x5bbe1b['available'])||this[_0x7a2f('0x16')][_0x5bbe1b['queue']][_0x7a2f('0x35')]!==_0x2b6957){this['voiceQueues'][_0x5bbe1b[_0x7a2f('0x61')]][_0x7a2f('0x36')]=_[_0x7a2f('0x64')](_0x5bbe1b['callers']);this[_0x7a2f('0x16')][_0x5bbe1b['queue']]['loggedIn']=_[_0x7a2f('0x64')](_0x5bbe1b['loggedin']);this[_0x7a2f('0x16')][_0x5bbe1b['queue']][_0x7a2f('0x51')]=_[_0x7a2f('0x64')](_0x5bbe1b[_0x7a2f('0x51')]);this[_0x7a2f('0x16')][_0x5bbe1b[_0x7a2f('0x61')]]['talking']=_0x2b6957>0x0?_0x2b6957:0x0;this[_0x7a2f('0x16')][_0x5bbe1b['queue']][_0x7a2f('0x35')]=this[_0x7a2f('0x16')][_0x5bbe1b[_0x7a2f('0x61')]]['talking']>_[_0x7a2f('0x64')](_0x5bbe1b['loggedin'])?_[_0x7a2f('0x64')](_0x5bbe1b[_0x7a2f('0x65')]):this['voiceQueues'][_0x5bbe1b[_0x7a2f('0x61')]][_0x7a2f('0x35')];this['emitVoiceQueueSummary'](this[_0x7a2f('0x16')][_0x5bbe1b['queue']]);}ami[_0x7a2f('0x46')](_0x7a2f('0x66'),this[_0x7a2f('0x16')][_0x5bbe1b[_0x7a2f('0x61')]]);}}}catch(_0x321905){logger[_0x7a2f('0x40')](_0x7a2f('0x67'),util[_0x7a2f('0x68')](_0x321905,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x7a2f('0xf')]['syncQueueSummaryComplete']=function(_0xd9149){this[_0x7a2f('0x17')]=!![];};VoiceQueueReport[_0x7a2f('0xf')][_0x7a2f('0x69')]=function(_0x480223){};VoiceQueueReport[_0x7a2f('0xf')][_0x7a2f('0x1f')]=function(_0x494d89){try{if(this[_0x7a2f('0x5d')](_0x494d89)){if(_[_0x7a2f('0x31')](this[_0x7a2f('0x14')][_0x494d89[_0x7a2f('0x6a')]])){this[_0x7a2f('0x14')][_0x494d89[_0x7a2f('0x6a')]]=[];this['channels'][_0x494d89[_0x7a2f('0x6a')]]={};}var _0x3f72d4=new QueueReport();_0x3f72d4['name']=_0x494d89[_0x7a2f('0x61')];_0x3f72d4[_0x7a2f('0x4d')]=this[_0x7a2f('0x16')][_0x3f72d4[_0x7a2f('0x4a')]]&&this['voiceQueues'][_0x3f72d4[_0x7a2f('0x4a')]][_0x7a2f('0x4d')]?this['voiceQueues'][_0x3f72d4[_0x7a2f('0x4a')]]['type']||'inbound':_0x7a2f('0x4e');_0x3f72d4['queue']=_0x494d89[_0x7a2f('0x61')];_0x3f72d4[_0x7a2f('0x6b')]=moment()['format'](_0x7a2f('0x6c'));_0x3f72d4['position']=_0x494d89[_0x7a2f('0x6d')];_0x3f72d4[_0x7a2f('0x6e')]=_0x494d89['count'];_[_0x7a2f('0x6f')](_0x3f72d4,_['pick'](_0x494d89,_[_0x7a2f('0x70')](_0x3f72d4)));this['queueReports'][_0x494d89[_0x7a2f('0x6a')]]['push'](_0x3f72d4);this[_0x7a2f('0x3a')][_0x494d89[_0x7a2f('0x6a')]]=_0x3f72d4;this['emitVoiceQueueChannelSave'](_0x3f72d4);}}catch(_0x402cd5){logger[_0x7a2f('0x40')](_0x7a2f('0x71'),util[_0x7a2f('0x68')](_0x402cd5,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x7a2f('0xf')][_0x7a2f('0x21')]=function(_0x1fca22){try{if(this['isNotNull'](_0x1fca22)){if(this[_0x7a2f('0x14')][_0x1fca22['uniqueid']]){var _0x4d4298=_['last'](this[_0x7a2f('0x14')][_0x1fca22[_0x7a2f('0x6a')]]);_0x4d4298[_0x7a2f('0x72')]=![];_0x4d4298[_0x7a2f('0x73')]=null;_0x4d4298[_0x7a2f('0x74')]=_0x1fca22[_0x7a2f('0x74')];_0x4d4298[_0x7a2f('0x75')]=_0x1fca22[_0x7a2f('0x75')];_0x4d4298[_0x7a2f('0x20')]=!![];_0x4d4298['queuecallerabandonAt']=moment()[_0x7a2f('0x48')](_0x7a2f('0x6c'));_0x4d4298[_0x7a2f('0x76')]='ABANDONED';_0x4d4298[_0x7a2f('0x77')]=null;this[_0x7a2f('0x3a')][_0x1fca22['uniqueid']]=_0x4d4298;this[_0x7a2f('0x45')](_0x4d4298);}}}catch(_0x4ccd68){logger['error'](_0x7a2f('0x78'),util[_0x7a2f('0x68')](_0x4ccd68,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x7a2f('0xf')][_0x7a2f('0x79')]=function(_0x51bdc7){try{if(this[_0x7a2f('0x5d')](_0x51bdc7)){if(this[_0x7a2f('0x14')][_0x51bdc7['uniqueid']]){var _0x198be2=_[_0x7a2f('0x7a')](this[_0x7a2f('0x14')][_0x51bdc7[_0x7a2f('0x6a')]]);_0x198be2[_0x7a2f('0x7b')]=moment()['format'](_0x7a2f('0x6c'));_0x198be2['connectedlinenum']=_0x51bdc7[_0x7a2f('0x7c')];_0x198be2[_0x7a2f('0x7d')]=_0x51bdc7[_0x7a2f('0x7d')];this[_0x7a2f('0x3a')][_0x51bdc7[_0x7a2f('0x6a')]]=_0x198be2;this[_0x7a2f('0x47')](_0x198be2);}}}catch(_0x41e4ae){logger[_0x7a2f('0x40')](_0x7a2f('0x7e'),util[_0x7a2f('0x68')](_0x41e4ae,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x7a2f('0xf')]['syncAgentConnect']=function(_0x207678){try{if(this[_0x7a2f('0x5d')](_0x207678)){if(this['queueReports'][_0x207678[_0x7a2f('0x6a')]]){var _0x543aa0=_[_0x7a2f('0x7a')](this[_0x7a2f('0x14')][_0x207678[_0x7a2f('0x6a')]]);_0x543aa0[_0x7a2f('0x72')]=!![];_0x543aa0['queuecallerexitreason']=_0x7a2f('0x7f');}}}catch(_0x3934e2){logger[_0x7a2f('0x40')](_0x7a2f('0x80'),util[_0x7a2f('0x68')](_0x3934e2,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x7a2f('0x81')]=function(_0x5bcac1){try{if(this[_0x7a2f('0x5d')](_0x5bcac1)){if(this[_0x7a2f('0x14')][_0x5bcac1[_0x7a2f('0x6a')]]){var _0x2f4c8b=_[_0x7a2f('0x7a')](this[_0x7a2f('0x14')][_0x5bcac1['uniqueid']]);_0x2f4c8b[_0x7a2f('0x20')]=![];_0x2f4c8b[_0x7a2f('0x82')]=null;_0x2f4c8b[_0x7a2f('0x83')]=!![];_0x2f4c8b['lastAssignedTo']=_0x5bcac1[_0x7a2f('0x84')];_0x2f4c8b[_0x7a2f('0x74')]=_0x5bcac1['holdtime'];_0x2f4c8b[_0x7a2f('0x72')]=!![];_0x2f4c8b[_0x7a2f('0x85')]=![];_0x2f4c8b[_0x7a2f('0x86')]=null;if(!_0x2f4c8b[_0x7a2f('0x87')]){if(_0x5bcac1[_0x7a2f('0x88')]=='transfer'){_0x2f4c8b['queuecallerexitreason']=_0x7a2f('0x89');}else{if(_[_0x7a2f('0x8a')](_0x5bcac1['channel'][_0x7a2f('0x8b')](),_0x7a2f('0x8c'))){if(this[_0x7a2f('0x14')][_0x5bcac1[_0x7a2f('0x8d')]]){var _0x555cc5=_[_0x7a2f('0x7a')](this[_0x7a2f('0x14')][_0x5bcac1['linkedid']]);_0x555cc5['queuecallercomplete']=![];_0x555cc5['queuecallerexit']=!![];_0x555cc5['queuecallerexitAt']=moment(_0x2f4c8b[_0x7a2f('0x6b')])['add'](_0x5bcac1[_0x7a2f('0x74')],_0x7a2f('0x8e'))['format'](_0x7a2f('0x6c'));_0x555cc5[_0x7a2f('0x76')]='FORWARDTRANSFER';_0x555cc5[_0x7a2f('0x87')]=!![];_0x555cc5[_0x7a2f('0x8f')]=_0x7a2f('0x90');_0x555cc5[_0x7a2f('0x91')]=_0x5bcac1[_0x7a2f('0x92')];_0x555cc5['transferuniqueid']=_0x5bcac1[_0x7a2f('0x6a')];var _0x47332a=this[_0x7a2f('0x14')][_0x5bcac1[_0x7a2f('0x8d')]];this['queueReports'][_0x5bcac1['linkedid']]=this[_0x7a2f('0x14')][_0x5bcac1['uniqueid']];this[_0x7a2f('0x14')][_0x5bcac1[_0x7a2f('0x6a')]]=_0x47332a;}}else{_0x2f4c8b['queuecallerexitreason']=_0x7a2f('0x93')+_0x5bcac1[_0x7a2f('0x88')][_0x7a2f('0x94')]();}}}this[_0x7a2f('0x3a')][_0x5bcac1[_0x7a2f('0x6a')]]=_0x2f4c8b;this[_0x7a2f('0x45')](_0x2f4c8b);}}}catch(_0x18094d){logger['error'](_0x7a2f('0x95'),util[_0x7a2f('0x68')](_0x18094d,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x7a2f('0xf')][_0x7a2f('0x96')]=function(_0x3ea269){try{if(this[_0x7a2f('0x5d')](_0x3ea269)){this[_0x7a2f('0x97')](_0x3ea269[_0x7a2f('0x6a')],_[_0x7a2f('0x70')](_0x3ea269[_0x7a2f('0x98')])[0x0],_0x3ea269[_0x7a2f('0x99')]);if(this[_0x7a2f('0x14')][_0x3ea269[_0x7a2f('0x6a')]]){var _0x393043=_[_0x7a2f('0x7a')](this[_0x7a2f('0x14')][_0x3ea269[_0x7a2f('0x6a')]]);if(_0x393043){if(this['isNotNull'](_0x3ea269[_0x7a2f('0x98')])&&this['isNotNull'](_0x3ea269[_0x7a2f('0x98')][_0x7a2f('0x9a')])){switch(_0x3ea269[_0x7a2f('0x99')]){case _0x7a2f('0x9b'):_0x393043['queuecallerexit']=![];_0x393043[_0x7a2f('0x86')]=null;break;case _0x7a2f('0x9c'):_0x393043[_0x7a2f('0x9d')]=_0x7a2f('0x9e');ami[_0x7a2f('0x46')](_0x7a2f('0x9f'),_0x393043);break;default:_0x393043[_0x7a2f('0x85')]=!![];_0x393043[_0x7a2f('0x86')]=moment()['format'](_0x7a2f('0x6c'));_0x393043['queuecallerleaveAt']=moment()[_0x7a2f('0x48')](_0x7a2f('0x6c'));}_0x393043['queuecallerabandon']=![];_0x393043['queuecallerabandonAt']=null;_0x393043['queuecallerexitreason']=_0x3ea269[_0x7a2f('0x99')];this[_0x7a2f('0x3a')][_0x3ea269[_0x7a2f('0x6a')]]=_0x393043;this[_0x7a2f('0x45')](_0x393043);}else if(this[_0x7a2f('0x5d')](_0x3ea269['variable'])&&this[_0x7a2f('0x5d')](_0x3ea269[_0x7a2f('0x98')][_0x7a2f('0xa0')])){if(!_0x393043[_0x7a2f('0x20')]){_0x393043[_0x7a2f('0x85')]=!![];_0x393043[_0x7a2f('0x86')]=moment()[_0x7a2f('0x48')](_0x7a2f('0x6c'));_0x393043[_0x7a2f('0x76')]='EXITWITHKEY';_0x393043[_0x7a2f('0x7b')]=moment()[_0x7a2f('0x48')](_0x7a2f('0x6c'));this['channels'][_0x3ea269[_0x7a2f('0x6a')]]=_0x393043;}}_0x393043['variables']=this[_0x7a2f('0x18')][_0x3ea269[_0x7a2f('0x6a')]];}}}}catch(_0xb79f9f){logger['error'](_0x7a2f('0xa1'),util[_0x7a2f('0x68')](_0xb79f9f,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x7a2f('0x97')]=function(_0x39fa7d,_0x2de20c,_0x1c3753){var _0x1f5114=[_0x7a2f('0xa2'),_0x7a2f('0xa3'),_0x7a2f('0xa4'),_0x7a2f('0xa5'),'rtpaudioqosloss',_0x7a2f('0xa6'),_0x7a2f('0xa7'),_0x7a2f('0xa8'),'sipcallid',_0x7a2f('0xa9'),'bridgepeer',_0x7a2f('0xaa'),_0x7a2f('0xab'),_0x7a2f('0xac'),_0x7a2f('0xad'),_0x7a2f('0xae'),'membername','memberpenalty',_0x7a2f('0xaf')];if(!_[_0x7a2f('0x3b')](_0x2de20c)&&!_['includes'](_0x1f5114,_0x2de20c)){if(_['isUndefined'](this['variables'][_0x39fa7d])){this[_0x7a2f('0x18')][_0x39fa7d]={};}this[_0x7a2f('0x18')][_0x39fa7d][_0x2de20c]=_0x1c3753;}};VoiceQueueReport[_0x7a2f('0xf')][_0x7a2f('0x27')]=function(_0x3c4fb4){try{if(this[_0x7a2f('0x5d')](_0x3c4fb4)){if(this[_0x7a2f('0x14')][_0x3c4fb4[_0x7a2f('0x6a')]]){for(var _0x440ec5=0x0,_0x7a9725={};_0x440ec50x0?_0x25c555:0x0;this[_0x7d00('0x10')][_0x21974b[_0x7d00('0x62')]][_0x7d00('0x2f')]=this['voiceQueues'][_0x21974b[_0x7d00('0x62')]]['talking']>_[_0x7d00('0x65')](_0x21974b[_0x7d00('0x67')])?_['toNumber'](_0x21974b['loggedin']):this[_0x7d00('0x10')][_0x21974b[_0x7d00('0x62')]]['talking'];this[_0x7d00('0x4e')](this['voiceQueues'][_0x21974b[_0x7d00('0x62')]]);}ami[_0x7d00('0x46')](_0x7d00('0x68'),this[_0x7d00('0x10')][_0x21974b[_0x7d00('0x62')]]);}}}catch(_0x1e4666){logger[_0x7d00('0x3e')](_0x7d00('0x69'),util['inspect'](_0x1e4666,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x7d00('0xc')][_0x7d00('0x16')]=function(_0x9fdbee){this[_0x7d00('0x11')]=!![];};VoiceQueueReport[_0x7d00('0xc')]['syncNewExten']=function(_0x4bbebf){};VoiceQueueReport[_0x7d00('0xc')]['syncQueueCallerJoin']=function(_0x601ea1){try{if(this['isNotNull'](_0x601ea1)){if(_['isUndefined'](this[_0x7d00('0x43')][_0x601ea1['uniqueid']])){this['queueReports'][_0x601ea1[_0x7d00('0x6a')]]=[];this[_0x7d00('0x35')][_0x601ea1[_0x7d00('0x6a')]]={};}var _0x171fab=new QueueReport();_0x171fab[_0x7d00('0x49')]=_0x601ea1[_0x7d00('0x62')];_0x171fab['type']=this[_0x7d00('0x10')][_0x171fab[_0x7d00('0x49')]]&&this[_0x7d00('0x10')][_0x171fab[_0x7d00('0x49')]]['type']?this['voiceQueues'][_0x171fab[_0x7d00('0x49')]][_0x7d00('0x4f')]||_0x7d00('0x50'):_0x7d00('0x50');_0x171fab[_0x7d00('0x62')]=_0x601ea1[_0x7d00('0x62')];_0x171fab['queuecallerjoinAt']=moment()[_0x7d00('0x47')](_0x7d00('0x6b'));_0x171fab[_0x7d00('0x6c')]=_0x601ea1['position'];_0x171fab[_0x7d00('0x6d')]=_0x601ea1['count'];_[_0x7d00('0x6e')](_0x171fab,_[_0x7d00('0x6f')](_0x601ea1,_['keys'](_0x171fab)));this[_0x7d00('0x43')][_0x601ea1['uniqueid']][_0x7d00('0x70')](_0x171fab);this['channels'][_0x601ea1[_0x7d00('0x6a')]]=_0x171fab;this[_0x7d00('0x71')](_0x171fab);}}catch(_0x20d784){logger[_0x7d00('0x3e')](_0x7d00('0x72'),util[_0x7d00('0x45')](_0x20d784,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x7d00('0xc')][_0x7d00('0x1a')]=function(_0x521f68){try{if(this[_0x7d00('0x5c')](_0x521f68)){if(this['queueReports'][_0x521f68[_0x7d00('0x6a')]]){var _0x5b978b=_[_0x7d00('0x73')](this['queueReports'][_0x521f68[_0x7d00('0x6a')]]);_0x5b978b[_0x7d00('0x74')]=![];_0x5b978b[_0x7d00('0x75')]=null;_0x5b978b[_0x7d00('0x76')]=_0x521f68[_0x7d00('0x76')];_0x5b978b[_0x7d00('0x77')]=_0x521f68[_0x7d00('0x77')];_0x5b978b[_0x7d00('0x19')]=!![];_0x5b978b[_0x7d00('0x78')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x5b978b[_0x7d00('0x79')]='ABANDONED';_0x5b978b['lastAssignedTo']=null;this['channels'][_0x521f68[_0x7d00('0x6a')]]=_0x5b978b;this[_0x7d00('0x44')](_0x5b978b);}}}catch(_0x41b9a6){logger[_0x7d00('0x3e')](_0x7d00('0x7a'),util[_0x7d00('0x45')](_0x41b9a6,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x7d00('0xc')][_0x7d00('0x1c')]=function(_0x5be47c){try{if(this['isNotNull'](_0x5be47c)){if(this['queueReports'][_0x5be47c[_0x7d00('0x6a')]]){var _0x236375=_['last'](this[_0x7d00('0x43')][_0x5be47c[_0x7d00('0x6a')]]);_0x236375['queuecallerleaveAt']=moment()[_0x7d00('0x47')](_0x7d00('0x6b'));_0x236375[_0x7d00('0x7b')]=_0x5be47c[_0x7d00('0x7b')];_0x236375[_0x7d00('0x7c')]=_0x5be47c[_0x7d00('0x7c')];this[_0x7d00('0x35')][_0x5be47c[_0x7d00('0x6a')]]=_0x236375;this['emitVoiceQueueChannelSave'](_0x236375);}}}catch(_0x2614d1){logger[_0x7d00('0x3e')]('[syncQueueCallerLeave][VoiceQueueReport]',util[_0x7d00('0x45')](_0x2614d1,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x7d00('0xc')][_0x7d00('0x1f')]=function(_0x4029c3){try{if(this['isNotNull'](_0x4029c3)){if(this['queueReports'][_0x4029c3[_0x7d00('0x6a')]]){var _0x389fc4=_[_0x7d00('0x73')](this[_0x7d00('0x43')][_0x4029c3[_0x7d00('0x6a')]]);_0x389fc4[_0x7d00('0x74')]=!![];_0x389fc4[_0x7d00('0x79')]=_0x7d00('0x7d');}}}catch(_0x46953d){logger['error'](_0x7d00('0x7e'),util[_0x7d00('0x45')](_0x46953d,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x7d00('0xc')][_0x7d00('0x7f')]=function(_0x2da0a5){try{if(this['isNotNull'](_0x2da0a5)){if(this['queueReports'][_0x2da0a5[_0x7d00('0x6a')]]){var _0x359043=_[_0x7d00('0x73')](this[_0x7d00('0x43')][_0x2da0a5[_0x7d00('0x6a')]]);_0x359043[_0x7d00('0x19')]=![];_0x359043[_0x7d00('0x78')]=null;_0x359043[_0x7d00('0x80')]=!![];_0x359043[_0x7d00('0x81')]=_0x2da0a5[_0x7d00('0x82')];_0x359043[_0x7d00('0x76')]=_0x2da0a5[_0x7d00('0x76')];_0x359043[_0x7d00('0x74')]=!![];_0x359043[_0x7d00('0x83')]=![];_0x359043['queuecallerexitAt']=null;if(!_0x359043['transfer']){if(_0x2da0a5[_0x7d00('0x84')]==_0x7d00('0x85')){_0x359043[_0x7d00('0x79')]=_0x7d00('0x86');}else{if(_[_0x7d00('0x87')](_0x2da0a5[_0x7d00('0x3a')]['toLowerCase'](),_0x7d00('0x88'))){if(this[_0x7d00('0x43')][_0x2da0a5[_0x7d00('0x89')]]){var _0x830d35=_['last'](this['queueReports'][_0x2da0a5[_0x7d00('0x89')]]);_0x830d35['queuecallercomplete']=![];_0x830d35['queuecallerexit']=!![];_0x830d35[_0x7d00('0x8a')]=moment(_0x359043[_0x7d00('0x8b')])['add'](_0x2da0a5[_0x7d00('0x76')],'seconds')[_0x7d00('0x47')]('YYYY-MM-DD\x20HH:mm:ss');_0x830d35[_0x7d00('0x79')]=_0x7d00('0x8c');_0x830d35[_0x7d00('0x85')]=!![];_0x830d35['transfertype']=_0x7d00('0x8d');_0x830d35[_0x7d00('0x8e')]=_0x2da0a5[_0x7d00('0x8f')];_0x830d35[_0x7d00('0x90')]=_0x2da0a5[_0x7d00('0x6a')];var _0x17dbbc=this[_0x7d00('0x43')][_0x2da0a5[_0x7d00('0x89')]];this['queueReports'][_0x2da0a5['linkedid']]=this[_0x7d00('0x43')][_0x2da0a5['uniqueid']];this['queueReports'][_0x2da0a5[_0x7d00('0x6a')]]=_0x17dbbc;}}else{_0x359043[_0x7d00('0x79')]='COMPLETEDBY'+_0x2da0a5['reason']['toUpperCase']();}}}this[_0x7d00('0x35')][_0x2da0a5['uniqueid']]=_0x359043;this[_0x7d00('0x44')](_0x359043);}}}catch(_0xafba3f){logger[_0x7d00('0x3e')](_0x7d00('0x91'),util[_0x7d00('0x45')](_0xafba3f,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x7d00('0xc')][_0x7d00('0x21')]=function(_0x2276f6){try{if(this['isNotNull'](_0x2276f6)){this[_0x7d00('0x92')](_0x2276f6[_0x7d00('0x6a')],_[_0x7d00('0x93')](_0x2276f6[_0x7d00('0x94')])[0x0],_0x2276f6[_0x7d00('0x95')]);if(this[_0x7d00('0x43')][_0x2276f6[_0x7d00('0x6a')]]){var _0x5b9528=_[_0x7d00('0x73')](this['queueReports'][_0x2276f6['uniqueid']]);if(_0x5b9528){if(this[_0x7d00('0x5c')](_0x2276f6[_0x7d00('0x94')])&&this[_0x7d00('0x5c')](_0x2276f6['variable'][_0x7d00('0x96')])){switch(_0x2276f6[_0x7d00('0x95')]){case'CONTINUE':_0x5b9528['queuecallerexit']=![];_0x5b9528[_0x7d00('0x8a')]=null;break;case'TIMEOUT':_0x5b9528[_0x7d00('0x97')]=_0x7d00('0x98');ami[_0x7d00('0x46')](_0x7d00('0x99'),_0x5b9528);break;default:_0x5b9528['queuecallerexit']=!![];_0x5b9528[_0x7d00('0x8a')]=moment()[_0x7d00('0x47')](_0x7d00('0x6b'));_0x5b9528[_0x7d00('0x9a')]=moment()[_0x7d00('0x47')](_0x7d00('0x6b'));}_0x5b9528['queuecallerabandon']=![];_0x5b9528['queuecallerabandonAt']=null;_0x5b9528[_0x7d00('0x79')]=_0x2276f6['value'];this[_0x7d00('0x35')][_0x2276f6[_0x7d00('0x6a')]]=_0x5b9528;this[_0x7d00('0x44')](_0x5b9528);}else if(this['isNotNull'](_0x2276f6[_0x7d00('0x94')])&&this[_0x7d00('0x5c')](_0x2276f6[_0x7d00('0x94')][_0x7d00('0x9b')])){if(!_0x5b9528['queuecallerabandon']){_0x5b9528[_0x7d00('0x83')]=!![];_0x5b9528['queuecallerexitAt']=moment()[_0x7d00('0x47')](_0x7d00('0x6b'));_0x5b9528['queuecallerexitreason']=_0x7d00('0x9c');_0x5b9528[_0x7d00('0x9a')]=moment()[_0x7d00('0x47')]('YYYY-MM-DD\x20HH:mm:ss');this[_0x7d00('0x35')][_0x2276f6[_0x7d00('0x6a')]]=_0x5b9528;}}_0x5b9528[_0x7d00('0x40')]=this['variables'][_0x2276f6[_0x7d00('0x6a')]];}}}}catch(_0x75979d){logger[_0x7d00('0x3e')](_0x7d00('0x9d'),util[_0x7d00('0x45')](_0x75979d,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x7d00('0x92')]=function(_0x2e9e6d,_0x3fd0e2,_0x2b2b23){var _0x66244d=[_0x7d00('0x9e'),_0x7d00('0x9f'),_0x7d00('0xa0'),_0x7d00('0xa1'),_0x7d00('0xa2'),_0x7d00('0xa3'),_0x7d00('0xa4'),_0x7d00('0xa5'),_0x7d00('0xa6'),_0x7d00('0xa7'),_0x7d00('0xa8'),_0x7d00('0xa9'),_0x7d00('0xaa'),_0x7d00('0xab'),_0x7d00('0xac'),_0x7d00('0xad'),_0x7d00('0x82'),_0x7d00('0xae'),_0x7d00('0xaf')];if(!_[_0x7d00('0x37')](_0x3fd0e2)&&!_[_0x7d00('0xb0')](_0x66244d,_0x3fd0e2)){if(_[_0x7d00('0x5d')](this[_0x7d00('0x40')][_0x2e9e6d])){this['variables'][_0x2e9e6d]={};}this['variables'][_0x2e9e6d][_0x3fd0e2]=_0x2b2b23;}};VoiceQueueReport[_0x7d00('0xc')][_0x7d00('0x22')]=function(_0x407e25){try{if(this['isNotNull'](_0x407e25)){if(this['queueReports'][_0x407e25['uniqueid']]){for(var _0x554428=0x0,_0x47a23f={};_0x554428=0x0?moment(_0x110ad5['endtime'])[_0xf3c1('0xd')](_0x110ad5['starttime'],_0xf3c1('0x18')):null,'data1':_0xf3c1('0x19'),'data2':_0x110ad5[_0xf3c1('0x11')],'data3':_0x110ad5[_0xf3c1('0x1a')],'data4':_0x110ad5[_0xf3c1('0x1b')]||null,'role':_0xf3c1('0x10'),'internal':_0x110ad5[_0xf3c1('0x11')]?_[_0xf3c1('0x12')](_0x110ad5['accountcode']):undefined,'uniqueid':_0x110ad5['uniqueid']},'log':'CreateMemberReport'});};
\ No newline at end of file
+var _0xcc2f=['accountcode','uniqueid','voiceDialReport','voice','membername','starttime','endtime','dialstring','toNumber','moment','lodash','util','queuecallercompleteAt','queuecallerexitAt','Request','CreateMemberReport','lastAssignedTo','isNil','interface','format','SIP/%s','queuecallerleaveAt','diff','seconds','inbound','exten','agent'];(function(_0x4d7583,_0x48d896){var _0x54ddde=function(_0x32b8c8){while(--_0x32b8c8){_0x4d7583['push'](_0x4d7583['shift']());}};_0x54ddde(++_0x48d896);}(_0xcc2f,0xab));var _0xfcc2=function(_0x2a6786,_0x1c5b74){_0x2a6786=_0x2a6786-0x0;var _0x3627fa=_0xcc2f[_0x2a6786];return _0x3627fa;};'use strict';var moment=require(_0xfcc2('0x0'));var _=require(_0xfcc2('0x1'));var util=require(_0xfcc2('0x2'));var client=require('../client');exports['voiceQueueReport']=function(_0x3aa0e1){var _0x27eac3=_0x3aa0e1[_0xfcc2('0x3')]||_0x3aa0e1[_0xfcc2('0x4')];return client[_0xfcc2('0x5')](_0xfcc2('0x6'),{'body':{'channel':'voice','membername':_0x3aa0e1[_0xfcc2('0x7')],'interface':_[_0xfcc2('0x8')](_0x3aa0e1[_0xfcc2('0x9')])?util[_0xfcc2('0xa')](_0xfcc2('0xb'),_0x3aa0e1['lastAssignedTo']):_0x3aa0e1[_0xfcc2('0x9')],'type':'TALKING','enterAt':_0x3aa0e1[_0xfcc2('0xc')],'exitAt':_0x27eac3,'duration':moment(_0x27eac3)[_0xfcc2('0xd')](_0x3aa0e1[_0xfcc2('0xc')],_0xfcc2('0xe')),'data1':_0xfcc2('0xf'),'data2':_0x3aa0e1['calleridnum'],'data3':_0x3aa0e1[_0xfcc2('0x10')],'data4':null,'data5':_0x3aa0e1['queue'],'role':_0xfcc2('0x11'),'internal':_0x3aa0e1[_0xfcc2('0x12')]?_['toNumber'](_0x3aa0e1['accountcode']):undefined,'uniqueid':_0x3aa0e1[_0xfcc2('0x13')]},'log':'CreateMemberReport'});};exports[_0xfcc2('0x14')]=function(_0x3f0ef8){return client[_0xfcc2('0x5')](_0xfcc2('0x6'),{'body':{'channel':_0xfcc2('0x15'),'membername':_0x3f0ef8[_0xfcc2('0x16')],'interface':_0x3f0ef8['interface'],'type':'TALKING','enterAt':_0x3f0ef8[_0xfcc2('0x17')],'exitAt':_0x3f0ef8['endtime'],'duration':moment(_0x3f0ef8[_0xfcc2('0x18')])['diff'](_0x3f0ef8[_0xfcc2('0x17')],'seconds')>=0x0?moment(_0x3f0ef8[_0xfcc2('0x18')])[_0xfcc2('0xd')](_0x3f0ef8['starttime'],'seconds'):null,'data1':'outbound','data2':_0x3f0ef8[_0xfcc2('0x12')],'data3':_0x3f0ef8[_0xfcc2('0x10')],'data4':_0x3f0ef8[_0xfcc2('0x19')]||null,'role':'agent','internal':_0x3f0ef8[_0xfcc2('0x12')]?_[_0xfcc2('0x1a')](_0x3f0ef8[_0xfcc2('0x12')]):undefined,'uniqueid':_0x3f0ef8['uniqueid']},'log':'CreateMemberReport'});};
\ No newline at end of file
diff --git a/server/services/ami/rpc/template.js b/server/services/ami/rpc/template.js
index 9b9c98d..0b3c062 100644
--- a/server/services/ami/rpc/template.js
+++ b/server/services/ami/rpc/template.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x8130=['name','html','../client','getTemplates','Request','GetTemplate'];(function(_0x5e9ab7,_0x272d43){var _0x39cafc=function(_0x387c9a){while(--_0x387c9a){_0x5e9ab7['push'](_0x5e9ab7['shift']());}};_0x39cafc(++_0x272d43);}(_0x8130,0x146));var _0x0813=function(_0x5b14bb,_0x487661){_0x5b14bb=_0x5b14bb-0x0;var _0x31467f=_0x8130[_0x5b14bb];return _0x31467f;};'use strict';var client=require(_0x0813('0x0'));exports[_0x0813('0x1')]=function(_0x5038a7){return function(_0xb7d498){return client[_0x0813('0x2')](_0x0813('0x3'),{'options':{'raw':!![],'attributes':['id',_0x0813('0x4'),_0x0813('0x5')]},'log':_0x0813('0x3')});};};
\ No newline at end of file
+var _0x693f=['name','html','../client','getTemplates','GetTemplate'];(function(_0x396466,_0xe9857b){var _0x5e9ab4=function(_0x362f66){while(--_0x362f66){_0x396466['push'](_0x396466['shift']());}};_0x5e9ab4(++_0xe9857b);}(_0x693f,0x9d));var _0xf693=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x693f[_0x14add3];return _0x4a174f;};'use strict';var client=require(_0xf693('0x0'));exports[_0xf693('0x1')]=function(_0x3511a1){return function(_0x4b17c7){return client['Request'](_0xf693('0x2'),{'options':{'raw':!![],'attributes':['id',_0xf693('0x3'),_0xf693('0x4')]},'log':_0xf693('0x2')});};};
\ No newline at end of file
diff --git a/server/services/ami/rpc/trigger.js b/server/services/ami/rpc/trigger.js
index 4d2bca3..554735d 100644
--- a/server/services/ami/rpc/trigger.js
+++ b/server/services/ami/rpc/trigger.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x2a04=['action','data1','data3','data4','data5','data7','../client','getTriggers','Request','GetTrigger','name','channel','status','Condition','AllConditions','field','value','AnyConditions','Action'];(function(_0x272eff,_0x27fba0){var _0x50b502=function(_0x39e228){while(--_0x39e228){_0x272eff['push'](_0x272eff['shift']());}};_0x50b502(++_0x27fba0);}(_0x2a04,0xc4));var _0x42a0=function(_0x1f5dbf,_0x84cde0){_0x1f5dbf=_0x1f5dbf-0x0;var _0x15be6e=_0x2a04[_0x1f5dbf];return _0x15be6e;};'use strict';var client=require(_0x42a0('0x0'));exports[_0x42a0('0x1')]=function(_0x4ab8d5){return function(_0x4e4711){return client[_0x42a0('0x2')](_0x42a0('0x3'),{'options':{'raw':![],'attributes':['id',_0x42a0('0x4'),_0x42a0('0x5'),_0x42a0('0x6')],'include':[{'model':_0x42a0('0x7'),'as':_0x42a0('0x8'),'attributes':['id',_0x42a0('0x9'),'operator',_0x42a0('0xa')]},{'model':_0x42a0('0x7'),'as':_0x42a0('0xb'),'attributes':['id',_0x42a0('0x9'),'operator','value']},{'model':_0x42a0('0xc'),'as':'Actions','attributes':['id',_0x42a0('0xd'),_0x42a0('0xe'),'data2',_0x42a0('0xf'),_0x42a0('0x10'),_0x42a0('0x11'),'data6',_0x42a0('0x12')]}]},'log':_0x42a0('0x3')});};};
\ No newline at end of file
+var _0xd1ee=['value','Condition','AnyConditions','field','Action','Actions','action','data1','data2','data3','data4','data5','data6','data7','../client','getTriggers','GetTrigger','name','channel','status','AllConditions','operator'];(function(_0x3541be,_0x105f79){var _0x468899=function(_0x563640){while(--_0x563640){_0x3541be['push'](_0x3541be['shift']());}};_0x468899(++_0x105f79);}(_0xd1ee,0x1c6));var _0xed1e=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd1ee[_0x3dd15e];return _0x231fd0;};'use strict';var client=require(_0xed1e('0x0'));exports[_0xed1e('0x1')]=function(_0x48e08a){return function(_0x10b05c){return client['Request'](_0xed1e('0x2'),{'options':{'raw':![],'attributes':['id',_0xed1e('0x3'),_0xed1e('0x4'),_0xed1e('0x5')],'include':[{'model':'Condition','as':_0xed1e('0x6'),'attributes':['id','field',_0xed1e('0x7'),_0xed1e('0x8')]},{'model':_0xed1e('0x9'),'as':_0xed1e('0xa'),'attributes':['id',_0xed1e('0xb'),'operator',_0xed1e('0x8')]},{'model':_0xed1e('0xc'),'as':_0xed1e('0xd'),'attributes':['id',_0xed1e('0xe'),_0xed1e('0xf'),_0xed1e('0x10'),_0xed1e('0x11'),_0xed1e('0x12'),_0xed1e('0x13'),_0xed1e('0x14'),_0xed1e('0x15')]}]},'log':_0xed1e('0x2')});};};
\ No newline at end of file
diff --git a/server/services/ami/rpc/trunk.js b/server/services/ami/rpc/trunk.js
index 0067fe7..e90f4d5 100644
--- a/server/services/ami/rpc/trunk.js
+++ b/server/services/ami/rpc/trunk.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xb420=['GetTrunk','name','registry','../client','Request'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb420,0x10c));var _0x0b42=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xb420[_0x501510];return _0x1e6ee5;};'use strict';var client=require(_0x0b42('0x0'));exports['getTrunks']=function(_0x19a59f){return function(_0x5cbc0c){return client[_0x0b42('0x1')](_0x0b42('0x2'),{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id',_0x0b42('0x3'),_0x0b42('0x4')]},'log':'GetTrunk'});};};
\ No newline at end of file
+var _0xa2ed=['GetTrunk','name','registry','../client','getTrunks','Request'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa2ed,0xe1));var _0xda2e=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa2ed[_0x3dd15e];return _0x231fd0;};'use strict';var client=require(_0xda2e('0x0'));exports[_0xda2e('0x1')]=function(_0x3ce294){return function(_0x225819){return client[_0xda2e('0x2')](_0xda2e('0x3'),{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id',_0xda2e('0x4'),_0xda2e('0x5')]},'log':_0xda2e('0x3')});};};
\ No newline at end of file
diff --git a/server/services/ami/rpc/user.js b/server/services/ami/rpc/user.js
index 5d492cd..7e422fa 100644
--- a/server/services/ami/rpc/user.js
+++ b/server/services/ami/rpc/user.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9b73=['ShowUser','name','lastPauseAt','../client','getAgents','GetUser','agent','email','accountcode','fullname','online','lastLoginAt','pauseType','voicePause','phone','mobile','interface','Request','internal','savePause','PauseUser','saveUnpause','UnpauseUser','getAgent'];(function(_0x5c0d6b,_0x3f8b79){var _0x5f1f35=function(_0x36ac53){while(--_0x36ac53){_0x5c0d6b['push'](_0x5c0d6b['shift']());}};_0x5f1f35(++_0x3f8b79);}(_0x9b73,0x123));var _0x39b7=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x9b73[_0xbca1b1];return _0x4e1686;};'use strict';var client=require(_0x39b7('0x0'));exports[_0x39b7('0x1')]=function(){return function(){return client['Request'](_0x39b7('0x2'),{'options':{'raw':![],'where':{'role':_0x39b7('0x3')},'attributes':['id','name',_0x39b7('0x4'),_0x39b7('0x5'),_0x39b7('0x6'),_0x39b7('0x7'),_0x39b7('0x8'),_0x39b7('0x9'),'lastPauseAt',_0x39b7('0xa'),_0x39b7('0xb'),_0x39b7('0xc'),_0x39b7('0xd')]},'log':'getAgents'});};};exports['getTelephones']=function(){return function(){return client[_0x39b7('0xe')](_0x39b7('0x2'),{'options':{'raw':!![],'where':{'role':'telephone'},'attributes':['id','name',_0x39b7('0x5'),_0x39b7('0xf')]},'log':'getTelephones'});};};exports[_0x39b7('0x10')]=function(_0x2b8398,_0x30aa4e,_0x499f4e){return client[_0x39b7('0xe')](_0x39b7('0x11'),{'body':{'type':_0x30aa4e,'uniqueid':_0x499f4e},'options':{'where':{'id':_0x2b8398['id']}},'log':_0x39b7('0x10')});};exports[_0x39b7('0x12')]=function(_0x397f18){return client[_0x39b7('0xe')](_0x39b7('0x13'),{'body':{},'options':{'where':{'id':_0x397f18['id']}},'log':'savePause'});};exports[_0x39b7('0x14')]=function(_0x36010b){return client[_0x39b7('0xe')](_0x39b7('0x15'),{'options':{'raw':![],'where':{'role':'agent','id':_0x36010b},'attributes':['id',_0x39b7('0x16'),_0x39b7('0x4'),_0x39b7('0x5'),_0x39b7('0x6'),_0x39b7('0x7'),'lastLoginAt',_0x39b7('0x9'),_0x39b7('0x17'),'voicePause',_0x39b7('0xd')]},'log':_0x39b7('0x14')});};
\ No newline at end of file
+var _0xf85d=['internal','getTelephones','savePause','getAgent','ShowUser','voicePause','Request','GetUser','agent','name','email','accountcode','fullname','lastLoginAt','pauseType','lastPauseAt','phone','mobile','interface','telephone'];(function(_0xe1c706,_0x3a7f82){var _0xd1cbe=function(_0xae3845){while(--_0xae3845){_0xe1c706['push'](_0xe1c706['shift']());}};_0xd1cbe(++_0x3a7f82);}(_0xf85d,0xf6));var _0xdf85=function(_0x53afa6,_0x59e786){_0x53afa6=_0x53afa6-0x0;var _0x51f86a=_0xf85d[_0x53afa6];return _0x51f86a;};'use strict';var client=require('../client');exports['getAgents']=function(){return function(){return client[_0xdf85('0x0')](_0xdf85('0x1'),{'options':{'raw':![],'where':{'role':_0xdf85('0x2')},'attributes':['id',_0xdf85('0x3'),_0xdf85('0x4'),_0xdf85('0x5'),_0xdf85('0x6'),'online',_0xdf85('0x7'),_0xdf85('0x8'),_0xdf85('0x9'),'voicePause',_0xdf85('0xa'),_0xdf85('0xb'),_0xdf85('0xc')]},'log':'getAgents'});};};exports['getTelephones']=function(){return function(){return client['Request'](_0xdf85('0x1'),{'options':{'raw':!![],'where':{'role':_0xdf85('0xd')},'attributes':['id',_0xdf85('0x3'),'accountcode',_0xdf85('0xe')]},'log':_0xdf85('0xf')});};};exports[_0xdf85('0x10')]=function(_0x3c6cfd,_0x2bbab3,_0x443d4e){return client[_0xdf85('0x0')]('PauseUser',{'body':{'type':_0x2bbab3,'uniqueid':_0x443d4e},'options':{'where':{'id':_0x3c6cfd['id']}},'log':_0xdf85('0x10')});};exports['saveUnpause']=function(_0x31e62e){return client[_0xdf85('0x0')]('UnpauseUser',{'body':{},'options':{'where':{'id':_0x31e62e['id']}},'log':_0xdf85('0x10')});};exports[_0xdf85('0x11')]=function(_0x4a6158){return client[_0xdf85('0x0')](_0xdf85('0x12'),{'options':{'raw':![],'where':{'role':_0xdf85('0x2'),'id':_0x4a6158},'attributes':['id',_0xdf85('0x3'),'email',_0xdf85('0x5'),'fullname','online',_0xdf85('0x7'),_0xdf85('0x8'),_0xdf85('0x9'),_0xdf85('0x13'),'interface']},'log':_0xdf85('0x11')});};
\ No newline at end of file
diff --git a/server/services/ami/rpc/voiceAgentReport.js b/server/services/ami/rpc/voiceAgentReport.js
index 6dd51b0..9d28914 100644
--- a/server/services/ami/rpc/voiceAgentReport.js
+++ b/server/services/ami/rpc/voiceAgentReport.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xb846=['update','../client','create','Request','CreateVoiceAgentReport'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xb846,0x15a));var _0x6b84=function(_0x138adb,_0x193fee){_0x138adb=_0x138adb-0x0;var _0x1b27f2=_0xb846[_0x138adb];return _0x1b27f2;};'use strict';var client=require(_0x6b84('0x0'));exports[_0x6b84('0x1')]=function(_0x447934){return client[_0x6b84('0x2')](_0x6b84('0x3'),{'body':_0x447934,'log':_0x6b84('0x3')});};exports[_0x6b84('0x4')]=function(_0x3c9dad,_0x272787,_0x1d8aeb){return client['Request']('UpdateVoiceAgentReport',{'body':_0x3c9dad,'options':{'where':{'uniqueid':_0x272787,'interface':_0x1d8aeb,'agentcomplete':!![]}},'log':'UpdateVoiceAgentReport'});};
\ No newline at end of file
+var _0x44f4=['../client','Request','CreateVoiceAgentReport','UpdateVoiceAgentReport'];(function(_0x2d8fc2,_0x1c461d){var _0x3a9e53=function(_0x18941c){while(--_0x18941c){_0x2d8fc2['push'](_0x2d8fc2['shift']());}};_0x3a9e53(++_0x1c461d);}(_0x44f4,0x140));var _0x444f=function(_0x42acd8,_0x335ff2){_0x42acd8=_0x42acd8-0x0;var _0x291afb=_0x44f4[_0x42acd8];return _0x291afb;};'use strict';var client=require(_0x444f('0x0'));exports['create']=function(_0x581047){return client[_0x444f('0x1')](_0x444f('0x2'),{'body':_0x581047,'log':_0x444f('0x2')});};exports['update']=function(_0x20587c,_0x4dd98d,_0xdb1585){return client[_0x444f('0x1')](_0x444f('0x3'),{'body':_0x20587c,'options':{'where':{'uniqueid':_0x4dd98d,'interface':_0xdb1585,'agentcomplete':!![]}},'log':_0x444f('0x3')});};
\ No newline at end of file
diff --git a/server/services/ami/rpc/voiceCallReport.js b/server/services/ami/rpc/voiceCallReport.js
index d08e6be..1bcfe38 100644
--- a/server/services/ami/rpc/voiceCallReport.js
+++ b/server/services/ami/rpc/voiceCallReport.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x3f42=['util','../client','Request','CreateVoiceCallReport','merge','calleridnum','context','callerid','DOCUMENTATION','getVoiceCallReports','outbound','startOf','format','endOf','YYYY-MM-DD\x20HH:mm:ss','type','disposition','billableseconds','moment'];(function(_0x47d11c,_0x4815d2){var _0x45b959=function(_0x238d55){while(--_0x238d55){_0x47d11c['push'](_0x47d11c['shift']());}};_0x45b959(++_0x4815d2);}(_0x3f42,0x84));var _0x23f4=function(_0x4cdcd0,_0x359529){_0x4cdcd0=_0x4cdcd0-0x0;var _0x5b4abf=_0x3f42[_0x4cdcd0];return _0x5b4abf;};'use strict';var moment=require(_0x23f4('0x0'));var util=require(_0x23f4('0x1'));var _=require('lodash');var client=require(_0x23f4('0x2'));exports['create']=function(_0x401af7){return client[_0x23f4('0x3')](_0x23f4('0x4'),{'body':_[_0x23f4('0x5')](_0x401af7,{'source':_0x401af7[_0x23f4('0x6')],'destinationcontext':_0x401af7[_0x23f4('0x7')],'callerid':_0x401af7[_0x23f4('0x8')],'amaflags':_0x23f4('0x9')}),'log':'CreateVoiceCallReport'});};exports[_0x23f4('0xa')]=function(){return function(){return client[_0x23f4('0x3')]('GetVoiceCallReport',{'options':{'where':{'type':[_0x23f4('0xb')],'createdAt':{'$between':[moment()[_0x23f4('0xc')]('day')[_0x23f4('0xd')]('YYYY-MM-DD\x20HH:mm:ss'),moment()[_0x23f4('0xe')]('day')[_0x23f4('0xd')](_0x23f4('0xf'))]}},'attributes':[_0x23f4('0x10'),_0x23f4('0x11'),'duration',_0x23f4('0x12')]},'log':'GetVoiceCallReports'});};};
\ No newline at end of file
+var _0x66c1=['day','format','YYYY-MM-DD\x20HH:mm:ss','endOf','type','disposition','duration','billableseconds','moment','util','lodash','../client','create','Request','CreateVoiceCallReport','calleridnum','context','callerid','DOCUMENTATION','getVoiceCallReports','startOf'];(function(_0x425b18,_0x24cb5c){var _0x167782=function(_0x129279){while(--_0x129279){_0x425b18['push'](_0x425b18['shift']());}};_0x167782(++_0x24cb5c);}(_0x66c1,0x71));var _0x166c=function(_0x4b3147,_0x2a3dbe){_0x4b3147=_0x4b3147-0x0;var _0x3446c1=_0x66c1[_0x4b3147];return _0x3446c1;};'use strict';var moment=require(_0x166c('0x0'));var util=require(_0x166c('0x1'));var _=require(_0x166c('0x2'));var client=require(_0x166c('0x3'));exports[_0x166c('0x4')]=function(_0x4e1194){return client[_0x166c('0x5')](_0x166c('0x6'),{'body':_['merge'](_0x4e1194,{'source':_0x4e1194[_0x166c('0x7')],'destinationcontext':_0x4e1194[_0x166c('0x8')],'callerid':_0x4e1194[_0x166c('0x9')],'amaflags':_0x166c('0xa')}),'log':_0x166c('0x6')});};exports[_0x166c('0xb')]=function(){return function(){return client[_0x166c('0x5')]('GetVoiceCallReport',{'options':{'where':{'type':['outbound'],'createdAt':{'$between':[moment()[_0x166c('0xc')](_0x166c('0xd'))[_0x166c('0xe')](_0x166c('0xf')),moment()[_0x166c('0x10')]('day')[_0x166c('0xe')]('YYYY-MM-DD\x20HH:mm:ss')]}},'attributes':[_0x166c('0x11'),_0x166c('0x12'),_0x166c('0x13'),_0x166c('0x14')]},'log':'GetVoiceCallReports'});};};
\ No newline at end of file
diff --git a/server/services/ami/rpc/voiceDialReport.js b/server/services/ami/rpc/voiceDialReport.js
index b072e19..d7d36ea 100644
--- a/server/services/ami/rpc/voiceDialReport.js
+++ b/server/services/ami/rpc/voiceDialReport.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x5b2a=['CreateVoiceDialReport','../client','create'];(function(_0xac5ab,_0x25058b){var _0x360cd2=function(_0x59f9eb){while(--_0x59f9eb){_0xac5ab['push'](_0xac5ab['shift']());}};_0x360cd2(++_0x25058b);}(_0x5b2a,0x1d5));var _0xa5b2=function(_0x186d17,_0x9fa8ef){_0x186d17=_0x186d17-0x0;var _0x5d4b89=_0x5b2a[_0x186d17];return _0x5d4b89;};'use strict';var client=require(_0xa5b2('0x0'));exports[_0xa5b2('0x1')]=function(_0x21ed53){return client['Request'](_0xa5b2('0x2'),{'body':_0x21ed53,'log':_0xa5b2('0x2')});};
\ No newline at end of file
+var _0x9abc=['Request','CreateVoiceDialReport','../client','create'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x9abc,0x10e));var _0xc9ab=function(_0xb69888,_0x1c9f86){_0xb69888=_0xb69888-0x0;var _0x381491=_0x9abc[_0xb69888];return _0x381491;};'use strict';var client=require(_0xc9ab('0x0'));exports[_0xc9ab('0x1')]=function(_0x5d9351){return client[_0xc9ab('0x2')](_0xc9ab('0x3'),{'body':_0x5d9351,'log':'CreateVoiceDialReport'});};
\ No newline at end of file
diff --git a/server/services/ami/rpc/voiceExtension.js b/server/services/ami/rpc/voiceExtension.js
index 146f8fc..ee42cff 100644
--- a/server/services/ami/rpc/voiceExtension.js
+++ b/server/services/ami/rpc/voiceExtension.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x41fa=['getVoiceExtensions','Request','GetVoiceExtension','exten','recordingFormat','../client'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x41fa,0x1f1));var _0xa41f=function(_0x4360c4,_0x2f8209){_0x4360c4=_0x4360c4-0x0;var _0x3168c8=_0x41fa[_0x4360c4];return _0x3168c8;};'use strict';var client=require(_0xa41f('0x0'));exports[_0xa41f('0x1')]=function(){return function(){return client[_0xa41f('0x2')](_0xa41f('0x3'),{'options':{'raw':!![],'attributes':['id',_0xa41f('0x4'),_0xa41f('0x5')],'where':{'VoiceExtensionId':null}},'log':'getVoiceExtensions'});};};
\ No newline at end of file
+var _0xd84c=['../client','getVoiceExtensions','Request','GetVoiceExtension','exten','recordingFormat'];(function(_0x505de5,_0x41b3bb){var _0x45ffeb=function(_0x2ca66c){while(--_0x2ca66c){_0x505de5['push'](_0x505de5['shift']());}};_0x45ffeb(++_0x41b3bb);}(_0xd84c,0x102));var _0xcd84=function(_0x336ce7,_0x3f830c){_0x336ce7=_0x336ce7-0x0;var _0x359d9b=_0xd84c[_0x336ce7];return _0x359d9b;};'use strict';var client=require(_0xcd84('0x0'));exports[_0xcd84('0x1')]=function(){return function(){return client[_0xcd84('0x2')](_0xcd84('0x3'),{'options':{'raw':!![],'attributes':['id',_0xcd84('0x4'),_0xcd84('0x5')],'where':{'VoiceExtensionId':null}},'log':_0xcd84('0x1')});};};
\ No newline at end of file
diff --git a/server/services/ami/rpc/voiceQueue.js b/server/services/ami/rpc/voiceQueue.js
index b45f116..89a1cd2 100644
--- a/server/services/ami/rpc/voiceQueue.js
+++ b/server/services/ami/rpc/voiceQueue.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xb282=['dialQueueProject','dialCongestionRetryFrequency','dialBusyMaxRetry','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialTimezone','dialGlobalInterval','dialCheckDuplicateType','dialAMDActive','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','timeout','dialRecallMeTimeout','dialRecallInQueue','dialAgiAfterHangupAgent','dialAgiAfterHangupClient','dialQueueProject2','strategy','dialCutDigit','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','mandatoryDisposition','dialPredictiveIntervalMinThreshold','Trunk','callerid','active','Pause','mandatoryDispositionPause','TrunkBackup','Interval','interval','../client','getVoiceQueues','Request','GetVoiceQueue','name','acw','monitor_format','type','dialActive','dialMethod','dialLimitChannel','dialPowerLevel','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateTimeout'];(function(_0x96379,_0x11e230){var _0x3e3a01=function(_0xe53937){while(--_0xe53937){_0x96379['push'](_0x96379['shift']());}};_0x3e3a01(++_0x11e230);}(_0xb282,0xa2));var _0x2b28=function(_0x429e7e,_0x5ae693){_0x429e7e=_0x429e7e-0x0;var _0x22c7d7=_0xb282[_0x429e7e];return _0x22c7d7;};'use strict';var client=require(_0x2b28('0x0'));exports[_0x2b28('0x1')]=function(){return function(){return client[_0x2b28('0x2')](_0x2b28('0x3'),{'options':{'raw':![],'attributes':['id',_0x2b28('0x4'),_0x2b28('0x5'),'acwTimeout','autopause',_0x2b28('0x6'),_0x2b28('0x7'),_0x2b28('0x8'),_0x2b28('0x9'),_0x2b28('0xa'),'dialLimitQueue',_0x2b28('0xb'),'dialPredictiveOptimization',_0x2b28('0xc'),_0x2b28('0xd'),'dialOriginateCallerIdName','dialOriginateCallerIdNumber',_0x2b28('0xe'),'dialQueueOptions','dialQueueTimeout',_0x2b28('0xf'),'dialCongestionMaxRetry',_0x2b28('0x10'),_0x2b28('0x11'),'dialBusyRetryFrequency',_0x2b28('0x12'),_0x2b28('0x13'),'dialGlobalMaxRetry',_0x2b28('0x14'),_0x2b28('0x15'),'dialPrefix',_0x2b28('0x16'),_0x2b28('0x17'),'dialAMDInitialSilence',_0x2b28('0x18'),_0x2b28('0x19'),'dialAMDTotalAnalysisTime',_0x2b28('0x1a'),_0x2b28('0x1b'),_0x2b28('0x1c'),_0x2b28('0x1d'),_0x2b28('0x1e'),_0x2b28('0x1f'),_0x2b28('0x20'),_0x2b28('0x21'),'dialOrderByScheduledAt',_0x2b28('0x22'),_0x2b28('0x23'),_0x2b28('0x24'),_0x2b28('0x6'),_0x2b28('0x25'),'dialRandomLastDigitCallerIdNumber',_0x2b28('0x26'),_0x2b28('0x27'),_0x2b28('0x28'),_0x2b28('0x29'),_0x2b28('0x2a'),_0x2b28('0x2b'),_0x2b28('0x2c'),_0x2b28('0x2d'),_0x2b28('0x2e'),_0x2b28('0x2f'),_0x2b28('0x30'),_0x2b28('0x31'),'dialPredictiveIntervalMaxThreshold',_0x2b28('0x32')],'include':[{'model':'Trunk','as':_0x2b28('0x33'),'attributes':['id',_0x2b28('0x4'),_0x2b28('0x34'),_0x2b28('0x35')]},{'model':_0x2b28('0x36'),'as':_0x2b28('0x37'),'attributes':['id',_0x2b28('0x4')]},{'model':_0x2b28('0x33'),'as':_0x2b28('0x38'),'attributes':['id',_0x2b28('0x4'),'callerid',_0x2b28('0x35')]},{'model':_0x2b28('0x39'),'as':_0x2b28('0x39'),'attributes':['id',_0x2b28('0x4')],'include':[{'model':_0x2b28('0x39'),'as':'Intervals','attributes':['id',_0x2b28('0x4'),_0x2b28('0x3a')]}]}]},'log':_0x2b28('0x1')});};};
\ No newline at end of file
+var _0x9051=['dialAMDSilenceThreshold','dialAMDMaximumWordLength','timeout','dialRecallInQueue','dialOrderByScheduledAt','dialAgiAfterHangupAgent','dialQueueProject2','strategy','dialRandomLastDigitCallerIdNumber','dialCutDigit','dialNoSuchNumberMaxRetry','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','mandatoryDisposition','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','callerid','active','Pause','mandatoryDispositionPause','Trunk','Interval','Intervals','interval','getVoiceQueues','../client','Request','name','acw','acwTimeout','autopause','monitor_format','type','dialActive','dialMethod','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dialPredictiveInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialGlobalMaxRetry','dialTimezone','dialGlobalInterval','dialPrefix','dialAMDActive','dialAMDInitialSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords'];(function(_0x390c42,_0x10e1ae){var _0x43894c=function(_0x510bd0){while(--_0x510bd0){_0x390c42['push'](_0x390c42['shift']());}};_0x43894c(++_0x10e1ae);}(_0x9051,0x1d7));var _0x1905=function(_0x2c9fd2,_0x13c630){_0x2c9fd2=_0x2c9fd2-0x0;var _0xe7c289=_0x9051[_0x2c9fd2];return _0xe7c289;};'use strict';var client=require(_0x1905('0x0'));exports['getVoiceQueues']=function(){return function(){return client[_0x1905('0x1')]('GetVoiceQueue',{'options':{'raw':![],'attributes':['id',_0x1905('0x2'),_0x1905('0x3'),_0x1905('0x4'),_0x1905('0x5'),_0x1905('0x6'),_0x1905('0x7'),_0x1905('0x8'),_0x1905('0x9'),'dialLimitChannel',_0x1905('0xa'),_0x1905('0xb'),_0x1905('0xc'),'dialPredictiveOptimizationPercentage',_0x1905('0xd'),_0x1905('0xe'),_0x1905('0xf'),_0x1905('0x10'),'dialQueueOptions',_0x1905('0x11'),_0x1905('0x12'),_0x1905('0x13'),_0x1905('0x14'),'dialBusyMaxRetry',_0x1905('0x15'),_0x1905('0x16'),'dialNoAnswerRetryFrequency',_0x1905('0x17'),_0x1905('0x18'),_0x1905('0x19'),_0x1905('0x1a'),'dialCheckDuplicateType',_0x1905('0x1b'),_0x1905('0x1c'),'dialAMDGreeting','dialAMDAfterGreetingSilence',_0x1905('0x1d'),_0x1905('0x1e'),_0x1905('0x1f'),_0x1905('0x20'),_0x1905('0x21'),_0x1905('0x22'),_0x1905('0x23'),'dialRecallMeTimeout',_0x1905('0x24'),_0x1905('0x25'),_0x1905('0x26'),'dialAgiAfterHangupClient',_0x1905('0x27'),_0x1905('0x6'),_0x1905('0x28'),_0x1905('0x29'),_0x1905('0x2a'),_0x1905('0x2b'),'dialNoSuchNumberRetryFrequency',_0x1905('0x2c'),_0x1905('0x2d'),'dialAbandonedMaxRetry',_0x1905('0x2e'),_0x1905('0x2f'),_0x1905('0x30'),_0x1905('0x31'),_0x1905('0x32'),_0x1905('0x33'),_0x1905('0x34'),_0x1905('0x35')],'include':[{'model':'Trunk','as':'Trunk','attributes':['id',_0x1905('0x2'),_0x1905('0x36'),_0x1905('0x37')]},{'model':_0x1905('0x38'),'as':_0x1905('0x39'),'attributes':['id',_0x1905('0x2')]},{'model':_0x1905('0x3a'),'as':'TrunkBackup','attributes':['id',_0x1905('0x2'),'callerid',_0x1905('0x37')]},{'model':_0x1905('0x3b'),'as':_0x1905('0x3b'),'attributes':['id',_0x1905('0x2')],'include':[{'model':_0x1905('0x3b'),'as':_0x1905('0x3c'),'attributes':['id',_0x1905('0x2'),_0x1905('0x3d')]}]}]},'log':_0x1905('0x3e')});};};
\ No newline at end of file
diff --git a/server/services/ami/rpc/voiceQueueReport.js b/server/services/ami/rpc/voiceQueueReport.js
index 1a24d4a..e9604b7 100644
--- a/server/services/ami/rpc/voiceQueueReport.js
+++ b/server/services/ami/rpc/voiceQueueReport.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xa5d1=['uniqueid','queue','queuecallerjoinAt','queuecallerleaveAt','queuecallercomplete','queuecallercompleteAt','queuecallerexit','queuecallerabandon','queuecallerabandonAt','GetVoiceQueueReports','../client','create','Request','CreateVoiceQueueReport','GetVoiceQueueReport','startOf','day','format','YYYY-MM-DD\x20HH:mm:ss','endOf'];(function(_0x5b5eb4,_0x117c87){var _0x42af53=function(_0xdf6fcb){while(--_0xdf6fcb){_0x5b5eb4['push'](_0x5b5eb4['shift']());}};_0x42af53(++_0x117c87);}(_0xa5d1,0x1c2));var _0x1a5d=function(_0x1b286a,_0x506a9d){_0x1b286a=_0x1b286a-0x0;var _0x312f1b=_0xa5d1[_0x1b286a];return _0x312f1b;};'use strict';var moment=require('moment');var _=require('lodash');var client=require(_0x1a5d('0x0'));exports[_0x1a5d('0x1')]=function(_0x5ec899){return client[_0x1a5d('0x2')](_0x1a5d('0x3'),{'body':_0x5ec899,'log':_0x1a5d('0x3')});};exports['getVoiceQueueReports']=function(){return function(){return client['Request'](_0x1a5d('0x4'),{'options':{'where':{'createdAt':{'$between':[moment()[_0x1a5d('0x5')](_0x1a5d('0x6'))[_0x1a5d('0x7')](_0x1a5d('0x8')),moment()[_0x1a5d('0x9')](_0x1a5d('0x6'))['format'](_0x1a5d('0x8'))]}},'attributes':[_0x1a5d('0xa'),_0x1a5d('0xb'),_0x1a5d('0xc'),_0x1a5d('0xd'),_0x1a5d('0xe'),_0x1a5d('0xf'),_0x1a5d('0x10'),'queuecallerexitAt',_0x1a5d('0x11'),_0x1a5d('0x12')]},'log':_0x1a5d('0x13')});};};
\ No newline at end of file
+var _0x1d11=['CreateVoiceQueueReport','getVoiceQueueReports','GetVoiceQueueReport','day','YYYY-MM-DD\x20HH:mm:ss','endOf','uniqueid','queuecallerleaveAt','queuecallercomplete','queuecallercompleteAt','queuecallerabandon','queuecallerabandonAt','moment','lodash','../client','create','Request'];(function(_0x3e3833,_0x2d01db){var _0x511bab=function(_0x7eea7e){while(--_0x7eea7e){_0x3e3833['push'](_0x3e3833['shift']());}};_0x511bab(++_0x2d01db);}(_0x1d11,0xb6));var _0x11d1=function(_0x27dd18,_0x4d6178){_0x27dd18=_0x27dd18-0x0;var _0x3a5873=_0x1d11[_0x27dd18];return _0x3a5873;};'use strict';var moment=require(_0x11d1('0x0'));var _=require(_0x11d1('0x1'));var client=require(_0x11d1('0x2'));exports[_0x11d1('0x3')]=function(_0x444b12){return client[_0x11d1('0x4')](_0x11d1('0x5'),{'body':_0x444b12,'log':_0x11d1('0x5')});};exports[_0x11d1('0x6')]=function(){return function(){return client[_0x11d1('0x4')](_0x11d1('0x7'),{'options':{'where':{'createdAt':{'$between':[moment()['startOf'](_0x11d1('0x8'))['format'](_0x11d1('0x9')),moment()[_0x11d1('0xa')]('day')['format'](_0x11d1('0x9'))]}},'attributes':[_0x11d1('0xb'),'queue','queuecallerjoinAt',_0x11d1('0xc'),_0x11d1('0xd'),_0x11d1('0xe'),'queuecallerexit','queuecallerexitAt',_0x11d1('0xf'),_0x11d1('0x10')]},'log':'GetVoiceQueueReports'});};};
\ No newline at end of file
diff --git a/server/services/ami/rpc/voiceQueueRt.js b/server/services/ami/rpc/voiceQueueRt.js
index 7ceb30b..682ae0f 100644
--- a/server/services/ami/rpc/voiceQueueRt.js
+++ b/server/services/ami/rpc/voiceQueueRt.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7364=['getVoiceQueueRtPauses','Request','GetVoiceQueueRtPauses','../client'];(function(_0x5dfe9b,_0x318b85){var _0x3bb0f4=function(_0x9f12f3){while(--_0x9f12f3){_0x5dfe9b['push'](_0x5dfe9b['shift']());}};_0x3bb0f4(++_0x318b85);}(_0x7364,0x143));var _0x4736=function(_0x36af10,_0x287853){_0x36af10=_0x36af10-0x0;var _0x525d8b=_0x7364[_0x36af10];return _0x525d8b;};'use strict';var client=require(_0x4736('0x0'));exports[_0x4736('0x1')]=function(_0x152ca7){return function(){return client[_0x4736('0x2')](_0x4736('0x3'),{'options':{'where':{'VoiceQueueId':_0x152ca7,'paused':!![]},'raw':!![]},'log':'getVoiceQueueRtPauses'});};};
\ No newline at end of file
+var _0x4083=['../client','Request','GetVoiceQueueRtPauses'];(function(_0x3c6ae2,_0x5c52d8){var _0x4edda=function(_0x5593eb){while(--_0x5593eb){_0x3c6ae2['push'](_0x3c6ae2['shift']());}};_0x4edda(++_0x5c52d8);}(_0x4083,0x1b0));var _0x3408=function(_0x46161a,_0x1eb7fe){_0x46161a=_0x46161a-0x0;var _0x531421=_0x4083[_0x46161a];return _0x531421;};'use strict';var client=require(_0x3408('0x0'));exports['getVoiceQueueRtPauses']=function(_0x3b4b4a){return function(){return client[_0x3408('0x1')](_0x3408('0x2'),{'options':{'where':{'VoiceQueueId':_0x3b4b4a,'paused':!![]},'raw':!![]},'log':'getVoiceQueueRtPauses'});};};
\ No newline at end of file
diff --git a/server/services/ami/rpc/voiceRecording.js b/server/services/ami/rpc/voiceRecording.js
index d6a0101..192f99e 100644
--- a/server/services/ami/rpc/voiceRecording.js
+++ b/server/services/ami/rpc/voiceRecording.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x2f35=['merge','monitorFilename','lodash','CreateVoiceRecording'];(function(_0x365b05,_0x29559a){var _0x4bcf28=function(_0x5eb571){while(--_0x5eb571){_0x365b05['push'](_0x365b05['shift']());}};_0x4bcf28(++_0x29559a);}(_0x2f35,0xa6));var _0x52f3=function(_0x5a8611,_0x515fba){_0x5a8611=_0x5a8611-0x0;var _0x325dcf=_0x2f35[_0x5a8611];return _0x325dcf;};'use strict';var _=require(_0x52f3('0x0'));var client=require('../client');exports['create']=function(_0x3dbeef){return client['Request'](_0x52f3('0x1'),{'body':_[_0x52f3('0x2')](_0x3dbeef,{'value':_0x3dbeef[_0x52f3('0x3')]}),'log':'CreateVoiceRecording'});};
\ No newline at end of file
+var _0x3e07=['CreateVoiceRecording','monitorFilename','lodash','../client','Request'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x3e07,0xde));var _0x73e0=function(_0x149cb4,_0x3aa516){_0x149cb4=_0x149cb4-0x0;var _0x23d197=_0x3e07[_0x149cb4];return _0x23d197;};'use strict';var _=require(_0x73e0('0x0'));var client=require(_0x73e0('0x1'));exports['create']=function(_0x499400){return client[_0x73e0('0x2')](_0x73e0('0x3'),{'body':_['merge'](_0x499400,{'value':_0x499400[_0x73e0('0x4')]}),'log':'CreateVoiceRecording'});};
\ No newline at end of file
diff --git a/server/services/ami/rpc/voiceTransferReport.js b/server/services/ami/rpc/voiceTransferReport.js
index c38bf54..d9bd8e6 100644
--- a/server/services/ami/rpc/voiceTransferReport.js
+++ b/server/services/ami/rpc/voiceTransferReport.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xc05d=['transfereelinkedid','isexternal','context','extension','origtransferercalleridname','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','secondtransferercontext','secondtransfererexten','origtransfererlinkedid','transfertargetchannel','transfertargetcalleridnum','transfertargetcalleridname','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetexten','transfertargetlinkedid','origtransferercontext','origtransfererexten','attended','../client','blindTransfer','Request','CreateVoiceTransferReport','result','transfererconnectedlinename','transfereraccountcode','transfererlinkedid','transfereechannel','transfereecalleridnum','transfereecalleridname','transfereeconnectedlinename','transfereeexten'];(function(_0x31987e,_0x1003ff){var _0x38e4c7=function(_0x2a0b00){while(--_0x2a0b00){_0x31987e['push'](_0x31987e['shift']());}};_0x38e4c7(++_0x1003ff);}(_0xc05d,0x103));var _0xdc05=function(_0x5c9760,_0x3c6cbb){_0x5c9760=_0x5c9760-0x0;var _0x1ea4a2=_0xc05d[_0x5c9760];return _0x1ea4a2;};'use strict';var client=require(_0xdc05('0x0'));exports[_0xdc05('0x1')]=function(_0x2b3595){return client[_0xdc05('0x2')](_0xdc05('0x3'),{'body':{'result':_0x2b3595[_0xdc05('0x4')],'transfererchannel':_0x2b3595['transfererchannel'],'transferercalleridnum':_0x2b3595['transferercalleridnum'],'transferercalleridname':_0x2b3595['transferercalleridname'],'transfererconnectedlinenum':_0x2b3595['transfererconnectedlinenum'],'transfererconnectedlinename':_0x2b3595[_0xdc05('0x5')],'transfereraccountcode':_0x2b3595[_0xdc05('0x6')],'transferercontext':_0x2b3595['transferercontext'],'transfererexten':_0x2b3595['transfererexten'],'transfererlinkedid':_0x2b3595[_0xdc05('0x7')],'transfereechannel':_0x2b3595[_0xdc05('0x8')],'transfereecalleridnum':_0x2b3595[_0xdc05('0x9')],'transfereecalleridname':_0x2b3595[_0xdc05('0xa')],'transfereeconnectedlinenum':_0x2b3595['transfereeconnectedlinenum'],'transfereeconnectedlinename':_0x2b3595[_0xdc05('0xb')],'transfereeaccountcode':_0x2b3595['transfereeaccountcode'],'transfereecontext':_0x2b3595['transfereecontext'],'transfereeexten':_0x2b3595[_0xdc05('0xc')],'transfereelinkedid':_0x2b3595[_0xdc05('0xd')],'isexternal':_0x2b3595[_0xdc05('0xe')],'context':_0x2b3595[_0xdc05('0xf')],'extension':_0x2b3595[_0xdc05('0x10')],'type':'blind'},'log':_0xdc05('0x3')});};exports['attendedTransfer']=function(_0x4c2963){return client[_0xdc05('0x2')](_0xdc05('0x3'),{'body':{'result':_0x4c2963[_0xdc05('0x4')],'transfererchannel':_0x4c2963['origtransfererchannel'],'transferercalleridnum':_0x4c2963['origtransferercalleridnum'],'transferercalleridname':_0x4c2963[_0xdc05('0x11')],'transfererconnectedlinenum':_0x4c2963[_0xdc05('0x12')],'transfererconnectedlinename':_0x4c2963[_0xdc05('0x13')],'transfereraccountcode':_0x4c2963['origtransfereraccountcode'],'transferercontext':_0x4c2963[_0xdc05('0x14')],'transfererexten':_0x4c2963[_0xdc05('0x15')],'transfererlinkedid':_0x4c2963[_0xdc05('0x16')],'transfereechannel':_0x4c2963[_0xdc05('0x17')],'transfereecalleridnum':_0x4c2963[_0xdc05('0x18')],'transfereecalleridname':_0x4c2963[_0xdc05('0x19')],'transfereeconnectedlinenum':_0x4c2963[_0xdc05('0x1a')],'transfereeconnectedlinename':_0x4c2963[_0xdc05('0x1b')],'transfereeaccountcode':_0x4c2963[_0xdc05('0x1c')],'transfereecontext':_0x4c2963['transfertargetcontext'],'transfereeexten':_0x4c2963[_0xdc05('0x1d')],'transfereelinkedid':_0x4c2963[_0xdc05('0x1e')],'isexternal':_0x4c2963[_0xdc05('0xe')],'context':_0x4c2963[_0xdc05('0x1f')],'extension':_0x4c2963[_0xdc05('0x20')],'type':_0xdc05('0x21')},'log':'CreateVoiceTransferReport'});};
\ No newline at end of file
+var _0xa8ad=['transfererconnectedlinenum','transferercontext','transfererexten','transfererlinkedid','transfereechannel','transfereecalleridnum','transfereecalleridname','transfereeconnectedlinenum','transfereeconnectedlinename','transfereeaccountcode','transfereecontext','transfereeexten','isexternal','context','extension','attendedTransfer','origtransfererchannel','origtransferercalleridname','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransferercontext','secondtransfererexten','transfertargetchannel','transfertargetcalleridname','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetcontext','transfertargetlinkedid','origtransferercontext','attended','../client','blindTransfer','Request','CreateVoiceTransferReport','result','transfererchannel','transferercalleridnum','transferercalleridname'];(function(_0x1a26ff,_0x5fec1b){var _0x18b8cd=function(_0x56b9af){while(--_0x56b9af){_0x1a26ff['push'](_0x1a26ff['shift']());}};_0x18b8cd(++_0x5fec1b);}(_0xa8ad,0xbb));var _0xda8a=function(_0x18c57d,_0x16da2b){_0x18c57d=_0x18c57d-0x0;var _0xed0301=_0xa8ad[_0x18c57d];return _0xed0301;};'use strict';var client=require(_0xda8a('0x0'));exports[_0xda8a('0x1')]=function(_0x4f1059){return client[_0xda8a('0x2')](_0xda8a('0x3'),{'body':{'result':_0x4f1059[_0xda8a('0x4')],'transfererchannel':_0x4f1059[_0xda8a('0x5')],'transferercalleridnum':_0x4f1059[_0xda8a('0x6')],'transferercalleridname':_0x4f1059[_0xda8a('0x7')],'transfererconnectedlinenum':_0x4f1059[_0xda8a('0x8')],'transfererconnectedlinename':_0x4f1059['transfererconnectedlinename'],'transfereraccountcode':_0x4f1059['transfereraccountcode'],'transferercontext':_0x4f1059[_0xda8a('0x9')],'transfererexten':_0x4f1059[_0xda8a('0xa')],'transfererlinkedid':_0x4f1059[_0xda8a('0xb')],'transfereechannel':_0x4f1059[_0xda8a('0xc')],'transfereecalleridnum':_0x4f1059[_0xda8a('0xd')],'transfereecalleridname':_0x4f1059[_0xda8a('0xe')],'transfereeconnectedlinenum':_0x4f1059[_0xda8a('0xf')],'transfereeconnectedlinename':_0x4f1059[_0xda8a('0x10')],'transfereeaccountcode':_0x4f1059[_0xda8a('0x11')],'transfereecontext':_0x4f1059[_0xda8a('0x12')],'transfereeexten':_0x4f1059[_0xda8a('0x13')],'transfereelinkedid':_0x4f1059['transfereelinkedid'],'isexternal':_0x4f1059[_0xda8a('0x14')],'context':_0x4f1059[_0xda8a('0x15')],'extension':_0x4f1059[_0xda8a('0x16')],'type':'blind'},'log':_0xda8a('0x3')});};exports[_0xda8a('0x17')]=function(_0x2c2fb6){return client[_0xda8a('0x2')](_0xda8a('0x3'),{'body':{'result':_0x2c2fb6[_0xda8a('0x4')],'transfererchannel':_0x2c2fb6[_0xda8a('0x18')],'transferercalleridnum':_0x2c2fb6['origtransferercalleridnum'],'transferercalleridname':_0x2c2fb6[_0xda8a('0x19')],'transfererconnectedlinenum':_0x2c2fb6['secondtransfererconnectedlinenum'],'transfererconnectedlinename':_0x2c2fb6[_0xda8a('0x1a')],'transfereraccountcode':_0x2c2fb6[_0xda8a('0x1b')],'transferercontext':_0x2c2fb6[_0xda8a('0x1c')],'transfererexten':_0x2c2fb6[_0xda8a('0x1d')],'transfererlinkedid':_0x2c2fb6['origtransfererlinkedid'],'transfereechannel':_0x2c2fb6[_0xda8a('0x1e')],'transfereecalleridnum':_0x2c2fb6['transfertargetcalleridnum'],'transfereecalleridname':_0x2c2fb6[_0xda8a('0x1f')],'transfereeconnectedlinenum':_0x2c2fb6[_0xda8a('0x20')],'transfereeconnectedlinename':_0x2c2fb6[_0xda8a('0x21')],'transfereeaccountcode':_0x2c2fb6[_0xda8a('0x22')],'transfereecontext':_0x2c2fb6[_0xda8a('0x23')],'transfereeexten':_0x2c2fb6['transfertargetexten'],'transfereelinkedid':_0x2c2fb6[_0xda8a('0x24')],'isexternal':_0x2c2fb6[_0xda8a('0x14')],'context':_0x2c2fb6[_0xda8a('0x25')],'extension':_0x2c2fb6['origtransfererexten'],'type':_0xda8a('0x26')},'log':_0xda8a('0x3')});};
\ No newline at end of file
diff --git a/server/services/ami/server/index.js b/server/services/ami/server/index.js
index e561d0b..000f08a 100644
--- a/server/services/ami/server/index.js
+++ b/server/services/ami/server/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x6a7a=['listen','%s/%s','SIP','timers','timer','agents','updateStatusRealtime','pause','isConnected','error','asterisk','username','ami\x20disconnected','join','pick','keys','module','Reload','catch','message','command','Command','then','voiceQueues','name','answered','available','loggedIn','sumHoldTime','talking','total','type','unmanaged','abandoned','loggedInDb','outbound','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startProgressive','Trunk','active','callerid','Interval','channels','voicechannel','length','map','uniqueid','channel','filename','format','wav','MixMonitor','ai(mixmonitorid)','find','monitors','/var/spool/asterisk/monitor/','isNil','toLowerCase','YYYY-MM-DD\x20HH:mm:ss','rec','MixMonitor\x20Success','mixmonitorid','Channel\x20doesn\x27t\x20exist','Action','StopMixMonitor','destinationchannel','status','stop','%s.%s','StopMixMonitor\x20Success','values','queueChannels','voicequeuechannel','voicequeuechannelhangup','Hangup','voicequeuechannelredirect','Redirect','exten','telephones','trunks','outboundChannels','campaigns','run','event','faxAccounts','send','checkAfterSend','server','http','127.0.0.1','log','RPC\x20listening\x20on\x20port:','lodash','util','jayson/promise','validate','bluebird','moment','../../../config/environment','../properties','../ami'];(function(_0x461886,_0x4fc171){var _0x295e0a=function(_0x451524){while(--_0x451524){_0x461886['push'](_0x461886['shift']());}};_0x295e0a(++_0x4fc171);}(_0x6a7a,0x7d));var _0xa6a7=function(_0x342233,_0x4a66d9){_0x342233=_0x342233-0x0;var _0x50c1e6=_0x6a7a[_0x342233];return _0x50c1e6;};'use strict';var _=require(_0xa6a7('0x0'));var util=require(_0xa6a7('0x1'));var jayson=require(_0xa6a7('0x2'));var schema=require(_0xa6a7('0x3'));var BPromise=require(_0xa6a7('0x4'));var moment=require(_0xa6a7('0x5'));var config=require(_0xa6a7('0x6'));var properties=require(_0xa6a7('0x7'));var ami=require(_0xa6a7('0x8'));exports[_0xa6a7('0x9')]=function(_0xf662be,_0x2858cb,_0x5e7067){return new BPromise(function(_0x207c0b,_0x33beac){var _0x19a38f={'QueuePause':function(_0x564437){return new Promise(function(_0x107ad0,_0x4dcb17){var _0x1ff028=util['format'](_0xa6a7('0xa'),_0xa6a7('0xb'),_0x564437['name']);if(_0xf662be[_0xa6a7('0xc')]&&_0xf662be[_0xa6a7('0xc')][_0x1ff028]&&_0xf662be[_0xa6a7('0xc')][_0x1ff028][_0xa6a7('0xd')]){_0xf662be[_0xa6a7('0xc')][_0x1ff028]['updateAcw']();}if(_0xf662be[_0xa6a7('0xe')][_0x1ff028]){_0xf662be[_0xa6a7('0xe')][_0x1ff028][_0xa6a7('0xf')]({'statePause':_0x564437[_0xa6a7('0x10')]?!![]:![]});}_0x107ad0({'code':0xc8,'message':'QueuePause'});});},'Reload':function(_0x1ba212){var _0x7b79b1=this;return new Promise(function(_0x312b2a,_0x1f4491){if(ami[_0xa6a7('0x11')]()==![]){return _0x1f4491(_0x7b79b1[_0xa6a7('0x12')](0x1f4,[config[_0xa6a7('0x13')]['ip'],config[_0xa6a7('0x13')][_0xa6a7('0x14')],_0xa6a7('0x15')][_0xa6a7('0x16')]('\x20')));}_0x1ba212=_[_0xa6a7('0x17')](_0x1ba212,_[_0xa6a7('0x18')](properties[_0xa6a7('0x19')]));_0x1ba212['action']=_0xa6a7('0x1a');return ami['Action'](_0x1ba212)['then'](function(_0x47d9cb){_0x312b2a({'code':0xc8,'message':_0x47d9cb['message']});})[_0xa6a7('0x1b')](function(_0x527781){_0x1f4491(_0x7b79b1[_0xa6a7('0x12')](0x1f5,_0x527781[_0xa6a7('0x1c')]));});});},'Command':function(_0x3b3be2){var _0x21c088=this;return new Promise(function(_0x52079b,_0x56dd19){if(ami['isConnected']()==![]){return _0x56dd19(_0x21c088[_0xa6a7('0x12')](0x1f4,[config[_0xa6a7('0x13')]['ip'],config['asterisk'][_0xa6a7('0x14')],_0xa6a7('0x15')][_0xa6a7('0x16')]('\x20')));}_0x3b3be2=_[_0xa6a7('0x17')](_0x3b3be2,_0xa6a7('0x1d'));_0x3b3be2['action']=_0xa6a7('0x1e');return ami['Action'](_0x3b3be2)[_0xa6a7('0x1f')](function(_0x3770e7){_0x52079b({'code':0xc8,'message':_0x3770e7['content']});})[_0xa6a7('0x1b')](function(_0x5f35ab){_0x56dd19(_0x21c088[_0xa6a7('0x12')](0x1f5,_0x5f35ab['message']));});});},'VoiceQueues':function(_0x422c35){return new Promise(function(_0x119a1e,_0x10b4c1){var _0x49674b=[];for(var _0x413c54 in _0xf662be[_0xa6a7('0x20')]){if(_0xf662be[_0xa6a7('0x20')]['hasOwnProperty'](_0x413c54)){var _0x29e0f1=_0xf662be['voiceQueues'][_0x413c54];var _0x1d4bda={'id':_0x29e0f1['id'],'name':_0x29e0f1[_0xa6a7('0x21')],'strategy':_0x29e0f1['strategy'],'answered':_0x29e0f1[_0xa6a7('0x22')],'available':_0x29e0f1[_0xa6a7('0x23')],'loggedIn':_0x29e0f1[_0xa6a7('0x24')],'pTalking':_0x29e0f1['pTalking'],'sumBillable':_0x29e0f1['sumBillable'],'sumDuration':_0x29e0f1['sumDuration'],'sumHoldTime':_0x29e0f1[_0xa6a7('0x25')]||0x0,'talking':_0x29e0f1[_0xa6a7('0x26')],'total':_0x29e0f1[_0xa6a7('0x27')],'type':_0x29e0f1[_0xa6a7('0x28')],'unmanaged':_0x29e0f1[_0xa6a7('0x29')],'abandoned':_0x29e0f1[_0xa6a7('0x2a')],'waiting':_0x29e0f1['waiting'],'loggedInDb':_0x29e0f1[_0xa6a7('0x2b')]};if(_0x29e0f1['type']===_0xa6a7('0x2c')){_0x1d4bda['dialActive']=_0x29e0f1[_0xa6a7('0x2d')];_0x1d4bda[_0xa6a7('0x2e')]=_0x29e0f1['dialMethod'];_0x1d4bda[_0xa6a7('0x2f')]=_0x29e0f1[_0xa6a7('0x2f')];_0x1d4bda[_0xa6a7('0x30')]=_0x29e0f1[_0xa6a7('0x30')];_0x1d4bda[_0xa6a7('0x31')]=_0x29e0f1[_0xa6a7('0x31')];_0x1d4bda['dialPrefix']=_0x29e0f1[_0xa6a7('0x32')];_0x1d4bda['outboundAnswerAgiCallsDay']=_0x29e0f1[_0xa6a7('0x33')];_0x1d4bda[_0xa6a7('0x34')]=_0x29e0f1[_0xa6a7('0x34')];_0x1d4bda[_0xa6a7('0x35')]=_0x29e0f1[_0xa6a7('0x35')];_0x1d4bda[_0xa6a7('0x36')]=_0x29e0f1['outboundBusyCallsDay'];_0x1d4bda[_0xa6a7('0x37')]=_0x29e0f1[_0xa6a7('0x37')];_0x1d4bda[_0xa6a7('0x38')]=_0x29e0f1[_0xa6a7('0x38')];_0x1d4bda[_0xa6a7('0x39')]=_0x29e0f1[_0xa6a7('0x39')];_0x1d4bda['outboundDropCallsDayTimeout']=_0x29e0f1[_0xa6a7('0x3a')];_0x1d4bda[_0xa6a7('0x3b')]=_0x29e0f1['outboundNoAnswerCallsDay'];_0x1d4bda[_0xa6a7('0x3c')]=_0x29e0f1[_0xa6a7('0x3c')];_0x1d4bda['outboundOriginateFailureCallsDay']=_0x29e0f1[_0xa6a7('0x3d')];_0x1d4bda[_0xa6a7('0x3e')]=_0x29e0f1['outboundReCallsDay'];_0x1d4bda[_0xa6a7('0x3f')]=_0x29e0f1[_0xa6a7('0x3f')];_0x1d4bda['outboundUnknownCallsDay']=_0x29e0f1['outboundUnknownCallsDay'];_0x1d4bda['predictiveIntervalAnsweredCalls']=_0x29e0f1[_0xa6a7('0x40')];_0x1d4bda['predictiveIntervalAvgHoldtime']=_0x29e0f1[_0xa6a7('0x41')];_0x1d4bda[_0xa6a7('0x42')]=_0x29e0f1[_0xa6a7('0x42')];_0x1d4bda[_0xa6a7('0x43')]=_0x29e0f1[_0xa6a7('0x43')];_0x1d4bda[_0xa6a7('0x44')]=_0x29e0f1[_0xa6a7('0x44')];_0x1d4bda['predictiveIntervalErlangCalls']=_0x29e0f1['predictiveIntervalErlangCalls'];_0x1d4bda[_0xa6a7('0x45')]=_0x29e0f1[_0xa6a7('0x45')];_0x1d4bda['predictiveIntervalHitRate']=_0x29e0f1[_0xa6a7('0x46')];_0x1d4bda[_0xa6a7('0x47')]=_0x29e0f1['predictiveIntervalMultiplicativeFactor'];_0x1d4bda['predictiveIntervalPauses']=_0x29e0f1[_0xa6a7('0x48')];_0x1d4bda[_0xa6a7('0x49')]=_0x29e0f1[_0xa6a7('0x49')];_0x1d4bda['predictiveIntervalTotalCalls']=_0x29e0f1['predictiveIntervalTotalCalls'];_0x1d4bda[_0xa6a7('0x1c')]=_0x29e0f1[_0xa6a7('0x1c')];_0x1d4bda[_0xa6a7('0x4a')]=_0x29e0f1['originated'];_0x1d4bda['erlangCalls']=_0x29e0f1[_0xa6a7('0x4b')];_0x1d4bda['erlangCallToSecond']=_0x29e0f1[_0xa6a7('0x4c')];_0x1d4bda[_0xa6a7('0x4d')]=_0x29e0f1[_0xa6a7('0x4d')];_0x1d4bda['erlangBusyFactor']=_0x29e0f1[_0xa6a7('0x4e')];_0x1d4bda['startPredictive']=_0x29e0f1['startPredictive'];_0x1d4bda[_0xa6a7('0x4f')]=_0x29e0f1['startProgressive'];}if(_0x29e0f1[_0xa6a7('0x50')]){_0x1d4bda[_0xa6a7('0x50')]={'id':_0x29e0f1[_0xa6a7('0x50')]['id'],'name':_0x29e0f1['Trunk'][_0xa6a7('0x21')],'active':_0x29e0f1[_0xa6a7('0x50')][_0xa6a7('0x51')],'callerid':_0x29e0f1['Trunk'][_0xa6a7('0x52')]};}if(_0x29e0f1[_0xa6a7('0x53')]){_0x1d4bda[_0xa6a7('0x53')]={'id':_0x29e0f1[_0xa6a7('0x53')]['id'],'name':_0x29e0f1[_0xa6a7('0x53')][_0xa6a7('0x21')]};}_0x49674b['push'](_0x1d4bda);}}_0x119a1e({'count':_0x49674b['length'],'rows':_0x49674b});});},'VoiceChannels':function(_0x96f57d){return new Promise(function(_0x27b042,_0x132c01){var _0x5254fa=_['values'](_0xf662be[_0xa6a7('0x54')]);_0x27b042({'count':_0x5254fa['length'],'rows':_0x5254fa});});},'VoiceChannelMixMonitor':function(_0x4e534e){var _0x24a63e=this;return new Promise(function(_0x4be2b4,_0x199536){if(ami[_0xa6a7('0x11')]()==![]){return _0x199536(_0x24a63e[_0xa6a7('0x12')](0x1f4,[config[_0xa6a7('0x13')]['ip'],config[_0xa6a7('0x13')][_0xa6a7('0x14')],_0xa6a7('0x15')][_0xa6a7('0x16')]('\x20')));}var _0x2a9b58=schema(properties[_0xa6a7('0x55')])['validate'](_0x4e534e);if(_0x2a9b58[_0xa6a7('0x56')]>0x0){return _0x199536(_0x24a63e[_0xa6a7('0x12')](0x1f4,_[_0xa6a7('0x57')](_0x2a9b58,_0xa6a7('0x1c'))['join'](',\x20')));}var _0x4b07c5=_['find'](_0xf662be[_0xa6a7('0x54')],{'uniqueid':_0x4e534e[_0xa6a7('0x58')]});if(_0x4b07c5&&_0x4b07c5[_0xa6a7('0x59')]){var _0x258dcf=util['format']('%s.%s',_0x4e534e[_0xa6a7('0x5a')]||_0x4e534e[_0xa6a7('0x58')],_0x4e534e[_0xa6a7('0x5b')]||_0xa6a7('0x5c'));return ami['Action']({'action':_0xa6a7('0x5d'),'channel':_0x4b07c5[_0xa6a7('0x59')],'file':_0x258dcf,'options':_0xa6a7('0x5e')})[_0xa6a7('0x1f')](function(_0x3cda0c){var _0x274f06=_[_0xa6a7('0x5f')](_0x4b07c5[_0xa6a7('0x60')],{'filename':_0xa6a7('0x61')+_0x258dcf['toLowerCase']()});if(_[_0xa6a7('0x62')](_0x274f06)){_0x4b07c5[_0xa6a7('0x60')]['push']({'filename':'/var/spool/asterisk/monitor/'+_0x258dcf[_0xa6a7('0x63')](),'createdAt':moment()['format'](_0xa6a7('0x64')),'mixmonitorid':_0x3cda0c['mixmonitorid'],'status':_0xa6a7('0x65')});}else{_0x274f06['mixmonitorid']=_0x3cda0c['mixmonitorid'];_0x274f06['status']='rec';}_0x4be2b4({'code':0xc8,'message':[_0x4e534e[_0xa6a7('0x58')],_0xa6a7('0x66'),_0x3cda0c['mixmonitorid']][_0xa6a7('0x16')]('\x20'),'mixmonitorid':_0x3cda0c[_0xa6a7('0x67')]});})[_0xa6a7('0x1b')](function(_0xdf62cb){_0x199536(_0x24a63e[_0xa6a7('0x12')](0x1f5,[_0x4e534e[_0xa6a7('0x58')],_0xdf62cb[_0xa6a7('0x1c')][_0xa6a7('0x63')]()][_0xa6a7('0x16')]('\x20')));});}else{return _0x199536(_0x24a63e['error'](0x1f5,_0xa6a7('0x68')));}});},'VoiceChannelStopMixMonitor':function(_0x5cdf36){var _0x1ceb8f=this;return new Promise(function(_0x3572b6,_0x578a90){if(ami[_0xa6a7('0x11')]()==![]){return _0x578a90(_0x1ceb8f[_0xa6a7('0x12')](0x1f4,[config[_0xa6a7('0x13')]['ip'],config[_0xa6a7('0x13')][_0xa6a7('0x14')],'ami\x20disconnected'][_0xa6a7('0x16')]('\x20')));}var _0x56efd0=schema(properties[_0xa6a7('0x55')])[_0xa6a7('0x3')](_0x5cdf36);if(_0x56efd0[_0xa6a7('0x56')]>0x0){return _0x578a90(_0x1ceb8f['error'](0x1f4,_['map'](_0x56efd0,_0xa6a7('0x1c'))['join'](',\x20')));}var _0x2101c3=_[_0xa6a7('0x5f')](_0xf662be[_0xa6a7('0x54')],{'uniqueid':_0x5cdf36[_0xa6a7('0x58')]});if(_0x2101c3){return BPromise['resolve']()[_0xa6a7('0x1f')](function(){if(_0x2101c3[_0xa6a7('0x59')]){return ami[_0xa6a7('0x69')]({'action':_0xa6a7('0x6a'),'channel':_0x2101c3[_0xa6a7('0x59')],'mixmonitorid':_0x5cdf36['mixmonitorid']})[_0xa6a7('0x1b')](function(_0x1edf6e){});}})[_0xa6a7('0x1f')](function(){if(_0x2101c3['destinationchannel']){return ami[_0xa6a7('0x69')]({'action':_0xa6a7('0x6a'),'channel':_0x2101c3[_0xa6a7('0x6b')],'mixmonitorid':_0x5cdf36[_0xa6a7('0x67')]})[_0xa6a7('0x1b')](function(_0x41950d){});}})[_0xa6a7('0x1f')](function(_0x485555){var _0x24e456=_['find'](_0x2101c3['monitors'],{'mixmonitorid':_0x5cdf36[_0xa6a7('0x67')]});if(_0x24e456){_0x24e456[_0xa6a7('0x6c')]=_0xa6a7('0x6d');}})[_0xa6a7('0x1f')](function(){var _0x3a9dcc=util[_0xa6a7('0x5b')](_0xa6a7('0x6e'),_0x5cdf36['filename']||_0x5cdf36[_0xa6a7('0x58')],_0x5cdf36[_0xa6a7('0x5b')]||_0xa6a7('0x5c'));var _0x375417=_[_0xa6a7('0x5f')](_0x2101c3[_0xa6a7('0x60')],{'filename':'/var/spool/asterisk/monitor/'+_0x3a9dcc[_0xa6a7('0x63')]()});if(_0x375417){_0x375417[_0xa6a7('0x6c')]=_0xa6a7('0x6d');}})['then'](function(){_0x3572b6({'code':0xc8,'message':[_0x5cdf36[_0xa6a7('0x58')],_0xa6a7('0x6f')][_0xa6a7('0x16')]('\x20')});})[_0xa6a7('0x1b')](function(_0x310387){_0x578a90(_0x1ceb8f[_0xa6a7('0x12')](0x1f5,[_0x5cdf36[_0xa6a7('0x58')],_0x310387['message'][_0xa6a7('0x63')]()]['join']('\x20')));});}else{return _0x578a90(_0x1ceb8f[_0xa6a7('0x12')](0x1f5,_0xa6a7('0x68')));}});},'VoiceQueuesChannels':function(_0x345fd8){return new Promise(function(_0x15f4ee,_0x26b868){var _0x1562b1=_[_0xa6a7('0x70')](_0xf662be[_0xa6a7('0x71')]);_0x15f4ee({'count':_0x1562b1[_0xa6a7('0x56')],'rows':_0x1562b1});});},'VoiceQueuesChannel':function(_0x4436f7){var _0xb07ef5=this;return new Promise(function(_0x5b9d8d,_0x3e0036){var _0x364a7d=schema(properties[_0xa6a7('0x72')])['validate'](_0x4436f7);if(_0x364a7d[_0xa6a7('0x56')]>0x0){return _0x3e0036(_0xb07ef5['error'](0x1f4,_[_0xa6a7('0x57')](_0x364a7d,_0xa6a7('0x1c'))[_0xa6a7('0x16')](',\x20')));}var _0x599376=_['find'](_0xf662be[_0xa6a7('0x71')],{'uniqueid':_0x4436f7['uniqueid']});if(_0x599376){_0x5b9d8d(_0x599376);}else{return _0x3e0036(_0xb07ef5['error'](0x1f5,_0xa6a7('0x68')));}});},'VoiceQueuesChannelHangup':function(_0x122ce2){var _0x24263e=this;return new Promise(function(_0x17218e,_0x385a69){if(ami['isConnected']()==![]){return _0x385a69(_0x24263e[_0xa6a7('0x12')](0x1f4,[config[_0xa6a7('0x13')]['ip'],config[_0xa6a7('0x13')][_0xa6a7('0x14')],'ami\x20disconnected'][_0xa6a7('0x16')]('\x20')));}var _0x3684aa=schema(properties[_0xa6a7('0x73')])[_0xa6a7('0x3')](_0x122ce2);if(_0x3684aa[_0xa6a7('0x56')]>0x0){return _0x385a69(_0x24263e[_0xa6a7('0x12')](0x1f4,_['map'](_0x3684aa,_0xa6a7('0x1c'))[_0xa6a7('0x16')](',\x20')));}var _0x40b17e=_['find'](_0xf662be['queueChannels'],{'uniqueid':_0x122ce2['uniqueid']});if(_0x40b17e&&_0x40b17e[_0xa6a7('0x59')]){return ami[_0xa6a7('0x69')]({'action':_0xa6a7('0x74'),'channel':_0x40b17e[_0xa6a7('0x59')]})[_0xa6a7('0x1f')](function(_0x4c036b){_0x17218e({'code':0xc8,'message':[_0x122ce2[_0xa6a7('0x58')],_0x4c036b[_0xa6a7('0x1c')][_0xa6a7('0x63')]()]['join']('\x20')});})[_0xa6a7('0x1b')](function(_0x16137f){_0x385a69(_0x24263e[_0xa6a7('0x12')](0x1f5,[_0x122ce2[_0xa6a7('0x58')],_0x16137f[_0xa6a7('0x1c')][_0xa6a7('0x63')]()][_0xa6a7('0x16')]('\x20')));});}else{return _0x385a69(_0x24263e[_0xa6a7('0x12')](0x1f5,_0xa6a7('0x68')));}});},'VoiceQueuesChannelRedirect':function(_0x57d8c5){var _0x461c7b=this;return new Promise(function(_0xce87aa,_0xa2048a){if(ami['isConnected']()==![]){return _0xa2048a(_0x461c7b[_0xa6a7('0x12')](0x1f4,[config[_0xa6a7('0x13')]['ip'],config[_0xa6a7('0x13')][_0xa6a7('0x14')],_0xa6a7('0x15')][_0xa6a7('0x16')]('\x20')));}var _0x171896=schema(properties[_0xa6a7('0x75')])['validate'](_0x57d8c5);if(_0x171896[_0xa6a7('0x56')]>0x0){return _0xa2048a(_0x461c7b['error'](0x1f4,_[_0xa6a7('0x57')](_0x171896,_0xa6a7('0x1c'))[_0xa6a7('0x16')](',\x20')));}var _0x197734=_[_0xa6a7('0x5f')](_0xf662be['queueChannels'],{'uniqueid':_0x57d8c5['uniqueid']});if(_0x197734&&_0x197734[_0xa6a7('0x59')]){return ami[_0xa6a7('0x69')]({'action':_0xa6a7('0x76'),'channel':_0x197734[_0xa6a7('0x59')],'exten':_0x57d8c5[_0xa6a7('0x77')],'context':_0x57d8c5['context']||_0x197734['context'],'priority':0x1})[_0xa6a7('0x1f')](function(_0x5d15f9){_0xce87aa({'code':0xc8,'message':[_0x57d8c5['uniqueid'],_0x5d15f9[_0xa6a7('0x1c')][_0xa6a7('0x63')]()]['join']('\x20')});})[_0xa6a7('0x1b')](function(_0x7d57aa){_0xa2048a(_0x461c7b['error'](0x1f5,[_0x57d8c5[_0xa6a7('0x58')],_0x7d57aa[_0xa6a7('0x1c')][_0xa6a7('0x63')]()][_0xa6a7('0x16')]('\x20')));});}else{return _0xa2048a(_0x461c7b[_0xa6a7('0x12')](0x1f5,_0xa6a7('0x68')));}});},'Agents':function(_0x55c3e5){return new Promise(function(_0x4ecd07,_0x4635c6){var _0x158955=_[_0xa6a7('0x70')](_0xf662be[_0xa6a7('0xe')]);_0x4ecd07({'count':_0x158955[_0xa6a7('0x56')],'rows':_0x158955});});},'Telephones':function(_0x34f1b3){return new Promise(function(_0x5ce50e,_0x565739){var _0xf0e1b0=_[_0xa6a7('0x70')](_0xf662be[_0xa6a7('0x78')]);_0x5ce50e({'count':_0xf0e1b0[_0xa6a7('0x56')],'rows':_0xf0e1b0});});},'Trunks':function(_0x4137c8){return new Promise(function(_0x49c6c9,_0x3a6765){var _0x1e0817=_[_0xa6a7('0x70')](_0xf662be[_0xa6a7('0x79')]);_0x49c6c9({'count':_0x1e0817['length'],'rows':_0x1e0817});});},'OutboundChannels':function(_0xff1817){return new Promise(function(_0x829516,_0x3d78b8){var _0x23cdb3=_['values'](_0xf662be[_0xa6a7('0x7a')]);_0x829516({'count':_0x23cdb3[_0xa6a7('0x56')],'rows':_0x23cdb3});});},'Outbound':function(_0x2fce14){return new Promise(function(_0x3294c5,_0x592597){_0x3294c5(_0xf662be[_0xa6a7('0x2c')]);});},'Campaigns':function(_0x2f857b){return new Promise(function(_0x30f04f,_0x447531){var _0x46be0c=_['values'](_0xf662be[_0xa6a7('0x7b')]);_0x30f04f({'count':_0x46be0c[_0xa6a7('0x56')],'rows':_0x46be0c});});},'VoiceQueuesPreview':function(_0x4eb2a7){var _0x403b2e=this;return new Promise(function(_0x226ace,_0x543bbb){_0x2858cb[_0xa6a7('0x7c')](_0x4eb2a7['id'])['then'](function(_0x52f994){_0x226ace({'code':0xc8,'message':_0x52f994['message']});})['catch'](function(_0x1f77cf){_0x543bbb(_0x403b2e[_0xa6a7('0x12')](0x1f4,_0x1f77cf['message']));});});},'EventManager':function(_0xfc68be){var _0x38a444=this;return new Promise(function(_0x378487,_0x5a06df){if(!_0xfc68be[_0xa6a7('0x7d')]){return _0x5a06df(_0x38a444[_0xa6a7('0x12')](0x1f4,'Event\x20name\x20mandatory'));}ami['emit']('custom:'+_0xfc68be['event'],_0xfc68be['message']);_0x378487({'code':0xc8,'message':_0xfc68be});});},'FaxAccounts':function(_0x530246){return new Promise(function(_0x403a3e,_0x1d6519){var _0x1365b0=_[_0xa6a7('0x70')](_0xf662be[_0xa6a7('0x7e')]);_0x403a3e({'count':_0x1365b0['length'],'rows':_0x1365b0});});},'SendFax':function(_0x2fb543){var _0xfadfa9=this;return new Promise(function(_0x4a308c,_0x2432c2){_0x5e7067[_0xa6a7('0x7f')](_0x2fb543)[_0xa6a7('0x1f')](function(_0x4ecc7f){_0x4a308c({'code':0xc8,'message':_0x4ecc7f['message']});})[_0xa6a7('0x1b')](function(_0x4154af){_0x2432c2(_0xfadfa9['error'](0x1f4,_0x4154af['message']));});});},'CheckAfterSend':function(_0x56da0c){var _0x20b4dc=this;return new Promise(function(_0x4afcfa,_0x4ab70f){_0x5e7067[_0xa6a7('0x80')](_0x56da0c)[_0xa6a7('0x1f')](function(_0x2ae4db){_0x4afcfa({'code':0xc8,'message':_0x2ae4db[_0xa6a7('0x1c')]});})[_0xa6a7('0x1b')](function(_0x35e587){_0x4ab70f(_0x20b4dc[_0xa6a7('0x12')](0x1f4,_0x35e587[_0xa6a7('0x1c')]));});});}};var _0x385447=jayson[_0xa6a7('0x81')](_0x19a38f)[_0xa6a7('0x82')]();_0x385447['on']('error',function(_0x443358){return _0x33beac(_0x443358);});_0x385447['listen'](0x232a,_0xa6a7('0x83'),function(){console[_0xa6a7('0x84')]('AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!',0x232a);return _0x207c0b(_0xa6a7('0x85')+0x232a);});});};
\ No newline at end of file
+var _0xa45c=['name','timers','updateAcw','agents','updateStatusRealtime','pause','QueuePause','error','asterisk','username','ami\x20disconnected','join','keys','module','action','Reload','Action','then','message','catch','isConnected','pick','command','Command','voiceQueues','strategy','available','pTalking','sumHoldTime','type','unmanaged','loggedInDb','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startProgressive','Trunk','active','Interval','push','length','values','channels','voicechannel','map','uniqueid','channel','%s.%s','filename','wav','MixMonitor','ai(mixmonitorid)','find','monitors','toLowerCase','isNil','/var/spool/asterisk/monitor/','YYYY-MM-DD\x20HH:mm:ss','rec','mixmonitorid','status','MixMonitor\x20Success','validate','resolve','StopMixMonitor','destinationchannel','format','stop','StopMixMonitor\x20Success','Channel\x20doesn\x27t\x20exist','voicequeuechannel','queueChannels','voicequeuechannelhangup','Hangup','exten','context','telephones','trunks','outbound','campaigns','run','event','Event\x20name\x20mandatory','emit','custom:','faxAccounts','send','server','http','127.0.0.1','AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','lodash','jayson/promise','moment','../../../config/environment','../properties','../ami','listen','%s/%s','SIP'];(function(_0x1858ea,_0x366f85){var _0x1c3ec2=function(_0x597b94){while(--_0x597b94){_0x1858ea['push'](_0x1858ea['shift']());}};_0x1c3ec2(++_0x366f85);}(_0xa45c,0x186));var _0xca45=function(_0x2114b2,_0x5b2411){_0x2114b2=_0x2114b2-0x0;var _0x1ea271=_0xa45c[_0x2114b2];return _0x1ea271;};'use strict';var _=require(_0xca45('0x0'));var util=require('util');var jayson=require(_0xca45('0x1'));var schema=require('validate');var BPromise=require('bluebird');var moment=require(_0xca45('0x2'));var config=require(_0xca45('0x3'));var properties=require(_0xca45('0x4'));var ami=require(_0xca45('0x5'));exports[_0xca45('0x6')]=function(_0x1b3c11,_0x25cf7c,_0x21371c){return new BPromise(function(_0x5c90ef,_0x509a41){var _0x2522f0={'QueuePause':function(_0x10bcd2){return new Promise(function(_0x438a08,_0x25f204){var _0x1d8c9c=util['format'](_0xca45('0x7'),_0xca45('0x8'),_0x10bcd2[_0xca45('0x9')]);if(_0x1b3c11[_0xca45('0xa')]&&_0x1b3c11[_0xca45('0xa')][_0x1d8c9c]&&_0x1b3c11[_0xca45('0xa')][_0x1d8c9c]['timer']){_0x1b3c11['timers'][_0x1d8c9c][_0xca45('0xb')]();}if(_0x1b3c11[_0xca45('0xc')][_0x1d8c9c]){_0x1b3c11[_0xca45('0xc')][_0x1d8c9c][_0xca45('0xd')]({'statePause':_0x10bcd2[_0xca45('0xe')]?!![]:![]});}_0x438a08({'code':0xc8,'message':_0xca45('0xf')});});},'Reload':function(_0x1149ef){var _0x2e659c=this;return new Promise(function(_0x1102b3,_0x232bf1){if(ami['isConnected']()==![]){return _0x232bf1(_0x2e659c[_0xca45('0x10')](0x1f4,[config[_0xca45('0x11')]['ip'],config[_0xca45('0x11')][_0xca45('0x12')],_0xca45('0x13')][_0xca45('0x14')]('\x20')));}_0x1149ef=_['pick'](_0x1149ef,_[_0xca45('0x15')](properties[_0xca45('0x16')]));_0x1149ef[_0xca45('0x17')]=_0xca45('0x18');return ami[_0xca45('0x19')](_0x1149ef)[_0xca45('0x1a')](function(_0x41b603){_0x1102b3({'code':0xc8,'message':_0x41b603[_0xca45('0x1b')]});})[_0xca45('0x1c')](function(_0xaff388){_0x232bf1(_0x2e659c['error'](0x1f5,_0xaff388[_0xca45('0x1b')]));});});},'Command':function(_0x1dab19){var _0x505419=this;return new Promise(function(_0x659fc7,_0x33e717){if(ami[_0xca45('0x1d')]()==![]){return _0x33e717(_0x505419[_0xca45('0x10')](0x1f4,[config[_0xca45('0x11')]['ip'],config[_0xca45('0x11')][_0xca45('0x12')],_0xca45('0x13')]['join']('\x20')));}_0x1dab19=_[_0xca45('0x1e')](_0x1dab19,_0xca45('0x1f'));_0x1dab19[_0xca45('0x17')]=_0xca45('0x20');return ami['Action'](_0x1dab19)['then'](function(_0x3809c6){_0x659fc7({'code':0xc8,'message':_0x3809c6['content']});})[_0xca45('0x1c')](function(_0x32ffb8){_0x33e717(_0x505419[_0xca45('0x10')](0x1f5,_0x32ffb8[_0xca45('0x1b')]));});});},'VoiceQueues':function(_0x5331e3){return new Promise(function(_0x38213d,_0x4cdd21){var _0x29de09=[];for(var _0x228f4e in _0x1b3c11['voiceQueues']){if(_0x1b3c11['voiceQueues']['hasOwnProperty'](_0x228f4e)){var _0x5355fd=_0x1b3c11[_0xca45('0x21')][_0x228f4e];var _0x2cc444={'id':_0x5355fd['id'],'name':_0x5355fd[_0xca45('0x9')],'strategy':_0x5355fd[_0xca45('0x22')],'answered':_0x5355fd['answered'],'available':_0x5355fd[_0xca45('0x23')],'loggedIn':_0x5355fd['loggedIn'],'pTalking':_0x5355fd[_0xca45('0x24')],'sumBillable':_0x5355fd['sumBillable'],'sumDuration':_0x5355fd['sumDuration'],'sumHoldTime':_0x5355fd[_0xca45('0x25')]||0x0,'talking':_0x5355fd['talking'],'total':_0x5355fd['total'],'type':_0x5355fd[_0xca45('0x26')],'unmanaged':_0x5355fd[_0xca45('0x27')],'abandoned':_0x5355fd['abandoned'],'waiting':_0x5355fd['waiting'],'loggedInDb':_0x5355fd[_0xca45('0x28')]};if(_0x5355fd[_0xca45('0x26')]==='outbound'){_0x2cc444[_0xca45('0x29')]=_0x5355fd[_0xca45('0x29')];_0x2cc444[_0xca45('0x2a')]=_0x5355fd['dialMethod'];_0x2cc444[_0xca45('0x2b')]=_0x5355fd[_0xca45('0x2b')];_0x2cc444[_0xca45('0x2c')]=_0x5355fd[_0xca45('0x2c')];_0x2cc444[_0xca45('0x2d')]=_0x5355fd[_0xca45('0x2d')];_0x2cc444[_0xca45('0x2e')]=_0x5355fd[_0xca45('0x2e')];_0x2cc444[_0xca45('0x2f')]=_0x5355fd[_0xca45('0x2f')];_0x2cc444[_0xca45('0x30')]=_0x5355fd['outboundAnswerCallsDay'];_0x2cc444['outboundBlacklistCallsDay']=_0x5355fd['outboundBlacklistCallsDay'];_0x2cc444[_0xca45('0x31')]=_0x5355fd['outboundBusyCallsDay'];_0x2cc444[_0xca45('0x32')]=_0x5355fd['outboundCongestionCallsDay'];_0x2cc444['outboundDropCallsDayACS']=_0x5355fd['outboundDropCallsDayACS'];_0x2cc444[_0xca45('0x33')]=_0x5355fd[_0xca45('0x33')];_0x2cc444['outboundDropCallsDayTimeout']=_0x5355fd[_0xca45('0x34')];_0x2cc444['outboundNoAnswerCallsDay']=_0x5355fd[_0xca45('0x35')];_0x2cc444[_0xca45('0x36')]=_0x5355fd[_0xca45('0x36')];_0x2cc444[_0xca45('0x37')]=_0x5355fd[_0xca45('0x37')];_0x2cc444[_0xca45('0x38')]=_0x5355fd['outboundReCallsDay'];_0x2cc444['outboundRejectCallsDay']=_0x5355fd[_0xca45('0x39')];_0x2cc444['outboundUnknownCallsDay']=_0x5355fd[_0xca45('0x3a')];_0x2cc444[_0xca45('0x3b')]=_0x5355fd[_0xca45('0x3b')];_0x2cc444[_0xca45('0x3c')]=_0x5355fd[_0xca45('0x3c')];_0x2cc444[_0xca45('0x3d')]=_0x5355fd[_0xca45('0x3d')];_0x2cc444['predictiveIntervalDroppedCallsCallersExit']=_0x5355fd[_0xca45('0x3e')];_0x2cc444['predictiveIntervalDroppedCallsTimeout']=_0x5355fd[_0xca45('0x3f')];_0x2cc444[_0xca45('0x40')]=_0x5355fd[_0xca45('0x40')];_0x2cc444['predictiveIntervalErlangCallsDroppedCalls']=_0x5355fd[_0xca45('0x41')];_0x2cc444[_0xca45('0x42')]=_0x5355fd['predictiveIntervalHitRate'];_0x2cc444[_0xca45('0x43')]=_0x5355fd[_0xca45('0x43')];_0x2cc444[_0xca45('0x44')]=_0x5355fd[_0xca45('0x44')];_0x2cc444[_0xca45('0x45')]=_0x5355fd[_0xca45('0x45')];_0x2cc444[_0xca45('0x46')]=_0x5355fd[_0xca45('0x46')];_0x2cc444[_0xca45('0x1b')]=_0x5355fd[_0xca45('0x1b')];_0x2cc444[_0xca45('0x47')]=_0x5355fd[_0xca45('0x47')];_0x2cc444[_0xca45('0x48')]=_0x5355fd[_0xca45('0x48')];_0x2cc444[_0xca45('0x49')]=_0x5355fd[_0xca45('0x49')];_0x2cc444[_0xca45('0x4a')]=_0x5355fd['erlangAbandonmentRate'];_0x2cc444[_0xca45('0x4b')]=_0x5355fd[_0xca45('0x4b')];_0x2cc444['startPredictive']=_0x5355fd['startPredictive'];_0x2cc444[_0xca45('0x4c')]=_0x5355fd[_0xca45('0x4c')];}if(_0x5355fd[_0xca45('0x4d')]){_0x2cc444[_0xca45('0x4d')]={'id':_0x5355fd[_0xca45('0x4d')]['id'],'name':_0x5355fd['Trunk'][_0xca45('0x9')],'active':_0x5355fd['Trunk'][_0xca45('0x4e')],'callerid':_0x5355fd[_0xca45('0x4d')]['callerid']};}if(_0x5355fd['Interval']){_0x2cc444[_0xca45('0x4f')]={'id':_0x5355fd[_0xca45('0x4f')]['id'],'name':_0x5355fd[_0xca45('0x4f')][_0xca45('0x9')]};}_0x29de09[_0xca45('0x50')](_0x2cc444);}}_0x38213d({'count':_0x29de09[_0xca45('0x51')],'rows':_0x29de09});});},'VoiceChannels':function(_0x2c41c4){return new Promise(function(_0x17a572,_0x3a316b){var _0x5837fc=_[_0xca45('0x52')](_0x1b3c11[_0xca45('0x53')]);_0x17a572({'count':_0x5837fc[_0xca45('0x51')],'rows':_0x5837fc});});},'VoiceChannelMixMonitor':function(_0x3cad22){var _0x44e5b7=this;return new Promise(function(_0x979f3d,_0x6e03f3){if(ami['isConnected']()==![]){return _0x6e03f3(_0x44e5b7[_0xca45('0x10')](0x1f4,[config['asterisk']['ip'],config[_0xca45('0x11')][_0xca45('0x12')],_0xca45('0x13')][_0xca45('0x14')]('\x20')));}var _0x1cb6b9=schema(properties[_0xca45('0x54')])['validate'](_0x3cad22);if(_0x1cb6b9[_0xca45('0x51')]>0x0){return _0x6e03f3(_0x44e5b7['error'](0x1f4,_[_0xca45('0x55')](_0x1cb6b9,'message')[_0xca45('0x14')](',\x20')));}var _0xf571be=_['find'](_0x1b3c11[_0xca45('0x53')],{'uniqueid':_0x3cad22[_0xca45('0x56')]});if(_0xf571be&&_0xf571be[_0xca45('0x57')]){var _0x2e6c67=util['format'](_0xca45('0x58'),_0x3cad22[_0xca45('0x59')]||_0x3cad22[_0xca45('0x56')],_0x3cad22['format']||_0xca45('0x5a'));return ami[_0xca45('0x19')]({'action':_0xca45('0x5b'),'channel':_0xf571be[_0xca45('0x57')],'file':_0x2e6c67,'options':_0xca45('0x5c')})[_0xca45('0x1a')](function(_0x301fc1){var _0x60ea40=_[_0xca45('0x5d')](_0xf571be[_0xca45('0x5e')],{'filename':'/var/spool/asterisk/monitor/'+_0x2e6c67[_0xca45('0x5f')]()});if(_[_0xca45('0x60')](_0x60ea40)){_0xf571be[_0xca45('0x5e')][_0xca45('0x50')]({'filename':_0xca45('0x61')+_0x2e6c67[_0xca45('0x5f')](),'createdAt':moment()['format'](_0xca45('0x62')),'mixmonitorid':_0x301fc1['mixmonitorid'],'status':_0xca45('0x63')});}else{_0x60ea40['mixmonitorid']=_0x301fc1[_0xca45('0x64')];_0x60ea40[_0xca45('0x65')]=_0xca45('0x63');}_0x979f3d({'code':0xc8,'message':[_0x3cad22[_0xca45('0x56')],_0xca45('0x66'),_0x301fc1['mixmonitorid']][_0xca45('0x14')]('\x20'),'mixmonitorid':_0x301fc1[_0xca45('0x64')]});})[_0xca45('0x1c')](function(_0x25c5ec){_0x6e03f3(_0x44e5b7[_0xca45('0x10')](0x1f5,[_0x3cad22[_0xca45('0x56')],_0x25c5ec['message'][_0xca45('0x5f')]()][_0xca45('0x14')]('\x20')));});}else{return _0x6e03f3(_0x44e5b7[_0xca45('0x10')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceChannelStopMixMonitor':function(_0x4292f9){var _0x4a85c2=this;return new Promise(function(_0x2df44c,_0x7a86b2){if(ami['isConnected']()==![]){return _0x7a86b2(_0x4a85c2['error'](0x1f4,[config[_0xca45('0x11')]['ip'],config['asterisk'][_0xca45('0x12')],_0xca45('0x13')][_0xca45('0x14')]('\x20')));}var _0x13ccb7=schema(properties[_0xca45('0x54')])[_0xca45('0x67')](_0x4292f9);if(_0x13ccb7[_0xca45('0x51')]>0x0){return _0x7a86b2(_0x4a85c2[_0xca45('0x10')](0x1f4,_[_0xca45('0x55')](_0x13ccb7,_0xca45('0x1b'))[_0xca45('0x14')](',\x20')));}var _0x56d6ed=_[_0xca45('0x5d')](_0x1b3c11[_0xca45('0x53')],{'uniqueid':_0x4292f9[_0xca45('0x56')]});if(_0x56d6ed){return BPromise[_0xca45('0x68')]()[_0xca45('0x1a')](function(){if(_0x56d6ed[_0xca45('0x57')]){return ami['Action']({'action':_0xca45('0x69'),'channel':_0x56d6ed[_0xca45('0x57')],'mixmonitorid':_0x4292f9[_0xca45('0x64')]})[_0xca45('0x1c')](function(_0x48ac20){});}})[_0xca45('0x1a')](function(){if(_0x56d6ed[_0xca45('0x6a')]){return ami[_0xca45('0x19')]({'action':_0xca45('0x69'),'channel':_0x56d6ed[_0xca45('0x6a')],'mixmonitorid':_0x4292f9['mixmonitorid']})['catch'](function(_0x15f578){});}})[_0xca45('0x1a')](function(_0x30cb9a){var _0x7d1205=_['find'](_0x56d6ed[_0xca45('0x5e')],{'mixmonitorid':_0x4292f9['mixmonitorid']});if(_0x7d1205){_0x7d1205['status']='stop';}})[_0xca45('0x1a')](function(){var _0x2c9f9d=util[_0xca45('0x6b')]('%s.%s',_0x4292f9[_0xca45('0x59')]||_0x4292f9[_0xca45('0x56')],_0x4292f9[_0xca45('0x6b')]||_0xca45('0x5a'));var _0x334f43=_[_0xca45('0x5d')](_0x56d6ed[_0xca45('0x5e')],{'filename':_0xca45('0x61')+_0x2c9f9d['toLowerCase']()});if(_0x334f43){_0x334f43[_0xca45('0x65')]=_0xca45('0x6c');}})[_0xca45('0x1a')](function(){_0x2df44c({'code':0xc8,'message':[_0x4292f9[_0xca45('0x56')],_0xca45('0x6d')][_0xca45('0x14')]('\x20')});})[_0xca45('0x1c')](function(_0x5d2d92){_0x7a86b2(_0x4a85c2['error'](0x1f5,[_0x4292f9[_0xca45('0x56')],_0x5d2d92['message'][_0xca45('0x5f')]()][_0xca45('0x14')]('\x20')));});}else{return _0x7a86b2(_0x4a85c2[_0xca45('0x10')](0x1f5,_0xca45('0x6e')));}});},'VoiceQueuesChannels':function(_0x4e877c){return new Promise(function(_0x38d145,_0x360ce7){var _0x1404ba=_['values'](_0x1b3c11['queueChannels']);_0x38d145({'count':_0x1404ba[_0xca45('0x51')],'rows':_0x1404ba});});},'VoiceQueuesChannel':function(_0x48d236){var _0x2f2911=this;return new Promise(function(_0x594d6f,_0x269d12){var _0x3c30d0=schema(properties[_0xca45('0x6f')])['validate'](_0x48d236);if(_0x3c30d0[_0xca45('0x51')]>0x0){return _0x269d12(_0x2f2911[_0xca45('0x10')](0x1f4,_[_0xca45('0x55')](_0x3c30d0,'message')[_0xca45('0x14')](',\x20')));}var _0x4a4409=_['find'](_0x1b3c11[_0xca45('0x70')],{'uniqueid':_0x48d236['uniqueid']});if(_0x4a4409){_0x594d6f(_0x4a4409);}else{return _0x269d12(_0x2f2911['error'](0x1f5,_0xca45('0x6e')));}});},'VoiceQueuesChannelHangup':function(_0x5fa099){var _0x11c2f9=this;return new Promise(function(_0x168f9e,_0x467222){if(ami[_0xca45('0x1d')]()==![]){return _0x467222(_0x11c2f9['error'](0x1f4,[config['asterisk']['ip'],config[_0xca45('0x11')][_0xca45('0x12')],_0xca45('0x13')]['join']('\x20')));}var _0x42cc44=schema(properties[_0xca45('0x71')])['validate'](_0x5fa099);if(_0x42cc44['length']>0x0){return _0x467222(_0x11c2f9[_0xca45('0x10')](0x1f4,_[_0xca45('0x55')](_0x42cc44,_0xca45('0x1b'))[_0xca45('0x14')](',\x20')));}var _0xd433e7=_[_0xca45('0x5d')](_0x1b3c11[_0xca45('0x70')],{'uniqueid':_0x5fa099[_0xca45('0x56')]});if(_0xd433e7&&_0xd433e7[_0xca45('0x57')]){return ami[_0xca45('0x19')]({'action':_0xca45('0x72'),'channel':_0xd433e7[_0xca45('0x57')]})['then'](function(_0x289edb){_0x168f9e({'code':0xc8,'message':[_0x5fa099[_0xca45('0x56')],_0x289edb[_0xca45('0x1b')][_0xca45('0x5f')]()]['join']('\x20')});})[_0xca45('0x1c')](function(_0x43fcd6){_0x467222(_0x11c2f9['error'](0x1f5,[_0x5fa099[_0xca45('0x56')],_0x43fcd6[_0xca45('0x1b')][_0xca45('0x5f')]()][_0xca45('0x14')]('\x20')));});}else{return _0x467222(_0x11c2f9[_0xca45('0x10')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceQueuesChannelRedirect':function(_0x2b04b2){var _0x448564=this;return new Promise(function(_0x1c2d61,_0x20338f){if(ami[_0xca45('0x1d')]()==![]){return _0x20338f(_0x448564[_0xca45('0x10')](0x1f4,[config[_0xca45('0x11')]['ip'],config[_0xca45('0x11')][_0xca45('0x12')],_0xca45('0x13')][_0xca45('0x14')]('\x20')));}var _0x502ee0=schema(properties['voicequeuechannelredirect'])['validate'](_0x2b04b2);if(_0x502ee0[_0xca45('0x51')]>0x0){return _0x20338f(_0x448564[_0xca45('0x10')](0x1f4,_[_0xca45('0x55')](_0x502ee0,'message')[_0xca45('0x14')](',\x20')));}var _0x440e0f=_[_0xca45('0x5d')](_0x1b3c11[_0xca45('0x70')],{'uniqueid':_0x2b04b2[_0xca45('0x56')]});if(_0x440e0f&&_0x440e0f[_0xca45('0x57')]){return ami['Action']({'action':'Redirect','channel':_0x440e0f[_0xca45('0x57')],'exten':_0x2b04b2[_0xca45('0x73')],'context':_0x2b04b2[_0xca45('0x74')]||_0x440e0f[_0xca45('0x74')],'priority':0x1})[_0xca45('0x1a')](function(_0x37ae80){_0x1c2d61({'code':0xc8,'message':[_0x2b04b2['uniqueid'],_0x37ae80[_0xca45('0x1b')]['toLowerCase']()][_0xca45('0x14')]('\x20')});})['catch'](function(_0x45b0c1){_0x20338f(_0x448564[_0xca45('0x10')](0x1f5,[_0x2b04b2[_0xca45('0x56')],_0x45b0c1[_0xca45('0x1b')]['toLowerCase']()][_0xca45('0x14')]('\x20')));});}else{return _0x20338f(_0x448564[_0xca45('0x10')](0x1f5,_0xca45('0x6e')));}});},'Agents':function(_0x4115a9){return new Promise(function(_0x4144b1,_0x55b145){var _0x3704df=_[_0xca45('0x52')](_0x1b3c11[_0xca45('0xc')]);_0x4144b1({'count':_0x3704df[_0xca45('0x51')],'rows':_0x3704df});});},'Telephones':function(_0x5f246a){return new Promise(function(_0x6463a5,_0x37bf8f){var _0x21c867=_[_0xca45('0x52')](_0x1b3c11[_0xca45('0x75')]);_0x6463a5({'count':_0x21c867[_0xca45('0x51')],'rows':_0x21c867});});},'Trunks':function(_0x10a1f7){return new Promise(function(_0x1bfce3,_0x159485){var _0xa322e4=_['values'](_0x1b3c11[_0xca45('0x76')]);_0x1bfce3({'count':_0xa322e4[_0xca45('0x51')],'rows':_0xa322e4});});},'OutboundChannels':function(_0x3e67a9){return new Promise(function(_0x3eb6e4,_0x5b8e34){var _0x45046f=_[_0xca45('0x52')](_0x1b3c11['outboundChannels']);_0x3eb6e4({'count':_0x45046f[_0xca45('0x51')],'rows':_0x45046f});});},'Outbound':function(_0x4ae7e9){return new Promise(function(_0x172deb,_0x4960b6){_0x172deb(_0x1b3c11[_0xca45('0x77')]);});},'Campaigns':function(_0x5dbe57){return new Promise(function(_0x36af3e,_0x95a735){var _0x5bcc9d=_['values'](_0x1b3c11[_0xca45('0x78')]);_0x36af3e({'count':_0x5bcc9d[_0xca45('0x51')],'rows':_0x5bcc9d});});},'VoiceQueuesPreview':function(_0x2a3059){var _0x8949af=this;return new Promise(function(_0x32ca48,_0x49c16b){_0x25cf7c[_0xca45('0x79')](_0x2a3059['id'])[_0xca45('0x1a')](function(_0x43af2b){_0x32ca48({'code':0xc8,'message':_0x43af2b[_0xca45('0x1b')]});})['catch'](function(_0x39cd8f){_0x49c16b(_0x8949af[_0xca45('0x10')](0x1f4,_0x39cd8f[_0xca45('0x1b')]));});});},'EventManager':function(_0x42a271){var _0x2e346b=this;return new Promise(function(_0x4198bc,_0x28dcd2){if(!_0x42a271[_0xca45('0x7a')]){return _0x28dcd2(_0x2e346b[_0xca45('0x10')](0x1f4,_0xca45('0x7b')));}ami[_0xca45('0x7c')](_0xca45('0x7d')+_0x42a271['event'],_0x42a271[_0xca45('0x1b')]);_0x4198bc({'code':0xc8,'message':_0x42a271});});},'FaxAccounts':function(_0x21fbd5){return new Promise(function(_0x548a5c,_0x256f53){var _0x5e098a=_[_0xca45('0x52')](_0x1b3c11[_0xca45('0x7e')]);_0x548a5c({'count':_0x5e098a['length'],'rows':_0x5e098a});});},'SendFax':function(_0x2028ed){var _0x145ed0=this;return new Promise(function(_0x5f3575,_0x42339c){_0x21371c[_0xca45('0x7f')](_0x2028ed)[_0xca45('0x1a')](function(_0x52d9b5){_0x5f3575({'code':0xc8,'message':_0x52d9b5[_0xca45('0x1b')]});})[_0xca45('0x1c')](function(_0x2c8ea8){_0x42339c(_0x145ed0[_0xca45('0x10')](0x1f4,_0x2c8ea8[_0xca45('0x1b')]));});});},'CheckAfterSend':function(_0x3de9af){var _0x2d1f6a=this;return new Promise(function(_0x2940d3,_0x51af68){_0x21371c['checkAfterSend'](_0x3de9af)[_0xca45('0x1a')](function(_0x5887dd){_0x2940d3({'code':0xc8,'message':_0x5887dd['message']});})[_0xca45('0x1c')](function(_0x36e8ec){_0x51af68(_0x2d1f6a['error'](0x1f4,_0x36e8ec[_0xca45('0x1b')]));});});}};var _0x4e3b13=jayson[_0xca45('0x80')](_0x2522f0)[_0xca45('0x81')]();_0x4e3b13['on'](_0xca45('0x10'),function(_0x480952){return _0x509a41(_0x480952);});_0x4e3b13[_0xca45('0x6')](0x232a,_0xca45('0x82'),function(){console['log'](_0xca45('0x83'),0x232a);return _0x5c90ef(_0xca45('0x84')+0x232a);});});};
\ No newline at end of file
diff --git a/server/services/ami/trigger/cmContact/index.js b/server/services/ami/trigger/cmContact/index.js
index d1b89a8..9d41167 100644
--- a/server/services/ami/trigger/cmContact/index.js
+++ b/server/services/ami/trigger/cmContact/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x52c4=['user:%s','name','format','trigger:%s','action','toLowerCase','merge','resolve','[%s][%s]\x20Contact\x20created:%s','catch','error','[%s][%s]\x20Error\x20creating\x20contact','[%s][%s]\x20Autocreate\x20disabled','bluebird','util','lodash','ioredis','../../../../config/environment','../../rpc/cmContact','redis','defaults','localhost','socket.io-emitter','info','[%s][%s]','stringify','emit','exec','data2','data1','calleridnum','firstName','calleridname','','uniqueid','destcalleridname','destcalleridnum','phone','then','omit','[%s][%s]\x20Contact\x20found:%s','xmd-contactid2'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x52c4,0x1b1));var _0x452c=function(_0x7aa744,_0x450c0d){_0x7aa744=_0x7aa744-0x0;var _0x3ef3cb=_0x52c4[_0x7aa744];return _0x3ef3cb;};'use strict';var BPromise=require(_0x452c('0x0'));var util=require(_0x452c('0x1'));var _=require(_0x452c('0x2'));var Redis=require(_0x452c('0x3'));var config=require(_0x452c('0x4'));var logger=require('../../../../config/logger')('trigger');var cmContactRpc=require(_0x452c('0x5'));config[_0x452c('0x6')]=_[_0x452c('0x7')](config['redis'],{'host':_0x452c('0x8'),'port':0x18eb});var io=require(_0x452c('0x9'))(new Redis(config['redis']));function emit(_0x3b4519,_0x5b752e,_0x1c683d,_0x12bac8){logger[_0x452c('0xa')](_0x452c('0xb'),_0x3b4519,'',_0x5b752e,_0x1c683d,JSON[_0x452c('0xc')](_0x12bac8));io['to'](_0x5b752e)[_0x452c('0xd')](_0x1c683d,_0x12bac8);}exports[_0x452c('0xe')]=function(_0xe1e6b4,_0x32f200,_0x1d6732){_0x1d6732['autoCreate']=0x0;if(_0x32f200[_0x452c('0xf')]&&parseInt(_0x32f200[_0x452c('0xf')],0xa)){var _0x170887={'ListId':parseInt(_0x32f200[_0x452c('0x10')],0xa),'phone':_0x1d6732[_0x452c('0x11')]};if(_['isNil'](_0x1d6732['routeId'])){_0x170887[_0x452c('0x12')]=_0x1d6732[_0x452c('0x13')]&&_0x1d6732['calleridname']!==_0x452c('0x14')?_0x1d6732[_0x452c('0x13')]:_0x1d6732['calleridnum']||_0x1d6732[_0x452c('0x15')];}else{_0x170887[_0x452c('0x12')]=_0x1d6732['destcalleridname']&&_0x1d6732[_0x452c('0x16')]!==''?_0x1d6732[_0x452c('0x16')]:_0x1d6732[_0x452c('0x17')]||_0x1d6732['uniqueid'];_0x170887[_0x452c('0x18')]=_0x1d6732[_0x452c('0x16')]&&_0x1d6732[_0x452c('0x16')]!==_0x452c('0x14')?_0x1d6732['destcalleridname']:_0x1d6732[_0x452c('0x17')]||_0x1d6732[_0x452c('0x15')];}BPromise['resolve']()[_0x452c('0x19')](cmContactRpc['showContact']({'where':_[_0x452c('0x1a')](_0x170887,[_0x452c('0x12')])}))[_0x452c('0x19')](function(_0x5fabb0){if(_0x5fabb0){logger['info'](_0x452c('0x1b'),_0x1d6732[_0x452c('0x15')],'',_0x5fabb0['id']);if(_0xe1e6b4){_0x1d6732[_0x452c('0x1c')]=_0x5fabb0['id'];emit(_0x1d6732[_0x452c('0x15')],util['format'](_0x452c('0x1d'),_0xe1e6b4[_0x452c('0x1e')]),util[_0x452c('0x1f')](_0x452c('0x20'),_0x32f200[_0x452c('0x21')][_0x452c('0x22')]()),_[_0x452c('0x23')](_0x1d6732,{'ListId':parseInt(_0x32f200[_0x452c('0x10')],0xa)}));}return;}else{logger[_0x452c('0xa')]('[%s][%s]\x20Contact\x20not\x20found',_0x1d6732['uniqueid'],'');return BPromise[_0x452c('0x24')]()[_0x452c('0x19')](cmContactRpc['createContact'](_0x170887));}})[_0x452c('0x19')](function(_0x3db0a3){if(_0x3db0a3){logger[_0x452c('0xa')](_0x452c('0x25'),_0x1d6732[_0x452c('0x15')],'',_0x3db0a3['id']);if(_0xe1e6b4){_0x1d6732[_0x452c('0x1c')]=_0x3db0a3['id'];emit(_0x1d6732[_0x452c('0x15')],util[_0x452c('0x1f')](_0x452c('0x1d'),_0xe1e6b4[_0x452c('0x1e')]),util['format'](_0x452c('0x20'),_0x32f200[_0x452c('0x21')]['toLowerCase']()),_['merge'](_0x1d6732,{'ListId':parseInt(_0x32f200['data1'],0xa)}));}}})[_0x452c('0x26')](function(_0x1b896f){logger[_0x452c('0x27')](_0x452c('0x28'),_0x1d6732[_0x452c('0x15')],'',JSON[_0x452c('0xc')](_0x1b896f));});}else{if(_0xe1e6b4){logger[_0x452c('0xa')](_0x452c('0x29'),_0x1d6732[_0x452c('0x15')],'');emit(_0x1d6732[_0x452c('0x15')],util[_0x452c('0x1f')](_0x452c('0x1d'),_0xe1e6b4[_0x452c('0x1e')]),util[_0x452c('0x1f')](_0x452c('0x20'),_0x32f200[_0x452c('0x21')]['toLowerCase']()),_[_0x452c('0x23')]({'ListId':parseInt(_0x32f200[_0x452c('0x10')],0xa)},_0x1d6732));}}};
\ No newline at end of file
+var _0xe03b=['name','trigger:%s','action','toLowerCase','merge','[%s][%s]\x20Contact\x20not\x20found','createContact','[%s][%s]\x20Contact\x20created:%s','catch','[%s][%s]\x20Error\x20creating\x20contact','stringify','[%s][%s]\x20Autocreate\x20disabled','bluebird','util','lodash','ioredis','../../../../config/logger','trigger','redis','defaults','localhost','socket.io-emitter','[%s][%s]','emit','exec','autoCreate','data2','data1','calleridnum','isNil','routeId','calleridname','','uniqueid','firstName','destcalleridname','destcalleridnum','phone','resolve','then','showContact','omit','info','[%s][%s]\x20Contact\x20found:%s','xmd-contactid2','format','user:%s'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0xe03b,0x155));var _0xbe03=function(_0x2aad87,_0x442b48){_0x2aad87=_0x2aad87-0x0;var _0x364649=_0xe03b[_0x2aad87];return _0x364649;};'use strict';var BPromise=require(_0xbe03('0x0'));var util=require(_0xbe03('0x1'));var _=require(_0xbe03('0x2'));var Redis=require(_0xbe03('0x3'));var config=require('../../../../config/environment');var logger=require(_0xbe03('0x4'))(_0xbe03('0x5'));var cmContactRpc=require('../../rpc/cmContact');config[_0xbe03('0x6')]=_[_0xbe03('0x7')](config[_0xbe03('0x6')],{'host':_0xbe03('0x8'),'port':0x18eb});var io=require(_0xbe03('0x9'))(new Redis(config[_0xbe03('0x6')]));function emit(_0x1b3887,_0x41b8e1,_0x42034b,_0x13ebc0){logger['info'](_0xbe03('0xa'),_0x1b3887,'',_0x41b8e1,_0x42034b,JSON['stringify'](_0x13ebc0));io['to'](_0x41b8e1)[_0xbe03('0xb')](_0x42034b,_0x13ebc0);}exports[_0xbe03('0xc')]=function(_0x2352f8,_0x3a239e,_0x1a487d){_0x1a487d[_0xbe03('0xd')]=0x0;if(_0x3a239e[_0xbe03('0xe')]&&parseInt(_0x3a239e['data2'],0xa)){var _0x4be753={'ListId':parseInt(_0x3a239e[_0xbe03('0xf')],0xa),'phone':_0x1a487d[_0xbe03('0x10')]};if(_[_0xbe03('0x11')](_0x1a487d[_0xbe03('0x12')])){_0x4be753['firstName']=_0x1a487d['calleridname']&&_0x1a487d[_0xbe03('0x13')]!==_0xbe03('0x14')?_0x1a487d[_0xbe03('0x13')]:_0x1a487d['calleridnum']||_0x1a487d[_0xbe03('0x15')];}else{_0x4be753[_0xbe03('0x16')]=_0x1a487d[_0xbe03('0x17')]&&_0x1a487d[_0xbe03('0x17')]!==_0xbe03('0x14')?_0x1a487d[_0xbe03('0x17')]:_0x1a487d[_0xbe03('0x18')]||_0x1a487d['uniqueid'];_0x4be753[_0xbe03('0x19')]=_0x1a487d[_0xbe03('0x17')]&&_0x1a487d[_0xbe03('0x17')]!==_0xbe03('0x14')?_0x1a487d[_0xbe03('0x17')]:_0x1a487d[_0xbe03('0x18')]||_0x1a487d[_0xbe03('0x15')];}BPromise[_0xbe03('0x1a')]()[_0xbe03('0x1b')](cmContactRpc[_0xbe03('0x1c')]({'where':_[_0xbe03('0x1d')](_0x4be753,[_0xbe03('0x16')])}))['then'](function(_0x5b0157){if(_0x5b0157){logger[_0xbe03('0x1e')](_0xbe03('0x1f'),_0x1a487d[_0xbe03('0x15')],'',_0x5b0157['id']);if(_0x2352f8){_0x1a487d[_0xbe03('0x20')]=_0x5b0157['id'];emit(_0x1a487d[_0xbe03('0x15')],util[_0xbe03('0x21')](_0xbe03('0x22'),_0x2352f8[_0xbe03('0x23')]),util[_0xbe03('0x21')](_0xbe03('0x24'),_0x3a239e[_0xbe03('0x25')][_0xbe03('0x26')]()),_[_0xbe03('0x27')](_0x1a487d,{'ListId':parseInt(_0x3a239e[_0xbe03('0xf')],0xa)}));}return;}else{logger[_0xbe03('0x1e')](_0xbe03('0x28'),_0x1a487d['uniqueid'],'');return BPromise[_0xbe03('0x1a')]()[_0xbe03('0x1b')](cmContactRpc[_0xbe03('0x29')](_0x4be753));}})['then'](function(_0xbd6569){if(_0xbd6569){logger[_0xbe03('0x1e')](_0xbe03('0x2a'),_0x1a487d[_0xbe03('0x15')],'',_0xbd6569['id']);if(_0x2352f8){_0x1a487d['xmd-contactid2']=_0xbd6569['id'];emit(_0x1a487d[_0xbe03('0x15')],util[_0xbe03('0x21')](_0xbe03('0x22'),_0x2352f8[_0xbe03('0x23')]),util[_0xbe03('0x21')](_0xbe03('0x24'),_0x3a239e['action'][_0xbe03('0x26')]()),_[_0xbe03('0x27')](_0x1a487d,{'ListId':parseInt(_0x3a239e['data1'],0xa)}));}}})[_0xbe03('0x2b')](function(_0xdf97f2){logger['error'](_0xbe03('0x2c'),_0x1a487d[_0xbe03('0x15')],'',JSON[_0xbe03('0x2d')](_0xdf97f2));});}else{if(_0x2352f8){logger[_0xbe03('0x1e')](_0xbe03('0x2e'),_0x1a487d['uniqueid'],'');emit(_0x1a487d['uniqueid'],util[_0xbe03('0x21')](_0xbe03('0x22'),_0x2352f8['name']),util[_0xbe03('0x21')](_0xbe03('0x24'),_0x3a239e[_0xbe03('0x25')][_0xbe03('0x26')]()),_['merge']({'ListId':parseInt(_0x3a239e[_0xbe03('0xf')],0xa)},_0x1a487d));}}};
\ No newline at end of file
diff --git a/server/services/ami/trigger/index.js b/server/services/ami/trigger/index.js
index eb34d26..cf12ce8 100644
--- a/server/services/ami/trigger/index.js
+++ b/server/services/ami/trigger/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xbb8e=['field','chat','operator','ChatWebsiteId','upperFirst','AccountId','value','interaction','message','event','agent','membername','lastevent','exports','util','lodash','url','mustache','./integration','./script','../rpc/cmContact','../../../config/environment','trigger','redis','defaults','localhost','socket.io-emitter','popup','winapp','triggers','agents','voiceQueues','templates','voiceExtensions','zendeskAccounts','freshdeskAccounts','sugarcrmAccounts','zohoAccounts','deskAccounts','servicenowAccounts','dynamics365Accounts','freshsalesAccounts','accounts','salesforceAccounts','custom:agentcalled','bind','custom:agentconnect','custom:agentringnoanswer','syncCustomEvent','custom:agentcomplete','custom:agentnosuchnumber','custom:agentnoanswer','custom:agentbusy','custom:agentcongestion','custom:agentreject','custom:queuecallerabandon','custom:dialconnect','custom:dialend','syncAgentDial','custom:outgoingmessage','custom:acceptmessage','custom:rejectmessage','prototype','emit','info','stringify','checkTriggers','status','merge','variables','length','Actions','interface','action','toLowerCase','data1','data2','render','html','template\x20not\x20found','uri','buildUri','isNil','data3','data4','location','uriLocation','windowWidth','data5','800','windowHeight','data6','600','winApplication','winArguments','format','user:%s','name','trigger:%s:%s','trigger:%s','contactmanager','integration','exec','queue','routeId','urlforward','script','search','replace','checkTrigger','AllConditions','checkConditions','channel','AnyConditions'];(function(_0x39de19,_0x5d3676){var _0x31e35e=function(_0x4a4416){while(--_0x4a4416){_0x39de19['push'](_0x39de19['shift']());}};_0x31e35e(++_0x5d3676);}(_0xbb8e,0x164));var _0xebb8=function(_0x3740d4,_0x476101){_0x3740d4=_0x3740d4-0x0;var _0x5dc641=_0xbb8e[_0x3740d4];return _0x5dc641;};'use strict';var util=require(_0xebb8('0x0'));var _=require(_0xebb8('0x1'));var url=require(_0xebb8('0x2'));var Mustache=require(_0xebb8('0x3'));var Redis=require('ioredis');var urlforward=require('./urlforward');var integration=require(_0xebb8('0x4'));var cmContact=require('./cmContact');var script=require(_0xebb8('0x5'));var cmContactRpc=require(_0xebb8('0x6'));var config=require(_0xebb8('0x7'));var logger=require('../../../config/logger')(_0xebb8('0x8'));var ami=require('../ami');config[_0xebb8('0x9')]=_[_0xebb8('0xa')](config[_0xebb8('0x9')],{'host':_0xebb8('0xb'),'port':0x18eb});var io=require(_0xebb8('0xc'))(new Redis(config['redis']));var operators={'equals':function(_0x5757de,_0x4e1270){return _0x5757de==_0x4e1270;},'not_equals':function(_0x2439a6,_0x462e46){return _0x2439a6!=_0x462e46;}};var barAndWebActions=[_0xebb8('0xd'),_0xebb8('0x2'),_0xebb8('0xe')];function Trigger(_0x3c0735){this[_0xebb8('0xf')]=_0x3c0735['triggers'];this[_0xebb8('0x10')]=_0x3c0735[_0xebb8('0x10')];this[_0xebb8('0x11')]=_0x3c0735[_0xebb8('0x11')];this['templates']=_0x3c0735[_0xebb8('0x12')];this['voiceExtensions']=_0x3c0735[_0xebb8('0x13')];this[_0xebb8('0x14')]=_0x3c0735[_0xebb8('0x14')];this[_0xebb8('0x15')]=_0x3c0735[_0xebb8('0x15')];this['salesforceAccounts']=_0x3c0735['salesforceAccounts'];this[_0xebb8('0x16')]=_0x3c0735[_0xebb8('0x16')];this[_0xebb8('0x17')]=_0x3c0735['zohoAccounts'];this[_0xebb8('0x18')]=_0x3c0735[_0xebb8('0x18')];this['vtigerAccounts']=_0x3c0735['vtigerAccounts'];this[_0xebb8('0x19')]=_0x3c0735[_0xebb8('0x19')];this[_0xebb8('0x1a')]=_0x3c0735[_0xebb8('0x1a')];this['freshsalesAccounts']=_0x3c0735[_0xebb8('0x1b')];this[_0xebb8('0x1c')]={'zendesk':this[_0xebb8('0x14')],'salesforce':this[_0xebb8('0x1d')],'freshdesk':this['freshdeskAccounts'],'sugarcrm':this[_0xebb8('0x16')],'zoho':this['zohoAccounts'],'desk':this['deskAccounts'],'vtiger':this['vtigerAccounts'],'dynamics365':this[_0xebb8('0x1a')],'freshsales':this[_0xebb8('0x1b')],'servicenow':this['servicenowAccounts']};ami['on'](_0xebb8('0x1e'),this['syncCustomEvent'][_0xebb8('0x1f')](this));ami['on'](_0xebb8('0x20'),this['syncCustomEvent'][_0xebb8('0x1f')](this));ami['on'](_0xebb8('0x21'),this[_0xebb8('0x22')]['bind'](this));ami['on'](_0xebb8('0x23'),this['syncCustomEvent'][_0xebb8('0x1f')](this));ami['on'](_0xebb8('0x24'),this[_0xebb8('0x22')]['bind'](this));ami['on'](_0xebb8('0x25'),this[_0xebb8('0x22')][_0xebb8('0x1f')](this));ami['on'](_0xebb8('0x26'),this[_0xebb8('0x22')]['bind'](this));ami['on'](_0xebb8('0x27'),this['syncCustomEvent'][_0xebb8('0x1f')](this));ami['on'](_0xebb8('0x28'),this[_0xebb8('0x22')]['bind'](this));ami['on'](_0xebb8('0x29'),this[_0xebb8('0x22')][_0xebb8('0x1f')](this));ami['on']('custom:timeout',this[_0xebb8('0x22')][_0xebb8('0x1f')](this));ami['on']('custom:dialbegin',this['syncAgentDial'][_0xebb8('0x1f')](this));ami['on'](_0xebb8('0x2a'),this['syncAgentDial']['bind'](this));ami['on'](_0xebb8('0x2b'),this[_0xebb8('0x2c')][_0xebb8('0x1f')](this));ami['on']('custom:newinteraction',this[_0xebb8('0x22')]['bind'](this));ami['on']('custom:closedinteraction',this[_0xebb8('0x22')]['bind'](this));ami['on']('custom:incomingmessage',this['syncCustomEvent'][_0xebb8('0x1f')](this));ami['on'](_0xebb8('0x2d'),this[_0xebb8('0x22')]['bind'](this));ami['on'](_0xebb8('0x2e'),this[_0xebb8('0x22')][_0xebb8('0x1f')](this));ami['on'](_0xebb8('0x2f'),this[_0xebb8('0x22')]['bind'](this));}Trigger[_0xebb8('0x30')][_0xebb8('0x31')]=function(_0x4beb3b,_0x412270,_0x24b4fa){logger[_0xebb8('0x32')](_0x4beb3b,_0x412270,JSON[_0xebb8('0x33')](_0x24b4fa));io['to'](_0x4beb3b)[_0xebb8('0x31')](_0x412270,_0x24b4fa);};Trigger[_0xebb8('0x30')][_0xebb8('0x22')]=function(_0x9055c5){var _0x33daa5=_['clone'](_0x9055c5);this[_0xebb8('0x34')](_0x33daa5);};Trigger[_0xebb8('0x30')][_0xebb8('0x2c')]=function(_0x15bb66){if(this[_0xebb8('0x10')][_0x15bb66['interface']]){this[_0xebb8('0x22')](_0x15bb66);}};Trigger[_0xebb8('0x30')][_0xebb8('0x34')]=function(_0x4cbb37){var _0x566f54;for(var _0x15d9c9 in this['triggers']){if(this[_0xebb8('0xf')]['hasOwnProperty'](_0x15d9c9)){if(this[_0xebb8('0xf')][_0x15d9c9][_0xebb8('0x35')]){_0x566f54=this['checkTrigger'](this['triggers'][_0x15d9c9],_0x4cbb37);if(_0x566f54){_[_0xebb8('0x36')](_0x4cbb37,_0x4cbb37[_0xebb8('0x37')]);for(var _0x4d78c3=0x0,_0x36aee3,_0x4d8302,_0x5629c6;_0x4d78c30x0){_0x34dc65=_[_0x0a9e('0x26')](_0x5bfb33,_0x1dc186);}return _0x34dc65;}function getCustomFields(_0x140511,_0x1538a4){var _0x11c3b6=[];var _0x14de77={'custom_fields':{}};if(_0x140511['length']>0x0){_[_0x0a9e('0x27')](_0x140511,function(_0x468813){if(_0x468813[_0x0a9e('0x28')]===_0x0a9e('0x29')&&_0x468813['nameField']&&!_0x468813[_0x0a9e('0x2a')]){_0x14de77[_0x468813[_0x0a9e('0x2b')][_0x0a9e('0x2c')]()]=_0x468813[_0x0a9e('0x2d')][_0x0a9e('0x2e')]();}else if(_0x468813[_0x0a9e('0x28')]===_0x0a9e('0x29')&&_0x468813[_0x0a9e('0x2f')]&&_0x468813[_0x0a9e('0x2a')]){_0x14de77['custom_fields'][_0x468813[_0x0a9e('0x2f')]]=_0x468813['content'][_0x0a9e('0x2e')]();}else if(_0x468813[_0x0a9e('0x28')]===_0x0a9e('0x30')&&_0x468813[_0x0a9e('0x31')]&&_0x468813[_0x0a9e('0x2f')]&&_0x468813['customField']){_0x1538a4[_0x468813[_0x0a9e('0x31')]]&&(_0x14de77[_0x0a9e('0x32')][_0x468813[_0x0a9e('0x2f')]]=_0x1538a4[_0x468813[_0x0a9e('0x31')]][_0x0a9e('0x2e')]());}else if(_0x468813[_0x0a9e('0x28')]===_0x0a9e('0x33')&&_0x468813[_0x0a9e('0x34')]&&_0x468813['Variable'][_0x0a9e('0x35')]&&_0x468813['idField']&&_0x468813[_0x0a9e('0x2a')]){_0x1538a4[_0x468813[_0x0a9e('0x34')][_0x0a9e('0x35')][_0x0a9e('0x2c')]()]&&(_0x14de77['custom_fields'][_0x468813[_0x0a9e('0x2f')]]=_0x1538a4[_0x468813[_0x0a9e('0x34')][_0x0a9e('0x35')][_0x0a9e('0x2c')]()]['toString']());}});}if(_0x14de77['priority']){_0x14de77[_0x0a9e('0x36')]=Number(_0x14de77['priority']);}return _0x14de77;}function getTicket(_0x24936a,_0x3d9717,_0x381c37,_0x1ef87a,_0x4f41ae){logger[_0x0a9e('0xb')](_0x0a9e('0x37'));var _0x3cae=_['merge']({'subject':intUtil[_0x0a9e('0x38')](_0x1ef87a[_0x0a9e('0x39')],_0x4f41ae,'\x20'),'type':_0x0a9e('0x3a'),'status':'new','labels':['xCALLY',_0x0a9e('0x3b'),_0x0a9e('0x3c')]['concat'](getTags(_0x1ef87a[_0x0a9e('0x3d')],_0x0a9e('0x35'))),'description':intUtil[_0x0a9e('0x38')](_0x1ef87a[_0x0a9e('0x3e')],_0x4f41ae,'\x0a'),'_links':{'assigned_user':{'href':util['format']('/api/v2/users/%d',_0x3d9717['id']),'class':_0x0a9e('0x3f')}},'message':{'direction':'in','body':intUtil[_0x0a9e('0x38')](_0x1ef87a['Descriptions'],_0x4f41ae,'\x0a')}},getCustomFields(_0x1ef87a[_0x0a9e('0x40')],_0x4f41ae));return request({'uri':util[_0x0a9e('0xd')](_0x0a9e('0x41'),_0x24936a['remoteUri'],_0x381c37['id']),'method':_0x0a9e('0x42'),'body':_0x3cae});}exports[_0x0a9e('0x43')]=function(_0x274e8e,_0x43dd5b,_0x13cb1f,_0xeaa5e5,_0x2881b3,_0x45a9b8){var _0x23b089,_0x3da2cd;_0x45a9b8[_0x0a9e('0x16')]=intUtil[_0x0a9e('0x44')](_0x45a9b8[_0x0a9e('0x16')]);_0x45a9b8[_0x0a9e('0x45')]=intUtil[_0x0a9e('0x44')](_0x45a9b8['serverUrl']);if(_0x2881b3&&_0x2881b3['monitor_format']){logger[_0x0a9e('0xb')](_0x0a9e('0x46'),_0x0a9e('0x47'));_0x43dd5b[_0x0a9e('0x48')]=util[_0x0a9e('0xd')](_0x0a9e('0x49'),_0x45a9b8[_0x0a9e('0x45')],_0x43dd5b[_0x0a9e('0x4a')],md5(_0x43dd5b[_0x0a9e('0x4a')]));}else{_0x43dd5b[_0x0a9e('0x48')]='';}headers[_0x0a9e('0x4b')]=getAuth(_0x45a9b8);return getUser(_0x45a9b8,_0xeaa5e5[_0x0a9e('0x4c')])['then'](function(_0x117c99){_0x23b089=_0x117c99;logger[_0x0a9e('0xb')](_0x0a9e('0x4d'),_0x23b089['id']);return getEndUser(_0x45a9b8,_0x43dd5b[_0x0a9e('0x4e')],_0x43dd5b[_0x0a9e('0x4f')]);})[_0x0a9e('0x12')](function(_0x21eb86){_0x3da2cd=_0x21eb86;logger[_0x0a9e('0xb')]('The\x20Enduser\x20ID\x20is:',_0x3da2cd['id']);return getTicket(_0x45a9b8,_0x23b089,_0x3da2cd,_0x13cb1f,_0x43dd5b);})[_0x0a9e('0x12')](function(_0x48fd45){if(_0x48fd45){logger[_0x0a9e('0xb')](_0x0a9e('0x50'));logger[_0x0a9e('0xb')]('The\x20Ticket\x20ID\x20is:',_0x48fd45['id']);switch(_0x45a9b8[_0x0a9e('0x28')]){case _0x0a9e('0x51'):logger[_0x0a9e('0xb')](_0x0a9e('0x46'),_0x0a9e('0x52'));emit(util[_0x0a9e('0xd')](_0x0a9e('0x53'),_0xeaa5e5['name']),_0x0a9e('0x54'),{'recordId':_0x48fd45['id']});break;case _0x0a9e('0x55'):logger[_0x0a9e('0xb')](_0x0a9e('0x46'),_0x0a9e('0x56'));emit(util[_0x0a9e('0xd')](_0x0a9e('0x53'),_0xeaa5e5[_0x0a9e('0x35')]),_0x0a9e('0x57'),{'uri':util['format'](_0x0a9e('0x58'),_0x48fd45['id'])});break;default:logger[_0x0a9e('0x59')]('[QUEUE]','Desk\x20account\x20type\x20not\x20recognized');}}})['catch'](function(_0x1adfee){console[_0x0a9e('0x59')](_0x1adfee);logger[_0x0a9e('0x59')](_0x0a9e('0x46'),JSON[_0x0a9e('0x19')](_0x1adfee));});};exports[_0x0a9e('0x5a')]=function(_0x2e5165,_0x375c18,_0x5d38ae,_0x4b1b9f,_0x53975a,_0x39d77d,_0x204173){var _0x14d602,_0x5bb3ed;_0x39d77d[_0x0a9e('0x16')]=intUtil[_0x0a9e('0x44')](_0x39d77d['remoteUri']);_0x39d77d['serverUrl']=intUtil[_0x0a9e('0x44')](_0x39d77d['serverUrl']);if(_0x204173&&_0x204173[_0x0a9e('0x5b')]&&_0x204173['recordingFormat']!==_0x0a9e('0x5c')){logger[_0x0a9e('0xb')](_0x0a9e('0x5d'),'Recording\x20is\x20enabled!');_0x375c18[_0x0a9e('0x48')]=util[_0x0a9e('0xd')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x39d77d['serverUrl'],_0x375c18[_0x0a9e('0x4a')],md5(_0x375c18[_0x0a9e('0x4a')]));}headers['Authorization']=getAuth(_0x39d77d);return getUser(_0x39d77d,_0x4b1b9f[_0x0a9e('0x4c')])['then'](function(_0x211ef9){_0x14d602=_0x211ef9;logger['info'](_0x0a9e('0x4d'),_0x14d602['id']);return getEndUser(_0x39d77d,_0x375c18['destcalleridname'],_0x375c18['destcalleridnum']);})['then'](function(_0x2da03c){_0x5bb3ed=_0x2da03c;logger['info'](_0x0a9e('0x5e'),_0x5bb3ed['id']);return getTicket(_0x39d77d,_0x14d602,_0x5bb3ed,_0x5d38ae,_0x375c18);})[_0x0a9e('0x12')](function(_0x3cfd00){if(_0x3cfd00){logger[_0x0a9e('0xb')](_0x0a9e('0x50'));logger[_0x0a9e('0xb')](_0x0a9e('0x5f'),_0x3cfd00['id']);switch(_0x39d77d[_0x0a9e('0x28')]){case'integrationTab':logger[_0x0a9e('0xb')](_0x0a9e('0x46'),_0x0a9e('0x52'));emit(util[_0x0a9e('0xd')](_0x0a9e('0x53'),_0x4b1b9f[_0x0a9e('0x35')]),'trigger:desk:display',{'recordId':_0x3cfd00['id']});break;case _0x0a9e('0x55'):logger[_0x0a9e('0xb')]('[QUEUE]',_0x0a9e('0x56'));emit(util['format'](_0x0a9e('0x53'),_0x4b1b9f['name']),'trigger:browser:url',{'uri':util['format'](_0x0a9e('0x60'),_0x39d77d['remoteUri'],_0x3cfd00['id'])});break;default:logger[_0x0a9e('0x59')](_0x0a9e('0x5d'),_0x0a9e('0x61'));}}})[_0x0a9e('0x62')](function(_0x1cca9f){logger[_0x0a9e('0x59')]('[OUTBOUND]',JSON[_0x0a9e('0x19')](_0x1cca9f));});};exports['unmanaged']=function(_0xca4ade,_0x1f07cb,_0x51aaf7,_0x5adf8f,_0x453360,_0x156f1c){var _0x119677,_0x32e134;_0x156f1c['remoteUri']=intUtil[_0x0a9e('0x44')](_0x156f1c[_0x0a9e('0x16')]);_0x156f1c['serverUrl']=intUtil[_0x0a9e('0x44')](_0x156f1c[_0x0a9e('0x45')]);if(_0x453360&&_0x453360[_0x0a9e('0x63')]){logger[_0x0a9e('0xb')]('['+_0x1f07cb[_0x0a9e('0x64')]['toUpperCase']()+']',_0x0a9e('0x47'));_0x1f07cb[_0x0a9e('0x48')]=util[_0x0a9e('0xd')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x156f1c[_0x0a9e('0x45')],_0x1f07cb['uniqueid'],md5(_0x1f07cb['uniqueid']));}else{_0x1f07cb[_0x0a9e('0x48')]='';}headers[_0x0a9e('0x4b')]=getAuth(_0x156f1c);return getUser(_0x156f1c)[_0x0a9e('0x12')](function(_0x19c995){_0x119677=_0x19c995;logger[_0x0a9e('0xb')](_0x0a9e('0x4d'),_0x119677['id']);return getEndUser(_0x156f1c,_0x1f07cb[_0x0a9e('0x4e')],_0x1f07cb[_0x0a9e('0x4f')]);})[_0x0a9e('0x12')](function(_0x1cc4f3){_0x32e134=_0x1cc4f3;logger[_0x0a9e('0xb')](_0x0a9e('0x5e'),_0x32e134['id']);return getTicket(_0x156f1c,_0x119677,_0x32e134,_0x51aaf7,_0x1f07cb);})[_0x0a9e('0x12')](function(_0x2b8192){if(_0x2b8192){logger[_0x0a9e('0xb')](_0x0a9e('0x50'));logger[_0x0a9e('0xb')](_0x0a9e('0x5f'),_0x2b8192['id']);}})['catch'](function(_0x1b0b98){logger[_0x0a9e('0x59')]('['+_0x1f07cb[_0x0a9e('0x64')]['toUpperCase']()+']',JSON[_0x0a9e('0x19')](_0x1b0b98));});};
\ No newline at end of file
+var _0xa9e0=['Getting\x20agent\x20with\x20email','format','total_entries','find','_embedded','entries','then','Agent\x20found!','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/users/me','remoteUri','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','debug','stringify','GET','authType','basic','%s:%s','username','password','token','Basic\x20%s','%s/customers/search','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','work','length','map','forEach','type','string','customField','nameField','toLowerCase','content','toString','idField','variable','variableName','custom_fields','customVariable','Variable','name','priority','Creating\x20new\x20ticket...','getString','Subjects','phone','Motion','CTI','Tags','Descriptions','user','Fields','%s/customers/%d/cases','POST','queue','stripTrailingSlash','serverUrl','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','email','The\x20User\x20ID\x20is:','calleridname','calleridnum','Ticket\x20created!','integrationTab','Displaying\x20ticket\x20to\x20agent...','user:%s','trigger:desk:display','newTab','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','https://xcally.desk.com/web/agent/case/%d','error','outbound','recordingFormat','none','[OUTBOUND]','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','%s/agent/tickets/%s','Desk\x20account\x20type\x20not\x20recognized','catch','monitor_format','lastevent','lodash','request-promise','md5','./util','../../../../config/logger','desk','redis','defaults','socket.io-emitter','emit','validateEmail','info'];(function(_0x1d5400,_0x567e3c){var _0x21d9fe=function(_0x23fb75){while(--_0x23fb75){_0x1d5400['push'](_0x1d5400['shift']());}};_0x21d9fe(++_0x567e3c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x47e7cb,_0x4c1b8d){_0x47e7cb=_0x47e7cb-0x0;var _0x2a8874=_0xa9e0[_0x47e7cb];return _0x2a8874;};'use strict';var _=require(_0x0a9e('0x0'));var rp=require(_0x0a9e('0x1'));var md5=require(_0x0a9e('0x2'));var util=require('util');var Redis=require('ioredis');var intUtil=require(_0x0a9e('0x3'));var config=require('../../../../config/environment');var logger=require(_0x0a9e('0x4'))(_0x0a9e('0x5'));config[_0x0a9e('0x6')]=_[_0x0a9e('0x7')](config[_0x0a9e('0x6')],{'host':'localhost','port':0x18eb});var io=require(_0x0a9e('0x8'))(new Redis(config[_0x0a9e('0x6')]));function emit(_0x2cc193,_0x5f41ea,_0x503809){io['to'](_0x2cc193)[_0x0a9e('0x9')](_0x5f41ea,_0x503809);}var headers={'Content-Type':'application/json','Accept':'application/json'};function getUser(_0x39753a,_0xf81284){if(intUtil[_0x0a9e('0xa')](_0xf81284)===!![]){logger[_0x0a9e('0xb')](_0x0a9e('0xc'),_0xf81284);return request({'uri':util[_0x0a9e('0xd')]('%s/users',_0x39753a['remoteUri'])})['then'](function(_0x4cfe67){if(_0x4cfe67[_0x0a9e('0xe')]){return _[_0x0a9e('0xf')](_0x4cfe67[_0x0a9e('0x10')][_0x0a9e('0x11')],{'email':_0xf81284});}})[_0x0a9e('0x12')](function(_0x69aeb7){if(_0x69aeb7){logger['info'](_0x0a9e('0x13'));return _0x69aeb7;}else{logger[_0x0a9e('0xb')](_0x0a9e('0x14'));return request({'uri':util[_0x0a9e('0xd')](_0x0a9e('0x15'),_0x39753a[_0x0a9e('0x16')])});}});}else{logger['info'](_0x0a9e('0x17'));return request({'uri':util['format'](_0x0a9e('0x15'),_0x39753a['remoteUri'])});}}function request(_0x16033c){logger[_0x0a9e('0x18')]('[HTTP]',JSON[_0x0a9e('0x19')](_0x16033c));return rp(_['defaults'](_0x16033c,{'method':_0x0a9e('0x1a'),'headers':headers,'json':!![]}));}function getAuth(_0x478723){var _0x106033;if(_0x478723[_0x0a9e('0x1b')]===_0x0a9e('0x1c')){_0x106033=util[_0x0a9e('0xd')](_0x0a9e('0x1d'),_0x478723[_0x0a9e('0x1e')],_0x478723[_0x0a9e('0x1f')]);}else if(_0x478723[_0x0a9e('0x1b')]===_0x0a9e('0x20')){_0x106033=util[_0x0a9e('0xd')]('%s/token:%s',_0x478723[_0x0a9e('0x1e')],_0x478723[_0x0a9e('0x20')]);}return util['format'](_0x0a9e('0x21'),new Buffer(_0x106033)['toString']('base64'));}function getEndUser(_0x3a02e1,_0x432e56,_0x38e7c4){logger[_0x0a9e('0xb')]('Searching\x20enduser\x20with\x20phone',_0x38e7c4);return request({'uri':util[_0x0a9e('0xd')](_0x0a9e('0x22'),_0x3a02e1[_0x0a9e('0x16')]),'qs':{'phone':_0x38e7c4}})[_0x0a9e('0x12')](function(_0x370d86){if(_0x370d86[_0x0a9e('0xe')]){logger[_0x0a9e('0xb')]('Enduser\x20found!');return _0x370d86['_embedded'][_0x0a9e('0x11')][0x0];}else{logger[_0x0a9e('0xb')](_0x0a9e('0x23'));return request({'uri':util[_0x0a9e('0xd')]('%s/customers',_0x3a02e1[_0x0a9e('0x16')]),'method':'POST','body':{'first_name':_0x432e56,'title':_0x432e56,'phone_numbers':[{'type':_0x0a9e('0x24'),'value':_0x38e7c4}]}});}});}function getTags(_0x5bfb33,_0x1dc186){var _0x34dc65=[];if(_0x5bfb33&&_0x5bfb33[_0x0a9e('0x25')]>0x0){_0x34dc65=_[_0x0a9e('0x26')](_0x5bfb33,_0x1dc186);}return _0x34dc65;}function getCustomFields(_0x140511,_0x1538a4){var _0x11c3b6=[];var _0x14de77={'custom_fields':{}};if(_0x140511['length']>0x0){_[_0x0a9e('0x27')](_0x140511,function(_0x468813){if(_0x468813[_0x0a9e('0x28')]===_0x0a9e('0x29')&&_0x468813['nameField']&&!_0x468813[_0x0a9e('0x2a')]){_0x14de77[_0x468813[_0x0a9e('0x2b')][_0x0a9e('0x2c')]()]=_0x468813[_0x0a9e('0x2d')][_0x0a9e('0x2e')]();}else if(_0x468813[_0x0a9e('0x28')]===_0x0a9e('0x29')&&_0x468813[_0x0a9e('0x2f')]&&_0x468813[_0x0a9e('0x2a')]){_0x14de77['custom_fields'][_0x468813[_0x0a9e('0x2f')]]=_0x468813['content'][_0x0a9e('0x2e')]();}else if(_0x468813[_0x0a9e('0x28')]===_0x0a9e('0x30')&&_0x468813[_0x0a9e('0x31')]&&_0x468813[_0x0a9e('0x2f')]&&_0x468813['customField']){_0x1538a4[_0x468813[_0x0a9e('0x31')]]&&(_0x14de77[_0x0a9e('0x32')][_0x468813[_0x0a9e('0x2f')]]=_0x1538a4[_0x468813[_0x0a9e('0x31')]][_0x0a9e('0x2e')]());}else if(_0x468813[_0x0a9e('0x28')]===_0x0a9e('0x33')&&_0x468813[_0x0a9e('0x34')]&&_0x468813['Variable'][_0x0a9e('0x35')]&&_0x468813['idField']&&_0x468813[_0x0a9e('0x2a')]){_0x1538a4[_0x468813[_0x0a9e('0x34')][_0x0a9e('0x35')][_0x0a9e('0x2c')]()]&&(_0x14de77['custom_fields'][_0x468813[_0x0a9e('0x2f')]]=_0x1538a4[_0x468813[_0x0a9e('0x34')][_0x0a9e('0x35')][_0x0a9e('0x2c')]()]['toString']());}});}if(_0x14de77['priority']){_0x14de77[_0x0a9e('0x36')]=Number(_0x14de77['priority']);}return _0x14de77;}function getTicket(_0x24936a,_0x3d9717,_0x381c37,_0x1ef87a,_0x4f41ae){logger[_0x0a9e('0xb')](_0x0a9e('0x37'));var _0x3cae=_['merge']({'subject':intUtil[_0x0a9e('0x38')](_0x1ef87a[_0x0a9e('0x39')],_0x4f41ae,'\x20'),'type':_0x0a9e('0x3a'),'status':'new','labels':['xCALLY',_0x0a9e('0x3b'),_0x0a9e('0x3c')]['concat'](getTags(_0x1ef87a[_0x0a9e('0x3d')],_0x0a9e('0x35'))),'description':intUtil[_0x0a9e('0x38')](_0x1ef87a[_0x0a9e('0x3e')],_0x4f41ae,'\x0a'),'_links':{'assigned_user':{'href':util['format']('/api/v2/users/%d',_0x3d9717['id']),'class':_0x0a9e('0x3f')}},'message':{'direction':'in','body':intUtil[_0x0a9e('0x38')](_0x1ef87a['Descriptions'],_0x4f41ae,'\x0a')}},getCustomFields(_0x1ef87a[_0x0a9e('0x40')],_0x4f41ae));return request({'uri':util[_0x0a9e('0xd')](_0x0a9e('0x41'),_0x24936a['remoteUri'],_0x381c37['id']),'method':_0x0a9e('0x42'),'body':_0x3cae});}exports[_0x0a9e('0x43')]=function(_0x274e8e,_0x43dd5b,_0x13cb1f,_0xeaa5e5,_0x2881b3,_0x45a9b8){var _0x23b089,_0x3da2cd;_0x45a9b8[_0x0a9e('0x16')]=intUtil[_0x0a9e('0x44')](_0x45a9b8[_0x0a9e('0x16')]);_0x45a9b8[_0x0a9e('0x45')]=intUtil[_0x0a9e('0x44')](_0x45a9b8['serverUrl']);if(_0x2881b3&&_0x2881b3['monitor_format']){logger[_0x0a9e('0xb')](_0x0a9e('0x46'),_0x0a9e('0x47'));_0x43dd5b[_0x0a9e('0x48')]=util[_0x0a9e('0xd')](_0x0a9e('0x49'),_0x45a9b8[_0x0a9e('0x45')],_0x43dd5b[_0x0a9e('0x4a')],md5(_0x43dd5b[_0x0a9e('0x4a')]));}else{_0x43dd5b[_0x0a9e('0x48')]='';}headers[_0x0a9e('0x4b')]=getAuth(_0x45a9b8);return getUser(_0x45a9b8,_0xeaa5e5[_0x0a9e('0x4c')])['then'](function(_0x117c99){_0x23b089=_0x117c99;logger[_0x0a9e('0xb')](_0x0a9e('0x4d'),_0x23b089['id']);return getEndUser(_0x45a9b8,_0x43dd5b[_0x0a9e('0x4e')],_0x43dd5b[_0x0a9e('0x4f')]);})[_0x0a9e('0x12')](function(_0x21eb86){_0x3da2cd=_0x21eb86;logger[_0x0a9e('0xb')]('The\x20Enduser\x20ID\x20is:',_0x3da2cd['id']);return getTicket(_0x45a9b8,_0x23b089,_0x3da2cd,_0x13cb1f,_0x43dd5b);})[_0x0a9e('0x12')](function(_0x48fd45){if(_0x48fd45){logger[_0x0a9e('0xb')](_0x0a9e('0x50'));logger[_0x0a9e('0xb')]('The\x20Ticket\x20ID\x20is:',_0x48fd45['id']);switch(_0x45a9b8[_0x0a9e('0x28')]){case _0x0a9e('0x51'):logger[_0x0a9e('0xb')](_0x0a9e('0x46'),_0x0a9e('0x52'));emit(util[_0x0a9e('0xd')](_0x0a9e('0x53'),_0xeaa5e5['name']),_0x0a9e('0x54'),{'recordId':_0x48fd45['id']});break;case _0x0a9e('0x55'):logger[_0x0a9e('0xb')](_0x0a9e('0x46'),_0x0a9e('0x56'));emit(util[_0x0a9e('0xd')](_0x0a9e('0x53'),_0xeaa5e5[_0x0a9e('0x35')]),_0x0a9e('0x57'),{'uri':util['format'](_0x0a9e('0x58'),_0x48fd45['id'])});break;default:logger[_0x0a9e('0x59')]('[QUEUE]','Desk\x20account\x20type\x20not\x20recognized');}}})['catch'](function(_0x1adfee){console[_0x0a9e('0x59')](_0x1adfee);logger[_0x0a9e('0x59')](_0x0a9e('0x46'),JSON[_0x0a9e('0x19')](_0x1adfee));});};exports[_0x0a9e('0x5a')]=function(_0x2e5165,_0x375c18,_0x5d38ae,_0x4b1b9f,_0x53975a,_0x39d77d,_0x204173){var _0x14d602,_0x5bb3ed;_0x39d77d[_0x0a9e('0x16')]=intUtil[_0x0a9e('0x44')](_0x39d77d['remoteUri']);_0x39d77d['serverUrl']=intUtil[_0x0a9e('0x44')](_0x39d77d['serverUrl']);if(_0x204173&&_0x204173[_0x0a9e('0x5b')]&&_0x204173['recordingFormat']!==_0x0a9e('0x5c')){logger[_0x0a9e('0xb')](_0x0a9e('0x5d'),'Recording\x20is\x20enabled!');_0x375c18[_0x0a9e('0x48')]=util[_0x0a9e('0xd')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x39d77d['serverUrl'],_0x375c18[_0x0a9e('0x4a')],md5(_0x375c18[_0x0a9e('0x4a')]));}headers['Authorization']=getAuth(_0x39d77d);return getUser(_0x39d77d,_0x4b1b9f[_0x0a9e('0x4c')])['then'](function(_0x211ef9){_0x14d602=_0x211ef9;logger['info'](_0x0a9e('0x4d'),_0x14d602['id']);return getEndUser(_0x39d77d,_0x375c18['destcalleridname'],_0x375c18['destcalleridnum']);})['then'](function(_0x2da03c){_0x5bb3ed=_0x2da03c;logger['info'](_0x0a9e('0x5e'),_0x5bb3ed['id']);return getTicket(_0x39d77d,_0x14d602,_0x5bb3ed,_0x5d38ae,_0x375c18);})[_0x0a9e('0x12')](function(_0x3cfd00){if(_0x3cfd00){logger[_0x0a9e('0xb')](_0x0a9e('0x50'));logger[_0x0a9e('0xb')](_0x0a9e('0x5f'),_0x3cfd00['id']);switch(_0x39d77d[_0x0a9e('0x28')]){case'integrationTab':logger[_0x0a9e('0xb')](_0x0a9e('0x46'),_0x0a9e('0x52'));emit(util[_0x0a9e('0xd')](_0x0a9e('0x53'),_0x4b1b9f[_0x0a9e('0x35')]),'trigger:desk:display',{'recordId':_0x3cfd00['id']});break;case _0x0a9e('0x55'):logger[_0x0a9e('0xb')]('[QUEUE]',_0x0a9e('0x56'));emit(util['format'](_0x0a9e('0x53'),_0x4b1b9f['name']),'trigger:browser:url',{'uri':util['format'](_0x0a9e('0x60'),_0x39d77d['remoteUri'],_0x3cfd00['id'])});break;default:logger[_0x0a9e('0x59')](_0x0a9e('0x5d'),_0x0a9e('0x61'));}}})[_0x0a9e('0x62')](function(_0x1cca9f){logger[_0x0a9e('0x59')]('[OUTBOUND]',JSON[_0x0a9e('0x19')](_0x1cca9f));});};exports['unmanaged']=function(_0xca4ade,_0x1f07cb,_0x51aaf7,_0x5adf8f,_0x453360,_0x156f1c){var _0x119677,_0x32e134;_0x156f1c['remoteUri']=intUtil[_0x0a9e('0x44')](_0x156f1c[_0x0a9e('0x16')]);_0x156f1c['serverUrl']=intUtil[_0x0a9e('0x44')](_0x156f1c[_0x0a9e('0x45')]);if(_0x453360&&_0x453360[_0x0a9e('0x63')]){logger[_0x0a9e('0xb')]('['+_0x1f07cb[_0x0a9e('0x64')]['toUpperCase']()+']',_0x0a9e('0x47'));_0x1f07cb[_0x0a9e('0x48')]=util[_0x0a9e('0xd')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x156f1c[_0x0a9e('0x45')],_0x1f07cb['uniqueid'],md5(_0x1f07cb['uniqueid']));}else{_0x1f07cb[_0x0a9e('0x48')]='';}headers[_0x0a9e('0x4b')]=getAuth(_0x156f1c);return getUser(_0x156f1c)[_0x0a9e('0x12')](function(_0x19c995){_0x119677=_0x19c995;logger[_0x0a9e('0xb')](_0x0a9e('0x4d'),_0x119677['id']);return getEndUser(_0x156f1c,_0x1f07cb[_0x0a9e('0x4e')],_0x1f07cb[_0x0a9e('0x4f')]);})[_0x0a9e('0x12')](function(_0x1cc4f3){_0x32e134=_0x1cc4f3;logger[_0x0a9e('0xb')](_0x0a9e('0x5e'),_0x32e134['id']);return getTicket(_0x156f1c,_0x119677,_0x32e134,_0x51aaf7,_0x1f07cb);})[_0x0a9e('0x12')](function(_0x2b8192){if(_0x2b8192){logger[_0x0a9e('0xb')](_0x0a9e('0x50'));logger[_0x0a9e('0xb')](_0x0a9e('0x5f'),_0x2b8192['id']);}})['catch'](function(_0x1b0b98){logger[_0x0a9e('0x59')]('['+_0x1f07cb[_0x0a9e('0x64')]['toUpperCase']()+']',JSON[_0x0a9e('0x19')](_0x1b0b98));});};
\ No newline at end of file
diff --git a/server/services/ami/trigger/integration/dynamics365.js b/server/services/ami/trigger/integration/dynamics365.js
index c8bac0e..92a12fc 100644
--- a/server/services/ami/trigger/integration/dynamics365.js
+++ b/server/services/ami/trigger/integration/dynamics365.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x5926=['enduserId','message','contacts?$select=telephone1','destcalleridnum','telephone1','contactid',']\x20Enduser\x20created!','forEach','string','nameField','customField','idField','substring','indexOf','content','ticketType','assign','getString','Subjects','Descriptions','/contacts(','/systemusers(','phonecall','phonecalls','callDirection','queue','Fields','odata-entityid','ticketId','format','%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s','user:%s','emit','trigger:browser:url','remoteUri','serverUrl','stripTrailingSlash','%s/api/data/v9.0/','https://login.microsoftonline.com/%s/oauth2/token','tenantId','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','Recording\x20is\x20enabled!','recordingURL','recordingFormat',']\x20The\x20User\x20ID\x20is:',']\x20The\x20User\x20email\x20is:',']\x20The\x20Enduser\x20ID\x20is:',']\x20The\x20%s\x20ID\x20is:\x20%s',']\x20Call\x20direction:\x20%s','unmanaged','Displaying\x20call\x20in\x20a\x20new\x20tab...','name',']\x20Error\x20running\x20Dynamics365\x20integration','bluebird','util','./util','md5','ioredis','../../../../config/environment','defaults','redis','POST','clientId','username','password','clientSecret','then','access_token','error','toUpperCase',']\x20Wrong\x20credentials!','GET','Bearer\x20','4.0','value','isNil','email','length','internalemailaddress','isdisabled',']\x20Agent\x20found\x20','userId','systemuserid','info','userEmail','catch','toLowerCase','outbound','calleridnum','contacts','headers','lastIndexOf'];(function(_0x1aa9ac,_0x4c4c7d){var _0x705dfb=function(_0x187d9e){while(--_0x187d9e){_0x1aa9ac['push'](_0x1aa9ac['shift']());}};_0x705dfb(++_0x4c4c7d);}(_0x5926,0xf3));var _0x6592=function(_0x146167,_0x57b75d){_0x146167=_0x146167-0x0;var _0x51b95b=_0x5926[_0x146167];return _0x51b95b;};'use strict';var _=require('lodash');var BPromise=require(_0x6592('0x0'));var rp=require('request-promise');var util=require(_0x6592('0x1'));var intUtil=require(_0x6592('0x2'));var md5=require(_0x6592('0x3'));var Redis=require(_0x6592('0x4'));var logger=require('../../../../config/logger')('dynamics365');var config=require(_0x6592('0x5'));config['redis']=_[_0x6592('0x6')](config[_0x6592('0x7')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x6592('0x7')]));function getAuthToken(_0x25b528,_0x2bd265,_0x3cfe46){var _0x5988e6={'method':_0x6592('0x8'),'uri':_0x2bd265,'form':{'client_id':_0x25b528[_0x6592('0x9')],'resource':_0x25b528['remoteUri'],'username':_0x25b528[_0x6592('0xa')],'password':_0x25b528[_0x6592('0xb')],'grant_type':'password','client_secret':_0x25b528[_0x6592('0xc')]},'json':!![]};return rp(_0x5988e6)[_0x6592('0xd')](function(_0x393331){return _0x393331[_0x6592('0xe')];})['catch'](function(_0x5d6ac3){logger[_0x6592('0xf')]('['+[_0x3cfe46[_0x6592('0x10')]()]+_0x6592('0x11'));return _0x5d6ac3['message'];});}function getUser(_0xa2fa56,_0x324541,_0x389a37,_0x311c7c,_0x171308,_0x2544f9){return new BPromise(function(_0x4714eb,_0x188c11){return getAuthToken(_0x324541,_0x311c7c,_0x2544f9)[_0x6592('0xd')](function(_0x400f52){var _0x434297={'method':_0x6592('0x12'),'uri':_0x171308+'systemusers?$select=internalemailaddress,isdisabled,systemuserid','headers':{'Authorization':_0x6592('0x13')+_0x400f52,'OData-Version':_0x6592('0x14')},'json':!![]};return rp(_0x434297);})['then'](function(_0x842e65){var _0x17912f=_0x842e65[_0x6592('0x15')];var _0x3df4f9=![];var _0x42ac27=null;if(!_[_0x6592('0x16')](_0x389a37)){if(intUtil['validateEmail'](_0x389a37['email'])){_0xa2fa56['userEmail']=_0x389a37[_0x6592('0x17')];for(_0x42ac27=0x0;_0x42ac27<_0x17912f[_0x6592('0x18')];_0x42ac27++){if(_0x17912f[_0x42ac27][_0x6592('0x19')]===_0x389a37[_0x6592('0x17')]&&!_0x17912f[_0x42ac27][_0x6592('0x1a')]){_0x3df4f9=!![];logger['info']('['+[_0x2544f9[_0x6592('0x10')]()]+_0x6592('0x1b')+_0x17912f[_0x42ac27]['systemuserid']+'!');_0xa2fa56[_0x6592('0x1c')]=_0x17912f[_0x42ac27][_0x6592('0x1d')];}}}}if(!_0x3df4f9){logger[_0x6592('0x1e')]('['+[_0x2544f9['toUpperCase']()]+']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');_0xa2fa56[_0x6592('0x1f')]=_0x324541[_0x6592('0xa')];for(_0x42ac27=0x0;_0x42ac27<_0x17912f[_0x6592('0x18')];_0x42ac27++){if(_0x17912f[_0x42ac27][_0x6592('0x19')]===_0x324541[_0x6592('0xa')]){_0xa2fa56[_0x6592('0x1c')]=_0x17912f[_0x42ac27][_0x6592('0x1d')];}}}_0x4714eb(_0xa2fa56);})[_0x6592('0x20')](function(_0x12ae89){_0x188c11(_0x12ae89['message']);});});}function createEndUser(_0x38f599,_0x481c7e,_0x38ccdc,_0x5a9f80,_0x4d1c7d,_0x19cb10){return new BPromise(function(_0xfe8110,_0x39bd46){return getAuthToken(_0x481c7e,_0x38ccdc,_0x19cb10)[_0x6592('0xd')](function(_0x3ddcfe){var _0x376861=_0x19cb10[_0x6592('0x21')]()===_0x6592('0x22')?_0x4d1c7d['destcalleridnum']:_0x4d1c7d[_0x6592('0x23')];var _0x5e4f95={'method':_0x6592('0x8'),'uri':_0x5a9f80+_0x6592('0x24'),'body':{'telephone1':_0x376861,'fullname':_0x376861,'firstname':_0x376861,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':'/systemusers('+_0x38f599[_0x6592('0x1c')]+')'},'headers':{'Authorization':_0x6592('0x13')+_0x3ddcfe,'OData-Version':_0x6592('0x14')},'json':!![],'resolveWithFullResponse':!![]};return rp(_0x5e4f95);})['then'](function(_0x4d2f7c){var _0x2aa69d=_0x4d2f7c[_0x6592('0x25')]['odata-entityid'];var _0xdffdc2=_0x2aa69d['substring'](_0x2aa69d['lastIndexOf']('(')+0x1,_0x2aa69d[_0x6592('0x26')](')'));_0x38f599[_0x6592('0x27')]=_0xdffdc2;_0xfe8110(_0x38f599);})[_0x6592('0x20')](function(_0x3ad346){_0x39bd46(_0x3ad346[_0x6592('0x28')]);});});}function getEndUser(_0x5caf4d,_0x57db1c,_0x230f86,_0x1b59cb,_0x49cfc8,_0x281537){return new BPromise(function(_0x26e2ba,_0x5ab325){return getAuthToken(_0x57db1c,_0x230f86,_0x281537)['then'](function(_0x1fd050){var _0x11c916={'method':_0x6592('0x12'),'uri':_0x1b59cb+_0x6592('0x29'),'headers':{'Authorization':'Bearer\x20'+_0x1fd050,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x11c916);})[_0x6592('0xd')](function(_0x260633){var _0x3afe8b=null;if(_0x260633){var _0x480b83=_0x260633[_0x6592('0x15')];var _0x3de3c6=![];for(_0x3afe8b=0x0;_0x3afe8b<_0x480b83[_0x6592('0x18')];_0x3afe8b++){var _0x32239b=_0x281537[_0x6592('0x21')]()==='outbound'?_0x49cfc8[_0x6592('0x2a')]:_0x49cfc8[_0x6592('0x23')];if(_0x480b83[_0x3afe8b][_0x6592('0x2b')]===_0x32239b){_0x3de3c6=!![];_0x5caf4d['enduserId']=_0x480b83[_0x3afe8b][_0x6592('0x2c')];}}if(_0x3de3c6){_0x26e2ba(_0x5caf4d);}else{return createEndUser(_0x5caf4d,_0x57db1c,_0x230f86,_0x1b59cb,_0x49cfc8,_0x281537)[_0x6592('0xd')](function(_0xadc24a){logger['info']('['+[_0x281537[_0x6592('0x10')]()]+_0x6592('0x2d'),_0xadc24a['enduserId']);_0x26e2ba(_0xadc24a);});}}else{return createEndUser(_0x5caf4d,_0x57db1c,_0x230f86,_0x1b59cb,_0x49cfc8,_0x281537)['then'](function(_0x5923ef){logger['info']('['+[_0x281537[_0x6592('0x10')]()]+']\x20Enduser\x20Created!',_0x5923ef['enduserId']);_0x26e2ba(_0x5923ef);});}});});}function getCustomFields(_0x9940df,_0x1fee97,_0x4d60cb){var _0x1a7d6e={};if(_0x9940df[_0x6592('0x18')]>0x0){_[_0x6592('0x2e')](_0x9940df,function(_0x1db04c){if(_0x1db04c['type']===_0x6592('0x2f')&&_0x1db04c[_0x6592('0x30')]&&!_0x1db04c[_0x6592('0x31')]){var _0x1b5e08=_0x1db04c[_0x6592('0x32')][_0x6592('0x21')]();var _0x59f795=_0x1b5e08[_0x6592('0x33')](0x0,_0x1b5e08['indexOf']('_'));var _0x4e89c3=_0x1b5e08[_0x6592('0x33')](_0x1b5e08[_0x6592('0x34')]('_')+0x1);if(_0x59f795===_0x4d60cb){_0x1a7d6e[_0x4e89c3]=_0x1db04c[_0x6592('0x35')];}}});}return _0x1a7d6e;}function getTicket(_0x109b0b,_0x423efd,_0x206bb6,_0x45cd25,_0x5360f5,_0x4b0fac,_0x2349f2){return new BPromise(function(_0xbe9db1,_0x29d4c8){var _0x343ae3;return getAuthToken(_0x423efd,_0x206bb6,_0x2349f2)[_0x6592('0xd')](function(_0xfc7fd4){if(_0x4b0fac[_0x6592('0x36')]==='incident'){_0x343ae3={'method':_0x6592('0x8'),'uri':_0x45cd25+'incidents','body':Object[_0x6592('0x37')]({},{'title':intUtil[_0x6592('0x38')](_0x4b0fac[_0x6592('0x39')],_0x5360f5,'\x20'),'description':intUtil['getString'](_0x4b0fac[_0x6592('0x3a')],_0x5360f5,'\x0a'),'customerid_contact@odata.bind':_0x6592('0x3b')+_0x109b0b[_0x6592('0x27')]+')','ownerid@odata.bind':_0x6592('0x3c')+_0x109b0b['userId']+')','caseorigincode':'1'},getCustomFields(_0x4b0fac['Fields'],_0x5360f5,_0x4b0fac[_0x6592('0x36')])),'headers':{'Authorization':_0x6592('0x13')+_0xfc7fd4,'OData-Version':_0x6592('0x14')},'json':!![],'resolveWithFullResponse':!![]};}if(_0x4b0fac[_0x6592('0x36')]===_0x6592('0x3d')){_0x343ae3={'method':'POST','uri':_0x45cd25+_0x6592('0x3e'),'body':Object[_0x6592('0x37')]({},{'subject':intUtil[_0x6592('0x38')](_0x4b0fac['Subjects'],_0x5360f5,'\x20'),'phonenumber':String(_0x5360f5['calleridnum']),'description':intUtil[_0x6592('0x38')](_0x4b0fac[_0x6592('0x3a')],_0x5360f5,'\x0a'),'regardingobjectid_contact@odata.bind':_0x6592('0x3b')+_0x109b0b[_0x6592('0x27')]+')','ownerid@odata.bind':_0x6592('0x3c')+_0x109b0b[_0x6592('0x1c')]+')','directioncode':_0x109b0b[_0x6592('0x3f')]===_0x6592('0x40')?![]:!![],'phonecall_activity_parties':[{'partyid_systemuser@odata.bind':_0x6592('0x3c')+_0x109b0b['userId']+')','participationtypemask':_0x109b0b['callDirection']===_0x6592('0x40')?0x2:0x1},{'partyid_contact@odata.bind':'/contacts('+_0x109b0b[_0x6592('0x27')]+')','participationtypemask':_0x109b0b[_0x6592('0x3f')]==='queue'?0x1:0x2}]},getCustomFields(_0x4b0fac[_0x6592('0x41')],_0x5360f5,_0x4b0fac[_0x6592('0x36')])),'headers':{'Authorization':'Bearer\x20'+_0xfc7fd4,'OData-Version':_0x6592('0x14')},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x343ae3);})['then'](function(_0x184d97){var _0x4cf085=_0x184d97[_0x6592('0x25')][_0x6592('0x42')];var _0x323a73=_0x4cf085[_0x6592('0x33')](_0x4cf085[_0x6592('0x26')]('(')+0x1,_0x4cf085['lastIndexOf'](')'));_0x109b0b[_0x6592('0x43')]=_0x323a73;_0xbe9db1(_0x109b0b);})[_0x6592('0x20')](function(_0x5a724a){_0x29d4c8(_0x5a724a[_0x6592('0x28')]);});});}function emit(_0x54c1e1,_0x4deeba,_0x123b28,_0x37c1ef){var _0x14141c={'uri':util[_0x6592('0x44')](_0x6592('0x45'),_0x54c1e1,_0x123b28,_0x37c1ef)};io['to'](util[_0x6592('0x44')](_0x6592('0x46'),_0x4deeba))[_0x6592('0x47')](_0x6592('0x48'),_0x14141c);}exports['cs']=function(_0x3ec76b,_0x6fab4d,_0x5b17b9,_0x35de82,_0x4f8277,_0x314be4,_0x430c8c,_0x5e1127){var _0xd30173={};_0x314be4[_0x6592('0x49')]=intUtil['stripTrailingSlash'](_0x314be4['remoteUri']);_0x314be4[_0x6592('0x4a')]=intUtil[_0x6592('0x4b')](_0x314be4['serverUrl']);_0xd30173[_0x6592('0x3f')]=_0x5e1127===_0x6592('0x40')||_0x5e1127==='unmanaged'?'queue':_0x6592('0x22');var _0x4e81fe=util[_0x6592('0x44')](_0x6592('0x4c'),_0x314be4[_0x6592('0x49')]);var _0x41764f=util['format'](_0x6592('0x4d'),_0x314be4[_0x6592('0x4e')]);var _0x4b51e1=util[_0x6592('0x44')](_0x6592('0x4f'),_0x314be4[_0x6592('0x4a')],_0x6fab4d[_0x6592('0x50')],md5(_0x6fab4d['uniqueid']));if(_0x4f8277&&_0x4f8277[_0x6592('0x51')]){logger[_0x6592('0x1e')]('[QUEUE]',_0x6592('0x52'));_0x6fab4d[_0x6592('0x53')]=_0x4b51e1;}else if(_0x430c8c&&_0x430c8c[_0x6592('0x54')]&&_0x430c8c[_0x6592('0x54')]!=='none'){logger[_0x6592('0x1e')]('[OUTBOUND]',_0x6592('0x52'));_0x6fab4d[_0x6592('0x53')]=_0x4b51e1;}else{_0x6fab4d[_0x6592('0x53')]='';}return getUser(_0xd30173,_0x314be4,_0x35de82,_0x41764f,_0x4e81fe,_0x5e1127)['then'](function(_0x2b87e9){logger[_0x6592('0x1e')]('['+_0x5e1127[_0x6592('0x10')]()+_0x6592('0x55'),_0x2b87e9[_0x6592('0x1c')]);logger[_0x6592('0x1e')]('['+_0x5e1127[_0x6592('0x10')]()+_0x6592('0x56'),_0x2b87e9[_0x6592('0x1f')]);return getEndUser(_0x2b87e9,_0x314be4,_0x41764f,_0x4e81fe,_0x6fab4d,_0x5e1127);})['then'](function(_0x316206){logger[_0x6592('0x1e')]('['+_0x5e1127[_0x6592('0x10')]()+_0x6592('0x57'),_0x316206[_0x6592('0x27')]);logger['info']('['+_0x5e1127[_0x6592('0x10')]()+']\x20The\x20Enduser\x20phone\x20is:',_0x6fab4d['calleridnum']);return getTicket(_0x316206,_0x314be4,_0x41764f,_0x4e81fe,_0x6fab4d,_0x5b17b9,_0x5e1127);})[_0x6592('0xd')](function(_0x51d06b){logger[_0x6592('0x1e')](util[_0x6592('0x44')]('['+_0x5e1127['toUpperCase']()+_0x6592('0x58'),_0x5b17b9[_0x6592('0x36')],_0x51d06b['ticketId']));logger[_0x6592('0x1e')](util['format']('['+_0x5e1127[_0x6592('0x10')]()+_0x6592('0x59'),_0x5e1127));if(_0x5e1127!==_0x6592('0x5a')){logger[_0x6592('0x1e')]('['+_0x5e1127[_0x6592('0x10')]()+']',_0x6592('0x5b'));emit(_0x314be4[_0x6592('0x49')],_0x35de82[_0x6592('0x5c')],_0x5b17b9[_0x6592('0x36')],_0x51d06b[_0x6592('0x43')]);}})['catch'](function(_0x4fce95){logger[_0x6592('0xf')]('['+_0x5e1127[_0x6592('0x10')]()+_0x6592('0x5d'),util['inspect'](_0x4fce95,{'showHidden':!![],'depth':null}));});};
\ No newline at end of file
+var _0x0048=['stripTrailingSlash','serverUrl','tenantId','monitor_format','[QUEUE]','recordingURL','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!',']\x20The\x20User\x20email\x20is:',']\x20The\x20Enduser\x20ID\x20is:',']\x20The\x20%s\x20ID\x20is:\x20%s',']\x20Call\x20direction:\x20%s','unmanaged','Displaying\x20call\x20in\x20a\x20new\x20tab...','name','error','inspect','lodash','bluebird','request-promise','util','md5','ioredis','../../../../config/logger','../../../../config/environment','redis','defaults','localhost','socket.io-emitter','POST','clientId','remoteUri','username','password','clientSecret','access_token','catch','toUpperCase',']\x20Wrong\x20credentials!','GET','systemusers?$select=internalemailaddress,isdisabled,systemuserid','Bearer\x20','then','isNil','validateEmail','email','userEmail','length','isdisabled','info','systemuserid','userId',']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','internalemailaddress','toLowerCase','destcalleridnum','calleridnum','/systemusers(','headers','odata-entityid','substring','lastIndexOf','message','contacts?$select=telephone1','4.0','value','outbound','telephone1','enduserId','contactid',']\x20Enduser\x20Created!','forEach','type','string','nameField','customField','idField','indexOf','incident','incidents','assign','getString','Subjects','Descriptions','/contacts(','Fields','phonecall','phonecalls','callDirection','queue','ticketType','ticketId','format','user:%s','trigger:browser:url'];(function(_0x452583,_0x1d4bb6){var _0x2347c9=function(_0x3b3374){while(--_0x3b3374){_0x452583['push'](_0x452583['shift']());}};_0x2347c9(++_0x1d4bb6);}(_0x0048,0x197));var _0x8004=function(_0x591781,_0x8e0ed2){_0x591781=_0x591781-0x0;var _0x315bd9=_0x0048[_0x591781];return _0x315bd9;};'use strict';var _=require(_0x8004('0x0'));var BPromise=require(_0x8004('0x1'));var rp=require(_0x8004('0x2'));var util=require(_0x8004('0x3'));var intUtil=require('./util');var md5=require(_0x8004('0x4'));var Redis=require(_0x8004('0x5'));var logger=require(_0x8004('0x6'))('dynamics365');var config=require(_0x8004('0x7'));config[_0x8004('0x8')]=_[_0x8004('0x9')](config[_0x8004('0x8')],{'host':_0x8004('0xa'),'port':0x18eb});var io=require(_0x8004('0xb'))(new Redis(config[_0x8004('0x8')]));function getAuthToken(_0x102e14,_0x122e62,_0x42d9de){var _0x46fecb={'method':_0x8004('0xc'),'uri':_0x122e62,'form':{'client_id':_0x102e14[_0x8004('0xd')],'resource':_0x102e14[_0x8004('0xe')],'username':_0x102e14[_0x8004('0xf')],'password':_0x102e14[_0x8004('0x10')],'grant_type':_0x8004('0x10'),'client_secret':_0x102e14[_0x8004('0x11')]},'json':!![]};return rp(_0x46fecb)['then'](function(_0x1e7ae9){return _0x1e7ae9[_0x8004('0x12')];})[_0x8004('0x13')](function(_0x384c28){logger['error']('['+[_0x42d9de[_0x8004('0x14')]()]+_0x8004('0x15'));return _0x384c28['message'];});}function getUser(_0x5ddc5e,_0x1652aa,_0x4f8254,_0x1ae7c0,_0xfff7dd,_0x23f0b3){return new BPromise(function(_0x2c8f2c,_0x6d0e0d){return getAuthToken(_0x1652aa,_0x1ae7c0,_0x23f0b3)['then'](function(_0x5be178){var _0x31268={'method':_0x8004('0x16'),'uri':_0xfff7dd+_0x8004('0x17'),'headers':{'Authorization':_0x8004('0x18')+_0x5be178,'OData-Version':'4.0'},'json':!![]};return rp(_0x31268);})[_0x8004('0x19')](function(_0x52e426){var _0x40dd0c=_0x52e426['value'];var _0x115559=![];var _0x3d1696=null;if(!_[_0x8004('0x1a')](_0x4f8254)){if(intUtil[_0x8004('0x1b')](_0x4f8254[_0x8004('0x1c')])){_0x5ddc5e[_0x8004('0x1d')]=_0x4f8254['email'];for(_0x3d1696=0x0;_0x3d1696<_0x40dd0c[_0x8004('0x1e')];_0x3d1696++){if(_0x40dd0c[_0x3d1696]['internalemailaddress']===_0x4f8254['email']&&!_0x40dd0c[_0x3d1696][_0x8004('0x1f')]){_0x115559=!![];logger[_0x8004('0x20')]('['+[_0x23f0b3['toUpperCase']()]+']\x20Agent\x20found\x20'+_0x40dd0c[_0x3d1696][_0x8004('0x21')]+'!');_0x5ddc5e[_0x8004('0x22')]=_0x40dd0c[_0x3d1696][_0x8004('0x21')];}}}}if(!_0x115559){logger['info']('['+[_0x23f0b3[_0x8004('0x14')]()]+_0x8004('0x23'));_0x5ddc5e[_0x8004('0x1d')]=_0x1652aa[_0x8004('0xf')];for(_0x3d1696=0x0;_0x3d1696<_0x40dd0c[_0x8004('0x1e')];_0x3d1696++){if(_0x40dd0c[_0x3d1696][_0x8004('0x24')]===_0x1652aa[_0x8004('0xf')]){_0x5ddc5e[_0x8004('0x22')]=_0x40dd0c[_0x3d1696][_0x8004('0x21')];}}}_0x2c8f2c(_0x5ddc5e);})[_0x8004('0x13')](function(_0x2e6e75){_0x6d0e0d(_0x2e6e75['message']);});});}function createEndUser(_0x101e32,_0x351d11,_0x5018b7,_0x549efb,_0x2c0524,_0x4768d0){return new BPromise(function(_0x26b5fb,_0x573dc5){return getAuthToken(_0x351d11,_0x5018b7,_0x4768d0)[_0x8004('0x19')](function(_0x20fe8e){var _0x3d5251=_0x4768d0[_0x8004('0x25')]()==='outbound'?_0x2c0524[_0x8004('0x26')]:_0x2c0524[_0x8004('0x27')];var _0x19ca91={'method':_0x8004('0xc'),'uri':_0x549efb+'contacts','body':{'telephone1':_0x3d5251,'fullname':_0x3d5251,'firstname':_0x3d5251,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':_0x8004('0x28')+_0x101e32['userId']+')'},'headers':{'Authorization':_0x8004('0x18')+_0x20fe8e,'OData-Version':'4.0'},'json':!![],'resolveWithFullResponse':!![]};return rp(_0x19ca91);})[_0x8004('0x19')](function(_0x4e75ff){var _0x58aad6=_0x4e75ff[_0x8004('0x29')][_0x8004('0x2a')];var _0x37bc4f=_0x58aad6[_0x8004('0x2b')](_0x58aad6['lastIndexOf']('(')+0x1,_0x58aad6[_0x8004('0x2c')](')'));_0x101e32['enduserId']=_0x37bc4f;_0x26b5fb(_0x101e32);})[_0x8004('0x13')](function(_0x9155f4){_0x573dc5(_0x9155f4[_0x8004('0x2d')]);});});}function getEndUser(_0xfbf077,_0x2a71eb,_0xf74ab1,_0x275318,_0x531aa1,_0xa10781){return new BPromise(function(_0x47c75c,_0x4d3852){return getAuthToken(_0x2a71eb,_0xf74ab1,_0xa10781)[_0x8004('0x19')](function(_0x2c7ec5){var _0x7990ee={'method':_0x8004('0x16'),'uri':_0x275318+_0x8004('0x2e'),'headers':{'Authorization':_0x8004('0x18')+_0x2c7ec5,'If-None-Match':null,'OData-Version':_0x8004('0x2f')},'json':!![]};return rp(_0x7990ee);})[_0x8004('0x19')](function(_0x2c9f7c){var _0x5712ee=null;if(_0x2c9f7c){var _0x4c8c8f=_0x2c9f7c[_0x8004('0x30')];var _0x28a968=![];for(_0x5712ee=0x0;_0x5712ee<_0x4c8c8f[_0x8004('0x1e')];_0x5712ee++){var _0x43537e=_0xa10781[_0x8004('0x25')]()===_0x8004('0x31')?_0x531aa1[_0x8004('0x26')]:_0x531aa1[_0x8004('0x27')];if(_0x4c8c8f[_0x5712ee][_0x8004('0x32')]===_0x43537e){_0x28a968=!![];_0xfbf077[_0x8004('0x33')]=_0x4c8c8f[_0x5712ee][_0x8004('0x34')];}}if(_0x28a968){_0x47c75c(_0xfbf077);}else{return createEndUser(_0xfbf077,_0x2a71eb,_0xf74ab1,_0x275318,_0x531aa1,_0xa10781)[_0x8004('0x19')](function(_0x543390){logger[_0x8004('0x20')]('['+[_0xa10781['toUpperCase']()]+']\x20Enduser\x20created!',_0x543390['enduserId']);_0x47c75c(_0x543390);});}}else{return createEndUser(_0xfbf077,_0x2a71eb,_0xf74ab1,_0x275318,_0x531aa1,_0xa10781)[_0x8004('0x19')](function(_0x1b12ac){logger[_0x8004('0x20')]('['+[_0xa10781[_0x8004('0x14')]()]+_0x8004('0x35'),_0x1b12ac[_0x8004('0x33')]);_0x47c75c(_0x1b12ac);});}});});}function getCustomFields(_0x3e266e,_0x3cf294,_0x4a7a1d){var _0x3875eb={};if(_0x3e266e['length']>0x0){_[_0x8004('0x36')](_0x3e266e,function(_0x6e3678){if(_0x6e3678[_0x8004('0x37')]===_0x8004('0x38')&&_0x6e3678[_0x8004('0x39')]&&!_0x6e3678[_0x8004('0x3a')]){var _0xb6ecdb=_0x6e3678[_0x8004('0x3b')][_0x8004('0x25')]();var _0x3bf49d=_0xb6ecdb[_0x8004('0x2b')](0x0,_0xb6ecdb[_0x8004('0x3c')]('_'));var _0x17cd27=_0xb6ecdb[_0x8004('0x2b')](_0xb6ecdb[_0x8004('0x3c')]('_')+0x1);if(_0x3bf49d===_0x4a7a1d){_0x3875eb[_0x17cd27]=_0x6e3678['content'];}}});}return _0x3875eb;}function getTicket(_0x271b08,_0x226bbc,_0x34901f,_0x286e3b,_0x4c1279,_0x547bb7,_0x297596){return new BPromise(function(_0x38b8ef,_0x11a67e){var _0x1e0693;return getAuthToken(_0x226bbc,_0x34901f,_0x297596)[_0x8004('0x19')](function(_0x48be01){if(_0x547bb7['ticketType']===_0x8004('0x3d')){_0x1e0693={'method':_0x8004('0xc'),'uri':_0x286e3b+_0x8004('0x3e'),'body':Object[_0x8004('0x3f')]({},{'title':intUtil[_0x8004('0x40')](_0x547bb7[_0x8004('0x41')],_0x4c1279,'\x20'),'description':intUtil['getString'](_0x547bb7[_0x8004('0x42')],_0x4c1279,'\x0a'),'customerid_contact@odata.bind':_0x8004('0x43')+_0x271b08[_0x8004('0x33')]+')','ownerid@odata.bind':_0x8004('0x28')+_0x271b08['userId']+')','caseorigincode':'1'},getCustomFields(_0x547bb7[_0x8004('0x44')],_0x4c1279,_0x547bb7['ticketType'])),'headers':{'Authorization':'Bearer\x20'+_0x48be01,'OData-Version':'4.0'},'json':!![],'resolveWithFullResponse':!![]};}if(_0x547bb7['ticketType']===_0x8004('0x45')){_0x1e0693={'method':_0x8004('0xc'),'uri':_0x286e3b+_0x8004('0x46'),'body':Object['assign']({},{'subject':intUtil[_0x8004('0x40')](_0x547bb7[_0x8004('0x41')],_0x4c1279,'\x20'),'phonenumber':String(_0x4c1279['calleridnum']),'description':intUtil[_0x8004('0x40')](_0x547bb7[_0x8004('0x42')],_0x4c1279,'\x0a'),'regardingobjectid_contact@odata.bind':'/contacts('+_0x271b08[_0x8004('0x33')]+')','ownerid@odata.bind':_0x8004('0x28')+_0x271b08[_0x8004('0x22')]+')','directioncode':_0x271b08[_0x8004('0x47')]===_0x8004('0x48')?![]:!![],'phonecall_activity_parties':[{'partyid_systemuser@odata.bind':_0x8004('0x28')+_0x271b08['userId']+')','participationtypemask':_0x271b08[_0x8004('0x47')]==='queue'?0x2:0x1},{'partyid_contact@odata.bind':'/contacts('+_0x271b08[_0x8004('0x33')]+')','participationtypemask':_0x271b08['callDirection']===_0x8004('0x48')?0x1:0x2}]},getCustomFields(_0x547bb7[_0x8004('0x44')],_0x4c1279,_0x547bb7[_0x8004('0x49')])),'headers':{'Authorization':_0x8004('0x18')+_0x48be01,'OData-Version':_0x8004('0x2f')},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x1e0693);})['then'](function(_0x30ea72){var _0x3c18cb=_0x30ea72[_0x8004('0x29')][_0x8004('0x2a')];var _0x2e30ca=_0x3c18cb[_0x8004('0x2b')](_0x3c18cb['lastIndexOf']('(')+0x1,_0x3c18cb[_0x8004('0x2c')](')'));_0x271b08[_0x8004('0x4a')]=_0x2e30ca;_0x38b8ef(_0x271b08);})[_0x8004('0x13')](function(_0x508c91){_0x11a67e(_0x508c91['message']);});});}function emit(_0x5dbcef,_0x40dd9b,_0x1ec678,_0xae164c){var _0x10a08d={'uri':util[_0x8004('0x4b')]('%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s',_0x5dbcef,_0x1ec678,_0xae164c)};io['to'](util['format'](_0x8004('0x4c'),_0x40dd9b))['emit'](_0x8004('0x4d'),_0x10a08d);}exports['cs']=function(_0x4f1740,_0x13b9b6,_0x30b5a0,_0x27df58,_0x457488,_0x4d7104,_0xb1cefe,_0x292016){var _0x19ae32={};_0x4d7104[_0x8004('0xe')]=intUtil[_0x8004('0x4e')](_0x4d7104[_0x8004('0xe')]);_0x4d7104[_0x8004('0x4f')]=intUtil[_0x8004('0x4e')](_0x4d7104[_0x8004('0x4f')]);_0x19ae32[_0x8004('0x47')]=_0x292016===_0x8004('0x48')||_0x292016==='unmanaged'?_0x8004('0x48'):_0x8004('0x31');var _0x4b2da2=util[_0x8004('0x4b')]('%s/api/data/v9.0/',_0x4d7104[_0x8004('0xe')]);var _0x1fa167=util[_0x8004('0x4b')]('https://login.microsoftonline.com/%s/oauth2/token',_0x4d7104[_0x8004('0x50')]);var _0x4c5580=util[_0x8004('0x4b')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x4d7104[_0x8004('0x4f')],_0x13b9b6['uniqueid'],md5(_0x13b9b6['uniqueid']));if(_0x457488&&_0x457488[_0x8004('0x51')]){logger['info'](_0x8004('0x52'),'Recording\x20is\x20enabled!');_0x13b9b6[_0x8004('0x53')]=_0x4c5580;}else if(_0xb1cefe&&_0xb1cefe[_0x8004('0x54')]&&_0xb1cefe['recordingFormat']!==_0x8004('0x55')){logger[_0x8004('0x20')](_0x8004('0x56'),_0x8004('0x57'));_0x13b9b6['recordingURL']=_0x4c5580;}else{_0x13b9b6['recordingURL']='';}return getUser(_0x19ae32,_0x4d7104,_0x27df58,_0x1fa167,_0x4b2da2,_0x292016)[_0x8004('0x19')](function(_0x5c0690){logger[_0x8004('0x20')]('['+_0x292016['toUpperCase']()+']\x20The\x20User\x20ID\x20is:',_0x5c0690[_0x8004('0x22')]);logger['info']('['+_0x292016[_0x8004('0x14')]()+_0x8004('0x58'),_0x5c0690[_0x8004('0x1d')]);return getEndUser(_0x5c0690,_0x4d7104,_0x1fa167,_0x4b2da2,_0x13b9b6,_0x292016);})[_0x8004('0x19')](function(_0x3a375a){logger[_0x8004('0x20')]('['+_0x292016['toUpperCase']()+_0x8004('0x59'),_0x3a375a[_0x8004('0x33')]);logger[_0x8004('0x20')]('['+_0x292016[_0x8004('0x14')]()+']\x20The\x20Enduser\x20phone\x20is:',_0x13b9b6['calleridnum']);return getTicket(_0x3a375a,_0x4d7104,_0x1fa167,_0x4b2da2,_0x13b9b6,_0x30b5a0,_0x292016);})[_0x8004('0x19')](function(_0x135c17){logger[_0x8004('0x20')](util[_0x8004('0x4b')]('['+_0x292016[_0x8004('0x14')]()+_0x8004('0x5a'),_0x30b5a0['ticketType'],_0x135c17['ticketId']));logger[_0x8004('0x20')](util[_0x8004('0x4b')]('['+_0x292016[_0x8004('0x14')]()+_0x8004('0x5b'),_0x292016));if(_0x292016!==_0x8004('0x5c')){logger['info']('['+_0x292016[_0x8004('0x14')]()+']',_0x8004('0x5d'));emit(_0x4d7104[_0x8004('0xe')],_0x27df58[_0x8004('0x5e')],_0x30b5a0[_0x8004('0x49')],_0x135c17['ticketId']);}})[_0x8004('0x13')](function(_0x214411){logger[_0x8004('0x5f')]('['+_0x292016['toUpperCase']()+']\x20Error\x20running\x20Dynamics365\x20integration',util[_0x8004('0x60')](_0x214411,{'showHidden':!![],'depth':null}));});};
\ No newline at end of file
diff --git a/server/services/ami/trigger/integration/freshdesk.js b/server/services/ami/trigger/integration/freshdesk.js
index 1dd5512..15f97e7 100644
--- a/server/services/ami/trigger/integration/freshdesk.js
+++ b/server/services/ami/trigger/integration/freshdesk.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7cf7=['Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','The\x20User\x20ID\x20is:','The\x20Enduser\x20ID\x20is:','user:%s','trigger:browser:url','catch','error','outbound','serverUrl','recordingFormat','The\x20Ticket\x20ID\x20is:','[OUTBOUND]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','%s/helpdesk/tickets/%d','unmanaged','lastevent','toUpperCase','md5','ioredis','./util','../../../../config/environment','freshdesk','redis','defaults','localhost','socket.io-emitter','emit','info','Creating\x20new\x20ticket...','format','Caller\x20-\x20%s','calleridname','calleridnum','Subjects','getString','Descriptions',' ','Tags','name','Fields','mapValues','keyBy','custom_fields','value','%s/api/v2/tickets','remoteUri','then','Ticket\x20created!','validateEmail','%s/api/v2/agents','length','find','email','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/api/v2/agents/me','Admin\x20account\x20selected.','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','Searching\x20enduser\x20with\x20phone','%s/api/v2/contacts','Enduser\x20found!','Enduser\x20created.','Basic\x20%s','apiKey','debug','[HTTP]','stringify','map','type','nameField','customField','toLowerCase','content','string','idField','push','variableName','toString','customVariable','Variable','queue','stripTrailingSlash','monitor_format','[QUEUE]'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x7cf7,0x11a));var _0x77cf=function(_0x2843d0,_0x3635fb){_0x2843d0=_0x2843d0-0x0;var _0x87965f=_0x7cf7[_0x2843d0];return _0x87965f;};'use strict';var _=require('lodash');var rp=require('request-promise');var md5=require(_0x77cf('0x0'));var util=require('util');var Redis=require(_0x77cf('0x1'));var intUtil=require(_0x77cf('0x2'));var config=require(_0x77cf('0x3'));var logger=require('../../../../config/logger')(_0x77cf('0x4'));config[_0x77cf('0x5')]=_[_0x77cf('0x6')](config[_0x77cf('0x5')],{'host':_0x77cf('0x7'),'port':0x18eb});var io=require(_0x77cf('0x8'))(new Redis(config['redis']));var headers={'Content-Type':'application/json','Accept':'application/json'};function emit(_0x310690,_0x32ef1d,_0x4bc571){io['to'](_0x310690)[_0x77cf('0x9')](_0x32ef1d,_0x4bc571);}function getTicket(_0x3491d0,_0x30ebc6,_0x462d5,_0x5b0c85,_0x54ece5){logger[_0x77cf('0xa')](_0x77cf('0xb'));var _0x101ad2=_['merge']({'responder_id':_0x30ebc6['id'],'requester_id':_0x462d5['id'],'name':util[_0x77cf('0xc')](_0x77cf('0xd'),_0x54ece5[_0x77cf('0xe')]),'phone':_0x54ece5[_0x77cf('0xf')],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil['getString'](_0x5b0c85[_0x77cf('0x10')],_0x54ece5,'\x20'),'description':intUtil[_0x77cf('0x11')](_0x5b0c85[_0x77cf('0x12')],_0x54ece5,_0x77cf('0x13')),'tags':getTags(_0x5b0c85[_0x77cf('0x14')],_0x77cf('0x15'))},getCustomFields(_0x5b0c85[_0x77cf('0x16')],_0x54ece5));_0x101ad2['custom_fields']=_[_0x77cf('0x17')](_[_0x77cf('0x18')](_0x101ad2[_0x77cf('0x19')],'id'),_0x77cf('0x1a'));return request({'uri':util[_0x77cf('0xc')](_0x77cf('0x1b'),_0x3491d0[_0x77cf('0x1c')]),'method':'POST','body':_0x101ad2})[_0x77cf('0x1d')](function(_0x5b0817){logger[_0x77cf('0xa')](_0x77cf('0x1e'));return _0x5b0817;});}function getUser(_0x334ff5,_0x53864c){if(intUtil[_0x77cf('0x1f')](_0x53864c)){return request({'uri':util['format'](_0x77cf('0x20'),_0x334ff5[_0x77cf('0x1c')]),'qs':{'email':_0x53864c}})[_0x77cf('0x1d')](function(_0x204698){if(_0x204698[_0x77cf('0x21')]){logger[_0x77cf('0xa')]('Agent\x20found!');return _[_0x77cf('0x22')](_0x204698,function(_0x2afe67){return _0x2afe67['contact'][_0x77cf('0x23')]===_0x53864c;});}else{logger['info'](_0x77cf('0x24'));return request({'uri':util[_0x77cf('0xc')](_0x77cf('0x25'),_0x334ff5[_0x77cf('0x1c')])})['then'](function(_0x1e32e3){logger[_0x77cf('0xa')](_0x77cf('0x26'));return _0x1e32e3;});}});}else{logger[_0x77cf('0xa')](_0x77cf('0x27'));return request({'uri':util[_0x77cf('0xc')](_0x77cf('0x25'),_0x334ff5[_0x77cf('0x1c')])})['then'](function(_0x2a4499){logger[_0x77cf('0xa')](_0x77cf('0x26'));return _0x2a4499;});}}function getEndUser(_0x5e3021,_0x8e1ca8,_0x58c8f0){logger[_0x77cf('0xa')](_0x77cf('0x28'),_0x58c8f0);return request({'uri':util['format'](_0x77cf('0x29'),_0x5e3021['remoteUri']),'qs':{'phone':_0x58c8f0}})[_0x77cf('0x1d')](function(_0x268f64){if(_0x268f64[_0x77cf('0x21')]){logger[_0x77cf('0xa')](_0x77cf('0x2a'));return _[_0x77cf('0x22')](_0x268f64,{'phone':_0x58c8f0});}else{logger[_0x77cf('0xa')]('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');return request({'uri':util[_0x77cf('0xc')](_0x77cf('0x29'),_0x5e3021[_0x77cf('0x1c')]),'method':'POST','body':{'name':_0x8e1ca8,'phone':_0x58c8f0}})['then'](function(_0x3b4e5b){logger[_0x77cf('0xa')](_0x77cf('0x2b'));return _0x3b4e5b;});}});}function getAuth(_0x43efa0){return util['format'](_0x77cf('0x2c'),new Buffer(_0x43efa0[_0x77cf('0x2d')]+':X')['toString']('base64'));}function request(_0x2fc33c){logger[_0x77cf('0x2e')](_0x77cf('0x2f'),JSON[_0x77cf('0x30')](_0x2fc33c));return rp(_[_0x77cf('0x6')](_0x2fc33c,{'method':'GET','headers':headers,'json':!![]}));}function getTags(_0x2bef32,_0x2cea3b){var _0x37bdf3=[];if(_0x2bef32&&_0x2bef32['length']>0x0){_0x37bdf3=_[_0x77cf('0x31')](_0x2bef32,_0x2cea3b);}return _0x37bdf3;}function getCustomFields(_0x3acee8,_0x5eb1fa){var _0x497041=[];var _0x10f8d4={'custom_fields':[]};if(_0x3acee8['length']>0x0){_['forEach'](_0x3acee8,function(_0x4d816e){if(_0x4d816e[_0x77cf('0x32')]==='string'&&_0x4d816e[_0x77cf('0x33')]&&!_0x4d816e[_0x77cf('0x34')]){_0x10f8d4[_0x4d816e[_0x77cf('0x33')][_0x77cf('0x35')]()]=_0x4d816e[_0x77cf('0x36')]['toString']();}else if(_0x4d816e[_0x77cf('0x32')]===_0x77cf('0x37')&&_0x4d816e[_0x77cf('0x38')]&&_0x4d816e[_0x77cf('0x34')]){_0x10f8d4['custom_fields'][_0x77cf('0x39')]({'id':_0x4d816e['idField'],'value':_0x4d816e[_0x77cf('0x36')]['toString']()});}else if(_0x4d816e[_0x77cf('0x32')]==='variable'&&_0x4d816e['variableName']&&_0x4d816e[_0x77cf('0x38')]&&_0x4d816e['customField']){_0x5eb1fa[_0x4d816e[_0x77cf('0x3a')]]&&_0x10f8d4[_0x77cf('0x19')]['push']({'id':_0x4d816e[_0x77cf('0x38')],'value':_0x5eb1fa[_0x4d816e[_0x77cf('0x3a')]][_0x77cf('0x3b')]()});}else if(_0x4d816e[_0x77cf('0x32')]===_0x77cf('0x3c')&&_0x4d816e[_0x77cf('0x3d')]&&_0x4d816e[_0x77cf('0x3d')][_0x77cf('0x15')]&&_0x4d816e['idField']&&_0x4d816e[_0x77cf('0x34')]){_0x5eb1fa[_0x4d816e['Variable'][_0x77cf('0x15')]['toLowerCase']()]&&_0x10f8d4['custom_fields'][_0x77cf('0x39')]({'id':_0x4d816e[_0x77cf('0x38')],'value':_0x5eb1fa[_0x4d816e[_0x77cf('0x3d')]['name']['toLowerCase']()][_0x77cf('0x3b')]()});}});}return _0x10f8d4;}exports[_0x77cf('0x3e')]=function(_0x18cf19,_0x19219c,_0x3555f3,_0xfc2516,_0x2ba390,_0x13793b){var _0x1b5d70,_0xa9a6ec;_0x13793b[_0x77cf('0x1c')]=intUtil['stripTrailingSlash'](_0x13793b[_0x77cf('0x1c')]);_0x13793b['serverUrl']=intUtil[_0x77cf('0x3f')](_0x13793b['serverUrl']);if(_0x2ba390&&_0x2ba390[_0x77cf('0x40')]){logger[_0x77cf('0xa')](_0x77cf('0x41'),_0x77cf('0x42'));_0x19219c[_0x77cf('0x43')]=util['format'](_0x77cf('0x44'),_0x13793b['serverUrl'],_0x19219c[_0x77cf('0x45')],md5(_0x19219c[_0x77cf('0x45')]));}else{_0x19219c[_0x77cf('0x43')]='';}headers[_0x77cf('0x46')]=getAuth(_0x13793b);return getUser(_0x13793b,_0xfc2516[_0x77cf('0x23')])[_0x77cf('0x1d')](function(_0x2cafe0){_0x1b5d70=_0x2cafe0;logger[_0x77cf('0xa')](_0x77cf('0x47'),_0x1b5d70['id']);return getEndUser(_0x13793b,_0x19219c['calleridname'],_0x19219c[_0x77cf('0xf')]);})[_0x77cf('0x1d')](function(_0x5d8855){_0xa9a6ec=_0x5d8855;logger[_0x77cf('0xa')](_0x77cf('0x48'),_0xa9a6ec['id']);return getTicket(_0x13793b,_0x1b5d70,_0xa9a6ec,_0x3555f3,_0x19219c);})[_0x77cf('0x1d')](function(_0x10051f){if(_0x10051f&&_0x10051f['id']){logger[_0x77cf('0xa')](_0x77cf('0x1e'));logger[_0x77cf('0xa')]('The\x20Ticket\x20ID\x20is:',_0x10051f['id']);logger['info'](_0x77cf('0x41'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x77cf('0xc')](_0x77cf('0x49'),_0xfc2516[_0x77cf('0x15')]),_0x77cf('0x4a'),{'uri':util[_0x77cf('0xc')]('%s/helpdesk/tickets/%d',_0x13793b['remoteUri'],_0x10051f['id'])});}})[_0x77cf('0x4b')](function(_0x3b818a){logger[_0x77cf('0x4c')]('[QUEUE]',JSON[_0x77cf('0x30')](_0x3b818a));});};exports[_0x77cf('0x4d')]=function(_0x393fed,_0x540ed9,_0x1a0e16,_0x3c7130,_0x5b5c90,_0x343ea4,_0x2592f5){var _0x241e55,_0x9031ae;_0x343ea4[_0x77cf('0x1c')]=intUtil[_0x77cf('0x3f')](_0x343ea4['remoteUri']);_0x343ea4['serverUrl']=intUtil['stripTrailingSlash'](_0x343ea4[_0x77cf('0x4e')]);if(_0x2592f5&&_0x2592f5[_0x77cf('0x4f')]&&_0x2592f5['recordingFormat']!=='none'){logger[_0x77cf('0xa')]('[OUTBOUND]','Recording\x20is\x20enabled!');_0x540ed9['recordingURL']=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x343ea4['serverUrl'],_0x540ed9[_0x77cf('0x45')],md5(_0x540ed9['uniqueid']));}headers[_0x77cf('0x46')]=getAuth(_0x343ea4);return getUser(_0x343ea4,_0x3c7130[_0x77cf('0x23')])[_0x77cf('0x1d')](function(_0x2d46c2){_0x241e55=_0x2d46c2;logger['info'](_0x77cf('0x47'),_0x241e55['id']);return getEndUser(_0x343ea4,_0x540ed9['destcalleridname'],_0x540ed9['destcalleridnum']);})['then'](function(_0x14e0e5){_0x9031ae=_0x14e0e5;logger[_0x77cf('0xa')](_0x77cf('0x48'),_0x9031ae['id']);return getTicket(_0x343ea4,_0x241e55,_0x9031ae,_0x1a0e16,_0x540ed9);})[_0x77cf('0x1d')](function(_0x519f1f){if(_0x519f1f&&_0x519f1f['id']){logger['info']('Ticket\x20created!');logger[_0x77cf('0xa')](_0x77cf('0x50'),_0x519f1f['id']);logger[_0x77cf('0xa')](_0x77cf('0x51'),_0x77cf('0x52'));emit(util[_0x77cf('0xc')](_0x77cf('0x49'),_0x3c7130[_0x77cf('0x15')]),'trigger:browser:url',{'uri':util[_0x77cf('0xc')](_0x77cf('0x53'),_0x343ea4[_0x77cf('0x1c')],_0x519f1f['id'])});}})['catch'](function(_0x582418){logger[_0x77cf('0x4c')](_0x77cf('0x51'),JSON['stringify'](_0x582418));});};exports[_0x77cf('0x54')]=function(_0x59e0a3,_0x5e2ee3,_0x2ae61d,_0x5be2a0,_0x447f27,_0x36d14a){var _0x5c6f8a,_0x5c21eb;_0x36d14a['remoteUri']=intUtil['stripTrailingSlash'](_0x36d14a[_0x77cf('0x1c')]);_0x36d14a[_0x77cf('0x4e')]=intUtil[_0x77cf('0x3f')](_0x36d14a['serverUrl']);if(_0x447f27&&_0x447f27['monitor_format']){logger[_0x77cf('0xa')]('['+_0x5e2ee3[_0x77cf('0x55')][_0x77cf('0x56')]()+']',_0x77cf('0x42'));_0x5e2ee3[_0x77cf('0x43')]=util[_0x77cf('0xc')](_0x77cf('0x44'),_0x36d14a[_0x77cf('0x4e')],_0x5e2ee3[_0x77cf('0x45')],md5(_0x5e2ee3[_0x77cf('0x45')]));}else{_0x5e2ee3[_0x77cf('0x43')]='';}headers['Authorization']=getAuth(_0x36d14a);return getUser(_0x36d14a,'')[_0x77cf('0x1d')](function(_0x2325d6){_0x5c6f8a=_0x2325d6;logger[_0x77cf('0xa')]('The\x20User\x20ID\x20is:',_0x5c6f8a['id']);return getEndUser(_0x36d14a,_0x5e2ee3['calleridname'],_0x5e2ee3[_0x77cf('0xf')]);})[_0x77cf('0x1d')](function(_0xbd0e28){_0x5c21eb=_0xbd0e28;logger[_0x77cf('0xa')](_0x77cf('0x48'),_0x5c21eb['id']);return getTicket(_0x36d14a,_0x5c6f8a,_0x5c21eb,_0x2ae61d,_0x5e2ee3);})['then'](function(_0xa34627){if(_0xa34627){logger[_0x77cf('0xa')](_0x77cf('0x1e'));logger['info'](_0x77cf('0x50'),_0xa34627['id']);}})['catch'](function(_0x26d813){logger['error']('['+_0x5e2ee3[_0x77cf('0x55')][_0x77cf('0x56')]()+']',JSON[_0x77cf('0x30')](_0x26d813));});};
\ No newline at end of file
+var _0xc621=['defaults','localhost','socket.io-emitter','application/json','format','calleridnum','getString','Subjects','Descriptions',' ','Tags','name','Fields','value','%s/api/v2/tickets','info','Ticket\x20created!','validateEmail','%s/api/v2/agents','remoteUri','then','length','Agent\x20found!','contact','email','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','Admin\x20account\x20selected.','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','%s/api/v2/agents/me','Searching\x20enduser\x20with\x20phone','Enduser\x20found!','find','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/api/v2/contacts','Enduser\x20created.','Basic\x20%s','apiKey','toString','base64','debug','[HTTP]','stringify','GET','map','type','string','nameField','customField','toLowerCase','content','idField','variable','variableName','push','customVariable','Variable','custom_fields','queue','serverUrl','stripTrailingSlash','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','The\x20User\x20ID\x20is:','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','user:%s','trigger:browser:url','%s/helpdesk/tickets/%d','error','outbound','recordingFormat','destcalleridname','[OUTBOUND]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','catch','unmanaged','toUpperCase','calleridname','lodash','request-promise','md5','util','./util','../../../../config/environment','../../../../config/logger','freshdesk','redis'];(function(_0x54429a,_0x14ef1b){var _0x49e4ce=function(_0x26bd92){while(--_0x26bd92){_0x54429a['push'](_0x54429a['shift']());}};_0x49e4ce(++_0x14ef1b);}(_0xc621,0x1c3));var _0x1c62=function(_0x570a9f,_0x4a2074){_0x570a9f=_0x570a9f-0x0;var _0x493db1=_0xc621[_0x570a9f];return _0x493db1;};'use strict';var _=require(_0x1c62('0x0'));var rp=require(_0x1c62('0x1'));var md5=require(_0x1c62('0x2'));var util=require(_0x1c62('0x3'));var Redis=require('ioredis');var intUtil=require(_0x1c62('0x4'));var config=require(_0x1c62('0x5'));var logger=require(_0x1c62('0x6'))(_0x1c62('0x7'));config[_0x1c62('0x8')]=_[_0x1c62('0x9')](config[_0x1c62('0x8')],{'host':_0x1c62('0xa'),'port':0x18eb});var io=require(_0x1c62('0xb'))(new Redis(config[_0x1c62('0x8')]));var headers={'Content-Type':_0x1c62('0xc'),'Accept':_0x1c62('0xc')};function emit(_0x55beed,_0x2ef7a,_0x4df952){io['to'](_0x55beed)['emit'](_0x2ef7a,_0x4df952);}function getTicket(_0xaba31e,_0x4bed8e,_0x39be0a,_0x4a0b10,_0x3b2f0e){logger['info']('Creating\x20new\x20ticket...');var _0x379b70=_['merge']({'responder_id':_0x4bed8e['id'],'requester_id':_0x39be0a['id'],'name':util[_0x1c62('0xd')]('Caller\x20-\x20%s',_0x3b2f0e['calleridname']),'phone':_0x3b2f0e[_0x1c62('0xe')],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil[_0x1c62('0xf')](_0x4a0b10[_0x1c62('0x10')],_0x3b2f0e,'\x20'),'description':intUtil[_0x1c62('0xf')](_0x4a0b10[_0x1c62('0x11')],_0x3b2f0e,_0x1c62('0x12')),'tags':getTags(_0x4a0b10[_0x1c62('0x13')],_0x1c62('0x14'))},getCustomFields(_0x4a0b10[_0x1c62('0x15')],_0x3b2f0e));_0x379b70['custom_fields']=_['mapValues'](_['keyBy'](_0x379b70['custom_fields'],'id'),_0x1c62('0x16'));return request({'uri':util[_0x1c62('0xd')](_0x1c62('0x17'),_0xaba31e['remoteUri']),'method':'POST','body':_0x379b70})['then'](function(_0x26574a){logger[_0x1c62('0x18')](_0x1c62('0x19'));return _0x26574a;});}function getUser(_0x402660,_0x248ba6){if(intUtil[_0x1c62('0x1a')](_0x248ba6)){return request({'uri':util[_0x1c62('0xd')](_0x1c62('0x1b'),_0x402660[_0x1c62('0x1c')]),'qs':{'email':_0x248ba6}})[_0x1c62('0x1d')](function(_0x1eadfd){if(_0x1eadfd[_0x1c62('0x1e')]){logger[_0x1c62('0x18')](_0x1c62('0x1f'));return _['find'](_0x1eadfd,function(_0x342366){return _0x342366[_0x1c62('0x20')][_0x1c62('0x21')]===_0x248ba6;});}else{logger['info'](_0x1c62('0x22'));return request({'uri':util[_0x1c62('0xd')]('%s/api/v2/agents/me',_0x402660[_0x1c62('0x1c')])})['then'](function(_0x145ad6){logger[_0x1c62('0x18')](_0x1c62('0x23'));return _0x145ad6;});}});}else{logger[_0x1c62('0x18')](_0x1c62('0x24'));return request({'uri':util[_0x1c62('0xd')](_0x1c62('0x25'),_0x402660['remoteUri'])})['then'](function(_0xe568cb){logger[_0x1c62('0x18')](_0x1c62('0x23'));return _0xe568cb;});}}function getEndUser(_0x13fbd4,_0x417459,_0x27b9a0){logger['info'](_0x1c62('0x26'),_0x27b9a0);return request({'uri':util[_0x1c62('0xd')]('%s/api/v2/contacts',_0x13fbd4[_0x1c62('0x1c')]),'qs':{'phone':_0x27b9a0}})['then'](function(_0x26a29c){if(_0x26a29c['length']){logger[_0x1c62('0x18')](_0x1c62('0x27'));return _[_0x1c62('0x28')](_0x26a29c,{'phone':_0x27b9a0});}else{logger[_0x1c62('0x18')](_0x1c62('0x29'));return request({'uri':util['format'](_0x1c62('0x2a'),_0x13fbd4[_0x1c62('0x1c')]),'method':'POST','body':{'name':_0x417459,'phone':_0x27b9a0}})['then'](function(_0x481ef0){logger[_0x1c62('0x18')](_0x1c62('0x2b'));return _0x481ef0;});}});}function getAuth(_0x48e710){return util[_0x1c62('0xd')](_0x1c62('0x2c'),new Buffer(_0x48e710[_0x1c62('0x2d')]+':X')[_0x1c62('0x2e')](_0x1c62('0x2f')));}function request(_0x304d84){logger[_0x1c62('0x30')](_0x1c62('0x31'),JSON[_0x1c62('0x32')](_0x304d84));return rp(_[_0x1c62('0x9')](_0x304d84,{'method':_0x1c62('0x33'),'headers':headers,'json':!![]}));}function getTags(_0x308fe2,_0x2e625b){var _0x2678d4=[];if(_0x308fe2&&_0x308fe2[_0x1c62('0x1e')]>0x0){_0x2678d4=_[_0x1c62('0x34')](_0x308fe2,_0x2e625b);}return _0x2678d4;}function getCustomFields(_0x34ae45,_0xd2381d){var _0x167353=[];var _0x570547={'custom_fields':[]};if(_0x34ae45[_0x1c62('0x1e')]>0x0){_['forEach'](_0x34ae45,function(_0x3ff6d7){if(_0x3ff6d7[_0x1c62('0x35')]===_0x1c62('0x36')&&_0x3ff6d7[_0x1c62('0x37')]&&!_0x3ff6d7[_0x1c62('0x38')]){_0x570547[_0x3ff6d7[_0x1c62('0x37')][_0x1c62('0x39')]()]=_0x3ff6d7[_0x1c62('0x3a')][_0x1c62('0x2e')]();}else if(_0x3ff6d7[_0x1c62('0x35')]===_0x1c62('0x36')&&_0x3ff6d7[_0x1c62('0x3b')]&&_0x3ff6d7['customField']){_0x570547['custom_fields']['push']({'id':_0x3ff6d7['idField'],'value':_0x3ff6d7['content'][_0x1c62('0x2e')]()});}else if(_0x3ff6d7[_0x1c62('0x35')]===_0x1c62('0x3c')&&_0x3ff6d7['variableName']&&_0x3ff6d7[_0x1c62('0x3b')]&&_0x3ff6d7['customField']){_0xd2381d[_0x3ff6d7[_0x1c62('0x3d')]]&&_0x570547['custom_fields'][_0x1c62('0x3e')]({'id':_0x3ff6d7[_0x1c62('0x3b')],'value':_0xd2381d[_0x3ff6d7[_0x1c62('0x3d')]]['toString']()});}else if(_0x3ff6d7[_0x1c62('0x35')]===_0x1c62('0x3f')&&_0x3ff6d7[_0x1c62('0x40')]&&_0x3ff6d7[_0x1c62('0x40')]['name']&&_0x3ff6d7[_0x1c62('0x3b')]&&_0x3ff6d7['customField']){_0xd2381d[_0x3ff6d7[_0x1c62('0x40')][_0x1c62('0x14')][_0x1c62('0x39')]()]&&_0x570547[_0x1c62('0x41')][_0x1c62('0x3e')]({'id':_0x3ff6d7[_0x1c62('0x3b')],'value':_0xd2381d[_0x3ff6d7[_0x1c62('0x40')][_0x1c62('0x14')][_0x1c62('0x39')]()][_0x1c62('0x2e')]()});}});}return _0x570547;}exports[_0x1c62('0x42')]=function(_0x4844d2,_0x203099,_0x544fa4,_0x3050df,_0x173886,_0x2178c9){var _0x14c8c6,_0x1cdaed;_0x2178c9['remoteUri']=intUtil['stripTrailingSlash'](_0x2178c9['remoteUri']);_0x2178c9[_0x1c62('0x43')]=intUtil[_0x1c62('0x44')](_0x2178c9[_0x1c62('0x43')]);if(_0x173886&&_0x173886[_0x1c62('0x45')]){logger[_0x1c62('0x18')](_0x1c62('0x46'),_0x1c62('0x47'));_0x203099[_0x1c62('0x48')]=util['format'](_0x1c62('0x49'),_0x2178c9[_0x1c62('0x43')],_0x203099[_0x1c62('0x4a')],md5(_0x203099[_0x1c62('0x4a')]));}else{_0x203099[_0x1c62('0x48')]='';}headers[_0x1c62('0x4b')]=getAuth(_0x2178c9);return getUser(_0x2178c9,_0x3050df[_0x1c62('0x21')])[_0x1c62('0x1d')](function(_0x2895b8){_0x14c8c6=_0x2895b8;logger[_0x1c62('0x18')](_0x1c62('0x4c'),_0x14c8c6['id']);return getEndUser(_0x2178c9,_0x203099['calleridname'],_0x203099['calleridnum']);})[_0x1c62('0x1d')](function(_0x5c6601){_0x1cdaed=_0x5c6601;logger['info'](_0x1c62('0x4d'),_0x1cdaed['id']);return getTicket(_0x2178c9,_0x14c8c6,_0x1cdaed,_0x544fa4,_0x203099);})[_0x1c62('0x1d')](function(_0x24a082){if(_0x24a082&&_0x24a082['id']){logger[_0x1c62('0x18')](_0x1c62('0x19'));logger[_0x1c62('0x18')](_0x1c62('0x4e'),_0x24a082['id']);logger[_0x1c62('0x18')](_0x1c62('0x46'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x1c62('0xd')](_0x1c62('0x4f'),_0x3050df['name']),_0x1c62('0x50'),{'uri':util[_0x1c62('0xd')](_0x1c62('0x51'),_0x2178c9['remoteUri'],_0x24a082['id'])});}})['catch'](function(_0x1f17f6){logger[_0x1c62('0x52')](_0x1c62('0x46'),JSON[_0x1c62('0x32')](_0x1f17f6));});};exports[_0x1c62('0x53')]=function(_0x10d730,_0x7f23e7,_0x2f9339,_0x4450ad,_0x79a7d,_0x1ffc07,_0x3b3e43){var _0x2d722c,_0x10ad1a;_0x1ffc07['remoteUri']=intUtil[_0x1c62('0x44')](_0x1ffc07[_0x1c62('0x1c')]);_0x1ffc07[_0x1c62('0x43')]=intUtil[_0x1c62('0x44')](_0x1ffc07['serverUrl']);if(_0x3b3e43&&_0x3b3e43[_0x1c62('0x54')]&&_0x3b3e43[_0x1c62('0x54')]!=='none'){logger['info']('[OUTBOUND]','Recording\x20is\x20enabled!');_0x7f23e7[_0x1c62('0x48')]=util[_0x1c62('0xd')](_0x1c62('0x49'),_0x1ffc07[_0x1c62('0x43')],_0x7f23e7[_0x1c62('0x4a')],md5(_0x7f23e7['uniqueid']));}headers[_0x1c62('0x4b')]=getAuth(_0x1ffc07);return getUser(_0x1ffc07,_0x4450ad[_0x1c62('0x21')])[_0x1c62('0x1d')](function(_0x1c745c){_0x2d722c=_0x1c745c;logger[_0x1c62('0x18')]('The\x20User\x20ID\x20is:',_0x2d722c['id']);return getEndUser(_0x1ffc07,_0x7f23e7[_0x1c62('0x55')],_0x7f23e7['destcalleridnum']);})['then'](function(_0x54e86d){_0x10ad1a=_0x54e86d;logger[_0x1c62('0x18')](_0x1c62('0x4d'),_0x10ad1a['id']);return getTicket(_0x1ffc07,_0x2d722c,_0x10ad1a,_0x2f9339,_0x7f23e7);})[_0x1c62('0x1d')](function(_0x1f0a27){if(_0x1f0a27&&_0x1f0a27['id']){logger[_0x1c62('0x18')]('Ticket\x20created!');logger[_0x1c62('0x18')]('The\x20Ticket\x20ID\x20is:',_0x1f0a27['id']);logger[_0x1c62('0x18')](_0x1c62('0x56'),_0x1c62('0x57'));emit(util[_0x1c62('0xd')](_0x1c62('0x4f'),_0x4450ad[_0x1c62('0x14')]),_0x1c62('0x50'),{'uri':util[_0x1c62('0xd')](_0x1c62('0x51'),_0x1ffc07[_0x1c62('0x1c')],_0x1f0a27['id'])});}})[_0x1c62('0x58')](function(_0x27c57d){logger[_0x1c62('0x52')]('[OUTBOUND]',JSON[_0x1c62('0x32')](_0x27c57d));});};exports[_0x1c62('0x59')]=function(_0x39f032,_0x20b7cb,_0x3d0065,_0x13e974,_0x4dfef5,_0x3da53b){var _0x2a91c6,_0x591e3a;_0x3da53b['remoteUri']=intUtil[_0x1c62('0x44')](_0x3da53b['remoteUri']);_0x3da53b['serverUrl']=intUtil[_0x1c62('0x44')](_0x3da53b[_0x1c62('0x43')]);if(_0x4dfef5&&_0x4dfef5[_0x1c62('0x45')]){logger['info']('['+_0x20b7cb['lastevent'][_0x1c62('0x5a')]()+']',_0x1c62('0x47'));_0x20b7cb['recordingURL']=util[_0x1c62('0xd')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x3da53b[_0x1c62('0x43')],_0x20b7cb[_0x1c62('0x4a')],md5(_0x20b7cb[_0x1c62('0x4a')]));}else{_0x20b7cb[_0x1c62('0x48')]='';}headers[_0x1c62('0x4b')]=getAuth(_0x3da53b);return getUser(_0x3da53b,'')[_0x1c62('0x1d')](function(_0x22977c){_0x2a91c6=_0x22977c;logger[_0x1c62('0x18')](_0x1c62('0x4c'),_0x2a91c6['id']);return getEndUser(_0x3da53b,_0x20b7cb[_0x1c62('0x5b')],_0x20b7cb[_0x1c62('0xe')]);})[_0x1c62('0x1d')](function(_0x200f78){_0x591e3a=_0x200f78;logger[_0x1c62('0x18')]('The\x20Enduser\x20ID\x20is:',_0x591e3a['id']);return getTicket(_0x3da53b,_0x2a91c6,_0x591e3a,_0x3d0065,_0x20b7cb);})['then'](function(_0x53d018){if(_0x53d018){logger[_0x1c62('0x18')](_0x1c62('0x19'));logger[_0x1c62('0x18')]('The\x20Ticket\x20ID\x20is:',_0x53d018['id']);}})[_0x1c62('0x58')](function(_0x2658c9){logger['error']('['+_0x20b7cb['lastevent']['toUpperCase']()+']',JSON['stringify'](_0x2658c9));});};
\ No newline at end of file
diff --git a/server/services/ami/trigger/integration/freshsales.js b/server/services/ami/trigger/integration/freshsales.js
index ea72fc6..e3b35e3 100644
--- a/server/services/ami/trigger/integration/freshsales.js
+++ b/server/services/ami/trigger/integration/freshsales.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xb3a9=['info','Getting\x20admin\x20information','users','length','email','adminId','Admin\x20found:','Requested\x20Resource\x20not\x20Found','catch','toUpperCase','message','Getting\x20user\x20list','agentEmail','userId','User\x20found:','userEmail','adminEmail','error','/api/contacts/filters','then','filters','forEach','name','Getting\x20contact\x20list','/api/contacts/view/','Searching\x20contact\x20with\x20phone','contacts','find','work_number','mobile_number','contactNumber','Contact\x20found:','endUserId','Contact\x20created:','POST','/api/contacts','format','YYYY-MM-DDTHH:mm:ss','Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact','Creating\x20new\x20task','/api/tasks','getString','Subjects','Descriptions','Contact','ticketId','task','emit','trigger:browser:url','Token\x20token=','remoteUri','stripTrailingSlash','serverUrl','toLowerCase','outbound','destcalleridnum','calleridnum','callDirection','unmanaged','queue','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','[OUTBOUND]','The\x20ticket\x20ID\x20is:\x20%s','Displaying\x20task\x20in\x20a\x20new\x20tab...',']\x20Error\x20running\x20Freshsales\x20integration','inspect','lodash','request-promise','md5','util','moment','bluebird','./util','../../../../config/environment','freshsales','redis','defaults','localhost','socket.io-emitter','GET','/api/selector/owners','headers'];(function(_0x312b38,_0x4ef56f){var _0x27a9ea=function(_0x318927){while(--_0x318927){_0x312b38['push'](_0x312b38['shift']());}};_0x27a9ea(++_0x4ef56f);}(_0xb3a9,0xa2));var _0x9b3a=function(_0x216175,_0x2e272d){_0x216175=_0x216175-0x0;var _0x21230a=_0xb3a9[_0x216175];return _0x21230a;};'use strict';var _=require(_0x9b3a('0x0'));var rp=require(_0x9b3a('0x1'));var md5=require(_0x9b3a('0x2'));var util=require(_0x9b3a('0x3'));var moment=require(_0x9b3a('0x4'));var Promise=require(_0x9b3a('0x5'));var Redis=require('ioredis');var intUtil=require(_0x9b3a('0x6'));var config=require(_0x9b3a('0x7'));var logger=require('../../../../config/logger')(_0x9b3a('0x8'));config[_0x9b3a('0x9')]=_[_0x9b3a('0xa')](config[_0x9b3a('0x9')],{'host':_0x9b3a('0xb'),'port':0x18eb});var io=require(_0x9b3a('0xc'))(new Redis(config[_0x9b3a('0x9')]));function getAdminId(_0x5d34b1,_0xd7cb7c,_0x5a9e15,_0x16a998){return new Promise(function(_0x27a73f,_0x4c2244){var _0x3cb1df=![];var _0x365b4c={'method':_0x9b3a('0xd'),'uri':_0x16a998+_0x9b3a('0xe'),'json':!![]};_0x365b4c[_0x9b3a('0xf')]=_0x5a9e15;logger[_0x9b3a('0x10')](_0x9b3a('0x11'));return rp(_0x365b4c)['then'](function(_0x53c6f7){if(_0x53c6f7){var _0x20404=_0x53c6f7[_0x9b3a('0x12')];var _0x34274c=null;for(_0x34274c=0x0;_0x34274c<_0x20404[_0x9b3a('0x13')];_0x34274c++){if(_0x20404[_0x34274c][_0x9b3a('0x14')]===_0x5d34b1['adminEmail']){_0x5d34b1[_0x9b3a('0x15')]=_0x20404[_0x34274c]['id'];_0x3cb1df=!![];}}if(_0x3cb1df){logger[_0x9b3a('0x10')](_0x9b3a('0x16'),_0x5d34b1[_0x9b3a('0x15')]);_0x27a73f(_0x5d34b1);}else{_0x4c2244({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}}else{_0x4c2244({'statusCode':0x194,'message':_0x9b3a('0x17')});}})[_0x9b3a('0x18')](function(_0x46161c){logger['error']('['+[_0xd7cb7c[_0x9b3a('0x19')]()]+']',_0x46161c[_0x9b3a('0x1a')]);_0x4c2244(_0x46161c);});});}function getUser(_0x45b990,_0x1c8a05,_0x14f7c6){return function(_0xf406e9){return new Promise(function(_0x3cedbd,_0x2950a2){var _0x75a380={'method':_0x9b3a('0xd'),'uri':_0x14f7c6+'/api/selector/owners','json':!![]};_0x75a380[_0x9b3a('0xf')]=_0x1c8a05;logger[_0x9b3a('0x10')](_0x9b3a('0x1b'));return rp(_0x75a380)['then'](function(_0x68f6){if(_0x68f6){var _0xafcf6f=_0x68f6[_0x9b3a('0x12')];var _0x436ad0=![];var _0x26d4e0=null;if(_0xf406e9[_0x9b3a('0x1c')]!==null){logger[_0x9b3a('0x10')]('Getting\x20user\x20with\x20email',_0xf406e9[_0x9b3a('0x1c')]);_0xf406e9['userEmail']=_0xf406e9['agentEmail'];for(_0x26d4e0=0x0;_0x26d4e0<_0xafcf6f[_0x9b3a('0x13')];_0x26d4e0++){if(_0xafcf6f[_0x26d4e0][_0x9b3a('0x14')]===_0xf406e9['agentEmail']){_0x436ad0=!![];_0xf406e9[_0x9b3a('0x1d')]=_0xafcf6f[_0x26d4e0]['id'];logger['info'](_0x9b3a('0x1e'),_0xf406e9[_0x9b3a('0x1d')]);}}}if(!_0x436ad0){logger[_0x9b3a('0x10')]('Admin\x20selected');_0xf406e9[_0x9b3a('0x1f')]=_0xf406e9[_0x9b3a('0x20')];_0xf406e9[_0x9b3a('0x1d')]=_0xf406e9[_0x9b3a('0x15')];_0x436ad0=!![];}if(_0x436ad0){_0x3cedbd(_0xf406e9);}else{_0x2950a2({'statusCode':0x194,'message':_0x9b3a('0x17')});}}else{_0x2950a2({'statusCode':0x194,'message':_0x9b3a('0x17')});}})[_0x9b3a('0x18')](function(_0x182372){logger[_0x9b3a('0x21')]('['+[_0x45b990[_0x9b3a('0x19')]()]+']',_0x182372[_0x9b3a('0x1a')]);_0x2950a2(_0x182372);});});};}function getEndUser(_0x5591ad,_0x47d2bf,_0x244b76){return function(_0x4426d1){return new Promise(function(_0x59bf1b,_0x587a1a){var _0x12d3a4=0x0;var _0x4a8b79={'method':_0x9b3a('0xd'),'uri':_0x244b76+_0x9b3a('0x22'),'json':!![]};_0x4a8b79['headers']=_0x47d2bf;logger[_0x9b3a('0x10')]('Getting\x20contacts\x20filter');return rp(_0x4a8b79)[_0x9b3a('0x23')](function(_0x3a3fff){_0x3a3fff[_0x9b3a('0x24')][_0x9b3a('0x25')](function(_0xa81837){if(_0xa81837[_0x9b3a('0x26')]==='All\x20Contacts'){_0x12d3a4=_0xa81837['id'];}});})['then'](function(){logger[_0x9b3a('0x10')](_0x9b3a('0x27'));var _0x3259bd={'method':_0x9b3a('0xd'),'uri':_0x244b76+_0x9b3a('0x28')+_0x12d3a4,'json':!![]};_0x3259bd[_0x9b3a('0xf')]=_0x47d2bf;return rp(_0x3259bd);})['then'](function(_0x5bb09f){logger['info'](_0x9b3a('0x29'),_0x4426d1['contactNumber']);if(_0x5bb09f[_0x9b3a('0x2a')][_0x9b3a('0x13')]>0x0){var _0xb98c85=_[_0x9b3a('0x2b')](_0x5bb09f['contacts'],function(_0x2b502f){if(_0x2b502f[_0x9b3a('0x2c')]===_0x4426d1['contactNumber']||_0x2b502f[_0x9b3a('0x2d')]===_0x4426d1[_0x9b3a('0x2e')]){return _0x2b502f;}});if(_0xb98c85){_0x4426d1['endUserId']=_0xb98c85['id'];logger[_0x9b3a('0x10')](_0x9b3a('0x2f'),_0x4426d1[_0x9b3a('0x30')]);_0x59bf1b(_0x4426d1);}else{return createEndUser(_0x4426d1,_0x5591ad,_0x47d2bf,_0x244b76)[_0x9b3a('0x23')](function(_0x6a8720){logger[_0x9b3a('0x10')](_0x9b3a('0x31'),_0x4426d1[_0x9b3a('0x30')]);_0x59bf1b(_0x6a8720);});}}else{return createEndUser(_0x4426d1,_0x5591ad,_0x47d2bf,_0x244b76)['then'](function(_0x43538a){logger['info'](_0x9b3a('0x31'),_0x4426d1[_0x9b3a('0x30')]);_0x59bf1b(_0x43538a);});}})[_0x9b3a('0x18')](function(_0x43dc68){throw new Error(_0x43dc68[_0x9b3a('0x1a')]);});});};}function createEndUser(_0x20036c,_0x2c9b0e,_0x2f9bfa,_0x4f3ad5){return new Promise(function(_0x4da110,_0x31465a){var _0x235421=moment();var _0x52ce65={'method':_0x9b3a('0x32'),'uri':_0x4f3ad5+_0x9b3a('0x33'),'body':{'contact':{'last_name':_0x20036c['contactNumber'],'work_number':_0x20036c[_0x9b3a('0x2e')],'mobile_number':_0x20036c[_0x9b3a('0x2e')],'owner_id':_0x20036c['userId'],'created_at':_0x235421[_0x9b3a('0x34')](_0x9b3a('0x35'))}},'json':!![]};_0x52ce65[_0x9b3a('0xf')]=_0x2f9bfa;logger[_0x9b3a('0x10')](_0x9b3a('0x36'));return rp(_0x52ce65)[_0x9b3a('0x23')](function(_0x4f5b36){_0x20036c[_0x9b3a('0x30')]=_0x4f5b36['contact']['id'];_0x4da110(_0x20036c);})[_0x9b3a('0x18')](function(_0x5ea016){logger[_0x9b3a('0x21')]('['+[_0x2c9b0e[_0x9b3a('0x19')]()]+']',_0x5ea016['message']);_0x31465a(_0x5ea016['message']);});});}function getTicket(_0x1becc7,_0x1f4584,_0x3133ee,_0xe6ba9b,_0x16e3f8){return function(_0x5914d4){logger[_0x9b3a('0x10')](_0x9b3a('0x37'));return new Promise(function(_0x2e73a4,_0x3b1751){var _0x57cf89=moment();var _0x58a003={'method':_0x9b3a('0x32'),'uri':_0x3133ee+_0x9b3a('0x38'),'body':{'title':intUtil[_0x9b3a('0x39')](_0xe6ba9b[_0x9b3a('0x3a')],_0x16e3f8,'\x20'),'description':intUtil[_0x9b3a('0x39')](_0xe6ba9b[_0x9b3a('0x3b')],_0x16e3f8,'\x0a'),'owner_id':_0x5914d4['userId'],'creater_id':_0x5914d4[_0x9b3a('0x15')],'targetable_id':_0x5914d4[_0x9b3a('0x30')],'targetable_type':_0x9b3a('0x3c'),'created_at':_0x57cf89[_0x9b3a('0x34')]('YYYY-MM-DDTHH:mm:ss'),'due_date':_0x57cf89['add'](0x1e,'m')[_0x9b3a('0x34')](_0x9b3a('0x35'))},'json':!![]};_0x58a003[_0x9b3a('0xf')]=_0x1f4584;return rp(_0x58a003)[_0x9b3a('0x23')](function(_0x4950d0){_0x5914d4[_0x9b3a('0x3d')]=_0x4950d0[_0x9b3a('0x3e')]['id'];logger[_0x9b3a('0x10')]('Task\x20created:',_0x5914d4[_0x9b3a('0x3d')]);_0x2e73a4(_0x5914d4);})[_0x9b3a('0x18')](function(_0x484791){logger[_0x9b3a('0x21')]('['+[_0x1becc7[_0x9b3a('0x19')]()]+']',_0x484791[_0x9b3a('0x1a')]);_0x3b1751(_0x484791[_0x9b3a('0x1a')]);});});};}function emit(_0x500594,_0x210c7d,_0x5c9110){var _0x46cf88={'uri':_0x500594+'/contacts/'+_0x5c9110};io['to'](util[_0x9b3a('0x34')]('user:%s',_0x210c7d))[_0x9b3a('0x3f')](_0x9b3a('0x40'),_0x46cf88);}exports['cs']=function(_0x228b3f,_0x3c6319,_0x40ee6b,_0x302a37,_0x1a955f,_0x33e69f,_0x363a34,_0x14b8a9){var _0x3ebcf0={};var _0x14ecc1={'Authorization':_0x9b3a('0x41')+_0x33e69f['apiKey']};_0x33e69f[_0x9b3a('0x42')]=intUtil[_0x9b3a('0x43')](_0x33e69f[_0x9b3a('0x42')]);_0x33e69f[_0x9b3a('0x44')]=intUtil[_0x9b3a('0x43')](_0x33e69f[_0x9b3a('0x44')]);var _0x2da6f7=_0x33e69f['remoteUri'];_0x3ebcf0[_0x9b3a('0x20')]=_0x33e69f['username'];_0x3ebcf0[_0x9b3a('0x2e')]=_0x14b8a9[_0x9b3a('0x45')]()===_0x9b3a('0x46')?_0x3c6319[_0x9b3a('0x47')]:_0x3c6319[_0x9b3a('0x48')];_0x3ebcf0[_0x9b3a('0x49')]=_0x14b8a9==='queue'||_0x14b8a9===_0x9b3a('0x4a')?_0x9b3a('0x4b'):_0x9b3a('0x46');if(_0x302a37){_0x3ebcf0[_0x9b3a('0x1c')]=_0x302a37[_0x9b3a('0x14')];}var _0x40d7e4=util[_0x9b3a('0x34')](_0x9b3a('0x4c'),_0x33e69f[_0x9b3a('0x44')],_0x3c6319[_0x9b3a('0x4d')],md5(_0x3c6319[_0x9b3a('0x4d')]));if(_0x1a955f&&_0x1a955f[_0x9b3a('0x4e')]){logger[_0x9b3a('0x10')](_0x9b3a('0x4f'),_0x9b3a('0x50'));_0x3c6319[_0x9b3a('0x51')]=_0x40d7e4;}else if(_0x363a34&&_0x363a34[_0x9b3a('0x52')]&&_0x363a34[_0x9b3a('0x52')]!==_0x9b3a('0x53')){logger[_0x9b3a('0x10')](_0x9b3a('0x54'),_0x9b3a('0x50'));_0x3c6319[_0x9b3a('0x51')]=_0x40d7e4;}else{_0x3c6319['recordingURL']='';}return getAdminId(_0x3ebcf0,_0x14b8a9,_0x14ecc1,_0x2da6f7)[_0x9b3a('0x23')](getUser(_0x14b8a9,_0x14ecc1,_0x2da6f7))[_0x9b3a('0x23')](getEndUser(_0x14b8a9,_0x14ecc1,_0x2da6f7))[_0x9b3a('0x23')](getTicket(_0x14b8a9,_0x14ecc1,_0x2da6f7,_0x40ee6b,_0x3c6319))[_0x9b3a('0x23')](function(_0x4f4b32){logger[_0x9b3a('0x10')](util[_0x9b3a('0x34')](_0x9b3a('0x55'),_0x4f4b32[_0x9b3a('0x3d')]));if(_0x14b8a9!=='unmanaged'){logger[_0x9b3a('0x10')]('['+[_0x14b8a9[_0x9b3a('0x19')]()]+']',_0x9b3a('0x56'));emit(_0x2da6f7,_0x302a37[_0x9b3a('0x26')],_0x4f4b32['endUserId']);}})[_0x9b3a('0x18')](function(_0x2689ec){logger[_0x9b3a('0x21')]('['+[_0x14b8a9[_0x9b3a('0x19')]()]+_0x9b3a('0x57'),util[_0x9b3a('0x58')](_0x2689ec,{'showHidden':!![],'depth':null}));});};
\ No newline at end of file
+var _0x5350=['Descriptions','Contact','add','task','Task\x20created:','ticketId','/contacts/','user:%s','trigger:browser:url','Token\x20token=','apiKey','remoteUri','stripTrailingSlash','serverUrl','outbound','destcalleridnum','calleridnum','callDirection','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','recordingURL','recordingFormat','[OUTBOUND]','Recording\x20is\x20enabled!','The\x20ticket\x20ID\x20is:\x20%s','unmanaged','Displaying\x20task\x20in\x20a\x20new\x20tab...','inspect','lodash','request-promise','md5','util','moment','bluebird','./util','../../../../config/environment','freshsales','redis','defaults','localhost','socket.io-emitter','GET','/api/selector/owners','headers','info','Getting\x20admin\x20information','users','length','adminEmail','Admin\x20found:','Requested\x20Resource\x20not\x20Found','catch','error','toUpperCase','message','Getting\x20user\x20list','agentEmail','Getting\x20user\x20with\x20email','userEmail','email','User\x20found:','Admin\x20selected','adminId','Getting\x20contacts\x20filter','then','filters','forEach','name','All\x20Contacts','Getting\x20contact\x20list','/api/contacts/view/','Searching\x20contact\x20with\x20phone','contacts','find','work_number','contactNumber','mobile_number','endUserId','Contact\x20created:','/api/contacts','userId','format','YYYY-MM-DDTHH:mm:ss','Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact','contact','Creating\x20new\x20task','POST','/api/tasks','getString','Subjects'];(function(_0x5153c0,_0x4dd5ba){var _0xfb156c=function(_0x184931){while(--_0x184931){_0x5153c0['push'](_0x5153c0['shift']());}};_0xfb156c(++_0x4dd5ba);}(_0x5350,0x78));var _0x0535=function(_0x37e766,_0x471645){_0x37e766=_0x37e766-0x0;var _0x4646d3=_0x5350[_0x37e766];return _0x4646d3;};'use strict';var _=require(_0x0535('0x0'));var rp=require(_0x0535('0x1'));var md5=require(_0x0535('0x2'));var util=require(_0x0535('0x3'));var moment=require(_0x0535('0x4'));var Promise=require(_0x0535('0x5'));var Redis=require('ioredis');var intUtil=require(_0x0535('0x6'));var config=require(_0x0535('0x7'));var logger=require('../../../../config/logger')(_0x0535('0x8'));config[_0x0535('0x9')]=_[_0x0535('0xa')](config[_0x0535('0x9')],{'host':_0x0535('0xb'),'port':0x18eb});var io=require(_0x0535('0xc'))(new Redis(config['redis']));function getAdminId(_0x5be6ed,_0x16d5f0,_0x38911a,_0x5b4275){return new Promise(function(_0x183f37,_0x386743){var _0x6bde2b=![];var _0x4a06d0={'method':_0x0535('0xd'),'uri':_0x5b4275+_0x0535('0xe'),'json':!![]};_0x4a06d0[_0x0535('0xf')]=_0x38911a;logger[_0x0535('0x10')](_0x0535('0x11'));return rp(_0x4a06d0)['then'](function(_0x2507a8){if(_0x2507a8){var _0x441e67=_0x2507a8[_0x0535('0x12')];var _0x2d5259=null;for(_0x2d5259=0x0;_0x2d5259<_0x441e67[_0x0535('0x13')];_0x2d5259++){if(_0x441e67[_0x2d5259]['email']===_0x5be6ed[_0x0535('0x14')]){_0x5be6ed['adminId']=_0x441e67[_0x2d5259]['id'];_0x6bde2b=!![];}}if(_0x6bde2b){logger[_0x0535('0x10')](_0x0535('0x15'),_0x5be6ed['adminId']);_0x183f37(_0x5be6ed);}else{_0x386743({'statusCode':0x194,'message':_0x0535('0x16')});}}else{_0x386743({'statusCode':0x194,'message':_0x0535('0x16')});}})[_0x0535('0x17')](function(_0x2d0fca){logger[_0x0535('0x18')]('['+[_0x16d5f0[_0x0535('0x19')]()]+']',_0x2d0fca[_0x0535('0x1a')]);_0x386743(_0x2d0fca);});});}function getUser(_0x48efa4,_0x2bcae4,_0x539a78){return function(_0x562016){return new Promise(function(_0x52f532,_0x4745ff){var _0x3d4014={'method':_0x0535('0xd'),'uri':_0x539a78+_0x0535('0xe'),'json':!![]};_0x3d4014[_0x0535('0xf')]=_0x2bcae4;logger[_0x0535('0x10')](_0x0535('0x1b'));return rp(_0x3d4014)['then'](function(_0x41f572){if(_0x41f572){var _0x268db1=_0x41f572['users'];var _0x4dc893=![];var _0x28ab05=null;if(_0x562016[_0x0535('0x1c')]!==null){logger[_0x0535('0x10')](_0x0535('0x1d'),_0x562016['agentEmail']);_0x562016[_0x0535('0x1e')]=_0x562016[_0x0535('0x1c')];for(_0x28ab05=0x0;_0x28ab05<_0x268db1[_0x0535('0x13')];_0x28ab05++){if(_0x268db1[_0x28ab05][_0x0535('0x1f')]===_0x562016[_0x0535('0x1c')]){_0x4dc893=!![];_0x562016['userId']=_0x268db1[_0x28ab05]['id'];logger[_0x0535('0x10')](_0x0535('0x20'),_0x562016['userId']);}}}if(!_0x4dc893){logger[_0x0535('0x10')](_0x0535('0x21'));_0x562016[_0x0535('0x1e')]=_0x562016[_0x0535('0x14')];_0x562016['userId']=_0x562016[_0x0535('0x22')];_0x4dc893=!![];}if(_0x4dc893){_0x52f532(_0x562016);}else{_0x4745ff({'statusCode':0x194,'message':_0x0535('0x16')});}}else{_0x4745ff({'statusCode':0x194,'message':_0x0535('0x16')});}})[_0x0535('0x17')](function(_0x10d157){logger[_0x0535('0x18')]('['+[_0x48efa4[_0x0535('0x19')]()]+']',_0x10d157['message']);_0x4745ff(_0x10d157);});});};}function getEndUser(_0xe0972c,_0x434032,_0x2e77ae){return function(_0x1d1556){return new Promise(function(_0x4a3f72,_0x47d7d1){var _0xad60b2=0x0;var _0x11fa6d={'method':'GET','uri':_0x2e77ae+'/api/contacts/filters','json':!![]};_0x11fa6d[_0x0535('0xf')]=_0x434032;logger[_0x0535('0x10')](_0x0535('0x23'));return rp(_0x11fa6d)[_0x0535('0x24')](function(_0x1561d1){_0x1561d1[_0x0535('0x25')][_0x0535('0x26')](function(_0x20467e){if(_0x20467e[_0x0535('0x27')]===_0x0535('0x28')){_0xad60b2=_0x20467e['id'];}});})[_0x0535('0x24')](function(){logger[_0x0535('0x10')](_0x0535('0x29'));var _0x1be73a={'method':_0x0535('0xd'),'uri':_0x2e77ae+_0x0535('0x2a')+_0xad60b2,'json':!![]};_0x1be73a[_0x0535('0xf')]=_0x434032;return rp(_0x1be73a);})[_0x0535('0x24')](function(_0x4cb945){logger[_0x0535('0x10')](_0x0535('0x2b'),_0x1d1556['contactNumber']);if(_0x4cb945[_0x0535('0x2c')][_0x0535('0x13')]>0x0){var _0x434629=_[_0x0535('0x2d')](_0x4cb945[_0x0535('0x2c')],function(_0x566aeb){if(_0x566aeb[_0x0535('0x2e')]===_0x1d1556[_0x0535('0x2f')]||_0x566aeb[_0x0535('0x30')]===_0x1d1556[_0x0535('0x2f')]){return _0x566aeb;}});if(_0x434629){_0x1d1556[_0x0535('0x31')]=_0x434629['id'];logger[_0x0535('0x10')]('Contact\x20found:',_0x1d1556['endUserId']);_0x4a3f72(_0x1d1556);}else{return createEndUser(_0x1d1556,_0xe0972c,_0x434032,_0x2e77ae)[_0x0535('0x24')](function(_0x722d2){logger[_0x0535('0x10')](_0x0535('0x32'),_0x1d1556[_0x0535('0x31')]);_0x4a3f72(_0x722d2);});}}else{return createEndUser(_0x1d1556,_0xe0972c,_0x434032,_0x2e77ae)['then'](function(_0x1d932b){logger[_0x0535('0x10')](_0x0535('0x32'),_0x1d1556[_0x0535('0x31')]);_0x4a3f72(_0x1d932b);});}})[_0x0535('0x17')](function(_0x28becd){throw new Error(_0x28becd['message']);});});};}function createEndUser(_0x5df53e,_0x3b85a3,_0x2236af,_0x43dde5){return new Promise(function(_0x23190c,_0xac065f){var _0x303bd0=moment();var _0x257e33={'method':'POST','uri':_0x43dde5+_0x0535('0x33'),'body':{'contact':{'last_name':_0x5df53e[_0x0535('0x2f')],'work_number':_0x5df53e['contactNumber'],'mobile_number':_0x5df53e[_0x0535('0x2f')],'owner_id':_0x5df53e[_0x0535('0x34')],'created_at':_0x303bd0[_0x0535('0x35')](_0x0535('0x36'))}},'json':!![]};_0x257e33[_0x0535('0xf')]=_0x2236af;logger['info'](_0x0535('0x37'));return rp(_0x257e33)['then'](function(_0x56318a){_0x5df53e[_0x0535('0x31')]=_0x56318a[_0x0535('0x38')]['id'];_0x23190c(_0x5df53e);})['catch'](function(_0x8260c7){logger[_0x0535('0x18')]('['+[_0x3b85a3['toUpperCase']()]+']',_0x8260c7[_0x0535('0x1a')]);_0xac065f(_0x8260c7['message']);});});}function getTicket(_0x56885c,_0x3db580,_0x155a4b,_0x2ab203,_0x8532b8){return function(_0x5871b5){logger[_0x0535('0x10')](_0x0535('0x39'));return new Promise(function(_0x40f13d,_0x3a9c7c){var _0x4a0341=moment();var _0x51fa32={'method':_0x0535('0x3a'),'uri':_0x155a4b+_0x0535('0x3b'),'body':{'title':intUtil[_0x0535('0x3c')](_0x2ab203[_0x0535('0x3d')],_0x8532b8,'\x20'),'description':intUtil[_0x0535('0x3c')](_0x2ab203[_0x0535('0x3e')],_0x8532b8,'\x0a'),'owner_id':_0x5871b5['userId'],'creater_id':_0x5871b5[_0x0535('0x22')],'targetable_id':_0x5871b5[_0x0535('0x31')],'targetable_type':_0x0535('0x3f'),'created_at':_0x4a0341[_0x0535('0x35')](_0x0535('0x36')),'due_date':_0x4a0341[_0x0535('0x40')](0x1e,'m')[_0x0535('0x35')](_0x0535('0x36'))},'json':!![]};_0x51fa32[_0x0535('0xf')]=_0x3db580;return rp(_0x51fa32)[_0x0535('0x24')](function(_0x367a8b){_0x5871b5['ticketId']=_0x367a8b[_0x0535('0x41')]['id'];logger['info'](_0x0535('0x42'),_0x5871b5[_0x0535('0x43')]);_0x40f13d(_0x5871b5);})[_0x0535('0x17')](function(_0x4e8b11){logger[_0x0535('0x18')]('['+[_0x56885c[_0x0535('0x19')]()]+']',_0x4e8b11[_0x0535('0x1a')]);_0x3a9c7c(_0x4e8b11['message']);});});};}function emit(_0xb05bcc,_0xe680bf,_0x3d830d){var _0x56fb99={'uri':_0xb05bcc+_0x0535('0x44')+_0x3d830d};io['to'](util[_0x0535('0x35')](_0x0535('0x45'),_0xe680bf))['emit'](_0x0535('0x46'),_0x56fb99);}exports['cs']=function(_0x64513b,_0x51cc26,_0x5c3365,_0x4ee89f,_0x2c5041,_0x566a40,_0x25c0ee,_0xb1654d){var _0x1dbbea={};var _0x6040eb={'Authorization':_0x0535('0x47')+_0x566a40[_0x0535('0x48')]};_0x566a40[_0x0535('0x49')]=intUtil[_0x0535('0x4a')](_0x566a40[_0x0535('0x49')]);_0x566a40[_0x0535('0x4b')]=intUtil['stripTrailingSlash'](_0x566a40[_0x0535('0x4b')]);var _0x305fc0=_0x566a40['remoteUri'];_0x1dbbea[_0x0535('0x14')]=_0x566a40['username'];_0x1dbbea[_0x0535('0x2f')]=_0xb1654d['toLowerCase']()===_0x0535('0x4c')?_0x51cc26[_0x0535('0x4d')]:_0x51cc26[_0x0535('0x4e')];_0x1dbbea[_0x0535('0x4f')]=_0xb1654d==='queue'||_0xb1654d==='unmanaged'?'queue':_0x0535('0x4c');if(_0x4ee89f){_0x1dbbea[_0x0535('0x1c')]=_0x4ee89f['email'];}var _0x5788c3=util[_0x0535('0x35')](_0x0535('0x50'),_0x566a40[_0x0535('0x4b')],_0x51cc26[_0x0535('0x51')],md5(_0x51cc26['uniqueid']));if(_0x2c5041&&_0x2c5041[_0x0535('0x52')]){logger['info']('[QUEUE]','Recording\x20is\x20enabled!');_0x51cc26[_0x0535('0x53')]=_0x5788c3;}else if(_0x25c0ee&&_0x25c0ee[_0x0535('0x54')]&&_0x25c0ee[_0x0535('0x54')]!=='none'){logger[_0x0535('0x10')](_0x0535('0x55'),_0x0535('0x56'));_0x51cc26[_0x0535('0x53')]=_0x5788c3;}else{_0x51cc26[_0x0535('0x53')]='';}return getAdminId(_0x1dbbea,_0xb1654d,_0x6040eb,_0x305fc0)[_0x0535('0x24')](getUser(_0xb1654d,_0x6040eb,_0x305fc0))[_0x0535('0x24')](getEndUser(_0xb1654d,_0x6040eb,_0x305fc0))[_0x0535('0x24')](getTicket(_0xb1654d,_0x6040eb,_0x305fc0,_0x5c3365,_0x51cc26))[_0x0535('0x24')](function(_0x1acd4f){logger[_0x0535('0x10')](util['format'](_0x0535('0x57'),_0x1acd4f[_0x0535('0x43')]));if(_0xb1654d!==_0x0535('0x58')){logger[_0x0535('0x10')]('['+[_0xb1654d['toUpperCase']()]+']',_0x0535('0x59'));emit(_0x305fc0,_0x4ee89f['name'],_0x1acd4f[_0x0535('0x31')]);}})[_0x0535('0x17')](function(_0x4d7996){logger[_0x0535('0x18')]('['+[_0xb1654d[_0x0535('0x19')]()]+']\x20Error\x20running\x20Freshsales\x20integration',util[_0x0535('0x5a')](_0x4d7996,{'showHidden':!![],'depth':null}));});};
\ No newline at end of file
diff --git a/server/services/ami/trigger/integration/index.js b/server/services/ami/trigger/integration/index.js
index 8e5bf77..dd4f41e 100644
--- a/server/services/ami/trigger/integration/index.js
+++ b/server/services/ami/trigger/integration/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x8e3f=['%s\x20configuration\x20#%s\x20not\x20found','[EXEC]','%s\x20account\x20#%s\x20not\x20found','lodash','util','./zendesk','./sugarcrm','./freshdesk','./zoho','./vtiger','./servicenow','./freshsales','zendesk','salesforce','sugarcrm','zoho','desk','vtiger','dynamics365','freshsales','servicenow','exec','includes','data1','toLowerCase','data2','find','data3','queue','routeId','outbound','unmanaged','freshdesk','log','unknown\x20integration','../../../../config/logger','error','format'];(function(_0x710815,_0x520da8){var _0x5b3b89=function(_0x2e1a8e){while(--_0x2e1a8e){_0x710815['push'](_0x710815['shift']());}};_0x5b3b89(++_0x520da8);}(_0x8e3f,0xc1));var _0xf8e3=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x8e3f[_0x122ef9];return _0x42fba0;};'use strict';var _=require(_0xf8e3('0x0'));var util=require(_0xf8e3('0x1'));var zendesk=require(_0xf8e3('0x2'));var salesforce=require('./salesforce');var sugarcrm=require(_0xf8e3('0x3'));var freshdesk=require(_0xf8e3('0x4'));var zoho=require(_0xf8e3('0x5'));var desk=require('./desk');var vtiger=require(_0xf8e3('0x6'));var servicenow=require(_0xf8e3('0x7'));var dynamics365=require('./dynamics365');var freshsales=require(_0xf8e3('0x8'));var integrations=[_0xf8e3('0x9'),_0xf8e3('0xa'),_0xf8e3('0xb'),'freshdesk',_0xf8e3('0xc'),_0xf8e3('0xd'),_0xf8e3('0xe'),_0xf8e3('0xf'),_0xf8e3('0x10'),_0xf8e3('0x11')];exports[_0xf8e3('0x12')]=function(_0x2a3b59,_0x2d914d,_0x2bc3cd,_0x28f5f0,_0xe584cd,_0x5e4b87){if(_0x2bc3cd){if(_[_0xf8e3('0x13')](integrations,_0x2a3b59[_0xf8e3('0x14')][_0xf8e3('0x15')]())){try{var _0x4888eb=null;var _0x40ae02='';var _0x41f85e=_0x2bc3cd[_0x2a3b59[_0xf8e3('0x14')][_0xf8e3('0x15')]()];if(_0x41f85e){var _0x565c04=_0x41f85e[_0x2a3b59[_0xf8e3('0x16')]];if(_0x565c04){var _0xa856f5=_[_0xf8e3('0x17')](_0x565c04['Configurations'],{'id':parseInt(_0x2a3b59[_0xf8e3('0x18')],0xa)});if(_0xa856f5){if(_0x28f5f0){if(_0xe584cd&&_0x2d914d['queue']){_0x40ae02=_0xf8e3('0x19');}else if(_0x2d914d[_0xf8e3('0x1a')]){_0x40ae02=_0xf8e3('0x1b');}else{console['log']('EVENT\x20UNKNOWN',_0x2d914d);}}else{_0x40ae02=_0xf8e3('0x1c');}switch(_0x2a3b59[_0xf8e3('0x14')][_0xf8e3('0x15')]()){case _0xf8e3('0x9'):zendesk[_0x40ae02](_0x2a3b59,_0x2d914d,_0xa856f5,_0x28f5f0,_0xe584cd,_0x565c04,_0x5e4b87);break;case _0xf8e3('0xa'):salesforce[_0x40ae02](_0x2a3b59,_0x2d914d,_0xa856f5,_0x28f5f0,_0xe584cd,_0x565c04,_0x5e4b87);break;case _0xf8e3('0xb'):sugarcrm[_0x40ae02](_0x2a3b59,_0x2d914d,_0xa856f5,_0x28f5f0,_0xe584cd,_0x565c04,_0x5e4b87);break;case _0xf8e3('0x1d'):freshdesk[_0x40ae02](_0x2a3b59,_0x2d914d,_0xa856f5,_0x28f5f0,_0xe584cd,_0x565c04,_0x5e4b87);break;case _0xf8e3('0xc'):zoho[_0x40ae02](_0x2a3b59,_0x2d914d,_0xa856f5,_0x28f5f0,_0xe584cd,_0x565c04,_0x5e4b87);break;case _0xf8e3('0xd'):desk[_0x40ae02](_0x2a3b59,_0x2d914d,_0xa856f5,_0x28f5f0,_0xe584cd,_0x565c04,_0x5e4b87);break;case _0xf8e3('0xe'):vtiger[_0x40ae02](_0x2a3b59,_0x2d914d,_0xa856f5,_0x28f5f0,_0xe584cd,_0x565c04,_0x5e4b87);break;case'freshsales':freshsales['cs'](_0x2a3b59,_0x2d914d,_0xa856f5,_0x28f5f0,_0xe584cd,_0x565c04,_0x5e4b87,_0x40ae02);break;case _0xf8e3('0x11'):servicenow['cs'](_0x2a3b59,_0x2d914d,_0xa856f5,_0x28f5f0,_0xe584cd,_0x565c04,_0x5e4b87,_0x40ae02);break;case _0xf8e3('0xf'):dynamics365['cs'](_0x2a3b59,_0x2d914d,_0xa856f5,_0x28f5f0,_0xe584cd,_0x565c04,_0x5e4b87,_0x40ae02);break;default:console[_0xf8e3('0x1e')](_0xf8e3('0x1f'));}}else{_0x4888eb=require(_0xf8e3('0x20'))(_0x2a3b59[_0xf8e3('0x14')][_0xf8e3('0x15')]());_0x4888eb[_0xf8e3('0x21')]('[EXEC]',util[_0xf8e3('0x22')](_0xf8e3('0x23'),_0x2a3b59[_0xf8e3('0x14')][_0xf8e3('0x15')](),_0x2a3b59['data3']));}}else{_0x4888eb=require(_0xf8e3('0x20'))(_0x2a3b59['data1'][_0xf8e3('0x15')]());_0x4888eb[_0xf8e3('0x21')](_0xf8e3('0x24'),util[_0xf8e3('0x22')](_0xf8e3('0x25'),_0x2a3b59[_0xf8e3('0x14')]['toLowerCase'](),_0x2a3b59[_0xf8e3('0x16')]));}}else{}}catch(_0x2fc674){console[_0xf8e3('0x21')](_0x2fc674);}}}};
\ No newline at end of file
+var _0x5eb8=['data1','data2','find','Configurations','data3','queue','outbound','EVENT\x20UNKNOWN','unmanaged','toLowerCase','vtiger','freshsales','log','unknown\x20integration','../../../../config/logger','format','%s\x20configuration\x20#%s\x20not\x20found','[EXEC]','%s\x20account\x20#%s\x20not\x20found','error','./zendesk','./salesforce','./sugarcrm','./freshdesk','./zoho','./desk','./vtiger','./servicenow','./dynamics365','./freshsales','zendesk','salesforce','freshdesk','zoho','desk','dynamics365','servicenow','exec','includes'];(function(_0x5658e6,_0x133234){var _0x32cf9e=function(_0x1c0f7d){while(--_0x1c0f7d){_0x5658e6['push'](_0x5658e6['shift']());}};_0x32cf9e(++_0x133234);}(_0x5eb8,0xb0));var _0x85eb=function(_0x5712f8,_0x17156b){_0x5712f8=_0x5712f8-0x0;var _0x14a364=_0x5eb8[_0x5712f8];return _0x14a364;};'use strict';var _=require('lodash');var util=require('util');var zendesk=require(_0x85eb('0x0'));var salesforce=require(_0x85eb('0x1'));var sugarcrm=require(_0x85eb('0x2'));var freshdesk=require(_0x85eb('0x3'));var zoho=require(_0x85eb('0x4'));var desk=require(_0x85eb('0x5'));var vtiger=require(_0x85eb('0x6'));var servicenow=require(_0x85eb('0x7'));var dynamics365=require(_0x85eb('0x8'));var freshsales=require(_0x85eb('0x9'));var integrations=[_0x85eb('0xa'),_0x85eb('0xb'),'sugarcrm',_0x85eb('0xc'),_0x85eb('0xd'),_0x85eb('0xe'),'vtiger',_0x85eb('0xf'),'freshsales',_0x85eb('0x10')];exports[_0x85eb('0x11')]=function(_0x673228,_0x29030b,_0x1dacf2,_0x73e6d0,_0x2c7fd3,_0x50ef6f){if(_0x1dacf2){if(_[_0x85eb('0x12')](integrations,_0x673228[_0x85eb('0x13')]['toLowerCase']())){try{var _0x2af376=null;var _0x784583='';var _0x2f42ba=_0x1dacf2[_0x673228[_0x85eb('0x13')]['toLowerCase']()];if(_0x2f42ba){var _0x548628=_0x2f42ba[_0x673228[_0x85eb('0x14')]];if(_0x548628){var _0x5c760a=_[_0x85eb('0x15')](_0x548628[_0x85eb('0x16')],{'id':parseInt(_0x673228[_0x85eb('0x17')],0xa)});if(_0x5c760a){if(_0x73e6d0){if(_0x2c7fd3&&_0x29030b[_0x85eb('0x18')]){_0x784583=_0x85eb('0x18');}else if(_0x29030b['routeId']){_0x784583=_0x85eb('0x19');}else{console['log'](_0x85eb('0x1a'),_0x29030b);}}else{_0x784583=_0x85eb('0x1b');}switch(_0x673228[_0x85eb('0x13')][_0x85eb('0x1c')]()){case'zendesk':zendesk[_0x784583](_0x673228,_0x29030b,_0x5c760a,_0x73e6d0,_0x2c7fd3,_0x548628,_0x50ef6f);break;case'salesforce':salesforce[_0x784583](_0x673228,_0x29030b,_0x5c760a,_0x73e6d0,_0x2c7fd3,_0x548628,_0x50ef6f);break;case'sugarcrm':sugarcrm[_0x784583](_0x673228,_0x29030b,_0x5c760a,_0x73e6d0,_0x2c7fd3,_0x548628,_0x50ef6f);break;case _0x85eb('0xc'):freshdesk[_0x784583](_0x673228,_0x29030b,_0x5c760a,_0x73e6d0,_0x2c7fd3,_0x548628,_0x50ef6f);break;case _0x85eb('0xd'):zoho[_0x784583](_0x673228,_0x29030b,_0x5c760a,_0x73e6d0,_0x2c7fd3,_0x548628,_0x50ef6f);break;case _0x85eb('0xe'):desk[_0x784583](_0x673228,_0x29030b,_0x5c760a,_0x73e6d0,_0x2c7fd3,_0x548628,_0x50ef6f);break;case _0x85eb('0x1d'):vtiger[_0x784583](_0x673228,_0x29030b,_0x5c760a,_0x73e6d0,_0x2c7fd3,_0x548628,_0x50ef6f);break;case _0x85eb('0x1e'):freshsales['cs'](_0x673228,_0x29030b,_0x5c760a,_0x73e6d0,_0x2c7fd3,_0x548628,_0x50ef6f,_0x784583);break;case _0x85eb('0x10'):servicenow['cs'](_0x673228,_0x29030b,_0x5c760a,_0x73e6d0,_0x2c7fd3,_0x548628,_0x50ef6f,_0x784583);break;case'dynamics365':dynamics365['cs'](_0x673228,_0x29030b,_0x5c760a,_0x73e6d0,_0x2c7fd3,_0x548628,_0x50ef6f,_0x784583);break;default:console[_0x85eb('0x1f')](_0x85eb('0x20'));}}else{_0x2af376=require(_0x85eb('0x21'))(_0x673228['data1']['toLowerCase']());_0x2af376['error']('[EXEC]',util[_0x85eb('0x22')](_0x85eb('0x23'),_0x673228[_0x85eb('0x13')][_0x85eb('0x1c')](),_0x673228[_0x85eb('0x17')]));}}else{_0x2af376=require(_0x85eb('0x21'))(_0x673228['data1']['toLowerCase']());_0x2af376['error'](_0x85eb('0x24'),util[_0x85eb('0x22')](_0x85eb('0x25'),_0x673228[_0x85eb('0x13')][_0x85eb('0x1c')](),_0x673228[_0x85eb('0x14')]));}}else{}}catch(_0x5dfc96){console[_0x85eb('0x26')](_0x5dfc96);}}}};
\ No newline at end of file
diff --git a/server/services/ami/trigger/integration/salesforce.js b/server/services/ami/trigger/integration/salesforce.js
index f05786e..c4713bd 100644
--- a/server/services/ami/trigger/integration/salesforce.js
+++ b/server/services/ami/trigger/integration/salesforce.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x5df0=['[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.','catch','outbound','recordingFormat','none','[OUTBOUND]','destcalleridnum','[OUTBOUND]\x20Ticket\x20%s\x20created.','Salesforce\x20account\x20type\x20not\x20recognized','stringify','unmanaged','lastevent','toUpperCase','calleridname',']\x20Integration\x20account\x20type\x20%s.','request-promise','moment','bluebird','md5','jsforce','util','ioredis','../../../../config/environment','../../../../config/logger','salesforce','redis','ticketType','assign','utc','Subjects','getString','Descriptions','WhoId','Case','ContactId','isNil','validateEmail','sobject','User','find','execute','then','length','Email','info','Agent\x20%s\x20found.','resolve','Name','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','identity','user_id','display_name','Task','Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.','moduleSearch','contact_lead','Lead','contact','Contact','lead','Phone','Enduser\x20with\x20phone\x20%s\x20not\x20found.','','Caller\x20-\x20%s','moduleCreate','Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','Company','No\x20Company','upperFirst','create','forEach','type','string','idField','content','toString','variable','variableName','customVariable','Variable','name','toLowerCase','password','concat','securityToken','Connection','remoteUri','clientSecret','queue','serverUrl','stripTrailingSlash','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','email','calleridnum','Fields','[QUEUE]\x20Ticket\x20%s\x20created','[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','integrationTab','format','user:%s','trigger:salesforce:display','newTab','trigger:browser:url','%s/%s/e','instanceUrl','error'];(function(_0x37698f,_0x1f669d){var _0x53db3c=function(_0xa2190e){while(--_0xa2190e){_0x37698f['push'](_0x37698f['shift']());}};_0x53db3c(++_0x1f669d);}(_0x5df0,0x15c));var _0x05df=function(_0x17cb1b,_0x12ae1b){_0x17cb1b=_0x17cb1b-0x0;var _0x21a7fa=_0x5df0[_0x17cb1b];return _0x21a7fa;};'use strict';var _=require('lodash');var rp=require(_0x05df('0x0'));var moment=require(_0x05df('0x1'));var BPromise=require(_0x05df('0x2'));var md5=require(_0x05df('0x3'));var jsforce=require(_0x05df('0x4'));var util=require(_0x05df('0x5'));var Redis=require(_0x05df('0x6'));var intUtil=require('./util');var config=require(_0x05df('0x7'));var logger=require(_0x05df('0x8'))(_0x05df('0x9'));config[_0x05df('0xa')]=_['defaults'](config[_0x05df('0xa')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x05df('0xa')]));function emit(_0x5740f1,_0x331c56,_0xd518b8){io['to'](_0x5740f1)['emit'](_0x331c56,_0xd518b8);}function getTicket(_0x354173,_0x403d35,_0x1618e6,_0x2e7a10,_0x417d8a,_0x13724d,_0x59c5ee,_0x2f3fbc){var _0x25de78={};if(_0x2e7a10[_0x05df('0xb')]==='Task'){_0x25de78=Object[_0x05df('0xc')]({},{'OwnerId':_0x403d35['id'],'ActivityDate':moment[_0x05df('0xd')](),'IsReminderSet':![],'IsRecurrence':![],'Subject':intUtil['getString'](_0x2e7a10[_0x05df('0xe')],_0x417d8a,'\x20'),'Description':intUtil[_0x05df('0xf')](_0x2e7a10[_0x05df('0x10')],_0x417d8a,'\x0a')},getCustomFields(_0x13724d,_0x417d8a));if(_0x1618e6){_0x25de78[_0x05df('0x11')]=_0x1618e6['id'];}}else if(_0x2e7a10[_0x05df('0xb')]===_0x05df('0x12')){_0x25de78=Object[_0x05df('0xc')]({},{'OwnerId':_0x403d35['id'],'Subject':intUtil['getString'](_0x2e7a10['Subjects'],_0x417d8a,'\x20'),'Description':intUtil['getString'](_0x2e7a10[_0x05df('0x10')],_0x417d8a,'\x0a')},getCustomFields(_0x13724d,_0x417d8a));if(_0x1618e6){_0x25de78[_0x05df('0x13')]=_0x1618e6['id'];}}return _0x59c5ee['sobject'](_0x2e7a10[_0x05df('0xb')])['create'](_0x25de78);}function getUser(_0x742c91,_0x1e7991,_0x162ab6){if(!_[_0x05df('0x14')](_0x1e7991)&&intUtil[_0x05df('0x15')](_0x1e7991)){var _0x1661ce={'Email':_0x1e7991};var _0x3c21a4={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x162ab6[_0x05df('0x16')](_0x05df('0x17'))[_0x05df('0x18')](_0x1661ce,_0x3c21a4)[_0x05df('0x19')]()[_0x05df('0x1a')](function(_0x2403da){if(_0x2403da[_0x05df('0x1b')]){var _0x1b035d=_[_0x05df('0x18')](_0x2403da,function(_0x42fdcb){return _0x42fdcb[_0x05df('0x1c')]===_0x1e7991;});if(_0x1b035d){logger[_0x05df('0x1d')](_0x05df('0x1e'),_0x1e7991);return BPromise[_0x05df('0x1f')]({'id':_0x1b035d['Id'],'name':_0x1b035d[_0x05df('0x20')]});}}else{logger[_0x05df('0x1d')](_0x05df('0x21'),_0x1e7991);return _0x162ab6[_0x05df('0x22')]()['then'](function(_0x16435d){return BPromise[_0x05df('0x1f')]({'id':_0x16435d[_0x05df('0x23')],'name':_0x16435d[_0x05df('0x24')]});});}});}else{logger[_0x05df('0x1d')](_0x05df('0x21'),_0x1e7991);return _0x162ab6[_0x05df('0x22')]()[_0x05df('0x1a')](function(_0x547e7b){return BPromise['resolve']({'id':_0x547e7b[_0x05df('0x23')],'name':_0x547e7b['display_name']});});}}function getEndUser(_0xc4b9de,_0x53176d,_0x4298ac,_0x109e5f,_0x9bc072){var _0x5efb97={'Phone':_0x109e5f};var _0x6502ff={'Id':!![],'Name':!![],'Phone':!![]};return BPromise[_0x05df('0x1f')]()['then'](function(){if(_0x53176d['ticketType']===_0x05df('0x25')){logger[_0x05df('0x1d')](_0x05df('0x26'),_0x109e5f,_0x53176d[_0x05df('0x27')]);switch(_0x53176d[_0x05df('0x27')]){case _0x05df('0x28'):return _0x9bc072[_0x05df('0x16')]('Contact')['find'](_0x5efb97,_0x6502ff)[_0x05df('0x19')]()[_0x05df('0x1a')](function(_0x604b6f){if(_0x604b6f&&_0x604b6f[_0x05df('0x1b')]){return _0x604b6f;}else{return _0x9bc072['sobject'](_0x05df('0x29'))[_0x05df('0x18')](_0x5efb97,_0x6502ff);}});case _0x05df('0x2a'):return _0x9bc072[_0x05df('0x16')](_0x05df('0x2b'))[_0x05df('0x18')](_0x5efb97,_0x6502ff)['execute']();case _0x05df('0x2c'):return _0x9bc072[_0x05df('0x16')](_0x05df('0x29'))[_0x05df('0x18')](_0x5efb97,_0x6502ff);default:return null;}}else if(_0x53176d[_0x05df('0xb')]==='Case'){logger[_0x05df('0x1d')](_0x05df('0x26'),_0x109e5f,_0x05df('0x2a'));return _0x9bc072[_0x05df('0x16')](_0x05df('0x2b'))[_0x05df('0x18')](_0x5efb97,_0x6502ff)[_0x05df('0x19')]();}})[_0x05df('0x1a')](function(_0x365eaa){if(_0x365eaa&&_0x365eaa[_0x05df('0x1b')]){var _0x363a3e=_['find'](_0x365eaa,function(_0x102264){return _0x102264[_0x05df('0x2d')]===_0x109e5f;});if(_0x363a3e){return BPromise['resolve']({'id':_0x363a3e['Id'],'name':_0x363a3e[_0x05df('0x20')],'phone':_0x363a3e[_0x05df('0x2d')]});}}})['then'](function(_0x562e63){if(_0x562e63){logger[_0x05df('0x1d')]('Enduser\x20with\x20phone\x20%s\x20found.',_0x109e5f);return BPromise['resolve'](_0x562e63);}else{logger[_0x05df('0x1d')](_0x05df('0x2e'),_0x109e5f);var _0x542686={'LastName':_0x4298ac!==_0x05df('0x2f')?_0x4298ac:util['format'](_0x05df('0x30'),_0x109e5f),'Phone':_0x109e5f};if(_0x53176d[_0x05df('0x31')]){if(_0x53176d[_0x05df('0x31')]===_0x05df('0x2a')){logger[_0x05df('0x1d')](_0x05df('0x32'),_0x109e5f,_0x53176d[_0x05df('0x31')]);}else if(_0x53176d['moduleCreate']===_0x05df('0x2c')&&_0x53176d['ticketType']===_0x05df('0x25')){logger[_0x05df('0x1d')](_0x05df('0x32'),_0x109e5f,_0x53176d[_0x05df('0x31')]);_0x542686[_0x05df('0x33')]=_0x05df('0x34');}else{return null;}}return _0x9bc072[_0x05df('0x16')](_[_0x05df('0x35')](_0x53176d[_0x05df('0x31')]))[_0x05df('0x36')](_0x542686);}});}function getCustomFields(_0x2a2a08,_0x43505d){var _0x125cca={};if(_0x2a2a08[_0x05df('0x1b')]>0x0){_[_0x05df('0x37')](_0x2a2a08,function(_0x223f90){if(_0x223f90[_0x05df('0x38')]===_0x05df('0x39')&&_0x223f90[_0x05df('0x3a')]){_0x125cca[_0x223f90['idField']]=_0x223f90[_0x05df('0x3b')][_0x05df('0x3c')]();}else if(_0x223f90[_0x05df('0x38')]===_0x05df('0x3d')&&_0x223f90['variableName']&&_0x223f90[_0x05df('0x3a')]){_0x43505d[_0x223f90[_0x05df('0x3e')]]&&(_0x125cca[_0x223f90[_0x05df('0x3a')]]=_0x43505d[_0x223f90[_0x05df('0x3e')]][_0x05df('0x3c')]());}else if(_0x223f90['type']===_0x05df('0x3f')&&_0x223f90['Variable']&&_0x223f90[_0x05df('0x40')][_0x05df('0x41')]&&_0x223f90[_0x05df('0x3a')]){_0x43505d[_0x223f90['Variable']['name'][_0x05df('0x42')]()]&&(_0x125cca[_0x223f90[_0x05df('0x3a')]]=_0x43505d[_0x223f90[_0x05df('0x40')][_0x05df('0x41')][_0x05df('0x42')]()][_0x05df('0x3c')]());}});}return _0x125cca;}function getConnection(_0x482e84){var _0x3ae4fd=_0x482e84[_0x05df('0x43')][_0x05df('0x44')](_0x482e84[_0x05df('0x45')]);var _0x108a58=new jsforce[(_0x05df('0x46'))]({'oauth2':{'loginUrl':_0x482e84[_0x05df('0x47')]||'https://login.salesforce.com','clientId':_0x482e84['clientId'],'clientSecret':_0x482e84[_0x05df('0x48')]}});return _0x108a58['login'](_0x482e84['username'],_0x3ae4fd)['then'](function(){logger[_0x05df('0x1d')]('Connection\x20established.');return _0x108a58;});}exports[_0x05df('0x49')]=function(_0x573b22,_0x23a436,_0x5de05f,_0x3e0ace,_0x2e6a9c,_0x2ee379){var _0x1917ee,_0x3061be,_0x1a1fe2,_0x277359;_0x2ee379[_0x05df('0x4a')]=intUtil[_0x05df('0x4b')](_0x2ee379[_0x05df('0x4a')]);_0x2ee379[_0x05df('0x47')]=intUtil['stripTrailingSlash'](_0x2ee379[_0x05df('0x47')]);if(_0x2e6a9c&&_0x2e6a9c[_0x05df('0x4c')]){logger[_0x05df('0x1d')](_0x05df('0x4d'),_0x05df('0x4e'));_0x23a436[_0x05df('0x4f')]=util['format'](_0x05df('0x50'),_0x2ee379['serverUrl'],_0x23a436[_0x05df('0x51')],md5(_0x23a436[_0x05df('0x51')]));}else{_0x23a436['recordingURL']='';}return getConnection(_0x2ee379)[_0x05df('0x1a')](function(_0x1f7c00){_0x277359=_0x1f7c00;return getUser(_0x2ee379,_0x3e0ace[_0x05df('0x52')],_0x277359);})[_0x05df('0x1a')](function(_0x5bf626){_0x1917ee=_0x5bf626;return getEndUser(_0x2ee379,_0x5de05f,_0x23a436['calleridname'],_0x23a436[_0x05df('0x53')],_0x277359);})[_0x05df('0x1a')](function(_0x238331){_0x3061be=_0x238331;return getTicket(_0x2ee379,_0x1917ee,_0x3061be,_0x5de05f,_0x23a436,_0x5de05f[_0x05df('0x54')],_0x277359,_0x05df('0x49'));})[_0x05df('0x1a')](function(_0x8d50bc){_0x1a1fe2=_0x8d50bc;logger[_0x05df('0x1d')](_0x05df('0x55'),_0x1a1fe2['id']);logger[_0x05df('0x1d')](_0x05df('0x56'),_0x1a1fe2['id'],_0x3e0ace[_0x05df('0x41')],_0x2ee379[_0x05df('0x38')]);switch(_0x2ee379[_0x05df('0x38')]){case _0x05df('0x57'):emit(util[_0x05df('0x58')](_0x05df('0x59'),_0x3e0ace[_0x05df('0x41')]),_0x05df('0x5a'),{'recordId':_0x1a1fe2['id']});break;case _0x05df('0x5b'):emit(util['format'](_0x05df('0x59'),_0x3e0ace['name']),_0x05df('0x5c'),{'uri':util[_0x05df('0x58')](_0x05df('0x5d'),_0x277359[_0x05df('0x5e')],_0x1a1fe2['id'])});break;default:logger[_0x05df('0x5f')](_0x05df('0x60'));}})[_0x05df('0x61')](function(_0x4e71b4){logger['error'](_0x05df('0x4d'),JSON['stringify'](_0x4e71b4));});};exports[_0x05df('0x62')]=function(_0xd59dad,_0x2cb32c,_0x44c04c,_0x389d04,_0x2a5212,_0x1178e0,_0x5d7381){var _0x3f95d0,_0x299c00,_0x584fe9,_0x391d0b;_0x1178e0[_0x05df('0x4a')]=intUtil[_0x05df('0x4b')](_0x1178e0[_0x05df('0x4a')]);_0x1178e0['remoteUri']=intUtil[_0x05df('0x4b')](_0x1178e0[_0x05df('0x47')]);if(_0x5d7381&&_0x5d7381['recordingFormat']&&_0x5d7381[_0x05df('0x63')]!==_0x05df('0x64')){logger[_0x05df('0x1d')](_0x05df('0x65'),_0x05df('0x4e'));_0x2cb32c[_0x05df('0x4f')]=util[_0x05df('0x58')](_0x05df('0x50'),_0x1178e0[_0x05df('0x4a')],_0x2cb32c[_0x05df('0x51')],md5(_0x2cb32c[_0x05df('0x51')]));}return getConnection(_0x1178e0)['then'](function(_0x6a2dc2){_0x391d0b=_0x6a2dc2;return getUser(_0x1178e0,_0x389d04[_0x05df('0x52')],_0x391d0b);})[_0x05df('0x1a')](function(_0x1f59bb){_0x3f95d0=_0x1f59bb;return getEndUser(_0x1178e0,_0x44c04c,_0x2cb32c['destcalleridname'],_0x2cb32c[_0x05df('0x66')],_0x391d0b);})['then'](function(_0x50d0c4){_0x299c00=_0x50d0c4;return getTicket(_0x1178e0,_0x3f95d0,_0x299c00,_0x44c04c,_0x2cb32c,_0x44c04c[_0x05df('0x54')],_0x391d0b,_0x05df('0x62'));})[_0x05df('0x1a')](function(_0x9ae369){_0x584fe9=_0x9ae369;logger[_0x05df('0x1d')](_0x05df('0x67'),_0x584fe9['id']);logger['info']('[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.',_0x584fe9['id'],_0x389d04['name'],_0x1178e0[_0x05df('0x38')]);switch(_0x1178e0[_0x05df('0x38')]){case _0x05df('0x57'):emit(util[_0x05df('0x58')](_0x05df('0x59'),_0x389d04[_0x05df('0x41')]),_0x05df('0x5a'),{'recordId':_0x584fe9['id']});break;case _0x05df('0x5b'):emit(util[_0x05df('0x58')]('user:%s',_0x389d04['name']),_0x05df('0x5c'),{'uri':util[_0x05df('0x58')](_0x05df('0x5d'),_0x391d0b[_0x05df('0x5e')],_0x584fe9['id'])});break;default:logger[_0x05df('0x5f')](_0x05df('0x65'),_0x05df('0x68'));}})[_0x05df('0x61')](function(_0x15bdd7){logger[_0x05df('0x5f')](_0x05df('0x65'),JSON[_0x05df('0x69')](_0x15bdd7));});};exports[_0x05df('0x6a')]=function(_0x2b16ed,_0x279fed,_0x3dbc58,_0x1495a9,_0x567f6a,_0x35e448){var _0x16afec,_0x5e7da5,_0x4c888e,_0x598a5a;_0x35e448['serverUrl']=intUtil[_0x05df('0x4b')](_0x35e448[_0x05df('0x4a')]);_0x35e448[_0x05df('0x47')]=intUtil['stripTrailingSlash'](_0x35e448[_0x05df('0x47')]);if(_0x567f6a&&_0x567f6a[_0x05df('0x4c')]){logger[_0x05df('0x1d')]('['+_0x279fed[_0x05df('0x6b')][_0x05df('0x6c')]()+']',_0x05df('0x4e'));_0x279fed[_0x05df('0x4f')]=util[_0x05df('0x58')](_0x05df('0x50'),_0x35e448[_0x05df('0x4a')],_0x279fed[_0x05df('0x51')],md5(_0x279fed[_0x05df('0x51')]));}else{_0x279fed['recordingURL']='';}return getConnection(_0x35e448)[_0x05df('0x1a')](function(_0x5d9a83){_0x598a5a=_0x5d9a83;if(!_[_0x05df('0x14')](_0x1495a9)){return getUser(_0x35e448,_0x1495a9['name'],_0x598a5a);}else{return getUser(_0x35e448,null,_0x598a5a);}})['then'](function(_0x23f969){_0x16afec=_0x23f969;return getEndUser(_0x35e448,_0x3dbc58,_0x279fed[_0x05df('0x6d')],_0x279fed['calleridnum'],_0x598a5a);})[_0x05df('0x1a')](function(_0x2019ed){_0x5e7da5=_0x2019ed;return getTicket(_0x35e448,_0x16afec,_0x5e7da5,_0x3dbc58,_0x279fed,_0x3dbc58[_0x05df('0x54')],_0x598a5a);})[_0x05df('0x1a')](function(_0x4f3f14){_0x4c888e=_0x4f3f14;logger['info']('['+_0x279fed['lastevent'][_0x05df('0x6c')]()+']\x20Ticket\x20%s\x20created.',_0x4c888e['id']);logger['info']('['+_0x279fed[_0x05df('0x6b')][_0x05df('0x6c')]()+_0x05df('0x6e'),_0x35e448['type']);})[_0x05df('0x61')](function(_0x1be491){logger[_0x05df('0x5f')]('['+_0x279fed[_0x05df('0x6b')]['toUpperCase']()+']',JSON[_0x05df('0x69')](_0x1be491));});};
\ No newline at end of file
+var _0x7afa=['validateEmail','User','find','execute','then','length','Email','info','Agent\x20%s\x20found.','resolve','Name','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','identity','user_id','display_name','Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.','moduleSearch','contact_lead','Contact','Lead','contact','lead','Case','Phone','Enduser\x20with\x20phone\x20%s\x20found.','Enduser\x20with\x20phone\x20%s\x20not\x20found.','format','moduleCreate','Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','Company','No\x20Company','forEach','type','string','idField','content','toString','variableName','customVariable','Variable','toLowerCase','password','concat','securityToken','https://login.salesforce.com','clientId','clientSecret','login','username','Connection\x20established.','serverUrl','stripTrailingSlash','remoteUri','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','calleridname','Fields','queue','[QUEUE]\x20Ticket\x20%s\x20created','[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','name','integrationTab','user:%s','newTab','instanceUrl','error','[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.','catch','stringify','outbound','recordingFormat','[OUTBOUND]','uniqueid','email','destcalleridname','[OUTBOUND]\x20Ticket\x20%s\x20created.','[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','trigger:browser:url','%s/%s/e','Salesforce\x20account\x20type\x20not\x20recognized','unmanaged','lastevent','toUpperCase','calleridnum',']\x20Ticket\x20%s\x20created.','lodash','request-promise','moment','bluebird','jsforce','util','ioredis','./util','../../../../config/environment','../../../../config/logger','salesforce','defaults','redis','localhost','socket.io-emitter','emit','ticketType','Task','assign','utc','Subjects','getString','Descriptions','WhoId','sobject','create','isNil'];(function(_0x3b601f,_0x249171){var _0x421392=function(_0x541480){while(--_0x541480){_0x3b601f['push'](_0x3b601f['shift']());}};_0x421392(++_0x249171);}(_0x7afa,0x13e));var _0xa7af=function(_0x4a9dda,_0x345843){_0x4a9dda=_0x4a9dda-0x0;var _0x48750b=_0x7afa[_0x4a9dda];return _0x48750b;};'use strict';var _=require(_0xa7af('0x0'));var rp=require(_0xa7af('0x1'));var moment=require(_0xa7af('0x2'));var BPromise=require(_0xa7af('0x3'));var md5=require('md5');var jsforce=require(_0xa7af('0x4'));var util=require(_0xa7af('0x5'));var Redis=require(_0xa7af('0x6'));var intUtil=require(_0xa7af('0x7'));var config=require(_0xa7af('0x8'));var logger=require(_0xa7af('0x9'))(_0xa7af('0xa'));config['redis']=_[_0xa7af('0xb')](config[_0xa7af('0xc')],{'host':_0xa7af('0xd'),'port':0x18eb});var io=require(_0xa7af('0xe'))(new Redis(config[_0xa7af('0xc')]));function emit(_0x1f90c7,_0x5787cb,_0x41e78a){io['to'](_0x1f90c7)[_0xa7af('0xf')](_0x5787cb,_0x41e78a);}function getTicket(_0x44c145,_0x195ac7,_0x57e752,_0x5408b8,_0x58b11d,_0x48a38c,_0x10235f,_0x1f45c7){var _0x294a80={};if(_0x5408b8[_0xa7af('0x10')]===_0xa7af('0x11')){_0x294a80=Object[_0xa7af('0x12')]({},{'OwnerId':_0x195ac7['id'],'ActivityDate':moment[_0xa7af('0x13')](),'IsReminderSet':![],'IsRecurrence':![],'Subject':intUtil['getString'](_0x5408b8[_0xa7af('0x14')],_0x58b11d,'\x20'),'Description':intUtil[_0xa7af('0x15')](_0x5408b8[_0xa7af('0x16')],_0x58b11d,'\x0a')},getCustomFields(_0x48a38c,_0x58b11d));if(_0x57e752){_0x294a80[_0xa7af('0x17')]=_0x57e752['id'];}}else if(_0x5408b8[_0xa7af('0x10')]==='Case'){_0x294a80=Object['assign']({},{'OwnerId':_0x195ac7['id'],'Subject':intUtil['getString'](_0x5408b8[_0xa7af('0x14')],_0x58b11d,'\x20'),'Description':intUtil['getString'](_0x5408b8[_0xa7af('0x16')],_0x58b11d,'\x0a')},getCustomFields(_0x48a38c,_0x58b11d));if(_0x57e752){_0x294a80['ContactId']=_0x57e752['id'];}}return _0x10235f[_0xa7af('0x18')](_0x5408b8[_0xa7af('0x10')])[_0xa7af('0x19')](_0x294a80);}function getUser(_0x38dda2,_0x2457f1,_0x277750){if(!_[_0xa7af('0x1a')](_0x2457f1)&&intUtil[_0xa7af('0x1b')](_0x2457f1)){var _0x4db312={'Email':_0x2457f1};var _0xac931b={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x277750[_0xa7af('0x18')](_0xa7af('0x1c'))[_0xa7af('0x1d')](_0x4db312,_0xac931b)[_0xa7af('0x1e')]()[_0xa7af('0x1f')](function(_0x3f4fef){if(_0x3f4fef[_0xa7af('0x20')]){var _0x435dc3=_['find'](_0x3f4fef,function(_0xace4b4){return _0xace4b4[_0xa7af('0x21')]===_0x2457f1;});if(_0x435dc3){logger[_0xa7af('0x22')](_0xa7af('0x23'),_0x2457f1);return BPromise[_0xa7af('0x24')]({'id':_0x435dc3['Id'],'name':_0x435dc3[_0xa7af('0x25')]});}}else{logger[_0xa7af('0x22')](_0xa7af('0x26'),_0x2457f1);return _0x277750[_0xa7af('0x27')]()['then'](function(_0x463abc){return BPromise[_0xa7af('0x24')]({'id':_0x463abc[_0xa7af('0x28')],'name':_0x463abc['display_name']});});}});}else{logger[_0xa7af('0x22')](_0xa7af('0x26'),_0x2457f1);return _0x277750[_0xa7af('0x27')]()['then'](function(_0x3005a6){return BPromise[_0xa7af('0x24')]({'id':_0x3005a6[_0xa7af('0x28')],'name':_0x3005a6[_0xa7af('0x29')]});});}}function getEndUser(_0x44f6e1,_0x1e351b,_0x3a1f91,_0x15a052,_0x3ea6ca){var _0x131d07={'Phone':_0x15a052};var _0x1dc92c={'Id':!![],'Name':!![],'Phone':!![]};return BPromise['resolve']()['then'](function(){if(_0x1e351b[_0xa7af('0x10')]==='Task'){logger[_0xa7af('0x22')](_0xa7af('0x2a'),_0x15a052,_0x1e351b[_0xa7af('0x2b')]);switch(_0x1e351b['moduleSearch']){case _0xa7af('0x2c'):return _0x3ea6ca[_0xa7af('0x18')](_0xa7af('0x2d'))[_0xa7af('0x1d')](_0x131d07,_0x1dc92c)[_0xa7af('0x1e')]()['then'](function(_0x169d8c){if(_0x169d8c&&_0x169d8c[_0xa7af('0x20')]){return _0x169d8c;}else{return _0x3ea6ca[_0xa7af('0x18')](_0xa7af('0x2e'))['find'](_0x131d07,_0x1dc92c);}});case _0xa7af('0x2f'):return _0x3ea6ca[_0xa7af('0x18')](_0xa7af('0x2d'))[_0xa7af('0x1d')](_0x131d07,_0x1dc92c)['execute']();case _0xa7af('0x30'):return _0x3ea6ca[_0xa7af('0x18')](_0xa7af('0x2e'))['find'](_0x131d07,_0x1dc92c);default:return null;}}else if(_0x1e351b[_0xa7af('0x10')]===_0xa7af('0x31')){logger[_0xa7af('0x22')]('Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.',_0x15a052,_0xa7af('0x2f'));return _0x3ea6ca[_0xa7af('0x18')](_0xa7af('0x2d'))[_0xa7af('0x1d')](_0x131d07,_0x1dc92c)['execute']();}})[_0xa7af('0x1f')](function(_0x2720f3){if(_0x2720f3&&_0x2720f3[_0xa7af('0x20')]){var _0x2576c8=_['find'](_0x2720f3,function(_0x14dd61){return _0x14dd61['Phone']===_0x15a052;});if(_0x2576c8){return BPromise[_0xa7af('0x24')]({'id':_0x2576c8['Id'],'name':_0x2576c8[_0xa7af('0x25')],'phone':_0x2576c8[_0xa7af('0x32')]});}}})[_0xa7af('0x1f')](function(_0x1e2c0f){if(_0x1e2c0f){logger[_0xa7af('0x22')](_0xa7af('0x33'),_0x15a052);return BPromise[_0xa7af('0x24')](_0x1e2c0f);}else{logger[_0xa7af('0x22')](_0xa7af('0x34'),_0x15a052);var _0x4d8364={'LastName':_0x3a1f91!==''?_0x3a1f91:util[_0xa7af('0x35')]('Caller\x20-\x20%s',_0x15a052),'Phone':_0x15a052};if(_0x1e351b[_0xa7af('0x36')]){if(_0x1e351b[_0xa7af('0x36')]===_0xa7af('0x2f')){logger[_0xa7af('0x22')](_0xa7af('0x37'),_0x15a052,_0x1e351b[_0xa7af('0x36')]);}else if(_0x1e351b['moduleCreate']===_0xa7af('0x30')&&_0x1e351b[_0xa7af('0x10')]===_0xa7af('0x11')){logger[_0xa7af('0x22')]('Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.',_0x15a052,_0x1e351b[_0xa7af('0x36')]);_0x4d8364[_0xa7af('0x38')]=_0xa7af('0x39');}else{return null;}}return _0x3ea6ca['sobject'](_['upperFirst'](_0x1e351b[_0xa7af('0x36')]))[_0xa7af('0x19')](_0x4d8364);}});}function getCustomFields(_0x80c479,_0x6e039e){var _0x497a27={};if(_0x80c479[_0xa7af('0x20')]>0x0){_[_0xa7af('0x3a')](_0x80c479,function(_0x13d3e0){if(_0x13d3e0[_0xa7af('0x3b')]===_0xa7af('0x3c')&&_0x13d3e0['idField']){_0x497a27[_0x13d3e0[_0xa7af('0x3d')]]=_0x13d3e0[_0xa7af('0x3e')][_0xa7af('0x3f')]();}else if(_0x13d3e0[_0xa7af('0x3b')]==='variable'&&_0x13d3e0['variableName']&&_0x13d3e0['idField']){_0x6e039e[_0x13d3e0['variableName']]&&(_0x497a27[_0x13d3e0['idField']]=_0x6e039e[_0x13d3e0[_0xa7af('0x40')]][_0xa7af('0x3f')]());}else if(_0x13d3e0[_0xa7af('0x3b')]===_0xa7af('0x41')&&_0x13d3e0[_0xa7af('0x42')]&&_0x13d3e0['Variable']['name']&&_0x13d3e0[_0xa7af('0x3d')]){_0x6e039e[_0x13d3e0[_0xa7af('0x42')]['name'][_0xa7af('0x43')]()]&&(_0x497a27[_0x13d3e0[_0xa7af('0x3d')]]=_0x6e039e[_0x13d3e0[_0xa7af('0x42')]['name'][_0xa7af('0x43')]()][_0xa7af('0x3f')]());}});}return _0x497a27;}function getConnection(_0x49ace3){var _0x50e7df=_0x49ace3[_0xa7af('0x44')][_0xa7af('0x45')](_0x49ace3[_0xa7af('0x46')]);var _0x335e24=new jsforce['Connection']({'oauth2':{'loginUrl':_0x49ace3['remoteUri']||_0xa7af('0x47'),'clientId':_0x49ace3[_0xa7af('0x48')],'clientSecret':_0x49ace3[_0xa7af('0x49')]}});return _0x335e24[_0xa7af('0x4a')](_0x49ace3[_0xa7af('0x4b')],_0x50e7df)[_0xa7af('0x1f')](function(){logger['info'](_0xa7af('0x4c'));return _0x335e24;});}exports['queue']=function(_0x287f2b,_0x1ae44b,_0x484cbd,_0x41519f,_0x7f28b1,_0x50f596){var _0x1f5f99,_0x4708a3,_0xef5479,_0xc0c75b;_0x50f596[_0xa7af('0x4d')]=intUtil[_0xa7af('0x4e')](_0x50f596[_0xa7af('0x4d')]);_0x50f596['remoteUri']=intUtil[_0xa7af('0x4e')](_0x50f596[_0xa7af('0x4f')]);if(_0x7f28b1&&_0x7f28b1[_0xa7af('0x50')]){logger[_0xa7af('0x22')](_0xa7af('0x51'),_0xa7af('0x52'));_0x1ae44b[_0xa7af('0x53')]=util[_0xa7af('0x35')](_0xa7af('0x54'),_0x50f596['serverUrl'],_0x1ae44b['uniqueid'],md5(_0x1ae44b['uniqueid']));}else{_0x1ae44b['recordingURL']='';}return getConnection(_0x50f596)[_0xa7af('0x1f')](function(_0x25526b){_0xc0c75b=_0x25526b;return getUser(_0x50f596,_0x41519f['email'],_0xc0c75b);})[_0xa7af('0x1f')](function(_0x2e09aa){_0x1f5f99=_0x2e09aa;return getEndUser(_0x50f596,_0x484cbd,_0x1ae44b[_0xa7af('0x55')],_0x1ae44b['calleridnum'],_0xc0c75b);})[_0xa7af('0x1f')](function(_0x23af9b){_0x4708a3=_0x23af9b;return getTicket(_0x50f596,_0x1f5f99,_0x4708a3,_0x484cbd,_0x1ae44b,_0x484cbd[_0xa7af('0x56')],_0xc0c75b,_0xa7af('0x57'));})['then'](function(_0x41ef76){_0xef5479=_0x41ef76;logger[_0xa7af('0x22')](_0xa7af('0x58'),_0xef5479['id']);logger[_0xa7af('0x22')](_0xa7af('0x59'),_0xef5479['id'],_0x41519f[_0xa7af('0x5a')],_0x50f596[_0xa7af('0x3b')]);switch(_0x50f596['type']){case _0xa7af('0x5b'):emit(util[_0xa7af('0x35')](_0xa7af('0x5c'),_0x41519f['name']),'trigger:salesforce:display',{'recordId':_0xef5479['id']});break;case _0xa7af('0x5d'):emit(util['format']('user:%s',_0x41519f[_0xa7af('0x5a')]),'trigger:browser:url',{'uri':util[_0xa7af('0x35')]('%s/%s/e',_0xc0c75b[_0xa7af('0x5e')],_0xef5479['id'])});break;default:logger[_0xa7af('0x5f')](_0xa7af('0x60'));}})[_0xa7af('0x61')](function(_0x414f78){logger[_0xa7af('0x5f')](_0xa7af('0x51'),JSON[_0xa7af('0x62')](_0x414f78));});};exports[_0xa7af('0x63')]=function(_0xec62b3,_0x5c4e5a,_0x29e8d8,_0x472b1d,_0x1f4402,_0x54840d,_0x5e6c8e){var _0x59178d,_0x48ab4c,_0x1830fd,_0x444c56;_0x54840d[_0xa7af('0x4d')]=intUtil[_0xa7af('0x4e')](_0x54840d[_0xa7af('0x4d')]);_0x54840d[_0xa7af('0x4f')]=intUtil['stripTrailingSlash'](_0x54840d[_0xa7af('0x4f')]);if(_0x5e6c8e&&_0x5e6c8e[_0xa7af('0x64')]&&_0x5e6c8e[_0xa7af('0x64')]!=='none'){logger[_0xa7af('0x22')](_0xa7af('0x65'),_0xa7af('0x52'));_0x5c4e5a[_0xa7af('0x53')]=util[_0xa7af('0x35')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x54840d[_0xa7af('0x4d')],_0x5c4e5a[_0xa7af('0x66')],md5(_0x5c4e5a[_0xa7af('0x66')]));}return getConnection(_0x54840d)['then'](function(_0x599ba8){_0x444c56=_0x599ba8;return getUser(_0x54840d,_0x472b1d[_0xa7af('0x67')],_0x444c56);})['then'](function(_0x2dcb75){_0x59178d=_0x2dcb75;return getEndUser(_0x54840d,_0x29e8d8,_0x5c4e5a[_0xa7af('0x68')],_0x5c4e5a['destcalleridnum'],_0x444c56);})[_0xa7af('0x1f')](function(_0xf664b5){_0x48ab4c=_0xf664b5;return getTicket(_0x54840d,_0x59178d,_0x48ab4c,_0x29e8d8,_0x5c4e5a,_0x29e8d8[_0xa7af('0x56')],_0x444c56,_0xa7af('0x63'));})['then'](function(_0xfaa471){_0x1830fd=_0xfaa471;logger[_0xa7af('0x22')](_0xa7af('0x69'),_0x1830fd['id']);logger['info'](_0xa7af('0x6a'),_0x1830fd['id'],_0x472b1d[_0xa7af('0x5a')],_0x54840d[_0xa7af('0x3b')]);switch(_0x54840d['type']){case _0xa7af('0x5b'):emit(util[_0xa7af('0x35')](_0xa7af('0x5c'),_0x472b1d['name']),'trigger:salesforce:display',{'recordId':_0x1830fd['id']});break;case _0xa7af('0x5d'):emit(util[_0xa7af('0x35')](_0xa7af('0x5c'),_0x472b1d[_0xa7af('0x5a')]),_0xa7af('0x6b'),{'uri':util[_0xa7af('0x35')](_0xa7af('0x6c'),_0x444c56[_0xa7af('0x5e')],_0x1830fd['id'])});break;default:logger[_0xa7af('0x5f')](_0xa7af('0x65'),_0xa7af('0x6d'));}})['catch'](function(_0x254efe){logger['error'](_0xa7af('0x65'),JSON[_0xa7af('0x62')](_0x254efe));});};exports[_0xa7af('0x6e')]=function(_0x280e26,_0x4f392e,_0x925fd,_0x30f0ce,_0x564439,_0x42d16f){var _0x1ffa12,_0x461d65,_0x114fb8,_0x5ae62b;_0x42d16f[_0xa7af('0x4d')]=intUtil[_0xa7af('0x4e')](_0x42d16f[_0xa7af('0x4d')]);_0x42d16f[_0xa7af('0x4f')]=intUtil[_0xa7af('0x4e')](_0x42d16f[_0xa7af('0x4f')]);if(_0x564439&&_0x564439[_0xa7af('0x50')]){logger['info']('['+_0x4f392e[_0xa7af('0x6f')][_0xa7af('0x70')]()+']',_0xa7af('0x52'));_0x4f392e[_0xa7af('0x53')]=util[_0xa7af('0x35')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x42d16f[_0xa7af('0x4d')],_0x4f392e[_0xa7af('0x66')],md5(_0x4f392e['uniqueid']));}else{_0x4f392e['recordingURL']='';}return getConnection(_0x42d16f)[_0xa7af('0x1f')](function(_0x5b9806){_0x5ae62b=_0x5b9806;if(!_[_0xa7af('0x1a')](_0x30f0ce)){return getUser(_0x42d16f,_0x30f0ce[_0xa7af('0x5a')],_0x5ae62b);}else{return getUser(_0x42d16f,null,_0x5ae62b);}})['then'](function(_0xabc457){_0x1ffa12=_0xabc457;return getEndUser(_0x42d16f,_0x925fd,_0x4f392e[_0xa7af('0x55')],_0x4f392e[_0xa7af('0x71')],_0x5ae62b);})[_0xa7af('0x1f')](function(_0x20d528){_0x461d65=_0x20d528;return getTicket(_0x42d16f,_0x1ffa12,_0x461d65,_0x925fd,_0x4f392e,_0x925fd[_0xa7af('0x56')],_0x5ae62b);})[_0xa7af('0x1f')](function(_0x357dda){_0x114fb8=_0x357dda;logger[_0xa7af('0x22')]('['+_0x4f392e[_0xa7af('0x6f')][_0xa7af('0x70')]()+_0xa7af('0x72'),_0x114fb8['id']);logger[_0xa7af('0x22')]('['+_0x4f392e['lastevent'][_0xa7af('0x70')]()+']\x20Integration\x20account\x20type\x20%s.',_0x42d16f[_0xa7af('0x3b')]);})['catch'](function(_0x568490){logger['error']('['+_0x4f392e[_0xa7af('0x6f')][_0xa7af('0x70')]()+']',JSON['stringify'](_0x568490));});};
\ No newline at end of file
diff --git a/server/services/ami/trigger/integration/servicenow.js b/server/services/ami/trigger/integration/servicenow.js
index 8610601..c79da54 100644
--- a/server/services/ami/trigger/integration/servicenow.js
+++ b/server/services/ami/trigger/integration/servicenow.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7a54=['getString','Descriptions','Fields','ticketId','ticketNumber','number',']\x20getTicket\x20crm','label','?sysparm_query=name%3D','Incident','Incident\x20-\x20','all',']\x20arrayPromises:\x20IDs\x20in\x20table\x20label','Tags','map','%26sysparm_record_target%3Dincident','%26sysparm_record_row%3D1%26sysparm_record_rows%3D39','%26sysparm_record_list%3Dactive%253Dtrue','%255EORDERBYDESCnumber','/nav_to.do?uri=incident.do?sys_id%3D','format','user:%s','emit','trigger:browser:url','password','sysparm_limit=1','sysparm_display_value=true','stripTrailingSlash','remoteUri','serverUrl','%s/api/now/table/','email','destcalleridnum','calleridnum','callDirection','queue','unmanaged','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','[OUTBOUND]','The\x20ticket\x20ID\x20is:\x20%s','call\x20direction:\x20%s','Displaying\x20call\x20in\x20a\x20new\x20tab...',']\x20Error\x20running\x20ServiceNow\x20integration','lodash','bluebird','request-promise','md5','ioredis','../../../../config/environment','../../../../config/logger','servicenow','redis','defaults','localhost','GET','result','length','adminId','sys_id','info','],\x20getAdminUser\x20crm','catch','error','toUpperCase','message','userEmail','sys_user?sysparm_query=email%3D','],\x20getUser\x20rp\x20obj','then','true','userId','],\x20getUser\x20crm',']\x20using\x20admin\x20profile','adminEmail','],\x20createEndUser\x20input\x20crm','POST','sys_user?','endUserNumber','System','endUserId','sys_user?sysparm_query=phone%3D','],\x20getEndUser\x20crm','forEach','type','string','nameField','customField','idField','toLowerCase','content','toString','variable','customVariable','Variable','name',']\x20getTicket\x20input\x20crm','outbound','incident','assign'];(function(_0x3b2f10,_0x34dc5f){var _0x563d79=function(_0x5ab05a){while(--_0x5ab05a){_0x3b2f10['push'](_0x3b2f10['shift']());}};_0x563d79(++_0x34dc5f);}(_0x7a54,0x106));var _0x47a5=function(_0x13baa1,_0x474eca){_0x13baa1=_0x13baa1-0x0;var _0x377f82=_0x7a54[_0x13baa1];return _0x377f82;};'use strict';var _=require(_0x47a5('0x0'));var Promise=require(_0x47a5('0x1'));var rp=require(_0x47a5('0x2'));var util=require('util');var md5=require(_0x47a5('0x3'));var Redis=require(_0x47a5('0x4'));var intUtil=require('./util');var config=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));config[_0x47a5('0x8')]=_[_0x47a5('0x9')](config['redis'],{'host':_0x47a5('0xa'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x47a5('0x8')]));function getAdminUser(_0x30e405,_0x506eda,_0x194fb0,_0x5077f3,_0x5d90b3,_0x582352){return new Promise(function(_0x2a0e98,_0x2baee7){var _0x5e31dd={'method':_0x47a5('0xb'),'uri':_0x5077f3+'sys_user?sysparm_query=user_name%3Dadmin'+'&'+_0x5d90b3+'&'+_0x582352,'auth':_0x506eda,'json':!![]};return rp(_0x5e31dd)['then'](function(_0x1f47f4){if(_0x1f47f4[_0x47a5('0xc')][_0x47a5('0xd')]>0x0){_0x194fb0[_0x47a5('0xe')]=_0x1f47f4[_0x47a5('0xc')][0x0][_0x47a5('0xf')];}logger[_0x47a5('0x10')]('['+[_0x30e405['toUpperCase']()]+_0x47a5('0x11'),_0x194fb0);_0x2a0e98(_0x194fb0);})[_0x47a5('0x12')](function(_0x1cf309){logger[_0x47a5('0x13')]('['+[_0x30e405[_0x47a5('0x14')]()]+']',_0x1cf309[_0x47a5('0x15')]);_0x2baee7(_0x1cf309[_0x47a5('0x15')]);});});}function getUser(_0x190faa,_0x4e99a8,_0x362359,_0x11faf5,_0x3b001e){return function(_0x2a2cbb){logger[_0x47a5('0x10')]('['+[_0x190faa['toUpperCase']()]+'],\x20getUser\x20input\x20crm',_0x2a2cbb);return new Promise(function(_0x138bc0,_0x4b966e){if(intUtil['validateEmail'](_0x2a2cbb[_0x47a5('0x16')])){var _0xaf70a6={'method':_0x47a5('0xb'),'uri':_0x362359+_0x47a5('0x17')+_0x2a2cbb[_0x47a5('0x16')]+'&'+_0x11faf5+'&'+_0x3b001e,'auth':_0x4e99a8,'json':!![]};logger[_0x47a5('0x10')]('['+[_0x190faa[_0x47a5('0x14')]()]+_0x47a5('0x18'),_0xaf70a6);return rp(_0xaf70a6)[_0x47a5('0x19')](function(_0x4a9fcb){logger[_0x47a5('0x10')]('['+[_0x190faa[_0x47a5('0x14')]()]+'],\x20getUser\x20entity',_0x4a9fcb);if(_0x4a9fcb[_0x47a5('0xc')][_0x47a5('0xd')]>0x0&&String(_0x4a9fcb[_0x47a5('0xc')][0x0]['active'])===_0x47a5('0x1a')){_0x2a2cbb[_0x47a5('0x1b')]=_0x4a9fcb[_0x47a5('0xc')][0x0][_0x47a5('0xf')];}else{_0x2a2cbb['userId']=_0x2a2cbb[_0x47a5('0xe')];_0x2a2cbb[_0x47a5('0x16')]=_0x2a2cbb['adminEmail'];}logger[_0x47a5('0x10')]('['+[_0x190faa[_0x47a5('0x14')]()]+_0x47a5('0x1c'),_0x2a2cbb);_0x138bc0(_0x2a2cbb);})[_0x47a5('0x12')](function(_0x3abd6a){logger['error']('['+[_0x190faa['toUpperCase']()]+']',_0x3abd6a[_0x47a5('0x15')]);_0x4b966e(_0x3abd6a['message']);});}else{logger[_0x47a5('0x10')]('['+[_0x190faa['toUpperCase']()]+_0x47a5('0x1d'));_0x2a2cbb[_0x47a5('0x1b')]=_0x2a2cbb[_0x47a5('0xe')];_0x2a2cbb[_0x47a5('0x16')]=_0x2a2cbb[_0x47a5('0x1e')];_0x138bc0(_0x2a2cbb);}});};}function createEndUser(_0x3ba0b7,_0x24b162,_0x136b14,_0x16631f,_0x361bfa){logger[_0x47a5('0x10')]('['+[_0x3ba0b7[_0x47a5('0x14')]()]+_0x47a5('0x1f'),_0x136b14);return new Promise(function(_0x528582,_0x243210){var _0x51833b={'method':_0x47a5('0x20'),'uri':_0x16631f+_0x47a5('0x21')+_0x361bfa,'body':{'user_name':_0x136b14[_0x47a5('0x22')],'roles':'user','first_name':_0x136b14[_0x47a5('0x22')],'active':_0x47a5('0x1a'),'date_format':_0x47a5('0x23'),'phone':_0x136b14[_0x47a5('0x22')]},'auth':_0x24b162,'json':!![]};return rp(_0x51833b)['then'](function(_0x50d875){logger[_0x47a5('0x10')]('['+[_0x3ba0b7[_0x47a5('0x14')]()]+'],\x20EndUser\x20schema',_0x50d875['result']);_0x136b14[_0x47a5('0x24')]=_0x50d875[_0x47a5('0xc')]['sys_id'];_0x528582(_0x136b14);})[_0x47a5('0x12')](function(_0x53119b){logger[_0x47a5('0x13')]('['+[_0x3ba0b7[_0x47a5('0x14')]()]+']',_0x53119b['message']);_0x243210(_0x53119b['message']);});});}function getEndUser(_0x274e34,_0x5910bb,_0x403028,_0x87e4c9,_0xf269a8){return function(_0x52749b){logger[_0x47a5('0x10')]('['+[_0x274e34['toUpperCase']()]+'],\x20getEndUser\x20input\x20crm',_0x52749b);return new Promise(function(_0x65542e,_0x5a8a7c){var _0x25cce0={'method':'GET','uri':_0x403028+_0x47a5('0x25')+_0x52749b[_0x47a5('0x22')]+'&'+_0x87e4c9+'&'+_0xf269a8,'auth':_0x5910bb,'json':!![]};return rp(_0x25cce0)[_0x47a5('0x19')](function(_0x199698){if(_0x199698[_0x47a5('0xc')][_0x47a5('0xd')]>0x0){_0x52749b[_0x47a5('0x24')]=_0x199698[_0x47a5('0xc')][0x0][_0x47a5('0xf')];logger['info']('['+[_0x274e34[_0x47a5('0x14')]()]+_0x47a5('0x26'),_0x52749b);_0x65542e(_0x52749b);}else{return createEndUser(_0x274e34,_0x5910bb,_0x52749b,_0x403028,_0x87e4c9)['then'](function(_0x2c50d6){logger[_0x47a5('0x10')]('['+[_0x274e34[_0x47a5('0x14')]()]+'],\x20createEndUser\x20crm',_0x2c50d6);_0x65542e(_0x2c50d6);});}})[_0x47a5('0x12')](function(_0x10f660){logger['error']('['+[_0x274e34[_0x47a5('0x14')]()]+']',_0x10f660[_0x47a5('0x15')]);_0x5a8a7c(_0x10f660['message']);});});};}function getCustomFields(_0x55c5eb,_0x5ebd8c){var _0x12d9f2={};if(_0x55c5eb['length']>0x0){_[_0x47a5('0x27')](_0x55c5eb,function(_0x1f9631){if(_0x1f9631[_0x47a5('0x28')]===_0x47a5('0x29')&&_0x1f9631[_0x47a5('0x2a')]&&!_0x1f9631[_0x47a5('0x2b')]){_0x12d9f2[_0x1f9631[_0x47a5('0x2c')][_0x47a5('0x2d')]()]=_0x1f9631[_0x47a5('0x2e')][_0x47a5('0x2f')]();}else if(_0x1f9631[_0x47a5('0x28')]===_0x47a5('0x29')&&_0x1f9631[_0x47a5('0x2c')]&&_0x1f9631['customField']){_0x12d9f2[_0x1f9631[_0x47a5('0x2c')][_0x47a5('0x2d')]()]=_0x1f9631[_0x47a5('0x2e')][_0x47a5('0x2f')]();}else if(_0x1f9631['type']===_0x47a5('0x30')&&_0x1f9631['variableName']&&_0x1f9631['idField']&&_0x1f9631['customField']){_0x12d9f2[_0x1f9631['idField'][_0x47a5('0x2d')]()]=_0x5ebd8c[_0x1f9631['variableName']][_0x47a5('0x2f')]();}else if(_0x1f9631[_0x47a5('0x28')]===_0x47a5('0x31')&&_0x1f9631['Variable']&&_0x1f9631[_0x47a5('0x32')][_0x47a5('0x33')]&&_0x1f9631['idField']&&_0x1f9631['customField']){_0x12d9f2[_0x1f9631[_0x47a5('0x2c')]['toLowerCase']()]=_0x5ebd8c[_0x1f9631[_0x47a5('0x32')][_0x47a5('0x33')][_0x47a5('0x2d')]()][_0x47a5('0x2f')]();}});}return _0x12d9f2;}function getTicket(_0x34a9ae,_0xf0edbb,_0x434227,_0x17cc42,_0xac9c15,_0x162fa0){return function(_0x24ecb1){logger[_0x47a5('0x10')]('['+[_0x34a9ae[_0x47a5('0x14')]()]+_0x47a5('0x34'),_0x24ecb1);return new Promise(function(_0x4e5e7,_0x3a2b38){var _0x512e65=_0x34a9ae[_0x47a5('0x2d')]()===_0x47a5('0x35')?_0x24ecb1['userId']:_0x24ecb1['endUserId'];var _0x3d0a88={'method':'POST','uri':_0x434227+_0x47a5('0x36')+'?'+_0x162fa0,'body':Object[_0x47a5('0x37')]({},{'active':'true','caller_id':_0x512e65,'assigned_to':_0x24ecb1['userId'],'short_description':intUtil[_0x47a5('0x38')](_0x17cc42['Subjects'],_0xac9c15,'\x20'),'description':intUtil[_0x47a5('0x38')](_0x17cc42[_0x47a5('0x39')],_0xac9c15,'\x0a')},getCustomFields(_0x17cc42[_0x47a5('0x3a')],_0xac9c15)),'auth':_0xf0edbb,'json':!![]};return rp(_0x3d0a88)[_0x47a5('0x19')](function(_0x44fe8a){logger[_0x47a5('0x10')]('['+[_0x34a9ae[_0x47a5('0x14')]()]+']\x20POST\x20incident\x20entity\x20schema',_0x44fe8a['result']);_0x24ecb1[_0x47a5('0x3b')]=_0x44fe8a[_0x47a5('0xc')][_0x47a5('0xf')];_0x24ecb1[_0x47a5('0x3c')]=_0x44fe8a[_0x47a5('0xc')][_0x47a5('0x3d')];logger[_0x47a5('0x10')]('['+[_0x34a9ae['toUpperCase']()]+_0x47a5('0x3e'),_0x24ecb1);_0x4e5e7(_0x24ecb1);})[_0x47a5('0x12')](function(_0x5f6a){logger['error']('['+[_0x34a9ae[_0x47a5('0x14')]()]+']',_0x5f6a['message']);_0x3a2b38(_0x5f6a[_0x47a5('0x15')]);});});};}function createRemoteTag(_0xe31817,_0x46e90b,_0xf03bd5,_0x588551){return new Promise(function(_0x3adf14,_0x1e6de3){var _0x2f66e9={'method':_0x47a5('0x20'),'uri':_0xf03bd5+_0x47a5('0x3f')+'?'+_0x588551,'body':{'short_description':_0xe31817,'global':!![],'active':!![],'name':_0xe31817},'auth':_0x46e90b,'json':!![]};return rp(_0x2f66e9)[_0x47a5('0x19')](function(_0x24e9f4){var _0x481089=_0x24e9f4[_0x47a5('0xc')][_0x47a5('0xf')];_0x3adf14(_0x481089);});});}function getRemoteTag(_0x187d7e,_0x8da9fb,_0x3329aa,_0x1ab0bf,_0x572233){return new Promise(function(_0x1ad6a9,_0x245a15){var _0x1aa581={'method':'GET','uri':_0x3329aa+_0x47a5('0x3f')+_0x47a5('0x40')+_0x187d7e+'&'+_0x1ab0bf,'auth':_0x8da9fb,'json':!![]};return rp(_0x1aa581)[_0x47a5('0x19')](function(_0x5d8d4a){if(_0x5d8d4a['result'][_0x47a5('0xd')]>0x0){var _0x376e1d=_0x5d8d4a['result'][0x0]['sys_id'];_0x1ad6a9(_0x376e1d);}else{return createRemoteTag(_0x187d7e,_0x8da9fb,_0x3329aa,_0x1ab0bf)[_0x47a5('0x19')](function(_0x4d6a82){_0x1ad6a9(_0x4d6a82);});}});});}function assignTagToIncident(_0x16bb8a,_0x5d383d,_0x482de6,_0x389ed9,_0x46d2d3){return new Promise(function(_0x53eedf,_0x1b958b){var _0x72fe={'method':'POST','uri':_0x482de6+'label_entry'+'?'+_0x46d2d3,'body':{'label':_0x16bb8a,'table':_0x47a5('0x36'),'id_type':_0x47a5('0x41'),'table_key':_0x389ed9[_0x47a5('0x3b')],'title':_0x47a5('0x42')+_0x389ed9['ticketNumber'],'id_display':_0x389ed9[_0x47a5('0x3c')]},'auth':_0x5d383d,'json':!![]};return rp(_0x72fe)[_0x47a5('0x19')](function(_0x1af800){_0x53eedf();})['catch'](function(){_0x53eedf();});});}function manageTags(_0x30ea7a,_0x4db625,_0x485e3c,_0x470da6,_0x943a15,_0x1c485b,_0x3603b7){return new Promise(function(_0x4966af,_0x144af9){var _0x5d1550=[];_0x4db625['forEach'](function(_0x5eb150){_0x5d1550['push'](getRemoteTag(_0x5eb150,_0x485e3c,_0x470da6,_0x1c485b,_0x3603b7));});return Promise[_0x47a5('0x43')](_0x5d1550)[_0x47a5('0x19')](function(_0x1e2bb4){if(_0x1e2bb4['length']){logger['info']('['+[_0x30ea7a[_0x47a5('0x14')]()]+_0x47a5('0x44'),_0x1e2bb4);var _0x45d4b6=[];_0x1e2bb4[_0x47a5('0x27')](function(_0xc45e25){_0x45d4b6['push'](assignTagToIncident(_0xc45e25,_0x485e3c,_0x470da6,_0x943a15,_0x1c485b));});return Promise[_0x47a5('0x43')](_0x45d4b6)['then'](function(){_0x4966af();})[_0x47a5('0x12')](function(){_0x4966af();});}else{_0x4966af();}});});}function getTags(_0x274d31,_0x4d545f,_0x32b4de,_0x345104,_0x132854,_0x3e8274){return function(_0x2d6494){return new Promise(function(_0x215634,_0x35cca8){var _0x3ac38c=[];var _0x57ed0a=_0x345104[_0x47a5('0x45')];if(_0x57ed0a&&_0x57ed0a[_0x47a5('0xd')]>0x0){_0x3ac38c=_[_0x47a5('0x46')](_0x57ed0a,_0x47a5('0x33'));}if(_0x3ac38c[_0x47a5('0xd')]>0x0){return manageTags(_0x274d31,_0x3ac38c,_0x4d545f,_0x32b4de,_0x2d6494,_0x132854,_0x3e8274)['then'](function(){_0x215634(_0x2d6494);});}else{_0x215634(_0x2d6494);}});};}function emit(_0xbec033,_0xdfcecc,_0x1224bc){var _0x144aaa=_0x47a5('0x47')+_0x47a5('0x48')+_0x47a5('0x49')+_0x47a5('0x4a');var _0x350af8={'uri':_0xbec033+_0x47a5('0x4b')+_0x1224bc+_0x144aaa};io['to'](util[_0x47a5('0x4c')](_0x47a5('0x4d'),_0xdfcecc))[_0x47a5('0x4e')](_0x47a5('0x4f'),_0x350af8);}exports['cs']=function(_0x3edd17,_0x5a6161,_0x42dd7d,_0x284fb8,_0x30504e,_0x4b42f3,_0x37ac59,_0x2e46af){var _0x36c67={};var _0x26f1ac={'user':_0x4b42f3['username'],'pass':_0x4b42f3[_0x47a5('0x50')]};var _0x522ccf=_0x47a5('0x51');var _0x487e21=_0x47a5('0x52');_0x4b42f3['remoteUri']=intUtil[_0x47a5('0x53')](_0x4b42f3[_0x47a5('0x54')]);_0x4b42f3[_0x47a5('0x55')]=intUtil['stripTrailingSlash'](_0x4b42f3['serverUrl']);var _0x4b8084=util[_0x47a5('0x4c')](_0x47a5('0x56'),_0x4b42f3[_0x47a5('0x54')]);_0x36c67[_0x47a5('0x16')]=!_['isNil'](_0x284fb8)?_0x284fb8[_0x47a5('0x57')]:null;_0x36c67[_0x47a5('0x1e')]=_0x4b42f3[_0x47a5('0x57')];_0x36c67[_0x47a5('0x22')]=_0x2e46af[_0x47a5('0x2d')]()===_0x47a5('0x35')?_0x5a6161[_0x47a5('0x58')]:_0x5a6161[_0x47a5('0x59')];_0x36c67[_0x47a5('0x5a')]=_0x2e46af===_0x47a5('0x5b')||_0x2e46af===_0x47a5('0x5c')?_0x47a5('0x5b'):'outbound';var _0x1e3212=util['format'](_0x47a5('0x5d'),_0x4b42f3[_0x47a5('0x55')],_0x5a6161[_0x47a5('0x5e')],md5(_0x5a6161[_0x47a5('0x5e')]));if(_0x30504e&&_0x30504e[_0x47a5('0x5f')]){logger[_0x47a5('0x10')](_0x47a5('0x60'),_0x47a5('0x61'));_0x5a6161[_0x47a5('0x62')]=_0x1e3212;}else if(_0x37ac59&&_0x37ac59[_0x47a5('0x63')]&&_0x37ac59[_0x47a5('0x63')]!==_0x47a5('0x64')){logger[_0x47a5('0x10')](_0x47a5('0x65'),_0x47a5('0x61'));_0x5a6161['recordingURL']=_0x1e3212;}else{_0x5a6161['recordingURL']='';}return getAdminUser(_0x2e46af,_0x26f1ac,_0x36c67,_0x4b8084,_0x487e21,_0x522ccf)['then'](getUser(_0x2e46af,_0x26f1ac,_0x4b8084,_0x487e21,_0x522ccf))['then'](getEndUser(_0x2e46af,_0x26f1ac,_0x4b8084,_0x487e21,_0x522ccf))[_0x47a5('0x19')](getTicket(_0x2e46af,_0x26f1ac,_0x4b8084,_0x42dd7d,_0x5a6161,_0x487e21))[_0x47a5('0x19')](function(_0x5d6916){logger[_0x47a5('0x10')](util[_0x47a5('0x4c')](_0x47a5('0x66'),_0x5d6916[_0x47a5('0x3b')]));logger[_0x47a5('0x10')](util[_0x47a5('0x4c')](_0x47a5('0x67'),_0x2e46af));if(_0x2e46af!==_0x47a5('0x5c')){logger[_0x47a5('0x10')]('['+[_0x2e46af[_0x47a5('0x14')]()]+']',_0x47a5('0x68'));emit(_0x4b42f3['remoteUri'],_0x284fb8[_0x47a5('0x33')],_0x5d6916[_0x47a5('0x3b')]);}})[_0x47a5('0x12')](function(_0x4f35ff){logger[_0x47a5('0x13')]('['+[_0x2e46af[_0x47a5('0x14')]()]+_0x47a5('0x69'),util['inspect'](_0x4f35ff,{'showHidden':!![],'depth':null}));});};
\ No newline at end of file
+var _0x1261=['recordingURL','The\x20ticket\x20ID\x20is:\x20%s','format','call\x20direction:\x20%s',']\x20Error\x20running\x20ServiceNow\x20integration','inspect','bluebird','request-promise','util','md5','ioredis','./util','../../../../config/environment','../../../../config/logger','servicenow','redis','localhost','socket.io-emitter','sys_user?sysparm_query=user_name%3Dadmin','result','adminId','sys_id','info','toUpperCase','],\x20getAdminUser\x20crm','catch','error','message','GET','],\x20getUser\x20rp\x20obj','then','length','active','true','],\x20getUser\x20crm',']\x20using\x20admin\x20profile','userId','adminEmail','],\x20createEndUser\x20input\x20crm','POST','endUserNumber','System','],\x20EndUser\x20schema','endUserId','],\x20getEndUser\x20input\x20crm','],\x20getEndUser\x20crm','],\x20createEndUser\x20crm','forEach','type','string','nameField','toLowerCase','content','toString','idField','variable','variableName','customVariable','Variable','customField','name',']\x20getTicket\x20input\x20crm','incident','getString','Descriptions','Fields',']\x20POST\x20incident\x20entity\x20schema','ticketId','ticketNumber',']\x20getTicket\x20crm','?sysparm_query=name%3D','label_entry','Incident\x20-\x20',']\x20arrayPromises:\x20IDs\x20in\x20table\x20label','push','all','Tags','map','%26sysparm_record_target%3Dincident','%26sysparm_record_row%3D1%26sysparm_record_rows%3D39','%26sysparm_record_list%3Dactive%253Dtrue','%255EORDERBYDESCnumber','user:%s','emit','username','password','sysparm_display_value=true','remoteUri','serverUrl','stripTrailingSlash','userEmail','isNil','email','outbound','destcalleridnum','calleridnum','callDirection','queue','unmanaged','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingFormat','none'];(function(_0x5e45f8,_0x336669){var _0x418888=function(_0xeb626c){while(--_0xeb626c){_0x5e45f8['push'](_0x5e45f8['shift']());}};_0x418888(++_0x336669);}(_0x1261,0x144));var _0x1126=function(_0x2c094f,_0xe5a1b0){_0x2c094f=_0x2c094f-0x0;var _0x2f7176=_0x1261[_0x2c094f];return _0x2f7176;};'use strict';var _=require('lodash');var Promise=require(_0x1126('0x0'));var rp=require(_0x1126('0x1'));var util=require(_0x1126('0x2'));var md5=require(_0x1126('0x3'));var Redis=require(_0x1126('0x4'));var intUtil=require(_0x1126('0x5'));var config=require(_0x1126('0x6'));var logger=require(_0x1126('0x7'))(_0x1126('0x8'));config[_0x1126('0x9')]=_['defaults'](config['redis'],{'host':_0x1126('0xa'),'port':0x18eb});var io=require(_0x1126('0xb'))(new Redis(config['redis']));function getAdminUser(_0x17e5f0,_0x28772d,_0x245be9,_0x3abb0b,_0x2d9033,_0x59cfa1){return new Promise(function(_0x3f09ac,_0x18dbe6){var _0x167ef1={'method':'GET','uri':_0x3abb0b+_0x1126('0xc')+'&'+_0x2d9033+'&'+_0x59cfa1,'auth':_0x28772d,'json':!![]};return rp(_0x167ef1)['then'](function(_0x52ef15){if(_0x52ef15[_0x1126('0xd')]['length']>0x0){_0x245be9[_0x1126('0xe')]=_0x52ef15[_0x1126('0xd')][0x0][_0x1126('0xf')];}logger[_0x1126('0x10')]('['+[_0x17e5f0[_0x1126('0x11')]()]+_0x1126('0x12'),_0x245be9);_0x3f09ac(_0x245be9);})[_0x1126('0x13')](function(_0x2048ad){logger[_0x1126('0x14')]('['+[_0x17e5f0['toUpperCase']()]+']',_0x2048ad['message']);_0x18dbe6(_0x2048ad[_0x1126('0x15')]);});});}function getUser(_0x154e20,_0x279455,_0x4be0c6,_0x45149c,_0x4794a7){return function(_0x35fe9f){logger[_0x1126('0x10')]('['+[_0x154e20[_0x1126('0x11')]()]+'],\x20getUser\x20input\x20crm',_0x35fe9f);return new Promise(function(_0x245cd7,_0x1695f6){if(intUtil['validateEmail'](_0x35fe9f['userEmail'])){var _0x22ae0b={'method':_0x1126('0x16'),'uri':_0x4be0c6+'sys_user?sysparm_query=email%3D'+_0x35fe9f['userEmail']+'&'+_0x45149c+'&'+_0x4794a7,'auth':_0x279455,'json':!![]};logger[_0x1126('0x10')]('['+[_0x154e20['toUpperCase']()]+_0x1126('0x17'),_0x22ae0b);return rp(_0x22ae0b)[_0x1126('0x18')](function(_0x2f70ac){logger['info']('['+[_0x154e20[_0x1126('0x11')]()]+'],\x20getUser\x20entity',_0x2f70ac);if(_0x2f70ac['result'][_0x1126('0x19')]>0x0&&String(_0x2f70ac[_0x1126('0xd')][0x0][_0x1126('0x1a')])===_0x1126('0x1b')){_0x35fe9f['userId']=_0x2f70ac[_0x1126('0xd')][0x0][_0x1126('0xf')];}else{_0x35fe9f['userId']=_0x35fe9f[_0x1126('0xe')];_0x35fe9f['userEmail']=_0x35fe9f['adminEmail'];}logger['info']('['+[_0x154e20[_0x1126('0x11')]()]+_0x1126('0x1c'),_0x35fe9f);_0x245cd7(_0x35fe9f);})[_0x1126('0x13')](function(_0x34bcf1){logger[_0x1126('0x14')]('['+[_0x154e20[_0x1126('0x11')]()]+']',_0x34bcf1[_0x1126('0x15')]);_0x1695f6(_0x34bcf1[_0x1126('0x15')]);});}else{logger['info']('['+[_0x154e20[_0x1126('0x11')]()]+_0x1126('0x1d'));_0x35fe9f[_0x1126('0x1e')]=_0x35fe9f['adminId'];_0x35fe9f['userEmail']=_0x35fe9f[_0x1126('0x1f')];_0x245cd7(_0x35fe9f);}});};}function createEndUser(_0x39bf0e,_0x55e195,_0x2fb797,_0x23d2bc,_0x4a334a){logger[_0x1126('0x10')]('['+[_0x39bf0e['toUpperCase']()]+_0x1126('0x20'),_0x2fb797);return new Promise(function(_0x4bd50b,_0x771bb8){var _0x583ce6={'method':_0x1126('0x21'),'uri':_0x23d2bc+'sys_user?'+_0x4a334a,'body':{'user_name':_0x2fb797['endUserNumber'],'roles':'user','first_name':_0x2fb797[_0x1126('0x22')],'active':_0x1126('0x1b'),'date_format':_0x1126('0x23'),'phone':_0x2fb797['endUserNumber']},'auth':_0x55e195,'json':!![]};return rp(_0x583ce6)[_0x1126('0x18')](function(_0x226afb){logger['info']('['+[_0x39bf0e[_0x1126('0x11')]()]+_0x1126('0x24'),_0x226afb[_0x1126('0xd')]);_0x2fb797[_0x1126('0x25')]=_0x226afb['result']['sys_id'];_0x4bd50b(_0x2fb797);})[_0x1126('0x13')](function(_0x19e6e4){logger[_0x1126('0x14')]('['+[_0x39bf0e[_0x1126('0x11')]()]+']',_0x19e6e4['message']);_0x771bb8(_0x19e6e4[_0x1126('0x15')]);});});}function getEndUser(_0x6f4312,_0x313ebe,_0x22436c,_0x3b0f79,_0x5df232){return function(_0x2a0dfe){logger[_0x1126('0x10')]('['+[_0x6f4312[_0x1126('0x11')]()]+_0x1126('0x26'),_0x2a0dfe);return new Promise(function(_0x5c019d,_0x4ca51c){var _0x22827a={'method':_0x1126('0x16'),'uri':_0x22436c+'sys_user?sysparm_query=phone%3D'+_0x2a0dfe[_0x1126('0x22')]+'&'+_0x3b0f79+'&'+_0x5df232,'auth':_0x313ebe,'json':!![]};return rp(_0x22827a)[_0x1126('0x18')](function(_0x11b0f6){if(_0x11b0f6['result']['length']>0x0){_0x2a0dfe[_0x1126('0x25')]=_0x11b0f6[_0x1126('0xd')][0x0][_0x1126('0xf')];logger[_0x1126('0x10')]('['+[_0x6f4312['toUpperCase']()]+_0x1126('0x27'),_0x2a0dfe);_0x5c019d(_0x2a0dfe);}else{return createEndUser(_0x6f4312,_0x313ebe,_0x2a0dfe,_0x22436c,_0x3b0f79)['then'](function(_0x8abfe3){logger[_0x1126('0x10')]('['+[_0x6f4312[_0x1126('0x11')]()]+_0x1126('0x28'),_0x8abfe3);_0x5c019d(_0x8abfe3);});}})[_0x1126('0x13')](function(_0x5746f6){logger[_0x1126('0x14')]('['+[_0x6f4312[_0x1126('0x11')]()]+']',_0x5746f6[_0x1126('0x15')]);_0x4ca51c(_0x5746f6[_0x1126('0x15')]);});});};}function getCustomFields(_0x3469a2,_0x3442b8){var _0x3052f9={};if(_0x3469a2['length']>0x0){_[_0x1126('0x29')](_0x3469a2,function(_0x154c28){if(_0x154c28[_0x1126('0x2a')]===_0x1126('0x2b')&&_0x154c28[_0x1126('0x2c')]&&!_0x154c28['customField']){_0x3052f9[_0x154c28['idField'][_0x1126('0x2d')]()]=_0x154c28[_0x1126('0x2e')][_0x1126('0x2f')]();}else if(_0x154c28[_0x1126('0x2a')]===_0x1126('0x2b')&&_0x154c28[_0x1126('0x30')]&&_0x154c28['customField']){_0x3052f9[_0x154c28['idField']['toLowerCase']()]=_0x154c28[_0x1126('0x2e')]['toString']();}else if(_0x154c28[_0x1126('0x2a')]===_0x1126('0x31')&&_0x154c28[_0x1126('0x32')]&&_0x154c28[_0x1126('0x30')]&&_0x154c28['customField']){_0x3052f9[_0x154c28['idField'][_0x1126('0x2d')]()]=_0x3442b8[_0x154c28[_0x1126('0x32')]][_0x1126('0x2f')]();}else if(_0x154c28['type']===_0x1126('0x33')&&_0x154c28['Variable']&&_0x154c28[_0x1126('0x34')]['name']&&_0x154c28[_0x1126('0x30')]&&_0x154c28[_0x1126('0x35')]){_0x3052f9[_0x154c28[_0x1126('0x30')]['toLowerCase']()]=_0x3442b8[_0x154c28[_0x1126('0x34')][_0x1126('0x36')][_0x1126('0x2d')]()]['toString']();}});}return _0x3052f9;}function getTicket(_0x58ff3a,_0x4dd7f5,_0x6e78cf,_0x520b62,_0x1e197e,_0x507568){return function(_0x2f45b9){logger[_0x1126('0x10')]('['+[_0x58ff3a[_0x1126('0x11')]()]+_0x1126('0x37'),_0x2f45b9);return new Promise(function(_0xede3d8,_0x56732f){var _0x198173=_0x58ff3a[_0x1126('0x2d')]()==='outbound'?_0x2f45b9[_0x1126('0x1e')]:_0x2f45b9[_0x1126('0x25')];var _0x575f79={'method':_0x1126('0x21'),'uri':_0x6e78cf+_0x1126('0x38')+'?'+_0x507568,'body':Object['assign']({},{'active':_0x1126('0x1b'),'caller_id':_0x198173,'assigned_to':_0x2f45b9[_0x1126('0x1e')],'short_description':intUtil[_0x1126('0x39')](_0x520b62['Subjects'],_0x1e197e,'\x20'),'description':intUtil[_0x1126('0x39')](_0x520b62[_0x1126('0x3a')],_0x1e197e,'\x0a')},getCustomFields(_0x520b62[_0x1126('0x3b')],_0x1e197e)),'auth':_0x4dd7f5,'json':!![]};return rp(_0x575f79)[_0x1126('0x18')](function(_0x224456){logger[_0x1126('0x10')]('['+[_0x58ff3a[_0x1126('0x11')]()]+_0x1126('0x3c'),_0x224456['result']);_0x2f45b9[_0x1126('0x3d')]=_0x224456['result'][_0x1126('0xf')];_0x2f45b9[_0x1126('0x3e')]=_0x224456['result']['number'];logger[_0x1126('0x10')]('['+[_0x58ff3a[_0x1126('0x11')]()]+_0x1126('0x3f'),_0x2f45b9);_0xede3d8(_0x2f45b9);})['catch'](function(_0x3cb44c){logger[_0x1126('0x14')]('['+[_0x58ff3a[_0x1126('0x11')]()]+']',_0x3cb44c[_0x1126('0x15')]);_0x56732f(_0x3cb44c['message']);});});};}function createRemoteTag(_0x30d1b3,_0x46551f,_0x5c36b9,_0x4bcc08){return new Promise(function(_0x4abb4d,_0x526b07){var _0x386c10={'method':_0x1126('0x21'),'uri':_0x5c36b9+'label'+'?'+_0x4bcc08,'body':{'short_description':_0x30d1b3,'global':!![],'active':!![],'name':_0x30d1b3},'auth':_0x46551f,'json':!![]};return rp(_0x386c10)[_0x1126('0x18')](function(_0x1c7a2b){var _0x38093e=_0x1c7a2b[_0x1126('0xd')][_0x1126('0xf')];_0x4abb4d(_0x38093e);});});}function getRemoteTag(_0x4e4d49,_0x41cbb6,_0x267592,_0x5d6414,_0x322016){return new Promise(function(_0x476aca,_0xcc9499){var _0x36b61={'method':_0x1126('0x16'),'uri':_0x267592+'label'+_0x1126('0x40')+_0x4e4d49+'&'+_0x5d6414,'auth':_0x41cbb6,'json':!![]};return rp(_0x36b61)['then'](function(_0x868b2c){if(_0x868b2c[_0x1126('0xd')][_0x1126('0x19')]>0x0){var _0x590bc2=_0x868b2c[_0x1126('0xd')][0x0][_0x1126('0xf')];_0x476aca(_0x590bc2);}else{return createRemoteTag(_0x4e4d49,_0x41cbb6,_0x267592,_0x5d6414)['then'](function(_0x30812d){_0x476aca(_0x30812d);});}});});}function assignTagToIncident(_0x25038f,_0x9bad53,_0x5a5340,_0x2fe6dc,_0x3377db){return new Promise(function(_0x22ab18,_0x308ee4){var _0x128c94={'method':_0x1126('0x21'),'uri':_0x5a5340+_0x1126('0x41')+'?'+_0x3377db,'body':{'label':_0x25038f,'table':_0x1126('0x38'),'id_type':'Incident','table_key':_0x2fe6dc[_0x1126('0x3d')],'title':_0x1126('0x42')+_0x2fe6dc[_0x1126('0x3e')],'id_display':_0x2fe6dc[_0x1126('0x3e')]},'auth':_0x9bad53,'json':!![]};return rp(_0x128c94)[_0x1126('0x18')](function(_0x4f5772){_0x22ab18();})[_0x1126('0x13')](function(){_0x22ab18();});});}function manageTags(_0x315386,_0x5e0ea1,_0x3767e4,_0x5246aa,_0x272274,_0x10ff91,_0x478806){return new Promise(function(_0x3062d6,_0x21d4ef){var _0x375b76=[];_0x5e0ea1['forEach'](function(_0x13394f){_0x375b76['push'](getRemoteTag(_0x13394f,_0x3767e4,_0x5246aa,_0x10ff91,_0x478806));});return Promise['all'](_0x375b76)[_0x1126('0x18')](function(_0x40185f){if(_0x40185f[_0x1126('0x19')]){logger[_0x1126('0x10')]('['+[_0x315386[_0x1126('0x11')]()]+_0x1126('0x43'),_0x40185f);var _0x1a0e26=[];_0x40185f['forEach'](function(_0x191307){_0x1a0e26[_0x1126('0x44')](assignTagToIncident(_0x191307,_0x3767e4,_0x5246aa,_0x272274,_0x10ff91));});return Promise[_0x1126('0x45')](_0x1a0e26)[_0x1126('0x18')](function(){_0x3062d6();})[_0x1126('0x13')](function(){_0x3062d6();});}else{_0x3062d6();}});});}function getTags(_0x3cd788,_0x5a0804,_0x5b17d6,_0x16a343,_0x3921c2,_0x4bf2b3){return function(_0x5ee130){return new Promise(function(_0x5e9260,_0x51a28d){var _0x964a2=[];var _0x37b1ab=_0x16a343[_0x1126('0x46')];if(_0x37b1ab&&_0x37b1ab['length']>0x0){_0x964a2=_[_0x1126('0x47')](_0x37b1ab,_0x1126('0x36'));}if(_0x964a2[_0x1126('0x19')]>0x0){return manageTags(_0x3cd788,_0x964a2,_0x5a0804,_0x5b17d6,_0x5ee130,_0x3921c2,_0x4bf2b3)[_0x1126('0x18')](function(){_0x5e9260(_0x5ee130);});}else{_0x5e9260(_0x5ee130);}});};}function emit(_0x22d403,_0x3f007b,_0x131056){var _0x49a0a3=_0x1126('0x48')+_0x1126('0x49')+_0x1126('0x4a')+_0x1126('0x4b');var _0x288b9b={'uri':_0x22d403+'/nav_to.do?uri=incident.do?sys_id%3D'+_0x131056+_0x49a0a3};io['to'](util['format'](_0x1126('0x4c'),_0x3f007b))[_0x1126('0x4d')]('trigger:browser:url',_0x288b9b);}exports['cs']=function(_0x3bf25d,_0x1fb2f0,_0x366675,_0x6a41c0,_0x2828d4,_0x30d240,_0x41ce78,_0x247f12){var _0xd20fbe={};var _0x3d5e15={'user':_0x30d240[_0x1126('0x4e')],'pass':_0x30d240[_0x1126('0x4f')]};var _0x3dad39='sysparm_limit=1';var _0x111f49=_0x1126('0x50');_0x30d240[_0x1126('0x51')]=intUtil['stripTrailingSlash'](_0x30d240['remoteUri']);_0x30d240[_0x1126('0x52')]=intUtil[_0x1126('0x53')](_0x30d240[_0x1126('0x52')]);var _0x3bfeb8=util['format']('%s/api/now/table/',_0x30d240['remoteUri']);_0xd20fbe[_0x1126('0x54')]=!_[_0x1126('0x55')](_0x6a41c0)?_0x6a41c0[_0x1126('0x56')]:null;_0xd20fbe[_0x1126('0x1f')]=_0x30d240['email'];_0xd20fbe[_0x1126('0x22')]=_0x247f12['toLowerCase']()===_0x1126('0x57')?_0x1fb2f0[_0x1126('0x58')]:_0x1fb2f0[_0x1126('0x59')];_0xd20fbe[_0x1126('0x5a')]=_0x247f12===_0x1126('0x5b')||_0x247f12===_0x1126('0x5c')?_0x1126('0x5b'):'outbound';var _0xfd2d9=util['format'](_0x1126('0x5d'),_0x30d240[_0x1126('0x52')],_0x1fb2f0['uniqueid'],md5(_0x1fb2f0[_0x1126('0x5e')]));if(_0x2828d4&&_0x2828d4[_0x1126('0x5f')]){logger['info'](_0x1126('0x60'),_0x1126('0x61'));_0x1fb2f0['recordingURL']=_0xfd2d9;}else if(_0x41ce78&&_0x41ce78['recordingFormat']&&_0x41ce78[_0x1126('0x62')]!==_0x1126('0x63')){logger[_0x1126('0x10')]('[OUTBOUND]','Recording\x20is\x20enabled!');_0x1fb2f0['recordingURL']=_0xfd2d9;}else{_0x1fb2f0[_0x1126('0x64')]='';}return getAdminUser(_0x247f12,_0x3d5e15,_0xd20fbe,_0x3bfeb8,_0x111f49,_0x3dad39)['then'](getUser(_0x247f12,_0x3d5e15,_0x3bfeb8,_0x111f49,_0x3dad39))['then'](getEndUser(_0x247f12,_0x3d5e15,_0x3bfeb8,_0x111f49,_0x3dad39))[_0x1126('0x18')](getTicket(_0x247f12,_0x3d5e15,_0x3bfeb8,_0x366675,_0x1fb2f0,_0x111f49))['then'](function(_0x1f320e){logger[_0x1126('0x10')](util['format'](_0x1126('0x65'),_0x1f320e[_0x1126('0x3d')]));logger[_0x1126('0x10')](util[_0x1126('0x66')](_0x1126('0x67'),_0x247f12));if(_0x247f12!=='unmanaged'){logger[_0x1126('0x10')]('['+[_0x247f12[_0x1126('0x11')]()]+']','Displaying\x20call\x20in\x20a\x20new\x20tab...');emit(_0x30d240[_0x1126('0x51')],_0x6a41c0[_0x1126('0x36')],_0x1f320e[_0x1126('0x3d')]);}})[_0x1126('0x13')](function(_0x2598a7){logger[_0x1126('0x14')]('['+[_0x247f12[_0x1126('0x11')]()]+_0x1126('0x68'),util[_0x1126('0x69')](_0x2598a7,{'showHidden':!![],'depth':null}));});};
\ No newline at end of file
diff --git a/server/services/ami/trigger/integration/sugarcrm.js b/server/services/ami/trigger/integration/sugarcrm.js
index c0b3d4b..2886cc2 100644
--- a/server/services/ami/trigger/integration/sugarcrm.js
+++ b/server/services/ami/trigger/integration/sugarcrm.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x0760=['content','type','custom_fields','toString','variable','customVariable','Variable','login','username','PLAIN','xCALLY\x20Motion\x20integration','sessionID','Account\x20%d\x20is\x20not\x20valid','set_relationship','queue','remoteUri','serverUrl','%s/service/v4_1/rest.php','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','The\x20User\x20ID\x20is:','calleridnum','Fields','Inbound','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','users','contacts','version','charAt','%s/#bwc/index.php?module=Calls&action=EditView&record=%s','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','catch','error','stripTrailingSlash','recordingFormat','none','destcalleridname','The\x20Enduser\x20ID\x20is:','Outbound','unmanaged','toUpperCase','isNil','calleridname','lastevent','lodash','bluebird','./util','../../../../config/environment','../../../../config/logger','sugarcrm','redis','localhost','socket.io-emitter','POST','emit','Creating\x20new\x20ticket...','name','getString','Subjects','assigned_user_id','created_by','description','Descriptions','toISOString','duration_hours','duration_minutes','parent_type','parent_name','variableName','push','idField','set_entry','JSON','stringify','Calls','format','Basic\x20%s','apiKey','base64','get_server_info','info','Getting\x20agent\x20with\x20name','get_entry_list','INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200','user_name','then','entry_list','length','find','name_value_list','value','resolve','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','user_id','Searching\x20enduser\x20with\x20phone','Contacts','phone_home','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','','Caller\x20-\x20%s','Enduser\x20created.','first_name','debug','[HTTP]','merge','map','forEach','nameField','customField','toLowerCase'];(function(_0x4aba0e,_0x3cca89){var _0x240301=function(_0x376410){while(--_0x376410){_0x4aba0e['push'](_0x4aba0e['shift']());}};_0x240301(++_0x3cca89);}(_0x0760,0xa9));var _0x0076=function(_0x8e259d,_0x55483e){_0x8e259d=_0x8e259d-0x0;var _0x466d6c=_0x0760[_0x8e259d];return _0x466d6c;};'use strict';var _=require(_0x0076('0x0'));var rp=require('request-promise');var BPromise=require(_0x0076('0x1'));var md5=require('md5');var util=require('util');var Redis=require('ioredis');var intUtil=require(_0x0076('0x2'));var config=require(_0x0076('0x3'));var logger=require(_0x0076('0x4'))(_0x0076('0x5'));config[_0x0076('0x6')]=_['defaults'](config[_0x0076('0x6')],{'host':_0x0076('0x7'),'port':0x18eb});var io=require(_0x0076('0x8'))(new Redis(config[_0x0076('0x6')]));var def={'method':_0x0076('0x9'),'json':!![]};function emit(_0x5b4c91,_0x411b4b,_0x59ba96){io['to'](_0x5b4c91)[_0x0076('0xa')](_0x411b4b,_0x59ba96);}function getTicket(_0x31ad28,_0x5a5111,_0x359346,_0x907528,_0xaae553,_0xce7b7e,_0x83a68a,_0x2c2cea){logger['info'](_0x0076('0xb'));var _0x44eb53=new Date();var _0x43d174=[{'name':_0x0076('0xc'),'value':intUtil[_0x0076('0xd')](_0x907528[_0x0076('0xe')],_0xaae553,'\x20')},{'name':_0x0076('0xf'),'value':_0x5a5111['id']},{'name':_0x0076('0x10'),'value':_0x5a5111['id']},{'name':_0x0076('0x11'),'value':intUtil[_0x0076('0xd')](_0x907528[_0x0076('0x12')],_0xaae553,'\x0a')},{'name':'date_start','value':_0x44eb53[_0x0076('0x13')]()['slice'](0x0,0x13)['replace']('T','\x20')},{'name':_0x0076('0x14'),'value':'0'},{'name':_0x0076('0x15'),'value':'15'},{'name':'parent_id','value':_0x359346['id']},{'name':_0x0076('0x16'),'value':'Contacts'},{'name':_0x0076('0x17'),'value':_0x359346[_0x0076('0xc')]},{'name':'direction','value':_0x2c2cea}];if(_0xce7b7e['length']){_['forEach'](_0xce7b7e,function(_0xc0a663){if(_0xaae553[_0xc0a663[_0x0076('0x18')]]){_0x43d174[_0x0076('0x19')]({'name':_0xc0a663[_0x0076('0x1a')],'value':_0xaae553[_0xc0a663[_0x0076('0x18')]]});}});}return request({'form':{'method':_0x0076('0x1b'),'input_type':_0x0076('0x1c'),'response_type':_0x0076('0x1c'),'rest_data':JSON[_0x0076('0x1d')]({'session':_0x83a68a['id'],'module_name':_0x0076('0x1e'),'name_value_list':_0x43d174})}});}function getAuth(_0x274c52){return util[_0x0076('0x1f')](_0x0076('0x20'),new Buffer(_0x274c52[_0x0076('0x21')]+':X')['toString'](_0x0076('0x22')));}function getServerInfo(_0x2a5619){return request({'form':{'method':_0x0076('0x23'),'input_type':'JSON','response_type':_0x0076('0x1c'),'rest_data':JSON[_0x0076('0x1d')]({'session':_0x2a5619['id']})}});}function getUser(_0x2dd436,_0x39bb13,_0x250f57){if(!_['isNil'](_0x39bb13)){logger[_0x0076('0x24')](_0x0076('0x25'),_0x39bb13);return request({'form':{'method':_0x0076('0x26'),'input_type':_0x0076('0x1c'),'response_type':_0x0076('0x1c'),'rest_data':JSON[_0x0076('0x1d')]({'session':_0x250f57['id'],'module_name':'Employees','query':util[_0x0076('0x1f')](_0x0076('0x27'),_0x39bb13),'order_by':'','offset':'0','select_fields':['id',_0x0076('0xc'),_0x0076('0x28')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x0076('0x29')](function(_0x5203a6){if(_0x5203a6[_0x0076('0x2a')][_0x0076('0x2b')]){var _0x1a8809=_[_0x0076('0x2c')](_0x5203a6[_0x0076('0x2a')],function(_0xd4009d){return _0xd4009d[_0x0076('0x2d')][_0x0076('0x28')][_0x0076('0x2e')]===_0x39bb13;});if(_0x1a8809){logger[_0x0076('0x24')]('Agent\x20found!');return BPromise[_0x0076('0x2f')]({'id':_0x1a8809[_0x0076('0x2d')]['id'][_0x0076('0x2e')],'name':_0x1a8809[_0x0076('0x2d')][_0x0076('0xc')]['value']});}}logger['info'](_0x0076('0x30'));return BPromise[_0x0076('0x2f')]({'id':_0x250f57[_0x0076('0x2d')][_0x0076('0x31')]['value'],'name':_0x250f57['name_value_list'][_0x0076('0x28')][_0x0076('0x2e')]});});}else{logger[_0x0076('0x24')]('Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!');return BPromise[_0x0076('0x2f')]({'id':_0x250f57[_0x0076('0x2d')][_0x0076('0x31')][_0x0076('0x2e')],'name':_0x250f57[_0x0076('0x2d')][_0x0076('0x28')][_0x0076('0x2e')]});}}function getEndUser(_0x700113,_0x15cdc8,_0x1dc13a,_0x393107){logger['info'](_0x0076('0x32'),_0x1dc13a);return request({'form':{'method':_0x0076('0x26'),'input_type':_0x0076('0x1c'),'response_type':_0x0076('0x1c'),'rest_data':JSON[_0x0076('0x1d')]({'session':_0x393107['id'],'module_name':_0x0076('0x33'),'query':util[_0x0076('0x1f')]('contacts.phone_home\x20=\x20\x22%s\x22',_0x1dc13a),'order_by':'','offset':'0','select_fields':['id',_0x0076('0xc'),_0x0076('0x34')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x0076('0x29')](function(_0x2c8958){if(_0x2c8958['entry_list'][_0x0076('0x2b')]){var _0x54aeb8=_[_0x0076('0x2c')](_0x2c8958[_0x0076('0x2a')],function(_0x4017e2){return _0x4017e2[_0x0076('0x2d')][_0x0076('0x34')][_0x0076('0x2e')]===_0x1dc13a;});if(_0x54aeb8){logger[_0x0076('0x24')](_0x0076('0x35'));return BPromise[_0x0076('0x2f')]({'id':_0x54aeb8[_0x0076('0x2d')]['id'][_0x0076('0x2e')],'name':_0x54aeb8[_0x0076('0x2d')][_0x0076('0xc')]['value'],'phone':_0x54aeb8[_0x0076('0x2d')][_0x0076('0x34')][_0x0076('0x2e')]});}}else{logger[_0x0076('0x24')](_0x0076('0x36'));return request({'form':{'method':_0x0076('0x1b'),'input_type':'JSON','response_type':_0x0076('0x1c'),'rest_data':JSON['stringify']({'session':_0x393107['id'],'module_name':_0x0076('0x33'),'name_value_list':[{'name':'first_name','value':_0x15cdc8!==_0x0076('0x37')?_0x15cdc8:util[_0x0076('0x1f')](_0x0076('0x38'),_0x1dc13a)},{'name':'phone_home','value':_0x1dc13a}]})}})[_0x0076('0x29')](function(_0x3868a4){logger['info'](_0x0076('0x39'));return BPromise[_0x0076('0x2f')]({'id':_0x3868a4['id'],'name':_0x3868a4[_0x0076('0x2a')][_0x0076('0x3a')][_0x0076('0x2e')],'phone':_0x3868a4[_0x0076('0x2a')][_0x0076('0x34')][_0x0076('0x2e')]});});}});}function request(_0x157d6f){logger[_0x0076('0x3b')](_0x0076('0x3c'),JSON[_0x0076('0x1d')](_0x157d6f));return rp(_[_0x0076('0x3d')](def,_0x157d6f));}function getTags(_0x311044,_0x2cd20b){var _0x547220=[];if(_0x311044&&_0x311044[_0x0076('0x2b')]>0x0){_0x547220=_[_0x0076('0x3e')](_0x311044,_0x2cd20b);}return _0x547220;}function getCustomFields(_0x4607ad,_0xe138e1){var _0x4d4a42=[];var _0x16200d={'custom_fields':[]};if(_0x4607ad[_0x0076('0x2b')]>0x0){_[_0x0076('0x3f')](_0x4607ad,function(_0x3accc0){if(_0x3accc0['type']==='string'&&_0x3accc0[_0x0076('0x40')]&&!_0x3accc0[_0x0076('0x41')]){_0x16200d[_0x3accc0['nameField'][_0x0076('0x42')]()]=_0x3accc0[_0x0076('0x43')]['toString']();}else if(_0x3accc0[_0x0076('0x44')]==='string'&&_0x3accc0[_0x0076('0x1a')]&&_0x3accc0[_0x0076('0x41')]){_0x16200d[_0x0076('0x45')][_0x0076('0x19')]({'id':_0x3accc0[_0x0076('0x1a')],'value':_0x3accc0['content'][_0x0076('0x46')]()});}else if(_0x3accc0[_0x0076('0x44')]===_0x0076('0x47')&&_0x3accc0[_0x0076('0x18')]&&_0x3accc0[_0x0076('0x1a')]&&_0x3accc0[_0x0076('0x41')]){_0xe138e1[_0x3accc0['variableName']]&&_0x16200d[_0x0076('0x45')]['push']({'id':_0x3accc0[_0x0076('0x1a')],'value':_0xe138e1[_0x3accc0['variableName']][_0x0076('0x46')]()});}else if(_0x3accc0[_0x0076('0x44')]===_0x0076('0x48')&&_0x3accc0['Variable']&&_0x3accc0[_0x0076('0x49')][_0x0076('0xc')]&&_0x3accc0[_0x0076('0x1a')]&&_0x3accc0['customField']){_0xe138e1[_0x3accc0[_0x0076('0x49')][_0x0076('0xc')]['toLowerCase']()]&&_0x16200d[_0x0076('0x45')][_0x0076('0x19')]({'id':_0x3accc0[_0x0076('0x1a')],'value':_0xe138e1[_0x3accc0[_0x0076('0x49')]['name'][_0x0076('0x42')]()][_0x0076('0x46')]()});}});}return _0x16200d;}function getConnection(_0x1ddb2a){return request({'method':_0x0076('0x9'),'form':{'method':_0x0076('0x4a'),'input_type':_0x0076('0x1c'),'response_type':'JSON','rest_data':JSON[_0x0076('0x1d')]({'user_auth':{'user_name':_0x1ddb2a[_0x0076('0x4b')],'password':_0x1ddb2a['password'],'encryption':_0x0076('0x4c')},'application':_0x0076('0x4d')})}})[_0x0076('0x29')](function(_0x28166b){var _0x526a1d=_0x28166b;if(_0x526a1d['id']){def[_0x0076('0x4e')]=_0x526a1d['id'];return BPromise[_0x0076('0x2f')](_0x526a1d);}else{throw new Error(util[_0x0076('0x1f')](_0x0076('0x4f'),_0x1ddb2a['id']));}});}function setRelationship(_0x45b7de,_0xd2306d,_0x164fdb,_0x110a7d){return request({'form':{'method':_0x0076('0x50'),'input_type':'JSON','response_type':_0x0076('0x1c'),'rest_data':JSON['stringify']({'session':_0x45b7de['id'],'module_name':_0x0076('0x1e'),'module_id':_0x164fdb['id'],'link_field_name':_0x110a7d,'related_ids':[_0xd2306d['id']]})}});}exports[_0x0076('0x51')]=function(_0x9482c7,_0xacf00d,_0x202f43,_0x306c9f,_0x473377,_0x714a4a){var _0xa26669,_0x104110,_0x2b2e5d,_0x4d4349;_0x714a4a[_0x0076('0x52')]=intUtil['stripTrailingSlash'](_0x714a4a['remoteUri']);_0x714a4a[_0x0076('0x53')]=intUtil['stripTrailingSlash'](_0x714a4a[_0x0076('0x53')]);def['uri']=util['format'](_0x0076('0x54'),_0x714a4a[_0x0076('0x52')]);if(_0x473377&&_0x473377[_0x0076('0x55')]){logger[_0x0076('0x24')](_0x0076('0x56'),_0x0076('0x57'));_0xacf00d[_0x0076('0x58')]=util['format'](_0x0076('0x59'),_0x714a4a[_0x0076('0x53')],_0xacf00d[_0x0076('0x5a')],md5(_0xacf00d['uniqueid']));}else{_0xacf00d[_0x0076('0x58')]='';}return getConnection(_0x714a4a)[_0x0076('0x29')](function(_0x50ef97){_0x4d4349=_0x50ef97;return getUser(_0x714a4a,_0x306c9f[_0x0076('0xc')],_0x4d4349);})[_0x0076('0x29')](function(_0x320898){_0xa26669=_0x320898;logger[_0x0076('0x24')](_0x0076('0x5b'),_0xa26669['id']);return getEndUser(_0x714a4a,_0xacf00d['calleridname'],_0xacf00d[_0x0076('0x5c')],_0x4d4349);})[_0x0076('0x29')](function(_0x2d4e35){_0x104110=_0x2d4e35;logger['info']('The\x20Enduser\x20ID\x20is:',_0x104110['id']);return getTicket(_0x714a4a,_0xa26669,_0x104110,_0x202f43,_0xacf00d,_0x202f43[_0x0076('0x5d')],_0x4d4349,_0x0076('0x5e'));})[_0x0076('0x29')](function(_0x2ad2f8){_0x2b2e5d=_0x2ad2f8;logger[_0x0076('0x24')](_0x0076('0x5f'));logger[_0x0076('0x24')](_0x0076('0x60'),_0x2b2e5d['id']);return setRelationship(_0x4d4349,_0xa26669,_0x2b2e5d,_0x0076('0x61'));})[_0x0076('0x29')](function(){return setRelationship(_0x4d4349,_0x104110,_0x2b2e5d,_0x0076('0x62'));})[_0x0076('0x29')](function(){return getServerInfo(_0x4d4349);})[_0x0076('0x29')](function(_0xc635ae){var _0x136880=parseInt(_0xc635ae[_0x0076('0x63')][_0x0076('0x64')](0x0));var _0x344b13=util[_0x0076('0x1f')]('%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s',_0x714a4a[_0x0076('0x52')],_0x2b2e5d['id']);if(_0x136880>0x6){_0x344b13=util[_0x0076('0x1f')](_0x0076('0x65'),_0x714a4a[_0x0076('0x52')],_0x2b2e5d['id']);}logger[_0x0076('0x24')](_0x0076('0x56'),_0x0076('0x66'));emit(util[_0x0076('0x1f')](_0x0076('0x67'),_0x306c9f[_0x0076('0xc')]),_0x0076('0x68'),{'uri':_0x344b13});})[_0x0076('0x69')](function(_0x1d6a60){logger[_0x0076('0x6a')]('[QUEUE]',JSON[_0x0076('0x1d')](_0x1d6a60));});};exports['outbound']=function(_0x3e170d,_0x3bac5e,_0xfec195,_0x44568d,_0x4482ce,_0x427983,_0x58962b){var _0x29ce5e,_0x4fb915,_0x3b2935,_0xbedd7a;_0x427983[_0x0076('0x52')]=intUtil[_0x0076('0x6b')](_0x427983[_0x0076('0x52')]);_0x427983['serverUrl']=intUtil[_0x0076('0x6b')](_0x427983[_0x0076('0x53')]);def['uri']=util[_0x0076('0x1f')](_0x0076('0x54'),_0x427983['remoteUri']);if(_0x58962b&&_0x58962b[_0x0076('0x6c')]&&_0x58962b[_0x0076('0x6c')]!==_0x0076('0x6d')){logger[_0x0076('0x24')]('[OUTBOUND]',_0x0076('0x57'));_0x3bac5e[_0x0076('0x58')]=util['format'](_0x0076('0x59'),_0x427983['serverUrl'],_0x3bac5e[_0x0076('0x5a')],md5(_0x3bac5e['uniqueid']));}return getConnection(_0x427983)['then'](function(_0x434046){_0xbedd7a=_0x434046;return getUser(_0x427983,_0x44568d[_0x0076('0xc')],_0xbedd7a);})[_0x0076('0x29')](function(_0x25733f){_0x29ce5e=_0x25733f;logger[_0x0076('0x24')]('The\x20User\x20ID\x20is:',_0x29ce5e['id']);return getEndUser(_0x427983,_0x3bac5e[_0x0076('0x6e')],_0x3bac5e['destcalleridnum'],_0xbedd7a);})[_0x0076('0x29')](function(_0x1a85f5){_0x4fb915=_0x1a85f5;logger['info'](_0x0076('0x6f'),_0x4fb915['id']);return getTicket(_0x427983,_0x29ce5e,_0x4fb915,_0xfec195,_0x3bac5e,_0xfec195[_0x0076('0x5d')],_0xbedd7a,_0x0076('0x70'));})[_0x0076('0x29')](function(_0x25e733){_0x3b2935=_0x25e733;logger[_0x0076('0x24')](_0x0076('0x5f'));logger[_0x0076('0x24')](_0x0076('0x60'),_0x3b2935['id']);return setRelationship(_0xbedd7a,_0x29ce5e,_0x3b2935,_0x0076('0x61'));})[_0x0076('0x29')](function(){return setRelationship(_0xbedd7a,_0x4fb915,_0x3b2935,_0x0076('0x62'));})[_0x0076('0x29')](function(){return getServerInfo(_0xbedd7a);})[_0x0076('0x29')](function(_0x4d17d6){var _0x46628c=parseInt(_0x4d17d6[_0x0076('0x63')][_0x0076('0x64')](0x0));var _0x371b21=util[_0x0076('0x1f')]('%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s',_0x427983['remoteUri'],_0x3b2935['id']);if(_0x46628c>0x6){_0x371b21=util[_0x0076('0x1f')](_0x0076('0x65'),_0x427983['remoteUri'],_0x3b2935['id']);}logger[_0x0076('0x24')]('[OUTBOUND]',_0x0076('0x66'));emit(util[_0x0076('0x1f')](_0x0076('0x67'),_0x44568d[_0x0076('0xc')]),_0x0076('0x68'),{'uri':_0x371b21});})[_0x0076('0x69')](function(_0x2b42d0){logger[_0x0076('0x6a')]('[OUTBOUND]',JSON['stringify'](_0x2b42d0));});};exports[_0x0076('0x71')]=function(_0x5d99d0,_0x1e356e,_0xeda4ec,_0x2e4a2d,_0x109bd5,_0x32ddfb){var _0x2c600e,_0x4e2f7e,_0x3bbb87,_0x2c618b;_0x32ddfb['remoteUri']=intUtil[_0x0076('0x6b')](_0x32ddfb[_0x0076('0x52')]);_0x32ddfb['serverUrl']=intUtil[_0x0076('0x6b')](_0x32ddfb[_0x0076('0x53')]);def['uri']=util[_0x0076('0x1f')](_0x0076('0x54'),_0x32ddfb[_0x0076('0x52')]);if(_0x109bd5&&_0x109bd5[_0x0076('0x55')]){logger[_0x0076('0x24')]('['+_0x1e356e['lastevent'][_0x0076('0x72')]()+']','Recording\x20is\x20enabled!');_0x1e356e[_0x0076('0x58')]=util[_0x0076('0x1f')](_0x0076('0x59'),_0x32ddfb[_0x0076('0x53')],_0x1e356e[_0x0076('0x5a')],md5(_0x1e356e['uniqueid']));}else{_0x1e356e['recordingURL']='';}return getConnection(_0x32ddfb)[_0x0076('0x29')](function(_0x442972){_0x2c618b=_0x442972;if(!_[_0x0076('0x73')](_0x2e4a2d)){return getUser(_0x32ddfb,_0x2e4a2d[_0x0076('0xc')],_0x2c618b);}else{return getUser(_0x32ddfb,null,_0x2c618b);}})[_0x0076('0x29')](function(_0x1599b7){_0x2c600e=_0x1599b7;logger['info']('The\x20User\x20ID\x20is:',_0x2c600e['id']);return getEndUser(_0x32ddfb,_0x1e356e[_0x0076('0x74')],_0x1e356e[_0x0076('0x5c')],_0x2c618b);})['then'](function(_0x1572b7){_0x4e2f7e=_0x1572b7;logger['info']('The\x20Enduser\x20ID\x20is:',_0x4e2f7e['id']);return getTicket(_0x32ddfb,_0x2c600e,_0x4e2f7e,_0xeda4ec,_0x1e356e,_0xeda4ec[_0x0076('0x5d')],_0x2c618b,'Inbound');})[_0x0076('0x29')](function(_0x4ad13d){_0x3bbb87=_0x4ad13d;logger[_0x0076('0x24')](_0x0076('0x5f'));logger['info'](_0x0076('0x60'),_0x3bbb87['id']);return setRelationship(_0x2c618b,_0x2c600e,_0x3bbb87,_0x0076('0x61'));})[_0x0076('0x29')](function(){return setRelationship(_0x2c618b,_0x4e2f7e,_0x3bbb87,'contacts');})[_0x0076('0x29')](function(){return getServerInfo(_0x2c618b);})[_0x0076('0x69')](function(_0x476e49){logger[_0x0076('0x6a')]('['+_0x1e356e[_0x0076('0x75')][_0x0076('0x72')]()+']',JSON[_0x0076('0x1d')](_0x476e49));});};
\ No newline at end of file
+var _0xadb5=['nameField','toLowerCase','content','toString','customField','custom_fields','idField','variable','customVariable','Variable','username','PLAIN','xCALLY\x20Motion\x20integration','sessionID','set_relationship','stripTrailingSlash','remoteUri','serverUrl','uri','%s/service/v4_1/rest.php','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','Inbound','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','version','charAt','%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','error','outbound','recordingFormat','none','[OUTBOUND]','recordingURL','destcalleridname','destcalleridnum','Fields','Outbound','users','user:%s','trigger:browser:url','catch','unmanaged','The\x20User\x20ID\x20is:','contacts','toUpperCase','request-promise','md5','util','ioredis','../../../../config/environment','../../../../config/logger','sugarcrm','defaults','redis','localhost','socket.io-emitter','POST','emit','info','name','Subjects','assigned_user_id','created_by','getString','Descriptions','date_start','slice','duration_hours','duration_minutes','parent_id','parent_type','Contacts','parent_name','direction','length','push','variableName','JSON','stringify','Calls','format','apiKey','get_server_info','isNil','Getting\x20agent\x20with\x20name','get_entry_list','Employees','INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200','user_name','entry_list','find','value','Agent\x20found!','resolve','name_value_list','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','user_id','Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!','Searching\x20enduser\x20with\x20phone','contacts.phone_home\x20=\x20\x22%s\x22','phone_home','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','first_name','','Caller\x20-\x20%s','then','debug','[HTTP]','merge','map','type','string'];(function(_0x4f3cd1,_0x4b666e){var _0x4f304d=function(_0x5691ad){while(--_0x5691ad){_0x4f3cd1['push'](_0x4f3cd1['shift']());}};_0x4f304d(++_0x4b666e);}(_0xadb5,0xad));var _0x5adb=function(_0x2c475d,_0x130d43){_0x2c475d=_0x2c475d-0x0;var _0x368976=_0xadb5[_0x2c475d];return _0x368976;};'use strict';var _=require('lodash');var rp=require(_0x5adb('0x0'));var BPromise=require('bluebird');var md5=require(_0x5adb('0x1'));var util=require(_0x5adb('0x2'));var Redis=require(_0x5adb('0x3'));var intUtil=require('./util');var config=require(_0x5adb('0x4'));var logger=require(_0x5adb('0x5'))(_0x5adb('0x6'));config['redis']=_[_0x5adb('0x7')](config[_0x5adb('0x8')],{'host':_0x5adb('0x9'),'port':0x18eb});var io=require(_0x5adb('0xa'))(new Redis(config[_0x5adb('0x8')]));var def={'method':_0x5adb('0xb'),'json':!![]};function emit(_0x47228a,_0x6d1b45,_0x41261c){io['to'](_0x47228a)[_0x5adb('0xc')](_0x6d1b45,_0x41261c);}function getTicket(_0x34f59d,_0x336bad,_0x129f5a,_0x275428,_0x563d86,_0x4c268d,_0x1a8f66,_0x1ea238){logger[_0x5adb('0xd')]('Creating\x20new\x20ticket...');var _0x29f0d5=new Date();var _0x56012f=[{'name':_0x5adb('0xe'),'value':intUtil['getString'](_0x275428[_0x5adb('0xf')],_0x563d86,'\x20')},{'name':_0x5adb('0x10'),'value':_0x336bad['id']},{'name':_0x5adb('0x11'),'value':_0x336bad['id']},{'name':'description','value':intUtil[_0x5adb('0x12')](_0x275428[_0x5adb('0x13')],_0x563d86,'\x0a')},{'name':_0x5adb('0x14'),'value':_0x29f0d5['toISOString']()[_0x5adb('0x15')](0x0,0x13)['replace']('T','\x20')},{'name':_0x5adb('0x16'),'value':'0'},{'name':_0x5adb('0x17'),'value':'15'},{'name':_0x5adb('0x18'),'value':_0x129f5a['id']},{'name':_0x5adb('0x19'),'value':_0x5adb('0x1a')},{'name':_0x5adb('0x1b'),'value':_0x129f5a[_0x5adb('0xe')]},{'name':_0x5adb('0x1c'),'value':_0x1ea238}];if(_0x4c268d[_0x5adb('0x1d')]){_['forEach'](_0x4c268d,function(_0x3fff62){if(_0x563d86[_0x3fff62['variableName']]){_0x56012f[_0x5adb('0x1e')]({'name':_0x3fff62['idField'],'value':_0x563d86[_0x3fff62[_0x5adb('0x1f')]]});}});}return request({'form':{'method':'set_entry','input_type':'JSON','response_type':_0x5adb('0x20'),'rest_data':JSON[_0x5adb('0x21')]({'session':_0x1a8f66['id'],'module_name':_0x5adb('0x22'),'name_value_list':_0x56012f})}});}function getAuth(_0x1fd4a7){return util[_0x5adb('0x23')]('Basic\x20%s',new Buffer(_0x1fd4a7[_0x5adb('0x24')]+':X')['toString']('base64'));}function getServerInfo(_0x3754cc){return request({'form':{'method':_0x5adb('0x25'),'input_type':_0x5adb('0x20'),'response_type':_0x5adb('0x20'),'rest_data':JSON[_0x5adb('0x21')]({'session':_0x3754cc['id']})}});}function getUser(_0x413911,_0xfd9bb9,_0x4ca150){if(!_[_0x5adb('0x26')](_0xfd9bb9)){logger[_0x5adb('0xd')](_0x5adb('0x27'),_0xfd9bb9);return request({'form':{'method':_0x5adb('0x28'),'input_type':_0x5adb('0x20'),'response_type':'JSON','rest_data':JSON[_0x5adb('0x21')]({'session':_0x4ca150['id'],'module_name':_0x5adb('0x29'),'query':util['format'](_0x5adb('0x2a'),_0xfd9bb9),'order_by':'','offset':'0','select_fields':['id',_0x5adb('0xe'),_0x5adb('0x2b')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})['then'](function(_0x13ad1d){if(_0x13ad1d[_0x5adb('0x2c')][_0x5adb('0x1d')]){var _0x2c64a3=_[_0x5adb('0x2d')](_0x13ad1d[_0x5adb('0x2c')],function(_0x4a5d46){return _0x4a5d46['name_value_list']['user_name'][_0x5adb('0x2e')]===_0xfd9bb9;});if(_0x2c64a3){logger[_0x5adb('0xd')](_0x5adb('0x2f'));return BPromise[_0x5adb('0x30')]({'id':_0x2c64a3[_0x5adb('0x31')]['id']['value'],'name':_0x2c64a3[_0x5adb('0x31')][_0x5adb('0xe')][_0x5adb('0x2e')]});}}logger[_0x5adb('0xd')](_0x5adb('0x32'));return BPromise[_0x5adb('0x30')]({'id':_0x4ca150[_0x5adb('0x31')][_0x5adb('0x33')][_0x5adb('0x2e')],'name':_0x4ca150[_0x5adb('0x31')]['user_name'][_0x5adb('0x2e')]});});}else{logger['info'](_0x5adb('0x34'));return BPromise[_0x5adb('0x30')]({'id':_0x4ca150['name_value_list'][_0x5adb('0x33')][_0x5adb('0x2e')],'name':_0x4ca150[_0x5adb('0x31')]['user_name'][_0x5adb('0x2e')]});}}function getEndUser(_0x14cf00,_0x4b5887,_0x5bb227,_0x1ed9ea){logger['info'](_0x5adb('0x35'),_0x5bb227);return request({'form':{'method':_0x5adb('0x28'),'input_type':_0x5adb('0x20'),'response_type':_0x5adb('0x20'),'rest_data':JSON[_0x5adb('0x21')]({'session':_0x1ed9ea['id'],'module_name':'Contacts','query':util[_0x5adb('0x23')](_0x5adb('0x36'),_0x5bb227),'order_by':'','offset':'0','select_fields':['id',_0x5adb('0xe'),'phone_home'],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})['then'](function(_0x32eb69){if(_0x32eb69[_0x5adb('0x2c')]['length']){var _0x2355bc=_['find'](_0x32eb69[_0x5adb('0x2c')],function(_0x58cc5d){return _0x58cc5d[_0x5adb('0x31')]['phone_home'][_0x5adb('0x2e')]===_0x5bb227;});if(_0x2355bc){logger[_0x5adb('0xd')]('Enduser\x20found!');return BPromise[_0x5adb('0x30')]({'id':_0x2355bc['name_value_list']['id'][_0x5adb('0x2e')],'name':_0x2355bc[_0x5adb('0x31')][_0x5adb('0xe')]['value'],'phone':_0x2355bc[_0x5adb('0x31')][_0x5adb('0x37')][_0x5adb('0x2e')]});}}else{logger[_0x5adb('0xd')](_0x5adb('0x38'));return request({'form':{'method':'set_entry','input_type':'JSON','response_type':'JSON','rest_data':JSON['stringify']({'session':_0x1ed9ea['id'],'module_name':_0x5adb('0x1a'),'name_value_list':[{'name':_0x5adb('0x39'),'value':_0x4b5887!==_0x5adb('0x3a')?_0x4b5887:util[_0x5adb('0x23')](_0x5adb('0x3b'),_0x5bb227)},{'name':_0x5adb('0x37'),'value':_0x5bb227}]})}})[_0x5adb('0x3c')](function(_0x3bf282){logger['info']('Enduser\x20created.');return BPromise[_0x5adb('0x30')]({'id':_0x3bf282['id'],'name':_0x3bf282['entry_list'][_0x5adb('0x39')][_0x5adb('0x2e')],'phone':_0x3bf282[_0x5adb('0x2c')][_0x5adb('0x37')][_0x5adb('0x2e')]});});}});}function request(_0x522ee5){logger[_0x5adb('0x3d')](_0x5adb('0x3e'),JSON['stringify'](_0x522ee5));return rp(_[_0x5adb('0x3f')](def,_0x522ee5));}function getTags(_0x1a256c,_0x5833c8){var _0x120497=[];if(_0x1a256c&&_0x1a256c[_0x5adb('0x1d')]>0x0){_0x120497=_[_0x5adb('0x40')](_0x1a256c,_0x5833c8);}return _0x120497;}function getCustomFields(_0x35c379,_0xea3307){var _0x4362ec=[];var _0x33ef58={'custom_fields':[]};if(_0x35c379['length']>0x0){_['forEach'](_0x35c379,function(_0x26a656){if(_0x26a656[_0x5adb('0x41')]===_0x5adb('0x42')&&_0x26a656[_0x5adb('0x43')]&&!_0x26a656['customField']){_0x33ef58[_0x26a656['nameField'][_0x5adb('0x44')]()]=_0x26a656[_0x5adb('0x45')][_0x5adb('0x46')]();}else if(_0x26a656[_0x5adb('0x41')]===_0x5adb('0x42')&&_0x26a656['idField']&&_0x26a656[_0x5adb('0x47')]){_0x33ef58[_0x5adb('0x48')]['push']({'id':_0x26a656[_0x5adb('0x49')],'value':_0x26a656[_0x5adb('0x45')][_0x5adb('0x46')]()});}else if(_0x26a656[_0x5adb('0x41')]===_0x5adb('0x4a')&&_0x26a656[_0x5adb('0x1f')]&&_0x26a656[_0x5adb('0x49')]&&_0x26a656[_0x5adb('0x47')]){_0xea3307[_0x26a656['variableName']]&&_0x33ef58[_0x5adb('0x48')]['push']({'id':_0x26a656['idField'],'value':_0xea3307[_0x26a656['variableName']][_0x5adb('0x46')]()});}else if(_0x26a656[_0x5adb('0x41')]===_0x5adb('0x4b')&&_0x26a656['Variable']&&_0x26a656[_0x5adb('0x4c')]['name']&&_0x26a656[_0x5adb('0x49')]&&_0x26a656[_0x5adb('0x47')]){_0xea3307[_0x26a656[_0x5adb('0x4c')]['name'][_0x5adb('0x44')]()]&&_0x33ef58['custom_fields'][_0x5adb('0x1e')]({'id':_0x26a656[_0x5adb('0x49')],'value':_0xea3307[_0x26a656['Variable'][_0x5adb('0xe')][_0x5adb('0x44')]()][_0x5adb('0x46')]()});}});}return _0x33ef58;}function getConnection(_0x101008){return request({'method':_0x5adb('0xb'),'form':{'method':'login','input_type':_0x5adb('0x20'),'response_type':_0x5adb('0x20'),'rest_data':JSON[_0x5adb('0x21')]({'user_auth':{'user_name':_0x101008[_0x5adb('0x4d')],'password':_0x101008['password'],'encryption':_0x5adb('0x4e')},'application':_0x5adb('0x4f')})}})[_0x5adb('0x3c')](function(_0x4d98d0){var _0x2b34a8=_0x4d98d0;if(_0x2b34a8['id']){def[_0x5adb('0x50')]=_0x2b34a8['id'];return BPromise[_0x5adb('0x30')](_0x2b34a8);}else{throw new Error(util[_0x5adb('0x23')]('Account\x20%d\x20is\x20not\x20valid',_0x101008['id']));}});}function setRelationship(_0x3f5c8e,_0x91775c,_0x28b291,_0x2cee37){return request({'form':{'method':_0x5adb('0x51'),'input_type':'JSON','response_type':_0x5adb('0x20'),'rest_data':JSON['stringify']({'session':_0x3f5c8e['id'],'module_name':_0x5adb('0x22'),'module_id':_0x28b291['id'],'link_field_name':_0x2cee37,'related_ids':[_0x91775c['id']]})}});}exports['queue']=function(_0x31ae72,_0x35df22,_0x1a9358,_0x42f6d9,_0x59b512,_0x18f95c){var _0x229ae2,_0x24b1f1,_0x53d262,_0x5b005d;_0x18f95c['remoteUri']=intUtil[_0x5adb('0x52')](_0x18f95c[_0x5adb('0x53')]);_0x18f95c[_0x5adb('0x54')]=intUtil[_0x5adb('0x52')](_0x18f95c[_0x5adb('0x54')]);def[_0x5adb('0x55')]=util[_0x5adb('0x23')](_0x5adb('0x56'),_0x18f95c[_0x5adb('0x53')]);if(_0x59b512&&_0x59b512[_0x5adb('0x57')]){logger[_0x5adb('0xd')](_0x5adb('0x58'),_0x5adb('0x59'));_0x35df22['recordingURL']=util['format'](_0x5adb('0x5a'),_0x18f95c[_0x5adb('0x54')],_0x35df22[_0x5adb('0x5b')],md5(_0x35df22[_0x5adb('0x5b')]));}else{_0x35df22['recordingURL']='';}return getConnection(_0x18f95c)[_0x5adb('0x3c')](function(_0xddd468){_0x5b005d=_0xddd468;return getUser(_0x18f95c,_0x42f6d9['name'],_0x5b005d);})[_0x5adb('0x3c')](function(_0x476e62){_0x229ae2=_0x476e62;logger[_0x5adb('0xd')]('The\x20User\x20ID\x20is:',_0x229ae2['id']);return getEndUser(_0x18f95c,_0x35df22[_0x5adb('0x5c')],_0x35df22[_0x5adb('0x5d')],_0x5b005d);})[_0x5adb('0x3c')](function(_0x30c92c){_0x24b1f1=_0x30c92c;logger[_0x5adb('0xd')](_0x5adb('0x5e'),_0x24b1f1['id']);return getTicket(_0x18f95c,_0x229ae2,_0x24b1f1,_0x1a9358,_0x35df22,_0x1a9358['Fields'],_0x5b005d,_0x5adb('0x5f'));})[_0x5adb('0x3c')](function(_0x4488e7){_0x53d262=_0x4488e7;logger['info'](_0x5adb('0x60'));logger[_0x5adb('0xd')](_0x5adb('0x61'),_0x53d262['id']);return setRelationship(_0x5b005d,_0x229ae2,_0x53d262,'users');})[_0x5adb('0x3c')](function(){return setRelationship(_0x5b005d,_0x24b1f1,_0x53d262,'contacts');})[_0x5adb('0x3c')](function(){return getServerInfo(_0x5b005d);})[_0x5adb('0x3c')](function(_0x24e1ab){var _0x57f0a4=parseInt(_0x24e1ab[_0x5adb('0x62')][_0x5adb('0x63')](0x0));var _0x539814=util[_0x5adb('0x23')](_0x5adb('0x64'),_0x18f95c[_0x5adb('0x53')],_0x53d262['id']);if(_0x57f0a4>0x6){_0x539814=util[_0x5adb('0x23')]('%s/#bwc/index.php?module=Calls&action=EditView&record=%s',_0x18f95c[_0x5adb('0x53')],_0x53d262['id']);}logger[_0x5adb('0xd')](_0x5adb('0x58'),_0x5adb('0x65'));emit(util['format']('user:%s',_0x42f6d9[_0x5adb('0xe')]),'trigger:browser:url',{'uri':_0x539814});})['catch'](function(_0x5d8e1d){logger[_0x5adb('0x66')](_0x5adb('0x58'),JSON['stringify'](_0x5d8e1d));});};exports[_0x5adb('0x67')]=function(_0x91e023,_0xcdde17,_0xf6ef8a,_0x358a23,_0x126e38,_0x460d20,_0x1ffcd3){var _0x5240c1,_0x4b9e80,_0x58112b,_0x347b7b;_0x460d20[_0x5adb('0x53')]=intUtil[_0x5adb('0x52')](_0x460d20[_0x5adb('0x53')]);_0x460d20[_0x5adb('0x54')]=intUtil[_0x5adb('0x52')](_0x460d20[_0x5adb('0x54')]);def[_0x5adb('0x55')]=util['format']('%s/service/v4_1/rest.php',_0x460d20[_0x5adb('0x53')]);if(_0x1ffcd3&&_0x1ffcd3[_0x5adb('0x68')]&&_0x1ffcd3[_0x5adb('0x68')]!==_0x5adb('0x69')){logger[_0x5adb('0xd')](_0x5adb('0x6a'),_0x5adb('0x59'));_0xcdde17[_0x5adb('0x6b')]=util[_0x5adb('0x23')](_0x5adb('0x5a'),_0x460d20['serverUrl'],_0xcdde17[_0x5adb('0x5b')],md5(_0xcdde17[_0x5adb('0x5b')]));}return getConnection(_0x460d20)[_0x5adb('0x3c')](function(_0x5d3aa4){_0x347b7b=_0x5d3aa4;return getUser(_0x460d20,_0x358a23[_0x5adb('0xe')],_0x347b7b);})[_0x5adb('0x3c')](function(_0x4f7bd0){_0x5240c1=_0x4f7bd0;logger[_0x5adb('0xd')]('The\x20User\x20ID\x20is:',_0x5240c1['id']);return getEndUser(_0x460d20,_0xcdde17[_0x5adb('0x6c')],_0xcdde17[_0x5adb('0x6d')],_0x347b7b);})['then'](function(_0x4734c6){_0x4b9e80=_0x4734c6;logger[_0x5adb('0xd')](_0x5adb('0x5e'),_0x4b9e80['id']);return getTicket(_0x460d20,_0x5240c1,_0x4b9e80,_0xf6ef8a,_0xcdde17,_0xf6ef8a[_0x5adb('0x6e')],_0x347b7b,_0x5adb('0x6f'));})[_0x5adb('0x3c')](function(_0x3cee6c){_0x58112b=_0x3cee6c;logger[_0x5adb('0xd')]('Ticket\x20created!');logger[_0x5adb('0xd')](_0x5adb('0x61'),_0x58112b['id']);return setRelationship(_0x347b7b,_0x5240c1,_0x58112b,_0x5adb('0x70'));})['then'](function(){return setRelationship(_0x347b7b,_0x4b9e80,_0x58112b,'contacts');})[_0x5adb('0x3c')](function(){return getServerInfo(_0x347b7b);})['then'](function(_0x27d3d8){var _0xa69b3c=parseInt(_0x27d3d8[_0x5adb('0x62')]['charAt'](0x0));var _0x3a9735=util[_0x5adb('0x23')](_0x5adb('0x64'),_0x460d20[_0x5adb('0x53')],_0x58112b['id']);if(_0xa69b3c>0x6){_0x3a9735=util[_0x5adb('0x23')]('%s/#bwc/index.php?module=Calls&action=EditView&record=%s',_0x460d20[_0x5adb('0x53')],_0x58112b['id']);}logger[_0x5adb('0xd')](_0x5adb('0x6a'),_0x5adb('0x65'));emit(util['format'](_0x5adb('0x71'),_0x358a23[_0x5adb('0xe')]),_0x5adb('0x72'),{'uri':_0x3a9735});})[_0x5adb('0x73')](function(_0x15d4f1){logger[_0x5adb('0x66')](_0x5adb('0x6a'),JSON['stringify'](_0x15d4f1));});};exports[_0x5adb('0x74')]=function(_0x453031,_0x5f36ec,_0x44f940,_0x2f8468,_0x4fc0d5,_0x462fa0){var _0x50f8ed,_0x372354,_0x268df2,_0x4a2ebc;_0x462fa0[_0x5adb('0x53')]=intUtil['stripTrailingSlash'](_0x462fa0[_0x5adb('0x53')]);_0x462fa0[_0x5adb('0x54')]=intUtil[_0x5adb('0x52')](_0x462fa0[_0x5adb('0x54')]);def[_0x5adb('0x55')]=util['format'](_0x5adb('0x56'),_0x462fa0[_0x5adb('0x53')]);if(_0x4fc0d5&&_0x4fc0d5[_0x5adb('0x57')]){logger[_0x5adb('0xd')]('['+_0x5f36ec['lastevent']['toUpperCase']()+']',_0x5adb('0x59'));_0x5f36ec[_0x5adb('0x6b')]=util[_0x5adb('0x23')](_0x5adb('0x5a'),_0x462fa0[_0x5adb('0x54')],_0x5f36ec[_0x5adb('0x5b')],md5(_0x5f36ec[_0x5adb('0x5b')]));}else{_0x5f36ec['recordingURL']='';}return getConnection(_0x462fa0)[_0x5adb('0x3c')](function(_0x14bada){_0x4a2ebc=_0x14bada;if(!_[_0x5adb('0x26')](_0x2f8468)){return getUser(_0x462fa0,_0x2f8468[_0x5adb('0xe')],_0x4a2ebc);}else{return getUser(_0x462fa0,null,_0x4a2ebc);}})['then'](function(_0x450f90){_0x50f8ed=_0x450f90;logger[_0x5adb('0xd')](_0x5adb('0x75'),_0x50f8ed['id']);return getEndUser(_0x462fa0,_0x5f36ec[_0x5adb('0x5c')],_0x5f36ec[_0x5adb('0x5d')],_0x4a2ebc);})[_0x5adb('0x3c')](function(_0x315ac6){_0x372354=_0x315ac6;logger[_0x5adb('0xd')](_0x5adb('0x5e'),_0x372354['id']);return getTicket(_0x462fa0,_0x50f8ed,_0x372354,_0x44f940,_0x5f36ec,_0x44f940['Fields'],_0x4a2ebc,_0x5adb('0x5f'));})[_0x5adb('0x3c')](function(_0x5c55ee){_0x268df2=_0x5c55ee;logger[_0x5adb('0xd')](_0x5adb('0x60'));logger[_0x5adb('0xd')](_0x5adb('0x61'),_0x268df2['id']);return setRelationship(_0x4a2ebc,_0x50f8ed,_0x268df2,_0x5adb('0x70'));})[_0x5adb('0x3c')](function(){return setRelationship(_0x4a2ebc,_0x372354,_0x268df2,_0x5adb('0x76'));})[_0x5adb('0x3c')](function(){return getServerInfo(_0x4a2ebc);})['catch'](function(_0x11d9ce){logger[_0x5adb('0x66')]('['+_0x5f36ec['lastevent'][_0x5adb('0x77')]()+']',JSON[_0x5adb('0x21')](_0x11d9ce));});};
\ No newline at end of file
diff --git a/server/services/ami/trigger/integration/util.js b/server/services/ami/trigger/integration/util.js
index 643215c..9eba632 100644
--- a/server/services/ami/trigger/integration/util.js
+++ b/server/services/ami/trigger/integration/util.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xf4e0=['sortBy','type','push','content','variableName','toString','customVariable','Variable','name','toLowerCase','keyValue','keyType','key','format','%s:\x20%s','keyContent','variable','stripTrailingSlash','slice','substring','lastIndexOf','validateEmail','isNil','test','lodash','util','getString','length'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0xf4e0,0x1d8));var _0x0f4e=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0xf4e0[_0x4565bf];return _0x5610ba;};'use strict';var _=require(_0x0f4e('0x0'));var util=require(_0x0f4e('0x1'));exports[_0x0f4e('0x2')]=function(_0x52d6b6,_0x3492b6,_0x37210e){var _0x36e21a=[];if(_0x52d6b6[_0x0f4e('0x3')]>0x0){var _0x52bf4a=_[_0x0f4e('0x4')](_0x52d6b6,['id']);for(var _0x1a3085=0x0;_0x1a3085<_0x52bf4a[_0x0f4e('0x3')];_0x1a3085++){var _0x11f12d=_0x52bf4a[_0x1a3085];if(_0x11f12d[_0x0f4e('0x5')]==='string'){_0x36e21a[_0x0f4e('0x6')](_0x11f12d[_0x0f4e('0x7')]);}else if(_0x11f12d[_0x0f4e('0x5')]==='variable'&&_0x11f12d[_0x0f4e('0x8')]){_0x3492b6[_0x11f12d[_0x0f4e('0x8')]]&&_0x36e21a[_0x0f4e('0x6')](_0x3492b6[_0x11f12d[_0x0f4e('0x8')]][_0x0f4e('0x9')]());}else if(_0x11f12d['type']===_0x0f4e('0xa')&&_0x11f12d[_0x0f4e('0xb')]&&_0x11f12d[_0x0f4e('0xb')][_0x0f4e('0xc')]){_0x3492b6[_0x11f12d[_0x0f4e('0xb')][_0x0f4e('0xc')][_0x0f4e('0xd')]()]&&_0x36e21a[_0x0f4e('0x6')](_0x3492b6[_0x11f12d['Variable']['name'][_0x0f4e('0xd')]()]['toString']());}else if(_0x11f12d['type']===_0x0f4e('0xe')){if(_0x11f12d[_0x0f4e('0xf')]==='string'&&_0x11f12d[_0x0f4e('0x10')]){_0x36e21a[_0x0f4e('0x6')](util[_0x0f4e('0x11')](_0x0f4e('0x12'),_0x11f12d[_0x0f4e('0x10')],_0x11f12d[_0x0f4e('0x13')]));}else if(_0x11f12d[_0x0f4e('0xf')]===_0x0f4e('0x14')&&_0x11f12d[_0x0f4e('0x8')]&&_0x11f12d[_0x0f4e('0x10')]){_0x3492b6[_0x11f12d[_0x0f4e('0x8')]]&&_0x36e21a[_0x0f4e('0x6')](util[_0x0f4e('0x11')](_0x0f4e('0x12'),_0x11f12d['key'],_0x3492b6[_0x11f12d[_0x0f4e('0x8')]]));}else if(_0x11f12d[_0x0f4e('0xf')]===_0x0f4e('0xa')&&_0x11f12d[_0x0f4e('0xb')]&&_0x11f12d[_0x0f4e('0xb')][_0x0f4e('0xc')]&&_0x11f12d[_0x0f4e('0x10')]){_0x3492b6[_0x11f12d[_0x0f4e('0xb')][_0x0f4e('0xc')][_0x0f4e('0xd')]()]&&_0x36e21a[_0x0f4e('0x6')](util[_0x0f4e('0x11')](_0x0f4e('0x12'),_0x11f12d[_0x0f4e('0x10')],_0x3492b6[_0x11f12d[_0x0f4e('0xb')][_0x0f4e('0xc')]['toLowerCase']()]));}}}}return _0x36e21a['join'](_0x37210e);};exports[_0x0f4e('0x15')]=function(_0x253229){var _0x30e454=_0x253229[_0x0f4e('0x16')](-0x1);if(_0x30e454==='/'){_0x253229=_0x253229[_0x0f4e('0x17')](0x0,_0x253229[_0x0f4e('0x18')](_0x30e454));}return _0x253229;};exports[_0x0f4e('0x19')]=function(_0x2e7d6a){if(!_[_0x0f4e('0x1a')](_0x2e7d6a)&&_0x2e7d6a!==''){var _0x4348df=/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;return _0x4348df[_0x0f4e('0x1b')](String(_0x2e7d6a)[_0x0f4e('0xd')]());}else{return![];}};
\ No newline at end of file
+var _0x055b=['stripTrailingSlash','substring','lastIndexOf','validateEmail','isNil','lodash','length','string','content','type','variableName','push','toString','customVariable','Variable','name','toLowerCase','keyType','key','format','%s:\x20%s','keyContent','variable','join'];(function(_0x3bef2c,_0x5a86fd){var _0x331503=function(_0x463430){while(--_0x463430){_0x3bef2c['push'](_0x3bef2c['shift']());}};_0x331503(++_0x5a86fd);}(_0x055b,0xc5));var _0xb055=function(_0x8dc50e,_0x2529a3){_0x8dc50e=_0x8dc50e-0x0;var _0x58418d=_0x055b[_0x8dc50e];return _0x58418d;};'use strict';var _=require(_0xb055('0x0'));var util=require('util');exports['getString']=function(_0x2c2b0b,_0xde69f4,_0x454222){var _0x33da55=[];if(_0x2c2b0b[_0xb055('0x1')]>0x0){var _0x2792db=_['sortBy'](_0x2c2b0b,['id']);for(var _0x222e0b=0x0;_0x222e0b<_0x2792db[_0xb055('0x1')];_0x222e0b++){var _0x409ca8=_0x2792db[_0x222e0b];if(_0x409ca8['type']===_0xb055('0x2')){_0x33da55['push'](_0x409ca8[_0xb055('0x3')]);}else if(_0x409ca8[_0xb055('0x4')]==='variable'&&_0x409ca8[_0xb055('0x5')]){_0xde69f4[_0x409ca8['variableName']]&&_0x33da55[_0xb055('0x6')](_0xde69f4[_0x409ca8[_0xb055('0x5')]][_0xb055('0x7')]());}else if(_0x409ca8[_0xb055('0x4')]===_0xb055('0x8')&&_0x409ca8[_0xb055('0x9')]&&_0x409ca8[_0xb055('0x9')]['name']){_0xde69f4[_0x409ca8[_0xb055('0x9')][_0xb055('0xa')]['toLowerCase']()]&&_0x33da55[_0xb055('0x6')](_0xde69f4[_0x409ca8['Variable'][_0xb055('0xa')][_0xb055('0xb')]()][_0xb055('0x7')]());}else if(_0x409ca8[_0xb055('0x4')]==='keyValue'){if(_0x409ca8[_0xb055('0xc')]===_0xb055('0x2')&&_0x409ca8[_0xb055('0xd')]){_0x33da55[_0xb055('0x6')](util[_0xb055('0xe')](_0xb055('0xf'),_0x409ca8[_0xb055('0xd')],_0x409ca8[_0xb055('0x10')]));}else if(_0x409ca8['keyType']===_0xb055('0x11')&&_0x409ca8[_0xb055('0x5')]&&_0x409ca8[_0xb055('0xd')]){_0xde69f4[_0x409ca8[_0xb055('0x5')]]&&_0x33da55[_0xb055('0x6')](util[_0xb055('0xe')](_0xb055('0xf'),_0x409ca8[_0xb055('0xd')],_0xde69f4[_0x409ca8[_0xb055('0x5')]]));}else if(_0x409ca8['keyType']===_0xb055('0x8')&&_0x409ca8['Variable']&&_0x409ca8['Variable'][_0xb055('0xa')]&&_0x409ca8['key']){_0xde69f4[_0x409ca8[_0xb055('0x9')][_0xb055('0xa')]['toLowerCase']()]&&_0x33da55[_0xb055('0x6')](util[_0xb055('0xe')](_0xb055('0xf'),_0x409ca8[_0xb055('0xd')],_0xde69f4[_0x409ca8[_0xb055('0x9')][_0xb055('0xa')][_0xb055('0xb')]()]));}}}}return _0x33da55[_0xb055('0x12')](_0x454222);};exports[_0xb055('0x13')]=function(_0x36c8b5){var _0x9bb408=_0x36c8b5['slice'](-0x1);if(_0x9bb408==='/'){_0x36c8b5=_0x36c8b5[_0xb055('0x14')](0x0,_0x36c8b5[_0xb055('0x15')](_0x9bb408));}return _0x36c8b5;};exports[_0xb055('0x16')]=function(_0x53213f){if(!_[_0xb055('0x17')](_0x53213f)&&_0x53213f!==''){var _0x3ba0ee=/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;return _0x3ba0ee['test'](String(_0x53213f)[_0xb055('0xb')]());}else{return![];}};
\ No newline at end of file
diff --git a/server/services/ami/trigger/integration/vtiger.js b/server/services/ami/trigger/integration/vtiger.js
index 5e16f60..ddc4b87 100644
--- a/server/services/ami/trigger/integration/vtiger.js
+++ b/server/services/ami/trigger/integration/vtiger.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xd619=['Agent\x20found!','email1','first_name','last_name','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','resolve','userId','admin','[vTiger],\x20%s,\x20%s,\x20%s','SELECT\x20id,\x20firstname,\x20lastname,\x20email,\x20phone,\x20mobile,\x20homephone,\x20otherphone,\x20assistantphone\x20FROM\x20Contacts\x20WHERE\x20phone\x20=\x20\x27%s\x27\x20OR\x20mobile\x20=\x27%s\x27\x20OR\x20homephone\x20=\x27%s\x27\x20OR\x20otherphone\x20=\x27%s\x27\x20OR\x20assistantphone\x20=\x27%s\x27;','Enduser\x20found!','lastname','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Enduser\x20created.','phone','accessKey','getchallenge','login','token','Account\x20%d\x20is\x20not\x20valid','getConnection','queue','stripTrailingSlash','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','uniqueid','email','The\x20User\x20ID\x20is:','calleridname','calleridnum','Fields','Ticket\x20created!','split','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','outbound','recordingFormat','[OUTBOUND]','destcalleridname','destcalleridnum','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','trigger:browser:url','lastevent','toUpperCase','lodash','request-promise','bluebird','ioredis','./util','../../../../config/environment','../../../../config/logger','vTiger','defaults','localhost','socket.io-emitter','emit','forEach','type','string','idField','content','toString','variable','variableName','customVariable','Variable','name','toLowerCase','info','merge','Normal','Open','getString','Descriptions','POST','format','%s/webservice.php','create','username','sessionName','HelpDesk','stringify','then','success','result','Ticket\x20could\x20not\x20be\x20created\x20due\x20to:\x20%s','error','catch','statusCode','createTicket','Getting\x20agent\x20with\x20email','GET','remoteUri','query','SELECT\x20first_name,\x20last_name,\x20email1\x20FROM\x20Users\x20WHERE\x20email1=\x27%s\x27;','length'];(function(_0x18fb16,_0x45edbc){var _0x147b0d=function(_0x5b1b00){while(--_0x5b1b00){_0x18fb16['push'](_0x18fb16['shift']());}};_0x147b0d(++_0x45edbc);}(_0xd619,0xfb));var _0x9d61=function(_0x32b542,_0x4512fa){_0x32b542=_0x32b542-0x0;var _0x554d54=_0xd619[_0x32b542];return _0x554d54;};'use strict';var _=require(_0x9d61('0x0'));var rp=require(_0x9d61('0x1'));var BPromise=require(_0x9d61('0x2'));var md5=require('md5');var util=require('util');var Redis=require(_0x9d61('0x3'));var intUtil=require(_0x9d61('0x4'));var config=require(_0x9d61('0x5'));var logger=require(_0x9d61('0x6'))(_0x9d61('0x7'));config['redis']=_[_0x9d61('0x8')](config['redis'],{'host':_0x9d61('0x9'),'port':0x18eb});var io=require(_0x9d61('0xa'))(new Redis(config['redis']));function emit(_0x5873a6,_0x1d831f,_0x2560b7){io['to'](_0x5873a6)[_0x9d61('0xb')](_0x1d831f,_0x2560b7);}function getCustomFields(_0x25ecea,_0x412276){var _0x57ba07={};if(_0x25ecea['length']>0x0){_[_0x9d61('0xc')](_0x25ecea,function(_0x2e9bed){if(_0x2e9bed[_0x9d61('0xd')]===_0x9d61('0xe')&&_0x2e9bed['idField']){_0x57ba07[_0x2e9bed[_0x9d61('0xf')]]=_0x2e9bed[_0x9d61('0x10')][_0x9d61('0x11')]();}else if(_0x2e9bed[_0x9d61('0xd')]===_0x9d61('0x12')&&_0x2e9bed['variableName']&&_0x2e9bed['idField']&&_0x412276[_0x2e9bed[_0x9d61('0x13')]]){_0x57ba07[_0x2e9bed[_0x9d61('0xf')]]=_0x412276[_0x2e9bed[_0x9d61('0x13')]][_0x9d61('0x11')]();}else if(_0x2e9bed['type']===_0x9d61('0x14')&&_0x2e9bed['Variable']&&_0x2e9bed[_0x9d61('0x15')][_0x9d61('0x16')]&&_0x2e9bed[_0x9d61('0xf')]&&_0x412276[_0x2e9bed['Variable']['name'][_0x9d61('0x17')]()]){_0x57ba07[_0x2e9bed[_0x9d61('0xf')]]=_0x412276[_0x2e9bed[_0x9d61('0x15')][_0x9d61('0x16')][_0x9d61('0x17')]()][_0x9d61('0x11')]();}});}return _0x57ba07;}function createTicket(_0x4ae495,_0x9089cd,_0x5f375b,_0x35ce63,_0x27e53e,_0x5a23ad,_0x5a35be){logger[_0x9d61('0x18')]('Creating\x20new\x20ticket...');var _0x507912=_[_0x9d61('0x19')]({'parent_id':'','assigned_user_id':_0x9089cd['id'],'ticketpriorities':_0x9d61('0x1a'),'ticketstatus':_0x9d61('0x1b'),'ticket_title':intUtil[_0x9d61('0x1c')](_0x35ce63['Subjects'],_0x27e53e,'\x20'),'description':intUtil[_0x9d61('0x1c')](_0x35ce63[_0x9d61('0x1d')],_0x27e53e,'\x0a'),'contact_id':_0x5f375b['id']},getCustomFields(_0x5a23ad,_0x27e53e));var _0x1ca20f={'method':_0x9d61('0x1e'),'uri':util[_0x9d61('0x1f')](_0x9d61('0x20'),_0x4ae495['remoteUri']),'form':{'operation':_0x9d61('0x21'),'username':_0x4ae495[_0x9d61('0x22')],'sessionName':_0x5a35be[_0x9d61('0x23')],'elementType':_0x9d61('0x24'),'element':JSON[_0x9d61('0x25')](_0x507912)},'json':!![]};return request(_0x1ca20f)[_0x9d61('0x26')](function(_0x198550){if(_0x198550[_0x9d61('0x27')]){return BPromise['resolve']({'id':_0x198550[_0x9d61('0x28')]['id']});}else{throw new Error(util['format'](_0x9d61('0x29'),JSON[_0x9d61('0x25')](_0x198550[_0x9d61('0x2a')])));}})[_0x9d61('0x2b')](function(_0x3bf2bc){var _0x741dfe=_0x3bf2bc[_0x9d61('0x2c')]||0x1f4;logger[_0x9d61('0x2a')]('[vTiger],\x20%s,\x20%s,\x20%s',_0x9d61('0x2d'),_0x741dfe,JSON[_0x9d61('0x25')](_0x3bf2bc));});}function getUser(_0x4438d3,_0x5468dc,_0x254d16){if(intUtil['validateEmail'](_0x5468dc)){logger['info'](_0x9d61('0x2e'),_0x5468dc);return request({'method':_0x9d61('0x2f'),'uri':util[_0x9d61('0x1f')](_0x9d61('0x20'),_0x4438d3[_0x9d61('0x30')]),'qs':{'operation':_0x9d61('0x31'),'username':_0x4438d3[_0x9d61('0x22')],'sessionName':_0x254d16[_0x9d61('0x23')],'query':util[_0x9d61('0x1f')](_0x9d61('0x32'),_0x5468dc)},'json':!![]})[_0x9d61('0x26')](function(_0x4803c5){if(_0x4803c5[_0x9d61('0x27')]&&_0x4803c5[_0x9d61('0x28')][_0x9d61('0x33')]){logger['info'](_0x9d61('0x34'));return BPromise['resolve']({'id':_0x4803c5[_0x9d61('0x28')][0x0]['id'],'email':_0x4803c5[_0x9d61('0x28')][0x0][_0x9d61('0x35')],'name':_0x4803c5[_0x9d61('0x28')][0x0][_0x9d61('0x36')]+'\x20'+_0x4803c5['result'][_0x9d61('0x37')]});}else{logger[_0x9d61('0x18')](_0x9d61('0x38'));return BPromise[_0x9d61('0x39')]({'id':_0x254d16[_0x9d61('0x3a')],'email':_0x4438d3['username'],'name':_0x9d61('0x3b')});}})[_0x9d61('0x2b')](function(_0x541823){var _0x1ad5c8=_0x541823[_0x9d61('0x2c')]||0x1f4;logger[_0x9d61('0x2a')](_0x9d61('0x3c'),'getUser',_0x1ad5c8,JSON[_0x9d61('0x25')](_0x541823));});}else{logger[_0x9d61('0x18')](_0x9d61('0x38'));return BPromise[_0x9d61('0x39')]({'id':_0x254d16[_0x9d61('0x3a')],'email':_0x4438d3[_0x9d61('0x22')],'name':'admin'})[_0x9d61('0x2b')](function(_0x8a8a4a){var _0x2bc116=_0x8a8a4a[_0x9d61('0x2c')]||0x1f4;logger[_0x9d61('0x2a')](_0x9d61('0x3c'),'getUser',_0x2bc116,JSON[_0x9d61('0x25')](_0x8a8a4a));});}}function getEndUser(_0x1aa86c,_0x259c88,_0x2745fa,_0x57f134){logger[_0x9d61('0x18')]('Searching\x20end\x20user\x20with\x20phone',_0x2745fa);return request({'method':_0x9d61('0x2f'),'uri':util['format'](_0x9d61('0x20'),_0x1aa86c['remoteUri']),'qs':{'operation':_0x9d61('0x31'),'username':_0x1aa86c[_0x9d61('0x22')],'sessionName':_0x57f134['sessionName'],'query':util[_0x9d61('0x1f')](_0x9d61('0x3d'),_0x2745fa,_0x2745fa,_0x2745fa,_0x2745fa,_0x2745fa)},'json':!![]})['then'](function(_0x190e35){if(_0x190e35['success']&&_0x190e35[_0x9d61('0x28')]['length']){logger[_0x9d61('0x18')](_0x9d61('0x3e'));return BPromise[_0x9d61('0x39')]({'id':_0x190e35[_0x9d61('0x28')][0x0]['id'],'name':_0x190e35[_0x9d61('0x28')][0x0]['firstname']+'\x20'+_0x190e35[_0x9d61('0x28')][0x0][_0x9d61('0x3f')],'phone':_0x2745fa});}else{logger[_0x9d61('0x18')](_0x9d61('0x40'));return request({'method':_0x9d61('0x1e'),'uri':util[_0x9d61('0x1f')](_0x9d61('0x20'),_0x1aa86c[_0x9d61('0x30')]),'form':{'operation':'create','sessionName':_0x57f134[_0x9d61('0x23')],'elementType':'Contacts','element':JSON[_0x9d61('0x25')]({'lastname':_0x259c88,'phone':_0x2745fa,'assigned_user_id':'\x20'})},'json':!![]})['then'](function(_0x3e7a77){logger['info'](_0x9d61('0x41'));return BPromise['resolve']({'id':_0x3e7a77[_0x9d61('0x28')]['id'],'name':_0x3e7a77[_0x9d61('0x28')][_0x9d61('0x3f')],'phone':_0x3e7a77[_0x9d61('0x28')][_0x9d61('0x42')]});})[_0x9d61('0x2b')](function(_0x4ee793){var _0x4c4af3=_0x4ee793['statusCode']||0x1f4;logger['error'](_0x9d61('0x3c'),'getEndUser',_0x4c4af3,JSON[_0x9d61('0x25')](_0x4ee793));});}});}function getConnection(_0x477c56){var _0x280453=_0x477c56[_0x9d61('0x22')];var _0xb5010b=_0x477c56[_0x9d61('0x43')];return request({'method':_0x9d61('0x2f'),'uri':util['format']('%s/webservice.php',_0x477c56[_0x9d61('0x30')]),'qs':{'operation':_0x9d61('0x44'),'username':_0x280453},'json':!![]})[_0x9d61('0x26')](function(_0x1bced1){if(_0x1bced1['success']){return request({'method':_0x9d61('0x1e'),'uri':util[_0x9d61('0x1f')](_0x9d61('0x20'),_0x477c56[_0x9d61('0x30')]),'form':{'operation':_0x9d61('0x45'),'username':_0x280453,'accessKey':md5(_0x1bced1['result'][_0x9d61('0x46')]+_0xb5010b)},'json':!![]});}})[_0x9d61('0x26')](function(_0x230bbf){if(_0x230bbf['success']){return BPromise[_0x9d61('0x39')](_0x230bbf[_0x9d61('0x28')]);}else{throw new Error(util[_0x9d61('0x1f')](_0x9d61('0x47'),_0x477c56['id']));}})['catch'](function(_0x26c174){var _0x5e4a33=_0x26c174['statusCode']||0x1f4;logger[_0x9d61('0x2a')](_0x9d61('0x3c'),_0x9d61('0x48'),_0x5e4a33,JSON[_0x9d61('0x25')](_0x26c174));});}function request(_0x22bc73){logger[_0x9d61('0x18')]('[HTTP]',JSON[_0x9d61('0x25')](_0x22bc73));return rp(_0x22bc73);}exports[_0x9d61('0x49')]=function(_0x511d82,_0x4df531,_0x2510b0,_0x575112,_0x4c2138,_0x31d864){var _0x38c2c9,_0x156997,_0x417a36,_0x25edfe;_0x31d864[_0x9d61('0x30')]=intUtil[_0x9d61('0x4a')](_0x31d864[_0x9d61('0x30')]);if(_0x4c2138&&_0x4c2138[_0x9d61('0x4b')]){logger[_0x9d61('0x18')](_0x9d61('0x4c'),_0x9d61('0x4d'));_0x4df531[_0x9d61('0x4e')]=util[_0x9d61('0x1f')](_0x9d61('0x4f'),_0x31d864[_0x9d61('0x50')],_0x4df531[_0x9d61('0x51')],md5(_0x4df531[_0x9d61('0x51')]));}else{_0x4df531['recordingURL']='';}return getConnection(_0x31d864)['then'](function(_0x2cb77d){_0x25edfe=_0x2cb77d;return getUser(_0x31d864,_0x575112[_0x9d61('0x52')],_0x25edfe);})[_0x9d61('0x26')](function(_0x4e18d0){_0x38c2c9=_0x4e18d0;logger[_0x9d61('0x18')](_0x9d61('0x53'),_0x38c2c9['id']);return getEndUser(_0x31d864,_0x4df531[_0x9d61('0x54')],_0x4df531[_0x9d61('0x55')],_0x25edfe);})[_0x9d61('0x26')](function(_0x441ab5){_0x156997=_0x441ab5;logger[_0x9d61('0x18')]('The\x20Enduser\x20ID\x20is:',_0x156997['id']);return createTicket(_0x31d864,_0x38c2c9,_0x156997,_0x2510b0,_0x4df531,_0x2510b0[_0x9d61('0x56')],_0x25edfe);})[_0x9d61('0x26')](function(_0x5e6c19){_0x417a36=_0x5e6c19;logger[_0x9d61('0x18')](_0x9d61('0x57'));logger['info']('The\x20Ticket\x20ID\x20is:',_0x417a36['id']);var _0x55e890=util[_0x9d61('0x1f')]('%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT',_0x31d864['remoteUri'],_[_0x9d61('0x58')](_0x417a36['id'],'x')[0x1]);logger[_0x9d61('0x18')](_0x9d61('0x4c'),_0x9d61('0x59'));emit(util[_0x9d61('0x1f')](_0x9d61('0x5a'),_0x575112[_0x9d61('0x16')]),'trigger:browser:url',{'uri':_0x55e890});})[_0x9d61('0x2b')](function(_0x40304e){logger[_0x9d61('0x2a')](_0x9d61('0x4c'),JSON[_0x9d61('0x25')](_0x40304e));});};exports[_0x9d61('0x5b')]=function(_0x12314d,_0x21cb52,_0xf07c62,_0x211571,_0x49b150,_0x17c84a,_0x3d98a4){var _0x53a20c,_0x5f0d69,_0x5ae808,_0x259733;_0x17c84a[_0x9d61('0x30')]=intUtil[_0x9d61('0x4a')](_0x17c84a[_0x9d61('0x30')]);_0x17c84a[_0x9d61('0x50')]=intUtil[_0x9d61('0x4a')](_0x17c84a[_0x9d61('0x50')]);if(_0x3d98a4&&_0x3d98a4[_0x9d61('0x5c')]&&_0x3d98a4['recordingFormat']!=='none'){logger[_0x9d61('0x18')](_0x9d61('0x5d'),_0x9d61('0x4d'));_0x21cb52['recordingURL']=util[_0x9d61('0x1f')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x17c84a['serverUrl'],_0x21cb52[_0x9d61('0x51')],md5(_0x21cb52[_0x9d61('0x51')]));}return getConnection(_0x17c84a)['then'](function(_0x31e3c2){_0x259733=_0x31e3c2;return getUser(_0x17c84a,_0x211571[_0x9d61('0x52')],_0x259733);})[_0x9d61('0x26')](function(_0x75ba89){_0x53a20c=_0x75ba89;logger[_0x9d61('0x18')](_0x9d61('0x53'),_0x53a20c['id']);return getEndUser(_0x17c84a,_0x21cb52[_0x9d61('0x5e')],_0x21cb52[_0x9d61('0x5f')],_0x259733);})['then'](function(_0x3db42d){_0x5f0d69=_0x3db42d;logger[_0x9d61('0x18')](_0x9d61('0x60'),_0x5f0d69['id']);return createTicket(_0x17c84a,_0x53a20c,_0x5f0d69,_0xf07c62,_0x21cb52,_0xf07c62[_0x9d61('0x56')],_0x259733);})[_0x9d61('0x26')](function(_0x502d41){_0x5ae808=_0x502d41;logger[_0x9d61('0x18')](_0x9d61('0x57'));logger[_0x9d61('0x18')](_0x9d61('0x61'),_0x5ae808['id']);var _0x557d05=util['format']('%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT',_0x17c84a[_0x9d61('0x30')],_[_0x9d61('0x58')](_0x5ae808['id'],'x')[0x1]);logger[_0x9d61('0x18')]('[OUTBOUND]',_0x9d61('0x59'));emit(util[_0x9d61('0x1f')](_0x9d61('0x5a'),_0x211571[_0x9d61('0x16')]),_0x9d61('0x62'),{'uri':_0x557d05});})[_0x9d61('0x2b')](function(_0x2bfe55){logger[_0x9d61('0x2a')]('[OUTBOUND]',JSON[_0x9d61('0x25')](_0x2bfe55));});};exports['unmanaged']=function(_0x19284d,_0x29ec20,_0x5c80b5,_0x1351c9,_0x20625e,_0x5b6625){var _0x18c2de,_0x5d3db5,_0x3c8b43,_0x248dc1;_0x5b6625[_0x9d61('0x30')]=intUtil['stripTrailingSlash'](_0x5b6625[_0x9d61('0x30')]);_0x5b6625['serverUrl']=intUtil['stripTrailingSlash'](_0x5b6625[_0x9d61('0x50')]);if(_0x20625e&&_0x20625e['monitor_format']){logger[_0x9d61('0x18')]('['+_0x29ec20[_0x9d61('0x63')][_0x9d61('0x64')]()+']','Recording\x20is\x20enabled!');_0x29ec20[_0x9d61('0x4e')]=util[_0x9d61('0x1f')](_0x9d61('0x4f'),_0x5b6625[_0x9d61('0x50')],_0x29ec20[_0x9d61('0x51')],md5(_0x29ec20[_0x9d61('0x51')]));}else{_0x29ec20['recordingURL']='';}return getConnection(_0x5b6625)[_0x9d61('0x26')](function(_0x357676){_0x248dc1=_0x357676;return getUser(_0x5b6625,'',_0x248dc1);})[_0x9d61('0x26')](function(_0x579ef1){_0x18c2de=_0x579ef1;logger[_0x9d61('0x18')](_0x9d61('0x53'),_0x18c2de['id']);return getEndUser(_0x5b6625,_0x29ec20[_0x9d61('0x54')],_0x29ec20['calleridnum'],_0x248dc1);})[_0x9d61('0x26')](function(_0x582729){_0x5d3db5=_0x582729;logger['info'](_0x9d61('0x60'),_0x5d3db5['id']);return createTicket(_0x5b6625,_0x18c2de,_0x5d3db5,_0x5c80b5,_0x29ec20,_0x5c80b5[_0x9d61('0x56')],_0x248dc1);})['then'](function(_0x243f03){_0x3c8b43=_0x243f03;logger[_0x9d61('0x18')](_0x9d61('0x57'));logger['info'](_0x9d61('0x61'),_0x3c8b43['id']);})[_0x9d61('0x2b')](function(_0x18cb61){logger['error']('['+_0x29ec20[_0x9d61('0x63')][_0x9d61('0x64')]()+']',JSON[_0x9d61('0x25')](_0x18cb61));});};
\ No newline at end of file
+var _0xd51d=['Open','getString','Descriptions','POST','format','remoteUri','create','stringify','then','success','resolve','result','Ticket\x20could\x20not\x20be\x20created\x20due\x20to:\x20%s','error','statusCode','[vTiger],\x20%s,\x20%s,\x20%s','validateEmail','GET','%s/webservice.php','query','username','sessionName','email1','first_name','last_name','userId','catch','getUser','admin','Searching\x20end\x20user\x20with\x20phone','SELECT\x20id,\x20firstname,\x20lastname,\x20email,\x20phone,\x20mobile,\x20homephone,\x20otherphone,\x20assistantphone\x20FROM\x20Contacts\x20WHERE\x20phone\x20=\x20\x27%s\x27\x20OR\x20mobile\x20=\x27%s\x27\x20OR\x20homephone\x20=\x27%s\x27\x20OR\x20otherphone\x20=\x27%s\x27\x20OR\x20assistantphone\x20=\x27%s\x27;','length','Enduser\x20found!','firstname','Contacts','Enduser\x20created.','lastname','phone','getEndUser','accessKey','getchallenge','token','Account\x20%d\x20is\x20not\x20valid','[HTTP]','queue','stripTrailingSlash','monitor_format','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','uniqueid','The\x20User\x20ID\x20is:','calleridname','calleridnum','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT','split','[QUEUE]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','outbound','none','[OUTBOUND]','email','destcalleridname','destcalleridnum','The\x20Enduser\x20ID\x20is:','Fields','user:%s','unmanaged','toUpperCase','lodash','request-promise','bluebird','md5','util','ioredis','../../../../config/environment','../../../../config/logger','vTiger','redis','localhost','socket.io-emitter','emit','forEach','string','idField','toString','type','variableName','Variable','name','toLowerCase','info','merge','Normal'];(function(_0x5ae626,_0x5994e9){var _0x39523b=function(_0x4aa51b){while(--_0x4aa51b){_0x5ae626['push'](_0x5ae626['shift']());}};_0x39523b(++_0x5994e9);}(_0xd51d,0x1d1));var _0xdd51=function(_0x63267,_0x21f36e){_0x63267=_0x63267-0x0;var _0x430cb3=_0xd51d[_0x63267];return _0x430cb3;};'use strict';var _=require(_0xdd51('0x0'));var rp=require(_0xdd51('0x1'));var BPromise=require(_0xdd51('0x2'));var md5=require(_0xdd51('0x3'));var util=require(_0xdd51('0x4'));var Redis=require(_0xdd51('0x5'));var intUtil=require('./util');var config=require(_0xdd51('0x6'));var logger=require(_0xdd51('0x7'))(_0xdd51('0x8'));config[_0xdd51('0x9')]=_['defaults'](config[_0xdd51('0x9')],{'host':_0xdd51('0xa'),'port':0x18eb});var io=require(_0xdd51('0xb'))(new Redis(config[_0xdd51('0x9')]));function emit(_0x2712e2,_0x4c560,_0x659cd9){io['to'](_0x2712e2)[_0xdd51('0xc')](_0x4c560,_0x659cd9);}function getCustomFields(_0x509030,_0x4b62a6){var _0x2d092d={};if(_0x509030['length']>0x0){_[_0xdd51('0xd')](_0x509030,function(_0x15e35b){if(_0x15e35b['type']===_0xdd51('0xe')&&_0x15e35b[_0xdd51('0xf')]){_0x2d092d[_0x15e35b[_0xdd51('0xf')]]=_0x15e35b['content'][_0xdd51('0x10')]();}else if(_0x15e35b[_0xdd51('0x11')]==='variable'&&_0x15e35b['variableName']&&_0x15e35b['idField']&&_0x4b62a6[_0x15e35b[_0xdd51('0x12')]]){_0x2d092d[_0x15e35b[_0xdd51('0xf')]]=_0x4b62a6[_0x15e35b[_0xdd51('0x12')]]['toString']();}else if(_0x15e35b[_0xdd51('0x11')]==='customVariable'&&_0x15e35b['Variable']&&_0x15e35b[_0xdd51('0x13')]['name']&&_0x15e35b[_0xdd51('0xf')]&&_0x4b62a6[_0x15e35b['Variable'][_0xdd51('0x14')][_0xdd51('0x15')]()]){_0x2d092d[_0x15e35b[_0xdd51('0xf')]]=_0x4b62a6[_0x15e35b['Variable'][_0xdd51('0x14')][_0xdd51('0x15')]()][_0xdd51('0x10')]();}});}return _0x2d092d;}function createTicket(_0x54a318,_0x5ae641,_0x3736db,_0x6064d7,_0x4dcd9b,_0x52c9dc,_0x2de3f9){logger[_0xdd51('0x16')]('Creating\x20new\x20ticket...');var _0x35a353=_[_0xdd51('0x17')]({'parent_id':'','assigned_user_id':_0x5ae641['id'],'ticketpriorities':_0xdd51('0x18'),'ticketstatus':_0xdd51('0x19'),'ticket_title':intUtil[_0xdd51('0x1a')](_0x6064d7['Subjects'],_0x4dcd9b,'\x20'),'description':intUtil[_0xdd51('0x1a')](_0x6064d7[_0xdd51('0x1b')],_0x4dcd9b,'\x0a'),'contact_id':_0x3736db['id']},getCustomFields(_0x52c9dc,_0x4dcd9b));var _0x5e41c8={'method':_0xdd51('0x1c'),'uri':util[_0xdd51('0x1d')]('%s/webservice.php',_0x54a318[_0xdd51('0x1e')]),'form':{'operation':_0xdd51('0x1f'),'username':_0x54a318['username'],'sessionName':_0x2de3f9['sessionName'],'elementType':'HelpDesk','element':JSON[_0xdd51('0x20')](_0x35a353)},'json':!![]};return request(_0x5e41c8)[_0xdd51('0x21')](function(_0x413e27){if(_0x413e27[_0xdd51('0x22')]){return BPromise[_0xdd51('0x23')]({'id':_0x413e27[_0xdd51('0x24')]['id']});}else{throw new Error(util[_0xdd51('0x1d')](_0xdd51('0x25'),JSON['stringify'](_0x413e27[_0xdd51('0x26')])));}})['catch'](function(_0x5ddcab){var _0x42c71a=_0x5ddcab[_0xdd51('0x27')]||0x1f4;logger[_0xdd51('0x26')](_0xdd51('0x28'),'createTicket',_0x42c71a,JSON['stringify'](_0x5ddcab));});}function getUser(_0x5aeca8,_0x99e6e7,_0x554964){if(intUtil[_0xdd51('0x29')](_0x99e6e7)){logger[_0xdd51('0x16')]('Getting\x20agent\x20with\x20email',_0x99e6e7);return request({'method':_0xdd51('0x2a'),'uri':util[_0xdd51('0x1d')](_0xdd51('0x2b'),_0x5aeca8[_0xdd51('0x1e')]),'qs':{'operation':_0xdd51('0x2c'),'username':_0x5aeca8[_0xdd51('0x2d')],'sessionName':_0x554964[_0xdd51('0x2e')],'query':util[_0xdd51('0x1d')]('SELECT\x20first_name,\x20last_name,\x20email1\x20FROM\x20Users\x20WHERE\x20email1=\x27%s\x27;',_0x99e6e7)},'json':!![]})['then'](function(_0x315c42){if(_0x315c42[_0xdd51('0x22')]&&_0x315c42[_0xdd51('0x24')]['length']){logger[_0xdd51('0x16')]('Agent\x20found!');return BPromise[_0xdd51('0x23')]({'id':_0x315c42[_0xdd51('0x24')][0x0]['id'],'email':_0x315c42[_0xdd51('0x24')][0x0][_0xdd51('0x2f')],'name':_0x315c42[_0xdd51('0x24')][0x0][_0xdd51('0x30')]+'\x20'+_0x315c42[_0xdd51('0x24')][_0xdd51('0x31')]});}else{logger[_0xdd51('0x16')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return BPromise['resolve']({'id':_0x554964[_0xdd51('0x32')],'email':_0x5aeca8[_0xdd51('0x2d')],'name':'admin'});}})[_0xdd51('0x33')](function(_0x3c588d){var _0x5ce417=_0x3c588d[_0xdd51('0x27')]||0x1f4;logger[_0xdd51('0x26')](_0xdd51('0x28'),_0xdd51('0x34'),_0x5ce417,JSON[_0xdd51('0x20')](_0x3c588d));});}else{logger[_0xdd51('0x16')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return BPromise['resolve']({'id':_0x554964[_0xdd51('0x32')],'email':_0x5aeca8['username'],'name':_0xdd51('0x35')})['catch'](function(_0x97fd44){var _0x2fc3ee=_0x97fd44[_0xdd51('0x27')]||0x1f4;logger[_0xdd51('0x26')](_0xdd51('0x28'),'getUser',_0x2fc3ee,JSON[_0xdd51('0x20')](_0x97fd44));});}}function getEndUser(_0x2c5313,_0x1501c5,_0x61fa58,_0x968768){logger[_0xdd51('0x16')](_0xdd51('0x36'),_0x61fa58);return request({'method':'GET','uri':util[_0xdd51('0x1d')](_0xdd51('0x2b'),_0x2c5313[_0xdd51('0x1e')]),'qs':{'operation':_0xdd51('0x2c'),'username':_0x2c5313[_0xdd51('0x2d')],'sessionName':_0x968768[_0xdd51('0x2e')],'query':util[_0xdd51('0x1d')](_0xdd51('0x37'),_0x61fa58,_0x61fa58,_0x61fa58,_0x61fa58,_0x61fa58)},'json':!![]})[_0xdd51('0x21')](function(_0x546729){if(_0x546729[_0xdd51('0x22')]&&_0x546729['result'][_0xdd51('0x38')]){logger['info'](_0xdd51('0x39'));return BPromise[_0xdd51('0x23')]({'id':_0x546729[_0xdd51('0x24')][0x0]['id'],'name':_0x546729[_0xdd51('0x24')][0x0][_0xdd51('0x3a')]+'\x20'+_0x546729[_0xdd51('0x24')][0x0]['lastname'],'phone':_0x61fa58});}else{logger['info']('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');return request({'method':_0xdd51('0x1c'),'uri':util[_0xdd51('0x1d')](_0xdd51('0x2b'),_0x2c5313[_0xdd51('0x1e')]),'form':{'operation':_0xdd51('0x1f'),'sessionName':_0x968768[_0xdd51('0x2e')],'elementType':_0xdd51('0x3b'),'element':JSON[_0xdd51('0x20')]({'lastname':_0x1501c5,'phone':_0x61fa58,'assigned_user_id':'\x20'})},'json':!![]})[_0xdd51('0x21')](function(_0xd23a50){logger[_0xdd51('0x16')](_0xdd51('0x3c'));return BPromise[_0xdd51('0x23')]({'id':_0xd23a50[_0xdd51('0x24')]['id'],'name':_0xd23a50[_0xdd51('0x24')][_0xdd51('0x3d')],'phone':_0xd23a50[_0xdd51('0x24')][_0xdd51('0x3e')]});})[_0xdd51('0x33')](function(_0x44928f){var _0x4c75d1=_0x44928f[_0xdd51('0x27')]||0x1f4;logger[_0xdd51('0x26')](_0xdd51('0x28'),_0xdd51('0x3f'),_0x4c75d1,JSON[_0xdd51('0x20')](_0x44928f));});}});}function getConnection(_0x2fef4d){var _0x4c65e7=_0x2fef4d[_0xdd51('0x2d')];var _0x5f270b=_0x2fef4d[_0xdd51('0x40')];return request({'method':'GET','uri':util['format']('%s/webservice.php',_0x2fef4d[_0xdd51('0x1e')]),'qs':{'operation':_0xdd51('0x41'),'username':_0x4c65e7},'json':!![]})[_0xdd51('0x21')](function(_0xfb1091){if(_0xfb1091[_0xdd51('0x22')]){return request({'method':_0xdd51('0x1c'),'uri':util['format']('%s/webservice.php',_0x2fef4d[_0xdd51('0x1e')]),'form':{'operation':'login','username':_0x4c65e7,'accessKey':md5(_0xfb1091[_0xdd51('0x24')][_0xdd51('0x42')]+_0x5f270b)},'json':!![]});}})[_0xdd51('0x21')](function(_0x54fb2f){if(_0x54fb2f['success']){return BPromise[_0xdd51('0x23')](_0x54fb2f['result']);}else{throw new Error(util['format'](_0xdd51('0x43'),_0x2fef4d['id']));}})[_0xdd51('0x33')](function(_0xd051e){var _0x2927e4=_0xd051e[_0xdd51('0x27')]||0x1f4;logger['error']('[vTiger],\x20%s,\x20%s,\x20%s','getConnection',_0x2927e4,JSON[_0xdd51('0x20')](_0xd051e));});}function request(_0x160221){logger['info'](_0xdd51('0x44'),JSON[_0xdd51('0x20')](_0x160221));return rp(_0x160221);}exports[_0xdd51('0x45')]=function(_0x59b43f,_0x476921,_0x50b614,_0x5510f4,_0x4d0c6c,_0x32d9e2){var _0x195a13,_0x2164b0,_0x8f25c,_0x345da0;_0x32d9e2[_0xdd51('0x1e')]=intUtil[_0xdd51('0x46')](_0x32d9e2[_0xdd51('0x1e')]);if(_0x4d0c6c&&_0x4d0c6c[_0xdd51('0x47')]){logger['info']('[QUEUE]',_0xdd51('0x48'));_0x476921[_0xdd51('0x49')]=util['format'](_0xdd51('0x4a'),_0x32d9e2[_0xdd51('0x4b')],_0x476921[_0xdd51('0x4c')],md5(_0x476921[_0xdd51('0x4c')]));}else{_0x476921[_0xdd51('0x49')]='';}return getConnection(_0x32d9e2)['then'](function(_0x4a869b){_0x345da0=_0x4a869b;return getUser(_0x32d9e2,_0x5510f4['email'],_0x345da0);})[_0xdd51('0x21')](function(_0x235eef){_0x195a13=_0x235eef;logger[_0xdd51('0x16')](_0xdd51('0x4d'),_0x195a13['id']);return getEndUser(_0x32d9e2,_0x476921[_0xdd51('0x4e')],_0x476921[_0xdd51('0x4f')],_0x345da0);})[_0xdd51('0x21')](function(_0xd65f77){_0x2164b0=_0xd65f77;logger[_0xdd51('0x16')]('The\x20Enduser\x20ID\x20is:',_0x2164b0['id']);return createTicket(_0x32d9e2,_0x195a13,_0x2164b0,_0x50b614,_0x476921,_0x50b614['Fields'],_0x345da0);})[_0xdd51('0x21')](function(_0x3036d3){_0x8f25c=_0x3036d3;logger[_0xdd51('0x16')](_0xdd51('0x50'));logger[_0xdd51('0x16')](_0xdd51('0x51'),_0x8f25c['id']);var _0x2b55b8=util[_0xdd51('0x1d')](_0xdd51('0x52'),_0x32d9e2[_0xdd51('0x1e')],_[_0xdd51('0x53')](_0x8f25c['id'],'x')[0x1]);logger['info'](_0xdd51('0x54'),_0xdd51('0x55'));emit(util[_0xdd51('0x1d')]('user:%s',_0x5510f4[_0xdd51('0x14')]),_0xdd51('0x56'),{'uri':_0x2b55b8});})[_0xdd51('0x33')](function(_0x1f0cee){logger['error'](_0xdd51('0x54'),JSON[_0xdd51('0x20')](_0x1f0cee));});};exports[_0xdd51('0x57')]=function(_0x3ba334,_0xc0ca2,_0x40be62,_0x5d2783,_0x3dc016,_0x58addc,_0xb7ba3){var _0x2b48f6,_0x56840c,_0x1566e6,_0x2e4dc8;_0x58addc['remoteUri']=intUtil[_0xdd51('0x46')](_0x58addc[_0xdd51('0x1e')]);_0x58addc[_0xdd51('0x4b')]=intUtil['stripTrailingSlash'](_0x58addc[_0xdd51('0x4b')]);if(_0xb7ba3&&_0xb7ba3['recordingFormat']&&_0xb7ba3['recordingFormat']!==_0xdd51('0x58')){logger['info'](_0xdd51('0x59'),_0xdd51('0x48'));_0xc0ca2[_0xdd51('0x49')]=util[_0xdd51('0x1d')](_0xdd51('0x4a'),_0x58addc[_0xdd51('0x4b')],_0xc0ca2['uniqueid'],md5(_0xc0ca2[_0xdd51('0x4c')]));}return getConnection(_0x58addc)[_0xdd51('0x21')](function(_0x5a1ce5){_0x2e4dc8=_0x5a1ce5;return getUser(_0x58addc,_0x5d2783[_0xdd51('0x5a')],_0x2e4dc8);})[_0xdd51('0x21')](function(_0x1395ff){_0x2b48f6=_0x1395ff;logger[_0xdd51('0x16')](_0xdd51('0x4d'),_0x2b48f6['id']);return getEndUser(_0x58addc,_0xc0ca2[_0xdd51('0x5b')],_0xc0ca2[_0xdd51('0x5c')],_0x2e4dc8);})[_0xdd51('0x21')](function(_0x273692){_0x56840c=_0x273692;logger[_0xdd51('0x16')](_0xdd51('0x5d'),_0x56840c['id']);return createTicket(_0x58addc,_0x2b48f6,_0x56840c,_0x40be62,_0xc0ca2,_0x40be62[_0xdd51('0x5e')],_0x2e4dc8);})[_0xdd51('0x21')](function(_0x23e748){_0x1566e6=_0x23e748;logger[_0xdd51('0x16')]('Ticket\x20created!');logger[_0xdd51('0x16')](_0xdd51('0x51'),_0x1566e6['id']);var _0x45e7ce=util[_0xdd51('0x1d')](_0xdd51('0x52'),_0x58addc['remoteUri'],_[_0xdd51('0x53')](_0x1566e6['id'],'x')[0x1]);logger['info']('[OUTBOUND]',_0xdd51('0x55'));emit(util[_0xdd51('0x1d')](_0xdd51('0x5f'),_0x5d2783[_0xdd51('0x14')]),_0xdd51('0x56'),{'uri':_0x45e7ce});})['catch'](function(_0xcb7c04){logger['error'](_0xdd51('0x59'),JSON[_0xdd51('0x20')](_0xcb7c04));});};exports[_0xdd51('0x60')]=function(_0x218389,_0x14631d,_0x489c4e,_0x2a778c,_0x1ff0da,_0x57bb28){var _0x36a873,_0x2afa5,_0x48dd22,_0x781a8f;_0x57bb28[_0xdd51('0x1e')]=intUtil[_0xdd51('0x46')](_0x57bb28[_0xdd51('0x1e')]);_0x57bb28[_0xdd51('0x4b')]=intUtil[_0xdd51('0x46')](_0x57bb28[_0xdd51('0x4b')]);if(_0x1ff0da&&_0x1ff0da[_0xdd51('0x47')]){logger[_0xdd51('0x16')]('['+_0x14631d['lastevent'][_0xdd51('0x61')]()+']',_0xdd51('0x48'));_0x14631d[_0xdd51('0x49')]=util[_0xdd51('0x1d')](_0xdd51('0x4a'),_0x57bb28[_0xdd51('0x4b')],_0x14631d[_0xdd51('0x4c')],md5(_0x14631d['uniqueid']));}else{_0x14631d[_0xdd51('0x49')]='';}return getConnection(_0x57bb28)[_0xdd51('0x21')](function(_0x4a6a34){_0x781a8f=_0x4a6a34;return getUser(_0x57bb28,'',_0x781a8f);})[_0xdd51('0x21')](function(_0x1d58df){_0x36a873=_0x1d58df;logger['info']('The\x20User\x20ID\x20is:',_0x36a873['id']);return getEndUser(_0x57bb28,_0x14631d['calleridname'],_0x14631d[_0xdd51('0x4f')],_0x781a8f);})[_0xdd51('0x21')](function(_0x35aae7){_0x2afa5=_0x35aae7;logger['info']('The\x20Enduser\x20ID\x20is:',_0x2afa5['id']);return createTicket(_0x57bb28,_0x36a873,_0x2afa5,_0x489c4e,_0x14631d,_0x489c4e[_0xdd51('0x5e')],_0x781a8f);})[_0xdd51('0x21')](function(_0x3af506){_0x48dd22=_0x3af506;logger[_0xdd51('0x16')](_0xdd51('0x50'));logger[_0xdd51('0x16')](_0xdd51('0x51'),_0x48dd22['id']);})['catch'](function(_0x38000b){logger['error']('['+_0x14631d['lastevent'][_0xdd51('0x61')]()+']',JSON['stringify'](_0x38000b));});};
\ No newline at end of file
diff --git a/server/services/ami/trigger/integration/zendesk.js b/server/services/ami/trigger/integration/zendesk.js
index d0ed939..1cd1b02 100644
--- a/server/services/ami/trigger/integration/zendesk.js
+++ b/server/services/ami/trigger/integration/zendesk.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7072=['socket.io-emitter','emit','application/json','info','Creating\x20new\x20ticket...','format','%s/tickets.json','remoteUri','POST','merge','Tags','name','Subjects','Descriptions','getString','Fields','then','Ticket\x20created!','ticket','validateEmail','Getting\x20agent\x20with\x20email','%s/search.json','type:user\x20role:agent\x20email:%s','Agent\x20found!','find','results','agent','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/users/me.json','Admin\x20account\x20selected.','user','Searching\x20enduser\x20with\x20phone','length','Enduser\x20found!','%s/users.json','end-user','Caller\x20-\x20%s','Enduser\x20created.','%s:%s','authType','token','%s/token:%s','username','Basic\x20%s','toString','debug','[HTTP]','GET','forEach','string','nameField','customField','toLowerCase','content','type','idField','custom_fields','push','variable','variableName','customVariable','Variable','queue','stripTrailingSlash','serverUrl','monitor_format','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','recordingURL','email','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','[QUEUE]','Displaying\x20ticket\x20to\x20agent...','%s/channels/voice/agents/%d/tickets/%d/display.json','newTab','user:%s','%s/agent/tickets/%s','error','Zendesk\x20account\x20type\x20not\x20recognized','catch','[QUEUE]\x20Error\x20running\x20Zendesk\x20integration','inspect','outbound','recordingFormat','none','[OUTBOUND]','The\x20User\x20ID\x20is:','destcalleridname','integrationTab','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration','unmanaged','lastevent','toUpperCase','request-promise','md5','util','ioredis','./util','zendesk','defaults','redis','localhost'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x7072,0x138));var _0x2707=function(_0x1969a7,_0x5a133a){_0x1969a7=_0x1969a7-0x0;var _0x3d665f=_0x7072[_0x1969a7];return _0x3d665f;};'use strict';var _=require('lodash');var rp=require(_0x2707('0x0'));var md5=require(_0x2707('0x1'));var util=require(_0x2707('0x2'));var Redis=require(_0x2707('0x3'));var intUtil=require(_0x2707('0x4'));var config=require('../../../../config/environment');var logger=require('../../../../config/logger')(_0x2707('0x5'));config['redis']=_[_0x2707('0x6')](config[_0x2707('0x7')],{'host':_0x2707('0x8'),'port':0x18eb});var io=require(_0x2707('0x9'))(new Redis(config[_0x2707('0x7')]));function emit(_0x128205,_0x21b0a0,_0x745cfd){io['to'](_0x128205)[_0x2707('0xa')](_0x21b0a0,_0x745cfd);}var headers={'Content-Type':_0x2707('0xb'),'Accept':'application/json'};function getTicket(_0x597ff9,_0x380339,_0x179cef,_0x379ac5,_0x56406b){logger[_0x2707('0xc')](_0x2707('0xd'));return request({'uri':util[_0x2707('0xe')](_0x2707('0xf'),_0x597ff9[_0x2707('0x10')]),'method':_0x2707('0x11'),'body':{'ticket':_[_0x2707('0x12')]({'requester_id':_0x179cef['id'],'submitter_id':_0x380339?_0x380339['id']:undefined,'assignee_id':_0x380339?_0x380339['id']:undefined,'tags':getTags(_0x379ac5[_0x2707('0x13')],_0x2707('0x14')),'subject':intUtil['getString'](_0x379ac5[_0x2707('0x15')],_0x56406b,'\x20'),'description':intUtil['getString'](_0x379ac5[_0x2707('0x16')],_0x56406b,'\x0a'),'comment':{'public':![],'body':intUtil[_0x2707('0x17')](_0x379ac5[_0x2707('0x16')],_0x56406b,'\x0a')}},getCustomFields(_0x379ac5[_0x2707('0x18')],_0x56406b))}})[_0x2707('0x19')](function(_0x4e52a3){logger[_0x2707('0xc')](_0x2707('0x1a'));return _0x4e52a3[_0x2707('0x1b')];});}function getUser(_0x5d523f,_0x1153d7){if(intUtil[_0x2707('0x1c')](_0x1153d7)){logger[_0x2707('0xc')](_0x2707('0x1d'),_0x1153d7);return request({'uri':util[_0x2707('0xe')](_0x2707('0x1e'),_0x5d523f['remoteUri']),'qs':{'query':util[_0x2707('0xe')](_0x2707('0x1f'),_0x1153d7)}})[_0x2707('0x19')](function(_0x518262){if(_0x518262['count']){logger['info'](_0x2707('0x20'));return _[_0x2707('0x21')](_0x518262[_0x2707('0x22')],{'email':_0x1153d7,'role':_0x2707('0x23')});}else{logger[_0x2707('0xc')](_0x2707('0x24'));return request({'uri':util[_0x2707('0xe')](_0x2707('0x25'),_0x5d523f[_0x2707('0x10')])})[_0x2707('0x19')](function(_0x37c475){logger[_0x2707('0xc')](_0x2707('0x26'));return _0x37c475[_0x2707('0x27')];});}});}else{logger['info'](_0x2707('0x24'));return request({'uri':util[_0x2707('0xe')](_0x2707('0x25'),_0x5d523f[_0x2707('0x10')])})[_0x2707('0x19')](function(_0x3f6e8b){logger['info'](_0x2707('0x26'));return _0x3f6e8b[_0x2707('0x27')];});}}function getEndUser(_0x171add,_0x2ad386,_0x5b763f){logger['info'](_0x2707('0x28'),_0x5b763f);return request({'uri':util['format'](_0x2707('0x1e'),_0x171add[_0x2707('0x10')]),'qs':{'query':util[_0x2707('0xe')]('type:user\x20role:end-user\x20phone:%s',_0x5b763f)}})[_0x2707('0x19')](function(_0x14daf8){var _0x2c7047;if(_0x14daf8['results'][_0x2707('0x29')]){_0x14daf8[_0x2707('0x22')]=_['filter'](_0x14daf8[_0x2707('0x22')],{'suspended':![],'role':'end-user'});if(_0x14daf8['results'][_0x2707('0x29')]){_0x2c7047=_['first'](_0x14daf8[_0x2707('0x22')]);}}if(_0x2c7047){logger[_0x2707('0xc')](_0x2707('0x2a'));return _0x2c7047;}else{logger[_0x2707('0xc')]('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');return request({'uri':util[_0x2707('0xe')](_0x2707('0x2b'),_0x171add[_0x2707('0x10')]),'method':_0x2707('0x11'),'body':{'user':{'role':_0x2707('0x2c'),'name':util[_0x2707('0xe')](_0x2707('0x2d'),_0x2ad386||_0x5b763f),'phone':_0x5b763f}}})[_0x2707('0x19')](function(_0x2d2520){logger['info'](_0x2707('0x2e'));return _0x2d2520[_0x2707('0x27')];});}});}function getAuth(_0x5bcdef){var _0x47ce1c;if(_0x5bcdef['authType']==='password'){_0x47ce1c=util['format'](_0x2707('0x2f'),_0x5bcdef['username'],_0x5bcdef['password']);}else if(_0x5bcdef[_0x2707('0x30')]===_0x2707('0x31')){_0x47ce1c=util['format'](_0x2707('0x32'),_0x5bcdef[_0x2707('0x33')],_0x5bcdef['token']);}return util['format'](_0x2707('0x34'),new Buffer(_0x47ce1c)[_0x2707('0x35')]('base64'));}function request(_0x5d69cf){logger[_0x2707('0x36')](_0x2707('0x37'),JSON['stringify'](_0x5d69cf));return rp(_[_0x2707('0x6')](_0x5d69cf,{'method':_0x2707('0x38'),'headers':headers,'json':!![]}));}function getTags(_0x1bd1c3,_0x2df9d5){var _0x9943e8=[];if(_0x1bd1c3&&_0x1bd1c3[_0x2707('0x29')]>0x0){_0x9943e8=_['map'](_0x1bd1c3,_0x2df9d5);}return _0x9943e8;}function getCustomFields(_0x15a953,_0x1836f7){var _0x37c39e=[];var _0x33612f={'custom_fields':[]};if(_0x15a953[_0x2707('0x29')]>0x0){_[_0x2707('0x39')](_0x15a953,function(_0x2700bf){if(_0x2700bf['type']===_0x2707('0x3a')&&_0x2700bf[_0x2707('0x3b')]&&!_0x2700bf[_0x2707('0x3c')]){_0x33612f[_0x2700bf[_0x2707('0x3b')][_0x2707('0x3d')]()]=_0x2700bf[_0x2707('0x3e')][_0x2707('0x35')]();}else if(_0x2700bf[_0x2707('0x3f')]===_0x2707('0x3a')&&_0x2700bf[_0x2707('0x40')]&&_0x2700bf[_0x2707('0x3c')]){_0x33612f[_0x2707('0x41')][_0x2707('0x42')]({'id':_0x2700bf[_0x2707('0x40')],'value':_0x2700bf[_0x2707('0x3e')][_0x2707('0x35')]()});}else if(_0x2700bf['type']===_0x2707('0x43')&&_0x2700bf[_0x2707('0x44')]&&_0x2700bf['idField']&&_0x2700bf[_0x2707('0x3c')]){_0x1836f7[_0x2700bf['variableName']]&&_0x33612f[_0x2707('0x41')][_0x2707('0x42')]({'id':_0x2700bf[_0x2707('0x40')],'value':_0x1836f7[_0x2700bf[_0x2707('0x44')]][_0x2707('0x35')]()});}else if(_0x2700bf[_0x2707('0x3f')]===_0x2707('0x45')&&_0x2700bf['Variable']&&_0x2700bf[_0x2707('0x46')][_0x2707('0x14')]&&_0x2700bf['idField']&&_0x2700bf[_0x2707('0x3c')]){_0x1836f7[_0x2700bf[_0x2707('0x46')][_0x2707('0x14')]['toLowerCase']()]&&_0x33612f['custom_fields'][_0x2707('0x42')]({'id':_0x2700bf[_0x2707('0x40')],'value':_0x1836f7[_0x2700bf['Variable'][_0x2707('0x14')]['toLowerCase']()][_0x2707('0x35')]()});}});}return _0x33612f;}exports[_0x2707('0x47')]=function(_0x323703,_0x6947fa,_0x4b110e,_0x16ede1,_0x420604,_0x3310e6){var _0x2befe9,_0x20a09c;_0x3310e6[_0x2707('0x10')]=intUtil[_0x2707('0x48')](_0x3310e6['remoteUri']);_0x3310e6[_0x2707('0x49')]=intUtil[_0x2707('0x48')](_0x3310e6[_0x2707('0x49')]);if(_0x420604&&_0x420604[_0x2707('0x4a')]){logger[_0x2707('0xc')]('[QUEUE]',_0x2707('0x4b'));_0x6947fa['recordingURL']=util[_0x2707('0xe')](_0x2707('0x4c'),_0x3310e6['serverUrl'],_0x6947fa[_0x2707('0x4d')],md5(_0x6947fa[_0x2707('0x4d')]));}else{_0x6947fa[_0x2707('0x4e')]='';}headers['Authorization']=getAuth(_0x3310e6);return getUser(_0x3310e6,_0x16ede1[_0x2707('0x4f')])['then'](function(_0xf3bfb8){_0x2befe9=_0xf3bfb8;logger[_0x2707('0xc')]('The\x20User\x20ID\x20is:',_0x2befe9['id']);return getEndUser(_0x3310e6,_0x6947fa[_0x2707('0x50')],_0x6947fa[_0x2707('0x51')]);})[_0x2707('0x19')](function(_0x5adec1){_0x20a09c=_0x5adec1;logger['info'](_0x2707('0x52'),_0x20a09c['id']);return getTicket(_0x3310e6,_0x2befe9,_0x20a09c,_0x4b110e,_0x6947fa);})[_0x2707('0x19')](function(_0x292b44){if(_0x292b44){logger[_0x2707('0xc')](_0x2707('0x53'),_0x292b44['id']);switch(_0x3310e6['type']){case'integrationTab':logger['info'](_0x2707('0x54'),_0x2707('0x55'));return request({'uri':util[_0x2707('0xe')](_0x2707('0x56'),_0x3310e6[_0x2707('0x10')],_0x2befe9['id'],_0x292b44['id']),'method':'POST'});case _0x2707('0x57'):logger[_0x2707('0xc')]('[QUEUE]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x2707('0xe')](_0x2707('0x58'),_0x16ede1[_0x2707('0x14')]),'trigger:browser:url',{'uri':util[_0x2707('0xe')](_0x2707('0x59'),_0x3310e6[_0x2707('0x10')],_0x292b44['id'])});break;default:logger[_0x2707('0x5a')]('[QUEUE]',_0x2707('0x5b'));}}})[_0x2707('0x5c')](function(_0x28a80e){logger[_0x2707('0x5a')](_0x2707('0x5d'),util[_0x2707('0x5e')](_0x28a80e,{'showHidden':!![],'depth':null}));});};exports[_0x2707('0x5f')]=function(_0x32befc,_0x2148b2,_0xe9512e,_0x4f2b54,_0x38acdd,_0x5316ee,_0x5d27ad){var _0x3029ce,_0x4b9451;_0x5316ee['remoteUri']=intUtil[_0x2707('0x48')](_0x5316ee[_0x2707('0x10')]);_0x5316ee[_0x2707('0x49')]=intUtil[_0x2707('0x48')](_0x5316ee[_0x2707('0x49')]);if(_0x5d27ad&&_0x5d27ad[_0x2707('0x60')]&&_0x5d27ad[_0x2707('0x60')]!==_0x2707('0x61')){logger[_0x2707('0xc')](_0x2707('0x62'),_0x2707('0x4b'));_0x2148b2['recordingURL']=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x5316ee[_0x2707('0x49')],_0x2148b2[_0x2707('0x4d')],md5(_0x2148b2[_0x2707('0x4d')]));}headers['Authorization']=getAuth(_0x5316ee);return getUser(_0x5316ee,_0x4f2b54['email'])[_0x2707('0x19')](function(_0x39c9b4){_0x3029ce=_0x39c9b4;logger[_0x2707('0xc')](_0x2707('0x63'),_0x3029ce['id']);return getEndUser(_0x5316ee,_0x2148b2[_0x2707('0x64')],_0x2148b2['destcalleridnum']);})['then'](function(_0x3c4c7b){_0x4b9451=_0x3c4c7b;logger[_0x2707('0xc')](_0x2707('0x52'),_0x4b9451['id']);return getTicket(_0x5316ee,_0x3029ce,_0x4b9451,_0xe9512e,_0x2148b2);})[_0x2707('0x19')](function(_0x19b87b){if(_0x19b87b){logger[_0x2707('0xc')](_0x2707('0x53'),_0x19b87b['id']);switch(_0x5316ee[_0x2707('0x3f')]){case _0x2707('0x65'):logger['info'](_0x2707('0x62'),_0x2707('0x55'));return request({'uri':util[_0x2707('0xe')](_0x2707('0x56'),_0x5316ee[_0x2707('0x10')],_0x3029ce['id'],_0x19b87b['id']),'method':_0x2707('0x11')});case'newTab':logger['info'](_0x2707('0x62'),_0x2707('0x66'));emit(util['format']('user:%s',_0x4f2b54['name']),'trigger:browser:url',{'uri':util[_0x2707('0xe')](_0x2707('0x59'),_0x5316ee['remoteUri'],_0x19b87b['id'])});break;default:logger[_0x2707('0x5a')](_0x2707('0x62'),_0x2707('0x5b'));}}})['catch'](function(_0x508265){logger[_0x2707('0x5a')](_0x2707('0x67'),util[_0x2707('0x5e')](_0x508265,{'showHidden':!![],'depth':null}));});};exports[_0x2707('0x68')]=function(_0x3001e5,_0xdb1de0,_0x3973a0,_0x4da6cf,_0x40b201,_0x3bedb2){var _0x319a1e,_0xe1074b;_0x3bedb2[_0x2707('0x10')]=intUtil[_0x2707('0x48')](_0x3bedb2['remoteUri']);_0x3bedb2[_0x2707('0x49')]=intUtil[_0x2707('0x48')](_0x3bedb2[_0x2707('0x49')]);if(_0x40b201&&_0x40b201[_0x2707('0x4a')]){logger[_0x2707('0xc')]('['+_0xdb1de0[_0x2707('0x69')]['toUpperCase']()+']','Recording\x20is\x20enabled!');_0xdb1de0[_0x2707('0x4e')]=util[_0x2707('0xe')](_0x2707('0x4c'),_0x3bedb2[_0x2707('0x49')],_0xdb1de0[_0x2707('0x4d')],md5(_0xdb1de0[_0x2707('0x4d')]));}else{_0xdb1de0['recordingURL']='';}headers['Authorization']=getAuth(_0x3bedb2);return getUser(_0x3bedb2)[_0x2707('0x19')](function(_0x48a9af){_0x319a1e=_0x48a9af;logger[_0x2707('0xc')](_0x2707('0x63'),_0x319a1e['id']);return getEndUser(_0x3bedb2,_0xdb1de0[_0x2707('0x50')],_0xdb1de0[_0x2707('0x51')]);})[_0x2707('0x19')](function(_0x1783e1){_0xe1074b=_0x1783e1;logger['info'](_0x2707('0x52'),_0xe1074b['id']);return getTicket(_0x3bedb2,_0x319a1e,_0xe1074b,_0x3973a0,_0xdb1de0);})['then'](function(_0x7327da){if(_0x7327da){logger[_0x2707('0xc')]('The\x20Ticket\x20ID\x20is:',_0x7327da['id']);}})[_0x2707('0x5c')](function(_0x16dcac){logger[_0x2707('0x5a')]('['+_0xdb1de0[_0x2707('0x69')][_0x2707('0x6a')]()+']'+'\x20Error\x20running\x20Zendesk\x20integration',util[_0x2707('0x5e')](_0x16dcac,{'showHidden':!![],'depth':null}));});};
\ No newline at end of file
+var _0x3e5c=['variableName','idField','customVariable','Variable','toLowerCase','custom_fields','stripTrailingSlash','serverUrl','monitor_format','Recording\x20is\x20enabled!','Authorization','email','The\x20User\x20ID\x20is:','calleridnum','The\x20Enduser\x20ID\x20is:','integrationTab','[QUEUE]','%s/channels/voice/agents/%d/tickets/%d/display.json','user:%s','trigger:browser:url','%s/agent/tickets/%s','Zendesk\x20account\x20type\x20not\x20recognized','error','[QUEUE]\x20Error\x20running\x20Zendesk\x20integration','recordingFormat','[OUTBOUND]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','destcalleridnum','The\x20Ticket\x20ID\x20is:','newTab','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','catch','unmanaged','lastevent','toUpperCase','recordingURL','calleridname','\x20Error\x20running\x20Zendesk\x20integration','inspect','lodash','request-promise','md5','util','./util','../../../../config/environment','../../../../config/logger','zendesk','redis','defaults','localhost','socket.io-emitter','emit','application/json','info','Creating\x20new\x20ticket...','format','%s/tickets.json','POST','merge','Tags','name','getString','Subjects','Descriptions','then','Ticket\x20created!','ticket','validateEmail','Getting\x20agent\x20with\x20email','%s/search.json','remoteUri','type:user\x20role:agent\x20email:%s','count','Agent\x20found!','results','agent','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','Admin\x20account\x20selected.','user','%s/users/me.json','Searching\x20enduser\x20with\x20phone','type:user\x20role:end-user\x20phone:%s','filter','first','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/users.json','end-user','Caller\x20-\x20%s','Enduser\x20created.','password','%s:%s','username','authType','%s/token:%s','token','Basic\x20%s','toString','base64','debug','[HTTP]','stringify','GET','length','map','forEach','type','string','nameField','customField','push','content','variable'];(function(_0x33d4a5,_0x514a52){var _0x5a5e9d=function(_0x23bcc1){while(--_0x23bcc1){_0x33d4a5['push'](_0x33d4a5['shift']());}};_0x5a5e9d(++_0x514a52);}(_0x3e5c,0x9a));var _0xc3e5=function(_0xa517d,_0x3a90cc){_0xa517d=_0xa517d-0x0;var _0x2c6f44=_0x3e5c[_0xa517d];return _0x2c6f44;};'use strict';var _=require(_0xc3e5('0x0'));var rp=require(_0xc3e5('0x1'));var md5=require(_0xc3e5('0x2'));var util=require(_0xc3e5('0x3'));var Redis=require('ioredis');var intUtil=require(_0xc3e5('0x4'));var config=require(_0xc3e5('0x5'));var logger=require(_0xc3e5('0x6'))(_0xc3e5('0x7'));config[_0xc3e5('0x8')]=_[_0xc3e5('0x9')](config['redis'],{'host':_0xc3e5('0xa'),'port':0x18eb});var io=require(_0xc3e5('0xb'))(new Redis(config[_0xc3e5('0x8')]));function emit(_0xcbbec0,_0x2d580e,_0x4864a2){io['to'](_0xcbbec0)[_0xc3e5('0xc')](_0x2d580e,_0x4864a2);}var headers={'Content-Type':_0xc3e5('0xd'),'Accept':_0xc3e5('0xd')};function getTicket(_0x19813b,_0x448454,_0x644286,_0xd1ef16,_0x55bece){logger[_0xc3e5('0xe')](_0xc3e5('0xf'));return request({'uri':util[_0xc3e5('0x10')](_0xc3e5('0x11'),_0x19813b['remoteUri']),'method':_0xc3e5('0x12'),'body':{'ticket':_[_0xc3e5('0x13')]({'requester_id':_0x644286['id'],'submitter_id':_0x448454?_0x448454['id']:undefined,'assignee_id':_0x448454?_0x448454['id']:undefined,'tags':getTags(_0xd1ef16[_0xc3e5('0x14')],_0xc3e5('0x15')),'subject':intUtil[_0xc3e5('0x16')](_0xd1ef16[_0xc3e5('0x17')],_0x55bece,'\x20'),'description':intUtil['getString'](_0xd1ef16['Descriptions'],_0x55bece,'\x0a'),'comment':{'public':![],'body':intUtil['getString'](_0xd1ef16[_0xc3e5('0x18')],_0x55bece,'\x0a')}},getCustomFields(_0xd1ef16['Fields'],_0x55bece))}})[_0xc3e5('0x19')](function(_0x3fb3ab){logger['info'](_0xc3e5('0x1a'));return _0x3fb3ab[_0xc3e5('0x1b')];});}function getUser(_0x2cc476,_0x1829f9){if(intUtil[_0xc3e5('0x1c')](_0x1829f9)){logger['info'](_0xc3e5('0x1d'),_0x1829f9);return request({'uri':util[_0xc3e5('0x10')](_0xc3e5('0x1e'),_0x2cc476[_0xc3e5('0x1f')]),'qs':{'query':util[_0xc3e5('0x10')](_0xc3e5('0x20'),_0x1829f9)}})['then'](function(_0x13d709){if(_0x13d709[_0xc3e5('0x21')]){logger['info'](_0xc3e5('0x22'));return _['find'](_0x13d709[_0xc3e5('0x23')],{'email':_0x1829f9,'role':_0xc3e5('0x24')});}else{logger[_0xc3e5('0xe')](_0xc3e5('0x25'));return request({'uri':util[_0xc3e5('0x10')]('%s/users/me.json',_0x2cc476[_0xc3e5('0x1f')])})[_0xc3e5('0x19')](function(_0x2d8c6f){logger[_0xc3e5('0xe')](_0xc3e5('0x26'));return _0x2d8c6f[_0xc3e5('0x27')];});}});}else{logger[_0xc3e5('0xe')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util[_0xc3e5('0x10')](_0xc3e5('0x28'),_0x2cc476[_0xc3e5('0x1f')])})[_0xc3e5('0x19')](function(_0x29c158){logger[_0xc3e5('0xe')](_0xc3e5('0x26'));return _0x29c158[_0xc3e5('0x27')];});}}function getEndUser(_0x564748,_0x25d3a3,_0x4c33d9){logger['info'](_0xc3e5('0x29'),_0x4c33d9);return request({'uri':util[_0xc3e5('0x10')](_0xc3e5('0x1e'),_0x564748['remoteUri']),'qs':{'query':util[_0xc3e5('0x10')](_0xc3e5('0x2a'),_0x4c33d9)}})[_0xc3e5('0x19')](function(_0x3ad580){var _0x591262;if(_0x3ad580[_0xc3e5('0x23')]['length']){_0x3ad580[_0xc3e5('0x23')]=_[_0xc3e5('0x2b')](_0x3ad580[_0xc3e5('0x23')],{'suspended':![],'role':'end-user'});if(_0x3ad580['results']['length']){_0x591262=_[_0xc3e5('0x2c')](_0x3ad580[_0xc3e5('0x23')]);}}if(_0x591262){logger[_0xc3e5('0xe')](_0xc3e5('0x2d'));return _0x591262;}else{logger[_0xc3e5('0xe')](_0xc3e5('0x2e'));return request({'uri':util['format'](_0xc3e5('0x2f'),_0x564748[_0xc3e5('0x1f')]),'method':_0xc3e5('0x12'),'body':{'user':{'role':_0xc3e5('0x30'),'name':util[_0xc3e5('0x10')](_0xc3e5('0x31'),_0x25d3a3||_0x4c33d9),'phone':_0x4c33d9}}})[_0xc3e5('0x19')](function(_0x133a46){logger[_0xc3e5('0xe')](_0xc3e5('0x32'));return _0x133a46[_0xc3e5('0x27')];});}});}function getAuth(_0x5d4297){var _0x3d7b87;if(_0x5d4297['authType']===_0xc3e5('0x33')){_0x3d7b87=util[_0xc3e5('0x10')](_0xc3e5('0x34'),_0x5d4297[_0xc3e5('0x35')],_0x5d4297['password']);}else if(_0x5d4297[_0xc3e5('0x36')]==='token'){_0x3d7b87=util['format'](_0xc3e5('0x37'),_0x5d4297['username'],_0x5d4297[_0xc3e5('0x38')]);}return util[_0xc3e5('0x10')](_0xc3e5('0x39'),new Buffer(_0x3d7b87)[_0xc3e5('0x3a')](_0xc3e5('0x3b')));}function request(_0x554b57){logger[_0xc3e5('0x3c')](_0xc3e5('0x3d'),JSON[_0xc3e5('0x3e')](_0x554b57));return rp(_[_0xc3e5('0x9')](_0x554b57,{'method':_0xc3e5('0x3f'),'headers':headers,'json':!![]}));}function getTags(_0x57a919,_0x3ab3be){var _0x484e21=[];if(_0x57a919&&_0x57a919[_0xc3e5('0x40')]>0x0){_0x484e21=_[_0xc3e5('0x41')](_0x57a919,_0x3ab3be);}return _0x484e21;}function getCustomFields(_0x4c9997,_0x30538f){var _0x565d93=[];var _0xd2b224={'custom_fields':[]};if(_0x4c9997[_0xc3e5('0x40')]>0x0){_[_0xc3e5('0x42')](_0x4c9997,function(_0x4a2c6b){if(_0x4a2c6b[_0xc3e5('0x43')]===_0xc3e5('0x44')&&_0x4a2c6b[_0xc3e5('0x45')]&&!_0x4a2c6b[_0xc3e5('0x46')]){_0xd2b224[_0x4a2c6b[_0xc3e5('0x45')]['toLowerCase']()]=_0x4a2c6b['content']['toString']();}else if(_0x4a2c6b[_0xc3e5('0x43')]===_0xc3e5('0x44')&&_0x4a2c6b['idField']&&_0x4a2c6b[_0xc3e5('0x46')]){_0xd2b224['custom_fields'][_0xc3e5('0x47')]({'id':_0x4a2c6b['idField'],'value':_0x4a2c6b[_0xc3e5('0x48')]['toString']()});}else if(_0x4a2c6b[_0xc3e5('0x43')]===_0xc3e5('0x49')&&_0x4a2c6b[_0xc3e5('0x4a')]&&_0x4a2c6b[_0xc3e5('0x4b')]&&_0x4a2c6b[_0xc3e5('0x46')]){_0x30538f[_0x4a2c6b[_0xc3e5('0x4a')]]&&_0xd2b224['custom_fields']['push']({'id':_0x4a2c6b[_0xc3e5('0x4b')],'value':_0x30538f[_0x4a2c6b['variableName']][_0xc3e5('0x3a')]()});}else if(_0x4a2c6b[_0xc3e5('0x43')]===_0xc3e5('0x4c')&&_0x4a2c6b[_0xc3e5('0x4d')]&&_0x4a2c6b[_0xc3e5('0x4d')][_0xc3e5('0x15')]&&_0x4a2c6b['idField']&&_0x4a2c6b[_0xc3e5('0x46')]){_0x30538f[_0x4a2c6b[_0xc3e5('0x4d')][_0xc3e5('0x15')][_0xc3e5('0x4e')]()]&&_0xd2b224[_0xc3e5('0x4f')][_0xc3e5('0x47')]({'id':_0x4a2c6b[_0xc3e5('0x4b')],'value':_0x30538f[_0x4a2c6b[_0xc3e5('0x4d')][_0xc3e5('0x15')][_0xc3e5('0x4e')]()]['toString']()});}});}return _0xd2b224;}exports['queue']=function(_0x5b5569,_0x3c7119,_0x5785e0,_0x2ca8cb,_0x48661e,_0x31587d){var _0x3b24c4,_0x49d5d9;_0x31587d[_0xc3e5('0x1f')]=intUtil[_0xc3e5('0x50')](_0x31587d[_0xc3e5('0x1f')]);_0x31587d[_0xc3e5('0x51')]=intUtil['stripTrailingSlash'](_0x31587d['serverUrl']);if(_0x48661e&&_0x48661e[_0xc3e5('0x52')]){logger[_0xc3e5('0xe')]('[QUEUE]',_0xc3e5('0x53'));_0x3c7119['recordingURL']=util[_0xc3e5('0x10')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x31587d[_0xc3e5('0x51')],_0x3c7119['uniqueid'],md5(_0x3c7119['uniqueid']));}else{_0x3c7119['recordingURL']='';}headers[_0xc3e5('0x54')]=getAuth(_0x31587d);return getUser(_0x31587d,_0x2ca8cb[_0xc3e5('0x55')])[_0xc3e5('0x19')](function(_0x5adc21){_0x3b24c4=_0x5adc21;logger['info'](_0xc3e5('0x56'),_0x3b24c4['id']);return getEndUser(_0x31587d,_0x3c7119['calleridname'],_0x3c7119[_0xc3e5('0x57')]);})[_0xc3e5('0x19')](function(_0x364297){_0x49d5d9=_0x364297;logger[_0xc3e5('0xe')](_0xc3e5('0x58'),_0x49d5d9['id']);return getTicket(_0x31587d,_0x3b24c4,_0x49d5d9,_0x5785e0,_0x3c7119);})[_0xc3e5('0x19')](function(_0x5cd31c){if(_0x5cd31c){logger[_0xc3e5('0xe')]('The\x20Ticket\x20ID\x20is:',_0x5cd31c['id']);switch(_0x31587d['type']){case _0xc3e5('0x59'):logger['info'](_0xc3e5('0x5a'),'Displaying\x20ticket\x20to\x20agent...');return request({'uri':util['format'](_0xc3e5('0x5b'),_0x31587d[_0xc3e5('0x1f')],_0x3b24c4['id'],_0x5cd31c['id']),'method':'POST'});case'newTab':logger[_0xc3e5('0xe')](_0xc3e5('0x5a'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0xc3e5('0x10')](_0xc3e5('0x5c'),_0x2ca8cb[_0xc3e5('0x15')]),_0xc3e5('0x5d'),{'uri':util[_0xc3e5('0x10')](_0xc3e5('0x5e'),_0x31587d[_0xc3e5('0x1f')],_0x5cd31c['id'])});break;default:logger['error'](_0xc3e5('0x5a'),_0xc3e5('0x5f'));}}})['catch'](function(_0x4b33e1){logger[_0xc3e5('0x60')](_0xc3e5('0x61'),util['inspect'](_0x4b33e1,{'showHidden':!![],'depth':null}));});};exports['outbound']=function(_0x566ed0,_0x4ada0d,_0x44152a,_0x232e57,_0x474891,_0x694a5d,_0x1cb207){var _0x4bb735,_0x14ad81;_0x694a5d[_0xc3e5('0x1f')]=intUtil[_0xc3e5('0x50')](_0x694a5d['remoteUri']);_0x694a5d[_0xc3e5('0x51')]=intUtil[_0xc3e5('0x50')](_0x694a5d[_0xc3e5('0x51')]);if(_0x1cb207&&_0x1cb207[_0xc3e5('0x62')]&&_0x1cb207[_0xc3e5('0x62')]!=='none'){logger['info'](_0xc3e5('0x63'),_0xc3e5('0x53'));_0x4ada0d['recordingURL']=util[_0xc3e5('0x10')](_0xc3e5('0x64'),_0x694a5d['serverUrl'],_0x4ada0d[_0xc3e5('0x65')],md5(_0x4ada0d[_0xc3e5('0x65')]));}headers[_0xc3e5('0x54')]=getAuth(_0x694a5d);return getUser(_0x694a5d,_0x232e57[_0xc3e5('0x55')])[_0xc3e5('0x19')](function(_0x3364d3){_0x4bb735=_0x3364d3;logger[_0xc3e5('0xe')](_0xc3e5('0x56'),_0x4bb735['id']);return getEndUser(_0x694a5d,_0x4ada0d['destcalleridname'],_0x4ada0d[_0xc3e5('0x66')]);})[_0xc3e5('0x19')](function(_0x3db9ac){_0x14ad81=_0x3db9ac;logger['info']('The\x20Enduser\x20ID\x20is:',_0x14ad81['id']);return getTicket(_0x694a5d,_0x4bb735,_0x14ad81,_0x44152a,_0x4ada0d);})[_0xc3e5('0x19')](function(_0x470b8d){if(_0x470b8d){logger[_0xc3e5('0xe')](_0xc3e5('0x67'),_0x470b8d['id']);switch(_0x694a5d[_0xc3e5('0x43')]){case _0xc3e5('0x59'):logger['info'](_0xc3e5('0x63'),'Displaying\x20ticket\x20to\x20agent...');return request({'uri':util[_0xc3e5('0x10')](_0xc3e5('0x5b'),_0x694a5d[_0xc3e5('0x1f')],_0x4bb735['id'],_0x470b8d['id']),'method':_0xc3e5('0x12')});case _0xc3e5('0x68'):logger[_0xc3e5('0xe')](_0xc3e5('0x63'),_0xc3e5('0x69'));emit(util[_0xc3e5('0x10')](_0xc3e5('0x5c'),_0x232e57['name']),'trigger:browser:url',{'uri':util[_0xc3e5('0x10')](_0xc3e5('0x5e'),_0x694a5d[_0xc3e5('0x1f')],_0x470b8d['id'])});break;default:logger[_0xc3e5('0x60')](_0xc3e5('0x63'),_0xc3e5('0x5f'));}}})[_0xc3e5('0x6a')](function(_0x95db72){logger[_0xc3e5('0x60')]('[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration',util['inspect'](_0x95db72,{'showHidden':!![],'depth':null}));});};exports[_0xc3e5('0x6b')]=function(_0x1a8d1c,_0x44bf4f,_0x2f480b,_0x58d33a,_0x2d184a,_0x182a6d){var _0x5ae5bf,_0x1cf94c;_0x182a6d[_0xc3e5('0x1f')]=intUtil[_0xc3e5('0x50')](_0x182a6d[_0xc3e5('0x1f')]);_0x182a6d['serverUrl']=intUtil[_0xc3e5('0x50')](_0x182a6d[_0xc3e5('0x51')]);if(_0x2d184a&&_0x2d184a['monitor_format']){logger[_0xc3e5('0xe')]('['+_0x44bf4f[_0xc3e5('0x6c')][_0xc3e5('0x6d')]()+']',_0xc3e5('0x53'));_0x44bf4f[_0xc3e5('0x6e')]=util[_0xc3e5('0x10')](_0xc3e5('0x64'),_0x182a6d[_0xc3e5('0x51')],_0x44bf4f[_0xc3e5('0x65')],md5(_0x44bf4f[_0xc3e5('0x65')]));}else{_0x44bf4f['recordingURL']='';}headers[_0xc3e5('0x54')]=getAuth(_0x182a6d);return getUser(_0x182a6d)[_0xc3e5('0x19')](function(_0x65c755){_0x5ae5bf=_0x65c755;logger[_0xc3e5('0xe')](_0xc3e5('0x56'),_0x5ae5bf['id']);return getEndUser(_0x182a6d,_0x44bf4f[_0xc3e5('0x6f')],_0x44bf4f[_0xc3e5('0x57')]);})['then'](function(_0xe68131){_0x1cf94c=_0xe68131;logger[_0xc3e5('0xe')](_0xc3e5('0x58'),_0x1cf94c['id']);return getTicket(_0x182a6d,_0x5ae5bf,_0x1cf94c,_0x2f480b,_0x44bf4f);})[_0xc3e5('0x19')](function(_0xca1b8a){if(_0xca1b8a){logger[_0xc3e5('0xe')](_0xc3e5('0x67'),_0xca1b8a['id']);}})[_0xc3e5('0x6a')](function(_0x5aa68c){logger['error']('['+_0x44bf4f[_0xc3e5('0x6c')][_0xc3e5('0x6d')]()+']'+_0xc3e5('0x70'),util[_0xc3e5('0x71')](_0x5aa68c,{'showHidden':!![],'depth':null}));});};
\ No newline at end of file
diff --git a/server/services/ami/trigger/integration/zoho.js b/server/services/ami/trigger/integration/zoho.js
index 6d63542..5c0eeb2 100644
--- a/server/services/ami/trigger/integration/zoho.js
+++ b/server/services/ami/trigger/integration/zoho.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x1af1=['calleridnum','lodash','request-promise','md5','util','./util','moment','ioredis','bluebird','../../../../config/environment','../../../../config/logger','redis','emit','debug','[HTTP]','length','forEach','type','string','idField','toString','variable','variableName','customVariable','Variable','name','toLowerCase','indexOf','split','isNil','access_token','isBefore','expires_in','zone','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.in','https://accounts.zoho.com.cn','https://accounts.zoho.eu','POST','clientSecret','refresh_token','then','add','seconds','catch','Failing\x20creating\x20the\x20access_token','stack','info','GET','format','https://www.zohoapis.%s/crm/v2/users','ActiveUsers','Zoho-oauthtoken\x20','isArrayLikeObject','users','findIndex','email','Agent\x20found!','Using\x20the\x20admin\x20account!','Administrator','error','The\x20failing\x20result\x20is','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','stringify','enduserType','startCase','moduleCreate','role','first_name','last_name','data','code','details','Error:\x20','log','CREATE\x20ERROR','moduleSearch','contact_lead','uri','https://www.zohoapis.','/crm/v2/Contacts/search?criteria=((Phone:equals:','Contacts','/crm/v2/Leads/search?criteria=((Phone:equals:','Leads','nothing','contact','lead','Creating\x20new\x20call...','Owner','profile','administrator','Subject','getString','Description','Descriptions','Full_Name','First_Name','Last_Name','What_Id','$se_module','Call_Duration','utc','talktime','mm:ss','answertime','endtime','YYYY-MM-DDTHH:mm:ss','diff','starttime','called','Called','complete','Call_Result','Answered','rejected','Rejected','Abandoned','Timeout','Call_Start_Time','agentcalledAt','Call_Type','Inbound','merge','/crm/v2/Calls','SUCCESS','Call\x20created!','err','host','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','uniqueid','/downloads?type=uniqueid&token=','zoho.eu','com','The\x20User\x20ID\x20is:','calleridname','The\x20Call\x20ID\x20is:','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','https://crm.','/crm/EntityInfo.do?module=Calls&id=','outbound','[OUTBOUND]','destcalleridname','trigger:browser:url','unmanaged','toUpperCase','/api/voice/recordings/'];(function(_0x320c61,_0x433cfe){var _0x228945=function(_0x152888){while(--_0x152888){_0x320c61['push'](_0x320c61['shift']());}};_0x228945(++_0x433cfe);}(_0x1af1,0x133));var _0x11af=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1af1[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x11af('0x0'));var rp=require(_0x11af('0x1'));var md5=require(_0x11af('0x2'));var util=require(_0x11af('0x3'));var intUtil=require(_0x11af('0x4'));var moment=require(_0x11af('0x5'));var Redis=require(_0x11af('0x6'));var BPromise=require(_0x11af('0x7'));var config=require(_0x11af('0x8'));var logger=require(_0x11af('0x9'))('zoho');config[_0x11af('0xa')]=_['defaults'](config[_0x11af('0xa')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x11af('0xa')]));function emit(_0x590e7d,_0x364f87,_0x4c8bf1){io['to'](_0x590e7d)[_0x11af('0xb')](_0x364f87,_0x4c8bf1);}function request(_0x23b31a){logger[_0x11af('0xc')](_0x11af('0xd'),JSON['stringify'](_0x23b31a));return rp(_0x23b31a);}function getCustomFields(_0x4214bd,_0x25f505){var _0x21f4f1={};if(_0x4214bd[_0x11af('0xe')]>0x0){_[_0x11af('0xf')](_0x4214bd,function(_0x2936ee){if(_0x2936ee[_0x11af('0x10')]===_0x11af('0x11')&&_0x2936ee[_0x11af('0x12')]){_0x21f4f1[_0x2936ee[_0x11af('0x12')]]=_0x2936ee['content'][_0x11af('0x13')]();}else if(_0x2936ee[_0x11af('0x10')]===_0x11af('0x14')&&_0x2936ee['variableName']&&_0x2936ee[_0x11af('0x12')]&&_0x25f505[_0x2936ee[_0x11af('0x15')]]){_0x21f4f1[_0x2936ee['idField']]=_0x25f505[_0x2936ee[_0x11af('0x15')]][_0x11af('0x13')]();}else if(_0x2936ee[_0x11af('0x10')]===_0x11af('0x16')&&_0x2936ee[_0x11af('0x17')]&&_0x2936ee[_0x11af('0x17')][_0x11af('0x18')]&&_0x2936ee[_0x11af('0x12')]&&_0x25f505[_0x2936ee[_0x11af('0x17')][_0x11af('0x18')][_0x11af('0x19')]()]){_0x21f4f1[_0x2936ee[_0x11af('0x12')]]=_0x25f505[_0x2936ee[_0x11af('0x17')][_0x11af('0x18')][_0x11af('0x19')]()][_0x11af('0x13')]();}});}return _0x21f4f1;}function getName(_0x66ef3f){if(_0x66ef3f[_0x11af('0x1a')]('\x20')>0x0){var _0x2a1de1=_0x66ef3f[_0x11af('0x1b')](/ (.+)/);if(_0x2a1de1[0x1]){return _0x2a1de1;}}return[_0x66ef3f,_0x66ef3f];}var accountsTokens={};function getAccessToken(_0x55940a){return new Promise(function(_0x33e92f,_0x2e2bf5){if(!_['isNil'](accountsTokens[_0x55940a['id']])&&!_[_0x11af('0x1c')](accountsTokens[_0x55940a['id']][_0x11af('0x1d')])){if(moment()[_0x11af('0x1e')](accountsTokens[_0x55940a['id']][_0x11af('0x1f')])){_0x33e92f(accountsTokens[_0x55940a['id']]['access_token']);}}var _0x2f7ac8;switch(_0x55940a[_0x11af('0x20')]){case'US':_0x2f7ac8=_0x11af('0x21');break;case'AU':_0x2f7ac8=_0x11af('0x22');break;case'EU':_0x2f7ac8='https://accounts.zoho.eu';break;case'IN':_0x2f7ac8=_0x11af('0x23');break;case'CN':_0x2f7ac8=_0x11af('0x24');break;default:_0x2f7ac8=_0x11af('0x25');break;}var _0x54fca2={'method':_0x11af('0x26'),'uri':_0x2f7ac8+'/oauth/v2/token','qs':{'refresh_token':_0x55940a['refreshToken'],'client_id':_0x55940a['clientId'],'client_secret':_0x55940a[_0x11af('0x27')],'grant_type':_0x11af('0x28')},'json':!![]};return rp(_0x54fca2)[_0x11af('0x29')](function(_0x3c1068){accountsTokens[_0x55940a['id']]={'access_token':_0x3c1068[_0x11af('0x1d')],'expires_in':moment()[_0x11af('0x2a')](_0x3c1068[_0x11af('0x1f')],_0x11af('0x2b'))};_0x33e92f(_0x3c1068[_0x11af('0x1d')]);})[_0x11af('0x2c')](function(_0x152751){logger['error'](_0x11af('0x2d'),_0x152751[_0x11af('0x2e')]);_0x2e2bf5(_0x152751);});});}function getUser(_0x31e05e,_0x11eafc,_0xfc1d23,_0x4bdc20){logger[_0x11af('0x2f')]('Search\x20user');return request({'method':_0x11af('0x30'),'uri':util[_0x11af('0x31')](_0x11af('0x32'),_0x11eafc),'qs':{'type':_0x11af('0x33')},'headers':{'Authorization':_0x11af('0x34')+_0x31e05e},'json':!![]})[_0x11af('0x29')](function(_0x190df4){if(_0x190df4['users']){var _0x3bfbae=-0x1;if(_[_0x11af('0x35')](_0x190df4[_0x11af('0x36')])){if(!_[_0x11af('0x1c')](_0x4bdc20)){_0x3bfbae=_[_0x11af('0x37')](_0x190df4['users'],function(_0x216947){return _0x216947[_0x11af('0x38')]===_0x4bdc20;});}if(_0x3bfbae>=0x0){logger['info'](_0x11af('0x39'));}else{logger['info'](_0x11af('0x3a'));_0x3bfbae=_[_0x11af('0x37')](_0x190df4[_0x11af('0x36')],function(_0x30d952){return _0x30d952['profile'][_0x11af('0x18')]===_0x11af('0x3b');});}return _0x190df4[_0x11af('0x36')][_0x3bfbae];}else{if(_0x190df4['user']['profile']['name']===_0x11af('0x3b')){logger[_0x11af('0x2f')]('Using\x20the\x20admin\x20account!');user=_0x190df4['user'];return user;}else{logger[_0x11af('0x3c')](_0x11af('0x3d'),JSON['stringify'](_0x190df4));throw new Error(_0x11af('0x3e')+JSON[_0x11af('0x3f')](_0x190df4));}}}else{logger[_0x11af('0x3c')](_0x11af('0x3d'),JSON['stringify'](_0x190df4));throw new Error(_0x11af('0x3e')+JSON[_0x11af('0x3f')](_0x190df4));}})[_0x11af('0x2c')](function(_0x1ff443){console['error'](_0x1ff443);});}function getZohoUser(_0x413858,_0x497633){return new BPromise(function(_0x22fb61,_0x5f07e6){request(_0x413858)[_0x11af('0x29')](function(_0x32fb5b){var _0x2f4c99=null;if(_0x32fb5b){_0x2f4c99=_0x32fb5b['data'][0x0];_0x2f4c99[_0x11af('0x40')]=_0x497633;}_0x22fb61(_0x2f4c99);})[_0x11af('0x2c')](function(_0x48329a){_0x5f07e6(_0x48329a);});});}function createEndUser(_0x479965,_0x2ae7d3,_0x5944b5,_0x4e89b7,_0x51318a,_0x3840d2){var _0x5944b5=getName(_0x5944b5);return request({'method':_0x11af('0x26'),'uri':'https://www.zohoapis.'+_0x2ae7d3+'/crm/v2/'+_[_0x11af('0x41')](_0x3840d2[_0x11af('0x42')])+'s','body':{'data':[{'Last_Name':_0x5944b5[0x1],'First_Name':_0x5944b5[0x0],'Phone':_0x4e89b7,'Owner':{'name':!_[_0x11af('0x1c')](_0x51318a[_0x11af('0x43')][_0x11af('0x18')])?_0x51318a[_0x11af('0x43')]['name']:!_[_0x11af('0x1c')](_0x51318a[_0x11af('0x44')])?_0x51318a[_0x11af('0x44')]+'\x20'+_0x51318a[_0x11af('0x45')]:_0x51318a[_0x11af('0x45')],'id':_0x51318a['id']}}]},'headers':{'Authorization':_0x11af('0x34')+_0x479965},'json':!![]})[_0x11af('0x29')](function(_0x436ac5){if(_0x436ac5&&_0x436ac5[_0x11af('0x46')][0x0][_0x11af('0x47')]==='SUCCESS'){var _0x5bf92e=_0x436ac5[_0x11af('0x46')][0x0][_0x11af('0x48')];_0x5bf92e['enduserType']=_['startCase'](_0x3840d2['moduleCreate'])+'s';return _0x5bf92e;}logger['error']('The\x20failing\x20result\x20is',JSON[_0x11af('0x3f')](data));throw new Error(_0x11af('0x49')+JSON['stringify'](data));})[_0x11af('0x2c')](function(_0x2742f0){console[_0x11af('0x4a')](_0x11af('0x4b'),_0x2742f0);});}function getEndUser(_0x544dc1,_0x3daf00,_0x2ec67e,_0x5ef2f4,_0x13bec0,_0x2fa899,_0x5abcb6){var _0x338003={'method':_0x11af('0x30'),'uri':'','headers':{'Authorization':_0x11af('0x34')+_0x544dc1},'json':!![]};switch(_0x5abcb6[_0x11af('0x4c')]){case _0x11af('0x4d'):_0x338003[_0x11af('0x4e')]=_0x11af('0x4f')+_0x3daf00+_0x11af('0x50')+_0x13bec0+'))';return getZohoUser(_0x338003,_0x11af('0x51'))[_0x11af('0x29')](function(_0x32c532){if(_0x32c532)return _0x32c532;_0x338003['uri']=_0x11af('0x4f')+_0x3daf00+_0x11af('0x52')+_0x13bec0+'))';return getZohoUser(_0x338003,_0x11af('0x53'))[_0x11af('0x29')](function(_0x4818b5){if(_0x4818b5)return _0x4818b5;if(_0x5abcb6[_0x11af('0x42')]!=_0x11af('0x54')){return createEndUser(_0x544dc1,_0x3daf00,_0x5ef2f4,_0x13bec0,_0x2fa899,_0x5abcb6);}else{return{};}});});break;case _0x11af('0x55'):_0x338003[_0x11af('0x4e')]=_0x11af('0x4f')+_0x3daf00+_0x11af('0x50')+_0x13bec0+'))';return getZohoUser(_0x338003,'Contacts')[_0x11af('0x29')](function(_0x4c52de){if(_0x4c52de)return _0x4c52de;if(_0x5abcb6['moduleCreate']!=_0x11af('0x54')){return createEndUser(_0x544dc1,_0x3daf00,_0x5ef2f4,_0x13bec0,_0x2fa899,_0x5abcb6);}else{return{};}});break;case _0x11af('0x56'):_0x338003[_0x11af('0x4e')]=_0x11af('0x4f')+_0x3daf00+_0x11af('0x52')+_0x13bec0+'))';return getZohoUser(_0x338003,'Leads')['then'](function(_0x33dba3){if(_0x33dba3)return _0x33dba3;if(_0x5abcb6[_0x11af('0x42')]!=_0x11af('0x54')){return createEndUser(_0x544dc1,_0x3daf00,_0x5ef2f4,_0x13bec0,_0x2fa899,_0x5abcb6);}else{return{};}});break;}}function getCall(_0x516516,_0x11ab76,_0x149aa3,_0x4350cf,_0xf55813,_0x2120b4,_0x43d774,_0x2fe470){logger['info'](_0x11af('0x57'));var _0x4dd2e7={};_0x4dd2e7[_0x11af('0x58')]={'name':!_[_0x11af('0x1c')](_0x4350cf[_0x11af('0x43')][_0x11af('0x18')])&&!_[_0x11af('0x1c')](_0x4350cf[_0x11af('0x59')][_0x11af('0x18')])&&_0x4350cf['profile'][_0x11af('0x18')]===_0x11af('0x5a')?_0x4350cf[_0x11af('0x43')][_0x11af('0x18')]:!_[_0x11af('0x1c')](_0x4350cf[_0x11af('0x44')])?_0x4350cf['first_name']+'\x20'+_0x4350cf[_0x11af('0x45')]:_0x4350cf[_0x11af('0x45')],'id':_0x4350cf['id']};_0x4dd2e7[_0x11af('0x5b')]=intUtil[_0x11af('0x5c')](_0x2120b4['Subjects'],_0x43d774,'\x20');_0x4dd2e7[_0x11af('0x5d')]=intUtil['getString'](_0x2120b4[_0x11af('0x5e')],_0x43d774,'\x0a');if(_0xf55813[_0x11af('0x40')]===_0x11af('0x51')){_0x4dd2e7['Who_Id']={'name':!_[_0x11af('0x1c')](_0xf55813[_0x11af('0x5f')])?_0xf55813[_0x11af('0x5f')]:!_[_0x11af('0x1c')](_0xf55813[_0x11af('0x60')])?_0xf55813[_0x11af('0x60')]+'\x20'+_0xf55813[_0x11af('0x61')]:_0xf55813[_0x11af('0x61')],'id':_0xf55813['id']};}if(_0xf55813[_0x11af('0x40')]===_0x11af('0x53')){_0x4dd2e7[_0x11af('0x62')]={'name':!_['isNil'](_0xf55813[_0x11af('0x5f')])?_0xf55813[_0x11af('0x5f')]:!_['isNil'](_0xf55813[_0x11af('0x60')])?_0xf55813[_0x11af('0x60')]+'\x20'+_0xf55813[_0x11af('0x61')]:_0xf55813[_0x11af('0x61')],'id':_0xf55813['id']};_0x4dd2e7[_0x11af('0x63')]=_[_0x11af('0x41')](_0xf55813[_0x11af('0x40')]);}if(_0x43d774['talktime']){_0x4dd2e7[_0x11af('0x64')]=moment[_0x11af('0x65')](parseInt(_0x43d774[_0x11af('0x66')])*0x3e8)[_0x11af('0x31')](_0x11af('0x67'));}else if(_0x43d774[_0x11af('0x68')]&&_0x43d774['endtime']){_0x4dd2e7[_0x11af('0x64')]=moment[_0x11af('0x65')](moment(_0x43d774[_0x11af('0x69')],_0x11af('0x6a'))[_0x11af('0x6b')](moment(_0x43d774[_0x11af('0x6c')],_0x11af('0x6a'))))[_0x11af('0x31')](_0x11af('0x67'));}switch(_0x43d774['lastevent']){case _0x11af('0x6d'):_0x4dd2e7['Call_Result']=_0x11af('0x6e');break;case _0x11af('0x6f'):case'connect':_0x4dd2e7[_0x11af('0x70')]=_0x11af('0x71');break;case _0x11af('0x72'):_0x4dd2e7[_0x11af('0x70')]=_0x11af('0x73');break;case'abandoned':_0x4dd2e7[_0x11af('0x70')]=_0x11af('0x74');break;case'timeout':_0x4dd2e7['Call_Result']=_0x11af('0x75');default:}_0x4dd2e7[_0x11af('0x76')]=(_0x2fe470==='outbound'?moment(_0x43d774[_0x11af('0x6c')])['format'](_0x11af('0x6a')):moment(_0x43d774[_0x11af('0x77')])[_0x11af('0x31')](_0x11af('0x6a')))||moment()[_0x11af('0x31')]('YYYY-MM-DDTHH:mm:ss');_0x4dd2e7[_0x11af('0x78')]=_0x2fe470||_0x11af('0x79');_0x4dd2e7=_[_0x11af('0x7a')](_0x4dd2e7,getCustomFields(_0x2120b4['Fields'],_0x43d774));return request({'method':_0x11af('0x26'),'uri':'https://www.zohoapis.'+_0x11ab76+_0x11af('0x7b'),'headers':{'Authorization':_0x11af('0x34')+_0x516516},'body':{'data':[_0x4dd2e7]},'json':!![]})[_0x11af('0x29')](function(_0xa050f7){if(_0xa050f7&&_0xa050f7[_0x11af('0x46')][0x0][_0x11af('0x47')]===_0x11af('0x7c')){logger[_0x11af('0x2f')](_0x11af('0x7d'));return{'id':_0xa050f7[_0x11af('0x46')][0x0][_0x11af('0x48')]['id']};}})[_0x11af('0x2c')](function(_0x5ced8a){logger['info'](_0x11af('0x7e'),_0x5ced8a[_0x11af('0x2e')]);console[_0x11af('0x4a')](_0x11af('0x7e'),_0x5ced8a);});}exports['queue']=function(_0x1a7cf6,_0x4eac0f,_0x1a8783,_0x402966,_0x1c83c1,_0x3783e9){var _0x40510d,_0x580d0e,_0x4c1c68;_0x3783e9[_0x11af('0x7f')]=intUtil[_0x11af('0x80')](_0x3783e9[_0x11af('0x7f')]);_0x3783e9['serverUrl']=intUtil[_0x11af('0x80')](_0x3783e9[_0x11af('0x81')]);if(_0x1c83c1&&_0x1c83c1[_0x11af('0x82')]){logger[_0x11af('0x2f')](_0x11af('0x83'),_0x11af('0x84'));_0x4eac0f[_0x11af('0x85')]=_0x3783e9[_0x11af('0x81')]+'/api/voice/recordings/'+_0x4eac0f[_0x11af('0x86')]+_0x11af('0x87')+md5(_0x4eac0f[_0x11af('0x86')]);}else{_0x4eac0f[_0x11af('0x85')]='';}var _0x4c2b17=_0x3783e9[_0x11af('0x7f')]===_0x11af('0x88')?'eu':_0x11af('0x89');return getAccessToken(_0x3783e9)[_0x11af('0x29')](function(_0x355e26){_0x4c1c68=_0x355e26;return getUser(_0x4c1c68,_0x4c2b17,_0x3783e9,_0x402966['email']);})[_0x11af('0x29')](function(_0x3941f1){_0x40510d=_0x3941f1;logger[_0x11af('0x2f')](_0x11af('0x8a'),_0x40510d['id']);return getEndUser(_0x4c1c68,_0x4c2b17,_0x3783e9,_0x4eac0f[_0x11af('0x8b')],_0x4eac0f['calleridnum'],_0x40510d,_0x1a8783);})['then'](function(_0xcda3a0){_0x580d0e=_0xcda3a0;return getCall(_0x4c1c68,_0x4c2b17,_0x3783e9,_0x40510d,_0x580d0e,_0x1a8783,_0x4eac0f,'Inbound');})[_0x11af('0x29')](function(_0x886887){if(_0x886887){logger[_0x11af('0x2f')](_0x11af('0x8c'),_0x886887['id']);logger[_0x11af('0x2f')](_0x11af('0x83'),_0x11af('0x8d'));emit(util[_0x11af('0x31')](_0x11af('0x8e'),_0x402966['name']),'trigger:browser:url',{'uri':_0x11af('0x8f')+_0x3783e9['host']+_0x11af('0x90')+_0x886887['id']});}})[_0x11af('0x2c')](function(_0x5a3520){logger[_0x11af('0x3c')](_0x11af('0x83'),JSON[_0x11af('0x3f')](_0x5a3520));});};exports[_0x11af('0x91')]=function(_0x402932,_0x5673b8,_0x1fc58a,_0x32fc04,_0x352abc,_0x244d1e,_0x2d8dc4){var _0x55af4d,_0x3537e3,_0x444add;_0x244d1e[_0x11af('0x7f')]=intUtil[_0x11af('0x80')](_0x244d1e[_0x11af('0x7f')]);_0x244d1e[_0x11af('0x81')]=intUtil[_0x11af('0x80')](_0x244d1e['serverUrl']);if(_0x2d8dc4&&_0x2d8dc4['recordingFormat']&&_0x2d8dc4['recordingFormat']!=='none'){logger['info'](_0x11af('0x92'),_0x11af('0x84'));_0x5673b8[_0x11af('0x85')]=_0x244d1e[_0x11af('0x81')]+'/api/voice/recordings/'+_0x5673b8[_0x11af('0x86')]+'/downloads?type=uniqueid&token='+md5(_0x5673b8[_0x11af('0x86')]);}var _0x48f785=_0x244d1e[_0x11af('0x7f')]===_0x11af('0x88')?'eu':_0x11af('0x89');return getAccessToken(_0x244d1e)[_0x11af('0x29')](function(_0xfa6c59){_0x444add=_0xfa6c59;return getUser(_0x444add,_0x48f785,_0x244d1e,_0x32fc04['email']);})['then'](function(_0x2407a0){_0x55af4d=_0x2407a0;logger[_0x11af('0x2f')]('The\x20User\x20ID\x20is:',_0x55af4d['id']);return getEndUser(_0x444add,_0x48f785,_0x244d1e,_0x5673b8[_0x11af('0x93')],_0x5673b8['destcalleridnum'],_0x55af4d,_0x1fc58a);})[_0x11af('0x29')](function(_0xd10eda){_0x3537e3=_0xd10eda;return getCall(_0x444add,_0x48f785,_0x244d1e,_0x55af4d,_0x3537e3,_0x1fc58a,_0x5673b8,'Outbound');})[_0x11af('0x29')](function(_0x69b87a){if(_0x69b87a){logger[_0x11af('0x2f')](_0x11af('0x8c'),_0x69b87a['id']);logger[_0x11af('0x2f')](_0x11af('0x92'),'Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util['format'](_0x11af('0x8e'),_0x32fc04[_0x11af('0x18')]),_0x11af('0x94'),{'uri':_0x11af('0x8f')+_0x244d1e['host']+_0x11af('0x90')+_0x69b87a['id']});}})[_0x11af('0x2c')](function(_0x3dcea0){logger[_0x11af('0x3c')](_0x11af('0x92'),JSON[_0x11af('0x3f')](_0x3dcea0));});};exports[_0x11af('0x95')]=function(_0x1a802e,_0x2f3dd9,_0x423cbf,_0x5e672f,_0x4821b1,_0x4e20b0){var _0x55ebaf,_0x19ef1b,_0x2cc012;_0x4e20b0['host']=intUtil[_0x11af('0x80')](_0x4e20b0['host']);_0x4e20b0[_0x11af('0x81')]=intUtil[_0x11af('0x80')](_0x4e20b0[_0x11af('0x81')]);if(_0x4821b1&&_0x4821b1[_0x11af('0x82')]){logger['info']('['+_0x2f3dd9['lastevent'][_0x11af('0x96')]()+']','Recording\x20is\x20enabled!');_0x2f3dd9[_0x11af('0x85')]=_0x4e20b0[_0x11af('0x81')]+_0x11af('0x97')+_0x2f3dd9[_0x11af('0x86')]+_0x11af('0x87')+md5(_0x2f3dd9['uniqueid']);}else{_0x2f3dd9[_0x11af('0x85')]='';}var _0x3892f4=_0x4e20b0[_0x11af('0x7f')]===_0x11af('0x88')?'eu':_0x11af('0x89');return getAccessToken(_0x4e20b0)[_0x11af('0x29')](function(_0x45c005){_0x2cc012=_0x45c005;return getUser(_0x2cc012,_0x3892f4,_0x4e20b0);})['then'](function(_0x69065b){_0x55ebaf=_0x69065b;logger[_0x11af('0x2f')]('The\x20User\x20ID\x20is:',_0x55ebaf['id']);return getEndUser(_0x2cc012,_0x3892f4,_0x4e20b0,_0x2f3dd9[_0x11af('0x8b')],_0x2f3dd9[_0x11af('0x98')],_0x55ebaf,_0x423cbf);})[_0x11af('0x29')](function(_0x20f841){_0x19ef1b=_0x20f841;return getCall(_0x2cc012,_0x3892f4,_0x4e20b0,_0x55ebaf,_0x19ef1b,_0x423cbf,_0x2f3dd9,_0x11af('0x79'));})[_0x11af('0x29')](function(_0x513a2e){if(_0x513a2e){logger[_0x11af('0x2f')]('The\x20Call\x20ID\x20is:',_0x513a2e['id']);}})[_0x11af('0x2c')](function(_0x4b0254){logger[_0x11af('0x3c')]('['+_0x2f3dd9['lastevent'][_0x11af('0x96')]()+']',JSON[_0x11af('0x3f')](_0x4b0254));});};
\ No newline at end of file
+var _0xf793=['Variable','name','toLowerCase','split','isNil','isBefore','expires_in','zone','https://accounts.zoho.com.au','https://accounts.zoho.eu','https://accounts.zoho.com.cn','POST','/oauth/v2/token','clientSecret','refresh_token','access_token','add','seconds','catch','error','stack','GET','format','https://www.zohoapis.%s/crm/v2/users','ActiveUsers','Zoho-oauthtoken\x20','then','users','isArrayLikeObject','findIndex','email','info','Agent\x20found!','Using\x20the\x20admin\x20account!','Administrator','profile','user','The\x20failing\x20result\x20is','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','enduserType','https://www.zohoapis.','/crm/v2/','role','last_name','data','code','SUCCESS','startCase','log','CREATE\x20ERROR','moduleSearch','uri','/crm/v2/Contacts/search?criteria=((Phone:equals:','Contacts','Leads','moduleCreate','nothing','contact','lead','/crm/v2/Leads/search?criteria=((Phone:equals:','Owner','administrator','first_name','Subject','getString','Subjects','Description','Descriptions','Who_Id','Full_Name','First_Name','Last_Name','What_Id','talktime','utc','endtime','Call_Duration','YYYY-MM-DDTHH:mm:ss','starttime','mm:ss','lastevent','called','Call_Result','Called','connect','Answered','rejected','Rejected','abandoned','Abandoned','timeout','Timeout','Call_Start_Time','outbound','agentcalledAt','Call_Type','Inbound','Fields','/crm/v2/Calls','Call\x20created!','details','err','host','stripTrailingSlash','serverUrl','monitor_format','Recording\x20is\x20enabled!','/downloads?type=uniqueid&token=','uniqueid','com','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Call\x20ID\x20is:','[QUEUE]','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','https://crm.','none','[OUTBOUND]','recordingURL','/api/voice/recordings/','destcalleridname','Outbound','/crm/EntityInfo.do?module=Calls&id=','unmanaged','toUpperCase','zoho.eu','request-promise','./util','moment','ioredis','bluebird','../../../../config/environment','../../../../config/logger','zoho','redis','defaults','emit','debug','[HTTP]','stringify','length','forEach','type','idField','content','toString','variable','variableName'];(function(_0x2e6d36,_0xd9726e){var _0x1612f4=function(_0x2cad69){while(--_0x2cad69){_0x2e6d36['push'](_0x2e6d36['shift']());}};_0x1612f4(++_0xd9726e);}(_0xf793,0x1ac));var _0x3f79=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xf793[_0x321bb2];return _0x9c12ed;};'use strict';var _=require('lodash');var rp=require(_0x3f79('0x0'));var md5=require('md5');var util=require('util');var intUtil=require(_0x3f79('0x1'));var moment=require(_0x3f79('0x2'));var Redis=require(_0x3f79('0x3'));var BPromise=require(_0x3f79('0x4'));var config=require(_0x3f79('0x5'));var logger=require(_0x3f79('0x6'))(_0x3f79('0x7'));config[_0x3f79('0x8')]=_[_0x3f79('0x9')](config[_0x3f79('0x8')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function emit(_0x5f4ddc,_0x5d64d8,_0x244e6d){io['to'](_0x5f4ddc)[_0x3f79('0xa')](_0x5d64d8,_0x244e6d);}function request(_0x1bbf9f){logger[_0x3f79('0xb')](_0x3f79('0xc'),JSON[_0x3f79('0xd')](_0x1bbf9f));return rp(_0x1bbf9f);}function getCustomFields(_0xf97932,_0x2f0c1f){var _0x1fb280={};if(_0xf97932[_0x3f79('0xe')]>0x0){_[_0x3f79('0xf')](_0xf97932,function(_0x520c87){if(_0x520c87[_0x3f79('0x10')]==='string'&&_0x520c87[_0x3f79('0x11')]){_0x1fb280[_0x520c87[_0x3f79('0x11')]]=_0x520c87[_0x3f79('0x12')][_0x3f79('0x13')]();}else if(_0x520c87[_0x3f79('0x10')]===_0x3f79('0x14')&&_0x520c87[_0x3f79('0x15')]&&_0x520c87['idField']&&_0x2f0c1f[_0x520c87[_0x3f79('0x15')]]){_0x1fb280[_0x520c87[_0x3f79('0x11')]]=_0x2f0c1f[_0x520c87['variableName']]['toString']();}else if(_0x520c87[_0x3f79('0x10')]==='customVariable'&&_0x520c87[_0x3f79('0x16')]&&_0x520c87[_0x3f79('0x16')][_0x3f79('0x17')]&&_0x520c87['idField']&&_0x2f0c1f[_0x520c87[_0x3f79('0x16')]['name'][_0x3f79('0x18')]()]){_0x1fb280[_0x520c87[_0x3f79('0x11')]]=_0x2f0c1f[_0x520c87['Variable'][_0x3f79('0x17')]['toLowerCase']()]['toString']();}});}return _0x1fb280;}function getName(_0xa19ada){if(_0xa19ada['indexOf']('\x20')>0x0){var _0x337766=_0xa19ada[_0x3f79('0x19')](/ (.+)/);if(_0x337766[0x1]){return _0x337766;}}return[_0xa19ada,_0xa19ada];}var accountsTokens={};function getAccessToken(_0x1c9ccf){return new Promise(function(_0xf26e0e,_0x2f421c){if(!_['isNil'](accountsTokens[_0x1c9ccf['id']])&&!_[_0x3f79('0x1a')](accountsTokens[_0x1c9ccf['id']]['access_token'])){if(moment()[_0x3f79('0x1b')](accountsTokens[_0x1c9ccf['id']][_0x3f79('0x1c')])){_0xf26e0e(accountsTokens[_0x1c9ccf['id']]['access_token']);}}var _0x2cd3f4;switch(_0x1c9ccf[_0x3f79('0x1d')]){case'US':_0x2cd3f4='https://accounts.zoho.com';break;case'AU':_0x2cd3f4=_0x3f79('0x1e');break;case'EU':_0x2cd3f4=_0x3f79('0x1f');break;case'IN':_0x2cd3f4='https://accounts.zoho.in';break;case'CN':_0x2cd3f4=_0x3f79('0x20');break;default:_0x2cd3f4=_0x3f79('0x1f');break;}var _0x276f98={'method':_0x3f79('0x21'),'uri':_0x2cd3f4+_0x3f79('0x22'),'qs':{'refresh_token':_0x1c9ccf['refreshToken'],'client_id':_0x1c9ccf['clientId'],'client_secret':_0x1c9ccf[_0x3f79('0x23')],'grant_type':_0x3f79('0x24')},'json':!![]};return rp(_0x276f98)['then'](function(_0x170417){accountsTokens[_0x1c9ccf['id']]={'access_token':_0x170417[_0x3f79('0x25')],'expires_in':moment()[_0x3f79('0x26')](_0x170417[_0x3f79('0x1c')],_0x3f79('0x27'))};_0xf26e0e(_0x170417[_0x3f79('0x25')]);})[_0x3f79('0x28')](function(_0x9e561d){logger[_0x3f79('0x29')]('Failing\x20creating\x20the\x20access_token',_0x9e561d[_0x3f79('0x2a')]);_0x2f421c(_0x9e561d);});});}function getUser(_0x230988,_0x20db03,_0xd47ba0,_0x39b9ad){logger['info']('Search\x20user');return request({'method':_0x3f79('0x2b'),'uri':util[_0x3f79('0x2c')](_0x3f79('0x2d'),_0x20db03),'qs':{'type':_0x3f79('0x2e')},'headers':{'Authorization':_0x3f79('0x2f')+_0x230988},'json':!![]})[_0x3f79('0x30')](function(_0x1570da){if(_0x1570da[_0x3f79('0x31')]){var _0x4d5cfc=-0x1;if(_[_0x3f79('0x32')](_0x1570da[_0x3f79('0x31')])){if(!_[_0x3f79('0x1a')](_0x39b9ad)){_0x4d5cfc=_[_0x3f79('0x33')](_0x1570da[_0x3f79('0x31')],function(_0x592870){return _0x592870[_0x3f79('0x34')]===_0x39b9ad;});}if(_0x4d5cfc>=0x0){logger[_0x3f79('0x35')](_0x3f79('0x36'));}else{logger[_0x3f79('0x35')](_0x3f79('0x37'));_0x4d5cfc=_['findIndex'](_0x1570da[_0x3f79('0x31')],function(_0x33248c){return _0x33248c['profile'][_0x3f79('0x17')]===_0x3f79('0x38');});}return _0x1570da[_0x3f79('0x31')][_0x4d5cfc];}else{if(_0x1570da['user'][_0x3f79('0x39')]['name']===_0x3f79('0x38')){logger['info'](_0x3f79('0x37'));user=_0x1570da[_0x3f79('0x3a')];return user;}else{logger[_0x3f79('0x29')](_0x3f79('0x3b'),JSON[_0x3f79('0xd')](_0x1570da));throw new Error('Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20'+JSON[_0x3f79('0xd')](_0x1570da));}}}else{logger[_0x3f79('0x29')](_0x3f79('0x3b'),JSON[_0x3f79('0xd')](_0x1570da));throw new Error(_0x3f79('0x3c')+JSON[_0x3f79('0xd')](_0x1570da));}})['catch'](function(_0x174ebb){console[_0x3f79('0x29')](_0x174ebb);});}function getZohoUser(_0x5f35c4,_0x561c81){return new BPromise(function(_0x1e71df,_0xb56ce9){request(_0x5f35c4)[_0x3f79('0x30')](function(_0x4d70a8){var _0x56d36b=null;if(_0x4d70a8){_0x56d36b=_0x4d70a8['data'][0x0];_0x56d36b[_0x3f79('0x3d')]=_0x561c81;}_0x1e71df(_0x56d36b);})[_0x3f79('0x28')](function(_0x4af77e){_0xb56ce9(_0x4af77e);});});}function createEndUser(_0xe9a580,_0x16739d,_0x352f6d,_0x398cf8,_0x3c9296,_0x3a8a5b){var _0x352f6d=getName(_0x352f6d);return request({'method':_0x3f79('0x21'),'uri':_0x3f79('0x3e')+_0x16739d+_0x3f79('0x3f')+_['startCase'](_0x3a8a5b['moduleCreate'])+'s','body':{'data':[{'Last_Name':_0x352f6d[0x1],'First_Name':_0x352f6d[0x0],'Phone':_0x398cf8,'Owner':{'name':!_[_0x3f79('0x1a')](_0x3c9296[_0x3f79('0x40')][_0x3f79('0x17')])?_0x3c9296['role'][_0x3f79('0x17')]:!_[_0x3f79('0x1a')](_0x3c9296['first_name'])?_0x3c9296['first_name']+'\x20'+_0x3c9296[_0x3f79('0x41')]:_0x3c9296['last_name'],'id':_0x3c9296['id']}}]},'headers':{'Authorization':_0x3f79('0x2f')+_0xe9a580},'json':!![]})[_0x3f79('0x30')](function(_0x1fdd15){if(_0x1fdd15&&_0x1fdd15[_0x3f79('0x42')][0x0][_0x3f79('0x43')]===_0x3f79('0x44')){var _0x1a4f60=_0x1fdd15[_0x3f79('0x42')][0x0]['details'];_0x1a4f60[_0x3f79('0x3d')]=_[_0x3f79('0x45')](_0x3a8a5b['moduleCreate'])+'s';return _0x1a4f60;}logger['error']('The\x20failing\x20result\x20is',JSON['stringify'](data));throw new Error('Error:\x20'+JSON[_0x3f79('0xd')](data));})[_0x3f79('0x28')](function(_0x2aa3b6){console[_0x3f79('0x46')](_0x3f79('0x47'),_0x2aa3b6);});}function getEndUser(_0x29ae44,_0x1f4c6b,_0x2031a0,_0x124711,_0xc8338f,_0x3b760c,_0x2972b1){var _0x3d08b0={'method':_0x3f79('0x2b'),'uri':'','headers':{'Authorization':_0x3f79('0x2f')+_0x29ae44},'json':!![]};switch(_0x2972b1[_0x3f79('0x48')]){case'contact_lead':_0x3d08b0[_0x3f79('0x49')]=_0x3f79('0x3e')+_0x1f4c6b+_0x3f79('0x4a')+_0xc8338f+'))';return getZohoUser(_0x3d08b0,_0x3f79('0x4b'))[_0x3f79('0x30')](function(_0x2a48a2){if(_0x2a48a2)return _0x2a48a2;_0x3d08b0[_0x3f79('0x49')]=_0x3f79('0x3e')+_0x1f4c6b+'/crm/v2/Leads/search?criteria=((Phone:equals:'+_0xc8338f+'))';return getZohoUser(_0x3d08b0,_0x3f79('0x4c'))['then'](function(_0x6db9ae){if(_0x6db9ae)return _0x6db9ae;if(_0x2972b1[_0x3f79('0x4d')]!=_0x3f79('0x4e')){return createEndUser(_0x29ae44,_0x1f4c6b,_0x124711,_0xc8338f,_0x3b760c,_0x2972b1);}else{return{};}});});break;case _0x3f79('0x4f'):_0x3d08b0[_0x3f79('0x49')]=_0x3f79('0x3e')+_0x1f4c6b+_0x3f79('0x4a')+_0xc8338f+'))';return getZohoUser(_0x3d08b0,_0x3f79('0x4b'))[_0x3f79('0x30')](function(_0x4c7695){if(_0x4c7695)return _0x4c7695;if(_0x2972b1[_0x3f79('0x4d')]!='nothing'){return createEndUser(_0x29ae44,_0x1f4c6b,_0x124711,_0xc8338f,_0x3b760c,_0x2972b1);}else{return{};}});break;case _0x3f79('0x50'):_0x3d08b0[_0x3f79('0x49')]=_0x3f79('0x3e')+_0x1f4c6b+_0x3f79('0x51')+_0xc8338f+'))';return getZohoUser(_0x3d08b0,_0x3f79('0x4c'))[_0x3f79('0x30')](function(_0x140d01){if(_0x140d01)return _0x140d01;if(_0x2972b1[_0x3f79('0x4d')]!=_0x3f79('0x4e')){return createEndUser(_0x29ae44,_0x1f4c6b,_0x124711,_0xc8338f,_0x3b760c,_0x2972b1);}else{return{};}});break;}}function getCall(_0x4169a3,_0x472666,_0xd280ab,_0x52e36e,_0x160586,_0x34d2d8,_0x168e96,_0x380d50){logger[_0x3f79('0x35')]('Creating\x20new\x20call...');var _0x10e323={};_0x10e323[_0x3f79('0x52')]={'name':!_[_0x3f79('0x1a')](_0x52e36e[_0x3f79('0x40')][_0x3f79('0x17')])&&!_[_0x3f79('0x1a')](_0x52e36e[_0x3f79('0x39')]['name'])&&_0x52e36e[_0x3f79('0x39')]['name']===_0x3f79('0x53')?_0x52e36e[_0x3f79('0x40')][_0x3f79('0x17')]:!_[_0x3f79('0x1a')](_0x52e36e['first_name'])?_0x52e36e[_0x3f79('0x54')]+'\x20'+_0x52e36e[_0x3f79('0x41')]:_0x52e36e['last_name'],'id':_0x52e36e['id']};_0x10e323[_0x3f79('0x55')]=intUtil[_0x3f79('0x56')](_0x34d2d8[_0x3f79('0x57')],_0x168e96,'\x20');_0x10e323[_0x3f79('0x58')]=intUtil['getString'](_0x34d2d8[_0x3f79('0x59')],_0x168e96,'\x0a');if(_0x160586['enduserType']==='Contacts'){_0x10e323[_0x3f79('0x5a')]={'name':!_[_0x3f79('0x1a')](_0x160586[_0x3f79('0x5b')])?_0x160586[_0x3f79('0x5b')]:!_[_0x3f79('0x1a')](_0x160586[_0x3f79('0x5c')])?_0x160586[_0x3f79('0x5c')]+'\x20'+_0x160586['Last_Name']:_0x160586[_0x3f79('0x5d')],'id':_0x160586['id']};}if(_0x160586[_0x3f79('0x3d')]===_0x3f79('0x4c')){_0x10e323[_0x3f79('0x5e')]={'name':!_[_0x3f79('0x1a')](_0x160586[_0x3f79('0x5b')])?_0x160586[_0x3f79('0x5b')]:!_[_0x3f79('0x1a')](_0x160586['First_Name'])?_0x160586[_0x3f79('0x5c')]+'\x20'+_0x160586[_0x3f79('0x5d')]:_0x160586[_0x3f79('0x5d')],'id':_0x160586['id']};_0x10e323['$se_module']=_[_0x3f79('0x45')](_0x160586['enduserType']);}if(_0x168e96[_0x3f79('0x5f')]){_0x10e323['Call_Duration']=moment[_0x3f79('0x60')](parseInt(_0x168e96['talktime'])*0x3e8)[_0x3f79('0x2c')]('mm:ss');}else if(_0x168e96['answertime']&&_0x168e96[_0x3f79('0x61')]){_0x10e323[_0x3f79('0x62')]=moment[_0x3f79('0x60')](moment(_0x168e96['endtime'],_0x3f79('0x63'))['diff'](moment(_0x168e96[_0x3f79('0x64')],'YYYY-MM-DDTHH:mm:ss')))[_0x3f79('0x2c')](_0x3f79('0x65'));}switch(_0x168e96[_0x3f79('0x66')]){case _0x3f79('0x67'):_0x10e323[_0x3f79('0x68')]=_0x3f79('0x69');break;case'complete':case _0x3f79('0x6a'):_0x10e323[_0x3f79('0x68')]=_0x3f79('0x6b');break;case _0x3f79('0x6c'):_0x10e323[_0x3f79('0x68')]=_0x3f79('0x6d');break;case _0x3f79('0x6e'):_0x10e323[_0x3f79('0x68')]=_0x3f79('0x6f');break;case _0x3f79('0x70'):_0x10e323[_0x3f79('0x68')]=_0x3f79('0x71');default:}_0x10e323[_0x3f79('0x72')]=(_0x380d50===_0x3f79('0x73')?moment(_0x168e96[_0x3f79('0x64')])[_0x3f79('0x2c')](_0x3f79('0x63')):moment(_0x168e96[_0x3f79('0x74')])[_0x3f79('0x2c')](_0x3f79('0x63')))||moment()[_0x3f79('0x2c')](_0x3f79('0x63'));_0x10e323[_0x3f79('0x75')]=_0x380d50||_0x3f79('0x76');_0x10e323=_['merge'](_0x10e323,getCustomFields(_0x34d2d8[_0x3f79('0x77')],_0x168e96));return request({'method':_0x3f79('0x21'),'uri':'https://www.zohoapis.'+_0x472666+_0x3f79('0x78'),'headers':{'Authorization':_0x3f79('0x2f')+_0x4169a3},'body':{'data':[_0x10e323]},'json':!![]})['then'](function(_0x3f4aa7){if(_0x3f4aa7&&_0x3f4aa7['data'][0x0][_0x3f79('0x43')]===_0x3f79('0x44')){logger['info'](_0x3f79('0x79'));return{'id':_0x3f4aa7['data'][0x0][_0x3f79('0x7a')]['id']};}})[_0x3f79('0x28')](function(_0x17f97c){logger['info'](_0x3f79('0x7b'),_0x17f97c[_0x3f79('0x2a')]);console[_0x3f79('0x46')](_0x3f79('0x7b'),_0x17f97c);});}exports['queue']=function(_0x5e2e7e,_0x22bdbc,_0x421f26,_0x4fd951,_0x2d99cc,_0x132060){var _0x2cecd5,_0x46fd20,_0x41c78e;_0x132060[_0x3f79('0x7c')]=intUtil[_0x3f79('0x7d')](_0x132060['host']);_0x132060[_0x3f79('0x7e')]=intUtil[_0x3f79('0x7d')](_0x132060[_0x3f79('0x7e')]);if(_0x2d99cc&&_0x2d99cc[_0x3f79('0x7f')]){logger[_0x3f79('0x35')]('[QUEUE]',_0x3f79('0x80'));_0x22bdbc['recordingURL']=_0x132060[_0x3f79('0x7e')]+'/api/voice/recordings/'+_0x22bdbc['uniqueid']+_0x3f79('0x81')+md5(_0x22bdbc[_0x3f79('0x82')]);}else{_0x22bdbc['recordingURL']='';}var _0x3fdd56=_0x132060['host']==='zoho.eu'?'eu':_0x3f79('0x83');return getAccessToken(_0x132060)[_0x3f79('0x30')](function(_0x578918){_0x41c78e=_0x578918;return getUser(_0x41c78e,_0x3fdd56,_0x132060,_0x4fd951[_0x3f79('0x34')]);})[_0x3f79('0x30')](function(_0xaa7fec){_0x2cecd5=_0xaa7fec;logger[_0x3f79('0x35')](_0x3f79('0x84'),_0x2cecd5['id']);return getEndUser(_0x41c78e,_0x3fdd56,_0x132060,_0x22bdbc[_0x3f79('0x85')],_0x22bdbc[_0x3f79('0x86')],_0x2cecd5,_0x421f26);})['then'](function(_0x436e4f){_0x46fd20=_0x436e4f;return getCall(_0x41c78e,_0x3fdd56,_0x132060,_0x2cecd5,_0x46fd20,_0x421f26,_0x22bdbc,_0x3f79('0x76'));})[_0x3f79('0x30')](function(_0x4876ce){if(_0x4876ce){logger[_0x3f79('0x35')](_0x3f79('0x87'),_0x4876ce['id']);logger[_0x3f79('0x35')](_0x3f79('0x88'),_0x3f79('0x89'));emit(util[_0x3f79('0x2c')](_0x3f79('0x8a'),_0x4fd951[_0x3f79('0x17')]),'trigger:browser:url',{'uri':_0x3f79('0x8b')+_0x132060[_0x3f79('0x7c')]+'/crm/EntityInfo.do?module=Calls&id='+_0x4876ce['id']});}})[_0x3f79('0x28')](function(_0x3223e0){logger[_0x3f79('0x29')](_0x3f79('0x88'),JSON[_0x3f79('0xd')](_0x3223e0));});};exports[_0x3f79('0x73')]=function(_0x34a043,_0x4a14a0,_0x3af74e,_0x474a9f,_0x3de798,_0x2b9dd5,_0x1768ed){var _0x5cfb80,_0x2a4158,_0x4c52ac;_0x2b9dd5[_0x3f79('0x7c')]=intUtil['stripTrailingSlash'](_0x2b9dd5[_0x3f79('0x7c')]);_0x2b9dd5[_0x3f79('0x7e')]=intUtil[_0x3f79('0x7d')](_0x2b9dd5['serverUrl']);if(_0x1768ed&&_0x1768ed['recordingFormat']&&_0x1768ed['recordingFormat']!==_0x3f79('0x8c')){logger[_0x3f79('0x35')](_0x3f79('0x8d'),_0x3f79('0x80'));_0x4a14a0[_0x3f79('0x8e')]=_0x2b9dd5['serverUrl']+_0x3f79('0x8f')+_0x4a14a0[_0x3f79('0x82')]+_0x3f79('0x81')+md5(_0x4a14a0[_0x3f79('0x82')]);}var _0x395d66=_0x2b9dd5[_0x3f79('0x7c')]==='zoho.eu'?'eu':_0x3f79('0x83');return getAccessToken(_0x2b9dd5)[_0x3f79('0x30')](function(_0x7ea41b){_0x4c52ac=_0x7ea41b;return getUser(_0x4c52ac,_0x395d66,_0x2b9dd5,_0x474a9f['email']);})[_0x3f79('0x30')](function(_0x2a38b1){_0x5cfb80=_0x2a38b1;logger[_0x3f79('0x35')](_0x3f79('0x84'),_0x5cfb80['id']);return getEndUser(_0x4c52ac,_0x395d66,_0x2b9dd5,_0x4a14a0[_0x3f79('0x90')],_0x4a14a0['destcalleridnum'],_0x5cfb80,_0x3af74e);})[_0x3f79('0x30')](function(_0x5ea178){_0x2a4158=_0x5ea178;return getCall(_0x4c52ac,_0x395d66,_0x2b9dd5,_0x5cfb80,_0x2a4158,_0x3af74e,_0x4a14a0,_0x3f79('0x91'));})[_0x3f79('0x30')](function(_0x466d7a){if(_0x466d7a){logger[_0x3f79('0x35')](_0x3f79('0x87'),_0x466d7a['id']);logger['info']('[OUTBOUND]','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util['format'](_0x3f79('0x8a'),_0x474a9f['name']),'trigger:browser:url',{'uri':_0x3f79('0x8b')+_0x2b9dd5['host']+_0x3f79('0x92')+_0x466d7a['id']});}})[_0x3f79('0x28')](function(_0x298dff){logger[_0x3f79('0x29')](_0x3f79('0x8d'),JSON[_0x3f79('0xd')](_0x298dff));});};exports[_0x3f79('0x93')]=function(_0x59f92a,_0x4e5bc7,_0x3b8f97,_0x322ba1,_0x168165,_0x5a6e7f){var _0x1d4973,_0x11018c,_0x2f8a8f;_0x5a6e7f[_0x3f79('0x7c')]=intUtil[_0x3f79('0x7d')](_0x5a6e7f[_0x3f79('0x7c')]);_0x5a6e7f[_0x3f79('0x7e')]=intUtil[_0x3f79('0x7d')](_0x5a6e7f[_0x3f79('0x7e')]);if(_0x168165&&_0x168165[_0x3f79('0x7f')]){logger[_0x3f79('0x35')]('['+_0x4e5bc7[_0x3f79('0x66')][_0x3f79('0x94')]()+']',_0x3f79('0x80'));_0x4e5bc7[_0x3f79('0x8e')]=_0x5a6e7f[_0x3f79('0x7e')]+'/api/voice/recordings/'+_0x4e5bc7['uniqueid']+_0x3f79('0x81')+md5(_0x4e5bc7[_0x3f79('0x82')]);}else{_0x4e5bc7[_0x3f79('0x8e')]='';}var _0x58c3bb=_0x5a6e7f['host']===_0x3f79('0x95')?'eu':_0x3f79('0x83');return getAccessToken(_0x5a6e7f)[_0x3f79('0x30')](function(_0x24bfe6){_0x2f8a8f=_0x24bfe6;return getUser(_0x2f8a8f,_0x58c3bb,_0x5a6e7f);})[_0x3f79('0x30')](function(_0x2e6ff6){_0x1d4973=_0x2e6ff6;logger[_0x3f79('0x35')](_0x3f79('0x84'),_0x1d4973['id']);return getEndUser(_0x2f8a8f,_0x58c3bb,_0x5a6e7f,_0x4e5bc7[_0x3f79('0x85')],_0x4e5bc7[_0x3f79('0x86')],_0x1d4973,_0x3b8f97);})[_0x3f79('0x30')](function(_0x338183){_0x11018c=_0x338183;return getCall(_0x2f8a8f,_0x58c3bb,_0x5a6e7f,_0x1d4973,_0x11018c,_0x3b8f97,_0x4e5bc7,'Inbound');})[_0x3f79('0x30')](function(_0x37d8a5){if(_0x37d8a5){logger[_0x3f79('0x35')](_0x3f79('0x87'),_0x37d8a5['id']);}})[_0x3f79('0x28')](function(_0x3cdbc3){logger[_0x3f79('0x29')]('['+_0x4e5bc7[_0x3f79('0x66')][_0x3f79('0x94')]()+']',JSON[_0x3f79('0xd')](_0x3cdbc3));});};
\ No newline at end of file
diff --git a/server/services/ami/trigger/script/index.js b/server/services/ami/trigger/script/index.js
index 291341a..cccddd5 100644
--- a/server/services/ami/trigger/script/index.js
+++ b/server/services/ami/trigger/script/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7a54=['mustache','trigger','exec','data2','Script','data3','%s\x20\x27%s\x27\x20failed\x20with\x20code\x20%d\x20and\x20error:\x20%s','info','%s\x20\x27%s\x27\x20succeeded\x20with\x20output:\x20%s','util','shelljs'];(function(_0x117ffd,_0x566ddf){var _0x3cc67b=function(_0x16c1db){while(--_0x16c1db){_0x117ffd['push'](_0x117ffd['shift']());}};_0x3cc67b(++_0x566ddf);}(_0x7a54,0x106));var _0x47a5=function(_0x595be4,_0x31da87){_0x595be4=_0x595be4-0x0;var _0x37bc55=_0x7a54[_0x595be4];return _0x37bc55;};'use strict';var util=require(_0x47a5('0x0'));var sh=require(_0x47a5('0x1'));var Mustache=require(_0x47a5('0x2'));var logger=require('../../../../config/logger')(_0x47a5('0x3'));exports[_0x47a5('0x4')]=function(_0x4880bf,_0x5f7f12){var _0x11bf85=_0x4880bf[_0x47a5('0x5')]?_0x4880bf[_0x47a5('0x5')]:_0x47a5('0x6');var _0x545a97=_0x4880bf[_0x47a5('0x7')]?Mustache['render'](_0x4880bf[_0x47a5('0x7')],_0x5f7f12):_0x5f7f12;sh[_0x47a5('0x4')](_0x545a97,function(_0x506eda,_0x194fb0,_0x5077f3){if(_0x506eda!==0x0){logger['error'](util['format'](_0x47a5('0x8'),_0x11bf85,_0x545a97,_0x506eda,_0x5077f3));}else{logger[_0x47a5('0x9')](util['format'](_0x47a5('0xa'),_0x11bf85,_0x545a97,_0x194fb0));}});};
\ No newline at end of file
+var _0x7a54=['mustache','trigger','exec','data2','Script','data3','%s\x20\x27%s\x27\x20failed\x20with\x20code\x20%d\x20and\x20error:\x20%s','info','%s\x20\x27%s\x27\x20succeeded\x20with\x20output:\x20%s','util','shelljs'];(function(_0x4b65cd,_0x3c7ab9){var _0x5af6fd=function(_0x3794b4){while(--_0x3794b4){_0x4b65cd['push'](_0x4b65cd['shift']());}};_0x5af6fd(++_0x3c7ab9);}(_0x7a54,0x106));var _0x47a5=function(_0x2122bf,_0x298942){_0x2122bf=_0x2122bf-0x0;var _0x17ae16=_0x7a54[_0x2122bf];return _0x17ae16;};'use strict';var util=require(_0x47a5('0x0'));var sh=require(_0x47a5('0x1'));var Mustache=require(_0x47a5('0x2'));var logger=require('../../../../config/logger')(_0x47a5('0x3'));exports[_0x47a5('0x4')]=function(_0x4880bf,_0x5f7f12){var _0x11bf85=_0x4880bf[_0x47a5('0x5')]?_0x4880bf[_0x47a5('0x5')]:_0x47a5('0x6');var _0x545a97=_0x4880bf[_0x47a5('0x7')]?Mustache['render'](_0x4880bf[_0x47a5('0x7')],_0x5f7f12):_0x5f7f12;sh[_0x47a5('0x4')](_0x545a97,function(_0x506eda,_0x194fb0,_0x5077f3){if(_0x506eda!==0x0){logger['error'](util['format'](_0x47a5('0x8'),_0x11bf85,_0x545a97,_0x506eda,_0x5077f3));}else{logger[_0x47a5('0x9')](util['format'](_0x47a5('0xa'),_0x11bf85,_0x545a97,_0x194fb0));}});};
\ No newline at end of file
diff --git a/server/services/ami/trigger/urlforward/index.js b/server/services/ami/trigger/urlforward/index.js
index 5b1b31c..2e14981 100644
--- a/server/services/ami/trigger/urlforward/index.js
+++ b/server/services/ami/trigger/urlforward/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x5f2f=['lodash','mustache','../../../../config/logger','trigger','exec','data1','toUpperCase','render','data2','number','data5','headers','data6','parse','stack','GET','DELETE','POST','PUT','data7','body','error','body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format','info','format','%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s','stringify','then','isNil',',\x20request\x20body:\x20','object','%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s','statusCode','catch','%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s','name','message','request-promise','util'];(function(_0x42cb39,_0x1c864e){var _0x39ef9d=function(_0x57a884){while(--_0x57a884){_0x42cb39['push'](_0x42cb39['shift']());}};_0x39ef9d(++_0x1c864e);}(_0x5f2f,0x73));var _0xf5f2=function(_0x5d7505,_0x2acae8){_0x5d7505=_0x5d7505-0x0;var _0x398bb8=_0x5f2f[_0x5d7505];return _0x398bb8;};'use strict';var rp=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var _=require(_0xf5f2('0x2'));var Mustache=require(_0xf5f2('0x3'));var logger=require(_0xf5f2('0x4'))(_0xf5f2('0x5'));exports[_0xf5f2('0x6')]=function(_0x107cf,_0x501fbd){var _0x4854b6,_0x1665c7;var _0x192215={'method':_0x107cf[_0xf5f2('0x7')][_0xf5f2('0x8')](),'uri':Mustache[_0xf5f2('0x9')](_0x107cf[_0xf5f2('0xa')],_0x501fbd),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x107cf['data5'])===_0xf5f2('0xb')&&parseInt(_0x107cf[_0xf5f2('0xc')])>=0x1&&parseInt(_0x107cf[_0xf5f2('0xc')])<=0xa?parseInt(_0x107cf['data5'])*0x3e8:0x5*0x3e8};try{_0x192215[_0xf5f2('0xd')]=_0x107cf[_0xf5f2('0xe')]?JSON[_0xf5f2('0xf')](Mustache['render'](_0x107cf[_0xf5f2('0xe')],_0x501fbd)):{};}catch(_0x4ebbbe){logger['error'](_0x4ebbbe[_0xf5f2('0x10')]);}switch(_0x107cf[_0xf5f2('0x7')]['toUpperCase']()){case _0xf5f2('0x11'):case _0xf5f2('0x12'):_0x4854b6=null;_0x192215['qs']=_0x501fbd;break;case _0xf5f2('0x13'):case _0xf5f2('0x14'):if(_0x107cf[_0xf5f2('0x15')]){try{_0x4854b6=JSON[_0xf5f2('0xf')](Mustache['render'](_0x107cf[_0xf5f2('0x15')],_0x501fbd));_0x192215[_0xf5f2('0x16')]=_0x4854b6;}catch(_0x269909){logger[_0xf5f2('0x17')](_0x269909[_0xf5f2('0x10')]);logger['error'](_0xf5f2('0x18'));}}else{_0x4854b6=_0x501fbd;_0x192215[_0xf5f2('0x16')]=_0x4854b6;}break;}logger[_0xf5f2('0x19')](util[_0xf5f2('0x1a')](_0xf5f2('0x1b'),_0x107cf[_0xf5f2('0x7')],_0x107cf[_0xf5f2('0xa')],JSON[_0xf5f2('0x1c')](_0x192215)));rp(_0x192215)[_0xf5f2('0x1d')](function(_0x228ace){_0x4854b6=!_[_0xf5f2('0x1e')](_0x4854b6)?_0xf5f2('0x1f')+_0x4854b6:'';_0x1665c7=typeof _0x228ace[_0xf5f2('0x16')]===_0xf5f2('0x20')?JSON[_0xf5f2('0x1c')](_0x228ace[_0xf5f2('0x16')]):_0x228ace[_0xf5f2('0x16')];logger['info'](util[_0xf5f2('0x1a')](_0xf5f2('0x21'),_0x107cf['data1'],_0x107cf['data2'],_0x228ace[_0xf5f2('0x22')],_0x1665c7));})[_0xf5f2('0x23')](function(_0x4ae323){logger[_0xf5f2('0x17')](util[_0xf5f2('0x1a')](_0xf5f2('0x24'),_0x107cf[_0xf5f2('0x7')],_0x107cf[_0xf5f2('0xa')],_0x4ae323['statusCode'],_0x4ae323[_0xf5f2('0x25')],_0x4ae323[_0xf5f2('0x26')]));});};
\ No newline at end of file
+var _0x7a54=['data6','parse','stack','data1','GET','DELETE','POST','PUT','render','data7','body','error','info','format','%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s','then',',\x20request\x20body:\x20','object','stringify','%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s','statusCode','name','request-promise','util','lodash','../../../../config/logger','trigger','toUpperCase','data2','data5'];(function(_0x1bf9b0,_0x386849){var _0x4a73db=function(_0x551bd8){while(--_0x551bd8){_0x1bf9b0['push'](_0x1bf9b0['shift']());}};_0x4a73db(++_0x386849);}(_0x7a54,0x106));var _0x47a5=function(_0x1aff9b,_0x53eb95){_0x1aff9b=_0x1aff9b-0x0;var _0x3f5d51=_0x7a54[_0x1aff9b];return _0x3f5d51;};'use strict';var rp=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var _=require(_0x47a5('0x2'));var Mustache=require('mustache');var logger=require(_0x47a5('0x3'))(_0x47a5('0x4'));exports['exec']=function(_0x5f7f12,_0x11bf85){var _0x2a1a7e,_0x3717e1;var _0xfdf934={'method':_0x5f7f12['data1'][_0x47a5('0x5')](),'uri':Mustache['render'](_0x5f7f12[_0x47a5('0x6')],_0x11bf85),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x5f7f12[_0x47a5('0x7')])==='number'&&parseInt(_0x5f7f12[_0x47a5('0x7')])>=0x1&&parseInt(_0x5f7f12['data5'])<=0xa?parseInt(_0x5f7f12['data5'])*0x3e8:0x5*0x3e8};try{_0xfdf934['headers']=_0x5f7f12[_0x47a5('0x8')]?JSON[_0x47a5('0x9')](Mustache['render'](_0x5f7f12[_0x47a5('0x8')],_0x11bf85)):{};}catch(_0x49e844){logger['error'](_0x49e844[_0x47a5('0xa')]);}switch(_0x5f7f12[_0x47a5('0xb')][_0x47a5('0x5')]()){case _0x47a5('0xc'):case _0x47a5('0xd'):_0x2a1a7e=null;_0xfdf934['qs']=_0x11bf85;break;case _0x47a5('0xe'):case _0x47a5('0xf'):if(_0x5f7f12['data7']){try{_0x2a1a7e=JSON[_0x47a5('0x9')](Mustache[_0x47a5('0x10')](_0x5f7f12[_0x47a5('0x11')],_0x11bf85));_0xfdf934[_0x47a5('0x12')]=_0x2a1a7e;}catch(_0x139f25){logger[_0x47a5('0x13')](_0x139f25[_0x47a5('0xa')]);logger[_0x47a5('0x13')]('body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format');}}else{_0x2a1a7e=_0x11bf85;_0xfdf934[_0x47a5('0x12')]=_0x2a1a7e;}break;}logger[_0x47a5('0x14')](util[_0x47a5('0x15')](_0x47a5('0x16'),_0x5f7f12[_0x47a5('0xb')],_0x5f7f12['data2'],JSON['stringify'](_0xfdf934)));rp(_0xfdf934)[_0x47a5('0x17')](function(_0x4b966e){_0x2a1a7e=!_['isNil'](_0x2a1a7e)?_0x47a5('0x18')+_0x2a1a7e:'';_0x3717e1=typeof _0x4b966e[_0x47a5('0x12')]===_0x47a5('0x19')?JSON[_0x47a5('0x1a')](_0x4b966e[_0x47a5('0x12')]):_0x4b966e[_0x47a5('0x12')];logger[_0x47a5('0x14')](util[_0x47a5('0x15')](_0x47a5('0x1b'),_0x5f7f12['data1'],_0x5f7f12[_0x47a5('0x6')],_0x4b966e[_0x47a5('0x1c')],_0x3717e1));})['catch'](function(_0x2b0360){logger[_0x47a5('0x13')](util[_0x47a5('0x15')]('%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s',_0x5f7f12[_0x47a5('0xb')],_0x5f7f12[_0x47a5('0x6')],_0x2b0360[_0x47a5('0x1c')],_0x2b0360[_0x47a5('0x1d')],_0x2b0360['message']));});};
\ No newline at end of file
diff --git a/server/services/email/client.js b/server/services/email/client.js
index 1b01c6c..b3d2407 100644
--- a/server/services/email/client.js
+++ b/server/services/email/client.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xbe02=['http','Request','request','then','error','rpc','exports','jayson/promise','bluebird','../../config/logger','routing'];(function(_0x459991,_0x86a7b5){var _0x594182=function(_0x1f3739){while(--_0x1f3739){_0x459991['push'](_0x459991['shift']());}};_0x594182(++_0x86a7b5);}(_0xbe02,0x146));var _0x2be0=function(_0xe01eee,_0x14610d){_0xe01eee=_0xe01eee-0x0;var _0x28957a=_0xbe02[_0xe01eee];return _0x28957a;};'use strict';var jayson=require(_0x2be0('0x0'));var BPromise=require(_0x2be0('0x1'));var logger=require(_0x2be0('0x2'))(_0x2be0('0x3'));var client=jayson['client'][_0x2be0('0x4')]({'port':0x2329});client[_0x2be0('0x5')]=function(_0x9eb980,_0x364c99){return new BPromise(function(_0x22ed11,_0x3b824){return client[_0x2be0('0x6')](_0x9eb980,_0x364c99)[_0x2be0('0x7')](function(_0x39a2ca){logger['debug']('rpc',_0x2be0('0x3'),_0x9eb980,_0x364c99,_0x39a2ca);if(_0x39a2ca[_0x2be0('0x8')]){logger[_0x2be0('0x8')](_0x2be0('0x9'),_0x2be0('0x3'),_0x9eb980,_0x39a2ca[_0x2be0('0x8')]['message'],_0x364c99);return _0x3b824(_0x39a2ca['error']['message']);}else{return _0x22ed11(_0x39a2ca['result']);}})['catch'](function(_0x4b4487){logger[_0x2be0('0x8')](_0x2be0('0x9'),'routing',_0x9eb980,_0x4b4487,_0x364c99);return _0x3b824(_0x4b4487);});});};module[_0x2be0('0xa')]=client;
\ No newline at end of file
+var _0x89fe=['http','Request','request','then','debug','error','rpc','message','result','catch','exports','jayson/promise','bluebird','../../config/logger','routing'];(function(_0x9f4560,_0x5976c0){var _0x5c8943=function(_0x3c93a3){while(--_0x3c93a3){_0x9f4560['push'](_0x9f4560['shift']());}};_0x5c8943(++_0x5976c0);}(_0x89fe,0x83));var _0xe89f=function(_0x407f9f,_0x2b7b48){_0x407f9f=_0x407f9f-0x0;var _0x30246=_0x89fe[_0x407f9f];return _0x30246;};'use strict';var jayson=require(_0xe89f('0x0'));var BPromise=require(_0xe89f('0x1'));var logger=require(_0xe89f('0x2'))(_0xe89f('0x3'));var client=jayson['client'][_0xe89f('0x4')]({'port':0x2329});client[_0xe89f('0x5')]=function(_0x580dce,_0x3d3aa8){return new BPromise(function(_0x3d8b30,_0x159e6b){return client[_0xe89f('0x6')](_0x580dce,_0x3d3aa8)[_0xe89f('0x7')](function(_0x2d5020){logger[_0xe89f('0x8')]('rpc',_0xe89f('0x3'),_0x580dce,_0x3d3aa8,_0x2d5020);if(_0x2d5020[_0xe89f('0x9')]){logger[_0xe89f('0x9')](_0xe89f('0xa'),_0xe89f('0x3'),_0x580dce,_0x2d5020['error'][_0xe89f('0xb')],_0x3d3aa8);return _0x159e6b(_0x2d5020[_0xe89f('0x9')][_0xe89f('0xb')]);}else{return _0x3d8b30(_0x2d5020[_0xe89f('0xc')]);}})[_0xe89f('0xd')](function(_0x104647){logger[_0xe89f('0x9')](_0xe89f('0xa'),_0xe89f('0x3'),_0x580dce,_0x104647,_0x3d3aa8);return _0x159e6b(_0x104647);});});};module[_0xe89f('0xe')]=client;
\ No newline at end of file
diff --git a/server/services/email/index.js b/server/services/email/index.js
index 3a98b36..fe6b670 100644
--- a/server/services/email/index.js
+++ b/server/services/email/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xbc82=['then','initMailAccounts','mailAccounts','Setting','findOne','log','bluebird','./rpc/mailAccount'];(function(_0x8c5047,_0x3dd03c){var _0x48b051=function(_0x362cec){while(--_0x362cec){_0x8c5047['push'](_0x8c5047['shift']());}};_0x48b051(++_0x3dd03c);}(_0xbc82,0x13e));var _0x2bc8=function(_0x53d147,_0x259f9e){_0x53d147=_0x53d147-0x0;var _0x3bc064=_0xbc82[_0x53d147];return _0x3bc064;};'use strict';var BPromise=require(_0x2bc8('0x0'));var server=require('./server');var Realtime=require('./realtime');var EmailChannel=require('./lib/email');var mailAccount=require(_0x2bc8('0x1'));var realtime=new Realtime();var email=new EmailChannel(realtime);var db=require('../../mysqldb')['db'];function initRealtime(){return BPromise['resolve']()[_0x2bc8('0x2')](mailAccount['getMailAccounts']())['then'](realtime[_0x2bc8('0x3')]())['then'](function(){email['refresh'](realtime[_0x2bc8('0x4')]);return realtime;});}function main(){return server['listen'](realtime,email)['then'](function(_0x20a193){return initRealtime();})[_0x2bc8('0x2')](function(_0x10ea46){return db[_0x2bc8('0x5')][_0x2bc8('0x6')]({'attributes':['id','loginMailFrequency'],'raw':!![]});})[_0x2bc8('0x2')](function(_0x4cc479){return setInterval(initRealtime,_0x4cc479['loginMailFrequency']*0x3e8);})['catch'](function(_0x1252fb){console[_0x2bc8('0x7')](_0x1252fb);});}main();
\ No newline at end of file
+var _0x644f=['./server','./realtime','./lib/email','./rpc/mailAccount','../../mysqldb','resolve','then','getMailAccounts','refresh','mailAccounts','listen','Setting','findOne','loginMailFrequency','catch'];(function(_0x2721d6,_0x572143){var _0x3ff642=function(_0x108307){while(--_0x108307){_0x2721d6['push'](_0x2721d6['shift']());}};_0x3ff642(++_0x572143);}(_0x644f,0x177));var _0xf644=function(_0x596284,_0x1cd02b){_0x596284=_0x596284-0x0;var _0x5313c6=_0x644f[_0x596284];return _0x5313c6;};'use strict';var BPromise=require('bluebird');var server=require(_0xf644('0x0'));var Realtime=require(_0xf644('0x1'));var EmailChannel=require(_0xf644('0x2'));var mailAccount=require(_0xf644('0x3'));var realtime=new Realtime();var email=new EmailChannel(realtime);var db=require(_0xf644('0x4'))['db'];function initRealtime(){return BPromise[_0xf644('0x5')]()[_0xf644('0x6')](mailAccount[_0xf644('0x7')]())[_0xf644('0x6')](realtime['initMailAccounts']())['then'](function(){email[_0xf644('0x8')](realtime[_0xf644('0x9')]);return realtime;});}function main(){return server[_0xf644('0xa')](realtime,email)['then'](function(_0x1f826a){return initRealtime();})[_0xf644('0x6')](function(_0x302671){return db[_0xf644('0xb')][_0xf644('0xc')]({'attributes':['id','loginMailFrequency'],'raw':!![]});})[_0xf644('0x6')](function(_0x21e90a){return setInterval(initRealtime,_0x21e90a[_0xf644('0xd')]*0x3e8);})[_0xf644('0xe')](function(_0x59d974){console['log'](_0x59d974);});}main();
\ No newline at end of file
diff --git a/server/services/email/lib/email.js b/server/services/email/lib/email.js
index 1c11da6..090c5c0 100644
--- a/server/services/email/lib/email.js
+++ b/server/services/email/lib/email.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x3d5d=['from','then','catch','Mail\x20not\x20accepted\x20from\x20routing\x20%s','lastSync','sendMail','verifySmtp','isNil','Smtp','verify','exports','lodash','moment','bluebird','md5','../../../config/environment','email','redis','defaults','localhost','./imap','./smtp','../rpc/mailAccount','info','start\x20email\x20channel','mailAccounts','imapAccounts','smtp','prototype','emit','name','key','Imap','status','messageStatus','total','mailAccount:update','hasOwnProperty','active','box','handleImapEnd','error','handleImapError','bind','disabled','handleImapBox','connected','messages','handleImapEmail','New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s','firstName','lastName'];(function(_0x200a88,_0xe77d83){var _0x480a20=function(_0x5ebd21){while(--_0x5ebd21){_0x200a88['push'](_0x200a88['shift']());}};_0x480a20(++_0xe77d83);}(_0x3d5d,0xa7));var _0xd3d5=function(_0x3bef2c,_0x5a86fd){_0x3bef2c=_0x3bef2c-0x0;var _0x331503=_0x3d5d[_0x3bef2c];return _0x331503;};'use strict';var _=require(_0xd3d5('0x0'));var moment=require(_0xd3d5('0x1'));var BPromise=require(_0xd3d5('0x2'));var md5=require(_0xd3d5('0x3'));var Redis=require('ioredis');var config=require(_0xd3d5('0x4'));var logger=require('../../../config/logger')(_0xd3d5('0x5'));config[_0xd3d5('0x6')]=_[_0xd3d5('0x7')](config[_0xd3d5('0x6')],{'host':_0xd3d5('0x8'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xd3d5('0x6')]));var EmailImap=require(_0xd3d5('0x9'));var EmailSmtp=require(_0xd3d5('0xa'));var mailAccount=require(_0xd3d5('0xb'));var md5Accounts={};function EmailChannel(_0x57eb16){logger[_0xd3d5('0xc')](_0xd3d5('0xd'));this['mailAccounts']=_0x57eb16[_0xd3d5('0xe')];this[_0xd3d5('0xf')]={};this[_0xd3d5('0x10')]=new EmailSmtp();}EmailChannel[_0xd3d5('0x11')][_0xd3d5('0x12')]=function(_0x493743){var _0x43b464=this[_0xd3d5('0xe')][_0x493743];var _0x829e0b={'id':_0x43b464['id'],'name':_0x43b464[_0xd3d5('0x13')],'key':_0x43b464[_0xd3d5('0x14')],'active':_0x43b464['active'],'Imap':{'status':_0x43b464[_0xd3d5('0x15')][_0xd3d5('0x16')],'messageStatus':_0x43b464[_0xd3d5('0x15')][_0xd3d5('0x17')],'total':_0x43b464['Imap'][_0xd3d5('0x18')]}};if(_['isNil'](md5Accounts[_0x493743])){md5Accounts[_0x493743]={};}var _0x77068e=md5(JSON['stringify'](_0x829e0b));if(md5Accounts[_0x493743][_0xd3d5('0x3')]!==_0x77068e){md5Accounts[_0x493743][_0xd3d5('0x3')]=_0x77068e;io[_0xd3d5('0x12')](_0xd3d5('0x19'),_0x829e0b);}};EmailChannel['prototype']['refresh']=function(_0x2b0119){for(var _0x196a0f in _0x2b0119){if(_0x2b0119[_0xd3d5('0x1a')](_0x196a0f)){if(_0x2b0119[_0x196a0f][_0xd3d5('0x15')]&&_0x2b0119[_0x196a0f][_0xd3d5('0x1b')]){var _0x282262=_0x2b0119[_0x196a0f][_0xd3d5('0x15')];if(!this[_0xd3d5('0xf')][_0xd3d5('0x1a')](_0x282262['id'])){this[_0xd3d5('0xf')][_0x282262['id']]=new EmailImap(_0x282262,_0x2b0119[_0x196a0f][_0xd3d5('0x5')]);this[_0xd3d5('0xf')][_0x282262['id']]['on'](_0xd3d5('0x1c'),this['handleImapBox']['bind'](this,_0x196a0f));this[_0xd3d5('0xf')][_0x282262['id']]['on']('email',this['handleImapEmail']['bind'](this,_0x196a0f));this[_0xd3d5('0xf')][_0x282262['id']]['on']('end',this[_0xd3d5('0x1d')]['bind'](this,_0x196a0f));this[_0xd3d5('0xf')][_0x282262['id']]['on'](_0xd3d5('0x1e'),this[_0xd3d5('0x1f')][_0xd3d5('0x20')](this,_0x196a0f));}}else{if(_['isNil'](this[_0xd3d5('0xe')][_0x196a0f][_0xd3d5('0x15')])){this[_0xd3d5('0xe')][_0x196a0f][_0xd3d5('0x15')]={};}this['mailAccounts'][_0x196a0f][_0xd3d5('0x15')][_0xd3d5('0x16')]=_0xd3d5('0x21');this[_0xd3d5('0xe')][_0x196a0f][_0xd3d5('0x15')]['messageStatus']='';this[_0xd3d5('0x12')](_0x196a0f);}}}};EmailChannel[_0xd3d5('0x11')][_0xd3d5('0x22')]=function(_0xc467f8,_0x2035c6){if(this[_0xd3d5('0xe')][_0xc467f8]){this['mailAccounts'][_0xc467f8][_0xd3d5('0x15')][_0xd3d5('0x16')]=_0xd3d5('0x23');this['mailAccounts'][_0xc467f8][_0xd3d5('0x15')]['messageStatus']=_0x2035c6[_0xd3d5('0x13')];if(_0x2035c6[_0xd3d5('0x24')]){this['mailAccounts'][_0xc467f8][_0xd3d5('0x15')][_0xd3d5('0x18')]=_0x2035c6[_0xd3d5('0x24')]['total'];}return this[_0xd3d5('0x12')](_0xc467f8);}};EmailChannel[_0xd3d5('0x11')][_0xd3d5('0x25')]=function(_0x54158d,_0x390413){logger[_0xd3d5('0xc')](_0xd3d5('0x26'),_0x390413[_0xd3d5('0x27')],_0x390413[_0xd3d5('0x28')],_0x390413[_0xd3d5('0x29')],_0x54158d);if(this[_0xd3d5('0xe')][_0x54158d]){return mailAccount['notify'](_0x54158d,_0x390413)[_0xd3d5('0x2a')](function(_0x3ca07c){if(_0x3ca07c){logger[_0xd3d5('0xc')]('Mail\x20accepted\x20from\x20routing');}})[_0xd3d5('0x2b')](function(_0x1ce434){logger[_0xd3d5('0x1e')](_0xd3d5('0x2c'),JSON['stringify'](_0x1ce434));});}};EmailChannel[_0xd3d5('0x11')][_0xd3d5('0x1d')]=function(_0x286f64){if(this[_0xd3d5('0xe')][_0x286f64]&&this[_0xd3d5('0xe')][_0x286f64][_0xd3d5('0x15')]){if(this['imapAccounts'][this['mailAccounts'][_0x286f64][_0xd3d5('0x15')]['id']]){delete this[_0xd3d5('0xf')][this['mailAccounts'][_0x286f64][_0xd3d5('0x15')]['id']];}this[_0xd3d5('0xe')][_0x286f64]['Imap'][_0xd3d5('0x2d')]=moment();this['emit'](_0x286f64);}};EmailChannel['prototype'][_0xd3d5('0x1f')]=function(_0x4b5c7d,_0x201d38){if(this['mailAccounts'][_0x4b5c7d]){this[_0xd3d5('0xe')][_0x4b5c7d][_0xd3d5('0x15')][_0xd3d5('0x16')]='error';this[_0xd3d5('0xe')][_0x4b5c7d][_0xd3d5('0x15')][_0xd3d5('0x17')]=_0x201d38;return this[_0xd3d5('0x12')](_0x4b5c7d);}};EmailChannel['prototype'][_0xd3d5('0x2e')]=function(_0x24adcd,_0x1bdd74){return this[_0xd3d5('0x10')]['send'](_0x24adcd,_0x1bdd74);};EmailChannel[_0xd3d5('0x11')][_0xd3d5('0x2f')]=function(_0x4dcaa2){var _0x172161=this;if(this['mailAccounts'][_0x4dcaa2['id']]){if(_[_0xd3d5('0x30')](this[_0xd3d5('0xe')][_0x4dcaa2['id']]['Smtp'])){this[_0xd3d5('0xe')][_0x4dcaa2['id']][_0xd3d5('0x31')]={};}this[_0xd3d5('0xe')][_0x4dcaa2['id']][_0xd3d5('0x31')][_0xd3d5('0x2d')]=moment();return new BPromise(function(_0x11c73d,_0x52914d){return _0x172161[_0xd3d5('0x10')][_0xd3d5('0x32')](_0x4dcaa2)[_0xd3d5('0x2a')](function(_0x413ea3){_0x172161[_0xd3d5('0xe')][_0x4dcaa2['id']][_0xd3d5('0x31')][_0xd3d5('0x16')]='verified';_0x172161[_0xd3d5('0xe')][_0x4dcaa2['id']][_0xd3d5('0x31')][_0xd3d5('0x17')]='';_0x172161[_0xd3d5('0x12')](_0x4dcaa2['id']);_0x11c73d(_0x413ea3);})[_0xd3d5('0x2b')](function(_0x5d194c){_0x172161['mailAccounts'][_0x4dcaa2['id']][_0xd3d5('0x31')][_0xd3d5('0x16')]=_0xd3d5('0x1e');_0x172161[_0xd3d5('0xe')][_0x4dcaa2['id']][_0xd3d5('0x31')][_0xd3d5('0x17')]=_0x5d194c;_0x172161[_0xd3d5('0x12')](_0x4dcaa2['id']);_0x52914d(_0x5d194c);});});}return this[_0xd3d5('0x10')][_0xd3d5('0x32')](_0x4dcaa2);};module[_0xd3d5('0x33')]=EmailChannel;
\ No newline at end of file
+var _0xfa44=['Mail\x20not\x20accepted\x20from\x20routing\x20%s','handleImapEnd','lastSync','sendMail','smtp','send','verifySmtp','Smtp','verify','verified','catch','lodash','moment','bluebird','md5','ioredis','../../../config/environment','../../../config/logger','email','defaults','localhost','redis','./imap','mailAccounts','imapAccounts','name','key','active','Imap','status','messageStatus','total','stringify','emit','mailAccount:update','prototype','refresh','hasOwnProperty','handleImapBox','bind','end','error','handleImapError','isNil','disabled','messages','New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s','firstName','from','then','info','Mail\x20accepted\x20from\x20routing'];(function(_0x34a5fa,_0x5deee4){var _0xb152a3=function(_0x2bbaf2){while(--_0x2bbaf2){_0x34a5fa['push'](_0x34a5fa['shift']());}};_0xb152a3(++_0x5deee4);}(_0xfa44,0x1df));var _0x4fa4=function(_0xa3400,_0x3a980a){_0xa3400=_0xa3400-0x0;var _0x33dba2=_0xfa44[_0xa3400];return _0x33dba2;};'use strict';var _=require(_0x4fa4('0x0'));var moment=require(_0x4fa4('0x1'));var BPromise=require(_0x4fa4('0x2'));var md5=require(_0x4fa4('0x3'));var Redis=require(_0x4fa4('0x4'));var config=require(_0x4fa4('0x5'));var logger=require(_0x4fa4('0x6'))(_0x4fa4('0x7'));config['redis']=_[_0x4fa4('0x8')](config['redis'],{'host':_0x4fa4('0x9'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x4fa4('0xa')]));var EmailImap=require(_0x4fa4('0xb'));var EmailSmtp=require('./smtp');var mailAccount=require('../rpc/mailAccount');var md5Accounts={};function EmailChannel(_0x2f79c8){logger['info']('start\x20email\x20channel');this[_0x4fa4('0xc')]=_0x2f79c8[_0x4fa4('0xc')];this[_0x4fa4('0xd')]={};this['smtp']=new EmailSmtp();}EmailChannel['prototype']['emit']=function(_0x2c8cc1){var _0x5e725e=this[_0x4fa4('0xc')][_0x2c8cc1];var _0x2aac1e={'id':_0x5e725e['id'],'name':_0x5e725e[_0x4fa4('0xe')],'key':_0x5e725e[_0x4fa4('0xf')],'active':_0x5e725e[_0x4fa4('0x10')],'Imap':{'status':_0x5e725e[_0x4fa4('0x11')][_0x4fa4('0x12')],'messageStatus':_0x5e725e[_0x4fa4('0x11')][_0x4fa4('0x13')],'total':_0x5e725e['Imap'][_0x4fa4('0x14')]}};if(_['isNil'](md5Accounts[_0x2c8cc1])){md5Accounts[_0x2c8cc1]={};}var _0x4b2700=md5(JSON[_0x4fa4('0x15')](_0x2aac1e));if(md5Accounts[_0x2c8cc1][_0x4fa4('0x3')]!==_0x4b2700){md5Accounts[_0x2c8cc1][_0x4fa4('0x3')]=_0x4b2700;io[_0x4fa4('0x16')](_0x4fa4('0x17'),_0x2aac1e);}};EmailChannel[_0x4fa4('0x18')][_0x4fa4('0x19')]=function(_0xa99e9e){for(var _0x35a552 in _0xa99e9e){if(_0xa99e9e[_0x4fa4('0x1a')](_0x35a552)){if(_0xa99e9e[_0x35a552]['Imap']&&_0xa99e9e[_0x35a552][_0x4fa4('0x10')]){var _0x324c59=_0xa99e9e[_0x35a552][_0x4fa4('0x11')];if(!this[_0x4fa4('0xd')][_0x4fa4('0x1a')](_0x324c59['id'])){this['imapAccounts'][_0x324c59['id']]=new EmailImap(_0x324c59,_0xa99e9e[_0x35a552][_0x4fa4('0x7')]);this[_0x4fa4('0xd')][_0x324c59['id']]['on']('box',this[_0x4fa4('0x1b')][_0x4fa4('0x1c')](this,_0x35a552));this[_0x4fa4('0xd')][_0x324c59['id']]['on']('email',this['handleImapEmail']['bind'](this,_0x35a552));this[_0x4fa4('0xd')][_0x324c59['id']]['on'](_0x4fa4('0x1d'),this['handleImapEnd'][_0x4fa4('0x1c')](this,_0x35a552));this['imapAccounts'][_0x324c59['id']]['on'](_0x4fa4('0x1e'),this[_0x4fa4('0x1f')]['bind'](this,_0x35a552));}}else{if(_[_0x4fa4('0x20')](this['mailAccounts'][_0x35a552]['Imap'])){this[_0x4fa4('0xc')][_0x35a552][_0x4fa4('0x11')]={};}this[_0x4fa4('0xc')][_0x35a552][_0x4fa4('0x11')][_0x4fa4('0x12')]=_0x4fa4('0x21');this[_0x4fa4('0xc')][_0x35a552][_0x4fa4('0x11')][_0x4fa4('0x13')]='';this[_0x4fa4('0x16')](_0x35a552);}}}};EmailChannel[_0x4fa4('0x18')][_0x4fa4('0x1b')]=function(_0x4f20a0,_0x2fef86){if(this[_0x4fa4('0xc')][_0x4f20a0]){this['mailAccounts'][_0x4f20a0]['Imap']['status']='connected';this[_0x4fa4('0xc')][_0x4f20a0][_0x4fa4('0x11')]['messageStatus']=_0x2fef86['name'];if(_0x2fef86[_0x4fa4('0x22')]){this[_0x4fa4('0xc')][_0x4f20a0][_0x4fa4('0x11')]['total']=_0x2fef86[_0x4fa4('0x22')]['total'];}return this[_0x4fa4('0x16')](_0x4f20a0);}};EmailChannel[_0x4fa4('0x18')]['handleImapEmail']=function(_0x56e415,_0x5e01d0){logger['info'](_0x4fa4('0x23'),_0x5e01d0[_0x4fa4('0x24')],_0x5e01d0['lastName'],_0x5e01d0[_0x4fa4('0x25')],_0x56e415);if(this[_0x4fa4('0xc')][_0x56e415]){return mailAccount['notify'](_0x56e415,_0x5e01d0)[_0x4fa4('0x26')](function(_0x268b01){if(_0x268b01){logger[_0x4fa4('0x27')](_0x4fa4('0x28'));}})['catch'](function(_0x18bb54){logger[_0x4fa4('0x1e')](_0x4fa4('0x29'),JSON[_0x4fa4('0x15')](_0x18bb54));});}};EmailChannel[_0x4fa4('0x18')][_0x4fa4('0x2a')]=function(_0x1545dc){if(this[_0x4fa4('0xc')][_0x1545dc]&&this[_0x4fa4('0xc')][_0x1545dc]['Imap']){if(this[_0x4fa4('0xd')][this[_0x4fa4('0xc')][_0x1545dc][_0x4fa4('0x11')]['id']]){delete this[_0x4fa4('0xd')][this[_0x4fa4('0xc')][_0x1545dc][_0x4fa4('0x11')]['id']];}this['mailAccounts'][_0x1545dc][_0x4fa4('0x11')][_0x4fa4('0x2b')]=moment();this[_0x4fa4('0x16')](_0x1545dc);}};EmailChannel[_0x4fa4('0x18')][_0x4fa4('0x1f')]=function(_0x54a3a4,_0x570318){if(this[_0x4fa4('0xc')][_0x54a3a4]){this[_0x4fa4('0xc')][_0x54a3a4][_0x4fa4('0x11')][_0x4fa4('0x12')]='error';this[_0x4fa4('0xc')][_0x54a3a4][_0x4fa4('0x11')]['messageStatus']=_0x570318;return this[_0x4fa4('0x16')](_0x54a3a4);}};EmailChannel[_0x4fa4('0x18')][_0x4fa4('0x2c')]=function(_0x3edc42,_0x337c93){return this[_0x4fa4('0x2d')][_0x4fa4('0x2e')](_0x3edc42,_0x337c93);};EmailChannel[_0x4fa4('0x18')][_0x4fa4('0x2f')]=function(_0x8c277f){var _0x1f3310=this;if(this[_0x4fa4('0xc')][_0x8c277f['id']]){if(_[_0x4fa4('0x20')](this['mailAccounts'][_0x8c277f['id']]['Smtp'])){this[_0x4fa4('0xc')][_0x8c277f['id']][_0x4fa4('0x30')]={};}this[_0x4fa4('0xc')][_0x8c277f['id']][_0x4fa4('0x30')][_0x4fa4('0x2b')]=moment();return new BPromise(function(_0x3e8960,_0x25ced8){return _0x1f3310[_0x4fa4('0x2d')][_0x4fa4('0x31')](_0x8c277f)[_0x4fa4('0x26')](function(_0x5cd36c){_0x1f3310[_0x4fa4('0xc')][_0x8c277f['id']][_0x4fa4('0x30')][_0x4fa4('0x12')]=_0x4fa4('0x32');_0x1f3310[_0x4fa4('0xc')][_0x8c277f['id']][_0x4fa4('0x30')][_0x4fa4('0x13')]='';_0x1f3310[_0x4fa4('0x16')](_0x8c277f['id']);_0x3e8960(_0x5cd36c);})[_0x4fa4('0x33')](function(_0x122438){_0x1f3310[_0x4fa4('0xc')][_0x8c277f['id']][_0x4fa4('0x30')]['status']=_0x4fa4('0x1e');_0x1f3310['mailAccounts'][_0x8c277f['id']]['Smtp'][_0x4fa4('0x13')]=_0x122438;_0x1f3310[_0x4fa4('0x16')](_0x8c277f['id']);_0x25ced8(_0x122438);});});}return this[_0x4fa4('0x2d')][_0x4fa4('0x31')](_0x8c277f);};module['exports']=EmailChannel;
\ No newline at end of file
diff --git a/server/services/email/lib/imap.js b/server/services/email/lib/imap.js
index fa2c53b..7bc9187 100644
--- a/server/services/email/lib/imap.js
+++ b/server/services/email/lib/imap.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xd6ae=['message','handleFetchMessage','error','handleFetchError','handleFetchEnd','closeBox','attributes','handleMessageAttributes','handleMessageBody','handleMessageEnd','handleEnd','stringify','hasOwnProperty','upperFirst','path','util','imap','lodash','randomstring','mailparser','simpleParser','Iconv','events','./utils','account','once','handleReady','bind','connect','inherits','prototype','connTimeout','authTimeout','service','authentication','user','password','host','port','tls','autotls','required','getHost','email','anonymous@xcally.com','openBox','handleOpenBox','emit','box','handleCloseBox','handleError','end','readUnseen','UNSEEN','handleReadUnseen','length'];(function(_0x4b055c,_0x4b870b){var _0x4b62bb=function(_0x4884c2){while(--_0x4884c2){_0x4b055c['push'](_0x4b055c['shift']());}};_0x4b62bb(++_0x4b870b);}(_0xd6ae,0x15e));var _0xed6a=function(_0x1fb917,_0x19eea1){_0x1fb917=_0x1fb917-0x0;var _0xa08321=_0xd6ae[_0x1fb917];return _0xa08321;};'use strict';var fs=require('fs');var path=require(_0xed6a('0x0'));var util=require(_0xed6a('0x1'));var Imap=require(_0xed6a('0x2'));var _=require(_0xed6a('0x3'));var rs=require(_0xed6a('0x4'));var simpleParser=require(_0xed6a('0x5'))[_0xed6a('0x6')];var Iconv=require('iconv')[_0xed6a('0x7')];var EventEmitter=require(_0xed6a('0x8'))['EventEmitter'];var utils=require(_0xed6a('0x9'));var logger=require('../../../config/logger')('email');function EmailImap(_0x37bec3,_0x21b5a4){this['mailbox']='INBOX';this[_0xed6a('0xa')]=this['getAccount'](_0x37bec3,_0x21b5a4);this[_0xed6a('0x2')]=new Imap(this['account']);this[_0xed6a('0x2')][_0xed6a('0xb')]('ready',this[_0xed6a('0xc')]['bind'](this));this[_0xed6a('0x2')][_0xed6a('0xb')]('end',this['handleEnd']['bind'](this));this[_0xed6a('0x2')]['on']('error',this['handleError'][_0xed6a('0xd')](this));this[_0xed6a('0x2')][_0xed6a('0xe')]();}util[_0xed6a('0xf')](EmailImap,EventEmitter);EmailImap[_0xed6a('0x10')]['getAccount']=function(_0x17e42c,_0x4dc902){var _0xb8ef6e={'connTimeout':_0x17e42c[_0xed6a('0x11')]?_0x17e42c[_0xed6a('0x11')]*0x3e8:0x2710,'authTimeout':_0x17e42c[_0xed6a('0x12')]?_0x17e42c['authTimeout']*0x3e8:0x1388};if(_['isNil'](_0x17e42c[_0xed6a('0x13')])){if(_0x17e42c[_0xed6a('0x14')]){_0xb8ef6e[_0xed6a('0x15')]=_0x17e42c[_0xed6a('0x15')];_0xb8ef6e[_0xed6a('0x16')]=_0x17e42c[_0xed6a('0x16')];}_0xb8ef6e[_0xed6a('0x17')]=_0x17e42c['host'];_0xb8ef6e[_0xed6a('0x18')]=_0x17e42c[_0xed6a('0x18')]||0x3e1;if(_0x17e42c[_0xed6a('0x19')]){_0xb8ef6e[_0xed6a('0x19')]=!![];}else{_0xb8ef6e[_0xed6a('0x19')]=![];_0xb8ef6e[_0xed6a('0x1a')]=_0xed6a('0x1b');}}else{_0xb8ef6e[_0xed6a('0x15')]=_0x17e42c[_0xed6a('0x15')];_0xb8ef6e[_0xed6a('0x16')]=_0x17e42c[_0xed6a('0x16')];_0xb8ef6e[_0xed6a('0x17')]=utils[_0xed6a('0x1c')](_0x17e42c[_0xed6a('0x13')]);_0xb8ef6e[_0xed6a('0x18')]=0x3e1;_0xb8ef6e[_0xed6a('0x19')]=!![];}_0xb8ef6e[_0xed6a('0x1d')]=_0x4dc902||_0x17e42c[_0xed6a('0x15')]||_0xed6a('0x1e');return _0xb8ef6e;};EmailImap[_0xed6a('0x10')]['handleReady']=function(){this[_0xed6a('0x2')][_0xed6a('0x1f')](this['mailbox'],![],this[_0xed6a('0x20')][_0xed6a('0xd')](this));};EmailImap['prototype']['handleOpenBox']=function(_0x38fb71,_0x2beb05){if(_0x38fb71){this['handleError'](_0x38fb71,!![]);}else{this[_0xed6a('0x21')](_0xed6a('0x22'),_0x2beb05);this['readUnseen']();}};EmailImap[_0xed6a('0x10')][_0xed6a('0x23')]=function(_0x35e970){if(_0x35e970){this[_0xed6a('0x24')](_0x35e970,!![]);}else{this[_0xed6a('0x2')][_0xed6a('0x25')]();}};EmailImap['prototype'][_0xed6a('0x26')]=function(){this[_0xed6a('0x2')]['search']([_0xed6a('0x27')],this[_0xed6a('0x28')][_0xed6a('0xd')](this));};EmailImap[_0xed6a('0x10')][_0xed6a('0x28')]=function(_0xa30d6d,_0x2fdbef){if(_0xa30d6d){this[_0xed6a('0x24')](_0xa30d6d,!![]);}else{if(_0x2fdbef[_0xed6a('0x29')]){try{var _0x4ca9e4=this[_0xed6a('0x2')]['fetch'](_0x2fdbef,{'bodies':'','markSeen':!![]});_0x4ca9e4['on'](_0xed6a('0x2a'),this[_0xed6a('0x2b')][_0xed6a('0xd')](this));_0x4ca9e4['once'](_0xed6a('0x2c'),this[_0xed6a('0x2d')]['bind'](this));_0x4ca9e4[_0xed6a('0xb')]('end',this[_0xed6a('0x2e')][_0xed6a('0xd')](this));}catch(_0x240524){logger['error'](_0x240524);}}else{this[_0xed6a('0x2')][_0xed6a('0x2f')](!![],this[_0xed6a('0x23')][_0xed6a('0xd')](this));}}};EmailImap[_0xed6a('0x10')]['handleFetchMessage']=function(_0x3e9a10,_0x1175d0){_0x3e9a10['on']('body',this['handleMessageBody']['bind'](this));_0x3e9a10[_0xed6a('0xb')](_0xed6a('0x30'),this[_0xed6a('0x31')][_0xed6a('0xd')](this));_0x3e9a10[_0xed6a('0xb')](_0xed6a('0x25'),this['handleMessageEnd'][_0xed6a('0xd')](this));};EmailImap[_0xed6a('0x10')][_0xed6a('0x32')]=function(_0x63aced,_0x104280){simpleParser(_0x63aced,{'Iconv':Iconv},this['handleSimpleParser']['bind'](this));};EmailImap[_0xed6a('0x10')]['handleMessageAttributes']=function(_0x45115d){};EmailImap[_0xed6a('0x10')][_0xed6a('0x33')]=function(){};EmailImap['prototype']['handleSimpleParser']=function(_0x18c4c8,_0x4af55f){if(_0x18c4c8){logger['error'](_0x18c4c8);}else{var _0x59d0f3=this;utils['parser'](this[_0xed6a('0xa')],_0x4af55f,function(_0x2193df){_0x59d0f3[_0xed6a('0x21')](_0xed6a('0x1d'),_0x2193df);});}};EmailImap[_0xed6a('0x10')][_0xed6a('0x2e')]=function(){this[_0xed6a('0x2')][_0xed6a('0x2f')](!![],this[_0xed6a('0x23')][_0xed6a('0xd')](this));};EmailImap[_0xed6a('0x10')][_0xed6a('0x2d')]=function(_0x2dde85){this[_0xed6a('0x24')](_0x2dde85);this[_0xed6a('0x2')][_0xed6a('0x2f')](!![],this[_0xed6a('0x23')][_0xed6a('0xd')](this));};EmailImap[_0xed6a('0x10')][_0xed6a('0x34')]=function(){this[_0xed6a('0x21')](_0xed6a('0x25'));};EmailImap[_0xed6a('0x10')][_0xed6a('0x24')]=function(_0x4b6f61,_0x3fb3fd){logger[_0xed6a('0x2c')](_0xed6a('0x24'),this[_0xed6a('0xa')]['email'],JSON[_0xed6a('0x35')](_0x4b6f61));var _0x2c8926='';if(_0x4b6f61){if(_0x4b6f61['textCode']){_0x2c8926=_0x4b6f61['textCode'];}else{for(var _0x2da3ac in _0x4b6f61){if(_0x4b6f61[_0xed6a('0x36')](_0x2da3ac)){_0x2c8926+=_[_0xed6a('0x37')](_0x2da3ac)+':\x20'+_0x4b6f61[_0x2da3ac]+'\x0a';}}}}if(_0x3fb3fd){this[_0xed6a('0x2')][_0xed6a('0x25')]();}else{this['emit'](_0xed6a('0x2c'),_0x2c8926);this[_0xed6a('0x21')](_0xed6a('0x25'));}};module['exports']=EmailImap;
\ No newline at end of file
+var _0x70e3=['error','handleError','connect','prototype','connTimeout','authTimeout','isNil','service','authentication','user','password','host','port','tls','autotls','required','getHost','email','openBox','mailbox','handleOpenBox','box','readUnseen','handleCloseBox','search','UNSEEN','handleReadUnseen','length','fetch','message','handleFetchError','end','handleFetchEnd','closeBox','handleFetchMessage','body','handleMessageBody','attributes','handleMessageAttributes','handleMessageEnd','handleSimpleParser','parser','emit','stringify','textCode','hasOwnProperty','upperFirst','exports','imap','randomstring','simpleParser','iconv','Iconv','EventEmitter','./utils','../../../config/logger','INBOX','account','getAccount','once','handleReady','bind','handleEnd'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x70e3,0xae));var _0x370e=function(_0x164eca,_0x555e28){_0x164eca=_0x164eca-0x0;var _0x2ce562=_0x70e3[_0x164eca];return _0x2ce562;};'use strict';var fs=require('fs');var path=require('path');var util=require('util');var Imap=require(_0x370e('0x0'));var _=require('lodash');var rs=require(_0x370e('0x1'));var simpleParser=require('mailparser')[_0x370e('0x2')];var Iconv=require(_0x370e('0x3'))[_0x370e('0x4')];var EventEmitter=require('events')[_0x370e('0x5')];var utils=require(_0x370e('0x6'));var logger=require(_0x370e('0x7'))('email');function EmailImap(_0x1043cf,_0x45a78b){this['mailbox']=_0x370e('0x8');this[_0x370e('0x9')]=this[_0x370e('0xa')](_0x1043cf,_0x45a78b);this['imap']=new Imap(this[_0x370e('0x9')]);this[_0x370e('0x0')][_0x370e('0xb')]('ready',this[_0x370e('0xc')][_0x370e('0xd')](this));this['imap']['once']('end',this[_0x370e('0xe')]['bind'](this));this['imap']['on'](_0x370e('0xf'),this[_0x370e('0x10')]['bind'](this));this['imap'][_0x370e('0x11')]();}util['inherits'](EmailImap,EventEmitter);EmailImap[_0x370e('0x12')]['getAccount']=function(_0x21cc48,_0x575fe6){var _0x329cda={'connTimeout':_0x21cc48['connTimeout']?_0x21cc48[_0x370e('0x13')]*0x3e8:0x2710,'authTimeout':_0x21cc48[_0x370e('0x14')]?_0x21cc48['authTimeout']*0x3e8:0x1388};if(_[_0x370e('0x15')](_0x21cc48[_0x370e('0x16')])){if(_0x21cc48[_0x370e('0x17')]){_0x329cda[_0x370e('0x18')]=_0x21cc48[_0x370e('0x18')];_0x329cda[_0x370e('0x19')]=_0x21cc48[_0x370e('0x19')];}_0x329cda[_0x370e('0x1a')]=_0x21cc48['host'];_0x329cda[_0x370e('0x1b')]=_0x21cc48[_0x370e('0x1b')]||0x3e1;if(_0x21cc48[_0x370e('0x1c')]){_0x329cda[_0x370e('0x1c')]=!![];}else{_0x329cda[_0x370e('0x1c')]=![];_0x329cda[_0x370e('0x1d')]=_0x370e('0x1e');}}else{_0x329cda[_0x370e('0x18')]=_0x21cc48['user'];_0x329cda[_0x370e('0x19')]=_0x21cc48['password'];_0x329cda[_0x370e('0x1a')]=utils[_0x370e('0x1f')](_0x21cc48[_0x370e('0x16')]);_0x329cda[_0x370e('0x1b')]=0x3e1;_0x329cda[_0x370e('0x1c')]=!![];}_0x329cda[_0x370e('0x20')]=_0x575fe6||_0x21cc48[_0x370e('0x18')]||'anonymous@xcally.com';return _0x329cda;};EmailImap[_0x370e('0x12')][_0x370e('0xc')]=function(){this['imap'][_0x370e('0x21')](this[_0x370e('0x22')],![],this[_0x370e('0x23')][_0x370e('0xd')](this));};EmailImap[_0x370e('0x12')][_0x370e('0x23')]=function(_0x51f278,_0x3d841b){if(_0x51f278){this[_0x370e('0x10')](_0x51f278,!![]);}else{this['emit'](_0x370e('0x24'),_0x3d841b);this[_0x370e('0x25')]();}};EmailImap[_0x370e('0x12')][_0x370e('0x26')]=function(_0x46861f){if(_0x46861f){this[_0x370e('0x10')](_0x46861f,!![]);}else{this[_0x370e('0x0')]['end']();}};EmailImap['prototype']['readUnseen']=function(){this[_0x370e('0x0')][_0x370e('0x27')]([_0x370e('0x28')],this[_0x370e('0x29')][_0x370e('0xd')](this));};EmailImap[_0x370e('0x12')][_0x370e('0x29')]=function(_0x19d56d,_0x2fb8ed){if(_0x19d56d){this['handleError'](_0x19d56d,!![]);}else{if(_0x2fb8ed[_0x370e('0x2a')]){try{var _0x581328=this[_0x370e('0x0')][_0x370e('0x2b')](_0x2fb8ed,{'bodies':'','markSeen':!![]});_0x581328['on'](_0x370e('0x2c'),this['handleFetchMessage']['bind'](this));_0x581328['once'](_0x370e('0xf'),this[_0x370e('0x2d')]['bind'](this));_0x581328['once'](_0x370e('0x2e'),this[_0x370e('0x2f')][_0x370e('0xd')](this));}catch(_0x1ea0cc){logger[_0x370e('0xf')](_0x1ea0cc);}}else{this[_0x370e('0x0')][_0x370e('0x30')](!![],this[_0x370e('0x26')][_0x370e('0xd')](this));}}};EmailImap[_0x370e('0x12')][_0x370e('0x31')]=function(_0x4331e7,_0x629c79){_0x4331e7['on'](_0x370e('0x32'),this[_0x370e('0x33')][_0x370e('0xd')](this));_0x4331e7[_0x370e('0xb')](_0x370e('0x34'),this[_0x370e('0x35')][_0x370e('0xd')](this));_0x4331e7[_0x370e('0xb')]('end',this[_0x370e('0x36')][_0x370e('0xd')](this));};EmailImap['prototype'][_0x370e('0x33')]=function(_0x19c0f8,_0xb8a03b){simpleParser(_0x19c0f8,{'Iconv':Iconv},this[_0x370e('0x37')][_0x370e('0xd')](this));};EmailImap[_0x370e('0x12')][_0x370e('0x35')]=function(_0x32bca1){};EmailImap[_0x370e('0x12')][_0x370e('0x36')]=function(){};EmailImap[_0x370e('0x12')][_0x370e('0x37')]=function(_0xfa354f,_0x289d8b){if(_0xfa354f){logger['error'](_0xfa354f);}else{var _0x334991=this;utils[_0x370e('0x38')](this[_0x370e('0x9')],_0x289d8b,function(_0x8c8c31){_0x334991[_0x370e('0x39')]('email',_0x8c8c31);});}};EmailImap['prototype']['handleFetchEnd']=function(){this[_0x370e('0x0')]['closeBox'](!![],this[_0x370e('0x26')]['bind'](this));};EmailImap[_0x370e('0x12')][_0x370e('0x2d')]=function(_0x2f831d){this[_0x370e('0x10')](_0x2f831d);this[_0x370e('0x0')][_0x370e('0x30')](!![],this[_0x370e('0x26')][_0x370e('0xd')](this));};EmailImap[_0x370e('0x12')]['handleEnd']=function(){this['emit'](_0x370e('0x2e'));};EmailImap['prototype'][_0x370e('0x10')]=function(_0x310474,_0x490978){logger['error'](_0x370e('0x10'),this[_0x370e('0x9')][_0x370e('0x20')],JSON[_0x370e('0x3a')](_0x310474));var _0x54ceba='';if(_0x310474){if(_0x310474['textCode']){_0x54ceba=_0x310474[_0x370e('0x3b')];}else{for(var _0x2e470a in _0x310474){if(_0x310474[_0x370e('0x3c')](_0x2e470a)){_0x54ceba+=_[_0x370e('0x3d')](_0x2e470a)+':\x20'+_0x310474[_0x2e470a]+'\x0a';}}}}if(_0x490978){this[_0x370e('0x0')][_0x370e('0x2e')]();}else{this[_0x370e('0x39')](_0x370e('0xf'),_0x54ceba);this['emit'](_0x370e('0x2e'));}};module[_0x370e('0x3e')]=EmailImap;
\ No newline at end of file
diff --git a/server/services/email/lib/smtp.js b/server/services/email/lib/smtp.js
index 68e026f..1c7b1ca 100644
--- a/server/services/email/lib/smtp.js
+++ b/server/services/email/lib/smtp.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7021=['prototype','createTransport','use','compile','sendMail','toString','verify','Not\x20verifired','nodemailer'];(function(_0x4d4de0,_0x192e68){var _0x21602b=function(_0x3067ca){while(--_0x3067ca){_0x4d4de0['push'](_0x4d4de0['shift']());}};_0x21602b(++_0x192e68);}(_0x7021,0xce));var _0x1702=function(_0xcbb8db,_0x1f0a12){_0xcbb8db=_0xcbb8db-0x0;var _0x2fdcac=_0x7021[_0xcbb8db];return _0x2fdcac;};'use strict';var nodemailer=require(_0x1702('0x0'));var BPromise=require('bluebird');var inlineBase64=require('nodemailer-plugin-inline-base64');function EmailSmtp(){}EmailSmtp[_0x1702('0x1')]['send']=function(_0x1d79e6,_0x35b610){return new BPromise(function(_0x4508e8,_0x164581){var _0x30557d=nodemailer[_0x1702('0x2')](_0x1d79e6);_0x30557d[_0x1702('0x3')](_0x1702('0x4'),inlineBase64());_0x30557d[_0x1702('0x5')](_0x35b610,function(_0x412f0f,_0x158f00){if(_0x412f0f){_0x164581(_0x412f0f[_0x1702('0x6')]());}else{_0x4508e8(_0x158f00);}});});};EmailSmtp[_0x1702('0x1')][_0x1702('0x7')]=function(_0x12426e){return new BPromise(function(_0x2758f8,_0x200263){var _0x4bb81f=nodemailer[_0x1702('0x2')](_0x12426e);_0x4bb81f['verify'](function(_0x4239e8,_0x28cc3f){if(_0x4239e8){_0x200263(_0x4239e8['toString']());}else{if(_0x28cc3f){_0x2758f8(_0x28cc3f);}else{_0x200263(_0x1702('0x8'));}}});});};module['exports']=EmailSmtp;
\ No newline at end of file
+var _0x7838=['exports','nodemailer','bluebird','nodemailer-plugin-inline-base64','prototype','send','createTransport','use','compile','verify','toString','Not\x20verifired'];(function(_0x424b56,_0x10cb4f){var _0x4a982c=function(_0x225ec3){while(--_0x225ec3){_0x424b56['push'](_0x424b56['shift']());}};_0x4a982c(++_0x10cb4f);}(_0x7838,0x1b1));var _0x8783=function(_0x376b45,_0x5964fb){_0x376b45=_0x376b45-0x0;var _0x2341b3=_0x7838[_0x376b45];return _0x2341b3;};'use strict';var nodemailer=require(_0x8783('0x0'));var BPromise=require(_0x8783('0x1'));var inlineBase64=require(_0x8783('0x2'));function EmailSmtp(){}EmailSmtp[_0x8783('0x3')][_0x8783('0x4')]=function(_0x54139d,_0x30cb7a){return new BPromise(function(_0xc4e3,_0x4a1830){var _0x433ee0=nodemailer[_0x8783('0x5')](_0x54139d);_0x433ee0[_0x8783('0x6')](_0x8783('0x7'),inlineBase64());_0x433ee0['sendMail'](_0x30cb7a,function(_0x21ae83,_0xac9431){if(_0x21ae83){_0x4a1830(_0x21ae83['toString']());}else{_0xc4e3(_0xac9431);}});});};EmailSmtp['prototype'][_0x8783('0x8')]=function(_0x24b386){return new BPromise(function(_0x1ffb32,_0x198856){var _0x59789e=nodemailer[_0x8783('0x5')](_0x24b386);_0x59789e['verify'](function(_0xe5dba,_0x307a27){if(_0xe5dba){_0x198856(_0xe5dba[_0x8783('0x9')]());}else{if(_0x307a27){_0x1ffb32(_0x307a27);}else{_0x198856(_0x8783('0xa'));}}});});};module[_0x8783('0xb')]=EmailSmtp;
\ No newline at end of file
diff --git a/server/services/email/lib/utils.js b/server/services/email/lib/utils.js
index 0c7b4ad..99f237d 100644
--- a/server/services/email/lib/utils.js
+++ b/server/services/email/lib/utils.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xbc46=['join','Anonymous','pop','isEmpty','generate','test','html','replace','body','textAsHtml','Empty\x20message ','Attachments','Title','Data','getHost','gmail','imap.gmail.com','yahoo','hotmail','imap-mail.outlook.com','outlook365','outlook.office365.com','lodash','moment','randomstring','path','../../../config/logger','email','../../../config/environment','head','value','address','anonymous','@xcally.com','name','length','slice'];(function(_0x26b308,_0x397dfc){var _0x59478d=function(_0x20b4c4){while(--_0x20b4c4){_0x26b308['push'](_0x26b308['shift']());}};_0x59478d(++_0x397dfc);}(_0xbc46,0x1b1));var _0x6bc4=function(_0x55b8f0,_0x4d0a1c){_0x55b8f0=_0x55b8f0-0x0;var _0x12ec10=_0xbc46[_0x55b8f0];return _0x12ec10;};'use strict';var _=require(_0x6bc4('0x0'));var moment=require(_0x6bc4('0x1'));var random=require(_0x6bc4('0x2'));var fs=require('fs');var path=require(_0x6bc4('0x3'));var util=require('util');var tnef=require('node-tnef');var logger=require(_0x6bc4('0x4'))(_0x6bc4('0x5'));var config=require(_0x6bc4('0x6'));function getAddress(_0x56b6da){var _0x17d3e4=_[_0x6bc4('0x7')](_0x56b6da[_0x6bc4('0x8')]);return _0x17d3e4&&_0x17d3e4[_0x6bc4('0x9')]?_0x17d3e4[_0x6bc4('0x9')]:_0x6bc4('0xa')+random['generate'](0x6)+_0x6bc4('0xb');}function getFirstName(_0x4872d4){var _0x58b22a=_[_0x6bc4('0x7')](_0x4872d4[_0x6bc4('0x8')]);if(_0x58b22a&&_0x58b22a[_0x6bc4('0xc')]){var _0x24746a=_0x58b22a['name']['split'](/\s+/);return _0x24746a[_0x6bc4('0xd')]?_0x24746a[_0x6bc4('0xe')](0x0,-0x1)[_0x6bc4('0xf')]('\x20'):_0x58b22a[_0x6bc4('0xc')];}return _0x6bc4('0x10');}function getLastName(_0x5ed468){var _0x46236c=_[_0x6bc4('0x7')](_0x5ed468[_0x6bc4('0x8')]);if(_0x46236c&&_0x46236c['name']){var _0x3e434c=_0x46236c[_0x6bc4('0xc')]['split'](/\s+/);return _0x3e434c[_0x6bc4('0xd')]>0x1?_0x3e434c[_0x6bc4('0x11')]():'';}return'';}function getMails(_0x52d7f2,_0x474bf7){var _0x2c582c='';for(var _0x57d5b7=0x0;_0x57d5b7<_0x474bf7[_0x6bc4('0x8')][_0x6bc4('0xd')];_0x57d5b7+=0x1){if(_0x474bf7[_0x6bc4('0x8')][_0x57d5b7][_0x6bc4('0x9')]!==_0x52d7f2){if(!_[_0x6bc4('0x12')](_0x2c582c)){_0x2c582c+=',';}_0x2c582c+=_0x474bf7[_0x6bc4('0x8')][_0x57d5b7]['name']||_0x474bf7[_0x6bc4('0x8')][_0x57d5b7][_0x6bc4('0x9')]||'';_0x2c582c+='\x20<';_0x2c582c+=_0x474bf7[_0x6bc4('0x8')][_0x57d5b7]['address']?_0x474bf7[_0x6bc4('0x8')][_0x57d5b7]['address']:_0x6bc4('0xa')+random[_0x6bc4('0x13')](0x6)+_0x6bc4('0xb');_0x2c582c+='>';}}return _0x2c582c;}function parseEmail(_0x3c54d3,_0x31332a,_0x49acc8){if(_0x31332a['html']){var _0x24692a=/